Compare commits
780 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 | |||
| 536f15a8d9 | |||
| 48b36b1b6f | |||
| a4f0094008 | |||
| eea320f75c | |||
| 3e91b801e4 | |||
| f421f8d994 | |||
| 3670e2fc1b | |||
| da15dc330a | |||
| 8735b7219a | |||
| c6938f1062 | |||
| 381cd945f1 | |||
| ff7330774d | |||
| ad458cc8f5 | |||
| 5cd5b06e85 | |||
| f4db1041e4 |
+18
-3
@@ -7,15 +7,14 @@
|
||||
<Option compiler="gcc" />
|
||||
<Build>
|
||||
<Target title="Release">
|
||||
<Option output="bin/Release/Cataclysm" prefix_auto="1" extension_auto="1" />
|
||||
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-O2" />
|
||||
<Add option="-Os" />
|
||||
</Compiler>
|
||||
<Linker>
|
||||
<Add option="-s" />
|
||||
<Add option="-Wl,-stack,12000000,-subsystem,windows" />
|
||||
<Add option="-static -lgdi32" />
|
||||
</Linker>
|
||||
@@ -27,6 +26,8 @@
|
||||
<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" />
|
||||
@@ -64,6 +65,8 @@
|
||||
<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" />
|
||||
@@ -82,6 +85,7 @@
|
||||
<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" />
|
||||
@@ -136,6 +140,8 @@
|
||||
<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" />
|
||||
@@ -171,6 +177,15 @@
|
||||
<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 @@
|
||||
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.
|
||||
@@ -21,7 +21,9 @@
|
||||
# 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
|
||||
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
|
||||
#PROFILE = -pg
|
||||
#OTHERS = -O3
|
||||
@@ -42,7 +44,7 @@ DEBUG = -g
|
||||
#DEFINES += -DDEBUG_ENABLE_MAP_GEN
|
||||
#DEFINES += -DDEBUG_ENABLE_GAME
|
||||
|
||||
VERSION = 0.1
|
||||
VERSION = 0.3
|
||||
|
||||
TARGET = cataclysm
|
||||
W32TARGET = cataclysm.exe
|
||||
@@ -54,6 +56,7 @@ DDIR = .deps
|
||||
|
||||
OS = $(shell uname -o)
|
||||
CXX = $(CROSS)g++
|
||||
LD = $(CROSS)g++
|
||||
|
||||
# enable optimizations. slow to build
|
||||
ifdef RELEASE
|
||||
@@ -105,6 +108,7 @@ ifeq ($(CROSS), i686-pc-mingw32-)
|
||||
endif
|
||||
|
||||
SOURCES = $(wildcard *.cpp)
|
||||
HEADERS = $(wildcard *.h)
|
||||
_OBJS = $(SOURCES:.cpp=.o)
|
||||
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
|
||||
|
||||
@@ -112,7 +116,7 @@ all: $(TARGET)
|
||||
@
|
||||
|
||||
$(TARGET): $(ODIR) $(DDIR) $(OBJS)
|
||||
$(CXX) $(W32FLAGS) -o $(TARGET) $(DEFINES) $(CXXFLAGS) \
|
||||
$(LD) $(W32FLAGS) -o $(TARGET) $(DEFINES) $(CXXFLAGS) \
|
||||
$(OBJS) $(LDFLAGS)
|
||||
|
||||
$(ODIR):
|
||||
@@ -139,14 +143,19 @@ $(BINDIST): $(TARGET) $(BINDIST_EXTRAS)
|
||||
|
||||
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
|
||||
.PHONY: tests check ctags etags
|
||||
|
||||
-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)
|
||||
-include ${OBJS:.o=.d}
|
||||
|
||||
|
||||
@@ -39,7 +39,7 @@ 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 fivedozenwhales@gmail.com. You can also submit problem reports and
|
||||
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
|
||||
|
||||
+12
@@ -193,6 +193,10 @@ std::string action_ident(action_id act)
|
||||
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:
|
||||
@@ -217,6 +221,8 @@ std::string action_ident(action_id act)
|
||||
return "missions";
|
||||
case ACTION_FACTIONS:
|
||||
return "factions";
|
||||
case ACTION_KILLS:
|
||||
return "kills";
|
||||
case ACTION_MORALE:
|
||||
return "morale";
|
||||
case ACTION_MESSAGES:
|
||||
@@ -351,6 +357,10 @@ std::string action_name(action_id act)
|
||||
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:
|
||||
@@ -375,6 +385,8 @@ std::string action_name(action_id act)
|
||||
return "View Missions";
|
||||
case ACTION_FACTIONS:
|
||||
return "View Factions";
|
||||
case ACTION_KILLS:
|
||||
return "View Kills";
|
||||
case ACTION_MORALE:
|
||||
return "View Morale";
|
||||
case ACTION_MESSAGES:
|
||||
|
||||
@@ -60,6 +60,8 @@ ACTION_BIONICS,
|
||||
// Long-term / special actions
|
||||
ACTION_WAIT,
|
||||
ACTION_CRAFT,
|
||||
ACTION_RECRAFT,
|
||||
ACTION_LONGCRAFT,
|
||||
ACTION_CONSTRUCT,
|
||||
ACTION_DISASSEMBLE,
|
||||
ACTION_SLEEP,
|
||||
@@ -72,6 +74,7 @@ ACTION_QUIT,
|
||||
ACTION_PL_INFO,
|
||||
ACTION_MAP,
|
||||
ACTION_MISSIONS,
|
||||
ACTION_KILLS,
|
||||
ACTION_FACTIONS,
|
||||
ACTION_MORALE,
|
||||
ACTION_MESSAGES,
|
||||
|
||||
+3
-3
@@ -141,7 +141,7 @@ It may have unknown powers; use 'a' to activate them.";
|
||||
art->charge_type = ARTC_NULL; // 1 in 8 chance that it can't recharge!
|
||||
|
||||
art->id = itypes.size();
|
||||
itypes.push_back(art);
|
||||
itypes[art->name]=art;
|
||||
return art;
|
||||
|
||||
} else { // Generate an armor artifact
|
||||
@@ -245,7 +245,7 @@ It may have unknown powers; use 'a' to activate them.";
|
||||
}
|
||||
|
||||
art->id = itypes.size();
|
||||
itypes.push_back(art);
|
||||
itypes[art->name]=art;
|
||||
return art;
|
||||
}
|
||||
}
|
||||
@@ -359,7 +359,7 @@ itype* game::new_natural_artifact(artifact_natural_property prop)
|
||||
}
|
||||
|
||||
art->id = itypes.size();
|
||||
itypes.push_back(art);
|
||||
itypes[art->name]=art;
|
||||
return art;
|
||||
}
|
||||
|
||||
|
||||
@@ -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
|
||||
+528
-126
@@ -2,14 +2,144 @@
|
||||
#include "game.h"
|
||||
#include "rng.h"
|
||||
#include "input.h"
|
||||
#include "keypress.h"
|
||||
#include "item.h"
|
||||
#include "bionics.h"
|
||||
#include "line.h"
|
||||
|
||||
#define BATTERY_AMOUNT 4 // How much batteries increase your power
|
||||
|
||||
std::map<bionic_id, bionic_data*> bionics;
|
||||
std::vector<bionic_id> faulty_bionics;
|
||||
std::vector<bionic_id> power_source_bionics;
|
||||
std::vector<bionic_id> unpowered_bionics;
|
||||
|
||||
void bionics_install_failure(game *g, player *u, int success);
|
||||
|
||||
bionic_data::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){
|
||||
name = new_name;
|
||||
power_source = new_power_source;
|
||||
activated = new_activated;
|
||||
power_cost = new_power_cost;
|
||||
charge_time = new_charge_time;
|
||||
description = new_description;
|
||||
}
|
||||
|
||||
|
||||
void player::power_bionics(game *g)
|
||||
{
|
||||
WINDOW* wBio = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
WINDOW* w_description = newwin(3, 78, 21 + getbegy(wBio), 1 + getbegx(wBio));
|
||||
|
||||
werase(wBio);
|
||||
wborder(wBio, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
|
||||
std::vector <bionic> passive;
|
||||
std::vector <bionic> active;
|
||||
mvwprintz(wBio, 1, 1, c_blue, "BIONICS -");
|
||||
mvwprintz(wBio, 1, 11, c_white, "Activating. Press '!' to examine your implants.");
|
||||
|
||||
for (int i = 1; i < 79; i++) {
|
||||
mvwputch(wBio, 2, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(wBio, 20, i, c_ltgray, LINE_OXOX);
|
||||
}
|
||||
|
||||
mvwputch(wBio, 2, 0, c_ltgray, LINE_XXXO); // |-
|
||||
mvwputch(wBio, 2, 79, c_ltgray, LINE_XOXX); // -|
|
||||
|
||||
mvwputch(wBio, 20, 0, c_ltgray, LINE_XXXO); // |-
|
||||
mvwputch(wBio, 20, 79, c_ltgray, LINE_XOXX); // -|
|
||||
|
||||
for (int i = 0; i < my_bionics.size(); i++) {
|
||||
if ( bionics[my_bionics[i].id]->power_source ||
|
||||
!bionics[my_bionics[i].id]->activated )
|
||||
passive.push_back(my_bionics[i]);
|
||||
else
|
||||
active.push_back(my_bionics[i]);
|
||||
}
|
||||
nc_color type;
|
||||
if (passive.size() > 0) {
|
||||
mvwprintz(wBio, 3, 1, c_ltblue, "Passive:");
|
||||
for (int i = 0; i < passive.size(); i++) {
|
||||
if (bionics[passive[i].id]->power_source)
|
||||
type = c_ltcyan;
|
||||
else
|
||||
type = c_cyan;
|
||||
mvwputch(wBio, 4 + i, 1, type, passive[i].invlet);
|
||||
mvwprintz(wBio, 4 + i, 3, type, bionics[passive[i].id]->name.c_str());
|
||||
}
|
||||
}
|
||||
if (active.size() > 0) {
|
||||
mvwprintz(wBio, 3, 33, c_ltblue, "Active:");
|
||||
for (int i = 0; i < active.size(); i++) {
|
||||
if (active[i].powered)
|
||||
type = c_red;
|
||||
else
|
||||
type = c_ltred;
|
||||
mvwputch(wBio, 4 + i, 33, type, active[i].invlet);
|
||||
mvwprintz(wBio, 4 + i, 35, type,
|
||||
(active[i].powered ? "%s - ON" : "%s - %d PU / %d trns"),
|
||||
bionics[active[i].id]->name.c_str(),
|
||||
bionics[active[i].id]->power_cost,
|
||||
bionics[active[i].id]->charge_time);
|
||||
}
|
||||
}
|
||||
wrefresh(wBio);
|
||||
char ch;
|
||||
bool activating = true;
|
||||
bionic *tmp;
|
||||
int b;
|
||||
do {
|
||||
ch = getch();
|
||||
if (ch == '!') {
|
||||
activating = !activating;
|
||||
if (activating)
|
||||
mvwprintz(wBio, 1, 11, c_white, "Activating. Press '!' to examine your implants.");
|
||||
else
|
||||
mvwprintz(wBio, 1, 11, c_white, "Examining. Press '!' to activate your implants.");
|
||||
} else if (ch == ' ')
|
||||
ch = KEY_ESCAPE;
|
||||
else if (ch != KEY_ESCAPE) {
|
||||
for (int i = 0; i < my_bionics.size(); i++) {
|
||||
if (ch == my_bionics[i].invlet) {
|
||||
tmp = &my_bionics[i];
|
||||
b = i;
|
||||
ch = KEY_ESCAPE;
|
||||
}
|
||||
}
|
||||
if (ch == KEY_ESCAPE) {
|
||||
if (activating) {
|
||||
if (bionics[tmp->id]->activated) {
|
||||
itype_id weapon_id = weapon.type->id;
|
||||
if (tmp->powered) {
|
||||
tmp->powered = false;
|
||||
g->add_msg("%s powered off.", bionics[tmp->id]->name.c_str());
|
||||
} else if (power_level >= bionics[tmp->id]->power_cost ||
|
||||
(weapon_id == "bio_claws_weapon" && tmp->id == "bio_claws_weapon"))
|
||||
activate_bionic(b, g);
|
||||
} else
|
||||
mvwprintz(wBio, 21, 1, c_ltred, "\
|
||||
You can not activate %s! To read a description of \
|
||||
%s, press '!', then '%c'.", bionics[tmp->id]->name.c_str(),
|
||||
bionics[tmp->id]->name.c_str(), tmp->invlet);
|
||||
} else { // Describing bionics, not activating them!
|
||||
// Clear the lines first
|
||||
ch = 0;
|
||||
werase(w_description);
|
||||
mvwprintz(w_description, 0, 0, c_ltblue, bionics[tmp->id]->description.c_str());
|
||||
}
|
||||
}
|
||||
}
|
||||
wrefresh(w_description);
|
||||
wrefresh(wBio);
|
||||
} while (ch != KEY_ESCAPE);
|
||||
werase(wBio);
|
||||
wrefresh(wBio);
|
||||
delwin(wBio);
|
||||
erase();
|
||||
}
|
||||
|
||||
// Why put this in a Big Switch? Why not let bionics have pointers to
|
||||
// functions, much like monsters and items?
|
||||
@@ -19,15 +149,15 @@ void bionics_install_failure(game *g, player *u, int success);
|
||||
void player::activate_bionic(int b, game *g)
|
||||
{
|
||||
bionic bio = my_bionics[b];
|
||||
int power_cost = bionics[bio.id].power_cost;
|
||||
if (weapon.type->id == itm_bio_claws && bio.id == bio_claws)
|
||||
int power_cost = bionics[bio.id]->power_cost;
|
||||
if (weapon.type->id == "bio_claws_weapon" && bio.id == "bio_claws_weapon")
|
||||
power_cost = 0;
|
||||
if (power_level < power_cost) {
|
||||
if (my_bionics[b].powered) {
|
||||
g->add_msg("Your %s powers down.", bionics[bio.id].name.c_str());
|
||||
g->add_msg("Your %s powers down.", bionics[bio.id]->name.c_str());
|
||||
my_bionics[b].powered = false;
|
||||
} else
|
||||
g->add_msg("You cannot power your %s", bionics[bio.id].name.c_str());
|
||||
g->add_msg("You cannot power your %s", bionics[bio.id]->name.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -36,9 +166,9 @@ void player::activate_bionic(int b, game *g)
|
||||
my_bionics[b].charge--;
|
||||
} else {
|
||||
// Not-on units, or those with zero charge, have to pay the power cost
|
||||
if (bionics[bio.id].charge_time > 0) {
|
||||
if (bionics[bio.id]->charge_time > 0) {
|
||||
my_bionics[b].powered = true;
|
||||
my_bionics[b].charge = bionics[bio.id].charge_time;
|
||||
my_bionics[b].charge = bionics[bio.id]->charge_time;
|
||||
}
|
||||
power_level -= power_cost;
|
||||
}
|
||||
@@ -52,20 +182,14 @@ void player::activate_bionic(int b, game *g)
|
||||
InputEvent input;
|
||||
item tmp_item;
|
||||
|
||||
switch (bio.id) {
|
||||
|
||||
case bio_painkiller:
|
||||
if(bio.id == "bio_painkiller"){
|
||||
pkill += 6;
|
||||
pain -= 2;
|
||||
if (pkill > pain)
|
||||
pkill = pain;
|
||||
break;
|
||||
|
||||
case bio_nanobots:
|
||||
} else if (bio.id == "bio_nanobots"){
|
||||
healall(4);
|
||||
break;
|
||||
|
||||
case bio_resonator:
|
||||
} else if (bio.id == "bio_resonator"){
|
||||
g->sound(posx, posy, 30, "VRRRRMP!");
|
||||
for (int i = posx - 1; i <= posx + 1; i++) {
|
||||
for (int j = posy - 1; j <= posy + 1; j++) {
|
||||
@@ -73,12 +197,10 @@ void player::activate_bionic(int b, game *g)
|
||||
g->m.bash(i, j, 40, junk); // Multibash effect, so that doors &c will fall
|
||||
g->m.bash(i, j, 40, junk);
|
||||
if (g->m.is_destructable(i, j) && rng(1, 10) >= 4)
|
||||
g->m.ter(i, j) = t_rubble;
|
||||
g->m.ter_set(i, j, t_rubble);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case bio_time_freeze:
|
||||
} else if (bio.id == "bio_time_freeze"){
|
||||
moves += 100 * power_level;
|
||||
power_level = 0;
|
||||
g->add_msg("Your speed suddenly increases!");
|
||||
@@ -92,16 +214,13 @@ void player::activate_bionic(int b, game *g)
|
||||
}
|
||||
if (one_in(5))
|
||||
add_disease(DI_TELEGLOW, rng(50, 400), g);
|
||||
break;
|
||||
|
||||
case bio_teleport:
|
||||
} else if (bio.id == "bio_teleport"){
|
||||
g->teleport();
|
||||
add_disease(DI_TELEGLOW, 300, g);
|
||||
break;
|
||||
|
||||
}
|
||||
// TODO: More stuff here (and bio_blood_filter)
|
||||
case bio_blood_anal:
|
||||
w = newwin(20, 40, 3, 10);
|
||||
else if(bio.id == "bio_blood_anal"){
|
||||
w = newwin(20, 40, 3 + ((TERMY > 25) ? (TERMY-25)/2 : 0), 10+((TERMX > 80) ? (TERMX-80)/2 : 0));
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
if (has_disease(DI_FUNGUS))
|
||||
@@ -146,9 +265,7 @@ void player::activate_bionic(int b, game *g)
|
||||
refresh();
|
||||
getch();
|
||||
delwin(w);
|
||||
break;
|
||||
|
||||
case bio_blood_filter:
|
||||
} else if(bio.id == "bio_blood_filter"){
|
||||
rem_disease(DI_FUNGUS);
|
||||
rem_disease(DI_POISON);
|
||||
rem_disease(DI_PKILL1);
|
||||
@@ -161,11 +278,9 @@ void player::activate_bionic(int b, game *g)
|
||||
rem_disease(DI_TOOK_PROZAC);
|
||||
rem_disease(DI_TOOK_FLUMED);
|
||||
rem_disease(DI_ADRENALINE);
|
||||
break;
|
||||
|
||||
case bio_evap:
|
||||
} else if(bio.id == "bio_evap"){
|
||||
if (query_yn("Drink directly? Otherwise you will need a container.")) {
|
||||
tmp_item = item(g->itypes[itm_water], 0);
|
||||
tmp_item = item(g->itypes["water_clean"], 0);
|
||||
thirst -= 50;
|
||||
if (has_trait(PF_GOURMAND) && thirst < -60) {
|
||||
g->add_msg("You can't finish it all!");
|
||||
@@ -178,128 +293,112 @@ void player::activate_bionic(int b, game *g)
|
||||
t = g->inv("Choose a container:");
|
||||
if (i_at(t).type == 0) {
|
||||
g->add_msg("You don't have that item!");
|
||||
power_level += bionics[bio_evap].power_cost;
|
||||
power_level += bionics["bio_evap"]->power_cost;
|
||||
} else if (!i_at(t).is_container()) {
|
||||
g->add_msg("That %s isn't a container!", i_at(t).tname().c_str());
|
||||
power_level += bionics[bio_evap].power_cost;
|
||||
power_level += bionics["bio_evap"]->power_cost;
|
||||
} else {
|
||||
it_container *cont = dynamic_cast<it_container*>(i_at(t).type);
|
||||
if (i_at(t).volume_contained() + 1 > cont->contains) {
|
||||
g->add_msg("There's no space left in your %s.", i_at(t).tname().c_str());
|
||||
power_level += bionics[bio_evap].power_cost;
|
||||
power_level += bionics["bio_evap"]->power_cost;
|
||||
} else if (!(cont->flags & con_wtight)) {
|
||||
g->add_msg("Your %s isn't watertight!", i_at(t).tname().c_str());
|
||||
power_level += bionics[bio_evap].power_cost;
|
||||
power_level += bionics["bio_evap"]->power_cost;
|
||||
} else {
|
||||
g->add_msg("You pour water into your %s.", i_at(t).tname().c_str());
|
||||
i_at(t).put_in(item(g->itypes[itm_water], 0));
|
||||
i_at(t).put_in(item(g->itypes["water_clean"], 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case bio_lighter:
|
||||
} else if(bio.id == "bio_lighter"){
|
||||
g->draw();
|
||||
mvprintw(0, 0, "Torch in which direction?");
|
||||
input = get_input();
|
||||
get_direction(dirx, diry, input);
|
||||
if (dirx == -2) {
|
||||
g->add_msg("Invalid direction.");
|
||||
power_level += bionics[bio_lighter].power_cost;
|
||||
power_level += bionics["bio_lighter"]->power_cost;
|
||||
return;
|
||||
}
|
||||
dirx += posx;
|
||||
diry += posy;
|
||||
if (!g->m.add_field(g, dirx, diry, fd_fire, 1)) // Unsuccessful.
|
||||
g->add_msg("You can't light a fire there.");
|
||||
break;
|
||||
|
||||
case bio_claws:
|
||||
if (weapon.type->id == itm_bio_claws) {
|
||||
} else if(bio.id == "bio_claws"){
|
||||
if (weapon.type->id == "bio_claws_weapon") {
|
||||
g->add_msg("You withdraw your claws.");
|
||||
weapon = ret_null;
|
||||
} else if (weapon.type->id != 0) {
|
||||
} else if(weapon.type->id != "null"){
|
||||
g->add_msg("Your claws extend, forcing you to drop your %s.",
|
||||
weapon.tname().c_str());
|
||||
g->m.add_item(posx, posy, weapon);
|
||||
weapon = item(g->itypes[itm_bio_claws], 0);
|
||||
weapon = item(g->itypes["bio_claws_weapon"], 0);
|
||||
weapon.invlet = '#';
|
||||
} else {
|
||||
g->add_msg("Your claws extend!");
|
||||
weapon = item(g->itypes[itm_bio_claws], 0);
|
||||
weapon = item(g->itypes["bio_claws_weapon"], 0);
|
||||
weapon.invlet = '#';
|
||||
}
|
||||
break;
|
||||
|
||||
case bio_blaster:
|
||||
} else if(bio.id == "bio_blaster"){
|
||||
tmp_item = weapon;
|
||||
weapon = item(g->itypes[itm_bio_blaster], 0);
|
||||
weapon.curammo = dynamic_cast<it_ammo*>(g->itypes[itm_bio_fusion]);
|
||||
weapon = item(g->itypes["bio_blaster_gun"], 0);
|
||||
weapon.curammo = dynamic_cast<it_ammo*>(g->itypes["bio_fusion_ammo"]);
|
||||
weapon.charges = 1;
|
||||
g->refresh_all();
|
||||
g->plfire(false);
|
||||
weapon = tmp_item;
|
||||
break;
|
||||
|
||||
case bio_laser:
|
||||
} else if (bio.id == "bio_laser"){
|
||||
tmp_item = weapon;
|
||||
weapon = item(g->itypes[itm_v29], 0);
|
||||
weapon.curammo = dynamic_cast<it_ammo*>(g->itypes[itm_laser_pack]);
|
||||
weapon = item(g->itypes["v29"], 0);
|
||||
weapon.curammo = dynamic_cast<it_ammo*>(g->itypes["laser_pack"]);
|
||||
weapon.charges = 1;
|
||||
g->refresh_all();
|
||||
g->plfire(false);
|
||||
weapon = tmp_item;
|
||||
break;
|
||||
|
||||
case bio_emp:
|
||||
} else if (bio.id == "bio_emp"){
|
||||
g->draw();
|
||||
mvprintw(0, 0, "Fire EMP in which direction?");
|
||||
input = get_input();
|
||||
get_direction(dirx, diry, input);
|
||||
if (dirx == -2) {
|
||||
g->add_msg("Invalid direction.");
|
||||
power_level += bionics[bio_emp].power_cost;
|
||||
power_level += bionics["bio_emp"]->power_cost;
|
||||
return;
|
||||
}
|
||||
dirx += posx;
|
||||
diry += posy;
|
||||
g->emp_blast(dirx, diry);
|
||||
break;
|
||||
|
||||
case bio_hydraulics:
|
||||
} else if (bio.id == "bio_hydraulics"){
|
||||
g->add_msg("Your muscles hiss as hydraulic strength fills them!");
|
||||
break;
|
||||
|
||||
case bio_water_extractor:
|
||||
} else if (bio.id == "bio_water_extractor"){
|
||||
for (int i = 0; i < g->m.i_at(posx, posy).size(); i++) {
|
||||
item tmp = g->m.i_at(posx, posy)[i];
|
||||
if (tmp.type->id == itm_corpse && query_yn("Extract water from the %s",
|
||||
if (tmp.type->id == "corpse" && query_yn("Extract water from the %s",
|
||||
tmp.tname().c_str())) {
|
||||
i = g->m.i_at(posx, posy).size() + 1; // Loop is finished
|
||||
t = g->inv("Choose a container:");
|
||||
if (i_at(t).type == 0) {
|
||||
g->add_msg("You don't have that item!");
|
||||
power_level += bionics[bio_water_extractor].power_cost;
|
||||
power_level += bionics["bio_water_extractor"]->power_cost;
|
||||
} else if (!i_at(t).is_container()) {
|
||||
g->add_msg("That %s isn't a container!", i_at(t).tname().c_str());
|
||||
power_level += bionics[bio_water_extractor].power_cost;
|
||||
power_level += bionics["bio_water_extractor"]->power_cost;
|
||||
} else {
|
||||
it_container *cont = dynamic_cast<it_container*>(i_at(t).type);
|
||||
if (i_at(t).volume_contained() + 1 > cont->contains) {
|
||||
g->add_msg("There's no space left in your %s.", i_at(t).tname().c_str());
|
||||
power_level += bionics[bio_water_extractor].power_cost;
|
||||
power_level += bionics["bio_water_extractor"]->power_cost;
|
||||
} else {
|
||||
g->add_msg("You pour water into your %s.", i_at(t).tname().c_str());
|
||||
i_at(t).put_in(item(g->itypes[itm_water], 0));
|
||||
i_at(t).put_in(item(g->itypes["water"], 0));
|
||||
}
|
||||
}
|
||||
}
|
||||
if (i == g->m.i_at(posx, posy).size() - 1) // We never chose a corpse
|
||||
power_level += bionics[bio_water_extractor].power_cost;
|
||||
power_level += bionics["bio_water_extractor"]->power_cost;
|
||||
}
|
||||
break;
|
||||
|
||||
case bio_magnet:
|
||||
} else if(bio.id == "bio_magnet"){
|
||||
for (int i = posx - 10; i <= posx + 10; i++) {
|
||||
for (int j = posy - 10; j <= posy + 10; j++) {
|
||||
if (g->m.i_at(i, j).size() > 0) {
|
||||
@@ -335,16 +434,14 @@ void player::activate_bionic(int b, game *g)
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case bio_lockpick:
|
||||
} else if(bio.id == "bio_lockpick"){
|
||||
g->draw();
|
||||
mvprintw(0, 0, "Unlock in which direction?");
|
||||
input = get_input();
|
||||
get_direction(dirx, diry, input);
|
||||
if (dirx == -2) {
|
||||
g->add_msg("Invalid direction.");
|
||||
power_level += bionics[bio_lockpick].power_cost;
|
||||
power_level += bionics["bio_lockpick"]->power_cost;
|
||||
return;
|
||||
}
|
||||
dirx += posx;
|
||||
@@ -352,11 +449,9 @@ void player::activate_bionic(int b, game *g)
|
||||
if (g->m.ter(dirx, diry) == t_door_locked) {
|
||||
moves -= 40;
|
||||
g->add_msg("You unlock the door.");
|
||||
g->m.ter(dirx, diry) = t_door_c;
|
||||
g->m.ter_set(dirx, diry, t_door_c);
|
||||
} else
|
||||
g->add_msg("You can't unlock that %s.", g->m.tername(dirx, diry).c_str());
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -367,44 +462,57 @@ bool player::install_bionics(game *g, it_bionic* type)
|
||||
return false;
|
||||
}
|
||||
std::string bio_name = type->name.substr(5); // Strip off "CBM: "
|
||||
WINDOW* w = newwin(25, 80, 0, 0);
|
||||
|
||||
WINDOW* w = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
WINDOW* w_description = newwin(3, 78, 21 + getbegy(w), 1 + getbegx(w));
|
||||
|
||||
werase(w);
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
|
||||
int pl_skill = int_cur +
|
||||
skillLevel("electronics").level() * 4 +
|
||||
skillLevel("firstaid").level() * 3 +
|
||||
skillLevel("mechanics").level() * 2;
|
||||
skillLevel("electronics") * 4 +
|
||||
skillLevel("firstaid") * 3 +
|
||||
skillLevel("mechanics") * 2;
|
||||
|
||||
int skint = int(pl_skill / 4);
|
||||
int skdec = int((pl_skill * 10) / 4) % 10;
|
||||
|
||||
// Header text
|
||||
mvwprintz(w, 0, 0, c_white, "Installing bionics:");
|
||||
mvwprintz(w, 0, 20, type->color, bio_name.c_str());
|
||||
mvwprintz(w, 1, 1, c_white, "Installing bionics:");
|
||||
mvwprintz(w, 1, 21, type->color, bio_name.c_str());
|
||||
|
||||
// Dividing bars
|
||||
for (int i = 0; i < 80; i++) {
|
||||
mvwputch(w, 1, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
|
||||
for (int i = 1; i < 79; i++) {
|
||||
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 20, i, c_ltgray, LINE_OXOX);
|
||||
}
|
||||
|
||||
mvwputch(w, 2, 0, c_ltgray, LINE_XXXO); // |-
|
||||
mvwputch(w, 2, 79, c_ltgray, LINE_XOXX); // -|
|
||||
|
||||
mvwputch(w, 20, 0, c_ltgray, LINE_XXXO); // |-
|
||||
mvwputch(w, 20, 79, c_ltgray, LINE_XOXX); // -|
|
||||
|
||||
// Init the list of bionics
|
||||
for (int i = 1; i < type->options.size(); i++) {
|
||||
bionic_id id = type->options[i];
|
||||
mvwprintz(w, i + 2, 0, (has_bionic(id) ? c_ltred : c_ltblue),
|
||||
bionics[id].name.c_str());
|
||||
mvwprintz(w, i + 3, 1, (has_bionic(id) ? c_ltred : c_ltblue),
|
||||
bionics[id]->name.c_str());
|
||||
}
|
||||
// Helper text
|
||||
mvwprintz(w, 2, 40, c_white, "Difficulty of this module: %d",
|
||||
mvwprintz(w, 3, 39, c_white, "Difficulty of this module: %d",
|
||||
type->difficulty);
|
||||
mvwprintz(w, 3, 40, c_white, "Your installation skill: %d.%d",
|
||||
mvwprintz(w, 4, 39, c_white, "Your installation skill: %d.%d",
|
||||
skint, skdec);
|
||||
mvwprintz(w, 4, 40, c_white, "Installation requires high intelligence,");
|
||||
mvwprintz(w, 5, 40, c_white, "and skill in electronics, first aid, and");
|
||||
mvwprintz(w, 6, 40, c_white, "mechanics (in that order of importance).");
|
||||
mvwprintz(w, 5, 39, c_white, "Installation requires high intelligence,");
|
||||
mvwprintz(w, 6, 39, c_white, "and skill in electronics, first aid, and");
|
||||
mvwprintz(w, 7, 39, c_white, "mechanics (in that order of importance).");
|
||||
|
||||
int chance_of_success = int((100 * pl_skill) /
|
||||
(pl_skill + 4 * type->difficulty));
|
||||
|
||||
mvwprintz(w, 8, 40, c_white, "Chance of success:");
|
||||
mvwprintz(w, 9, 39, c_white, "Chance of success:");
|
||||
|
||||
nc_color col_suc;
|
||||
if (chance_of_success >= 95)
|
||||
@@ -418,20 +526,22 @@ bool player::install_bionics(game *g, it_bionic* type)
|
||||
else
|
||||
col_suc = c_red;
|
||||
|
||||
mvwprintz(w, 8, 59, col_suc, "%d%%%%", chance_of_success);
|
||||
mvwprintz(w, 9, 59, col_suc, "%d%%%%", chance_of_success);
|
||||
|
||||
mvwprintz(w, 10, 40, c_white, "Failure may result in crippling damage,");
|
||||
mvwprintz(w, 11, 40, c_white, "loss of existing bionics, genetic damage");
|
||||
mvwprintz(w, 12, 40, c_white, "or faulty installation.");
|
||||
mvwprintz(w, 11, 39, c_white, "Failure may result in crippling damage,");
|
||||
mvwprintz(w, 12, 39, c_white, "loss of existing bionics, genetic damage");
|
||||
mvwprintz(w, 13, 39, c_white, "or faulty installation.");
|
||||
wrefresh(w);
|
||||
|
||||
if (type->id == itm_bionics_battery) { // No selection list; just confirm
|
||||
mvwprintz(w, 2, 0, h_ltblue, "Battery Level +%d", BATTERY_AMOUNT);
|
||||
mvwprintz(w, 22, 0, c_ltblue, "\
|
||||
Installing this bionic will increase your total battery capacity by %d.\n\
|
||||
Batteries are necessary for most bionics to function. They also require a\n\
|
||||
if (type->id == "bio_power_storage") { // No selection list; just confirm
|
||||
mvwprintz(w, 3, 1, h_ltblue, "Power Storage +%d", BATTERY_AMOUNT);
|
||||
mvwprintz(w_description, 0, 0, c_ltblue, "\
|
||||
Installing this bionic will increase your total power storage by %d.\n\
|
||||
Power is necessary for most bionics to function. You also require a\n\
|
||||
charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
|
||||
|
||||
InputEvent input;
|
||||
wrefresh(w_description);
|
||||
wrefresh(w);
|
||||
do
|
||||
input = get_input();
|
||||
@@ -463,24 +573,22 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
|
||||
do {
|
||||
|
||||
bionic_id id = type->options[selection];
|
||||
mvwprintz(w, 2 + selection, 0, (has_bionic(id) ? h_ltred : h_ltblue),
|
||||
bionics[id].name.c_str());
|
||||
mvwprintz(w, 3 + selection, 1, (has_bionic(id) ? h_ltred : h_ltblue),
|
||||
bionics[id]->name.c_str());
|
||||
|
||||
// Clear the bottom three lines...
|
||||
mvwprintz(w, 22, 0, c_ltgray, "\
|
||||
\n\
|
||||
\n\
|
||||
");
|
||||
werase(w_description);
|
||||
// ...and then fill them with the description of the selected bionic
|
||||
mvwprintz(w, 22, 0, c_ltblue, bionics[id].description.c_str());
|
||||
mvwprintz(w_description, 0, 0, c_ltblue, bionics[id]->description.c_str());
|
||||
|
||||
wrefresh(w_description);
|
||||
wrefresh(w);
|
||||
input = get_input();
|
||||
switch (input) {
|
||||
|
||||
case DirectionS:
|
||||
mvwprintz(w, 2 + selection, 0, (has_bionic(id) ? c_ltred : c_ltblue),
|
||||
bionics[id].name.c_str());
|
||||
bionics[id]->name.c_str());
|
||||
if (selection == type->options.size() - 1)
|
||||
selection = 0;
|
||||
else
|
||||
@@ -489,7 +597,7 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
|
||||
|
||||
case DirectionN:
|
||||
mvwprintz(w, 2 + selection, 0, (has_bionic(id) ? c_ltred : c_ltblue),
|
||||
bionics[id].name.c_str());
|
||||
bionics[id]->name.c_str());
|
||||
if (selection == 0)
|
||||
selection = type->options.size() - 1;
|
||||
else
|
||||
@@ -498,7 +606,7 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
|
||||
|
||||
}
|
||||
if (input == Confirm && has_bionic(id)) {
|
||||
popup("You already have a %s!", bionics[id].name.c_str());
|
||||
popup("You already have a %s!", bionics[id]->name.c_str());
|
||||
input = Nothing;
|
||||
}
|
||||
} while (input != Cancel && input != Confirm);
|
||||
@@ -510,7 +618,7 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
|
||||
bionic_id id = type->options[selection];
|
||||
int success = chance_of_success - rng(1, 100);
|
||||
if (success > 0) {
|
||||
g->add_msg("Successfully installed %s.", bionics[id].name.c_str());
|
||||
g->add_msg("Successfully installed %s.", bionics[id]->name.c_str());
|
||||
add_bionic(id);
|
||||
} else
|
||||
bionics_install_failure(g, this, success);
|
||||
@@ -589,10 +697,10 @@ void bionics_install_failure(game *g, player *u, int success)
|
||||
{
|
||||
fail_text += ", causing a faulty installation.";
|
||||
std::vector<bionic_id> valid;
|
||||
for (int i = max_bio_good + 1; i < max_bio; i++) {
|
||||
bionic_id id = bionic_id(i);
|
||||
if (!u->has_bionic(id))
|
||||
valid.push_back(id);
|
||||
for (std::vector<std::string>::iterator it = faulty_bionics.begin() ; it != faulty_bionics.end(); ++it){
|
||||
if (!u->has_bionic(*it)){
|
||||
valid.push_back(*it);
|
||||
}
|
||||
}
|
||||
if (valid.size() == 0) { // We've got all the bad bionics!
|
||||
if (u->max_power_level > 0) {
|
||||
@@ -611,3 +719,297 @@ void bionics_install_failure(game *g, player *u, int success)
|
||||
g->add_msg(fail_text.c_str());
|
||||
|
||||
}
|
||||
|
||||
void game::init_bionics(){
|
||||
bionics["bio_null"] = new bionic_data("NULL bionics", false, false, 0, 0, "\
|
||||
If you're seeing this, it's a bug.");
|
||||
// NAME ,PW_SRC, ACT ,COST, TIME,
|
||||
bionics["bio_batteries"] = new bionic_data("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. Use 'E' to consume batteries.");
|
||||
power_source_bionics.push_back("bio_batteries");
|
||||
bionics["bio_metabolics"] = new bionic_data("Metabolic Interchange", true, false, 0, 0, "\
|
||||
Your digestive system and power supply are interconnected. Any drain on\n\
|
||||
energy instead increases your hunger.");
|
||||
power_source_bionics.push_back("bio_metabolics");
|
||||
bionics["bio_solar"] = new bionic_data("Solar Panels", true, false, 0, 0, "\
|
||||
You have a few solar panels installed. While in direct sunlight, your power\n\
|
||||
level will slowly recharge.");
|
||||
power_source_bionics.push_back("bio_solar");
|
||||
bionics["bio_furnace"] = new bionic_data("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.");
|
||||
power_source_bionics.push_back("bio_furnace");
|
||||
bionics["bio_ethanol"] = new bionic_data("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.");
|
||||
power_source_bionics.push_back("bio_ethanol");
|
||||
bionics["bio_memory"] = new bionic_data("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 poweron.");
|
||||
unpowered_bionics.push_back("bio_memory");
|
||||
bionics["bio_ears"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
|
||||
bionics["bio_eye_enhancer"] = new bionic_data("Diamond Cornea", false, false, 0, 0, "\
|
||||
Your vision is greatly enhanced, giving you a +2 bonus to perception.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_membrane"] = new bionic_data("Nictating Membrane", false, false, 0, 0, "\
|
||||
Your eyes have a thin membrane that closes over your eyes while underwater,\n\
|
||||
negating any vision penalties.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_targeting"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_gills"] = new bionic_data("Membrane Oxygenator", false, false, 1, 0, "\
|
||||
An oxygen interchange system automatically switches on while underwater,\n\
|
||||
slowly draining your energy reserves but providing oxygen.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_purifier"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_climate"] = new bionic_data("Internal Climate Control", false, true, 1, 30, "\
|
||||
Throughout your body lies a network of thermal piping which eases the effects\n\
|
||||
of high and low ambient temperatures.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
|
||||
bionics["bio_storage"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_recycler"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_digestion"] = new bionic_data("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 foodborne illness, and can sometimes eat rotten food.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_tools"] = new bionic_data("Integrated Toolset", false, false, 0, 0, "\
|
||||
Implanted in your hands and fingers is a complete tool set - screwdriver,\n\
|
||||
hammer, wrench, and heating elements. You can use this in place of many\n\
|
||||
tools when crafting.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_shock"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_heat_absorb"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_carbon"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_armor_head"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_armor_torso"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_armor_arms"] = new bionic_data("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 1.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
bionics["bio_armor_legs"] = new bionic_data("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.");
|
||||
unpowered_bionics.push_back("bio_ears");
|
||||
|
||||
bionics["bio_flashlight"] = new bionic_data("Cranial Flashlight", false, true, 1, 30, "\
|
||||
Mounted between your eyes is a small but powerful LED flashlight.");
|
||||
bionics["bio_night_vision"] = new bionic_data("Implanted Night Vision", false, true, 1, 20, "\
|
||||
Your eyes have been modified to amplify existing light, allowing you to see\n\
|
||||
in the dark.");
|
||||
bionics["bio_infrared"] = new bionic_data("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.");
|
||||
bionics["bio_face_mask"] = new bionic_data("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.");
|
||||
bionics["bio_ads"] = new bionic_data("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.");
|
||||
bionics["bio_ods"] = new bionic_data("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.");
|
||||
bionics["bio_scent_mask"] = new bionic_data("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.");
|
||||
|
||||
bionics["bio_scent_vision"] = new bionic_data("Scent Vision", false, true, 1, 30, "\
|
||||
While this system is powered, you're able to visually sense your own scent,\n\
|
||||
making it possible for you to recognize your surroundings even if you can't\n\
|
||||
see it.");
|
||||
bionics["bio_cloak"] = new bionic_data("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.");
|
||||
bionics["bio_painkiller"] = new bionic_data("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.");
|
||||
bionics["bio_nanobots"] = new bionic_data("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.");
|
||||
bionics["bio_heatsink"] = new bionic_data("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.");
|
||||
bionics["bio_resonator"] = new bionic_data("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.");
|
||||
|
||||
bionics["bio_time_freeze"] = new bionic_data("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.");
|
||||
bionics["bio_teleport"] = new bionic_data("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.");
|
||||
bionics["bio_blood_anal"] = new bionic_data("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.");
|
||||
bionics["bio_blood_filter"] = new bionic_data("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.");
|
||||
bionics["bio_alarm"] = new bionic_data("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.");
|
||||
bionics["bio_evap"] = new bionic_data("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.");
|
||||
bionics["bio_lighter"] = new bionic_data("Mini-Flamethrower", false, true, 3, 0, "\
|
||||
The index fingers of both hands have powerful fire starters which extend from\n\
|
||||
the tip.");
|
||||
bionics["bio_claws"] = new bionic_data("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.");
|
||||
|
||||
bionics["bio_blaster"] = new bionic_data("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.");
|
||||
bionics["bio_laser"] = new bionic_data("Finger-Mounted 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.");
|
||||
bionics["bio_emp"] = new bionic_data("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.");
|
||||
bionics["bio_hydraulics"] = new bionic_data("Hydraulic Muscles", false, true, 1, 3, "\
|
||||
While activated, the muscles in your arms will be greatly enchanced,\n\
|
||||
increasing your strength by 20.");
|
||||
bionics["bio_water_extractor"] = new bionic_data("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.");
|
||||
bionics["bio_magnet"] = new bionic_data("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.");
|
||||
bionics["bio_fingerhack"] = new bionic_data("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.");
|
||||
bionics["bio_lockpick"] = new bionic_data("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.");
|
||||
|
||||
bionics["bio_ground_sonar"] = new bionic_data("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.");
|
||||
|
||||
bionics["bio_banish"] = new bionic_data("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.");
|
||||
bionics["bio_gate_out"] = new bionic_data("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...");
|
||||
bionics["bio_gate_in"] = new bionic_data("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.");
|
||||
bionics["bio_nightfall"] = new bionic_data("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.");
|
||||
bionics["bio_drilldown"] = new bionic_data("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.");
|
||||
|
||||
bionics["bio_heatwave"] = new bionic_data("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.");
|
||||
bionics["bio_lightning"] = new bionic_data("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.");
|
||||
bionics["bio_tremor"] = new bionic_data("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.");
|
||||
bionics["bio_flashflood"] = new bionic_data("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.");
|
||||
|
||||
//Fault Bionics from here on out.
|
||||
bionics["bio_dis_shock"] = new bionic_data("Electrical Discharge", false, false, 0, 0, "\
|
||||
A malfunctioning bionic which occasionally discharges electricity through\n\
|
||||
your body, causing pain and brief paralysis but no damage.");
|
||||
faulty_bionics.push_back("bio_dis_shock");
|
||||
|
||||
bionics["bio_dis_acid"] = new bionic_data("Acidic Discharge", false, false, 0, 0, "\
|
||||
A malfunctioning bionic which occasionally discharges acid into your muscles,\n\
|
||||
causing sharp pain and minor damage.");
|
||||
faulty_bionics.push_back("bio_dis_shock");
|
||||
|
||||
bionics["bio_drain"] = new bionic_data("Electrical Drain", false, false, 0, 0, "\
|
||||
A malfunctioning bionic. It doesn't perform any useful function, but will\n\
|
||||
occasionally draw power from your batteries.");
|
||||
faulty_bionics.push_back("bio_drain");
|
||||
|
||||
bionics["bio_noise"] = new bionic_data("Noisemaker", false, false, 0, 0, "\
|
||||
A malfunctioning bionic. It will occasionally emit a loud burst of noise.");
|
||||
faulty_bionics.push_back("bio_noise");
|
||||
bionics["bio_power_weakness"] = new bionic_data("Power Overload", false, false, 0, 0, "\
|
||||
Damaged power circuits cause short-circuiting inside your muscles when your\n\
|
||||
batteries are above 75%%%% capacity, causing greatly reduced strength. This\n\
|
||||
has no effect if you have no internal batteries.");
|
||||
faulty_bionics.push_back("bio_power_weakness");
|
||||
|
||||
bionics["bio_stiff"] = new bionic_data("Wire-induced Stiffness", false, false, 0, 0, "\
|
||||
Improperly installed wires cause a physical stiffness in most of your body,\n\
|
||||
causing increased encumberance.");
|
||||
faulty_bionics.push_back("bio_stiff");
|
||||
}
|
||||
|
||||
|
||||
@@ -1,51 +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 {
|
||||
bio_null,
|
||||
// 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_scent_vision, 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,
|
||||
// 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_good,
|
||||
// Everything below THIS point is bad bionics, meant to be punishments
|
||||
bio_dis_shock, bio_dis_acid, bio_drain, bio_noise, bio_power_weakness,
|
||||
bio_stiff,
|
||||
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 {
|
||||
@@ -54,7 +29,7 @@ struct bionic {
|
||||
bool powered;
|
||||
int charge;
|
||||
bionic() {
|
||||
id = bio_batteries;
|
||||
id = "bio_batteries";
|
||||
invlet = 'a';
|
||||
powered = false;
|
||||
charge = 0;
|
||||
@@ -67,265 +42,9 @@ struct bionic {
|
||||
};
|
||||
};
|
||||
|
||||
const bionic_data bionics[] = {
|
||||
{"NULL bionics", false, false, 0, 0, "\
|
||||
If you're seeing this, it's a bug."},
|
||||
// NAME ,PW_SRC, ACT ,COST, TIME,
|
||||
{"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. Use 'E' to consume 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."},
|
||||
{"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 foodborne 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 heating elements. You can use this in place of many\n\
|
||||
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."},
|
||||
{"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 1."},
|
||||
{"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."},
|
||||
{"Scent Vision", false, true, 1, 30, "\
|
||||
While this system is powered, you're able to visually sense your own scent,\n\
|
||||
making it possible for you to recognize your surroundings even if you can't\n\
|
||||
see it."},
|
||||
{"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-Mounted 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 muscles 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."},
|
||||
|
||||
{"max_bio_good - BUG", false, false, 0, 0, "\
|
||||
This is a placeholder bionic. If you are reading this, you have found a bug!"},
|
||||
|
||||
{"Electrical Discharge", false, false, 0, 0, "\
|
||||
A malfunctioning bionic which occasionally discharges electricity through\n\
|
||||
your body, causing pain and brief paralysis but no damage."},
|
||||
{"Acidic Discharge", false, false, 0, 0, "\
|
||||
A malfunctioning bionic which occasionally discharges acid into your muscles,\n\
|
||||
causing sharp pain and minor damage."},
|
||||
{"Electrical Drain", false, false, 0, 0, "\
|
||||
A malfunctioning bionic. It doesn't perform any useful function, but will\n\
|
||||
occasionally draw power from your batteries."},
|
||||
{"Noisemaker", false, false, 0, 0, "\
|
||||
A malfunctioning bionic. It will occasionally emit a loud burst of noise."},
|
||||
{"Power Overload", false, false, 0, 0, "\
|
||||
Damaged power circuits cause short-circuiting inside your muscles when your\n\
|
||||
batteries are above 75%%%% capacity, causing greatly reduced strength. This\n\
|
||||
has no effect if you have no internal batteries."},
|
||||
{"Wire-induced Stiffness", false, false, 0, 0, "\
|
||||
Improperly installed wires cause a physical stiffness in most of your body,\n\
|
||||
causing increased encumberance."}
|
||||
|
||||
};
|
||||
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
|
||||
|
||||
+1
-1
@@ -2,7 +2,7 @@
|
||||
#define _BODYPART_H_
|
||||
|
||||
#include <string>
|
||||
|
||||
// The order is important ; pldata.h has to be in the same order
|
||||
enum body_part {
|
||||
bp_torso = 0,
|
||||
bp_head,
|
||||
|
||||
+6
-6
@@ -224,14 +224,14 @@ void calendar::standardize()
|
||||
season = season_type(tmpseason);
|
||||
}
|
||||
|
||||
int calendar::minutes_past_midnight()
|
||||
int calendar::minutes_past_midnight() const
|
||||
{
|
||||
//debugmsg("minute: %d hour: %d");
|
||||
int ret = minute + hour * 60;
|
||||
return ret;
|
||||
}
|
||||
|
||||
moon_phase calendar::moon()
|
||||
moon_phase calendar::moon() const
|
||||
{
|
||||
int phase = day / (DAYS_IN_SEASON / 4);
|
||||
//phase %= 4; Redundant?
|
||||
@@ -241,7 +241,7 @@ moon_phase calendar::moon()
|
||||
return moon_phase(phase);
|
||||
}
|
||||
|
||||
calendar calendar::sunrise()
|
||||
calendar calendar::sunrise() const
|
||||
{
|
||||
calendar ret;
|
||||
int start_hour = 0, end_hour = 0;
|
||||
@@ -273,7 +273,7 @@ calendar calendar::sunrise()
|
||||
return ret;
|
||||
}
|
||||
|
||||
calendar calendar::sunset()
|
||||
calendar calendar::sunset() const
|
||||
{
|
||||
calendar ret;
|
||||
int start_hour = 0, end_hour = 0;
|
||||
@@ -305,7 +305,7 @@ calendar calendar::sunset()
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool calendar::is_night()
|
||||
bool calendar::is_night() const
|
||||
{
|
||||
calendar sunrise_time = sunrise(), sunset_time = sunset();
|
||||
|
||||
@@ -316,7 +316,7 @@ bool calendar::is_night()
|
||||
return (mins > sunset_mins + TWILIGHT_MINUTES || mins < sunrise_mins);
|
||||
}
|
||||
|
||||
int calendar::sunlight()
|
||||
int calendar::sunlight() const
|
||||
{
|
||||
calendar sunrise_time = sunrise(), sunset_time = sunset();
|
||||
|
||||
|
||||
+6
-6
@@ -70,12 +70,12 @@ class calendar
|
||||
void standardize(); // Ensure minutes <= 59, hour <= 23, etc.
|
||||
|
||||
// Sunlight and day/night calcuations
|
||||
int minutes_past_midnight(); // Useful for sunrise/set calculations
|
||||
moon_phase moon(); // Find phase of moon
|
||||
calendar sunrise(); // Current time of sunrise
|
||||
calendar sunset(); // Current time of sunset
|
||||
bool is_night(); // After sunset + TWILIGHT_MINUTES, before sunrise
|
||||
int sunlight(); // Current amount of sun/moonlight; uses preceding funcs
|
||||
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);
|
||||
|
||||
+36
-17
@@ -46,7 +46,7 @@ bool WinCreate()
|
||||
int WinBorderWidth;
|
||||
int WinTitleSize;
|
||||
unsigned int WindowStyle;
|
||||
const WCHAR *szTitle= (L"Cataclysm");
|
||||
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
|
||||
@@ -157,6 +157,7 @@ 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);
|
||||
};
|
||||
|
||||
@@ -331,6 +332,10 @@ fin.open("data\\FONTDATA");
|
||||
|
||||
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];
|
||||
@@ -646,6 +651,20 @@ int getmaxy(WINDOW *win)
|
||||
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;
|
||||
@@ -659,22 +678,22 @@ inline RGBQUAD BGR(int b, int g, int r)
|
||||
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); //Oddzball - Black
|
||||
windowsPalette[1]= BGR(0, 0, 255); //Oddzball - Red
|
||||
windowsPalette[2]= BGR(0,100,0); //Oddzball- Green
|
||||
windowsPalette[3]= BGR(23,51,92); //Oddzball- Brown??? -Made Darker
|
||||
windowsPalette[4]= BGR(150, 0, 0); //Oddzball-Blue
|
||||
windowsPalette[5]= BGR(98, 58, 139); //Oddzball-Pink? -Made Purple
|
||||
windowsPalette[6]= BGR(180, 150, 0); //Oddzball-Cyan
|
||||
windowsPalette[7]= BGR(196, 196, 196);//Oddzball-Gray
|
||||
windowsPalette[8]= BGR(77, 77, 77);//Oddzball-Dark Gray -Made Darker Gray
|
||||
windowsPalette[9]= BGR(150, 150, 255); //Oddzball-Light Red/Salmon? -Made Lighter red
|
||||
windowsPalette[10]= BGR(0, 255, 0); //Oddzball-Bright Green
|
||||
windowsPalette[11]= BGR(0, 255, 255); //Oddzball-Yellow
|
||||
windowsPalette[12]= BGR(255, 100, 100); //Oddzball-Dark Blue? -Made Light Blue
|
||||
windowsPalette[13]= BGR(240, 0, 255); //Oddzball- Pink
|
||||
windowsPalette[14]= BGR(255, 240, 0); //Oddzball -Light Cyan?
|
||||
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);
|
||||
};
|
||||
|
||||
@@ -141,6 +141,8 @@ 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
|
||||
|
||||
+1
-1
@@ -18,7 +18,7 @@ ADDITIONS
|
||||
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
|
||||
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!
|
||||
|
||||
+43
-33
@@ -70,7 +70,7 @@ void computer::shutdown_terminal()
|
||||
void computer::use(game *g)
|
||||
{
|
||||
if (w_terminal == NULL)
|
||||
w_terminal = newwin(25, 80, 0, 0);
|
||||
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 );
|
||||
|
||||
@@ -163,7 +163,7 @@ bool computer::hack_attempt(player *p, int Security)
|
||||
Security = security; // Set to main system security if no value passed
|
||||
|
||||
p->practice("computer", 5 + Security * 2);
|
||||
int player_roll = p->skillLevel("computer").level();
|
||||
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))
|
||||
@@ -260,12 +260,12 @@ void computer::activate_function(game *g, computer_action action)
|
||||
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[itm_sewage], g->turn) );
|
||||
it->put_in( item(g->itypes["sewage"], g->turn) );
|
||||
found_item = true;
|
||||
}
|
||||
}
|
||||
if (!found_item) {
|
||||
item sewage(g->itypes[itm_sewage], g->turn);
|
||||
item sewage(g->itypes["sewage"], g->turn);
|
||||
g->m.add_item(x1, y1, sewage);
|
||||
}
|
||||
}
|
||||
@@ -385,12 +385,10 @@ void computer::activate_function(game *g, computer_action action)
|
||||
if (maxx >= OMAPX) maxx = OMAPX - 1;
|
||||
if (miny < 0) miny = 0;
|
||||
if (maxy >= OMAPY) maxy = OMAPY - 1;
|
||||
overmap tmp(g, g->cur_om.posx, g->cur_om.posy, 0);
|
||||
for (int i = minx; i <= maxx; i++) {
|
||||
for (int j = miny; j <= maxy; j++)
|
||||
tmp.seen(i, j) = true;
|
||||
g->cur_om.seen(i, j, 0) = true;
|
||||
}
|
||||
tmp.save(g->u.name, g->cur_om.posx, g->cur_om.posy, 0);
|
||||
print_line("Surface map data downloaded.");
|
||||
} break;
|
||||
|
||||
@@ -405,20 +403,19 @@ void computer::activate_function(game *g, computer_action action)
|
||||
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) >= ot_sewer_ns &&
|
||||
g->cur_om.ter(i, j) <= ot_sewer_nesw) ||
|
||||
(g->cur_om.ter(i, j) >= ot_sewage_treatment &&
|
||||
g->cur_om.ter(i, j) <= ot_sewage_treatment_under))
|
||||
g->cur_om.seen(i, j) = true;
|
||||
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: {
|
||||
overmap tmp_om(g, g->cur_om.posx, g->cur_om.posy, 0);
|
||||
// Target Acquisition.
|
||||
point target = tmp_om.choose_point(g);
|
||||
point target = g->cur_om.choose_point(g, 0);
|
||||
if (target.x == -1) {
|
||||
print_line("Launch canceled.");
|
||||
return;
|
||||
@@ -437,15 +434,12 @@ void computer::activate_function(game *g, computer_action action)
|
||||
}
|
||||
}
|
||||
// For each level between here and the surface, remove the missile
|
||||
for (int level = g->cur_om.posz; level < 0; level++) {
|
||||
tmp_om = g->cur_om;
|
||||
g->cur_om = overmap(g, tmp_om.posx, tmp_om.posy, level);
|
||||
for (int level = g->levz; level < 0; level++) {
|
||||
tinymap tmpmap(&g->itypes, &g->mapitems, &g->traps);
|
||||
tmpmap.load(g, g->levx, g->levy, false);
|
||||
tmpmap.load(g, g->levx, g->levy, level, false);
|
||||
tmpmap.translate(t_missile, t_hole);
|
||||
tmpmap.save(&tmp_om, g->turn, g->levx, g->levy);
|
||||
tmpmap.save(&g->cur_om, g->turn, g->levx, level, g->levz);
|
||||
}
|
||||
g->cur_om = tmp_om;
|
||||
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);
|
||||
@@ -473,14 +467,14 @@ void computer::activate_function(game *g, computer_action action)
|
||||
for (int i = 0; i < names.size(); i++)
|
||||
print_line(names[i].c_str());
|
||||
if (more > 0)
|
||||
print_line("%d OTHERS FOUND...");
|
||||
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(x, y) = t_elevator_control;
|
||||
g->m.ter_set(x, y, t_elevator_control);
|
||||
}
|
||||
}
|
||||
print_line("Elevator activated.");
|
||||
@@ -553,7 +547,7 @@ know that's sort of a big deal, but come on, these guys can't handle it?\n");
|
||||
print_line("\
|
||||
SITE %d%d%d%d%d\n\
|
||||
PERTINANT FOREMAN LOGS WILL BE PREPENDED TO NOTES",
|
||||
g->cur_om.posx, g->cur_om.posy, g->levx, g->levy, abs(g->levz));
|
||||
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\
|
||||
@@ -585,7 +579,7 @@ of pureed bone & LSD.");
|
||||
break;
|
||||
|
||||
case COMPACT_DOWNLOAD_SOFTWARE:
|
||||
if (!g->u.has_amount(itm_usb_drive, 1))
|
||||
if (!g->u.has_amount("usb_drive", 1))
|
||||
print_error("USB drive required!");
|
||||
else {
|
||||
mission *miss = g->find_mission(mission_id);
|
||||
@@ -610,11 +604,11 @@ of pureed bone & LSD.");
|
||||
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 != itm_vacutainer)
|
||||
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 != itm_blood)
|
||||
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]);
|
||||
@@ -624,10 +618,10 @@ of pureed bone & LSD.");
|
||||
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(itm_usb_drive, 1))
|
||||
if (!g->u.has_amount("usb_drive", 1))
|
||||
print_error("USB drive required!");
|
||||
else {
|
||||
item software(g->itypes[itm_software_blood_data], 0);
|
||||
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);
|
||||
@@ -644,6 +638,21 @@ of pureed bone & LSD.");
|
||||
}
|
||||
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)
|
||||
}
|
||||
|
||||
@@ -665,7 +674,7 @@ void computer::activate_failure(game *g, computer_failure fail)
|
||||
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(x, y) = t_console_broken;
|
||||
g->m.ter_set(x, y, t_console_broken);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -722,7 +731,7 @@ void computer::activate_failure(game *g, computer_failure fail)
|
||||
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(x, y) = t_rubble;
|
||||
g->m.ter_set(x, y, t_rubble);
|
||||
g->explosion(x, y, 10, 0, false);
|
||||
}
|
||||
}
|
||||
@@ -751,7 +760,7 @@ void computer::activate_failure(game *g, computer_failure fail)
|
||||
i = leak_size;
|
||||
else {
|
||||
p = next_move[rng(0, next_move.size() - 1)];
|
||||
g->m.ter(p.x, p.y) = t_sewage;
|
||||
g->m.ter_set(p.x, p.y, t_sewage);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -776,11 +785,11 @@ void computer::activate_failure(game *g, computer_failure fail)
|
||||
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 != itm_vacutainer)
|
||||
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 != itm_blood)
|
||||
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.");
|
||||
@@ -792,6 +801,7 @@ void computer::activate_failure(game *g, computer_failure fail)
|
||||
}
|
||||
getch();
|
||||
break;
|
||||
|
||||
}// switch (fail)
|
||||
}
|
||||
|
||||
|
||||
@@ -32,6 +32,7 @@ enum computer_action
|
||||
COMPACT_DOWNLOAD_SOFTWARE,
|
||||
COMPACT_BLOOD_ANAL,
|
||||
COMPACT_STEMCELL_TREATMENT,
|
||||
COMPACT_EMERG_MESS,
|
||||
NUM_COMPUTER_ACTIONS
|
||||
};
|
||||
|
||||
|
||||
+326
-200
@@ -22,12 +22,13 @@ void game::init_construction()
|
||||
constructions.push_back( new constructable(id, name, difficulty, able, done))
|
||||
|
||||
#define STAGE(...)\
|
||||
tl = 0; cl = 0; sl++; \
|
||||
tl = -1; cl = -1; sl++; \
|
||||
constructions[id]->stages.push_back(construction_stage(__VA_ARGS__));
|
||||
#define TOOL(...) setvector(constructions[id]->stages[sl].tools[tl], \
|
||||
__VA_ARGS__); tl++
|
||||
#define COMP(...) setvector(constructions[id]->stages[sl].components[cl], \
|
||||
__VA_ARGS__); cl++
|
||||
#define TOOL(item) ++tl; constructions[id]->stages[sl].tools[tl].push_back(component(item, -1))
|
||||
#define TOOLCONT(item) constructions[id]->stages[sl].tools[tl].push_back(component(item, -1))
|
||||
#define COMP(item, amount) ++cl; constructions[id]->stages[sl].components[cl].push_back(component(item,amount))
|
||||
#define COMPCONT(item, amount) constructions[id]->stages[sl].components[cl].push_back(component(item,amount))
|
||||
|
||||
|
||||
/* CONSTRUCT( name, time, able, done )
|
||||
* Name is the name as it appears in the menu; 30 characters or less, please.
|
||||
@@ -42,27 +43,36 @@ void game::init_construction()
|
||||
|
||||
CONSTRUCT("Dig Pit", 0, &construct::able_dig, &construct::done_nothing);
|
||||
STAGE(t_pit_shallow, 10);
|
||||
TOOL(itm_shovel, NULL);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
TOOLCONT("digging_stick");
|
||||
STAGE(t_pit, 10);
|
||||
TOOL(itm_shovel, NULL);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
|
||||
CONSTRUCT("Spike Pit", 0, &construct::able_pit, &construct::done_nothing);
|
||||
STAGE(t_pit_spiked, 5);
|
||||
COMP(itm_spear_wood, 4, NULL);
|
||||
COMP("spear_wood", 4);
|
||||
|
||||
CONSTRUCT("Fill Pit", 0, &construct::able_pit, &construct::done_nothing);
|
||||
STAGE(t_pit_shallow, 5);
|
||||
TOOL(itm_shovel, NULL);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
STAGE(t_dirt, 5);
|
||||
TOOL(itm_shovel, NULL);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
|
||||
CONSTRUCT("Chop Down Tree", 0, &construct::able_tree, &construct::done_tree);
|
||||
STAGE(t_dirt, 10);
|
||||
TOOL(itm_ax, itm_chainsaw_on, NULL);
|
||||
TOOL("ax");
|
||||
TOOLCONT("primitive_axe");
|
||||
TOOLCONT("chainsaw_on");
|
||||
|
||||
CONSTRUCT("Chop Up Log", 0, &construct::able_log, &construct::done_log);
|
||||
STAGE(t_dirt, 20);
|
||||
TOOL(itm_ax, itm_chainsaw_on, NULL);
|
||||
TOOL("ax");
|
||||
TOOLCONT("primitive_axe");
|
||||
TOOLCONT("chainsaw_on");
|
||||
|
||||
CONSTRUCT("Move Furniture", -1, &construct::able_furniture, &construct::done_furniture);
|
||||
STAGE(t_null, 1);
|
||||
@@ -74,97 +84,143 @@ void game::init_construction()
|
||||
/* CONSTRUCT("Remove Window Pane", 1, &construct::able_window_pane,
|
||||
&construct::done_window_pane);
|
||||
STAGE(t_window_empty, 10);
|
||||
TOOL(itm_hammer, itm_rock, itm_hatchet, NULL);
|
||||
TOOL(itm_screwdriver, itm_knife_butter, itm_toolset, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("rock");
|
||||
TOOLCONT("hatchet");
|
||||
TOOL("screwdriver");
|
||||
TOOLCONT("knife_butter");
|
||||
TOOLCONT("toolset");
|
||||
*/
|
||||
|
||||
CONSTRUCT("Repair Door", 1, &construct::able_door_broken,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_door_c, 10);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_2x4, 3, NULL);
|
||||
COMP(itm_nail, 12, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("2x4", 3);
|
||||
COMP("nail", 12);
|
||||
|
||||
CONSTRUCT("Board Up Door", 0, &construct::able_door, &construct::done_nothing);
|
||||
STAGE(t_door_boarded, 8);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_2x4, 4, NULL);
|
||||
COMP(itm_nail, 8, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("hammer_sledge");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("2x4", 4);
|
||||
COMP("nail", 8);
|
||||
|
||||
CONSTRUCT("Board Up Window", 0, &construct::able_window,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_window_boarded, 5);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_2x4, 4, NULL);
|
||||
COMP(itm_nail, 8, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("hammer_sledge");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("2x4", 4);
|
||||
COMP("nail", 8);
|
||||
|
||||
CONSTRUCT("Build Wall", 2, &construct::able_empty, &construct::done_nothing);
|
||||
STAGE(t_wall_half, 10);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_2x4, 10, NULL);
|
||||
COMP(itm_nail, 20, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("2x4", 10);
|
||||
COMP("nail", 20);
|
||||
STAGE(t_wall_wood, 10);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_2x4, 10, NULL);
|
||||
COMP(itm_nail, 20, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("2x4", 10);
|
||||
COMP("nail", 20);
|
||||
|
||||
CONSTRUCT("Build Log Wall", 2, &construct::able_pit, &construct::done_nothing);
|
||||
STAGE(t_wall_log_half, 20);
|
||||
TOOL(itm_shovel, NULL);
|
||||
COMP(itm_log, 2, NULL);
|
||||
COMP(itm_stick, 3, NULL);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
COMP("log", 2);
|
||||
COMP("stick", 3);
|
||||
STAGE(t_wall_log, 20);
|
||||
TOOL(itm_shovel, NULL);
|
||||
COMP(itm_log, 2, NULL);
|
||||
COMP(itm_stick, 3, NULL);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
COMP("log", 2);
|
||||
COMP("stick", 3);
|
||||
|
||||
CONSTRUCT("Build Palisade Wall", 2, &construct::able_pit, &construct::done_nothing);
|
||||
STAGE(t_palisade, 20);
|
||||
TOOL(itm_shovel, NULL);
|
||||
COMP(itm_log, 3, NULL);
|
||||
COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
COMP("log", 3);
|
||||
COMP("rope_30", 1);
|
||||
COMPCONT("rope_6", 5);
|
||||
|
||||
CONSTRUCT("Build Rope and Pulley System", 2, &construct::able_empty, &construct::done_nothing);
|
||||
STAGE(t_palisade_pulley, 0);
|
||||
COMP("rope_30", 1);
|
||||
COMP("stick", 8);
|
||||
COMPCONT("2x4", 8);
|
||||
|
||||
CONSTRUCT("Build Palisade Gate", 2, &construct::able_pit, &construct::done_nothing);
|
||||
STAGE(t_palisade_gate, 20);
|
||||
TOOL(itm_shovel, NULL);
|
||||
COMP(itm_log, 2, NULL);
|
||||
COMP(itm_2x4, 3, NULL);
|
||||
COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
COMP("log", 2);
|
||||
COMP("2x4", 3);
|
||||
COMP("rope_30", 1);
|
||||
COMPCONT("rope_6", 5);
|
||||
|
||||
CONSTRUCT("Build Window", 2, &construct::able_empty,
|
||||
CONSTRUCT("Build Window", 2, &construct::able_make_window,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_window_empty, 10);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_2x4, 15, itm_log, 2, NULL);
|
||||
COMP(itm_nail, 30, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("2x4", 15);
|
||||
COMPCONT("log", 2);
|
||||
COMP("nail", 30);
|
||||
STAGE(t_window, 5);
|
||||
COMP(itm_glass_sheet, 1, NULL);
|
||||
COMP("glass_sheet", 1);
|
||||
STAGE(t_window_domestic, 5);
|
||||
TOOL(itm_saw, NULL);
|
||||
COMP(itm_nail, 4, NULL);
|
||||
COMP(itm_sheet, 2, NULL);
|
||||
COMP(itm_stick, 1, NULL);
|
||||
|
||||
TOOL("saw");
|
||||
COMP("nail", 4);
|
||||
COMP("sheet", 2);
|
||||
COMP("stick", 1);
|
||||
|
||||
CONSTRUCT("Build Door", 2, &construct::able_empty,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_door_frame, 15);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_2x4, 12, NULL);
|
||||
COMP(itm_nail, 24, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("2x4", 12);
|
||||
COMP("nail", 24);
|
||||
STAGE(t_door_c, 15);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_2x4, 4, NULL);
|
||||
COMP(itm_nail, 12, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("2x4", 4);
|
||||
COMP("nail", 12);
|
||||
|
||||
CONSTRUCT("Build Wire Fence",3, &construct::able_dig,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_chainfence_posts, 20);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_rock, NULL);
|
||||
COMP(itm_pipe, 6, NULL);
|
||||
COMP(itm_scrap, 8, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("rock");
|
||||
COMP("pipe", 6);
|
||||
COMP("scrap", 8);
|
||||
STAGE(t_chainfence_v, 20);
|
||||
COMP(itm_wire, 15, NULL);
|
||||
COMP("wire", 15);
|
||||
|
||||
CONSTRUCT("Realign Fence", 0, &construct::able_chainlink,
|
||||
&construct::done_nothing);
|
||||
@@ -174,89 +230,143 @@ void game::init_construction()
|
||||
CONSTRUCT("Build Wire Gate", 3, &construct::able_between_walls,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_chaingate_c, 15);
|
||||
COMP(itm_wire, 20, NULL);
|
||||
COMP(itm_steel_chunk, 3, itm_scrap, 12, NULL);
|
||||
COMP(itm_pipe, 6, NULL);
|
||||
COMP("wire", 20);
|
||||
COMP("steel_chunk", 3);
|
||||
COMPCONT("scrap", 12);
|
||||
COMP("pipe", 6);
|
||||
|
||||
/* Removed until we have some way of auto-aligning fences!
|
||||
CONSTRUCT("Build Fence", 1, 15, &construct::able_empty);
|
||||
STAGE(t_fence_h, 10);
|
||||
TOOL(itm_hammer, itm_hatchet, NULL);
|
||||
COMP(itm_2x4, 5, itm_nail, 8, NULL);
|
||||
*/
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
COMP("2x4", 5);
|
||||
COMPCONT("nail", 8);
|
||||
*/
|
||||
|
||||
CONSTRUCT("Build Roof", 3, &construct::able_between_walls,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_floor, 40);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_2x4, 8, NULL);
|
||||
COMP(itm_nail, 40, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("2x4", 8);
|
||||
COMP("nail", 40);
|
||||
|
||||
// Base stuff
|
||||
CONSTRUCT("Build Bulletin Board", 0, &construct::able_empty,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_bulletin, 10)
|
||||
TOOL("saw");
|
||||
TOOL("hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("2x4", 4);
|
||||
COMP("nail", 8);
|
||||
|
||||
// Household stuff
|
||||
CONSTRUCT("Build Dresser", 1, &construct::able_indoors,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_dresser, 20);
|
||||
TOOL(itm_saw, NULL);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_nail, 8, NULL);
|
||||
COMP(itm_2x4, 6, NULL);
|
||||
TOOL("saw");
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("nail", 8);
|
||||
COMP("2x4", 6);
|
||||
|
||||
CONSTRUCT("Build Bookcase", 1, &construct::able_indoors,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_bookcase, 20);
|
||||
TOOL(itm_saw, NULL);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_nail, 16, NULL);
|
||||
COMP(itm_2x4, 12, NULL);
|
||||
TOOL("saw");
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("nail", 16);
|
||||
COMP("2x4", 12);
|
||||
|
||||
CONSTRUCT("Build Counter", 0, &construct::able_indoors,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_counter, 20);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_nail, 8, NULL);
|
||||
COMP(itm_2x4, 6, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("nail", 8);
|
||||
COMP("2x4", 6);
|
||||
|
||||
CONSTRUCT("Build Makeshift Bed", 0, &construct::able_indoors,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_makeshift_bed, 20);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
COMP(itm_nail, 8, NULL);
|
||||
COMP(itm_2x4, 10, NULL);
|
||||
COMP(itm_sheet, 1, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
COMP("nail", 8);
|
||||
COMP("2x4", 10);
|
||||
COMP("sheet", 1);
|
||||
|
||||
CONSTRUCT("Tape up window", 0, &construct::able_window,
|
||||
&construct::done_tape);
|
||||
STAGE(t_null, 2);
|
||||
COMP(itm_duct_tape, 50, NULL);
|
||||
COMP("duct_tape", 50);
|
||||
|
||||
CONSTRUCT("Deconstruct Furniture", 0, &construct::able_deconstruct,
|
||||
&construct::done_deconstruct);
|
||||
STAGE(t_null, 20);
|
||||
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
|
||||
TOOL(itm_screwdriver, itm_toolset, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("nailgun");
|
||||
TOOL("screwdriver");
|
||||
TOOLCONT("toolset");
|
||||
|
||||
CONSTRUCT("Start vehicle construction", 0, &construct::able_empty, &construct::done_vehicle);
|
||||
STAGE(t_null, 10);
|
||||
COMP(itm_frame, 1, NULL);
|
||||
COMP("frame", 1);
|
||||
|
||||
CONSTRUCT("Fence Posts", 0, &construct::able_dig,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_fence_post, 5);
|
||||
TOOL(itm_hammer, itm_shovel, itm_rock, itm_hatchet, itm_ax, NULL);
|
||||
COMP(itm_spear_wood, 2, NULL);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
TOOLCONT("rock");
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("ax");
|
||||
TOOLCONT("primitive_axe");
|
||||
COMP("spear_wood", 2);
|
||||
|
||||
CONSTRUCT("Build Wood Stove", 0, &construct::able_empty,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_woodstove, 10);
|
||||
TOOL("hacksaw");
|
||||
COMP("metal_tank", 1);
|
||||
COMP("pipe", 1);
|
||||
}
|
||||
|
||||
void game::construction_menu()
|
||||
{
|
||||
WINDOW *w_con = newwin(25, 80, 0, 0);
|
||||
int iMaxY = TERMY;
|
||||
if (constructions.size()+2 < iMaxY)
|
||||
iMaxY = constructions.size()+2;
|
||||
if (iMaxY < 25)
|
||||
iMaxY = 25;
|
||||
|
||||
WINDOW *w_con = newwin(iMaxY, 80, (TERMY > iMaxY) ? (TERMY-iMaxY)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
wborder(w_con, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
mvwprintz(w_con, 0, 1, c_red, "Construction");
|
||||
mvwputch(w_con, 0, 30, c_white, LINE_OXXX);
|
||||
mvwputch(w_con, 24, 30, c_white, LINE_XXOX);
|
||||
for (int i = 1; i < 24; i++)
|
||||
mvwputch(w_con, i, 30, c_white, LINE_XOXO);
|
||||
mvwprintz(w_con, 0, 8, c_ltred, " Construction ");
|
||||
|
||||
mvwputch(w_con, 0, 30, c_ltgray, LINE_OXXX);
|
||||
mvwputch(w_con, iMaxY-1, 30, c_ltgray, LINE_XXOX);
|
||||
for (int i = 1; i < iMaxY-1; i++)
|
||||
mvwputch(w_con, i, 30, c_ltgray, LINE_XOXO);
|
||||
|
||||
mvwprintz(w_con, 1, 31, c_white, "Difficulty:");
|
||||
|
||||
@@ -264,46 +374,48 @@ void game::construction_menu()
|
||||
|
||||
bool update_info = true;
|
||||
int select = 0;
|
||||
char ch;
|
||||
long ch;
|
||||
|
||||
inventory total_inv = crafting_inventory();
|
||||
|
||||
do {
|
||||
// Erase existing list of constructions
|
||||
for (int i = 1; i < 24; i++) {
|
||||
for (int j = 1; j < 29; j++)
|
||||
mvwputch(w_con, i, j, c_black, 'x');
|
||||
for (int i = 1; i < iMaxY-1; i++) {
|
||||
for (int j = 1; j < 30; j++)
|
||||
mvwputch(w_con, i, j, c_black, ' ');
|
||||
}
|
||||
// Determine where in the master list to start printing
|
||||
//int offset = select - 11;
|
||||
int offset = 0;
|
||||
if (select >= 22)
|
||||
offset = select - 22;
|
||||
if (select >= iMaxY-2)
|
||||
offset = select - iMaxY + 3;
|
||||
// Print the constructions between offset and max (or how many will fit)
|
||||
for (int i = 0; i <= 22 && (i + offset) < constructions.size(); i++) {
|
||||
for (int i = 0; i < iMaxY-2 && (i + offset) < constructions.size(); i++) {
|
||||
int current = i + offset;
|
||||
nc_color col = (player_can_build(u, total_inv, constructions[current]) ?
|
||||
c_white : c_dkgray);
|
||||
// Map menu items to hotkey letters, skipping j, k, l, and q.
|
||||
char hotkey = current + ((current < 9) ? 97 : ((current < 13) ? 100 : 101));
|
||||
char hotkey = 97 + current;
|
||||
if (hotkey > 122)
|
||||
hotkey = hotkey - 58;
|
||||
|
||||
if (current == select)
|
||||
col = hilite(col);
|
||||
mvwprintz(w_con, 1 + i, 1, col, "%c %s", hotkey,
|
||||
constructions[current]->name.c_str());
|
||||
mvwprintz(w_con, 1 + i, 1, col, "%c %s", hotkey, constructions[current]->name.c_str());
|
||||
}
|
||||
|
||||
if (update_info) {
|
||||
update_info = false;
|
||||
constructable* current_con = constructions[select];
|
||||
// Print difficulty
|
||||
int pskill = u.skillLevel("carpentry").level();
|
||||
int pskill = u.skillLevel("carpentry");
|
||||
int diff = current_con->difficulty > 0 ? current_con->difficulty : 0;
|
||||
mvwprintz(w_con, 1, 43, (pskill >= diff ? c_white : c_red),
|
||||
"%d ", diff);
|
||||
// Clear out lines for tools & materials
|
||||
for (int i = 2; i < 24; i++) {
|
||||
for (int i = 2; i < iMaxY-1; i++) {
|
||||
for (int j = 31; j < 79; j++)
|
||||
mvwputch(w_con, i, j, c_black, 'x');
|
||||
mvwputch(w_con, i, j, c_black, ' ');
|
||||
}
|
||||
|
||||
// Print stages and their requirements
|
||||
@@ -324,7 +436,7 @@ void game::construction_menu()
|
||||
posy++;
|
||||
posx = 33;
|
||||
for (int j = 0; j < stage.tools[i].size(); j++) {
|
||||
itype_id tool = stage.tools[i][j];
|
||||
itype_id tool = stage.tools[i][j].type;
|
||||
nc_color col = c_red;
|
||||
if (total_inv.has_amount(tool, 1)) {
|
||||
has_tool[i] = true;
|
||||
@@ -398,54 +510,60 @@ void game::construction_menu()
|
||||
wrefresh(w_con);
|
||||
} // Finished updating
|
||||
|
||||
ch = input();
|
||||
ch = getch();
|
||||
switch (ch) {
|
||||
case 'j':
|
||||
case KEY_DOWN:
|
||||
update_info = true;
|
||||
if (select < constructions.size() - 1)
|
||||
select++;
|
||||
else
|
||||
select = 0;
|
||||
break;
|
||||
case 'k':
|
||||
case KEY_UP:
|
||||
update_info = true;
|
||||
if (select > 0)
|
||||
select--;
|
||||
else
|
||||
select = constructions.size() - 1;
|
||||
break;
|
||||
case ' ':
|
||||
case KEY_ESCAPE:
|
||||
ch = 'q';
|
||||
break;
|
||||
case '\n':
|
||||
case 'l':
|
||||
if (player_can_build(u, total_inv, constructions[select])) {
|
||||
place_construction(constructions[select]);
|
||||
ch = 'q';
|
||||
} else {
|
||||
popup("You can't build that!");
|
||||
for (int i = 1; i < 24; i++)
|
||||
mvwputch(w_con, i, 30, c_white, LINE_XOXO);
|
||||
update_info = true;
|
||||
default:
|
||||
if (ch > 64 && ch < 91) //A-Z
|
||||
ch = ch - 65 + 26;
|
||||
|
||||
if (ch > 96 && ch < 123) //a-z
|
||||
ch = ch - 97;
|
||||
|
||||
if (ch == '\n')
|
||||
ch = select;
|
||||
|
||||
if (ch < constructions.size()) {
|
||||
if (player_can_build(u, total_inv, constructions[ch])) {
|
||||
place_construction(constructions[ch]);
|
||||
ch = 'q';
|
||||
} else {
|
||||
popup("You can't build that!");
|
||||
if (ch != '\n')
|
||||
select = ch;
|
||||
for (int i = 1; i < iMaxY-1; i++)
|
||||
mvwputch(w_con, i, 30, c_ltgray, LINE_XOXO);
|
||||
update_info = true;
|
||||
}
|
||||
}
|
||||
break;
|
||||
case 'q':
|
||||
case 'Q':
|
||||
case KEY_ESCAPE:
|
||||
break;
|
||||
default:
|
||||
if (ch < 97 || ch > constructions.size() + 101) break;
|
||||
// Map menu items to hotkey letters, skipping j, k, l, and q.
|
||||
char hotkey = ch - ((ch < 106) ? 97 : ((ch < 112) ? 100 : 101));
|
||||
if (player_can_build(u, total_inv, constructions[hotkey])) {
|
||||
place_construction(constructions[hotkey]);
|
||||
ch = 'q';
|
||||
} else {
|
||||
popup("You can't build that!");
|
||||
for (int i = 1; i < 24; i++)
|
||||
mvwputch(w_con, i, 30, c_white, LINE_XOXO);
|
||||
update_info = true;
|
||||
}
|
||||
break;
|
||||
}
|
||||
} while (ch != 'q' && ch != 'Q' && ch != KEY_ESCAPE);
|
||||
|
||||
for (int i = iMaxY-25; i < iMaxY+1; i++) {
|
||||
for (int j = TERRAIN_WINDOW_WIDTH; j < 81; j++)
|
||||
mvwputch(w_con, i, j, c_black, ' ');
|
||||
}
|
||||
|
||||
wrefresh(w_con);
|
||||
refresh_all();
|
||||
}
|
||||
|
||||
@@ -479,7 +597,7 @@ bool game::player_can_build(player &p, inventory inv, constructable* con,
|
||||
tools_required = true;
|
||||
has_tool = false;
|
||||
for (int k = 0; k < stage.tools[j].size() && !has_tool; k++) {
|
||||
if (inv.has_amount(stage.tools[j][k], 1))
|
||||
if (inv.has_amount(stage.tools[j][k].type, 1))
|
||||
has_tool = true;
|
||||
}
|
||||
if (!has_tool) // missing one of the tools for this stage
|
||||
@@ -578,7 +696,7 @@ void game::place_construction(constructable *con)
|
||||
max_stage = i;
|
||||
}
|
||||
|
||||
u.assign_activity(ACT_BUILD, con->stages[starting_stage].time * 1000, con->id);
|
||||
u.assign_activity(this, ACT_BUILD, con->stages[starting_stage].time * 1000, con->id);
|
||||
|
||||
u.moves = 0;
|
||||
std::vector<int> stages;
|
||||
@@ -609,7 +727,7 @@ void game::complete_construction()
|
||||
// Make the terrain change
|
||||
int terx = u.activity.placement.x, tery = u.activity.placement.y;
|
||||
if (stage.terrain != t_null)
|
||||
m.ter(terx, tery) = stage.terrain;
|
||||
m.ter_set(terx, tery, stage.terrain);
|
||||
|
||||
// Strip off the first stage in our list...
|
||||
u.activity.values.erase(u.activity.values.begin());
|
||||
@@ -648,10 +766,13 @@ bool construct::able_furniture(game *g, point p)
|
||||
switch(g->m.ter(p.x, p.y)) {
|
||||
case t_fridge:
|
||||
case t_glass_fridge:
|
||||
case t_oven:
|
||||
case t_bathtub:
|
||||
required_str = 10;
|
||||
break;
|
||||
case t_bookcase:
|
||||
case t_locker:
|
||||
case t_table:
|
||||
required_str = 9;
|
||||
break;
|
||||
case t_dresser:
|
||||
@@ -659,6 +780,7 @@ bool construct::able_furniture(game *g, point p)
|
||||
case t_chair:
|
||||
case t_armchair:
|
||||
case t_bench:
|
||||
case t_cupboard:
|
||||
required_str = 8;
|
||||
break;
|
||||
default:
|
||||
@@ -681,6 +803,10 @@ bool construct::able_window(game *g, point p)
|
||||
g->m.ter(p.x, p.y) == t_window);
|
||||
}
|
||||
|
||||
bool construct::able_make_window(game *g, point p)
|
||||
{
|
||||
return able_window(g, p) || able_empty(g, p);
|
||||
}
|
||||
bool construct::able_empty_window(game *g, point p)
|
||||
{
|
||||
return (g->m.ter(p.x, p.y) == t_window_empty);
|
||||
@@ -742,12 +868,12 @@ bool construct::able_pit(game *g, point p)
|
||||
|
||||
bool construct::able_between_walls(game *g, point p)
|
||||
{
|
||||
return (g->m.has_flag(supports_roof, p.x -1, p.y) && g->m.has_flag(supports_roof, p.x +1, p.y) ||
|
||||
g->m.has_flag(supports_roof, p.x -1, p.y) && g->m.has_flag(supports_roof, p.x, p.y +1) ||
|
||||
g->m.has_flag(supports_roof, p.x -1, p.y) && g->m.has_flag(supports_roof, p.x, p.y -1) ||
|
||||
g->m.has_flag(supports_roof, p.x +1, p.y) && g->m.has_flag(supports_roof, p.x, p.y +1) ||
|
||||
g->m.has_flag(supports_roof, p.x +1, p.y) && g->m.has_flag(supports_roof, p.x, p.y -1) ||
|
||||
g->m.has_flag(supports_roof, p.x, p.y -1) && g->m.has_flag(supports_roof, p.x, p.y +1));
|
||||
return ((g->m.has_flag(supports_roof, p.x -1, p.y) && g->m.has_flag(supports_roof, p.x +1, p.y)) ||
|
||||
(g->m.has_flag(supports_roof, p.x -1, p.y) && g->m.has_flag(supports_roof, p.x, p.y +1)) ||
|
||||
(g->m.has_flag(supports_roof, p.x -1, p.y) && g->m.has_flag(supports_roof, p.x, p.y -1)) ||
|
||||
(g->m.has_flag(supports_roof, p.x +1, p.y) && g->m.has_flag(supports_roof, p.x, p.y +1)) ||
|
||||
(g->m.has_flag(supports_roof, p.x +1, p.y) && g->m.has_flag(supports_roof, p.x, p.y -1)) ||
|
||||
(g->m.has_flag(supports_roof, p.x, p.y -1) && g->m.has_flag(supports_roof, p.x, p.y +1)));
|
||||
}
|
||||
|
||||
bool construct::able_deconstruct(game *g, point p)
|
||||
@@ -757,7 +883,7 @@ bool construct::able_deconstruct(game *g, point p)
|
||||
|
||||
void construct::done_window_pane(game *g, point p)
|
||||
{
|
||||
g->m.add_item(g->u.posx, g->u.posy, g->itypes[itm_glass_sheet], 0);
|
||||
g->m.spawn_item(g->u.posx, g->u.posy, g->itypes["glass_sheet"], 0);
|
||||
}
|
||||
|
||||
void construct::done_furniture(game *g, point p)
|
||||
@@ -780,8 +906,8 @@ void construct::done_furniture(game *g, point p)
|
||||
break;
|
||||
}
|
||||
|
||||
g->m.ter(x, y) = g->m.ter(p.x, p.y);
|
||||
g->m.ter(p.x, p.y) = t_floor;
|
||||
g->m.ter_set(x, y, g->m.ter(p.x, p.y));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
|
||||
//Move all Items within a container
|
||||
std::vector <item> vItemMove = g->m.i_at(p.x, p.y);
|
||||
@@ -803,13 +929,13 @@ void construct::done_tree(game *g, point p)
|
||||
std::vector<point> tree = line_to(p.x, p.y, x, y, rng(1, 8));
|
||||
for (int i = 0; i < tree.size(); i++) {
|
||||
g->m.destroy(g, tree[i].x, tree[i].y, true);
|
||||
g->m.ter(tree[i].x, tree[i].y) = t_log;
|
||||
g->m.ter_set(tree[i].x, tree[i].y, t_log);
|
||||
}
|
||||
}
|
||||
|
||||
void construct::done_log(game *g, point p)
|
||||
{
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_log], int(g->turn), rng(5, 15));
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["log"], int(g->turn), rng(5, 15));
|
||||
}
|
||||
|
||||
|
||||
@@ -832,13 +958,13 @@ void construct::done_tape(game *g, point p)
|
||||
switch (g->m.ter(p.x, p.y))
|
||||
{
|
||||
case t_window_alarm:
|
||||
g->m.ter(p.x, p.y) = t_window_alarm_taped;
|
||||
g->m.ter_set(p.x, p.y, t_window_alarm_taped);
|
||||
|
||||
case t_window_domestic:
|
||||
g->m.ter(p.x, p.y) = t_window_domestic_taped;
|
||||
g->m.ter_set(p.x, p.y, t_window_domestic_taped);
|
||||
|
||||
case t_window:
|
||||
g->m.ter(p.x, p.y) = t_window_taped;
|
||||
g->m.ter_set(p.x, p.y, t_window_taped);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -851,91 +977,91 @@ void construct::done_deconstruct(game *g, point p)
|
||||
case t_makeshift_bed:
|
||||
case t_bed:
|
||||
case t_armchair:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_2x4], 0, 9);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_rag], 0, 9);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, rng(6,8));
|
||||
g->m.ter(p.x, p.y) = t_floor;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["2x4"], 0, 9);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["rag"], 0, 9);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["nail"], 0, 0, rng(6,8));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_door_c:
|
||||
case t_door_o:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_2x4], 0, 3);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, rng(6,12));
|
||||
g->m.ter(p.x, p.y) = t_door_frame;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["2x4"], 0, 3);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["nail"], 0, 0, rng(6,12));
|
||||
g->m.ter_set(p.x, p.y, t_door_frame);
|
||||
break;
|
||||
case t_window_domestic:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_stick], 0);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_sheet], 0, 1);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_glass_sheet], 0);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, 3);
|
||||
g->m.ter(p.x, p.y) = t_window_empty;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["stick"], 0);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["sheet"], 0, 1);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["glass_sheet"], 0);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["nail"], 0, 0, 3);
|
||||
g->m.ter_set(p.x, p.y, t_window_empty);
|
||||
break;
|
||||
|
||||
case t_window:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_glass_sheet], 0);
|
||||
g->m.ter(p.x, p.y) = t_window_empty;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["glass_sheet"], 0);
|
||||
g->m.ter_set(p.x, p.y, t_window_empty);
|
||||
break;
|
||||
|
||||
case t_backboard:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_2x4], 0, 4);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, rng(6,10));
|
||||
g->m.ter(p.x, p.y) = t_pavement;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["2x4"], 0, 4);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["nail"], 0, 0, rng(6,10));
|
||||
g->m.ter_set(p.x, p.y, t_pavement);
|
||||
break;
|
||||
|
||||
case t_sandbox:
|
||||
case t_bench:
|
||||
case t_crate_o:
|
||||
case t_crate_c:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_2x4], 0, 4);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, rng(6,10));
|
||||
g->m.ter(p.x, p.y) = t_floor;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["2x4"], 0, 4);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["nail"], 0, 0, rng(6,10));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_chair:
|
||||
case t_cupboard:
|
||||
case t_desk:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_2x4], 0, 4);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, rng(6,10));
|
||||
g->m.ter(p.x, p.y) = t_floor;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["2x4"], 0, 4);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["nail"], 0, 0, rng(6,10));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_slide:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_steel_plate], 0);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_pipe], 0, rng(4,8));
|
||||
g->m.ter(p.x, p.y) = t_grass;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["steel_plate"], 0);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["pipe"], 0, rng(4,8));
|
||||
g->m.ter_set(p.x, p.y, t_grass);
|
||||
break;
|
||||
|
||||
case t_rack:
|
||||
case t_monkey_bars:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_pipe], 0, rng(6,12));
|
||||
g->m.ter(p.x, p.y) = t_grass;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["pipe"], 0, rng(6,12));
|
||||
g->m.ter_set(p.x, p.y, t_grass);
|
||||
break;
|
||||
|
||||
case t_fridge:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_scrap], 0, rng(2,6));
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_steel_chunk], 0, rng(2,3));
|
||||
g->m.ter(p.x, p.y) = t_floor;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["scrap"], 0, rng(2,6));
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["steel_chunk"], 0, rng(2,3));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_counter:
|
||||
case t_dresser:
|
||||
case t_table:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_2x4], 0, 6);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, rng(6,8));
|
||||
g->m.ter(p.x, p.y) = t_floor;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["2x4"], 0, 6);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["nail"], 0, 0, rng(6,8));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_pool_table:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_2x4], 0, 4);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_rag], 0, 4);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, rng(6,10));
|
||||
g->m.ter(p.x, p.y) = t_floor;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["2x4"], 0, 4);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["rag"], 0, 4);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["nail"], 0, 0, rng(6,10));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_bookcase:
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_2x4], 0, 12);
|
||||
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, rng(12,16));
|
||||
g->m.ter(p.x, p.y) = t_floor;
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["2x4"], 0, 12);
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["nail"], 0, 0, rng(12,16));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
}
|
||||
|
||||
|
||||
+2
-1
@@ -8,7 +8,7 @@ struct construction_stage
|
||||
{
|
||||
ter_id terrain;
|
||||
int time; // In minutes, i.e. 10 turns
|
||||
std::vector<itype_id> tools[3];
|
||||
std::vector<component> tools[3];
|
||||
std::vector<component> components[3];
|
||||
|
||||
construction_stage(ter_id Terrain, int Time) :
|
||||
@@ -39,6 +39,7 @@ struct construct // Construction functions.
|
||||
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
|
||||
|
||||
+2390
-1418
File diff suppressed because it is too large
Load Diff
+4
-4
@@ -27,7 +27,7 @@ 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) {}
|
||||
};
|
||||
|
||||
@@ -41,12 +41,12 @@ struct recipe {
|
||||
int time;
|
||||
bool reversible; // can the item be disassembled?
|
||||
|
||||
std::vector<component> tools[5];
|
||||
std::vector<component> components[10];
|
||||
std::vector<component> tools[20];
|
||||
std::vector<component> components[20];
|
||||
|
||||
recipe() {
|
||||
id = 0;
|
||||
result = itm_null;
|
||||
result = "null";
|
||||
category = CC_NULL;
|
||||
sk_primary = NULL;
|
||||
sk_secondary = NULL;
|
||||
|
||||
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
|
||||
@@ -1,17 +1,18 @@
|
||||
# This message may be 16 lines long at maximum.
|
||||
# Max length of a line is 64 characters; the following line is for reference
|
||||
################################################################
|
||||
This branch contains much work by Creidieki, Uzername,
|
||||
Kevingranade, HerbertJones, Gim, Shades and Origamiwolf.
|
||||
# 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.
|
||||
|
||||
The game now has configurable options.
|
||||
You can directly edit options.txt in the data directory, or you
|
||||
can edit the options via the help menu.
|
||||
For latest discussions and news on Cataclysm DDA, please visit:
|
||||
|
||||
For latest discussions on Cataclysm and its mods, please visit:
|
||||
http://www.cataclysm.glyphgryph.com/smf/index.php
|
||||
Homepage: http://www.cataclysmdda.com/
|
||||
Forum: http://www.cataclysmdda.com/smf/
|
||||
Wiki: http://wiki.cataclysmdda.com/
|
||||
|
||||
Check out the options listing by pressing ?2
|
||||
The game now has new configurable options:
|
||||
Customizeable Viewport, Spawntype: Classic/Static, Starting time
|
||||
|
||||
As always, please visit the forums at:
|
||||
http://www.cataclysmdda.com/smf/index.php
|
||||
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 }
|
||||
]
|
||||
}
|
||||
]
|
||||
@@ -91,6 +91,7 @@
|
||||
{ "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" },
|
||||
|
||||
@@ -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"]
|
||||
}
|
||||
]
|
||||
+53
-51
@@ -79,6 +79,8 @@ bool defense_game::init(game *g)
|
||||
setup();
|
||||
g->u.cash = initial_cash;
|
||||
popup_nowait("Please wait as the map generates [ 0%]");
|
||||
// TODO: support multiple defence games? clean up old defence game
|
||||
g->cur_om = overmap(g, 0, 0);
|
||||
init_map(g);
|
||||
caravan(g);
|
||||
return true;
|
||||
@@ -155,10 +157,10 @@ void defense_game::game_over(game *g)
|
||||
|
||||
void defense_game::init_itypes(game *g)
|
||||
{
|
||||
g->itypes[itm_2x4]->volume = 0;
|
||||
g->itypes[itm_2x4]->weight = 0;
|
||||
g->itypes[itm_landmine]->price = 300;
|
||||
g->itypes[itm_bot_turret]->price = 6000;
|
||||
g->itypes["2x4"]->volume = 0;
|
||||
g->itypes["2x4"]->weight = 0;
|
||||
g->itypes["landmine"]->price = 300;
|
||||
g->itypes["bot_turret"]->price = 6000;
|
||||
}
|
||||
|
||||
void defense_game::init_mtypes(game *g)
|
||||
@@ -193,12 +195,12 @@ void defense_game::init_map(game *g)
|
||||
{
|
||||
for (int x = 0; x < OMAPX; x++) {
|
||||
for (int y = 0; y < OMAPY; y++) {
|
||||
g->cur_om.ter(x, y) = ot_field;
|
||||
g->cur_om.seen(x, y) = true;
|
||||
g->cur_om.ter(x, y, 0) = ot_field;
|
||||
g->cur_om.seen(x, y, 0) = true;
|
||||
}
|
||||
}
|
||||
|
||||
g->cur_om.save(g->u.name, 0, 0, DEFENSE_Z);
|
||||
g->cur_om.save();
|
||||
g->levx = 100;
|
||||
g->levy = 100;
|
||||
g->levz = 0;
|
||||
@@ -210,29 +212,29 @@ void defense_game::init_map(game *g)
|
||||
case DEFLOC_HOSPITAL:
|
||||
for (int x = 49; x <= 51; x++) {
|
||||
for (int y = 49; y <= 51; y++)
|
||||
g->cur_om.ter(x, y) = ot_hospital;
|
||||
g->cur_om.ter(x, y, 0) = ot_hospital;
|
||||
}
|
||||
g->cur_om.ter(50, 49) = ot_hospital_entrance;
|
||||
g->cur_om.ter(50, 49, 0) = ot_hospital_entrance;
|
||||
break;
|
||||
|
||||
case DEFLOC_MALL:
|
||||
for (int x = 49; x <= 51; x++) {
|
||||
for (int y = 49; y <= 51; y++)
|
||||
g->cur_om.ter(x, y) = ot_megastore;
|
||||
g->cur_om.ter(x, y, 0) = ot_megastore;
|
||||
}
|
||||
g->cur_om.ter(50, 49) = ot_megastore_entrance;
|
||||
g->cur_om.ter(50, 49, 0) = ot_megastore_entrance;
|
||||
break;
|
||||
|
||||
case DEFLOC_BAR:
|
||||
g->cur_om.ter(50, 50) = ot_bar_north;
|
||||
g->cur_om.ter(50, 50, 0) = ot_bar_north;
|
||||
break;
|
||||
|
||||
case DEFLOC_MANSION:
|
||||
for (int x = 49; x <= 51; x++) {
|
||||
for (int y = 49; y <= 51; y++)
|
||||
g->cur_om.ter(x, y) = ot_mansion;
|
||||
g->cur_om.ter(x, y, 0) = ot_mansion;
|
||||
}
|
||||
g->cur_om.ter(50, 49) = ot_mansion_entrance;
|
||||
g->cur_om.ter(50, 49, 0) = ot_mansion_entrance;
|
||||
break;
|
||||
}
|
||||
// Init the map
|
||||
@@ -251,14 +253,14 @@ void defense_game::init_map(game *g)
|
||||
mx -= mx % 2;
|
||||
my -= my % 2;
|
||||
tinymap tm(&g->itypes, &g->mapitems, &g->traps);
|
||||
tm.generate(g, &(g->cur_om), mx, my, int(g->turn));
|
||||
tm.generate(g, &(g->cur_om), mx, my, 0, int(g->turn));
|
||||
tm.clear_spawns();
|
||||
tm.clear_traps();
|
||||
tm.save(&g->cur_om, int(g->turn), mx, my);
|
||||
tm.save(&g->cur_om, int(g->turn), mx, my, 0);
|
||||
}
|
||||
}
|
||||
|
||||
g->m.load(g, g->levx, g->levy);
|
||||
g->m.load(g, g->levx, g->levy, g->levz, true);
|
||||
|
||||
g->update_map(g->u.posx, g->u.posy);
|
||||
monster generator(g->mtypes[mon_generator], g->u.posx + 1, g->u.posy + 1);
|
||||
@@ -995,7 +997,7 @@ Press Enter to buy everything in your cart, Esc to buy nothing.");
|
||||
for (int j = 0; j < item_count[0][i]; j++) {
|
||||
if (g->u.volume_carried() + tmp.volume() <= g->u.volume_capacity() &&
|
||||
g->u.weight_carried() + tmp.weight() <= g->u.weight_capacity() &&
|
||||
g->u.inv.size() < 52)
|
||||
g->u.inv.size() < inv_chars.size())
|
||||
g->u.i_add(tmp);
|
||||
else { // Could fit it in the inventory!
|
||||
dropped_some = true;
|
||||
@@ -1031,50 +1033,50 @@ std::vector<itype_id> caravan_items(caravan_category cat)
|
||||
|
||||
case CARAVAN_MELEE:
|
||||
setvector(ret,
|
||||
itm_hammer, itm_bat, itm_mace, itm_morningstar, itm_hammer_sledge, itm_hatchet,
|
||||
itm_knife_combat, itm_rapier, itm_machete, itm_katana, itm_spear_knife,
|
||||
itm_pike, itm_chainsaw_off, NULL);
|
||||
"hammer", "bat", "mace", "morningstar", "hammer_sledge", "hatchet",
|
||||
"knife_combat", "rapier", "machete", "katana", "spear_knife",
|
||||
"pike", "chainsaw_off", NULL);
|
||||
break;
|
||||
|
||||
case CARAVAN_GUNS:
|
||||
setvector(ret,
|
||||
itm_crossbow, itm_bolt_steel, itm_compbow, itm_arrow_cf, itm_marlin_9a,
|
||||
itm_22_lr, itm_hk_mp5, itm_9mm, itm_taurus_38, itm_38_special, itm_deagle_44,
|
||||
itm_44magnum, itm_m1911, itm_hk_ump45, itm_45_acp, itm_fn_p90, itm_57mm,
|
||||
itm_remington_870, itm_shot_00, itm_shot_slug, itm_browning_blr, itm_3006,
|
||||
itm_ak47, itm_762_m87, itm_m4a1, itm_556, itm_savage_111f, itm_hk_g3,
|
||||
itm_762_51, itm_hk_g80, itm_12mm, itm_plasma_rifle, itm_plasma, NULL);
|
||||
"crossbow", "bolt_steel", "compbow", "arrow_cf", "marlin_9a",
|
||||
"22_lr", "hk_mp5", "9mm", "taurus_38", "38_special", "deagle_44",
|
||||
"44magnum", "m1911", "hk_ump45", "45_acp", "fn_p90", "57mm",
|
||||
"remington_870", "shot_00", "shot_slug", "browning_blr", "3006",
|
||||
"ak47", "762_m87", "m4a1", "556", "savage_111f", "hk_g3",
|
||||
"762_51", "hk_g80", "12mm", "plasma_rifle", "plasma", NULL);
|
||||
break;
|
||||
|
||||
case CARAVAN_COMPONENTS:
|
||||
setvector(ret,
|
||||
itm_rag, itm_fur, itm_leather, itm_superglue, itm_string_36, itm_chain,
|
||||
itm_processor, itm_RAM, itm_power_supply, itm_motor, itm_hose, itm_pot,
|
||||
itm_2x4, itm_battery, itm_nail, itm_gasoline, NULL);
|
||||
"rag", "fur", "leather", "superglue", "string_36", "chain",
|
||||
"processor", "RAM", "power_supply", "motor", "hose", "pot",
|
||||
"2x4", "battery", "nail", "gasoline", NULL);
|
||||
break;
|
||||
|
||||
case CARAVAN_FOOD:
|
||||
setvector(ret,
|
||||
itm_1st_aid, itm_water, itm_energy_drink, itm_whiskey, itm_can_beans,
|
||||
itm_mre_beef, itm_flour, itm_inhaler, itm_codeine, itm_oxycodone, itm_adderall,
|
||||
itm_cig, itm_meth, itm_royal_jelly, itm_mutagen, itm_purifier, NULL);
|
||||
"1st_aid", "water", "energy_drink", "whiskey", "can_beans",
|
||||
"mre_beef", "flour", "inhaler", "codeine", "oxycodone", "adderall",
|
||||
"cig", "meth", "royal_jelly", "mutagen", "purifier", NULL);
|
||||
break;
|
||||
|
||||
case CARAVAN_CLOTHES:
|
||||
setvector(ret,
|
||||
itm_backpack, itm_vest, itm_trenchcoat, itm_jacket_leather, itm_kevlar,
|
||||
itm_gloves_fingerless, itm_mask_filter, itm_mask_gas, itm_glasses_eye,
|
||||
itm_glasses_safety, itm_goggles_ski, itm_goggles_nv, itm_helmet_ball,
|
||||
itm_helmet_riot, NULL);
|
||||
"backpack", "vest", "trenchcoat", "jacket_leather", "kevlar",
|
||||
"gloves_fingerless", "mask_filter", "mask_gas", "glasses_eye",
|
||||
"glasses_safety", "goggles_ski", "goggles_nv", "helmet_ball",
|
||||
"helmet_riot", NULL);
|
||||
break;
|
||||
|
||||
case CARAVAN_TOOLS:
|
||||
setvector(ret,
|
||||
itm_screwdriver, itm_wrench, itm_saw, itm_hacksaw, itm_lighter, itm_sewing_kit,
|
||||
itm_scissors, itm_extinguisher, itm_flashlight, itm_hotplate,
|
||||
itm_soldering_iron, itm_shovel, itm_jackhammer, itm_landmine, itm_teleporter,
|
||||
itm_grenade, itm_flashbang, itm_EMPbomb, itm_smokebomb, itm_bot_manhack,
|
||||
itm_bot_turret, itm_UPS_off, itm_mininuke, NULL);
|
||||
"screwdriver", "wrench", "saw", "hacksaw", "lighter", "sewing_kit",
|
||||
"scissors", "extinguisher", "flashlight", "hotplate",
|
||||
"soldering_iron", "shovel", "jackhammer", "landmine", "teleporter",
|
||||
"grenade", "flashbang", "EMPbomb", "smokebomb", "bot_manhack",
|
||||
"bot_turret", "UPS_off", "mininuke", NULL);
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -1187,7 +1189,7 @@ void draw_caravan_items(WINDOW *w, game *g, std::vector<itype_id> *items,
|
||||
int caravan_price(player &u, int price) {
|
||||
if (u.skillLevel("barter") > 10)
|
||||
return int( double(price) * .5);
|
||||
return int( double(price) * (1.0 - double(u.skillLevel("barter").level()) * .05));
|
||||
return int( double(price) * (1.0 - double(u.skillLevel("barter")) * .05));
|
||||
}
|
||||
|
||||
void defense_game::spawn_wave(game *g)
|
||||
@@ -1234,28 +1236,28 @@ void defense_game::spawn_wave(game *g)
|
||||
|
||||
std::vector<mon_id> defense_game::pick_monster_wave(game *g)
|
||||
{
|
||||
std::vector<moncat_id> valid;
|
||||
std::vector<std::string> valid;
|
||||
std::vector<mon_id> ret;
|
||||
|
||||
if (zombies || specials) {
|
||||
if (specials)
|
||||
valid.push_back(mcat_zombie);
|
||||
valid.push_back("GROUP_ZOMBIE");
|
||||
else
|
||||
valid.push_back(mcat_vanilla_zombie);
|
||||
valid.push_back("GROUP_VANILLA");
|
||||
}
|
||||
if (spiders)
|
||||
valid.push_back(mcat_spider);
|
||||
valid.push_back("GROUP_SPIDER");
|
||||
if (triffids)
|
||||
valid.push_back(mcat_triffid);
|
||||
valid.push_back("GROUP_TRIFFID");
|
||||
if (robots)
|
||||
valid.push_back(mcat_robot);
|
||||
valid.push_back("GROUP_ROBOT");
|
||||
if (subspace)
|
||||
valid.push_back(mcat_nether);
|
||||
valid.push_back("GROUP_NETHER");
|
||||
|
||||
if (valid.empty())
|
||||
debugmsg("Couldn't find a valid monster group for defense!");
|
||||
else
|
||||
ret = g->moncats[ valid[rng(0, valid.size() - 1)] ];
|
||||
ret = MonsterGroupManager::GetMonstersFromGroup(valid[rng(0, valid.size() - 1)]);
|
||||
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ struct talk_function
|
||||
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
|
||||
@@ -58,6 +59,7 @@ struct talk_function
|
||||
void start_training (game *g, npc *p);
|
||||
|
||||
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);
|
||||
|
||||
+242
-74
@@ -79,6 +79,17 @@ void dis_msg(game *g, dis_type type)
|
||||
case DI_STEMCELL_TREATMENT:
|
||||
g->add_msg("You receive a pureed bone & enamel injection into your eyeball.");
|
||||
g->add_msg("It is excruciating.");
|
||||
case DI_BITE:
|
||||
g->add_msg("The bite wound feels really deep...");
|
||||
break;
|
||||
case DI_INFECTED:
|
||||
g->add_msg("Your bite wound feels infected");
|
||||
break;
|
||||
case DI_LIGHTSNARE:
|
||||
g->add_msg("You are snared.");
|
||||
break;
|
||||
case DI_HEAVYSNARE:
|
||||
g->add_msg("You are snared.");
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
@@ -106,6 +117,14 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_COLD_MOUTH:
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.per_cur -= 3; if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your face is stiff from the cold.");
|
||||
case 2 : p.per_cur--;
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_COLD_TORSO:
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.dex_cur -= 2; if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your torso is burning up. You should remove some layers.");
|
||||
@@ -120,15 +139,15 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
case DI_COLD_ARMS:
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.dex_cur -= 2;
|
||||
case 2 : p.dex_cur--;
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("Your arms are shivering.");
|
||||
case 2 : p.dex_cur--; if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your arms are shivering.");
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("Your arms have goosebumps.");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_COLD_HANDS:
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.dex_cur -= 2;
|
||||
case 2 : p.dex_cur -= 2;
|
||||
case 2 : p.dex_cur -= 2; if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your hands are shivering.");
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
|
||||
}
|
||||
break;
|
||||
@@ -156,7 +175,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
switch (dis.intensity) {
|
||||
case 2 : p.dex_cur -= 3;
|
||||
case 1 :
|
||||
if (p.temp_cur[bp_mouth] > BODYTEMP_COLD && p.pain < 40) p.pain++;
|
||||
if (p.temp_cur[bp_hands] > BODYTEMP_COLD && p.pain < 40) p.pain++;
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your hands feel numb.");
|
||||
}
|
||||
break;
|
||||
@@ -165,7 +184,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
switch (dis.intensity) {
|
||||
case 2 : // -4 speed
|
||||
case 1 :
|
||||
if (p.temp_cur[bp_mouth] > BODYTEMP_COLD && p.pain < 40) p.pain++;
|
||||
if (p.temp_cur[bp_feet] > BODYTEMP_COLD && p.pain < 40) p.pain++;
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your feet feel numb.");
|
||||
}
|
||||
break;
|
||||
@@ -212,12 +231,21 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
if (p.pain < 20) p.pain++;
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("The heat is making you see things.");
|
||||
// Speed -5
|
||||
case 1 :
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
|
||||
case 1 :
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot.\"");
|
||||
// Speed -2
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_HOT_MOUTH:
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.thirst--;
|
||||
if (p.pain < 50) p.pain++;
|
||||
case 2 : p.thirst--;
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot.\"");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_HOT_TORSO:
|
||||
switch (dis.intensity) {
|
||||
case 3 :
|
||||
@@ -229,8 +257,8 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
p.thirst--;
|
||||
p.str_cur--;
|
||||
// Speed -5
|
||||
case 1 :
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
|
||||
case 1 :
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot.\"");
|
||||
// Speed -2
|
||||
}
|
||||
break;
|
||||
@@ -240,7 +268,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
case 3 : p.thirst--;
|
||||
if (p.pain < 50) p.pain++;
|
||||
case 2 : p.thirst--;
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot.\"");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -248,7 +276,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.dex_cur--;
|
||||
case 2 : p.dex_cur--;
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot.\"");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -258,23 +286,25 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
if (p.pain < 50) p.pain++;
|
||||
if (one_in(200)) g->add_msg("Your legs are cramping up.");
|
||||
case 2 : p.thirst--;
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot.\"");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_HOT_FEET:
|
||||
switch (dis.intensity) {
|
||||
case 3 : if (p.pain < 50) p.pain++;
|
||||
case 2 :
|
||||
case 2 :
|
||||
if (p.pain < 30) p.pain++;
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your feet are swelling in the heat.");
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot.\"");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_COMMON_COLD:
|
||||
if (int(g->turn) % 300 == 0)
|
||||
p.thirst++;
|
||||
if (int(g->turn) % 50 == 0)
|
||||
p.fatigue++;
|
||||
if (p.has_disease(DI_TOOK_FLUMED)) {
|
||||
p.str_cur--;
|
||||
p.int_cur--;
|
||||
@@ -493,7 +523,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
dis.duration = dice(3, 100);
|
||||
}
|
||||
}
|
||||
if (int(g->turn) % 100 == 0 && !p.has_bionic(bio_recycler)) {
|
||||
if (int(g->turn) % 100 == 0 && !p.has_bionic("bio_recycler")) {
|
||||
// Hunger and thirst advance more slowly while we sleep.
|
||||
p.hunger--;
|
||||
p.thirst--;
|
||||
@@ -513,7 +543,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
|
||||
case DI_STEMCELL_TREATMENT:
|
||||
//slightly repair broken limbs. (also nonbroken limbs (unless they're too healthy))
|
||||
for (int i = 0; i < num_hp_parts; i++) {
|
||||
@@ -622,7 +652,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
break;
|
||||
|
||||
case DI_BLEED:
|
||||
if (!p.is_npc() && one_in(2)) {
|
||||
if (!p.is_npc() && one_in(6)) {
|
||||
g->add_msg("You lose some blood.");
|
||||
p.pain++;
|
||||
p.hurt(g, bp_torso, 0, 1);
|
||||
@@ -877,8 +907,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
}
|
||||
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)];
|
||||
mon_id type = MonsterGroupManager::GetMonsterFromGroup("GROUP_NETHER", &g->mtypes);
|
||||
monster beast(g->mtypes[type]);
|
||||
int x, y, tries = 0;
|
||||
do {
|
||||
@@ -889,7 +918,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
tries < 10);
|
||||
if (tries < 10) {
|
||||
if (g->m.move_cost(x, y) == 0)
|
||||
g->m.ter(x, y) = t_rubble;
|
||||
g->m.ter_set(x, y, t_rubble);
|
||||
beast.spawn(x, y);
|
||||
g->z.push_back(beast);
|
||||
if (g->u_see(x, y, junk)) {
|
||||
@@ -940,8 +969,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
case DI_ATTENTION:
|
||||
if (one_in( 100000 / dis.duration ) && one_in( 100000 / dis.duration ) &&
|
||||
one_in(250)) {
|
||||
int range = g->moncats[mcat_nether].size();
|
||||
mon_id type = (g->moncats[mcat_nether])[rng(0, range - 1)];
|
||||
mon_id type = MonsterGroupManager::GetMonsterFromGroup("GROUP_NETHER", &g->mtypes);
|
||||
monster beast(g->mtypes[type]);
|
||||
int x, y, tries = 0, junk;
|
||||
do {
|
||||
@@ -952,7 +980,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
tries < 10);
|
||||
if (tries < 10) {
|
||||
if (g->m.move_cost(x, y) == 0)
|
||||
g->m.ter(x, y) = t_rubble;
|
||||
g->m.ter_set(x, y, t_rubble);
|
||||
beast.spawn(x, y);
|
||||
g->z.push_back(beast);
|
||||
if (g->u_see(x, y, junk)) {
|
||||
@@ -1002,6 +1030,118 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
p.per_cur -= (dis.duration > 4000 ? 10 : int(dis.duration / 400));
|
||||
}
|
||||
} break;
|
||||
|
||||
case DI_BITE:
|
||||
//3600 (6-hour) lifespan
|
||||
if (dis.duration > 2400) { // First symptoms for 2 hours
|
||||
if (one_in(300)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("Your bite wound really hurts.");
|
||||
}
|
||||
} else if (dis.duration > 1200) { //Pain at 4 hours in
|
||||
if (one_in(100)) {
|
||||
if (!p.is_npc())
|
||||
if (p.has_disease(DI_SLEEP)) {
|
||||
p.rem_disease(DI_SLEEP);
|
||||
g->add_msg("You wake up.");
|
||||
}
|
||||
g->add_msg("Your bite wound feels swollen and painful.");
|
||||
if(p.pain < 20)
|
||||
p.pain++;
|
||||
}
|
||||
|
||||
p.dex_cur-= 1;
|
||||
} else { // Infection starts
|
||||
p.rem_disease(DI_BITE);
|
||||
p.add_disease(DI_INFECTED, 14400, g); // 1 day of timer
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_LIGHTSNARE:
|
||||
p.moves = -500;
|
||||
if(one_in(10)) {
|
||||
g->add_msg("You attempt to free yourself from the snare.");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_HEAVYSNARE:
|
||||
p.moves = -500;
|
||||
if(one_in(20)) {
|
||||
g->add_msg("You attempt to free yourself from the snare.");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_INFECTED:
|
||||
p.dex_cur-= 1;
|
||||
if (dis.duration > 10800) { // Infection Symptoms 6 hours into infection
|
||||
if (one_in(300)) {
|
||||
if (!p.is_npc()) {
|
||||
if (p.has_disease(DI_SLEEP)) {
|
||||
p.rem_disease(DI_SLEEP);
|
||||
g->add_msg("You wake up.");
|
||||
}
|
||||
g->add_msg("Your infected wound is incredibly painful.");
|
||||
}
|
||||
if(p.pain < 40)
|
||||
p.pain++;
|
||||
}
|
||||
p.str_cur-= 1;
|
||||
p.dex_cur-= 1;
|
||||
|
||||
} else if (dis.duration > 7200) { //Infection Symptoms 12 hours into infection
|
||||
if (one_in(100)) {
|
||||
if (!p.is_npc()) {
|
||||
if (p.has_disease(DI_SLEEP)) {
|
||||
p.rem_disease(DI_SLEEP);
|
||||
g->add_msg("You wake up.");
|
||||
}
|
||||
g->add_msg("You feel feverish and nauseous, your wound has begun to turn green.");
|
||||
}
|
||||
p.vomit(g);
|
||||
if(p.pain < 60)
|
||||
p.pain++;
|
||||
}
|
||||
p.str_cur-= 2;
|
||||
p.dex_cur-= 2;
|
||||
|
||||
} else if (dis.duration > 3600) { //Infection Symptoms 18 hours into infection
|
||||
if (one_in(100)) {
|
||||
if (!p.is_npc()) {
|
||||
if (p.has_disease(DI_SLEEP)) {
|
||||
p.rem_disease(DI_SLEEP);
|
||||
g->add_msg("You wake up.");
|
||||
g->add_msg("You feel terribly weak, standing up is nearly impossible.");
|
||||
} else {
|
||||
g->add_msg("You can barely remain standing.");
|
||||
}
|
||||
}
|
||||
p.vomit(g);
|
||||
if(p.pain < 100)
|
||||
{
|
||||
p.pain++;
|
||||
}
|
||||
}
|
||||
p.str_cur-= 2;
|
||||
p.dex_cur-= 2;
|
||||
|
||||
if(one_in(10)) {
|
||||
if (p.has_disease(DI_SLEEP))
|
||||
p.rem_disease(DI_SLEEP);
|
||||
g->add_msg("You pass out.");
|
||||
p.add_disease(DI_SLEEP, 60, g);
|
||||
}
|
||||
} else { // You die. 24 hours after infection Total time, 30 hours including bite.
|
||||
if (p.has_disease(DI_SLEEP))
|
||||
p.rem_disease(DI_SLEEP);
|
||||
g->add_msg("You succumb to the infection.");
|
||||
p.hurtall(500);
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_RECOVER:
|
||||
p.str_cur-= 1;
|
||||
p.dex_cur-= 1;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1051,32 +1191,37 @@ std::string dis_name(disease dis)
|
||||
switch (dis.type) {
|
||||
case DI_NULL: return "";
|
||||
case DI_GLARE: return "Glare";
|
||||
case DI_COLD_HEAD:
|
||||
case DI_COLD_HEAD:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold head";
|
||||
case 2: return "Cold head!";
|
||||
case 3: return "Freezing head!!";}
|
||||
case DI_COLD_TORSO:
|
||||
case 3: return "Freezing head!!";}
|
||||
case DI_COLD_MOUTH:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold face";
|
||||
case 2: return "Cold face!";
|
||||
case 3: return "Freezing face!!";}
|
||||
case DI_COLD_TORSO:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold torso";
|
||||
case 2: return "Cold torso!";
|
||||
case 3: return "Freezing torso!!";}
|
||||
case DI_COLD_ARMS:
|
||||
case 3: return "Freezing torso!!";}
|
||||
case DI_COLD_ARMS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold arms";
|
||||
case 2: return "Cold arms!";
|
||||
case 3: return "Freezing arms!!";}
|
||||
case DI_COLD_HANDS:
|
||||
case 3: return "Freezing arms!!";}
|
||||
case DI_COLD_HANDS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold hands";
|
||||
case 2: return "Cold hands!";
|
||||
case 3: return "Freezing hands!!";}
|
||||
case DI_COLD_LEGS:
|
||||
case 3: return "Freezing hands!!";}
|
||||
case DI_COLD_LEGS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold legs";
|
||||
case 2: return "Cold legs!";
|
||||
case 3: return "Freezing legs!!";}
|
||||
case DI_COLD_FEET:
|
||||
case 3: return "Freezing legs!!";}
|
||||
case DI_COLD_FEET:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold feet";
|
||||
case 2: return "Cold feet!";
|
||||
@@ -1093,36 +1238,41 @@ std::string dis_name(disease dis)
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Frostnip - face";
|
||||
case 2: return "Frostbite - face";}
|
||||
case DI_HOT_HEAD:
|
||||
case DI_HOT_HEAD:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot head";
|
||||
case 2: return "Hot head!";
|
||||
case 3: return "Scorching head!!";}
|
||||
case DI_HOT_TORSO:
|
||||
case 3: return "Scorching head!!";}
|
||||
case DI_HOT_MOUTH:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot face";
|
||||
case 2: return "Hot face!";
|
||||
case 3: return "Scorching face!!";}
|
||||
case DI_HOT_TORSO:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot torso";
|
||||
case 2: return "Hot torso!";
|
||||
case 3: return "Scorching torso!!";}
|
||||
case DI_HOT_ARMS:
|
||||
case 3: return "Scorching torso!!";}
|
||||
case DI_HOT_ARMS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot arms";
|
||||
case 2: return "Hot arms!";
|
||||
case 3: return "Scorching arms!!";}
|
||||
case DI_HOT_HANDS:
|
||||
case 3: return "Scorching arms!!";}
|
||||
case DI_HOT_HANDS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot hands";
|
||||
case 2: return "Hot hands!";
|
||||
case 3: return "Scorching hands!!";}
|
||||
case DI_HOT_LEGS:
|
||||
case 3: return "Scorching hands!!";}
|
||||
case DI_HOT_LEGS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot legs";
|
||||
case 2: return "Hot legs!";
|
||||
case 3: return "Scorching legs!!";}
|
||||
case DI_HOT_FEET:
|
||||
case 3: return "Scorching legs!!";}
|
||||
case DI_HOT_FEET:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot feet";
|
||||
case 2: return "Hot feet!";
|
||||
case 3: return "Scorching feet!!";}
|
||||
case 3: return "Scorching feet!!";}
|
||||
case DI_BLISTERS_MOUTH: return "Blisters - face";
|
||||
case DI_BLISTERS_TORSO: return "Blisters - torso";
|
||||
case DI_BLISTERS_ARMS: return "Blisters - arms";
|
||||
@@ -1189,6 +1339,15 @@ std::string dis_name(disease dis)
|
||||
case 2: return "Viper Strike Unlocked!";
|
||||
default: return "VIPER BUG!!!!";
|
||||
}
|
||||
case DI_BITE:
|
||||
if (dis.duration > 3000) return "Bite Wound";
|
||||
return "Painful Bite Wound";
|
||||
case DI_INFECTED:
|
||||
if (dis.duration > 10800) return "Infected Wound";
|
||||
if (dis.duration > 7200) return "Painful Infected Wound";
|
||||
return "Puss Filled Wound";
|
||||
case DI_RECOVER: return "Recovering From Infection";
|
||||
|
||||
break;
|
||||
|
||||
default: return "";
|
||||
@@ -1207,49 +1366,43 @@ std::string dis_description(disease dis)
|
||||
case DI_GLARE:
|
||||
return "Perception - 1";
|
||||
|
||||
case DI_COLD_HEAD:
|
||||
case DI_COLD_HEAD:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your head is exposed to the cold.";
|
||||
case 2: return "Your head is very exposed to the cold. It is hard to concentrate.";
|
||||
case 3: return "Your head is dangerously cold. Getting undressed sounds like a good idea.";}
|
||||
|
||||
case DI_COLD_EYES:
|
||||
case DI_COLD_MOUTH:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your eyes are exposed to the cold.";
|
||||
case 2: return "Your eyes are very exposed to the cold.";
|
||||
case 3: return "Your eyes are dangerously cold.";}
|
||||
case 1: return "Your face is exposed to the cold.";
|
||||
case 2: return "Your face is very exposed to the cold.";
|
||||
case 3: return "Your face is dangerously cold.";}
|
||||
|
||||
case DI_COLD_MOUTH:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your mouth is exposed to the cold.";
|
||||
case 2: return "Your mouth is very exposed to the cold.";
|
||||
case 3: return "Your mouth is dangerously cold.";}
|
||||
|
||||
case DI_COLD_TORSO:
|
||||
case DI_COLD_TORSO:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your torso is exposed to the cold.";
|
||||
case 2: return "Your torso is very exposed to the cold. Your actions are incoordinated.";
|
||||
case 3: return "Your torso is dangerously cold. Your actions are incredibly incoordinated.";}
|
||||
|
||||
case DI_COLD_ARMS:
|
||||
case DI_COLD_ARMS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your arms are exposed to the cold.";
|
||||
case 2: return "Your arms are very exposed to the cold. Your arms are shivering.";
|
||||
case 3: return "Your arms is dangerously cold. Your arms are shivering uncontrollably";}
|
||||
|
||||
case DI_COLD_HANDS:
|
||||
case DI_COLD_HANDS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your hands are exposed to the cold.";
|
||||
case 2: return "Your hands are very exposed to the cold. Your hands are shivering.";
|
||||
case 3: return "Your hands is dangerously cold. Your hands are shivering uncontrollably";}
|
||||
|
||||
case DI_COLD_LEGS:
|
||||
case DI_COLD_LEGS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your legs are exposed to the cold.";
|
||||
case 2: return "Your legs are very exposed to the cold. Your strength is sapped.";
|
||||
case 3: return "Your legs is dangerously cold. Your strength is sapped.";}
|
||||
|
||||
case DI_COLD_FEET:
|
||||
case DI_COLD_FEET:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your feet are exposed to the cold.";
|
||||
case 2: return "Your feet are very exposed to the cold. Your strength is sapped.";
|
||||
@@ -1281,41 +1434,47 @@ std::string dis_description(disease dis)
|
||||
case DI_FROSTBITE_LEGS: return "\
|
||||
Your legs are frostbitten from prolonged exposure to the cold. It is extremely painful.";
|
||||
|
||||
case DI_HOT_HEAD:
|
||||
case DI_HOT_HEAD:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your head feels warm.";
|
||||
case 2: return "Your head is sweating from the heat. You feel nauseated. You have a headache.";
|
||||
case 3: return "Your head is sweating profusely. You feel very nauseated. You have a headache.";}
|
||||
case 3: return "Your head is sweating profusely. You feel very nauseated. You have a headache.";}
|
||||
|
||||
case DI_HOT_TORSO:
|
||||
case DI_HOT_MOUTH:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your face feels warm.";
|
||||
case 2: return "Your face is sweating from the heat, making it hard to see.";
|
||||
case 3: return "Your face is sweating profusely, making it hard to see.";}
|
||||
|
||||
case DI_HOT_TORSO:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your torso feels warm.";
|
||||
case 2: return "Your torso is sweating from the heat. You feel weak.";
|
||||
case 3: return "Your torso is sweating profusely. You feel very weak.";}
|
||||
case 3: return "Your torso is sweating profusely. You feel very weak.";}
|
||||
|
||||
case DI_HOT_ARMS:
|
||||
case DI_HOT_ARMS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your arms feel warm.";
|
||||
case 2: return "Your arms are sweating from the heat.";
|
||||
case 3: return "Your arms are sweating profusely. Your muscles are in pain due to cramps.";}
|
||||
case 3: return "Your arms are sweating profusely. Your muscles are in pain due to cramps.";}
|
||||
|
||||
case DI_HOT_HANDS:
|
||||
case DI_HOT_HANDS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your hands feel warm.";
|
||||
case 2: return "Your hands feel hot and incoordinated.";
|
||||
case 3: return "Your hands feel disgustinly hot and are very incoordinated.";}
|
||||
case 3: return "Your hands feel disgustinly hot and are very incoordinated.";}
|
||||
|
||||
case DI_HOT_LEGS:
|
||||
case DI_HOT_LEGS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your legs feel warm.";
|
||||
case 2: return "Your legs are sweating from the heat.";
|
||||
case 3: return "Your legs are sweating profusely. Your muscles are in pain due to cramps.";}
|
||||
case 3: return "Your legs are sweating profusely. Your muscles are in pain due to cramps.";}
|
||||
|
||||
case DI_HOT_FEET:
|
||||
case DI_HOT_FEET:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your feet feel hot.";
|
||||
case 2: return "Your feet are painfully swollen due to the heat.";
|
||||
case 3: return "Your feet are painfully swollen due to the heat.";}
|
||||
case 3: return "Your feet are painfully swollen due to the heat.";}
|
||||
|
||||
case DI_BLISTERS_MOUTH: return "\
|
||||
Your face is blistering from the intense heat. It is extremely painful.";
|
||||
@@ -1510,6 +1669,15 @@ will deal piercing damage.";
|
||||
Your next strike will be a Viper Strike. It requires both arms to be in good\n\
|
||||
condition, and deals massive damage.";
|
||||
}
|
||||
case DI_BITE:
|
||||
return "\
|
||||
You have a nasty bite wound.";
|
||||
case DI_INFECTED:
|
||||
return "\
|
||||
You have an infected wound.";
|
||||
|
||||
case DI_RECOVER: return "\
|
||||
You are recovering from an infection.";
|
||||
|
||||
default:
|
||||
return "Who knows? This is probably a bug.";
|
||||
|
||||
@@ -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
|
||||
};
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
#include "npc.h"
|
||||
#include "game.h"
|
||||
#include "rng.h"
|
||||
#include "options.h"
|
||||
|
||||
void event::actualize(game *g)
|
||||
{
|
||||
@@ -112,7 +113,7 @@ void event::actualize(game *g)
|
||||
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(x, y) = t_underbrush;
|
||||
g->m.ter_set(x, y, t_underbrush);
|
||||
}
|
||||
}
|
||||
break;
|
||||
@@ -122,7 +123,7 @@ void event::actualize(game *g)
|
||||
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(x, y) = t_stairs_down;
|
||||
g->m.ter_set(x, y, t_stairs_down);
|
||||
int j;
|
||||
if (!saw_grate && g->u_see(x, y, j))
|
||||
saw_grate = true;
|
||||
@@ -184,7 +185,7 @@ void event::actualize(game *g)
|
||||
// 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(x, y) = flood_buf[x][y];
|
||||
g->m.ter_set(x, y, flood_buf[x][y]);
|
||||
}
|
||||
g->add_event(EVENT_TEMPLE_FLOOD, int(g->turn) + rng(2, 3));
|
||||
} break;
|
||||
@@ -220,7 +221,8 @@ void event::per_turn(game *g)
|
||||
{
|
||||
switch (type) {
|
||||
case EVENT_WANTED: {
|
||||
if (g->levz >= 0 && one_in(100)) { // About once every 10 minutes
|
||||
// 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();
|
||||
|
||||
@@ -91,11 +91,12 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
if (it->is_ammo() && it->ammo_type() != AT_BATT &&
|
||||
it->ammo_type() != AT_NAIL && it->ammo_type() != AT_BB &&
|
||||
it->ammo_type() != AT_BOLT && it->ammo_type() != AT_ARROW && it->ammo_type() != AT_NULL) {
|
||||
cur->age /= 2;
|
||||
cur->age -= 600;
|
||||
destroyed = true;
|
||||
smoke += 6;
|
||||
consumed++;
|
||||
// cook off ammo instead of just burning it.
|
||||
for(int i = 0; i < (it->charges / 10) + 1; i++)
|
||||
{
|
||||
g->explosion(x, y, (dynamic_cast<it_ammo*>(it->type))->damage / 2, true, false);
|
||||
}
|
||||
|
||||
} else if (it->made_of(PAPER)) {
|
||||
destroyed = it->burn(cur->density * 3);
|
||||
@@ -139,21 +140,16 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
}
|
||||
|
||||
} else if (it->made_of(LIQUID)) {
|
||||
switch (it->type->id) { // TODO: Make this be not a hack.
|
||||
case itm_whiskey:
|
||||
case itm_vodka:
|
||||
case itm_rum:
|
||||
case itm_tequila:
|
||||
cur->age -= 300;
|
||||
smoke += 6;
|
||||
break;
|
||||
default:
|
||||
cur->age += rng(80 * vol, 300 * vol);
|
||||
smoke++;
|
||||
if(it->type->id == "tequila" || it->type->id == "whiskey" ||
|
||||
it->type->id == "vodka" || it->type->id == "rum") {
|
||||
cur->age -= 300;
|
||||
smoke += 6;
|
||||
} else {
|
||||
cur->age += rng(80 * vol, 300 * vol);
|
||||
smoke++;
|
||||
}
|
||||
destroyed = true;
|
||||
consumed++;
|
||||
|
||||
} else if (it->made_of(POWDER)) {
|
||||
cur->age -= vol;
|
||||
destroyed = true;
|
||||
@@ -180,10 +176,10 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
if (veh)
|
||||
veh->damage (part, cur->density * 10, false);
|
||||
// If the flames are in a brazier, they're fully contained, so skip consuming terrain
|
||||
if(tr_brazier != tr_at(x, y)) {
|
||||
if((tr_brazier != tr_at(x, y))&&(has_flag(fire_container, x, y) != TRUE )) {
|
||||
// Consume the terrain we're on
|
||||
if (has_flag(explodes, x, y)) {
|
||||
ter(x, y) = ter_id(int(ter(x, y)) + 1);
|
||||
ter_set(x, y, ter_id(int(ter(x, y)) + 1));
|
||||
cur->age = 0;
|
||||
cur->density = 3;
|
||||
g->explosion(x, y, 40, 0, true);
|
||||
@@ -198,7 +194,7 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
cur->age -= cur->density * cur->density * 40;
|
||||
smoke += 15;
|
||||
if (cur->density == 3)
|
||||
ter(x, y) = t_ash;
|
||||
ter_set(x, y, t_ash);
|
||||
|
||||
} else if (has_flag(l_flammable, x, y) && one_in(62 - cur->density * 10)) {
|
||||
cur->age -= cur->density * cur->density * 30;
|
||||
@@ -219,7 +215,8 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
// If the flames are in a pit, it can't spread to non-pit
|
||||
bool in_pit = (ter(x, y) == t_pit);
|
||||
// If the flames are REALLY big, they contribute to adjacent flames
|
||||
if (cur->density == 3 && cur->age < 0 && tr_brazier != tr_at(x, y)) {
|
||||
if (cur->density == 3 && cur->age < 0 && tr_brazier != tr_at(x, y)
|
||||
&& (has_flag(fire_container, x, y) != TRUE ) ){
|
||||
// Randomly offset our x/y shifts by 0-2, to randomly pick a square to spread to
|
||||
int starti = rng(0, 2);
|
||||
int startj = rng(0, 2);
|
||||
@@ -247,11 +244,12 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
if (field_at(fx, fy).type == fd_web)
|
||||
spread_chance = 50 + spread_chance / 2;
|
||||
if (has_flag(explodes, fx, fy) && one_in(8 - cur->density) &&
|
||||
tr_brazier != tr_at(x, y)) {
|
||||
ter(fx, fy) = ter_id(int(ter(fx, fy)) + 1);
|
||||
tr_brazier != tr_at(x, y) && (has_flag(fire_container, x, y) != TRUE ) ) {
|
||||
ter_set(fx, fy, ter_id(int(ter(fx, fy)) + 1));
|
||||
g->explosion(fx, fy, 40, 0, true);
|
||||
} else if ((i != 0 || j != 0) && rng(1, 100) < spread_chance &&
|
||||
tr_brazier != tr_at(x, y) &&
|
||||
(has_flag(fire_container, x, y) != TRUE )&&
|
||||
(in_pit == (ter(fx, fy) == t_pit)) &&
|
||||
((cur->density == 3 &&
|
||||
(has_flag(flammable, fx, fy) || one_in(20))) ||
|
||||
@@ -278,7 +276,8 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
// If we're not spreading, maybe we'll stick out some smoke, huh?
|
||||
if (move_cost(fx, fy) > 0 &&
|
||||
(!one_in(smoke) || (nosmoke && one_in(40))) &&
|
||||
rng(3, 35) < cur->density * 10 && cur->age < 1000) {
|
||||
rng(3, 35) < cur->density * 10 && cur->age < 1000 &&
|
||||
(has_flag(suppress_smoke, x, y) != TRUE )) {
|
||||
smoke--;
|
||||
add_field(g, fx, fy, fd_smoke, rng(1, cur->density));
|
||||
}
|
||||
@@ -539,7 +538,7 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
case fd_push_items: {
|
||||
std::vector<item> *it = &(i_at(x, y));
|
||||
for (int i = 0; i < it->size(); i++) {
|
||||
if ((*it)[i].type->id != itm_rock || (*it)[i].bday >= int(g->turn) - 1)
|
||||
if ((*it)[i].type->id != "rock" || (*it)[i].bday >= int(g->turn) - 1)
|
||||
i++;
|
||||
else {
|
||||
item tmp = (*it)[i];
|
||||
@@ -712,11 +711,17 @@ void map::step_in_field(int x, int y, game *g)
|
||||
case fd_fire:
|
||||
adjusted_intensity = cur->density;
|
||||
if( g->u.in_vehicle )
|
||||
if( inside )
|
||||
adjusted_intensity -= 2;
|
||||
else
|
||||
adjusted_intensity -= 1;
|
||||
if (!g->u.has_active_bionic(bio_heatsink)) {
|
||||
{
|
||||
if( inside )
|
||||
{
|
||||
adjusted_intensity -= 2;
|
||||
}
|
||||
else
|
||||
{
|
||||
adjusted_intensity -= 1;
|
||||
}
|
||||
}
|
||||
if (!g->u.has_active_bionic("bio_heatsink")) {
|
||||
if (adjusted_intensity == 1) {
|
||||
g->add_msg("You burn your legs and feet!");
|
||||
g->u.hit(g, bp_feet, 0, 0, rng(2, 6));
|
||||
@@ -743,23 +748,33 @@ void map::step_in_field(int x, int y, game *g)
|
||||
break;
|
||||
|
||||
case fd_smoke:
|
||||
if (cur->density == 3 && !inside)
|
||||
g->u.infect(DI_SMOKE, bp_mouth, 4, 15, g);
|
||||
break;
|
||||
if (cur->density == 3 && !inside)
|
||||
{
|
||||
g->u.infect(DI_SMOKE, bp_mouth, 4, 15, g);
|
||||
}
|
||||
break;
|
||||
|
||||
case fd_tear_gas:
|
||||
if ((cur->density > 1 || !one_in(3)) && !inside || inside && one_in(3))
|
||||
g->u.infect(DI_TEARGAS, bp_mouth, 5, 20, g);
|
||||
if (cur->density > 1 && !inside || inside && one_in(3))
|
||||
g->u.infect(DI_BLIND, bp_eyes, cur->density * 2, 10, g);
|
||||
break;
|
||||
if ((cur->density > 1 || !one_in(3)) && (!inside || (inside && one_in(3))))
|
||||
{
|
||||
g->u.infect(DI_TEARGAS, bp_mouth, 5, 20, g);
|
||||
}
|
||||
if (cur->density > 1 && (!inside || (inside && one_in(3))))
|
||||
{
|
||||
g->u.infect(DI_BLIND, bp_eyes, cur->density * 2, 10, g);
|
||||
}
|
||||
break;
|
||||
|
||||
case fd_toxic_gas:
|
||||
if (cur->density == 2 && !inside || cur->density == 3 && inside )
|
||||
g->u.infect(DI_POISON, bp_mouth, 5, 30, g);
|
||||
else if (cur->density == 3 && !inside)
|
||||
g->u.infect(DI_BADPOISON, bp_mouth, 5, 30, g);
|
||||
break;
|
||||
if (cur->density == 2 && (!inside || (cur->density == 3 && inside)))
|
||||
{
|
||||
g->u.infect(DI_POISON, bp_mouth, 5, 30, g);
|
||||
}
|
||||
else if (cur->density == 3 && !inside)
|
||||
{
|
||||
g->u.infect(DI_BADPOISON, bp_mouth, 5, 30, g);
|
||||
}
|
||||
break;
|
||||
|
||||
case fd_nuke_gas:
|
||||
g->u.radiation += rng(0, cur->density * (cur->density + 1));
|
||||
@@ -771,7 +786,7 @@ void map::step_in_field(int x, int y, game *g)
|
||||
|
||||
case fd_flame_burst:
|
||||
if (inside) break;
|
||||
if (!g->u.has_active_bionic(bio_heatsink)) {
|
||||
if (!g->u.has_active_bionic("bio_heatsink")) {
|
||||
g->add_msg("You're torched by flames!");
|
||||
g->u.hit(g, bp_legs, 0, 0, rng(2, 6));
|
||||
g->u.hit(g, bp_legs, 1, 0, rng(2, 6));
|
||||
@@ -822,7 +837,7 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
|
||||
|
||||
case fd_web:
|
||||
if (!z->has_flag(MF_WEBWALK)) {
|
||||
z->speed *= .8;
|
||||
z->moves *= .8;
|
||||
remove_field(x, y);
|
||||
}
|
||||
break;
|
||||
@@ -838,7 +853,7 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
|
||||
break;
|
||||
|
||||
case fd_sap:
|
||||
z->speed -= cur->density * 5;
|
||||
z->moves -= cur->density * 5;
|
||||
if (cur->density == 1)
|
||||
remove_field(x, y);
|
||||
else
|
||||
@@ -880,14 +895,16 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
|
||||
// Drop through to smoke
|
||||
|
||||
case fd_smoke:
|
||||
if (cur->density == 3)
|
||||
z->speed -= rng(10, 20);
|
||||
if (z->made_of(VEGGY)) // Plants suffer from smoke even worse
|
||||
z->speed -= rng(1, cur->density * 12);
|
||||
if (!z->has_flag(MF_NO_BREATHE)){
|
||||
if (cur->density == 3)
|
||||
z->moves -= rng(10, 20);
|
||||
if (z->made_of(VEGGY)) // Plants suffer from smoke even worse
|
||||
z->moves -= rng(1, cur->density * 12);
|
||||
}
|
||||
break;
|
||||
|
||||
case fd_tear_gas:
|
||||
if (z->made_of(FLESH) || z->made_of(VEGGY)) {
|
||||
if ((z->made_of(FLESH) || z->made_of(VEGGY)) && !z->has_flag(MF_NO_BREATHE)) {
|
||||
z->add_effect(ME_BLIND, cur->density * 8);
|
||||
if (cur->density == 3) {
|
||||
z->add_effect(ME_STUNNED, rng(10, 20));
|
||||
@@ -898,31 +915,35 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
|
||||
} else
|
||||
z->add_effect(ME_STUNNED, rng(1, 5));
|
||||
if (z->made_of(VEGGY)) {
|
||||
z->speed -= rng(cur->density * 5, cur->density * 12);
|
||||
z->moves -= rng(cur->density * 5, cur->density * 12);
|
||||
dam += cur->density * rng(8, 14);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case fd_toxic_gas:
|
||||
dam = cur->density;
|
||||
z->speed -= cur->density;
|
||||
if(!z->has_flag(MF_NO_BREATHE)){
|
||||
dam = cur->density;
|
||||
z->moves -= cur->density;
|
||||
}
|
||||
break;
|
||||
|
||||
case fd_nuke_gas:
|
||||
if (cur->density == 3) {
|
||||
z->speed -= rng(60, 120);
|
||||
dam = rng(30, 50);
|
||||
} else if (cur->density == 2) {
|
||||
z->speed -= rng(20, 50);
|
||||
dam = rng(10, 25);
|
||||
} else {
|
||||
z->speed -= rng(0, 15);
|
||||
dam = rng(0, 12);
|
||||
}
|
||||
if (z->made_of(VEGGY)) {
|
||||
z->speed -= rng(cur->density * 5, cur->density * 12);
|
||||
dam *= cur->density;
|
||||
if(!z->has_flag(MF_NO_BREATHE)){
|
||||
if (cur->density == 3) {
|
||||
z->moves -= rng(60, 120);
|
||||
dam = rng(30, 50);
|
||||
} else if (cur->density == 2) {
|
||||
z->moves -= rng(20, 50);
|
||||
dam = rng(10, 25);
|
||||
} else {
|
||||
z->moves -= rng(0, 15);
|
||||
dam = rng(0, 12);
|
||||
}
|
||||
if (z->made_of(VEGGY)) {
|
||||
z->moves -= rng(cur->density * 5, cur->density * 12);
|
||||
dam *= cur->density;
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
|
||||
@@ -27,6 +27,20 @@
|
||||
#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
|
||||
@@ -83,6 +97,7 @@ 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
|
||||
@@ -165,7 +180,7 @@ class game
|
||||
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();
|
||||
float natural_light_level() const;
|
||||
unsigned char light_level();
|
||||
void reset_light_level();
|
||||
int assign_npc_id();
|
||||
@@ -204,7 +219,10 @@ class game
|
||||
void consume_items(std::vector<component> components);
|
||||
void consume_tools(std::vector<component> tools);
|
||||
|
||||
std::vector <itype*> itypes;
|
||||
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;
|
||||
@@ -223,14 +241,12 @@ class game
|
||||
char nextinv; // Determines which letter the next inv item will have
|
||||
overmap cur_om;
|
||||
map m;
|
||||
light_map lm;
|
||||
int levx, levy, levz; // Placement inside the overmap
|
||||
player u;
|
||||
std::vector<monster> z;
|
||||
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
|
||||
@@ -238,12 +254,10 @@ class game
|
||||
std::vector<item> items_dragged;
|
||||
int weight_dragged; // Computed once, when you start dragging
|
||||
bool debugmon;
|
||||
bool no_npc;
|
||||
// Display data... TODO: Make this more portable?
|
||||
int VIEWX;
|
||||
int VIEWY;
|
||||
int TERRAIN_WINDOW_WIDTH;
|
||||
int TERRAIN_WINDOW_HEIGHT;
|
||||
bool starting_npc;
|
||||
bool random_npc;
|
||||
|
||||
std::map<int, std::map<int, bool> > mapRain;
|
||||
|
||||
WINDOW *w_terrain;
|
||||
WINDOW *w_minimap;
|
||||
@@ -252,11 +266,18 @@ class game
|
||||
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();// 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
|
||||
@@ -264,9 +285,10 @@ class game
|
||||
|
||||
// Data Initialization
|
||||
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_moncats(); // Initializes monster categories
|
||||
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
|
||||
@@ -276,7 +298,10 @@ class game
|
||||
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
|
||||
@@ -295,15 +320,21 @@ class game
|
||||
void open(); // Open a door 'o'
|
||||
void close(); // Close a door 'c'
|
||||
void smash(); // Smash terrain
|
||||
void craft(); // See crafting.cpp
|
||||
void make_craft(recipe *making); // See crafting.cpp
|
||||
void complete_craft(); // See crafting.cpp
|
||||
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 disassemble(); // See crafting.cpp
|
||||
void disassemble_item(recipe *dis); // See crafting.cpp
|
||||
void complete_disassemble(); // See crafting.cpp
|
||||
void construction_menu(); // See construction.cpp
|
||||
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);
|
||||
@@ -317,7 +348,7 @@ class game
|
||||
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
|
||||
bool handle_liquid(item &liquid, bool from_ground, bool infinite);
|
||||
|
||||
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'
|
||||
@@ -339,6 +370,7 @@ class game
|
||||
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
|
||||
@@ -353,16 +385,13 @@ class game
|
||||
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
|
||||
mon_id valid_monster_from(std::vector<mon_id> group);
|
||||
int valid_group(mon_id type, int x, int y);// Picks a group from cur_om
|
||||
moncat_id mt_to_mc(mon_id type);// Monster type to monster category
|
||||
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 cleanup_dead(); // Delete any dead NPCs/monsters
|
||||
void monmove(); // Monster movement
|
||||
void rustCheck(); // Degrades practice levels
|
||||
void update_bodytemp(); // Maintains body temperature
|
||||
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
|
||||
@@ -386,10 +415,6 @@ class game
|
||||
void disp_NPCs(); // Currently UNUSED. Lists global NPCs.
|
||||
void list_missions(); // Listed current, completed and failed missions.
|
||||
|
||||
// If x & y are OOB, creates a new overmap and 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);
|
||||
|
||||
// Debug functions
|
||||
void debug(); // All-encompassing debug screen. TODO: This.
|
||||
void display_scent(); // Displays the scent map
|
||||
|
||||
+1
-1
@@ -15,4 +15,4 @@ public:
|
||||
std::string *contents;
|
||||
};
|
||||
|
||||
#endif
|
||||
#endif
|
||||
|
||||
+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__) */
|
||||
@@ -13,19 +13,19 @@ InputEvent get_input(int ch)
|
||||
{
|
||||
case 'k':
|
||||
case '8':
|
||||
case KEY_UP:
|
||||
case KEY_UP:
|
||||
return DirectionN;
|
||||
case 'j':
|
||||
case '2':
|
||||
case KEY_DOWN:
|
||||
case KEY_DOWN:
|
||||
return DirectionS;
|
||||
case 'l':
|
||||
case '6':
|
||||
case KEY_RIGHT:
|
||||
case KEY_RIGHT:
|
||||
return DirectionE;
|
||||
case 'h':
|
||||
case '4':
|
||||
case KEY_LEFT:
|
||||
case KEY_LEFT:
|
||||
return DirectionW;
|
||||
case 'y':
|
||||
case '7':
|
||||
@@ -60,7 +60,12 @@ InputEvent get_input(int ch)
|
||||
case ',':
|
||||
case 'g':
|
||||
return Pickup;
|
||||
|
||||
case 'f':
|
||||
case 'F':
|
||||
return Filter;
|
||||
case 'r':
|
||||
case 'R':
|
||||
return Reset;
|
||||
default:
|
||||
return Undefined;
|
||||
}
|
||||
|
||||
@@ -19,7 +19,8 @@ enum InputEvent {
|
||||
|
||||
DirectionDown, /* Think stairs */
|
||||
DirectionUp,
|
||||
|
||||
Filter,
|
||||
Reset,
|
||||
Pickup,
|
||||
Nothing,
|
||||
Undefined
|
||||
|
||||
+42
-20
@@ -4,6 +4,8 @@
|
||||
#include "keypress.h"
|
||||
#include "mapdata.h"
|
||||
|
||||
const std::string inv_chars = "abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ!\"#&()*+./:;=?@[\\]^_{|}";
|
||||
|
||||
item& inventory::operator[] (int i)
|
||||
{
|
||||
if (i < 0 || i > items.size()) {
|
||||
@@ -141,6 +143,11 @@ void inventory::add_item(item newit, bool keep_invlet)
|
||||
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;
|
||||
@@ -197,16 +204,39 @@ void inventory::form_from_map(game *g, point origin, int range)
|
||||
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[itm_fire], 0);
|
||||
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_sink || terrain_id == t_water_sh || terrain_id == t_water_dp){
|
||||
item water(g->itypes[itm_water], 0);
|
||||
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);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -462,22 +492,14 @@ bool inventory::has_item(item *it)
|
||||
|
||||
void inventory::assign_empty_invlet(item &it, player *p)
|
||||
{
|
||||
for (int ch = 'a'; ch <= 'z'; ch++) {
|
||||
//debugmsg("Trying %c", ch);
|
||||
if (index_by_letter(ch) == -1 && (!p || !p->has_weapon_or_armor(ch))) {
|
||||
it.invlet = ch;
|
||||
//debugmsg("Using %c", ch);
|
||||
return;
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
for (int ch = 'A'; ch <= 'Z'; ch++) {
|
||||
//debugmsg("Trying %c", ch);
|
||||
if (index_by_letter(ch) == -1 && (!p || !p->has_weapon_or_armor(ch))) {
|
||||
//debugmsg("Using %c", ch);
|
||||
it.invlet = ch;
|
||||
return;
|
||||
}
|
||||
}
|
||||
it.invlet = '`';
|
||||
//debugmsg("Couldn't find empty invlet");
|
||||
it.invlet = '`';
|
||||
//debugmsg("Couldn't find empty invlet");
|
||||
}
|
||||
|
||||
@@ -8,6 +8,8 @@
|
||||
class game;
|
||||
class map;
|
||||
|
||||
const extern std::string inv_chars;
|
||||
|
||||
class inventory
|
||||
{
|
||||
public:
|
||||
|
||||
+65
-52
@@ -5,10 +5,51 @@
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
|
||||
std::string CATEGORIES[9] =
|
||||
{"GROUND:", "FIREARMS:", "AMMUNITION:", "CLOTHING:", "COMESTIBLES:",
|
||||
"TOOLS:", "BOOKS:", "WEAPONS:", "OTHER:"};
|
||||
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)
|
||||
@@ -73,47 +114,17 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
|
||||
}
|
||||
|
||||
// Print items carried
|
||||
for(int ch='a'; ch <= 'z'; ++ch)
|
||||
n_items += ((g->u.inv.index_by_letter(ch) == -1) ? 0 : 1);
|
||||
for(int ch='A'; ch <= 'Z'; ++ch)
|
||||
n_items += ((g->u.inv.index_by_letter(ch) == -1) ? 0 : 1);
|
||||
mvwprintw(w_inv, 1, 62, "Items: %d/52 ", n_items);
|
||||
}
|
||||
|
||||
std::vector<int> find_firsts(inventory &inv)
|
||||
{
|
||||
std::vector<int> firsts;
|
||||
for (int i = 0; i < 8; 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() || inv[i].is_food_container()))
|
||||
firsts[3] = i;
|
||||
else if (firsts[4] == -1 && (inv[i].is_tool() || inv[i].is_gunmod() ||
|
||||
inv[i].is_bionic()))
|
||||
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_other())
|
||||
firsts[7] = i;
|
||||
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);
|
||||
}
|
||||
|
||||
return firsts;
|
||||
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), 0, 0);
|
||||
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;
|
||||
@@ -144,7 +155,7 @@ char game::inv(std::string title)
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
// Print category header
|
||||
for (int i = 1; i < 9; i++) {
|
||||
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++;
|
||||
@@ -183,7 +194,7 @@ 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), 0, 0);
|
||||
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;
|
||||
@@ -263,7 +274,7 @@ char game::inv_type(std::string title, int inv_item_type)
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
|
||||
for (int i = 1; i < 9; i++) {
|
||||
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++;
|
||||
@@ -304,7 +315,7 @@ 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), 0, 0);
|
||||
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++)
|
||||
@@ -338,7 +349,7 @@ std::vector<item> game::multidrop()
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
// Print category header
|
||||
for (int i = 1; i < 9; i++) {
|
||||
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++;
|
||||
@@ -386,8 +397,8 @@ std::vector<item> game::multidrop()
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
if (ch == u.weapon.invlet && u.weapon.type->id > num_items &&
|
||||
u.weapon.type->id < num_all_items) {
|
||||
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;
|
||||
@@ -513,8 +524,9 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
const int groundsize = (grounditems.size() > 10 ? 10 : grounditems.size());
|
||||
u.sort_inv();
|
||||
u.inv.restack(&u);
|
||||
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), 0, 0);
|
||||
int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
|
||||
|
||||
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;
|
||||
@@ -556,7 +568,7 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
// Print category header
|
||||
for (int i = iHeaderOffset; i < 9; i++) {
|
||||
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++;
|
||||
@@ -606,8 +618,9 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
if (ch == u.weapon.invlet && u.weapon.type->id > num_items &&
|
||||
u.weapon.type->id < num_all_items) {
|
||||
|
||||
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)
|
||||
@@ -687,8 +700,8 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
sItemCh = u.i_at(ch).tname(this);
|
||||
}
|
||||
|
||||
compare_split_screen_popup(true, sItemLastCh, vItemLastCh, vItemCh);
|
||||
compare_split_screen_popup(false, sItemCh, vItemCh, vItemLastCh);
|
||||
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);
|
||||
|
||||
@@ -4,8 +4,14 @@
|
||||
#include "skill.h"
|
||||
#include "game.h"
|
||||
#include <sstream>
|
||||
#include <algorithm>
|
||||
#include "cursesdef.h"
|
||||
|
||||
// mfb(n) converts a flag to its appropriate position in covers's bitfield
|
||||
#ifndef mfb
|
||||
#define mfb(n) long(1 << (n))
|
||||
#endif
|
||||
|
||||
bool is_flammable(material m);
|
||||
|
||||
std::string default_technique_name(technique_id tech);
|
||||
@@ -20,6 +26,8 @@ item::item()
|
||||
burnt = 0;
|
||||
poison = 0;
|
||||
mode = IF_NULL;
|
||||
item_flags = 0;
|
||||
item_counter = 0;
|
||||
type = nullitem();
|
||||
curammo = NULL;
|
||||
corpse = NULL;
|
||||
@@ -42,6 +50,8 @@ item::item(itype* it, unsigned int turn)
|
||||
burnt = 0;
|
||||
poison = 0;
|
||||
mode = IF_NULL;
|
||||
item_flags = 0;
|
||||
item_counter = 0;
|
||||
active = false;
|
||||
curammo = NULL;
|
||||
corpse = NULL;
|
||||
@@ -67,7 +77,7 @@ item::item(itype* it, unsigned int turn)
|
||||
charges = -1;
|
||||
else
|
||||
charges = tool->def_charges;
|
||||
} else if (it->is_gunmod() && it->id == itm_spare_mag) {
|
||||
} else if ((it->is_gunmod() && it->id == "spare_mag") || it->item_flags & mfb(IF_MODE_AUX)) {
|
||||
charges = 0;
|
||||
} else
|
||||
charges = -1;
|
||||
@@ -89,6 +99,8 @@ item::item(itype *it, unsigned int turn, char let)
|
||||
burnt = 0;
|
||||
poison = 0;
|
||||
mode = IF_NULL;
|
||||
item_flags = 0;
|
||||
item_counter = 0;
|
||||
active = false;
|
||||
if (it->is_gun()) {
|
||||
charges = 0;
|
||||
@@ -107,7 +119,7 @@ item::item(itype *it, unsigned int turn, char let)
|
||||
charges = -1;
|
||||
else
|
||||
charges = tool->def_charges;
|
||||
} else if (it->is_gunmod() && it->id == itm_spare_mag) {
|
||||
} else if (it->is_gunmod() && it->id == "spare_mag") {
|
||||
charges = 0;
|
||||
} else {
|
||||
charges = -1;
|
||||
@@ -133,6 +145,8 @@ void item::make_corpse(itype* it, mtype* mt, unsigned int turn)
|
||||
burnt = 0;
|
||||
poison = 0;
|
||||
mode = IF_NULL;
|
||||
item_flags = 0;
|
||||
item_counter = 0;
|
||||
curammo = NULL;
|
||||
active = false;
|
||||
if(!it)
|
||||
@@ -169,26 +183,26 @@ void item::make(itype* it)
|
||||
|
||||
bool item::is_null()
|
||||
{
|
||||
return (type == NULL || type->id == 0);
|
||||
return (type == NULL || type->id == "null");
|
||||
}
|
||||
|
||||
item item::in_its_container(std::vector<itype*> *itypes)
|
||||
item item::in_its_container(std::map<std::string, itype*> *itypes)
|
||||
{
|
||||
|
||||
if (is_software()) {
|
||||
item ret( (*itypes)[itm_usb_drive], 0);
|
||||
item ret( (*itypes)["usb_drive"], 0);
|
||||
ret.contents.push_back(*this);
|
||||
ret.invlet = invlet;
|
||||
return ret;
|
||||
}
|
||||
|
||||
if (!is_food() || (dynamic_cast<it_comest*>(type))->container == itm_null)
|
||||
if (!is_food() || (dynamic_cast<it_comest*>(type))->container == "null")
|
||||
return *this;
|
||||
|
||||
it_comest *food = dynamic_cast<it_comest*>(type);
|
||||
item ret((*itypes)[food->container], bday);
|
||||
|
||||
if (dynamic_cast<it_comest*>(type)->container == itm_can_food)
|
||||
if (dynamic_cast<it_comest*>(type)->container == "can_food")
|
||||
food->spoils = 0;
|
||||
|
||||
if (made_of(LIQUID))
|
||||
@@ -204,7 +218,7 @@ item item::in_its_container(std::vector<itype*> *itypes)
|
||||
|
||||
bool item::invlet_is_okay()
|
||||
{
|
||||
return ((invlet >= 'a' && invlet <= 'z') || (invlet >= 'A' && invlet <= 'Z'));
|
||||
return (inv_chars.find(invlet) != std::string::npos);
|
||||
}
|
||||
|
||||
bool item::stacks_with(item rhs)
|
||||
@@ -212,6 +226,7 @@ bool item::stacks_with(item rhs)
|
||||
|
||||
bool stacks = (type == rhs.type && damage == rhs.damage &&
|
||||
active == rhs.active && charges == rhs.charges &&
|
||||
item_flags == rhs.item_flags &&
|
||||
contents.size() == rhs.contents.size() &&
|
||||
(!goes_bad() || bday == rhs.bday));
|
||||
|
||||
@@ -243,21 +258,28 @@ void item::put_in(item payload)
|
||||
|
||||
std::string item::save_info()
|
||||
{
|
||||
if (type == NULL)
|
||||
if (type == NULL){
|
||||
debugmsg("Tried to save an item with NULL type!");
|
||||
int ammotmp = 0;
|
||||
}
|
||||
itype_id ammotmp = "null";
|
||||
/* TODO: This causes a segfault sometimes, even though we check to make sure
|
||||
* curammo isn't NULL. The crashes seem to occur most frequently when saving an
|
||||
* NPC, or when saving map data containing an item an NPC has dropped.
|
||||
*/
|
||||
if (curammo != NULL)
|
||||
if (curammo != NULL){
|
||||
ammotmp = curammo->id;
|
||||
if (ammotmp < 0 || ammotmp > num_items)
|
||||
ammotmp = 0; // Saves us from some bugs
|
||||
std::stringstream dump;// (std::stringstream::in | std::stringstream::out);
|
||||
dump << " " << int(invlet) << " " << int(typeId()) << " " << int(charges) <<
|
||||
" " << int(damage) << " " << int(burnt) << " " << poison << " " <<
|
||||
ammotmp << " " << owned << " " << int(bday);
|
||||
}
|
||||
if( std::find(unreal_itype_ids.begin(), unreal_itype_ids.end(),
|
||||
ammotmp) != unreal_itype_ids.end() &&
|
||||
std::find(artifact_itype_ids.begin(), artifact_itype_ids.end(),
|
||||
ammotmp) != artifact_itype_ids.end()
|
||||
) {
|
||||
ammotmp = "null"; //Saves us from some bugs, apparently?
|
||||
}
|
||||
std::stringstream dump;
|
||||
dump << " " << int(invlet) << " " << typeId() << " " << int(charges) <<
|
||||
" " << int(damage) << " " << int(item_flags) << " " << int(burnt) <<
|
||||
" " << poison << " " << ammotmp << " " << owned << " " << int(bday);
|
||||
if (active)
|
||||
dump << " 1";
|
||||
else
|
||||
@@ -280,9 +302,11 @@ void item::load_info(std::string data, game *g)
|
||||
{
|
||||
std::stringstream dump;
|
||||
dump << data;
|
||||
int idtmp, ammotmp, lettmp, damtmp, burntmp, acttmp, corp;
|
||||
dump >> lettmp >> idtmp >> charges >> damtmp >> burntmp >> poison >> ammotmp >>
|
||||
owned >> bday >> acttmp >> corp >> mission_id >> player_id;
|
||||
std::string idtmp, ammotmp;
|
||||
int lettmp, damtmp, burntmp, acttmp, corp, item_flagstmp;
|
||||
dump >> lettmp >> idtmp >> charges >> damtmp >> item_flagstmp >>
|
||||
burntmp >> poison >> ammotmp >> owned >> bday >> acttmp >>
|
||||
corp >> mission_id >> player_id;
|
||||
if (corp != -1)
|
||||
corpse = g->mtypes[corp];
|
||||
else
|
||||
@@ -302,11 +326,12 @@ void item::load_info(std::string data, game *g)
|
||||
invlet = char(lettmp);
|
||||
damage = damtmp;
|
||||
burnt = burntmp;
|
||||
item_flags = item_flagstmp;
|
||||
active = false;
|
||||
mode = IF_NULL;
|
||||
if (acttmp == 1)
|
||||
active = true;
|
||||
if (ammotmp > 0)
|
||||
if (ammotmp != "null")
|
||||
curammo = dynamic_cast<it_ammo*>(g->itypes[ammotmp]);
|
||||
else
|
||||
curammo = NULL;
|
||||
@@ -331,14 +356,10 @@ std::string item::info(bool showtext, std::vector<iteminfo> *dump)
|
||||
dump->push_back(iteminfo("BASE", " To-hit bonus: ", ((type->m_to_hit > 0) ? "+" : ""), int(type->m_to_hit), ""));
|
||||
dump->push_back(iteminfo("BASE", " Moves per attack: ", "", int(attack_time()), "", true, true));
|
||||
|
||||
/*
|
||||
dump << " Volume: " << volume() << " Weight: " << weight() << "\n" <<
|
||||
" Bash: " << int(type->melee_dam) <<
|
||||
(has_flag(IF_SPEAR) ? " Pierce: " : " Cut: ") <<
|
||||
int(type->melee_cut) << " To-hit bonus: " <<
|
||||
(type->m_to_hit > 0 ? "+" : "" ) << int(type->m_to_hit) << "\n" <<
|
||||
" Moves per attack: " << attack_time() << "\n";
|
||||
*/
|
||||
if (type->techniques != 0)
|
||||
for (int i = 1; i < NUM_TECHNIQUES; i++)
|
||||
if (type->techniques & mfb(i))
|
||||
dump->push_back(iteminfo("TECHNIQUE", " +",default_technique_name( technique_id(i) )));
|
||||
}
|
||||
|
||||
if (is_food()) {
|
||||
@@ -348,11 +369,6 @@ std::string item::info(bool showtext, std::vector<iteminfo> *dump)
|
||||
dump->push_back(iteminfo("FOOD", " Quench: ", "", int(food->quench)));
|
||||
dump->push_back(iteminfo("FOOD", " Enjoyability: ", "", int(food->fun)));
|
||||
|
||||
/*
|
||||
dump << " Nutrition: " << int(food->nutr) << "\n Quench: " <<
|
||||
int(food->quench) << "\n Enjoyability: " << int(food->fun);
|
||||
*/
|
||||
|
||||
} else if (is_food_container()) {
|
||||
// added charge display for debugging
|
||||
it_comest* food = dynamic_cast<it_comest*>(contents[0].type);
|
||||
@@ -360,13 +376,7 @@ std::string item::info(bool showtext, std::vector<iteminfo> *dump)
|
||||
dump->push_back(iteminfo("FOOD", " Nutrition: ", "", int(food->nutr)));
|
||||
dump->push_back(iteminfo("FOOD", " Quench: ", "", int(food->quench)));
|
||||
dump->push_back(iteminfo("FOOD", " Enjoyability: ", "", int(food->fun)));
|
||||
dump->push_back(iteminfo("FOOD", " Charges: ", "", int(contents[0].charges)));
|
||||
|
||||
/*
|
||||
dump << " Nutrition: " << int(food->nutr) << "\n Quench: " <<
|
||||
int(food->quench) << "\n Enjoyability: " << int(food->fun)
|
||||
<< "\n Charges: " << int(contents[0].charges);
|
||||
*/
|
||||
dump->push_back(iteminfo("FOOD", " Portions: ", "", abs(int(contents[0].charges))));
|
||||
|
||||
} else if (is_ammo()) {
|
||||
// added charge display for debugging
|
||||
@@ -380,14 +390,6 @@ std::string item::info(bool showtext, std::vector<iteminfo> *dump)
|
||||
dump->push_back(iteminfo("AMMO", " Recoil: ", "", int(ammo->recoil), "", true, true));
|
||||
dump->push_back(iteminfo("AMMO", " Count: ", "", int(ammo->count)));
|
||||
|
||||
/*
|
||||
dump << " Type: " << ammo_name(ammo->type) << "\n Damage: " <<
|
||||
int(ammo->damage) << "\n Armor-pierce: " << int(ammo->pierce) <<
|
||||
"\n Range: " << int(ammo->range) << "\n Accuracy: " <<
|
||||
int(100 - ammo->accuracy) << "\n Recoil: " << int(ammo->recoil)
|
||||
<< "\n Count: " << int(ammo->count);
|
||||
*/
|
||||
|
||||
} else if (is_ammo_container()) {
|
||||
it_ammo* ammo = dynamic_cast<it_ammo*>(contents[0].type);
|
||||
|
||||
@@ -399,14 +401,6 @@ std::string item::info(bool showtext, std::vector<iteminfo> *dump)
|
||||
dump->push_back(iteminfo("AMMO", " Recoil: ", "", int(ammo->recoil), "", true, true));
|
||||
dump->push_back(iteminfo("AMMO", " Count: ", "", int(contents[0].charges)));
|
||||
|
||||
/*
|
||||
dump << " Type: " << ammo_name(ammo->type) << "\n Damage: " <<
|
||||
int(ammo->damage) << "\n Armor-pierce: " << int(ammo->pierce) <<
|
||||
"\n Range: " << int(ammo->range) << "\n Accuracy: " <<
|
||||
int(100 - ammo->accuracy) << "\n Recoil: " << int(ammo->recoil)
|
||||
<< "\n Count: " << int(contents[0].charges);
|
||||
*/
|
||||
|
||||
} else if (is_gun()) {
|
||||
it_gun* gun = dynamic_cast<it_gun*>(type);
|
||||
int ammo_dam = 0, ammo_recoil = 0;
|
||||
@@ -419,81 +413,66 @@ std::string item::info(bool showtext, std::vector<iteminfo> *dump)
|
||||
dump->push_back(iteminfo("GUN", " Skill used: ", gun->skill_used->name()));
|
||||
dump->push_back(iteminfo("GUN", " Ammunition: ", "", int(clip_size()), " rounds of " + ammo_name(ammo_type())));
|
||||
|
||||
/*
|
||||
dump << " Skill used: " << gun->skill_used->name() << "\n Ammunition: " <<
|
||||
clip_size() << " rounds of " << ammo_name(ammo_type());
|
||||
|
||||
dump << "\n Damage: ";
|
||||
*/
|
||||
|
||||
temp1.str("");
|
||||
if (has_ammo)
|
||||
temp1 << ammo_dam; //dump << ammo_dam;
|
||||
temp1 << ammo_dam;
|
||||
|
||||
temp1 << (gun_damage(false) >= 0 ? "+" : "" );
|
||||
//dump << (gun_damage(false) >= 0 ? "+" : "" ) << gun_damage(false);
|
||||
|
||||
temp2.str("");
|
||||
if (has_ammo)
|
||||
temp2 << " = " << gun_damage(); //dump << " = " << gun_damage();
|
||||
temp2 << " = " << gun_damage();
|
||||
|
||||
dump->push_back(iteminfo("GUN", " Damage: ", temp1.str(), int(gun_damage(false)), temp2.str()));
|
||||
dump->push_back(iteminfo("GUN", " Accuracy: ", "", int(100 - accuracy())));
|
||||
//dump << "\n Accuracy: " << int(100 - accuracy());
|
||||
|
||||
//dump << "\n Recoil: ";
|
||||
temp1.str("");
|
||||
if (has_ammo)
|
||||
temp1 << ammo_dam; //dump << ammo_recoil;
|
||||
temp1 << ammo_recoil;
|
||||
|
||||
temp1 << (recoil(false) >= 0 ? "+" : "" );
|
||||
//dump << (recoil(false) >= 0 ? "+" : "" ) << recoil(false);
|
||||
|
||||
temp2.str("");
|
||||
if (has_ammo)
|
||||
temp2 << " = " << recoil(); //dump << " = " << recoil();
|
||||
temp2 << " = " << recoil();
|
||||
|
||||
dump->push_back(iteminfo("GUN"," Recoil: ", temp1.str(), int(recoil(false)), temp2.str(), true, true));
|
||||
|
||||
//dump << "\n Reload time: " << int(gun->reload_time);
|
||||
//if (has_flag(IF_RELOAD_ONE))
|
||||
//dump << " per round";
|
||||
|
||||
dump->push_back(iteminfo("GUN", " Reload time: ", "", int(gun->reload_time), ((has_flag(IF_RELOAD_ONE)) ? " per round" : ""), true, true));
|
||||
|
||||
if (burst_size() == 0) {
|
||||
if (gun->skill_used == Skill::skill("pistol") && has_flag(IF_RELOAD_ONE))
|
||||
dump->push_back(iteminfo("GUN", " Revolver.")); //dump << "\n Revolver.";
|
||||
dump->push_back(iteminfo("GUN", " Revolver."));
|
||||
else
|
||||
dump->push_back(iteminfo("GUN", " Semi-automatic.")); //dump << "\n Semi-automatic.";
|
||||
dump->push_back(iteminfo("GUN", " Semi-automatic."));
|
||||
} else
|
||||
dump->push_back(iteminfo("GUN", " Burst size: ", "", int(burst_size()))); //dump << "\n Burst size: " << burst_size();
|
||||
dump->push_back(iteminfo("GUN", " Burst size: ", "", int(burst_size())));
|
||||
|
||||
if (contents.size() > 0)
|
||||
dump->push_back(iteminfo("GUN", "\n")); //dump << "\n";
|
||||
dump->push_back(iteminfo("GUN", "\n"));
|
||||
|
||||
temp1.str("");
|
||||
for (int i = 0; i < contents.size(); i++)
|
||||
temp1 << "\n+" << contents[i].tname();
|
||||
|
||||
dump->push_back(iteminfo("GUN", temp1.str())); //
|
||||
dump->push_back(iteminfo("GUN", temp1.str()));
|
||||
|
||||
} else if (is_gunmod()) {
|
||||
it_gunmod* mod = dynamic_cast<it_gunmod*>(type);
|
||||
|
||||
if (mod->accuracy != 0)
|
||||
dump->push_back(iteminfo("GUNMOD", " Accuracy: ", ((mod->accuracy > 0) ? "+" : ""), int(mod->accuracy))); //dump << " Accuracy: " << (mod->accuracy > 0 ? "+" : "") << int(mod->accuracy);
|
||||
dump->push_back(iteminfo("GUNMOD", " Accuracy: ", ((mod->accuracy > 0) ? "+" : ""), int(mod->accuracy)));
|
||||
if (mod->damage != 0)
|
||||
dump->push_back(iteminfo("GUNMOD", " Damage: ", ((mod->damage > 0) ? "+" : ""), int(mod->damage))); //dump << "\n Damage: " << (mod->damage > 0 ? "+" : "") << int(mod->damage);
|
||||
dump->push_back(iteminfo("GUNMOD", " Damage: ", ((mod->damage > 0) ? "+" : ""), int(mod->damage)));
|
||||
if (mod->clip != 0)
|
||||
dump->push_back(iteminfo("GUNMOD", " Magazine: ", ((mod->clip > 0) ? "+" : ""), int(mod->clip), "%")); //dump << "\n Magazine: " << (mod->clip > 0 ? "+" : "") << int(mod->damage) << "%";
|
||||
dump->push_back(iteminfo("GUNMOD", " Magazine: ", ((mod->clip > 0) ? "+" : ""), int(mod->clip), "%"));
|
||||
if (mod->recoil != 0)
|
||||
dump->push_back(iteminfo("GUNMOD", " Recoil: ", ((mod->recoil > 0) ? "+" : ""), int(mod->recoil), "", true, true)); //dump << "\n Recoil: " << int(mod->recoil);
|
||||
dump->push_back(iteminfo("GUNMOD", " Recoil: ", ((mod->recoil > 0) ? "+" : ""), int(mod->recoil), "", true, true));
|
||||
if (mod->burst != 0)
|
||||
dump->push_back(iteminfo("GUNMOD", " Burst: ", (mod->burst > 0 ? "+" : ""), int(mod->burst))); //dump << "\n Burst: " << (mod->clip > 0 ? "+" : "") << int(mod->clip);
|
||||
dump->push_back(iteminfo("GUNMOD", " Burst: ", (mod->burst > 0 ? "+" : ""), int(mod->burst)));
|
||||
|
||||
if (mod->newtype != AT_NULL)
|
||||
dump->push_back(iteminfo("GUNMOD", " " + ammo_name(mod->newtype))); //dump << "\n " << ammo_name(mod->newtype);
|
||||
dump->push_back(iteminfo("GUNMOD", " " + ammo_name(mod->newtype)));
|
||||
|
||||
temp1.str("");
|
||||
temp1 << " Used on: ";
|
||||
@@ -510,7 +489,7 @@ std::string item::info(bool showtext, std::vector<iteminfo> *dump)
|
||||
|
||||
} else if (is_armor()) {
|
||||
it_armor* armor = dynamic_cast<it_armor*>(type);
|
||||
|
||||
|
||||
temp1.str("");
|
||||
temp1 << " Covers: ";
|
||||
if (armor->covers & mfb(bp_head))
|
||||
@@ -532,88 +511,69 @@ std::string item::info(bool showtext, std::vector<iteminfo> *dump)
|
||||
|
||||
dump->push_back(iteminfo("ARMOR", temp1.str()));
|
||||
|
||||
dump->push_back(iteminfo("ARMOR", " Encumberment: ", "", int(armor->encumber), "", true, true));
|
||||
if (has_flag(IF_FIT))
|
||||
{
|
||||
dump->push_back(iteminfo("ARMOR", " Encumberment: ", "", int(armor->encumber) - 1, " (fits)", true, true));
|
||||
}
|
||||
else
|
||||
{
|
||||
dump->push_back(iteminfo("ARMOR", " Encumberment: ", "", int(armor->encumber), "", true, true));
|
||||
}
|
||||
|
||||
dump->push_back(iteminfo("ARMOR", " Bashing protection: ", "", int(armor->dmg_resist)));
|
||||
dump->push_back(iteminfo("ARMOR", " Cut protection: ", "", int(armor->cut_resist)));
|
||||
dump->push_back(iteminfo("ARMOR", " Environmental protection: ", "", int(armor->env_resist)));
|
||||
dump->push_back(iteminfo("ARMOR", " Warmth: ", "", int(armor->warmth)));
|
||||
dump->push_back(iteminfo("ARMOR", " Storage: ", "", int(armor->storage)));
|
||||
|
||||
/*
|
||||
dump << "\n Encumberment: " << int(armor->encumber) <<
|
||||
"\n Bashing protection: " << int(armor->dmg_resist) <<
|
||||
"\n Cut protection: " << int(armor->cut_resist) <<
|
||||
"\n Environmental protection: " << int(armor->env_resist) <<
|
||||
"\n Warmth: " << int(armor->warmth) <<
|
||||
"\n Storage: " << int(armor->storage);
|
||||
*/
|
||||
|
||||
} else if (is_book()) {
|
||||
|
||||
it_book* book = dynamic_cast<it_book*>(type);
|
||||
if (!book->type)
|
||||
dump->push_back(iteminfo("BOOK", " Just for fun.")); //dump << " Just for fun.\n";
|
||||
dump->push_back(iteminfo("BOOK", " Just for fun."));
|
||||
else {
|
||||
dump->push_back(iteminfo("BOOK", " Can bring your ", book->type->name() + " skill to ", int(book->level)));
|
||||
//dump << " Can bring your " << book->type->name() << " skill to " << int(book->level) << std::endl;
|
||||
|
||||
if (book->req == 0)
|
||||
dump->push_back(iteminfo("BOOK", " It can be understood by beginners.")); //dump << " It can be understood by beginners.\n";
|
||||
dump->push_back(iteminfo("BOOK", " It can be understood by beginners."));
|
||||
else
|
||||
dump->push_back(iteminfo("BOOK", " Requires ", book->type->name() + " level ", int(book->req), " to understand.", true, true)); //dump << " Requires " << book->type->name() << " level " << int(book->req) << " to understand.\n";
|
||||
dump->push_back(iteminfo("BOOK", " Requires ", book->type->name() + " level ", int(book->req), " to understand.", true, true));
|
||||
}
|
||||
|
||||
dump->push_back(iteminfo("BOOK", " Requires intelligence of ", "", int(book->intel), " to easily read.", true, true));
|
||||
//dump << " Requires intelligence of " << int(book->intel) << " to easily read." << std::endl;
|
||||
if (book->fun != 0)
|
||||
dump->push_back(iteminfo("BOOK", " Reading this book affects your morale by ", (book->fun > 0 ? "+" : ""), int(book->fun))); //dump << " Reading this book affects your morale by " << (book->fun > 0 ? "+" : "") << int(book->fun) << std::endl;
|
||||
dump->push_back(iteminfo("BOOK", " Reading this book affects your morale by ", (book->fun > 0 ? "+" : ""), int(book->fun)));
|
||||
|
||||
dump->push_back(iteminfo("BOOK", " This book takes ", "", int(book->time), " minutes to read.", true, true));
|
||||
//dump << " This book takes " << int(book->time) << " minutes to read.";
|
||||
|
||||
} else if (is_tool()) {
|
||||
it_tool* tool = dynamic_cast<it_tool*>(type);
|
||||
/*
|
||||
dump << " Maximum " << tool->max_charges << " charges";
|
||||
if (tool->ammo == AT_NULL)
|
||||
dump << ".";
|
||||
else
|
||||
dump << " of " << ammo_name(tool->ammo) << ".";
|
||||
*/
|
||||
dump->push_back(iteminfo("TOOL", " Maximum ", "", int(tool->max_charges), " charges" + ((tool->ammo == AT_NULL) ? "" : (" of " + ammo_name(tool->ammo))) + "."));
|
||||
|
||||
if ((tool->max_charges)!=0)
|
||||
dump->push_back(iteminfo("TOOL", " Maximum ", "", int(tool->max_charges), " charges" + ((tool->ammo == AT_NULL) ? "" : (" of " + ammo_name(tool->ammo))) + "."));
|
||||
|
||||
} else if (is_style()) {
|
||||
it_style* style = dynamic_cast<it_style*>(type);
|
||||
|
||||
//dump << "\n";
|
||||
for (int i = 0; i < style->moves.size(); i++) {
|
||||
dump->push_back(iteminfo("STYLE", default_technique_name(style->moves[i].tech), ". Requires Unarmed Skill of ", int(style->moves[i].level)));
|
||||
//dump << default_technique_name(style->moves[i].tech) << ". Requires Unarmed Skill of " << style->moves[i].level << "\n";
|
||||
}
|
||||
|
||||
} else if (!is_null() && type->techniques != 0) {
|
||||
//dump << "\n";
|
||||
temp1.str("");
|
||||
for (int i = 1; i < NUM_TECHNIQUES; i++) {
|
||||
if (type->techniques & mfb(i))
|
||||
temp1 << default_technique_name( technique_id(i) ) + "; "; //dump << default_technique_name( technique_id(i) ) << "; ";
|
||||
}
|
||||
|
||||
if (temp1.str() != "")
|
||||
dump->push_back(iteminfo("TECHNIQUE", temp1.str()));
|
||||
}
|
||||
|
||||
if ( showtext && !is_null() ) {
|
||||
//dump << "\n\n" << type->description << "\n";
|
||||
dump->push_back(iteminfo("DESCRIPTION", type->description));
|
||||
if (is_armor() && has_flag(IF_FIT))
|
||||
{
|
||||
dump->push_back(iteminfo("DESCRIPTION", "\n\n"));
|
||||
dump->push_back(iteminfo("DESCRIPTION", "This piece of clothing fits you perfectly."));
|
||||
}
|
||||
if (contents.size() > 0) {
|
||||
if (is_gun()) {
|
||||
for (int i = 0; i < contents.size(); i++)
|
||||
dump->push_back(iteminfo("DESCRIPTION", contents[i].type->description));
|
||||
//dump << "\n " << contents[i].type->description;
|
||||
} else
|
||||
dump->push_back(iteminfo("DESCRIPTION", contents[0].type->description));
|
||||
//dump << "\n " << contents[0].type->description;
|
||||
//dump << "\n";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -647,7 +607,7 @@ nc_color item::color(player *u)
|
||||
{
|
||||
nc_color ret = c_ltgray;
|
||||
|
||||
if (active) // Active items show up as yellow
|
||||
if (active && !is_food() && !is_food_container()) // Active items show up as yellow
|
||||
ret = c_yellow;
|
||||
else if (is_gun()) { // Guns are green if you are carrying ammo for them
|
||||
ammotype amtype = ammo_type();
|
||||
@@ -667,7 +627,7 @@ nc_color item::color(player *u)
|
||||
}
|
||||
} else if (is_book()) {
|
||||
it_book* tmp = dynamic_cast<it_book*>(type);
|
||||
if (tmp->type && tmp->intel <= u->int_cur + u->skillLevel(tmp->type).level() &&
|
||||
if (tmp->type && tmp->intel <= u->int_cur + u->skillLevel(tmp->type) &&
|
||||
(tmp->intel == 0 || !u->has_trait(PF_ILLITERATE)) &&
|
||||
(u->skillLevel(tmp->type) >= tmp->req) &&
|
||||
(u->skillLevel(tmp->type) < tmp->level))
|
||||
@@ -680,7 +640,7 @@ nc_color item::color_in_inventory(player *u)
|
||||
{
|
||||
// Items in our inventory get colorized specially
|
||||
nc_color ret = c_white;
|
||||
if (active)
|
||||
if (active && !is_food() && !is_food_container())
|
||||
ret = c_yellow;
|
||||
|
||||
return ret;
|
||||
@@ -743,7 +703,6 @@ std::string item::tname(game *g)
|
||||
if (damage == 4) damtext = "thoroughly rusted ";
|
||||
break;
|
||||
default:
|
||||
//damtext = "damaged ";
|
||||
if (damage == 1) damtext = "lightly damaged ";
|
||||
if (damage == 2) damtext = "damaged ";
|
||||
if (damage == 3) damtext = "very damaged ";
|
||||
@@ -753,7 +712,6 @@ std::string item::tname(game *g)
|
||||
}
|
||||
|
||||
if (is_var_veh_part()){
|
||||
//if(is_engine()){
|
||||
if(type->bigness_aspect == BIGNESS_ENGINE_DISPLACEMENT){ //liters, e.g. "3.21-Liter V8 engine"
|
||||
ret.precision(4);
|
||||
ret << (float)bigness/100 << "-Liter ";
|
||||
@@ -768,12 +726,12 @@ std::string item::tname(game *g)
|
||||
else if (burnt > 0)
|
||||
ret << "burnt ";
|
||||
|
||||
if (typeId() == itm_corpse) {
|
||||
if (typeId() == "corpse") {
|
||||
ret << corpse->name << " corpse";
|
||||
if (name != "")
|
||||
ret << " of " << name;
|
||||
return ret.str();
|
||||
} else if (typeId() == itm_blood) {
|
||||
} else if (typeId() == "blood") {
|
||||
if (corpse == NULL || corpse->id == mon_null)
|
||||
ret << "human blood";
|
||||
else
|
||||
@@ -799,7 +757,13 @@ std::string item::tname(game *g)
|
||||
food = dynamic_cast<it_comest*>(contents[0].type);
|
||||
if (food != NULL && g != NULL && food->spoils != 0 &&
|
||||
int(g->turn) < (int)bday + 100)
|
||||
ret << " (fresh)";
|
||||
if (food != NULL && g != NULL && has_flag(IF_HOT))
|
||||
ret << " (hot)";
|
||||
if (food != NULL && g != NULL && is_food_container()) {
|
||||
if (contents[0].has_flag(IF_HOT))
|
||||
ret << " (hot)";
|
||||
}
|
||||
if (food != NULL && g != NULL && food->spoils != 0 &&
|
||||
int(g->turn) - (int)bday > food->spoils * 600)
|
||||
ret << " (rotten)";
|
||||
@@ -811,7 +775,7 @@ std::string item::tname(game *g)
|
||||
|
||||
nc_color item::color()
|
||||
{
|
||||
if (typeId() == itm_corpse)
|
||||
if (typeId() == "corpse")
|
||||
return corpse->color;
|
||||
if( is_null() )
|
||||
return c_black;
|
||||
@@ -831,7 +795,7 @@ int item::price()
|
||||
|
||||
int item::weight()
|
||||
{
|
||||
if (typeId() == itm_corpse) {
|
||||
if (typeId() == "corpse") {
|
||||
int ret;
|
||||
switch (corpse->size) {
|
||||
case MS_TINY: ret = 5; break;
|
||||
@@ -881,7 +845,7 @@ int item::weight()
|
||||
|
||||
int item::volume()
|
||||
{
|
||||
if (typeId() == itm_corpse) {
|
||||
if (typeId() == "corpse") {
|
||||
switch (corpse->size) {
|
||||
case MS_TINY: return 2;
|
||||
case MS_SMALL: return 40;
|
||||
@@ -933,7 +897,7 @@ int item::damage_cut()
|
||||
{
|
||||
if (is_gun()) {
|
||||
for (int i = 0; i < contents.size(); i++) {
|
||||
if (contents[i].typeId() == itm_bayonet)
|
||||
if (contents[i].typeId() == "bayonet")
|
||||
return contents[i].type->melee_cut;
|
||||
}
|
||||
}
|
||||
@@ -944,22 +908,33 @@ int item::damage_cut()
|
||||
|
||||
bool item::has_flag(item_flag f)
|
||||
{
|
||||
bool ret = false;
|
||||
|
||||
// first check for flags specific to item type
|
||||
// gun flags
|
||||
if (is_gun()) {
|
||||
if (mode == IF_MODE_AUX) {
|
||||
item* gunmod = active_gunmod();
|
||||
if( gunmod != NULL )
|
||||
return gunmod->has_flag(f);
|
||||
ret = gunmod->has_flag(f);
|
||||
if (ret) return ret;
|
||||
} else {
|
||||
for (int i = 0; i < contents.size(); i++) {
|
||||
// Don't report flags from active gunmods for the gun.
|
||||
if (contents[i].has_flag(f) && contents[i].has_flag(IF_MODE_AUX))
|
||||
return true;
|
||||
if (contents[i].has_flag(f) && contents[i].has_flag(IF_MODE_AUX)) {
|
||||
ret = true;
|
||||
return ret;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
if( is_null() )
|
||||
return false;
|
||||
return (type->item_flags & mfb(f));
|
||||
// other item type flags
|
||||
ret = type->item_flags & mfb(f);
|
||||
if (ret) return ret;
|
||||
|
||||
// now check for item specific flags
|
||||
ret = item_flags & mfb(f);
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool item::has_technique(technique_id tech, player *p)
|
||||
@@ -977,7 +952,7 @@ bool item::has_technique(technique_id tech, player *p)
|
||||
return (type->techniques & mfb(tech));
|
||||
}
|
||||
|
||||
int item::has_gunmod(int type)
|
||||
int item::has_gunmod(itype_id type)
|
||||
{
|
||||
if (!is_gun())
|
||||
return -1;
|
||||
@@ -1070,14 +1045,11 @@ int item::weapon_value(int skills[num_skill_types])
|
||||
|
||||
my_value += int(type->melee_dam * (1 + .3 * skills[sk_bashing] +
|
||||
.1 * skills[sk_melee] ));
|
||||
//debugmsg("My value: (+bash) %d", my_value);
|
||||
|
||||
my_value += int(type->melee_cut * (1 + .4 * skills[sk_cutting] +
|
||||
.1 * skills[sk_melee] ));
|
||||
//debugmsg("My value: (+cut) %d", my_value);
|
||||
|
||||
my_value += int(type->m_to_hit * (1.2 + .3 * skills[sk_melee]));
|
||||
//debugmsg("My value: (+hit) %d", my_value);
|
||||
|
||||
return my_value;
|
||||
}
|
||||
@@ -1090,14 +1062,11 @@ int item::melee_value(int skills[num_skill_types])
|
||||
int my_value = 0;
|
||||
my_value += int(type->melee_dam * (1 + .3 * skills[sk_bashing] +
|
||||
.1 * skills[sk_melee] ));
|
||||
//debugmsg("My value: (+bash) %d", my_value);
|
||||
|
||||
my_value += int(type->melee_cut * (1 + .4 * skills[sk_cutting] +
|
||||
.1 * skills[sk_melee] ));
|
||||
//debugmsg("My value: (+cut) %d", my_value);
|
||||
|
||||
my_value += int(type->m_to_hit * (1.2 + .3 * skills[sk_melee]));
|
||||
//debugmsg("My value: (+hit) %d", my_value);
|
||||
|
||||
if (is_style())
|
||||
my_value += 15 * skills[sk_unarmed] + 8 * skills[sk_melee];
|
||||
@@ -1124,8 +1093,6 @@ style_move item::style_data(technique_id tech)
|
||||
|
||||
bool item::is_two_handed(player *u)
|
||||
{
|
||||
if (is_gun() && (dynamic_cast<it_gun*>(type))->skill_used != Skill::skill("pistol"))
|
||||
return true;
|
||||
return (weight() > u->str_cur * 4);
|
||||
}
|
||||
|
||||
@@ -1134,7 +1101,7 @@ bool item::made_of(material mat)
|
||||
if( is_null() )
|
||||
return false;
|
||||
|
||||
if (typeId() == itm_corpse)
|
||||
if (typeId() == "corpse")
|
||||
return (corpse->mat == mat);
|
||||
|
||||
return (type->m1 == mat || type->m2 == mat);
|
||||
@@ -1176,6 +1143,19 @@ bool item::is_gun()
|
||||
return type->is_gun();
|
||||
}
|
||||
|
||||
bool item::is_silent()
|
||||
{
|
||||
if ( is_null() )
|
||||
return false;
|
||||
|
||||
// So far only gun code uses this check
|
||||
return type->is_gun() && (
|
||||
noise() < 5 || // almost silent
|
||||
curammo->type == AT_BOLT || // crossbows
|
||||
curammo->type == AT_ARROW // bows
|
||||
);
|
||||
}
|
||||
|
||||
bool item::is_gunmod()
|
||||
{
|
||||
if( is_null() )
|
||||
@@ -1211,11 +1191,11 @@ bool item::is_food(player *u)
|
||||
if (type->is_food())
|
||||
return true;
|
||||
|
||||
if (u->has_bionic(bio_batteries) && is_ammo() &&
|
||||
if (u->has_bionic("bio_batteries") && is_ammo() &&
|
||||
(dynamic_cast<it_ammo*>(type))->type == AT_BATT)
|
||||
return true;
|
||||
if (u->has_bionic(bio_furnace) && is_flammable(type->m1) &&
|
||||
is_flammable(type->m2) && typeId() != itm_corpse)
|
||||
if (u->has_bionic("bio_furnace") && is_flammable(type->m1) &&
|
||||
is_flammable(type->m2) && typeId() != "corpse")
|
||||
return true;
|
||||
return false;
|
||||
}
|
||||
@@ -1293,12 +1273,6 @@ bool item::is_book()
|
||||
if( is_null() )
|
||||
return false;
|
||||
|
||||
/*
|
||||
if (type->is_macguffin()) {
|
||||
it_macguffin* mac = dynamic_cast<it_macguffin*>(type);
|
||||
return mac->readable;
|
||||
}
|
||||
*/
|
||||
return type->is_book();
|
||||
}
|
||||
|
||||
@@ -1368,11 +1342,11 @@ int item::reload_time(player &u)
|
||||
it_gun* reloading = dynamic_cast<it_gun*>(type);
|
||||
ret = reloading->reload_time;
|
||||
if (charges == 0) {
|
||||
int spare_mag = has_gunmod(itm_spare_mag);
|
||||
int spare_mag = has_gunmod("spare_mag");
|
||||
if (spare_mag != -1 && contents[spare_mag].charges > 0)
|
||||
ret -= double(ret) * 0.9;
|
||||
}
|
||||
double skill_bonus = double(u.skillLevel(reloading->skill_used).level()) * .075;
|
||||
double skill_bonus = double(u.skillLevel(reloading->skill_used)) * .075;
|
||||
if (skill_bonus > .75)
|
||||
skill_bonus = .75;
|
||||
ret -= double(ret) * skill_bonus;
|
||||
@@ -1631,7 +1605,7 @@ int item::pick_reload_ammo(player &u, bool interactive)
|
||||
debugmsg("RELOADING NON-GUN NON-TOOL");
|
||||
return false;
|
||||
}
|
||||
int has_spare_mag = has_gunmod (itm_spare_mag);
|
||||
int has_spare_mag = has_gunmod ("spare_mag");
|
||||
|
||||
std::vector<int> am; // List of indicies of valid ammo
|
||||
|
||||
@@ -1672,7 +1646,7 @@ int item::pick_reload_ammo(player &u, bool interactive)
|
||||
int index = -1;
|
||||
|
||||
if (am.size() > 1 && interactive) {// More than one option; list 'em and pick
|
||||
WINDOW* w_ammo = newwin(am.size() + 1, 80, 0, 0);
|
||||
WINDOW* w_ammo = newwin(am.size() + 1, 80, VIEW_OFFSET_Y, VIEW_OFFSET_X);
|
||||
char ch;
|
||||
clear();
|
||||
it_ammo* ammo_type;
|
||||
@@ -1721,7 +1695,7 @@ bool item::reload(player &u, int index)
|
||||
|
||||
if (is_gun()) {
|
||||
// Reload using a spare magazine
|
||||
int spare_mag = has_gunmod(itm_spare_mag);
|
||||
int spare_mag = has_gunmod("spare_mag");
|
||||
if (charges <= 0 && spare_mag != -1 &&
|
||||
u.weapon.contents[spare_mag].charges > 0) {
|
||||
charges = u.weapon.contents[spare_mag].charges;
|
||||
@@ -1765,7 +1739,7 @@ bool item::reload(player &u, int index)
|
||||
return false;
|
||||
|
||||
if (reload_target->is_gun() || reload_target->is_gunmod()) {
|
||||
if (reload_target->is_gunmod() && reload_target->typeId() == itm_spare_mag) {
|
||||
if (reload_target->is_gunmod() && reload_target->typeId() == "spare_mag") {
|
||||
// Use gun numbers instead of the mod if it's a spare magazine
|
||||
max_load = (dynamic_cast<it_gun*>(type))->clip;
|
||||
single_load = has_flag(IF_RELOAD_ONE);
|
||||
@@ -1809,10 +1783,16 @@ bool item::reload(player &u, int index)
|
||||
}
|
||||
}
|
||||
if (ammo_to_use->charges == 0)
|
||||
if (u.inv[index].is_container())
|
||||
u.inv[index].contents.erase(u.inv[index].contents.begin());
|
||||
else
|
||||
u.i_remn(index);
|
||||
{
|
||||
if (u.inv[index].is_container())
|
||||
{
|
||||
u.inv[index].contents.erase(u.inv[index].contents.begin());
|
||||
}
|
||||
else
|
||||
{
|
||||
u.i_remn(index);
|
||||
}
|
||||
}
|
||||
return true;
|
||||
} else
|
||||
return false;
|
||||
@@ -1880,9 +1860,9 @@ std::ostream & operator<<(std::ostream & out, const item & it)
|
||||
}
|
||||
|
||||
|
||||
int item::typeId()
|
||||
itype_id item::typeId()
|
||||
{
|
||||
if (!type)
|
||||
return itm_null;
|
||||
return "null";
|
||||
return type->id;
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
void make(itype* it);
|
||||
|
||||
// returns the default container of this item, with this item in it
|
||||
item in_its_container(std::vector<itype*> *itypes);
|
||||
item in_its_container(std::map<std::string, itype*> *itypes);
|
||||
|
||||
nc_color color(player *u);
|
||||
nc_color color_in_inventory(player *u);
|
||||
@@ -86,7 +86,7 @@ public:
|
||||
int damage_cut();
|
||||
bool has_flag(item_flag f);
|
||||
bool has_technique(technique_id t, player *p = NULL);
|
||||
int has_gunmod(int type);
|
||||
int has_gunmod(itype_id type);
|
||||
item* active_gunmod();
|
||||
std::vector<technique_id> techniques();
|
||||
bool goes_bad();
|
||||
@@ -117,6 +117,7 @@ public:
|
||||
bool is_bashing_weapon();
|
||||
bool is_cutting_weapon();
|
||||
bool is_gun();
|
||||
bool is_silent();
|
||||
bool is_gunmod();
|
||||
bool is_bionic();
|
||||
bool is_ammo();
|
||||
@@ -131,9 +132,8 @@ public:
|
||||
bool is_var_veh_part();
|
||||
bool is_artifact();
|
||||
|
||||
int typeId();
|
||||
|
||||
itype* type;
|
||||
itype_id typeId();
|
||||
itype* type;
|
||||
mtype* corpse;
|
||||
it_ammo* curammo;
|
||||
|
||||
@@ -152,7 +152,8 @@ public:
|
||||
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!
|
||||
|
||||
@@ -165,4 +166,12 @@ private:
|
||||
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
|
||||
|
||||
@@ -31,250 +31,12 @@ enum item_cat
|
||||
IC_CONTAINER
|
||||
};
|
||||
|
||||
|
||||
enum itype_id {
|
||||
itm_null = 0,
|
||||
itm_corpse,
|
||||
// Special pseudoitems
|
||||
itm_fire, itm_toolset, itm_apparatus,
|
||||
// Drinks
|
||||
itm_water, itm_water_clean, itm_sewage, itm_salt_water, itm_oj, itm_apple_cider,
|
||||
itm_energy_drink, itm_cola, itm_rootbeer, itm_milk, itm_V8, itm_broth,
|
||||
itm_soup, itm_whiskey, itm_vodka, itm_gin, itm_rum, itm_tequila, itm_triple_sec,
|
||||
itm_long_island, itm_beer, itm_bleach,
|
||||
itm_ammonia, itm_mutagen, itm_purifier, itm_tea, itm_coffee, itm_blood,
|
||||
// Monster Meats
|
||||
itm_meat, itm_veggy, itm_human_flesh, itm_veggy_wild, itm_meat_tainted, itm_veggy_tainted,
|
||||
itm_meat_cooked, itm_veggy_cooked, itm_veggy_wild_cooked,
|
||||
// Food
|
||||
itm_apple, itm_orange, itm_lemon, itm_chips, itm_chips2, itm_chips3,
|
||||
itm_pretzels, itm_chocolate,
|
||||
itm_jerky, itm_sandwich_t, itm_candy, itm_mushroom, itm_mushroom_poison,
|
||||
itm_mushroom_magic, itm_blueberries, itm_strawberries, itm_tomato,
|
||||
itm_broccoli, itm_zucchini, itm_corn, itm_frozen_dinner, itm_cooked_dinner,
|
||||
itm_spaghetti_raw, itm_spaghetti_cooked, itm_macaroni_raw, itm_macaroni_cooked,
|
||||
itm_ravioli, itm_sauce_red, itm_sauce_pesto, itm_can_beans, itm_can_corn,
|
||||
itm_can_spam, itm_can_pineapple, itm_can_coconut, itm_can_sardine,
|
||||
itm_can_tuna, itm_can_catfood, itm_honeycomb, itm_wax, itm_royal_jelly, itm_fetus,
|
||||
itm_arm, itm_leg, itm_ant_egg, itm_marloss_berry, itm_flour, itm_sugar,
|
||||
itm_salt, itm_potato_raw, itm_potato_baked, itm_bread, itm_pie, itm_pizza,
|
||||
itm_mre_beef, itm_mre_veggy, itm_tea_raw, itm_coffee_raw,
|
||||
// Medication
|
||||
itm_bandages, itm_1st_aid, itm_vitamins, itm_aspirin, itm_caffeine,
|
||||
itm_pills_sleep, itm_iodine, itm_dayquil, itm_nyquil, itm_inhaler, itm_codeine,
|
||||
itm_oxycodone, itm_tramadol, itm_xanax, itm_adderall, itm_thorazine,
|
||||
itm_prozac, itm_cig, itm_weed, itm_coke, itm_meth, itm_heroin, itm_cigar,
|
||||
itm_antibiotics, itm_poppy_sleep, itm_poppy_pain, itm_crack, /*itm_grack,*/
|
||||
// Do-nothing / Melee weapons
|
||||
itm_wrapper, itm_withered, itm_syringe, itm_fur, itm_leather, itm_superglue,
|
||||
itm_id_science, itm_id_military, itm_electrohack, itm_string_6, itm_string_36,
|
||||
itm_rope_6, itm_rope_30, itm_chain, itm_processor, itm_RAM, itm_power_supply,
|
||||
itm_amplifier, itm_transponder, itm_receiver, itm_antenna, itm_steel_chunk,
|
||||
itm_steel_lump, itm_scrap, itm_hose, itm_glass_sheet, itm_manhole_cover, itm_rock,
|
||||
itm_stick, itm_broom,
|
||||
itm_hammer_sledge, itm_hatchet, itm_nailboard, itm_nailbat,
|
||||
itm_pot, itm_pan, itm_knife_butter, itm_2x4, itm_muffler,
|
||||
itm_pipe, itm_bat, itm_bat_metal,
|
||||
itm_spear_wood, itm_baton,
|
||||
itm_bee_sting, itm_wasp_sting, itm_chitin_piece, itm_biollante_bud,
|
||||
itm_canister_empty, itm_gold, itm_coal, itm_petrified_eye, itm_spiral_stone,
|
||||
itm_cane, itm_binoculars, itm_usb_drive,
|
||||
itm_mace, itm_morningstar, itm_pool_cue, itm_pool_ball, itm_candlestick,
|
||||
itm_carspike, itm_carblade, itm_wire, itm_wire_barbed, itm_rebar, itm_log,
|
||||
itm_splinter, itm_skewer, itm_crackpipe, itm_torch_done,
|
||||
itm_spring, itm_lawnmower, itm_sheet, itm_broketent, itm_element,
|
||||
itm_television, itm_pilot_light, itm_toaster, itm_microwave, itm_laptop,
|
||||
itm_fan, itm_ceramic_plate, itm_ceramic_bowl, itm_ceramic_cup,
|
||||
itm_glass_plate, itm_glass_bowl, itm_glass, itm_tin_plate, itm_fork, itm_spork,
|
||||
itm_foon, itm_rag_bloody, itm_clock, itm_clockworks,
|
||||
// Vehicle parts
|
||||
itm_frame,
|
||||
itm_wheel, itm_wheel_wide, itm_wheel_bicycle, itm_wheel_motorbike, itm_wheel_small,
|
||||
itm_seat, itm_vehicle_controls,
|
||||
itm_1cyl_combustion, itm_v2_combustion, itm_i4_combustion,
|
||||
itm_v6_combustion, itm_v8_combustion,
|
||||
itm_motor, itm_motor_large, itm_plasma_engine, itm_foot_crank,
|
||||
itm_metal_tank, itm_storage_battery, itm_minireactor, itm_solar_panel,
|
||||
itm_steel_plate, itm_alloy_plate, itm_spiked_plate, itm_hard_plate,
|
||||
// Footwear
|
||||
itm_socks, itm_socks_wool,
|
||||
itm_sneakers, itm_boots, itm_boots_steel, itm_boots_winter, itm_mocassins,
|
||||
itm_flip_flops, itm_dress_shoes, itm_heels,
|
||||
itm_sneakers_fit, itm_boots_fit, itm_boots_steel_fit, itm_boots_winter_fit,
|
||||
itm_dress_shoes_fit, itm_heels_fit,
|
||||
// Legwear
|
||||
itm_shorts, itm_shorts_cargo,
|
||||
itm_jeans, itm_pants, itm_pants_leather, itm_pants_cargo, itm_pants_army, itm_pants_ski,
|
||||
itm_long_underpants, itm_skirt,
|
||||
itm_jeans_fit, itm_pants_fit, itm_pants_cargo_fit, itm_pants_army_fit,
|
||||
// Full-body clothing
|
||||
itm_jumpsuit, itm_dress, itm_armor_chitin, itm_suit, itm_hazmat_suit,
|
||||
itm_armor_plate,
|
||||
// Torso clothing
|
||||
itm_tshirt, itm_polo_shirt, itm_dress_shirt, itm_tank_top, itm_sweatshirt,
|
||||
itm_sweater, itm_hoodie, itm_under_armor, itm_jacket_light, itm_jacket_jean, itm_blazer,
|
||||
itm_jacket_leather, itm_kevlar, itm_coat_rain, itm_poncho, itm_trenchcoat, itm_trenchcoat_leather,
|
||||
itm_coat_winter, itm_coat_fur, itm_peacoat, itm_vest, itm_beltrig, itm_coat_lab,
|
||||
itm_tshirt_fit, itm_polo_shirt_fit, itm_hoodie_fit, itm_sweatshirt_fit, itm_sweater_fit,
|
||||
itm_jacket_light_fit, itm_jacket_leather_fit, itm_trenchcoat_fit, itm_trenchcoat_leather_fit,
|
||||
// Arm clothing
|
||||
itm_armguard_soft, itm_armguard_hard, itm_armguard_chitin, itm_armguard_metal,
|
||||
// Gloves
|
||||
itm_gloves_liner, itm_gloves_light, itm_mittens, itm_gloves_wool, itm_gloves_winter,
|
||||
itm_gloves_leather, itm_gloves_fingerless, itm_gloves_rubber,
|
||||
itm_gloves_medical, itm_fire_gauntlets,
|
||||
// Masks
|
||||
itm_mask_dust, itm_bandana, itm_scarf, itm_mask_filter, itm_mask_gas,
|
||||
// Eyewear
|
||||
itm_glasses_eye, itm_glasses_reading, itm_glasses_safety, itm_goggles_swim,
|
||||
itm_goggles_ski, itm_goggles_welding, itm_goggles_nv, itm_glasses_monocle, itm_sunglasses,
|
||||
// Headwear
|
||||
itm_hat_ball, itm_hat_boonie, itm_hat_cotton, itm_hat_knit, itm_hat_hunting, itm_hat_fur, itm_balclava, itm_hat_hard,
|
||||
itm_helmet_bike, itm_helmet_skid, itm_helmet_ball, itm_helmet_army, itm_helmet_riot,
|
||||
itm_helmet_motor, itm_helmet_chitin, itm_helmet_plate, itm_tophat,
|
||||
// High-storage
|
||||
itm_backpack, itm_rucksack, itm_purse, itm_mbag, itm_fanny, itm_holster, itm_bootstrap,
|
||||
// Decorative
|
||||
itm_ring, itm_necklace,
|
||||
// Ammunition
|
||||
itm_battery, itm_thread, itm_duct_tape, itm_cable, itm_plut_cell,
|
||||
itm_nail, itm_bb, itm_arrow_wood, itm_arrow_cf,
|
||||
itm_bolt_wood, itm_bolt_steel, itm_shot_bird, itm_shot_00, itm_shot_slug,
|
||||
itm_shot_he, itm_22_lr, itm_22_cb, itm_22_ratshot, itm_9mm, itm_9mmP,
|
||||
itm_9mmP2, itm_38_special, itm_38_super, itm_10mm, itm_40sw, itm_44magnum,
|
||||
itm_45_acp, itm_45_jhp, itm_45_super, itm_57mm, itm_46mm, itm_762_m43,
|
||||
itm_762_m87, itm_223, itm_556, itm_556_incendiary, itm_270, itm_3006,
|
||||
itm_3006_incendiary, itm_308, itm_762_51, itm_762_51_incendiary,
|
||||
itm_laser_pack, itm_40mm_concussive, itm_40mm_frag, itm_40mm_incendiary,
|
||||
itm_40mm_teargas, itm_40mm_smoke, itm_40mm_flashbang, itm_12mm, itm_plasma,
|
||||
itm_charge_shot,
|
||||
itm_shot_hull,
|
||||
itm_9mm_casing, itm_38_casing, itm_40_casing, itm_44_casing, itm_45_casing,
|
||||
itm_57mm_casing, itm_46mm_casing, itm_762_casing, itm_223_casing,
|
||||
itm_3006_casing, itm_308_casing, itm_40mm_casing, itm_gunpowder,
|
||||
itm_shotgun_primer, itm_smpistol_primer, itm_lgpistol_primer,
|
||||
itm_smrifle_primer, itm_lgrifle_primer, itm_lead, itm_incendiary, itm_gasoline,
|
||||
// Guns
|
||||
itm_nailgun, itm_bbgun, itm_crossbow, itm_compbow, itm_longbow, itm_rifle_22,
|
||||
itm_rifle_9mm, itm_smg_9mm, itm_smg_45, itm_sig_mosquito, itm_sw_22,
|
||||
itm_glock_19, itm_usp_9mm, itm_sw_619, itm_taurus_38, itm_sig_40, itm_sw_610,
|
||||
itm_ruger_redhawk, itm_deagle_44, itm_usp_45, itm_m1911, itm_fn57, itm_hk_ucp,
|
||||
itm_shotgun_sawn, itm_saiga_sawn, itm_shotgun_s, itm_shotgun_d, itm_remington_870,
|
||||
itm_mossberg_500, itm_saiga_12, itm_american_180, itm_uzi, itm_tec9,
|
||||
itm_calico, itm_hk_mp5, itm_mac_10, itm_hk_ump45, itm_TDI, itm_fn_p90,
|
||||
itm_hk_mp7, itm_marlin_9a, itm_ruger_1022, itm_browning_blr,
|
||||
itm_remington_700, itm_sks, itm_ruger_mini, itm_savage_111f, itm_hk_g3,
|
||||
itm_hk_g36, itm_ak47, itm_fn_fal, itm_acr, itm_ar15, itm_m4a1, itm_scar_l,
|
||||
itm_scar_h, itm_steyr_aug, itm_m249, itm_v29, itm_ftk93, itm_nx17,
|
||||
itm_flamethrower_simple, itm_flamethrower, itm_launcher_simple, itm_m79,
|
||||
itm_m320, itm_mgl, itm_coilgun, itm_hk_g80, itm_plasma_rifle,
|
||||
itm_revolver_shotgun,
|
||||
// Gun modifications
|
||||
itm_silencer, itm_grip, itm_barrel_big, itm_barrel_small, itm_barrel_rifled,
|
||||
itm_clip, itm_clip2, itm_spare_mag, itm_stablizer, itm_blowback, itm_autofire,
|
||||
itm_retool_45, itm_retool_9mm, itm_retool_22, itm_retool_57, itm_retool_46,
|
||||
itm_retool_308, itm_retool_223, itm_conversion_battle, itm_conversion_sniper,
|
||||
itm_m203, itm_bayonet, itm_u_shotgun, itm_gun_crossbow,
|
||||
// Books
|
||||
itm_mag_porn, itm_mag_tv, itm_mag_news, itm_mag_cars, itm_mag_cooking,
|
||||
itm_mag_carpentry,
|
||||
itm_mag_guns, itm_mag_archery, itm_novel_romance, itm_novel_spy, itm_novel_scifi,
|
||||
itm_novel_drama, itm_manual_brawl, itm_manual_knives, itm_manual_mechanics, itm_manual_survival,
|
||||
itm_manual_speech, itm_manual_business, itm_manual_first_aid,
|
||||
itm_manual_computers, itm_cookbook, itm_manual_electronics,
|
||||
itm_manual_tailor, itm_manual_traps, itm_manual_carpentry,
|
||||
itm_textbook_computers, itm_textbook_electronics, itm_textbook_business, itm_textbook_mechanics,
|
||||
itm_textbook_chemistry, itm_textbook_carpentry, itm_SICP, itm_textbook_robots,
|
||||
// Containers
|
||||
itm_bag_plastic, itm_bottle_plastic, itm_bottle_glass,
|
||||
itm_can_drink, itm_can_food, itm_box_small,
|
||||
itm_canteen, itm_jerrycan, itm_carboy_plastic, itm_flask_glass,
|
||||
// Tools
|
||||
itm_lighter, itm_sewing_kit, itm_scissors, itm_hammer, itm_extinguisher,
|
||||
itm_flashlight, itm_flashlight_on, itm_hotplate, itm_soldering_iron,
|
||||
itm_water_purifier, itm_two_way_radio, itm_radio, itm_radio_on, itm_crowbar,
|
||||
itm_hoe, itm_shovel, itm_chainsaw_off, itm_chainsaw_on, itm_jackhammer, itm_jacqueshammer,
|
||||
itm_bubblewrap, itm_beartrap, itm_board_trap, itm_tripwire, itm_crossbow_trap,
|
||||
itm_shotgun_trap, itm_blade_trap, itm_landmine, itm_geiger_off, itm_geiger_on,
|
||||
itm_teleporter, itm_canister_goo, itm_pipebomb, itm_pipebomb_act, itm_grenade,
|
||||
itm_grenade_act, itm_flashbang, itm_flashbang_act, itm_EMPbomb,
|
||||
itm_EMPbomb_act, itm_scrambler, itm_scrambler_act, itm_gasbomb, itm_gasbomb_act, itm_smokebomb,
|
||||
itm_smokebomb_act, itm_molotov, itm_molotov_lit, itm_acidbomb,
|
||||
itm_acidbomb_act, itm_dynamite, itm_dynamite_act, itm_mininuke,
|
||||
itm_mininuke_act, itm_pheromone, itm_portal, itm_bot_manhack, itm_bot_turret,
|
||||
itm_UPS_off, itm_UPS_on, itm_tazer, itm_mp3, itm_mp3_on, itm_vortex_stone,
|
||||
itm_dogfood, itm_boobytrap, itm_c4, itm_c4armed, itm_dog_whistle,
|
||||
itm_vacutainer, itm_welder, itm_cot, itm_rollmat, itm_xacto, itm_scalpel,
|
||||
itm_machete, itm_katana, itm_spear_knife, itm_rapier, itm_pike, itm_broadsword,
|
||||
itm_lawnmower_blade, itm_lawnmower_machete, itm_lawnmower_halberd, itm_knife_steak,
|
||||
itm_knife_butcher, itm_knife_combat, itm_saw, itm_ax, itm_hacksaw,
|
||||
itm_tent_kit, itm_torch, itm_torch_lit, itm_candle, itm_candle_lit,
|
||||
itm_brazier, itm_puller, itm_press, itm_screwdriver, itm_wrench,
|
||||
itm_boltcutters, itm_mop, itm_picklocks, itm_pickaxe, itm_spray_can, itm_rag,
|
||||
itm_pda, itm_pda_flashlight, itm_pockknife,
|
||||
// Bionics containers
|
||||
itm_bionics_battery,
|
||||
//power sources
|
||||
itm_bionics_solar, itm_bionics_batteries,
|
||||
itm_bionics_metabolics, itm_bionics_furnace, itm_bionics_ethanol,
|
||||
// utility
|
||||
itm_bionics_toolset, itm_bionics_storage, itm_bionics_flashlight,
|
||||
itm_bionics_lighter, itm_bionics_magnet,
|
||||
// neuro
|
||||
itm_bionics_memory, itm_bionics_painkiller,itm_bionics_alarm,
|
||||
// sensory
|
||||
itm_bionics_ears, itm_bionics_eye_enhancer, itm_bionics_night_vision,
|
||||
itm_bionics_infrared, itm_bionics_scent_vision,
|
||||
// cbm: aquatic
|
||||
itm_bionics_membrane, itm_bionics_gills,
|
||||
// cbm: combat augs
|
||||
itm_bionics_targeting, itm_bionics_ground_sonar,
|
||||
// cbm: hazmat
|
||||
itm_bionics_purifier, itm_bionics_climate, itm_bionics_heatsink, itm_bionics_blood_filter,
|
||||
// nutritional
|
||||
itm_bionics_recycler, itm_bionics_digestion, itm_bionics_evap, itm_bionics_water_extractor,
|
||||
// desert survival (all dupes)
|
||||
// melee:
|
||||
itm_bionics_shock, itm_bionics_heat_absorb, itm_bionics_claws,
|
||||
// armor:
|
||||
itm_bionics_carbon, itm_bionics_armor_head, itm_bionics_armor_torso,
|
||||
itm_bionics_armor_arms, itm_bionics_armor_legs,
|
||||
// espionage
|
||||
itm_bionics_face_mask, itm_bionics_scent_mask, itm_bionics_cloak, itm_bionics_fingerhack,
|
||||
//defense
|
||||
itm_bionics_ads, itm_bionics_ods,
|
||||
// medical
|
||||
itm_bionics_nanobots, itm_bionics_blood_anal,
|
||||
// construction
|
||||
itm_bionics_resonator, itm_bionics_hydraulics,
|
||||
// super soldier
|
||||
itm_bionics_time_freeze, itm_bionics_teleport,
|
||||
// ranged combat
|
||||
itm_bionics_blaster, itm_bionics_laser, itm_bionics_emp,
|
||||
|
||||
// Software
|
||||
itm_software_useless, itm_software_hacking, itm_software_medical,
|
||||
itm_software_math, itm_software_blood_data,
|
||||
// MacGuffins!
|
||||
itm_note,
|
||||
//-----Jovan's. Flowers!-----
|
||||
itm_poppy_flower, itm_poppy_bud,
|
||||
//---------------------------
|
||||
|
||||
// Static (non-random) artifacts should go here.
|
||||
num_items,
|
||||
// These shouldn't be counted among "normal" items; thus, they are outside the
|
||||
// bounds of num_items
|
||||
itm_bio_claws, itm_bio_fusion, itm_bio_blaster,
|
||||
// Unarmed Combat Styles
|
||||
itm_style_karate, itm_style_aikido, itm_style_judo, itm_style_tai_chi,
|
||||
itm_style_capoeira, itm_style_krav_maga, itm_style_muay_thai,
|
||||
itm_style_ninjutsu, itm_style_taekwando, itm_style_tiger, itm_style_crane,
|
||||
itm_style_leopard, itm_style_snake, itm_style_dragon, itm_style_centipede,
|
||||
itm_style_venom_snake, itm_style_scorpion, itm_style_lizard, itm_style_toad,
|
||||
itm_style_zui_quan,
|
||||
num_all_items
|
||||
};
|
||||
typedef std::string itype_id;
|
||||
extern std::vector<std::string> unreal_itype_ids;
|
||||
extern std::vector<std::string> martial_arts_itype_ids;
|
||||
extern std::vector<std::string> artifact_itype_ids;
|
||||
extern std::vector<std::string> standard_itype_ids;
|
||||
extern std::vector<std::string> pseudo_itype_ids;
|
||||
|
||||
// IMPORTANT: If adding a new AT_*** ammotype, add it to the ammo_name function
|
||||
// at the end of itypedef.cpp
|
||||
@@ -283,15 +45,17 @@ AT_NULL, AT_THREAD,
|
||||
AT_BATT, AT_PLUT,
|
||||
AT_NAIL, AT_BB, AT_BOLT, AT_ARROW,
|
||||
AT_SHOT,
|
||||
AT_22, AT_9MM, AT_38, AT_40, AT_44, AT_45,
|
||||
AT_22, AT_9MM, AT_762x25, AT_38, AT_40, AT_44, AT_45,
|
||||
AT_57, AT_46,
|
||||
AT_762, AT_223, AT_3006, AT_308,
|
||||
AT_40MM,
|
||||
AT_66MM,
|
||||
AT_GAS,
|
||||
AT_FUSION,
|
||||
AT_MUSCLE,
|
||||
AT_12MM,
|
||||
AT_PLASMA,
|
||||
AT_WATER,
|
||||
NUM_AMMO_TYPES
|
||||
};
|
||||
|
||||
@@ -329,11 +93,22 @@ IF_SHOCK, // Stuns and damages enemies, powers up shockers.
|
||||
|
||||
IF_UNARMED_WEAPON, // Counts as an unarmed weapon
|
||||
IF_NO_UNWIELD, // Impossible to unwield, e.g. bionic claws
|
||||
IF_NO_UNLOAD, // Cannot be unloaded. For Fusion rifles and other ammo generating weapons.
|
||||
IF_BACKBLAST, // Creates a backblast of smoke.
|
||||
|
||||
// Weapon mode flags
|
||||
IF_MODE_AUX, // A gunmod with a firing mode
|
||||
IF_MODE_BURST, // A burst of attacks
|
||||
|
||||
// Food status flags
|
||||
IF_HOT, // hot food
|
||||
IF_EATEN_HOT, // food meant to be eaten hot
|
||||
IF_ROTTEN, // rotten food
|
||||
|
||||
// Clothing flags
|
||||
IF_VARSIZE, // comes in variable sizes (item type flag)
|
||||
IF_FIT, // clothing fits player (item specific flag)
|
||||
|
||||
NUM_ITEM_FLAGS
|
||||
};
|
||||
|
||||
@@ -407,12 +182,12 @@ struct style_move
|
||||
|
||||
// Returns the name of a category of ammo (e.g. "shot")
|
||||
std::string ammo_name(ammotype t);
|
||||
// Returns the default ammo for a category of ammo (e.g. "itm_00_shot")
|
||||
// Returns the default ammo for a category of ammo (e.g. ""00_shot"")
|
||||
itype_id default_ammo(ammotype guntype);
|
||||
|
||||
struct itype
|
||||
{
|
||||
int id; // ID # that matches its place in master itype list
|
||||
itype_id id; // ID # that matches its place in master itype list
|
||||
// Used for save files; aligns to itype_id above.
|
||||
unsigned char rarity; // How often it's found
|
||||
unsigned int price; // Its value
|
||||
@@ -444,6 +219,7 @@ struct itype
|
||||
virtual bool is_gunmod() { return false; }
|
||||
virtual bool is_bionic() { return false; }
|
||||
virtual bool is_armor() { return false; }
|
||||
virtual bool is_power_armor() { return false; }
|
||||
virtual bool is_book() { return false; }
|
||||
virtual bool is_tool() { return false; }
|
||||
virtual bool is_container() { return false; }
|
||||
@@ -458,7 +234,7 @@ struct itype
|
||||
virtual std::string save_data() { return std::string(); }
|
||||
|
||||
itype() {
|
||||
id = 0;
|
||||
id = "null";
|
||||
rarity = 0;
|
||||
name = "none";
|
||||
sym = '#';
|
||||
@@ -473,7 +249,7 @@ struct itype
|
||||
techniques = 0;
|
||||
}
|
||||
|
||||
itype(int pid, unsigned char prarity, unsigned int pprice,
|
||||
itype(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -501,60 +277,64 @@ struct itype
|
||||
// Includes food drink and drugs
|
||||
struct it_comest : public itype
|
||||
{
|
||||
signed char quench; // Many things make you thirstier!
|
||||
unsigned char nutr; // Nutrition imparted
|
||||
unsigned char spoils; // How long it takes to spoil (hours / 600 turns)
|
||||
unsigned char addict; // Addictiveness potential
|
||||
unsigned char charges; // Defaults # of charges (drugs, loaf of bread? etc)
|
||||
signed char stim;
|
||||
signed char healthy;
|
||||
signed char quench; // Many things make you thirstier!
|
||||
unsigned char nutr; // Nutrition imparted
|
||||
unsigned char spoils; // How long it takes to spoil (hours / 600 turns)
|
||||
unsigned char addict; // Addictiveness potential
|
||||
unsigned char charges; // Defaults # of charges (drugs, loaf of bread? etc)
|
||||
signed char stim;
|
||||
signed char healthy;
|
||||
std::string comesttype; //FOOD, DRINK, MED
|
||||
|
||||
signed char fun; // How fun its use is
|
||||
signed char fun; // How fun its use is
|
||||
|
||||
itype_id container; // The container it comes in
|
||||
itype_id tool; // Tool needed to consume (e.g. lighter for cigarettes)
|
||||
itype_id container; // The container it comes in
|
||||
itype_id tool; // Tool needed to consume (e.g. lighter for cigarettes)
|
||||
|
||||
virtual bool is_food() { return true; }
|
||||
// virtual bool count_by_charges() { return charges >= 1 ; }
|
||||
virtual bool is_food() { return true; }
|
||||
// virtual bool count_by_charges() { return charges >= 1 ; }
|
||||
|
||||
virtual bool count_by_charges()
|
||||
{
|
||||
if (m1 == LIQUID) return true;
|
||||
else
|
||||
return charges > 1 ;
|
||||
}
|
||||
virtual bool count_by_charges()
|
||||
{
|
||||
if (m1 == LIQUID) {
|
||||
return true;
|
||||
} else {
|
||||
return charges > 1 ;
|
||||
}
|
||||
}
|
||||
|
||||
void (iuse::*use)(game *, player *, item *, bool);// Special effects of use
|
||||
add_type add; // Effects of addiction
|
||||
|
||||
void (iuse::*use)(game *, player *, item *, bool);// Special effects of use
|
||||
add_type add; // Effects of addiction
|
||||
it_comest(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
signed char pmelee_dam, signed char pmelee_cut,
|
||||
signed char pm_to_hit, unsigned pitem_flags,
|
||||
|
||||
it_comest(int pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
signed char pmelee_dam, signed char pmelee_cut,
|
||||
signed char pm_to_hit, unsigned pitem_flags,
|
||||
|
||||
signed char pquench, unsigned char pnutr, signed char pspoils,
|
||||
signed char pstim, signed char phealthy, unsigned char paddict,
|
||||
unsigned char pcharges, signed char pfun, itype_id pcontainer,
|
||||
itype_id ptool, void (iuse::*puse)(game *, player *, item *, bool),
|
||||
add_type padd)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, MNULL,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
quench = pquench;
|
||||
nutr = pnutr;
|
||||
spoils = pspoils;
|
||||
stim = pstim;
|
||||
healthy = phealthy;
|
||||
addict = paddict;
|
||||
charges = pcharges;
|
||||
fun = pfun;
|
||||
container = pcontainer;
|
||||
tool = ptool;
|
||||
use = puse;
|
||||
add = padd;
|
||||
}
|
||||
signed char pquench, unsigned char pnutr, signed char pspoils,
|
||||
signed char pstim, signed char phealthy, unsigned char paddict,
|
||||
unsigned char pcharges, signed char pfun, itype_id pcontainer,
|
||||
itype_id ptool, void (iuse::*puse)(game *, player *, item *, bool),
|
||||
add_type padd, std::string pcomesttype)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, MNULL,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
quench = pquench;
|
||||
nutr = pnutr;
|
||||
spoils = pspoils;
|
||||
stim = pstim;
|
||||
healthy = phealthy;
|
||||
addict = paddict;
|
||||
charges = pcharges;
|
||||
fun = pfun;
|
||||
container = pcontainer;
|
||||
tool = ptool;
|
||||
use = puse;
|
||||
add = padd;
|
||||
comesttype = pcomesttype;
|
||||
item_flags = pitem_flags;
|
||||
}
|
||||
};
|
||||
|
||||
// v6, v8, wankel, etc.
|
||||
@@ -564,7 +344,7 @@ struct it_var_veh_part: public itype
|
||||
unsigned int min_bigness; //CC's
|
||||
unsigned int max_bigness;
|
||||
|
||||
it_var_veh_part(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_var_veh_part(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -583,8 +363,8 @@ struct it_var_veh_part: public itype
|
||||
virtual bool is_var_veh_part(){return true;}
|
||||
virtual bool is_wheel() { return false; }
|
||||
virtual bool is_engine() {
|
||||
if (id < itm_1cyl_combustion) return false;
|
||||
if (id > itm_v8_combustion) return false;
|
||||
//FIX ME OH FUCKING GOD NOT EVERYTING SHOULD BE AN ENGINE
|
||||
// TODO: glyphgryph
|
||||
return true;
|
||||
}
|
||||
};
|
||||
@@ -603,10 +383,10 @@ struct it_ammo : public itype
|
||||
unsigned ammo_effects : NUM_AMMO_EFFECTS;
|
||||
|
||||
virtual bool is_ammo() { return true; }
|
||||
// virtual bool count_by_charges() { return id != itm_gasoline; }
|
||||
// virtual bool count_by_charges() { return id != "gasoline"; }
|
||||
virtual bool count_by_charges() { return true; }
|
||||
|
||||
it_ammo(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_ammo(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -643,7 +423,7 @@ struct it_gun : public itype
|
||||
|
||||
virtual bool is_gun() { return true; }
|
||||
|
||||
it_gun(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_gun(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -679,7 +459,7 @@ struct it_gunmod : public itype
|
||||
|
||||
virtual bool is_gunmod() { return true; }
|
||||
|
||||
it_gunmod(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_gunmod(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -718,7 +498,10 @@ struct it_armor : public itype
|
||||
signed char warmth;
|
||||
unsigned char storage;
|
||||
|
||||
bool power_armor;
|
||||
|
||||
virtual bool is_armor() { return true; }
|
||||
virtual bool is_power_armor() { return power_armor; }
|
||||
virtual bool is_artifact() { return false; }
|
||||
virtual std::string save_data() { return std::string(); }
|
||||
|
||||
@@ -733,7 +516,7 @@ struct it_armor : public itype
|
||||
storage = 0;
|
||||
}
|
||||
|
||||
it_armor(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_armor(itype_id pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -743,7 +526,7 @@ struct it_armor : public itype
|
||||
unsigned char pcovers, signed char pencumber,
|
||||
unsigned char pdmg_resist, unsigned char pcut_resist,
|
||||
unsigned char penv_resist, signed char pwarmth,
|
||||
unsigned char pstorage)
|
||||
unsigned char pstorage, bool ppower_armor = false)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
covers = pcovers;
|
||||
@@ -753,6 +536,7 @@ struct it_armor : public itype
|
||||
env_resist = penv_resist;
|
||||
warmth = pwarmth;
|
||||
storage = pstorage;
|
||||
power_armor = ppower_armor;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -766,7 +550,7 @@ struct it_book : public itype
|
||||
unsigned char time; // How long, in 10-turns (aka minutes), it takes to read
|
||||
// "To read" means getting 1 skill point, not all of em
|
||||
virtual bool is_book() { return true; }
|
||||
it_book(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_book(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -798,7 +582,7 @@ struct it_container : public itype
|
||||
unsigned char contains; // Internal volume
|
||||
unsigned flags : num_con_flags;
|
||||
virtual bool is_container() { return true; }
|
||||
it_container(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_container(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -834,11 +618,11 @@ struct it_tool : public itype
|
||||
def_charges = 0;
|
||||
charges_per_use = 0;
|
||||
turns_per_charge = 0;
|
||||
revert_to = itm_null;
|
||||
revert_to = "null";
|
||||
use = &iuse::none;
|
||||
}
|
||||
|
||||
it_tool(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_tool(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -868,23 +652,18 @@ struct it_bionic : public itype
|
||||
|
||||
virtual bool is_bionic() { return true; }
|
||||
|
||||
it_bionic(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_bionic(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
signed char pmelee_dam, signed char pmelee_cut,
|
||||
signed char pm_to_hit, unsigned pitem_flags,
|
||||
|
||||
int pdifficulty, ...)
|
||||
int pdifficulty)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
difficulty = pdifficulty;
|
||||
va_list ap;
|
||||
va_start(ap, pdifficulty);
|
||||
bionic_id tmp;
|
||||
while ((tmp = (bionic_id)va_arg(ap, int)))
|
||||
options.push_back(tmp);
|
||||
va_end(ap);
|
||||
options.push_back(id);
|
||||
}
|
||||
};
|
||||
|
||||
@@ -895,7 +674,7 @@ struct it_macguffin : public itype
|
||||
|
||||
virtual bool is_macguffin() { return true; }
|
||||
|
||||
it_macguffin(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_macguffin(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -918,7 +697,7 @@ struct it_software : public itype
|
||||
|
||||
virtual bool is_software() { return true; }
|
||||
|
||||
it_software(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_software(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
@@ -939,7 +718,7 @@ struct it_style : public itype
|
||||
|
||||
std::vector<style_move> moves;
|
||||
|
||||
it_style(int pid, unsigned char prarity, unsigned int pprice,
|
||||
it_style(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned char pvolume, unsigned char pweight,
|
||||
@@ -996,11 +775,11 @@ struct it_artifact_tool : public it_tool
|
||||
def_charges = 0;
|
||||
charges_per_use = 1;
|
||||
turns_per_charge = 0;
|
||||
revert_to = itm_null;
|
||||
revert_to = "null";
|
||||
use = &iuse::artifact;
|
||||
};
|
||||
|
||||
it_artifact_tool(int pid, unsigned int pprice, std::string pname,
|
||||
it_artifact_tool(std::string pid, unsigned int pprice, std::string pname,
|
||||
std::string pdes, char psym, nc_color pcolor, material pm1,
|
||||
material pm2, unsigned short pvolume, unsigned short pweight,
|
||||
signed char pmelee_dam, signed char pmelee_cut,
|
||||
@@ -1008,7 +787,7 @@ struct it_artifact_tool : public it_tool
|
||||
|
||||
:it_tool(pid, 0, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags,
|
||||
0, 0, 1, 0, AT_NULL, itm_null, &iuse::artifact) { };
|
||||
0, 0, 1, 0, AT_NULL, "null", &iuse::artifact) { };
|
||||
};
|
||||
|
||||
struct it_artifact_armor : public it_armor
|
||||
@@ -1049,7 +828,7 @@ struct it_artifact_armor : public it_armor
|
||||
price = 0;
|
||||
};
|
||||
|
||||
it_artifact_armor(int pid, unsigned int pprice, std::string pname,
|
||||
it_artifact_armor(std::string pid, unsigned int pprice, std::string pname,
|
||||
std::string pdes, char psym, nc_color pcolor, material pm1,
|
||||
material pm2, unsigned short pvolume, unsigned short pweight,
|
||||
signed char pmelee_dam, signed char pmelee_cut,
|
||||
|
||||
+2407
-2212
File diff suppressed because it is too large
Load Diff
@@ -18,6 +18,7 @@ class iuse
|
||||
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);
|
||||
@@ -25,6 +26,7 @@ class iuse
|
||||
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);
|
||||
@@ -54,10 +56,17 @@ class iuse
|
||||
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);
|
||||
@@ -93,6 +102,10 @@ class iuse
|
||||
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);
|
||||
@@ -111,6 +124,7 @@ class iuse
|
||||
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);
|
||||
@@ -124,6 +138,9 @@ class iuse
|
||||
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);
|
||||
|
||||
+23
-2
@@ -2,9 +2,29 @@
|
||||
#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 KEY_UP: return 'k';
|
||||
case KEY_LEFT: return 'h';
|
||||
@@ -208,6 +228,7 @@ player_data @\n\
|
||||
map m :\n\
|
||||
missions M\n\
|
||||
factions #\n\
|
||||
kills )\n\
|
||||
morale %\n\
|
||||
messages P\n\
|
||||
help ?\n\
|
||||
|
||||
+1
-1
@@ -7,7 +7,7 @@
|
||||
class game;
|
||||
|
||||
// Simple text input--translates numpad to vikeys
|
||||
long input();
|
||||
long input(long ch = -1);
|
||||
bool input_wait(char & ret_ch, int timeout);
|
||||
|
||||
// Uses the keymap to figure out direction properly
|
||||
|
||||
+202
-300
@@ -3,314 +3,333 @@
|
||||
#include "game.h"
|
||||
#include "lightmap.h"
|
||||
|
||||
#define INBOUNDS(x, y) (x >= -SEEX && x <= SEEX && y >= -SEEY && y <= SEEY)
|
||||
#define INBOUNDS_LARGE(x, y) (x >= -LIGHTMAP_RANGE_X && x <= LIGHTMAP_RANGE_X &&\
|
||||
y >= -LIGHTMAP_RANGE_Y && y <= LIGHTMAP_RANGE_Y)
|
||||
#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
|
||||
|
||||
light_map::light_map()
|
||||
: lm()
|
||||
, sm()
|
||||
void map::generate_lightmap(game* g)
|
||||
{
|
||||
memset(lm, 0, sizeof(lm));
|
||||
memset(sm, 0, sizeof(sm));
|
||||
}
|
||||
|
||||
void light_map::generate(game* g, int x, int y, float natural_light, float luminance)
|
||||
{
|
||||
build_light_cache(g, x, y);
|
||||
memset(lm, 0, sizeof(lm));
|
||||
memset(sm, 0, sizeof(sm));
|
||||
|
||||
int dir_x[] = { 1, 0 , -1, 0 };
|
||||
int dir_y[] = { 0, 1 , 0, -1 };
|
||||
int dir_d[] = { 180, 270, 0, 90 };
|
||||
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 = x - SEEX; sx <= x + SEEX; ++sx) {
|
||||
for(int sy = y - SEEY; sy <= y + SEEY; ++sy) {
|
||||
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 (!is_outside(sx - x + LIGHTMAP_RANGE_X, sy - y + LIGHTMAP_RANGE_Y))
|
||||
lm[sx - x + SEEX][sy - y + SEEY] = LIGHT_AMBIENT_LOW;
|
||||
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, x, y, luminance);
|
||||
apply_light_source(g->u.posx, g->u.posy, luminance);
|
||||
|
||||
for(int sx = x - LIGHTMAP_RANGE_X; sx <= x + LIGHTMAP_RANGE_X; ++sx) {
|
||||
for(int sy = y - LIGHTMAP_RANGE_Y; sy <= y + LIGHTMAP_RANGE_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 (!is_outside(sx - x + LIGHTMAP_RANGE_X, sy - y + LIGHTMAP_RANGE_Y)) {
|
||||
// Apply light sources for external/internal divide
|
||||
for(int i = 0; i < 4; ++i) {
|
||||
if (INBOUNDS_LARGE(sx - x + dir_x[i], sy - y + dir_y[i]) &&
|
||||
is_outside(sx - x + LIGHTMAP_RANGE_X + dir_x[i], sy - y + LIGHTMAP_RANGE_Y + dir_y[i])) {
|
||||
if (INBOUNDS(sx - x, sy - y) && is_outside(LIGHTMAP_RANGE_X, LIGHTMAP_RANGE_Y))
|
||||
lm[sx - x + SEEX][sy - y + SEEY] = natural_light;
|
||||
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 (c[sx - x + LIGHTMAP_RANGE_X][sy - y + LIGHTMAP_RANGE_Y].transparency > LIGHT_TRANSPARENCY_SOLID)
|
||||
apply_light_arc(sx, sy, dir_d[i], x, y, 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 == itm_flashlight_on)
|
||||
apply_light_source(sx, sy, x, y, 20);
|
||||
items[0].type->id == "lightstrip")
|
||||
apply_light_source(sx, sy, 1);
|
||||
|
||||
if(terrain == t_lava)
|
||||
apply_light_source(sx, sy, x, y, 50);
|
||||
apply_light_source(sx, sy, 50);
|
||||
|
||||
if(terrain == t_console)
|
||||
apply_light_source(sx, sy, x, y, 3);
|
||||
apply_light_source(sx, sy, 3);
|
||||
|
||||
if (items.size() == 1 &&
|
||||
items[0].type->id == itm_candle_lit)
|
||||
apply_light_source(sx, sy, x, y, 4);
|
||||
items[0].type->id == "candle_lit")
|
||||
apply_light_source(sx, sy, 4);
|
||||
|
||||
if(terrain == t_emergency_light)
|
||||
apply_light_source(sx, sy, x, y, 3);
|
||||
apply_light_source(sx, sy, 3);
|
||||
|
||||
// TODO: [lightmap] Attach light brightness to fields
|
||||
switch(current_field.type) {
|
||||
switch(current_field.type) {
|
||||
case fd_fire:
|
||||
if (3 == current_field.density)
|
||||
apply_light_source(sx, sy, x, y, 160);
|
||||
apply_light_source(sx, sy, 160);
|
||||
else if (2 == current_field.density)
|
||||
apply_light_source(sx, sy, x, y, 60);
|
||||
apply_light_source(sx, sy, 60);
|
||||
else
|
||||
apply_light_source(sx, sy, x, y, 16);
|
||||
apply_light_source(sx, sy, 16);
|
||||
break;
|
||||
case fd_fire_vent:
|
||||
case fd_flame_burst:
|
||||
apply_light_source(sx, sy, x, y, 8);
|
||||
apply_light_source(sx, sy, 8);
|
||||
break;
|
||||
case fd_electricity:
|
||||
if (3 == current_field.density)
|
||||
apply_light_source(sx, sy, x, y, 8);
|
||||
apply_light_source(sx, sy, 8);
|
||||
else if (2 == current_field.density)
|
||||
apply_light_source(sx, sy, x, y, 1);
|
||||
apply_light_source(sx, sy, 1);
|
||||
else
|
||||
apply_light_source(sx, sy, x, y, LIGHT_SOURCE_LOCAL); // kinda a hack as the square will still get marked
|
||||
apply_light_source(sx, sy, LIGHT_SOURCE_LOCAL); // kinda a hack as the square will still get marked
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Apply any vehicle light sources
|
||||
if (c[sx - x + LIGHTMAP_RANGE_X][sy - y + LIGHTMAP_RANGE_Y].veh &&
|
||||
c[sx - x + LIGHTMAP_RANGE_X][sy - y + LIGHTMAP_RANGE_Y].veh_light > LL_DARK) {
|
||||
if (c[sx - x + LIGHTMAP_RANGE_X][sy - y + LIGHTMAP_RANGE_Y].veh_light > LL_LIT) {
|
||||
int dir = c[sx - x + LIGHTMAP_RANGE_X][sy - y + LIGHTMAP_RANGE_Y].veh->face.dir();
|
||||
float luminance = c[sx - x + LIGHTMAP_RANGE_X][sy - y + LIGHTMAP_RANGE_Y].veh_light;
|
||||
apply_light_arc(sx, sy, dir, x, y, luminance);
|
||||
}
|
||||
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;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (c[sx - x + LIGHTMAP_RANGE_X][sy - y + LIGHTMAP_RANGE_Y].mon >= 0) {
|
||||
if (g->z[c[sx - x + LIGHTMAP_RANGE_X][sy - y + LIGHTMAP_RANGE_Y].mon].has_effect(ME_ONFIRE))
|
||||
apply_light_source(sx, sy, x, y, 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[c[sx - x + LIGHTMAP_RANGE_X][sy - y + LIGHTMAP_RANGE_Y].mon].type->id) {
|
||||
case mon_zombie_electric:
|
||||
apply_light_source(sx, sy, x, y, 1);
|
||||
break;
|
||||
case mon_turret:
|
||||
apply_light_source(sx, sy, x, y, 2);
|
||||
break;
|
||||
case mon_flaming_eye:
|
||||
apply_light_source(sx, sy, x, y, LIGHT_SOURCE_BRIGHT);
|
||||
break;
|
||||
case mon_manhack:
|
||||
apply_light_source(sx, sy, x, y, 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 light_map::at(int dx, int dy)
|
||||
lit_level map::light_at(int dx, int dy)
|
||||
{
|
||||
if (!INBOUNDS(dx, dy))
|
||||
return LL_DARK; // Out of bounds
|
||||
|
||||
if (sm[dx + SEEX][dy + SEEY] >= LIGHT_SOURCE_BRIGHT)
|
||||
if (sm[dx][dy] >= LIGHT_SOURCE_BRIGHT)
|
||||
return LL_BRIGHT;
|
||||
|
||||
if (lm[dx + SEEX][dy + SEEY] >= LIGHT_AMBIENT_LIT)
|
||||
if (lm[dx][dy] >= LIGHT_AMBIENT_LIT)
|
||||
return LL_LIT;
|
||||
|
||||
if (lm[dx + SEEX][dy + SEEY] >= LIGHT_AMBIENT_LOW)
|
||||
if (lm[dx][dy] >= LIGHT_AMBIENT_LOW)
|
||||
return LL_LOW;
|
||||
|
||||
return LL_DARK;
|
||||
}
|
||||
|
||||
float light_map::ambient_at(int dx, int dy)
|
||||
float map::ambient_light_at(int dx, int dy)
|
||||
{
|
||||
if (!INBOUNDS(dx, dy))
|
||||
return 0.0f;
|
||||
|
||||
return lm[dx + SEEX][dy + SEEY];
|
||||
return lm[dx][dy];
|
||||
}
|
||||
|
||||
bool light_map::is_outside(int dx, int dy)
|
||||
bool map::pl_sees(int fx, int fy, int tx, int ty, int max_range)
|
||||
{
|
||||
// We don't know and true seems a better default than false
|
||||
if (!INBOUNDS_LARGE(dx, dy))
|
||||
return true;
|
||||
|
||||
return outside_cache[dx + LIGHTMAP_RANGE_X][dy + LIGHTMAP_RANGE_Y];
|
||||
}
|
||||
|
||||
bool light_map::sees(int fx, int fy, int tx, int ty, int max_range)
|
||||
{
|
||||
if(!INBOUNDS_LARGE(fx, fy) || !INBOUNDS_LARGE(tx, ty))
|
||||
return false;
|
||||
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!
|
||||
|
||||
int ax = abs(tx - fx) << 1;
|
||||
int ay = abs(ty - fy) << 1;
|
||||
int dx = (fx < tx) ? 1 : -1;
|
||||
int dy = (fy < ty) ? 1 : -1;
|
||||
int x = fx;
|
||||
int y = fy;
|
||||
|
||||
// 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;
|
||||
|
||||
if(c[x + LIGHTMAP_RANGE_X][y + LIGHTMAP_RANGE_Y].transparency == LIGHT_TRANSPARENCY_SOLID)
|
||||
break;
|
||||
|
||||
} 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;
|
||||
|
||||
if(c[x + LIGHTMAP_RANGE_X][y + LIGHTMAP_RANGE_Y].transparency == LIGHT_TRANSPARENCY_SOLID)
|
||||
break;
|
||||
|
||||
} while(!(x == tx && y == ty));
|
||||
}
|
||||
|
||||
return (x == tx && y == ty);
|
||||
return seen_cache[tx][ty];
|
||||
}
|
||||
|
||||
void light_map::apply_light_source(int x, int y, int cx, int cy, float luminance)
|
||||
void map::cache_seen(int fx, int fy, int tx, int ty, int max_range)
|
||||
{
|
||||
bool lit[LIGHTMAP_X][LIGHTMAP_Y];
|
||||
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 - cx, y - cy)) {
|
||||
lit[x - cx + SEEX][y - cy + SEEY] = true;
|
||||
lm[x - cx + SEEX][y - cy + SEEY] += std::max(luminance, static_cast<float>(LL_LOW));
|
||||
sm[x - cx + SEEX][y - cy + SEEY] += luminance;
|
||||
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 - cx - range; int ex = x - cx + range;
|
||||
int sy = y - cy - range; int ey = y - cy + range;
|
||||
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, cx + off, cy + sy, cx, cy, luminance);
|
||||
apply_light_ray(lit, x, y, cx + off, cy + ey, cx, cy, luminance);
|
||||
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, cx + sx, cy + off, cx, cy, luminance);
|
||||
apply_light_ray(lit, x, y, cx + ex, cy + off, cx, cy, luminance);
|
||||
apply_light_ray(lit, x, y, sx, off, luminance);
|
||||
apply_light_ray(lit, x, y, ex, off, luminance);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void light_map::apply_light_arc(int x, int y, int angle, int cx, int cy, float luminance)
|
||||
void map::apply_light_arc(int x, int y, int angle, float luminance)
|
||||
{
|
||||
if (luminance <= LIGHT_SOURCE_LOCAL)
|
||||
return;
|
||||
|
||||
bool lit[LIGHTMAP_X][LIGHTMAP_Y];
|
||||
bool lit[LIGHTMAP_CACHE_X][LIGHTMAP_CACHE_Y];
|
||||
memset(lit, 0, sizeof(lit));
|
||||
|
||||
int range = LIGHT_RANGE(luminance);
|
||||
apply_light_source(x, y, cx, cy, LIGHT_SOURCE_LOCAL);
|
||||
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 - cy - ((angle < 90) ? range * (( 45 - angle) / 45.0f) : range);
|
||||
int ey = y - cy + ((angle > 270) ? range * ((angle - 315) / 45.0f) : range);
|
||||
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 - cx + range;
|
||||
int ox = x + range;
|
||||
for(int oy = sy; oy <= ey; ++oy)
|
||||
apply_light_ray(lit, x, y, cx + ox, cy + oy, cx, cy, luminance);
|
||||
apply_light_ray(lit, x, y, ox, oy, luminance);
|
||||
}
|
||||
|
||||
// South side
|
||||
if (angle < 180) {
|
||||
int sx = x - cx - ((angle < 90) ? range * (( angle - 45) / 45.0f) : range);
|
||||
int ex = x - cx + ((angle > 90) ? range * ((135 - angle) / 45.0f) : range);
|
||||
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 - cy + range;
|
||||
int oy = y + range;
|
||||
for(int ox = sx; ox <= ex; ++ox)
|
||||
apply_light_ray(lit, x, y, cx + ox, cy + oy, cx, cy, luminance);
|
||||
apply_light_ray(lit, x, y, ox, oy, luminance);
|
||||
}
|
||||
|
||||
// West side
|
||||
if (angle > 90 && angle < 270) {
|
||||
int sy = y - cy - ((angle < 180) ? range * ((angle - 135) / 45.0f) : range);
|
||||
int ey = y - cy + ((angle > 180) ? range * ((225 - angle) / 45.0f) : range);
|
||||
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 - cx - range;
|
||||
int ox = x - range;
|
||||
for(int oy = sy; oy <= ey; ++oy)
|
||||
apply_light_ray(lit, x, y, cx + ox, cy + oy, cx, cy, luminance);
|
||||
apply_light_ray(lit, x, y, ox, oy, luminance);
|
||||
}
|
||||
|
||||
// North side
|
||||
if (angle > 180) {
|
||||
int sx = x - cx - ((angle > 270) ? range * ((315 - angle) / 45.0f) : range);
|
||||
int ex = x - cx + ((angle < 270) ? range * ((angle - 225) / 45.0f) : range);
|
||||
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 - cy - range;
|
||||
int oy = y - range;
|
||||
for(int ox = sx; ox <= ex; ++ox)
|
||||
apply_light_ray(lit, x, y, cx + ox, cy + oy, cx, cy, luminance);
|
||||
apply_light_ray(lit, x, y, ox, oy, luminance);
|
||||
}
|
||||
}
|
||||
|
||||
void light_map::apply_light_ray(bool lit[LIGHTMAP_X][LIGHTMAP_Y], int sx, int sy,
|
||||
int ex, int ey, int cx, int cy, float 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;
|
||||
@@ -333,17 +352,17 @@ void light_map::apply_light_ray(bool lit[LIGHTMAP_X][LIGHTMAP_Y], int sx, int sy
|
||||
x += dx;
|
||||
t += ay;
|
||||
|
||||
if (INBOUNDS(x - cx, y - cy) && !lit[x - cx + SEEX][y - cy + SEEY]) {
|
||||
if (INBOUNDS(x, y) && !lit[x][y]) {
|
||||
// Multiple rays will pass through the same squares so we need to record that
|
||||
lit[x - cx + SEEX][y - cy + SEEY] = true;
|
||||
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 - cx + SEEX][y - cy + SEEY] += light * transparency;
|
||||
lm[x][y] += light * transparency;
|
||||
}
|
||||
|
||||
if (INBOUNDS_LARGE(x - cx, y - cy))
|
||||
transparency *= c[x - cx + LIGHTMAP_RANGE_X][y - cy + LIGHTMAP_RANGE_Y].transparency;
|
||||
if (INBOUNDS(x, y))
|
||||
transparency *= light_transparency(x, y);
|
||||
|
||||
if (transparency <= LIGHT_TRANSPARENCY_SOLID)
|
||||
break;
|
||||
@@ -360,17 +379,17 @@ void light_map::apply_light_ray(bool lit[LIGHTMAP_X][LIGHTMAP_Y], int sx, int sy
|
||||
y += dy;
|
||||
t += ax;
|
||||
|
||||
if (INBOUNDS(x - cx, y - cy) && !lit[x - cx + SEEX][y - cy + SEEY]) {
|
||||
if (INBOUNDS(x, y) && !lit[x][y]) {
|
||||
// Multiple rays will pass through the same squares so we need to record that
|
||||
lit[x - cx + SEEX][y - cy + SEEY] = true;
|
||||
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 - cx + SEEX][y - cy + SEEY] += light;
|
||||
lm[x][y] += light;
|
||||
}
|
||||
|
||||
if (INBOUNDS_LARGE(x - cx, y - cy))
|
||||
transparency *= c[x - cx + LIGHTMAP_RANGE_X][y - cy + LIGHTMAP_RANGE_Y].transparency;
|
||||
if (INBOUNDS(x, y))
|
||||
transparency *= light_transparency(x, y);
|
||||
|
||||
if (transparency <= LIGHT_TRANSPARENCY_SOLID)
|
||||
break;
|
||||
@@ -378,120 +397,3 @@ void light_map::apply_light_ray(bool lit[LIGHTMAP_X][LIGHTMAP_Y], int sx, int sy
|
||||
} while(!(x == ex && y == ey));
|
||||
}
|
||||
}
|
||||
|
||||
void light_map::build_outside_cache(map *m, const int x, const int y, const int sx, const int sy)
|
||||
{
|
||||
const ter_id terrain = m->ter(sx, sy);
|
||||
|
||||
if( terrain == t_floor || terrain == t_rock_floor || terrain == t_floor_wax) {
|
||||
for( int dx = -1; dx <=1; dx++ ) {
|
||||
for( int dy = -1; dy <=1; dy++ ) {
|
||||
if( INBOUNDS(x + dx, x + dy) ) {
|
||||
outside_cache[x + dx][y + dy] = false;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if(terrain == t_bed || terrain == t_groundsheet) {
|
||||
outside_cache[x][y] = false;
|
||||
}
|
||||
}
|
||||
|
||||
// We only do this once now so we don't make 100k calls to is_outside for each
|
||||
// generation. As well as close to that for the veh_at function.
|
||||
void light_map::build_light_cache(game* g, int cx, int cy)
|
||||
{
|
||||
// Clear cache
|
||||
// Initialize cache of outside tiles
|
||||
memset(outside_cache, true, sizeof(outside_cache));
|
||||
for(int sx = cx - LIGHTMAP_RANGE_X; sx <= cx + LIGHTMAP_RANGE_X; ++sx) {
|
||||
for(int sy = cy - LIGHTMAP_RANGE_Y; sy <= cy + LIGHTMAP_RANGE_Y; ++sy) {
|
||||
int x = sx - cx + LIGHTMAP_RANGE_X;
|
||||
int y = sy - cy + LIGHTMAP_RANGE_Y;
|
||||
|
||||
build_outside_cache(&g->m, x, y, sx, sy);
|
||||
c[x][y].transparency = LIGHT_TRANSPARENCY_CLEAR;
|
||||
c[x][y].veh = NULL;
|
||||
c[x][y].veh_part = 0;
|
||||
c[x][y].veh_light = 0;
|
||||
c[x][y].mon = -1;
|
||||
}
|
||||
}
|
||||
|
||||
// Check for critters and cache
|
||||
for (int i = 0; i < g->z.size(); ++i)
|
||||
if (INBOUNDS(g->z[i].posx - cx, g->z[i].posy - cy))
|
||||
c[g->z[i].posx - cx + LIGHTMAP_RANGE_X][g->z[i].posy - cy + LIGHTMAP_RANGE_Y].mon = i;
|
||||
|
||||
// Check for vehicles and cache
|
||||
VehicleList vehs = g->m.get_vehicles(cx - LIGHTMAP_RANGE_X, cy - LIGHTMAP_RANGE_Y, cx + LIGHTMAP_RANGE_X, cy + LIGHTMAP_RANGE_Y);
|
||||
for(int v = 0; v < vehs.size(); ++v) {
|
||||
for(int p = 0; p < vehs[v].v->parts.size(); ++p) {
|
||||
int px = vehs[v].x + vehs[v].v->parts[p].precalc_dx[0] - cx;
|
||||
int py = vehs[v].y + vehs[v].v->parts[p].precalc_dy[0] - cy;
|
||||
|
||||
if (INBOUNDS(px, py)) {
|
||||
px += LIGHTMAP_RANGE_X;
|
||||
py += LIGHTMAP_RANGE_Y;
|
||||
|
||||
if (vehs[v].v->is_inside(p))
|
||||
outside_cache[px][py] = true;
|
||||
// External part appears to always be the first?
|
||||
if (!c[px][py].veh) {
|
||||
c[px][py].veh = vehs[v].v;
|
||||
c[px][py].veh_part = p;
|
||||
}
|
||||
|
||||
if (vehs[v].v->lights_on &&
|
||||
vehs[v].v->part_flag(p, vpf_light) &&
|
||||
vehs[v].v->parts[p].hp > 0)
|
||||
c[px][py].veh_light = vehs[v].v->part_info(p).power;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
for(int sx = cx - LIGHTMAP_RANGE_X; sx <= cx + LIGHTMAP_RANGE_X; ++sx) {
|
||||
for(int sy = cy - LIGHTMAP_RANGE_Y; sy <= cy + LIGHTMAP_RANGE_Y; ++sy) {
|
||||
int x = sx - cx + LIGHTMAP_RANGE_X;
|
||||
int y = sy - cy + LIGHTMAP_RANGE_Y;
|
||||
|
||||
if (c[x][y].veh) {
|
||||
if (c[x][y].veh->part_flag(c[x][y].veh_part, vpf_opaque) &&
|
||||
c[x][y].veh->parts[c[x][y].veh_part].hp > 0) {
|
||||
int dpart = c[x][y].veh->part_with_feature(c[x][y].veh_part, vpf_openable);
|
||||
if (dpart < 0 || !c[x][y].veh->parts[dpart].open) {
|
||||
c[x][y].transparency = LIGHT_TRANSPARENCY_SOLID;
|
||||
continue;
|
||||
}
|
||||
}
|
||||
} else if (!(terlist[g->m.ter(sx, sy)].flags & mfb(transparent))) {
|
||||
c[x][y].transparency = LIGHT_TRANSPARENCY_SOLID;
|
||||
continue;
|
||||
}
|
||||
|
||||
field& f = g->m.field_at(sx, sy);
|
||||
if(f.type > 0) {
|
||||
if(!fieldlist[f.type].transparent[f.density - 1]) {
|
||||
// Fields are either transparent or not, however we want some to be translucent
|
||||
switch(f.type) {
|
||||
case fd_smoke:
|
||||
case fd_toxic_gas:
|
||||
case fd_tear_gas:
|
||||
if(f.density == 3)
|
||||
c[x][y].transparency = LIGHT_TRANSPARENCY_SOLID;
|
||||
if(f.density == 2)
|
||||
c[x][y].transparency *= 0.5;
|
||||
break;
|
||||
case fd_nuke_gas:
|
||||
c[x][y].transparency *= 0.5;
|
||||
break;
|
||||
default:
|
||||
c[x][y].transparency = LIGHT_TRANSPARENCY_SOLID;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: [lightmap] Have glass reduce light as well
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
-51
@@ -1,9 +1,6 @@
|
||||
#ifndef _LIGHTMAP_H_
|
||||
#define _LIGHTMAP_H_
|
||||
|
||||
#include "mapdata.h"
|
||||
#include "map.h"
|
||||
|
||||
#define LIGHT_SOURCE_LOCAL 0.1
|
||||
#define LIGHT_SOURCE_BRIGHT 10
|
||||
|
||||
@@ -13,17 +10,7 @@
|
||||
#define LIGHT_TRANSPARENCY_SOLID 0
|
||||
#define LIGHT_TRANSPARENCY_CLEAR 1
|
||||
|
||||
#define LIGHTMAP_X (2 * SEEX + 1)
|
||||
#define LIGHTMAP_Y (2 * SEEY + 1)
|
||||
|
||||
#define LIGHT_RANGE(b) static_cast<int>(sqrt(b / LIGHT_AMBIENT_LOW) + 1)
|
||||
#define LIGHT_MAX_RANGE_X (SEEX*(MAPSIZE/2))
|
||||
#define LIGHT_MAX_RANGE_Y (SEEX*(MAPSIZE/2))
|
||||
#define LIGHTMAP_RANGE_X (SEEX + LIGHT_MAX_RANGE_X)
|
||||
#define LIGHTMAP_RANGE_Y (SEEY + LIGHT_MAX_RANGE_Y)
|
||||
|
||||
#define LIGHTMAP_CACHE_X (2 * LIGHTMAP_RANGE_X + 1)
|
||||
#define LIGHTMAP_CACHE_Y (2 * LIGHTMAP_RANGE_Y + 1)
|
||||
|
||||
enum lit_level {
|
||||
LL_DARK = 0,
|
||||
@@ -32,42 +19,4 @@ enum lit_level {
|
||||
LL_BRIGHT // Probably only for light sources
|
||||
};
|
||||
|
||||
struct light_map_cache {
|
||||
float transparency;
|
||||
vehicle* veh;
|
||||
int veh_part;
|
||||
int veh_light;
|
||||
int mon;
|
||||
};
|
||||
|
||||
class light_map
|
||||
{
|
||||
public:
|
||||
light_map();
|
||||
|
||||
void generate(game* g, int x, int y, float natural_light, float luminance);
|
||||
|
||||
lit_level at(int dx, int dy); // Assumes 0,0 is light map center
|
||||
float ambient_at(int dx, int dy); // Raw values for tilesets
|
||||
|
||||
bool is_outside(int dx, int dy);
|
||||
bool sees(int fx, int fy, int tx, int ty, int max_range);
|
||||
|
||||
private:
|
||||
typedef light_map_cache light_cache[LIGHTMAP_CACHE_X][LIGHTMAP_CACHE_Y];
|
||||
float lm[LIGHTMAP_X][LIGHTMAP_Y];
|
||||
float sm[LIGHTMAP_X][LIGHTMAP_Y];
|
||||
bool outside_cache[LIGHTMAP_CACHE_X][LIGHTMAP_CACHE_Y];
|
||||
light_cache c;
|
||||
|
||||
void apply_light_source(int x, int y, int cx, int cy, float luminance);
|
||||
void apply_light_arc(int x, int y, int angle, int cx, int cy, float luminance);
|
||||
|
||||
void apply_light_ray(bool lit[LIGHTMAP_X][LIGHTMAP_Y], int sx, int sy,
|
||||
int ex, int ey, int cx, int cy, float luminance);
|
||||
|
||||
void build_outside_cache(map *m, const int x, const int y, const int sx, const int sy);
|
||||
void build_light_cache(game* g, int x, int y);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
@@ -53,6 +53,7 @@ int main(int argc, char *argv[])
|
||||
bool quit_game = false;
|
||||
bool delete_world = false;
|
||||
game *g = new game;
|
||||
g->init_ui();
|
||||
MAPBUFFER.set_game(g);
|
||||
MAPBUFFER.load();
|
||||
|
||||
@@ -89,13 +90,13 @@ void exit_handler(int s) {
|
||||
bool bExit = false;
|
||||
|
||||
if (s == 2) {
|
||||
if (query_yn("Really Quit without saving?")) {
|
||||
if (query_yn("Really Quit? All unsafed changes will be lost.")) {
|
||||
bExit = true;
|
||||
}
|
||||
} else if (s == -999) {
|
||||
bExit = true;
|
||||
} else {
|
||||
//query_yn("Signal received: %d", s);
|
||||
//query_yn(g, "Signal received: %d", s);
|
||||
bExit = true;
|
||||
}
|
||||
|
||||
@@ -109,6 +110,6 @@ void exit_handler(int s) {
|
||||
system("clear"); // Tell the terminal to clear itself
|
||||
#endif
|
||||
|
||||
exit(1);
|
||||
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;
|
||||
}
|
||||
@@ -17,8 +17,11 @@
|
||||
#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;
|
||||
@@ -41,7 +44,7 @@ class map
|
||||
|
||||
// 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();
|
||||
|
||||
@@ -49,13 +52,13 @@ class map
|
||||
void draw(game *g, WINDOW* w, const point center);
|
||||
void debug();
|
||||
void drawsq(WINDOW* w, player &u, const int x, const int y, const bool invert, const bool show_items,
|
||||
const int cx = -1, const int cy = -1,
|
||||
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
|
||||
virtual void save(overmap *om, unsigned const int turn, const int x, const int y);
|
||||
virtual void load(game *g, const int wx, const int wy, const bool update_vehicles = true);
|
||||
void shift(game *g, const int wx, const int wy, const int x, const 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();
|
||||
@@ -63,12 +66,12 @@ class map
|
||||
// Movement and LOS
|
||||
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, char * trans_buf = NULL); // Transparent?
|
||||
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(const int Fx, const int Fy, const int Tx, const int Ty,
|
||||
const int range, int &tc, char * trans_buf = NULL);
|
||||
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);
|
||||
@@ -103,7 +106,8 @@ class map
|
||||
bool displace_water (const int x, const int y);
|
||||
|
||||
// Terrain
|
||||
ter_id& ter(const int x, const int y); // Terrain at coord (x, y); {x|y}=(0, SEE{X|Y}*3]
|
||||
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)
|
||||
@@ -137,7 +141,7 @@ class map
|
||||
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 add_item(const int x, const int y, itype* type, int birthday, int quantity = 0);
|
||||
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);
|
||||
@@ -164,14 +168,19 @@ class map
|
||||
// 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 turn);
|
||||
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, const moncat_id monster_type, const int chance,
|
||||
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);
|
||||
@@ -184,16 +193,21 @@ class map
|
||||
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::vector <itype*> *itypes;
|
||||
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,
|
||||
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 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,
|
||||
@@ -202,6 +216,10 @@ protected:
|
||||
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;
|
||||
@@ -220,6 +238,18 @@ protected:
|
||||
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];
|
||||
};
|
||||
|
||||
@@ -227,7 +257,7 @@ class tinymap : public map
|
||||
{
|
||||
public:
|
||||
tinymap();
|
||||
tinymap(std::vector<itype*> *itptr, std::vector<itype_id> (*miptr)[num_itloc],
|
||||
tinymap(std::map<std::string, itype*> *itptr, std::vector<itype_id> (*miptr)[num_itloc],
|
||||
std::vector<trap*> *trptr);
|
||||
~tinymap();
|
||||
|
||||
|
||||
+8
-3
@@ -167,6 +167,10 @@ void mapbuffer::save()
|
||||
if (sm->comp.name != "")
|
||||
fout << "c " << sm->comp.save_data() << std::endl;
|
||||
|
||||
// Output base camp if any
|
||||
if (sm->camp.is_valid())
|
||||
fout << "B " << sm->camp.save_data() << std::endl;
|
||||
|
||||
// Output the graffiti
|
||||
for (int j = 0; j < SEEY; j++) {
|
||||
for (int i = 0; i < SEEX; i++) {
|
||||
@@ -194,8 +198,7 @@ void mapbuffer::load()
|
||||
if (!fin.is_open())
|
||||
return;
|
||||
|
||||
int itx, ity, t, d, a, num_submaps, num_loaded=0;
|
||||
bool fields_here = false;
|
||||
int itx, ity, t, d, a, num_submaps, num_loaded = 0;
|
||||
item it_tmp;
|
||||
std::string databuff;
|
||||
fin >> num_submaps;
|
||||
@@ -259,7 +262,6 @@ void mapbuffer::load()
|
||||
fin >> itx >> ity >> t;
|
||||
sm->trp[itx][ity] = trap_id(t);
|
||||
} else if (string_identifier == "F") {
|
||||
fields_here = true;
|
||||
fin >> itx >> ity >> t >> d >> a;
|
||||
sm->fld[itx][ity] = field(field_id(t), d, a);
|
||||
sm->field_count++;
|
||||
@@ -281,6 +283,9 @@ void mapbuffer::load()
|
||||
} else if (string_identifier == "c") {
|
||||
getline(fin, databuff);
|
||||
sm->comp.load_data(databuff);
|
||||
} else if (string_identifier == "B") {
|
||||
getline(fin, databuff);
|
||||
sm->camp.load_data(databuff);
|
||||
} else if (string_identifier == "G") {
|
||||
std::string s;
|
||||
int j;
|
||||
|
||||
@@ -11,6 +11,8 @@
|
||||
#include "computer.h"
|
||||
#include "vehicle.h"
|
||||
#include "graffiti.h"
|
||||
#include "basecamp.h"
|
||||
#include "iexamine.h"
|
||||
#include <iosfwd>
|
||||
|
||||
class game;
|
||||
@@ -58,16 +60,20 @@ enum t_flag {
|
||||
collapses, // Tiles that have a roof over them (which can collapse)
|
||||
flammable2, // Burn to ash rather than rubble.
|
||||
deconstruct, // Can be deconstructed
|
||||
reduce_scent, // Reduces the scent even more, only works if object is bashable as well
|
||||
fire_container,// Contains fire like brazier or wood stove.
|
||||
suppress_smoke, // Prevents smoke from being generated by fires. Used for ventilated tiles such as wood stoves.
|
||||
num_t_flags // MUST be last
|
||||
};
|
||||
|
||||
struct ter_t {
|
||||
std::string name;
|
||||
char sym;
|
||||
long sym;
|
||||
nc_color color;
|
||||
unsigned char movecost;
|
||||
trap_id trap;
|
||||
unsigned long flags;// : num_t_flags;
|
||||
void (iexamine::*examine)(game *, player *, map *m, int examx, int examy);
|
||||
};
|
||||
|
||||
enum ter_id {
|
||||
@@ -88,10 +94,11 @@ t_slime,
|
||||
t_bridge,
|
||||
// Tent Walls & doors
|
||||
t_canvas_wall, t_canvas_door, t_canvas_door_o, t_groundsheet, t_fema_groundsheet,
|
||||
t_skin_wall, t_skin_door, t_skin_door_o, t_skin_groundsheet,
|
||||
// Lighting related
|
||||
t_skylight, t_emergency_light_flicker, t_emergency_light,
|
||||
// Walls
|
||||
t_wall_log_half, t_wall_log, t_wall_log_chipped, t_wall_log_broken, t_palisade, t_palisade_gate, t_palisade_gate_o,
|
||||
t_wall_log_half, t_wall_log, t_wall_log_chipped, t_wall_log_broken, t_palisade, t_palisade_gate,
|
||||
t_wall_half, t_wall_wood, t_wall_wood_chipped, t_wall_wood_broken,
|
||||
t_wall_v, t_wall_h, t_concrete_v, t_concrete_h,
|
||||
t_wall_metal_v, t_wall_metal_h,
|
||||
@@ -131,7 +138,7 @@ t_gas_pump, t_gas_pump_smashed, t_gas_pump_empty,
|
||||
t_missile, t_missile_exploded,
|
||||
t_counter,
|
||||
t_radio_tower, t_radio_controls,
|
||||
t_console_broken, t_console, t_gates_mech_control, t_barndoor,
|
||||
t_console_broken, t_console, t_gates_mech_control, t_barndoor, t_palisade_pulley,
|
||||
t_sewage_pipe, t_sewage_pump,
|
||||
t_centrifuge,
|
||||
t_column,
|
||||
@@ -159,420 +166,422 @@ num_terrain_types
|
||||
|
||||
const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
|
||||
{"nothing", ' ', c_white, 2, tr_null,
|
||||
mfb(transparent)|mfb(diggable)},
|
||||
{"empty space", '#', c_black, 2, tr_ledge,
|
||||
mfb(transparent)},
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"empty space", ' ', c_black, 2, tr_ledge,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"dirt", '.', c_brown, 2, tr_null,
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable)},
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable), &iexamine::none},
|
||||
{"sand", '.', c_yellow, 2, tr_null,
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable)},
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable), &iexamine::none},
|
||||
{"mound of dirt", '#', c_brown, 3, tr_null,
|
||||
mfb(transparent)|mfb(diggable)},
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"shallow pit", '0', c_yellow, 8, tr_null,
|
||||
mfb(transparent)|mfb(diggable)},
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"pit", '0', c_brown, 10, tr_pit,
|
||||
mfb(transparent)|mfb(diggable)},
|
||||
mfb(transparent)|mfb(diggable), &iexamine::pit},
|
||||
{"corpse filled pit",'#', c_green, 5, tr_null,
|
||||
mfb(transparent)|mfb(diggable)},
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"covered pit", '#', c_ltred, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::pit_covered},
|
||||
{"spiked pit", '0', c_ltred, 10, tr_spike_pit,
|
||||
mfb(transparent)|mfb(diggable)},
|
||||
mfb(transparent)|mfb(diggable), &iexamine::pit_spiked},
|
||||
{"covered spiked pit",'#',c_ltred, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::pit_spiked_covered},
|
||||
{"rock floor", '.', c_ltgray, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"pile of rubble", '^', c_ltgray, 4, tr_null,
|
||||
mfb(transparent)|mfb(rough)|mfb(diggable)},
|
||||
mfb(transparent)|mfb(rough)|mfb(diggable), &iexamine::rubble},
|
||||
{"pile of ash", '#', c_ltgray, 2, tr_null,
|
||||
mfb(transparent)|mfb(diggable)},
|
||||
mfb(transparent)|mfb(diggable), &iexamine::rubble},
|
||||
{"twisted metal", '#', c_cyan, 5, tr_null,
|
||||
mfb(transparent)|mfb(rough)|mfb(sharp)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(rough)|mfb(sharp)|mfb(place_item), &iexamine::wreckage},
|
||||
{"metal wreckage", '#', c_cyan, 5, tr_null,
|
||||
mfb(transparent)|mfb(rough)|mfb(sharp)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(rough)|mfb(sharp)|mfb(place_item), &iexamine::wreckage},
|
||||
{"grass", '.', c_green, 2, tr_null,
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable)},
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable), &iexamine::none},
|
||||
{"metal floor", '.', c_ltcyan, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"pavement", '.', c_dkgray, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"yellow pavement", '.', c_yellow, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"sidewalk", '.', c_ltgray, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"floor", '.', c_cyan, 2, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses)},
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses), &iexamine::none},
|
||||
{"dirt floor", '.', c_brown, 2, tr_null, //Dirt Floor, must have roofs!
|
||||
mfb(transparent)|mfb(diggable)|mfb(supports_roof)|mfb(collapses)},
|
||||
mfb(transparent)|mfb(diggable)|mfb(supports_roof)|mfb(collapses), &iexamine::none},
|
||||
{"hay", '#', i_brown, 5, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable2)|mfb(collapses)},
|
||||
mfb(transparent)|mfb(container)|mfb(flammable2)|mfb(collapses), &iexamine::none},
|
||||
{"metal grate", '#', c_dkgray, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"slime", '~', c_green, 6, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable2)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(container)|mfb(flammable2)|mfb(place_item), &iexamine::none},
|
||||
{"walkway", '#', c_yellow, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"canvas wall", '#', c_blue, 0, tr_null,
|
||||
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable)},
|
||||
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable), &iexamine::none},
|
||||
{"canvas flap", '+', c_blue, 0, tr_null,
|
||||
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable)},
|
||||
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable), &iexamine::none},
|
||||
{"open canvas flap", '.', c_blue, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"groundsheet", ';', c_green, 2, tr_null,
|
||||
mfb(transparent)|mfb(tentable)},
|
||||
mfb(transparent)|mfb(tentable), &iexamine::tent},
|
||||
{"groundsheet", ';', c_green, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"animalskin wall", '#', c_brown, 0, tr_null,
|
||||
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable), &iexamine::none},
|
||||
{"animalskin flap", '+', c_white, 0, tr_null,
|
||||
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable), &iexamine::none},
|
||||
{"open animalskin flap", '.', c_white, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"animalskin floor", ';', c_brown, 2, tr_null,
|
||||
mfb(transparent)|mfb(tentable), &iexamine::shelter},
|
||||
{"floor", '.', c_white, 2, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses)}, // Skylight
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses), &iexamine::none}, // Skylight
|
||||
{"floor", '.', c_white, 2, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses)}, // Emergency Light
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses), &iexamine::none}, // Emergency Light
|
||||
{"floor", '.', c_white, 2, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses)}, // Regular Light
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses), &iexamine::none}, // Regular Light
|
||||
{"half-built wall", '#', c_brown, 4, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"log wall", '#', c_brown, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"chipped log wall",'#', c_brown, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"broken log wall", '&', c_brown, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)|
|
||||
mfb(supports_roof)},
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"palisade wall", '#', c_brown, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent)},
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent), &iexamine::none},
|
||||
{"palisade gate", '+', c_ltred, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(door)|mfb(transparent)},
|
||||
{"open palisade gate", '#', c_ltred, 2, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent)},
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(door)|mfb(transparent), &iexamine::none},
|
||||
{"half-built wall", '#', c_ltred, 4, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"wooden wall", '#', c_ltred, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"chipped wood wall",'#', c_ltred, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"broken wood wall", '&', c_ltred, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)|
|
||||
mfb(supports_roof)},
|
||||
{"wall", '|', c_ltgray, 0, tr_null,
|
||||
mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
|
||||
{"wall", '-', c_ltgray, 0, tr_null,
|
||||
mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
|
||||
{"concrete wall", '|', c_dkgray, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof)},
|
||||
{"concrete wall", '-', c_dkgray, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof)},
|
||||
{"metal wall", '|', c_cyan, 0, tr_null,
|
||||
mfb(noitem)|mfb(noitem)|mfb(supports_roof)},
|
||||
{"metal wall", '-', c_cyan, 0, tr_null,
|
||||
mfb(noitem)|mfb(noitem)|mfb(supports_roof)},
|
||||
{"glass wall", '|', c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof)},
|
||||
{"glass wall", '-', c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof)},
|
||||
{"glass wall", '|', c_ltcyan, 0, tr_null, // Alarmed
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"wall", LINE_XOXO, c_ltgray, 0, tr_null,
|
||||
mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"wall", LINE_OXOX, c_ltgray, 0, tr_null,
|
||||
mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"concrete wall", LINE_XOXO, c_dkgray, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"concrete wall", LINE_OXOX, c_dkgray, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"metal wall", LINE_XOXO, c_cyan, 0, tr_null,
|
||||
mfb(noitem)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"metal wall", LINE_OXOX, c_cyan, 0, tr_null,
|
||||
mfb(noitem)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"glass wall", LINE_XOXO, c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"glass wall", LINE_OXOX, c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"glass wall", LINE_XOXO, c_ltcyan, 0, tr_null, // Alarmed
|
||||
mfb(transparent)|mfb(bashable)|mfb(alarmed)|mfb(noitem)|
|
||||
mfb(supports_roof)},
|
||||
{"glass wall", '-', c_ltcyan, 0, tr_null, // Alarmed
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"glass wall", LINE_OXOX, c_ltcyan, 0, tr_null, // Alarmed
|
||||
mfb(transparent)|mfb(bashable)|mfb(alarmed)|mfb(noitem)|
|
||||
mfb(supports_roof)},
|
||||
{"reinforced glass", '|', c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof)},
|
||||
{"reinforced glass", '-', c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"reinforced glass", LINE_XOXO, c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"reinforced glass", LINE_OXOX, c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"metal bars", '"', c_ltgray, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem)},
|
||||
mfb(transparent)|mfb(noitem), &iexamine::none},
|
||||
{"closed wood door", '+', c_brown, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable2)|mfb(door)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(bashable)|mfb(flammable2)|mfb(door)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"damaged wood door",'&', c_brown, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)|
|
||||
mfb(supports_roof)},
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"open wood door", '\'', c_brown, 2, tr_null,
|
||||
mfb(flammable2)|mfb(transparent)|mfb(supports_roof)},
|
||||
mfb(flammable2)|mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed wood door", '+', c_brown, 0, tr_null, // Actually locked
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed wood door", '+', c_brown, 0, tr_null, // Locked and alarmed
|
||||
mfb(bashable)|mfb(flammable2)|mfb(alarmed)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(bashable)|mfb(flammable2)|mfb(alarmed)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"empty door frame", '.', c_brown, 2, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof)},
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"locked wire gate", '+', c_cyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof)},
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed wooden gate", '+', c_brown, 3, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof) |mfb(bashable)|mfb(flammable2)},
|
||||
mfb(transparent)|mfb(supports_roof) |mfb(bashable)|mfb(flammable2), &iexamine::none},
|
||||
{"open wooden gate", '.', c_brown, 2, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof) |mfb(bashable)|mfb(flammable2)},
|
||||
mfb(transparent)|mfb(supports_roof) |mfb(bashable)|mfb(flammable2), &iexamine::none},
|
||||
{"closed wire gate", '+', c_cyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof)},
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"open wire gate", '.', c_cyan, 2, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof)},
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"boarded up door", '#', c_brown, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed metal door",'+', c_cyan, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"open metal door", '\'', c_cyan, 2, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof)},
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed metal door",'+', c_cyan, 0, tr_null, // Actually locked
|
||||
mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed glass door",'+', c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(door)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(door)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"open glass door", '\'', c_ltcyan, 2, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof)},
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"bulletin board", '6', c_blue, 0, tr_null,
|
||||
mfb(flammable)|mfb(noitem)},
|
||||
mfb(flammable)|mfb(noitem), &iexamine::none},
|
||||
{"makeshift portcullis", '&', c_cyan, 0, tr_null,
|
||||
mfb(noitem)},
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"steel compactor", '&', c_green, 0, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::recycler},
|
||||
{"window", '"', c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
|
||||
mfb(supports_roof)|mfb(deconstruct)}, // Plain Ol' window
|
||||
mfb(supports_roof)|mfb(deconstruct), &iexamine::none}, // Plain Ol' window
|
||||
{"taped window", '"', c_dkgray, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)}, // Regular window
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)| mfb(reduce_scent), &iexamine::none}, // Regular window
|
||||
{"window", '"', c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
|
||||
mfb(supports_roof)|mfb(deconstruct)}, //has curtains
|
||||
mfb(supports_roof)|mfb(deconstruct), &iexamine::none}, //has curtains
|
||||
{"taped window", '"', c_dkgray, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)}, // Curtain window
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)| mfb(reduce_scent), &iexamine::none}, // Curtain window
|
||||
{"open window", '\'', c_ltcyan, 4, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)},
|
||||
mfb(transparent)|mfb(flammable)|mfb(noitem)| mfb(supports_roof), &iexamine::none},
|
||||
{"closed curtains", '"', c_dkgray, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)},
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof), &iexamine::none},
|
||||
{"window", '"', c_ltcyan, 0, tr_null, // Actually alarmed
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(alarmed)|mfb(noitem)|
|
||||
mfb(supports_roof)},
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"taped window", '"', c_dkgray, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)|mfb(alarmed)}, //Alarmed, duh.
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)|mfb(alarmed)| mfb(reduce_scent), &iexamine::none}, //Alarmed, duh.
|
||||
{"empty window", '0', c_yellow, 8, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(supports_roof)},
|
||||
mfb(transparent)|mfb(flammable)|mfb(supports_roof), &iexamine::none},
|
||||
{"window frame", '0', c_ltcyan, 8, tr_null,
|
||||
mfb(transparent)|mfb(sharp)|mfb(flammable)|mfb(noitem)|
|
||||
mfb(supports_roof)},
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"boarded up window",'#', c_brown, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"solid rock", '#', c_white, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"odd fault", '#', c_magenta, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::fault},
|
||||
{"paper wall", '#', c_white, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem)},
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"tree", '7', c_green, 0, tr_null,
|
||||
mfb(flammable2)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(flammable2)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"young tree", '1', c_green, 4, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"apple tree", '7', c_ltgreen, 0, tr_null,
|
||||
mfb(flammable2)|mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(flammable2)|mfb(noitem)|mfb(supports_roof), &iexamine::tree_apple},
|
||||
{"underbrush", '#', c_ltgreen, 6, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(diggable)|mfb(container)|
|
||||
mfb(flammable2)|mfb(thin_obstacle)|mfb(place_item)},
|
||||
mfb(flammable2)|mfb(thin_obstacle)|mfb(place_item), &iexamine::shrub_wildveggies},
|
||||
{"shrub", '#', c_green, 8, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(flammable2)|
|
||||
mfb(thin_obstacle)|mfb(place_item)},
|
||||
mfb(thin_obstacle)|mfb(place_item), &iexamine::none},
|
||||
{"blueberry bush", '#', c_ltgreen, 8, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(flammable2)|mfb(thin_obstacle)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(flammable2)|mfb(thin_obstacle), &iexamine::shrub_blueberry},
|
||||
{"tree trunk", '1', c_brown, 4, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(diggable)},
|
||||
mfb(transparent)|mfb(flammable2)|mfb(diggable), &iexamine::none},
|
||||
{"root wall", '#', c_brown, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof)},
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"wax wall", '#', c_yellow, 0, tr_null,
|
||||
mfb(flammable2)|mfb(noitem)|mfb(supports_roof)|mfb(place_item)},
|
||||
mfb(flammable2)|mfb(noitem)|mfb(supports_roof)|mfb(place_item), &iexamine::none},
|
||||
{"wax floor", '.', c_yellow, 2, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)},
|
||||
mfb(transparent)|mfb(l_flammable), &iexamine::none},
|
||||
{"picket fence", '|', c_brown, 3, tr_null,
|
||||
mfb(transparent)|mfb(diggable)|mfb(flammable2)|mfb(noitem)|mfb(thin_obstacle)},
|
||||
mfb(bashable)|mfb(transparent)|mfb(diggable)|mfb(flammable2)|mfb(noitem)|mfb(thin_obstacle), &iexamine::none},
|
||||
{"picket fence", '-', c_brown, 3, tr_null,
|
||||
mfb(transparent)|mfb(diggable)|mfb(flammable2)|mfb(noitem)|mfb(thin_obstacle)},
|
||||
mfb(bashable)|mfb(transparent)|mfb(diggable)|mfb(flammable2)|mfb(noitem)|mfb(thin_obstacle), &iexamine::none},
|
||||
{"chain link fence", '|', c_cyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(thin_obstacle)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(thin_obstacle), &iexamine::chainfence},
|
||||
{"chain link fence", '-', c_cyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(thin_obstacle)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(thin_obstacle), &iexamine::chainfence},
|
||||
{"metal post", '#', c_cyan, 2, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle)},
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::fence_post},
|
||||
{"fence post", '#', c_brown, 2, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle)},
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::fence_post},
|
||||
{"wire fence", '$', c_blue, 4, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle)},
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::remove_fence_wire},
|
||||
{"barbed wire fence",'$', c_blue, 4, tr_null,
|
||||
mfb(transparent)|mfb(sharp)|mfb(thin_obstacle)},
|
||||
mfb(transparent)|mfb(sharp)|mfb(thin_obstacle), &iexamine::remove_fence_barbed},
|
||||
{"rope fence", '$', c_brown, 3, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle)},
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::remove_fence_rope},
|
||||
{"railing", '|', c_yellow, 3, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(thin_obstacle)},
|
||||
mfb(transparent)|mfb(noitem)|mfb(thin_obstacle), &iexamine::none},
|
||||
{"railing", '-', c_yellow, 3, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(thin_obstacle)},
|
||||
mfb(transparent)|mfb(noitem)|mfb(thin_obstacle), &iexamine::none},
|
||||
{"marloss bush", '1', c_dkgray, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2), &iexamine::none},
|
||||
{"fungal bed", '#', c_dkgray, 3, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(diggable)},
|
||||
mfb(transparent)|mfb(flammable2)|mfb(diggable), &iexamine::none},
|
||||
{"fungal tree", '7', c_dkgray, 0, tr_null,
|
||||
mfb(flammable2)|mfb(noitem)},
|
||||
mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"shallow water", '~', c_ltblue, 5, tr_null,
|
||||
mfb(transparent)|mfb(liquid)|mfb(swimmable)},
|
||||
mfb(transparent)|mfb(liquid)|mfb(swimmable), &iexamine::none},
|
||||
{"deep water", '~', c_blue, 0, tr_null,
|
||||
mfb(transparent)|mfb(liquid)|mfb(swimmable)},
|
||||
mfb(transparent)|mfb(liquid)|mfb(swimmable), &iexamine::none},
|
||||
{"sewage", '~', c_ltgreen, 6, tr_null,
|
||||
mfb(transparent)|mfb(swimmable)},
|
||||
mfb(transparent)|mfb(swimmable), &iexamine::none},
|
||||
{"lava", '~', c_red, 4, tr_lava,
|
||||
mfb(transparent)|mfb(liquid)},
|
||||
mfb(transparent)|mfb(liquid), &iexamine::none},
|
||||
{"bed", '#', c_magenta, 5, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable2)|mfb(collapses)|
|
||||
mfb(deconstruct)|mfb(place_item)},
|
||||
mfb(deconstruct)|mfb(place_item), &iexamine::none},
|
||||
{"toilet", '&', c_white, 4, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses), &iexamine::none},
|
||||
{"makeshift bed", '#', c_magenta, 5, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"sink", '&', c_white, 4, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)|mfb(container)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)|mfb(container)|mfb(place_item), &iexamine::none},
|
||||
{"oven", '#', c_dkgray, 4, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)|mfb(container)|mfb(place_item)},
|
||||
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)|mfb(container)|mfb(place_item), &iexamine::none},
|
||||
{"wood stove", '#', i_red, 4, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(place_item)},
|
||||
|
||||
|
||||
mfb(transparent)|mfb(container)|mfb(fire_container)|mfb(suppress_smoke)|mfb(place_item), &iexamine::none},
|
||||
{"bathtub", '~', c_white, 4, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)|mfb(container)|mfb(place_item)},
|
||||
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)|mfb(container)|mfb(place_item), &iexamine::none},
|
||||
{"chair", '#', c_brown, 2, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)},
|
||||
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"arm chair", 'H', c_green, 3, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)},
|
||||
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"sofa", 'H', i_red, 3, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)},
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"cupboard", '#', c_blue, 3, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)|
|
||||
mfb(container)|mfb(place_item)},
|
||||
mfb(container)|mfb(place_item), &iexamine::none},
|
||||
{"trash can", '&', c_ltcyan, 3, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(container)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(container)|mfb(place_item), &iexamine::none},
|
||||
{"desk", '#', c_ltred, 3, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)|
|
||||
mfb(container)|mfb(place_item)},
|
||||
mfb(container)|mfb(place_item), &iexamine::none},
|
||||
{"sandbox", '#', c_yellow, 3, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct)},
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"slide", '#', c_ltcyan, 4, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct)},
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"monkey bars", '#', c_cyan, 4, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct)},
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"backboard", '7', c_red, 0, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct)},
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"bench", '#', c_brown, 3, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)},
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"table", '#', c_red, 4, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(collapses)|mfb(deconstruct)},
|
||||
mfb(transparent)|mfb(flammable)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"pool table", '#', c_green, 4, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(collapses)|mfb(deconstruct)},
|
||||
mfb(transparent)|mfb(flammable)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"gasoline pump", '&', c_red, 0, tr_null,
|
||||
mfb(transparent)|mfb(explodes)|mfb(noitem)},
|
||||
mfb(transparent)|mfb(explodes)|mfb(noitem), &iexamine::gaspump},
|
||||
{"smashed gas pump", '&', c_ltred, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem)},
|
||||
mfb(transparent)|mfb(noitem), &iexamine::none},
|
||||
{"out-of-order gasoline pump", '&', c_red, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem)},
|
||||
mfb(transparent)|mfb(noitem), &iexamine::none},
|
||||
{"missile", '#', c_ltblue, 0, tr_null,
|
||||
mfb(explodes)|mfb(noitem)},
|
||||
mfb(explodes)|mfb(noitem), &iexamine::none},
|
||||
{"blown-out missile",'#', c_ltgray, 0, tr_null,
|
||||
mfb(noitem)},
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"counter", '#', c_blue, 4, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(collapses)|mfb(deconstruct)},
|
||||
mfb(transparent)|mfb(flammable)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"radio tower", '&', c_ltgray, 0, tr_null,
|
||||
mfb(noitem)},
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"radio controls", '6', c_green, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem), &iexamine::none},
|
||||
{"broken console", '6', c_ltgray, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses)},
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses), &iexamine::none},
|
||||
{"computer console", '6', c_blue, 0, tr_null,
|
||||
mfb(transparent)|mfb(console)|mfb(noitem)|mfb(collapses)},
|
||||
mfb(transparent)|mfb(console)|mfb(noitem)|mfb(collapses), &iexamine::none},
|
||||
{"mechanical winch", '6', c_cyan_red, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses)},
|
||||
{"rope and pulley", '|', i_brown, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses)},
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses), &iexamine::controls_gate},
|
||||
{"rope and pulley", '|', c_brown, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses), &iexamine::controls_gate},
|
||||
{"rope and pulley", '|', c_brown, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses), &iexamine::controls_gate},
|
||||
{"sewage pipe", '1', c_ltgray, 0, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"sewage pump", '&', c_ltgray, 0, tr_null,
|
||||
mfb(noitem)},
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"centrifuge", '{', c_magenta, 0, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"column", '1', c_ltgray, 0, tr_null,
|
||||
mfb(flammable)},
|
||||
mfb(flammable), &iexamine::none},
|
||||
{"refrigerator", '{', c_ltcyan, 0, tr_null,
|
||||
mfb(container)|mfb(collapses)|mfb(bashable)|mfb(place_item)},
|
||||
mfb(container)|mfb(collapses)|mfb(bashable)|mfb(place_item), &iexamine::none},
|
||||
{"glass door fridge",'{', c_ltcyan, 0, tr_null,
|
||||
mfb(collapses)|mfb(bashable)|mfb(place_item)},
|
||||
mfb(collapses)|mfb(bashable)|mfb(place_item), &iexamine::none},
|
||||
{"dresser", '{', c_brown, 0, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable)|mfb(collapses)|
|
||||
mfb(bashable)|mfb(deconstruct)|mfb(place_item)},
|
||||
mfb(bashable)|mfb(deconstruct)|mfb(place_item), &iexamine::none},
|
||||
{"locker", '{', c_ltgray, 0, tr_null,
|
||||
mfb(container)|mfb(collapses)|mfb(bashable)|mfb(place_item)},
|
||||
mfb(container)|mfb(collapses)|mfb(bashable)|mfb(place_item), &iexamine::none},
|
||||
{"display rack", '{', c_ltgray, 0, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(collapses)|mfb(bashable)|
|
||||
mfb(deconstruct)|mfb(place_item)},
|
||||
mfb(deconstruct)|mfb(place_item), &iexamine::none},
|
||||
{"book case", '{', c_brown, 0, tr_null,
|
||||
mfb(flammable)|mfb(collapses)|mfb(bashable)|mfb(deconstruct)|mfb(place_item)},
|
||||
mfb(flammable)|mfb(collapses)|mfb(bashable)|mfb(deconstruct)|mfb(place_item), &iexamine::none},
|
||||
{"dumpster", '{', c_green, 0, tr_null,
|
||||
mfb(container)|mfb(bashable)|mfb(place_item)},
|
||||
mfb(container)|mfb(bashable)|mfb(place_item), &iexamine::none},
|
||||
{"cloning vat", '0', c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(sealed)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(sealed)|mfb(place_item), &iexamine::none},
|
||||
{"crate", 'X', i_brown, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(sealed)|
|
||||
mfb(flammable)|mfb(deconstruct)|mfb(place_item)},
|
||||
mfb(flammable)|mfb(deconstruct)|mfb(place_item), &iexamine::none},
|
||||
{"open crate", 'O', i_brown, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(flammable)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(flammable)|mfb(place_item), &iexamine::none},
|
||||
{"stairs down", '>', c_yellow, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item), &iexamine::none},
|
||||
{"stairs up", '<', c_yellow, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item), &iexamine::none},
|
||||
{"manhole", '>', c_dkgray, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item), &iexamine::none},
|
||||
{"ladder", '<', c_dkgray, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item), &iexamine::none},
|
||||
{"ladder", '>', c_dkgray, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item), &iexamine::none},
|
||||
{"downward slope", '>', c_brown, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item), &iexamine::none},
|
||||
{"upward slope", '<', c_brown, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item)},
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item), &iexamine::none},
|
||||
{"rope leading up", '<', c_white, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_up)},
|
||||
mfb(transparent)|mfb(goes_up), &iexamine::none},
|
||||
{"manhole cover", '0', c_dkgray, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"card reader", '6', c_pink, 0, tr_null, // Science
|
||||
mfb(noitem)},
|
||||
mfb(noitem), &iexamine::cardreader},
|
||||
{"card reader", '6', c_pink, 0, tr_null, // Military
|
||||
mfb(noitem)},
|
||||
mfb(noitem), &iexamine::cardreader},
|
||||
{"broken card reader",'6',c_ltgray, 0, tr_null,
|
||||
mfb(noitem)},
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"slot machine", '6', c_green, 0, tr_null,
|
||||
mfb(bashable)|mfb(noitem)},
|
||||
mfb(bashable)|mfb(noitem), &iexamine::slot_machine},
|
||||
{"elevator controls",'6', c_ltblue, 0, tr_null,
|
||||
mfb(noitem)},
|
||||
mfb(noitem), &iexamine::elevator},
|
||||
{"powerless controls",'6',c_ltgray, 0, tr_null,
|
||||
mfb(noitem)},
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"elevator", '.', c_magenta, 2, tr_null,
|
||||
0},
|
||||
0, &iexamine::none},
|
||||
{"dark pedestal", '&', c_dkgray, 0, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::pedestal_wyrm},
|
||||
{"light pedestal", '&', c_white, 0, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::pedestal_temple},
|
||||
{"red stone", '#', c_red, 0, tr_null,
|
||||
0},
|
||||
0, &iexamine::none},
|
||||
{"green stone", '#', c_green, 0, tr_null,
|
||||
0},
|
||||
0, &iexamine::none},
|
||||
{"blue stone", '#', c_blue, 0, tr_null,
|
||||
0},
|
||||
0, &iexamine::none},
|
||||
{"red floor", '.', c_red, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"green floor", '.', c_green, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"blue floor", '.', c_blue, 2, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"yellow switch", '6', c_yellow, 0, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"cyan switch", '6', c_cyan, 0, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"purple switch", '6', c_magenta, 0, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"checkered switch", '6', c_white, 0, tr_null,
|
||||
mfb(transparent)},
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"mutated poppy flower", 'f', c_red, 3, tr_null,
|
||||
mfb(transparent)}
|
||||
mfb(transparent), &iexamine::flower_poppy}
|
||||
};
|
||||
|
||||
enum map_extra {
|
||||
@@ -595,6 +604,10 @@ enum map_extra {
|
||||
num_map_extras
|
||||
};
|
||||
|
||||
const int classic_extras = mfb(mx_helicopter) | mfb(mx_military) |
|
||||
mfb(mx_stash) | mfb(mx_drugdeal) | mfb(mx_supplydrop) | mfb(mx_minefield) |
|
||||
mfb(mx_wolfpack) | mfb(mx_cougar) | mfb(mx_puddle) | mfb(mx_crater);
|
||||
|
||||
// Chances are relative to eachother; e.g. a 200 chance is twice as likely
|
||||
// as a 100 chance to appear.
|
||||
const int map_extra_chance[num_map_extras + 1] = {
|
||||
@@ -798,6 +811,7 @@ struct submap {
|
||||
std::vector<spawn_point> spawns;
|
||||
std::vector<vehicle*> vehicles;
|
||||
computer comp;
|
||||
basecamp camp; // only allowing one basecamp per submap
|
||||
};
|
||||
|
||||
std::ostream & operator<<(std::ostream &, const submap *);
|
||||
|
||||
+1556
-1531
File diff suppressed because it is too large
Load Diff
+5
-3
@@ -1,10 +1,10 @@
|
||||
#ifndef _MAPITEMS_H_
|
||||
#define _MAPITEMS_H_
|
||||
enum items_location {
|
||||
mi_none,
|
||||
mi_none, mi_child_items,
|
||||
mi_field, mi_forest, mi_hive, mi_hive_center,
|
||||
mi_road,
|
||||
mi_livingroom, mi_kitchen, mi_fridge, mi_home_hw, mi_bedroom, mi_homeguns,
|
||||
mi_livingroom, mi_kitchen, mi_knifeblock, mi_fridge, mi_home_hw, mi_bedroom, mi_homeguns,
|
||||
mi_dresser, mi_dining,
|
||||
mi_snacks, mi_fridgesnacks, mi_behindcounter, mi_magazines,
|
||||
mi_softdrugs, mi_harddrugs,
|
||||
@@ -40,7 +40,9 @@ enum items_location {
|
||||
mi_spider,
|
||||
mi_ant_food, mi_ant_egg,
|
||||
// Monster drops
|
||||
mi_biollante, mi_bugs, mi_bees, mi_wasps, mi_robots,
|
||||
mi_biollante, mi_bugs, mi_bees, mi_wasps, mi_robots, mi_eyebot,
|
||||
mi_manhack, mi_skitterbot, mi_secubot, mi_copbot, mi_molebot,
|
||||
mi_tripod, mi_chickenbot, mi_tankbot, mi_turret,
|
||||
// Map Extras
|
||||
mi_helicopter, mi_military, mi_science, mi_rare, mi_stash_food, mi_stash_ammo,
|
||||
mi_stash_wood, mi_stash_drugs, mi_drugdealer, mi_wreckage,
|
||||
|
||||
+547
-513
File diff suppressed because it is too large
Load Diff
@@ -22,7 +22,7 @@ std::string melee_verb(technique_id tech, std::string your, player &p,
|
||||
* STATE QUERIES
|
||||
* bool is_armed() - True if we are armed with any weapon.
|
||||
* bool unarmed_attack() - True if we are NOT armed with any weapon, but still
|
||||
* true if we're wielding a bionic weapon (at this point, just itm_bio_claws).
|
||||
* true if we're wielding a bionic weapon (at this point, just "bio_claws").
|
||||
*
|
||||
* HIT DETERMINATION
|
||||
* int base_to_hit() - The base number of sides we get in hit_roll().
|
||||
@@ -34,12 +34,12 @@ std::string melee_verb(technique_id tech, std::string your, player &p,
|
||||
|
||||
bool player::is_armed()
|
||||
{
|
||||
return (weapon.typeId() != 0 && !weapon.is_style());
|
||||
return (weapon.typeId() != "null" && !weapon.is_style());
|
||||
}
|
||||
|
||||
bool player::unarmed_attack()
|
||||
{
|
||||
return (weapon.typeId() == 0 || weapon.is_style() ||
|
||||
return (weapon.typeId() == "null" || weapon.is_style() ||
|
||||
weapon.has_flag(IF_UNARMED_WEAPON));
|
||||
}
|
||||
|
||||
@@ -47,23 +47,19 @@ int player::base_to_hit(bool real_life, int stat)
|
||||
{
|
||||
if (stat == -999)
|
||||
stat = (real_life ? dex_cur : dex_max);
|
||||
return 1 + int(stat / 2) + skillLevel("melee").level();
|
||||
return 1 + int(stat / 2) + skillLevel("melee");
|
||||
}
|
||||
|
||||
int player::hit_roll()
|
||||
{
|
||||
int stat = dex_cur;
|
||||
// Some martial arts use something else to determine hits!
|
||||
switch (weapon.typeId()) {
|
||||
case itm_style_tiger:
|
||||
if(weapon.typeId() == "style_tiger"){
|
||||
stat = (str_cur * 2 + dex_cur) / 3;
|
||||
break;
|
||||
case itm_style_leopard:
|
||||
} else if(weapon.typeId() == "style_leopard"){
|
||||
stat = (per_cur + int_cur + dex_cur * 2) / 4;
|
||||
break;
|
||||
case itm_style_snake:
|
||||
} else if(weapon.typeId() == "style_snake"){
|
||||
stat = (per_cur + dex_cur) / 2;
|
||||
break;
|
||||
}
|
||||
int numdice = base_to_hit(stat) + weapon.type->m_to_hit +
|
||||
disease_intensity(DI_ATTACK_BOOST);
|
||||
@@ -74,28 +70,28 @@ int player::hit_roll()
|
||||
|
||||
// Are we unarmed?
|
||||
if (unarmed_attack()) {
|
||||
best_bonus = skillLevel("unarmed").level();
|
||||
if (skillLevel("unarmed").level() > 4)
|
||||
best_bonus += skillLevel("unarmed").level() - 4; // Extra bonus for high levels
|
||||
best_bonus = skillLevel("unarmed");
|
||||
if (skillLevel("unarmed") > 4)
|
||||
best_bonus += skillLevel("unarmed") - 4; // Extra bonus for high levels
|
||||
}
|
||||
|
||||
// Using a bashing weapon?
|
||||
if (weapon.is_bashing_weapon()) {
|
||||
int bash_bonus = int(skillLevel("bashing").level() / 3);
|
||||
int bash_bonus = int(skillLevel("bashing") / 3);
|
||||
if (bash_bonus > best_bonus)
|
||||
best_bonus = bash_bonus;
|
||||
}
|
||||
|
||||
// Using a cutting weapon?
|
||||
if (weapon.is_cutting_weapon()) {
|
||||
int cut_bonus = int(skillLevel("cutting").level() / 2);
|
||||
int cut_bonus = int(skillLevel("cutting") / 2);
|
||||
if (cut_bonus > best_bonus)
|
||||
best_bonus = cut_bonus;
|
||||
}
|
||||
|
||||
// Using a spear?
|
||||
if (weapon.has_flag(IF_SPEAR) || weapon.has_flag(IF_STAB)) {
|
||||
int stab_bonus = int(skillLevel("stabbing").level() / 2);
|
||||
int stab_bonus = int(skillLevel("stabbing") / 2);
|
||||
if (stab_bonus > best_bonus)
|
||||
best_bonus = stab_bonus;
|
||||
}
|
||||
@@ -110,6 +106,11 @@ int player::hit_roll()
|
||||
numdice += int(disease_level(DI_DRUNK) / 400);
|
||||
}
|
||||
|
||||
// Farsightedness makes us hit worse
|
||||
if (has_trait(PF_HYPEROPIC) && !is_wearing("glasses_reading")) {
|
||||
numdice -= 2;
|
||||
}
|
||||
|
||||
if (numdice < 1) {
|
||||
numdice = 1;
|
||||
sides = 8 - encumb(bp_torso);
|
||||
@@ -173,6 +174,7 @@ int player::hit_mon(game *g, monster *z, bool allow_grab) // defaults to true
|
||||
int stuck_penalty = roll_stuck_penalty(z, (stab_dam >= cut_dam));
|
||||
if (weapon.is_style())
|
||||
stuck_penalty = 0;
|
||||
moves -= stuck_penalty;
|
||||
|
||||
// Pick one or more special attacks
|
||||
technique_id technique = pick_technique(g, z, NULL, critical_hit, allow_grab);
|
||||
@@ -188,7 +190,7 @@ int player::hit_mon(game *g, monster *z, bool allow_grab) // defaults to true
|
||||
melee_special_effects(g, z, NULL, critical_hit, bash_dam, cut_dam, stab_dam);
|
||||
|
||||
// Make a rather quiet sound, to alert any nearby monsters
|
||||
if (weapon.typeId() != itm_style_ninjutsu) // Ninjutsu is silent!
|
||||
if (weapon.typeId() != "style_ninjutsu") // Ninjutsu is silent!
|
||||
g->sound(posx, posy, 8, "");
|
||||
|
||||
verb = melee_verb(technique, your, *this, bash_dam, cut_dam, stab_dam);
|
||||
@@ -300,7 +302,8 @@ void player::hit_player(game *g, player &p, bool allow_grab)
|
||||
int stuck_penalty = roll_stuck_penalty(NULL, (stab_dam >= cut_dam));
|
||||
if (weapon.is_style())
|
||||
stuck_penalty = 0;
|
||||
|
||||
moves -= stuck_penalty;
|
||||
|
||||
// Pick one or more special attacks
|
||||
technique_id technique = pick_technique(g, NULL, &p, critical_hit, allow_grab);
|
||||
|
||||
@@ -315,7 +318,7 @@ void player::hit_player(game *g, player &p, bool allow_grab)
|
||||
melee_special_effects(g, NULL, &p, critical_hit, bash_dam, cut_dam, stab_dam);
|
||||
|
||||
// Make a rather quiet sound, to alert any nearby monsters
|
||||
if (weapon.typeId() != itm_style_ninjutsu) // Ninjutsu is silent!
|
||||
if (weapon.typeId() != "style_ninjutsu") // Ninjutsu is silent!
|
||||
g->sound(posx, posy, 8, "");
|
||||
|
||||
p.hit(g, bp_hit, side, bash_dam, (cut_dam > stab_dam ? cut_dam : stab_dam));
|
||||
@@ -335,8 +338,8 @@ void player::hit_player(game *g, player &p, bool allow_grab)
|
||||
if (allow_grab && technique == TEC_GRAB) {
|
||||
// Move our weapon to a temp slot, if it's not unarmed
|
||||
if (p.weapon.has_technique(TEC_BREAK, &p) &&
|
||||
dice(p.dex_cur + p.skillLevel("melee").level(), 12) >
|
||||
dice(dex_cur + skillLevel("melee").level(), 10)) {
|
||||
dice(p.dex_cur + p.skillLevel("melee"), 12) >
|
||||
dice(dex_cur + skillLevel("melee"), 10)) {
|
||||
if (is_u)
|
||||
g->add_msg("%s break%s the grab!", target.c_str(), (p.is_npc() ? "s" : ""));
|
||||
} else if (!unarmed_attack()) {
|
||||
@@ -375,7 +378,7 @@ bool player::scored_crit(int target_dodge)
|
||||
// Weapon to-hit roll
|
||||
int chance = 25;
|
||||
if (unarmed_attack()) { // Unarmed attack: 1/2 of unarmed skill is to-hit
|
||||
for (int i = 1; i <= int(skillLevel("unarmed").level() * .5); i++)
|
||||
for (int i = 1; i <= int(skillLevel("unarmed") * .5); i++)
|
||||
chance += (50 / (2 + i));
|
||||
}
|
||||
if (weapon.type->m_to_hit > 0) {
|
||||
@@ -392,16 +395,12 @@ bool player::scored_crit(int target_dodge)
|
||||
// ... except sometimes we don't use dexteiry!
|
||||
int stat = dex_cur;
|
||||
// Some martial arts use something else to determine hits!
|
||||
switch (weapon.typeId()) {
|
||||
case itm_style_tiger:
|
||||
if(weapon.typeId() == "style_tiger"){
|
||||
stat = (str_cur * 2 + dex_cur) / 3;
|
||||
break;
|
||||
case itm_style_leopard:
|
||||
} else if(weapon.typeId() == "style_leopard"){
|
||||
stat = (per_cur + int_cur + dex_cur * 2) / 4;
|
||||
break;
|
||||
case itm_style_snake:
|
||||
} else if(weapon.typeId() == "style_snake"){
|
||||
stat = (per_cur + dex_cur) / 2;
|
||||
break;
|
||||
}
|
||||
chance = 25;
|
||||
if (stat > 8) {
|
||||
@@ -421,17 +420,17 @@ bool player::scored_crit(int target_dodge)
|
||||
// Skill level roll
|
||||
int best_skill = 0;
|
||||
|
||||
if (weapon.is_bashing_weapon() && skillLevel("bashing").level() > best_skill)
|
||||
best_skill = skillLevel("bashing").level();
|
||||
if (weapon.is_cutting_weapon() && skillLevel("cutting").level() > best_skill)
|
||||
best_skill = skillLevel("cutting").level();
|
||||
if (weapon.is_bashing_weapon() && skillLevel("bashing") > best_skill)
|
||||
best_skill = skillLevel("bashing");
|
||||
if (weapon.is_cutting_weapon() && skillLevel("cutting") > best_skill)
|
||||
best_skill = skillLevel("cutting");
|
||||
if ((weapon.has_flag(IF_SPEAR) || weapon.has_flag(IF_STAB)) &&
|
||||
skillLevel("stabbing").level() > best_skill)
|
||||
best_skill = skillLevel("stabbing").level();
|
||||
if (unarmed_attack() && skillLevel("unarmed").level() > best_skill)
|
||||
best_skill = skillLevel("unarmed").level();
|
||||
skillLevel("stabbing") > best_skill)
|
||||
best_skill = skillLevel("stabbing");
|
||||
if (unarmed_attack() && skillLevel("unarmed") > best_skill)
|
||||
best_skill = skillLevel("unarmed");
|
||||
|
||||
best_skill += int(skillLevel("melee").level() / 2.5);
|
||||
best_skill += int(skillLevel("melee") / 2.5);
|
||||
|
||||
chance = 25;
|
||||
if (best_skill > 3) {
|
||||
@@ -459,7 +458,7 @@ int player::dodge(game *g)
|
||||
if (activity.type != ACT_NULL)
|
||||
return 0;
|
||||
int ret = 4 + (dex_cur / 2);
|
||||
ret += skillLevel("dodge").level();
|
||||
ret += skillLevel("dodge");
|
||||
ret += disease_intensity(DI_DODGE_BOOST);
|
||||
ret -= (encumb(bp_legs) / 2) + encumb(bp_torso);
|
||||
ret += int(current_speed(g) / 150);
|
||||
@@ -476,15 +475,15 @@ int player::dodge(game *g)
|
||||
else if (str_max <= 5)
|
||||
ret++; // Bonus if we're small
|
||||
if (dodges_left <= 0) { // We already dodged this turn
|
||||
if (rng(1, skillLevel("dodge").level() + dex_cur + 15) <= skillLevel("dodge").level() + dex_cur)
|
||||
if (rng(1, skillLevel("dodge") + dex_cur + 15) <= skillLevel("dodge") + dex_cur)
|
||||
ret = rng(0, ret);
|
||||
else
|
||||
ret = 0;
|
||||
}
|
||||
dodges_left--;
|
||||
// If we're over our cap, average it with our cap
|
||||
if (ret > int(dex_cur / 2) + skillLevel("dodge").level() * 2)
|
||||
ret = ( ret + int(dex_cur / 2) + skillLevel("dodge").level() * 2 ) / 2;
|
||||
if (ret > int(dex_cur / 2) + skillLevel("dodge") * 2)
|
||||
ret = ( ret + int(dex_cur / 2) + skillLevel("dodge") * 2 ) / 2;
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -512,20 +511,16 @@ int player::roll_bash_damage(monster *z, bool crit)
|
||||
{
|
||||
int ret = 0;
|
||||
int stat = str_cur; // Which stat determines damage?
|
||||
int skill = skillLevel("bashing").level(); // Which skill determines damage?
|
||||
int skill = skillLevel("bashing"); // Which skill determines damage?
|
||||
if (unarmed_attack())
|
||||
skill = skillLevel("unarmed").level();
|
||||
skill = skillLevel("unarmed");
|
||||
|
||||
switch (weapon.typeId()) { // Some martial arts change which stat
|
||||
case itm_style_crane:
|
||||
if(weapon.typeId() =="style_crane"){
|
||||
stat = (dex_cur * 2 + str_cur) / 3;
|
||||
break;
|
||||
case itm_style_snake:
|
||||
} else if(weapon.typeId() == "style_snake"){
|
||||
stat = int(str_cur + per_cur) / 2;
|
||||
break;
|
||||
case itm_style_dragon:
|
||||
} else if(weapon.typeId() == "style_dragon"){
|
||||
stat = int(str_cur + int_cur) / 2;
|
||||
break;
|
||||
}
|
||||
|
||||
ret = base_damage(true, stat);
|
||||
@@ -548,7 +543,7 @@ int player::roll_bash_damage(monster *z, bool crit)
|
||||
bash_cap = 5 + stat + skill;
|
||||
|
||||
if (unarmed_attack())
|
||||
bash_dam = rng(0, int(stat / 2) + skillLevel("unarmed").level());
|
||||
bash_dam = rng(0, int(stat / 2) + skillLevel("unarmed"));
|
||||
|
||||
if (crit) {
|
||||
bash_dam *= 1.5;
|
||||
@@ -588,7 +583,7 @@ int player::roll_cut_damage(monster *z, bool crit)
|
||||
{
|
||||
if (weapon.has_flag(IF_SPEAR))
|
||||
return 0; // Stabs, doesn't cut!
|
||||
int z_armor_cut = (z == NULL ? 0 : z->armor_cut() - skillLevel("cutting").level() / 2);
|
||||
int z_armor_cut = (z == NULL ? 0 : z->armor_cut() - skillLevel("cutting") / 2);
|
||||
|
||||
if (crit)
|
||||
z_armor_cut /= 2;
|
||||
@@ -601,7 +596,7 @@ int player::roll_cut_damage(monster *z, bool crit)
|
||||
if (has_trait(PF_CLAWS))
|
||||
ret += 6;
|
||||
if (has_trait(PF_TALONS))
|
||||
ret += 6 + (skillLevel("unarmed").level() > 8 ? 8 : skillLevel("unarmed").level());
|
||||
ret += 6 + ((int)skillLevel("unarmed") > 8 ? 8 : (int)skillLevel("unarmed"));
|
||||
if (has_trait(PF_SLIME_HANDS) && (z == NULL || !z->has_flag(MF_ACIDPROOF)))
|
||||
ret += rng(4, 6);
|
||||
}
|
||||
@@ -610,13 +605,13 @@ int player::roll_cut_damage(monster *z, bool crit)
|
||||
return 0; // No negative damage!
|
||||
|
||||
// 80%, 88%, 96%, 104%, 112%, 116%, 120%, 124%, 128%, 132%
|
||||
if (skillLevel("cutting").level() <= 5)
|
||||
ret *= double( 0.8 + 0.08 * skillLevel("cutting").level() );
|
||||
if (skillLevel("cutting") <= 5)
|
||||
ret *= double( 0.8 + 0.08 * skillLevel("cutting") );
|
||||
else
|
||||
ret *= double( 0.92 + 0.04 * skillLevel("cutting").level() );
|
||||
ret *= double( 0.92 + 0.04 * skillLevel("cutting") );
|
||||
|
||||
if (crit)
|
||||
ret *= double( 1.0 + double(skillLevel("cutting").level() / 12) );
|
||||
ret *= double( 1.0 + double(skillLevel("cutting") / 12) );
|
||||
|
||||
return ret;
|
||||
}
|
||||
@@ -624,7 +619,7 @@ int player::roll_cut_damage(monster *z, bool crit)
|
||||
int player::roll_stab_damage(monster *z, bool crit)
|
||||
{
|
||||
int ret = 0;
|
||||
int z_armor = (z == NULL ? 0 : z->armor_cut() - 3 * skillLevel("stabbing").level());
|
||||
int z_armor = (z == NULL ? 0 : z->armor_cut() - 3 * skillLevel("stabbing"));
|
||||
|
||||
if (crit)
|
||||
z_armor /= 3;
|
||||
@@ -657,7 +652,7 @@ int player::roll_stab_damage(monster *z, bool crit)
|
||||
return 0; // No negative stabbing!
|
||||
|
||||
if (crit) {
|
||||
int multiplier = double( 1.0 + double(skillLevel("stabbing").level() / 5) );
|
||||
int multiplier = double( 1.0 + double(skillLevel("stabbing") / 5) );
|
||||
if (multiplier > 2.5)
|
||||
multiplier = 2.5;
|
||||
ret *= multiplier;
|
||||
@@ -673,10 +668,10 @@ int player::roll_stuck_penalty(monster *z, bool stabbing)
|
||||
cutarm = (z == NULL ? 6 : z->armor_cut());
|
||||
if (stabbing)
|
||||
ret = weapon.damage_cut() * 3 + basharm * 3 + cutarm * 3 -
|
||||
dice(skillLevel("stabbing").level(), 10);
|
||||
dice(skillLevel("stabbing"), 10);
|
||||
else
|
||||
ret = weapon.damage_cut() * 4 + basharm * 5 + cutarm * 4 -
|
||||
dice(skillLevel("cutting").level(), 10);
|
||||
dice(skillLevel("cutting"), 10);
|
||||
|
||||
if (ret >= weapon.damage_cut() * 10)
|
||||
return weapon.damage_cut() * 10;
|
||||
@@ -714,7 +709,7 @@ technique_id player::pick_technique(game *g, monster *z, player *p,
|
||||
possible.push_back(TEC_PRECISE);
|
||||
|
||||
if (weapon.has_technique(TEC_BRUTAL, this) && !downed &&
|
||||
str_cur + skillLevel("melee").level() >= 4 + base_str_req)
|
||||
str_cur + skillLevel("melee") >= 4 + base_str_req)
|
||||
possible.push_back(TEC_BRUTAL);
|
||||
|
||||
}
|
||||
@@ -722,9 +717,9 @@ technique_id player::pick_technique(game *g, monster *z, player *p,
|
||||
if (possible.empty()) { // Use non-crits only if any crit-onlies aren't used
|
||||
|
||||
if (weapon.has_technique(TEC_DISARM, this) && !z &&
|
||||
p->weapon.typeId() != 0 && !p->weapon.has_flag(IF_UNARMED_WEAPON) &&
|
||||
dice( dex_cur + skillLevel("unarmed").level(), 8) >
|
||||
dice(p->dex_cur + p->skillLevel("melee").level(), 10))
|
||||
p->weapon.typeId() != "null" && !p->weapon.has_flag(IF_UNARMED_WEAPON) &&
|
||||
dice( dex_cur + skillLevel("unarmed"), 8) >
|
||||
dice(p->dex_cur + p->skillLevel("melee"), 10))
|
||||
possible.push_back(TEC_DISARM);
|
||||
|
||||
if (weapon.has_technique(TEC_GRAB, this) && allowgrab)
|
||||
@@ -734,7 +729,7 @@ technique_id player::pick_technique(game *g, monster *z, player *p,
|
||||
possible.push_back(TEC_RAPID);
|
||||
|
||||
if (weapon.has_technique(TEC_THROW, this) && !downed &&
|
||||
str_cur + skillLevel("melee").level() >= 4 + base_str_req * 4 + rng(-4, 4))
|
||||
str_cur + skillLevel("melee") >= 4 + base_str_req * 4 + rng(-4, 4))
|
||||
possible.push_back(TEC_THROW);
|
||||
|
||||
if (weapon.has_technique(TEC_WIDE, this)) { // Count monsters
|
||||
@@ -800,7 +795,7 @@ void player::perform_technique(technique_id technique, game *g, monster *z,
|
||||
if (z != NULL && !z->has_flag(MF_FLIES)) {
|
||||
z->add_effect(ME_DOWNED, rng(1, 2));
|
||||
bash_dam += z->fall_damage();
|
||||
} else if (p != NULL && !p->weapon.typeId() == itm_style_judo) {
|
||||
} else if (p != NULL && p->weapon.typeId() != "style_judo") {
|
||||
p->add_disease(DI_DOWNED, rng(1, 2), g);
|
||||
bash_dam += 3;
|
||||
}
|
||||
@@ -832,7 +827,7 @@ void player::perform_technique(technique_id technique, game *g, monster *z,
|
||||
z->knock_back_from(g, posx + rng(-1, 1), posy + rng(-1, 1));
|
||||
} else if (p != NULL) {
|
||||
p->knock_back_from(g, posx + rng(-1, 1), posy + rng(-1, 1));
|
||||
if (!p->weapon.typeId() == itm_style_judo)
|
||||
if (p->weapon.typeId() != "style_judo")
|
||||
p->add_disease(DI_DOWNED, rng(1, 2), g);
|
||||
}
|
||||
break;
|
||||
@@ -888,7 +883,7 @@ technique_id player::pick_defensive_technique(game *g, monster *z, player *p)
|
||||
if (z != NULL)
|
||||
foe_melee_skill = z->type->melee_skill;
|
||||
else if (p != NULL)
|
||||
foe_melee_skill = p->dex_cur + p->skillLevel("melee").level();
|
||||
foe_melee_skill = p->dex_cur + p->skillLevel("melee");
|
||||
|
||||
int foe_dodge = 0;
|
||||
if (z != NULL)
|
||||
@@ -909,26 +904,26 @@ technique_id player::pick_defensive_technique(game *g, monster *z, player *p)
|
||||
|
||||
blocks_left--;
|
||||
if (weapon.has_technique(TEC_WBLOCK_3) &&
|
||||
dice(dex_cur + skillLevel("melee").level(), 12) > dice(foe_melee_skill, 10))
|
||||
dice(dex_cur + skillLevel("melee"), 12) > dice(foe_melee_skill, 10))
|
||||
return TEC_WBLOCK_3;
|
||||
|
||||
if (weapon.has_technique(TEC_WBLOCK_2) &&
|
||||
dice(dex_cur + skillLevel("melee").level(), 6) > dice(foe_melee_skill, 10))
|
||||
dice(dex_cur + skillLevel("melee"), 6) > dice(foe_melee_skill, 10))
|
||||
return TEC_WBLOCK_2;
|
||||
|
||||
if (weapon.has_technique(TEC_WBLOCK_1) &&
|
||||
dice(dex_cur + skillLevel("melee").level(), 3) > dice(foe_melee_skill, 10))
|
||||
dice(dex_cur + skillLevel("melee"), 3) > dice(foe_melee_skill, 10))
|
||||
return TEC_WBLOCK_1;
|
||||
|
||||
if (weapon.has_technique(TEC_DEF_DISARM, this) &&
|
||||
z == NULL && p->weapon.typeId() != 0 &&
|
||||
z == NULL && p->weapon.typeId() != "null" &&
|
||||
!p->weapon.has_flag(IF_UNARMED_WEAPON) &&
|
||||
dice( dex_cur + skillLevel("unarmed").level(), 8) >
|
||||
dice(p->dex_cur + p->skillLevel("melee").level(), 10))
|
||||
dice( dex_cur + skillLevel("unarmed"), 8) >
|
||||
dice(p->dex_cur + p->skillLevel("melee"), 10))
|
||||
return TEC_DEF_DISARM;
|
||||
|
||||
if (weapon.has_technique(TEC_DEF_THROW, this) &&
|
||||
str_cur + skillLevel("melee").level() >= foe_size + rng(-4, 4) &&
|
||||
str_cur + skillLevel("melee") >= foe_size + rng(-4, 4) &&
|
||||
hit_roll() > rng(1, 5) + foe_dodge && !one_in(3))
|
||||
return TEC_DEF_THROW;
|
||||
|
||||
@@ -938,13 +933,13 @@ technique_id player::pick_defensive_technique(game *g, monster *z, player *p)
|
||||
|
||||
if (weapon.has_technique(TEC_BLOCK_LEGS, this) &&
|
||||
(hp_cur[hp_leg_l] >= 20 || hp_cur[hp_leg_r] >= 20) &&
|
||||
dice(dex_cur + skillLevel("unarmed").level() + skillLevel("melee").level(), 13) >
|
||||
dice(dex_cur + skillLevel("unarmed") + skillLevel("melee"), 13) >
|
||||
dice(8 + foe_melee_skill, 10))
|
||||
return TEC_BLOCK_LEGS;
|
||||
|
||||
if (weapon.has_technique(TEC_BLOCK, this) &&
|
||||
(hp_cur[hp_arm_l] >= 20 || hp_cur[hp_arm_r] >= 20) &&
|
||||
dice(dex_cur + skillLevel("unarmed").level() + skillLevel("melee").level(), 16) >
|
||||
dice(dex_cur + skillLevel("unarmed") + skillLevel("melee"), 16) >
|
||||
dice(6 + foe_melee_skill, 10))
|
||||
return TEC_BLOCK;
|
||||
|
||||
@@ -986,9 +981,9 @@ void player::perform_defensive_technique(
|
||||
bash_dam *= .5;
|
||||
double reduction = 1.0;
|
||||
// Special reductions for certain styles
|
||||
if (weapon.typeId() == itm_style_tai_chi)
|
||||
if (weapon.typeId() == "style_tai_chi")
|
||||
reduction -= double(0.08 * double(per_cur - 6));
|
||||
if (weapon.typeId() == itm_style_taekwando)
|
||||
if (weapon.typeId() == "style_taekwondo")
|
||||
reduction -= double(0.08 * double(str_cur - 6));
|
||||
if (reduction > 1.0)
|
||||
reduction = 1.0;
|
||||
@@ -1113,7 +1108,7 @@ void player::melee_special_effects(game *g, monster *z, player *p, bool crit,
|
||||
|
||||
// Bashing crit
|
||||
if (crit && !unarmed_attack()) {
|
||||
int turns_stunned = int(bash_dam / 20) + rng(0, int(skillLevel("bashing").level() / 2));
|
||||
int turns_stunned = int(bash_dam / 20) + rng(0, int(skillLevel("bashing") / 2));
|
||||
if (turns_stunned > 6)
|
||||
turns_stunned = 6;
|
||||
if (turns_stunned > 0) {
|
||||
@@ -1145,11 +1140,11 @@ void player::melee_special_effects(game *g, monster *z, player *p, bool crit,
|
||||
p->moves -= stab_moves;
|
||||
|
||||
// Bonus attacks!
|
||||
bool shock_them = (has_bionic(bio_shock) && power_level >= 2 &&
|
||||
bool shock_them = (has_bionic("bio_shock") && power_level >= 2 &&
|
||||
unarmed_attack() && (!mon || !z->has_flag(MF_ELECTRIC)) &&
|
||||
one_in(3));
|
||||
|
||||
bool drain_them = (has_bionic(bio_heat_absorb) && power_level >= 1 &&
|
||||
bool drain_them = (has_bionic("bio_heat_absorb") && power_level >= 1 &&
|
||||
!is_armed() && (!mon || z->has_flag(MF_WARM)));
|
||||
|
||||
if (drain_them)
|
||||
@@ -1239,7 +1234,7 @@ void player::melee_special_effects(game *g, monster *z, player *p, bool crit,
|
||||
} else {
|
||||
if (mon && (cut_dam >= z->hp || stab_dam >= z->hp)) {
|
||||
cutting_penalty /= 2;
|
||||
cutting_penalty -= rng(skillLevel("cutting").level(), skillLevel("cutting").level() * 2 + 2);
|
||||
cutting_penalty -= rng(skillLevel("cutting"), skillLevel("cutting") * 2 + 2);
|
||||
}
|
||||
if (cutting_penalty > 0)
|
||||
moves -= cutting_penalty;
|
||||
@@ -1251,36 +1246,22 @@ void player::melee_special_effects(game *g, monster *z, player *p, bool crit,
|
||||
}
|
||||
|
||||
// Finally, some special effects for martial arts
|
||||
switch (weapon.typeId()) {
|
||||
|
||||
case itm_style_karate:
|
||||
if(weapon.typeId() == "style_karate"){
|
||||
dodges_left++;
|
||||
blocks_left += 2;
|
||||
break;
|
||||
|
||||
case itm_style_aikido:
|
||||
} else if(weapon.typeId() == "style_aikido"){
|
||||
bash_dam /= 2;
|
||||
break;
|
||||
|
||||
case itm_style_capoeira:
|
||||
} else if(weapon.typeId() == "style_capoeira"){
|
||||
add_disease(DI_DODGE_BOOST, 2, g, 2);
|
||||
break;
|
||||
|
||||
case itm_style_muay_thai:
|
||||
} else if(weapon.typeId() == "style_muay_thai"){
|
||||
if ((mon && z->type->size >= MS_LARGE) || (!mon && p->str_max >= 12))
|
||||
bash_dam += rng((mon ? z->type->size : (p->str_max - 8) / 4),
|
||||
3 * (mon ? z->type->size : (p->str_max - 8) / 4));
|
||||
break;
|
||||
|
||||
case itm_style_tiger:
|
||||
} else if(weapon.typeId() == "style_tiger"){
|
||||
add_disease(DI_DAMAGE_BOOST, 2, g, 2, 10);
|
||||
break;
|
||||
|
||||
case itm_style_centipede:
|
||||
} else if(weapon.typeId() == "style_centipede"){
|
||||
add_disease(DI_SPEED_BOOST, 2, g, 4, 40);
|
||||
break;
|
||||
|
||||
case itm_style_venom_snake:
|
||||
} else if(weapon.typeId() == "style_venom_snake"){
|
||||
if (has_disease(DI_VIPER_COMBO)) {
|
||||
if (disease_intensity(DI_VIPER_COMBO) == 1) {
|
||||
if (is_u)
|
||||
@@ -1305,9 +1286,7 @@ void player::melee_special_effects(game *g, monster *z, player *p, bool crit,
|
||||
bash_dam += 5;
|
||||
add_disease(DI_VIPER_COMBO, 2, g, 1, 2);
|
||||
}
|
||||
break;
|
||||
|
||||
case itm_style_scorpion:
|
||||
} else if(weapon.typeId() == "style_scorpion"){
|
||||
if (crit) {
|
||||
if (!is_npc())
|
||||
g->add_msg("Stinger Strike!");
|
||||
@@ -1325,12 +1304,8 @@ void player::melee_special_effects(game *g, monster *z, player *p, bool crit,
|
||||
p->knock_back_from(g, posx, posy); // Knock a 2nd time if the first worked
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case itm_style_zui_quan:
|
||||
} else if(weapon.typeId() == "style_zui_quan"){
|
||||
dodges_left = 50; // Basically, unlimited.
|
||||
break;
|
||||
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1351,7 +1326,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
|
||||
std::stringstream text;
|
||||
|
||||
if (has_trait(PF_FANGS) && !wearing_something_on(bp_mouth) &&
|
||||
one_in(20 - dex_cur - skillLevel("unarmed").level())) {
|
||||
one_in(20 - dex_cur - skillLevel("unarmed"))) {
|
||||
special_attack tmp;
|
||||
text << You << " sink" << (is_u ? " " : "s ") << your << " fangs into " <<
|
||||
target << "!";
|
||||
@@ -1360,7 +1335,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
|
||||
ret.push_back(tmp);
|
||||
}
|
||||
|
||||
if (has_trait(PF_MANDIBLES) && one_in(22 - dex_cur - skillLevel("unarmed").level())) {
|
||||
if (has_trait(PF_MANDIBLES) && one_in(22 - dex_cur - skillLevel("unarmed"))) {
|
||||
special_attack tmp;
|
||||
text << You << " slice" << (is_u ? " " : "s ") << target << " with " <<
|
||||
your << " mandibles!";
|
||||
@@ -1369,7 +1344,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
|
||||
ret.push_back(tmp);
|
||||
}
|
||||
|
||||
if (has_trait(PF_BEAK) && one_in(15 - dex_cur - skillLevel("unarmed").level())) {
|
||||
if (has_trait(PF_BEAK) && one_in(15 - dex_cur - skillLevel("unarmed"))) {
|
||||
special_attack tmp;
|
||||
text << You << " peck" << (is_u ? " " : "s ") << target << "!";
|
||||
tmp.text = text.str();
|
||||
@@ -1377,7 +1352,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
|
||||
ret.push_back(tmp);
|
||||
}
|
||||
|
||||
if (has_trait(PF_HOOVES) && one_in(25 - dex_cur - 2 * skillLevel("unarmed").level())) {
|
||||
if (has_trait(PF_HOOVES) && one_in(25 - dex_cur - 2 * skillLevel("unarmed"))) {
|
||||
special_attack tmp;
|
||||
text << You << " kick" << (is_u ? " " : "s ") << target << " with " <<
|
||||
your << " hooves!";
|
||||
@@ -1388,7 +1363,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
|
||||
ret.push_back(tmp);
|
||||
}
|
||||
|
||||
if (has_trait(PF_HORNS) && one_in(20 - dex_cur - skillLevel("unarmed").level())) {
|
||||
if (has_trait(PF_HORNS) && one_in(20 - dex_cur - skillLevel("unarmed"))) {
|
||||
special_attack tmp;
|
||||
text << You << " headbutt" << (is_u ? " " : "s ") << target << " with " <<
|
||||
your << " horns!";
|
||||
@@ -1398,7 +1373,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
|
||||
ret.push_back(tmp);
|
||||
}
|
||||
|
||||
if (has_trait(PF_HORNS_CURLED) && one_in(20 - dex_cur - skillLevel("unarmed").level())) {
|
||||
if (has_trait(PF_HORNS_CURLED) && one_in(20 - dex_cur - skillLevel("unarmed"))) {
|
||||
special_attack tmp;
|
||||
text << You << " headbutt" << (is_u ? " " : "s ") << target << " with " <<
|
||||
your << " curled horns!";
|
||||
@@ -1407,7 +1382,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
|
||||
ret.push_back(tmp);
|
||||
}
|
||||
|
||||
if (has_trait(PF_HORNS_POINTED) && one_in(22 - dex_cur - skillLevel("unarmed").level())){
|
||||
if (has_trait(PF_HORNS_POINTED) && one_in(22 - dex_cur - skillLevel("unarmed"))){
|
||||
special_attack tmp;
|
||||
text << You << " stab" << (is_u ? " " : "s ") << target << " with " <<
|
||||
your << " pointed horns!";
|
||||
@@ -1416,7 +1391,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
|
||||
ret.push_back(tmp);
|
||||
}
|
||||
|
||||
if (has_trait(PF_ANTLERS) && one_in(20 - dex_cur - skillLevel("unarmed").level())) {
|
||||
if (has_trait(PF_ANTLERS) && one_in(20 - dex_cur - skillLevel("unarmed"))) {
|
||||
special_attack tmp;
|
||||
text << You << " butt" << (is_u ? " " : "s ") << target << " with " <<
|
||||
your << " antlers!";
|
||||
@@ -1454,7 +1429,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
|
||||
num_attacks--;
|
||||
|
||||
for (int i = 0; i < num_attacks; i++) {
|
||||
if (one_in(18 - dex_cur - skillLevel("unarmed").level())) {
|
||||
if (one_in(18 - dex_cur - skillLevel("unarmed"))) {
|
||||
special_attack tmp;
|
||||
text.str("");
|
||||
text << You << " slap" << (is_u ? " " : "s ") << target << " with " <<
|
||||
|
||||
+2
-1
@@ -45,7 +45,8 @@ std::string mission::save_info()
|
||||
|
||||
void mission::load_info(game *g, std::ifstream &data)
|
||||
{
|
||||
int type_id, rewtype, reward_id, rew_item, rew_skill, itemid, tmpfollow;
|
||||
int type_id, rewtype, reward_id, rew_skill, tmpfollow;
|
||||
std::string rew_item, itemid;
|
||||
data >> type_id;
|
||||
type = &(g->mission_types[type_id]);
|
||||
std::string tmpdesc;
|
||||
|
||||
@@ -109,7 +109,7 @@ struct mission_type {
|
||||
{
|
||||
deadline_low = 0;
|
||||
deadline_high = 0;
|
||||
item_id = itm_null;
|
||||
item_id = "null";
|
||||
follow_up = MISSION_NULL;
|
||||
};
|
||||
|
||||
@@ -145,7 +145,7 @@ struct mission {
|
||||
value = 0;
|
||||
uid = -1;
|
||||
target = point(-1, -1);
|
||||
item_id = itm_null;
|
||||
item_id = "null";
|
||||
count = 0;
|
||||
deadline = 0;
|
||||
npc_id = -1;
|
||||
|
||||
+21
-21
@@ -21,7 +21,7 @@ void mission_start::infect_npc(game *g, mission *miss)
|
||||
}
|
||||
p->add_disease(DI_INFECTION, -1, g);
|
||||
for (int i = 0; i < p->inv.size(); i++) {
|
||||
if (p->inv[i].type->id == itm_antibiotics) {
|
||||
if (p->inv[i].type->id == "antibiotics") {
|
||||
p->inv.remove_stack(i);
|
||||
i--;
|
||||
}
|
||||
@@ -37,20 +37,20 @@ void mission_start::place_dog(game *g, mission *miss)
|
||||
debugmsg("Couldn't find NPC! %d", miss->npc_id);
|
||||
return;
|
||||
}
|
||||
g->u.i_add( item(g->itypes[itm_dog_whistle], 0) );
|
||||
g->u.i_add( item(g->itypes["dog_whistle"], 0) );
|
||||
g->add_msg("%s gave you a dog whistle.", dev->name.c_str());
|
||||
|
||||
miss->target = house;
|
||||
// Make it seen on our map
|
||||
for (int x = house.x - 6; x <= house.x + 6; x++) {
|
||||
for (int y = house.y - 6; y <= house.y + 6; y++)
|
||||
g->cur_om.seen(x, y) = true;
|
||||
g->cur_om.seen(x, y, 0) = true;
|
||||
}
|
||||
|
||||
tinymap doghouse(&(g->itypes), &(g->mapitems), &(g->traps));
|
||||
doghouse.load(g, house.x * 2, house.y * 2, false);
|
||||
doghouse.load(g, house.x * 2, house.y * 2, 0, false);
|
||||
doghouse.add_spawn(mon_dog, 1, SEEX, SEEY, true, -1, miss->uid);
|
||||
doghouse.save(&(g->cur_om), int(g->turn), house.x * 2, house.y * 2);
|
||||
doghouse.save(&(g->cur_om), int(g->turn), house.x * 2, house.y * 2, 0);
|
||||
}
|
||||
|
||||
void mission_start::place_zombie_mom(game *g, mission *miss)
|
||||
@@ -62,13 +62,13 @@ void mission_start::place_zombie_mom(game *g, mission *miss)
|
||||
// Make it seen on our map
|
||||
for (int x = house.x - 6; x <= house.x + 6; x++) {
|
||||
for (int y = house.y - 6; y <= house.y + 6; y++)
|
||||
g->cur_om.seen(x, y) = true;
|
||||
g->cur_om.seen(x, y, 0) = true;
|
||||
}
|
||||
|
||||
tinymap zomhouse(&(g->itypes), &(g->mapitems), &(g->traps));
|
||||
zomhouse.load(g, house.x * 2, house.y * 2, false);
|
||||
zomhouse.load(g, house.x * 2, house.y * 2, 0, false);
|
||||
zomhouse.add_spawn(mon_zombie, 1, SEEX, SEEY, false, -1, miss->uid, Name::get(nameIsFemaleName | nameIsGivenName));
|
||||
zomhouse.save(&(g->cur_om), int(g->turn), house.x * 2, house.y * 2);
|
||||
zomhouse.save(&(g->cur_om), int(g->turn), house.x * 2, house.y * 2, 0);
|
||||
}
|
||||
|
||||
void mission_start::place_npc_software(game *g, mission *miss)
|
||||
@@ -78,25 +78,25 @@ void mission_start::place_npc_software(game *g, mission *miss)
|
||||
debugmsg("Couldn't find NPC! %d", miss->npc_id);
|
||||
return;
|
||||
}
|
||||
g->u.i_add( item(g->itypes[itm_usb_drive], 0) );
|
||||
g->u.i_add( item(g->itypes["usb_drive"], 0) );
|
||||
g->add_msg("%s gave you a USB drive.", dev->name.c_str());
|
||||
|
||||
oter_id ter = ot_house_north;
|
||||
|
||||
switch (dev->myclass) {
|
||||
case NC_HACKER:
|
||||
miss->item_id = itm_software_hacking;
|
||||
miss->item_id = "software_hacking";
|
||||
break;
|
||||
case NC_DOCTOR:
|
||||
miss->item_id = itm_software_medical;
|
||||
miss->item_id = "software_medical";
|
||||
ter = ot_s_pharm_north;
|
||||
miss->follow_up = MISSION_GET_ZOMBIE_BLOOD_ANAL;
|
||||
break;
|
||||
case NC_SCIENTIST:
|
||||
miss->item_id = itm_software_math;
|
||||
miss->item_id = "software_math";
|
||||
break;
|
||||
default:
|
||||
miss->item_id = itm_software_useless;
|
||||
miss->item_id = "software_useless";
|
||||
}
|
||||
|
||||
int dist = 0;
|
||||
@@ -110,13 +110,13 @@ void mission_start::place_npc_software(game *g, mission *miss)
|
||||
// Make it seen on our map
|
||||
for (int x = place.x - 6; x <= place.x + 6; x++) {
|
||||
for (int y = place.y - 6; y <= place.y + 6; y++)
|
||||
g->cur_om.seen(x, y) = true;
|
||||
g->cur_om.seen(x, y, 0) = true;
|
||||
}
|
||||
tinymap compmap(&(g->itypes), &(g->mapitems), &(g->traps));
|
||||
compmap.load(g, place.x * 2, place.y * 2, false);
|
||||
compmap.load(g, place.x * 2, place.y * 2, 0, false);
|
||||
point comppoint;
|
||||
|
||||
switch (g->cur_om.ter(place.x, place.y)) {
|
||||
switch (g->cur_om.ter(place.x, place.y, 0)) {
|
||||
case ot_house_north:
|
||||
case ot_house_east:
|
||||
case ot_house_west:
|
||||
@@ -190,20 +190,20 @@ void mission_start::place_npc_software(game *g, mission *miss)
|
||||
|
||||
std::stringstream compname;
|
||||
compname << dev->name << "'s Terminal";
|
||||
compmap.ter(comppoint.x, comppoint.y) = t_console;
|
||||
compmap.ter_set(comppoint.x, comppoint.y, t_console);
|
||||
computer *tmpcomp = compmap.add_computer(comppoint.x, comppoint.y,
|
||||
compname.str(), 0);
|
||||
tmpcomp->mission_id = miss->uid;
|
||||
tmpcomp->add_option("Download Software", COMPACT_DOWNLOAD_SOFTWARE, 0);
|
||||
|
||||
compmap.save(&(g->cur_om), int(g->turn), place.x * 2, place.y * 2);
|
||||
compmap.save(&(g->cur_om), int(g->turn), place.x * 2, place.y * 2, 0);
|
||||
}
|
||||
|
||||
void mission_start::reveal_hospital(game *g, mission *miss)
|
||||
{
|
||||
npc* dev = g->find_npc(miss->npc_id);
|
||||
if (dev != NULL) {
|
||||
g->u.i_add( item(g->itypes[itm_vacutainer], 0) );
|
||||
g->u.i_add( item(g->itypes["vacutainer"], 0) );
|
||||
g->add_msg("%s gave you a vacutainer.", dev->name.c_str());
|
||||
}
|
||||
int dist = 0;
|
||||
@@ -211,7 +211,7 @@ void mission_start::reveal_hospital(game *g, mission *miss)
|
||||
false);
|
||||
for (int x = place.x - 3; x <= place.x + 3; x++) {
|
||||
for (int y = place.y - 3; y <= place.y + 3; y++)
|
||||
g->cur_om.seen(x, y) = true;
|
||||
g->cur_om.seen(x, y, 0) = true;
|
||||
}
|
||||
miss->target = place;
|
||||
}
|
||||
@@ -231,7 +231,7 @@ void mission_start::find_safety(game *g, mission *miss)
|
||||
case 2: check.y += dist; check.x -= radius; break;
|
||||
case 3: check.y += dist; check.x += radius; break;
|
||||
}
|
||||
if (g->cur_om.is_safe(check.x, check.y)) {
|
||||
if (g->cur_om.is_safe(check.x, check.y, g->levz)) {
|
||||
miss->target = check;
|
||||
done = true;
|
||||
}
|
||||
|
||||
+2
-2
@@ -29,7 +29,7 @@ mission_type(id, name, goal, diff, val, urgent, place, start, end, fail) )
|
||||
&mission_place::always, &mission_start::infect_npc,
|
||||
&mission_end::heal_infection, &mission_fail::kill_npc);
|
||||
ORIGINS(ORIGIN_OPENER_NPC);
|
||||
ITEM(itm_antibiotics);
|
||||
ITEM("antibiotics");
|
||||
DEADLINE(24, 48); // 1 - 2 days
|
||||
|
||||
MISSION("Retrieve Software", MGOAL_FIND_ANY_ITEM, 2, 800, false,
|
||||
@@ -41,7 +41,7 @@ mission_type(id, name, goal, diff, val, urgent, place, start, end, fail) )
|
||||
&mission_place::always, &mission_start::reveal_hospital,
|
||||
&mission_end::standard, &mission_fail::standard);
|
||||
ORIGINS(ORIGIN_SECONDARY);
|
||||
ITEM(itm_software_blood_data);
|
||||
ITEM("software_blood_data");
|
||||
|
||||
MISSION("Find Lost Dog", MGOAL_FIND_MONSTER, 3, 1000, false,
|
||||
&mission_place::near_town, &mission_start::place_dog,
|
||||
|
||||
+59
-19
@@ -15,7 +15,7 @@ void mattack::antqueen(game *g, monster *z)
|
||||
for (int y = z->posy - 2; y <= z->posy + 2; y++) {
|
||||
for (int i = 0; i < g->m.i_at(x, y).size(); i++) {
|
||||
// is_empty() because we can't hatch an ant under the player, a monster, etc.
|
||||
if (g->m.i_at(x, y)[i].type->id == itm_ant_egg && g->is_empty(x, y)) {
|
||||
if (g->m.i_at(x, y)[i].type->id == "ant_egg" && g->is_empty(x, y)) {
|
||||
egg_points.push_back(point(x, y));
|
||||
i = g->m.i_at(x, y).size(); // Done looking at this tile
|
||||
}
|
||||
@@ -43,7 +43,7 @@ void mattack::antqueen(game *g, monster *z)
|
||||
int junk;
|
||||
if (g->u_see(z->posx, z->posy, junk))
|
||||
g->add_msg("The %s lays an egg!", z->name().c_str());
|
||||
g->m.add_item(z->posx, z->posy, g->itypes[itm_ant_egg], g->turn);
|
||||
g->m.spawn_item(z->posx, z->posy, g->itypes["ant_egg"], g->turn);
|
||||
} else { // There are eggs nearby. Let's hatch some.
|
||||
z->moves -= 20 * egg_points.size(); // It takes a while
|
||||
int junk;
|
||||
@@ -52,7 +52,7 @@ void mattack::antqueen(game *g, monster *z)
|
||||
for (int i = 0; i < egg_points.size(); i++) {
|
||||
int x = egg_points[i].x, y = egg_points[i].y;
|
||||
for (int j = 0; j < g->m.i_at(x, y).size(); j++) {
|
||||
if (g->m.i_at(x, y)[j].type->id == itm_ant_egg) {
|
||||
if (g->m.i_at(x, y)[j].type->id == "ant_egg") {
|
||||
g->m.i_rem(x, y, j);
|
||||
j = g->m.i_at(x, y).size(); // Max one hatch per tile.
|
||||
monster tmp(g->mtypes[mon_ant_larva], x, y);
|
||||
@@ -135,6 +135,24 @@ void mattack::shockstorm(game *g, monster *z)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
void mattack::smokecloud(game *g, monster *z)
|
||||
{
|
||||
z->sp_timeout = z->type->sp_freq; // Reset timer
|
||||
for (int i = -3; i <= 3; i++) {
|
||||
for (int j = -3; j <=3; j++) {
|
||||
g->m.add_field(g, z->posx + i, z->posy + j, fd_smoke, 2);
|
||||
}
|
||||
}
|
||||
//Round it out a bit
|
||||
for (int i = -2; i <= 2; i++){
|
||||
g->m.add_field(g, z->posx + i, z->posy + 4, fd_smoke, 2);
|
||||
g->m.add_field(g, z->posx + i, z->posy - 4, fd_smoke, 2);
|
||||
g->m.add_field(g, z->posx + 4, z->posy + i, fd_smoke, 2);
|
||||
g->m.add_field(g, z->posx - 4, z->posy + i, fd_smoke, 2);
|
||||
}
|
||||
}
|
||||
|
||||
void mattack::boomer(game *g, monster *z)
|
||||
{
|
||||
int j;
|
||||
@@ -182,7 +200,7 @@ void mattack::resurrect(game *g, monster *z)
|
||||
for (int y = z->posy - 4; y <= z->posy + 4; y++) {
|
||||
if (g->is_empty(x, y) && g->m.sees(z->posx, z->posy, x, y, -1, junk)) {
|
||||
for (int i = 0; i < g->m.i_at(x, y).size(); i++) {
|
||||
if (g->m.i_at(x, y)[i].type->id == itm_corpse &&
|
||||
if (g->m.i_at(x, y)[i].type->id == "corpse" &&
|
||||
g->m.i_at(x, y)[i].corpse->species == species_zombie) {
|
||||
corpses.push_back(point(x, y));
|
||||
i = g->m.i_at(x, y).size();
|
||||
@@ -203,7 +221,7 @@ void mattack::resurrect(game *g, monster *z)
|
||||
for (int i = 0; i < corpses.size(); i++) {
|
||||
int x = corpses[i].x, y = corpses[i].y;
|
||||
for (int n = 0; n < g->m.i_at(x, y).size(); n++) {
|
||||
if (g->m.i_at(x, y)[n].type->id == itm_corpse && one_in(2)) {
|
||||
if (g->m.i_at(x, y)[n].type->id == "corpse" && one_in(2)) {
|
||||
if (g->u_see(x, y, junk))
|
||||
raised++;
|
||||
int burnt_penalty = g->m.i_at(x, y)[n].burnt;
|
||||
@@ -318,9 +336,9 @@ void mattack::growplants(game *g, monster *z)
|
||||
if (i == 0 && j == 0)
|
||||
j++;
|
||||
if (!g->m.has_flag(diggable, z->posx + i, z->posy + j) && one_in(4))
|
||||
g->m.ter(z->posx + i, z->posy + j) = t_dirt;
|
||||
g->m.ter_set(z->posx + i, z->posy + j, t_dirt);
|
||||
else if (one_in(3) && g->m.is_destructable(z->posx + i, z->posy + j))
|
||||
g->m.ter(z->posx + i, z->posy + j) = t_dirtmound; // Destroy walls, &c
|
||||
g->m.ter_set(z->posx + i, z->posy + j, t_dirtmound); // Destroy walls, &c
|
||||
else {
|
||||
if (one_in(4)) { // 1 in 4 chance to grow a tree
|
||||
int mondex = g->mon_at(z->posx + i, z->posy + j);
|
||||
@@ -361,9 +379,9 @@ void mattack::growplants(game *g, monster *z)
|
||||
g->active_npc[npcdex].hit(g, hit, side, 0, rng(10, 30));
|
||||
}
|
||||
}
|
||||
g->m.ter(z->posx + i, z->posy + j) = t_tree_young;
|
||||
g->m.ter_set(z->posx + i, z->posy + j, t_tree_young);
|
||||
} else if (one_in(3)) // If no tree, perhaps underbrush
|
||||
g->m.ter(z->posx + i, z->posy + j) = t_underbrush;
|
||||
g->m.ter_set(z->posx + i, z->posy + j, t_underbrush);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -373,7 +391,7 @@ void mattack::growplants(game *g, monster *z)
|
||||
for (int j = -5; j <= 5; j++) {
|
||||
if (i != 0 || j != 0) {
|
||||
if (g->m.ter(z->posx + i, z->posy + j) == t_tree_young)
|
||||
g->m.ter(z->posx + i, z->posy + j) = t_tree; // Young tree => tree
|
||||
g->m.ter_set(z->posx + i, z->posy + j, t_tree); // Young tree => tree
|
||||
else if (g->m.ter(z->posx + i, z->posy + j) == t_underbrush) {
|
||||
// Underbrush => young tree
|
||||
int mondex = g->mon_at(z->posx + i, z->posy + j);
|
||||
@@ -551,9 +569,9 @@ void mattack::triffid_heartbeat(game *g, monster *z)
|
||||
for (int x = g->u.posx; x <= z->posx - 3; x++) {
|
||||
for (int y = g->u.posy; y <= z->posy - 3; y++) {
|
||||
if (g->is_empty(x, y) && one_in(4))
|
||||
g->m.ter(x, y) = t_root_wall;
|
||||
g->m.ter_set(x, y, t_root_wall);
|
||||
else if (g->m.ter(x, y) == t_root_wall && one_in(10))
|
||||
g->m.ter(x, y) = t_dirt;
|
||||
g->m.ter_set(x, y, t_dirt);
|
||||
}
|
||||
}
|
||||
// Open blank tiles as long as there's no possible route
|
||||
@@ -562,7 +580,7 @@ void mattack::triffid_heartbeat(game *g, monster *z)
|
||||
tries < 20) {
|
||||
int x = rng(g->u.posx, z->posx - 3), y = rng(g->u.posy, z->posy - 3);
|
||||
tries++;
|
||||
g->m.ter(x, y) = t_dirt;
|
||||
g->m.ter_set(x, y, t_dirt);
|
||||
if (rl_dist(x, y, g->u.posx, g->u.posy > 3 && g->z.size() < 30 &&
|
||||
g->mon_at(x, y) == -1 && one_in(20))) { // Spawn an extra monster
|
||||
mon_id montype = mon_triffid;
|
||||
@@ -717,7 +735,7 @@ void mattack::dermatik(game *g, monster *z)
|
||||
|
||||
// Can we swat the bug away?
|
||||
int dodge_roll = z->dodge_roll();
|
||||
int swat_skill = (g->u.skillLevel("melee").level() + g->u.skillLevel("unarmed").level() * 2) / 3;
|
||||
int swat_skill = (g->u.skillLevel("melee") + g->u.skillLevel("unarmed") * 2) / 3;
|
||||
int player_swat = dice(swat_skill, 10);
|
||||
if (player_swat > dodge_roll) {
|
||||
g->add_msg("The %s lands on you, but you swat it off.", z->name().c_str());
|
||||
@@ -1070,7 +1088,7 @@ void mattack::stare(game *g, monster *z)
|
||||
g->m.ter(sight[i].x, sight[i].y) == t_reinforced_glass_v)
|
||||
i = sight.size();
|
||||
else if (g->m.is_destructable(sight[i].x, sight[i].y))
|
||||
g->m.ter(sight[i].x, sight[i].y) = t_rubble;
|
||||
g->m.ter_set(sight[i].x, sight[i].y, t_rubble);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -1154,8 +1172,8 @@ void mattack::smg(game *g, monster *z)
|
||||
tmp.str_cur = 16;
|
||||
tmp.dex_cur = 6;
|
||||
tmp.per_cur = 8;
|
||||
tmp.weapon = item(g->itypes[itm_smg_9mm], 0);
|
||||
tmp.weapon.curammo = dynamic_cast<it_ammo*>(g->itypes[itm_9mm]);
|
||||
tmp.weapon = item(g->itypes["smg_9mm"], 0);
|
||||
tmp.weapon.curammo = dynamic_cast<it_ammo*>(g->itypes["9mm"]);
|
||||
tmp.weapon.charges = 10;
|
||||
std::vector<point> traj = line_to(z->posx, z->posy,
|
||||
target->posx, target->posy, fire_t);
|
||||
@@ -1193,8 +1211,8 @@ void mattack::smg(game *g, monster *z)
|
||||
tmp.str_cur = 16;
|
||||
tmp.dex_cur = 6;
|
||||
tmp.per_cur = 8;
|
||||
tmp.weapon = item(g->itypes[itm_smg_9mm], 0);
|
||||
tmp.weapon.curammo = dynamic_cast<it_ammo*>(g->itypes[itm_9mm]);
|
||||
tmp.weapon = item(g->itypes["smg_9mm"], 0);
|
||||
tmp.weapon.curammo = dynamic_cast<it_ammo*>(g->itypes["9mm"]);
|
||||
tmp.weapon.charges = 10;
|
||||
std::vector<point> traj = line_to(z->posx, z->posy, g->u.posx, g->u.posy, t);
|
||||
g->fire(tmp, g->u.posx, g->u.posy, traj, true);
|
||||
@@ -1363,3 +1381,25 @@ void mattack::breathe(game *g, monster *z)
|
||||
g->z.push_back(spawned);
|
||||
}
|
||||
}
|
||||
|
||||
void mattack::bite(game *g, monster *z)
|
||||
{
|
||||
if (rl_dist(z->posx, z->posy, g->u.posx, g->u.posy) > 1)
|
||||
return;
|
||||
z->sp_timeout = z->type->sp_freq; // Reset timer
|
||||
g->add_msg("The %s lunges forward attempting to bite you!", z->name().c_str());
|
||||
z->moves -= 100;
|
||||
if (rng(0, 20) > g->u.dodge(g) || one_in(g->u.dodge(g))) {
|
||||
g->add_msg("You dodge it!");
|
||||
return;
|
||||
}
|
||||
body_part hit = random_body_part();
|
||||
int dam = rng(5, 10), side = rng(0, 1);
|
||||
g->add_msg("Your %s is bitten for %d damage!", body_part_name(hit, side).c_str(),
|
||||
dam);
|
||||
g->u.hit(g, hit, side, dam, 0);
|
||||
if(one_in(10)){
|
||||
g->u.add_disease(DI_BITE, 3600, g);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -13,6 +13,7 @@ class mattack
|
||||
void shriek (game *g, monster *z);
|
||||
void acid (game *g, monster *z);
|
||||
void shockstorm (game *g, monster *z);
|
||||
void smokecloud (game *g, monster *z);
|
||||
void boomer (game *g, monster *z);
|
||||
void resurrect (game *g, monster *z);
|
||||
void science (game *g, monster *z);
|
||||
@@ -44,6 +45,7 @@ class mattack
|
||||
void generator (game *g, monster *z);
|
||||
void upgrade (game *g, monster *z);
|
||||
void breathe (game *g, monster *z);
|
||||
void bite (game *g, monster *z);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+20
-2
@@ -22,7 +22,7 @@ void mdeath::normal(game *g, monster *z)
|
||||
if ((z->hp >= -50 || z->hp >= 0 - 2 * z->type->hp) &&
|
||||
(z->made_of(FLESH) || z->made_of(VEGGY))) {
|
||||
item tmp;
|
||||
tmp.make_corpse(g->itypes[itm_corpse], z->type, g->turn);
|
||||
tmp.make_corpse(g->itypes["corpse"], z->type, g->turn);
|
||||
g->m.add_item(z->posx, z->posy, tmp);
|
||||
}
|
||||
}
|
||||
@@ -197,7 +197,7 @@ void mdeath::disappear(game *g, monster *z)
|
||||
|
||||
void mdeath::guilt(game *g, monster *z)
|
||||
{
|
||||
if (g->u.has_trait(PF_HEARTLESS))
|
||||
if (g->u.has_trait(PF_CANNIBAL))
|
||||
return; // We don't give a shit!
|
||||
if (rl_dist(z->posx, z->posy, g->u.posx, g->u.posy) > 5)
|
||||
return; // Too far away, we can deal with it
|
||||
@@ -302,6 +302,24 @@ void mdeath::ratking(game *g, monster *z)
|
||||
g->u.rem_disease(DI_RAT);
|
||||
}
|
||||
|
||||
void mdeath::smokeburst(game *g, monster *z)
|
||||
{
|
||||
std::string tmp;
|
||||
g->sound(z->posx, z->posy, 24, "a smoker explodes!");
|
||||
for (int i = -1; i <= 1; i++) {
|
||||
for (int j = -1; j <= 1; j++) {
|
||||
g->m.add_field(g, z->posx + i, z->posy + j, fd_smoke, 3);
|
||||
int mondex = g->mon_at(z->posx + i, z->posy +j);
|
||||
if (mondex != -1) {
|
||||
g->z[mondex].stumble(g, false);
|
||||
g->z[mondex].moves -= 250;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
void mdeath::gameover(game *g, monster *z)
|
||||
{
|
||||
g->add_msg("Your %s is destroyed! GAME OVER!", z->name().c_str());
|
||||
|
||||
@@ -27,6 +27,7 @@ public:
|
||||
void explode (game *g, monster *z); // Damaging explosion
|
||||
void ratking (game *g, monster *z); // Cure verminitis
|
||||
void kill_breathers (game *g, monster *z); // All breathers die
|
||||
void smokeburst (game *g, monster *z); //Explode like a huge smoke bomb.
|
||||
|
||||
void gameover (game *g, monster *z); // Game over! Defense mode
|
||||
};
|
||||
|
||||
+49
-25
@@ -3,49 +3,73 @@
|
||||
|
||||
#include "mtype.h"
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
enum moncat_id {
|
||||
mcat_null = 0,
|
||||
mcat_forest,
|
||||
mcat_ant,
|
||||
mcat_bee,
|
||||
mcat_worm,
|
||||
mcat_zombie,
|
||||
mcat_triffid,
|
||||
mcat_fungi,
|
||||
mcat_goo,
|
||||
mcat_chud,
|
||||
mcat_sewer,
|
||||
mcat_swamp,
|
||||
mcat_lab,
|
||||
mcat_nether,
|
||||
mcat_spiral,
|
||||
mcat_vanilla_zombie, // Defense mode only
|
||||
mcat_spider, // Defense mode only
|
||||
mcat_robot, // Defense mode only
|
||||
num_moncats
|
||||
typedef std::map<mon_id, int> FreqDef;
|
||||
typedef FreqDef::iterator FreqDef_iter;
|
||||
|
||||
struct MonsterGroup
|
||||
{
|
||||
std::string name;
|
||||
mon_id defaultMonster;
|
||||
FreqDef monsters;
|
||||
};
|
||||
|
||||
bool moncat_is_safe(moncat_id id);
|
||||
/*enum MonsterGroupType
|
||||
{
|
||||
GROUP_NULL = 0,
|
||||
GROUP_FOREST,
|
||||
GROUP_ANT,
|
||||
GROUP_BEE,
|
||||
GROUP_WORM,
|
||||
GROUP_ZOMBIE,
|
||||
GROUP_TRIFFID,
|
||||
GROUP_FUNGI,
|
||||
GROUP_GOO,
|
||||
GROUP_CHUD,
|
||||
GROUP_SEWER,
|
||||
GROUP_SWAMP,
|
||||
GROUP_LAB,
|
||||
GROUP_NETHER,
|
||||
GROUP_SPIRAL,
|
||||
GROUP_VANILLA,
|
||||
GROUP_SPIDER,
|
||||
GROUP_ROBOT,
|
||||
GROUP_COUNT
|
||||
};*/
|
||||
|
||||
struct mongroup {
|
||||
moncat_id type;
|
||||
int posx, posy;
|
||||
std::string type;
|
||||
int posx, posy, posz;
|
||||
unsigned char radius;
|
||||
unsigned int population;
|
||||
bool dying;
|
||||
bool diffuse; // group size ind. of dist. from center and radius invariant
|
||||
mongroup(moncat_id ptype, int pposx, int pposy, unsigned char prad,
|
||||
mongroup(std::string ptype, int pposx, int pposy, int pposz, unsigned char prad,
|
||||
unsigned int ppop) {
|
||||
type = ptype;
|
||||
posx = pposx;
|
||||
posy = pposy;
|
||||
posz = pposz;
|
||||
radius = prad;
|
||||
population = ppop;
|
||||
dying = false;
|
||||
diffuse = false;
|
||||
}
|
||||
bool is_safe() { return moncat_is_safe(type); };
|
||||
bool is_safe() { return (type == "GROUP_NULL" || type == "GROUP_FOREST"); };
|
||||
};
|
||||
|
||||
class MonsterGroupManager
|
||||
{
|
||||
public:
|
||||
static void LoadJSONGroups();
|
||||
static mon_id GetMonsterFromGroup(std::string, std::vector <mtype*> *, int turn = -1);
|
||||
static bool IsMonsterInGroup(std::string, mon_id);
|
||||
static std::string Monster2Group(mon_id);
|
||||
static std::vector<mon_id> GetMonstersFromGroup(std::string);
|
||||
static MonsterGroup GetMonsterGroup(std::string group);
|
||||
|
||||
private:
|
||||
static std::map<std::string, MonsterGroup> monsterGroupMap;
|
||||
};
|
||||
#endif
|
||||
|
||||
+222
-67
@@ -1,75 +1,230 @@
|
||||
#include "game.h"
|
||||
#include <fstream>
|
||||
#include <vector>
|
||||
#include "setvector.h"
|
||||
#include "picojson.h"
|
||||
#include "options.h"
|
||||
|
||||
void game::init_moncats()
|
||||
//Adding a group:
|
||||
// 1: Declare it in the MonsterGroupDefs enum in mongroup.h
|
||||
// 2: Define it in here with the macro Group(your group, default monster)
|
||||
// and AddMonster(your group, some monster, a frequency on 1000)
|
||||
//
|
||||
// Frequency: If you don't use the whole 1000 points of frequency for each of
|
||||
// the monsters, the remaining points will go to the defaultMonster.
|
||||
// Ie. a group with 1 monster at frequency will have 50% chance to spawn
|
||||
// the default monster.
|
||||
// In the same spirit, if you have a total point count of over 1000, the
|
||||
// default monster will never get picked, and nor will the others past the
|
||||
// monster that makes the point count go over 1000
|
||||
|
||||
std::map<std::string, MonsterGroup> MonsterGroupManager::monsterGroupMap;
|
||||
|
||||
void game::init_mongroups() { MonsterGroupManager::LoadJSONGroups(); }
|
||||
|
||||
mon_id MonsterGroupManager::GetMonsterFromGroup(std::string group, std::vector <mtype*> *mtypes, int turn)
|
||||
{
|
||||
setvector(
|
||||
moncats[mcat_forest],
|
||||
mon_squirrel, mon_rabbit, mon_deer, mon_wolf, mon_bear, mon_cougar, mon_spider_wolf,
|
||||
mon_spider_jumping, mon_dog, mon_shia, NULL);
|
||||
setvector(
|
||||
moncats[mcat_ant],
|
||||
mon_ant_larva, mon_ant, mon_ant_soldier, mon_ant_queen, NULL);
|
||||
setvector(
|
||||
moncats[mcat_bee],
|
||||
mon_bee, NULL);
|
||||
setvector(
|
||||
moncats[mcat_worm],
|
||||
mon_graboid, mon_worm, mon_halfworm, NULL);
|
||||
setvector(
|
||||
moncats[mcat_zombie],
|
||||
mon_zombie, mon_zombie_cop, mon_zombie_shrieker, mon_zombie_spitter, mon_zombie_fast,
|
||||
mon_zombie_electric, mon_zombie_brute, mon_zombie_hulk,
|
||||
mon_zombie_necro, mon_boomer, mon_skeleton, mon_zombie_grabber,
|
||||
mon_zombie_master, NULL);
|
||||
setvector(
|
||||
moncats[mcat_triffid],
|
||||
mon_triffid, mon_triffid_young, mon_vinebeast, mon_triffid_queen, NULL);
|
||||
setvector(
|
||||
moncats[mcat_fungi],
|
||||
mon_fungaloid, mon_fungaloid_dormant, mon_ant_fungus, mon_zombie_fungus,
|
||||
mon_boomer_fungus, mon_spore, mon_fungaloid_queen, mon_fungal_wall,
|
||||
NULL);
|
||||
setvector(
|
||||
moncats[mcat_goo],
|
||||
mon_blob, NULL);
|
||||
setvector(
|
||||
moncats[mcat_chud],
|
||||
mon_chud, mon_one_eye, mon_crawler, NULL);
|
||||
setvector(
|
||||
moncats[mcat_sewer],
|
||||
mon_sewer_fish, mon_sewer_snake, mon_sewer_rat, NULL);
|
||||
setvector(
|
||||
moncats[mcat_swamp],
|
||||
mon_mosquito, mon_dragonfly, mon_centipede, mon_frog, mon_slug,
|
||||
mon_dermatik_larva, mon_dermatik, NULL);
|
||||
setvector(
|
||||
moncats[mcat_lab],
|
||||
mon_zombie_scientist, mon_blob_small, mon_manhack, mon_skitterbot,
|
||||
NULL);
|
||||
setvector(
|
||||
moncats[mcat_nether],
|
||||
mon_flying_polyp, mon_hunting_horror, mon_mi_go, mon_yugg, mon_gelatin,
|
||||
mon_flaming_eye, mon_kreck, mon_blank, mon_gozu, NULL);
|
||||
setvector(
|
||||
moncats[mcat_spiral],
|
||||
mon_human_snail, mon_twisted_body, mon_vortex, NULL);
|
||||
setvector(
|
||||
moncats[mcat_vanilla_zombie],
|
||||
mon_zombie, NULL);
|
||||
setvector(
|
||||
moncats[mcat_spider],
|
||||
mon_spider_wolf, mon_spider_web, mon_spider_jumping, mon_spider_widow,
|
||||
NULL);
|
||||
setvector(
|
||||
moncats[mcat_robot],
|
||||
mon_manhack, mon_skitterbot, mon_secubot, mon_copbot, mon_molebot,
|
||||
mon_tripod, mon_chickenbot, mon_tankbot, NULL);
|
||||
int roll = rng(1, 1000);
|
||||
MonsterGroup g = monsterGroupMap[group];
|
||||
for (FreqDef_iter it = g.monsters.begin(); it != g.monsters.end(); ++it)
|
||||
{
|
||||
if((turn == -1 || (turn + 900 >= MINUTES(STARTING_MINUTES) + HOURS((*mtypes)[it->first]->difficulty))) &&
|
||||
(!OPTIONS[OPT_CLASSIC_ZOMBIES] ||
|
||||
(*mtypes)[it->first]->in_category(MC_CLASSIC) ||
|
||||
(*mtypes)[it->first]->in_category(MC_WILDLIFE)))
|
||||
{ //Not too hard for us (or we dont care)
|
||||
if(it->second >= roll) return it->first;
|
||||
else roll -= it->second;
|
||||
}
|
||||
}
|
||||
if ((turn + 900 < MINUTES(STARTING_MINUTES) + HOURS((*mtypes)[g.defaultMonster]->difficulty))
|
||||
&& (!OPTIONS[OPT_STATIC_SPAWN]))
|
||||
return mon_null;
|
||||
else
|
||||
return g.defaultMonster;
|
||||
}
|
||||
|
||||
bool moncat_is_safe(moncat_id id)
|
||||
bool MonsterGroupManager::IsMonsterInGroup(std::string group, mon_id monster)
|
||||
{
|
||||
if (id == mcat_null || id == mcat_forest)
|
||||
return true;
|
||||
return false;
|
||||
MonsterGroup g = monsterGroupMap[group];
|
||||
for (FreqDef_iter it = g.monsters.begin(); it != g.monsters.end(); ++it)
|
||||
{
|
||||
if(it->first == monster) return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string MonsterGroupManager::Monster2Group(mon_id monster)
|
||||
{
|
||||
for (std::map<std::string, MonsterGroup>::const_iterator it = monsterGroupMap.begin(); it != monsterGroupMap.end(); ++it)
|
||||
{
|
||||
if(IsMonsterInGroup(it->first, monster ))
|
||||
{
|
||||
return it->first;
|
||||
}
|
||||
}
|
||||
return "GROUP_NULL";
|
||||
}
|
||||
|
||||
std::vector<mon_id> MonsterGroupManager::GetMonstersFromGroup(std::string group)
|
||||
{
|
||||
MonsterGroup g = GetMonsterGroup(group);
|
||||
|
||||
std::vector<mon_id> monsters;
|
||||
|
||||
monsters.push_back(g.defaultMonster);
|
||||
|
||||
for (FreqDef_iter it = g.monsters.begin(); it != g.monsters.end(); ++it)
|
||||
{
|
||||
monsters.push_back(it->first);
|
||||
}
|
||||
return monsters;
|
||||
}
|
||||
|
||||
MonsterGroup MonsterGroupManager::GetMonsterGroup(std::string group)
|
||||
{
|
||||
std::map<std::string, MonsterGroup>::iterator it = monsterGroupMap.find(group);
|
||||
if(it == monsterGroupMap.end())
|
||||
{
|
||||
debugmsg("Unable to get the group '%s'", group.c_str());
|
||||
return MonsterGroup();
|
||||
}
|
||||
else
|
||||
{
|
||||
return it->second;
|
||||
}
|
||||
}
|
||||
|
||||
//json loading
|
||||
const char *monGroupFilePath = "data/raw/monstergroups.json";
|
||||
std::map<std::string, mon_id> monStr2monId;
|
||||
void init_translation();
|
||||
std::string GetString(std::string, picojson::object *);
|
||||
int GetInt(std::string, picojson::object *);
|
||||
|
||||
MonsterGroup GetMGroupFromJSON(picojson::object *jsonobj)
|
||||
{
|
||||
MonsterGroup g;
|
||||
picojson::object jsonmonster;
|
||||
picojson::value jsonval;
|
||||
std::vector<picojson::value> jsonarray;
|
||||
g.name = GetString("name", jsonobj);
|
||||
g.defaultMonster = monStr2monId[GetString("default", jsonobj)];
|
||||
|
||||
if(jsonobj->find("monsters")->second.is<picojson::array>())
|
||||
jsonarray = jsonobj->find("monsters")->second.get<picojson::array>();
|
||||
else
|
||||
{
|
||||
printf("Fatal error, cannot get monster group array in %s", monGroupFilePath);
|
||||
exit(1);
|
||||
}
|
||||
|
||||
for (picojson::array::const_iterator it_mons = jsonarray.begin(); it_mons != jsonarray.end(); ++it_mons)
|
||||
{
|
||||
jsonmonster = it_mons->get<picojson::object>();
|
||||
g.monsters[monStr2monId[GetString("monster",&jsonmonster)]] = GetInt("freq",&jsonmonster);
|
||||
}
|
||||
|
||||
return g;
|
||||
}
|
||||
|
||||
void MonsterGroupManager::LoadJSONGroups()
|
||||
{
|
||||
//open the file
|
||||
std::ifstream file;
|
||||
file.open(monGroupFilePath);
|
||||
if(!file.good())
|
||||
{
|
||||
printf("Unable to load file %s\n",monGroupFilePath); return;
|
||||
}
|
||||
|
||||
//load the data
|
||||
picojson::value groupsRaw;
|
||||
file >> groupsRaw;
|
||||
|
||||
std::string error = picojson::get_last_error();
|
||||
if(! error.empty())
|
||||
{
|
||||
printf("'%s' : %s", monGroupFilePath, error.c_str());
|
||||
return;
|
||||
}
|
||||
|
||||
//check the data
|
||||
if (! groupsRaw.is<picojson::array>()) {
|
||||
printf("The monster group file '%s' does not contain the expected JSON data", monGroupFilePath);
|
||||
return;
|
||||
}
|
||||
|
||||
init_translation();
|
||||
picojson::object jsonobj;
|
||||
MonsterGroup g;
|
||||
|
||||
const picojson::array& groups = groupsRaw.get<picojson::array>();
|
||||
for (picojson::array::const_iterator it_groups = groups.begin(); it_groups != groups.end(); ++it_groups)
|
||||
{
|
||||
jsonobj = it_groups->get<picojson::object>();
|
||||
g = GetMGroupFromJSON(&jsonobj);
|
||||
monsterGroupMap[g.name] = g;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
std::string GetString(std::string key, picojson::object *obj)
|
||||
{
|
||||
if(obj->find(key)->second.is<std::string>())
|
||||
return obj->find(key)->second.get<std::string>();
|
||||
else
|
||||
{
|
||||
printf("Cannot get string '%s' in '%s'",key.c_str(), monGroupFilePath);
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
int GetInt(std::string key, picojson::object *obj)
|
||||
{
|
||||
if(obj->find(key)->second.is<double>())
|
||||
return obj->find(key)->second.get<double>();
|
||||
else
|
||||
{
|
||||
printf("Cannot get number '%s' in '%s'",key.c_str(), monGroupFilePath);
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
void init_translation()
|
||||
{
|
||||
monStr2monId["mon_null"] = mon_null;
|
||||
monStr2monId["mon_squirrel"] = mon_squirrel; monStr2monId["mon_rabbit"] = mon_rabbit; monStr2monId["mon_deer"] = mon_deer; monStr2monId["mon_wolf"] = mon_wolf; monStr2monId["mon_bear"] = mon_bear; monStr2monId["mon_cougar"] = mon_cougar; monStr2monId["mon_crow"] = mon_crow;
|
||||
monStr2monId["mon_dog"] = mon_dog; monStr2monId["mon_cat"] = mon_cat;
|
||||
monStr2monId["mon_ant_larva"] = mon_ant_larva; monStr2monId["mon_ant"] = mon_ant; monStr2monId["mon_ant_soldier"] = mon_ant_soldier; monStr2monId["mon_ant_queen"] = mon_ant_queen; monStr2monId["mon_ant_fungus"] = mon_ant_fungus;
|
||||
monStr2monId["mon_fly"] = mon_fly; monStr2monId["mon_bee"] = mon_bee; monStr2monId["mon_wasp"] = mon_wasp;
|
||||
monStr2monId["mon_graboid"] = mon_graboid; monStr2monId["mon_worm"] = mon_worm; monStr2monId["mon_halfworm"] = mon_halfworm;
|
||||
monStr2monId["mon_zombie"] = mon_zombie; monStr2monId["mon_zombie_cop"] = mon_zombie_cop; monStr2monId["mon_zombie_shrieker"] = mon_zombie_shrieker; monStr2monId["mon_zombie_spitter"] = mon_zombie_spitter; monStr2monId["mon_zombie_electric"] = mon_zombie_electric;
|
||||
monStr2monId["mon_zombie_smoker"] = mon_zombie_smoker;
|
||||
monStr2monId["mon_zombie_fast"] = mon_zombie_fast; monStr2monId["mon_zombie_brute"] = mon_zombie_brute; monStr2monId["mon_zombie_hulk"] = mon_zombie_hulk; monStr2monId["mon_zombie_fungus"] = mon_zombie_fungus;
|
||||
monStr2monId["mon_boomer"] = mon_boomer; monStr2monId["mon_boomer_fungus"] = mon_boomer_fungus; monStr2monId["mon_skeleton"] = mon_skeleton; monStr2monId["mon_zombie_necro"] = mon_zombie_necro;
|
||||
monStr2monId["mon_zombie_scientist"] = mon_zombie_scientist; monStr2monId["mon_zombie_soldier"] = mon_zombie_soldier; monStr2monId["mon_zombie_grabber"] = mon_zombie_grabber;
|
||||
monStr2monId["mon_zombie_master"] = mon_zombie_master; monStr2monId["mon_beekeeper"] = mon_beekeeper; monStr2monId["mon_zombie_child"] = mon_zombie_child;
|
||||
monStr2monId["mon_triffid"] = mon_triffid; monStr2monId["mon_triffid_young"] = mon_triffid_young; monStr2monId["mon_triffid_queen"] = mon_triffid_queen; monStr2monId["mon_creeper_hub"] = mon_creeper_hub;
|
||||
monStr2monId["mon_creeper_vine"] = mon_creeper_vine; monStr2monId["mon_biollante"] = mon_biollante; monStr2monId["mon_vinebeast"] = mon_vinebeast; monStr2monId["mon_triffid_heart"] = mon_triffid_heart;
|
||||
monStr2monId["mon_fungaloid"] = mon_fungaloid; monStr2monId["mon_fungaloid_dormant"] = mon_fungaloid_dormant; monStr2monId["mon_fungaloid_young"] = mon_fungaloid_young; monStr2monId["mon_spore"] = mon_spore;
|
||||
monStr2monId["mon_fungaloid_queen"] = mon_fungaloid_queen; monStr2monId["mon_fungal_wall"] = mon_fungal_wall;
|
||||
monStr2monId["mon_blob"] = mon_blob; monStr2monId["mon_blob_small"] = mon_blob_small;
|
||||
monStr2monId["mon_chud"] = mon_chud; monStr2monId["mon_one_eye"] = mon_one_eye; monStr2monId["mon_crawler"] = mon_crawler;
|
||||
monStr2monId["mon_sewer_fish"] = mon_sewer_fish; monStr2monId["mon_sewer_snake"] = mon_sewer_snake; monStr2monId["mon_sewer_rat"] = mon_sewer_rat; monStr2monId["mon_rat_king"] = mon_rat_king;
|
||||
monStr2monId["mon_mosquito"] = mon_mosquito; monStr2monId["mon_dragonfly"] = mon_dragonfly; monStr2monId["mon_centipede"] = mon_centipede; monStr2monId["mon_frog"] = mon_frog; monStr2monId["mon_slug"] = mon_slug;
|
||||
monStr2monId["mon_dermatik_larva"] = mon_dermatik_larva; monStr2monId["mon_dermatik"] = mon_dermatik;
|
||||
monStr2monId["mon_spider_wolf"] = mon_spider_wolf; monStr2monId["mon_spider_web"] = mon_spider_web; monStr2monId["mon_spider_jumping"] = mon_spider_jumping; monStr2monId["mon_spider_trapdoor"] = mon_spider_trapdoor;
|
||||
monStr2monId["mon_spider_widow"] = mon_spider_widow;
|
||||
monStr2monId["mon_dark_wyrm"] = mon_dark_wyrm; monStr2monId["mon_amigara_horror"] = mon_amigara_horror; monStr2monId["mon_dog_thing"] = mon_dog_thing; monStr2monId["mon_headless_dog_thing"] = mon_headless_dog_thing;
|
||||
monStr2monId["mon_thing"] = mon_thing;
|
||||
monStr2monId["mon_human_snail"] = mon_human_snail; monStr2monId["mon_twisted_body"] = mon_twisted_body; monStr2monId["mon_vortex"] = mon_vortex;
|
||||
monStr2monId["mon_flying_polyp"] = mon_flying_polyp; monStr2monId["mon_hunting_horror"] = mon_hunting_horror; monStr2monId["mon_mi_go"] = mon_mi_go; monStr2monId["mon_yugg"] = mon_yugg; monStr2monId["mon_gelatin"] = mon_gelatin;
|
||||
monStr2monId["mon_flaming_eye"] = mon_flaming_eye; monStr2monId["mon_kreck"] = mon_kreck; monStr2monId["mon_gracke"] = mon_gracke; monStr2monId["mon_blank"] = mon_blank; monStr2monId["mon_gozu"] = mon_gozu; monStr2monId["mon_shadow"] = mon_shadow; monStr2monId["mon_breather_hub"] = mon_breather_hub;
|
||||
monStr2monId["mon_breather"] = mon_breather; monStr2monId["mon_shadow_snake"] = mon_shadow_snake;
|
||||
monStr2monId["mon_eyebot"] = mon_eyebot; monStr2monId["mon_manhack"] = mon_manhack; monStr2monId["mon_skitterbot"] = mon_skitterbot; monStr2monId["mon_secubot"] = mon_secubot; monStr2monId["mon_copbot"] = mon_copbot; monStr2monId["mon_molebot"] = mon_molebot;
|
||||
monStr2monId["mon_tripod"] = mon_tripod; monStr2monId["mon_chickenbot"] = mon_chickenbot; monStr2monId["mon_tankbot"] = mon_tankbot; monStr2monId["mon_turret"] = mon_turret; monStr2monId["mon_exploder"] = mon_exploder;
|
||||
monStr2monId["mon_hallu_zom"] = mon_hallu_zom; monStr2monId["mon_hallu_bee"] = mon_hallu_bee; monStr2monId["mon_hallu_ant"] = mon_hallu_ant; monStr2monId["mon_hallu_mom"] = mon_hallu_mom;
|
||||
monStr2monId["mon_generator"] = mon_generator;
|
||||
}
|
||||
|
||||
|
||||
+32
-12
@@ -13,10 +13,12 @@ void game::init_monitems()
|
||||
mi_softdrugs, 5,mi_harddrugs, 1,mi_tools, 20,mi_trash, 7,
|
||||
mi_ammo, 1,mi_pistols, 1,mi_shotguns, 1,mi_smg, 1,
|
||||
NULL);
|
||||
setvector(monitems[mon_zombie_child],
|
||||
mi_child_items,65, NULL);
|
||||
|
||||
monitems[mon_zombie_shrieker] = monitems[mon_zombie];
|
||||
monitems[mon_zombie_spitter] = monitems[mon_zombie];
|
||||
monitems[mon_zombie_electric] = monitems[mon_zombie];
|
||||
monitems[mon_zombie_fast] = monitems[mon_zombie];
|
||||
monitems[mon_zombie_brute] = monitems[mon_zombie];
|
||||
monitems[mon_zombie_hulk] = monitems[mon_zombie];
|
||||
monitems[mon_zombie_fungus] = monitems[mon_zombie];
|
||||
@@ -25,7 +27,6 @@ void game::init_monitems()
|
||||
monitems[mon_zombie_necro] = monitems[mon_zombie];
|
||||
monitems[mon_zombie_grabber] = monitems[mon_zombie];
|
||||
monitems[mon_zombie_master] = monitems[mon_zombie];
|
||||
monitems[mon_zombie_child] = monitems[mon_zombie];
|
||||
|
||||
setvector(monitems[mon_beekeeper],
|
||||
mi_hive, 80, NULL);
|
||||
@@ -70,14 +71,33 @@ void game::init_monitems()
|
||||
monitems[mon_spider_widow] = monitems[mon_dragonfly];
|
||||
|
||||
setvector(monitems[mon_eyebot],
|
||||
mi_robots, 4, mi_ammo, 1,NULL);
|
||||
monitems[mon_manhack] = monitems[mon_eyebot];
|
||||
monitems[mon_skitterbot] = monitems[mon_eyebot];
|
||||
monitems[mon_secubot] = monitems[mon_eyebot];
|
||||
monitems[mon_copbot] = monitems[mon_eyebot];
|
||||
monitems[mon_molebot] = monitems[mon_eyebot];
|
||||
monitems[mon_tripod] = monitems[mon_eyebot];
|
||||
monitems[mon_chickenbot] = monitems[mon_eyebot];
|
||||
monitems[mon_tankbot] = monitems[mon_eyebot];
|
||||
monitems[mon_turret] = monitems[mon_eyebot];
|
||||
mi_robots,4, mi_eyebot, 1,NULL);
|
||||
|
||||
setvector(monitems[mon_manhack],
|
||||
mi_robots,4, mi_manhack, 1, NULL);
|
||||
|
||||
setvector(monitems[mon_skitterbot],
|
||||
mi_robots,4, mi_skitterbot, 1, NULL);
|
||||
|
||||
setvector(monitems[mon_secubot],
|
||||
mi_robots,4, mi_secubot, 1, NULL);
|
||||
|
||||
setvector(monitems[mon_copbot],
|
||||
mi_robots,4, mi_copbot, 1, NULL);
|
||||
|
||||
setvector(monitems[mon_molebot],
|
||||
mi_robots,4, mi_molebot, 1, NULL);
|
||||
|
||||
setvector(monitems[mon_tripod],
|
||||
mi_robots,4, mi_tripod, 1, NULL);
|
||||
|
||||
setvector(monitems[mon_chickenbot],
|
||||
mi_robots,4, mi_chickenbot, 1, NULL);
|
||||
|
||||
setvector(monitems[mon_tankbot],
|
||||
mi_robots,4, mi_tankbot, 1, NULL);
|
||||
|
||||
setvector(monitems[mon_turret],
|
||||
mi_robots,4, mi_turret, 1, NULL);
|
||||
|
||||
}
|
||||
|
||||
+21
-15
@@ -261,7 +261,7 @@ void monster::move(game *g)
|
||||
hit_player(g, g->u);
|
||||
else if (mondex != -1 && g->z[mondex].type->species == species_hallu)
|
||||
g->kill_mon(mondex);
|
||||
else if (mondex != -1 && type->melee_dice > 0 &&
|
||||
else if (mondex != -1 && type->melee_dice > 0 && this != &(g->z[mondex]) &&
|
||||
(g->z[mondex].friendly != 0 || has_flag(MF_ATTACKMON)))
|
||||
hit_monster(g, mondex);
|
||||
else if (npcdex != -1 && type->melee_dice > 0)
|
||||
@@ -361,8 +361,10 @@ point monster::scent_move(game *g)
|
||||
std::vector<point> smoves;
|
||||
|
||||
int maxsmell = 2; // Squares with smell 0 are not eligable targets
|
||||
if (has_flag(MF_KEENNOSE)) {
|
||||
int maxsmell = 1; }
|
||||
if (has_flag(MF_KEENNOSE))
|
||||
{
|
||||
maxsmell = 1;
|
||||
}
|
||||
int minsmell = 9999;
|
||||
point pbuff, next(-1, -1);
|
||||
unsigned int smell;
|
||||
@@ -494,11 +496,11 @@ void monster::hit_player(game *g, player &p, bool can_grab)
|
||||
g->add_msg("You stop reloading.");
|
||||
else if (g->u.activity.type == ACT_READ)
|
||||
g->add_msg("You stop reading.");
|
||||
else if (g->u.activity.type == ACT_CRAFT)
|
||||
else if (g->u.activity.type == ACT_CRAFT || g->u.activity.type == ACT_LONGCRAFT)
|
||||
g->add_msg("You stop crafting.");
|
||||
g->u.activity.type = ACT_NULL;
|
||||
}
|
||||
if (p.has_active_bionic(bio_ods)) {
|
||||
if (p.has_active_bionic("bio_ods")) {
|
||||
if (u_see)
|
||||
g->add_msg("%s offensive defense system shocks it!", Your.c_str());
|
||||
hurt(rng(10, 40));
|
||||
@@ -527,14 +529,14 @@ void monster::hit_player(game *g, player &p, bool can_grab)
|
||||
if (has_flag(MF_BLEED) && dam > 6 && cut > 0) {
|
||||
if (!is_npc)
|
||||
g->add_msg("You're Bleeding!");
|
||||
p.add_disease(DI_BLEED, 30, g);
|
||||
p.add_disease(DI_BLEED, 60, g);
|
||||
}
|
||||
if (can_grab && has_flag(MF_GRABS) &&
|
||||
dice(type->melee_dice, 10) > dice(p.dodge(g), 10)) {
|
||||
if (!is_npc)
|
||||
g->add_msg("The %s grabs you!", name().c_str());
|
||||
if (p.weapon.has_technique(TEC_BREAK, &p) &&
|
||||
dice(p.dex_cur + p.skillLevel("melee").level(), 12) > dice(type->melee_dice, 10)){
|
||||
dice(p.dex_cur + p.skillLevel("melee"), 12) > dice(type->melee_dice, 10)){
|
||||
if (!is_npc)
|
||||
g->add_msg("You break the grab!");
|
||||
} else
|
||||
@@ -610,7 +612,7 @@ void monster::move_to(game *g, int x, int y)
|
||||
}
|
||||
// Diggers turn the dirt into dirtmound
|
||||
if (has_flag(MF_DIGS))
|
||||
g->m.ter(posx, posy) = t_dirtmound;
|
||||
g->m.ter_set(posx, posy, t_dirtmound);
|
||||
// Acid trail monsters leave... a trail of acid
|
||||
if (has_flag(MF_ACIDTRAIL))
|
||||
g->m.add_field(g, posx, posy, fd_acid, 1);
|
||||
@@ -628,12 +630,10 @@ void monster::move_to(game *g, int x, int y)
|
||||
void monster::stumble(game *g, bool moved)
|
||||
{
|
||||
// don't stumble every turn. every 3rd turn, or 8th when walking.
|
||||
if(moved)
|
||||
if(!one_in(8))
|
||||
return;
|
||||
else
|
||||
if(!one_in(3))
|
||||
return;
|
||||
if((moved && !one_in(8)) || !one_in(3))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
std::vector <point> valid_stumbles;
|
||||
for (int i = -1; i <= 1; i++) {
|
||||
@@ -647,7 +647,9 @@ void monster::stumble(game *g, bool moved)
|
||||
}
|
||||
}
|
||||
if (valid_stumbles.size() == 0) //nowhere to stumble?
|
||||
return;
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
int choice = rng(0, valid_stumbles.size() - 1);
|
||||
posx = valid_stumbles[choice].x;
|
||||
@@ -766,6 +768,10 @@ bool monster::will_reach(game *g, int x, int y)
|
||||
if (has_flag(MF_IMMOBILE) && (posx != x || posy != y))
|
||||
return false;
|
||||
|
||||
std::vector<point> path = g->m.route(posx, posy, x, y, has_flag(MF_BASHES));
|
||||
if (path.size() == 0)
|
||||
return false;
|
||||
|
||||
if (has_flag(MF_SMELLS) && g->scent(posx, posy) > 0 &&
|
||||
g->scent(x, y) > g->scent(posx, posy))
|
||||
return true;
|
||||
|
||||
+16
-32
@@ -446,10 +446,10 @@ int monster::trigger_sum(game *g, std::vector<monster_trigger> *triggers)
|
||||
if (check_meat) {
|
||||
std::vector<item> *items = &(g->m.i_at(x, y));
|
||||
for (int n = 0; n < items->size(); n++) {
|
||||
if ((*items)[n].type->id == itm_corpse ||
|
||||
(*items)[n].type->id == itm_meat ||
|
||||
(*items)[n].type->id == itm_meat_cooked ||
|
||||
(*items)[n].type->id == itm_human_flesh) {
|
||||
if ((*items)[n].type->id == "corpse" ||
|
||||
(*items)[n].type->id == "meat" ||
|
||||
(*items)[n].type->id == "meat_cooked" ||
|
||||
(*items)[n].type->id == "human_flesh") {
|
||||
ret += 3;
|
||||
check_meat = false;
|
||||
}
|
||||
@@ -462,7 +462,7 @@ int monster::trigger_sum(game *g, std::vector<monster_trigger> *triggers)
|
||||
}
|
||||
}
|
||||
if (check_fire) {
|
||||
if (g->u.has_amount(itm_torch_lit, 1))
|
||||
if (g->u.has_amount("torch_lit", 1))
|
||||
ret += 49;
|
||||
}
|
||||
}
|
||||
@@ -529,6 +529,11 @@ void monster::hit_monster(game *g, int i)
|
||||
int junk;
|
||||
monster* target = &(g->z[i]);
|
||||
|
||||
if (this == target) {
|
||||
debugmsg("stopped monster from hitting itself");
|
||||
return;
|
||||
}
|
||||
|
||||
int numdice = type->melee_skill;
|
||||
int dodgedice = target->dodge() * 2;
|
||||
switch (target->type->size) {
|
||||
@@ -648,7 +653,7 @@ void monster::die(game *g)
|
||||
selected_item++;
|
||||
cur_chance -= g->itypes[mapit[selected_item]]->rarity;
|
||||
}
|
||||
g->m.add_item(posx, posy, g->itypes[mapit[selected_item]], 0);
|
||||
g->m.spawn_item(posx, posy, g->itypes[mapit[selected_item]], 0);
|
||||
if (type->item_chance < 0)
|
||||
animal_done = true; // Only drop ONE item.
|
||||
}
|
||||
@@ -656,34 +661,13 @@ void monster::die(game *g)
|
||||
|
||||
// If we're a queen, make nearby groups of our type start to die out
|
||||
if (has_flag(MF_QUEEN)) {
|
||||
std::vector<mongroup*> groups = g->cur_om.monsters_at(g->levx, g->levy);
|
||||
for (int i = 0; i < groups.size(); i++) {
|
||||
moncat_id moncat_type = groups[i]->type;
|
||||
bool match = false;
|
||||
for (int j = 0; !match && j < g->moncats[moncat_type].size(); j++) {
|
||||
if (g->moncats[moncat_type][j] == type->id)
|
||||
match = true;
|
||||
}
|
||||
if (match)
|
||||
groups[i]->dying = true;
|
||||
}
|
||||
// Do it for overmap above/below too
|
||||
overmap tmp;
|
||||
if (g->cur_om.posz == 0)
|
||||
tmp = overmap(g, g->cur_om.posx, g->cur_om.posy, -1);
|
||||
else
|
||||
tmp = overmap(g, g->cur_om.posx, g->cur_om.posy, 0);
|
||||
|
||||
groups = tmp.monsters_at(g->levx, g->levy);
|
||||
for (int i = 0; i < groups.size(); i++) {
|
||||
moncat_id moncat_type = groups[i]->type;
|
||||
bool match = false;
|
||||
for (int j = 0; !match && j < g->moncats[moncat_type].size(); j++) {
|
||||
if (g->moncats[moncat_type][j] == type->id)
|
||||
match = true;
|
||||
}
|
||||
if (match)
|
||||
for(int z = 0; z >= -1; --z) {
|
||||
std::vector<mongroup*> groups = g->cur_om.monsters_at(g->levx, g->levy, z);
|
||||
for (int i = 0; i < groups.size(); i++) {
|
||||
if (MonsterGroupManager::IsMonsterInGroup(groups[i]->type, mon_id(type->id)))
|
||||
groups[i]->dying = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
// If we're a mission monster, update the mission
|
||||
|
||||
@@ -10,6 +10,7 @@ enum morale_type
|
||||
{
|
||||
MORALE_NULL = 0,
|
||||
MORALE_FOOD_GOOD,
|
||||
MORALE_FOOD_HOT,
|
||||
MORALE_MUSIC,
|
||||
MORALE_MARLOSS,
|
||||
MORALE_FEELING_GOOD,
|
||||
@@ -23,6 +24,7 @@ enum morale_type
|
||||
MORALE_CRAVING_CRACK,
|
||||
|
||||
MORALE_FOOD_BAD,
|
||||
MORALE_CANNIBAL,
|
||||
MORALE_VEGETARIAN,
|
||||
MORALE_WET,
|
||||
MORALE_COLD,
|
||||
|
||||
@@ -7,6 +7,7 @@
|
||||
std::string morale_data[NUM_MORALE_TYPES] = {
|
||||
"This is a bug",
|
||||
"Enjoyed %i",
|
||||
"Enjoyed a hot meal",
|
||||
"Music",
|
||||
"Marloss Bliss",
|
||||
"Good Feeling",
|
||||
@@ -20,6 +21,7 @@ std::string morale_data[NUM_MORALE_TYPES] = {
|
||||
"Crack Cocaine Craving",
|
||||
|
||||
"Disliked %i",
|
||||
"Ate Human Flesh",
|
||||
"Ate Meat",
|
||||
"Wet",
|
||||
"Cold",
|
||||
|
||||
@@ -30,7 +30,7 @@ num_species
|
||||
enum mon_id {
|
||||
mon_null = 0,
|
||||
// Wildlife
|
||||
mon_squirrel, mon_rabbit, mon_deer, mon_wolf, mon_bear, mon_cougar,
|
||||
mon_squirrel, mon_rabbit, mon_deer, mon_wolf, mon_bear, mon_cougar, mon_crow,
|
||||
// Friendly animals
|
||||
mon_dog, mon_cat,
|
||||
// Ants
|
||||
@@ -41,10 +41,11 @@ mon_fly, mon_bee, mon_wasp,
|
||||
mon_graboid, mon_worm, mon_halfworm,
|
||||
// Zombies
|
||||
mon_zombie, mon_zombie_cop, mon_zombie_shrieker, mon_zombie_spitter, mon_zombie_electric,
|
||||
mon_zombie_smoker,
|
||||
mon_zombie_fast, mon_zombie_brute, mon_zombie_hulk, mon_zombie_fungus,
|
||||
mon_boomer, mon_boomer_fungus, mon_skeleton, mon_zombie_necro,
|
||||
mon_zombie_scientist, mon_zombie_soldier, mon_zombie_grabber,
|
||||
mon_zombie_master, mon_beekeeper, mon_shia, mon_zombie_child,
|
||||
mon_zombie_master, mon_beekeeper, mon_zombie_child,
|
||||
// Triffids
|
||||
mon_triffid, mon_triffid_young, mon_triffid_queen, mon_creeper_hub,
|
||||
mon_creeper_vine, mon_biollante, mon_vinebeast, mon_triffid_heart,
|
||||
@@ -120,6 +121,11 @@ std::vector<monster_trigger> default_fears(monster_species spec);
|
||||
enum m_flag {
|
||||
MF_NULL = 0, // Helps with setvector
|
||||
MF_SEES, // It can see you (and will run/follow)
|
||||
MF_VIS50, //Vision -10
|
||||
MF_VIS40, //Vision -20
|
||||
MF_VIS30, //Vision -30
|
||||
MF_VIS20, //Vision -40
|
||||
MF_VIS10, //Vision -50
|
||||
MF_HEARS, // It can hear you
|
||||
MF_GOODHEARING, // Pursues sounds more than most monsters
|
||||
MF_SMELLS, // It can smell you
|
||||
@@ -152,30 +158,40 @@ MF_QUEEN, // When it dies, local populations start to die off too
|
||||
MF_ELECTRONIC, // e.g. a robot; affected by emp blasts, and other stuff
|
||||
MF_FUR, // May produce fur when butchered.
|
||||
MF_LEATHER, // May produce leather when butchered
|
||||
MF_CBM, // May produce a cbm or two when butchered
|
||||
MF_BONES, // May produce bones and sinews when butchered
|
||||
MF_IMMOBILE, // Doesn't move (e.g. turrets)
|
||||
MF_FRIENDLY_SPECIAL, // Use our special attack, even if friendly
|
||||
MF_HIT_AND_RUN, // Flee for several turns after a melee attack
|
||||
MF_GUILT, // You feel guilty for killing it
|
||||
MF_HUMAN, // It's a live human
|
||||
MF_NO_BREATHE, //Provides immunity to inhalation effects from gas, smoke, and poison
|
||||
MF_MAX // Sets the length of the flags - obviously MUST be last
|
||||
};
|
||||
|
||||
enum m_category {
|
||||
MC_NULL = 0, // No category.
|
||||
MC_CLASSIC, // Only monsters we expect in a classic zombie movie.
|
||||
MC_WILDLIFE, // The natural animals.
|
||||
MC_MAX // Size of flag array.
|
||||
};
|
||||
|
||||
struct mtype {
|
||||
int id;
|
||||
std::string name;
|
||||
std::string description;
|
||||
monster_species species;
|
||||
char sym; // Symbol on the map
|
||||
long sym; // Symbol on the map
|
||||
nc_color color;// Color of symbol (see color.h)
|
||||
|
||||
m_size size;
|
||||
material mat; // See enums.h for material list. Generally, flesh; veggy?
|
||||
std::vector<m_flag> flags;
|
||||
std::vector<m_category> categories;
|
||||
std::vector<monster_trigger> anger; // What angers us?
|
||||
std::vector<monster_trigger> placate; // What reduces our anger?
|
||||
std::vector<monster_trigger> fear; // What are we afraid of?
|
||||
|
||||
unsigned char frequency; // How often do these show up? 0 (never) to ??
|
||||
int difficulty;// Used all over; 30 min + (diff-3)*30 min = earlist appearance
|
||||
int agro; // How likely to attack; -100 to 100
|
||||
int morale; // Default morale level
|
||||
@@ -207,7 +223,6 @@ struct mtype {
|
||||
size = MS_MEDIUM;
|
||||
mat = FLESH;
|
||||
difficulty = 0;
|
||||
frequency = 0;
|
||||
agro = 0;
|
||||
morale = 0;
|
||||
speed = 0;
|
||||
@@ -228,7 +243,7 @@ struct mtype {
|
||||
// Non-default (messy)
|
||||
mtype (int pid, std::string pname, monster_species pspecies, char psym,
|
||||
nc_color pcolor, m_size psize, material pmat,
|
||||
unsigned char pfreq, unsigned int pdiff, signed char pagro,
|
||||
unsigned int pdiff, signed char pagro,
|
||||
signed char pmorale, unsigned int pspeed, unsigned char pml_skill,
|
||||
unsigned char pml_dice, unsigned char pml_sides, unsigned char pml_cut,
|
||||
unsigned char pdodge, unsigned char parmor_bash,
|
||||
@@ -244,7 +259,6 @@ struct mtype {
|
||||
color = pcolor;
|
||||
size = psize;
|
||||
mat = pmat;
|
||||
frequency = pfreq;
|
||||
difficulty = pdiff;
|
||||
agro = pagro;
|
||||
morale = pmorale;
|
||||
@@ -275,6 +289,15 @@ struct mtype {
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool in_category(m_category category)
|
||||
{
|
||||
for (int i = 0; i < categories.size(); i++) {
|
||||
if (categories[i] == category)
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
}
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+343
-321
File diff suppressed because it is too large
Load Diff
+1
-2
@@ -221,7 +221,7 @@ void player::remove_child_flag(game *g, pl_flag flag)
|
||||
void mutation_effect(game *g, player &p, pl_flag mut)
|
||||
{
|
||||
bool is_u = (&p == &(g->u));
|
||||
bool destroy = false, skip_cloth = false;
|
||||
bool destroy = false;
|
||||
std::vector<body_part> bps;
|
||||
|
||||
switch (mut) {
|
||||
@@ -262,7 +262,6 @@ void mutation_effect(game *g, player &p, pl_flag mut)
|
||||
case PF_HORNS_POINTED:
|
||||
case PF_ANTENNAE:
|
||||
case PF_ANTLERS:
|
||||
skip_cloth = true;
|
||||
bps.push_back(bp_head);
|
||||
break;
|
||||
|
||||
|
||||
+306
-227
@@ -1,4 +1,5 @@
|
||||
#include "player.h"
|
||||
#include "profession.h"
|
||||
#include "output.h"
|
||||
#include "rng.h"
|
||||
#include "keypress.h"
|
||||
@@ -34,12 +35,15 @@
|
||||
#define HIGH_STAT 14 // The point after which stats cost double
|
||||
#define MAX_TRAIT_POINTS 12 // How many points from traits
|
||||
|
||||
void draw_tabs(WINDOW* w);
|
||||
#define NEWCHAR_TAB_MAX 4 // The ID of the rightmost tab
|
||||
|
||||
int set_stats(WINDOW* w, player *u, int &points);
|
||||
int set_traits(WINDOW* w, player *u, int &points);
|
||||
int set_skills(WINDOW* w, player *u, int &points);
|
||||
int set_description(WINDOW* w, player *u, int &points);
|
||||
void draw_tabs(WINDOW* w, std::string sTab);
|
||||
|
||||
int set_stats(WINDOW* w, game* g, player *u, int &points);
|
||||
int set_traits(WINDOW* w, game* g, player *u, int &points);
|
||||
int set_profession(WINDOW* w, game* g, player *u, int &points);
|
||||
int set_skills(WINDOW* w, game* g, player *u, int &points);
|
||||
int set_description(WINDOW* w, game* g, player *u, int &points);
|
||||
|
||||
int random_skill();
|
||||
|
||||
@@ -49,8 +53,12 @@ void save_template(player *u);
|
||||
|
||||
bool player::create(game *g, character_type type, std::string tempname)
|
||||
{
|
||||
weapon = item(g->itypes[0], 0);
|
||||
WINDOW* w = newwin(25, 80, 0, 0);
|
||||
weapon = item(g->itypes["null"], 0);
|
||||
|
||||
g->u.prof = profession::generic();
|
||||
|
||||
WINDOW* w = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
|
||||
int tab = 0, points = 38;
|
||||
if (type != PLTYPE_CUSTOM) {
|
||||
switch (type) {
|
||||
@@ -121,7 +129,7 @@ bool player::create(game *g, character_type type, std::string tempname)
|
||||
rn = random_skill();
|
||||
|
||||
Skill *aSkill = Skill::skill(rn);
|
||||
int level = skillLevel(aSkill).level();
|
||||
int level = skillLevel(aSkill);
|
||||
|
||||
if (level < points) {
|
||||
points -= level + 1;
|
||||
@@ -146,21 +154,21 @@ bool player::create(game *g, character_type type, std::string tempname)
|
||||
points = 0;
|
||||
} break;
|
||||
}
|
||||
tab = 3;
|
||||
tab = NEWCHAR_TAB_MAX;
|
||||
} else
|
||||
points = OPTIONS[OPT_INITIAL_POINTS];
|
||||
|
||||
do {
|
||||
werase(w);
|
||||
draw_tabs(w);
|
||||
wrefresh(w);
|
||||
switch (tab) {
|
||||
case 0: tab += set_stats (w, this, points); break;
|
||||
case 1: tab += set_traits (w, this, points); break;
|
||||
case 2: tab += set_skills (w, this, points); break;
|
||||
case 3: tab += set_description(w, this, points); break;
|
||||
case 0: tab += set_stats (w, g, this, points); break;
|
||||
case 1: tab += set_traits (w, g, this, points); break;
|
||||
case 2: tab += set_profession (w, g, this, points); break;
|
||||
case 3: tab += set_skills (w, g, this, points); break;
|
||||
case 4: tab += set_description(w, g, this, points); break;
|
||||
}
|
||||
} while (tab >= 0 && tab < 4);
|
||||
} while (tab >= 0 && tab <= NEWCHAR_TAB_MAX);
|
||||
delwin(w);
|
||||
|
||||
if (tab < 0)
|
||||
@@ -178,16 +186,18 @@ bool player::create(game *g, character_type type, std::string tempname)
|
||||
if (has_trait(PF_SMELLY))
|
||||
scent = 800;
|
||||
if (has_trait(PF_ANDROID)) {
|
||||
add_bionic(bionic_id(rng(bio_memory, max_bio_start - 1)));// Other
|
||||
if (bionics[my_bionics[0].id].power_cost > 0) {
|
||||
add_bionic(bionic_id(rng(1, bio_ethanol))); // Power Source
|
||||
std::map<std::string,bionic_data*>::iterator random_bionic = bionics.begin();
|
||||
std::advance(random_bionic,rng(0,bionics.size()-1));
|
||||
add_bionic(random_bionic->first);// Other
|
||||
if (bionics[my_bionics[0].id]->power_cost > 0) {
|
||||
add_bionic(bionic_id(power_source_bionics[rng(0,power_source_bionics.size())])); // Power Source
|
||||
max_power_level = 10;
|
||||
power_level = 10;
|
||||
} else {
|
||||
bionic_id tmpbio;
|
||||
do
|
||||
tmpbio = bionic_id(rng(bio_ethanol + 1, bio_armor_legs));
|
||||
while (bionics[tmpbio].power_cost > 0);
|
||||
tmpbio = bionic_id(unpowered_bionics[rng(0, unpowered_bionics.size())]);
|
||||
while (bionics[tmpbio]->power_cost > 0);
|
||||
add_bionic(tmpbio);
|
||||
max_power_level = 0;
|
||||
power_level = 0;
|
||||
@@ -195,9 +205,9 @@ bool player::create(game *g, character_type type, std::string tempname)
|
||||
|
||||
/* CHEATER'S STUFF
|
||||
|
||||
add_bionic(bionic_id(rng(0, bio_ethanol))); // Power Source
|
||||
add_bionic(bionic_id(rng(0, "bio_ethanol"))); // Power Source
|
||||
for (int i = 0; i < 5; i++)
|
||||
add_bionic(bionic_id(rng(bio_memory, max_bio_start - 1)));// Other
|
||||
add_bionic(bionic_id(rng("bio_memory", max_"bio_start" - 1)));// Other
|
||||
max_power_level = 80;
|
||||
power_level = 80;
|
||||
|
||||
@@ -208,123 +218,121 @@ End of cheatery */
|
||||
itype_id ma_type;
|
||||
do {
|
||||
int choice = menu("Pick your style:",
|
||||
"Karate", "Judo", "Aikido", "Tai Chi", "Taekwando", NULL);
|
||||
"Karate", "Judo", "Aikido", "Tai Chi", "Taekwondo", NULL);
|
||||
if (choice == 1)
|
||||
ma_type = itm_style_karate;
|
||||
ma_type = "style_karate";
|
||||
if (choice == 2)
|
||||
ma_type = itm_style_judo;
|
||||
ma_type = "style_judo";
|
||||
if (choice == 3)
|
||||
ma_type = itm_style_aikido;
|
||||
ma_type = "style_aikido";
|
||||
if (choice == 4)
|
||||
ma_type = itm_style_tai_chi;
|
||||
ma_type = "style_tai_chi";
|
||||
if (choice == 5)
|
||||
ma_type = itm_style_taekwando;
|
||||
ma_type = "style_taekwondo";
|
||||
item tmpitem = item(g->itypes[ma_type], 0);
|
||||
full_screen_popup(tmpitem.info(true).c_str());
|
||||
} while (!query_yn("Use this style?"));
|
||||
styles.push_back(ma_type);
|
||||
}
|
||||
ret_null = item(g->itypes[0], 0);
|
||||
ret_null = item(g->itypes["null"], 0);
|
||||
if (!styles.empty())
|
||||
weapon = item(g->itypes[ styles[0] ], 0, ':');
|
||||
else
|
||||
weapon = item(g->itypes[0], 0);
|
||||
// Nice to start out less than naked.
|
||||
item tmp(g->itypes[itm_jeans_fit], 0, 'a');
|
||||
worn.push_back(tmp);
|
||||
tmp = item(g->itypes[itm_tshirt_fit], 0, 'b');
|
||||
worn.push_back(tmp);
|
||||
tmp = item(g->itypes[itm_sneakers_fit], 0, 'c');
|
||||
worn.push_back(tmp);
|
||||
weapon = item(g->itypes["null"], 0);
|
||||
|
||||
item tmp; //gets used several times
|
||||
|
||||
std::vector<std::string> prof_items = g->u.prof->items();
|
||||
for (std::vector<std::string>::const_iterator iter = prof_items.begin(); iter != prof_items.end(); ++iter) {
|
||||
item tmp = item(g->itypes.at(*iter), 0, 'a' + worn.size());
|
||||
if (tmp.is_armor()) {
|
||||
if (tmp.has_flag(IF_VARSIZE))
|
||||
tmp.item_flags |= mfb(IF_FIT);
|
||||
worn.push_back(tmp);
|
||||
} else {
|
||||
inv.push_back(tmp);
|
||||
}
|
||||
|
||||
// if we start with drugs, need to start strongly addicted, too
|
||||
if (tmp.is_food()) {
|
||||
it_comest *comest = dynamic_cast<it_comest*>(tmp.type);
|
||||
if (comest->add != ADD_NULL) {
|
||||
addiction add(comest->add, 10);
|
||||
g->u.addictions.push_back(add);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// The near-sighted get to start with glasses.
|
||||
if (has_trait(PF_MYOPIC)) {
|
||||
tmp = item(g->itypes[itm_glasses_eye], 0, 'd');
|
||||
tmp = item(g->itypes["glasses_eye"], 0, 'a' + worn.size());
|
||||
worn.push_back(tmp);
|
||||
}
|
||||
// And the far-sighted get to start with reading glasses.
|
||||
if (has_trait(PF_HYPEROPIC)) {
|
||||
tmp = item(g->itypes["glasses_reading"], 0, 'a' + worn.size());
|
||||
worn.push_back(tmp);
|
||||
}
|
||||
// Likewise, the asthmatic start with their medication.
|
||||
if (has_trait(PF_ASTHMA)) {
|
||||
tmp = item(g->itypes[itm_inhaler], 0, 'a' + worn.size());
|
||||
tmp = item(g->itypes["inhaler"], 0, 'a' + worn.size());
|
||||
inv.push_back(tmp);
|
||||
}
|
||||
// Basic starter gear, added independently of profession.
|
||||
tmp = item(g->itypes["pockknife"], 0,'a' + worn.size());
|
||||
inv.push_back(tmp);
|
||||
tmp = item(g->itypes["matches"], 0,'a' + worn.size());
|
||||
inv.push_back(tmp);
|
||||
}
|
||||
// Add starter gear, possibly tie this to profession setting later.
|
||||
/* tmp = item(g->itypes[itm_pockknife], 0,'a' + worn.size());
|
||||
inv.push_back(tmp);
|
||||
tmp = item(g->itypes[itm_lighter], 0,'a' + worn.size());
|
||||
inv.push_back(tmp); */
|
||||
// make sure we have no mutations
|
||||
for (int i = 0; i < PF_MAX2; i++)
|
||||
my_mutations[i] = false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void draw_tabs(WINDOW* w)
|
||||
void draw_tabs(WINDOW* w, std::string sTab)
|
||||
{
|
||||
for (int i = 0; i < 16; i++) {
|
||||
if (i < 9)
|
||||
mvwputch(w, 0, i + 5, c_ltgray, LINE_OXOX);
|
||||
if (i < 10) {
|
||||
mvwputch(w, 0, i + 22, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 0, i + 40, c_ltgray, LINE_OXOX);
|
||||
for (int i = 1; i < 79; i++) {
|
||||
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 24, i, c_ltgray, LINE_OXOX);
|
||||
|
||||
if (i > 2 && i < 24) {
|
||||
mvwputch(w, i, 0, c_ltgray, LINE_XOXO);
|
||||
mvwputch(w, i, 79, c_ltgray, LINE_XOXO);
|
||||
}
|
||||
mvwputch(w, 0, i + 57, c_ltgray, LINE_OXOX);
|
||||
}
|
||||
mvwputch(w, 0, 4, c_ltgray, LINE_OXXO);
|
||||
mvwputch(w, 0,21, c_ltgray, LINE_OXXO);
|
||||
mvwputch(w, 0,39, c_ltgray, LINE_OXXO);
|
||||
mvwputch(w, 0,57, c_ltgray, LINE_OXXO);
|
||||
|
||||
mvwputch(w, 0,14, c_ltgray, LINE_OOXX);
|
||||
mvwputch(w, 0,32, c_ltgray, LINE_OOXX);
|
||||
mvwputch(w, 0,50, c_ltgray, LINE_OOXX);
|
||||
mvwputch(w, 0,73, c_ltgray, LINE_OOXX);
|
||||
draw_tab(w, 7, "STATS", (sTab == "STATS") ? true : false);
|
||||
draw_tab(w, 18, "TRAITS", (sTab == "TRAITS") ? true : false);
|
||||
draw_tab(w, 30, "PROFESSION", (sTab == "PROFESSION") ? true : false);
|
||||
draw_tab(w, 46, "SKILLS", (sTab == "SKILLS") ? true : false);
|
||||
draw_tab(w, 58, "DESCRIPTION", (sTab == "DESCRIPTION") ? true : false);
|
||||
|
||||
mvwprintz(w, 1, 4, c_ltgray, "\
|
||||
STATS TRAITS SKILLS DESCRIPTION ");
|
||||
mvwputch(w, 2, 0, c_ltgray, LINE_OXXO); // |^
|
||||
mvwputch(w, 2, 79, c_ltgray, LINE_OOXX); // ^|
|
||||
|
||||
mvwputch(w, 1, 4, c_ltgray, LINE_XOXO);
|
||||
mvwputch(w, 1,14, c_ltgray, LINE_XOXO);
|
||||
mvwputch(w, 1,21, c_ltgray, LINE_XOXO);
|
||||
mvwputch(w, 1,32, c_ltgray, LINE_XOXO);
|
||||
mvwputch(w, 1,39, c_ltgray, LINE_XOXO);
|
||||
mvwputch(w, 1,50, c_ltgray, LINE_XOXO);
|
||||
mvwputch(w, 1,57, c_ltgray, LINE_XOXO);
|
||||
mvwputch(w, 1,73, c_ltgray, LINE_XOXO);
|
||||
mvwputch(w, 4, 0, c_ltgray, LINE_XXXO); // |-
|
||||
mvwputch(w, 4, 79, c_ltgray, LINE_XOXX); // -|
|
||||
|
||||
mvwputch(w, 24, 0, c_ltgray, LINE_XXOO); // |_
|
||||
mvwputch(w, 24, 79, c_ltgray, LINE_XOOX); // _|
|
||||
}
|
||||
|
||||
int set_stats(WINDOW* w, player *u, int &points)
|
||||
int set_stats(WINDOW* w, game* g, player *u, int &points)
|
||||
{
|
||||
unsigned char sel = 1;
|
||||
char ch;
|
||||
// Draw horizontal lines, with a gap for the active tab
|
||||
for (int i = 0; i < 80; i++) {
|
||||
if (i < 4 || i > 14)
|
||||
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
|
||||
}
|
||||
// Attaching lines for tabs
|
||||
mvwputch(w, 1, 2, h_ltgray, '<');
|
||||
mvwputch(w, 1, 16, h_ltgray, '>');
|
||||
mvwputch(w, 2, 4, c_ltgray, LINE_XOOX);
|
||||
mvwputch(w, 2, 14, c_ltgray, LINE_XXOO);
|
||||
mvwputch(w, 2, 21, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2, 32, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2, 39, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2, 50, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2, 57, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2, 73, c_ltgray, LINE_XXOX);
|
||||
mvwprintz(w, 1, 5, h_ltgray, " STATS ");
|
||||
|
||||
mvwprintz(w, 11, 0, c_ltgray, "\
|
||||
j/k, 8/2, or arrows select\n\
|
||||
a statistic.\n\
|
||||
l, 6, or right arrow\n\
|
||||
increases the statistic.\n\
|
||||
h, 4, or left arrow\n\
|
||||
decreases the statistic.\n\
|
||||
\n\
|
||||
> Takes you to the next tab.\n\
|
||||
< Returns you to the main menu.");
|
||||
draw_tabs(w, "STATS");
|
||||
|
||||
mvwprintz(w, 11, 2, c_ltgray, "j/k, 8/2, or arrows select");
|
||||
mvwprintz(w, 12, 2, c_ltgray, " a statistic.");
|
||||
mvwprintz(w, 13, 2, c_ltgray, "l, 6, or right arrow");
|
||||
mvwprintz(w, 14, 2, c_ltgray, " increases the statistic.");
|
||||
mvwprintz(w, 15, 2, c_ltgray, "h, 4, or left arrow");
|
||||
mvwprintz(w, 16, 2, c_ltgray, " decreases the statistic.");
|
||||
mvwprintz(w, 18, 2, c_ltgray, "> Takes you to the next tab.");
|
||||
mvwprintz(w, 19, 2, c_ltgray, "< Returns you to the main menu.");
|
||||
|
||||
do {
|
||||
mvwprintz(w, 3, 2, c_ltgray, "Points left: %d ", points);
|
||||
@@ -344,9 +352,9 @@ int set_stats(WINDOW* w, player *u, int &points)
|
||||
u->weight_capacity(false) / 4);
|
||||
mvwprintz(w, 8, 33, COL_STAT_ACT, "Melee damage: %d ",
|
||||
u->base_damage(false));
|
||||
mvwprintz(w, 9, 33, COL_STAT_ACT, " Strength also makes you more resistant to ");
|
||||
mvwprintz(w,10, 33, COL_STAT_ACT, "many diseases and poisons, and makes actions");
|
||||
mvwprintz(w,11, 33, COL_STAT_ACT, "which require brute force more effective. ");
|
||||
mvwprintz(w,10, 33, COL_STAT_ACT, "Strength also makes you more resistant to ");
|
||||
mvwprintz(w,11, 33, COL_STAT_ACT, "many diseases and poisons, and makes actions");
|
||||
mvwprintz(w,12, 33, COL_STAT_ACT, "which require brute force more effective. ");
|
||||
break;
|
||||
|
||||
case 2:
|
||||
@@ -370,9 +378,10 @@ int set_stats(WINDOW* w, player *u, int &points)
|
||||
(u->throw_dex_mod(false) <= 0 ? "bonus" : "penalty"),
|
||||
(u->throw_dex_mod(false) <= 0 ? "+" : "-"),
|
||||
abs(u->throw_dex_mod(false)));
|
||||
mvwprintz(w, 9, 33, COL_STAT_ACT, " Dexterity also enhances many actions which");
|
||||
mvwprintz(w,10, 33, COL_STAT_ACT, "require finesse. ");
|
||||
mvwprintz(w,11, 33, COL_STAT_ACT, " ");
|
||||
mvwprintz(w, 9, 33, COL_STAT_ACT, " ");
|
||||
mvwprintz(w,10, 33, COL_STAT_ACT, "Dexterity also enhances many actions which ");
|
||||
mvwprintz(w,11, 33, COL_STAT_ACT, "require finesse. ");
|
||||
mvwprintz(w,12, 33, COL_STAT_ACT, " ");
|
||||
break;
|
||||
|
||||
case 3:
|
||||
@@ -384,14 +393,16 @@ int set_stats(WINDOW* w, player *u, int &points)
|
||||
mvwprintz(w, 7, 2, c_ltgray, "Dexterity: %d ", u->dex_max);
|
||||
mvwprintz(w, 8, 2, COL_STAT_ACT, "Intelligence: %d ", u->int_max);
|
||||
mvwprintz(w, 9, 2, c_ltgray, "Perception: %d ", u->per_max);
|
||||
|
||||
mvwprintz(w, 6, 33, COL_STAT_ACT, "Skill comprehension: %d%%%% ",
|
||||
u->skillLevel("melee").comprehension(u->int_max));
|
||||
mvwprintz(w, 7, 33, COL_STAT_ACT, "Read times: %d%%%% ",
|
||||
u->read_speed(false));
|
||||
mvwprintz(w, 8, 33, COL_STAT_ACT, " Intelligence is also used when crafting, ");
|
||||
mvwprintz(w, 9, 33, COL_STAT_ACT, "installing bionics, and interacting with ");
|
||||
mvwprintz(w,10, 33, COL_STAT_ACT, "NPCs. ");
|
||||
mvwprintz(w,11, 33, COL_STAT_ACT, " ");
|
||||
mvwprintz(w, 8, 33, COL_STAT_ACT, " ");
|
||||
mvwprintz(w, 9, 33, COL_STAT_ACT, "Intelligence is also used when crafting, ");
|
||||
mvwprintz(w,10, 33, COL_STAT_ACT, "installing bionics, and interacting with ");
|
||||
mvwprintz(w,11, 33, COL_STAT_ACT, "NPCs. ");
|
||||
mvwprintz(w,12, 33, COL_STAT_ACT, " ");
|
||||
break;
|
||||
|
||||
case 4:
|
||||
@@ -408,11 +419,12 @@ int set_stats(WINDOW* w, player *u, int &points)
|
||||
(u->ranged_per_mod(false) <= 0 ? "bonus" : "penalty"),
|
||||
(u->ranged_per_mod(false) <= 0 ? "+" : "-"),
|
||||
abs(u->ranged_per_mod(false)));
|
||||
mvwprintz(w, 7, 33, COL_STAT_ACT, " Perception is also used for detecting ");
|
||||
mvwprintz(w, 8, 33, COL_STAT_ACT, "traps and other things of interest. ");
|
||||
mvwprintz(w, 9, 33, COL_STAT_ACT, " ");
|
||||
mvwprintz(w, 7, 33, COL_STAT_ACT, " ");
|
||||
mvwprintz(w, 8, 33, COL_STAT_ACT, "Perception is also used for detecting ");
|
||||
mvwprintz(w, 9, 33, COL_STAT_ACT, "traps and other things of interest. ");
|
||||
mvwprintz(w,10, 33, COL_STAT_ACT, " ");
|
||||
mvwprintz(w,11, 33, COL_STAT_ACT, " ");
|
||||
mvwprintz(w,12, 33, COL_STAT_ACT, " ");
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -478,8 +490,11 @@ int set_stats(WINDOW* w, player *u, int &points)
|
||||
} while (true);
|
||||
}
|
||||
|
||||
int set_traits(WINDOW* w, player *u, int &points)
|
||||
int set_traits(WINDOW* w, game* g, player *u, int &points)
|
||||
{
|
||||
draw_tabs(w, "TRAITS");
|
||||
|
||||
WINDOW* w_description = newwin(3, 78, 21 + getbegy(w), 1 + getbegx(w));
|
||||
// Track how many good / bad POINTS we have; cap both at MAX_TRAIT_POINTS
|
||||
int num_good = 0, num_bad = 0;
|
||||
for (int i = 0; i < PF_SPLIT; i++) {
|
||||
@@ -490,25 +505,6 @@ int set_traits(WINDOW* w, player *u, int &points)
|
||||
if (u->has_trait(i))
|
||||
num_bad += abs(traits[i].points);
|
||||
}
|
||||
// Draw horizontal lines, with a gap for the active tab
|
||||
for (int i = 0; i < 80; i++) {
|
||||
if (i < 21 || i > 32)
|
||||
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
|
||||
}
|
||||
// Attaching lines for tabs
|
||||
mvwputch(w, 1,19, h_ltgray, '<');
|
||||
mvwputch(w, 1,34, h_ltgray, '>');
|
||||
mvwputch(w, 2, 4, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,14, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,21, c_ltgray, LINE_XOOX);
|
||||
mvwputch(w, 2,32, c_ltgray, LINE_XXOO);
|
||||
mvwputch(w, 2,39, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,50, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,57, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,73, c_ltgray, LINE_XXOX);
|
||||
mvwprintz(w, 1,22, h_ltgray, " TRAITS ");
|
||||
|
||||
for (int i = 0; i < 16; i++) {
|
||||
mvwprintz(w, 5 + i, 40, c_dkgray, "\
|
||||
@@ -533,25 +529,22 @@ int set_traits(WINDOW* w, player *u, int &points)
|
||||
mvwprintz(w, 3,33, c_ltred, "%s%d/%d", (num_bad < 10 ? " " : ""),
|
||||
num_bad, MAX_TRAIT_POINTS);
|
||||
// Clear the bottom of the screen.
|
||||
mvwprintz(w, 22, 0, c_ltgray, "\
|
||||
");
|
||||
mvwprintz(w, 23, 0, c_ltgray, "\
|
||||
");
|
||||
mvwprintz(w, 24, 0, c_ltgray, "\
|
||||
");
|
||||
mvwprintz(w_description, 0, 0, c_ltgray, " ");
|
||||
mvwprintz(w_description, 1, 0, c_ltgray, " ");
|
||||
mvwprintz(w_description, 2, 0, c_ltgray, " ");
|
||||
if (using_adv) {
|
||||
col_on = COL_TR_GOOD_ON;
|
||||
col_off = COL_TR_GOOD_OFF;
|
||||
hi_on = hilite(col_on);
|
||||
hi_off = hilite(col_off);
|
||||
xoff = 0;
|
||||
xoff = 2;
|
||||
cur_trait = cur_adv;
|
||||
traitmin = 1;
|
||||
traitmax = PF_SPLIT;
|
||||
mvwprintz(w, 3, 40, c_ltgray, " ");
|
||||
mvwprintz(w, 3, 40, c_ltgray, " ");
|
||||
mvwprintz(w, 3, 40, COL_TR_GOOD, "%s costs %d points",
|
||||
traits[cur_adv].name.c_str(), traits[cur_adv].points);
|
||||
mvwprintz(w, 22, 0, COL_TR_GOOD, "%s", traits[cur_adv].description.c_str());
|
||||
mvwprintz(w_description, 0, 0, COL_TR_GOOD, "%s", traits[cur_adv].description.c_str());
|
||||
} else {
|
||||
col_on = COL_TR_BAD_ON;
|
||||
col_off = COL_TR_BAD_OFF;
|
||||
@@ -561,15 +554,16 @@ int set_traits(WINDOW* w, player *u, int &points)
|
||||
cur_trait = cur_dis;
|
||||
traitmin = PF_SPLIT + 1;
|
||||
traitmax = PF_MAX;
|
||||
mvwprintz(w, 3, 40, c_ltgray, " ");
|
||||
mvwprintz(w, 3, 40, c_ltgray, " ");
|
||||
mvwprintz(w, 3, 40, COL_TR_BAD, "%s earns %d points",
|
||||
traits[cur_dis].name.c_str(), traits[cur_dis].points * -1);
|
||||
mvwprintz(w, 22, 0, COL_TR_BAD, "%s", traits[cur_dis].description.c_str());
|
||||
mvwprintz(w_description, 0, 0, COL_TR_BAD, "%s", traits[cur_dis].description.c_str());
|
||||
}
|
||||
|
||||
if (cur_trait <= traitmin + 7) {
|
||||
for (int i = traitmin; i < traitmin + 16; i++) {
|
||||
mvwprintz(w, 5 + i - traitmin, xoff, c_ltgray, "\
|
||||
"); // Clear the line
|
||||
"); // Clear the line
|
||||
if (i == cur_trait) {
|
||||
if (u->has_trait(i))
|
||||
mvwprintz(w, 5 + i - traitmin, xoff, hi_on, traits[i].name.c_str());
|
||||
@@ -585,7 +579,7 @@ int set_traits(WINDOW* w, player *u, int &points)
|
||||
} else if (cur_trait >= traitmax - 9) {
|
||||
for (int i = traitmax - 16; i < traitmax; i++) {
|
||||
mvwprintz(w, 21 + i - traitmax, xoff, c_ltgray, "\
|
||||
"); // Clear the line
|
||||
"); // Clear the line
|
||||
if (i == cur_trait) {
|
||||
if (u->has_trait(i))
|
||||
mvwprintz(w, 21 + i - traitmax, xoff, hi_on, traits[i].name.c_str());
|
||||
@@ -601,7 +595,7 @@ int set_traits(WINDOW* w, player *u, int &points)
|
||||
} else {
|
||||
for (int i = cur_trait - 7; i < cur_trait + 9; i++) {
|
||||
mvwprintz(w, 12 + i - cur_trait, xoff, c_ltgray, "\
|
||||
"); // Clear the line
|
||||
"); // Clear the line
|
||||
if (i == cur_trait) {
|
||||
if (u->has_trait(i))
|
||||
mvwprintz(w, 12 + i - cur_trait, xoff, hi_on, traits[i].name.c_str());
|
||||
@@ -617,6 +611,7 @@ int set_traits(WINDOW* w, player *u, int &points)
|
||||
}
|
||||
|
||||
wrefresh(w);
|
||||
wrefresh(w_description);
|
||||
switch (input()) {
|
||||
case 'h':
|
||||
case 'l':
|
||||
@@ -629,9 +624,9 @@ int set_traits(WINDOW* w, player *u, int &points)
|
||||
}
|
||||
} else {
|
||||
for (int i = 0; i < 16; i++) {
|
||||
mvwprintz(w, 5 + i, 0, c_dkgray, "\
|
||||
mvwprintz(w, 5 + i, 2, c_dkgray, "\
|
||||
");
|
||||
mvwprintz(w, 5 + i, 0, c_dkgray, traits[i + 1].name.c_str());
|
||||
mvwprintz(w, 5 + i, 2, c_dkgray, traits[i + 1].name.c_str());
|
||||
}
|
||||
}
|
||||
using_adv = !using_adv;
|
||||
@@ -692,27 +687,125 @@ int set_traits(WINDOW* w, player *u, int &points)
|
||||
} while (true);
|
||||
}
|
||||
|
||||
int set_skills(WINDOW* w, player *u, int &points)
|
||||
int set_profession(WINDOW* w, game* g, player *u, int &points)
|
||||
{
|
||||
// Draw horizontal lines, with a gap for the active tab
|
||||
for (int i = 0; i < 80; i++) {
|
||||
if (i < 39 || i > 50)
|
||||
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
|
||||
}
|
||||
// Attaching lines for tabs
|
||||
mvwputch(w, 1,37, h_ltgray, '<');
|
||||
mvwputch(w, 1,52, h_ltgray, '>');
|
||||
mvwputch(w, 2, 4, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,14, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,21, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,32, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,39, c_ltgray, LINE_XOOX);
|
||||
mvwputch(w, 2,50, c_ltgray, LINE_XXOO);
|
||||
mvwputch(w, 2,57, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,73, c_ltgray, LINE_XXOX);
|
||||
mvwprintz(w,1,40, h_ltgray, " SKILLS ");
|
||||
draw_tabs(w, "PROFESSION");
|
||||
|
||||
WINDOW* w_description = newwin(3, 78, 21 + getbegy(w), 1 + getbegx(w));
|
||||
|
||||
int cur_id = 1;
|
||||
int retval = 0;
|
||||
|
||||
//may as well stick that +1 on for convenience
|
||||
profession const** sorted_profs = new profession const*[profession::count()+1];
|
||||
for (profmap::const_iterator iter = profession::begin(); iter != profession::end(); ++iter)
|
||||
{
|
||||
profession const* prof = &(iter->second);
|
||||
sorted_profs[prof->id()] = prof;
|
||||
}
|
||||
|
||||
do
|
||||
{
|
||||
int netPointCost = sorted_profs[cur_id]->point_cost() - u->prof->point_cost();
|
||||
mvwprintz(w, 3, 2, c_ltgray, "Points left: %d ", points);
|
||||
// Clear the bottom of the screen.
|
||||
mvwprintz(w_description, 0, 0, c_ltgray, "\
|
||||
");
|
||||
mvwprintz(w_description, 1, 0, c_ltgray, "\
|
||||
");
|
||||
mvwprintz(w_description, 2, 0, c_ltgray, "\
|
||||
");
|
||||
mvwprintz(w, 3, 40, c_ltgray, " ");
|
||||
if (points >= netPointCost)
|
||||
{
|
||||
mvwprintz(w, 3, 20, c_green, "Profession %s costs %d points (net: %d)",
|
||||
sorted_profs[cur_id]->name().c_str(), sorted_profs[cur_id]->point_cost(),
|
||||
netPointCost);
|
||||
}
|
||||
else
|
||||
{
|
||||
mvwprintz(w, 3, 20, c_ltred, "Profession %s costs %d points (net: %d)",
|
||||
sorted_profs[cur_id]->name().c_str(), sorted_profs[cur_id]->point_cost(),
|
||||
netPointCost);
|
||||
}
|
||||
mvwprintz(w_description, 0, 0, c_green, sorted_profs[cur_id]->description().c_str());
|
||||
|
||||
for (int i = 1; i < 17; ++i)
|
||||
{
|
||||
mvwprintz(w, 4 + i, 2, c_ltgray, "\
|
||||
"); // Clear the line
|
||||
int id = i;
|
||||
if (cur_id < 7)
|
||||
{
|
||||
//do nothing
|
||||
}
|
||||
else if (cur_id >= profession::count() - 9)
|
||||
{
|
||||
id = profession::count() - 16 + i;
|
||||
}
|
||||
else
|
||||
{
|
||||
id += cur_id - 7;
|
||||
}
|
||||
|
||||
if (id > profession::count())
|
||||
{
|
||||
break;
|
||||
}
|
||||
|
||||
if (u->prof != sorted_profs[id])
|
||||
{
|
||||
mvwprintz(w, 4 + i, 2, (sorted_profs[id] == sorted_profs[cur_id] ? h_ltgray : c_ltgray),
|
||||
sorted_profs[id]->name().c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
mvwprintz(w, 4 + i, 2,
|
||||
(sorted_profs[id] == sorted_profs[cur_id] ? hilite(COL_SKILL_USED) : COL_SKILL_USED),
|
||||
sorted_profs[id]->name().c_str());
|
||||
}
|
||||
}
|
||||
|
||||
wrefresh(w);
|
||||
wrefresh(w_description);
|
||||
switch (input())
|
||||
{
|
||||
case 'j':
|
||||
if (cur_id < profession::count())
|
||||
cur_id++;
|
||||
break;
|
||||
|
||||
case 'k':
|
||||
if (cur_id > 1)
|
||||
cur_id--;
|
||||
break;
|
||||
|
||||
case '\n':
|
||||
if (netPointCost <= points) {
|
||||
u->prof = profession::prof(sorted_profs[cur_id]->ident()); // we've got a const*
|
||||
points -= netPointCost;
|
||||
}
|
||||
break;
|
||||
|
||||
case '<':
|
||||
retval = -1;
|
||||
break;
|
||||
|
||||
case '>':
|
||||
retval = 1;
|
||||
break;
|
||||
}
|
||||
} while (retval == 0);
|
||||
|
||||
delete[] sorted_profs;
|
||||
return retval;
|
||||
}
|
||||
|
||||
int set_skills(WINDOW* w, game* g, player *u, int &points)
|
||||
{
|
||||
draw_tabs(w, "SKILLS");
|
||||
|
||||
WINDOW* w_description = newwin(3, 78, 21 + getbegy(w), 1 + getbegx(w));
|
||||
|
||||
int cur_sk = 1;
|
||||
Skill *currentSkill = Skill::skill(cur_sk);
|
||||
@@ -720,72 +813,74 @@ int set_skills(WINDOW* w, player *u, int &points)
|
||||
do {
|
||||
mvwprintz(w, 3, 2, c_ltgray, "Points left: %d ", points);
|
||||
// Clear the bottom of the screen.
|
||||
mvwprintz(w, 22, 0, c_ltgray, "\
|
||||
mvwprintz(w_description, 0, 0, c_ltgray, "\
|
||||
");
|
||||
mvwprintz(w, 23, 0, c_ltgray, "\
|
||||
mvwprintz(w_description, 1, 0, c_ltgray, "\
|
||||
");
|
||||
mvwprintz(w, 24, 0, c_ltgray, "\
|
||||
mvwprintz(w_description, 2, 0, c_ltgray, "\
|
||||
");
|
||||
if (points >= u->skillLevel(currentSkill).level() + 1)
|
||||
mvwprintz(w, 3, 30, COL_SKILL_USED, "Upgrading %s costs %d points ",
|
||||
skill_name(cur_sk).c_str(), u->skillLevel(currentSkill).level() + 1);
|
||||
mvwprintz(w, 3, 40, c_ltgray, " ");
|
||||
if (points >= u->skillLevel(currentSkill) + 1)
|
||||
mvwprintz(w, 3, 30, COL_SKILL_USED, "Upgrading %s costs %d points",
|
||||
skill_name(cur_sk).c_str(), u->skillLevel(currentSkill) + 1);
|
||||
else
|
||||
mvwprintz(w, 3, 30, c_ltred, "Upgrading %s costs %d points ",
|
||||
skill_name(cur_sk).c_str(), u->skillLevel(currentSkill).level() + 1);
|
||||
mvwprintz(w, 22, 0, COL_SKILL_USED, currentSkill->description().c_str());
|
||||
mvwprintz(w, 3, 30, c_ltred, "Upgrading %s costs %d points",
|
||||
skill_name(cur_sk).c_str(), u->skillLevel(currentSkill) + 1);
|
||||
mvwprintz(w_description, 0, 0, COL_SKILL_USED, currentSkill->description().c_str());
|
||||
|
||||
if (cur_sk <= 7) {
|
||||
for (int i = 1; i < 17; i++) {
|
||||
Skill *thisSkill = Skill::skill(i);
|
||||
|
||||
mvwprintz(w, 4 + i, 0, c_ltgray, "\
|
||||
mvwprintz(w, 4 + i, 2, c_ltgray, "\
|
||||
"); // Clear the line
|
||||
if (u->skillLevel(thisSkill) == 0) {
|
||||
mvwprintz(w, 4 + i, 0, (i == cur_sk ? h_ltgray : c_ltgray),
|
||||
mvwprintz(w, 4 + i, 2, (i == cur_sk ? h_ltgray : c_ltgray),
|
||||
thisSkill->name().c_str());
|
||||
} else {
|
||||
mvwprintz(w, 4 + i, 0,
|
||||
mvwprintz(w, 4 + i, 2,
|
||||
(i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED),
|
||||
"%s ", skill_name(i).c_str());
|
||||
for (int j = 0; j < u->skillLevel(thisSkill).level(); j++)
|
||||
for (int j = 0; j < u->skillLevel(thisSkill); j++)
|
||||
wprintz(w, (i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED), "*");
|
||||
}
|
||||
}
|
||||
} else if (cur_sk >= Skill::skills.size() - 9) {
|
||||
for (int i = num_skill_types - 16; i < num_skill_types; i++) {
|
||||
Skill *thisSkill = Skill::skill(i);
|
||||
mvwprintz(w, 21 + i - num_skill_types, 0, c_ltgray, "\
|
||||
mvwprintz(w, 21 + i - num_skill_types, 2, c_ltgray, "\
|
||||
"); // Clear the line
|
||||
if (u->skillLevel(thisSkill) == 0) {
|
||||
mvwprintz(w, 21 + i - num_skill_types, 0,
|
||||
mvwprintz(w, 21 + i - num_skill_types, 2,
|
||||
(i == cur_sk ? h_ltgray : c_ltgray), thisSkill->name().c_str());
|
||||
} else {
|
||||
mvwprintz(w, 21 + i - num_skill_types, 0,
|
||||
mvwprintz(w, 21 + i - num_skill_types, 2,
|
||||
(i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED), "%s ",
|
||||
thisSkill->name().c_str());
|
||||
for (int j = 0; j < u->skillLevel(thisSkill).level(); j++)
|
||||
for (int j = 0; j < u->skillLevel(thisSkill); j++)
|
||||
wprintz(w, (i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED), "*");
|
||||
}
|
||||
}
|
||||
} else {
|
||||
for (int i = cur_sk - 7; i < cur_sk + 9; i++) {
|
||||
Skill *thisSkill = Skill::skill(i);
|
||||
mvwprintz(w, 12 + i - cur_sk, 0, c_ltgray, "\
|
||||
mvwprintz(w, 12 + i - cur_sk, 2, c_ltgray, "\
|
||||
"); // Clear the line
|
||||
if (u->skillLevel(thisSkill) == 0) {
|
||||
mvwprintz(w, 12 + i - cur_sk, 0, (i == cur_sk ? h_ltgray : c_ltgray),
|
||||
mvwprintz(w, 12 + i - cur_sk, 2, (i == cur_sk ? h_ltgray : c_ltgray),
|
||||
thisSkill->name().c_str());
|
||||
} else {
|
||||
mvwprintz(w, 12 + i - cur_sk, 0,
|
||||
mvwprintz(w, 12 + i - cur_sk, 2,
|
||||
(i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED),
|
||||
"%s ", thisSkill->name().c_str());
|
||||
for (int j = 0; j < u->skillLevel(thisSkill).level(); j++)
|
||||
for (int j = 0; j < u->skillLevel(thisSkill); j++)
|
||||
wprintz(w, (i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED), "*");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
wrefresh(w);
|
||||
wrefresh(w_description);
|
||||
switch (input()) {
|
||||
case 'j':
|
||||
if (cur_sk < Skill::skills.size() - 1)
|
||||
@@ -798,15 +893,15 @@ int set_skills(WINDOW* w, player *u, int &points)
|
||||
currentSkill = Skill::skill(cur_sk);
|
||||
break;
|
||||
case 'h':
|
||||
if (u->skillLevel(currentSkill).level()) {
|
||||
u->skillLevel(currentSkill).level(u->skillLevel(currentSkill).level() - 2);
|
||||
points += u->skillLevel(currentSkill).level() + 1;
|
||||
if (u->skillLevel(currentSkill)) {
|
||||
u->skillLevel(currentSkill).level(u->skillLevel(currentSkill) - 2);
|
||||
points += u->skillLevel(currentSkill) + 1;
|
||||
}
|
||||
break;
|
||||
case 'l':
|
||||
if (points >= u->skillLevel(currentSkill).level() + 1) {
|
||||
points -= u->skillLevel(currentSkill).level() + 1;
|
||||
u->skillLevel(currentSkill).level(u->skillLevel(currentSkill).level() + 2);
|
||||
if (points >= u->skillLevel(currentSkill) + 1) {
|
||||
points -= u->skillLevel(currentSkill) + 1;
|
||||
u->skillLevel(currentSkill).level(u->skillLevel(currentSkill) + 2);
|
||||
}
|
||||
break;
|
||||
case '<':
|
||||
@@ -817,27 +912,10 @@ int set_skills(WINDOW* w, player *u, int &points)
|
||||
} while (true);
|
||||
}
|
||||
|
||||
int set_description(WINDOW* w, player *u, int &points)
|
||||
int set_description(WINDOW* w, game* g, player *u, int &points)
|
||||
{
|
||||
// Draw horizontal lines, with a gap for the active tab
|
||||
for (int i = 0; i < 80; i++) {
|
||||
if (i < 57 || i > 73)
|
||||
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
|
||||
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
|
||||
}
|
||||
// Attaching lines for tabs
|
||||
mvwputch(w, 1,55, h_ltgray, '<');
|
||||
mvwputch(w, 1,75, h_ltgray, '>');
|
||||
mvwputch(w, 2, 4, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,14, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,21, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,32, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,39, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,50, c_ltgray, LINE_XXOX);
|
||||
mvwputch(w, 2,57, c_ltgray, LINE_XOOX);
|
||||
mvwputch(w, 2,73, c_ltgray, LINE_XXOO);
|
||||
mvwprintz(w,1,58, h_ltgray, " DESCRIPTION ");
|
||||
draw_tabs(w, "DESCRIPTION");
|
||||
|
||||
mvwprintz(w, 3, 2, c_ltgray, "Points left: %d ", points);
|
||||
|
||||
mvwprintz(w, 6, 2, c_ltgray, "\
|
||||
@@ -882,24 +960,25 @@ To save this character as a template, press !.");
|
||||
mvwprintz(w, 6, 8, c_ltgray, "______________________________");
|
||||
noname = false;
|
||||
}
|
||||
|
||||
|
||||
|
||||
if (ch == '>') {
|
||||
if (points > 0)
|
||||
mvwprintz(w, 3, 2, c_red, "\
|
||||
Points left: %d You must use the rest of your points!", points);
|
||||
else if (u->name.size() == 0) {
|
||||
if (points > 0 && !query_yn("Remaining points will be discarded, are you sure you want to proceed?")) {
|
||||
continue;
|
||||
} else if (u->name.size() == 0) {
|
||||
mvwprintz(w, 6, 8, h_ltgray, "______NO NAME ENTERED!!!!_____");
|
||||
noname = true;
|
||||
wrefresh(w);
|
||||
if (query_yn("Are you SURE you're finished? Your name will be randomly generated.")){
|
||||
if (!query_yn("Are you SURE you're finished? Your name will be randomly generated.")) {
|
||||
continue;
|
||||
} else {
|
||||
u->pick_name();
|
||||
return 1;
|
||||
}
|
||||
} else if (query_yn("Are you SURE you're finished?"))
|
||||
} else if (query_yn("Are you SURE you're finished?")) {
|
||||
return 1;
|
||||
else
|
||||
refresh();
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else if (ch == '<') {
|
||||
return -1;
|
||||
} else if (ch == '!') {
|
||||
|
||||
@@ -31,6 +31,7 @@ npc::npc()
|
||||
ity = -1;
|
||||
goalx = 999;
|
||||
goaly = 999;
|
||||
goalz = 999;
|
||||
fatigue = 0;
|
||||
hunger = 0;
|
||||
thirst = 0;
|
||||
@@ -52,7 +53,7 @@ npc::npc()
|
||||
sklevel[i] = 0;
|
||||
}
|
||||
|
||||
npc::npc(const npc &rhs) { *this = rhs; }
|
||||
npc::npc(const npc &rhs):player() { *this = rhs; }
|
||||
|
||||
npc::~npc() { }
|
||||
|
||||
@@ -79,6 +80,7 @@ npc& npc::operator= (const npc & rhs)
|
||||
ity = rhs.ity;
|
||||
goalx = rhs.goalx;
|
||||
goaly = rhs.goaly;
|
||||
goalz = rhs.goalz;
|
||||
|
||||
path = rhs.path;
|
||||
|
||||
@@ -156,7 +158,7 @@ std::string npc::save_info()
|
||||
|
||||
dump << styles.size() << " ";
|
||||
for (int i = 0; i < styles.size(); i++)
|
||||
dump << int(styles[i]) << " ";
|
||||
dump << itype_id(styles[i]) << " ";
|
||||
|
||||
dump << illness.size() << " ";
|
||||
for (int i = 0; i < illness.size(); i++)
|
||||
@@ -169,7 +171,7 @@ std::string npc::save_info()
|
||||
|
||||
dump << my_bionics.size() << " ";
|
||||
for (int i = 0; i < my_bionics.size(); i++)
|
||||
dump << int(my_bionics[i].id) << " " << my_bionics[i].invlet << " " <<
|
||||
dump << bionic_id(my_bionics[i].id) << " " << my_bionics[i].invlet << " " <<
|
||||
int(my_bionics[i].powered) << " " << my_bionics[i].charge << " ";
|
||||
|
||||
// NPC-specific stuff
|
||||
@@ -178,7 +180,7 @@ std::string npc::save_info()
|
||||
int(personality.altruism) << " " << wandx << " " << wandy << " " <<
|
||||
wandf << " " << omx << " " << omy << " " << omz << " " << mapx <<
|
||||
" " << mapy << " " << plx << " " << ply << " " << goalx << " " <<
|
||||
goaly << " " << int(mission) << " " << int(flags) << " ";
|
||||
goaly << " " << goalz << " " << int(mission) << " " << int(flags) << " ";
|
||||
if (my_fac == NULL)
|
||||
dump << -1;
|
||||
else
|
||||
@@ -246,16 +248,18 @@ void npc::load_info(game *g, std::string data)
|
||||
for (int i = 0; i < num_skill_types; i++)
|
||||
dump >> sklevel[i] >> skexercise[i];
|
||||
|
||||
int numill, numstyle;
|
||||
int typetmp;
|
||||
disease illtmp;
|
||||
itype_id tmpstyle;
|
||||
int numstyle;
|
||||
dump >> numstyle;
|
||||
for (int i = 0; i < numstyle; i++) {
|
||||
dump >> typetmp;
|
||||
styles.push_back(itype_id(typetmp));
|
||||
dump >> tmpstyle;
|
||||
styles.push_back(tmpstyle);
|
||||
}
|
||||
|
||||
int typetmp;
|
||||
int numill;
|
||||
dump >> numill;
|
||||
disease illtmp;
|
||||
for (int i = 0; i < numill; i++) {
|
||||
dump >> typetmp >> illtmp.duration;
|
||||
illtmp.type = dis_type(typetmp);
|
||||
@@ -269,18 +273,19 @@ void npc::load_info(game *g, std::string data)
|
||||
addtmp.type = add_type(typetmp);
|
||||
addictions.push_back(addtmp);
|
||||
}
|
||||
bionic_id tmpbionic;
|
||||
int numbio;
|
||||
bionic biotmp;
|
||||
dump >> numbio;
|
||||
for (int i = 0; i < numbio; i++) {
|
||||
dump >> typetmp >> biotmp.invlet >> biotmp.powered >> biotmp.charge;
|
||||
biotmp.id = bionic_id(typetmp);
|
||||
dump >> tmpbionic >> biotmp.invlet >> biotmp.powered >> biotmp.charge;
|
||||
biotmp.id = bionic_id(tmpbionic);
|
||||
my_bionics.push_back(biotmp);
|
||||
}
|
||||
// Special NPC stuff
|
||||
int misstmp, flagstmp, tmpatt, agg, bra, col, alt;
|
||||
dump >> agg >> bra >> col >> alt >> wandx >> wandy >> wandf >> omx >> omy >>
|
||||
omz >> mapx >> mapy >> plx >> ply >> goalx >> goaly >> misstmp >>
|
||||
omz >> mapx >> mapy >> plx >> ply >> goalx >> goaly >> goalz >> misstmp >>
|
||||
flagstmp >> fac_id >> tmpatt;
|
||||
personality.aggression = agg;
|
||||
personality.bravery = bra;
|
||||
@@ -302,8 +307,8 @@ void npc::randomize(game *g, npc_class type)
|
||||
dex_max = dice(4, 3);
|
||||
int_max = dice(4, 3);
|
||||
per_max = dice(4, 3);
|
||||
ret_null = item(g->itypes[0], 0);
|
||||
weapon = item(g->itypes[0], 0);
|
||||
ret_null = item(g->itypes["null"], 0);
|
||||
weapon = item(g->itypes["null"], 0);
|
||||
inv.clear();
|
||||
personality.aggression = rng(-10, 10);
|
||||
personality.bravery = rng( -3, 10);
|
||||
@@ -398,7 +403,7 @@ void npc::randomize(game *g, npc_class type)
|
||||
personality.bravery += rng(0, 3);
|
||||
personality.collector -= rng(1, 6);
|
||||
do
|
||||
styles.push_back( itype_id( rng(itm_style_karate, itm_style_zui_quan) ) );
|
||||
styles.push_back( martial_arts_itype_ids[rng(0, martial_arts_itype_ids.size()-1)] );
|
||||
while (one_in(2));
|
||||
break;
|
||||
|
||||
@@ -695,58 +700,58 @@ void npc::randomize_from_faction(game *g, faction *fac)
|
||||
std::vector<item> starting_clothes(npc_class type, bool male, game *g)
|
||||
{
|
||||
std::vector<item> ret;
|
||||
itype_id pants = itm_null, shoes = itm_null, shirt = itm_null,
|
||||
gloves = itm_null, coat = itm_null, mask = itm_null,
|
||||
glasses = itm_null, hat = itm_null;
|
||||
itype_id pants = "null", shoes = "null", shirt = "null",
|
||||
gloves = "null", coat = "null", mask = "null",
|
||||
glasses = "null", hat = "null";
|
||||
|
||||
switch(rng(0, (male ? 3 : 4))) {
|
||||
case 0: pants = itm_jeans; break;
|
||||
case 1: pants = itm_pants; break;
|
||||
case 2: pants = itm_pants_leather; break;
|
||||
case 3: pants = itm_pants_cargo; break;
|
||||
case 4: pants = itm_skirt; break;
|
||||
case 0: pants = "jeans"; break;
|
||||
case 1: pants = "pants"; break;
|
||||
case 2: pants = "pants_leather"; break;
|
||||
case 3: pants = "pants_cargo"; break;
|
||||
case 4: pants = "skirt"; break;
|
||||
}
|
||||
switch (rng(0, 3)) {
|
||||
case 0: shirt = itm_tshirt; break;
|
||||
case 1: shirt = itm_polo_shirt; break;
|
||||
case 2: shirt = itm_dress_shirt; break;
|
||||
case 3: shirt = itm_tank_top; break;
|
||||
case 0: shirt = "tshirt"; break;
|
||||
case 1: shirt = "polo_shirt"; break;
|
||||
case 2: shirt = "dress_shirt"; break;
|
||||
case 3: shirt = "tank_top"; break;
|
||||
}
|
||||
switch(rng(0, 10)) {
|
||||
case 8: gloves = itm_gloves_leather; break;
|
||||
case 9: gloves = itm_gloves_fingerless; break;
|
||||
case 10: gloves = itm_fire_gauntlets; break;
|
||||
case 8: gloves = "gloves_leather"; break;
|
||||
case 9: gloves = "gloves_fingerless"; break;
|
||||
case 10: gloves = "fire_gauntlets"; break;
|
||||
}
|
||||
switch (rng(0, 6)) {
|
||||
case 2: coat = itm_hoodie; break;
|
||||
case 3: coat = itm_jacket_light; break;
|
||||
case 4: coat = itm_jacket_jean; break;
|
||||
case 5: coat = itm_jacket_leather; break;
|
||||
case 6: coat = itm_trenchcoat; break;
|
||||
case 2: coat = "hoodie"; break;
|
||||
case 3: coat = "jacket_light"; break;
|
||||
case 4: coat = "jacket_jean"; break;
|
||||
case 5: coat = "jacket_leather"; break;
|
||||
case 6: coat = "trenchcoat"; break;
|
||||
}
|
||||
if (one_in(30))
|
||||
coat = itm_kevlar;
|
||||
shoes = itm_sneakers;
|
||||
mask = itm_null;
|
||||
coat = "kevlar";
|
||||
shoes = "sneakers";
|
||||
mask = "null";
|
||||
if (one_in(8)) {
|
||||
switch(rng(0, 2)) {
|
||||
case 0: mask = itm_mask_dust; break;
|
||||
case 1: mask = itm_bandana; break;
|
||||
case 2: mask = itm_mask_filter; break;
|
||||
case 0: mask = "mask_dust"; break;
|
||||
case 1: mask = "bandana"; break;
|
||||
case 2: mask = "mask_filter"; break;
|
||||
}
|
||||
}
|
||||
glasses = itm_null;
|
||||
glasses = "null";
|
||||
if (one_in(8))
|
||||
glasses = itm_glasses_safety;
|
||||
hat = itm_null;
|
||||
glasses = "glasses_safety";
|
||||
hat = "null";
|
||||
if (one_in(6)) {
|
||||
switch(rng(0, 5)) {
|
||||
case 0: hat = itm_hat_ball; break;
|
||||
case 1: hat = itm_hat_hunting; break;
|
||||
case 2: hat = itm_hat_hard; break;
|
||||
case 3: hat = itm_helmet_bike; break;
|
||||
case 4: hat = itm_helmet_riot; break;
|
||||
case 5: hat = itm_helmet_motor; break;
|
||||
case 0: hat = "hat_ball"; break;
|
||||
case 1: hat = "hat_hunting"; break;
|
||||
case 2: hat = "hat_hard"; break;
|
||||
case 3: hat = "helmet_bike"; break;
|
||||
case 4: hat = "helmet_riot"; break;
|
||||
case 5: hat = "helmet_motor"; break;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -754,101 +759,101 @@ std::vector<item> starting_clothes(npc_class type, bool male, game *g)
|
||||
switch (type) {
|
||||
case NC_DOCTOR:
|
||||
if (one_in(2))
|
||||
pants = itm_pants;
|
||||
pants = "pants";
|
||||
if (one_in(3))
|
||||
shirt = (one_in(2) ? itm_polo_shirt : itm_dress_shirt);
|
||||
shirt = (one_in(2) ? "polo_shirt" : "dress_shirt");
|
||||
if (!one_in(8))
|
||||
coat = itm_coat_lab;
|
||||
coat = "coat_lab";
|
||||
if (one_in(3))
|
||||
mask = itm_mask_dust;
|
||||
mask = "mask_dust";
|
||||
if (one_in(4))
|
||||
glasses = itm_glasses_safety;
|
||||
if (gloves != itm_null || one_in(3))
|
||||
gloves = itm_gloves_medical;
|
||||
glasses = "glasses_safety";
|
||||
if (gloves != "null" || one_in(3))
|
||||
gloves = "gloves_medical";
|
||||
break;
|
||||
|
||||
case NC_TRADER:
|
||||
if (one_in(2))
|
||||
pants = itm_pants_cargo;
|
||||
pants = "pants_cargo";
|
||||
switch (rng(0, 8)) {
|
||||
case 1: coat = itm_hoodie; break;
|
||||
case 2: coat = itm_jacket_jean; break;
|
||||
case 3: case 4: coat = itm_vest; break;
|
||||
case 5: case 6: case 7: case 8: coat = itm_trenchcoat; break;
|
||||
case 1: coat = "hoodie"; break;
|
||||
case 2: coat = "jacket_jean"; break;
|
||||
case 3: case 4: coat = "vest"; break;
|
||||
case 5: case 6: case 7: case 8: coat = "trenchcoat"; break;
|
||||
}
|
||||
break;
|
||||
|
||||
case NC_NINJA:
|
||||
if (one_in(4))
|
||||
shirt = itm_null;
|
||||
shirt = "null";
|
||||
else if (one_in(3))
|
||||
shirt = itm_tank_top;
|
||||
shirt = "tank_top";
|
||||
if (one_in(5))
|
||||
gloves = itm_gloves_leather;
|
||||
gloves = "gloves_leather";
|
||||
if (one_in(2))
|
||||
mask = itm_bandana;
|
||||
mask = "bandana";
|
||||
if (one_in(3))
|
||||
hat = itm_null;
|
||||
hat = "null";
|
||||
break;
|
||||
|
||||
case NC_COWBOY:
|
||||
if (one_in(2))
|
||||
shoes = itm_boots;
|
||||
shoes = "boots";
|
||||
if (one_in(2))
|
||||
pants = itm_jeans;
|
||||
pants = "jeans";
|
||||
if (one_in(3))
|
||||
shirt = itm_tshirt;
|
||||
shirt = "tshirt";
|
||||
if (one_in(4))
|
||||
gloves = itm_gloves_leather;
|
||||
gloves = "gloves_leather";
|
||||
if (one_in(4))
|
||||
coat = itm_jacket_jean;
|
||||
coat = "jacket_jean";
|
||||
if (one_in(3))
|
||||
hat = itm_hat_boonie;
|
||||
hat = "hat_boonie";
|
||||
break;
|
||||
|
||||
case NC_SCIENTIST:
|
||||
if (one_in(4))
|
||||
glasses = itm_glasses_eye;
|
||||
glasses = "glasses_eye";
|
||||
else if (one_in(2))
|
||||
glasses = itm_glasses_safety;
|
||||
glasses = "glasses_safety";
|
||||
if (one_in(5))
|
||||
coat = itm_coat_lab;
|
||||
coat = "coat_lab";
|
||||
break;
|
||||
|
||||
case NC_BOUNTY_HUNTER:
|
||||
if (one_in(3))
|
||||
pants = itm_pants_cargo;
|
||||
pants = "pants_cargo";
|
||||
if (one_in(2))
|
||||
shoes = itm_boots_steel;
|
||||
shoes = "boots_steel";
|
||||
if (one_in(4))
|
||||
coat = itm_jacket_leather;
|
||||
coat = "jacket_leather";
|
||||
if (one_in(4))
|
||||
mask = itm_mask_filter;
|
||||
mask = "mask_filter";
|
||||
if (one_in(5))
|
||||
glasses = itm_goggles_ski;
|
||||
glasses = "goggles_ski";
|
||||
if (one_in(3)) {
|
||||
mask = itm_null;
|
||||
hat = itm_helmet_motor;
|
||||
mask = "null";
|
||||
hat = "helmet_motor";
|
||||
}
|
||||
break;
|
||||
}
|
||||
// Fill in the standard things we wear
|
||||
if (shoes != itm_null)
|
||||
if (shoes != "null")
|
||||
ret.push_back(item(g->itypes[shoes], 0));
|
||||
if (pants != itm_null)
|
||||
if (pants != "null")
|
||||
ret.push_back(item(g->itypes[pants], 0));
|
||||
if (shirt != itm_null)
|
||||
if (shirt != "null")
|
||||
ret.push_back(item(g->itypes[shirt], 0));
|
||||
if (coat != itm_null)
|
||||
if (coat != "null")
|
||||
ret.push_back(item(g->itypes[coat], 0));
|
||||
if (gloves != itm_null)
|
||||
if (gloves != "null")
|
||||
ret.push_back(item(g->itypes[gloves], 0));
|
||||
// Bad to wear a mask under a motorcycle helmet
|
||||
if (mask != itm_null && hat != itm_helmet_motor)
|
||||
if (mask != "null" && hat != "helmet_motor")
|
||||
ret.push_back(item(g->itypes[mask], 0));
|
||||
if (glasses != itm_null)
|
||||
if (glasses != "null")
|
||||
ret.push_back(item(g->itypes[glasses], 0));
|
||||
if (hat != itm_null)
|
||||
if (hat != "null")
|
||||
ret.push_back(item(g->itypes[hat], 0));
|
||||
|
||||
// Second pass--for extra stuff like backpacks, etc
|
||||
@@ -857,16 +862,16 @@ std::vector<item> starting_clothes(npc_class type, bool male, game *g)
|
||||
case NC_DOCTOR:
|
||||
case NC_SCIENTIST:
|
||||
if (one_in(10))
|
||||
ret.push_back(item(g->itypes[itm_backpack], 0));
|
||||
ret.push_back(item(g->itypes["backpack"], 0));
|
||||
break;
|
||||
case NC_COWBOY:
|
||||
case NC_BOUNTY_HUNTER:
|
||||
if (one_in(2))
|
||||
ret.push_back(item(g->itypes[itm_backpack], 0));
|
||||
ret.push_back(item(g->itypes["backpack"], 0));
|
||||
break;
|
||||
case NC_TRADER:
|
||||
if (!one_in(15))
|
||||
ret.push_back(item(g->itypes[itm_backpack], 0));
|
||||
ret.push_back(item(g->itypes["backpack"], 0));
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -877,7 +882,7 @@ std::vector<item> starting_inv(npc *me, npc_class type, game *g)
|
||||
{
|
||||
int total_space = me->volume_capacity() - 2;
|
||||
std::vector<item> ret;
|
||||
ret.push_back( item(g->itypes[itm_lighter], 0) );
|
||||
ret.push_back( item(g->itypes["lighter"], 0) );
|
||||
itype_id tmp;
|
||||
|
||||
// First, if we're wielding a gun, get some ammo for it
|
||||
@@ -896,7 +901,7 @@ std::vector<item> starting_inv(npc *me, npc_class type, game *g)
|
||||
}
|
||||
if (type == NC_TRADER) { // Traders just have tons of random junk
|
||||
while (total_space > 0 && !one_in(50)) {
|
||||
tmp = itype_id(rng(2, num_items - 1));
|
||||
tmp = standard_itype_ids[rng(0,standard_itype_ids.size()-1)];
|
||||
if (total_space >= g->itypes[tmp]->volume) {
|
||||
ret.push_back(item(g->itypes[tmp], 0));
|
||||
ret[ret.size() - 1] = ret[ret.size() - 1].in_its_container(&g->itypes);
|
||||
@@ -938,7 +943,7 @@ std::vector<item> starting_inv(npc *me, npc_class type, game *g)
|
||||
// TODO: More specifics.
|
||||
|
||||
while (total_space > 0 && !one_in(8)) {
|
||||
tmp = itype_id(rng(4, num_items - 1));
|
||||
tmp = standard_itype_ids[rng(0, standard_itype_ids.size())];
|
||||
if (total_space >= g->itypes[tmp]->volume) {
|
||||
ret.push_back(item(g->itypes[tmp], 0));
|
||||
ret[ret.size() - 1] = ret[ret.size() - 1].in_its_container(&g->itypes);
|
||||
@@ -962,8 +967,8 @@ std::vector<item> starting_inv(npc *me, npc_class type, game *g)
|
||||
void npc::spawn_at(overmap *o, int x, int y)
|
||||
{
|
||||
// First, specify that we are in this overmap!
|
||||
omx = o->posx;
|
||||
omy = o->posy;
|
||||
omx = o->pos().x;
|
||||
omy = o->pos().y;
|
||||
mapx = x;
|
||||
mapy = y;
|
||||
if (x == -1 || y == -1) {
|
||||
@@ -978,6 +983,28 @@ void npc::spawn_at(overmap *o, int x, int y)
|
||||
}
|
||||
}
|
||||
|
||||
void npc::place_near(game *g, int potentialX, int potentialY)
|
||||
{
|
||||
//places the npc at the nearest empty spot near (potentialX, potentialY). Searches in a spiral pattern for a suitable location.
|
||||
int x = 0;
|
||||
int y = 0;
|
||||
int dx = 0;
|
||||
int dy = -1;
|
||||
int temp;
|
||||
while(!g->is_empty(potentialX + x, potentialY + y)) {
|
||||
if ((x == y) || ((x < 0) && (x == -y)) || ((x > 0) && (x == 1-y))) {//change direction
|
||||
temp = dx;
|
||||
dx = -dy;
|
||||
dy = temp;
|
||||
}
|
||||
x += dx;
|
||||
y += dy;
|
||||
}//end search, potentialX + x , potentialY + y contains a free spot.
|
||||
//place the npc at the free spot.
|
||||
posx = potentialX + x;
|
||||
posy = potentialY + y;
|
||||
}
|
||||
|
||||
skill npc::best_skill()
|
||||
{
|
||||
std::vector<int> best_skills;
|
||||
@@ -1005,22 +1032,22 @@ void npc::starting_weapon(game *g)
|
||||
switch (best) {
|
||||
case sk_bashing:
|
||||
switch (rng(0, 5)) {
|
||||
case 0: weapon.make(g->itypes[itm_hammer]); break;
|
||||
case 1: weapon.make(g->itypes[itm_wrench]); break;
|
||||
case 2: weapon.make(g->itypes[itm_hammer_sledge]); break;
|
||||
case 3: weapon.make(g->itypes[itm_pipe]); break;
|
||||
case 4: weapon.make(g->itypes[itm_bat]); break;
|
||||
case 5: weapon.make(g->itypes[itm_crowbar]); break;
|
||||
case 0: weapon.make(g->itypes["hammer"]); break;
|
||||
case 1: weapon.make(g->itypes["wrench"]); break;
|
||||
case 2: weapon.make(g->itypes["hammer_sledge"]); break;
|
||||
case 3: weapon.make(g->itypes["pipe"]); break;
|
||||
case 4: weapon.make(g->itypes["bat"]); break;
|
||||
case 5: weapon.make(g->itypes["crowbar"]); break;
|
||||
}
|
||||
break;
|
||||
case sk_cutting:
|
||||
switch (rng(0, 5)) {
|
||||
case 0: weapon.make(g->itypes[itm_knife_butcher]); break;
|
||||
case 1: weapon.make(g->itypes[itm_hatchet]); break;
|
||||
case 2: weapon.make(g->itypes[itm_ax]); break;
|
||||
case 3: weapon.make(g->itypes[itm_machete]); break;
|
||||
case 4: weapon.make(g->itypes[itm_knife_combat]); break;
|
||||
case 5: weapon.make(g->itypes[itm_katana]); break;
|
||||
case 0: weapon.make(g->itypes["knife_butcher"]); break;
|
||||
case 1: weapon.make(g->itypes["hatchet"]); break;
|
||||
case 2: weapon.make(g->itypes["ax"]); break;
|
||||
case 3: weapon.make(g->itypes["machete"]); break;
|
||||
case 4: weapon.make(g->itypes["knife_combat"]); break;
|
||||
case 5: weapon.make(g->itypes["katana"]); break;
|
||||
}
|
||||
break;
|
||||
case sk_throw:
|
||||
@@ -1270,7 +1297,7 @@ int npc::player_danger(player *u)
|
||||
ret += 8;
|
||||
} else if (u->weapon.type->melee_dam >= 12 || u->weapon.type->melee_cut >= 12)
|
||||
ret++;
|
||||
else if (u->weapon.type->id == 0) // Unarmed
|
||||
else if (u->weapon.type->id == "null") // Unarmed
|
||||
ret -= 3;
|
||||
|
||||
if (u->str_cur > 20) // Superhuman strength!
|
||||
@@ -1303,6 +1330,37 @@ int npc::player_danger(player *u)
|
||||
return ret;
|
||||
}
|
||||
|
||||
int npc::vehicle_danger(game *g, int radius)
|
||||
{
|
||||
VehicleList vehicles = g->m.get_vehicles(posx - radius, posy - radius, posx + radius, posy + radius);
|
||||
|
||||
int danger = 0;
|
||||
|
||||
// TODO: check for most dangerous vehicle?
|
||||
for(size_t i = 0; i < vehicles.size(); ++i)
|
||||
if (vehicles[i].v->velocity > 0)
|
||||
{
|
||||
float facing = vehicles[i].v->face.dir();
|
||||
|
||||
int ax = vehicles[i].v->global_x();
|
||||
int ay = vehicles[i].v->global_y();
|
||||
int bx = ax + cos (facing * M_PI / 180.0) * radius;
|
||||
int by = ay + sin (facing * M_PI / 180.0) * radius;
|
||||
|
||||
// fake size
|
||||
int last_part = vehicles[i].v->external_parts.back();
|
||||
int size = std::max(vehicles[i].v->parts[last_part].mount_dx, vehicles[i].v->parts[last_part].mount_dy);
|
||||
|
||||
float normal = sqrt((bx - ax) * (bx - ax) + (by - ay) * (by - ay));
|
||||
int closest = abs((posx - ax) * (by - ay) - (posy - ay) * (bx - ax)) / normal;
|
||||
|
||||
if (size > closest)
|
||||
danger = i;
|
||||
}
|
||||
|
||||
return danger;
|
||||
}
|
||||
|
||||
bool npc::turned_hostile()
|
||||
{
|
||||
return (op_of_u.anger >= hostile_anger_level());
|
||||
@@ -1402,7 +1460,7 @@ void npc::decide_needs()
|
||||
it_gun* gun = dynamic_cast<it_gun*>(weapon.type);
|
||||
needrank[need_ammo] = 5 * has_ammo(gun->ammo).size();
|
||||
}
|
||||
if (weapon.type->id == 0 && sklevel[sk_unarmed] < 4)
|
||||
if (weapon.type->id == "null" && sklevel[sk_unarmed] < 4)
|
||||
needrank[need_weapon] = 1;
|
||||
else
|
||||
needrank[need_weapon] = weapon.type->melee_dam + weapon.type->melee_cut +
|
||||
@@ -1473,7 +1531,7 @@ void npc::init_selling(std::vector<int> &indices, std::vector<int> &prices)
|
||||
int val, price;
|
||||
bool found_lighter = false;
|
||||
for (int i = 0; i < inv.size(); i++) {
|
||||
if (inv[i].type->id == itm_lighter && !found_lighter)
|
||||
if (inv[i].type->id == "lighter" && !found_lighter)
|
||||
found_lighter = true;
|
||||
else {
|
||||
val = value(inv[i]) - (inv[i].price() / 50);
|
||||
@@ -1576,8 +1634,8 @@ int npc::value(item &it)
|
||||
if (fac_has_job(FACJOB_DRUGS) && it.is_food() &&
|
||||
(dynamic_cast<it_comest*>(it.type))->addict >= 5)
|
||||
ret += 10;
|
||||
if (fac_has_job(FACJOB_DOCTORS) && it.type->id >= itm_bandages &&
|
||||
it.type->id <= itm_prozac)
|
||||
if (fac_has_job(FACJOB_DOCTORS) && it.type->id >= "bandages" &&
|
||||
it.type->id <= "prozac")
|
||||
ret += 10;
|
||||
if (fac_has_value(FACVAL_BOOKS) && it.is_book())
|
||||
ret += 14;
|
||||
@@ -1591,7 +1649,7 @@ int npc::value(item &it)
|
||||
bool npc::has_healing_item()
|
||||
{
|
||||
for (int i = 0; i < inv.size(); i++) {
|
||||
if (inv[i].type->id == itm_bandages || inv[i].type->id == itm_1st_aid)
|
||||
if (inv[i].type->id == "bandages" || inv[i].type->id == "1st_aid")
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1600,9 +1658,9 @@ bool npc::has_healing_item()
|
||||
bool npc::has_painkiller()
|
||||
{
|
||||
for (int i = 0; i < inv.size(); i++) {
|
||||
if ((pain <= 35 && inv[i].type->id == itm_aspirin) ||
|
||||
(pain >= 50 && inv[i].type->id == itm_oxycodone) ||
|
||||
inv[i].type->id == itm_tramadol || inv[i].type->id == itm_codeine)
|
||||
if ((pain <= 35 && inv[i].type->id == "aspirin") ||
|
||||
(pain >= 50 && inv[i].type->id == "oxycodone") ||
|
||||
inv[i].type->id == "tramadol" || inv[i].type->id == "codeine")
|
||||
return true;
|
||||
}
|
||||
return false;
|
||||
@@ -1817,7 +1875,7 @@ void npc::print_info(WINDOW* w)
|
||||
// because it's a border as well; so we have lines 6 through 11.
|
||||
// w is also 48 characters wide - 2 characters for border = 46 characters for us
|
||||
mvwprintz(w, 6, 1, c_white, "NPC: %s", name.c_str());
|
||||
mvwprintz(w, 7, 1, c_red, "Wielding %s%s", (weapon.type->id == 0 ? "" : "a "),
|
||||
mvwprintz(w, 7, 1, c_red, "Wielding %s%s", (weapon.type->id == "null" ? "" : "a "),
|
||||
weapon.tname().c_str());
|
||||
std::string wearing;
|
||||
std::stringstream wstr;
|
||||
@@ -1950,7 +2008,7 @@ void npc::die(game *g, bool your_fault)
|
||||
int j;
|
||||
if (g->u_see(posx, posy, j))
|
||||
g->add_msg("%s dies!", name.c_str());
|
||||
if (your_fault && !g->u.has_trait(PF_HEARTLESS)) {
|
||||
if (your_fault && !g->u.has_trait(PF_CANNIBAL)) {
|
||||
if (is_friend())
|
||||
g->u.add_morale(MORALE_KILLED_FRIEND, -500);
|
||||
else if (!is_enemy())
|
||||
@@ -1958,14 +2016,14 @@ void npc::die(game *g, bool your_fault)
|
||||
}
|
||||
|
||||
item my_body;
|
||||
my_body.make_corpse(g->itypes[itm_corpse], g->mtypes[mon_null], g->turn);
|
||||
my_body.make_corpse(g->itypes["corpse"], g->mtypes[mon_null], g->turn);
|
||||
my_body.name = name;
|
||||
g->m.add_item(posx, posy, my_body);
|
||||
for (int i = 0; i < inv.size(); i++)
|
||||
g->m.add_item(posx, posy, inv[i]);
|
||||
for (int i = 0; i < worn.size(); i++)
|
||||
g->m.add_item(posx, posy, worn[i]);
|
||||
if (weapon.type->id != itm_null)
|
||||
if (weapon.type->id != "null")
|
||||
g->m.add_item(posx, posy, weapon);
|
||||
|
||||
for (int i = 0; i < g->active_missions.size(); i++) {
|
||||
|
||||
@@ -62,6 +62,9 @@ enum npc_mission {
|
||||
|
||||
NPC_MISSION_MISSING, // Special; following player to finish mission
|
||||
NPC_MISSION_KIDNAPPED, // Special; was kidnapped, to be rescued by player
|
||||
|
||||
NPC_MISSION_BASE, // Base Mission: unassigned
|
||||
|
||||
NUM_NPC_MISSIONS
|
||||
};
|
||||
|
||||
@@ -90,9 +93,10 @@ enum npc_action {
|
||||
npc_escape_item, npc_wield_melee, npc_wield_loaded_gun, npc_wield_empty_gun,
|
||||
npc_heal, npc_use_painkiller, npc_eat, npc_drop_items, // 5 - 12
|
||||
npc_flee, npc_melee, npc_shoot, npc_shoot_burst, npc_alt_attack, // 13 - 17
|
||||
npc_look_for_player, npc_heal_player, npc_follow_player, npc_talk_to_player,
|
||||
npc_mug_player, // 18 - 22
|
||||
npc_goto_destination, npc_avoid_friendly_fire, // 23, 24
|
||||
npc_look_for_player, npc_heal_player, npc_follow_player, npc_follow_embarked,
|
||||
npc_talk_to_player, npc_mug_player, // 18 - 23
|
||||
npc_goto_destination, npc_avoid_friendly_fire, // 24, 25
|
||||
npc_base_idle, // 26
|
||||
num_npc_actions
|
||||
};
|
||||
|
||||
@@ -132,7 +136,7 @@ struct npc_favor
|
||||
npc_favor() {
|
||||
type = FAVOR_NULL;
|
||||
value = 0;
|
||||
item_id = itm_null;
|
||||
item_id = "null";
|
||||
skill = NULL;
|
||||
};
|
||||
|
||||
@@ -231,11 +235,12 @@ struct npc_opinion
|
||||
int tmpsize;
|
||||
info >> trust >> fear >> value >> anger >> owed >> tmpsize;
|
||||
for (int i = 0; i < tmpsize; i++) {
|
||||
int tmptype, tmpitem, tmpskill;
|
||||
int tmptype, tmpskill;
|
||||
std::string tmpitem;
|
||||
npc_favor tmpfavor;
|
||||
info >> tmptype >> tmpfavor.value >> tmpitem >> tmpskill;
|
||||
tmpfavor.type = npc_favor_type(tmptype);
|
||||
tmpfavor.item_id = itype_id(tmpitem);
|
||||
tmpfavor.item_id = tmpitem;
|
||||
tmpfavor.skill = Skill::skill(tmpskill);
|
||||
favors.push_back(tmpfavor);
|
||||
}
|
||||
@@ -255,25 +260,27 @@ struct npc_combat_rules
|
||||
combat_engagement engagement;
|
||||
bool use_guns;
|
||||
bool use_grenades;
|
||||
bool use_silent;
|
||||
|
||||
npc_combat_rules()
|
||||
{
|
||||
engagement = ENGAGE_ALL;
|
||||
use_guns = true;
|
||||
use_grenades = true;
|
||||
use_silent = false;
|
||||
};
|
||||
|
||||
std::string save_info()
|
||||
{
|
||||
std::stringstream dump;
|
||||
dump << engagement << " " << use_guns << " " << use_grenades << " ";
|
||||
dump << engagement << " " << use_guns << " " << use_grenades << " " << use_silent;
|
||||
return dump.str();
|
||||
}
|
||||
|
||||
void load_info(std::istream &data)
|
||||
{
|
||||
int tmpen;
|
||||
data >> tmpen >> use_guns >> use_grenades;
|
||||
data >> tmpen >> use_guns >> use_grenades >> use_silent;
|
||||
engagement = combat_engagement(tmpen);
|
||||
}
|
||||
};
|
||||
@@ -405,6 +412,7 @@ public:
|
||||
void randomize(game *g, npc_class type = NC_NONE);
|
||||
void randomize_from_faction(game *g, faction *fac);
|
||||
void spawn_at(overmap *o, int posx, int posy);
|
||||
void place_near(game *g, int potentialX, int potentialY);
|
||||
skill best_skill();
|
||||
void starting_weapon(game *g);
|
||||
|
||||
@@ -431,6 +439,7 @@ public:
|
||||
void form_opinion(player *u);
|
||||
talk_topic pick_talk_topic(player *u);
|
||||
int player_danger(player *u); // Comparable to monsters
|
||||
int vehicle_danger(game *g, int radius);
|
||||
bool turned_hostile(); // True if our anger is at least equal to...
|
||||
int hostile_anger_level(); // ... this value!
|
||||
void make_angry(); // Called if the player attacks us
|
||||
@@ -497,7 +506,7 @@ public:
|
||||
// Functions which choose an action for a particular goal
|
||||
void choose_monster_target(game *g, int &enemy, int &danger,
|
||||
int &total_danger);
|
||||
npc_action method_of_fleeing (game *g, int enemy);
|
||||
npc_action method_of_fleeing (game *g, int target);
|
||||
npc_action method_of_attack (game *g, int enemy, int danger);
|
||||
npc_action address_needs (game *g, int danger);
|
||||
npc_action address_player (game *g);
|
||||
@@ -562,7 +571,7 @@ public:
|
||||
int mapx, mapy;// Which square in that overmap (e.g., m.0.0)
|
||||
int plx, ply, plt;// Where we last saw the player, timeout to forgetting
|
||||
int itx, ity; // The square containing an item we want
|
||||
int goalx, goaly;// Which mapx:mapy square we want to get to
|
||||
int goalx, goaly, goalz;// Which mapx:mapy square we want to get to
|
||||
|
||||
bool fetching_item;
|
||||
bool has_new_items; // If true, we have something new and should re-equip
|
||||
|
||||
+126
-42
@@ -12,9 +12,9 @@
|
||||
#ifndef NUM_ESCAPE_ITEMS
|
||||
#define NUM_ESCAPE_ITEMS 11
|
||||
itype_id ESCAPE_ITEMS[NUM_ESCAPE_ITEMS] = {
|
||||
itm_cola, itm_caffeine, itm_energy_drink, itm_canister_goo, itm_smokebomb,
|
||||
itm_smokebomb_act, itm_adderall, itm_coke, itm_meth, itm_teleporter,
|
||||
itm_pheromone
|
||||
"cola", "caffeine", "energy_drink", "canister_goo", "smokebomb",
|
||||
"smokebomb_act", "adderall", "coke", "meth", "teleporter",
|
||||
"pheromone"
|
||||
};
|
||||
#endif
|
||||
|
||||
@@ -22,13 +22,15 @@ itype_id ESCAPE_ITEMS[NUM_ESCAPE_ITEMS] = {
|
||||
#ifndef NUM_ALT_ATTACK_ITEMS
|
||||
#define NUM_ALT_ATTACK_ITEMS 16
|
||||
itype_id ALT_ATTACK_ITEMS[NUM_ALT_ATTACK_ITEMS] = {
|
||||
itm_knife_combat, itm_spear_wood, itm_molotov, itm_pipebomb, itm_grenade,
|
||||
itm_gasbomb, itm_bot_manhack, itm_tazer, itm_dynamite, itm_mininuke,
|
||||
itm_molotov_lit, itm_pipebomb_act, itm_grenade_act, itm_gasbomb_act,
|
||||
itm_dynamite_act, itm_mininuke_act
|
||||
"knife_combat", "spear_wood", "molotov", "pipebomb", "grenade",
|
||||
"gasbomb", "bot_manhack", "tazer", "dynamite", "mininuke",
|
||||
"molotov_lit", "pipebomb_act", "grenade_act", "gasbomb_act",
|
||||
"dynamite_act", "mininuke_act"
|
||||
};
|
||||
#endif
|
||||
|
||||
const int avoidance_vehicles_radius = 5;
|
||||
|
||||
std::string npc_action_name(npc_action action);
|
||||
bool thrown_item(item *used);
|
||||
|
||||
@@ -63,7 +65,20 @@ void npc::move(game *g)
|
||||
}
|
||||
// TODO: Place player-aiding actions here, with a weight
|
||||
|
||||
/* NPCs are fairly suicidal so at this point we will do a quick check to see if
|
||||
* something nasty is going to happen.
|
||||
*/
|
||||
|
||||
int vehicle = vehicle_danger(g, avoidance_vehicles_radius);
|
||||
if (vehicle) {
|
||||
// TODO: Think about how this actually needs to work, for now assume flee from player
|
||||
target = TARGET_PLAYER;
|
||||
}
|
||||
|
||||
// TODO: morale breaking when surrounded by hostiles
|
||||
//if (!bravery_check(danger) || !bravery_check(total_danger) ||
|
||||
// TODO: near by active explosives spotted
|
||||
|
||||
if (target == TARGET_PLAYER && attitude == NPCATT_FLEE)
|
||||
action = method_of_fleeing(g, target);
|
||||
else if (danger > 0 || (target == TARGET_PLAYER && attitude == NPCATT_KILL))
|
||||
@@ -86,7 +101,10 @@ void npc::move(game *g)
|
||||
find_item(g);
|
||||
if (g->debugmon)
|
||||
debugmsg("find_item %s", npc_action_name(action).c_str());
|
||||
if (fetching_item) // Set to true if find_item() found something
|
||||
// check if in vehicle before rushing off to fetch things
|
||||
if (is_following() && g->u.in_vehicle)
|
||||
action = npc_follow_embarked;
|
||||
else if (fetching_item) // Set to true if find_item() found something
|
||||
action = npc_pickup;
|
||||
else if (is_following()) // No items, so follow the player?
|
||||
action = npc_follow_player;
|
||||
@@ -100,9 +118,15 @@ void npc::move(game *g)
|
||||
/* Sometimes we'll be following the player at this point, but close enough that
|
||||
* "following" means standing still. If that's the case, if there are any
|
||||
* monsters around, we should attack them after all!
|
||||
*
|
||||
* If we are following a embarked player and we are in a vehicle then shoot anyway
|
||||
* as we are most likely riding shotgun
|
||||
*/
|
||||
if (action == npc_follow_player && danger > 0 &&
|
||||
rl_dist(posx, posy, g->u.posx, g->u.posy) <= follow_distance())
|
||||
if (danger > 0 && (
|
||||
(action == npc_follow_embarked && in_vehicle) ||
|
||||
(action == npc_follow_player &&
|
||||
rl_dist(posx, posy, g->u.posx, g->u.posy) <= follow_distance())
|
||||
))
|
||||
action = method_of_attack(g, target, danger);
|
||||
|
||||
if (g->debugmon)
|
||||
@@ -289,6 +313,39 @@ void npc::execute_action(game *g, npc_action action, int target)
|
||||
move_pause();
|
||||
break;
|
||||
|
||||
case npc_follow_embarked:
|
||||
if (in_vehicle)
|
||||
move_pause();
|
||||
else {
|
||||
int p1;
|
||||
vehicle *veh = g->m.veh_at(g->u.posx, g->u.posy, p1);
|
||||
|
||||
if (!veh) {
|
||||
debugmsg("Following an embarked player with no vehicle at their location?");
|
||||
// TODO: change to wait? - for now pause
|
||||
move_pause();
|
||||
} else {
|
||||
int p2 = veh->free_seat();
|
||||
if (p2 < 0) {
|
||||
// TODO: be angry at player, switch to wait or leave - for now pause
|
||||
move_pause();
|
||||
} else {
|
||||
int px = veh->global_x() + veh->parts[p2].precalc_dx[0];
|
||||
int py = veh->global_y() + veh->parts[p2].precalc_dy[0];
|
||||
update_path(g, px, py);
|
||||
|
||||
// TODO: replace extra hop distance with finding the correct door
|
||||
// Hop in the last few squares is mostly to avoid player clash
|
||||
if (path.size() <= 2) {
|
||||
g->m.board_vehicle(g, px, py, this);
|
||||
move_pause();
|
||||
} else
|
||||
move_to_next(g);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case npc_talk_to_player:
|
||||
talk_to_u(g);
|
||||
moves = 0;
|
||||
@@ -312,6 +369,11 @@ void npc::execute_action(game *g, npc_action action, int target)
|
||||
avoid_friendly_fire(g, target);
|
||||
break;
|
||||
|
||||
case npc_base_idle:
|
||||
// TODO: patrol or sleep or something?
|
||||
move_pause();
|
||||
break;
|
||||
|
||||
default:
|
||||
debugmsg("Unknown NPC action (%d)", action);
|
||||
}
|
||||
@@ -349,7 +411,7 @@ void npc::choose_monster_target(game *g, int &enemy, int &danger,
|
||||
priority -= 10;
|
||||
monster_danger -= 10;
|
||||
} else
|
||||
priority *= 1 + (.1 * distance);
|
||||
priority *= 1 + (.1 *use_escape_item distance);
|
||||
*/
|
||||
total_danger += int(monster_danger / (distance == 0 ? 1 : distance));
|
||||
|
||||
@@ -421,6 +483,7 @@ npc_action npc::method_of_attack(game *g, int target, int danger)
|
||||
{
|
||||
int tarx = posx, tary = posy;
|
||||
bool can_use_gun = (!is_following() || combat_rules.use_guns);
|
||||
bool use_silent = (is_following() && combat_rules.use_silent);
|
||||
|
||||
if (target == TARGET_PLAYER) {
|
||||
tarx = g->u.posx;
|
||||
@@ -444,16 +507,24 @@ npc_action npc::method_of_attack(game *g, int target, int danger)
|
||||
return npc_reload;
|
||||
if (emergency(danger_assessment(g)) && alt_attack_available(g))
|
||||
return npc_alt_attack;
|
||||
if (weapon.is_gun() && weapon.charges > 0) {
|
||||
if (weapon.is_gun() && (!use_silent || weapon.is_silent()) && weapon.charges > 0) {
|
||||
it_gun* gun = dynamic_cast<it_gun*>(weapon.type);
|
||||
if (dist > confident_range()) {
|
||||
if (can_reload() && enough_time_to_reload(g, target, weapon))
|
||||
if (can_reload() && (enough_time_to_reload(g, target, weapon) || in_vehicle))
|
||||
return npc_reload;
|
||||
else if (in_vehicle && dist > 1)
|
||||
return npc_pause;
|
||||
else
|
||||
return npc_melee;
|
||||
}
|
||||
if (!wont_hit_friend(g, tarx, tary))
|
||||
return npc_avoid_friendly_fire;
|
||||
if (in_vehicle)
|
||||
if (can_reload())
|
||||
return npc_reload;
|
||||
else
|
||||
return npc_pause; // wait for clear shot
|
||||
else
|
||||
return npc_avoid_friendly_fire;
|
||||
else if (dist <= confident_range() / 3 && weapon.charges >= gun->burst &&
|
||||
gun->burst > 1 &&
|
||||
((weapon.curammo && target_HP >= weapon.curammo->damage * 3) || emergency(danger * 2)))
|
||||
@@ -467,10 +538,10 @@ npc_action npc::method_of_attack(game *g, int target, int danger)
|
||||
bool has_empty_gun = false, has_better_melee = false;
|
||||
std::vector<int> empty_guns;
|
||||
for (int i = 0; i < inv.size(); i++) {
|
||||
if (can_use_gun && inv[i].is_gun() && inv[i].charges > 0)
|
||||
bool allowed = can_use_gun && inv[i].is_gun() && (!use_silent || weapon.is_silent());
|
||||
if (allowed && inv[i].charges > 0)
|
||||
return npc_wield_loaded_gun;
|
||||
else if (can_use_gun && inv[i].is_gun() &&
|
||||
enough_time_to_reload(g, target, inv[i])) {
|
||||
else if (allowed && enough_time_to_reload(g, target, inv[i])) {
|
||||
has_empty_gun = true;
|
||||
empty_guns.push_back(i);
|
||||
} else if (inv[i].melee_value(sklevel) > weapon.melee_value(sklevel) * 1.1)
|
||||
@@ -491,6 +562,8 @@ npc_action npc::method_of_attack(game *g, int target, int danger)
|
||||
else if (has_better_melee)
|
||||
return npc_wield_melee;
|
||||
|
||||
if (in_vehicle && dist > 1)
|
||||
return npc_pause;
|
||||
return npc_melee;
|
||||
}
|
||||
|
||||
@@ -597,6 +670,8 @@ npc_action npc::long_term_goal_action(game *g)
|
||||
|
||||
// TODO: Follow / look for player
|
||||
|
||||
if (mission == NPC_MISSION_BASE)
|
||||
return npc_base_idle;
|
||||
|
||||
if (!has_destination())
|
||||
set_destination(g);
|
||||
@@ -692,13 +767,13 @@ int npc::confident_range(int index)
|
||||
// See game::fire (ranged.cpp) for where these computations come from
|
||||
|
||||
if (skillLevel(firing->skill_used) < 5)
|
||||
deviation += 3.5 * (5 - skillLevel(firing->skill_used).level());
|
||||
deviation += 3.5 * (5 - skillLevel(firing->skill_used));
|
||||
else
|
||||
deviation -= 2.5 * (skillLevel(firing->skill_used).level() - 5);
|
||||
deviation -= 2.5 * (skillLevel(firing->skill_used) - 5);
|
||||
if (sklevel[sk_gun] < 3)
|
||||
deviation += 1.5 * (3 - skillLevel("gun").level());
|
||||
deviation += 1.5 * (3 - skillLevel("gun"));
|
||||
else
|
||||
deviation -= .5 * (skillLevel("gun").level() - 3);
|
||||
deviation -= .5 * (skillLevel("gun") - 3);
|
||||
|
||||
if (per_cur < 8)
|
||||
deviation += 2 * (9 - per_cur);
|
||||
@@ -862,6 +937,11 @@ bool npc::can_move_to(game *g, int x, int y)
|
||||
|
||||
void npc::move_to(game *g, int x, int y)
|
||||
{
|
||||
if (in_vehicle) {
|
||||
// TODO: handle this nicely - npcs should not jump from moving vehicles
|
||||
g->m.unboard_vehicle(g, posx, posy);
|
||||
}
|
||||
|
||||
if (has_disease(DI_DOWNED)) {
|
||||
moves -= 100;
|
||||
return;
|
||||
@@ -1318,15 +1398,17 @@ void npc::drop_items(game *g, int weight, int volume)
|
||||
|
||||
npc_action npc::scan_new_items(game *g, int target)
|
||||
{
|
||||
bool can_use_gun = (!is_following() || combat_rules.use_guns);
|
||||
bool can_use_gun = (!is_following() || combat_rules.use_guns);
|
||||
bool use_silent = (is_following() && combat_rules.use_silent);
|
||||
|
||||
// Check if there's something better to wield
|
||||
bool has_empty_gun = false, has_better_melee = false;
|
||||
std::vector<int> empty_guns;
|
||||
for (int i = 0; i < inv.size(); i++) {
|
||||
if (can_use_gun && inv[i].is_gun() && inv[i].charges > 0)
|
||||
bool allowed = can_use_gun && inv[i].is_gun() && (!use_silent || inv[i].is_silent());
|
||||
if (allowed && inv[i].charges > 0)
|
||||
return npc_wield_loaded_gun;
|
||||
else if (can_use_gun && inv[i].is_gun() &&
|
||||
enough_time_to_reload(g, target, inv[i])) {
|
||||
else if (allowed && enough_time_to_reload(g, target, inv[i])) {
|
||||
has_empty_gun = true;
|
||||
empty_guns.push_back(i);
|
||||
} else if (inv[i].melee_value(sklevel) > weapon.melee_value(sklevel) * 1.1)
|
||||
@@ -1389,7 +1471,7 @@ void npc::wield_best_melee(game *g)
|
||||
|
||||
void npc::alt_attack(game *g, int target)
|
||||
{
|
||||
itype_id which = itm_null;
|
||||
itype_id which = "null";
|
||||
int tarx, tary;
|
||||
if (target == TARGET_PLAYER) {
|
||||
tarx = g->u.posx;
|
||||
@@ -1414,7 +1496,7 @@ void npc::alt_attack(game *g, int target)
|
||||
which = ALT_ATTACK_ITEMS[i];
|
||||
}
|
||||
|
||||
if (which == itm_null) { // We ain't got shit!
|
||||
if (which == "null") { // We ain't got shit!
|
||||
// Not sure if this should ever occur. For now, let's warn with a debug msg
|
||||
debugmsg("npc::alt_attack() couldn't find an alt attack item!");
|
||||
if (dist == 1) {
|
||||
@@ -1540,7 +1622,7 @@ bool thrown_item(item *used)
|
||||
return false;
|
||||
}
|
||||
itype_id type = itype_id(used->type->id);
|
||||
return (used->active || type == itm_knife_combat || type == itm_spear_wood);
|
||||
return (used->active || type == "knife_combat" || type == "spear_wood");
|
||||
}
|
||||
|
||||
void npc::heal_player(game *g, player &patient)
|
||||
@@ -1584,20 +1666,20 @@ void npc::heal_player(game *g, player &patient)
|
||||
g->add_msg("Someone heals you.");
|
||||
|
||||
int amount_healed;
|
||||
if (has_amount(itm_1st_aid, 1)) {
|
||||
if (has_amount("1st_aid", 1)) {
|
||||
switch (worst) {
|
||||
case hp_head: amount_healed = 10 + 1.6 * sklevel[sk_firstaid]; break;
|
||||
case hp_torso: amount_healed = 20 + 3 * sklevel[sk_firstaid]; break;
|
||||
default: amount_healed = 15 + 2 * sklevel[sk_firstaid];
|
||||
}
|
||||
use_charges(itm_1st_aid, 1);
|
||||
} else if (has_amount(itm_bandages, 1)) {
|
||||
use_charges("1st_aid", 1);
|
||||
} else if (has_amount("bandages", 1)) {
|
||||
switch (worst) {
|
||||
case hp_head: amount_healed = 1 + 1.6 * sklevel[sk_firstaid]; break;
|
||||
case hp_torso: amount_healed = 4 + 3 * sklevel[sk_firstaid]; break;
|
||||
default: amount_healed = 3 + 2 * sklevel[sk_firstaid];
|
||||
}
|
||||
use_charges(itm_bandages, 1);
|
||||
use_charges("bandages", 1);
|
||||
}
|
||||
patient.heal(worst, amount_healed);
|
||||
moves -= 250;
|
||||
@@ -1634,20 +1716,20 @@ void npc::heal_self(game *g)
|
||||
}
|
||||
|
||||
int amount_healed;
|
||||
if (has_amount(itm_1st_aid, 1)) {
|
||||
if (has_amount("1st_aid", 1)) {
|
||||
switch (worst) {
|
||||
case hp_head: amount_healed = 10 + 1.6 * sklevel[sk_firstaid]; break;
|
||||
case hp_torso: amount_healed = 20 + 3 * sklevel[sk_firstaid]; break;
|
||||
default: amount_healed = 15 + 2 * sklevel[sk_firstaid];
|
||||
}
|
||||
use_charges(itm_1st_aid, 1);
|
||||
} else if (has_amount(itm_bandages, 1)) {
|
||||
use_charges("1st_aid", 1);
|
||||
} else if (has_amount("bandages", 1)) {
|
||||
switch (worst) {
|
||||
case hp_head: amount_healed = 1 + 1.6 * sklevel[sk_firstaid]; break;
|
||||
case hp_torso: amount_healed = 4 + 3 * sklevel[sk_firstaid]; break;
|
||||
default: amount_healed = 3 + 2 * sklevel[sk_firstaid];
|
||||
}
|
||||
use_charges(itm_bandages, 1);
|
||||
use_charges("bandages", 1);
|
||||
} else {
|
||||
debugmsg("NPC tried to heal self, but has no bandages / first aid");
|
||||
move_pause();
|
||||
@@ -1665,15 +1747,15 @@ void npc::use_painkiller(game *g)
|
||||
int difference = 9999, index = -1;
|
||||
for (int i = 0; i < inv.size(); i++) {
|
||||
int diff = 9999;
|
||||
if (inv[i].type->id == itm_aspirin)
|
||||
if (inv[i].type->id == "aspirin")
|
||||
diff = abs(pain - 15);
|
||||
else if (inv[i].type->id == itm_codeine)
|
||||
else if (inv[i].type->id == "codeine")
|
||||
diff = abs(pain - 30);
|
||||
else if (inv[i].type->id == itm_oxycodone)
|
||||
else if (inv[i].type->id == "oxycodone")
|
||||
diff = abs(pain - 60);
|
||||
else if (inv[i].type->id == itm_heroin)
|
||||
else if (inv[i].type->id == "heroin")
|
||||
diff = abs(pain - 100);
|
||||
else if (inv[i].type->id == itm_tramadol)
|
||||
else if (inv[i].type->id == "tramadol")
|
||||
diff = abs(pain - 40) / 2; // Bonus since it's long-acting
|
||||
|
||||
if (diff < difference) {
|
||||
@@ -1885,7 +1967,7 @@ void npc::set_destination(game *g)
|
||||
|
||||
// all of the following luxuries are at ground level.
|
||||
// so please wallow in hunger & fear if below ground.
|
||||
if(g->cur_om.posz != 0){
|
||||
if(g->levz != 0){
|
||||
goalx = -1;
|
||||
goaly = -1;
|
||||
return;
|
||||
@@ -1924,6 +2006,7 @@ void npc::set_destination(game *g)
|
||||
point p = g->cur_om.find_closest(point(mapx, mapy),dest_type,4, dist, false);
|
||||
goalx = p.x;
|
||||
goaly = p.y;
|
||||
goalz = g->levz;
|
||||
}
|
||||
|
||||
void npc::go_to_destination(game *g)
|
||||
@@ -1987,6 +2070,7 @@ std::string npc_action_name(npc_action action)
|
||||
case npc_look_for_player: return "Look for player";
|
||||
case npc_heal_player: return "Heal player";
|
||||
case npc_follow_player: return "Follow player";
|
||||
case npc_follow_embarked: return "Follow player (embarked)";
|
||||
case npc_talk_to_player: return "Talk to player";
|
||||
case npc_mug_player: return "Mug player";
|
||||
case npc_goto_destination: return "Go to destination";
|
||||
|
||||
+70
-16
@@ -5,6 +5,7 @@
|
||||
#include "rng.h"
|
||||
#include "line.h"
|
||||
#include "keypress.h"
|
||||
#include "debug.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
@@ -41,6 +42,8 @@
|
||||
|
||||
#define SUCCESS_MISSION(type) ret.back().miss = type
|
||||
|
||||
#define dbg(x) dout((DebugLevel)(x),D_GAME) << __FILE__ << ":" << __LINE__ << ": "
|
||||
|
||||
std::string dynamic_line(talk_topic topic, game *g, npc *p);
|
||||
std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p);
|
||||
int topic_category(talk_topic topic);
|
||||
@@ -103,7 +106,7 @@ void npc::talk_to_u(game *g)
|
||||
moves -= 100;
|
||||
decide_needs();
|
||||
|
||||
d.win = newwin(25, 80, 0, 0);
|
||||
d.win = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
wborder(d.win, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
for (int i = 1; i < 24; i++)
|
||||
@@ -233,7 +236,7 @@ std::string dynamic_line(talk_topic topic, game *g, npc *p)
|
||||
} break;
|
||||
|
||||
case TALK_TRAIN_START:
|
||||
if (g->cur_om.is_safe(g->om_location().x, g->om_location().y))
|
||||
if (g->cur_om.is_safe(g->om_location().x, g->om_location().y, g->levz))
|
||||
return "Alright, let's begin.";
|
||||
else
|
||||
return "It's not safe here. Let's get to safety first.";
|
||||
@@ -297,7 +300,8 @@ std::string dynamic_line(talk_topic topic, game *g, npc *p)
|
||||
case ENGAGE_ALL: status << "engaging all enemies."; break;
|
||||
}
|
||||
status << " " << (p->male ? "He" : "She") << " will " <<
|
||||
(p->combat_rules.use_guns ? "" : "not ") << "use firearms.";
|
||||
(p->combat_rules.use_guns ? (p->combat_rules.use_silent ? "use silenced" : "use")
|
||||
: "not use") << " firearms";
|
||||
status << " " << (p->male ? "He" : "She") << " will " <<
|
||||
(p->combat_rules.use_grenades ? "" : "not ") << "use grenades.";
|
||||
|
||||
@@ -347,8 +351,12 @@ std::string dynamic_line(talk_topic topic, game *g, npc *p)
|
||||
return "Well, I was lost, but you found me...";
|
||||
case NPC_MISSION_KIDNAPPED:
|
||||
return "Well, I was kidnapped, but you saved me...";
|
||||
case NPC_MISSION_BASE:
|
||||
return "I'm guarding this location.";
|
||||
case NPC_MISSION_NULL:
|
||||
switch (p->myclass) {
|
||||
case NC_SHOPKEEP:
|
||||
return "I'm a local shopkeeper.";
|
||||
case NC_HACKER:
|
||||
return "I'm looking for some choice systems to hack.";
|
||||
case NC_DOCTOR:
|
||||
@@ -661,6 +669,14 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
|
||||
int score = p->op_of_u.trust + p->op_of_u.value * 3 +
|
||||
p->personality.altruism * 2;
|
||||
int missions_value = p->assigned_missions_value(g);
|
||||
if (g->u.has_amount("mininuke", 1)) {
|
||||
RESPONSE("Because I'm holding a thermal detonator!");
|
||||
SUCCESS(TALK_GIVE_EQUIPMENT);
|
||||
SUCCESS_ACTION(&talk_function::give_equipment);
|
||||
SUCCESS_OPINION(0, 0, -1, 0, score * 300);
|
||||
FAILURE(TALK_DENY_EQUIPMENT);
|
||||
FAILURE_OPINION(0, 0, -1, 0, 0);
|
||||
}
|
||||
RESPONSE("Because I'm your friend!");
|
||||
TRIAL(TALK_TRIAL_PERSUADE, 10 + score);
|
||||
SUCCESS(TALK_GIVE_EQUIPMENT);
|
||||
@@ -723,7 +739,7 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
|
||||
resume << "Yes, let's resume training " <<
|
||||
(g->u.backlog.index > 0 ?
|
||||
skill_name(g->u.backlog.index) :
|
||||
g->itypes[ 0 - g->u.backlog.index ]->name);
|
||||
g->itypes[ martial_arts_itype_ids[0-g->u.backlog.index] ]->name);
|
||||
SELECT_TEMP( resume.str(), g->u.backlog.index);
|
||||
SUCCESS(TALK_TRAIN_START);
|
||||
}
|
||||
@@ -732,6 +748,7 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
|
||||
if (trainable.empty() && styles.empty()) {
|
||||
RESPONSE("Oh, okay."); // Nothing to learn here
|
||||
SUCCESS(TALK_NONE);
|
||||
break;
|
||||
}
|
||||
int printed = 0;
|
||||
int shift = p->chatbin.tempvalue;
|
||||
@@ -753,7 +770,7 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
|
||||
for (int i = 0; i < styles.size() && printed < 9; i++) {
|
||||
printed++;
|
||||
SELECT_TEMP( g->itypes[styles[i]]->name + " (cost 800)",
|
||||
0 - styles[i] );
|
||||
0 - i );
|
||||
SUCCESS(TALK_TRAIN_START);
|
||||
}
|
||||
if (more) {
|
||||
@@ -772,7 +789,7 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
|
||||
} break;
|
||||
|
||||
case TALK_TRAIN_START:
|
||||
if (g->cur_om.is_safe(g->om_location().x, g->om_location().y)) {
|
||||
if (g->cur_om.is_safe(g->om_location().x, g->om_location().y, g->levz)) {
|
||||
RESPONSE("Sounds good.");
|
||||
SUCCESS(TALK_DONE);
|
||||
SUCCESS_ACTION(&talk_function::start_training);
|
||||
@@ -927,6 +944,11 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
|
||||
RESPONSE("Let's trade items.");
|
||||
SUCCESS(TALK_NONE);
|
||||
SUCCESS_ACTION(&talk_function::start_trade);
|
||||
if (p->is_following() && g->m.camp_at(g->u.posx, g->u.posy)) {
|
||||
RESPONSE("Wait at this base,");
|
||||
SUCCESS(TALK_DONE);
|
||||
SUCCESS_ACTION(&talk_function::assign_base);
|
||||
}
|
||||
RESPONSE("Let's go.");
|
||||
SUCCESS(TALK_DONE);
|
||||
break;
|
||||
@@ -943,6 +965,15 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
|
||||
SUCCESS(TALK_COMBAT_COMMANDS);
|
||||
SUCCESS_ACTION(&talk_function::toggle_use_guns);
|
||||
}
|
||||
if (p->combat_rules.use_silent) {
|
||||
RESPONSE("Don't worry about noise.");
|
||||
SUCCESS(TALK_COMBAT_COMMANDS);
|
||||
SUCCESS_ACTION(&talk_function::toggle_use_silent);
|
||||
} else {
|
||||
RESPONSE("Use only silent weapons.");
|
||||
SUCCESS(TALK_COMBAT_COMMANDS);
|
||||
SUCCESS_ACTION(&talk_function::toggle_use_silent);
|
||||
}
|
||||
if (p->combat_rules.use_grenades) {
|
||||
RESPONSE("Don't use grenades anymore.");
|
||||
SUCCESS(TALK_COMBAT_COMMANDS);
|
||||
@@ -1286,6 +1317,20 @@ void talk_function::start_trade(game *g, npc *p)
|
||||
trade(g, p, trade_amount, "Trade");
|
||||
}
|
||||
|
||||
void talk_function::assign_base(game *g, npc *p)
|
||||
{
|
||||
// TODO: decide what to do upon assign? maybe pathing required
|
||||
basecamp* camp = g->m.camp_at(g->u.posx, g->u.posy);
|
||||
if(!camp) {
|
||||
dbg(D_ERROR) << "talk_function::assign_base: Assigned to base but no base here.";
|
||||
return;
|
||||
}
|
||||
|
||||
g->add_msg("%s waits at %s", p->name.c_str(), camp->camp_name().c_str());
|
||||
p->mission = NPC_MISSION_BASE;
|
||||
p->attitude = NPCATT_NULL;
|
||||
}
|
||||
|
||||
void talk_function::give_equipment(game *g, npc *p)
|
||||
{
|
||||
std::vector<int> giving;
|
||||
@@ -1392,6 +1437,7 @@ void talk_function::lead_to_safety(game *g, npc *p)
|
||||
point target = g->find_mission( missid )->target;
|
||||
p->goalx = target.x;
|
||||
p->goaly = target.y;
|
||||
p->goalz = g->levz;
|
||||
p->attitude = NPCATT_LEAD;
|
||||
}
|
||||
|
||||
@@ -1400,6 +1446,11 @@ void talk_function::toggle_use_guns(game *g, npc *p)
|
||||
p->combat_rules.use_guns = !p->combat_rules.use_guns;
|
||||
}
|
||||
|
||||
void talk_function::toggle_use_silent(game *g, npc *p)
|
||||
{
|
||||
p->combat_rules.use_silent = !p->combat_rules.use_silent;
|
||||
}
|
||||
|
||||
void talk_function::toggle_use_grenades(game *g, npc *p)
|
||||
{
|
||||
p->combat_rules.use_grenades = !p->combat_rules.use_grenades;
|
||||
@@ -1434,15 +1485,17 @@ void talk_function::start_training(game *g, npc *p)
|
||||
{
|
||||
int cost = 0, time = 0;
|
||||
skill sk_used = sk_null;
|
||||
itype_id style = itm_null;
|
||||
//There were some style references here that... didn't do anything. Created but never used.
|
||||
//TODO: Remove these comments once I'm sure this is correct.
|
||||
//itype_id style = "null";
|
||||
if (p->chatbin.tempvalue < 0) {
|
||||
cost = -800;
|
||||
style = itype_id(0 - p->chatbin.tempvalue);
|
||||
// style = itype_id(0 - p->chatbin.tempvalue);
|
||||
time = 30000;
|
||||
} else {
|
||||
sk_used = skill(p->chatbin.tempvalue);
|
||||
cost = -200 * (1 + g->u.skillLevel(Skill::skill(sk_used)).level());
|
||||
time = 10000 + 5000 * g->u.skillLevel(Skill::skill(sk_used)).level();
|
||||
cost = -200 * (1 + g->u.skillLevel(Skill::skill(sk_used)));
|
||||
time = 10000 + 5000 * g->u.skillLevel(Skill::skill(sk_used));
|
||||
}
|
||||
|
||||
// Pay for it
|
||||
@@ -1451,7 +1504,7 @@ void talk_function::start_training(game *g, npc *p)
|
||||
else if (!trade(g, p, cost, "Pay for training:"))
|
||||
return;
|
||||
// Then receive it
|
||||
g->u.assign_activity(ACT_TRAIN, time, p->chatbin.tempvalue);
|
||||
g->u.assign_activity(g, ACT_TRAIN, time, p->chatbin.tempvalue);
|
||||
}
|
||||
|
||||
void parse_tags(std::string &phrase, player *u, npc *me)
|
||||
@@ -1481,7 +1534,7 @@ void parse_tags(std::string &phrase, player *u, npc *me)
|
||||
if (tag == "<yrwp>")
|
||||
phrase.replace(fa, l, u->weapon.tname());
|
||||
else if (tag == "<mywp>") {
|
||||
if (me->weapon.type->id == 0)
|
||||
if (me->weapon.type->id == "null")
|
||||
phrase.replace(fa, l, "fists");
|
||||
else
|
||||
phrase.replace(fa, l, me->weapon.tname());
|
||||
@@ -1679,9 +1732,10 @@ talk_topic special_talk(char ch)
|
||||
|
||||
bool trade(game *g, npc *p, int cost, std::string deal)
|
||||
{
|
||||
WINDOW* w_head = newwin( 4, 80, 0, 0);
|
||||
WINDOW* w_them = newwin(21, 40, 4, 0);
|
||||
WINDOW* w_you = newwin(21, 40, 4, 40);
|
||||
WINDOW* w_head = newwin(4, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
WINDOW* w_them = newwin(21, 40, 4+((TERMY > 25) ? (TERMY-25)/2 : 0), (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
WINDOW* w_you = newwin(21, 40, 4+((TERMY > 25) ? (TERMY-25)/2 : 0), 40+((TERMX > 80) ? (TERMX-80)/2 : 0));
|
||||
|
||||
WINDOW* w_tmp;
|
||||
mvwprintz(w_head, 0, 0, c_white, "\
|
||||
Trading with %s\n\
|
||||
@@ -1809,7 +1863,7 @@ Tab key to switch lists, letters to pick items, Enter to finalize, Esc to quit\n
|
||||
break;
|
||||
case '?':
|
||||
update = true;
|
||||
w_tmp = newwin(3, 21, 1, 30);
|
||||
w_tmp = newwin(3, 21, 1+(TERMY-25)/2, 30+(TERMX-80)/2);
|
||||
mvwprintz(w_tmp, 1, 1, c_red, "Examine which item?");
|
||||
wborder(w_tmp, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
|
||||
@@ -13,10 +13,6 @@
|
||||
#define OMAPX 180
|
||||
#define OMAPY 180
|
||||
|
||||
#define TUTORIAL_Z 10
|
||||
#define DEFENSE_Z 20
|
||||
#define NETHER_Z 30
|
||||
|
||||
class overmap;
|
||||
|
||||
struct oter_t {
|
||||
@@ -268,7 +264,7 @@ const oter_t oterlist[num_ter_types] = {
|
||||
{"mansion", 'M', c_ltgreen, 5, build_extras, false, false},
|
||||
{"mansion", 'M', c_green, 5, build_extras, false, false},
|
||||
{"fema camp", '+', c_blue, 5, build_extras, false, false},
|
||||
{"fema camp", 'F', i_blue, 5, build_extras, false, false}, //Oddzball- Added fema graphic
|
||||
{"fema camp", 'F', i_blue, 5, build_extras, false, false},
|
||||
{"evac shelter", '+', c_white, 2, no_extras, true, false},
|
||||
{"evac shelter", '+', c_white, 2, no_extras, false, true},
|
||||
{"LMOE shelter", '+', c_red, 2, no_extras, true, false},
|
||||
@@ -373,19 +369,20 @@ OMS_FLAG_BIG, // As big as possible
|
||||
OMS_FLAG_ROAD, // Add a road_point here; connect to towns etc.
|
||||
OMS_FLAG_PARKING_LOT, // Add a road_point to the north of here
|
||||
OMS_FLAG_DIRT_LOT, // Dirt lot flag for specials
|
||||
OMS_FLAG_CLASSIC, // Allow this location to spawn in classic mode
|
||||
NUM_OMS_FLAGS
|
||||
};
|
||||
|
||||
struct omspec_place
|
||||
{
|
||||
// Able functions - true if p is valid
|
||||
bool never (overmap *om, point p) { return false; }
|
||||
bool always (overmap *om, point p) { return true; }
|
||||
bool water (overmap *om, point p); // Only on rivers
|
||||
bool land (overmap *om, point p); // Only on land (no rivers)
|
||||
bool forest (overmap *om, point p); // Forest
|
||||
bool wilderness (overmap *om, point p); // Forest or fields
|
||||
bool by_highway (overmap *om, point p); // Next to existing highways
|
||||
bool never (overmap *om, tripoint p) { return false; }
|
||||
bool always (overmap *om, tripoint p) { return true; }
|
||||
bool water (overmap *om, tripoint p); // Only on rivers
|
||||
bool land (overmap *om, tripoint p); // Only on land (no rivers)
|
||||
bool forest (overmap *om, tripoint p); // Forest
|
||||
bool wilderness (overmap *om, tripoint p); // Forest or fields
|
||||
bool by_highway (overmap *om, tripoint p); // Next to existing highways
|
||||
};
|
||||
|
||||
struct overmap_special
|
||||
@@ -396,13 +393,13 @@ struct overmap_special
|
||||
int min_dist_from_city;// Min distance from city limits
|
||||
int max_dist_from_city;// Max distance from city limits
|
||||
|
||||
moncat_id monsters; // Type of monsters that appear here
|
||||
std::string monsters; // Type of monsters that appear here
|
||||
int monster_pop_min; // Minimum monster population
|
||||
int monster_pop_max; // Maximum monster population
|
||||
int monster_rad_min; // Minimum monster radius
|
||||
int monster_rad_max; // Maximum monster radius
|
||||
|
||||
bool (omspec_place::*able) (overmap *om, point p); // See above
|
||||
bool (omspec_place::*able) (overmap *om, tripoint p); // See above
|
||||
unsigned flags : NUM_OMS_FLAGS; // See above
|
||||
};
|
||||
|
||||
@@ -445,95 +442,95 @@ enum omspec_id
|
||||
const overmap_special overmap_specials[NUM_OMSPECS] = {
|
||||
|
||||
// Terrain MIN MAX DISTANCE
|
||||
{ot_crater, 0, 10, 0, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::land, mfb(OMS_FLAG_BLOB)},
|
||||
{ot_crater, 0, 10, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::land, mfb(OMS_FLAG_BLOB) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_hive, 0, 50, 10, -1, mcat_bee, 20, 60, 2, 4,
|
||||
{ot_hive, 0, 50, 10, -1, "GROUP_BEE", 20, 60, 2, 4,
|
||||
&omspec_place::forest, mfb(OMS_FLAG_3X3)},
|
||||
|
||||
{ot_house_north, 0,100, 0, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_ROTATE_ROAD)},
|
||||
{ot_house_north, 0,100, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_ROTATE_ROAD) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_s_gas_north, 0,100, 0, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_ROTATE_ROAD)},
|
||||
{ot_s_gas_north, 0,100, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_ROTATE_ROAD) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_cabin, 0, 30, 20, -1, mcat_null, 0, 0, 0, 0, // Woods cabin
|
||||
{ot_cabin, 0, 30, 20, -1, "GROUP_NULL", 0, 0, 0, 0, // Woods cabin
|
||||
&omspec_place::forest, mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_lmoe, 0, 3, 20, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::land, mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_farm, 0, 20, 20, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, mfb(OMS_FLAG_3X3_SECOND) |mfb(OMS_FLAG_DIRT_LOT) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_temple_stairs, 0, 3, 20, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::forest, 0},
|
||||
|
||||
{ot_lmoe, 0, 3, 20, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::land, 0},
|
||||
|
||||
{ot_farm, 0, 20, 20, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, mfb(OMS_FLAG_3X3_SECOND) |mfb(OMS_FLAG_DIRT_LOT)},
|
||||
|
||||
{ot_temple_stairs, 0, 3, 20, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::forest, 0},
|
||||
|
||||
{ot_lab_stairs, 0, 30, 8, -1, mcat_null, 0, 0, 0, 0,
|
||||
{ot_lab_stairs, 0, 30, 8, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::land, mfb(OMS_FLAG_ROAD)},
|
||||
|
||||
{ot_fema_entrance, 0, 5, 8, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::land, mfb(OMS_FLAG_3X3_SECOND)}, //Oddzball-Fema test
|
||||
{ot_fema_entrance, 0, 5, 8, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::land, mfb(OMS_FLAG_3X3_SECOND) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
// Terrain MIN MAX DISTANCE
|
||||
{ot_bunker, 2, 10, 4, -1, mcat_null, 0, 0, 0, 0,
|
||||
{ot_bunker, 2, 10, 4, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::land, mfb(OMS_FLAG_ROAD)},
|
||||
|
||||
{ot_outpost, 0, 10, 4, -1, mcat_null, 0, 0, 0, 0,
|
||||
{ot_outpost, 0, 10, 4, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, 0},
|
||||
|
||||
{ot_silo, 0, 1, 30, -1, mcat_null, 0, 0, 0, 0,
|
||||
{ot_silo, 0, 1, 30, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, mfb(OMS_FLAG_ROAD)},
|
||||
|
||||
{ot_radio_tower, 1, 5, 0, 20, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, 0},
|
||||
{ot_radio_tower, 1, 5, 0, 20, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_mansion_entrance, 0, 8, 0, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND)},
|
||||
{ot_mansion_entrance, 0, 8, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_mansion_entrance, 0, 4, 10, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, mfb(OMS_FLAG_3X3_SECOND)},
|
||||
{ot_mansion_entrance, 0, 4, 10, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, mfb(OMS_FLAG_3X3_SECOND) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_megastore_entrance, 0, 5, 0, 10, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND)},
|
||||
{ot_megastore_entrance, 0, 5, 0, 10, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_hospital_entrance, 1, 5, 3, 15, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND)},
|
||||
{ot_hospital_entrance, 1, 5, 3, 15, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_sewage_treatment, 1, 5, 10, 20, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::land, mfb(OMS_FLAG_PARKING_LOT)},
|
||||
{ot_sewage_treatment, 1, 5, 10, 20, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::land, mfb(OMS_FLAG_PARKING_LOT) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_mine_entrance, 0, 5, 15, -1, mcat_null, 0, 0, 0, 0,
|
||||
{ot_mine_entrance, 0, 5, 15, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, mfb(OMS_FLAG_PARKING_LOT)},
|
||||
|
||||
// Terrain MIN MAX DISTANCE
|
||||
{ot_anthill, 0, 30, 10, -1, mcat_ant, 10, 30, 1000, 2000,
|
||||
{ot_anthill, 0, 30, 10, -1, "GROUP_ANT", 10, 30, 1000, 2000,
|
||||
&omspec_place::wilderness, 0},
|
||||
|
||||
{ot_spider_pit, 0,500, 0, -1, mcat_null, 0, 0, 0, 0,
|
||||
{ot_spider_pit, 0,500, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::forest, 0},
|
||||
|
||||
{ot_slimepit, 0, 4, 0, -1, mcat_goo, 2, 10, 100, 200,
|
||||
{ot_slimepit, 0, 4, 0, -1, "GROUP_GOO", 2, 10, 100, 200,
|
||||
&omspec_place::land, 0},
|
||||
|
||||
{ot_fungal_bloom, 0, 3, 5, -1, mcat_fungi, 600, 1200, 30, 50,
|
||||
{ot_fungal_bloom, 0, 3, 5, -1, "GROUP_FUNGI", 600, 1200, 30, 50,
|
||||
&omspec_place::wilderness, 0},
|
||||
|
||||
{ot_triffid_grove, 0, 4, 0, -1, mcat_triffid, 800, 1300, 12, 20,
|
||||
{ot_triffid_grove, 0, 4, 0, -1, "GROUP_TRIFFID", 800, 1300, 12, 20,
|
||||
&omspec_place::forest, 0},
|
||||
|
||||
{ot_river_center, 0, 10, 10, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::always, mfb(OMS_FLAG_BLOB)},
|
||||
{ot_river_center, 0, 10, 10, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::always, mfb(OMS_FLAG_BLOB) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
// Terrain MIN MAX DISTANCE
|
||||
{ot_shelter, 5, 10, 5, 10, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, mfb(OMS_FLAG_ROAD)},
|
||||
{ot_shelter, 5, 10, 5, 10, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, mfb(OMS_FLAG_ROAD) | mfb(OMS_FLAG_CLASSIC)},
|
||||
|
||||
{ot_cave, 0, 30, 0, -1, mcat_null, 0, 0, 0, 0,
|
||||
{ot_cave, 0, 30, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, 0},
|
||||
|
||||
{ot_toxic_dump, 0, 5, 15, -1, mcat_null, 0, 0, 0, 0,
|
||||
&omspec_place::wilderness,0}
|
||||
{ot_toxic_dump, 0, 5, 15, -1, "GROUP_NULL", 0, 0, 0, 0,
|
||||
&omspec_place::wilderness, mfb(OMS_FLAG_CLASSIC)}
|
||||
|
||||
};
|
||||
|
||||
|
||||
+146
-4
@@ -1,5 +1,7 @@
|
||||
#include "game.h"
|
||||
#include "options.h"
|
||||
#include "output.h"
|
||||
#include "keypress.h"
|
||||
|
||||
#include <stdlib.h>
|
||||
#include <fstream>
|
||||
@@ -12,6 +14,120 @@ bool option_is_bool(option_key id);
|
||||
void create_default_options();
|
||||
std::string options_header();
|
||||
|
||||
void game::show_options()
|
||||
{
|
||||
WINDOW* w_options_border = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
WINDOW* w_options = newwin(23, 78, 1 + ((TERMY > 25) ? (TERMY-25)/2 : 0), 1 + ((TERMX > 80) ? (TERMX-80)/2 : 0));
|
||||
|
||||
int offset = 1;
|
||||
int line = 0;
|
||||
char ch = ' ';
|
||||
bool changed_options = false;
|
||||
bool needs_refresh = true;
|
||||
do {
|
||||
wborder(w_options_border, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX);
|
||||
mvwprintz(w_options_border, 0, 36, c_ltred, " OPTIONS ");
|
||||
wrefresh(w_options_border);
|
||||
|
||||
// TODO: change instructions
|
||||
if (needs_refresh) {
|
||||
werase(w_options);
|
||||
mvwprintz(w_options, 0, 40, c_white, "Use up/down keys to scroll through");
|
||||
mvwprintz(w_options, 1, 40, c_white, "available options.");
|
||||
mvwprintz(w_options, 2, 40, c_white, "Use left/right keys to toggle.");
|
||||
mvwprintz(w_options, 3, 40, c_white, "Press ESC or q to return. ");
|
||||
// highlight options for option descriptions
|
||||
std::string tmp = option_desc(option_key(offset + line));
|
||||
std::string out;
|
||||
size_t pos;
|
||||
int displayline = 5;
|
||||
do {
|
||||
pos = tmp.find_first_of('\n');
|
||||
out = tmp.substr(0, pos);
|
||||
mvwprintz(w_options, displayline, 40, c_white, out.c_str());
|
||||
tmp = tmp.substr(pos + 1);
|
||||
displayline++;
|
||||
} while (pos != std::string::npos && displayline < 12);
|
||||
needs_refresh = false;
|
||||
}
|
||||
|
||||
// Clear the lines
|
||||
for (int i = 0; i < 25; i++)
|
||||
mvwprintz(w_options, i, 0, c_black, " ");
|
||||
int valid_option_count = 0;
|
||||
|
||||
// display options
|
||||
for (int i = 0; i < 25 && offset + i < NUM_OPTION_KEYS; i++)
|
||||
{
|
||||
valid_option_count++;
|
||||
mvwprintz(w_options, i, 0, c_white, "%s: ",
|
||||
option_name( option_key(offset + i) ).c_str());
|
||||
|
||||
if (option_is_bool(option_key(offset + i)))
|
||||
{
|
||||
bool on = OPTIONS[ option_key(offset + i) ];
|
||||
if (i == line)
|
||||
mvwprintz(w_options, i, 30, hilite(c_ltcyan), (on ? "True" : "False"));
|
||||
else
|
||||
mvwprintz(w_options, i, 30, (on ? c_ltgreen : c_ltred), (on ? "True" : "False"));
|
||||
} else {
|
||||
char option_val = OPTIONS[ option_key(offset + i) ];
|
||||
if (i == line)
|
||||
mvwprintz(w_options, i, 30, hilite(c_ltcyan), "%d", option_val );
|
||||
else
|
||||
mvwprintz(w_options, i, 30, c_ltgreen, "%d", option_val );
|
||||
}
|
||||
}
|
||||
wrefresh(w_options);
|
||||
refresh();
|
||||
ch = input();
|
||||
needs_refresh = true;
|
||||
refresh();
|
||||
|
||||
switch (ch) {
|
||||
// move up and down
|
||||
case 'j':
|
||||
line++;
|
||||
if (line == NUM_OPTION_KEYS - 1)
|
||||
line = 0;
|
||||
break;
|
||||
case 'k':
|
||||
line--;
|
||||
if (line < 0)
|
||||
line = NUM_OPTION_KEYS - 2;
|
||||
break;
|
||||
// toggle options with left/right keys
|
||||
case 'h':
|
||||
if (option_is_bool(option_key(offset + line)))
|
||||
OPTIONS[ option_key(offset + line) ] = !(OPTIONS[ option_key(offset + line) ]);
|
||||
else
|
||||
{
|
||||
OPTIONS[ option_key(offset + line) ]--;
|
||||
if ((OPTIONS[ option_key(offset + line) ]) < 0 )
|
||||
OPTIONS[ option_key(offset + line) ] = option_max_options(option_key(offset + line)) - 1;
|
||||
}
|
||||
changed_options = true;
|
||||
break;
|
||||
case 'l':
|
||||
if (option_is_bool(option_key(offset + line)))
|
||||
OPTIONS[ option_key(offset + line) ] = !(OPTIONS[ option_key(offset + line) ]);
|
||||
else
|
||||
{
|
||||
OPTIONS[ option_key(offset + line) ]++;
|
||||
if ((OPTIONS[ option_key(offset + line) ]) >= option_max_options(option_key(offset + line)))
|
||||
OPTIONS[ option_key(offset + line) ] = 0;
|
||||
}
|
||||
changed_options = true;
|
||||
break;
|
||||
}
|
||||
} while (ch != 'q' && ch != 'Q' && ch != KEY_ESCAPE);
|
||||
|
||||
if (changed_options && query_yn("Save changes?"))
|
||||
save_options();
|
||||
werase(w_options);
|
||||
}
|
||||
|
||||
void load_options()
|
||||
{
|
||||
std::ifstream fin;
|
||||
@@ -90,6 +206,8 @@ option_key lookup_option_key(std::string id)
|
||||
return OPT_AUTOSAVE;
|
||||
if (id == "gradual_night_light")
|
||||
return OPT_GRADUAL_NIGHT_LIGHT;
|
||||
if (id == "rain_animation")
|
||||
return OPT_RAIN_ANIMATION;
|
||||
if (id == "query_disassemble")
|
||||
return OPT_QUERY_DISASSEMBLE;
|
||||
if (id == "drop_empty")
|
||||
@@ -100,12 +218,16 @@ option_key lookup_option_key(std::string id)
|
||||
return OPT_DELETE_WORLD;
|
||||
if (id == "initial_points")
|
||||
return OPT_INITIAL_POINTS;
|
||||
if(id == "initial_time")
|
||||
return OPT_INITIAL_TIME;
|
||||
if (id == "viewport_x")
|
||||
return OPT_VIEWPORT_X;
|
||||
if (id == "viewport_y")
|
||||
return OPT_VIEWPORT_Y;
|
||||
if (id == "static_spawn")
|
||||
return OPT_STATIC_SPAWN;
|
||||
if (id == "classic_zombies")
|
||||
return OPT_CLASSIC_ZOMBIES;
|
||||
return OPT_NULL;
|
||||
}
|
||||
|
||||
@@ -124,14 +246,17 @@ std::string option_string(option_key key)
|
||||
case OPT_AUTOSAFEMODETURNS: return "autosafemodeturns";
|
||||
case OPT_AUTOSAVE: return "autosave";
|
||||
case OPT_GRADUAL_NIGHT_LIGHT: return "gradual_night_light";
|
||||
case OPT_RAIN_ANIMATION: return "rain_animation";
|
||||
case OPT_QUERY_DISASSEMBLE: return "query_disassemble";
|
||||
case OPT_DROP_EMPTY: return "drop_empty";
|
||||
case OPT_SKILL_RUST: return "skill_rust";
|
||||
case OPT_DELETE_WORLD: return "delete_world";
|
||||
case OPT_INITIAL_POINTS: return "initial_points";
|
||||
case OPT_INITIAL_TIME: return "initial_time";
|
||||
case OPT_VIEWPORT_X: return "viewport_x";
|
||||
case OPT_VIEWPORT_Y: return "viewport_y";
|
||||
case OPT_STATIC_SPAWN: return "static_spawn";
|
||||
case OPT_CLASSIC_ZOMBIES: return "classic_zombies";
|
||||
default: return "unknown_option";
|
||||
}
|
||||
return "unknown_option";
|
||||
@@ -152,14 +277,17 @@ std::string option_desc(option_key key)
|
||||
case OPT_AUTOSAFEMODETURNS: return "Number of turns after safemode\nis reenabled if no hostiles are\nin safemodeproximity distance";
|
||||
case OPT_AUTOSAVE: return "If true, game will periodically\nsave the map";
|
||||
case OPT_GRADUAL_NIGHT_LIGHT: return "If true will add nice gradual-lighting\n(should only make a difference @night)";
|
||||
case OPT_RAIN_ANIMATION: return "If true, will display weather animations";
|
||||
case OPT_QUERY_DISASSEMBLE: return "If true, will query before disassembling\nitems";
|
||||
case OPT_DROP_EMPTY: return "Set to drop empty containers after use\n0 - don't drop any\n1 - all except watertight containers\n2 - all containers";
|
||||
case OPT_SKILL_RUST: return "Set the level of skill rust\n0 - vanilla Cataclysm\n1 - capped at skill levels\n2 - none at all";
|
||||
case OPT_DELETE_WORLD: return "Delete saves upon player death\n0 - no\n1 - yes\n2 - query";
|
||||
case OPT_INITIAL_POINTS: return "Initial points available on character\ngeneration. Default is 6";
|
||||
case OPT_VIEWPORT_X: return "Set the expansion of the viewport along\nthe X axis. Must restart for changes\nto take effect. Default is 12";
|
||||
case OPT_VIEWPORT_Y: return "Set the expansion of the viewport along\nthe Y axis. Must restart for changes\nto take effect. Default is 12";
|
||||
case OPT_STATIC_SPAWN: return "Spawn zombies at game start instead of\nduring game. Must delete save directory\nafter changing for it to take effect.\nDefault is 12";
|
||||
case OPT_INITIAL_TIME: return "Initial starting time of day on character\ngeneration. Default is 8:00";
|
||||
case OPT_VIEWPORT_X: return "WINDOWS ONLY: Set the expansion of the viewport along\nthe X axis. Must restart for changes\nto take effect. Default is 12. POSIX\nsystems will use terminal size at startup.";
|
||||
case OPT_VIEWPORT_Y: return "WINDOWS ONLY: Set the expansion of the viewport along\nthe Y axis. Must restart for changes\nto take effect. Default is 12. POSIX\nsystems will use terminal size at startup.";
|
||||
case OPT_STATIC_SPAWN: return "Spawn zombies at game start instead of\nduring game. Must delete save directory\nafter changing for it to take effect.\nDefault is F";
|
||||
case OPT_CLASSIC_ZOMBIES: return "Only spawn classic zombies and natural\nwildlife. Probably requires a reset of\nsave folder to take effect. Default is F";
|
||||
default: return " ";
|
||||
}
|
||||
return "Big ol Bug";
|
||||
@@ -180,14 +308,17 @@ std::string option_name(option_key key)
|
||||
case OPT_AUTOSAFEMODETURNS: return "Turns to reenable safemode";
|
||||
case OPT_AUTOSAVE: return "Periodically Autosave";
|
||||
case OPT_GRADUAL_NIGHT_LIGHT: return "Gradual night light";
|
||||
case OPT_RAIN_ANIMATION: return "Rain animation";
|
||||
case OPT_QUERY_DISASSEMBLE: return "Query on disassembly";
|
||||
case OPT_DROP_EMPTY: return "Drop empty containers";
|
||||
case OPT_SKILL_RUST: return "Skill Rust";
|
||||
case OPT_DELETE_WORLD: return "Delete World";
|
||||
case OPT_INITIAL_POINTS: return "Initial points";
|
||||
case OPT_INITIAL_TIME: return "Initial time";
|
||||
case OPT_VIEWPORT_X: return "Viewport width";
|
||||
case OPT_VIEWPORT_Y: return "Viewport height";
|
||||
case OPT_STATIC_SPAWN: return "Static spawn";
|
||||
case OPT_CLASSIC_ZOMBIES: return "Classic zombies";
|
||||
default: return "Unknown Option (BUG)";
|
||||
}
|
||||
return "Big ol Bug";
|
||||
@@ -203,6 +334,7 @@ bool option_is_bool(option_key id)
|
||||
case OPT_DROP_EMPTY:
|
||||
case OPT_DELETE_WORLD:
|
||||
case OPT_INITIAL_POINTS:
|
||||
case OPT_INITIAL_TIME:
|
||||
case OPT_VIEWPORT_X:
|
||||
case OPT_VIEWPORT_Y:
|
||||
return false;
|
||||
@@ -233,6 +365,9 @@ char option_max_options(option_key id)
|
||||
case OPT_INITIAL_POINTS:
|
||||
ret = 25;
|
||||
break;
|
||||
case OPT_INITIAL_TIME:
|
||||
ret = 24; // 0h to 23h
|
||||
break;
|
||||
case OPT_DELETE_WORLD:
|
||||
case OPT_DROP_EMPTY:
|
||||
case OPT_SKILL_RUST:
|
||||
@@ -240,7 +375,7 @@ char option_max_options(option_key id)
|
||||
break;
|
||||
case OPT_VIEWPORT_X:
|
||||
case OPT_VIEWPORT_Y:
|
||||
ret = 61; // TODO Set up min/max values so weird numbers don't have to be used.
|
||||
ret = 93; // TODO Set up min/max values so weird numbers don't have to be used.
|
||||
break;
|
||||
default:
|
||||
ret = 2;
|
||||
@@ -281,6 +416,8 @@ autosafemodeturns 50\n\
|
||||
autosave F\n\
|
||||
# If true will add nice gradual-lighting (should only make a difference @night)\n\
|
||||
gradual_night_light F\n\
|
||||
# If true, will display weather animations\n\
|
||||
rain_animation T\n\
|
||||
# If true, will query beefore disassembling items\n\
|
||||
query_disassemble T\n\
|
||||
# Player will automatically drop empty containers after use\n\
|
||||
@@ -294,11 +431,16 @@ skill_rust 0\n\
|
||||
delete_world 0\n\
|
||||
# Initial points available in character generation\n\
|
||||
initial_points 6\n\
|
||||
# Initial time at character generation\n\
|
||||
initial_time 8\n\
|
||||
# The width of the terrain window in characters.\n\
|
||||
viewport_x 12\n\
|
||||
# The height of the terrain window, which is also the height of the main window, in characters.\n\
|
||||
viewport_y 12\n\
|
||||
# Spawn zombies at game start instead of during the game. You must create a new world after changing\n\
|
||||
static_spawn T\n\
|
||||
# Only spawn classic zombies and natural wildlife. You must create a new world after changing\n\
|
||||
classic_zombies F\n\
|
||||
";
|
||||
fout.close();
|
||||
}
|
||||
|
||||
@@ -17,40 +17,52 @@ OPT_AUTOSAFEMODE, // Autosafemode on by default?
|
||||
OPT_AUTOSAFEMODETURNS, //Number of turns untill safemode kicks back in
|
||||
OPT_AUTOSAVE, // Automatically save the game on intervals.
|
||||
OPT_GRADUAL_NIGHT_LIGHT, // be so cool at night :)
|
||||
OPT_RAIN_ANIMATION, // Enable the rain and other weather animation
|
||||
OPT_QUERY_DISASSEMBLE, // Query before disassembling items
|
||||
OPT_DROP_EMPTY, // auto drop empty containers after use
|
||||
OPT_SKILL_RUST, // level of skill rust
|
||||
OPT_DELETE_WORLD, // Delete workd every time New Character is created
|
||||
OPT_INITIAL_POINTS, // Set the number of character points
|
||||
OPT_INITIAL_TIME, // Sets the starting hour (0-24)
|
||||
OPT_VIEWPORT_X, // Set the width of the terrain window, in characters
|
||||
OPT_VIEWPORT_Y, // Set the height of the terrain window, in characters
|
||||
OPT_STATIC_SPAWN, // Makes zombies spawn using the new static system
|
||||
OPT_CLASSIC_ZOMBIES, // Only spawn the more classic zombies
|
||||
NUM_OPTION_KEYS
|
||||
};
|
||||
|
||||
struct option_table
|
||||
{
|
||||
double options[NUM_OPTION_KEYS];
|
||||
double options[NUM_OPTION_KEYS];
|
||||
|
||||
option_table() {
|
||||
for (int i = 0; i < NUM_OPTION_KEYS; i++) {
|
||||
if(i == OPT_VIEWPORT_X || i == OPT_VIEWPORT_Y) {
|
||||
options[i] = 12;
|
||||
}
|
||||
else {
|
||||
options[i] = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
option_table()
|
||||
{
|
||||
for (int i = 0; i < NUM_OPTION_KEYS; i++)
|
||||
{ //setup default values where needed
|
||||
switch(i)
|
||||
{
|
||||
case OPT_VIEWPORT_X:
|
||||
case OPT_VIEWPORT_Y:
|
||||
options[i] = 12;
|
||||
break;
|
||||
case OPT_INITIAL_TIME:
|
||||
options[i] = 8;
|
||||
break;
|
||||
default:
|
||||
options[i] = 0;
|
||||
}
|
||||
}
|
||||
};
|
||||
|
||||
double& operator[] (option_key i) { return options[i]; };
|
||||
double& operator[] (int i) { return options[i]; };
|
||||
double& operator[] (option_key i) { return options[i]; };
|
||||
double& operator[] (int i) { return options[i]; };
|
||||
};
|
||||
|
||||
extern option_table OPTIONS;
|
||||
|
||||
bool option_is_bool(option_key id);
|
||||
char option_max_options(option_key id);
|
||||
void show_options();
|
||||
void load_options();
|
||||
void save_options();
|
||||
std::string option_string(option_key key);
|
||||
|
||||
+93
-25
@@ -26,6 +26,16 @@
|
||||
#define LINE_OXXX 4194423
|
||||
#define LINE_XXXX 4194414
|
||||
|
||||
// Display data
|
||||
int TERMX;
|
||||
int TERMY;
|
||||
int VIEWX;
|
||||
int VIEWY;
|
||||
int VIEW_OFFSET_X;
|
||||
int VIEW_OFFSET_Y;
|
||||
int TERRAIN_WINDOW_WIDTH;
|
||||
int TERRAIN_WINDOW_HEIGHT;
|
||||
|
||||
nc_color hilite(nc_color c)
|
||||
{
|
||||
switch (c) {
|
||||
@@ -327,16 +337,17 @@ bool query_yn(const char *mes, ...)
|
||||
vsprintf(buff, mes, ap);
|
||||
va_end(ap);
|
||||
int win_width = strlen(buff) + 26;
|
||||
WINDOW* w = newwin(3, win_width, 11, 0);
|
||||
|
||||
WINDOW *w = newwin(3, win_width, (TERMY-3)/2, (TERMX > win_width) ? (TERMX-win_width)/2 : 0);
|
||||
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
mvwprintz(w, 1, 1, c_ltred, "%s (%s)", buff,
|
||||
(force_uc ? "Y/N - Case Sensitive" : "y/n"));
|
||||
mvwprintz(w, 1, 1, c_ltred, "%s (%s)", buff, (force_uc ? "Y/N - Case Sensitive" : "y/n"));
|
||||
wrefresh(w);
|
||||
char ch;
|
||||
do
|
||||
ch = getch();
|
||||
while (ch != 'Y' && ch != 'N' && (force_uc || (ch != 'y' && ch != 'n')));
|
||||
while (ch != '\n' && ch != ' ' && ch != KEY_ESCAPE && ch != 'Y' && ch != 'N' && (force_uc || (ch != 'y' && ch != 'n')));
|
||||
werase(w);
|
||||
wrefresh(w);
|
||||
delwin(w);
|
||||
@@ -354,7 +365,9 @@ int query_int(const char *mes, ...)
|
||||
vsprintf(buff, mes, ap);
|
||||
va_end(ap);
|
||||
int win_width = strlen(buff) + 10;
|
||||
WINDOW* w = newwin(3, win_width, 11, 0);
|
||||
|
||||
WINDOW *w = newwin(3, win_width, (TERMY-3)/2, 11+((TERMX > win_width) ? (TERMX-win_width)/2 : 0));
|
||||
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
mvwprintz(w, 1, 1, c_ltred, "%s (0-9)", buff);
|
||||
@@ -377,7 +390,7 @@ std::string string_input_popup(std::string title, int max_length, std::string in
|
||||
std::string ret = input;
|
||||
|
||||
int startx = title.size() + 2;
|
||||
WINDOW* w = newwin(3, 80, 11, 0);
|
||||
WINDOW *w = newwin(3, 80, (TERMY-3)/2, ((TERMX > 80) ? (TERMX-80)/2 : 0));
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
for (int i = startx + 1; i < 79; i++)
|
||||
@@ -443,8 +456,7 @@ char popup_getkey(const char *mes, ...)
|
||||
width += 2;
|
||||
if (height > 25)
|
||||
height = 25;
|
||||
WINDOW* w = newwin(height + 1, width, int((25 - height) / 2),
|
||||
int((80 - width) / 2));
|
||||
WINDOW *w = newwin(height+1, width, (TERMY-(height+1))/2, (TERMX > width) ? (TERMX-width)/2 : 0);
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
tmp = buff;
|
||||
@@ -481,7 +493,7 @@ int menu_vec(const char *mes, std::vector<std::string> options)
|
||||
if (options[i].length() + 6 > width)
|
||||
width = options[i].length() + 6;
|
||||
}
|
||||
WINDOW* w = newwin(height, width, 12-height/2, 40-width/2);
|
||||
WINDOW *w = newwin(height, width, (TERMY-height)/2, (TERMX > width) ? (TERMX-width)/2 : 0);
|
||||
wattron(w, c_white);
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
@@ -555,7 +567,7 @@ void popup_top(const char *mes, ...)
|
||||
if (width == 0 || tmp.length() > width)
|
||||
width = tmp.length();
|
||||
width += 2;
|
||||
WINDOW* w = newwin(height + 1, width, 0, int((80 - width) / 2));
|
||||
WINDOW *w = newwin(height+1, width, 0, (TERMX > width) ? (TERMX-width)/2 : 0);
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
tmp = buff;
|
||||
@@ -605,8 +617,7 @@ void popup(const char *mes, ...)
|
||||
width += 2;
|
||||
if (height > 25)
|
||||
height = 25;
|
||||
WINDOW* w = newwin(height + 1, width, int((25 - height) / 2),
|
||||
int((80 - width) / 2));
|
||||
WINDOW *w = newwin(height+1, width, (TERMY-(height+1))/2, (TERMX > width) ? (TERMX-width)/2 : 0);
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
tmp = buff;
|
||||
@@ -656,8 +667,7 @@ void popup_nowait(const char *mes, ...)
|
||||
width += 2;
|
||||
if (height > 25)
|
||||
height = 25;
|
||||
WINDOW* w = newwin(height + 1, width, int((25 - height) / 2),
|
||||
int((80 - width) / 2));
|
||||
WINDOW *w = newwin(height+1, width, (TERMY-(height+1))/2, (TERMX > width) ? (TERMX-width)/2 : 0);
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
tmp = buff;
|
||||
@@ -685,7 +695,8 @@ void full_screen_popup(const char* mes, ...)
|
||||
vsprintf(buff, mes, ap);
|
||||
va_end(ap);
|
||||
std::string tmp = buff;
|
||||
WINDOW* w = newwin(25, 80, 0, 0);
|
||||
|
||||
WINDOW *w = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
|
||||
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
|
||||
size_t pos = tmp.find_first_of('\n');
|
||||
@@ -710,9 +721,13 @@ void full_screen_popup(const char* mes, ...)
|
||||
refresh();
|
||||
}
|
||||
|
||||
char compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare)
|
||||
//note that passing in iteminfo instances with sType == "MENU" or "DESCRIPTION" does special things
|
||||
//if sType == "MENU", sPre == "iOffsetY" or "iOffsetX" also do special things
|
||||
//otherwise if sType == "MENU", iValue can be used to control color
|
||||
//all this should probably be cleaned up at some point, rather than using a function for things it wasn't meant for
|
||||
char compare_split_screen_popup(int iLeft, int iWidth, int iHeight, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare)
|
||||
{
|
||||
WINDOW* w = newwin(25, 40, 0, (bLeft) ? 0 : 40);
|
||||
WINDOW* w = newwin(iHeight, iWidth, VIEW_OFFSET_Y, iLeft + VIEW_OFFSET_X);
|
||||
|
||||
mvwprintz(w, 1, 2, c_white, sItemName.c_str());
|
||||
int line_num = 3;
|
||||
@@ -721,23 +736,27 @@ char compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<i
|
||||
bool bStartNewLine = true;
|
||||
for (int i = 0; i < vItemDisplay.size(); i++) {
|
||||
if (vItemDisplay[i].sType == "MENU") {
|
||||
if (vItemDisplay[i].sPre == "iY") {
|
||||
if (vItemDisplay[i].sPre == "iOffsetY") {
|
||||
line_num += vItemDisplay[i].iValue;
|
||||
} else if (vItemDisplay[i].sPre == "iX") {
|
||||
} else if (vItemDisplay[i].sPre == "iOffsetX") {
|
||||
iStartX = vItemDisplay[i].iValue;
|
||||
} else {
|
||||
mvwprintz(w, line_num, iStartX, c_ltgreen, "%s", (vItemDisplay[i].sName).c_str());
|
||||
nc_color nameColor = c_ltgreen; //pre-existing behavior, so make it the default
|
||||
//patched to allow variable "name" coloring, e.g. for item examining
|
||||
if (vItemDisplay[i].iValue >= 0) {
|
||||
nameColor = vItemDisplay[i].iValue == 0 ? c_ltgray : c_ltred;
|
||||
}
|
||||
mvwprintz(w, line_num, iStartX, nameColor, "%s", (vItemDisplay[i].sName).c_str());
|
||||
wprintz(w, c_white, "%s", (vItemDisplay[i].sPre).c_str());
|
||||
line_num++;
|
||||
}
|
||||
} else if (vItemDisplay[i].sType == "DESCRIPTION") {
|
||||
std::string sText = vItemDisplay[i].sName;
|
||||
std::replace(sText.begin(), sText.end(), '\n', ' ');
|
||||
int iPos;
|
||||
while (1) {
|
||||
line_num++;
|
||||
if (sText.size() > 36) {
|
||||
int iPos = sText.find_last_of(' ', 36);
|
||||
if (sText.size() > iWidth-4) {
|
||||
int iPos = sText.find_last_of(' ', iWidth-4);
|
||||
mvwprintz(w, line_num, 2, c_white, (sText.substr(0, iPos)).c_str());
|
||||
sText = sText.substr(iPos+1, sText.size());
|
||||
} else {
|
||||
@@ -807,7 +826,7 @@ char compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<i
|
||||
char ch = ' ';
|
||||
|
||||
wrefresh(w);
|
||||
if (!bLeft) {
|
||||
if (iLeft > 0) {
|
||||
ch = getch();
|
||||
werase(w);
|
||||
wrefresh(w);
|
||||
@@ -837,7 +856,7 @@ char rand_char()
|
||||
|
||||
// this translates symbol y, u, n, b to NW, NE, SE, SW lines correspondingly
|
||||
// h, j, c to horizontal, vertical, cross correspondingly
|
||||
long special_symbol (char sym)
|
||||
long special_symbol (long sym)
|
||||
{
|
||||
switch (sym)
|
||||
{
|
||||
@@ -888,7 +907,56 @@ std::string word_rewrap (const std::string &in, int width){
|
||||
return o.str();
|
||||
}
|
||||
|
||||
void draw_tab(WINDOW *w, int iOffsetX, std::string sText, bool bSelected)
|
||||
{
|
||||
int iOffsetXRight = iOffsetX + sText.size() + 1;
|
||||
|
||||
mvwputch(w, 0, iOffsetX, c_ltgray, LINE_OXXO); // |^
|
||||
mvwputch(w, 0, iOffsetXRight, c_ltgray, LINE_OOXX); // ^|
|
||||
mvwputch(w, 1, iOffsetX, c_ltgray, LINE_XOXO); // |
|
||||
mvwputch(w, 1, iOffsetXRight, c_ltgray, LINE_XOXO); // |
|
||||
|
||||
mvwprintz(w, 1, iOffsetX+1, (bSelected) ? h_ltgray : c_ltgray, sText.c_str());
|
||||
|
||||
for (int i = iOffsetX+1; i < iOffsetXRight; i++)
|
||||
mvwputch(w, 0, i, c_ltgray, LINE_OXOX); // -
|
||||
|
||||
if (bSelected) {
|
||||
mvwputch(w, 1, iOffsetX-1, h_ltgray, '<');
|
||||
mvwputch(w, 1, iOffsetXRight+1, h_ltgray, '>');
|
||||
|
||||
for (int i = iOffsetX+1; i < iOffsetXRight; i++)
|
||||
mvwputch(w, 2, i, c_black, ' ');
|
||||
|
||||
mvwputch(w, 2, iOffsetX, c_ltgray, LINE_XOOX); // _|
|
||||
mvwputch(w, 2, iOffsetXRight, c_ltgray, LINE_XXOO); // |_
|
||||
|
||||
} else {
|
||||
mvwputch(w, 2, iOffsetX, c_ltgray, LINE_XXOX); // _|_
|
||||
mvwputch(w, 2, iOffsetXRight, c_ltgray, LINE_XXOX); // _|_
|
||||
}
|
||||
}
|
||||
|
||||
void hit_animation(int iX, int iY, nc_color cColor, char cTile, int iTimeout)
|
||||
{
|
||||
WINDOW *w_hit = newwin(1, 1, iY+VIEW_OFFSET_Y, iX+VIEW_OFFSET_X);
|
||||
if (w_hit == NULL) {
|
||||
return; //we passed in negative values (semi-expected), so let's not segfault
|
||||
}
|
||||
|
||||
mvwputch(w_hit, 0, 0, cColor, cTile);
|
||||
wrefresh(w_hit);
|
||||
|
||||
if (iTimeout <= 0 || iTimeout > 999) {
|
||||
iTimeout = 70;
|
||||
}
|
||||
|
||||
timeout(iTimeout);
|
||||
getch(); //useing this, because holding down a key with nanosleep can get yourself killed
|
||||
timeout(-1);
|
||||
|
||||
/*timespec ts;
|
||||
ts.tv_sec = 0;
|
||||
ts.tv_nsec = iTimeout * 1000 * 1000; //100ms
|
||||
nanosleep(&ts, NULL);*/
|
||||
}
|
||||
|
||||
@@ -21,6 +21,16 @@
|
||||
#define LINE_OXXX 4194423
|
||||
#define LINE_XXXX 4194414
|
||||
|
||||
// Display data
|
||||
extern int TERMX;
|
||||
extern int TERMY;
|
||||
extern int VIEWX;
|
||||
extern int VIEWY;
|
||||
extern int VIEW_OFFSET_X;
|
||||
extern int VIEW_OFFSET_Y;
|
||||
extern int TERRAIN_WINDOW_WIDTH;
|
||||
extern int TERRAIN_WINDOW_HEIGHT;
|
||||
|
||||
void mvputch(int y, int x, nc_color FG, long ch);
|
||||
void wputch(WINDOW* w, nc_color FG, long ch);
|
||||
void mvwputch(WINDOW* w, int y, int x, nc_color FG, long ch);
|
||||
@@ -51,16 +61,22 @@ void popup_top(const char *mes, ...); // Displayed at the top of the screen
|
||||
void popup(const char *mes, ...);
|
||||
void popup_nowait(const char *mes, ...); // Doesn't wait for spacebar
|
||||
void full_screen_popup(const char *mes, ...);
|
||||
char compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare);
|
||||
char compare_split_screen_popup(int iLeft, int iWidth, int iHeight, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare);
|
||||
|
||||
nc_color hilite(nc_color c);
|
||||
nc_color invert_color(nc_color c);
|
||||
nc_color red_background(nc_color c);
|
||||
nc_color rand_color();
|
||||
char rand_char();
|
||||
long special_symbol (char sym);
|
||||
long special_symbol (long sym);
|
||||
|
||||
// utility: moves \n's around to fit string breaks within a certain width.
|
||||
std::string word_rewrap (const std::string &in, int width);
|
||||
|
||||
// short visual animation (player, monster, ...) (hit, dodge, ...)
|
||||
void hit_animation(int iX, int iY, nc_color cColor, char cTile, int iTimeout = 70);
|
||||
|
||||
void draw_tab(WINDOW *w, int iOffsetX, std::string sText, bool bSelected);
|
||||
void clear_window(WINDOW* w);
|
||||
|
||||
#endif
|
||||
|
||||
+900
-809
File diff suppressed because it is too large
Load Diff
@@ -13,6 +13,10 @@
|
||||
class npc;
|
||||
struct settlement;
|
||||
|
||||
#define OVERMAP_DEPTH 10
|
||||
#define OVERMAP_HEIGHT 0
|
||||
#define OVERMAP_LAYERS (1 + OVERMAP_DEPTH + OVERMAP_HEIGHT)
|
||||
|
||||
struct city {
|
||||
int x;
|
||||
int y;
|
||||
@@ -38,19 +42,27 @@ struct radio_tower {
|
||||
x (X), y (Y), strength (S), message (M) {}
|
||||
};
|
||||
|
||||
struct map_layer {
|
||||
oter_id terrain[OMAPX][OMAPY];
|
||||
bool visible[OMAPX][OMAPY];
|
||||
std::vector<om_note> notes;
|
||||
|
||||
map_layer() : terrain(), visible(), notes() {}
|
||||
};
|
||||
|
||||
class overmap
|
||||
{
|
||||
public:
|
||||
overmap();
|
||||
overmap(const overmap & om);
|
||||
overmap(game *g, int x, int y, int z);
|
||||
overmap(overmap const&);
|
||||
overmap(game *g, int x, int y);
|
||||
~overmap();
|
||||
void save(std::string name);
|
||||
void save(std::string name, int x, int y, int z);
|
||||
void open(game *g, int x, int y, int z);
|
||||
void generate(game *g, overmap* north, overmap* east, overmap* south,
|
||||
overmap* west);
|
||||
void generate_sub(overmap* above);
|
||||
|
||||
overmap& operator=(overmap const&);
|
||||
|
||||
point const& pos() const { return loc; }
|
||||
|
||||
void save();
|
||||
void make_tutorial();
|
||||
void first_house(int &x, int &y);
|
||||
|
||||
@@ -64,47 +76,61 @@ class overmap
|
||||
* Use must_be_seen=true if only terrain seen by the player should be searched.
|
||||
* If no such tile can be found, (-1, -1) is returned.
|
||||
*/
|
||||
// TODO: make this 3d
|
||||
point find_closest(point origin, oter_id type, int type_range,
|
||||
int &dist, bool must_be_seen);
|
||||
std::vector<point> find_all(point origin, oter_id type, int type_range,
|
||||
int &dist, bool must_be_seen);
|
||||
std::vector<point> find_terrain(std::string term, int cursx, int cursy);
|
||||
std::vector<point> find_all(tripoint origin, oter_id type, int type_range,
|
||||
int &dist, bool must_be_seen);
|
||||
std::vector<point> find_terrain(std::string term, int cursx, int cursy, int zlevel);
|
||||
int closest_city(point p);
|
||||
point random_house_in_city(int city_id);
|
||||
int dist_from_city(point p);
|
||||
// Interactive point choosing; used as the map screen
|
||||
point choose_point(game *g);
|
||||
point choose_point(game *g, int const z);
|
||||
|
||||
bool ter_in_type_range(int x, int y, oter_id type, int type_range);
|
||||
oter_id& ter(int x, int y);
|
||||
unsigned zones(int x, int y);
|
||||
std::vector<mongroup*> monsters_at(int x, int y);
|
||||
bool is_safe(int x, int y); // true if monsters_at is empty, or only woodland
|
||||
bool& seen(int x, int y);
|
||||
bool ter_in_type_range(int x, int y, int z, oter_id type, int type_range);
|
||||
oter_id& ter(int x, int y, int z);
|
||||
bool& seen(int x, int y, int z);
|
||||
std::vector<mongroup*> monsters_at(int x, int y, int z);
|
||||
bool is_safe(int x, int y, int z); // true if monsters_at is empty, or only woodland
|
||||
|
||||
bool has_note(int x, int y);
|
||||
std::string note(int x, int y);
|
||||
void add_note(int x, int y, std::string message);
|
||||
point find_note(point origin, std::string text);
|
||||
void delete_note(int x, int y);
|
||||
point display_notes();
|
||||
bool has_note(int const x, int const y, int const z) const;
|
||||
std::string const& note(int const x, int const y, int const z) const;
|
||||
void add_note(int const x, int const y, int const z, std::string const& message);
|
||||
void delete_note(int const x, int const y, int const z) { add_note(x, y, z, ""); }
|
||||
point display_notes(game* g, int const z) const;
|
||||
|
||||
point find_note(int const x, int const y, int const z, std::string const& text) const;
|
||||
|
||||
// TODO: make private
|
||||
std::vector<mongroup> zg;
|
||||
std::vector<radio_tower> radios;
|
||||
std::vector<npc> npcs;
|
||||
std::vector<city> cities;
|
||||
std::vector<city> roads_out;
|
||||
std::vector<settlement> towns;
|
||||
std::vector<mongroup> zg;
|
||||
std::vector<radio_tower> radios;
|
||||
int posx, posy, posz;
|
||||
std::vector<npc> npcs;
|
||||
|
||||
private:
|
||||
oter_id t[OMAPX][OMAPY];
|
||||
point loc;
|
||||
std::string prefix;
|
||||
std::string name;
|
||||
|
||||
//map_layer layer[OVERMAP_LAYERS];
|
||||
map_layer *layer;
|
||||
|
||||
oter_id nullret;
|
||||
bool s[OMAPX][OMAPY];
|
||||
bool nullbool;
|
||||
std::vector<om_note> notes;
|
||||
std::string nullstr;
|
||||
|
||||
// Initialise
|
||||
void init_layers();
|
||||
void open(game *g);
|
||||
void generate(game *g, overmap* north, overmap* east, overmap* south,
|
||||
overmap* west);
|
||||
bool generate_sub(int const z);
|
||||
|
||||
//Drawing
|
||||
void draw(WINDOW *w, game *g, int &cursx, int &cursy,
|
||||
void draw(WINDOW *w, game *g, int z, int &cursx, int &cursy,
|
||||
int &origx, int &origy, char &ch, bool blink);
|
||||
// Overall terrain
|
||||
void place_river(point pa, point pb);
|
||||
@@ -113,35 +139,37 @@ class overmap
|
||||
void place_cities();
|
||||
void put_buildings(int x, int y, int dir, city town);
|
||||
void make_road(int cx, int cy, int cs, int dir, city town);
|
||||
void build_lab(int x, int y, int s);
|
||||
void build_anthill(int x, int y, int s);
|
||||
void build_tunnel(int x, int y, int s, int dir);
|
||||
void build_slimepit(int x, int y, int s);
|
||||
void build_mine(int x, int y, int s);
|
||||
void place_rifts();
|
||||
bool build_lab(int x, int y, int z, int s);
|
||||
void build_anthill(int x, int y, int z, int s);
|
||||
void build_tunnel(int x, int y, int z, int s, int dir);
|
||||
bool build_slimepit(int x, int y, int z, int s);
|
||||
void build_mine(int x, int y, int z, int s);
|
||||
void place_rifts(int const z);
|
||||
// Connection highways
|
||||
void place_hiways(std::vector<city> cities, oter_id base);
|
||||
void place_hiways(std::vector<city> cities, int z, oter_id base);
|
||||
void place_subways(std::vector<point> stations);
|
||||
void make_hiway(int x1, int y1, int x2, int y2, oter_id base);
|
||||
void make_hiway(int x1, int y1, int x2, int y2, int z, oter_id base);
|
||||
void building_on_hiway(int x, int y, int dir);
|
||||
// Polishing
|
||||
bool is_road(oter_id base, int x, int y); // Dependant on road type
|
||||
bool is_road(int x, int y);
|
||||
void polish(oter_id min = ot_null, oter_id max = ot_tutorial);
|
||||
void good_road(oter_id base, int x, int y);
|
||||
void good_river(int x, int y);
|
||||
bool is_road(oter_id base, int x, int y, int z); // Dependant on road type
|
||||
bool is_road(int x, int y, int z);
|
||||
void polish(int z, oter_id min = ot_null, oter_id max = ot_tutorial);
|
||||
void good_road(oter_id base, int x, int y, int z);
|
||||
void good_river(int x, int y, int z);
|
||||
// Monsters, radios, etc.
|
||||
void place_specials();
|
||||
void place_special(overmap_special special, point p);
|
||||
void place_special(overmap_special special, tripoint p);
|
||||
void place_mongroups();
|
||||
void place_radios();
|
||||
// File I/O
|
||||
|
||||
friend std::ostream & operator<<(std::ostream &, const overmap *);
|
||||
std::string terrain_filename(int const x, int const y) const;
|
||||
std::string player_filename(int const x, int const y) const;
|
||||
};
|
||||
|
||||
std::ostream & operator<<(std::ostream &, const overmap *);
|
||||
std::ostream & operator<<(std::ostream &, const overmap &);
|
||||
std::ostream & operator<<(std::ostream &, const city &);
|
||||
// TODO: readd the stream operators
|
||||
//std::ostream & operator<<(std::ostream &, const overmap *);
|
||||
//std::ostream & operator<<(std::ostream &, const overmap &);
|
||||
//std::ostream & operator<<(std::ostream &, const city &);
|
||||
|
||||
#endif
|
||||
|
||||
+1263
-617
File diff suppressed because it is too large
Load Diff
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user