Compare commits
1682 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1cd0f1f61d | |||
| 783f0ef4a2 | |||
| a98b011ed6 | |||
| c8b7515f38 | |||
| 78df118350 | |||
| 0b035b344c | |||
| afcec85b1c | |||
| 29dcc1960c | |||
| 45498558f9 | |||
| d7b08463ea | |||
| 2eb0ad444e | |||
| 7b7b50dad7 | |||
| a5620124d6 | |||
| 7642811bbf | |||
| 9457aacdf0 | |||
| 9b15e7fcf8 | |||
| 1f4459aafd | |||
| 8ab3b1a1cf | |||
| 085dcfd617 | |||
| 8e722ea716 | |||
| f15a4de104 | |||
| 10e3ae9f33 | |||
| 331bc16d61 | |||
| 77c87667db | |||
| c8ce78afd0 | |||
| ef83b84f8b | |||
| a395843c68 | |||
| 7615f98ff7 | |||
| a6494f5ad5 | |||
| 379c161446 | |||
| 0c734d6832 | |||
| 06e7288463 | |||
| a1833b71bb | |||
| 47fb78f48f | |||
| 3062f7b1c5 | |||
| 685d36e801 | |||
| 928fc755cc | |||
| 3942bb6bde | |||
| 740ccdeae5 | |||
| 43ab59355c | |||
| 01975326ff | |||
| d19eb1b420 | |||
| 6d6df3b0e0 | |||
| 5ed3f2cdc3 | |||
| fd856d47cd | |||
| 432aa7a7f9 | |||
| 60d84eb9c7 | |||
| 22a998a486 | |||
| 8d25113870 | |||
| 8eed366797 | |||
| 829b4c4755 | |||
| 52db89f7c8 | |||
| 49e7c28584 | |||
| 6377d81abc | |||
| 3c1b528685 | |||
| 8f290fcc86 | |||
| e0e1f3e654 | |||
| b663eef6f0 | |||
| 0ff829de6a | |||
| c7e5684425 | |||
| 3df4b1af97 | |||
| 35ae82ec91 | |||
| 34f6fb4e8d | |||
| 7e53e362b3 | |||
| 6319f032ec | |||
| 26c3919ded | |||
| e9fe6943b3 | |||
| b5c37c493e | |||
| 9a83ba77d2 | |||
| e397c29983 | |||
| a49daf240c | |||
| e0ee49cfef | |||
| 0ead765da9 | |||
| 0ec54e1dcf | |||
| efe30fdc31 | |||
| faf89f3c8e | |||
| 195a68e9e1 | |||
| b804dde202 | |||
| d95c55f8c4 | |||
| 195446684f | |||
| 447fa2e768 | |||
| 1035cc8ba6 | |||
| 7929120aa8 | |||
| 0696961ea7 | |||
| e558e38487 | |||
| df013ad57b | |||
| 06f5c8ddd7 | |||
| c5e5541282 | |||
| ab984471bd | |||
| ca48e195b2 | |||
| 2ee0736a5a | |||
| 9d766a375f | |||
| 89e2fabaf4 | |||
| c91b3ebaa2 | |||
| 77bb0fe85f | |||
| 678b3f5f5c | |||
| 17a6d312a7 | |||
| cc5bccdf33 | |||
| a62858a5a5 | |||
| ab6425d526 | |||
| 7bad2dfd0a | |||
| ac4c9c60d3 | |||
| bc07a5179f | |||
| 61e4d140e3 | |||
| 07317608bc | |||
| b32ff5badc | |||
| 4653350687 | |||
| 8a2cc5493c | |||
| a97b899e74 | |||
| fb3ba56953 | |||
| 0ee8e83212 | |||
| 16ab75d7fa | |||
| 3a4c5e8047 | |||
| 26611e970f | |||
| 9d984bbd5f | |||
| 141d788990 | |||
| ef00549452 | |||
| 5f3ccbcf1c | |||
| 552a6d3cd4 | |||
| efa46c5d62 | |||
| 92739fdbeb | |||
| 84a0becfe4 | |||
| 31c5694c10 | |||
| 1c0e09c334 | |||
| 5aa4104683 | |||
| d626730dd2 | |||
| f3b0bcb7c9 | |||
| 6db72c165c | |||
| d67fc55322 | |||
| 78942cc30f | |||
| 0f682ec45e | |||
| d4f500787b | |||
| 986b7a07f0 | |||
| 835652c5d2 | |||
| 6f63dd7522 | |||
| ab15f1a879 | |||
| 4f8010d0a0 | |||
| 0988944949 | |||
| c52f6b9048 | |||
| 1e07470c98 | |||
| 61113a8dd9 | |||
| 5acbb5b3db | |||
| ebecd3b40e | |||
| 01cc3f6bf7 | |||
| fcee31c237 | |||
| 21855e2176 | |||
| 68cadcb52c | |||
| a28693139d | |||
| 2e3af258b4 | |||
| 528edd10b2 | |||
| 8bf2035d3c | |||
| 25c9986d4d | |||
| 0c759878bd | |||
| 903feb9bc1 | |||
| 23f088e938 | |||
| c9ef1d465b | |||
| 9d61f574e8 | |||
| 01bfde4bc7 | |||
| f673fe21d2 | |||
| 7f5d6f8383 | |||
| a9606106cd | |||
| 029ce0d948 | |||
| 97e822da48 | |||
| 25b58a0873 | |||
| d9dcdb8915 | |||
| c02fd28af1 | |||
| a22522a725 | |||
| 8dc7cd36fe | |||
| 49b3b63d72 | |||
| d2501bc030 | |||
| 97b9331afb | |||
| 6451098bd8 | |||
| 510c759f64 | |||
| 6363ad61f7 | |||
| 551fc095ac | |||
| 7cfb3e9369 | |||
| 222ce076f5 | |||
| d7d7b8bf49 | |||
| b5ace4ad2a | |||
| 35eea03570 | |||
| 91449a4fc0 | |||
| 3e835b85a0 | |||
| 0816af5cb8 | |||
| a783ea88d3 | |||
| 8e4024afb0 | |||
| d29b244ff3 | |||
| 092793805b | |||
| 3d5ba4eae8 | |||
| 4350320437 | |||
| 3153790ac8 | |||
| 2316fd5911 | |||
| b8519ed9c7 | |||
| 4183d70999 | |||
| 9a8283e121 | |||
| 6f96ab0173 | |||
| 9f48d73510 | |||
| 305d1f5cdd | |||
| b1a8c6d395 | |||
| bd364111dc | |||
| e9745bba42 | |||
| 3882cb5cc2 | |||
| 7920ca2d48 | |||
| 8673eea0a1 | |||
| dc2d6a7244 | |||
| 34d4b97189 | |||
| eb0f327c49 | |||
| 877b136f02 | |||
| 705a2f25d6 | |||
| 10ce9024f4 | |||
| 40350df34f | |||
| ad3c7828d4 | |||
| 25dd4be923 | |||
| 9474e84e35 | |||
| ede15e1a8f | |||
| b51549e20a | |||
| b9f6c70b95 | |||
| 6359d73864 | |||
| f8a43b5053 | |||
| f7b4bb5635 | |||
| 27f6f4064a | |||
| 783bc2cc18 | |||
| 524ad4a5e1 | |||
| 3ed605f45f | |||
| dcca01a26d | |||
| deedf81e90 | |||
| bd387006f4 | |||
| ed149d8ef3 | |||
| 086e56c81d | |||
| 3b561a037e | |||
| e97fd63d8b | |||
| 9475956cdc | |||
| f74a85320e | |||
| d314685789 | |||
| 42d5e77536 | |||
| 6d35478837 | |||
| be01f5fcab | |||
| ad9f771c02 | |||
| 268819aa44 | |||
| 865b5ec6ba | |||
| d2d7cc175e | |||
| a195837be5 | |||
| 3ee1b69be4 | |||
| cec14342fa | |||
| e6b8b4b858 | |||
| 9d7ed3b561 | |||
| 723002d92b | |||
| 05037ceed2 | |||
| f4795426be | |||
| acdf2094d0 | |||
| bbd5143dc3 | |||
| 9e23cf1a92 | |||
| edafe2e453 | |||
| e11b84b982 | |||
| 8c1751c0b5 | |||
| eafd32048b | |||
| 8712b85bea | |||
| b9b08294c9 | |||
| f162d0f195 | |||
| ff98c8c4db | |||
| 3f13bb9f25 | |||
| ce19e1bf8d | |||
| f64cb83838 | |||
| d790f8f9ba | |||
| f42e20b48d | |||
| 5f6441214b | |||
| ded915d780 | |||
| a711120781 | |||
| ec1e7b63e1 | |||
| 6479dfcbe2 | |||
| d3462eca05 | |||
| 479f6feb6c | |||
| d897f1b9cb | |||
| c37e641e6b | |||
| e098d1d39b | |||
| a2727180df | |||
| 79fc31c74f | |||
| cda170ff64 | |||
| 7fceef44f2 | |||
| d1e11bf78a | |||
| 3957eb2bf6 | |||
| bb56645fb0 | |||
| 04bd38a2ab | |||
| 78591cd9ca | |||
| fe2b68697b | |||
| 4d27d8a250 | |||
| c474d10f77 | |||
| 600130b1a1 | |||
| 602e64dafe | |||
| 22f93982df | |||
| 6bb10531bc | |||
| eb345f04c2 | |||
| 96a4d54295 | |||
| ca9a57c684 | |||
| 9074961c55 | |||
| 909ca50c49 | |||
| c0f8cea2cf | |||
| c4318c4e3d | |||
| 14eb3ddd4f | |||
| 8a3bec3f62 | |||
| 697cba3bb5 | |||
| b5087e1ed4 | |||
| fd689a4a3b | |||
| e38776ab89 | |||
| 06696b6002 | |||
| 491273bd35 | |||
| 4182ff8bf5 | |||
| 49589a2406 | |||
| 65e992f0c2 | |||
| 15df8f7f37 | |||
| 73378e1456 | |||
| 6bf376f3cf | |||
| 1708fc2b3b | |||
| 91f2a5a00a | |||
| 748d7561d8 | |||
| 1faf1e61c0 | |||
| 2dbd68c703 | |||
| 08e8426cbd | |||
| c68bb0f295 | |||
| ef62aeaa65 | |||
| c288630d74 | |||
| d9de70eb3f | |||
| 9e3482b8ef | |||
| d578c09c85 | |||
| 3d03d8c2a7 | |||
| 3c70c9475c | |||
| 68551c1145 | |||
| 348e83c86a | |||
| 3983e49459 | |||
| a09087b3f2 | |||
| 4e66ed5cb3 | |||
| ff458e43ea | |||
| 4466f7e315 | |||
| 1140e5a28a | |||
| 9bef3b10ef | |||
| eb27dae044 | |||
| 0a2bfc91f4 | |||
| d0e47205ea | |||
| 431c9cdb1f | |||
| 2a77a1307e | |||
| 4e964a58f9 | |||
| 37d1a0b365 | |||
| aeee7fa419 | |||
| af799bc6c4 | |||
| efd23ef434 | |||
| 0cb717e342 | |||
| d13ca72b67 | |||
| d85b39e41f | |||
| 6a570f0c53 | |||
| 1ec122d162 | |||
| cf1fcdde28 | |||
| 2dd42317ef | |||
| 7da807e1be | |||
| 989be8275d | |||
| 5485b75e2f | |||
| 55e1197800 | |||
| 3cb3dce7f2 | |||
| 294c04cc1e | |||
| 9bbefa16e8 | |||
| b66fd49c8e | |||
| 424bcf0b5d | |||
| 78d87c8e4c | |||
| 11f18517f4 | |||
| 7eff9b9fe1 | |||
| fec629aa4f | |||
| 66e8cdf26b | |||
| 015a8b5284 | |||
| 6ad3169434 | |||
| 0379189c17 | |||
| ac4c785fb8 | |||
| e08ceb81db | |||
| 4495a9369f | |||
| 11fac6058d | |||
| 098887a329 | |||
| f394fa7b92 | |||
| 0da409648c | |||
| 9108c53e5d | |||
| 22c3301c5b | |||
| e22b6f6e81 | |||
| 2ab5e43c29 | |||
| 40318b986d | |||
| a8051ba330 | |||
| d4bbbf352b | |||
| 95b0f791c2 | |||
| 6f1ddd2126 | |||
| 03153ebfc5 | |||
| 2e475fa83d | |||
| b0345c2f7b | |||
| 9f94ff602b | |||
| ec1f8c0656 | |||
| 8f9f2b81fa | |||
| 2e40eeaf57 | |||
| 195d8caba5 | |||
| f0eb67f2df | |||
| aec010d4aa | |||
| 61d7722d58 | |||
| 5510fdda83 | |||
| c2d5d6b845 | |||
| 688263a4b2 | |||
| b505b82a6c | |||
| ed4ca9497d | |||
| b04f51abe3 | |||
| 41950db139 | |||
| ac3bebf8bc | |||
| a9e0ee9515 | |||
| 1bfb4bec63 | |||
| d62c714434 | |||
| 1d84ccf2b5 | |||
| 9a79713510 | |||
| 5f87fcd549 | |||
| 98779857d6 | |||
| e7fb33496e | |||
| 1bc4f249de | |||
| d6b05e978e | |||
| 76bbf9779d | |||
| aaff40057e | |||
| 6dae388bcf | |||
| 32e2942650 | |||
| fd9975c5ff | |||
| db5c679e8d | |||
| a6d32cde1a | |||
| f34568ee60 | |||
| bbbe83ffdc | |||
| 01f5296a1d | |||
| 3fbca61610 | |||
| 3367e0cf13 | |||
| 98220d9e36 | |||
| 2d8967f603 | |||
| cbfe708f36 | |||
| 2be2924e05 | |||
| ea7211ab97 | |||
| 8047cbf4ff | |||
| b7d0bae27e | |||
| ad1920876c | |||
| 46bcc0845a | |||
| 95f3b83ff3 | |||
| 4ca94f6bb1 | |||
| 1941b4de71 | |||
| 5edcfdcd26 | |||
| 397b231583 | |||
| dcf02f0d67 | |||
| 6402bcf27b | |||
| 80ece8d258 | |||
| 03a6364d9b | |||
| be6647066c | |||
| a720914bb5 | |||
| 4a6764af79 | |||
| 1662931a47 | |||
| 7b21957354 | |||
| e93219ff14 | |||
| ea1d558122 | |||
| f625fe9122 | |||
| 823feaf118 | |||
| 04099f616a | |||
| 45366ee295 | |||
| 2cea5dddbf | |||
| 06a6c3edda | |||
| 361dd56d86 | |||
| 65add6f7e0 | |||
| f8e8578d6f | |||
| 23adb8980e | |||
| 4628c57a0e | |||
| e36d22b247 | |||
| e6ecd0f808 | |||
| 9bbac19deb | |||
| 70ef2c462d | |||
| 68952a196e | |||
| 08b2937f6d | |||
| bd488e0d43 | |||
| ac6097c90e | |||
| 3f8c412ed5 | |||
| 2668d71da3 | |||
| cd027374a8 | |||
| 4851b6b46e | |||
| 4274b47aaf | |||
| fbdc5d645c | |||
| 5e344b212a | |||
| a75932c41f | |||
| 7bb642a151 | |||
| ec3e7159ba | |||
| 1bbb0450e9 | |||
| 87dc9c95bc | |||
| bf6de1f221 | |||
| 2dda9136b1 | |||
| 68440d6b9b | |||
| 143b697272 | |||
| 3af4f50a0b | |||
| c8278a4a01 | |||
| 0ca7b343d7 | |||
| 3f928311a3 | |||
| 0c6d4d0df6 | |||
| efd7a7a1d1 | |||
| c533b3e5e3 | |||
| 3ef72e3278 | |||
| efc0cc8e76 | |||
| c16218cd12 | |||
| db7d4073f7 | |||
| c380b77f64 | |||
| 1b3d547a1f | |||
| ba78704a74 | |||
| 215ee8a0a9 | |||
| 84a87fe6ad | |||
| d4e9057939 | |||
| 0e1660efce | |||
| 50977e8062 | |||
| 0cedbf6955 | |||
| 03d7f7385d | |||
| 1923bd5137 | |||
| 653900fd85 | |||
| 439279c069 | |||
| ca0a7a614f | |||
| 8dd5e8df67 | |||
| 434c9057a4 | |||
| 850b41c92c | |||
| 239740ad6a | |||
| 65d19be1be | |||
| 7c92f74668 | |||
| ae4a3c3118 | |||
| d102b0d6e2 | |||
| 767475355e | |||
| ed83664888 | |||
| dbbc4fe323 | |||
| 2054755efa | |||
| 44d3adbc92 | |||
| 7ecfbef8ce | |||
| 72e2ccb419 | |||
| 314c05c059 | |||
| 86d7cabfc2 | |||
| f28e427a04 | |||
| 95937d27b6 | |||
| 8b67bd05b9 | |||
| 1e78e6f302 | |||
| b6a1dadafc | |||
| 0a313cf103 | |||
| a0200f5922 | |||
| 78d067e51b | |||
| 95207ca2cb | |||
| 56efd2853c | |||
| ef4766f1f1 | |||
| 97b4043be2 | |||
| 94345a60e5 | |||
| 318f7771b8 | |||
| b8094625c8 | |||
| fb80910a1b | |||
| fe2af5a9e9 | |||
| 84244301c0 | |||
| ee2578039c | |||
| 7ede782371 | |||
| 6adb425ab4 | |||
| 076fe953a8 | |||
| 78ae253b7e | |||
| 6284c7f310 | |||
| 8cac4f05c2 | |||
| e5a6fa0f5f | |||
| 7c4db80ac4 | |||
| 7ac4ae9bfa | |||
| d35a2ebb8d | |||
| bf8c56c511 | |||
| 7b3f6542e7 | |||
| 269b04cb1f | |||
| 1a10ceaa25 | |||
| c14902154c | |||
| 0f06505787 | |||
| 37d8d33244 | |||
| f7e9e9b41b | |||
| 36c0eb27e0 | |||
| ee54b68f33 | |||
| 8f11e360a9 | |||
| 55d84400b9 | |||
| 16702223b4 | |||
| 218a8e9807 | |||
| 3474800769 | |||
| ccf0dbb5fd | |||
| 556d60b4d2 | |||
| 3dccc08411 | |||
| aac52183f5 | |||
| af048b1bbc | |||
| 1ae24a17ff | |||
| ec96820550 | |||
| 892fe144ca | |||
| 6cc77411e4 | |||
| 0b87149c28 | |||
| c732772315 | |||
| 779184be8f | |||
| 34bf1926d9 | |||
| d39962b38b | |||
| 214b3ef0b7 | |||
| a850c62f91 | |||
| 988ed77f5c | |||
| 56127dd975 | |||
| e92496ff5a | |||
| 97278bac0b | |||
| b73395132f | |||
| 9d78235b17 | |||
| ac7ad13d59 | |||
| 360a3279a1 | |||
| 79c53e5a95 | |||
| bb1872ac1a | |||
| 5167440503 | |||
| d55064493c | |||
| 03ff172e16 | |||
| 16bf49adde | |||
| c8e359644c | |||
| 7566c8bd50 | |||
| b030902cd8 | |||
| 19292eda23 | |||
| 833dc0f746 | |||
| 042e838ceb | |||
| 0f7e91ea4b | |||
| 8ab097029d | |||
| 8d321fac3e | |||
| a68f1c9019 | |||
| 6d0840b2e0 | |||
| c16266e59d | |||
| 3d16bb6bb9 | |||
| d49b4f1677 | |||
| 19ad248bd8 | |||
| ee92ac51fe | |||
| 66005e3056 | |||
| 514f277a16 | |||
| 8e2096e93a | |||
| b6ce97120f | |||
| fcb0a4daa9 | |||
| 85adbf7fe2 | |||
| 09d37a86a0 | |||
| fcaa32ec5c | |||
| d8ded8228e | |||
| 569cf05f50 | |||
| 1c183d9406 | |||
| 6c9f84b42c | |||
| 0dcb206f78 | |||
| 71d60cb2d1 | |||
| 22dd9dfc5e | |||
| f05d81673d | |||
| bb93200423 | |||
| 2f13f6636c | |||
| 333ee08d62 | |||
| d70e73cd2f | |||
| 1b691b1279 | |||
| d67d368a25 | |||
| cdd37aef00 | |||
| fd5623160a | |||
| 75d63194e1 | |||
| 382f3c351e | |||
| 4c9137a6ba | |||
| 1ea167a34d | |||
| 2a440181f4 | |||
| 6ea9bd624e | |||
| 1a0a051ccb | |||
| db1f3e7707 | |||
| 0a50ad2ecc | |||
| 53ee7d5878 | |||
| 1f8acf900e | |||
| 20765e1ea8 | |||
| 25c5c88a74 | |||
| 6c0f80736c | |||
| 9b1f9d2c98 | |||
| fde5614ffd | |||
| f3cfa189c1 | |||
| a9b8a4badf | |||
| 0af738b937 | |||
| 60bd4c8918 | |||
| 8fd5532e95 | |||
| 1272ea7b65 | |||
| 8e4580057c | |||
| 8fa100a309 | |||
| 2290edd3fb | |||
| 0b4761a9b1 | |||
| 3eb4c6489a | |||
| e3cfb527f2 | |||
| 98d4976199 | |||
| 99aef279f8 | |||
| 89a34d39fc | |||
| e783d2528b | |||
| ca3d4a72fc | |||
| a6f1260329 | |||
| fe5c14ab59 | |||
| 92f9e3c53c | |||
| 5b6b519092 | |||
| 530b0c8e81 | |||
| 746c5be69b | |||
| 290c1de6dc | |||
| 6fbc2ee982 | |||
| 73e06f8507 | |||
| bbcc613b69 | |||
| f7fd14d17c | |||
| d97da371c3 | |||
| a675fde2e4 | |||
| 8938e47b2e | |||
| 6b7f836085 | |||
| 63923cd643 | |||
| 95e1afae3e | |||
| 47fd6137d1 | |||
| 82360b296e | |||
| 581bb99133 | |||
| 62b311f2bc | |||
| 581a1a0bbc | |||
| 684b607479 | |||
| 957439e63c | |||
| 7e3ed4a61f | |||
| fbfb9bac2e | |||
| 3d6332465b | |||
| aab1e7509e | |||
| 51048fdbad | |||
| a4172fa0f7 | |||
| e6f71af174 | |||
| b1f7d161bf | |||
| 1985b18dfa | |||
| 992d1daf25 | |||
| f407045a4a | |||
| 167ef3387e | |||
| e357c21509 | |||
| 7a1b31dd30 | |||
| 2ae15f12ab | |||
| 2257549e91 | |||
| 547457ab42 | |||
| e0430d4244 | |||
| 20eb69d706 | |||
| 4fd57be302 | |||
| 84a306b08b | |||
| b68579b4e2 | |||
| 69b3e9b77d | |||
| 1e9709f22b | |||
| 71310f885a | |||
| b62c726070 | |||
| ae5b0e746a | |||
| ce233072df | |||
| b943c93b3c | |||
| 0a88f66a58 | |||
| 1e9411426a | |||
| 3ca3b484f7 | |||
| ebda7d3a4f | |||
| e223e362b0 | |||
| b15b5b1002 | |||
| f1d601a2c4 | |||
| d207182c04 | |||
| a8bbc27b0a | |||
| a0f67902ae | |||
| 8bfd9cd380 | |||
| 874364596f | |||
| 61d99558bc | |||
| d52e9b2cd6 | |||
| 700a92ac6a | |||
| 919596eacb | |||
| 986f780fd7 | |||
| 031afc690b | |||
| a0c6c152a3 | |||
| 466fb00531 | |||
| 9f0d0a212f | |||
| fe173195b2 | |||
| f1235a08b6 | |||
| a937f01a41 | |||
| b8b4dd0fab | |||
| 8bd11deb24 | |||
| c3a29e9dcd | |||
| ba34bbb8f2 | |||
| d1f36ccfcc | |||
| 11b042bac1 | |||
| 02c8b31912 | |||
| 9373b9c163 | |||
| 2e297ec7f0 | |||
| 3a22667aa6 | |||
| b347bb83bf | |||
| f356ada0fd | |||
| 6c0568916b | |||
| d1913896c0 | |||
| e17ab1b08e | |||
| ed5a88f6da | |||
| 1af5328537 | |||
| 6fe3e4e565 | |||
| a28898441b | |||
| 4e685ba359 | |||
| ea42509125 | |||
| a994d7f1a2 | |||
| 9eee37c023 | |||
| d02feb1d5d | |||
| 48d77b97bb | |||
| c3cc3609f4 | |||
| 9046960f2a | |||
| 3da9282266 | |||
| 4a0c8f41a7 | |||
| 50321598e7 | |||
| 2be4117401 | |||
| 333554ac55 | |||
| c75167f56b | |||
| 1a6addb6ba | |||
| e0c5e4b51e | |||
| 9363f651a3 | |||
| 9e3d36d779 | |||
| 4ff76d150c | |||
| 448a359bdc | |||
| cf6d9a3e29 | |||
| 0f50711b03 | |||
| d14bfa655c | |||
| 9cbbfe2ee0 | |||
| c74d6d7a86 | |||
| 20f1ab1ef6 | |||
| 814408e639 | |||
| 066521bb54 | |||
| ff22e6a50f | |||
| bed07b632b | |||
| 409d9f8e61 | |||
| 760a8c6a08 | |||
| 4e8f6b33e7 | |||
| 812ac5864f | |||
| 73bad6e342 | |||
| d961f1d35d | |||
| d13cc7bbe5 | |||
| cff00d318d | |||
| 4e76914767 | |||
| 4fccb12826 | |||
| 14be4a7acc | |||
| e37bcefcbd | |||
| 7937bbac72 | |||
| 5ab6ee2058 | |||
| ef64daaab3 | |||
| 5ccc0d8080 | |||
| 5a176c84d0 | |||
| b65b9d5b94 | |||
| 937a5ca44c | |||
| a91a0b0dbb | |||
| e9159d3c02 | |||
| 01e3b5e063 | |||
| 34c3f2d9fc | |||
| c6b8b4202b | |||
| f5f40ec2e6 | |||
| 163e92c1d8 | |||
| ffa28ea872 | |||
| b02deeb45a | |||
| c50bc06c9c | |||
| 8def207ddf | |||
| 27dbfbefee | |||
| 33b3540a1e | |||
| cc361d8f19 | |||
| ed9826f145 | |||
| de6fd3480e | |||
| aee74ccdc5 | |||
| db4e8eeb2c | |||
| 23515bb121 | |||
| ebf8fb0177 | |||
| 5a1c0aafb2 | |||
| fdb67b69f9 | |||
| 1018865602 | |||
| 339a4b96a6 | |||
| cc2573e81d | |||
| b445f2b026 | |||
| e98c1891b6 | |||
| ca2add2332 | |||
| b17969c596 | |||
| bc8c2c052d | |||
| 2b7cb8d713 | |||
| 06a25a234b | |||
| cc31d07b98 | |||
| 16d5b46565 | |||
| f97a7e5185 | |||
| fa29a60fa4 | |||
| 9a4e6fa235 | |||
| 50f8554968 | |||
| fe67da5df2 | |||
| 697d818a99 | |||
| 73b5879c87 | |||
| 8952996c16 | |||
| fd41008a42 | |||
| 19fd360f4c | |||
| eff49db944 | |||
| 8e9d769a7c | |||
| 52d35ecd0a | |||
| 76cb4a1e92 | |||
| 5e770db4b0 | |||
| c155d3e771 | |||
| 39bf2f0b83 | |||
| ecfc2b555b | |||
| 67f9e2f22f | |||
| 341adbdd86 | |||
| 25733bc0d3 | |||
| 6cd2a52306 | |||
| dc998944a8 | |||
| b19d4e25c5 | |||
| e67f83d49c | |||
| b5658f6820 | |||
| c864072ad4 | |||
| aa79906bdf | |||
| bc5b3e37df | |||
| f13def77f1 | |||
| 8835883e7a | |||
| cc9b6fb693 | |||
| 465107b5dd | |||
| f60b03008b | |||
| dc6d27cd02 | |||
| c07a0a01a3 | |||
| e6e1cf1b90 | |||
| 0cf42d906f | |||
| c2d7c818a8 | |||
| 112d203638 | |||
| ab2192a14a | |||
| 9082f60def | |||
| 45031f1d8f | |||
| 730f264c1b | |||
| a7ca556f3b | |||
| a14eb58308 | |||
| ddb088c16b | |||
| a6f662f28f | |||
| 4f60654735 | |||
| 1b016fd4db | |||
| 095e119ef7 | |||
| b251bd36ce | |||
| 0960eb42c3 | |||
| 5d9c28b463 | |||
| ba7009bc4b | |||
| 70d9598045 | |||
| 4843518041 | |||
| fda759909f | |||
| 50332ba1c5 | |||
| 2289cd3088 | |||
| 0fa61f1998 | |||
| 514e29cb40 | |||
| 9c8aae56ba | |||
| e239e301ff | |||
| 7aa7b944f0 | |||
| 5b62eb9080 | |||
| ce7adeb7ea | |||
| 673df9aebd | |||
| 51260d5274 | |||
| 50e03e2fc7 | |||
| 8c8fd8c5c2 | |||
| c206119e85 | |||
| ec44ca7964 | |||
| ef923b87c9 | |||
| dd9249485e | |||
| 00cc4a2436 | |||
| 6fec8185d1 | |||
| b01b722c33 | |||
| ff1e4d0b66 | |||
| 73097eb284 | |||
| 65ac642977 | |||
| 87e16a5f2a | |||
| 31ccd4144b | |||
| b283e16493 | |||
| 23e6eb34ec | |||
| 78b20a7993 | |||
| 22c60b3789 | |||
| 1cf221fd87 | |||
| 2f2b5038c1 | |||
| 3d5596f74e | |||
| b47377b717 | |||
| 066ca69a7b | |||
| ee42111888 | |||
| 8cb7d77514 | |||
| 80fa320fd4 | |||
| 5af6393756 | |||
| bb74ffaff1 | |||
| c7bd14c9fa | |||
| d3647d1713 | |||
| 38f3c52b84 | |||
| 466281438c | |||
| 485fa925e7 | |||
| 0538e02dc0 | |||
| ba29e071a7 | |||
| 6f067f0995 | |||
| 83e727ccd7 | |||
| 0ea9f640df | |||
| 708ef8e8f5 | |||
| 388e5ff84f | |||
| af824e6bca | |||
| fb30f54798 | |||
| 39b8ff354b | |||
| aae82d3866 | |||
| fdccfb42b2 | |||
| 01e694efaf | |||
| 2e326de350 | |||
| 09ed66030b | |||
| b827f13abc | |||
| 21519a4a32 | |||
| e1391ad272 | |||
| ba11230b5f | |||
| 0030442c93 | |||
| 9e2f41f426 | |||
| f5367786f5 | |||
| 2c63b38829 | |||
| 050e63e12f | |||
| c9296205e7 | |||
| b1518235b6 | |||
| bf9fe279ed | |||
| ad021aadb8 | |||
| b60366c142 | |||
| 16fba6284c | |||
| 4a3c4681c1 | |||
| bd20b654eb | |||
| 3b204f6df0 | |||
| 7ce79129bc | |||
| deb8c052bd | |||
| 141fdc9a80 | |||
| c888616d9d | |||
| 3c9b8f6bff | |||
| 4ddf2b0178 | |||
| 7d80546989 | |||
| 6874535966 | |||
| 4efe14ebe5 | |||
| 4281e29814 | |||
| 5582877ca9 | |||
| b0a164928b | |||
| 6494f07212 | |||
| e54f3966fc | |||
| 279a9bd713 | |||
| ffb6cc269b | |||
| 06d9a8ad85 | |||
| 311e9842e7 | |||
| 1cb66c25e6 | |||
| 21b79fbdd8 | |||
| 09a175935c | |||
| 057a65f632 | |||
| b9fcadf4d9 | |||
| 923eeda247 | |||
| 5636362e5f | |||
| 9d39ef4428 | |||
| 58219fd309 | |||
| 314b70e7c3 | |||
| 7e728edf79 | |||
| f4e2194d8d | |||
| 88b154a6a9 | |||
| 43e6f88f15 | |||
| c6ae17fc13 | |||
| 70f0d2fda2 | |||
| 118dfafb92 | |||
| b311d68952 | |||
| 50c6fb24bd | |||
| 8fd8e9722d | |||
| fdbbe5e953 | |||
| d915d69327 | |||
| 5150be5f3b | |||
| b8cbc7fdb1 | |||
| fefd11d2fc | |||
| cc6c7d561a | |||
| d6edf8d2ec | |||
| 64d641f328 | |||
| 6eb520a095 | |||
| 8458ac3496 | |||
| 3bcdc9f854 | |||
| f778ee86a2 | |||
| 9c90bf4c30 | |||
| 8980898543 | |||
| 4f5cf8c47c | |||
| e1a0fe4181 | |||
| c73bee4927 | |||
| 0912d4b997 | |||
| a49cbfc37f | |||
| 11b8e95723 | |||
| 4269091a00 | |||
| 4f9b8f1e96 | |||
| 9b27e46bf2 | |||
| 7f3caf2bc7 | |||
| 946473384a | |||
| bbf08d18b8 | |||
| 5900a9f06a | |||
| 94c46e5d46 | |||
| 191edaaaf0 | |||
| d2fe8b4b1a | |||
| 0be21c5494 | |||
| 7beead5acf | |||
| 1cef2fdbee | |||
| f814f8db72 | |||
| 29964dea6c | |||
| 67d44ac47d | |||
| 515485c9ca | |||
| 46e5e5185b | |||
| e3e7a87c06 | |||
| 33fcd7e4a7 | |||
| 5cf8e82279 | |||
| d88ab1794a | |||
| 1122ee7c78 | |||
| e97baf1fe8 | |||
| 27ae55a6ac | |||
| a93535783d | |||
| 9fd40a77a3 | |||
| e1f244e876 | |||
| d61e3023c0 | |||
| 73d53f542f | |||
| 20a8616c00 | |||
| 9f5d3ce750 | |||
| 9f8f9c48b2 | |||
| 23cd22ef46 | |||
| f05fa032c7 | |||
| 7e6c823518 | |||
| 7142f90209 | |||
| 51ccd1dee1 | |||
| 48901ed9f5 | |||
| 54a1fc3b3a | |||
| 29f26c6967 | |||
| e2217827b4 | |||
| 9198766a5a | |||
| 7684faf67c | |||
| a01d962440 | |||
| 470a8ccc08 | |||
| f3ad25db35 | |||
| e791265eff | |||
| b1b0d50820 | |||
| 164a2c8dac | |||
| 05408ced2b | |||
| 5f2cec8dff | |||
| 37877fbf76 | |||
| d889f9f057 | |||
| 2e9d8785cb | |||
| 51d77112fe | |||
| fc6f7dd9b8 | |||
| 9be377c847 | |||
| 5b72456b80 | |||
| 80a17d0f17 | |||
| 69455c0573 | |||
| bff8159633 | |||
| f889246ea3 | |||
| 64a9db567f | |||
| 498cb106a5 | |||
| 2ae29f9c4b | |||
| 6bba43e88d | |||
| 3cdf9ba616 | |||
| 5538ea0b3e | |||
| 721256dacf | |||
| af24e6e70a | |||
| ed4d4da62c | |||
| 685e3dd7ef | |||
| ca18fe3125 | |||
| 6c39291f7f | |||
| 20b12b9790 | |||
| 7e1548fa72 | |||
| 6208d00a70 | |||
| 1f90391445 | |||
| 3da22f74cb | |||
| 440b73b99a | |||
| 4562cfb68a | |||
| 830cba6b2e | |||
| 68411e1fd3 | |||
| 5b57969620 | |||
| 0e5ae9372c | |||
| 692e3d7663 | |||
| f4fbbbcc30 | |||
| 756db54c7e | |||
| 65d85921c7 | |||
| 572a45c265 | |||
| 9f2d795b39 | |||
| 7535508ad5 | |||
| 9a434a4733 | |||
| 1767e5db95 | |||
| 8e74b2c011 | |||
| 83bb89c118 | |||
| f328c63fb2 | |||
| 4755ed4366 | |||
| 1516b240fb | |||
| 730d8dba94 | |||
| 8ff9af741a | |||
| 75b7199f79 | |||
| d56f63ce1a | |||
| 6e4366f3fe | |||
| dada465e7b | |||
| 86e8487d7b | |||
| 38e60b604a | |||
| 42cd8b4e65 | |||
| b5b00fb4fc | |||
| 05ae3c9f30 | |||
| 2770eeb57e | |||
| 02b4c0f095 | |||
| 5fb07abc23 | |||
| 049c966126 | |||
| 30219cec41 | |||
| 11cea1008f | |||
| b01d4a2a94 | |||
| fc36ea3be4 | |||
| 71934ca884 | |||
| b079323940 | |||
| 78c523e342 | |||
| 220f14d127 | |||
| 2b7df6cd55 | |||
| b9018f8159 | |||
| 8513fa26bf | |||
| a75e6fed42 | |||
| 5e20983ecf | |||
| 4ec2602c33 | |||
| 33ae4f5b95 | |||
| 5f858741fc | |||
| dfe29f2e1c | |||
| 4858457ba9 | |||
| 088412e207 | |||
| f42e077270 | |||
| b5389c050d | |||
| f30e78c27a | |||
| 61a2e08927 | |||
| 09aba18d4e | |||
| bda59fae16 | |||
| 72607bef81 | |||
| ecc249e971 | |||
| 6619ca67fb | |||
| 9d17476027 | |||
| f4d6dc512e | |||
| 40e9ed7e61 | |||
| b69cc518f8 | |||
| 4b4ee3d086 | |||
| 230b184529 | |||
| 45d2a9b118 | |||
| b70447484d | |||
| 250f133f10 | |||
| d3f2b5a5f4 | |||
| 248449ed9c | |||
| 3b2dbc2cbc | |||
| a6f30533b6 | |||
| 0bcf810973 | |||
| 53e3aec4ac | |||
| 15bbf67b59 | |||
| 6bc0f4016d | |||
| 3a2b8b9a97 | |||
| 06b86b448f | |||
| 4fd0b7645b | |||
| 3f27b8d314 | |||
| 2d26346388 | |||
| 104abb0724 | |||
| 42976d8f31 | |||
| bf389bc2e1 | |||
| 950a36a1c5 | |||
| 4e98459092 | |||
| 6c61c54080 | |||
| f773e5b53b | |||
| 6398d533bb | |||
| 59a46573ac | |||
| 23274c44bb | |||
| be009d84c5 | |||
| 2661c02c28 | |||
| 0d302ed37e | |||
| 1b04a42118 | |||
| 25b90e09d8 | |||
| de6c291f8a | |||
| 1bd96df08d | |||
| a5434b1a93 | |||
| 3b140e646c | |||
| fd5c80075d | |||
| 219b918331 | |||
| bb72502d24 | |||
| 3fd82111cd | |||
| 40c010583e | |||
| 7b6f3c83c8 | |||
| 656156c9ed | |||
| 30a7792771 | |||
| d60e329a24 | |||
| e11bb41545 | |||
| 4113da2fbc | |||
| 28e2a5249f | |||
| 4c8bbdbf87 | |||
| 4d9f79dedc | |||
| d566a863ed | |||
| 2aabb97ae5 | |||
| aaec4da0f2 | |||
| 96ce0e5a7f | |||
| e3df93e349 | |||
| 2999ceae34 | |||
| b1300c09b1 | |||
| d533039fd0 | |||
| c69717ef49 | |||
| 32cf3ff1ed | |||
| 1e6c1205c3 | |||
| 1d76f9eb0d | |||
| cd1f2b332e | |||
| b1256b61a7 | |||
| d9453558cc | |||
| b206ce466d | |||
| a6926595d5 | |||
| dd27ea987f | |||
| 05fceafad7 | |||
| 114a8a6228 | |||
| cb3240a6b7 | |||
| a69b84485b | |||
| a19533dd07 | |||
| bda64f135d | |||
| aacb2cdcfa | |||
| bdd1b7cbfe | |||
| 62d3f27572 | |||
| be2edad24b | |||
| 130e4cdba4 | |||
| 288d0f3759 | |||
| 4c1020445b | |||
| ae267664a7 | |||
| 73c07b1745 | |||
| 8f0e648a7a | |||
| 429b1d248e | |||
| 183399d114 | |||
| eb1959689e | |||
| e9b38fdcb0 | |||
| d7a5104bb5 | |||
| 8ea8efc3de | |||
| 2b6c989ab3 | |||
| 4d8a61842e | |||
| dc5781a0c0 | |||
| c4567d6317 | |||
| 52d4c473f2 | |||
| 2837110c01 | |||
| 3802be27ef | |||
| d291c41bb5 | |||
| 948e103796 | |||
| 7231aabea3 | |||
| 953f491979 | |||
| 51238c65e2 | |||
| b399a4881c | |||
| 284b37d63c | |||
| 8e576dbadc | |||
| 2de693c70f | |||
| c061849783 | |||
| 7e56cd21b0 | |||
| be630b910a | |||
| 244ec0c355 | |||
| d76febdf56 | |||
| 9e1bf24313 | |||
| 07fd5e30ec | |||
| 59d6dfdbf9 | |||
| 5dad2a3ae4 | |||
| ba3d5a97b7 | |||
| 9fdfaf7536 | |||
| 74a4b97535 | |||
| bd368b94e2 | |||
| e4616ccfc0 | |||
| 6f1956f6dd | |||
| bd60983ecc | |||
| bb121595ee | |||
| dd18ad45e9 | |||
| 5de5da1fc6 | |||
| 7c8e421caa | |||
| 698ddeb76c | |||
| 72d3f55379 | |||
| fcf68613ae | |||
| c9e34e95c0 | |||
| d053c9941b | |||
| 407ca5efbc | |||
| aebd88c14e | |||
| f2f16cff33 | |||
| 17b6c189d1 | |||
| aa2247366a | |||
| d92980a712 | |||
| 3044f815c2 | |||
| ac68e41197 | |||
| 3631fb6b81 | |||
| 02b682e810 | |||
| 64b041f0b6 | |||
| ae1bedc416 | |||
| 0e4fba8d11 | |||
| 72dcd674d0 | |||
| c1bedb2d96 | |||
| ed7c7bba64 | |||
| dbb4ada1a4 | |||
| 401f05846a | |||
| cbe46754fc | |||
| f73beda29b | |||
| bf5fc488f9 | |||
| 59283dfd42 | |||
| 7dcb069fd1 | |||
| 243c3decd8 | |||
| 62aa4a0172 | |||
| f1f7b0d3ca | |||
| 0f3e8741ab | |||
| c955683776 | |||
| 221ad9f456 | |||
| d18d627c58 | |||
| a963d1f737 | |||
| b5ffa4b4b0 | |||
| 5da6e6ff5e | |||
| 9bc9a07182 | |||
| ea4c9b3f08 | |||
| f0b9466faa | |||
| 548b9608f0 | |||
| 339189950e | |||
| b7695f4d3f | |||
| 8c3851a65c | |||
| 3a32c08fa8 | |||
| bea000431b | |||
| f708b30c37 | |||
| c789bc8656 | |||
| 28c9dcd6ce | |||
| c4f26747c5 | |||
| 15af713e26 | |||
| 34ad5f6bdd | |||
| 82a88c1fb6 | |||
| 8f31e5a85e | |||
| 53aba45c44 | |||
| 79b394ce83 | |||
| 92a2afd621 | |||
| 34ab6b29fb | |||
| 36998f5e68 | |||
| 82e47d68e7 | |||
| 5593ca32d3 | |||
| a7f17e1d1e | |||
| 2185593afb | |||
| 1b85e47a73 | |||
| afdf59a63d | |||
| c9a2f5e087 | |||
| 2e2720fe1d | |||
| 7ebc84dc7b | |||
| 06bfb23843 | |||
| dd066d3c6a | |||
| a5dedb81aa | |||
| 238497e821 | |||
| d80afc35fb | |||
| c3e9cbfe3c | |||
| cb2532688a | |||
| c1a8c4f5f7 | |||
| d4c0937ba2 | |||
| 456273c1ea | |||
| 444dec1ffb | |||
| b61cae985c | |||
| 6e8e795cdd | |||
| 4ad647ae0d | |||
| e5ce3ef87d | |||
| 56ed01160d | |||
| 59fdcb847c | |||
| 5702416bf4 | |||
| 680ae8ddf5 | |||
| 673c2db045 | |||
| 7466110f94 | |||
| 29c40355e4 | |||
| 0c3d17970e | |||
| b4086724d8 | |||
| bd9e41a912 | |||
| deb553d2f8 | |||
| 0cabda6a8b | |||
| 08c5f1dfa0 | |||
| 8e412a8dfc | |||
| c3f6ccce35 | |||
| d1481feedd | |||
| 47e36208e9 | |||
| f2e3b04bd1 | |||
| 97f94107ad | |||
| 98e03d0bf9 | |||
| 5f47c42841 | |||
| 14c6a29b2c | |||
| 3fcd6716fc | |||
| e1b8545338 | |||
| 50553e8d2c | |||
| f3953ee05b | |||
| bf9e4f1dd6 | |||
| 98d7025fc7 | |||
| 371a0e870a | |||
| 872304660a | |||
| ac0a5b2dee | |||
| d9f03fb014 | |||
| bb1c4f4894 | |||
| 8f20305d0e | |||
| 740b354ce0 | |||
| 004aa3c9e9 | |||
| ede7f95aad | |||
| 52da6cf1f4 | |||
| 37a4bcdd1b | |||
| a0df40fc56 | |||
| 867e94ef27 | |||
| 195acfece5 | |||
| 26f37817dd | |||
| 06628cd42d | |||
| 1336b449ca | |||
| 54e125864b | |||
| fa47c7c739 | |||
| dcba959d86 | |||
| 9e3299a762 | |||
| 26885d4888 | |||
| 57e3bda687 | |||
| 010450c2ff | |||
| 7e40c8d0fd | |||
| 1ab83d89c9 | |||
| c1005ccead | |||
| dc366f0926 | |||
| 6baff491b1 | |||
| 6084becec5 | |||
| 6e3ec2efe4 | |||
| 3e69ecd2a6 | |||
| 7f147dc1d0 | |||
| 748b526d80 | |||
| 76dbbf2ed3 | |||
| 19241894a2 | |||
| f68bd65e41 | |||
| 32f5bb9ccb | |||
| b716ca2bf0 | |||
| 31d74a25eb | |||
| ec9d3d8495 | |||
| ad791dcfc5 | |||
| a3e26c82e0 | |||
| 1c1bed274f | |||
| 06f9c0f8bf | |||
| 52f7e4546b | |||
| 1033e45a55 | |||
| 43eeae6936 | |||
| 90876a43dc | |||
| f87921a761 | |||
| 9f00b8b960 | |||
| b53a33b2b8 | |||
| 56bc3fb1ea | |||
| 50f2c1f1ef | |||
| c6b23f8900 | |||
| 7f99a4f03e | |||
| ca9269b66d | |||
| 8b582a6797 | |||
| 55dbb14262 | |||
| ca1af0d0b1 | |||
| 941899e366 | |||
| 64ec817803 | |||
| 371736daae | |||
| 1b4af36ea2 | |||
| b704ae5da1 | |||
| 529097d57a | |||
| f138dada12 | |||
| 5b734ebb57 | |||
| 03d961758f | |||
| 08429eb222 | |||
| a5db6af0d7 | |||
| 790f181b62 | |||
| 0ab1fb13cf | |||
| b936e46459 | |||
| f31be642f0 | |||
| 818a7248a8 | |||
| b7edd4a572 | |||
| 6a54ff6e16 | |||
| 81b5f63355 | |||
| e81c029888 | |||
| 2d63545383 | |||
| e01060baa8 | |||
| 9690a5c418 | |||
| 661217f26f | |||
| 31fdb9d0e3 | |||
| 9c0c359227 | |||
| 56f567505d | |||
| 50e9318c15 | |||
| 4e525a45a4 | |||
| 24207440aa | |||
| 6f368c12c6 | |||
| 3d3dc16c70 | |||
| 96d5c727b0 | |||
| bea3acb963 | |||
| 65c633bd74 | |||
| 78c6a3f18f | |||
| 780652f51e | |||
| 507b24e26c | |||
| 9f308335f3 | |||
| 8e0d43a546 | |||
| 1cc14d602c | |||
| 128cd2f0e4 | |||
| e541e51288 | |||
| 956b37f773 | |||
| 2e95b66094 | |||
| 8178e569bd | |||
| 90e57f1dae | |||
| 6a82abe713 | |||
| 5c2ff4d8b8 | |||
| 710439ad03 | |||
| 5e0774d595 | |||
| 2bbdd5f4b1 | |||
| 0dc7d00cc9 | |||
| af8e413d7d | |||
| e918f15f51 | |||
| 5a0f485374 | |||
| c9641f2a9d | |||
| dc6671c110 | |||
| f5a4b5b010 | |||
| e5f8ecadae | |||
| a753dbfe36 | |||
| 7d24f45e6e | |||
| 6f86400737 | |||
| bb42924b3c | |||
| b8b5335e43 | |||
| 1b7645c11e | |||
| b26da9ae82 | |||
| 11e88402e3 | |||
| 153765e3d5 | |||
| 03e4176618 | |||
| 4645695fdd | |||
| d2804adc96 | |||
| f9ba079c85 | |||
| 025768538b | |||
| d7322153aa | |||
| 61fb34181f | |||
| f142e4582d | |||
| 9abbbe6265 | |||
| 1f786288d2 | |||
| 4b9c82aef4 | |||
| 08b6d7b43d | |||
| 56aec1d572 | |||
| 4d63b52b94 | |||
| 4b6cd52dbf | |||
| cb8d101d8d | |||
| f612e678d8 | |||
| 4371287a65 | |||
| 9b1196341e | |||
| f2a0fd2de1 | |||
| fffbd401bd | |||
| e577ea5196 | |||
| 7c3bdcbcb9 | |||
| ff1e899a30 | |||
| 5ef35157af | |||
| 15a3a00501 | |||
| 8ce04d82be | |||
| 5ed1e1323c | |||
| 0c9af0172d | |||
| 69a7583a30 | |||
| e011dd4a37 | |||
| 92a07d19ba | |||
| 387e3a73f1 | |||
| 23307443f3 | |||
| 8c0aefb52f | |||
| c7b8a3544e | |||
| 823fad701a | |||
| 4254294d06 | |||
| 5a987c407b | |||
| 5a8ae2719e | |||
| 4d83c56bf3 | |||
| 47037471c0 | |||
| c6323c497d | |||
| 0cd6dd8a34 | |||
| 16868d3424 | |||
| f21fe182bd | |||
| 4ccb96cfdd | |||
| 756070a34a | |||
| 6185322415 | |||
| 259450b6d2 | |||
| 8839361610 | |||
| e6f9bc1e9e | |||
| 2a2e09f592 | |||
| e81766387b | |||
| 59febd4ad6 | |||
| 8933256fe1 | |||
| 2dde93b067 | |||
| f97606e06b | |||
| 7347d6c0b4 | |||
| 5fbbab5567 | |||
| 7fbb6554e4 | |||
| e64fdc4381 | |||
| c2c3b24b12 | |||
| cf1b542511 | |||
| 95bf0f46c8 | |||
| 1ca9a88224 | |||
| eb74d17ffb | |||
| 29e6b4715c | |||
| 5b9602a745 | |||
| 3354255b5a | |||
| 128f30d28a | |||
| 1e469829c6 | |||
| aa04172ac7 | |||
| 95ed637ef4 | |||
| 054878d127 | |||
| f3f4cad530 | |||
| b55185b114 | |||
| e70b3de26a | |||
| 184ee41860 | |||
| cc46377dbb | |||
| b1d7220ce7 | |||
| 60ca9b336c | |||
| 8a48779047 | |||
| 0838e39b38 | |||
| f6ec8bb16b | |||
| 2ac0add305 | |||
| 62fa68ef43 | |||
| f991d2c14f | |||
| 763186cb8e | |||
| 5fc316e275 | |||
| 652ed6cf01 | |||
| 1baa560d27 | |||
| 45bdb24cfe | |||
| 13b53cac38 | |||
| a1bb155612 | |||
| f962ce139a | |||
| 585ee75769 | |||
| bf44765446 | |||
| 09d5e1dcf0 | |||
| c39d925b7e | |||
| 7508fdeef9 | |||
| c5bcd48104 | |||
| 31c794ecd7 | |||
| d00da29a4f | |||
| 63b22b823d | |||
| 4fc2a470f5 | |||
| 354dddc705 | |||
| 7c2a6beed4 | |||
| 9ae5faad12 | |||
| 9230700679 | |||
| 8231ba3a06 | |||
| 2a5fc534e0 | |||
| b9c2dae06a | |||
| df49f8a895 | |||
| 099cc919c3 | |||
| 43e1d92388 | |||
| c69fcca380 | |||
| 45a4d4f575 | |||
| 428391ee1f | |||
| 892bd0d4ff | |||
| dea3eea1fe |
@@ -6,3 +6,9 @@ debug.log
|
||||
logg.txt
|
||||
bindist/
|
||||
cataclysmdda-*
|
||||
objwin/
|
||||
cataclysm.exe
|
||||
version.h
|
||||
Cataclysm.exe
|
||||
CataclysmWin.depend
|
||||
CataclysmWin.layout
|
||||
|
||||
+11
@@ -0,0 +1,11 @@
|
||||
language: cpp
|
||||
compiler:
|
||||
- gcc
|
||||
|
||||
script: make
|
||||
|
||||
notifications:
|
||||
irc: "irc.newnet.net#Cataclysm-DDA"
|
||||
irc: "irc.freenode.org#Cataclysm-DDA"
|
||||
use_notice: true
|
||||
skip_join: true
|
||||
@@ -0,0 +1,8 @@
|
||||
Current policy is to update code to the standard style when changing a
|
||||
substantial portion of it. Blocks of code can be passed through astyle
|
||||
to ensure that their formatting is correct:
|
||||
|
||||
astyle --style=allman --indent=spaces=4 --add-brackets --align-pointer=name -p
|
||||
|
||||
For example, from vi, set marks a and b around the block, then:
|
||||
:'a,'b ! astyle --style=allman --indent=spaces=4 --add-brackets --align-pointer=name
|
||||
+144
@@ -0,0 +1,144 @@
|
||||
# Contribute
|
||||
|
||||
Contributing to Cataclysm: Dark Days Ahead is easy - simply fork the repository here on GitHub, make your changes, and then send us a pull request.
|
||||
|
||||
## Guidelines
|
||||
|
||||
There are a couple of guidelines we suggest sticking to:
|
||||
|
||||
* Add this repository as an `upstream` remote.
|
||||
* Keep your `master` branch clean. This means you can easily pull changes made to this repository into yours.
|
||||
* Create a new branch for each new feature or set of related bug fixes.
|
||||
* Never merge from your local branches into your `master` branch. Only update that by pulling from `upstream/master`.
|
||||
|
||||
## Code Style
|
||||
|
||||
Current policy is to only update code to the standard style when changing a substantial portion of it, but **please** do this in a seperate commit. Blocks of code can be passed through astyle to ensure that their formatting is correct:
|
||||
|
||||
astyle --style=allman --indent=spaces=4 --add-brackets --align-pointer=name
|
||||
|
||||
For example, from vi, set marks a and b around the block, then:
|
||||
|
||||
:'a,'b ! astyle --style=allman --indent=spaces=4 --add-brackets --align-pointer=name
|
||||
|
||||
|
||||
## Example Workflow
|
||||
|
||||
#### Setup your environment
|
||||
|
||||
*(This only needs to be done once.)*
|
||||
|
||||
1. Fork this repository here on GitHub.
|
||||
|
||||
2. Clone your fork locally.
|
||||
|
||||
$ git clone https://github.com/YOUR_USERNAME/Cataclysm-DDA.git
|
||||
# Clones your fork of the repository into the current directory in terminal
|
||||
|
||||
3. Add this repository as a remote.
|
||||
|
||||
$ cd Cataclysm-DDA
|
||||
# Changes the active directory in the prompt to the newly cloned "Cataclysm-DDA" directory
|
||||
$ git remote add -f upstream https://github.com/TheDarklingWolf/Cataclysm-DDA.git
|
||||
# Assigns the original repository to a remote called "upstream"
|
||||
|
||||
#### Update your `master` branch
|
||||
|
||||
1. Make sure you have your `master` branch checked out.
|
||||
|
||||
$ git checkout master
|
||||
|
||||
2. Pull the changes from the `upstream/master` branch.
|
||||
|
||||
$ git pull --ff-only upstream master
|
||||
# gets changes from "master" branch on the "upstream" remote
|
||||
|
||||
* Note: If this gives you an error, it means you have committed directly to your local `master` branch. [Click here for instructions on how to fix this issue](#why-does-git-pull---ff-only-result-in-an-error).
|
||||
|
||||
#### Make your changes
|
||||
|
||||
0. Update your `master` branch, if you haven't already.
|
||||
|
||||
1. For each new feature or bug fix, create a new branch.
|
||||
|
||||
$ git branch new_feature
|
||||
# Creates a new branch called "new_feature"
|
||||
$ git checkout new_feature
|
||||
# Makes "new_feature" the active branch
|
||||
|
||||
2. Once you've committed some changes locally, you need to push them to your fork here on GitHub.
|
||||
|
||||
$ git push origin new_feature
|
||||
# origin was automatically set to point to your fork when you cloned it
|
||||
|
||||
|
||||
3. Once you're finished working on your branch, and have committed and pushed all your changes, submit a pull request from your `new_feature` branch to this repository's `master` branch.
|
||||
|
||||
* Note: any new commits to the `new_feature` branch on GitHub will automatically be included in the pull request, so make sure to only commit related changes to the same branch.
|
||||
|
||||
|
||||
## Advanced Techniques
|
||||
|
||||
These guidelines aren't essential, but they can make keeping things in order much easier.
|
||||
|
||||
#### Using remote tracking branches
|
||||
|
||||
Remote tracking branches allow you to easily stay in touch with this repository's `master` branch, as they automatically know which remote branch to get changes from.
|
||||
|
||||
$ git branch -vv
|
||||
* master xxxx [origin/master] ....
|
||||
new_feature xxxx ....
|
||||
|
||||
Here you can see we have two branches; `master` which is tracking `origin/master`, and `new_feature` which isn't tracking any branch. In practice, what this means is that git won't know where to get changes from.
|
||||
|
||||
$ git checkout new_feature
|
||||
Switched to branch 'new_feature'
|
||||
$ git pull
|
||||
There is no tracking information for the current branch.
|
||||
Please specify which branch you want to merge with.
|
||||
|
||||
In order to easily pull changes from `upstream/master` into the `new_feature` branch, we can tell git which branch it should track. (You can even do this for your local master branch.)
|
||||
|
||||
$ git branch -u upstream/master new_feature
|
||||
Branch new_feature set up to track remote branch master from upstream.
|
||||
$ git pull
|
||||
Updating xxxx..xxxx
|
||||
....
|
||||
|
||||
You can also set the tracking information at the same time as creating the branch.
|
||||
|
||||
$ git branch new_feature_2 --track upstream/master
|
||||
Branch new_feature_2 set up to track remote branch master from upstream.
|
||||
|
||||
* Note: Although this makes it easier to pull from `upstream/master`, it doesn't change anything with regards to pushing. `git push` fails because you don't have permission to push to `upstream/master`.
|
||||
|
||||
$ git push
|
||||
error: The requested URL returned error: 403 while accessing https://github.com/TheDarklingWolf/Cataclysm-DDA.git
|
||||
fatal: HTTP request failed
|
||||
$ git push origin
|
||||
....
|
||||
To https://github.com/YOUR_USERNAME/Cataclysm-DDA.git
|
||||
xxxx..xxxx new_feature -> new_feature
|
||||
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
####Why does `git pull --ff-only` result in an error?
|
||||
|
||||
If `git pull --ff-only` shows an error, it means that you've committed directly to your local `master` branch. To fix this, we create a new branch with these commits, find the point at which we diverged from `upstream/master`, and then reset `master` to that point.
|
||||
|
||||
$ git pull --ff-only upstream master
|
||||
From https://github.com/TheDarklingWolf/Cataclysm-DDA
|
||||
* branch master -> FETCH_HEAD
|
||||
fatal: Not possible to fast-forward, aborting.
|
||||
$ git branch new_branch master # mark the current commit with a tmp branch
|
||||
$ git merge-base master upstream/master
|
||||
cc31d0... # the last commit before we committed directly to master
|
||||
$ git reset --hard cc31d0....
|
||||
HEAD is now at cc31d0... ...
|
||||
|
||||
Now that `master` has been cleaned up, we can easily pull from `upstream/master`, and then continue working on `new_branch`.
|
||||
|
||||
$ git pull --ff-only upstream master
|
||||
# gets changes from the "upstream" remote for the matching branch, in this case "master"
|
||||
$ git checkout new_branch
|
||||
+23
-4
@@ -9,7 +9,7 @@
|
||||
<Target title="Release">
|
||||
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
|
||||
<Option object_output="obj/Release/" />
|
||||
<Option type="1" />
|
||||
<Option type="0" />
|
||||
<Option compiler="gcc" />
|
||||
<Compiler>
|
||||
<Add option="-Os" />
|
||||
@@ -22,6 +22,7 @@
|
||||
</Build>
|
||||
<Unit filename="action.cpp" />
|
||||
<Unit filename="action.h" />
|
||||
<Unit filename="addiction.cpp" />
|
||||
<Unit filename="addiction.h" />
|
||||
<Unit filename="artifact.cpp" />
|
||||
<Unit filename="artifact.h" />
|
||||
@@ -32,10 +33,14 @@
|
||||
<Unit filename="bionics.h" />
|
||||
<Unit filename="bodypart.cpp" />
|
||||
<Unit filename="bodypart.h" />
|
||||
<Unit filename="building_generation.cpp" />
|
||||
<Unit filename="building_generation.h" />
|
||||
<Unit filename="calendar.cpp" />
|
||||
<Unit filename="calendar.h" />
|
||||
<Unit filename="catacurse.cpp" />
|
||||
<Unit filename="catacurse.h" />
|
||||
<Unit filename="catajson.cpp" />
|
||||
<Unit filename="catajson.h" />
|
||||
<Unit filename="color.cpp" />
|
||||
<Unit filename="color.h" />
|
||||
<Unit filename="computer.cpp" />
|
||||
@@ -65,6 +70,8 @@
|
||||
<Unit filename="graffiti.cpp" />
|
||||
<Unit filename="graffiti.h" />
|
||||
<Unit filename="help.cpp" />
|
||||
<Unit filename="helper.cpp" />
|
||||
<Unit filename="helper.h" />
|
||||
<Unit filename="iexamine.cpp" />
|
||||
<Unit filename="iexamine.h" />
|
||||
<Unit filename="input.cpp" />
|
||||
@@ -74,6 +81,10 @@
|
||||
<Unit filename="inventory_ui.cpp" />
|
||||
<Unit filename="item.cpp" />
|
||||
<Unit filename="item.h" />
|
||||
<Unit filename="item_factory.cpp" />
|
||||
<Unit filename="item_factory.h" />
|
||||
<Unit filename="item_group.cpp" />
|
||||
<Unit filename="item_group.h" />
|
||||
<Unit filename="itype.h" />
|
||||
<Unit filename="itypedef.cpp" />
|
||||
<Unit filename="iuse.cpp" />
|
||||
@@ -93,8 +104,12 @@
|
||||
<Unit filename="mapdata.cpp" />
|
||||
<Unit filename="mapdata.h" />
|
||||
<Unit filename="mapgen.cpp" />
|
||||
<Unit filename="mapgenformat.cpp" />
|
||||
<Unit filename="mapgenformat.h" />
|
||||
<Unit filename="mapitems.h" />
|
||||
<Unit filename="mapitemsdef.cpp" />
|
||||
<Unit filename="material.h" />
|
||||
<Unit filename="material.cpp" />
|
||||
<Unit filename="melee.cpp" />
|
||||
<Unit filename="mission.cpp" />
|
||||
<Unit filename="mission.h" />
|
||||
@@ -134,6 +149,8 @@
|
||||
<Unit filename="output.h" />
|
||||
<Unit filename="overmap.cpp" />
|
||||
<Unit filename="overmap.h" />
|
||||
<Unit filename="overmapbuffer.cpp" />
|
||||
<Unit filename="overmapbuffer.h" />
|
||||
<Unit filename="picojson.h" />
|
||||
<Unit filename="player.cpp" />
|
||||
<Unit filename="player.h" />
|
||||
@@ -154,8 +171,8 @@
|
||||
<Unit filename="setvector.h" />
|
||||
<Unit filename="skill.cpp" />
|
||||
<Unit filename="skill.h" />
|
||||
<Unit filename="texthash.cpp" />
|
||||
<Unit filename="texthash.h" />
|
||||
<Unit filename="text_snippets.cpp" />
|
||||
<Unit filename="text_snippets.h" />
|
||||
<Unit filename="tileray.cpp" />
|
||||
<Unit filename="tileray.h" />
|
||||
<Unit filename="trap.h" />
|
||||
@@ -169,9 +186,11 @@
|
||||
<Unit filename="veh_typedef.cpp" />
|
||||
<Unit filename="vehicle.cpp" />
|
||||
<Unit filename="vehicle.h" />
|
||||
<Unit filename="version.cpp" />
|
||||
<Unit filename="version.h" />
|
||||
<Unit filename="weather.cpp" />
|
||||
<Unit filename="weather.h" />
|
||||
<Unit filename="weather_data.h" />
|
||||
<Unit filename="weather_data.cpp" />
|
||||
<Unit filename="wish.cpp" />
|
||||
<Extensions>
|
||||
<code_completion />
|
||||
|
||||
@@ -12,6 +12,8 @@
|
||||
Edit iuse.h and include the function in the class declaration; then edit
|
||||
iuse.cpp and define your function. Functions may be shared among different
|
||||
item types.
|
||||
6) If you do not want NPCs to carry the item, add it to the list called
|
||||
mapitems[mi_trader_avoid] in mapitemsdef.cpp.
|
||||
|
||||
1.2 Adding a monster
|
||||
1) Edit mtype.h. Change the enum mon_id and insert a unique identifier for
|
||||
@@ -59,6 +61,39 @@
|
||||
{ot_toxic_dump, 0, 5, 15, -1, mcat_null, 0, 0, 0, 0, &omspec_place::wilderness,0}
|
||||
The comments given in source code to structure struct overmap_special explains the meaning of these constants in the example above.
|
||||
|
||||
1.4 Adding/editing armour and how armour protection is calculated
|
||||
1) Edit armor.json and add your armor item near similar types.
|
||||
2) The fields are:
|
||||
"type" : "ARMOR", // this must be ARMOR
|
||||
"id" : "socks", // the identifier used by the game. Must be one continuous word, use underscores if necessary
|
||||
"name" : "socks", // the name appearing in the examine box. Can be more than one word separated by spaces
|
||||
"weight" : 1, // weight of armour
|
||||
"color" : "blue", // ascii character colour
|
||||
"covers" : ["FEET"], // where it covers. Possible options are TORSO, HEAD, EYES, MOUTH, ARMS, HANDS, LEGS, FEET
|
||||
"to_hit" : 0, // bonus if using it as a melee weapon (whatever for?)
|
||||
"storage" : 0, // how many volume storage slots it adds
|
||||
"symbol" : "[", // ascii character
|
||||
"description" : "Socks. Put 'em on your feet.", // description of armour
|
||||
"price" : 100, // price of armour, used when bartering with NPCs
|
||||
"material" : ["COTTON", "NULL"], // material types. See materials.json for possible options
|
||||
"volume" : 1, // volume occupied
|
||||
"cutting" : 0, // cutting damage caused by using it as a melee weapon
|
||||
"warmth" : 10, // how much warmth clothing provides
|
||||
"phase" : "solid", // what phase it is
|
||||
"enviromental_protection" : 0, // how much environmental protection it affords
|
||||
"rarity" : 70, // determines how often it spawns
|
||||
"encumberance" : 0, // base encumbrance (unfitted value)
|
||||
"bashing" : -5, // bashing damage caused by using it as a melee weapon
|
||||
"flags" : ["VARSIZE"] // used to indicate clothing type which can be fitted. Leave out the flags field entirely if clothing cannot be fitted
|
||||
"coverage" : 80, // what percentage of body part
|
||||
"material_thickness" : 1 // thickness of material, in millimetre units (approximately). Generally ranges between 1 - 5, more unusual armour types go up to 10 or more
|
||||
3) When the player is hit at a specific body part, armour coverage determines whether the armour is hit, or an uncovered part of the player is hit (roll 1d100 against coverage)
|
||||
4) If the above roll fails (ie roll value is above coverage), then the armour does not absorb any damage from the blow, neither does it become damaged
|
||||
5) If the above roll succeeds, the armour is hit, possibly absorbing some damage and possibly getting damaged in the process
|
||||
6) The above steps are repeated for each layer of armour on the body part
|
||||
7) Armour protects against bash and cut damage. These are determined by multiplying the armour thickness by the material bash/cut resistance factor respectively, given in materials.json
|
||||
8) If the armour is made from 2 materials types, then it takes a weighted average of the primary material (66%) and secondary material (33%).
|
||||
9) Materials resistance factors are given relative to PAPER as a material (this probably needs some fine-tuning for balance).
|
||||
|
||||
FAQ
|
||||
Q: What the heck is up with the map objects?
|
||||
@@ -80,3 +115,6 @@ An overmap encapsulates the large-scale structure of a map
|
||||
There are an arbitrary number of overmaps
|
||||
Additional overmaps are generated as the player enters new areas.
|
||||
|
||||
FAQ
|
||||
Q: what is the relation of NPCS/Monsters vs maps. How are they stored, where are they stored? Are they stored?
|
||||
A: All npcs are now stored in the overmap. Active npcs only contain the currently active npcs. There is a difference between npc active npc coordinates, and overmap coordinates. So these will need to be changed when saving the npcs. Or else the npcs will be saved at the wrong location. And yes they are stored.
|
||||
|
||||
@@ -7,8 +7,13 @@
|
||||
# make NATIVE=linux32
|
||||
# Linux cross-compile to Win32
|
||||
# make CROSS=i686-pc-mingw32-
|
||||
# or make CROSS=i586-mingw32msvc-
|
||||
# or whichever prefix your crosscompiler uses
|
||||
# as long as its name contains mingw32
|
||||
# Win32
|
||||
# Run: make NATIVE=win32
|
||||
# OS X
|
||||
# Run: make NATIVE=osx
|
||||
|
||||
# Build types:
|
||||
# Debug (no optimizations)
|
||||
@@ -21,7 +26,7 @@
|
||||
# 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
|
||||
# Uncomment below to disable warnings
|
||||
#WARNINGS = -w
|
||||
DEBUG = -g
|
||||
@@ -44,7 +49,9 @@ DEBUG = -g
|
||||
#DEFINES += -DDEBUG_ENABLE_MAP_GEN
|
||||
#DEFINES += -DDEBUG_ENABLE_GAME
|
||||
|
||||
VERSION = 0.3
|
||||
|
||||
VERSION = 0.5
|
||||
|
||||
|
||||
TARGET = cataclysm
|
||||
W32TARGET = cataclysm.exe
|
||||
@@ -64,7 +71,7 @@ ifdef RELEASE
|
||||
DEBUG =
|
||||
endif
|
||||
|
||||
CXXFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS) -MMD
|
||||
CXXFLAGS += $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS) -MMD
|
||||
|
||||
BINDIST_EXTRAS = README data cataclysm-launcher
|
||||
BINDIST = cataclysmdda-$(VERSION).tar.gz
|
||||
@@ -77,34 +84,57 @@ W32BINDIST_CMD = zip -r $(W32BINDIST) $(BINDIST_DIR)
|
||||
#ifeq ($(OS), Msys)
|
||||
# LDFLAGS = -static -lpdcurses
|
||||
#else
|
||||
LDFLAGS = -lncurses
|
||||
# LDFLAGS += -lncurses
|
||||
#endif
|
||||
|
||||
# Check if called without a special build target
|
||||
ifeq ($(NATIVE),)
|
||||
ifeq ($(CROSS),)
|
||||
TARGETSYSTEM=LINUX
|
||||
endif
|
||||
endif
|
||||
|
||||
# Linux 64-bit
|
||||
ifeq ($(NATIVE), linux64)
|
||||
CXXFLAGS += -m64
|
||||
TARGETSYSTEM=LINUX
|
||||
else
|
||||
# Linux 32-bit
|
||||
ifeq ($(NATIVE), linux32)
|
||||
CXXFLAGS += -m32
|
||||
TARGETSYSTEM=LINUX
|
||||
endif
|
||||
endif
|
||||
|
||||
# OSX
|
||||
ifeq ($(NATIVE), osx)
|
||||
CXXFLAGS += -mmacosx-version-min=10.6
|
||||
TARGETSYSTEM=LINUX
|
||||
endif
|
||||
|
||||
# Win32 (mingw32?)
|
||||
ifeq ($(NATIVE), win32)
|
||||
TARGET = $(W32TARGET)
|
||||
BINDIST = $(W32BINDIST)
|
||||
BINDIST_CMD = $(W32BINDIST_CMD)
|
||||
ODIR = $(W32ODIR)
|
||||
W32LDFLAGS = -Wl,-stack,12000000,-subsystem,windows
|
||||
LDFLAGS += -static -lgdi32
|
||||
TARGETSYSTEM=WINDOWS
|
||||
endif
|
||||
|
||||
# MXE cross-compile to win32
|
||||
ifeq ($(CROSS), i686-pc-mingw32-)
|
||||
ifneq (,$(findstring mingw32,$(CROSS)))
|
||||
TARGETSYSTEM=WINDOWS
|
||||
endif
|
||||
|
||||
# Global settings for Linux targets
|
||||
ifeq ($(TARGETSYSTEM),LINUX)
|
||||
LDFLAGS += -lncurses
|
||||
endif
|
||||
|
||||
# Global settings for Windows targets
|
||||
ifeq ($(TARGETSYSTEM),WINDOWS)
|
||||
TARGET = $(W32TARGET)
|
||||
BINDIST = $(W32BINDIST)
|
||||
BINDIST_CMD = $(W32BINDIST_CMD)
|
||||
ODIR = $(W32ODIR)
|
||||
LDFLAGS += -lgdi32
|
||||
LDFLAGS += -static -lgdi32
|
||||
W32FLAGS += -Wl,-stack,12000000,-subsystem,windows
|
||||
endif
|
||||
|
||||
SOURCES = $(wildcard *.cpp)
|
||||
@@ -112,13 +142,21 @@ HEADERS = $(wildcard *.h)
|
||||
_OBJS = $(SOURCES:.cpp=.o)
|
||||
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
|
||||
|
||||
all: $(TARGET)
|
||||
all: version $(TARGET)
|
||||
@
|
||||
|
||||
$(TARGET): $(ODIR) $(DDIR) $(OBJS)
|
||||
$(LD) $(W32FLAGS) -o $(TARGET) $(DEFINES) $(CXXFLAGS) \
|
||||
$(OBJS) $(LDFLAGS)
|
||||
|
||||
.PHONY: version
|
||||
version:
|
||||
@( VERSION_STRING=$(VERSION) ; \
|
||||
[ -e ".git" ] && GITVERSION=$$( git describe --tags --always --dirty --match "[0-9]*.[0-9]*" ) && VERSION_STRING=$$GITVERSION ; \
|
||||
[ -e "version.h" ] && OLDVERSION=$$(grep VERSION version.h|cut -d '"' -f2) ; \
|
||||
if [ "x$$VERSION_STRING" != "x$$OLDVERSION" ]; then echo "#define VERSION \"$$VERSION_STRING\"" | tee version.h ; fi \
|
||||
)
|
||||
|
||||
$(ODIR):
|
||||
mkdir $(ODIR)
|
||||
|
||||
@@ -128,10 +166,13 @@ $(DDIR):
|
||||
$(ODIR)/%.o: %.cpp
|
||||
$(CXX) $(DEFINES) $(CXXFLAGS) -c $< -o $@
|
||||
|
||||
clean:
|
||||
version.cpp: version
|
||||
|
||||
clean: clean-tests
|
||||
rm -f $(TARGET) $(W32TARGET) $(ODIR)/*.o $(ODIR)/*.d $(W32ODIR)/*.o $(W32BINDIST) \
|
||||
$(BINDIST)
|
||||
rm -rf $(BINDIST_DIR)
|
||||
rm -f version.h
|
||||
|
||||
bindist: $(BINDIST)
|
||||
|
||||
@@ -155,7 +196,10 @@ tests: $(ODIR) $(DDIR) $(OBJS)
|
||||
check: tests
|
||||
$(MAKE) -C tests check
|
||||
|
||||
.PHONY: tests check ctags etags
|
||||
clean-tests:
|
||||
$(MAKE) -C tests clean
|
||||
|
||||
.PHONY: tests check ctags etags clean-tests
|
||||
|
||||
-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)
|
||||
-include ${OBJS:.o=.d}
|
||||
|
||||
+1
-1
@@ -35,7 +35,7 @@ all: $(TARGET)
|
||||
@
|
||||
|
||||
$(TARGET): $(ODIR) $(DDIR) $(OBJS)
|
||||
$(CXX) $(LINKERFLAGS) -o $(TARGET) $(CFLAGS) $(OBJS) $(LDFLAGS)
|
||||
$(CXX) $(LINKERFLAGS) -o $(TARGET) $(CFLAGS) $(OBJS) $(LDFLAGS) -DMINGW
|
||||
|
||||
$(ODIR):
|
||||
mkdir $(ODIR)
|
||||
|
||||
@@ -1,13 +1,42 @@
|
||||
Cataclysm: Dark Days Ahead
|
||||
==========================
|
||||
You emerge from the shelter into the dim light of an overcast day, and look around for the first time since the disaster.
|
||||
|
||||
The world as you knew it is gone. A ruined world stands in its place, full of nightmares come to life. Nothing can ever go back to the way it was, before the Cataclysm, but you have to be strong. You have to survive. You have to persevere. If you don't, death will be one of the better outcomes.
|
||||
|
||||
Above your head, storm clouds gather, and the rain stings and hisses against your skin. You shoulder your backpack, and start walking. The world has gone to hell, but you get the sinking feeling that there are darker days ahead.
|
||||
# Cataclysm: Dark Days Ahead
|
||||
|
||||
Cataclysm: Dark Days Ahead is a roguelike set in a post-apocalyptic world. While some have described it as a "zombie game", there's far more to Cataclysm than that. Struggle to survive in a harsh, persistant, procedurally generated world. Scavenge the remnants of a dead civilization for for food, equipment, or, if you're lucky, a vehicle with a full tank of gas to get you the hell out of Dodge. Fight to defeat or escape from a wide variety of powerful monstrosities, from zombies to giant insects to killer robots and things far stranger and deadlier, and against the others like yourself, that want what you have...
|
||||
|
||||
Build the tools and defenses you will need to overcome the challenges you face, from a strongly fortified lair full of customized firearms and surrounded by pits and landmines, to a mobile, gasoline powered blade spinning fortress of death, tearing apart anything stupid enough to get in the way. And finally, improve! Learn skills to help you survive, acquire mind-bending mutations, and convert your own body into a cybernetic masterpiece.
|
||||
|
||||
Make no mistake - there is no other game quite like Cataclysm. How long can you survive?
|
||||
## Download
|
||||
|
||||
The following binary releases are available:
|
||||
|
||||
* [Windows Executable](http://www.cataclysmdda.com/Downloads/CataDDA0.4.zip)
|
||||
* [OS X 10.6+ Executable](http://www.cataclysm.glyphgryph.com/Downloads/CataDDA0.4.tar.gz)
|
||||
|
||||
The source can either be downloaded as [an archive](https://github.com/TheDarklingWolf/Cataclysm-DDA/archive/master.zip), or you can clone it from [our GitHub repository](https://github.com/TheDarklingWolf/Cataclysm-DDA/).
|
||||
|
||||
|
||||
## Compile
|
||||
|
||||
The latest instructions on how to compile can be found on [our wiki](http://www.wiki.cataclysmdda.com/index.php?title=How_to_compile).
|
||||
|
||||
|
||||
## Contribute
|
||||
|
||||
Please see [CONTRIBUTING.md](https://github.com/TheDarklingWolf/Cataclysm-DDA/blob/master/CONTRIBUTING.md) for details.
|
||||
|
||||
|
||||
## Frequently Asked Questions
|
||||
|
||||
#### Is there a tutorial?
|
||||
|
||||
Yes, you can find the tutorial in the **Special** menu at the main menu. You can also access documentation in-game via the **?** key.
|
||||
|
||||
#### How can I change the key bindings?
|
||||
|
||||
Press the `?` key, followed by the `1` key to see the full list of key commands. Press the `+` key to add a key binding, select which action with the corresponding letter key `a-w`, and then the key you wish to assign to that action.
|
||||
|
||||
#### How can I start a new world?
|
||||
|
||||
Simply delete the **save** folder, which can be found in the same directory as the executable.
|
||||
|
||||
#### I've found a bug / I would like to make a suggestion. What should I do?
|
||||
|
||||
Please submit an issue on [our GitHub page](https://github.com/TheDarklingWolf/Cataclysm-DDA/issues/). If you're not able to, send an email to `TheDarklingWolf@gmail.com`.
|
||||
|
||||
@@ -0,0 +1,18 @@
|
||||
The undersigned release all their contributions to the Cataclysm project under the Creative Commons Attribution-ShareAlike 3.0 Unported License.
|
||||
|
||||
Kevin Granade <kevin.granade@gmail.com>
|
||||
Matthew Moffatt <TheDarklingWolf@gmail.com>
|
||||
origamiwolf <origamiwolf@gmail.com>
|
||||
Frank Huard <veryinky@gmail.com>
|
||||
daftfad <daftfjord@gmail.com>
|
||||
ZwodahS <ericnjf@gmail.com>
|
||||
Williham "Wito" Totland <williham.totland@gmail.com>
|
||||
Zach Morgan <zpmorgan@gmail.com>
|
||||
Livingstone <minexal@gmail.com>
|
||||
Ethan "Soron" Kaminski <ethan.kaminski@gmail.com>
|
||||
Soyweiser <soyweiser@gmail.com>
|
||||
Jason Gilbert <0jason.gilbert@gmail.com>
|
||||
Charlie Nolan (FunnyMan3595) <funnyman3595@gmail.com>
|
||||
uzername (some_name) <ivanpost777@gmail.com>
|
||||
Christian Buskirk (i2amroy) <i2amroy@gmail.com>
|
||||
Ozone <satori.jj@gmail.com>
|
||||
@@ -0,0 +1,6 @@
|
||||
There's a slowly growing test suite in tests/. To build install libtap
|
||||
from http://www.shlomifish.org/open-source/projects/libtap/ *, then build
|
||||
the "check" target. e.g. "make check". This builds and runs any tests.
|
||||
|
||||
*Unpack the tarball with "gunzip tap-1.03.tar.gz && tar xf tap-1.03.tar"
|
||||
instead of the usual tar command.
|
||||
+332
-315
@@ -29,16 +29,21 @@ void game::load_keyboard_settings()
|
||||
Warning! data/keymap.txt contains an unknown action, \"%s\"\n\
|
||||
Fix data/keymap.txt at your next chance!", id.c_str());
|
||||
else {
|
||||
while (fin.peek() != '\n' && !fin.eof()) {
|
||||
char ch;
|
||||
fin >> ch;
|
||||
if (keymap.find(ch) != keymap.end())
|
||||
debugmsg("\
|
||||
while (!fin.eof()) {
|
||||
char ch;
|
||||
fin >> std::noskipws >> ch >> std::skipws;
|
||||
if (ch == '\n') {
|
||||
break;
|
||||
} else if (ch != ' ' || fin.peek() == '\n') {
|
||||
if (keymap.find(ch) != keymap.end()) {
|
||||
debugmsg("\
|
||||
Warning! '%c' assigned twice in the keymap!\n\
|
||||
%s is being ignored.\n\
|
||||
Fix data/keymap.txt at your next chance!", ch, id.c_str());
|
||||
else
|
||||
keymap[ ch ] = act;
|
||||
} else {
|
||||
keymap[ ch ] = act;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
@@ -88,319 +93,331 @@ void game::clear_bindings(action_id act)
|
||||
|
||||
std::string action_ident(action_id act)
|
||||
{
|
||||
switch (act) {
|
||||
case ACTION_PAUSE:
|
||||
return "pause";
|
||||
case ACTION_MOVE_N:
|
||||
return "move_n";
|
||||
case ACTION_MOVE_NE:
|
||||
return "move_ne";
|
||||
case ACTION_MOVE_E:
|
||||
return "move_e";
|
||||
case ACTION_MOVE_SE:
|
||||
return "move_se";
|
||||
case ACTION_MOVE_S:
|
||||
return "move_s";
|
||||
case ACTION_MOVE_SW:
|
||||
return "move_sw";
|
||||
case ACTION_MOVE_W:
|
||||
return "move_w";
|
||||
case ACTION_MOVE_NW:
|
||||
return "move_nw";
|
||||
case ACTION_MOVE_DOWN:
|
||||
return "move_down";
|
||||
case ACTION_MOVE_UP:
|
||||
return "move_up";
|
||||
case ACTION_CENTER:
|
||||
return "center";
|
||||
case ACTION_SHIFT_N:
|
||||
return "shift_n";
|
||||
case ACTION_SHIFT_NE:
|
||||
return "shift_ne";
|
||||
case ACTION_SHIFT_E:
|
||||
return "shift_e";
|
||||
case ACTION_SHIFT_SE:
|
||||
return "shift_se";
|
||||
case ACTION_SHIFT_S:
|
||||
return "shift_s";
|
||||
case ACTION_SHIFT_SW:
|
||||
return "shift_sw";
|
||||
case ACTION_SHIFT_W:
|
||||
return "shift_w";
|
||||
case ACTION_SHIFT_NW:
|
||||
return "shift_nw";
|
||||
case ACTION_OPEN:
|
||||
return "open";
|
||||
case ACTION_CLOSE:
|
||||
return "close";
|
||||
case ACTION_SMASH:
|
||||
return "smash";
|
||||
case ACTION_EXAMINE:
|
||||
return "examine";
|
||||
case ACTION_PICKUP:
|
||||
return "pickup";
|
||||
case ACTION_BUTCHER:
|
||||
return "butcher";
|
||||
case ACTION_CHAT:
|
||||
return "chat";
|
||||
case ACTION_LOOK:
|
||||
return "look";
|
||||
case ACTION_PEEK:
|
||||
return "peek";
|
||||
case ACTION_LIST_ITEMS:
|
||||
return "listitems";
|
||||
case ACTION_INVENTORY:
|
||||
return "inventory";
|
||||
case ACTION_COMPARE:
|
||||
return "compare";
|
||||
case ACTION_ORGANIZE:
|
||||
return "organize";
|
||||
case ACTION_USE:
|
||||
return "apply";
|
||||
case ACTION_USE_WIELDED:
|
||||
return "apply_wielded";
|
||||
case ACTION_WEAR:
|
||||
return "wear";
|
||||
case ACTION_TAKE_OFF:
|
||||
return "take_off";
|
||||
case ACTION_EAT:
|
||||
return "eat";
|
||||
case ACTION_READ:
|
||||
return "read";
|
||||
case ACTION_WIELD:
|
||||
return "wield";
|
||||
case ACTION_PICK_STYLE:
|
||||
return "pick_style";
|
||||
case ACTION_RELOAD:
|
||||
return "reload";
|
||||
case ACTION_UNLOAD:
|
||||
return "unload";
|
||||
case ACTION_THROW:
|
||||
return "throw";
|
||||
case ACTION_FIRE:
|
||||
return "fire";
|
||||
case ACTION_FIRE_BURST:
|
||||
return "fire_burst";
|
||||
case ACTION_SELECT_FIRE_MODE:
|
||||
return "select_fire_mode";
|
||||
case ACTION_DROP:
|
||||
return "drop";
|
||||
case ACTION_DIR_DROP:
|
||||
return "drop_adj";
|
||||
case ACTION_BIONICS:
|
||||
return "bionics";
|
||||
case ACTION_WAIT:
|
||||
return "wait";
|
||||
case ACTION_CRAFT:
|
||||
return "craft";
|
||||
case ACTION_RECRAFT:
|
||||
return "recraft";
|
||||
case ACTION_LONGCRAFT:
|
||||
return "long_craft";
|
||||
case ACTION_CONSTRUCT:
|
||||
return "construct";
|
||||
case ACTION_DISASSEMBLE:
|
||||
return "disassemble";
|
||||
case ACTION_SLEEP:
|
||||
return "sleep";
|
||||
case ACTION_TOGGLE_SAFEMODE:
|
||||
return "safemode";
|
||||
case ACTION_TOGGLE_AUTOSAFE:
|
||||
return "autosafe";
|
||||
case ACTION_IGNORE_ENEMY:
|
||||
return "ignore_enemy";
|
||||
case ACTION_SAVE:
|
||||
return "save";
|
||||
case ACTION_QUIT:
|
||||
return "quit";
|
||||
case ACTION_PL_INFO:
|
||||
return "player_data";
|
||||
case ACTION_MAP:
|
||||
return "map";
|
||||
case ACTION_MISSIONS:
|
||||
return "missions";
|
||||
case ACTION_FACTIONS:
|
||||
return "factions";
|
||||
case ACTION_KILLS:
|
||||
return "kills";
|
||||
case ACTION_MORALE:
|
||||
return "morale";
|
||||
case ACTION_MESSAGES:
|
||||
return "messages";
|
||||
case ACTION_HELP:
|
||||
return "help";
|
||||
case ACTION_DEBUG:
|
||||
return "debug";
|
||||
case ACTION_DISPLAY_SCENT:
|
||||
return "debug_scent";
|
||||
case ACTION_TOGGLE_DEBUGMON:
|
||||
return "debug_mode";
|
||||
case ACTION_NULL:
|
||||
return "null";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
switch (act) {
|
||||
case ACTION_PAUSE:
|
||||
return "pause";
|
||||
case ACTION_MOVE_N:
|
||||
return "move_n";
|
||||
case ACTION_MOVE_NE:
|
||||
return "move_ne";
|
||||
case ACTION_MOVE_E:
|
||||
return "move_e";
|
||||
case ACTION_MOVE_SE:
|
||||
return "move_se";
|
||||
case ACTION_MOVE_S:
|
||||
return "move_s";
|
||||
case ACTION_MOVE_SW:
|
||||
return "move_sw";
|
||||
case ACTION_MOVE_W:
|
||||
return "move_w";
|
||||
case ACTION_MOVE_NW:
|
||||
return "move_nw";
|
||||
case ACTION_MOVE_DOWN:
|
||||
return "move_down";
|
||||
case ACTION_MOVE_UP:
|
||||
return "move_up";
|
||||
case ACTION_CENTER:
|
||||
return "center";
|
||||
case ACTION_SHIFT_N:
|
||||
return "shift_n";
|
||||
case ACTION_SHIFT_NE:
|
||||
return "shift_ne";
|
||||
case ACTION_SHIFT_E:
|
||||
return "shift_e";
|
||||
case ACTION_SHIFT_SE:
|
||||
return "shift_se";
|
||||
case ACTION_SHIFT_S:
|
||||
return "shift_s";
|
||||
case ACTION_SHIFT_SW:
|
||||
return "shift_sw";
|
||||
case ACTION_SHIFT_W:
|
||||
return "shift_w";
|
||||
case ACTION_SHIFT_NW:
|
||||
return "shift_nw";
|
||||
case ACTION_OPEN:
|
||||
return "open";
|
||||
case ACTION_CLOSE:
|
||||
return "close";
|
||||
case ACTION_SMASH:
|
||||
return "smash";
|
||||
case ACTION_EXAMINE:
|
||||
return "examine";
|
||||
case ACTION_ADVANCEDINV:
|
||||
return "advinv";
|
||||
case ACTION_PICKUP:
|
||||
return "pickup";
|
||||
case ACTION_BUTCHER:
|
||||
return "butcher";
|
||||
case ACTION_CHAT:
|
||||
return "chat";
|
||||
case ACTION_LOOK:
|
||||
return "look";
|
||||
case ACTION_PEEK:
|
||||
return "peek";
|
||||
case ACTION_LIST_ITEMS:
|
||||
return "listitems";
|
||||
case ACTION_INVENTORY:
|
||||
return "inventory";
|
||||
case ACTION_COMPARE:
|
||||
return "compare";
|
||||
case ACTION_ORGANIZE:
|
||||
return "organize";
|
||||
case ACTION_USE:
|
||||
return "apply";
|
||||
case ACTION_USE_WIELDED:
|
||||
return "apply_wielded";
|
||||
case ACTION_WEAR:
|
||||
return "wear";
|
||||
case ACTION_TAKE_OFF:
|
||||
return "take_off";
|
||||
case ACTION_EAT:
|
||||
return "eat";
|
||||
case ACTION_READ:
|
||||
return "read";
|
||||
case ACTION_WIELD:
|
||||
return "wield";
|
||||
case ACTION_PICK_STYLE:
|
||||
return "pick_style";
|
||||
case ACTION_RELOAD:
|
||||
return "reload";
|
||||
case ACTION_UNLOAD:
|
||||
return "unload";
|
||||
case ACTION_THROW:
|
||||
return "throw";
|
||||
case ACTION_FIRE:
|
||||
return "fire";
|
||||
case ACTION_FIRE_BURST:
|
||||
return "fire_burst";
|
||||
case ACTION_SELECT_FIRE_MODE:
|
||||
return "select_fire_mode";
|
||||
case ACTION_DROP:
|
||||
return "drop";
|
||||
case ACTION_DIR_DROP:
|
||||
return "drop_adj";
|
||||
case ACTION_BIONICS:
|
||||
return "bionics";
|
||||
case ACTION_SORT_ARMOR:
|
||||
return "sort_armor";
|
||||
case ACTION_WAIT:
|
||||
return "wait";
|
||||
case ACTION_CRAFT:
|
||||
return "craft";
|
||||
case ACTION_RECRAFT:
|
||||
return "recraft";
|
||||
case ACTION_LONGCRAFT:
|
||||
return "long_craft";
|
||||
case ACTION_CONSTRUCT:
|
||||
return "construct";
|
||||
case ACTION_DISASSEMBLE:
|
||||
return "disassemble";
|
||||
case ACTION_SLEEP:
|
||||
return "sleep";
|
||||
case ACTION_TOGGLE_SAFEMODE:
|
||||
return "safemode";
|
||||
case ACTION_TOGGLE_AUTOSAFE:
|
||||
return "autosafe";
|
||||
case ACTION_IGNORE_ENEMY:
|
||||
return "ignore_enemy";
|
||||
case ACTION_SAVE:
|
||||
return "save";
|
||||
case ACTION_QUIT:
|
||||
return "quit";
|
||||
case ACTION_PL_INFO:
|
||||
return "player_data";
|
||||
case ACTION_MAP:
|
||||
return "map";
|
||||
case ACTION_MISSIONS:
|
||||
return "missions";
|
||||
case ACTION_FACTIONS:
|
||||
return "factions";
|
||||
case ACTION_KILLS:
|
||||
return "kills";
|
||||
case ACTION_MORALE:
|
||||
return "morale";
|
||||
case ACTION_MESSAGES:
|
||||
return "messages";
|
||||
case ACTION_HELP:
|
||||
return "help";
|
||||
case ACTION_DEBUG:
|
||||
return "debug";
|
||||
case ACTION_DISPLAY_SCENT:
|
||||
return "debug_scent";
|
||||
case ACTION_TOGGLE_DEBUGMON:
|
||||
return "debug_mode";
|
||||
case ACTION_NULL:
|
||||
return "null";
|
||||
}
|
||||
return "unknown";
|
||||
}
|
||||
|
||||
action_id look_up_action(std::string ident)
|
||||
{
|
||||
for (int i = 0; i < NUM_ACTIONS; i++) {
|
||||
if (action_ident( action_id(i) ) == ident)
|
||||
return action_id(i);
|
||||
}
|
||||
return ACTION_NULL;
|
||||
for (int i = 0; i < NUM_ACTIONS; i++)
|
||||
{
|
||||
if (action_ident( action_id(i) ) == ident)
|
||||
{
|
||||
return action_id(i);
|
||||
}
|
||||
}
|
||||
return ACTION_NULL;
|
||||
}
|
||||
|
||||
std::string action_name(action_id act)
|
||||
{
|
||||
switch (act) {
|
||||
case ACTION_PAUSE:
|
||||
return "Pause";
|
||||
case ACTION_MOVE_N:
|
||||
return "Move North";
|
||||
case ACTION_MOVE_NE:
|
||||
return "Move Northeast";
|
||||
case ACTION_MOVE_E:
|
||||
return "Move East";
|
||||
case ACTION_MOVE_SE:
|
||||
return "Move Southeast";
|
||||
case ACTION_MOVE_S:
|
||||
return "Move South";
|
||||
case ACTION_MOVE_SW:
|
||||
return "Move Southwest";
|
||||
case ACTION_MOVE_W:
|
||||
return "Move West";
|
||||
case ACTION_MOVE_NW:
|
||||
return "Move Northwest";
|
||||
case ACTION_MOVE_DOWN:
|
||||
return "Descend Stairs";
|
||||
case ACTION_MOVE_UP:
|
||||
return "Ascend Stairs";
|
||||
case ACTION_CENTER:
|
||||
return "Center View";
|
||||
case ACTION_SHIFT_N:
|
||||
return "Move View North";
|
||||
case ACTION_SHIFT_NE:
|
||||
return "Move View Northeast";
|
||||
case ACTION_SHIFT_E:
|
||||
return "Move View East";
|
||||
case ACTION_SHIFT_SE:
|
||||
return "Move View Southeast";
|
||||
case ACTION_SHIFT_S:
|
||||
return "Move View South";
|
||||
case ACTION_SHIFT_SW:
|
||||
return "Move View Southwest";
|
||||
case ACTION_SHIFT_W:
|
||||
return "Move View West";
|
||||
case ACTION_SHIFT_NW:
|
||||
return "Move View Northwest";
|
||||
case ACTION_OPEN:
|
||||
return "Open Door";
|
||||
case ACTION_CLOSE:
|
||||
return "Close Door";
|
||||
case ACTION_SMASH:
|
||||
return "Smash Nearby Terrain";
|
||||
case ACTION_EXAMINE:
|
||||
return "Examine Nearby Terrain";
|
||||
case ACTION_PICKUP:
|
||||
return "Pick Item(s) Up";
|
||||
case ACTION_BUTCHER:
|
||||
return "Butcher";
|
||||
case ACTION_CHAT:
|
||||
return "Chat with NPC";
|
||||
case ACTION_LOOK:
|
||||
return "Look Around";
|
||||
case ACTION_PEEK:
|
||||
return "Peek Around Corners";
|
||||
case ACTION_LIST_ITEMS:
|
||||
return "List all items around the player";
|
||||
case ACTION_INVENTORY:
|
||||
return "Open Inventory";
|
||||
case ACTION_COMPARE:
|
||||
return "Compare two Items";
|
||||
case ACTION_ORGANIZE:
|
||||
return "Swap Inventory Letters";
|
||||
case ACTION_USE:
|
||||
return "Apply or Use Item";
|
||||
case ACTION_USE_WIELDED:
|
||||
return "Apply or Use Wielded Item";
|
||||
case ACTION_WEAR:
|
||||
return "Wear Item";
|
||||
case ACTION_TAKE_OFF:
|
||||
return "Take Off Worn Item";
|
||||
case ACTION_EAT:
|
||||
return "Eat";
|
||||
case ACTION_READ:
|
||||
return "Read";
|
||||
case ACTION_WIELD:
|
||||
return "Wield";
|
||||
case ACTION_PICK_STYLE:
|
||||
return "Select Unarmed Style";
|
||||
case ACTION_RELOAD:
|
||||
return "Reload Wielded Item";
|
||||
case ACTION_UNLOAD:
|
||||
return "Unload or Empty Wielded Item";
|
||||
case ACTION_THROW:
|
||||
return "Throw Item";
|
||||
case ACTION_FIRE:
|
||||
return "Fire Wielded Item";
|
||||
case ACTION_FIRE_BURST:
|
||||
return "Burst-Fire Wielded Item";
|
||||
case ACTION_SELECT_FIRE_MODE:
|
||||
return "Toggle attack mode of Wielded Item";
|
||||
case ACTION_DROP:
|
||||
return "Drop Item";
|
||||
case ACTION_DIR_DROP:
|
||||
return "Drop Item to Adjacent Tile";
|
||||
case ACTION_BIONICS:
|
||||
return "View/Activate Bionics";
|
||||
case ACTION_WAIT:
|
||||
return "Wait for Several Minutes";
|
||||
case ACTION_CRAFT:
|
||||
return "Craft Items";
|
||||
case ACTION_RECRAFT:
|
||||
return "Recraft last recipe";
|
||||
case ACTION_LONGCRAFT:
|
||||
return "Craft as long as possible";
|
||||
case ACTION_CONSTRUCT:
|
||||
return "Construct Terrain";
|
||||
case ACTION_DISASSEMBLE:
|
||||
return "Disassemble items";
|
||||
case ACTION_SLEEP:
|
||||
return "Sleep";
|
||||
case ACTION_TOGGLE_SAFEMODE:
|
||||
return "Toggle Safemode";
|
||||
case ACTION_TOGGLE_AUTOSAFE:
|
||||
return "Toggle Auto-Safemode";
|
||||
case ACTION_IGNORE_ENEMY:
|
||||
return "Ignore Nearby Enemy";
|
||||
case ACTION_SAVE:
|
||||
return "Save and Quit";
|
||||
case ACTION_QUIT:
|
||||
return "Commit Suicide";
|
||||
case ACTION_PL_INFO:
|
||||
return "View Player Info";
|
||||
case ACTION_MAP:
|
||||
return "View Map";
|
||||
case ACTION_MISSIONS:
|
||||
return "View Missions";
|
||||
case ACTION_FACTIONS:
|
||||
return "View Factions";
|
||||
case ACTION_KILLS:
|
||||
return "View Kills";
|
||||
case ACTION_MORALE:
|
||||
return "View Morale";
|
||||
case ACTION_MESSAGES:
|
||||
return "View Message Log";
|
||||
case ACTION_HELP:
|
||||
return "View Help";
|
||||
case ACTION_DEBUG:
|
||||
return "Debug Menu";
|
||||
case ACTION_DISPLAY_SCENT:
|
||||
return "View Scentmap";
|
||||
case ACTION_TOGGLE_DEBUGMON:
|
||||
return "Toggle Debug Messages";
|
||||
case ACTION_NULL:
|
||||
return "No Action";
|
||||
}
|
||||
return "Someone forgot to name an action.";
|
||||
switch (act)
|
||||
{
|
||||
case ACTION_PAUSE:
|
||||
return "Pause";
|
||||
case ACTION_MOVE_N:
|
||||
return "Move North";
|
||||
case ACTION_MOVE_NE:
|
||||
return "Move Northeast";
|
||||
case ACTION_MOVE_E:
|
||||
return "Move East";
|
||||
case ACTION_MOVE_SE:
|
||||
return "Move Southeast";
|
||||
case ACTION_MOVE_S:
|
||||
return "Move South";
|
||||
case ACTION_MOVE_SW:
|
||||
return "Move Southwest";
|
||||
case ACTION_MOVE_W:
|
||||
return "Move West";
|
||||
case ACTION_MOVE_NW:
|
||||
return "Move Northwest";
|
||||
case ACTION_MOVE_DOWN:
|
||||
return "Descend Stairs";
|
||||
case ACTION_MOVE_UP:
|
||||
return "Ascend Stairs";
|
||||
case ACTION_CENTER:
|
||||
return "Center View";
|
||||
case ACTION_SHIFT_N:
|
||||
return "Move View North";
|
||||
case ACTION_SHIFT_NE:
|
||||
return "Move View Northeast";
|
||||
case ACTION_SHIFT_E:
|
||||
return "Move View East";
|
||||
case ACTION_SHIFT_SE:
|
||||
return "Move View Southeast";
|
||||
case ACTION_SHIFT_S:
|
||||
return "Move View South";
|
||||
case ACTION_SHIFT_SW:
|
||||
return "Move View Southwest";
|
||||
case ACTION_SHIFT_W:
|
||||
return "Move View West";
|
||||
case ACTION_SHIFT_NW:
|
||||
return "Move View Northwest";
|
||||
case ACTION_OPEN:
|
||||
return "Open Door";
|
||||
case ACTION_CLOSE:
|
||||
return "Close Door";
|
||||
case ACTION_SMASH:
|
||||
return "Smash Nearby Terrain";
|
||||
case ACTION_EXAMINE:
|
||||
return "Examine Nearby Terrain";
|
||||
case ACTION_PICKUP:
|
||||
return "Pick Item(s) Up";
|
||||
case ACTION_BUTCHER:
|
||||
return "Butcher";
|
||||
case ACTION_CHAT:
|
||||
return "Chat with NPC";
|
||||
case ACTION_LOOK:
|
||||
return "Look Around";
|
||||
case ACTION_PEEK:
|
||||
return "Peek Around Corners";
|
||||
case ACTION_LIST_ITEMS:
|
||||
return "List all items around the player";
|
||||
case ACTION_INVENTORY:
|
||||
return "Open Inventory";
|
||||
case ACTION_ADVANCEDINV:
|
||||
return "Advanced Inventory management";
|
||||
case ACTION_COMPARE:
|
||||
return "Compare two Items";
|
||||
case ACTION_ORGANIZE:
|
||||
return "Swap Inventory Letters";
|
||||
case ACTION_USE:
|
||||
return "Apply or Use Item";
|
||||
case ACTION_USE_WIELDED:
|
||||
return "Apply or Use Wielded Item";
|
||||
case ACTION_WEAR:
|
||||
return "Wear Item";
|
||||
case ACTION_TAKE_OFF:
|
||||
return "Take Off Worn Item";
|
||||
case ACTION_EAT:
|
||||
return "Eat";
|
||||
case ACTION_READ:
|
||||
return "Read";
|
||||
case ACTION_WIELD:
|
||||
return "Wield";
|
||||
case ACTION_PICK_STYLE:
|
||||
return "Select Unarmed Style";
|
||||
case ACTION_RELOAD:
|
||||
return "Reload Wielded Item";
|
||||
case ACTION_UNLOAD:
|
||||
return "Unload or Empty Wielded Item";
|
||||
case ACTION_THROW:
|
||||
return "Throw Item";
|
||||
case ACTION_FIRE:
|
||||
return "Fire Wielded Item";
|
||||
case ACTION_FIRE_BURST:
|
||||
return "Burst-Fire Wielded Item";
|
||||
case ACTION_SELECT_FIRE_MODE:
|
||||
return "Toggle attack mode of Wielded Item";
|
||||
case ACTION_DROP:
|
||||
return "Drop Item";
|
||||
case ACTION_DIR_DROP:
|
||||
return "Drop Item to Adjacent Tile";
|
||||
case ACTION_BIONICS:
|
||||
return "View/Activate Bionics";
|
||||
case ACTION_SORT_ARMOR:
|
||||
return "Re-layer armour/clothing";
|
||||
case ACTION_WAIT:
|
||||
return "Wait for Several Minutes";
|
||||
case ACTION_CRAFT:
|
||||
return "Craft Items";
|
||||
case ACTION_RECRAFT:
|
||||
return "Recraft last recipe";
|
||||
case ACTION_LONGCRAFT:
|
||||
return "Craft as long as possible";
|
||||
case ACTION_CONSTRUCT:
|
||||
return "Construct Terrain";
|
||||
case ACTION_DISASSEMBLE:
|
||||
return "Disassemble items";
|
||||
case ACTION_SLEEP:
|
||||
return "Sleep";
|
||||
case ACTION_TOGGLE_SAFEMODE:
|
||||
return "Toggle Safemode";
|
||||
case ACTION_TOGGLE_AUTOSAFE:
|
||||
return "Toggle Auto-Safemode";
|
||||
case ACTION_IGNORE_ENEMY:
|
||||
return "Ignore Nearby Enemy";
|
||||
case ACTION_SAVE:
|
||||
return "Save and Quit";
|
||||
case ACTION_QUIT:
|
||||
return "Commit Suicide";
|
||||
case ACTION_PL_INFO:
|
||||
return "View Player Info";
|
||||
case ACTION_MAP:
|
||||
return "View Map";
|
||||
case ACTION_MISSIONS:
|
||||
return "View Missions";
|
||||
case ACTION_FACTIONS:
|
||||
return "View Factions";
|
||||
case ACTION_KILLS:
|
||||
return "View Kills";
|
||||
case ACTION_MORALE:
|
||||
return "View Morale";
|
||||
case ACTION_MESSAGES:
|
||||
return "View Message Log";
|
||||
case ACTION_HELP:
|
||||
return "View Help";
|
||||
case ACTION_DEBUG:
|
||||
return "Debug Menu";
|
||||
case ACTION_DISPLAY_SCENT:
|
||||
return "View Scentmap";
|
||||
case ACTION_TOGGLE_DEBUGMON:
|
||||
return "Toggle Debug Messages";
|
||||
case ACTION_NULL:
|
||||
return "No Action";
|
||||
}
|
||||
return "Someone forgot to name an action.";
|
||||
}
|
||||
|
||||
@@ -38,6 +38,7 @@ ACTION_PEEK,
|
||||
ACTION_LIST_ITEMS,
|
||||
// Inventory Interaction (including quasi-inventories like bionics)
|
||||
ACTION_INVENTORY,
|
||||
ACTION_ADVANCEDINV,
|
||||
ACTION_COMPARE,
|
||||
ACTION_ORGANIZE,
|
||||
ACTION_USE,
|
||||
@@ -57,6 +58,7 @@ ACTION_SELECT_FIRE_MODE,
|
||||
ACTION_DROP,
|
||||
ACTION_DIR_DROP,
|
||||
ACTION_BIONICS,
|
||||
ACTION_SORT_ARMOR,
|
||||
// Long-term / special actions
|
||||
ACTION_WAIT,
|
||||
ACTION_CRAFT,
|
||||
|
||||
+227
@@ -0,0 +1,227 @@
|
||||
#include "addiction.h"
|
||||
|
||||
void addict_effect(game *g, addiction &add)
|
||||
{
|
||||
int in = add.intensity;
|
||||
|
||||
switch (add.type) {
|
||||
case ADD_CIG:
|
||||
if (in > 20 || one_in((500 - 20 * in))) {
|
||||
g->add_msg("You %s a cigarette.",
|
||||
rng(0, 6) < in ? "need" : "could use");
|
||||
g->cancel_activity_query("You have a nicotine craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_NICOTINE, -15, -50);
|
||||
if (one_in(800 - 50 * in))
|
||||
g->u.fatigue++;
|
||||
if (one_in(400 - 20 * in))
|
||||
g->u.stim--;
|
||||
}
|
||||
break;
|
||||
|
||||
case ADD_CAFFEINE:
|
||||
g->u.moves -= 2;
|
||||
if (in > 20 || one_in((500 - 20 * in))) {
|
||||
g->add_msg("You want some caffeine.");
|
||||
g->cancel_activity_query("You have a caffeine craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_CAFFEINE, -5, -30);
|
||||
if (rng(0, 10) < in)
|
||||
g->u.stim--;
|
||||
if (rng(8, 400) < in) {
|
||||
g->add_msg("Your hands start shaking... you need it bad!");
|
||||
g->u.add_disease(DI_SHAKES, 20, g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ADD_ALCOHOL:
|
||||
g->u.per_cur--;
|
||||
g->u.int_cur--;
|
||||
if (rng(40, 1200) <= in * 10)
|
||||
g->u.health--;
|
||||
if (one_in(20) && rng(0, 20) < in) {
|
||||
g->add_msg("You could use a drink.");
|
||||
g->cancel_activity_query("You have an alcohol craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_ALCOHOL, -35, -120);
|
||||
} else if (rng(8, 300) < in) {
|
||||
g->add_msg("Your hands start shaking... you need a drink bad!");
|
||||
g->cancel_activity_query("You have an alcohol craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_ALCOHOL, -35, -120);
|
||||
g->u.add_disease(DI_SHAKES, 50, g);
|
||||
} else if (!g->u.has_disease(DI_HALLU) && rng(10, 1600) < in)
|
||||
g->u.add_disease(DI_HALLU, 3600, g);
|
||||
break;
|
||||
|
||||
case ADD_SLEEP:
|
||||
// No effects here--just in player::can_sleep()
|
||||
// EXCEPT! Prolong this addiction longer than usual.
|
||||
if (one_in(2) && add.sated < 0)
|
||||
add.sated++;
|
||||
break;
|
||||
|
||||
case ADD_PKILLER:
|
||||
if ((in >= 25 || int(g->turn) % (100 - in * 4) == 0) && g->u.pkill > 0)
|
||||
g->u.pkill--; // Tolerance increases!
|
||||
if (g->u.pkill >= 35) // No further effects if we're doped up.
|
||||
add.sated = 0;
|
||||
else {
|
||||
g->u.str_cur -= 1 + int(in / 7);
|
||||
g->u.per_cur--;
|
||||
g->u.dex_cur--;
|
||||
if (g->u.pain < in * 3)
|
||||
g->u.pain++;
|
||||
if (in >= 40 || one_in((1200 - 30 * in)))
|
||||
g->u.health--;
|
||||
if (one_in(20) && dice(2, 20) < in) {
|
||||
g->add_msg("Your hands start shaking... you need some painkillers.");
|
||||
g->cancel_activity_query("You have an opiate craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_OPIATE, -40, -200);
|
||||
g->u.add_disease(DI_SHAKES, 20 + in * 5, g);
|
||||
} else if (one_in(20) && dice(2, 30) < in) {
|
||||
g->add_msg("You feel anxious. You need your painkillers!");
|
||||
g->u.add_morale(MORALE_CRAVING_OPIATE, -30, -200);
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
} else if (one_in(50) && dice(3, 50) < in) {
|
||||
g->add_msg("You throw up heavily!");
|
||||
g->cancel_activity_query("Throwing up.");
|
||||
g->u.vomit(g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ADD_SPEED: {
|
||||
int move_pen = in * 5;
|
||||
if (move_pen > 30)
|
||||
move_pen = 30;
|
||||
g->u.moves -= move_pen;
|
||||
g->u.int_cur--;
|
||||
g->u.str_cur--;
|
||||
if (g->u.stim > -100 && (in >= 20 || int(g->turn) % (100 - in * 5) == 0))
|
||||
g->u.stim--;
|
||||
if (rng(0, 150) <= in)
|
||||
g->u.health--;
|
||||
if (dice(2, 100) < in) {
|
||||
g->add_msg("You feel depressed. Speed would help.");
|
||||
g->cancel_activity_query("You have a speed craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_SPEED, -25, -200);
|
||||
} else if (one_in(10) && dice(2, 80) < in) {
|
||||
g->add_msg("Your hands start shaking... you need a pick-me-up.");
|
||||
g->cancel_activity_query("You have a speed craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_SPEED, -25, -200);
|
||||
g->u.add_disease(DI_SHAKES, in * 20, g);
|
||||
} else if (one_in(50) && dice(2, 100) < in) {
|
||||
g->add_msg("You stop suddenly, feeling bewildered.");
|
||||
g->cancel_activity();
|
||||
g->u.moves -= 300;
|
||||
} else if (!g->u.has_disease(DI_HALLU) && one_in(20) &&
|
||||
8 + dice(2, 80) < in)
|
||||
g->u.add_disease(DI_HALLU, 3600, g);
|
||||
} break;
|
||||
|
||||
case ADD_COKE:
|
||||
g->u.int_cur--;
|
||||
g->u.per_cur--;
|
||||
if (in >= 30 || one_in((900 - 30 * in))) {
|
||||
g->add_msg("You feel like you need a bump.");
|
||||
g->cancel_activity_query("You have a craving for cocaine.");
|
||||
g->u.add_morale(MORALE_CRAVING_COCAINE, -20, -250);
|
||||
}
|
||||
if (dice(2, 80) <= in) {
|
||||
g->add_msg("You feel like you need a bump.");
|
||||
g->cancel_activity_query("You have a craving for cocaine.");
|
||||
g->u.add_morale(MORALE_CRAVING_COCAINE, -20, -250);
|
||||
g->u.stim -= 3;
|
||||
}
|
||||
break;
|
||||
case ADD_CRACK:
|
||||
g->u.int_cur--;
|
||||
g->u.per_cur--;
|
||||
if (in >= 30 || one_in((900 - 30 * in))) {
|
||||
g->add_msg("You're shivering, you need some crack.");
|
||||
g->cancel_activity_query("You have a craving for crack.");
|
||||
g->u.add_morale(MORALE_CRAVING_CRACK, -80, -250);
|
||||
}
|
||||
if (dice(2, 80) <= in) {
|
||||
g->add_msg("You're shivering, you need some crack.");
|
||||
g->cancel_activity_query("You have a craving for crack.");
|
||||
g->u.add_morale(MORALE_CRAVING_CRACK, -80, -250);
|
||||
g->u.stim -= 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string addiction_name(addiction cur)
|
||||
{
|
||||
switch (cur.type) {
|
||||
case ADD_CIG: return "Nicotine Withdrawal";
|
||||
case ADD_CAFFEINE: return "Caffeine Withdrawal";
|
||||
case ADD_ALCOHOL: return "Alcohol Withdrawal";
|
||||
case ADD_SLEEP: return "Sleeping Pill Dependance";
|
||||
case ADD_PKILLER: return "Opiate Withdrawal";
|
||||
case ADD_SPEED: return "Amphetamine Withdrawal";
|
||||
case ADD_COKE: return "Cocaine Withdrawal";
|
||||
case ADD_CRACK: return "Crack Cocaine Withdrawal";
|
||||
default: return "Erroneous addiction";
|
||||
}
|
||||
}
|
||||
|
||||
add_type addiction_type(std::string name)
|
||||
{
|
||||
if (name == "nicotine")
|
||||
return ADD_CIG;
|
||||
else if (name == "caffeine")
|
||||
return ADD_CAFFEINE;
|
||||
else if (name == "alcohol")
|
||||
return ADD_ALCOHOL;
|
||||
else if (name == "sleeping pill")
|
||||
return ADD_SLEEP;
|
||||
else if (name == "opiate")
|
||||
return ADD_PKILLER;
|
||||
else if (name == "amphetamine")
|
||||
return ADD_SPEED;
|
||||
else if (name == "cocaine")
|
||||
return ADD_COKE;
|
||||
else if (name == "crack")
|
||||
return ADD_CRACK;
|
||||
else
|
||||
return ADD_NULL;
|
||||
}
|
||||
|
||||
std::string addiction_text(addiction cur)
|
||||
{
|
||||
std::stringstream dump;
|
||||
int strpen = 1 + int(cur.intensity / 7);
|
||||
switch (cur.type) {
|
||||
case ADD_CIG:
|
||||
return "Intelligence - 1; Occasional cravings";
|
||||
|
||||
case ADD_CAFFEINE:
|
||||
return "Strength - 1; Slight sluggishness; Occasional cravings";
|
||||
|
||||
case ADD_ALCOHOL:
|
||||
return "\
|
||||
Perception - 1; Intelligence - 1; Occasional Cravings;\n\
|
||||
Risk of delirium tremens";
|
||||
|
||||
case ADD_SLEEP:
|
||||
return "You may find it difficult to sleep without medication.";
|
||||
|
||||
case ADD_PKILLER:
|
||||
dump << "Strength -" << strpen << "; Perception - 1; Dexterity - 1;" <<
|
||||
std::endl <<
|
||||
"Depression and physical pain to some degree. Frequent cravings. Vomiting.";
|
||||
return dump.str();
|
||||
|
||||
case ADD_SPEED:
|
||||
return "Strength - 1; Intelligence - 1;\n\
|
||||
Movement rate reduction. Depression. Weak immune system. Frequent cravings.";
|
||||
|
||||
case ADD_COKE:
|
||||
return "Perception - 1; Intelligence - 1; Frequent cravings.";
|
||||
|
||||
case ADD_CRACK:
|
||||
return "Perception - 2; Intelligence - 2; Frequent cravings.";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
+4
-200
@@ -8,208 +8,12 @@
|
||||
|
||||
#define MIN_ADDICTION_LEVEL 3 // Minimum intensity before effects are seen
|
||||
|
||||
void addict_effect(game *g, addiction &add)
|
||||
{
|
||||
int in = add.intensity;
|
||||
void addict_effect(game *g, addiction &add);
|
||||
|
||||
switch (add.type) {
|
||||
case ADD_CIG:
|
||||
if (in > 20 || one_in((500 - 20 * in))) {
|
||||
g->add_msg("You %s a cigarette.",
|
||||
rng(0, 6) < in ? "need" : "could use");
|
||||
g->cancel_activity_query("You have a nicotine craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_NICOTINE, -15, -50);
|
||||
if (one_in(800 - 50 * in))
|
||||
g->u.fatigue++;
|
||||
if (one_in(400 - 20 * in))
|
||||
g->u.stim--;
|
||||
}
|
||||
break;
|
||||
std::string addiction_name(addiction cur);
|
||||
|
||||
case ADD_CAFFEINE:
|
||||
g->u.moves -= 2;
|
||||
if (in > 20 || one_in((500 - 20 * in))) {
|
||||
g->add_msg("You want some caffeine.");
|
||||
g->cancel_activity_query("You have a caffeine craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_CAFFEINE, -5, -30);
|
||||
if (rng(0, 10) < in)
|
||||
g->u.stim--;
|
||||
if (rng(8, 400) < in) {
|
||||
g->add_msg("Your hands start shaking... you need it bad!");
|
||||
g->u.add_disease(DI_SHAKES, 20, g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
add_type addiction_type(std::string name);
|
||||
|
||||
case ADD_ALCOHOL:
|
||||
g->u.per_cur--;
|
||||
g->u.int_cur--;
|
||||
if (rng(40, 1200) <= in * 10)
|
||||
g->u.health--;
|
||||
if (one_in(20) && rng(0, 20) < in) {
|
||||
g->add_msg("You could use a drink.");
|
||||
g->cancel_activity_query("You have an alcohol craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_ALCOHOL, -35, -120);
|
||||
} else if (rng(8, 300) < in) {
|
||||
g->add_msg("Your hands start shaking... you need a drink bad!");
|
||||
g->cancel_activity_query("You have an alcohol craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_ALCOHOL, -35, -120);
|
||||
g->u.add_disease(DI_SHAKES, 50, g);
|
||||
} else if (!g->u.has_disease(DI_HALLU) && rng(10, 1600) < in)
|
||||
g->u.add_disease(DI_HALLU, 3600, g);
|
||||
break;
|
||||
|
||||
case ADD_SLEEP:
|
||||
// No effects here--just in player::can_sleep()
|
||||
// EXCEPT! Prolong this addiction longer than usual.
|
||||
if (one_in(2) && add.sated < 0)
|
||||
add.sated++;
|
||||
break;
|
||||
|
||||
case ADD_PKILLER:
|
||||
if ((in >= 25 || int(g->turn) % (100 - in * 4) == 0) && g->u.pkill > 0)
|
||||
g->u.pkill--; // Tolerance increases!
|
||||
if (g->u.pkill >= 35) // No further effects if we're doped up.
|
||||
add.sated = 0;
|
||||
else {
|
||||
g->u.str_cur -= 1 + int(in / 7);
|
||||
g->u.per_cur--;
|
||||
g->u.dex_cur--;
|
||||
if (g->u.pain < in * 3)
|
||||
g->u.pain++;
|
||||
if (in >= 40 || one_in((1200 - 30 * in)))
|
||||
g->u.health--;
|
||||
if (one_in(20) && dice(2, 20) < in) {
|
||||
g->add_msg("Your hands start shaking... you need some painkillers.");
|
||||
g->cancel_activity_query("You have an opiate craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_OPIATE, -40, -200);
|
||||
g->u.add_disease(DI_SHAKES, 20 + in * 5, g);
|
||||
} else if (one_in(20) && dice(2, 30) < in) {
|
||||
g->add_msg("You feel anxious. You need your painkillers!");
|
||||
g->u.add_morale(MORALE_CRAVING_OPIATE, -30, -200);
|
||||
g->cancel_activity_query("You have a craving.");
|
||||
} else if (one_in(50) && dice(3, 50) < in) {
|
||||
g->add_msg("You throw up heavily!");
|
||||
g->cancel_activity_query("Throwing up.");
|
||||
g->u.vomit(g);
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case ADD_SPEED: {
|
||||
int move_pen = in * 5;
|
||||
if (move_pen > 30)
|
||||
move_pen = 30;
|
||||
g->u.moves -= move_pen;
|
||||
g->u.int_cur--;
|
||||
g->u.str_cur--;
|
||||
if (g->u.stim > -100 && (in >= 20 || int(g->turn) % (100 - in * 5) == 0))
|
||||
g->u.stim--;
|
||||
if (rng(0, 150) <= in)
|
||||
g->u.health--;
|
||||
if (dice(2, 100) < in) {
|
||||
g->add_msg("You feel depressed. Speed would help.");
|
||||
g->cancel_activity_query("You have a speed craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_SPEED, -25, -200);
|
||||
} else if (one_in(10) && dice(2, 80) < in) {
|
||||
g->add_msg("Your hands start shaking... you need a pick-me-up.");
|
||||
g->cancel_activity_query("You have a speed craving.");
|
||||
g->u.add_morale(MORALE_CRAVING_SPEED, -25, -200);
|
||||
g->u.add_disease(DI_SHAKES, in * 20, g);
|
||||
} else if (one_in(50) && dice(2, 100) < in) {
|
||||
g->add_msg("You stop suddenly, feeling bewildered.");
|
||||
g->cancel_activity();
|
||||
g->u.moves -= 300;
|
||||
} else if (!g->u.has_disease(DI_HALLU) && one_in(20) &&
|
||||
8 + dice(2, 80) < in)
|
||||
g->u.add_disease(DI_HALLU, 3600, g);
|
||||
} break;
|
||||
|
||||
case ADD_COKE:
|
||||
g->u.int_cur--;
|
||||
g->u.per_cur--;
|
||||
if (in >= 30 || one_in((900 - 30 * in))) {
|
||||
g->add_msg("You feel like you need a bump.");
|
||||
g->cancel_activity_query("You have a craving for cocaine.");
|
||||
g->u.add_morale(MORALE_CRAVING_COCAINE, -20, -250);
|
||||
}
|
||||
if (dice(2, 80) <= in) {
|
||||
g->add_msg("You feel like you need a bump.");
|
||||
g->cancel_activity_query("You have a craving for cocaine.");
|
||||
g->u.add_morale(MORALE_CRAVING_COCAINE, -20, -250);
|
||||
g->u.stim -= 3;
|
||||
}
|
||||
break;
|
||||
case ADD_CRACK:
|
||||
g->u.int_cur--;
|
||||
g->u.per_cur--;
|
||||
if (in >= 30 || one_in((900 - 30 * in))) {
|
||||
g->add_msg("You're shivering, you need some crack.");
|
||||
g->cancel_activity_query("You have a craving for crack.");
|
||||
g->u.add_morale(MORALE_CRAVING_CRACK, -80, -250);
|
||||
}
|
||||
if (dice(2, 80) <= in) {
|
||||
g->add_msg("You're shivering, you need some crack.");
|
||||
g->cancel_activity_query("You have a craving for crack.");
|
||||
g->u.add_morale(MORALE_CRAVING_CRACK, -80, -250);
|
||||
g->u.stim -= 3;
|
||||
}
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
std::string addiction_name(addiction cur)
|
||||
{
|
||||
switch (cur.type) {
|
||||
case ADD_CIG: return "Nicotine Withdrawal";
|
||||
case ADD_CAFFEINE: return "Caffeine Withdrawal";
|
||||
case ADD_ALCOHOL: return "Alcohol Withdrawal";
|
||||
case ADD_SLEEP: return "Sleeping Pill Dependance";
|
||||
case ADD_PKILLER: return "Opiate Withdrawal";
|
||||
case ADD_SPEED: return "Amphetamine Withdrawal";
|
||||
case ADD_COKE: return "Cocaine Withdrawal";
|
||||
case ADD_CRACK: return "Crack Cocaine Withdrawal";
|
||||
default: return "Erroneous addiction";
|
||||
}
|
||||
}
|
||||
|
||||
std::string addiction_text(addiction cur)
|
||||
{
|
||||
std::stringstream dump;
|
||||
int strpen = 1 + int(cur.intensity / 7);
|
||||
switch (cur.type) {
|
||||
case ADD_CIG:
|
||||
return "Intelligence - 1; Occasional cravings";
|
||||
|
||||
case ADD_CAFFEINE:
|
||||
return "Strength - 1; Slight sluggishness; Occasional cravings";
|
||||
|
||||
case ADD_ALCOHOL:
|
||||
return "\
|
||||
Perception - 1; Intelligence - 1; Occasional Cravings;\n\
|
||||
Risk of delirium tremens";
|
||||
|
||||
case ADD_SLEEP:
|
||||
return "You may find it difficult to sleep without medication.";
|
||||
|
||||
case ADD_PKILLER:
|
||||
dump << "Strength -" << strpen << "; Perception - 1; Dexterity - 1;" <<
|
||||
std::endl <<
|
||||
"Depression and physical pain to some degree. Frequent cravings. Vomiting.";
|
||||
return dump.str();
|
||||
|
||||
case ADD_SPEED:
|
||||
return "Strength - 1; Intelligence - 1;\n\
|
||||
Movement rate reduction. Depression. Weak immune system. Frequent cravings.";
|
||||
|
||||
case ADD_COKE:
|
||||
return "Perception - 1; Intelligence - 1; Frequent cravings.";
|
||||
|
||||
case ADD_CRACK:
|
||||
return "Perception - 2; Intelligence - 2; Frequent cravings.";
|
||||
default:
|
||||
return "";
|
||||
}
|
||||
}
|
||||
std::string addiction_text(addiction cur);
|
||||
|
||||
#endif
|
||||
|
||||
+370
-19
@@ -9,6 +9,347 @@ std::vector<art_effect_passive> fill_bad_passive();
|
||||
std::vector<art_effect_active> fill_good_active();
|
||||
std::vector<art_effect_active> fill_bad_active();
|
||||
|
||||
int passive_effect_cost[NUM_AEPS] = {
|
||||
0, // AEP_NULL
|
||||
|
||||
3, // AEP_STR_UP
|
||||
3, // AEP_DEX_UP
|
||||
3, // AEP_PER_UP
|
||||
3, // AEP_INT_UP
|
||||
5, // AEP_ALL_UP
|
||||
4, // AEP_SPEED_UP
|
||||
2, // AEP_IODINE
|
||||
4, // AEP_SNAKES
|
||||
7, // AEP_INVISIBLE
|
||||
5, // AEP_CLAIRVOYANCE
|
||||
50, // AEP_SUPER_CLAIRVOYANCE
|
||||
2, // AEP_STEALTH
|
||||
2, // AEP_EXTINGUISH
|
||||
1, // AEP_GLOW
|
||||
1, // AEP_PSYSHIELD
|
||||
3, // AEP_RESIST_ELECTRICITY
|
||||
3, // AEP_CARRY_MORE
|
||||
5, // AEP_SAP_LIFE
|
||||
|
||||
0, // AEP_SPLIT
|
||||
|
||||
-2, // AEP_HUNGER
|
||||
-2, // AEP_THIRST
|
||||
-1, // AEP_SMOKE
|
||||
-5, // AEP_EVIL
|
||||
-3, // AEP_SCHIZO
|
||||
-5, // AEP_RADIOACTIVE
|
||||
-3, // AEP_MUTAGENIC
|
||||
-5, // AEP_ATTENTION
|
||||
-2, // AEP_STR_DOWN
|
||||
-2, // AEP_DEX_DOWN
|
||||
-2, // AEP_PER_DOWN
|
||||
-2, // AEP_INT_DOWN
|
||||
-5, // AEP_ALL_DOWN
|
||||
-4, // AEP_SPEED_DOWN
|
||||
-5, // AEP_FORCE_TELEPORT
|
||||
-3, // AEP_MOVEMENT_NOISE
|
||||
-2, // AEP_BAD_WEATHER
|
||||
-1 // AEP_SICK
|
||||
};
|
||||
|
||||
int active_effect_cost[NUM_AEAS] = {
|
||||
0, // AEA_NULL
|
||||
|
||||
2, // AEA_STORM
|
||||
4, // AEA_FIREBALL
|
||||
5, // AEA_ADRENALINE
|
||||
4, // AEA_MAP
|
||||
0, // AEA_BLOOD
|
||||
0, // AEA_FATIGUE
|
||||
4, // AEA_ACIDBALL
|
||||
5, // AEA_PULSE
|
||||
4, // AEA_HEAL
|
||||
3, // AEA_CONFUSED
|
||||
3, // AEA_ENTRANCE
|
||||
3, // AEA_BUGS
|
||||
5, // AEA_TELEPORT
|
||||
1, // AEA_LIGHT
|
||||
4, // AEA_GROWTH
|
||||
6, // AEA_HURTALL
|
||||
|
||||
0, // AEA_SPLIT
|
||||
|
||||
-3, // AEA_RADIATION
|
||||
-2, // AEA_PAIN
|
||||
-3, // AEA_MUTATE
|
||||
-2, // AEA_PARALYZE
|
||||
-3, // AEA_FIRESTORM
|
||||
-6, // AEA_ATTENTION
|
||||
-4, // AEA_TELEGLOW
|
||||
-2, // AEA_NOISE
|
||||
-2, // AEA_SCREAM
|
||||
-3, // AEA_DIM
|
||||
-4, // AEA_FLASH
|
||||
-2, // AEA_VOMIT
|
||||
-5 // AEA_SHADOWS
|
||||
};
|
||||
|
||||
artifact_shape_datum artifact_shape_data[ARTSHAPE_MAX] = {
|
||||
{"BUG", "BUG", 0, 0, 0, 0},
|
||||
{"sphere", "smooth sphere", 2, 4, 0, 10},
|
||||
{"rod", "tapered rod", 1, 7, 1, 7},
|
||||
{"teardrop", "teardrop-shaped stone", 2, 6, 0, 8},
|
||||
{"lamp", "hollow, transparent cube", 4, 9, 0, 3},
|
||||
{"snake", "winding, flexible rod", 0, 8, 0, 8},
|
||||
{"disc", "smooth disc", 4, 6, 2, 4},
|
||||
{"beads", "string of beads", 3, 7, 0, 6},
|
||||
{"napkin", "very thin sheet", 0, 3, 0, 3},
|
||||
{"urchin", "spiked sphere", 3, 5, 2, 6},
|
||||
{"jelly", "malleable blob", 2, 8, 2, 4},
|
||||
{"spiral", "spiraling rod", 5, 6, 2, 3},
|
||||
{"pin", "pointed rod", 1, 5, 1, 9},
|
||||
{"tube", "hollow tube", 2, 5, 3, 6},
|
||||
{"pyramid", "regular tetrahedron", 3, 7, 2, 4},
|
||||
{"crystal", "translucent crystal", 1, 6, 2, 7},
|
||||
{"knot", "twisted, knotted cord", 2, 6, 1, 7},
|
||||
{"crescent", "crescent-shaped stone", 2, 6, 2, 6}
|
||||
};
|
||||
|
||||
artifact_property_datum artifact_property_data[ARTPROP_MAX] = {
|
||||
{"BUG", "BUG",
|
||||
{AEP_NULL, AEP_NULL, AEP_NULL, AEP_NULL},
|
||||
{AEP_NULL, AEP_NULL, AEP_NULL, AEP_NULL},
|
||||
{AEA_NULL, AEA_NULL, AEA_NULL, AEA_NULL},
|
||||
{AEA_NULL, AEA_NULL, AEA_NULL, AEA_NULL}
|
||||
},
|
||||
{"wriggling", "is constantly wriggling",
|
||||
{AEP_SPEED_UP, AEP_SNAKES, AEP_NULL, AEP_NULL},
|
||||
{AEP_DEX_DOWN, AEP_FORCE_TELEPORT, AEP_SICK, AEP_NULL},
|
||||
{AEA_TELEPORT, AEA_ADRENALINE, AEA_NULL, AEA_NULL},
|
||||
{AEA_MUTATE, AEA_ATTENTION, AEA_VOMIT, AEA_NULL}
|
||||
},
|
||||
{"glowing", "glows faintly",
|
||||
{AEP_INT_UP, AEP_GLOW, AEP_CLAIRVOYANCE, AEP_NULL},
|
||||
{AEP_RADIOACTIVE, AEP_MUTAGENIC, AEP_ATTENTION, AEP_NULL},
|
||||
{AEA_LIGHT, AEA_LIGHT, AEA_LIGHT, AEA_NULL},
|
||||
{AEA_ATTENTION, AEA_TELEGLOW, AEA_FLASH, AEA_SHADOWS}
|
||||
},
|
||||
{"humming", "hums very quietly",
|
||||
{AEP_ALL_UP, AEP_PSYSHIELD, AEP_NULL, AEP_NULL},
|
||||
{AEP_SCHIZO, AEP_PER_DOWN, AEP_INT_DOWN, AEP_NULL},
|
||||
{AEA_PULSE, AEA_ENTRANCE, AEA_NULL, AEA_NULL},
|
||||
{AEA_NOISE, AEA_NOISE, AEA_SCREAM, AEA_NULL}
|
||||
},
|
||||
{"moving", "shifts from side to side slowly",
|
||||
{AEP_STR_UP, AEP_DEX_UP, AEP_SPEED_UP, AEP_NULL},
|
||||
{AEP_HUNGER, AEP_PER_DOWN, AEP_FORCE_TELEPORT, AEP_NULL},
|
||||
{AEA_TELEPORT, AEA_TELEPORT, AEA_MAP, AEA_NULL},
|
||||
{AEA_PARALYZE, AEA_VOMIT, AEA_VOMIT, AEA_NULL}
|
||||
},
|
||||
{"whispering", "makes very faint whispering sounds",
|
||||
{AEP_CLAIRVOYANCE, AEP_EXTINGUISH, AEP_STEALTH, AEP_NULL},
|
||||
{AEP_EVIL, AEP_SCHIZO, AEP_ATTENTION, AEP_NULL},
|
||||
{AEA_FATIGUE, AEA_ENTRANCE, AEA_ENTRANCE, AEA_NULL},
|
||||
{AEA_ATTENTION, AEA_SCREAM, AEA_SCREAM, AEA_SHADOWS}
|
||||
},
|
||||
{"breathing",
|
||||
"shrinks and grows very slightly with a regular pulse, as if breathing",
|
||||
{AEP_SAP_LIFE, AEP_ALL_UP, AEP_SPEED_UP, AEP_CARRY_MORE},
|
||||
{AEP_HUNGER, AEP_THIRST, AEP_SICK, AEP_BAD_WEATHER},
|
||||
{AEA_ADRENALINE, AEA_HEAL, AEA_ENTRANCE, AEA_GROWTH},
|
||||
{AEA_MUTATE, AEA_ATTENTION, AEA_SHADOWS, AEA_NULL}
|
||||
},
|
||||
{"dead", "is icy cold to the touch",
|
||||
{AEP_INVISIBLE, AEP_CLAIRVOYANCE, AEP_EXTINGUISH, AEP_SAP_LIFE},
|
||||
{AEP_HUNGER, AEP_EVIL, AEP_ALL_DOWN, AEP_SICK},
|
||||
{AEA_BLOOD, AEA_HURTALL, AEA_NULL, AEA_NULL},
|
||||
{AEA_PAIN, AEA_SHADOWS, AEA_DIM, AEA_VOMIT}
|
||||
},
|
||||
{"itchy", "makes your skin itch slightly when it is close",
|
||||
{AEP_DEX_UP, AEP_SPEED_UP, AEP_PSYSHIELD, AEP_NULL},
|
||||
{AEP_RADIOACTIVE, AEP_MUTAGENIC, AEP_SICK, AEP_NULL},
|
||||
{AEA_ADRENALINE, AEA_BLOOD, AEA_HEAL, AEA_BUGS},
|
||||
{AEA_RADIATION, AEA_PAIN, AEA_PAIN, AEA_VOMIT}
|
||||
},
|
||||
{"glittering", "glitters faintly under direct light",
|
||||
{AEP_INT_UP, AEP_EXTINGUISH, AEP_GLOW, AEP_NULL},
|
||||
{AEP_SMOKE, AEP_ATTENTION, AEP_NULL, AEP_NULL},
|
||||
{AEA_MAP, AEA_LIGHT, AEA_CONFUSED, AEA_ENTRANCE},
|
||||
{AEA_RADIATION, AEA_MUTATE, AEA_ATTENTION, AEA_FLASH}
|
||||
},
|
||||
{"electric", "very weakly shocks you when touched",
|
||||
{AEP_RESIST_ELECTRICITY, AEP_DEX_UP, AEP_SPEED_UP, AEP_PSYSHIELD},
|
||||
{AEP_THIRST, AEP_SMOKE, AEP_STR_DOWN, AEP_BAD_WEATHER},
|
||||
{AEA_STORM, AEA_ADRENALINE, AEA_LIGHT, AEA_NULL},
|
||||
{AEA_PAIN, AEA_PARALYZE, AEA_FLASH, AEA_FLASH}
|
||||
},
|
||||
{"slimy", "feels slimy",
|
||||
{AEP_SNAKES, AEP_STEALTH, AEP_EXTINGUISH, AEP_SAP_LIFE},
|
||||
{AEP_THIRST, AEP_DEX_DOWN, AEP_SPEED_DOWN, AEP_SICK},
|
||||
{AEA_BLOOD, AEA_ACIDBALL, AEA_GROWTH, AEA_ACIDBALL},
|
||||
{AEA_MUTATE, AEA_MUTATE, AEA_VOMIT, AEA_VOMIT}
|
||||
},
|
||||
{"engraved", "is covered with odd etchings",
|
||||
{AEP_CLAIRVOYANCE, AEP_INVISIBLE, AEP_PSYSHIELD, AEP_SAP_LIFE},
|
||||
{AEP_EVIL, AEP_ATTENTION, AEP_NULL, AEP_NULL},
|
||||
{AEA_FATIGUE, AEA_TELEPORT, AEA_HEAL, AEA_FATIGUE},
|
||||
{AEA_ATTENTION, AEA_ATTENTION, AEA_TELEGLOW, AEA_DIM}
|
||||
},
|
||||
{"crackling", "occasionally makes a soft crackling sound",
|
||||
{AEP_EXTINGUISH, AEP_RESIST_ELECTRICITY, AEP_NULL, AEP_NULL},
|
||||
{AEP_SMOKE, AEP_RADIOACTIVE, AEP_MOVEMENT_NOISE, AEP_NULL},
|
||||
{AEA_STORM, AEA_FIREBALL, AEA_PULSE, AEA_NULL},
|
||||
{AEA_PAIN, AEA_PARALYZE, AEA_NOISE, AEA_NOISE}
|
||||
},
|
||||
{"warm", "is warm to the touch",
|
||||
{AEP_STR_UP, AEP_EXTINGUISH, AEP_GLOW, AEP_NULL},
|
||||
{AEP_SMOKE, AEP_RADIOACTIVE, AEP_NULL, AEP_NULL},
|
||||
{AEA_FIREBALL, AEA_FIREBALL, AEA_FIREBALL, AEA_LIGHT},
|
||||
{AEA_FIRESTORM, AEA_FIRESTORM, AEA_TELEGLOW, AEA_NULL}
|
||||
},
|
||||
{"rattling", "makes a rattling sound when moved",
|
||||
{AEP_DEX_UP, AEP_SPEED_UP, AEP_SNAKES, AEP_CARRY_MORE},
|
||||
{AEP_ATTENTION, AEP_INT_DOWN, AEP_MOVEMENT_NOISE, AEP_MOVEMENT_NOISE},
|
||||
{AEA_BLOOD, AEA_PULSE, AEA_BUGS, AEA_NULL},
|
||||
{AEA_PAIN, AEA_ATTENTION, AEA_NOISE, AEA_NULL}
|
||||
},
|
||||
{"scaled", "has a surface reminiscent of reptile scales",
|
||||
{AEP_SNAKES, AEP_SNAKES, AEP_SNAKES, AEP_STEALTH},
|
||||
{AEP_THIRST, AEP_MUTAGENIC, AEP_SPEED_DOWN, AEP_NULL},
|
||||
{AEA_ADRENALINE, AEA_BUGS, AEA_GROWTH, AEA_NULL},
|
||||
{AEA_MUTATE, AEA_SCREAM, AEA_DIM, AEA_NULL}
|
||||
},
|
||||
{"fractal",
|
||||
"has a self-similar pattern which repeats until it is too small for you to see",
|
||||
{AEP_ALL_UP, AEP_ALL_UP, AEP_CLAIRVOYANCE, AEP_PSYSHIELD},
|
||||
{AEP_SCHIZO, AEP_ATTENTION, AEP_FORCE_TELEPORT, AEP_BAD_WEATHER},
|
||||
{AEA_STORM, AEA_FATIGUE, AEA_TELEPORT, AEA_NULL},
|
||||
{AEA_RADIATION, AEA_MUTATE, AEA_TELEGLOW, AEA_TELEGLOW}
|
||||
}
|
||||
};
|
||||
|
||||
artifact_tool_form_datum artifact_tool_form_data[NUM_ARTTOOLFORMS] = {
|
||||
{"", '*', c_white, MNULL, MNULL, 0, 0, 0, 0, ARTWEAP_BULK,
|
||||
{ARTWEAP_NULL, ARTWEAP_NULL, ARTWEAP_NULL}},
|
||||
|
||||
{"Harp", ';', c_yellow, WOOD, MNULL, 20, 30, 10, 18, ARTWEAP_BULK,
|
||||
{ARTWEAP_SPEAR, ARTWEAP_SWORD, ARTWEAP_KNIFE}},
|
||||
|
||||
{"Staff", '/', c_brown, WOOD, MNULL, 6, 12, 4, 10, ARTWEAP_CLUB,
|
||||
{ARTWEAP_BULK, ARTWEAP_SPEAR, ARTWEAP_KNIFE}},
|
||||
|
||||
{"Sword", '/', c_ltblue, STEEL, MNULL, 8, 14, 8, 28, ARTWEAP_SWORD,
|
||||
{ARTWEAP_BULK, ARTWEAP_NULL, ARTWEAP_NULL}},
|
||||
|
||||
{"Dagger", ';', c_ltblue, STEEL, MNULL, 1, 4, 1, 6, ARTWEAP_KNIFE,
|
||||
{ARTWEAP_NULL, ARTWEAP_NULL, ARTWEAP_NULL}},
|
||||
|
||||
{"Cube", '*', c_white, STEEL, MNULL, 1, 3, 1, 20, ARTWEAP_BULK,
|
||||
{ARTWEAP_SPEAR, ARTWEAP_NULL, ARTWEAP_NULL}}
|
||||
};
|
||||
|
||||
artifact_weapon_datum artifact_weapon_data[NUM_ARTWEAPS] = {
|
||||
{"", 0, 0, 0, 0, 0, 0, 0, 0, ""},
|
||||
// Adjective Vol,wgt Bash Cut To-Hit
|
||||
{"Heavy", 0, 12, 10, 20, 0, 0, -2, 0,
|
||||
""},
|
||||
{"Knobbed", 1, 2, 14, 30, 0, 0, -1, 1,
|
||||
""},
|
||||
{"Spiked", 1, 1, 0, 0, 20, 40, -1, 1,
|
||||
"SPEAR"},
|
||||
{"Edged", 2, 4, 0, 0, 20, 50, -1, 2,
|
||||
""},
|
||||
{"Bladed", 1, 2, 0, 0, 12, 30, -1, 1,
|
||||
"STAB"}
|
||||
};
|
||||
|
||||
artifact_armor_form_datum artifact_armor_form_data[NUM_ARTARMFORMS] = {
|
||||
{"", c_white, MNULL, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
// Name color Materials Vol Wgt Enc Cov Thk Env Wrm Sto Bsh Cut Hit
|
||||
{"Robe", c_red, WOOL, MNULL, 6, 6, 1, 3, 3, 0, 2, 0, -8, 0, -3,
|
||||
mfb(bp_torso)|mfb(bp_legs), false,
|
||||
{ARMORMOD_LIGHT, ARMORMOD_BULKY, ARMORMOD_POCKETED, ARMORMOD_FURRED,
|
||||
ARMORMOD_PADDED}},
|
||||
|
||||
{"Coat", c_brown,LEATHER,MNULL, 14, 14, 2, 3, 2, 1, 4, 4, -6, 0, -3,
|
||||
mfb(bp_torso), false,
|
||||
{ARMORMOD_LIGHT, ARMORMOD_POCKETED, ARMORMOD_FURRED, ARMORMOD_PADDED,
|
||||
ARMORMOD_PLATED}},
|
||||
|
||||
{"Mask", c_white, WOOD, MNULL, 4, 1, 2, 2, 2, 1, 2, 0, 2, 0, -2,
|
||||
mfb(bp_eyes)|mfb(bp_mouth), false,
|
||||
{ARMORMOD_FURRED, ARMORMOD_FURRED, ARMORMOD_NULL, ARMORMOD_NULL,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
// Name color Materials Vol Wgt Enc Cov Thk Env Wrm Sto Bsh Cut Hit
|
||||
{"Helm", c_dkgray,SILVER, MNULL, 6, 6, 2, 3, 3, 0, 1, 0, 8, 0, -2,
|
||||
mfb(bp_head), false,
|
||||
{ARMORMOD_BULKY, ARMORMOD_FURRED, ARMORMOD_PADDED, ARMORMOD_PLATED,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
{"Gloves", c_ltblue,LEATHER,MNULL, 2, 1, 1, 3, 3, 1, 2, 0, -4, 0, -2,
|
||||
mfb(bp_hands), true,
|
||||
{ARMORMOD_BULKY, ARMORMOD_FURRED, ARMORMOD_PADDED, ARMORMOD_PLATED,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
// Name color Materials Vol Wgt Enc Cov Thk Env Wrm Sto Bsh Cut Hit
|
||||
{"Boots", c_blue, LEATHER, MNULL, 6, 2, 1, 3, 3, 1, 3, 0, 4, 0, -1,
|
||||
mfb(bp_feet), true,
|
||||
{ARMORMOD_LIGHT, ARMORMOD_BULKY, ARMORMOD_PADDED, ARMORMOD_PLATED,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
{"Ring", c_ltgreen, SILVER, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, true,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}}
|
||||
|
||||
};
|
||||
|
||||
artifact_armor_form_datum artifact_armor_mod_data[NUM_ARMORMODS] = {
|
||||
|
||||
{"", c_white, MNULL, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
// Description; "It is ..." or "They are ..."
|
||||
{"very thin and light.", c_white, MNULL, MNULL,
|
||||
// Vol Wgt Enc Cov Thk Env Wrm Sto
|
||||
-4, -8, -2, -1, -1, -1, -1, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"extremely bulky.", c_white, MNULL, MNULL,
|
||||
8, 10, 2, 1, 1, 0, 1, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"covered in pockets.", c_white, MNULL, MNULL,
|
||||
1, 1, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"disgustingly furry.", c_white, WOOL, MNULL,
|
||||
// Vol Wgt Enc Dmg Cut Env Wrm Sto
|
||||
4, 2, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"leather-padded.", c_white, LEATHER, MNULL,
|
||||
4, 4, 1, 1, 1, 0, 1, -3, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"plated in iron.", c_white, IRON, MNULL,
|
||||
4, 12, 3, 2, 2, 0, 1, -4, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
};
|
||||
|
||||
std::string artifact_adj[NUM_ART_ADJS] = {
|
||||
"Forbidden", "Unknown", "Forgotten", "Hideous", "Eldritch",
|
||||
"Gelatinous", "Ancient", "Cursed", "Bloody", "Undying",
|
||||
"Shadowy", "Silent", "Cyclopean", "Fungal", "Unspeakable",
|
||||
"Grotesque", "Frigid", "Shattered", "Sleeping", "Repellent"
|
||||
};
|
||||
|
||||
// Prepending + makes it proper, e.g. "The Forbidden Abyss"
|
||||
std::string artifact_noun[NUM_ART_NOUNS] = {
|
||||
"Technique", "Dreams", "Beasts", "Evil", "Miasma",
|
||||
"+Abyss", "+City", "Shadows", "Shade", "Illusion",
|
||||
"Justice", "+Necropolis", "Ichor", "+Monolith", "Aeons",
|
||||
"Graves", "Horrors", "Suffering", "Death", "Horror"
|
||||
};
|
||||
|
||||
std::string artifact_name(std::string type);
|
||||
|
||||
itype* game::new_artifact()
|
||||
@@ -31,7 +372,9 @@ itype* game::new_artifact()
|
||||
art->melee_dam = rng(weapon->bash_min, weapon->bash_max);
|
||||
art->melee_cut = rng(weapon->cut_min, weapon->cut_max);
|
||||
art->m_to_hit = rng(weapon->to_hit_min, weapon->to_hit_max);
|
||||
art->item_flags = weapon->flags;
|
||||
if( weapon->tag != "" ) {
|
||||
art->item_tags.insert(weapon->tag);
|
||||
}
|
||||
// Add an extra weapon perhaps?
|
||||
if (one_in(2)) {
|
||||
int select = rng(0, 2);
|
||||
@@ -42,7 +385,9 @@ itype* game::new_artifact()
|
||||
art->melee_dam += rng(weapon->bash_min, weapon->bash_max);
|
||||
art->melee_cut += rng(weapon->bash_min, weapon->bash_max);
|
||||
art->m_to_hit += rng(weapon->to_hit_min, weapon->to_hit_max);
|
||||
art->item_flags |= weapon->flags;
|
||||
if( weapon->tag != "" ) {
|
||||
art->item_tags.insert(weapon->tag);
|
||||
}
|
||||
std::stringstream newname;
|
||||
newname << weapon->adjective << " " << info->name;
|
||||
art->name = artifact_name(newname.str());
|
||||
@@ -141,7 +486,9 @@ 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[art->name]=art;
|
||||
|
||||
itypes[art->id]=art;
|
||||
artifact_itype_ids.push_back(art->id);
|
||||
return art;
|
||||
|
||||
} else { // Generate an armor artifact
|
||||
@@ -160,11 +507,10 @@ It may have unknown powers; use 'a' to activate them.";
|
||||
art->melee_dam = info->melee_bash;
|
||||
art->melee_cut = info->melee_cut;
|
||||
art->m_to_hit = info->melee_hit;
|
||||
art->item_flags = 0;
|
||||
art->covers = info->covers;
|
||||
art->encumber = info->encumb;
|
||||
art->dmg_resist = info->dmg_resist;
|
||||
art->cut_resist = info->cut_resist;
|
||||
art->coverage = info->coverage;
|
||||
art->thickness = info->thickness;
|
||||
art->env_resist = info->env_resist;
|
||||
art->warmth = info->warmth;
|
||||
art->storage = info->storage;
|
||||
@@ -191,15 +537,15 @@ It may have unknown powers; use 'a' to activate them.";
|
||||
|
||||
art->encumber += modinfo->encumb;
|
||||
|
||||
if (modinfo->dmg_resist > 0 || art->dmg_resist > abs(modinfo->dmg_resist))
|
||||
art->dmg_resist += modinfo->dmg_resist;
|
||||
if (modinfo->coverage > 0 || art->coverage > abs(modinfo->coverage))
|
||||
art->coverage += modinfo->coverage;
|
||||
else
|
||||
art->dmg_resist = 0;
|
||||
art->coverage = 0;
|
||||
|
||||
if (modinfo->cut_resist > 0 || art->cut_resist > abs(modinfo->cut_resist))
|
||||
art->cut_resist += modinfo->cut_resist;
|
||||
if (modinfo->thickness > 0 || art->thickness > abs(modinfo->thickness))
|
||||
art->thickness += modinfo->thickness;
|
||||
else
|
||||
art->cut_resist = 0;
|
||||
art->thickness = 0;
|
||||
|
||||
if (modinfo->env_resist > 0 || art->env_resist > abs(modinfo->env_resist))
|
||||
art->env_resist += modinfo->env_resist;
|
||||
@@ -245,7 +591,8 @@ It may have unknown powers; use 'a' to activate them.";
|
||||
}
|
||||
|
||||
art->id = itypes.size();
|
||||
itypes[art->name]=art;
|
||||
itypes[art->id]=art;
|
||||
artifact_itype_ids.push_back(art->id);
|
||||
return art;
|
||||
}
|
||||
}
|
||||
@@ -272,7 +619,6 @@ itype* game::new_natural_artifact(artifact_natural_property prop)
|
||||
art->melee_dam = 0;
|
||||
art->melee_cut = 0;
|
||||
art->m_to_hit = 0;
|
||||
art->item_flags = 0;
|
||||
|
||||
art->name = property_data->name + " " + shape_data->name;
|
||||
std::stringstream desc;
|
||||
@@ -359,7 +705,8 @@ itype* game::new_natural_artifact(artifact_natural_property prop)
|
||||
}
|
||||
|
||||
art->id = itypes.size();
|
||||
itypes[art->name]=art;
|
||||
artifact_itype_ids.push_back(art->id);
|
||||
itypes[art->id]=art;
|
||||
return art;
|
||||
}
|
||||
|
||||
@@ -426,23 +773,23 @@ void game::process_artifact(item *it, player *p, bool wielded)
|
||||
if (it->charges < tool->max_charges) {
|
||||
switch (tool->charge_type) {
|
||||
case ARTC_TIME:
|
||||
if (turn.second == 0 && turn.minute == 0) // Once per hour
|
||||
if (turn.seconds() == 0 && turn.minutes() == 0) // Once per hour
|
||||
it->charges++;
|
||||
break;
|
||||
case ARTC_SOLAR:
|
||||
if (turn.second == 0 && turn.minute % 10 == 0 &&
|
||||
if (turn.seconds() == 0 && turn.minutes() % 10 == 0 &&
|
||||
is_in_sunlight(p->posx, p->posy))
|
||||
it->charges++;
|
||||
break;
|
||||
case ARTC_PAIN:
|
||||
if (turn.second == 0) {
|
||||
if (turn.seconds() == 0) {
|
||||
add_msg("You suddenly feel sharp pain for no reason.");
|
||||
p->pain += 3 * rng(1, 3);
|
||||
it->charges++;
|
||||
}
|
||||
break;
|
||||
case ARTC_HP:
|
||||
if (turn.second == 0) {
|
||||
if (turn.seconds() == 0) {
|
||||
add_msg("You feel your body decaying.");
|
||||
p->hurtall(1);
|
||||
it->charges++;
|
||||
@@ -600,6 +947,10 @@ void game::add_artifact_messages(std::vector<art_effect_passive> effects)
|
||||
add_msg("You can see through walls!");
|
||||
break;
|
||||
|
||||
case AEP_SUPER_CLAIRVOYANCE:
|
||||
add_msg("You can see through everything!");
|
||||
break;
|
||||
|
||||
case AEP_STEALTH:
|
||||
add_msg("Your steps stop making noise.");
|
||||
break;
|
||||
|
||||
@@ -17,6 +17,7 @@ enum art_effect_passive {
|
||||
AEP_SNAKES, // Summons friendly snakes when you're hit
|
||||
AEP_INVISIBLE, // Makes you invisible
|
||||
AEP_CLAIRVOYANCE, // See through walls
|
||||
AEP_SUPER_CLAIRVOYANCE, // See through walls to a great distance
|
||||
AEP_STEALTH, // Your steps are quieted
|
||||
AEP_EXTINGUISH, // May extinguish nearby flames
|
||||
AEP_GLOW, // Four-tile light source
|
||||
|
||||
+15
-335
@@ -5,85 +5,10 @@
|
||||
#include "artifact.h"
|
||||
#include "itype.h"
|
||||
|
||||
int passive_effect_cost[NUM_AEPS] = {
|
||||
0, // AEP_NULL
|
||||
extern int passive_effect_cost[NUM_AEPS];
|
||||
|
||||
3, // AEP_STR_UP
|
||||
3, // AEP_DEX_UP
|
||||
3, // AEP_PER_UP
|
||||
3, // AEP_INT_UP
|
||||
5, // AEP_ALL_UP
|
||||
4, // AEP_SPEED_UP
|
||||
2, // AEP_IODINE
|
||||
4, // AEP_SNAKES
|
||||
7, // AEP_INVISIBLE
|
||||
5, // AEP_CLAIRVOYANCE
|
||||
2, // AEP_STEALTH
|
||||
2, // AEP_EXTINGUISH
|
||||
1, // AEP_GLOW
|
||||
1, // AEP_PSYSHIELD
|
||||
3, // AEP_RESIST_ELECTRICITY
|
||||
3, // AEP_CARRY_MORE
|
||||
5, // AEP_SAP_LIFE
|
||||
extern int active_effect_cost[NUM_AEAS];
|
||||
|
||||
0, // AEP_SPLIT
|
||||
|
||||
-2, // AEP_HUNGER
|
||||
-2, // AEP_THIRST
|
||||
-1, // AEP_SMOKE
|
||||
-5, // AEP_EVIL
|
||||
-3, // AEP_SCHIZO
|
||||
-5, // AEP_RADIOACTIVE
|
||||
-3, // AEP_MUTAGENIC
|
||||
-5, // AEP_ATTENTION
|
||||
-2, // AEP_STR_DOWN
|
||||
-2, // AEP_DEX_DOWN
|
||||
-2, // AEP_PER_DOWN
|
||||
-2, // AEP_INT_DOWN
|
||||
-5, // AEP_ALL_DOWN
|
||||
-4, // AEP_SPEED_DOWN
|
||||
-5, // AEP_FORCE_TELEPORT
|
||||
-3, // AEP_MOVEMENT_NOISE
|
||||
-2, // AEP_BAD_WEATHER
|
||||
-1 // AEP_SICK
|
||||
};
|
||||
|
||||
int active_effect_cost[NUM_AEAS] = {
|
||||
0, // AEA_NULL
|
||||
|
||||
2, // AEA_STORM
|
||||
4, // AEA_FIREBALL
|
||||
5, // AEA_ADRENALINE
|
||||
4, // AEA_MAP
|
||||
0, // AEA_BLOOD
|
||||
0, // AEA_FATIGUE
|
||||
4, // AEA_ACIDBALL
|
||||
5, // AEA_PULSE
|
||||
4, // AEA_HEAL
|
||||
3, // AEA_CONFUSED
|
||||
3, // AEA_ENTRANCE
|
||||
3, // AEA_BUGS
|
||||
5, // AEA_TELEPORT
|
||||
1, // AEA_LIGHT
|
||||
4, // AEA_GROWTH
|
||||
6, // AEA_HURTALL
|
||||
|
||||
0, // AEA_SPLIT
|
||||
|
||||
-3, // AEA_RADIATION
|
||||
-2, // AEA_PAIN
|
||||
-3, // AEA_MUTATE
|
||||
-2, // AEA_PARALYZE
|
||||
-3, // AEA_FIRESTORM
|
||||
-6, // AEA_ATTENTION
|
||||
-4, // AEA_TELEGLOW
|
||||
-2, // AEA_NOISE
|
||||
-2, // AEA_SCREAM
|
||||
-3, // AEA_DIM
|
||||
-4, // AEA_FLASH
|
||||
-2, // AEA_VOMIT
|
||||
-5 // AEA_SHADOWS
|
||||
};
|
||||
|
||||
struct artifact_shape_datum
|
||||
{
|
||||
@@ -93,26 +18,7 @@ struct artifact_shape_datum
|
||||
int weight_min, weight_max;
|
||||
};
|
||||
|
||||
artifact_shape_datum artifact_shape_data[ARTSHAPE_MAX] = {
|
||||
{"BUG", "BUG", 0, 0, 0, 0},
|
||||
{"sphere", "smooth sphere", 2, 4, 0, 10},
|
||||
{"rod", "tapered rod", 1, 7, 1, 7},
|
||||
{"teardrop", "teardrop-shaped stone", 2, 6, 0, 8},
|
||||
{"lamp", "hollow, transparent cube", 4, 9, 0, 3},
|
||||
{"snake", "winding, flexible rod", 0, 8, 0, 8},
|
||||
{"disc", "smooth disc", 4, 6, 2, 4},
|
||||
{"beads", "string of beads", 3, 7, 0, 6},
|
||||
{"napkin", "very thin sheet", 0, 3, 0, 3},
|
||||
{"urchin", "spiked sphere", 3, 5, 2, 6},
|
||||
{"jelly", "malleable blob", 2, 8, 2, 4},
|
||||
{"spiral", "spiraling rod", 5, 6, 2, 3},
|
||||
{"pin", "pointed rod", 1, 5, 1, 9},
|
||||
{"tube", "hollow tube", 2, 5, 3, 6},
|
||||
{"pyramid", "regular tetrahedron", 3, 7, 2, 4},
|
||||
{"crystal", "translucent crystal", 1, 6, 2, 7},
|
||||
{"knot", "twisted, knotted cord", 2, 6, 1, 7},
|
||||
{"crescent", "crescent-shaped stone", 2, 6, 2, 6}
|
||||
};
|
||||
extern artifact_shape_datum artifact_shape_data[ARTSHAPE_MAX];
|
||||
|
||||
struct artifact_property_datum
|
||||
{
|
||||
@@ -124,118 +30,7 @@ struct artifact_property_datum
|
||||
art_effect_active active_bad[4];
|
||||
};
|
||||
|
||||
artifact_property_datum artifact_property_data[ARTPROP_MAX] = {
|
||||
{"BUG", "BUG",
|
||||
{AEP_NULL, AEP_NULL, AEP_NULL, AEP_NULL},
|
||||
{AEP_NULL, AEP_NULL, AEP_NULL, AEP_NULL},
|
||||
{AEA_NULL, AEA_NULL, AEA_NULL, AEA_NULL},
|
||||
{AEA_NULL, AEA_NULL, AEA_NULL, AEA_NULL}
|
||||
},
|
||||
{"wriggling", "is constantly wriggling",
|
||||
{AEP_SPEED_UP, AEP_SNAKES, AEP_NULL, AEP_NULL},
|
||||
{AEP_DEX_DOWN, AEP_FORCE_TELEPORT, AEP_SICK, AEP_NULL},
|
||||
{AEA_TELEPORT, AEA_ADRENALINE, AEA_NULL, AEA_NULL},
|
||||
{AEA_MUTATE, AEA_ATTENTION, AEA_VOMIT, AEA_NULL}
|
||||
},
|
||||
{"glowing", "glows faintly",
|
||||
{AEP_INT_UP, AEP_GLOW, AEP_CLAIRVOYANCE, AEP_NULL},
|
||||
{AEP_RADIOACTIVE, AEP_MUTAGENIC, AEP_ATTENTION, AEP_NULL},
|
||||
{AEA_LIGHT, AEA_LIGHT, AEA_LIGHT, AEA_NULL},
|
||||
{AEA_ATTENTION, AEA_TELEGLOW, AEA_FLASH, AEA_SHADOWS}
|
||||
},
|
||||
{"humming", "hums very quietly",
|
||||
{AEP_ALL_UP, AEP_PSYSHIELD, AEP_NULL, AEP_NULL},
|
||||
{AEP_SCHIZO, AEP_PER_DOWN, AEP_INT_DOWN, AEP_NULL},
|
||||
{AEA_PULSE, AEA_ENTRANCE, AEA_NULL, AEA_NULL},
|
||||
{AEA_NOISE, AEA_NOISE, AEA_SCREAM, AEA_NULL}
|
||||
},
|
||||
{"moving", "shifts from side to side slowly",
|
||||
{AEP_STR_UP, AEP_DEX_UP, AEP_SPEED_UP, AEP_NULL},
|
||||
{AEP_HUNGER, AEP_PER_DOWN, AEP_FORCE_TELEPORT, AEP_NULL},
|
||||
{AEA_TELEPORT, AEA_TELEPORT, AEA_MAP, AEA_NULL},
|
||||
{AEA_PARALYZE, AEA_VOMIT, AEA_VOMIT, AEA_NULL}
|
||||
},
|
||||
{"whispering", "makes very faint whispering sounds",
|
||||
{AEP_CLAIRVOYANCE, AEP_EXTINGUISH, AEP_STEALTH, AEP_NULL},
|
||||
{AEP_EVIL, AEP_SCHIZO, AEP_ATTENTION, AEP_NULL},
|
||||
{AEA_FATIGUE, AEA_ENTRANCE, AEA_ENTRANCE, AEA_NULL},
|
||||
{AEA_ATTENTION, AEA_SCREAM, AEA_SCREAM, AEA_SHADOWS}
|
||||
},
|
||||
{"breathing",
|
||||
"shrinks and grows very slightly with a regular pulse, as if breathing",
|
||||
{AEP_SAP_LIFE, AEP_ALL_UP, AEP_SPEED_UP, AEP_CARRY_MORE},
|
||||
{AEP_HUNGER, AEP_THIRST, AEP_SICK, AEP_BAD_WEATHER},
|
||||
{AEA_ADRENALINE, AEA_HEAL, AEA_ENTRANCE, AEA_GROWTH},
|
||||
{AEA_MUTATE, AEA_ATTENTION, AEA_SHADOWS, AEA_NULL}
|
||||
},
|
||||
{"dead", "is icy cold to the touch",
|
||||
{AEP_INVISIBLE, AEP_CLAIRVOYANCE, AEP_EXTINGUISH, AEP_SAP_LIFE},
|
||||
{AEP_HUNGER, AEP_EVIL, AEP_ALL_DOWN, AEP_SICK},
|
||||
{AEA_BLOOD, AEA_HURTALL, AEA_NULL, AEA_NULL},
|
||||
{AEA_PAIN, AEA_SHADOWS, AEA_DIM, AEA_VOMIT}
|
||||
},
|
||||
{"itchy", "makes your skin itch slightly when it is close",
|
||||
{AEP_DEX_UP, AEP_SPEED_UP, AEP_PSYSHIELD, AEP_NULL},
|
||||
{AEP_RADIOACTIVE, AEP_MUTAGENIC, AEP_SICK, AEP_NULL},
|
||||
{AEA_ADRENALINE, AEA_BLOOD, AEA_HEAL, AEA_BUGS},
|
||||
{AEA_RADIATION, AEA_PAIN, AEA_PAIN, AEA_VOMIT}
|
||||
},
|
||||
{"glittering", "glitters faintly under direct light",
|
||||
{AEP_INT_UP, AEP_EXTINGUISH, AEP_GLOW, AEP_NULL},
|
||||
{AEP_SMOKE, AEP_ATTENTION, AEP_NULL, AEP_NULL},
|
||||
{AEA_MAP, AEA_LIGHT, AEA_CONFUSED, AEA_ENTRANCE},
|
||||
{AEA_RADIATION, AEA_MUTATE, AEA_ATTENTION, AEA_FLASH}
|
||||
},
|
||||
{"electric", "very weakly shocks you when touched",
|
||||
{AEP_RESIST_ELECTRICITY, AEP_DEX_UP, AEP_SPEED_UP, AEP_PSYSHIELD},
|
||||
{AEP_THIRST, AEP_SMOKE, AEP_STR_DOWN, AEP_BAD_WEATHER},
|
||||
{AEA_STORM, AEA_ADRENALINE, AEA_LIGHT, AEA_NULL},
|
||||
{AEA_PAIN, AEA_PARALYZE, AEA_FLASH, AEA_FLASH}
|
||||
},
|
||||
{"slimy", "feels slimy",
|
||||
{AEP_SNAKES, AEP_STEALTH, AEP_EXTINGUISH, AEP_SAP_LIFE},
|
||||
{AEP_THIRST, AEP_DEX_DOWN, AEP_SPEED_DOWN, AEP_SICK},
|
||||
{AEA_BLOOD, AEA_ACIDBALL, AEA_GROWTH, AEA_ACIDBALL},
|
||||
{AEA_MUTATE, AEA_MUTATE, AEA_VOMIT, AEA_VOMIT}
|
||||
},
|
||||
{"engraved", "is covered with odd etchings",
|
||||
{AEP_CLAIRVOYANCE, AEP_INVISIBLE, AEP_PSYSHIELD, AEP_SAP_LIFE},
|
||||
{AEP_EVIL, AEP_ATTENTION, AEP_NULL, AEP_NULL},
|
||||
{AEA_FATIGUE, AEA_TELEPORT, AEA_HEAL, AEA_FATIGUE},
|
||||
{AEA_ATTENTION, AEA_ATTENTION, AEA_TELEGLOW, AEA_DIM}
|
||||
},
|
||||
{"crackling", "occasionally makes a soft crackling sound",
|
||||
{AEP_EXTINGUISH, AEP_RESIST_ELECTRICITY, AEP_NULL, AEP_NULL},
|
||||
{AEP_SMOKE, AEP_RADIOACTIVE, AEP_MOVEMENT_NOISE, AEP_NULL},
|
||||
{AEA_STORM, AEA_FIREBALL, AEA_PULSE, AEA_NULL},
|
||||
{AEA_PAIN, AEA_PARALYZE, AEA_NOISE, AEA_NOISE}
|
||||
},
|
||||
{"warm", "is warm to the touch",
|
||||
{AEP_STR_UP, AEP_EXTINGUISH, AEP_GLOW, AEP_NULL},
|
||||
{AEP_SMOKE, AEP_RADIOACTIVE, AEP_NULL, AEP_NULL},
|
||||
{AEA_FIREBALL, AEA_FIREBALL, AEA_FIREBALL, AEA_LIGHT},
|
||||
{AEA_FIRESTORM, AEA_FIRESTORM, AEA_TELEGLOW, AEA_NULL}
|
||||
},
|
||||
{"rattling", "makes a rattling sound when moved",
|
||||
{AEP_DEX_UP, AEP_SPEED_UP, AEP_SNAKES, AEP_CARRY_MORE},
|
||||
{AEP_ATTENTION, AEP_INT_DOWN, AEP_MOVEMENT_NOISE, AEP_MOVEMENT_NOISE},
|
||||
{AEA_BLOOD, AEA_PULSE, AEA_BUGS, AEA_NULL},
|
||||
{AEA_PAIN, AEA_ATTENTION, AEA_NOISE, AEA_NULL}
|
||||
},
|
||||
{"scaled", "has a surface reminiscent of reptile scales",
|
||||
{AEP_SNAKES, AEP_SNAKES, AEP_SNAKES, AEP_STEALTH},
|
||||
{AEP_THIRST, AEP_MUTAGENIC, AEP_SPEED_DOWN, AEP_NULL},
|
||||
{AEA_ADRENALINE, AEA_BUGS, AEA_GROWTH, AEA_NULL},
|
||||
{AEA_MUTATE, AEA_SCREAM, AEA_DIM, AEA_NULL}
|
||||
},
|
||||
{"fractal",
|
||||
"has a self-similar pattern which repeats until it is too small for you to see",
|
||||
{AEP_ALL_UP, AEP_ALL_UP, AEP_CLAIRVOYANCE, AEP_PSYSHIELD},
|
||||
{AEP_SCHIZO, AEP_ATTENTION, AEP_FORCE_TELEPORT, AEP_BAD_WEATHER},
|
||||
{AEA_STORM, AEA_FATIGUE, AEA_TELEPORT, AEA_NULL},
|
||||
{AEA_RADIATION, AEA_MUTATE, AEA_TELEGLOW, AEA_TELEGLOW}
|
||||
}
|
||||
};
|
||||
extern artifact_property_datum artifact_property_data[ARTPROP_MAX];
|
||||
|
||||
enum artifact_weapon_type
|
||||
{
|
||||
@@ -283,25 +78,7 @@ enum artifact_tool_form
|
||||
NUM_ARTTOOLFORMS
|
||||
};
|
||||
|
||||
artifact_tool_form_datum artifact_tool_form_data[NUM_ARTTOOLFORMS] = {
|
||||
{"", '*', c_white, MNULL, MNULL, 0, 0, 0, 0, ARTWEAP_BULK,
|
||||
{ARTWEAP_NULL, ARTWEAP_NULL, ARTWEAP_NULL}},
|
||||
|
||||
{"Harp", ';', c_yellow, WOOD, MNULL, 20, 30, 10, 18, ARTWEAP_BULK,
|
||||
{ARTWEAP_SPEAR, ARTWEAP_SWORD, ARTWEAP_KNIFE}},
|
||||
|
||||
{"Staff", '/', c_brown, WOOD, MNULL, 6, 12, 4, 10, ARTWEAP_CLUB,
|
||||
{ARTWEAP_BULK, ARTWEAP_SPEAR, ARTWEAP_KNIFE}},
|
||||
|
||||
{"Sword", '/', c_ltblue, STEEL, MNULL, 8, 14, 8, 28, ARTWEAP_SWORD,
|
||||
{ARTWEAP_BULK, ARTWEAP_NULL, ARTWEAP_NULL}},
|
||||
|
||||
{"Dagger", ';', c_ltblue, STEEL, MNULL, 1, 4, 1, 6, ARTWEAP_KNIFE,
|
||||
{ARTWEAP_NULL, ARTWEAP_NULL, ARTWEAP_NULL}},
|
||||
|
||||
{"Cube", '*', c_white, STEEL, MNULL, 1, 3, 1, 20, ARTWEAP_BULK,
|
||||
{ARTWEAP_SPEAR, ARTWEAP_NULL, ARTWEAP_NULL}}
|
||||
};
|
||||
extern artifact_tool_form_datum artifact_tool_form_data[NUM_ARTTOOLFORMS];
|
||||
|
||||
struct artifact_weapon_datum
|
||||
{
|
||||
@@ -310,23 +87,10 @@ struct artifact_weapon_datum
|
||||
int bash_min, bash_max;
|
||||
int cut_min, cut_max;
|
||||
int to_hit_min, to_hit_max;
|
||||
unsigned flags : NUM_ITEM_FLAGS;
|
||||
std::string tag;
|
||||
};
|
||||
|
||||
artifact_weapon_datum artifact_weapon_data[NUM_ARTWEAPS] = {
|
||||
{"", 0, 0, 0, 0, 0, 0, 0, 0, 0},
|
||||
// Adjective Vol,wgt Bash Cut To-Hit
|
||||
{"Heavy", 0, 12, 10, 20, 0, 0, -2, 0,
|
||||
0},
|
||||
{"Knobbed", 1, 2, 14, 30, 0, 0, -1, 1,
|
||||
0},
|
||||
{"Spiked", 1, 1, 0, 0, 20, 40, -1, 1,
|
||||
mfb(IF_SPEAR)},
|
||||
{"Edged", 2, 4, 0, 0, 20, 50, -1, 2,
|
||||
0},
|
||||
{"Bladed", 1, 2, 0, 0, 12, 30, -1, 1,
|
||||
mfb(IF_STAB)}
|
||||
};
|
||||
extern artifact_weapon_datum artifact_weapon_data[NUM_ARTWEAPS];
|
||||
|
||||
enum artifact_armor_mod
|
||||
{
|
||||
@@ -348,8 +112,8 @@ struct artifact_armor_form_datum
|
||||
material m2;
|
||||
int volume, weight;
|
||||
int encumb;
|
||||
int dmg_resist;
|
||||
int cut_resist;
|
||||
int coverage;
|
||||
int thickness;
|
||||
int env_resist;
|
||||
int warmth;
|
||||
int storage;
|
||||
@@ -366,8 +130,8 @@ struct artifact_armor_form_datum
|
||||
int Warmth, int Storage, int Bash, int Cut, int Hit, unsigned char Covers,
|
||||
bool Plural, artifact_armor_mod Mods[5])
|
||||
: name (Name), color (Color), m1 (M1), m2 (M2), volume (Volume),
|
||||
weight (Weight), encumb (Encumb), dmg_resist (Dmg_res),
|
||||
cut_resist (Cut_res), env_resist (Env_res), warmth (Warmth),
|
||||
weight (Weight), encumb (Encumb), coverage (Coverage),
|
||||
thickness (thickness), env_resist (Env_res), warmth (Warmth),
|
||||
storage (Storage), melee_bash (Bash), melee_cut (Cut), melee_hit (Hit),
|
||||
covers (Covers), plural (Plural), available_mods (Mods) { };
|
||||
|
||||
@@ -387,102 +151,18 @@ enum artifact_armor_form
|
||||
NUM_ARTARMFORMS
|
||||
};
|
||||
|
||||
artifact_armor_form_datum artifact_armor_form_data[NUM_ARTARMFORMS] = {
|
||||
{"", c_white, MNULL, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
// Name color Materials Vol Wgt Enc Dmg Cut Env Wrm Sto Bsh Cut Hit
|
||||
{"Robe", c_red, WOOL, MNULL, 6, 6, 1, 3, 1, 0, 2, 0, -8, 0, -3,
|
||||
mfb(bp_torso)|mfb(bp_legs), false,
|
||||
{ARMORMOD_LIGHT, ARMORMOD_BULKY, ARMORMOD_POCKETED, ARMORMOD_FURRED,
|
||||
ARMORMOD_PADDED}},
|
||||
|
||||
{"Coat", c_brown,LEATHER,MNULL, 14, 14, 2, 4, 12, 1, 4, 4, -6, 0, -3,
|
||||
mfb(bp_torso), false,
|
||||
{ARMORMOD_LIGHT, ARMORMOD_POCKETED, ARMORMOD_FURRED, ARMORMOD_PADDED,
|
||||
ARMORMOD_PLATED}},
|
||||
|
||||
{"Mask", c_white, WOOD, MNULL, 4, 1, 2, 2, 16, 1, 2, 0, 2, 0, -2,
|
||||
mfb(bp_eyes)|mfb(bp_mouth), false,
|
||||
{ARMORMOD_FURRED, ARMORMOD_FURRED, ARMORMOD_NULL, ARMORMOD_NULL,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
// Name color Materials Vol Wgt Enc Dmg Cut Env Wrm Sto Bsh Cut Hit
|
||||
{"Helm", c_dkgray,SILVER, MNULL, 6, 6, 2, 4, 18, 0, 1, 0, 8, 0, -2,
|
||||
mfb(bp_head), false,
|
||||
{ARMORMOD_BULKY, ARMORMOD_FURRED, ARMORMOD_PADDED, ARMORMOD_PLATED,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
{"Gloves", c_ltblue,LEATHER,MNULL, 2, 1, 1, 6, 6, 1, 2, 0, -4, 0, -2,
|
||||
mfb(bp_hands), true,
|
||||
{ARMORMOD_BULKY, ARMORMOD_FURRED, ARMORMOD_PADDED, ARMORMOD_PLATED,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
// Name color Materials Vol Wgt Enc Dmg Cut Env Wrm Sto Bsh Cut Hit
|
||||
{"Boots", c_blue, LEATHER, MNULL, 6, 2, 1, 6, 6, 1, 3, 0, 4, 0, -1,
|
||||
mfb(bp_feet), true,
|
||||
{ARMORMOD_LIGHT, ARMORMOD_BULKY, ARMORMOD_PADDED, ARMORMOD_PLATED,
|
||||
ARMORMOD_NULL}},
|
||||
|
||||
{"Ring", c_ltgreen, SILVER, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
|
||||
0, true,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}}
|
||||
|
||||
};
|
||||
extern artifact_armor_form_datum artifact_armor_form_data[NUM_ARTARMFORMS];
|
||||
|
||||
/* Armor mods alter the normal values of armor.
|
||||
* If the basic armor type has MNULL as its second material, and the mod has a
|
||||
* material attached, the second material will be changed.
|
||||
*/
|
||||
artifact_armor_form_datum artifact_armor_mod_data[NUM_ARMORMODS] = {
|
||||
|
||||
{"", c_white, MNULL, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
// Description; "It is ..." or "They are ..."
|
||||
{"very thin and light.", c_white, MNULL, MNULL,
|
||||
// Vol Wgt Enc Dmg Cut Env Wrm Sto
|
||||
-4, -8, -2, -1, -1, -1, -1, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"extremely bulky.", c_white, MNULL, MNULL,
|
||||
8, 10, 2, 1, 1, 0, 1, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"covered in pockets.", c_white, MNULL, MNULL,
|
||||
1, 1, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"disgustingly furry.", c_white, WOOL, MNULL,
|
||||
// Vol Wgt Enc Dmg Cut Env Wrm Sto
|
||||
4, 2, 1, 4, 0, 1, 3, 0, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"leather-padded.", c_white, LEATHER, MNULL,
|
||||
4, 4, 1, 10, 4, 0, 1, -3, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
{"plated in iron.", c_white, IRON, MNULL,
|
||||
4, 12, 3, 8, 14, 0, 1, -4, 0, 0, 0, 0, false,
|
||||
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
|
||||
|
||||
};
|
||||
|
||||
extern artifact_armor_form_datum artifact_armor_mod_data[NUM_ARMORMODS];
|
||||
|
||||
#define NUM_ART_ADJS 20
|
||||
std::string artifact_adj[NUM_ART_ADJS] = {
|
||||
"Forbidden", "Unknown", "Forgotten", "Hideous", "Eldritch",
|
||||
"Gelatinous", "Ancient", "Cursed", "Bloody", "Undying",
|
||||
"Shadowy", "Silent", "Cyclopean", "Fungal", "Unspeakable",
|
||||
"Grotesque", "Frigid", "Shattered", "Sleeping", "Repellent"
|
||||
};
|
||||
extern std::string artifact_adj[NUM_ART_ADJS];
|
||||
|
||||
#define NUM_ART_NOUNS 20
|
||||
// Prepending + makes it proper, e.g. "The Forbidden Abyss"
|
||||
std::string artifact_noun[NUM_ART_NOUNS] = {
|
||||
"Technique", "Dreams", "Beasts", "Evil", "Miasma",
|
||||
"+Abyss", "+City", "Shadows", "Shade", "Illusion",
|
||||
"Justice", "+Necropolis", "Ichor", "+Monolith", "Aeons",
|
||||
"Graves", "Horrors", "Suffering", "Death", "Horror"
|
||||
};
|
||||
extern std::string artifact_noun[NUM_ART_NOUNS];
|
||||
|
||||
#endif
|
||||
|
||||
+245
-240
@@ -17,20 +17,45 @@ 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){
|
||||
int new_power_cost, int new_charge_time, std::string new_description, bool new_faulty){
|
||||
name = new_name;
|
||||
power_source = new_power_source;
|
||||
activated = new_activated;
|
||||
power_cost = new_power_cost;
|
||||
charge_time = new_charge_time;
|
||||
description = new_description;
|
||||
faulty = new_faulty;
|
||||
}
|
||||
|
||||
bionic_id game::random_good_bionic() const
|
||||
{
|
||||
std::map<std::string,bionic_data*>::const_iterator random_bionic;
|
||||
do
|
||||
{
|
||||
random_bionic = bionics.begin();
|
||||
std::advance(random_bionic,rng(0,bionics.size()-1));
|
||||
} while (random_bionic->first == "bio_null" || random_bionic->second->faulty);
|
||||
return random_bionic->first;
|
||||
}
|
||||
|
||||
// helper function for power_bionics
|
||||
void show_power_level_in_titlebar(WINDOW* window, player* p)
|
||||
{
|
||||
mvwprintz(window, 1, 62, c_white, "Power: %d/%d", p->power_level, p->max_power_level);
|
||||
}
|
||||
|
||||
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));
|
||||
int HEIGHT = TERMY;
|
||||
int WIDTH = 80;
|
||||
int START_X = (TERMX - WIDTH)/2;
|
||||
int START_Y = (TERMY - HEIGHT)/2;
|
||||
WINDOW* wBio = newwin(HEIGHT, WIDTH, START_Y, START_X);
|
||||
int DESCRIPTION_WIDTH = WIDTH - 2; // Same width as bionics window minus 2 for the borders
|
||||
int DESCRIPTION_HEIGHT = 3;
|
||||
int DESCRIPTION_START_X = getbegx(wBio) + 1; // +1 to avoid border
|
||||
int DESCRIPTION_START_Y = getmaxy(wBio) - DESCRIPTION_HEIGHT - 1; // At the bottom of the bio window, -1 to avoid border
|
||||
WINDOW* w_description = newwin(DESCRIPTION_HEIGHT, DESCRIPTION_WIDTH, DESCRIPTION_START_Y, DESCRIPTION_START_X);
|
||||
|
||||
werase(wBio);
|
||||
wborder(wBio, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
|
||||
@@ -38,19 +63,24 @@ void player::power_bionics(game *g)
|
||||
|
||||
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.");
|
||||
int HEADER_TEXT_Y = START_Y + 1;
|
||||
mvwprintz(wBio, HEADER_TEXT_Y, 1, c_blue, "BIONICS -");
|
||||
mvwprintz(wBio, HEADER_TEXT_Y, 11, c_white, "Activating. Press '!' to examine your implants.");
|
||||
show_power_level_in_titlebar(wBio, this);
|
||||
|
||||
int HEADER_LINE_Y = START_Y + 2;
|
||||
int DESCRIPTION_LINE_Y = DESCRIPTION_START_Y - 1;
|
||||
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, HEADER_LINE_Y, i, c_ltgray, LINE_OXOX); // Draw line under title
|
||||
mvwputch(wBio, DESCRIPTION_LINE_Y, i, c_ltgray, LINE_OXOX); // Draw line above description
|
||||
}
|
||||
|
||||
mvwputch(wBio, 2, 0, c_ltgray, LINE_XXXO); // |-
|
||||
mvwputch(wBio, 2, 79, c_ltgray, LINE_XOXX); // -|
|
||||
// Draw symbols to connect additional lines to border
|
||||
mvwputch(wBio, HEADER_LINE_Y, 0, c_ltgray, LINE_XXXO); // |-
|
||||
mvwputch(wBio, HEADER_LINE_Y, 79, c_ltgray, LINE_XOXX); // -|
|
||||
|
||||
mvwputch(wBio, 20, 0, c_ltgray, LINE_XXXO); // |-
|
||||
mvwputch(wBio, 20, 79, c_ltgray, LINE_XOXX); // -|
|
||||
mvwputch(wBio, DESCRIPTION_LINE_Y, 0, c_ltgray, LINE_XXXO); // |-
|
||||
mvwputch(wBio, DESCRIPTION_LINE_Y, 79, c_ltgray, LINE_XOXX); // -|
|
||||
|
||||
for (int i = 0; i < my_bionics.size(); i++) {
|
||||
if ( bionics[my_bionics[i].id]->power_source ||
|
||||
@@ -112,6 +142,7 @@ void player::power_bionics(game *g)
|
||||
if (ch == KEY_ESCAPE) {
|
||||
if (activating) {
|
||||
if (bionics[tmp->id]->activated) {
|
||||
show_power_level_in_titlebar(wBio, this);
|
||||
itype_id weapon_id = weapon.type->id;
|
||||
if (tmp->powered) {
|
||||
tmp->powered = false;
|
||||
@@ -496,9 +527,9 @@ bool player::install_bionics(game *g, it_bionic* type)
|
||||
|
||||
// Init the list of bionics
|
||||
for (int i = 1; i < type->options.size(); i++) {
|
||||
bionic_id id = type->options[i];
|
||||
mvwprintz(w, i + 3, 1, (has_bionic(id) ? c_ltred : c_ltblue),
|
||||
bionics[id]->name.c_str());
|
||||
bionic_id bio_id = type->options[i];
|
||||
mvwprintz(w, i + 3, 1, (has_bionic(bio_id) ? c_ltred : c_ltblue),
|
||||
bionics[bio_id]->name.c_str());
|
||||
}
|
||||
// Helper text
|
||||
mvwprintz(w, 3, 39, c_white, "Difficulty of this module: %d",
|
||||
@@ -533,27 +564,33 @@ bool player::install_bionics(game *g, it_bionic* type)
|
||||
mvwprintz(w, 13, 39, c_white, "or faulty installation.");
|
||||
wrefresh(w);
|
||||
|
||||
if (type->id == "bio_power_storage") { // No selection list; just confirm
|
||||
mvwprintz(w, 3, 1, h_ltblue, "Power Storage +%d", BATTERY_AMOUNT);
|
||||
if (type->id == "bio_power_storage" || type->id == "bio_power_storage_mkII") { // No selection list; just confirm
|
||||
int pow_up = BATTERY_AMOUNT;
|
||||
|
||||
if (type->id == "bio_power_storage_mkII") {
|
||||
pow_up = 10;
|
||||
}
|
||||
|
||||
mvwprintz(w, 3, 1, h_ltblue, "Power Storage +%d", pow_up);
|
||||
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);
|
||||
charge mechanism, which must be installed from another CBM.", pow_up);
|
||||
|
||||
InputEvent input;
|
||||
wrefresh(w_description);
|
||||
wrefresh(w);
|
||||
do
|
||||
input = get_input();
|
||||
while (input != Confirm && input != Close);
|
||||
while (input != Confirm && input != Cancel);
|
||||
if (input == Confirm) {
|
||||
practice("electronics", (100 - chance_of_success) * 1.5);
|
||||
practice("firstaid", (100 - chance_of_success) * 1.0);
|
||||
practice("mechanics", (100 - chance_of_success) * 0.5);
|
||||
practice(g->turn, "electronics", (100 - chance_of_success) * 1.5);
|
||||
practice(g->turn, "firstaid", (100 - chance_of_success) * 1.0);
|
||||
practice(g->turn, "mechanics", (100 - chance_of_success) * 0.5);
|
||||
int success = chance_of_success - rng(1, 100);
|
||||
if (success > 0) {
|
||||
g->add_msg("Successfully installed batteries.");
|
||||
max_power_level += BATTERY_AMOUNT;
|
||||
max_power_level += pow_up;
|
||||
} else
|
||||
bionics_install_failure(g, this, success);
|
||||
werase(w);
|
||||
@@ -572,14 +609,14 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
|
||||
|
||||
do {
|
||||
|
||||
bionic_id id = type->options[selection];
|
||||
mvwprintz(w, 3 + selection, 1, (has_bionic(id) ? h_ltred : h_ltblue),
|
||||
bionics[id]->name.c_str());
|
||||
bionic_id bio_id = type->options[selection];
|
||||
mvwprintz(w, 3 + selection, 1, (has_bionic(bio_id) ? h_ltred : h_ltblue),
|
||||
bionics[bio_id]->name.c_str());
|
||||
|
||||
// Clear the bottom three lines...
|
||||
werase(w_description);
|
||||
// ...and then fill them with the description of the selected bionic
|
||||
mvwprintz(w_description, 0, 0, c_ltblue, bionics[id]->description.c_str());
|
||||
mvwprintz(w_description, 0, 0, c_ltblue, bionics[bio_id]->description.c_str());
|
||||
|
||||
wrefresh(w_description);
|
||||
wrefresh(w);
|
||||
@@ -587,8 +624,8 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
|
||||
switch (input) {
|
||||
|
||||
case DirectionS:
|
||||
mvwprintz(w, 2 + selection, 0, (has_bionic(id) ? c_ltred : c_ltblue),
|
||||
bionics[id]->name.c_str());
|
||||
mvwprintz(w, 2 + selection, 0, (has_bionic(bio_id) ? c_ltred : c_ltblue),
|
||||
bionics[bio_id]->name.c_str());
|
||||
if (selection == type->options.size() - 1)
|
||||
selection = 0;
|
||||
else
|
||||
@@ -596,8 +633,8 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
|
||||
break;
|
||||
|
||||
case DirectionN:
|
||||
mvwprintz(w, 2 + selection, 0, (has_bionic(id) ? c_ltred : c_ltblue),
|
||||
bionics[id]->name.c_str());
|
||||
mvwprintz(w, 2 + selection, 0, (has_bionic(bio_id) ? c_ltred : c_ltblue),
|
||||
bionics[bio_id]->name.c_str());
|
||||
if (selection == 0)
|
||||
selection = type->options.size() - 1;
|
||||
else
|
||||
@@ -605,21 +642,21 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
|
||||
break;
|
||||
|
||||
}
|
||||
if (input == Confirm && has_bionic(id)) {
|
||||
popup("You already have a %s!", bionics[id]->name.c_str());
|
||||
if (input == Confirm && has_bionic(bio_id)) {
|
||||
popup("You already have a %s!", bionics[bio_id]->name.c_str());
|
||||
input = Nothing;
|
||||
}
|
||||
} while (input != Cancel && input != Confirm);
|
||||
|
||||
if (input == Confirm) {
|
||||
practice("electronics", (100 - chance_of_success) * 1.5);
|
||||
practice("firstaid", (100 - chance_of_success) * 1.0);
|
||||
practice("mechanics", (100 - chance_of_success) * 0.5);
|
||||
bionic_id id = type->options[selection];
|
||||
practice(g->turn, "electronics", (100 - chance_of_success) * 1.5);
|
||||
practice(g->turn, "firstaid", (100 - chance_of_success) * 1.0);
|
||||
practice(g->turn, "mechanics", (100 - chance_of_success) * 0.5);
|
||||
bionic_id bio_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());
|
||||
add_bionic(id);
|
||||
g->add_msg("Successfully installed %s.", bionics[bio_id]->name.c_str());
|
||||
add_bionic(bio_id);
|
||||
} else
|
||||
bionics_install_failure(g, this, success);
|
||||
werase(w);
|
||||
@@ -722,294 +759,262 @@ void bionics_install_failure(game *g, player *u, int success)
|
||||
|
||||
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.");
|
||||
If you're seeing this, it's a bug. (game::init_bionics)");
|
||||
// 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.");
|
||||
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.");
|
||||
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.");
|
||||
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_torsionratchet"] = new bionic_data("Joint Torsion Ratchet", true, false, 0, 0, "\
|
||||
Your joints have been equipped with torsion ratchets that generate power slowly\n\
|
||||
when you move.");
|
||||
power_source_bionics.push_back("bio_torsionratchet");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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");
|
||||
Your vision is greatly enhanced, giving you a +2 bonus to perception.");
|
||||
unpowered_bionics.push_back("bio_eye_enhancer");
|
||||
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");
|
||||
Your eyes have a thin membrane that closes over your eyes while underwater,\n\
|
||||
negating any vision penalties.");
|
||||
unpowered_bionics.push_back("bio_membrane");
|
||||
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");
|
||||
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_targeting");
|
||||
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");
|
||||
An oxygen interchange system automatically switches on while underwater,\n\
|
||||
slowly draining your energy reserves but providing oxygen.");
|
||||
unpowered_bionics.push_back("bio_gills");
|
||||
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");
|
||||
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_purifier");
|
||||
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");
|
||||
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_climate");
|
||||
|
||||
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");
|
||||
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_storage");
|
||||
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");
|
||||
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_recycler");
|
||||
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");
|
||||
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_digestion");
|
||||
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");
|
||||
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_tools");
|
||||
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");
|
||||
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_shock");
|
||||
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");
|
||||
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_heat_absorb");
|
||||
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");
|
||||
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.");
|
||||
unpowered_bionics.push_back("bio_carbon");
|
||||
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");
|
||||
The flesh on your head has been replaced by a strong armor, protecting both\n\
|
||||
your head and jaw regions.");
|
||||
unpowered_bionics.push_back("bio_armor_head");
|
||||
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");
|
||||
The flesh on your torso has been replaced by a strong armor, protecting you\n\
|
||||
greatly.");
|
||||
unpowered_bionics.push_back("bio_armor_torso");
|
||||
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");
|
||||
The flesh on your arms has been replaced by a strong armor, protecting you\n\
|
||||
greatly.");
|
||||
unpowered_bionics.push_back("bio_armor_arms");
|
||||
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");
|
||||
The flesh on your legs has been replaced by a strong armor, protecting you\n\
|
||||
greatly.");
|
||||
unpowered_bionics.push_back("bio_armor_legs");
|
||||
|
||||
bionics["bio_flashlight"] = new bionic_data("Cranial Flashlight", false, true, 1, 30, "\
|
||||
Mounted between your eyes is a small but powerful LED flashlight.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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 Dissipation", 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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
Nanotubes 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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
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.");
|
||||
bionics["bio_power_armor_interface"] = new bionic_data("Power Armor Interface", false, true, 1, 10, "\
|
||||
Interfaces your power system with the internal charging port on suits of power armor.");
|
||||
|
||||
//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.");
|
||||
A malfunctioning bionic which occasionally discharges electricity through\n\
|
||||
your body, causing pain and brief paralysis but no damage.",true);
|
||||
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.");
|
||||
A malfunctioning bionic which occasionally discharges acid into your muscles,\n\
|
||||
causing sharp pain and minor damage.",true);
|
||||
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.");
|
||||
A malfunctioning bionic. It doesn't perform any useful function, but will\n\
|
||||
occasionally draw power from your batteries.",true);
|
||||
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.");
|
||||
A malfunctioning bionic. It will occasionally emit a loud burst of noise.",true);
|
||||
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.");
|
||||
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.",true);
|
||||
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.");
|
||||
Improperly installed wires cause a physical stiffness in most of your body,\n\
|
||||
causing increased encumberance.",true);
|
||||
faulty_bionics.push_back("bio_stiff");
|
||||
}
|
||||
|
||||
|
||||
@@ -11,7 +11,7 @@ typedef std::string bionic_id;
|
||||
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);
|
||||
int new_power_cost, int new_charge_time, std::string new_description, bool new_faulty = false);
|
||||
|
||||
std::string name;
|
||||
bool power_source;
|
||||
@@ -21,6 +21,7 @@ public:
|
||||
int charge_time; // How long, when activated, between drawing power_cost
|
||||
// If 0, it draws power once
|
||||
std::string description;
|
||||
bool faulty; // Whether or not the bionic is faulty
|
||||
};
|
||||
|
||||
struct bionic {
|
||||
|
||||
@@ -0,0 +1,380 @@
|
||||
#include "building_generation.h"
|
||||
#include "output.h"
|
||||
#include "item_factory.h"
|
||||
|
||||
mapgendata::mapgendata(oter_id north, oter_id east, oter_id south, oter_id west)
|
||||
{
|
||||
t_nesw[0] = north;
|
||||
t_nesw[1] = east;
|
||||
t_nesw[2] = south;
|
||||
t_nesw[3] = west;
|
||||
n_fac = 0;
|
||||
e_fac = 0;
|
||||
s_fac = 0;
|
||||
w_fac = 0;
|
||||
}
|
||||
|
||||
void mapgendata::set_dir(int dir_in, int val)
|
||||
{
|
||||
switch (dir_in)
|
||||
{
|
||||
case 0:
|
||||
n_fac = val;
|
||||
break;
|
||||
case 1:
|
||||
e_fac = val;
|
||||
break;
|
||||
case 2:
|
||||
s_fac = val;
|
||||
break;
|
||||
case 3:
|
||||
w_fac = val;
|
||||
break;
|
||||
default:
|
||||
debugmsg("Invalid direction for mapgendata::set_dir. dir_in = %d", dir_in);
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
void mapgendata::fill(int val)
|
||||
{
|
||||
n_fac = val;
|
||||
e_fac = val;
|
||||
s_fac = val;
|
||||
w_fac = val;
|
||||
}
|
||||
|
||||
int& mapgendata::dir(int dir_in)
|
||||
{
|
||||
switch (dir_in)
|
||||
{
|
||||
case 0:
|
||||
return n_fac;
|
||||
break;
|
||||
case 1:
|
||||
return e_fac;
|
||||
break;
|
||||
case 2:
|
||||
return s_fac;
|
||||
break;
|
||||
case 3:
|
||||
return w_fac;
|
||||
break;
|
||||
default:
|
||||
debugmsg("Invalid direction for mapgendata::set_dir. dir_in = %d", dir_in);
|
||||
//return something just so the compiler doesn't freak out. Not really correct, though.
|
||||
return n_fac;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
ter_id grass_or_dirt()
|
||||
{
|
||||
if (one_in(4))
|
||||
return t_grass;
|
||||
return t_dirt;
|
||||
}
|
||||
|
||||
ter_id dirt_or_pile()
|
||||
{
|
||||
if (one_in(4))
|
||||
return t_dirtmound;
|
||||
return t_dirt;
|
||||
}
|
||||
|
||||
// helper functions below
|
||||
|
||||
void mapgen_null(map *m)
|
||||
{
|
||||
debugmsg("Generating terrain for ot_null, please report this as a bug");
|
||||
for (int i = 0; i < SEEX * 2; i++)
|
||||
{
|
||||
for (int j = 0; j < SEEY * 2; j++)
|
||||
{
|
||||
m->ter_set(i, j, t_null);
|
||||
m->radiation(i, j) = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void mapgen_crater(map *m, mapgendata dat)
|
||||
{
|
||||
for(int i = 0; i < 4; i++)
|
||||
{
|
||||
if(dat.t_nesw[i] != ot_crater)
|
||||
{
|
||||
dat.set_dir(i, 6);
|
||||
}
|
||||
}
|
||||
|
||||
for (int i = 0; i < SEEX * 2; i++)
|
||||
{
|
||||
for (int j = 0; j < SEEY * 2; j++)
|
||||
{
|
||||
if (rng(0, dat.w_fac) <= i && rng(0, dat.e_fac) <= SEEX * 2 - 1 - i &&
|
||||
rng(0, dat.n_fac) <= j && rng(0, dat.s_fac) <= SEEX * 2 - 1 - j )
|
||||
{
|
||||
m->ter_set(i, j, t_rubble);
|
||||
m->radiation(i, j) = rng(0, 4) * rng(0, 2);
|
||||
}
|
||||
else
|
||||
{
|
||||
m->ter_set(i, j, t_dirt);
|
||||
m->radiation(i, j) = rng(0, 2) * rng(0, 2) * rng(0, 2);
|
||||
}
|
||||
}
|
||||
}
|
||||
m->place_items(mi_wreckage, 83, 0, 0, SEEX * 2 - 1, SEEY * 2 - 1, true, 0);
|
||||
}
|
||||
|
||||
void mapgen_field(map *m, int turn)
|
||||
{
|
||||
for (int i = 0; i < SEEX * 2; i++)
|
||||
{
|
||||
for (int j = 0; j < SEEY * 2; j++)
|
||||
{
|
||||
m->ter_set(i, j, grass_or_dirt());
|
||||
//------Jovan's-----
|
||||
if (one_in(120))
|
||||
{
|
||||
if (one_in(30))
|
||||
{
|
||||
m->ter_set(i, j, t_shrub_blueberry);
|
||||
}
|
||||
else
|
||||
{
|
||||
m->ter_set(i, j, t_shrub);
|
||||
}
|
||||
}
|
||||
else
|
||||
if (one_in(1000)) { m->ter_set(i,j, t_mutpoppy); }
|
||||
//------------------
|
||||
}
|
||||
}
|
||||
m->place_items(mi_field, 60, 0, 0, SEEX * 2 - 1, SEEY * 2 - 1, true, turn);
|
||||
}
|
||||
|
||||
void mapgen_dirtlot(map *m, game *g)
|
||||
{
|
||||
for (int i = 0; i < SEEX * 2; i++)
|
||||
{
|
||||
for (int j = 0; j < SEEY * 2; j++)
|
||||
{
|
||||
m->ter_set(i, j, t_dirt);
|
||||
if (one_in(120))
|
||||
{
|
||||
m->ter_set(i, j, t_pit_shallow);
|
||||
}
|
||||
else if (one_in(50))
|
||||
{
|
||||
m->ter_set(i,j, t_grass);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (one_in(4))
|
||||
{
|
||||
m->add_vehicle (g, veh_truck, 12, 12, 90, -1, -1);
|
||||
}
|
||||
}
|
||||
|
||||
void mapgen_forest_general(map *m, oter_id terrain_type, mapgendata dat, int turn)
|
||||
{
|
||||
switch (terrain_type)
|
||||
{
|
||||
case ot_forest_thick:
|
||||
dat.fill(8);
|
||||
break;
|
||||
case ot_forest_water:
|
||||
dat.fill(4);
|
||||
break;
|
||||
case ot_forest:
|
||||
dat.fill(0);
|
||||
break;
|
||||
}
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (dat.t_nesw[i] == ot_forest || dat.t_nesw[i] == ot_forest_water)
|
||||
{
|
||||
dat.dir(i) += 14;
|
||||
}
|
||||
else if (dat.t_nesw[i] == ot_forest_thick)
|
||||
{
|
||||
dat.dir(i) += 18;
|
||||
}
|
||||
}
|
||||
for (int i = 0; i < SEEX * 2; i++)
|
||||
{
|
||||
for (int j = 0; j < SEEY * 2; j++)
|
||||
{
|
||||
int forest_chance = 0, num = 0;
|
||||
if (j < dat.n_fac)
|
||||
{
|
||||
forest_chance += dat.n_fac - j;
|
||||
num++;
|
||||
}
|
||||
if (SEEX * 2 - 1 - i < dat.e_fac)
|
||||
{
|
||||
forest_chance += dat.e_fac - (SEEX * 2 - 1 - i);
|
||||
num++;
|
||||
}
|
||||
if (SEEY * 2 - 1 - j < dat.s_fac)
|
||||
{
|
||||
forest_chance += dat.s_fac - (SEEY * 2 - 1 - j);
|
||||
num++;
|
||||
}
|
||||
if (i < dat.w_fac)
|
||||
{
|
||||
forest_chance += dat.w_fac - i;
|
||||
num++;
|
||||
}
|
||||
if (num > 0)
|
||||
{
|
||||
forest_chance /= num;
|
||||
}
|
||||
int rn = rng(0, forest_chance);
|
||||
if ((forest_chance > 0 && rn > 13) || one_in(100 - forest_chance))
|
||||
{
|
||||
if (one_in(250))
|
||||
{
|
||||
m->ter_set(i, j, t_tree_apple);
|
||||
m->spawn_item(i, j, item_controller->find_template("apple"), turn);
|
||||
}
|
||||
else
|
||||
{
|
||||
m->ter_set(i, j, t_tree);
|
||||
}
|
||||
}
|
||||
else if ((forest_chance > 0 && rn > 10) || one_in(100 - forest_chance))
|
||||
{
|
||||
m->ter_set(i, j, t_tree_young);
|
||||
}
|
||||
else if ((forest_chance > 0 && rn > 9) || one_in(100 - forest_chance))
|
||||
{
|
||||
if (one_in(250))
|
||||
{
|
||||
m->ter_set(i, j, t_shrub_blueberry);
|
||||
}
|
||||
else
|
||||
{
|
||||
m->ter_set(i, j, t_underbrush);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
m->ter_set(i, j, t_dirt);
|
||||
}
|
||||
}
|
||||
}
|
||||
m->place_items(mi_forest, 60, 0, 0, SEEX * 2 - 1, SEEY * 2 - 1, true, turn);
|
||||
|
||||
if (terrain_type == ot_forest_water)
|
||||
{
|
||||
// Reset *_fac to handle where to place water
|
||||
for (int i = 0; i < 4; i++)
|
||||
{
|
||||
if (dat.t_nesw[i] == ot_forest_water)
|
||||
{
|
||||
dat.set_dir(i, 2);
|
||||
}
|
||||
else if (dat.t_nesw[i] >= ot_river_center && dat.t_nesw[i] <= ot_river_nw)
|
||||
{
|
||||
dat.set_dir(i, 3);
|
||||
}
|
||||
else if (dat.t_nesw[i] == ot_forest || dat.t_nesw[i] == ot_forest_thick)
|
||||
{
|
||||
dat.set_dir(i, 1);
|
||||
}
|
||||
else
|
||||
{
|
||||
dat.set_dir(i, 0);
|
||||
}
|
||||
}
|
||||
int x = SEEX / 2 + rng(0, SEEX), y = SEEY / 2 + rng(0, SEEY);
|
||||
for (int i = 0; i < 20; i++)
|
||||
{
|
||||
if (x >= 0 && x < SEEX * 2 && y >= 0 && y < SEEY * 2)
|
||||
{
|
||||
if (m->ter(x, y) == t_water_sh)
|
||||
{
|
||||
m->ter_set(x, y, t_water_dp);
|
||||
}
|
||||
else if (m->ter(x, y) == t_dirt || m->ter(x, y) == t_underbrush)
|
||||
{
|
||||
m->ter_set(x, y, t_water_sh);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
i = 20;
|
||||
}
|
||||
x += rng(-2, 2);
|
||||
y += rng(-2, 2);
|
||||
if (x < 0 || x >= SEEX * 2)
|
||||
{
|
||||
x = SEEX / 2 + rng(0, SEEX);
|
||||
}
|
||||
if (y < 0 || y >= SEEY * 2)
|
||||
{
|
||||
y = SEEY / 2 + rng(0, SEEY);
|
||||
}
|
||||
for (int j = 0; j < dat.n_fac; j++)
|
||||
{
|
||||
int wx = rng(0, SEEX * 2 -1), wy = rng(0, SEEY - 1);
|
||||
if (m->ter(wx, wy) == t_dirt || m->ter(wx, wy) == t_underbrush)
|
||||
{
|
||||
m->ter_set(wx, wy, t_water_sh);
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < dat.e_fac; j++)
|
||||
{
|
||||
int wx = rng(SEEX, SEEX * 2 - 1), wy = rng(0, SEEY * 2 - 1);
|
||||
if (m->ter(wx, wy) == t_dirt || m->ter(wx, wy) == t_underbrush)
|
||||
{
|
||||
m->ter_set(wx, wy, t_water_sh);
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < dat.s_fac; j++)
|
||||
{
|
||||
int wx = rng(0, SEEX * 2 - 1), wy = rng(SEEY, SEEY * 2 - 1);
|
||||
if (m->ter(wx, wy) == t_dirt || m->ter(wx, wy) == t_underbrush)
|
||||
{
|
||||
m->ter_set(wx, wy, t_water_sh);
|
||||
}
|
||||
}
|
||||
for (int j = 0; j < dat.w_fac; j++)
|
||||
{
|
||||
int wx = rng(0, SEEX - 1), wy = rng(0, SEEY * 2 - 1);
|
||||
if (m->ter(wx, wy) == t_dirt || m->ter(wx, wy) == t_underbrush)
|
||||
{
|
||||
m->ter_set(wx, wy, t_water_sh);
|
||||
}
|
||||
}
|
||||
}
|
||||
int rn = rng(0, 2) * rng(0, 1) * (rng(0, 1) + rng(0, 1));// Good chance of 0
|
||||
for (int i = 0; i < rn; i++)
|
||||
{
|
||||
x = rng(0, SEEX * 2 - 1);
|
||||
y = rng(0, SEEY * 2 - 1);
|
||||
m->add_trap(x, y, tr_sinkhole);
|
||||
if (m->ter(x, y) != t_water_sh)
|
||||
{
|
||||
m->ter_set(x, y, t_dirt);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (one_in(100)) // One in 100 forests has a spider living in it :o
|
||||
{
|
||||
for (int i = 0; i < SEEX * 2; i++)
|
||||
{
|
||||
for (int j = 0; j < SEEX * 2; j++)
|
||||
{
|
||||
if ((m->ter(i, j) == t_dirt || m->ter(i, j) == t_underbrush) && !one_in(3))
|
||||
{
|
||||
m->add_field(NULL, i, j, fd_web, rng(1, 3));
|
||||
}
|
||||
}
|
||||
}
|
||||
m->add_spawn(mon_spider_web, rng(1, 2), SEEX, SEEY);
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,32 @@
|
||||
#ifndef _BUILDING_GENERATION_H_
|
||||
#define _BUILDING_GENERATION_H_
|
||||
|
||||
#include "omdata.h"
|
||||
#include "map.h"
|
||||
|
||||
struct mapgendata
|
||||
{
|
||||
public:
|
||||
oter_id t_nesw[4];
|
||||
int n_fac; // dir == 0
|
||||
int e_fac; // dir == 1
|
||||
int s_fac; // dir == 2
|
||||
int w_fac; // dir == 3
|
||||
|
||||
mapgendata(oter_id north, oter_id east, oter_id south, oter_id west);
|
||||
void set_dir(int dir_in, int val);
|
||||
void fill(int val);
|
||||
int& dir(int dir_in);
|
||||
};
|
||||
|
||||
ter_id grass_or_dirt();
|
||||
ter_id dirt_or_pile();
|
||||
|
||||
// helper functions for mapgen.cpp, so that we can avoid having a massive switch statement (sorta)
|
||||
void mapgen_null(map *m);
|
||||
void mapgen_crater(map *m, mapgendata dat);
|
||||
void mapgen_field(map *m, int turn);
|
||||
void mapgen_dirtlot(map *m, game *g);
|
||||
void mapgen_forest_general(map *m, oter_id terrain_type, mapgendata dat, int turn);
|
||||
|
||||
#endif
|
||||
+150
-65
@@ -35,26 +35,26 @@ calendar::calendar(int Minute, int Hour, int Day, season_type Season, int Year)
|
||||
|
||||
calendar::calendar(int turn)
|
||||
{
|
||||
int minutes = int(turn / 10);
|
||||
int hours = minutes / 60;
|
||||
int days = hours / 24;
|
||||
int seasons = days / DAYS_IN_SEASON;
|
||||
int minute_param = int(turn / 10);
|
||||
int hour_param = minute_param / 60;
|
||||
int day_param = hour_param / 24;
|
||||
int season_param = day_param / OPTIONS[OPT_SEASON_LENGTH];
|
||||
second = 6 * (turn % 10);
|
||||
minute = minutes % 60;
|
||||
hour = hours % 24;
|
||||
day = 1 + days % DAYS_IN_SEASON;
|
||||
season = season_type(seasons % 4);
|
||||
year = seasons / 4;
|
||||
minute = minute_param % 60;
|
||||
hour = hour_param % 24;
|
||||
day = 1 + day_param % (int)OPTIONS[OPT_SEASON_LENGTH];
|
||||
season = season_type(season_param % 4);
|
||||
year = season_param / 4;
|
||||
}
|
||||
|
||||
int calendar::get_turn()
|
||||
int calendar::get_turn() const
|
||||
{
|
||||
int ret = second / 6;
|
||||
ret += minute * 10;
|
||||
ret += hour * 600;
|
||||
ret += day * 14400;
|
||||
ret += int(season) * 14400 * DAYS_IN_SEASON;
|
||||
ret += year * 14400 * 4 * DAYS_IN_SEASON;
|
||||
ret += int(season) * 14400 * (int)OPTIONS[OPT_SEASON_LENGTH];
|
||||
ret += year * 14400 * 4 * (int)OPTIONS[OPT_SEASON_LENGTH];
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -64,8 +64,8 @@ calendar::operator int() const
|
||||
ret += minute * 10;
|
||||
ret += hour * 600;
|
||||
ret += day * 14400;
|
||||
ret += int(season) * 14400 * DAYS_IN_SEASON;
|
||||
ret += year * 14400 * 4 * DAYS_IN_SEASON;
|
||||
ret += int(season) * 14400 * (int)OPTIONS[OPT_SEASON_LENGTH];
|
||||
ret += year * 14400 * 4 * (int)OPTIONS[OPT_SEASON_LENGTH];
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -86,16 +86,16 @@ calendar& calendar::operator =(calendar &rhs)
|
||||
|
||||
calendar& calendar::operator =(int rhs)
|
||||
{
|
||||
int minutes = int(rhs / 10);
|
||||
int hours = minutes / 60;
|
||||
int days = hours / 24;
|
||||
int seasons = days / DAYS_IN_SEASON;
|
||||
int minute_param = int(rhs / 10);
|
||||
int hour_param = minute_param / 60;
|
||||
int day_param = hour_param / 24;
|
||||
int season_param = day_param / OPTIONS[OPT_SEASON_LENGTH];
|
||||
second = 6 * (rhs % 10);
|
||||
minute = minutes % 60;
|
||||
hour = hours % 24;
|
||||
day = days % DAYS_IN_SEASON;
|
||||
season = season_type(seasons % 4);
|
||||
year = seasons / 4;
|
||||
minute = minute_param % 60;
|
||||
hour = hour_param % 24;
|
||||
day = day_param % (int)OPTIONS[OPT_SEASON_LENGTH];
|
||||
season = season_type(season_param % 4);
|
||||
year = season_param / 4;
|
||||
return *this;
|
||||
}
|
||||
|
||||
@@ -149,11 +149,11 @@ calendar& calendar::operator +=(int rhs)
|
||||
return *this;
|
||||
}
|
||||
|
||||
bool calendar::operator ==(int rhs)
|
||||
bool calendar::operator ==(int rhs) const
|
||||
{
|
||||
return int(*this) == rhs;
|
||||
}
|
||||
bool calendar::operator ==(calendar &rhs)
|
||||
bool calendar::operator ==(calendar &rhs) const
|
||||
{
|
||||
return (second == rhs.second &&
|
||||
minute == rhs.minute &&
|
||||
@@ -213,9 +213,9 @@ void calendar::standardize()
|
||||
hour %= 24;
|
||||
}
|
||||
int tmpseason = int(season);
|
||||
if (day >= DAYS_IN_SEASON) {
|
||||
tmpseason += day / DAYS_IN_SEASON;
|
||||
day %= DAYS_IN_SEASON;
|
||||
if (day >= OPTIONS[OPT_SEASON_LENGTH]) {
|
||||
tmpseason += day / OPTIONS[OPT_SEASON_LENGTH];
|
||||
day %= (int)OPTIONS[OPT_SEASON_LENGTH];
|
||||
}
|
||||
if (tmpseason >= 4) {
|
||||
year += tmpseason / 4;
|
||||
@@ -233,7 +233,7 @@ int calendar::minutes_past_midnight() const
|
||||
|
||||
moon_phase calendar::moon() const
|
||||
{
|
||||
int phase = day / (DAYS_IN_SEASON / 4);
|
||||
int phase = day / (OPTIONS[OPT_SEASON_LENGTH] / 4);
|
||||
//phase %= 4; Redundant?
|
||||
if (phase == 3)
|
||||
return MOON_HALF;
|
||||
@@ -263,7 +263,7 @@ calendar calendar::sunrise() const
|
||||
end_hour = SUNRISE_SOLSTICE;
|
||||
break;
|
||||
}
|
||||
double percent = double(double(day) / DAYS_IN_SEASON);
|
||||
double percent = double(double(day) / OPTIONS[OPT_SEASON_LENGTH]);
|
||||
double time = double(start_hour) * (1.- percent) + double(end_hour) * percent;
|
||||
|
||||
ret.hour = int(time);
|
||||
@@ -295,7 +295,7 @@ calendar calendar::sunset() const
|
||||
end_hour = SUNSET_SOLSTICE;
|
||||
break;
|
||||
}
|
||||
double percent = double(double(day) / DAYS_IN_SEASON);
|
||||
double percent = double(double(day) / OPTIONS[OPT_SEASON_LENGTH]);
|
||||
double time = double(start_hour) * (1.- percent) + double(end_hour) * percent;
|
||||
|
||||
ret.hour = int(time);
|
||||
@@ -346,41 +346,58 @@ int calendar::sunlight() const
|
||||
return DAYLIGHT_LEVEL;
|
||||
}
|
||||
|
||||
std::string calendar::print_time(bool twentyfour)
|
||||
{
|
||||
std::stringstream ret;
|
||||
if (twentyfour) {
|
||||
ret << hour << ":";
|
||||
if (minute < 10)
|
||||
ret << "0";
|
||||
ret << minute;
|
||||
} else {
|
||||
if (OPTIONS[OPT_24_HOUR] == 1) {
|
||||
int hours = hour % 24;
|
||||
if (hours < 10)
|
||||
ret << "0";
|
||||
ret << hours;
|
||||
} else if (OPTIONS[OPT_24_HOUR] == 2) {
|
||||
int hours = hour % 24;
|
||||
ret << hours << ":";
|
||||
}else {
|
||||
int hours = hour % 12;
|
||||
if (hours == 0)
|
||||
hours = 12;
|
||||
ret << hours << ":";
|
||||
}
|
||||
if (minute < 10)
|
||||
ret << "0";
|
||||
ret << minute;
|
||||
if (OPTIONS[OPT_24_HOUR] == 0) {
|
||||
if (hour < 12)
|
||||
ret << " AM";
|
||||
else
|
||||
ret << " PM";
|
||||
}
|
||||
}
|
||||
|
||||
return ret.str();
|
||||
|
||||
std::string calendar::print_time(bool just_hour) const
|
||||
{
|
||||
std::stringstream time_string;
|
||||
|
||||
if (OPTIONS[OPT_24_HOUR] == 1)
|
||||
{
|
||||
int hour_param = hour % 24;
|
||||
if (hour_param < 10)
|
||||
{
|
||||
time_string << "0";
|
||||
}
|
||||
time_string << hour_param;
|
||||
}
|
||||
else if (OPTIONS[OPT_24_HOUR] == 2)
|
||||
{
|
||||
int hour_param = hour % 24;
|
||||
time_string << hour_param;
|
||||
if (!just_hour) time_string << ":";
|
||||
}
|
||||
else
|
||||
{
|
||||
int hour_param = hour % 12;
|
||||
if (hour_param == 0)
|
||||
{
|
||||
hour_param = 12;
|
||||
}
|
||||
time_string << hour_param;
|
||||
if (!just_hour) time_string << ":";
|
||||
}
|
||||
if(!just_hour)
|
||||
{
|
||||
if (minute < 10)
|
||||
{
|
||||
time_string << "0";
|
||||
}
|
||||
time_string << minute;
|
||||
}
|
||||
if (OPTIONS[OPT_24_HOUR] == 0)
|
||||
{
|
||||
if (hour < 12)
|
||||
{
|
||||
time_string << " AM";
|
||||
}
|
||||
else
|
||||
{
|
||||
time_string << " PM";
|
||||
}
|
||||
}
|
||||
|
||||
return time_string.str();
|
||||
}
|
||||
|
||||
std::string calendar::textify_period()
|
||||
@@ -414,3 +431,71 @@ std::string calendar::textify_period()
|
||||
|
||||
return ret.str();
|
||||
}
|
||||
|
||||
std::string calendar::day_of_week() const
|
||||
{
|
||||
// Design rationale
|
||||
// <kevingranade> here's a question
|
||||
// <kevingranade> what day of the week is day 0?
|
||||
// <wito> Sunday
|
||||
// <GlyphGryph> Why does it matter?
|
||||
// <GlyphGryph> For like where people are and stuff?
|
||||
// <wito> 7 is also Sunday
|
||||
// <kevingranade> NOAA weather forecasts include day of week
|
||||
// <GlyphGryph> Also by day0 do you mean the day people start day 0
|
||||
// <GlyphGryph> Or actual day 0
|
||||
// <kevingranade> good point, turn 0
|
||||
// <GlyphGryph> So day 5
|
||||
// <wito> Oh, I thought we were talking about week day numbering in general.
|
||||
// <wito> Day 5 is a thursday, I think.
|
||||
// <wito> Nah, Day 5 feels like a thursday. :P
|
||||
// <wito> Which would put the apocalpyse on a saturday?
|
||||
// <Starfyre> must be a thursday. I was never able to get the hang of those.
|
||||
// <ZChris13> wito: seems about right to me
|
||||
// <wito> kevingranade: add four for thursday. ;)
|
||||
// <kevingranade> sounds like consensus to me
|
||||
// <kevingranade> Thursday it is
|
||||
|
||||
enum weekday
|
||||
{
|
||||
THURSDAY = 0,
|
||||
FRIDAY = 1,
|
||||
SATURDAY = 2,
|
||||
SUNDAY = 3,
|
||||
MONDAY = 4,
|
||||
TUESDAY = 5,
|
||||
WEDNESDAY = 6
|
||||
};
|
||||
|
||||
// calendar::day gets mangled by season transitions, so reclaculate days since start.
|
||||
int current_day = day % 7;
|
||||
|
||||
std::string day_string;
|
||||
|
||||
switch (current_day)
|
||||
{
|
||||
case SUNDAY:
|
||||
day_string = "Sunday";
|
||||
break;
|
||||
case MONDAY:
|
||||
day_string = "Monday";
|
||||
break;
|
||||
case TUESDAY:
|
||||
day_string = "Tuesday";
|
||||
break;
|
||||
case WEDNESDAY:
|
||||
day_string = "Wendsday";
|
||||
break;
|
||||
case THURSDAY:
|
||||
day_string = "Thursday";
|
||||
break;
|
||||
case FRIDAY:
|
||||
day_string = "Friday";
|
||||
break;
|
||||
case SATURDAY:
|
||||
day_string = "Saturday";
|
||||
break;
|
||||
}
|
||||
|
||||
return day_string;
|
||||
}
|
||||
|
||||
+30
-11
@@ -1,10 +1,7 @@
|
||||
#include <string>
|
||||
#include "weather.h"
|
||||
#ifndef _CALENDAR_H_
|
||||
#define _CALENDAR_H_
|
||||
|
||||
// How many minutes exist when the game starts - 8:00 AM
|
||||
#define STARTING_MINUTES 480
|
||||
// The number of days in a season - this also defines moon cycles
|
||||
#define DAYS_IN_SEASON 14
|
||||
#include <string>
|
||||
|
||||
// Convert minutes, hours, days to turns
|
||||
#define MINUTES(x) ((x) * 10)
|
||||
@@ -28,6 +25,14 @@
|
||||
// How much light is provided in full daylight
|
||||
#define DAYLIGHT_LEVEL 60
|
||||
|
||||
enum season_type {
|
||||
SPRING = 0,
|
||||
SUMMER = 1,
|
||||
AUTUMN = 2,
|
||||
WINTER = 3
|
||||
#define FALL AUTUMN
|
||||
};
|
||||
|
||||
enum moon_phase {
|
||||
MOON_NEW = 0,
|
||||
MOON_HALF,
|
||||
@@ -36,7 +41,7 @@ MOON_FULL
|
||||
|
||||
class calendar
|
||||
{
|
||||
public:
|
||||
private:
|
||||
// The basic data; note that "second" should always be a multiple of 6
|
||||
int second;
|
||||
int minute;
|
||||
@@ -46,11 +51,12 @@ class calendar
|
||||
int year;
|
||||
// End data
|
||||
|
||||
public:
|
||||
calendar();
|
||||
calendar(const calendar ©);
|
||||
calendar(int Minute, int Hour, int Day, season_type Season, int Year);
|
||||
calendar(int turn);
|
||||
int get_turn();
|
||||
int get_turn() const;
|
||||
operator int() const; // Returns get_turn() for backwards compatibility
|
||||
calendar& operator = (calendar &rhs);
|
||||
calendar& operator = (int rhs);
|
||||
@@ -62,8 +68,8 @@ class calendar
|
||||
calendar operator - (int rhs);
|
||||
calendar operator + (calendar &rhs);
|
||||
calendar operator + (int rhs);
|
||||
bool operator ==(int rhs);
|
||||
bool operator ==(calendar &rhs);
|
||||
bool operator ==(int rhs) const;
|
||||
bool operator ==(calendar &rhs) const;
|
||||
|
||||
void increment(); // Add one turn / 6 seconds
|
||||
|
||||
@@ -77,7 +83,20 @@ class calendar
|
||||
bool is_night() const; // After sunset + TWILIGHT_MINUTES, before sunrise
|
||||
int sunlight() const; // Current amount of sun/moonlight; uses preceding funcs
|
||||
|
||||
// Basic accessors
|
||||
int seconds() const {return second;}
|
||||
int minutes() const {return minute;}
|
||||
int hours() const {return hour;}
|
||||
int days() const {return day;}
|
||||
season_type get_season() const {return season;}
|
||||
int years() const {return year;}
|
||||
|
||||
void set_season(season_type new_season) {season = new_season;}
|
||||
|
||||
|
||||
// Print-friendly stuff
|
||||
std::string print_time(bool twentyfour = false);
|
||||
std::string print_time(bool just_hour = false) const;
|
||||
std::string textify_period(); // "1 second" "2 hours" "two days"
|
||||
std::string day_of_week() const;
|
||||
};
|
||||
#endif // _CALENDAR_H_
|
||||
|
||||
+126
-19
@@ -1,6 +1,8 @@
|
||||
#if (defined _WIN32 || defined WINDOWS)
|
||||
#include "catacurse.h"
|
||||
#include "options.h"
|
||||
#include "output.h"
|
||||
#include "color.h"
|
||||
#include <cstdlib>
|
||||
#include <fstream>
|
||||
|
||||
@@ -32,6 +34,7 @@ RGBQUAD *windowsPalette; //The coor palette, 16 colors emulates a terminal
|
||||
pairs *colorpairs; //storage for pair'ed colored, should be dynamic, meh
|
||||
unsigned char *dcbits; //the bits of the screen image, for direct access
|
||||
char szDirectory[MAX_PATH] = "";
|
||||
int echoOn; //1 = getnstr shows input, 0 = doesn't show. needed for echo()-ncurses compatibility.
|
||||
|
||||
//***********************************
|
||||
//Non-curses, Window functions *
|
||||
@@ -46,7 +49,7 @@ bool WinCreate()
|
||||
int WinBorderWidth;
|
||||
int WinTitleSize;
|
||||
unsigned int WindowStyle;
|
||||
const WCHAR *szTitle= (L"Cataclysm: Dark Days Ahead - 0.4");
|
||||
const WCHAR *szTitle= (L"Cataclysm: Dark Days Ahead - 0.6git");
|
||||
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
|
||||
@@ -123,6 +126,12 @@ LRESULT CALLBACK ProcessMessages(HWND__ *hWnd,unsigned int Msg,
|
||||
case VK_DOWN:
|
||||
lastchar = KEY_DOWN;
|
||||
break;
|
||||
case VK_NEXT:
|
||||
lastchar = KEY_NPAGE;
|
||||
break;
|
||||
case VK_PRIOR:
|
||||
lastchar = KEY_PPAGE;
|
||||
break;
|
||||
default:
|
||||
break;
|
||||
};
|
||||
@@ -165,10 +174,20 @@ void DrawWindow(WINDOW *win)
|
||||
{
|
||||
int i,j,drawx,drawy;
|
||||
char tmp;
|
||||
RECT update = {win->x * fontwidth, -1,
|
||||
(win->x + win->width) * fontwidth, -1};
|
||||
for (j=0; j<win->height; j++){
|
||||
if (win->line[j].touched)
|
||||
{
|
||||
update.bottom = (win->y+j+1)*fontheight;
|
||||
if (update.top == -1)
|
||||
{
|
||||
update.top = update.bottom - fontheight;
|
||||
}
|
||||
|
||||
win->line[j].touched=false;
|
||||
|
||||
for (i=0; i<win->width; i++){
|
||||
win->line[j].touched=false;
|
||||
drawx=((win->x+i)*fontwidth);
|
||||
drawy=((win->y+j)*fontheight);//-j;
|
||||
if (((drawx+fontwidth)<=WindowWidth) && ((drawy+fontheight)<=WindowHeight)){
|
||||
@@ -237,8 +256,13 @@ void DrawWindow(WINDOW *win)
|
||||
};//switch (tmp)
|
||||
}//(tmp < 0)
|
||||
};//for (i=0;i<_windows[w].width;i++)
|
||||
}
|
||||
};// for (j=0;j<_windows[w].height;j++)
|
||||
win->draw=false; //We drew the window, mark it as so
|
||||
if (update.top != -1)
|
||||
{
|
||||
RedrawWindow(WindowHandle, &update, NULL, RDW_INVALIDATE | RDW_UPDATENOW);
|
||||
}
|
||||
};
|
||||
|
||||
//Check for any window messages (keypress, paint, mousemove, etc)
|
||||
@@ -268,7 +292,7 @@ std::ifstream fin;
|
||||
fin.open("data\\FONTDATA");
|
||||
if (!fin.is_open()){
|
||||
MessageBox(WindowHandle, "Failed to open FONTDATA, loading defaults.",
|
||||
NULL, NULL);
|
||||
NULL, 0);
|
||||
fontheight=16;
|
||||
fontwidth=8;
|
||||
} else {
|
||||
@@ -279,7 +303,7 @@ fin.open("data\\FONTDATA");
|
||||
fin >> fontheight;
|
||||
if ((fontwidth <= 4) || (fontheight <=4)){
|
||||
MessageBox(WindowHandle, "Invalid font size specified!",
|
||||
NULL, NULL);
|
||||
NULL, 0);
|
||||
fontheight=16;
|
||||
fontwidth=8;
|
||||
}
|
||||
@@ -315,7 +339,7 @@ fin.open("data\\FONTDATA");
|
||||
|
||||
} else {
|
||||
MessageBox(WindowHandle, "Failed to load default font, using FixedSys.",
|
||||
NULL, NULL);
|
||||
NULL, 0);
|
||||
font = CreateFont(fontheight, fontwidth, 0, 0, FW_NORMAL, FALSE, FALSE, FALSE,
|
||||
ANSI_CHARSET, OUT_DEFAULT_PRECIS,CLIP_DEFAULT_PRECIS,
|
||||
PROOF_QUALITY, FF_MODERN, "FixedSys"); //Create our font
|
||||
@@ -336,6 +360,16 @@ WINDOW *newwin(int nlines, int ncols, int begin_y, int begin_x)
|
||||
return NULL; //it's the caller's problem now (since they have logging functions declared)
|
||||
}
|
||||
|
||||
// default values
|
||||
if (ncols == 0)
|
||||
{
|
||||
ncols = TERMX - begin_x;
|
||||
}
|
||||
if (nlines == 0)
|
||||
{
|
||||
nlines = TERMY - begin_y;
|
||||
}
|
||||
|
||||
int i,j;
|
||||
WINDOW *newwindow = new WINDOW;
|
||||
//newwindow=&_windows[WindowCount];
|
||||
@@ -405,7 +439,10 @@ inline void addedchar(WINDOW *win){
|
||||
//Borders the window with fancy lines!
|
||||
int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)
|
||||
{
|
||||
|
||||
/*
|
||||
ncurses does not do this, and this prevents: wattron(win, c_customBordercolor); wborder(win, ...); wattroff(win, c_customBorderColor);
|
||||
wattron(win, c_white);
|
||||
*/
|
||||
int i, j;
|
||||
int oldx=win->cursorx;//methods below move the cursor, save the value!
|
||||
int oldy=win->cursory;//methods below move the cursor, save the value!
|
||||
@@ -432,6 +469,7 @@ int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl,
|
||||
//_windows[w].cursorx=oldx;//methods above move the cursor, put it back
|
||||
//_windows[w].cursory=oldy;//methods above move the cursor, put it back
|
||||
wmove(win,oldy,oldx);
|
||||
wattroff(win, c_white);
|
||||
return 1;
|
||||
};
|
||||
|
||||
@@ -450,11 +488,19 @@ int refresh(void)
|
||||
return wrefresh(mainwin);
|
||||
};
|
||||
|
||||
//Not terribly sure how this function is suppose to work,
|
||||
//but jday helped to figure most of it out
|
||||
int getch(void)
|
||||
{
|
||||
refresh();
|
||||
return wgetch(mainwin);
|
||||
}
|
||||
|
||||
//Not terribly sure how this function is suppose to work,
|
||||
//but jday helped to figure most of it out
|
||||
int wgetch(WINDOW* win)
|
||||
{
|
||||
// standards note: getch is sometimes required to call refresh
|
||||
// see, e.g., http://linux.die.net/man/3/getch
|
||||
// so although it's non-obvious, that refresh() call (and maybe InvalidateRect?) IS supposed to be there
|
||||
wrefresh(win);
|
||||
InvalidateRect(WindowHandle,NULL,true);
|
||||
lastchar=ERR;//ERR=-1
|
||||
if (inputdelay < 0)
|
||||
@@ -488,6 +534,58 @@ int getch(void)
|
||||
return lastchar;
|
||||
};
|
||||
|
||||
int mvgetch(int y, int x)
|
||||
{
|
||||
move(y,x);
|
||||
return getch();
|
||||
}
|
||||
|
||||
int mvwgetch(WINDOW* win, int y, int x)
|
||||
{
|
||||
move(y, x);
|
||||
return wgetch(win);
|
||||
}
|
||||
|
||||
int getnstr(char *str, int size)
|
||||
{
|
||||
int startX = mainwin->cursorx;
|
||||
int count = 0;
|
||||
char input;
|
||||
while(true)
|
||||
{
|
||||
input = getch();
|
||||
// Carriage return, Line feed and End of File terminate the input.
|
||||
if( input == '\r' || input == '\n' || input == '\x04' )
|
||||
{
|
||||
str[count] = '\x00';
|
||||
return count;
|
||||
}
|
||||
else if( input == 127 ) // Backspace, remapped from \x8 in ProcessMessages()
|
||||
{
|
||||
if( count == 0 )
|
||||
continue;
|
||||
str[count] = '\x00';
|
||||
if(echoOn == 1)
|
||||
mvaddch(mainwin->cursory, startX + count, ' ');
|
||||
--count;
|
||||
if(echoOn == 1)
|
||||
move(mainwin->cursory, startX + count);
|
||||
}
|
||||
else
|
||||
{
|
||||
if( count >= size - 1 ) // Still need space for trailing 0x00
|
||||
continue;
|
||||
str[count] = input;
|
||||
++count;
|
||||
if(echoOn == 1)
|
||||
{
|
||||
move(mainwin->cursory, startX + count);
|
||||
mvaddch(mainwin->cursory, startX + count, input);
|
||||
}
|
||||
}
|
||||
}
|
||||
return count;
|
||||
}
|
||||
//The core printing function, prints characters to the array, and sets colors
|
||||
inline int printstring(WINDOW *win, char *fmt)
|
||||
{
|
||||
@@ -573,7 +671,7 @@ int werase(WINDOW *win)
|
||||
}
|
||||
win->draw=true;
|
||||
wmove(win,0,0);
|
||||
wrefresh(win);
|
||||
// wrefresh(win);
|
||||
return 1;
|
||||
};
|
||||
|
||||
@@ -681,20 +779,20 @@ int start_color(void)
|
||||
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[2]= BGR(0,110,0); // Green
|
||||
windowsPalette[3]= BGR(23,51,92); // Brown???
|
||||
windowsPalette[4]= BGR(150, 0, 0); // Blue
|
||||
windowsPalette[4]= BGR(200, 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[7]= BGR(150, 150, 150);// Gray
|
||||
windowsPalette[8]= BGR(99, 99, 99);// 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);
|
||||
windowsPalette[15]= BGR(255, 255, 255); //White
|
||||
return SetDIBColorTable(backbuffer, 0, 16, windowsPalette);
|
||||
};
|
||||
|
||||
@@ -703,10 +801,6 @@ int keypad(WINDOW *faux, bool bf)
|
||||
return 1;
|
||||
};
|
||||
|
||||
int noecho(void)
|
||||
{
|
||||
return 1;
|
||||
};
|
||||
int cbreak(void)
|
||||
{
|
||||
return 1;
|
||||
@@ -828,4 +922,17 @@ void timeout(int delay)
|
||||
};
|
||||
void set_escdelay(int delay) { } //PORTABILITY, DUMMY FUNCTION
|
||||
|
||||
|
||||
int echo()
|
||||
{
|
||||
echoOn = 1;
|
||||
return 0; // 0 = OK, -1 = ERR
|
||||
}
|
||||
|
||||
int noecho()
|
||||
{
|
||||
echoOn = 0;
|
||||
return 0;
|
||||
}
|
||||
|
||||
#endif
|
||||
|
||||
+8
-3
@@ -97,6 +97,8 @@ typedef struct {
|
||||
#define KEY_RIGHT 0x105 /* right arrow*/
|
||||
#define KEY_HOME 0x106 /* home key */ //<---------not used
|
||||
#define KEY_BACKSPACE 0x107 /* Backspace */ //<---------not used
|
||||
#define KEY_NPAGE 0x152 /* page down */
|
||||
#define KEY_PPAGE 0x153 /* page up */
|
||||
|
||||
/* Curses external declarations. */
|
||||
|
||||
@@ -114,13 +116,16 @@ int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl,
|
||||
int wrefresh(WINDOW *win);
|
||||
int refresh(void);
|
||||
int getch(void);
|
||||
int wgetch(WINDOW* win);
|
||||
int mvgetch(int y, int x);
|
||||
int mvwgetch(WINDOW* win, int y, int x);
|
||||
int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...);
|
||||
int mvprintw(int y, int x, const char *fmt, ...);
|
||||
int werase(WINDOW *win);
|
||||
int start_color(void);
|
||||
int init_pair(short pair, short f, short b);
|
||||
int wmove(WINDOW *win, int y, int x);
|
||||
|
||||
int getnstr(char *str, int size);
|
||||
int clear(void);
|
||||
int erase(void);
|
||||
int endwin(void);
|
||||
@@ -128,7 +133,6 @@ int mvwaddch(WINDOW *win, int y, int x, const chtype ch);
|
||||
int wclear(WINDOW *win);
|
||||
int wprintw(WINDOW *win, const char *fmt, ...);
|
||||
WINDOW *initscr(void);
|
||||
int noecho(void);//PORTABILITY, DUMMY FUNCTION
|
||||
int cbreak(void);//PORTABILITY, DUMMY FUNCTION
|
||||
int keypad(WINDOW *faux, bool bf);//PORTABILITY, DUMMY FUNCTION
|
||||
int curs_set(int visibility);//PORTABILITY, DUMMY FUNCTION
|
||||
@@ -146,7 +150,8 @@ 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
|
||||
|
||||
int echo(void);
|
||||
int noecho(void);
|
||||
//Window Functions, Do not call these outside of catacurse.cpp
|
||||
void WinDestroy();
|
||||
bool WinCreate(bool initgl);
|
||||
|
||||
+316
@@ -0,0 +1,316 @@
|
||||
#include "catajson.h"
|
||||
#include "output.h"
|
||||
#include <string>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <sstream>
|
||||
|
||||
catajson::catajson()
|
||||
{
|
||||
path_msg = "";
|
||||
}
|
||||
|
||||
catajson::catajson(std::string path)
|
||||
{
|
||||
std::ifstream file;
|
||||
file.open(path.c_str());
|
||||
file >> val;
|
||||
file.close();
|
||||
|
||||
path_msg = path;
|
||||
|
||||
std::string err = picojson::get_last_error();
|
||||
if (! err.empty()) {
|
||||
debugmsg("Parse error in %s.\n\nERROR: %s\n", path.c_str(), err.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
catajson::catajson(picojson::value val_in, std::string path_msg_in)
|
||||
{
|
||||
val = val_in;
|
||||
path_msg = path_msg_in;
|
||||
}
|
||||
|
||||
char catajson::as_char() const
|
||||
{
|
||||
std::string temp = as_string();
|
||||
if (temp.size() != 1)
|
||||
{
|
||||
debugmsg("JSON warning at %s: value requested as char, string length is not 1", path_msg.c_str());
|
||||
}
|
||||
return temp[0];
|
||||
}
|
||||
|
||||
std::string catajson::as_string() const
|
||||
{
|
||||
if (val.is<std::string>())
|
||||
{
|
||||
return val.get<std::string>();
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: value is not a string", path_msg.c_str());
|
||||
}
|
||||
return "";
|
||||
}
|
||||
|
||||
int catajson::as_int() const
|
||||
{
|
||||
double temp = as_double();
|
||||
int ret = static_cast<int>(temp);
|
||||
if (ret != temp)
|
||||
{
|
||||
debugmsg("JSON warning at %s: value was requested as int, provided as double", path_msg.c_str());
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool catajson::as_bool() const
|
||||
{
|
||||
if (val.is<bool>())
|
||||
{
|
||||
return val.get<bool>();
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: value is not a boolean", path_msg.c_str());
|
||||
}
|
||||
return val.evaluate_as_boolean();
|
||||
}
|
||||
|
||||
double catajson::as_double() const
|
||||
{
|
||||
if (val.is<double>())
|
||||
{
|
||||
return val.get<double>();
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: value is not numeric", path_msg.c_str());
|
||||
}
|
||||
return 0;
|
||||
}
|
||||
|
||||
std::set<std::string> catajson::as_tags()
|
||||
{
|
||||
std::set<std::string> tags;
|
||||
if (is_array())
|
||||
{
|
||||
for (set_begin(); has_curr(); next())
|
||||
{
|
||||
tags.insert( curr().as_string() );
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
// We should have gotten a string, if not an array.
|
||||
tags.insert( as_string() );
|
||||
}
|
||||
return tags;
|
||||
}
|
||||
|
||||
catajson catajson::get(std::string key) const
|
||||
{
|
||||
if (val.is<picojson::object>())
|
||||
{
|
||||
if (has(key))
|
||||
{
|
||||
return catajson(val.get(key), path_msg + "[" + key + "]");
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s[%s]: value does not exist", path_msg.c_str(), key.c_str());
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: value is not an object", path_msg.c_str());
|
||||
}
|
||||
return catajson();
|
||||
}
|
||||
|
||||
catajson catajson::get(int index) const
|
||||
{
|
||||
if (val.is<picojson::array>())
|
||||
{
|
||||
if (has(index))
|
||||
{
|
||||
std::stringstream text;
|
||||
text << path_msg << "[" << index << "]";
|
||||
return catajson(val.get(index), text.str());
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s[%d]: value does not exist", path_msg.c_str(), index);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: value is not an array", path_msg.c_str());
|
||||
}
|
||||
return catajson();
|
||||
}
|
||||
|
||||
bool catajson::has(std::string key) const
|
||||
{
|
||||
if (val.is<picojson::object>())
|
||||
{
|
||||
return val.contains(key);
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: value is not an object", path_msg.c_str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool catajson::has(int index) const
|
||||
{
|
||||
if (val.is<picojson::array>())
|
||||
{
|
||||
return val.contains(index);
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: value is not an array", path_msg.c_str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
bool catajson::is_char() const
|
||||
{
|
||||
return is_string() && as_string().size() == 1;
|
||||
}
|
||||
|
||||
bool catajson::is_string() const
|
||||
{
|
||||
return val.is<std::string>();
|
||||
}
|
||||
|
||||
bool catajson::is_number() const
|
||||
{
|
||||
return val.is<double>();
|
||||
}
|
||||
|
||||
bool catajson::is_bool() const
|
||||
{
|
||||
return val.is<bool>();
|
||||
}
|
||||
|
||||
bool catajson::is_object() const
|
||||
{
|
||||
return val.is<picojson::object>();
|
||||
}
|
||||
|
||||
bool catajson::is_array() const
|
||||
{
|
||||
return val.is<picojson::array>();
|
||||
}
|
||||
|
||||
void catajson::set_begin()
|
||||
{
|
||||
if (val.is<picojson::array>())
|
||||
{
|
||||
ar_iter = val.get<picojson::array>().begin();
|
||||
}
|
||||
else if (val.is<picojson::object>())
|
||||
{
|
||||
obj_iter = val.get<picojson::object>().begin();
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: cannot call set_begin(), value is not an array or object", path_msg.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void catajson::set_end()
|
||||
{
|
||||
if (val.is<picojson::array>())
|
||||
{
|
||||
ar_iter = val.get<picojson::array>().end();
|
||||
}
|
||||
else if (val.is<picojson::object>())
|
||||
{
|
||||
obj_iter = val.get<picojson::object>().end();
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: cannot call set_end(), value is not an array or object", path_msg.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void catajson::next()
|
||||
{
|
||||
if (val.is<picojson::array>())
|
||||
{
|
||||
++ar_iter;
|
||||
}
|
||||
else if (val.is<picojson::object>())
|
||||
{
|
||||
++obj_iter;
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: tried to iterate an invalid value", path_msg.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
void catajson::prev()
|
||||
{
|
||||
if (val.is<picojson::array>())
|
||||
{
|
||||
--ar_iter;
|
||||
}
|
||||
else if (val.is<picojson::object>())
|
||||
{
|
||||
--obj_iter;
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: tried to iterate an invalid value", path_msg.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
bool catajson::has_curr() const
|
||||
{
|
||||
if (val.is<picojson::array>())
|
||||
{
|
||||
if (ar_iter >= val.get<picojson::array>().begin() && ar_iter < val.get<picojson::array>().end())
|
||||
{
|
||||
return true;
|
||||
}
|
||||
}
|
||||
else if (val.is<picojson::object>())
|
||||
{
|
||||
return has(obj_iter->first);
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: not an array or object", path_msg.c_str());
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
catajson catajson::curr() const
|
||||
{
|
||||
if (val.is<picojson::array>())
|
||||
{
|
||||
const int count = val.get<picojson::array>().size();
|
||||
for (int i = 0; i < count; ++i)
|
||||
{
|
||||
if (val.get(i) == *ar_iter)
|
||||
{
|
||||
return get(i);
|
||||
}
|
||||
}
|
||||
}
|
||||
else if (val.is<picojson::object>())
|
||||
{
|
||||
return get(obj_iter->first);
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("JSON error at %s: not an array or object", path_msg.c_str());
|
||||
}
|
||||
return catajson();
|
||||
}
|
||||
+53
@@ -0,0 +1,53 @@
|
||||
#ifndef _CATAJSON_H_
|
||||
#define _CATAJSON_H_
|
||||
|
||||
#include "picojson.h"
|
||||
#include <set>
|
||||
|
||||
class catajson
|
||||
{
|
||||
public:
|
||||
catajson();
|
||||
catajson(std::string path);
|
||||
catajson(picojson::value val, std::string path_msg);
|
||||
|
||||
// accessors for picojson values containing simple types
|
||||
char as_char() const;
|
||||
std::string as_string() const;
|
||||
int as_int() const;
|
||||
bool as_bool() const;
|
||||
double as_double() const;
|
||||
// accessor for not-so-simple type
|
||||
std::set<std::string> as_tags();
|
||||
// accessors in the case of array or object values
|
||||
catajson get(std::string key) const;
|
||||
catajson get(int index) const;
|
||||
|
||||
//these check whether a given key/index is valid
|
||||
bool has(std::string key) const;
|
||||
bool has(int index) const;
|
||||
|
||||
bool is_char() const;
|
||||
bool is_string() const;
|
||||
bool is_number() const; // double OR int
|
||||
bool is_bool() const;
|
||||
bool is_object() const; // string-value pairs
|
||||
bool is_array() const;
|
||||
|
||||
// these are intended for use in iteration
|
||||
// STL-style iterators are acceptable too, if anyone wants to add them
|
||||
void set_begin(); // start iterating from the beginning
|
||||
void set_end(); // start iterating from the end
|
||||
void next(); // caller's responsibility to init first
|
||||
void prev(); // caller's responsibility to init first
|
||||
bool has_curr() const; // would curr() be valid?
|
||||
catajson curr() const; // get the current element
|
||||
|
||||
private:
|
||||
picojson::value val;
|
||||
picojson::array::const_iterator ar_iter;
|
||||
picojson::object::const_iterator obj_iter;
|
||||
std::string path_msg; // used for error messages
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -39,3 +39,47 @@ ADDITIONS
|
||||
they die. This works the same as attacks, but the relevent files are
|
||||
mondeath.h and mondeath.cpp.
|
||||
|
||||
1.3 Adding a recipe
|
||||
1) Edit recipes.json. Add your recipe among similar recipes. Required fields
|
||||
are "result", "category", "difficulty", "time", "autolearn", "components".
|
||||
Optional fields are "reversible" (defaults to false), "tools" (defaults to
|
||||
none), "skill_pri" (primary skill, defaults to none), "skill_sec" (defaults
|
||||
to none), "id_suffix" (disambiguates recipes with the same result, must be
|
||||
unique among the set of such recipes), "decomp_learn" (the level (if any)
|
||||
when you can learn it from disassembly), "book_learn" (a list of books that
|
||||
teach the recipe, and the level they teach it at).
|
||||
|
||||
1.4 Adding/editing armour and how armour protection is calculated
|
||||
1) Edit armor.json and add your armor item near similar types.
|
||||
2) The fields are:
|
||||
"type" : "ARMOR", // this must be ARMOR
|
||||
"id" : "socks", // the identifier used by the game. Must be one continuous word, use underscores if necessary
|
||||
"name" : "socks", // the name appearing in the examine box. Can be more than one word separated by spaces
|
||||
"weight" : 1, // weight of armour
|
||||
"color" : "blue", // ascii character colour
|
||||
"covers" : ["FEET"], // where it covers. Possible options are TORSO, HEAD, EYES, MOUTH, ARMS, HANDS, LEGS, FEET
|
||||
"to_hit" : 0, // to-hit bonus if using it as a melee weapon (whatever for?)
|
||||
"storage" : 0, // how many volume storage slots it adds
|
||||
"symbol" : "[", // ascii character
|
||||
"description" : "Socks. Put 'em on your feet.", // description of armour
|
||||
"price" : 100, // price of armour, used when bartering with NPCs
|
||||
"material" : ["COTTON", "NULL"], // material types. See materials.json for possible options
|
||||
"volume" : 1, // volume occupied
|
||||
"cutting" : 0, // cutting damage caused by using it as a melee weapon
|
||||
"warmth" : 10, // how much warmth clothing provides
|
||||
"phase" : "solid", // what phase it is
|
||||
"enviromental_protection" : 0, // how much environmental protection it affords
|
||||
"rarity" : 70, // determines how often it spawns
|
||||
"encumberance" : 0, // base encumbrance (unfitted value)
|
||||
"bashing" : -5, // bashing damage caused by using it as a melee weapon
|
||||
"flags" : ["VARSIZE"] // used to indicate clothing type which can be fitted. Leave out the flags field entirely if clothing cannot be fitted
|
||||
"coverage" : 80, // what percentage of body part
|
||||
"material_thickness" : 1 // thickness of material, in millimetre units (approximately). Generally ranges between 1 - 5, more unusual armour types go up to 10 or more
|
||||
3) When the player is hit at a specific body part, armour coverage determines whether the armour is hit, or an uncovered part of the player is hit (roll 1d100 against coverage)
|
||||
4) If the above roll fails (ie roll value is above coverage), then the armour does not absorb any damage from the blow, neither does it become damaged
|
||||
5) If the above roll succeeds, the armour is hit, possibly absorbing some damage and possibly getting damaged in the process
|
||||
6) The above steps are repeated for each layer of armour on the body part
|
||||
7) Armour protects against bash and cut damage. These are determined by multiplying the armour thickness by the material bash/cut resistance factor respectively, given in materials.json
|
||||
8) If the armour is made from 2 materials types, then it takes a weighted average of the primary material (66%) and secondary material (33%).
|
||||
9) Materials resistance factors are given relative to PAPER as a material (this probably needs some fine-tuning for balance).
|
||||
|
||||
|
||||
@@ -0,0 +1,32 @@
|
||||
Stat system scaling:
|
||||
Minimum stat: 1 (should only happen due to penalties)
|
||||
Nominal stat: 8 ("average" person)
|
||||
Very high stat: ? (realistic world class human)
|
||||
Maximal stat: 20 (higher may be achievable, but we're not worried about balancing at that point.)
|
||||
|
||||
Skill system scaling:
|
||||
Minimum skill: 0 (no training)
|
||||
Maximum skill: 10 (requires regular training to maintain)
|
||||
|
||||
Monster melee skill scaling:
|
||||
Ranges from 8 to 16
|
||||
|
||||
Dodge System assumptions:
|
||||
Dodge chance is based on attacker's melee skill and target's dex stat and dodge skill.
|
||||
Successful dodges negate the attack and impose a cumulative penalty on dodges within the same turn.
|
||||
|
||||
Dodge Use Cases:
|
||||
An individual with no skill and nominal stats in ideal circumstances against a basic opponent should occasionally be able to dodge.
|
||||
|
||||
An individual with no skill and nominal stats in ideal corcumstances against a skilled opponent should rarely if ever be able to dodge.
|
||||
|
||||
An individual with world-class dodging ability, in ideal circumstances against a basic opponent should have a negligible chance of failure.
|
||||
|
||||
An individual with world-class dodging ability, in ideal circumstances against a skilled opponent should have a moderate chance of failure.
|
||||
|
||||
The effect of increasing dodge skill has a growth rate with diminishing returns that accelerates sharply at the point where you move beyond the dodge a "regular" character is likely to achieve (7 and above)
|
||||
|
||||
The balance of melee versus dodge should favour dodge which, after all, isn't effective against a wide variety of other types of attacks.
|
||||
|
||||
Even a world class dodger should not be able to dodge continuously when attacked many times a turn.
|
||||
|
||||
+439
-64
@@ -93,7 +93,7 @@ void computer::use(game *g)
|
||||
|
||||
case 'y':
|
||||
case 'Y':
|
||||
if (!hack_attempt(&(g->u))) {
|
||||
if (!hack_attempt(g, &(g->u))) {
|
||||
if (failures.size() == 0) {
|
||||
print_line("Maximum login attempts exceeded. Press any key...");
|
||||
getch();
|
||||
@@ -140,7 +140,7 @@ void computer::use(game *g)
|
||||
if (current.security > 0) {
|
||||
print_error("Password required.");
|
||||
if (query_bool("Hack into system?")) {
|
||||
if (!hack_attempt(&(g->u), current.security)) {
|
||||
if (!hack_attempt(g, &(g->u), current.security)) {
|
||||
activate_random_failure(g);
|
||||
shutdown_terminal();
|
||||
return;
|
||||
@@ -151,18 +151,19 @@ void computer::use(game *g)
|
||||
}
|
||||
} else // No need to hack, just activate
|
||||
activate_function(g, current.action);
|
||||
reset_terminal();
|
||||
} // Done processing a selected option.
|
||||
} while (!done); // Done with main terminal loop
|
||||
|
||||
shutdown_terminal(); // This should have been done by now, but just in case.
|
||||
}
|
||||
|
||||
bool computer::hack_attempt(player *p, int Security)
|
||||
bool computer::hack_attempt(game *g, player *p, int Security)
|
||||
{
|
||||
if (Security == -1)
|
||||
Security = security; // Set to main system security if no value passed
|
||||
|
||||
p->practice("computer", 5 + Security * 2);
|
||||
p->practice(g->turn, "computer", 5 + Security * 2);
|
||||
int player_roll = p->skillLevel("computer");
|
||||
if (p->int_cur < 8 && one_in(2))
|
||||
player_roll -= rng(0, 8 - p->int_cur);
|
||||
@@ -221,10 +222,10 @@ void computer::load_data(std::string data)
|
||||
std::string tmpname;
|
||||
int tmpaction, tmpsec;
|
||||
dump >> tmpname >> tmpaction >> tmpsec;
|
||||
size_t found = tmpname.find("_");
|
||||
while (found != std::string::npos) {
|
||||
tmpname.replace(found, 1, " ");
|
||||
found = tmpname.find("_");
|
||||
size_t tmp_found = tmpname.find("_");
|
||||
while (tmp_found != std::string::npos) {
|
||||
tmpname.replace(tmp_found, 1, " ");
|
||||
tmp_found = tmpname.find("_");
|
||||
}
|
||||
add_option(tmpname, computer_action(tmpaction), tmpsec);
|
||||
}
|
||||
@@ -248,6 +249,24 @@ void computer::activate_function(game *g, computer_action action)
|
||||
g->m.translate(t_door_metal_locked, t_floor);
|
||||
print_line("Doors opened.");
|
||||
break;
|
||||
|
||||
//LOCK AND UNLOCK are used to build more complex buildings that can have multiple doors that can be locked and
|
||||
//unlocked by different computers. Simply uses translate_radius which take a given radius and player position
|
||||
//to determine which terrain tiles to edit.
|
||||
case COMPACT_LOCK:
|
||||
g->m.translate_radius(t_door_metal_c, t_door_metal_locked, 8.0, g->u.posx, g->u.posy);
|
||||
print_line("Lock enabled.");
|
||||
break;
|
||||
|
||||
case COMPACT_UNLOCK:
|
||||
g->m.translate_radius(t_door_metal_locked, t_door_metal_c, 8.0, g->u.posx, g->u.posy);
|
||||
print_line("Lock disabled.");
|
||||
break;
|
||||
|
||||
//Toll is required for the church computer/mechanism to function
|
||||
case COMPACT_TOLL:
|
||||
g->sound(g->u.posx, g->u.posy, 120, "Bohm... Bohm... Bohm...");
|
||||
break;
|
||||
|
||||
case COMPACT_SAMPLE:
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
@@ -374,6 +393,7 @@ void computer::activate_function(game *g, computer_action action)
|
||||
print_line(" %s", log.c_str());
|
||||
print_line("Press any key...");
|
||||
getch();
|
||||
reset_terminal();
|
||||
} break;
|
||||
|
||||
case COMPACT_MAPS: {
|
||||
@@ -387,9 +407,11 @@ 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++)
|
||||
g->cur_om.seen(i, j, 0) = true;
|
||||
g->cur_om->seen(i, j, 0) = true;
|
||||
}
|
||||
print_line("Surface map data downloaded.");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
} break;
|
||||
|
||||
case COMPACT_MAP_SEWER: {
|
||||
@@ -403,50 +425,84 @@ 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, 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;
|
||||
if ((g->cur_om->ter(i, j, g->levz) >= ot_sewer_ns &&
|
||||
g->cur_om->ter(i, j, g->levz) <= ot_sewer_nesw) ||
|
||||
(g->cur_om->ter(i, j, g->levz) >= ot_sewage_treatment &&
|
||||
g->cur_om->ter(i, j, g->levz) <= ot_sewage_treatment_under))
|
||||
g->cur_om->seen(i, j, g->levz) = true;
|
||||
}
|
||||
print_line("Sewage map data downloaded.");
|
||||
} break;
|
||||
|
||||
|
||||
case COMPACT_MISS_LAUNCH: {
|
||||
// Target Acquisition.
|
||||
point target = g->cur_om.choose_point(g, 0);
|
||||
if (target.x == -1) {
|
||||
print_line("Launch canceled.");
|
||||
return;
|
||||
}
|
||||
// Figure out where the glass wall is...
|
||||
int wall_spot = 0;
|
||||
for (int i = g->u.posx; i < g->u.posx + SEEX * 2 && wall_spot == 0; i++) {
|
||||
if (g->m.ter(i, 10) == t_wall_glass_v)
|
||||
wall_spot = i;
|
||||
}
|
||||
// ...and put radioactive to the right of it
|
||||
for (int i = wall_spot + 1; i < SEEX * 2 - 1; i++) {
|
||||
for (int j = 1; j < SEEY * 2 - 1; j++) {
|
||||
if (one_in(3))
|
||||
g->m.add_field(NULL, i, j, fd_nuke_gas, 3);
|
||||
}
|
||||
}
|
||||
// For each level between here and the surface, remove the missile
|
||||
for (int level = g->levz; level < 0; level++) {
|
||||
tinymap tmpmap(&g->itypes, &g->mapitems, &g->traps);
|
||||
tmpmap.load(g, g->levx, g->levy, level, false);
|
||||
tmpmap.translate(t_missile, t_hole);
|
||||
tmpmap.save(&g->cur_om, g->turn, g->levx, level, g->levz);
|
||||
}
|
||||
for (int x = target.x - 2; x <= target.x + 2; x++) {
|
||||
for (int y = target.y - 2; y <= target.y + 2; y++)
|
||||
g->nuke(x, y);
|
||||
}
|
||||
case COMPACT_MISS_LAUNCH:
|
||||
{
|
||||
// Target Acquisition.
|
||||
point target = g->cur_om->draw_overmap(g, 0);
|
||||
if (target.x == -1)
|
||||
{
|
||||
g->add_msg("Target acquisition canceled");
|
||||
return;
|
||||
}
|
||||
if(query_yn("Confirm nuclear missile launch."))
|
||||
{
|
||||
g->add_msg("Nuclear missile launched!");
|
||||
options.clear();//Remove the option to fire another missle.
|
||||
}
|
||||
else
|
||||
{
|
||||
g->add_msg("Nuclear missile launch aborted.");
|
||||
return;
|
||||
}
|
||||
g->refresh_all();
|
||||
|
||||
//Put some smoke gas and explosions at the nuke location.
|
||||
for(int i= g->u.posx +8; i < g->u.posx +15; i++)
|
||||
{
|
||||
for(int j= g->u.posy +3; j < g->u.posy +12; j++)
|
||||
if(!one_in(4))
|
||||
g->m.add_field(NULL, i+rng(-2,2), j+rng(-2,2), fd_smoke, rng(1,9));
|
||||
}
|
||||
|
||||
g->explosion(g->u.posx +10, g->u.posx +21, 200, 0, true); //Only explode once. But make it large.
|
||||
|
||||
//...ERASE MISSILE, OPEN SILO, DISABLE COMPUTER
|
||||
// For each level between here and the surface, remove the missile
|
||||
for (int level = g->levz; level <= 0; level++)
|
||||
{
|
||||
map tmpmap(&g->itypes, &g->mapitems, &g->traps);
|
||||
tmpmap.load(g, g->levx, g->levy, level, false);
|
||||
|
||||
if(level < 0)
|
||||
tmpmap.translate(t_missile, t_hole);
|
||||
else if(level == 0)
|
||||
tmpmap.translate(t_metal_floor, t_hole);
|
||||
tmpmap.save(g->cur_om, g->turn, g->levx, g->levy, level);
|
||||
}
|
||||
|
||||
|
||||
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);
|
||||
}
|
||||
|
||||
activate_failure(g, COMPFAIL_SHUTDOWN);
|
||||
} break;
|
||||
|
||||
case COMPACT_MISS_DISARM: // TODO: This!
|
||||
|
||||
case COMPACT_MISS_DISARM: // TODO: stop the nuke from creating radioactive clouds.
|
||||
if(query_yn("Disarm missile."))
|
||||
{
|
||||
g->add_msg("Nuclear missile disarmed!");
|
||||
options.clear();//disable missile.
|
||||
activate_failure(g, COMPFAIL_SHUTDOWN);
|
||||
}
|
||||
else
|
||||
{
|
||||
g->add_msg("Nuclear missile remains active.");
|
||||
return;
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPACT_LIST_BIONICS: {
|
||||
@@ -547,7 +603,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.pos().x, g->cur_om.pos().y, 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\
|
||||
@@ -589,9 +645,9 @@ of pureed bone & LSD.");
|
||||
}
|
||||
item software(g->itypes[miss->item_id], 0);
|
||||
software.mission_id = mission_id;
|
||||
int index = g->u.pick_usb();
|
||||
g->u.inv[index].contents.clear();
|
||||
g->u.inv[index].put_in(software);
|
||||
item* usb = g->u.pick_usb();
|
||||
usb->contents.clear();
|
||||
usb->put_in(software);
|
||||
print_line("Software downloaded.");
|
||||
}
|
||||
break;
|
||||
@@ -622,9 +678,9 @@ of pureed bone & LSD.");
|
||||
print_error("USB drive required!");
|
||||
else {
|
||||
item software(g->itypes["software_blood_data"], 0);
|
||||
int index = g->u.pick_usb();
|
||||
g->u.inv[index].contents.clear();
|
||||
g->u.inv[index].put_in(software);
|
||||
item* usb = g->u.pick_usb();
|
||||
usb->contents.clear();
|
||||
usb->put_in(software);
|
||||
print_line("Software downloaded.");
|
||||
}
|
||||
}
|
||||
@@ -637,22 +693,301 @@ of pureed bone & LSD.");
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPACT_DATA_ANAL:
|
||||
for (int x = g->u.posx - 2; x <= g->u.posx + 2; x++) {
|
||||
for (int y = g->u.posy - 2; y <= g->u.posy + 2; y++) {
|
||||
if (g->m.ter(x, y) == t_floor_blue) {
|
||||
print_error("PROCESSING DATA");
|
||||
if (g->m.i_at(x, y).empty()){
|
||||
print_error("ERROR: Please place memory bank in scan area.");
|
||||
query_any("Press any key to continue...");}
|
||||
else if (g->m.i_at(x, y).size() > 1){
|
||||
print_error("ERROR: Please only scan one item at a time.");
|
||||
query_any("Press any key to continue...");}
|
||||
else if (g->m.i_at(x, y)[0].type->id != "usb_drive" && g->m.i_at(x, y)[0].type->id != "black_box"){
|
||||
print_error("ERROR: Memory bank destroyed or not present.");
|
||||
query_any("Press any key to continue...");}
|
||||
else if (g->m.i_at(x, y)[0].type->id == "usb_drive" && g->m.i_at(x, y)[0].contents.empty()){
|
||||
print_error("ERROR: Memory bank is empty.");
|
||||
query_any("Press any key to continue...");}
|
||||
else { // Success!
|
||||
if (g->m.i_at(x, y)[0].type->id == "usb_drive"){
|
||||
print_line("Memory Bank: Unencrypted\nNothing of interest.");
|
||||
query_any("Press any key to continue...");}
|
||||
if (g->m.i_at(x, y)[0].type->id == "black_box"){
|
||||
print_line("Memory Bank: Military Hexron Encryption\nPrinting Transcript\n");
|
||||
query_any("Press any key to continue...");
|
||||
item transcript(g->itypes["black_box_transcript"], g->turn);
|
||||
g->m.add_item(g->u.posx, g->u.posy, transcript);
|
||||
} else
|
||||
print_line("Memory Bank: Unencrypted\nNothing of interest.\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
case COMPACT_DISCONNECT:
|
||||
reset_terminal();
|
||||
print_line("\n\
|
||||
ERROR: NETWORK DISCONNECT \n\
|
||||
UNABLE TO REACH NETWORK ROUTER OR PROXY. PLEASE CONTACT YOUR\n\
|
||||
SYSTEM ADMINISTRATOR TO RESOLVE THIS ISSUE.\n\
|
||||
\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
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...");
|
||||
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\
|
||||
\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_TOWER_UNRESPONSIVE:
|
||||
print_line("\
|
||||
WARNING, RADIO TOWER IS UNRESPONSIVE. \n\
|
||||
\n\
|
||||
BACKUP POWER INSUFFICIENT TO MEET BROADCASTING REQUIREMENTS. \n\
|
||||
IN THE EVENT OF AN EMERGENCY, CONTACT LOCAL NATIONAL GUARD \n\
|
||||
UNITS TO RECEIVE PRIORITY WHEN GENERATORS ARE BEING DEPLOYED. \n\
|
||||
\n\
|
||||
\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_SR1_MESS:
|
||||
reset_terminal();
|
||||
print_line("\n\
|
||||
Subj: Security Reminder\n\
|
||||
To: all SRCF staff\n\
|
||||
From: Constantine Dvorak, Undersecretary of Nuclear Security\n\
|
||||
\n\
|
||||
I want to remind everyone on staff: Do not open or examine\n\
|
||||
containers above your security-clearance. If you have some\n\
|
||||
question about safety protocols or shipping procedures, please\n\
|
||||
contact your SRCF administrator or on-site military officer.\n\
|
||||
When in doubt, assume all containers are Class-A Biohazards\n\
|
||||
and highly toxic. Take full precautions!\n\
|
||||
\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_SR2_MESS:
|
||||
reset_terminal();
|
||||
print_line("\n\
|
||||
Subj: Security Reminder\n\
|
||||
To: all SRCF staff\n\
|
||||
From: Constantine Dvorak, Undersecretary of Nuclear Security\n\
|
||||
\n\
|
||||
From today onward medical wastes are not to be stored anywhere\n\
|
||||
near radioactive materials. All containers are to be\n\
|
||||
re-arranged according to these new regulations. If your\n\
|
||||
facility currently has these containers stored in close\n\
|
||||
proximity, you are to work with armed guards on duty at all\n\
|
||||
times. Report any unusual activity to your SRCF administrator\n\
|
||||
at once.\n\
|
||||
");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_SR3_MESS:
|
||||
reset_terminal();
|
||||
print_line("\n\
|
||||
Subj: Security Reminder\n\
|
||||
To: all SRCF staff\n\
|
||||
From: Constantine Dvorak, Undersecretary of Nuclear Security\n\
|
||||
\n\
|
||||
Worker health and safety is our number one concern! As such,\n\
|
||||
we are instituting weekly health examinations for all SRCF\n\
|
||||
employees. Report any unusual symptoms or physical changes\n\
|
||||
to your SRCF administrator at once.\n\
|
||||
");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_SR4_MESS:
|
||||
reset_terminal();
|
||||
print_line("\n\
|
||||
Subj: Security Reminder\n\
|
||||
To: all SRCF staff\n\
|
||||
From: Constantine Dvorak, Undersecretary of Nuclear Security\n\
|
||||
\n\
|
||||
All compromised facilities will remain under lock down until\n\
|
||||
further notice. Anyone who has seen or come in direct contact\n\
|
||||
with the creatures is to report to the home office for a full\n\
|
||||
medical evaluation and security debriefing.\n\
|
||||
");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_SRCF_1_MESS:
|
||||
reset_terminal();
|
||||
print_line("\n\
|
||||
Subj: EPA: Report All Potential Containment Breaches 3873643\n\
|
||||
To: all SRCF staff\n\
|
||||
From: Robert Shane, Director of the EPA\n\
|
||||
\n\
|
||||
All hazardous waste dumps and sarcouphagi must submit three\n\
|
||||
samples from each operational leache system to the following\n\
|
||||
addresses:\n\
|
||||
\n\
|
||||
CDC Bioterrism Lab \n\
|
||||
Building 10\n\
|
||||
Corporate Square Boulevard\n\
|
||||
Atlanta, GA 30329\n\
|
||||
\n\
|
||||
EPA Region 8 Laboratory\n\
|
||||
16194 W. 45th\n\
|
||||
Drive Golden, Colorado 80403\n\
|
||||
\n\
|
||||
These samples must be accurate and any attempts to cover\n\
|
||||
incompetencies will resault in charges of Federal Corrution\n\
|
||||
and potentially Treason.\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
print_line("Director of the EPA,\n\
|
||||
Robert Shane\n\
|
||||
\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_SRCF_2_MESS:
|
||||
reset_terminal();
|
||||
print_line(" Subj: SRCF: Internal Memo, EPA [2918024]\n\
|
||||
To: all SRCF admin staff\n\
|
||||
From: Constantine Dvorak, Undersecretary of Nuclear Security\n\
|
||||
\n\
|
||||
Director Grimes has released a new series of accusations that\n\
|
||||
will soon be investigated by a Congressional committee. Below\n\
|
||||
is the message that he sent myself.\n\
|
||||
\n\
|
||||
--------------------------------------------------------------\n\
|
||||
Subj: Congressional Investigations\n\
|
||||
To: Constantine Dvorak, Undersecretary of Nuclear Safety\n\
|
||||
From: Robert Shane, director of the EPA\n\
|
||||
\n\
|
||||
The EPA has opposed the Security-Restricted Containment\n\
|
||||
Facility (SRCF) project from its inception. We were horrified\n\
|
||||
that these facilities would be constructed so close to populated\n\
|
||||
areas, and only agreed to sign-off on the project if we were\n\
|
||||
allowed to freely examine and monitor the sarcophagi. But that\n\
|
||||
has not happened. Since then the DoE has employed any and all\n\
|
||||
means to keep EPA agents from visiting the SRCFs, using military\n\
|
||||
secrecy, emergency powers, and inter-departmental gag orders to\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
print_line(" surround the project with an impenetrable thicket of red tape.\n\
|
||||
\n\
|
||||
Although our agents have not been allowed inside, our atmospheric\n\
|
||||
testers in nearby communities have detected high levels of toxins\n\
|
||||
and radiation, and we've found dozens of potentially dangerous\n\
|
||||
unidentified compounds in the ground water. We now have\n\
|
||||
conclusive evidence that the SRCFs are a threat to the public\n\
|
||||
safety. We are taking these data to state representatives and\n\
|
||||
petitioning for a full congressional inquiry. They should be\n\
|
||||
able to force open your secret vaults, and the world will see\n\
|
||||
what you've been hiding.\n\
|
||||
\n\
|
||||
If you had any hand in this outbreak I hope you rot in hell.\n\
|
||||
\n\
|
||||
Director of the EPA,\n\
|
||||
Robert Shane\n\
|
||||
\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_SRCF_3_MESS:
|
||||
reset_terminal();
|
||||
print_line(" Subj: CDC: Internal Memo, Standby [2918115]\n\
|
||||
To: all SRCF staff\n\
|
||||
From: Ellen Grimes, Director of the EPA\n\
|
||||
\n\
|
||||
Your site along with many others has been found to be\n\
|
||||
contaminated with what we will now refer to as [redracted].\n\
|
||||
It is vital that you standby for further orders. We are\n\
|
||||
currently awaiting the President to decide our course of\n\
|
||||
action in this national crisis. You will proceed with fail-\n\
|
||||
safe procedures and rig the sarcouphagus with c-4 as outlined\n\
|
||||
in Publication 4423. We will send you orders to either detonate\n\
|
||||
and seal the sarcouphagus or remove the charges. It is of\n\
|
||||
upmost importance that the facility is sealed immediatly when\n\
|
||||
the orders are given, we have been alerted by Homeland Security\n\
|
||||
that there are potential terrorist suspects that are being\n\
|
||||
detained in connection with the recent national crisis.\n\
|
||||
\n\
|
||||
Director of the CDC,\n\
|
||||
Ellen Grimes\n\
|
||||
\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_SRCF_SEAL_ORDER:
|
||||
reset_terminal();
|
||||
print_line(" Subj: USARMY: SEAL SRCF [987167]\n\
|
||||
To: all SRCF staff\n\
|
||||
From: Major General Cornelius, U.S. Army\n\
|
||||
\n\
|
||||
As a general warning to all civilian staff: the 10th Mountain\n\
|
||||
Division has been assigned to oversee the sealing of the SRCF\n\
|
||||
facilities. By direct order, all non-essential staff must vacate\n\
|
||||
at the earliest possible opportunity to prevent potential\n\
|
||||
contamination. Low yield tactical nuclear demolition charges\n\
|
||||
will be deployed in the lower tunnels to ensure that recovery\n\
|
||||
of hazardous material is impossible. The Army Corps of Engineers\n\
|
||||
will then dump concrete over the rubble so that we can redeploy \n\
|
||||
the 10th Mountain into the greater Boston area.\n\
|
||||
\n\
|
||||
Cornelius,\n\
|
||||
Major General, U.S. Army\n\
|
||||
Commander of the 10th Mountain Division\n\
|
||||
\n");
|
||||
query_any("Press any key to continue...");
|
||||
reset_terminal();
|
||||
break;
|
||||
|
||||
case COMPACT_SRCF_SEAL:
|
||||
g->add_msg("Evacuate Immediatly!");
|
||||
for (int x = 0; x < SEEX * MAPSIZE; x++) {
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (g->m.ter(x, y) == t_elevator || g->m.ter(x, y) == t_vat) {
|
||||
g->m.ter_set(x, y, t_rubble);
|
||||
g->explosion(x, y, 40, 0, true);
|
||||
}
|
||||
if (g->m.ter(x, y) == t_wall_glass_h || g->m.ter(x, y) == t_wall_glass_v)
|
||||
g->m.ter_set(x, y, t_rubble);
|
||||
if (g->m.ter(x, y) == t_sewage_pipe || g->m.ter(x, y) == t_sewage || g->m.ter(x, y) == t_grate)
|
||||
g->m.ter_set(x, y, t_rubble);
|
||||
if (g->m.ter(x, y) == t_sewage_pump) {
|
||||
g->m.ter_set(x, y, t_rubble);
|
||||
g->explosion(x, y, 50, 0, true);
|
||||
}
|
||||
}
|
||||
}
|
||||
break;
|
||||
|
||||
} // switch (action)
|
||||
}
|
||||
|
||||
@@ -801,6 +1136,31 @@ void computer::activate_failure(game *g, computer_failure fail)
|
||||
}
|
||||
getch();
|
||||
break;
|
||||
|
||||
case COMPFAIL_DESTROY_DATA:
|
||||
print_error("ERROR: ACCESSING DATA MALFUNCTION");
|
||||
for (int x = 0; x <= 23; x++) {
|
||||
for (int y = 0; y <= 23; y++) {
|
||||
if (g->m.ter(x, y) == t_floor_blue) {
|
||||
for (int i = 0; i < g->m.i_at(x, y).size(); i++) {
|
||||
if (g->m.i_at(x, y).empty())
|
||||
print_error("ERROR: Please place memory bank in scan area.");
|
||||
else if (g->m.i_at(x, y).size() > 1)
|
||||
print_error("ERROR: Please only scan one item at a time.");
|
||||
else if (g->m.i_at(x, y)[0].type->id != "usb_drive")
|
||||
print_error("ERROR: Memory bank destroyed or not present.");
|
||||
else if (g->m.i_at(x, y)[0].contents.empty())
|
||||
print_error("ERROR: Memory bank is empty.");
|
||||
else {
|
||||
print_error("ERROR: Data bank destroyed.");
|
||||
g->m.i_at(x, y)[i].contents.clear();
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
getch();
|
||||
break;
|
||||
|
||||
}// switch (fail)
|
||||
}
|
||||
@@ -826,6 +1186,21 @@ bool computer::query_bool(const char *mes, ...)
|
||||
return (ret == 'y' || ret == 'Y');
|
||||
}
|
||||
|
||||
bool computer::query_any(const char *mes, ...)
|
||||
{
|
||||
// Translate the printf flags
|
||||
va_list ap;
|
||||
va_start(ap, mes);
|
||||
char buff[6000];
|
||||
vsprintf(buff, mes, ap);
|
||||
va_end(ap);
|
||||
std::string full_line = buff;
|
||||
// Print the resulting text
|
||||
print_line(full_line.c_str());
|
||||
getch();
|
||||
return true;
|
||||
}
|
||||
|
||||
char computer::query_ynq(const char *mes, ...)
|
||||
{
|
||||
// Translate the printf flags
|
||||
|
||||
+19
-2
@@ -1,7 +1,6 @@
|
||||
#ifndef _COMPUTER_H_
|
||||
#define _COMPUTER_H_
|
||||
|
||||
//#include "texthash.h"
|
||||
#include "output.h"
|
||||
#include <vector>
|
||||
#include <string>
|
||||
@@ -15,6 +14,9 @@ enum computer_action
|
||||
{
|
||||
COMPACT_NULL = 0,
|
||||
COMPACT_OPEN,
|
||||
COMPACT_LOCK,
|
||||
COMPACT_UNLOCK,
|
||||
COMPACT_TOLL,
|
||||
COMPACT_SAMPLE,
|
||||
COMPACT_RELEASE,
|
||||
COMPACT_TERMINATE,
|
||||
@@ -31,8 +33,20 @@ enum computer_action
|
||||
COMPACT_AMIGARA_START,
|
||||
COMPACT_DOWNLOAD_SOFTWARE,
|
||||
COMPACT_BLOOD_ANAL,
|
||||
COMPACT_DATA_ANAL,
|
||||
COMPACT_DISCONNECT,
|
||||
COMPACT_STEMCELL_TREATMENT,
|
||||
COMPACT_EMERG_MESS,
|
||||
COMPACT_TOWER_UNRESPONSIVE,
|
||||
COMPACT_SR1_MESS, //Security Reminders for Hazardous Waste Sarcophagus (SRCF)
|
||||
COMPACT_SR2_MESS,
|
||||
COMPACT_SR3_MESS,
|
||||
COMPACT_SR4_MESS,
|
||||
COMPACT_SRCF_1_MESS,
|
||||
COMPACT_SRCF_2_MESS,
|
||||
COMPACT_SRCF_3_MESS,
|
||||
COMPACT_SRCF_SEAL_ORDER,
|
||||
COMPACT_SRCF_SEAL,
|
||||
NUM_COMPUTER_ACTIONS
|
||||
};
|
||||
|
||||
@@ -48,6 +62,7 @@ enum computer_failure
|
||||
COMPFAIL_PUMP_LEAK,
|
||||
COMPFAIL_AMIGARA,
|
||||
COMPFAIL_DESTROY_BLOOD,
|
||||
COMPFAIL_DESTROY_DATA,
|
||||
NUM_COMPUTER_FAILURES
|
||||
};
|
||||
|
||||
@@ -77,7 +92,7 @@ public:
|
||||
// Basic usage
|
||||
void shutdown_terminal(); // Shutdown (free w_terminal, etc)
|
||||
void use(game *g);
|
||||
bool hack_attempt(player *p, int Security = -1);// -1 defaults to main security
|
||||
bool hack_attempt(game *g, player *p, int Security = -1);// -1 defaults to main security
|
||||
// Save/load
|
||||
std::string save_data();
|
||||
void load_data(std::string data);
|
||||
@@ -111,6 +126,8 @@ private:
|
||||
char query_ynq(const char *text, ...);
|
||||
// Same as query_ynq, but returns true for y or Y
|
||||
bool query_bool(const char *text, ...);
|
||||
// Simply wait for any key, returns True
|
||||
bool query_any(const char *text, ...);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+237
-133
@@ -7,7 +7,7 @@
|
||||
#include "mapdata.h"
|
||||
#include "skill.h"
|
||||
#include "crafting.h" // For the use_comps use_tools functions
|
||||
|
||||
#include "item_factory.h"
|
||||
|
||||
bool will_flood_stop(map *m, bool (&fill)[SEEX * MAPSIZE][SEEY * MAPSIZE],
|
||||
int x, int y);
|
||||
@@ -53,6 +53,7 @@ void game::init_construction()
|
||||
CONSTRUCT("Spike Pit", 0, &construct::able_pit, &construct::done_nothing);
|
||||
STAGE(t_pit_spiked, 5);
|
||||
COMP("spear_wood", 4);
|
||||
COMPCONT("pointy_stick", 4);
|
||||
|
||||
CONSTRUCT("Fill Pit", 0, &construct::able_pit, &construct::done_nothing);
|
||||
STAGE(t_pit_shallow, 5);
|
||||
@@ -140,40 +141,61 @@ void game::init_construction()
|
||||
COMP("2x4", 10);
|
||||
COMP("nail", 20);
|
||||
|
||||
CONSTRUCT("Build Log Wall", 2, &construct::able_pit, &construct::done_nothing);
|
||||
CONSTRUCT("Build Log Wall", 2, &construct::able_dig, &construct::done_nothing);
|
||||
STAGE(t_pit_shallow, 10);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
TOOLCONT("digging_stick");
|
||||
STAGE(t_pit, 10);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
STAGE(t_wall_log_half, 20);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
COMP("log", 2);
|
||||
COMP("stick", 3);
|
||||
COMPCONT("2x4", 6);
|
||||
STAGE(t_wall_log, 20);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
COMP("log", 2);
|
||||
COMP("stick", 3);
|
||||
COMPCONT("2x4", 6);
|
||||
|
||||
CONSTRUCT("Build Palisade Wall", 2, &construct::able_pit, &construct::done_nothing);
|
||||
CONSTRUCT("Build Palisade Wall", 2, &construct::able_dig, &construct::done_nothing);
|
||||
STAGE(t_pit_shallow, 10);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
TOOLCONT("digging_stick");
|
||||
STAGE(t_pit, 10);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
STAGE(t_palisade, 20);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
COMP("log", 3);
|
||||
COMP("rope_30", 1);
|
||||
COMPCONT("rope_6", 5);
|
||||
COMP("rope_6", 2);
|
||||
|
||||
CONSTRUCT("Build Rope and Pulley System", 2, &construct::able_empty, &construct::done_nothing);
|
||||
CONSTRUCT("Build Rope & 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);
|
||||
CONSTRUCT("Build Palisade Gate", 2, &construct::able_dig, &construct::done_nothing);
|
||||
STAGE(t_pit_shallow, 10);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
TOOLCONT("digging_stick");
|
||||
STAGE(t_pit, 10);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
STAGE(t_palisade_gate, 20);
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
COMP("log", 2);
|
||||
COMP("2x4", 3);
|
||||
COMP("rope_30", 1);
|
||||
COMPCONT("rope_6", 5);
|
||||
COMP("rope_6", 2);
|
||||
|
||||
CONSTRUCT("Build Window", 2, &construct::able_make_window,
|
||||
&construct::done_nothing);
|
||||
@@ -192,6 +214,7 @@ void game::init_construction()
|
||||
COMP("nail", 4);
|
||||
COMP("sheet", 2);
|
||||
COMP("stick", 1);
|
||||
COMP("string_36", 1);
|
||||
|
||||
CONSTRUCT("Build Door", 2, &construct::able_empty,
|
||||
&construct::done_nothing);
|
||||
@@ -220,7 +243,7 @@ void game::init_construction()
|
||||
COMP("pipe", 6);
|
||||
COMP("scrap", 8);
|
||||
STAGE(t_chainfence_v, 20);
|
||||
COMP("wire", 15);
|
||||
COMP("wire", 20);
|
||||
|
||||
CONSTRUCT("Realign Fence", 0, &construct::able_chainlink,
|
||||
&construct::done_nothing);
|
||||
@@ -255,6 +278,19 @@ void game::init_construction()
|
||||
COMP("2x4", 8);
|
||||
COMP("nail", 40);
|
||||
|
||||
CONSTRUCT("Build Log & Sod Roof", 3, &construct::able_between_walls,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_floor, 80);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOL("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
COMP("log", 2);
|
||||
COMP("stick", 4);
|
||||
COMPCONT("2x4", 8);
|
||||
|
||||
|
||||
// Base stuff
|
||||
CONSTRUCT("Build Bulletin Board", 0, &construct::able_empty,
|
||||
&construct::done_nothing);
|
||||
@@ -289,6 +325,25 @@ void game::init_construction()
|
||||
COMP("nail", 16);
|
||||
COMP("2x4", 12);
|
||||
|
||||
CONSTRUCT("Build Locker", 1, &construct::able_indoors,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_locker, 20);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOL("wrench");
|
||||
COMP("sheet_metal", 2);
|
||||
COMP("pipe", 8);
|
||||
|
||||
CONSTRUCT("Build Metal Rack", 1, &construct::able_indoors,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_rack, 20);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("hatchet");
|
||||
TOOL("wrench");
|
||||
COMP("pipe", 12);
|
||||
|
||||
CONSTRUCT("Build Counter", 0, &construct::able_indoors,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_counter, 20);
|
||||
@@ -308,9 +363,9 @@ void game::init_construction()
|
||||
TOOLCONT("nailgun");
|
||||
COMP("nail", 8);
|
||||
COMP("2x4", 10);
|
||||
COMP("sheet", 1);
|
||||
COMP("blanket", 1);
|
||||
|
||||
CONSTRUCT("Tape up window", 0, &construct::able_window,
|
||||
CONSTRUCT("Tape up window", 0, &construct::able_window_pane,
|
||||
&construct::done_tape);
|
||||
STAGE(t_null, 2);
|
||||
COMP("duct_tape", 50);
|
||||
@@ -340,7 +395,8 @@ void game::init_construction()
|
||||
TOOLCONT("hatchet");
|
||||
TOOLCONT("ax");
|
||||
TOOLCONT("primitive_axe");
|
||||
COMP("spear_wood", 2);
|
||||
COMP("pointy_stick", 2);
|
||||
COMPCONT("spear_wood", 2);
|
||||
|
||||
CONSTRUCT("Build Wood Stove", 0, &construct::able_empty,
|
||||
&construct::done_nothing);
|
||||
@@ -348,6 +404,15 @@ void game::init_construction()
|
||||
TOOL("hacksaw");
|
||||
COMP("metal_tank", 1);
|
||||
COMP("pipe", 1);
|
||||
|
||||
CONSTRUCT("Build Stone Fireplace", 0, &construct::able_empty,
|
||||
&construct::done_nothing);
|
||||
STAGE(t_fireplace, 40);
|
||||
TOOL("hammer");
|
||||
TOOLCONT("primitive_hammer");
|
||||
TOOLCONT("shovel");
|
||||
TOOLCONT("primitive_shovel");
|
||||
COMP("rock", 40);
|
||||
}
|
||||
|
||||
void game::construction_menu()
|
||||
@@ -374,9 +439,11 @@ void game::construction_menu()
|
||||
|
||||
bool update_info = true;
|
||||
int select = 0;
|
||||
int chosen = 0;
|
||||
long ch;
|
||||
bool exit = false;
|
||||
|
||||
inventory total_inv = crafting_inventory();
|
||||
inventory total_inv = crafting_inventory(&u);
|
||||
|
||||
do {
|
||||
// Erase existing list of constructions
|
||||
@@ -395,7 +462,7 @@ void game::construction_menu()
|
||||
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 = 97 + current;
|
||||
unsigned char hotkey = 97 + current;
|
||||
if (hotkey > 122)
|
||||
hotkey = hotkey - 58;
|
||||
|
||||
@@ -429,12 +496,20 @@ void game::construction_menu()
|
||||
posy++;
|
||||
// Print tools
|
||||
construction_stage stage = current_con->stages[n];
|
||||
bool has_tool[3] = {stage.tools[0].empty(),
|
||||
stage.tools[1].empty(),
|
||||
stage.tools[2].empty()};
|
||||
for (int i = 0; i < 3 && !has_tool[i]; i++) {
|
||||
posy++;
|
||||
posx = 33;
|
||||
bool has_tool[10] = {stage.tools[0].empty(),
|
||||
stage.tools[1].empty(),
|
||||
stage.tools[2].empty(),
|
||||
stage.tools[3].empty(),
|
||||
stage.tools[4].empty(),
|
||||
stage.tools[5].empty(),
|
||||
stage.tools[6].empty(),
|
||||
stage.tools[7].empty(),
|
||||
stage.tools[8].empty(),
|
||||
stage.tools[9].empty()};
|
||||
posy++;
|
||||
posx = 33;
|
||||
for (int i = 0; i < 9 && !has_tool[i]; i++) {
|
||||
mvwprintz(w_con, posy, posx-2, c_white, ">");
|
||||
for (int j = 0; j < stage.tools[i].size(); j++) {
|
||||
itype_id tool = stage.tools[i][j].type;
|
||||
nc_color col = c_red;
|
||||
@@ -442,12 +517,12 @@ void game::construction_menu()
|
||||
has_tool[i] = true;
|
||||
col = c_green;
|
||||
}
|
||||
int length = itypes[tool]->name.length();
|
||||
int length = item_controller->find_template(tool)->name.length();
|
||||
if (posx + length > 79) {
|
||||
posy++;
|
||||
posx = 33;
|
||||
}
|
||||
mvwprintz(w_con, posy, posx, col, itypes[tool]->name.c_str());
|
||||
mvwprintz(w_con, posy, posx, col, item_controller->find_template(tool)->name.c_str());
|
||||
posx += length + 1; // + 1 for an empty space
|
||||
if (j < stage.tools[i].size() - 1) { // "OR" if there's more
|
||||
if (posx > 77) {
|
||||
@@ -458,34 +533,42 @@ void game::construction_menu()
|
||||
posx += 3;
|
||||
}
|
||||
}
|
||||
posy += 2;
|
||||
posx = 33;
|
||||
}
|
||||
// Print components
|
||||
posy++;
|
||||
posx = 33;
|
||||
bool has_component[3] = {stage.components[0].empty(),
|
||||
stage.components[1].empty(),
|
||||
stage.components[2].empty()};
|
||||
for (int i = 0; i < 3; i++) {
|
||||
posx = 33;
|
||||
while (has_component[i])
|
||||
i++;
|
||||
for (int j = 0; j < stage.components[i].size() && i < 3; j++) {
|
||||
bool has_component[10] = {stage.components[0].empty(),
|
||||
stage.components[1].empty(),
|
||||
stage.components[2].empty(),
|
||||
stage.components[3].empty(),
|
||||
stage.components[4].empty(),
|
||||
stage.components[5].empty(),
|
||||
stage.components[6].empty(),
|
||||
stage.components[7].empty(),
|
||||
stage.components[8].empty(),
|
||||
stage.components[9].empty()};
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (has_component[i])
|
||||
continue;
|
||||
mvwprintz(w_con, posy, posx-2, c_white, ">");
|
||||
for (int j = 0; j < stage.components[i].size() && i < 10; j++) {
|
||||
nc_color col = c_red;
|
||||
component comp = stage.components[i][j];
|
||||
if (( itypes[comp.type]->is_ammo() &&
|
||||
if (( item_controller->find_template(comp.type)->is_ammo() &&
|
||||
total_inv.has_charges(comp.type, comp.count)) ||
|
||||
(!itypes[comp.type]->is_ammo() &&
|
||||
(!item_controller->find_template(comp.type)->is_ammo() &&
|
||||
total_inv.has_amount(comp.type, comp.count))) {
|
||||
has_component[i] = true;
|
||||
col = c_green;
|
||||
}
|
||||
int length = itypes[comp.type]->name.length();
|
||||
int length = item_controller->find_template(comp.type)->name.length();
|
||||
if (posx + length > 79) {
|
||||
posy++;
|
||||
posx = 33;
|
||||
}
|
||||
mvwprintz(w_con, posy, posx, col, "%s x%d",
|
||||
itypes[comp.type]->name.c_str(), comp.count);
|
||||
item_controller->find_template(comp.type)->name.c_str(), comp.count);
|
||||
posx += length + 3; // + 2 for " x", + 1 for an empty space
|
||||
// Add more space for the length of the count
|
||||
if (comp.count < 10)
|
||||
@@ -504,7 +587,8 @@ void game::construction_menu()
|
||||
posx += 3;
|
||||
}
|
||||
}
|
||||
posy++;
|
||||
posx = 33;
|
||||
posy += 2;
|
||||
}
|
||||
}
|
||||
wrefresh(w_con);
|
||||
@@ -528,27 +612,28 @@ void game::construction_menu()
|
||||
break;
|
||||
case ' ':
|
||||
case KEY_ESCAPE:
|
||||
ch = 'q';
|
||||
case 'q':
|
||||
case 'Q':
|
||||
exit = true;
|
||||
break;
|
||||
case '\n':
|
||||
default:
|
||||
if (ch > 64 && ch < 91) //A-Z
|
||||
ch = ch - 65 + 26;
|
||||
chosen = ch - 65 + 26;
|
||||
|
||||
if (ch > 96 && ch < 123) //a-z
|
||||
ch = ch - 97;
|
||||
else if (ch > 96 && ch < 123) //a-z
|
||||
chosen = ch - 97;
|
||||
|
||||
if (ch == '\n')
|
||||
ch = select;
|
||||
else if (ch == '\n')
|
||||
chosen = select;
|
||||
|
||||
if (ch < constructions.size()) {
|
||||
if (player_can_build(u, total_inv, constructions[ch])) {
|
||||
place_construction(constructions[ch]);
|
||||
ch = 'q';
|
||||
if (chosen < constructions.size()) {
|
||||
if (player_can_build(u, total_inv, constructions[chosen])) {
|
||||
place_construction(constructions[chosen]);
|
||||
exit = true;
|
||||
} else {
|
||||
popup("You can't build that!");
|
||||
if (ch != '\n')
|
||||
select = ch;
|
||||
select = chosen;
|
||||
for (int i = 1; i < iMaxY-1; i++)
|
||||
mvwputch(w_con, i, 30, c_ltgray, LINE_XOXO);
|
||||
update_info = true;
|
||||
@@ -556,7 +641,7 @@ void game::construction_menu()
|
||||
}
|
||||
break;
|
||||
}
|
||||
} while (ch != 'q' && ch != 'Q' && ch != KEY_ESCAPE);
|
||||
} while (!exit);
|
||||
|
||||
for (int i = iMaxY-25; i < iMaxY+1; i++) {
|
||||
for (int j = TERRAIN_WINDOW_WIDTH; j < 81; j++)
|
||||
@@ -567,7 +652,7 @@ void game::construction_menu()
|
||||
refresh_all();
|
||||
}
|
||||
|
||||
bool game::player_can_build(player &p, inventory inv, constructable* con,
|
||||
bool game::player_can_build(player &p, inventory pinv, constructable* con,
|
||||
const int level, bool cont, bool exact_level)
|
||||
{
|
||||
int last_level = level;
|
||||
@@ -586,34 +671,48 @@ bool game::player_can_build(player &p, inventory inv, constructable* con,
|
||||
|
||||
bool can_build_any = false;
|
||||
for (int i = start; i < con->stages.size() && i <= last_level; i++) {
|
||||
construction_stage stage = con->stages[i];
|
||||
construction_stage* stage = &(con->stages[i]);
|
||||
bool has_tool = false;
|
||||
bool has_component = false;
|
||||
bool tools_required = false;
|
||||
bool components_required = false;
|
||||
|
||||
for (int j = 0; j < 3; j++) {
|
||||
if (stage.tools[j].size() > 0) {
|
||||
for (int j = 0; j < 10; j++) {
|
||||
if (stage->tools[j].size() > 0) {
|
||||
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].type, 1))
|
||||
has_tool = true;
|
||||
for (int k = 0; k < stage->tools[j].size(); k++) {
|
||||
if (pinv.has_amount(stage->tools[j][k].type, 1))
|
||||
{
|
||||
has_tool = true;
|
||||
stage->tools[j][k].available = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
stage->tools[j][k].available = -1;
|
||||
}
|
||||
}
|
||||
if (!has_tool) // missing one of the tools for this stage
|
||||
break;
|
||||
}
|
||||
if (stage.components[j].size() > 0) {
|
||||
if (stage->components[j].size() > 0) {
|
||||
components_required = true;
|
||||
has_component = false;
|
||||
for (int k = 0; k < stage.components[j].size() && !has_component; k++) {
|
||||
if (( itypes[stage.components[j][k].type]->is_ammo() &&
|
||||
inv.has_charges(stage.components[j][k].type,
|
||||
stage.components[j][k].count) ) ||
|
||||
(!itypes[stage.components[j][k].type]->is_ammo() &&
|
||||
inv.has_amount (stage.components[j][k].type,
|
||||
stage.components[j][k].count) ))
|
||||
has_component = true;
|
||||
for (int k = 0; k < stage->components[j].size(); k++) {
|
||||
if (( item_controller->find_template(stage->components[j][k].type)->is_ammo() &&
|
||||
pinv.has_charges(stage->components[j][k].type,
|
||||
stage->components[j][k].count) ) ||
|
||||
(!item_controller->find_template(stage->components[j][k].type)->is_ammo() &&
|
||||
pinv.has_amount (stage->components[j][k].type,
|
||||
stage->components[j][k].count) ))
|
||||
{
|
||||
has_component = true;
|
||||
stage->components[j][k].available = 1;
|
||||
}
|
||||
else
|
||||
{
|
||||
stage->components[j][k].available = -1;
|
||||
}
|
||||
}
|
||||
if (!has_component) // missing one of the comps for this stage
|
||||
break;
|
||||
@@ -633,7 +732,7 @@ bool game::player_can_build(player &p, inventory inv, constructable* con,
|
||||
void game::place_construction(constructable *con)
|
||||
{
|
||||
refresh_all();
|
||||
inventory total_inv = crafting_inventory();
|
||||
inventory total_inv = crafting_inventory(&u);
|
||||
|
||||
std::vector<point> valid;
|
||||
for (int x = u.posx - 1; x <= u.posx + 1; x++) {
|
||||
@@ -683,7 +782,15 @@ void game::place_construction(constructable *con)
|
||||
point_is_okay = true;
|
||||
}
|
||||
if (!point_is_okay) {
|
||||
add_msg("You cannot build there!");
|
||||
construct test;
|
||||
if (con->name == "Move Furniture" && !(test.*(con->able))(this, point(dirx, diry)))
|
||||
{
|
||||
add_msg("You're not strong enough!");
|
||||
}
|
||||
else
|
||||
{
|
||||
add_msg("You cannot build there!");
|
||||
}
|
||||
return;
|
||||
}
|
||||
|
||||
@@ -708,20 +815,18 @@ void game::place_construction(constructable *con)
|
||||
|
||||
void game::complete_construction()
|
||||
{
|
||||
inventory map_inv;
|
||||
map_inv.form_from_map(this, point(u.posx, u.posy), PICKUP_RANGE);
|
||||
int stage_num = u.activity.values[0];
|
||||
constructable *built = constructions[u.activity.index];
|
||||
construction_stage stage = built->stages[stage_num];
|
||||
std::vector<component> player_use;
|
||||
std::vector<component> map_use;
|
||||
|
||||
u.practice("carpentry", built->difficulty * 10);
|
||||
u.practice(turn, "carpentry", built->difficulty * 10);
|
||||
if (built->difficulty == 0)
|
||||
u.practice("carpentry", 10);
|
||||
for (int i = 0; i < 3; i++) {
|
||||
u.practice(turn, "carpentry", 10);
|
||||
for (int i = 0; i < 10; i++) {
|
||||
if (!stage.components[i].empty())
|
||||
consume_items(stage.components[i]);
|
||||
consume_items(&u, stage.components[i]);
|
||||
}
|
||||
|
||||
// Make the terrain change
|
||||
@@ -761,34 +866,17 @@ bool construct::able_log(game *g, point p)
|
||||
|
||||
bool construct::able_furniture(game *g, point p)
|
||||
{
|
||||
int required_str = 0;
|
||||
ter_t terrain_type = terlist[g->m.ter(p.x, p.y)];
|
||||
int required_str = terrain_type.move_str_req;
|
||||
|
||||
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:
|
||||
case t_rack:
|
||||
case t_chair:
|
||||
case t_armchair:
|
||||
case t_bench:
|
||||
case t_cupboard:
|
||||
required_str = 8;
|
||||
break;
|
||||
default:
|
||||
//Not a furniture we can move
|
||||
return false;
|
||||
// Object can not be moved
|
||||
if (required_str < 0)
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
if( g->u.str_cur < required_str ) {
|
||||
if( g->u.str_cur < required_str )
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -800,7 +888,8 @@ bool construct::able_window(game *g, point p)
|
||||
return (g->m.ter(p.x, p.y) == t_window_frame ||
|
||||
g->m.ter(p.x, p.y) == t_window_empty ||
|
||||
g->m.ter(p.x, p.y) == t_window_domestic ||
|
||||
g->m.ter(p.x, p.y) == t_window);
|
||||
g->m.ter(p.x, p.y) == t_window ||
|
||||
g->m.ter(p.x, p.y) == t_window_alarm);
|
||||
}
|
||||
|
||||
bool construct::able_make_window(game *g, point p)
|
||||
@@ -827,6 +916,7 @@ bool construct::able_door(game *g, point p)
|
||||
return (g->m.ter(p.x, p.y) == t_door_c ||
|
||||
g->m.ter(p.x, p.y) == t_door_b ||
|
||||
g->m.ter(p.x, p.y) == t_door_o ||
|
||||
g->m.ter(p.x, p.y) == t_door_locked_interior ||
|
||||
g->m.ter(p.x, p.y) == t_door_locked);
|
||||
}
|
||||
|
||||
@@ -848,7 +938,7 @@ bool construct::able_wall_wood(game *g, point p)
|
||||
|
||||
bool construct::able_indoors(game *g, point p)
|
||||
{
|
||||
return (g->m.is_indoor(p.x, p.y));
|
||||
return g->m.has_flag(indoors, p.x, p.y) && able_empty(g, p);
|
||||
}
|
||||
|
||||
bool construct::able_dig(game *g, point p)
|
||||
@@ -883,7 +973,7 @@ bool construct::able_deconstruct(game *g, point p)
|
||||
|
||||
void construct::done_window_pane(game *g, point p)
|
||||
{
|
||||
g->m.spawn_item(g->u.posx, g->u.posy, g->itypes["glass_sheet"], 0);
|
||||
g->m.spawn_item(g->u.posx, g->u.posy, item_controller->find_template("glass_sheet"), 0);
|
||||
}
|
||||
|
||||
void construct::done_furniture(game *g, point p)
|
||||
@@ -899,13 +989,14 @@ void construct::done_furniture(game *g, point p)
|
||||
return;
|
||||
x += p.x;
|
||||
y += p.y;
|
||||
if(!g->m.ter(x, y) == t_floor || !g->is_empty(x, y)) {
|
||||
if(g->m.ter(x, y) != t_floor || !g->is_empty(x, y)) {
|
||||
mvprintz(0, 0, c_red, "Can't move furniture there! Choose a direction with open floor.");
|
||||
continue;
|
||||
}
|
||||
break;
|
||||
}
|
||||
|
||||
g->sound(x, y, terlist[g->m.ter(p.x, p.y)].move_str_req * 2, "a scraping noise");
|
||||
g->m.ter_set(x, y, g->m.ter(p.x, p.y));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
|
||||
@@ -935,14 +1026,14 @@ void construct::done_tree(game *g, point p)
|
||||
|
||||
void construct::done_log(game *g, point p)
|
||||
{
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["log"], int(g->turn), rng(5, 15));
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("log"), int(g->turn), rng(5, 15));
|
||||
}
|
||||
|
||||
|
||||
void construct::done_vehicle(game *g, point p)
|
||||
{
|
||||
std::string name = string_input_popup("Enter new vehicle name", 20);
|
||||
vehicle *veh = g->m.add_vehicle (g, veh_custom, p.x, p.y, 270);
|
||||
vehicle *veh = g->m.add_vehicle (g, veh_custom, p.x, p.y, 270, 0, 0);
|
||||
if (!veh)
|
||||
{
|
||||
debugmsg ("error constructing vehicle");
|
||||
@@ -977,34 +1068,35 @@ void construct::done_deconstruct(game *g, point p)
|
||||
case t_makeshift_bed:
|
||||
case t_bed:
|
||||
case t_armchair:
|
||||
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.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 9);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("rag"), 0, 9);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("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.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.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 3);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,12));
|
||||
g->m.ter_set(p.x, p.y, t_door_frame);
|
||||
break;
|
||||
case t_window_domestic:
|
||||
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.spawn_item(p.x, p.y, item_controller->find_template("stick"), 0);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("sheet"), 0, 1);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("glass_sheet"), 0);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, 3);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("string_36"), 0, 0, 1);
|
||||
g->m.ter_set(p.x, p.y, t_window_empty);
|
||||
break;
|
||||
|
||||
case t_window:
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["glass_sheet"], 0);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("glass_sheet"), 0);
|
||||
g->m.ter_set(p.x, p.y, t_window_empty);
|
||||
break;
|
||||
|
||||
case t_backboard:
|
||||
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.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 4);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,10));
|
||||
g->m.ter_set(p.x, p.y, t_pavement);
|
||||
break;
|
||||
|
||||
@@ -1012,55 +1104,67 @@ void construct::done_deconstruct(game *g, point p)
|
||||
case t_bench:
|
||||
case t_crate_o:
|
||||
case t_crate_c:
|
||||
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.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 4);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("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.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));
|
||||
case t_bulletin:
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 4);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,10));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_slide:
|
||||
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.spawn_item(p.x, p.y, item_controller->find_template("sheet_metal"), 0);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("pipe"), 0, rng(4,8));
|
||||
g->m.ter_set(p.x, p.y, t_grass);
|
||||
break;
|
||||
|
||||
case t_locker:
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("sheet_metal"), 0);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("pipe"), 0, rng(4,8));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_rack:
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("pipe"), 0, rng(6,12));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_monkey_bars:
|
||||
g->m.spawn_item(p.x, p.y, g->itypes["pipe"], 0, rng(6,12));
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("pipe"), 0, rng(6,12));
|
||||
g->m.ter_set(p.x, p.y, t_grass);
|
||||
break;
|
||||
|
||||
case t_fridge:
|
||||
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.spawn_item(p.x, p.y, item_controller->find_template("scrap"), 0, rng(2,6));
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("steel_chunk"), 0, rng(2,3));
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("hose"), 0, 1);
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_counter:
|
||||
case t_dresser:
|
||||
case t_table:
|
||||
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.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 6);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,8));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_pool_table:
|
||||
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.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 4);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("rag"), 0, 4);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,10));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
|
||||
case t_bookcase:
|
||||
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.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 12);
|
||||
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(12,16));
|
||||
g->m.ter_set(p.x, p.y, t_floor);
|
||||
break;
|
||||
}
|
||||
|
||||
+2
-2
@@ -8,8 +8,8 @@ struct construction_stage
|
||||
{
|
||||
ter_id terrain;
|
||||
int time; // In minutes, i.e. 10 turns
|
||||
std::vector<component> tools[3];
|
||||
std::vector<component> components[3];
|
||||
std::vector<component> tools[10];
|
||||
std::vector<component> components[10];
|
||||
|
||||
construction_stage(ter_id Terrain, int Time) :
|
||||
terrain (Terrain), time (Time) { };
|
||||
|
||||
+882
-2199
File diff suppressed because it is too large
Load Diff
+21
-22
@@ -3,61 +3,57 @@
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include "itype.h"
|
||||
#include "skill.h"
|
||||
#include "rng.h"
|
||||
|
||||
#define MAX_DISPLAYED_RECIPES 18
|
||||
|
||||
enum craft_cat {
|
||||
CC_NULL = 0,
|
||||
CC_WEAPON,
|
||||
CC_AMMO,
|
||||
CC_FOOD,
|
||||
CC_DRINK,
|
||||
CC_CHEM,
|
||||
CC_ELECTRONIC,
|
||||
CC_ARMOR,
|
||||
CC_MISC,
|
||||
CC_NONCRAFT,
|
||||
NUM_CC
|
||||
};
|
||||
typedef std::string craft_cat;
|
||||
|
||||
struct component
|
||||
{
|
||||
itype_id type;
|
||||
int count;
|
||||
component() { type = "null"; count = 0; }
|
||||
component(itype_id TYPE, int COUNT) : type (TYPE), count (COUNT) {}
|
||||
int available; // -1 means the player doesn't have the item, 1 means they do,
|
||||
// 0 means they have item but not enough for both tool and component
|
||||
component() { type = "null"; count = 0; available = -1;}
|
||||
component(itype_id TYPE, int COUNT) : type (TYPE), count (COUNT), available(-1) {}
|
||||
};
|
||||
|
||||
struct recipe {
|
||||
std::string ident;
|
||||
int id;
|
||||
itype_id result;
|
||||
craft_cat category;
|
||||
craft_cat cat;
|
||||
Skill *sk_primary;
|
||||
Skill *sk_secondary;
|
||||
int difficulty;
|
||||
int time;
|
||||
bool reversible; // can the item be disassembled?
|
||||
bool autolearn; // do we learn it just by leveling skills?
|
||||
int learn_by_disassembly; // what level (if any) do we learn it by disassembly?
|
||||
|
||||
std::vector<component> tools[20];
|
||||
std::vector<component> components[20];
|
||||
std::vector<std::vector<component> > tools;
|
||||
std::vector<std::vector<component> > components;
|
||||
|
||||
recipe() {
|
||||
id = 0;
|
||||
result = "null";
|
||||
category = CC_NULL;
|
||||
sk_primary = NULL;
|
||||
sk_secondary = NULL;
|
||||
difficulty = 0;
|
||||
time = 0;
|
||||
reversible = false;
|
||||
autolearn = false;
|
||||
}
|
||||
|
||||
recipe(int pid, itype_id pres, craft_cat cat, const char *p1, const char *p2,
|
||||
int pdiff, int ptime, bool preversible) :
|
||||
id (pid), result (pres), category (cat), difficulty (pdiff), time (ptime), reversible (preversible)
|
||||
recipe(std::string pident, int pid, itype_id pres, craft_cat pcat, const char *p1,
|
||||
const char *p2, int pdiff, int ptime, bool preversible, bool pautolearn,
|
||||
int plearn_dis) :
|
||||
ident (pident), id (pid), result (pres), cat(pcat), difficulty (pdiff), time (ptime),
|
||||
reversible (preversible), autolearn (pautolearn), learn_by_disassembly (plearn_dis)
|
||||
{
|
||||
sk_primary = p1?Skill::skill(p1):NULL;
|
||||
sk_secondary = p2?Skill::skill(p2):NULL;
|
||||
@@ -65,4 +61,7 @@ recipe(int pid, itype_id pres, craft_cat cat, const char *p1, const char *p2,
|
||||
};
|
||||
|
||||
|
||||
typedef std::vector<recipe*> recipe_list;
|
||||
typedef std::map<craft_cat, recipe_list> recipe_map;
|
||||
|
||||
#endif
|
||||
|
||||
+24
-16
@@ -28,10 +28,10 @@ terminated.
|
||||
%
|
||||
Tests on the prehistoric fauna show extremely close genetic relationships with
|
||||
extant and extinct terranian animals. It might be that the portal had performed
|
||||
a transposition in time, unfortunately the portal device had been destroyed
|
||||
when security had put down the fauna.
|
||||
a transposition in time, unfortunately the portal device was destroyed when
|
||||
security put down the fauna.
|
||||
%
|
||||
An incident occured in the teleportation lab, wherein a subject managed to
|
||||
An incident occurred in the teleportation lab, wherein a subject managed to
|
||||
teleport into another subject. The latter was completely destroyed from the
|
||||
inside out, while the former sustained little damage. I would like to explore
|
||||
the phenomenon further, but subjects are expensive.
|
||||
@@ -46,10 +46,10 @@ tunnels along the 4th dimension, allowing life forms to transfer to this
|
||||
plane. All subjects with prolonged exposure have been terminated.
|
||||
%
|
||||
Our lifeform extraction program continues to produce samples of specimen
|
||||
XE037. It seems to be a kind of living, semi-sentient primordal ooze, and is
|
||||
XE037. It seems to be a kind of living, semi-sentient primordial ooze, and is
|
||||
the basis of much of the life we have found.
|
||||
%
|
||||
Specimen XE037, jokingly referred to as "the blob," has been observed entering
|
||||
Specimen XE037, jokingly referred to as "the blob", has been observed entering
|
||||
a kind of dormant state, forming a depression in the floor. Hendelson stepped
|
||||
into one of these pits yesterday, and was immediately coated and attacked.
|
||||
%
|
||||
@@ -81,7 +81,7 @@ the surface, particularly in the sewage systems.
|
||||
%
|
||||
Today we applied a very small sample of XE037, suspended in water, to subject
|
||||
TP92, prior to necessary termination. During the postmortem examination, the
|
||||
subject went through a revivication progress, but displayed next to no human
|
||||
subject went through a revivification progress, but displayed next to no human
|
||||
intelligence.
|
||||
%
|
||||
Mendelson shows a dismaying lack of organization and security consciousness.
|
||||
@@ -109,7 +109,7 @@ in the insects, and security intervention was required.
|
||||
%
|
||||
Program S37ZBE, investigation of XE037 on inert human bodies, is making great
|
||||
strides. Recently we found that XE037 has no effect when introduced to a
|
||||
deceased body; revivication only occurs when the subject is exposed to XE037
|
||||
deceased body; revivification only occurs when the subject is exposed to XE037
|
||||
prior to expiration.
|
||||
%
|
||||
S37ZBE, the special investigation into the effects of XE037 on inert human
|
||||
@@ -117,32 +117,32 @@ bodies, has made terrific discoveries. It seems that it occasionally displays
|
||||
a mutagenic property which manifests itself after termination of the subject,
|
||||
resulting in a striking variety in postmortem morphology.
|
||||
%
|
||||
S37ZBE may be put on indefinate hold shortly. Postmortem morphological
|
||||
S37ZBE may be put on indefinite hold shortly. Postmortem morphological
|
||||
changes have reached extreme levels; this morning one subject nearly doubled
|
||||
in size, acquiring enough strength to reduce a concrete wall to rubble. It
|
||||
required a 6 man team, heavily armed, to re-terminate the subject.
|
||||
%
|
||||
Jakobson insists that S37ZBE must continue, despite the extreme security and
|
||||
safety risks. Nearly half our security forces have been redirected to the
|
||||
project, simply to deal with the occasional escape of a subject.
|
||||
safety risks. Nearly half of our security forces have been redirected to the
|
||||
S37ZBE project, simply to deal with the occasional escape of a subject.
|
||||
%
|
||||
Jakobson was killed today by one of S37ZBE's subjects; ironic considering how
|
||||
hard he fought to keep the project active. Alarmingly, his corpse revivified
|
||||
immediately. This suggests that XE037 may have contaminated the lab at large.
|
||||
%
|
||||
Termination of a subject which was never a part of S37ZBE has confirmed my
|
||||
fears. XE037 has contaminated most if not all of the laboratory, most likely
|
||||
via the water supply. Research has started immediately into a process to
|
||||
destroy XE037 within the human body.
|
||||
fears. XE037 has contaminated most, if not all of the laboratory, most
|
||||
likely via the water supply. Research has started immediately into a process
|
||||
to destroy XE037 within the human body.
|
||||
%
|
||||
Despite a wide variety of treatments, we have been completely unsuccessful in
|
||||
removing XE037 from human subjects. Every individual displayed revivication
|
||||
removing XE037 from human subjects. Every individual displayed revivification
|
||||
post termination. Interestingly, XE037 seems to be completely inert prior to
|
||||
termination.
|
||||
%
|
||||
We have finally found success in S37BEP, our emergency investigation into the
|
||||
destruction of XE037 in living subjects. 8 of 10 of the subjects showed no
|
||||
revivication, despite confirmed dosages of XE037.
|
||||
revivification, despite confirmed dosages of XE037.
|
||||
%
|
||||
PE062, our "cure" for XE037 contamination, has neared perfection. Sadly, the
|
||||
production of PE062 is a costly and time-consuming process. What is more, the
|
||||
@@ -155,7 +155,7 @@ half mile from the laboratory. It is unclear how it escaped; it is quite
|
||||
possible that it is in the ground water now.
|
||||
%
|
||||
An emergency meeting was held today to discuss the possible implications of
|
||||
widespread XE037 contamination. It was agreed that neturalization must be
|
||||
widespread XE037 contamination. It was agreed that neutralization must be
|
||||
instated immediately to prevent a catastrophic event.
|
||||
%
|
||||
It has begun. The XE037 contamination has spread for miles, and those who
|
||||
@@ -163,6 +163,14 @@ have since deceased have revivified. It is my fear that extremely large
|
||||
populations will be decimated by this pandemic. We must find a way to remove
|
||||
XE037 from revivified bodies.
|
||||
%
|
||||
We have even more distressing news than the widespread XE037 contamination,
|
||||
there are reports of the XE037 mutating into various new variants. See
|
||||
data files on XE037a - XE037f. Research on the effects of these variants
|
||||
is ongoing. We do know that XE037d shows signs of PE062 immunity, and
|
||||
XE037b can revive various breeds of canines. However, revival is not
|
||||
as guaranteed as standard XE037 humanoid infection. Canine body size seems
|
||||
to influence the chances. See experiment tXE037b_c.
|
||||
%
|
||||
Today we found our solution, quite by accident. It was found that XE037 is
|
||||
completely removed from a revivified body following a series of extremely-high
|
||||
energy 4th dimensional transpositions. Unfortunately, this invariably allows
|
||||
|
||||
+274
-4
@@ -1,5 +1,275 @@
|
||||
Changelog will be a little light for the early entries due to me being really bad at documenting things.
|
||||
|
||||
|
||||
0.6
|
||||
|
||||
Highlights:
|
||||
---
|
||||
* Some work to make vehicle collisions sane.
|
||||
* Zombies will revive after a time, if not butchered (or otherwise dealt with).
|
||||
* The Android trait now behaves the way that the description indicates.
|
||||
* Gasoline can be siphoned from vehicles. Requires a rubber hose for now - these are easier to acquire.
|
||||
* Sewing requires materials other than thread - rags for cloth, leather patches for leather.
|
||||
* Leather repair/reinforcement actually possible!
|
||||
* Inventory management UI improvements, and a new screen to organize worn items.
|
||||
* NPCs continue to be less buggy, but are still prone to crashes.
|
||||
* Weapon firing code reworked a bit. UI improvements, and you should now be able to fire at anything within range.
|
||||
* Reworked the armor/protection code.
|
||||
* Reworked the learning system: replaced XP with Focus. See the relevant help text.
|
||||
* Added a bunch of new missions, for those who play with the shelter NPC turned on.
|
||||
* Vehicle collision physics are now based on *actual* physics! Reduces collision insanity.
|
||||
* As usual, many bugfixes.
|
||||
|
||||
Full list:
|
||||
---
|
||||
Purifier no longer removes traits available at chargen.
|
||||
Fix some calculations that wanted floating-point math, and were using integer math.
|
||||
Fix some vehicle collision craziness related to skids.
|
||||
Added zombie revival. Chance of unbutchered zombie corpses rezzing, once 6 hours have passed.
|
||||
Advanced inventory UI improvements/fixes.
|
||||
Dropping count-by-charge items (batteries, meds, etc.) into vehicles will cause restacking.
|
||||
Android trait always gives a power system bionic.
|
||||
Fix torso encumbrance display (it's smart about sign use now).
|
||||
Bitmask-based item flags no longer exist! Instead, we have string-based tags, that have no upper limit.
|
||||
Tweaked glowstick behavior - can no longer deactivate, and they have a dead state.
|
||||
Android trait should no longer give the player faulty bionics.
|
||||
Bolts moved to ammo category, like arrows.
|
||||
Added bone broth, and recipe.
|
||||
Adjust how Climate Control bionic works, make vehicles have functioning (magic!) AC.
|
||||
Added fuel siphoning using rubber hose.
|
||||
Appearance-improving mutations are now flagged as being good mutations.
|
||||
Welder charges are actually used during vehicle construction.
|
||||
Items will no longer become erroneously fitted, and item tags should not spread during map loading.
|
||||
Weather accounts for starting time properly.
|
||||
Containers can be unloaded again (they were bugged).
|
||||
Optimized scentmap updates, hopefully this speeds up certain activities.
|
||||
Pit-requiring constructions have pit digging as their first two stages, to make it more obvious what the prereqs are.
|
||||
Some menus (notably, inventory) can be navigated with arrow keys and enter.
|
||||
Allowing sewing of leather items, make sewing require rags/patches.
|
||||
Cooking rotten food does not make it magically fresh any more (but it does make it slightly less rotten).
|
||||
Resolves an issue where destroying an item while tailoring would crash the game.
|
||||
New UI to sort clothing and automatically assign special characters to clothing (accessed via +)
|
||||
Footwear warmth values tweaked to be more flexible.
|
||||
Wool warmth is not reduced by rain.
|
||||
Sofas and armchairs help with sleeping.
|
||||
Temperature is less of an issue while sleeping.
|
||||
Warning messages for when the player is cold/hot while sleeping.
|
||||
Oversized clothing can be worn over anything (blankets, cloaks, etc).
|
||||
Sound interruptions can be categorically ignored while crafting, reading, etc.
|
||||
More improvements to the advanced inventory UI.
|
||||
Shrubs less difficult to smash.
|
||||
Upgraded versions of Fast Healer still give you bonuses while sleeping.
|
||||
Soldering iron recipe learnable via disassembly.
|
||||
Integrated toolset power usage normalized on a few recipes.
|
||||
Vehicle speed is now taken into account when throwing a character that exits a moving vehicle.
|
||||
Gasoline lanterns added to the game.
|
||||
Bifocal glasses added to the game.
|
||||
Tweak Windows (catacurse) colors.
|
||||
Correct window border color behavior under Windows.
|
||||
Add glass jars, make sauces spawn in them instead of in tin cans.
|
||||
Removed a couple NPC crash bugs.
|
||||
You can safely exit a vehicle moving less than 1 MPH.
|
||||
Fix a pair of drawing glitches related to the item pickup window.
|
||||
Remove the artificial delay when animating vehicle movement.
|
||||
Out-of-range enemies are still drawn when firing a weapon.
|
||||
Make it so that anything within range can be targeted with a ranged weapon.
|
||||
Disassembly recipe for vacuum sealer.
|
||||
Backspace no longer causes junk to be input during string entry.
|
||||
The overmap screen now lets you use "<" and ">" to view different z-levels.
|
||||
Reworked the armor/protection code.
|
||||
Fridges drop rubber hose instead of pipe when destroyed.
|
||||
Reworked the learning system: replaced XP with Focus. See the relevant help text.
|
||||
Autosave should save everything now, rather than a subset.
|
||||
Fix artifact saving/loading... again.
|
||||
Added new missions.
|
||||
Added cathedral to mapgen.
|
||||
Fixed flamethrowers.
|
||||
Add 40mm acid bomb shells.
|
||||
Moving furniture causes noise.
|
||||
Clothing damage descriptions now depend on the item's material.
|
||||
Gunmods now show "%" properly in the magazine size line.
|
||||
Add bicycle seats: low-mass seats that can't take a seatbelt.
|
||||
Vehicle collision physics are now based on *actual* physics! Reduces collision insanity.
|
||||
Foraging gives survival experience, even on failure.
|
||||
Disassembling ammo gives firearms experience.
|
||||
Ball bearings should hopefully drop now.
|
||||
Added headlights to a few more default vehicles.
|
||||
Lab coats can be fitted.
|
||||
Items in adjacent containers (fridges, lockers, etc.) visible with 'V' screen.
|
||||
Players can no longer examine sealed crates to see their contents.
|
||||
Funnels give acid water during acid rain :).
|
||||
Acid water (after refinement) now an alternate ingredient for acid bombs.
|
||||
Corrected a few item name typos.
|
||||
Cleaned up generation of a particular (spiral-y) underground room.
|
||||
More temperature tweaks.
|
||||
Being hot makes you MORE thirsty, not less.
|
||||
Reworked item unloading and reloading a bit to remove bugs.
|
||||
Flatbed trucks now have rear windows.
|
||||
Electric cars added as potential vehicle spawns.
|
||||
Fix some bugs related to known overmap data and leaking the state to other characters.
|
||||
Effects of current stats are shown on the '@' screen.
|
||||
Materials obtained from clothing depend on the clothing's damage level.
|
||||
Fixed some lab mapgen bugs.
|
||||
Mansions got a little love.
|
||||
Having too little intelligence for a book is more of a penalty.
|
||||
Vehicle headlight state is persistent after save-load.
|
||||
|
||||
|
||||
======
|
||||
|
||||
0.5
|
||||
|
||||
Highlights:
|
||||
---
|
||||
* Many new details added to mapgen! New buildings, ruined vehicles on roads, and so on.
|
||||
* Much more modding-friendly: MANY bits of data have been moved into data files, rather than being hardcoded in the source.
|
||||
* A handful of recipes can be learned from sources other than just leveling your skills.
|
||||
* Artifacts should save/load properly now!
|
||||
* Assorted UI tweaks and improvements.
|
||||
* Weather radio and directional antenna.
|
||||
* Rain funnels - first step towards proper rain barrels.
|
||||
* Robust Genetics and dodging have both been significantly rebalanced, and should actually be useful.
|
||||
* Zombies wear damaged clothing.
|
||||
* Tailoring is more important, and string is easier to acquire.
|
||||
* New content all around!
|
||||
* Numerous bugfixes.
|
||||
|
||||
|
||||
Full list:
|
||||
---
|
||||
Matches usable anywhere lighters could be used previously.
|
||||
Draw lit areas outside of LOS and normal sight radius the same as unlit areas
|
||||
Tell the player when their gear is damaged in combat
|
||||
Display player feat morale boosts
|
||||
Pickling/canning
|
||||
Only rust skill if X turns have passed since practice, not every x turns.
|
||||
Halve rate of skill rust across the board.
|
||||
Push crafting recipes out to JSON - now moddable without recompiling!
|
||||
Acid rain causes pain not injury
|
||||
Changed default viewmorale key to v
|
||||
Learn crafting recipes from item disassembly or books.
|
||||
New Hardcore trait
|
||||
Other new traits: Skilled Liar, Pretty, Beautiful, Very Beautiful, Glorius (cancels truth-teller, ugly mutations)
|
||||
Set minimum move to 25
|
||||
Death by starvation or thirst
|
||||
New professions: tailor, scoundrel
|
||||
Adjusted conditions for cutting and stabbing skill practice (should be able to practice piercing now)
|
||||
Code compiles with no warnings. No user-visible change, but important stability milestone.
|
||||
Added a craftable power armor power interface CBM, solar panels.
|
||||
Continuous reading.
|
||||
New mixed drinks
|
||||
A new book; "To Serve Man"
|
||||
Glowsticks, found in sporting goods stores and bedrooms.
|
||||
Broken and Empty windows can no longer be taped up, alarmed windows can.
|
||||
Palisade walls changed to require 2 6foot ropes rather than one thirty foot one.
|
||||
Domestic Windows drop strings now (Those are the kind that can be opened)
|
||||
String can be made from sinew and plant fibre.
|
||||
Added blankets, fur blankets (craft only), emergency blankets, sleeping bags, fur sleeping bags (craft only).
|
||||
Added house coat, snuggie, cloak, fur cloak (craft only), leather cloak (craft only).
|
||||
Added fur scarf, fur gloves, fur trenchcoat, fur pants, fur boots (all craft only).
|
||||
All tailoring items that use fur require survival as secondary skill.
|
||||
Added crafting recipes for bandana, blanket, house coat, cloak.
|
||||
Weather radio
|
||||
Radios are tuneable, so you can receive from more than one station without moving.
|
||||
New item that doubles battery capacity of tools, recipe learn from certain electronics books.
|
||||
Bugfix: reduced chance of "Tried to kill monster" debug s pam.
|
||||
Bugfix: reduced chance of "Stopping out-of-map vehicle" spam.
|
||||
Bugfix: can unload liquids into items wielded in hands (e.g., steel jerrycans).
|
||||
Bionics screen shows current and maximum power.
|
||||
Escape key usable to exit out of more menus.
|
||||
Multidrop screen continually updates to show new potential weight/volume.
|
||||
Bugfix: longbow should not end up loaded while in inventory, and can be fired if it does.
|
||||
Backpacks, messenger bags, etc. can be repaired via sewing kits.
|
||||
Add fire drill as a survivalcraft firestarter (trickier and slower than lighter/matches).
|
||||
Furry mutation provides warmth, Bark mutation protects from fire.
|
||||
Removed/reduced a lot of spam messages related to being hot or cold.
|
||||
Sleeping should be easier in the cold (decreased chances of waking up).
|
||||
Being too hot can now wake you up.
|
||||
Inreased the amount fo heat generated by the player while awake.
|
||||
Tweaked hunger and fatigue's contribution to body temperature.
|
||||
More traits and mutations have body temperature effects.
|
||||
Fix artifact saving and loading.
|
||||
Multiple building additions in town and in the countryside.
|
||||
Support for 2x2 and 3x3 buildings.
|
||||
Temporary fix to decrease the number of large structures with roads running through them.
|
||||
Items can only be set on fire if it would affect them (no more burning sheets infinitely).
|
||||
Looking around at items (with "V") has a few improvements.
|
||||
Soldering irons give heating elements when disassembled, tweak numbers for hotplates and water purifiers.
|
||||
Advanced inventory management screen, default keymap "/". Lets you interact with adjacent tiles.
|
||||
Roadmap is made of paper.
|
||||
Removed RV kitchen units from some spawn locations.
|
||||
Backend: made it much easier to define pre-built locations. Responsible for a lot of the new building types.
|
||||
Increased the quench value of clean water.
|
||||
Early-game survivalist stabbing weapon is now pointy stick. Wood spear is higher level.
|
||||
You can now read using torches and other items.
|
||||
Addictions can be configured explicitly in the professions file.
|
||||
Tweak crossbow trap drops.
|
||||
Made several UI screens smarter (resize to fit screen, esc can exit, etc.).
|
||||
Show nearby map notes on the minimap.
|
||||
Some item types can be defined from data files now! So far: misc/melee, armor, guns, ammo, tools, gun mods, books
|
||||
Glasses can be worn with power armor.
|
||||
Added several new constructions.
|
||||
Power use of integrated toolset has been rebalanced.
|
||||
Armor CBMs have had drawbacks removed.
|
||||
Rain coats can be made from plastic bags.
|
||||
Fursuits.
|
||||
Work to make NPCs less buggy.
|
||||
Nuclear missile fixes.
|
||||
Tweaked steel recycler behavior.
|
||||
Autosaves take into account the passage of real-world time.
|
||||
Placable funnel that collects some water while raining.
|
||||
Characters with the Android trait no longer get unimplemented bionics.
|
||||
Added several new options.
|
||||
NPC spawning is toggled with the in-game options menu rather than a text file hack.
|
||||
Added more wildlife (coyotes, cats, etc.).
|
||||
Robust Genetics trait heavily buffed.
|
||||
Change how overmap tile data is saved, to allow for more terrain types and buildings.
|
||||
Add high-capacity power storage CBM.
|
||||
Add some new magazines and entertainment books.
|
||||
Blisters no longer lower max HP (at least until the system is more fleshed out).
|
||||
Cannibal trait has been rebalanced, as well as morale effects of eating human flesh.
|
||||
Added cookbook for Italian recipes.
|
||||
Sewing now requires an adequate source of light.
|
||||
New health display for non-Self Aware characters, accurate to 1/10th max HP rather than 1/4th.
|
||||
Targeting window (when throwing/firing weapons) has been reorganized.
|
||||
Directional antennas!
|
||||
Gas pumps have been rebalanced (less fragile when filling vehicles, more fragile when filling containers).
|
||||
Added sling, slingshot, and associated ammunition.
|
||||
Gas stations can spawn next to highways.
|
||||
Large creatures are more likely to leave a corpse when taking high damage.
|
||||
Add flavor items with variable descriptions to the game (fliers and such).
|
||||
Some guns have range modifiers independent of their ammo. Buffed coilgun range.
|
||||
Add limb torsion ratchet bionic, generates power when moving.
|
||||
Desks don't spawn outside any more.
|
||||
The option to delete your world on character death actually works now!
|
||||
Tweaked projectile/glass interaction, stopped leaping monsters from phasing through windows.
|
||||
Debug menu changes.
|
||||
Made it possible to build indoor furniture in more situations.
|
||||
Updated readme, added contributing guidelines.
|
||||
Stopped small animals from suiciding, in many cases (e.g., broken windows and landmines).
|
||||
Add a few hats. No, not TF2-style.
|
||||
Artifacts will successfully save and load now!
|
||||
Adjusted monster spawning mechanics to reduce the chance of swarms of difficult zombies.
|
||||
Stop roads from going through buildings so often.
|
||||
Pits less awkward to board over (can use nearby items).
|
||||
Tweak glass bottle weight/volume.
|
||||
Allow for reading/sewing in the dark through mutations/CBM's with a speed penalty.
|
||||
Rewrote dodge abilities to have a noticeable impact.
|
||||
Mansion pools are considered indoors now.
|
||||
Tires can be changed with a wrench and a jack.
|
||||
Add game logic to handle recipes that take the same item as a component and a tool, and add UI to alert the player.
|
||||
Improve rendering in the main Windows port - animations should display better.
|
||||
Cave-ins cause damaging rubble to fall.
|
||||
Improve fuel guage display in the vehicle examination window.
|
||||
Overmap notes blink again.
|
||||
Space and tab should be available for keymaps.
|
||||
Hitting the "pause"/"skip turn" button will let you cancel reading, crafting, and other long-term actions.
|
||||
Special road spawns should not happen on bridges.
|
||||
Ruined vehicles spawn on roads.
|
||||
Zombies wear damaged clothing.
|
||||
Nighttime lights are visible from reasonable distances now.
|
||||
|
||||
======
|
||||
|
||||
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.
|
||||
@@ -16,7 +286,7 @@ Vehicle-mountable water tanks and kitchen units, implied storage-battery-chargin
|
||||
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.
|
||||
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.
|
||||
@@ -25,7 +295,7 @@ Standing in water or sewage will increase the rate of heat loss (but not make th
|
||||
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.
|
||||
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.
|
||||
@@ -35,7 +305,7 @@ 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.
|
||||
|
||||
+1
-1
@@ -13,4 +13,4 @@ BurnZeZ, Oddzball, Shades, Shoes01, Tase, GalenEvil
|
||||
Contributors:
|
||||
AkrionXxarr, Benjamg, Creidieki, Daftfad, Elricsfate, Gim,
|
||||
GlyphGryph, Gremour, HerbertJones, hovatterz, Origamiwolf,
|
||||
Soron, Uzername, Voker57, Wito
|
||||
Soron, Uzername, Voker57, Wito, i2amroy
|
||||
|
||||
@@ -1,10 +1,9 @@
|
||||
# This message may be 16 lines long at maximum.
|
||||
# Max length of a line is 68 characters; the following line is for reference
|
||||
####################################################################
|
||||
New features v0.3:
|
||||
Reduced sight range of monsters. Monster bites and infections.
|
||||
A bunch of new survival craft.
|
||||
Fixes, fixes and more fixes.
|
||||
New features v0.5:
|
||||
* Todo
|
||||
* Fixes, fixes and more fixes.
|
||||
|
||||
For latest discussions and news on Cataclysm DDA, please visit:
|
||||
|
||||
@@ -14,5 +13,6 @@ Wiki: http://wiki.cataclysmdda.com/
|
||||
|
||||
The game now has new configurable options:
|
||||
Customizeable Viewport, Spawntype: Classic/Static, Starting time
|
||||
Static NPCs, Randomly spawning NPCs, Seasons
|
||||
|
||||
Ingame you can access the options via the help menu (?2).
|
||||
|
||||
@@ -1,18 +0,0 @@
|
||||
# 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,16 @@
|
||||
[
|
||||
{ "id":"TEST",
|
||||
"items":[
|
||||
["GUITAR", 400],
|
||||
["DRUM", 300],
|
||||
["HATCHET", 200]
|
||||
],
|
||||
"groups":[
|
||||
["NOTHING", 200]
|
||||
]
|
||||
},
|
||||
{ "id":"NOTHING",
|
||||
"default_item": "MISSING_ITEM"
|
||||
}
|
||||
|
||||
]
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,33 @@
|
||||
[
|
||||
{ "id":"GUITAR",
|
||||
"symbol": "$",
|
||||
"color": "red",
|
||||
"name":"Guitar",
|
||||
"description":"An acoustic six-string guitar. A bit out of tune, but in good shape otherwise.",
|
||||
"rarity": 60,
|
||||
"material": "WOOD",
|
||||
"weight": 13,
|
||||
"volume": 24,
|
||||
"damage": 14,
|
||||
"to_hit": 1,
|
||||
"use": "PLAY_GUITAR",
|
||||
"variations": [
|
||||
{ "odds" : 200,
|
||||
"name" : "Specific Variation"
|
||||
}
|
||||
]
|
||||
},
|
||||
{ "id":"DRUM",
|
||||
"symbol": "o",
|
||||
"color": "green",
|
||||
"name":"Bongo",
|
||||
"description": "A handheld drum. Suitable for making loud noises into all hours of the night.",
|
||||
"rarity": 60,
|
||||
"material": ["WOOD", "STEEL"],
|
||||
"weight": 10,
|
||||
"volume": 10,
|
||||
"damage": 11,
|
||||
"to_hit": 1,
|
||||
"use": "PLAY_DRUM"
|
||||
}
|
||||
]
|
||||
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,589 @@
|
||||
[
|
||||
{ "id":"retool_45",
|
||||
"type": "GUNMOD",
|
||||
"symbol": ":",
|
||||
"color": "green",
|
||||
"name":".45 caliber retool",
|
||||
"description":"Replacing several key parts of a 9mm, .38, .40 or .44 firearm converts it to a .45 firearm. The conversion results in reduced accuracy and increased recoil.",
|
||||
"rarity": 3,
|
||||
"price": 480,
|
||||
"material": "STEEL",
|
||||
"weight": 2,
|
||||
"volume": 2,
|
||||
"bashing": 3,
|
||||
"cutting": 0,
|
||||
"to_hit": -1,
|
||||
"accuracy_modifier": 2,
|
||||
"damage_modifier": 0,
|
||||
"loudness_modifier": 0,
|
||||
"ammo_modifier": ".45",
|
||||
"recoil_modifier": 2,
|
||||
"burst_modifier": 0,
|
||||
"clip_size_modifier": 0,
|
||||
"mod_targets": ["pistol", "smg"],
|
||||
"acceptable_ammo": ["9MM", "38", "40", "44"]
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "suppressor",
|
||||
"name" : "suppressor",
|
||||
"clip_size_modifier" : 0,
|
||||
"accuracy_modifier" : -1,
|
||||
"damage_modifier" : -4,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "Using a suppressor is almost an imperative in zombie-infested regions. Gunfire is very noisy, and will attract predators. Its only drawback is a reduced muzzle velocity, resulting in less accuracy and damage.",
|
||||
"weight" : 1,
|
||||
"to_hit" : 2,
|
||||
"color" : "dark_gray",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "PLASTIC"],
|
||||
"mod_targets" : ["pistol", "smg", "rifle"],
|
||||
"volume" : 2,
|
||||
"bashing" : 3,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"rarity" : 15,
|
||||
"price" : 480,
|
||||
"loudness_modifier" : -25
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "grip",
|
||||
"name" : "enhanced grip",
|
||||
"clip_size_modifier" : 0,
|
||||
"accuracy_modifier" : 2,
|
||||
"damage_modifier" : 0,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "A grip placed forward on the barrel allows for greater control and accuracy. Aside from increased weight, there are no drawbacks.",
|
||||
"weight" : 1,
|
||||
"to_hit" : -1,
|
||||
"color" : "brown",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "PLASTIC"],
|
||||
"mod_targets" : ["shotgun", "smg", "rifle"],
|
||||
"volume" : 1,
|
||||
"bashing" : 0,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : 0,
|
||||
"recoil_modifier" : -2,
|
||||
"rarity" : 12,
|
||||
"price" : 280,
|
||||
"loudness_modifier" : 0
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "barrel_big",
|
||||
"name" : "barrel extension",
|
||||
"clip_size_modifier" : 0,
|
||||
"accuracy_modifier" : 6,
|
||||
"damage_modifier" : 1,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "A longer barrel increases the muzzle velocity of a firearm, contributing to both accuracy and damage. However, the longer barrel tends to vibrate after firing, greatly increasing recoil.",
|
||||
"weight" : 1,
|
||||
"to_hit" : 2,
|
||||
"color" : "light_gray",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"mod_targets" : ["smg", "rifle"],
|
||||
"volume" : 4,
|
||||
"bashing" : 5,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : 0,
|
||||
"recoil_modifier" : 5,
|
||||
"rarity" : 10,
|
||||
"price" : 400,
|
||||
"loudness_modifier" : 0
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "barrel_small",
|
||||
"name" : "shortened barrel",
|
||||
"clip_size_modifier" : 0,
|
||||
"accuracy_modifier" : -5,
|
||||
"damage_modifier" : 0,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "A shortened barrel results in markedly reduced accuracy, and a minor increase in noise, but also reduces recoil greatly as a result of the improved managability of the firearm.",
|
||||
"weight" : 1,
|
||||
"to_hit" : -1,
|
||||
"color" : "light_gray",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"mod_targets" : ["smg", "rifle"],
|
||||
"volume" : 1,
|
||||
"bashing" : -2,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : 0,
|
||||
"recoil_modifier" : -6,
|
||||
"rarity" : 6,
|
||||
"price" : 320,
|
||||
"loudness_modifier" : 2
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "barrel_rifled",
|
||||
"name" : "rifled barrel",
|
||||
"clip_size_modifier" : 0,
|
||||
"accuracy_modifier" : 10,
|
||||
"damage_modifier" : -20,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "Rifling a shotgun barrel is mainly done in order to improve its accuracy when firing slugs. The rifling makes the gun less suitable for shot, however.",
|
||||
"weight" : 1,
|
||||
"to_hit" : 1,
|
||||
"color" : "light_gray",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"mod_targets" : ["shotgun"],
|
||||
"volume" : 2,
|
||||
"bashing" : 3,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : -1,
|
||||
"recoil_modifier" : 0,
|
||||
"rarity" : 5,
|
||||
"price" : 220,
|
||||
"loudness_modifier" : 0
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "clip",
|
||||
"name" : "extended magazine",
|
||||
"clip_size_modifier" : 50,
|
||||
"accuracy_modifier" : -1,
|
||||
"damage_modifier" : 0,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "Increases the ammunition capacity of your firearm by 50%, but the added bulk reduces accuracy slightly.",
|
||||
"weight" : 1,
|
||||
"to_hit" : -1,
|
||||
"color" : "light_gray",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "PLASTIC"],
|
||||
"mod_targets" : ["pistol", "shotgun", "smg", "rifle"],
|
||||
"volume" : 1,
|
||||
"bashing" : -2,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"rarity" : 8,
|
||||
"price" : 560,
|
||||
"loudness_modifier" : 0
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "clip2",
|
||||
"name" : "double magazine",
|
||||
"clip_size_modifier" : 100,
|
||||
"accuracy_modifier" : -2,
|
||||
"damage_modifier" : 0,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "Completely doubles the ammunition capacity of your firearm, but the added bulk reduces accuracy and increases recoil.",
|
||||
"weight" : 2,
|
||||
"to_hit" : 0,
|
||||
"color" : "light_gray",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "PLASTIC"],
|
||||
"mod_targets" : ["shotgun", "smg", "rifle"],
|
||||
"volume" : 2,
|
||||
"bashing" : 0,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : 0,
|
||||
"recoil_modifier" : 2,
|
||||
"rarity" : 4,
|
||||
"price" : 720,
|
||||
"loudness_modifier" : 0
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "spare_mag",
|
||||
"name" : "spare magazine",
|
||||
"clip_size_modifier" : 0,
|
||||
"accuracy_modifier" : 0,
|
||||
"damage_modifier" : 0,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "A spare magazine you can keep on hand to make reloads faster, but must itself be reloaded before it can be used again.",
|
||||
"weight" : 1,
|
||||
"to_hit" : 0,
|
||||
"color" : "light_gray",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "PLASTIC"],
|
||||
"mod_targets" : ["pistol", "shotgun", "smg", "rifle"],
|
||||
"volume" : 1,
|
||||
"bashing" : 0,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"rarity" : 15,
|
||||
"price" : 200,
|
||||
"loudness_modifier" : 0
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "stabilizer",
|
||||
"name" : "gyroscopic stabilizer",
|
||||
"clip_size_modifier" : -10,
|
||||
"accuracy_modifier" : 2,
|
||||
"damage_modifier" : -2,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "An advanced unit that straps onto the side of your firearm and reduces vibration, greatly reducing recoil and increasing accuracy. However, it also takes up space in the magazine slot, reducing ammo capacity.",
|
||||
"weight" : 2,
|
||||
"to_hit" : -3,
|
||||
"color" : "blue",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "PLASTIC"],
|
||||
"mod_targets" : ["smg", "rifle"],
|
||||
"volume" : 3,
|
||||
"bashing" : 0,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : 0,
|
||||
"recoil_modifier" : -8,
|
||||
"rarity" : 4,
|
||||
"price" : 680,
|
||||
"loudness_modifier" : 0
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "blowback",
|
||||
"name" : "rapid blowback",
|
||||
"clip_size_modifier" : 0,
|
||||
"accuracy_modifier" : -3,
|
||||
"damage_modifier" : 0,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "An improved blowback mechanism makes your firearm's automatic fire faster, at the cost of reduced accuracy and increased noise.",
|
||||
"weight" : 1,
|
||||
"to_hit" : 0,
|
||||
"color" : "red",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "PLASTIC"],
|
||||
"mod_targets" : ["smg", "rifle"],
|
||||
"volume" : 0,
|
||||
"bashing" : 0,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : 6,
|
||||
"recoil_modifier" : 0,
|
||||
"rarity" : 3,
|
||||
"price" : 700,
|
||||
"loudness_modifier" : 4
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "autofire",
|
||||
"name" : "auto-fire mechanism",
|
||||
"weight" : 2,
|
||||
"color" : "red",
|
||||
"burst_modifier" : 3,
|
||||
"loudness_modifier" : 2,
|
||||
"to_hit" : -1,
|
||||
"accuracy_modifier" : -2,
|
||||
"price" : 650,
|
||||
"clip_size_modifier" : 0,
|
||||
"description" : "A simple mechanism that converts a pistol to a fully-automatic weapon, with a burst size of three rounds. However, it reduces accuracy, and increases noise and recoil.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "PLASTIC"],
|
||||
"volume" : 1,
|
||||
"cutting" : 0,
|
||||
"recoil_modifier" : 2,
|
||||
"damage_modifier" : 0,
|
||||
"acceptable_ammo" : ["22", "9MM", "38", "40", "57", "46"],
|
||||
"mod_targets" : ["pistol"],
|
||||
"rarity" : 2,
|
||||
"bashing" : 2,
|
||||
"ammo_modifier" : "none"
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "retool_9mm",
|
||||
"name" : "9mm caliber retool",
|
||||
"weight" : 1,
|
||||
"color" : "green",
|
||||
"burst_modifier" : 0,
|
||||
"loudness_modifier" : 0,
|
||||
"to_hit" : -1,
|
||||
"accuracy_modifier" : -1,
|
||||
"price" : 420,
|
||||
"clip_size_modifier" : 0,
|
||||
"description" : "Replacing several key parts of a .38, .40, .44 or .45 firearm converts it to a 9mm firearm. The conversion results in a slight reduction in accuracy.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"volume" : 1,
|
||||
"cutting" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"damage_modifier" : 0,
|
||||
"acceptable_ammo" : ["38", "40", "44", "45"],
|
||||
"mod_targets" : ["pistol", "smg"],
|
||||
"rarity" : 3,
|
||||
"bashing" : 0,
|
||||
"ammo_modifier" : "9mm"
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "retool_22",
|
||||
"name" : ".22 caliber retool",
|
||||
"weight" : 1,
|
||||
"color" : "green",
|
||||
"burst_modifier" : 0,
|
||||
"loudness_modifier" : 0,
|
||||
"to_hit" : -1,
|
||||
"accuracy_modifier" : -1,
|
||||
"price" : 320,
|
||||
"clip_size_modifier" : 0,
|
||||
"description" : "Replacing several key parts of a 9mm, .38, .40, 5.7mm, 4.6mm, 7.62mm or .223 firearm converts it to a .22 firearm. The conversion results in a slight reduction in accuracy.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"volume" : 1,
|
||||
"cutting" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"damage_modifier" : 0,
|
||||
"acceptable_ammo" : ["9MM", "38", "40", "57", "46", "762", "223"],
|
||||
"mod_targets" : ["pistol", "smg", "rifle"],
|
||||
"rarity" : 2,
|
||||
"bashing" : -2,
|
||||
"ammo_modifier" : ".22"
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "retool_57",
|
||||
"name" : "5.7mm caliber retool",
|
||||
"weight" : 1,
|
||||
"color" : "green",
|
||||
"burst_modifier" : 0,
|
||||
"loudness_modifier" : 0,
|
||||
"to_hit" : -1,
|
||||
"accuracy_modifier" : -1,
|
||||
"price" : 460,
|
||||
"clip_size_modifier" : 0,
|
||||
"description" : "FN Hestal sells a conversion kit, used to convert .22, 9mm, or .38 firearms to their proprietary 5.7x28mm, a round designed for accuracy and armor penetration.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"volume" : 1,
|
||||
"cutting" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"damage_modifier" : 0,
|
||||
"acceptable_ammo" : ["22", "9MM", "38"],
|
||||
"mod_targets" : ["pistol", "smg"],
|
||||
"rarity" : 1,
|
||||
"bashing" : -3,
|
||||
"ammo_modifier" : "5.7mm"
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "retool_46",
|
||||
"name" : "4.6mm caliber retool",
|
||||
"weight" : 1,
|
||||
"color" : "green",
|
||||
"burst_modifier" : 0,
|
||||
"loudness_modifier" : 0,
|
||||
"to_hit" : -1,
|
||||
"accuracy_modifier" : -1,
|
||||
"price" : 460,
|
||||
"clip_size_modifier" : 0,
|
||||
"description" : "Heckler and Koch sells a conversion kit, used to convert .22, 9mm, or .38 firearms to their proprietary 4.6x30mm, a round designed for accuracy and armor penetration.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"volume" : 1,
|
||||
"cutting" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"damage_modifier" : 0,
|
||||
"acceptable_ammo" : ["22", "9MM", "38"],
|
||||
"mod_targets" : ["pistol", "smg"],
|
||||
"rarity" : 1,
|
||||
"bashing" : -3,
|
||||
"ammo_modifier" : "4.6mm"
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "retool_308",
|
||||
"name" : ".308 caliber retool",
|
||||
"weight" : 1,
|
||||
"color" : "green",
|
||||
"burst_modifier" : 0,
|
||||
"loudness_modifier" : 0,
|
||||
"to_hit" : 1,
|
||||
"accuracy_modifier" : -2,
|
||||
"price" : 520,
|
||||
"clip_size_modifier" : -20,
|
||||
"description" : "This kit is used to convert a shotgun or 7.62mm, .223 or .30-06 rifle to the popular and powerful .308 caliber. The conversion results in reduced ammo capacity and a slight reduction in accuracy.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"volume" : 2,
|
||||
"cutting" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"damage_modifier" : 0,
|
||||
"acceptable_ammo" : ["SHOT", "762", "223", "3006"],
|
||||
"mod_targets" : ["shotgun", "rifle"],
|
||||
"rarity" : 2,
|
||||
"bashing" : 4,
|
||||
"ammo_modifier" : ".308"
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "retool_223",
|
||||
"name" : ".223 caliber retool",
|
||||
"weight" : 1,
|
||||
"color" : "green",
|
||||
"burst_modifier" : 0,
|
||||
"loudness_modifier" : 0,
|
||||
"to_hit" : 1,
|
||||
"accuracy_modifier" : -2,
|
||||
"price" : 500,
|
||||
"clip_size_modifier" : -10,
|
||||
"description" : "This kit is used to convert a shotgun or 7.62mm, .30-06, or .308 rifle to the popular, accurate, and damaging .223 caliber. The conversion results in slight reductions in both accuracy and ammo capacity.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"volume" : 2,
|
||||
"cutting" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"damage_modifier" : 0,
|
||||
"acceptable_ammo" : ["SHOT", "762", "3006", "308"],
|
||||
"mod_targets" : ["shotgun", "rifle"],
|
||||
"rarity" : 2,
|
||||
"bashing" : 4,
|
||||
"ammo_modifier" : ".223"
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "conversion_battle",
|
||||
"name" : "battle rifle conversion",
|
||||
"clip_size_modifier" : 20,
|
||||
"accuracy_modifier" : -6,
|
||||
"damage_modifier" : 6,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "This is a complete conversion kit, designed to turn a rifle into a powerful battle rifle. It reduces accuracy, and increases noise and recoil, but also increases damage, ammo capacity, and fire rate.",
|
||||
"weight" : 3,
|
||||
"to_hit" : -1,
|
||||
"color" : "magenta",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"mod_targets" : ["rifle"],
|
||||
"volume" : 4,
|
||||
"bashing" : 6,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : 4,
|
||||
"recoil_modifier" : 4,
|
||||
"rarity" : 1,
|
||||
"price" : 680,
|
||||
"loudness_modifier" : 4
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "conversion_sniper",
|
||||
"name" : "sniper conversion",
|
||||
"clip_size_modifier" : -15,
|
||||
"accuracy_modifier" : 10,
|
||||
"damage_modifier" : 8,
|
||||
"ammo_modifier" : "none",
|
||||
"description" : "This is a complete conversion kit, designed to turn a rifle into a deadly sniper rifle. It decreases ammo capacity, and removes any automatic fire capabilities, but also increases accuracy and damage.",
|
||||
"weight" : 2,
|
||||
"to_hit" : -1,
|
||||
"color" : "green",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"mod_targets" : ["rifle"],
|
||||
"volume" : 1,
|
||||
"bashing" : 0,
|
||||
"cutting" : 0,
|
||||
"burst_modifier" : -99,
|
||||
"recoil_modifier" : 0,
|
||||
"rarity" : 1,
|
||||
"price" : 660,
|
||||
"loudness_modifier" : 3
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "m203",
|
||||
"name" : "M203",
|
||||
"weight" : 1,
|
||||
"color" : "light_red",
|
||||
"burst_modifier" : 0,
|
||||
"loudness_modifier" : 0,
|
||||
"to_hit" : -1,
|
||||
"accuracy_modifier" : -2,
|
||||
"price" : 650,
|
||||
"clip_size_modifier" : 1,
|
||||
"description" : "The M203 was originally designed for use with M16 variants but today can be attached to almost any rifle. It allows a single 40mm grenade to be loaded and fired.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"volume" : 2,
|
||||
"cutting" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"damage_modifier" : 0,
|
||||
"mod_targets" : ["rifle"],
|
||||
"rarity" : 2,
|
||||
"bashing" : 2,
|
||||
"flags" : ["MODE_AUX"],
|
||||
"ammo_modifier" : "40mm"
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "bayonet",
|
||||
"name" : "bayonet",
|
||||
"weight" : 2,
|
||||
"color" : "light_cyan",
|
||||
"burst_modifier" : 0,
|
||||
"loudness_modifier" : 0,
|
||||
"to_hit" : -3,
|
||||
"accuracy_modifier" : 0,
|
||||
"price" : 400,
|
||||
"clip_size_modifier" : 0,
|
||||
"description" : "A bayonet is a stabbing weapon that can be attached to the front of a shotgun, sub-machinegun or rifle, allowing a melee attack to deal piercing damage. The added length increases recoil slightly.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"volume" : 2,
|
||||
"cutting" : 16,
|
||||
"recoil_modifier" : 3,
|
||||
"damage_modifier" : 0,
|
||||
"mod_targets" : ["shotgun", "smg", "rifle"],
|
||||
"rarity" : 6,
|
||||
"bashing" : 0,
|
||||
"flags" : ["STAB"],
|
||||
"ammo_modifier" : "none"
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "u_shotgun",
|
||||
"name" : "underslung shotgun",
|
||||
"weight" : 1,
|
||||
"color" : "light_red",
|
||||
"burst_modifier" : 0,
|
||||
"loudness_modifier" : 0,
|
||||
"to_hit" : -1,
|
||||
"accuracy_modifier" : -2,
|
||||
"price" : 650,
|
||||
"clip_size_modifier" : 2,
|
||||
"description" : "A miniaturized shotgun with 2 barrels, which can be mounted under the barrel of many rifles. It allows two shotgun shells to be loaded and fired.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "NULL"],
|
||||
"volume" : 2,
|
||||
"cutting" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"damage_modifier" : 0,
|
||||
"mod_targets" : ["rifle"],
|
||||
"rarity" : 2,
|
||||
"bashing" : 2,
|
||||
"flags" : ["MODE_AUX"],
|
||||
"ammo_modifier" : "shot"
|
||||
},
|
||||
{
|
||||
"type" : "GUNMOD",
|
||||
"id" : "gun_crossbow",
|
||||
"name" : "rail-mounted crossbow",
|
||||
"weight" : 1,
|
||||
"color" : "light_red",
|
||||
"burst_modifier" : 0,
|
||||
"loudness_modifier" : 0,
|
||||
"to_hit" : -1,
|
||||
"accuracy_modifier" : 0,
|
||||
"price" : 500,
|
||||
"clip_size_modifier" : 1,
|
||||
"description" : "A kit to attach a pair of crossbow arms and a firing rail to the barrel of a long firearm. It allows crossbow bolts to be fired.",
|
||||
"symbol" : ":",
|
||||
"material" : ["STEEL", "WOOD"],
|
||||
"volume" : 2,
|
||||
"cutting" : 0,
|
||||
"recoil_modifier" : 0,
|
||||
"damage_modifier" : 0,
|
||||
"mod_targets" : ["shotgun", "rifle"],
|
||||
"rarity" : 2,
|
||||
"bashing" : 2,
|
||||
"flags" : ["MODE_AUX", "STR_RELOAD"],
|
||||
"ammo_modifier" : "bolt"
|
||||
}
|
||||
]
|
||||
File diff suppressed because it is too large
Load Diff
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,211 @@
|
||||
[
|
||||
{
|
||||
"ident" : "null",
|
||||
"name" : "Null",
|
||||
"bash_resist" : 0,
|
||||
"cut_resist" : 0,
|
||||
"bash_dmg_verb" : "damaged",
|
||||
"cut_dmg_verb" : "damaged",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 0,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "veggy",
|
||||
"name" : "Plant Matter",
|
||||
"bash_resist" : 1,
|
||||
"cut_resist" : 1,
|
||||
"bash_dmg_verb" : "ripped",
|
||||
"cut_dmg_verb" : "cut",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 1,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "flesh",
|
||||
"name" : "Flesh",
|
||||
"bash_resist" : 1,
|
||||
"cut_resist" : 1,
|
||||
"bash_dmg_verb" : "bruised",
|
||||
"cut_dmg_verb" : "sliced",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 1,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "powder",
|
||||
"name" : "Powder",
|
||||
"bash_resist" : 1,
|
||||
"cut_resist" : 1,
|
||||
"bash_dmg_verb" : "damaged",
|
||||
"cut_dmg_verb" : "damaged",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "hflesh",
|
||||
"name" : "Human Flesh",
|
||||
"bash_resist" : 1,
|
||||
"cut_resist" : 1,
|
||||
"bash_dmg_verb" : "bruised",
|
||||
"cut_dmg_verb" : "sliced",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 1,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "cotton",
|
||||
"name" : "Cotton",
|
||||
"bash_resist" : 1,
|
||||
"cut_resist" : 1,
|
||||
"bash_dmg_verb" : "ripped",
|
||||
"cut_dmg_verb" : "cut",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "wool",
|
||||
"name" : "Wool",
|
||||
"bash_resist" : 1,
|
||||
"cut_resist" : 1,
|
||||
"bash_dmg_verb" : "torn",
|
||||
"cut_dmg_verb" : "cut",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "leather",
|
||||
"name" : "Leather",
|
||||
"bash_resist" : 2,
|
||||
"cut_resist" : 2,
|
||||
"bash_dmg_verb" : "ripped",
|
||||
"cut_dmg_verb" : "sliced",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 1
|
||||
},
|
||||
{
|
||||
"ident" : "kevlar",
|
||||
"name" : "Kevlar",
|
||||
"bash_resist" : 2,
|
||||
"cut_resist" : 4,
|
||||
"bash_dmg_verb" : "ripped",
|
||||
"cut_dmg_verb" : "cut",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 1
|
||||
},
|
||||
{
|
||||
"ident" : "fur",
|
||||
"name" : "Fur",
|
||||
"bash_resist" : 2,
|
||||
"cut_resist" : 2,
|
||||
"bash_dmg_verb" : "ripped",
|
||||
"cut_dmg_verb" : "sliced",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "chitin",
|
||||
"name" : "Chitin",
|
||||
"bash_resist" : 3,
|
||||
"cut_resist" : 4,
|
||||
"bash_dmg_verb" : "cracked",
|
||||
"cut_dmg_verb" : "chipped",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 2
|
||||
},
|
||||
{
|
||||
"ident" : "stone",
|
||||
"name" : "Stone",
|
||||
"bash_resist" : 6,
|
||||
"cut_resist" : 6,
|
||||
"bash_dmg_verb" : "cracked",
|
||||
"cut_dmg_verb" : "chipped",
|
||||
"acid_resist" : 2,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 2
|
||||
},
|
||||
{
|
||||
"ident" : "paper",
|
||||
"name" : "Paper",
|
||||
"bash_resist" : 1,
|
||||
"cut_resist" : 1,
|
||||
"bash_dmg_verb" : "ripped",
|
||||
"cut_dmg_verb" : "cut",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "wood",
|
||||
"name" : "Wood",
|
||||
"bash_resist" : 3,
|
||||
"cut_resist" : 2,
|
||||
"bash_dmg_verb" : "splintered",
|
||||
"cut_dmg_verb" : "gouged",
|
||||
"acid_resist" : 1,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "plastic",
|
||||
"name" : "Plastic",
|
||||
"bash_resist" : 2,
|
||||
"cut_resist" : 2,
|
||||
"bash_dmg_verb" : "dented",
|
||||
"cut_dmg_verb" : "gouged",
|
||||
"acid_resist" : 1,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 0
|
||||
},
|
||||
{
|
||||
"ident" : "glass",
|
||||
"name" : "Glass",
|
||||
"bash_resist" : 1,
|
||||
"cut_resist" : 4,
|
||||
"bash_dmg_verb" : "cracked",
|
||||
"cut_dmg_verb" : "scratched",
|
||||
"acid_resist" : 2,
|
||||
"elec_resist" : 2,
|
||||
"fire_resist" : 2
|
||||
},
|
||||
{
|
||||
"ident" : "iron",
|
||||
"name" : "Iron",
|
||||
"bash_resist" : 4,
|
||||
"cut_resist" : 4,
|
||||
"bash_dmg_verb" : "dented",
|
||||
"cut_dmg_verb" : "scratched",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 0,
|
||||
"fire_resist" : 2
|
||||
},
|
||||
{
|
||||
"ident" : "steel",
|
||||
"name" : "Steel",
|
||||
"bash_resist" : 6,
|
||||
"cut_resist" : 6,
|
||||
"bash_dmg_verb" : "dented",
|
||||
"cut_dmg_verb" : "scratched",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 0,
|
||||
"fire_resist" : 2
|
||||
},
|
||||
{
|
||||
"ident" : "silver",
|
||||
"name" : "Silver",
|
||||
"bash_resist" : 2,
|
||||
"cut_resist" : 3,
|
||||
"bash_dmg_verb" : "dented",
|
||||
"cut_dmg_verb" : "scratched",
|
||||
"acid_resist" : 0,
|
||||
"elec_resist" : 0,
|
||||
"fire_resist" : 2
|
||||
}
|
||||
]
|
||||
+146
-143
@@ -3,24 +3,27 @@
|
||||
"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 }
|
||||
{ "monster" : "mon_rabbit", "freq" : 150, "multiplier" : 0 },
|
||||
{ "monster" : "mon_deer", "freq" : 30, "multiplier" : 3 },
|
||||
{ "monster" : "mon_moose", "freq" : 10, "multiplier" : 3 },
|
||||
{ "monster" : "mon_wolf", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_coyote", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_bear", "freq" : 20, "multiplier" : 10 },
|
||||
{ "monster" : "mon_cougar", "freq" : 20, "multiplier" : 10 },
|
||||
{ "monster" : "mon_spider_wolf", "freq" : 30, "multiplier" : 10 },
|
||||
{ "monster" : "mon_spider_jumping", "freq" : 30, "multiplier" : 10 },
|
||||
{ "monster" : "mon_dog", "freq" : 10, "multiplier" : 0 },
|
||||
{ "monster" : "mon_cat", "freq" : 10, "multiplier" : 0 },
|
||||
{ "monster" : "mon_crow", "freq" : 30, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 }
|
||||
{ "monster" : "mon_ant_larva", "freq" : 40, "multiplier" : 0 },
|
||||
{ "monster" : "mon_ant_soldier", "freq" : 90, "multiplier" : 5 },
|
||||
{ "monster" : "mon_ant_queen", "freq" : 0, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -33,49 +36,49 @@
|
||||
"name" : "GROUP_WORM",
|
||||
"default" : "mon_worm",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_graboid", "freq" : 30 },
|
||||
{ "monster" : "mon_halfworm", "freq" : 0 }
|
||||
{ "monster" : "mon_graboid", "freq" : 30, "multiplier" : 20 },
|
||||
{ "monster" : "mon_halfworm", "freq" : 0, "multiplier" : 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 }
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 20, "multiplier" : 3 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 70, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70, "multiplier" : 1 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_boomer", "freq" : 30, "multiplier" : 7 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10, "multiplier" : 15 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1, "multiplier" : 50 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_crow", "freq" : 1, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_TRIFFID",
|
||||
"default" : "mon_triffid",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_triffid_young", "freq" : 300 },
|
||||
{ "monster" : "mon_vinebeast", "freq" : 160 },
|
||||
{ "monster" : "mon_triffid_queen", "freq" : 60 }
|
||||
{ "monster" : "mon_triffid_young", "freq" : 300, "multiplier" : 0 },
|
||||
{ "monster" : "mon_vinebeast", "freq" : 160, "multiplier" : 10 },
|
||||
{ "monster" : "mon_triffid_queen", "freq" : 60, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 }
|
||||
{ "monster" : "mon_fungaloid_dormant", "freq" : 0, "multiplier" : 0 },
|
||||
{ "monster" : "mon_ant_fungus", "freq" : 0, "multiplier" : 0 },
|
||||
{ "monster" : "mon_zombie_fungus", "freq" : 300, "multiplier" : 0 },
|
||||
{ "monster" : "mon_boomer_fungus", "freq" : 30, "multiplier" : 0 },
|
||||
{ "monster" : "mon_spore", "freq" : 0, "multiplier" : 0 },
|
||||
{ "monster" : "mon_fungal_wall", "freq" : 0, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
|
||||
@@ -83,66 +86,66 @@
|
||||
"name" : "GROUP_GOO",
|
||||
"default" : "mon_blob",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_blob_small", "freq" : 200 }
|
||||
{ "monster" : "mon_blob_small", "freq" : 200, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_CHUD",
|
||||
"default" : "mon_chud",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_one_eye", "freq" : 90 },
|
||||
{ "monster" : "mon_crawler", "freq" : 35 }
|
||||
{ "monster" : "mon_one_eye", "freq" : 90, "multiplier" : 0 },
|
||||
{ "monster" : "mon_crawler", "freq" : 35, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_SEWER",
|
||||
"default" : "mon_sewer_rat",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_sewer_fish", "freq" : 470 },
|
||||
{ "monster" : "mon_sewer_snake", "freq" : 240 }
|
||||
{ "monster" : "mon_sewer_fish", "freq" : 470, "multiplier" : 0 },
|
||||
{ "monster" : "mon_sewer_snake", "freq" : 240, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 }
|
||||
{ "monster" : "mon_dragonfly", "freq" : 130, "multiplier" : 0 },
|
||||
{ "monster" : "mon_centipede", "freq" : 150, "multiplier" : 0 },
|
||||
{ "monster" : "mon_frog", "freq" : 100, "multiplier" : 0 },
|
||||
{ "monster" : "mon_slug", "freq" : 85, "multiplier" : 0 },
|
||||
{ "monster" : "mon_dermatik_larva", "freq" : 0, "multiplier" : 0 },
|
||||
{ "monster" : "mon_dermatik", "freq" : 65, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_LAB",
|
||||
"default" : "mon_zombie_scientist",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_blob_small", "freq" : 25 },
|
||||
{ "monster" : "mon_manhack", "freq" : 245 },
|
||||
{ "monster" : "mon_skitterbot", "freq" : 245 }
|
||||
{ "monster" : "mon_blob_small", "freq" : 25, "multiplier" : 0 },
|
||||
{ "monster" : "mon_manhack", "freq" : 245, "multiplier" : 0 },
|
||||
{ "monster" : "mon_skitterbot", "freq" : 245, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 }
|
||||
{ "monster" : "mon_flying_polyp", "freq" : 25, "multiplier" : 0 },
|
||||
{ "monster" : "mon_hunting_horror", "freq" : 240, "multiplier" : 0 },
|
||||
{ "monster" : "mon_mi_go", "freq" : 120, "multiplier" : 0 },
|
||||
{ "monster" : "mon_yugg", "freq" : 70, "multiplier" : 0 },
|
||||
{ "monster" : "mon_gelatin", "freq" : 120, "multiplier" : 0 },
|
||||
{ "monster" : "mon_flaming_eye", "freq" : 120, "multiplier" : 0 },
|
||||
{ "monster" : "mon_kreck", "freq" : 210, "multiplier" : 0 },
|
||||
{ "monster" : "mon_gozu", "freq" : 25, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_SPIRAL",
|
||||
"default" : "mon_human_snail",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_twisted_body", "freq" : 180 },
|
||||
{ "monster" : "mon_vortex", "freq" : 80 }
|
||||
{ "monster" : "mon_twisted_body", "freq" : 180, "multiplier" : 0 },
|
||||
{ "monster" : "mon_vortex", "freq" : 80, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
@@ -155,130 +158,130 @@
|
||||
"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 }
|
||||
{ "monster" : "mon_spider_web", "freq" : 200, "multiplier" : 0 },
|
||||
{ "monster" : "mon_spider_jumping", "freq" : 400, "multiplier" : 0 },
|
||||
{ "monster" : "mon_spider_widow", "freq" : 200, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 }
|
||||
{ "monster" : "mon_skitterbot", "freq" : 220, "multiplier" : 0 },
|
||||
{ "monster" : "mon_secubot", "freq" : 150, "multiplier" : 0 },
|
||||
{ "monster" : "mon_copbot", "freq" : 0, "multiplier" : 0 },
|
||||
{ "monster" : "mon_molebot", "freq" : 40, "multiplier" : 0 },
|
||||
{ "monster" : "mon_tripod", "freq" : 110, "multiplier" : 0 },
|
||||
{ "monster" : "mon_chickenbot", "freq" : 60, "multiplier" : 0 },
|
||||
{ "monster" : "mon_tankbot", "freq" : 20, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 }
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 320, "multiplier" : 3 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 70, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70, "multiplier" : 1 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_boomer", "freq" : 30, "multiplier" : 7 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10, "multiplier" : 15 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1, "multiplier" : 50 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_crow", "freq" : 1, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 }
|
||||
{ "monster" : "mon_zombie_child", "freq" : 150, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 20, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 70, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70, "multiplier" : 1 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_boomer", "freq" : 30, "multiplier" : 7 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10, "multiplier" : 15 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1, "multiplier" : 50 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_crow", "freq" : 1, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 }
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 20, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 220, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70, "multiplier" : 1 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_boomer", "freq" : 30, "multiplier" : 7 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10, "multiplier" : 15 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1, "multiplier" : 50 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_crow", "freq" : 1, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 }
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 20, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 70, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70, "multiplier" : 1 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 180, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_boomer", "freq" : 30, "multiplier" : 7 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10, "multiplier" : 15 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1, "multiplier" : 50 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_crow", "freq" : 1, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"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 }
|
||||
{ "monster" : "mon_zombie_cop", "freq" : 20, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_fast", "freq" : 70, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_grabber", "freq" : 70, "multiplier" : 1 },
|
||||
{ "monster" : "mon_skeleton", "freq" : 30, "multiplier" : 2 },
|
||||
{ "monster" : "mon_zombie_smoker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_shrieker", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_spitter", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_electric", "freq" : 30, "multiplier" : 5 },
|
||||
{ "monster" : "mon_zombie_necro", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_boomer", "freq" : 180, "multiplier" : 7 },
|
||||
{ "monster" : "mon_zombie_brute", "freq" : 10, "multiplier" : 15 },
|
||||
{ "monster" : "mon_zombie_hulk", "freq" : 1, "multiplier" : 50 },
|
||||
{ "monster" : "mon_zombie_master", "freq" : 1, "multiplier" : 25 },
|
||||
{ "monster" : "mon_crow", "freq" : 1, "multiplier" : 0 }
|
||||
]
|
||||
},
|
||||
{
|
||||
"name" : "GROUP_MAYBE_MIL", "_comment" : "50% chance military zombie",
|
||||
"default" : "mon_null",
|
||||
"monsters" : [
|
||||
{ "monster" : "mon_zombie_soldier", "freq" : 50 }
|
||||
{ "monster" : "mon_zombie_soldier", "freq" : 50, "multiplier" : 0 }
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
+1156
-3
File diff suppressed because it is too large
Load Diff
@@ -5,7 +5,16 @@
|
||||
"description":
|
||||
"They say you don't have any 'useful skills', but at least your clothes fit\nwell.",
|
||||
"points": 0,
|
||||
"items": ["jeans", "tshirt", "sneakers"]
|
||||
"items": ["jeans", "tshirt", "sneakers"]
|
||||
},
|
||||
|
||||
{
|
||||
"ident": "tailor",
|
||||
"name": "Tailor",
|
||||
"description":
|
||||
"You've made and adjusted clothing for some of the biggest names in town.\nNow, their undead bodies are trying to eat your brains. At least you'll be\nable to keep your own clothing repaired.",
|
||||
"points": 1,
|
||||
"items": ["polo_shirt", "blazer", "pants", "dress_shoes", "sewing_kit", "scissors", "manual_tailor"]
|
||||
},
|
||||
|
||||
{
|
||||
@@ -23,7 +32,16 @@
|
||||
"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"]
|
||||
"items": ["tank_top", "jeans", "boots", "beltrig", "wrench", "mag_cars", "manual_mechanics"]
|
||||
},
|
||||
|
||||
{
|
||||
"ident": "scoundrel",
|
||||
"name": "Scoundrel",
|
||||
"description":
|
||||
"Your flexible outlook on law has ensured your survival, but now what?\nYou start with cargo pants, a hoodie, and \"sundries\".",
|
||||
"points": 2,
|
||||
"items": ["tank_top", "hoodie", "pants_cargo", "sneakers", "weed", "picklocks"]
|
||||
},
|
||||
|
||||
{
|
||||
@@ -32,6 +50,12 @@
|
||||
"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"]
|
||||
"items": ["pants", "dress_shirt", "dress_shoes", "cig"],
|
||||
"addictions": [
|
||||
{
|
||||
"type": "nicotine",
|
||||
"intensity": 10
|
||||
}
|
||||
]
|
||||
}
|
||||
]
|
||||
|
||||
File diff suppressed because it is too large
Load Diff
@@ -1,9 +1,4 @@
|
||||
[
|
||||
[
|
||||
"null",
|
||||
"null",
|
||||
"The skill of true Zen."
|
||||
],
|
||||
[
|
||||
"dodge",
|
||||
"dodge",
|
||||
|
||||
@@ -0,0 +1,77 @@
|
||||
{
|
||||
"snippets":
|
||||
[
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for the Diet Devil brand Metabolic Exchange CBM. It shows a picture of a tiny obese devil sitting on a woman's shoulder. The woman stares intently at a gigantic wedding cake covered with bacon and candybars. The caption reads: \"Burn calories! Burn!\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for the Diet Devil brand Internal Furnace CBM. It shows a picture of a tiny obese devil sitting on a man's shoulder. The man is about to bite into a frosting-covered baby. The caption reads: \"Eat What You Want! How You Want! Who You Want!\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for the Diet Devil brand Ethanol Burner CBM. It shows a picture of a teenaged boy driving a car while chugging a bottle of whiskey. A tiny obese devil sits on his shoulder and drinks a martini. The caption reads: \"Drink like there's no tomorrow!\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for the Twenty8 brand Diamond Cornea CBM. It shows a picture of the cyber-module being clutched by an eagle in flight. The captions read: \"Get the new Model 28.bx Eagle-Eye!\" and \"Twenty8. See what you've been missing.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for the Twenty8 brand Night Vision CBM. It shows a picture of an owl swooping down on a the cyber-module. The captions read: \"Get the new Model 28.hx Night-Owl!\" and \"Twenty8. See what you've been missing.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for the Twenty8 brand Diamond Cornea CBM. It shows a picture of a flying hawk carrying the cyber-module in its beak. The captions read: \"Get the new Model 28.xx Hawk-Eye!\" and \"Twenty8. See what you've been missing.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for the Twenty8 brand Scent Vision CBM. It shows a picture of a vulture perched on a pile of skulls and cyber-modules. The captions read: \"Get the new Model 28.vx Vulture today!\" and \"Twenty8. See what you've been missing.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an ad for a Twenty8 brand Infrared Vision CBM. It shows a picture of a robotic phoenix covered in flames. The captions read: \"Get the new Model 28.tx Phoenix today!\" and \"Twenty8. See what you've been missing.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for DoubleTech brand law enforcement robots. It shows a picture of copbot and an eyebot boldly emerging from a cloud of teargas and flame. The caption reads: \"DoubleTech Industries. Built to Protect. Programmed to Serve.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for DoubleTech brand law enforcement robots. It shows a picture of an eyebot flying alongside a bald eagle and a Stealth bomber painted as an American flag. The caption reads: \"Built to Protect. Programmed to Serve.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for DoubleTech brand law enforcement robots. It shows a picture of a dozen eyebots floating over a woman as she jogs through a park. The captions read: \"Built to Protect. Programmed to Serve.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for DoubleTech brand law enforcement robots. It shows a picture of copbot pepper-spraying a handcuffed rioter. In the background a troop of boy scouts salutes the robot. The caption reads: \"Built to Protect. Programmed to Serve.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for Robert's Universal Robotics brand law enforcement robots. It shows a picture of tripod robot incinerating a mob of looters and stepping over charred and smoking corpses. The caption reads: \"Built to Protect. Programmed to Serve.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for Robert's Universal Robots brand labor-bots. It shows a picture of a robot carrying a heavy pallet of bricks. In the background a human foreman is sleeping on the job, with his hardhat pulled down over his eyes. The captions read: \"It's a tough job, so why should you have to do it?\" and \"R.U.R. Technology you can Trust.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for Robert's Universal Robots brand labor-bots. It shows a picture of a factory floor run entirely by robots. In the background a man in a suit reads a newspaper that shows soaring stock prices. The caption reads: \"R.U.R. Technology you can Trust.\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for Sybil's Cyber Boutique. It shows a picture of several bikini-clad female doctors removing the skin from man's face. The patient is strapped to a chair but cheerfully gives two thumbs up. The caption reads: \"Free Plastic Surgery While You Wait!\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for Sybil's Cyber Boutique. It shows a picture of a nerdy looking man surrounded by a group of admiring women. In the foreground a blood-drenched doctor gives an exaggerated wink and a two thumbs up. The caption reads: \"Holiday sales! Get the package deals!\""
|
||||
},
|
||||
{
|
||||
"category": "flier",
|
||||
"text": "This is an advertisement for Sybil's Cyber Boutique. It shows a picture of a man flexing shiny cybernetic arms in front of a mirror. He is flanked by two scantily clad nurses who hold bloody chainsaws and give approving thumbs up. In the background feral dogs gnaw on the man's discarded former limbs. The caption reads: \"Spring Cleaning Sale! 20% off!\""
|
||||
}
|
||||
]
|
||||
}
|
||||
+35
-30
@@ -4,6 +4,7 @@
|
||||
#include "keypress.h"
|
||||
#include "itype.h"
|
||||
#include "mtype.h"
|
||||
#include "overmapbuffer.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
@@ -80,7 +81,7 @@ bool defense_game::init(game *g)
|
||||
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);
|
||||
g->cur_om = &overmap_buffer.get(g, 0, 0);
|
||||
init_map(g);
|
||||
caravan(g);
|
||||
return true;
|
||||
@@ -186,21 +187,25 @@ void defense_game::init_constructions(game *g)
|
||||
|
||||
void defense_game::init_recipes(game *g)
|
||||
{
|
||||
for (int i = 0; i < g->recipes.size(); i++) {
|
||||
g->recipes[i]->time /= 10; // Things take turns, not minutes
|
||||
}
|
||||
for (recipe_map::iterator map_iter = g->recipes.begin(); map_iter != g->recipes.end(); ++map_iter)
|
||||
{
|
||||
for (recipe_list::iterator list_iter = map_iter->second.begin(); list_iter != map_iter->second.end(); ++list_iter)
|
||||
{
|
||||
(*list_iter)->time /= 10; // Things take turns, not minutes
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
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, 0) = ot_field;
|
||||
g->cur_om.seen(x, y, 0) = true;
|
||||
g->cur_om->ter(x, y, 0) = ot_field;
|
||||
g->cur_om->seen(x, y, 0) = true;
|
||||
}
|
||||
}
|
||||
|
||||
g->cur_om.save();
|
||||
g->cur_om->save();
|
||||
g->levx = 100;
|
||||
g->levy = 100;
|
||||
g->levz = 0;
|
||||
@@ -212,29 +217,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, 0) = ot_hospital;
|
||||
g->cur_om->ter(x, y, 0) = ot_hospital;
|
||||
}
|
||||
g->cur_om.ter(50, 49, 0) = 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, 0) = ot_megastore;
|
||||
g->cur_om->ter(x, y, 0) = ot_megastore;
|
||||
}
|
||||
g->cur_om.ter(50, 49, 0) = ot_megastore_entrance;
|
||||
g->cur_om->ter(50, 49, 0) = ot_megastore_entrance;
|
||||
break;
|
||||
|
||||
case DEFLOC_BAR:
|
||||
g->cur_om.ter(50, 50, 0) = 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, 0) = ot_mansion;
|
||||
g->cur_om->ter(x, y, 0) = ot_mansion;
|
||||
}
|
||||
g->cur_om.ter(50, 49, 0) = ot_mansion_entrance;
|
||||
g->cur_om->ter(50, 49, 0) = ot_mansion_entrance;
|
||||
break;
|
||||
}
|
||||
// Init the map
|
||||
@@ -253,10 +258,10 @@ 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, 0, 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, 0);
|
||||
tm.save(g->cur_om, int(g->turn), mx, my, 0);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -268,7 +273,7 @@ void defense_game::init_map(game *g)
|
||||
std::vector<point> valid;
|
||||
for (int x = g->u.posx - 1; x <= g->u.posx + 1; x++) {
|
||||
for (int y = g->u.posy - 1; y <= g->u.posy + 1; y++) {
|
||||
if (generator.can_move_to(g->m, x, y) && g->is_empty(x, y))
|
||||
if (generator.can_move_to(g, x, y) && g->is_empty(x, y))
|
||||
valid.push_back( point(x, y) );
|
||||
}
|
||||
}
|
||||
@@ -713,7 +718,7 @@ std::string defense_style_name(defense_style style)
|
||||
case DEFENSE_TRIFFIDS: return "Day of the Triffids";
|
||||
case DEFENSE_SKYNET: return "Skynet";
|
||||
case DEFENSE_LOVECRAFT: return "The Call of Cthulhu";
|
||||
default: return "Bug! Report this!";
|
||||
default: return "Bug! (bug in defense.cpp:defense_style_name)";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -742,19 +747,19 @@ std::string defense_style_description(defense_style style)
|
||||
case DEFENSE_LOVECRAFT:
|
||||
return "Ward off legions of eldritch horrors.";
|
||||
default:
|
||||
return "What the heck is this I don't even know. A bug!";
|
||||
return "What the heck is this I don't even know. (defense.cpp:defense_style_description)";
|
||||
}
|
||||
}
|
||||
|
||||
std::string defense_location_name(defense_location location)
|
||||
{
|
||||
switch (location) {
|
||||
case DEFLOC_NULL: return "Nowhere?! A bug!";
|
||||
case DEFLOC_NULL: return "Nowhere?! (bug in defense.cpp:defense_location_name)";
|
||||
case DEFLOC_HOSPITAL: return "Hospital";
|
||||
case DEFLOC_MALL: return "Megastore";
|
||||
case DEFLOC_BAR: return "Bar";
|
||||
case DEFLOC_MANSION: return "Mansion";
|
||||
default: return "a ghost's house (bug)";
|
||||
default: return "a ghost's house (bug in defense.cpp:defense_location_name)";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -762,7 +767,7 @@ std::string defense_location_description(defense_location location)
|
||||
{
|
||||
switch (location) {
|
||||
case DEFLOC_NULL:
|
||||
return "NULL Bug.";
|
||||
return "NULL Bug. (defense.cpp:defense_location_description)";
|
||||
case DEFLOC_HOSPITAL:
|
||||
return "One entrance and many rooms. Some medical supplies.";
|
||||
case DEFLOC_MALL:
|
||||
@@ -772,7 +777,7 @@ std::string defense_location_description(defense_location location)
|
||||
case DEFLOC_MANSION:
|
||||
return "A large house with many rooms and.";
|
||||
default:
|
||||
return "Unknown data bug.";
|
||||
return "Unknown data bug. (defense.cpp:defense_location_description)";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1021,7 +1026,7 @@ std::string caravan_category_name(caravan_category cat)
|
||||
case CARAVAN_CLOTHES: return "Clothing & Armor";
|
||||
case CARAVAN_TOOLS: return "Tools, Traps & Grenades";
|
||||
}
|
||||
return "BUG";
|
||||
return "BUG (defense.cpp:caravan_category_name)";
|
||||
}
|
||||
|
||||
std::vector<itype_id> caravan_items(caravan_category cat)
|
||||
@@ -1032,14 +1037,14 @@ std::vector<itype_id> caravan_items(caravan_category cat)
|
||||
return ret;
|
||||
|
||||
case CARAVAN_MELEE:
|
||||
setvector(ret,
|
||||
setvector(&ret,
|
||||
"hammer", "bat", "mace", "morningstar", "hammer_sledge", "hatchet",
|
||||
"knife_combat", "rapier", "machete", "katana", "spear_knife",
|
||||
"pike", "chainsaw_off", NULL);
|
||||
break;
|
||||
|
||||
case CARAVAN_GUNS:
|
||||
setvector(ret,
|
||||
setvector(&ret,
|
||||
"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",
|
||||
@@ -1049,21 +1054,21 @@ std::vector<itype_id> caravan_items(caravan_category cat)
|
||||
break;
|
||||
|
||||
case CARAVAN_COMPONENTS:
|
||||
setvector(ret,
|
||||
setvector(&ret,
|
||||
"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,
|
||||
setvector(&ret,
|
||||
"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,
|
||||
setvector(&ret,
|
||||
"backpack", "vest", "trenchcoat", "jacket_leather", "kevlar",
|
||||
"gloves_fingerless", "mask_filter", "mask_gas", "glasses_eye",
|
||||
"glasses_safety", "goggles_ski", "goggles_nv", "helmet_ball",
|
||||
@@ -1071,7 +1076,7 @@ std::vector<itype_id> caravan_items(caravan_category cat)
|
||||
break;
|
||||
|
||||
case CARAVAN_TOOLS:
|
||||
setvector(ret,
|
||||
setvector(&ret,
|
||||
"screwdriver", "wrench", "saw", "hacksaw", "lighter", "sewing_kit",
|
||||
"scissors", "extinguisher", "flashlight", "hotplate",
|
||||
"soldering_iron", "shovel", "jackhammer", "landmine", "teleporter",
|
||||
|
||||
+185
-124
@@ -3,6 +3,7 @@
|
||||
#include "bodypart.h"
|
||||
#include "disease.h"
|
||||
#include "weather.h"
|
||||
#include <stdlib.h>
|
||||
#include <sstream>
|
||||
|
||||
void dis_msg(game *g, dis_type type)
|
||||
@@ -29,6 +30,11 @@ void dis_msg(game *g, dis_type type)
|
||||
case DI_TEARGAS:
|
||||
g->add_msg("You inhale a lungful of tear gas.");
|
||||
break;
|
||||
case DI_CRUSHED:
|
||||
g->add_msg("The ceiling collapses on you!");
|
||||
break;
|
||||
case DI_BOULDERING:
|
||||
g->add_msg("You are slowed by the rubble.");
|
||||
case DI_BOOMERED:
|
||||
g->add_msg("You're covered in bile!");
|
||||
break;
|
||||
@@ -74,11 +80,12 @@ void dis_msg(game *g, dis_type type)
|
||||
g->add_msg("You're knocked to the floor!");
|
||||
break;
|
||||
case DI_AMIGARA:
|
||||
g->add_msg("You can't look away from the fautline...");
|
||||
g->add_msg("You can't look away from the faultline...");
|
||||
break;
|
||||
case DI_STEMCELL_TREATMENT:
|
||||
g->add_msg("You receive a pureed bone & enamel injection into your eyeball.");
|
||||
g->add_msg("It is excruciating.");
|
||||
break;
|
||||
case DI_BITE:
|
||||
g->add_msg("The bite wound feels really deep...");
|
||||
break;
|
||||
@@ -99,7 +106,6 @@ void dis_msg(game *g, dis_type type)
|
||||
void dis_effect(game *g, player &p, disease &dis)
|
||||
{
|
||||
int bonus;
|
||||
int junk;
|
||||
switch (dis.type) {
|
||||
case DI_GLARE:
|
||||
p.per_cur -= 1;
|
||||
@@ -111,55 +117,49 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
|
||||
case DI_COLD_HEAD:
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.int_cur -= 3; if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your thoughts are unclear.");
|
||||
case 3 : p.int_cur -= 3; if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your thoughts are unclear.");
|
||||
case 2 : p.int_cur--;
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
|
||||
}
|
||||
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 3 : p.per_cur -= 3; if (!p.has_disease(DI_SLEEP) && one_in(400)) 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.");
|
||||
case 3 : p.dex_cur -= 2; if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your torso is burning up. You should remove some layers.");
|
||||
// Speed -20
|
||||
case 2 : p.dex_cur -= 1;
|
||||
// Speed -5
|
||||
case 1 : p.dex_cur -= 1; if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
|
||||
// Speed -2
|
||||
// case1 : Speed -2
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_COLD_ARMS:
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.dex_cur -= 2;
|
||||
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.");
|
||||
case 2 : p.dex_cur--; if (!p.has_disease(DI_SLEEP) && one_in(800)) g->add_msg("Your arms are shivering.");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_COLD_HANDS:
|
||||
switch (dis.intensity) {
|
||||
case 3 : 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.\"");
|
||||
case 2 : p.dex_cur -= 2; if (!p.has_disease(DI_SLEEP) && one_in(800)) g->add_msg("Your hands are shivering.");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_COLD_LEGS:
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.str_cur--; if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your legs are seizing from the incredible cold.");
|
||||
case 3 : p.str_cur--; if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your legs are seizing from the incredible cold.");
|
||||
// Speed -20
|
||||
case 2 : p.str_cur--;
|
||||
// Speed -5
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("Your legs feel sluggish from the cold.");
|
||||
// Speed -2
|
||||
// case 1 : Speed -2
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -167,7 +167,6 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.str_cur--;
|
||||
case 2 : p.str_cur--;
|
||||
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -176,7 +175,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
case 2 : p.dex_cur -= 3;
|
||||
case 1 :
|
||||
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.");
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your hands feel numb.");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -185,7 +184,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
case 2 : // -4 speed
|
||||
case 1 :
|
||||
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.");
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your feet feel numb.");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -194,81 +193,76 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
case 2 : p.per_cur -= 3;
|
||||
case 1 :
|
||||
if (p.temp_cur[bp_mouth] > BODYTEMP_COLD && p.pain < 40) p.pain++;
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your face feels numb.");
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your face feels numb.");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_BLISTERS_HANDS:
|
||||
p.dex_cur--;
|
||||
if (p.pain < 35) p.pain++;
|
||||
if (one_in(2)) p.hp_max[hp_arm_r]--;
|
||||
else p.hp_max[hp_arm_l]--;
|
||||
if (one_in(2)) p.hp_cur[hp_arm_r]--;
|
||||
else p.hp_cur[hp_arm_l]--;
|
||||
break;
|
||||
|
||||
case DI_BLISTERS_FEET:
|
||||
p.str_cur--;
|
||||
if (p.pain < 35) p.pain++;
|
||||
if (one_in(2)) p.hp_max[hp_leg_r]--;
|
||||
else p.hp_max[hp_leg_l]--;
|
||||
if (one_in(2)) p.hp_cur[hp_leg_r]--;
|
||||
else p.hp_cur[hp_leg_l]--;
|
||||
break;
|
||||
|
||||
case DI_BLISTERS_MOUTH:
|
||||
p.per_cur--;
|
||||
p.hp_max[hp_head]--;
|
||||
p.hp_cur[hp_head]--;
|
||||
if (p.pain < 35) p.pain++;
|
||||
break;
|
||||
|
||||
case DI_HOT_HEAD:
|
||||
switch (dis.intensity) {
|
||||
case 3 :
|
||||
p.thirst--;
|
||||
if (p.pain < 50) p.pain++;
|
||||
p.thirst++;
|
||||
if (p.pain < 40) p.pain++;
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your head is pounding from the heat.");
|
||||
// Speed -20
|
||||
case 2 :
|
||||
p.thirst--;
|
||||
if (one_in(15000 - p.temp_cur[bp_head])) p.vomit(g); // Hallucinations handled in game.cpp
|
||||
p.thirst++;
|
||||
// Hallucinations handled in game.cpp
|
||||
if (one_in(std::min(14500,15000-p.temp_cur[bp_head]))) p.vomit(g);
|
||||
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.\"");
|
||||
// Speed -2
|
||||
// case 1 : 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.\"");
|
||||
case 3 : p.thirst++;
|
||||
if (p.pain < 30) p.pain++;
|
||||
case 2 : p.thirst++;
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_HOT_TORSO:
|
||||
switch (dis.intensity) {
|
||||
case 3 :
|
||||
p.thirst--;
|
||||
p.thirst++;
|
||||
p.str_cur--;
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("You are sweating profusely.");
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("You are sweating profusely.");
|
||||
// Speed -20
|
||||
case 2 :
|
||||
p.thirst--;
|
||||
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.\"");
|
||||
// Speed -2
|
||||
// case 1 : Speed -2
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_HOT_ARMS:
|
||||
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.\"");
|
||||
case 3 : p.thirst++;
|
||||
if (p.pain < 30) p.pain++;
|
||||
case 2 : p.thirst++;
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -276,27 +270,23 @@ 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.\"");
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_HOT_LEGS:
|
||||
switch (dis.intensity) {
|
||||
case 3 : p.thirst--;
|
||||
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.\"");
|
||||
case 3 : p.thirst++;
|
||||
if (p.pain < 30) p.pain++;
|
||||
if (one_in(400)) g->add_msg("Your legs are cramping up.");
|
||||
case 2 : p.thirst++;
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_HOT_FEET:
|
||||
switch (dis.intensity) {
|
||||
case 3 : if (p.pain < 50) p.pain++;
|
||||
case 2 :
|
||||
case 3 :
|
||||
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.\"");
|
||||
if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your feet are swelling in the heat.");
|
||||
}
|
||||
break;
|
||||
|
||||
@@ -398,6 +388,32 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
}
|
||||
break;
|
||||
|
||||
case DI_CRUSHED:
|
||||
p.hurtall(10);
|
||||
//This could be developed on later, for instance
|
||||
//to deal different damage amounts to different body parts and
|
||||
//to account for helmets and other armor
|
||||
break;
|
||||
|
||||
case DI_BOULDERING:
|
||||
switch(g->u.disease_intensity(DI_BOULDERING)){
|
||||
case 1:
|
||||
p.dex_cur -= 1;
|
||||
break;
|
||||
case 2:
|
||||
p.dex_cur -= 3;
|
||||
break;
|
||||
case 3:
|
||||
p.dex_cur -= 5;
|
||||
break;
|
||||
default:
|
||||
debugmsg("Something went wrong with DI_BOULDERING.");
|
||||
debugmsg("Check disease.cpp");
|
||||
}
|
||||
if (p.dex_cur < 1) {
|
||||
p.dex_cur = 1;
|
||||
}
|
||||
|
||||
case DI_BOOMERED:
|
||||
p.per_cur -= 5;
|
||||
break;
|
||||
@@ -447,7 +463,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
one_in(2000 + bonus * 10)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You vomit a thick, gray goop.");
|
||||
else if (g->u_see(p.posx, p.posy, junk))
|
||||
else if (g->u_see(p.posx, p.posy))
|
||||
g->add_msg("%s vomits a thick, gray goop.", p.name.c_str());
|
||||
p.moves = -200;
|
||||
p.hunger += 50;
|
||||
@@ -457,7 +473,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
if (one_in(1000 + bonus * 8)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("You double over, spewing live spores from your mouth!");
|
||||
else if (g->u_see(p.posx, p.posy, junk))
|
||||
else if (g->u_see(p.posx, p.posy))
|
||||
g->add_msg("%s coughs up a stream of live spores!", p.name.c_str());
|
||||
p.moves = -500;
|
||||
int sporex, sporey;
|
||||
@@ -468,7 +484,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
sporey = p.posy + j;
|
||||
if (g->m.move_cost(sporex, sporey) > 0 && one_in(5)) {
|
||||
if (g->mon_at(sporex, sporey) >= 0) { // Spores hit a monster
|
||||
if (g->u_see(sporex, sporey, junk))
|
||||
if (g->u_see(sporex, sporey))
|
||||
g->add_msg("The %s is covered in tiny spores!",
|
||||
g->z[g->mon_at(sporex, sporey)].name().c_str());
|
||||
if (!g->z[g->mon_at(sporex, sporey)].make_fungus(g))
|
||||
@@ -483,7 +499,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
} else if (one_in(6000 + bonus * 20)) {
|
||||
if (!p.is_npc())
|
||||
g->add_msg("Fungus stalks burst through your hands!");
|
||||
else if (g->u_see(p.posx, p.posy, junk))
|
||||
else if (g->u_see(p.posx, p.posy))
|
||||
g->add_msg("Fungus stalks burst through %s's hands!", p.name.c_str());
|
||||
p.hurt(g, bp_arms, 0, 60);
|
||||
p.hurt(g, bp_arms, 1, 60);
|
||||
@@ -508,41 +524,67 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
g->add_msg("You try to sleep, but can't...");
|
||||
break;
|
||||
|
||||
case DI_SLEEP:
|
||||
p.moves = 0;
|
||||
if (int(g->turn) % 25 == 0) {
|
||||
if (p.fatigue > 0)
|
||||
p.fatigue -= 1 + rng(0, 1) * rng(0, 1);
|
||||
if (p.has_trait(PF_FASTHEALER))
|
||||
p.healall(rng(0, 1));
|
||||
else
|
||||
p.healall(rng(0, 1) * rng(0, 1) * rng(0, 1));
|
||||
if (p.fatigue <= 0 && p.fatigue > -20) {
|
||||
p.fatigue = -25;
|
||||
g->add_msg("Fully rested.");
|
||||
dis.duration = dice(3, 100);
|
||||
}
|
||||
}
|
||||
if (int(g->turn) % 100 == 0 && !p.has_bionic("bio_recycler")) {
|
||||
// Hunger and thirst advance more slowly while we sleep.
|
||||
p.hunger--;
|
||||
p.thirst--;
|
||||
}
|
||||
if (rng(5, 80) + rng(0, 120) + rng(0, abs(p.fatigue)) +
|
||||
rng(0, abs(p.fatigue * 5)) < g->light_level() &&
|
||||
(p.fatigue < 10 || one_in(p.fatigue / 2))) {
|
||||
g->add_msg("The light wakes you up.");
|
||||
dis.duration = 1;
|
||||
}
|
||||
// Cold may wake you up.
|
||||
// Player gets desperate for sleep
|
||||
if (p.temp_cur[bp_torso] < BODYTEMP_VERY_COLD - p.fatigue/2 ||
|
||||
(one_in(p.temp_cur[bp_torso]) && p.temp_cur[bp_torso] < BODYTEMP_NORM - p.fatigue/2)){
|
||||
g->add_msg("The cold wakes you up.");
|
||||
dis.duration = 1;
|
||||
}
|
||||
case DI_SLEEP:
|
||||
p.moves = 0;
|
||||
|
||||
break;
|
||||
if (int(g->turn) % 25 == 0) {
|
||||
if (p.fatigue > 0)
|
||||
p.fatigue -= 1 + rng(0, 1) * rng(0, 1);
|
||||
if (p.has_trait(PF_FASTHEALER)) {
|
||||
p.healall(rng(0, 1));
|
||||
} else if (p.has_trait(PF_FASTHEALER2)) {
|
||||
p.healall(rng(0, 2));
|
||||
} else if (p.has_trait(PF_REGEN)) {
|
||||
p.healall(rng(1, 2));
|
||||
} else {
|
||||
p.healall(rng(0, 1) * rng(0, 1) * rng(0, 1));
|
||||
}
|
||||
|
||||
if (p.fatigue <= 0 && p.fatigue > -20) {
|
||||
p.fatigue = -25;
|
||||
g->add_msg("Fully rested.");
|
||||
dis.duration = dice(3, 100);
|
||||
}
|
||||
}
|
||||
|
||||
if (int(g->turn) % 100 == 0 && !p.has_bionic("bio_recycler")) {
|
||||
// Hunger and thirst advance more slowly while we sleep.
|
||||
p.hunger--;
|
||||
p.thirst--;
|
||||
}
|
||||
|
||||
if (rng(5, 80) + rng(0, 120) + rng(0, abs(p.fatigue)) +
|
||||
rng(0, abs(p.fatigue * 5)) < g->light_level() &&
|
||||
(p.fatigue < 10 || one_in(p.fatigue / 2))) {
|
||||
g->add_msg("The light wakes you up.");
|
||||
dis.duration = 1;
|
||||
}
|
||||
|
||||
// Cold or heat may wake you up.
|
||||
// Player will sleep through cold or heat if fatigued enough
|
||||
for (int i = 0 ; i < num_bp ; i++)
|
||||
{
|
||||
if (p.temp_cur[i] < BODYTEMP_VERY_COLD - p.fatigue/2)
|
||||
{
|
||||
if (one_in(5000)) { g->add_msg("You toss and turn trying to keep warm."); }
|
||||
if (p.temp_cur[i] < BODYTEMP_FREEZING - p.fatigue/2 || (one_in(p.temp_cur[i] + 5000)))
|
||||
{
|
||||
g->add_msg("The cold wakes you up.");
|
||||
dis.duration = 1;
|
||||
}
|
||||
}
|
||||
else if (p.temp_cur[i] > BODYTEMP_VERY_HOT + p.fatigue/2)
|
||||
{
|
||||
if (one_in(5000)) { g->add_msg("You toss and turn in the heat."); }
|
||||
if (p.temp_cur[i] > BODYTEMP_SCORCHING + p.fatigue/2 || (one_in(15000 - p.temp_cur[i])))
|
||||
{
|
||||
g->add_msg("The heat wakes you up.");
|
||||
dis.duration = 1;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
break;
|
||||
|
||||
case DI_STEMCELL_TREATMENT:
|
||||
//slightly repair broken limbs. (also nonbroken limbs (unless they're too healthy))
|
||||
@@ -727,11 +769,10 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
}
|
||||
}
|
||||
if (valid_spawns.size() >= 1) {
|
||||
int t;
|
||||
p.rem_disease(DI_DERMATIK); // No more infection! yay.
|
||||
if (!p.is_npc())
|
||||
g->add_msg("Insects erupt from your skin!");
|
||||
else if (g->u_see(p.posx, p.posy, t))
|
||||
else if (g->u_see(p.posx, p.posy))
|
||||
g->add_msg("Insects erupt from %s's skin!", p.name.c_str());
|
||||
p.moves -= 600;
|
||||
monster grub(g->mtypes[mon_dermatik_larva]);
|
||||
@@ -780,11 +821,10 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
p.int_cur -= 2;
|
||||
p.str_cur -= 1;
|
||||
if (one_in(10 + 40 * p.int_cur)) {
|
||||
int t;
|
||||
if (!p.is_npc()) {
|
||||
g->add_msg("You start scratching yourself all over!");
|
||||
g->cancel_activity();
|
||||
} else if (g->u_see(p.posx, p.posy, t))
|
||||
} else if (g->u_see(p.posx, p.posy))
|
||||
g->add_msg("%s starts scratching %s all over!", p.name.c_str(),
|
||||
(p.male ? "himself" : "herself"));
|
||||
p.moves -= 150;
|
||||
@@ -921,7 +961,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
g->m.ter_set(x, y, t_rubble);
|
||||
beast.spawn(x, y);
|
||||
g->z.push_back(beast);
|
||||
if (g->u_see(x, y, junk)) {
|
||||
if (g->u_see(x, y)) {
|
||||
g->cancel_activity_query("A monster appears nearby!");
|
||||
g->add_msg("A portal opens nearby, and a monster crawls through!");
|
||||
}
|
||||
@@ -971,7 +1011,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
one_in(250)) {
|
||||
mon_id type = MonsterGroupManager::GetMonsterFromGroup("GROUP_NETHER", &g->mtypes);
|
||||
monster beast(g->mtypes[type]);
|
||||
int x, y, tries = 0, junk;
|
||||
int x, y, tries = 0;
|
||||
do {
|
||||
x = p.posx + rng(-4, 4);
|
||||
y = p.posy + rng(-4, 4);
|
||||
@@ -983,7 +1023,7 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
g->m.ter_set(x, y, t_rubble);
|
||||
beast.spawn(x, y);
|
||||
g->z.push_back(beast);
|
||||
if (g->u_see(x, y, junk)) {
|
||||
if (g->u_see(x, y)) {
|
||||
g->cancel_activity_query("A monster appears nearby!");
|
||||
g->add_msg("A portal opens nearby, and a monster crawls through!");
|
||||
}
|
||||
@@ -1008,8 +1048,8 @@ void dis_effect(game *g, player &p, disease &dis)
|
||||
for (int i = 0; !lesser && i < p.worn.size(); i++) {
|
||||
if (p.worn[i].is_artifact()) {
|
||||
it_artifact_armor *armor = dynamic_cast<it_artifact_armor*>(p.worn[i].type);
|
||||
for (int i = 0; i < armor->effects_worn.size(); i++) {
|
||||
if (armor->effects_worn[i] == AEP_EVIL)
|
||||
for (int j = 0; j < armor->effects_worn.size(); j++) {
|
||||
if (armor->effects_worn[j] == AEP_EVIL)
|
||||
lesser = true;
|
||||
}
|
||||
}
|
||||
@@ -1182,6 +1222,7 @@ int disease_speed_boost(disease dis)
|
||||
case DI_ASTHMA: return 0 - int(dis.duration / 5);
|
||||
case DI_GRACK: return +20000;
|
||||
case DI_METH: return (dis.duration > 600 ? 50 : -40);
|
||||
case DI_BOULDERING: return ( 0 - (dis.intensity * 10));
|
||||
default: return 0;
|
||||
}
|
||||
}
|
||||
@@ -1193,37 +1234,37 @@ std::string dis_name(disease dis)
|
||||
case DI_GLARE: return "Glare";
|
||||
case DI_COLD_HEAD:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold head";
|
||||
case 1: return "Chilly head";
|
||||
case 2: return "Cold head!";
|
||||
case 3: return "Freezing head!!";}
|
||||
case DI_COLD_MOUTH:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold face";
|
||||
case 1: return "Chilly face";
|
||||
case 2: return "Cold face!";
|
||||
case 3: return "Freezing face!!";}
|
||||
case DI_COLD_TORSO:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold torso";
|
||||
case 1: return "Chilly torso";
|
||||
case 2: return "Cold torso!";
|
||||
case 3: return "Freezing torso!!";}
|
||||
case DI_COLD_ARMS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold arms";
|
||||
case 1: return "Chilly arms";
|
||||
case 2: return "Cold arms!";
|
||||
case 3: return "Freezing arms!!";}
|
||||
case DI_COLD_HANDS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold hands";
|
||||
case 1: return "Chilly hands";
|
||||
case 2: return "Cold hands!";
|
||||
case 3: return "Freezing hands!!";}
|
||||
case DI_COLD_LEGS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold legs";
|
||||
case 1: return "Chilly legs";
|
||||
case 2: return "Cold legs!";
|
||||
case 3: return "Freezing legs!!";}
|
||||
case DI_COLD_FEET:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Cold feet";
|
||||
case 1: return "Chilly feet";
|
||||
case 2: return "Cold feet!";
|
||||
case 3: return "Freezing feet!!";}
|
||||
case DI_FROSTBITE_HANDS:
|
||||
@@ -1240,37 +1281,37 @@ std::string dis_name(disease dis)
|
||||
case 2: return "Frostbite - face";}
|
||||
case DI_HOT_HEAD:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot head";
|
||||
case 1: return "Warm head";
|
||||
case 2: return "Hot head!";
|
||||
case 3: return "Scorching head!!";}
|
||||
case DI_HOT_MOUTH:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot face";
|
||||
case 1: return "Warm face";
|
||||
case 2: return "Hot face!";
|
||||
case 3: return "Scorching face!!";}
|
||||
case DI_HOT_TORSO:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot torso";
|
||||
case 1: return "Warm torso";
|
||||
case 2: return "Hot torso!";
|
||||
case 3: return "Scorching torso!!";}
|
||||
case DI_HOT_ARMS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot arms";
|
||||
case 1: return "Warm arms";
|
||||
case 2: return "Hot arms!";
|
||||
case 3: return "Scorching arms!!";}
|
||||
case DI_HOT_HANDS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot hands";
|
||||
case 1: return "Warm hands";
|
||||
case 2: return "Hot hands!";
|
||||
case 3: return "Scorching hands!!";}
|
||||
case DI_HOT_LEGS:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot legs";
|
||||
case 1: return "Warm legs";
|
||||
case 2: return "Hot legs!";
|
||||
case 3: return "Scorching legs!!";}
|
||||
case DI_HOT_FEET:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Hot feet";
|
||||
case 1: return "Warm feet";
|
||||
case 2: return "Hot feet!";
|
||||
case 3: return "Scorching feet!!";}
|
||||
case DI_BLISTERS_MOUTH: return "Blisters - face";
|
||||
@@ -1325,6 +1366,7 @@ std::string dis_name(disease dis)
|
||||
return "Meth Comedown";
|
||||
|
||||
case DI_IN_PIT: return "Stuck in Pit";
|
||||
case DI_BOULDERING: return "Clambering Over Rubble";
|
||||
|
||||
case DI_STEMCELL_TREATMENT: return "Stem cell treatment";
|
||||
|
||||
@@ -1337,7 +1379,7 @@ std::string dis_name(disease dis)
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Snakebite Unlocked!";
|
||||
case 2: return "Viper Strike Unlocked!";
|
||||
default: return "VIPER BUG!!!!";
|
||||
default: return "Viper combo bug. (in disease.cpp:dis_name)";
|
||||
}
|
||||
case DI_BITE:
|
||||
if (dis.duration > 3000) return "Bite Wound";
|
||||
@@ -1388,25 +1430,25 @@ std::string dis_description(disease dis)
|
||||
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 3: return "Your arms are dangerously cold. Your arms are shivering uncontrollably";}
|
||||
|
||||
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 3: return "Your hands are dangerously cold. Your hands are shivering uncontrollably";}
|
||||
|
||||
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 3: return "Your legs are dangerously cold. Your strength is sapped.";}
|
||||
|
||||
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.";
|
||||
case 3: return "Your feet is dangerously cold. Your strength is sapped.";}
|
||||
case 3: return "Your feet are dangerously cold. Your strength is sapped.";}
|
||||
|
||||
case DI_FROSTBITE_HANDS:
|
||||
switch (dis.intensity) {
|
||||
@@ -1472,7 +1514,7 @@ std::string dis_description(disease dis)
|
||||
|
||||
case DI_HOT_FEET:
|
||||
switch (dis.intensity) {
|
||||
case 1: return "Your feet feel hot.";
|
||||
case 1: return "Your feet feel warm.";
|
||||
case 2: return "Your feet are painfully swollen due to the heat.";
|
||||
case 3: return "Your feet are painfully swollen due to the heat.";}
|
||||
|
||||
@@ -1513,6 +1555,25 @@ Loss of health - Torso";
|
||||
Loss of health - Entire Body\n\
|
||||
Your clothing and other equipment may be consumed by the flames.";
|
||||
|
||||
case DI_CRUSHED: return "\
|
||||
If you're seeing this, there is a bug in disease.cpp!";
|
||||
|
||||
case DI_BOULDERING:
|
||||
switch (dis.intensity){
|
||||
case 1:
|
||||
return "\
|
||||
Dexterity - 1; Speed -10%\
|
||||
You are being slowed by climbing over a pile of rubble";
|
||||
case 2:
|
||||
return "\
|
||||
Dexterity - 3; Speed -20%\
|
||||
You are being slowed by climbing over a heap of rubble";
|
||||
case 3:
|
||||
return "\
|
||||
Dexterity - 5; Speed -30%\
|
||||
You are being slowed by climbing over a mountain of rubble";
|
||||
}
|
||||
|
||||
case DI_BOOMERED: return "\
|
||||
Perception - 5\n\
|
||||
Range of Sight: 1; All sight is tinted magenta";
|
||||
@@ -1680,7 +1741,7 @@ You have an infected wound.";
|
||||
You are recovering from an infection.";
|
||||
|
||||
default:
|
||||
return "Who knows? This is probably a bug.";
|
||||
return "Who knows? This is probably a bug. (disease.cpp:dis_description)";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -8,7 +8,7 @@
|
||||
|
||||
#define MIN_DISEASE_AGE (-43200) // Permanent disease capped @ 3 days
|
||||
|
||||
struct game;
|
||||
class game;
|
||||
|
||||
void dis_msg(game *g, dis_type type);
|
||||
|
||||
|
||||
@@ -8,11 +8,27 @@
|
||||
enum material {
|
||||
MNULL = 0,
|
||||
//Food Materials
|
||||
LIQUID, VEGGY, FLESH, POWDER, HFLESH, //Human Flesh.
|
||||
VEGGY, FLESH, POWDER, HFLESH, //Human Flesh.
|
||||
//Clothing
|
||||
COTTON, WOOL, LEATHER, KEVLAR, FUR,
|
||||
COTTON, WOOL, LEATHER, KEVLAR, FUR, CHITIN,
|
||||
//Other
|
||||
STONE, PAPER, WOOD, PLASTIC, GLASS, IRON, STEEL, SILVER
|
||||
STONE, PAPER, WOOD, PLASTIC, GLASS, IRON, STEEL, SILVER,
|
||||
NUM_MAT_TYPES
|
||||
};
|
||||
|
||||
enum phase_id {
|
||||
PNULL, SOLID, LIQUID, GAS, PLASMA
|
||||
};
|
||||
|
||||
enum damage_type
|
||||
{
|
||||
DNULL = 0,
|
||||
BASH,
|
||||
CUT,
|
||||
ACID,
|
||||
ELECTRICITY,
|
||||
FIRE,
|
||||
NUM_DAM_TYPES
|
||||
};
|
||||
|
||||
struct point {
|
||||
|
||||
@@ -25,7 +25,7 @@ void event::actualize(game *g)
|
||||
tmp.attitude = NPCATT_DEFEND;
|
||||
tmp.posx = g->u.posx - SEEX * 2 + rng(-5, 5);
|
||||
tmp.posy = g->u.posy - SEEY * 2 + rng(-5, 5);
|
||||
g->active_npc.push_back(tmp);
|
||||
g->active_npc.push_back(&tmp);
|
||||
}
|
||||
} break;
|
||||
|
||||
@@ -124,8 +124,7 @@ void event::actualize(game *g)
|
||||
for (int y = 0; y < SEEY * MAPSIZE; y++) {
|
||||
if (g->m.ter(x, y) == t_grate) {
|
||||
g->m.ter_set(x, y, t_stairs_down);
|
||||
int j;
|
||||
if (!saw_grate && g->u_see(x, y, j))
|
||||
if (!saw_grate && g->u_see(x, y))
|
||||
saw_grate = true;
|
||||
}
|
||||
}
|
||||
@@ -230,8 +229,7 @@ void event::per_turn(game *g)
|
||||
return; // We're safely indoors!
|
||||
eyebot.spawn(place.x, place.y);
|
||||
g->z.push_back(eyebot);
|
||||
int t;
|
||||
if (g->u_see(place.x, place.y, t))
|
||||
if (g->u_see(place.x, place.y))
|
||||
g->add_msg("An eyebot swoops down nearby!");
|
||||
}
|
||||
} break;
|
||||
|
||||
+4
-4
@@ -57,7 +57,7 @@ faction::faction(int uid)
|
||||
mapy = 0;
|
||||
size = 0;
|
||||
power = 0;
|
||||
uid = id;
|
||||
id = uid;
|
||||
}
|
||||
|
||||
|
||||
@@ -92,9 +92,9 @@ void faction::load_info(std::string data)
|
||||
goal = faction_goal(goaltmp);
|
||||
job1 = faction_job(jobtmp1);
|
||||
job2 = faction_job(jobtmp2);
|
||||
int size, tmpop;
|
||||
dump >> size;
|
||||
for (int i = 0; i < size; i++) {
|
||||
int tmpsize, tmpop;
|
||||
dump >> tmpsize;
|
||||
for (int i = 0; i < tmpsize; i++) {
|
||||
dump >> tmpop;
|
||||
opinion_of.push_back(tmpop);
|
||||
}
|
||||
|
||||
@@ -59,6 +59,7 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
item *melting = &(i_at(x, y)[i]);
|
||||
if (melting->made_of(LIQUID) || melting->made_of(VEGGY) ||
|
||||
melting->made_of(FLESH) || melting->made_of(POWDER) ||
|
||||
melting->made_of(HFLESH) ||
|
||||
melting->made_of(COTTON) || melting->made_of(WOOL) ||
|
||||
melting->made_of(PAPER) || melting->made_of(PLASTIC) ||
|
||||
(melting->made_of(GLASS) && !one_in(3)) || one_in(4)) {
|
||||
@@ -87,17 +88,33 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
destroyed = false;
|
||||
vol = i_at(x, y)[i].volume();
|
||||
item *it = &(i_at(x, y)[i]);
|
||||
it_ammo *ammo_type = NULL;
|
||||
|
||||
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) {
|
||||
destroyed = true;
|
||||
// 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);
|
||||
}
|
||||
|
||||
if (it->is_ammo())
|
||||
{
|
||||
ammo_type = dynamic_cast<it_ammo*>(it->type);
|
||||
}
|
||||
if(ammo_type != NULL &&
|
||||
(ammo_type->ammo_effects & mfb(AMMO_FLAME) ||
|
||||
ammo_type->ammo_effects & mfb(AMMO_INCENDIARY) ||
|
||||
ammo_type->ammo_effects & mfb(AMMO_EXPLOSIVE) ||
|
||||
ammo_type->ammo_effects & mfb(AMMO_FRAG) ||
|
||||
ammo_type->ammo_effects & mfb(AMMO_NAPALM) ||
|
||||
ammo_type->ammo_effects & mfb(AMMO_EXPLOSIVE_BIG) ||
|
||||
ammo_type->ammo_effects & mfb(AMMO_TEARGAS) ||
|
||||
ammo_type->ammo_effects & mfb(AMMO_SMOKE) ||
|
||||
ammo_type->ammo_effects & mfb(AMMO_FLASHBANG) ||
|
||||
ammo_type->ammo_effects & mfb(AMMO_COOKOFF)))
|
||||
{
|
||||
const int rounds_exploded = rng(1, it->charges);
|
||||
// TODO: Vary the effect based on the ammo flag instead of just exploding them all.
|
||||
// cook off ammo instead of just burning it.
|
||||
for(int j = 0; j < (rounds_exploded / 10) + 1; j++)
|
||||
{
|
||||
g->explosion(x, y, ammo_type->damage / 2, true, false);
|
||||
}
|
||||
it->charges -= rounds_exploded;
|
||||
if(it->charges == 0) destroyed = true;
|
||||
} else if (it->made_of(PAPER)) {
|
||||
destroyed = it->burn(cur->density * 3);
|
||||
consumed++;
|
||||
@@ -128,7 +145,7 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
smoke++;
|
||||
}
|
||||
|
||||
} else if (it->made_of(FLESH)) {
|
||||
} else if ((it->made_of(FLESH))||(it->made_of(HFLESH))) {
|
||||
if (vol <= cur->density * 5 || (cur->density == 3 && one_in(vol / 20))) {
|
||||
cur->age--;
|
||||
destroyed = it->burn(cur->density);
|
||||
@@ -299,7 +316,7 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
for (int a = -1; a <= 1; a++) {
|
||||
for (int b = -1; b <= 1; b++) {
|
||||
if ((field_at(x+a, y+b).type == fd_smoke &&
|
||||
field_at(x+a, y+b).density < 3 ) ||
|
||||
field_at(x+a, y+b).density < 3) ||
|
||||
(field_at(x+a, y+b).is_null() && move_cost(x+a, y+b) > 0))
|
||||
spread.push_back(point(x+a, y+b));
|
||||
}
|
||||
@@ -563,18 +580,16 @@ bool map::process_fields_in_submap(game *g, int gridn)
|
||||
mondex = g->mon_at(newp.x, newp.y);
|
||||
|
||||
if (npcdex != -1) {
|
||||
int junk;
|
||||
npc *p = &(g->active_npc[npcdex]);
|
||||
npc *p = g->active_npc[npcdex];
|
||||
p->hit(g, random_body_part(), rng(0, 1), 6, 0);
|
||||
if (g->u_see(newp.x, newp.y, junk))
|
||||
if (g->u_see(newp.x, newp.y))
|
||||
g->add_msg("A %s hits %s!", tmp.tname().c_str(), p->name.c_str());
|
||||
}
|
||||
|
||||
if (mondex != -1) {
|
||||
int junk;
|
||||
monster *mon = &(g->z[mondex]);
|
||||
mon->hurt(6 - mon->armor_bash());
|
||||
if (g->u_see(newp.x, newp.y, junk))
|
||||
if (g->u_see(newp.x, newp.y))
|
||||
g->add_msg("A %s hits the %s!", tmp.tname().c_str(),
|
||||
mon->name().c_str());
|
||||
}
|
||||
@@ -673,6 +688,10 @@ void map::step_in_field(int x, int y, game *g)
|
||||
inside = (veh && veh->is_inside(veh_part));
|
||||
}
|
||||
|
||||
if (cur->type != fd_rubble){
|
||||
g->u.rem_disease(DI_BOULDERING);
|
||||
}
|
||||
|
||||
switch (cur->type) {
|
||||
case fd_null:
|
||||
case fd_blood: // It doesn't actually do anything
|
||||
@@ -747,6 +766,10 @@ void map::step_in_field(int x, int y, game *g)
|
||||
}
|
||||
break;
|
||||
|
||||
case fd_rubble:
|
||||
g->u.add_disease(DI_BOULDERING, 0, g, cur->density, 3);
|
||||
break;
|
||||
|
||||
case fd_smoke:
|
||||
if (cur->density == 3 && !inside)
|
||||
{
|
||||
@@ -861,7 +884,7 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
|
||||
break;
|
||||
|
||||
case fd_fire:
|
||||
if (z->made_of(FLESH))
|
||||
if ( z->made_of(FLESH) || z->made_of(HFLESH) )
|
||||
dam = 3;
|
||||
if (z->made_of(VEGGY))
|
||||
dam = 12;
|
||||
@@ -894,6 +917,11 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
|
||||
}
|
||||
// Drop through to smoke
|
||||
|
||||
case fd_rubble:
|
||||
if (!z->has_flag(MF_FLIES) && !z->has_flag(MF_AQUATIC))
|
||||
z->add_effect(ME_BOULDERING, 1);
|
||||
break;
|
||||
|
||||
case fd_smoke:
|
||||
if (!z->has_flag(MF_NO_BREATHE)){
|
||||
if (cur->density == 3)
|
||||
@@ -904,7 +932,8 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
|
||||
break;
|
||||
|
||||
case fd_tear_gas:
|
||||
if ((z->made_of(FLESH) || z->made_of(VEGGY)) && !z->has_flag(MF_NO_BREATHE)) {
|
||||
if ((z->made_of(FLESH) || z->made_of(HFLESH) || 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));
|
||||
@@ -948,7 +977,7 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
|
||||
break;
|
||||
|
||||
case fd_flame_burst:
|
||||
if (z->made_of(FLESH))
|
||||
if (z->made_of(FLESH) || z->made_of(HFLESH))
|
||||
dam = 3;
|
||||
if (z->made_of(VEGGY))
|
||||
dam = 12;
|
||||
@@ -981,9 +1010,9 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
|
||||
if (tries == 10)
|
||||
g->explode_mon(g->mon_at(z->posx, z->posy));
|
||||
else {
|
||||
int mon_hit = g->mon_at(newposx, newposy), t;
|
||||
int mon_hit = g->mon_at(newposx, newposy);
|
||||
if (mon_hit != -1) {
|
||||
if (g->u_see(z, t))
|
||||
if (g->u_see(z))
|
||||
g->add_msg("The %s teleports into a %s, killing them both!",
|
||||
z->name().c_str(), g->z[mon_hit].name().c_str());
|
||||
g->explode_mon(mon_hit);
|
||||
@@ -1008,3 +1037,84 @@ bool vector_has(std::vector <item> vec, itype_id type)
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
void map::field_effect(int x, int y, game *g) //Applies effect of field immediately
|
||||
{
|
||||
field *cur = &field_at(x, y);
|
||||
switch (cur->type) { //Can add independent code for different types of fields to apply different effects
|
||||
case fd_rubble:
|
||||
int hit_chance = 10;
|
||||
int fdmon = g->mon_at(x, y); //The index of the monster at (x,y), or -1 if there isn't one
|
||||
int fdnpc = g->npc_at(x, y); //The index of the NPC at (x,y), or -1 if there isn't one
|
||||
npc *me = NULL;
|
||||
if (fdnpc != -1)
|
||||
me = g->active_npc[fdnpc];
|
||||
int veh_part;
|
||||
bool pc_inside = false;
|
||||
bool npc_inside = false;
|
||||
|
||||
if (g->u.in_vehicle) {
|
||||
vehicle *veh = g->m.veh_at(x, y, veh_part);
|
||||
pc_inside = (veh && veh->is_inside(veh_part));
|
||||
}
|
||||
if (me && me->in_vehicle) {
|
||||
vehicle *veh = g->m.veh_at(x, y, veh_part);
|
||||
npc_inside = (veh && veh->is_inside(veh_part));
|
||||
}
|
||||
if (g->u.posx == x && g->u.posy == y && !pc_inside) { //If there's a PC at (x,y) and he's not in a covered vehicle...
|
||||
if (g->u.dodge(g) < rng(1, hit_chance) || one_in(g->u.dodge(g))) {
|
||||
int how_many_limbs_hit = rng(0, num_hp_parts);
|
||||
for ( int i = 0 ; i < how_many_limbs_hit ; i++ ) {
|
||||
g->u.hp_cur[rng(0, num_hp_parts)] -= rng(0, 10);
|
||||
g->add_msg("You are hit by the falling debris!");
|
||||
}
|
||||
if (one_in(g->u.dex_cur)) {
|
||||
g->u.add_disease(DI_DOWNED, 2, g);
|
||||
}
|
||||
if (one_in(g->u.str_cur)) {
|
||||
g->u.add_disease(DI_STUNNED, 2, g);
|
||||
}
|
||||
}
|
||||
else if (one_in(g->u.str_cur)) {
|
||||
g->add_msg("You trip as you evade the falling debris!");
|
||||
g->u.add_disease(DI_DOWNED, 1, g);
|
||||
}
|
||||
//Avoiding disease system for the moment, since I was having trouble with it.
|
||||
// g->u.add_disease(DI_CRUSHED, 42, g); //Using a disease allows for easy modification without messing with field code
|
||||
// g->u.rem_disease(DI_CRUSHED); //For instance, if we wanted to easily add a chance of limb mangling or a stun effect later
|
||||
}
|
||||
if (fdmon != -1 && fdmon < g->z.size()) { //If there's a monster at (x,y)...
|
||||
monster* monhit = &(g->z[fdmon]);
|
||||
int dam = 10; //This is a simplistic damage implementation. It can be improved, for instance to account for armor
|
||||
if (monhit->hurt(dam)) //Ideally an external disease-like system would handle this to make it easier to modify later
|
||||
g->kill_mon(fdmon, false);
|
||||
}
|
||||
if (fdnpc != -1) {
|
||||
if (fdnpc < g->active_npc.size() && !npc_inside) { //If there's an NPC at (x,y) and he's not in a covered vehicle...
|
||||
if (me->dodge(g) < rng(1, hit_chance) || one_in(me->dodge(g))) {
|
||||
int how_many_limbs_hit = rng(0, num_hp_parts);
|
||||
for ( int i = 0 ; i < how_many_limbs_hit ; i++ ) {
|
||||
me->hp_cur[rng(0, num_hp_parts)] -= rng(0, 10);
|
||||
}
|
||||
if (one_in(me->dex_cur)) {
|
||||
me->add_disease(DI_DOWNED, 2, g);
|
||||
}
|
||||
if (one_in(me->str_cur)) {
|
||||
me->add_disease(DI_STUNNED, 2, g);
|
||||
}
|
||||
}
|
||||
else if (one_in(me->str_cur)) {
|
||||
me->add_disease(DI_DOWNED, 1, g);
|
||||
}
|
||||
}
|
||||
if (me->hp_cur[hp_head] <= 0 || me->hp_cur[hp_torso] <= 0) {
|
||||
me->die(g, false); //Right now cave-ins are treated as not the player's fault. This should be iterated on.
|
||||
g->active_npc.erase(g->active_npc.begin() + fdnpc);
|
||||
} //Still need to add vehicle damage, but I'm ignoring that for now.
|
||||
}
|
||||
vehicle *veh = veh_at(x, y, veh_part);
|
||||
if (veh) {
|
||||
veh->damage(veh_part, ceil(veh->parts[veh_part].hp/3.0 * cur->density), 1, false);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -25,6 +25,7 @@
|
||||
#include "action.h"
|
||||
#include <vector>
|
||||
#include <map>
|
||||
#include <list>
|
||||
#include <stdarg.h>
|
||||
|
||||
// Fixed window sizes
|
||||
@@ -118,8 +119,9 @@ class game
|
||||
// Sound at (x, y) of intensity (vol), described to the player is (description)
|
||||
void sound(int x, int y, int vol, std::string description);
|
||||
// creates a list of coordinates to draw footsteps
|
||||
void add_footstep(int x, int y, int volume, int distance);
|
||||
std::vector<point> footsteps;
|
||||
void add_footstep(int x, int y, int volume, int distance, monster* source);
|
||||
std::vector<std::vector<point> > footsteps;
|
||||
std::vector<monster*> footsteps_source;
|
||||
// visual cue to monsters moving out of the players sight
|
||||
void draw_footsteps();
|
||||
// Explosion at (x, y) of intensity (power), with (shrapnel) chunks of shrapnel
|
||||
@@ -143,6 +145,8 @@ class game
|
||||
// Kill that monster; fixes any pointers etc
|
||||
void kill_mon(int index, bool player_did_it = false);
|
||||
void explode_mon(int index); // Explode a monster; like kill_mon but messier
|
||||
void revive_corpse(int x, int y, int n); // revives a corpse from an item pile
|
||||
void revive_corpse(int x, int y, item *it); // revives a corpse by item pointer, caller handles item deletion
|
||||
// hit_monster_with_flags processes ammo flags (e.g. incendiary, etc)
|
||||
void hit_monster_with_flags(monster &z, unsigned int flags);
|
||||
void plfire(bool burst); // Player fires a gun (target selection)...
|
||||
@@ -153,6 +157,8 @@ class game
|
||||
std::vector<point> &trajectory);
|
||||
void cancel_activity();
|
||||
void cancel_activity_query(const char* message, ...);
|
||||
bool cancel_activity_or_ignore_query(const char* reason, ...);
|
||||
|
||||
int assign_mission_id(); // Just returns the next available one
|
||||
void give_mission(mission_id type); // Create the mission and assign it
|
||||
void assign_mission(int id); // Just assign an existing mission
|
||||
@@ -175,7 +181,7 @@ class game
|
||||
void teleport(player *p = NULL);
|
||||
void plswim(int x, int y); // Called by plmove. Handles swimming
|
||||
// when player is thrown (by impact or something)
|
||||
void fling_player_or_monster(player *p, monster *zz, int dir, int flvel);
|
||||
void fling_player_or_monster(player *p, monster *zz, const int& dir, float flvel);
|
||||
|
||||
void nuke(int x, int y);
|
||||
std::vector<faction *> factions_at(int x, int y);
|
||||
@@ -187,8 +193,8 @@ class game
|
||||
int assign_faction_id();
|
||||
faction* faction_by_id(int it);
|
||||
bool sees_u(int x, int y, int &t);
|
||||
bool u_see (int x, int y, int &t);
|
||||
bool u_see (monster *mon, int &t);
|
||||
bool u_see (int x, int y);
|
||||
bool u_see (monster *mon);
|
||||
bool pl_sees(player *p, monster *mon, int &t);
|
||||
void refresh_all();
|
||||
void update_map(int &x, int &y); // Called by plmove when the map updates
|
||||
@@ -207,17 +213,26 @@ class game
|
||||
point look_around();// Look at nearby terrain ';'
|
||||
void list_items(); //List all items around the player
|
||||
bool list_items_match(std::string sText, std::string sPattern);
|
||||
std::string sFilter;
|
||||
int list_filter_high_priority(std::vector<map_item_stack> &stack, std::string prorities);
|
||||
int list_filter_low_priority(std::vector<map_item_stack> &stack,int start, std::string prorities);
|
||||
std::vector<map_item_stack> filter_item_stacks(std::vector<map_item_stack> stack, std::string filter);
|
||||
std::vector<map_item_stack> find_nearby_items(int search_x, int search_y);
|
||||
std::string ask_item_filter(WINDOW* window, int rows);
|
||||
void draw_trail_to_square(std::vector<point>& vPoint, int x, int y);
|
||||
void reset_item_list_state(WINDOW* window, int height);
|
||||
std::string sFilter; // this is a member so that it's remembered over time
|
||||
std::string list_item_upvote;
|
||||
std::string list_item_downvote;
|
||||
char inv(std::string title = "Inventory:");
|
||||
char inv_type(std::string title = "Inventory:", int inv_item_type = 0);
|
||||
char inv_type(std::string title = "Inventory:", item_cat inv_item_type = IC_NULL);
|
||||
std::vector<item> multidrop();
|
||||
faction* list_factions(std::string title = "FACTIONS:");
|
||||
point find_item(item *it);
|
||||
void remove_item(item *it);
|
||||
|
||||
inventory crafting_inventory(); // inv_from_map, inv, & 'weapon'
|
||||
void consume_items(std::vector<component> components);
|
||||
void consume_tools(std::vector<component> tools);
|
||||
inventory crafting_inventory(player *p); // inv_from_map, inv, & 'weapon'
|
||||
std::list<item> consume_items(player *p, std::vector<component> components);
|
||||
void consume_tools(player *p, std::vector<component> tools, bool force_available);
|
||||
|
||||
bool has_gametype() const { return gamemode && gamemode->id() != SGAME_NULL; }
|
||||
special_game_id gametype() const { return (gamemode) ? gamemode->id() : SGAME_NULL; }
|
||||
@@ -226,7 +241,7 @@ class game
|
||||
std::vector <mtype*> mtypes;
|
||||
std::vector <vehicle*> vtypes;
|
||||
std::vector <trap*> traps;
|
||||
std::vector<recipe*> recipes; // The list of valid recipes
|
||||
recipe_map recipes; // The list of valid recipes
|
||||
std::vector<constructable*> constructions; // The list of constructions
|
||||
|
||||
std::vector <itype_id> mapitems[num_itloc]; // Items at various map types
|
||||
@@ -238,15 +253,18 @@ class game
|
||||
calendar turn;
|
||||
signed char temperature; // The air temperature
|
||||
weather_type weather; // Weather pattern--SEE weather.h
|
||||
|
||||
std::list<weather_segment> future_weather;
|
||||
|
||||
char nextinv; // Determines which letter the next inv item will have
|
||||
overmap cur_om;
|
||||
overmap *cur_om;
|
||||
map m;
|
||||
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<npc *> active_npc;
|
||||
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
|
||||
@@ -254,8 +272,6 @@ class game
|
||||
std::vector<item> items_dragged;
|
||||
int weight_dragged; // Computed once, when you start dragging
|
||||
bool debugmon;
|
||||
bool starting_npc;
|
||||
bool random_npc;
|
||||
|
||||
std::map<int, std::map<int, bool> > mapRain;
|
||||
|
||||
@@ -273,18 +289,33 @@ class game
|
||||
|
||||
void open_gate( game *g, const int examx, const int examy, const enum ter_id handle_type );
|
||||
|
||||
recipe* recipe_by_name(std::string name); // See crafting.cpp
|
||||
|
||||
bionic_id random_good_bionic() const; // returns a non-faulty, valid bionic
|
||||
|
||||
void load_artifacts(); // Load artifact data
|
||||
// Needs to be called by main() before MAPBUFFER.load
|
||||
|
||||
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_weather(std::ifstream &fin);
|
||||
void load(std::string name); // Load a player-specific save file
|
||||
void start_game(); // Starts a new game
|
||||
void start_special_game(special_game_id gametype); // See gamemode.cpp
|
||||
|
||||
//private save functions.
|
||||
void save_factions_missions_npcs();
|
||||
void save_artifacts();
|
||||
void save_maps();
|
||||
std::string save_weather() const;
|
||||
|
||||
// Data Initialization
|
||||
void init_itypes(); // Initializes item types
|
||||
void init_skills();
|
||||
void init_bionics(); // Initializes bionics... for now.
|
||||
void init_mapitems(); // Initializes item placement
|
||||
void init_mtypes(); // Initializes monster types
|
||||
@@ -298,15 +329,14 @@ 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
|
||||
|
||||
void create_factions(); // Creates new factions (for a new game world)
|
||||
void load_npcs(); //Make any nearby NPCs from the overmap active.
|
||||
void create_starting_npcs(); // Creates NPCs that start near you
|
||||
|
||||
// Player actions
|
||||
@@ -327,13 +357,19 @@ class game
|
||||
recipe* select_crafting_recipe(); // See crafting.cpp
|
||||
bool making_would_work(recipe *r); // See crafting.cpp
|
||||
bool can_make(recipe *r); // See crafting.cpp
|
||||
bool check_enough_materials(recipe *r, inventory crafting_inv);
|
||||
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,std::string filter);// crafting.cpp
|
||||
void add_known_recipes(std::vector<recipe*> ¤t, recipe_list source,
|
||||
std::string filter = ""); //crafting.cpp
|
||||
craft_cat next_craft_cat(craft_cat cat); // crafting.cpp
|
||||
craft_cat prev_craft_cat(craft_cat cat); // crafting.cpp
|
||||
void disassemble(char ch = 0); // See crafting.cpp
|
||||
void complete_disassemble(); // See crafting.cpp
|
||||
recipe* recipe_by_index(int index); // 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,
|
||||
@@ -344,6 +380,7 @@ class game
|
||||
bool vehicle_near ();
|
||||
void handbrake ();
|
||||
void examine();// Examine nearby terrain 'e'
|
||||
void advanced_inv();
|
||||
// open vehicle interaction screen
|
||||
void exam_vehicle(vehicle &veh, int examx, int examy, int cx=0, int cy=0);
|
||||
void pickup(int posx, int posy, int min);// Pickup items; ',' or via examine()
|
||||
@@ -352,7 +389,7 @@ class game
|
||||
void compare(int iCompareX = -999, int iCompareY = -999); // Compare two Items 'I'
|
||||
void drop(char chInput = '.'); // Drop an item 'd'
|
||||
void drop_in_direction(); // Drop w/ direction 'D'
|
||||
void reassign_item(); // Reassign the letter of an item '='
|
||||
void reassign_item(char ch = '.'); // Reassign the letter of an item '='
|
||||
void butcher(); // Butcher a corpse 'B'
|
||||
void complete_butcher(int index); // Finish the butchering process
|
||||
void forage(); // Foraging ('a' on underbrush)
|
||||
@@ -363,7 +400,7 @@ class game
|
||||
void takeoff(char chInput = '.'); // Remove armor 'T'
|
||||
void reload(); // Reload a wielded gun/tool 'r'
|
||||
void reload(char chInput);
|
||||
void unload(); // Unload a wielded gun/tool 'U'
|
||||
void unload(item& it); // Unload a gun/tool 'U'
|
||||
void unload(char chInput);
|
||||
void wield(char chInput = '.'); // Wield a weapon 'w'
|
||||
void read(); // Read a book 'R' (or 'a')
|
||||
@@ -397,6 +434,7 @@ class game
|
||||
void update_weather(); // Updates the temperature and weather patten
|
||||
void hallucinate(const int x, const int y); // Prints hallucination junk to the screen
|
||||
void mon_info(); // Prints a list of nearby monsters (top right)
|
||||
void handle_key_blocking_activity(); // Abort reading etc.
|
||||
bool handle_action();
|
||||
void update_scent(); // Updates the scent map
|
||||
bool is_game_over(); // Returns true if the player quit or died
|
||||
@@ -445,12 +483,18 @@ class game
|
||||
int kills[num_monsters]; // Player's kill count
|
||||
std::string last_action; // The keypresses of last turn
|
||||
|
||||
int last_inv_start, last_inv_sel; // workaround until inventory_ui.cpp is rewritten
|
||||
int advanced_inv_leftsort, advanced_inv_rightsort;
|
||||
|
||||
int moves_since_last_save;
|
||||
int item_exchanges_since_save;
|
||||
time_t last_save_timestamp;
|
||||
unsigned char latest_lightlevel;
|
||||
calendar latest_lightlevel_turn;
|
||||
|
||||
special_game *gamemode;
|
||||
|
||||
int moveCount; //Times the player has moved (not pause, sleep, etc)
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+3
-3
@@ -5,10 +5,10 @@ std::string special_game_name(special_game_id id)
|
||||
{
|
||||
switch (id) {
|
||||
case SGAME_NULL:
|
||||
case NUM_SPECIAL_GAMES: return "nethack (this is a bug)";
|
||||
case NUM_SPECIAL_GAMES: return "Bug (gamemode.cpp:special_game_name)";
|
||||
case SGAME_TUTORIAL: return "Tutorial";
|
||||
case SGAME_DEFENSE: return "Defense";
|
||||
default: return "Uncoded (this is a bug)";
|
||||
default: return "Uncoded (gamemode.cpp:special_game_name)";
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,7 @@ special_game* get_special_game(special_game_id id)
|
||||
ret = new defense_game;
|
||||
break;
|
||||
default:
|
||||
debugmsg("Missing something in get_special_game()?");
|
||||
debugmsg("Missing something in gamemode.cpp:get_special_game()?");
|
||||
ret = new special_game;
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -22,6 +22,7 @@ special_game* get_special_game(special_game_id id);
|
||||
|
||||
struct special_game
|
||||
{
|
||||
virtual ~special_game() { return; };
|
||||
virtual special_game_id id() { return SGAME_NULL; };
|
||||
// init is run when the game begins
|
||||
virtual bool init(game *g) { return true; };
|
||||
|
||||
@@ -39,7 +39,7 @@ c: Viewing k: Traps\n\
|
||||
d: Hunger, Thirst, and Sleep l: Items overview\n\
|
||||
e: Pain and Stimulants m: Combat\n\
|
||||
f: Addiction n: Unarmed Styles\n\
|
||||
g: Morale and XP o: Survival tips\n\
|
||||
g: Morale and Learning o: Survival tips\n\
|
||||
h: Radioactivity and Mutation\n\
|
||||
\n\
|
||||
1: List of all commands (you can change key commands here)\n\
|
||||
@@ -221,14 +221,24 @@ Press any key for more...");
|
||||
getch();
|
||||
werase(w_help);
|
||||
mvwprintz(w_help, 0, 0, c_white, "\
|
||||
Morale is also responsible for filling your XP pool. This XP pool is used\n\
|
||||
for improving your skills; as you use your skills, points are taken from the\n\
|
||||
XP pool and placed into the skill used. If your XP pool is empty, your\n\
|
||||
skills cannot be improved except through the use of books.\n\
|
||||
Morale is also responsible for ensuring you can learn effectively, via a\n\
|
||||
mechanic referred to as 'focus'. Your focus level is a measure of how\n\
|
||||
effectively you can learn. The natural level is 100, which indicates normal\n\
|
||||
learning potential. Higher or lower focus levels make it easier or harder to\n\
|
||||
learn from practical experience.\n\
|
||||
\n\
|
||||
Your XP pool will not fill unless your morale is at least 0. A morale level\n\
|
||||
between 0 and 100 gives the percentage chance for your XP to increase by 1\n\
|
||||
each turn. Above 100, you get 1 XP point each turn for every 100 morale.");
|
||||
Your focus level has a natural set point that it converges towards. When your\n\
|
||||
focus is much lower - or higher - than this set point, it will change faster\n\
|
||||
than when it is near the set point. Having high morale will raise the set\n\
|
||||
point, and having low morale will lower the set point. Pain is also factored\n\
|
||||
into the set point calculation - it's harder to learn when you're in pain.\n\
|
||||
\n\
|
||||
Your focus is also lowered by certain activities. Training your skills\n\
|
||||
through real-world practice lowers your focus gradually, by an amount that\n\
|
||||
depends on your current level of focus (higher focus means larger decreases,\n\
|
||||
as well as improved learning). Training your skills by reading books\n\
|
||||
decreases your focus rapidly, by giving a significant penalty to the set\n\
|
||||
point of your focus.");
|
||||
wrefresh(w_help);
|
||||
refresh();
|
||||
getch();
|
||||
@@ -487,7 +497,7 @@ extremities from frostbite and to keep your distance from large fires.");
|
||||
case '1': {
|
||||
werase(w_help);
|
||||
int offset = 1;
|
||||
char ch = ' ';
|
||||
char remapch = ' ';
|
||||
bool changed_keymap = false;
|
||||
bool needs_refresh = true;
|
||||
do {
|
||||
@@ -508,7 +518,7 @@ extremities from frostbite and to keep your distance from large fires.");
|
||||
}
|
||||
// Clear the lines
|
||||
for (int i = 0; i < 23; i++)
|
||||
mvwprintz(w_help, i, 0, c_black, " ");
|
||||
mvwprintz(w_help, i, 0, c_black, " ");
|
||||
|
||||
for (int i = 0; i < 23 && offset + i < NUM_ACTIONS; i++) {
|
||||
std::vector<char> keys = keys_bound_to( action_id(offset + i) );
|
||||
@@ -526,14 +536,14 @@ extremities from frostbite and to keep your distance from large fires.");
|
||||
}
|
||||
wrefresh(w_help);
|
||||
refresh();
|
||||
ch = input();
|
||||
remapch = input();
|
||||
int sx = 0, sy = 0;
|
||||
get_direction(this, sx, sy, ch);
|
||||
get_direction(this, sx, sy, remapch);
|
||||
if (sy == -1 && offset > 1)
|
||||
offset--;
|
||||
if (sy == 1 && offset + 20 < NUM_ACTIONS)
|
||||
offset++;
|
||||
if (ch == '-' || ch == '+') {
|
||||
if (remapch == '-' || remapch == '+') {
|
||||
needs_refresh = true;
|
||||
for (int i = 0; i < 23 && i + offset < NUM_ACTIONS; i++) {
|
||||
mvwprintz(w_help, i, 0, c_ltblue, "%c", 'a' + i);
|
||||
@@ -545,10 +555,10 @@ extremities from frostbite and to keep your distance from large fires.");
|
||||
if (actch >= 'a' && actch <= 'a' + 24 &&
|
||||
actch - 'a' + offset < NUM_ACTIONS) {
|
||||
action_id act = action_id(actch - 'a' + offset);
|
||||
if (ch == '-' && query_yn("Clear keys for %s?",action_name(act).c_str())){
|
||||
if (remapch == '-' && query_yn("Clear keys for %s?",action_name(act).c_str())){
|
||||
clear_bindings(act);
|
||||
changed_keymap = true;
|
||||
} else if (ch == '+') {
|
||||
} else if (remapch == '+') {
|
||||
char newbind = popup_getkey("New key for %s:", action_name(act).c_str());
|
||||
if (keymap.find(newbind) == keymap.end()) { // It's not in use! Good.
|
||||
keymap[ newbind ] = act;
|
||||
@@ -559,7 +569,7 @@ extremities from frostbite and to keep your distance from large fires.");
|
||||
}
|
||||
}
|
||||
}
|
||||
} while (ch != 'q' && ch != 'Q' && ch != KEY_ESCAPE);
|
||||
} while (remapch != 'q' && remapch != 'Q' && remapch != KEY_ESCAPE);
|
||||
if (changed_keymap && query_yn("Save changes?"))
|
||||
save_keymap();
|
||||
werase(w_help);
|
||||
@@ -707,7 +717,7 @@ O Parking lot - Empty lot, few items. Mostly useless.");
|
||||
Handguns are small weapons held in one or both hands. They are much more\n\
|
||||
difficult to aim and control than larger firearms, and this is reflected in\n\
|
||||
their poor accuracy. However, their small size makes them appropriate for\n\
|
||||
short-range combat, where largers guns fare poorly.\n\
|
||||
short-range combat, where larger guns fare poorly.\n\
|
||||
They are also relatively quick to reload, and use a very wide selection of\n\
|
||||
ammunition. Their small size and low weight make it possible to carry\n\
|
||||
several loaded handguns, switching from one to the next once their ammo is\n\
|
||||
@@ -794,7 +804,7 @@ making them very good at clearing out large numbers of enemies.");
|
||||
mvwprintz(w_help, 10, 0, c_magenta, "( Energy Weapons");
|
||||
mvwprintz(w_help, 11, 0, c_white, "\
|
||||
Energy weapons is an umbrella term used to describe a variety of rifles and\n\
|
||||
handguns which fire lasers, plasma, or energy atttacks. They started to\n\
|
||||
handguns which fire lasers, plasma, or energy attacks. They started to\n\
|
||||
appear in military use just prior to the start of the apocalypse, and as such\n\
|
||||
are very difficult to find.\n\
|
||||
Energy weapons have no recoil at all; they are nearly silent, have a long\n\
|
||||
|
||||
+24
@@ -0,0 +1,24 @@
|
||||
#include "helper.h"
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
namespace helper
|
||||
{
|
||||
int to_int(std::string str)
|
||||
{
|
||||
std::istringstream buffer(str);
|
||||
int value;
|
||||
buffer >> value;
|
||||
if(str != to_string(value)) //if the converted value is different then return 0 (similar to atoi)
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
return value;
|
||||
}
|
||||
std::string to_string(int i)
|
||||
{
|
||||
std::stringstream sstr;
|
||||
sstr << i;
|
||||
std::string str1 = sstr.str();
|
||||
return str1;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,10 @@
|
||||
#ifndef _HELPER_H_
|
||||
#define _HELPER_H_
|
||||
#include <string>
|
||||
#include <sstream>
|
||||
namespace helper
|
||||
{
|
||||
int to_int(std::string str);
|
||||
std::string to_string(int i);
|
||||
}
|
||||
#endif
|
||||
+233
-87
@@ -5,6 +5,7 @@
|
||||
// Livingstone
|
||||
//
|
||||
|
||||
#include "item_factory.h"
|
||||
#include "iuse.h"
|
||||
#include "game.h"
|
||||
#include "mapdata.h"
|
||||
@@ -32,7 +33,7 @@ void iexamine::gaspump(game *g, player *p, map *m, int examx, int examy) {
|
||||
p->moves -= 300;
|
||||
g->handle_liquid(gas, false, true);
|
||||
}
|
||||
if (one_in(50)) {
|
||||
if (one_in(10)) {
|
||||
g->add_msg("With a clang and a shudder, the gas pump goes silent.");
|
||||
m->ter_set(examx, examy, t_gas_pump_empty);
|
||||
}
|
||||
@@ -91,7 +92,7 @@ void iexamine::cardreader(game *g, player *p, map *m, int examx, int examy) {
|
||||
query_yn("Use fingerhack on the reader?"));
|
||||
if (using_electrohack || using_fingerhack) {
|
||||
p->moves -= 500;
|
||||
p->practice("computer", 20);
|
||||
p->practice(g->turn, "computer", 20);
|
||||
int success = rng(p->skillLevel("computer") / 4 - 2, p->skillLevel("computer") * 2);
|
||||
success += rng(-3, 3);
|
||||
if (using_fingerhack)
|
||||
@@ -185,8 +186,8 @@ void iexamine::tent(game *g, player *p, map *m, int examx, int examy) {
|
||||
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);
|
||||
item dropped(g->itypes["tent_kit"], g->turn);
|
||||
m->add_item(examx, examy, dropped);
|
||||
}
|
||||
|
||||
void iexamine::shelter(game *g, player *p, map *m, int examx, int examy) {
|
||||
@@ -199,8 +200,8 @@ void iexamine::shelter(game *g, player *p, map *m, int examx, int examy) {
|
||||
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);
|
||||
item dropped(g->itypes["shelter_kit"], g->turn);
|
||||
m->add_item(examx, examy, dropped);
|
||||
}
|
||||
|
||||
void iexamine::wreckage(game *g, player *p, map *m, int examx, int examy) {
|
||||
@@ -225,60 +226,86 @@ void iexamine::wreckage(game *g, player *p, map *m, int examx, int examy) {
|
||||
}
|
||||
}
|
||||
|
||||
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(game *g, player *p, map *m, int examx, int examy)
|
||||
{
|
||||
bool player_has = false;
|
||||
bool map_has = false;
|
||||
inventory map_inv;
|
||||
map_inv.form_from_map(g, point(p->posx, p->posy), 1);
|
||||
|
||||
// check if player has 2x4
|
||||
player_has = p->has_amount("2x4", 1);
|
||||
|
||||
// check if map has 2x4 in a 1-tile radius around player
|
||||
map_has = map_inv.has_amount("2x4", 1);
|
||||
|
||||
// return if there is no 2x4 around
|
||||
if (!player_has && !map_has)
|
||||
{
|
||||
none(g, p, m, examx, examy);
|
||||
return;
|
||||
}
|
||||
|
||||
if (query_yn("Place a plank over the pit?"))
|
||||
{
|
||||
// if both have, then ask to use the one on the map
|
||||
if (player_has && map_has)
|
||||
{
|
||||
if (query_yn("Use the plank at your feet?"))
|
||||
{
|
||||
m->use_amount(point(p->posx, p->posy), 1, "2x4", 1, false);
|
||||
}
|
||||
else
|
||||
{
|
||||
p->use_amount("2x4", 1);
|
||||
}
|
||||
}
|
||||
else if (player_has && !map_has) // only player has plank
|
||||
{
|
||||
p->use_amount("2x4", 1);
|
||||
}
|
||||
else if (!player_has && map_has) // only map has plank
|
||||
{
|
||||
m->use_amount(point(p->posx, p->posy), 1, "2x4", 1, false);
|
||||
}
|
||||
|
||||
if( m->ter(examx, examy) == t_pit )
|
||||
{
|
||||
m->ter_set(examx, examy, t_pit_covered);
|
||||
}
|
||||
else if( m->ter(examx, examy) == t_pit_spiked )
|
||||
{
|
||||
m->ter_set(examx, examy, t_pit_spiked_covered);
|
||||
}
|
||||
g->add_msg("You place a plank of wood over the pit.");
|
||||
}
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
|
||||
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);
|
||||
}
|
||||
item plank(g->itypes["2x4"], g->turn);
|
||||
g->add_msg("You remove the plank.");
|
||||
m->add_item(p->posx, p->posy, plank);
|
||||
|
||||
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);
|
||||
if( m->ter(examx, examy) == t_pit_covered )
|
||||
{
|
||||
m->ter_set(examx, examy, t_pit);
|
||||
}
|
||||
else if( m->ter(examx, examy) == t_pit_spiked_covered )
|
||||
{
|
||||
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",
|
||||
int ch = menu(true, "Fence Construction:", "Rope Fence", "Wire Fence",
|
||||
"Barbed Wire Fence", "Cancel", NULL);
|
||||
switch (ch){
|
||||
case 1:{
|
||||
@@ -382,7 +409,9 @@ void iexamine::bulletin_board(game *g, player *p, map *m, int examx, int 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;
|
||||
// Causes a warning due to being unused, but don't want to delete since
|
||||
// it's clearly what's intened for future functionality.
|
||||
//int choice = menu_vec(true, camp->board_name().c_str(), options) - 1;
|
||||
}
|
||||
else {
|
||||
bool create_camp = m->allow_camp(examx, examy);
|
||||
@@ -391,7 +420,7 @@ void iexamine::bulletin_board(game *g, player *p, map *m, int examx, int examy)
|
||||
options.push_back("Create camp");
|
||||
options.push_back("Cancel");
|
||||
// TODO: Other Bulletin Boards
|
||||
int choice = menu_vec("Bulletin Board", options) - 1;
|
||||
int choice = menu_vec(true, "Bulletin Board", options) - 1;
|
||||
if (choice >= 0 && choice < options.size()) {
|
||||
if (options[choice] == "Create camp") {
|
||||
// TODO: Allow text entry for name
|
||||
@@ -558,38 +587,117 @@ void iexamine::shrub_wildveggies(game *g, player *p, map *m, int examx, int exam
|
||||
}
|
||||
|
||||
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;
|
||||
}
|
||||
int ch = menu(true,
|
||||
"Recycle metal into?:", "Lumps", "Sheets", "Chunks", "Scraps", "Cancel", NULL);
|
||||
|
||||
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.");
|
||||
// check for how much steel, by weight, is in the recycler
|
||||
// only items made of STEEL are checked
|
||||
// IRON and other metals cannot be turned into STEEL for now
|
||||
|
||||
int steel_weight = 0;
|
||||
int num_lumps = 0;
|
||||
int num_sheets = 0;
|
||||
int num_chunks = 0;
|
||||
int num_scraps = 0;
|
||||
|
||||
if (m->i_at(examx, examy).size() == 0)
|
||||
{
|
||||
g->add_msg("The recycler is currently empty. Drop some metal items onto it and examine it again.");
|
||||
return;
|
||||
}
|
||||
|
||||
if (ch == 5)
|
||||
{
|
||||
g->add_msg("Never mind.");
|
||||
return;
|
||||
}
|
||||
|
||||
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))
|
||||
steel_weight += it->weight();
|
||||
m->i_at(examx, examy).erase(m->i_at(examx, examy).begin() + i);
|
||||
i--;
|
||||
}
|
||||
|
||||
double recover_factor = rng(6, 9) / 10.0;
|
||||
steel_weight = (int)(steel_weight * recover_factor);
|
||||
|
||||
if (steel_weight == 0)
|
||||
{
|
||||
g->add_msg("The recycler chews up all the items in its hopper.");
|
||||
g->add_msg("The recycler beeps: \"No steel to process!\"");
|
||||
return;
|
||||
}
|
||||
|
||||
g->sound(examx, examy, 80, "Ka-klunk!");
|
||||
|
||||
switch(ch)
|
||||
{
|
||||
case 1: // 1 steel lump = weight 80
|
||||
num_lumps = steel_weight / (item_controller->find_template("steel_lump")->weight);
|
||||
steel_weight -= num_lumps * (item_controller->find_template("steel_lump")->weight);
|
||||
num_sheets = steel_weight / (item_controller->find_template("sheet_metal")->weight);
|
||||
steel_weight -= num_sheets * (item_controller->find_template("sheet_metal")->weight);
|
||||
num_chunks = steel_weight / (item_controller->find_template("steel_chunk")->weight);
|
||||
steel_weight -= num_chunks * (item_controller->find_template("steel_chunk")->weight);
|
||||
num_scraps = steel_weight / (item_controller->find_template("scrap")->weight);
|
||||
if (num_lumps == 0)
|
||||
{
|
||||
g->add_msg("The recycler beeps: \"Insufficient steel!\"");
|
||||
g->add_msg("It spits out an assortment of smaller pieces instead.");
|
||||
}
|
||||
break;
|
||||
|
||||
case 2: // 1 metal sheet = weight 20
|
||||
num_sheets = steel_weight / (item_controller->find_template("sheet_metal")->weight);
|
||||
steel_weight -= num_sheets * (item_controller->find_template("sheet_metal")->weight);
|
||||
num_chunks = steel_weight / (item_controller->find_template("steel_chunk")->weight);
|
||||
steel_weight -= num_chunks * (item_controller->find_template("sheet_chunk")->weight);
|
||||
num_scraps = steel_weight / (item_controller->find_template("scrap")->weight);
|
||||
if (num_sheets == 0)
|
||||
{
|
||||
g->add_msg("The recycler beeps: \"Insufficient steel!\"");
|
||||
g->add_msg("It spits out an assortment of smaller pieces instead.");
|
||||
}
|
||||
break;
|
||||
|
||||
case 3: // 1 steel chunk = weight 6
|
||||
num_chunks = steel_weight / (item_controller->find_template("steel_chunk")->weight);
|
||||
steel_weight -= num_chunks * (item_controller->find_template("steel_chunk")->weight);
|
||||
num_scraps = steel_weight / (item_controller->find_template("scrap")->weight);
|
||||
if (num_chunks == 0)
|
||||
{
|
||||
g->add_msg("The recycler beeps: \"Insufficient steel!\"");
|
||||
g->add_msg("It spits out an assortment of smaller pieces instead.");
|
||||
}
|
||||
break;
|
||||
|
||||
case 4: // 1 metal scrap = weight 1
|
||||
num_scraps = steel_weight / (item_controller->find_template("scrap")->weight);
|
||||
break;
|
||||
}
|
||||
|
||||
for (int i = 0; i < num_lumps; i++)
|
||||
{
|
||||
m->spawn_item(p->posx, p->posy, item_controller->find_template("steel_lump"), 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < num_sheets; i++)
|
||||
{
|
||||
m->spawn_item(p->posx, p->posy, item_controller->find_template("sheet_metal"), 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < num_chunks; i++)
|
||||
{
|
||||
m->spawn_item(p->posx, p->posy, item_controller->find_template("steel_chunk"), 0);
|
||||
}
|
||||
|
||||
for (int i = 0; i < num_scraps; i++)
|
||||
{
|
||||
m->spawn_item(p->posx, p->posy, item_controller->find_template("scrap"), 0);
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::trap(game *g, player *p, map *m, int examx, int examy) {
|
||||
@@ -597,6 +705,44 @@ void iexamine::trap(game *g, player *p, map *m, int examx, int examy) {
|
||||
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);
|
||||
}
|
||||
m->disarm_trap(g, examx, examy);
|
||||
}
|
||||
else if (m->tr_at(examx, examy) == tr_funnel && m->is_outside(examx, examy) &&
|
||||
(g->weather == WEATHER_DRIZZLE || g->weather == WEATHER_RAINY ||
|
||||
g->weather == WEATHER_THUNDER || g->weather == WEATHER_LIGHTNING))
|
||||
{
|
||||
water_source(g, p, m, examx, examy);
|
||||
}
|
||||
else if (m->tr_at(examx, examy) == tr_funnel && m->is_outside(examx, examy) &&
|
||||
(g->weather == WEATHER_ACID_DRIZZLE || g->weather == WEATHER_ACID_RAIN))
|
||||
{
|
||||
acid_source(g, p, m, examx, examy);
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::water_source(game *g, player *p, map *m, const int examx, const int examy)
|
||||
{
|
||||
item water = m->water_from(examx, examy);
|
||||
// Try to handle first (bottling) drink after.
|
||||
// changed boolean, large sources should be infinite
|
||||
if (g->handle_liquid(water, true, true))
|
||||
{
|
||||
p->moves -= 100;
|
||||
}
|
||||
else if (query_yn("Drink from your hands?"))
|
||||
{
|
||||
p->inv.push_back(water);
|
||||
water = p->inv.item_by_type(water.typeId());
|
||||
p->eat(g, water.invlet);
|
||||
p->moves -= 350;
|
||||
}
|
||||
}
|
||||
|
||||
void iexamine::acid_source(game *g, player *p, map *m, const int examx, const int examy)
|
||||
{
|
||||
item acid = m->acid_from(examx, examy);
|
||||
if (g->handle_liquid(acid, true, true))
|
||||
{
|
||||
p->moves -= 100;
|
||||
}
|
||||
}
|
||||
|
||||
+2
-2
@@ -30,9 +30,7 @@ public:
|
||||
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);
|
||||
@@ -49,6 +47,8 @@ public:
|
||||
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);
|
||||
void water_source (game *g, player *p, map *m, const int examx, const int examy);
|
||||
void acid_source (game *g, player *p, map *m, const int examx, const int examy);
|
||||
};
|
||||
|
||||
#endif /* defined(__Cataclysmic__iexamine__) */
|
||||
|
||||
+1150
-284
File diff suppressed because it is too large
Load Diff
+73
-25
@@ -4,37 +4,48 @@
|
||||
#include "item.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <list>
|
||||
|
||||
class game;
|
||||
class map;
|
||||
|
||||
const extern std::string inv_chars;
|
||||
|
||||
typedef std::list< std::list<item> > invstack;
|
||||
typedef std::vector< std::list<item>* > invslice;
|
||||
|
||||
class inventory
|
||||
{
|
||||
public:
|
||||
item& operator[] (int i);
|
||||
std::vector<item>& stack_at(int i);
|
||||
std::vector<item> const_stack(int i) const;
|
||||
std::vector<item> as_vector();
|
||||
item& front();
|
||||
item& back();
|
||||
invslice slice(int start, int length);
|
||||
invslice slice(const std::list<item>* stack, int length);
|
||||
// returns an inventory instance containing only the chosen items
|
||||
// chosen is an invlet-count mapping
|
||||
inventory subset(std::map<char, int> chosen) const;
|
||||
std::list<item>& stack_by_letter(char ch);
|
||||
std::list<item> const_stack(int i) const;
|
||||
int size() const;
|
||||
int num_items() const;
|
||||
bool is_sorted() const;
|
||||
|
||||
inventory& operator= (inventory &rhs);
|
||||
inventory& operator= (const inventory &rhs);
|
||||
inventory& operator+= (const inventory &rhs);
|
||||
inventory& operator+= (const item &rhs);
|
||||
inventory& operator+= (const std::vector<item> &rhs);
|
||||
inventory& operator+= (const std::list<item> &rhs);
|
||||
inventory operator+ (const inventory &rhs);
|
||||
inventory operator+ (const item &rhs);
|
||||
inventory operator+ (const std::vector<item> &rhs);
|
||||
inventory operator+ (const std::list<item> &rhs);
|
||||
|
||||
inventory filter_by_category(item_cat cat, const player& u) const;
|
||||
|
||||
void unsort(); // flags the inventory as unsorted
|
||||
void sort();
|
||||
void clear();
|
||||
void add_stack(std::vector<item> newits);
|
||||
void push_back(std::vector<item> newits);
|
||||
void add_item (item newit, bool keep_invlet = false);
|
||||
void add_stack(std::list<item> newits);
|
||||
void push_back(std::list<item> newits);
|
||||
item& add_item (item newit, bool keep_invlet = false); //returns a ref to the added item
|
||||
void add_item_by_type(itype_id type, int count = 1, int charges = -1);
|
||||
void add_item_keep_invlet(item newit);
|
||||
void push_back(item newit);
|
||||
|
||||
@@ -46,25 +57,60 @@ class inventory
|
||||
|
||||
void form_from_map(game *g, point origin, int distance);
|
||||
|
||||
std::vector<item> remove_stack(int index);
|
||||
item remove_item(int index);
|
||||
item remove_item(int stack, int index);
|
||||
std::list<item> remove_stack_by_letter(char ch);
|
||||
std::list<item> remove_partial_stack(char ch, int amount);
|
||||
item remove_item(item *it);
|
||||
item remove_item_by_type(itype_id type);
|
||||
item remove_item_by_letter(char ch);
|
||||
item remove_item_by_quantity(int index, int quantity);
|
||||
item remove_item_by_charges(char ch, int quantity); // charged items, not stacks
|
||||
std::vector<item> remove_mission_items(int mission_id);
|
||||
item& item_by_letter(char ch);
|
||||
int index_by_letter(char ch);
|
||||
item& item_by_type(itype_id type);
|
||||
item& item_or_container(itype_id type); // returns an item, or a container of it
|
||||
|
||||
std::vector<item*> all_items_by_type(itype_id type);
|
||||
std::vector<item*> all_ammo(ammotype type);
|
||||
|
||||
// Below, "amount" refers to quantity
|
||||
// "charges" refers to charges
|
||||
int amount_of (itype_id it);
|
||||
int charges_of(itype_id it);
|
||||
int amount_of (itype_id it) const;
|
||||
int charges_of(itype_id it) const;
|
||||
|
||||
void use_amount (itype_id it, int quantity, bool use_container = false);
|
||||
void use_charges(itype_id it, int quantity);
|
||||
std::list<item> use_amount (itype_id it, int quantity, bool use_container = false);
|
||||
std::list<item> use_charges(itype_id it, int quantity);
|
||||
|
||||
bool has_amount (itype_id it, int quantity);
|
||||
bool has_charges(itype_id it, int quantity);
|
||||
bool has_item(item *it); // Looks for a specific item
|
||||
bool has_amount (itype_id it, int quantity) const;
|
||||
bool has_charges(itype_id it, int quantity) const;
|
||||
bool has_item(item *it) const; // Looks for a specific item
|
||||
bool has_gun_for_ammo(ammotype type) const;
|
||||
bool has_active_item(itype_id) const;
|
||||
|
||||
bool has_mission_item(int mission_id) const;
|
||||
int butcher_factor() const;
|
||||
bool has_artifact_with(art_effect_passive effect) const;
|
||||
bool has_liquid(itype_id type) const;
|
||||
item& watertight_container();
|
||||
|
||||
// NPC/AI functions
|
||||
int worst_item_value(npc* p) const;
|
||||
bool has_enough_painkiller(int pain) const;
|
||||
item& most_appropriate_painkiller(int pain);
|
||||
item& best_for_melee(player *p);
|
||||
item& most_loaded_gun();
|
||||
|
||||
void rust_iron_items();
|
||||
|
||||
int weight() const;
|
||||
int volume() const;
|
||||
int max_active_item_charges(itype_id id) const;
|
||||
|
||||
void dump(std::vector<item>& dest) const; // dumps contents into dest (does not delete contents)
|
||||
|
||||
// vector rather than list because it's NOT an item stack
|
||||
std::vector<item*> active_items();
|
||||
|
||||
// hack to account for players saving inventory data (including weapon, etc.)
|
||||
std::string save_str_no_quant() const;
|
||||
|
||||
/* TODO: This stuff, I guess?
|
||||
std::string save();
|
||||
@@ -72,10 +118,12 @@ class inventory
|
||||
*/
|
||||
|
||||
item nullitem;
|
||||
std::vector<item> nullstack;
|
||||
std::list<item> nullstack;
|
||||
private:
|
||||
item remove_item(invstack::iterator iter);
|
||||
void assign_empty_invlet(item &it, player *p = NULL);
|
||||
std::vector< std::vector<item> > items;
|
||||
invstack items;
|
||||
bool sorted;
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+373
-256
@@ -12,38 +12,40 @@ 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)
|
||||
//TODO: make this function not have issues with items that are classed as multiple things
|
||||
std::vector<int> find_firsts(invslice &slice)
|
||||
{
|
||||
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()) {
|
||||
for (int i = 0; i < slice.size(); i++) {
|
||||
item& it = slice[i]->front();
|
||||
if (firsts[0] == -1 && it.is_gun()) {
|
||||
firsts[0] = i;
|
||||
} else if (firsts[1] == -1 && inv[i].is_ammo()) {
|
||||
} else if (firsts[1] == -1 && it.is_ammo()) {
|
||||
firsts[1] = i;
|
||||
} else if (firsts[2] == -1 && inv[i].is_armor()) {
|
||||
} else if (firsts[2] == -1 && it.is_armor()) {
|
||||
firsts[2] = i;
|
||||
} else if (firsts[3] == -1 && inv[i].is_food_container()) {
|
||||
} else if (firsts[3] == -1 && it.is_food_container()) {
|
||||
firsts[3] = i;
|
||||
} else if (inv[i].is_food()) {
|
||||
it_comest* comest = dynamic_cast<it_comest*>(inv[i].type);
|
||||
} else if (it.is_food()) {
|
||||
it_comest* comest = dynamic_cast<it_comest*>(it.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()) {
|
||||
} else if (firsts[4] == -1 && it.is_tool()) {
|
||||
firsts[4] = i;
|
||||
} else if (firsts[5] == -1 && inv[i].is_book()) {
|
||||
} else if (firsts[5] == -1 && it.is_book()) {
|
||||
firsts[5] = i;
|
||||
} else if (firsts[6] == -1 && inv[i].is_weap()) {
|
||||
} else if (firsts[6] == -1 && it.is_weap()) {
|
||||
firsts[6] = i;
|
||||
} else if (firsts[7] == -1 && (inv[i].is_gunmod() || inv[i].is_bionic())) {
|
||||
} else if (firsts[7] == -1 && (it.is_gunmod() || it.is_bionic())) {
|
||||
firsts[7] = i;
|
||||
} else if (firsts[9] == -1 && inv[i].is_other()) {
|
||||
} else if (firsts[9] == -1 && it.is_other()) {
|
||||
firsts[9] = i;
|
||||
}
|
||||
}
|
||||
@@ -51,27 +53,40 @@ std::vector<int> find_firsts(inventory &inv)
|
||||
return firsts;
|
||||
}
|
||||
|
||||
void print_inv_weight_vol(game *g, WINDOW* w_inv, int weight_carried, int vol_carried)
|
||||
{
|
||||
// Print weight
|
||||
mvwprintw(w_inv, 0, 43, "Weight: ");
|
||||
if (weight_carried >= g->u.weight_capacity() * .25)
|
||||
{
|
||||
wprintz(w_inv, c_red, "%4d", weight_carried);
|
||||
}
|
||||
else
|
||||
{
|
||||
wprintz(w_inv, c_ltgray, "%4d", weight_carried);
|
||||
}
|
||||
wprintz(w_inv, c_ltgray, "/%-4d", int(g->u.weight_capacity() * .25));//, g->u.weight_capacity());
|
||||
|
||||
// Print volume
|
||||
mvwprintw(w_inv, 0, 61, "Volume: ");
|
||||
if (vol_carried > g->u.volume_capacity() - 2)
|
||||
{
|
||||
wprintz(w_inv, c_red, "%3d", vol_carried);
|
||||
}
|
||||
else
|
||||
{
|
||||
wprintz(w_inv, c_ltgray, "%3d", vol_carried);
|
||||
}
|
||||
wprintw(w_inv, "/%-3d", g->u.volume_capacity() - 2);
|
||||
}
|
||||
|
||||
void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
|
||||
std::vector<char> dropped_items)
|
||||
{
|
||||
// Print our header
|
||||
mvwprintw(w_inv, 0, 0, title.c_str());
|
||||
|
||||
// Print weight
|
||||
mvwprintw(w_inv, 0, 45, "Weight: ");
|
||||
if (g->u.weight_carried() >= g->u.weight_capacity() * .25)
|
||||
wprintz(w_inv, c_red, "%d", g->u.weight_carried());
|
||||
else
|
||||
wprintz(w_inv, c_ltgray, "%d", g->u.weight_carried());
|
||||
wprintz(w_inv, c_ltgray, "/%d", int(g->u.weight_capacity() * .25));//, g->u.weight_capacity());
|
||||
|
||||
// Print volume
|
||||
mvwprintw(w_inv, 0, 62, "Volume: ");
|
||||
if (g->u.volume_carried() > g->u.volume_capacity() - 2)
|
||||
wprintz(w_inv, c_red, "%d", g->u.volume_carried());
|
||||
else
|
||||
wprintz(w_inv, c_ltgray, "%d", g->u.volume_carried());
|
||||
wprintw(w_inv, "/%d", g->u.volume_capacity() - 2);
|
||||
print_inv_weight_vol(g, w_inv, g->u.weight_carried(), g->u.volume_carried());
|
||||
|
||||
// Print our weapon
|
||||
int n_items = 0;
|
||||
@@ -116,7 +131,7 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
|
||||
// Print items carried
|
||||
for (std::string::const_iterator invlet = inv_chars.begin();
|
||||
invlet != inv_chars.end(); invlet++) {
|
||||
n_items += ((g->u.inv.index_by_letter(*invlet) == -1) ? 0 : 1);
|
||||
n_items += ((g->u.inv.item_by_letter(*invlet).is_null()) ? 0 : 1);
|
||||
}
|
||||
mvwprintw(w_inv, 1, 62, "Items: %d/%d ", n_items, inv_chars.size());
|
||||
}
|
||||
@@ -126,31 +141,40 @@ char game::inv(std::string title)
|
||||
{
|
||||
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
|
||||
const int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
|
||||
char ch = '.';
|
||||
int start = 0, cur_it;
|
||||
u.sort_inv();
|
||||
int ch = (int)'.';
|
||||
int start = 0, cur_it, max_it;
|
||||
u.inv.sort();
|
||||
u.inv.restack(&u);
|
||||
invslice slice = u.inv.slice(0, u.inv.size());
|
||||
std::vector<char> null_vector;
|
||||
print_inv_statics(this, w_inv, title, null_vector);
|
||||
// Gun, ammo, weapon, armor, food, tool, book, other
|
||||
std::vector<int> firsts = find_firsts(u.inv);
|
||||
std::vector<int> firsts = find_firsts(slice);
|
||||
int selected=-1;
|
||||
int selected_char=(int)' ';
|
||||
|
||||
if( last_inv_start >= 0 ) start = last_inv_start;
|
||||
if( last_inv_sel >= 0 ) selected = last_inv_sel;
|
||||
do {
|
||||
if (ch == '<' && start > 0) { // Clear lines and shift
|
||||
selected_char=(int)' ';
|
||||
if (( ch == '<' || ch == KEY_PPAGE ) && start > 0) { // Clear lines and shift
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
if ( selected > -1 ) selected = start; // oy, the cheese
|
||||
}
|
||||
if (ch == '>' && cur_it < u.inv.size()) { // Clear lines and shift
|
||||
if ((ch == '>' || ch == KEY_NPAGE ) && cur_it < u.inv.size()) { // Clear lines and shift
|
||||
start = cur_it;
|
||||
mvwprintw(w_inv, maxitems + 4, 12, " ");
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
if ( selected < start && selected > -1 ) selected = start;
|
||||
}
|
||||
int cur_line = 2;
|
||||
max_it = 0;
|
||||
for (cur_it = start; cur_it < start + maxitems && cur_line < maxitems+3; cur_it++) {
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
@@ -161,17 +185,20 @@ char game::inv(std::string title)
|
||||
cur_line++;
|
||||
}
|
||||
}
|
||||
if (cur_it < u.inv.size()) {
|
||||
mvwputch (w_inv, cur_line, 0, c_white, u.inv[cur_it].invlet);
|
||||
mvwprintz(w_inv, cur_line, 1, u.inv[cur_it].color_in_inventory(&u), " %s",
|
||||
u.inv[cur_it].tname(this).c_str());
|
||||
if (u.inv.stack_at(cur_it).size() > 1)
|
||||
wprintw(w_inv, " [%d]", u.inv.stack_at(cur_it).size());
|
||||
if (u.inv[cur_it].charges > 0)
|
||||
wprintw(w_inv, " (%d)", u.inv[cur_it].charges);
|
||||
else if (u.inv[cur_it].contents.size() == 1 &&
|
||||
u.inv[cur_it].contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", u.inv[cur_it].contents[0].charges);
|
||||
if (cur_it < slice.size()) {
|
||||
item& it = slice[cur_it]->front();
|
||||
if(cur_it==selected) selected_char=(int)it.invlet;
|
||||
mvwputch (w_inv, cur_line, 0, (cur_it == selected ? h_white : c_white), it.invlet);
|
||||
mvwprintz(w_inv, cur_line, 1, (cur_it == selected ? h_white : it.color_in_inventory(&u) ), " %s",
|
||||
it.tname(this).c_str());
|
||||
if (slice[cur_it]->size() > 1)
|
||||
wprintw(w_inv, " [%d]", slice[cur_it]->size());
|
||||
if (it.charges > 0)
|
||||
wprintw(w_inv, " (%d)", it.charges);
|
||||
else if (it.contents.size() == 1 &&
|
||||
it.contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", it.contents[0].charges);
|
||||
max_it=cur_it;
|
||||
}
|
||||
cur_line++;
|
||||
}
|
||||
@@ -180,96 +207,93 @@ char game::inv(std::string title)
|
||||
if (cur_it < u.inv.size())
|
||||
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
|
||||
wrefresh(w_inv);
|
||||
|
||||
ch = getch();
|
||||
} while (ch == '<' || ch == '>');
|
||||
|
||||
if ( ch == KEY_DOWN ) {
|
||||
if ( selected < 0 ) {
|
||||
selected = start;
|
||||
} else {
|
||||
selected++;
|
||||
}
|
||||
if ( selected > max_it ) {
|
||||
if( cur_it < u.inv.size() ) {
|
||||
ch='>';
|
||||
} else {
|
||||
selected = u.inv.size() - 1; // wraparound?
|
||||
}
|
||||
}
|
||||
} else if ( ch == KEY_UP ) {
|
||||
selected--;
|
||||
if ( selected < -1 ) {
|
||||
selected = -1; // wraparound?
|
||||
} else if ( selected < start ) {
|
||||
if ( start > 0 ) {
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
}
|
||||
}
|
||||
} else if ( ch == '\n' || ch == KEY_RIGHT ) {
|
||||
if ( last_inv_start > -2 && last_inv_sel > -2 ) {
|
||||
last_inv_start=start;
|
||||
last_inv_sel=selected;
|
||||
}
|
||||
ch = selected_char;
|
||||
}
|
||||
} while (ch == '<' || ch == '>' || ch == KEY_NPAGE || ch == KEY_PPAGE || ch == KEY_UP || ch == KEY_DOWN );
|
||||
werase(w_inv);
|
||||
delwin(w_inv);
|
||||
erase();
|
||||
refresh_all();
|
||||
return ch;
|
||||
return (char)ch;
|
||||
}
|
||||
|
||||
char game::inv_type(std::string title, int inv_item_type)
|
||||
char game::inv_type(std::string title, item_cat inv_item_type)
|
||||
{
|
||||
// this function lists inventory objects by type
|
||||
// refer to enum item_cat in itype.h for list of categories
|
||||
|
||||
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
|
||||
const int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
|
||||
char ch = '.';
|
||||
int start = 0, cur_it;
|
||||
u.sort_inv();
|
||||
int ch = (int)'.';
|
||||
int start = 0, cur_it, max_it;
|
||||
u.inv.sort();
|
||||
u.inv.restack(&u);
|
||||
std::vector<char> null_vector;
|
||||
print_inv_statics(this, w_inv, title, null_vector);
|
||||
// Gun, ammo, weapon, armor, food, tool, book, other
|
||||
|
||||
// Create the reduced inventory
|
||||
inventory reduced_inv = u.inv;
|
||||
reduced_inv.clear();
|
||||
int inv_index = 0;
|
||||
inventory reduced_inv = u.inv.filter_by_category(inv_item_type, u);
|
||||
|
||||
if (u.inv.size() > 0)
|
||||
{
|
||||
do
|
||||
{
|
||||
switch (inv_item_type)
|
||||
{
|
||||
case IC_COMESTIBLE: // food
|
||||
if (u.inv[inv_index].is_food(&u) || u.inv[inv_index].is_food_container(&u))
|
||||
reduced_inv += u.inv[inv_index];
|
||||
break;
|
||||
case IC_AMMO: // ammo
|
||||
if (u.inv[inv_index].is_ammo() || u.inv[inv_index].is_ammo_container())
|
||||
reduced_inv += u.inv[inv_index];
|
||||
break;
|
||||
case IC_ARMOR: // armour
|
||||
if (u.inv[inv_index].is_armor())
|
||||
reduced_inv += u.inv[inv_index];
|
||||
break;
|
||||
case IC_BOOK: // books
|
||||
if (u.inv[inv_index].is_book())
|
||||
reduced_inv += u.inv[inv_index];
|
||||
break;
|
||||
case IC_TOOL: // tools
|
||||
if (u.inv[inv_index].is_tool())
|
||||
reduced_inv += u.inv[inv_index];
|
||||
break;
|
||||
case IC_CONTAINER: // containers for liquid handling
|
||||
if (u.inv[inv_index].is_tool() || u.inv[inv_index].is_gun())
|
||||
{
|
||||
if (u.inv[inv_index].ammo_type() == AT_GAS)
|
||||
reduced_inv += u.inv[inv_index];
|
||||
}
|
||||
else
|
||||
{
|
||||
if (u.inv[inv_index].is_container())
|
||||
reduced_inv += u.inv[inv_index];
|
||||
}
|
||||
break;
|
||||
}
|
||||
inv_index++;
|
||||
} while (inv_index < u.inv.size());
|
||||
}
|
||||
|
||||
std::vector<int> firsts = find_firsts(reduced_inv);
|
||||
invslice slice = reduced_inv.slice(0, reduced_inv.size());
|
||||
std::vector<int> firsts = find_firsts(slice);
|
||||
|
||||
int selected=-1;
|
||||
int selected_char=(int)' ';
|
||||
do {
|
||||
if (ch == '<' && start > 0) { // Clear lines and shift
|
||||
if (( ch == '<' || ch == KEY_PPAGE ) && start > 0) { // Clear lines and shift
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
if ( selected > -1 ) selected = start; // oy, the cheese
|
||||
}
|
||||
if (ch == '>' && cur_it < reduced_inv.size()) { // Clear lines and shift
|
||||
if (( ch == '>' || ch == KEY_NPAGE ) && cur_it < reduced_inv.size()) { // Clear lines and shift
|
||||
start = cur_it;
|
||||
mvwprintw(w_inv, maxitems + 4, 12, " ");
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
if ( selected < start && selected > -1 ) selected = start;
|
||||
}
|
||||
int cur_line = 2;
|
||||
max_it = 0;
|
||||
for (cur_it = start; cur_it < start + maxitems && cur_line < maxitems+3; cur_it++) {
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
@@ -281,19 +305,22 @@ char game::inv_type(std::string title, int inv_item_type)
|
||||
}
|
||||
}
|
||||
|
||||
if (cur_it < reduced_inv.size())
|
||||
if (cur_it < slice.size())
|
||||
{
|
||||
mvwputch (w_inv, cur_line, 0, c_white, reduced_inv[cur_it].invlet);
|
||||
mvwprintz(w_inv, cur_line, 1, reduced_inv[cur_it].color_in_inventory(&u), " %s",
|
||||
reduced_inv[cur_it].tname(this).c_str());
|
||||
if (reduced_inv.stack_at(cur_it).size() > 1)
|
||||
wprintw(w_inv, " [%d]", reduced_inv.stack_at(cur_it).size());
|
||||
if (reduced_inv[cur_it].charges > 0)
|
||||
wprintw(w_inv, " (%d)", reduced_inv[cur_it].charges);
|
||||
else if (reduced_inv[cur_it].contents.size() == 1 &&
|
||||
reduced_inv[cur_it].contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", reduced_inv[cur_it].contents[0].charges);
|
||||
cur_line++;
|
||||
item& it = slice[cur_it]->front();
|
||||
if(cur_it==selected) selected_char=(int)it.invlet;
|
||||
mvwputch (w_inv, cur_line, 0, (cur_it == selected ? h_white : c_white), it.invlet);
|
||||
mvwprintz(w_inv, cur_line, 1, (cur_it == selected ? h_white : it.color_in_inventory(&u) ), " %s",
|
||||
it.tname(this).c_str());
|
||||
if (slice[cur_it]->size() > 1)
|
||||
wprintw(w_inv, " [%d]", slice[cur_it]->size());
|
||||
if (it.charges > 0)
|
||||
wprintw(w_inv, " (%d)", it.charges);
|
||||
else if (it.contents.size() == 1 &&
|
||||
it.contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", it.contents[0].charges);
|
||||
cur_line++;
|
||||
max_it=cur_it;
|
||||
}
|
||||
// cur_line++;
|
||||
}
|
||||
@@ -302,49 +329,78 @@ char game::inv_type(std::string title, int inv_item_type)
|
||||
if (cur_it < reduced_inv.size())
|
||||
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
|
||||
wrefresh(w_inv);
|
||||
|
||||
ch = getch();
|
||||
} while (ch == '<' || ch == '>');
|
||||
|
||||
if ( ch == KEY_DOWN ) {
|
||||
if ( selected < 0 ) {
|
||||
selected = start;
|
||||
} else {
|
||||
selected++;
|
||||
}
|
||||
if ( selected > max_it ) {
|
||||
if( cur_it < u.inv.size() ) {
|
||||
ch='>';
|
||||
} else {
|
||||
selected = u.inv.size() - 1; // wraparound?
|
||||
}
|
||||
}
|
||||
} else if ( ch == KEY_UP ) {
|
||||
selected--;
|
||||
if ( selected < -1 ) {
|
||||
selected = -1; // wraparound?
|
||||
} else if ( selected < start ) {
|
||||
if ( start > 0 ) {
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
}
|
||||
}
|
||||
} else if ( ch == '\n' || ch == KEY_RIGHT ) {
|
||||
ch = selected_char;
|
||||
}
|
||||
|
||||
} while (ch == '<' || ch == '>' || ch == KEY_NPAGE || ch == KEY_PPAGE || ch == KEY_UP || ch == KEY_DOWN );
|
||||
werase(w_inv);
|
||||
delwin(w_inv);
|
||||
erase();
|
||||
refresh_all();
|
||||
return ch;
|
||||
return (char)ch;
|
||||
}
|
||||
|
||||
std::vector<item> game::multidrop()
|
||||
{
|
||||
u.sort_inv();
|
||||
u.inv.sort();
|
||||
u.inv.restack(&u);
|
||||
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
|
||||
const int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
|
||||
int dropping[u.inv.size()]; // Count of how many we'll drop from each stack
|
||||
for (int i = 0; i < u.inv.size(); i++)
|
||||
dropping[i] = 0;
|
||||
std::map<char, int> dropping; // Count of how many we'll drop from each stack
|
||||
int count = 0; // The current count
|
||||
std::vector<char> weapon_and_armor; // Always single, not counted
|
||||
bool warned_about_bionic = false; // Printed add_msg re: dropping bionics
|
||||
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
|
||||
// Gun, ammo, weapon, armor, food, tool, book, other
|
||||
std::vector<int> firsts = find_firsts(u.inv);
|
||||
int base_weight = u.weight_carried();
|
||||
int base_volume = u.volume_carried();
|
||||
|
||||
char ch = '.';
|
||||
int start = 0, cur_it;
|
||||
int ch = (int)'.';
|
||||
int start = 0, cur_it, max_it;
|
||||
invslice stacks = u.inv.slice(0, u.inv.size());
|
||||
std::vector<int> firsts = find_firsts(stacks);
|
||||
int selected=-1;
|
||||
int selected_char=(int)' ';
|
||||
do {
|
||||
if (ch == '<' && start > 0) {
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
}
|
||||
if (ch == '>' && cur_it < u.inv.size()) {
|
||||
start = cur_it;
|
||||
mvwprintw(w_inv, maxitems + 4, 12, " ");
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
inventory drop_subset = u.inv.subset(dropping);
|
||||
int new_weight = base_weight - drop_subset.weight();
|
||||
int new_volume = base_volume - drop_subset.volume();
|
||||
for (int i = 0; i < weapon_and_armor.size(); ++i) {
|
||||
new_weight -= u.i_at(weapon_and_armor[i]).weight();
|
||||
}
|
||||
print_inv_weight_vol(this, w_inv, new_weight, new_volume);
|
||||
int cur_line = 2;
|
||||
max_it = 0;
|
||||
for (cur_it = start; cur_it < start + maxitems && cur_line < maxitems+3; cur_it++) {
|
||||
// Clear the current line;
|
||||
mvwprintw(w_inv, cur_line, 0, " ");
|
||||
@@ -355,83 +411,155 @@ std::vector<item> game::multidrop()
|
||||
cur_line++;
|
||||
}
|
||||
}
|
||||
if (cur_it < u.inv.size()) {
|
||||
mvwputch (w_inv, cur_line, 0, c_white, u.inv[cur_it].invlet);
|
||||
|
||||
if ( selected < start && selected > -1 ) selected = start;
|
||||
|
||||
if (cur_it < stacks.size()) {
|
||||
item& it = stacks[cur_it]->front();
|
||||
if(cur_it==selected) selected_char=(int)it.invlet;
|
||||
mvwputch (w_inv, cur_line, 0, (cur_it == selected ? h_white : c_white), it.invlet);
|
||||
char icon = '-';
|
||||
if (dropping[cur_it] >= u.inv.stack_at(cur_it).size())
|
||||
if (dropping[it.invlet] >= (it.count_by_charges() ? it.charges : stacks[cur_it]->size()))
|
||||
icon = '+';
|
||||
else if (dropping[cur_it] > 0)
|
||||
else if (dropping[it.invlet] > 0)
|
||||
icon = '#';
|
||||
nc_color col = (dropping[cur_it] == 0 ? c_ltgray : c_white);
|
||||
nc_color col = ( cur_it == selected ? h_white : (dropping[it.invlet] == 0 ? c_ltgray : c_white ) );
|
||||
mvwprintz(w_inv, cur_line, 1, col, " %c %s", icon,
|
||||
u.inv[cur_it].tname(this).c_str());
|
||||
if (u.inv.stack_at(cur_it).size() > 1)
|
||||
wprintz(w_inv, col, " [%d]", u.inv.stack_at(cur_it).size());
|
||||
if (u.inv[cur_it].charges > 0)
|
||||
wprintz(w_inv, col, " (%d)", u.inv[cur_it].charges);
|
||||
else if (u.inv[cur_it].contents.size() == 1 &&
|
||||
u.inv[cur_it].contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", u.inv[cur_it].contents[0].charges);
|
||||
it.tname(this).c_str());
|
||||
if (stacks[cur_it]->size() > 1)
|
||||
wprintz(w_inv, col, " [%d]", stacks[cur_it]->size());
|
||||
if (it.charges > 0)
|
||||
wprintz(w_inv, col, " (%d)", it.charges);
|
||||
else if (it.contents.size() == 1 &&
|
||||
it.contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", it.contents[0].charges);
|
||||
}
|
||||
cur_line++;
|
||||
max_it=cur_it;
|
||||
}
|
||||
if (start > 0)
|
||||
mvwprintw(w_inv, maxitems + 4, 0, "< Go Back");
|
||||
if (cur_it < u.inv.size())
|
||||
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
|
||||
wrefresh(w_inv);
|
||||
/* back to (int)getch() as input() mangles arrow keys
|
||||
ch = input();
|
||||
*/
|
||||
ch = getch();
|
||||
if (ch >= '0' && ch <= '9') {
|
||||
ch -= '0';
|
||||
if ( ch == '<' || ch == KEY_PPAGE ) {
|
||||
if( start > 0) {
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
if ( selected > -1 ) selected = start; // oy, the cheese
|
||||
}
|
||||
} else if ( ch == '>' || ch == KEY_NPAGE ) {
|
||||
if ( cur_it < u.inv.size()) {
|
||||
start = cur_it;
|
||||
mvwprintw(w_inv, maxitems + 4, 12, " ");
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
if ( selected < start && selected > -1 ) selected = start;
|
||||
}
|
||||
} else if ( ch == KEY_DOWN ) {
|
||||
if ( selected < 0 ) {
|
||||
selected = start;
|
||||
} else {
|
||||
selected++;
|
||||
}
|
||||
if ( selected > max_it ) {
|
||||
if( cur_it < u.inv.size() ) {
|
||||
start = cur_it;
|
||||
mvwprintw(w_inv, maxitems + 4, 12, " ");
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
} else {
|
||||
selected = u.inv.size() - 1; // wraparound?
|
||||
}
|
||||
}
|
||||
} else if ( ch == KEY_UP ) {
|
||||
selected--;
|
||||
if ( selected < -1 ) {
|
||||
selected = -1; // wraparound?
|
||||
} else if ( selected < start ) {
|
||||
if ( start > 0 ) {
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
if (start < 0)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
}
|
||||
}
|
||||
} else if (ch >= '0'&& ch <= '9') {
|
||||
ch = (char)ch - '0';
|
||||
count *= 10;
|
||||
count += ch;
|
||||
} else if (u.has_item(ch)) {
|
||||
int index = u.inv.index_by_letter(ch);
|
||||
if (index == -1) { // Not from inventory
|
||||
int found = false;
|
||||
for (int i = 0; i < weapon_and_armor.size() && !found; i++) {
|
||||
if (weapon_and_armor[i] == ch) {
|
||||
weapon_and_armor.erase(weapon_and_armor.begin() + i);
|
||||
found = true;
|
||||
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
|
||||
} else { // todo: reformat and maybe rewrite
|
||||
if ( ch == '\t' || ch == KEY_RIGHT || ch == KEY_LEFT ) {
|
||||
ch = selected_char;
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
if ( ch == u.weapon.invlet &&
|
||||
std::find(unreal_itype_ids.begin(), unreal_itype_ids.end(), u.weapon.type->id) != unreal_itype_ids.end()){
|
||||
if (!warned_about_bionic)
|
||||
add_msg("You cannot drop your %s.", u.weapon.tname(this).c_str());
|
||||
warned_about_bionic = true;
|
||||
} else {
|
||||
weapon_and_armor.push_back(ch);
|
||||
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
|
||||
if (u.has_item(ch)) {
|
||||
item& it = u.inv.item_by_letter(ch);
|
||||
if (it.is_null()) { // Not from inventory
|
||||
int found = false;
|
||||
for (int i = 0; i < weapon_and_armor.size() && !found; i++) {
|
||||
if (weapon_and_armor[i] == ch) {
|
||||
weapon_and_armor.erase(weapon_and_armor.begin() + i);
|
||||
found = true;
|
||||
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
|
||||
}
|
||||
}
|
||||
if (!found) {
|
||||
if ( ch == u.weapon.invlet &&
|
||||
std::find(unreal_itype_ids.begin(), unreal_itype_ids.end(), u.weapon.type->id) != unreal_itype_ids.end()){
|
||||
if (!warned_about_bionic)
|
||||
add_msg("You cannot drop your %s.", u.weapon.tname(this).c_str());
|
||||
warned_about_bionic = true;
|
||||
} else {
|
||||
weapon_and_armor.push_back(ch);
|
||||
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
int index = -1;
|
||||
for (int i = 0; i < stacks.size(); ++i) {
|
||||
if (stacks[i]->front().invlet == it.invlet) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index == -1) {
|
||||
debugmsg("Inventory got out of sync with inventory slice?");
|
||||
}
|
||||
if (count == 0) {
|
||||
if (it.count_by_charges())
|
||||
{
|
||||
if (dropping[it.invlet] == 0)
|
||||
dropping[it.invlet] = -1;
|
||||
else
|
||||
dropping[it.invlet] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dropping[it.invlet] == 0)
|
||||
dropping[it.invlet] = stacks[index]->size();
|
||||
else
|
||||
dropping[it.invlet] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
else if (count >= stacks[index]->size() && !it.count_by_charges())
|
||||
dropping[it.invlet] = stacks[index]->size();
|
||||
else
|
||||
dropping[it.invlet] = count;
|
||||
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (count == 0) {
|
||||
if (u.inv.stack_at(index)[0].count_by_charges())
|
||||
{
|
||||
if (dropping[index] == 0)
|
||||
dropping[index] = -1;
|
||||
else
|
||||
dropping[index] = 0;
|
||||
}
|
||||
else
|
||||
{
|
||||
if (dropping[index] == 0)
|
||||
dropping[index] = u.inv.stack_at(index).size();
|
||||
else
|
||||
dropping[index] = 0;
|
||||
}
|
||||
}
|
||||
|
||||
else if (count >= u.inv.stack_at(index).size() && !u.inv.stack_at(index)[0].count_by_charges())
|
||||
dropping[index] = u.inv.stack_at(index).size();
|
||||
else
|
||||
dropping[index] = count;
|
||||
|
||||
count = 0;
|
||||
}
|
||||
}
|
||||
} while (ch != '\n' && ch != KEY_ESCAPE && ch != ' ');
|
||||
werase(w_inv);
|
||||
@@ -444,38 +572,15 @@ std::vector<item> game::multidrop()
|
||||
if (ch != '\n')
|
||||
return ret; // Canceled!
|
||||
|
||||
int current_stack = 0;
|
||||
int max_size = u.inv.size();
|
||||
for (int i = 0; i < max_size; i++) {
|
||||
|
||||
if (dropping[i] == -1) { // drop whole stack of charges
|
||||
ret.push_back(u.inv.remove_item(current_stack));
|
||||
current_stack--;
|
||||
}
|
||||
|
||||
for (int j = 0; j < dropping[i]; j++) {
|
||||
if (u.inv.stack_at(current_stack)[0].count_by_charges()) { // dropping parts of stacks
|
||||
int tmpcount = dropping[i];
|
||||
|
||||
if (tmpcount >= u.inv.stack_at(current_stack)[0].charges) {
|
||||
ret.push_back(u.inv.remove_item(current_stack));
|
||||
current_stack--;
|
||||
} else {
|
||||
u.inv.stack_at(current_stack)[0].charges -= tmpcount;
|
||||
ret.push_back(u.inv.remove_item_by_quantity(current_stack, tmpcount));
|
||||
}
|
||||
j = dropping[i];
|
||||
} else {
|
||||
if (current_stack >= 0) {
|
||||
if (u.inv.stack_at(current_stack).size() == 1) {
|
||||
ret.push_back(u.inv.remove_item(current_stack));
|
||||
current_stack--;
|
||||
} else
|
||||
ret.push_back(u.inv.remove_item(current_stack));
|
||||
}
|
||||
}
|
||||
}
|
||||
current_stack++;
|
||||
for (std::map<char,int>::iterator it = dropping.begin(); it != dropping.end(); it++) {
|
||||
if (it->second == -1)
|
||||
ret.push_back( u.inv.remove_item_by_letter( it->first));
|
||||
else if (it->second && u.inv.item_by_letter( it->first).count_by_charges()) {
|
||||
int charges = u.inv.item_by_letter( it->first).charges;// >= it->second ? : it->second;
|
||||
ret.push_back( u.inv.remove_item_by_charges( it->first, it->second > charges ? charges : it->second));
|
||||
} else if (it->second)
|
||||
for (int j = it->second; j > 0; j--)
|
||||
ret.push_back( u.inv.remove_item_by_letter( it->first));
|
||||
}
|
||||
|
||||
for (int i = 0; i < weapon_and_armor.size(); i++)
|
||||
@@ -487,7 +592,7 @@ std::vector<item> game::multidrop()
|
||||
void game::compare(int iCompareX, int iCompareY)
|
||||
{
|
||||
int examx, examy;
|
||||
char ch = '.';
|
||||
int ch = (int)'.';
|
||||
|
||||
if (iCompareX != -999 && iCompareX != -999) {
|
||||
examx = iCompareX;
|
||||
@@ -522,21 +627,22 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
}
|
||||
//Only the first 10 Items due to numbering 0-9
|
||||
const int groundsize = (grounditems.size() > 10 ? 10 : grounditems.size());
|
||||
u.sort_inv();
|
||||
u.inv.sort();
|
||||
u.inv.restack(&u);
|
||||
|
||||
invslice stacks = u.inv.slice(0, u.inv.size());
|
||||
|
||||
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
|
||||
std::vector<int> compare_list; // Count of how many we'll drop from each stack
|
||||
bool bFirst = false; // First Item selected
|
||||
bool bShowCompare = false;
|
||||
char cLastCh;
|
||||
for (int i = 0; i < u.inv.size() + groundsize; i++)
|
||||
compare[i] = 0;
|
||||
compare_list.resize(u.inv.size() + groundsize, 0);
|
||||
std::vector<char> weapon_and_armor; // Always single, not counted
|
||||
print_inv_statics(this, w_inv, "Compare:", weapon_and_armor);
|
||||
// Gun, ammo, weapon, armor, food, tool, book, other
|
||||
std::vector<int> first = find_firsts(u.inv);
|
||||
std::vector<int> first = find_firsts(stacks);
|
||||
std::vector<int> firsts;
|
||||
if (groundsize > 0) {
|
||||
firsts.push_back(0);
|
||||
@@ -547,7 +653,7 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
ch = '.';
|
||||
int start = 0, cur_it;
|
||||
do {
|
||||
if (ch == '<' && start > 0) {
|
||||
if (( ch == '<' || ch == KEY_PPAGE ) && start > 0) {
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
mvwprintz(w_inv, i, 0, c_black, " ");
|
||||
start -= maxitems;
|
||||
@@ -555,7 +661,7 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
start = 0;
|
||||
mvwprintw(w_inv, maxitems + 4, 0, " ");
|
||||
}
|
||||
if (ch == '>' && cur_it < u.inv.size() + groundsize) {
|
||||
if (( ch == '>' || ch == KEY_NPAGE ) && cur_it < u.inv.size() + groundsize) {
|
||||
start = cur_it;
|
||||
mvwprintw(w_inv, maxitems + 4, 12, " ");
|
||||
for (int i = 1; i < maxitems+4; i++)
|
||||
@@ -576,25 +682,26 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
}
|
||||
if (cur_it < u.inv.size() + groundsize) {
|
||||
char icon = '-';
|
||||
if (compare[cur_it] == 1)
|
||||
if (compare_list[cur_it] == 1)
|
||||
icon = '+';
|
||||
if (cur_it < groundsize) {
|
||||
mvwputch (w_inv, cur_line, 0, c_white, '1'+((cur_it<9) ? cur_it: -1));
|
||||
nc_color col = (compare[cur_it] == 0 ? c_ltgray : c_white);
|
||||
nc_color col = (compare_list[cur_it] == 0 ? c_ltgray : c_white);
|
||||
mvwprintz(w_inv, cur_line, 1, col, " %c %s", icon,
|
||||
grounditems[cur_it].tname(this).c_str());
|
||||
} else {
|
||||
mvwputch (w_inv, cur_line, 0, c_white, u.inv[cur_it-groundsize].invlet);
|
||||
nc_color col = (compare[cur_it] == 0 ? c_ltgray : c_white);
|
||||
item& it = stacks[cur_it-groundsize]->front();
|
||||
mvwputch (w_inv, cur_line, 0, c_white, it.invlet);
|
||||
nc_color col = (compare_list[cur_it] == 0 ? c_ltgray : c_white);
|
||||
mvwprintz(w_inv, cur_line, 1, col, " %c %s", icon,
|
||||
u.inv[cur_it-groundsize].tname(this).c_str());
|
||||
if (u.inv.stack_at(cur_it-groundsize).size() > 1)
|
||||
wprintz(w_inv, col, " [%d]", u.inv.stack_at(cur_it-groundsize).size());
|
||||
if (u.inv[cur_it-groundsize].charges > 0)
|
||||
wprintz(w_inv, col, " (%d)", u.inv[cur_it-groundsize].charges);
|
||||
else if (u.inv[cur_it-groundsize].contents.size() == 1 &&
|
||||
u.inv[cur_it-groundsize].contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", u.inv[cur_it-groundsize].contents[0].charges);
|
||||
it.tname(this).c_str());
|
||||
if (stacks[cur_it-groundsize]->size() > 1)
|
||||
wprintz(w_inv, col, " [%d]", stacks[cur_it-groundsize]->size());
|
||||
if (it.charges > 0)
|
||||
wprintz(w_inv, col, " (%d)", it.charges);
|
||||
else if (it.contents.size() == 1 &&
|
||||
it.contents[0].charges > 0)
|
||||
wprintw(w_inv, " (%d)", it.contents[0].charges);
|
||||
}
|
||||
}
|
||||
cur_line++;
|
||||
@@ -606,8 +713,8 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
wrefresh(w_inv);
|
||||
ch = getch();
|
||||
if (u.has_item(ch)) {
|
||||
int index = u.inv.index_by_letter(ch);
|
||||
if (index == -1) { // Not from inventory
|
||||
item& it = u.inv.item_by_letter(ch);
|
||||
if (it.is_null()) { // Not from inventory
|
||||
bool found = false;
|
||||
for (int i = 0; i < weapon_and_armor.size() && !found; i++) {
|
||||
if (weapon_and_armor[i] == ch) {
|
||||
@@ -635,14 +742,24 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
}
|
||||
}
|
||||
} else {
|
||||
if (compare[index+groundsize] == 1)
|
||||
int index = -1;
|
||||
for (int i = 0; i < stacks.size(); ++i) {
|
||||
if (stacks[i]->front().invlet == it.invlet) {
|
||||
index = i;
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (index == -1) {
|
||||
debugmsg("Inventory got out of sync with inventory slice?");
|
||||
}
|
||||
if (compare_list[index+groundsize] == 1)
|
||||
{
|
||||
compare[index+groundsize] = 0;
|
||||
compare_list[index+groundsize] = 0;
|
||||
bFirst = false;
|
||||
} else {
|
||||
if (!bFirst)
|
||||
{
|
||||
compare[index+groundsize] = 1;
|
||||
compare_list[index+groundsize] = 1;
|
||||
bFirst = true;
|
||||
cLastCh = ch;
|
||||
} else {
|
||||
@@ -656,14 +773,14 @@ void game::compare(int iCompareX, int iCompareY)
|
||||
if (ch == '0') {
|
||||
iZero = 10;
|
||||
}
|
||||
if (compare[ch-'1'+iZero] == 1)
|
||||
if (compare_list[ch-'1'+iZero] == 1)
|
||||
{
|
||||
compare[ch-'1'+iZero] = 0;
|
||||
compare_list[ch-'1'+iZero] = 0;
|
||||
bFirst = false;
|
||||
} else {
|
||||
if (!bFirst)
|
||||
{
|
||||
compare[ch-'1'+iZero] = 1;
|
||||
compare_list[ch-'1'+iZero] = 1;
|
||||
bFirst = true;
|
||||
cLastCh = ch;
|
||||
} else {
|
||||
|
||||
@@ -41,6 +41,7 @@ public:
|
||||
item(std::string itemdata, game *g);
|
||||
~item();
|
||||
void make(itype* it);
|
||||
void clear(); // cleanup that's required to re-use an item variable
|
||||
|
||||
// returns the default container of this item, with this item in it
|
||||
item in_its_container(std::map<std::string, itype*> *itypes);
|
||||
@@ -56,83 +57,92 @@ public:
|
||||
int clip_size();
|
||||
int accuracy();
|
||||
int gun_damage(bool with_ammo = true);
|
||||
int noise();
|
||||
int noise() const;
|
||||
int burst_size();
|
||||
int recoil(bool with_ammo = true);
|
||||
int range(player *p = NULL);
|
||||
ammotype ammo_type();
|
||||
int pick_reload_ammo(player &u, bool interactive);
|
||||
bool reload(player &u, int index);
|
||||
ammotype ammo_type() const;
|
||||
char pick_reload_ammo(player &u, bool interactive);
|
||||
bool reload(player &u, char invlet);
|
||||
void next_mode();
|
||||
|
||||
std::string save_info(); // Formatted for save files
|
||||
std::string save_info() const; // Formatted for save files
|
||||
void load_info(std::string data, game *g);
|
||||
//std::string info(bool showtext = false); // Formatted for human viewing
|
||||
std::string info(bool showtext = false);
|
||||
std::string info(bool showtext, std::vector<iteminfo> *dump);
|
||||
char symbol();
|
||||
nc_color color();
|
||||
int price();
|
||||
int price() const;
|
||||
|
||||
bool invlet_is_okay();
|
||||
bool stacks_with(item rhs);
|
||||
void put_in(item payload);
|
||||
|
||||
int weight();
|
||||
int volume();
|
||||
int weight() const;
|
||||
int volume() const;
|
||||
int volume_contained();
|
||||
int attack_time();
|
||||
int damage_bash();
|
||||
int damage_cut();
|
||||
bool has_flag(item_flag f);
|
||||
int damage_cut() const;
|
||||
bool has_flag(std::string f) const;
|
||||
bool has_technique(technique_id t, player *p = NULL);
|
||||
int has_gunmod(itype_id type);
|
||||
item* active_gunmod();
|
||||
item const* inspect_active_gunmod() const;
|
||||
std::vector<technique_id> techniques();
|
||||
bool goes_bad();
|
||||
bool count_by_charges();
|
||||
bool count_by_charges() const;
|
||||
bool craft_has_charges();
|
||||
int num_charges();
|
||||
bool rotten(game *g);
|
||||
bool ready_to_revive(game *g); // used for corpses
|
||||
|
||||
// Our value as a weapon, given particular skills
|
||||
int weapon_value(int skills[num_skill_types]);
|
||||
int weapon_value(player *p) const;
|
||||
// As above, but discounts its use as a ranged weapon
|
||||
int melee_value (int skills[num_skill_types]);
|
||||
int melee_value (player *p);
|
||||
// how resistant armour is to bashing and cutting damage
|
||||
int bash_resist() const;
|
||||
int cut_resist() const;
|
||||
// Returns the data associated with tech, if we are an it_style
|
||||
style_move style_data(technique_id tech);
|
||||
bool is_two_handed(player *u);
|
||||
bool made_of(material mat);
|
||||
bool made_of(material mat) const;
|
||||
bool made_of(phase_id phase) const;
|
||||
bool conductive(); // Electricity
|
||||
bool destroyed_at_zero_charges();
|
||||
// Most of the is_whatever() functions call the same function in our itype
|
||||
bool is_null(); // True if type is NULL, or points to the null item (id == 0)
|
||||
bool is_food(player *u);// Some non-food items are food to certain players
|
||||
bool is_food_container(player *u); // Ditto
|
||||
bool is_food(); // Ignoring the ability to eat batteries, etc.
|
||||
bool is_food_container(); // Ignoring the ability to eat batteries, etc.
|
||||
bool is_ammo_container();
|
||||
bool is_drink();
|
||||
bool is_weap();
|
||||
bool is_bashing_weapon();
|
||||
bool is_cutting_weapon();
|
||||
bool is_gun();
|
||||
bool is_silent();
|
||||
bool is_gunmod();
|
||||
bool is_bionic();
|
||||
bool is_ammo();
|
||||
bool is_armor();
|
||||
bool is_book();
|
||||
bool is_container();
|
||||
bool is_tool();
|
||||
bool is_software();
|
||||
bool is_macguffin();
|
||||
bool is_style();
|
||||
bool is_other(); // Doesn't belong in other categories
|
||||
bool is_var_veh_part();
|
||||
bool is_artifact();
|
||||
bool is_null() const; // True if type is NULL, or points to the null item (id == 0)
|
||||
bool is_food(player const*u) const;// Some non-food items are food to certain players
|
||||
bool is_food_container(player const*u) const; // Ditto
|
||||
bool is_food() const; // Ignoring the ability to eat batteries, etc.
|
||||
bool is_food_container() const; // Ignoring the ability to eat batteries, etc.
|
||||
bool is_ammo_container() const;
|
||||
bool is_drink() const;
|
||||
bool is_weap() const;
|
||||
bool is_bashing_weapon() const;
|
||||
bool is_cutting_weapon() const;
|
||||
bool is_gun() const;
|
||||
bool is_silent() const;
|
||||
bool is_gunmod() const;
|
||||
bool is_bionic() const;
|
||||
bool is_ammo() const;
|
||||
bool is_armor() const;
|
||||
bool is_book() const;
|
||||
bool is_container() const;
|
||||
bool is_tool() const;
|
||||
bool is_software() const;
|
||||
bool is_macguffin() const;
|
||||
bool is_style() const;
|
||||
bool is_stationary() const;
|
||||
bool is_other() const; // Doesn't belong in other categories
|
||||
bool is_var_veh_part() const;
|
||||
bool is_artifact() const;
|
||||
|
||||
bool operator<(const item& other) const;
|
||||
|
||||
itype_id typeId();
|
||||
itype_id typeId() const;
|
||||
itype* type;
|
||||
mtype* corpse;
|
||||
it_ammo* curammo;
|
||||
@@ -150,22 +160,52 @@ public:
|
||||
union{
|
||||
int poison; // How badly poisoned is it?
|
||||
int bigness; // engine power, wheel size
|
||||
int frequency; // Radio frequency
|
||||
int note; // Associated dynamic text snippet.
|
||||
};
|
||||
int mode; // Mode of operation, can be changed by the player.
|
||||
unsigned item_flags : NUM_ITEM_FLAGS; // generic item specific flags
|
||||
std::string mode; // Mode of operation, can be changed by the player.
|
||||
std::set<std::string> item_tags; // generic item specific flags
|
||||
unsigned item_counter; // generic counter to be used with item flags
|
||||
int mission_id;// Refers to a mission in game's master list
|
||||
int player_id; // Only give a mission to the right player!
|
||||
|
||||
static itype * nullitem();
|
||||
|
||||
item clone();
|
||||
private:
|
||||
int sort_rank() const;
|
||||
static itype * nullitem_m;
|
||||
};
|
||||
|
||||
std::ostream & operator<<(std::ostream &, const item &);
|
||||
std::ostream & operator<<(std::ostream &, const item *);
|
||||
|
||||
struct map_item_stack
|
||||
{
|
||||
public:
|
||||
item example; //an example item for showing stats, etc.
|
||||
int x;
|
||||
int y;
|
||||
int count;
|
||||
|
||||
//only expected to be used for things like lists and vectors
|
||||
map_item_stack()
|
||||
{
|
||||
example = item();
|
||||
x = 0;
|
||||
y = 0;
|
||||
count = 0;
|
||||
}
|
||||
|
||||
map_item_stack(item it, int arg_x, int arg_y)
|
||||
{
|
||||
example = it;
|
||||
x = arg_x;
|
||||
y = arg_y;
|
||||
count = 1;
|
||||
}
|
||||
};
|
||||
|
||||
//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 {
|
||||
|
||||
@@ -0,0 +1,940 @@
|
||||
#include "item_factory.h"
|
||||
#include "rng.h"
|
||||
#include "enums.h"
|
||||
#include "catajson.h"
|
||||
#include "addiction.h"
|
||||
#include <algorithm>
|
||||
#include <cstdlib>
|
||||
#include <iostream>
|
||||
#include <fstream>
|
||||
#include <stdio.h>
|
||||
|
||||
// mfb(n) converts a flag to its appropriate position in covers's bitfield
|
||||
#ifndef mfb
|
||||
#define mfb(n) long(1 << (n))
|
||||
#endif
|
||||
|
||||
Item_factory* item_controller = new Item_factory();
|
||||
|
||||
//Every item factory comes with a missing item
|
||||
Item_factory::Item_factory(){
|
||||
init();
|
||||
m_missing_item = new itype();
|
||||
m_missing_item->name = "Error: Item Missing.";
|
||||
m_missing_item->description = "There is only the space where an object should be, but isn't. No item template of this type exists.";
|
||||
m_templates["MISSING_ITEM"]=m_missing_item;
|
||||
}
|
||||
|
||||
void Item_factory::init(){
|
||||
//Populate the iuse functions
|
||||
iuse_function_list["NONE"] = &iuse::none;
|
||||
iuse_function_list["SEWAGE"] = &iuse::sewage;
|
||||
|
||||
iuse_function_list["HONEYCOMB"] = &iuse::honeycomb;
|
||||
iuse_function_list["ROYAL_JELLY"] = &iuse::royal_jelly;
|
||||
iuse_function_list["BANDAGE"] = &iuse::bandage;
|
||||
iuse_function_list["FIRSTAID"] = &iuse::firstaid;
|
||||
iuse_function_list["CAFF"] = &iuse::caff;
|
||||
iuse_function_list["ALCOHOL"] = &iuse::alcohol;
|
||||
iuse_function_list["ALCOHOL_WEAK"] = &iuse::alcohol_weak;
|
||||
iuse_function_list["PKILL_1"] = &iuse::pkill_1;
|
||||
iuse_function_list["PKILL_2"] = &iuse::pkill_2;
|
||||
iuse_function_list["PKILL_3"] = &iuse::pkill_3;
|
||||
iuse_function_list["PKILL_4"] = &iuse::pkill_4;
|
||||
iuse_function_list["PKILL_L"] = &iuse::pkill_l;
|
||||
iuse_function_list["XANAX"] = &iuse::xanax;
|
||||
iuse_function_list["CIG"] = &iuse::cig;
|
||||
iuse_function_list["ANTIBIOTIC"] = &iuse::antibiotic;
|
||||
iuse_function_list["WEED"] = &iuse::weed;
|
||||
iuse_function_list["COKE"] = &iuse::coke;
|
||||
iuse_function_list["CRACK"] = &iuse::crack;
|
||||
iuse_function_list["GRACK"] = &iuse::grack;
|
||||
iuse_function_list["METH"] = &iuse::meth;
|
||||
iuse_function_list["POISON"] = &iuse::poison;
|
||||
iuse_function_list["HALLU"] = &iuse::hallu;
|
||||
iuse_function_list["THORAZINE"] = &iuse::thorazine;
|
||||
iuse_function_list["PROZAC"] = &iuse::prozac;
|
||||
iuse_function_list["SLEEP"] = &iuse::sleep;
|
||||
iuse_function_list["IODINE"] = &iuse::iodine;
|
||||
iuse_function_list["FLUMED"] = &iuse::flumed;
|
||||
iuse_function_list["FLUSLEEP"] = &iuse::flusleep;
|
||||
iuse_function_list["INHALER"] = &iuse::inhaler;
|
||||
iuse_function_list["BLECH"] = &iuse::blech;
|
||||
iuse_function_list["MUTAGEN"] = &iuse::mutagen;
|
||||
iuse_function_list["MUTAGEN_3"] = &iuse::mutagen_3;
|
||||
iuse_function_list["PURIFIER"] = &iuse::purifier;
|
||||
iuse_function_list["MARLOSS"] = &iuse::marloss;
|
||||
iuse_function_list["DOGFOOD"] = &iuse::dogfood;
|
||||
|
||||
// TOOLS
|
||||
iuse_function_list["LIGHTER"] = &iuse::lighter;
|
||||
iuse_function_list["PRIMITIVE_FIRE"] = &iuse::primitive_fire;
|
||||
iuse_function_list["SEW"] = &iuse::sew;
|
||||
iuse_function_list["EXTRA_BATTERY"] = &iuse::extra_battery;
|
||||
iuse_function_list["SCISSORS"] = &iuse::scissors;
|
||||
iuse_function_list["EXTINGUISHER"] = &iuse::extinguisher;
|
||||
iuse_function_list["HAMMER"] = &iuse::hammer;
|
||||
iuse_function_list["LIGHT_OFF"] = &iuse::light_off;
|
||||
iuse_function_list["LIGHT_ON"] = &iuse::light_on;
|
||||
iuse_function_list["GASOLINE_LANTERN_OFF"] = &iuse::gasoline_lantern_off;
|
||||
iuse_function_list["GASOLINE_LANTERN_ON"] = &iuse::gasoline_lantern_on;
|
||||
iuse_function_list["LIGHTSTRIP"] = &iuse::lightstrip;
|
||||
iuse_function_list["LIGHTSTRIP_ACTIVE"] = &iuse::lightstrip_active;
|
||||
iuse_function_list["GLOWSTICK"] = &iuse::glowstick;
|
||||
iuse_function_list["GLOWSTICK_ACTIVE"] = &iuse::glowstick_active;
|
||||
iuse_function_list["DIRECTIONAL_ANTENNA"] = &iuse::directional_antenna;
|
||||
iuse_function_list["DEVAC"] = &iuse::devac;
|
||||
iuse_function_list["CAUTERIZE_ELEC"] = &iuse::cauterize_elec;
|
||||
iuse_function_list["WATER_PURIFIER"] = &iuse::water_purifier;
|
||||
iuse_function_list["TWO_WAY_RADIO"] = &iuse::two_way_radio;
|
||||
iuse_function_list["RADIO_OFF"] = &iuse::radio_off;
|
||||
iuse_function_list["RADIO_ON"] = &iuse::radio_on;
|
||||
iuse_function_list["NOISE_EMITTER_OFF"] = &iuse::noise_emitter_off;
|
||||
iuse_function_list["NOISE_EMITTER_ON"] = &iuse::noise_emitter_on;
|
||||
iuse_function_list["ROADMAP"] = &iuse::roadmap;
|
||||
//// These have special arguments and won't work here
|
||||
//iuse_function_list["ROADMAP_A_TARGET"] = &iuse::roadmap_a_target;
|
||||
//iuse_function_list["ROADMAP_TARGETS"] = &iuse::roadmap_targets;
|
||||
iuse_function_list["PICKLOCK"] = &iuse::picklock;
|
||||
iuse_function_list["CROWBAR"] = &iuse::crowbar;
|
||||
iuse_function_list["MAKEMOUND"] = &iuse::makemound;
|
||||
iuse_function_list["DIG"] = &iuse::dig;
|
||||
iuse_function_list["SIPHON"] = &iuse::siphon;
|
||||
iuse_function_list["CHAINSAW_OFF"] = &iuse::chainsaw_off;
|
||||
iuse_function_list["CHAINSAW_ON"] = &iuse::chainsaw_on;
|
||||
iuse_function_list["JACKHAMMER"] = &iuse::jackhammer;
|
||||
iuse_function_list["JACQUESHAMMER"] = &iuse::jacqueshammer;
|
||||
iuse_function_list["PICKAXE"] = &iuse::pickaxe;
|
||||
iuse_function_list["SET_TRAP"] = &iuse::set_trap;
|
||||
iuse_function_list["GEIGER"] = &iuse::geiger;
|
||||
iuse_function_list["TELEPORT"] = &iuse::teleport;
|
||||
iuse_function_list["CAN_GOO"] = &iuse::can_goo;
|
||||
iuse_function_list["PIPEBOMB"] = &iuse::pipebomb;
|
||||
iuse_function_list["PIPEBOMB_ACT"] = &iuse::pipebomb_act;
|
||||
iuse_function_list["GRENADE"] = &iuse::grenade;
|
||||
iuse_function_list["GRENADE_ACT"] = &iuse::grenade_act;
|
||||
iuse_function_list["FLASHBANG"] = &iuse::flashbang;
|
||||
iuse_function_list["FLASHBANG_ACT"] = &iuse::flashbang_act;
|
||||
iuse_function_list["C4"] = &iuse::c4;
|
||||
iuse_function_list["C4ARMED"] = &iuse::c4armed;
|
||||
iuse_function_list["EMPBOMB"] = &iuse::EMPbomb;
|
||||
iuse_function_list["EMPBOMB_ACT"] = &iuse::EMPbomb_act;
|
||||
iuse_function_list["SCRAMBLER"] = &iuse::scrambler;
|
||||
iuse_function_list["SCRAMBLER_ACT"] = &iuse::scrambler_act;
|
||||
iuse_function_list["GASBOMB"] = &iuse::gasbomb;
|
||||
iuse_function_list["GASBOMB_ACT"] = &iuse::gasbomb_act;
|
||||
iuse_function_list["SMOKEBOMB"] = &iuse::smokebomb;
|
||||
iuse_function_list["SMOKEBOMB_ACT"] = &iuse::smokebomb_act;
|
||||
iuse_function_list["ACIDBOMB"] = &iuse::acidbomb;
|
||||
iuse_function_list["ACIDBOMB_ACT"] = &iuse::acidbomb_act;
|
||||
iuse_function_list["MOLOTOV"] = &iuse::molotov;
|
||||
iuse_function_list["MOLOTOV_LIT"] = &iuse::molotov_lit;
|
||||
iuse_function_list["DYNAMITE"] = &iuse::dynamite;
|
||||
iuse_function_list["DYNAMITE_ACT"] = &iuse::dynamite_act;
|
||||
iuse_function_list["FIRECRACKER_PACK"] = &iuse::firecracker_pack;
|
||||
iuse_function_list["FIRECRACKER_PACK_ACT"] = &iuse::firecracker_pack_act;
|
||||
iuse_function_list["FIRECRACKER"] = &iuse::firecracker;
|
||||
iuse_function_list["FIRECRACKER_ACT"] = &iuse::firecracker_act;
|
||||
iuse_function_list["MININUKE"] = &iuse::mininuke;
|
||||
iuse_function_list["MININUKE_ACT"] = &iuse::mininuke_act;
|
||||
iuse_function_list["PHEROMONE"] = &iuse::pheromone;
|
||||
iuse_function_list["PORTAL"] = &iuse::portal;
|
||||
iuse_function_list["MANHACK"] = &iuse::manhack;
|
||||
iuse_function_list["TURRET"] = &iuse::turret;
|
||||
iuse_function_list["UPS_OFF"] = &iuse::UPS_off;
|
||||
iuse_function_list["UPS_ON"] = &iuse::UPS_on;
|
||||
iuse_function_list["TAZER"] = &iuse::tazer;
|
||||
iuse_function_list["MP3"] = &iuse::mp3;
|
||||
iuse_function_list["MP3_ON"] = &iuse::mp3_on;
|
||||
iuse_function_list["VORTEX"] = &iuse::vortex;
|
||||
iuse_function_list["DOG_WHISTLE"] = &iuse::dog_whistle;
|
||||
iuse_function_list["VACUTAINER"] = &iuse::vacutainer;
|
||||
iuse_function_list["KNIFE"] = &iuse::knife;
|
||||
iuse_function_list["LUMBER"] = &iuse::lumber;
|
||||
iuse_function_list["HACKSAW"] = &iuse::hacksaw;
|
||||
iuse_function_list["TENT"] = &iuse::tent;
|
||||
iuse_function_list["SHELTER"] = &iuse::shelter;
|
||||
iuse_function_list["TORCH"] = &iuse::torch;
|
||||
iuse_function_list["TORCH_LIT"] = &iuse::torch_lit;
|
||||
iuse_function_list["CANDLE"] = &iuse::candle;
|
||||
iuse_function_list["CANDLE_LIT"] = &iuse::candle_lit;
|
||||
iuse_function_list["BULLET_PULLER"] = &iuse::bullet_puller;
|
||||
iuse_function_list["BOLTCUTTERS"] = &iuse::boltcutters;
|
||||
iuse_function_list["MOP"] = &iuse::mop;
|
||||
iuse_function_list["SPRAY_CAN"] = &iuse::spray_can;
|
||||
iuse_function_list["RAG"] = &iuse::rag;
|
||||
iuse_function_list["PDA"] = &iuse::pda;
|
||||
iuse_function_list["PDA_FLASHLIGHT"] = &iuse::pda_flashlight;
|
||||
iuse_function_list["LAW"] = &iuse::LAW;
|
||||
iuse_function_list["HEATPACK"] = &iuse::heatpack;
|
||||
iuse_function_list["DEJAR"] = &iuse::dejar;
|
||||
// MACGUFFINS
|
||||
iuse_function_list["MCG_NOTE"] = &iuse::mcg_note;
|
||||
// ARTIFACTS
|
||||
// This function is used when an artifact is activated
|
||||
// It examines the item's artifact-specific properties
|
||||
// See artifact.h for a list
|
||||
iuse_function_list["ARTIFACT"] = &iuse::artifact;
|
||||
|
||||
// Offensive Techniques
|
||||
techniques_list["SWEEP"] = mfb(TEC_SWEEP);
|
||||
techniques_list["PRECISE"] = mfb(TEC_PRECISE);
|
||||
techniques_list["BRUTAL"] = mfb(TEC_BRUTAL);
|
||||
techniques_list["GRAB"] = mfb(TEC_GRAB);
|
||||
techniques_list["WIDE"] = mfb(TEC_WIDE);
|
||||
techniques_list["RAPID"] = mfb(TEC_RAPID);
|
||||
techniques_list["FEINT"] = mfb(TEC_FEINT);
|
||||
techniques_list["THROW"] = mfb(TEC_THROW);
|
||||
techniques_list["DISARM"] = mfb(TEC_DISARM);
|
||||
// Defensive Techniques
|
||||
techniques_list["BLOCK"] = mfb(TEC_BLOCK);
|
||||
techniques_list["BLOCK_LEGS"] = mfb(TEC_BLOCK_LEGS);
|
||||
techniques_list["WBLOCK_1"] = mfb(TEC_WBLOCK_1);
|
||||
techniques_list["WBLOCK_2"] = mfb(TEC_WBLOCK_2);
|
||||
techniques_list["WBLOCK_3"] = mfb(TEC_WBLOCK_3);
|
||||
techniques_list["COUNTER"] = mfb(TEC_COUNTER);
|
||||
techniques_list["BREAK"] = mfb(TEC_BREAK);
|
||||
techniques_list["DEF_THROW"] = mfb(TEC_DEF_THROW);
|
||||
techniques_list["DEF_DISARM"] = mfb(TEC_DEF_DISARM);
|
||||
|
||||
//Ammo lists
|
||||
ammo_flags_list["NULL"] = mfb(AT_NULL);
|
||||
ammo_flags_list["THREAD"] = mfb(AT_THREAD);
|
||||
ammo_flags_list["BATT"] = mfb(AT_BATT);
|
||||
ammo_flags_list["PLUT"] = mfb(AT_PLUT);
|
||||
ammo_flags_list["NAIL"] = mfb(AT_NAIL);
|
||||
ammo_flags_list["BB"] = mfb(AT_BB);
|
||||
ammo_flags_list["BOLT"] = mfb(AT_BOLT);
|
||||
ammo_flags_list["ARROW"] = mfb(AT_ARROW);
|
||||
ammo_flags_list["SHOT"] = mfb(AT_SHOT);
|
||||
ammo_flags_list["22"] = mfb(AT_22);
|
||||
ammo_flags_list["9MM"] = mfb(AT_9MM);
|
||||
ammo_flags_list["762x25"] = mfb(AT_762x25);
|
||||
ammo_flags_list["38"] = mfb(AT_38);
|
||||
ammo_flags_list["40"] = mfb(AT_40);
|
||||
ammo_flags_list["44"] = mfb(AT_44);
|
||||
ammo_flags_list["45"] = mfb(AT_45);
|
||||
ammo_flags_list["57"] = mfb(AT_57);
|
||||
ammo_flags_list["46"] = mfb(AT_46);
|
||||
ammo_flags_list["762"] = mfb(AT_762);
|
||||
ammo_flags_list["223"] = mfb(AT_223);
|
||||
ammo_flags_list["3006"] = mfb(AT_3006);
|
||||
ammo_flags_list["308"] = mfb(AT_308);
|
||||
ammo_flags_list["40MM"] = mfb(AT_40MM);
|
||||
ammo_flags_list["66MM"] = mfb(AT_66MM);
|
||||
ammo_flags_list["GAS"] = mfb(AT_GAS);
|
||||
ammo_flags_list["FUSION"] = mfb(AT_FUSION);
|
||||
ammo_flags_list["MUSCLE"] = mfb(AT_MUSCLE);
|
||||
ammo_flags_list["12MM"] = mfb(AT_12MM);
|
||||
ammo_flags_list["PLASMA"] = mfb(AT_PLASMA);
|
||||
ammo_flags_list["WATER"] = mfb(AT_WATER);
|
||||
ammo_flags_list["PEBBLE"] = mfb(AT_PEBBLE);
|
||||
|
||||
ammo_effects_list["FLAME"] = mfb(AMMO_FLAME);
|
||||
ammo_effects_list["INCENDIARY"] = mfb(AMMO_INCENDIARY);
|
||||
ammo_effects_list["EXPLOSIVE"] = mfb(AMMO_EXPLOSIVE);
|
||||
ammo_effects_list["FRAG"] = mfb(AMMO_FRAG);
|
||||
ammo_effects_list["NAPALM"] = mfb(AMMO_NAPALM);
|
||||
ammo_effects_list["ACIDBOMB"] = mfb(AMMO_ACIDBOMB);
|
||||
ammo_effects_list["EXPLOSIVE_BIG"] = mfb(AMMO_EXPLOSIVE_BIG);
|
||||
ammo_effects_list["TEARGAS"] = mfb(AMMO_TEARGAS);
|
||||
ammo_effects_list["SMOKE"] = mfb(AMMO_SMOKE);
|
||||
ammo_effects_list["TRAIL"] = mfb(AMMO_TRAIL);
|
||||
ammo_effects_list["FLASHBANG"] = mfb(AMMO_FLASHBANG);
|
||||
ammo_effects_list["STREAM"] = mfb(AMMO_STREAM);
|
||||
ammo_effects_list["COOKOFF"] = mfb(AMMO_COOKOFF);
|
||||
ammo_effects_list["LASER"] = mfb(AMMO_LASER);
|
||||
|
||||
bodyparts_list["TORSO"] = mfb(bp_torso);
|
||||
bodyparts_list["HEAD"] = mfb(bp_head);
|
||||
bodyparts_list["EYES"] = mfb(bp_eyes);
|
||||
bodyparts_list["MOUTH"] = mfb(bp_mouth);
|
||||
bodyparts_list["ARMS"] = mfb(bp_arms);
|
||||
bodyparts_list["HANDS"] = mfb(bp_hands);
|
||||
bodyparts_list["LEGS"] = mfb(bp_legs);
|
||||
bodyparts_list["FEET"] = mfb(bp_feet);
|
||||
}
|
||||
|
||||
//Will eventually be deprecated - Loads existing item format into the item factory, and vice versa
|
||||
void Item_factory::init(game* main_game){
|
||||
load_item_templates(); // this one HAS to be called after game is created
|
||||
// Make a copy of our items loaded from JSON
|
||||
std::map<Item_tag, itype*> new_templates = m_templates;
|
||||
//Copy the hardcoded template pointers to the factory list
|
||||
m_templates.insert(main_game->itypes.begin(), main_game->itypes.end());
|
||||
//Copy the JSON-derived items to the legacy list
|
||||
main_game->itypes.insert(new_templates.begin(), new_templates.end());
|
||||
//And add them to the various item lists, as needed.
|
||||
for(std::map<Item_tag, itype*>::iterator iter = new_templates.begin(); iter != new_templates.end(); ++iter) {
|
||||
standard_itype_ids.push_back(iter->first);
|
||||
}
|
||||
}
|
||||
|
||||
//Returns the template with the given identification tag
|
||||
itype* Item_factory::find_template(const Item_tag id){
|
||||
std::map<Item_tag, itype*>::iterator found = m_templates.find(id);
|
||||
if(found != m_templates.end()){
|
||||
return found->second;
|
||||
}
|
||||
else{
|
||||
return m_missing_item;
|
||||
}
|
||||
}
|
||||
|
||||
//Returns a random template from the list of all templates.
|
||||
itype* Item_factory::random_template(){
|
||||
return template_from("ALL");
|
||||
}
|
||||
|
||||
//Returns a random template from those with the given group tag
|
||||
itype* Item_factory::template_from(const Item_tag group_tag){
|
||||
return find_template( id_from(group_tag) );
|
||||
}
|
||||
|
||||
//Returns a random template name from the list of all templates.
|
||||
const Item_tag Item_factory::random_id(){
|
||||
return id_from("ALL");
|
||||
}
|
||||
|
||||
//Returns a random template name from the list of all templates.
|
||||
const Item_tag Item_factory::id_from(const Item_tag group_tag){
|
||||
std::map<Item_tag, Item_group*>::iterator group_iter = m_template_groups.find(group_tag);
|
||||
//If the tag isn't found, just return a reference to missing item.
|
||||
if(group_iter != m_template_groups.end()){
|
||||
return group_iter->second->get_id();
|
||||
} else {
|
||||
return "MISSING_ITEM";
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
item Item_factory::create(Item_tag id, int created_at){
|
||||
return item(find_template(id),0);
|
||||
}
|
||||
Item_list Item_factory::create(Item_tag id, int created_at, int quantity){
|
||||
Item_list new_items;
|
||||
item new_item_base = create(id, created_at);
|
||||
for(int ii=0;ii<quantity;++ii){
|
||||
new_items.push_back(new_item_base.clone());
|
||||
}
|
||||
return new_items;
|
||||
}
|
||||
item Item_factory::create_from(Item_tag group, int created_at){
|
||||
return create(id_from(group), created_at);
|
||||
}
|
||||
Item_list Item_factory::create_from(Item_tag group, int created_at, int quantity){
|
||||
return create(id_from(group), created_at, quantity);
|
||||
}
|
||||
item Item_factory::create_random(int created_at){
|
||||
return create(random_id(), created_at);
|
||||
}
|
||||
Item_list Item_factory::create_random(int created_at, int quantity){
|
||||
Item_list new_items;
|
||||
item new_item_base = create(random_id(), created_at);
|
||||
for(int ii=0;ii<quantity;++ii){
|
||||
new_items.push_back(new_item_base.clone());
|
||||
}
|
||||
return new_items;
|
||||
}
|
||||
|
||||
///////////////////////
|
||||
// DATA FILE READING //
|
||||
///////////////////////
|
||||
|
||||
void Item_factory::load_item_templates(){
|
||||
load_item_templates_from("data/raw/items/melee.json");
|
||||
load_item_templates_from("data/raw/items/ranged.json");
|
||||
load_item_templates_from("data/raw/items/ammo.json");
|
||||
load_item_templates_from("data/raw/items/mods.json");
|
||||
load_item_templates_from("data/raw/items/tools.json");
|
||||
load_item_templates_from("data/raw/items/comestibles.json");
|
||||
load_item_templates_from("data/raw/items/armor.json");
|
||||
load_item_templates_from("data/raw/items/books.json");
|
||||
load_item_groups_from("data/raw/item_groups.json");
|
||||
}
|
||||
|
||||
// Load values from this data file into m_templates
|
||||
void Item_factory::load_item_templates_from(const std::string file_name){
|
||||
catajson all_items(file_name);
|
||||
|
||||
if (! all_items.is_array()) {
|
||||
debugmsg("%s is not an array of item_templates", file_name.c_str());
|
||||
exit(2);
|
||||
}
|
||||
|
||||
//Crawl through and extract the items
|
||||
for (all_items.set_begin(); all_items.has_curr(); all_items.next()) {
|
||||
catajson entry = all_items.curr();
|
||||
// The one element we absolutely require for an item definition is an id
|
||||
if(!entry.has("id") || !entry.get("id").is_string())
|
||||
{
|
||||
debugmsg("Item definition skipped, no id found or id was malformed.");
|
||||
}
|
||||
else
|
||||
{
|
||||
Item_tag new_id = entry.get("id").as_string();
|
||||
|
||||
// If everything works out, add the item to the group list...
|
||||
// unless a similar item is already there
|
||||
if(m_templates.find(new_id) != m_templates.end())
|
||||
{
|
||||
debugmsg("Item definition skipped, id %s already exists.", new_id.c_str());
|
||||
}
|
||||
else
|
||||
{
|
||||
itype* new_item_template;
|
||||
if (!entry.has("type"))
|
||||
{
|
||||
new_item_template = new itype();
|
||||
}
|
||||
else
|
||||
{
|
||||
std::string type_label = entry.get("type").as_string();
|
||||
if (type_label == "GUNMOD")
|
||||
{
|
||||
it_gunmod* gunmod_template = new it_gunmod();
|
||||
gunmod_template->damage = entry.get("damage_modifier").as_int();;
|
||||
gunmod_template->loudness = entry.get("loudness_modifier").as_int();
|
||||
gunmod_template->newtype = ammo_from_string(entry.get("ammo_modifier").as_string());
|
||||
gunmod_template->used_on_pistol = is_mod_target(entry.get("mod_targets"), "pistol");
|
||||
gunmod_template->used_on_shotgun = is_mod_target(entry.get("mod_targets"), "shotgun");
|
||||
gunmod_template->used_on_smg = is_mod_target(entry.get("mod_targets"), "smg");
|
||||
gunmod_template->used_on_rifle = is_mod_target(entry.get("mod_targets"), "rifle");
|
||||
gunmod_template->accuracy = entry.get("accuracy_modifier").as_int();
|
||||
gunmod_template->recoil = entry.get("recoil_modifier").as_int();
|
||||
gunmod_template->burst = entry.get("burst_modifier").as_int();
|
||||
gunmod_template->clip = entry.get("clip_size_modifier").as_int();
|
||||
gunmod_template->acceptible_ammo_types = (!entry.has("acceptable_ammo") ? 0 : flags_from_json(entry.get("acceptable_ammo"), "ammo"));
|
||||
new_item_template = gunmod_template;
|
||||
}
|
||||
else if (type_label == "COMESTIBLE")
|
||||
{
|
||||
it_comest* comest_template = new it_comest();
|
||||
comest_template->comesttype = entry.get("comestible_type").as_string();
|
||||
comest_template->tool = entry.get("tool").as_string();
|
||||
comest_template->container = entry.get("container").as_string();
|
||||
comest_template->quench = entry.get("quench").as_int();
|
||||
comest_template->nutr = entry.get("nutrition").as_int();
|
||||
comest_template->spoils = entry.get("spoils_in").as_int();
|
||||
comest_template->addict = entry.get("addiction_potential").as_int();
|
||||
comest_template->charges = entry.get("charges").as_int();
|
||||
comest_template->stim = entry.get("stim").as_int();
|
||||
comest_template->healthy = entry.get("heal").as_int();
|
||||
comest_template->fun = entry.get("fun").as_int();
|
||||
comest_template->add = addiction_type(entry.get("addiction_type").as_string());
|
||||
new_item_template = comest_template;
|
||||
}
|
||||
else if (type_label == "GUN")
|
||||
{
|
||||
it_gun* gun_template = new it_gun();
|
||||
gun_template->ammo = ammo_from_string(entry.get("ammo").as_string());
|
||||
gun_template->skill_used = Skill::skill(entry.get("skill").as_string());
|
||||
gun_template->dmg_bonus = entry.get("ranged_damage").as_int();
|
||||
gun_template->range = entry.get("range").as_int();
|
||||
gun_template->accuracy = entry.get("accuracy").as_int();
|
||||
gun_template->recoil = entry.get("recoil").as_int();
|
||||
gun_template->durability = entry.get("durability").as_int();
|
||||
gun_template->burst = entry.get("burst").as_int();
|
||||
gun_template->clip = entry.get("clip_size").as_int();
|
||||
gun_template->reload_time = entry.get("reload").as_int();
|
||||
|
||||
new_item_template = gun_template;
|
||||
}
|
||||
else if (type_label == "TOOL")
|
||||
{
|
||||
it_tool* tool_template = new it_tool();
|
||||
tool_template->ammo = ammo_from_string(entry.get("ammo").as_string());
|
||||
tool_template->max_charges = entry.get("max_charges").as_int();
|
||||
tool_template->def_charges = entry.get("initial_charges").as_int();
|
||||
tool_template->charges_per_use = entry.get("charges_per_use").as_int();
|
||||
tool_template->turns_per_charge = entry.get("turns_per_charge").as_int();
|
||||
tool_template->revert_to = entry.get("revert_to").as_string();
|
||||
|
||||
new_item_template = tool_template;
|
||||
}
|
||||
else if (type_label == "AMMO")
|
||||
{
|
||||
it_ammo* ammo_template = new it_ammo();
|
||||
ammo_template->type =
|
||||
ammo_from_string(
|
||||
entry.get("ammo_type").as_string());
|
||||
ammo_template->damage = entry.get("damage").as_int();
|
||||
ammo_template->pierce = entry.get("pierce").as_int();
|
||||
ammo_template->range = entry.get("range").as_int();
|
||||
ammo_template->accuracy =
|
||||
entry.get("accuracy").as_int();
|
||||
ammo_template->recoil = entry.get("recoil").as_int();
|
||||
ammo_template->count = entry.get("count").as_int();
|
||||
ammo_template->ammo_effects =
|
||||
(!entry.has("effects") ? 0 :
|
||||
flags_from_json(entry.get("effects"),
|
||||
"ammo_effects"));
|
||||
|
||||
new_item_template = ammo_template;
|
||||
}
|
||||
else if (type_label == "ARMOR")
|
||||
{
|
||||
it_armor* armor_template = new it_armor();
|
||||
|
||||
armor_template->encumber = entry.get("encumberance").as_int();
|
||||
armor_template->coverage = entry.get("coverage").as_int();
|
||||
armor_template->thickness = entry.get("material_thickness").as_int();
|
||||
armor_template->env_resist = entry.get("enviromental_protection").as_int();
|
||||
armor_template->warmth = entry.get("warmth").as_int();
|
||||
armor_template->storage = entry.get("storage").as_int();
|
||||
armor_template->power_armor = entry.has("power_armor") ? entry.get("power_armor").as_bool() : false;
|
||||
armor_template->covers = entry.has("covers") ?
|
||||
flags_from_json(entry.get("covers"),"bodyparts") : 0;
|
||||
|
||||
new_item_template = armor_template;
|
||||
}
|
||||
else if (type_label == "BOOK")
|
||||
{
|
||||
it_book* book_template = new it_book();
|
||||
|
||||
book_template->level = entry.get("max_level").as_int();
|
||||
book_template->req = entry.get("required_level").as_int();
|
||||
book_template->fun = entry.get("fun").as_int();
|
||||
book_template->intel = entry.get("intelligence").as_int();
|
||||
book_template->time = entry.get("time").as_int();
|
||||
book_template->type = Skill::skill(entry.get("skill").as_string());
|
||||
|
||||
new_item_template = book_template;
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("Item definition for %s skipped, unrecognized type: %s", new_id.c_str(),
|
||||
type_label.c_str());
|
||||
break;
|
||||
}
|
||||
}
|
||||
new_item_template->id = new_id;
|
||||
m_templates[new_id] = new_item_template;
|
||||
|
||||
// And then proceed to assign the correct field
|
||||
new_item_template->rarity = entry.get("rarity").as_int();
|
||||
new_item_template->price = entry.get("price").as_int();
|
||||
new_item_template->name = entry.get("name").as_string();
|
||||
new_item_template->sym = entry.get("symbol").as_char();
|
||||
new_item_template->color = color_from_string(entry.get("color").as_string());
|
||||
new_item_template->description = entry.get("description").as_string();
|
||||
if(entry.has("material")){
|
||||
set_material_from_json(new_id, entry.get("material"));
|
||||
} else {
|
||||
new_item_template->m1 = MNULL;
|
||||
new_item_template->m2 = MNULL;
|
||||
}
|
||||
Item_tag new_phase = "solid";
|
||||
if(entry.has("phase")){
|
||||
new_phase = entry.get("phase").as_string();
|
||||
}
|
||||
new_item_template->phase = phase_from_tag(new_phase);
|
||||
new_item_template->volume = entry.get("volume").as_int();
|
||||
new_item_template->weight = entry.get("weight").as_int();
|
||||
new_item_template->melee_dam = entry.get("bashing").as_int();
|
||||
new_item_template->melee_cut = entry.get("cutting").as_int();
|
||||
new_item_template->m_to_hit = entry.get("to_hit").as_int();
|
||||
|
||||
if( entry.has("flags") )
|
||||
{
|
||||
new_item_template->item_tags = entry.get("flags").as_tags();
|
||||
/*
|
||||
List of current flags
|
||||
FIT - Reduces encumberance by one
|
||||
VARSIZE - Can be made to fit via tailoring
|
||||
OVERSIZE - Can always be worn no matter encumberance/mutations/bionics/etc
|
||||
HOOD - Will increase warmth for head if head is cold and player is not wearing a helmet (headwear of material that is not wool or cotton)
|
||||
POCKETS - Will increase warmth for hands if hands are cold and the player is wielding nothing
|
||||
*/
|
||||
}
|
||||
|
||||
new_item_template->techniques = (!entry.has("techniques") ? 0 :
|
||||
flags_from_json(entry.get("techniques"), "techniques"));
|
||||
new_item_template->use = (!entry.has("use_action") ? &iuse::none :
|
||||
use_from_string(entry.get("use_action").as_string()));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Load values from this data file into m_template_groups
|
||||
void Item_factory::load_item_groups_from(const std::string file_name){
|
||||
std::ifstream data_file;
|
||||
picojson::value input_value;
|
||||
|
||||
data_file.open(file_name.c_str());
|
||||
data_file >> input_value;
|
||||
data_file.close();
|
||||
|
||||
//Handle any obvious errors on file load
|
||||
std::string err = picojson::get_last_error();
|
||||
if (! err.empty()) {
|
||||
std::cerr << "In JSON file \"" << file_name << "\"" << data_file << ":" << err << std::endl;
|
||||
exit(1);
|
||||
}
|
||||
if (! input_value.is<picojson::array>()) {
|
||||
std::cerr << file_name << " is not an array of item groups"<< std::endl;
|
||||
exit(2);
|
||||
}
|
||||
|
||||
//Crawl through once and create an entry for every definition
|
||||
const picojson::array& all_items = input_value.get<picojson::array>();
|
||||
for (picojson::array::const_iterator entry = all_items.begin(); entry != all_items.end(); ++entry) {
|
||||
if( !(entry->is<picojson::object>()) ){
|
||||
std::cerr << "Invalid group definition, entry not a JSON object" << std::endl;
|
||||
}
|
||||
else{
|
||||
const picojson::value::object& entry_body = entry->get<picojson::object>();
|
||||
|
||||
// The one element we absolutely require for an item definition is an id
|
||||
picojson::value::object::const_iterator key_pair = entry_body.find("id");
|
||||
if( key_pair == entry_body.end() || !(key_pair->second.is<std::string>()) ){
|
||||
std::cerr << "Group definition skipped, no id found or id was malformed." << std::endl;
|
||||
} else {
|
||||
Item_tag group_id = key_pair->second.get<std::string>();
|
||||
m_template_groups[group_id] = new Item_group(group_id);
|
||||
}
|
||||
}
|
||||
}
|
||||
//Once all the group definitions are set, fill them out
|
||||
for (picojson::array::const_iterator entry = all_items.begin(); entry != all_items.end(); ++entry) {
|
||||
const picojson::value::object& entry_body = entry->get<picojson::object>();
|
||||
|
||||
Item_tag group_id = entry_body.find("id")->second.get<std::string>();
|
||||
Item_group current_group = *m_template_groups.find(group_id)->second;
|
||||
|
||||
//Add items
|
||||
picojson::value::object::const_iterator key_pair = entry_body.find("items");
|
||||
if( key_pair != entry_body.end() ){
|
||||
if( !(key_pair->second.is<picojson::array>()) ){
|
||||
std::cerr << "Invalid item list for group definition '"+group_id+"', list of items not an array." << std::endl;
|
||||
} else {
|
||||
//We have confirmed that we have a list of SOMETHING, now let's add them one at a time.
|
||||
const picojson::array& items_to_add = key_pair->second.get<picojson::array>();
|
||||
for (picojson::array::const_iterator item_pair = items_to_add.begin(); item_pair != items_to_add.end(); ++item_pair) {
|
||||
//Before adding, make sure this element is in the right format, namely ["TAG_NAME", frequency number]
|
||||
if(!(item_pair->is<picojson::array>())){
|
||||
std::cerr << "Invalid item list for group definition '"+group_id+"', element is not an array." << std::endl;
|
||||
} else if(item_pair->get<picojson::array>().size()!=2){
|
||||
std::cerr << "Invalid item list for group definition '"+group_id+"', element does not have 2 values." << std::endl;
|
||||
} else {
|
||||
picojson::array item_frequency_array = item_pair->get<picojson::array>();
|
||||
//Finally, insure that the first value is a string, and the second is a number
|
||||
if(!item_frequency_array[0].is<std::string>() || !item_frequency_array[1].is<double>() ){
|
||||
std::cerr << "Invalid item list for group definition '"+group_id+"', element is not a valid tag/frequency pair." << std::endl;
|
||||
} else {
|
||||
current_group.add_entry(item_frequency_array[0].get<std::string>(), (int)item_frequency_array[1].get<double>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Add groups
|
||||
key_pair = entry_body.find("groups");
|
||||
if(key_pair != entry_body.end()){
|
||||
if( !(key_pair->second.is<picojson::array>()) ){
|
||||
std::cerr << "Invalid group list for group definition '"+group_id+"', list of items not an array." << std::endl;
|
||||
} else {
|
||||
//We have confirmed that we have a list of SOMETHING, now let's add them one at a time.
|
||||
const picojson::array& items_to_add = key_pair->second.get<picojson::array>();
|
||||
for (picojson::array::const_iterator item_pair = items_to_add.begin(); item_pair != items_to_add.end(); ++item_pair) {
|
||||
//Before adding, make sure this element is in the right format, namely ["TAG_NAME", frequency number]
|
||||
if(!(item_pair->is<picojson::array>())){
|
||||
std::cerr << "Invalid group list for group definition '"+group_id+"', element is not an array." << std::endl;
|
||||
} else if(item_pair->get<picojson::array>().size()!=2){
|
||||
std::cerr << "Invalid group list for group definition '"+group_id+"', element does not have 2 values." << std::endl;
|
||||
} else {
|
||||
picojson::array item_frequency_array = item_pair->get<picojson::array>();
|
||||
//Finally, insure that the first value is a string, and the second is a number
|
||||
if(!item_frequency_array[0].is<std::string>() || !item_frequency_array[1].is<double>() ){
|
||||
std::cerr << "Invalid group list for group definition '"+group_id+"', element is not a valid tag/frequency pair." << std::endl;
|
||||
} else {
|
||||
Item_group* subgroup = m_template_groups.find(item_frequency_array[0].get<std::string>())->second;
|
||||
current_group.add_group(subgroup, (int)item_frequency_array[1].get<double>());
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
//Grab color, with appropriate error handling
|
||||
nc_color Item_factory::color_from_string(std::string new_color){
|
||||
if("red"==new_color){
|
||||
return c_red;
|
||||
} else if("blue"==new_color){
|
||||
return c_blue;
|
||||
} else if("green"==new_color){
|
||||
return c_green;
|
||||
} else if("light_cyan"==new_color){
|
||||
return c_ltcyan;
|
||||
} else if("brown"==new_color){
|
||||
return c_brown;
|
||||
} else if("light_red"==new_color){
|
||||
return c_ltred;
|
||||
} else if("white"==new_color){
|
||||
return c_white;
|
||||
} else if("light_blue"==new_color){
|
||||
return c_ltblue;
|
||||
} else if("yellow"==new_color){
|
||||
return c_yellow;
|
||||
} else if("magenta"==new_color){
|
||||
return c_magenta;
|
||||
} else if("cyan"==new_color){
|
||||
return c_cyan;
|
||||
} else if("light_gray"==new_color){
|
||||
return c_ltgray;
|
||||
} else if("dark_gray"==new_color){
|
||||
return c_dkgray;
|
||||
} else if("light_green"==new_color){
|
||||
return c_ltgreen;
|
||||
} else if("pink"==new_color){
|
||||
return c_pink;
|
||||
} else {
|
||||
debugmsg("Received invalid color property %s. Color is required.", new_color.c_str());
|
||||
return c_white;
|
||||
}
|
||||
}
|
||||
|
||||
ammotype Item_factory::ammo_from_string(std::string new_ammo){
|
||||
if("nail"==new_ammo){
|
||||
return AT_NAIL;
|
||||
} else if ("BB" == new_ammo) {
|
||||
return AT_BB;
|
||||
} else if ("pebble" == new_ammo) {
|
||||
return AT_PEBBLE;
|
||||
} else if ("bolt" == new_ammo) {
|
||||
return AT_BOLT;
|
||||
} else if ("arrow" == new_ammo) {
|
||||
return AT_ARROW;
|
||||
} else if ("shot" == new_ammo) {
|
||||
return AT_SHOT;
|
||||
} else if (".22" == new_ammo) {
|
||||
return AT_22;
|
||||
} else if ("9mm" == new_ammo) {
|
||||
return AT_9MM;
|
||||
} else if ("7.62x25mm" == new_ammo) {
|
||||
return AT_762x25;
|
||||
} else if (".38" == new_ammo) {
|
||||
return AT_38;
|
||||
} else if (".40" == new_ammo) {
|
||||
return AT_40;
|
||||
} else if (".44" == new_ammo) {
|
||||
return AT_44;
|
||||
} else if (".45" == new_ammo) {
|
||||
return AT_45;
|
||||
} else if ("5.7mm" == new_ammo) {
|
||||
return AT_57;
|
||||
} else if ("4.6mm" == new_ammo) {
|
||||
return AT_46;
|
||||
} else if ("7.62x39mm" == new_ammo) {
|
||||
return AT_762;
|
||||
} else if (".223" == new_ammo) {
|
||||
return AT_223;
|
||||
} else if (".30-06" == new_ammo) {
|
||||
return AT_3006;
|
||||
} else if (".308" == new_ammo) {
|
||||
return AT_308;
|
||||
} else if ("40mm" == new_ammo) {
|
||||
return AT_40MM;
|
||||
} else if ("66mm" == new_ammo) {
|
||||
return AT_66MM;
|
||||
} else if ("gasoline" == new_ammo) {
|
||||
return AT_GAS;
|
||||
} else if ("thread" == new_ammo) {
|
||||
return AT_THREAD;
|
||||
} else if ("battery" == new_ammo) {
|
||||
return AT_BATT;
|
||||
} else if ("plutonium" == new_ammo) {
|
||||
return AT_PLUT;
|
||||
} else if ("muscle" == new_ammo) {
|
||||
return AT_MUSCLE;
|
||||
} else if ("fusion" == new_ammo) {
|
||||
return AT_FUSION;
|
||||
} else if ("12mm" == new_ammo) {
|
||||
return AT_12MM;
|
||||
} else if ("plasma" == new_ammo) {
|
||||
return AT_PLASMA;
|
||||
} else if ("water" == new_ammo) {
|
||||
return AT_WATER;
|
||||
} else if ("none" == new_ammo) {
|
||||
return AT_NULL; // NX17 and other special weapons
|
||||
} else {
|
||||
debugmsg("Read invalid ammo %s.", new_ammo.c_str());
|
||||
return AT_NULL;
|
||||
}
|
||||
}
|
||||
|
||||
Use_function Item_factory::use_from_string(std::string function_name){
|
||||
std::map<Item_tag, Use_function>::iterator found_function = iuse_function_list.find(function_name);
|
||||
|
||||
//Before returning, make sure sure the function actually exists
|
||||
if(found_function != iuse_function_list.end()){
|
||||
return found_function->second;
|
||||
} else {
|
||||
//Otherwise, return a hardcoded function we know exists (hopefully)
|
||||
debugmsg("Received unrecognized iuse function %s, using iuse::none instead", function_name.c_str());
|
||||
return &iuse::none;
|
||||
}
|
||||
}
|
||||
|
||||
void Item_factory::set_flag_by_string(unsigned& cur_flags, std::string new_flag, std::string flag_type)
|
||||
{
|
||||
std::map<Item_tag, unsigned> flag_map;
|
||||
if(flag_type=="ammo"){
|
||||
flag_map = ammo_flags_list;
|
||||
} else if(flag_type=="techniques"){
|
||||
flag_map = techniques_list;
|
||||
} else if(flag_type=="ammo_effects"){
|
||||
flag_map = ammo_effects_list;
|
||||
} else if(flag_type=="bodyparts"){
|
||||
flag_map = bodyparts_list;
|
||||
}
|
||||
|
||||
set_bitmask_by_string(flag_map, cur_flags, new_flag);
|
||||
}
|
||||
|
||||
void Item_factory::set_bitmask_by_string(std::map<Item_tag, unsigned> flag_map, unsigned& cur_bitmask, std::string new_flag)
|
||||
{
|
||||
std::map<Item_tag, unsigned>::const_iterator found_flag_iter = flag_map.find(new_flag);
|
||||
if(found_flag_iter != flag_map.end())
|
||||
{
|
||||
cur_bitmask = cur_bitmask | found_flag_iter->second;
|
||||
}
|
||||
else
|
||||
{
|
||||
debugmsg("Invalid item flag (etc.): %s", new_flag.c_str());
|
||||
}
|
||||
}
|
||||
|
||||
unsigned Item_factory::flags_from_json(catajson flag_list, std::string flag_type){
|
||||
//If none is found, just use the standard none action
|
||||
unsigned flag = 0;
|
||||
//Otherwise, grab the right label to look for
|
||||
if (flag_list.is_array())
|
||||
{
|
||||
for (flag_list.set_begin(); flag_list.has_curr(); flag_list.next())
|
||||
{
|
||||
set_flag_by_string(flag, flag_list.curr().as_string(), flag_type);
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
//we should have gotten a string, if not an array, and catajson will do error checking
|
||||
set_flag_by_string(flag, flag_list.as_string(), flag_type);
|
||||
}
|
||||
return flag;
|
||||
}
|
||||
|
||||
bool Item_factory::is_mod_target(catajson targets, std::string weapon){
|
||||
//If none is found, just use the standard none action
|
||||
unsigned is_included = false;
|
||||
//Otherwise, grab the right label to look for
|
||||
if (targets.is_array())
|
||||
{
|
||||
for (targets.set_begin(); targets.has_curr() && !is_included; targets.next())
|
||||
{
|
||||
if(targets.curr().as_string() == weapon){
|
||||
is_included=true;
|
||||
}
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
if(targets.as_string() == weapon){
|
||||
is_included=true;
|
||||
}
|
||||
}
|
||||
return is_included;
|
||||
}
|
||||
|
||||
void Item_factory::set_material_from_json(Item_tag new_id, catajson mat_list){
|
||||
//If the value isn't found, just return a group of null materials
|
||||
material material_list[2] = {MNULL, MNULL};
|
||||
|
||||
if (mat_list.is_array())
|
||||
{
|
||||
if (mat_list.has(2))
|
||||
{
|
||||
debugmsg("Too many materials provided for item %s", new_id.c_str());
|
||||
}
|
||||
material_list[0] = material_from_tag(new_id, mat_list.get(0).as_string());
|
||||
material_list[1] = material_from_tag(new_id, mat_list.get(1).as_string());
|
||||
}
|
||||
else
|
||||
{
|
||||
material_list[0] = material_from_tag(new_id, mat_list.as_string());
|
||||
}
|
||||
|
||||
itype* temp = find_template(new_id);
|
||||
temp->m1 = material_list[0];
|
||||
temp->m2 = material_list[1];
|
||||
}
|
||||
|
||||
|
||||
phase_id Item_factory::phase_from_tag(Item_tag name){
|
||||
if(name == "liquid"){
|
||||
return LIQUID;
|
||||
} else if(name == "solid"){
|
||||
return SOLID;
|
||||
} else if(name == "gas"){
|
||||
return GAS;
|
||||
} else if(name == "plasma"){
|
||||
return PLASMA;
|
||||
} else {
|
||||
return PNULL;
|
||||
}
|
||||
};
|
||||
|
||||
// TODO: depreciate once materials rewrite is up and running
|
||||
|
||||
material Item_factory::material_from_tag(Item_tag new_id, Item_tag name){
|
||||
// Map the valid input tags to a valid material
|
||||
|
||||
// This should clearly be some sort of map, stored somewhere
|
||||
// ...unless it can get replaced entirely, which would be nice.
|
||||
// For now, though, that isn't the problem I'm solving.
|
||||
if(name == "VEGGY"){
|
||||
return VEGGY;
|
||||
} else if(name == "FLESH"){
|
||||
return FLESH;
|
||||
} else if(name == "POWDER"){
|
||||
return POWDER;
|
||||
} else if(name == "HFLESH"){
|
||||
return HFLESH;
|
||||
} else if(name == "COTTON"){
|
||||
return COTTON;
|
||||
} else if(name == "WOOL"){
|
||||
return WOOL;
|
||||
} else if(name == "LEATHER"){
|
||||
return LEATHER;
|
||||
} else if(name == "KEVLAR"){
|
||||
return KEVLAR;
|
||||
} else if(name == "FUR"){
|
||||
return FUR;
|
||||
} else if(name == "CHITIN"){
|
||||
return CHITIN;
|
||||
} else if(name == "STONE"){
|
||||
return STONE;
|
||||
} else if(name == "PAPER"){
|
||||
return PAPER;
|
||||
} else if(name == "WOOD"){
|
||||
return WOOD;
|
||||
} else if(name == "PLASTIC"){
|
||||
return PLASTIC;
|
||||
} else if(name == "GLASS"){
|
||||
return GLASS;
|
||||
} else if(name == "IRON"){
|
||||
return IRON;
|
||||
} else if(name == "STEEL"){
|
||||
return STEEL;
|
||||
} else if(name == "SILVER"){
|
||||
return SILVER;
|
||||
} else if(name == "NULL"){
|
||||
return MNULL;
|
||||
} else {
|
||||
return MNULL;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,86 @@
|
||||
#ifndef _ITEM_FACTORY_H_
|
||||
#define _ITEM_FACTORY_H_
|
||||
|
||||
#include "game.h"
|
||||
#include "itype.h"
|
||||
#include "item.h"
|
||||
#include "color.h"
|
||||
#include "picojson.h"
|
||||
#include "catajson.h"
|
||||
#include "item_group.h"
|
||||
#include "iuse.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <map>
|
||||
|
||||
typedef std::string Item_tag;
|
||||
typedef std::vector<item> Item_list;
|
||||
typedef void (iuse::*Use_function)(game*,player*,item*,bool);
|
||||
|
||||
//For the iuse arguments
|
||||
class game;
|
||||
class player;
|
||||
|
||||
class Item_factory
|
||||
{
|
||||
public:
|
||||
//Setup
|
||||
Item_factory();
|
||||
void init();
|
||||
void init(game* main_game);
|
||||
|
||||
//Intermediary Methods - Will probably be removed at final stage
|
||||
itype* find_template(Item_tag id);
|
||||
itype* random_template();
|
||||
itype* template_from(Item_tag group_tag);
|
||||
const Item_tag random_id();
|
||||
const Item_tag id_from(Item_tag group_tag);
|
||||
|
||||
//Production methods
|
||||
item create(Item_tag id, int created_at);
|
||||
Item_list create(Item_tag id, int created_at, int quantity);
|
||||
item create_from(Item_tag group, int created_at);
|
||||
Item_list create_from(Item_tag group, int created_at, int quantity);
|
||||
item create_random(int created_at);
|
||||
Item_list create_random(int created_at, int quantity);
|
||||
|
||||
private:
|
||||
std::map<Item_tag, itype*> m_templates;
|
||||
itype* m_missing_item;
|
||||
std::map<Item_tag, Item_group*> m_template_groups;
|
||||
|
||||
//json data handlers
|
||||
void load_item_templates();
|
||||
void load_item_templates_from(const std::string file_name);
|
||||
void load_item_groups_from(const std::string file_name);
|
||||
|
||||
nc_color color_from_string(std::string color);
|
||||
Use_function use_from_string(std::string name);
|
||||
unsigned flags_from_json(catajson flags, std::string flag_type="");
|
||||
void set_material_from_json(Item_tag new_id, catajson mats);
|
||||
bool is_mod_target(catajson targets, std::string weapon);
|
||||
material material_from_tag(Item_tag new_id, Item_tag index);
|
||||
phase_id phase_from_tag(Item_tag name);
|
||||
ammotype ammo_from_string(std::string ammo);
|
||||
|
||||
//two convenience functions that just call into set_bitmask_by_string
|
||||
void set_flag_by_string(unsigned& cur_flags, std::string new_flag, std::string flag_type);
|
||||
//sets a bitmask (cur_bitmask) based on the values of flag_map and new_flag
|
||||
void set_bitmask_by_string(std::map<Item_tag, unsigned> flag_map,
|
||||
unsigned& cur_bitmask, std::string new_flag);
|
||||
|
||||
//iuse stuff
|
||||
std::map<Item_tag, Use_function> iuse_function_list;
|
||||
//techniques stuff
|
||||
std::map<Item_tag, unsigned> techniques_list;
|
||||
//ammo stuff
|
||||
std::map<Item_tag, unsigned> ammo_flags_list;
|
||||
//ammo effects
|
||||
std::map<Item_tag, unsigned> ammo_effects_list;
|
||||
//bodyparts
|
||||
std::map<Item_tag, unsigned> bodyparts_list;
|
||||
};
|
||||
|
||||
extern Item_factory* item_controller;
|
||||
|
||||
#endif
|
||||
@@ -0,0 +1,88 @@
|
||||
#include "item_factory.h"
|
||||
#include "item_group.h"
|
||||
#include "rng.h"
|
||||
#include <map>
|
||||
#include <algorithm>
|
||||
|
||||
Item_group::Item_group(const Item_tag id) : m_id(id), m_max_odds(0){
|
||||
}
|
||||
|
||||
// When selecting an id from this group, the value returned is determined based on the odds
|
||||
// given when inserted into the group.
|
||||
const Item_tag Item_group::get_id(){
|
||||
//Create a list of visited groups - in case of recursion, this will be needed to throw an error.
|
||||
std::vector<Item_tag> recursion_list;
|
||||
return get_id(recursion_list);
|
||||
}
|
||||
|
||||
const Item_tag Item_group::get_id(std::vector<Item_tag> recursion_list){
|
||||
int rolled_value = rng(1,m_max_odds)-1;
|
||||
|
||||
//Insure we haven't already visited this group
|
||||
if(std::find(recursion_list.begin(), recursion_list.end(), m_id) != recursion_list.end()){
|
||||
std::string error_message = "Recursion loop occured in retrieval from item group "+m_id+". Recursion backtrace follows:\n";
|
||||
for(std::vector<Item_tag>::iterator iter = recursion_list.begin(); iter != recursion_list.end(); ++iter){
|
||||
error_message+=*iter;
|
||||
}
|
||||
debugmsg(error_message.c_str());
|
||||
return "MISSING_ITEM";
|
||||
}
|
||||
//So we don't visit this item group again
|
||||
recursion_list.push_back(m_id);
|
||||
|
||||
//First, check through groups.
|
||||
//Groups are assigned first, and will get the lower value odds.
|
||||
for(std::vector<Item_group_group*>::iterator iter = m_groups.begin(); iter != m_groups.end(); ++iter){
|
||||
if((*iter)->check(rolled_value)){
|
||||
return (*iter)->get(recursion_list);
|
||||
}
|
||||
}
|
||||
|
||||
//If no match was found in groups, check in entries
|
||||
for(std::vector<Item_group_entry*>::iterator iter = m_entries.begin(); iter != m_entries.end(); ++iter){
|
||||
if((*iter)->check(rolled_value)){
|
||||
return (*iter)->get();
|
||||
}
|
||||
}
|
||||
|
||||
debugmsg("There was an unknown error in Item_group::get_id.");
|
||||
return "MISSING_ITEM";
|
||||
}
|
||||
|
||||
|
||||
void Item_group::add_entry(const Item_tag id, int chance){
|
||||
m_max_odds = m_max_odds+chance;
|
||||
Item_group_entry* new_entry = new Item_group_entry(id, m_max_odds);
|
||||
m_entries.push_back(new_entry);
|
||||
}
|
||||
|
||||
void Item_group::add_group(Item_group* group, int chance){
|
||||
m_max_odds = m_max_odds+chance;
|
||||
Item_group_group* new_group = new Item_group_group(group, m_max_odds);
|
||||
m_groups.push_back(new_group);
|
||||
}
|
||||
|
||||
|
||||
//Item_group_entry definition
|
||||
Item_group_entry::Item_group_entry(const Item_tag id, int upper_bound): m_id(id), m_upper_bound(upper_bound){
|
||||
}
|
||||
|
||||
bool Item_group_entry::check(int value) const{
|
||||
return (value < m_upper_bound);
|
||||
}
|
||||
|
||||
const Item_tag Item_group_entry::get() const{
|
||||
return m_id;
|
||||
}
|
||||
|
||||
//Item_group_group definitions
|
||||
Item_group_group::Item_group_group(Item_group* group, int upper_bound): m_group(group), m_upper_bound(upper_bound){
|
||||
}
|
||||
|
||||
bool Item_group_group::check(int value) const{
|
||||
return (value < m_upper_bound);
|
||||
}
|
||||
|
||||
const Item_tag Item_group_group::get(std::vector<Item_tag> recursion_list){
|
||||
return m_group->get_id(recursion_list);
|
||||
}
|
||||
@@ -0,0 +1,53 @@
|
||||
#ifndef _ITEM_GROUP_H_
|
||||
#define _ITEM_GROUP_H_
|
||||
|
||||
#include <vector>
|
||||
|
||||
typedef std::string Item_tag;
|
||||
|
||||
class Item_group_entry;
|
||||
class Item_group_group;
|
||||
|
||||
class Item_group
|
||||
{
|
||||
public:
|
||||
Item_group(Item_tag id);
|
||||
|
||||
const Item_tag get_id();
|
||||
const Item_tag get_id(std::vector<Item_tag> recursion_list);
|
||||
void add_entry(const Item_tag item_id, int chance);
|
||||
void add_group(Item_group*, int chance);
|
||||
private:
|
||||
const Item_tag m_id;
|
||||
int m_max_odds;
|
||||
std::vector<Item_group_group*> m_groups;
|
||||
std::vector<Item_group_entry*> m_entries;
|
||||
};
|
||||
|
||||
//Item group entries involve a string value, and an upper bound
|
||||
//Since items beforehand have already been checked, there is no need
|
||||
//to add a lower bound value.
|
||||
class Item_group_entry
|
||||
{
|
||||
public:
|
||||
Item_group_entry(const Item_tag id, int upper_bound);
|
||||
|
||||
bool check(int value) const;
|
||||
const Item_tag get() const;
|
||||
private:
|
||||
const Item_tag m_id;
|
||||
int m_upper_bound;
|
||||
};
|
||||
|
||||
class Item_group_group
|
||||
{
|
||||
public:
|
||||
Item_group_group(Item_group* group, int upper_bound);
|
||||
|
||||
bool check(int value) const;
|
||||
const Item_tag get(std::vector<Item_tag> recursion_list);
|
||||
private:
|
||||
Item_group* m_group;
|
||||
int m_upper_bound;
|
||||
};
|
||||
#endif
|
||||
@@ -1,9 +1,6 @@
|
||||
#ifndef _ITYPE_H_
|
||||
#define _ITYPE_H_
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include "color.h"
|
||||
#include "enums.h"
|
||||
#include "iuse.h"
|
||||
@@ -12,6 +9,13 @@
|
||||
#include "skill.h"
|
||||
#include "bionics.h"
|
||||
#include "artifact.h"
|
||||
#include "picojson.h"
|
||||
#include "rng.h"
|
||||
#include "material.h"
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <sstream>
|
||||
#include <set>
|
||||
|
||||
// mfb(n) converts a flag to its appropriate position in covers's bitfield
|
||||
#ifndef mfb
|
||||
@@ -56,6 +60,7 @@ AT_MUSCLE,
|
||||
AT_12MM,
|
||||
AT_PLASMA,
|
||||
AT_WATER,
|
||||
AT_PEBBLE,
|
||||
NUM_AMMO_TYPES
|
||||
};
|
||||
|
||||
@@ -69,65 +74,24 @@ SW_DATA,
|
||||
NUM_SOFTWARE_TYPES
|
||||
};
|
||||
|
||||
enum item_flag {
|
||||
IF_NULL,
|
||||
|
||||
IF_LIGHT_4, // Provides 4 tiles of light
|
||||
IF_LIGHT_8, // Provides 8 tiles of light
|
||||
|
||||
IF_FIRE, // Chance to set fire to tiles/enemies
|
||||
IF_SPEAR, // Cutting damage is actually a piercing attack
|
||||
IF_STAB, // This weapon *can* pierce, but also has normal cutting
|
||||
IF_WRAP, // Can wrap around your target, costing you and them movement
|
||||
IF_MESSY, // Splatters blood, etc.
|
||||
IF_RELOAD_ONE, // Reload cartridge by cartridge (e.g. most shotguns)
|
||||
IF_STR_RELOAD, // Reloading time is reduced by Strength * 20
|
||||
IF_STR8_DRAW, // Requires strength 8 to draw
|
||||
IF_STR10_DRAW, // Requires strength 10 to draw
|
||||
IF_USE_UPS, // Draws power from a UPS
|
||||
IF_RELOAD_AND_SHOOT, // Reloading and shooting is one action
|
||||
IF_FIRE_100, // Fires 100 rounds at once! (e.g. flamethrower)
|
||||
IF_GRENADE, // NPCs treat this as a grenade
|
||||
IF_CHARGE, // For guns; charges up slowly
|
||||
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
|
||||
};
|
||||
|
||||
enum ammo_effect {
|
||||
AMMO_FLAME, // Sets fire to terrain and monsters
|
||||
AMMO_INCENDIARY, // Sparks explosive terrain
|
||||
AMMO_EXPLOSIVE, // Small explosion
|
||||
AMMO_FRAG, // Frag explosion
|
||||
AMMO_NAPALM, // Firey explosion
|
||||
AMMO_ACIDBOMB, // Acid bomb ammo
|
||||
AMMO_EXPLOSIVE_BIG, // Big explosion!
|
||||
AMMO_TEARGAS, // Teargas burst
|
||||
AMMO_SMOKE, // Smoke burst
|
||||
AMMO_TRAIL, // Leaves a trail of smoke
|
||||
AMMO_FLASHBANG, // Disorients and blinds
|
||||
AMMO_STREAM, // Doesn't stop once it hits a monster
|
||||
AMMO_COOKOFF, // Explodes when burned instead of just burning
|
||||
AMMO_LASER, // laser effects
|
||||
NUM_AMMO_EFFECTS
|
||||
};
|
||||
|
||||
|
||||
enum technique_id {
|
||||
TEC_NULL,
|
||||
// Offensive Techniques
|
||||
@@ -201,6 +165,8 @@ struct itype
|
||||
material m1; // Main material
|
||||
material m2; // Secondary material -- MNULL if made of just 1 thing
|
||||
|
||||
phase_id phase; //e.g. solid, liquid, gas
|
||||
|
||||
unsigned int volume; // Space taken up by this item
|
||||
unsigned int weight; // Weight in quarter-pounds; is 64 lbs max ok?
|
||||
// Also assumes positive weight. No helium, guys!
|
||||
@@ -210,7 +176,7 @@ struct itype
|
||||
signed char melee_cut; // Cutting damage in melee
|
||||
signed char m_to_hit; // To-hit bonus for melee combat; -5 to 5 is reasonable
|
||||
|
||||
unsigned item_flags : NUM_ITEM_FLAGS;
|
||||
std::set<std::string> item_tags;
|
||||
unsigned techniques : NUM_TECHNIQUES;
|
||||
|
||||
virtual bool is_food() { return false; }
|
||||
@@ -226,12 +192,15 @@ struct itype
|
||||
virtual bool is_software() { return false; }
|
||||
virtual bool is_macguffin() { return false; }
|
||||
virtual bool is_style() { return false; }
|
||||
virtual bool is_stationary() { return false; }
|
||||
virtual bool is_artifact() { return false; }
|
||||
virtual bool is_var_veh_part() { return false; }
|
||||
virtual bool is_engine() { return false; }
|
||||
virtual bool is_wheel() { return false; }
|
||||
virtual bool count_by_charges() { return false; }
|
||||
virtual std::string save_data() { return std::string(); }
|
||||
virtual picojson::value save_data() { return picojson::value(); }
|
||||
|
||||
void (iuse::*use)(game *, player *, item *, bool);// Special effects of use
|
||||
|
||||
itype() {
|
||||
id = "null";
|
||||
@@ -241,20 +210,21 @@ struct itype
|
||||
color = c_white;
|
||||
m1 = MNULL;
|
||||
m2 = MNULL;
|
||||
phase = SOLID;
|
||||
volume = 0;
|
||||
weight = 0;
|
||||
melee_dam = 0;
|
||||
m_to_hit = 0;
|
||||
item_flags = 0;
|
||||
techniques = 0;
|
||||
use = &iuse::none;
|
||||
}
|
||||
|
||||
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,
|
||||
char psym, nc_color pcolor, material pm1, material pm2, phase_id pphase,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
|
||||
unsigned pitem_flags, unsigned ptechniques = 0) {
|
||||
unsigned ptechniques = 0) {
|
||||
id = pid;
|
||||
rarity = prarity;
|
||||
price = pprice;
|
||||
@@ -264,13 +234,14 @@ struct itype
|
||||
color = pcolor;
|
||||
m1 = pm1;
|
||||
m2 = pm2;
|
||||
phase = pphase;
|
||||
volume = pvolume;
|
||||
weight = pweight;
|
||||
melee_dam = pmelee_dam;
|
||||
melee_cut = pmelee_cut;
|
||||
m_to_hit = pm_to_hit;
|
||||
item_flags = pitem_flags;
|
||||
techniques = ptechniques;
|
||||
use = &iuse::none;
|
||||
}
|
||||
};
|
||||
|
||||
@@ -296,45 +267,46 @@ struct it_comest : public itype
|
||||
|
||||
virtual bool count_by_charges()
|
||||
{
|
||||
if (m1 == LIQUID) {
|
||||
if (phase == LIQUID) {
|
||||
return true;
|
||||
} else {
|
||||
return charges > 1 ;
|
||||
}
|
||||
}
|
||||
|
||||
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,
|
||||
char psym, nc_color pcolor, material pm1, phase_id pphase,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
signed char pmelee_dam, signed char pmelee_cut,
|
||||
signed char pm_to_hit, unsigned pitem_flags,
|
||||
signed char pm_to_hit,
|
||||
|
||||
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;
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, MNULL, pphase,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit)
|
||||
{
|
||||
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;
|
||||
}
|
||||
|
||||
it_comest() :itype() { };
|
||||
};
|
||||
|
||||
// v6, v8, wankel, etc.
|
||||
@@ -354,8 +326,8 @@ struct it_var_veh_part: public itype
|
||||
unsigned int big_min,
|
||||
unsigned int big_max,
|
||||
bigness_property_aspect big_aspect)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, 0) {
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
|
||||
min_bigness = big_min;
|
||||
max_bigness = big_max;
|
||||
bigness_aspect = big_aspect;
|
||||
@@ -386,9 +358,21 @@ struct it_ammo : public itype
|
||||
// virtual bool count_by_charges() { return id != "gasoline"; }
|
||||
virtual bool count_by_charges() { return true; }
|
||||
|
||||
it_ammo() : itype()
|
||||
{
|
||||
type = AT_NULL;
|
||||
damage = 0;
|
||||
pierce = 0;
|
||||
range = 0;
|
||||
accuracy = 0;
|
||||
recoil = 0;
|
||||
count = 0;
|
||||
ammo_effects = 0;
|
||||
}
|
||||
|
||||
it_ammo(std::string pid, unsigned char prarity, unsigned int pprice,
|
||||
std::string pname, std::string pdes,
|
||||
char psym, nc_color pcolor, material pm1,
|
||||
char psym, nc_color pcolor, material pm1, phase_id pphase,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
|
||||
unsigned effects,
|
||||
@@ -396,7 +380,7 @@ struct it_ammo : public itype
|
||||
ammotype ptype, unsigned char pdamage, unsigned char ppierce,
|
||||
signed char paccuracy, unsigned char precoil, unsigned char prange,
|
||||
unsigned char pcount)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, MNULL,
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, MNULL, pphase,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, 0) {
|
||||
type = ptype;
|
||||
damage = pdamage;
|
||||
@@ -414,6 +398,7 @@ struct it_gun : public itype
|
||||
ammotype ammo;
|
||||
Skill *skill_used;
|
||||
signed char dmg_bonus;
|
||||
signed char range;
|
||||
signed char accuracy;
|
||||
signed char recoil;
|
||||
signed char durability;
|
||||
@@ -428,16 +413,16 @@ struct it_gun : public itype
|
||||
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,
|
||||
|
||||
const char *pskill_used, ammotype pammo, signed char pdmg_bonus,
|
||||
const char *pskill_used, ammotype pammo, signed char pdmg_bonus, signed char prange,
|
||||
signed char paccuracy, signed char precoil, unsigned char pdurability,
|
||||
unsigned char pburst, int pclip, int preload_time)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
|
||||
skill_used = pskill_used?Skill::skill(pskill_used):NULL;
|
||||
ammo = pammo;
|
||||
dmg_bonus = pdmg_bonus;
|
||||
range = prange;
|
||||
accuracy = paccuracy;
|
||||
recoil = precoil;
|
||||
durability = pdurability;
|
||||
@@ -445,6 +430,8 @@ struct it_gun : public itype
|
||||
clip = pclip;
|
||||
reload_time = preload_time;
|
||||
}
|
||||
|
||||
it_gun() :itype() { };
|
||||
};
|
||||
|
||||
struct it_gunmod : public itype
|
||||
@@ -464,15 +451,15 @@ struct it_gunmod : public itype
|
||||
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,
|
||||
signed char pm_to_hit,
|
||||
|
||||
signed char paccuracy, signed char pdamage, signed char ploudness,
|
||||
signed char pclip, signed char precoil, signed char pburst,
|
||||
ammotype pnewtype, long a_a_t, bool pistol,
|
||||
bool shotgun, bool smg, bool rifle)
|
||||
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
|
||||
accuracy = paccuracy;
|
||||
damage = pdamage;
|
||||
loudness = ploudness;
|
||||
@@ -486,14 +473,16 @@ struct it_gunmod : public itype
|
||||
used_on_smg = smg;
|
||||
used_on_rifle = rifle;
|
||||
}
|
||||
|
||||
it_gunmod() :itype() { };
|
||||
};
|
||||
|
||||
struct it_armor : public itype
|
||||
{
|
||||
unsigned char covers; // Bitfield of enum body_part
|
||||
signed char encumber;
|
||||
unsigned char dmg_resist;
|
||||
unsigned char cut_resist;
|
||||
unsigned char coverage;
|
||||
unsigned char thickness;
|
||||
unsigned char env_resist; // Resistance to environmental effects
|
||||
signed char warmth;
|
||||
unsigned char storage;
|
||||
@@ -503,17 +492,26 @@ struct it_armor : public itype
|
||||
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(); }
|
||||
virtual picojson::value save_data() { return picojson::value(); }
|
||||
std::string bash_dmg_verb() { return m2 == MNULL || !one_in(3) ?
|
||||
material_type::find_material_from_tag(m1)->bash_dmg_verb() :
|
||||
material_type::find_material_from_tag(m2)->bash_dmg_verb();
|
||||
}
|
||||
std::string cut_dmg_verb() { return m2 == MNULL || !one_in(3) ?
|
||||
material_type::find_material_from_tag(m1)->cut_dmg_verb() :
|
||||
material_type::find_material_from_tag(m2)->cut_dmg_verb();
|
||||
}
|
||||
|
||||
it_armor()
|
||||
it_armor() : itype()
|
||||
{
|
||||
covers = 0;
|
||||
encumber = 0;
|
||||
dmg_resist = 0;
|
||||
cut_resist = 0;
|
||||
coverage = 0;
|
||||
thickness = 0;
|
||||
env_resist = 0;
|
||||
warmth = 0;
|
||||
storage = 0;
|
||||
power_armor = false;
|
||||
}
|
||||
|
||||
it_armor(itype_id pid, unsigned char prarity, unsigned int pprice,
|
||||
@@ -521,18 +519,17 @@ struct it_armor : public itype
|
||||
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,
|
||||
|
||||
unsigned char pcovers, signed char pencumber,
|
||||
unsigned char pdmg_resist, unsigned char pcut_resist,
|
||||
unsigned char pcoverage, unsigned char pthickness,
|
||||
unsigned char penv_resist, signed char pwarmth,
|
||||
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) {
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
|
||||
covers = pcovers;
|
||||
encumber = pencumber;
|
||||
dmg_resist = pdmg_resist;
|
||||
cut_resist = pcut_resist;
|
||||
coverage = pcoverage;
|
||||
thickness = pthickness;
|
||||
env_resist = penv_resist;
|
||||
warmth = pwarmth;
|
||||
storage = pstorage;
|
||||
@@ -540,6 +537,8 @@ struct it_armor : public itype
|
||||
}
|
||||
};
|
||||
|
||||
struct recipe;
|
||||
|
||||
struct it_book : public itype
|
||||
{
|
||||
Skill *type; // Which skill it upgrades
|
||||
@@ -549,18 +548,19 @@ struct it_book : public itype
|
||||
unsigned char intel; // Intelligence required to read, at all
|
||||
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
|
||||
std::map<recipe*, int> recipes; //what recipes can be learned from this book
|
||||
virtual bool is_book() { return true; }
|
||||
it_book() {}
|
||||
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,
|
||||
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
|
||||
unsigned pitem_flags,
|
||||
|
||||
const char *ptype, unsigned char plevel, unsigned char preq,
|
||||
signed char pfun, unsigned char pintel, unsigned char ptime)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
|
||||
type = ptype?Skill::skill(ptype):NULL;
|
||||
level = plevel;
|
||||
req = preq;
|
||||
@@ -587,11 +587,11 @@ struct it_container : public itype
|
||||
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,
|
||||
signed char pm_to_hit,
|
||||
|
||||
unsigned char pcontains, unsigned pflags)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
|
||||
contains = pcontains;
|
||||
flags = pflags;
|
||||
}
|
||||
@@ -605,13 +605,12 @@ struct it_tool : public itype
|
||||
unsigned char charges_per_use;
|
||||
unsigned char turns_per_charge;
|
||||
itype_id revert_to;
|
||||
void (iuse::*use)(game *, player *, item *, bool);
|
||||
|
||||
virtual bool is_tool() { return true; }
|
||||
virtual bool is_artifact() { return false; }
|
||||
virtual std::string save_data() { return std::string(); }
|
||||
virtual picojson::value save_data() { return picojson::value(); }
|
||||
|
||||
it_tool()
|
||||
it_tool() :itype()
|
||||
{
|
||||
ammo = AT_NULL;
|
||||
max_charges = 0;
|
||||
@@ -624,17 +623,16 @@ struct it_tool : public itype
|
||||
|
||||
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,
|
||||
char psym, nc_color pcolor, material pm1, material pm2, phase_id pphase,
|
||||
unsigned short pvolume, unsigned short pweight,
|
||||
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
|
||||
unsigned pitem_flags,
|
||||
|
||||
unsigned int pmax_charges, unsigned int pdef_charges,
|
||||
unsigned char pcharges_per_use, unsigned char pturns_per_charge,
|
||||
ammotype pammo, itype_id prevert_to,
|
||||
void (iuse::*puse)(game *, player *, item *, bool))
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, pphase,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
|
||||
max_charges = pmax_charges;
|
||||
def_charges = pdef_charges;
|
||||
ammo = pammo;
|
||||
@@ -657,11 +655,11 @@ struct it_bionic : public itype
|
||||
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,
|
||||
signed char pm_to_hit,
|
||||
|
||||
int pdifficulty)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
|
||||
difficulty = pdifficulty;
|
||||
options.push_back(id);
|
||||
}
|
||||
@@ -670,7 +668,6 @@ struct it_bionic : public itype
|
||||
struct it_macguffin : public itype
|
||||
{
|
||||
bool readable; // If true, activated with 'R'
|
||||
void (iuse::*use)(game *, player *, item *, bool);
|
||||
|
||||
virtual bool is_macguffin() { return true; }
|
||||
|
||||
@@ -679,12 +676,12 @@ struct it_macguffin : public itype
|
||||
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,
|
||||
signed char pm_to_hit,
|
||||
|
||||
bool preadable,
|
||||
void (iuse::*puse)(game *, player *, item *, bool))
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
|
||||
readable = preadable;
|
||||
use = puse;
|
||||
}
|
||||
@@ -702,11 +699,11 @@ struct it_software : public itype
|
||||
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,
|
||||
signed char pm_to_hit,
|
||||
|
||||
software_type pswtype, int ppower)
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
|
||||
swtype = pswtype;
|
||||
power = ppower;
|
||||
}
|
||||
@@ -723,10 +720,31 @@ struct it_style : public itype
|
||||
char psym, nc_color pcolor, material pm1, material pm2,
|
||||
unsigned char pvolume, unsigned char pweight,
|
||||
signed char pmelee_dam, signed char pmelee_cut,
|
||||
signed char pm_to_hit, unsigned pitem_flags)
|
||||
signed char pm_to_hit)
|
||||
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) { }
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) { }
|
||||
};
|
||||
|
||||
struct it_stationary : public itype
|
||||
{
|
||||
virtual bool is_stationary() { return true; }
|
||||
|
||||
std::string category;
|
||||
|
||||
it_stationary(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,
|
||||
signed char pmelee_dam, signed char pmelee_cut,
|
||||
signed char pm_to_hit,
|
||||
std::string pcategory)
|
||||
|
||||
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit)
|
||||
{
|
||||
category = pcategory;
|
||||
}
|
||||
};
|
||||
|
||||
struct it_artifact_tool : public it_tool
|
||||
@@ -737,39 +755,81 @@ struct it_artifact_tool : public it_tool
|
||||
std::vector<art_effect_passive> effects_carried;
|
||||
|
||||
virtual bool is_artifact() { return true; }
|
||||
virtual std::string save_data()
|
||||
virtual picojson::value save_data()
|
||||
{
|
||||
std::stringstream data;
|
||||
data << "T " << price << " " << sym << " " << color_to_int(color) << " " <<
|
||||
int(m1) << " " << int(m2) << " " << int(volume) << " " <<
|
||||
int(weight) << " " << int(melee_dam) << " " << int(melee_cut) <<
|
||||
" " << int(m_to_hit) << " " << int(item_flags) << " " <<
|
||||
int(charge_type) << " " << max_charges << " " <<
|
||||
effects_wielded.size();
|
||||
for (int i = 0; i < effects_wielded.size(); i++)
|
||||
data << " " << int(effects_wielded[i]);
|
||||
std::map<std::string, picojson::value> data;
|
||||
|
||||
data << " " << effects_activated.size();
|
||||
for (int i = 0; i < effects_activated.size(); i++)
|
||||
data << " " << int(effects_activated[i]);
|
||||
data[std::string("type")] = picojson::value("artifact_tool");
|
||||
|
||||
data << " " << effects_carried.size();
|
||||
for (int i = 0; i < effects_carried.size(); i++)
|
||||
data << " " << int(effects_carried[i]);
|
||||
// generic data
|
||||
data[std::string("id")] = picojson::value(id);
|
||||
data[std::string("price")] = picojson::value(price);
|
||||
data[std::string("name")] = picojson::value(name);
|
||||
data[std::string("description")] = picojson::value(description);
|
||||
data[std::string("sym")] = picojson::value(sym);
|
||||
data[std::string("color")] = picojson::value(color_to_int(color));
|
||||
data[std::string("m1")] = picojson::value(m1);
|
||||
data[std::string("m2")] = picojson::value(m2);
|
||||
data[std::string("volume")] = picojson::value(volume);
|
||||
data[std::string("weight")] = picojson::value(weight);
|
||||
data[std::string("id")] = picojson::value(id);
|
||||
data[std::string("melee_dam")] = picojson::value(melee_dam);
|
||||
data[std::string("melee_cut")] = picojson::value(melee_cut);
|
||||
data[std::string("m_to_hit")] = picojson::value(m_to_hit);
|
||||
|
||||
data << " " << name << " - ";
|
||||
std::string desctmp = description;
|
||||
size_t endline;
|
||||
do {
|
||||
endline = desctmp.find("\n");
|
||||
if (endline != std::string::npos)
|
||||
desctmp.replace(endline, 1, " = ");
|
||||
} while (endline != std::string::npos);
|
||||
data << desctmp << " -";
|
||||
return data.str();
|
||||
std::vector<picojson::value> tags_json;
|
||||
for(std::set<std::string>::iterator it = item_tags.begin();
|
||||
it != item_tags.end(); ++it)
|
||||
{
|
||||
tags_json.push_back(picojson::value(*it));
|
||||
}
|
||||
data[std::string("item_flags")] = picojson::value(tags_json);
|
||||
|
||||
data[std::string("techniques")] = picojson::value(techniques);
|
||||
|
||||
// tool data
|
||||
data[std::string("ammo")] = picojson::value(ammo);
|
||||
data[std::string("max_charges")] = picojson::value(max_charges);
|
||||
data[std::string("def_charges")] = picojson::value(def_charges);
|
||||
data[std::string("charges_per_use")] = picojson::value(charges_per_use);
|
||||
data[std::string("turns_per_charge")] = picojson::value(turns_per_charge);
|
||||
data[std::string("revert_to")] = picojson::value(revert_to);
|
||||
|
||||
// artifact data
|
||||
data[std::string("charge_type")] = picojson::value(charge_type);
|
||||
|
||||
std::vector<picojson::value> effects_wielded_json;
|
||||
for(std::vector<art_effect_passive>::iterator it = effects_wielded.begin();
|
||||
it != effects_wielded.end(); ++it)
|
||||
{
|
||||
effects_wielded_json.push_back(picojson::value(*it));
|
||||
}
|
||||
data[std::string("effects_wielded")] =
|
||||
picojson::value(effects_wielded_json);
|
||||
|
||||
std::vector<picojson::value> effects_activated_json;
|
||||
for(std::vector<art_effect_active>::iterator it =
|
||||
effects_activated.begin();
|
||||
it != effects_activated.end(); ++it)
|
||||
{
|
||||
effects_activated_json.push_back(picojson::value(*it));
|
||||
}
|
||||
data[std::string("effects_activated")] =
|
||||
picojson::value(effects_activated_json);
|
||||
|
||||
std::vector<picojson::value> effects_carried_json;
|
||||
for(std::vector<art_effect_passive>::iterator it = effects_carried.begin();
|
||||
it != effects_carried.end(); ++it)
|
||||
{
|
||||
effects_carried_json.push_back(picojson::value(*it));
|
||||
}
|
||||
data[std::string("effects_carried")] =
|
||||
picojson::value(effects_carried_json);
|
||||
|
||||
return picojson::value(data);
|
||||
}
|
||||
|
||||
it_artifact_tool() {
|
||||
it_artifact_tool() :it_tool(){
|
||||
ammo = AT_NULL;
|
||||
price = 0;
|
||||
def_charges = 0;
|
||||
@@ -783,11 +843,21 @@ struct it_artifact_tool : public it_tool
|
||||
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)
|
||||
signed char pm_to_hit, std::set<std::string> pitem_tags,
|
||||
|
||||
: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, "null", &iuse::artifact) { };
|
||||
unsigned int pmax_charges, unsigned int pdef_charges,
|
||||
unsigned char pcharges_per_use,
|
||||
unsigned char pturns_per_charge,
|
||||
ammotype pammo, itype_id prevert_to)
|
||||
|
||||
:it_tool(pid, 0, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit,
|
||||
pmax_charges, pdef_charges, pcharges_per_use, pturns_per_charge,
|
||||
pammo, prevert_to, &iuse::artifact)
|
||||
{
|
||||
item_tags = pitem_tags;
|
||||
artifact_itype_ids.push_back(pid);
|
||||
};
|
||||
};
|
||||
|
||||
struct it_artifact_armor : public it_armor
|
||||
@@ -796,34 +866,62 @@ struct it_artifact_armor : public it_armor
|
||||
|
||||
virtual bool is_artifact() { return true; }
|
||||
|
||||
virtual std::string save_data()
|
||||
virtual picojson::value save_data()
|
||||
{
|
||||
std::stringstream data;
|
||||
data << "A " << price << " " << sym << " " << color_to_int(color) << " " <<
|
||||
int(m1) << " " << int(m2) << " " << int(volume) << " " <<
|
||||
int(weight) << " " << int(melee_dam) << " " << int(melee_cut) <<
|
||||
" " << int(m_to_hit) << " " << int(item_flags) << " " <<
|
||||
int(covers) << " " << int(encumber) << " " << int(dmg_resist) <<
|
||||
" " << int(cut_resist) << " " << int(env_resist) << " " <<
|
||||
int(warmth) << " " << int(storage) << " " << effects_worn.size();
|
||||
for (int i = 0; i < effects_worn.size(); i++)
|
||||
data << " " << int(effects_worn[i]);
|
||||
std::map<std::string, picojson::value> data;
|
||||
|
||||
data << " " << name << " - ";
|
||||
std::string desctmp = description;
|
||||
size_t endline;
|
||||
do {
|
||||
endline = desctmp.find("\n");
|
||||
if (endline != std::string::npos)
|
||||
desctmp.replace(endline, 1, " = ");
|
||||
} while (endline != std::string::npos);
|
||||
data[std::string("type")] = picojson::value("artifact_armor");
|
||||
|
||||
data << desctmp << " -";
|
||||
// generic data
|
||||
data[std::string("id")] = picojson::value(id);
|
||||
data[std::string("price")] = picojson::value(price);
|
||||
data[std::string("name")] = picojson::value(name);
|
||||
data[std::string("description")] = picojson::value(description);
|
||||
data[std::string("sym")] = picojson::value(sym);
|
||||
data[std::string("color")] = picojson::value(color_to_int(color));
|
||||
data[std::string("m1")] = picojson::value(m1);
|
||||
data[std::string("m2")] = picojson::value(m2);
|
||||
data[std::string("volume")] = picojson::value(volume);
|
||||
data[std::string("weight")] = picojson::value(weight);
|
||||
data[std::string("id")] = picojson::value(id);
|
||||
data[std::string("melee_dam")] = picojson::value(melee_dam);
|
||||
data[std::string("melee_cut")] = picojson::value(melee_cut);
|
||||
data[std::string("m_to_hit")] = picojson::value(m_to_hit);
|
||||
|
||||
return data.str();
|
||||
std::vector<picojson::value> tags_json;
|
||||
for(std::set<std::string>::iterator it = item_tags.begin();
|
||||
it != item_tags.end(); ++it)
|
||||
{
|
||||
tags_json.push_back(picojson::value(*it));
|
||||
}
|
||||
data[std::string("item_flags")] = picojson::value(tags_json);
|
||||
|
||||
data[std::string("techniques")] = picojson::value(techniques);
|
||||
|
||||
// armor data
|
||||
data[std::string("covers")] = picojson::value(covers);
|
||||
data[std::string("encumber")] = picojson::value(encumber);
|
||||
data[std::string("coverage")] = picojson::value(coverage);
|
||||
data[std::string("material_thickness")] = picojson::value(thickness);
|
||||
data[std::string("env_resist")] = picojson::value(env_resist);
|
||||
data[std::string("warmth")] = picojson::value(warmth);
|
||||
data[std::string("storage")] = picojson::value(storage);
|
||||
data[std::string("power_armor")] = picojson::value(power_armor);
|
||||
|
||||
// artifact data
|
||||
std::vector<picojson::value> effects_worn_json;
|
||||
for(std::vector<art_effect_passive>::iterator it = effects_worn.begin();
|
||||
it != effects_worn.end(); ++it)
|
||||
{
|
||||
effects_worn_json.push_back(picojson::value(*it));
|
||||
}
|
||||
data[std::string("effects_worn")] =
|
||||
picojson::value(effects_worn_json);
|
||||
|
||||
return picojson::value(data);
|
||||
}
|
||||
|
||||
it_artifact_armor()
|
||||
it_artifact_armor() :it_armor()
|
||||
{
|
||||
price = 0;
|
||||
};
|
||||
@@ -832,16 +930,20 @@ struct it_artifact_armor : public it_armor
|
||||
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,
|
||||
signed char pm_to_hit, std::set<std::string> pitem_tags,
|
||||
|
||||
unsigned char pcovers, signed char pencumber,
|
||||
unsigned char pdmg_resist, unsigned char pcut_resist,
|
||||
unsigned char pcoverage, unsigned char pthickness,
|
||||
unsigned char penv_resist, signed char pwarmth,
|
||||
unsigned char pstorage)
|
||||
:it_armor(pid, 0, pprice, pname, pdes, psym, pcolor, pm1, pm2,
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags,
|
||||
pcovers, pencumber, pdmg_resist, pcut_resist, penv_resist, pwarmth,
|
||||
pstorage) { };
|
||||
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit,
|
||||
pcovers, pencumber, pcoverage, pthickness, penv_resist, pwarmth,
|
||||
pstorage)
|
||||
{
|
||||
item_tags = pitem_tags;
|
||||
artifact_itype_ids.push_back(pid);
|
||||
};
|
||||
};
|
||||
|
||||
#endif
|
||||
|
||||
+45
-4213
File diff suppressed because it is too large
Load Diff
@@ -5,10 +5,12 @@ class game;
|
||||
class item;
|
||||
class player;
|
||||
|
||||
|
||||
|
||||
class iuse
|
||||
{
|
||||
public:
|
||||
void none (game *g, player *p, item *it, bool t) { };
|
||||
void none (game *g, player *p, item *it, bool t);
|
||||
|
||||
// FOOD AND DRUGS (ADMINISTRATION)
|
||||
void sewage (game *g, player *p, item *it, bool t);
|
||||
@@ -50,16 +52,24 @@ class iuse
|
||||
|
||||
// TOOLS
|
||||
void lighter (game *g, player *p, item *it, bool t);
|
||||
void primitive_fire(game *g, player *p, item *it, bool t);
|
||||
void sew (game *g, player *p, item *it, bool t);
|
||||
void extra_battery(game *g, player *p, item *it, bool t);
|
||||
void scissors (game *g, player *p, item *it, bool t);
|
||||
void extinguisher (game *g, player *p, item *it, bool t);
|
||||
void hammer (game *g, player *p, item *it, bool t);
|
||||
void light_off (game *g, player *p, item *it, bool t);
|
||||
void light_on (game *g, player *p, item *it, bool t);
|
||||
void gasoline_lantern_off (game *g, player *p, item *it, bool t);
|
||||
void gasoline_lantern_on (game *g, player *p, item *it, bool t);
|
||||
void lightstrip (game *g, player *p, item *it, bool t);
|
||||
void lightstrip_active(game *g, player *p, item *it, bool t);
|
||||
void glowstick (game *g, player *p, item *it, bool t);
|
||||
void glowstick_active(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 directional_antenna (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);
|
||||
@@ -71,6 +81,7 @@ class iuse
|
||||
void crowbar (game *g, player *p, item *it, bool t);
|
||||
void makemound (game *g, player *p, item *it, bool t);
|
||||
void dig (game *g, player *p, item *it, bool t);
|
||||
void siphon (game *g, player *p, item *it, bool t);
|
||||
void chainsaw_off (game *g, player *p, item *it, bool t);
|
||||
void chainsaw_on (game *g, player *p, item *it, bool t);
|
||||
void jackhammer (game *g, player *p, item *it, bool t);
|
||||
@@ -130,8 +141,6 @@ class iuse
|
||||
void candle (game *g, player *p, item *it, bool t);
|
||||
void candle_lit (game *g, player *p, item *it, bool t);
|
||||
void bullet_puller (game *g, player *p, item *it, bool t);
|
||||
void screwdriver (game *g, player *p, item *it, bool t);
|
||||
void wrench (game *g, player *p, item *it, bool t);
|
||||
void boltcutters (game *g, player *p, item *it, bool t);
|
||||
void mop (game *g, player *p, item *it, bool t);
|
||||
void spray_can (game *g, player *p, item *it, bool t);
|
||||
@@ -140,7 +149,8 @@ class iuse
|
||||
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);
|
||||
|
||||
void dejar (game *g, player *p, item *it, bool t);
|
||||
void devac (game *g, player *p, item *it, bool t);
|
||||
|
||||
// MACGUFFINS
|
||||
void mcg_note (game *g, player *p, item *it, bool t);
|
||||
@@ -149,12 +159,6 @@ class iuse
|
||||
// It examines the item's artifact-specific properties
|
||||
// See artifact.h for a list
|
||||
void artifact (game *g, player *p, item *it, bool t);
|
||||
void heal (game *g, player *p, item *it, bool t);
|
||||
void twist_space (game *g, player *p, item *it, bool t);
|
||||
void mass_vampire (game *g, player *p, item *it, bool t);
|
||||
void growth (game *g, player *p, item *it, bool t);
|
||||
void water (game *g, player *p, item *it, bool t);
|
||||
void lava (game *g, player *p, item *it, bool t);
|
||||
|
||||
};
|
||||
|
||||
|
||||
+13
-2
@@ -30,6 +30,8 @@ long input(long ch)
|
||||
case KEY_LEFT: return 'h';
|
||||
case KEY_RIGHT: return 'l';
|
||||
case KEY_DOWN: return 'j';
|
||||
case KEY_NPAGE: return '>';
|
||||
case KEY_PPAGE: return '<';
|
||||
case 459: return '\n';
|
||||
default: return ch;
|
||||
}
|
||||
@@ -55,6 +57,12 @@ bool input_wait(char & ret_ch, int delay_ms)
|
||||
case KEY_DOWN:
|
||||
ret_ch = 'j';
|
||||
break;
|
||||
case KEY_NPAGE:
|
||||
ret_ch = '>';
|
||||
break;
|
||||
case KEY_PPAGE:
|
||||
ret_ch = '<';
|
||||
break;
|
||||
case 459:
|
||||
ret_ch = '\n';
|
||||
break;
|
||||
@@ -182,6 +190,7 @@ open o\n\
|
||||
close c\n\
|
||||
smash s\n\
|
||||
examine e\n\
|
||||
advinv /\n\
|
||||
pickup , g\n\
|
||||
butcher B\n\
|
||||
chat C\n\
|
||||
@@ -210,10 +219,12 @@ select_fire_mode F\n\
|
||||
drop d\n\
|
||||
drop_adj D\n\
|
||||
bionics p\n\
|
||||
sort_armor +\n\
|
||||
\n\
|
||||
# LONG TERM & SPECIAL ACTIONS\n\
|
||||
wait ^\n\
|
||||
wait |\n\
|
||||
craft &\n\
|
||||
recraft -\n\
|
||||
construct *\n\
|
||||
disassemble (\n\
|
||||
sleep $\n\
|
||||
@@ -229,7 +240,7 @@ map m :\n\
|
||||
missions M\n\
|
||||
factions #\n\
|
||||
kills )\n\
|
||||
morale %\n\
|
||||
morale v\n\
|
||||
messages P\n\
|
||||
help ?\n\
|
||||
\n\
|
||||
|
||||
+34
-29
@@ -16,24 +16,35 @@ void map::generate_lightmap(game* g)
|
||||
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 held_luminance = g->u.active_light();
|
||||
const float natural_light = g->natural_light_level();
|
||||
|
||||
// Daylight vision handling returned back to map due to issues it causes here
|
||||
if (natural_light > LIGHT_SOURCE_BRIGHT) {
|
||||
// Apply sunlight, first light source so just assign
|
||||
for(int sx = 0; sx < LIGHTMAP_CACHE_X; ++sx) {
|
||||
for(int sy = 0; sy < LIGHTMAP_CACHE_Y; ++sy) {
|
||||
// In bright light indoor light exists to some degree
|
||||
if (!g->m.is_outside(sx, sy))
|
||||
lm[sx][sy] = LIGHT_AMBIENT_LOW;
|
||||
}
|
||||
}
|
||||
if (natural_light > LIGHT_SOURCE_BRIGHT)
|
||||
{
|
||||
// Apply sunlight, first light source so just assign
|
||||
for(int sx = 0; sx < LIGHTMAP_CACHE_X; ++sx)
|
||||
{
|
||||
for(int sy = 0; sy < LIGHTMAP_CACHE_Y; ++sy)
|
||||
{
|
||||
// In bright light indoor light exists to some degree
|
||||
if (!g->m.is_outside(sx, sy))
|
||||
{
|
||||
lm[sx][sy] = LIGHT_AMBIENT_LOW;
|
||||
}
|
||||
else if (g->u.posx == sx && g->u.posy == sy )
|
||||
{
|
||||
//Only apply daylight on square where player is standing to avoid flooding
|
||||
// the lightmap when in less than total sunlight.
|
||||
lm[sx][sy] = natural_light;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// Apply player light sources
|
||||
if (luminance > LIGHT_AMBIENT_LOW)
|
||||
apply_light_source(g->u.posx, g->u.posy, luminance);
|
||||
if (held_luminance > LIGHT_AMBIENT_LOW)
|
||||
apply_light_source(g->u.posx, g->u.posy, held_luminance);
|
||||
|
||||
for(int sx = 0; sx < LIGHTMAP_CACHE_X; ++sx) {
|
||||
for(int sy = 0; sy < LIGHTMAP_CACHE_Y; ++sy) {
|
||||
@@ -57,15 +68,13 @@ void map::generate_lightmap(game* g)
|
||||
}
|
||||
}
|
||||
|
||||
// TODO: make this bit use item flags
|
||||
// may need to make item::has_flag const first
|
||||
if (items.size() == 1 &&
|
||||
items[0].type->id == "flashlight_on")
|
||||
apply_light_source(sx, sy, 20);
|
||||
|
||||
if (items.size() == 1 &&
|
||||
items[0].type->id == "lightstrip")
|
||||
apply_light_source(sx, sy, 1);
|
||||
for( std::vector<item>::const_iterator itm = items.begin(); itm != items.end(); ++itm )
|
||||
{
|
||||
if ( itm->has_flag("LIGHT_20")) { apply_light_source(sx, sy, 20); }
|
||||
if ( itm->has_flag("LIGHT_1")) { apply_light_source(sx, sy, 1); }
|
||||
if ( itm->has_flag("LIGHT_4")) { apply_light_source(sx, sy, 4); }
|
||||
if ( itm->has_flag("LIGHT_8")) { apply_light_source(sx, sy, 8); }
|
||||
}
|
||||
|
||||
if(terrain == t_lava)
|
||||
apply_light_source(sx, sy, 50);
|
||||
@@ -73,10 +82,6 @@ void map::generate_lightmap(game* g)
|
||||
if(terrain == t_console)
|
||||
apply_light_source(sx, sy, 3);
|
||||
|
||||
if (items.size() == 1 &&
|
||||
items[0].type->id == "candle_lit")
|
||||
apply_light_source(sx, sy, 4);
|
||||
|
||||
if(terrain == t_emergency_light)
|
||||
apply_light_source(sx, sy, 3);
|
||||
|
||||
@@ -145,9 +150,9 @@ void map::generate_lightmap(game* g)
|
||||
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);
|
||||
float veh_luminance = vehs[v].v->part_info(dpart).power;
|
||||
if (veh_luminance > LL_LIT) {
|
||||
apply_light_arc(px, py, dir, veh_luminance);
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -201,7 +206,7 @@ void map::cache_seen(int fx, int fy, int tx, int ty, int max_range)
|
||||
const int dy = (fy < ty) ? 1 : -1;
|
||||
int x = fx;
|
||||
int y = fy;
|
||||
int seen = true;
|
||||
bool seen = true;
|
||||
|
||||
// TODO: [lightmap] Pull out the common code here rather than duplication
|
||||
if (ax > ay)
|
||||
|
||||
+1
-1
@@ -1,7 +1,7 @@
|
||||
#ifndef _LIGHTMAP_H_
|
||||
#define _LIGHTMAP_H_
|
||||
|
||||
#define LIGHT_SOURCE_LOCAL 0.1
|
||||
#define LIGHT_SOURCE_LOCAL 0.1f
|
||||
#define LIGHT_SOURCE_BRIGHT 10
|
||||
|
||||
#define LIGHT_AMBIENT_LOW 1
|
||||
|
||||
@@ -155,7 +155,7 @@ std::string direction_name(direction dir)
|
||||
case WEST: return "west";
|
||||
case NORTHWEST: return "northwest";
|
||||
}
|
||||
return "WEIRD DIRECTION_NAME() BUG";
|
||||
return "BUG. (line.cpp:direction_name)";
|
||||
}
|
||||
|
||||
std::string direction_name_short(direction dir)
|
||||
@@ -170,7 +170,7 @@ std::string direction_name_short(direction dir)
|
||||
case WEST: return "W ";
|
||||
case NORTHWEST: return "NW";
|
||||
}
|
||||
return "WEIRD DIRECTION_NAME() BUG";
|
||||
return "Bug. (line.cpp:direction_name_short)";
|
||||
}
|
||||
|
||||
|
||||
|
||||
@@ -45,7 +45,7 @@ int main(int argc, char *argv[])
|
||||
cbreak(); // C-style breaks (e.g. ^C to SIGINT)
|
||||
keypad(stdscr, true); // Numpad is numbers
|
||||
init_colors(); // See color.cpp
|
||||
curs_set(0); // Invisible cursor
|
||||
// curs_set(0); // Invisible cursor
|
||||
set_escdelay(10); // Make escape actually responsive
|
||||
|
||||
std::srand(seed);
|
||||
@@ -55,8 +55,11 @@ int main(int argc, char *argv[])
|
||||
game *g = new game;
|
||||
g->init_ui();
|
||||
MAPBUFFER.set_game(g);
|
||||
g->load_artifacts(); //artifacts have to be loaded before any items are created
|
||||
MAPBUFFER.load();
|
||||
|
||||
curs_set(0); // Invisible cursor here, because MAPBUFFER.load() is crash-prone
|
||||
|
||||
#if (!(defined _WIN32 || defined WINDOWS))
|
||||
struct sigaction sigIntHandler;
|
||||
sigIntHandler.sa_handler = exit_handler;
|
||||
@@ -90,7 +93,7 @@ void exit_handler(int s) {
|
||||
bool bExit = false;
|
||||
|
||||
if (s == 2) {
|
||||
if (query_yn("Really Quit? All unsafed changes will be lost.")) {
|
||||
if (query_yn("Really Quit? All unsaved changes will be lost.")) {
|
||||
bExit = true;
|
||||
}
|
||||
} else if (s == -999) {
|
||||
|
||||
+14
-5
@@ -4,12 +4,20 @@
|
||||
#include "debug.h"
|
||||
#include "mapbuffer.h"
|
||||
#include "cursesdef.h"
|
||||
#include "overmapbuffer.h"
|
||||
|
||||
#include <sys/stat.h>
|
||||
#ifdef _MSC_VER
|
||||
#include "wdirent.h"
|
||||
#include <direct.h>
|
||||
#else
|
||||
#include <dirent.h>
|
||||
#endif
|
||||
|
||||
#define dbg(x) dout((DebugLevel)(x),D_GAME) << __FILE__ << ":" << __LINE__ << ": "
|
||||
|
||||
const char* getVersionString();
|
||||
|
||||
void game::print_menu(WINDOW* w_open, int iSel, const int iMenuOffsetX, int iMenuOffsetY, bool bShowDDA)
|
||||
{
|
||||
//Clear Lines
|
||||
@@ -52,6 +60,7 @@ void game::print_menu(WINDOW* w_open, int iSel, const int iMenuOffsetX, int iMen
|
||||
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, "/ | \\| Y \\\\ ___/ / __ \\_/ /_/ | ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, "\\____|__ /|___| / \\___ >(____ /\\____ | ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, " \\/ \\/ \\/ \\/ \\/ ");
|
||||
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, "Version: %s",getVersionString());
|
||||
}
|
||||
|
||||
std::vector<std::string> vMenuItems;
|
||||
@@ -107,7 +116,6 @@ bool game::opening_screen()
|
||||
print_menu(w_open, 0, iMenuOffsetX, iMenuOffsetY);
|
||||
|
||||
std::vector<std::string> savegames, templates;
|
||||
std::string tmp;
|
||||
dirent *dp;
|
||||
DIR *dir = opendir("save");
|
||||
if (!dir) {
|
||||
@@ -125,14 +133,14 @@ bool game::opening_screen()
|
||||
exit(1);
|
||||
}
|
||||
while ((dp = readdir(dir))) {
|
||||
tmp = dp->d_name;
|
||||
std::string 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;
|
||||
std::string tmp = dp->d_name;
|
||||
if (tmp.find(".template") != std::string::npos)
|
||||
templates.push_back(tmp.substr(0, tmp.find(".template")));
|
||||
}
|
||||
@@ -152,7 +160,7 @@ bool game::opening_screen()
|
||||
while (!motd_file.eof()) {
|
||||
std::string tmp;
|
||||
getline(motd_file, tmp);
|
||||
if (tmp[0] != '#')
|
||||
if (!tmp.length() || tmp[0] != '#')
|
||||
motd.push_back(tmp);
|
||||
}
|
||||
}
|
||||
@@ -167,7 +175,7 @@ bool game::opening_screen()
|
||||
while (!credits_file.eof()) {
|
||||
std::string tmp;
|
||||
getline(credits_file, tmp);
|
||||
if (tmp[0] != '#')
|
||||
if (!tmp.length() || tmp[0] != '#')
|
||||
credits.push_back(tmp);
|
||||
}
|
||||
}
|
||||
@@ -336,6 +344,7 @@ bool game::opening_screen()
|
||||
savegames.clear();
|
||||
MAPBUFFER.reset();
|
||||
MAPBUFFER.make_volatile();
|
||||
overmap_buffer.clear();
|
||||
}
|
||||
|
||||
layer = 1;
|
||||
|
||||
@@ -19,6 +19,7 @@
|
||||
#include "graffiti.h"
|
||||
#include "lightmap.h"
|
||||
|
||||
//TODO: include comments about how these variables work. Where are they used. Are they constant etc.
|
||||
#define MAPSIZE 11
|
||||
#define CAMPSIZE 1
|
||||
#define CAMPCHECK 3
|
||||
@@ -108,11 +109,10 @@ class map
|
||||
// Terrain
|
||||
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 tername(const int x, const int y) const; // Name of terrain at (x, y)
|
||||
std::string features(const int x, const int y); // Words relevant to terrain (sharp, etc)
|
||||
bool has_flag(const t_flag flag, const int x, const int y); // checks terrain and vehicles
|
||||
bool has_flag_ter_only(const t_flag flag, const int x, const int y); // only checks terrain
|
||||
bool has_flag_ter_only(const t_flag flag, const int x, const int y) const; // only checks terrain
|
||||
bool is_destructable(const int x, const int y); // checks terrain and vehicles
|
||||
bool is_destructable_ter_only(const int x, const int y); // only checks terrain
|
||||
bool is_outside(const int x, const int y);
|
||||
@@ -121,6 +121,7 @@ class map
|
||||
point random_outdoor_tile();
|
||||
|
||||
void translate(const ter_id from, const ter_id to); // Change all instances of $from->$to
|
||||
void translate_radius(const ter_id from, const ter_id to, const float radi, const int uX, const int uY);
|
||||
bool close_door(const int x, const int y, const bool inside);
|
||||
bool open_door(const int x, const int y, const bool inside);
|
||||
// bash: if res pointer is supplied, res will contain absorbed impact or -1
|
||||
@@ -128,6 +129,7 @@ class map
|
||||
void destroy(game *g, const int x, const int y, const bool makesound);
|
||||
void shoot(game *g, const int x, const int y, int &dam, const bool hit_items, const unsigned flags);
|
||||
bool hit_with_acid(game *g, const int x, const int y);
|
||||
bool hit_with_fire(game *g, const int x, const int y);
|
||||
void marlossify(const int x, const int y);
|
||||
bool has_adjacent_furniture(const int x, const int y);
|
||||
void mop_spills(const int x, const int y);
|
||||
@@ -138,18 +140,21 @@ class map
|
||||
// Items
|
||||
std::vector<item>& i_at(int x, int y);
|
||||
item water_from(const int x, const int y);
|
||||
item acid_from(const int x, const int y);
|
||||
void i_clear(const int x, const int y);
|
||||
void i_rem(const int x, const int y, const int index);
|
||||
point find_item(const item *it);
|
||||
void spawn_item(const int x, const int y, itype* type, int birthday, int quantity = 0, int charges = 0);
|
||||
void spawn_item(const int x, const int y, itype* type, int birthday, int quantity = 0, int charges = 0, int damlevel = 0);
|
||||
void spawn_item(const int x, const int y, std::string itype_id, int birthday, int quantity = 0, int charges = 0, int damlevel = 0);
|
||||
void add_item_or_charges(const int x, const int y, item new_item);
|
||||
void add_item(const int x, const int y, item new_item);
|
||||
void process_active_items(game *g);
|
||||
void process_active_items_in_submap(game *g, const int nonant);
|
||||
void process_vehicles(game *g);
|
||||
|
||||
void use_amount(const point origin, const int range, const itype_id type, const int amount,
|
||||
const bool use_container = false);
|
||||
void use_charges(const point origin, const int range, const itype_id type, const int amount);
|
||||
std::list<item> use_amount(const point origin, const int range, const itype_id type, const int amount,
|
||||
const bool use_container = false);
|
||||
std::list<item> use_charges(const point origin, const int range, const itype_id type, const int amount);
|
||||
|
||||
// Traps
|
||||
trap_id& tr_at(const int x, const int y);
|
||||
@@ -164,6 +169,7 @@ class map
|
||||
bool process_fields_in_submap(game *g, const int gridn); // See fields.cpp
|
||||
void step_in_field(const int x, const int y, game *g); // See fields.cpp
|
||||
void mon_in_field(const int x, const int y, game *g, monster *z); // See fields.cpp
|
||||
void field_effect(int x, int y, game *g); //See fields.cpp
|
||||
|
||||
// Computers
|
||||
computer* computer_at(const int x, const int y);
|
||||
@@ -185,13 +191,16 @@ class map
|
||||
void place_items(items_location loc, const int chance, const int x1, const int y1,
|
||||
const int x2, const int y2, bool ongrass, const int turn);
|
||||
// put_items_from puts exactly num items, based on chances
|
||||
void put_items_from(items_location loc, const int num, const int x, const int y, const int turn = 0);
|
||||
void put_items_from(items_location loc, const int num, const int x, const int y, const int turn = 0, const int quantity = 0, const int charges = 0, const int damlevel = 0);
|
||||
void spawn_item(const int x, const int y, item new_item, const int birthday,
|
||||
const int quantity, const int charges, const int damlevel);
|
||||
void add_spawn(mon_id type, const int count, const int x, const int y, bool friendly = false,
|
||||
const int faction_id = -1, const int mission_id = -1,
|
||||
std::string name = "NONE");
|
||||
void add_spawn(monster *mon);
|
||||
void create_anomaly(const int cx, const int cy, artifact_natural_property prop);
|
||||
vehicle *add_vehicle(game *g, vhtype_id type, const int x, const int y, const int dir);
|
||||
vehicle *add_vehicle(game *g, vhtype_id type, const int x, const int y, const int dir,
|
||||
const int init_veh_fuel = -1, const int init_veh_status = -1 );
|
||||
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);
|
||||
|
||||
+1
-1
@@ -84,7 +84,7 @@ void mapbuffer::save_if_dirty()
|
||||
|
||||
void mapbuffer::save()
|
||||
{
|
||||
std::map<tripoint, submap*>::iterator it;
|
||||
std::map<tripoint, submap*, pointcomp>::iterator it;
|
||||
std::ofstream fout;
|
||||
fout.open("save/maps.txt");
|
||||
|
||||
|
||||
@@ -56,6 +56,7 @@ enum t_flag {
|
||||
alarmed, // Sets off an alarm if smashed
|
||||
supports_roof,// Used as a boundary for roof construction
|
||||
// can also knock down adjacent supports_roof and collapses tiles when destroyed
|
||||
indoors, // Has a roof ovr it, therefore blocks rain, sunlight, etc.
|
||||
thin_obstacle,// passable by player and monsters, but not by vehicles
|
||||
collapses, // Tiles that have a roof over them (which can collapse)
|
||||
flammable2, // Burn to ash rather than rubble.
|
||||
@@ -71,6 +72,7 @@ struct ter_t {
|
||||
long sym;
|
||||
nc_color color;
|
||||
unsigned char movecost;
|
||||
int move_str_req;
|
||||
trap_id trap;
|
||||
unsigned long flags;// : num_t_flags;
|
||||
void (iexamine::*examine)(game *, player *, map *m, int examx, int examy);
|
||||
@@ -106,7 +108,7 @@ t_wall_glass_v, t_wall_glass_h,
|
||||
t_wall_glass_v_alarm, t_wall_glass_h_alarm,
|
||||
t_reinforced_glass_v, t_reinforced_glass_h,
|
||||
t_bars,
|
||||
t_door_c, t_door_b, t_door_o, t_door_locked, t_door_locked_alarm, t_door_frame,
|
||||
t_door_c, t_door_b, t_door_o, t_door_locked_interior, t_door_locked, t_door_locked_alarm, t_door_frame,
|
||||
t_chaingate_l, t_fencegate_c, t_fencegate_o, t_chaingate_c, t_chaingate_o, t_door_boarded,
|
||||
t_door_metal_c, t_door_metal_o, t_door_metal_locked,
|
||||
t_door_glass_c, t_door_glass_o,
|
||||
@@ -114,10 +116,11 @@ t_bulletin,
|
||||
t_portcullis,
|
||||
t_recycler, t_window, t_window_taped, t_window_domestic, t_window_domestic_taped, t_window_open, t_curtains,
|
||||
t_window_alarm, t_window_alarm_taped, t_window_empty, t_window_frame, t_window_boarded,
|
||||
t_window_stained_green, t_window_stained_red, t_window_stained_blue,
|
||||
t_rock, t_fault,
|
||||
t_paper,
|
||||
// Tree
|
||||
t_tree, t_tree_young, t_tree_apple, t_underbrush, t_shrub, t_shrub_blueberry, t_log,
|
||||
t_tree, t_tree_young, t_tree_apple, t_underbrush, t_shrub, t_indoor_plant, t_shrub_blueberry, t_log,
|
||||
t_root_wall,
|
||||
t_wax, t_floor_wax,
|
||||
t_fence_v, t_fence_h, t_chainfence_v, t_chainfence_h, t_chainfence_posts,
|
||||
@@ -126,15 +129,16 @@ t_railing_v, t_railing_h,
|
||||
// Nether
|
||||
t_marloss, t_fungus, t_tree_fungal,
|
||||
// Water, lava, etc.
|
||||
t_water_sh, t_water_dp, t_sewage,
|
||||
t_water_sh, t_water_dp, t_water_pool, t_sewage,
|
||||
t_lava,
|
||||
// Embellishments
|
||||
t_bed, t_toilet, t_makeshift_bed,
|
||||
// More embellishments than you can shake a stick at.
|
||||
t_sink, t_oven, t_woodstove, t_bathtub, t_chair, t_armchair, t_sofa, t_cupboard, t_trashcan, t_desk,
|
||||
t_sink, t_oven, t_woodstove, t_fireplace, t_bathtub, t_chair, t_armchair, t_sofa, t_cupboard, t_trashcan, t_desk, t_exercise,
|
||||
t_sandbox, t_slide, t_monkey_bars, t_backboard,
|
||||
t_bench, t_table, t_pool_table,
|
||||
t_gas_pump, t_gas_pump_smashed, t_gas_pump_empty,
|
||||
t_generator_broken,
|
||||
t_missile, t_missile_exploded,
|
||||
t_counter,
|
||||
t_radio_tower, t_radio_controls,
|
||||
@@ -143,6 +147,7 @@ t_sewage_pipe, t_sewage_pump,
|
||||
t_centrifuge,
|
||||
t_column,
|
||||
// Containers
|
||||
t_washer, t_dryer,
|
||||
t_fridge, t_glass_fridge, t_dresser, t_locker,
|
||||
t_rack, t_bookcase,
|
||||
t_dumpster,
|
||||
@@ -165,423 +170,469 @@ 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), &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), &iexamine::none},
|
||||
{"sand", '.', c_yellow, 2, tr_null,
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable), &iexamine::none},
|
||||
{"mound of dirt", '#', c_brown, 3, tr_null,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"shallow pit", '0', c_yellow, 8, tr_null,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"pit", '0', c_brown, 10, tr_pit,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::pit},
|
||||
{"corpse filled pit",'#', c_green, 5, tr_null,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"covered pit", '#', c_ltred, 2, tr_null,
|
||||
mfb(transparent), &iexamine::pit_covered},
|
||||
{"spiked pit", '0', c_ltred, 10, tr_spike_pit,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::pit_spiked},
|
||||
{"covered spiked pit",'#',c_ltred, 2, tr_null,
|
||||
mfb(transparent), &iexamine::pit_spiked_covered},
|
||||
{"rock floor", '.', c_ltgray, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"pile of rubble", '^', c_ltgray, 4, tr_null,
|
||||
mfb(transparent)|mfb(rough)|mfb(diggable), &iexamine::rubble},
|
||||
{"pile of ash", '#', c_ltgray, 2, tr_null,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::rubble},
|
||||
{"twisted metal", '#', c_cyan, 5, tr_null,
|
||||
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), &iexamine::wreckage},
|
||||
{"grass", '.', c_green, 2, tr_null,
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable), &iexamine::none},
|
||||
{"metal floor", '.', c_ltcyan, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"pavement", '.', c_dkgray, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"yellow pavement", '.', c_yellow, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"sidewalk", '.', c_ltgray, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"floor", '.', c_cyan, 2, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"hay", '#', i_brown, 5, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable2)|mfb(collapses), &iexamine::none},
|
||||
{"metal grate", '#', c_dkgray, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"slime", '~', c_green, 6, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable2)|mfb(place_item), &iexamine::none},
|
||||
{"walkway", '#', c_yellow, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"canvas wall", '#', c_blue, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"open canvas flap", '.', c_blue, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"groundsheet", ';', c_green, 2, tr_null,
|
||||
mfb(transparent)|mfb(tentable), &iexamine::tent},
|
||||
{"groundsheet", ';', c_green, 2, tr_null,
|
||||
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), &iexamine::none}, // Skylight
|
||||
{"floor", '.', c_white, 2, tr_null,
|
||||
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), &iexamine::none}, // Regular Light
|
||||
{"half-built wall", '#', c_brown, 4, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"chipped log wall",'#', c_brown, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"palisade wall", '#', c_brown, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"half-built wall", '#', c_ltred, 4, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"chipped wood wall",'#', c_ltred, 0, tr_null,
|
||||
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)|
|
||||
{"nothing", ' ', c_white, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"empty space", ' ', c_black, 2, -1, tr_ledge,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"dirt", '.', c_brown, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable), &iexamine::none},
|
||||
{"sand", '.', c_yellow, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable), &iexamine::none},
|
||||
{"mound of dirt", '#', c_brown, 3, -1, tr_null,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"shallow pit", '0', c_yellow, 8, -1, tr_null,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"pit", '0', c_brown, 10, -1, tr_pit,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::pit},
|
||||
{"corpse filled pit",'#', c_green, 5, -1, tr_null,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::none},
|
||||
{"covered pit", '#', c_ltred, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::pit_covered},
|
||||
{"spiked pit", '0', c_ltred, 10, -1, tr_spike_pit,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::pit},
|
||||
{"covered spiked pit",'#',c_ltred, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::pit_covered},
|
||||
{"rock floor", '.', c_ltgray, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(indoors), &iexamine::none},
|
||||
{"pile of rubble", '^', c_ltgray, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(rough)|mfb(diggable), &iexamine::rubble},
|
||||
{"pile of ash", '#', c_ltgray, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(diggable), &iexamine::rubble},
|
||||
{"twisted metal", '#', c_cyan, 5, -1, tr_null,
|
||||
mfb(transparent)|mfb(rough)|mfb(sharp)|mfb(place_item), &iexamine::wreckage},
|
||||
{"metal wreckage", '#', c_cyan, 5, -1, tr_null,
|
||||
mfb(transparent)|mfb(rough)|mfb(sharp)|mfb(place_item), &iexamine::wreckage},
|
||||
{"grass", '.', c_green, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(diggable)|mfb(tentable), &iexamine::none},
|
||||
{"metal floor", '.', c_ltcyan, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(indoors), &iexamine::none},
|
||||
{"pavement", '.', c_dkgray, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"yellow pavement", '.', c_yellow, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"sidewalk", '.', c_ltgray, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"floor", '.', c_cyan, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses)|mfb(indoors),
|
||||
&iexamine::none},
|
||||
{"dirt floor", '.', c_brown, 2, -1, tr_null, //Dirt Floor, must have roofs!
|
||||
mfb(transparent)|mfb(diggable)|mfb(supports_roof)|mfb(collapses)|mfb(indoors),
|
||||
&iexamine::none},
|
||||
{"hay", '#', i_brown, 5, -1, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable2)|mfb(collapses)|mfb(indoors),
|
||||
&iexamine::none},
|
||||
{"metal grate", '#', c_dkgray, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"slime", '~', c_green, 6, -1, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable2)|mfb(place_item), &iexamine::none},
|
||||
{"walkway", '#', c_yellow, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"canvas wall", '#', c_blue, 0, -1, tr_null,
|
||||
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable), &iexamine::none},
|
||||
{"canvas flap", '+', c_blue, 0, -1, tr_null,
|
||||
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable), &iexamine::none},
|
||||
{"open canvas flap", '.', c_blue, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"groundsheet", ';', c_green, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(tentable)|mfb(indoors), &iexamine::tent},
|
||||
{"groundsheet", ';', c_green, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(indoors), &iexamine::none},
|
||||
{"animalskin wall", '#', c_brown, 0, -1, tr_null,
|
||||
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable), &iexamine::none},
|
||||
{"animalskin flap", '+', c_white, 0, -1, tr_null,
|
||||
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable), &iexamine::none},
|
||||
{"open animalskin flap", '.', c_white, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"animalskin floor", ';', c_brown, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(indoors), &iexamine::shelter},
|
||||
{"floor", '.', c_white, 2, -1, tr_null, // Skylight
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses), &iexamine::none},
|
||||
{"floor", '.', c_white, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses)|mfb(indoors),
|
||||
&iexamine::none}, // Emergency Light
|
||||
{"floor", '.', c_white, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses)|mfb(indoors),
|
||||
&iexamine::none}, // Regular Light
|
||||
{"half-built wall", '#', c_brown, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"log wall", '#', c_brown, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"chipped log wall",'#', c_brown, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"broken log wall", '&', c_brown, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)|
|
||||
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), &iexamine::none},
|
||||
{"glass wall", LINE_OXOX, c_ltcyan, 0, tr_null, // Alarmed
|
||||
mfb(transparent)|mfb(bashable)|mfb(alarmed)|mfb(noitem)|
|
||||
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), &iexamine::none},
|
||||
{"closed wood door", '+', c_brown, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"open wood door", '\'', c_brown, 2, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"closed wood door", '+', c_brown, 0, tr_null, // Locked and alarmed
|
||||
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), &iexamine::none},
|
||||
{"locked wire gate", '+', c_cyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed wooden gate", '+', c_brown, 3, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"closed wire gate", '+', c_cyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"open wire gate", '.', c_cyan, 2, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"boarded up door", '#', c_brown, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed metal door",'+', c_cyan, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"open metal door", '\'', c_cyan, 2, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed metal door",'+', c_cyan, 0, tr_null, // Actually locked
|
||||
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), &iexamine::none},
|
||||
{"open glass door", '\'', c_ltcyan, 2, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"bulletin board", '6', c_blue, 0, tr_null,
|
||||
mfb(flammable)|mfb(noitem), &iexamine::none},
|
||||
{"makeshift portcullis", '&', c_cyan, 0, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"steel compactor", '&', c_green, 0, tr_null,
|
||||
mfb(transparent), &iexamine::recycler},
|
||||
{"window", '"', c_ltcyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
|
||||
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)| 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), &iexamine::none}, //has curtains
|
||||
{"taped window", '"', c_dkgray, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"closed curtains", '"', c_dkgray, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"taped window", '"', c_dkgray, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"window frame", '0', c_ltcyan, 8, tr_null,
|
||||
mfb(transparent)|mfb(sharp)|mfb(flammable)|mfb(noitem)|
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"boarded up window",'#', c_brown, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"solid rock", '#', c_white, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"odd fault", '#', c_magenta, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::fault},
|
||||
{"paper wall", '#', c_white, 0, tr_null,
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"tree", '7', c_green, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"apple tree", '7', c_ltgreen, 0, tr_null,
|
||||
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), &iexamine::shrub_wildveggies},
|
||||
{"shrub", '#', c_green, 8, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(flammable2)|
|
||||
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), &iexamine::shrub_blueberry},
|
||||
{"tree trunk", '1', c_brown, 4, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(diggable), &iexamine::none},
|
||||
{"root wall", '#', c_brown, 0, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"wax wall", '#', c_yellow, 0, tr_null,
|
||||
mfb(flammable2)|mfb(noitem)|mfb(supports_roof)|mfb(place_item), &iexamine::none},
|
||||
{"wax floor", '.', c_yellow, 2, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable), &iexamine::none},
|
||||
{"picket fence", '|', c_brown, 3, tr_null,
|
||||
mfb(bashable)|mfb(transparent)|mfb(diggable)|mfb(flammable2)|mfb(noitem)|mfb(thin_obstacle), &iexamine::none},
|
||||
{"picket fence", '-', c_brown, 3, tr_null,
|
||||
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), &iexamine::chainfence},
|
||||
{"chain link fence", '-', c_cyan, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(thin_obstacle), &iexamine::chainfence},
|
||||
{"metal post", '#', c_cyan, 2, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::fence_post},
|
||||
{"fence post", '#', c_brown, 2, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::fence_post},
|
||||
{"wire fence", '$', c_blue, 4, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::remove_fence_wire},
|
||||
{"barbed wire fence",'$', c_blue, 4, tr_null,
|
||||
mfb(transparent)|mfb(sharp)|mfb(thin_obstacle), &iexamine::remove_fence_barbed},
|
||||
{"rope fence", '$', c_brown, 3, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::remove_fence_rope},
|
||||
{"railing", '|', c_yellow, 3, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(thin_obstacle), &iexamine::none},
|
||||
{"railing", '-', c_yellow, 3, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(thin_obstacle), &iexamine::none},
|
||||
{"marloss bush", '1', c_dkgray, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2), &iexamine::none},
|
||||
{"fungal bed", '#', c_dkgray, 3, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(diggable), &iexamine::none},
|
||||
{"fungal tree", '7', c_dkgray, 0, tr_null,
|
||||
mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"shallow water", '~', c_ltblue, 5, tr_null,
|
||||
mfb(transparent)|mfb(liquid)|mfb(swimmable), &iexamine::none},
|
||||
{"deep water", '~', c_blue, 0, tr_null,
|
||||
mfb(transparent)|mfb(liquid)|mfb(swimmable), &iexamine::none},
|
||||
{"sewage", '~', c_ltgreen, 6, tr_null,
|
||||
mfb(transparent)|mfb(swimmable), &iexamine::none},
|
||||
{"lava", '~', c_red, 4, tr_lava,
|
||||
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), &iexamine::none},
|
||||
{"toilet", '&', c_white, 4, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"sink", '&', c_white, 4, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"wood stove", '#', i_red, 4, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"chair", '#', c_brown, 2, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"sofa", 'H', i_red, 3, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"trash can", '&', c_ltcyan, 3, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"sandbox", '#', c_yellow, 3, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"slide", '#', c_ltcyan, 4, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"monkey bars", '#', c_cyan, 4, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"backboard", '7', c_red, 0, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"bench", '#', c_brown, 3, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"table", '#', c_red, 4, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"gasoline pump", '&', c_red, 0, tr_null,
|
||||
mfb(transparent)|mfb(explodes)|mfb(noitem), &iexamine::gaspump},
|
||||
{"smashed gas pump", '&', c_ltred, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem), &iexamine::none},
|
||||
{"out-of-order gasoline pump", '&', c_red, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem), &iexamine::none},
|
||||
{"missile", '#', c_ltblue, 0, tr_null,
|
||||
mfb(explodes)|mfb(noitem), &iexamine::none},
|
||||
{"blown-out missile",'#', c_ltgray, 0, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"counter", '#', c_blue, 4, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"radio tower", '&', c_ltgray, 0, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"radio controls", '6', c_green, 0, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem), &iexamine::none},
|
||||
{"broken console", '6', c_ltgray, 0, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses), &iexamine::none},
|
||||
{"computer console", '6', c_blue, 0, tr_null,
|
||||
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), &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), &iexamine::none},
|
||||
{"sewage pump", '&', c_ltgray, 0, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"centrifuge", '{', c_magenta, 0, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"column", '1', c_ltgray, 0, tr_null,
|
||||
mfb(flammable), &iexamine::none},
|
||||
{"refrigerator", '{', c_ltcyan, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"dresser", '{', c_brown, 0, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable)|mfb(collapses)|
|
||||
mfb(bashable)|mfb(deconstruct)|mfb(place_item), &iexamine::none},
|
||||
{"locker", '{', c_ltgray, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"book case", '{', c_brown, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"cloning vat", '0', c_ltcyan, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"open crate", 'O', i_brown, 0, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"stairs up", '<', c_yellow, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item), &iexamine::none},
|
||||
{"manhole", '>', c_dkgray, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item), &iexamine::none},
|
||||
{"ladder", '<', c_dkgray, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item), &iexamine::none},
|
||||
{"ladder", '>', c_dkgray, 2, tr_null,
|
||||
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), &iexamine::none},
|
||||
{"upward slope", '<', c_brown, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item), &iexamine::none},
|
||||
{"rope leading up", '<', c_white, 2, tr_null,
|
||||
mfb(transparent)|mfb(goes_up), &iexamine::none},
|
||||
{"manhole cover", '0', c_dkgray, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"card reader", '6', c_pink, 0, tr_null, // Science
|
||||
mfb(noitem), &iexamine::cardreader},
|
||||
{"card reader", '6', c_pink, 0, tr_null, // Military
|
||||
mfb(noitem), &iexamine::cardreader},
|
||||
{"broken card reader",'6',c_ltgray, 0, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"slot machine", '6', c_green, 0, tr_null,
|
||||
mfb(bashable)|mfb(noitem), &iexamine::slot_machine},
|
||||
{"elevator controls",'6', c_ltblue, 0, tr_null,
|
||||
mfb(noitem), &iexamine::elevator},
|
||||
{"powerless controls",'6',c_ltgray, 0, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"elevator", '.', c_magenta, 2, tr_null,
|
||||
0, &iexamine::none},
|
||||
{"dark pedestal", '&', c_dkgray, 0, tr_null,
|
||||
mfb(transparent), &iexamine::pedestal_wyrm},
|
||||
{"light pedestal", '&', c_white, 0, tr_null,
|
||||
mfb(transparent), &iexamine::pedestal_temple},
|
||||
{"red stone", '#', c_red, 0, tr_null,
|
||||
0, &iexamine::none},
|
||||
{"green stone", '#', c_green, 0, tr_null,
|
||||
0, &iexamine::none},
|
||||
{"blue stone", '#', c_blue, 0, tr_null,
|
||||
0, &iexamine::none},
|
||||
{"red floor", '.', c_red, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"green floor", '.', c_green, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"blue floor", '.', c_blue, 2, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"yellow switch", '6', c_yellow, 0, tr_null,
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"cyan switch", '6', c_cyan, 0, tr_null,
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"purple switch", '6', c_magenta, 0, tr_null,
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"checkered switch", '6', c_white, 0, tr_null,
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"mutated poppy flower", 'f', c_red, 3, tr_null,
|
||||
mfb(transparent), &iexamine::flower_poppy}
|
||||
{"palisade wall", '#', c_brown, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent),
|
||||
&iexamine::none},
|
||||
{"palisade gate", '+', c_ltred, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(door)|mfb(transparent),
|
||||
&iexamine::none},
|
||||
{"half-built wall", '#', c_ltred, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"wooden wall", '#', c_ltred, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"chipped wood wall",'#', c_ltred, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"broken wood wall", '&', c_ltred, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)|
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"wall", LINE_XOXO, c_ltgray, 0, -1, tr_null,
|
||||
mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"wall", LINE_OXOX, c_ltgray, 0, -1, tr_null,
|
||||
mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"concrete wall", LINE_XOXO, c_dkgray, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"concrete wall", LINE_OXOX, c_dkgray, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"metal wall", LINE_XOXO, c_cyan, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"metal wall", LINE_OXOX, c_cyan, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"glass wall", LINE_XOXO, c_ltcyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"glass wall", LINE_OXOX, c_ltcyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"glass wall", LINE_XOXO, c_ltcyan, 0, -1, tr_null, // Alarmed
|
||||
mfb(transparent)|mfb(bashable)|mfb(alarmed)|mfb(noitem)|
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"glass wall", LINE_OXOX, c_ltcyan, 0, -1, tr_null, // Alarmed
|
||||
mfb(transparent)|mfb(bashable)|mfb(alarmed)|mfb(noitem)|
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"reinforced glass", LINE_XOXO, c_ltcyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"reinforced glass", LINE_OXOX, c_ltcyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"metal bars", '"', c_ltgray, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(noitem), &iexamine::none},
|
||||
{"closed wood door", '+', c_brown, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable2)|mfb(door)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"damaged wood door",'&', c_brown, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)|
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"open wood door", '\'', c_brown, 2, -1, tr_null,
|
||||
mfb(flammable2)|mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed wood door", '+', c_brown, 0, -1, tr_null, // Locked from all directions
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed wood door", '+', c_brown, 0, -1, tr_null, // Actually locked
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed wood door", '+', c_brown, 0, -1, tr_null, // Locked and alarmed
|
||||
mfb(bashable)|mfb(flammable2)|mfb(alarmed)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"empty door frame", '.', c_brown, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"locked wire gate", '+', c_cyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed wooden gate", '+', c_brown, 3, -1, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof) |mfb(bashable)|mfb(flammable2), &iexamine::none},
|
||||
{"open wooden gate", '.', c_brown, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof) |mfb(bashable)|mfb(flammable2), &iexamine::none},
|
||||
{"closed wire gate", '+', c_cyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"open wire gate", '.', c_cyan, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"boarded up door", '#', c_brown, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed metal door",'+', c_cyan, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"open metal door", '\'', c_cyan, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed metal door",'+', c_cyan, 0, -1, tr_null, // Actually locked
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"closed glass door",'+', c_ltcyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(door)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"open glass door", '\'', c_ltcyan, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(supports_roof), &iexamine::none},
|
||||
{"bulletin board", '6', c_blue, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(deconstruct), &iexamine::none},
|
||||
{"makeshift portcullis", '&', c_cyan, 0, -1, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"steel compactor", '&', c_green, 0, -1, tr_null,
|
||||
mfb(transparent), &iexamine::recycler},
|
||||
{"window", '"', c_ltcyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
|
||||
mfb(supports_roof)|mfb(deconstruct), &iexamine::none}, // Plain Ol' window
|
||||
{"taped window", '"', c_dkgray, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)| mfb(reduce_scent),
|
||||
&iexamine::none}, // Regular window
|
||||
{"window", '"', c_ltcyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
|
||||
mfb(supports_roof)|mfb(deconstruct), &iexamine::none}, //has curtains
|
||||
{"taped window", '"', c_dkgray, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)| mfb(reduce_scent),
|
||||
&iexamine::none}, // Curtain window
|
||||
{"open window", '\'', c_ltcyan, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(noitem)| mfb(supports_roof), &iexamine::none},
|
||||
{"closed curtains", '"', c_dkgray, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof), &iexamine::none},
|
||||
{"window", '"', c_ltcyan, 0, -1, tr_null, // Actually alarmed
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(alarmed)|mfb(noitem)|
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"taped window", '"', c_dkgray, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)|mfb(alarmed)|
|
||||
mfb(reduce_scent), &iexamine::none}, //Alarmed, duh.
|
||||
{"empty window", '0', c_yellow, 8, -1, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(supports_roof), &iexamine::none},
|
||||
{"window frame", '0', c_ltcyan, 8, -1, tr_null,
|
||||
mfb(transparent)|mfb(sharp)|mfb(flammable)|mfb(noitem)|
|
||||
mfb(supports_roof), &iexamine::none},
|
||||
{"boarded up window",'#', c_brown, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"high stained glass window",'"', c_ltgreen, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"high stained glass window",'"', c_ltred, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"high stained glass window",'"', c_ltblue, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"solid rock", '#', c_white, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"odd fault", '#', c_magenta, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::fault},
|
||||
{"paper wall", '#', c_white, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"tree", '7', c_green, 0, -1, tr_null,
|
||||
mfb(flammable2)|mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"young tree", '1', c_green, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"apple tree", '7', c_ltgreen, 0, -1, tr_null,
|
||||
mfb(flammable2)|mfb(noitem)|mfb(supports_roof), &iexamine::tree_apple},
|
||||
{"underbrush", '#', c_ltgreen, 6, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(diggable)|mfb(container)|
|
||||
mfb(flammable2)|mfb(thin_obstacle)|mfb(place_item), &iexamine::shrub_wildveggies},
|
||||
{"shrub", '#', c_green, 8, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(flammable2)|
|
||||
mfb(thin_obstacle)|mfb(place_item), &iexamine::none},
|
||||
{"indoor plant", '^', c_green, 4, -1, tr_null,
|
||||
mfb(container)|mfb(collapses)|mfb(bashable)|mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"blueberry bush", '#', c_ltgreen, 8, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(flammable2)|mfb(thin_obstacle),
|
||||
&iexamine::shrub_blueberry},
|
||||
{"tree trunk", '1', c_brown, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(diggable), &iexamine::none},
|
||||
{"root wall", '#', c_brown, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(supports_roof), &iexamine::none},
|
||||
{"wax wall", '#', c_yellow, 0, -1, tr_null,
|
||||
mfb(flammable2)|mfb(noitem)|mfb(supports_roof)|mfb(place_item), &iexamine::none},
|
||||
{"wax floor", '.', c_yellow, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(indoors), &iexamine::none},
|
||||
{"picket fence", '|', c_brown, 3, -1, tr_null,
|
||||
mfb(bashable)|mfb(transparent)|mfb(diggable)|mfb(flammable2)|mfb(noitem)|mfb(thin_obstacle),
|
||||
&iexamine::none},
|
||||
{"picket fence", '-', c_brown, 3, -1, tr_null,
|
||||
mfb(bashable)|mfb(transparent)|mfb(diggable)|mfb(flammable2)|mfb(noitem)|mfb(thin_obstacle),
|
||||
&iexamine::none},
|
||||
{"chain link fence", '|', c_cyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(thin_obstacle)|mfb(supports_roof), &iexamine::chainfence},
|
||||
{"chain link fence", '-', c_cyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem)|mfb(thin_obstacle)|mfb(supports_roof), &iexamine::chainfence},
|
||||
{"metal post", '#', c_cyan, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::none},
|
||||
{"fence post", '#', c_brown, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::fence_post},
|
||||
{"wire fence", '$', c_blue, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::remove_fence_wire},
|
||||
{"barbed wire fence",'$', c_blue, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(sharp)|mfb(thin_obstacle), &iexamine::remove_fence_barbed},
|
||||
{"rope fence", '$', c_brown, 3, -1, tr_null,
|
||||
mfb(transparent)|mfb(thin_obstacle), &iexamine::remove_fence_rope},
|
||||
{"railing", '|', c_yellow, 3, -1, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(thin_obstacle), &iexamine::none},
|
||||
{"railing", '-', c_yellow, 3, -1, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(thin_obstacle), &iexamine::none},
|
||||
{"marloss bush", '1', c_dkgray, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2), &iexamine::none},
|
||||
{"fungal bed", '#', c_dkgray, 3, -1, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(diggable), &iexamine::none},
|
||||
{"fungal tree", '7', c_dkgray, 0, -1, tr_null,
|
||||
mfb(flammable2)|mfb(noitem), &iexamine::none},
|
||||
{"shallow water", '~', c_ltblue, 5, -1, tr_null,
|
||||
mfb(transparent)|mfb(liquid)|mfb(swimmable), &iexamine::water_source},
|
||||
{"deep water", '~', c_blue, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(liquid)|mfb(swimmable), &iexamine::water_source},
|
||||
{"pool water", '~', c_ltblue, 5, -1, tr_null,
|
||||
mfb(transparent)|mfb(liquid)|mfb(swimmable)|mfb(indoors),
|
||||
&iexamine::water_source},
|
||||
{"sewage", '~', c_ltgreen, 6, -1, tr_null,
|
||||
mfb(transparent)|mfb(swimmable), &iexamine::water_source},
|
||||
{"lava", '~', c_red, 4, -1, tr_lava,
|
||||
mfb(transparent)|mfb(liquid), &iexamine::none},
|
||||
{"bed", '#', c_magenta, 5, -1, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable2)|mfb(collapses)|
|
||||
mfb(deconstruct)|mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"toilet", '&', c_white, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)|mfb(indoors), &iexamine::water_source},
|
||||
{"makeshift bed", '#', c_magenta, 5, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)|mfb(indoors),
|
||||
&iexamine::none},
|
||||
{"sink", '&', c_white, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)|mfb(container)|
|
||||
mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"oven", '#', c_dkgray, 4, 10, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)|mfb(container)|
|
||||
mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"wood stove", '#', i_red, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(fire_container)|mfb(suppress_smoke)|mfb(place_item)|
|
||||
mfb(indoors), &iexamine::none},
|
||||
{"fireplace", '#', i_white, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(fire_container)|mfb(suppress_smoke)|mfb(place_item)|
|
||||
mfb(indoors), &iexamine::none},
|
||||
{"bathtub", '~', c_white, 4, 10, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(l_flammable)|mfb(collapses)|mfb(container)|
|
||||
mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"chair", '#', c_brown, 2, 8, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)|mfb(indoors), &iexamine::none},
|
||||
{"arm chair", 'H', c_green, 3, 8, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)|mfb(indoors), &iexamine::none},
|
||||
{"sofa", 'H', i_red, 3, -1, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)|mfb(indoors), &iexamine::none},
|
||||
{"cupboard", '#', c_blue, 3, 8, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)|
|
||||
mfb(container)|mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"trash can", '&', c_ltcyan, 3, -1, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(container)|mfb(place_item)|mfb(indoors),
|
||||
&iexamine::none},
|
||||
{"desk", '#', c_ltred, 3, 8, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct)|
|
||||
mfb(container)|mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"exercise machine", 'T', c_dkgray, 3, 8, tr_null,
|
||||
mfb(transparent)|mfb(indoors)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"sandbox", '#', c_yellow, 3, -1, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"slide", '#', c_ltcyan, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"monkey bars", '#', c_cyan, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"backboard", '7', c_red, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(deconstruct), &iexamine::none},
|
||||
{"bench", '#', c_brown, 3, 8, tr_null,
|
||||
mfb(transparent)|mfb(flammable2)|mfb(collapses)|mfb(deconstruct), &iexamine::none},
|
||||
{"table", '#', c_red, 4, 9, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(collapses)|mfb(deconstruct)|mfb(indoors), &iexamine::none},
|
||||
{"pool table", '#', c_green, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(collapses)|mfb(deconstruct)|mfb(indoors), &iexamine::none},
|
||||
{"gasoline pump", '&', c_red, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(explodes)|mfb(noitem), &iexamine::gaspump},
|
||||
{"smashed gas pump", '&', c_ltred, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(noitem), &iexamine::none},
|
||||
{"out-of-order gasoline pump", '&', c_red, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(noitem), &iexamine::none},
|
||||
{"broken generator", '&', c_ltgray, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(noitem), &iexamine::none},
|
||||
{"missile", '#', c_ltblue, 0, -1, tr_null,
|
||||
mfb(explodes)|mfb(noitem), &iexamine::none},
|
||||
{"blown-out missile",'#', c_ltgray, 0, -1, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"counter", '#', c_blue, 4, -1, tr_null,
|
||||
mfb(transparent)|mfb(flammable)|mfb(collapses)|mfb(deconstruct)|mfb(indoors), &iexamine::none},
|
||||
{"radio tower", '&', c_ltgray, 0, -1, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"radio controls", '6', c_green, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(noitem), &iexamine::none},
|
||||
{"broken console", '6', c_ltgray, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses)|mfb(indoors), &iexamine::none},
|
||||
{"computer console", '6', c_blue, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(console)|mfb(noitem)|mfb(collapses)|mfb(indoors), &iexamine::none},
|
||||
{"mechanical winch", '6', c_cyan_red, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses), &iexamine::controls_gate},
|
||||
{"rope and pulley", '|', c_brown, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses), &iexamine::controls_gate},
|
||||
{"rope and pulley", '|', c_brown, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(noitem)|mfb(collapses), &iexamine::controls_gate},
|
||||
{"sewage pipe", '1', c_ltgray, 0, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"sewage pump", '&', c_ltgray, 0, -1, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"centrifuge", '{', c_magenta, 0, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"column", '1', c_ltgray, 0, -1, tr_null,
|
||||
mfb(flammable), &iexamine::none},
|
||||
{"washing machine", '{', i_white, 0, -1, tr_null,
|
||||
mfb(container)|mfb(collapses)|mfb(bashable)|mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"dryer", '{', i_white, 0, -1, tr_null,
|
||||
mfb(container)|mfb(collapses)|mfb(bashable)|mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"refrigerator", '{', c_ltcyan, 0, 10, tr_null,
|
||||
mfb(container)|mfb(collapses)|mfb(bashable)|mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"glass door fridge",'{', c_ltcyan, 0, 10, tr_null,
|
||||
mfb(collapses)|mfb(bashable)|mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"dresser", '{', c_brown, 0, 8, tr_null,
|
||||
mfb(transparent)|mfb(container)|mfb(flammable)|mfb(collapses)|
|
||||
mfb(bashable)|mfb(deconstruct)|mfb(place_item)|mfb(indoors), &iexamine::none},
|
||||
{"locker", '{', c_ltgray, 0, 9, tr_null,
|
||||
mfb(container)|mfb(collapses)|mfb(bashable)|mfb(place_item)|mfb(indoors)|mfb(deconstruct),
|
||||
&iexamine::none},
|
||||
{"display rack", '{', c_ltgray, 0, 8, tr_null,
|
||||
mfb(transparent)|mfb(l_flammable)|mfb(collapses)|mfb(bashable)|
|
||||
mfb(deconstruct)|mfb(place_item)|mfb(indoors)|mfb(deconstruct), &iexamine::none},
|
||||
{"book case", '{', c_brown, 0, 9, tr_null,
|
||||
mfb(flammable)|mfb(collapses)|mfb(bashable)|mfb(deconstruct)|mfb(place_item)|mfb(indoors),
|
||||
&iexamine::none},
|
||||
{"dumpster", '{', c_green, 0, -1, tr_null,
|
||||
mfb(container)|mfb(bashable)|mfb(place_item), &iexamine::none},
|
||||
{"cloning vat", '0', c_ltcyan, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(sealed)|mfb(place_item), &iexamine::none},
|
||||
{"crate", 'X', i_brown, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(sealed)|
|
||||
mfb(flammable)|mfb(deconstruct)|mfb(place_item), &iexamine::none},
|
||||
{"open crate", 'O', i_brown, 0, -1, tr_null,
|
||||
mfb(transparent)|mfb(bashable)|mfb(container)|mfb(flammable)|mfb(place_item),
|
||||
&iexamine::none},
|
||||
{"stairs down", '>', c_yellow, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item), &iexamine::none},
|
||||
{"stairs up", '<', c_yellow, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item), &iexamine::none},
|
||||
{"manhole", '>', c_dkgray, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item), &iexamine::none},
|
||||
{"ladder", '<', c_dkgray, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item), &iexamine::none},
|
||||
{"ladder", '>', c_dkgray, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item), &iexamine::none},
|
||||
{"downward slope", '>', c_brown, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(goes_down)|mfb(place_item), &iexamine::none},
|
||||
{"upward slope", '<', c_brown, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(goes_up)|mfb(place_item), &iexamine::none},
|
||||
{"rope leading up", '<', c_white, 2, -1, tr_null,
|
||||
mfb(transparent)|mfb(goes_up), &iexamine::none},
|
||||
{"manhole cover", '0', c_dkgray, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"card reader", '6', c_pink, 0, -1, tr_null, // Science
|
||||
mfb(noitem), &iexamine::cardreader},
|
||||
{"card reader", '6', c_pink, 0, -1, tr_null, // Military
|
||||
mfb(noitem), &iexamine::cardreader},
|
||||
{"broken card reader",'6',c_ltgray, 0, -1, tr_null,
|
||||
mfb(noitem), &iexamine::none},
|
||||
{"slot machine", '6', c_green, 0, -1, tr_null,
|
||||
mfb(bashable)|mfb(noitem)|mfb(indoors), &iexamine::slot_machine},
|
||||
{"elevator controls",'6', c_ltblue, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(indoors), &iexamine::elevator},
|
||||
{"powerless controls",'6',c_ltgray, 0, -1, tr_null,
|
||||
mfb(noitem)|mfb(indoors), &iexamine::none},
|
||||
{"elevator", '.', c_magenta, 2, -1, tr_null,
|
||||
mfb(indoors)|mfb(transparent), &iexamine::none},
|
||||
{"dark pedestal", '&', c_dkgray, 0, -1, tr_null,
|
||||
mfb(transparent), &iexamine::pedestal_wyrm},
|
||||
{"light pedestal", '&', c_white, 0, -1, tr_null,
|
||||
mfb(transparent), &iexamine::pedestal_temple},
|
||||
{"red stone", '#', c_red, 0, -1, tr_null,
|
||||
0, &iexamine::none},
|
||||
{"green stone", '#', c_green, 0, -1, tr_null,
|
||||
0, &iexamine::none},
|
||||
{"blue stone", '#', c_blue, 0, -1, tr_null,
|
||||
0, &iexamine::none},
|
||||
{"red floor", '.', c_red, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"green floor", '.', c_green, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"blue floor", '.', c_blue, 2, -1, tr_null,
|
||||
mfb(transparent), &iexamine::none},
|
||||
{"yellow switch", '6', c_yellow, 0, -1, tr_null,
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"cyan switch", '6', c_cyan, 0, -1, tr_null,
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"purple switch", '6', c_magenta, 0, -1, tr_null,
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"checkered switch", '6', c_white, 0, -1, tr_null,
|
||||
mfb(transparent), &iexamine::fswitch},
|
||||
{"mutated poppy flower", 'f', c_red, 3, -1, tr_null,
|
||||
mfb(transparent), &iexamine::flower_poppy}
|
||||
};
|
||||
|
||||
enum map_extra {
|
||||
@@ -677,6 +728,7 @@ enum field_id {
|
||||
fd_acid,
|
||||
fd_sap,
|
||||
fd_fire,
|
||||
fd_rubble,
|
||||
fd_smoke,
|
||||
fd_toxic_gas,
|
||||
fd_tear_gas,
|
||||
@@ -717,6 +769,9 @@ const field_t fieldlist[] = {
|
||||
{{"small fire", "fire", "raging fire"}, '4',
|
||||
{c_yellow, c_ltred, c_red}, {true, true, true}, {true, true, true}, 800},
|
||||
|
||||
{{"rubble heap", "rubble pile", "mountain of rubble"}, '#',
|
||||
{c_dkgray, c_dkgray, c_dkgray}, {true, true, false},{false, false, false}, 0},
|
||||
|
||||
{{"thin smoke", "smoke", "thick smoke"}, '8',
|
||||
{c_white, c_ltgray, c_dkgray}, {true, false, false},{false, true, true}, 300},
|
||||
|
||||
|
||||
+4542
-806
File diff suppressed because it is too large
Load Diff
@@ -0,0 +1,116 @@
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
|
||||
#include <string>
|
||||
|
||||
#include <cassert>
|
||||
#include <stdarg.h>
|
||||
|
||||
#include "output.h"
|
||||
|
||||
#include "mapgenformat.h"
|
||||
|
||||
namespace mapf
|
||||
{
|
||||
|
||||
void formatted_set_terrain(map* m, const int startx, const int starty, const char* cstr, ...)
|
||||
{
|
||||
internal::format_data fdata;
|
||||
va_list vl;
|
||||
va_start(vl,cstr);
|
||||
internal::format_effect* temp;
|
||||
while((temp = va_arg(vl,internal::format_effect*)))
|
||||
{
|
||||
temp->execute(fdata);
|
||||
delete temp;
|
||||
}
|
||||
|
||||
if(fdata.bindings.find(' ') == fdata.bindings.end())
|
||||
fdata.bindings[' '] = new internal::statically_determine_terrain();
|
||||
|
||||
va_end(vl);
|
||||
|
||||
const char* p = cstr;
|
||||
int x = startx;
|
||||
int y = starty;
|
||||
while(*p != 0) {
|
||||
if(*p == '\n') {
|
||||
y++;
|
||||
x = startx;
|
||||
}
|
||||
else {
|
||||
if(fdata.bindings.find(*p) == fdata.bindings.end())
|
||||
{
|
||||
debugmsg("No binding for \'%c.\'", *p);
|
||||
fdata.bindings[*p] = new internal::statically_determine_terrain();
|
||||
}
|
||||
ter_id id = (*fdata.bindings[*p])(m, x, y);
|
||||
if(id != t_null)
|
||||
m->ter_set(x, y, id);
|
||||
x++;
|
||||
}
|
||||
p++;
|
||||
}
|
||||
for(std::map<char, internal::determine_terrain*>::iterator it = fdata.bindings.begin(); it != fdata.bindings.end(); ++it)
|
||||
{
|
||||
delete it->second;
|
||||
}
|
||||
}
|
||||
|
||||
internal::format_effect* basic_bind(std::string characters, ...)
|
||||
{
|
||||
std::string temp;
|
||||
for(int i = 0; i < characters.size(); i++)
|
||||
if(characters[i] != ' ')
|
||||
temp += characters[i];
|
||||
characters = temp;
|
||||
|
||||
std::vector<internal::determine_terrain*> determiners;
|
||||
va_list vl;
|
||||
va_start(vl,characters);
|
||||
for(int i = 0; i < characters.size(); i++)
|
||||
determiners.push_back( new internal::statically_determine_terrain( (ter_id)va_arg(vl,int) ));
|
||||
va_end(vl);
|
||||
return new internal::format_effect(characters, determiners);
|
||||
}
|
||||
|
||||
internal::format_effect* simple_method_bind(std::string characters, ...)
|
||||
{
|
||||
std::string temp;
|
||||
for(int i = 0; i < characters.size(); i++)
|
||||
if(characters[i] != ' ')
|
||||
temp += characters[i];
|
||||
characters = temp;
|
||||
|
||||
std::vector<internal::determine_terrain*> determiners;
|
||||
va_list vl;
|
||||
va_start(vl,characters);
|
||||
for(int i = 0; i < characters.size(); i++)
|
||||
determiners.push_back( new internal::determine_terrain_with_simple_method( va_arg(vl, internal::determine_terrain_with_simple_method::ter_id_func ) ));
|
||||
va_end(vl);
|
||||
return new internal::format_effect(characters, determiners);
|
||||
}
|
||||
|
||||
internal::format_effect* end()
|
||||
{
|
||||
return NULL;
|
||||
}
|
||||
|
||||
namespace internal
|
||||
{
|
||||
format_effect::format_effect(std::string characters, std::vector<determine_terrain*> determiners)
|
||||
{
|
||||
this->characters = characters;
|
||||
this->determiners = determiners;
|
||||
}
|
||||
|
||||
format_effect::~format_effect() {}
|
||||
|
||||
void format_effect::execute(format_data& data)
|
||||
{
|
||||
for(int i = 0; i < characters.size(); i++)
|
||||
data.bindings[characters[i]] = determiners[i];
|
||||
}
|
||||
}
|
||||
|
||||
}//END NAMESPACE mapf
|
||||
@@ -0,0 +1,98 @@
|
||||
#ifndef MAPGENFORMAT_H
|
||||
#define MAPGENFORMAT_H
|
||||
|
||||
#include <vector>
|
||||
|
||||
#include "map.h"
|
||||
|
||||
namespace mapf
|
||||
{
|
||||
namespace internal
|
||||
{
|
||||
class format_effect;
|
||||
}
|
||||
/** The return statement for this method is not finalized.
|
||||
* The following things will be acces from this return statements.
|
||||
* - the region of points set by given character
|
||||
* - the region of points set to a given terrian id
|
||||
* - possibly some other stuff
|
||||
* You will have specify the values you want to track with a parameter.
|
||||
*/
|
||||
void formatted_set_terrain(map* m, const int startx, const int starty, const char* cstr, ...);
|
||||
|
||||
internal::format_effect* basic_bind(std::string characters, ...);
|
||||
internal::format_effect* simple_method_bind(std::string characters, ...);
|
||||
internal::format_effect* end();
|
||||
|
||||
// Anything specified in here isn't finalized
|
||||
namespace internal
|
||||
{
|
||||
class determine_terrain;
|
||||
struct format_data
|
||||
{
|
||||
std::map<char, determine_terrain*> bindings;
|
||||
};
|
||||
|
||||
// This class will become an interface in the future.
|
||||
class format_effect
|
||||
{
|
||||
private:
|
||||
std::string characters;
|
||||
std::vector<determine_terrain*> determiners;
|
||||
|
||||
public:
|
||||
format_effect(std::string characters, std::vector<determine_terrain*> determiners);
|
||||
virtual ~format_effect();
|
||||
|
||||
void execute(format_data& data);
|
||||
};
|
||||
|
||||
class determine_terrain
|
||||
{
|
||||
public:
|
||||
virtual ~determine_terrain() {}
|
||||
virtual ter_id operator ()(map* m, const int x, const int y) = 0;
|
||||
};
|
||||
|
||||
class statically_determine_terrain : public determine_terrain
|
||||
{
|
||||
private:
|
||||
ter_id id;
|
||||
public:
|
||||
statically_determine_terrain():id(t_null) {}
|
||||
statically_determine_terrain(ter_id pid):id(pid) {}
|
||||
virtual ~statically_determine_terrain() {}
|
||||
virtual ter_id operator ()(map* m, const int x, const int y){return id;}
|
||||
};
|
||||
|
||||
class determine_terrain_with_simple_method : public determine_terrain
|
||||
{
|
||||
public:
|
||||
typedef ter_id (*ter_id_func)();
|
||||
private:
|
||||
ter_id_func f;
|
||||
public:
|
||||
determine_terrain_with_simple_method():f(NULL) {}
|
||||
determine_terrain_with_simple_method(ter_id_func pf):f(pf) {}
|
||||
virtual ~determine_terrain_with_simple_method() {}
|
||||
virtual ter_id operator ()(map* m, const int x, const int y){return f();}
|
||||
};
|
||||
|
||||
//TODO: make use of this
|
||||
class determine_terrain_with_complex_method : public determine_terrain
|
||||
{
|
||||
private:
|
||||
ter_id (*f)(map*, const int, const int);
|
||||
public:
|
||||
determine_terrain_with_complex_method():f(NULL) {}
|
||||
determine_terrain_with_complex_method(ter_id (*pf)(map*, const int, const int)):f(pf) {}
|
||||
virtual ~determine_terrain_with_complex_method() {}
|
||||
virtual ter_id operator ()(map* m, const int x, const int y){return f(m,x,y);}
|
||||
};
|
||||
|
||||
|
||||
} //END NAMESPACE mapf::internal
|
||||
|
||||
} //END NAMESPACE mapf
|
||||
|
||||
#endif // MAPGENFORMAT_H
|
||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user