Compare commits
2392 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 0437a6a1da | |||
| 8ffd80bc3c | |||
| 8161d5e05c | |||
| 0d0c76ddc1 | |||
| 78f5684d99 | |||
| 3b29b27771 | |||
| db84695991 | |||
| de34f5b77c | |||
| 696a172d0a | |||
| a639ccbe28 | |||
| 787201a31e | |||
| ff56b067c4 | |||
| d93650de66 | |||
| 1ca87176c4 | |||
| a82df535fa | |||
| 01b7ecc18b | |||
| 197e609124 | |||
| 545dc8bbbc | |||
| 01da9c940f | |||
| 817344154c | |||
| 1c558a9c0d | |||
| e95c9aa28d | |||
| 62737a7950 | |||
| 43693bbae7 | |||
| baf791b5d3 | |||
| cd615422bb | |||
| cae16d32b1 | |||
| 95620911c0 | |||
| 40d9591981 | |||
| d7bf561fad | |||
| acb0fa8425 | |||
| c9aca9e2dc | |||
| 2d8e2a2088 | |||
| 2e5906ef0c | |||
| 6cbf21e7fe | |||
| a6dbb75cce | |||
| 4cc6ae7edd | |||
| 0979d8c71e | |||
| 57868c74bc | |||
| a3abd5bcc6 | |||
| 00cdb03cea | |||
| 4d1bba8bbe | |||
| c733e4b9af | |||
| 9e47869388 | |||
| cf96d030a9 | |||
| ece990ec01 | |||
| c533fcf832 | |||
| 07b34d7ef2 | |||
| 82e243c07f | |||
| 7daae41cf4 | |||
| 9d6d2f24c4 | |||
| 5656841982 | |||
| c76a403b55 | |||
| 5c112e1480 | |||
| 17ae49dd4a | |||
| 7d9689028f | |||
| a339407086 | |||
| ad3de43e6a | |||
| ece782625a | |||
| 2f8d827c8e | |||
| 4b46b78be8 | |||
| f56ae59586 | |||
| 1d8805f3fa | |||
| 5bfa00de3f | |||
| 9c5677b5f5 | |||
| 2bb67b30a6 | |||
| b2c9ec1577 | |||
| 65bb5e001e | |||
| 85b1ebc033 | |||
| e7183e60a4 | |||
| a368fefb0f | |||
| 2041eee0a9 | |||
| 307db0d9e0 | |||
| d5883b5fb1 | |||
| 6a75336347 | |||
| d3f0d9e289 | |||
| 8340844cd8 | |||
| 2a0dfe1868 | |||
| 22d20a9cf8 | |||
| 483e0ff312 | |||
| 1f58f281c5 | |||
| 49f5e895ed | |||
| 03ee927084 | |||
| 46831513b5 | |||
| 9262b40ae4 | |||
| e4bc1b7c57 | |||
| 6be0f9009e | |||
| eff3d172ad | |||
| 6c7d45cc16 | |||
| 5fd829aa52 | |||
| d5f89e5dc7 | |||
| 504403e0ce | |||
| 90fc36b064 | |||
| 49dc432d8f | |||
| 3e2e6fe7f8 | |||
| 82fb42c93c | |||
| 7113766aa4 | |||
| b67916f9cd | |||
| 2d77a2a3af | |||
| 7fd45e85d0 | |||
| 009bd0458c | |||
| dc35824b53 | |||
| 48c7e1fe2a | |||
| 4c4f5e9f56 | |||
| ef744c5525 | |||
| 7e1e43d186 | |||
| 4c0daa7b57 | |||
| 5198b22302 | |||
| 293b61c714 | |||
| 171f72276b | |||
| 59f3f4039f | |||
| c23e4aed6c | |||
| 439a5fb9ed | |||
| 8645051fab | |||
| cfb9e3fe21 | |||
| d7cba9f752 | |||
| 518d9b5bc0 | |||
| b04f1eb44a | |||
| 52c3ee670e | |||
| 0afc96717a | |||
| f5f624027c | |||
| 32f939e79b | |||
| 49f497ba40 | |||
| 257f787d7e | |||
| 6c357fa2c9 | |||
| 859aa2e8c2 | |||
| b02ab12ea2 | |||
| f478dc5c45 | |||
| b8bc5a7b25 | |||
| 3d291f7d70 | |||
| 19c93f3bc2 | |||
| eacc97927a | |||
| e475dc46ff | |||
| ae9e074aff | |||
| efad1cf3d6 | |||
| 15a42427c4 | |||
| c118da5524 | |||
| 6ecb916e70 | |||
| 2974c54cb1 | |||
| 7737b34e49 | |||
| 9e7a74c0b2 | |||
| 7f4a0cb3b1 | |||
| dd1e9f9777 | |||
| 575b2ce302 | |||
| 7af47f6b90 | |||
| c5f2101744 | |||
| daa842c88b | |||
| beff3aa23d | |||
| 6dc7e01410 | |||
| c5f06e6531 | |||
| 7fa9498417 | |||
| 2cb272f3fa | |||
| a7603358d1 | |||
| 9244f91cc4 | |||
| facf3a3838 | |||
| ca9dd45ea8 | |||
| ef902addc5 | |||
| f75288aa5b | |||
| ea767e2f0d | |||
| e8e733620a | |||
| b182d91f90 | |||
| 5ebf79b895 | |||
| 379bc45587 | |||
| 1bbba41719 | |||
| 9b4a00ad2e | |||
| eebcbf3c61 | |||
| 86ffd5c2fa | |||
| b58b819012 | |||
| 73ff14cd8c | |||
| e93d2c1090 | |||
| 73864981c7 | |||
| 82e7b9716f | |||
| 39bfcc8867 | |||
| 29cf1f608c | |||
| d338869491 | |||
| 18a2649452 | |||
| 4518131c58 | |||
| b4f9e8139d | |||
| 14c8c5e357 | |||
| fdc1a6c6d8 | |||
| c266bb9fba | |||
| 521aa1f30f | |||
| 79c36ebc3f | |||
| d70ad0a2ce | |||
| 5e93e734fe | |||
| d6426f85cb | |||
| b0507b7c91 | |||
| 59f5d337ff | |||
| 6fa9547df3 | |||
| dce2ebdf21 | |||
| 2ef337b379 | |||
| af017d5b96 | |||
| 3db8f03679 | |||
| aaba2d6d3b | |||
| d342bdc6d1 | |||
| 545ad70c15 | |||
| 8897d27526 | |||
| fd05d90e5a | |||
| 6ee607f8ed | |||
| 50fe2c7104 | |||
| 57bef43546 | |||
| ff5f35069a | |||
| 986488955e | |||
| 4fe312bc1f | |||
| 0b2285d621 | |||
| 58d2b42818 | |||
| 5b5ef7ce6a | |||
| 9e5bb85684 | |||
| 3522136133 | |||
| 5b88d6032c | |||
| 91934d490c | |||
| ead4a85c30 | |||
| 3ab096c7bd | |||
| 5746f4ca9c | |||
| 2bb7dd9bac | |||
| cec149a6d0 | |||
| 908c365d3e | |||
| ff3769a6b4 | |||
| 73333b0af6 | |||
| 208cc86ca9 | |||
| 4c36416aaa | |||
| 3817112743 | |||
| 945beeac94 | |||
| 1ef319b69f | |||
| 9688f48263 | |||
| fc7ecb81d3 | |||
| 3d9632c061 | |||
| eae9b5d7fd | |||
| 1de6840abe | |||
| 5b3999963f | |||
| 04ff8c6f3f | |||
| e62b8a4476 | |||
| 6335f1016d | |||
| 794f5f685d | |||
| 523c253d77 | |||
| 5e81d8ad64 | |||
| 5b451558f4 | |||
| 636566920b | |||
| 012d5d0e0a | |||
| aff09c13db | |||
| e7a5f8e799 | |||
| 18b4b10da0 | |||
| 96f706a92e | |||
| ff8809a8c4 | |||
| a16121b7ea | |||
| 7fd4b7526d | |||
| 3cfce434ba | |||
| 01a76511ca | |||
| a278488d0a | |||
| c851c02845 | |||
| 13ae920d71 | |||
| c944ec0f19 | |||
| cd0aa8fad5 | |||
| 953e4ba2ed | |||
| 23c05e83eb | |||
| ddd7080774 | |||
| a791f86881 | |||
| c78261e78c | |||
| b2f3a7e425 | |||
| 02929f47d2 | |||
| 013812de4d | |||
| e45237acaa | |||
| ebf2e3c562 | |||
| 6e0d1b59d2 | |||
| bb8b64cf09 | |||
| 50bb31cc46 | |||
| ceed70560f | |||
| 0952d85022 | |||
| 903d02b598 | |||
| 7523b28ed3 | |||
| ef13701022 | |||
| 9d3221c734 | |||
| a79d056a1a | |||
| 98949a4a96 | |||
| a4eefd9856 | |||
| 9fdbd37085 | |||
| 86f52e663b | |||
| 73ca6fa7cf | |||
| e2e32c0648 | |||
| 4930d6329a | |||
| 09c6496ef2 | |||
| 196e5e2bc8 | |||
| 5e9b6b6819 | |||
| b11079b996 | |||
| c9f0cd83a8 | |||
| a1f2c4880a | |||
| 99f99b4e31 | |||
| 739461b493 | |||
| 8e83e3da02 | |||
| bddf99b610 | |||
| e527b053ba | |||
| b3fd4457c8 | |||
| 282b7ede67 | |||
| 1d996fe1d1 | |||
| 6d5ce19836 | |||
| e29fc1425c | |||
| 55fbd65bfe | |||
| 5ee7471d67 | |||
| 352d1b298e | |||
| ea493762e6 | |||
| 398d6bc480 | |||
| c7fb15ba92 | |||
| 82820641a9 | |||
| 5b7fa524b9 | |||
| e6139173d3 | |||
| 73f752be35 | |||
| 49f9704622 | |||
| a79dadb2a3 | |||
| 6dffb1ddba | |||
| 6020c78a2f | |||
| 47b607819e | |||
| 1cb9d2cc81 | |||
| f98ebb6fd6 | |||
| 679e33fabf | |||
| 1a78c75394 | |||
| be9a7cb28f | |||
| b09643a69a | |||
| 565863d77d | |||
| 6ddef70815 | |||
| 9de1305b75 | |||
| a7e977b4b7 | |||
| 41045c5a6a | |||
| e384a013db | |||
| 6493039b0b | |||
| 01c482e909 | |||
| 35aaba05f7 | |||
| 6d16b303ae | |||
| 678c64c1d5 | |||
| 3c03730fc3 | |||
| 6878be3e07 | |||
| 1a0b11bdd4 | |||
| 204e8bd33d | |||
| d4b446599a | |||
| 24ec07af5b | |||
| c1e3aff6f0 | |||
| ac8bfd011b | |||
| 52a2fb9214 | |||
| 06630c6cc6 | |||
| e7df8092a7 | |||
| 2f15639834 | |||
| ac5b21e753 | |||
| c1258b7b9e | |||
| 1f08fd9d08 | |||
| 88d2a18bbe | |||
| 7f7a16d38a | |||
| 0923703509 | |||
| ca468be5b0 | |||
| 1352c67fee | |||
| b5983bcfce | |||
| ba8dda9e4d | |||
| 09018363b3 | |||
| c58992c251 | |||
| 16d7b2c88d | |||
| 525119dd30 | |||
| 0918650cb2 | |||
| eb7e450a3b | |||
| 20e0f06e3a | |||
| d0d8925608 | |||
| 476712991c | |||
| 4af7a4f7be | |||
| 5ee73b40ed | |||
| 0977d4bae1 | |||
| d53b95223e | |||
| 42ede8ae08 | |||
| 79b41bac9e | |||
| d9d8047b71 | |||
| c213bb0dde | |||
| ecbd8acd0e | |||
| 63582c6aa1 | |||
| e2ea835a8f | |||
| 2121cc1abb | |||
| 7ba5e980a5 | |||
| 824c4403ef | |||
| 6b7dd80aff | |||
| 835ae6b10a | |||
| 11a6a46b4f | |||
| c41bbcc715 | |||
| 564fb6fddf | |||
| dcbf8bea88 | |||
| 3e99666c5b | |||
| 63ab391d87 | |||
| 2562cab0d0 | |||
| 758193655d | |||
| 318f9831f2 | |||
| 75b99b303b | |||
| 63c1f4e90a | |||
| a320089556 | |||
| 799b0fc98b | |||
| 1e6572d07b | |||
| 177f547bba | |||
| 2eff3aa0ef | |||
| 4ea7602be4 | |||
| 95865b3cab | |||
| bfe1bfb2c9 | |||
| bf4a014b44 | |||
| d8c07512b6 | |||
| ed68f5c5c8 | |||
| 16cf629aa3 | |||
| 2b1e86e87e | |||
| 643214d089 | |||
| c9ca0e653e | |||
| 18d4c6095b | |||
| 1c6a35d3d0 | |||
| 8e9c0bb87a | |||
| db92fda0a0 | |||
| 74cacdba88 | |||
| 7fb40f8aa8 | |||
| f11f1c059d | |||
| 83b5f1f4a2 | |||
| 3921184c94 | |||
| 949698f25b | |||
| ddd8c2bdec | |||
| 0203f7ddfa | |||
| 6b65d8522f | |||
| 5190d7135e | |||
| c62041fd4d | |||
| a4c3cceeaa | |||
| 213fb65d3c | |||
| b8e91273c0 | |||
| 54e7a1651d | |||
| 8b359b6507 | |||
| a760f04359 | |||
| 4f29b99976 | |||
| af9f2777e4 | |||
| 89f915ca1c | |||
| ca9d1b9391 | |||
| 46eb5da624 | |||
| 64641f9cda | |||
| 5061472733 | |||
| e2fe1d87db | |||
| 39b9681bff | |||
| 304352a291 | |||
| 84a0f7e306 | |||
| e1a20db931 | |||
| 280656c67e | |||
| b70f6468f2 | |||
| 564608b4ed | |||
| dce9aa280c | |||
| ef18ec7240 | |||
| d653cbe075 | |||
| 1f2ee09b71 | |||
| fd3f7a6959 | |||
| afd356aed7 | |||
| b2139028d5 | |||
| 88aa7c694d | |||
| 2df32242fa | |||
| c6488d5533 | |||
| 01157afaff | |||
| 872a9e4d5b | |||
| f63212a7f3 | |||
| b37b2d43d6 | |||
| 7001e762d0 | |||
| 8099b17219 | |||
| 9d40726f9c | |||
| a02e737bf8 | |||
| dbe1cabe1c | |||
| afb011bbdc | |||
| 3974ba7c2e | |||
| efe5094f22 | |||
| d9517e4b16 | |||
| 820c1da06c | |||
| cababa656b | |||
| 40c2dbd67a | |||
| 6f39046ff6 | |||
| 11f561f6c0 | |||
| 45aee52c6f | |||
| 27b9e621cc | |||
| 36a7b5cc4b | |||
| b43c60344a | |||
| cd49a620cb | |||
| cf5adc89f3 | |||
| 135ae3e34c | |||
| 24fa753a87 | |||
| a52647505f | |||
| 2780bca908 | |||
| bc9b0f9165 | |||
| cdb7482867 | |||
| 302bfd83a5 | |||
| 327e7fd688 | |||
| 71d6c39609 | |||
| 6957dd9287 | |||
| b0cf2aa9da | |||
| 71bd83a57c | |||
| 3ae68750db | |||
| 69348b5791 | |||
| a1287cffae | |||
| 4151851a2e | |||
| 2952c88461 | |||
| 425a1959ee | |||
| 571b00efe1 | |||
| 118fed6c7e | |||
| 0715a97bef | |||
| 7b10c56331 | |||
| d0446e2cf4 | |||
| 1b0f619fe5 | |||
| 5e1e0f51ac | |||
| 5cf55368ba | |||
| 08862e2047 | |||
| 8ead5f322c | |||
| 2942bb2535 | |||
| e9b91cd2e7 | |||
| 5ef8bca993 | |||
| 28c5d7ca1c | |||
| 5b9f29f114 | |||
| c2c91cd3e8 | |||
| 92be39a5a6 | |||
| 8e2ab70b13 | |||
| 6c153ff59d | |||
| 8e8936fec4 | |||
| 92f53a7e44 | |||
| 18fe671cb3 | |||
| 0c550d9b8a | |||
| 74a3440d99 | |||
| 9dacb424b5 | |||
| c71c78369f | |||
| 66bd79dd1a | |||
| d9b1fb9bcc | |||
| a1dee9955f | |||
| 299babe8ea | |||
| df1b04a7f6 | |||
| 00e504625f | |||
| 2f86bfda3e | |||
| 9a12e6cad1 | |||
| fd2c9b0bd7 | |||
| f5aedbdcd9 | |||
| 87729d039a | |||
| 955c2c59c0 | |||
| bdae1a67f9 | |||
| 1ee86e0eea | |||
| ec879b274d | |||
| d66d2ceb22 | |||
| 475327ae44 | |||
| b370b56752 | |||
| 43ed5a9231 | |||
| a5f17a3856 | |||
| 73c03f8718 | |||
| 14fe5baf3b | |||
| 67282a877c | |||
| ec44ef2615 | |||
| 9e3e9048ce | |||
| aa3fa883fb | |||
| 07dd527d86 | |||
| b0642d21da | |||
| 906ad34a79 | |||
| 8d86aeae2f | |||
| f198557e55 | |||
| 35d3036274 | |||
| 70078c38de | |||
| f00e5f12ab | |||
| 77d54138c7 | |||
| 8962523424 | |||
| d3a06a62ce | |||
| 81d3238f1e | |||
| 83a6d67712 | |||
| e1f647975a | |||
| e2d43e847f | |||
| 8b415041cf | |||
| 909b0bab41 | |||
| 385578aa13 | |||
| ed8da91310 | |||
| 5b8c8348b4 | |||
| 036915d312 | |||
| 7a2a8673eb | |||
| 04f68fa933 | |||
| 902ccce77f | |||
| e35def251f | |||
| 3d98b24ad1 | |||
| f30d7508ba | |||
| 9eeb13ebb6 | |||
| b332515852 | |||
| cc34401443 | |||
| 940aad4da8 | |||
| 628db6bbbb | |||
| 1634bd27bc | |||
| f6db41d585 | |||
| d735fe501c | |||
| 8409ca7f5d | |||
| 2cf82462cd | |||
| d998849df6 | |||
| ff333bd338 | |||
| 07fdec11c9 | |||
| 96f94ac469 | |||
| a48333bb65 | |||
| 7a41e104f1 | |||
| 3d40c714e1 | |||
| 5bed383cd1 | |||
| 3845a064df | |||
| 591b2fcf9b | |||
| bb40c17753 | |||
| 6f316a6bbd | |||
| ab6b4df9ba | |||
| ad250e1cb4 | |||
| 066363d904 | |||
| e463a42c40 | |||
| 530585d725 | |||
| 415d7f75db | |||
| 9691da5377 | |||
| ac9816977c | |||
| 4a80ed6754 | |||
| 355fe913f5 | |||
| 72b4356c94 | |||
| eb5c1f5f62 | |||
| 66272d36c6 | |||
| bf2771ed03 | |||
| 82d1ab26db | |||
| 42057ca65d | |||
| 07c29fec7c | |||
| a7e5c27af1 | |||
| 144cf834cb | |||
| bdd8968739 | |||
| 66a6a82290 | |||
| 70ced9eded | |||
| 843865e72e | |||
| f73cc83545 | |||
| 350901b44b | |||
| 3a7033f76b | |||
| b9e92f09a0 | |||
| 76d5c16478 | |||
| 4cac9e7c81 | |||
| c25c69803a | |||
| 108a54f56a | |||
| 0cca91b7f3 | |||
| b9b47504f8 | |||
| be9f6d859c | |||
| 24d5eaafb0 | |||
| 3d0970527a | |||
| d7c13c7e3a | |||
| e39fd9465b | |||
| 21690874c7 | |||
| f0019e2561 | |||
| 03e0d1b172 | |||
| 49da6a0997 | |||
| fc16dfd922 | |||
| 2e96cf6647 | |||
| 0723b5ab55 | |||
| 6fa5064b70 | |||
| dfbeab6757 | |||
| b9cbd5e2c7 | |||
| d09b597150 | |||
| cd44921c16 | |||
| ed1bec2c52 | |||
| 7b50b3d805 | |||
| 10856ca3d6 | |||
| 20ae644b88 | |||
| 2c632622da | |||
| 60f7d9e702 | |||
| b58b9fd56c | |||
| 148b0781ba | |||
| a9ad73a22f | |||
| a71b3290ea | |||
| ee9c09bea0 | |||
| 893b845e17 | |||
| 401d80f2f8 | |||
| 788a521230 | |||
| ba500fc7c1 | |||
| 390d7549b5 | |||
| 22ca702c20 | |||
| aaa3e3e4bf | |||
| 6528fe7ece | |||
| 3793c8ba29 | |||
| 69ab1529e0 | |||
| 5f4bbd7142 | |||
| dd73fd389d | |||
| 575ea5483e | |||
| b667bd1f77 | |||
| 3396b74a85 | |||
| 48c7535247 | |||
| 5d27eebc1f | |||
| 71f9f6674b | |||
| d062ab5404 | |||
| 51538fc5e9 | |||
| 8fb5457a28 | |||
| 3d811b954c | |||
| c5cad472af | |||
| ddd8e40cd6 | |||
| f8de31d231 | |||
| 725899213d | |||
| 152c8fc007 | |||
| 0f3d352b36 | |||
| bbb256a7ef | |||
| ac122d7736 | |||
| 2798584420 | |||
| 8640ec6c2a | |||
| 23960c9121 | |||
| fe30293baa | |||
| 8f8901af86 | |||
| 4100fd7acc | |||
| 5c012275b1 | |||
| d15ce938be | |||
| 110cbcc316 | |||
| f4a88cbb3d | |||
| 6587278dae | |||
| e2635c68a3 | |||
| a09ecc0084 | |||
| 260c62460b | |||
| 1c37f8bbac | |||
| 175d341be7 | |||
| 14a38c1b71 | |||
| a0ebbdfd1d | |||
| 3a4d0ff178 | |||
| ad8a92485c | |||
| 39acf5227a | |||
| 89b1a6994a | |||
| ffbbea7f80 | |||
| 51857ba693 | |||
| 227f604542 | |||
| 7f73dffd85 | |||
| 9ff1a070c0 | |||
| 6fe0356212 | |||
| 9de9034966 | |||
| 54e340dd17 | |||
| f5abd4eeaa | |||
| 2a94ce9f17 | |||
| 89b51ad59b | |||
| c4edd0006f | |||
| cb96ece6c9 | |||
| c627c8f662 | |||
| 518e3be120 | |||
| 887bdabd58 | |||
| 1fff48a4ba | |||
| 2e5b68db95 | |||
| 3f108d12ab | |||
| f2b769cf20 | |||
| 72ea78d830 | |||
| 73d1bb6888 | |||
| 520d684b3d | |||
| ea23972d44 | |||
| 284d56f187 | |||
| 93391f297b | |||
| 46f465e81c | |||
| de47aee9d8 | |||
| 8d748d19ab | |||
| 5fa487221a | |||
| ee780a47d3 | |||
| 8c7776122b | |||
| 11e1f8bd40 | |||
| 535f899210 | |||
| 511c880592 | |||
| d91fa792a1 | |||
| 73fcddf77e | |||
| b2896165e0 | |||
| 25d88a03fc | |||
| 81e551386c | |||
| 3fda0abf2c | |||
| fe0904b318 | |||
| 897c8f0842 | |||
| 47f3501a4b | |||
| 0dc6c57e16 | |||
| 2fed5e80c8 | |||
| 2ab4fb70cb | |||
| 0512166a36 | |||
| fa60ef508d | |||
| 5c48a63e97 | |||
| 80a85f638e | |||
| 61331e360a | |||
| 542abb8bb5 | |||
| b3cdab96f4 | |||
| eec1207a50 | |||
| c6dff4a2e6 | |||
| 6283e22c3e | |||
| 90d7579b21 | |||
| 60fadbf6eb | |||
| 05a7199b00 | |||
| 0eccf31d43 | |||
| 4f8722f5b8 | |||
| 8666490d6a | |||
| faa50819eb | |||
| eb63d39865 | |||
| 536f15a8d9 | |||
| dc8b9831c0 | |||
| 24e27d36ec | |||
| dda2e5dd1e | |||
| d45ea8f7a3 | |||
| 6f110e4ea3 | |||
| d974fa4882 | |||
| 9801da51cf | |||
| 3bab8dfe98 | |||
| 3ff88c4736 | |||
| 7bdbc9e0ae | |||
| 0cb3aeaa52 | |||
| 5fdfb2b17f | |||
| 39700a7fff | |||
| 39b8738184 | |||
| 8b1ca73225 | |||
| 0d41c95353 | |||
| 92fefb6adf | |||
| 64ba80026f | |||
| 1aa6ded393 | |||
| eaf3536c6e | |||
| 81338012a5 | |||
| 03f6184a71 | |||
| 7676b07cb6 | |||
| bd33a5738d | |||
| 86894453ce | |||
| d34c73c2f6 | |||
| b2bc3ca2f6 | |||
| 26921a91b4 | |||
| 20844c7cab | |||
| 9ec4cc602b | |||
| 77e37b0113 | |||
| dc56e2eca1 | |||
| 070df33b9e | |||
| 459cb2d1f9 | |||
| 0349cd9668 | |||
| 7784b07af2 | |||
| 10298aad75 | |||
| 6d8bc20eb4 | |||
| 578436cc73 | |||
| c7da5cce22 | |||
| 23f75a3248 | |||
| d604f5b761 | |||
| a51226bebb | |||
| bb14238b43 | |||
| ed91287ad4 | |||
| 5b9926db78 | |||
| e295648c61 | |||
| 7508445bc7 | |||
| 8633b2a1cb | |||
| 2b0b5bec98 | |||
| 1e34693f74 | |||
| 8499f59080 | |||
| d1252c2b59 | |||
| 89aee80229 | |||
| dfa73854d3 | |||
| f0d63e2ab6 | |||
| a5b4dfbd27 | |||
| 10e736b5f0 | |||
| e9d31bec58 | |||
| 625ba7aba0 | |||
| 9b96c7089f | |||
| e9cb72d3c5 | |||
| 5fa706ac9d | |||
| d12045a1f2 | |||
| 13602188c6 | |||
| 17ea14eb48 | |||
| 7b79660e4d | |||
| 8aec1699eb | |||
| 4c9ced093f | |||
| 6a0bf4c865 | |||
| e978f250eb | |||
| a3e1be9e8d | |||
| ec0616d2e4 | |||
| e6588068bc | |||
| 5dee478a35 | |||
| 2984403382 | |||
| 230fe26545 | |||
| aa9c6072c3 | |||
| b341d92b10 | |||
| e7cc2e8cb1 | |||
| 4fc1a1a8df | |||
| 6f8a1ed478 | |||
| 9549305c8d | |||
| 6d4b6b2ad5 | |||
| 4864d3064b | |||
| 41b6f12f89 | |||
| 1f0c27ff6f | |||
| 01d113b202 | |||
| e8b4a21540 | |||
| 48be67014c | |||
| a8ad03d677 | |||
| 7d2e2a16a9 | |||
| 5eb21df4b3 | |||
| 643c3b440a | |||
| b2ba305653 | |||
| 5986601e02 | |||
| b8b08ba99a | |||
| d4fe0acd05 | |||
| cfd5518cfd | |||
| d5152fdc3d | |||
| e195d28c8e | |||
| 9ba34d3ebf | |||
| e19854dc3e | |||
| 0f657dee94 | |||
| d3c6015ea6 | |||
| 494a641e6b | |||
| 22e1de332a | |||
| 55b8e3a83e | |||
| 544aaaf3fc | |||
| e7446e0264 | |||
| 8bd8c06947 | |||
| 9ad98f7e70 | |||
| c0d7ddd1d3 | |||
| 33919dcf4b | |||
| 48b36b1b6f | |||
| a5fa8f9668 | |||
| 87af41d2c8 | |||
| 9de7ad5c58 | |||
| 0ef60d89d2 | |||
| 0e92eca46d | |||
| e3b8e0fd73 | |||
| 9057403a6c | |||
| 694f1cbe97 | |||
| ec16dc4822 | |||
| 91ee4faaa2 | |||
| b628deaf18 | |||
| 4e62e0299b | |||
| cba16f9d7c | |||
| a042be590d | |||
| a4f0094008 | |||
| 96548da1e8 | |||
| 3452ad54aa | |||
| 2562f2d3dd | |||
| b38ec05c2d | |||
| 34b1c93283 | |||
| bc44340bd9 | |||
| b8959a1219 | |||
| ddb1d408be | |||
| 5472cef101 | |||
| 6106145e3d | |||
| 16036327c8 | |||
| 5977e198e1 | |||
| 2032dda642 | |||
| adac220862 | |||
| eea320f75c | |||
| 3e91b801e4 | |||
| c79fcdca2f | |||
| f421f8d994 | |||
| 3670e2fc1b | |||
| c618b1a353 | |||
| 44dc6ff371 | |||
| e586852e35 | |||
| 34249c3d25 | |||
| 23b559893b | |||
| d615426fe0 | |||
| f7b95d1e89 | |||
| 509ed7da6d | |||
| bef38b47f1 | |||
| ae43c16989 | |||
| d20008c6ac | |||
| 4327342cf0 | |||
| 47bfc29dbe | |||
| 856847b08f | |||
| 97dba19f55 | |||
| 337dd5e662 | |||
| cc8b0cd7f5 | |||
| d8b8c9cfa8 | |||
| fcfbbffea2 | |||
| a2e0134127 | |||
| 6a33c12182 | |||
| 4ea120c8bb | |||
| b8b7bf9929 | |||
| 19b683d5a7 | |||
| 0726226ca0 | |||
| 7e56bb3242 | |||
| bd5a1c0419 | |||
| ee68fcbbeb | |||
| 35970d6329 | |||
| 281a7c0a5d | |||
| 65ab22db41 | |||
| b3e95e73a4 | |||
| 2ed36683b5 | |||
| 03c18caee5 | |||
| 5effecdd88 | |||
| 9276ebf88b | |||
| 1dd43f8d66 | |||
| 89c0e31cfb | |||
| 5934e05df7 | |||
| d08dad61ed | |||
| 04548af0c2 | |||
| c931f95b33 | |||
| 1c3eac3854 | |||
| bc9255890f | |||
| 454265f935 | |||
| 403bcdc2a1 | |||
| e1ef05fb71 | |||
| 18e44e28c4 | |||
| 6e46b9425c | |||
| 826a3b8516 | |||
| 2ae2883366 | |||
| 986ab209b8 | |||
| 4edd189405 | |||
| 0d024a56b8 | |||
| 60b16b5ff3 | |||
| 75d30ac349 | |||
| 3cad6857f5 | |||
| b026f450d9 | |||
| 9ca4e46593 | |||
| b983c7c587 | |||
| df8740481e | |||
| 9eab1abf40 | |||
| 5add54c437 | |||
| 0f0da70f13 | |||
| 643345a914 | |||
| 08ab4bc598 | |||
| 5837fc0eea | |||
| 83f1ced9d7 | |||
| 46dbec0ae6 | |||
| 522f8f2f3b | |||
| ba45e06bae | |||
| cfe3bf0701 | |||
| 49c513e2f8 | |||
| 54a979833c | |||
| 9cbffdf09a | |||
| a2d7228244 | |||
| 6e1a45d897 | |||
| 35915b8f3e | |||
| db7c4c9bbd | |||
| ba34a04979 | |||
| 3ac362b99f | |||
| 5801dfee6f | |||
| 06c158e2ee | |||
| 97c273ab81 | |||
| a44cf5c204 | |||
| 6daf131baa | |||
| ba795cd153 | |||
| e729e818d8 | |||
| 1f9907e39e | |||
| dca4aeae2f | |||
| dac4a0eb11 | |||
| 76f7493899 | |||
| a871bde0d6 | |||
| ca1187f4a7 | |||
| 9055a9bff2 | |||
| 1aed5e12a7 | |||
| acdbdae3ad | |||
| aecb06bdb9 | |||
| ea78391e80 | |||
| 5cf6e985c2 | |||
| 04cf39ef6f | |||
| 00ab00c6c5 | |||
| 5b2ed65ca6 | |||
| c8d6cf99e7 | |||
| 7a0af03703 | |||
| 8a401b0f92 | |||
| 85b3b8e871 | |||
| 2dd6e15f44 | |||
| 256e301238 | |||
| 016b972009 | |||
| 44e9a6ad7a | |||
| 411c28dbfa | |||
| 246d00aca3 | |||
| bc323490c8 | |||
| 06523f22f0 | |||
| fe840cb33e | |||
| 3d90ba774b | |||
| addb67b951 | |||
| 6acd3aa389 | |||
| f3ae1ad0e7 | |||
| 11322a02ac | |||
| e61a9f11b3 | |||
| ba7321fcf5 | |||
| 32400248f1 | |||
| efd1f174fd | |||
| ed36ffd43b | |||
| 3b2d7568d5 | |||
| ec6c3b8c51 | |||
| 810a2bce9f | |||
| 3ccc822df6 | |||
| 25e6e8cba7 | |||
| 000be1da4b | |||
| bcfdb078bd | |||
| 5a346f3d59 | |||
| f1bfdbf5c4 | |||
| c1c7b751c9 | |||
| 933229d750 | |||
| 9df6f0b7e2 | |||
| 15b8d907c1 | |||
| e87b72d3be | |||
| 5758539e48 | |||
| 87e6645582 | |||
| 35d3a9624f | |||
| 30b57b7b51 | |||
| ba6a0c83c6 | |||
| 6bdd334a12 | |||
| 6b51d1bb33 | |||
| a106ebcc24 | |||
| b462d3f968 | |||
| a204b7834d | |||
| 6f24e400b6 | |||
| fb077c5077 | |||
| ca374fcde8 | |||
| e9820e4347 | |||
| a80e738c6a | |||
| bd262995d5 | |||
| 09e64565b2 | |||
| d7ee55c8ad | |||
| 37c1d95c58 | |||
| eb3e2c7b4c | |||
| ba3513d4b3 | |||
| 4655a4807d | |||
| 45388eccea | |||
| cef3ec452c | |||
| dc049d7384 | |||
| 3f6dbbf3c6 | |||
| a4913dd1e3 | |||
| f7f916df19 | |||
| cf717f7c06 | |||
| 9ca7b646de | |||
| d7aff3108c | |||
| 31209a09c7 | |||
| 24c688a00a | |||
| 094a3d95f6 | |||
| f2f4febc2d | |||
| d23ef6b761 | |||
| 0c670e8f36 | |||
| 3adf2e4dba | |||
| d6c08b678f | |||
| 9d4a1f210b | |||
| 52e818d744 | |||
| 00a162350d | |||
| 293656a980 | |||
| 9dd45220d9 | |||
| 39fac67b86 | |||
| 37b139253f | |||
| 0084768b34 | |||
| 9b1c1ccfc2 | |||
| 2ffcc5c0d0 | |||
| 15872638bc | |||
| 58f5f94a46 | |||
| f1585f5657 | |||
| 9403f7a771 | |||
| e848b49224 | |||
| 51511d6d0d | |||
| 5d1a577bca | |||
| 155d247c94 | |||
| 1172657cce | |||
| db6a446ddf | |||
| abc9dadfef | |||
| 3b0c733fe5 | |||
| b921769d38 | |||
| cf5fedf6d7 | |||
| c09d2a8206 | |||
| d3070f82b8 | |||
| 27081a318d | |||
| c30365023d | |||
| 73e5fa090b | |||
| da88ee5fc0 | |||
| ae61625d63 | |||
| ef649a6bbe | |||
| 9207082540 | |||
| 7b404822fd | |||
| f26cf8768c | |||
| 62457c6934 | |||
| cd8914571a | |||
| 497b2fd006 | |||
| b35f85ac30 | |||
| 0c2288fe9a | |||
| bd68d058d1 | |||
| 0de4433ee2 | |||
| 42c031e651 | |||
| 9ae79f711c | |||
| 892ec0139b | |||
| 15dd7f97c9 | |||
| 0307f7cda4 | |||
| ab250ec5a3 | |||
| 1dd6349c80 | |||
| 83916fc982 | |||
| 7d613b17b9 | |||
| 1f797d2b83 | |||
| 776d8976da | |||
| 71a02a0730 | |||
| cbb62cf4f1 | |||
| a6bd9225d7 | |||
| 78cf1da87f | |||
| 9749eb941b | |||
| a8b7f2e6e5 | |||
| 05cfb3d2ad | |||
| 3e7f30ce59 | |||
| 0e7af62dbc | |||
| fee83cadec | |||
| 3644e06f78 | |||
| d0663918a1 | |||
| db306da05f | |||
| 557d40b9e6 | |||
| bc8a7077ff | |||
| e6d1cf9b14 | |||
| 0ac6411c28 | |||
| 235ce4c0b6 | |||
| 79f839d270 | |||
| b6214956e4 | |||
| 3d9c70e20b | |||
| dec7b592ff | |||
| a907cc609b | |||
| 2bfe0a3f52 | |||
| c0cd01c769 | |||
| cd2fec3d42 | |||
| 827da1aad0 | |||
| d068516cca | |||
| 0b1291995e | |||
| ded5eb0909 | |||
| cb99fb5ec1 | |||
| 2628ac1cac | |||
| 1c8c23132d | |||
| 23ccbcf889 | |||
| cfa135e7d7 | |||
| 9e62f5a8da | |||
| d067e220c0 | |||
| 2495d16e1c | |||
| 9739983c6e | |||
| 08a9d5b258 | |||
| 7775a650da | |||
| 6fe46c31f5 | |||
| 9c887bfe8b | |||
| 0d2de85b74 | |||
| cbdc176394 | |||
| 8e369176e7 | |||
| 325eec1586 | |||
| 29703c79fc | |||
| 5afc5f34a0 | |||
| 2cbe9421ea | |||
| fc10e83386 | |||
| d60968d1b9 | |||
| 48428e0222 | |||
| d969ad813a | |||
| 366dfa192f | |||
| c2ceb8df06 | |||
| a1c7621ba2 | |||
| 006f7fd769 | |||
| cc817a906e | |||
| 6b3a02bcfc | |||
| 44bb0485de | |||
| 848b1196c4 | |||
| 3bfcb8d92f | |||
| a9f2ea76ed | |||
| 1bb82a3558 | |||
| 410b621ff1 | |||
| 3f8e3230fc | |||
| 1b7afcd805 | |||
| 67686a47bc | |||
| 4737671203 | |||
| ae0727d23d | |||
| 70d018ae12 | |||
| 9b13e7ddd9 | |||
| 9f6b949dd2 | |||
| 923d62f351 | |||
| ee4c311533 | |||
| 4c85a1ecd7 | |||
| ca210f6216 | |||
| ca58f05e96 | |||
| 10118d7271 | |||
| b762ce33a7 | |||
| 4326c641f8 | |||
| 43356a1c2e | |||
| 15eee9cd6c | |||
| 9b2701c579 | |||
| 6724b2fc85 | |||
| f7b9712ea9 | |||
| 020892617d | |||
| 299cea9f30 | |||
| 2cdb56d170 | |||
| eb2e32bfa4 | |||
| 071d4ea048 | |||
| 77c63b2f47 | |||
| a2b900f011 | |||
| d95b544c4c | |||
| 3f48b4ccb9 | |||
| 1ee3538cc3 | |||
| 22b5ec129b | |||
| e9b0bad46f | |||
| 9656fcf3fb | |||
| 325c3b2744 | |||
| 1017958f6e | |||
| 9552b51b5d | |||
| de863b7a9b | |||
| 784c608154 | |||
| 6b514e246f | |||
| 07ba88a989 | |||
| c79008f638 | |||
| 0484cd7f16 | |||
| 28babc916e | |||
| 72da311a5f | |||
| a7f51a5c55 | |||
| ca3b5a4ad7 | |||
| 6bd0b00587 | |||
| 4cc077fbb6 | |||
| 1b2e59894d | |||
| 74638cf789 | |||
| 7868ba8b91 | |||
| 26459db720 | |||
| 708523a5ff | |||
| e9aafd365b | |||
| 4b5844037e | |||
| f4308f8dcb | |||
| 89f856d546 | |||
| a07858943a | |||
| 3af7a751ee | |||
| 9eb9a6995c | |||
| 6bfc743bc2 | |||
| c4f7f2bdd6 | |||
| 8bb22521d7 | |||
| 3630b6d79d | |||
| a7143cd69e | |||
| 28190a437d | |||
| 492d6e3e7e | |||
| d26b1a8f2f | |||
| 9cceee1d79 | |||
| c1afb564b8 | |||
| 78eccaf7ed | |||
| e8b4d2d9f8 | |||
| 16c79ac3e3 | |||
| b294657ca9 | |||
| 8208d7965b | |||
| d713e741e3 | |||
| 10d6219cec | |||
| 349d176b2b | |||
| 15a8bb45a6 | |||
| 5fbdd83ac0 | |||
| 1af454bf62 | |||
| dd407d112f | |||
| 8b44d40189 | |||
| db7dd3770e | |||
| 0d038010b4 | |||
| ab8b0772d0 | |||
| 76268f1ae0 | |||
| f1d406d696 | |||
| 850d92e666 | |||
| 9f93dc3539 | |||
| 6bda5a0dd7 | |||
| d04caa986f | |||
| fb09de7a0a | |||
| 383b13f42d | |||
| 1095d9e8a3 | |||
| a931a2fae8 | |||
| 55685f6c28 | |||
| 81bf947b55 | |||
| c5743b67fe | |||
| f9f3c4a1d1 | |||
| ec0dc233c4 | |||
| 974d443d80 | |||
| 032e558cc9 | |||
| a51790df92 | |||
| 32334d3ad2 | |||
| 03008318c4 | |||
| 45878a6ac6 | |||
| 1936ff0524 | |||
| 11c9524dcb | |||
| 496a757dd2 | |||
| 46e390cbb7 | |||
| 4d8af82e1e | |||
| 44a1a4c2dd | |||
| 5c127b2c8c | |||
| 9f2e12d896 | |||
| a209c72876 | |||
| b735c8a926 | |||
| cbca4f0665 | |||
| da1f3f2464 | |||
| 3b53de1810 | |||
| 1fece90606 | |||
| 73d7139f72 | |||
| 69194d324c | |||
| 5bf5dee2a7 | |||
| ca77de0657 | |||
| 43f604fcc1 | |||
| b107b0edc4 | |||
| 7d344784d2 | |||
| 9b7deb698a | |||
| a1fc81f2a4 | |||
| 0bb607e295 | |||
| 494a0dbd74 | |||
| 4113bc4d86 | |||
| 93ac47bb63 | |||
| 77d2a3a828 | |||
| 83f86de61c | |||
| 5858c1e74f | |||
| 49506cf689 | |||
| f9756382a9 | |||
| 21c9237f4b | |||
| 10edcaf67f | |||
| 5898a2a8d8 | |||
| e6478eff42 | |||
| b44c28f456 | |||
| ee33c1e565 | |||
| 19da866c6b | |||
| b1554e46ee | |||
| 9d978ba029 | |||
| 28cf77c47f | |||
| 0a0326af51 | |||
| 67278adc2f | |||
| 3d09c9906c | |||
| b03485645d | |||
| ef17051934 | |||
| 893c97d67c | |||
| deda10f174 | |||
| 2d808053fe | |||
| e1ac6ac701 | |||
| 2d8b851413 | |||
| be7a0d3c32 | |||
| b97bc7abc7 | |||
| e01e193105 | |||
| 31fed07310 | |||
| 3b52e12938 | |||
| 5835ce3018 | |||
| 4ca0bc186a | |||
| 14f543d172 | |||
| e318f9e1f0 | |||
| b8ec2aec2a | |||
| da539e11e3 | |||
| 068fb0d90a | |||
| d2b8d9fe9b | |||
| 669d96174a | |||
| da15dc330a | |||
| 8735b7219a | |||
| c6938f1062 | |||
| 381cd945f1 | |||
| ed4fb9e583 | |||
| 02557c0495 | |||
| 8fce0efb59 | |||
| 13b74e98d3 | |||
| bc88ba9c51 | |||
| 80a5aafed5 | |||
| 1cc9e18d52 | |||
| 89a86c4bf3 | |||
| 65dbe56dd4 | |||
| 9f55dcff89 | |||
| 4138486053 | |||
| 1a0b44bdbb | |||
| 35297d0bc9 | |||
| ff7330774d | |||
| 21413a6da5 | |||
| d898a8e417 | |||
| a329840751 | |||
| ad458cc8f5 | |||
| 7f5ad2c9d3 | |||
| 7569f8b252 | |||
| 1f80fb3e1b | |||
| e168f97280 | |||
| 46fc5d0118 | |||
| addeb75d37 | |||
| 5cd5b06e85 | |||
| f4db1041e4 | |||
| 2e4e06bd20 | |||
| d23e3f362c | |||
| 5b4e8a79f4 | |||
| 84751969be | |||
| 0983210445 | |||
| 5f515e596f | |||
| 4e1fe11505 | |||
| dda68881ec | |||
| 57c51510ad | |||
| c1e0814874 | |||
| 70051b9734 | |||
| 814731e663 | |||
| d39f4cef2a | |||
| 0cca4cca1d | |||
| 717d335ebb | |||
| f85b9d78b6 | |||
| f9e9e6bebf | |||
| 72c344be5a | |||
| df5fc6946c | |||
| 50ac0921d9 | |||
| 5452d36fd8 | |||
| 0588d00b05 | |||
| a2337b2a13 | |||
| 8f4f9da4d1 | |||
| d10c36c445 | |||
| 204206200a | |||
| ac7ad24743 | |||
| a6a7a36675 | |||
| 08b9085a67 | |||
| aa1ffcff70 | |||
| 1381681192 | |||
| 92cc02db29 | |||
| b02078fcb9 | |||
| 3d86c5144a | |||
| 14edde3a64 | |||
| cd4f2b707a | |||
| 4ca7b1488d | |||
| fc5d784483 | |||
| 067e550579 | |||
| 9cffcfb6d4 | |||
| dcfb92df00 | |||
| df4b232d3f | |||
| c5162d25d2 | |||
| 4f784862ae | |||
| 505d4a3087 | |||
| 7a51e26285 | |||
| 34831c98e1 | |||
| d9d9105b2f | |||
| 14e7d28f51 | |||
| d7b2a59973 | |||
| 7796b11204 | |||
| 93ffc17f39 | |||
| a7fcaf61f9 | |||
| 14a1919f2e | |||
| f965d7c83f | |||
| 85443e661b | |||
| 1a26777911 | |||
| 34651948bc | |||
| 06ae5e8afc | |||
| 8f6f3a6177 | |||
| 3f9b5f23d6 | |||
| 230fc8e7db | |||
| 400e63611d | |||
| 211064deb5 | |||
| f6e605a8ed | |||
| 099524867e | |||
| 8d5be56b82 | |||
| dafe823eec | |||
| 628fd893ed | |||
| b7c29d42d0 | |||
| c3c323cc1c | |||
| dc7c8825ea | |||
| 0f39a18454 | |||
| f3e3ddcc95 | |||
| abe6aa602d | |||
| 6ddbc82c0e | |||
| 3b415dfeb3 | |||
| 431c624d48 | |||
| f9964da509 | |||
| 1a0948c6d4 | |||
| a6f7e307ea | |||
| 929df3cf80 | |||
| c3b1916e03 | |||
| edd13a5fce | |||
| b3c93c246e | |||
| 13e36b8e91 | |||
| 58a5d644ff | |||
| e43d0248b1 | |||
| 418ca32936 | |||
| 341575d47a | |||
| 105674989f | |||
| ccb707f744 | |||
| 747437920d | |||
| db11c99ca1 | |||
| 0b65753283 | |||
| 443a0e60f6 | |||
| 8c270c5575 | |||
| a33c36d498 | |||
| ba2958a61a | |||
| e1fd552487 | |||
| 8f94ab592f | |||
| 79e873f4fa | |||
| 8913413f06 | |||
| 6d195a5216 | |||
| 5d07944500 | |||
| b0e87517d6 | |||
| 5665a46f11 | |||
| e3173299ec | |||
| 391ad46ab7 | |||
| 756bc8e752 | |||
| 9960a3aa1a | |||
| 006bf2c743 | |||
| b5ed92d21a | |||
| 4c71f9ba68 | |||
| ac0a8e7c96 | |||
| feb7eb025e | |||
| e1f75ee7c9 | |||
| f206351c0f | |||
| fad310e5d0 | |||
| 15ed3d5df0 | |||
| a57118f0e1 | |||
| ab9ae4f387 | |||
| 02fe813021 | |||
| 6201e425d4 | |||
| f9e4ef5ef7 | |||
| 787428c2c3 | |||
| 69126557b2 | |||
| 08e4ac01ee | |||
| 292bac1157 | |||
| a7789c5cea | |||
| 04ecdebe64 | |||
| a2515af81d | |||
| 6cd22bf3cd | |||
| c199b9ba9d | |||
| 9c1b205041 | |||
| 20a012d50d | |||
| 4e3061d938 | |||
| 1ecd4f0109 | |||
| 54290bbfa2 | |||
| 65e1df5ee9 | |||
| 32c5fef652 | |||
| 382b5fd4ec | |||
| e0948f84e1 | |||
| 5245afe7e3 | |||
| c7199e5c77 | |||
| 3535dee1f5 | |||
| 5ed55137a6 | |||
| e3f9fd1e05 | |||
| 5ba961e4f8 | |||
| 4e93669d26 | |||
| 2868d49234 | |||
| 2c57d4c62e | |||
| 000883bd4b | |||
| 55d3e37c07 | |||
| c63282658a | |||
| 62075ef850 | |||
| d72ad3dd48 | |||
| 977db7dc3d | |||
| 3ca4cb3b91 | |||
| 360d44663a | |||
| e9cecd6e91 | |||
| 2235a75258 | |||
| a30511ac26 | |||
| 6cf4779072 | |||
| dd2395fa1c | |||
| 9a52779156 | |||
| 602ad29c97 | |||
| a40d63b5ee | |||
| 5f5ef0448f | |||
| 23302e5293 | |||
| dc90d90d79 | |||
| 6aaafee780 | |||
| 31446157b8 | |||
| e84df02299 | |||
| 17e7327705 | |||
| 74ceb97548 | |||
| a8ae4996f1 | |||
| c9292e548a | |||
| 8e0c1c261b | |||
| c75804422d | |||
| 1973bd697f | |||
| 8ac115784b | |||
| 9add5b5aea | |||
| ad7c7b79dd | |||
| 10b13424fb | |||
| 662c78bb9d | |||
| 6eae2dac32 | |||
| 781fc05f79 | |||
| cfdb7105e9 | |||
| 17e576b86a | |||
| 040d0e1313 | |||
| 3fa03db2ed | |||
| debf059f80 | |||
| 06a52038eb | |||
| cbd564fd78 | |||
| f7ccb51ef8 | |||
| ce2456564f | |||
| 1254271e1b | |||
| 43211542fc | |||
| 1523f63750 | |||
| 1986220a91 | |||
| c511309fe5 | |||
| d6f1f513ad | |||
| 4e43bc9b51 | |||
| 21c7f79600 | |||
| 792cce6935 | |||
| e1cd33ad51 | |||
| dffea40943 | |||
| 26d9d1da06 | |||
| 8e9dd609fb | |||
| dab052a260 | |||
| 7fe07aff99 | |||
| 1d3d0cf040 | |||
| d5dd3a868c | |||
| 76bc6f4cd1 | |||
| 9a4c553e1a | |||
| c53b44bb6e | |||
| 10ad974e76 | |||
| b0025c19f3 | |||
| f625620fd4 | |||
| a8639cca6f | |||
| 3334003c9f | |||
| 427989f2c6 | |||
| 09e6797e7d | |||
| 9767fd0865 | |||
| 327f5ad50d | |||
| 7220ad4f95 | |||
| 43b7128a5d | |||
| 8a112dc45a | |||
| 8adc2311fe | |||
| 6d2c4d7119 | |||
| 2b213fb619 | |||
| 68c9f81eb8 | |||
| ef1434ae7a | |||
| fd3d93fbfb | |||
| 422d928fbc | |||
| 8e108f0d47 | |||
| a6c6ea81d9 | |||
| 55680f1b75 | |||
| 4232100f4e | |||
| cbf52a1b8d | |||
| 24aba76d84 | |||
| ca08273f7a | |||
| 31b2dc30e2 | |||
| 4ad0cf99b3 | |||
| ed94540827 | |||
| cd4b03c552 | |||
| 4ae1f9c61a | |||
| 67a5c51a16 | |||
| 84d2b32a10 | |||
| 0d7bb035b2 | |||
| 2a4c5898bb | |||
| e8e0988cf6 | |||
| b952f9a5a8 | |||
| a940a87f00 | |||
| f125e3af00 | |||
| 50670f7687 | |||
| 2135dff556 | |||
| ba220b848e | |||
| 0306f226fe | |||
| 27d9a3e7e5 | |||
| 68d89aa1e8 | |||
| 7b9d796fb8 | |||
| c1a358f466 | |||
| 8b134d84c6 | |||
| b3a4b611fb | |||
| 6d5e2f9f75 | |||
| 752175b8ac | |||
| fa48f6437b | |||
| 507c8f3d50 | |||
| 10aa1fb079 | |||
| 6be3ee0604 | |||
| 06d571a70c | |||
| a6b2fe3504 | |||
| 6157de366f | |||
| 087f2b7e36 | |||
| a5847ac4bf | |||
| 8a39d215a3 | |||
| b457d0f122 | |||
| f6528871b4 | |||
| 7e4af6b1c3 | |||
| cea5d5a76a | |||
| c318168fc3 | |||
| fcf40d70bf | |||
| e86872308c | |||
| 779614fd91 | |||
| aead3adc89 | |||
| e3d03ab906 | |||
| e3590ab70e | |||
| e2d8972cc9 | |||
| d1bf705fac | |||
| ac58269489 | |||
| 704c73a030 | |||
| 08cdba7c97 | |||
| 969fd891ef | |||
| bbe4d41051 | |||
| 23fcc1a626 | |||
| 884372f875 | |||
| 0c8cedd45e | |||
| 00b6a52cb8 | |||
| ba6a4a51f6 | |||
| c2107e2fcf | |||
| 85327b5ad4 | |||
| 346c9e6c03 | |||
| 726137d6b9 | |||
| bcbec0059a | |||
| 8017be8902 | |||
| aacb8482c3 | |||
| 1507cd2c25 | |||
| 1b55630753 | |||
| 58faaa348c | |||
| 558f29f79d | |||
| 3ca65b54f0 | |||
| 8302fe4b44 | |||
| e3331ac5f8 | |||
| bc574bd27b | |||
| 12c93c8196 | |||
| ed5eb84f89 | |||
| 0bd32f3e6d | |||
| 06cef3e014 | |||
| ab845a6b05 | |||
| 6e3dfee54a | |||
| 4aec44de3f | |||
| cbfaec8f6a | |||
| 7d2a3b470c | |||
| e9d3b3e05e | |||
| 5d0b257920 | |||
| 1a955208da | |||
| 5e45d53d37 | |||
| 4a903b2ba9 | |||
| 9ac16c53cf | |||
| f5be8bf696 | |||
| f362f66fc2 | |||
| 57f92de48f | |||
| cf59098d16 | |||
| 0a01240cb8 | |||
| 822a0e9be2 | |||
| a756729a43 | |||
| e3cf746c8a | |||
| 0071e262fd | |||
| 0b713658ad | |||
| 4d607159ec | |||
| 124b898476 | |||
| 375c1260f7 | |||
| 03ae914e4f | |||
| a70b88a66a | |||
| 939a3ca74f | |||
| ac8ccd753b | |||
| 3183ad6665 | |||
| 681b0b7743 | |||
| cfa9783799 | |||
| 02fff83f82 | |||
| 83b949904b | |||
| 5e01704e6f | |||
| 43bb9522bc | |||
| 456fd2daf0 | |||
| 6eb0be2d8a | |||
| 4a983e7ea8 | |||
| 542c59b166 | |||
| 2c2eed7ac4 | |||
| e3ff24c240 | |||
| 86fabaad34 | |||
| 3fcfd0e8f3 | |||
| d22cae48a5 | |||
| 54b0129b9a | |||
| 676f3f1bcc | |||
| 5099ac4794 | |||
| 24380b9a38 | |||
| 9f678d2eaa | |||
| 9550b43a1c | |||
| 0625b05f3b | |||
| 08ede862fd | |||
| 957a12bc39 | |||
| 74ed455ece | |||
| 99fa80bc4f | |||
| eda6175448 | |||
| 771fdcaab6 | |||
| 23f031efda | |||
| bdda564486 | |||
| c1136f72d4 | |||
| a6a2892b59 | |||
| 70b5da4860 | |||
| cf42902900 | |||
| 5553604045 | |||
| 44e60dd31f | |||
| ddcba86217 | |||
| b6402254fa | |||
| 7a6781993c | |||
| eb9dc4c242 | |||
| dce1aefeca | |||
| 3c8bb0bbe6 | |||
| c0ca85feb4 | |||
| dba825c360 | |||
| 6f3a59e228 | |||
| b6ee019dc5 | |||
| 9f8f01e5ec | |||
| 064fa6b85b | |||
| fb38cfa71f | |||
| a27ca45972 | |||
| 59ad241116 | |||
| 501b17eda5 | |||
| 9b72fb490b | |||
| 174dde63f9 | |||
| da47ec5b29 | |||
| eb769bbf9f | |||
| 224847f7f1 | |||
| b9c95bb3ed | |||
| da1ad9b03e | |||
| b00cd29c5d | |||
| ad820a5bc2 | |||
| 117bebca25 | |||
| 0367385f69 | |||
| 7c6f8459f6 | |||
| 222ffa0b19 | |||
| 25d42c27e1 | |||
| a238321d3a | |||
| 7ee5ba840a | |||
| 14b18a2a7a | |||
| 1686194f1a | |||
| 1416ad6679 | |||
| 1328426bfe | |||
| ea27156f99 | |||
| 1cf4941e5a | |||
| 34b0331419 | |||
| 93fce651b9 | |||
| c5604b4cb1 | |||
| db12add5cd | |||
| cb345a4c90 | |||
| ebbf82dc85 | |||
| f2fc0c6581 | |||
| 0e1515a170 | |||
| 5721e91aab | |||
| 8ac42285a2 | |||
| 05c5999321 | |||
| 8b53f92960 | |||
| fb4fcaf8dd | |||
| 9cd27755e2 | |||
| 697b734423 | |||
| 2b9a257bae | |||
| ecfa9b18c1 | |||
| 202c239688 | |||
| 0de09e7e5f | |||
| 4d1cb18d65 | |||
| 5cffff392c | |||
| 52029cea25 | |||
| d383930750 | |||
| 39a7e8ac1e | |||
| e262b74d6c | |||
| 75539752b3 | |||
| ccffd82195 | |||
| 6f0c8990f1 | |||
| f0c4a18558 | |||
| 4728e6dba2 | |||
| 7d86e37668 | |||
| 335ff5c52a | |||
| b0670a39d2 | |||
| c0583fa611 | |||
| a6237d1c57 | |||
| 5540b9f53e | |||
| a24a743911 | |||
| 1211a40c9b | |||
| a4a32cee08 | |||
| f3a00bbb41 | |||
| 50c35a1875 | |||
| d249925d07 | |||
| 58564c883b | |||
| b26c0583b4 | |||
| fec7af3349 | |||
| 01cec3aa30 | |||
| 99421f0c02 | |||
| e228af3a45 | |||
| 7ae18207d5 | |||
| bf241ec9ca | |||
| fce8162973 | |||
| 5d3d67eec4 | |||
| 0808fb03a8 | |||
| fd4c214396 | |||
| 6d65c1d470 | |||
| 60729e7112 | |||
| d4ee5fcf40 | |||
| c7e0e87d1a | |||
| 4a2a5d764d | |||
| 63fc410767 | |||
| f09b2f4d50 | |||
| 3eb6fe568f | |||
| 37eadceb68 | |||
| b983304c12 | |||
| 160f1cb759 | |||
| 2d6ea9916d | |||
| 9ac02b9bf6 | |||
| 7425a57984 | |||
| bef3b0960d | |||
| bb15139353 | |||
| ce8423b215 | |||
| f48e918b04 | |||
| d464969c00 | |||
| 77cc84f041 | |||
| 30b628755a | |||
| 7bb598c4ea | |||
| 5686e6f4fa | |||
| 2912429e01 | |||
| 7728dd176e | |||
| 11c9a705f4 | |||
| a1537d7eb9 | |||
| cae7ee9de3 | |||
| ef83a931b1 | |||
| 09d41598cc | |||
| 159d8a4360 | |||
| 011fc2dcc2 | |||
| b03929feb7 | |||
| 2b7cd5b373 | |||
| fe988b88b5 | |||
| 08a4de6ab0 | |||
| b159ecaae4 | |||
| 2166af42b1 | |||
| 999f0f8d41 | |||
| b7b696d5ea | |||
| b8bf484c86 | |||
| af7fcc22fa | |||
| c60bd80b74 | |||
| 06f7a33403 | |||
| 23c87bef1f | |||
| b6719918d4 | |||
| cb5105f9f3 | |||
| 12050a2070 | |||
| 16331bba19 | |||
| b5924a2f25 | |||
| 98ebd8d238 | |||
| 7bd8de49b9 | |||
| 1fb2d2afa6 | |||
| ca306c2917 | |||
| caa7b16bc2 | |||
| 8c10c7125d | |||
| 59d8da90bd | |||
| 6d81793659 | |||
| e271cdc342 | |||
| 11961240ae | |||
| 327f92f3e1 | |||
| 824a51416c | |||
| c50edd6f1e | |||
| d598710a7a | |||
| 71e0a3db61 | |||
| 2ca23ae66c | |||
| 57f3aeb885 | |||
| e830130da5 | |||
| f7a32568a9 | |||
| 2ccbc84b2a | |||
| e3b8506de5 | |||
| f5caa29f09 | |||
| e9bd4ba8a3 | |||
| 6da272de15 | |||
| 840a74eaca | |||
| 59fb64d32e | |||
| 45250c102b | |||
| d5aa6c4efb | |||
| 89fec415b3 | |||
| eb9cc05864 | |||
| 56907c92a0 | |||
| 068f503140 | |||
| 0e0610fce8 | |||
| a1dad0a504 | |||
| 8e287613a3 | |||
| 8602c53565 | |||
| e3f2a7a1df | |||
| bce80395b5 | |||
| 41615685fb | |||
| 23fa0623dc | |||
| f8d7ef4e82 | |||
| 5cae902543 | |||
| b115c3e99a | |||
| 5050d52f77 | |||
| c5c45ca030 | |||
| b0d0e98898 | |||
| b1948db575 | |||
| f023010996 | |||
| cf18cea2fd | |||
| 0767a2a02a | |||
| df7bc53182 | |||
| 829918b3b0 | |||
| 2cccc877d9 | |||
| 579fb9a059 | |||
| 06a0541451 | |||
| 8b99eef480 | |||
| d20ef8ef47 | |||
| 3ff22bf4c4 | |||
| d195f89cbe | |||
| ce8e91b9dd | |||
| 2ec4adc6c0 | |||
| 0eba532016 | |||
| 5e6de296cb | |||
| d9728a69e6 | |||
| 64d15bc4a3 | |||
| e034b3aa34 | |||
| fff78e0bee | |||
| 8344007feb | |||
| c57bec133e | |||
| 672ba36345 | |||
| bd3fd79c32 | |||
| d2d5f665b6 | |||
| c5e91bf3f9 | |||
| 839b8ad54f | |||
| 9dc6c321d0 | |||
| 938a4b1ca2 | |||
| 76ef3446ae | |||
| 6ecb46fd55 | |||
| 73c752b846 | |||
| 348c0e3c19 | |||
| afc212dc0b | |||
| 2ae7a6f4a7 | |||
| c1188bfb51 | |||
| 342b6e8904 | |||
| 3b06d52487 | |||
| 0c55a58c81 | |||
| 46972840c0 | |||
| e292a05d92 | |||
| 518b4a8161 | |||
| d515c879d5 | |||
| 7281ff7b4b | |||
| cae0c2bbe9 | |||
| 76c2ee0535 | |||
| a30020b9f9 | |||
| b0238a1194 | |||
| 23a52e75c4 | |||
| cffbe2d141 | |||
| 8b098fdb4f | |||
| 1aca1847ad | |||
| ad3820e28c | |||
| f2d7e35e34 | |||
| 24201ba6bd | |||
| 3c999b92b7 | |||
| c743dda481 | |||
| f900e52b45 | |||
| fb3ee1703b | |||
| 213bd1d64e | |||
| d2b95b996d | |||
| a958eb7360 | |||
| 83b40aff43 | |||
| ef44bc1218 | |||
| 768bf2efd4 | |||
| 02844d9563 | |||
| 1aac60223b | |||
| f66a101735 | |||
| ef76a5e3a1 | |||
| 6cc2390495 | |||
| 7af5bcea66 | |||
| 5f39a42f32 | |||
| 95974473e6 | |||
| 20fb52e49c | |||
| c4df7ad9be | |||
| 4b7038a7a8 | |||
| 2818169ec2 | |||
| f926dc2cd8 | |||
| 84e7b70bfb | |||
| 0f9d6ff139 | |||
| e0ea44a397 | |||
| 2f78a6cea1 | |||
| 899698d630 | |||
| 5a5ef867fd | |||
| 93b374a1f3 | |||
| 47dbd003bf | |||
| 07a1cb62f6 | |||
| d2d1653a5c | |||
| 00584a1550 | |||
| c7f5eb32f0 | |||
| 357b6b0fb3 | |||
| 3328c6bae4 | |||
| 9dfb3cb318 | |||
| ea84a277df | |||
| f49f81b432 | |||
| 710b3a0297 | |||
| ef904d0620 | |||
| 43e93a580a | |||
| 1f60992516 | |||
| f820fd223d | |||
| fadac131e3 | |||
| 0f9e9bf4f5 | |||
| 494276b3e2 | |||
| 03bfb855fe | |||
| 39f7a324b3 | |||
| bceef0cf51 | |||
| 75fa516546 | |||
| f7afaaea56 | |||
| 804b474529 | |||
| 08eaf94d4f | |||
| ce7898aba3 | |||
| 4cb43d45ee | |||
| b44185be71 | |||
| 769d1dc54f | |||
| 1c7faeef5c | |||
| f43b5d17ab | |||
| 7db51d1119 | |||
| 6cc69c1b8a | |||
| fd7f371a94 | |||
| 0cee4ad347 | |||
| e720ba9270 | |||
| 90b3b338ed | |||
| 0944c37a26 | |||
| e6fd9aab4c | |||
| 93536c0abc | |||
| f26ab4cb78 | |||
| a623e25548 | |||
| 50737a437b | |||
| 37d4ed3eed | |||
| 7e78c238a2 | |||
| a9c5f3864e | |||
| e2da2eba12 | |||
| fd6958b400 | |||
| f271b5e0b4 | |||
| e625ed348e | |||
| f18f111c9f | |||
| 12192b032b | |||
| 6f7bb993b5 | |||
| 401a2c823a | |||
| ef8e986c59 | |||
| 9aa028517c | |||
| a0639bcf47 | |||
| 5f78e47d1f | |||
| 1b084ea2ca | |||
| 6c76a3f7e0 | |||
| da9f23241a | |||
| e97ad5fa68 | |||
| 4d8a772860 | |||
| 8503c961d5 | |||
| 88f67243dd | |||
| b0cf4369ff | |||
| 3493d04e4e | |||
| 96c9593476 | |||
| a6af9cbd2d | |||
| d51ae662ff | |||
| b8cb160513 | |||
| ac9fcd7f32 | |||
| df5465a798 | |||
| 67dd809314 | |||
| 6815400644 | |||
| fa6cd30a83 | |||
| 7010072f00 | |||
| fc69a99605 | |||
| b6e66d3c1c | |||
| 6faf55edfa | |||
| 000627ee75 | |||
| 18cfaef4f4 | |||
| b728bd5e6f | |||
| 0c808641ef | |||
| 7086fb8855 | |||
| c6d34a378f | |||
| 215e761464 | |||
| 2f649dd139 | |||
| 49562fe156 | |||
| 0e2dca271a | |||
| 533442dfdd | |||
| 760b8a242e | |||
| 5d470f1536 | |||
| 2d633e1a29 | |||
| a3976c83dc | |||
| 2830d55377 | |||
| 07a8cfb93a | |||
| 6f350bc68c | |||
| bc86e7acea | |||
| 047e28a5db | |||
| c8b2cd92a7 | |||
| 8d49ea49d8 | |||
| 450002cf9e | |||
| 097575fe55 | |||
| 06dc370d5b | |||
| ee7bd30f81 | |||
| 82d3778e95 | |||
| 8ff8197851 | |||
| 995d6986af | |||
| 2ec930b3bf | |||
| a0de4d05b6 | |||
| 6d0dad1c2e | |||
| 1667644ed9 | |||
| 41766138d4 | |||
| 0cb4a7e92f | |||
| 50a6e9141b | |||
| fc650167db | |||
| 4b33234305 | |||
| 521018239e | |||
| 41725ec9b7 | |||
| c7fae52d6d | |||
| 7d0c768085 | |||
| 7c098650b1 | |||
| f3c745db67 | |||
| 89df44437f | |||
| 36a5520435 | |||
| 48f00d929e | |||
| a704eb9338 | |||
| ac8a977e89 | |||
| 7ea5fe7c75 | |||
| e319094ddc | |||
| cdd0f23f9c | |||
| 55cbf7a7ce | |||
| 4fb5f3e46a | |||
| 725c3d2b6e | |||
| 9c43e01bb8 | |||
| 77d47a1dd4 | |||
| 30318f9ab3 | |||
| a2c319b7ab | |||
| 9b03771800 | |||
| 284d7f3fe5 | |||
| f1fc78ab64 | |||
| fd0dd79d94 | |||
| 3cf049f945 | |||
| a37725318b | |||
| 269f5a7643 | |||
| ace358a7dc | |||
| 38b5fbd276 | |||
| 208eb75efd | |||
| 469bfcfb43 | |||
| 5418c20642 | |||
| a23d47c919 | |||
| 17fc76a174 | |||
| d5e3a91a47 | |||
| 8f0ea42fdf | |||
| 585f86f91a | |||
| f2358ccc61 | |||
| 22e2673b35 | |||
| 13b5f9655e | |||
| 7b809b5e26 | |||
| 18a226a3c6 | |||
| e51299b292 | |||
| 17dbb9c19e | |||
| f22614a2ca | |||
| 21eb858ef9 | |||
| daaeb79341 | |||
| cbbae51103 | |||
| 64f27e8637 | |||
| 67b0ab2bd7 | |||
| 445c4cb0a9 | |||
| 3ddfe99811 | |||
| 518503d579 | |||
| 22ee09d8a8 | |||
| 948ab0cb21 | |||
| 518d122efd | |||
| 6d4af60756 | |||
| 59dc9e0cc5 | |||
| ac5b7890d8 | |||
| 1de7e02091 | |||
| 84f49e8000 | |||
| a1882258fb | |||
| 1afb72db4a | |||
| 73705055b4 | |||
| b60ab36c2e | |||
| 932960856f | |||
| f794197638 | |||
| 851d6d7838 | |||
| 1dc2e4c789 | |||
| e3e4150e67 | |||
| 8f954ea342 | |||
| 4c1e721e4d | |||
| c0d8ecf9dd | |||
| 0f1df830f7 | |||
| d6cd3a3d5a | |||
| 0b38e7dd3b | |||
| 81a8e2efbf | |||
| 09e0b740f2 | |||
| 325947da52 | |||
| 75e7f02015 | |||
| 8b2fb01b8c | |||
| 9a45b178c8 | |||
| 45941bdaf1 | |||
| 1cbc0aaf85 | |||
| 1129b2df71 | |||
| f32b8c697c | |||
| a1eed05d71 | |||
| 323faf52af | |||
| 348a5e825d | |||
| fec53eb0f7 | |||
| 979bb1d78d | |||
| b2800d2eb4 | |||
| e2db12d622 | |||
| 806fd7d519 | |||
| 35637d956f | |||
| 84b6a3e149 | |||
| f71dc83330 | |||
| 80a9c1f30d | |||
| 7156efa18b | |||
| f191ecb1bd | |||
| dd855d70f8 | |||
| ac9d094c02 | |||
| 4320af963a | |||
| 08f06b1837 | |||
| 904d1044bb | |||
| 7519f29f70 | |||
| c66b7425f8 | |||
| ffc5a9a9fd | |||
| af560645d0 | |||
| ec7b45ac96 | |||
| 733eeb9d27 | |||
| 5f5da74ac9 | |||
| 7cd09ebc32 | |||
| 8512789c69 | |||
| 3ed5520443 | |||
| 69cd3991b8 | |||
| 57cf46c03a | |||
| 39184176c8 | |||
| 891846fb7a | |||
| 1e5961ce80 | |||
| 6264716e22 | |||
| 972ac20d81 | |||
| 4af619a092 | |||
| 8d71264300 | |||
| 9d0e34b992 | |||
| c4c706dbcb | |||
| f24c4d2f71 | |||
| 42df443d42 | |||
| 3472933cdb | |||
| f9796a9e8e | |||
| 1f8db1d8aa | |||
| fd555837ce | |||
| 879f73d783 | |||
| 015b094ecb | |||
| 2f27fd8edc | |||
| 51f71dbd54 | |||
| af07f81d1e | |||
| 2cf3f8394e | |||
| da9fe835e7 | |||
| 92e6bb3741 | |||
| b93ff2e13d | |||
| f912ba2b84 | |||
| 3b3cd6a274 | |||
| 4e4b31b5b9 | |||
| e954402238 | |||
| aa478a1504 | |||
| 70bea8ed6e | |||
| 9cb78e8a83 | |||
| f05cebf705 | |||
| 57d06e8c42 | |||
| 1d47351a10 | |||
| 219bcb4fcd | |||
| 67c28572bd | |||
| 72ca1eeb78 | |||
| 892e342a80 | |||
| 4c052c054a | |||
| ef072ae11c | |||
| 92cda56011 | |||
| a4b39fa6b8 | |||
| 02556d6b52 | |||
| 9b787771dc | |||
| 1ac561405c | |||
| acc01a4535 | |||
| 59dd726bcc | |||
| e90d8b75dc | |||
| b681e29d7a | |||
| 346bc2947d | |||
| c0a596dd98 | |||
| c0550d8f36 | |||
| 11ffb57dde | |||
| 6ba9d80500 | |||
| 736fb73fdf | |||
| c959076667 | |||
| 8d78d27742 | |||
| dc839a87df | |||
| 48e919b61b | |||
| ff83f5b77c | |||
| 085c2e2189 | |||
| 106bca9df9 | |||
| 9d80fa8086 | |||
| b657f8df8a | |||
| bf1237c87d | |||
| 51f29b5bc9 | |||
| 84ab99ecbc | |||
| ee0c0dc872 | |||
| 61258b4052 | |||
| b3aec5c281 | |||
| be2d22c19a | |||
| ef94b33d7f | |||
| da4c76c452 | |||
| 2d44b7e6fe | |||
| 5f4f8f6ca6 | |||
| dce9b247e6 | |||
| ef2649f609 |
@@ -0,0 +1,8 @@
|
||||
cataclysm
|
||||
data/*.template
|
||||
save/
|
||||
obj/
|
||||
debug.log
|
||||
logg.txt
|
||||
bindist/
|
||||
cataclysmdda-*
|
||||
@@ -0,0 +1,20 @@
|
||||
Instructions for compiling on a Debian-based system. The package names here are for Ubuntu 12.10
|
||||
|
||||
Dependencies: libncurses
|
||||
|
||||
# Native build on current platform
|
||||
sudo apt-get install libncurses5-dev
|
||||
make
|
||||
|
||||
# Cross-compile to linux 32-bit from linux 64-bit
|
||||
sudo apt-get install libc6-dev-i386 lib32ncurses5-dev lib32stdc++-dev g++-multilib
|
||||
make NATIVE=linux32
|
||||
|
||||
# Cross-compile for Windows
|
||||
sudo apt-get install autoconf bison flex cmake git automake intltool libtool scons yasm
|
||||
mkdir -p ~/src
|
||||
git clone -b stable https://github.com/mxe/mxe.git ~/src
|
||||
cd ~/src/mxe
|
||||
make gcc
|
||||
PATH=${PATH}:~/src/mxe/usr/bin
|
||||
make CROSS=win32
|
||||
Executable
+191
@@ -0,0 +1,191 @@
|
||||
<?xml version="1.0" encoding="UTF-8" standalone="yes" ?>
|
||||
<CodeBlocks_project_file>
|
||||
<FileVersion major="1" minor="6" />
|
||||
<Project>
|
||||
<Option title="Cataclysm" />
|
||||
<Option pch_mode="2" />
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Release">
|
||||
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Os" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-Wl,-stack,12000000,-subsystem,windows" />
|
||||
<Add option="-static -lgdi32" />
|
||||
</Linker>
|
||||
</Target>
|
||||
</Build>
|
||||
<Unit filename="action.cpp" />
|
||||
<Unit filename="action.h" />
|
||||
<Unit filename="addiction.h" />
|
||||
<Unit filename="artifact.cpp" />
|
||||
<Unit filename="artifact.h" />
|
||||
<Unit filename="artifactdata.h" />
|
||||
<Unit filename="basecamp.cpp" />
|
||||
<Unit filename="basecamp.h" />
|
||||
<Unit filename="bionics.cpp" />
|
||||
<Unit filename="bionics.h" />
|
||||
<Unit filename="bodypart.cpp" />
|
||||
<Unit filename="bodypart.h" />
|
||||
<Unit filename="calendar.cpp" />
|
||||
<Unit filename="calendar.h" />
|
||||
<Unit filename="catacurse.cpp" />
|
||||
<Unit filename="catacurse.h" />
|
||||
<Unit filename="color.cpp" />
|
||||
<Unit filename="color.h" />
|
||||
<Unit filename="computer.cpp" />
|
||||
<Unit filename="computer.h" />
|
||||
<Unit filename="construction.cpp" />
|
||||
<Unit filename="construction.h" />
|
||||
<Unit filename="crafting.cpp" />
|
||||
<Unit filename="crafting.h" />
|
||||
<Unit filename="cursesdef.h" />
|
||||
<Unit filename="debug.cpp" />
|
||||
<Unit filename="debug.h" />
|
||||
<Unit filename="defense.cpp" />
|
||||
<Unit filename="dialogue.h" />
|
||||
<Unit filename="disease.cpp" />
|
||||
<Unit filename="disease.h" />
|
||||
<Unit filename="enums.h" />
|
||||
<Unit filename="event.cpp" />
|
||||
<Unit filename="event.h" />
|
||||
<Unit filename="facdata.h" />
|
||||
<Unit filename="faction.cpp" />
|
||||
<Unit filename="faction.h" />
|
||||
<Unit filename="field.cpp" />
|
||||
<Unit filename="game.cpp" />
|
||||
<Unit filename="game.h" />
|
||||
<Unit filename="gamemode.cpp" />
|
||||
<Unit filename="gamemode.h" />
|
||||
<Unit filename="graffiti.cpp" />
|
||||
<Unit filename="graffiti.h" />
|
||||
<Unit filename="help.cpp" />
|
||||
<Unit filename="iexamine.cpp" />
|
||||
<Unit filename="iexamine.h" />
|
||||
<Unit filename="input.cpp" />
|
||||
<Unit filename="input.h" />
|
||||
<Unit filename="inventory.cpp" />
|
||||
<Unit filename="inventory.h" />
|
||||
<Unit filename="inventory_ui.cpp" />
|
||||
<Unit filename="item.cpp" />
|
||||
<Unit filename="item.h" />
|
||||
<Unit filename="itype.h" />
|
||||
<Unit filename="itypedef.cpp" />
|
||||
<Unit filename="iuse.cpp" />
|
||||
<Unit filename="iuse.h" />
|
||||
<Unit filename="keypress.cpp" />
|
||||
<Unit filename="keypress.h" />
|
||||
<Unit filename="lightmap.cpp" />
|
||||
<Unit filename="lightmap.h" />
|
||||
<Unit filename="line.cpp" />
|
||||
<Unit filename="line.h" />
|
||||
<Unit filename="main.cpp" />
|
||||
<Unit filename="main_menu.cpp" />
|
||||
<Unit filename="map.cpp" />
|
||||
<Unit filename="map.h" />
|
||||
<Unit filename="mapbuffer.cpp" />
|
||||
<Unit filename="mapbuffer.h" />
|
||||
<Unit filename="mapdata.cpp" />
|
||||
<Unit filename="mapdata.h" />
|
||||
<Unit filename="mapgen.cpp" />
|
||||
<Unit filename="mapitems.h" />
|
||||
<Unit filename="mapitemsdef.cpp" />
|
||||
<Unit filename="melee.cpp" />
|
||||
<Unit filename="mission.cpp" />
|
||||
<Unit filename="mission.h" />
|
||||
<Unit filename="mission_end.cpp" />
|
||||
<Unit filename="mission_fail.cpp" />
|
||||
<Unit filename="mission_place.cpp" />
|
||||
<Unit filename="mission_start.cpp" />
|
||||
<Unit filename="missiondef.cpp" />
|
||||
<Unit filename="monattack.cpp" />
|
||||
<Unit filename="monattack.h" />
|
||||
<Unit filename="mondeath.cpp" />
|
||||
<Unit filename="mondeath.h" />
|
||||
<Unit filename="mongroup.h" />
|
||||
<Unit filename="mongroupdef.cpp" />
|
||||
<Unit filename="monitemsdef.cpp" />
|
||||
<Unit filename="monmove.cpp" />
|
||||
<Unit filename="monster.cpp" />
|
||||
<Unit filename="monster.h" />
|
||||
<Unit filename="morale.h" />
|
||||
<Unit filename="moraledata.h" />
|
||||
<Unit filename="mtype.h" />
|
||||
<Unit filename="mtypedef.cpp" />
|
||||
<Unit filename="mutation.cpp" />
|
||||
<Unit filename="mutation.h" />
|
||||
<Unit filename="mutation_data.cpp" />
|
||||
<Unit filename="name.cpp" />
|
||||
<Unit filename="name.h" />
|
||||
<Unit filename="newcharacter.cpp" />
|
||||
<Unit filename="npc.cpp" />
|
||||
<Unit filename="npc.h" />
|
||||
<Unit filename="npcmove.cpp" />
|
||||
<Unit filename="npctalk.cpp" />
|
||||
<Unit filename="omdata.h" />
|
||||
<Unit filename="options.cpp" />
|
||||
<Unit filename="options.h" />
|
||||
<Unit filename="output.cpp" />
|
||||
<Unit filename="output.h" />
|
||||
<Unit filename="overmap.cpp" />
|
||||
<Unit filename="overmap.h" />
|
||||
<Unit filename="picojson.h" />
|
||||
<Unit filename="player.cpp" />
|
||||
<Unit filename="player.h" />
|
||||
<Unit filename="pldata.h" />
|
||||
<Unit filename="posix_time.cpp" />
|
||||
<Unit filename="posix_time.h" />
|
||||
<Unit filename="profession.cpp" />
|
||||
<Unit filename="profession.h" />
|
||||
<Unit filename="ranged.cpp" />
|
||||
<Unit filename="resource.rc">
|
||||
<Option compilerVar="WINDRES" />
|
||||
</Unit>
|
||||
<Unit filename="rng.cpp" />
|
||||
<Unit filename="rng.h" />
|
||||
<Unit filename="settlement.cpp" />
|
||||
<Unit filename="settlement.h" />
|
||||
<Unit filename="setvector.cpp" />
|
||||
<Unit filename="setvector.h" />
|
||||
<Unit filename="skill.cpp" />
|
||||
<Unit filename="skill.h" />
|
||||
<Unit filename="texthash.cpp" />
|
||||
<Unit filename="texthash.h" />
|
||||
<Unit filename="tileray.cpp" />
|
||||
<Unit filename="tileray.h" />
|
||||
<Unit filename="trap.h" />
|
||||
<Unit filename="trapdef.cpp" />
|
||||
<Unit filename="trapfunc.cpp" />
|
||||
<Unit filename="tutorial.cpp" />
|
||||
<Unit filename="tutorial.h" />
|
||||
<Unit filename="veh_interact.cpp" />
|
||||
<Unit filename="veh_interact.h" />
|
||||
<Unit filename="veh_type.h" />
|
||||
<Unit filename="veh_typedef.cpp" />
|
||||
<Unit filename="vehicle.cpp" />
|
||||
<Unit filename="vehicle.h" />
|
||||
<Unit filename="weather.cpp" />
|
||||
<Unit filename="weather.h" />
|
||||
<Unit filename="weather_data.h" />
|
||||
<Unit filename="wish.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
<debugger />
|
||||
<envvars />
|
||||
<DoxyBlocks>
|
||||
<comment_style block="0" line="0" />
|
||||
<doxyfile_project />
|
||||
<doxyfile_build />
|
||||
<doxyfile_warnings />
|
||||
<doxyfile_output />
|
||||
<doxyfile_dot />
|
||||
<general />
|
||||
</DoxyBlocks>
|
||||
</Extensions>
|
||||
</Project>
|
||||
</CodeBlocks_project_file>
|
||||
@@ -0,0 +1,82 @@
|
||||
1.1 Adding an item
|
||||
1) Edit itype.h. Change the enum item_id and insert a unique identifier for
|
||||
your new item type. Be sure to put it among similar items.
|
||||
2) Edit itypedef.cpp. Macros are used for all item types, and they are pretty
|
||||
self-explanatory. Be ABSOLUTELY sure that you insert the macro at the same
|
||||
point in the list as you inserted the identifier in item_id!
|
||||
3) Your item type is now valid, but won't be spawned. If you want it to be
|
||||
spawned among similar items, edit mapitemsdef.cpp. Find the appropriate
|
||||
array(s), and insert the identifier for your item (e.g. itm_aspirin). Make
|
||||
sure it comes in before the NULL at the end of the list.
|
||||
5) Some items, like tools or food, also take an iuse::function reference.
|
||||
Edit iuse.h and include the function in the class declaration; then edit
|
||||
iuse.cpp and define your function. Functions may be shared among different
|
||||
item types.
|
||||
|
||||
1.2 Adding a monster
|
||||
1) Edit mtype.h. Change the enum mon_id and insert a unique identifier for
|
||||
your new monster type. Be sure to put it among similar monsters.
|
||||
2) Edit montypedef.cpp. A macro is used for monsters and it is pretty
|
||||
straightforward (Any of this ring a bell?). Be ABSOLUTELY sure that you
|
||||
insert the macro at the same point in the list as your inserted the
|
||||
identifier in mon_id!
|
||||
3) Your monster type is now valid, but won't be spawned. If you want it to be
|
||||
spawned among similar monsters, edit mongroupdef.cpp. Find the appropriate
|
||||
array, and insert the identifier for your monster (e.g, mon_zombie). Make
|
||||
sure it comes in before the NULL at the end of the list.
|
||||
4) If you want your monster to drop items, edit monitemsdef.cpp. Make a new
|
||||
array for your monster type with all the map item groups it may carry, and a
|
||||
chance value for each.
|
||||
5) Your monster may have a special attack, a monattack::function reference.
|
||||
Edit monattack.h and include the function in the class definition; then
|
||||
edit monattack.cpp and define your function. Functions may be shared among
|
||||
different monster types. Be aware that the function should contain a
|
||||
statement that the monster uses to decide whether or not to use the attack,
|
||||
and if they do, should reset the monster's attack timer.
|
||||
7) Just like attacks, some monsters may have a special function called when
|
||||
they die. This works the same as attacks, but the relevent files are
|
||||
mondeath.h and mondeath.cpp.
|
||||
1.3 Adding structures to the map
|
||||
Most "regular" buildings are spawned in cities (large clusters of buildings which are located rather close to each other).
|
||||
In file omdata.h in the enum oter_id structure define names (code identifiers) for your building.
|
||||
If you want your building to be displayed at overmap in different orientations, you should add 4 identifiers for each orientation (south, east, west and north correspondingly).
|
||||
In the same file in structure const oter_t oterlist[num_ter_types]
|
||||
we should define how these buildings will be displayed, how much they obscure vision and which extras set they have. For example:
|
||||
{"mil. surplus", '^', c_white, 5, build_extras, false, false},
|
||||
{"mil. surplus", '>', c_white, 5, build_extras, false, false},
|
||||
{"mil. surplus", 'v', c_white, 5, build_extras, false, false},
|
||||
{"mil. surplus", '<', c_white, 5, build_extras, false, false}
|
||||
Comments at the beginning of this structure are rather useful.
|
||||
In the file mapgen.cpp find the subroutine called draw_map(...);
|
||||
there you should find a huge variant operator ("switch")
|
||||
where you should put your code defining the new building by adding new case-statement.
|
||||
This should be mentioned that most buildings are built on the square SEEX*2 x SEEY*2 tiles.
|
||||
If you want your building to be spawned not only in city limits
|
||||
you should refer to structures in file omdata.h
|
||||
(starting from the line #define OMSPEC_FREQ 7).
|
||||
These structures are commented in source code. Add new identifier in enum omspec_id structure before
|
||||
NUM_OMSPECS and then add a record in const overmap_special overmap_specials[NUM_OMSPECS] array. For example:
|
||||
{ot_toxic_dump, 0, 5, 15, -1, mcat_null, 0, 0, 0, 0, &omspec_place::wilderness,0}
|
||||
The comments given in source code to structure struct overmap_special explains the meaning of these constants in the example above.
|
||||
|
||||
|
||||
FAQ
|
||||
Q: What the heck is up with the map objects?
|
||||
|
||||
A: The pertinent map objects are submap, mapbuffer, map, and overmap.
|
||||
The submap contains the actual map data, in SEEXxSEEY chunks.
|
||||
Vehicles and Spawns are stored in vectors because they're relatively sparse.
|
||||
Submaps live in the single global mapbuffer, MAPBUFFER.
|
||||
Map encapsulates the area around the player that is currently active.
|
||||
It contains an array of MAPSIZE * MAPSIZE submap pointers called grid.
|
||||
This is a 2D array, but is mapped to a 1D array for (questionable) indexing purposes.
|
||||
When the player moves from one submap to another, map::shift() is called.
|
||||
It moves the pointers in grid to keep the player centered.
|
||||
The leading edge of grid is populated by map::load()
|
||||
If the submap has been visited before, it's loaded from MAPBUFFER
|
||||
Otherwise a 2x2 chunk of submaps is generated based on the corresponding overmap square type.
|
||||
An overmap encapsulates the large-scale structure of a map
|
||||
Such as location and layout of cities, forests, rivers, roads, etc...
|
||||
There are an arbitrary number of overmaps
|
||||
Additional overmaps are generated as the player enters new areas.
|
||||
|
||||
@@ -0,0 +1 @@
|
||||
Cataclysm is licensed under the Creative Commons Attribution-ShareAlike 3.0 Unported License. To view a copy of this license, visit http://creativecommons.org/licenses/by-sa/3.0/ or send a letter to Creative Commons, 444 Castro Street, Suite 900, Mountain View, California, 94041, USA.
|
||||
@@ -1,11 +1,161 @@
|
||||
CC = g++
|
||||
# Platforms:
|
||||
# Linux native
|
||||
# (don't need to do anything)
|
||||
# Linux 64-bit
|
||||
# make NATIVE=linux64
|
||||
# Linux 32-bit
|
||||
# make NATIVE=linux32
|
||||
# Linux cross-compile to Win32
|
||||
# make CROSS=i686-pc-mingw32-
|
||||
# Win32
|
||||
# Run: make NATIVE=win32
|
||||
|
||||
# Build types:
|
||||
# Debug (no optimizations)
|
||||
# Default
|
||||
# Release (turn on optimizations)
|
||||
# make RELEASE=1
|
||||
|
||||
|
||||
# comment these to toggle them as one sees fit.
|
||||
# WARNINGS will spam hundreds of warnings, mostly safe, if turned on
|
||||
# DEBUG is best turned on if you plan to debug in gdb -- please do!
|
||||
# PROFILE is for use with gprof or a similar program -- don't bother generally
|
||||
WARNINGS = -Wall -Wextra -Wno-switch -Wno-sign-compare -Wno-missing-braces -Wno-unused-parameter -Wno-char-subscripts
|
||||
# Uncomment below to disable warnings
|
||||
#WARNINGS = -w
|
||||
DEBUG = -g
|
||||
CFLAGS = -Wall -c -lncurses $(DEBUG)
|
||||
LFLAGS = -Wall -lncurses $(DEBUG)
|
||||
CXX = g++
|
||||
CXXFLAGS = -lncurses
|
||||
OBJS = main.o bionics.o bodypart.o crafting.o event.o faction.o field.o game.o help.o item.o itypedef.o iuse.o keypress.o line.o map.o mapgen.o mapitemsdef.o monattack.o mondeath.o mongroupdef.o monitemsdef.o monmove.o monster.o mtypedef.o newcharacter.o npc.o npcmove.o npctalk.o output.o overmap.o player.o rng.o settlement.o setvector.o skill.o trapdef.o trapfunc.o wish.o
|
||||
cataclysm: $(OBJS)
|
||||
$(CC) $(LFLAGS) $(OBJS) -o cataclysm
|
||||
#PROFILE = -pg
|
||||
#OTHERS = -O3
|
||||
#DEFINES = -DNDEBUG
|
||||
|
||||
# Disable debug. Comment this out to get logging.
|
||||
#DEFINES = -DENABLE_LOGGING
|
||||
|
||||
# Limit debug to level. Comment out all for all levels.
|
||||
#DEFINES += -DDEBUG_INFO
|
||||
#DEFINES += -DDEBUG_WARNING
|
||||
#DEFINES += -DDEBUG_ERROR
|
||||
#DEFINES += -DDEBUG_PEDANTIC_INFO
|
||||
|
||||
# Limit debug to section. Comment out all for all levels.
|
||||
#DEFINES += -DDEBUG_ENABLE_MAIN
|
||||
#DEFINES += -DDEBUG_ENABLE_MAP
|
||||
#DEFINES += -DDEBUG_ENABLE_MAP_GEN
|
||||
#DEFINES += -DDEBUG_ENABLE_GAME
|
||||
|
||||
VERSION = 0.3
|
||||
|
||||
TARGET = cataclysm
|
||||
W32TARGET = cataclysm.exe
|
||||
BINDIST_DIR = bindist
|
||||
|
||||
ODIR = obj
|
||||
W32ODIR = objwin
|
||||
DDIR = .deps
|
||||
|
||||
OS = $(shell uname -o)
|
||||
CXX = $(CROSS)g++
|
||||
LD = $(CROSS)g++
|
||||
|
||||
# enable optimizations. slow to build
|
||||
ifdef RELEASE
|
||||
OTHERS += -O3
|
||||
DEBUG =
|
||||
endif
|
||||
|
||||
CXXFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS) -MMD
|
||||
|
||||
BINDIST_EXTRAS = README data cataclysm-launcher
|
||||
BINDIST = cataclysmdda-$(VERSION).tar.gz
|
||||
W32BINDIST = cataclysmdda-$(VERSION).zip
|
||||
BINDIST_CMD = tar -czvf $(BINDIST) $(BINDIST_DIR)
|
||||
W32BINDIST_CMD = zip -r $(W32BINDIST) $(BINDIST_DIR)
|
||||
|
||||
# is this section even being used anymore?
|
||||
# SOMEBODY PLEASE CHECK
|
||||
#ifeq ($(OS), Msys)
|
||||
# LDFLAGS = -static -lpdcurses
|
||||
#else
|
||||
LDFLAGS = -lncurses
|
||||
#endif
|
||||
|
||||
# Linux 64-bit
|
||||
ifeq ($(NATIVE), linux64)
|
||||
CXXFLAGS += -m64
|
||||
else
|
||||
# Linux 32-bit
|
||||
ifeq ($(NATIVE), linux32)
|
||||
CXXFLAGS += -m32
|
||||
endif
|
||||
endif
|
||||
# Win32 (mingw32?)
|
||||
ifeq ($(NATIVE), win32)
|
||||
TARGET = $(W32TARGET)
|
||||
BINDIST = $(W32BINDIST)
|
||||
BINDIST_CMD = $(W32BINDIST_CMD)
|
||||
ODIR = $(W32ODIR)
|
||||
W32LDFLAGS = -Wl,-stack,12000000,-subsystem,windows
|
||||
LDFLAGS += -static -lgdi32
|
||||
endif
|
||||
# MXE cross-compile to win32
|
||||
ifeq ($(CROSS), i686-pc-mingw32-)
|
||||
TARGET = $(W32TARGET)
|
||||
BINDIST = $(W32BINDIST)
|
||||
BINDIST_CMD = $(W32BINDIST_CMD)
|
||||
ODIR = $(W32ODIR)
|
||||
LDFLAGS += -lgdi32
|
||||
endif
|
||||
|
||||
SOURCES = $(wildcard *.cpp)
|
||||
HEADERS = $(wildcard *.h)
|
||||
_OBJS = $(SOURCES:.cpp=.o)
|
||||
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
|
||||
|
||||
all: $(TARGET)
|
||||
@
|
||||
|
||||
$(TARGET): $(ODIR) $(DDIR) $(OBJS)
|
||||
$(LD) $(W32FLAGS) -o $(TARGET) $(DEFINES) $(CXXFLAGS) \
|
||||
$(OBJS) $(LDFLAGS)
|
||||
|
||||
$(ODIR):
|
||||
mkdir $(ODIR)
|
||||
|
||||
$(DDIR):
|
||||
@mkdir $(DDIR)
|
||||
|
||||
$(ODIR)/%.o: %.cpp
|
||||
$(CXX) $(DEFINES) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -f cataclysm main.o bionics.o bodypart.o crafting.o event.o faction.o field.o game.o help.o item.o itypedef.o iuse.o keypress.o line.o map.o mapgen.o mapitemsdef.o monattack.o mondeath.o mongroupdef.o monitemsdef.o monmove.o monster.o mtypedef.o newcharacter.o npc.o npcmove.o npctalk.o output.o overmap.o player.o rng.o settlement.o setvector.o skill.o trapdef.o trapfunc.o wish.o
|
||||
rm -f $(TARGET) $(W32TARGET) $(ODIR)/*.o $(ODIR)/*.d $(W32ODIR)/*.o $(W32BINDIST) \
|
||||
$(BINDIST)
|
||||
rm -rf $(BINDIST_DIR)
|
||||
|
||||
bindist: $(BINDIST)
|
||||
|
||||
$(BINDIST): $(TARGET) $(BINDIST_EXTRAS)
|
||||
rm -rf $(BINDIST_DIR)
|
||||
mkdir -p $(BINDIST_DIR)
|
||||
cp -R $(TARGET) $(BINDIST_EXTRAS) $(BINDIST_DIR)
|
||||
$(BINDIST_CMD)
|
||||
|
||||
export ODIR _OBJS LDFLAGS CXX W32FLAGS DEFINES CXXFLAGS
|
||||
|
||||
ctags: $(SOURCES) $(HEADERS)
|
||||
ctags $(SOURCES) $(HEADERS)
|
||||
|
||||
etags: $(SOURCES) $(HEADERS)
|
||||
etags $(SOURCES) $(HEADERS)
|
||||
|
||||
tests: $(ODIR) $(DDIR) $(OBJS)
|
||||
$(MAKE) -C tests
|
||||
|
||||
check: tests
|
||||
$(MAKE) -C tests check
|
||||
|
||||
.PHONY: tests check ctags etags
|
||||
|
||||
-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)
|
||||
-include ${OBJS:.o=.d}
|
||||
|
||||
@@ -0,0 +1,52 @@
|
||||
# comment these to toggle them as one sees fit.
|
||||
# WARNINGS will spam hundreds of warnings, mostly safe, if turned on
|
||||
# DEBUG is best turned on if you plan to debug in gdb -- please do!
|
||||
# PROFILE is for use with gprof or a similar program -- don't bother generally
|
||||
#WARNINGS = -Wall -Wextra -Wno-switch -Wno-sign-compare -Wno-missing-braces -Wno-unused-parameter -Wno-char-subscripts
|
||||
DEBUG = -g
|
||||
#PROFILE = -pg
|
||||
OTHERS = -O3
|
||||
|
||||
ODIR = objwin
|
||||
DDIR = .deps
|
||||
|
||||
TARGET = cataclysm.exe
|
||||
|
||||
CXX = g++
|
||||
|
||||
LINKER = i486-mingw32-ld
|
||||
LINKERFLAGS = -Wl,-stack,12000000,-subsystem,windows
|
||||
|
||||
CFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS)
|
||||
|
||||
LDFLAGS = -static -lgdi32
|
||||
|
||||
#ifeq ($(OS), Msys)
|
||||
#LDFLAGS = -static -lpdcurses
|
||||
#else
|
||||
#LDFLAGS = -lncurses
|
||||
#endif
|
||||
|
||||
SOURCES = $(wildcard *.cpp)
|
||||
_OBJS = $(SOURCES:.cpp=.o)
|
||||
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
|
||||
|
||||
all: $(TARGET)
|
||||
@
|
||||
|
||||
$(TARGET): $(ODIR) $(DDIR) $(OBJS)
|
||||
$(CXX) $(LINKERFLAGS) -o $(TARGET) $(CFLAGS) $(OBJS) $(LDFLAGS)
|
||||
|
||||
$(ODIR):
|
||||
mkdir $(ODIR)
|
||||
|
||||
$(DDIR):
|
||||
@mkdir $(DDIR)
|
||||
|
||||
$(ODIR)/%.o: %.cpp
|
||||
$(CXX) $(CFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
rm -f $(TARGET) $(ODIR)/*.o
|
||||
|
||||
-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)
|
||||
-100
@@ -1,100 +0,0 @@
|
||||
Emma
|
||||
Isabella
|
||||
Emily
|
||||
Madison
|
||||
Ava
|
||||
Olivia
|
||||
Sophie
|
||||
Abigail
|
||||
Elizabeth
|
||||
Chloe
|
||||
Samantha
|
||||
Addison
|
||||
Natalie
|
||||
Mia
|
||||
Alexis
|
||||
Alyssa
|
||||
Hannah
|
||||
Ashley
|
||||
Ella
|
||||
Sarah
|
||||
Grace
|
||||
Brianna
|
||||
Lily
|
||||
Hailey
|
||||
Anna
|
||||
Victoria
|
||||
Kayla
|
||||
Lillian
|
||||
Lauren
|
||||
Kaylee
|
||||
Allison
|
||||
Savannah
|
||||
Nevaeh
|
||||
Gabriella
|
||||
Sofia
|
||||
Makayla
|
||||
Avery
|
||||
Riley
|
||||
Julia
|
||||
Leah
|
||||
Aubrey
|
||||
Jasmine
|
||||
Audrey
|
||||
Katie
|
||||
Morgan
|
||||
Brooklyn
|
||||
Destiny
|
||||
Sydney
|
||||
Alexa
|
||||
Kylie
|
||||
Brooke
|
||||
Kaitlin
|
||||
Evelyn
|
||||
Layla
|
||||
Madeline
|
||||
Kimberly
|
||||
Kim
|
||||
Zoe
|
||||
Jessica
|
||||
Jessie
|
||||
Alexandra
|
||||
Claire
|
||||
Madelyn
|
||||
Maria
|
||||
Arianna
|
||||
Jocelyn
|
||||
Amelia
|
||||
Angelina
|
||||
Trinity
|
||||
Andrea
|
||||
Maya
|
||||
Valeria
|
||||
Sophie
|
||||
Rachel
|
||||
Vanessa
|
||||
Aaliyah
|
||||
Mariah
|
||||
Gabrielle
|
||||
Katelyn
|
||||
Ariana
|
||||
Bailey
|
||||
Camilla
|
||||
Jennifer
|
||||
Jen
|
||||
Melanie
|
||||
Gianna
|
||||
Charlotte
|
||||
Paige
|
||||
Autumn
|
||||
Payton
|
||||
Faith
|
||||
Sara
|
||||
Isabelle
|
||||
Caroline
|
||||
Genesis
|
||||
Isabel
|
||||
Mary
|
||||
Zoey
|
||||
Gracie
|
||||
Megan
|
||||
-100
@@ -1,100 +0,0 @@
|
||||
Smith
|
||||
Johnson
|
||||
Williams
|
||||
Jones
|
||||
Brown
|
||||
Davis
|
||||
Miller
|
||||
Wilson
|
||||
Moore
|
||||
Taylor
|
||||
Anderson
|
||||
Thomas
|
||||
Jackson
|
||||
White
|
||||
Harris
|
||||
Martin
|
||||
Thompson
|
||||
Garcia
|
||||
Martinez
|
||||
Robinson
|
||||
Clark
|
||||
Rodriguez
|
||||
Lewis
|
||||
Lee
|
||||
Walker
|
||||
Hall
|
||||
Allen
|
||||
Young
|
||||
Hernandez
|
||||
King
|
||||
Wright
|
||||
Lopez
|
||||
Hill
|
||||
Scott
|
||||
Green
|
||||
Adams
|
||||
Baker
|
||||
Gonzalez
|
||||
Nelson
|
||||
Carter
|
||||
Mitchell
|
||||
Perez
|
||||
Roberts
|
||||
Turner
|
||||
Phillips
|
||||
Campbell
|
||||
Parker
|
||||
Evans
|
||||
Edwards
|
||||
Collins
|
||||
Stewart
|
||||
Sanchez
|
||||
Morris
|
||||
Rogers
|
||||
Reed
|
||||
Cook
|
||||
Morgan
|
||||
Bell
|
||||
Murphy
|
||||
Bailey
|
||||
Rivera
|
||||
Cooper
|
||||
Richardson
|
||||
Cox
|
||||
Howard
|
||||
Ward
|
||||
Torres
|
||||
Peterson
|
||||
Gray
|
||||
Ramirez
|
||||
James
|
||||
Watson
|
||||
Brooks
|
||||
Kelly
|
||||
Sanders
|
||||
Price
|
||||
Bennett
|
||||
Wood
|
||||
Barnes
|
||||
Ross
|
||||
Henderson
|
||||
Coleman
|
||||
Jenkins
|
||||
Perry
|
||||
Powell
|
||||
Long
|
||||
Patterson
|
||||
Hughes
|
||||
Flores
|
||||
Washington
|
||||
Butler
|
||||
Simmons
|
||||
Foster
|
||||
Gonzales
|
||||
Bryant
|
||||
Alexander
|
||||
Russell
|
||||
Griffin
|
||||
Diaz
|
||||
Hayes
|
||||
-100
@@ -1,100 +0,0 @@
|
||||
Jacob
|
||||
Michael
|
||||
Ethan
|
||||
Joshua
|
||||
Daniel
|
||||
Alexander
|
||||
Anthony
|
||||
William
|
||||
Christopher
|
||||
Matthew
|
||||
Jayden
|
||||
Andrew
|
||||
Joseph
|
||||
David
|
||||
Noah
|
||||
Aiden
|
||||
James
|
||||
Ryan
|
||||
Logan
|
||||
John
|
||||
Nathan
|
||||
Elijah
|
||||
Christian
|
||||
Gabriel
|
||||
Benjamin
|
||||
Jonathan
|
||||
Tyler
|
||||
Samuel
|
||||
Nicholas
|
||||
Gavin
|
||||
Dylan
|
||||
Jackson
|
||||
Brandon
|
||||
Caleb
|
||||
Mason
|
||||
Angel
|
||||
Isaac
|
||||
Evan
|
||||
Jack
|
||||
Kevin
|
||||
Jose
|
||||
Isaiah
|
||||
Luke
|
||||
Landon
|
||||
Justin
|
||||
Lucas
|
||||
Zachary
|
||||
Jordan
|
||||
Robert
|
||||
Aaron
|
||||
Brayden
|
||||
Thomas
|
||||
Cameron
|
||||
Hunter
|
||||
Austin
|
||||
Adrian
|
||||
Connor
|
||||
Owen
|
||||
Aidan
|
||||
Jason
|
||||
Julian
|
||||
Wyatt
|
||||
Charles
|
||||
Luis
|
||||
Carter
|
||||
Juan
|
||||
Chase
|
||||
Diego
|
||||
Jeremiah
|
||||
Brody
|
||||
Xavier
|
||||
Adam
|
||||
Carlos
|
||||
Sabastian
|
||||
Liam
|
||||
Hayden
|
||||
Nathaniel
|
||||
Henry
|
||||
Jesus
|
||||
Ian
|
||||
Tristan
|
||||
Bryan
|
||||
Sean
|
||||
Cole
|
||||
Alex
|
||||
Eric
|
||||
Brian
|
||||
Jaden
|
||||
Carson
|
||||
Blake
|
||||
Ayden
|
||||
Cooper
|
||||
Dominic
|
||||
Brady
|
||||
Caden
|
||||
Josiah
|
||||
Kyle
|
||||
Colton
|
||||
Kaden
|
||||
Eli
|
||||
@@ -0,0 +1,56 @@
|
||||
Cataclysm is a post-apocalyptic roguelike, set in the countryside of New England
|
||||
after a devastating plague of monsters and zombies.
|
||||
|
||||
At present time, Cataclysm is still in early alpha, and is being developed very
|
||||
rapidly. As such, there are no formal version numbers, as a new version is
|
||||
released every day, often several a day.
|
||||
|
||||
Source is available at the github repository, http://github.com/Whales/Cataclysm
|
||||
There is also a tarball available at http://squidnet.ath.cx/cataclysm.tar.gz
|
||||
Squidnet maintains a public SSH server. If you cannot play Cataclysm locally,
|
||||
or if you prefer to play it in a world shared with others, connect to
|
||||
cataclysm@squidnet.ath.cx (there is no password).
|
||||
|
||||
Compiling Cataclysm under linux is straightforward, and only requires the
|
||||
ncurses development libraries. Under Ubuntu, these libraries can be found in
|
||||
the libncurses5-dev package ("sudo apt-get install libncurses5-dev" will install
|
||||
this package).
|
||||
|
||||
Cataclysm is very different from most roguelikes in many ways. Rather than
|
||||
being set in a vertical, linear dungeon, it is set in an unbounded, 3D world.
|
||||
This means that exploration plays a much bigger role than in most roguelikes,
|
||||
and the game is much less linear.
|
||||
Because the map is so huge, it is actually completely persistant between games.
|
||||
If you die, and start a new character, your new game will be set in the same
|
||||
game world as your last. Like in many roguelikes, you will be able to loot the
|
||||
dead bodies of previous characters; unlike most roguelikes, you will also be
|
||||
able to retrace their steps completely, and any dramatic changes made to the
|
||||
world will persist into your next game.
|
||||
While this makes for interesting depth of play, and the ability to "save" game
|
||||
progress even after death, some prefer to start each game with a freshly
|
||||
generated world. This can be achieved by erasing the contents of the save
|
||||
directory, found in the same folder as the executable. "rm save/*" will erase
|
||||
these files for you.
|
||||
|
||||
Cataclysm's gameplay also includes many unique quirks, and the learning curve is
|
||||
somewhat steep, even for those experienced with roguelikes. Included with the
|
||||
game is a tutorial which runs the player through most of the key features. The
|
||||
game also has extensive documentation via the ? command. Pressing ?1 will list
|
||||
all the key commands, which is a good place to start.
|
||||
|
||||
To submit a bug, complaint, feature request, or praise, please send them via
|
||||
email to TheDarklingWolf@gmail.com. You can also submit problem reports and
|
||||
patches at the github repository at http://github.com/Whales/Cataclysm .
|
||||
|
||||
I strive to include as many feature requests as possible, and if you submit one
|
||||
there is a good chance that it will appear in the game within a few days. Of
|
||||
course, it is inevitable that I will reject some feature requests, either
|
||||
because they do not fit my conception of the game, or because they require more
|
||||
code than I think they're worth. Feature requests supplied in the form of a
|
||||
patch stand a better chance of inclusion, of course ;) For instructions on
|
||||
making changes to item types, monster types, etc., please see the EDITING file.
|
||||
Most changes of this variety require no training in C++, or programming in
|
||||
general.
|
||||
|
||||
If you want to take Cataclysm in a new direction, please feel free to create a
|
||||
branch project--just let me know about it!
|
||||
@@ -0,0 +1,13 @@
|
||||
Cataclysm: Dark Days Ahead
|
||||
==========================
|
||||
You emerge from the shelter into the dim light of an overcast day, and look around for the first time since the disaster.
|
||||
|
||||
The world as you knew it is gone. A ruined world stands in its place, full of nightmares come to life. Nothing can ever go back to the way it was, before the Cataclysm, but you have to be strong. You have to survive. You have to persevere. If you don't, death will be one of the better outcomes.
|
||||
|
||||
Above your head, storm clouds gather, and the rain stings and hisses against your skin. You shoulder your backpack, and start walking. The world has gone to hell, but you get the sinking feeling that there are darker days ahead.
|
||||
|
||||
Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world. While some have described it as a "zombie game", there's far more to Cataclysm than that. Struggle to survive in a harsh, persistant, procedurally generated world. Scavenge the remnants of a dead civilization for for food, equipment, or, if you're lucky, a vehicle with a full tank of gas to get you the hell out of Dodge. Fight to defeat or escape from a wide variety of powerful monstrosities, from zombies to giant insects to killer robots and things far stranger and deadlier, and against the others like yourself, that want what you have...
|
||||
|
||||
Build the tools and defenses you will need to overcome the challenges you face, from a strongly fortified lair full of customized firearms and surrounded by pits and landmines, to a mobile, gasoline powered blade spinning fortress of death, tearing apart anything stupid enough to get in the way. And finally, improve! Learn skills to help you survive, acquire mind-bending mutations, and convert your own body into a cybernetic masterpiece.
|
||||
|
||||
Make no mistake - there is no other game quite like Cataclysm. How long can you survive?
|
||||
+406
@@ -0,0 +1,406 @@
|
||||
#include "game.h"
|
||||
#include "keypress.h"
|
||||
#include <fstream>
|
||||
|
||||
void game::load_keyboard_settings()
|
||||
{
|
||||
std::ifstream fin;
|
||||
fin.open("data/keymap.txt");
|
||||
if (!fin) { // It doesn't exist
|
||||
std::ofstream fout;
|
||||
fout.open("data/keymap.txt");
|
||||
fout << default_keymap_txt();
|
||||
fout.close();
|
||||
fin.open("data/keymap.txt");
|
||||
}
|
||||
if (!fin) { // Still can't open it--probably bad permissions
|
||||
debugmsg("Can't open data/keymap.txt. This may be a permissions issue.");
|
||||
return;
|
||||
}
|
||||
while (!fin.eof()) {
|
||||
std::string id;
|
||||
fin >> id;
|
||||
if (id == "")
|
||||
getline(fin, id); // Empty line, chomp it
|
||||
else if (id[0] != '#') {
|
||||
action_id act = look_up_action(id);
|
||||
if (act == ACTION_NULL)
|
||||
debugmsg("\
|
||||
Warning! data/keymap.txt contains an unknown action, \"%s\"\n\
|
||||
Fix data/keymap.txt at your next chance!", id.c_str());
|
||||
else {
|
||||
while (fin.peek() != '\n' && !fin.eof()) {
|
||||
char ch;
|
||||
fin >> ch;
|
||||
if (keymap.find(ch) != keymap.end())
|
||||
debugmsg("\
|
||||
Warning! '%c' assigned twice in the keymap!\n\
|
||||
%s is being ignored.\n\
|
||||
Fix data/keymap.txt at your next chance!", ch, id.c_str());
|
||||
else
|
||||
keymap[ ch ] = act;
|
||||
}
|
||||
}
|
||||
} else {
|
||||
getline(fin, id); // Clear the whole line
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void game::save_keymap()
|
||||
{
|
||||
std::ofstream fout;
|
||||
fout.open("data/keymap.txt");
|
||||
if (!fout) { // It doesn't exist
|
||||
debugmsg("Can't open data/keymap.txt.");
|
||||
fout.close();
|
||||
return;
|
||||
}
|
||||
std::map<char, action_id>::iterator it;
|
||||
for (it = keymap.begin(); it != keymap.end(); it++)
|
||||
fout << action_ident( (*it).second ) << " " << (*it).first << std::endl;
|
||||
|
||||
fout.close();
|
||||
}
|
||||
|
||||
std::vector<char> game::keys_bound_to(action_id act)
|
||||
{
|
||||
std::vector<char> ret;
|
||||
std::map<char, action_id>::iterator it;
|
||||
for (it = keymap.begin(); it != keymap.end(); it++) {
|
||||
if ( (*it).second == act )
|
||||
ret.push_back( (*it).first );
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void game::clear_bindings(action_id act)
|
||||
{
|
||||
std::map<char, action_id>::iterator it;
|
||||
for (it = keymap.begin(); it != keymap.end(); it++) {
|
||||
if ( (*it).second == act ) {
|
||||
keymap.erase(it);
|
||||
it = keymap.begin();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string action_ident(action_id act)
|
||||
{
|
||||
switch (act) {
|
||||
case ACTION_PAUSE:
|
||||
return "pause";
|
||||
case ACTION_MOVE_N:
|
||||
return "move_n";
|
||||
case ACTION_MOVE_NE:
|
||||
return "move_ne";
|
||||
case ACTION_MOVE_E:
|
||||
return "move_e";
|
||||
case ACTION_MOVE_SE:
|
||||
return "move_se";
|
||||
case ACTION_MOVE_S:
|
||||
return "move_s";
|
||||
case ACTION_MOVE_SW:
|
||||
return "move_sw";
|
||||
case ACTION_MOVE_W:
|
||||
return "move_w";
|
||||
case ACTION_MOVE_NW:
|
||||
return "move_nw";
|
||||
case ACTION_MOVE_DOWN:
|
||||
return "move_down";
|
||||
case ACTION_MOVE_UP:
|
||||
return "move_up";
|
||||
case ACTION_CENTER:
|
||||
return "center";
|
||||
case ACTION_SHIFT_N:
|
||||
return "shift_n";
|
||||
case ACTION_SHIFT_NE:
|
||||
return "shift_ne";
|
||||
case ACTION_SHIFT_E:
|
||||
return "shift_e";
|
||||
case ACTION_SHIFT_SE:
|
||||
return "shift_se";
|
||||
case ACTION_SHIFT_S:
|
||||
return "shift_s";
|
||||
case ACTION_SHIFT_SW:
|
||||
return "shift_sw";
|
||||
case ACTION_SHIFT_W:
|
||||
return "shift_w";
|
||||
case ACTION_SHIFT_NW:
|
||||
return "shift_nw";
|
||||
case ACTION_OPEN:
|
||||
return "open";
|
||||
case ACTION_CLOSE:
|
||||
return "close";
|
||||
case ACTION_SMASH:
|
||||
return "smash";
|
||||
case ACTION_EXAMINE:
|
||||
return "examine";
|
||||
case ACTION_PICKUP:
|
||||
return "pickup";
|
||||
case ACTION_BUTCHER:
|
||||
return "butcher";
|
||||
case ACTION_CHAT:
|
||||
return "chat";
|
||||
case ACTION_LOOK:
|
||||
return "look";
|
||||
case ACTION_PEEK:
|
||||
return "peek";
|
||||
case ACTION_LIST_ITEMS:
|
||||
return "listitems";
|
||||
case ACTION_INVENTORY:
|
||||
return "inventory";
|
||||
case ACTION_COMPARE:
|
||||
return "compare";
|
||||
case ACTION_ORGANIZE:
|
||||
return "organize";
|
||||
case ACTION_USE:
|
||||
return "apply";
|
||||
case ACTION_USE_WIELDED:
|
||||
return "apply_wielded";
|
||||
case ACTION_WEAR:
|
||||
return "wear";
|
||||
case ACTION_TAKE_OFF:
|
||||
return "take_off";
|
||||
case ACTION_EAT:
|
||||
return "eat";
|
||||
case ACTION_READ:
|
||||
return "read";
|
||||
case ACTION_WIELD:
|
||||
return "wield";
|
||||
case ACTION_PICK_STYLE:
|
||||
return "pick_style";
|
||||
case ACTION_RELOAD:
|
||||
return "reload";
|
||||
case ACTION_UNLOAD:
|
||||
return "unload";
|
||||
case ACTION_THROW:
|
||||
return "throw";
|
||||
case ACTION_FIRE:
|
||||
return "fire";
|
||||
case ACTION_FIRE_BURST:
|
||||
return "fire_burst";
|
||||
case ACTION_SELECT_FIRE_MODE:
|
||||
return "select_fire_mode";
|
||||
case ACTION_DROP:
|
||||
return "drop";
|
||||
case ACTION_DIR_DROP:
|
||||
return "drop_adj";
|
||||
case ACTION_BIONICS:
|
||||
return "bionics";
|
||||
case ACTION_WAIT:
|
||||
return "wait";
|
||||
case ACTION_CRAFT:
|
||||
return "craft";
|
||||
case ACTION_RECRAFT:
|
||||
return "recraft";
|
||||
case ACTION_LONGCRAFT:
|
||||
return "long_craft";
|
||||
case ACTION_CONSTRUCT:
|
||||
return "construct";
|
||||
case ACTION_DISASSEMBLE:
|
||||
return "disassemble";
|
||||
case ACTION_SLEEP:
|
||||
return "sleep";
|
||||
case ACTION_TOGGLE_SAFEMODE:
|
||||
return "safemode";
|
||||
case ACTION_TOGGLE_AUTOSAFE:
|
||||
return "autosafe";
|
||||
case ACTION_IGNORE_ENEMY:
|
||||
return "ignore_enemy";
|
||||
case ACTION_SAVE:
|
||||
return "save";
|
||||
case ACTION_QUIT:
|
||||
return "quit";
|
||||
case ACTION_PL_INFO:
|
||||
return "player_data";
|
||||
case ACTION_MAP:
|
||||
return "map";
|
||||
case ACTION_MISSIONS:
|
||||
return "missions";
|
||||
case ACTION_FACTIONS:
|
||||
return "factions";
|
||||
case ACTION_KILLS:
|
||||
return "kills";
|
||||
case ACTION_MORALE:
|
||||
return "morale";
|
||||
case ACTION_MESSAGES:
|
||||
return "messages";
|
||||
case ACTION_HELP:
|
||||
return "help";
|
||||
case ACTION_DEBUG:
|
||||
return "debug";
|
||||
case ACTION_DISPLAY_SCENT:
|
||||
return "debug_scent";
|
||||
case ACTION_TOGGLE_DEBUGMON:
|
||||
return "debug_mode";
|
||||
case ACTION_NULL:
|
||||
return "null";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
action_id look_up_action(std::string ident)
|
||||
{
|
||||
for (int i = 0; i < NUM_ACTIONS; i++) {
|
||||
if (action_ident( action_id(i) ) == ident)
|
||||
return action_id(i);
|
||||
}
|
||||
return ACTION_NULL;
|
||||
}
|
||||
|
||||
std::string action_name(action_id act)
|
||||
{
|
||||
switch (act) {
|
||||
case ACTION_PAUSE:
|
||||
return "Pause";
|
||||
case ACTION_MOVE_N:
|
||||
return "Move North";
|
||||
case ACTION_MOVE_NE:
|
||||
return "Move Northeast";
|
||||
case ACTION_MOVE_E:
|
||||
return "Move East";
|
||||
case ACTION_MOVE_SE:
|
||||
return "Move Southeast";
|
||||
case ACTION_MOVE_S:
|
||||
return "Move South";
|
||||
case ACTION_MOVE_SW:
|
||||
return "Move Southwest";
|
||||
case ACTION_MOVE_W:
|
||||
return "Move West";
|
||||
case ACTION_MOVE_NW:
|
||||
return "Move Northwest";
|
||||
case ACTION_MOVE_DOWN:
|
||||
return "Descend Stairs";
|
||||
case ACTION_MOVE_UP:
|
||||
return "Ascend Stairs";
|
||||
case ACTION_CENTER:
|
||||
return "Center View";
|
||||
case ACTION_SHIFT_N:
|
||||
return "Move View North";
|
||||
case ACTION_SHIFT_NE:
|
||||
return "Move View Northeast";
|
||||
case ACTION_SHIFT_E:
|
||||
return "Move View East";
|
||||
case ACTION_SHIFT_SE:
|
||||
return "Move View Southeast";
|
||||
case ACTION_SHIFT_S:
|
||||
return "Move View South";
|
||||
case ACTION_SHIFT_SW:
|
||||
return "Move View Southwest";
|
||||
case ACTION_SHIFT_W:
|
||||
return "Move View West";
|
||||
case ACTION_SHIFT_NW:
|
||||
return "Move View Northwest";
|
||||
case ACTION_OPEN:
|
||||
return "Open Door";
|
||||
case ACTION_CLOSE:
|
||||
return "Close Door";
|
||||
case ACTION_SMASH:
|
||||
return "Smash Nearby Terrain";
|
||||
case ACTION_EXAMINE:
|
||||
return "Examine Nearby Terrain";
|
||||
case ACTION_PICKUP:
|
||||
return "Pick Item(s) Up";
|
||||
case ACTION_BUTCHER:
|
||||
return "Butcher";
|
||||
case ACTION_CHAT:
|
||||
return "Chat with NPC";
|
||||
case ACTION_LOOK:
|
||||
return "Look Around";
|
||||
case ACTION_PEEK:
|
||||
return "Peek Around Corners";
|
||||
case ACTION_LIST_ITEMS:
|
||||
return "List all items around the player";
|
||||
case ACTION_INVENTORY:
|
||||
return "Open Inventory";
|
||||
case ACTION_COMPARE:
|
||||
return "Compare two Items";
|
||||
case ACTION_ORGANIZE:
|
||||
return "Swap Inventory Letters";
|
||||
case ACTION_USE:
|
||||
return "Apply or Use Item";
|
||||
case ACTION_USE_WIELDED:
|
||||
return "Apply or Use Wielded Item";
|
||||
case ACTION_WEAR:
|
||||
return "Wear Item";
|
||||
case ACTION_TAKE_OFF:
|
||||
return "Take Off Worn Item";
|
||||
case ACTION_EAT:
|
||||
return "Eat";
|
||||
case ACTION_READ:
|
||||
return "Read";
|
||||
case ACTION_WIELD:
|
||||
return "Wield";
|
||||
case ACTION_PICK_STYLE:
|
||||
return "Select Unarmed Style";
|
||||
case ACTION_RELOAD:
|
||||
return "Reload Wielded Item";
|
||||
case ACTION_UNLOAD:
|
||||
return "Unload or Empty Wielded Item";
|
||||
case ACTION_THROW:
|
||||
return "Throw Item";
|
||||
case ACTION_FIRE:
|
||||
return "Fire Wielded Item";
|
||||
case ACTION_FIRE_BURST:
|
||||
return "Burst-Fire Wielded Item";
|
||||
case ACTION_SELECT_FIRE_MODE:
|
||||
return "Toggle attack mode of Wielded Item";
|
||||
case ACTION_DROP:
|
||||
return "Drop Item";
|
||||
case ACTION_DIR_DROP:
|
||||
return "Drop Item to Adjacent Tile";
|
||||
case ACTION_BIONICS:
|
||||
return "View/Activate Bionics";
|
||||
case ACTION_WAIT:
|
||||
return "Wait for Several Minutes";
|
||||
case ACTION_CRAFT:
|
||||
return "Craft Items";
|
||||
case ACTION_RECRAFT:
|
||||
return "Recraft last recipe";
|
||||
case ACTION_LONGCRAFT:
|
||||
return "Craft as long as possible";
|
||||
case ACTION_CONSTRUCT:
|
||||
return "Construct Terrain";
|
||||
case ACTION_DISASSEMBLE:
|
||||
return "Disassemble items";
|
||||
case ACTION_SLEEP:
|
||||
return "Sleep";
|
||||
case ACTION_TOGGLE_SAFEMODE:
|
||||
return "Toggle Safemode";
|
||||
case ACTION_TOGGLE_AUTOSAFE:
|
||||
return "Toggle Auto-Safemode";
|
||||
case ACTION_IGNORE_ENEMY:
|
||||
return "Ignore Nearby Enemy";
|
||||
case ACTION_SAVE:
|
||||
return "Save and Quit";
|
||||
case ACTION_QUIT:
|
||||
return "Commit Suicide";
|
||||
case ACTION_PL_INFO:
|
||||
return "View Player Info";
|
||||
case ACTION_MAP:
|
||||
return "View Map";
|
||||
case ACTION_MISSIONS:
|
||||
return "View Missions";
|
||||
case ACTION_FACTIONS:
|
||||
return "View Factions";
|
||||
case ACTION_KILLS:
|
||||
return "View Kills";
|
||||
case ACTION_MORALE:
|
||||
return "View Morale";
|
||||
case ACTION_MESSAGES:
|
||||
return "View Message Log";
|
||||
case ACTION_HELP:
|
||||
return "View Help";
|
||||
case ACTION_DEBUG:
|
||||
return "Debug Menu";
|
||||
case ACTION_DISPLAY_SCENT:
|
||||
return "View Scentmap";
|
||||
case ACTION_TOGGLE_DEBUGMON:
|
||||
return "Toggle Debug Messages";
|
||||
case ACTION_NULL:
|
||||
return "No Action";
|
||||
}
|
||||
return "Someone forgot to name an action.";
|
||||
}
|
||||
@@ -0,0 +1,93 @@
|
||||
#ifndef _ACTION_H_
|
||||
#define _ACTION_H_
|
||||
|
||||
enum action_id {
|
||||
ACTION_NULL = 0,
|
||||
// Movement
|
||||
ACTION_PAUSE,
|
||||
ACTION_MOVE_N,
|
||||
ACTION_MOVE_NE,
|
||||
ACTION_MOVE_E,
|
||||
ACTION_MOVE_SE,
|
||||
ACTION_MOVE_S,
|
||||
ACTION_MOVE_SW,
|
||||
ACTION_MOVE_W,
|
||||
ACTION_MOVE_NW,
|
||||
ACTION_MOVE_DOWN,
|
||||
ACTION_MOVE_UP,
|
||||
// Shift view
|
||||
ACTION_CENTER,
|
||||
ACTION_SHIFT_N,
|
||||
ACTION_SHIFT_NE,
|
||||
ACTION_SHIFT_E,
|
||||
ACTION_SHIFT_SE,
|
||||
ACTION_SHIFT_S,
|
||||
ACTION_SHIFT_SW,
|
||||
ACTION_SHIFT_W,
|
||||
ACTION_SHIFT_NW,
|
||||
// Environment Interaction
|
||||
ACTION_OPEN,
|
||||
ACTION_CLOSE,
|
||||
ACTION_SMASH,
|
||||
ACTION_EXAMINE,
|
||||
ACTION_PICKUP,
|
||||
ACTION_BUTCHER,
|
||||
ACTION_CHAT,
|
||||
ACTION_LOOK,
|
||||
ACTION_PEEK,
|
||||
ACTION_LIST_ITEMS,
|
||||
// Inventory Interaction (including quasi-inventories like bionics)
|
||||
ACTION_INVENTORY,
|
||||
ACTION_COMPARE,
|
||||
ACTION_ORGANIZE,
|
||||
ACTION_USE,
|
||||
ACTION_USE_WIELDED,
|
||||
ACTION_WEAR,
|
||||
ACTION_TAKE_OFF,
|
||||
ACTION_EAT,
|
||||
ACTION_READ,
|
||||
ACTION_WIELD,
|
||||
ACTION_PICK_STYLE,
|
||||
ACTION_RELOAD,
|
||||
ACTION_UNLOAD,
|
||||
ACTION_THROW,
|
||||
ACTION_FIRE,
|
||||
ACTION_FIRE_BURST,
|
||||
ACTION_SELECT_FIRE_MODE,
|
||||
ACTION_DROP,
|
||||
ACTION_DIR_DROP,
|
||||
ACTION_BIONICS,
|
||||
// Long-term / special actions
|
||||
ACTION_WAIT,
|
||||
ACTION_CRAFT,
|
||||
ACTION_RECRAFT,
|
||||
ACTION_LONGCRAFT,
|
||||
ACTION_CONSTRUCT,
|
||||
ACTION_DISASSEMBLE,
|
||||
ACTION_SLEEP,
|
||||
ACTION_TOGGLE_SAFEMODE,
|
||||
ACTION_TOGGLE_AUTOSAFE,
|
||||
ACTION_IGNORE_ENEMY,
|
||||
ACTION_SAVE,
|
||||
ACTION_QUIT,
|
||||
// Info Screens
|
||||
ACTION_PL_INFO,
|
||||
ACTION_MAP,
|
||||
ACTION_MISSIONS,
|
||||
ACTION_KILLS,
|
||||
ACTION_FACTIONS,
|
||||
ACTION_MORALE,
|
||||
ACTION_MESSAGES,
|
||||
ACTION_HELP,
|
||||
// Debug Functions
|
||||
ACTION_DEBUG,
|
||||
ACTION_DISPLAY_SCENT,
|
||||
ACTION_TOGGLE_DEBUGMON,
|
||||
NUM_ACTIONS
|
||||
};
|
||||
|
||||
action_id look_up_action(std::string ident);
|
||||
std::string action_ident(action_id);
|
||||
std::string action_name(action_id);
|
||||
|
||||
#endif
|
||||
+76
-50
@@ -3,38 +3,37 @@
|
||||
|
||||
#include "rng.h"
|
||||
#include "game.h"
|
||||
#include "morale.h"
|
||||
#include <sstream>
|
||||
|
||||
#define MIN_ADDICTION_LEVEL 3 // Minimum intensity before effects are seen
|
||||
|
||||
void addict_effect(game *g, addiction &add)
|
||||
{
|
||||
int in = add.intensity;
|
||||
|
||||
switch (add.type) {
|
||||
case ADD_CIG:
|
||||
g->u.int_cur--;
|
||||
if (in > 20 || one_in((500 - 20 * in))) {
|
||||
g->add_msg("You %s a cigarette.",
|
||||
rng(0, 6) < in ? "need" : "could use");
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
g->cancel_activity_query("You have a nicotine craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_NICOTINE, -15, -50);
|
||||
if (one_in(800 - 50 * in))
|
||||
g->u.fatigue++;
|
||||
if (one_in(400 - 20 * in))
|
||||
g->u.stim--;
|
||||
if (one_in((800 - 10 * in)))
|
||||
g->u.morale--;
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
case ADD_CAFFEINE:
|
||||
g->u.str_cur--;
|
||||
g->u.moves -= 2;
|
||||
if (in > 20 || one_in((500 - 20 * in))) {
|
||||
g->add_msg("You want some caffeine.");
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
g->cancel_activity_query("You have a caffeine craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_CAFFEINE, -5, -30);
|
||||
if (rng(0, 10) < in)
|
||||
g->u.stim--;
|
||||
if (in > 19 || one_in((1000 - 50 * in)))
|
||||
g->u.morale--;
|
||||
if (rng(8, 400) < in) {
|
||||
g->add_msg("Your hands start shaking... you need it bad!");
|
||||
g->u.add_disease(DI_SHAKES, 20, g);
|
||||
@@ -49,11 +48,12 @@ void addict_effect(game *g, addiction &add)
|
||||
g->u.health--;
|
||||
if (one_in(20) && rng(0, 20) < in) {
|
||||
g->add_msg("You could use a drink.");
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
g->u.morale -= rng(1, 4);
|
||||
g->cancel_activity_query("You have an alcohol craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_ALCOHOL, -35, -120);
|
||||
} else if (rng(8, 300) < in) {
|
||||
g->add_msg("Your hands start shaking... you need a drink bad!");
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
g->cancel_activity_query("You have an alcohol craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_ALCOHOL, -35, -120);
|
||||
g->u.add_disease(DI_SHAKES, 50, g);
|
||||
} else if (!g->u.has_disease(DI_HALLU) && rng(10, 1600) < in)
|
||||
g->u.add_disease(DI_HALLU, 3600, g);
|
||||
@@ -67,72 +67,92 @@ void addict_effect(game *g, addiction &add)
|
||||
break;
|
||||
|
||||
case ADD_PKILLER:
|
||||
g->u.str_cur -= 1 + int(in / 7);
|
||||
g->u.per_cur--;
|
||||
g->u.dex_cur--;
|
||||
if (g->u.pain < in * 3)
|
||||
g->u.pain++;
|
||||
if (g->u.morale > 0 - in)
|
||||
g->u.morale--;
|
||||
if ((in >= 25 || g->turn % (100 - in * 4) == 0) && g->u.pkill > 0)
|
||||
if ((in >= 25 || int(g->turn) % (100 - in * 4) == 0) && g->u.pkill > 0)
|
||||
g->u.pkill--; // Tolerance increases!
|
||||
if (in >= 40 || one_in((1200 - 30 * in)))
|
||||
g->u.health--;
|
||||
if (one_in(20) && dice(2, 20) < in) {
|
||||
g->add_msg("Your hands start shaking... you need some painkillers.");
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
g->u.add_disease(DI_SHAKES, 20 + in * 5, g);
|
||||
} else if (one_in(20) && dice(2, 30) < in) {
|
||||
g->add_msg("You feel anxious. You need your painkillers!");
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
g->u.morale -= 5;
|
||||
} else if (one_in(50) && dice(3, 50) < in) {
|
||||
g->add_msg("You throw up heavily!");
|
||||
g->cancel_activity_query("Throwing up.");
|
||||
g->u.vomit(g);
|
||||
if (g->u.pkill >= 35) // No further effects if we're doped up.
|
||||
add.sated = 0;
|
||||
else {
|
||||
g->u.str_cur -= 1 + int(in / 7);
|
||||
g->u.per_cur--;
|
||||
g->u.dex_cur--;
|
||||
if (g->u.pain < in * 3)
|
||||
g->u.pain++;
|
||||
if (in >= 40 || one_in((1200 - 30 * in)))
|
||||
g->u.health--;
|
||||
if (one_in(20) && dice(2, 20) < in) {
|
||||
g->add_msg("Your hands start shaking... you need some painkillers.");
|
||||
g->cancel_activity_query("You have an opiate craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_OPIATE, -40, -200);
|
||||
g->u.add_disease(DI_SHAKES, 20 + in * 5, g);
|
||||
} else if (one_in(20) && dice(2, 30) < in) {
|
||||
g->add_msg("You feel anxious. You need your painkillers!");
|
||||
g->u.add_morale(MORALE_CRAVING_OPIATE, -30, -200);
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
} else if (one_in(50) && dice(3, 50) < in) {
|
||||
g->add_msg("You throw up heavily!");
|
||||
g->cancel_activity_query("Throwing up.");
|
||||
g->u.vomit(g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ADD_SPEED:
|
||||
g->u.moves -= in;
|
||||
if (g->u.morale > 0 - in)
|
||||
g->u.morale--;
|
||||
case ADD_SPEED: {
|
||||
int move_pen = in * 5;
|
||||
if (move_pen > 30)
|
||||
move_pen = 30;
|
||||
g->u.moves -= move_pen;
|
||||
g->u.int_cur--;
|
||||
g->u.str_cur--;
|
||||
if (in >= 20 || g->turn % (100 - in * 5) == 0)
|
||||
if (g->u.stim > -100 && (in >= 20 || int(g->turn) % (100 - in * 5) == 0))
|
||||
g->u.stim--;
|
||||
if (rng(0, 150) <= in)
|
||||
g->u.health--;
|
||||
if (dice(2, 100) < in) {
|
||||
g->add_msg("You feel depressed. Speed would help.");
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
g->u.morale -= rng(1, 1 + int(in / 3));
|
||||
g->cancel_activity_query("You have a speed craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_SPEED, -25, -200);
|
||||
} else if (one_in(10) && dice(2, 80) < in) {
|
||||
g->add_msg("Your hands start shaking... you need a pick-me-up.");
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
g->cancel_activity_query("You have a speed craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_SPEED, -25, -200);
|
||||
g->u.add_disease(DI_SHAKES, in * 20, g);
|
||||
} else if (one_in(50) && dice(2, 100) < in) {
|
||||
g->add_msg("You stop suddenly, feeling bewildered.");
|
||||
g->cancel_activity();
|
||||
g->u.moves -= 300;
|
||||
} else if (!g->u.has_disease(DI_HALLU) && one_in(20) &&
|
||||
8 + dice(2, 80) < in) {
|
||||
8 + dice(2, 80) < in)
|
||||
g->u.add_disease(DI_HALLU, 3600, g);
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
|
||||
case ADD_COKE:
|
||||
g->u.int_cur--;
|
||||
g->u.per_cur--;
|
||||
if (g->u.morale > -20 && (in >= 30 || one_in((900 - 30 * in)))) {
|
||||
if (in >= 30 || one_in((900 - 30 * in))) {
|
||||
g->add_msg("You feel like you need a bump.");
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
g->u.morale -= 2;
|
||||
g->cancel_activity_query("You have a craving for cocaine.");
|
||||
g->u.add_morale(MORALE_CRAVING_COCAINE, -20, -250);
|
||||
}
|
||||
if (dice(2, 80) <= in) {
|
||||
g->add_msg("You feel like you need a bump.");
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
g->u.stim--;
|
||||
g->cancel_activity_query("You have a craving for cocaine.");
|
||||
g->u.add_morale(MORALE_CRAVING_COCAINE, -20, -250);
|
||||
g->u.stim -= 3;
|
||||
}
|
||||
break;
|
||||
case ADD_CRACK:
|
||||
g->u.int_cur--;
|
||||
g->u.per_cur--;
|
||||
if (in >= 30 || one_in((900 - 30 * in))) {
|
||||
g->add_msg("You're shivering, you need some crack.");
|
||||
g->cancel_activity_query("You have a craving for crack.");
|
||||
g->u.add_morale(MORALE_CRAVING_CRACK, -80, -250);
|
||||
}
|
||||
if (dice(2, 80) <= in) {
|
||||
g->add_msg("You're shivering, you need some crack.");
|
||||
g->cancel_activity_query("You have a craving for crack.");
|
||||
g->u.add_morale(MORALE_CRAVING_CRACK, -80, -250);
|
||||
g->u.stim -= 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
@@ -148,6 +168,7 @@ std::string addiction_name(addiction cur)
|
||||
case ADD_PKILLER: return "Opiate Withdrawal";
|
||||
case ADD_SPEED: return "Amphetamine Withdrawal";
|
||||
case ADD_COKE: return "Cocaine Withdrawal";
|
||||
case ADD_CRACK: return "Crack Cocaine Withdrawal";
|
||||
default: return "Erroneous addiction";
|
||||
}
|
||||
}
|
||||
@@ -183,6 +204,11 @@ Movement rate reduction. Depression. Weak immune system. Frequent cravings.";
|
||||
|
||||
case ADD_COKE:
|
||||
return "Perception - 1; Intelligence - 1; Frequent cravings.";
|
||||
|
||||
case ADD_CRACK:
|
||||
return "Perception - 2; Intelligence - 2; Frequent cravings.";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
+680
@@ -0,0 +1,680 @@
|
||||
#include <sstream>
|
||||
#include <vector>
|
||||
#include "game.h"
|
||||
#include "artifact.h"
|
||||
#include "artifactdata.h"
|
||||
|
||||
std::vector<art_effect_passive> fill_good_passive();
|
||||
std::vector<art_effect_passive> fill_bad_passive();
|
||||
std::vector<art_effect_active> fill_good_active();
|
||||
std::vector<art_effect_active> fill_bad_active();
|
||||
|
||||
std::string artifact_name(std::string type);
|
||||
|
||||
itype* game::new_artifact()
|
||||
{
|
||||
if (one_in(2)) { // Generate a "tool" artifact
|
||||
|
||||
it_artifact_tool *art = new it_artifact_tool();
|
||||
int form = rng(ARTTOOLFORM_NULL + 1, NUM_ARTTOOLFORMS - 1);
|
||||
|
||||
artifact_tool_form_datum *info = &(artifact_tool_form_data[form]);
|
||||
art->name = artifact_name(info->name);
|
||||
art->color = info->color;
|
||||
art->sym = info->sym;
|
||||
art->m1 = info->m1;
|
||||
art->m2 = info->m2;
|
||||
art->volume = rng(info->volume_min, info->volume_max);
|
||||
art->weight = rng(info->weight_min, info->weight_max);
|
||||
// Set up the basic weapon type
|
||||
artifact_weapon_datum *weapon = &(artifact_weapon_data[info->base_weapon]);
|
||||
art->melee_dam = rng(weapon->bash_min, weapon->bash_max);
|
||||
art->melee_cut = rng(weapon->cut_min, weapon->cut_max);
|
||||
art->m_to_hit = rng(weapon->to_hit_min, weapon->to_hit_max);
|
||||
art->item_flags = weapon->flags;
|
||||
// Add an extra weapon perhaps?
|
||||
if (one_in(2)) {
|
||||
int select = rng(0, 2);
|
||||
if (info->extra_weapons[select] != ARTWEAP_NULL) {
|
||||
weapon = &(artifact_weapon_data[ info->extra_weapons[select] ]);
|
||||
art->volume += weapon->volume;
|
||||
art->weight += weapon->weight;
|
||||
art->melee_dam += rng(weapon->bash_min, weapon->bash_max);
|
||||
art->melee_cut += rng(weapon->bash_min, weapon->bash_max);
|
||||
art->m_to_hit += rng(weapon->to_hit_min, weapon->to_hit_max);
|
||||
art->item_flags |= weapon->flags;
|
||||
std::stringstream newname;
|
||||
newname << weapon->adjective << " " << info->name;
|
||||
art->name = artifact_name(newname.str());
|
||||
}
|
||||
}
|
||||
|
||||
std::stringstream description;
|
||||
description << "This is the " << art->name << ".\n\
|
||||
It is the only one of its kind.\n\
|
||||
It may have unknown powers; use 'a' to activate them.";
|
||||
art->description = description.str();
|
||||
|
||||
// Finally, pick some powers
|
||||
art_effect_passive passive_tmp = AEP_NULL;
|
||||
art_effect_active active_tmp = AEA_NULL;
|
||||
int num_good = 0, num_bad = 0, value = 0;
|
||||
std::vector<art_effect_passive> good_effects = fill_good_passive();
|
||||
std::vector<art_effect_passive> bad_effects = fill_bad_passive();
|
||||
|
||||
// Wielded effects first
|
||||
while (!good_effects.empty() && !bad_effects.empty() &&
|
||||
num_good < 3 && num_bad < 3 &&
|
||||
(num_good < 1 || num_bad < 1 || one_in(num_good + 1) ||
|
||||
one_in(num_bad + 1) || value > 1)) {
|
||||
if (value < 1 && one_in(2)) { // Good
|
||||
int index = rng(0, good_effects.size() - 1);
|
||||
passive_tmp = good_effects[index];
|
||||
good_effects.erase(good_effects.begin() + index);
|
||||
num_good++;
|
||||
} else if (!bad_effects.empty()) { // Bad effect
|
||||
int index = rng(0, bad_effects.size() - 1);
|
||||
passive_tmp = bad_effects[index];
|
||||
bad_effects.erase(bad_effects.begin() + index);
|
||||
num_bad++;
|
||||
}
|
||||
value += passive_effect_cost[passive_tmp];
|
||||
art->effects_wielded.push_back(passive_tmp);
|
||||
}
|
||||
// Next, carried effects; more likely to be just bad
|
||||
num_good = 0;
|
||||
num_bad = 0;
|
||||
value = 0;
|
||||
good_effects = fill_good_passive();
|
||||
bad_effects = fill_bad_passive();
|
||||
while (one_in(2) && !good_effects.empty() && !bad_effects.empty() &&
|
||||
num_good < 3 && num_bad < 3 &&
|
||||
((num_good > 2 && one_in(num_good + 1)) || num_bad < 1 ||
|
||||
one_in(num_bad + 1) || value > 1)) {
|
||||
if (value < 1 && one_in(3)) { // Good
|
||||
int index = rng(0, good_effects.size() - 1);
|
||||
passive_tmp = good_effects[index];
|
||||
good_effects.erase(good_effects.begin() + index);
|
||||
num_good++;
|
||||
} else { // Bad effect
|
||||
int index = rng(0, bad_effects.size() - 1);
|
||||
passive_tmp = bad_effects[index];
|
||||
bad_effects.erase(bad_effects.begin() + index);
|
||||
num_bad++;
|
||||
}
|
||||
value += passive_effect_cost[passive_tmp];
|
||||
art->effects_carried.push_back(passive_tmp);
|
||||
}
|
||||
// Finally, activated effects; not necessarily good or bad
|
||||
num_good = 0;
|
||||
num_bad = 0;
|
||||
value = 0;
|
||||
art->def_charges = 0;
|
||||
art->max_charges = 0;
|
||||
std::vector<art_effect_active> good_a_effects = fill_good_active();
|
||||
std::vector<art_effect_active> bad_a_effects = fill_bad_active();
|
||||
while (!good_a_effects.empty() && !bad_a_effects.empty() &&
|
||||
num_good < 3 && num_bad < 3 &&
|
||||
(value > 3 || (num_bad > 0 && num_good == 0) ||
|
||||
!one_in(3 - num_good) || !one_in(3 - num_bad))) {
|
||||
if (!one_in(3) && value <= 1) { // Good effect
|
||||
int index = rng(0, good_a_effects.size() - 1);
|
||||
active_tmp = good_a_effects[index];
|
||||
good_a_effects.erase(good_a_effects.begin() + index);
|
||||
num_good++;
|
||||
value += active_effect_cost[active_tmp];
|
||||
} else { // Bad effect
|
||||
int index = rng(0, bad_a_effects.size() - 1);
|
||||
active_tmp = bad_a_effects[index];
|
||||
bad_a_effects.erase(bad_a_effects.begin() + index);
|
||||
num_bad++;
|
||||
value += active_effect_cost[active_tmp];
|
||||
}
|
||||
art->effects_activated.push_back(active_tmp);
|
||||
art->max_charges += rng(1, 3);
|
||||
}
|
||||
art->def_charges = art->max_charges;
|
||||
// If we have charges, pick a recharge mechanism
|
||||
if (art->max_charges > 0)
|
||||
art->charge_type = art_charge( rng(ARTC_NULL + 1, NUM_ARTCS - 1) );
|
||||
if (one_in(8) && num_bad + num_good >= 4)
|
||||
art->charge_type = ARTC_NULL; // 1 in 8 chance that it can't recharge!
|
||||
|
||||
art->id = itypes.size();
|
||||
itypes[art->name]=art;
|
||||
return art;
|
||||
|
||||
} else { // Generate an armor artifact
|
||||
|
||||
it_artifact_armor *art = new it_artifact_armor();
|
||||
int form = rng(ARTARMFORM_NULL + 1, NUM_ARTARMFORMS - 1);
|
||||
artifact_armor_form_datum *info = &(artifact_armor_form_data[form]);
|
||||
|
||||
art->name = artifact_name(info->name);
|
||||
art->sym = '['; // Armor is always [
|
||||
art->color = info->color;
|
||||
art->m1 = info->m1;
|
||||
art->m2 = info->m2;
|
||||
art->volume = info->volume;
|
||||
art->weight = info->weight;
|
||||
art->melee_dam = info->melee_bash;
|
||||
art->melee_cut = info->melee_cut;
|
||||
art->m_to_hit = info->melee_hit;
|
||||
art->item_flags = 0;
|
||||
art->covers = info->covers;
|
||||
art->encumber = info->encumb;
|
||||
art->dmg_resist = info->dmg_resist;
|
||||
art->cut_resist = info->cut_resist;
|
||||
art->env_resist = info->env_resist;
|
||||
art->warmth = info->warmth;
|
||||
art->storage = info->storage;
|
||||
std::stringstream description;
|
||||
description << "This is the " << art->name << ".\n" <<
|
||||
(info->plural ? "They are the only ones of their kind." :
|
||||
"It is the only one of its kind.");
|
||||
|
||||
// Modify the armor further
|
||||
if (!one_in(4)) {
|
||||
int index = rng(0, 4);
|
||||
if (info->available_mods[index] != ARMORMOD_NULL) {
|
||||
artifact_armor_mod mod = info->available_mods[index];
|
||||
artifact_armor_form_datum *modinfo = &(artifact_armor_mod_data[mod]);
|
||||
if (modinfo->volume >= 0 || art->volume > abs(modinfo->volume))
|
||||
art->volume += modinfo->volume;
|
||||
else
|
||||
art->volume = 1;
|
||||
|
||||
if (modinfo->weight >= 0 || art->weight > abs(modinfo->weight))
|
||||
art->weight += modinfo->weight;
|
||||
else
|
||||
art->weight = 1;
|
||||
|
||||
art->encumber += modinfo->encumb;
|
||||
|
||||
if (modinfo->dmg_resist > 0 || art->dmg_resist > abs(modinfo->dmg_resist))
|
||||
art->dmg_resist += modinfo->dmg_resist;
|
||||
else
|
||||
art->dmg_resist = 0;
|
||||
|
||||
if (modinfo->cut_resist > 0 || art->cut_resist > abs(modinfo->cut_resist))
|
||||
art->cut_resist += modinfo->cut_resist;
|
||||
else
|
||||
art->cut_resist = 0;
|
||||
|
||||
if (modinfo->env_resist > 0 || art->env_resist > abs(modinfo->env_resist))
|
||||
art->env_resist += modinfo->env_resist;
|
||||
else
|
||||
art->env_resist = 0;
|
||||
art->warmth += modinfo->warmth;
|
||||
|
||||
if (modinfo->storage > 0 || art->storage > abs(modinfo->storage))
|
||||
art->storage += modinfo->storage;
|
||||
else
|
||||
art->storage = 0;
|
||||
|
||||
description << "\n" << (info->plural ? "They are " : "It is ") <<
|
||||
modinfo->name;
|
||||
}
|
||||
}
|
||||
|
||||
art->description = description.str();
|
||||
|
||||
// Finally, pick some effects
|
||||
int num_good = 0, num_bad = 0, value = 0;
|
||||
art_effect_passive passive_tmp = AEP_NULL;
|
||||
std::vector<art_effect_passive> good_effects = fill_good_passive();
|
||||
std::vector<art_effect_passive> bad_effects = fill_bad_passive();
|
||||
|
||||
while (!good_effects.empty() && !bad_effects.empty() &&
|
||||
num_good < 3 && num_bad < 3 &&
|
||||
(num_good < 1 || one_in(num_good * 2) || value > 1 ||
|
||||
(num_bad < 3 && !one_in(3 - num_bad)))) {
|
||||
if (value < 1 && one_in(2)) { // Good effect
|
||||
int index = rng(0, good_effects.size() - 1);
|
||||
passive_tmp = good_effects[index];
|
||||
good_effects.erase(good_effects.begin() + index);
|
||||
num_good++;
|
||||
} else { // Bad effect
|
||||
int index = rng(0, bad_effects.size() - 1);
|
||||
passive_tmp = bad_effects[index];
|
||||
bad_effects.erase(bad_effects.begin() + index);
|
||||
num_bad++;
|
||||
}
|
||||
value += passive_effect_cost[passive_tmp];
|
||||
art->effects_worn.push_back(passive_tmp);
|
||||
}
|
||||
|
||||
art->id = itypes.size();
|
||||
itypes[art->name]=art;
|
||||
return art;
|
||||
}
|
||||
}
|
||||
|
||||
itype* game::new_natural_artifact(artifact_natural_property prop)
|
||||
{
|
||||
// Natural artifacts are always tools.
|
||||
it_artifact_tool *art = new it_artifact_tool();
|
||||
// Pick a form
|
||||
artifact_natural_shape shape =
|
||||
artifact_natural_shape(rng(ARTSHAPE_NULL + 1, ARTSHAPE_MAX - 1));
|
||||
artifact_shape_datum *shape_data = &(artifact_shape_data[shape]);
|
||||
// Pick a property
|
||||
artifact_natural_property property = (prop > ARTPROP_NULL ? prop :
|
||||
artifact_natural_property(rng(ARTPROP_NULL + 1, ARTPROP_MAX - 1)));
|
||||
artifact_property_datum *property_data = &(artifact_property_data[property]);
|
||||
|
||||
art->sym = ':';
|
||||
art->color = c_yellow;
|
||||
art->m1 = STONE;
|
||||
art->m2 = MNULL;
|
||||
art->volume = rng(shape_data->volume_min, shape_data->volume_max);
|
||||
art->weight = rng(shape_data->weight_min, shape_data->weight_max);
|
||||
art->melee_dam = 0;
|
||||
art->melee_cut = 0;
|
||||
art->m_to_hit = 0;
|
||||
art->item_flags = 0;
|
||||
|
||||
art->name = property_data->name + " " + shape_data->name;
|
||||
std::stringstream desc;
|
||||
desc << "This " << shape_data->desc << " " << property_data->desc << ".";
|
||||
art->description = desc.str();
|
||||
// Add line breaks to the description as necessary
|
||||
size_t pos = 76;
|
||||
while (art->description.length() - pos >= 76) {
|
||||
pos = art->description.find_last_of(' ', pos);
|
||||
if (pos == std::string::npos)
|
||||
pos = art->description.length();
|
||||
else {
|
||||
art->description[pos] = '\n';
|
||||
pos += 76;
|
||||
}
|
||||
}
|
||||
|
||||
// Three possibilities: good passive + bad passive, good active + bad active,
|
||||
// and bad passive + good active
|
||||
bool good_passive = false, bad_passive = false,
|
||||
good_active = false, bad_active = false;
|
||||
switch (rng(1, 3)) {
|
||||
case 1:
|
||||
good_passive = true;
|
||||
bad_passive = true;
|
||||
break;
|
||||
case 2:
|
||||
good_active = true;
|
||||
bad_active = true;
|
||||
break;
|
||||
case 3:
|
||||
bad_passive = true;
|
||||
good_active = true;
|
||||
break;
|
||||
}
|
||||
|
||||
int value_to_reach = 0; // This is slowly incremented, allowing for better arts
|
||||
int value = 0;
|
||||
art_effect_passive aep_good = AEP_NULL, aep_bad = AEP_NULL;
|
||||
art_effect_active aea_good = AEA_NULL, aea_bad = AEA_NULL;
|
||||
|
||||
do {
|
||||
if (good_passive) {
|
||||
aep_good = property_data->passive_good[ rng(0, 3) ];
|
||||
if (aep_good == AEP_NULL || one_in(4))
|
||||
aep_good = art_effect_passive(rng(AEP_NULL + 1, AEP_SPLIT - 1));
|
||||
}
|
||||
if (bad_passive) {
|
||||
aep_bad = property_data->passive_bad[ rng(0, 3) ];
|
||||
if (aep_bad == AEP_NULL || one_in(4))
|
||||
aep_bad = art_effect_passive(rng(AEP_SPLIT + 1, NUM_AEAS - 1));
|
||||
}
|
||||
if (good_active) {
|
||||
aea_good = property_data->active_good[ rng(0, 3) ];
|
||||
if (aea_good == AEA_NULL || one_in(4))
|
||||
aea_good = art_effect_active(rng(AEA_NULL + 1, AEA_SPLIT - 1));
|
||||
}
|
||||
if (bad_active) {
|
||||
aea_bad = property_data->active_bad[ rng(0, 3) ];
|
||||
if (aea_bad == AEA_NULL || one_in(4))
|
||||
aea_bad = art_effect_active(rng(AEA_SPLIT + 1, NUM_AEAS - 1));
|
||||
}
|
||||
|
||||
value = passive_effect_cost[aep_good] + passive_effect_cost[aep_bad] +
|
||||
active_effect_cost[aea_good] + active_effect_cost[aea_bad];
|
||||
value_to_reach++; // Yes, it is intentional that this is 1 the first check
|
||||
} while (value > value_to_reach);
|
||||
|
||||
if (aep_good != AEP_NULL)
|
||||
art->effects_carried.push_back(aep_good);
|
||||
if (aep_bad != AEP_NULL)
|
||||
art->effects_carried.push_back(aep_bad);
|
||||
if (aea_good != AEA_NULL)
|
||||
art->effects_activated.push_back(aea_good);
|
||||
if (aea_bad != AEA_NULL)
|
||||
art->effects_activated.push_back(aea_bad);
|
||||
|
||||
// Natural artifacts ALWAYS can recharge
|
||||
// (When "implanting" them in a mundane item, this ability may be lost
|
||||
if (!art->effects_activated.empty()) {
|
||||
art->max_charges = rng(1, 4);
|
||||
art->def_charges = art->max_charges;
|
||||
art->charge_type = art_charge( rng(ARTC_NULL + 1, NUM_ARTCS - 1) );
|
||||
}
|
||||
|
||||
art->id = itypes.size();
|
||||
itypes[art->name]=art;
|
||||
return art;
|
||||
}
|
||||
|
||||
std::vector<art_effect_passive> fill_good_passive()
|
||||
{
|
||||
std::vector<art_effect_passive> ret;
|
||||
for (int i = AEP_NULL + 1; i < AEP_SPLIT; i++)
|
||||
ret.push_back( art_effect_passive(i) );
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<art_effect_passive> fill_bad_passive()
|
||||
{
|
||||
std::vector<art_effect_passive> ret;
|
||||
for (int i = AEP_SPLIT + 1; i < NUM_AEPS; i++)
|
||||
ret.push_back( art_effect_passive(i) );
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<art_effect_active> fill_good_active()
|
||||
{
|
||||
std::vector<art_effect_active> ret;
|
||||
for (int i = AEA_NULL + 1; i < AEA_SPLIT; i++)
|
||||
ret.push_back( art_effect_active(i) );
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::vector<art_effect_active> fill_bad_active()
|
||||
{
|
||||
std::vector<art_effect_active> ret;
|
||||
for (int i = AEA_SPLIT + 1; i < NUM_AEAS; i++)
|
||||
ret.push_back( art_effect_active(i) );
|
||||
return ret;
|
||||
}
|
||||
|
||||
std::string artifact_name(std::string type)
|
||||
{
|
||||
std::stringstream ret;
|
||||
ret << type << " of ";
|
||||
std::string noun = artifact_noun[rng(0, NUM_ART_NOUNS - 1)];
|
||||
if (noun[0] == '+') {
|
||||
ret << "the ";
|
||||
noun = noun.substr(1); // Chop off '+'
|
||||
}
|
||||
ret << artifact_adj[rng(0, NUM_ART_ADJS - 1)] << " " << noun;
|
||||
return ret.str();
|
||||
}
|
||||
|
||||
|
||||
void game::process_artifact(item *it, player *p, bool wielded)
|
||||
{
|
||||
std::vector<art_effect_passive> effects;
|
||||
if (it->is_armor()) {
|
||||
it_artifact_armor* armor = dynamic_cast<it_artifact_armor*>(it->type);
|
||||
effects = armor->effects_worn;
|
||||
} else if (it->is_tool()) {
|
||||
it_artifact_tool* tool = dynamic_cast<it_artifact_tool*>(it->type);
|
||||
effects = tool->effects_carried;
|
||||
if (wielded) {
|
||||
for (int i = 0; i < tool->effects_wielded.size(); i++)
|
||||
effects.push_back(tool->effects_wielded[i]);
|
||||
}
|
||||
// Recharge it if necessary
|
||||
if (it->charges < tool->max_charges) {
|
||||
switch (tool->charge_type) {
|
||||
case ARTC_TIME:
|
||||
if (turn.second == 0 && turn.minute == 0) // Once per hour
|
||||
it->charges++;
|
||||
break;
|
||||
case ARTC_SOLAR:
|
||||
if (turn.second == 0 && turn.minute % 10 == 0 &&
|
||||
is_in_sunlight(p->posx, p->posy))
|
||||
it->charges++;
|
||||
break;
|
||||
case ARTC_PAIN:
|
||||
if (turn.second == 0) {
|
||||
add_msg("You suddenly feel sharp pain for no reason.");
|
||||
p->pain += 3 * rng(1, 3);
|
||||
it->charges++;
|
||||
}
|
||||
break;
|
||||
case ARTC_HP:
|
||||
if (turn.second == 0) {
|
||||
add_msg("You feel your body decaying.");
|
||||
p->hurtall(1);
|
||||
it->charges++;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < effects.size(); i++) {
|
||||
switch (effects[i]) {
|
||||
case AEP_STR_UP:
|
||||
p->str_cur += 4;
|
||||
break;
|
||||
case AEP_DEX_UP:
|
||||
p->dex_cur += 4;
|
||||
break;
|
||||
case AEP_PER_UP:
|
||||
p->per_cur += 4;
|
||||
break;
|
||||
case AEP_INT_UP:
|
||||
p->int_cur += 4;
|
||||
break;
|
||||
case AEP_ALL_UP:
|
||||
p->str_cur += 2;
|
||||
p->dex_cur += 2;
|
||||
p->per_cur += 2;
|
||||
p->int_cur += 2;
|
||||
break;
|
||||
case AEP_SPEED_UP: // Handled in player::current_speed()
|
||||
break;
|
||||
|
||||
case AEP_IODINE:
|
||||
if (p->radiation > 0)
|
||||
p->radiation--;
|
||||
break;
|
||||
|
||||
case AEP_SMOKE:
|
||||
if (one_in(10)) {
|
||||
int x = p->posx + rng(-1, 1), y = p->posy + rng(-1, 1);
|
||||
if (m.add_field(this, x, y, fd_smoke, rng(1, 3)))
|
||||
add_msg("The %s emits some smoke.", it->tname().c_str());
|
||||
}
|
||||
break;
|
||||
|
||||
case AEP_SNAKES:
|
||||
break; // Handled in player::hit()
|
||||
|
||||
case AEP_EXTINGUISH:
|
||||
for (int x = p->posx - 1; x <= p->posx + 1; x++) {
|
||||
for (int y = p->posy - 1; y <= p->posy + 1; y++) {
|
||||
if (m.field_at(x, y).type == fd_fire) {
|
||||
if (m.field_at(x, y).density == 0)
|
||||
m.remove_field(x, y);
|
||||
else
|
||||
m.field_at(x, y).density--;
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case AEP_HUNGER:
|
||||
if (one_in(100))
|
||||
p->hunger++;
|
||||
break;
|
||||
|
||||
case AEP_THIRST:
|
||||
if (one_in(120))
|
||||
p->thirst++;
|
||||
break;
|
||||
|
||||
case AEP_EVIL:
|
||||
if (one_in(150)) { // Once every 15 minutes, on average
|
||||
p->add_disease(DI_EVIL, 300, this);
|
||||
if (!wielded && !it->is_armor())
|
||||
add_msg("You have an urge to %s the %s.",
|
||||
(it->is_armor() ? "wear" : "wield"), it->tname().c_str());
|
||||
}
|
||||
break;
|
||||
|
||||
case AEP_SCHIZO:
|
||||
break; // Handled in player::suffer()
|
||||
|
||||
case AEP_RADIOACTIVE:
|
||||
if (one_in(4))
|
||||
p->radiation++;
|
||||
break;
|
||||
|
||||
case AEP_STR_DOWN:
|
||||
p->str_cur -= 3;
|
||||
break;
|
||||
|
||||
case AEP_DEX_DOWN:
|
||||
p->dex_cur -= 3;
|
||||
break;
|
||||
|
||||
case AEP_PER_DOWN:
|
||||
p->per_cur -= 3;
|
||||
break;
|
||||
|
||||
case AEP_INT_DOWN:
|
||||
p->int_cur -= 3;
|
||||
break;
|
||||
|
||||
case AEP_ALL_DOWN:
|
||||
p->str_cur -= 2;
|
||||
p->dex_cur -= 2;
|
||||
p->per_cur -= 2;
|
||||
p->int_cur -= 2;
|
||||
break;
|
||||
|
||||
case AEP_SPEED_DOWN:
|
||||
break; // Handled in player::current_speed()
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void game::add_artifact_messages(std::vector<art_effect_passive> effects)
|
||||
{
|
||||
int net_str = 0, net_dex = 0, net_per = 0, net_int = 0, net_speed = 0;
|
||||
for (int i = 0; i < effects.size(); i++) {
|
||||
switch (effects[i]) {
|
||||
case AEP_STR_UP: net_str += 4; break;
|
||||
case AEP_DEX_UP: net_dex += 4; break;
|
||||
case AEP_PER_UP: net_per += 4; break;
|
||||
case AEP_INT_UP: net_int += 4; break;
|
||||
case AEP_ALL_UP: net_str += 2;
|
||||
net_dex += 2;
|
||||
net_per += 2;
|
||||
net_int += 2; break;
|
||||
case AEP_STR_DOWN: net_str -= 3; break;
|
||||
case AEP_DEX_DOWN: net_dex -= 3; break;
|
||||
case AEP_PER_DOWN: net_per -= 3; break;
|
||||
case AEP_INT_DOWN: net_int -= 3; break;
|
||||
case AEP_ALL_DOWN: net_str -= 2;
|
||||
net_dex -= 2;
|
||||
net_per -= 2;
|
||||
net_int -= 2; break;
|
||||
|
||||
case AEP_SPEED_UP: net_speed += 20; break;
|
||||
case AEP_SPEED_DOWN: net_speed -= 20; break;
|
||||
|
||||
case AEP_IODINE:
|
||||
break; // No message
|
||||
|
||||
case AEP_SNAKES:
|
||||
add_msg("Your skin feels slithery.");
|
||||
break;
|
||||
|
||||
case AEP_INVISIBLE:
|
||||
add_msg("You fade into invisibility!");
|
||||
break;
|
||||
|
||||
case AEP_CLAIRVOYANCE:
|
||||
add_msg("You can see through walls!");
|
||||
break;
|
||||
|
||||
case AEP_STEALTH:
|
||||
add_msg("Your steps stop making noise.");
|
||||
break;
|
||||
|
||||
case AEP_GLOW:
|
||||
add_msg("A glow of light forms around you.");
|
||||
break;
|
||||
|
||||
case AEP_PSYSHIELD:
|
||||
add_msg("Your mental state feels protected.");
|
||||
break;
|
||||
|
||||
case AEP_RESIST_ELECTRICITY:
|
||||
add_msg("You feel insulated.");
|
||||
break;
|
||||
|
||||
case AEP_CARRY_MORE:
|
||||
add_msg("Your back feels strengthened.");
|
||||
break;
|
||||
|
||||
case AEP_HUNGER:
|
||||
add_msg("You feel hungry.");
|
||||
break;
|
||||
|
||||
case AEP_THIRST:
|
||||
add_msg("You feel thirsty.");
|
||||
break;
|
||||
|
||||
case AEP_EVIL:
|
||||
add_msg("You feel an evil presence...");
|
||||
break;
|
||||
|
||||
case AEP_SCHIZO:
|
||||
add_msg("You feel a tickle of insanity.");
|
||||
break;
|
||||
|
||||
case AEP_RADIOACTIVE:
|
||||
add_msg("Your skin prickles with radiation.");
|
||||
break;
|
||||
|
||||
case AEP_MUTAGENIC:
|
||||
add_msg("You feel your genetic makeup degrading.");
|
||||
break;
|
||||
|
||||
case AEP_ATTENTION:
|
||||
add_msg("You feel an otherworldly attention upon you...");
|
||||
break;
|
||||
|
||||
case AEP_FORCE_TELEPORT:
|
||||
add_msg("You feel a force pulling you inwards.");
|
||||
break;
|
||||
|
||||
case AEP_MOVEMENT_NOISE:
|
||||
add_msg("You hear a rattling noise coming from inside yourself.");
|
||||
break;
|
||||
|
||||
case AEP_BAD_WEATHER:
|
||||
add_msg("You feel storms coming.");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::stringstream stat_info;
|
||||
if (net_str != 0)
|
||||
stat_info << "Str " << (net_str > 0 ? "+" : "") << net_str << "! ";
|
||||
if (net_dex != 0)
|
||||
stat_info << "Dex " << (net_dex > 0 ? "+" : "") << net_dex << "! ";
|
||||
if (net_int != 0)
|
||||
stat_info << "Int " << (net_int > 0 ? "+" : "") << net_int << "! ";
|
||||
if (net_per != 0)
|
||||
stat_info << "Per " << (net_per > 0 ? "+" : "") << net_per << "! ";
|
||||
|
||||
if (stat_info.str().length() > 0)
|
||||
add_msg(stat_info.str().c_str());
|
||||
|
||||
if (net_speed != 0)
|
||||
add_msg("Speed %s%d", (net_speed > 0 ? "+" : ""), net_speed);
|
||||
}
|
||||
+141
-23
@@ -1,29 +1,147 @@
|
||||
#ifndef _ARTIFACT_H_
|
||||
#define _ARTIFACT_H_
|
||||
|
||||
#include "itype.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
struct it_artifact : itype
|
||||
{
|
||||
itype base;
|
||||
virtual bool is_artifact() { return true; }
|
||||
// is_* returns the value for the base type
|
||||
virtual bool is_food() { return base.is_food(); };
|
||||
virtual bool is_ammo() { return base.is_ammo(); };
|
||||
virtual bool is_armor() { return base.is_armor(); };
|
||||
virtual bool is_book() { return base.is_book(); };
|
||||
virtual bool is_tool() { return base.is_tool(); };
|
||||
virtual bool is_container() { return base.is_container(); };
|
||||
// Can have one or two invoked uses
|
||||
void (iuse::*use1)(game *, item *, bool);
|
||||
void (iuse::*use2)(game *, item *, bool);
|
||||
// *wield is every-turn effect while wielded or worn
|
||||
void (iuse::*wield)(game *, item *, bool);
|
||||
// *unwield is effect upon unwielding or taking off
|
||||
void (iuse::*unwield)(game *, item *, bool);
|
||||
// *carry is every-turn effect while it's in your inventory
|
||||
void (iuse::*carry)(game *, item *, bool);
|
||||
|
||||
enum art_effect_passive {
|
||||
AEP_NULL = 0,
|
||||
// Good
|
||||
AEP_STR_UP, // Strength + 4
|
||||
AEP_DEX_UP, // Dexterity + 4
|
||||
AEP_PER_UP, // Perception + 4
|
||||
AEP_INT_UP, // Intelligence + 4
|
||||
AEP_ALL_UP, // All stats + 2
|
||||
AEP_SPEED_UP, // +20 speed
|
||||
AEP_IODINE, // Reduces radiation
|
||||
AEP_SNAKES, // Summons friendly snakes when you're hit
|
||||
AEP_INVISIBLE, // Makes you invisible
|
||||
AEP_CLAIRVOYANCE, // See through walls
|
||||
AEP_STEALTH, // Your steps are quieted
|
||||
AEP_EXTINGUISH, // May extinguish nearby flames
|
||||
AEP_GLOW, // Four-tile light source
|
||||
AEP_PSYSHIELD, // Protection from stare attacks
|
||||
AEP_RESIST_ELECTRICITY, // Protection from electricity
|
||||
AEP_CARRY_MORE, // Increases carrying capacity by 200
|
||||
AEP_SAP_LIFE, // Killing non-zombie monsters may heal you
|
||||
// Splits good from bad
|
||||
AEP_SPLIT,
|
||||
// Bad
|
||||
AEP_HUNGER, // Increases hunger
|
||||
AEP_THIRST, // Increases thirst
|
||||
AEP_SMOKE, // Emits smoke occasionally
|
||||
AEP_EVIL, // Addiction to the power
|
||||
AEP_SCHIZO, // Mimicks schizophrenia
|
||||
AEP_RADIOACTIVE, // Increases your radiation
|
||||
AEP_MUTAGENIC, // Mutates you slowly
|
||||
AEP_ATTENTION, // Draws netherworld attention slowly
|
||||
AEP_STR_DOWN, // Strength - 3
|
||||
AEP_DEX_DOWN, // Dex - 3
|
||||
AEP_PER_DOWN, // Per - 3
|
||||
AEP_INT_DOWN, // Int - 3
|
||||
AEP_ALL_DOWN, // All stats - 2
|
||||
AEP_SPEED_DOWN, // -20 speed
|
||||
AEP_FORCE_TELEPORT, // Occasionally force a teleport
|
||||
AEP_MOVEMENT_NOISE, // Makes noise when you move
|
||||
AEP_BAD_WEATHER, // More likely to experience bad weather
|
||||
AEP_SICK, // Decreases health
|
||||
|
||||
NUM_AEPS
|
||||
};
|
||||
|
||||
|
||||
enum art_effect_active {
|
||||
AEA_NULL = 0,
|
||||
|
||||
AEA_STORM, // Emits shock fields
|
||||
AEA_FIREBALL, // Targeted
|
||||
AEA_ADRENALINE, // Adrenaline rush
|
||||
AEA_MAP, // Maps the area around you
|
||||
AEA_BLOOD, // Shoots blood all over
|
||||
AEA_FATIGUE, // Creates interdimensional fatigue
|
||||
AEA_ACIDBALL, // Targeted acid
|
||||
AEA_PULSE, // Destroys adjacent terrain
|
||||
AEA_HEAL, // Heals minor damage
|
||||
AEA_CONFUSED, // Confuses all monsters in view
|
||||
AEA_ENTRANCE, // Chance to make nearby monsters friendly
|
||||
AEA_BUGS, // Chance to summon friendly insects
|
||||
AEA_TELEPORT, // Teleports you
|
||||
AEA_LIGHT, // Temporary light source
|
||||
AEA_GROWTH, // Grow plants, a la triffid queen
|
||||
AEA_HURTALL, // Hurts all monsters!
|
||||
|
||||
AEA_SPLIT, // Split between good and bad
|
||||
|
||||
AEA_RADIATION, // Spew radioactive gas
|
||||
AEA_PAIN, // Increases player pain
|
||||
AEA_MUTATE, // Chance of mutation
|
||||
AEA_PARALYZE, // You lose several turns
|
||||
AEA_FIRESTORM, // Spreads minor fire all around you
|
||||
AEA_ATTENTION, // Attention from sub-prime denizens
|
||||
AEA_TELEGLOW, // Teleglow disease
|
||||
AEA_NOISE, // Loud noise
|
||||
AEA_SCREAM, // Noise & morale penalty
|
||||
AEA_DIM, // Darkens the sky slowly
|
||||
AEA_FLASH, // Flashbang
|
||||
AEA_VOMIT, // User vomits
|
||||
AEA_SHADOWS, // Summon shadow creatures
|
||||
|
||||
NUM_AEAS
|
||||
};
|
||||
|
||||
enum art_charge
|
||||
{
|
||||
ARTC_NULL, // Never recharges!
|
||||
ARTC_TIME, // Very slowly recharges with time
|
||||
ARTC_SOLAR, // Recharges in sunlight
|
||||
ARTC_PAIN, // Creates pain to recharge
|
||||
ARTC_HP, // Drains HP to recharge
|
||||
NUM_ARTCS
|
||||
};
|
||||
|
||||
enum artifact_natural_shape
|
||||
{
|
||||
ARTSHAPE_NULL,
|
||||
ARTSHAPE_SPHERE,
|
||||
ARTSHAPE_ROD,
|
||||
ARTSHAPE_TEARDROP,
|
||||
ARTSHAPE_LAMP,
|
||||
ARTSHAPE_SNAKE,
|
||||
ARTSHAPE_DISC,
|
||||
ARTSHAPE_BEADS,
|
||||
ARTSHAPE_NAPKIN,
|
||||
ARTSHAPE_URCHIN,
|
||||
ARTSHAPE_JELLY,
|
||||
ARTSHAPE_SPIRAL,
|
||||
ARTSHAPE_PIN,
|
||||
ARTSHAPE_TUBE,
|
||||
ARTSHAPE_PYRAMID,
|
||||
ARTSHAPE_CRYSTAL,
|
||||
ARTSHAPE_KNOT,
|
||||
ARTSHAPE_CRESCENT,
|
||||
ARTSHAPE_MAX
|
||||
};
|
||||
|
||||
enum artifact_natural_property
|
||||
{
|
||||
ARTPROP_NULL,
|
||||
ARTPROP_WRIGGLING, //
|
||||
ARTPROP_GLOWING, //
|
||||
ARTPROP_HUMMING, //
|
||||
ARTPROP_MOVING, //
|
||||
ARTPROP_WHISPERING, //
|
||||
ARTPROP_BREATHING, //
|
||||
ARTPROP_DEAD, //
|
||||
ARTPROP_ITCHY, //
|
||||
ARTPROP_GLITTERING, //
|
||||
ARTPROP_ELECTRIC, //
|
||||
ARTPROP_SLIMY, //
|
||||
ARTPROP_ENGRAVED, //
|
||||
ARTPROP_CRACKLING, //
|
||||
ARTPROP_WARM, //
|
||||
ARTPROP_RATTLING, //
|
||||
ARTPROP_SCALED,
|
||||
ARTPROP_FRACTAL,
|
||||
ARTPROP_MAX
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+488
@@ -0,0 +1,488 @@
|
||||
#ifndef _ARTIFACTDATA_H_
|
||||
#define _ARTIFACTDATA_H_
|
||||
|
||||
#include <vector>
|
||||
#include "artifact.h"
|
||||
#include "itype.h"
|
||||
|
||||
int passive_effect_cost[NUM_AEPS] = {
|
||||
0, // AEP_NULL
|
||||
|
||||
3, // AEP_STR_UP
|
||||
3, // AEP_DEX_UP
|
||||
3, // AEP_PER_UP
|
||||
3, // AEP_INT_UP
|
||||
5, // AEP_ALL_UP
|
||||
4, // AEP_SPEED_UP
|
||||
2, // AEP_IODINE
|
||||
4, // AEP_SNAKES
|
||||
7, // AEP_INVISIBLE
|
||||
5, // AEP_CLAIRVOYANCE
|
||||
2, // AEP_STEALTH
|
||||
2, // AEP_EXTINGUISH
|
||||
1, // AEP_GLOW
|
||||
1, // AEP_PSYSHIELD
|
||||
3, // AEP_RESIST_ELECTRICITY
|
||||
3, // AEP_CARRY_MORE
|
||||
5, // AEP_SAP_LIFE
|
||||
|
||||
0, // AEP_SPLIT
|
||||
|
||||
-2, // AEP_HUNGER
|
||||
-2, // AEP_THIRST
|
||||
-1, // AEP_SMOKE
|
||||
-5, // AEP_EVIL
|
||||
-3, // AEP_SCHIZO
|
||||
-5, // AEP_RADIOACTIVE
|
||||
-3, // AEP_MUTAGENIC
|
||||
-5, // AEP_ATTENTION
|
||||
-2, // AEP_STR_DOWN
|
||||
-2, // AEP_DEX_DOWN
|
||||
-2, // AEP_PER_DOWN
|
||||
-2, // AEP_INT_DOWN
|
||||
-5, // AEP_ALL_DOWN
|
||||
-4, // AEP_SPEED_DOWN
|
||||
-5, // AEP_FORCE_TELEPORT
|
||||
-3, // AEP_MOVEMENT_NOISE
|
||||
-2, // AEP_BAD_WEATHER
|
||||
-1 // AEP_SICK
|
||||
};
|
||||
|
||||
int active_effect_cost[NUM_AEAS] = {
|
||||
0, // AEA_NULL
|
||||
|
||||
2, // AEA_STORM
|
||||
4, // AEA_FIREBALL
|
||||
5, // AEA_ADRENALINE
|
||||
4, // AEA_MAP
|
||||
0, // AEA_BLOOD
|
||||
0, // AEA_FATIGUE
|
||||
4, // AEA_ACIDBALL
|
||||
5, // AEA_PULSE
|
||||
4, // AEA_HEAL
|
||||
3, // AEA_CONFUSED
|
||||
3, // AEA_ENTRANCE
|
||||
3, // AEA_BUGS
|
||||
5, // AEA_TELEPORT
|
||||
1, // AEA_LIGHT
|
||||
4, // AEA_GROWTH
|
||||
6, // AEA_HURTALL
|
||||
|
||||
0, // AEA_SPLIT
|
||||
|
||||
-3, // AEA_RADIATION
|
||||
-2, // AEA_PAIN
|
||||
-3, // AEA_MUTATE
|
||||
-2, // AEA_PARALYZE
|
||||
-3, // AEA_FIRESTORM
|
||||
-6, // AEA_ATTENTION
|
||||
-4, // AEA_TELEGLOW
|
||||
-2, // AEA_NOISE
|
||||
-2, // AEA_SCREAM
|
||||
-3, // AEA_DIM
|
||||
-4, // AEA_FLASH
|
||||
-2, // AEA_VOMIT
|
||||
-5 // AEA_SHADOWS
|
||||
};
|
||||
|
||||
struct artifact_shape_datum
|
||||
{
|
||||
std::string name;
|
||||
std::string desc;
|
||||
int volume_min, volume_max;
|
||||
int weight_min, weight_max;
|
||||
};
|
||||
|
||||
artifact_shape_datum artifact_shape_data[ARTSHAPE_MAX] = {
|
||||
{"BUG", "BUG", 0, 0, 0, 0},
|
||||
{"sphere", "smooth sphere", 2, 4, 0, 10},
|
||||
{"rod", "tapered rod", 1, 7, 1, 7},
|
||||
{"teardrop", "teardrop-shaped stone", 2, 6, 0, 8},
|
||||
{"lamp", "hollow, transparent cube", 4, 9, 0, 3},
|
||||
{"snake", "winding, flexible rod", 0, 8, 0, 8},
|
||||
{"disc", "smooth disc", 4, 6, 2, 4},
|
||||
{"beads", "string of beads", 3, 7, 0, 6},
|
||||
{"napkin", "very thin sheet", 0, 3, 0, 3},
|
||||
{"urchin", "spiked sphere", 3, 5, 2, 6},
|
||||
{"jelly", "malleable blob", 2, 8, 2, 4},
|
||||
{"spiral", "spiraling rod", 5, 6, 2, 3},
|
||||
{"pin", "pointed rod", 1, 5, 1, 9},
|
||||
{"tube", "hollow tube", 2, 5, 3, 6},
|
||||
{"pyramid", "regular tetrahedron", 3, 7, 2, 4},
|
||||
{"crystal", "translucent crystal", 1, 6, 2, 7},
|
||||
{"knot", "twisted, knotted cord", 2, 6, 1, 7},
|
||||
{"crescent", "crescent-shaped stone", 2, 6, 2, 6}
|
||||
};
|
||||
|
||||
struct artifact_property_datum
|
||||
{
|
||||
std::string name;
|
||||
std::string desc;
|
||||
art_effect_passive passive_good[4];
|
||||
art_effect_passive passive_bad[4];
|
||||
art_effect_active active_good[4];
|
||||
art_effect_active active_bad[4];
|
||||
};
|
||||
|
||||
artifact_property_datum artifact_property_data[ARTPROP_MAX] = {
|
||||
{"BUG", "BUG",
|
||||
{AEP_NULL, AEP_NULL, AEP_NULL, AEP_NULL},
|
||||
{AEP_NULL, AEP_NULL, AEP_NULL, AEP_NULL},
|
||||
{AEA_NULL, AEA_NULL, AEA_NULL, AEA_NULL},
|
||||
{AEA_NULL, AEA_NULL, AEA_NULL, AEA_NULL}
|
||||
},
|
||||
{"wriggling", "is constantly wriggling",
|
||||
{AEP_SPEED_UP, AEP_SNAKES, AEP_NULL, AEP_NULL},
|
||||
{AEP_DEX_DOWN, AEP_FORCE_TELEPORT, AEP_SICK, AEP_NULL},
|
||||
{AEA_TELEPORT, AEA_ADRENALINE, AEA_NULL, AEA_NULL},
|
||||
{AEA_MUTATE, AEA_ATTENTION, AEA_VOMIT, AEA_NULL}
|
||||
},
|
||||
{"glowing", "glows faintly",
|
||||
{AEP_INT_UP, AEP_GLOW, AEP_CLAIRVOYANCE, AEP_NULL},
|
||||
{AEP_RADIOACTIVE, AEP_MUTAGENIC, AEP_ATTENTION, AEP_NULL},
|
||||
{AEA_LIGHT, AEA_LIGHT, AEA_LIGHT, AEA_NULL},
|
||||
{AEA_ATTENTION, AEA_TELEGLOW, AEA_FLASH, AEA_SHADOWS}
|
||||
},
|
||||
{"humming", "hums very quietly",
|
||||
{AEP_ALL_UP, AEP_PSYSHIELD, AEP_NULL, AEP_NULL},
|
||||
{AEP_SCHIZO, AEP_PER_DOWN, AEP_INT_DOWN, AEP_NULL},
|
||||
{AEA_PULSE, AEA_ENTRANCE, AEA_NULL, AEA_NULL},
|
||||
{AEA_NOISE, AEA_NOISE, AEA_SCREAM, AEA_NULL}
|
||||
},
|
||||
{"moving", "shifts from side to side slowly",
|
||||
{AEP_STR_UP, AEP_DEX_UP, AEP_SPEED_UP, AEP_NULL},
|
||||
{AEP_HUNGER, AEP_PER_DOWN, AEP_FORCE_TELEPORT, AEP_NULL},
|
||||
{AEA_TELEPORT, AEA_TELEPORT, AEA_MAP, AEA_NULL},
|
||||
{AEA_PARALYZE, AEA_VOMIT, AEA_VOMIT, AEA_NULL}
|
||||
},
|
||||
{"whispering", "makes very faint whispering sounds",
|
||||
{AEP_CLAIRVOYANCE, AEP_EXTINGUISH, AEP_STEALTH, AEP_NULL},
|
||||
{AEP_EVIL, AEP_SCHIZO, AEP_ATTENTION, AEP_NULL},
|
||||
{AEA_FATIGUE, AEA_ENTRANCE, AEA_ENTRANCE, AEA_NULL},
|
||||
{AEA_ATTENTION, AEA_SCREAM, AEA_SCREAM, AEA_SHADOWS}
|
||||
},
|
||||
{"breathing",
|
||||
"shrinks and grows very slightly with a regular pulse, as if breathing",
|
||||
{AEP_SAP_LIFE, AEP_ALL_UP, AEP_SPEED_UP, AEP_CARRY_MORE},
|
||||
{AEP_HUNGER, AEP_THIRST, AEP_SICK, AEP_BAD_WEATHER},
|
||||
{AEA_ADRENALINE, AEA_HEAL, AEA_ENTRANCE, AEA_GROWTH},
|
||||
{AEA_MUTATE, AEA_ATTENTION, AEA_SHADOWS, AEA_NULL}
|
||||
},
|
||||
{"dead", "is icy cold to the touch",
|
||||
{AEP_INVISIBLE, AEP_CLAIRVOYANCE, AEP_EXTINGUISH, AEP_SAP_LIFE},
|
||||
{AEP_HUNGER, AEP_EVIL, AEP_ALL_DOWN, AEP_SICK},
|
||||
{AEA_BLOOD, AEA_HURTALL, AEA_NULL, AEA_NULL},
|
||||
{AEA_PAIN, AEA_SHADOWS, AEA_DIM, AEA_VOMIT}
|
||||
},
|
||||
{"itchy", "makes your skin itch slightly when it is close",
|
||||
{AEP_DEX_UP, AEP_SPEED_UP, AEP_PSYSHIELD, AEP_NULL},
|
||||
{AEP_RADIOACTIVE, AEP_MUTAGENIC, AEP_SICK, AEP_NULL},
|
||||
{AEA_ADRENALINE, AEA_BLOOD, AEA_HEAL, AEA_BUGS},
|
||||
{AEA_RADIATION, AEA_PAIN, AEA_PAIN, AEA_VOMIT}
|
||||
},
|
||||
{"glittering", "glitters faintly under direct light",
|
||||
{AEP_INT_UP, AEP_EXTINGUISH, AEP_GLOW, AEP_NULL},
|
||||
{AEP_SMOKE, AEP_ATTENTION, AEP_NULL, AEP_NULL},
|
||||
{AEA_MAP, AEA_LIGHT, AEA_CONFUSED, AEA_ENTRANCE},
|
||||
{AEA_RADIATION, AEA_MUTATE, AEA_ATTENTION, AEA_FLASH}
|
||||
},
|
||||
{"electric", "very weakly shocks you when touched",
|
||||
{AEP_RESIST_ELECTRICITY, AEP_DEX_UP, AEP_SPEED_UP, AEP_PSYSHIELD},
|
||||
{AEP_THIRST, AEP_SMOKE, AEP_STR_DOWN, AEP_BAD_WEATHER},
|
||||
{AEA_STORM, AEA_ADRENALINE, AEA_LIGHT, AEA_NULL},
|
||||
{AEA_PAIN, AEA_PARALYZE, AEA_FLASH, AEA_FLASH}
|
||||
},
|
||||
{"slimy", "feels slimy",
|
||||
{AEP_SNAKES, AEP_STEALTH, AEP_EXTINGUISH, AEP_SAP_LIFE},
|
||||
{AEP_THIRST, AEP_DEX_DOWN, AEP_SPEED_DOWN, AEP_SICK},
|
||||
{AEA_BLOOD, AEA_ACIDBALL, AEA_GROWTH, AEA_ACIDBALL},
|
||||
{AEA_MUTATE, AEA_MUTATE, AEA_VOMIT, AEA_VOMIT}
|
||||
},
|
||||
{"engraved", "is covered with odd etchings",
|
||||
{AEP_CLAIRVOYANCE, AEP_INVISIBLE, AEP_PSYSHIELD, AEP_SAP_LIFE},
|
||||
{AEP_EVIL, AEP_ATTENTION, AEP_NULL, AEP_NULL},
|
||||
{AEA_FATIGUE, AEA_TELEPORT, AEA_HEAL, AEA_FATIGUE},
|
||||
{AEA_ATTENTION, AEA_ATTENTION, AEA_TELEGLOW, AEA_DIM}
|
||||
},
|
||||
{"crackling", "occasionally makes a soft crackling sound",
|
||||
{AEP_EXTINGUISH, AEP_RESIST_ELECTRICITY, AEP_NULL, AEP_NULL},
|
||||
{AEP_SMOKE, AEP_RADIOACTIVE, AEP_MOVEMENT_NOISE, AEP_NULL},
|
||||
{AEA_STORM, AEA_FIREBALL, AEA_PULSE, AEA_NULL},
|
||||
{AEA_PAIN, AEA_PARALYZE, AEA_NOISE, AEA_NOISE}
|
||||
},
|
||||
{"warm", "is warm to the touch",
|
||||
{AEP_STR_UP, AEP_EXTINGUISH, AEP_GLOW, AEP_NULL},
|
||||
{AEP_SMOKE, AEP_RADIOACTIVE, AEP_NULL, AEP_NULL},
|
||||
{AEA_FIREBALL, AEA_FIREBALL, AEA_FIREBALL, AEA_LIGHT},
|
||||
{AEA_FIRESTORM, AEA_FIRESTORM, AEA_TELEGLOW, AEA_NULL}
|
||||
},
|
||||
{"rattling", "makes a rattling sound when moved",
|
||||
{AEP_DEX_UP, AEP_SPEED_UP, AEP_SNAKES, AEP_CARRY_MORE},
|
||||
{AEP_ATTENTION, AEP_INT_DOWN, AEP_MOVEMENT_NOISE, AEP_MOVEMENT_NOISE},
|
||||
{AEA_BLOOD, AEA_PULSE, AEA_BUGS, AEA_NULL},
|
||||
{AEA_PAIN, AEA_ATTENTION, AEA_NOISE, AEA_NULL}
|
||||
},
|
||||
{"scaled", "has a surface reminiscent of reptile scales",
|
||||
{AEP_SNAKES, AEP_SNAKES, AEP_SNAKES, AEP_STEALTH},
|
||||
{AEP_THIRST, AEP_MUTAGENIC, AEP_SPEED_DOWN, AEP_NULL},
|
||||
{AEA_ADRENALINE, AEA_BUGS, AEA_GROWTH, AEA_NULL},
|
||||
{AEA_MUTATE, AEA_SCREAM, AEA_DIM, AEA_NULL}
|
||||
},
|
||||
{"fractal",
|
||||
"has a self-similar pattern which repeats until it is too small for you to see",
|
||||
{AEP_ALL_UP, AEP_ALL_UP, AEP_CLAIRVOYANCE, AEP_PSYSHIELD},
|
||||
{AEP_SCHIZO, AEP_ATTENTION, AEP_FORCE_TELEPORT, AEP_BAD_WEATHER},
|
||||
{AEA_STORM, AEA_FATIGUE, AEA_TELEPORT, AEA_NULL},
|
||||
{AEA_RADIATION, AEA_MUTATE, AEA_TELEGLOW, AEA_TELEGLOW}
|
||||
}
|
||||
};
|
||||
|
||||
enum artifact_weapon_type
|
||||
{
|
||||
ARTWEAP_NULL,
|
||||
ARTWEAP_BULK, // A bulky item that works okay for bashing
|
||||
ARTWEAP_CLUB, // An item designed to bash
|
||||
ARTWEAP_SPEAR, // A stab-only weapon
|
||||
ARTWEAP_SWORD, // A long slasher
|
||||
ARTWEAP_KNIFE, // Short, slash and stab
|
||||
NUM_ARTWEAPS
|
||||
};
|
||||
|
||||
struct artifact_tool_form_datum
|
||||
{
|
||||
std::string name;
|
||||
char sym;
|
||||
nc_color color;
|
||||
material m1;
|
||||
material m2;
|
||||
int volume_min, volume_max;
|
||||
int weight_min, weight_max;
|
||||
artifact_weapon_type base_weapon;
|
||||
artifact_weapon_type extra_weapons[3];
|
||||
|
||||
/*
|
||||
artifact_tool_form_datum
|
||||
(std::string Name, char Sym, nc_color Color, material M1, material M2,
|
||||
int Volmin, int Volmax, int Wgtmin, int Wgtmax, artifact_weapon_type Base,
|
||||
artifact_weapon_type extra[3])
|
||||
: name (Name), sym (Sym), color (Color), m1 (M1), m2 (M2),
|
||||
volume_min (Volmin), volume_max (Volmax), weight_min (Wgtmin),
|
||||
weight_max (Wgtmax), base_weapon (Base), extra_weapons (extra) { };
|
||||
*/
|
||||
|
||||
};
|
||||
|
||||
enum artifact_tool_form
|
||||
{
|
||||
ARTTOOLFORM_NULL,
|
||||
ARTTOOLFORM_HARP,
|
||||
ARTTOOLFORM_STAFF,
|
||||
ARTTOOLFORM_SWORD,
|
||||
ARTTOOLFORM_KNIFE,
|
||||
ARTTOOLFORM_CUBE,
|
||||
NUM_ARTTOOLFORMS
|
||||
};
|
||||
|
||||
artifact_tool_form_datum artifact_tool_form_data[NUM_ARTTOOLFORMS] = {
|
||||
{"", '*', c_white, MNULL, MNULL, 0, 0, 0, 0, ARTWEAP_BULK,
|
||||
{ARTWEAP_NULL, ARTWEAP_NULL, ARTWEAP_NULL}},
|
||||
|
||||
{"Harp", ';', c_yellow, WOOD, MNULL, 20, 30, 10, 18, ARTWEAP_BULK,
|
||||
{ARTWEAP_SPEAR, ARTWEAP_SWORD, ARTWEAP_KNIFE}},
|
||||
|
||||
{"Staff", '/', c_brown, WOOD, MNULL, 6, 12, 4, 10, ARTWEAP_CLUB,
|
||||
{ARTWEAP_BULK, ARTWEAP_SPEAR, ARTWEAP_KNIFE}},
|
||||
|
||||
{"Sword", '/', c_ltblue, STEEL, MNULL, 8, 14, 8, 28, ARTWEAP_SWORD,
|
||||
{ARTWEAP_BULK, ARTWEAP_NULL, ARTWEAP_NULL}},
|
||||
|
||||
{"Dagger", ';', c_ltblue, STEEL, MNULL, 1, 4, 1, 6, ARTWEAP_KNIFE,
|
||||
{ARTWEAP_NULL, ARTWEAP_NULL, ARTWEAP_NULL}},
|
||||
|
||||
{"Cube", '*', c_white, STEEL, MNULL, 1, 3, 1, 20, ARTWEAP_BULK,
|
||||
{ARTWEAP_SPEAR, ARTWEAP_NULL, ARTWEAP_NULL}}
|
||||
};
|
||||
|
||||
struct artifact_weapon_datum
|
||||
{
|
||||
std::string adjective;
|
||||
int volume, weight; // Only applicable if this is an *extra* weapon
|
||||
int bash_min, bash_max;
|
||||
int cut_min, cut_max;
|
||||
int to_hit_min, to_hit_max;
|
||||
unsigned flags : NUM_ITEM_FLAGS;
|
||||
};
|
||||
|
||||
artifact_weapon_datum artifact_weapon_data[NUM_ARTWEAPS] = {
|
||||
{"", 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
// Adjective Vol,wgt Bash Cut To-Hit
|
||||
{"Heavy", 0, 12, 10, 20, 0, 0, -2, 0,
|
||||
0},
|
||||
{"Knobbed", 1, 2, 14, 30, 0, 0, -1, 1,
|
||||
0},
|
||||
{"Spiked", 1, 1, 0, 0, 20, 40, -1, 1,
|
||||
mfb(IF_SPEAR)},
|
||||
{"Edged", 2, 4, 0, 0, 20, 50, -1, 2,
|
||||
0},
|
||||
{"Bladed", 1, 2, 0, 0, 12, 30, -1, 1,
|
||||
mfb(IF_STAB)}
|
||||
};
|
||||
|
||||
enum artifact_armor_mod
|
||||
{
|
||||
ARMORMOD_NULL,
|
||||
ARMORMOD_LIGHT,
|
||||
ARMORMOD_BULKY,
|
||||
ARMORMOD_POCKETED,
|
||||
ARMORMOD_FURRED,
|
||||
ARMORMOD_PADDED,
|
||||
ARMORMOD_PLATED,
|
||||
NUM_ARMORMODS
|
||||
};
|
||||
|
||||
struct artifact_armor_form_datum
|
||||
{
|
||||
std::string name;
|
||||
nc_color color;
|
||||
material m1;
|
||||
material m2;
|
||||
int volume, weight;
|
||||
int encumb;
|
||||
int dmg_resist;
|
||||
int cut_resist;
|
||||
int env_resist;
|
||||
int warmth;
|
||||
int storage;
|
||||
int melee_bash, melee_cut, melee_hit;
|
||||
unsigned char covers;
|
||||
bool plural;
|
||||
artifact_armor_mod available_mods[5];
|
||||
|
||||
/*
|
||||
// Constructor
|
||||
artifact_armor_form_datum
|
||||
(std::string Name, nc_color Color, material M1, material M2, int Volume,
|
||||
int Weight, int Encumb, int Dmg_res, int Cut_res, int Env_res,
|
||||
int Warmth, int Storage, int Bash, int Cut, int Hit, unsigned char Covers,
|
||||
bool Plural, artifact_armor_mod Mods[5])
|
||||
: name (Name), color (Color), m1 (M1), m2 (M2), volume (Volume),
|
||||
weight (Weight), encumb (Encumb), dmg_resist (Dmg_res),
|
||||
cut_resist (Cut_res), env_resist (Env_res), warmth (Warmth),
|
||||
storage (Storage), melee_bash (Bash), melee_cut (Cut), melee_hit (Hit),
|
||||
covers (Covers), plural (Plural), available_mods (Mods) { };
|
||||
|
||||
*/
|
||||
};
|
||||
|
||||
enum artifact_armor_form
|
||||
{
|
||||
ARTARMFORM_NULL,
|
||||
ARTARMFORM_ROBE,
|
||||
ARTARMFORM_COAT,
|
||||
ARTARMFORM_MASK,
|
||||
ARTARMFORM_HELM,
|
||||
ARTARMFORM_GLOVES,
|
||||
ARTARMFORM_BOOTS,
|
||||
ARTARMFORM_RING,
|
||||
NUM_ARTARMFORMS
|
||||
};
|
||||
|
||||
artifact_armor_form_datum artifact_armor_form_data[NUM_ARTARMFORMS] = {
|
||||
{"", c_white, MNULL, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
// Name color Materials Vol Wgt Enc Dmg Cut Env Wrm Sto Bsh Cut Hit
|
||||
{"Robe", c_red, WOOL, MNULL, 6, 6, 1, 3, 1, 0, 2, 0, -8, 0, -3,
|
||||
mfb(bp_torso)|mfb(bp_legs), false,
|
||||
{ARMORMOD_LIGHT, ARMORMOD_BULKY, ARMORMOD_POCKETED, ARMORMOD_FURRED,
|
||||
ARMORMOD_PADDED}},
|
||||
|
||||
{"Coat", c_brown,LEATHER,MNULL, 14, 14, 2, 4, 12, 1, 4, 4, -6, 0, -3,
|
||||
mfb(bp_torso), false,
|
||||
{ARMORMOD_LIGHT, ARMORMOD_POCKETED, ARMORMOD_FURRED, ARMORMOD_PADDED,
|
||||
ARMORMOD_PLATED}},
|
||||
|
||||
{"Mask", c_white, WOOD, MNULL, 4, 1, 2, 2, 16, 1, 2, 0, 2, 0, -2,
|
||||
mfb(bp_eyes)|mfb(bp_mouth), false,
|
||||
{ARMORMOD_FURRED, ARMORMOD_FURRED, ARMORMOD_NULL, ARMORMOD_NULL,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
// Name color Materials Vol Wgt Enc Dmg Cut Env Wrm Sto Bsh Cut Hit
|
||||
{"Helm", c_dkgray,SILVER, MNULL, 6, 6, 2, 4, 18, 0, 1, 0, 8, 0, -2,
|
||||
mfb(bp_head), false,
|
||||
{ARMORMOD_BULKY, ARMORMOD_FURRED, ARMORMOD_PADDED, ARMORMOD_PLATED,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
{"Gloves", c_ltblue,LEATHER,MNULL, 2, 1, 1, 6, 6, 1, 2, 0, -4, 0, -2,
|
||||
mfb(bp_hands), true,
|
||||
{ARMORMOD_BULKY, ARMORMOD_FURRED, ARMORMOD_PADDED, ARMORMOD_PLATED,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
// Name color Materials Vol Wgt Enc Dmg Cut Env Wrm Sto Bsh Cut Hit
|
||||
{"Boots", c_blue, LEATHER, MNULL, 6, 2, 1, 6, 6, 1, 3, 0, 4, 0, -1,
|
||||
mfb(bp_feet), true,
|
||||
{ARMORMOD_LIGHT, ARMORMOD_BULKY, ARMORMOD_PADDED, ARMORMOD_PLATED,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
{"Ring", c_ltgreen, SILVER, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, true,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}}
|
||||
|
||||
};
|
||||
|
||||
/* Armor mods alter the normal values of armor.
|
||||
* If the basic armor type has MNULL as its second material, and the mod has a
|
||||
* material attached, the second material will be changed.
|
||||
*/
|
||||
artifact_armor_form_datum artifact_armor_mod_data[NUM_ARMORMODS] = {
|
||||
|
||||
{"", c_white, MNULL, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
// Description; "It is ..." or "They are ..."
|
||||
{"very thin and light.", c_white, MNULL, MNULL,
|
||||
// Vol Wgt Enc Dmg Cut Env Wrm Sto
|
||||
-4, -8, -2, -1, -1, -1, -1, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"extremely bulky.", c_white, MNULL, MNULL,
|
||||
8, 10, 2, 1, 1, 0, 1, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"covered in pockets.", c_white, MNULL, MNULL,
|
||||
1, 1, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"disgustingly furry.", c_white, WOOL, MNULL,
|
||||
// Vol Wgt Enc Dmg Cut Env Wrm Sto
|
||||
4, 2, 1, 4, 0, 1, 3, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"leather-padded.", c_white, LEATHER, MNULL,
|
||||
4, 4, 1, 10, 4, 0, 1, -3, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"plated in iron.", c_white, IRON, MNULL,
|
||||
4, 12, 3, 8, 14, 0, 1, -4, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
};
|
||||
|
||||
|
||||
#define NUM_ART_ADJS 20
|
||||
std::string artifact_adj[NUM_ART_ADJS] = {
|
||||
"Forbidden", "Unknown", "Forgotten", "Hideous", "Eldritch",
|
||||
"Gelatinous", "Ancient", "Cursed", "Bloody", "Undying",
|
||||
"Shadowy", "Silent", "Cyclopean", "Fungal", "Unspeakable",
|
||||
"Grotesque", "Frigid", "Shattered", "Sleeping", "Repellent"
|
||||
};
|
||||
|
||||
#define NUM_ART_NOUNS 20
|
||||
// Prepending + makes it proper, e.g. "The Forbidden Abyss"
|
||||
std::string artifact_noun[NUM_ART_NOUNS] = {
|
||||
"Technique", "Dreams", "Beasts", "Evil", "Miasma",
|
||||
"+Abyss", "+City", "Shadows", "Shade", "Illusion",
|
||||
"Justice", "+Necropolis", "Ichor", "+Monolith", "Aeons",
|
||||
"Graves", "Horrors", "Suffering", "Death", "Horror"
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,45 @@
|
||||
#include <algorithm>
|
||||
#include <sstream>
|
||||
|
||||
#include "basecamp.h"
|
||||
|
||||
basecamp::basecamp()
|
||||
: name()
|
||||
, posx(0), posy(0)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
basecamp::basecamp(std::string const& name_, int const posx_, int const posy_)
|
||||
: name(name_)
|
||||
, posx(posx_), posy(posy_)
|
||||
{
|
||||
|
||||
}
|
||||
|
||||
std::string basecamp::board_name() const
|
||||
{
|
||||
return name + " Board";
|
||||
}
|
||||
|
||||
std::string basecamp::save_data() const
|
||||
{
|
||||
std::stringstream data;
|
||||
|
||||
// TODO: This will lose underscores, is that a problem?
|
||||
// strip spaces from name
|
||||
std::string savename = name;
|
||||
replace(savename.begin(), savename.end(), ' ', '_');
|
||||
|
||||
data << savename << " " << posx << " " << posy;
|
||||
return data.str();
|
||||
}
|
||||
|
||||
void basecamp::load_data(std::string const& data)
|
||||
{
|
||||
std::stringstream stream(data);
|
||||
stream >> name >> posx >> posy;
|
||||
|
||||
// add space to name
|
||||
replace(name.begin(), name.end(), '_', ' ');
|
||||
}
|
||||
+29
@@ -0,0 +1,29 @@
|
||||
#ifndef _BASECAMP_H_
|
||||
#define _BASECAMP_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
class basecamp
|
||||
{
|
||||
public:
|
||||
basecamp();
|
||||
basecamp(std::string const& name_, int const posx_, int const posy_);
|
||||
|
||||
inline bool is_valid() const { return !name.empty(); }
|
||||
inline int board_x() const { return posx; }
|
||||
inline int board_y() const { return posy; }
|
||||
inline std::string const& camp_name() const { return name; }
|
||||
|
||||
std::string board_name() const;
|
||||
|
||||
// Save/load
|
||||
std::string save_data() const;
|
||||
void load_data(std::string const& data);
|
||||
|
||||
private:
|
||||
std::string name;
|
||||
int posx, posy; // location of associated bulletin board
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
+766
-82
File diff suppressed because it is too large
Load Diff
@@ -1,47 +1,26 @@
|
||||
#ifndef _BIONICS_H_
|
||||
#define _BIONICS_H_
|
||||
#include <string>
|
||||
#include <map>
|
||||
|
||||
/* Thought: Perhaps a HUD bionic that changes the display of the game?
|
||||
* Showing more information or something. */
|
||||
|
||||
enum bionic_id {
|
||||
// Power sources
|
||||
bio_batteries, bio_metabolics, bio_solar, bio_furnace, bio_ethanol,
|
||||
// Automatic / Always-On
|
||||
bio_memory, bio_ears,
|
||||
bio_eye_enhancer, bio_membrane, bio_targeting,
|
||||
bio_gills, bio_purifier,
|
||||
bio_climate, bio_storage, bio_recycler, bio_digestion, // TODO: Ynnn
|
||||
bio_tools, bio_shock, bio_heat_absorb,
|
||||
bio_carbon, bio_armor_head, bio_armor_torso, bio_armor_arms, bio_armor_legs,
|
||||
// Player Activated
|
||||
bio_flashlight, bio_night_vision, bio_infrared,
|
||||
bio_face_mask, // TODO
|
||||
bio_ads, bio_ods, bio_scent_mask, bio_cloak, bio_painkiller, bio_nanobots,
|
||||
bio_heatsink, bio_resonator, bio_time_freeze, bio_teleport, bio_blood_anal,
|
||||
bio_blood_filter, bio_alarm,
|
||||
bio_evap, bio_lighter, bio_claws, bio_blaster, bio_laser, bio_emp,
|
||||
// TODO: fingerhack
|
||||
bio_hydraulics, bio_water_extractor, bio_magnet, bio_fingerhack, bio_lockpick,
|
||||
bio_ground_sonar,
|
||||
max_bio_start,
|
||||
// EVERYTHING below this point is not available to brand-new players
|
||||
// TODO: all these suckers
|
||||
bio_banish, bio_gate_out, bio_gate_in, bio_nightfall, bio_drilldown,
|
||||
bio_heatwave, bio_lightning, bio_tremor, bio_flashflood,
|
||||
max_bio
|
||||
};
|
||||
typedef std::string bionic_id;
|
||||
|
||||
struct bionic_data {
|
||||
std::string name;
|
||||
bool power_source;
|
||||
bool activated; // If true, then the below function only happens when
|
||||
// activated; otherwise, it happens every turn
|
||||
int power_cost;
|
||||
int charge_time; // How long, when activated, between drawing power_cost
|
||||
// If 0, it draws power once
|
||||
std::string description;
|
||||
class bionic_data {
|
||||
public:
|
||||
bionic_data(std::string new_name, bool new_power_source, bool new_activated,
|
||||
int new_power_cost, int new_charge_time, std::string new_description);
|
||||
|
||||
std::string name;
|
||||
bool power_source;
|
||||
bool activated; // If true, then the below function only happens when
|
||||
// activated; otherwise, it happens every turn
|
||||
int power_cost;
|
||||
int charge_time; // How long, when activated, between drawing power_cost
|
||||
// If 0, it draws power once
|
||||
std::string description;
|
||||
};
|
||||
|
||||
struct bionic {
|
||||
@@ -50,7 +29,7 @@ struct bionic {
|
||||
bool powered;
|
||||
int charge;
|
||||
bionic() {
|
||||
id = bio_batteries;
|
||||
id = "bio_batteries";
|
||||
invlet = 'a';
|
||||
powered = false;
|
||||
charge = 0;
|
||||
@@ -62,236 +41,10 @@ struct bionic {
|
||||
charge = 0;
|
||||
};
|
||||
};
|
||||
|
||||
const bionic_data bionics[] = {
|
||||
{"Battery System", true, false, 0, 0, "\
|
||||
You have a battery draining attachment, and thus can make use of the energy\n\
|
||||
contained in normal, everyday batteries."},
|
||||
{"Metabolic Interchange", true, false, 0, 0, "\
|
||||
Your digestive system and power supply are interconnected. Any drain on\n\
|
||||
energy instead increases your hunger."},
|
||||
{"Solar Panels", true, false, 0, 0, "\
|
||||
You have a few solar panels installed. While in direct sunlight, your power\n\
|
||||
level will slowly recharge."},
|
||||
{"Internal Furnace", true, false, 0, 0, "\
|
||||
You can burn nearly any organic material as fuel (use 'E'), recharging your\n\
|
||||
power level. Some materials will burn better than others."},
|
||||
{"Ethanol Burner", true, false, 0, 0, "\
|
||||
You burn alcohol as fuel in an extremely efficient reaction. However, you\n\
|
||||
will still suffer the inebriating effects of the substance."},
|
||||
|
||||
{"Enhanced Memory Banks", false, false, 1, 0, "\
|
||||
Your memory has been enhanced with small quantum storage drives. Any time\n\
|
||||
you start to forget a skill, you have a chance at retaining all knowledge, at\n\
|
||||
the cost of a small amount of power."},
|
||||
{"Enhanced Hearing", false, false, 0, 0, "\
|
||||
Your hearing has been drastically improved, allowing you to hear ten times\n\
|
||||
better than the average person. Additionally, high-intensity sounds will be\n\
|
||||
automatically dampened before they can damage your hearing."},
|
||||
{"Diamond Cornea", false, false, 0, 0, "\
|
||||
Your vision is greatly enhanced, giving you a +2 bonus to perception."},
|
||||
{"Nictating Membrane", false, false, 0, 0, "\
|
||||
Your eyes have a thin membrane that closes over your eyes while underwater,\n\
|
||||
negating any vision penalties."},
|
||||
{"Targeting System", false, false, 0, 0, "\
|
||||
Your eyes are equipped with range finders, and their movement is synced with\n\
|
||||
that of your arms, to a degree. Shots you fire will be much more accurate,\n\
|
||||
particularly at long range."},
|
||||
{"Membrane Oxygenator", false, false, 1, 0, "\
|
||||
An oxygen interchange system automatically switches on while underwater,\n\
|
||||
slowly draining your energy reserves but providing oxygen."},
|
||||
{"Air Filtration System", false, false, 1, 0, "\
|
||||
Implanted in your trachea is an advanced filtration system. If toxins find\n\
|
||||
their way into your windpipe, the filter will attempt to remove them, at the\n\
|
||||
cost of a small amount of power."},
|
||||
{"Internal Climate Control", false, false, 0, 0, "\
|
||||
Throughout your body lies a network of thermal piping which eases the effects\n\
|
||||
of high and low ambient temperatures. It has an operating range of 0 to 140\n\
|
||||
degrees Fahrenheit."},
|
||||
{"Internal Storage", false, false, 0, 0, "\
|
||||
Space inside your chest cavity has been converted into a storage area. You\n\
|
||||
may carry an extra 8 units of volume."},
|
||||
{"Recycler Unit", false, false, 0, 0, "\
|
||||
Your digestive system has been outfitted with a series of filters and\n\
|
||||
processors, allowing you to reclaim waste liquid and, to a lesser degree,\n\
|
||||
nutrients. The net effect is a greatly reduced need to eat and drink."},
|
||||
{"Expanded Digestive System", false, false, 0, 0, "\
|
||||
You have been outfitted with three synthetic stomachs and industrial-grade\n\
|
||||
intestines. Not only can you extract much more nutrition from food, but you\n\
|
||||
are highly resistant to food-born illness, and can sometimes eat rotten food."},
|
||||
{"Integrated Toolset", false, false, 0, 0, "\
|
||||
Implanted in your hands and fingers is a complete tool set - screwdriver,\n\
|
||||
hammer, wrench, and much more. You no longer need any tools when crafting."},
|
||||
{"Electroshock Unit", false, false, 1, 0, "\
|
||||
While fighting unarmed, or with a weapon that conducts electricity, there is\n\
|
||||
a chance that a successful hit will shock your opponent, inflicting extra\n\
|
||||
damage and disabling them temporarily at the cost of some energy."},
|
||||
{"Heat Drain", false, false, 1, 0, "\
|
||||
While fighting unarmed against a warm-blooded opponent, there is a chance\n\
|
||||
that a successful hit will drain body heat, inflicting a small amount of\n\
|
||||
extra damage, and increasing your power reserves slightly."},
|
||||
{"Subdermal Carbon Filament", false, false, 0, 0, "\
|
||||
Lying just beneath your skin is a thin armor made of carbon nanotubes. This\n\
|
||||
reduces bashing damage by 2 and cutting damage by 4, but also reduces your\n\
|
||||
dexterity by 2."},
|
||||
{"Alloy Plating - Head", false, false, 0, 0, "\
|
||||
The flesh on your head has been replaced by a strong armor, protecting both\n\
|
||||
your head and jaw regions, but increasing encumberance by 2 and decreasing\n\
|
||||
perception by 1."},
|
||||
{"Alloy Plating - Torso", false, false, 0, 0, "\
|
||||
The flesh on your torso has been replaced by a strong armor, protecting you\n\
|
||||
greatly, but increasing your encumberance by 2 and decreasing dexterity by 1."},
|
||||
{"Alloy Plating - Arms", false, false, 0, 0, "\
|
||||
The flesh on your arms has been replaced by a strong armor, protecting you\n\
|
||||
greatly, but decreasing your dexterity by 2."},
|
||||
{"Alloy Plating - Legs", false, false, 0, 0, "\
|
||||
The flesh on your legs has been replaced by a strong armor, protecting you\n\
|
||||
greatly, but decreasing your speed by 15."},
|
||||
|
||||
{"Cranial Flashlight", false, true, 1, 30, "\
|
||||
Mounted between your eyes is a small but powerful LED flashlight."},
|
||||
{"Implanted Night Vision", false, true, 1, 20, "\
|
||||
Your eyes have been modified to amplify existing light, allowing you to see\n\
|
||||
in the dark."},
|
||||
{"Infrared Vision", false, true, 1, 4, "\
|
||||
Your range of vision extends into the infrared, allowing you to see warm-\n\
|
||||
blooded creatures in the dark, and even through walls."},
|
||||
{"Facial Distortion", false, true, 1, 10, "\
|
||||
Your face is actually made of a compound which may be molded by electrical\n\
|
||||
impulses, making you impossible to recognize. While not powered, however,\n\
|
||||
the compound reverts to its default shape."},
|
||||
{"Active Defense System", false, true, 1, 7, "\
|
||||
A thin forcefield surrounds your body, continually draining power. Anything\n\
|
||||
attempting to penetrate this field has a chance of being deflected at the\n\
|
||||
cost of more energy. Melee attacks will be stopped more often than bullets."},
|
||||
{"Offensive Defense System", false, true, 1, 6, "\
|
||||
A thin forcefield surrounds your body, continually draining power. This\n\
|
||||
field does not deflect penetration, but rather delivers a very strong shock,\n\
|
||||
damaging unarmed attackers and those with a conductive weapon."},
|
||||
{"Olfactory Mask", false, true, 1, 8, "\
|
||||
While this system is powered, your body will produce very little odor, making\n\
|
||||
it nearly impossible for creatures to track you by scent."},
|
||||
{"Cloaking System", false, true, 2, 1, "\
|
||||
This high-power system uses a set of cameras and LEDs to make you blend into\n\
|
||||
your background, rendering you fully invisible to normal vision. However,\n\
|
||||
you may be detected by infrared, sonar, etc."},
|
||||
{"Sensory Dulling", false, true, 2, 0, "\
|
||||
Your nervous system is wired to allow you to inhibit the signals of pain,\n\
|
||||
allowing you to dull your senses at will. However, the use of this system\n\
|
||||
may cause delayed reaction time and drowsiness."},
|
||||
{"Repair Nanobots", false, true, 5, 0, "\
|
||||
Inside your body is a fleet of tiny dormant robots. Once charged from your\n\
|
||||
energy banks, they will flit about your body, repairing any damage."},
|
||||
{"Thermal Dissapation", false, true, 1, 6, "\
|
||||
Powerful heatsinks supermaterials are woven into your flesh. While powered,\n\
|
||||
this system will prevent heat damage up to 2000 degrees fahrenheit. Note\n\
|
||||
that this does not affect your internal temperature."},
|
||||
{"Sonic Resonator", false, true, 4, 0, "\
|
||||
Your entire body may resonate at very high power, creating a short-range\n\
|
||||
shockwave. While it will not to much damage to flexible creatures, stiff\n\
|
||||
items such as walls, doors, and even robots will be severely damaged."},
|
||||
{"Time Dilation", false, true, 3, 0, "\
|
||||
At an immense cost of power, you may increase your body speed and reactions\n\
|
||||
dramatically, essentially freezing time. You are still delicate, however,\n\
|
||||
and violent or rapid movements may damage you due to friction."},
|
||||
{"Teleportation Unit", false, true, 10, 0, "\
|
||||
This highly experimental unit folds space over short distances, instantly\n\
|
||||
transporting your body up to 25 feet at the cost of much power. Note that\n\
|
||||
prolonged or frequent use may have dangerous side effects."},
|
||||
{"Blood Analysis", false, true, 1, 0, "\
|
||||
Small sensors have been implanted in your heart, allowing you to analyse your\n\
|
||||
blood. This will detect many illnesses, drugs, and other conditions."},
|
||||
{"Blood Filter", false, true, 3, 0, "\
|
||||
A filtration system in your heart allows you to actively filter out chemical\n\
|
||||
impurities, primarily drugs. It will have limited impact on viruses. Note\n\
|
||||
that it is not a targeted filter; ALL drugs in your system will be affected."},
|
||||
{"Alarm System", false, true, 1, 400, "\
|
||||
A motion-detecting alarm system will notice almost all movement within a\n\
|
||||
fifteen-foot radius, and will silently alert you. This is very useful during\n\
|
||||
sleep, or if you suspect a cloaked pursuer."},
|
||||
{"Aero-Evaporator", false, true, 8, 0, "\
|
||||
This unit draws moisture from the surrounding air, which then is poured from\n\
|
||||
a fingertip in the form of water. It may fail in very dry environments."},
|
||||
{"Mini-Flamethrower", false, true, 3, 0, "\
|
||||
The index fingers of both hands have powerful fire starters which extend from\n\
|
||||
the tip."},
|
||||
{"Adamantium Claws", false, true, 3, 0, "\
|
||||
Your fingers can withdraw into your hands, allowing a set of vicious claws to\n\
|
||||
extend. These do considerable cutting damage, but prevent you from holding\n\
|
||||
anything else."},
|
||||
{"Fusion Blaster Arm", false, true, 2, 0, "\
|
||||
Your left arm has been replaced by a heavy-duty fusion blaster! You may use\n\
|
||||
your energy banks to fire a damaging heat ray; however, you are unable to use\n\
|
||||
or carry two-handed items, and may only fire handguns."},
|
||||
{"Finger-Mounter Laser", false, true, 2, 0, "\
|
||||
One of your fingers has a small high-powered laser embedded in it. This long\n\
|
||||
range weapon is not incredibly damaging, but is very accurate, and has the\n\
|
||||
potential to start fires."},
|
||||
{"Directional EMP", false, true, 4, 0, "\
|
||||
Mounted in the palms of your hand are small parabolic EMP field generators.\n\
|
||||
You may use power to fire a short-ranged blast which will disable electronics\n\
|
||||
and robots."},
|
||||
{"Hydraulic Muscles", false, true, 1, 3, "\
|
||||
While activated, the muslces in your arms will be greatly enchanced,\n\
|
||||
increasing your strength by 20."},
|
||||
{"Water Extraction Unit", false, true, 2, 0, "\
|
||||
Nanotubs embedded in the palm of your hand will pump any available fluid out\n\
|
||||
of a dead body, cleanse it of impurities and convert it into drinkable water.\n\
|
||||
You must, however, have a container to store the water in."},
|
||||
{"Electromagnetic Unit", false, true, 2, 0, "\
|
||||
Embedded in your hand is a powerful electromagnet, allowing you to pull items\n\
|
||||
made of iron over short distances."},
|
||||
{"Fingerhack", false, true, 1, 0, "\
|
||||
One of your fingers has an electrohack embedded in it; an all-purpose hacking\n\
|
||||
unit used to override control panels and the like (but not computers). Skill\n\
|
||||
in computers is important, and a failed use may damage your circuits."},
|
||||
{"Fingerpick", false, true, 1, 0, "\
|
||||
One of your fingers has an electronic lockpick embedded in it. This auto-\n\
|
||||
matic system will quickly unlock all but the most advanced key locks without\n\
|
||||
any skill required on the part of the user."},
|
||||
{"Terranian Sonar", false, true, 1, 5, "\
|
||||
Your feet are equipped with precision sonar equipment, allowing you to detect\n\
|
||||
the movements of creatures below the ground."},
|
||||
|
||||
{"max_bio_start - BUG", false, false, 0, 0, "\
|
||||
This is a placeholder bionic meant to demarkate those which a new character\n\
|
||||
can start with. If you are reading this, you have found a bug!"},
|
||||
|
||||
{"Banishment", false, true, 40, 0, "\
|
||||
You can briefly open a one-way gate to the nether realm, banishing a single\n\
|
||||
target there permanently. This is not without its dangers, however, as the\n\
|
||||
inhabitants of the nether world may take notice."},
|
||||
{"Gate Out", false, true, 55, 0, "\
|
||||
You can temporarily open a two-way gate to the nether realm, accessible only\n\
|
||||
by you. This will remove you from immediate danger, but may attract the\n\
|
||||
attention of the nether world's inhabitants..."},
|
||||
{"Gate In", false, true, 35, 0, "\
|
||||
You can temporarily open a one-way gate from the nether realm. This will\n\
|
||||
attract the attention of its horrifying inhabitants, who may begin to pour\n\
|
||||
into reality."},
|
||||
{"Artificial Night", false, true, 5, 1, "\
|
||||
Photon absorbtion panels will attract and obliterate photons within a 100'\n\
|
||||
radius, casting an area around you into pitch darkness."},
|
||||
{"Borehole Drill", false, true, 30, 0, "\
|
||||
Your legs can transform into a powerful drill which will bury you 50 feet\n\
|
||||
into the earth. Be careful to only drill down when you know you will be able\n\
|
||||
to get out, or you'll simply dig your own tomb."},
|
||||
{"Heatwave", false, true, 45, 0, "\
|
||||
At the cost of immense power, you can cause dramatic spikes in the ambient\n\
|
||||
temperature around you. These spikes are very short-lived, but last long\n\
|
||||
enough to ignite wood, paper, gunpowder, and other substances."},
|
||||
{"Chain Lightning", false, true, 48, 0, "\
|
||||
Powerful capacitors unleash an electrical storm at your command, sending a\n\
|
||||
chain of highly-damaging lightning through the air. It has the power to\n\
|
||||
injure several opponents before grounding itself."},
|
||||
{"Tremor Pads", false, true, 40, 0, "\
|
||||
Using tremor pads in your feet, you can cause a miniature earthquake. The\n\
|
||||
shockwave will damage enemies (particularly those digging underground), tear\n\
|
||||
down walls, and churn the earth."},
|
||||
{"Flashflood", false, true, 35, 0, "\
|
||||
By drawing the moisture from the air, and synthesizing water from in-air\n\
|
||||
elements, you can create a massive puddle around you. The effects are more\n\
|
||||
powerful when used near a body of water."}
|
||||
};
|
||||
extern std::map<bionic_id, bionic_data*> bionics;
|
||||
extern std::vector<bionic_id> faulty_bionics;
|
||||
extern std::vector<bionic_id> power_source_bionics;
|
||||
extern std::vector<bionic_id> unpowered_bionics;
|
||||
|
||||
#endif
|
||||
|
||||
+21
-6
@@ -9,7 +9,7 @@ std::string body_part_name (body_part bp, int side)
|
||||
case bp_eyes:
|
||||
return "eyes";
|
||||
case bp_mouth:
|
||||
return "jaw";
|
||||
return "mouth";
|
||||
case bp_torso:
|
||||
return "torso";
|
||||
case bp_arms:
|
||||
@@ -41,18 +41,33 @@ std::string body_part_name (body_part bp, int side)
|
||||
}
|
||||
}
|
||||
|
||||
std::string encumb_text(body_part bp)
|
||||
{
|
||||
switch (bp) {
|
||||
case bp_head: return "";
|
||||
case bp_eyes: return "Ranged combat is hampered.";
|
||||
case bp_mouth: return "Running is slowed.";
|
||||
case bp_torso: return "Dodging and melee is hampered.";
|
||||
case bp_arms: return "Melee and ranged combat is hampered.";
|
||||
case bp_hands: return "Manual tasks are slowed.";
|
||||
case bp_legs: return "Running and swimming are slowed.";
|
||||
case bp_feet: return "Running is slowed.";
|
||||
default: return "It's inflammed.";
|
||||
}
|
||||
}
|
||||
|
||||
body_part random_body_part()
|
||||
{
|
||||
int rn = rng(0, 30);
|
||||
int rn = rng(0, 100);
|
||||
if (rn == 0)
|
||||
return bp_eyes;
|
||||
if (rn <= 2)
|
||||
if (rn <= 1)
|
||||
return bp_mouth;
|
||||
if (rn <= 6)
|
||||
if (rn <= 7)
|
||||
return bp_head;
|
||||
if (rn <= 12)
|
||||
if (rn <= 28)
|
||||
return bp_legs;
|
||||
if (rn <= 20)
|
||||
if (rn <= 50)
|
||||
return bp_arms;
|
||||
return bp_torso;
|
||||
}
|
||||
|
||||
+5
-3
@@ -2,12 +2,12 @@
|
||||
#define _BODYPART_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
// The order is important ; pldata.h has to be in the same order
|
||||
enum body_part {
|
||||
bp_head = 0,
|
||||
bp_torso = 0,
|
||||
bp_head,
|
||||
bp_eyes,
|
||||
bp_mouth,
|
||||
bp_torso,
|
||||
bp_arms,
|
||||
bp_hands,
|
||||
bp_legs,
|
||||
@@ -16,6 +16,8 @@ enum body_part {
|
||||
};
|
||||
|
||||
std::string body_part_name(body_part bp, int side);
|
||||
std::string encumb_text(body_part bp);
|
||||
|
||||
body_part random_body_part();
|
||||
|
||||
#endif
|
||||
|
||||
+416
@@ -0,0 +1,416 @@
|
||||
#include <sstream>
|
||||
#include "calendar.h"
|
||||
#include "output.h"
|
||||
#include "options.h"
|
||||
|
||||
calendar::calendar()
|
||||
{
|
||||
second = 0;
|
||||
minute = 0;
|
||||
hour = 0;
|
||||
day = 0;
|
||||
season = SPRING;
|
||||
year = 0;
|
||||
}
|
||||
|
||||
calendar::calendar(const calendar ©)
|
||||
{
|
||||
second = copy.second;
|
||||
minute = copy.minute;
|
||||
hour = copy.hour;
|
||||
day = copy.day;
|
||||
season = copy.season;
|
||||
year = copy.year;
|
||||
}
|
||||
|
||||
calendar::calendar(int Minute, int Hour, int Day, season_type Season, int Year)
|
||||
{
|
||||
second = 0;
|
||||
minute = Minute;
|
||||
hour = Hour;
|
||||
day = Day;
|
||||
season = Season;
|
||||
year = Year;
|
||||
}
|
||||
|
||||
calendar::calendar(int turn)
|
||||
{
|
||||
int minutes = int(turn / 10);
|
||||
int hours = minutes / 60;
|
||||
int days = hours / 24;
|
||||
int seasons = days / DAYS_IN_SEASON;
|
||||
second = 6 * (turn % 10);
|
||||
minute = minutes % 60;
|
||||
hour = hours % 24;
|
||||
day = 1 + days % DAYS_IN_SEASON;
|
||||
season = season_type(seasons % 4);
|
||||
year = seasons / 4;
|
||||
}
|
||||
|
||||
int calendar::get_turn()
|
||||
{
|
||||
int ret = second / 6;
|
||||
ret += minute * 10;
|
||||
ret += hour * 600;
|
||||
ret += day * 14400;
|
||||
ret += int(season) * 14400 * DAYS_IN_SEASON;
|
||||
ret += year * 14400 * 4 * DAYS_IN_SEASON;
|
||||
return ret;
|
||||
}
|
||||
|
||||
calendar::operator int() const
|
||||
{
|
||||
int ret = second / 6;
|
||||
ret += minute * 10;
|
||||
ret += hour * 600;
|
||||
ret += day * 14400;
|
||||
ret += int(season) * 14400 * DAYS_IN_SEASON;
|
||||
ret += year * 14400 * 4 * DAYS_IN_SEASON;
|
||||
return ret;
|
||||
}
|
||||
|
||||
calendar& calendar::operator =(calendar &rhs)
|
||||
{
|
||||
if (this == &rhs)
|
||||
return *this;
|
||||
|
||||
second = rhs.second;
|
||||
minute = rhs.minute;
|
||||
hour = rhs.hour;
|
||||
day = rhs.day;
|
||||
season = rhs.season;
|
||||
year = rhs.year;
|
||||
|
||||
return *this;
|
||||
}
|
||||
|
||||
calendar& calendar::operator =(int rhs)
|
||||
{
|
||||
int minutes = int(rhs / 10);
|
||||
int hours = minutes / 60;
|
||||
int days = hours / 24;
|
||||
int seasons = days / DAYS_IN_SEASON;
|
||||
second = 6 * (rhs % 10);
|
||||
minute = minutes % 60;
|
||||
hour = hours % 24;
|
||||
day = days % DAYS_IN_SEASON;
|
||||
season = season_type(seasons % 4);
|
||||
year = seasons / 4;
|
||||
return *this;
|
||||
}
|
||||
|
||||
calendar& calendar::operator -=(calendar &rhs)
|
||||
{
|
||||
calendar tmp(rhs);
|
||||
tmp.standardize();
|
||||
second -= tmp.second;
|
||||
minute -= tmp.minute;
|
||||
hour -= tmp.hour;
|
||||
day -= tmp.day;
|
||||
int tmpseason = int(season) - int(tmp.season);
|
||||
while (tmpseason < 0) {
|
||||
year--;
|
||||
tmpseason += 4;
|
||||
}
|
||||
season = season_type(tmpseason);
|
||||
year -= tmp.year;
|
||||
standardize();
|
||||
return *this;
|
||||
}
|
||||
|
||||
calendar& calendar::operator -=(int rhs)
|
||||
{
|
||||
calendar tmp(rhs);
|
||||
*this -= tmp;
|
||||
return *this;
|
||||
}
|
||||
|
||||
calendar& calendar::operator +=(calendar &rhs)
|
||||
{
|
||||
second += rhs.second;
|
||||
minute += rhs.minute;
|
||||
hour += rhs.hour;
|
||||
day += rhs.day;
|
||||
int tmpseason = int(season) + int(rhs.season);
|
||||
while (tmpseason >= 4) {
|
||||
year++;
|
||||
tmpseason -= 4;
|
||||
}
|
||||
season = season_type(tmpseason);
|
||||
year += rhs.year;
|
||||
standardize();
|
||||
return *this;
|
||||
}
|
||||
|
||||
calendar& calendar::operator +=(int rhs)
|
||||
{
|
||||
second += rhs * 6;
|
||||
standardize();
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool calendar::operator ==(int rhs)
|
||||
{
|
||||
return int(*this) == rhs;
|
||||
}
|
||||
bool calendar::operator ==(calendar &rhs)
|
||||
{
|
||||
return (second == rhs.second &&
|
||||
minute == rhs.minute &&
|
||||
hour == rhs.hour &&
|
||||
day == rhs.day &&
|
||||
season == rhs.season &&
|
||||
year == rhs.year);
|
||||
}
|
||||
|
||||
/*
|
||||
calendar& calendar::operator ++()
|
||||
{
|
||||
*this += 1;
|
||||
return *this;
|
||||
}
|
||||
*/
|
||||
|
||||
calendar calendar::operator -(calendar &rhs)
|
||||
{
|
||||
return calendar(*this) -= rhs;
|
||||
}
|
||||
|
||||
calendar calendar::operator -(int rhs)
|
||||
{
|
||||
return calendar(*this) -= rhs;
|
||||
}
|
||||
|
||||
calendar calendar::operator +(calendar &rhs)
|
||||
{
|
||||
return calendar(*this) += rhs;
|
||||
}
|
||||
|
||||
calendar calendar::operator +(int rhs)
|
||||
{
|
||||
return calendar(*this) += rhs;
|
||||
}
|
||||
|
||||
void calendar::increment()
|
||||
{
|
||||
second += 6;
|
||||
if (second >= 60)
|
||||
standardize();
|
||||
}
|
||||
|
||||
void calendar::standardize()
|
||||
{
|
||||
if (second >= 60) {
|
||||
minute += second / 60;
|
||||
second %= 60;
|
||||
}
|
||||
if (minute >= 60) {
|
||||
hour += minute / 60;
|
||||
minute %= 60;
|
||||
}
|
||||
if (hour >= 24) {
|
||||
day += hour / 24;
|
||||
hour %= 24;
|
||||
}
|
||||
int tmpseason = int(season);
|
||||
if (day >= DAYS_IN_SEASON) {
|
||||
tmpseason += day / DAYS_IN_SEASON;
|
||||
day %= DAYS_IN_SEASON;
|
||||
}
|
||||
if (tmpseason >= 4) {
|
||||
year += tmpseason / 4;
|
||||
tmpseason %= 4;
|
||||
}
|
||||
season = season_type(tmpseason);
|
||||
}
|
||||
|
||||
int calendar::minutes_past_midnight() const
|
||||
{
|
||||
//debugmsg("minute: %d hour: %d");
|
||||
int ret = minute + hour * 60;
|
||||
return ret;
|
||||
}
|
||||
|
||||
moon_phase calendar::moon() const
|
||||
{
|
||||
int phase = day / (DAYS_IN_SEASON / 4);
|
||||
//phase %= 4; Redundant?
|
||||
if (phase == 3)
|
||||
return MOON_HALF;
|
||||
else
|
||||
return moon_phase(phase);
|
||||
}
|
||||
|
||||
calendar calendar::sunrise() const
|
||||
{
|
||||
calendar ret;
|
||||
int start_hour = 0, end_hour = 0;
|
||||
switch (season) {
|
||||
case SPRING:
|
||||
start_hour = SUNRISE_SOLSTICE;
|
||||
end_hour = SUNRISE_SUMMER;
|
||||
break;
|
||||
case SUMMER:
|
||||
start_hour = SUNRISE_SUMMER;
|
||||
end_hour = SUNRISE_SOLSTICE;
|
||||
break;
|
||||
case AUTUMN:
|
||||
start_hour = SUNRISE_SOLSTICE;
|
||||
end_hour = SUNRISE_WINTER;
|
||||
break;
|
||||
case WINTER:
|
||||
start_hour = SUNRISE_WINTER;
|
||||
end_hour = SUNRISE_SOLSTICE;
|
||||
break;
|
||||
}
|
||||
double percent = double(double(day) / DAYS_IN_SEASON);
|
||||
double time = double(start_hour) * (1.- percent) + double(end_hour) * percent;
|
||||
|
||||
ret.hour = int(time);
|
||||
time -= int(time);
|
||||
ret.minute = int(time * 60);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
calendar calendar::sunset() const
|
||||
{
|
||||
calendar ret;
|
||||
int start_hour = 0, end_hour = 0;
|
||||
switch (season) {
|
||||
case SPRING:
|
||||
start_hour = SUNSET_SOLSTICE;
|
||||
end_hour = SUNSET_SUMMER;
|
||||
break;
|
||||
case SUMMER:
|
||||
start_hour = SUNSET_SUMMER;
|
||||
end_hour = SUNSET_SOLSTICE;
|
||||
break;
|
||||
case AUTUMN:
|
||||
start_hour = SUNSET_SOLSTICE;
|
||||
end_hour = SUNSET_WINTER;
|
||||
break;
|
||||
case WINTER:
|
||||
start_hour = SUNSET_WINTER;
|
||||
end_hour = SUNSET_SOLSTICE;
|
||||
break;
|
||||
}
|
||||
double percent = double(double(day) / DAYS_IN_SEASON);
|
||||
double time = double(start_hour) * (1.- percent) + double(end_hour) * percent;
|
||||
|
||||
ret.hour = int(time);
|
||||
time -= int(time);
|
||||
ret.minute = int(time * 60);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool calendar::is_night() const
|
||||
{
|
||||
calendar sunrise_time = sunrise(), sunset_time = sunset();
|
||||
|
||||
int mins = minutes_past_midnight(),
|
||||
sunrise_mins = sunrise_time.minutes_past_midnight(),
|
||||
sunset_mins = sunset_time.minutes_past_midnight();
|
||||
|
||||
return (mins > sunset_mins + TWILIGHT_MINUTES || mins < sunrise_mins);
|
||||
}
|
||||
|
||||
int calendar::sunlight() const
|
||||
{
|
||||
calendar sunrise_time = sunrise(), sunset_time = sunset();
|
||||
|
||||
int mins = 0, sunrise_mins = 0, sunset_mins = 0;
|
||||
mins = minutes_past_midnight();
|
||||
sunrise_mins = sunrise_time.minutes_past_midnight();
|
||||
sunset_mins = sunset_time.minutes_past_midnight();
|
||||
|
||||
int moonlight = 1 + int(moon()) * MOONLIGHT_LEVEL;
|
||||
|
||||
if (mins > sunset_mins + TWILIGHT_MINUTES || mins < sunrise_mins) // Night
|
||||
return moonlight;
|
||||
|
||||
else if (mins >= sunrise_mins && mins <= sunrise_mins + TWILIGHT_MINUTES) {
|
||||
|
||||
double percent = double(mins - sunrise_mins) / TWILIGHT_MINUTES;
|
||||
return int( double(moonlight) * (1. - percent) +
|
||||
double(DAYLIGHT_LEVEL) * percent );
|
||||
|
||||
} else if (mins >= sunset_mins && mins <= sunset_mins + TWILIGHT_MINUTES) {
|
||||
|
||||
double percent = double(mins - sunset_mins) / TWILIGHT_MINUTES;
|
||||
return int( double(DAYLIGHT_LEVEL) * (1. - percent) +
|
||||
double(moonlight) * percent );
|
||||
|
||||
} else
|
||||
return DAYLIGHT_LEVEL;
|
||||
}
|
||||
|
||||
std::string calendar::print_time(bool twentyfour)
|
||||
{
|
||||
std::stringstream ret;
|
||||
if (twentyfour) {
|
||||
ret << hour << ":";
|
||||
if (minute < 10)
|
||||
ret << "0";
|
||||
ret << minute;
|
||||
} else {
|
||||
if (OPTIONS[OPT_24_HOUR] == 1) {
|
||||
int hours = hour % 24;
|
||||
if (hours < 10)
|
||||
ret << "0";
|
||||
ret << hours;
|
||||
} else if (OPTIONS[OPT_24_HOUR] == 2) {
|
||||
int hours = hour % 24;
|
||||
ret << hours << ":";
|
||||
}else {
|
||||
int hours = hour % 12;
|
||||
if (hours == 0)
|
||||
hours = 12;
|
||||
ret << hours << ":";
|
||||
}
|
||||
if (minute < 10)
|
||||
ret << "0";
|
||||
ret << minute;
|
||||
if (OPTIONS[OPT_24_HOUR] == 0) {
|
||||
if (hour < 12)
|
||||
ret << " AM";
|
||||
else
|
||||
ret << " PM";
|
||||
}
|
||||
}
|
||||
|
||||
return ret.str();
|
||||
}
|
||||
|
||||
std::string calendar::textify_period()
|
||||
{
|
||||
standardize();
|
||||
std::stringstream ret;
|
||||
int am;
|
||||
std::string tx;
|
||||
// Describe the biggest time period, as "<am> <tx>s", am = amount, tx = name
|
||||
if (year > 0) {
|
||||
am = year;
|
||||
tx = "year";
|
||||
} else if (season > 0) {
|
||||
am = season;
|
||||
tx = "season";
|
||||
} else if (day > 0) {
|
||||
am = day;
|
||||
tx = "day";
|
||||
} else if (hour > 0) {
|
||||
am = hour;
|
||||
tx = "hour";
|
||||
} else if (minute >= 5) {
|
||||
am = minute;
|
||||
tx = "minute";
|
||||
} else {
|
||||
am = second / 6 + minute * 10;
|
||||
tx = "turn";
|
||||
}
|
||||
|
||||
ret << am << " " << tx << (am > 1 ? "s" : "");
|
||||
|
||||
return ret.str();
|
||||
}
|
||||
+83
@@ -0,0 +1,83 @@
|
||||
#include <string>
|
||||
#include "weather.h"
|
||||
|
||||
// How many minutes exist when the game starts - 8:00 AM
|
||||
#define STARTING_MINUTES 480
|
||||
// The number of days in a season - this also defines moon cycles
|
||||
#define DAYS_IN_SEASON 14
|
||||
|
||||
// Convert minutes, hours, days to turns
|
||||
#define MINUTES(x) ((x) * 10)
|
||||
#define HOURS(x) ((x) * 600)
|
||||
#define DAYS(x) ((x) * 14400)
|
||||
|
||||
// Times for sunrise, sunset at equinoxes
|
||||
#define SUNRISE_WINTER 7
|
||||
#define SUNRISE_SOLSTICE 6
|
||||
#define SUNRISE_SUMMER 5
|
||||
|
||||
#define SUNSET_WINTER 17
|
||||
#define SUNSET_SOLSTICE 19
|
||||
#define SUNSET_SUMMER 21
|
||||
|
||||
// How long, in minutes, does sunrise/sunset last?
|
||||
#define TWILIGHT_MINUTES 60
|
||||
|
||||
// How much light moon provides--double for full moon
|
||||
#define MOONLIGHT_LEVEL 4
|
||||
// How much light is provided in full daylight
|
||||
#define DAYLIGHT_LEVEL 60
|
||||
|
||||
enum moon_phase {
|
||||
MOON_NEW = 0,
|
||||
MOON_HALF,
|
||||
MOON_FULL
|
||||
};
|
||||
|
||||
class calendar
|
||||
{
|
||||
public:
|
||||
// The basic data; note that "second" should always be a multiple of 6
|
||||
int second;
|
||||
int minute;
|
||||
int hour;
|
||||
int day;
|
||||
season_type season;
|
||||
int year;
|
||||
// End data
|
||||
|
||||
calendar();
|
||||
calendar(const calendar ©);
|
||||
calendar(int Minute, int Hour, int Day, season_type Season, int Year);
|
||||
calendar(int turn);
|
||||
int get_turn();
|
||||
operator int() const; // Returns get_turn() for backwards compatibility
|
||||
calendar& operator = (calendar &rhs);
|
||||
calendar& operator = (int rhs);
|
||||
calendar& operator -=(calendar &rhs);
|
||||
calendar& operator -=(int rhs);
|
||||
calendar& operator +=(calendar &rhs);
|
||||
calendar& operator +=(int rhs);
|
||||
calendar operator - (calendar &rhs);
|
||||
calendar operator - (int rhs);
|
||||
calendar operator + (calendar &rhs);
|
||||
calendar operator + (int rhs);
|
||||
bool operator ==(int rhs);
|
||||
bool operator ==(calendar &rhs);
|
||||
|
||||
void increment(); // Add one turn / 6 seconds
|
||||
|
||||
void standardize(); // Ensure minutes <= 59, hour <= 23, etc.
|
||||
|
||||
// Sunlight and day/night calcuations
|
||||
int minutes_past_midnight() const; // Useful for sunrise/set calculations
|
||||
moon_phase moon() const; // Find phase of moon
|
||||
calendar sunrise() const; // Current time of sunrise
|
||||
calendar sunset() const; // Current time of sunset
|
||||
bool is_night() const; // After sunset + TWILIGHT_MINUTES, before sunrise
|
||||
int sunlight() const; // Current amount of sun/moonlight; uses preceding funcs
|
||||
|
||||
// Print-friendly stuff
|
||||
std::string print_time(bool twentyfour = false);
|
||||
std::string textify_period(); // "1 second" "2 hours" "two days"
|
||||
};
|
||||
Executable
+3
@@ -0,0 +1,3 @@
|
||||
#!/usr/bin/env sh
|
||||
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
|
||||
cd $DIR && ./cataclysm
|
||||
+831
@@ -0,0 +1,831 @@
|
||||
#if (defined _WIN32 || defined WINDOWS)
|
||||
#include "catacurse.h"
|
||||
#include "options.h"
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
|
||||
//***********************************
|
||||
//Globals *
|
||||
//***********************************
|
||||
|
||||
WINDOW *mainwin;
|
||||
const WCHAR *szWindowClass = (L"CataCurseWindow"); //Class name :D
|
||||
HINSTANCE WindowINST; //the instance of the window
|
||||
HWND WindowHandle; //the handle of the window
|
||||
HDC WindowDC; //Device Context of the window, used for backbuffer
|
||||
int WindowX; //X pos of the actual window, not the curses window
|
||||
int WindowY; //Y pos of the actual window, not the curses window
|
||||
int WindowWidth; //Width of the actual window, not the curses window
|
||||
int WindowHeight; //Height of the actual window, not the curses window
|
||||
int lastchar; //the last character that was pressed, resets in getch
|
||||
int inputdelay; //How long getch will wait for a character to be typed
|
||||
//WINDOW *_windows; //Probably need to change this to dynamic at some point
|
||||
//int WindowCount; //The number of curses windows currently in use
|
||||
HDC backbuffer; //an off-screen DC to prevent flickering, lower cpu
|
||||
HBITMAP backbit; //the bitmap that is used in conjunction wth the above
|
||||
int fontwidth; //the width of the font, background is always this size
|
||||
int fontheight; //the height of the font, background is always this size
|
||||
int halfwidth; //half of the font width, used for centering lines
|
||||
int halfheight; //half of the font height, used for centering lines
|
||||
HFONT font; //Handle to the font created by CreateFont
|
||||
RGBQUAD *windowsPalette; //The coor palette, 16 colors emulates a terminal
|
||||
pairs *colorpairs; //storage for pair'ed colored, should be dynamic, meh
|
||||
unsigned char *dcbits; //the bits of the screen image, for direct access
|
||||
char szDirectory[MAX_PATH] = "";
|
||||
|
||||
//***********************************
|
||||
//Non-curses, Window functions *
|
||||
//***********************************
|
||||
|
||||
//Registers, creates, and shows the Window!!
|
||||
bool WinCreate()
|
||||
{
|
||||
int success;
|
||||
WNDCLASSEXW WindowClassType;
|
||||
int WinBorderHeight;
|
||||
int WinBorderWidth;
|
||||
int WinTitleSize;
|
||||
unsigned int WindowStyle;
|
||||
const WCHAR *szTitle= (L"Cataclysm: Dark Days Ahead - 0.4");
|
||||
WinTitleSize = GetSystemMetrics(SM_CYCAPTION); //These lines ensure
|
||||
WinBorderWidth = GetSystemMetrics(SM_CXDLGFRAME) * 2; //that our window will
|
||||
WinBorderHeight = GetSystemMetrics(SM_CYDLGFRAME) * 2; // be a perfect size
|
||||
WindowClassType.cbSize = sizeof(WNDCLASSEXW);
|
||||
WindowClassType.style = 0;//No point in having a custom style, no mouse, etc
|
||||
WindowClassType.lpfnWndProc = ProcessMessages;//the procedure that gets msgs
|
||||
WindowClassType.cbClsExtra = 0;
|
||||
WindowClassType.cbWndExtra = 0;
|
||||
WindowClassType.hInstance = WindowINST;// hInstance
|
||||
WindowClassType.hIcon = LoadIcon(WindowINST, IDI_APPLICATION);//Default Icon
|
||||
WindowClassType.hIconSm = LoadIcon(WindowINST, IDI_APPLICATION);//Default Icon
|
||||
WindowClassType.hCursor = LoadCursor(NULL, IDC_ARROW);//Default Pointer
|
||||
WindowClassType.lpszMenuName = NULL;
|
||||
WindowClassType.hbrBackground = 0;//Thanks jday! Remove background brush
|
||||
WindowClassType.lpszClassName = szWindowClass;
|
||||
success = RegisterClassExW(&WindowClassType);
|
||||
if ( success== 0){
|
||||
return false;
|
||||
}
|
||||
WindowStyle = WS_OVERLAPPEDWINDOW & ~(WS_THICKFRAME) & ~(WS_MAXIMIZEBOX);
|
||||
WindowHandle = CreateWindowExW(WS_EX_APPWINDOW || WS_EX_TOPMOST * 0,
|
||||
szWindowClass , szTitle,WindowStyle, WindowX,
|
||||
WindowY, WindowWidth + (WinBorderWidth) * 1,
|
||||
WindowHeight + (WinBorderHeight +
|
||||
WinTitleSize) * 1, 0, 0, WindowINST, NULL);
|
||||
if (WindowHandle == 0){
|
||||
return false;
|
||||
}
|
||||
ShowWindow(WindowHandle,5);
|
||||
return true;
|
||||
};
|
||||
|
||||
//Unregisters, releases the DC if needed, and destroys the window.
|
||||
void WinDestroy()
|
||||
{
|
||||
if ((WindowDC > 0) && (ReleaseDC(WindowHandle, WindowDC) == 0)){
|
||||
WindowDC = 0;
|
||||
}
|
||||
if ((!WindowHandle == 0) && (!(DestroyWindow(WindowHandle)))){
|
||||
WindowHandle = 0;
|
||||
}
|
||||
if (!(UnregisterClassW(szWindowClass, WindowINST))){
|
||||
WindowINST = 0;
|
||||
}
|
||||
};
|
||||
|
||||
//This function processes any Windows messages we get. Keyboard, OnClose, etc
|
||||
LRESULT CALLBACK ProcessMessages(HWND__ *hWnd,unsigned int Msg,
|
||||
WPARAM wParam, LPARAM lParam)
|
||||
{
|
||||
switch (Msg){
|
||||
case WM_CHAR: //This handles most key presses
|
||||
lastchar=(int)wParam;
|
||||
switch (lastchar){
|
||||
case 13: //Reroute ENTER key for compatilbity purposes
|
||||
lastchar=10;
|
||||
break;
|
||||
case 8: //Reroute BACKSPACE key for compatilbity purposes
|
||||
lastchar=127;
|
||||
break;
|
||||
};
|
||||
break;
|
||||
case WM_KEYDOWN: //Here we handle non-character input
|
||||
switch (wParam){
|
||||
case VK_LEFT:
|
||||
lastchar = KEY_LEFT;
|
||||
break;
|
||||
case VK_RIGHT:
|
||||
lastchar = KEY_RIGHT;
|
||||
break;
|
||||
case VK_UP:
|
||||
lastchar = KEY_UP;
|
||||
break;
|
||||
case VK_DOWN:
|
||||
lastchar = KEY_DOWN;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
case WM_ERASEBKGND:
|
||||
return 1; //We don't want to erase our background
|
||||
case WM_PAINT: //Pull from our backbuffer, onto the screen
|
||||
BitBlt(WindowDC, 0, 0, WindowWidth, WindowHeight, backbuffer, 0, 0,SRCCOPY);
|
||||
ValidateRect(WindowHandle,NULL);
|
||||
break;
|
||||
case WM_DESTROY:
|
||||
exit(0);//A messy exit, but easy way to escape game loop
|
||||
default://If we didnt process a message, return the default value for it
|
||||
return DefWindowProcW(hWnd, Msg, wParam, lParam);
|
||||
};
|
||||
return 0;
|
||||
};
|
||||
|
||||
//The following 3 methods use mem functions for fast drawing
|
||||
inline void VertLineDIB(int x, int y, int y2,int thickness, unsigned char color)
|
||||
{
|
||||
int j;
|
||||
for (j=y; j<y2; j++)
|
||||
memset(&dcbits[x+j*WindowWidth],color,thickness);
|
||||
};
|
||||
inline void HorzLineDIB(int x, int y, int x2,int thickness, unsigned char color)
|
||||
{
|
||||
int j;
|
||||
for (j=y; j<y+thickness; j++)
|
||||
memset(&dcbits[x+j*WindowWidth],color,x2-x);
|
||||
};
|
||||
inline void FillRectDIB(int x, int y, int width, int height, unsigned char color)
|
||||
{
|
||||
int j;
|
||||
for (j=y; j<y+height; j++)
|
||||
//NOTE TO FUTURE: this breaks if j is negative. Apparently it doesn't break if j is too large, though?
|
||||
memset(&dcbits[x+j*WindowWidth],color,width);
|
||||
};
|
||||
|
||||
void DrawWindow(WINDOW *win)
|
||||
{
|
||||
int i,j,drawx,drawy;
|
||||
char tmp;
|
||||
for (j=0; j<win->height; j++){
|
||||
if (win->line[j].touched)
|
||||
for (i=0; i<win->width; i++){
|
||||
win->line[j].touched=false;
|
||||
drawx=((win->x+i)*fontwidth);
|
||||
drawy=((win->y+j)*fontheight);//-j;
|
||||
if (((drawx+fontwidth)<=WindowWidth) && ((drawy+fontheight)<=WindowHeight)){
|
||||
tmp = win->line[j].chars[i];
|
||||
int FG = win->line[j].FG[i];
|
||||
int BG = win->line[j].BG[i];
|
||||
FillRectDIB(drawx,drawy,fontwidth,fontheight,BG);
|
||||
|
||||
if ( tmp > 0){
|
||||
//if (tmp==95){//If your font doesnt draw underscores..uncomment
|
||||
// HorzLineDIB(drawx,drawy+fontheight-2,drawx+fontwidth,1,FG);
|
||||
// } else { // all the wa to here
|
||||
int color = RGB(windowsPalette[FG].rgbRed,windowsPalette[FG].rgbGreen,windowsPalette[FG].rgbBlue);
|
||||
SetTextColor(backbuffer,color);
|
||||
ExtTextOut(backbuffer,drawx,drawy,0,NULL,&tmp,1,NULL);
|
||||
// } //and this line too.
|
||||
} else if ( tmp < 0 ) {
|
||||
switch (tmp) {
|
||||
case -60://box bottom/top side (horizontal line)
|
||||
HorzLineDIB(drawx,drawy+halfheight,drawx+fontwidth,1,FG);
|
||||
break;
|
||||
case -77://box left/right side (vertical line)
|
||||
VertLineDIB(drawx+halfwidth,drawy,drawy+fontheight,2,FG);
|
||||
break;
|
||||
case -38://box top left
|
||||
HorzLineDIB(drawx+halfwidth,drawy+halfheight,drawx+fontwidth,1,FG);
|
||||
VertLineDIB(drawx+halfwidth,drawy+halfheight,drawy+fontheight,2,FG);
|
||||
break;
|
||||
case -65://box top right
|
||||
HorzLineDIB(drawx,drawy+halfheight,drawx+halfwidth,1,FG);
|
||||
VertLineDIB(drawx+halfwidth,drawy+halfheight,drawy+fontheight,2,FG);
|
||||
break;
|
||||
case -39://box bottom right
|
||||
HorzLineDIB(drawx,drawy+halfheight,drawx+halfwidth,1,FG);
|
||||
VertLineDIB(drawx+halfwidth,drawy,drawy+halfheight+1,2,FG);
|
||||
break;
|
||||
case -64://box bottom left
|
||||
HorzLineDIB(drawx+halfwidth,drawy+halfheight,drawx+fontwidth,1,FG);
|
||||
VertLineDIB(drawx+halfwidth,drawy,drawy+halfheight+1,2,FG);
|
||||
break;
|
||||
case -63://box bottom north T (left, right, up)
|
||||
HorzLineDIB(drawx,drawy+halfheight,drawx+fontwidth,1,FG);
|
||||
VertLineDIB(drawx+halfwidth,drawy,drawy+halfheight,2,FG);
|
||||
break;
|
||||
case -61://box bottom east T (up, right, down)
|
||||
VertLineDIB(drawx+halfwidth,drawy,drawy+fontheight,2,FG);
|
||||
HorzLineDIB(drawx+halfwidth,drawy+halfheight,drawx+fontwidth,1,FG);
|
||||
break;
|
||||
case -62://box bottom south T (left, right, down)
|
||||
HorzLineDIB(drawx,drawy+halfheight,drawx+fontwidth,1,FG);
|
||||
VertLineDIB(drawx+halfwidth,drawy+halfheight,drawy+fontheight,2,FG);
|
||||
break;
|
||||
case -59://box X (left down up right)
|
||||
HorzLineDIB(drawx,drawy+halfheight,drawx+fontwidth,1,FG);
|
||||
VertLineDIB(drawx+halfwidth,drawy,drawy+fontheight,2,FG);
|
||||
break;
|
||||
case -76://box bottom east T (left, down, up)
|
||||
VertLineDIB(drawx+halfwidth,drawy,drawy+fontheight,2,FG);
|
||||
HorzLineDIB(drawx,drawy+halfheight,drawx+halfwidth,1,FG);
|
||||
break;
|
||||
default:
|
||||
// SetTextColor(DC,_windows[w].line[j].chars[i].color.FG);
|
||||
// TextOut(DC,drawx,drawy,&tmp,1);
|
||||
break;
|
||||
}
|
||||
};//switch (tmp)
|
||||
}//(tmp < 0)
|
||||
};//for (i=0;i<_windows[w].width;i++)
|
||||
};// for (j=0;j<_windows[w].height;j++)
|
||||
win->draw=false; //We drew the window, mark it as so
|
||||
};
|
||||
|
||||
//Check for any window messages (keypress, paint, mousemove, etc)
|
||||
void CheckMessages()
|
||||
{
|
||||
MSG msg;
|
||||
while (PeekMessage(&msg, 0 , 0, 0, PM_REMOVE)){
|
||||
TranslateMessage(&msg);
|
||||
DispatchMessage(&msg);
|
||||
}
|
||||
};
|
||||
|
||||
//***********************************
|
||||
//Psuedo-Curses Functions *
|
||||
//***********************************
|
||||
|
||||
//Basic Init, create the font, backbuffer, etc
|
||||
WINDOW *initscr(void)
|
||||
{
|
||||
// _windows = new WINDOW[20]; //initialize all of our variables
|
||||
BITMAPINFO bmi;
|
||||
lastchar=-1;
|
||||
inputdelay=-1;
|
||||
std::string typeface;
|
||||
char * typeface_c;
|
||||
std::ifstream fin;
|
||||
fin.open("data\\FONTDATA");
|
||||
if (!fin.is_open()){
|
||||
MessageBox(WindowHandle, "Failed to open FONTDATA, loading defaults.",
|
||||
NULL, NULL);
|
||||
fontheight=16;
|
||||
fontwidth=8;
|
||||
} else {
|
||||
getline(fin, typeface);
|
||||
typeface_c= new char [typeface.size()+1];
|
||||
strcpy (typeface_c, typeface.c_str());
|
||||
fin >> fontwidth;
|
||||
fin >> fontheight;
|
||||
if ((fontwidth <= 4) || (fontheight <=4)){
|
||||
MessageBox(WindowHandle, "Invalid font size specified!",
|
||||
NULL, NULL);
|
||||
fontheight=16;
|
||||
fontwidth=8;
|
||||
}
|
||||
}
|
||||
halfwidth=fontwidth / 2;
|
||||
halfheight=fontheight / 2;
|
||||
WindowWidth= (55 + (OPTIONS[OPT_VIEWPORT_X] * 2 + 1)) * fontwidth;
|
||||
WindowHeight= (OPTIONS[OPT_VIEWPORT_Y] * 2 + 1) *fontheight;
|
||||
WindowX=(GetSystemMetrics(SM_CXSCREEN) / 2)-WindowWidth/2; //center this
|
||||
WindowY=(GetSystemMetrics(SM_CYSCREEN) / 2)-WindowHeight/2; //sucker
|
||||
WinCreate(); //Create the actual window, register it, etc
|
||||
CheckMessages(); //Let the message queue handle setting up the window
|
||||
WindowDC = GetDC(WindowHandle);
|
||||
backbuffer = CreateCompatibleDC(WindowDC);
|
||||
ZeroMemory(&bmi, sizeof(BITMAPINFO));
|
||||
bmi.bmiHeader.biSize = sizeof(BITMAPINFOHEADER);
|
||||
bmi.bmiHeader.biWidth = WindowWidth;
|
||||
bmi.bmiHeader.biHeight = -WindowHeight;
|
||||
bmi.bmiHeader.biPlanes = 1;
|
||||
bmi.bmiHeader.biBitCount=8;
|
||||
bmi.bmiHeader.biCompression = BI_RGB; //store it in uncompressed bytes
|
||||
bmi.bmiHeader.biSizeImage = WindowWidth * WindowHeight * 1;
|
||||
bmi.bmiHeader.biClrUsed=16; //the number of colors in our palette
|
||||
bmi.bmiHeader.biClrImportant=16; //the number of colors in our palette
|
||||
backbit = CreateDIBSection(0, &bmi, DIB_RGB_COLORS, (void**)&dcbits, NULL, 0);
|
||||
DeleteObject(SelectObject(backbuffer, backbit));//load the buffer into DC
|
||||
|
||||
int nResults = AddFontResourceExA("data\\termfont",FR_PRIVATE,NULL);
|
||||
if (nResults>0){
|
||||
font = CreateFont(fontheight, fontwidth, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
|
||||
ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
|
||||
PROOF_QUALITY, FF_MODERN, typeface_c); //Create our font
|
||||
|
||||
} else {
|
||||
MessageBox(WindowHandle, "Failed to load default font, using FixedSys.",
|
||||
NULL, NULL);
|
||||
font = CreateFont(fontheight, fontwidth, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
|
||||
ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
|
||||
PROOF_QUALITY, FF_MODERN, "FixedSys"); //Create our font
|
||||
}
|
||||
//FixedSys will be user-changable at some point in time??
|
||||
SetBkMode(backbuffer, TRANSPARENT);//Transparent font backgrounds
|
||||
SelectObject(backbuffer, font);//Load our font into the DC
|
||||
// WindowCount=0;
|
||||
|
||||
delete typeface_c;
|
||||
mainwin = newwin((OPTIONS[OPT_VIEWPORT_Y] * 2 + 1),(55 + (OPTIONS[OPT_VIEWPORT_Y] * 2 + 1)),0,0);
|
||||
return mainwin; //create the 'stdscr' window and return its ref
|
||||
};
|
||||
|
||||
WINDOW *newwin(int nlines, int ncols, int begin_y, int begin_x)
|
||||
{
|
||||
if (begin_y < 0 || begin_x < 0) {
|
||||
return NULL; //it's the caller's problem now (since they have logging functions declared)
|
||||
}
|
||||
|
||||
int i,j;
|
||||
WINDOW *newwindow = new WINDOW;
|
||||
//newwindow=&_windows[WindowCount];
|
||||
newwindow->x=begin_x;
|
||||
newwindow->y=begin_y;
|
||||
newwindow->width=ncols;
|
||||
newwindow->height=nlines;
|
||||
newwindow->inuse=true;
|
||||
newwindow->draw=false;
|
||||
newwindow->BG=0;
|
||||
newwindow->FG=8;
|
||||
newwindow->cursorx=0;
|
||||
newwindow->cursory=0;
|
||||
newwindow->line = new curseline[nlines];
|
||||
|
||||
for (j=0; j<nlines; j++)
|
||||
{
|
||||
newwindow->line[j].chars= new char[ncols];
|
||||
newwindow->line[j].FG= new char[ncols];
|
||||
newwindow->line[j].BG= new char[ncols];
|
||||
newwindow->line[j].touched=true;//Touch them all !?
|
||||
for (i=0; i<ncols; i++)
|
||||
{
|
||||
newwindow->line[j].chars[i]=0;
|
||||
newwindow->line[j].FG[i]=0;
|
||||
newwindow->line[j].BG[i]=0;
|
||||
}
|
||||
}
|
||||
//WindowCount++;
|
||||
return newwindow;
|
||||
};
|
||||
|
||||
|
||||
//Deletes the window and marks it as free. Clears it just in case.
|
||||
int delwin(WINDOW *win)
|
||||
{
|
||||
int j;
|
||||
win->inuse=false;
|
||||
win->draw=false;
|
||||
for (j=0; j<win->height; j++){
|
||||
delete win->line[j].chars;
|
||||
delete win->line[j].FG;
|
||||
delete win->line[j].BG;
|
||||
}
|
||||
delete win->line;
|
||||
delete win;
|
||||
return 1;
|
||||
};
|
||||
|
||||
inline int newline(WINDOW *win){
|
||||
if (win->cursory < win->height - 1){
|
||||
win->cursory++;
|
||||
win->cursorx=0;
|
||||
return 1;
|
||||
}
|
||||
return 0;
|
||||
};
|
||||
|
||||
inline void addedchar(WINDOW *win){
|
||||
win->cursorx++;
|
||||
win->line[win->cursory].touched=true;
|
||||
if (win->cursorx > win->width)
|
||||
newline(win);
|
||||
};
|
||||
|
||||
|
||||
//Borders the window with fancy lines!
|
||||
int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)
|
||||
{
|
||||
|
||||
int i, j;
|
||||
int oldx=win->cursorx;//methods below move the cursor, save the value!
|
||||
int oldy=win->cursory;//methods below move the cursor, save the value!
|
||||
if (ls>0)
|
||||
for (j=1; j<win->height-1; j++)
|
||||
mvwaddch(win, j, 0, 179);
|
||||
if (rs>0)
|
||||
for (j=1; j<win->height-1; j++)
|
||||
mvwaddch(win, j, win->width-1, 179);
|
||||
if (ts>0)
|
||||
for (i=1; i<win->width-1; i++)
|
||||
mvwaddch(win, 0, i, 196);
|
||||
if (bs>0)
|
||||
for (i=1; i<win->width-1; i++)
|
||||
mvwaddch(win, win->height-1, i, 196);
|
||||
if (tl>0)
|
||||
mvwaddch(win,0, 0, 218);
|
||||
if (tr>0)
|
||||
mvwaddch(win,0, win->width-1, 191);
|
||||
if (bl>0)
|
||||
mvwaddch(win,win->height-1, 0, 192);
|
||||
if (br>0)
|
||||
mvwaddch(win,win->height-1, win->width-1, 217);
|
||||
//_windows[w].cursorx=oldx;//methods above move the cursor, put it back
|
||||
//_windows[w].cursory=oldy;//methods above move the cursor, put it back
|
||||
wmove(win,oldy,oldx);
|
||||
return 1;
|
||||
};
|
||||
|
||||
//Refreshes a window, causing it to redraw on top.
|
||||
int wrefresh(WINDOW *win)
|
||||
{
|
||||
if (win==0) win=mainwin;
|
||||
if (win->draw)
|
||||
DrawWindow(win);
|
||||
return 1;
|
||||
};
|
||||
|
||||
//Refreshes window 0 (stdscr), causing it to redraw on top.
|
||||
int refresh(void)
|
||||
{
|
||||
return wrefresh(mainwin);
|
||||
};
|
||||
|
||||
//Not terribly sure how this function is suppose to work,
|
||||
//but jday helped to figure most of it out
|
||||
int getch(void)
|
||||
{
|
||||
refresh();
|
||||
InvalidateRect(WindowHandle,NULL,true);
|
||||
lastchar=ERR;//ERR=-1
|
||||
if (inputdelay < 0)
|
||||
{
|
||||
do
|
||||
{
|
||||
CheckMessages();
|
||||
if (lastchar!=ERR) break;
|
||||
MsgWaitForMultipleObjects(0, NULL, FALSE, 50, QS_ALLEVENTS);//low cpu wait!
|
||||
}
|
||||
while (lastchar==ERR);
|
||||
}
|
||||
else if (inputdelay > 0)
|
||||
{
|
||||
unsigned long starttime=GetTickCount();
|
||||
unsigned long endtime;
|
||||
do
|
||||
{
|
||||
CheckMessages(); //MsgWaitForMultipleObjects won't work very good here
|
||||
endtime=GetTickCount(); //it responds to mouse movement, and WM_PAINT, not good
|
||||
if (lastchar!=ERR) break;
|
||||
Sleep(2);
|
||||
}
|
||||
while (endtime<(starttime+inputdelay));
|
||||
}
|
||||
else
|
||||
{
|
||||
CheckMessages();
|
||||
};
|
||||
Sleep(25);
|
||||
return lastchar;
|
||||
};
|
||||
|
||||
//The core printing function, prints characters to the array, and sets colors
|
||||
inline int printstring(WINDOW *win, char *fmt)
|
||||
{
|
||||
int size = strlen(fmt);
|
||||
int j;
|
||||
for (j=0; j<size; j++){
|
||||
if (!(fmt[j]==10)){//check that this isnt a newline char
|
||||
if (win->cursorx <= win->width - 1 && win->cursory <= win->height - 1) {
|
||||
win->line[win->cursory].chars[win->cursorx]=fmt[j];
|
||||
win->line[win->cursory].FG[win->cursorx]=win->FG;
|
||||
win->line[win->cursory].BG[win->cursorx]=win->BG;
|
||||
win->line[win->cursory].touched=true;
|
||||
addedchar(win);
|
||||
} else
|
||||
return 0; //if we try and write anything outside the window, abort completely
|
||||
} else // if the character is a newline, make sure to move down a line
|
||||
if (newline(win)==0){
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
win->draw=true;
|
||||
return 1;
|
||||
}
|
||||
|
||||
//Prints a formatted string to a window at the current cursor, base function
|
||||
int wprintw(WINDOW *win, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
char printbuf[2048];
|
||||
vsnprintf(printbuf, 2047, fmt, args);
|
||||
va_end(args);
|
||||
return printstring(win,printbuf);
|
||||
};
|
||||
|
||||
//Prints a formatted string to a window, moves the cursor
|
||||
int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
char printbuf[2048];
|
||||
vsnprintf(printbuf, 2047, fmt, args);
|
||||
va_end(args);
|
||||
if (wmove(win,y,x)==0) return 0;
|
||||
return printstring(win,printbuf);
|
||||
};
|
||||
|
||||
//Prints a formatted string to window 0 (stdscr), moves the cursor
|
||||
int mvprintw(int y, int x, const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
char printbuf[2048];
|
||||
vsnprintf(printbuf, 2047, fmt, args);
|
||||
va_end(args);
|
||||
if (move(y,x)==0) return 0;
|
||||
return printstring(mainwin,printbuf);
|
||||
};
|
||||
|
||||
//Prints a formatted string to window 0 (stdscr) at the current cursor
|
||||
int printw(const char *fmt, ...)
|
||||
{
|
||||
va_list args;
|
||||
va_start(args, fmt);
|
||||
char printbuf[2078];
|
||||
vsnprintf(printbuf, 2047, fmt, args);
|
||||
va_end(args);
|
||||
return printstring(mainwin,printbuf);
|
||||
};
|
||||
|
||||
//erases a window of all text and attributes
|
||||
int werase(WINDOW *win)
|
||||
{
|
||||
int j,i;
|
||||
for (j=0; j<win->height; j++)
|
||||
{
|
||||
for (i=0; i<win->width; i++) {
|
||||
win->line[j].chars[i]=0;
|
||||
win->line[j].FG[i]=0;
|
||||
win->line[j].BG[i]=0;
|
||||
}
|
||||
win->line[j].touched=true;
|
||||
}
|
||||
win->draw=true;
|
||||
wmove(win,0,0);
|
||||
wrefresh(win);
|
||||
return 1;
|
||||
};
|
||||
|
||||
//erases window 0 (stdscr) of all text and attributes
|
||||
int erase(void)
|
||||
{
|
||||
return werase(mainwin);
|
||||
};
|
||||
|
||||
//pairs up a foreground and background color and puts it into the array of pairs
|
||||
int init_pair(short pair, short f, short b)
|
||||
{
|
||||
colorpairs[pair].FG=f;
|
||||
colorpairs[pair].BG=b;
|
||||
return 1;
|
||||
};
|
||||
|
||||
//moves the cursor in a window
|
||||
int wmove(WINDOW *win, int y, int x)
|
||||
{
|
||||
if (x>=win->width)
|
||||
{return 0;}//FIXES MAP CRASH -> >= vs > only
|
||||
if (y>=win->height)
|
||||
{return 0;}// > crashes?
|
||||
if (y<0)
|
||||
{return 0;}
|
||||
if (x<0)
|
||||
{return 0;}
|
||||
win->cursorx=x;
|
||||
win->cursory=y;
|
||||
return 1;
|
||||
};
|
||||
|
||||
//Clears windows 0 (stdscr) I'm not sure if its suppose to do this?
|
||||
int clear(void)
|
||||
{
|
||||
return wclear(mainwin);
|
||||
};
|
||||
|
||||
//Ends the terminal, destroy everything
|
||||
int endwin(void)
|
||||
{
|
||||
DeleteObject(font);
|
||||
WinDestroy();
|
||||
RemoveFontResourceExA("data\\termfont",FR_PRIVATE,NULL);//Unload it
|
||||
return 1;
|
||||
};
|
||||
|
||||
//adds a character to the window
|
||||
int mvwaddch(WINDOW *win, int y, int x, const chtype ch)
|
||||
{
|
||||
if (wmove(win,y,x)==0) return 0;
|
||||
return waddch(win, ch);
|
||||
};
|
||||
|
||||
//clears a window
|
||||
int wclear(WINDOW *win)
|
||||
{
|
||||
werase(win);
|
||||
wrefresh(win);
|
||||
return 1;
|
||||
};
|
||||
|
||||
//gets the max x of a window (the width)
|
||||
int getmaxx(WINDOW *win)
|
||||
{
|
||||
if (win==0) return mainwin->width; //StdScr
|
||||
return win->width;
|
||||
};
|
||||
|
||||
//gets the max y of a window (the height)
|
||||
int getmaxy(WINDOW *win)
|
||||
{
|
||||
if (win==0) return mainwin->height; //StdScr
|
||||
return win->height;
|
||||
};
|
||||
|
||||
//gets the beginning x of a window (the x pos)
|
||||
int getbegx(WINDOW *win)
|
||||
{
|
||||
if (win==0) return mainwin->x; //StdScr
|
||||
return win->x;
|
||||
};
|
||||
|
||||
//gets the beginning y of a window (the y pos)
|
||||
int getbegy(WINDOW *win)
|
||||
{
|
||||
if (win==0) return mainwin->y; //StdScr
|
||||
return win->y;
|
||||
};
|
||||
|
||||
inline RGBQUAD BGR(int b, int g, int r)
|
||||
{
|
||||
RGBQUAD result;
|
||||
result.rgbBlue=b; //Blue
|
||||
result.rgbGreen=g; //Green
|
||||
result.rgbRed=r; //Red
|
||||
result.rgbReserved=0;//The Alpha, isnt used, so just set it to 0
|
||||
return result;
|
||||
};
|
||||
|
||||
int start_color(void)
|
||||
{
|
||||
colorpairs=new pairs[50];
|
||||
windowsPalette=new RGBQUAD[16]; //Colors in the struct are BGR!! not RGB!!
|
||||
windowsPalette[0]= BGR(0,0,0); // Black
|
||||
windowsPalette[1]= BGR(0, 0, 255); // Red
|
||||
windowsPalette[2]= BGR(0,100,0); // Green
|
||||
windowsPalette[3]= BGR(23,51,92); // Brown???
|
||||
windowsPalette[4]= BGR(150, 0, 0); // Blue
|
||||
windowsPalette[5]= BGR(98, 58, 139); // Purple
|
||||
windowsPalette[6]= BGR(180, 150, 0); // Cyan
|
||||
windowsPalette[7]= BGR(196, 196, 196);// Gray
|
||||
windowsPalette[8]= BGR(77, 77, 77);// Dark Gray
|
||||
windowsPalette[9]= BGR(150, 150, 255); // Light Red/Salmon?
|
||||
windowsPalette[10]= BGR(0, 255, 0); // Bright Green
|
||||
windowsPalette[11]= BGR(0, 255, 255); // Yellow
|
||||
windowsPalette[12]= BGR(255, 100, 100); // Light Blue
|
||||
windowsPalette[13]= BGR(240, 0, 255); // Pink
|
||||
windowsPalette[14]= BGR(255, 240, 0); // Light Cyan?
|
||||
windowsPalette[15]= BGR(255, 255, 255);
|
||||
return SetDIBColorTable(backbuffer, 0, 16, windowsPalette);
|
||||
};
|
||||
|
||||
int keypad(WINDOW *faux, bool bf)
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
|
||||
int noecho(void)
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
int cbreak(void)
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
int keypad(int faux, bool bf)
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
int curs_set(int visibility)
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
|
||||
int mvaddch(int y, int x, const chtype ch)
|
||||
{
|
||||
return mvwaddch(mainwin,y,x,ch);
|
||||
};
|
||||
|
||||
int wattron(WINDOW *win, int attrs)
|
||||
{
|
||||
bool isBold = !!(attrs & A_BOLD);
|
||||
bool isBlink = !!(attrs & A_BLINK);
|
||||
int pairNumber = (attrs & A_COLOR) >> 17;
|
||||
win->FG=colorpairs[pairNumber].FG;
|
||||
win->BG=colorpairs[pairNumber].BG;
|
||||
if (isBold) win->FG += 8;
|
||||
if (isBlink) win->BG += 8;
|
||||
return 1;
|
||||
};
|
||||
int wattroff(WINDOW *win, int attrs)
|
||||
{
|
||||
win->FG=8; //reset to white
|
||||
win->BG=0; //reset to black
|
||||
return 1;
|
||||
};
|
||||
int attron(int attrs)
|
||||
{
|
||||
return wattron(mainwin, attrs);
|
||||
};
|
||||
int attroff(int attrs)
|
||||
{
|
||||
return wattroff(mainwin,attrs);
|
||||
};
|
||||
int waddch(WINDOW *win, const chtype ch)
|
||||
{
|
||||
char charcode;
|
||||
charcode=ch;
|
||||
|
||||
switch (ch){ //LINE_NESW - X for on, O for off
|
||||
case 4194424: //#define LINE_XOXO 4194424
|
||||
charcode=179;
|
||||
break;
|
||||
case 4194417: //#define LINE_OXOX 4194417
|
||||
charcode=196;
|
||||
break;
|
||||
case 4194413: //#define LINE_XXOO 4194413
|
||||
charcode=192;
|
||||
break;
|
||||
case 4194412: //#define LINE_OXXO 4194412
|
||||
charcode=218;
|
||||
break;
|
||||
case 4194411: //#define LINE_OOXX 4194411
|
||||
charcode=191;
|
||||
break;
|
||||
case 4194410: //#define LINE_XOOX 4194410
|
||||
charcode=217;
|
||||
break;
|
||||
case 4194422: //#define LINE_XXOX 4194422
|
||||
charcode=193;
|
||||
break;
|
||||
case 4194420: //#define LINE_XXXO 4194420
|
||||
charcode=195;
|
||||
break;
|
||||
case 4194421: //#define LINE_XOXX 4194421
|
||||
charcode=180;
|
||||
break;
|
||||
case 4194423: //#define LINE_OXXX 4194423
|
||||
charcode=194;
|
||||
break;
|
||||
case 4194414: //#define LINE_XXXX 4194414
|
||||
charcode=197;
|
||||
break;
|
||||
default:
|
||||
charcode = (char)ch;
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
int curx=win->cursorx;
|
||||
int cury=win->cursory;
|
||||
|
||||
//if (win2 > -1){
|
||||
win->line[cury].chars[curx]=charcode;
|
||||
win->line[cury].FG[curx]=win->FG;
|
||||
win->line[cury].BG[curx]=win->BG;
|
||||
|
||||
|
||||
win->draw=true;
|
||||
addedchar(win);
|
||||
return 1;
|
||||
// else{
|
||||
// win2=win2+1;
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
||||
|
||||
//Move the cursor of windows 0 (stdscr)
|
||||
int move(int y, int x)
|
||||
{
|
||||
return wmove(mainwin,y,x);
|
||||
};
|
||||
|
||||
//Set the amount of time getch waits for input
|
||||
void timeout(int delay)
|
||||
{
|
||||
inputdelay=delay;
|
||||
};
|
||||
void set_escdelay(int delay) { } //PORTABILITY, DUMMY FUNCTION
|
||||
|
||||
#endif
|
||||
+156
@@ -0,0 +1,156 @@
|
||||
#ifndef __CATACURSE__
|
||||
#define __CATACURSE__
|
||||
#define _WIN32_WINNT 0x0500
|
||||
#define WIN32_LEAN_AND_MEAN
|
||||
//#define VC_EXTRALEAN
|
||||
#include <windows.h>
|
||||
#include <stdio.h>
|
||||
typedef int chtype;
|
||||
typedef unsigned short attr_t;
|
||||
typedef unsigned int u_int32_t;
|
||||
|
||||
#define __CHARTEXT 0x000000ff /* bits for 8-bit characters */ //<---------not used
|
||||
#define __NORMAL 0x00000000 /* Added characters are normal. */ //<---------not used
|
||||
#define __STANDOUT 0x00000100 /* Added characters are standout. */ //<---------not used
|
||||
#define __UNDERSCORE 0x00000200 /* Added characters are underscored. */ //<---------not used
|
||||
#define __REVERSE 0x00000400 /* Added characters are reverse //<---------not used
|
||||
video. */
|
||||
#define __BLINK 0x00000800 /* Added characters are blinking. */
|
||||
#define __DIM 0x00001000 /* Added characters are dim. */ //<---------not used
|
||||
#define __BOLD 0x00002000 /* Added characters are bold. */
|
||||
#define __BLANK 0x00004000 /* Added characters are blanked. */ //<---------not used
|
||||
#define __PROTECT 0x00008000 /* Added characters are protected. */ //<---------not used
|
||||
#define __ALTCHARSET 0x00010000 /* Added characters are ACS */ //<---------not used
|
||||
#define __COLOR 0x03fe0000 /* Color bits */
|
||||
#define __ATTRIBUTES 0x03ffff00 /* All 8-bit attribute bits */ //<---------not used
|
||||
|
||||
//a pair of colors[] indexes, foreground and background
|
||||
typedef struct
|
||||
{
|
||||
int FG;//foreground index in colors[]
|
||||
int BG;//foreground index in colors[]
|
||||
} pairs;
|
||||
|
||||
//The curse character struct, just a char, attribute, and color pair
|
||||
//typedef struct
|
||||
//{
|
||||
// char character;//the ascii actual character
|
||||
// int attrib;//attributes, mostly for A_BLINK and A_BOLD
|
||||
// pairs color;//pair of foreground/background, indexed into colors[]
|
||||
//} cursechar;
|
||||
|
||||
//Individual lines, so that we can track changed lines
|
||||
typedef struct{
|
||||
bool touched;
|
||||
char *chars;
|
||||
char *FG;
|
||||
char *BG;
|
||||
//cursechar chars [80];
|
||||
} curseline;
|
||||
//The curses window struct
|
||||
typedef struct {
|
||||
int x;//left side of window
|
||||
int y;//top side of window
|
||||
int width;//width of the curses window
|
||||
int height;//height of the curses window
|
||||
int FG;//current foreground color from attron
|
||||
int BG;//current background color from attron
|
||||
bool inuse;// Does this window actually exist?
|
||||
bool draw;//Tracks if the window text has been changed
|
||||
int cursorx;//x location of the cursor
|
||||
int cursory;//y location of the cursor
|
||||
curseline *line;
|
||||
|
||||
} WINDOW;
|
||||
|
||||
#define A_NORMAL __NORMAL
|
||||
#define A_STANDOUT __STANDOUT
|
||||
#define A_UNDERLINE __UNDERSCORE
|
||||
#define A_REVERSE __REVERSE
|
||||
#define A_BLINK __BLINK
|
||||
#define A_DIM __DIM
|
||||
#define A_BOLD __BOLD
|
||||
#define A_BLANK __BLANK
|
||||
#define A_PROTECT __PROTECT
|
||||
#define A_ALTCHARSET __ALTCHARSET
|
||||
#define A_ATTRIBUTES __ATTRIBUTES
|
||||
#define A_CHARTEXT __CHARTEXT
|
||||
#define A_COLOR __COLOR
|
||||
|
||||
#define COLOR_BLACK 0x00 //RGB{0,0,0}
|
||||
#define COLOR_RED 0x01 //RGB{196, 0, 0}
|
||||
#define COLOR_GREEN 0x02 //RGB{0,196,0}
|
||||
#define COLOR_YELLOW 0x03 //RGB{196,180,30}
|
||||
#define COLOR_BLUE 0x04 //RGB{0, 0, 196}
|
||||
#define COLOR_MAGENTA 0x05 //RGB{196, 0, 180}
|
||||
#define COLOR_CYAN 0x06 //RGB{0, 170, 200}
|
||||
#define COLOR_WHITE 0x07 //RGB{196, 196, 196}
|
||||
|
||||
#define COLOR_PAIR(n) ((((u_int32_t)n) << 17) & A_COLOR)
|
||||
//#define PAIR_NUMBER(n) ((((u_int32_t)n) & A_COLOR) >> 17)
|
||||
|
||||
#define KEY_MIN 0x101 /* minimum extended key value */ //<---------not used
|
||||
#define KEY_BREAK 0x101 /* break key */ //<---------not used
|
||||
#define KEY_DOWN 0x102 /* down arrow */
|
||||
#define KEY_UP 0x103 /* up arrow */
|
||||
#define KEY_LEFT 0x104 /* left arrow */
|
||||
#define KEY_RIGHT 0x105 /* right arrow*/
|
||||
#define KEY_HOME 0x106 /* home key */ //<---------not used
|
||||
#define KEY_BACKSPACE 0x107 /* Backspace */ //<---------not used
|
||||
|
||||
/* Curses external declarations. */
|
||||
|
||||
#define stdscr 0
|
||||
//WINDOW *stdscr; //Define this for portability, strscr will basically be window[0] anyways
|
||||
|
||||
#define getmaxyx(w, y, x) (y = getmaxy(w), x = getmaxx(w))
|
||||
|
||||
//Curses Functions
|
||||
#define ERR (-1) /* Error return. */
|
||||
#define OK (0) /* Success return. */
|
||||
WINDOW *newwin(int nlines, int ncols, int begin_y, int begin_x);
|
||||
int delwin(WINDOW *win);
|
||||
int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br);
|
||||
int wrefresh(WINDOW *win);
|
||||
int refresh(void);
|
||||
int getch(void);
|
||||
int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...);
|
||||
int mvprintw(int y, int x, const char *fmt, ...);
|
||||
int werase(WINDOW *win);
|
||||
int start_color(void);
|
||||
int init_pair(short pair, short f, short b);
|
||||
int wmove(WINDOW *win, int y, int x);
|
||||
|
||||
int clear(void);
|
||||
int erase(void);
|
||||
int endwin(void);
|
||||
int mvwaddch(WINDOW *win, int y, int x, const chtype ch);
|
||||
int wclear(WINDOW *win);
|
||||
int wprintw(WINDOW *win, const char *fmt, ...);
|
||||
WINDOW *initscr(void);
|
||||
int noecho(void);//PORTABILITY, DUMMY FUNCTION
|
||||
int cbreak(void);//PORTABILITY, DUMMY FUNCTION
|
||||
int keypad(WINDOW *faux, bool bf);//PORTABILITY, DUMMY FUNCTION
|
||||
int curs_set(int visibility);//PORTABILITY, DUMMY FUNCTION
|
||||
int mvaddch(int y, int x, const chtype ch);
|
||||
int wattron(WINDOW *win, int attrs);
|
||||
int wattroff(WINDOW *win, int attrs);
|
||||
int attron(int attrs);
|
||||
int attroff(int attrs);
|
||||
int waddch(WINDOW *win, const chtype ch);
|
||||
int printw(const char *fmt,...);
|
||||
int getmaxx(WINDOW *win);
|
||||
int getmaxy(WINDOW *win);
|
||||
int getbegx(WINDOW *win);
|
||||
int getbegy(WINDOW *win);
|
||||
int move(int y, int x);
|
||||
void timeout(int delay);//PORTABILITY, DUMMY FUNCTION
|
||||
void set_escdelay(int delay);//PORTABILITY, DUMMY FUNCTION
|
||||
|
||||
//Window Functions, Do not call these outside of catacurse.cpp
|
||||
void WinDestroy();
|
||||
bool WinCreate(bool initgl);
|
||||
void CheckMessages();
|
||||
int FindWin(WINDOW *wnd);
|
||||
LRESULT CALLBACK ProcessMessages(HWND__ *hWnd,u_int32_t Msg,WPARAM wParam, LPARAM lParam);
|
||||
#endif
|
||||
@@ -0,0 +1,41 @@
|
||||
ADDITIONS
|
||||
|
||||
1.1 Adding an item
|
||||
1) Edit itype.h. Change the enum item_id and insert a unique identifier for
|
||||
your new item type. Be sure to put it among similar items.
|
||||
2) Edit itypedef.cpp. Macros are used for all item types, and they are pretty
|
||||
self-explanatory. Be ABSOLUTELY sure that you insert the macro at the same
|
||||
point in the list as you inserted the identifier in item_id!
|
||||
3) Your item type is now valid, but won't be spawned. If you want it to be
|
||||
spawned among similar items, edit mapitemsdef.cpp. Find the appropriate
|
||||
array(s), and insert the identifier for your item (e.g. itm_aspirin). Make
|
||||
sure it comes in before the NULL at the end of the list.
|
||||
5) Some items, like tools or food, also take an iuse::function reference.
|
||||
Edit iuse.h and include the function in the class declaration; then edit
|
||||
iuse.cpp and define your function. Functions may be shared among different
|
||||
item types.
|
||||
|
||||
1.2 Adding a monster
|
||||
1) Edit mtype.h. Change the enum mon_id and insert a unique identifier for
|
||||
your new monster type. Be sure to put it among similar monsters.
|
||||
2) Edit mtypedef.cpp. A macro is used for monsters and it is pretty
|
||||
straightforward (Any of this ring a bell?). Be ABSOLUTELY sure that you
|
||||
insert the macro at the same point in the list as your inserted the
|
||||
identifier in mon_id!
|
||||
3) Your monster type is now valid, but won't be spawned. If you want it to be
|
||||
spawned among similar monsters, edit mongroupdef.cpp. Find the appropriate
|
||||
array, and insert the identifier for your monster (e.g, mon_zombie). Make
|
||||
sure it comes in before the NULL at the end of the list.
|
||||
4) If you want your monster to drop items, edit monitemsdef.cpp. Make a new
|
||||
array for your monster type with all the map item groups it may carry, and a
|
||||
chance value for each.
|
||||
5) Your monster may have a special attack, a monattack::function reference.
|
||||
Edit monattack.h and include the function in the class definition; then
|
||||
edit monattack.cpp and define your function. Functions may be shared among
|
||||
different monster types. Be aware that the function should contain a
|
||||
statement that the monster uses to decide whether or not to use the attack,
|
||||
and if they do, should reset the monster's attack timer.
|
||||
7) Just like attacks, some monsters may have a special function called when
|
||||
they die. This works the same as attacks, but the relevent files are
|
||||
mondeath.h and mondeath.cpp.
|
||||
|
||||
@@ -0,0 +1,84 @@
|
||||
ENUMS
|
||||
|
||||
This is a guide to all the enumerations in the game. If you encounter a flag
|
||||
you don't understand, grep it here. Likewise if a function accepts an m_flags
|
||||
tag, grep this document for 'm_flags'. Enums are also labeled with the file in
|
||||
which they are defined.
|
||||
|
||||
Format:
|
||||
|
||||
<File with definition> : <Name of enum>
|
||||
<List of values...>
|
||||
<Related classes, files, notes...>
|
||||
|
||||
----------------------------------------
|
||||
|
||||
bionics.h : bionic_id
|
||||
bio_null, bio_batteries, bio_metabolics, bio_solar, bio_furnace, bio_ethanol,
|
||||
bio_memory, bio_ears, bio_eye_enhancer, bio_membrane, bio_targeting, bio_gills,
|
||||
bio_purifier, bio_climate, bio_storage, bio_recycler, bio_digestion, bio_tools,
|
||||
bio_shock, bio_heat_absorb, bio_carbon, bio_armor_head, bio_armor_torso,
|
||||
bio_armor_arms, bio_armor_legs, bio_flashlight, bio_night_vision, bio_infrared,
|
||||
bio_face_mask, bio_ads, bio_ods, bio_scent_mask, bio_cloak, bio_painkiller,
|
||||
bio_nanobots, bio_heatsink, bio_resonator, bio_time_freeze, bio_teleport,
|
||||
bio_blood_anal, bio_blood_filter, bio_alarm, bio_evap, bio_lighter, bio_claws,
|
||||
bio_blaster, bio_laser, bio_emp, bio_hydraulics, bio_water_extractor,
|
||||
bio_magnet, bio_fingerhack, bio_lockpick, bio_ground_sonar, max_bio_start,
|
||||
bio_banish, bio_gate_out, bio_gate_in, bio_nightfall, bio_drilldown,
|
||||
bio_heatwave, bio_lightning, bio_tremor, bio_flashflood, max_bio_good,
|
||||
bio_dis_shock, bio_dis_acid, bio_drain, bio_noise, bio_power_weakness,
|
||||
bio_stiff, max_bio
|
||||
|
||||
bodypart.h : body_part
|
||||
color.h : col_attribute
|
||||
color.h : nc_color
|
||||
crafting.h : craft_cat
|
||||
dialogue.h : talk_topic
|
||||
enums.h : material
|
||||
event.h : event_type
|
||||
faction.h : faction_goal
|
||||
faction.h : faction_job
|
||||
faction.h : faction_value
|
||||
game.h : tut_type
|
||||
itype.h : itype_id
|
||||
itype.h : item_cat
|
||||
itype.h : ammotype
|
||||
itype.h : weapon_flag
|
||||
itype.h : container_flags
|
||||
line.h : direction
|
||||
map.cpp : astar_list
|
||||
mapdata.h : t_flag
|
||||
mapdata.h : ter_id
|
||||
mapdata.h : map_extra
|
||||
mapdata.h : field_id
|
||||
mapgen.cpp : room_type
|
||||
mapitems.h : items_location
|
||||
mission.h : mission_id
|
||||
mission.h : mission_origin
|
||||
mission.h : mission_goal
|
||||
mongroup.h : moncat_id
|
||||
monster.h : monster_effect_type
|
||||
morale.h:enum morale_type
|
||||
mtype.h : mon_id
|
||||
mtype.h : m_size
|
||||
mtype.h : m_flags
|
||||
npc.h : npc_attitude
|
||||
npc.h : npc_mission
|
||||
npc.h : npc_class
|
||||
npc.h : npc_action
|
||||
npc.h : npc_need
|
||||
npc.h : npc_flag
|
||||
omdata.h : oter_id
|
||||
omdata.h:// Order MUST match enum oter_id above!
|
||||
overmap.h:#include "enums.h"
|
||||
pldata.h : character_type
|
||||
pldata.h : dis_type
|
||||
pldata.h : add_type
|
||||
pldata.h : activity_type
|
||||
pldata.h : pl_flag
|
||||
pldata.h : hp_part
|
||||
skill.h : skill
|
||||
trap.h : trap_id
|
||||
tutorial.h : tut_lesson
|
||||
weather.h : season_type
|
||||
weather.h : weather_type
|
||||
@@ -0,0 +1,121 @@
|
||||
#0 Table of Contents
|
||||
|
||||
#0 Table of Contents
|
||||
#1 Files
|
||||
#2 special_game class
|
||||
#3 Functions
|
||||
#3.0 id()
|
||||
#3.1 init()
|
||||
#3.2 per_turn()
|
||||
#3.3 pre_action()
|
||||
#3.4 post_action()
|
||||
#3.5 game_over()
|
||||
|
||||
#1 Files
|
||||
|
||||
The main file to be concerned with is gamemode.h.
|
||||
|
||||
This is where you can insert the class definition for your game mode, and any
|
||||
enums it might use.
|
||||
|
||||
gamemode.cpp is also important, if short. It contains two functions:
|
||||
special_game_name() returns the name of each special game.
|
||||
get_special_game() returns a pointer to a special game of the proper
|
||||
type.
|
||||
|
||||
Also of note are tutorial.h (houses text snippets for tutorials), and
|
||||
tutorial.cpp and defense.cpp, which house code for tutorials and defense games
|
||||
respectively.
|
||||
|
||||
If you add a new game mode, use <mode name>.cpp for its code and <mode name>.h
|
||||
for any static data associated with it.
|
||||
|
||||
|
||||
|
||||
#2 special_game class
|
||||
|
||||
Every new game mode is a child class of special_game. It may house any private
|
||||
functions and variables it needs, as well as a constructor, but otherwise the
|
||||
only public members should be the five functions described below.
|
||||
|
||||
The game class holds a pointer to a special_game. The five functions are
|
||||
called as is appropriate, and thus are cast to the proper function in a child
|
||||
class.
|
||||
|
||||
There is an enum, special_game_id, at the top of gamemode.h. There should be
|
||||
one entry for every game mode in existance. Add one for yours.
|
||||
|
||||
|
||||
|
||||
#3 Functions
|
||||
|
||||
|
||||
#3.0 id()
|
||||
|
||||
virtual special_game_id id();
|
||||
|
||||
Returns the special_game_id assigned to your game mode.
|
||||
|
||||
|
||||
#3.1 init()
|
||||
|
||||
virtual void init(game *g);
|
||||
|
||||
This is run when your game mode begins.
|
||||
|
||||
Some ideas:
|
||||
>>Change the itype and mtype definitions--remove certain monsters from
|
||||
the game, make certain items weightless, make baseballs bats uber-powerful
|
||||
>>Change the recipes. Add new ones, reduce the time crafting takes.
|
||||
>>Start the game in a special area. Edit the world to be entirely swamp.
|
||||
|
||||
|
||||
#3.2 per_turn()
|
||||
|
||||
virtual void per_turn(game *g);
|
||||
|
||||
This is run every turn, before anything else is done, including player actions.
|
||||
|
||||
Some ideas:
|
||||
>>Reset the player's thirst, hunger, or fatigue to 0, eliminating these needs
|
||||
>>Spawn some monsters every 50 turns
|
||||
>>Make fire burn off faster
|
||||
>>Add a chance for a space debris to fall
|
||||
|
||||
|
||||
#3.3 pre_action()
|
||||
|
||||
virtual void pre_action(game *g, action_id &act);
|
||||
|
||||
This is run after a keypress, but before the action is performed. The action
|
||||
is passed by reference, so you can modify it if you like.
|
||||
|
||||
Some ideas:
|
||||
>>Rewrite the functionality of actions entirely; change the long wait menu,
|
||||
for example
|
||||
>>Disallow certain actions by setting act to ACTION_NULL
|
||||
>>Add a confirmation request to certain actions
|
||||
>>Make the availability of certain actions dependant on game state
|
||||
|
||||
|
||||
#3.4 post_action()
|
||||
|
||||
virtual void post_action(game *g, action_id act);
|
||||
|
||||
This is run after an action is performed.
|
||||
|
||||
Some ideas:
|
||||
>>Make certain actions perform faster by rebating movement points
|
||||
>>Add extra effects to certain actions
|
||||
>>Display a message upon execution of certain actions
|
||||
|
||||
|
||||
#3.5 game_over()
|
||||
|
||||
virtual void game_over(game *g);
|
||||
|
||||
This is run when the game is over (player quit or died).
|
||||
|
||||
Some ideas:
|
||||
>>Add a special achievement message, e.g. number of rounds survived
|
||||
>>Delete any special files created during play
|
||||
+258
@@ -0,0 +1,258 @@
|
||||
NOTABLE BUGS:
|
||||
|
||||
Factions cannot be saved at all, or they corrupt the master save file
|
||||
|
||||
|
||||
|
||||
LONG-TERM FEATURES: Stuff I hope to finish in a year
|
||||
|
||||
Add a "list nearby items" command, which lists visible items by distance,
|
||||
name, type, etc. Make it searchable, perhaps allow the player to define
|
||||
highlighted items which are always moved to the top of the list.
|
||||
|
||||
Missions need to have save() and load() functions.
|
||||
|
||||
Save NPCs.
|
||||
|
||||
Once NPCs are working, populate settlements with them. Make sure that the
|
||||
code for placing an NPC REALLY WORKS, so that shopkeepers stay where
|
||||
they're supposed to.
|
||||
Most settlements belong to a faction; its citizens should too (mostly?)
|
||||
|
||||
Factions already get generated and placed in the world, but they have no
|
||||
effect on it. Once NPCs are working, place faction patrols in the world.
|
||||
Factions could control radio towers, spewing propaganda or using it to
|
||||
recruit or start missions
|
||||
Factions could have projects; exterminating the zombies in a given town,
|
||||
clearing a particular forest, paving a new road!
|
||||
|
||||
Replace the Skills tab in character creation with a Class tab
|
||||
Classes come with a set of items and the skills needed to use them
|
||||
e.g. a handgun, ammo, & holster, plus handgun & firearms skills
|
||||
Cap at one class? Or make it mix-and-match, purchasable with points?
|
||||
Mix-and-match has the problem of giving the player too many
|
||||
items to store, unless we start them with a backpack
|
||||
Maybe add a trait that allows a player to take 2 classes
|
||||
Classes may also have unique effects upon the game
|
||||
Priests start with robe & collar and have bonuses when
|
||||
interacting with religious NPCs
|
||||
|
||||
|
||||
Support terminals larger than 80x25, with the extra space being utilized
|
||||
Larger terminals should not be given any real advantages over smaller
|
||||
ones; this means that the visible terrain should not be a larger
|
||||
area, but rather the extra space could be used for a larger visible
|
||||
message buffer.
|
||||
|
||||
Wrap WINDOW* in a custom class. This will eliminate the possibility of
|
||||
memory leaks from undeleted temporary windows, and will make porting to
|
||||
different display libraries (e.g. tiles) much easier.
|
||||
|
||||
Eventually a tiles port would be nice. The biggest obstacle to this is the
|
||||
actual tile graphics; once those are acquired, the only things needing a
|
||||
rewrite should be output.{h,cpp} and keypress.{h,cpp}
|
||||
Though mtypedef and itypedef might need to have item glyphs replaced or
|
||||
enchanced with a link to a image file or part of an image file. Same
|
||||
with terrain data
|
||||
|
||||
Sustained high morale generates "life points" (think of a less stupid name).
|
||||
These can be spent on a permanent stat increase, crafting a "legendary" item,
|
||||
or other otherwise unobtainable goodies. This gives the player motivation to
|
||||
maintain high morale without the artificial-feeling stat bonuses.
|
||||
High morale now generates XP points, which go into increasing your
|
||||
skills without the use of books. Maybe these XP points could be used
|
||||
for the above effects?
|
||||
|
||||
GENERAL:
|
||||
|
||||
More cultural references!
|
||||
LOST: Black cloud monster, polar bear, hatches
|
||||
Resident Evil style zombies
|
||||
Kinda done with The Thing dog
|
||||
->The whole game is already a reference to Fallout, let's admit it. So
|
||||
avoid Fallout references in general, they're too easy.
|
||||
->Ditto for Half-Life, the game is saturated with HL references
|
||||
Hellraiser: High level Void monsters could be Cenobites.
|
||||
Bladerunner: "Androids And The People Who Kill Them"
|
||||
Steam powered robots (built by post-apoc factions)
|
||||
Wild Wild West, Miyazaki, Iron Giant, Neverhood, etc. etc.
|
||||
2001: Get locked in a chamber with an insane computer which you must
|
||||
disable
|
||||
What are the other great "insane computer" movies?
|
||||
Logan's Run: A faction that kills people when they reach 30
|
||||
Six-String Samurai: Like, all the bad guys. Wind People.
|
||||
Nausicaa: Radiation-purifying mushroom forests
|
||||
They Live!: Special glasses that let you see "reality" somehow
|
||||
Hidden doors? Some people are really disguised monsters?
|
||||
Indiana Jones: Archeologist class, religious artifacts
|
||||
The Warriors: Making gangs (basically small factions) with cool themes
|
||||
and costumes would be nice.
|
||||
Dr Strangelove: Mineshafts converted into bunkers; quotes
|
||||
Ghostbusters: Weapons! Maybe ghosts.
|
||||
OTHERS: Escape From New York,
|
||||
Classes (see above under LONG-TERM) could draw from pop culture heros
|
||||
Archeologist: Indiana Jones (a la nethack)
|
||||
Road Warrior: Mad Max
|
||||
|
||||
|
||||
Pushable furniture; push dressers, fridges, etc. in front of doors
|
||||
|
||||
Configurable options:
|
||||
Colors (e.g. highlight color, currently blue)
|
||||
Also ncurses options, e.g. A_BLINK support--not all terminals
|
||||
can display bright background colors, so black-on-dark-gray
|
||||
will just show up as a blank tile. We should have an option
|
||||
to turn off bright background colors.
|
||||
Run Mode behavior / Run Mode auto-on
|
||||
Auto-drop food containers (empty soda cans, etc)
|
||||
|
||||
Fix eating/fullness; right now only overeating when Full is a risk of puking,
|
||||
which comes too quickly and feels unfair. Thirst (and small amounts of
|
||||
nutrition) never causes puking, which allows players to exploit cola by
|
||||
drinking 10 at once.
|
||||
Possible solutions:
|
||||
>Two levels; "Full" and "Overfull"; Only when Overfull is puking a risk
|
||||
>Three levels, hunger, thirst, and stomach fullness
|
||||
|
||||
Make cooking a rotten item result in a rotten item
|
||||
Or, average the original item's birthday with the current turn, to allow
|
||||
for some freshening.
|
||||
|
||||
When picking items up, highlight useful ones in particular colors
|
||||
DONE Red: Ammo for a gun you have, or vice versa
|
||||
Green: Important medical (1st aid, bandages, painkiller, etc.)
|
||||
Possibly context-dependant? Painkillers if you're in pain, etc.
|
||||
Blue: Items you can craft with
|
||||
Purple: User-defined criteria
|
||||
|
||||
Food canning. We already have tin cans, add an item "canning kit"
|
||||
Or make it a craft; canning requires boiling water + equipment
|
||||
|
||||
Highlight or color-invert monsters that're fleeing; also make indifference
|
||||
visually obvious in some way (change glyph foreground color?)
|
||||
|
||||
Audit how we're using screen space in the data window
|
||||
Maybe make a special data structure for how the data section is used and
|
||||
layed out; easier to audit, player configurable
|
||||
|
||||
Make swimming more interesting
|
||||
Items at the bottoms of rivers, only discoverable by diving underwater
|
||||
Entrances to special dungeons;
|
||||
Sewage treatment plant?
|
||||
Underwater monster lair?
|
||||
Water-dwelling monsters. Probably rare, because for unskilled swimmers
|
||||
almost any monsters would be deadly
|
||||
|
||||
Automatically drop items if our volume capacity suddenly drops (e.g. from a
|
||||
torn-open backpack)
|
||||
|
||||
Add a warning in the data screen if volume carried is over capacity
|
||||
|
||||
Allow basic movement while reloading, or make it possible to resume
|
||||
interrupted reloading
|
||||
|
||||
Make computer usage more widespread and more convincing. Possibly add a
|
||||
class for computer networks; an area on the overmap, protected by a password.
|
||||
Once you hack the password, you gain access to certain commands on computers
|
||||
found inside that area.
|
||||
Make computer functions use skills other than sk_computer. For
|
||||
instance, the computers in hospitals should use sk_firstaid
|
||||
|
||||
Desires, as in The Sims 3. These could be their own class, or a special
|
||||
type of mission; added more or less randomly, they include things like "eat an
|
||||
orange," "read a novel" and other banal actions, and reward the player with a
|
||||
larger-than-usual morale boost.
|
||||
|
||||
|
||||
|
||||
ITEMS / BIONICS:
|
||||
|
||||
Book: Bible; high morale boost if you have the Religious trait
|
||||
|
||||
Canning kit (see canning under GENERAL)
|
||||
|
||||
Fire extinguisher bionic
|
||||
Make this, and real fire extinguishers, more effective
|
||||
|
||||
Road maps, found in gas stations; using it adds some map data.
|
||||
|
||||
|
||||
|
||||
MAP:
|
||||
|
||||
Hatch (see cultural references, above)
|
||||
|
||||
Terrain tiles, such as heavy doors, which require the help of an extra NPC
|
||||
or two to open (or very high strength)
|
||||
|
||||
|
||||
CHARACTER CREATION:
|
||||
|
||||
Illiterate makes read speed show up as "N/A" on stats tab
|
||||
|
||||
Glass Jaw makes Head HP show up on stats tab, alongside Base HP
|
||||
|
||||
Show skill erosion rate on stats tab (modded by Forgetful)
|
||||
|
||||
Greater transparency for skill comprehension (at level 0, 4, 8, etc.)
|
||||
|
||||
Show food consumption rate? (Modified by Light Eater)
|
||||
Should high Strength increase this rate?
|
||||
|
||||
Save our position in both Traits lists, even when changing tabs
|
||||
|
||||
Display player::miss_penalty() in Stats tab (Under Str and/or Dex)
|
||||
Modified by Dex, by Str with heavy weapons, and the Deft trait
|
||||
Show penalty under various circumstances? Unarmed, crowbar, chainsaw etc
|
||||
|
||||
Make skill levels affect values in Stats tab?
|
||||
Bottom 3 lines could be a color legend, blue=from stat, green=from skill
|
||||
|
||||
Make Drunken Master bonus appear in Stats tab?
|
||||
|
||||
Make the Description tab more interesting? Maybe hair color, etc.
|
||||
Any effect on gameplay? Probably not.
|
||||
Make the effect of gender on gameplay transparent
|
||||
|
||||
List specific effects on gameplay mechanics in the Skills tab, comparable to
|
||||
those listed in the Stats tab.
|
||||
|
||||
|
||||
|
||||
TRAITS:
|
||||
|
||||
More Schizophrenic effects
|
||||
Make auditory hallucinations more realistic/varied
|
||||
|
||||
Balance/fix/remove Jittery
|
||||
|
||||
More obvious Wool Allergy text (remind the player that they're allergic)
|
||||
Wool Allergy prevents eating wool (with Internal Furnace bionic)
|
||||
|
||||
Make Fast Learner affect skill comprehension directly
|
||||
Rewrite description
|
||||
|
||||
Android encourages start-scumming. Maybe make it a static set, or present
|
||||
the player with a few different options?
|
||||
Make Android a class instead? (see above under LONG-TERM)
|
||||
|
||||
|
||||
|
||||
CRAFTING:
|
||||
|
||||
Expand cooking; much more morale-boosting (i.e. tasty) recipes
|
||||
|
||||
Fruit drying; remove quench and some nutrition, but won't go bad
|
||||
|
||||
|
||||
|
||||
KEYBINDINGS/INPUT:
|
||||
|
||||
Configurable bindings!
|
||||
This ties into options in general.
|
||||
|
||||
Make ctrl+movement equivalent to 'e'+movement
|
||||
|
||||
"Repeat last command" command
|
||||
|
||||
Macros--are they necessary or useful at all?
|
||||
@@ -0,0 +1,188 @@
|
||||
#include "color.h"
|
||||
|
||||
#define HILIGHT COLOR_BLUE
|
||||
void init_colors()
|
||||
{
|
||||
start_color();
|
||||
|
||||
init_pair( 1, COLOR_WHITE, COLOR_BLACK );
|
||||
init_pair( 2, COLOR_RED, COLOR_BLACK );
|
||||
init_pair( 3, COLOR_GREEN, COLOR_BLACK );
|
||||
init_pair( 4, COLOR_BLUE, COLOR_BLACK );
|
||||
init_pair( 5, COLOR_CYAN, COLOR_BLACK );
|
||||
init_pair( 6, COLOR_MAGENTA, COLOR_BLACK );
|
||||
init_pair( 7, COLOR_YELLOW, COLOR_BLACK );
|
||||
|
||||
// Inverted Colors
|
||||
init_pair( 8, COLOR_BLACK, COLOR_WHITE );
|
||||
init_pair( 9, COLOR_BLACK, COLOR_RED );
|
||||
init_pair(10, COLOR_BLACK, COLOR_GREEN );
|
||||
init_pair(11, COLOR_BLACK, COLOR_BLUE );
|
||||
init_pair(12, COLOR_BLACK, COLOR_CYAN );
|
||||
init_pair(13, COLOR_BLACK, COLOR_MAGENTA);
|
||||
init_pair(14, COLOR_BLACK, COLOR_YELLOW );
|
||||
|
||||
// Highlighted - blue background
|
||||
init_pair(15, COLOR_WHITE, HILIGHT);
|
||||
init_pair(16, COLOR_RED, HILIGHT);
|
||||
init_pair(17, COLOR_GREEN, HILIGHT);
|
||||
init_pair(18, COLOR_BLUE, HILIGHT);
|
||||
init_pair(19, COLOR_CYAN, HILIGHT);
|
||||
init_pair(20, COLOR_BLACK, HILIGHT);
|
||||
init_pair(21, COLOR_MAGENTA, HILIGHT);
|
||||
init_pair(22, COLOR_YELLOW, HILIGHT);
|
||||
|
||||
// Red background - for monsters on fire
|
||||
init_pair(23, COLOR_WHITE, COLOR_RED);
|
||||
init_pair(24, COLOR_RED, COLOR_RED);
|
||||
init_pair(25, COLOR_GREEN, COLOR_RED);
|
||||
init_pair(26, COLOR_BLUE, COLOR_RED);
|
||||
init_pair(27, COLOR_CYAN, COLOR_RED);
|
||||
init_pair(28, COLOR_MAGENTA, COLOR_RED);
|
||||
init_pair(29, COLOR_YELLOW, COLOR_RED);
|
||||
|
||||
init_pair(30, COLOR_BLACK, COLOR_BLACK );
|
||||
}
|
||||
|
||||
int color_to_int(nc_color col)
|
||||
{
|
||||
switch (col) {
|
||||
case c_black : return 0;
|
||||
case c_white : return 1;
|
||||
case c_ltgray : return 2;
|
||||
case c_dkgray : return 3;
|
||||
case c_red : return 4;
|
||||
case c_green : return 5;
|
||||
case c_blue : return 6;
|
||||
case c_cyan : return 7;
|
||||
case c_magenta: return 8;
|
||||
case c_brown : return 9;
|
||||
case c_ltred : return 10;
|
||||
case c_ltgreen: return 11;
|
||||
case c_ltblue : return 12;
|
||||
case c_ltcyan : return 13;
|
||||
case c_pink : return 14;
|
||||
case c_yellow : return 15;
|
||||
|
||||
case h_black : return 16;
|
||||
case h_white : return 17;
|
||||
case h_ltgray : return 18;
|
||||
case h_dkgray : return 19;
|
||||
case h_red : return 20;
|
||||
case h_green : return 21;
|
||||
case h_cyan : return 23;
|
||||
case h_magenta: return 24;
|
||||
case h_brown : return 25;
|
||||
case h_ltred : return 26;
|
||||
case h_ltgreen: return 27;
|
||||
case h_ltblue : return 28;
|
||||
case h_ltcyan : return 29;
|
||||
case h_pink : return 30;
|
||||
case h_yellow : return 31;
|
||||
|
||||
case i_white : return 33;
|
||||
case i_ltgray : return 34;
|
||||
case i_dkgray : return 35;
|
||||
case i_red : return 36;
|
||||
case i_green : return 37;
|
||||
case i_blue : return 38;
|
||||
case i_cyan : return 39;
|
||||
case i_magenta: return 40;
|
||||
case i_brown : return 41;
|
||||
case i_ltred : return 42;
|
||||
case i_ltgreen: return 43;
|
||||
case i_ltblue : return 44;
|
||||
case i_ltcyan : return 45;
|
||||
case i_pink : return 46;
|
||||
case i_yellow : return 47;
|
||||
|
||||
case c_white_red : return 48;
|
||||
case c_ltgray_red : return 49;
|
||||
case c_green_red : return 52;
|
||||
case c_blue_red : return 53;
|
||||
case c_cyan_red : return 54;
|
||||
case c_magenta_red: return 55;
|
||||
case c_brown_red : return 56;
|
||||
case c_ltred_red : return 57;
|
||||
case c_ltgreen_red: return 58;
|
||||
case c_ltblue_red : return 59;
|
||||
case c_ltcyan_red : return 60;
|
||||
case c_pink_red : return 61;
|
||||
case c_yellow_red : return 62;
|
||||
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
nc_color int_to_color(int key)
|
||||
{
|
||||
switch (key) {
|
||||
case 0: return c_black ;
|
||||
case 1: return c_white ;
|
||||
case 2: return c_ltgray ;
|
||||
case 3: return c_dkgray ;
|
||||
case 4: return c_red ;
|
||||
case 5: return c_green ;
|
||||
case 6: return c_blue ;
|
||||
case 7: return c_cyan ;
|
||||
case 8: return c_magenta;
|
||||
case 9: return c_brown ;
|
||||
case 10: return c_ltred ;
|
||||
case 11: return c_ltgreen;
|
||||
case 12: return c_ltblue ;
|
||||
case 13: return c_ltcyan ;
|
||||
case 14: return c_pink ;
|
||||
case 15: return c_yellow ;
|
||||
|
||||
case 16: return h_black ;
|
||||
case 17: return h_white ;
|
||||
case 18: return h_ltgray ;
|
||||
case 19: return h_dkgray ;
|
||||
case 20: return h_red ;
|
||||
case 21: return h_green ;
|
||||
case 22: return h_blue ;
|
||||
case 23: return h_cyan ;
|
||||
case 24: return h_magenta;
|
||||
case 25: return h_brown ;
|
||||
case 26: return h_ltred ;
|
||||
case 27: return h_ltgreen;
|
||||
case 28: return h_ltblue ;
|
||||
case 29: return h_ltcyan ;
|
||||
case 30: return h_pink ;
|
||||
case 31: return h_yellow ;
|
||||
|
||||
case 32: return i_black ;
|
||||
case 33: return i_white ;
|
||||
case 34: return i_ltgray ;
|
||||
case 35: return i_dkgray ;
|
||||
case 36: return i_red ;
|
||||
case 37: return i_green ;
|
||||
case 38: return i_blue ;
|
||||
case 39: return i_cyan ;
|
||||
case 40: return i_magenta;
|
||||
case 41: return i_brown ;
|
||||
case 42: return i_ltred ;
|
||||
case 43: return i_ltgreen;
|
||||
case 44: return i_ltblue ;
|
||||
case 45: return i_ltcyan ;
|
||||
case 46: return i_pink ;
|
||||
case 47: return i_yellow ;
|
||||
|
||||
case 48: return c_white_red ;
|
||||
case 49: return c_ltgray_red ;
|
||||
case 50: return c_dkgray_red ;
|
||||
case 51: return c_red_red ;
|
||||
case 52: return c_green_red ;
|
||||
case 53: return c_blue_red ;
|
||||
case 54: return c_cyan_red ;
|
||||
case 55: return c_magenta_red;
|
||||
case 56: return c_brown_red ;
|
||||
case 57: return c_ltred_red ;
|
||||
case 58: return c_ltgreen_red;
|
||||
case 59: return c_ltblue_red ;
|
||||
case 60: return c_ltcyan_red ;
|
||||
case 61: return c_pink_red ;
|
||||
case 62: return c_yellow_red ;
|
||||
}
|
||||
return c_black;
|
||||
}
|
||||
@@ -1,11 +1,13 @@
|
||||
#ifndef _COLOR_H_
|
||||
#define _COLOR_H
|
||||
|
||||
#include <ncurses.h>
|
||||
|
||||
#ifndef _COLOR_LIST_
|
||||
#define _COLOR_LIST_
|
||||
|
||||
#include "cursesdef.h"
|
||||
|
||||
void init_colors();
|
||||
|
||||
enum col_attribute {
|
||||
WA_NULL = 0,
|
||||
HI = 1,
|
||||
@@ -13,10 +15,10 @@ INV = 2
|
||||
};
|
||||
|
||||
enum nc_color {
|
||||
c_black = COLOR_PAIR(23),
|
||||
c_black = COLOR_PAIR(30),
|
||||
c_white = COLOR_PAIR(1) | A_BOLD,
|
||||
c_ltgray = COLOR_PAIR(1),
|
||||
c_dkgray = COLOR_PAIR(23) | A_BOLD,
|
||||
c_dkgray = COLOR_PAIR(30) | A_BOLD,
|
||||
c_red = COLOR_PAIR(2),
|
||||
c_green = COLOR_PAIR(3),
|
||||
c_blue = COLOR_PAIR(4),
|
||||
@@ -47,10 +49,10 @@ h_ltcyan = COLOR_PAIR(19) | A_BOLD,
|
||||
h_pink = COLOR_PAIR(21) | A_BOLD,
|
||||
h_yellow = COLOR_PAIR(22) | A_BOLD,
|
||||
|
||||
i_black = COLOR_PAIR(23),
|
||||
i_black = COLOR_PAIR(30),
|
||||
i_white = COLOR_PAIR(8) | A_BLINK,
|
||||
i_ltgray = COLOR_PAIR(8),
|
||||
i_dkgray = COLOR_PAIR(23) | A_BLINK,
|
||||
i_dkgray = COLOR_PAIR(30) | A_BLINK,
|
||||
i_red = COLOR_PAIR(9),
|
||||
i_green = COLOR_PAIR(10),
|
||||
i_blue = COLOR_PAIR(11),
|
||||
@@ -62,9 +64,29 @@ i_ltgreen = COLOR_PAIR(10) | A_BLINK,
|
||||
i_ltblue = COLOR_PAIR(11) | A_BLINK,
|
||||
i_ltcyan = COLOR_PAIR(12) | A_BLINK,
|
||||
i_pink = COLOR_PAIR(13) | A_BLINK,
|
||||
i_yellow = COLOR_PAIR(14) | A_BLINK
|
||||
i_yellow = COLOR_PAIR(14) | A_BLINK,
|
||||
|
||||
c_white_red = COLOR_PAIR(23) | A_BOLD,
|
||||
c_ltgray_red = COLOR_PAIR(23),
|
||||
c_dkgray_red = COLOR_PAIR(9),
|
||||
c_red_red = COLOR_PAIR(9),
|
||||
c_green_red = COLOR_PAIR(25),
|
||||
c_blue_red = COLOR_PAIR(26),
|
||||
c_cyan_red = COLOR_PAIR(27),
|
||||
c_magenta_red = COLOR_PAIR(28),
|
||||
c_brown_red = COLOR_PAIR(29),
|
||||
c_ltred_red = COLOR_PAIR(24) | A_BOLD,
|
||||
c_ltgreen_red = COLOR_PAIR(25) | A_BOLD,
|
||||
c_ltblue_red = COLOR_PAIR(26) | A_BOLD,
|
||||
c_ltcyan_red = COLOR_PAIR(27) | A_BOLD,
|
||||
c_pink_red = COLOR_PAIR(28) | A_BOLD,
|
||||
c_yellow_red = COLOR_PAIR(29) | A_BOLD
|
||||
|
||||
};
|
||||
|
||||
int color_to_int(nc_color col);
|
||||
nc_color int_to_color(int key);
|
||||
|
||||
void setattr(nc_color &col, col_attribute attr);
|
||||
|
||||
#endif
|
||||
|
||||
+919
@@ -0,0 +1,919 @@
|
||||
#include "computer.h"
|
||||
#include "game.h"
|
||||
#include "monster.h"
|
||||
#include "overmap.h"
|
||||
#include "output.h"
|
||||
#include <fstream>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
|
||||
computer::computer()
|
||||
{
|
||||
security = 0;
|
||||
name = DEFAULT_COMPUTER_NAME;
|
||||
w_terminal = NULL;
|
||||
mission_id = -1;
|
||||
}
|
||||
|
||||
computer::computer(std::string Name, int Security)
|
||||
{
|
||||
security = Security;
|
||||
name = Name;
|
||||
w_terminal = NULL;
|
||||
mission_id = -1;
|
||||
}
|
||||
|
||||
computer::~computer()
|
||||
{
|
||||
if (w_terminal != NULL)
|
||||
delwin(w_terminal);
|
||||
}
|
||||
|
||||
computer& computer::operator=(const computer &rhs)
|
||||
{
|
||||
security = rhs.security;
|
||||
name = rhs.name;
|
||||
mission_id = rhs.mission_id;
|
||||
options.clear();
|
||||
for (int i = 0; i < rhs.options.size(); i++)
|
||||
options.push_back(rhs.options[i]);
|
||||
failures.clear();
|
||||
for (int i = 0; i < rhs.failures.size(); i++)
|
||||
failures.push_back(rhs.failures[i]);
|
||||
w_terminal = NULL;
|
||||
return *this;
|
||||
}
|
||||
|
||||
void computer::set_security(int Security)
|
||||
{
|
||||
security = Security;
|
||||
}
|
||||
|
||||
void computer::add_option(std::string opt_name, computer_action action,
|
||||
int Security)
|
||||
{
|
||||
options.push_back(computer_option(opt_name, action, Security));
|
||||
}
|
||||
|
||||
void computer::add_failure(computer_failure failure)
|
||||
{
|
||||
failures.push_back(failure);
|
||||
}
|
||||
|
||||
void computer::shutdown_terminal()
|
||||
{
|
||||
werase(w_terminal);
|
||||
delwin(w_terminal);
|
||||
w_terminal = NULL;
|
||||
}
|
||||
|
||||
void computer::use(game *g)
|
||||
{
|
||||
if (w_terminal == NULL)
|
||||
w_terminal = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
wborder(w_terminal, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
|
||||
print_line("Logging into %s...", name.c_str());
|
||||
|
||||
if (security > 0) {
|
||||
print_error("ERROR! Access denied!");
|
||||
switch (query_ynq("Bypass security?")) {
|
||||
case 'q':
|
||||
case 'Q':
|
||||
shutdown_terminal();
|
||||
return;
|
||||
|
||||
case 'n':
|
||||
case 'N':
|
||||
print_line("Shutting down... press any key.");
|
||||
getch();
|
||||
shutdown_terminal();
|
||||
return;
|
||||
|
||||
case 'y':
|
||||
case 'Y':
|
||||
if (!hack_attempt(&(g->u))) {
|
||||
if (failures.size() == 0) {
|
||||
print_line("Maximum login attempts exceeded. Press any key...");
|
||||
getch();
|
||||
shutdown_terminal();
|
||||
return;
|
||||
}
|
||||
activate_random_failure(g);
|
||||
shutdown_terminal();
|
||||
return;
|
||||
} else { // Successful hack attempt
|
||||
security = 0;
|
||||
print_line("Login successful. Press any key...");
|
||||
getch();
|
||||
reset_terminal();
|
||||
}
|
||||
}
|
||||
} else { // No security
|
||||
print_line("Login successful. Press any key...");
|
||||
getch();
|
||||
reset_terminal();
|
||||
}
|
||||
|
||||
// Main computer loop
|
||||
|
||||
bool done = false; // Are we done using the computer?
|
||||
do {
|
||||
//reset_terminal();
|
||||
print_line("");
|
||||
print_line("%s - Root Menu", name.c_str());
|
||||
for (int i = 0; i < options.size(); i++)
|
||||
print_line("%d - %s", i + 1, options[i].name.c_str());
|
||||
print_line("Q - Quit and shut down");
|
||||
print_line("");
|
||||
|
||||
char ch;
|
||||
do
|
||||
ch = getch();
|
||||
while (ch != 'q' && ch != 'Q' && (ch < '1' || ch - '1' >= options.size()));
|
||||
if (ch == 'q' || ch == 'Q')
|
||||
done = true;
|
||||
else { // We selected an option other than quit.
|
||||
ch -= '1'; // So '1' -> 0; index in options.size()
|
||||
computer_option current = options[ch];
|
||||
if (current.security > 0) {
|
||||
print_error("Password required.");
|
||||
if (query_bool("Hack into system?")) {
|
||||
if (!hack_attempt(&(g->u), current.security)) {
|
||||
activate_random_failure(g);
|
||||
shutdown_terminal();
|
||||
return;
|
||||
} else {
|
||||
activate_function(g, current.action);
|
||||
reset_terminal();
|
||||
}
|
||||
}
|
||||
} else // No need to hack, just activate
|
||||
activate_function(g, current.action);
|
||||
} // Done processing a selected option.
|
||||
} while (!done); // Done with main terminal loop
|
||||
|
||||
shutdown_terminal(); // This should have been done by now, but just in case.
|
||||
}
|
||||
|
||||
bool computer::hack_attempt(player *p, int Security)
|
||||
{
|
||||
if (Security == -1)
|
||||
Security = security; // Set to main system security if no value passed
|
||||
|
||||
p->practice("computer", 5 + Security * 2);
|
||||
int player_roll = p->skillLevel("computer");
|
||||
if (p->int_cur < 8 && one_in(2))
|
||||
player_roll -= rng(0, 8 - p->int_cur);
|
||||
else if (p->int_cur > 8 && one_in(3))
|
||||
player_roll += rng(0, p->int_cur - 8);
|
||||
|
||||
return (dice(player_roll, 6) >= dice(Security, 6));
|
||||
}
|
||||
|
||||
std::string computer::save_data()
|
||||
{
|
||||
std::stringstream data;
|
||||
std::string savename = name; // Replace " " with "_"
|
||||
size_t found = savename.find(" ");
|
||||
while (found != std::string::npos) {
|
||||
savename.replace(found, 1, "_");
|
||||
found = savename.find(" ");
|
||||
}
|
||||
data << savename << " " << security << " " << mission_id << " " <<
|
||||
options.size() << " ";
|
||||
for (int i = 0; i < options.size(); i++) {
|
||||
savename = options[i].name;
|
||||
found = savename.find(" ");
|
||||
while (found != std::string::npos) {
|
||||
savename.replace(found, 1, "_");
|
||||
found = savename.find(" ");
|
||||
}
|
||||
data << savename << " " << int(options[i].action) << " " <<
|
||||
options[i].security << " ";
|
||||
}
|
||||
data << failures.size() << " ";
|
||||
for (int i = 0; i < failures.size(); i++)
|
||||
data << int(failures[i]) << " ";
|
||||
|
||||
return data.str();
|
||||
}
|
||||
|
||||
void computer::load_data(std::string data)
|
||||
{
|
||||
options.clear();
|
||||
failures.clear();
|
||||
std::stringstream dump;
|
||||
std::string buffer;
|
||||
dump << data;
|
||||
// Pull in name and security
|
||||
dump >> name >> security >> mission_id;
|
||||
size_t found = name.find("_");
|
||||
while (found != std::string::npos) {
|
||||
name.replace(found, 1, " ");
|
||||
found = name.find("_");
|
||||
}
|
||||
// Pull in options
|
||||
int optsize;
|
||||
dump >> optsize;
|
||||
for (int n = 0; n < optsize; n++) {
|
||||
std::string tmpname;
|
||||
int tmpaction, tmpsec;
|
||||
dump >> tmpname >> tmpaction >> tmpsec;
|
||||
size_t found = tmpname.find("_");
|
||||
while (found != std::string::npos) {
|
||||
tmpname.replace(found, 1, " ");
|
||||
found = tmpname.find("_");
|
||||
}
|
||||
add_option(tmpname, computer_action(tmpaction), tmpsec);
|
||||
}
|
||||
// Pull in failures
|
||||
int failsize, tmpfail;
|
||||
dump >> failsize;
|
||||
for (int n = 0; n < failsize; n++) {
|
||||
dump >> tmpfail;
|
||||
failures.push_back(computer_failure(tmpfail));
|
||||
}
|
||||
}
|
||||
|
||||
void computer::activate_function(game *g, computer_action action)
|
||||
{
|
||||
switch (action) {
|
||||
|
||||
case COMPACT_NULL:
|
||||
break; // Why would this be called?
|
||||
|
||||
case COMPACT_OPEN:
|
||||
g->m.translate(t_door_metal_locked, t_floor);
|
||||
print_line("Doors opened.");
|
||||
break;
|
||||
|
||||
case COMPACT_SAMPLE:
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (g->m.ter(x, y) == t_sewage_pump) {
|
||||
for (int x1 = x - 1; x1 <= x + 1; x1++) {
|
||||
for (int y1 = y - 1; y1 <= y + 1; y1++ ) {
|
||||
if (g->m.ter(x1, y1) == t_counter) {
|
||||
bool found_item = false;
|
||||
for (int i = 0; i < g->m.i_at(x1, y1).size(); i++) {
|
||||
item *it = &(g->m.i_at(x1, y1)[i]);
|
||||
if (it->is_container() && it->contents.empty()) {
|
||||
it->put_in( item(g->itypes["sewage"], g->turn) );
|
||||
found_item = true;
|
||||
}
|
||||
}
|
||||
if (!found_item) {
|
||||
item sewage(g->itypes["sewage"], g->turn);
|
||||
g->m.add_item(x1, y1, sewage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPACT_RELEASE:
|
||||
g->sound(g->u.posx, g->u.posy, 40, "An alarm sounds!");
|
||||
g->m.translate(t_reinforced_glass_h, t_floor);
|
||||
g->m.translate(t_reinforced_glass_v, t_floor);
|
||||
print_line("Containment shields opened.");
|
||||
break;
|
||||
|
||||
case COMPACT_TERMINATE:
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
int mondex = g->mon_at(x, y);
|
||||
if (mondex != -1 &&
|
||||
((g->m.ter(x, y - 1) == t_reinforced_glass_h &&
|
||||
g->m.ter(x, y + 1) == t_wall_h) ||
|
||||
(g->m.ter(x, y + 1) == t_reinforced_glass_h &&
|
||||
g->m.ter(x, y - 1) == t_wall_h)))
|
||||
g->kill_mon(mondex, true);
|
||||
}
|
||||
}
|
||||
print_line("Subjects terminated.");
|
||||
break;
|
||||
|
||||
case COMPACT_PORTAL:
|
||||
for (int i = 0; i < SEEX * MAPSIZE; i++) {
|
||||
for (int j = 0; j < SEEY * MAPSIZE; j++) {
|
||||
int numtowers = 0;
|
||||
for (int xt = i - 2; xt <= i + 2; xt++) {
|
||||
for (int yt = j - 2; yt <= j + 2; yt++) {
|
||||
if (g->m.ter(xt, yt) == t_radio_tower)
|
||||
numtowers++;
|
||||
}
|
||||
}
|
||||
if (numtowers == 4) {
|
||||
if (g->m.tr_at(i, j) == tr_portal)
|
||||
g->m.tr_at(i, j) = tr_null;
|
||||
else
|
||||
g->m.add_trap(i, j, tr_portal);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPACT_CASCADE: {
|
||||
if (!query_bool("WARNING: Resonance cascade carries severe risk! Continue?"))
|
||||
return;
|
||||
std::vector<point> cascade_points;
|
||||
for (int i = g->u.posx - 10; i <= g->u.posx + 10; i++) {
|
||||
for (int j = g->u.posy - 10; j <= g->u.posy + 10; j++) {
|
||||
if (g->m.ter(i, j) == t_radio_tower)
|
||||
cascade_points.push_back(point(i, j));
|
||||
}
|
||||
}
|
||||
if (cascade_points.size() == 0)
|
||||
g->resonance_cascade(g->u.posx, g->u.posy);
|
||||
else {
|
||||
point p = cascade_points[rng(0, cascade_points.size() - 1)];
|
||||
g->resonance_cascade(p.x, p.y);
|
||||
}
|
||||
} break;
|
||||
|
||||
case COMPACT_RESEARCH: {
|
||||
int lines = 0, notes = 0;
|
||||
std::string log, tmp;
|
||||
int ch;
|
||||
std::ifstream fin;
|
||||
fin.open("data/LAB_NOTES");
|
||||
if (!fin.is_open()) {
|
||||
debugmsg("Couldn't open ./data/LAB_NOTES for reading");
|
||||
return;
|
||||
}
|
||||
while (fin.good()) {
|
||||
ch = fin.get();
|
||||
if (ch == '%')
|
||||
notes++;
|
||||
}
|
||||
|
||||
while (lines < 10) {
|
||||
fin.clear();
|
||||
fin.seekg(0, std::ios::beg);
|
||||
fin.clear();
|
||||
int choice = rng(1, notes);
|
||||
while (choice > 0) {
|
||||
getline(fin, tmp);
|
||||
if (tmp.find_first_of('%') == 0)
|
||||
choice--;
|
||||
}
|
||||
getline(fin, tmp);
|
||||
do {
|
||||
lines++;
|
||||
if (lines < 15 && tmp.find_first_of('%') != 0) {
|
||||
log.append(tmp);
|
||||
log.append("\n");
|
||||
}
|
||||
} while(tmp.find_first_of('%') != 0 && getline(fin, tmp));
|
||||
}
|
||||
print_line(" %s", log.c_str());
|
||||
print_line("Press any key...");
|
||||
getch();
|
||||
} break;
|
||||
|
||||
case COMPACT_MAPS: {
|
||||
int minx = int((g->levx + int(MAPSIZE / 2)) / 2) - 40;
|
||||
int maxx = int((g->levx + int(MAPSIZE / 2)) / 2) + 40;
|
||||
int miny = int((g->levy + int(MAPSIZE / 2)) / 2) - 40;
|
||||
int maxy = int((g->levy + int(MAPSIZE / 2)) / 2) + 40;
|
||||
if (minx < 0) minx = 0;
|
||||
if (maxx >= OMAPX) maxx = OMAPX - 1;
|
||||
if (miny < 0) miny = 0;
|
||||
if (maxy >= OMAPY) maxy = OMAPY - 1;
|
||||
for (int i = minx; i <= maxx; i++) {
|
||||
for (int j = miny; j <= maxy; j++)
|
||||
g->cur_om.seen(i, j, 0) = true;
|
||||
}
|
||||
print_line("Surface map data downloaded.");
|
||||
} break;
|
||||
|
||||
case COMPACT_MAP_SEWER: {
|
||||
int minx = int((g->levx + int(MAPSIZE / 2)) / 2) - 60;
|
||||
int maxx = int((g->levx + int(MAPSIZE / 2)) / 2) + 60;
|
||||
int miny = int((g->levy + int(MAPSIZE / 2)) / 2) - 60;
|
||||
int maxy = int((g->levy + int(MAPSIZE / 2)) / 2) + 60;
|
||||
if (minx < 0) minx = 0;
|
||||
if (maxx >= OMAPX) maxx = OMAPX - 1;
|
||||
if (miny < 0) miny = 0;
|
||||
if (maxy >= OMAPY) maxy = OMAPY - 1;
|
||||
for (int i = minx; i <= maxx; i++) {
|
||||
for (int j = miny; j <= maxy; j++)
|
||||
if ((g->cur_om.ter(i, j, g->levz) >= ot_sewer_ns &&
|
||||
g->cur_om.ter(i, j, g->levz) <= ot_sewer_nesw) ||
|
||||
(g->cur_om.ter(i, j, g->levz) >= ot_sewage_treatment &&
|
||||
g->cur_om.ter(i, j, g->levz) <= ot_sewage_treatment_under))
|
||||
g->cur_om.seen(i, j, g->levz) = true;
|
||||
}
|
||||
print_line("Sewage map data downloaded.");
|
||||
} break;
|
||||
|
||||
|
||||
case COMPACT_MISS_LAUNCH: {
|
||||
// Target Acquisition.
|
||||
point target = g->cur_om.choose_point(g, 0);
|
||||
if (target.x == -1) {
|
||||
print_line("Launch canceled.");
|
||||
return;
|
||||
}
|
||||
// Figure out where the glass wall is...
|
||||
int wall_spot = 0;
|
||||
for (int i = g->u.posx; i < g->u.posx + SEEX * 2 && wall_spot == 0; i++) {
|
||||
if (g->m.ter(i, 10) == t_wall_glass_v)
|
||||
wall_spot = i;
|
||||
}
|
||||
// ...and put radioactive to the right of it
|
||||
for (int i = wall_spot + 1; i < SEEX * 2 - 1; i++) {
|
||||
for (int j = 1; j < SEEY * 2 - 1; j++) {
|
||||
if (one_in(3))
|
||||
g->m.add_field(NULL, i, j, fd_nuke_gas, 3);
|
||||
}
|
||||
}
|
||||
// For each level between here and the surface, remove the missile
|
||||
for (int level = g->levz; level < 0; level++) {
|
||||
tinymap tmpmap(&g->itypes, &g->mapitems, &g->traps);
|
||||
tmpmap.load(g, g->levx, g->levy, level, false);
|
||||
tmpmap.translate(t_missile, t_hole);
|
||||
tmpmap.save(&g->cur_om, g->turn, g->levx, level, g->levz);
|
||||
}
|
||||
for (int x = target.x - 2; x <= target.x + 2; x++) {
|
||||
for (int y = target.y - 2; y <= target.y + 2; y++)
|
||||
g->nuke(x, y);
|
||||
}
|
||||
} break;
|
||||
|
||||
case COMPACT_MISS_DISARM: // TODO: This!
|
||||
break;
|
||||
|
||||
case COMPACT_LIST_BIONICS: {
|
||||
std::vector<std::string> names;
|
||||
int more = 0;
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
for (int i = 0; i < g->m.i_at(x, y).size(); i++) {
|
||||
if (g->m.i_at(x, y)[i].is_bionic()) {
|
||||
if (names.size() < 9)
|
||||
names.push_back(g->m.i_at(x, y)[i].tname());
|
||||
else
|
||||
more++;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < names.size(); i++)
|
||||
print_line(names[i].c_str());
|
||||
if (more > 0)
|
||||
print_line("%d OTHERS FOUND...", more);
|
||||
} break;
|
||||
|
||||
case COMPACT_ELEVATOR_ON:
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (g->m.ter(x, y) == t_elevator_control_off)
|
||||
g->m.ter_set(x, y, t_elevator_control);
|
||||
}
|
||||
}
|
||||
print_line("Elevator activated.");
|
||||
break;
|
||||
|
||||
case COMPACT_AMIGARA_LOG: // TODO: This is static, move to data file?
|
||||
print_line("NEPower Mine(%d:%d) Log", g->levx, g->levy);
|
||||
print_line("\
|
||||
ENTRY 47:\n\
|
||||
Our normal mining routine has unearthed a hollow chamber. This would not be\n\
|
||||
out of the ordinary, save for the odd, perfectly vertical faultline found.\n\
|
||||
This faultline has several odd concavities in it which have the more\n\
|
||||
superstitious crew members alarmed; they seem to be of human origin.\n\
|
||||
\n\
|
||||
ENTRY 48:\n\
|
||||
The concavities are between 10 and 20 feet tall, and run the length of the\n\
|
||||
faultline. Each one is vaguely human in shape, but with the proportions of\n\
|
||||
the limbs, neck and head greatly distended, all twisted and curled in on\n\
|
||||
themselves.\n");
|
||||
if (!query_bool("Continue reading?"))
|
||||
return;
|
||||
reset_terminal();
|
||||
print_line("NEPower Mine(%d:%d) Log", g->levx, g->levy);
|
||||
print_line("\
|
||||
ENTRY 49:\n\
|
||||
We've stopped mining operations in this area, obviously, until archaeologists\n\
|
||||
have the chance to inspect the area. This is going to set our schedule back\n\
|
||||
by at least a week. This stupid artifact-preservation law has been in place\n\
|
||||
for 50 years, and hasn't even been up for termination despite the fact that\n\
|
||||
these mining operations are the backbone of our economy.\n\
|
||||
\n\
|
||||
ENTRY 52:\n\
|
||||
Still waiting on the archaeologists. We've done a little light insepction of\n\
|
||||
the faultline; our sounding equipment is insufficient to measure the depth of\n\
|
||||
the concavities. The equipment is rated at 15 miles depth, but it isn't made\n\
|
||||
for such narrow tunnels, so it's hard to say exactly how far back they go.\n");
|
||||
if (!query_bool("Continue reading?"))
|
||||
return;
|
||||
reset_terminal();
|
||||
print_line("NEPower Mine(%d:%d) Log", g->levx, g->levy);
|
||||
print_line("\
|
||||
ENTRY 54:\n\
|
||||
I noticed a couple of the guys down in the chamber with a chisel, breaking\n\
|
||||
off a piece of the sheer wall. I'm looking the other way. It's not like\n\
|
||||
the eggheads are going to notice a little piece missing. Fuck em.\n\
|
||||
\n\
|
||||
ENTRY 55:\n\
|
||||
Well, the archaeologists are down there now with a couple of the boys as\n\
|
||||
guides. They're hardly Indiana Jones types; I doubt they been below 20\n\
|
||||
feet. I hate taking guys off assignment just to babysit the scientists, but\n\
|
||||
if they get hurt we'll be shut down for god knows how long.\n\
|
||||
\n\
|
||||
ENTRY 58:\n\
|
||||
They're bringing in ANOTHER CREW? Christ, it's just some cave carvings! I\n\
|
||||
know that's sort of a big deal, but come on, these guys can't handle it?\n");
|
||||
if (!query_bool("Continue reading?"))
|
||||
return;
|
||||
reset_terminal();
|
||||
for (int i = 0; i < 10; i++)
|
||||
print_gibberish_line();
|
||||
print_line("");
|
||||
print_line("");
|
||||
print_line("");
|
||||
print_line("AMIGARA PROJECT");
|
||||
print_line("");
|
||||
print_line("");
|
||||
if (!query_bool("Continue reading?"))
|
||||
return;
|
||||
reset_terminal();
|
||||
print_line("\
|
||||
SITE %d%d%d%d%d\n\
|
||||
PERTINANT FOREMAN LOGS WILL BE PREPENDED TO NOTES",
|
||||
g->cur_om.pos().x, g->cur_om.pos().y, g->levx, g->levy, abs(g->levz));
|
||||
print_line("\n\
|
||||
MINE OPERATIONS SUSPENDED; CONTROL TRANSFERRED TO AMIGARA PROJECT UNDER\n\
|
||||
IMPERATIVE 2:07B\n\
|
||||
FAULTLINE SOUNDING HAS PLACED DEPTH AT 30.09 KM\n\
|
||||
DAMAGE TO FAULTLINE DISCOVERED; NEPOWER MINE CREW PLACED UNDER ARREST FOR\n\
|
||||
VIOLATION OF REGULATION 87.08 AND TRANSFERRED TO LAB 89-C FOR USE AS\n\
|
||||
SUBJECTS\n\
|
||||
QUALITIY OF FAULTLINE NOT COMPROMISED\n\
|
||||
INITIATING STANDARD TREMOR TEST...");
|
||||
print_gibberish_line();
|
||||
print_gibberish_line();
|
||||
print_line("");
|
||||
print_error("FILE CORRUPTED, PRESS ANY KEY...");
|
||||
getch();
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_AMIGARA_START:
|
||||
g->add_event(EVENT_AMIGARA, int(g->turn) + 10, 0, 0, 0);
|
||||
if (!g->u.has_artifact_with(AEP_PSYSHIELD))
|
||||
g->u.add_disease(DI_AMIGARA, 20, g);
|
||||
break;
|
||||
|
||||
case COMPACT_STEMCELL_TREATMENT:
|
||||
g->u.add_disease(DI_STEMCELL_TREATMENT, 120, g);
|
||||
print_line("The machine injects your eyeball with the solution \n\
|
||||
of pureed bone & LSD.");
|
||||
g->u.pain += rng(40,90);
|
||||
break;
|
||||
|
||||
case COMPACT_DOWNLOAD_SOFTWARE:
|
||||
if (!g->u.has_amount("usb_drive", 1))
|
||||
print_error("USB drive required!");
|
||||
else {
|
||||
mission *miss = g->find_mission(mission_id);
|
||||
if (miss == NULL) {
|
||||
debugmsg("Computer couldn't find its mission!");
|
||||
return;
|
||||
}
|
||||
item software(g->itypes[miss->item_id], 0);
|
||||
software.mission_id = mission_id;
|
||||
int index = g->u.pick_usb();
|
||||
g->u.inv[index].contents.clear();
|
||||
g->u.inv[index].put_in(software);
|
||||
print_line("Software downloaded.");
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPACT_BLOOD_ANAL:
|
||||
for (int x = g->u.posx - 2; x <= g->u.posx + 2; x++) {
|
||||
for (int y = g->u.posy - 2; y <= g->u.posy + 2; y++) {
|
||||
if (g->m.ter(x, y) == t_centrifuge) {
|
||||
if (g->m.i_at(x, y).empty())
|
||||
print_error("ERROR: Please place sample in centrifuge.");
|
||||
else if (g->m.i_at(x, y).size() > 1)
|
||||
print_error("ERROR: Please remove all but one sample from centrifuge.");
|
||||
else if (g->m.i_at(x, y)[0].type->id != "vacutainer")
|
||||
print_error("ERROR: Please use vacutainer-contained samples.");
|
||||
else if (g->m.i_at(x, y)[0].contents.empty())
|
||||
print_error("ERROR: Vacutainer empty.");
|
||||
else if (g->m.i_at(x, y)[0].contents[0].type->id != "blood")
|
||||
print_error("ERROR: Please only use blood samples.");
|
||||
else { // Success!
|
||||
item *blood = &(g->m.i_at(x, y)[0].contents[0]);
|
||||
if (blood->corpse == NULL || blood->corpse->id == mon_null)
|
||||
print_line("Result: Human blood, no pathogens found.");
|
||||
else if (blood->corpse->sym == 'Z') {
|
||||
print_line("Result: Human blood. Unknown pathogen found.");
|
||||
print_line("Pathogen bonded to erythrocytes and leukocytes.");
|
||||
if (query_bool("Download data?")) {
|
||||
if (!g->u.has_amount("usb_drive", 1))
|
||||
print_error("USB drive required!");
|
||||
else {
|
||||
item software(g->itypes["software_blood_data"], 0);
|
||||
int index = g->u.pick_usb();
|
||||
g->u.inv[index].contents.clear();
|
||||
g->u.inv[index].put_in(software);
|
||||
print_line("Software downloaded.");
|
||||
}
|
||||
}
|
||||
} else
|
||||
print_line("Result: Unknown blood type. Test nonconclusive.");
|
||||
print_line("Press any key...");
|
||||
getch();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPACT_EMERG_MESS:
|
||||
print_line("\
|
||||
GREETINGS CITIZEN. A BIOLOGICAL ATTACK HAS TAKEN PLACE AND A STATE OF \n\
|
||||
EMERGENCY HAS BEEN DECLARED. EMERGENCY PERSONNEL WILL BE AIDING YOU \n\
|
||||
SHORTLY. TO ENSURE YOUR SAFETY PLEASE FOLLOW THE BELOW STEPS. \n\
|
||||
\n\
|
||||
1. DO NOT PANIC. \n\
|
||||
2. REMAIN INSIDE THE BUILDING. \n\
|
||||
3. SEEK SHELTER IN THE BASEMENT. \n\
|
||||
4. USE PROVIDED GAS MASKS. \n\
|
||||
5. AWAIT FURTHER INSTRUCTIONS \n\
|
||||
\n\
|
||||
Press any key to continue...");
|
||||
break;
|
||||
|
||||
} // switch (action)
|
||||
}
|
||||
|
||||
void computer::activate_random_failure(game *g)
|
||||
{
|
||||
computer_failure fail = (failures.empty() ? COMPFAIL_SHUTDOWN :
|
||||
failures[rng(0, failures.size() - 1)]);
|
||||
activate_failure(g, fail);
|
||||
}
|
||||
|
||||
void computer::activate_failure(game *g, computer_failure fail)
|
||||
{
|
||||
switch (fail) {
|
||||
|
||||
case COMPFAIL_NULL:
|
||||
break; // Do nothing. Why was this even called >:|
|
||||
|
||||
case COMPFAIL_SHUTDOWN:
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (g->m.has_flag(console, x, y))
|
||||
g->m.ter_set(x, y, t_console_broken);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPFAIL_ALARM:
|
||||
g->sound(g->u.posx, g->u.posy, 60, "An alarm sounds!");
|
||||
if (g->levz > 0 && !g->event_queued(EVENT_WANTED))
|
||||
g->add_event(EVENT_WANTED, int(g->turn) + 300, 0, g->levx, g->levy);
|
||||
break;
|
||||
|
||||
case COMPFAIL_MANHACKS: {
|
||||
int num_robots = rng(4, 8);
|
||||
for (int i = 0; i < num_robots; i++) {
|
||||
int mx, my, tries = 0;
|
||||
do {
|
||||
mx = rng(g->u.posx - 3, g->u.posx + 3);
|
||||
my = rng(g->u.posy - 3, g->u.posy + 3);
|
||||
tries++;
|
||||
} while (!g->is_empty(mx, my) && tries < 10);
|
||||
if (tries != 10) {
|
||||
g->add_msg("Manhacks drop from compartments in the ceiling.");
|
||||
monster robot(g->mtypes[mon_manhack]);
|
||||
robot.spawn(mx, my);
|
||||
g->z.push_back(robot);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
case COMPFAIL_SECUBOTS: {
|
||||
int num_robots = 1;
|
||||
for (int i = 0; i < num_robots; i++) {
|
||||
int mx, my, tries = 0;
|
||||
do {
|
||||
mx = rng(g->u.posx - 3, g->u.posx + 3);
|
||||
my = rng(g->u.posy - 3, g->u.posy + 3);
|
||||
tries++;
|
||||
} while (!g->is_empty(mx, my) && tries < 10);
|
||||
if (tries != 10) {
|
||||
g->add_msg("Secubots emerge from compartments in the floor.");
|
||||
monster robot(g->mtypes[mon_secubot]);
|
||||
robot.spawn(mx, my);
|
||||
g->z.push_back(robot);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
case COMPFAIL_DAMAGE:
|
||||
g->add_msg("The console electrocutes you!");
|
||||
g->u.hurtall(rng(1, 10));
|
||||
break;
|
||||
|
||||
case COMPFAIL_PUMP_EXPLODE:
|
||||
g->add_msg("The pump explodes!");
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (g->m.ter(x, y) == t_sewage_pump) {
|
||||
g->m.ter_set(x, y, t_rubble);
|
||||
g->explosion(x, y, 10, 0, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPFAIL_PUMP_LEAK:
|
||||
g->add_msg("Sewage leaks!");
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (g->m.ter(x, y) == t_sewage_pump) {
|
||||
point p(x, y);
|
||||
int leak_size = rng(4, 10);
|
||||
for (int i = 0; i < leak_size; i++) {
|
||||
std::vector<point> next_move;
|
||||
if (g->m.move_cost(p.x, p.y - 1) > 0)
|
||||
next_move.push_back( point(p.x, p.y - 1) );
|
||||
if (g->m.move_cost(p.x + 1, p.y) > 0)
|
||||
next_move.push_back( point(p.x + 1, p.y) );
|
||||
if (g->m.move_cost(p.x, p.y + 1) > 0)
|
||||
next_move.push_back( point(p.x, p.y + 1) );
|
||||
if (g->m.move_cost(p.x - 1, p.y) > 0)
|
||||
next_move.push_back( point(p.x - 1, p.y) );
|
||||
|
||||
if (next_move.empty())
|
||||
i = leak_size;
|
||||
else {
|
||||
p = next_move[rng(0, next_move.size() - 1)];
|
||||
g->m.ter_set(p.x, p.y, t_sewage);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPFAIL_AMIGARA:
|
||||
g->add_event(EVENT_AMIGARA, int(g->turn) + 5, 0, 0, 0);
|
||||
g->u.add_disease(DI_AMIGARA, 20, g);
|
||||
g->explosion(rng(0, SEEX * MAPSIZE), rng(0, SEEY * MAPSIZE), 10, 10, false);
|
||||
g->explosion(rng(0, SEEX * MAPSIZE), rng(0, SEEY * MAPSIZE), 10, 10, false);
|
||||
break;
|
||||
|
||||
case COMPFAIL_DESTROY_BLOOD:
|
||||
print_error("ERROR: Disruptive Spin");
|
||||
for (int x = g->u.posx - 2; x <= g->u.posx + 2; x++) {
|
||||
for (int y = g->u.posy - 2; y <= g->u.posy + 2; y++) {
|
||||
if (g->m.ter(x, y) == t_centrifuge) {
|
||||
for (int i = 0; i < g->m.i_at(x, y).size(); i++) {
|
||||
if (g->m.i_at(x, y).empty())
|
||||
print_error("ERROR: Please place sample in centrifuge.");
|
||||
else if (g->m.i_at(x, y).size() > 1)
|
||||
print_error("ERROR: Please remove all but one sample from centrifuge.");
|
||||
else if (g->m.i_at(x, y)[0].type->id != "vacutainer")
|
||||
print_error("ERROR: Please use vacutainer-contained samples.");
|
||||
else if (g->m.i_at(x, y)[0].contents.empty())
|
||||
print_error("ERROR: Vacutainer empty.");
|
||||
else if (g->m.i_at(x, y)[0].contents[0].type->id != "blood")
|
||||
print_error("ERROR: Please only use blood samples.");
|
||||
else {
|
||||
print_error("ERROR: Blood sample destroyed.");
|
||||
g->m.i_at(x, y)[i].contents.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
getch();
|
||||
break;
|
||||
|
||||
}// switch (fail)
|
||||
}
|
||||
|
||||
bool computer::query_bool(const char *mes, ...)
|
||||
{
|
||||
// Translate the printf flags
|
||||
va_list ap;
|
||||
va_start(ap, mes);
|
||||
char buff[6000];
|
||||
vsprintf(buff, mes, ap);
|
||||
va_end(ap);
|
||||
// Append with (Y/N/Q)
|
||||
std::string full_line = buff;
|
||||
full_line += " (Y/N/Q)";
|
||||
// Print the resulting text
|
||||
print_line(full_line.c_str());
|
||||
char ret;
|
||||
do
|
||||
ret = getch();
|
||||
while (ret != 'y' && ret != 'Y' && ret != 'n' && ret != 'N' && ret != 'q' &&
|
||||
ret != 'Q');
|
||||
return (ret == 'y' || ret == 'Y');
|
||||
}
|
||||
|
||||
char computer::query_ynq(const char *mes, ...)
|
||||
{
|
||||
// Translate the printf flags
|
||||
va_list ap;
|
||||
va_start(ap, mes);
|
||||
char buff[6000];
|
||||
vsprintf(buff, mes, ap);
|
||||
va_end(ap);
|
||||
// Append with (Y/N/Q)
|
||||
std::string full_line = buff;
|
||||
full_line += " (Y/N/Q)";
|
||||
// Print the resulting text
|
||||
print_line(full_line.c_str());
|
||||
char ret;
|
||||
do
|
||||
ret = getch();
|
||||
while (ret != 'y' && ret != 'Y' && ret != 'n' && ret != 'N' && ret != 'q' &&
|
||||
ret != 'Q');
|
||||
return ret;
|
||||
}
|
||||
|
||||
void computer::print_line(const char *mes, ...)
|
||||
{
|
||||
// Translate the printf flags
|
||||
va_list ap;
|
||||
va_start(ap, mes);
|
||||
char buff[6000];
|
||||
vsprintf(buff, mes, ap);
|
||||
va_end(ap);
|
||||
// Replace any '\n' with "\n " to allow for the border
|
||||
std::string message = buff;
|
||||
size_t pos = 0;
|
||||
while (pos != std::string::npos) {
|
||||
pos = message.find("\n", pos);
|
||||
if (pos != std::string::npos) {
|
||||
message.replace(pos, 1, "\n ");
|
||||
pos += 2;
|
||||
}
|
||||
}
|
||||
// Print the line.
|
||||
wprintz(w_terminal, c_green, " %s\n", message.c_str());
|
||||
// Reprint the border, in case we pushed a line over it
|
||||
wborder(w_terminal, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
wrefresh(w_terminal);
|
||||
}
|
||||
|
||||
void computer::print_error(const char *mes, ...)
|
||||
{
|
||||
// Translate the printf flags
|
||||
va_list ap;
|
||||
va_start(ap, mes);
|
||||
char buff[6000];
|
||||
vsprintf(buff, mes, ap);
|
||||
va_end(ap);
|
||||
// Print the line.
|
||||
wprintz(w_terminal, c_red, " %s%s", buff, "\n");
|
||||
// Reprint the border, in case we pushed a line over it
|
||||
wborder(w_terminal, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
wrefresh(w_terminal);
|
||||
}
|
||||
|
||||
void computer::print_gibberish_line()
|
||||
{
|
||||
std::string gibberish;
|
||||
int length = rng(50, 70);
|
||||
for (int i = 0; i < length; i++) {
|
||||
switch (rng(0, 4)) {
|
||||
case 0: gibberish += '0' + rng(0, 9); break;
|
||||
case 1:
|
||||
case 2: gibberish += 'a' + rng(0, 25); break;
|
||||
case 3:
|
||||
case 4: gibberish += 'A' + rng(0, 25); break;
|
||||
}
|
||||
}
|
||||
wprintz(w_terminal, c_yellow, gibberish.c_str());
|
||||
wborder(w_terminal, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
wrefresh(w_terminal);
|
||||
}
|
||||
|
||||
void computer::reset_terminal()
|
||||
{
|
||||
werase(w_terminal);
|
||||
wborder(w_terminal, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
wmove(w_terminal, 1, 1);
|
||||
wrefresh(w_terminal);
|
||||
}
|
||||
|
||||
+116
@@ -0,0 +1,116 @@
|
||||
#ifndef _COMPUTER_H_
|
||||
#define _COMPUTER_H_
|
||||
|
||||
//#include "texthash.h"
|
||||
#include "output.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
|
||||
#define DEFAULT_COMPUTER_NAME ""
|
||||
|
||||
class game;
|
||||
class player;
|
||||
|
||||
enum computer_action
|
||||
{
|
||||
COMPACT_NULL = 0,
|
||||
COMPACT_OPEN,
|
||||
COMPACT_SAMPLE,
|
||||
COMPACT_RELEASE,
|
||||
COMPACT_TERMINATE,
|
||||
COMPACT_PORTAL,
|
||||
COMPACT_CASCADE,
|
||||
COMPACT_RESEARCH,
|
||||
COMPACT_MAPS,
|
||||
COMPACT_MAP_SEWER,
|
||||
COMPACT_MISS_LAUNCH,
|
||||
COMPACT_MISS_DISARM,
|
||||
COMPACT_LIST_BIONICS,
|
||||
COMPACT_ELEVATOR_ON,
|
||||
COMPACT_AMIGARA_LOG,
|
||||
COMPACT_AMIGARA_START,
|
||||
COMPACT_DOWNLOAD_SOFTWARE,
|
||||
COMPACT_BLOOD_ANAL,
|
||||
COMPACT_STEMCELL_TREATMENT,
|
||||
COMPACT_EMERG_MESS,
|
||||
NUM_COMPUTER_ACTIONS
|
||||
};
|
||||
|
||||
enum computer_failure
|
||||
{
|
||||
COMPFAIL_NULL = 0,
|
||||
COMPFAIL_SHUTDOWN,
|
||||
COMPFAIL_ALARM,
|
||||
COMPFAIL_MANHACKS,
|
||||
COMPFAIL_SECUBOTS,
|
||||
COMPFAIL_DAMAGE,
|
||||
COMPFAIL_PUMP_EXPLODE,
|
||||
COMPFAIL_PUMP_LEAK,
|
||||
COMPFAIL_AMIGARA,
|
||||
COMPFAIL_DESTROY_BLOOD,
|
||||
NUM_COMPUTER_FAILURES
|
||||
};
|
||||
|
||||
struct computer_option
|
||||
{
|
||||
std::string name;
|
||||
computer_action action;
|
||||
int security;
|
||||
|
||||
computer_option() { name = "Unknown", action = COMPACT_NULL, security = 0; };
|
||||
computer_option(std::string N, computer_action A, int S) :
|
||||
name (N), action (A), security (S) {};
|
||||
};
|
||||
|
||||
class computer
|
||||
{
|
||||
public:
|
||||
computer();
|
||||
computer(std::string Name, int Security);
|
||||
~computer();
|
||||
|
||||
computer & operator=(const computer &rhs);
|
||||
// Initialization
|
||||
void set_security(int Security);
|
||||
void add_option(std::string opt_name, computer_action action, int Security);
|
||||
void add_failure(computer_failure failure);
|
||||
// Basic usage
|
||||
void shutdown_terminal(); // Shutdown (free w_terminal, etc)
|
||||
void use(game *g);
|
||||
bool hack_attempt(player *p, int Security = -1);// -1 defaults to main security
|
||||
// Save/load
|
||||
std::string save_data();
|
||||
void load_data(std::string data);
|
||||
|
||||
std::string name; // "Jon's Computer", "Lab 6E77-B Terminal Omega"
|
||||
int mission_id; // Linked to a mission?
|
||||
|
||||
private:
|
||||
int security; // Difficulty of simply logging in
|
||||
std::vector<computer_option> options; // Things we can do
|
||||
std::vector<computer_failure> failures; // Things that happen if we fail a hack
|
||||
WINDOW *w_terminal; // Output window
|
||||
|
||||
// Called by use()
|
||||
void activate_function (game *g, computer_action action);
|
||||
// Generally called when we fail a hack attempt
|
||||
void activate_random_failure(game *g);
|
||||
// ...but we can also choose a specific failure.
|
||||
void activate_failure (game *g, computer_failure fail);
|
||||
|
||||
// OUTPUT/INPUT
|
||||
// Reset to a blank terminal (e.g. at start of usage loop)
|
||||
void reset_terminal();
|
||||
// Prints a line to the terminal (with printf flags)
|
||||
void print_line(const char *text, ...);
|
||||
// For now, the same as print_line but in red (TODO: change this?)
|
||||
void print_error(const char *text, ...);
|
||||
// Prints code-looking gibberish
|
||||
void print_gibberish_line();
|
||||
// Prints a line and waits for Y/N/Q
|
||||
char query_ynq(const char *text, ...);
|
||||
// Same as query_ynq, but returns true for y or Y
|
||||
bool query_bool(const char *text, ...);
|
||||
};
|
||||
|
||||
#endif
|
||||
+1068
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,77 @@
|
||||
bool able_window(game *, point); // Any window tile#include <vector>
|
||||
#include <string>
|
||||
#include "crafting.h"
|
||||
|
||||
struct construct;
|
||||
|
||||
struct construction_stage
|
||||
{
|
||||
ter_id terrain;
|
||||
int time; // In minutes, i.e. 10 turns
|
||||
std::vector<component> tools[3];
|
||||
std::vector<component> components[3];
|
||||
|
||||
construction_stage(ter_id Terrain, int Time) :
|
||||
terrain (Terrain), time (Time) { };
|
||||
};
|
||||
|
||||
struct constructable
|
||||
{
|
||||
int id;
|
||||
std::string name; // Name as displayed
|
||||
int difficulty; // Carpentry skill level required
|
||||
std::vector<construction_stage> stages;
|
||||
bool (construct::*able) (game *, point);
|
||||
void (construct::*done) (game *, point);
|
||||
|
||||
constructable(int Id, std::string Name, int Diff,
|
||||
bool (construct::*Able) (game *, point),
|
||||
void (construct::*Done) (game *, point)) :
|
||||
id (Id), name (Name), difficulty (Diff), able (Able), done (Done) {};
|
||||
};
|
||||
|
||||
struct construct // Construction functions.
|
||||
{
|
||||
// Bools - able to build at the given point?
|
||||
bool able_always(game *, point) { return true; }
|
||||
bool able_never (game *, point) { return false; }
|
||||
|
||||
bool able_empty (game *, point); // Able if tile is empty
|
||||
|
||||
bool able_window(game *, point); // Any window tile
|
||||
bool able_make_window(game *, point); // Any window tile or empty
|
||||
bool able_empty_window(game *, point); // Empty window tiles
|
||||
bool able_window_pane(game *, point); // Only intact windows
|
||||
bool able_broken_window(game *, point); // Able if tile is broken window
|
||||
|
||||
bool able_door(game *, point); // Any door tile
|
||||
bool able_door_broken(game *, point); // Broken door
|
||||
|
||||
bool able_wall (game *, point); // Able if tile is wall
|
||||
bool able_wall_wood(game *g, point); // Only player-built walls
|
||||
bool able_indoors(game *g, point); // Able on floors
|
||||
|
||||
bool able_between_walls(game *, point); // Flood-fill contained by walls
|
||||
|
||||
bool able_dig(game *, point); // Able if diggable terrain
|
||||
bool able_chainlink(game *, point); // Able on chain link fences
|
||||
bool able_pit(game *, point); // Able only on pits
|
||||
|
||||
bool able_tree(game *, point); // Able on trees
|
||||
bool able_log(game *, point); // Able on logs
|
||||
|
||||
bool able_furniture(game *, point); // Able on furniture
|
||||
|
||||
bool able_deconstruct(game *, point);
|
||||
|
||||
// Does anything special happen when we're finished?
|
||||
void done_nothing(game *, point) { }
|
||||
void done_window_pane(game *, point);
|
||||
void done_vehicle(game *, point);
|
||||
void done_tree(game *, point);
|
||||
void done_log(game *, point);
|
||||
void done_furniture(game *, point);
|
||||
void done_tape(game *, point);
|
||||
void done_deconstruct(game *, point);
|
||||
|
||||
};
|
||||
+2888
-763
File diff suppressed because it is too large
Load Diff
+37
-18
@@ -7,13 +7,19 @@
|
||||
#include "skill.h"
|
||||
#include "rng.h"
|
||||
|
||||
#define MAX_DISPLAYED_RECIPES 18
|
||||
|
||||
enum craft_cat {
|
||||
CC_NULL = 0,
|
||||
CC_WEAPON,
|
||||
CC_AMMO,
|
||||
CC_FOOD,
|
||||
CC_DRINK,
|
||||
CC_CHEM,
|
||||
CC_ELECTRONIC,
|
||||
CC_ARMOR,
|
||||
CC_MISC,
|
||||
CC_NONCRAFT,
|
||||
NUM_CC
|
||||
};
|
||||
|
||||
@@ -21,29 +27,42 @@ struct component
|
||||
{
|
||||
itype_id type;
|
||||
int count;
|
||||
component() { type = itm_null; count = 0; }
|
||||
component() { type = "null"; count = 0; }
|
||||
component(itype_id TYPE, int COUNT) : type (TYPE), count (COUNT) {}
|
||||
};
|
||||
|
||||
struct recipe
|
||||
{
|
||||
int id;
|
||||
itype_id result;
|
||||
craft_cat category;
|
||||
skill sk_primary;
|
||||
skill sk_secondary;
|
||||
int difficulty;
|
||||
int time;
|
||||
struct recipe {
|
||||
int id;
|
||||
itype_id result;
|
||||
craft_cat category;
|
||||
Skill *sk_primary;
|
||||
Skill *sk_secondary;
|
||||
int difficulty;
|
||||
int time;
|
||||
bool reversible; // can the item be disassembled?
|
||||
|
||||
std::vector<component> tools[5];
|
||||
std::vector<component> components[5];
|
||||
std::vector<component> tools[20];
|
||||
std::vector<component> components[20];
|
||||
|
||||
recipe() { id = 0; result = itm_null; category = CC_NULL; sk_primary = sk_null;
|
||||
sk_secondary = sk_null; difficulty = 0; time = 0; }
|
||||
recipe(int pid, itype_id pres, craft_cat cat, skill p1, skill p2, int pdiff,
|
||||
int ptime) :
|
||||
id (pid), result (pres), category (cat), sk_primary (p1), sk_secondary (p2),
|
||||
difficulty (pdiff), time (ptime) {}
|
||||
recipe() {
|
||||
id = 0;
|
||||
result = "null";
|
||||
category = CC_NULL;
|
||||
sk_primary = NULL;
|
||||
sk_secondary = NULL;
|
||||
difficulty = 0;
|
||||
time = 0;
|
||||
reversible = false;
|
||||
}
|
||||
|
||||
recipe(int pid, itype_id pres, craft_cat cat, const char *p1, const char *p2,
|
||||
int pdiff, int ptime, bool preversible) :
|
||||
id (pid), result (pres), category (cat), difficulty (pdiff), time (ptime), reversible (preversible)
|
||||
{
|
||||
sk_primary = p1?Skill::skill(p1):NULL;
|
||||
sk_secondary = p2?Skill::skill(p2):NULL;
|
||||
}
|
||||
};
|
||||
|
||||
|
||||
#endif
|
||||
|
||||
+12
@@ -0,0 +1,12 @@
|
||||
#ifndef _CURSES_DEF_H_
|
||||
#define _CURSES_DEF_H_
|
||||
|
||||
#if (defined _WIN32 || defined WINDOWS)
|
||||
#include "catacurse.h"
|
||||
#elif (defined __CYGWIN__)
|
||||
#include "ncurses/curses.h"
|
||||
#else
|
||||
#include <curses.h>
|
||||
#endif
|
||||
|
||||
#endif // CURSES_DEF_H
|
||||
@@ -0,0 +1,3 @@
|
||||
# These are both generated if missing at program startup
|
||||
keymap.txt
|
||||
options.txt
|
||||
@@ -0,0 +1,3 @@
|
||||
Terminus
|
||||
8
|
||||
16
|
||||
@@ -20,6 +20,17 @@ Our research on teleportation has ground to a halt. For some reason, the
|
||||
creation of a long-range transportation device eludes us, and one can transfer
|
||||
no further than 30 meters.
|
||||
%
|
||||
I don't know how it happened, but a janitor managed to activate the portal
|
||||
while cleaning the lab, shifting in an assortment of prehistoric fauna.
|
||||
Security was called in immediately but was unable to save the janitor from
|
||||
being torn apart. By the time the confusion settled, all the fauna had been
|
||||
terminated.
|
||||
%
|
||||
Tests on the prehistoric fauna show extremely close genetic relationships with
|
||||
extant and extinct terranian animals. It might be that the portal had performed
|
||||
a transposition in time, unfortunately the portal device had been destroyed
|
||||
when security had put down the fauna.
|
||||
%
|
||||
An incident occured in the teleportation lab, wherein a subject managed to
|
||||
teleport into another subject. The latter was completely destroyed from the
|
||||
inside out, while the former sustained little damage. I would like to explore
|
||||
@@ -52,7 +63,7 @@ slime-like structure as XE037, suggesting a close genetic relationship.
|
||||
%
|
||||
Today we tested weaponry against XE142 and XE157, two amorphous subprime
|
||||
samples. Their form proved to be nearly invulnerable to projectile based
|
||||
weaponry, but they were susceptible to energy weapons and fire.
|
||||
weaponry, but they were susceptible to directed energy weapons and flagration.
|
||||
%
|
||||
Our cloning department has failed to produce results. In vats containing stem
|
||||
cell treatments, XE037, and control vats, the subjects simple disintegrated.
|
||||
@@ -61,11 +72,11 @@ destructive effects on prime plane lifeforms.
|
||||
%
|
||||
The vivisection program has shown mixed results, revealing an incredible
|
||||
degree of variation in subplane lifeforms. Certain specimens have an internal
|
||||
structure that is amazingly similar to that of humans, while others seem to
|
||||
structure that is amazingly similar to that of mammals, while others seem to
|
||||
have no internal structure at all.
|
||||
%
|
||||
Our security department has identified several key flaws. Though our surface
|
||||
entrance is quite secure, there are several possible points of entrance below
|
||||
entrance is quite secure, there are several possible points of entry below
|
||||
the surface, particularly in the sewage systems.
|
||||
%
|
||||
Today we applied a very small sample of XE037, suspended in water, to subject
|
||||
@@ -172,7 +172,7 @@ Most gun stores follow pretty similar layouts. The restricted stuff--SMGs, assa
|
||||
|
||||
I've spent many nights in the changing rooms at the back of clothing stores. Walls on four sides, far from the store's entrance, a corridor for easy defense... it's perfect!
|
||||
|
||||
If you're getting chased by a hoarde of zombies, try ducking into the subways and traveling a block or two, then coming back up.
|
||||
If you're getting chased by a hoard of zombies, try ducking into the subways and traveling a block or two, then coming back up.
|
||||
|
||||
Have you seen those weird science labs out in the middle of nowhere? I think you need some kind of special ID card to get in.
|
||||
|
||||
@@ -184,4 +184,3 @@ In a lot of places, there's little hallways connecting the subways with the sewe
|
||||
|
||||
Be careful of drinking water from rivers and stuff, it's a good way to get sick. But if you have a water purifier, it'll make it safe.
|
||||
|
||||
|
||||
Executable
BIN
Binary file not shown.
|
After Width: | Height: | Size: 66 KiB |
Executable
+94
@@ -0,0 +1,94 @@
|
||||
Changelog will be a little light for the early entries due to me being really bad at documenting things.
|
||||
|
||||
0.4
|
||||
Make the battery system bionic only consume as many batteries as necessary to fully power yourself
|
||||
Knives can also cauterize wounds now. Requires a lighter.
|
||||
Soldering irons (and hotplates, why not) can be used to cauterize wounds, causing pain and removing any bleeding or uninfected bite effects.
|
||||
Fixed crash bug in Windows when attacks hit something off-screen?
|
||||
Fixed precipitation animation with shifted viewport.
|
||||
Can now disassemble items from the examination screen.
|
||||
Added colored hinting to the item examination sidebar listing possible actions. e.g., "W" (for "wear") is grayed out if the item isn't wearable.
|
||||
Added ability to craft a recipe continuously (until out of materials, etc.).
|
||||
Reduce (maybe fully fix) wolf self-attacks.
|
||||
Power armor.
|
||||
More fitted gear, and a few more pieces made craftable.
|
||||
Vehicle-mountable water tanks and kitchen units, implied storage-battery-charging generators.
|
||||
Map tiles can now contain up to 64 items.
|
||||
Beer has been made weaker, and now appears in kegs in liquor stores and bars.
|
||||
Steel jerrycans.
|
||||
Any gun can now be used one-handed if you are strong enough.
|
||||
Hardcoded frostbite not to occur above freezing temperatures.
|
||||
Improved fire's ability to warm the player. Also, standing on fire and being on fire warm up the player.
|
||||
Fixed body temperature equalization.
|
||||
Sunny and clear weather no longer warm the player underground.
|
||||
Standing in water or sewage will increase the rate of heat loss (but not make the player colder)
|
||||
The head and torso now lose heat faster than other body parts.
|
||||
Body temperature drops as you lose HP.
|
||||
Encumberance menu's listing of warmth has been made more colorful.
|
||||
Mouth (face) now has appropriate cold and hot diseases.
|
||||
The ability to cauterize wounds to heal bites and stop bleeding. (a)ctivate a knife, requires a lighter.
|
||||
The ability to craft an item as many times as is possible. Defaults to the + key. (Linux and Mac users will need to assign a key)
|
||||
Added M72-LAW. Makes a large explosion and penetrates armour well. One shot only.
|
||||
Clothing can be made fitted by (a)pplying a sewing kit.
|
||||
Some foods can be heated, hot food grants a larger morale bonus than cold food.
|
||||
Ammunition explodes rather than burning.
|
||||
Lightstrips, function as weak light providers. Craftable.
|
||||
Bandages and First Aid kits no longer show uninjured bodyparts in the menu.
|
||||
Some basic professions, more to be added later.
|
||||
|
||||
|
||||
0.3
|
||||
Many menus stretch with an enlarged viewport.
|
||||
An action to repeat the last craft has been added, default keybinding of -
|
||||
When crafting liquid items, the game asks you for a container first, then asks if you want to dump the item.
|
||||
A large amount of survival craft has been added, allowing you to make most of the basic tools and necessities. Along with several new weapons, some storage items and a liquid container.
|
||||
Smoker Zombies, belch clouds of smoke at players, slowing them and blocking LOS.
|
||||
Robots now pull from separate drop lists when killed.
|
||||
Alcohol cost for Torches and Bandages has been increased to 7, or one third of a bottle.
|
||||
Alcohol cost for molotovs has been reduced to 14, gasoline cost increased to 400.
|
||||
Chitinous boots and gauntlets added.
|
||||
Picklock kits break when damaged 5 times.
|
||||
Zombie spawn ratios have been rebalanced for static spawning.
|
||||
Pocketknives are useable for all logical recipes.
|
||||
Child zombies have had a small pool of item drops added.
|
||||
HP Ignorant is now the player default, Self Aware can be purchased to display exact HP.
|
||||
Lawnmower blades have been replaced with generic blades, most bladed items are made using blades instead of machetes/swords now.
|
||||
Nail bat, nail board and makeshift halberd now all have weak block.
|
||||
Wild veggies function as plant marrow for most recipes.
|
||||
Meat soup added, more cooking to come.
|
||||
The player now spawns with a pocket knife and lighter.
|
||||
Sledge hammer is usable to board windows and doors up.
|
||||
Heartless trait has been removed, replaced with the Cannibal trait, which allows you to eat human meat with no morale penalty.
|
||||
Braziers are now craftable. They contain fire and can be set up indoors.
|
||||
Bulletin Boards can be built to set an area as your home base. NPCs can
|
||||
be told to wait there and will defend the area.
|
||||
Bear traps have been increased in weight and volume.
|
||||
Carboys have been renamed to Gallon jugs.
|
||||
You can now create a character without allocating all skill points.
|
||||
Winter Boots and Raincoats now correctly display the reinforced tag.
|
||||
Kills can now be accessed from in-game. Default key is ).
|
||||
'Phew it's hot warm' message has been fixed.
|
||||
The game now accepts wielded items when checking for containers.
|
||||
Sunny and Clear weather now provide warmth.
|
||||
Internal Climate Control bionic consumes power to cool or warm you.
|
||||
Crash bug caused by the screen being larger than the loaded overmap has
|
||||
been fixed.
|
||||
Crash bug when going down stairs near cities has been fixed.
|
||||
Hunger now affects body temperature.
|
||||
Added new crafting recipes: shorts, cargo shorts, balclava, long underwear,
|
||||
glove liners, socks.
|
||||
Added a digging stick. Can be used to dig shallow pits, and level construction enough to enable crafting of stone shovels.
|
||||
|
||||
Got angry at other developers for not updating changelog.
|
||||
|
||||
0.2
|
||||
Reworked spawning option which places zombies at world generation
|
||||
rather than generating them dynamically in play.
|
||||
Implementation of a context menu when examining inventory items.
|
||||
Machine added to hospitals to regrow limbs.
|
||||
|
||||
0.1
|
||||
Palisade Walls and Gates - Pretty tough to bash down, and can be fired throguh
|
||||
Log Walls - Basically the same as wood walls, different construction methods.
|
||||
The ability to disassemble tshirts and tank tops by hand. - Handy for bleeding.
|
||||
Revolver Shotgun - NotTe much to say on this.
|
||||
@@ -0,0 +1,16 @@
|
||||
# This message may be 16 lines long at maximum.
|
||||
# Max length of a line is 68 characters; the following line is for reference
|
||||
####################################################################
|
||||
Original author: Project Manager: Website/Forum:
|
||||
Whales (retired) TheDarklingWolf GlyphGryph
|
||||
|
||||
Main Developers/Gihub Managers:
|
||||
Kevingranade, Ozone, TheDarklingWolf, zpmorgan
|
||||
|
||||
Active Contributors:
|
||||
BurnZeZ, Oddzball, Shades, Shoes01, Tase, GalenEvil
|
||||
|
||||
Contributors:
|
||||
AkrionXxarr, Benjamg, Creidieki, Daftfad, Elricsfate, Gim,
|
||||
GlyphGryph, Gremour, HerbertJones, hovatterz, Origamiwolf,
|
||||
Soron, Uzername, Voker57, Wito
|
||||
@@ -0,0 +1,18 @@
|
||||
# This message may be 16 lines long at maximum.
|
||||
# Max length of a line is 68 characters; the following line is for reference
|
||||
####################################################################
|
||||
New features v0.3:
|
||||
Reduced sight range of monsters. Monster bites and infections.
|
||||
A bunch of new survival craft.
|
||||
Fixes, fixes and more fixes.
|
||||
|
||||
For latest discussions and news on Cataclysm DDA, please visit:
|
||||
|
||||
Homepage: http://www.cataclysmdda.com/
|
||||
Forum: http://www.cataclysmdda.com/smf/
|
||||
Wiki: http://wiki.cataclysmdda.com/
|
||||
|
||||
The game now has new configurable options:
|
||||
Customizeable Viewport, Spawntype: Classic/Static, Starting time
|
||||
|
||||
Ingame you can access the options via the help menu (?2).
|
||||
@@ -0,0 +1,18 @@
|
||||
# This is the npc file for Cataclysm.
|
||||
# You can start a line with # to make it a comment--it will be ignored.
|
||||
# Blank lines are ignored too.
|
||||
# Extra whitespace, including tab, is ignored, so format things how you like.
|
||||
# If you wish to restore defaults, simply remove this file.
|
||||
|
||||
# This file currently has two options, disabling starting npcs and
|
||||
# disabling randomly spawning npcs spawned by the dynamic spawn system
|
||||
|
||||
# Turning on the starting_npc setting only has effect on new character
|
||||
# creation. None of these settings get rid of already spawned npcs. Use
|
||||
# the debug menu for that.
|
||||
|
||||
# WARNING: NPC's are currently broken. When used expect bugs and crashes.
|
||||
# You have been warned.
|
||||
# None of these settings prevent you from spawning npcs using the debug menu.
|
||||
starting_npc n
|
||||
random_npc n
|
||||
@@ -0,0 +1,284 @@
|
||||
[
|
||||
{
|
||||
"name" : "GROUP_FOREST",
|
||||
"default" : "mon_squirrel",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_rabbit", "freq" : 150 },
|
||||
{ "monster" : "mon_deer", "freq" : 30 },
|
||||
{ "monster" : "mon_wolf", "freq" : 30 },
|
||||
{ "monster" : "mon_bear", "freq" : 20 },
|
||||
{ "monster" : "mon_cougar", "freq" : 20 },
|
||||
{ "monster" : "mon_spider_wolf", "freq" : 30 },
|
||||
{ "monster" : "mon_spider_jumping", "freq" : 30 },
|
||||
{ "monster" : "mon_dog", "freq" : 10 },
|
||||
{ "monster" : "mon_crow", "freq" : 30 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_ANT",
|
||||
"default" : "mon_ant",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_ant_larva", "freq" : 40 },
|
||||
{ "monster" : "mon_ant_soldier", "freq" : 90 },
|
||||
{ "monster" : "mon_ant_queen", "freq" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_BEE",
|
||||
"default" : "mon_bee",
|
||||
"monsters" : [
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_WORM",
|
||||
"default" : "mon_worm",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_graboid", "freq" : 30 },
|
||||
{ "monster" : "mon_halfworm", "freq" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_ZOMBIE",
|
||||
"default" : "mon_zombie",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 20 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 70 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1 },
|
||||
{ "monster" : "mon_boomer", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1 },
|
||||
{ "monster" : "mon_crow", "freq" : 1 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_TRIFFID",
|
||||
"default" : "mon_triffid",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_triffid_young", "freq" : 300 },
|
||||
{ "monster" : "mon_vinebeast", "freq" : 160 },
|
||||
{ "monster" : "mon_triffid_queen", "freq" : 60 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_FUNGI",
|
||||
"default" : "mon_fungaloid",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_fungaloid_dormant", "freq" : 0 },
|
||||
{ "monster" : "mon_ant_fungus", "freq" : 0 },
|
||||
{ "monster" : "mon_zombie_fungus", "freq" : 300 },
|
||||
{ "monster" : "mon_boomer_fungus", "freq" : 30 },
|
||||
{ "monster" : "mon_spore", "freq" : 0 },
|
||||
{ "monster" : "mon_fungal_wall", "freq" : 0 }
|
||||
]
|
||||
},
|
||||
|
||||
{
|
||||
"name" : "GROUP_GOO",
|
||||
"default" : "mon_blob",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_blob_small", "freq" : 200 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_CHUD",
|
||||
"default" : "mon_chud",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_one_eye", "freq" : 90 },
|
||||
{ "monster" : "mon_crawler", "freq" : 35 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_SEWER",
|
||||
"default" : "mon_sewer_rat",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_sewer_fish", "freq" : 470 },
|
||||
{ "monster" : "mon_sewer_snake", "freq" : 240 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_SWAMP",
|
||||
"default" : "mon_mosquito",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_dragonfly", "freq" : 130 },
|
||||
{ "monster" : "mon_centipede", "freq" : 150 },
|
||||
{ "monster" : "mon_frog", "freq" : 100 },
|
||||
{ "monster" : "mon_slug", "freq" : 85 },
|
||||
{ "monster" : "mon_dermatik_larva", "freq" : 0 },
|
||||
{ "monster" : "mon_dermatik", "freq" : 65 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_LAB",
|
||||
"default" : "mon_zombie_scientist",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_blob_small", "freq" : 25 },
|
||||
{ "monster" : "mon_manhack", "freq" : 245 },
|
||||
{ "monster" : "mon_skitterbot", "freq" : 245 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_NETHER",
|
||||
"default" : "mon_blank",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_flying_polyp", "freq" : 25 },
|
||||
{ "monster" : "mon_hunting_horror", "freq" : 240 },
|
||||
{ "monster" : "mon_mi_go", "freq" : 120 },
|
||||
{ "monster" : "mon_yugg", "freq" : 70 },
|
||||
{ "monster" : "mon_gelatin", "freq" : 120 },
|
||||
{ "monster" : "mon_flaming_eye", "freq" : 120 },
|
||||
{ "monster" : "mon_kreck", "freq" : 210 },
|
||||
{ "monster" : "mon_gozu", "freq" : 25 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_SPIRAL",
|
||||
"default" : "mon_human_snail",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_twisted_body", "freq" : 180 },
|
||||
{ "monster" : "mon_vortex", "freq" : 80 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_VANILLA",
|
||||
"default" : "mon_zombie",
|
||||
"monsters" : [
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_SPIDER",
|
||||
"default" : "mon_spider_wolf",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_spider_web", "freq" : 200 },
|
||||
{ "monster" : "mon_spider_jumping", "freq" : 400 },
|
||||
{ "monster" : "mon_spider_widow", "freq" : 200 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_ROBOT",
|
||||
"default" : "mon_manhack",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_skitterbot", "freq" : 220 },
|
||||
{ "monster" : "mon_secubot", "freq" : 150 },
|
||||
{ "monster" : "mon_copbot", "freq" : 0 },
|
||||
{ "monster" : "mon_molebot", "freq" : 40 },
|
||||
{ "monster" : "mon_tripod", "freq" : 110 },
|
||||
{ "monster" : "mon_chickenbot", "freq" : 60 },
|
||||
{ "monster" : "mon_tankbot", "freq" : 20 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_POLICE", "_comment" : "+30% cops",
|
||||
"default" : "mon_zombie",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 320 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 70 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1 },
|
||||
{ "monster" : "mon_boomer", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1 },
|
||||
{ "monster" : "mon_crow", "freq" : 1 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_HOUSE", "_comment" : "+15% child",
|
||||
"default" : "mon_zombie",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_zombie_child", "freq" : 150 },
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 20 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 70 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1 },
|
||||
{ "monster" : "mon_boomer", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1 },
|
||||
{ "monster" : "mon_crow", "freq" : 1 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_PHARM", "_comment" : "+15% fast",
|
||||
"default" : "mon_zombie",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 20 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 220 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1 },
|
||||
{ "monster" : "mon_boomer", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1 },
|
||||
{ "monster" : "mon_crow", "freq" : 1 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_ELECTRO", "_comment" : "+15% electric",
|
||||
"default" : "mon_zombie",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 20 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 70 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 180 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1 },
|
||||
{ "monster" : "mon_boomer", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1 },
|
||||
{ "monster" : "mon_crow", "freq" : 1 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_GROCERY", "_comment" : "+15% bommers",
|
||||
"default" : "mon_zombie",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 20 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 70 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 30 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1 },
|
||||
{ "monster" : "mon_boomer", "freq" : 180 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1 },
|
||||
{ "monster" : "mon_crow", "freq" : 1 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_MAYBE_MIL", "_comment" : "50% chance military zombie",
|
||||
"default" : "mon_null",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_zombie_soldier", "freq" : 50 }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,303 @@
|
||||
[
|
||||
{ "name" : "Aaliyah", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Aaron", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Abigail", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Adam", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Adams", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Addison", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Adrian", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Aidan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Aiden", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Alex", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Alexa", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Alexander", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Alexander", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Alexandra", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Alexis", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Allen", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Allison", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Alyssa", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Amelia", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Anderson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Andrea", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Andrew", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Angel", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Angelina", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Anna", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Anthony", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Ariana", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Arianna", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Ashley", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Aubrey", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Audrey", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Austin", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Autumn", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Ava", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Avery", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Ayden", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Bailey", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Bailey", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Baker", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Barnes", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Bell", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Benjamin", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Bennett", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Blake", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Brady", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Brandon", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Brayden", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Brian", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Brianna", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Brody", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Brooke", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Brooklyn", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Brooks", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Brown", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Bryan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Bryant", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Butler", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Caden", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Caleb", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Cameron", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Camilla", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Campbell", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Carlos", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Caroline", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Carson", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Carter", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Carter", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Charles", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Charlotte", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Chase", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Chloe", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Christian", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Christopher", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Claire", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Clark", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Cole", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Coleman", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Collins", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Colton", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Connor", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Cook", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Cooper", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Cooper", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Cox", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Daniel", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "David", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Davis", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Destiny", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Diaz", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Diego", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Dominic", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Dylan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Eben", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Edwards", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Eli", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Elijah", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Elizabeth", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Ella", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Emily", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Emma", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Eric", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Ethan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Evan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Evans", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Evelyn", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Faith", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Flores", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Foster", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Gabriel", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Gabriella", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Gabrielle", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Garcia", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Gavin", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Genesis", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Gianna", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Gonzales", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Gonzalez", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Grace", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Gracie", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Gray", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Green", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Griffin", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Hailey", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Hall", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Hannah", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Harris", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Hayden", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Hayes", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Henderson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Henry", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Hernandez", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Hill", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Howard", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Hughes", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Hunter", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Ian", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Isaac", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Isabel", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Isabella", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Isabelle", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Isaiah", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Jack", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Jackson", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Jackson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Jacob", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Jaden", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "James", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "James", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Jasmine", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Jason", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Jayden", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Jen", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Jenkins", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Jennifer", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Jeremiah", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Jessica", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Jessie", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Jesus", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Jocelyn", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "John", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Johnson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Jonathan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Jones", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Jordan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Jose", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Joseph", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Joshua", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Josiah", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Juan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Julia", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Julian", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Justin", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Kaden", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Kaitlin", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Katelyn", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Katie", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Kayla", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Kaylee", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Kelly", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Kevin", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Kim", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Kimberly", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "King", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Kyle", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Kylie", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Landon", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Lauren", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Layla", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Leah", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Lee", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Lewis", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Liam", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Lillian", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Lily", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Logan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Long", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Lopez", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Lucas", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Luis", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Luke", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Madeline", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Madelyn", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Madison", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Makayla", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Maria", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Mariah", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Martin", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Martinez", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Mary", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Mason", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Matthew", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Maya", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Megan", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Melanie", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Mia", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Michael", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Miller", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Mitchell", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Moore", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Morgan", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Morgan", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Morris", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Murphy", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Natalie", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Nathan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Nathaniel", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Nelson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Nevaeh", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Nicholas", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Noah", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Olivia", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Owen", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Paige", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Parker", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Patterson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Payton", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Perez", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Perry", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Peterson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Phillips", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Powell", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Price", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Rachel", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Ramirez", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Reed", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Richardson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Riley", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Rivera", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Robert", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Roberts", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Robinson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Rodriguez", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Rogers", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Ross", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Russell", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Ryan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Sabastian", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Samantha", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Samuel", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Sanchez", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Sanders", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Sara", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Sarah", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Savannah", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Scott", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Sean", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Simmons", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Smith", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Sofia", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Sophie", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Sophie", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Stewart", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Sydney", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Taylor", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Thomas", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Thomas", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Thompson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Torres", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Trinity", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Tristan", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Turner", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Tyler", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Valeria", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Vanessa", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Victoria", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Walker", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Ward", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Washington", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Watson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "White", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "William", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Williams", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Wilson", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Wood", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Wright", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Wyatt", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Xavier", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Young", "gender" : "unisex", "usage" : "family" },
|
||||
{ "name" : "Zachary", "gender" : "male", "usage" : "given" },
|
||||
{ "name" : "Zoe", "gender" : "female", "usage" : "given" },
|
||||
{ "name" : "Zoey", "gender" : "female", "usage" : "given" }
|
||||
]
|
||||
@@ -0,0 +1,37 @@
|
||||
[
|
||||
{
|
||||
"ident": "unemployed",
|
||||
"name": "Unemployed",
|
||||
"description":
|
||||
"They say you don't have any 'useful skills', but at least your clothes fit\nwell.",
|
||||
"points": 0,
|
||||
"items": ["jeans", "tshirt", "sneakers"]
|
||||
},
|
||||
|
||||
{
|
||||
"ident": "labtech",
|
||||
"name": "Lab Technician",
|
||||
"description":
|
||||
"It was your first day in the lab when the cataclysm hit. You were evacuated\nwith all the civilians, but at least you kept your lab gear.",
|
||||
"points": 1,
|
||||
"items": ["dress_shirt", "pants", "boots", "coat_lab", "gloves_rubber", "glasses_safety"]
|
||||
},
|
||||
|
||||
{
|
||||
"ident": "mechanic",
|
||||
"name": "Wannabe Mechanic",
|
||||
"description":
|
||||
"Although you never got your driver's license, you've always loved cars.\nYou start with a wrench, a toolbelt, and some car-related reading material.",
|
||||
"points": 2,
|
||||
"items": ["tank_top", "jeans", "beltrig", "wrench", "mag_cars", "manual_mechanics"]
|
||||
},
|
||||
|
||||
{
|
||||
"ident": "smoker",
|
||||
"name": "Chain Smoker",
|
||||
"description":
|
||||
"Everyone at work knew you as the person who always had a cigarette or two\nin hand. Now, you're down to a single pack, and you hope you find more soon.\nYou start out with a strong nicotine addiction, and 10 cigarettes.",
|
||||
"points": -1,
|
||||
"items": ["pants", "dress_shirt", "dress_shoes", "cig"]
|
||||
}
|
||||
]
|
||||
@@ -0,0 +1,142 @@
|
||||
[
|
||||
[
|
||||
"null",
|
||||
"null",
|
||||
"The skill of true Zen."
|
||||
],
|
||||
[
|
||||
"dodge",
|
||||
"dodge",
|
||||
"Your skill at dodging, whether it be from an attack, a trap, or a natural\noccurrence. It is also used when attempting to fall gracefully, or in other\nacrobatic feats."
|
||||
],
|
||||
[
|
||||
"melee",
|
||||
"melee",
|
||||
"Your skill at hand-to-hand combat, both with and without a weapon. At low\nlevels this merely increases your chance to hit, but at higher levels it also\nincreases the damage done significantly."
|
||||
],
|
||||
[
|
||||
"unarmed",
|
||||
"unarmed combat",
|
||||
"Your skill at combat without a weapon. While at low levels, unarmed combat is\na good way to die quickly, those skilled in it can eventually use throws and\ncrushing blows to quickly dispatch enemies."
|
||||
],
|
||||
[
|
||||
"bashing",
|
||||
"bashing weapons",
|
||||
"Your skill at combat with weapons that club or bash your enemies. This\nincludes everything from rocks to baseball bats, and even the butt of rifles.\nThis increases damage, and at higher levels will improve your chance to hit."
|
||||
],
|
||||
[
|
||||
"cutting",
|
||||
"cutting weapons",
|
||||
"Your skill at combat with weapons that cut or slice your enemies. At first\nthis will simply slightly increase accuracy and damage; later on it will\nhelp you bypass armor and thick hides."
|
||||
],
|
||||
[
|
||||
"stabbing",
|
||||
"piercing weapons",
|
||||
"Your skill at combat that involves piercing weapons. This includes spears,\nwhich only have a stabbing attack, and things like knives, which can cut or\npierce. This increases your accuracy and chance of a deadly critical."
|
||||
],
|
||||
[
|
||||
"throw",
|
||||
"throwing",
|
||||
"Your skill at throwing items and getting them to go where you want. Increases\nboth accuracy and, at higher levels, range."
|
||||
],
|
||||
[
|
||||
"gun",
|
||||
"firearms",
|
||||
"Your general skill at firearms. This increases your accuracy with any gun,\nbut not as much as the skill associated with the gun in question."
|
||||
],
|
||||
[
|
||||
"pistol",
|
||||
"handguns",
|
||||
"Your skill with handguns. These have poor accuracy, but generally are fired\nand reloaded faster than other guns, and are good in close quarters."
|
||||
],
|
||||
[
|
||||
"shotgun",
|
||||
"shotguns",
|
||||
"Your skill with shotguns. Shot is easy to hit with, and does massive damage,\nbut has short range. Shotguns may also be loaded with slugs, which go further\nand do as much damage, but are not very accurate."
|
||||
],
|
||||
[
|
||||
"smg",
|
||||
"submachine guns",
|
||||
"Your skill with submachine guns and machine pistols. Halfway between a pistol\nand an assault rifle, these weapons fire and reload quickly, and may fire in\nbursts, but they are not very accurate."
|
||||
],
|
||||
[
|
||||
"rifle",
|
||||
"rifles",
|
||||
"Your skill with rifles, both assault rifles and semi-auto hunting rifles.\nThese have terrific range and accuracy, but are very slow to fire and reload,\nand are not very good in close quarters."
|
||||
],
|
||||
[
|
||||
"archery",
|
||||
"archery",
|
||||
"Your skill with all kinds of bows, from crossbows to handmade long bows.\nThese are quiet, but require some amount of strength to use, and are not\nterribly accurate. They can only be deadly in skilled hands."
|
||||
],
|
||||
[
|
||||
"launcher",
|
||||
"grenade launcher",
|
||||
"Your skill with grenade launchers, whether standalone or as a rifle mod.\nThese launchers fire a variety of 40mm grenades with different uses,\nbut they and their rounds are hard to find."
|
||||
],
|
||||
[
|
||||
"computer",
|
||||
"computers",
|
||||
"Your skill with computers, both in terms of legitimate use, and hacking. This\nwill help you use complex systems, and bypass their security."
|
||||
],
|
||||
[
|
||||
"mechanics",
|
||||
"mechanics",
|
||||
"Your skill with repairs to mechanical systems, and the crafting of many items\nthat use complex parts, but are not electronics."
|
||||
],
|
||||
[
|
||||
"electronics",
|
||||
"electronics",
|
||||
"Your skill with repairs to electrical systems, and the crafting of many items\nthat use electrical parts."
|
||||
],
|
||||
[
|
||||
"cooking",
|
||||
"cooking",
|
||||
"Your skill in combining food ingredients to make other, tastier food items.\nThis may also be used in mixing chemicals and other more esoteric tasks."
|
||||
],
|
||||
[
|
||||
"carpentry",
|
||||
"construction",
|
||||
"Your general knowledge in construction. This is used primarily when building\nterrain, via the * screen."
|
||||
],
|
||||
[
|
||||
"survival",
|
||||
"survival",
|
||||
"Your skill in wilderness survival. This helps you butcher meat from a corpse\nand craft various basic survival items. High levels may allow you to remove\npoison from tainted meat. Also used for skinning corpses to acquire pelts."
|
||||
],
|
||||
[
|
||||
"traps",
|
||||
"traps",
|
||||
"Your skill at setting and disarming traps safely and effectively. Note that\nthis does not help you detect traps, or avoid their effects if you activate\nthem."
|
||||
],
|
||||
[
|
||||
"tailor",
|
||||
"tailoring",
|
||||
"Your skill at repairing clothing, and at higher levels, creating clothing\nfrom basic materials. Generally a sewing kit is needed. Also applies to\nother methods of clothing repair and textile crafting."
|
||||
],
|
||||
[
|
||||
"firstaid",
|
||||
"first aid",
|
||||
"Your skill at emergency medical treatment, such as that from first aid kits\nand bandages. High levels of this skill may help heal more HP. Some drugs\nmay be more effective as well."
|
||||
],
|
||||
[
|
||||
"speech",
|
||||
"speech",
|
||||
"Your skill at talking to people, convincing them of things, lying, and many\nothers. Works best in conjunction with a high intelligence."
|
||||
],
|
||||
[
|
||||
"barter",
|
||||
"barter",
|
||||
"Your skill at getting a good deal when trading with others. Very high levels\nmight even see you getting freebies."
|
||||
],
|
||||
[
|
||||
"swimming",
|
||||
"swimming",
|
||||
"Your skill at swimming. This affects speed, your ability to swim while\nwearing clothes or carrying weights, and in-water combat."
|
||||
],
|
||||
[
|
||||
"driving",
|
||||
"driving",
|
||||
"Your skill at driving. This affects how well you can control a vehicle,\nas well as the penalty of shooting while driving."
|
||||
]
|
||||
]
|
||||
Binary file not shown.
@@ -0,0 +1,217 @@
|
||||
#include "debug.h"
|
||||
#include <time.h>
|
||||
|
||||
|
||||
#if !(defined _WIN32 || defined WINDOWS || defined __CYGWIN__)
|
||||
#include <execinfo.h>
|
||||
#include <stdlib.h>
|
||||
#endif
|
||||
|
||||
// Static defines {{{1
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
static int debugLevel = DL_ALL;
|
||||
static int debugClass = DC_ALL;
|
||||
|
||||
// Normal functions {{{1
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
void setupDebug()
|
||||
{
|
||||
int level = 0;
|
||||
|
||||
#ifdef DEBUG_INFO
|
||||
level |= D_INFO;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_WARNING
|
||||
level |= D_WARNING;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ERROR
|
||||
level |= D_ERROR;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_PEDANTIC_INFO
|
||||
level |= D_PEDANTIC_INFO;
|
||||
#endif
|
||||
|
||||
if( level != 0 )
|
||||
limitDebugLevel(level);
|
||||
|
||||
int cl = 0;
|
||||
|
||||
#ifdef DEBUG_ENABLE_MAIN
|
||||
cl |= D_MAIN;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLE_MAP
|
||||
cl |= D_MAP;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLE_MAP_GEN
|
||||
cl |= D_MAP_GEN;
|
||||
#endif
|
||||
|
||||
#ifdef DEBUG_ENABLE_GAME
|
||||
cl |= D_GAME;
|
||||
#endif
|
||||
|
||||
if( cl != 0 )
|
||||
limitDebugClass(cl);
|
||||
}
|
||||
|
||||
void limitDebugLevel( int i )
|
||||
{
|
||||
dout() << "Set debug level to: " << (DebugLevel)i;
|
||||
debugLevel = i;
|
||||
}
|
||||
|
||||
void limitDebugClass( int i )
|
||||
{
|
||||
dout() << "Set debug class to: " << (DebugClass)i;
|
||||
debugClass = i;
|
||||
}
|
||||
|
||||
// Debug only {{{1
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#ifdef ENABLE_LOGGING
|
||||
|
||||
#define TRACE_SIZE 20
|
||||
|
||||
void* tracePtrs[TRACE_SIZE];
|
||||
|
||||
// Debug Includes {{{2
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#include <fstream>
|
||||
#include <streambuf>
|
||||
|
||||
// Null OStream {{{2
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
struct NullBuf : public std::streambuf
|
||||
{
|
||||
NullBuf() {}
|
||||
int overflow(int c) { return c; }
|
||||
};
|
||||
|
||||
struct DebugFile
|
||||
{
|
||||
DebugFile();
|
||||
~DebugFile();
|
||||
|
||||
std::ofstream & currentTime();
|
||||
std::ofstream file;
|
||||
};
|
||||
|
||||
static NullBuf nullBuf;
|
||||
static std::ostream nullStream(&nullBuf);
|
||||
|
||||
// DebugFile OStream Wrapper {{{2
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
static DebugFile debugFile;
|
||||
|
||||
DebugFile::DebugFile()
|
||||
{
|
||||
file.open("data/debug.txt", std::ios::out | std::ios::app );
|
||||
file << "\n\n-----------------------------------------\n";
|
||||
currentTime() << " : Starting log.";
|
||||
}
|
||||
|
||||
DebugFile::~DebugFile()
|
||||
{
|
||||
file << "\n";
|
||||
currentTime() << " : Log shutdown.\n";
|
||||
file << "-----------------------------------------\n\n";
|
||||
file.close();
|
||||
}
|
||||
|
||||
// OStream Operators {{{2
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
std::ostream & operator<<(std::ostream & out, DebugLevel lev)
|
||||
{
|
||||
if( lev != DL_ALL )
|
||||
{
|
||||
if( lev & D_INFO )
|
||||
out << "INFO ";
|
||||
if( lev & D_WARNING )
|
||||
out << "WARNING ";
|
||||
if( lev & D_ERROR )
|
||||
out << "ERROR ";
|
||||
if( lev & D_PEDANTIC_INFO )
|
||||
out << "PEDANTIC ";
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
std::ostream & operator<<(std::ostream & out, DebugClass cl)
|
||||
{
|
||||
if( cl != DC_ALL )
|
||||
{
|
||||
if( cl & D_MAIN )
|
||||
out << "MAIN ";
|
||||
if( cl & D_MAP )
|
||||
out << "MAP ";
|
||||
}
|
||||
return out;
|
||||
}
|
||||
|
||||
std::ofstream & DebugFile::currentTime()
|
||||
{
|
||||
struct tm *current;
|
||||
time_t now;
|
||||
|
||||
time(&now);
|
||||
current = localtime(&now);
|
||||
|
||||
file << current->tm_hour << ":" << current->tm_min << ":" <<
|
||||
current->tm_sec;
|
||||
return file;
|
||||
}
|
||||
|
||||
std::ostream & dout(DebugLevel lev,DebugClass cl)
|
||||
{
|
||||
if( (lev & debugLevel) && (cl & debugClass) )
|
||||
{
|
||||
debugFile.file << std::endl;
|
||||
debugFile.currentTime() << " ";
|
||||
if( lev != debugLevel )
|
||||
debugFile.file << lev;
|
||||
if( cl != debugClass )
|
||||
debugFile.file << cl;
|
||||
debugFile.file << ": ";
|
||||
|
||||
// Backtrace on error.
|
||||
#if !(defined _WIN32 || defined WINDOWS)
|
||||
if( lev == D_ERROR )
|
||||
{
|
||||
int count = backtrace( tracePtrs, TRACE_SIZE );
|
||||
char** funcNames = backtrace_symbols( tracePtrs, count );
|
||||
for(int i = 0; i < count; ++i)
|
||||
debugFile.file << "\n\t(" << funcNames[i] << "), ";
|
||||
debugFile.file << "\n\t";
|
||||
free(funcNames);
|
||||
}
|
||||
#endif
|
||||
|
||||
return debugFile.file;
|
||||
}
|
||||
return nullStream;
|
||||
}
|
||||
|
||||
// Non Debug Only {{{1
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#else // If NOT defined ENABLE_LOGGING
|
||||
|
||||
|
||||
DebugVoid dout(DebugLevel,DebugClass)
|
||||
{ return DebugVoid(); }
|
||||
|
||||
#endif // END If NOT defined ENABLE_LOGGING
|
||||
|
||||
// vim:tw=72:sw=1:fdm=marker:fdl=0:
|
||||
@@ -0,0 +1,105 @@
|
||||
#ifndef DEBUG_H_1YCYLZSS
|
||||
#define DEBUG_H_1YCYLZSS
|
||||
|
||||
// Includes {{{1
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#include <iostream>
|
||||
#include <vector>
|
||||
#include <fstream>
|
||||
|
||||
// Enumerations {{{1
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
enum DebugLevel
|
||||
{
|
||||
D_INFO = 1,
|
||||
D_WARNING = 1<<2,
|
||||
D_ERROR = 1<<3,
|
||||
D_PEDANTIC_INFO = 1<<4,
|
||||
|
||||
DL_ALL = (1<<5)-1
|
||||
};
|
||||
|
||||
enum DebugClass
|
||||
{
|
||||
D_MAIN = 1,
|
||||
D_MAP = 1<<2,
|
||||
D_MAP_GEN = 1<<3,
|
||||
D_GAME = 1<<4,
|
||||
D_NPC = 1<<5,
|
||||
|
||||
DC_ALL = (1<<6)-1
|
||||
};
|
||||
|
||||
void setupDebug();
|
||||
|
||||
// Function Declatations {{{1
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
void limitDebugLevel( int );
|
||||
void limitDebugClass( int );
|
||||
|
||||
// Debug Only {{{1
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
#ifdef ENABLE_LOGGING
|
||||
std::ostream & dout(DebugLevel=DL_ALL,DebugClass=DC_ALL);
|
||||
#else // if NOT defined ENABLE_LOGGING
|
||||
|
||||
// Non debug only {{{1
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
struct DebugVoid {};
|
||||
template<class T>
|
||||
DebugVoid operator<< ( const DebugVoid & dv, const T & )
|
||||
{ return dv; }
|
||||
DebugVoid dout(DebugLevel=DL_ALL,DebugClass=DC_ALL);
|
||||
|
||||
#endif // END if NOT defined ENABLE_LOGGING
|
||||
|
||||
// OStream operators {{{1
|
||||
// ---------------------------------------------------------------------
|
||||
|
||||
template<typename C, typename A>
|
||||
std::ostream & operator<<(std::ostream & out, const std::vector<C,A> & elm)
|
||||
{
|
||||
bool first = true;
|
||||
for( typename std::vector<C>::const_iterator
|
||||
it = elm.begin(),
|
||||
end = elm.end();
|
||||
it != end; ++it )
|
||||
{
|
||||
if( first )
|
||||
first = false;
|
||||
else
|
||||
out << ",";
|
||||
out << *it;
|
||||
}
|
||||
|
||||
return out;
|
||||
}
|
||||
|
||||
struct DebugLog
|
||||
{
|
||||
DebugLog() {
|
||||
fout.open("logg.txt", std::ios_base::app | std::ios_base::out);
|
||||
}
|
||||
~DebugLog() {
|
||||
fout.close();
|
||||
}
|
||||
|
||||
template <class T>
|
||||
DebugLog& operator<<(T& t) {
|
||||
fout << t;
|
||||
return *this;
|
||||
}
|
||||
|
||||
private:
|
||||
std::ofstream fout;
|
||||
};
|
||||
|
||||
|
||||
|
||||
// vim:tw=72:sw=1:fdm=marker:fdl=0:
|
||||
#endif /* end of include guard: DEBUG_H_1YCYLZSS */
|
||||
+1313
File diff suppressed because it is too large
Load Diff
+343
-31
@@ -1,3 +1,6 @@
|
||||
#ifndef _DIALOGUE_H_
|
||||
#define _DIALOGUE_H_
|
||||
|
||||
#include "player.h"
|
||||
#include "output.h"
|
||||
#include "npc.h"
|
||||
@@ -10,51 +13,159 @@ struct dialogue {
|
||||
WINDOW *win;
|
||||
bool done;
|
||||
std::vector<std::string> history;
|
||||
std::vector<talk_topic> topic_stack;
|
||||
|
||||
int opt(std::string challenge, ...);
|
||||
talk_topic opt(talk_topic topic, game *g);
|
||||
|
||||
dialogue()
|
||||
{
|
||||
alpha = NULL;
|
||||
beta = NULL;
|
||||
win = NULL;
|
||||
done = false;
|
||||
}
|
||||
};
|
||||
|
||||
std::string talk_okay[10] = {
|
||||
"okay", "get it", "you dig", "dig", "got it", "you see", "see, <name_g>",
|
||||
"savvy", "that clear"};
|
||||
struct talk_function
|
||||
{
|
||||
void nothing (game *g, npc *p) {};
|
||||
void assign_mission (game *g, npc *p);
|
||||
void mission_success (game *g, npc *p);
|
||||
void mission_failure (game *g, npc *p);
|
||||
void clear_mission (game *g, npc *p);
|
||||
void mission_reward (game *g, npc *p);
|
||||
void mission_favor (game *g, npc *p);
|
||||
void give_equipment (game *g, npc *p);
|
||||
void start_trade (game *g, npc *p);
|
||||
void assign_base(game *g, npc *p);
|
||||
void follow (game *g, npc *p); // p follows u
|
||||
void deny_follow (game *g, npc *p); // p gets DI_ASKED_TO_FOLLOW
|
||||
void deny_lead (game *g, npc *p); // p gets DI_ASKED_TO_LEAD
|
||||
void deny_equipment (game *g, npc *p); // p gets DI_ASKED_FOR_ITEM
|
||||
void enslave (game *g, npc *p) {}; // p becomes slave of u
|
||||
void hostile (game *g, npc *p); // p turns hostile to u
|
||||
void flee (game *g, npc *p);
|
||||
void leave (game *g, npc *p); // p becomes indifferant
|
||||
|
||||
std::string talk_bad_names[10] = {
|
||||
"punk", "bitch", "mark", "asshole", "fucker",
|
||||
"sucker", "fuckwad", "fuckface", "motherfucker", "shithead"};
|
||||
void start_mugging (game *g, npc *p);
|
||||
void player_leaving (game *g, npc *p);
|
||||
|
||||
std::string talk_good_names[10] = {
|
||||
"stranger", "friend", "pilgrim", "traveler", "pal",
|
||||
"fella", "you", "dude", "buddy", "man"};
|
||||
void drop_weapon (game *g, npc *p);
|
||||
void player_weapon_away (game *g, npc *p);
|
||||
void player_weapon_drop (game *g, npc *p);
|
||||
|
||||
std::string talk_greeting_gen[10] = {
|
||||
"Hey <name_g>.", "Greetings <name_g>.", "Hi <name_g><punc> You okay?",
|
||||
"<name_g><punc> Let's talk.", "Well hey there.",
|
||||
"<name_g><punc> Hello.", "What's up, <name_g>?", "You okay, <name_g>?",
|
||||
"Hello, <name_g>.", "Hi <name_g>"};
|
||||
void lead_to_safety (game *g, npc *p);
|
||||
void start_training (game *g, npc *p);
|
||||
|
||||
std::string ill_die[10] = {
|
||||
"I'm not gonna last much longer", "I'll be dead soon", "I'll be a goner",
|
||||
"I'm dead, <name_g>,", "I'm dead meat", "I'm in serious trouble", "I'm doomed",
|
||||
"I'm done for", "I won't last much longer", "my days are numbered"};
|
||||
void toggle_use_guns (game *g, npc *p);
|
||||
void toggle_use_silent (game *g, npc *p);
|
||||
void toggle_use_grenades (game *g, npc *p);
|
||||
void set_engagement_none (game *g, npc *p);
|
||||
void set_engagement_close (game *g, npc *p);
|
||||
void set_engagement_weak (game *g, npc *p);
|
||||
void set_engagement_hit (game *g, npc *p);
|
||||
void set_engagement_all (game *g, npc *p);
|
||||
};
|
||||
|
||||
enum talk_trial
|
||||
{
|
||||
TALK_TRIAL_NONE, // No challenge here!
|
||||
TALK_TRIAL_LIE, // Straight up lying
|
||||
TALK_TRIAL_PERSUADE, // Convince them
|
||||
TALK_TRIAL_INTIMIDATE, // Physical intimidation
|
||||
NUM_TALK_TRIALS
|
||||
};
|
||||
|
||||
std::string talk_trial_text[NUM_TALK_TRIALS] = {
|
||||
"", "LIE", "PERSUADE", "INTIMIDATE"
|
||||
};
|
||||
|
||||
struct talk_response
|
||||
{
|
||||
std::string text;
|
||||
talk_trial trial;
|
||||
int difficulty;
|
||||
int mission_index;
|
||||
mission_id miss; // If it generates a new mission
|
||||
int tempvalue; // Used for various stuff
|
||||
npc_opinion opinion_success;
|
||||
npc_opinion opinion_failure;
|
||||
void (talk_function::*effect_success)(game *, npc *);
|
||||
void (talk_function::*effect_failure)(game *, npc *);
|
||||
talk_topic success;
|
||||
talk_topic failure;
|
||||
|
||||
talk_response()
|
||||
{
|
||||
text = "";
|
||||
trial = TALK_TRIAL_NONE;
|
||||
difficulty = 0;
|
||||
mission_index = -1;
|
||||
miss = MISSION_NULL;
|
||||
tempvalue = -1;
|
||||
effect_success = &talk_function::nothing;
|
||||
effect_failure = &talk_function::nothing;
|
||||
opinion_success = npc_opinion();
|
||||
opinion_failure = npc_opinion();
|
||||
success = TALK_NONE;
|
||||
failure = TALK_NONE;
|
||||
}
|
||||
|
||||
talk_response(const talk_response &rhs)
|
||||
{
|
||||
text = rhs.text;
|
||||
trial = rhs.trial;
|
||||
difficulty = rhs.difficulty;
|
||||
mission_index = rhs.mission_index;
|
||||
miss = rhs.miss;
|
||||
tempvalue = rhs.tempvalue;
|
||||
effect_success = rhs.effect_success;
|
||||
effect_failure = rhs.effect_failure;
|
||||
opinion_success = rhs.opinion_success;
|
||||
opinion_failure = rhs.opinion_failure;
|
||||
success = rhs.success;
|
||||
failure = rhs.failure;
|
||||
}
|
||||
};
|
||||
|
||||
struct talk_response_list
|
||||
{
|
||||
std::vector<talk_response> none(game *g, npc *p);
|
||||
std::vector<talk_response> shelter(game *g, npc *p);
|
||||
std::vector<talk_response> shopkeep(game *g, npc *p);
|
||||
};
|
||||
|
||||
/* There is a array of tag_data, "tags", at the bottom of this file.
|
||||
* It maps tags to the array of string replacements;
|
||||
* e.g. "<name_g>" => talk_good_names
|
||||
* Other tags, like "<yrwp>", are mapped to dynamic things
|
||||
* (like the player's weapon), and are defined in parse_tags() (npctalk.cpp)
|
||||
*/
|
||||
struct tag_data
|
||||
{
|
||||
std::string tag;
|
||||
std::string (*replacement)[10];
|
||||
};
|
||||
|
||||
std::string talk_needs[num_needs][5] = {
|
||||
{"", "", "", "", ""},
|
||||
{"Hey<punc> You got any <ammo>?", "I'll need some <ammo> soon, got any?",
|
||||
"I really need some <ammo><punc>", "I need <ammo> for my <mywp>, got any?",
|
||||
"I need some <ammo> bad<punc>"},
|
||||
"I need some <ammo> <very> bad<punc>"},
|
||||
{"Got anything I can use as a weapon?",
|
||||
"<ill_die> without a good weapon<punc>",
|
||||
"I'm sick of fighting with my <mywp>, got something better?",
|
||||
"I'm sick of fighting with my <swear> <mywp>, got something better?",
|
||||
"Hey <name_g>, care to sell me a weapon?",
|
||||
"My <mywp> just won't cut it, I need a real weapon..."},
|
||||
{"Hey <name_g>, I could really use a gun.",
|
||||
"Hey, you got a spare gun? It'd be better than my <mywp><punc>",
|
||||
"Hey, you got a spare gun? It'd be better than my <swear> <mywp><punc>",
|
||||
"<ill_die> if I don't find a gun soon!",
|
||||
"<name_g><punc> Feel like selling me a gun?",
|
||||
"I need a gun, any kind will do!"},
|
||||
{"I could use some food, here.", "I need some food, real bad!",
|
||||
"Man, am I glad to see you! Got any food to trade?",
|
||||
"<ill_die> unless I get some food in me... got any?",
|
||||
{"I could use some food, here.", "I need some food, <very> bad!",
|
||||
"Man, am I <happy> to see you! Got any food to trade?",
|
||||
"<ill_die> unless I get some food in me<punc> <okay>?",
|
||||
"Please tell me you have some food to trade!"},
|
||||
{"Got anything to drink?", "I need some water or something.",
|
||||
"<name_g>, I need some water... got any?",
|
||||
@@ -66,21 +177,83 @@ std::string talk_needs[num_needs][5] = {
|
||||
*/
|
||||
};
|
||||
|
||||
std::string talk_drop_weap[10] = {
|
||||
"Drop your weapon!",
|
||||
std::string talk_okay[10] = {
|
||||
"okay", "get it", "you dig", "dig", "got it", "you see", "see, <name_g>",
|
||||
"alright", "that clear"};
|
||||
|
||||
std::string talk_no[10] = {
|
||||
"no", "fuck no", "hell no", "no way", "not a chance",
|
||||
"I don't think so", "no way in hell", "nuh uh", "nope", "fat chance"};
|
||||
|
||||
std::string talk_bad_names[10] = {
|
||||
"punk", "bitch", "dickhead", "asshole", "fucker",
|
||||
"sucker", "fuckwad", "cocksucker", "motherfucker", "shithead"};
|
||||
|
||||
std::string talk_good_names[10] = {
|
||||
"stranger", "friend", "pilgrim", "traveler", "pal",
|
||||
"fella", "you", "dude", "buddy", "man"};
|
||||
|
||||
std::string talk_swear[10] = { // e.g. "drop the <swear> weapon"
|
||||
"fucking", "goddamn", "motherfucking", "freaking", "damn", "<swear> <swear>",
|
||||
"fucking", "fuckin'", "god damn", "mafuckin'"};
|
||||
|
||||
std::string talk_swear_interjection[10] = {
|
||||
"fuck", "damn", "damnit", "shit", "cocksucker", "crap",
|
||||
"motherfucker", "<swear><punc> <swear!>", "<very> <swear!>", "son of a bitch"};
|
||||
|
||||
std::string talk_fuck_you[10] = {
|
||||
"fuck you", "fuck off", "go fuck yourself", "<fuck_you>, <name_b>",
|
||||
"<fuck_you>, <swear> <name_b>", "<name_b>", "<swear> <name_b>",
|
||||
"fuck you", "fuck off", "go fuck yourself"};
|
||||
|
||||
std::string talk_very[10] = { // Synonyms for "very" -- applied to adjectives
|
||||
"really", "fucking", "super", "wicked", "very", "mega", "uber", "ultra",
|
||||
"so <very>", "<very> <very>"};
|
||||
|
||||
std::string talk_really[10] = { // Synonyms for "really" -- applied to verbs
|
||||
"really", "fucking", "absolutely", "definitely", "for real", "honestly",
|
||||
"<really> <really>", "most <really>", "urgently", "REALLY"};
|
||||
|
||||
std::string talk_happy[10] = {
|
||||
"glad", "happy", "overjoyed", "ecstatic", "thrilled", "stoked",
|
||||
"<very> <happy>", "tickled pink", "delighted", "pumped"};
|
||||
|
||||
std::string talk_sad[10] = {
|
||||
"sad", "bummed", "depressed", "pissed", "unhappy", "<very> <sad>", "dejected",
|
||||
"down", "blue", "glum"};
|
||||
|
||||
std::string talk_greeting_gen[10] = {
|
||||
"Hey <name_g>.", "Greetings <name_g>.", "Hi <name_g><punc> You okay?",
|
||||
"<name_g><punc> Let's talk.", "Well hey there.",
|
||||
"<name_g><punc> Hello.", "What's up, <name_g>?", "You okay, <name_g>?",
|
||||
"Hello, <name_g>.", "Hi <name_g>"};
|
||||
|
||||
std::string talk_ill_die[10] = {
|
||||
"I'm not gonna last much longer", "I'll be dead soon", "I'll be a goner",
|
||||
"I'm dead, <name_g>,", "I'm dead meat", "I'm in <very> serious trouble",
|
||||
"I'm <very> doomed", "I'm done for", "I won't last much longer",
|
||||
"my days are <really> numbered"};
|
||||
|
||||
std::string talk_ill_kill_you[10] = {
|
||||
"I'll kill you", "you're dead", "I'll <swear> kill you", "you're dead meat",
|
||||
"<ill_kill_you>, <name_b>", "you're a dead <man>", "you'll taste my <mywp>",
|
||||
"you're <swear> dead", "<name_b>, <ill_kill_you>"};
|
||||
|
||||
std::string talk_drop_weapon[10] = {
|
||||
"Drop your <swear> weapon!",
|
||||
"Okay <name_b>, drop your weapon!",
|
||||
"Put your weapon down!",
|
||||
"Put your <swear> weapon down!",
|
||||
"Drop the <yrwp>, <name_b>!",
|
||||
"Drop the <yrwp>!",
|
||||
"Drop the <swear> <yrwp>!",
|
||||
"Drop your <yrwp>!",
|
||||
"Put down the <yrwp>!",
|
||||
"Drop your weapon, <name_b>!",
|
||||
"Drop your <swear> weapon, <name_b>!",
|
||||
"Put down your <yrwp>!",
|
||||
"Alright, drop the <yrwp>!"
|
||||
};
|
||||
|
||||
std::string talk_hands_up[10] = {
|
||||
"Put your hands up!",
|
||||
"Put your <swear> hands up!",
|
||||
"Put your hands up, <name_b>!",
|
||||
"Reach for the sky!",
|
||||
"Hands up!",
|
||||
@@ -102,5 +275,144 @@ std::string talk_no_faction[10] = {
|
||||
"I'm a free agent, more money that way.",
|
||||
"I prefer to work uninhibited by that kind of connection.",
|
||||
"I haven't found one that's good enough for me.",
|
||||
"I don't belong to a faction, <name_g>"
|
||||
"I don't belong to a faction, <name_g>."
|
||||
};
|
||||
|
||||
std::string talk_come_here[10] = {
|
||||
"Wait up, let's talk!",
|
||||
"Hey, I <really> want to talk to you!",
|
||||
"Come on, talk to me!",
|
||||
"Hey <name_g>, let's talk!",
|
||||
"<name_g>, we <really> need to talk!",
|
||||
"Hey, we should talk, <okay>?",
|
||||
"<name_g>! Wait up!",
|
||||
"Wait up, <okay>?",
|
||||
"Let's talk, <name_g>!",
|
||||
"Look, <name_g><punc> let's talk!"
|
||||
};
|
||||
|
||||
std::string talk_keep_up[10] = {
|
||||
"Catch up!",
|
||||
"Get over here!",
|
||||
"Catch up, <name_g>!",
|
||||
"Keep up!",
|
||||
"Come on, <catch_up>!",
|
||||
|
||||
"Keep it moving!",
|
||||
"Stay with me!",
|
||||
"Keep close!",
|
||||
"Stay close!",
|
||||
"Let's keep going!"
|
||||
};
|
||||
|
||||
std::string talk_wait[10] = {
|
||||
"Hey, where are you?",
|
||||
"Wait up, <name_g>!",
|
||||
"<name_g>, wait for me!",
|
||||
"Hey, wait up, <okay>?",
|
||||
"You <really> need to wait for me!",
|
||||
"You <swear> need to wait!",
|
||||
"<name_g>, where are you?",
|
||||
"Hey <name_g><punc> Wait for me!",
|
||||
"Where are you?!",
|
||||
"Hey, I'm over here!"
|
||||
};
|
||||
|
||||
std::string talk_let_me_pass[10] = {
|
||||
"Excuse me, let me pass.",
|
||||
"Hey <name_g>, can I get through?",
|
||||
"Let me get past you, <name_g>.",
|
||||
"Let me through, <okay>?",
|
||||
"Can I get past you, <name_g>?",
|
||||
"I need to get past you, <name_g>.",
|
||||
"Move your <swear> ass, <name_b>!",
|
||||
"Out of my way, <name_b>!",
|
||||
"Move it, <name_g>!",
|
||||
"You need to move, <name_g>, <okay>?"
|
||||
};
|
||||
|
||||
// Used to tell player to move to avoid friendly fire
|
||||
std::string talk_move[10] = {
|
||||
"Move",
|
||||
"Move your ass",
|
||||
"Get out of the way",
|
||||
"You need to move"
|
||||
"Hey <name_g>, move",
|
||||
"<swear> move it",
|
||||
"Move your <swear> ass",
|
||||
"Get out of my way, <name_b>,",
|
||||
"Move to the side",
|
||||
"Get out of my line of fire"
|
||||
};
|
||||
|
||||
std::string talk_done_mugging[10] = {
|
||||
"Thanks for the cash, <name_b>!",
|
||||
"So long, <name_b>!",
|
||||
"Thanks a lot, <name_g>!",
|
||||
"Catch you later, <name_g>!",
|
||||
"See you later, <name_b>!",
|
||||
"See you in hell, <name_b>!",
|
||||
"Hasta luego, <name_g>!",
|
||||
"I'm outta here! <done_mugging>",
|
||||
"Bye bye, <name_b>!",
|
||||
"Thanks, <name_g>!"
|
||||
};
|
||||
|
||||
std::string talk_leaving[10] = {
|
||||
"So long, <name_b>!",
|
||||
"Hasta luego, <name_g>!",
|
||||
"I'm outta here!",
|
||||
"Bye bye, <name_b>!",
|
||||
"So long, <name_b>!",
|
||||
"Hasta luego, <name_g>!",
|
||||
"I'm outta here!",
|
||||
"Bye bye, <name_b>!",
|
||||
"I'm outta here!",
|
||||
"Bye bye, <name_b>!"
|
||||
};
|
||||
|
||||
std::string talk_catch_up[10] = {
|
||||
"You're too far away, <name_b>!",
|
||||
"Hurry up, <name_g>!",
|
||||
"I'm outta here soon!",
|
||||
"Come on molasses!",
|
||||
"What's taking so long?",
|
||||
"Get with the program laggard!",
|
||||
"Did the zombies get you?",
|
||||
"Wait up <name_b>!",
|
||||
"Did you evolve from a snail?",
|
||||
"How 'bout picking up the pace!"
|
||||
};
|
||||
|
||||
#define NUM_STATIC_TAGS 26
|
||||
|
||||
tag_data talk_tags[NUM_STATIC_TAGS] = {
|
||||
{"<okay>", &talk_okay},
|
||||
{"<no>", &talk_no},
|
||||
{"<name_b>", &talk_bad_names},
|
||||
{"<name_g>", &talk_good_names},
|
||||
{"<swear>", &talk_swear},
|
||||
{"<swear!>", &talk_swear_interjection},
|
||||
{"<fuck_you>", &talk_fuck_you},
|
||||
{"<very>", &talk_very},
|
||||
{"<really>", &talk_really},
|
||||
{"<happy>", &talk_happy},
|
||||
{"<sad>", &talk_sad},
|
||||
{"<greet>", &talk_greeting_gen},
|
||||
{"<ill_die>", &talk_ill_die},
|
||||
{"<ill_kill_you>", &talk_ill_kill_you},
|
||||
{"<drop_it>", &talk_drop_weapon},
|
||||
{"<hands_up>", &talk_hands_up},
|
||||
{"<no_faction>", &talk_no_faction},
|
||||
{"<come_here>", &talk_come_here},
|
||||
{"<keep_up>", &talk_keep_up},
|
||||
{"<lets_talk>", &talk_come_here},
|
||||
{"<wait>", &talk_wait},
|
||||
{"<let_me_pass>", &talk_let_me_pass},
|
||||
{"<move>", &talk_move},
|
||||
{"<done_mugging>", &talk_done_mugging},
|
||||
{"<catch_up>", &talk_catch_up},
|
||||
{"<im_leaving_you>", &talk_leaving}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+1686
File diff suppressed because it is too large
Load Diff
@@ -6,647 +6,18 @@
|
||||
#include "bodypart.h"
|
||||
#include <sstream>
|
||||
|
||||
#define MIN_DISEASE_AGE (-43200) // Permanent disease capped @ 3 days
|
||||
|
||||
struct game;
|
||||
|
||||
void dis_msg(game *g, dis_type type)
|
||||
{
|
||||
switch (type) {
|
||||
case DI_HEATSTROKE:
|
||||
g->add_msg("You have heatstroke!");
|
||||
break;
|
||||
case DI_FBFACE:
|
||||
g->add_msg("Your face is frostbitten.");
|
||||
break;
|
||||
case DI_FBHANDS:
|
||||
g->add_msg("Your hands are frostbitten.");
|
||||
break;
|
||||
case DI_FBFEET:
|
||||
g->add_msg("Your feet are frostbitten.");
|
||||
break;
|
||||
case DI_ONFIRE:
|
||||
g->add_msg("You're on fire!");
|
||||
break;
|
||||
case DI_SMOKE:
|
||||
g->add_msg("You inhale a lungful of thick smoke.");
|
||||
break;
|
||||
case DI_TEARGAS:
|
||||
g->add_msg("You inhale a lungful of tear gas.");
|
||||
break;
|
||||
case DI_BOOMERED:
|
||||
g->add_msg("You're covered in bile!");
|
||||
break;
|
||||
case DI_SPORES:
|
||||
g->add_msg("You're covered in tiny spores!");
|
||||
break;
|
||||
case DI_SLIMED:
|
||||
g->add_msg("You're covered in thick goo!");
|
||||
break;
|
||||
case DI_LYING_DOWN:
|
||||
g->add_msg("You lie down to go to sleep...");
|
||||
break;
|
||||
case DI_DRUNK:
|
||||
case DI_HIGH:
|
||||
g->add_msg("You feel lightheaded.");
|
||||
break;
|
||||
case DI_ADRENALINE:
|
||||
g->add_msg("You feel a surge of adrenaline!");
|
||||
g->u.moves += 800;
|
||||
break;
|
||||
case DI_ASTHMA:
|
||||
g->add_msg("You can't breathe... asthma attack!");
|
||||
break;
|
||||
case DI_BLIND:
|
||||
g->add_msg("You're blinded!");
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void dis_effect(game *g, player &p, disease &dis)
|
||||
{
|
||||
int bonus;
|
||||
int junk;
|
||||
switch (dis.type) {
|
||||
case DI_HEATSTROKE:
|
||||
p.moves -= 15;
|
||||
p.str_cur -= 2;
|
||||
p.per_cur -= 1;
|
||||
p.int_cur -= 2;
|
||||
break;
|
||||
case DI_FBFACE:
|
||||
p.per_cur -= 2;
|
||||
break;
|
||||
case DI_FBHANDS:
|
||||
p.dex_cur -= 4;
|
||||
break;
|
||||
case DI_FBFEET:
|
||||
p.moves -= 40;
|
||||
p.str_cur -= 1;
|
||||
break;
|
||||
case DI_SMOKE:
|
||||
p.str_cur--;
|
||||
p.dex_cur--;
|
||||
if (one_in(5)) {
|
||||
if (!p.is_npc()) {
|
||||
g->add_msg("You cough heavily.");
|
||||
g->sound(p.posx, p.posy, 12, "");
|
||||
} else
|
||||
g->sound(p.posx, p.posy, 12, "a hacking cough.");
|
||||
p.moves -= 80;
|
||||
p.hurt(g, bp_torso, 0, 1 - (rng(0, 1) * rng(0, 1)));
|
||||
}
|
||||
break;
|
||||
case DI_TEARGAS:
|
||||
p.str_cur -= 2;
|
||||
p.dex_cur -= 2;
|
||||
p.int_cur -= 1;
|
||||
p.per_cur -= 4;
|
||||
if (one_in(3)) {
|
||||
if (!p.is_npc()) {
|
||||
g->add_msg("You cough heavily.");
|
||||
g->sound(p.posx, p.posy, 12, "");
|
||||
} else
|
||||
g->sound(p.posx, p.posy, 12, "a hacking cough");
|
||||
p.moves -= 100;
|
||||
p.hurt(g, bp_torso, 0, rng(0, 3) * rng(0, 1));
|
||||
}
|
||||
break;
|
||||
case DI_ONFIRE:
|
||||
p.hurtall(3);
|
||||
for (int i = 0; i < p.worn.size(); i++) {
|
||||
if (p.worn[i].made_of(VEGGY) || p.worn[i].made_of(PAPER) ||
|
||||
p.worn[i].made_of(PAPER)) {
|
||||
p.worn.erase(p.worn.begin() + i);
|
||||
i--;
|
||||
} else if ((p.worn[i].made_of(COTTON) || p.worn[i].made_of(WOOL)) &&
|
||||
one_in(10)) {
|
||||
p.worn.erase(p.worn.begin() + i);
|
||||
i--;
|
||||
} else if (p.worn[i].made_of(PLASTIC) && one_in(50)) {
|
||||
p.worn.erase(p.worn.begin() + i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DI_BOOMERED:
|
||||
p.per_cur -= 5;
|
||||
break;
|
||||
case DI_SPORES:
|
||||
p.moves -= 40;
|
||||
if (one_in(30))
|
||||
p.add_disease(DI_FUNGUS, -1, g);
|
||||
break;
|
||||
case DI_FUNGUS:
|
||||
bonus = 0;
|
||||
if (p.has_trait(PF_POISRESIST))
|
||||
bonus = 100;
|
||||
p.moves -= 10;
|
||||
p.str_cur -= 1;
|
||||
p.dex_cur -= 1;
|
||||
if (dis.duration > -600) { // First hour symptoms
|
||||
if (one_in(160 + bonus)) {
|
||||
if (!p.is_npc()) {
|
||||
g->add_msg("You cough heavily.");
|
||||
g->sound(p.posx, p.posy, 12, "");
|
||||
} else
|
||||
g->sound(p.posx, p.posy, 12, "a hacking cough");
|
||||
p.pain++;
|
||||
}
|
||||
if (one_in(100 + bonus)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You feel nauseous.");
|
||||
}
|
||||
if (one_in(100 + bonus)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You smell and taste mushrooms.");
|
||||
}
|
||||
} else if (dis.duration > -3600) { // One to six hours
|
||||
if (one_in(600 + bonus * 3)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You spasm suddenly!");
|
||||
p.moves = 0;
|
||||
p.hurt(g, bp_torso, 0, 5);
|
||||
}
|
||||
if ((p.has_trait(PF_WEAKSTOMACH) && one_in(1600 + bonus * 8)) ||
|
||||
one_in(2000 + bonus * 10)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You vomit a thick, gray goop.");
|
||||
else if (g->u_see(p.posx, p.posy, junk))
|
||||
g->add_msg("%s vomits a thick, gray goop.", p.name.c_str());
|
||||
p.moves = -200;
|
||||
p.hunger += 50;
|
||||
p.thirst += 68;
|
||||
}
|
||||
} else { // Full symptoms
|
||||
if (one_in(1000 + bonus * 8)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You double over, spewing live spores from your mouth!");
|
||||
else if (g->u_see(p.posx, p.posy, junk))
|
||||
g->add_msg("%s coughs up a stream of live spores!", p.name.c_str());
|
||||
p.moves = -500;
|
||||
int sporex, sporey;
|
||||
monster spore(g->mtypes[mon_spore]);
|
||||
for (int i = -1; i <= 1; i++) {
|
||||
for (int j = -1; j <= 1; j++) {
|
||||
sporex = p.posx + i;
|
||||
sporey = p.posy + j;
|
||||
if (g->m.move_cost(sporex, sporey) > 0 && one_in(5)) {
|
||||
if (g->mon_at(sporex, sporey) >= 0) { // Spores hit a monster
|
||||
if (g->u_see(sporex, sporey, junk))
|
||||
g->add_msg("The %s is covered in tiny spores!",
|
||||
g->z[g->mon_at(sporex, sporey)].name().c_str());
|
||||
if (!g->z[g->mon_at(sporex, sporey)].make_fungus(g))
|
||||
g->kill_mon(g->mon_at(sporex, sporey));
|
||||
} else {
|
||||
spore.spawn(sporex, sporey);
|
||||
g->z.push_back(spore);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (one_in(6000 + bonus * 20)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("Fungus stalks burst through your hands!");
|
||||
else if (g->u_see(p.posx, p.posy, junk))
|
||||
g->add_msg("Fungus stalks burst through %s's hands!", p.name.c_str());
|
||||
p.hurt(g, bp_arms, 0, 60);
|
||||
p.hurt(g, bp_arms, 1, 60);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DI_SLIMED:
|
||||
p.moves -= 30;
|
||||
if (p.moves < 1)
|
||||
p.moves = 1;
|
||||
p.dex_cur -= 2;
|
||||
break;
|
||||
case DI_LYING_DOWN:
|
||||
p.moves = 0;
|
||||
if (p.can_sleep(g)) {
|
||||
dis.duration = 1;
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You fall asleep.");
|
||||
p.add_disease(DI_SLEEP, 6000, g);
|
||||
}
|
||||
if (dis.duration == 1 && !p.has_disease(DI_SLEEP))
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You try to sleep, but can't...");
|
||||
break;
|
||||
case DI_SLEEP:
|
||||
p.moves = 0;
|
||||
if (g->turn % 25 == 0) {
|
||||
if (p.fatigue > 0)
|
||||
p.fatigue -= rng(1, 2);
|
||||
if (p.has_trait(PF_FASTHEALER) && one_in(2))
|
||||
p.healall(rng(0, 1)); // Sum chance of 1/4, PLUS normal rate
|
||||
else
|
||||
p.healall(rng(0, 1) * rng(0, 1) * rng(0, 1));
|
||||
if (p.fatigue <= 0 && p.fatigue > -20) {
|
||||
p.fatigue = -25;
|
||||
g->add_msg("Fully rested.");
|
||||
dis.duration = dice(3, 100);
|
||||
}
|
||||
}
|
||||
if (g->turn % 100 == 0) {
|
||||
// Hunger and thirst advance more slowly while we sleep.
|
||||
p.hunger--;
|
||||
p.thirst--;
|
||||
}
|
||||
if (rng(2, 80) + rng(0, 100) + rng(0, 120) + rng(0, p.fatigue) <
|
||||
g->light_level() && (one_in(p.fatigue / 10) || p.fatigue < 10)) {
|
||||
g->add_msg("The light wakes you up.");
|
||||
dis.duration = 1;
|
||||
}
|
||||
break;
|
||||
case DI_PKILL1:
|
||||
if (dis.duration <= 70 && dis.duration % 7 == 0 && p.pkill < 35)
|
||||
p.pkill++;
|
||||
break;
|
||||
case DI_PKILL2:
|
||||
if (dis.duration % 7 == 0 &&
|
||||
(one_in(p.addiction_level(ADD_PKILLER)) ||
|
||||
one_in(p.addiction_level(ADD_PKILLER)) ))
|
||||
p.pkill += 2;
|
||||
break;
|
||||
case DI_PKILL3:
|
||||
if (dis.duration % 2 == 0 &&
|
||||
(one_in(p.addiction_level(ADD_PKILLER)) ||
|
||||
one_in(p.addiction_level(ADD_PKILLER)) ))
|
||||
p.pkill++;
|
||||
break;
|
||||
case DI_PKILL_L:
|
||||
if (dis.duration % 20 == 0 && p.pkill < 49 &&
|
||||
(one_in(p.addiction_level(ADD_PKILLER)) ||
|
||||
one_in(p.addiction_level(ADD_PKILLER)) ))
|
||||
p.pkill++;
|
||||
break;
|
||||
case DI_TOOK_XANAX:
|
||||
if (dis.duration % 25 == 0 && (p.stim > 0 || one_in(2)))
|
||||
p.stim--;
|
||||
break;
|
||||
case DI_DRUNK:
|
||||
// We get 600 turns, or one hour, of DI_DRUNK for each drink we have (on avg)
|
||||
// So, the duration of DI_DRUNK is a good indicator of how much alcohol is in
|
||||
// our system.
|
||||
p.per_cur -= int(dis.duration / 800);
|
||||
p.dex_cur -= int(dis.duration / 800);
|
||||
p.int_cur -= int(dis.duration / 800);
|
||||
p.str_cur -= int(dis.duration / 1000);
|
||||
if (dis.duration <= 600)
|
||||
p.str_cur += 1;
|
||||
if (dis.duration > 2000 + 100 * dice(2, 100) &&
|
||||
(p.has_trait(PF_WEAKSTOMACH) || one_in(20)))
|
||||
p.vomit(g);
|
||||
if (!p.has_disease(DI_SLEEP) && dis.duration >= 4500 &&
|
||||
one_in(500 - int(dis.duration / 80))) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You pass out.");
|
||||
p.add_disease(DI_SLEEP, dis.duration / 2, g);
|
||||
}
|
||||
break;
|
||||
case DI_CIG:
|
||||
if (dis.duration >= 200) { // Smoked too much
|
||||
p.str_cur -= 1;
|
||||
p.dex_cur -= 1;
|
||||
if (dis.duration >= 500 && (one_in(50) ||
|
||||
one_in(20) && p.has_trait(PF_WEAKSTOMACH)))
|
||||
p.vomit(g);
|
||||
} else {
|
||||
p.dex_cur++;
|
||||
p.int_cur++;
|
||||
p.per_cur++;
|
||||
}
|
||||
break;
|
||||
case DI_HIGH:
|
||||
p.dex_cur--;
|
||||
p.int_cur--;
|
||||
p.per_cur--;
|
||||
break;
|
||||
case DI_POISON:
|
||||
if ((!p.has_trait(PF_POISRESIST) && one_in(150)) ||
|
||||
( p.has_trait(PF_POISRESIST) && one_in(900)) ) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You're suddenly wracked with pain!");
|
||||
p.pain += 2;
|
||||
p.hurt(g, bp_torso, 0, rng(0, 2) * rng(0, 1));
|
||||
}
|
||||
p.per_cur--;
|
||||
p.dex_cur--;
|
||||
if (!p.has_trait(PF_POISRESIST))
|
||||
p.str_cur -= 2;
|
||||
break;
|
||||
case DI_FOODPOISON:
|
||||
bonus = 0;
|
||||
if (p.has_trait(PF_POISRESIST))
|
||||
bonus = 600;
|
||||
if (one_in(300 + bonus)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You're suddenly wracked with pain and nausea!");
|
||||
p.pain += 2;
|
||||
p.hurt(g, bp_torso, 0, 2);
|
||||
}
|
||||
if ((p.has_trait(PF_WEAKSTOMACH) && one_in(350 + bonus)) ||
|
||||
one_in(900 + bonus))
|
||||
p.vomit(g);
|
||||
p.moves -= 35;
|
||||
p.str_cur -= 3;
|
||||
p.dex_cur--;
|
||||
p.per_cur--;
|
||||
if (p.has_trait(PF_POISRESIST)) {
|
||||
p.moves += 15;
|
||||
p.str_cur += 2;
|
||||
}
|
||||
break;
|
||||
case DI_SHAKES:
|
||||
p.dex_cur -= 4;
|
||||
p.str_cur--;
|
||||
break;
|
||||
case DI_HALLU:
|
||||
// This assumes that we were given DI_HALLU with a 3600 (6-hour) lifespan
|
||||
if (dis.duration > 3000) { // First hour symptoms
|
||||
if (one_in(300)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You feel a little strange.");
|
||||
}
|
||||
} else if (dis.duration > 2400) { // Coming up
|
||||
if (one_in(100) || (p.has_trait(PF_WEAKSTOMACH) && one_in(100))) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You feel nauseous.");
|
||||
p.hunger -= 5;
|
||||
}
|
||||
if (!p.is_npc()) {
|
||||
if (one_in(200))
|
||||
g->add_msg("Huh? What was that?");
|
||||
else if (one_in(200))
|
||||
g->add_msg("Oh god, what's happening?");
|
||||
else if (one_in(200))
|
||||
g->add_msg("Of course... it's all fractals!");
|
||||
}
|
||||
} else if (dis.duration == 2400) // Visuals start
|
||||
p.add_disease(DI_VISUALS, 2400, g);
|
||||
else { // Full symptoms
|
||||
p.per_cur -= 2;
|
||||
p.int_cur -= 1;
|
||||
p.dex_cur -= 2;
|
||||
p.str_cur -= 1;
|
||||
if (one_in(50)) { // Generate phantasm
|
||||
monster phantasm(g->mtypes[mon_hallu_zom + rng(0, 3)]);
|
||||
phantasm.spawn(p.posx + rng(-10, 10), p.posy + rng(-10, 10));
|
||||
g->z.push_back(phantasm);
|
||||
}
|
||||
}
|
||||
break;
|
||||
case DI_ADRENALINE:
|
||||
if (dis.duration > 400) { // 20 minutes positive effects
|
||||
p.moves += rng(40, 100);
|
||||
p.str_cur += 5;
|
||||
p.dex_cur += 3;
|
||||
p.int_cur -= 8;
|
||||
p.per_cur += 1;
|
||||
} else if (dis.duration == 400) { // 40 minutes come-down
|
||||
if (!p.is_npc())
|
||||
g->add_msg("Your adrenaline rush wears off. You feel AWFUL!");
|
||||
p.moves -= 300;
|
||||
} else {
|
||||
p.str_cur -= 2;
|
||||
p.dex_cur -= 1;
|
||||
p.int_cur -= 1;
|
||||
p.per_cur -= 1;
|
||||
}
|
||||
break;
|
||||
case DI_ASTHMA:
|
||||
if (dis.duration > 1200) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("Your asthma overcomes you. You stop breathing and die...");
|
||||
p.hurtall(500);
|
||||
}
|
||||
p.moves -= dis.duration / 5;
|
||||
p.str_cur -= 2;
|
||||
p.dex_cur -= 3;
|
||||
break;
|
||||
case DI_METH:
|
||||
if (dis.duration > 600) {
|
||||
p.str_cur += 2;
|
||||
p.dex_cur += 2;
|
||||
p.int_cur += 2;
|
||||
p.per_cur += 2;
|
||||
p.moves += 50;
|
||||
} else {
|
||||
p.str_cur -= 3;
|
||||
p.dex_cur -= 2;
|
||||
p.int_cur -= 1;
|
||||
p.moves -= 40;
|
||||
}
|
||||
break;
|
||||
case DI_TELEGLOW:
|
||||
// Default we get around 300 duration points per teleport (possibly more
|
||||
// depending on the source).
|
||||
// TODO: Include a chance to teleport to the nether realm.
|
||||
if (dis.duration > 6000) { // 20 teles (no decay; in practice at least 21)
|
||||
if (one_in(1000 - ((dis.duration - 6000) / 10))) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("Glowing lights surround you, and you teleport.");
|
||||
g->teleport();
|
||||
if (one_in(4))
|
||||
p.rem_disease(DI_TELEGLOW);
|
||||
}
|
||||
if (one_in(1200 - ((dis.duration - 6000) / 5)) && one_in(20)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You pass out.");
|
||||
p.add_disease(DI_SLEEP, 1200, g);
|
||||
if (one_in(6))
|
||||
p.rem_disease(DI_TELEGLOW);
|
||||
}
|
||||
}
|
||||
if (dis.duration > 3600) { // 12 teles
|
||||
if (one_in(4000 - int(.25 * (dis.duration - 3600)))) {
|
||||
int range = g->moncats[mcat_nether].size();
|
||||
mon_id type = (g->moncats[mcat_nether])[rng(0, range - 1)];
|
||||
monster beast(g->mtypes[type]);
|
||||
int x, y, tries = 0;
|
||||
do {
|
||||
x = p.posx + rng(-4, 4);
|
||||
y = p.posy + rng(-4, 4);
|
||||
} while ((x == p.posx && y == p.posy) || g->mon_at(x, y) != -1);
|
||||
if (g->m.move_cost(x, y) == 0)
|
||||
g->m.ter(x, y) = t_rubble;
|
||||
beast.spawn(x, y);
|
||||
g->z.push_back(beast);
|
||||
if (g->u_see(x, y, junk))
|
||||
g->add_msg("A portal opens nearby, and a monster crawls through!");
|
||||
if (one_in(2))
|
||||
p.rem_disease(DI_TELEGLOW);
|
||||
}
|
||||
if (one_in(3500 - int(.25 * (dis.duration - 3600)))) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You shudder suddenly.");
|
||||
p.mutate(g);
|
||||
if (one_in(4))
|
||||
p.rem_disease(DI_TELEGLOW);
|
||||
}
|
||||
}
|
||||
if (dis.duration > 2400) { // 8 teleports
|
||||
if (one_in(10000 - dis.duration))
|
||||
p.add_disease(DI_SHAKES, rng(40, 80), g);
|
||||
if (one_in(12000 - dis.duration)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("Your vision is filled with bright lights...");
|
||||
p.add_disease(DI_BLIND, rng(10, 20), g);
|
||||
if (one_in(8))
|
||||
p.rem_disease(DI_TELEGLOW);
|
||||
}
|
||||
if (one_in(5000) && !p.has_disease(DI_HALLU)) {
|
||||
p.add_disease(DI_HALLU, 3600, g);
|
||||
if (one_in(5))
|
||||
p.rem_disease(DI_TELEGLOW);
|
||||
}
|
||||
}
|
||||
if (one_in(4000)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You're suddenly covered in ectoplasm.");
|
||||
p.add_disease(DI_BOOMERED, 100, g);
|
||||
if (one_in(4))
|
||||
p.rem_disease(DI_TELEGLOW);
|
||||
}
|
||||
if (one_in(10000)) {
|
||||
p.add_disease(DI_FUNGUS, -1, g);
|
||||
p.rem_disease(DI_TELEGLOW);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
void dis_msg(game *g, dis_type type);
|
||||
|
||||
std::string dis_name(disease dis)
|
||||
{
|
||||
switch (dis.type) {
|
||||
case DI_NULL: return "";
|
||||
case DI_HEATSTROKE: return "Heatstroke";
|
||||
case DI_FBFACE: return "Frostbite - Face";
|
||||
case DI_FBHANDS: return "Frostbite - Hands";
|
||||
case DI_FBFEET: return "Frostbite - Feet";
|
||||
case DI_SMOKE: return "Smoke";
|
||||
case DI_TEARGAS: return "Tear gas";
|
||||
case DI_ONFIRE: return "On Fire";
|
||||
case DI_BOOMERED: return "Boomered";
|
||||
case DI_SPORES: return "Spores";
|
||||
case DI_SLIMED: return "Slimed";
|
||||
case DI_BLIND: return "Blind";
|
||||
case DI_POISON: return "Poisoned";
|
||||
case DI_FOODPOISON: return "Food Poisoning";
|
||||
case DI_SHAKES: return "Shakes";
|
||||
case DI_DRUNK:
|
||||
if (dis.duration > 2200)
|
||||
return "Wasted";
|
||||
if (dis.duration > 1400)
|
||||
return "Trashed";
|
||||
if (dis.duration > 800)
|
||||
return "Drunk";
|
||||
return "Tipsy";
|
||||
case DI_CIG: return "Cigarette";
|
||||
case DI_HIGH: return "High";
|
||||
case DI_VISUALS: return "Hallucinating";
|
||||
case DI_ADRENALINE:
|
||||
if (dis.duration > 400)
|
||||
return "Adrenaline Rush";
|
||||
return "Adrenaline Comedown";
|
||||
case DI_ASTHMA:
|
||||
if (dis.duration > 800)
|
||||
return "Heavy Asthma";
|
||||
return "Asthma";
|
||||
case DI_METH:
|
||||
if (dis.duration > 600)
|
||||
return "High on Meth";
|
||||
return "Meth Comedown";
|
||||
case DI_IN_PIT: return "Stuck in Pit";
|
||||
default: return "";
|
||||
}
|
||||
}
|
||||
void dis_effect(game *g, player &p, disease &dis);
|
||||
|
||||
std::string dis_description(disease dis)
|
||||
{
|
||||
int strpen, allpen;
|
||||
std::stringstream stream;
|
||||
switch (dis.type) {
|
||||
case DI_NULL:
|
||||
return "None";
|
||||
case DI_HEATSTROKE: return "\
|
||||
Speed -15%; Strength - 2; Intelligence - 2; Perception - 1";
|
||||
case DI_FBFACE: return "\
|
||||
Perception - 2";
|
||||
case DI_FBHANDS: return "\
|
||||
Dexterity - 2";
|
||||
case DI_FBFEET: return "\
|
||||
Speed -40%; Strength - 1";
|
||||
case DI_SMOKE: return "\
|
||||
Strength - 1; Dexterity - 1;\n\
|
||||
Occasionally you will cough, costing movement and creating noise.\n\
|
||||
Loss of health - Torso";
|
||||
case DI_TEARGAS: return "\
|
||||
Strength - 2; Dexterity - 2; Intelligence - 1; Perception - 4\n\
|
||||
Occasionally you will cough, costing movement and creating noise.\n\
|
||||
Loss of health - Torso";
|
||||
case DI_ONFIRE: return "\
|
||||
Loss of health - Entire Body\n\
|
||||
Your clothing and other equipment may be consumed by the flames.";
|
||||
case DI_BOOMERED: return "\
|
||||
Perception - 5\n\
|
||||
Range of Sight: 1; All sight is tinted magenta";
|
||||
case DI_SPORES: return "\
|
||||
Speed -40%\
|
||||
You can feel the tiny spores sinking directly into your flesh.";
|
||||
case DI_SLIMED: return "\
|
||||
Speed -40%; Dexterity - 2";
|
||||
case DI_BLIND: return "\
|
||||
Range of Sight: 0";
|
||||
case DI_POISON: return "\
|
||||
Perception - 1; Dexterity - 1; Strength - 2 IF not resistant\n\
|
||||
Occasional pain and/or damage.";
|
||||
case DI_FOODPOISON: return "\
|
||||
Speed - 35%; Strength - 3; Dexterity - 1; Perception - 1\n\
|
||||
Your stomach is extremely upset, and you keep having pangs of pain and nausea.";
|
||||
case DI_SHAKES: return "\
|
||||
Strength - 1; Dexterity - 4;";
|
||||
case DI_DRUNK:
|
||||
strpen = int(dis.duration / 1000);
|
||||
allpen = int(dis.duration / 800);
|
||||
stream << "Strength - " << strpen << "; Dexterity - " << allpen <<
|
||||
"; Intelligence - " << allpen << "; Perception - " << allpen;
|
||||
|
||||
return stream.str();
|
||||
case DI_CIG:
|
||||
if (dis.duration > 200)
|
||||
return "\
|
||||
Strength - 1; Dexterity - 1\n\
|
||||
You smoked too much.";
|
||||
return "\
|
||||
Dexterity + 1; Intelligence + 1; Perception + 1";
|
||||
case DI_HIGH:
|
||||
return "\
|
||||
Dexterity - 1; Intelligence - 1; Perception - 1";
|
||||
case DI_VISUALS:
|
||||
return "\
|
||||
You can't trust everything that you see.";
|
||||
case DI_ADRENALINE:
|
||||
if (dis.duration > 400)
|
||||
return "\
|
||||
Speed +80; Strength + 5; Dexterity + 3; Intelligence - 8; Perception + 1";
|
||||
return "\
|
||||
Strength - 2; Dexterity - 1; Intelligence - 1; Perception - 1";
|
||||
case DI_ASTHMA:
|
||||
stream<< "Speed - " << int(dis.duration / 5) << "%; Strength - 2; " <<
|
||||
"Dexterity - 3";
|
||||
return stream.str();
|
||||
case DI_METH:
|
||||
if (dis.duration > 600)
|
||||
return "\
|
||||
Speed +50; Strength + 2; Dexterity + 2; Intelligence + 2; Perception + 2";
|
||||
return "\
|
||||
Speed -30; Strength - 3; Dexterity - 2; Intelligence - 2";
|
||||
case DI_IN_PIT:
|
||||
return "\
|
||||
You're stuck in a pit. Sight distance is limited and you have to climb out.";
|
||||
default:
|
||||
return "Who knows?";
|
||||
}
|
||||
}
|
||||
int disease_speed_boost(disease dis);
|
||||
|
||||
std::string dis_name(disease dis);
|
||||
|
||||
std::string dis_description(disease dis);
|
||||
|
||||
#endif
|
||||
|
||||
@@ -8,9 +8,9 @@
|
||||
enum material {
|
||||
MNULL = 0,
|
||||
//Food Materials
|
||||
LIQUID, VEGGY, FLESH, POWDER,
|
||||
LIQUID, VEGGY, FLESH, POWDER, HFLESH, //Human Flesh.
|
||||
//Clothing
|
||||
COTTON, WOOL, LEATHER, KEVLAR,
|
||||
COTTON, WOOL, LEATHER, KEVLAR, FUR,
|
||||
//Other
|
||||
STONE, PAPER, WOOD, PLASTIC, GLASS, IRON, STEEL, SILVER
|
||||
};
|
||||
@@ -19,7 +19,17 @@ struct point {
|
||||
int x;
|
||||
int y;
|
||||
point(int X = 0, int Y = 0) : x (X), y (Y) {}
|
||||
point(const point &p) : x (p.x), y (p.y) {}
|
||||
~point(){}
|
||||
};
|
||||
|
||||
struct tripoint {
|
||||
int x;
|
||||
int y;
|
||||
int z;
|
||||
tripoint(int X = 0, int Y = 0, int Z = 0) : x (X), y (Y), z (Z) {}
|
||||
tripoint(const tripoint &p) : x (p.x), y (p.y), z (p.z) {}
|
||||
~tripoint(){}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,28 +2,259 @@
|
||||
#include "npc.h"
|
||||
#include "game.h"
|
||||
#include "rng.h"
|
||||
#include "options.h"
|
||||
|
||||
void event::actualize(game *g)
|
||||
{
|
||||
npc tmp;
|
||||
switch (type) {
|
||||
case EVENT_HELP:
|
||||
if (relevant_faction == NULL) {
|
||||
tmp.randomize(g);
|
||||
tmp.attitude = NPCATT_DEFEND;
|
||||
tmp.posx = g->u.posx - SEEX * 2 + rng(-5, 5);
|
||||
tmp.posy = g->u.posy - SEEY * 2 + rng(-5, 5);
|
||||
g->active_npc.push_back(tmp);
|
||||
} else {
|
||||
int num = rng(1, 6);
|
||||
|
||||
case EVENT_HELP: {
|
||||
npc tmp;
|
||||
int num = 1;
|
||||
if (faction_id >= 0)
|
||||
num = rng(1, 6);
|
||||
for (int i = 0; i < num; i++) {
|
||||
tmp.randomize_from_fact(g, relevant_faction);
|
||||
if (faction_id != -1) {
|
||||
faction* fac = g->faction_by_id(faction_id);
|
||||
if (fac)
|
||||
tmp.randomize_from_faction(g, fac);
|
||||
else
|
||||
debugmsg("EVENT_HELP run with invalid faction_id");
|
||||
} else
|
||||
tmp.randomize(g);
|
||||
tmp.attitude = NPCATT_DEFEND;
|
||||
tmp.posx = g->u.posx - SEEX * 2 + rng(-5, 5);
|
||||
tmp.posy = g->u.posy - SEEY * 2 + rng(-5, 5);
|
||||
g->active_npc.push_back(tmp);
|
||||
}
|
||||
}
|
||||
break;
|
||||
} break;
|
||||
|
||||
case EVENT_ROBOT_ATTACK: {
|
||||
if (rl_dist(g->levx, g->levy, map_point.x, map_point.y) <= 4) {
|
||||
mtype *robot_type = g->mtypes[mon_tripod];
|
||||
if (faction_id == 0) // The cops!
|
||||
robot_type = g->mtypes[mon_copbot];
|
||||
monster robot(robot_type);
|
||||
int robx = (g->levx > map_point.x ? 0 - SEEX * 2 : SEEX * 4),
|
||||
roby = (g->levy > map_point.y ? 0 - SEEY * 2 : SEEY * 4);
|
||||
robot.spawn(robx, roby);
|
||||
g->z.push_back(robot);
|
||||
}
|
||||
} break;
|
||||
|
||||
case EVENT_SPAWN_WYRMS: {
|
||||
if (g->levz >= 0)
|
||||
return;
|
||||
monster wyrm(g->mtypes[mon_dark_wyrm]);
|
||||
int num_wyrms = rng(1, 4);
|
||||
for (int i = 0; i < num_wyrms; i++) {
|
||||
int tries = 0;
|
||||
int monx = -1, mony = -1;
|
||||
do {
|
||||
monx = rng(0, SEEX * MAPSIZE);
|
||||
mony = rng(0, SEEY * MAPSIZE);
|
||||
tries++;
|
||||
} while (tries < 10 && !g->is_empty(monx, mony) &&
|
||||
rl_dist(g->u.posx, g->u.posx, monx, mony) <= 2);
|
||||
if (tries < 10) {
|
||||
wyrm.spawn(monx, mony);
|
||||
g->z.push_back(wyrm);
|
||||
}
|
||||
}
|
||||
if (!one_in(25)) // They just keep coming!
|
||||
g->add_event(EVENT_SPAWN_WYRMS, int(g->turn) + rng(15, 25));
|
||||
} break;
|
||||
|
||||
case EVENT_AMIGARA: {
|
||||
int num_horrors = rng(3, 5);
|
||||
int faultx = -1, faulty = -1;
|
||||
bool horizontal;
|
||||
for (int x = 0; x < SEEX * MAPSIZE && faultx == -1; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE && faulty == -1; y++) {
|
||||
if (g->m.ter(x, y) == t_fault) {
|
||||
faultx = x;
|
||||
faulty = y;
|
||||
if (g->m.ter(x - 1, y) == t_fault || g->m.ter(x + 1, y) == t_fault)
|
||||
horizontal = true;
|
||||
else
|
||||
horizontal = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
monster horror(g->mtypes[mon_amigara_horror]);
|
||||
for (int i = 0; i < num_horrors; i++) {
|
||||
int tries = 0;
|
||||
int monx = -1, mony = -1;
|
||||
do {
|
||||
if (horizontal) {
|
||||
monx = rng(faultx, faultx + 2 * SEEX - 8);
|
||||
for (int n = -1; n <= 1; n++) {
|
||||
if (g->m.ter(monx, faulty + n) == t_rock_floor)
|
||||
mony = faulty + n;
|
||||
}
|
||||
} else { // Vertical fault
|
||||
mony = rng(faulty, faulty + 2 * SEEY - 8);
|
||||
for (int n = -1; n <= 1; n++) {
|
||||
if (g->m.ter(faultx + n, mony) == t_rock_floor)
|
||||
monx = faultx + n;
|
||||
}
|
||||
}
|
||||
tries++;
|
||||
} while ((monx == -1 || mony == -1 || g->is_empty(monx, mony)) &&
|
||||
tries < 10);
|
||||
if (tries < 10) {
|
||||
horror.spawn(monx, mony);
|
||||
g->z.push_back(horror);
|
||||
}
|
||||
}
|
||||
} break;
|
||||
|
||||
case EVENT_ROOTS_DIE:
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (g->m.ter(x, y) == t_root_wall && one_in(3))
|
||||
g->m.ter_set(x, y, t_underbrush);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case EVENT_TEMPLE_OPEN: {
|
||||
bool saw_grate = false;
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (g->m.ter(x, y) == t_grate) {
|
||||
g->m.ter_set(x, y, t_stairs_down);
|
||||
int j;
|
||||
if (!saw_grate && g->u_see(x, y, j))
|
||||
saw_grate = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (saw_grate)
|
||||
g->add_msg("The nearby grates open to reveal a staircase!");
|
||||
} break;
|
||||
|
||||
case EVENT_TEMPLE_FLOOD: {
|
||||
bool flooded = false;
|
||||
|
||||
ter_id flood_buf[SEEX*MAPSIZE][SEEY*MAPSIZE];
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++)
|
||||
flood_buf[x][y] = g->m.ter(x, y);
|
||||
}
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (g->m.ter(x, y) == t_water_sh) {
|
||||
bool deepen = false;
|
||||
for (int wx = x - 1; wx <= x + 1 && !deepen; wx++) {
|
||||
for (int wy = y - 1; wy <= y + 1 && !deepen; wy++) {
|
||||
if (g->m.ter(wx, wy) == t_water_dp)
|
||||
deepen = true;
|
||||
}
|
||||
}
|
||||
if (deepen) {
|
||||
flood_buf[x][y] = t_water_dp;
|
||||
flooded = true;
|
||||
}
|
||||
} else if (g->m.ter(x, y) == t_rock_floor) {
|
||||
bool flood = false;
|
||||
for (int wx = x - 1; wx <= x + 1 && !flood; wx++) {
|
||||
for (int wy = y - 1; wy <= y + 1 && !flood; wy++) {
|
||||
if (g->m.ter(wx, wy) == t_water_dp || g->m.ter(wx, wy) == t_water_sh)
|
||||
flood = true;
|
||||
}
|
||||
}
|
||||
if (flood) {
|
||||
flood_buf[x][y] = t_water_sh;
|
||||
flooded = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if (!flooded)
|
||||
return; // We finished flooding the entire chamber!
|
||||
// Check if we should print a message
|
||||
if (flood_buf[g->u.posx][g->u.posy] != g->m.ter(g->u.posx, g->u.posy)) {
|
||||
if (flood_buf[g->u.posx][g->u.posy] == t_water_sh)
|
||||
g->add_msg("Water quickly floods up to your knees.");
|
||||
else { // Must be deep water!
|
||||
g->add_msg("Water fills nearly to the ceiling!");
|
||||
g->plswim(g->u.posx, g->u.posy);
|
||||
}
|
||||
}
|
||||
// flood_buf is filled with correct tiles; now copy them back to g->m
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++)
|
||||
g->m.ter_set(x, y, flood_buf[x][y]);
|
||||
}
|
||||
g->add_event(EVENT_TEMPLE_FLOOD, int(g->turn) + rng(2, 3));
|
||||
} break;
|
||||
|
||||
case EVENT_TEMPLE_SPAWN: {
|
||||
mon_id montype;
|
||||
switch (rng(1, 4)) {
|
||||
case 1: montype = mon_sewer_snake; break;
|
||||
case 2: montype = mon_centipede; break;
|
||||
case 3: montype = mon_dermatik; break;
|
||||
case 4: montype = mon_spider_widow; break;
|
||||
}
|
||||
monster spawned( g->mtypes[montype] );
|
||||
int tries = 0, x, y;
|
||||
do {
|
||||
x = rng(g->u.posx - 5, g->u.posx + 5);
|
||||
y = rng(g->u.posy - 5, g->u.posy + 5);
|
||||
tries++;
|
||||
} while (tries < 20 && !g->is_empty(x, y) &&
|
||||
rl_dist(x, y, g->u.posx, g->u.posy) <= 2);
|
||||
if (tries < 20) {
|
||||
spawned.spawn(x, y);
|
||||
g->z.push_back(spawned);
|
||||
}
|
||||
} break;
|
||||
|
||||
default:
|
||||
break; // Nothing happens for other events
|
||||
}
|
||||
}
|
||||
|
||||
void event::per_turn(game *g)
|
||||
{
|
||||
switch (type) {
|
||||
case EVENT_WANTED: {
|
||||
// About once every 10 minutes. Suppress in classic zombie mode.
|
||||
if (g->levz >= 0 && one_in(100) && !OPTIONS[OPT_CLASSIC_ZOMBIES]) {
|
||||
monster eyebot(g->mtypes[mon_eyebot]);
|
||||
eyebot.faction_id = faction_id;
|
||||
point place = g->m.random_outdoor_tile();
|
||||
if (place.x == -1 && place.y == -1)
|
||||
return; // We're safely indoors!
|
||||
eyebot.spawn(place.x, place.y);
|
||||
g->z.push_back(eyebot);
|
||||
int t;
|
||||
if (g->u_see(place.x, place.y, t))
|
||||
g->add_msg("An eyebot swoops down nearby!");
|
||||
}
|
||||
} break;
|
||||
|
||||
case EVENT_SPAWN_WYRMS:
|
||||
if (g->levz >= 0) {
|
||||
turn--;
|
||||
return;
|
||||
}
|
||||
if (int(g->turn) % 3 == 0)
|
||||
g->add_msg("You hear screeches from the rock above and around you!");
|
||||
break;
|
||||
|
||||
case EVENT_AMIGARA:
|
||||
g->add_msg("The entire cavern shakes!");
|
||||
break;
|
||||
|
||||
case EVENT_TEMPLE_OPEN:
|
||||
g->add_msg("The earth rumbles.");
|
||||
break;
|
||||
|
||||
|
||||
default:
|
||||
break; // Nothing happens for other events
|
||||
}
|
||||
}
|
||||
|
||||
@@ -2,33 +2,50 @@
|
||||
#define _EVENT_H_
|
||||
|
||||
#include "faction.h"
|
||||
#include "line.h"
|
||||
|
||||
class game;
|
||||
|
||||
enum event_type {
|
||||
EVENT_NULL,
|
||||
EVENT_HELP,
|
||||
EVENT_WANTED,
|
||||
EVENT_ROBOT_ATTACK,
|
||||
EVENT_SPAWN_WYRMS,
|
||||
EVENT_AMIGARA,
|
||||
EVENT_ROOTS_DIE,
|
||||
EVENT_TEMPLE_OPEN,
|
||||
EVENT_TEMPLE_FLOOD,
|
||||
EVENT_TEMPLE_SPAWN,
|
||||
EVENT_DIM,
|
||||
EVENT_ARTIFACT_LIGHT,
|
||||
NUM_EVENT_TYPES
|
||||
};
|
||||
|
||||
struct event {
|
||||
event_type type;
|
||||
int turn;
|
||||
faction* relevant_faction;
|
||||
int faction_id;
|
||||
point map_point;
|
||||
|
||||
event() {
|
||||
type = EVENT_NULL;
|
||||
turn = 0;
|
||||
relevant_faction = NULL;
|
||||
faction_id = -1;
|
||||
map_point.x = -1;
|
||||
map_point.y = -1;
|
||||
}
|
||||
|
||||
event(event_type e_t, int t, faction* r_f) {
|
||||
event(event_type e_t, int t, int f_id, int x, int y) {
|
||||
type = e_t;
|
||||
turn = t;
|
||||
relevant_faction = r_f;
|
||||
faction_id = f_id;
|
||||
map_point.x = x;
|
||||
map_point.y = y;
|
||||
}
|
||||
|
||||
void actualize(game *g);
|
||||
void actualize(game *g); // When the time runs out
|
||||
void per_turn(game *g); // Every turn
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -2,12 +2,14 @@
|
||||
|
||||
std::string faction_adj_pos[15] = {
|
||||
"Shining", "Sacred", "Golden", "Holy", "Righteous", "Devoted", "Virtuous",
|
||||
"Splendid", "Divine", "Radiant", "Noble", "Venerable", "Immaculate"
|
||||
"Splendid", "Divine", "Radiant", "Noble", "Venerable", "Immaculate",
|
||||
"Heroic", "Bright"};
|
||||
|
||||
std::string faction_adj_neu[15] = {
|
||||
"Original", "Crystal", "Metal", "Mighty", "Powerful", "Solid", "Stone",
|
||||
"Firey", "Colossal", "Famous", "Supreme", "Invincible", "Unlimited",
|
||||
"Great", "Electric"};
|
||||
|
||||
std::string faction_adj_bad[15] = {
|
||||
"Poisonous", "Deadly", "Foul", "Nefarious", "Wicked", "Vile", "Ruinous",
|
||||
"Horror", "Devastating", "Vicious", "Sinister", "Baleful", "Pestilent",
|
||||
@@ -17,17 +19,21 @@ std::string faction_noun_strong[15] = {
|
||||
"Fists", "Slayers", "Furies", "Dervishes", "Tigers", "Destroyers",
|
||||
"Berserkers", "Samurai", "Valkyries", "Army", "Killers", "Paladins",
|
||||
"Knights", "Warriors", "Huntsmen"};
|
||||
|
||||
std::string faction_noun_sneak[15] = {
|
||||
"Snakes", "Rats", "Assassins", "Ninja", "Agents", "Shadows", "Guerillas",
|
||||
"Eliminators", "Snipers", "Smoke", "Arachnids", "Creepers", "Shade",
|
||||
"Stalkers", "Eels"};
|
||||
|
||||
std::string faction_noun_crime[15] = {
|
||||
"Bandits", "Punks", "Family", "Mafia", "Mob", "Gang", "Vandals", "Sharks",
|
||||
"Muggers", "Cutthroats", "Guild", "Faction", "Thugs", "Racket", "Crooks"};
|
||||
|
||||
std::string faction_noun_cult[15] = {
|
||||
"Brotherhood", "Church", "Ones", "Crucible", "Sect", "Creed", "Doctrine",
|
||||
"Priests", "Tenet", "Monks", "Clerics", "Pastors", "Gnostics", "Elders",
|
||||
"Inquisitors"};
|
||||
|
||||
std::string faction_noun_none[15] = {
|
||||
"Settlers", "People", "Men", "Faction", "Tribe", "Clan", "Society", "Folk",
|
||||
"Nation", "Republic", "Colony", "State", "Kingdom", "Party", "Company"};
|
||||
@@ -53,11 +59,12 @@ faction_value_datum facgoal_data[NUM_FACGOALS] = {
|
||||
{"contact with unseen powers", -1, 0, 1, 0, 4},
|
||||
{"bringing the apocalypse", -5, 1, 2, 0, 7},
|
||||
{"general chaos and anarchy", -3, 2, -3, 2, -1},
|
||||
{"the cultivation of knowledge", 2, -3, -1, -1, 0},
|
||||
{"the cultivation of knowledge", 2, -3, 2, -1, 0},
|
||||
{"harmony with nature", 2, -2, 0, -1, 2},
|
||||
{"rebuilding civilization", 2, 1, -2, -2, -4}
|
||||
{"rebuilding civilization", 2, 1, -2, -2, -4},
|
||||
{"spreading the fungus", -2, 1, 1, 0, 4}
|
||||
};
|
||||
// TOTAL: -3 2 -5 0 3
|
||||
// TOTAL: -5 3 -2 0 7
|
||||
|
||||
faction_value_datum facjob_data[NUM_FACJOBS] = {
|
||||
// "They earn money via <name>"
|
||||
@@ -86,18 +93,18 @@ faction_value_datum facval_data[NUM_FACVALS] = {
|
||||
{"Null", 0, 0, 0, 0, 0},
|
||||
{"their charitable nature", 5, -1, -1, -2, -2},
|
||||
{"their isolationism", 0, -2, 1, 0, 2},
|
||||
{"exploring extensively", 1, 0, 0, -2, -1},
|
||||
{"collecting rare artifacts", 0, 1, 1, -1, 3},
|
||||
{"exploring extensively", 1, 0, 0, -1, -1},
|
||||
{"collecting rare artifacts", 0, 1, 1, 0, 3},
|
||||
{"their knowledge of bionics", 1, 2, 0, 0, 0},
|
||||
{"their libraries", 1, -3, 0, -2, 1},
|
||||
{"their elite training", 0, 4, 2, 0, 2},
|
||||
{"their robotics factories", 0, 3, -1, 0, -2},
|
||||
{"treachery", -3, 0, 1, 3, 0},
|
||||
{"the avoidance of drugs", 1, 0, 0, -2, 1},
|
||||
{"the avoidance of drugs", 1, 0, 0, -1, 1},
|
||||
{"their adherance to the law", 2, -1, -1, -4, -1},
|
||||
{"their cruelty", -3, 1, -1, 4, 1}
|
||||
};
|
||||
// TOTALS: 5 4 1 -6 4
|
||||
// TOTALS: 5 4 1 -3 4
|
||||
/* Note: It's nice to keep the totals around 0 for Good, and about even for the
|
||||
* other four. It's okay if Good is slightly negative (after all, in a post-
|
||||
* apocalyptic world people might be a LITTLE less virtuous), and to keep
|
||||
|
||||
+79
-1
@@ -6,10 +6,37 @@
|
||||
#include "omdata.h"
|
||||
#include "game.h"
|
||||
|
||||
#include <sstream>
|
||||
|
||||
std::string invent_name();
|
||||
std::string invent_adj();
|
||||
|
||||
faction::faction()
|
||||
{
|
||||
// debugmsg("Warning: Faction created without UID!");
|
||||
name = "";
|
||||
values = 0;
|
||||
likes_u = 0;
|
||||
respects_u = 0;
|
||||
known_by_u = false;
|
||||
goal = FACGOAL_NULL;
|
||||
job1 = FACJOB_NULL;
|
||||
job2 = FACJOB_NULL;
|
||||
strength = 0;
|
||||
sneak = 0;
|
||||
crime = 0;
|
||||
cult = 0;
|
||||
good = 0;
|
||||
omx = 0;
|
||||
omy = 0;
|
||||
mapx = 0;
|
||||
mapy = 0;
|
||||
size = 0;
|
||||
power = 0;
|
||||
id = -1;
|
||||
}
|
||||
|
||||
faction::faction(int uid)
|
||||
{
|
||||
name = "";
|
||||
values = 0;
|
||||
@@ -19,12 +46,63 @@ faction::faction()
|
||||
goal = FACGOAL_NULL;
|
||||
job1 = FACJOB_NULL;
|
||||
job2 = FACJOB_NULL;
|
||||
strength = 0;
|
||||
sneak = 0;
|
||||
crime = 0;
|
||||
cult = 0;
|
||||
good = 0;
|
||||
omx = 0;
|
||||
omy = 0;
|
||||
mapx = 0;
|
||||
mapy = 0;
|
||||
size = 0;
|
||||
power = 0;
|
||||
uid = id;
|
||||
}
|
||||
|
||||
|
||||
faction::~faction()
|
||||
{
|
||||
}
|
||||
|
||||
std::string faction::save_info()
|
||||
{
|
||||
std::stringstream dump;
|
||||
dump << id << " " << values << " " << goal << " " << job1 << " " << job2 <<
|
||||
" " << likes_u << " " << respects_u << " " << known_by_u << " " <<
|
||||
strength << " " << sneak << " " << crime << " " << cult << " " <<
|
||||
good << " " << omx << " " << omy << " " << mapx << " " << mapy <<
|
||||
" " << size << " " << power << " ";
|
||||
dump << opinion_of.size() << " ";
|
||||
for (int i = 0; i < opinion_of.size(); i++)
|
||||
dump << opinion_of[i] << " ";
|
||||
dump << name;
|
||||
return dump.str();
|
||||
}
|
||||
|
||||
void faction::load_info(std::string data)
|
||||
{
|
||||
std::stringstream dump;
|
||||
int valuetmp, goaltmp, jobtmp1, jobtmp2;
|
||||
dump << data;
|
||||
dump >> id >> valuetmp >> goaltmp >> jobtmp1 >> jobtmp2 >> likes_u >>
|
||||
respects_u >> known_by_u >> strength >> sneak >> crime >> cult >>
|
||||
good >> omx >> omy >> mapx >> mapy >> size >> power;
|
||||
values = valuetmp;
|
||||
goal = faction_goal(goaltmp);
|
||||
job1 = faction_job(jobtmp1);
|
||||
job2 = faction_job(jobtmp2);
|
||||
int size, tmpop;
|
||||
dump >> size;
|
||||
for (int i = 0; i < size; i++) {
|
||||
dump >> tmpop;
|
||||
opinion_of.push_back(tmpop);
|
||||
}
|
||||
std::string subname;
|
||||
while (dump >> subname)
|
||||
name += " " + subname;
|
||||
}
|
||||
|
||||
void faction::randomize()
|
||||
{
|
||||
// Set up values
|
||||
@@ -475,6 +553,6 @@ std::string fac_respect_text(int val)
|
||||
return "Leech";
|
||||
if (val <= -10)
|
||||
return "Laughingstock";
|
||||
|
||||
|
||||
return "Neutral";
|
||||
}
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
#define MAX_FAC_NAME_SIZE 40
|
||||
|
||||
#ifndef mfb
|
||||
#define mfb(n) int(pow(2,(int)n))
|
||||
#define mfb(n) long(1 << (n))
|
||||
#endif
|
||||
|
||||
std::string fac_ranking_text(int val);
|
||||
@@ -17,17 +17,18 @@ std::string fac_respect_text(int val);
|
||||
class game;
|
||||
|
||||
enum faction_goal {
|
||||
FACGOAL_NULL = 0, // Not meant to be used; denotes a bug
|
||||
FACGOAL_NONE, // No particular goal outside of prosperity
|
||||
FACGOAL_WEALTH, // Financial wealth
|
||||
FACGOAL_DOMINANCE, // Complete military dominance
|
||||
FACGOAL_CLEANSE, // Destroy zombies &c
|
||||
FACGOAL_SHADOW, // Contact, control, etc. of the shadow world
|
||||
FACGOAL_APOCALYPSE, // Destroy the world!
|
||||
FACGOAL_ANARCHY, // Nihilistic; destroy anything
|
||||
FACGOAL_KNOWLEDGE, // Golden age of knowledge; a new renaissance
|
||||
FACGOAL_NATURE, // Golden age of ecological harmony
|
||||
FACGOAL_CIVILIZATION, // Rebuilding society as it was before
|
||||
FACGOAL_NULL = 0,
|
||||
FACGOAL_NONE,
|
||||
FACGOAL_WEALTH,
|
||||
FACGOAL_DOMINANCE,
|
||||
FACGOAL_CLEANSE,
|
||||
FACGOAL_SHADOW,
|
||||
FACGOAL_APOCALYPSE,
|
||||
FACGOAL_ANARCHY,
|
||||
FACGOAL_KNOWLEDGE,
|
||||
FACGOAL_NATURE,
|
||||
FACGOAL_CIVILIZATION,
|
||||
FACGOAL_FUNGUS,
|
||||
NUM_FACGOALS
|
||||
};
|
||||
|
||||
@@ -67,10 +68,15 @@ enum faction_value {
|
||||
NUM_FACVALS
|
||||
};
|
||||
|
||||
|
||||
struct faction {
|
||||
faction();
|
||||
faction(int uid);
|
||||
~faction();
|
||||
|
||||
std::string save_info();
|
||||
void load_info(std::string data);
|
||||
|
||||
void randomize();
|
||||
void make_army();
|
||||
bool has_job(faction_job j);
|
||||
|
||||
@@ -4,6 +4,7 @@
|
||||
#include "mtype.h"
|
||||
#include "monster.h"
|
||||
#include "map.h"
|
||||
#include "lightmap.h"
|
||||
#include "player.h"
|
||||
#include "overmap.h"
|
||||
#include "omdata.h"
|
||||
@@ -11,10 +12,41 @@
|
||||
#include "crafting.h"
|
||||
#include "trap.h"
|
||||
#include "npc.h"
|
||||
#include "tutorial.h"
|
||||
#include "faction.h"
|
||||
#include "event.h"
|
||||
#include "mission.h"
|
||||
#include "weather.h"
|
||||
#include "construction.h"
|
||||
#include "calendar.h"
|
||||
#include "posix_time.h"
|
||||
#include "artifact.h"
|
||||
#include "mutation.h"
|
||||
#include "gamemode.h"
|
||||
#include "action.h"
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <stdarg.h>
|
||||
|
||||
// Fixed window sizes
|
||||
#define HP_HEIGHT 14
|
||||
#define HP_WIDTH 7
|
||||
#define MINIMAP_HEIGHT 7
|
||||
#define MINIMAP_WIDTH 7
|
||||
#define MONINFO_HEIGHT 12
|
||||
#define MONINFO_WIDTH 48
|
||||
#define MESSAGES_HEIGHT 8
|
||||
#define MESSAGES_WIDTH 48
|
||||
#define LOCATION_HEIGHT 1
|
||||
#define LOCATION_WIDTH 48
|
||||
#define STATUS_HEIGHT 4
|
||||
#define STATUS_WIDTH 55
|
||||
|
||||
#define LONG_RANGE 10
|
||||
#define BLINK_SPEED 300
|
||||
#define BULLET_SPEED 10000000
|
||||
#define EXPLOSION_SPEED 70000000
|
||||
|
||||
#define PICKUP_RANGE 2
|
||||
|
||||
enum tut_type {
|
||||
TUT_NULL,
|
||||
@@ -22,188 +54,403 @@ enum tut_type {
|
||||
TUT_MAX
|
||||
};
|
||||
|
||||
enum input_ret {
|
||||
IR_GOOD,
|
||||
IR_BAD,
|
||||
IR_TIMEOUT
|
||||
};
|
||||
|
||||
enum quit_status {
|
||||
QUIT_NO = 0, // Still playing
|
||||
QUIT_MENU, // Quit at the menu
|
||||
QUIT_SUICIDE, // Quit with 'Q'
|
||||
QUIT_SAVED, // Saved and quit
|
||||
QUIT_DIED, // Actual death
|
||||
QUIT_DELETE_WORLD // Quit and delete world
|
||||
};
|
||||
|
||||
struct monster_and_count
|
||||
{
|
||||
monster mon;
|
||||
int count;
|
||||
monster_and_count(monster M, int C) : mon (M), count (C) {};
|
||||
};
|
||||
|
||||
struct game_message
|
||||
{
|
||||
calendar turn;
|
||||
int count;
|
||||
std::string message;
|
||||
game_message() { turn = 0; count = 1; message = ""; };
|
||||
game_message(calendar T, std::string M) : turn (T), message (M) { count = 1; };
|
||||
};
|
||||
|
||||
struct mtype;
|
||||
struct mission_type;
|
||||
class map;
|
||||
class player;
|
||||
class calendar;
|
||||
struct mutation_branch;
|
||||
|
||||
class game
|
||||
{
|
||||
public:
|
||||
game();
|
||||
~game();
|
||||
void init_ui();
|
||||
void setup();
|
||||
bool game_quit(); // True if we actually quit the game - used in main.cpp
|
||||
quit_status uquit; // used in main.cpp to determine what type of quit
|
||||
void save();
|
||||
void delete_save();
|
||||
void cleanup_at_end();
|
||||
bool do_turn();
|
||||
void tutorial_message(tut_lesson lesson);
|
||||
void draw();
|
||||
void draw_ter();
|
||||
void draw_ter(int posx = -999, int posy = -999);
|
||||
void advance_nextinv(); // Increment the next inventory letter
|
||||
void decrease_nextinv(); // Decrement the next inventory letter
|
||||
void vadd_msg(const char* msg, va_list ap );
|
||||
void add_msg(const char* msg, ...);
|
||||
void add_event(event_type type, int on_turn, faction* rel);
|
||||
void add_msg_if_player(player *p, const char* msg, ...);
|
||||
void add_event(event_type type, int on_turn, int faction_id = -1,
|
||||
int x = -1, int y = -1);
|
||||
bool event_queued(event_type type);
|
||||
// Sound at (x, y) of intensity (vol), described to the player is (description)
|
||||
void sound(int x, int y, int vol, std::string description);
|
||||
// creates a list of coordinates to draw footsteps
|
||||
void add_footstep(int x, int y, int volume, int distance);
|
||||
std::vector<point> footsteps;
|
||||
// visual cue to monsters moving out of the players sight
|
||||
void draw_footsteps();
|
||||
// Explosion at (x, y) of intensity (power), with (shrapnel) chunks of shrapnel
|
||||
void explosion(int x, int y, int power, int shrapnel, bool fire);
|
||||
// Flashback at (x, y)
|
||||
void flashbang(int x, int y);
|
||||
// Move the player vertically, if (force) then they fell
|
||||
void vertical_move(int z, bool force);
|
||||
void use_computer(int x, int y);
|
||||
bool pl_refill_vehicle (vehicle &veh, int part, bool test=false);
|
||||
void resonance_cascade(int x, int y);
|
||||
void scrambler_blast(int x, int y);
|
||||
void emp_blast(int x, int y);
|
||||
int npc_at(int x, int y); // Index of the npc at (x, y); -1 for none
|
||||
int npc_by_id(int id); // Index of the npc at (x, y); -1 for none
|
||||
// void build_monmap(); // Caches data for mon_at()
|
||||
int mon_at(int x, int y); // Index of the monster at (x, y); -1 for none
|
||||
void kill_mon(int index); // Kill that monster; fixes any pointers etc
|
||||
void plfire(bool burst); // Player fires a gun (setup of target)...
|
||||
bool is_empty(int x, int y); // True if no PC, no monster, move cost > 0
|
||||
bool isBetween(int test, int down, int up);
|
||||
bool is_in_sunlight(int x, int y); // Checks outdoors + sunny
|
||||
// Kill that monster; fixes any pointers etc
|
||||
void kill_mon(int index, bool player_did_it = false);
|
||||
void explode_mon(int index); // Explode a monster; like kill_mon but messier
|
||||
// hit_monster_with_flags processes ammo flags (e.g. incendiary, etc)
|
||||
void hit_monster_with_flags(monster &z, unsigned int flags);
|
||||
void plfire(bool burst); // Player fires a gun (target selection)...
|
||||
// ... a gun is fired, maybe by an NPC (actual damage, etc.).
|
||||
void fire(player &p, int tarx, int tary, std::vector<point> &trajectory,
|
||||
bool burst);
|
||||
void throw_item(player &p, int tarx, int tary, item &thrown,
|
||||
std::vector<point> &trajectory);
|
||||
void cancel_activity();
|
||||
void cancel_activity_query(std::string message);
|
||||
void teleport();
|
||||
void cancel_activity_query(const char* message, ...);
|
||||
int assign_mission_id(); // Just returns the next available one
|
||||
void give_mission(mission_id type); // Create the mission and assign it
|
||||
void assign_mission(int id); // Just assign an existing mission
|
||||
// reserve_mission() creates a new mission of the given type and pushes it to
|
||||
// active_missions. The function returns the UID of the new mission, which can
|
||||
// then be passed to a MacGuffin or something else that needs to track a mission
|
||||
int reserve_mission(mission_id type, int npc_id = -1);
|
||||
int reserve_random_mission(mission_origin origin, point p = point(-1, -1),
|
||||
int npc_id = -1);
|
||||
npc* find_npc(int id);
|
||||
mission* find_mission(int id); // Mission with UID=id; NULL if non-existant
|
||||
mission_type* find_mission_type(int id); // Same, but returns its type
|
||||
bool mission_complete(int id, int npc_id); // True if we made it
|
||||
bool mission_failed(int id); // True if we failed it
|
||||
void wrap_up_mission(int id); // Perform required actions
|
||||
void fail_mission(int id); // Perform required actions, move to failed list
|
||||
void mission_step_complete(int id, int step); // Parial completion
|
||||
void process_missions(); // Process missions, see if time's run out
|
||||
|
||||
void teleport(player *p = NULL);
|
||||
void plswim(int x, int y); // Called by plmove. Handles swimming
|
||||
// when player is thrown (by impact or something)
|
||||
void fling_player_or_monster(player *p, monster *zz, int dir, int flvel);
|
||||
|
||||
void nuke(int x, int y);
|
||||
std::vector<faction *> factions_at(int x, int y);
|
||||
int& scent(int x, int y);
|
||||
float natural_light_level() const;
|
||||
unsigned char light_level();
|
||||
void reset_light_level();
|
||||
int assign_npc_id();
|
||||
int assign_faction_id();
|
||||
faction* faction_by_id(int it);
|
||||
bool sees_u(int x, int y, int &t);
|
||||
bool u_see (int x, int y, int &t);
|
||||
bool u_see (monster *mon, int &t);
|
||||
bool pl_sees(player *p, monster *mon, int &t);
|
||||
void refresh_all();
|
||||
void update_map(int &x, int &y); // Called by plmove when the map updates
|
||||
void update_overmap_seen(); // Update which overmap tiles we can see
|
||||
point om_location(); // levx and levy converted to overmap coordinates
|
||||
|
||||
char inv(std::string title = "INVENTORY:");
|
||||
faction* random_good_faction();
|
||||
faction* random_evil_faction();
|
||||
|
||||
itype* new_artifact();
|
||||
itype* new_natural_artifact(artifact_natural_property prop = ARTPROP_NULL);
|
||||
void process_artifact(item *it, player *p, bool wielded = false);
|
||||
void add_artifact_messages(std::vector<art_effect_passive> effects);
|
||||
|
||||
void peek();
|
||||
point look_around();// Look at nearby terrain ';'
|
||||
void list_items(); //List all items around the player
|
||||
bool list_items_match(std::string sText, std::string sPattern);
|
||||
std::string sFilter;
|
||||
char inv(std::string title = "Inventory:");
|
||||
char inv_type(std::string title = "Inventory:", int inv_item_type = 0);
|
||||
std::vector<item> multidrop();
|
||||
faction* list_factions(std::string title = "FACTIONS:");
|
||||
point find_item(item *it);
|
||||
void remove_item(item *it);
|
||||
|
||||
std::vector <itype*> itypes;
|
||||
inventory crafting_inventory(); // inv_from_map, inv, & 'weapon'
|
||||
void consume_items(std::vector<component> components);
|
||||
void consume_tools(std::vector<component> tools);
|
||||
|
||||
bool has_gametype() const { return gamemode && gamemode->id() != SGAME_NULL; }
|
||||
special_game_id gametype() const { return (gamemode) ? gamemode->id() : SGAME_NULL; }
|
||||
|
||||
std::map<std::string, itype*> itypes;
|
||||
std::vector <mtype*> mtypes;
|
||||
std::vector <vehicle*> vtypes;
|
||||
std::vector <trap*> traps;
|
||||
std::vector<recipe*> recipes; // The list of valid recipes
|
||||
std::vector<constructable*> constructions; // The list of constructions
|
||||
|
||||
std::vector <itype_id> mapitems[num_itloc]; // Items at various map types
|
||||
std::vector <items_location_and_chance> monitems[num_monsters];
|
||||
unsigned int turn;
|
||||
std::vector <mission_type> mission_types; // The list of mission templates
|
||||
mutation_branch mutation_data[PF_MAX2]; // Mutation data
|
||||
std::map<char, action_id> keymap;
|
||||
|
||||
calendar turn;
|
||||
signed char temperature; // The air temperature
|
||||
weather_type weather; // Weather pattern--SEE weather.h
|
||||
char nextinv; // Determines which letter the next inv item will have
|
||||
overmap cur_om;
|
||||
map m;
|
||||
int levx, levy, levz; // Placement inside the overmap
|
||||
player u;
|
||||
std::vector<monster> z;
|
||||
std::vector<monster> monbuff;
|
||||
int monbuffx, monbuffy, monbuffz, monbuff_turn;
|
||||
std::vector<monster_and_count> coming_to_stairs;
|
||||
int monstairx, monstairy, monstairz;
|
||||
std::vector<npc> active_npc;
|
||||
std::vector<mon_id> moncats[num_moncats];
|
||||
std::vector<faction> factions;
|
||||
std::vector<mission> active_missions; // Missions which may be assigned
|
||||
// NEW: Dragging a piece of furniture, with a list of items contained
|
||||
ter_id dragging;
|
||||
std::vector<item> items_dragged;
|
||||
int weight_dragged; // Computed once, when you start dragging
|
||||
bool debugmon;
|
||||
// Display data... TODO: Make this more portable?
|
||||
bool starting_npc;
|
||||
bool random_npc;
|
||||
|
||||
std::map<int, std::map<int, bool> > mapRain;
|
||||
|
||||
WINDOW *w_terrain;
|
||||
WINDOW *w_minimap;
|
||||
WINDOW *w_HP;
|
||||
WINDOW *w_moninfo;
|
||||
WINDOW *w_messages;
|
||||
WINDOW *w_location;
|
||||
WINDOW *w_status;
|
||||
WINDOW *w_void; //space unter status if viewport Y > 12
|
||||
overmap *om_hori, *om_vert, *om_diag; // Adjacent overmaps
|
||||
|
||||
bool handle_liquid(item &liquid, bool from_ground, bool infinite);
|
||||
|
||||
void open_gate( game *g, const int examx, const int examy, const enum ter_id handle_type );
|
||||
|
||||
private:
|
||||
// Game-start procedures
|
||||
bool opening_screen();
|
||||
void load(std::string name);
|
||||
void save();
|
||||
void start_game();
|
||||
void start_tutorial(tut_type type);
|
||||
bool opening_screen();// Warn about screen size, then present the main menu
|
||||
void print_menu(WINDOW* w_open, int iSel, const int iMenuOffsetX, int iMenuOffsetY, bool bShowDDA = true);
|
||||
void print_menu_items(WINDOW* w_in, std::vector<std::string> vItems, int iSel, int iOffsetY, int iOffsetX);
|
||||
bool load_master(); // Load the master data file, with factions &c
|
||||
void load(std::string name); // Load a player-specific save file
|
||||
void start_game(); // Starts a new game
|
||||
void start_special_game(special_game_id gametype); // See gamemode.cpp
|
||||
|
||||
// Data Initialization
|
||||
void init_itypes();
|
||||
void init_mapitems();
|
||||
void init_mtypes();
|
||||
void init_moncats();
|
||||
void init_monitems();
|
||||
void init_traps();
|
||||
void init_recipes();
|
||||
void init_factions();
|
||||
void init_itypes(); // Initializes item types
|
||||
void init_bionics(); // Initializes bionics... for now.
|
||||
void init_mapitems(); // Initializes item placement
|
||||
void init_mtypes(); // Initializes monster types
|
||||
void init_mongroups(); // Initualizes monster groups
|
||||
void init_monitems(); // Initializes monster inventory selection
|
||||
void init_traps(); // Initializes trap types
|
||||
void init_recipes(); // Initializes crafting recipes
|
||||
void init_construction(); // Initializes construction "recipes"
|
||||
void init_missions(); // Initializes mission templates
|
||||
void init_mutations(); // Initializes mutation "tech tree"
|
||||
void init_vehicles(); // Initializes vehicle types
|
||||
void init_autosave(); // Initializes autosave parameters
|
||||
|
||||
std::string default_npc_txt(); //load the default settings for the npc.txt file
|
||||
void load_keyboard_settings(); // Load keybindings from disk
|
||||
void load_npc_settings(); //load npc settings from disk
|
||||
|
||||
void save_keymap(); // Save keybindings to disk
|
||||
std::vector<char> keys_bound_to(action_id act); // All keys bound to act
|
||||
void clear_bindings(action_id act); // Deletes all keys bound to act
|
||||
|
||||
void create_factions(); // Creates new factions (for a new game world)
|
||||
void create_starting_npcs(); // Creates NPCs that start near you
|
||||
|
||||
// Player actions
|
||||
void wish();
|
||||
void plmove(int x, int y);
|
||||
void plswim(int x, int y);
|
||||
void update_map(int &x, int &y); // Called by plmove, sometimes
|
||||
void spawn_mon(int shift, int shifty); // Called by update_map, sometimes
|
||||
mon_id valid_monster_from(std::vector<mon_id> group);
|
||||
int valid_group(mon_id type, int x, int y);
|
||||
moncat_id mt_to_mc(mon_id type);
|
||||
void wait();
|
||||
void open();
|
||||
void close();
|
||||
void smash();
|
||||
void craft(); // See crafting.cpp
|
||||
void make_craft(recipe *making); // See crafting.cpp
|
||||
void complete_craft(); // See crafting.cpp
|
||||
void wish(); // Cheat by wishing for an item 'Z'
|
||||
void monster_wish(); // Create a monster
|
||||
void mutation_wish(); // Mutate
|
||||
|
||||
void pldrive(int x, int y); // drive vehicle
|
||||
void plmove(int x, int y); // Standard movement; handles attacks, traps, &c
|
||||
void wait(); // Long wait (player action) '^'
|
||||
void open(); // Open a door 'o'
|
||||
void close(); // Close a door 'c'
|
||||
void smash(); // Smash terrain
|
||||
void craft(); // See crafting.cpp
|
||||
void recraft(); // See crafting.cpp
|
||||
void long_craft(); // See crafting.cpp
|
||||
bool crafting_allowed(); // See crafting.cpp
|
||||
recipe* select_crafting_recipe(); // See crafting.cpp
|
||||
bool making_would_work(recipe *r); // See crafting.cpp
|
||||
bool can_make(recipe *r); // See crafting.cpp
|
||||
void make_craft(recipe *making); // See crafting.cpp
|
||||
void make_all_craft(recipe *making); // See crafting.cpp
|
||||
void complete_craft(); // See crafting.cpp
|
||||
void pick_recipes(std::vector<recipe*> ¤t,
|
||||
std::vector<bool> &available, craft_cat tab);// crafting.cpp
|
||||
void examine();
|
||||
void look_around();
|
||||
void pickup(int posx, int posy, int min);
|
||||
void drop();
|
||||
void butcher();
|
||||
void eat();
|
||||
void use_item();
|
||||
void wear();
|
||||
void takeoff();
|
||||
void reload();
|
||||
void unload();
|
||||
void wield();
|
||||
void read();
|
||||
void chat(); // Chat to an NPC
|
||||
void plthrow();
|
||||
std::vector<bool> &available, craft_cat tab,std::string filter);// crafting.cpp
|
||||
void disassemble(char ch = 0); // See crafting.cpp
|
||||
void complete_disassemble(); // See crafting.cpp
|
||||
void construction_menu(); // See construction.cpp
|
||||
bool player_can_build(player &p, inventory inv, constructable* con,
|
||||
const int level = -1, bool cont = false,
|
||||
bool exact_level=false);
|
||||
void place_construction(constructable *con); // See construction.cpp
|
||||
void complete_construction(); // See construction.cpp
|
||||
bool pl_choose_vehicle (int &x, int &y);
|
||||
bool vehicle_near ();
|
||||
void handbrake ();
|
||||
void examine();// Examine nearby terrain 'e'
|
||||
// open vehicle interaction screen
|
||||
void exam_vehicle(vehicle &veh, int examx, int examy, int cx=0, int cy=0);
|
||||
void pickup(int posx, int posy, int min);// Pickup items; ',' or via examine()
|
||||
// Pick where to put liquid; false if it's left where it was
|
||||
|
||||
void compare(int iCompareX = -999, int iCompareY = -999); // Compare two Items 'I'
|
||||
void drop(char chInput = '.'); // Drop an item 'd'
|
||||
void drop_in_direction(); // Drop w/ direction 'D'
|
||||
void reassign_item(); // Reassign the letter of an item '='
|
||||
void butcher(); // Butcher a corpse 'B'
|
||||
void complete_butcher(int index); // Finish the butchering process
|
||||
void forage(); // Foraging ('a' on underbrush)
|
||||
void eat(char chInput = '.'); // Eat food or fuel 'E' (or 'a')
|
||||
void use_item(char chInput = '.');// Use item; also tries E,R,W 'a'
|
||||
void use_wielded_item();
|
||||
void wear(char chInput = '.'); // Wear armor 'W' (or 'a')
|
||||
void takeoff(char chInput = '.'); // Remove armor 'T'
|
||||
void reload(); // Reload a wielded gun/tool 'r'
|
||||
void reload(char chInput);
|
||||
void unload(); // Unload a wielded gun/tool 'U'
|
||||
void unload(char chInput);
|
||||
void wield(char chInput = '.'); // Wield a weapon 'w'
|
||||
void read(); // Read a book 'R' (or 'a')
|
||||
void chat(); // Talk to a nearby NPC 'C'
|
||||
void plthrow(char chInput = '.'); // Throw an item 't'
|
||||
void help(); // Help screen '?'
|
||||
void show_options(); // Options screen '?'
|
||||
|
||||
// Target is an interactive function which allows the player to choose a nearby
|
||||
// square. It display information on any monster/NPC on that square, and also
|
||||
// returns a Bresenham line to that square. It is called by plfire() and
|
||||
// throw().
|
||||
std::vector<point> target(int &x, int &y, int lowx, int lowy, int hix,
|
||||
int hiy, std::vector <monster> t, int &target,
|
||||
item *relevent);
|
||||
void help();
|
||||
|
||||
// Map updating and monster spawning
|
||||
void replace_stair_monsters();
|
||||
void update_stair_monsters();
|
||||
void despawn_monsters(const bool stairs = false, const int shiftx = 0, const int shifty = 0);
|
||||
void spawn_mon(int shift, int shifty); // Called by update_map, sometimes
|
||||
int valid_group(mon_id type, int x, int y, int z);// Picks a group from cur_om
|
||||
void set_adjacent_overmaps(bool from_scratch = false);
|
||||
|
||||
// Routine loop functions, approximately in order of execution
|
||||
void monmove();
|
||||
void om_npcs_move();
|
||||
void check_warmth();
|
||||
void update_skills();
|
||||
void process_events();
|
||||
void process_activity();
|
||||
void hallucinate();
|
||||
void mon_info();
|
||||
void get_input();
|
||||
void update_scent();
|
||||
bool is_game_over();
|
||||
void gameover();
|
||||
void write_msg();
|
||||
void draw_minimap();
|
||||
void draw_HP();
|
||||
void cleanup_dead(); // Delete any dead NPCs/monsters
|
||||
void monmove(); // Monster movement
|
||||
void rustCheck(); // Degrades practice levels
|
||||
void process_events(); // Processes and enacts long-term events
|
||||
void process_activity(); // Processes and enacts the player's activity
|
||||
void update_weather(); // Updates the temperature and weather patten
|
||||
void hallucinate(const int x, const int y); // Prints hallucination junk to the screen
|
||||
void mon_info(); // Prints a list of nearby monsters (top right)
|
||||
bool handle_action();
|
||||
void update_scent(); // Updates the scent map
|
||||
bool is_game_over(); // Returns true if the player quit or died
|
||||
void death_screen(); // Display our stats, "GAME OVER BOO HOO"
|
||||
void gameover(); // Ends the game
|
||||
void write_msg(); // Prints the messages in the messages list
|
||||
void msg_buffer(); // Opens a window with old messages in it
|
||||
void draw_minimap(); // Draw the 5x5 minimap
|
||||
void draw_HP(); // Draws the player's HP and Power level
|
||||
int autosave_timeout(); // If autosave enabled, how long we should wait for user inaction before saving.
|
||||
void autosave(); // Saves map
|
||||
|
||||
// On-request draw functions
|
||||
void draw_overmap();
|
||||
void disp_kills();
|
||||
void disp_NPCs();
|
||||
|
||||
// If x & y are OOB, gens a new overmap returns the proper terrain; also, may
|
||||
// mark the square as seen by the player
|
||||
oter_id ter_at(int x, int y, bool& mark_as_seen);
|
||||
void draw_overmap(); // Draws the overmap, allows note-taking etc.
|
||||
void disp_kills(); // Display the player's kill counts
|
||||
void disp_NPCs(); // Currently UNUSED. Lists global NPCs.
|
||||
void list_missions(); // Listed current, completed and failed missions.
|
||||
|
||||
// Debug functions
|
||||
void debug();
|
||||
void display_scent();
|
||||
void mondebug();
|
||||
void groupdebug();
|
||||
// Data
|
||||
void debug(); // All-encompassing debug screen. TODO: This.
|
||||
void display_scent(); // Displays the scent map
|
||||
void mondebug(); // Debug monster behavior directly
|
||||
void groupdebug(); // Get into on monster groups
|
||||
|
||||
|
||||
|
||||
// ########################## DATA ################################
|
||||
|
||||
signed char last_target;// The last monster targeted
|
||||
char run_mode; // 0 - Normal run always; 1 - Running allowed, but if a new
|
||||
// monsters spawns, go to 2 - No movement allowed
|
||||
int mostseen; // # of mons seen last turn; if this increases, run_mode++
|
||||
int mostseen; // # of mons seen last turn; if this increases, run_mode++
|
||||
bool autosafemode; // is autosafemode enabled?
|
||||
int turnssincelastmon; // needed for auto run mode
|
||||
// quit_status uquit; // Set to true if the player quits ('Q')
|
||||
|
||||
bool uquit;
|
||||
|
||||
int nextspawn;
|
||||
signed char temp;
|
||||
std::vector <std::string> messages;
|
||||
char curmes; // The last-seen message. Older than 256 is deleted.
|
||||
int grscent[SEEX * 3][SEEY * 3]; // The scent map
|
||||
calendar nextspawn; // The turn on which monsters will spawn next.
|
||||
calendar nextweather; // The turn on which weather will shift next.
|
||||
int next_npc_id, next_faction_id, next_mission_id; // Keep track of UIDs
|
||||
std::vector <game_message> messages; // Messages to be printed
|
||||
int curmes; // The last-seen message.
|
||||
int grscent[SEEX * MAPSIZE][SEEY * MAPSIZE]; // The scent map
|
||||
//int monmap[SEEX * MAPSIZE][SEEY * MAPSIZE]; // Temp monster map, for mon_at()
|
||||
int nulscent; // Returned for OOB scent checks
|
||||
std::vector<recipe> recipes;
|
||||
std::vector<event> events;
|
||||
int kills[num_monsters];
|
||||
std::vector<event> events; // Game events to be processed
|
||||
int kills[num_monsters]; // Player's kill count
|
||||
std::string last_action; // The keypresses of last turn
|
||||
|
||||
bool tutorials_seen[NUM_LESSONS]; // Which tutorial lessons have we learned
|
||||
bool in_tutorial;
|
||||
int moves_since_last_save;
|
||||
int item_exchanges_since_save;
|
||||
unsigned char latest_lightlevel;
|
||||
calendar latest_lightlevel_turn;
|
||||
|
||||
special_game *gamemode;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -0,0 +1,35 @@
|
||||
#include "gamemode.h"
|
||||
#include "output.h"
|
||||
|
||||
std::string special_game_name(special_game_id id)
|
||||
{
|
||||
switch (id) {
|
||||
case SGAME_NULL:
|
||||
case NUM_SPECIAL_GAMES: return "nethack (this is a bug)";
|
||||
case SGAME_TUTORIAL: return "Tutorial";
|
||||
case SGAME_DEFENSE: return "Defense";
|
||||
default: return "Uncoded (this is a bug)";
|
||||
}
|
||||
}
|
||||
|
||||
special_game* get_special_game(special_game_id id)
|
||||
{
|
||||
special_game* ret;
|
||||
switch (id) {
|
||||
case SGAME_NULL:
|
||||
ret = new special_game;
|
||||
break;
|
||||
case SGAME_TUTORIAL:
|
||||
ret = new tutorial_game;
|
||||
break;
|
||||
case SGAME_DEFENSE:
|
||||
ret = new defense_game;
|
||||
break;
|
||||
default:
|
||||
debugmsg("Missing something in get_special_game()?");
|
||||
ret = new special_game;
|
||||
break;
|
||||
}
|
||||
|
||||
return ret;
|
||||
}
|
||||
+182
@@ -0,0 +1,182 @@
|
||||
#ifndef _GAMEMODE_H_
|
||||
#define _GAMEMODE_H_
|
||||
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "action.h"
|
||||
#include "itype.h"
|
||||
#include "mtype.h"
|
||||
|
||||
class game;
|
||||
struct special_game;
|
||||
|
||||
enum special_game_id {
|
||||
SGAME_NULL = 0,
|
||||
SGAME_TUTORIAL,
|
||||
SGAME_DEFENSE,
|
||||
NUM_SPECIAL_GAMES
|
||||
};
|
||||
|
||||
std::string special_game_name(special_game_id id);
|
||||
special_game* get_special_game(special_game_id id);
|
||||
|
||||
struct special_game
|
||||
{
|
||||
virtual special_game_id id() { return SGAME_NULL; };
|
||||
// init is run when the game begins
|
||||
virtual bool init(game *g) { return true; };
|
||||
// per_turn is run every turn--before any player actions
|
||||
virtual void per_turn(game *g) { };
|
||||
// pre_action is run after a keypress, but before the game handles the action
|
||||
// It may modify the action, e.g. to cancel it
|
||||
virtual void pre_action(game *g, action_id &act) { };
|
||||
// post_action is run after the game handles the action
|
||||
virtual void post_action(game *g, action_id act) { };
|
||||
// game_over is run when the player dies (or the game otherwise ends)
|
||||
virtual void game_over(game *g) { };
|
||||
|
||||
};
|
||||
|
||||
// TUTORIAL:
|
||||
|
||||
enum tut_lesson {
|
||||
LESSON_INTRO,
|
||||
LESSON_MOVE, LESSON_LOOK, LESSON_OPEN, LESSON_CLOSE, LESSON_SMASH,
|
||||
LESSON_WINDOW, LESSON_PICKUP, LESSON_EXAMINE, LESSON_INTERACT,
|
||||
|
||||
LESSON_FULL_INV, LESSON_WIELD_NO_SPACE, LESSON_AUTOWIELD, LESSON_ITEM_INTO_INV,
|
||||
LESSON_GOT_ARMOR, LESSON_GOT_WEAPON, LESSON_GOT_FOOD, LESSON_GOT_TOOL,
|
||||
LESSON_GOT_GUN, LESSON_GOT_AMMO, LESSON_WORE_ARMOR, LESSON_WORE_STORAGE,
|
||||
LESSON_WORE_MASK,
|
||||
|
||||
LESSON_WEAPON_INFO, LESSON_HIT_MONSTER, LESSON_PAIN, LESSON_BUTCHER,
|
||||
|
||||
LESSON_TOOK_PAINKILLER, LESSON_TOOK_CIG, LESSON_DRANK_WATER,
|
||||
|
||||
LESSON_ACT_GRENADE, LESSON_ACT_BUBBLEWRAP,
|
||||
|
||||
LESSON_OVERLOADED,
|
||||
|
||||
LESSON_GUN_LOAD, LESSON_GUN_FIRE, LESSON_RECOIL,
|
||||
|
||||
LESSON_STAIRS, LESSON_DARK_NO_FLASH, LESSON_DARK, LESSON_PICKUP_WATER,
|
||||
|
||||
NUM_LESSONS
|
||||
};
|
||||
|
||||
struct tutorial_game : public special_game
|
||||
{
|
||||
virtual special_game_id id() { return SGAME_TUTORIAL; };
|
||||
virtual bool init(game *g);
|
||||
virtual void per_turn(game *g);
|
||||
virtual void pre_action(game *g, action_id &act);
|
||||
virtual void post_action(game *g, action_id act);
|
||||
virtual void game_over(game *g) { };
|
||||
|
||||
private:
|
||||
void add_message(game *g, tut_lesson lesson);
|
||||
|
||||
bool tutorials_seen[NUM_LESSONS];
|
||||
};
|
||||
|
||||
|
||||
// DEFENSE
|
||||
|
||||
enum defense_style {
|
||||
DEFENSE_CUSTOM = 0,
|
||||
DEFENSE_EASY,
|
||||
DEFENSE_MEDIUM,
|
||||
DEFENSE_HARD,
|
||||
DEFENSE_SHAUN,
|
||||
DEFENSE_DAWN,
|
||||
DEFENSE_SPIDERS,
|
||||
DEFENSE_TRIFFIDS,
|
||||
DEFENSE_SKYNET,
|
||||
DEFENSE_LOVECRAFT,
|
||||
NUM_DEFENSE_STYLES
|
||||
};
|
||||
|
||||
enum defense_location {
|
||||
DEFLOC_NULL = 0,
|
||||
DEFLOC_HOSPITAL,
|
||||
DEFLOC_MALL,
|
||||
DEFLOC_BAR,
|
||||
DEFLOC_MANSION,
|
||||
NUM_DEFENSE_LOCATIONS
|
||||
};
|
||||
|
||||
enum caravan_category {
|
||||
CARAVAN_CART = 0,
|
||||
CARAVAN_MELEE,
|
||||
CARAVAN_GUNS,
|
||||
CARAVAN_COMPONENTS,
|
||||
CARAVAN_FOOD,
|
||||
CARAVAN_CLOTHES,
|
||||
CARAVAN_TOOLS,
|
||||
NUM_CARAVAN_CATEGORIES
|
||||
};
|
||||
|
||||
struct defense_game : public special_game
|
||||
{
|
||||
defense_game();
|
||||
|
||||
virtual special_game_id id() { return SGAME_DEFENSE; };
|
||||
virtual bool init(game *g);
|
||||
virtual void per_turn(game *g);
|
||||
virtual void pre_action(game *g, action_id &act);
|
||||
virtual void post_action(game *g, action_id act);
|
||||
virtual void game_over(game *g);
|
||||
|
||||
private:
|
||||
void init_to_style(defense_style new_style);
|
||||
void load_style(std::string style_name);
|
||||
|
||||
void setup();
|
||||
void refresh_setup(WINDOW *w, int selection);
|
||||
void init_itypes(game *g);
|
||||
void init_mtypes(game *g);
|
||||
void init_constructions(game *g);
|
||||
void init_recipes(game *g);
|
||||
void init_map(game *g);
|
||||
std::vector<itype_id> carvan_items(caravan_category cat);
|
||||
|
||||
void spawn_wave(game *g);
|
||||
void caravan(game *g);
|
||||
std::vector<mon_id> pick_monster_wave(game *g);
|
||||
void spawn_wave_monster(game *g, mtype *type);
|
||||
|
||||
std::string special_wave_message(std::string name);
|
||||
|
||||
|
||||
// DATA
|
||||
int current_wave;
|
||||
|
||||
defense_style style; // What type of game is it?
|
||||
defense_location location; // Where are we?
|
||||
|
||||
int initial_difficulty; // Total "level" of monsters in first wave
|
||||
int wave_difficulty; // Increased "level" of monsters per wave
|
||||
|
||||
int time_between_waves; // Cooldown / building / healing time
|
||||
int waves_between_caravans; // How many waves until we get to trade?
|
||||
|
||||
int initial_cash; // How much cash do we start with?
|
||||
int cash_per_wave; // How much cash do we get per wave?
|
||||
int cash_increase; // How much does the above increase per wave?
|
||||
|
||||
bool zombies;
|
||||
bool specials;
|
||||
bool spiders;
|
||||
bool triffids;
|
||||
bool robots;
|
||||
bool subspace;
|
||||
|
||||
bool hunger; // Do we hunger?
|
||||
bool thirst; // Do we thirst?
|
||||
bool sleep; // Do we need to sleep?
|
||||
|
||||
bool mercenaries; // Do caravans offer the option of hiring a mercenary?
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,26 @@
|
||||
#include "graffiti.h"
|
||||
#include "output.h"
|
||||
|
||||
graffiti::graffiti()
|
||||
{
|
||||
this->contents = NULL;
|
||||
}
|
||||
|
||||
graffiti::graffiti(std::string newstr)
|
||||
{
|
||||
this->contents = new std::string(newstr);
|
||||
}
|
||||
|
||||
graffiti::~graffiti()
|
||||
{
|
||||
// delete contents;
|
||||
}
|
||||
|
||||
graffiti graffiti::operator=(graffiti rhs)
|
||||
{
|
||||
if(rhs.contents)
|
||||
this->contents = new std::string(*rhs.contents);
|
||||
else
|
||||
this->contents = 0;
|
||||
return *this;
|
||||
}
|
||||
+18
@@ -0,0 +1,18 @@
|
||||
#ifndef _GRAFFITI_H_
|
||||
#define _GRAFFITI_H_
|
||||
|
||||
#include <string>
|
||||
#include "itype.h"
|
||||
#include "mtype.h"
|
||||
|
||||
class graffiti
|
||||
{
|
||||
public:
|
||||
graffiti();
|
||||
graffiti(std::string contents);
|
||||
~graffiti();
|
||||
graffiti operator=(graffiti rhs);
|
||||
std::string *contents;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,7 @@
|
||||
#ifndef RESOURCE_RC_INCLUDED
|
||||
#define RESOURCE_RC_INCLUDED
|
||||
|
||||
MAINICON ICON "data/cataicon.ico"
|
||||
|
||||
#endif // RESOURCE_RC_INCLUDED
|
||||
|
||||
+602
@@ -0,0 +1,602 @@
|
||||
//
|
||||
// iexamine.cpp
|
||||
// Cataclysm
|
||||
//
|
||||
// Livingstone
|
||||
//
|
||||
|
||||
#include "iuse.h"
|
||||
#include "game.h"
|
||||
#include "mapdata.h"
|
||||
#include "keypress.h"
|
||||
#include "output.h"
|
||||
#include "rng.h"
|
||||
#include "line.h"
|
||||
#include "player.h"
|
||||
#include <sstream>
|
||||
|
||||
void iexamine::none (game *g, player *p, map *m, int examx, int examy) {
|
||||
g->add_msg("That is a %s.", m->tername(examx, examy).c_str());
|
||||
};
|
||||
|
||||
void iexamine::gaspump(game *g, player *p, map *m, int examx, int examy) {
|
||||
if (!query_yn("Use the %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
item gas(g->itypes["gasoline"], g->turn);
|
||||
if (one_in(10 + p->dex_cur)) {
|
||||
g->add_msg("You accidentally spill the gasoline.");
|
||||
m->add_item(p->posx, p->posy, gas);
|
||||
} else {
|
||||
p->moves -= 300;
|
||||
g->handle_liquid(gas, false, true);
|
||||
}
|
||||
if (one_in(50)) {
|
||||
g->add_msg("With a clang and a shudder, the gas pump goes silent.");
|
||||
m->ter_set(examx, examy, t_gas_pump_empty);
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::elevator(game *g, player *p, map *m, int examx, int examy){
|
||||
if (!query_yn("Use the %s?",m->tername(examx, examy).c_str())) return;
|
||||
int movez = (g->levz < 0 ? 2 : -2);
|
||||
g->levz += movez;
|
||||
m->load(g, g->levx, g->levy, g->levz);
|
||||
g->update_map(p->posx, p->posy);
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (m->ter(x, y) == t_elevator) {
|
||||
p->posx = x;
|
||||
p->posy = y;
|
||||
}
|
||||
}
|
||||
}
|
||||
g->refresh_all();
|
||||
}
|
||||
|
||||
void iexamine::controls_gate(game *g, player *p, map *m, int examx, int examy) {
|
||||
if (!query_yn("Use the %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
g->open_gate(g,examx,examy, m->ter(examx,examy));
|
||||
}
|
||||
|
||||
void iexamine::cardreader(game *g, player *p, map *m, int examx, int examy) {
|
||||
itype_id card_type = (m->ter(examx, examy) == t_card_science ? "id_science" :
|
||||
"id_military");
|
||||
if (p->has_amount(card_type, 1) && query_yn("Swipe your ID card?")) {
|
||||
p->moves -= 100;
|
||||
for (int i = -3; i <= 3; i++) {
|
||||
for (int j = -3; j <= 3; j++) {
|
||||
if (m->ter(examx + i, examy + j) == t_door_metal_locked)
|
||||
m->ter_set(examx + i, examy + j, t_floor);
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < g->z.size(); i++) {
|
||||
if (g->z[i].type->id == mon_turret) {
|
||||
g->z.erase(g->z.begin() + i);
|
||||
i--;
|
||||
}
|
||||
}
|
||||
g->add_msg("You insert your ID card.");
|
||||
g->add_msg("The nearby doors slide into the floor.");
|
||||
p->use_amount(card_type, 1);
|
||||
} else {
|
||||
bool using_electrohack = (p->has_amount("electrohack", 1) &&
|
||||
query_yn("Use electrohack on the reader?"));
|
||||
bool using_fingerhack = (!using_electrohack && p->has_bionic("bio_fingerhack") &&
|
||||
p->power_level > 0 &&
|
||||
query_yn("Use fingerhack on the reader?"));
|
||||
if (using_electrohack || using_fingerhack) {
|
||||
p->moves -= 500;
|
||||
p->practice("computer", 20);
|
||||
int success = rng(p->skillLevel("computer") / 4 - 2, p->skillLevel("computer") * 2);
|
||||
success += rng(-3, 3);
|
||||
if (using_fingerhack)
|
||||
success++;
|
||||
if (p->int_cur < 8)
|
||||
success -= rng(0, int((8 - p->int_cur) / 2));
|
||||
else if (p->int_cur > 8)
|
||||
success += rng(0, int((p->int_cur - 8) / 2));
|
||||
if (success < 0) {
|
||||
g->add_msg("You cause a short circuit!");
|
||||
if (success <= -5) {
|
||||
if (using_electrohack) {
|
||||
g->add_msg("Your electrohack is ruined!");
|
||||
p->use_amount("electrohack", 1);
|
||||
} else {
|
||||
g->add_msg("Your power is drained!");
|
||||
p->charge_power(0 - rng(0, p->power_level));
|
||||
}
|
||||
}
|
||||
m->ter_set(examx, examy, t_card_reader_broken);
|
||||
} else if (success < 6)
|
||||
g->add_msg("Nothing happens.");
|
||||
else {
|
||||
g->add_msg("You activate the panel!");
|
||||
g->add_msg("The nearby doors slide into the floor.");
|
||||
m->ter_set(examx, examy, t_card_reader_broken);
|
||||
for (int i = -3; i <= 3; i++) {
|
||||
for (int j = -3; j <= 3; j++) {
|
||||
if (m->ter(examx + i, examy + j) == t_door_metal_locked)
|
||||
m->ter_set(examx + i, examy + j, t_floor);
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
g->add_msg("Looks like you need a %s.",g->itypes[card_type]->name.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::rubble(game *g, player *p, map *m, int examx, int examy) {
|
||||
if (!(p->has_amount("shovel", 1) || p->has_amount("primitive_shovel", 1))) {
|
||||
g->add_msg("If only you had a shovel...");
|
||||
return;
|
||||
}
|
||||
const char *xname = m->tername(examx, examy).c_str();
|
||||
if (query_yn("Clear up that %s?",xname)) {
|
||||
// "Remove"
|
||||
p->moves -= 200;
|
||||
|
||||
// "Replace"
|
||||
if(m->ter(examx,examy) == t_rubble) {
|
||||
item rock(g->itypes["rock"], g->turn);
|
||||
m->add_item(p->posx, p->posy, rock);
|
||||
m->add_item(p->posx, p->posy, rock);
|
||||
}
|
||||
|
||||
// "Refloor"
|
||||
if (g->levz < 0) {
|
||||
m->ter_set(examx, examy, t_rock_floor);
|
||||
} else {
|
||||
m->ter_set(examx, examy, t_dirt);
|
||||
}
|
||||
|
||||
// "Remind"
|
||||
g->add_msg("You clear up that %s.", xname);
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::chainfence(game *g, player *p, map *m, int examx, int examy) {
|
||||
if (!query_yn("Climb %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
p->moves -= 400;
|
||||
if (one_in(p->dex_cur)) {
|
||||
g->add_msg("You slip whilst climbing and fall down again");
|
||||
} else {
|
||||
p->moves += p->dex_cur * 10;
|
||||
p->posx = examx;
|
||||
p->posy = examy;
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::tent(game *g, player *p, map *m, int examx, int examy) {
|
||||
if (!query_yn("Take down your tent?")) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
p->moves -= 200;
|
||||
for (int i = -1; i <= 1; i++)
|
||||
for (int j = -1; j <= 1; j++)
|
||||
m->ter_set(examx + i, examy + j, t_dirt);
|
||||
g->add_msg("You take down the tent");
|
||||
item tent(g->itypes["tent_kit"], g->turn);
|
||||
m->add_item(examx, examy, tent);
|
||||
}
|
||||
|
||||
void iexamine::shelter(game *g, player *p, map *m, int examx, int examy) {
|
||||
if (!query_yn("Take down %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
p->moves -= 200;
|
||||
for (int i = -1; i <= 1; i++)
|
||||
for (int j = -1; j <= 1; j++)
|
||||
m->ter_set(examx + i, examy + j, t_dirt);
|
||||
g->add_msg("You take down the shelter");
|
||||
item tent(g->itypes["shelter_kit"], g->turn);
|
||||
m->add_item(examx, examy, tent);
|
||||
}
|
||||
|
||||
void iexamine::wreckage(game *g, player *p, map *m, int examx, int examy) {
|
||||
if (!(p->has_amount("shovel", 1) || p->has_amount("primitive_shovel", 1))) {
|
||||
g->add_msg("If only you had a shovel..");
|
||||
return;
|
||||
}
|
||||
|
||||
if (query_yn("Clear up that wreckage?")) {
|
||||
p->moves -= 200;
|
||||
m->ter_set(examx, examy, t_dirt);
|
||||
item chunk(g->itypes["steel_chunk"], g->turn);
|
||||
item scrap(g->itypes["scrap"], g->turn);
|
||||
item pipe(g->itypes["pipe"], g->turn);
|
||||
item wire(g->itypes["wire"], g->turn);
|
||||
m->add_item(examx, examy, chunk);
|
||||
m->add_item(examx, examy, scrap);
|
||||
if (one_in(5)) {
|
||||
m->add_item(examx, examy, pipe);
|
||||
m->add_item(examx, examy, wire); }
|
||||
g->add_msg("You clear the wreckage up");
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::pit(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!p->has_amount("2x4", 1)) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
if (query_yn("Place a plank over the pit?")) {
|
||||
p->use_amount("2x4", 1);
|
||||
m->ter_set(examx, examy, t_pit_covered);
|
||||
g->add_msg("You place a plank of wood over the pit");
|
||||
} else {
|
||||
g->add_msg("You need a plank of wood to do that");
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::pit_spiked(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!p->has_amount("2x4", 1)) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
if (query_yn("Place a plank over the pit?")) {
|
||||
p->use_amount("2x4", 1);
|
||||
m->ter_set(examx, examy, t_pit_spiked_covered);
|
||||
g->add_msg("You place a plank of wood over the pit");
|
||||
} else {
|
||||
g->add_msg("You need a plank of wood to do that");
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::pit_covered(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Remove cover?")) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
item plank(g->itypes["2x4"], g->turn);
|
||||
g->add_msg("You remove the plank.");
|
||||
m->add_item(p->posx, p->posy, plank);
|
||||
m->ter_set(examx, examy, t_pit);
|
||||
}
|
||||
|
||||
void iexamine::pit_spiked_covered(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Remove cover?")) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
|
||||
item plank(g->itypes["2x4"], g->turn);
|
||||
g->add_msg("You remove the plank.");
|
||||
m->add_item(p->posx, p->posy, plank);
|
||||
m->ter_set(examx, examy, t_pit_spiked);
|
||||
}
|
||||
|
||||
void iexamine::fence_post(game *g, player *p, map *m, int examx, int examy) {
|
||||
|
||||
int ch = menu("Fence Construction:", "Rope Fence", "Wire Fence",
|
||||
"Barbed Wire Fence", "Cancel", NULL);
|
||||
switch (ch){
|
||||
case 1:{
|
||||
if (p->has_amount("rope_6", 2)) {
|
||||
p->use_amount("rope_6", 2);
|
||||
m->ter_set(examx, examy, t_fence_rope);
|
||||
p->moves -= 200;
|
||||
} else
|
||||
g->add_msg("You need 2 six-foot lengths of rope to do that");
|
||||
} break;
|
||||
|
||||
case 2:{
|
||||
if (p->has_amount("wire", 2)) {
|
||||
p->use_amount("wire", 2);
|
||||
m->ter_set(examx, examy, t_fence_wire);
|
||||
p->moves -= 200;
|
||||
} else
|
||||
g->add_msg("You need 2 lengths of wire to do that!");
|
||||
} break;
|
||||
|
||||
case 3:{
|
||||
if (p->has_amount("wire_barbed", 2)) {
|
||||
p->use_amount("wire_barbed", 2);
|
||||
m->ter_set(examx, examy, t_fence_barbed);
|
||||
p->moves -= 200;
|
||||
} else
|
||||
g->add_msg("You need 2 lengths of barbed wire to do that!");
|
||||
} break;
|
||||
|
||||
case 4:
|
||||
default:
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::remove_fence_rope(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Remove %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
item rope(g->itypes["rope_6"], g->turn);
|
||||
m->add_item(p->posx, p->posy, rope);
|
||||
m->add_item(p->posx, p->posy, rope);
|
||||
m->ter_set(examx, examy, t_fence_post);
|
||||
p->moves -= 200;
|
||||
|
||||
}
|
||||
|
||||
void iexamine::remove_fence_wire(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Remove %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
|
||||
item rope(g->itypes["wire"], g->turn);
|
||||
m->add_item(p->posx, p->posy, rope);
|
||||
m->add_item(p->posx, p->posy, rope);
|
||||
m->ter_set(examx, examy, t_fence_post);
|
||||
p->moves -= 200;
|
||||
}
|
||||
|
||||
void iexamine::remove_fence_barbed(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Remove %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
|
||||
item rope(g->itypes["wire_barbed"], g->turn);
|
||||
m->add_item(p->posx, p->posy, rope);
|
||||
m->add_item(p->posx, p->posy, rope);
|
||||
m->ter_set(examx, examy, t_fence_post);
|
||||
p->moves -= 200;
|
||||
}
|
||||
|
||||
void iexamine::slot_machine(game *g, player *p, map *m, int examx, int examy) {
|
||||
if (p->cash < 10)
|
||||
g->add_msg("You need $10 to play.");
|
||||
else if (query_yn("Insert $10?")) {
|
||||
do {
|
||||
if (one_in(5))
|
||||
popup("Three cherries... you get your money back!");
|
||||
else if (one_in(20)) {
|
||||
popup("Three bells... you win $50!");
|
||||
p->cash += 40; // Minus the $10 we wagered
|
||||
} else if (one_in(50)) {
|
||||
popup("Three stars... you win $200!");
|
||||
p->cash += 190;
|
||||
} else if (one_in(1000)) {
|
||||
popup("JACKPOT! You win $5000!");
|
||||
p->cash += 4990;
|
||||
} else {
|
||||
popup("No win.");
|
||||
p->cash -= 10;
|
||||
}
|
||||
} while (p->cash >= 10 && query_yn("Play again?"));
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::bulletin_board(game *g, player *p, map *m, int examx, int examy) {
|
||||
basecamp *camp = m->camp_at(examx, examy);
|
||||
if (camp && camp->board_x() == examx && camp->board_y() == examy) {
|
||||
std::vector<std::string> options;
|
||||
options.push_back("Cancel");
|
||||
int choice = menu_vec(camp->board_name().c_str(), options) - 1;
|
||||
}
|
||||
else {
|
||||
bool create_camp = m->allow_camp(examx, examy);
|
||||
std::vector<std::string> options;
|
||||
if (create_camp)
|
||||
options.push_back("Create camp");
|
||||
options.push_back("Cancel");
|
||||
// TODO: Other Bulletin Boards
|
||||
int choice = menu_vec("Bulletin Board", options) - 1;
|
||||
if (choice >= 0 && choice < options.size()) {
|
||||
if (options[choice] == "Create camp") {
|
||||
// TODO: Allow text entry for name
|
||||
m->add_camp("Home", examx, examy);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::fault(game *g, player *p, map *m, int examx, int examy) {
|
||||
popup("\
|
||||
This wall is perfectly vertical. Odd, twisted holes are set in it, leading\n\
|
||||
as far back into the solid rock as you can see. The holes are humanoid in\n\
|
||||
shape, but with long, twisted, distended limbs.");
|
||||
}
|
||||
|
||||
void iexamine::pedestal_wyrm(game *g, player *p, map *m, int examx, int examy) {
|
||||
if (!m->i_at(examx, examy).empty()) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
g->add_msg("The pedestal sinks into the ground...");
|
||||
m->ter_set(examx, examy, t_rock_floor);
|
||||
g->add_event(EVENT_SPAWN_WYRMS, int(g->turn) + rng(5, 10));
|
||||
}
|
||||
|
||||
void iexamine::pedestal_temple(game *g, player *p, map *m, int examx, int examy) {
|
||||
|
||||
if (m->i_at(examx, examy).size() == 1 &&
|
||||
m->i_at(examx, examy)[0].type->id == "petrified_eye") {
|
||||
g->add_msg("The pedestal sinks into the ground...");
|
||||
m->ter_set(examx, examy, t_dirt);
|
||||
m->i_at(examx, examy).clear();
|
||||
g->add_event(EVENT_TEMPLE_OPEN, int(g->turn) + 4);
|
||||
} else if (p->has_amount("petrified_eye", 1) &&
|
||||
query_yn("Place your petrified eye on the pedestal?")) {
|
||||
p->use_amount("petrified_eye", 1);
|
||||
g->add_msg("The pedestal sinks into the ground...");
|
||||
m->ter_set(examx, examy, t_dirt);
|
||||
g->add_event(EVENT_TEMPLE_OPEN, int(g->turn) + 4);
|
||||
} else
|
||||
g->add_msg("This pedestal is engraved in eye-shaped diagrams, and has a large\
|
||||
semi-spherical indentation at the top.");
|
||||
}
|
||||
|
||||
void iexamine::fswitch(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Flip the %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
|
||||
p->moves -= 100;
|
||||
for (int y = examy; y <= examy + 5; y++) {
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
switch (m->ter(examx, examy)) {
|
||||
case t_switch_rg:
|
||||
if (m->ter(x, y) == t_rock_red)
|
||||
m->ter_set(x, y, t_floor_red);
|
||||
else if (m->ter(x, y) == t_floor_red)
|
||||
m->ter_set(x, y, t_rock_red);
|
||||
else if (m->ter(x, y) == t_rock_green)
|
||||
m->ter_set(x, y, t_floor_green);
|
||||
else if (m->ter(x, y) == t_floor_green)
|
||||
m->ter_set(x, y, t_rock_green);
|
||||
break;
|
||||
case t_switch_gb:
|
||||
if (m->ter(x, y) == t_rock_blue)
|
||||
m->ter_set(x, y, t_floor_blue);
|
||||
else if (m->ter(x, y) == t_floor_blue)
|
||||
m->ter_set(x, y, t_rock_blue);
|
||||
else if (m->ter(x, y) == t_rock_green)
|
||||
m->ter_set(x, y, t_floor_green);
|
||||
else if (m->ter(x, y) == t_floor_green)
|
||||
m->ter_set(x, y, t_rock_green);
|
||||
break;
|
||||
case t_switch_rb:
|
||||
if (m->ter(x, y) == t_rock_blue)
|
||||
m->ter_set(x, y, t_floor_blue);
|
||||
else if (m->ter(x, y) == t_floor_blue)
|
||||
m->ter_set(x, y, t_rock_blue);
|
||||
else if (m->ter(x, y) == t_rock_red)
|
||||
m->ter_set(x, y, t_floor_red);
|
||||
else if (m->ter(x, y) == t_floor_red)
|
||||
m->ter_set(x, y, t_rock_red);
|
||||
break;
|
||||
case t_switch_even:
|
||||
if ((y - examy) % 2 == 1) {
|
||||
if (m->ter(x, y) == t_rock_red)
|
||||
m->ter_set(x, y, t_floor_red);
|
||||
else if (m->ter(x, y) == t_floor_red)
|
||||
m->ter_set(x, y, t_rock_red);
|
||||
else if (m->ter(x, y) == t_rock_green)
|
||||
m->ter_set(x, y, t_floor_green);
|
||||
else if (m->ter(x, y) == t_floor_green)
|
||||
m->ter_set(x, y, t_rock_green);
|
||||
else if (m->ter(x, y) == t_rock_blue)
|
||||
m->ter_set(x, y, t_floor_blue);
|
||||
else if (m->ter(x, y) == t_floor_blue)
|
||||
m->ter_set(x, y, t_rock_blue);
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
g->add_msg("You hear the rumble of rock shifting.");
|
||||
g->add_event(EVENT_TEMPLE_SPAWN, g->turn + 3);
|
||||
}
|
||||
|
||||
void iexamine::flower_poppy(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Pick %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
|
||||
g->add_msg("This flower has a heady aroma");
|
||||
if (!(p->is_wearing("mask_filter")||p->is_wearing("mask_gas") ||
|
||||
one_in(3))) {
|
||||
g->add_msg("You fall asleep...");
|
||||
p->add_disease(DI_SLEEP, 1200, g);
|
||||
g->add_msg("Your legs are covered by flower's roots!");
|
||||
p->hurt(g,bp_legs, 0, 4);
|
||||
p->moves-=50;
|
||||
}
|
||||
m->ter_set(examx, examy, t_dirt);
|
||||
m->spawn_item(examx, examy, g->itypes["poppy_flower"],0);
|
||||
m->spawn_item(examx, examy, g->itypes["poppy_bud"],0);
|
||||
}
|
||||
|
||||
void iexamine::tree_apple(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Pick %s?",m->tername(examx, examy).c_str())) return;
|
||||
|
||||
int num_apples = rng(1, p->skillLevel("survival"));
|
||||
if (num_apples >= 12)
|
||||
num_apples = 12;
|
||||
for (int i = 0; i < num_apples; i++)
|
||||
m->spawn_item(examx, examy, g->itypes["apple"], g->turn, 0);
|
||||
|
||||
m->ter_set(examx, examy, t_tree);
|
||||
|
||||
}
|
||||
|
||||
void iexamine::shrub_blueberry(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Pick %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
|
||||
int num_blueberries = rng(1, p->skillLevel("survival"));
|
||||
|
||||
if (num_blueberries >= 12)
|
||||
num_blueberries = 12;
|
||||
for (int i = 0; i < num_blueberries; i++)
|
||||
m->spawn_item(examx, examy, g->itypes["blueberries"], g->turn, 0);
|
||||
|
||||
m->ter_set(examx, examy, t_shrub);
|
||||
}
|
||||
|
||||
void iexamine::shrub_wildveggies(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Pick %s?",m->tername(examx, examy).c_str())) return;
|
||||
|
||||
p->assign_activity(g, ACT_FORAGE, 500 / (p->skillLevel("survival") + 1), 0);
|
||||
p->activity.placement = point(examx, examy);
|
||||
p->moves = 0;
|
||||
}
|
||||
|
||||
void iexamine::recycler(game *g, player *p, map *m, int examx, int examy) {
|
||||
if(!query_yn("Use the %s?",m->tername(examx, examy).c_str())) {
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
|
||||
if (m->i_at(examx, examy).size() > 0)
|
||||
{
|
||||
g->sound(examx, examy, 80, "Ka-klunk!");
|
||||
int num_metal = 0;
|
||||
for (int i = 0; i < m->i_at(examx, examy).size(); i++)
|
||||
{
|
||||
item *it = &(m->i_at(examx, examy)[i]);
|
||||
if (it->made_of(STEEL))
|
||||
num_metal++;
|
||||
m->i_at(examx, examy).erase(m->i_at(examx, examy).begin() + i);
|
||||
i--;
|
||||
}
|
||||
if (num_metal > 0)
|
||||
{
|
||||
while (num_metal > 9)
|
||||
{
|
||||
m->spawn_item(p->posx, p->posy, g->itypes["steel_lump"], 0);
|
||||
num_metal -= 10;
|
||||
}
|
||||
do
|
||||
{
|
||||
m->spawn_item(p->posx, p->posy, g->itypes["steel_chunk"], 0);
|
||||
num_metal -= 3;
|
||||
} while (num_metal > 2);
|
||||
}
|
||||
}
|
||||
else g->add_msg("The recycler is empty.");
|
||||
}
|
||||
|
||||
void iexamine::trap(game *g, player *p, map *m, int examx, int examy) {
|
||||
if (g->traps[m->tr_at(examx, examy)]->difficulty < 99 &&
|
||||
p->per_cur-p->encumb(bp_eyes) >= g->traps[m->tr_at(examx, examy)]->visibility &&
|
||||
query_yn("There is a %s there. Disarm?",
|
||||
g->traps[m->tr_at(examx, examy)]->name.c_str())) {
|
||||
m->disarm_trap(g, examx, examy);
|
||||
}
|
||||
}
|
||||
+54
@@ -0,0 +1,54 @@
|
||||
//
|
||||
// iexamine.h
|
||||
// Cataclysm
|
||||
//
|
||||
// Livingstone
|
||||
//
|
||||
|
||||
#ifndef __Cataclysmic__iexamine__
|
||||
#define __Cataclysmic__iexamine__
|
||||
|
||||
//#include <iostream>
|
||||
|
||||
class game;
|
||||
class item;
|
||||
class player;
|
||||
class map;
|
||||
|
||||
class iexamine
|
||||
{
|
||||
public:
|
||||
void none (game *g, player *p, map *m, int examx, int examy);
|
||||
|
||||
void gaspump (game *g, player *p, map *m, int examx, int examy);
|
||||
void elevator (game *g, player *p, map *m, int examx, int examy);
|
||||
void controls_gate(game *g, player *p, map *m, int examx, int examy);
|
||||
void cardreader (game *g, player *p, map *m, int examx, int examy);
|
||||
void rubble (game *g, player *p, map *m, int examx, int examy);
|
||||
void chainfence (game *g, player *p, map *m, int examx, int examy);
|
||||
void tent (game *g, player *p, map *m, int examx, int examy);
|
||||
void shelter (game *g, player *p, map *m, int examx, int examy);
|
||||
void wreckage (game *g, player *p, map *m, int examx, int examy);
|
||||
void pit (game *g, player *p, map *m, int examx, int examy);
|
||||
void pit_spiked (game *g, player *p, map *m, int examx, int examy);
|
||||
void pit_covered (game *g, player *p, map *m, int examx, int examy);
|
||||
void pit_spiked_covered (game *g, player *p, map *m, int examx, int examy);
|
||||
void fence_post (game *g, player *p, map *m, int examx, int examy);
|
||||
void remove_fence_rope (game *g, player *p, map *m, int examx, int examy);
|
||||
void remove_fence_wire (game *g, player *p, map *m, int examx, int examy);
|
||||
void remove_fence_barbed (game *g, player *p, map *m, int examx, int examy);
|
||||
void slot_machine (game *g, player *p, map *m, int examx, int examy);
|
||||
void bulletin_board (game *g, player *p, map *m, int examx, int examy);
|
||||
void fault (game *g, player *p, map *m, int examx, int examy);
|
||||
void pedestal_wyrm (game *g, player *p, map *m, int examx, int examy);
|
||||
void pedestal_temple (game *g, player *p, map *m, int examx, int examy);
|
||||
void fswitch (game *g, player *p, map *m, int examx, int examy);
|
||||
void flower_poppy (game *g, player *p, map *m, int examx, int examy);
|
||||
void tree_apple (game *g, player *p, map *m, int examx, int examy);
|
||||
void shrub_blueberry (game *g, player *p, map *m, int examx, int examy);
|
||||
void shrub_wildveggies (game *g, player *p, map *m, int examx, int examy);
|
||||
void recycler (game *g, player *p, map *m, int examx, int examy);
|
||||
void trap(game *g, player *p, map *m, int examx, int examy);
|
||||
};
|
||||
|
||||
#endif /* defined(__Cataclysmic__iexamine__) */
|
||||
@@ -0,0 +1,116 @@
|
||||
#include "cursesdef.h"
|
||||
#include "input.h"
|
||||
|
||||
/* TODO Replace the hardcoded values with an abstraction layer.
|
||||
* Lower redundancy across the methods. */
|
||||
|
||||
InputEvent get_input(int ch)
|
||||
{
|
||||
if (ch == '\0')
|
||||
ch = getch();
|
||||
|
||||
switch(ch)
|
||||
{
|
||||
case 'k':
|
||||
case '8':
|
||||
case KEY_UP:
|
||||
return DirectionN;
|
||||
case 'j':
|
||||
case '2':
|
||||
case KEY_DOWN:
|
||||
return DirectionS;
|
||||
case 'l':
|
||||
case '6':
|
||||
case KEY_RIGHT:
|
||||
return DirectionE;
|
||||
case 'h':
|
||||
case '4':
|
||||
case KEY_LEFT:
|
||||
return DirectionW;
|
||||
case 'y':
|
||||
case '7':
|
||||
return DirectionNW;
|
||||
case 'u':
|
||||
case '9':
|
||||
return DirectionNE;
|
||||
case 'b':
|
||||
case '1':
|
||||
return DirectionSW;
|
||||
case 'n':
|
||||
case '3':
|
||||
return DirectionSE;
|
||||
case '.':
|
||||
case '5':
|
||||
return DirectionNone;
|
||||
case '>':
|
||||
return DirectionDown;
|
||||
case '<':
|
||||
return DirectionUp;
|
||||
|
||||
case '\n':
|
||||
return Confirm;
|
||||
case ' ':
|
||||
return Close;
|
||||
case 27: /* TODO Fix delay */
|
||||
case 'q':
|
||||
return Cancel;
|
||||
case '?':
|
||||
return Help;
|
||||
|
||||
case ',':
|
||||
case 'g':
|
||||
return Pickup;
|
||||
case 'f':
|
||||
case 'F':
|
||||
return Filter;
|
||||
case 'r':
|
||||
case 'R':
|
||||
return Reset;
|
||||
default:
|
||||
return Undefined;
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
void get_direction(int &x, int &y, InputEvent &input)
|
||||
{
|
||||
x = 0;
|
||||
y = 0;
|
||||
|
||||
switch(input) {
|
||||
case DirectionN:
|
||||
--y;
|
||||
break;
|
||||
case DirectionS:
|
||||
++y;
|
||||
break;
|
||||
case DirectionE:
|
||||
++x;
|
||||
break;
|
||||
case DirectionW:
|
||||
--x;
|
||||
break;
|
||||
case DirectionNW:
|
||||
--x;
|
||||
--y;
|
||||
break;
|
||||
case DirectionNE:
|
||||
++x;
|
||||
--y;
|
||||
break;
|
||||
case DirectionSW:
|
||||
--x;
|
||||
++y;
|
||||
break;
|
||||
case DirectionSE:
|
||||
++x;
|
||||
++y;
|
||||
break;
|
||||
case DirectionNone:
|
||||
case Pickup:
|
||||
break;
|
||||
default:
|
||||
x = -2;
|
||||
y = -2;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef _INPUT_H_
|
||||
#define _INPUT_H_
|
||||
|
||||
enum InputEvent {
|
||||
Confirm,
|
||||
Cancel,
|
||||
Close,
|
||||
Help,
|
||||
|
||||
DirectionN,
|
||||
DirectionS,
|
||||
DirectionE,
|
||||
DirectionW,
|
||||
DirectionNW,
|
||||
DirectionNE,
|
||||
DirectionSE,
|
||||
DirectionSW,
|
||||
DirectionNone,
|
||||
|
||||
DirectionDown, /* Think stairs */
|
||||
DirectionUp,
|
||||
Filter,
|
||||
Reset,
|
||||
Pickup,
|
||||
Nothing,
|
||||
Undefined
|
||||
};
|
||||
|
||||
InputEvent get_input(int ch = '\0');
|
||||
void get_direction(int &x, int &y, InputEvent &input);
|
||||
|
||||
#endif
|
||||
+505
@@ -0,0 +1,505 @@
|
||||
#include <sstream>
|
||||
#include "inventory.h"
|
||||
#include "game.h"
|
||||
#include "keypress.h"
|
||||
#include "mapdata.h"
|
||||
|
||||
const std::string inv_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#&()*+./:;=?@[\\]^_{|}";
|
||||
|
||||
item& inventory::operator[] (int i)
|
||||
{
|
||||
if (i < 0 || i > items.size()) {
|
||||
debugmsg("Attempted to access item %d in an inventory (size %d)",
|
||||
i, items.size());
|
||||
return nullitem;
|
||||
}
|
||||
|
||||
return items[i][0];
|
||||
}
|
||||
|
||||
std::vector<item>& inventory::stack_at(int i)
|
||||
{
|
||||
if (i < 0 || i > items.size()) {
|
||||
debugmsg("Attempted to access stack %d in an inventory (size %d)",
|
||||
i, items.size());
|
||||
return nullstack;
|
||||
}
|
||||
return items[i];
|
||||
}
|
||||
|
||||
std::vector<item> inventory::const_stack(int i) const
|
||||
{
|
||||
if (i < 0 || i > items.size()) {
|
||||
debugmsg("Attempted to access stack %d in an inventory (size %d)",
|
||||
i, items.size());
|
||||
return nullstack;
|
||||
}
|
||||
return items[i];
|
||||
}
|
||||
|
||||
std::vector<item> inventory::as_vector()
|
||||
{
|
||||
std::vector<item> ret;
|
||||
for (int i = 0; i < size(); i++) {
|
||||
for (int j = 0; j < stack_at(i).size(); j++)
|
||||
ret.push_back(items[i][j]);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int inventory::size() const
|
||||
{
|
||||
return items.size();
|
||||
}
|
||||
|
||||
int inventory::num_items() const
|
||||
{
|
||||
int ret = 0;
|
||||
for (int i = 0; i < items.size(); i++)
|
||||
ret += items[i].size();
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
inventory& inventory::operator= (inventory &rhs)
|
||||
{
|
||||
if (this == &rhs)
|
||||
return *this; // No self-assignment
|
||||
|
||||
clear();
|
||||
for (int i = 0; i < rhs.size(); i++)
|
||||
items.push_back(rhs.stack_at(i));
|
||||
return *this;
|
||||
}
|
||||
|
||||
inventory& inventory::operator= (const inventory &rhs)
|
||||
{
|
||||
if (this == &rhs)
|
||||
return *this; // No self-assignment
|
||||
|
||||
clear();
|
||||
for (int i = 0; i < rhs.size(); i++)
|
||||
items.push_back(rhs.const_stack(i));
|
||||
return *this;
|
||||
}
|
||||
|
||||
inventory& inventory::operator+= (const inventory &rhs)
|
||||
{
|
||||
for (int i = 0; i < rhs.size(); i++)
|
||||
add_stack(rhs.const_stack(i));
|
||||
return *this;
|
||||
}
|
||||
|
||||
inventory& inventory::operator+= (const std::vector<item> &rhs)
|
||||
{
|
||||
for (int i = 0; i < rhs.size(); i++)
|
||||
add_item(rhs[i]);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inventory& inventory::operator+= (const item &rhs)
|
||||
{
|
||||
add_item(rhs);
|
||||
return *this;
|
||||
}
|
||||
|
||||
inventory inventory::operator+ (const inventory &rhs)
|
||||
{
|
||||
return inventory(*this) += rhs;
|
||||
}
|
||||
|
||||
inventory inventory::operator+ (const std::vector<item> &rhs)
|
||||
{
|
||||
return inventory(*this) += rhs;
|
||||
}
|
||||
|
||||
inventory inventory::operator+ (const item &rhs)
|
||||
{
|
||||
return inventory(*this) += rhs;
|
||||
}
|
||||
|
||||
void inventory::clear()
|
||||
{
|
||||
items.clear();
|
||||
}
|
||||
|
||||
void inventory::add_stack(const std::vector<item> newits)
|
||||
{
|
||||
for (int i = 0; i < newits.size(); i++)
|
||||
add_item(newits[i], true);
|
||||
}
|
||||
|
||||
void inventory::push_back(std::vector<item> newits)
|
||||
{
|
||||
add_stack(newits);
|
||||
}
|
||||
|
||||
void inventory::add_item(item newit, bool keep_invlet)
|
||||
{
|
||||
if (keep_invlet && !newit.invlet_is_okay())
|
||||
assign_empty_invlet(newit); // Keep invlet is true, but invlet is invalid!
|
||||
|
||||
if (newit.is_style())
|
||||
return; // Styles never belong in our inventory.
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
if (items[i][0].stacks_with(newit)) {
|
||||
if (items[i][0].is_food() && items[i][0].has_flag(IF_HOT)) {
|
||||
int tmpcounter = (items[i][0].item_counter + newit.item_counter) / 2;
|
||||
items[i][0].item_counter = tmpcounter;
|
||||
newit.item_counter = tmpcounter;
|
||||
}
|
||||
newit.invlet = items[i][0].invlet;
|
||||
items[i].push_back(newit);
|
||||
return;
|
||||
} else if (keep_invlet && items[i][0].invlet == newit.invlet)
|
||||
assign_empty_invlet(items[i][0]);
|
||||
}
|
||||
if (!newit.invlet_is_okay() || index_by_letter(newit.invlet) != -1)
|
||||
assign_empty_invlet(newit);
|
||||
|
||||
std::vector<item> newstack;
|
||||
newstack.push_back(newit);
|
||||
items.push_back(newstack);
|
||||
}
|
||||
|
||||
void inventory::add_item_keep_invlet(item newit)
|
||||
{
|
||||
add_item(newit, true);
|
||||
}
|
||||
|
||||
void inventory::push_back(item newit)
|
||||
{
|
||||
add_item(newit);
|
||||
}
|
||||
|
||||
void inventory::restack(player *p)
|
||||
{
|
||||
inventory tmp;
|
||||
for (int i = 0; i < size(); i++) {
|
||||
for (int j = 0; j < items[i].size(); j++)
|
||||
tmp.add_item(items[i][j]);
|
||||
}
|
||||
clear();
|
||||
if (p) {
|
||||
for (int i = 0; i < tmp.size(); i++) {
|
||||
if (!tmp[i].invlet_is_okay() || p->has_weapon_or_armor(tmp[i].invlet)) {
|
||||
//debugmsg("Restacking item %d (invlet %c)", i, tmp[i].invlet);
|
||||
tmp.assign_empty_invlet(tmp[i], p);
|
||||
for (int j = 1; j < tmp.stack_at(i).size(); j++)
|
||||
tmp.stack_at(i)[j].invlet = tmp[i].invlet;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < tmp.size(); i++)
|
||||
items.push_back(tmp.stack_at(i));
|
||||
}
|
||||
|
||||
void inventory::form_from_map(game *g, point origin, int range)
|
||||
{
|
||||
items.clear();
|
||||
for (int x = origin.x - range; x <= origin.x + range; x++) {
|
||||
for (int y = origin.y - range; y <= origin.y + range; y++) {
|
||||
for (int i = 0; i < g->m.i_at(x, y).size(); i++)
|
||||
if (!g->m.i_at(x, y)[i].made_of(LIQUID))
|
||||
add_item(g->m.i_at(x, y)[i]);
|
||||
// Kludges for now!
|
||||
if (g->m.field_at(x, y).type == fd_fire) {
|
||||
item fire(g->itypes["fire"], 0);
|
||||
fire.charges = 1;
|
||||
add_item(fire);
|
||||
}
|
||||
ter_id terrain_id = g->m.ter(x, y);
|
||||
if (terrain_id == t_toilet || terrain_id == t_water_sh || terrain_id == t_water_dp){
|
||||
item water(g->itypes["water"], 0);
|
||||
water.charges = 50;
|
||||
add_item(water);
|
||||
}
|
||||
|
||||
int vpart = -1;
|
||||
vehicle *veh = g->m.veh_at(x, y, vpart);
|
||||
|
||||
if (veh) {
|
||||
const int kpart = veh->part_with_feature(vpart, vpf_kitchen);
|
||||
|
||||
if (kpart >= 0) {
|
||||
item hotplate(g->itypes["hotplate"], 0);
|
||||
hotplate.charges = veh->fuel_left(AT_BATT, true);
|
||||
add_item(hotplate);
|
||||
|
||||
item water(g->itypes["water_clean"], 0);
|
||||
water.charges = veh->fuel_left(AT_WATER);
|
||||
add_item(water);
|
||||
|
||||
item pot(g->itypes["pot"], 0);
|
||||
add_item(pot);
|
||||
item pan(g->itypes["pan"], 0);
|
||||
add_item(pan);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::vector<item> inventory::remove_stack(int index)
|
||||
{
|
||||
if (index < 0 || index >= items.size()) {
|
||||
debugmsg("Tried to remove_stack(%d) from an inventory (size %d)",
|
||||
index, items.size());
|
||||
std::vector<item> nullvector;
|
||||
return nullvector;
|
||||
}
|
||||
std::vector<item> ret = stack_at(index);
|
||||
items.erase(items.begin() + index);
|
||||
return ret;
|
||||
}
|
||||
|
||||
item inventory::remove_item(int index)
|
||||
{
|
||||
if (index < 0 || index >= items.size()) {
|
||||
debugmsg("Tried to remove_item(%d) from an inventory (size %d)",
|
||||
index, items.size());
|
||||
return nullitem;
|
||||
}
|
||||
item ret = items[index][0];
|
||||
items[index].erase(items[index].begin());
|
||||
if (items[index].empty())
|
||||
items.erase(items.begin() + index);
|
||||
return ret;
|
||||
}
|
||||
|
||||
item inventory::remove_item(int stack, int index)
|
||||
{
|
||||
if (stack < 0 || stack >= items.size()) {
|
||||
debugmsg("Tried to remove_item(%d, %d) from an inventory (size %d)",
|
||||
stack, index, items.size());
|
||||
return nullitem;
|
||||
} else if (index < 0 || index >= items[stack].size()) {
|
||||
debugmsg("Tried to remove_item(%d, %d) from an inventory (stack is size %d)",
|
||||
stack, index, items[stack].size());
|
||||
return nullitem;
|
||||
}
|
||||
|
||||
item ret = items[stack][index];
|
||||
items[stack].erase(items[stack].begin() + index);
|
||||
if (items[stack].empty())
|
||||
items.erase(items.begin() + stack);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
item inventory::remove_item_by_letter(char ch)
|
||||
{
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
if (items[i][0].invlet == ch) {
|
||||
if (items[i].size() > 1)
|
||||
items[i][1].invlet = ch;
|
||||
return remove_item(i);
|
||||
}
|
||||
}
|
||||
|
||||
return nullitem;
|
||||
}
|
||||
|
||||
item inventory::remove_item_by_quantity(int index, int quantity)
|
||||
{
|
||||
// using this assumes the item has charges
|
||||
|
||||
if (index < 0 || index >= items.size()) {
|
||||
debugmsg("Quantity: Tried to remove_item(%d) from an inventory (size %d)",
|
||||
index, items.size());
|
||||
return nullitem;
|
||||
}
|
||||
|
||||
item ret = items[index][0];
|
||||
ret.charges = quantity;
|
||||
|
||||
return ret;
|
||||
|
||||
}
|
||||
|
||||
item& inventory::item_by_letter(char ch)
|
||||
{
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
if (items[i][0].invlet == ch)
|
||||
return items[i][0];
|
||||
}
|
||||
return nullitem;
|
||||
}
|
||||
|
||||
int inventory::index_by_letter(char ch)
|
||||
{
|
||||
if (ch == KEY_ESCAPE)
|
||||
return -1;
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
if (items[i][0].invlet == ch)
|
||||
return i;
|
||||
}
|
||||
return -1;
|
||||
}
|
||||
|
||||
int inventory::amount_of(itype_id it)
|
||||
{
|
||||
int count = 0;
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
for (int j = 0; j < items[i].size(); j++) {
|
||||
if (items[i][j].type->id == it)
|
||||
{
|
||||
// check if it's a container, if so, it should be empty
|
||||
if (items[i][j].type->is_container())
|
||||
{
|
||||
if (items[i][j].contents.empty())
|
||||
count++;
|
||||
} else count++;
|
||||
}
|
||||
for (int k = 0; k < items[i][j].contents.size(); k++) {
|
||||
if (items[i][j].contents[k].type->id == it)
|
||||
count++;
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
int inventory::charges_of(itype_id it)
|
||||
{
|
||||
int count = 0;
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
for (int j = 0; j < items[i].size(); j++) {
|
||||
if (items[i][j].type->id == it) {
|
||||
if (items[i][j].charges < 0)
|
||||
count++;
|
||||
else
|
||||
count += items[i][j].charges;
|
||||
}
|
||||
for (int k = 0; k < items[i][j].contents.size(); k++) {
|
||||
if (items[i][j].contents[k].type->id == it) {
|
||||
if (items[i][j].contents[k].charges < 0)
|
||||
count++;
|
||||
else
|
||||
count += items[i][j].contents[k].charges;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
|
||||
void inventory::use_amount(itype_id it, int quantity, bool use_container)
|
||||
{
|
||||
for (int i = 0; i < items.size() && quantity > 0; i++) {
|
||||
for (int j = 0; j < items[i].size() && quantity > 0; j++) {
|
||||
// First, check contents
|
||||
bool used_item_contents = false;
|
||||
for (int k = 0; k < items[i][j].contents.size() && quantity > 0; k++) {
|
||||
if (items[i][j].contents[k].type->id == it) {
|
||||
quantity--;
|
||||
items[i][j].contents.erase(items[i][j].contents.begin() + k);
|
||||
k--;
|
||||
used_item_contents = true;
|
||||
}
|
||||
}
|
||||
// Now check the item itself
|
||||
if (use_container && used_item_contents) {
|
||||
items[i].erase(items[i].begin() + j);
|
||||
j--;
|
||||
if (items[i].empty()) {
|
||||
items.erase(items.begin() + i);
|
||||
i--;
|
||||
j = 0;
|
||||
}
|
||||
} else if (items[i][j].type->id == it && quantity > 0) {
|
||||
quantity--;
|
||||
items[i].erase(items[i].begin() + j);
|
||||
j--;
|
||||
if (items[i].empty()) {
|
||||
items.erase(items.begin() + i);
|
||||
i--;
|
||||
j = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void inventory::use_charges(itype_id it, int quantity)
|
||||
{
|
||||
for (int i = 0; i < items.size() && quantity > 0; i++) {
|
||||
for (int j = 0; j < items[i].size() && quantity > 0; j++) {
|
||||
// First, check contents
|
||||
for (int k = 0; k < items[i][j].contents.size() && quantity > 0; k++) {
|
||||
if (items[i][j].contents[k].type->id == it) {
|
||||
if (items[i][j].contents[k].charges <= quantity) {
|
||||
quantity -= items[i][j].contents[k].charges;
|
||||
if (items[i][j].contents[k].destroyed_at_zero_charges()) {
|
||||
items[i][j].contents.erase(items[i][j].contents.begin() + k);
|
||||
k--;
|
||||
} else
|
||||
items[i][j].contents[k].charges = 0;
|
||||
} else {
|
||||
items[i][j].contents[k].charges -= quantity;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
// Now check the item itself
|
||||
if (items[i][j].type->id == it) {
|
||||
if (items[i][j].charges <= quantity) {
|
||||
quantity -= items[i][j].charges;
|
||||
if (items[i][j].destroyed_at_zero_charges()) {
|
||||
items[i].erase(items[i].begin() + j);
|
||||
j--;
|
||||
if (items[i].empty()) {
|
||||
items.erase(items.begin() + i);
|
||||
i--;
|
||||
j = 0;
|
||||
}
|
||||
} else
|
||||
items[i][j].charges = 0;
|
||||
} else {
|
||||
items[i][j].charges -= quantity;
|
||||
return;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
bool inventory::has_amount(itype_id it, int quantity)
|
||||
{
|
||||
return (amount_of(it) >= quantity);
|
||||
}
|
||||
|
||||
bool inventory::has_charges(itype_id it, int quantity)
|
||||
{
|
||||
return (charges_of(it) >= quantity);
|
||||
}
|
||||
|
||||
bool inventory::has_item(item *it)
|
||||
{
|
||||
for (int i = 0; i < items.size(); i++) {
|
||||
for (int j = 0; j < items[i].size(); j++) {
|
||||
if (it == &(items[i][j]))
|
||||
return true;
|
||||
for (int k = 0; k < items[i][j].contents.size(); k++) {
|
||||
if (it == &(items[i][j].contents[k]))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void inventory::assign_empty_invlet(item &it, player *p)
|
||||
{
|
||||
for (std::string::const_iterator newinvlet = inv_chars.begin();
|
||||
newinvlet != inv_chars.end();
|
||||
newinvlet++) {
|
||||
if (index_by_letter(*newinvlet) == -1 && (!p || !p->has_weapon_or_armor(*newinvlet))) {
|
||||
it.invlet = *newinvlet;
|
||||
return;
|
||||
}
|
||||
}
|
||||
it.invlet = '`';
|
||||
//debugmsg("Couldn't find empty invlet");
|
||||
}
|
||||
+81
@@ -0,0 +1,81 @@
|
||||
#ifndef _INVENTORY_H_
|
||||
#define _INVENTORY_H_
|
||||
|
||||
#include "item.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
|
||||
class game;
|
||||
class map;
|
||||
|
||||
const extern std::string inv_chars;
|
||||
|
||||
class inventory
|
||||
{
|
||||
public:
|
||||
item& operator[] (int i);
|
||||
std::vector<item>& stack_at(int i);
|
||||
std::vector<item> const_stack(int i) const;
|
||||
std::vector<item> as_vector();
|
||||
item& front();
|
||||
item& back();
|
||||
int size() const;
|
||||
int num_items() const;
|
||||
|
||||
inventory& operator= (inventory &rhs);
|
||||
inventory& operator= (const inventory &rhs);
|
||||
inventory& operator+= (const inventory &rhs);
|
||||
inventory& operator+= (const item &rhs);
|
||||
inventory& operator+= (const std::vector<item> &rhs);
|
||||
inventory operator+ (const inventory &rhs);
|
||||
inventory operator+ (const item &rhs);
|
||||
inventory operator+ (const std::vector<item> &rhs);
|
||||
|
||||
void clear();
|
||||
void add_stack(std::vector<item> newits);
|
||||
void push_back(std::vector<item> newits);
|
||||
void add_item (item newit, bool keep_invlet = false);
|
||||
void add_item_keep_invlet(item newit);
|
||||
void push_back(item newit);
|
||||
|
||||
/* Check all items for proper stacking, rearranging as needed
|
||||
* game pointer is not necessary, but if supplied, will ensure no overlap with
|
||||
* the player's worn items / weapon
|
||||
*/
|
||||
void restack(player *p = NULL);
|
||||
|
||||
void form_from_map(game *g, point origin, int distance);
|
||||
|
||||
std::vector<item> remove_stack(int index);
|
||||
item remove_item(int index);
|
||||
item remove_item(int stack, int index);
|
||||
item remove_item_by_letter(char ch);
|
||||
item remove_item_by_quantity(int index, int quantity);
|
||||
item& item_by_letter(char ch);
|
||||
int index_by_letter(char ch);
|
||||
|
||||
// Below, "amount" refers to quantity
|
||||
// "charges" refers to charges
|
||||
int amount_of (itype_id it);
|
||||
int charges_of(itype_id it);
|
||||
|
||||
void use_amount (itype_id it, int quantity, bool use_container = false);
|
||||
void use_charges(itype_id it, int quantity);
|
||||
|
||||
bool has_amount (itype_id it, int quantity);
|
||||
bool has_charges(itype_id it, int quantity);
|
||||
bool has_item(item *it); // Looks for a specific item
|
||||
|
||||
/* TODO: This stuff, I guess?
|
||||
std::string save();
|
||||
void load(std::string data);
|
||||
*/
|
||||
|
||||
item nullitem;
|
||||
std::vector<item> nullstack;
|
||||
private:
|
||||
void assign_empty_invlet(item &it, player *p = NULL);
|
||||
std::vector< std::vector<item> > items;
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,715 @@
|
||||
#include "game.h"
|
||||
#include "output.h"
|
||||
#include "keypress.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
|
||||
const int iCategorieNum = 11;
|
||||
std::string CATEGORIES[iCategorieNum] =
|
||||
{"GROUND:", "FIREARMS:", "AMMUNITION:", "CLOTHING:", "FOOD/DRINKS:",
|
||||
"TOOLS:", "BOOKS:", "WEAPONS:", "MODS/BIONICS", "MEDICINE/DRUGS", "OTHER:"};
|
||||
|
||||
std::vector<int> find_firsts(inventory &inv)
|
||||
{
|
||||
std::vector<int> firsts;
|
||||
for (int i = 0; i < iCategorieNum-1; i++) {
|
||||
firsts.push_back(-1);
|
||||
}
|
||||
|
||||
for (int i = 0; i < inv.size(); i++) {
|
||||
if (firsts[0] == -1 && inv[i].is_gun()) {
|
||||
firsts[0] = i;
|
||||
} else if (firsts[1] == -1 && inv[i].is_ammo()) {
|
||||
firsts[1] = i;
|
||||
} else if (firsts[2] == -1 && inv[i].is_armor()) {
|
||||
firsts[2] = i;
|
||||
} else if (firsts[3] == -1 && inv[i].is_food_container()) {
|
||||
firsts[3] = i;
|
||||
} else if (inv[i].is_food()) {
|
||||
it_comest* comest = dynamic_cast<it_comest*>(inv[i].type);
|
||||
if (firsts[3] == -1 && comest->comesttype != "MED") {
|
||||
firsts[3] = i;
|
||||
} else if (firsts[8] == -1 && comest->comesttype == "MED") {
|
||||
firsts[8] = i;
|
||||
}
|
||||
} else if (firsts[4] == -1 && inv[i].is_tool()) {
|
||||
firsts[4] = i;
|
||||
} else if (firsts[5] == -1 && inv[i].is_book()) {
|
||||
firsts[5] = i;
|
||||
} else if (firsts[6] == -1 && inv[i].is_weap()) {
|
||||
firsts[6] = i;
|
||||
} else if (firsts[7] == -1 && (inv[i].is_gunmod() || inv[i].is_bionic())) {
|
||||
firsts[7] = i;
|
||||
} else if (firsts[9] == -1 && inv[i].is_other()) {
|
||||
firsts[9] = i;
|
||||
}
|
||||
}
|
||||
|
||||
return firsts;
|
||||
}
|
||||
|
||||
void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
|
||||
std::vector<char> dropped_items)
|
||||
{
|
||||
// Print our header
|
||||
mvwprintw(w_inv, 0, 0, title.c_str());
|
||||
|
||||
// Print weight
|
||||
mvwprintw(w_inv, 0, 45, "Weight: ");
|
||||
if (g->u.weight_carried() >= g->u.weight_capacity() * .25)
|
||||
wprintz(w_inv, c_red, "%d", g->u.weight_carried());
|
||||
else
|
||||
wprintz(w_inv, c_ltgray, "%d", g->u.weight_carried());
|
||||
wprintz(w_inv, c_ltgray, "/%d", int(g->u.weight_capacity() * .25));//, g->u.weight_capacity());
|
||||
|
||||
// Print volume
|
||||
mvwprintw(w_inv, 0, 62, "Volume: ");
|
||||
if (g->u.volume_carried() > g->u.volume_capacity() - 2)
|
||||
wprintz(w_inv, c_red, "%d", g->u.volume_carried());
|
||||
else
|
||||
wprintz(w_inv, c_ltgray, "%d", g->u.volume_carried());
|
||||
wprintw(w_inv, "/%d", g->u.volume_capacity() - 2);
|
||||
|
||||
// Print our weapon
|
||||
int n_items = 0;
|
||||
mvwprintz(w_inv, 2, 45, c_magenta, "WEAPON:");
|
||||
int dropping_weapon = false;
|
||||
for (int i = 0; i < dropped_items.size() && !dropping_weapon; i++) {
|
||||
if (dropped_items[i] == g->u.weapon.invlet)
|
||||
dropping_weapon = true;
|
||||
}
|
||||
if (g->u.is_armed()) {
|
||||
n_items++;
|
||||
if (dropping_weapon)
|
||||
mvwprintz(w_inv, 3, 45, c_white, "%c + %s", g->u.weapon.invlet,
|
||||
g->u.weapname().c_str());
|
||||
else
|
||||
mvwprintz(w_inv, 3, 45, g->u.weapon.color_in_inventory(&(g->u)), "%c - %s",
|
||||
g->u.weapon.invlet, g->u.weapname().c_str());
|
||||
} else if (g->u.weapon.is_style()) {
|
||||
n_items++;
|
||||
mvwprintz(w_inv, 3, 45, c_ltgray, "%c - %s",
|
||||
g->u.weapon.invlet, g->u.weapname().c_str());
|
||||
} else
|
||||
mvwprintz(w_inv, 3, 45, c_ltgray, g->u.weapname().c_str());
|
||||
// Print worn items
|
||||
if (g->u.worn.size() > 0)
|
||||
mvwprintz(w_inv, 5, 45, c_magenta, "ITEMS WORN:");
|
||||
for (int i = 0; i < g->u.worn.size(); i++) {
|
||||
n_items++;
|
||||
bool dropping_armor = false;
|
||||
for (int j = 0; j < dropped_items.size() && !dropping_armor; j++) {
|
||||
if (dropped_items[j] == g->u.worn[i].invlet)
|
||||
dropping_armor = true;
|
||||
}
|
||||
if (dropping_armor)
|
||||
mvwprintz(w_inv, 6 + i, 45, c_white, "%c + %s", g->u.worn[i].invlet,
|
||||
g->u.worn[i].tname(g).c_str());
|
||||
else
|
||||
mvwprintz(w_inv, 6 + i, 45, c_ltgray, "%c - %s", g->u.worn[i].invlet,
|
||||
g->u.worn[i].tname(g).c_str());
|
||||
}
|
||||
|
||||
// Print items carried
|
||||
for (std::string::const_iterator invlet = inv_chars.begin();
|
||||
invlet != inv_chars.end(); invlet++) {
|
||||
n_items += ((g->u.inv.index_by_letter(*invlet) == -1) ? 0 : 1);
|
||||
}
|
||||
mvwprintw(w_inv, 1, 62, "Items: %d/%d ", n_items, inv_chars.size());
|
||||
}
|
||||
|
||||
// Display current inventory.
|
||||
char game::inv(std::string title)
|
||||
{
|
||||
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
|
||||
const int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
|
||||
char ch = '.';
|
||||
int start = 0, cur_it;
|
||||
u.sort_inv();
|
||||
u.inv.restack(&u);
|
||||
std::vector<char> null_vector;
|
||||
print_inv_statics(this, w_inv, title, null_vector);
|
||||
// Gun, ammo, weapon, armor, food, tool, book, other
|
||||
std::vector<int> firsts = find_firsts(u.inv);
|
||||
|
||||
do {
|
||||
if (ch == '<' && start > 0) { // Clear lines and shift
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
}
|
||||
if (ch == '>' && cur_it < u.inv.size()) { // Clear lines and shift
|
||||
start = cur_it;
|
||||
mvwprintw(w_inv, maxitems + 4, 12, " ");
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
}
|
||||
int cur_line = 2;
|
||||
for (cur_it = start; cur_it < start + maxitems && cur_line < maxitems+3; cur_it++) {
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
// Print category header
|
||||
for (int i = 1; i < iCategorieNum; i++) {
|
||||
if (cur_it == firsts[i-1]) {
|
||||
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
|
||||
cur_line++;
|
||||
}
|
||||
}
|
||||
if (cur_it < u.inv.size()) {
|
||||
mvwputch (w_inv, cur_line, 0, c_white, u.inv[cur_it].invlet);
|
||||
mvwprintz(w_inv, cur_line, 1, u.inv[cur_it].color_in_inventory(&u), " %s",
|
||||
u.inv[cur_it].tname(this).c_str());
|
||||
if (u.inv.stack_at(cur_it).size() > 1)
|
||||
wprintw(w_inv, " [%d]", u.inv.stack_at(cur_it).size());
|
||||
if (u.inv[cur_it].charges > 0)
|
||||
wprintw(w_inv, " (%d)", u.inv[cur_it].charges);
|
||||
else if (u.inv[cur_it].contents.size() == 1 &&
|
||||
u.inv[cur_it].contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", u.inv[cur_it].contents[0].charges);
|
||||
}
|
||||
cur_line++;
|
||||
}
|
||||
if (start > 0)
|
||||
mvwprintw(w_inv, maxitems + 4, 0, "< Go Back");
|
||||
if (cur_it < u.inv.size())
|
||||
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
|
||||
wrefresh(w_inv);
|
||||
ch = getch();
|
||||
} while (ch == '<' || ch == '>');
|
||||
werase(w_inv);
|
||||
delwin(w_inv);
|
||||
erase();
|
||||
refresh_all();
|
||||
return ch;
|
||||
}
|
||||
|
||||
char game::inv_type(std::string title, int inv_item_type)
|
||||
{
|
||||
// this function lists inventory objects by type
|
||||
// refer to enum item_cat in itype.h for list of categories
|
||||
|
||||
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
|
||||
const int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
|
||||
char ch = '.';
|
||||
int start = 0, cur_it;
|
||||
u.sort_inv();
|
||||
u.inv.restack(&u);
|
||||
std::vector<char> null_vector;
|
||||
print_inv_statics(this, w_inv, title, null_vector);
|
||||
// Gun, ammo, weapon, armor, food, tool, book, other
|
||||
|
||||
// Create the reduced inventory
|
||||
inventory reduced_inv = u.inv;
|
||||
reduced_inv.clear();
|
||||
int inv_index = 0;
|
||||
|
||||
if (u.inv.size() > 0)
|
||||
{
|
||||
do
|
||||
{
|
||||
switch (inv_item_type)
|
||||
{
|
||||
case IC_COMESTIBLE: // food
|
||||
if (u.inv[inv_index].is_food(&u) || u.inv[inv_index].is_food_container(&u))
|
||||
reduced_inv += u.inv[inv_index];
|
||||
break;
|
||||
case IC_AMMO: // ammo
|
||||
if (u.inv[inv_index].is_ammo() || u.inv[inv_index].is_ammo_container())
|
||||
reduced_inv += u.inv[inv_index];
|
||||
break;
|
||||
case IC_ARMOR: // armour
|
||||
if (u.inv[inv_index].is_armor())
|
||||
reduced_inv += u.inv[inv_index];
|
||||
break;
|
||||
case IC_BOOK: // books
|
||||
if (u.inv[inv_index].is_book())
|
||||
reduced_inv += u.inv[inv_index];
|
||||
break;
|
||||
case IC_TOOL: // tools
|
||||
if (u.inv[inv_index].is_tool())
|
||||
reduced_inv += u.inv[inv_index];
|
||||
break;
|
||||
case IC_CONTAINER: // containers for liquid handling
|
||||
if (u.inv[inv_index].is_tool() || u.inv[inv_index].is_gun())
|
||||
{
|
||||
if (u.inv[inv_index].ammo_type() == AT_GAS)
|
||||
reduced_inv += u.inv[inv_index];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (u.inv[inv_index].is_container())
|
||||
reduced_inv += u.inv[inv_index];
|
||||
}
|
||||
break;
|
||||
}
|
||||
inv_index++;
|
||||
} while (inv_index < u.inv.size());
|
||||
}
|
||||
|
||||
std::vector<int> firsts = find_firsts(reduced_inv);
|
||||
|
||||
do {
|
||||
if (ch == '<' && start > 0) { // Clear lines and shift
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
}
|
||||
if (ch == '>' && cur_it < reduced_inv.size()) { // Clear lines and shift
|
||||
start = cur_it;
|
||||
mvwprintw(w_inv, maxitems + 4, 12, " ");
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
}
|
||||
int cur_line = 2;
|
||||
for (cur_it = start; cur_it < start + maxitems && cur_line < maxitems+3; cur_it++) {
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
|
||||
for (int i = 1; i < iCategorieNum; i++) {
|
||||
if (cur_it == firsts[i-1]) {
|
||||
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
|
||||
cur_line++;
|
||||
}
|
||||
}
|
||||
|
||||
if (cur_it < reduced_inv.size())
|
||||
{
|
||||
mvwputch (w_inv, cur_line, 0, c_white, reduced_inv[cur_it].invlet);
|
||||
mvwprintz(w_inv, cur_line, 1, reduced_inv[cur_it].color_in_inventory(&u), " %s",
|
||||
reduced_inv[cur_it].tname(this).c_str());
|
||||
if (reduced_inv.stack_at(cur_it).size() > 1)
|
||||
wprintw(w_inv, " [%d]", reduced_inv.stack_at(cur_it).size());
|
||||
if (reduced_inv[cur_it].charges > 0)
|
||||
wprintw(w_inv, " (%d)", reduced_inv[cur_it].charges);
|
||||
else if (reduced_inv[cur_it].contents.size() == 1 &&
|
||||
reduced_inv[cur_it].contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", reduced_inv[cur_it].contents[0].charges);
|
||||
cur_line++;
|
||||
}
|
||||
// cur_line++;
|
||||
}
|
||||
if (start > 0)
|
||||
mvwprintw(w_inv, maxitems + 4, 0, "< Go Back");
|
||||
if (cur_it < reduced_inv.size())
|
||||
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
|
||||
wrefresh(w_inv);
|
||||
ch = getch();
|
||||
} while (ch == '<' || ch == '>');
|
||||
werase(w_inv);
|
||||
delwin(w_inv);
|
||||
erase();
|
||||
refresh_all();
|
||||
return ch;
|
||||
}
|
||||
|
||||
std::vector<item> game::multidrop()
|
||||
{
|
||||
u.sort_inv();
|
||||
u.inv.restack(&u);
|
||||
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
|
||||
const int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
|
||||
int dropping[u.inv.size()]; // Count of how many we'll drop from each stack
|
||||
for (int i = 0; i < u.inv.size(); i++)
|
||||
dropping[i] = 0;
|
||||
int count = 0; // The current count
|
||||
std::vector<char> weapon_and_armor; // Always single, not counted
|
||||
bool warned_about_bionic = false; // Printed add_msg re: dropping bionics
|
||||
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
|
||||
// Gun, ammo, weapon, armor, food, tool, book, other
|
||||
std::vector<int> firsts = find_firsts(u.inv);
|
||||
|
||||
char ch = '.';
|
||||
int start = 0, cur_it;
|
||||
do {
|
||||
if (ch == '<' && start > 0) {
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
}
|
||||
if (ch == '>' && cur_it < u.inv.size()) {
|
||||
start = cur_it;
|
||||
mvwprintw(w_inv, maxitems + 4, 12, " ");
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
}
|
||||
int cur_line = 2;
|
||||
for (cur_it = start; cur_it < start + maxitems && cur_line < maxitems+3; cur_it++) {
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
// Print category header
|
||||
for (int i = 1; i < iCategorieNum; i++) {
|
||||
if (cur_it == firsts[i-1]) {
|
||||
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
|
||||
cur_line++;
|
||||
}
|
||||
}
|
||||
if (cur_it < u.inv.size()) {
|
||||
mvwputch (w_inv, cur_line, 0, c_white, u.inv[cur_it].invlet);
|
||||
char icon = '-';
|
||||
if (dropping[cur_it] >= u.inv.stack_at(cur_it).size())
|
||||
icon = '+';
|
||||
else if (dropping[cur_it] > 0)
|
||||
icon = '#';
|
||||
nc_color col = (dropping[cur_it] == 0 ? c_ltgray : c_white);
|
||||
mvwprintz(w_inv, cur_line, 1, col, " %c %s", icon,
|
||||
u.inv[cur_it].tname(this).c_str());
|
||||
if (u.inv.stack_at(cur_it).size() > 1)
|
||||
wprintz(w_inv, col, " [%d]", u.inv.stack_at(cur_it).size());
|
||||
if (u.inv[cur_it].charges > 0)
|
||||
wprintz(w_inv, col, " (%d)", u.inv[cur_it].charges);
|
||||
else if (u.inv[cur_it].contents.size() == 1 &&
|
||||
u.inv[cur_it].contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", u.inv[cur_it].contents[0].charges);
|
||||
}
|
||||
cur_line++;
|
||||
}
|
||||
if (start > 0)
|
||||
mvwprintw(w_inv, maxitems + 4, 0, "< Go Back");
|
||||
if (cur_it < u.inv.size())
|
||||
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
|
||||
wrefresh(w_inv);
|
||||
ch = getch();
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
ch -= '0';
|
||||
count *= 10;
|
||||
count += ch;
|
||||
} else if (u.has_item(ch)) {
|
||||
int index = u.inv.index_by_letter(ch);
|
||||
if (index == -1) { // Not from inventory
|
||||
int found = false;
|
||||
for (int i = 0; i < weapon_and_armor.size() && !found; i++) {
|
||||
if (weapon_and_armor[i] == ch) {
|
||||
weapon_and_armor.erase(weapon_and_armor.begin() + i);
|
||||
found = true;
|
||||
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
if ( ch == u.weapon.invlet &&
|
||||
std::find(unreal_itype_ids.begin(), unreal_itype_ids.end(), u.weapon.type->id) != unreal_itype_ids.end()){
|
||||
if (!warned_about_bionic)
|
||||
add_msg("You cannot drop your %s.", u.weapon.tname(this).c_str());
|
||||
warned_about_bionic = true;
|
||||
} else {
|
||||
weapon_and_armor.push_back(ch);
|
||||
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (count == 0) {
|
||||
if (u.inv.stack_at(index)[0].count_by_charges())
|
||||
{
|
||||
if (dropping[index] == 0)
|
||||
dropping[index] = -1;
|
||||
else
|
||||
dropping[index] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dropping[index] == 0)
|
||||
dropping[index] = u.inv.stack_at(index).size();
|
||||
else
|
||||
dropping[index] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
else if (count >= u.inv.stack_at(index).size() && !u.inv.stack_at(index)[0].count_by_charges())
|
||||
dropping[index] = u.inv.stack_at(index).size();
|
||||
else
|
||||
dropping[index] = count;
|
||||
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
} while (ch != '\n' && ch != KEY_ESCAPE && ch != ' ');
|
||||
werase(w_inv);
|
||||
delwin(w_inv);
|
||||
erase();
|
||||
refresh_all();
|
||||
|
||||
std::vector<item> ret;
|
||||
|
||||
if (ch != '\n')
|
||||
return ret; // Canceled!
|
||||
|
||||
int current_stack = 0;
|
||||
int max_size = u.inv.size();
|
||||
for (int i = 0; i < max_size; i++) {
|
||||
|
||||
if (dropping[i] == -1) { // drop whole stack of charges
|
||||
ret.push_back(u.inv.remove_item(current_stack));
|
||||
current_stack--;
|
||||
}
|
||||
|
||||
for (int j = 0; j < dropping[i]; j++) {
|
||||
if (u.inv.stack_at(current_stack)[0].count_by_charges()) { // dropping parts of stacks
|
||||
int tmpcount = dropping[i];
|
||||
|
||||
if (tmpcount >= u.inv.stack_at(current_stack)[0].charges) {
|
||||
ret.push_back(u.inv.remove_item(current_stack));
|
||||
current_stack--;
|
||||
} else {
|
||||
u.inv.stack_at(current_stack)[0].charges -= tmpcount;
|
||||
ret.push_back(u.inv.remove_item_by_quantity(current_stack, tmpcount));
|
||||
}
|
||||
j = dropping[i];
|
||||
} else {
|
||||
if (current_stack >= 0) {
|
||||
if (u.inv.stack_at(current_stack).size() == 1) {
|
||||
ret.push_back(u.inv.remove_item(current_stack));
|
||||
current_stack--;
|
||||
} else
|
||||
ret.push_back(u.inv.remove_item(current_stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
current_stack++;
|
||||
}
|
||||
|
||||
for (int i = 0; i < weapon_and_armor.size(); i++)
|
||||
ret.push_back(u.i_rem(weapon_and_armor[i]));
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
void game::compare(int iCompareX, int iCompareY)
|
||||
{
|
||||
int examx, examy;
|
||||
char ch = '.';
|
||||
|
||||
if (iCompareX != -999 && iCompareX != -999) {
|
||||
examx = iCompareX;
|
||||
examy = iCompareY;
|
||||
} else {
|
||||
mvwprintw(w_terrain, 0, 0, "Compare where? (Direction button)");
|
||||
wrefresh(w_terrain);
|
||||
|
||||
ch = input();
|
||||
last_action += ch;
|
||||
if (ch == KEY_ESCAPE || ch == 'q')
|
||||
return;
|
||||
if (ch == '\n' || ch == 'I')
|
||||
ch = '.';
|
||||
get_direction(this, examx, examy, ch);
|
||||
if (examx == -2 || examy == -2) {
|
||||
add_msg("Invalid direction.");
|
||||
return;
|
||||
}
|
||||
}
|
||||
examx += u.posx;
|
||||
examy += u.posy;
|
||||
std::vector <item> here = m.i_at(examx, examy);
|
||||
std::vector <item> grounditems;
|
||||
//Filter out items with the same name (keep only one of them)
|
||||
std::map <std::string, bool> dups;
|
||||
for (int i = 0; i < here.size(); i++) {
|
||||
if (!dups[here[i].tname(this).c_str()]) {
|
||||
grounditems.push_back(here[i]);
|
||||
dups[here[i].tname(this).c_str()] = true;
|
||||
}
|
||||
}
|
||||
//Only the first 10 Items due to numbering 0-9
|
||||
const int groundsize = (grounditems.size() > 10 ? 10 : grounditems.size());
|
||||
u.sort_inv();
|
||||
u.inv.restack(&u);
|
||||
|
||||
WINDOW* w_inv = newwin(TERMY-VIEW_OFFSET_Y*2, TERMX-VIEW_OFFSET_X*2, VIEW_OFFSET_Y, VIEW_OFFSET_X);
|
||||
int maxitems = TERMY-5-VIEW_OFFSET_Y*2; // Number of items to show at one time.
|
||||
int compare[u.inv.size() + groundsize]; // Count of how many we'll drop from each stack
|
||||
bool bFirst = false; // First Item selected
|
||||
bool bShowCompare = false;
|
||||
char cLastCh;
|
||||
for (int i = 0; i < u.inv.size() + groundsize; i++)
|
||||
compare[i] = 0;
|
||||
std::vector<char> weapon_and_armor; // Always single, not counted
|
||||
print_inv_statics(this, w_inv, "Compare:", weapon_and_armor);
|
||||
// Gun, ammo, weapon, armor, food, tool, book, other
|
||||
std::vector<int> first = find_firsts(u.inv);
|
||||
std::vector<int> firsts;
|
||||
if (groundsize > 0) {
|
||||
firsts.push_back(0);
|
||||
}
|
||||
for (int i = 0; i < first.size(); i++) {
|
||||
firsts.push_back((first[i] >= 0) ? first[i]+groundsize : -1);
|
||||
}
|
||||
ch = '.';
|
||||
int start = 0, cur_it;
|
||||
do {
|
||||
if (ch == '<' && start > 0) {
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
}
|
||||
if (ch == '>' && cur_it < u.inv.size() + groundsize) {
|
||||
start = cur_it;
|
||||
mvwprintw(w_inv, maxitems + 4, 12, " ");
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
}
|
||||
int cur_line = 2;
|
||||
int iHeaderOffset = (groundsize > 0) ? 0 : 1;
|
||||
|
||||
for (cur_it = start; cur_it < start + maxitems && cur_line < maxitems+3; cur_it++) {
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
// Print category header
|
||||
for (int i = iHeaderOffset; i < iCategorieNum; i++) {
|
||||
if (cur_it == firsts[i-iHeaderOffset]) {
|
||||
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
|
||||
cur_line++;
|
||||
}
|
||||
}
|
||||
if (cur_it < u.inv.size() + groundsize) {
|
||||
char icon = '-';
|
||||
if (compare[cur_it] == 1)
|
||||
icon = '+';
|
||||
if (cur_it < groundsize) {
|
||||
mvwputch (w_inv, cur_line, 0, c_white, '1'+((cur_it<9) ? cur_it: -1));
|
||||
nc_color col = (compare[cur_it] == 0 ? c_ltgray : c_white);
|
||||
mvwprintz(w_inv, cur_line, 1, col, " %c %s", icon,
|
||||
grounditems[cur_it].tname(this).c_str());
|
||||
} else {
|
||||
mvwputch (w_inv, cur_line, 0, c_white, u.inv[cur_it-groundsize].invlet);
|
||||
nc_color col = (compare[cur_it] == 0 ? c_ltgray : c_white);
|
||||
mvwprintz(w_inv, cur_line, 1, col, " %c %s", icon,
|
||||
u.inv[cur_it-groundsize].tname(this).c_str());
|
||||
if (u.inv.stack_at(cur_it-groundsize).size() > 1)
|
||||
wprintz(w_inv, col, " [%d]", u.inv.stack_at(cur_it-groundsize).size());
|
||||
if (u.inv[cur_it-groundsize].charges > 0)
|
||||
wprintz(w_inv, col, " (%d)", u.inv[cur_it-groundsize].charges);
|
||||
else if (u.inv[cur_it-groundsize].contents.size() == 1 &&
|
||||
u.inv[cur_it-groundsize].contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", u.inv[cur_it-groundsize].contents[0].charges);
|
||||
}
|
||||
}
|
||||
cur_line++;
|
||||
}
|
||||
if (start > 0)
|
||||
mvwprintw(w_inv, maxitems + 4, 0, "< Go Back");
|
||||
if (cur_it < u.inv.size() + groundsize)
|
||||
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
|
||||
wrefresh(w_inv);
|
||||
ch = getch();
|
||||
if (u.has_item(ch)) {
|
||||
int index = u.inv.index_by_letter(ch);
|
||||
if (index == -1) { // Not from inventory
|
||||
bool found = false;
|
||||
for (int i = 0; i < weapon_and_armor.size() && !found; i++) {
|
||||
if (weapon_and_armor[i] == ch) {
|
||||
weapon_and_armor.erase(weapon_and_armor.begin() + i);
|
||||
found = true;
|
||||
bFirst = false;
|
||||
print_inv_statics(this, w_inv, "Compare:", weapon_and_armor);
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
|
||||
if ( ch == u.weapon.invlet &&
|
||||
std::find(unreal_itype_ids.begin(), unreal_itype_ids.end(), u.weapon.type->id) != unreal_itype_ids.end()){
|
||||
//Do Bionic stuff here?!
|
||||
} else {
|
||||
if (!bFirst)
|
||||
{
|
||||
weapon_and_armor.push_back(ch);
|
||||
print_inv_statics(this, w_inv, "Compare:", weapon_and_armor);
|
||||
bFirst = true;
|
||||
cLastCh = ch;
|
||||
} else {
|
||||
bShowCompare = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (compare[index+groundsize] == 1)
|
||||
{
|
||||
compare[index+groundsize] = 0;
|
||||
bFirst = false;
|
||||
} else {
|
||||
if (!bFirst)
|
||||
{
|
||||
compare[index+groundsize] = 1;
|
||||
bFirst = true;
|
||||
cLastCh = ch;
|
||||
} else {
|
||||
bShowCompare = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if ((ch >= '1' && ch <= '9' && ch-'1' < groundsize) || (ch == '0' && groundsize == 10)) {
|
||||
//Ground Items
|
||||
int iZero = 0;
|
||||
if (ch == '0') {
|
||||
iZero = 10;
|
||||
}
|
||||
if (compare[ch-'1'+iZero] == 1)
|
||||
{
|
||||
compare[ch-'1'+iZero] = 0;
|
||||
bFirst = false;
|
||||
} else {
|
||||
if (!bFirst)
|
||||
{
|
||||
compare[ch-'1'+iZero] = 1;
|
||||
bFirst = true;
|
||||
cLastCh = ch;
|
||||
} else {
|
||||
bShowCompare = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (bShowCompare) {
|
||||
std::vector<iteminfo> vItemLastCh, vItemCh;
|
||||
std::string sItemLastCh, sItemCh;
|
||||
if (cLastCh >= '0' && cLastCh <= '9') {
|
||||
int iZero = 0;
|
||||
if (cLastCh == '0') {
|
||||
iZero = 10;
|
||||
}
|
||||
|
||||
grounditems[cLastCh-'1'+iZero].info(true, &vItemLastCh);
|
||||
sItemLastCh = grounditems[cLastCh-'1'+iZero].tname(this);
|
||||
} else {
|
||||
u.i_at(cLastCh).info(true, &vItemLastCh);
|
||||
sItemLastCh = u.i_at(cLastCh).tname(this);
|
||||
}
|
||||
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
int iZero = 0;
|
||||
if (ch == '0') {
|
||||
iZero = 10;
|
||||
}
|
||||
|
||||
grounditems[ch-'1'+iZero].info(true, &vItemCh);
|
||||
sItemCh = grounditems[ch-'1'+iZero].tname(this);
|
||||
} else {
|
||||
u.i_at(ch).info(true, &vItemCh);
|
||||
sItemCh = u.i_at(ch).tname(this);
|
||||
}
|
||||
|
||||
compare_split_screen_popup(0, (TERMX-VIEW_OFFSET_X*2)/2, TERMY-VIEW_OFFSET_Y*2, sItemLastCh, vItemLastCh, vItemCh);
|
||||
compare_split_screen_popup((TERMX-VIEW_OFFSET_X*2)/2, (TERMX-VIEW_OFFSET_X*2)/2, TERMY-VIEW_OFFSET_Y*2, sItemCh, vItemCh, vItemLastCh);
|
||||
|
||||
wclear(w_inv);
|
||||
print_inv_statics(this, w_inv, "Compare:", weapon_and_armor);
|
||||
bShowCompare = false;
|
||||
}
|
||||
} while (ch != '\n' && ch != KEY_ESCAPE && ch != ' ');
|
||||
werase(w_inv);
|
||||
delwin(w_inv);
|
||||
erase();
|
||||
refresh_all();
|
||||
}
|
||||
@@ -10,6 +10,27 @@
|
||||
class player;
|
||||
class npc;
|
||||
|
||||
struct iteminfo{
|
||||
public:
|
||||
std::string sType; //Itemtype
|
||||
std::string sName; //Main item text
|
||||
std::string sPre; //Text between main item and value
|
||||
int iValue; //Set to -999 if no compare value is present
|
||||
std::string sPost; //Text after value
|
||||
bool bNewLine; //New line at the end
|
||||
bool bLowerIsBetter; //Lower values are better (red <-> green)
|
||||
|
||||
iteminfo(std::string sIn0, std::string sIn1, std::string sIn2 = "", int iIn0 = -999, std::string sIn3 = "", bool bIn0 = true, bool bIn1 = false) {
|
||||
sType = sIn0;
|
||||
sName = sIn1;
|
||||
sPre = sIn2;
|
||||
iValue = iIn0;
|
||||
sPost = sIn3;
|
||||
bNewLine = bIn0;
|
||||
bLowerIsBetter = bIn1;
|
||||
}
|
||||
};
|
||||
|
||||
class item
|
||||
{
|
||||
public:
|
||||
@@ -20,71 +41,137 @@ public:
|
||||
item(std::string itemdata, game *g);
|
||||
~item();
|
||||
void make(itype* it);
|
||||
// returns the default container of this item, with this item in it
|
||||
item in_its_container(std::vector<itype*> *itypes);
|
||||
|
||||
std::string tname();
|
||||
// returns the default container of this item, with this item in it
|
||||
item in_its_container(std::map<std::string, itype*> *itypes);
|
||||
|
||||
nc_color color(player *u);
|
||||
nc_color color_in_inventory(player *u);
|
||||
std::string tname(game *g = NULL); // g needed for rotten-test
|
||||
void use(player &u);
|
||||
bool burn(int amount = 1); // Returns true if destroyed
|
||||
|
||||
// Firearm specifics
|
||||
int reload_time(player &u);
|
||||
int clip_size();
|
||||
int accuracy();
|
||||
int gun_damage();
|
||||
int gun_damage(bool with_ammo = true);
|
||||
int noise();
|
||||
int burst_size();
|
||||
int recoil();
|
||||
ammotype ammo();
|
||||
int recoil(bool with_ammo = true);
|
||||
int range(player *p = NULL);
|
||||
ammotype ammo_type();
|
||||
int pick_reload_ammo(player &u, bool interactive);
|
||||
bool reload(player &u, int index);
|
||||
void next_mode();
|
||||
|
||||
std::string save_info(); // Formatted for save files
|
||||
void load_info(std::string data, game *g);
|
||||
std::string info(bool showtext = false); // Formatted for human viewing
|
||||
//std::string info(bool showtext = false); // Formatted for human viewing
|
||||
std::string info(bool showtext = false);
|
||||
std::string info(bool showtext, std::vector<iteminfo> *dump);
|
||||
char symbol();
|
||||
nc_color color();
|
||||
int price();
|
||||
|
||||
bool invlet_is_okay();
|
||||
bool stacks_with(item rhs);
|
||||
void put_in(item payload);
|
||||
|
||||
unsigned int weight();
|
||||
unsigned int volume();
|
||||
unsigned char volume_contained();
|
||||
int weight();
|
||||
int volume();
|
||||
int volume_contained();
|
||||
int attack_time();
|
||||
int damage_bash();
|
||||
int damage_cut();
|
||||
bool has_flag(item_flag f);
|
||||
bool has_technique(technique_id t, player *p = NULL);
|
||||
int has_gunmod(itype_id type);
|
||||
item* active_gunmod();
|
||||
std::vector<technique_id> techniques();
|
||||
bool goes_bad();
|
||||
bool count_by_charges();
|
||||
bool craft_has_charges();
|
||||
int num_charges();
|
||||
bool rotten(game *g);
|
||||
|
||||
// Our value as a weapon, given particular skills
|
||||
int weapon_value(int skills[num_skill_types]);
|
||||
// As above, but discounts its use as a ranged weapon
|
||||
int melee_value (int skills[num_skill_types]);
|
||||
// Returns the data associated with tech, if we are an it_style
|
||||
style_move style_data(technique_id tech);
|
||||
bool is_two_handed(player *u);
|
||||
bool made_of(material mat);
|
||||
bool conductive();
|
||||
bool conductive(); // Electricity
|
||||
bool destroyed_at_zero_charges();
|
||||
// Most of the is_whatever() functions call the same function in our itype
|
||||
bool is_null(); // True if type is NULL, or points to the null item (id == 0)
|
||||
bool is_food(player *u);// Some non-food items are food to certain players
|
||||
bool is_food_container(player *u); // Ditto
|
||||
bool is_food(); // Ignoring the ability to eat batteries, etc.
|
||||
bool is_food_container(); // Ignoring the ability to eat batteries, etc.
|
||||
bool is_food_container(player *u); // Ditto
|
||||
bool is_food(); // Ignoring the ability to eat batteries, etc.
|
||||
bool is_food_container(); // Ignoring the ability to eat batteries, etc.
|
||||
bool is_ammo_container();
|
||||
bool is_drink();
|
||||
bool is_weap();
|
||||
bool is_bashing_weapon();
|
||||
bool is_cutting_weapon();
|
||||
bool is_gun();
|
||||
bool is_gunmod();;
|
||||
bool is_silent();
|
||||
bool is_gunmod();
|
||||
bool is_bionic();
|
||||
bool is_ammo();
|
||||
bool is_armor();
|
||||
bool is_book();
|
||||
bool is_container();
|
||||
bool is_tool();
|
||||
bool is_software();
|
||||
bool is_macguffin();
|
||||
bool is_style();
|
||||
bool is_other(); // Doesn't belong in other categories
|
||||
bool is_var_veh_part();
|
||||
bool is_artifact();
|
||||
|
||||
itype_id typeId();
|
||||
itype* type;
|
||||
mtype* corpse;
|
||||
mtype* corpse;
|
||||
it_ammo* curammo;
|
||||
|
||||
std::vector<item> contents;
|
||||
|
||||
std::string name;
|
||||
char invlet;
|
||||
char invlet; // Inventory letter
|
||||
int charges;
|
||||
bool active; // If true, it has active effects to be processed
|
||||
signed char damage; // How much damage it's sustained; generally, max is 5
|
||||
unsigned int bday; // The turn on which it was created
|
||||
bool owned; // If true, NPCs will shout at you for picking it up
|
||||
bool active; // If true, it has active effects to be processed
|
||||
signed char damage; // How much damage it's sustained; generally, max is 5
|
||||
char burnt; // How badly we're burnt
|
||||
unsigned int bday; // The turn on which it was created
|
||||
int owned; // UID of NPC owner; 0 = player, -1 = unowned
|
||||
union{
|
||||
int poison; // How badly poisoned is it?
|
||||
int bigness; // engine power, wheel size
|
||||
};
|
||||
int mode; // Mode of operation, can be changed by the player.
|
||||
unsigned item_flags : NUM_ITEM_FLAGS; // generic item specific flags
|
||||
unsigned item_counter; // generic counter to be used with item flags
|
||||
int mission_id;// Refers to a mission in game's master list
|
||||
int player_id; // Only give a mission to the right player!
|
||||
|
||||
static itype * nullitem();
|
||||
|
||||
private:
|
||||
static itype * nullitem_m;
|
||||
};
|
||||
|
||||
std::ostream & operator<<(std::ostream &, const item &);
|
||||
std::ostream & operator<<(std::ostream &, const item *);
|
||||
|
||||
//the assigned numbers are a result of legacy stuff in compare_split_screen_popup(),
|
||||
//it would be better long-term to rewrite stuff so that we don't need that hack
|
||||
enum hint_rating {
|
||||
HINT_CANT = 0, //meant to display as gray
|
||||
HINT_IFFY = 1, //meant to display as red
|
||||
HINT_GOOD = -999 // meant to display as green
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+4226
-1811
File diff suppressed because it is too large
Load Diff
@@ -3,74 +3,159 @@
|
||||
|
||||
class game;
|
||||
class item;
|
||||
class player;
|
||||
|
||||
class iuse
|
||||
{
|
||||
public:
|
||||
void none (game *g, item *it, bool t) { };
|
||||
void none (game *g, player *p, item *it, bool t) { };
|
||||
|
||||
// FOOD AND DRUGS (ADMINISTRATION)
|
||||
void royal_jelly (game *g, item *it, bool t);
|
||||
void bandage (game *g, item *it, bool t);
|
||||
void firstaid (game *g, item *it, bool t);
|
||||
void caff (game *g, item *it, bool t);
|
||||
void alcohol (game *g, item *it, bool t);
|
||||
void pkill_1 (game *g, item *it, bool t);
|
||||
void pkill_2 (game *g, item *it, bool t);
|
||||
void pkill_3 (game *g, item *it, bool t);
|
||||
void pkill_4 (game *g, item *it, bool t);
|
||||
void pkill_l (game *g, item *it, bool t);
|
||||
void xanax (game *g, item *it, bool t);
|
||||
void cig (game *g, item *it, bool t);
|
||||
void weed (game *g, item *it, bool t);
|
||||
void coke (game *g, item *it, bool t);
|
||||
void meth (game *g, item *it, bool t);
|
||||
void poison (game *g, item *it, bool t);
|
||||
void hallu (game *g, item *it, bool t);
|
||||
void thorazine (game *g, item *it, bool t);
|
||||
void prozac (game *g, item *it, bool t);
|
||||
void sleep (game *g, item *it, bool t);
|
||||
void flumed (game *g, item *it, bool t);
|
||||
void flusleep (game *g, item *it, bool t);
|
||||
void inhaler (game *g, item *it, bool t);
|
||||
void blech (game *g, item *it, bool t);
|
||||
void mutagen (game *g, item *it, bool t);
|
||||
void purifier (game *g, item *it, bool t);
|
||||
void sewage (game *g, player *p, item *it, bool t);
|
||||
void honeycomb (game *g, player *p, item *it, bool t);
|
||||
void royal_jelly (game *g, player *p, item *it, bool t);
|
||||
void bandage (game *g, player *p, item *it, bool t);
|
||||
void firstaid (game *g, player *p, item *it, bool t);
|
||||
void caff (game *g, player *p, item *it, bool t);
|
||||
void alcohol (game *g, player *p, item *it, bool t);
|
||||
void alcohol_weak (game *g, player *p, item *it, bool t);
|
||||
void pkill_1 (game *g, player *p, item *it, bool t);
|
||||
void pkill_2 (game *g, player *p, item *it, bool t);
|
||||
void pkill_3 (game *g, player *p, item *it, bool t);
|
||||
void pkill_4 (game *g, player *p, item *it, bool t);
|
||||
void pkill_l (game *g, player *p, item *it, bool t);
|
||||
void xanax (game *g, player *p, item *it, bool t);
|
||||
void cig (game *g, player *p, item *it, bool t);
|
||||
void antibiotic (game *g, player *p, item *it, bool t);
|
||||
void weed (game *g, player *p, item *it, bool t);
|
||||
void coke (game *g, player *p, item *it, bool t);
|
||||
void crack (game *g, player *p, item *it, bool t);
|
||||
void grack (game *g, player *p, item *it, bool t);
|
||||
void meth (game *g, player *p, item *it, bool t);
|
||||
void poison (game *g, player *p, item *it, bool t);
|
||||
void hallu (game *g, player *p, item *it, bool t);
|
||||
void thorazine (game *g, player *p, item *it, bool t);
|
||||
void prozac (game *g, player *p, item *it, bool t);
|
||||
void sleep (game *g, player *p, item *it, bool t);
|
||||
void iodine (game *g, player *p, item *it, bool t);
|
||||
void flumed (game *g, player *p, item *it, bool t);
|
||||
void flusleep (game *g, player *p, item *it, bool t);
|
||||
void inhaler (game *g, player *p, item *it, bool t);
|
||||
void blech (game *g, player *p, item *it, bool t);
|
||||
void mutagen (game *g, player *p, item *it, bool t);
|
||||
void mutagen_3 (game *g, player *p, item *it, bool t);
|
||||
void purifier (game *g, player *p, item *it, bool t);
|
||||
void marloss (game *g, player *p, item *it, bool t);
|
||||
void dogfood (game *g, player *p, item *it, bool t);
|
||||
|
||||
// TOOLS
|
||||
void lighter (game *g, item *it, bool t);
|
||||
void sew (game *g, item *it, bool t);
|
||||
void scissors (game *g, item *it, bool t);
|
||||
void extinguisher (game *g, item *it, bool t);
|
||||
void hammer (game *g, item *it, bool t);
|
||||
void light_off (game *g, item *it, bool t);
|
||||
void light_on (game *g, item *it, bool t);
|
||||
void water_purifier (game *g, item *it, bool t);
|
||||
void two_way_radio (game *g, item *it, bool t);
|
||||
void radio_off (game *g, item *it, bool t);
|
||||
void radio_on (game *g, item *it, bool t);
|
||||
void crowbar (game *g, item *it, bool t);
|
||||
void makemound (game *g, item *it, bool t);
|
||||
void dig (game *g, item *it, bool t);
|
||||
void chainsaw_off (game *g, item *it, bool t);
|
||||
void chainsaw_on (game *g, item *it, bool t);
|
||||
void jackhammer (game *g, item *it, bool t);
|
||||
void set_trap (game *g, item *it, bool t);
|
||||
void geiger (game *g, item *it, bool t);
|
||||
void teleport (game *g, item *it, bool t);
|
||||
void can_goo (game *g, item *it, bool t);
|
||||
void grenade (game *g, item *it, bool t);
|
||||
void grenade_act (game *g, item *it, bool t);
|
||||
void gasbomb (game *g, item *it, bool t);
|
||||
void gasbomb_act (game *g, item *it, bool t);
|
||||
void smokebomb (game *g, item *it, bool t);
|
||||
void smokebomb_act (game *g, item *it, bool t);
|
||||
void molotov (game *g, item *it, bool t);
|
||||
void molotov_lit (game *g, item *it, bool t);
|
||||
void dynamite (game *g, item *it, bool t);
|
||||
void dynamite_act (game *g, item *it, bool t);
|
||||
void mininuke (game *g, item *it, bool t);
|
||||
void mininuke_act (game *g, item *it, bool t);
|
||||
void pheromone (game *g, item *it, bool t);
|
||||
void portal (game *g, item *it, bool t);
|
||||
void lighter (game *g, player *p, item *it, bool t);
|
||||
void sew (game *g, player *p, item *it, bool t);
|
||||
void scissors (game *g, player *p, item *it, bool t);
|
||||
void extinguisher (game *g, player *p, item *it, bool t);
|
||||
void hammer (game *g, player *p, item *it, bool t);
|
||||
void light_off (game *g, player *p, item *it, bool t);
|
||||
void light_on (game *g, player *p, item *it, bool t);
|
||||
void lightstrip (game *g, player *p, item *it, bool t);
|
||||
void cauterize_elec (game *g, player *p, item *it, bool t);
|
||||
void water_purifier (game *g, player *p, item *it, bool t);
|
||||
void two_way_radio (game *g, player *p, item *it, bool t);
|
||||
void radio_off (game *g, player *p, item *it, bool t);
|
||||
void radio_on (game *g, player *p, item *it, bool t);
|
||||
void noise_emitter_off(game *g, player *p, item *it, bool t);
|
||||
void noise_emitter_on (game *g, player *p, item *it, bool t);
|
||||
void roadmap (game *g, player *p, item *it, bool t);
|
||||
void roadmap_a_target (game *g, player *p, item *it, bool t, int target);
|
||||
void roadmap_targets(game *g, player *p, item *it, bool t, int target, int target_range, int distance, int reveal_distance);
|
||||
void picklock (game *g, player *p, item *it, bool t);
|
||||
void crowbar (game *g, player *p, item *it, bool t);
|
||||
void makemound (game *g, player *p, item *it, bool t);
|
||||
void dig (game *g, player *p, item *it, bool t);
|
||||
void chainsaw_off (game *g, player *p, item *it, bool t);
|
||||
void chainsaw_on (game *g, player *p, item *it, bool t);
|
||||
void jackhammer (game *g, player *p, item *it, bool t);
|
||||
void jacqueshammer (game *g, player *p, item *it, bool t);
|
||||
void pickaxe (game *g, player *p, item *it, bool t);
|
||||
void set_trap (game *g, player *p, item *it, bool t);
|
||||
void geiger (game *g, player *p, item *it, bool t);
|
||||
void teleport (game *g, player *p, item *it, bool t);
|
||||
void can_goo (game *g, player *p, item *it, bool t);
|
||||
void pipebomb (game *g, player *p, item *it, bool t);
|
||||
void pipebomb_act (game *g, player *p, item *it, bool t);
|
||||
void grenade (game *g, player *p, item *it, bool t);
|
||||
void grenade_act (game *g, player *p, item *it, bool t);
|
||||
void flashbang (game *g, player *p, item *it, bool t);
|
||||
void flashbang_act (game *g, player *p, item *it, bool t);
|
||||
void c4 (game *g, player *p, item *it, bool t);
|
||||
void c4armed (game *g, player *p, item *it, bool t);
|
||||
void EMPbomb (game *g, player *p, item *it, bool t);
|
||||
void EMPbomb_act (game *g, player *p, item *it, bool t);
|
||||
void scrambler (game *g, player *p, item *it, bool t);
|
||||
void scrambler_act (game *g, player *p, item *it, bool t);
|
||||
void gasbomb (game *g, player *p, item *it, bool t);
|
||||
void gasbomb_act (game *g, player *p, item *it, bool t);
|
||||
void smokebomb (game *g, player *p, item *it, bool t);
|
||||
void smokebomb_act (game *g, player *p, item *it, bool t);
|
||||
void acidbomb (game *g, player *p, item *it, bool t);
|
||||
void acidbomb_act (game *g, player *p, item *it, bool t);
|
||||
void molotov (game *g, player *p, item *it, bool t);
|
||||
void molotov_lit (game *g, player *p, item *it, bool t);
|
||||
void dynamite (game *g, player *p, item *it, bool t);
|
||||
void dynamite_act (game *g, player *p, item *it, bool t);
|
||||
void firecracker_pack (game *g, player *p, item *it, bool t);
|
||||
void firecracker_pack_act (game *g, player *p, item *it, bool t);
|
||||
void firecracker (game *g, player *p, item *it, bool t);
|
||||
void firecracker_act (game *g, player *p, item *it, bool t);
|
||||
void mininuke (game *g, player *p, item *it, bool t);
|
||||
void mininuke_act (game *g, player *p, item *it, bool t);
|
||||
void pheromone (game *g, player *p, item *it, bool t);
|
||||
void portal (game *g, player *p, item *it, bool t);
|
||||
void manhack (game *g, player *p, item *it, bool t);
|
||||
void turret (game *g, player *p, item *it, bool t);
|
||||
void UPS_off (game *g, player *p, item *it, bool t);
|
||||
void UPS_on (game *g, player *p, item *it, bool t);
|
||||
void tazer (game *g, player *p, item *it, bool t);
|
||||
void mp3 (game *g, player *p, item *it, bool t);
|
||||
void mp3_on (game *g, player *p, item *it, bool t);
|
||||
void vortex (game *g, player *p, item *it, bool t);
|
||||
void dog_whistle (game *g, player *p, item *it, bool t);
|
||||
void vacutainer (game *g, player *p, item *it, bool t);
|
||||
void knife (game *g, player *p, item *it, bool t);
|
||||
void lumber (game *g, player *p, item *it, bool t);
|
||||
void hacksaw (game *g, player *p, item *it, bool t);
|
||||
void tent (game *g, player *p, item *it, bool t);
|
||||
void shelter (game *g, player *p, item *it, bool t);
|
||||
void torch (game *g, player *p, item *it, bool t);
|
||||
void torch_lit (game *g, player *p, item *it, bool t);
|
||||
void candle (game *g, player *p, item *it, bool t);
|
||||
void candle_lit (game *g, player *p, item *it, bool t);
|
||||
void bullet_puller (game *g, player *p, item *it, bool t);
|
||||
void screwdriver (game *g, player *p, item *it, bool t);
|
||||
void wrench (game *g, player *p, item *it, bool t);
|
||||
void boltcutters (game *g, player *p, item *it, bool t);
|
||||
void mop (game *g, player *p, item *it, bool t);
|
||||
void spray_can (game *g, player *p, item *it, bool t);
|
||||
void rag (game *g, player *p, item *it, bool t);
|
||||
void pda (game *g, player *p, item *it, bool t);
|
||||
void pda_flashlight (game *g, player *p, item *it, bool t);
|
||||
void LAW (game *g, player *p, item *it, bool t);
|
||||
void heatpack (game *g, player *p, item *it, bool t);
|
||||
|
||||
|
||||
// MACGUFFINS
|
||||
void mcg_note (game *g, player *p, item *it, bool t);
|
||||
// ARTIFACTS
|
||||
// This function is used when an artifact is activated
|
||||
// It examines the item's artifact-specific properties
|
||||
// See artifact.h for a list
|
||||
void artifact (game *g, player *p, item *it, bool t);
|
||||
void heal (game *g, player *p, item *it, bool t);
|
||||
void twist_space (game *g, player *p, item *it, bool t);
|
||||
void mass_vampire (game *g, player *p, item *it, bool t);
|
||||
void growth (game *g, player *p, item *it, bool t);
|
||||
void water (game *g, player *p, item *it, bool t);
|
||||
void lava (game *g, player *p, item *it, bool t);
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+205
-25
@@ -1,61 +1,241 @@
|
||||
#include "keypress.h"
|
||||
#include "action.h"
|
||||
#include "game.h"
|
||||
|
||||
long input()
|
||||
long input(long ch)
|
||||
{
|
||||
long ch = getch();
|
||||
if (ch == -1) {
|
||||
ch = getch();
|
||||
}
|
||||
|
||||
// Needs a totally seperate implementation for windows
|
||||
#if !(defined _WIN32 || defined WINDOWS)
|
||||
int newch;
|
||||
|
||||
// Clear the buffer of characters that match the one we're going to act on.
|
||||
timeout(0);
|
||||
do {
|
||||
newch = getch();
|
||||
} while( newch != ERR && newch == ch );
|
||||
timeout(-1);
|
||||
|
||||
// If we read a different character than the one we're going to act on, re-queue it.
|
||||
if (newch != ERR && newch != ch) {
|
||||
ungetch(newch);
|
||||
}
|
||||
#endif
|
||||
|
||||
switch (ch) {
|
||||
case '7': return 'y';
|
||||
case KEY_UP:
|
||||
case '8': return 'k';
|
||||
case '9': return 'u';
|
||||
case KEY_LEFT:
|
||||
case '4': return 'h';
|
||||
case '5': return '.';
|
||||
case KEY_RIGHT:
|
||||
case '6': return 'l';
|
||||
case '1': return 'b';
|
||||
case KEY_DOWN:
|
||||
case '2': return 'j';
|
||||
case '3': return 'n';
|
||||
case KEY_UP: return 'k';
|
||||
case KEY_LEFT: return 'h';
|
||||
case KEY_RIGHT: return 'l';
|
||||
case KEY_DOWN: return 'j';
|
||||
case 459: return '\n';
|
||||
default: return ch;
|
||||
}
|
||||
}
|
||||
|
||||
void get_direction(int &x, int &y, char ch)
|
||||
bool input_wait(char & ret_ch, int delay_ms)
|
||||
{
|
||||
while(true)
|
||||
{
|
||||
ret_ch = '\0';
|
||||
timeout(delay_ms);
|
||||
long ch = getch();
|
||||
switch (ch) {
|
||||
case KEY_UP:
|
||||
ret_ch = 'k';
|
||||
break;
|
||||
case KEY_LEFT:
|
||||
ret_ch = 'h';
|
||||
break;
|
||||
case KEY_RIGHT:
|
||||
ret_ch = 'l';
|
||||
break;
|
||||
case KEY_DOWN:
|
||||
ret_ch = 'j';
|
||||
break;
|
||||
case 459:
|
||||
ret_ch = '\n';
|
||||
break;
|
||||
case ERR:
|
||||
if(errno == EINTR)
|
||||
return input_wait(ret_ch, delay_ms);
|
||||
break;
|
||||
default:
|
||||
ret_ch = ch;
|
||||
break;
|
||||
}
|
||||
timeout(-1);
|
||||
if( ret_ch != '\0' )
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
void get_direction(game *g, int &x, int &y, char ch)
|
||||
{
|
||||
x = 0;
|
||||
y = 0;
|
||||
switch (ch) {
|
||||
case 'y':
|
||||
action_id act;
|
||||
if (g->keymap.find(ch) == g->keymap.end())
|
||||
act = ACTION_NULL;
|
||||
else
|
||||
act = g->keymap[ch];
|
||||
|
||||
switch (act) {
|
||||
case ACTION_MOVE_NW:
|
||||
x = -1;
|
||||
y = -1;
|
||||
return;
|
||||
case 'u':
|
||||
case ACTION_MOVE_NE:
|
||||
x = 1;
|
||||
y = -1;
|
||||
return;
|
||||
case 'h':
|
||||
case ACTION_MOVE_W:
|
||||
x = -1;
|
||||
return;
|
||||
case 'j':
|
||||
case ACTION_MOVE_S:
|
||||
y = 1;
|
||||
return;
|
||||
case 'k':
|
||||
case ACTION_MOVE_N:
|
||||
y = -1;
|
||||
return;
|
||||
case 'l':
|
||||
case ACTION_MOVE_E:
|
||||
x = 1;
|
||||
return;
|
||||
case 'b':
|
||||
case ACTION_MOVE_SW:
|
||||
x = -1;
|
||||
y = 1;
|
||||
return;
|
||||
case 'n':
|
||||
case ACTION_MOVE_SE:
|
||||
x = 1;
|
||||
y = 1;
|
||||
return;
|
||||
case ACTION_PAUSE:
|
||||
case ACTION_PICKUP:
|
||||
x = 0;
|
||||
y = 0;
|
||||
return;
|
||||
default:
|
||||
x = -2;
|
||||
y = -2;
|
||||
}
|
||||
}
|
||||
|
||||
std::string default_keymap_txt()
|
||||
{
|
||||
return "\
|
||||
# This is the keymapping for Cataclysm.\n\
|
||||
# You can start a line with # to make it a comment--it will be ignored.\n\
|
||||
# Blank lines are ignored too.\n\
|
||||
# Extra whitespace, including tab, is ignored, so format things how you like.\n\
|
||||
# If you wish to restore defaults, simply remove this file.\n\
|
||||
\n\
|
||||
# The format for each line is an action identifier, followed by several\n\
|
||||
# keys. Any action may have an unlimited number of keys bound to it.\n\
|
||||
# If you bind the same key to multiple actions, the second and subsequent\n\
|
||||
# bindings will be ignored--and you'll get a warning when the game starts.\n\
|
||||
# Keys are case-sensitive, of course; c and C are different.\n\
|
||||
\n\
|
||||
# WARNING: If you skip an action identifier, there will be no key bound to\n\
|
||||
# that action! You will be NOT be warned of this when the game starts.\n\
|
||||
# If you're going to mess with stuff, maybe you should back this file up?\n\
|
||||
\n\
|
||||
# It is okay to split commands across lines.\n\
|
||||
# pause . 5 is equivalent to:\n\
|
||||
# pause .\n\
|
||||
# pause 5\n\
|
||||
\n\
|
||||
# Note that movement keybindings ONLY apply to movement (for now).\n\
|
||||
# That is, binding w to move_n will let you use w to move north, but you\n\
|
||||
# cannot use w to smash north, examine to the north, etc.\n\
|
||||
# For now, you must use vikeys, the numpad, or arrow keys for those actions.\n\
|
||||
# This is planned to change in the future.\n\
|
||||
\n\
|
||||
# Finally, there is no support for special keys, like spacebar, Home, and\n\
|
||||
# so on. This is not a planned feature, but if it's important to you, please\n\
|
||||
# let me know.\n\
|
||||
\n\
|
||||
# MOVEMENT:\n\
|
||||
pause . 5\n\
|
||||
move_n k 8\n\
|
||||
move_ne u 9\n\
|
||||
move_e l 6\n\
|
||||
move_se n 3\n\
|
||||
move_s j 2\n\
|
||||
move_sw b 1\n\
|
||||
move_w h 4\n\
|
||||
move_nw y 7\n\
|
||||
move_down >\n\
|
||||
move_up <\n\
|
||||
\n\
|
||||
# MOVEMENT:\n\
|
||||
center G\n\
|
||||
shift_n K\n\
|
||||
shift_e L\n\
|
||||
shift_s J\n\
|
||||
shift_w H\n\
|
||||
\n\
|
||||
# ENVIRONMENT INTERACTION\n\
|
||||
open o\n\
|
||||
close c\n\
|
||||
smash s\n\
|
||||
examine e\n\
|
||||
pickup , g\n\
|
||||
butcher B\n\
|
||||
chat C\n\
|
||||
look ; x\n\
|
||||
peek X\n\
|
||||
listitems V\n\
|
||||
\n\
|
||||
# INVENTORY & QUASI-INVENTORY INTERACTION\n\
|
||||
inventory i\n\
|
||||
compare I\n\
|
||||
organize =\n\
|
||||
apply a\n\
|
||||
apply_wielded A\n\
|
||||
wear W\n\
|
||||
take_off T\n\
|
||||
eat E\n\
|
||||
read R\n\
|
||||
wield w\n\
|
||||
pick_style _\n\
|
||||
reload r\n\
|
||||
unload U\n\
|
||||
throw t\n\
|
||||
fire f\n\
|
||||
#fire_burst F\n\
|
||||
select_fire_mode F\n\
|
||||
drop d\n\
|
||||
drop_adj D\n\
|
||||
bionics p\n\
|
||||
\n\
|
||||
# LONG TERM & SPECIAL ACTIONS\n\
|
||||
wait ^\n\
|
||||
craft &\n\
|
||||
construct *\n\
|
||||
disassemble (\n\
|
||||
sleep $\n\
|
||||
safemode !\n\
|
||||
autosafe \"\n\
|
||||
ignore_enemy '\n\
|
||||
save S\n\
|
||||
quit Q\n\
|
||||
\n\
|
||||
# INFO SCREENS\n\
|
||||
player_data @\n\
|
||||
map m :\n\
|
||||
missions M\n\
|
||||
factions #\n\
|
||||
kills )\n\
|
||||
morale %\n\
|
||||
messages P\n\
|
||||
help ?\n\
|
||||
\n\
|
||||
# DEBUG FUNCTIONS\n\
|
||||
debug_mode ~\n\
|
||||
# debug Z\n\
|
||||
# debug_scent -\n\
|
||||
";
|
||||
}
|
||||
|
||||
+12
-4
@@ -1,10 +1,18 @@
|
||||
#ifndef _KEYPRESS_H_
|
||||
#define _KEYPRESS_H_
|
||||
#include <ncurses.h>
|
||||
|
||||
#include <string>
|
||||
#include "cursesdef.h"
|
||||
|
||||
class game;
|
||||
|
||||
// Simple text input--translates numpad to vikeys
|
||||
long input();
|
||||
// If ch is vikey, x & y are set to corresponding direction; ch=='y'->x=-1,y=-1
|
||||
void get_direction(int &x, int &y, char ch);
|
||||
long input(long ch = -1);
|
||||
bool input_wait(char & ret_ch, int timeout);
|
||||
|
||||
// Uses the keymap to figure out direction properly
|
||||
void get_direction(game *g, int &x, int &y, char ch);
|
||||
std::string default_keymap_txt();
|
||||
|
||||
#define CTRL(n) (n - 'A' + 1 < 1 ? n - 'a' + 1 : n - 'A' + 1)
|
||||
#define KEY_ESCAPE 27
|
||||
|
||||
+399
@@ -0,0 +1,399 @@
|
||||
#include "mapdata.h"
|
||||
#include "map.h"
|
||||
#include "game.h"
|
||||
#include "lightmap.h"
|
||||
|
||||
#define INBOUNDS(x, y) \
|
||||
(x >= 0 && x < SEEX * MAPSIZE && y >= 0 && y < SEEY * MAPSIZE)
|
||||
#define LIGHTMAP_CACHE_X SEEX * MAPSIZE
|
||||
#define LIGHTMAP_CACHE_Y SEEY * MAPSIZE
|
||||
|
||||
void map::generate_lightmap(game* g)
|
||||
{
|
||||
memset(lm, 0, sizeof(lm));
|
||||
memset(sm, 0, sizeof(sm));
|
||||
|
||||
const int dir_x[] = { 1, 0 , -1, 0 };
|
||||
const int dir_y[] = { 0, 1 , 0, -1 };
|
||||
const int dir_d[] = { 180, 270, 0, 90 };
|
||||
const float luminance = g->u.active_light();
|
||||
const float natural_light = g->natural_light_level();
|
||||
|
||||
// Daylight vision handling returned back to map due to issues it causes here
|
||||
if (natural_light > LIGHT_SOURCE_BRIGHT) {
|
||||
// Apply sunlight, first light source so just assign
|
||||
for(int sx = 0; sx < LIGHTMAP_CACHE_X; ++sx) {
|
||||
for(int sy = 0; sy < LIGHTMAP_CACHE_Y; ++sy) {
|
||||
// In bright light indoor light exists to some degree
|
||||
if (!g->m.is_outside(sx, sy))
|
||||
lm[sx][sy] = LIGHT_AMBIENT_LOW;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Apply player light sources
|
||||
if (luminance > LIGHT_AMBIENT_LOW)
|
||||
apply_light_source(g->u.posx, g->u.posy, luminance);
|
||||
|
||||
for(int sx = 0; sx < LIGHTMAP_CACHE_X; ++sx) {
|
||||
for(int sy = 0; sy < LIGHTMAP_CACHE_Y; ++sy) {
|
||||
const ter_id terrain = g->m.ter(sx, sy);
|
||||
const std::vector<item> items = g->m.i_at(sx, sy);
|
||||
const field current_field = g->m.field_at(sx, sy);
|
||||
// When underground natural_light is 0, if this changes we need to revisit
|
||||
if (natural_light > LIGHT_AMBIENT_LOW) {
|
||||
if (!g->m.is_outside(sx, sy)) {
|
||||
// Apply light sources for external/internal divide
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (INBOUNDS(sx + dir_x[i], sy + dir_y[i]) &&
|
||||
g->m.is_outside(sx + dir_x[i], sy + dir_y[i])) {
|
||||
if (INBOUNDS(sx, sy) && g->m.is_outside(0, 0))
|
||||
lm[sx][sy] = natural_light;
|
||||
|
||||
if (g->m.light_transparency(sx, sy) > LIGHT_TRANSPARENCY_SOLID)
|
||||
apply_light_arc(sx, sy, dir_d[i], natural_light);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: make this bit use item flags
|
||||
// may need to make item::has_flag const first
|
||||
if (items.size() == 1 &&
|
||||
items[0].type->id == "flashlight_on")
|
||||
apply_light_source(sx, sy, 20);
|
||||
|
||||
if (items.size() == 1 &&
|
||||
items[0].type->id == "lightstrip")
|
||||
apply_light_source(sx, sy, 1);
|
||||
|
||||
if(terrain == t_lava)
|
||||
apply_light_source(sx, sy, 50);
|
||||
|
||||
if(terrain == t_console)
|
||||
apply_light_source(sx, sy, 3);
|
||||
|
||||
if (items.size() == 1 &&
|
||||
items[0].type->id == "candle_lit")
|
||||
apply_light_source(sx, sy, 4);
|
||||
|
||||
if(terrain == t_emergency_light)
|
||||
apply_light_source(sx, sy, 3);
|
||||
|
||||
// TODO: [lightmap] Attach light brightness to fields
|
||||
switch(current_field.type) {
|
||||
case fd_fire:
|
||||
if (3 == current_field.density)
|
||||
apply_light_source(sx, sy, 160);
|
||||
else if (2 == current_field.density)
|
||||
apply_light_source(sx, sy, 60);
|
||||
else
|
||||
apply_light_source(sx, sy, 16);
|
||||
break;
|
||||
case fd_fire_vent:
|
||||
case fd_flame_burst:
|
||||
apply_light_source(sx, sy, 8);
|
||||
break;
|
||||
case fd_electricity:
|
||||
if (3 == current_field.density)
|
||||
apply_light_source(sx, sy, 8);
|
||||
else if (2 == current_field.density)
|
||||
apply_light_source(sx, sy, 1);
|
||||
else
|
||||
apply_light_source(sx, sy, LIGHT_SOURCE_LOCAL); // kinda a hack as the square will still get marked
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < g->z.size(); ++i) {
|
||||
int mx = g->z[i].posx;
|
||||
int my = g->z[i].posy;
|
||||
if (INBOUNDS(mx, my)) {
|
||||
if (g->z[i].has_effect(ME_ONFIRE)) {
|
||||
apply_light_source(mx, my, 3);
|
||||
}
|
||||
// TODO: [lightmap] Attach natural light brightness to creatures
|
||||
// TODO: [lightmap] Allow creatures to have light attacks (ie: eyebot)
|
||||
// TODO: [lightmap] Allow creatures to have facing and arc lights
|
||||
switch (g->z[i].type->id) {
|
||||
case mon_zombie_electric:
|
||||
apply_light_source(mx, my, 1);
|
||||
break;
|
||||
case mon_turret:
|
||||
apply_light_source(mx, my, 2);
|
||||
break;
|
||||
case mon_flaming_eye:
|
||||
apply_light_source(mx, my, LIGHT_SOURCE_BRIGHT);
|
||||
break;
|
||||
case mon_manhack:
|
||||
apply_light_source(mx, my, LIGHT_SOURCE_LOCAL);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Apply any vehicle light sources
|
||||
VehicleList vehs = g->m.get_vehicles();
|
||||
for(int v = 0; v < vehs.size(); ++v) {
|
||||
if(vehs[v].v->lights_on) {
|
||||
int dir = vehs[v].v->face.dir();
|
||||
for (std::vector<int>::iterator part = vehs[v].v->external_parts.begin();
|
||||
part != vehs[v].v->external_parts.end(); ++part) {
|
||||
int px = vehs[v].x + vehs[v].v->parts[*part].precalc_dx[0];
|
||||
int py = vehs[v].y + vehs[v].v->parts[*part].precalc_dy[0];
|
||||
if(INBOUNDS(px, py)) {
|
||||
int dpart = vehs[v].v->part_with_feature(*part , vpf_light);
|
||||
if (dpart >= 0) {
|
||||
float luminance = vehs[v].v->part_info(dpart).power;
|
||||
if (luminance > LL_LIT) {
|
||||
apply_light_arc(px, py, dir, luminance);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
lit_level map::light_at(int dx, int dy)
|
||||
{
|
||||
if (!INBOUNDS(dx, dy))
|
||||
return LL_DARK; // Out of bounds
|
||||
|
||||
if (sm[dx][dy] >= LIGHT_SOURCE_BRIGHT)
|
||||
return LL_BRIGHT;
|
||||
|
||||
if (lm[dx][dy] >= LIGHT_AMBIENT_LIT)
|
||||
return LL_LIT;
|
||||
|
||||
if (lm[dx][dy] >= LIGHT_AMBIENT_LOW)
|
||||
return LL_LOW;
|
||||
|
||||
return LL_DARK;
|
||||
}
|
||||
|
||||
float map::ambient_light_at(int dx, int dy)
|
||||
{
|
||||
if (!INBOUNDS(dx, dy))
|
||||
return 0.0f;
|
||||
|
||||
return lm[dx][dy];
|
||||
}
|
||||
|
||||
bool map::pl_sees(int fx, int fy, int tx, int ty, int max_range)
|
||||
{
|
||||
if (!INBOUNDS(tx, ty)) return false;
|
||||
|
||||
if (max_range >= 0 && (abs(tx - fx) > max_range || abs(ty - fy) > max_range))
|
||||
return false; // Out of range!
|
||||
|
||||
return seen_cache[tx][ty];
|
||||
}
|
||||
|
||||
void map::cache_seen(int fx, int fy, int tx, int ty, int max_range)
|
||||
{
|
||||
if (!INBOUNDS(fx, fy) || !INBOUNDS(tx, ty)) return;
|
||||
|
||||
const int ax = abs(tx - fx) << 1;
|
||||
const int ay = abs(ty - fy) << 1;
|
||||
const int dx = (fx < tx) ? 1 : -1;
|
||||
const int dy = (fy < ty) ? 1 : -1;
|
||||
int x = fx;
|
||||
int y = fy;
|
||||
int seen = true;
|
||||
|
||||
// TODO: [lightmap] Pull out the common code here rather than duplication
|
||||
if (ax > ay)
|
||||
{
|
||||
int t = ay - (ax >> 1);
|
||||
do
|
||||
{
|
||||
if(t >= 0 && ((y + dy != ty) || (x + dx == tx)))
|
||||
{
|
||||
y += dy;
|
||||
t -= ax;
|
||||
}
|
||||
|
||||
x += dx;
|
||||
t += ay;
|
||||
|
||||
seen_cache[x][y] |= seen;
|
||||
if(light_transparency(x, y) == LIGHT_TRANSPARENCY_SOLID) seen = false;
|
||||
|
||||
} while(!(x == tx && y == ty));
|
||||
}
|
||||
else
|
||||
{
|
||||
int t = ax - (ay >> 1);
|
||||
do
|
||||
{
|
||||
if(t >= 0 && ((x + dx != tx) || (y + dy == ty)))
|
||||
{
|
||||
x += dx;
|
||||
t -= ay;
|
||||
}
|
||||
|
||||
y += dy;
|
||||
t += ax;
|
||||
|
||||
seen_cache[x][y] |= seen;
|
||||
if(light_transparency(x, y) == LIGHT_TRANSPARENCY_SOLID) seen = false;
|
||||
|
||||
} while(!(x == tx && y == ty));
|
||||
}
|
||||
}
|
||||
|
||||
void map::apply_light_source(int x, int y, float luminance)
|
||||
{
|
||||
bool lit[LIGHTMAP_CACHE_X][LIGHTMAP_CACHE_Y];
|
||||
memset(lit, 0, sizeof(lit));
|
||||
|
||||
if (INBOUNDS(x, y)) {
|
||||
lit[x][y] = true;
|
||||
lm[x][y] += std::max(luminance, static_cast<float>(LL_LOW));
|
||||
sm[x][y] += luminance;
|
||||
}
|
||||
|
||||
if (luminance > LIGHT_SOURCE_LOCAL) {
|
||||
int range = LIGHT_RANGE(luminance);
|
||||
int sx = x - range; int ex = x + range;
|
||||
int sy = y - range; int ey = y + range;
|
||||
|
||||
for(int off = sx; off <= ex; ++off) {
|
||||
apply_light_ray(lit, x, y, off, sy, luminance);
|
||||
apply_light_ray(lit, x, y, off, ey, luminance);
|
||||
}
|
||||
|
||||
// Skip corners with + 1 and < as they were done
|
||||
for(int off = sy + 1; off < ey; ++off) {
|
||||
apply_light_ray(lit, x, y, sx, off, luminance);
|
||||
apply_light_ray(lit, x, y, ex, off, luminance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void map::apply_light_arc(int x, int y, int angle, float luminance)
|
||||
{
|
||||
if (luminance <= LIGHT_SOURCE_LOCAL)
|
||||
return;
|
||||
|
||||
bool lit[LIGHTMAP_CACHE_X][LIGHTMAP_CACHE_Y];
|
||||
memset(lit, 0, sizeof(lit));
|
||||
|
||||
int range = LIGHT_RANGE(luminance);
|
||||
apply_light_source(x, y, LIGHT_SOURCE_LOCAL);
|
||||
|
||||
// Normalise (should work with negative values too)
|
||||
angle = angle % 360;
|
||||
|
||||
// East side
|
||||
if (angle < 90 || angle > 270) {
|
||||
int sy = y - ((angle < 90) ? range * (( 45 - angle) / 45.0f) : range);
|
||||
int ey = y + ((angle > 270) ? range * ((angle - 315) / 45.0f) : range);
|
||||
|
||||
int ox = x + range;
|
||||
for(int oy = sy; oy <= ey; ++oy)
|
||||
apply_light_ray(lit, x, y, ox, oy, luminance);
|
||||
}
|
||||
|
||||
// South side
|
||||
if (angle < 180) {
|
||||
int sx = x - ((angle < 90) ? range * (( angle - 45) / 45.0f) : range);
|
||||
int ex = x + ((angle > 90) ? range * ((135 - angle) / 45.0f) : range);
|
||||
|
||||
int oy = y + range;
|
||||
for(int ox = sx; ox <= ex; ++ox)
|
||||
apply_light_ray(lit, x, y, ox, oy, luminance);
|
||||
}
|
||||
|
||||
// West side
|
||||
if (angle > 90 && angle < 270) {
|
||||
int sy = y - ((angle < 180) ? range * ((angle - 135) / 45.0f) : range);
|
||||
int ey = y + ((angle > 180) ? range * ((225 - angle) / 45.0f) : range);
|
||||
|
||||
int ox = x - range;
|
||||
for(int oy = sy; oy <= ey; ++oy)
|
||||
apply_light_ray(lit, x, y, ox, oy, luminance);
|
||||
}
|
||||
|
||||
// North side
|
||||
if (angle > 180) {
|
||||
int sx = x - ((angle > 270) ? range * ((315 - angle) / 45.0f) : range);
|
||||
int ex = x + ((angle < 270) ? range * ((angle - 225) / 45.0f) : range);
|
||||
|
||||
int oy = y - range;
|
||||
for(int ox = sx; ox <= ex; ++ox)
|
||||
apply_light_ray(lit, x, y, ox, oy, luminance);
|
||||
}
|
||||
}
|
||||
|
||||
void map::apply_light_ray(bool lit[LIGHTMAP_CACHE_X][LIGHTMAP_CACHE_Y],
|
||||
int sx, int sy, int ex, int ey, float luminance)
|
||||
{
|
||||
int ax = abs(ex - sx) << 1;
|
||||
int ay = abs(ey - sy) << 1;
|
||||
int dx = (sx < ex) ? 1 : -1;
|
||||
int dy = (sy < ey) ? 1 : -1;
|
||||
int x = sx;
|
||||
int y = sy;
|
||||
|
||||
float transparency = LIGHT_TRANSPARENCY_CLEAR;
|
||||
|
||||
// TODO: [lightmap] Pull out the common code here rather than duplication
|
||||
if (ax > ay) {
|
||||
int t = ay - (ax >> 1);
|
||||
do {
|
||||
if(t >= 0) {
|
||||
y += dy;
|
||||
t -= ax;
|
||||
}
|
||||
|
||||
x += dx;
|
||||
t += ay;
|
||||
|
||||
if (INBOUNDS(x, y) && !lit[x][y]) {
|
||||
// Multiple rays will pass through the same squares so we need to record that
|
||||
lit[x][y] = true;
|
||||
|
||||
// We know x is the longest angle here and squares can ignore the abs calculation
|
||||
float light = luminance / ((sx - x) * (sx - x));
|
||||
lm[x][y] += light * transparency;
|
||||
}
|
||||
|
||||
if (INBOUNDS(x, y))
|
||||
transparency *= light_transparency(x, y);
|
||||
|
||||
if (transparency <= LIGHT_TRANSPARENCY_SOLID)
|
||||
break;
|
||||
|
||||
} while(!(x == ex && y == ey));
|
||||
} else {
|
||||
int t = ax - (ay >> 1);
|
||||
do {
|
||||
if(t >= 0) {
|
||||
x += dx;
|
||||
t -= ay;
|
||||
}
|
||||
|
||||
y += dy;
|
||||
t += ax;
|
||||
|
||||
if (INBOUNDS(x, y) && !lit[x][y]) {
|
||||
// Multiple rays will pass through the same squares so we need to record that
|
||||
lit[x][y] = true;
|
||||
|
||||
// We know y is the longest angle here and squares can ignore the abs calculation
|
||||
float light = luminance / ((sy - y) * (sy - y));
|
||||
lm[x][y] += light;
|
||||
}
|
||||
|
||||
if (INBOUNDS(x, y))
|
||||
transparency *= light_transparency(x, y);
|
||||
|
||||
if (transparency <= LIGHT_TRANSPARENCY_SOLID)
|
||||
break;
|
||||
|
||||
} while(!(x == ex && y == ey));
|
||||
}
|
||||
}
|
||||
+22
@@ -0,0 +1,22 @@
|
||||
#ifndef _LIGHTMAP_H_
|
||||
#define _LIGHTMAP_H_
|
||||
|
||||
#define LIGHT_SOURCE_LOCAL 0.1
|
||||
#define LIGHT_SOURCE_BRIGHT 10
|
||||
|
||||
#define LIGHT_AMBIENT_LOW 1
|
||||
#define LIGHT_AMBIENT_LIT 2
|
||||
|
||||
#define LIGHT_TRANSPARENCY_SOLID 0
|
||||
#define LIGHT_TRANSPARENCY_CLEAR 1
|
||||
|
||||
#define LIGHT_RANGE(b) static_cast<int>(sqrt(b / LIGHT_AMBIENT_LOW) + 1)
|
||||
|
||||
enum lit_level {
|
||||
LL_DARK = 0,
|
||||
LL_LOW, // Hard to see
|
||||
LL_LIT,
|
||||
LL_BRIGHT // Probably only for light sources
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,9 +1,10 @@
|
||||
#include "line.h"
|
||||
#include "map.h"
|
||||
#include <stdlib.h>
|
||||
|
||||
#define SGN(a) (((a)<0) ? -1 : 1)
|
||||
|
||||
std::vector <point> line_to(int x1, int y1, int x2, int y2, int t) {
|
||||
std::vector <point> line_to(int x1, int y1, int x2, int y2, int t)
|
||||
{
|
||||
std::vector<point> ret;
|
||||
int dx = x2 - x1;
|
||||
int dy = y2 - y1;
|
||||
@@ -17,7 +18,22 @@ std::vector <point> line_to(int x1, int y1, int x2, int y2, int t) {
|
||||
cur.x = x1;
|
||||
cur.y = y1;
|
||||
|
||||
if (ax > ay) {
|
||||
int xmin = (x1 < x2 ? x1 : x2), ymin = (y1 < y2 ? y1 : y2),
|
||||
xmax = (x1 > x2 ? x1 : x2), ymax = (y1 > y2 ? y1 : y2);
|
||||
|
||||
xmin -= abs(dx);
|
||||
ymin -= abs(dy);
|
||||
xmax += abs(dx);
|
||||
ymax += abs(dy);
|
||||
|
||||
if (ax == ay) {
|
||||
do {
|
||||
cur.y += sy;
|
||||
cur.x += sx;
|
||||
ret.push_back(cur);
|
||||
} while ((cur.x != x2 || cur.y != y2) &&
|
||||
(cur.x >= xmin && cur.x <= xmax && cur.y >= ymin && cur.y <= ymax));
|
||||
} else if (ax > ay) {
|
||||
do {
|
||||
if (t > 0) {
|
||||
cur.y += sy;
|
||||
@@ -27,8 +43,7 @@ std::vector <point> line_to(int x1, int y1, int x2, int y2, int t) {
|
||||
t += ay;
|
||||
ret.push_back(cur);
|
||||
} while ((cur.x != x2 || cur.y != y2) &&
|
||||
(cur.x >= 0 - SEEX * 3 && cur.x <= SEEX * 6 &&
|
||||
cur.y >= 0 - SEEY * 3 && cur.y <= SEEY * 6 ));
|
||||
(cur.x >= xmin && cur.x <= xmax && cur.y >= ymin && cur.y <= ymax));
|
||||
} else {
|
||||
do {
|
||||
if (t > 0) {
|
||||
@@ -39,15 +54,14 @@ std::vector <point> line_to(int x1, int y1, int x2, int y2, int t) {
|
||||
t += ax;
|
||||
ret.push_back(cur);
|
||||
} while ((cur.x != x2 || cur.y != y2) &&
|
||||
(cur.x >= 0 - SEEX * 3 && cur.x <= SEEX * 6 &&
|
||||
cur.y >= 0 - SEEY * 3 && cur.y <= SEEY * 6 ));
|
||||
(cur.x >= xmin && cur.x <= xmax && cur.y >= ymin && cur.y <= ymax));
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
int trig_dist(int x1, int y1, int x2, int y2)
|
||||
{
|
||||
return int(sqrt(pow(x1 - x2, 2) + pow(y1 - y2, 2)));
|
||||
return int(sqrt(double(pow(x1 - x2, 2.0) + pow(y1 - y2, 2.0))));
|
||||
}
|
||||
|
||||
int rl_dist(int x1, int y1, int x2, int y2)
|
||||
@@ -58,37 +72,167 @@ int rl_dist(int x1, int y1, int x2, int y2)
|
||||
return dy;
|
||||
}
|
||||
|
||||
std::string direction_from(int x1, int y1, int x2, int y2)
|
||||
int rl_dist(point a, point b)
|
||||
{
|
||||
int dx = abs(a.x - b.x), dy = abs(a.y - b.y);
|
||||
if (dx > dy)
|
||||
return dx;
|
||||
return dy;
|
||||
}
|
||||
|
||||
double slope_of(std::vector<point> line)
|
||||
{
|
||||
double dX = line.back().x - line.front().x, dY = line.back().y - line.front().y;
|
||||
if (dX == 0)
|
||||
return SLOPE_VERTICAL;
|
||||
return (dY / dX);
|
||||
}
|
||||
|
||||
std::vector<point> continue_line(std::vector<point> line, int distance)
|
||||
{
|
||||
point start = line.back(), end = line.back();
|
||||
double slope = slope_of(line);
|
||||
int sX = (line.front().x < line.back().x ? 1 : -1),
|
||||
sY = (line.front().y < line.back().y ? 1 : -1);
|
||||
if (abs(slope) == 1) {
|
||||
end.x += distance * sX;
|
||||
end.y += distance * sY;
|
||||
} else if (abs(slope) < 1) {
|
||||
end.x += distance * sX;
|
||||
end.y += int(distance * abs(slope) * sY);
|
||||
} else {
|
||||
end.y += distance * sY;
|
||||
if (slope != SLOPE_VERTICAL)
|
||||
end.x += int(distance / abs(slope)) * sX;
|
||||
}
|
||||
return line_to(start.x, start.y, end.x, end.y, 0);
|
||||
}
|
||||
|
||||
direction direction_from(int x1, int y1, int x2, int y2)
|
||||
{
|
||||
int dx = x2 - x1;
|
||||
int dy = y2 - y1;
|
||||
if (dx < 0) {
|
||||
if (abs(dx) >> 1 > abs(dy) || dy == 0) {
|
||||
return "the west";
|
||||
} else if (abs(dy) >> 1 > abs(dx)) {
|
||||
if (abs(dx) / 2 > abs(dy) || dy == 0) {
|
||||
return WEST;
|
||||
} else if (abs(dy) / 2 > abs(dx)) {
|
||||
if (dy < 0)
|
||||
return "the north";
|
||||
return NORTH;
|
||||
else
|
||||
return "the south";
|
||||
return SOUTH;
|
||||
} else {
|
||||
if (dy < 0)
|
||||
return "the northwest";
|
||||
return NORTHWEST;
|
||||
else
|
||||
return "the southwest";
|
||||
return SOUTHWEST;
|
||||
}
|
||||
} else {
|
||||
if (dx >> 1 > abs(dy) || dy == 0) {
|
||||
return "the east";
|
||||
} else if (abs(dy) >> 1 > dx || dx == 0) {
|
||||
if (dx / 2 > abs(dy) || dy == 0) {
|
||||
return EAST;
|
||||
} else if (abs(dy) / 2 > dx || dx == 0) {
|
||||
if (dy < 0)
|
||||
return "the north";
|
||||
return NORTH;
|
||||
else
|
||||
return "the south";
|
||||
return SOUTH;
|
||||
} else {
|
||||
if (dy < 0)
|
||||
return "the northeast";
|
||||
return NORTHEAST;
|
||||
else
|
||||
return "the southeast";
|
||||
return SOUTHEAST;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string direction_name(direction dir)
|
||||
{
|
||||
switch (dir) {
|
||||
case NORTH: return "north";
|
||||
case NORTHEAST: return "northeast";
|
||||
case EAST: return "east";
|
||||
case SOUTHEAST: return "southeast";
|
||||
case SOUTH: return "south";
|
||||
case SOUTHWEST: return "southwest";
|
||||
case WEST: return "west";
|
||||
case NORTHWEST: return "northwest";
|
||||
}
|
||||
return "WEIRD DIRECTION_NAME() BUG";
|
||||
}
|
||||
|
||||
std::string direction_name_short(direction dir)
|
||||
{
|
||||
switch (dir) {
|
||||
case NORTH: return "N ";
|
||||
case NORTHEAST: return "NE";
|
||||
case EAST: return "E ";
|
||||
case SOUTHEAST: return "SE";
|
||||
case SOUTH: return "W ";
|
||||
case SOUTHWEST: return "SW";
|
||||
case WEST: return "W ";
|
||||
case NORTHWEST: return "NW";
|
||||
}
|
||||
return "WEIRD DIRECTION_NAME() BUG";
|
||||
}
|
||||
|
||||
|
||||
float rl_vec2d::norm(){
|
||||
if (fabs(x) > fabs(y))
|
||||
return fabs(x);
|
||||
return fabs(y);
|
||||
}
|
||||
|
||||
rl_vec2d rl_vec2d::normalized(){
|
||||
rl_vec2d ret;
|
||||
if (is_null()){ // shouldn't happen?
|
||||
ret.x = ret.y = 1;
|
||||
return ret;
|
||||
}
|
||||
float n = norm();
|
||||
ret.x = x/n;
|
||||
ret.y = y/n;
|
||||
return ret;
|
||||
}
|
||||
float rl_vec2d::dot_product (rl_vec2d &v){
|
||||
float dot = x*v.x + y*v.y;
|
||||
// this is messy, but the dot of normalized rl_vecs should somehow be max 1
|
||||
float tot1 = fabs(x) + fabs(y);
|
||||
float tot2 = fabs(v.x) + fabs(v.y);
|
||||
dot /= ((tot1+tot2)/2);
|
||||
dot *= norm() * v.norm();
|
||||
return dot;
|
||||
}
|
||||
bool rl_vec2d::is_null(){
|
||||
return !(x || y);
|
||||
}
|
||||
// scale.
|
||||
rl_vec2d rl_vec2d::operator* (const float rhs){
|
||||
rl_vec2d ret;
|
||||
ret.x = x * rhs;
|
||||
ret.y = y * rhs;
|
||||
return ret;
|
||||
}
|
||||
// subtract
|
||||
rl_vec2d rl_vec2d::operator- (const rl_vec2d &rhs){
|
||||
rl_vec2d ret;
|
||||
ret.x = x - rhs.x;
|
||||
ret.y = y - rhs.y;
|
||||
return ret;
|
||||
}
|
||||
// unary negation
|
||||
rl_vec2d rl_vec2d::operator- (){
|
||||
rl_vec2d ret;
|
||||
ret.x = -x;
|
||||
ret.y = -y;
|
||||
return ret;
|
||||
}
|
||||
rl_vec2d rl_vec2d::operator+ (const rl_vec2d &rhs){
|
||||
rl_vec2d ret;
|
||||
ret.x = x + rhs.x;
|
||||
ret.y = y + rhs.y;
|
||||
return ret;
|
||||
}
|
||||
rl_vec2d rl_vec2d::operator/ (const float rhs){
|
||||
rl_vec2d ret;
|
||||
ret.x = x / rhs;
|
||||
ret.y = y / rhs;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -4,11 +4,59 @@
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include "enums.h"
|
||||
#include <math.h>
|
||||
|
||||
#define SLOPE_VERTICAL 999999
|
||||
|
||||
enum direction {
|
||||
NORTH = 0,
|
||||
NORTHEAST,
|
||||
EAST,
|
||||
SOUTHEAST,
|
||||
SOUTH,
|
||||
SOUTHWEST,
|
||||
WEST,
|
||||
NORTHWEST
|
||||
};
|
||||
|
||||
// The "t" value decides WHICH Bresenham line is used.
|
||||
std::vector <point> line_to(int x1, int y1, int x2, int y2, int t);
|
||||
// sqrt(dX^2 + dY^2)
|
||||
int trig_dist(int x1, int y1, int x2, int y2);
|
||||
// Roguelike distance; minimum of dX and dY
|
||||
int rl_dist(int x1, int y1, int x2, int y2);
|
||||
std::string direction_from(int x1, int y1, int x2, int y2);
|
||||
int rl_dist(point a, point b);
|
||||
double slope_of(std::vector<point> line);
|
||||
std::vector<point> continue_line(std::vector<point> line, int distance);
|
||||
direction direction_from(int x1, int y1, int x2, int y2);
|
||||
std::string direction_name(direction dir);
|
||||
std::string direction_name_short(direction dir);
|
||||
|
||||
|
||||
|
||||
|
||||
// weird class for 2d vectors where dist is derived from rl_dist
|
||||
struct rl_vec2d {
|
||||
float x;
|
||||
float y;
|
||||
|
||||
// vec2d(){}
|
||||
rl_vec2d(float X = 0, float Y = 0) : x (X), y (Y) {}
|
||||
rl_vec2d(const rl_vec2d &v) : x (v.x), y (v.y) {}
|
||||
~rl_vec2d(){}
|
||||
|
||||
float norm();
|
||||
rl_vec2d normalized();
|
||||
float dot_product (rl_vec2d &v);
|
||||
bool is_null();
|
||||
// scale.
|
||||
rl_vec2d operator* (const float rhs);
|
||||
rl_vec2d operator/ (const float rhs);
|
||||
// subtract
|
||||
rl_vec2d operator- (const rl_vec2d &rhs);
|
||||
// unary negation
|
||||
rl_vec2d operator- ();
|
||||
rl_vec2d operator+ (const rl_vec2d &rhs);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -4,65 +4,112 @@
|
||||
* Who knows
|
||||
*/
|
||||
|
||||
#include <ncurses.h>
|
||||
#include "cursesdef.h"
|
||||
#include <ctime>
|
||||
#include "game.h"
|
||||
#include "color.h"
|
||||
#include "options.h"
|
||||
#include "mapbuffer.h"
|
||||
#include "debug.h"
|
||||
#include <sys/stat.h>
|
||||
#include <cstdlib>
|
||||
#include <signal.h>
|
||||
|
||||
// FUNCTIONS
|
||||
void do_colors();
|
||||
//void load_items();
|
||||
void exit_handler(int s);
|
||||
|
||||
int main(int argc, char *argv[])
|
||||
{
|
||||
srand(time(NULL));
|
||||
#ifdef ENABLE_LOGGING
|
||||
setupDebug();
|
||||
#endif
|
||||
int seed = time(NULL);
|
||||
|
||||
initscr();
|
||||
noecho();
|
||||
cbreak();
|
||||
keypad(stdscr, true);
|
||||
do_colors();
|
||||
curs_set(0);
|
||||
//args: world seeding only.
|
||||
argc--; argv++;
|
||||
while (argc){
|
||||
if(std::string(argv[0]) == "--seed"){
|
||||
argc--; argv++;
|
||||
if(argc){
|
||||
seed = djb2_hash((unsigned char*)argv[0]);
|
||||
argc--; argv++;
|
||||
}
|
||||
}
|
||||
else // ignore unknown args.
|
||||
argc--; argv++;
|
||||
}
|
||||
|
||||
// ncurses stuff
|
||||
load_options(); // For getting size options
|
||||
initscr(); // Initialize ncurses
|
||||
noecho(); // Don't echo keypresses
|
||||
cbreak(); // C-style breaks (e.g. ^C to SIGINT)
|
||||
keypad(stdscr, true); // Numpad is numbers
|
||||
init_colors(); // See color.cpp
|
||||
curs_set(0); // Invisible cursor
|
||||
set_escdelay(10); // Make escape actually responsive
|
||||
|
||||
std::srand(seed);
|
||||
|
||||
bool quit_game = false;
|
||||
bool delete_world = false;
|
||||
game *g = new game;
|
||||
g->init_ui();
|
||||
MAPBUFFER.set_game(g);
|
||||
MAPBUFFER.load();
|
||||
|
||||
#if (!(defined _WIN32 || defined WINDOWS))
|
||||
struct sigaction sigIntHandler;
|
||||
sigIntHandler.sa_handler = exit_handler;
|
||||
sigemptyset(&sigIntHandler.sa_mask);
|
||||
sigIntHandler.sa_flags = 0;
|
||||
sigaction(SIGINT, &sigIntHandler, NULL);
|
||||
#endif
|
||||
|
||||
do {
|
||||
g->setup();
|
||||
while (!g->do_turn()) ;
|
||||
if (g->uquit == QUIT_DELETE_WORLD)
|
||||
delete_world = true;
|
||||
if (g->game_quit())
|
||||
quit_game = true;
|
||||
} while (!quit_game);
|
||||
|
||||
if (delete_world)
|
||||
{
|
||||
g->delete_save();
|
||||
} else {
|
||||
MAPBUFFER.save_if_dirty();
|
||||
}
|
||||
|
||||
exit_handler(-999);
|
||||
|
||||
rand();
|
||||
game g;
|
||||
while (!g.do_turn());
|
||||
erase();
|
||||
endwin();
|
||||
system("clear");
|
||||
return 0;
|
||||
}
|
||||
|
||||
#define HILIGHT COLOR_BLUE
|
||||
void do_colors()
|
||||
{
|
||||
start_color();
|
||||
void exit_handler(int s) {
|
||||
bool bExit = false;
|
||||
|
||||
init_pair( 1, COLOR_WHITE, COLOR_BLACK );
|
||||
init_pair( 2, COLOR_RED, COLOR_BLACK );
|
||||
init_pair( 3, COLOR_GREEN, COLOR_BLACK );
|
||||
init_pair( 4, COLOR_BLUE, COLOR_BLACK );
|
||||
init_pair( 5, COLOR_CYAN, COLOR_BLACK );
|
||||
init_pair( 6, COLOR_MAGENTA, COLOR_BLACK );
|
||||
init_pair( 7, COLOR_YELLOW, COLOR_BLACK );
|
||||
if (s == 2) {
|
||||
if (query_yn("Really Quit? All unsafed changes will be lost.")) {
|
||||
bExit = true;
|
||||
}
|
||||
} else if (s == -999) {
|
||||
bExit = true;
|
||||
} else {
|
||||
//query_yn(g, "Signal received: %d", s);
|
||||
bExit = true;
|
||||
}
|
||||
|
||||
// Inverted Colors
|
||||
init_pair( 8, COLOR_BLACK, COLOR_WHITE );
|
||||
init_pair( 9, COLOR_BLACK, COLOR_RED );
|
||||
init_pair(10, COLOR_BLACK, COLOR_GREEN );
|
||||
init_pair(11, COLOR_BLACK, COLOR_BLUE );
|
||||
init_pair(12, COLOR_BLACK, COLOR_CYAN );
|
||||
init_pair(13, COLOR_BLACK, COLOR_MAGENTA);
|
||||
init_pair(14, COLOR_BLACK, COLOR_YELLOW );
|
||||
if (bExit) {
|
||||
erase(); // Clear screen
|
||||
endwin(); // End ncurses
|
||||
#if (defined _WIN32 || defined WINDOWS)
|
||||
system("cls"); // Tell the terminal to clear itself
|
||||
system("color 07");
|
||||
#else
|
||||
system("clear"); // Tell the terminal to clear itself
|
||||
#endif
|
||||
|
||||
// Highlighted - blue background
|
||||
init_pair(15, COLOR_WHITE, HILIGHT);
|
||||
init_pair(16, COLOR_RED, HILIGHT);
|
||||
init_pair(17, COLOR_GREEN, HILIGHT);
|
||||
init_pair(18, COLOR_BLUE, HILIGHT);
|
||||
init_pair(19, COLOR_CYAN, HILIGHT);
|
||||
init_pair(20, COLOR_BLACK, HILIGHT);
|
||||
init_pair(21, COLOR_MAGENTA, HILIGHT);
|
||||
init_pair(22, COLOR_YELLOW, HILIGHT);
|
||||
|
||||
init_pair(23, COLOR_BLACK, COLOR_BLACK );
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
+426
@@ -0,0 +1,426 @@
|
||||
#include "game.h"
|
||||
#include "input.h"
|
||||
#include "keypress.h"
|
||||
#include "debug.h"
|
||||
#include "mapbuffer.h"
|
||||
#include "cursesdef.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
#include <dirent.h>
|
||||
|
||||
#define dbg(x) dout((DebugLevel)(x),D_GAME) << __FILE__ << ":" << __LINE__ << ": "
|
||||
|
||||
void game::print_menu(WINDOW* w_open, int iSel, const int iMenuOffsetX, int iMenuOffsetY, bool bShowDDA)
|
||||
{
|
||||
//Clear Lines
|
||||
werase(w_open);
|
||||
|
||||
for (int i = 1; i < 79; i++)
|
||||
mvwputch(w_open, 23, i, c_white, LINE_OXOX);
|
||||
|
||||
mvwprintz(w_open, 24, 5, c_red, "Please report bugs to TheDarklingWolf@gmail.com or post on the forums.");
|
||||
|
||||
int iLine = 0;
|
||||
const int iOffsetX1 = 3;
|
||||
const int iOffsetX2 = 4;
|
||||
const int iOffsetX3 = 18;
|
||||
|
||||
const nc_color cColor1 = c_ltcyan;
|
||||
const nc_color cColor2 = c_ltblue;
|
||||
const nc_color cColor3 = c_ltblue;
|
||||
|
||||
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, "_________ __ .__ ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, "\\_ ___ \\ _____ _/ |_ _____ ____ | | ___.__ ______ _____ ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, "/ \\ \\/ \\__ \\ \\ __\\\\__ \\ _/ ___\\ | | < | | / ___/ / \\ ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, "\\ \\____ / __ \\_ | | / __ \\_\\ \\___ | |__ \\___ | \\___ \\ | Y Y \\");
|
||||
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, " \\______ /(____ / |__| (____ / \\___ >|____/ / ____|/____ >|__|_| /");
|
||||
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, " \\/ \\/ \\/ \\/ \\/ \\/ \\/ ");
|
||||
|
||||
if (bShowDDA) {
|
||||
iLine++;
|
||||
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, "________ .__ ________ ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, "\\______ \\ _____ _______ | | __ \\______ \\ _____ ___.__ ______");
|
||||
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, " | | \\ \\__ \\ \\_ __ \\| |/ / | | \\ \\__ \\ < | | / ___/");
|
||||
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, " | ` \\ / __ \\_ | | \\/| < | ` \\ / __ \\_ \\___ | \\___ \\ ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, "/_______ /(____ / |__| |__|_ \\ /_______ /(____ / / ____|/____ >");
|
||||
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, " \\/ \\/ \\/ \\/ \\/ \\/ \\/ ");
|
||||
|
||||
iLine++;
|
||||
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, " _____ .__ .___");
|
||||
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, " / _ \\ | |__ ____ _____ __| _/");
|
||||
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, " / /_\\ \\ | | \\ _/ __ \\ \\__ \\ / __ | ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, "/ | \\| Y \\\\ ___/ / __ \\_/ /_/ | ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, "\\____|__ /|___| / \\___ >(____ /\\____ | ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, " \\/ \\/ \\/ \\/ \\/ ");
|
||||
}
|
||||
|
||||
std::vector<std::string> vMenuItems;
|
||||
vMenuItems.push_back("MOTD");
|
||||
vMenuItems.push_back("New Game");
|
||||
vMenuItems.push_back("Load");
|
||||
vMenuItems.push_back("Reset");
|
||||
vMenuItems.push_back("Special");
|
||||
vMenuItems.push_back("Options");
|
||||
vMenuItems.push_back("Help");
|
||||
vMenuItems.push_back("Credits");
|
||||
vMenuItems.push_back("Quit");
|
||||
|
||||
print_menu_items(w_open, vMenuItems, iSel, iMenuOffsetY, iMenuOffsetX);
|
||||
|
||||
refresh();
|
||||
wrefresh(w_open);
|
||||
refresh();
|
||||
}
|
||||
|
||||
void game::print_menu_items(WINDOW* w_in, std::vector<std::string> vItems, int iSel, int iOffsetY, int iOffsetX)
|
||||
{
|
||||
mvwprintz(w_in, iOffsetY, iOffsetX, c_black, "");
|
||||
|
||||
for (int i=0; i < vItems.size(); i++) {
|
||||
wprintz(w_in, c_ltgray, "[");
|
||||
if (iSel == i) {
|
||||
wprintz(w_in, h_white, vItems[i].c_str());
|
||||
} else {
|
||||
wprintz(w_in, c_white, (vItems[i].substr(0, 1)).c_str());
|
||||
wprintz(w_in, c_ltgray, (vItems[i].substr(1)).c_str());
|
||||
}
|
||||
wprintz(w_in, c_ltgray, "] ");
|
||||
}
|
||||
}
|
||||
|
||||
bool game::opening_screen()
|
||||
{
|
||||
WINDOW* w_background = newwin(TERMY, TERMX, 0, 0);
|
||||
|
||||
werase(w_background);
|
||||
wrefresh(w_background);
|
||||
|
||||
WINDOW* w_open = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
const int iMenuOffsetX = 2;
|
||||
int iMenuOffsetY = 22;
|
||||
|
||||
std::vector<std::string> vSubItems;
|
||||
vSubItems.push_back("Custom Character");
|
||||
vSubItems.push_back("Preset Character");
|
||||
vSubItems.push_back("Random Character");
|
||||
|
||||
print_menu(w_open, 0, iMenuOffsetX, iMenuOffsetY);
|
||||
|
||||
std::vector<std::string> savegames, templates;
|
||||
std::string tmp;
|
||||
dirent *dp;
|
||||
DIR *dir = opendir("save");
|
||||
if (!dir) {
|
||||
#if (defined _WIN32 || defined __WIN32__)
|
||||
mkdir("save");
|
||||
#else
|
||||
mkdir("save", 0777);
|
||||
#endif
|
||||
dir = opendir("save");
|
||||
}
|
||||
if (!dir) {
|
||||
dbg(D_ERROR) << "game:opening_screen: Unable to make save directory.";
|
||||
debugmsg("Could not make './save' directory");
|
||||
endwin();
|
||||
exit(1);
|
||||
}
|
||||
while ((dp = readdir(dir))) {
|
||||
tmp = dp->d_name;
|
||||
if (tmp.find(".sav") != std::string::npos)
|
||||
savegames.push_back(tmp.substr(0, tmp.find(".sav")));
|
||||
}
|
||||
closedir(dir);
|
||||
dir = opendir("data");
|
||||
while ((dp = readdir(dir))) {
|
||||
tmp = dp->d_name;
|
||||
if (tmp.find(".template") != std::string::npos)
|
||||
templates.push_back(tmp.substr(0, tmp.find(".template")));
|
||||
}
|
||||
|
||||
int sel1 = 1, sel2 = 1, layer = 1;
|
||||
InputEvent input;
|
||||
int chInput;
|
||||
bool start = false;
|
||||
|
||||
// Load MOTD and store it in a string
|
||||
std::vector<std::string> motd;
|
||||
std::ifstream motd_file;
|
||||
motd_file.open("data/motd");
|
||||
if (!motd_file.is_open())
|
||||
motd.push_back("No message today.");
|
||||
else {
|
||||
while (!motd_file.eof()) {
|
||||
std::string tmp;
|
||||
getline(motd_file, tmp);
|
||||
if (tmp[0] != '#')
|
||||
motd.push_back(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
// Load Credits and store it in a string
|
||||
std::vector<std::string> credits;
|
||||
std::ifstream credits_file;
|
||||
credits_file.open("data/credits");
|
||||
if (!credits_file.is_open())
|
||||
credits.push_back("No message today.");
|
||||
else {
|
||||
while (!credits_file.eof()) {
|
||||
std::string tmp;
|
||||
getline(credits_file, tmp);
|
||||
if (tmp[0] != '#')
|
||||
credits.push_back(tmp);
|
||||
}
|
||||
}
|
||||
|
||||
while(!start) {
|
||||
if (layer == 1) {
|
||||
print_menu(w_open, sel1, iMenuOffsetX, iMenuOffsetY, (sel1 == 0 || sel1 == 7) ? false : true);
|
||||
|
||||
if (sel1 == 0) { // Print the MOTD.
|
||||
for (int i = 0; i < motd.size() && i < 16; i++)
|
||||
mvwprintz(w_open, i + 7, 8, c_ltred, motd[i].c_str());
|
||||
|
||||
wrefresh(w_open);
|
||||
refresh();
|
||||
} else if (sel1 == 7) { // Print the Credits.
|
||||
for (int i = 0; i < credits.size() && i < 16; i++)
|
||||
mvwprintz(w_open, i + 7, 8, c_ltred, credits[i].c_str());
|
||||
|
||||
wrefresh(w_open);
|
||||
refresh();
|
||||
}
|
||||
|
||||
chInput = getch();
|
||||
|
||||
if (chInput == 'm' || chInput == 'M') {
|
||||
sel1 = 0;
|
||||
chInput = '\n';
|
||||
} else if (chInput == 'n' || chInput == 'N') {
|
||||
sel1 = 1;
|
||||
chInput = '\n';
|
||||
} else if (chInput == 'L') {
|
||||
sel1 = 2;
|
||||
chInput = '\n';
|
||||
} else if (chInput == 'r' || chInput == 'R') {
|
||||
sel1 = 3;
|
||||
chInput = '\n';
|
||||
} else if (chInput == 's' || chInput == 'S') {
|
||||
sel1 = 4;
|
||||
chInput = '\n';
|
||||
} else if (chInput == 'o' || chInput == 'O') {
|
||||
sel1 = 5;
|
||||
chInput = '\n';
|
||||
} else if (chInput == 'H') {
|
||||
sel1 = 6;
|
||||
chInput = '\n';
|
||||
} else if (chInput == 'c' || chInput == 'C') {
|
||||
sel1 = 7;
|
||||
chInput = '\n';
|
||||
} else if (chInput == 'q' || chInput == 'Q' || chInput == KEY_ESCAPE) {
|
||||
sel1 = 8;
|
||||
chInput = '\n';
|
||||
}
|
||||
|
||||
if (chInput == KEY_LEFT || chInput == 'h') {
|
||||
if (sel1 > 0)
|
||||
sel1--;
|
||||
else
|
||||
sel1 = 8;
|
||||
} else if (chInput == KEY_RIGHT || chInput == 'l') {
|
||||
if (sel1 < 8)
|
||||
sel1++;
|
||||
else
|
||||
sel1 = 0;
|
||||
} else if ((chInput == KEY_UP || chInput == 'k' || chInput == '\n') && sel1 > 0 && sel1 != 7) {
|
||||
if (sel1 == 5) {
|
||||
show_options();
|
||||
} else if (sel1 == 6) {
|
||||
help();
|
||||
} else if (sel1 == 8) {
|
||||
uquit = QUIT_MENU;
|
||||
return false;
|
||||
} else {
|
||||
sel2 = 0;
|
||||
layer = 2;
|
||||
print_menu(w_open, sel1, iMenuOffsetX, iMenuOffsetY, (sel1 == 0 || sel1 == 7) ? false : true);
|
||||
}
|
||||
}
|
||||
} else if (layer == 2) {
|
||||
if (sel1 == 1) { // New Character
|
||||
print_menu_items(w_open, vSubItems, sel2, iMenuOffsetY-2, iMenuOffsetX+7);
|
||||
wrefresh(w_open);
|
||||
refresh();
|
||||
chInput = getch();
|
||||
|
||||
if (chInput == 'c' || chInput == 'C') {
|
||||
sel2 = 0;
|
||||
chInput = '\n' ;
|
||||
} else if (chInput == 'p' || chInput == 'P') {
|
||||
sel2 = 1;
|
||||
chInput = '\n';
|
||||
} else if (chInput == 'r' || chInput == 'R') {
|
||||
sel2 = 2;
|
||||
chInput = '\n';
|
||||
}
|
||||
|
||||
if (chInput == KEY_LEFT || chInput == 'h') {
|
||||
if (sel2 > 0)
|
||||
sel2--;
|
||||
else
|
||||
sel2 = 2;
|
||||
} if (chInput == KEY_RIGHT || chInput == 'l') {
|
||||
if (sel2 < 2)
|
||||
sel2++;
|
||||
else
|
||||
sel2 = 0;
|
||||
} else if (chInput == KEY_DOWN || chInput == 'j' || chInput == KEY_ESCAPE) {
|
||||
layer = 1;
|
||||
sel1 = 1;
|
||||
}
|
||||
if (chInput == KEY_UP || chInput == 'k' || chInput == '\n') {
|
||||
if (sel2 == 0 || sel2 == 2) {
|
||||
if (!u.create(this, (sel2 == 0) ? PLTYPE_CUSTOM : PLTYPE_RANDOM)) {
|
||||
u = player();
|
||||
delwin(w_open);
|
||||
return (opening_screen());
|
||||
}
|
||||
|
||||
werase(w_background);
|
||||
wrefresh(w_background);
|
||||
start_game();
|
||||
start = true;
|
||||
} else if (sel2 == 1) {
|
||||
layer = 3;
|
||||
sel1 = 0;
|
||||
print_menu_items(w_open, vSubItems, sel2, iMenuOffsetY-2, iMenuOffsetX+7);
|
||||
}
|
||||
}
|
||||
} else if (sel1 == 2) { // Load Character
|
||||
if (savegames.size() == 0)
|
||||
mvwprintz(w_open, iMenuOffsetY - 2, 19 + iMenuOffsetX, c_red, "No save games found!");
|
||||
else {
|
||||
for (int i = 0; i < savegames.size(); i++) {
|
||||
int line = iMenuOffsetY - 2 - i;
|
||||
mvwprintz(w_open, line, 19 + iMenuOffsetX, (sel2 == i ? h_white : c_white), savegames[i].c_str());
|
||||
}
|
||||
}
|
||||
wrefresh(w_open);
|
||||
refresh();
|
||||
input = get_input();
|
||||
if (savegames.size() == 0 && (input == DirectionS || input == Confirm)) {
|
||||
layer = 1;
|
||||
} else if (input == DirectionS) {
|
||||
if (sel2 > 0)
|
||||
sel2--;
|
||||
else
|
||||
sel2 = savegames.size() - 1;
|
||||
} else if (input == DirectionN) {
|
||||
if (sel2 < savegames.size() - 1)
|
||||
sel2++;
|
||||
else
|
||||
sel2 = 0;
|
||||
} else if (input == DirectionW || input == Cancel) {
|
||||
layer = 1;
|
||||
}
|
||||
if (input == DirectionE || input == Confirm) {
|
||||
if (sel2 >= 0 && sel2 < savegames.size()) {
|
||||
werase(w_background);
|
||||
wrefresh(w_background);
|
||||
load(savegames[sel2]);
|
||||
start = true;
|
||||
}
|
||||
}
|
||||
} else if (sel1 == 3) { // Delete world
|
||||
if (query_yn("Delete the world and all saves?")) {
|
||||
delete_save();
|
||||
savegames.clear();
|
||||
MAPBUFFER.reset();
|
||||
MAPBUFFER.make_volatile();
|
||||
}
|
||||
|
||||
layer = 1;
|
||||
} else if (sel1 == 4) { // Special game
|
||||
for (int i = 1; i < NUM_SPECIAL_GAMES; i++) {
|
||||
mvwprintz(w_open, iMenuOffsetY-i-1, 34 + iMenuOffsetX, (sel2 == i-1 ? h_white : c_white),
|
||||
special_game_name( special_game_id(i) ).c_str());
|
||||
}
|
||||
wrefresh(w_open);
|
||||
refresh();
|
||||
input = get_input();
|
||||
if (input == DirectionS) {
|
||||
if (sel2 > 0)
|
||||
sel2--;
|
||||
else
|
||||
sel2 = NUM_SPECIAL_GAMES - 2;
|
||||
} else if (input == DirectionN) {
|
||||
if (sel2 < NUM_SPECIAL_GAMES - 2)
|
||||
sel2++;
|
||||
else
|
||||
sel2 = 0;
|
||||
} else if (input == DirectionW || input == Cancel) {
|
||||
layer = 1;
|
||||
}
|
||||
if (input == DirectionE || input == Confirm) {
|
||||
if (sel2 >= 0 && sel2 < NUM_SPECIAL_GAMES - 1) {
|
||||
delete gamemode;
|
||||
gamemode = get_special_game( special_game_id(sel2+1) );
|
||||
if (!gamemode->init(this)) {
|
||||
delete gamemode;
|
||||
gamemode = new special_game;
|
||||
u = player();
|
||||
delwin(w_open);
|
||||
return (opening_screen());
|
||||
}
|
||||
start = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (layer == 3) { // Character Templates
|
||||
if (templates.size() == 0)
|
||||
mvwprintz(w_open, iMenuOffsetY-4, iMenuOffsetX+27, c_red, "No templates found!");
|
||||
else {
|
||||
for (int i = 0; i < templates.size(); i++) {
|
||||
int line = iMenuOffsetY - 4 - i;
|
||||
mvwprintz(w_open, line, 27 + iMenuOffsetX, (sel1 == i ? h_white : c_white), templates[i].c_str());
|
||||
}
|
||||
}
|
||||
wrefresh(w_open);
|
||||
refresh();
|
||||
input = get_input();
|
||||
if (input == DirectionS) {
|
||||
if (sel1 > 0)
|
||||
sel1--;
|
||||
else
|
||||
sel1 = templates.size() - 1;
|
||||
} else if (templates.size() == 0 && (input == DirectionN || input == Confirm)) {
|
||||
sel1 = 1;
|
||||
layer = 2;
|
||||
print_menu(w_open, sel1, iMenuOffsetX, iMenuOffsetY);
|
||||
} else if (input == DirectionN) {
|
||||
if (sel1 < templates.size() - 1)
|
||||
sel1++;
|
||||
else
|
||||
sel1 = 0;
|
||||
} else if (input == DirectionW || input == Cancel || templates.size() == 0) {
|
||||
sel1 = 1;
|
||||
layer = 2;
|
||||
print_menu(w_open, sel1, iMenuOffsetX, iMenuOffsetY);
|
||||
} else if (input == DirectionE || input == Confirm) {
|
||||
if (!u.create(this, PLTYPE_TEMPLATE, templates[sel1])) {
|
||||
u = player();
|
||||
delwin(w_open);
|
||||
return (opening_screen());
|
||||
}
|
||||
|
||||
werase(w_background);
|
||||
wrefresh(w_background);
|
||||
start_game();
|
||||
start = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
delwin(w_open);
|
||||
if (start == false)
|
||||
uquit = QUIT_MENU;
|
||||
return start;
|
||||
}
|
||||
@@ -1,10 +1,13 @@
|
||||
#ifndef _MAP_H_
|
||||
#define _MAP_H_
|
||||
|
||||
#include <ncurses.h>
|
||||
#include "cursesdef.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <set>
|
||||
#include <map>
|
||||
|
||||
#include "mapdata.h"
|
||||
#include "mapitems.h"
|
||||
@@ -12,103 +15,257 @@
|
||||
#include "item.h"
|
||||
#include "monster.h"
|
||||
#include "npc.h"
|
||||
#include "vehicle.h"
|
||||
#include "graffiti.h"
|
||||
#include "lightmap.h"
|
||||
|
||||
#define MAPSIZE 11
|
||||
#define CAMPSIZE 1
|
||||
#define CAMPCHECK 3
|
||||
|
||||
class player;
|
||||
class item;
|
||||
struct itype;
|
||||
|
||||
// TODO: This should be const& but almost no functions are const
|
||||
struct wrapped_vehicle{
|
||||
int x;
|
||||
int y;
|
||||
int i; // submap col
|
||||
int j; // submap row
|
||||
vehicle* v;
|
||||
};
|
||||
|
||||
typedef std::vector<wrapped_vehicle> VehicleList;
|
||||
|
||||
class map
|
||||
{
|
||||
public:
|
||||
|
||||
// Constructors & Initialization
|
||||
map();
|
||||
map(std::vector<itype*> *itptr, std::vector<itype_id> (*miptr)[num_itloc],
|
||||
map(std::map<std::string, itype*>* itptr, std::vector<itype_id> (*miptr)[num_itloc],
|
||||
std::vector<trap*> *trptr);
|
||||
~map();
|
||||
void init(game *g, int x, int y);
|
||||
void generate(game *g, overmap *om, int x, int y, int turn);
|
||||
|
||||
// Visual Output
|
||||
void draw(game *g, WINDOW* w);
|
||||
void draw(game *g, WINDOW* w, const point center);
|
||||
void debug();
|
||||
void drawsq(WINDOW* w, player &u, int x, int y, bool invert, bool show_items);
|
||||
void drawsq(WINDOW* w, player &u, const int x, const int y, const bool invert, const bool show_items,
|
||||
const int view_center_x = -1, const int view_center_y = -1,
|
||||
const bool low_light = false, const bool bright_level = false);
|
||||
|
||||
// File I/O
|
||||
void save(overmap *om, unsigned int turn, int x, int y);
|
||||
void load(game *g, int wx, int wy);
|
||||
void shift(game *g, int wx, int wy, int x, int y);
|
||||
virtual void save(overmap *om, unsigned const int turn, const int x, const int y, const int z);
|
||||
virtual void load(game *g, const int wx, const int wy, const int wz, const bool update_vehicles = true);
|
||||
void shift(game *g, const int wx, const int wy, const int wz, const int x, const int y);
|
||||
void spawn_monsters(game *g);
|
||||
void clear_spawns();
|
||||
void clear_traps();
|
||||
|
||||
// Movement and LOS
|
||||
int move_cost(int x, int y); // Cost to move through; 0 = impassible
|
||||
bool trans(int x, int y); // Transparent?
|
||||
int move_cost(const int x, const int y); // Cost to move through; 0 = impassible
|
||||
int move_cost_ter_only(const int x, const int y); // same as above, but don't take vehicles into account
|
||||
bool trans(const int x, const int y); // Transparent?
|
||||
// (Fx, Fy) sees (Tx, Ty), within a range of (range)?
|
||||
// tc indicates the Bresenham line used to connect the two points, and may
|
||||
// subsequently be used to form a path between them
|
||||
bool sees(int Fx, int Fy, int Tx, int Ty, int range, int &tc);
|
||||
//std::vector<point> route(int Fx, int Fy, int Tx, int Ty); // Best route
|
||||
bool sees(const int Fx, const int Fy, const int Tx, const int Ty,
|
||||
const int range, int &tc);
|
||||
// clear_path is the same idea, but uses cost_min <= move_cost <= cost_max
|
||||
bool clear_path(const int Fx, const int Fy, const int Tx, const int Ty,
|
||||
const int range, const int cost_min, const int cost_max, int &tc);
|
||||
// route() generates an A* best path; if bash is true, we can bash through doors
|
||||
std::vector<point> route(const int Fx, const int Fy, const int Tx, const int Ty,
|
||||
const bool bash = true);
|
||||
|
||||
// vehicles
|
||||
VehicleList get_vehicles();
|
||||
VehicleList get_vehicles(const int sx, const int sy, const int ex, const int ey);
|
||||
|
||||
// checks, if tile is occupied by vehicle and by which part
|
||||
vehicle* veh_at(const int x, const int y, int &part_num);
|
||||
vehicle* veh_at(const int x, const int y);// checks, if tile is occupied by vehicle
|
||||
// put player on vehicle at x,y
|
||||
void board_vehicle(game *g, int x, int y, player *p);
|
||||
void unboard_vehicle(game *g, const int x, const int y);//remove player from vehicle at x,y
|
||||
void update_vehicle_cache(vehicle *, const bool brand_new = false);
|
||||
void reset_vehicle_cache();
|
||||
void clear_vehicle_cache();
|
||||
void update_vehicle_list(const int to);
|
||||
|
||||
void destroy_vehicle (vehicle *veh);
|
||||
// Change vehicle coords and move vehicle's driver along.
|
||||
// Returns true, if there was a submap change.
|
||||
// If test is true, function only checks for submap change, no displacement
|
||||
// WARNING: not checking collisions!
|
||||
bool displace_vehicle (game *g, int &x, int &y, const int dx, const int dy, bool test);
|
||||
void vehmove(game* g); // Vehicle movement
|
||||
bool vehproceed(game* g);
|
||||
// move water under wheels. true if moved
|
||||
bool displace_water (const int x, const int y);
|
||||
|
||||
// Terrain
|
||||
ter_id& ter(int x, int y); // Terrain at coord (x, y); {x|y}=(0, SEE{X|Y}*3]
|
||||
std::string tername(int x, int y); // Name of terrain at (x, y)
|
||||
std::string features(int x, int y); // Words relevant to terrain (sharp, etc)
|
||||
bool has_flag(t_flag flag, int x, int y);
|
||||
bool is_destructable(int x, int y);
|
||||
ter_id ter(const int x, const int y) const; // Terrain at coord (x, y); {x|y}=(0, SEE{X|Y}*3]
|
||||
void ter_set(const int x, const int y, const ter_id new_terrain);
|
||||
bool is_indoor(const int x, const int y); // Check if current ter is indoors
|
||||
std::string tername(const int x, const int y); // Name of terrain at (x, y)
|
||||
std::string features(const int x, const int y); // Words relevant to terrain (sharp, etc)
|
||||
bool has_flag(const t_flag flag, const int x, const int y); // checks terrain and vehicles
|
||||
bool has_flag_ter_only(const t_flag flag, const int x, const int y); // only checks terrain
|
||||
bool is_destructable(const int x, const int y); // checks terrain and vehicles
|
||||
bool is_destructable_ter_only(const int x, const int y); // only checks terrain
|
||||
bool is_outside(const int x, const int y);
|
||||
bool flammable_items_at(const int x, const int y);
|
||||
bool moppable_items_at(const int x, const int y);
|
||||
point random_outdoor_tile();
|
||||
|
||||
bool close_door(int x, int y);
|
||||
bool open_door(int x, int y, bool inside);
|
||||
bool bash(int x, int y, int str, std::string &sound);
|
||||
void destroy(game *g, int x, int y, bool makesound);
|
||||
void shoot(game *g, int x, int y, int &dam, bool hit_items);
|
||||
void translate(const ter_id from, const ter_id to); // Change all instances of $from->$to
|
||||
bool close_door(const int x, const int y, const bool inside);
|
||||
bool open_door(const int x, const int y, const bool inside);
|
||||
// bash: if res pointer is supplied, res will contain absorbed impact or -1
|
||||
bool bash(const int x, const int y, const int str, std::string &sound, int *res = 0);
|
||||
void destroy(game *g, const int x, const int y, const bool makesound);
|
||||
void shoot(game *g, const int x, const int y, int &dam, const bool hit_items, const unsigned flags);
|
||||
bool hit_with_acid(game *g, const int x, const int y);
|
||||
void marlossify(const int x, const int y);
|
||||
bool has_adjacent_furniture(const int x, const int y);
|
||||
void mop_spills(const int x, const int y);
|
||||
|
||||
// Radiation
|
||||
int& radiation(int x, int y); // Amount of radiation at (x, y);
|
||||
int& radiation(const int x, const int y); // Amount of radiation at (x, y);
|
||||
|
||||
// Items
|
||||
std::vector<item>& i_at(int x, int y);
|
||||
item water_from(int x, int y);
|
||||
void i_clear(int x, int y);
|
||||
void i_rem(int x, int y, int index);
|
||||
point find_item(item *it);
|
||||
void add_item(int x, int y, itype* type, int birthday);
|
||||
void add_item(int x, int y, item new_item);
|
||||
item water_from(const int x, const int y);
|
||||
void i_clear(const int x, const int y);
|
||||
void i_rem(const int x, const int y, const int index);
|
||||
point find_item(const item *it);
|
||||
void spawn_item(const int x, const int y, itype* type, int birthday, int quantity = 0, int charges = 0);
|
||||
void add_item(const int x, const int y, item new_item);
|
||||
void process_active_items(game *g);
|
||||
void process_active_items_in_submap(game *g, const int nonant);
|
||||
void process_vehicles(game *g);
|
||||
|
||||
void use_amount(const point origin, const int range, const itype_id type, const int amount,
|
||||
const bool use_container = false);
|
||||
void use_charges(const point origin, const int range, const itype_id type, const int amount);
|
||||
|
||||
// Traps
|
||||
trap_id& tr_at(int x, int y);
|
||||
void add_trap(int x, int y, trap_id t);
|
||||
void disarm_trap( game *g, int x, int y);
|
||||
trap_id& tr_at(const int x, const int y);
|
||||
void add_trap(const int x, const int y, const trap_id t);
|
||||
void disarm_trap( game *g, const int x, const int y);
|
||||
|
||||
// Fields
|
||||
field& field_at(int x, int y);
|
||||
bool add_field(game *g, int x, int y, field_id t, unsigned char density);
|
||||
bool process_fields(game *g);
|
||||
void step_in_field(int x, int y, game *g);
|
||||
void mon_in_field(int x, int y, game *g, monster *z);
|
||||
// mapgen.h functions
|
||||
void place_items(items_location loc, int chance, int x1, int y1,
|
||||
int x2, int y2, bool ongrass, int turn);
|
||||
void make_all_items_owned();
|
||||
void add_spawn(mon_id type, int count, int x, int y);
|
||||
|
||||
private:
|
||||
void saven(overmap *om, unsigned int turn, int x, int y, int gridx, int gridy);
|
||||
bool loadn(game *g, int x, int y, int gridx, int gridy);
|
||||
void draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
|
||||
oter_id t_south, oter_id t_west, oter_id t_above, int turn);
|
||||
void rotate(int turns);// Rotates the current map 90*turns degress clockwise
|
||||
// Useful for houses, shops, etc
|
||||
field& field_at(const int x, const int y);
|
||||
bool add_field(game *g, const int x, const int y, const field_id t, const unsigned char density);
|
||||
void remove_field(const int x, const int y);
|
||||
bool process_fields(game *g); // See fields.cpp
|
||||
bool process_fields_in_submap(game *g, const int gridn); // See fields.cpp
|
||||
void step_in_field(const int x, const int y, game *g); // See fields.cpp
|
||||
void mon_in_field(const int x, const int y, game *g, monster *z); // See fields.cpp
|
||||
|
||||
// Computers
|
||||
computer* computer_at(const int x, const int y);
|
||||
|
||||
// Camps
|
||||
bool allow_camp(const int x, const int y, const int radius = CAMPCHECK);
|
||||
basecamp* camp_at(const int x, const int y, const int radius = CAMPSIZE);
|
||||
void add_camp(const std::string& name, const int x, const int y);
|
||||
|
||||
// Graffiti
|
||||
graffiti graffiti_at(int x, int y);
|
||||
bool add_graffiti(game *g, int x, int y, std::string contents);
|
||||
|
||||
// mapgen.cpp functions
|
||||
void generate(game *g, overmap *om, const int x, const int y, const int z, const int turn);
|
||||
void post_process(game *g, unsigned zones);
|
||||
void place_spawns(game *g, std::string group, const int chance,
|
||||
const int x1, const int y1, const int x2, const int y2, const float density);
|
||||
void place_items(items_location loc, const int chance, const int x1, const int y1,
|
||||
const int x2, const int y2, bool ongrass, const int turn);
|
||||
// put_items_from puts exactly num items, based on chances
|
||||
void put_items_from(items_location loc, const int num, const int x, const int y, const int turn = 0);
|
||||
void add_spawn(mon_id type, const int count, const int x, const int y, bool friendly = false,
|
||||
const int faction_id = -1, const int mission_id = -1,
|
||||
std::string name = "NONE");
|
||||
void add_spawn(monster *mon);
|
||||
void create_anomaly(const int cx, const int cy, artifact_natural_property prop);
|
||||
vehicle *add_vehicle(game *g, vhtype_id type, const int x, const int y, const int dir);
|
||||
computer* add_computer(const int x, const int y, std::string name, const int security);
|
||||
float light_transparency(const int x, const int y) const;
|
||||
void build_map_cache(game *g);
|
||||
lit_level light_at(int dx, int dy); // Assumes 0,0 is light map center
|
||||
float ambient_light_at(int dx, int dy); // Raw values for tilesets
|
||||
bool pl_sees(int fx, int fy, int tx, int ty, int max_range);
|
||||
|
||||
std::map<std::string, itype*>* itypes;
|
||||
std::set<vehicle*> vehicle_list;
|
||||
std::map< std::pair<int,int>, std::pair<vehicle*,int> > veh_cached_parts;
|
||||
bool veh_exists_at [SEEX * MAPSIZE][SEEY * MAPSIZE];
|
||||
|
||||
protected:
|
||||
void saven(overmap *om, unsigned const int turn, const int x, const int y, const int z,
|
||||
const int gridx, const int gridy);
|
||||
bool loadn(game *g, const int x, const int y, const int z, const int gridx, const int gridy,
|
||||
const bool update_vehicles = true);
|
||||
void copy_grid(const int to, const int from);
|
||||
void draw_map(const oter_id terrain_type, const oter_id t_north, const oter_id t_east,
|
||||
const oter_id t_south, const oter_id t_west, const oter_id t_above, const int turn,
|
||||
game *g, const float density);
|
||||
void add_extra(map_extra type, game *g);
|
||||
void rotate(const int turns);// Rotates the current map 90*turns degress clockwise
|
||||
// Useful for houses, shops, etc
|
||||
void build_transparency_cache();
|
||||
void build_outside_cache(const game *g);
|
||||
void generate_lightmap(game *g);
|
||||
void build_seen_cache(game *g);
|
||||
|
||||
bool inbounds(const int x, const int y);
|
||||
int my_MAPSIZE;
|
||||
virtual bool is_tiny() { return false; };
|
||||
|
||||
submap grid[9];
|
||||
std::vector<item> nulitems; // Returned when &i_at() is asked for an OOB value
|
||||
ter_id nulter; // Returned when &ter() is asked for an OOB value
|
||||
trap_id nultrap; // Returned when &tr_at() is asked for an OOB value
|
||||
field nulfield; // Returned when &field_at() is asked for an OOB value
|
||||
vehicle nulveh; // Returned when &veh_at() is asked for an OOB value
|
||||
int nulrad; // OOB &radiation()
|
||||
|
||||
std::vector <itype*> *itypes;
|
||||
std::vector <trap*> *traps;
|
||||
std::vector <itype_id> (*mapitems)[num_itloc];
|
||||
|
||||
bool veh_in_active_range;
|
||||
|
||||
private:
|
||||
long determine_wall_corner(const int x, const int y, const long orig_sym);
|
||||
void cache_seen(const int fx, const int fy, const int tx, const int ty, const int max_range);
|
||||
void apply_light_source(int x, int y, float luminance);
|
||||
void apply_light_arc(int x, int y, int angle, float luminance);
|
||||
void apply_light_ray(bool lit[MAPSIZE*SEEX][MAPSIZE*SEEY],
|
||||
int sx, int sy, int ex, int ey, float luminance);
|
||||
|
||||
float lm[MAPSIZE*SEEX][MAPSIZE*SEEY];
|
||||
float sm[MAPSIZE*SEEX][MAPSIZE*SEEY];
|
||||
bool outside_cache[MAPSIZE*SEEX][MAPSIZE*SEEY];
|
||||
float transparency_cache[MAPSIZE*SEEX][MAPSIZE*SEEY];
|
||||
bool seen_cache[MAPSIZE*SEEX][MAPSIZE*SEEY];
|
||||
submap* grid[MAPSIZE * MAPSIZE];
|
||||
};
|
||||
|
||||
class tinymap : public map
|
||||
{
|
||||
public:
|
||||
tinymap();
|
||||
tinymap(std::map<std::string, itype*> *itptr, std::vector<itype_id> (*miptr)[num_itloc],
|
||||
std::vector<trap*> *trptr);
|
||||
~tinymap();
|
||||
|
||||
protected:
|
||||
virtual bool is_tiny() { return true; };
|
||||
|
||||
private:
|
||||
submap* grid[4];
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user