Compare commits

...

510 Commits

Author SHA1 Message Date
TheDarklingWolf 5190d7135e Added shelters and digging sticks. 2013-03-22 16:54:21 +00:00
OzoneH3 c62041fd4d Fixed windows crash for real now. 2013-03-22 15:40:55 +01:00
OzoneH3 a4c3cceeaa Fixes for Viewport > 60: win crash, redraw, wrong menu position. 2013-03-22 15:30:58 +01:00
Ozone 213fb65d3c Added: Make taped up windows block scent better. 2013-03-22 13:50:02 +01:00
Ozone b8e91273c0 Fix for inventory reload to actually reload the gun -.- 2013-03-22 13:12:29 +01:00
Ozone 54e7a1651d Reload from inventory: Monsters get one extra move now if using this method. 2013-03-22 13:06:46 +01:00
Ozone 8b359b6507 HP window not fully cleared after closing certain menus. 2013-03-22 10:58:43 +01:00
Ozone a760f04359 Fix for terrain being drawn on unseen region. 2013-03-22 09:58:32 +01:00
Kevin Granade 4f29b99976 Make child zombies be made of zombie meat too. 2013-03-21 23:21:44 -05:00
Kevin Granade af9f2777e4 Base production of bone and sinew on a MF_BONE flag instead of MEAT, so insects, spiders, etc don't produce bones. 2013-03-21 23:20:42 -05:00
Kevin Granade 89f915ca1c Merge pull request #239 from delebota/iss56
Firecrackers.
2013-03-21 21:09:39 -07:00
delebota ca9d1b9391 Increased sound volume. Set pack to 1 vol/weight, single firecracker to 0 vol/weight. 2013-03-21 20:58:35 -07:00
delebota 46eb5da624 Implemented firecrackers. #56 2013-03-21 19:46:07 -07:00
Kevin Granade 64641f9cda Fix off-by-one coordinate typo when spawning subway stations. 2013-03-21 21:30:40 -05:00
Kevin Granade e2fe1d87db Merge pull request #237 from Shoes01/master
Added crafting recipes, hunger now affects bod temp (a bit)
2013-03-21 16:47:02 -07:00
OzoneH3 39b9681bff Listitems draw fix. 2013-03-22 00:35:07 +01:00
OzoneH3 304352a291 Main menu preset character up/down movement fix. 2013-03-22 00:28:42 +01:00
OzoneH3 84a0f7e306 Modified menues to match max terrainX/Y 121 2013-03-22 00:03:55 +01:00
OzoneH3 e1a20db931 Merge branch 'refs/heads/rain' 2013-03-21 22:28:30 +01:00
OzoneH3 280656c67e Max terrain width/height 121 (Viewdistance). Center terrain if Viewport X/Y > 60. 2013-03-21 22:27:03 +01:00
OzoneH3 b70f6468f2 Rain effect caused game slowdown after a while on the same tile. 2013-03-21 20:21:32 +01:00
OzoneH3 564608b4ed Dont rain all the time ... 2013-03-21 19:57:24 +01:00
OzoneH3 dce9aa280c Improved rain draw performance on w_terrain window. 2013-03-21 19:55:34 +01:00
OzoneH3 ef18ec7240 Working rain before performance changes. 2013-03-21 19:14:46 +01:00
Ozone d653cbe075 Rain effect based on Tase's code. 2013-03-21 16:38:32 +01:00
Shoes01 fd3f7a6959 Updated changelog 2013-03-20 21:27:14 -07:00
Shoes01 afd356aed7 Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA
Conflicts:
	crafting.cpp
2013-03-20 21:22:15 -07:00
Shoes01 b2139028d5 Cleaned up a few errors 2013-03-20 21:18:47 -07:00
Shoes01 88aa7c694d Tried to add order to the Armor crafting submenu 2013-03-20 21:14:35 -07:00
Shoes01 2df32242fa Added new crafting recipes for clothing added in the body temp mod 2013-03-20 21:04:56 -07:00
Kevin Granade c6488d5533 Alow wider-screen windows. 2013-03-20 22:53:07 -05:00
Kevin Granade 01157afaff Disable eyebot/copbot event from triggering in classic zombie mode. 2013-03-20 22:49:13 -05:00
Shoes01 872a9e4d5b Hunger now affects body temperature 2013-03-20 20:43:15 -07:00
Kevin Granade f63212a7f3 Suppress non-classic monsters and locations if classic zombie mode is enabled. 2013-03-20 22:20:20 -05:00
Kevin Granade b37b2d43d6 Refactor MonsterGroupManager::GetMonsterFromGroup() to allways accept a reference to the mtype vector. 2013-03-20 22:17:34 -05:00
Kevin Granade 7001e762d0 Add classic flag to overmap specials. 2013-03-20 22:15:35 -05:00
Kevin Granade 8099b17219 Add classic zombies option. 2013-03-20 22:13:57 -05:00
Kevin Granade 9d40726f9c Add a category flag to mtypes. 2013-03-20 22:03:02 -05:00
Kevin Granade a02e737bf8 Spelling correction. 2013-03-20 19:05:41 -05:00
Kevin Granade dbe1cabe1c Merge commit 'cababa6' into dda-master
Conflicts:
	overmap.cpp
2013-03-20 18:57:21 -05:00
Kevin Granade afb011bbdc Merge commit 'bc9b0f9' into dda-master
Conflicts:
	crafting.cpp
	itypedef.cpp
2013-03-20 17:43:49 -05:00
TheDarklingWolf 3974ba7c2e Updated changelog 2013-03-20 22:38:20 +00:00
OzoneH3 efe5094f22 TERMX/Y, VIEWX/Y are now global. More centering. 2013-03-20 23:03:39 +01:00
Kevin Granade d9517e4b16 Merge pull request #231 from tasetase/freq
Lowered spider/wolf ratio -> 3%spider, 3%wolf, 2%cougar/bear ~> 15% rabbit
2013-03-20 14:17:05 -07:00
tasetase 820c1da06c Lowered spider/wolf ratio -> 3%spider, 3%wolf, 2%cougar/bear ~> 15% rabbit 2013-03-20 17:11:31 -04:00
benjamg cababa656b update to stop cycling layer data so much 2013-03-20 20:10:04 +00:00
benjamg 40c2dbd67a fix notes display for z-level code 2013-03-20 19:13:53 +00:00
Ben Gray 6f39046ff6 removed unknown function, something I broke during merge I think 2013-03-20 19:07:42 +00:00
Ben Gray 11f561f6c0 fix for merged change not having z-axis data 2013-03-20 19:07:42 +00:00
Ben Gray 45aee52c6f fixed segfault, sped up generation and maps 2013-03-20 19:07:42 +00:00
benjamg 27b9e621cc prefix is filename not directory 2013-03-20 19:06:20 +00:00
benjamg 36a7b5cc4b slight speed up in world generation, and a popup because it takes so long 2013-03-20 19:06:20 +00:00
benjamg b43c60344a shift out mongroups to z-level code, re-add bits that where disabled during switch over 2013-03-20 19:06:20 +00:00
benjamg cd49a620cb switch overmap to full 3d stack 2013-03-20 19:06:20 +00:00
Shoes01 cf5adc89f3 Common cold now make you more tired, which in turn lowers body temp 2013-03-20 10:13:07 -07:00
Shoes01 135ae3e34c Flu makes your head hotter, common cold makes your body colder 2013-03-20 10:02:52 -07:00
Ozone 24fa753a87 Compile fix 2013-03-20 16:59:28 +01:00
Ozone a52647505f Centering and bordering. 2013-03-20 16:16:04 +01:00
Kevin Granade 2780bca908 Fixed ridiculously stupid overmap corruption/crash bug. 2013-03-19 22:20:03 -05:00
delebota bc9b0f9165 Changed snare traps to snare kits. 2013-03-19 20:17:07 -07:00
Kevin Granade cdb7482867 Merge pull request #190 from tasetase/freq
Monster Picker
2013-03-19 19:16:18 -07:00
tasetase 302bfd83a5 Fixed compile issue 2013-03-19 21:55:34 -04:00
tasetase 327e7fd688 Fixed compile issues, removed freq from mtypes 2013-03-19 21:38:47 -04:00
Kevin Granade 71d6c39609 Merge pull request #229 from GlyphGryph/plastic_jug_to_gallon_jug
Plastic jug to gallon jug
2013-03-19 18:15:51 -07:00
tasetase 6957dd9287 Merge remote-tracking branch 'upstream/master' into freq 2013-03-19 21:14:41 -04:00
GlyphGryph b0cf2aa9da Merge branch 'master' into plastic_jug_to_gallon_jug
Conflicts:
	itypedef.cpp
2013-03-19 21:12:45 -04:00
Kevin Granade 71bd83a57c Merge pull request #227 from Shoes01/master
Bionic fix, and a typo
2013-03-19 18:08:51 -07:00
Kevin Granade 3ae68750db Prevent segfault when descending stairs by not dereferencing closest_city when null. 2013-03-19 18:49:54 -05:00
OzoneH3 69348b5791 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-20 00:22:52 +01:00
OzoneH3 a1287cffae Fix for weather segfault. 2013-03-19 23:43:09 +01:00
tasetase 4151851a2e Merge remote-tracking branch 'upstream/master' into freq 2013-03-19 17:51:52 -04:00
tasetase 2952c88461 Added some static spawns to spawns, catching the error when asking for an nonexistant group 2013-03-19 17:48:19 -04:00
TheDarklingWolf 425a1959ee Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-19 17:07:37 +00:00
TheDarklingWolf 571b00efe1 Added toolset to knife group. 'Phew it's hot warm' has been removed.
Palisade gates now require a pulley to open.
2013-03-19 17:06:37 +00:00
Ozone 118fed6c7e Fixed view_offset with hit animation. 2013-03-19 15:56:24 +01:00
Ozone 0715a97bef Added hit animation. Z/Player/Npcs flash with a red background when hit. 2013-03-19 15:24:27 +01:00
TheDarklingWolf 7b10c56331 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-19 10:41:07 +00:00
Ozone d0446e2cf4 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-19 09:42:33 +01:00
Ozone 1b0f619fe5 Merge branch 'master' of https://github.com/OzoneH3/Cataclysm-DDA 2013-03-19 09:42:24 +01:00
Kevin Granade 5e1e0f51ac Add basecamp.cpp and basecamp.h to CataclysmWin.cbp. 2013-03-18 21:46:41 -05:00
Kevin Granade 5cf55368ba Added recipe to make a brazier out of sheet metal. 2013-03-18 20:03:45 -05:00
Kevin Granade 08862e2047 Added recipe to weld scrap metal into sheet metal. 2013-03-18 20:03:16 -05:00
Kevin Granade 8ead5f322c Added sheet metal item. 2013-03-18 20:02:52 -05:00
Kevin Granade 2942bb2535 DOS newline eradication. 2013-03-18 20:02:20 -05:00
Kevin Granade e9b91cd2e7 Merge pull request #120 from benjamg/feature/npc
Can't really be any more broken, right?
Feature/npc
2013-03-18 17:00:05 -07:00
OzoneH3 5ef8bca993 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-19 00:22:42 +01:00
OzoneH3 28c5d7ca1c Centered QUERY_YN Messages 2013-03-19 00:22:30 +01:00
tasetase 5b9f29f114 Merge remote-tracking branch 'upstream/master' into freq 2013-03-18 17:07:35 -04:00
Kyratzes Talvadore c2c91cd3e8 Merge pull request #224 from AreasAside/master
Finished fixing bug preventing containers in the weapon slot from being filled all the way
2013-03-18 11:40:11 -07:00
TheDarklingWolf 92be39a5a6 Increased volume on some items, bear traps are a lot larger now. 2013-03-18 14:02:45 +00:00
AreasAside 8e2ab70b13 Made Player::Has_matching_liquid() check weapon slot.
Removed check in handle liquid that did not allow selection of weapon slot when using a half full container.
2013-03-17 23:03:56 -07:00
GlyphGryph 6c153ff59d Plastic jug renamed to gallon jug, plastic moved to description. 2013-03-18 00:33:30 -04:00
Kevin Granade 8e8936fec4 Fix for teleport duplicating monsters. 2013-03-17 23:22:00 -05:00
delebota 92f53a7e44 Implemented light and heavy snares. 2013-03-17 21:12:52 -07:00
Shoes01 18fe671cb3 Made Internal Climate Control bionic actually draw power 2013-03-17 17:14:44 -07:00
Shoes01 0c550d9b8a Sunny and clear weather now warm the player 2013-03-17 17:06:53 -07:00
Shoes01 74a3440d99 Made the Internal Temp bionic consume power, and tweaked its behaviour 2013-03-17 16:50:36 -07:00
Kyratzes Talvadore 9dacb424b5 Merge pull request #221 from areasaside/master
Fixed bug where you can't fill wielded bottles
2013-03-17 14:22:32 -07:00
Kyratzes Talvadore c71c78369f Merge pull request #220 from GlyphGryph/carboy_name_change
Changed carboy to the more generally understood term 'jug'
2013-03-17 14:20:32 -07:00
TheDarklingWolf 66bd79dd1a Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-17 21:18:53 +00:00
TheDarklingWolf d9b1fb9bcc String and rope no longer choppable. Closes #222 2013-03-17 21:17:59 +00:00
tasetase a1dee9955f Changed from map.at() to map.find() for C++98 compatibility 2013-03-17 16:22:40 -04:00
AreasAside 299babe8ea Make player::has_watertight_container() check weapon slot as well as inventory 2013-03-17 13:07:24 -07:00
tasetase df1b04a7f6 Implemented loading monster groups from JSON 2013-03-17 15:42:07 -04:00
Kevin Granade 00e504625f Prevent monsters with no path from following us down stairs. Fix contributed by Uronym. 2013-03-17 11:15:41 -05:00
GlyphGryph 2f86bfda3e Changed carboy to the more generally understood term 'jug' 2013-03-17 12:09:14 -04:00
tasetase 9a12e6cad1 Merge remote-tracking branch 'upstream/master' into freq
Conflicts:
	overmap.cpp
2013-03-17 11:40:14 -04:00
tasetase fd2c9b0bd7 Balanced the group freq numbers to reflect the old numbers 2013-03-17 02:14:14 -04:00
Shoes01 f5aedbdcd9 Fixed formatting issue with help display 2013-03-16 23:32:45 -03:00
TheDarklingWolf 87729d039a Added 'Dark Days Ahead' to app window, will be adding version numbers when applicable. 2013-03-16 23:48:35 +00:00
Kevin Granade 955c2c59c0 Center forest monsgroups in the overmap. 2013-03-16 16:03:46 -05:00
Kevin Granade bdae1a67f9 Make diffuse mongroups use rl_dist() for distance calculation so they can tile. 2013-03-16 16:03:45 -05:00
Kyratzes Talvadore 1ee86e0eea Merge pull request #218 from fs0/master
Missing brackets in newcharacter.cpp
2013-03-16 13:58:58 -07:00
fs0 ec879b274d Added missing brackets. 2013-03-16 21:15:40 +01:00
tasetase d66d2ceb22 Implemented consideration for difficulty when picking a monster 2013-03-16 14:53:16 -04:00
OzoneH3 475327ae44 Main menu tweaks, hjkl readded to navigate, changed c_blue to c_white for readabililty.
Centerd bionic screen.
2013-03-16 19:48:58 +01:00
OzoneH3 b370b56752 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-16 10:04:15 +01:00
OzoneH3 43ed5a9231 Added new file main_menu.cpp to CataclysmWin.cbp 2013-03-16 10:03:42 +01:00
OzoneH3 a5f17a3856 Merge pull request #216 from fs0/master
Exit status of game
2013-03-16 01:46:38 -07:00
fs0 73c03f8718 Changed exit status of program to successful. 2013-03-16 09:35:17 +01:00
tasetase 14fe5baf3b Fixed mistake with GetMonsterFromGroup 2013-03-15 23:51:01 -04:00
tasetase 67282a877c Merge remote-tracking branch 'upstream/master' into freq 2013-03-15 22:00:52 -04:00
tasetase ec44ef2615 Removed deprec comments, removed redudant namespace::, comment 2013-03-15 22:00:20 -04:00
tasetase 9e3e9048ce Finished removing moncat_id 2013-03-15 21:48:11 -04:00
OzoneH3 aa3fa883fb Main menu fixes. Crafting and Construction centered. 2013-03-16 00:43:19 +01:00
OzoneH3 07dd527d86 Missing file.... 2013-03-15 23:13:38 +01:00
OzoneH3 b0642d21da Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-15 19:09:53 +01:00
OzoneH3 906ad34a79 Reworked main menu. 2013-03-15 19:08:10 +01:00
TheDarklingWolf 8d86aeae2f Added fur to waterskins, because it's basically leather anyway. 2013-03-15 17:44:37 +00:00
TheDarklingWolf f198557e55 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-15 16:54:54 +00:00
Kyratzes Talvadore 35d3036274 Merge pull request #213 from fs0/master
spelling error in pldata.h
2013-03-15 09:52:06 -07:00
fs0 70078c38de Fixed spelling error: received 2013-03-15 17:37:05 +01:00
TheDarklingWolf f00e5f12ab Add toolset to primitive crafts. Also made the needle use the knives toolgroup. 2013-03-15 16:29:14 +00:00
TheDarklingWolf 77d54138c7 Fixed reinforced tag on fitted boots. You can now discard unwanted skillpoints at chargen 2013-03-15 16:28:11 +00:00
OzoneH3 8962523424 Merge pull request #212 from Shoes01/master
Bodytemp code moved to player.cpp
2013-03-15 02:25:59 -07:00
Shoes01 d3a06a62ce Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA 2013-03-15 06:13:17 -07:00
OzoneH3 81d3238f1e Merge pull request #209 from iank/kill_screen
View kill stats in-game
2013-03-15 01:54:07 -07:00
OzoneH3 83a6d67712 Merge pull request #211 from Catacstone/human_meat_morale
Cannibalism-induced morale status shift fix
2013-03-15 01:53:00 -07:00
OzoneH3 e1f647975a Merge pull request #210 from tasetase/quickfix
Quick fix for windows size
2013-03-15 01:50:35 -07:00
Matias Oksa e2d43e847f Cannibalism-induced morale status shift fix 2013-03-15 10:35:35 +02:00
tasetase 8b415041cf Quick fix for windows size 2013-03-14 23:44:46 -04:00
tasetase 909b0bab41 Phasing out moncat_id, need to fix up valid_group though 2013-03-14 23:41:37 -04:00
tasetase 385578aa13 Merge branch 'freq' of https://github.com/tasetase/DDAtase into freq 2013-03-14 23:39:08 -04:00
tasetase ed8da91310 Merge remote-tracking branch 'upstream/master' into freq 2013-03-14 23:37:51 -04:00
Your Name 5b8c8348b4 Proper terminal dimensions for death screen 2013-03-14 20:35:09 -04:00
Your Name 036915d312 View kill stats in-game
Someone already wrote this disp_kills routine, but it was dead code;
I deduplicated the end-game kill stats screen and bound it to a key:
')' by default.
2013-03-14 20:33:30 -04:00
OzoneH3 7a2a8673eb Centered Help and Options menu and added a border. 2013-03-15 00:12:58 +01:00
tasetase 04f68fa933 Merge remote-tracking branch 'upstream/master' into freq 2013-03-14 17:43:07 -04:00
OzoneH3 3d98b24ad1 Spelling fix: Taekwondo 2013-03-14 20:54:07 +01:00
OzoneH3 f30d7508ba Minor Tweaks: Support larger terminals automatically
Make sure Terrain width/height are uneven
Readded windows viewport options
2013-03-14 20:29:32 +01:00
OzoneH3 9eeb13ebb6 Merge pull request #193 from iank/terminal_size
Support larger terminals automatically
2013-03-14 12:16:41 -07:00
Kyratzes Talvadore b332515852 Merge pull request #206 from jbfink/spelling-fix
spelling fix in iuse.cpp
2013-03-14 11:55:33 -07:00
jbfink cc34401443 spelling fix in iuse.cpp 2013-03-14 14:06:13 -04:00
Shoes01 940aad4da8 Long underwear no longer have storage 2013-03-13 21:17:05 -07:00
Shoes01 628db6bbbb Moved bodytemp code to player.cpp and uncommented update_bodytemp 2013-03-13 21:16:33 -07:00
Kevin Granade 1634bd27bc Merge pull request #202 from Catacstone/lockpick_breakage
Lockpicks break more properly now
2013-03-13 17:48:50 -07:00
Kevin Granade f6db41d585 Merge pull request #199 from Catacstone/hospital_map
Hospital maps
2013-03-13 17:47:51 -07:00
Matias Oksa 8409ca7f5d Unneeded i_rem removal 2013-03-14 01:32:51 +02:00
tasetase 2cf82462cd Merge remote-tracking branch 'upstream/master' into freq 2013-03-13 19:22:23 -04:00
Matias Oksa d998849df6 Lockpicks break more properly now 2013-03-14 01:16:22 +02:00
Matias Oksa ff333bd338 Hospital maps 2013-03-14 00:17:49 +02:00
TheDarklingWolf 96f94ac469 Fixed cake spawn 2013-03-13 21:09:14 +00:00
TheDarklingWolf a48333bb65 Added cake, some new weapons, replaced Heartless with cannibal, new
morale penalty for eating human meat.
2013-03-13 21:05:32 +00:00
TheDarklingWolf 7a41e104f1 More changelog, updated makefile version number 2013-03-13 12:31:59 +00:00
TheDarklingWolf 3d40c714e1 Added a changelog 2013-03-13 12:30:01 +00:00
TheDarklingWolf 5bed383cd1 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-13 12:21:58 +00:00
TheDarklingWolf 3845a064df Moved templates back to data folder.
Having them in the save folder prevented some problems with carrying
over to new versions yes, but it was also incredibly annoying to use
templates if you also wanted to use the 'delete world on save' option.
2013-03-13 12:20:44 +00:00
Kyratzes Talvadore 591b2fcf9b Merge pull request #201 from Catacstone/mxdrugdeal_freeze
Drugdeal generation freeze fix
2013-03-13 05:09:03 -07:00
TheDarklingWolf bb40c17753 Change (hot) to (fresh) on newly generated items. 2013-03-13 12:06:41 +00:00
Matias Oksa 6f316a6bbd Drugdeal generation freeze fix 2013-03-13 12:14:15 +02:00
tasetase ab6b4df9ba Fixed compile issue 2013-03-12 21:26:05 -04:00
TheDarklingWolf ad250e1cb4 Fixed an error in waterskin crafting, Reworked some skill costs 2013-03-13 01:01:40 +00:00
TheDarklingWolf 066363d904 Fixed duplicate bashable flag 2013-03-13 00:35:07 +00:00
tasetase e463a42c40 Removed moncat_id and replaced it by MonsterGroupType, did relevant changes to the code that used moncat_id to preserve logic (minus limiting spawn when its early game) 2013-03-12 20:32:25 -04:00
TheDarklingWolf 530585d725 Zombies bash curtained windows, waterskins craftable. Text overlap on
stats probably fixed.
2013-03-13 00:28:43 +00:00
TheDarklingWolf 415d7f75db Craftable rock pots 2013-03-13 00:19:09 +00:00
TheDarklingWolf 9691da5377 Sinks no longer count as water sources 2013-03-12 23:03:53 +00:00
TheDarklingWolf ac9816977c Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-12 21:37:23 +00:00
Kyratzes Talvadore 4a80ed6754 Merge pull request #198 from Catacstone/npc_talk_fix
Npc training talk fix
2013-03-12 14:36:53 -07:00
tasetase 355fe913f5 Merge remote-tracking branch 'upstream/master' into freq 2013-03-12 17:17:26 -04:00
TheDarklingWolf 72b4356c94 Updated credits 2013-03-12 21:04:12 +00:00
Matias Oksa eb5c1f5f62 Npc training talk fix 2013-03-12 22:06:32 +02:00
OzoneH3 66272d36c6 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-12 21:06:07 +01:00
OzoneH3 bf2771ed03 Windows redraw fixes. 2013-03-12 21:05:53 +01:00
TheDarklingWolf 82d1ab26db Fixed error with blades in knife spears. Also added meat soup 2013-03-12 20:02:17 +00:00
TheDarklingWolf 42057ca65d Fixed read time being displayed when selecting perception. Normalized
amount of flammable stuff required for a molotov
2013-03-12 18:55:33 +00:00
TheDarklingWolf 07c29fec7c Added block to a few more items. Steel spear is named knife spear, is
crafted with a spike rather than a knife. Steak knives can now be
disassembled '(' for a spike.
2013-03-12 18:45:20 +00:00
TheDarklingWolf a7e5c27af1 Added weak block to nailbats, forgot to include it when adding them 2013-03-12 18:13:21 +00:00
TheDarklingWolf 144cf834cb Add weak block to makeshift machete and broadsword 2013-03-12 18:05:37 +00:00
Your Name bdd8968739 Simplify the terminal size/layout logic 2013-03-12 13:11:01 -04:00
TheDarklingWolf 66a6a82290 Fixed firstaid and bandages. 2013-03-12 16:08:12 +00:00
TheDarklingWolf 70ced9eded Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-12 11:22:06 +00:00
TheDarklingWolf 843865e72e Lawnmower blades are now generic blade items, lawnmower stuff has been
renamed to makeshift
2013-03-12 11:21:45 +00:00
Ozone f73cc83545 Inventory: Separated medicine/drugs from food/drinks 2013-03-12 12:04:11 +01:00
Your Name 350901b44b Support larger terminals automatically
On POSIX systems, determine the main window layout based on the terminal
size at startup; Hardcoded window positioning has been replaced with a
layout which is a function of terminal size. (This is a stepping stone
for a resizable window in-game).

On Windows systems, layout is still determined via 'Viewport size'
options; This patch should be simple to adapt for windows but I am
unable to test on that platform.
2013-03-11 21:42:00 -04:00
Kevin Granade 3a7033f76b Optimize caching the per-square is_outside data for the lightmap code, and it works this time. 2013-03-11 19:29:21 -05:00
Kevin Granade b9e92f09a0 Merge pull request #192 from shmup/master
Dirt floors no longer considered outside.
2013-03-11 17:11:37 -07:00
Jared Miller 76d5c16478 added dirtfloor to be excluded from outside 2013-03-11 20:06:30 -04:00
tasetase 4cac9e7c81 Took the frequencies from mtypedef.cpp and put them in mongroupdef.ccp. Needs balancing (ps: file as accidentally pushed with the merge 0cca91b7f3 ) 2013-03-11 19:45:35 -04:00
tasetase c25c69803a Merge remote-tracking branch 'upstream/master' into freq 2013-03-11 19:34:29 -04:00
tasetase 108a54f56a Merge branch 'freq' of https://github.com/tasetase/DDAtase into freq 2013-03-11 19:32:54 -04:00
tasetase 0cca91b7f3 Merge remote-tracking branch 'upstream/master' into freq 2013-03-11 19:31:06 -04:00
TheDarklingWolf b9b47504f8 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-11 19:54:27 +00:00
TheDarklingWolf be9f6d859c String crafting no longer needs knife, bone needle is usable for sewing.
Fur is no longer wool. Blade traps use generic blades
2013-03-11 18:33:05 +00:00
Kyratzes Talvadore 24d5eaafb0 Merge pull request #187 from Catacstone/pour_q
Handling them liquids like a boss
2013-03-11 11:23:46 -07:00
Matias Oksa 3d0970527a Handling them liquids like a boss 2013-03-11 20:18:52 +02:00
Kyratzes Talvadore d7c13c7e3a Merge pull request #182 from ZwodahS/master
Added function for recrafting the last crafted recipe.
2013-03-11 10:03:53 -07:00
Kyratzes Talvadore e39fd9465b Merge pull request #185 from Catacstone/woodbolt
Wood bolt recipe missing a -1 on hatchet, reported by rubybrowncoat
2013-03-11 10:03:11 -07:00
Eric Ng(ZwodahS) 21690874c7 remove debug msg 2013-03-12 00:38:13 +08:00
Matias Oksa f0019e2561 Wood bolt recipe missing a -1 on hatchet 2013-03-11 17:59:51 +02:00
Eric Ng(ZwodahS) 03e0d1b172 Added functionality for crafting last used recipe.
This will be useful for spear crafting, clean water etc.

The action is defined as ACTION_RECRAFT in action.h
2013-03-11 20:26:07 +08:00
OzoneH3 49da6a0997 Merge pull request #181 from shmup/master
Added a sledge hammer to the boarding up recipes
2013-03-11 03:40:41 -07:00
OzoneH3 fc16dfd922 Center main menu and character creation with bigger viewport. 2013-03-11 11:34:18 +01:00
Jared Miller 2e96cf6647 use a sledge hammer for boarding up. finesse not required, like for building 2013-03-10 22:54:14 -04:00
tasetase 0723b5ab55 Merge remote-tracking branch 'upstream/master' into freq 2013-03-10 22:40:47 -04:00
Kevin Granade 6fa5064b70 Increase tool and component cap on recipes still further. 2013-03-10 20:05:19 -05:00
Matias Oksa dfbeab6757 Tool group macro (for knives)
Conflicts:

	crafting.cpp
2013-03-10 19:57:00 -05:00
Matias Oksa b9cbd5e2c7 SkillLevel breaks an apple; no biggie 2013-03-10 19:50:20 -05:00
Kevin Granade d09b597150 Add a cast to force a SlillLevel object to convert to int before passing to mwvprintz() so macs don't barf on it. Reported by Livingstone. 2013-03-10 19:23:23 -05:00
Kevin Granade cd44921c16 Clean up the last places using level() unnecessaraly. 2013-03-10 18:41:35 -05:00
Kyratzes Talvadore ed1bec2c52 Merge pull request #180 from GlyphGryph/ignorant_to_self_aware
Ignorant to self aware
2013-03-10 16:32:24 -07:00
GlyphGryph 7b50b3d805 Merge branch 'master' into ignorant_to_self_aware
Conflicts:
	iuse.cpp
2013-03-10 19:08:10 -04:00
OzoneH3 10856ca3d6 Merge pull request #178 from OzoneH3/master
Expand item information with viewport. Moved Tools under Weapons, new category Mods/Bionics. Reworked start menu.
2013-03-10 16:03:02 -07:00
OzoneH3 20ae644b88 Update after merge. 2013-03-11 00:01:58 +01:00
OzoneH3 2c632622da Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA
Conflicts:
	newcharacter.cpp
2013-03-10 23:53:30 +01:00
OzoneH3 60f7d9e702 Main menu style rework. 2013-03-10 23:47:17 +01:00
GlyphGryph b58b9fd56c HP Ignorant has been removed in favour of Self-Aware, a perk that allows you to see your health, which you no longer can be default 2013-03-10 18:34:11 -04:00
Kyratzes Talvadore 148b0781ba Merge pull request #179 from GlyphGryph/child_drops
Child zombies now drop a variety of child-appropriate items.
2013-03-10 14:44:31 -07:00
tasetase a9ad73a22f Moved the monster picker code to mongroupdef.cpp, fixed up a few other loose ends 2013-03-10 17:19:11 -04:00
OzoneH3 a71b3290ea Added borders to the character creation screen 2013-03-10 21:49:46 +01:00
tasetase ee9c09bea0 Typos, indentation 2013-03-10 15:46:03 -04:00
GlyphGryph 893b845e17 Child zombies now drop a variety of child-appropriate items. 2013-03-10 15:43:22 -04:00
tasetase 401d80f2f8 Spawn frequency and spawn group rewrite: The start 2013-03-10 15:37:06 -04:00
Kevin Granade 788a521230 Streamline skillLevel api since requesting level of skill is so common. 2013-03-10 14:31:06 -05:00
Kevin Granade ba500fc7c1 Make SkillLevel class act like a raw level by default. 2013-03-10 14:31:06 -05:00
Kevin Granade 390d7549b5 Add a ctags target to the makefile. 2013-03-10 14:31:06 -05:00
OzoneH3 22ca702c20 Clear whole screen if gameover or safed. 2013-03-10 20:26:23 +01:00
OzoneH3 aaa3e3e4bf Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-10 20:11:30 +01:00
OzoneH3 6528fe7ece Expand item information with viewport. Moved Tools under Weapons, new category Mods/Bionics. 2013-03-10 20:09:53 +01:00
TheDarklingWolf 3793c8ba29 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-10 18:17:15 +00:00
TheDarklingWolf 69ab1529e0 Remove Shia 2013-03-10 18:17:04 +00:00
Kyratzes Talvadore 5f4bbd7142 Merge pull request #176 from Voker57/tweaks
Use pocket knife for wood arrows
2013-03-10 10:21:58 -07:00
Voker57 dd73fd389d Use pocket knife for wood arrows 2013-03-10 16:54:07 +04:00
benjamg 575ea5483e Merge branch 'master' into feature/npc 2013-03-10 08:51:17 +00:00
Kevin Granade b667bd1f77 Add newline at end of file. Reported by aapo. 2013-03-09 21:21:29 -06:00
Kevin Granade 3396b74a85 Merge pull request #174 from OzoneH3/master
Destroy picklock kit when its damaged 5 times.
2013-03-09 19:16:09 -08:00
Kevin Granade 48c7535247 Double regular zombie spawns with a terrible hack to make regular zombies far more frequent. 2013-03-09 21:02:18 -06:00
Kevin Granade 5d27eebc1f Rebalance zombie frequencies to make the new static spawn system playable. 2013-03-09 21:02:18 -06:00
TheDarklingWolf 71f9f6674b Shia is no longer abundant 2013-03-09 23:55:28 +00:00
Kevin Granade d062ab5404 Center lightmap cache generation on player so it doesn't shift when you move the view. 2013-03-09 17:27:32 -06:00
Kevin Granade 51538fc5e9 Base determination of whether a tile is outside on g_light_level instead of natural_light_level. 2013-03-09 17:27:32 -06:00
OzoneH3 8fb5457a28 Destroy picklock kit when its damaged 5 times. 2013-03-09 23:16:48 +01:00
TheDarklingWolf 3d811b954c Chitinous boots and gauntlets. 2013-03-09 19:32:59 +00:00
TheDarklingWolf c5cad472af Reinforced tag is now applied to winter boots and rain coats. Fixed crafting.cpp error. 2013-03-09 18:57:33 +00:00
TheDarklingWolf ddd8e40cd6 Bumped alcohol required for torches and bandages to 7, added gin and triple-sec to recipes 2013-03-09 18:47:08 +00:00
TheDarklingWolf f8de31d231 Fixed broken crafting recipes for primitive tools 2013-03-09 17:19:18 +00:00
TheDarklingWolf 725899213d Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-09 16:46:52 +00:00
TheDarklingWolf 152c8fc007 Fixed itype order again. 2013-03-09 16:46:21 +00:00
Kyratzes Talvadore 0f3d352b36 Merge pull request #173 from OzoneH3/master
Moved templates to save folder. Construction fix.
2013-03-09 06:01:27 -08:00
OzoneH3 bbb256a7ef Construction fix. 2013-03-09 14:57:33 +01:00
TheDarklingWolf ac122d7736 Craftable shovels, hammers and axes. Not yet added to crafting recipes. 2013-03-09 13:42:16 +00:00
TheDarklingWolf 2798584420 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-09 12:41:49 +00:00
OzoneH3 8640ec6c2a Moved templates to save folder. 2013-03-09 11:14:37 +01:00
Kevin Granade 23960c9121 typo in MF_NO_BREATHE flag. 2013-03-08 23:02:37 -06:00
Kevin Granade fe30293baa Merge pull request #170 from GlyphGryph/shocker_changes
Added the ability to recover CBMs from butchered shocker zombies.
2013-03-08 20:55:34 -08:00
GlyphGryph 8f8901af86 Merge branch 'master' into shocker_changes
Conflicts:
	mtypedef.cpp
2013-03-08 22:39:37 -05:00
Kevin Granade 4100fd7acc Make robot drops make more sense. Posted on the forums by Sorenson. 2013-03-08 21:01:44 -06:00
Kevin Granade 5c012275b1 More line-ending cleanups. 2013-03-08 20:41:56 -06:00
Kevin Granade d15ce938be Merge pull request #169 from GlyphGryph/add_smokers
Added smoker zombie, and fixed several field-related bugs.
2013-03-08 18:40:44 -08:00
GlyphGryph 110cbcc316 Added the ability to recover CBMs from butchered shocker zombies. 2013-03-08 21:23:59 -05:00
GlyphGryph f4a88cbb3d Added smoker zombie, and fixed several field-related bugs.
Fields now properly hide monsters.
The debug monster spawn now works correctly.
Smoke no longer freezes monsters.
Added a no_breathe tag for monsters that shouldn't be slowed at all.
2013-03-08 21:03:11 -05:00
Kevin Granade 6587278dae Prune uninformative comment label clutter. 2013-03-08 19:55:19 -06:00
Kevin Granade e2635c68a3 Prune dos-style newlines. 2013-03-08 19:52:06 -06:00
Kevin Granade a09ecc0084 Merge pull request #165 from OzoneH3/master
Stretch construchtion menu with viewport. Runmode fix.
2013-03-08 17:43:09 -08:00
OzoneH3 260c62460b Fix construction, weird jumpy menu selection 2013-03-09 00:50:19 +01:00
OzoneH3 1c37f8bbac Construction menu, coloring and redraw tweaks. 2013-03-08 23:15:47 +01:00
OzoneH3 175d341be7 Pritified crafting window a little bit. 2013-03-08 22:23:22 +01:00
TheDarklingWolf 14a38c1b71 Javelins added, basically an upgraded wooden spear. 2013-03-08 19:30:33 +00:00
TheDarklingWolf a0ebbdfd1d Rag and leather pouches, low level easily craftable storage items 2013-03-08 19:02:46 +00:00
OzoneH3 3a4d0ff178 Failed to remove a line. 2013-03-08 18:46:52 +01:00
OzoneH3 ad8a92485c Removed redundant if 2013-03-08 18:43:33 +01:00
OzoneH3 39acf5227a Safemode dont stop for squirrels 2013-03-08 18:41:28 +01:00
OzoneH3 89b1a6994a Safemode on even if monster dosent see you. 2013-03-08 18:40:03 +01:00
TheDarklingWolf ffbbea7f80 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-08 17:30:44 +00:00
OzoneH3 51857ba693 Run mode fix. 2013-03-08 18:20:56 +01:00
OzoneH3 227f604542 Stretch construchtion screen with new viewport. 2013-03-08 18:13:53 +01:00
TheDarklingWolf 7f73dffd85 Added bone needle, reloads with thread, sinew or fibre.
Sinews and fibres transform into thread when unloaded, will look into fixing later.
2013-03-08 14:53:39 +00:00
Kyratzes Talvadore 9ff1a070c0 Merge pull request #164 from OzoneH3/master
Fixed credits  freeze
2013-03-08 06:32:40 -08:00
OzoneH3 6fe0356212 Fixed credits freeze 2013-03-08 15:29:30 +01:00
TheDarklingWolf 9de9034966 Added sinews and bones, restored starting inventory. 2013-03-08 14:19:06 +00:00
Kyratzes Talvadore 54e340dd17 Merge pull request #163 from OzoneH3/master
Main Menu fix for windows, clear all lines before drawing menu
2013-03-08 05:35:49 -08:00
OzoneH3 f5abd4eeaa Main Menu fix for windows, clear all lines before drawing menu 2013-03-08 14:31:43 +01:00
OzoneH3 2a94ce9f17 Merge branch 'master' of https://github.com/OzoneH3/Cataclysm-DDA 2013-03-08 14:11:49 +01:00
OzoneH3 89b51ad59b Wake up if infected wound gets worse, dont just die while sleeping. 2013-03-08 13:13:04 +01:00
Kyratzes Talvadore c4edd0006f Merge pull request #162 from OzoneH3/master
Added start menu credits section, added new features/options to motd
2013-03-08 04:00:33 -08:00
OzoneH3 cb96ece6c9 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-08 12:23:14 +01:00
OzoneH3 c627c8f662 Added start menu credits section, added new features/options to motd 2013-03-08 12:21:59 +01:00
Kevin Granade 518e3be120 Merge pull request #160 from tasetase/dda
Added option to select starting time of day at character creation
2013-03-07 19:59:23 -08:00
Kevin Granade 887bdabd58 Merge pull request #149 from elricsfate/patch-1
Added message to the Evac Shelter Terminal
2013-03-07 19:51:27 -08:00
Robert T 1fff48a4ba Modified Message Text
Added line

  5. AWAIT FURTHER INSTRUCTIONS \n\
2013-03-07 21:48:53 -06:00
Kevin Granade 2e5b68db95 Fix a typo, thanks TheGherkin and lumikant. 2013-03-07 21:31:49 -06:00
Kevin Granade 3f108d12ab Add a splash of color to drug deals. 2013-03-07 21:28:15 -06:00
tasetase f2b769cf20 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA into dda
Conflicts:
	help.cpp
2013-03-07 22:03:46 -05:00
Robert T 72ea78d830 Moved Case and fixed syntax
Moved case from activate_failure section to activate_feature section and corrected syntax on case statement.
2013-03-07 20:57:33 -06:00
Kevin Granade 73d1bb6888 Correct description of static spawn option, thanks to aapo for reporting. 2013-03-07 20:07:00 -06:00
Kevin Granade 520d684b3d Merge pull request #153 from OzoneH3/master
Reworked playerinfo to strech with new viewport and added a fancy border
2013-03-07 17:55:03 -08:00
tasetase ea23972d44 Added default value for starting time in option array init 2013-03-07 19:53:37 -05:00
Kevin Granade 284d56f187 Correct offset passed into lightmap::is_outside() since it gets LIGHTMAP_RANGE_XY added already. 2013-03-07 18:19:42 -06:00
tasetase 93391f297b Added option to select starting time of day at character creation 2013-03-07 17:33:20 -05:00
OzoneH3 46f465e81c Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-07 17:51:20 +01:00
OzoneH3 de47aee9d8 Added Options menu to start menu, updated motd with new links 2013-03-07 17:11:31 +01:00
Kevin Granade 8d748d19ab Revert specialized outside caching code. 2013-03-06 22:40:45 -06:00
Shoes01 5fa487221a Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA 2013-03-06 16:43:52 -08:00
Robert T ee780a47d3 Moved COMPACT_EMERG_MESS case and removed white sp
Moved COMPACT_EMERG_MESS case to end of cases and removed white space that was introduced.
2013-03-06 15:22:49 -06:00
Robert T 8c7776122b Added COMPACT_EMERG_MESS to computer_action list 2013-03-06 15:13:06 -06:00
Kevin Granade 11e1f8bd40 Merge pull request #150 from Shoes01/master
The display for bodytemp on the HUD is wrong
2013-03-06 13:09:30 -08:00
Robert T 535f899210 Removed "this" from evac shelter add_computer 2013-03-06 15:07:24 -06:00
Robert T 511c880592 Added option to see emergency message
Added option to see emergency message on Evac Shelter computer
2013-03-06 15:04:20 -06:00
Robert T d91fa792a1 Moved Evac Terminal Message to a "case" 2013-03-06 14:33:28 -06:00
Robert T 73fcddf77e Closed Parentheses
Error in print. Corrected
2013-03-06 13:07:20 -06:00
Robert T b2896165e0 Added message to the Evac Shelter Terminal
Added a message when the Evac Shelter Terminal is examined by the player.

**CORRECTION TO CODE**
2013-03-06 12:51:31 -06:00
OzoneH3 25d88a03fc Fixed mon_info() to work with the new monster view ranges
Only color compas monster direction red if a monster spotted you
2013-03-06 18:18:45 +01:00
OzoneH3 81e551386c Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-06 17:23:25 +01:00
OzoneH3 3fda0abf2c Player info menu, set smalest window height to 25 2013-03-06 16:20:53 +01:00
OzoneH3 fe0904b318 Reworked playerinfo to strech with new viewport, now with the right file -.- 2013-03-06 15:47:23 +01:00
OzoneH3 897c8f0842 Refresh terrain after comparing items from list_items 2013-03-06 15:46:31 +01:00
OzoneH3 47f3501a4b Reworked playerinfo to strech with new viewport 2013-03-06 15:35:48 +01:00
Zach Morgan 0dc6c57e16 taking ui initialization out of game constructor. 2013-03-06 07:45:43 -05:00
OzoneH3 2fed5e80c8 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-06 10:32:52 +01:00
OzoneH3 2ab4fb70cb Merge branch 'master' of https://github.com/OzoneH3/Cataclysm-DDA 2013-03-06 10:32:42 +01:00
Kevin Granade 0512166a36 Reduce sight range of monsters, based on code by Oddzballs. 2013-03-05 21:39:18 -06:00
Kevin Granade fa60ef508d Add vision reduction flags to various monsters. 2013-03-05 21:24:53 -06:00
Owen Diamond 5c48a63e97 Add monster flags to adjust vision range. 2013-03-05 21:14:59 -06:00
Owen Diamond 80a85f638e Adjusted 2013-03-05 20:07:15 -06:00
Owen Diamond 61331e360a Curing infection and bite wounds, also added a recovery phase.
Conflicts:

	iuse.cpp
	iuse.h
2013-03-05 19:54:59 -06:00
Owen Diamond 542abb8bb5 Bite and infection done.
Conflicts:

	iuse.cpp
2013-03-05 19:52:35 -06:00
Kevin Granade b3cdab96f4 Setup mobs with bite attack, changed bleeding slightly.
Conflicts:

	mtypedef.cpp
2013-03-05 19:35:54 -06:00
Kevin Granade eec1207a50 Added Bite wound and infection
Conflicts:

	disease.cpp
2013-03-05 19:26:13 -06:00
Owen Diamond c6dff4a2e6 Declared DI_BITE and DI_INFECTED
Conflicts:

	pldata.h
2013-03-05 19:24:09 -06:00
Owen Diamond 6283e22c3e Bite attack coded in.
Conflicts:

	mtypedef.cpp
2013-03-05 19:12:32 -06:00
Owen Diamond 90d7579b21 Fixed axe spelling 2013-03-05 18:49:48 -06:00
Kevin Granade 60fadbf6eb Added crows, fixed typo, made friendly animals attack zombies
Conflicts:

	mongroupdef.cpp
2013-03-05 18:49:48 -06:00
OzoneH3 05a7199b00 Unfinished playerinfo rework 2013-03-06 00:13:42 +01:00
Robert T 0eccf31d43 Added message to the Evac Shelter Terminal
Added a message when the Evac Shelter Terminal is examined by the player.
2013-03-05 15:52:38 -06:00
TheDarklingWolf 4f8722f5b8 Removed the butter. I'm watching my weight! 2013-03-05 19:41:52 +00:00
TheDarklingWolf 8666490d6a Fix crowbars 2013-03-05 16:55:13 +00:00
TheDarklingWolf faa50819eb Messed with pocketknife stats, fixed email bug 2013-03-05 16:05:00 +00:00
Kyratzes Talvadore eb63d39865 Merge pull request #145 from OzoneH3/master
Added magacine for archery, added guns and ammo to magazine group
2013-03-05 03:05:31 -08:00
OzoneH3 536f15a8d9 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-05 11:49:28 +01:00
Kevin Granade dc8b9831c0 Make static or dynamic zombie spawning an option. 2013-03-04 21:32:11 -06:00
Kevin Granade 24e27d36ec Add some comments to new option flags. 2013-03-04 21:32:11 -06:00
Kevin Granade dda2e5dd1e Give zombie groups a major bump. 2013-03-04 21:32:11 -06:00
Kevin Granade d45ea8f7a3 Make zombie population density fall off exponentially with distance from city centers. 2013-03-04 21:32:11 -06:00
Kevin Granade 6f110e4ea3 Make staticly spawned monsters generate a new spawn at their current location when despawning instead of warping back to their origin. 2013-03-04 21:32:11 -06:00
Kevin Granade d974fa4882 Centralize the monster despawn logic in a single method. 2013-03-04 21:32:11 -06:00
Kevin Granade 9801da51cf Make spawns dencer at the center of towns. 2013-03-04 21:30:58 -06:00
Kevin Granade 3bab8dfe98 Replace the city mongroup with static spawns of zombies scattered about. 2013-03-04 21:30:58 -06:00
Kevin Granade 3ff88c4736 Give lockpicking and prying open alarmed doors have a chance of setting off alarms. 2013-03-04 19:40:03 -06:00
Kevin Granade 7bdbc9e0ae Make picking a lock unlock the door instead of also opening it. 2013-03-04 19:11:20 -06:00
Kevin Granade 0cb3aeaa52 Factor mechancs skill in to lockpicking and door forcing. 2013-03-04 18:52:32 -06:00
Kevin Granade 5fdfb2b17f Refactor crowbar code to repeat itself less. 2013-03-04 18:52:32 -06:00
Kevin Granade 39700a7fff Make the rest of the esged weapons ueable as cutting tools. 2013-03-04 18:52:32 -06:00
Kevin Granade 39b8738184 Add varable strength requirements for moving different furniture types. 2013-03-04 18:52:32 -06:00
Kevin Granade 8b1ca73225 Refactor lockpicking code to not repeat itself so much. 2013-03-04 18:52:31 -06:00
Kevin Granade 0d41c95353 Add message indicating failure to pick a lock. 2013-03-04 18:52:31 -06:00
Kevin Granade 92fefb6adf Make lockpicking and forcing doors take time whether it works or not. 2013-03-04 18:52:31 -06:00
TheDarklingWolf 64ba80026f Cots no longer prompt a warning 2013-03-04 17:41:56 +00:00
TheDarklingWolf 1aa6ded393 Added a 3in string to 50 thread recipe. All rope disassembly is handled via the disassembly key. 2013-03-04 17:34:35 +00:00
TheDarklingWolf eaf3536c6e Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-04 17:09:17 +00:00
TheDarklingWolf 81338012a5 Updated rollmat description to make it more descriptive. 2013-03-04 17:08:43 +00:00
OzoneH3 03f6184a71 Updated list_items to not redraw terrain if it isnt absolutley needed 2013-03-04 15:11:55 +01:00
OzoneH3 7676b07cb6 Added possibility to Takeoff the weapon
It is possible, to (w)ield and press '-' to take off the weaopn, but how should anyone know that?!
2013-03-04 12:59:10 +01:00
OzoneH3 bd33a5738d Added magacine for archery, added guns and ammo to magazine group 2013-03-04 11:40:21 +01:00
Zach Morgan 86894453ce make vehicle control regaining make more sense
by eating the sideways velocity.
also fixing rl_vec dot products, broken from from last commit's fix
2013-03-04 05:35:13 -05:00
Zach Morgan d34c73c2f6 moving skid recovery
from inside map::vehproceed
to vehicle::possibly_recover_from_skid
2013-03-04 05:07:08 -05:00
Zach Morgan b2bc3ca2f6 give a chance to recover in a skid, depenging on
chance, and move & face vectors being somewhat aligned.
2013-03-04 04:40:01 -05:00
OzoneH3 26921a91b4 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-04 09:41:09 +01:00
Zach Morgan 20844c7cab implemented vehicle::face_vec 2013-03-04 00:30:39 -05:00
Zach Morgan 9ec4cc602b mingw & fake curses compilation fix 2013-03-04 00:25:44 -05:00
Zach Morgan 77e37b0113 giving 'tough' trait a cost of 3 pts instead of 5 2013-03-03 23:40:38 -05:00
Zach Morgan dc56e2eca1 s/percussion/concussion in bike helmet description.
Thanks to elricsfate for pointing it out.
2013-03-03 23:23:47 -05:00
OzoneH3 070df33b9e Update list items only redraw previous trail to item instead of whole terrain 2013-03-04 00:35:05 +01:00
Kyratzes Talvadore 459cb2d1f9 Merge pull request #144 from OzoneH3/master
Updated inventory menu to always display item info and a menu beside
2013-03-03 14:43:14 -08:00
OzoneH3 0349cd9668 Updated inventory menu to always display item info and a menu beside 2013-03-03 23:24:02 +01:00
TheDarklingWolf 7784b07af2 Fema groundsheets are now indoor tiles. The labs no longer use pavement. 2013-03-03 21:39:59 +00:00
TheDarklingWolf 10298aad75 Makefile update 2013-03-03 18:34:46 +00:00
Kyratzes Talvadore 6d8bc20eb4 Merge pull request #130 from OzoneH3/master
Added Option (safemodeproximity) for safemode, at what distance to hostiles safemode should kick in
2013-03-03 09:54:58 -08:00
Kevin Granade 578436cc73 Make wolves and other meat-eaters unhappy about zombie meat, but ok with cooked and human meat. 2013-03-03 11:36:36 -06:00
Kevin Granade c7da5cce22 Remove DOS style newlines. 2013-03-03 11:22:23 -06:00
TheDarklingWolf 23f75a3248 Fixed unburied landmines being placed in mx_minefield 2013-03-03 17:10:32 +00:00
OzoneH3 d604f5b761 Added missing key for numpad support 2013-03-03 13:58:02 +00:00
OzoneH3 a51226bebb Added numpad keys to input.cpp
Conflicts:

	overmap.cpp
2013-03-03 13:57:59 +00:00
Kyratzes Talvadore bb14238b43 Fixed a screwup in cooked marrow description. 2013-03-03 13:33:46 +00:00
OzoneH3 ed91287ad4 Added missing key for numpad support 2013-03-03 14:26:32 +01:00
TheDarklingWolf 5b9926db78 Increased chance of gas pumps running out of gas 2013-03-03 13:20:25 +00:00
TheDarklingWolf e295648c61 Added wild veggies to various recipes 2013-03-03 13:18:13 +00:00
TheDarklingWolf 7508445bc7 Changed messenger bag description and storage 2013-03-03 13:16:16 +00:00
TheDarklingWolf 8633b2a1cb Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-03 13:15:00 +00:00
TheDarklingWolf 2b0b5bec98 Some name changes to veggy chunks 2013-03-03 13:14:50 +00:00
OzoneH3 1e34693f74 Added numpad keys to input.cpp 2013-03-03 12:42:38 +01:00
OzoneH3 8499f59080 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA
Conflicts:
	game.cpp
	overmap.cpp
2013-03-03 10:40:38 +01:00
Kevin Granade d1252c2b59 Update distance to target message offset. 2013-03-03 02:23:22 -06:00
Zach Morgan 89aee80229 Merge pull request #142 from BurnZeZ/master
Lowered encumbrance of messenger bag to 0
2013-03-02 23:12:37 -08:00
Zach Morgan dfa73854d3 Revert "Merge branch 'WarningResolutions' of git://github.com/AkrionXxarr/Cataclysm-DDA"
This reverts commit b8b08ba99a, reversing
changes made to d5152fdc3d.

Justification: Apparently, Whales used represented certain states using negative values in the inventory
system, and perhaps in other instances. This branch replaced a bunch of
ints with unsigned ints, for no real reason.

I think that this also causes the initial NPC's needs vector to become
corrupted.

Conflicts:
	bionics.cpp
	game.cpp
	graffiti.cpp
	map.cpp
	overmap.cpp
	rng.cpp
2013-03-03 01:46:08 -05:00
BurnZeZ f0d63e2ab6 Lowered encumbrance of messenger bag to 0
RIP Bruce
2013-03-02 23:05:38 -05:00
Kevin Granade a5b4dfbd27 Stop blueberries from spawning, you have to forage for them now. 2013-03-02 21:58:30 -06:00
BurnZeZ 10e736b5f0 That was levels of wrong beyond the ability of ethics to account for. 2013-03-02 22:49:21 -05:00
Zach Morgan e9d31bec58 Merge pull request #141 from BurnZeZ/master
Input revamp base
2013-03-02 19:41:00 -08:00
BurnZeZ 625ba7aba0 Removed the escape key delay. 2013-03-02 22:28:50 -05:00
Zach Morgan 9b96c7089f Merge pull request #140 from tasetase/master
Make t_window_domestic break when shot
2013-03-02 19:08:11 -08:00
Zach Morgan e9cb72d3c5 stem cell treatment to repair bones
"Mr. Stem Cell" treatment terminal in hospital,
and disease.
no new items.
2013-03-02 20:37:18 -05:00
BurnZeZ 5fa706ac9d Merge pull request #2 from BurnZeZ/input-revamp
Input revamp beginnings
2013-03-02 16:47:42 -08:00
BurnZeZ d12045a1f2 get_input() can now handle arrow keys 2013-03-02 19:42:05 -05:00
BurnZeZ 13602188c6 Temp fix so arrow keys work. 2013-03-02 19:26:04 -05:00
phil 17ea14eb48 Made t_window_domestic breakable when shot 2013-03-02 18:58:58 -05:00
phil 7b79660e4d Minor tweaks related to shooting 2013-03-02 18:58:01 -05:00
BurnZeZ 8aec1699eb Merge branch 'master' into input-revamp
Conflicts:
	bionics.cpp
	game.cpp
2013-03-02 18:46:54 -05:00
OzoneH3 4c9ced093f Fixed freeze when options get changed from bool to int 2013-03-03 00:19:08 +01:00
OzoneH3 6a0bf4c865 Added inventory menu option to reload item 2013-03-02 23:16:34 +01:00
OzoneH3 e978f250eb Fix inventory menu unload, dont unload held weapon if selected item is worn item 2013-03-02 21:41:04 +01:00
OzoneH3 a3e1be9e8d Added unload items from inventory menu 2013-03-02 21:16:26 +01:00
Kevin Granade ec0616d2e4 Increase scent update radius, only seems to make a difference if you're running. 2013-03-01 21:57:48 -06:00
Kevin Granade e6588068bc Only return scent values when queried from inside scent update radius to avoid confusing monsters. 2013-03-01 20:50:54 -06:00
Kevin Granade 5dee478a35 Update draw_scent() debug function for configurable view size. 2013-03-01 20:21:33 -06:00
OzoneH3 2984403382 Inventory, add menu to choose what to do with the selected item.
Reload/Unload may follow, but its complicated ...
2013-03-01 22:38:43 +01:00
TheDarklingWolf 230fe26545 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA 2013-03-01 20:54:26 +00:00
TheDarklingWolf aa9c6072c3 Landmines can now be set on non-diggable terrain. 2013-03-01 20:53:36 +00:00
Zach Morgan b341d92b10 Merge pull request #128 from AkrionXxarr/WarningResolutions
More fixes similar to the djb2_hash fix.
2013-03-01 11:40:46 -08:00
TheDarklingWolf e7cc2e8cb1 Remove sewing kit exception from disassembly 2013-03-01 18:17:51 +00:00
TheDarklingWolf 4fc1a1a8df Rip up tshirts by hand 2013-03-01 18:17:23 +00:00
OzoneH3 6f8a1ed478 Fixed broken overmap Notes not being displayed and added custom note symbol with X:TEXT 2013-03-01 16:06:48 +01:00
OzoneH3 9549305c8d 12/24 hour time text update 2013-03-01 14:38:40 +01:00
OzoneH3 6d4b6b2ad5 Made the Help menu a bit more 80x25 friendly 2013-03-01 13:41:49 +01:00
OzoneH3 4864d3064b Added normal 24h time display to time options 2013-03-01 13:24:05 +01:00
OzoneH3 41b6f12f89 If Ausosafemode is on, color SAFE green if no hostiles are in proximity range, otherwise color it red
Added progressbar like coloring of SAFE while autosafemode is powering up.
2013-03-01 12:47:01 +01:00
OzoneH3 1f0c27ff6f Fix: Show new skill percentage when reading a book 2013-03-01 12:04:50 +01:00
OzoneH3 01d113b202 Added Option (safemodeproximity) for safemode, at what distance to hostiles safemode should kick in
Also added an option after how many turns autosafemode reenables safemode if there are no hostiles in safemodeproximity range
2013-03-01 11:57:37 +01:00
AkrionXxarr e8b4a21540 Fix to confusing and potentially unpredictable conditionals.
This is a fix similar to the djb2_hash fix.
2013-02-28 21:10:25 -08:00
Zach Morgan 48be67014c Merge pull request #127 from AkrionXxarr/WarningResolutions
Fixed djb2_hash with proper code.
2013-02-28 20:33:59 -08:00
AkrionXxarr a8ad03d677 Fixed djb2_hash with proper code. 2013-02-28 19:28:33 -08:00
Kevin Granade 7d2e2a16a9 Added minimal test running make target. 2013-02-28 18:41:36 -06:00
Kevin Granade 5eb21df4b3 Minor cleanup to line_test.cpp. 2013-02-28 18:21:30 -06:00
Kevin Granade 643c3b440a Workaround to probable symbol collision between some cataclysm object and libtap. 2013-02-28 18:21:30 -06:00
Zach Morgan b2ba305653 trivial bracketing 2013-02-28 19:18:22 -05:00
Zach Morgan 5986601e02 making vehicles move 2013-02-28 19:04:43 -05:00
Zach Morgan b8b08ba99a Merge branch 'WarningResolutions' of git://github.com/AkrionXxarr/Cataclysm-DDA
Conflicts:
	inventory_ui.cpp
2013-02-28 18:48:02 -05:00
BurnZeZ d4fe0acd05 Merge branch 'master' into input-revamp 2013-02-28 18:06:23 -05:00
BurnZeZ cfd5518cfd Made get_input() backwards compatible with the existing codebase
Fixed a bug trapping you at the item list prompt
2013-02-28 17:57:27 -05:00
Zach Morgan d5152fdc3d Merge pull request #125 from OzoneH3/master
Add worn items and weapon to total item count in inventory.
2013-02-28 14:55:57 -08:00
Zach Morgan e195d28c8e Merge pull request #118 from benjamg/hotfix/makefile_dependencies
add dependency information for g++ linux builds
2013-02-28 14:40:05 -08:00
AkrionXxarr 9ba34d3ebf Further warning resolutions. Specifically focused on signed/unsigned mismatches.
Change to warning flags in Makefile.

Small error fix.
2013-02-28 14:05:21 -08:00
AkrionXxarr e19854dc3e Further warning resolutions. Specifically focused on unused parameter warnings.
Small error fixes.

Further warning resolutions. A fix in items.h.

Further warning resolutions.
A few bug fixes and fixes to past changes.

Small error fixes.
2013-02-28 14:05:20 -08:00
AkrionXxarr 0f657dee94 Further warning resolutions. Specifically defaulting switch statements.
Further warning resolutions.
2013-02-28 14:05:19 -08:00
AkrionXxarr d3c6015ea6 Further warning resolutions.
Further warning resolutions.
Tweeked previous -Wunused-parameter warning fixes

Further warning resolutions.

Further warning resolutions. Crazy source file is crazy.

Potential bug fix?
2013-02-28 14:04:57 -08:00
OzoneH3 494a641e6b Add worn items and weapon to total item count in inventory. 2013-02-28 23:03:14 +01:00
AkrionXxarr 22e1de332a Fixed a couple errors in previous commit.
More warning resolutions.
Reordered switch in artifact.cpp to match enum order.
(Probably missed doing this to a couple previous switches,
 will have to go back)
2013-02-28 13:30:37 -08:00
AkrionXxarr 55b8e3a83e Warning Resolutions 2013-02-28 13:30:36 -08:00
BurnZeZ 544aaaf3fc Merge branch 'master' into input-revamp 2013-02-28 15:15:08 -05:00
BurnZeZ e7446e0264 More input.h integration 2013-02-28 15:13:06 -05:00
benjamg 8bd8c06947 fix for clean method 2013-02-28 19:50:49 +00:00
benjamg 9ad98f7e70 Merge branch 'hotfix/makefile_dependencies' of github.com:benjamg/Cataclysm-DDA into hotfix/makefile_dependencies 2013-02-28 19:47:06 +00:00
BurnZeZ c0d7ddd1d3 Fixed factions ignoring input that should close the window
Removed an accidental double call to get_input() in game::close()
Updated a DebugLog string to display get_input() rather than input()
2013-02-28 14:40:42 -05:00
BurnZeZ 33919dcf4b A bit of input refactoring inside game.cpp
More code uses input.h functions rather than directly calling getch()

Fixed the menu loop I broke last commit
2013-02-28 14:31:31 -05:00
Shoes01 48b36b1b6f Fix Temp in status 2013-02-28 10:43:11 -08:00
Zach Morgan a5fa8f9668 Using larger chunks of memory instead of VLAs.
This lets clang++ compile cataclysm.
2013-02-28 13:18:02 -05:00
Zach Morgan 87af41d2c8 Merge pull request #123 from benjamg/hotfix/makefile_anytests
Support multiple tests with libtab
2013-02-28 07:53:36 -08:00
Ben Gray 9de7ad5c58 make clean remove dependency files too 2013-02-28 10:08:08 +00:00
Ben Gray 0ef60d89d2 add dependency information for g++ linux builds 2013-02-28 10:06:46 +00:00
Ben Gray 0e92eca46d updated makefile to build each test from it's own source file as libtab uses the main entry point as it's test runner 2013-02-28 10:06:14 +00:00
Kevin Granade e3b8e0fd73 Fix off-by-one error in construction menu that was making construction menu crash on entry of a `. 2013-02-27 22:30:38 -06:00
Zach Morgan 9057403a6c distinct message for cigars 2013-02-27 22:21:46 -05:00
Zach Morgan 694f1cbe97 unarmed vs. inventory screen offset fix 2013-02-27 22:01:55 -05:00
Kevin Granade ec16dc4822 Initial support for unit tests using libtap. 2013-02-27 18:21:24 -06:00
Kevin Granade 91ee4faaa2 Revert "Replace the city mongroup with static spawns of zombies scattered about."
This reverts commit bc44340bd9.
2013-02-27 18:07:24 -06:00
Kevin Granade b628deaf18 Prune map.h as an include for line.cpp. 2013-02-27 18:04:12 -06:00
Kevin Granade 4e62e0299b Initialize temp_cur with the appropriate define. 2013-02-27 17:53:25 -06:00
Kevin Granade cba16f9d7c Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA into dda-master 2013-02-27 17:52:35 -06:00
BurnZeZ a042be590d Added a new method for input.
Made the main menu use the new input system.
2013-02-27 18:40:59 -05:00
benjamg a4f0094008 Merge branch 'master' into feature/npc 2013-02-27 21:15:52 +00:00
Ben Gray 96548da1e8 add dependency information for g++ linux builds 2013-02-27 21:12:42 +00:00
TheDarklingWolf 3452ad54aa Disabled body temperature updates 2013-02-27 19:33:14 +00:00
Zach Morgan 2562f2d3dd misc game.cpp chanves, from kevin 2013-02-27 11:11:38 -05:00
Zach Morgan b38ec05c2d making zombie kids more friendly 2013-02-27 02:50:31 -05:00
Zach Morgan 34b1c93283 - annoying temperature message 2013-02-27 02:39:17 -05:00
Kevin Granade bc44340bd9 Replace the city mongroup with static spawns of zombies scattered about. 2013-02-27 00:12:48 -06:00
Kevin Granade b8959a1219 Add new place_spawns() function to generate random-ish static spawns of monsters. 2013-02-27 00:11:44 -06:00
Zach Morgan ddb1d408be taking a step to prevent multiple veh-veh
collision events in the same instance.

Note: this could add time to the system, and with collisions being the
way they are, they could add energy to the system.
So hopefully the resonances don't cascade with too many vehicles.
2013-02-27 00:35:58 -05:00
Zach Morgan 5472cef101 fixing vehicle solar panels 2013-02-26 22:54:46 -05:00
Kevin Granade 6106145e3d Merge remote-tracking branch 'shoes/master' into dda-master
Conflicts:
	weather.h
2013-02-26 21:10:47 -06:00
Shoes01 16036327c8 Bodytemp is now updated every tick instead of every 10 ticks 2013-02-26 21:40:22 -08:00
Shoes01 5977e198e1 Documentation and cleanup of bodytemp stuff 2013-02-26 20:30:08 -08:00
Kevin Granade 2032dda642 Give gas pumps a chance of running out of gas. 2013-02-26 20:43:47 -06:00
Kevin Granade adac220862 Fix bionic description typo. 2013-02-26 20:43:47 -06:00
benjamg eea320f75c allowed npcs to wait at basecamp 2013-02-27 00:02:21 +00:00
benjamg 3e91b801e4 added basecamp, tied into bulletin boards 2013-02-26 23:17:08 +00:00
benjamg f421f8d994 undo new avoidance system because I didn't think how it was going to work, and it doesn't 2013-02-26 20:49:10 +00:00
benjamg 3670e2fc1b merge conflicts fixed 2013-02-26 20:34:01 +00:00
Shoes01 18e44e28c4 Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA 2013-02-24 08:13:58 -08:00
Shoes01 9ca4e46593 Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA 2013-02-24 01:23:51 -08:00
Shoes01 1f9907e39e Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA 2013-02-23 12:09:52 -08:00
Shoes01 76f7493899 Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA 2013-02-23 07:25:50 -08:00
Shoes01 85b3b8e871 Added player complaints due to heat 2013-02-22 18:54:32 -08:00
benjamg da15dc330a npcs detection for incoming cars 2013-01-22 23:35:44 +00:00
benjamg 8735b7219a allow use of silenced firearms, added combat option for player to toggle 2013-01-22 21:01:57 +00:00
benjamg c6938f1062 why I should at least complile code before I checkin 2013-01-22 20:14:16 +00:00
benjamg 381cd945f1 Merge branch 'master' into feature/npc 2013-01-22 20:11:05 +00:00
benjamg ff7330774d reload if in vehicles over using melee 2013-01-21 23:10:41 +00:00
benjamg ad458cc8f5 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA into feature/npc 2013-01-20 17:18:22 +00:00
benjamg 5cd5b06e85 finally stopped npcs leaping to their death in a quest for some random cookie 2013-01-19 20:05:45 +00:00
benjamg f4db1041e4 merged from pre-dda mod 2013-01-19 19:13:50 +00:00
103 changed files with 8839 additions and 5374 deletions
+14 -3
View File
@@ -27,6 +27,8 @@
<Unit filename="artifact.cpp" />
<Unit filename="artifact.h" />
<Unit filename="artifactdata.h" />
<Unit filename="basecamp.cpp" />
<Unit filename="basecamp.h" />
<Unit filename="bionics.cpp" />
<Unit filename="bionics.h" />
<Unit filename="bodypart.cpp" />
@@ -64,9 +66,8 @@
<Unit filename="graffiti.cpp" />
<Unit filename="graffiti.h" />
<Unit filename="help.cpp" />
<Unit filename="icon.rc">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="input.cpp" />
<Unit filename="input.h" />
<Unit filename="inventory.cpp" />
<Unit filename="inventory.h" />
<Unit filename="inventory_ui.cpp" />
@@ -83,6 +84,7 @@
<Unit filename="line.cpp" />
<Unit filename="line.h" />
<Unit filename="main.cpp" />
<Unit filename="main_menu.cpp" />
<Unit filename="map.cpp" />
<Unit filename="map.h" />
<Unit filename="mapbuffer.cpp" />
@@ -172,6 +174,15 @@
<code_completion />
<debugger />
<envvars />
<DoxyBlocks>
<comment_style block="0" line="0" />
<doxyfile_project />
<doxyfile_build />
<doxyfile_warnings />
<doxyfile_output />
<doxyfile_dot />
<general />
</DoxyBlocks>
</Extensions>
</Project>
</CodeBlocks_project_file>
+20 -3
View File
@@ -22,6 +22,8 @@
# DEBUG is best turned on if you plan to debug in gdb -- please do!
# PROFILE is for use with gprof or a similar program -- don't bother generally
#WARNINGS = -Wall -Wextra -Wno-switch -Wno-sign-compare -Wno-missing-braces -Wno-unused-parameter -Wno-char-subscripts
# Uncomment below to disable warnings
WARNINGS = -w
DEBUG = -g
#PROFILE = -pg
#OTHERS = -O3
@@ -42,7 +44,7 @@ DEBUG = -g
#DEFINES += -DDEBUG_ENABLE_MAP_GEN
#DEFINES += -DDEBUG_ENABLE_GAME
VERSION = 0.1
VERSION = 0.3
TARGET = cataclysm
W32TARGET = cataclysm.exe
@@ -61,7 +63,7 @@ ifdef RELEASE
DEBUG =
endif
CXXFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS)
CXXFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS) -MMD
BINDIST_EXTRAS = README data cataclysm-launcher
BINDIST = cataclysmdda-$(VERSION).tar.gz
@@ -105,6 +107,7 @@ ifeq ($(CROSS), i686-pc-mingw32-)
endif
SOURCES = $(wildcard *.cpp)
HEADERS = $(wildcard *.h)
_OBJS = $(SOURCES:.cpp=.o)
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
@@ -125,7 +128,7 @@ $(ODIR)/%.o: %.cpp
$(CXX) $(DEFINES) $(CXXFLAGS) -c $< -o $@
clean:
rm -f $(TARGET) $(W32TARGET) $(ODIR)/*.o $(W32ODIR)/*.o $(W32BINDIST) \
rm -f $(TARGET) $(W32TARGET) $(ODIR)/*.o $(ODIR)/*.d $(W32ODIR)/*.o $(W32BINDIST) \
$(BINDIST)
rm -rf $(BINDIST_DIR)
@@ -137,4 +140,18 @@ $(BINDIST): $(TARGET) $(BINDIST_EXTRAS)
cp -R $(TARGET) $(BINDIST_EXTRAS) $(BINDIST_DIR)
$(BINDIST_CMD)
export ODIR _OBJS LDFLAGS CXX W32FLAGS DEFINES CXXFLAGS
ctags: $(SOURCES) $(HEADERS)
ctags $(SOURCES) $(HEADERS)
tests: $(ODIR) $(DDIR) $(OBJS)
$(MAKE) -C tests
check: tests
$(MAKE) -C tests check
.PHONY: tests check
-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)
-include ${OBJS:.o=.d}
+8
View File
@@ -217,6 +217,8 @@ std::string action_ident(action_id act)
return "missions";
case ACTION_FACTIONS:
return "factions";
case ACTION_KILLS:
return "kills";
case ACTION_MORALE:
return "morale";
case ACTION_MESSAGES:
@@ -231,6 +233,8 @@ std::string action_ident(action_id act)
return "debug_mode";
case ACTION_NULL:
return "null";
case ACTION_RECRAFT:
return "recraft";
}
return "unknown";
}
@@ -375,6 +379,8 @@ std::string action_name(action_id act)
return "View Missions";
case ACTION_FACTIONS:
return "View Factions";
case ACTION_KILLS:
return "View Kills";
case ACTION_MORALE:
return "View Morale";
case ACTION_MESSAGES:
@@ -389,6 +395,8 @@ std::string action_name(action_id act)
return "Toggle Debug Messages";
case ACTION_NULL:
return "No Action";
case ACTION_RECRAFT:
return "Recraft last recipe";
}
return "Someone forgot to name an action.";
}
+2
View File
@@ -60,6 +60,7 @@ ACTION_BIONICS,
// Long-term / special actions
ACTION_WAIT,
ACTION_CRAFT,
ACTION_RECRAFT,
ACTION_CONSTRUCT,
ACTION_DISASSEMBLE,
ACTION_SLEEP,
@@ -72,6 +73,7 @@ ACTION_QUIT,
ACTION_PL_INFO,
ACTION_MAP,
ACTION_MISSIONS,
ACTION_KILLS,
ACTION_FACTIONS,
ACTION_MORALE,
ACTION_MESSAGES,
+45
View File
@@ -0,0 +1,45 @@
#include <algorithm>
#include <sstream>
#include "basecamp.h"
basecamp::basecamp()
: name()
, posx(0), posy(0)
{
}
basecamp::basecamp(std::string const& name_, int const posx_, int const posy_)
: name(name_)
, posx(posx_), posy(posy_)
{
}
std::string basecamp::board_name() const
{
return name + " Board";
}
std::string basecamp::save_data() const
{
std::stringstream data;
// TODO: This will lose underscores, is that a problem?
// strip spaces from name
std::string savename = name;
replace(savename.begin(), savename.end(), ' ', '_');
data << savename << " " << posx << " " << posy;
return data.str();
}
void basecamp::load_data(std::string const& data)
{
std::stringstream stream(data);
stream >> name >> posx >> posy;
// add space to name
replace(name.begin(), name.end(), '_', ' ');
}
+29
View File
@@ -0,0 +1,29 @@
#ifndef _BASECAMP_H_
#define _BASECAMP_H_
#include <string>
class basecamp
{
public:
basecamp();
basecamp(std::string const& name_, int const posx_, int const posy_);
inline bool is_valid() const { return !name.empty(); }
inline int board_x() const { return posx; }
inline int board_y() const { return posy; }
inline std::string const& camp_name() const { return name; }
std::string board_name() const;
// Save/load
std::string save_data() const;
void load_data(std::string const& data);
private:
std::string name;
int posx, posy; // location of associated bulletin board
};
#endif
+176 -45
View File
@@ -1,6 +1,7 @@
#include "player.h"
#include "game.h"
#include "rng.h"
#include "input.h"
#include "keypress.h"
#include "item.h"
#include "bionics.h"
@@ -10,6 +11,118 @@
void bionics_install_failure(game *g, player *u, int success);
void player::power_bionics(game *g)
{
WINDOW* wBio = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
WINDOW* w_description = newwin(3, 78, 21 + getbegy(wBio), 1 + getbegx(wBio));
werase(wBio);
wborder(wBio, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
std::vector <bionic> passive;
std::vector <bionic> active;
mvwprintz(wBio, 1, 1, c_blue, "BIONICS -");
mvwprintz(wBio, 1, 11, c_white, "Activating. Press '!' to examine your implants.");
for (int i = 1; i < 79; i++) {
mvwputch(wBio, 2, i, c_ltgray, LINE_OXOX);
mvwputch(wBio, 20, i, c_ltgray, LINE_OXOX);
}
mvwputch(wBio, 2, 0, c_ltgray, LINE_XXXO); // |-
mvwputch(wBio, 2, 79, c_ltgray, LINE_XOXX); // -|
mvwputch(wBio, 20, 0, c_ltgray, LINE_XXXO); // |-
mvwputch(wBio, 20, 79, c_ltgray, LINE_XOXX); // -|
for (int i = 0; i < my_bionics.size(); i++) {
if ( bionics[my_bionics[i].id].power_source ||
!bionics[my_bionics[i].id].activated )
passive.push_back(my_bionics[i]);
else
active.push_back(my_bionics[i]);
}
nc_color type;
if (passive.size() > 0) {
mvwprintz(wBio, 3, 1, c_ltblue, "Passive:");
for (int i = 0; i < passive.size(); i++) {
if (bionics[passive[i].id].power_source)
type = c_ltcyan;
else
type = c_cyan;
mvwputch(wBio, 4 + i, 1, type, passive[i].invlet);
mvwprintz(wBio, 4 + i, 3, type, bionics[passive[i].id].name.c_str());
}
}
if (active.size() > 0) {
mvwprintz(wBio, 3, 33, c_ltblue, "Active:");
for (int i = 0; i < active.size(); i++) {
if (active[i].powered)
type = c_red;
else
type = c_ltred;
mvwputch(wBio, 4 + i, 33, type, active[i].invlet);
mvwprintz(wBio, 4 + i, 35, type,
(active[i].powered ? "%s - ON" : "%s - %d PU / %d trns"),
bionics[active[i].id].name.c_str(),
bionics[active[i].id].power_cost,
bionics[active[i].id].charge_time);
}
}
wrefresh(wBio);
char ch;
bool activating = true;
bionic *tmp;
int b;
do {
ch = getch();
if (ch == '!') {
activating = !activating;
if (activating)
mvwprintz(wBio, 1, 11, c_white, "Activating. Press '!' to examine your implants.");
else
mvwprintz(wBio, 1, 11, c_white, "Examining. Press '!' to activate your implants.");
} else if (ch == ' ')
ch = KEY_ESCAPE;
else if (ch != KEY_ESCAPE) {
for (int i = 0; i < my_bionics.size(); i++) {
if (ch == my_bionics[i].invlet) {
tmp = &my_bionics[i];
b = i;
ch = KEY_ESCAPE;
}
}
if (ch == KEY_ESCAPE) {
if (activating) {
if (bionics[tmp->id].activated) {
if (tmp->powered) {
tmp->powered = false;
g->add_msg("%s powered off.", bionics[tmp->id].name.c_str());
} else if (power_level >= bionics[tmp->id].power_cost ||
(weapon.type->id == itm_bio_claws && tmp->id == bio_claws))
activate_bionic(b, g);
} else
mvwprintz(wBio, 21, 1, c_ltred, "\
You can not activate %s! To read a description of \
%s, press '!', then '%c'.", bionics[tmp->id].name.c_str(),
bionics[tmp->id].name.c_str(), tmp->invlet);
} else { // Describing bionics, not activating them!
// Clear the lines first
ch = 0;
werase(w_description);
mvwprintz(w_description, 0, 0, c_ltblue, bionics[tmp->id].description.c_str());
}
}
}
wrefresh(w_description);
wrefresh(wBio);
} while (ch != KEY_ESCAPE);
werase(wBio);
wrefresh(wBio);
delwin(wBio);
erase();
}
// Why put this in a Big Switch? Why not let bionics have pointers to
// functions, much like monsters and items?
@@ -49,6 +162,7 @@ void player::activate_bionic(int b, game *g)
std::vector<std::string> bad;
WINDOW* w;
int dirx, diry, t, l, index;
InputEvent input;
item tmp_item;
switch (bio.id) {
@@ -100,7 +214,8 @@ void player::activate_bionic(int b, game *g)
// TODO: More stuff here (and bio_blood_filter)
case bio_blood_anal:
w = newwin(20, 40, 3, 10);
w = newwin(20, 40, 3 + ((TERMY > 25) ? (TERMY-25)/2 : 0), 10+((TERMX > 80) ? (TERMX-80)/2 : 0));
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
if (has_disease(DI_FUNGUS))
@@ -200,7 +315,8 @@ void player::activate_bionic(int b, game *g)
case bio_lighter:
g->draw();
mvprintw(0, 0, "Torch in which direction?");
get_direction(g, dirx, diry, input());
input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
g->add_msg("Invalid direction.");
power_level += bionics[bio_lighter].power_cost;
@@ -252,7 +368,8 @@ void player::activate_bionic(int b, game *g)
case bio_emp:
g->draw();
mvprintw(0, 0, "Fire EMP in which direction?");
get_direction(g, dirx, diry, input());
input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
g->add_msg("Invalid direction.");
power_level += bionics[bio_emp].power_cost;
@@ -337,7 +454,8 @@ void player::activate_bionic(int b, game *g)
case bio_lockpick:
g->draw();
mvprintw(0, 0, "Unlock in which direction?");
get_direction(g, dirx, diry, input());
input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
g->add_msg("Invalid direction.");
power_level += bionics[bio_lockpick].power_cost;
@@ -363,44 +481,57 @@ bool player::install_bionics(game *g, it_bionic* type)
return false;
}
std::string bio_name = type->name.substr(5); // Strip off "CBM: "
WINDOW* w = newwin(25, 80, 0, 0);
WINDOW* w = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
WINDOW* w_description = newwin(3, 78, 21 + getbegy(w), 1 + getbegx(w));
werase(w);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
int pl_skill = int_cur +
skillLevel("electronics").level() * 4 +
skillLevel("firstaid").level() * 3 +
skillLevel("mechanics").level() * 2;
skillLevel("electronics") * 4 +
skillLevel("firstaid") * 3 +
skillLevel("mechanics") * 2;
int skint = int(pl_skill / 4);
int skdec = int((pl_skill * 10) / 4) % 10;
// Header text
mvwprintz(w, 0, 0, c_white, "Installing bionics:");
mvwprintz(w, 0, 20, type->color, bio_name.c_str());
mvwprintz(w, 1, 1, c_white, "Installing bionics:");
mvwprintz(w, 1, 21, type->color, bio_name.c_str());
// Dividing bars
for (int i = 0; i < 80; i++) {
mvwputch(w, 1, i, c_ltgray, LINE_OXOX);
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
for (int i = 1; i < 79; i++) {
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
mvwputch(w, 20, i, c_ltgray, LINE_OXOX);
}
mvwputch(w, 2, 0, c_ltgray, LINE_XXXO); // |-
mvwputch(w, 2, 79, c_ltgray, LINE_XOXX); // -|
mvwputch(w, 20, 0, c_ltgray, LINE_XXXO); // |-
mvwputch(w, 20, 79, c_ltgray, LINE_XOXX); // -|
// Init the list of bionics
for (int i = 1; i < type->options.size(); i++) {
bionic_id id = type->options[i];
mvwprintz(w, i + 2, 0, (has_bionic(id) ? c_ltred : c_ltblue),
mvwprintz(w, i + 3, 1, (has_bionic(id) ? c_ltred : c_ltblue),
bionics[id].name.c_str());
}
// Helper text
mvwprintz(w, 2, 40, c_white, "Difficulty of this module: %d",
mvwprintz(w, 3, 39, c_white, "Difficulty of this module: %d",
type->difficulty);
mvwprintz(w, 3, 40, c_white, "Your installation skill: %d.%d",
mvwprintz(w, 4, 39, c_white, "Your installation skill: %d.%d",
skint, skdec);
mvwprintz(w, 4, 40, c_white, "Installation requires high intelligence,");
mvwprintz(w, 5, 40, c_white, "and skill in electronics, first aid, and");
mvwprintz(w, 6, 40, c_white, "mechanics (in that order of importance).");
mvwprintz(w, 5, 39, c_white, "Installation requires high intelligence,");
mvwprintz(w, 6, 39, c_white, "and skill in electronics, first aid, and");
mvwprintz(w, 7, 39, c_white, "mechanics (in that order of importance).");
int chance_of_success = int((100 * pl_skill) /
(pl_skill + 4 * type->difficulty));
mvwprintz(w, 8, 40, c_white, "Chance of success:");
mvwprintz(w, 9, 39, c_white, "Chance of success:");
nc_color col_suc;
if (chance_of_success >= 95)
@@ -414,25 +545,27 @@ bool player::install_bionics(game *g, it_bionic* type)
else
col_suc = c_red;
mvwprintz(w, 8, 59, col_suc, "%d%%%%", chance_of_success);
mvwprintz(w, 9, 59, col_suc, "%d%%%%", chance_of_success);
mvwprintz(w, 10, 40, c_white, "Failure may result in crippling damage,");
mvwprintz(w, 11, 40, c_white, "loss of existing bionics, genetic damage");
mvwprintz(w, 12, 40, c_white, "or faulty installation.");
mvwprintz(w, 11, 39, c_white, "Failure may result in crippling damage,");
mvwprintz(w, 12, 39, c_white, "loss of existing bionics, genetic damage");
mvwprintz(w, 13, 39, c_white, "or faulty installation.");
wrefresh(w);
if (type->id == itm_bionics_battery) { // No selection list; just confirm
mvwprintz(w, 2, 0, h_ltblue, "Battery Level +%d", BATTERY_AMOUNT);
mvwprintz(w, 22, 0, c_ltblue, "\
mvwprintz(w, 3, 1, h_ltblue, "Battery Level +%d", BATTERY_AMOUNT);
mvwprintz(w_description, 0, 0, c_ltblue, "\
Installing this bionic will increase your total battery capacity by %d.\n\
Batteries are necessary for most bionics to function. They also require a\n\
charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
char ch;
InputEvent input;
wrefresh(w_description);
wrefresh(w);
do
ch = getch();
while (ch != 'q' && ch != '\n' && ch != KEY_ESCAPE);
if (ch == '\n') {
input = get_input();
while (input != Confirm && input != Close);
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);
@@ -454,27 +587,25 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
}
int selection = 0;
char ch;
InputEvent input;
do {
bionic_id id = type->options[selection];
mvwprintz(w, 2 + selection, 0, (has_bionic(id) ? h_ltred : h_ltblue),
mvwprintz(w, 3 + selection, 1, (has_bionic(id) ? h_ltred : h_ltblue),
bionics[id].name.c_str());
// Clear the bottom three lines...
mvwprintz(w, 22, 0, c_ltgray, "\
\n\
\n\
");
werase(w_description);
// ...and then fill them with the description of the selected bionic
mvwprintz(w, 22, 0, c_ltblue, bionics[id].description.c_str());
mvwprintz(w_description, 0, 0, c_ltblue, bionics[id].description.c_str());
wrefresh(w_description);
wrefresh(w);
ch = input();
switch (ch) {
input = get_input();
switch (input) {
case 'j':
case DirectionS:
mvwprintz(w, 2 + selection, 0, (has_bionic(id) ? c_ltred : c_ltblue),
bionics[id].name.c_str());
if (selection == type->options.size() - 1)
@@ -483,7 +614,7 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
selection++;
break;
case 'k':
case DirectionN:
mvwprintz(w, 2 + selection, 0, (has_bionic(id) ? c_ltred : c_ltblue),
bionics[id].name.c_str());
if (selection == 0)
@@ -493,13 +624,13 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
break;
}
if (ch == '\n' && has_bionic(id)) {
if (input == Confirm && has_bionic(id)) {
popup("You already have a %s!", bionics[id].name.c_str());
ch = 'a';
input = Nothing;
}
} while (ch != '\n' && ch != 'q' && ch != KEY_ESCAPE);
} while (input != Cancel && input != Confirm);
if (ch == '\n') {
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);
+3 -4
View File
@@ -110,10 +110,9 @@ slowly draining your energy reserves but providing oxygen."},
{"Air Filtration System", false, false, 1, 0, "\
Implanted in your trachea is an advanced filtration system. If toxins find\n\
their way into your windpipe, the filter will attempt to remove them."},
{"Internal Climate Control", false, false, 0, 0, "\
{"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. It has an operating range of 0 to 140\n\
degrees Fahrenheit."},
of high and low ambient temperatures."},
{"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."},
@@ -234,7 +233,7 @@ anything else."},
Your left arm has been replaced by a heavy-duty fusion blaster! You may use\n\
your energy banks to fire a damaging heat ray; however, you are unable to use\n\
or carry two-handed items, and may only fire handguns."},
{"Finger-Mounter Laser", false, true, 2, 0, "\
{"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."},
+3 -3
View File
@@ -2,12 +2,12 @@
#define _BODYPART_H_
#include <string>
// The order is important ; pldata.h has to be in the same order
enum body_part {
bp_head = 0,
bp_torso = 0,
bp_head,
bp_eyes,
bp_mouth,
bp_torso,
bp_arms,
bp_hands,
bp_legs,
+6 -3
View File
@@ -355,12 +355,15 @@ std::string calendar::print_time(bool twentyfour)
ret << "0";
ret << minute;
} else {
if (OPTIONS[OPT_24_HOUR]) {
if (OPTIONS[OPT_24_HOUR] == 1) {
int hours = hour % 24;
if (hours < 10)
ret << "0";
ret << hours;
} else {
} else if (OPTIONS[OPT_24_HOUR] == 2) {
int hours = hour % 24;
ret << hours << ":";
}else {
int hours = hour % 12;
if (hours == 0)
hours = 12;
@@ -369,7 +372,7 @@ std::string calendar::print_time(bool twentyfour)
if (minute < 10)
ret << "0";
ret << minute;
if (!OPTIONS[OPT_24_HOUR]) {
if (OPTIONS[OPT_24_HOUR] == 0) {
if (hour < 12)
ret << " AM";
else
+32 -17
View File
@@ -46,7 +46,7 @@ bool WinCreate()
int WinBorderWidth;
int WinTitleSize;
unsigned int WindowStyle;
const WCHAR *szTitle= (L"Cataclysm");
const WCHAR *szTitle= (L"Cataclysm: Dark Days Ahead - 0.3 Prerelease");
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
@@ -646,6 +646,20 @@ int getmaxy(WINDOW *win)
return win->height;
};
//gets the beginning x of a window (the x pos)
int getbegx(WINDOW *win)
{
if (win==0) return mainwin->x; //StdScr
return win->x;
};
//gets the beginning y of a window (the y pos)
int getbegy(WINDOW *win)
{
if (win==0) return mainwin->y; //StdScr
return win->y;
};
inline RGBQUAD BGR(int b, int g, int r)
{
RGBQUAD result;
@@ -659,22 +673,22 @@ inline RGBQUAD BGR(int b, int g, int r)
int start_color(void)
{
colorpairs=new pairs[50];
windowsPalette=new RGBQUAD[16]; //Colors in the struct are BGR!! not RGB!!
windowsPalette[0]= BGR(0,0,0); //Oddzball - Black
windowsPalette[1]= BGR(0, 0, 255); //Oddzball - Red
windowsPalette[2]= BGR(0,100,0); //Oddzball- Green
windowsPalette[3]= BGR(23,51,92); //Oddzball- Brown??? -Made Darker
windowsPalette[4]= BGR(150, 0, 0); //Oddzball-Blue
windowsPalette[5]= BGR(98, 58, 139); //Oddzball-Pink? -Made Purple
windowsPalette[6]= BGR(180, 150, 0); //Oddzball-Cyan
windowsPalette[7]= BGR(196, 196, 196);//Oddzball-Gray
windowsPalette[8]= BGR(77, 77, 77);//Oddzball-Dark Gray -Made Darker Gray
windowsPalette[9]= BGR(150, 150, 255); //Oddzball-Light Red/Salmon? -Made Lighter red
windowsPalette[10]= BGR(0, 255, 0); //Oddzball-Bright Green
windowsPalette[11]= BGR(0, 255, 255); //Oddzball-Yellow
windowsPalette[12]= BGR(255, 100, 100); //Oddzball-Dark Blue? -Made Light Blue
windowsPalette[13]= BGR(240, 0, 255); //Oddzball- Pink
windowsPalette[14]= BGR(255, 240, 0); //Oddzball -Light Cyan?
windowsPalette=new RGBQUAD[16]; //Colors in the struct are BGR!! not RGB!!
windowsPalette[0]= BGR(0,0,0); // Black
windowsPalette[1]= BGR(0, 0, 255); // Red
windowsPalette[2]= BGR(0,100,0); // Green
windowsPalette[3]= BGR(23,51,92); // Brown???
windowsPalette[4]= BGR(150, 0, 0); // Blue
windowsPalette[5]= BGR(98, 58, 139); // Purple
windowsPalette[6]= BGR(180, 150, 0); // Cyan
windowsPalette[7]= BGR(196, 196, 196);// Gray
windowsPalette[8]= BGR(77, 77, 77);// Dark Gray
windowsPalette[9]= BGR(150, 150, 255); // Light Red/Salmon?
windowsPalette[10]= BGR(0, 255, 0); // Bright Green
windowsPalette[11]= BGR(0, 255, 255); // Yellow
windowsPalette[12]= BGR(255, 100, 100); // Light Blue
windowsPalette[13]= BGR(240, 0, 255); // Pink
windowsPalette[14]= BGR(255, 240, 0); // Light Cyan?
windowsPalette[15]= BGR(255, 255, 255);
return SetDIBColorTable(backbuffer, 0, 16, windowsPalette);
};
@@ -807,5 +821,6 @@ void timeout(int delay)
{
inputdelay=delay;
};
void set_escdelay(int delay) { } //PORTABILITY, DUMMY FUNCTION
#endif
+3
View File
@@ -141,8 +141,11 @@ int waddch(WINDOW *win, const chtype ch);
int printw(const char *fmt,...);
int getmaxx(WINDOW *win);
int getmaxy(WINDOW *win);
int getbegx(WINDOW *win);
int getbegy(WINDOW *win);
int move(int y, int x);
void timeout(int delay);//PORTABILITY, DUMMY FUNCTION
void set_escdelay(int delay);//PORTABILITY, DUMMY FUNCTION
//Window Functions, Do not call these outside of catacurse.cpp
void WinDestroy();
+1 -1
View File
@@ -18,7 +18,7 @@ ADDITIONS
1.2 Adding a monster
1) Edit mtype.h. Change the enum mon_id and insert a unique identifier for
your new monster type. Be sure to put it among similar monsters.
2) Edit montypedef.cpp. A macro is used for monsters and it is pretty
2) Edit mtypedef.cpp. A macro is used for monsters and it is pretty
straightforward (Any of this ring a bell?). Be ABSOLUTELY sure that you
insert the macro at the same point in the list as your inserted the
identifier in mon_id!
+36 -19
View File
@@ -70,7 +70,7 @@ void computer::shutdown_terminal()
void computer::use(game *g)
{
if (w_terminal == NULL)
w_terminal = newwin(25, 80, 0, 0);
w_terminal = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
wborder(w_terminal, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
@@ -163,7 +163,7 @@ bool computer::hack_attempt(player *p, int Security)
Security = security; // Set to main system security if no value passed
p->practice("computer", 5 + Security * 2);
int player_roll = p->skillLevel("computer").level();
int player_roll = p->skillLevel("computer");
if (p->int_cur < 8 && one_in(2))
player_roll -= rng(0, 8 - p->int_cur);
else if (p->int_cur > 8 && one_in(3))
@@ -385,12 +385,10 @@ void computer::activate_function(game *g, computer_action action)
if (maxx >= OMAPX) maxx = OMAPX - 1;
if (miny < 0) miny = 0;
if (maxy >= OMAPY) maxy = OMAPY - 1;
overmap tmp(g, g->cur_om.posx, g->cur_om.posy, 0);
for (int i = minx; i <= maxx; i++) {
for (int j = miny; j <= maxy; j++)
tmp.seen(i, j) = true;
g->cur_om.seen(i, j, 0) = true;
}
tmp.save(g->u.name, g->cur_om.posx, g->cur_om.posy, 0);
print_line("Surface map data downloaded.");
} break;
@@ -405,20 +403,19 @@ void computer::activate_function(game *g, computer_action action)
if (maxy >= OMAPY) maxy = OMAPY - 1;
for (int i = minx; i <= maxx; i++) {
for (int j = miny; j <= maxy; j++)
if ((g->cur_om.ter(i, j) >= ot_sewer_ns &&
g->cur_om.ter(i, j) <= ot_sewer_nesw) ||
(g->cur_om.ter(i, j) >= ot_sewage_treatment &&
g->cur_om.ter(i, j) <= ot_sewage_treatment_under))
g->cur_om.seen(i, j) = true;
if ((g->cur_om.ter(i, j, g->levz) >= ot_sewer_ns &&
g->cur_om.ter(i, j, g->levz) <= ot_sewer_nesw) ||
(g->cur_om.ter(i, j, g->levz) >= ot_sewage_treatment &&
g->cur_om.ter(i, j, g->levz) <= ot_sewage_treatment_under))
g->cur_om.seen(i, j, g->levz) = true;
}
print_line("Sewage map data downloaded.");
} break;
case COMPACT_MISS_LAUNCH: {
overmap tmp_om(g, g->cur_om.posx, g->cur_om.posy, 0);
// Target Acquisition.
point target = tmp_om.choose_point(g);
point target = g->cur_om.choose_point(g, 0);
if (target.x == -1) {
print_line("Launch canceled.");
return;
@@ -437,15 +434,12 @@ void computer::activate_function(game *g, computer_action action)
}
}
// For each level between here and the surface, remove the missile
for (int level = g->cur_om.posz; level < 0; level++) {
tmp_om = g->cur_om;
g->cur_om = overmap(g, tmp_om.posx, tmp_om.posy, level);
for (int level = g->levz; level < 0; level++) {
tinymap tmpmap(&g->itypes, &g->mapitems, &g->traps);
tmpmap.load(g, g->levx, g->levy, false);
tmpmap.load(g, g->levx, g->levy, level, false);
tmpmap.translate(t_missile, t_hole);
tmpmap.save(&tmp_om, g->turn, g->levx, g->levy);
tmpmap.save(&g->cur_om, g->turn, g->levx, level, g->levz);
}
g->cur_om = tmp_om;
for (int x = target.x - 2; x <= target.x + 2; x++) {
for (int y = target.y - 2; y <= target.y + 2; y++)
g->nuke(x, y);
@@ -553,7 +547,7 @@ know that's sort of a big deal, but come on, these guys can't handle it?\n");
print_line("\
SITE %d%d%d%d%d\n\
PERTINANT FOREMAN LOGS WILL BE PREPENDED TO NOTES",
g->cur_om.posx, g->cur_om.posy, g->levx, g->levy, abs(g->levz));
g->cur_om.pos().x, g->cur_om.pos().y, g->levx, g->levy, abs(g->levz));
print_line("\n\
MINE OPERATIONS SUSPENDED; CONTROL TRANSFERRED TO AMIGARA PROJECT UNDER\n\
IMPERATIVE 2:07B\n\
@@ -577,6 +571,13 @@ INITIATING STANDARD TREMOR TEST...");
g->u.add_disease(DI_AMIGARA, 20, g);
break;
case COMPACT_STEMCELL_TREATMENT:
g->u.add_disease(DI_STEMCELL_TREATMENT, 120, g);
print_line("The machine injects your eyeball with the solution \n\
of pureed bone & LSD.");
g->u.pain += rng(40,90);
break;
case COMPACT_DOWNLOAD_SOFTWARE:
if (!g->u.has_amount(itm_usb_drive, 1))
print_error("USB drive required!");
@@ -637,6 +638,21 @@ INITIATING STANDARD TREMOR TEST...");
}
break;
case COMPACT_EMERG_MESS:
print_line("\
GREETINGS CITIZEN. A BIOLOGICAL ATTACK HAS TAKEN PLACE AND A STATE OF \n\
EMERGENCY HAS BEEN DECLARED. EMERGENCY PERSONNEL WILL BE AIDING YOU \n\
SHORTLY. TO ENSURE YOUR SAFETY PLEASE FOLLOW THE BELOW STEPS. \n\
\n\
1. DO NOT PANIC. \n\
2. REMAIN INSIDE THE BUILDING. \n\
3. SEEK SHELTER IN THE BASEMENT. \n\
4. USE PROVIDED GAS MASKS. \n\
5. AWAIT FURTHER INSTRUCTIONS \n\
\n\
Press any key to continue...");
break;
} // switch (action)
}
@@ -785,6 +801,7 @@ void computer::activate_failure(game *g, computer_failure fail)
}
getch();
break;
}// switch (fail)
}
+2
View File
@@ -31,6 +31,8 @@ enum computer_action
COMPACT_AMIGARA_START,
COMPACT_DOWNLOAD_SOFTWARE,
COMPACT_BLOOD_ANAL,
COMPACT_STEMCELL_TREATMENT,
COMPACT_EMERG_MESS,
NUM_COMPUTER_ACTIONS
};
+140 -106
View File
@@ -42,9 +42,9 @@ void game::init_construction()
CONSTRUCT("Dig Pit", 0, &construct::able_dig, &construct::done_nothing);
STAGE(t_pit_shallow, 10);
TOOL(itm_shovel, NULL);
TOOL(itm_shovel, itm_primitive_shovel, itm_digging_stick, NULL);
STAGE(t_pit, 10);
TOOL(itm_shovel, NULL);
TOOL(itm_shovel, itm_primitive_shovel, NULL);
CONSTRUCT("Spike Pit", 0, &construct::able_pit, &construct::done_nothing);
STAGE(t_pit_spiked, 5);
@@ -52,17 +52,17 @@ void game::init_construction()
CONSTRUCT("Fill Pit", 0, &construct::able_pit, &construct::done_nothing);
STAGE(t_pit_shallow, 5);
TOOL(itm_shovel, NULL);
TOOL(itm_shovel, itm_primitive_shovel, NULL);
STAGE(t_dirt, 5);
TOOL(itm_shovel, NULL);
TOOL(itm_shovel, itm_primitive_shovel, NULL);
CONSTRUCT("Chop Down Tree", 0, &construct::able_tree, &construct::done_tree);
STAGE(t_dirt, 10);
TOOL(itm_ax, itm_chainsaw_on, NULL);
TOOL(itm_ax, itm_primitive_axe, itm_chainsaw_on, NULL);
CONSTRUCT("Chop Up Log", 0, &construct::able_log, &construct::done_log);
STAGE(t_dirt, 20);
TOOL(itm_ax, itm_chainsaw_on, NULL);
TOOL(itm_ax, itm_primitive_axe, itm_chainsaw_on, NULL);
CONSTRUCT("Move Furniture", -1, &construct::able_furniture, &construct::done_furniture);
STAGE(t_null, 1);
@@ -74,67 +74,72 @@ void game::init_construction()
/* CONSTRUCT("Remove Window Pane", 1, &construct::able_window_pane,
&construct::done_window_pane);
STAGE(t_window_empty, 10);
TOOL(itm_hammer, itm_rock, itm_hatchet, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_rock, itm_hatchet, NULL);
TOOL(itm_screwdriver, itm_knife_butter, itm_toolset, NULL);
*/
CONSTRUCT("Repair Door", 1, &construct::able_door_broken,
&construct::done_nothing);
STAGE(t_door_c, 10);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 3, NULL);
COMP(itm_nail, 12, NULL);
CONSTRUCT("Board Up Door", 0, &construct::able_door, &construct::done_nothing);
STAGE(t_door_boarded, 8);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_hammer_sledge, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 4, NULL);
COMP(itm_nail, 8, NULL);
CONSTRUCT("Board Up Window", 0, &construct::able_window,
&construct::done_nothing);
STAGE(t_window_boarded, 5);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_hammer_sledge, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 4, NULL);
COMP(itm_nail, 8, NULL);
CONSTRUCT("Build Wall", 2, &construct::able_empty, &construct::done_nothing);
STAGE(t_wall_half, 10);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 10, NULL);
COMP(itm_nail, 20, NULL);
STAGE(t_wall_wood, 10);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 10, NULL);
COMP(itm_nail, 20, NULL);
CONSTRUCT("Build Log Wall", 2, &construct::able_pit, &construct::done_nothing);
STAGE(t_wall_log_half, 20);
TOOL(itm_shovel, NULL);
TOOL(itm_shovel, itm_primitive_shovel, NULL);
COMP(itm_log, 2, NULL);
COMP(itm_stick, 3, NULL);
STAGE(t_wall_log, 20);
TOOL(itm_shovel, NULL);
TOOL(itm_shovel, itm_primitive_shovel, NULL);
COMP(itm_log, 2, NULL);
COMP(itm_stick, 3, NULL);
COMP(itm_stick, 3, NULL);
CONSTRUCT("Build Palisade Wall", 2, &construct::able_pit, &construct::done_nothing);
STAGE(t_palisade, 20);
TOOL(itm_shovel, NULL);
TOOL(itm_shovel, itm_primitive_shovel, NULL);
COMP(itm_log, 3, NULL);
COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);
COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);
CONSTRUCT("Build Rope and Pulley System", 2, &construct::able_empty, &construct::done_nothing);
STAGE(t_palisade_pulley, 0);
COMP(itm_rope_30, 1, NULL);
COMP(itm_stick, 8, itm_2x4, 8, NULL);
CONSTRUCT("Build Palisade Gate", 2, &construct::able_pit, &construct::done_nothing);
STAGE(t_palisade_gate, 20);
TOOL(itm_shovel, NULL);
COMP(itm_log, 2, NULL);
TOOL(itm_shovel, itm_primitive_shovel, NULL);
COMP(itm_log, 2, NULL);
COMP(itm_2x4, 3, NULL);
COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);
COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);
CONSTRUCT("Build Window", 2, &construct::able_empty,
&construct::done_nothing);
STAGE(t_window_empty, 10);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 15, itm_log, 2, NULL);
COMP(itm_nail, 30, NULL);
STAGE(t_window, 5);
@@ -142,25 +147,25 @@ void game::init_construction()
STAGE(t_window_domestic, 5);
TOOL(itm_saw, NULL);
COMP(itm_nail, 4, NULL);
COMP(itm_sheet, 2, NULL);
COMP(itm_sheet, 2, NULL);
COMP(itm_stick, 1, NULL);
CONSTRUCT("Build Door", 2, &construct::able_empty,
&construct::done_nothing);
STAGE(t_door_frame, 15);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 12, NULL);
COMP(itm_nail, 24, NULL);
STAGE(t_door_c, 15);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 4, NULL);
COMP(itm_nail, 12, NULL);
CONSTRUCT("Build Wire Fence",3, &construct::able_dig,
&construct::done_nothing);
STAGE(t_chainfence_posts, 20);
TOOL(itm_hammer, itm_hatchet, itm_rock, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_rock, NULL);
COMP(itm_pipe, 6, NULL);
COMP(itm_scrap, 8, NULL);
STAGE(t_chainfence_v, 20);
@@ -181,23 +186,32 @@ void game::init_construction()
/* Removed until we have some way of auto-aligning fences!
CONSTRUCT("Build Fence", 1, 15, &construct::able_empty);
STAGE(t_fence_h, 10);
TOOL(itm_hammer, itm_hatchet, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, NULL);
COMP(itm_2x4, 5, itm_nail, 8, NULL);
*/
CONSTRUCT("Build Roof", 3, &construct::able_between_walls,
&construct::done_nothing);
STAGE(t_floor, 40);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 8, NULL);
COMP(itm_nail, 40, NULL);
// Base stuff
CONSTRUCT("Build Bulletin Board", 0, &construct::able_empty,
&construct::done_nothing);
STAGE(t_bulletin, 10)
TOOL(itm_saw, NULL);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 4, NULL);
COMP(itm_nail, 8, NULL);
// Household stuff
CONSTRUCT("Build Dresser", 1, &construct::able_indoors,
&construct::done_nothing);
STAGE(t_dresser, 20);
TOOL(itm_saw, NULL);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_nail, 8, NULL);
COMP(itm_2x4, 6, NULL);
@@ -205,34 +219,34 @@ void game::init_construction()
&construct::done_nothing);
STAGE(t_bookcase, 20);
TOOL(itm_saw, NULL);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_nail, 16, NULL);
COMP(itm_2x4, 12, NULL);
CONSTRUCT("Build Counter", 0, &construct::able_indoors,
&construct::done_nothing);
STAGE(t_counter, 20);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_nail, 8, NULL);
COMP(itm_2x4, 6, NULL);
CONSTRUCT("Build Makeshift Bed", 0, &construct::able_indoors,
&construct::done_nothing);
STAGE(t_makeshift_bed, 20);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_nail, 8, NULL);
COMP(itm_2x4, 10, NULL);
COMP(itm_sheet, 1, NULL);
CONSTRUCT("Tape up window", 0, &construct::able_window,
&construct::done_tape);
STAGE(t_null, 2);
COMP(itm_duct_tape, 50, NULL);
CONSTRUCT("Tape up window", 0, &construct::able_window,
&construct::done_tape);
STAGE(t_null, 2);
COMP(itm_duct_tape, 50, NULL);
CONSTRUCT("Deconstruct Furniture", 0, &construct::able_deconstruct,
&construct::done_deconstruct);
STAGE(t_null, 20);
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_hatchet, itm_nailgun, NULL);
TOOL(itm_screwdriver, itm_toolset, NULL);
CONSTRUCT("Start vehicle construction", 0, &construct::able_empty, &construct::done_vehicle);
@@ -242,21 +256,28 @@ void game::init_construction()
CONSTRUCT("Fence Posts", 0, &construct::able_dig,
&construct::done_nothing);
STAGE(t_fence_post, 5);
TOOL(itm_hammer, itm_shovel, itm_rock, itm_hatchet, itm_ax, NULL);
TOOL(itm_hammer, itm_primitive_hammer, itm_shovel, itm_primitive_shovel, itm_rock, itm_hatchet, itm_ax, itm_primitive_axe, NULL);
COMP(itm_spear_wood, 2, NULL);
}
void game::construction_menu()
{
WINDOW *w_con = newwin(25, 80, 0, 0);
int iMaxY = TERMY;
if (constructions.size()+2 < iMaxY)
iMaxY = constructions.size()+2;
if (iMaxY < 25)
iMaxY = 25;
WINDOW *w_con = newwin(iMaxY, 80, (TERMY > iMaxY) ? (TERMY-iMaxY)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
wborder(w_con, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
mvwprintz(w_con, 0, 1, c_red, "Construction");
mvwputch(w_con, 0, 30, c_white, LINE_OXXX);
mvwputch(w_con, 24, 30, c_white, LINE_XXOX);
for (int i = 1; i < 24; i++)
mvwputch(w_con, i, 30, c_white, LINE_XOXO);
mvwprintz(w_con, 0, 8, c_ltred, " Construction ");
mvwputch(w_con, 0, 30, c_ltgray, LINE_OXXX);
mvwputch(w_con, iMaxY-1, 30, c_ltgray, LINE_XXOX);
for (int i = 1; i < iMaxY-1; i++)
mvwputch(w_con, i, 30, c_ltgray, LINE_XOXO);
mvwprintz(w_con, 1, 31, c_white, "Difficulty:");
@@ -264,46 +285,48 @@ void game::construction_menu()
bool update_info = true;
int select = 0;
char ch;
long ch;
inventory total_inv = crafting_inventory();
do {
// Erase existing list of constructions
for (int i = 1; i < 24; i++) {
for (int j = 1; j < 29; j++)
mvwputch(w_con, i, j, c_black, 'x');
for (int i = 1; i < iMaxY-1; i++) {
for (int j = 1; j < 30; j++)
mvwputch(w_con, i, j, c_black, ' ');
}
// Determine where in the master list to start printing
//int offset = select - 11;
int offset = 0;
if (select >= 22)
offset = select - 22;
if (select >= iMaxY-2)
offset = select - iMaxY + 3;
// Print the constructions between offset and max (or how many will fit)
for (int i = 0; i <= 22 && (i + offset) < constructions.size(); i++) {
for (int i = 0; i < iMaxY-2 && (i + offset) < constructions.size(); i++) {
int current = i + offset;
nc_color col = (player_can_build(u, total_inv, constructions[current]) ?
c_white : c_dkgray);
// Map menu items to hotkey letters, skipping j, k, l, and q.
char hotkey = current + ((current < 9) ? 97 : ((current < 13) ? 100 : 101));
char hotkey = 97 + current;
if (hotkey > 122)
hotkey = hotkey - 58;
if (current == select)
col = hilite(col);
mvwprintz(w_con, 1 + i, 1, col, "%c %s", hotkey,
constructions[current]->name.c_str());
mvwprintz(w_con, 1 + i, 1, col, "%c %s", hotkey, constructions[current]->name.c_str());
}
if (update_info) {
update_info = false;
constructable* current_con = constructions[select];
// Print difficulty
int pskill = u.skillLevel("carpentry").level();
int pskill = u.skillLevel("carpentry");
int diff = current_con->difficulty > 0 ? current_con->difficulty : 0;
mvwprintz(w_con, 1, 43, (pskill >= diff ? c_white : c_red),
"%d ", diff);
// Clear out lines for tools & materials
for (int i = 2; i < 24; i++) {
for (int i = 2; i < iMaxY-1; i++) {
for (int j = 31; j < 79; j++)
mvwputch(w_con, i, j, c_black, 'x');
mvwputch(w_con, i, j, c_black, ' ');
}
// Print stages and their requirements
@@ -398,54 +421,60 @@ void game::construction_menu()
wrefresh(w_con);
} // Finished updating
ch = input();
ch = getch();
switch (ch) {
case 'j':
case KEY_DOWN:
update_info = true;
if (select < constructions.size() - 1)
select++;
else
select = 0;
break;
case 'k':
case KEY_UP:
update_info = true;
if (select > 0)
select--;
else
select = constructions.size() - 1;
break;
case ' ':
case KEY_ESCAPE:
ch = 'q';
break;
case '\n':
case 'l':
if (player_can_build(u, total_inv, constructions[select])) {
place_construction(constructions[select]);
ch = 'q';
} else {
popup("You can't build that!");
for (int i = 1; i < 24; i++)
mvwputch(w_con, i, 30, c_white, LINE_XOXO);
update_info = true;
default:
if (ch > 64 && ch < 91) //A-Z
ch = ch - 65 + 26;
if (ch > 96 && ch < 123) //a-z
ch = ch - 97;
if (ch == '\n')
ch = select;
if (ch < constructions.size()) {
if (player_can_build(u, total_inv, constructions[ch])) {
place_construction(constructions[ch]);
ch = 'q';
} else {
popup("You can't build that!");
if (ch != '\n')
select = ch;
for (int i = 1; i < iMaxY-1; i++)
mvwputch(w_con, i, 30, c_ltgray, LINE_XOXO);
update_info = true;
}
}
break;
case 'q':
case 'Q':
case KEY_ESCAPE:
break;
default:
if (ch < 96 || ch > constructions.size() + 101) break;
// Map menu items to hotkey letters, skipping j, k, l, and q.
char hotkey = ch - ((ch < 106) ? 97 : ((ch < 112) ? 100 : 101));
if (player_can_build(u, total_inv, constructions[hotkey])) {
place_construction(constructions[hotkey]);
ch = 'q';
} else {
popup("You can't build that!");
for (int i = 1; i < 24; i++)
mvwputch(w_con, i, 30, c_white, LINE_XOXO);
update_info = true;
}
break;
}
} while (ch != 'q' && ch != 'Q' && ch != KEY_ESCAPE);
for (int i = iMaxY-25; i < iMaxY+1; i++) {
for (int j = TERRAIN_WINDOW_WIDTH; j < 81; j++)
mvwputch(w_con, i, j, c_black, ' ');
}
wrefresh(w_con);
refresh_all();
}
@@ -578,7 +607,7 @@ void game::place_construction(constructable *con)
max_stage = i;
}
u.assign_activity(ACT_BUILD, con->stages[starting_stage].time * 1000, con->id);
u.assign_activity(this, ACT_BUILD, con->stages[starting_stage].time * 1000, con->id);
u.moves = 0;
std::vector<int> stages;
@@ -648,12 +677,17 @@ bool construct::able_furniture(game *g, point p)
switch(g->m.ter(p.x, p.y)) {
case t_fridge:
case t_glass_fridge:
required_str = 10;
break;
case t_bookcase:
case t_locker:
required_str = 9;
break;
case t_dresser:
case t_rack:
case t_bookcase:
case t_locker:
case t_chair:
case t_chair:
case t_armchair:
case t_bench:
required_str = 8;
break;
default:
@@ -819,24 +853,24 @@ void construct::done_vehicle(game *g, point p)
}
veh->name = name;
veh->install_part (0, 0, vp_frame_v2);
}
}
void construct::done_tape(game *g, point p)
{
g->add_msg("You tape up the %s.", g->m.tername(p.x, p.y).c_str());
switch (g->m.ter(p.x, p.y))
{
case t_window_alarm:
g->m.ter(p.x, p.y) = t_window_alarm_taped;
case t_window_domestic:
g->m.ter(p.x, p.y) = t_window_domestic_taped;
case t_window:
case t_window_alarm:
g->m.ter(p.x, p.y) = t_window_alarm_taped;
case t_window_domestic:
g->m.ter(p.x, p.y) = t_window_domestic_taped;
case t_window:
g->m.ter(p.x, p.y) = t_window_taped;
}
}
}
void construct::done_deconstruct(game *g, point p)
{
@@ -861,7 +895,7 @@ void construct::done_deconstruct(game *g, point p)
case t_window_domestic:
g->m.add_item(p.x, p.y, g->itypes[itm_stick], 0);
g->m.add_item(p.x, p.y, g->itypes[itm_sheet], 0, 1);
g->m.add_item(p.x, p.y, g->itypes[itm_glass_sheet], 0);
g->m.add_item(p.x, p.y, g->itypes[itm_glass_sheet], 0);
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, 3);
g->m.ter(p.x, p.y) = t_window_empty;
break;
@@ -895,7 +929,7 @@ void construct::done_deconstruct(game *g, point p)
break;
case t_slide:
g->m.add_item(p.x, p.y, g->itypes[itm_steel_plate], 0);
g->m.add_item(p.x, p.y, g->itypes[itm_sheet_metal], 3);
g->m.add_item(p.x, p.y, g->itypes[itm_pipe], 0, rng(4,8));
g->m.ter(p.x, p.y) = t_grass;
break;
+1 -1
View File
@@ -69,7 +69,7 @@ struct construct // Construction functions.
void done_vehicle(game *, point);
void done_tree(game *, point);
void done_log(game *, point);
void done_furniture(game *, point);
void done_furniture(game *, point);
void done_tape(game *, point);
void done_deconstruct(game *, point);
+469 -308
View File
File diff suppressed because it is too large Load Diff
+2 -2
View File
@@ -41,8 +41,8 @@ struct recipe {
int time;
bool reversible; // can the item be disassembled?
std::vector<component> tools[5];
std::vector<component> components[10];
std::vector<component> tools[20];
std::vector<component> components[20];
recipe() {
id = 0;
+57
View File
@@ -0,0 +1,57 @@
Changelog will be a little light for the early entries due to me being really bad at documenting things.
0.3
Many menus stretch with an enlarged viewport.
An action to repeat the last craft has been added, default keybinding of -
When crafting liquid items, the game asks you for a container first, then asks if you want to dump the item.
A large amount of survival craft has been added, allowing you to make most of the basic tools and necessities. Along with several new weapons, some storage items and a liquid container.
Smoker Zombies, belch clouds of smoke at players, slowing them and blocking LOS.
Robots now pull from separate drop lists when killed.
Alcohol cost for Torches and Bandages has been increased to 7, or one third of a bottle.
Alcohol cost for molotovs has been reduced to 14, gasoline cost increased to 400.
Chitinous boots and gauntlets added.
Picklock kits break when damaged 5 times.
Zombie spawn ratios have been rebalanced for static spawning.
Pocketknives are useable for all logical recipes.
Child zombies have had a small pool of item drops added.
HP Ignorant is now the player default, Self Aware can be purchased to display exact HP.
Lawnmower blades have been replaced with generic blades, most bladed items are made using blades instead of machetes/swords now.
Nail bat, nail board and makeshift halberd now all have weak block.
Wild veggies function as plant marrow for most recipes.
Meat soup added, more cooking to come.
The player now spawns with a pocket knife and lighter.
Sledge hammer is usable to board windows and doors up.
Heartless trait has been removed, replaced with the Cannibal trait, which allows you to eat human meat with no morale penalty.
Braziers are now craftable. They contain fire and can be set up indoors.
Bulletin Boards can be built to set an area as your home base. NPCs can
be told to wait there and will defend the area.
Bear traps have been increased in weight and volume.
Carboys have been renamed to Gallon jugs.
You can now create a character without allocating all skill points.
Winter Boots and Raincoats now correctly display the reinforced tag.
Kills can now be accessed from in-game. Default key is ).
'Phew it's hot warm' message has been fixed.
The game now accepts wielded items when checking for containers.
Sunny and Clear weather now provide warmth.
Internal Climate Control bionic consumes power to cool or warm you.
Crash bug caused by the screen being larger than the loaded overmap has
been fixed.
Crash bug when going down stairs near cities has been fixed.
Hunger now affects body temperature.
Added new crafting recipes: shorts, cargo shorts, balclava, long underwear,
glove liners, socks.
Added a digging stick. Can be used to dig shallow pits, and level construction enough to enable crafting of stone shovels.
Got angry at other developers for not updating changelog.
0.2
Reworked spawning option which places zombies at world generation
rather than generating them dynamically in play.
Implementation of a context menu when examining inventory items.
Machine added to hospitals to regrow limbs.
0.1
Palisade Walls and Gates - Pretty tough to bash down, and can be fired throguh
Log Walls - Basically the same as wood walls, different construction methods.
The ability to disassemble tshirts and tank tops by hand. - Handy for bleeding.
Revolver Shotgun - NotTe much to say on this.
+16
View File
@@ -0,0 +1,16 @@
# This message may be 16 lines long at maximum.
# Max length of a line is 68 characters; the following line is for reference
####################################################################
Original author: Project Manager: Website/Forum:
Whales (retired) TheDarklingWolf GlyphGryph
Main Developers/Gihub Managers:
Kevingranade, Ozone, TheDarklingWolf, zpmorgan
Active Contributors:
BurnZeZ, Oddzball, Shades, Shoes01, Tase, GalenEvil
Contributors:
AkrionXxarr, Benjamg, Creidieki, Daftfad, Elricsfate, Gim,
GlyphGryph, Gremour, HerbertJones, hovatterz, Origamiwolf,
Uzername, Voker57, Wito
+13 -12
View File
@@ -1,17 +1,18 @@
# This message may be 16 lines long at maximum.
# Max length of a line is 64 characters; the following line is for reference
################################################################
This branch contains much work by Creidieki, Uzername,
Kevingranade, HerbertJones, Gim, Shades and Origamiwolf.
# Max length of a line is 68 characters; the following line is for reference
####################################################################
New features v0.3:
Reduced sight range of monsters. Monster bites and infections.
A bunch of new survival craft.
Fixes, fixes and more fixes.
The game now has configurable options.
You can directly edit options.txt in the data directory, or you
can edit the options via the help menu.
For latest discussions and news on Cataclysm DDA, please visit:
For latest discussions on Cataclysm and its mods, please visit:
http://www.cataclysm.glyphgryph.com/smf/index.php
Homepage: http://www.cataclysmdda.com/
Forum: http://www.cataclysmdda.com/smf/
Wiki: http://wiki.cataclysmdda.com/
Check out the options listing by pressing ?2
The game now has new configurable options:
Customizeable Viewport, Spawntype: Classic/Static, Starting time
As always, please visit the forums at:
http://www.cataclysm.glyphgryph.com/smf/index.php
Ingame you can access the options via the help menu (?2).
+285
View File
@@ -0,0 +1,285 @@
[
{
"name" : "GROUP_FOREST",
"default" : "mon_squirrel",
"monsters" : [
{ "monster" : "mon_rabbit", "freq" : 150 },
{ "monster" : "mon_deer", "freq" : 30 },
{ "monster" : "mon_wolf", "freq" : 30 },
{ "monster" : "mon_bear", "freq" : 20 },
{ "monster" : "mon_cougar", "freq" : 20 },
{ "monster" : "mon_spider_wolf", "freq" : 30 },
{ "monster" : "mon_spider_jumping", "freq" : 30 },
{ "monster" : "mon_dog", "freq" : 10 },
{ "monster" : "mon_crow", "freq" : 30 }
]
},
{
"name" : "GROUP_ANT",
"default" : "mon_ant",
"monsters" : [
{ "monster" : "mon_ant_larva", "freq" : 40 },
{ "monster" : "mon_ant_soldier", "freq" : 90 },
{ "monster" : "mon_ant_queen", "freq" : 0 }
]
},
{
"name" : "GROUP_BEE",
"default" : "mon_bee",
"monsters" : [
]
},
{
"name" : "GROUP_WORM",
"default" : "mon_worm",
"monsters" : [
{ "monster" : "mon_graboid", "freq" : 30 },
{ "monster" : "mon_halfworm", "freq" : 0 }
]
},
{
"name" : "GROUP_ZOMBIE",
"default" : "mon_zombie",
"monsters" : [
{ "monster" : "mon_zombie_cop", "freq" : 20 },
{ "monster" : "mon_zombie_fast", "freq" : 70 },
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
{ "monster" : "mon_skeleton", "freq" : 30 },
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
{ "monster" : "mon_zombie_electric", "freq" : 30 },
{ "monster" : "mon_zombie_necro", "freq" : 1 },
{ "monster" : "mon_boomer", "freq" : 30 },
{ "monster" : "mon_zombie_brute", "freq" : 10 },
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
{ "monster" : "mon_zombie_master", "freq" : 1 },
{ "monster" : "mon_crow", "freq" : 1 }
]
},
{
"name" : "GROUP_TRIFFID",
"default" : "mon_triffid",
"monsters" : [
{ "monster" : "mon_triffid_young", "freq" : 300 },
{ "monster" : "mon_vinebeast", "freq" : 160 },
{ "monster" : "mon_triffid_queen", "freq" : 60 }
]
},
{
"name" : "GROUP_FUNGI",
"default" : "mon_fungaloid",
"monsters" : [
{ "monster" : "mon_fungaloid_dormant", "freq" : 0 },
{ "monster" : "mon_ant_fungus", "freq" : 0 },
{ "monster" : "mon_zombie_fungus", "freq" : 300 },
{ "monster" : "mon_boomer_fungus", "freq" : 30 },
{ "monster" : "mon_spore", "freq" : 0 },
{ "monster" : "mon_fungaloid_queen", "freq" : 303 },
{ "monster" : "mon_fungal_wall", "freq" : 0 }
]
},
{
"name" : "GROUP_GOO",
"default" : "mon_blob",
"monsters" : [
{ "monster" : "mon_blob_small", "freq" : 200 }
]
},
{
"name" : "GROUP_CHUD",
"default" : "mon_chud",
"monsters" : [
{ "monster" : "mon_one_eye", "freq" : 90 },
{ "monster" : "mon_crawler", "freq" : 35 }
]
},
{
"name" : "GROUP_SEWER",
"default" : "mon_sewer_rat",
"monsters" : [
{ "monster" : "mon_sewer_fish", "freq" : 470 },
{ "monster" : "mon_sewer_snake", "freq" : 240 }
]
},
{
"name" : "GROUP_SWAMP",
"default" : "mon_mosquito",
"monsters" : [
{ "monster" : "mon_dragonfly", "freq" : 130 },
{ "monster" : "mon_centipede", "freq" : 150 },
{ "monster" : "mon_frog", "freq" : 100 },
{ "monster" : "mon_slug", "freq" : 85 },
{ "monster" : "mon_dermatik_larva", "freq" : 0 },
{ "monster" : "mon_dermatik", "freq" : 65 }
]
},
{
"name" : "GROUP_LAB",
"default" : "mon_zombie_scientist",
"monsters" : [
{ "monster" : "mon_blob_small", "freq" : 25 },
{ "monster" : "mon_manhack", "freq" : 245 },
{ "monster" : "mon_skitterbot", "freq" : 245 }
]
},
{
"name" : "GROUP_NETHER",
"default" : "mon_blank",
"monsters" : [
{ "monster" : "mon_flying_polyp", "freq" : 25 },
{ "monster" : "mon_hunting_horror", "freq" : 240 },
{ "monster" : "mon_mi_go", "freq" : 120 },
{ "monster" : "mon_yugg", "freq" : 70 },
{ "monster" : "mon_gelatin", "freq" : 120 },
{ "monster" : "mon_flaming_eye", "freq" : 120 },
{ "monster" : "mon_kreck", "freq" : 210 },
{ "monster" : "mon_gozu", "freq" : 25 }
]
},
{
"name" : "GROUP_SPIRAL",
"default" : "mon_human_snail",
"monsters" : [
{ "monster" : "mon_twisted_body", "freq" : 180 },
{ "monster" : "mon_vortex", "freq" : 80 }
]
},
{
"name" : "GROUP_VANILLA",
"default" : "mon_zombie",
"monsters" : [
]
},
{
"name" : "GROUP_SPIDER",
"default" : "mon_spider_wolf",
"monsters" : [
{ "monster" : "mon_spider_web", "freq" : 200 },
{ "monster" : "mon_spider_jumping", "freq" : 400 },
{ "monster" : "mon_spider_widow", "freq" : 200 }
]
},
{
"name" : "GROUP_ROBOT",
"default" : "mon_manhack",
"monsters" : [
{ "monster" : "mon_skitterbot", "freq" : 220 },
{ "monster" : "mon_secubot", "freq" : 150 },
{ "monster" : "mon_copbot", "freq" : 0 },
{ "monster" : "mon_molebot", "freq" : 40 },
{ "monster" : "mon_tripod", "freq" : 110 },
{ "monster" : "mon_chickenbot", "freq" : 60 },
{ "monster" : "mon_tankbot", "freq" : 20 }
]
},
{
"name" : "GROUP_POLICE", "_comment" : "+30% cops",
"default" : "mon_zombie",
"monsters" : [
{ "monster" : "mon_zombie_cop", "freq" : 320 },
{ "monster" : "mon_zombie_fast", "freq" : 70 },
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
{ "monster" : "mon_skeleton", "freq" : 30 },
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
{ "monster" : "mon_zombie_electric", "freq" : 30 },
{ "monster" : "mon_zombie_necro", "freq" : 1 },
{ "monster" : "mon_boomer", "freq" : 30 },
{ "monster" : "mon_zombie_brute", "freq" : 10 },
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
{ "monster" : "mon_zombie_master", "freq" : 1 },
{ "monster" : "mon_crow", "freq" : 1 }
]
},
{
"name" : "GROUP_HOUSE", "_comment" : "+15% child",
"default" : "mon_zombie",
"monsters" : [
{ "monster" : "mon_zombie_child", "freq" : 150 },
{ "monster" : "mon_zombie_cop", "freq" : 20 },
{ "monster" : "mon_zombie_fast", "freq" : 70 },
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
{ "monster" : "mon_skeleton", "freq" : 30 },
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
{ "monster" : "mon_zombie_electric", "freq" : 30 },
{ "monster" : "mon_zombie_necro", "freq" : 1 },
{ "monster" : "mon_boomer", "freq" : 30 },
{ "monster" : "mon_zombie_brute", "freq" : 10 },
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
{ "monster" : "mon_zombie_master", "freq" : 1 },
{ "monster" : "mon_crow", "freq" : 1 }
]
},
{
"name" : "GROUP_PHARM", "_comment" : "+15% fast",
"default" : "mon_zombie",
"monsters" : [
{ "monster" : "mon_zombie_cop", "freq" : 20 },
{ "monster" : "mon_zombie_fast", "freq" : 220 },
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
{ "monster" : "mon_skeleton", "freq" : 30 },
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
{ "monster" : "mon_zombie_electric", "freq" : 30 },
{ "monster" : "mon_zombie_necro", "freq" : 1 },
{ "monster" : "mon_boomer", "freq" : 30 },
{ "monster" : "mon_zombie_brute", "freq" : 10 },
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
{ "monster" : "mon_zombie_master", "freq" : 1 },
{ "monster" : "mon_crow", "freq" : 1 }
]
},
{
"name" : "GROUP_ELECTRO", "_comment" : "+15% electric",
"default" : "mon_zombie",
"monsters" : [
{ "monster" : "mon_zombie_cop", "freq" : 20 },
{ "monster" : "mon_zombie_fast", "freq" : 70 },
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
{ "monster" : "mon_skeleton", "freq" : 30 },
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
{ "monster" : "mon_zombie_electric", "freq" : 180 },
{ "monster" : "mon_zombie_necro", "freq" : 1 },
{ "monster" : "mon_boomer", "freq" : 30 },
{ "monster" : "mon_zombie_brute", "freq" : 10 },
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
{ "monster" : "mon_zombie_master", "freq" : 1 },
{ "monster" : "mon_crow", "freq" : 1 }
]
},
{
"name" : "GROUP_GROCERY", "_comment" : "+15% bommers",
"default" : "mon_zombie",
"monsters" : [
{ "monster" : "mon_zombie_cop", "freq" : 20 },
{ "monster" : "mon_zombie_fast", "freq" : 70 },
{ "monster" : "mon_zombie_grabber", "freq" : 70 },
{ "monster" : "mon_skeleton", "freq" : 30 },
{ "monster" : "mon_zombie_smoker", "freq" : 30 },
{ "monster" : "mon_zombie_shrieker", "freq" : 30 },
{ "monster" : "mon_zombie_spitter", "freq" : 30 },
{ "monster" : "mon_zombie_electric", "freq" : 30 },
{ "monster" : "mon_zombie_necro", "freq" : 1 },
{ "monster" : "mon_boomer", "freq" : 180 },
{ "monster" : "mon_zombie_brute", "freq" : 10 },
{ "monster" : "mon_zombie_hulk", "freq" : 1 },
{ "monster" : "mon_zombie_master", "freq" : 1 },
{ "monster" : "mon_crow", "freq" : 1 }
]
},
{
"name" : "GROUP_MAYBE_MIL", "_comment" : "50% chance military zombie",
"default" : "mon_null",
"monsters" : [
{ "monster" : "mon_zombie_soldier", "freq" : 50 }
]
}
]
+24 -22
View File
@@ -79,6 +79,8 @@ bool defense_game::init(game *g)
setup();
g->u.cash = initial_cash;
popup_nowait("Please wait as the map generates [ 0%]");
// TODO: support multiple defence games? clean up old defence game
g->cur_om = overmap(g, 0, 0);
init_map(g);
caravan(g);
return true;
@@ -193,12 +195,12 @@ void defense_game::init_map(game *g)
{
for (int x = 0; x < OMAPX; x++) {
for (int y = 0; y < OMAPY; y++) {
g->cur_om.ter(x, y) = ot_field;
g->cur_om.seen(x, y) = true;
g->cur_om.ter(x, y, 0) = ot_field;
g->cur_om.seen(x, y, 0) = true;
}
}
g->cur_om.save(g->u.name, 0, 0, DEFENSE_Z);
g->cur_om.save();
g->levx = 100;
g->levy = 100;
g->levz = 0;
@@ -210,29 +212,29 @@ void defense_game::init_map(game *g)
case DEFLOC_HOSPITAL:
for (int x = 49; x <= 51; x++) {
for (int y = 49; y <= 51; y++)
g->cur_om.ter(x, y) = ot_hospital;
g->cur_om.ter(x, y, 0) = ot_hospital;
}
g->cur_om.ter(50, 49) = ot_hospital_entrance;
g->cur_om.ter(50, 49, 0) = ot_hospital_entrance;
break;
case DEFLOC_MALL:
for (int x = 49; x <= 51; x++) {
for (int y = 49; y <= 51; y++)
g->cur_om.ter(x, y) = ot_megastore;
g->cur_om.ter(x, y, 0) = ot_megastore;
}
g->cur_om.ter(50, 49) = ot_megastore_entrance;
g->cur_om.ter(50, 49, 0) = ot_megastore_entrance;
break;
case DEFLOC_BAR:
g->cur_om.ter(50, 50) = ot_bar_north;
g->cur_om.ter(50, 50, 0) = ot_bar_north;
break;
case DEFLOC_MANSION:
for (int x = 49; x <= 51; x++) {
for (int y = 49; y <= 51; y++)
g->cur_om.ter(x, y) = ot_mansion;
g->cur_om.ter(x, y, 0) = ot_mansion;
}
g->cur_om.ter(50, 49) = ot_mansion_entrance;
g->cur_om.ter(50, 49, 0) = ot_mansion_entrance;
break;
}
// Init the map
@@ -251,14 +253,14 @@ void defense_game::init_map(game *g)
mx -= mx % 2;
my -= my % 2;
tinymap tm(&g->itypes, &g->mapitems, &g->traps);
tm.generate(g, &(g->cur_om), mx, my, int(g->turn));
tm.generate(g, &(g->cur_om), mx, my, 0, int(g->turn));
tm.clear_spawns();
tm.clear_traps();
tm.save(&g->cur_om, int(g->turn), mx, my);
tm.save(&g->cur_om, int(g->turn), mx, my, 0);
}
}
g->m.load(g, g->levx, g->levy);
g->m.load(g, g->levx, g->levy, g->levz, true);
g->update_map(g->u.posx, g->u.posy);
monster generator(g->mtypes[mon_generator], g->u.posx + 1, g->u.posy + 1);
@@ -1187,7 +1189,7 @@ void draw_caravan_items(WINDOW *w, game *g, std::vector<itype_id> *items,
int caravan_price(player &u, int price) {
if (u.skillLevel("barter") > 10)
return int( double(price) * .5);
return int( double(price) * (1.0 - double(u.skillLevel("barter").level()) * .05));
return int( double(price) * (1.0 - double(u.skillLevel("barter")) * .05));
}
void defense_game::spawn_wave(game *g)
@@ -1234,28 +1236,28 @@ void defense_game::spawn_wave(game *g)
std::vector<mon_id> defense_game::pick_monster_wave(game *g)
{
std::vector<moncat_id> valid;
std::vector<std::string> valid;
std::vector<mon_id> ret;
if (zombies || specials) {
if (specials)
valid.push_back(mcat_zombie);
valid.push_back("GROUP_ZOMBIE");
else
valid.push_back(mcat_vanilla_zombie);
valid.push_back("GROUP_VANILLA");
}
if (spiders)
valid.push_back(mcat_spider);
valid.push_back("GROUP_SPIDER");
if (triffids)
valid.push_back(mcat_triffid);
valid.push_back("GROUP_TRIFFID");
if (robots)
valid.push_back(mcat_robot);
valid.push_back("GROUP_ROBOT");
if (subspace)
valid.push_back(mcat_nether);
valid.push_back("GROUP_NETHER");
if (valid.empty())
debugmsg("Couldn't find a valid monster group for defense!");
else
ret = g->moncats[ valid[rng(0, valid.size() - 1)] ];
ret = MonsterGroupManager::GetMonstersFromGroup(valid[rng(0, valid.size() - 1)]);
return ret;
}
+2
View File
@@ -38,6 +38,7 @@ struct talk_function
void mission_favor (game *g, npc *p);
void give_equipment (game *g, npc *p);
void start_trade (game *g, npc *p);
void assign_base(game *g, npc *p);
void follow (game *g, npc *p); // p follows u
void deny_follow (game *g, npc *p); // p gets DI_ASKED_TO_FOLLOW
void deny_lead (game *g, npc *p); // p gets DI_ASKED_TO_LEAD
@@ -58,6 +59,7 @@ struct talk_function
void start_training (game *g, npc *p);
void toggle_use_guns (game *g, npc *p);
void toggle_use_silent (game *g, npc *p);
void toggle_use_grenades (game *g, npc *p);
void set_engagement_none (game *g, npc *p);
void set_engagement_close (game *g, npc *p);
+243 -64
View File
@@ -76,6 +76,21 @@ void dis_msg(game *g, dis_type type)
case DI_AMIGARA:
g->add_msg("You can't look away from the fautline...");
break;
case DI_STEMCELL_TREATMENT:
g->add_msg("You receive a pureed bone & enamel injection into your eyeball.");
g->add_msg("It is excruciating.");
case DI_BITE:
g->add_msg("The bite wound feels really deep...");
break;
case DI_INFECTED:
g->add_msg("Your bite wound feels infected");
break;
case DI_LIGHTSNARE:
g->add_msg("You are snared.");
break;
case DI_HEAVYSNARE:
g->add_msg("You are snared.");
break;
default:
break;
}
@@ -96,19 +111,19 @@ void dis_effect(game *g, player &p, disease &dis)
case DI_COLD_HEAD:
switch (dis.intensity) {
case 3 : p.int_cur -= 3; if (one_in(200)) g->add_msg("Your thoughts are unclear.");
case 3 : p.int_cur -= 3; if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your thoughts are unclear.");
case 2 : p.int_cur--;
case 1 : if (one_in(600)) g->add_msg("Brr.");
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 (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(200)) 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 (one_in(600)) g->add_msg("Brr.");
case 1 : p.dex_cur -= 1; if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
// Speed -2
}
break;
@@ -117,7 +132,7 @@ void dis_effect(game *g, player &p, disease &dis)
switch (dis.intensity) {
case 3 : p.dex_cur -= 2;
case 2 : p.dex_cur--;
case 1 : if (one_in(600)) g->add_msg("Your arms are shivering.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("Your arms are shivering.");
}
break;
@@ -125,17 +140,17 @@ void dis_effect(game *g, player &p, disease &dis)
switch (dis.intensity) {
case 3 : p.dex_cur -= 2;
case 2 : p.dex_cur -= 2;
case 1 : if (one_in(600)) g->add_msg("Brr.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
}
break;
case DI_COLD_LEGS:
switch (dis.intensity) {
case 3 : p.str_cur--; if (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(200)) g->add_msg("Your legs are seizing from the incredible cold.");
// Speed -20
case 2 : p.str_cur--;
// Speed -5
case 1 : if (one_in(600)) g->add_msg("Your legs feel sluggish from the cold.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("Your legs feel sluggish from the cold.");
// Speed -2
}
break;
@@ -144,7 +159,7 @@ 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 (one_in(600)) g->add_msg("Brr.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
}
break;
@@ -153,7 +168,7 @@ void dis_effect(game *g, player &p, disease &dis)
case 2 : p.dex_cur -= 3;
case 1 :
if (p.temp_cur[bp_mouth] > BODYTEMP_COLD && p.pain < 40) p.pain++;
if (one_in(600)) g->add_msg("Your hands feel numb.");
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your hands feel numb.");
}
break;
@@ -162,7 +177,7 @@ void dis_effect(game *g, player &p, disease &dis)
case 2 : // -4 speed
case 1 :
if (p.temp_cur[bp_mouth] > BODYTEMP_COLD && p.pain < 40) p.pain++;
if (one_in(600)) g->add_msg("Your feet feel numb.");
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your feet feel numb.");
}
break;
@@ -171,7 +186,7 @@ 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 (one_in(600)) g->add_msg("Your face feels numb.");
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your face feels numb.");
}
break;
@@ -200,10 +215,17 @@ void dis_effect(game *g, player &p, disease &dis)
case 3 :
p.thirst--;
if (p.pain < 50) 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(1500 - p.temp_cur[bp_head])) p.vomit(g); // Hallucinations handled in game.cpp
if (one_in(15000 - p.temp_cur[bp_head])) p.vomit(g); // Hallucinations handled in game.cpp
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
}
break;
@@ -212,17 +234,24 @@ void dis_effect(game *g, player &p, disease &dis)
case 3 :
p.thirst--;
p.str_cur--;
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("You are sweating profusely.");
// Speed -20
case 2 :
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
}
break;
case DI_HOT_ARMS:
switch (dis.intensity) {
case 3 : p.thirst--;
if (p.pain < 50) p.pain++;
if (p.pain < 50) p.pain++;
case 2 : p.thirst--;
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot.\"");
}
break;
@@ -230,6 +259,7 @@ void dis_effect(game *g, player &p, disease &dis)
switch (dis.intensity) {
case 3 : p.dex_cur--;
case 2 : p.dex_cur--;
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot.\"");
}
break;
@@ -237,20 +267,27 @@ void dis_effect(game *g, player &p, disease &dis)
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.\"");
}
break;
case DI_HOT_FEET:
switch (dis.intensity) {
case 3 : if (p.pain < 50) p.pain++;
case 2 : if (p.pain < 30) p.pain++;
case 2 :
if (p.pain < 30) p.pain++;
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your feet are swelling in the heat.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot.\"");
}
break;
case DI_COMMON_COLD:
if (int(g->turn) % 300 == 0)
p.thirst++;
if (int(g->turn) % 50 == 0)
p.fatigue++;
if (p.has_disease(DI_TOOK_FLUMED)) {
p.str_cur--;
p.int_cur--;
@@ -490,6 +527,22 @@ void dis_effect(game *g, player &p, disease &dis)
break;
case DI_STEMCELL_TREATMENT:
//slightly repair broken limbs. (also nonbroken limbs (unless they're too healthy))
for (int i = 0; i < num_hp_parts; i++) {
if(one_in(6)){
if (p.hp_cur[i] < rng(0,40)){
g->add_msg("You feel your skeleton melt and mend.");
p.hp_cur[i]+= rng(1,8);
}
else if (p.hp_cur[i] > rng(10,2000)){
g->add_msg("You feel your skeleton melt");
p.hp_cur[i] -= rng(0,8);
}
}
}
break;
case DI_PKILL1:
if (dis.duration <= 70 && dis.duration % 7 == 0 && p.pkill < 15)
p.pkill++;
@@ -582,7 +635,7 @@ void dis_effect(game *g, player &p, disease &dis)
break;
case DI_BLEED:
if (!p.is_npc() && one_in(2)) {
if (!p.is_npc() && one_in(6)) {
g->add_msg("You lose some blood.");
p.pain++;
p.hurt(g, bp_torso, 0, 1);
@@ -837,8 +890,7 @@ void dis_effect(game *g, player &p, disease &dis)
}
if (dis.duration > 3600) { // 12 teles
if (one_in(4000 - int(.25 * (dis.duration - 3600)))) {
int range = g->moncats[mcat_nether].size();
mon_id type = (g->moncats[mcat_nether])[rng(0, range - 1)];
mon_id type = MonsterGroupManager::GetMonsterFromGroup("GROUP_NETHER", &g->mtypes);
monster beast(g->mtypes[type]);
int x, y, tries = 0;
do {
@@ -900,8 +952,7 @@ void dis_effect(game *g, player &p, disease &dis)
case DI_ATTENTION:
if (one_in( 100000 / dis.duration ) && one_in( 100000 / dis.duration ) &&
one_in(250)) {
int range = g->moncats[mcat_nether].size();
mon_id type = (g->moncats[mcat_nether])[rng(0, range - 1)];
mon_id type = MonsterGroupManager::GetMonsterFromGroup("GROUP_NETHER", &g->mtypes);
monster beast(g->mtypes[type]);
int x, y, tries = 0, junk;
do {
@@ -962,6 +1013,114 @@ void dis_effect(game *g, player &p, disease &dis)
p.per_cur -= (dis.duration > 4000 ? 10 : int(dis.duration / 400));
}
} break;
case DI_BITE:
//3600 (6-hour) lifespan
if (dis.duration > 2400) { // First symptoms for 2 hours
if (one_in(300)) {
if (!p.is_npc())
g->add_msg("Your bite wound really hurts.");
}
} else if (dis.duration > 1200) { //Pain at 4 hours in
if (one_in(100)) {
if (!p.is_npc())
if (p.has_disease(DI_SLEEP)) {
p.rem_disease(DI_SLEEP);
g->add_msg("You wake up.");
}
g->add_msg("Your bite wound feels swollen and painful.");
if(p.pain < 20)
p.pain++;
}
p.dex_cur-= 1;
} else { // Infection starts
p.rem_disease(DI_BITE);
p.add_disease(DI_INFECTED, 14400, g); // 1 day of timer
}
break;
case DI_LIGHTSNARE:
p.moves = -500;
if(one_in(10)) {
g->add_msg("You attempt to free yourself from the snare.");
}
break;
case DI_HEAVYSNARE:
p.moves = -500;
if(one_in(20)) {
g->add_msg("You attempt to free yourself from the snare.");
}
break;
case DI_INFECTED:
p.dex_cur-= 1;
if (dis.duration > 10800) { // Infection Symptoms 6 hours into infection
if (one_in(300)) {
if (!p.is_npc()) {
if (p.has_disease(DI_SLEEP)) {
p.rem_disease(DI_SLEEP);
g->add_msg("You wake up.");
}
g->add_msg("Your infected wound is incredibly painful.");
}
if(p.pain < 40)
p.pain++;
}
p.str_cur-= 1;
p.dex_cur-= 1;
} else if (dis.duration > 7200) { //Infection Symptoms 12 hours into infection
if (one_in(100)) {
if (!p.is_npc()) {
if (p.has_disease(DI_SLEEP)) {
p.rem_disease(DI_SLEEP);
g->add_msg("You wake up.");
}
g->add_msg("You feel feverish and nauseous, your wound has begun to turn green.");
}
p.vomit(g);
if(p.pain < 60)
p.pain++;
}
p.str_cur-= 2;
p.dex_cur-= 2;
} else if (dis.duration > 3600) { //Infection Symptoms 18 hours into infection
if (one_in(100)) {
if (!p.is_npc())
if (p.has_disease(DI_SLEEP)) {
p.rem_disease(DI_SLEEP);
g->add_msg("You wake up.");
g->add_msg("You feel terribly weak, standing up is nearly impossible.");
} else
g->add_msg("You can barely remain standing.");
p.vomit(g);
if(p.pain < 100)
p.pain++;
}
p.str_cur-= 2;
p.dex_cur-= 2;
if(one_in(10)) {
if (p.has_disease(DI_SLEEP))
p.rem_disease(DI_SLEEP);
g->add_msg("You pass out.");
p.add_disease(DI_SLEEP, 60, g);
}
} else { // You die. 24 hours after infection Total time, 30 hours including bite.
if (p.has_disease(DI_SLEEP))
p.rem_disease(DI_SLEEP);
g->add_msg("You succumb to the infection.");
p.hurtall(500);
}
break;
case DI_RECOVER:
p.str_cur-= 1;
p.dex_cur-= 1;
break;
}
}
@@ -1011,32 +1170,32 @@ std::string dis_name(disease dis)
switch (dis.type) {
case DI_NULL: return "";
case DI_GLARE: return "Glare";
case DI_COLD_HEAD:
case DI_COLD_HEAD:
switch (dis.intensity) {
case 1: return "Cold head";
case 2: return "Cold head!";
case 3: return "Freezing head!!";}
case DI_COLD_TORSO:
case 3: return "Freezing head!!";}
case DI_COLD_TORSO:
switch (dis.intensity) {
case 1: return "Cold torso";
case 2: return "Cold torso!";
case 3: return "Freezing torso!!";}
case DI_COLD_ARMS:
case 3: return "Freezing torso!!";}
case DI_COLD_ARMS:
switch (dis.intensity) {
case 1: return "Cold arms";
case 2: return "Cold arms!";
case 3: return "Freezing arms!!";}
case DI_COLD_HANDS:
case 3: return "Freezing arms!!";}
case DI_COLD_HANDS:
switch (dis.intensity) {
case 1: return "Cold hands";
case 2: return "Cold hands!";
case 3: return "Freezing hands!!";}
case DI_COLD_LEGS:
case 3: return "Freezing hands!!";}
case DI_COLD_LEGS:
switch (dis.intensity) {
case 1: return "Cold legs";
case 2: return "Cold legs!";
case 3: return "Freezing legs!!";}
case DI_COLD_FEET:
case 3: return "Freezing legs!!";}
case DI_COLD_FEET:
switch (dis.intensity) {
case 1: return "Cold feet";
case 2: return "Cold feet!";
@@ -1053,36 +1212,36 @@ std::string dis_name(disease dis)
switch (dis.intensity) {
case 1: return "Frostnip - face";
case 2: return "Frostbite - face";}
case DI_HOT_HEAD:
case DI_HOT_HEAD:
switch (dis.intensity) {
case 1: return "Hot head";
case 2: return "Hot head!";
case 3: return "Scorching head!!";}
case DI_HOT_TORSO:
case 3: return "Scorching head!!";}
case DI_HOT_TORSO:
switch (dis.intensity) {
case 1: return "Hot torso";
case 2: return "Hot torso!";
case 3: return "Scorching torso!!";}
case DI_HOT_ARMS:
case 3: return "Scorching torso!!";}
case DI_HOT_ARMS:
switch (dis.intensity) {
case 1: return "Hot arms";
case 2: return "Hot arms!";
case 3: return "Scorching arms!!";}
case DI_HOT_HANDS:
case 3: return "Scorching arms!!";}
case DI_HOT_HANDS:
switch (dis.intensity) {
case 1: return "Hot hands";
case 2: return "Hot hands!";
case 3: return "Scorching hands!!";}
case DI_HOT_LEGS:
case 3: return "Scorching hands!!";}
case DI_HOT_LEGS:
switch (dis.intensity) {
case 1: return "Hot legs";
case 2: return "Hot legs!";
case 3: return "Scorching legs!!";}
case DI_HOT_FEET:
case 3: return "Scorching legs!!";}
case DI_HOT_FEET:
switch (dis.intensity) {
case 1: return "Hot feet";
case 2: return "Hot feet!";
case 3: return "Scorching feet!!";}
case 3: return "Scorching feet!!";}
case DI_BLISTERS_MOUTH: return "Blisters - face";
case DI_BLISTERS_TORSO: return "Blisters - torso";
case DI_BLISTERS_ARMS: return "Blisters - arms";
@@ -1128,7 +1287,7 @@ std::string dis_name(disease dis)
if (dis.duration > 800) return "Heavy Asthma";
return "Asthma";
case DI_GRACK: return "UNLEASH THE GRACKEN!!!!";
case DI_GRACK: return "RELEASE THE GRACKEN!!!!";
case DI_METH:
if (dis.duration > 600) return "High on Meth";
@@ -1136,6 +1295,8 @@ std::string dis_name(disease dis)
case DI_IN_PIT: return "Stuck in Pit";
case DI_STEMCELL_TREATMENT: return "Stem cell treatment";
case DI_ATTACK_BOOST: return "Hit Bonus";
case DI_DAMAGE_BOOST: return "Damage Bonus";
case DI_DODGE_BOOST: return "Dodge Bonus";
@@ -1147,6 +1308,15 @@ std::string dis_name(disease dis)
case 2: return "Viper Strike Unlocked!";
default: return "VIPER BUG!!!!";
}
case DI_BITE:
if (dis.duration > 3000) return "Bite Wound";
return "Painful Bite Wound";
case DI_INFECTED:
if (dis.duration > 10800) return "Infected Wound";
if (dis.duration > 7200) return "Painful Infected Wound";
return "Puss Filled Wound";
case DI_RECOVER: return "Recovering From Infection";
break;
default: return "";
@@ -1165,49 +1335,49 @@ std::string dis_description(disease dis)
case DI_GLARE:
return "Perception - 1";
case DI_COLD_HEAD:
case DI_COLD_HEAD:
switch (dis.intensity) {
case 1: return "Your head is exposed to the cold.";
case 2: return "Your head is very exposed to the cold. It is hard to concentrate.";
case 3: return "Your head is dangerously cold. Getting undressed sounds like a good idea.";}
case DI_COLD_EYES:
case DI_COLD_EYES:
switch (dis.intensity) {
case 1: return "Your eyes are exposed to the cold.";
case 2: return "Your eyes are very exposed to the cold.";
case 3: return "Your eyes are dangerously cold.";}
case DI_COLD_MOUTH:
case DI_COLD_MOUTH:
switch (dis.intensity) {
case 1: return "Your mouth is exposed to the cold.";
case 2: return "Your mouth is very exposed to the cold.";
case 3: return "Your mouth is dangerously cold.";}
case DI_COLD_TORSO:
case DI_COLD_TORSO:
switch (dis.intensity) {
case 1: return "Your torso is exposed to the cold.";
case 2: return "Your torso is very exposed to the cold. Your actions are incoordinated.";
case 3: return "Your torso is dangerously cold. Your actions are incredibly incoordinated.";}
case DI_COLD_ARMS:
case DI_COLD_ARMS:
switch (dis.intensity) {
case 1: return "Your arms are exposed to the cold.";
case 2: return "Your arms are very exposed to the cold. Your arms are shivering.";
case 3: return "Your arms is dangerously cold. Your arms are shivering uncontrollably";}
case DI_COLD_HANDS:
case DI_COLD_HANDS:
switch (dis.intensity) {
case 1: return "Your hands are exposed to the cold.";
case 2: return "Your hands are very exposed to the cold. Your hands are shivering.";
case 3: return "Your hands is dangerously cold. Your hands are shivering uncontrollably";}
case DI_COLD_LEGS:
case DI_COLD_LEGS:
switch (dis.intensity) {
case 1: return "Your legs are exposed to the cold.";
case 2: return "Your legs are very exposed to the cold. Your strength is sapped.";
case 3: return "Your legs is dangerously cold. Your strength is sapped.";}
case DI_COLD_FEET:
case DI_COLD_FEET:
switch (dis.intensity) {
case 1: return "Your feet are exposed to the cold.";
case 2: return "Your feet are very exposed to the cold. Your strength is sapped.";
@@ -1239,41 +1409,41 @@ std::string dis_description(disease dis)
case DI_FROSTBITE_LEGS: return "\
Your legs are frostbitten from prolonged exposure to the cold. It is extremely painful.";
case DI_HOT_HEAD:
case DI_HOT_HEAD:
switch (dis.intensity) {
case 1: return "Your head feels warm.";
case 2: return "Your head is sweating from the heat. You feel nauseated. You have a headache.";
case 3: return "Your head is sweating profusely. You feel very nauseated. You have a headache.";}
case 3: return "Your head is sweating profusely. You feel very nauseated. You have a headache.";}
case DI_HOT_TORSO:
case DI_HOT_TORSO:
switch (dis.intensity) {
case 1: return "Your torso feels warm.";
case 2: return "Your torso is sweating from the heat. You feel weak.";
case 3: return "Your torso is sweating profusely. You feel very weak.";}
case 3: return "Your torso is sweating profusely. You feel very weak.";}
case DI_HOT_ARMS:
case DI_HOT_ARMS:
switch (dis.intensity) {
case 1: return "Your arms feel warm.";
case 2: return "Your arms are sweating from the heat.";
case 3: return "Your arms are sweating profusely. Your muscles are in pain due to cramps.";}
case 3: return "Your arms are sweating profusely. Your muscles are in pain due to cramps.";}
case DI_HOT_HANDS:
case DI_HOT_HANDS:
switch (dis.intensity) {
case 1: return "Your hands feel warm.";
case 2: return "Your hands feel hot and incoordinated.";
case 3: return "Your hands feel disgustinly hot and are very incoordinated.";}
case 3: return "Your hands feel disgustinly hot and are very incoordinated.";}
case DI_HOT_LEGS:
case DI_HOT_LEGS:
switch (dis.intensity) {
case 1: return "Your legs feel warm.";
case 2: return "Your legs are sweating from the heat.";
case 3: return "Your legs are sweating profusely. Your muscles are in pain due to cramps.";}
case 3: return "Your legs are sweating profusely. Your muscles are in pain due to cramps.";}
case DI_HOT_FEET:
case DI_HOT_FEET:
switch (dis.intensity) {
case 1: return "Your feet feel hot.";
case 2: return "Your feet are painfully swollen due to the heat.";
case 3: return "Your feet are painfully swollen due to the heat.";}
case 3: return "Your feet are painfully swollen due to the heat.";}
case DI_BLISTERS_MOUTH: return "\
Your face is blistering from the intense heat. It is extremely painful.";
@@ -1468,6 +1638,15 @@ will deal piercing damage.";
Your next strike will be a Viper Strike. It requires both arms to be in good\n\
condition, and deals massive damage.";
}
case DI_BITE:
return "\
You have a nasty bite wound.";
case DI_INFECTED:
return "\
You have an infected wound.";
case DI_RECOVER: return "\
You are recovering from an infection.";
default:
return "Who knows? This is probably a bug.";
+2 -2
View File
@@ -8,9 +8,9 @@
enum material {
MNULL = 0,
//Food Materials
LIQUID, VEGGY, FLESH, POWDER,
LIQUID, VEGGY, FLESH, POWDER, HFLESH, //Human Flesh.
//Clothing
COTTON, WOOL, LEATHER, KEVLAR,
COTTON, WOOL, LEATHER, KEVLAR, FUR,
//Other
STONE, PAPER, WOOD, PLASTIC, GLASS, IRON, STEEL, SILVER
};
+3 -1
View File
@@ -2,6 +2,7 @@
#include "npc.h"
#include "game.h"
#include "rng.h"
#include "options.h"
void event::actualize(game *g)
{
@@ -220,7 +221,8 @@ void event::per_turn(game *g)
{
switch (type) {
case EVENT_WANTED: {
if (g->levz >= 0 && one_in(100)) { // About once every 10 minutes
// About once every 10 minutes. Suppress in classic zombie mode.
if (g->levz >= 0 && one_in(100) && !OPTIONS[OPT_CLASSIC_ZOMBIES]) {
monster eyebot(g->mtypes[mon_eyebot]);
eyebot.faction_id = faction_id;
point place = g->m.random_outdoor_tile();
+29 -23
View File
@@ -822,7 +822,7 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
case fd_web:
if (!z->has_flag(MF_WEBWALK)) {
z->speed *= .8;
z->moves *= .8;
remove_field(x, y);
}
break;
@@ -838,7 +838,7 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
break;
case fd_sap:
z->speed -= cur->density * 5;
z->moves -= cur->density * 5;
if (cur->density == 1)
remove_field(x, y);
else
@@ -880,14 +880,16 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
// Drop through to smoke
case fd_smoke:
if (cur->density == 3)
z->speed -= rng(10, 20);
if (z->made_of(VEGGY)) // Plants suffer from smoke even worse
z->speed -= rng(1, cur->density * 12);
if (!z->has_flag(MF_NO_BREATHE)){
if (cur->density == 3)
z->moves -= rng(10, 20);
if (z->made_of(VEGGY)) // Plants suffer from smoke even worse
z->moves -= rng(1, cur->density * 12);
}
break;
case fd_tear_gas:
if (z->made_of(FLESH) || z->made_of(VEGGY)) {
if ((z->made_of(FLESH) || z->made_of(VEGGY)) && !z->has_flag(MF_NO_BREATHE)) {
z->add_effect(ME_BLIND, cur->density * 8);
if (cur->density == 3) {
z->add_effect(ME_STUNNED, rng(10, 20));
@@ -898,31 +900,35 @@ void map::mon_in_field(int x, int y, game *g, monster *z)
} else
z->add_effect(ME_STUNNED, rng(1, 5));
if (z->made_of(VEGGY)) {
z->speed -= rng(cur->density * 5, cur->density * 12);
z->moves -= rng(cur->density * 5, cur->density * 12);
dam += cur->density * rng(8, 14);
}
}
break;
case fd_toxic_gas:
dam = cur->density;
z->speed -= cur->density;
if(!z->has_flag(MF_NO_BREATHE)){
dam = cur->density;
z->moves -= cur->density;
}
break;
case fd_nuke_gas:
if (cur->density == 3) {
z->speed -= rng(60, 120);
dam = rng(30, 50);
} else if (cur->density == 2) {
z->speed -= rng(20, 50);
dam = rng(10, 25);
} else {
z->speed -= rng(0, 15);
dam = rng(0, 12);
}
if (z->made_of(VEGGY)) {
z->speed -= rng(cur->density * 5, cur->density * 12);
dam *= cur->density;
if(!z->has_flag(MF_NO_BREATHE)){
if (cur->density == 3) {
z->moves -= rng(60, 120);
dam = rng(30, 50);
} else if (cur->density == 2) {
z->moves -= rng(20, 50);
dam = rng(10, 25);
} else {
z->moves -= rng(0, 15);
dam = rng(0, 12);
}
if (z->made_of(VEGGY)) {
z->moves -= rng(cur->density * 5, cur->density * 12);
dam *= cur->density;
}
}
break;
+1142 -1171
View File
File diff suppressed because it is too large Load Diff
+40 -23
View File
@@ -27,6 +27,20 @@
#include <map>
#include <stdarg.h>
// Fixed window sizes
#define HP_HEIGHT 14
#define HP_WIDTH 7
#define MINIMAP_HEIGHT 7
#define MINIMAP_WIDTH 7
#define MONINFO_HEIGHT 12
#define MONINFO_WIDTH 48
#define MESSAGES_HEIGHT 8
#define MESSAGES_WIDTH 48
#define LOCATION_HEIGHT 1
#define LOCATION_WIDTH 48
#define STATUS_HEIGHT 4
#define STATUS_WIDTH 55
#define LONG_RANGE 10
#define BLINK_SPEED 300
#define BULLET_SPEED 10000000
@@ -83,6 +97,7 @@ class game
public:
game();
~game();
void init_ui();
void setup();
bool game_quit(); // True if we actually quit the game - used in main.cpp
quit_status uquit; // used in main.cpp to determine what type of quit
@@ -204,6 +219,9 @@ class game
void consume_items(std::vector<component> components);
void consume_tools(std::vector<component> tools);
bool has_gametype() const { return gamemode && gamemode->id() != SGAME_NULL; }
special_game_id gametype() const { return (gamemode) ? gamemode->id() : SGAME_NULL; }
std::vector <itype*> itypes;
std::vector <mtype*> mtypes;
std::vector <vehicle*> vtypes;
@@ -230,7 +248,6 @@ class game
std::vector<monster_and_count> coming_to_stairs;
int monstairx, monstairy, monstairz;
std::vector<npc> active_npc;
std::vector<mon_id> moncats[num_moncats];
std::vector<faction> factions;
std::vector<mission> active_missions; // Missions which may be assigned
// NEW: Dragging a piece of furniture, with a list of items contained
@@ -239,11 +256,8 @@ class game
int weight_dragged; // Computed once, when you start dragging
bool debugmon;
bool no_npc;
// Display data... TODO: Make this more portable?
int VIEWX;
int VIEWY;
int TERRAIN_WINDOW_WIDTH;
int TERRAIN_WINDOW_HEIGHT;
std::map<int, std::map<int, bool> > mapRain;
WINDOW *w_terrain;
WINDOW *w_minimap;
@@ -252,11 +266,14 @@ class game
WINDOW *w_messages;
WINDOW *w_location;
WINDOW *w_status;
WINDOW *w_void; //space unter status if viewport Y > 12
overmap *om_hori, *om_vert, *om_diag; // Adjacent overmaps
private:
// Game-start procedures
bool opening_screen();// Warn about screen size, then present the main menu
void print_menu(WINDOW* w_open, int iSel, const int iMenuOffsetX, int iMenuOffsetY, bool bShowDDA = true);
void print_menu_items(WINDOW* w_in, std::vector<std::string> vItems, int iSel, int iOffsetY, int iOffsetX);
bool load_master(); // Load the master data file, with factions &c
void load(std::string name); // Load a player-specific save file
void start_game(); // Starts a new game
@@ -266,7 +283,7 @@ class game
void init_itypes(); // Initializes item types
void init_mapitems(); // Initializes item placement
void init_mtypes(); // Initializes monster types
void init_moncats(); // Initializes monster categories
void init_mongroups(); // Initualizes monster groups
void init_monitems(); // Initializes monster inventory selection
void init_traps(); // Initializes trap types
void init_recipes(); // Initializes crafting recipes
@@ -296,6 +313,9 @@ class game
void close(); // Close a door 'c'
void smash(); // Smash terrain
void craft(); // See crafting.cpp
void recraft(); // See crafting.cpp
void try_and_make(recipe *r);
bool can_make(recipe *r);
void make_craft(recipe *making); // See crafting.cpp
void complete_craft(); // See crafting.cpp
void pick_recipes(std::vector<recipe*> &current,
@@ -319,24 +339,27 @@ class game
// Pick where to put liquid; false if it's left where it was
bool handle_liquid(item &liquid, bool from_ground, bool infinite);
void compare(int iCompareX = -999, int iCompareY = -999); // Compare two Items 'I'
void drop(); // Drop an item 'd'
void drop(char chInput = '.'); // Drop an item 'd'
void drop_in_direction(); // Drop w/ direction 'D'
void reassign_item(); // Reassign the letter of an item '='
void butcher(); // Butcher a corpse 'B'
void complete_butcher(int index); // Finish the butchering process
void forage(); // Foraging ('a' on underbrush)
void eat(); // Eat food or fuel 'E' (or 'a')
void use_item();// Use item; also tries E,R,W 'a'
void eat(char chInput = '.'); // Eat food or fuel 'E' (or 'a')
void use_item(char chInput = '.');// Use item; also tries E,R,W 'a'
void use_wielded_item();
void wear(); // Wear armor 'W' (or 'a')
void takeoff(); // Remove armor 'T'
void wear(char chInput = '.'); // Wear armor 'W' (or 'a')
void takeoff(char chInput = '.'); // Remove armor 'T'
void reload(); // Reload a wielded gun/tool 'r'
void reload(char chInput);
void unload(); // Unload a wielded gun/tool 'U'
void wield(); // Wield a weapon 'w'
void unload(char chInput);
void wield(char chInput = '.'); // Wield a weapon 'w'
void read(); // Read a book 'R' (or 'a')
void chat(); // Talk to a nearby NPC 'C'
void plthrow(); // Throw an item 't'
void plthrow(char chInput = '.'); // Throw an item 't'
void help(); // Help screen '?'
void show_options(); // Options screen '?'
// Target is an interactive function which allows the player to choose a nearby
// square. It display information on any monster/NPC on that square, and also
@@ -349,23 +372,21 @@ class game
// Map updating and monster spawning
void replace_stair_monsters();
void update_stair_monsters();
void despawn_monsters(const bool stairs = false, const int shiftx = 0, const int shifty = 0);
void spawn_mon(int shift, int shifty); // Called by update_map, sometimes
mon_id valid_monster_from(std::vector<mon_id> group);
int valid_group(mon_id type, int x, int y);// Picks a group from cur_om
moncat_id mt_to_mc(mon_id type);// Monster type to monster category
int valid_group(mon_id type, int x, int y, int z);// Picks a group from cur_om
void set_adjacent_overmaps(bool from_scratch = false);
// Routine loop functions, approximately in order of execution
void cleanup_dead(); // Delete any dead NPCs/monsters
void monmove(); // Monster movement
void rustCheck(); // Degrades practice levels
void update_bodytemp(); // Maintains body temperature
void process_events(); // Processes and enacts long-term events
void process_activity(); // Processes and enacts the player's activity
void update_weather(); // Updates the temperature and weather patten
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)
input_ret get_input(int timeout_ms); // Gets player input and calls the proper function
bool handle_action();
void update_scent(); // Updates the scent map
bool is_game_over(); // Returns true if the player quit or died
void death_screen(); // Display our stats, "GAME OVER BOO HOO"
@@ -383,10 +404,6 @@ class game
void disp_NPCs(); // Currently UNUSED. Lists global NPCs.
void list_missions(); // Listed current, completed and failed missions.
// If x & y are OOB, creates a new overmap and returns the proper terrain; also,
// may mark the square as seen by the player
oter_id ter_at(int x, int y, bool& mark_as_seen);
// Debug functions
void debug(); // All-encompassing debug screen. TODO: This.
void display_scent(); // Displays the scent map
+2 -1
View File
@@ -22,4 +22,5 @@ graffiti graffiti::operator=(graffiti rhs)
this->contents = new std::string(*rhs.contents);
else
this->contents = 0;
}
return *this;
}
+1 -1
View File
@@ -15,4 +15,4 @@ public:
std::string *contents;
};
#endif
#endif
+352 -371
View File
File diff suppressed because it is too large Load Diff
+111
View File
@@ -0,0 +1,111 @@
#include "cursesdef.h"
#include "input.h"
/* TODO Replace the hardcoded values with an abstraction layer.
* Lower redundancy across the methods. */
InputEvent get_input(int ch)
{
if (ch == '\0')
ch = getch();
switch(ch)
{
case 'k':
case '8':
case KEY_UP:
return DirectionN;
case 'j':
case '2':
case KEY_DOWN:
return DirectionS;
case 'l':
case '6':
case KEY_RIGHT:
return DirectionE;
case 'h':
case '4':
case KEY_LEFT:
return DirectionW;
case 'y':
case '7':
return DirectionNW;
case 'u':
case '9':
return DirectionNE;
case 'b':
case '1':
return DirectionSW;
case 'n':
case '3':
return DirectionSE;
case '.':
case '5':
return DirectionNone;
case '>':
return DirectionDown;
case '<':
return DirectionUp;
case '\n':
return Confirm;
case ' ':
return Close;
case 27: /* TODO Fix delay */
case 'q':
return Cancel;
case '?':
return Help;
case ',':
case 'g':
return Pickup;
default:
return Undefined;
}
}
void get_direction(int &x, int &y, InputEvent &input)
{
x = 0;
y = 0;
switch(input) {
case DirectionN:
--y;
break;
case DirectionS:
++y;
break;
case DirectionE:
++x;
break;
case DirectionW:
--x;
break;
case DirectionNW:
--x;
--y;
break;
case DirectionNE:
++x;
--y;
break;
case DirectionSW:
--x;
++y;
break;
case DirectionSE:
++x;
++y;
break;
case DirectionNone:
case Pickup:
break;
default:
x = -2;
y = -2;
}
}
+31
View File
@@ -0,0 +1,31 @@
#ifndef _INPUT_H_
#define _INPUT_H_
enum InputEvent {
Confirm,
Cancel,
Close,
Help,
DirectionN,
DirectionS,
DirectionE,
DirectionW,
DirectionNW,
DirectionNE,
DirectionSE,
DirectionSW,
DirectionNone,
DirectionDown, /* Think stairs */
DirectionUp,
Pickup,
Nothing,
Undefined
};
InputEvent get_input(int ch = '\0');
void get_direction(int &x, int &y, InputEvent &input);
#endif
+1 -1
View File
@@ -202,7 +202,7 @@ void inventory::form_from_map(game *g, point origin, int range)
add_item(fire);
}
ter_id terrain_id = g->m.ter(x, y);
if (terrain_id == t_toilet || terrain_id == t_sink || terrain_id == t_water_sh || terrain_id == t_water_dp){
if (terrain_id == t_toilet || terrain_id == t_water_sh || terrain_id == t_water_dp){
item water(g->itypes[itm_water], 0);
water.charges = 50;
add_item(water);
+89 -83
View File
@@ -6,9 +6,49 @@
#include <map>
#include <sstream>
std::string CATEGORIES[9] =
{"GROUND:", "FIREARMS:", "AMMUNITION:", "CLOTHING:", "COMESTIBLES:",
"TOOLS:", "BOOKS:", "WEAPONS:", "OTHER:"};
const int iCategorieNum = 11;
std::string CATEGORIES[iCategorieNum] =
{"GROUND:", "FIREARMS:", "AMMUNITION:", "CLOTHING:", "FOOD/DRINKS:",
"TOOLS:", "BOOKS:", "WEAPONS:", "MODS/BIONICS", "MEDICINE/DRUGS", "OTHER:"};
std::vector<int> find_firsts(inventory &inv)
{
std::vector<int> firsts;
for (int i = 0; i < iCategorieNum-1; i++) {
firsts.push_back(-1);
}
for (int i = 0; i < inv.size(); i++) {
if (firsts[0] == -1 && inv[i].is_gun()) {
firsts[0] = i;
} else if (firsts[1] == -1 && inv[i].is_ammo()) {
firsts[1] = i;
} else if (firsts[2] == -1 && inv[i].is_armor()) {
firsts[2] = i;
} else if (firsts[3] == -1 && inv[i].is_food_container()) {
firsts[3] = i;
} else if (inv[i].is_food()) {
it_comest* comest = dynamic_cast<it_comest*>(inv[i].type);
if (firsts[3] == -1 && comest->comesttype != "MED") {
firsts[3] = i;
} else if (firsts[8] == -1 && comest->comesttype == "MED") {
firsts[8] = i;
}
} else if (firsts[4] == -1 && inv[i].is_tool()) {
firsts[4] = i;
} else if (firsts[5] == -1 && inv[i].is_book()) {
firsts[5] = i;
} else if (firsts[6] == -1 && inv[i].is_weap()) {
firsts[6] = i;
} else if (firsts[7] == -1 && (inv[i].is_gunmod() || inv[i].is_bionic())) {
firsts[7] = i;
} else if (firsts[9] == -1 && inv[i].is_other()) {
firsts[9] = i;
}
}
return firsts;
}
void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
std::vector<char> dropped_items)
@@ -32,15 +72,8 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
wprintz(w_inv, c_ltgray, "%d", g->u.volume_carried());
wprintw(w_inv, "/%d", g->u.volume_capacity() - 2);
// Print items carried
int n_items = 0;
for(int ch='a'; ch <= 'z'; ++ch)
n_items += ((g->u.inv.index_by_letter(ch) == -1) ? 0 : 1);
for(int ch='A'; ch <= 'Z'; ++ch)
n_items += ((g->u.inv.index_by_letter(ch) == -1) ? 0 : 1);
mvwprintw(w_inv, 1, 62, "Items: %d/52 ", n_items);
// Print our weapon
int n_items = 0;
mvwprintz(w_inv, 2, 45, c_magenta, "WEAPON:");
int dropping_weapon = false;
for (int i = 0; i < dropped_items.size() && !dropping_weapon; i++) {
@@ -48,21 +81,24 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
dropping_weapon = true;
}
if (g->u.is_armed()) {
n_items++;
if (dropping_weapon)
mvwprintz(w_inv, 3, 45, c_white, "%c + %s", g->u.weapon.invlet,
g->u.weapname().c_str());
else
mvwprintz(w_inv, 3, 45, g->u.weapon.color_in_inventory(&(g->u)), "%c - %s",
g->u.weapon.invlet, g->u.weapname().c_str());
} else if (g->u.weapon.is_style())
} else if (g->u.weapon.is_style()) {
n_items++;
mvwprintz(w_inv, 3, 45, c_ltgray, "%c - %s",
g->u.weapon.invlet, g->u.weapname().c_str());
else
mvwprintz(w_inv, 3, 42, c_ltgray, g->u.weapname().c_str());
} else
mvwprintz(w_inv, 3, 45, c_ltgray, g->u.weapname().c_str());
// Print worn items
if (g->u.worn.size() > 0)
mvwprintz(w_inv, 5, 45, c_magenta, "ITEMS WORN:");
for (int i = 0; i < g->u.worn.size(); i++) {
n_items++;
bool dropping_armor = false;
for (int j = 0; j < dropped_items.size() && !dropping_armor; j++) {
if (dropped_items[j] == g->u.worn[i].invlet)
@@ -75,42 +111,19 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
mvwprintz(w_inv, 6 + i, 45, c_ltgray, "%c - %s", g->u.worn[i].invlet,
g->u.worn[i].tname(g).c_str());
}
}
std::vector<int> find_firsts(inventory &inv)
{
std::vector<int> firsts;
for (int i = 0; i < 8; i++)
firsts.push_back(-1);
for (int i = 0; i < inv.size(); i++) {
if (firsts[0] == -1 && inv[i].is_gun())
firsts[0] = i;
else if (firsts[1] == -1 && inv[i].is_ammo())
firsts[1] = i;
else if (firsts[2] == -1 && inv[i].is_armor())
firsts[2] = i;
else if (firsts[3] == -1 &&
(inv[i].is_food() || inv[i].is_food_container()))
firsts[3] = i;
else if (firsts[4] == -1 && (inv[i].is_tool() || inv[i].is_gunmod() ||
inv[i].is_bionic()))
firsts[4] = i;
else if (firsts[5] == -1 && inv[i].is_book())
firsts[5] = i;
else if (firsts[6] == -1 && inv[i].is_weap())
firsts[6] = i;
else if (firsts[7] == -1 && inv[i].is_other())
firsts[7] = i;
}
return firsts;
// Print items carried
for(int ch='a'; ch <= 'z'; ++ch)
n_items += ((g->u.inv.index_by_letter(ch) == -1) ? 0 : 1);
for(int ch='A'; ch <= 'Z'; ++ch)
n_items += ((g->u.inv.index_by_letter(ch) == -1) ? 0 : 1);
mvwprintw(w_inv, 1, 62, "Items: %d/52 ", n_items);
}
// Display current inventory.
char game::inv(std::string title)
{
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), 0, 0);
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
const int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
char ch = '.';
int start = 0, cur_it;
@@ -141,7 +154,7 @@ char game::inv(std::string title)
// Clear the current line;
mvwprintw(w_inv, cur_line, 0, " ");
// Print category header
for (int i = 1; i < 9; i++) {
for (int i = 1; i < iCategorieNum; i++) {
if (cur_it == firsts[i-1]) {
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
cur_line++;
@@ -180,7 +193,7 @@ char game::inv_type(std::string title, int inv_item_type)
// this function lists inventory objects by type
// refer to enum item_cat in itype.h for list of categories
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), 0, 0);
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
const int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
char ch = '.';
int start = 0, cur_it;
@@ -260,7 +273,7 @@ char game::inv_type(std::string title, int inv_item_type)
// Clear the current line;
mvwprintw(w_inv, cur_line, 0, " ");
for (int i = 1; i < 9; i++) {
for (int i = 1; i < iCategorieNum; i++) {
if (cur_it == firsts[i-1]) {
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
cur_line++;
@@ -301,7 +314,7 @@ std::vector<item> game::multidrop()
{
u.sort_inv();
u.inv.restack(&u);
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), 0, 0);
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
const int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
int dropping[u.inv.size()]; // Count of how many we'll drop from each stack
for (int i = 0; i < u.inv.size(); i++)
@@ -335,7 +348,7 @@ std::vector<item> game::multidrop()
// Clear the current line;
mvwprintw(w_inv, cur_line, 0, " ");
// Print category header
for (int i = 1; i < 9; i++) {
for (int i = 1; i < iCategorieNum; i++) {
if (cur_it == firsts[i-1]) {
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
cur_line++;
@@ -434,40 +447,32 @@ std::vector<item> game::multidrop()
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--;
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++) {
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 (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];
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));
}
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));
}
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++;
}
@@ -518,8 +523,9 @@ void game::compare(int iCompareX, int iCompareY)
const int groundsize = (grounditems.size() > 10 ? 10 : grounditems.size());
u.sort_inv();
u.inv.restack(&u);
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), 0, 0);
int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
WINDOW* w_inv = newwin(TERMY-VIEW_OFFSET_Y*2, TERMX-VIEW_OFFSET_X*2, VIEW_OFFSET_Y, VIEW_OFFSET_X);
int maxitems = TERMY-5-VIEW_OFFSET_Y*2; // Number of items to show at one time.
int compare[u.inv.size() + groundsize]; // Count of how many we'll drop from each stack
bool bFirst = false; // First Item selected
bool bShowCompare = false;
@@ -561,7 +567,7 @@ void game::compare(int iCompareX, int iCompareY)
// Clear the current line;
mvwprintw(w_inv, cur_line, 0, " ");
// Print category header
for (int i = iHeaderOffset; i < 9; i++) {
for (int i = iHeaderOffset; i < iCategorieNum; i++) {
if (cur_it == firsts[i-iHeaderOffset]) {
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
cur_line++;
@@ -692,8 +698,8 @@ void game::compare(int iCompareX, int iCompareY)
sItemCh = u.i_at(ch).tname(this);
}
compare_split_screen_popup(true, sItemLastCh, vItemLastCh, vItemCh);
compare_split_screen_popup(false, sItemCh, vItemCh, vItemLastCh);
compare_split_screen_popup(0, (TERMX-VIEW_OFFSET_X*2)/2, TERMY-VIEW_OFFSET_Y*2, sItemLastCh, vItemLastCh, vItemCh);
compare_split_screen_popup((TERMX-VIEW_OFFSET_X*2)/2, (TERMX-VIEW_OFFSET_X*2)/2, TERMY-VIEW_OFFSET_Y*2, sItemCh, vItemCh, vItemLastCh);
wclear(w_inv);
print_inv_statics(this, w_inv, "Compare:", weapon_and_armor);
+18 -5
View File
@@ -444,7 +444,7 @@ std::string item::info(bool showtext, std::vector<iteminfo> *dump)
//dump << "\n Recoil: ";
temp1.str("");
if (has_ammo)
temp1 << ammo_dam; //dump << ammo_recoil;
temp1 << ammo_recoil; //dump << ammo_recoil;
temp1 << (recoil(false) >= 0 ? "+" : "" );
//dump << (recoil(false) >= 0 ? "+" : "" ) << recoil(false);
@@ -667,7 +667,7 @@ nc_color item::color(player *u)
}
} else if (is_book()) {
it_book* tmp = dynamic_cast<it_book*>(type);
if (tmp->type && tmp->intel <= u->int_cur + u->skillLevel(tmp->type).level() &&
if (tmp->type && tmp->intel <= u->int_cur + u->skillLevel(tmp->type) &&
(tmp->intel == 0 || !u->has_trait(PF_ILLITERATE)) &&
(u->skillLevel(tmp->type) >= tmp->req) &&
(u->skillLevel(tmp->type) < tmp->level))
@@ -799,7 +799,7 @@ std::string item::tname(game *g)
food = dynamic_cast<it_comest*>(contents[0].type);
if (food != NULL && g != NULL && food->spoils != 0 &&
int(g->turn) < (int)bday + 100)
ret << " (hot)";
ret << " (fresh)";
if (food != NULL && g != NULL && food->spoils != 0 &&
int(g->turn) - (int)bday > food->spoils * 600)
ret << " (rotten)";
@@ -1176,6 +1176,19 @@ bool item::is_gun()
return type->is_gun();
}
bool item::is_silent()
{
if ( is_null() )
return false;
// So far only gun code uses this check
return type->is_gun() && (
noise() < 5 || // almost silent
curammo->type == AT_BOLT || // crossbows
curammo->type == AT_ARROW // bows
);
}
bool item::is_gunmod()
{
if( is_null() )
@@ -1372,7 +1385,7 @@ int item::reload_time(player &u)
if (spare_mag != -1 && contents[spare_mag].charges > 0)
ret -= double(ret) * 0.9;
}
double skill_bonus = double(u.skillLevel(reloading->skill_used).level()) * .075;
double skill_bonus = double(u.skillLevel(reloading->skill_used)) * .075;
if (skill_bonus > .75)
skill_bonus = .75;
ret -= double(ret) * skill_bonus;
@@ -1672,7 +1685,7 @@ int item::pick_reload_ammo(player &u, bool interactive)
int index = -1;
if (am.size() > 1 && interactive) {// More than one option; list 'em and pick
WINDOW* w_ammo = newwin(am.size() + 1, 80, 0, 0);
WINDOW* w_ammo = newwin(am.size() + 1, 80, VIEW_OFFSET_Y, VIEW_OFFSET_X);
char ch;
clear();
it_ammo* ammo_type;
+1
View File
@@ -117,6 +117,7 @@ public:
bool is_bashing_weapon();
bool is_cutting_weapon();
bool is_gun();
bool is_silent();
bool is_gunmod();
bool is_bionic();
bool is_ammo();
+92 -82
View File
@@ -40,14 +40,14 @@ itm_fire, itm_toolset, itm_apparatus,
// Drinks
itm_water, itm_water_clean, itm_sewage, itm_salt_water, itm_oj, itm_apple_cider,
itm_energy_drink, itm_cola, itm_rootbeer, itm_milk, itm_V8, itm_broth,
itm_soup, itm_whiskey, itm_vodka, itm_gin, itm_rum, itm_tequila, itm_triple_sec,
itm_soup_veggy, itm_soup_meat, itm_whiskey, itm_vodka, itm_gin, itm_rum, itm_tequila, itm_triple_sec,
itm_long_island, itm_beer, itm_bleach,
itm_ammonia, itm_mutagen, itm_purifier, itm_tea, itm_coffee, itm_blood,
// Monster Meats
itm_meat, itm_veggy, itm_human_flesh, itm_veggy_wild, itm_meat_tainted, itm_veggy_tainted,
itm_meat_cooked, itm_veggy_cooked, itm_veggy_wild_cooked,
itm_bone, itm_plant_sac, itm_meat, itm_veggy, itm_human_flesh, itm_veggy_wild, itm_meat_tainted, itm_veggy_tainted,
itm_meat_cooked, itm_veggy_cooked, itm_veggy_wild_cooked,
// Food
itm_apple, itm_orange, itm_lemon, itm_chips, itm_chips2, itm_chips3,
itm_apple, itm_orange, itm_lemon, itm_chips, itm_chips2, itm_chips3,
itm_pretzels, itm_chocolate,
itm_jerky, itm_sandwich_t, itm_candy, itm_mushroom, itm_mushroom_poison,
itm_mushroom_magic, itm_blueberries, itm_strawberries, itm_tomato,
@@ -58,7 +58,7 @@ itm_apple, itm_orange, itm_lemon, itm_chips, itm_chips2, itm_chips3,
itm_can_tuna, itm_can_catfood, itm_honeycomb, itm_wax, itm_royal_jelly, itm_fetus,
itm_arm, itm_leg, itm_ant_egg, itm_marloss_berry, itm_flour, itm_sugar,
itm_salt, itm_potato_raw, itm_potato_baked, itm_bread, itm_pie, itm_pizza,
itm_mre_beef, itm_mre_veggy, itm_tea_raw, itm_coffee_raw,
itm_mre_beef, itm_mre_veggy, itm_tea_raw, itm_coffee_raw, itm_jihelucake,
// Medication
itm_bandages, itm_1st_aid, itm_vitamins, itm_aspirin, itm_caffeine,
itm_pills_sleep, itm_iodine, itm_dayquil, itm_nyquil, itm_inhaler, itm_codeine,
@@ -69,25 +69,26 @@ itm_bandages, itm_1st_aid, itm_vitamins, itm_aspirin, itm_caffeine,
itm_wrapper, itm_withered, itm_syringe, itm_fur, itm_leather, itm_superglue,
itm_id_science, itm_id_military, itm_electrohack, itm_string_6, itm_string_36,
itm_rope_6, itm_rope_30, itm_chain, itm_processor, itm_RAM, itm_power_supply,
itm_amplifier, itm_transponder, itm_receiver, itm_antenna, itm_steel_chunk,
itm_amplifier, itm_transponder, itm_receiver, itm_burnt_out_bionic,
itm_antenna, itm_steel_chunk,
itm_steel_lump, itm_scrap, itm_hose, itm_glass_sheet, itm_manhole_cover, itm_rock,
itm_stick, itm_broom,
itm_hammer_sledge, itm_hatchet, itm_nailboard, itm_nailbat,
itm_xacto, itm_scalpel, itm_pot, itm_pan, itm_knife_butter, itm_2x4, itm_muffler,
itm_pot, itm_pan, itm_knife_butter, itm_2x4, itm_muffler,
itm_pipe, itm_bat, itm_bat_metal,
itm_machete, itm_katana, itm_spear_wood, itm_spear_knife, itm_baton,
itm_spear_wood, itm_baton,
itm_bee_sting, itm_wasp_sting, itm_chitin_piece, itm_biollante_bud,
itm_canister_empty, itm_gold, itm_coal, itm_petrified_eye, itm_spiral_stone,
itm_rapier, itm_cane, itm_binoculars, itm_usb_drive, itm_pike, itm_broadsword,
itm_cane, itm_binoculars, itm_usb_drive,
itm_mace, itm_morningstar, itm_pool_cue, itm_pool_ball, itm_candlestick,
itm_carspike, itm_carblade, itm_wire, itm_wire_barbed, itm_rebar, itm_log,
itm_spike, itm_blade, itm_wire, itm_wire_barbed, itm_rebar, itm_log,
itm_splinter, itm_skewer, itm_crackpipe, itm_torch_done,
itm_spring, itm_lawnmower, itm_lawnmower_blade, itm_lawnmower_machete,
itm_lawnmower_halberd, itm_sheet, itm_broketent, itm_element,
itm_spring, itm_lawnmower, itm_sheet, itm_broketent, itm_element,
itm_television, itm_pilot_light, itm_toaster, itm_microwave, itm_laptop,
itm_fan, itm_ceramic_plate, itm_ceramic_bowl, itm_ceramic_cup,
itm_glass_plate, itm_glass_bowl, itm_glass, itm_tin_plate, itm_fork, itm_spork,
itm_foon, itm_rag_bloody, itm_clock, itm_clockworks,
itm_javelin, itm_rock_pot,
// Vehicle parts
itm_frame,
itm_wheel, itm_wheel_wide, itm_wheel_bicycle, itm_wheel_motorbike, itm_wheel_small,
@@ -96,13 +97,13 @@ itm_wrapper, itm_withered, itm_syringe, itm_fur, itm_leather, itm_superglue,
itm_v6_combustion, itm_v8_combustion,
itm_motor, itm_motor_large, itm_plasma_engine, itm_foot_crank,
itm_metal_tank, itm_storage_battery, itm_minireactor, itm_solar_panel,
itm_steel_plate, itm_alloy_plate, itm_spiked_plate, itm_hard_plate,
itm_sheet_metal, itm_steel_plate, itm_alloy_plate, itm_spiked_plate, itm_hard_plate,
// Footwear
itm_socks, itm_socks_wool,
itm_sneakers, itm_boots, itm_boots_steel, itm_boots_winter, itm_mocassins,
itm_flip_flops, itm_dress_shoes, itm_heels,
itm_sneakers_fit, itm_boots_fit, itm_boots_steel_fit, itm_boots_winter_fit,
itm_dress_shoes_fit, itm_heels_fit,
itm_dress_shoes_fit, itm_heels_fit, itm_boots_chitin,
// Legwear
itm_shorts, itm_shorts_cargo,
itm_jeans, itm_pants, itm_pants_leather, itm_pants_cargo, itm_pants_army, itm_pants_ski,
@@ -123,7 +124,7 @@ itm_armguard_soft, itm_armguard_hard, itm_armguard_chitin, itm_armguard_metal,
// Gloves
itm_gloves_liner, itm_gloves_light, itm_mittens, itm_gloves_wool, itm_gloves_winter,
itm_gloves_leather, itm_gloves_fingerless, itm_gloves_rubber,
itm_gloves_medical, itm_fire_gauntlets,
itm_gloves_medical, itm_fire_gauntlets, itm_gauntlets_chitin,
// Masks
itm_mask_dust, itm_bandana, itm_scarf, itm_mask_filter, itm_mask_gas,
// Eyewear
@@ -135,14 +136,15 @@ itm_hat_ball, itm_hat_boonie, itm_hat_cotton, itm_hat_knit, itm_hat_hunting, itm
itm_helmet_motor, itm_helmet_chitin, itm_helmet_plate, itm_tophat,
// High-storage
itm_backpack, itm_rucksack, itm_purse, itm_mbag, itm_fanny, itm_holster, itm_bootstrap,
itm_ragpouch, itm_leather_pouch,
// Decorative
itm_ring, itm_necklace,
// Ammunition
itm_battery, itm_thread, itm_duct_tape, itm_cable, itm_plut_cell,
itm_battery, itm_thread, itm_sinew, itm_plant_fibre, itm_duct_tape, itm_cable, itm_plut_cell,
itm_nail, itm_bb, itm_arrow_wood, itm_arrow_cf,
itm_bolt_wood, itm_bolt_steel, itm_shot_bird, itm_shot_00, itm_shot_slug,
itm_shot_he, itm_22_lr, itm_22_cb, itm_22_ratshot, itm_9mm, itm_9mmP,
itm_9mmP2, itm_38_special, itm_38_super, itm_10mm, itm_40sw, itm_44magnum,
itm_9mmP2, itm_762_25, itm_38_special, itm_38_super, itm_10mm, itm_40sw, itm_44magnum,
itm_45_acp, itm_45_jhp, itm_45_super, itm_57mm, itm_46mm, itm_762_m43,
itm_762_m87, itm_223, itm_556, itm_556_incendiary, itm_270, itm_3006,
itm_3006_incendiary, itm_308, itm_762_51, itm_762_51_incendiary,
@@ -160,15 +162,16 @@ itm_nailgun, itm_bbgun, itm_crossbow, itm_compbow, itm_longbow, itm_rifle_22,
itm_rifle_9mm, itm_smg_9mm, itm_smg_45, itm_sig_mosquito, itm_sw_22,
itm_glock_19, itm_usp_9mm, itm_sw_619, itm_taurus_38, itm_sig_40, itm_sw_610,
itm_ruger_redhawk, itm_deagle_44, itm_usp_45, itm_m1911, itm_fn57, itm_hk_ucp,
itm_tokarev,
itm_shotgun_sawn, itm_saiga_sawn, itm_shotgun_s, itm_shotgun_d, itm_remington_870,
itm_mossberg_500, itm_saiga_12, itm_american_180, itm_uzi, itm_tec9,
itm_calico, itm_hk_mp5, itm_mac_10, itm_hk_ump45, itm_TDI, itm_fn_p90,
itm_hk_mp7, itm_marlin_9a, itm_ruger_1022, itm_browning_blr,
itm_hk_mp7, itm_ppsh, itm_marlin_9a, itm_ruger_1022, itm_browning_blr,
itm_remington_700, itm_sks, itm_ruger_mini, itm_savage_111f, itm_hk_g3,
itm_hk_g36, itm_ak47, itm_fn_fal, itm_acr, itm_ar15, itm_m4a1, itm_scar_l,
itm_scar_h, itm_steyr_aug, itm_m249, itm_v29, itm_ftk93, itm_nx17,
itm_flamethrower_simple, itm_flamethrower, itm_launcher_simple, itm_m79,
itm_m320, itm_mgl, itm_coilgun, itm_hk_g80, itm_plasma_rifle,
itm_m320, itm_mgl, itm_coilgun, itm_hk_g80, itm_plasma_rifle,
itm_revolver_shotgun,
// Gun modifications
itm_silencer, itm_grip, itm_barrel_big, itm_barrel_small, itm_barrel_rifled,
@@ -179,7 +182,7 @@ itm_silencer, itm_grip, itm_barrel_big, itm_barrel_small, itm_barrel_rifled,
// Books
itm_mag_porn, itm_mag_tv, itm_mag_news, itm_mag_cars, itm_mag_cooking,
itm_mag_carpentry,
itm_mag_guns, itm_novel_romance, itm_novel_spy, itm_novel_scifi,
itm_mag_guns, itm_mag_archery, itm_novel_romance, itm_novel_spy, itm_novel_scifi,
itm_novel_drama, itm_manual_brawl, itm_manual_knives, itm_manual_mechanics, itm_manual_survival,
itm_manual_speech, itm_manual_business, itm_manual_first_aid,
itm_manual_computers, itm_cookbook, itm_manual_electronics,
@@ -189,28 +192,32 @@ itm_silencer, itm_grip, itm_barrel_big, itm_barrel_small, itm_barrel_rifled,
// Containers
itm_bag_plastic, itm_bottle_plastic, itm_bottle_glass,
itm_can_drink, itm_can_food, itm_box_small,
itm_canteen, itm_jerrycan, itm_carboy_plastic, itm_flask_glass,
itm_canteen, itm_jerrycan, itm_jug_plastic, itm_flask_glass, itm_waterskin,
// Tools
itm_lighter, itm_sewing_kit, itm_scissors, itm_hammer, itm_extinguisher,
itm_flashlight, itm_flashlight_on, itm_hotplate, itm_soldering_iron,
itm_water_purifier, itm_two_way_radio, itm_radio, itm_radio_on, itm_crowbar,
itm_water_purifier, itm_two_way_radio, itm_radio, itm_radio_on, itm_roadmap, itm_crowbar,
itm_hoe, itm_shovel, itm_chainsaw_off, itm_chainsaw_on, itm_jackhammer, itm_jacqueshammer,
itm_bubblewrap, itm_beartrap, itm_board_trap, itm_tripwire, itm_crossbow_trap,
itm_shotgun_trap, itm_blade_trap, itm_landmine, itm_geiger_off, itm_geiger_on,
itm_teleporter, itm_canister_goo, itm_pipebomb, itm_pipebomb_act, itm_grenade,
itm_grenade_act, itm_flashbang, itm_flashbang_act, itm_EMPbomb,
itm_shotgun_trap, itm_blade_trap, itm_light_snare_kit, itm_heavy_snare_kit, itm_landmine,
itm_geiger_off, itm_geiger_on, itm_teleporter, itm_canister_goo, itm_pipebomb, itm_pipebomb_act,
itm_grenade, itm_grenade_act, itm_flashbang, itm_flashbang_act, itm_EMPbomb,
itm_EMPbomb_act, itm_scrambler, itm_scrambler_act, itm_gasbomb, itm_gasbomb_act, itm_smokebomb,
itm_smokebomb_act, itm_molotov, itm_molotov_lit, itm_acidbomb,
itm_acidbomb_act, itm_dynamite, itm_dynamite_act, itm_mininuke,
itm_mininuke_act, itm_pheromone, itm_portal, itm_bot_manhack, itm_bot_turret,
itm_UPS_off, itm_UPS_on, itm_tazer, itm_mp3, itm_mp3_on, itm_vortex_stone,
itm_dogfood, itm_boobytrap, itm_c4, itm_c4armed, itm_dog_whistle,
itm_vacutainer, itm_welder, itm_cot, itm_rollmat, itm_knife_steak,
itm_acidbomb_act, itm_dynamite, itm_dynamite_act, itm_firecracker_pack, itm_firecracker_pack_act,
itm_firecracker, itm_firecracker_act, itm_mininuke, itm_mininuke_act, itm_pheromone, itm_portal,
itm_bot_manhack, itm_bot_turret, itm_UPS_off, itm_UPS_on, itm_tazer, itm_mp3, itm_mp3_on,
itm_vortex_stone, itm_dogfood, itm_boobytrap, itm_c4, itm_c4armed, itm_dog_whistle,
itm_vacutainer, itm_welder, itm_cot, itm_rollmat, itm_xacto, itm_scalpel,
itm_machete, itm_katana, itm_spear_knife, itm_rapier, itm_pike, itm_broadsword,
itm_makeshift_machete, itm_makeshift_halberd, itm_knife_steak,
itm_knife_butcher, itm_knife_combat, itm_saw, itm_ax, itm_hacksaw,
itm_tent_kit, itm_torch, itm_torch_lit, itm_candle, itm_candle_lit,
itm_brazier, itm_puller, itm_press, itm_screwdriver, itm_wrench,
itm_brazier, itm_puller, itm_press, itm_screwdriver, itm_wrench, itm_snare_trigger,
itm_boltcutters, itm_mop, itm_picklocks, itm_pickaxe, itm_spray_can, itm_rag,
itm_pda, itm_pda_flashlight, itm_pockknife,
itm_pda, itm_pda_flashlight, itm_pockknife, itm_needle_bone,
itm_primitive_hammer, itm_primitive_axe, itm_primitive_shovel, itm_digging_stick,
itm_shelter_kit, itm_damaged_shelter_kit,
// Bionics containers
itm_bionics_battery,
//power sources
@@ -268,7 +275,7 @@ itm_bio_claws, itm_bio_fusion, itm_bio_blaster,
// Unarmed Combat Styles
itm_style_karate, itm_style_aikido, itm_style_judo, itm_style_tai_chi,
itm_style_capoeira, itm_style_krav_maga, itm_style_muay_thai,
itm_style_ninjutsu, itm_style_taekwando, itm_style_tiger, itm_style_crane,
itm_style_ninjutsu, itm_style_taekwondo, itm_style_tiger, itm_style_crane,
itm_style_leopard, itm_style_snake, itm_style_dragon, itm_style_centipede,
itm_style_venom_snake, itm_style_scorpion, itm_style_lizard, itm_style_toad,
itm_style_zui_quan,
@@ -282,7 +289,7 @@ AT_NULL, AT_THREAD,
AT_BATT, AT_PLUT,
AT_NAIL, AT_BB, AT_BOLT, AT_ARROW,
AT_SHOT,
AT_22, AT_9MM, AT_38, AT_40, AT_44, AT_45,
AT_22, AT_9MM, AT_762x25, AT_38, AT_40, AT_44, AT_45,
AT_57, AT_46,
AT_762, AT_223, AT_3006, AT_308,
AT_40MM,
@@ -323,7 +330,7 @@ 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_CHARGE, // For guns; charges up slowly
IF_SHOCK, // Stuns and damages enemies, powers up shockers.
IF_UNARMED_WEAPON, // Counts as an unarmed weapon
@@ -500,60 +507,63 @@ struct itype
// Includes food drink and drugs
struct it_comest : public itype
{
signed char quench; // Many things make you thirstier!
unsigned char nutr; // Nutrition imparted
unsigned char spoils; // How long it takes to spoil (hours / 600 turns)
unsigned char addict; // Addictiveness potential
unsigned char charges; // Defaults # of charges (drugs, loaf of bread? etc)
signed char stim;
signed char healthy;
signed char quench; // Many things make you thirstier!
unsigned char nutr; // Nutrition imparted
unsigned char spoils; // How long it takes to spoil (hours / 600 turns)
unsigned char addict; // Addictiveness potential
unsigned char charges; // Defaults # of charges (drugs, loaf of bread? etc)
signed char stim;
signed char healthy;
std::string comesttype; //FOOD, DRINK, MED
signed char fun; // How fun its use is
signed char fun; // How fun its use is
itype_id container; // The container it comes in
itype_id tool; // Tool needed to consume (e.g. lighter for cigarettes)
itype_id container; // The container it comes in
itype_id tool; // Tool needed to consume (e.g. lighter for cigarettes)
virtual bool is_food() { return true; }
// virtual bool count_by_charges() { return charges >= 1 ; }
virtual bool is_food() { return true; }
// virtual bool count_by_charges() { return charges >= 1 ; }
virtual bool count_by_charges()
{
if (m1 == LIQUID) return true;
else
return charges > 1 ;
}
virtual bool count_by_charges()
{
if (m1 == LIQUID) {
return true;
} else {
return charges > 1 ;
}
}
void (iuse::*use)(game *, player *, item *, bool);// Special effects of use
add_type add; // Effects of addiction
void (iuse::*use)(game *, player *, item *, bool);// Special effects of use
add_type add; // Effects of addiction
it_comest(int pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
it_comest(int pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
signed char pquench, unsigned char pnutr, signed char pspoils,
signed char pstim, signed char phealthy, unsigned char paddict,
unsigned char pcharges, signed char pfun, itype_id pcontainer,
itype_id ptool, void (iuse::*puse)(game *, player *, item *, bool),
add_type padd)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, MNULL,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
quench = pquench;
nutr = pnutr;
spoils = pspoils;
stim = pstim;
healthy = phealthy;
addict = paddict;
charges = pcharges;
fun = pfun;
container = pcontainer;
tool = ptool;
use = puse;
add = padd;
}
signed char pquench, unsigned char pnutr, signed char pspoils,
signed char pstim, signed char phealthy, unsigned char paddict,
unsigned char pcharges, signed char pfun, itype_id pcontainer,
itype_id ptool, void (iuse::*puse)(game *, player *, item *, bool),
add_type padd, std::string pcomesttype)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, MNULL,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
quench = pquench;
nutr = pnutr;
spoils = pspoils;
stim = pstim;
healthy = phealthy;
addict = paddict;
charges = pcharges;
fun = pfun;
container = pcontainer;
tool = ptool;
use = puse;
add = padd;
comesttype = pcomesttype;
}
};
// v6, v8, wankel, etc.
+337 -136
View File
@@ -61,7 +61,7 @@ void game::init_itypes ()
healthy,addict,charges,fun,use_func,addict_func,des) \
index++;itypes.push_back(new it_comest(index,rarity,price,name,des,'~',\
color,LIQUID,2,1,0,0,0,0,quench,nutr,spoils,stim,healthy,addict,charges,\
fun,container,itm_null,use_func,addict_func));
fun,container,itm_null,use_func,addict_func,"DRINK"));
// NAME RAR PRC COLOR CONTAINER
DRINK("water", 90, 50, c_ltcyan, itm_bottle_plastic,
@@ -119,10 +119,14 @@ DRINK("broth", 15, 35, c_yellow, itm_can_food,
10, 15,160, 0, 0, 0, 1, 1,&iuse::none, ADD_NULL, "\
Vegetable stock. Tasty and fairly nutritious.");
DRINK("soup", 15, 60, c_red, itm_can_food,
DRINK("vegetable soup", 15, 60, c_red, itm_can_food,
10, 60,120, 0, 2, 0, 1, 2,&iuse::none, ADD_NULL, "\
A nutritious and delicious hearty vegetable soup.");
DRINK("meat soup", 15, 60, c_red, itm_can_food,
10, 60,120, 0, 2, 0, 1, 2,&iuse::none, ADD_NULL, "\
A nutritious and delicious hearty meat soup.");
DRINK("whiskey", 16, 85, c_brown, itm_bottle_glass,
-12, 4, 0,-12, -2, 5, 7, 15,&iuse::alcohol, ADD_ALCOHOL, "\
Made from, by, and for real Southern colonels!");
@@ -158,12 +162,12 @@ DRINK("beer", 60, 35, c_brown, itm_can_drink,
16, 4, 0, -4, -1, 2, 1, 10, &iuse::alcohol, ADD_ALCOHOL, "\
Best served cold, in a glass, and with a lime - but you're not that lucky.");
DRINK("bleach", 20, 18, c_white, itm_carboy_plastic,
DRINK("bleach", 20, 18, c_white, itm_jug_plastic,
-96, 0, 0, 0, -8, 0, 1,-30,&iuse::blech, ADD_NULL, "\
Don't drink it. Mixing it with ammonia produces toxic gas.");
// NAME RAR PRC COLOR CONTAINER
DRINK("ammonia", 24, 30, c_yellow, itm_carboy_plastic,
DRINK("ammonia", 24, 30, c_yellow, itm_jug_plastic,
// QUE NUT SPO STM HTH ADD CHG FUN use_func addiction type
-96, 0, 0, 0, -2, 0, 1,-30,&iuse::blech, ADD_NULL, "\
Don't drink it. Mixing it with bleach produces toxic gas.");
@@ -196,22 +200,34 @@ Blood, possibly that of a human. Disgusting!");
nutr,spoils,stim,healthy,addict,charges,fun,use_func,addict_func,des) \
index++;itypes.push_back(new it_comest(index,rarity,price,name,des,'%',\
color,mat1,volume,weight,0,0,0,0,quench,nutr,spoils,stim,healthy,addict,charges,\
fun,container,itm_null,use_func,addict_func));
fun,container,itm_null,use_func,addict_func,"FOOD"));
// FOOD
FOOD("bone", 50, 50, c_white, FLESH, itm_null,
1, 1, 0, 4, 0, 0, -1, 0, 1, 0, &iuse::none, ADD_NULL, "\
A bone from some creature or other, could be eaten or used to make some\n\
stuff, like needles.");
FOOD("fluid sac", 50, 50, c_white, FLESH, itm_null,
1, 1, 0, 4, 0, 0, -1, 0, 1, 0, &iuse::none, ADD_NULL, "\
A fluid bladder from a plant based lifeform, not very nutritious, but\n\
fine to eat anyway.");
// NAME RAR PRC COLOR MAT1 CONTAINER
FOOD("chunk of meat", 50, 50, c_red, FLESH, itm_null,
// VOL WGT QUE NUT SPO STM HTH ADD CHG FUN use_func addiction type
1, 2, 0, 20, 24, 0, -1, 0, 1,-10, &iuse::none, ADD_NULL, "\
Freshly butchered meat. You could eat it raw, but cooking it is better.");
FOOD("chunk of veggy", 30, 60, c_green, VEGGY, itm_null,
1, 2, 0, 20, 80, 0, 1, 0, 1, 0, &iuse::none, ADD_NULL, "\
A raw chunk of vegetable. Fine for eating raw, tastier when cooked.");
FOOD("human flesh", 50, 50, c_red, FLESH, itm_null,
FOOD("plant marrow", 30, 60, c_green, VEGGY, itm_null,
1, 2, 0, 20, 80, 0, 1, 0, 1, 0, &iuse::none, ADD_NULL, "\
A nutrient rich chunk of plant matter, could be eaten raw or cooked.");
// NAME RAR PRC COLOR MAT1 CONTAINER
FOOD("human flesh", 50, 50, c_red, HFLESH, itm_null,
// VOL WGT QUE NUT SPO STM HTH ADD CHG FUN use_func addiction type
1, 2, 0, 20, 24, 0, -1, 0, 1,-30, &iuse::none, ADD_NULL, "\
1, 2, 0, 20, 24, 0, -1, 0, 1, 0, &iuse::none, ADD_NULL, "\
Freshly butchered from a human body.");
FOOD("wild vegetables", 30, 60, c_green, VEGGY, itm_null,
@@ -230,9 +246,9 @@ FOOD("cooked meat", 0, 75, c_red, FLESH, itm_null,
1, 2, 0, 50, 24, 0, 0, 0, 1, 8, &iuse::none, ADD_NULL, "\
Freshly cooked meat. Very nutritious.");
FOOD("cooked veggy", 0, 70, c_green, VEGGY, itm_null,
FOOD("cooked plant marrow", 0, 70, c_green, VEGGY, itm_null,
1, 2, 0, 40, 50, 0, 1, 0, 1, 0, &iuse::none, ADD_NULL, "\
Freshly cooked vegetables. Very nutritious.");
A freshly cooked chunk of plant matter, tasty and nutritious.");
FOOD("cooked wild vegetables", 0, 70, c_green, VEGGY, itm_null,
1, 2, 0, 40, 50, 0, 1, 0, 1, 0, &iuse::none, ADD_NULL, "\
@@ -418,20 +434,22 @@ FOOD("royal jelly", 8,200, c_magenta, VEGGY, itm_null,
A large chunk of wax, filled with dense, dark honey. Useful for curing all\n\
sorts of afflictions.");
FOOD("misshapen fetus", 1,150, c_magenta, FLESH, itm_null,
FOOD("misshapen fetus", 1,150, c_magenta, HFLESH, itm_null,
4, 4, 0, 8, 0, 0, -8, 0, 1,-60, &iuse::mutagen, ADD_NULL, "\
Eating this is about the most disgusting thing you can imagine, and it will\n\
cause your DNA to mutate as well.");
A deformed human fetus, eating this would be very nasty, and cause\n\
your DNA to mutate.");
// NAME RAR PRC COLOR MAT1 CONTAINER
FOOD("arm", 4,250, c_brown, FLESH, itm_null,
FOOD("mutated arm", 4,250, c_brown, HFLESH, itm_null,
// VOL WGT QUE NUT SPO STM HTH ADD CHG FUN use_func addiction type
8, 14, 0, 12, 0, 0, -8, 0, 1, -20, &iuse::mutagen, ADD_NULL, "\
Eating this would be pretty gross. It causes you to mutate.");
A misshapen human arm, eating this would be pretty disgusting\n\
and cause your DNA to mutate.");
FOOD("leg", 4,250, c_brown, FLESH, itm_null,
FOOD("mutated leg", 4,250, c_brown, HFLESH, itm_null,
12, 24, 0, 16, 0, 0, -8, 0, 1, -20, &iuse::mutagen, ADD_NULL, "\
Eating this would be pretty gross. It causes you to mutate.");
A malformed human leg, this would be gross to eat, and cause\n\
mutations.");
FOOD("ant egg", 5, 80, c_white, FLESH, itm_null,
4, 2, 10, 100, 0, 0, -1, 0, 1, -10, &iuse::none, ADD_NULL, "\
@@ -504,12 +522,17 @@ FOOD("coffee powder", 15, 13, c_brown, VEGGY, itm_bag_plastic,
Ground coffee beans. You can boil it into a mediocre stimulant,\n\
or swallow it raw for a lesser stimulative boost.");
FOOD("cake", 0, 0, c_white, VEGGY, itm_null,
// VOL WGT QUE NUT SPO STM HTH ADD CHG FUN use_func addiction type
2, 1, 0, 25, 0, 0, 0, 0, 1, 20, &iuse::none, ADD_NULL, "\
Delicious sponge cake with buttercream icing, it says happy birthday on it.");
// MEDS
#define MED(name,rarity,price,color,tool,mat,stim,healthy,addict,\
charges,fun,use_func,addict_func,des) \
index++;itypes.push_back(new it_comest(index,rarity,price,name,des,'!',\
color,mat,1,1,0,0,0,0,0,0,0,stim,healthy,addict,charges,\
fun,itm_null,tool,use_func,addict_func));
fun,itm_null,tool,use_func,addict_func,"MED"));
// NAME RAR PRC COLOR TOOL
MED("bandages", 50, 60, c_white, itm_null,
@@ -627,7 +650,7 @@ MED("cigars", 5,120, c_dkgray, itm_lighter,
A gentleman's vice. Cigars are what separates a gentleman from a savage.");
MED("antibiotics", 25,900, c_pink, itm_null,
PLASTIC, 0, -2, 0, 15, 0,&iuse::none, ADD_NULL, "\
PLASTIC, 0, -2, 0, 15, 0,&iuse::antibiotic, ADD_NULL, "\
Medication designed to stop the spread of, and kill, bacterial infections.");
MED("Poppy Sleep", 25,900, c_pink, itm_null,
@@ -676,11 +699,11 @@ MELEE("syringe", 8, 25, ',', c_ltcyan, PLASTIC,MNULL,
1, 0, -4, 6, -2, mfb(IF_SPEAR), "\
A medical syringe. Used for administering heroin and other drugs.");
MELEE("fur pelt", 0, 10, ',', c_brown, WOOL, FLESH,
MELEE("fur pelt", 0, 10, ',', c_brown, FUR, LEATHER,
1, 1, -8, 0, 0, 0, "\
A small bolt of fur from an animal. Can be made into warm clothing.");
MELEE("leather patch", 0, 20, ',', c_red, LEATHER,FLESH,
MELEE("leather patch", 0, 20, ',', c_red, LEATHER, FLESH,
2, 1, -2, 0, -1, 0, "\
A smallish patch of leather, could be used to make tough clothing.");
@@ -761,6 +784,12 @@ MELEE("signal receiver",10,135, ',', c_ltcyan, IRON, PLASTIC,
A module designed to receive many forms of signals. Useful for crafting\n\
communications equipment.");
MELEE("burnt out bionic",10,135, ',', c_ltred, STEEL, PLASTIC,
1, 0, -4, 0, -1, 0, "\
Once a valuable bionic implants, it's not held up well under repeated\n\
use. This object has been destroyed by excessive electric current and\n\
is now useless.");
MELEE("antenna", 18, 80, ',', c_ltcyan, STEEL, MNULL,
1, 0, -6, 0, 2, 0, "\
A simple thin aluminum shaft. Useful in lots of electronics recipes.");
@@ -797,7 +826,6 @@ MELEE("manhole cover", 1, 20, ']', c_dkgray, IRON, MNULL,
45,250, 20, 0,-10, 0, "\
A heavy iron disc which generally covers a ladder into the sewers. Lifting\n\
it from the manhole is impossible without a crowbar.");
TECH( mfb(TEC_WBLOCK_3) );
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("rock", 40, 0, '*', c_ltgray, STONE, MNULL,
@@ -831,23 +859,12 @@ MELEE("nail board", 5, 80,'/', c_ltred, WOOD, MNULL,
6, 6, 16, 6, 1, mfb(IF_STAB), "\
A long piece of wood with several nails through one end; essentially a simple\n\
mace. Makes a great melee weapon.");
TECH( mfb(TEC_WBLOCK_1) );
MELEE("nail bat", 60, 160,'/', c_ltred, WOOD, MNULL,
12, 10, 28, 6, 3, mfb(IF_STAB), "\
A baseball bat with several nails driven through it, an excellent melee weapon.");
MELEE("X-Acto knife", 10, 40,';', c_dkgray, IRON, PLASTIC,
1, 0, 0, 14, -4, mfb(IF_SPEAR), "\
A small, very sharp knife. Causes decent damage but is difficult to hit\n\
with. Its small tip allows for a precision strike in hands of the skill."
);
TECH(mfb(TEC_PRECISE));
MELEE("scalpel", 48, 40,',', c_cyan, STEEL, MNULL,
1, 0, 0, 18, -4, mfb(IF_SPEAR), "\
A small, very sharp knife, used in surgery. Its small tip allows for a\n\
precision strike in the hands of the skilled.");
TECH(mfb(TEC_PRECISE));
TECH( mfb(TEC_WBLOCK_1) );
MELEE("pot", 25, 45,')', c_ltgray, IRON, MNULL,
8, 6, 9, 0, 1, 0, "\
@@ -890,31 +907,11 @@ An aluminium baseball bat, smaller and lighter than a wooden bat\n\
and a little less damaging as a result.");
TECH( mfb(TEC_WBLOCK_1) );
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("machete", 5, 280,'/', c_blue, IRON, MNULL,
// VOL WGT DAM CUT HIT FLAGS
8, 14, 6, 28, 2, 0, "\
This huge iron knife makes an excellent melee weapon.");
TECH( mfb(TEC_WBLOCK_1) );
MELEE("katana", 2, 980,'/', c_ltblue, STEEL, MNULL,
16, 16, 4, 45, 1, mfb(IF_STAB), "\
A rare sword from Japan. Deadly against unarmored targets, and still very\n\
effective against the armored.");
TECH( mfb(TEC_RAPID)|mfb(TEC_WBLOCK_2) );
MELEE("wood spear", 5, 40,'/', c_ltred, WOOD, MNULL,
5, 3, 4, 18, 1, mfb(IF_SPEAR), "\
A simple wood pole with one end sharpened.");
TECH( mfb(TEC_WBLOCK_1) | mfb(TEC_RAPID) );
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("steel spear", 5, 140,'/', c_ltred, WOOD, STEEL,
// VOL WGT DAM CUT HIT FLAGS
6, 6, 2, 28, 1, mfb(IF_SPEAR), "\
A simple wood pole made deadlier by the knife tied to it.");
TECH( mfb(TEC_WBLOCK_1) | mfb(TEC_RAPID) );
MELEE("expandable baton",8, 175,'/', c_blue, STEEL, MNULL,
1, 4, 12, 0, 2, 0, "\
A telescoping baton that collapses for easy storage. Makes an excellent\n\
@@ -968,12 +965,6 @@ A rock the size of your fist. It is covered with intricate spirals; it is\n\
impossible to tell whether they are carved, naturally formed, or some kind of\n\
fossil.");
MELEE("rapier", 3, 980,'/', c_ltblue, STEEL, MNULL,
6, 9, 5, 28, 2, mfb(IF_STAB), "\
Preferred weapon of gentlemen and swashbucklers. Light and quick, it makes\n\
any battle a stylish battle.");
TECH( mfb(TEC_RAPID)|mfb(TEC_WBLOCK_1)|mfb(TEC_PRECISE) );
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("walking cane", 10, 160,'/', c_ltred, WOOD, MNULL,
// VOL WGT DAM CUT HIT FLAGS
@@ -992,19 +983,6 @@ MELEE("USB drive", 5, 100,',', c_white, PLASTIC,MNULL,
0, 0, 0, 0, 0, 0, "\
A USB thumb drive. Useful for holding software.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("awl pike", 5,2000,'/', c_ltcyan, IRON, WOOD,
// VOL WGT DAM CUT HIT FLAGS
14, 18, 8, 50, 2, mfb(IF_SPEAR), "\
A medieval weapon consisting of a wood shaft, tipped with an iron spike.\n\
Though large and heavy compared to other spears, its accuracy and damage\n\
are unparalled.");
MELEE("broadsword", 30,1200,'/',c_cyan, IRON, MNULL,
7, 11, 8, 35, 2, mfb(IF_STAB), "\
An early modern sword seeing use in the 16th, 17th ane 18th centuries.\n\
Called 'broad' to contrast with the slimmer rapiers.");
MELEE("mace", 20,1000,'/',c_dkgray, IRON, WOOD,
10, 18, 36, 0, 1, 0, "\
A medieval weapon consisting of a wood handle with a heavy iron end. It\n\
@@ -1042,9 +1020,9 @@ mounted on a vehicle.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("blade", 5, 280,'/', c_blue, IRON, MNULL,
// VOL WGT DAM CUT HIT FLAGS
8, 14, 6, 10, -2, 0, "\
A large and slightly misshapen blade, could do some damage\n\
mounted on a vehicle.");
8, 10, 6, 10, -2, 0, "\
A large, relatively sharp blade. Could be used to make\n\
bladed weaponry, or attached to a car.");
MELEE("wire", 50, 200,';', c_blue, STEEL, MNULL,
4, 2, 0, 0, -2, 0, "\
@@ -1093,21 +1071,6 @@ MELEE("lawnmower", 25, 100, ';', c_red, STEEL, IRON,
A motorized pushmower, it seems to be broken. You could\n\
take it apart if you had a wrench.");
MELEE("lawnmower blade", 0, 100, '/', c_ltgray, IRON, MNULL,
7, 5, 4, 15, -1, mfb(IF_STAB), "\
The blade of a lawnmower. It's not incredibly sharp, but\n\
it could still do some serious damage.");
MELEE("lawnmower machete", 0, 100, '/', c_ltgray, IRON, MNULL,
7, 5, 4, 15, 1, mfb(IF_STAB), "\
A lawnmower blade that's been fashioned into a makeshift\n\
machete, mainly by adding a handle for easier wielding.");
MELEE("lawnmower halberd", 0, 100, '/', c_ltgray, IRON, MNULL,
10, 7, 4, 15, 2, mfb(IF_STAB), "\
A lawnmower blade affixed to a long stick, in the right\n\
hands, this thing could do some massive damage.");
MELEE("sheet", 0, 100, ';', c_dkgray, COTTON, MNULL,
20, 2, 0, 0, -1, 0, "\
A large fabric sheet, could be used as a curtain or bedsheets;\n\
@@ -1201,15 +1164,26 @@ MELEE("blood soaked rag", 1, 0, ',', c_red, COTTON, MNULL,
0, 0, 0, 0, 0, 0, "\
A large rag, drenched in blood. It could be cleaned with\n\
boiling water.");
MELEE("clock", 60, 0, ';', c_ltcyan, PLASTIC, IRON,
1, 2, 0, 0, 0, 0, "\
A small mechanical clock, it's stopped at 10:10.");
MELEE("clockworks", 30, 0, ';', c_ltcyan, IRON, MNULL,
1, 1, 0, 0, 0, 0, "\
A small assortment of gears and other clockwork gubbins.");
MELEE("clock", 60, 0, ';', c_ltcyan, PLASTIC, IRON,
1, 2, 0, 0, 0, 0, "\
A small mechanical clock, it's stopped at 10:10.");
MELEE("clockworks", 30, 0, ';', c_ltcyan, IRON, MNULL,
1, 1, 0, 0, 0, 0, "\
A small assortment of gears and other clockwork gubbins.");
MELEE("wooden javelin", 5, 40,'/', c_ltred, WOOD, MNULL,
// VOL WGT DAM CUT HIT FLAGS
5, 3, 6, 22, 2, mfb(IF_SPEAR), "\
A wooden spear, honed to a sharper point and fire hardened\n\
for toughness. The grip area has also be carved and covered\n\
for better grip.");
TECH( mfb(TEC_WBLOCK_1) | mfb(TEC_RAPID) );
MELEE("stone pot", 0, 0, ';', c_dkgray, STONE, MNULL,
8, 3, 4, 0, -1, 0, "\
A large stone, roughly hollowed out into a pot.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("steel frame", 20, 55, ']', c_cyan, STEEL, MNULL,
@@ -1344,6 +1318,11 @@ MELEE("solar panel", 3, 900, ']', c_yellow, GLASS, MNULL,
Electronic device which can convert solar radiation into electric\n\
power. Useful for crafting.");
MELEE("sheet metal", 30, 60, ']', c_ltcyan, STEEL, MNULL,
// VOL WGT DAM CUT HIT FLAGS
4, 20, 5, 0, -2, 0, "\
A thin sheet of metal.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("steel plating", 30, 120, ']', c_ltcyan, STEEL, MNULL,
// VOL WGT DAM CUT HIT FLAGS
@@ -1398,11 +1377,11 @@ ARMOR("steeltoed boots",50, 135,C_SHOES, LEATHER, STEEL,
7, 9, 4, -1, 1, 4, 4, 3, 50, 0, mfb(bp_feet), "\
Leather boots with a steel toe. Extremely durable.");
ARMOR("winter boots", 60, 140,C_SHOES, PLASTIC, WOOL,
ARMOR("winter boots", 60, 140,C_SHOES, WOOL, PLASTIC,
8, 7, 0, -1, 2, 0, 2, 1, 80, 0, mfb(bp_feet), "\
Cumbersome boots designed for warmth.");
ARMOR("mocassins", 5, 80,C_SHOES, LEATHER, WOOL,
ARMOR("mocassins", 5, 80,C_SHOES, FUR, LEATHER,
2, 1, -3, 0, 0, 0, 1, 0, 40, 0, mfb(bp_feet), "\
Simple shoes made from animal pelts.");
@@ -1437,7 +1416,7 @@ ARMOR("steeltoed boots",5, 135,C_SHOES, LEATHER, STEEL,
Leather boots with a steel toe. Extremely durable.\n\
These boots are a perfect fit for you.");
ARMOR("winter boots", 5, 140,C_SHOES, PLASTIC, WOOL,
ARMOR("winter boots", 5, 140,C_SHOES, WOOL, PLASTIC,
8, 7, 0, -1, 1, 0, 2, 1, 85, 0, mfb(bp_feet), "\
Cumbersome boots designed for warmth.\n\
These boots are a perfect fit for you.");
@@ -1452,6 +1431,10 @@ ARMOR("heels", 1, 50,C_SHOES, LEATHER, MNULL,
A pair of high heels. Difficult to even walk in.\n\
These high heels are a perfect fit for you.");
ARMOR("chitinous boots",50, 135,C_SHOES, LEATHER, STEEL,
7, 9, 4, -1, 1, 4, 4, 3, 50, 0, mfb(bp_feet), "\
Boots made from the exoskeletons of insects. Light and durable.");
ARMOR("shorts", 70, 180,C_PANTS, COTTON, MNULL,
4, 2, -4, 1, 0, 0, 1, 0, 0, 4, mfb(bp_legs), "\
A pair of khaki shorts.");
@@ -1488,7 +1471,7 @@ ARMOR("ski pants", 60, 300,C_PANTS, COTTON, MNULL,
A pair of pants meant for alpine skiing.");
ARMOR("long underwear", 40, 200,C_PANTS, COTTON, MNULL,
4, 2, -3, 0, 0, 0, 0, 0, 30, 12, mfb(bp_legs), "\
4, 2, -3, 0, 0, 0, 0, 0, 30, 0, mfb(bp_legs), "\
A pair of long underwear that help to maintain body temperature.");
ARMOR("skirt", 75, 120,C_PANTS, COTTON, MNULL,
@@ -1607,7 +1590,7 @@ ARMOR("kevlar vest", 30, 800,C_TORSO, KEVLAR, MNULL,
24, 24, 6, -3, 2, 4, 22, 0, 20, 4, mfb(bp_torso), "\
A heavy bulletproof vest. The best protection from cuts and bullets.");
ARMOR("rain coat", 50, 100,C_TORSO, PLASTIC, COTTON,
ARMOR("rain coat", 50, 100,C_TORSO, COTTON, PLASTIC,
9, 8, -4, 0, 2, 0, 3, 1, 20, 7, mfb(bp_torso)|mfb(bp_arms), "\
A plastic coat with two very large pockets. Provides protection from rain.");
@@ -1632,7 +1615,7 @@ ARMOR("winter coat", 50, 160,C_TORSO, COTTON, MNULL,
12, 6, -5, -2, 3, 3, 1, 1, 70, 12, mfb(bp_torso)|mfb(bp_arms), "\
A padded coat with deep pockets. Very warm.");
ARMOR("fur coat", 5, 550,C_TORSO, WOOL, FLESH,
ARMOR("fur coat", 5, 550,C_TORSO, FUR, LEATHER,
18, 12, -5, -5, 2, 4, 2, 2, 80, 4, mfb(bp_torso)|mfb(bp_arms), "\
A fur coat with a couple small pockets. Extremely warm.");
@@ -1772,6 +1755,11 @@ ARMOR("fire gauntlets", 5, 95,C_GLOVES, LEATHER, MNULL,
3, 5, -2, 2, 6, 1, 2, 5, 40, 0, mfb(bp_hands), "\
A heavy pair of leather gloves, used by firefighters for heat protection.");
ARMOR("chitinous gauntlets", 1, 380,C_HAT, FLESH, MNULL,
// VOL WGT DAM HIT ENC RES CUT ENV WRM STO COVERS
4, 1, 2, -2, 1, 5, 7, 4, 20, 0, mfb(bp_hands), "\
Gauntlets made from the exoskeletons of insects. Very light and durable.");
// NAME RAR PRC COLOR MAT1 MAT2
ARMOR("dust mask", 65, 20,C_MOUTH, COTTON, IRON,
// VOL WGT DAM HIT ENC RES CUT ENV WRM STO COVERS
@@ -1876,7 +1864,7 @@ ARMOR("hunting cap", 20, 80,C_HAT, WOOL, MNULL,
3, 2, -5, 0, 0, 0, 1, 2, 60, 0, mfb(bp_head), "\
A red plaid hunting cap with ear flaps. Notably warm.");
ARMOR("fur hat", 15, 120,C_HAT, WOOL, MNULL,
ARMOR("fur hat", 15, 120,C_HAT, FUR, LEATHER,
4, 2, -5, 0, 1, 2, 2, 0, 80, 0, mfb(bp_head), "\
A hat made from the pelts of animals. Extremely warm.");
@@ -1894,7 +1882,7 @@ TECH( mfb(TEC_WBLOCK_1) );
ARMOR("bike helmet", 35, 140,C_HAT, PLASTIC, MNULL,
12, 2, 4, 0, 1, 8, 2, 0, 20, 0, mfb(bp_head), "\
A thick foam helmet. Designed to protect against percussion.");
A thick foam helmet. Designed to protect against concussion.");
TECH( mfb(TEC_WBLOCK_1) );
ARMOR("skid lid", 30, 190,C_HAT, PLASTIC, IRON,
@@ -1959,12 +1947,13 @@ A huge military rucksack, provides a lot of storage.");
// NAME RAR PRC COLOR MAT1 MAT2
ARMOR("purse", 40, 75,C_STORE, LEATHER, MNULL,
// VOL WGT DAM HIT ENC RES CUT ENV WRM STO COVERS
10, 3, 2, 2, 1, 0, 0, 0, 0, 20, mfb(bp_torso), "\
10, 3, 2, 2, 0, 0, 0, 0, 0, 20, mfb(bp_torso), "\
A bit encumbersome to wear, but provides lots of storage.");
ARMOR("messenger bag", 20, 110,C_STORE, PLASTIC, MNULL,
8, 2, 1, 1, 1, 0, 0, 0, 0, 30, mfb(bp_torso), "\
A bit encumbersome to wear, but provides lots of storage.");
// VOL WGT DAM HIT ENC RES CUT ENV WRM STO COVERS
8, 2, 1, 1, 0, 0, 0, 0, 0, 20, mfb(bp_torso), "\
Light and easy to wear, but doesn't offer much storage.");
ARMOR("fanny pack", 10, 100,C_STORE, PLASTIC, MNULL,
3, 1, 1, 2, 0, 0, 0, 0, 0, 6, 0, "\
@@ -1980,6 +1969,18 @@ ARMOR("bootstrap", 3, 80,C_STORE, LEATHER, MNULL,
1, 1, -1, -1, 0, 0, 0, 0, 1, 2, mfb(bp_legs), "\
A small holster worn on the ankle.");
ARMOR("pouch", 20, 110,C_STORE, COTTON, MNULL,
// VOL WGT DAM HIT ENC RES CUT ENV WRM STO COVERS
5, 2, 1, 1, 1, 0, 0, 0, 0, 12, mfb(bp_torso), "\
A makeshift bag, cobbled together from rags. Really gets in the way, but\n\
provides a decent amount of storage.");
ARMOR("leather pouch", 20, 110,C_STORE, LEATHER, MNULL,
// VOL WGT DAM HIT ENC RES CUT ENV WRM STO COVERS
5, 2, 1, 1, 0, 0, 0, 0, 0, 12, mfb(bp_torso), "\
A bag stitched together from leather scraps. Doesn't hold an awful lot\n\
but is easy to wear.");
ARMOR("gold ring", 12, 600,C_DECOR, SILVER, MNULL,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, "\
A flashy gold ring. You can wear it if you like, but it won't provide\n\
@@ -1990,6 +1991,7 @@ ARMOR("silver necklace",14, 500,C_DECOR, SILVER, MNULL,
A nice silver necklace. You can wear it if you like, but it won't provide\n\
any effects.");
// AMMUNITION
// Material should be the wrapper--even though shot is made of iron, because
// it can survive a dip in water and be okay, its material here is PLASTIC.
@@ -2019,6 +2021,19 @@ AMMO("thread", 40, 50, AT_THREAD, c_magenta, COTTON,
A small quantity of thread that could be used to refill a sewing kit.",
0);
// NAME RAR PRC TYPE COLOR MAT
AMMO("sinew", 50, 120,AT_THREAD, c_red, FLESH,
// VOL WGT DMG AP RNG ACC REC COUNT
1, 1, 0, 0, 0, 0, 0, 10, "\
A tough sinew cut from a corpse, useable as thread.",
0);
// NAME RAR PRC TYPE COLOR MAT
AMMO("plant fibre", 50, 120,AT_THREAD, c_green, VEGGY,
// VOL WGT DMG AP RNG ACC REC COUNT
1, 1, 1, 0, 0, 0, 0, 10, "\
Tough thin fibres, taken from a plant. Can be used as thread.",
0);
AMMO("duct tape", 60, 20, AT_NULL, c_ltgray, PLASTIC,
2, 2, 0, 0, 0, 0, 0, 200, "\
A roll of incredibly strong tape. Its uses are innumerable.",
@@ -2147,6 +2162,14 @@ A step beyond the high-pressure 9mm +P round, the +P+ is a very high pressure\n\
loading which offers a degree of armor-penetrating ability.",
0);
// NAME RAR PRC TYPE COLOR MAT
AMMO("7.62mm Type P",8, 300, AT_762x25, c_ltblue, STEEL,
// VOL WGT DMG AP RNG ACC REC COUNT
2, 7, 15, 4, 12, 14, 10, 200, "\
This small caliber pistol round offers quite good armor penetration at the\n\
cost of slightly less damage, it is rarely used outside of the Chinese army.",
0);
AMMO(".38 Special", 7, 400,AT_38, c_ltblue, STEEL,
2, 10, 20, 0, 14, 16, 12, 50, "\
The .38 Smith & Wesson Special enjoyed popularity among US police forces\n\
@@ -2447,7 +2470,7 @@ Primer from a shotgun round.",
AMMO("small pistol primer", 15, 40,AT_NULL, c_dkgray, STEEL,
0, 0, 0, 0, 0, 0, 0, 200, "\
Primer from a small caliber pistol round.",
Primer from a small caliber round.",
0);
AMMO("large pistol primer", 15, 60,AT_NULL, c_dkgray, STEEL,
@@ -2664,13 +2687,22 @@ Designed to work with H&K's proprietary 4.6x30mm round, the UCP is a small\n\
pistol with a very high capacity, best used against armored opponents.",
0);
GUN("Tokarev TT-30", 7,1400,c_dkgray, STEEL, PLASTIC,
// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
"pistol", AT_762x25, 2, 12, 10,1, 0, 23, 4, 6, 0, 8, 300, "\
The Norinco manufactured Tokarev TT-30 is the standard sidearm of the\n\
Chinese military, it does not see extensive use outside of China.",
0);
GUN("sawn-off shotgun", 1, 700,c_red, IRON, WOOD,
"shotgun", AT_SHOT, 6, 10, 14, 2, 4, 40, 15, 4, 0, 2, 100, "\
// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
"shotgun", AT_SHOT, 6, 10, 14, 2, 4, 40, 15, 4, 0, 2, 100, "\
The barrels of shotguns are often sawed in half to make it more maneuverable\n\
and concealable. This has the added effect of reducing accuracy greatly.",
mfb(IF_RELOAD_ONE));
GUN("sawn-off Saiga 12", 1, 700,c_red, IRON, WOOD,
// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
"shotgun", AT_SHOT, 6, 10, 14, 2, 4, 40, 15, 4, 0, 10, 100, "\
The Saiga-12 shotgun is designed on the same Kalishnikov pattern as the AK47\n\
rifle. It reloads with a magazine, rather than one shell at a time like most\n\
@@ -2790,6 +2822,13 @@ successor to the extremely popular H&K MP5. Using H&K's proprietary 4.6x30mm\n\
ammunition, it is designed for burst fire.",
mfb(IF_MODE_BURST));
// NAME RAR PRC COLOR MAT1 MAT2
GUN("PPSh-41", 12,2800,c_cyan, STEEL, WOOD,
// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
"smg", AT_762x25,12, 26, 10, 2, 1, 16, -1, 8, 8, 35, 400, "\
The Soviet made PPSh-41, chambered in 7.62 Tokarev provides a relatively\n\
large ammunition capacity, coupled with low recoil and decent accuracy.",
mfb(IF_MODE_BURST));
// NAME RAR PRC COLOR MAT1 MAT2
GUN("Marlin 39A", 14,1600,c_brown,IRON, WOOD,
// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP RELOAD
@@ -3011,14 +3050,14 @@ GUN("Boeing XM-P Plasma Rifle", 1,13000,c_ltblue,STEEL, MNULL,
Boeing developed the focused plasma weaponry together with DARPA. It heats\n\
hydrogen to create plasma and envelops it with polymers to reduce blooming.\n\
While powerful, it suffers from short range. Powered by UPS.",
mfb(IF_USE_UPS)|mfb(IF_MODE_BURST));
mfb(IF_USE_UPS)|mfb(IF_MODE_BURST));
// NAME RAR PRC COLOR MAT1 MAT2
GUN("Shotgun Revolver",1,600,c_red,IRON, WOOD,
// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
"shotgun", AT_SHOT,12, 24, 14, 3, 0, 6, 5, 6, 0, 6, 100, "\
A shotgun modified to use a revolver cylinder mechanism, it can hold\n\
6 cartridges.",
A shotgun modified to use a revolver cylinder mechanism, it can hold\n\
6 cartridges.",
mfb(IF_RELOAD_ONE));
// GUN MODS
@@ -3284,6 +3323,12 @@ BOOK("Guns n Ammo", 20, 48,c_pink, PAPER, MNULL,
1, 1, -3, 1, "gun", 1, 0, 1, 2, 7, "\
Reviews of firearms, and various useful tips about their use.");
BOOK("Archery for Kids", 20, 48, c_pink, PAPER, MNULL,
1, 1, -3, 1, "archery", 1, 0, 1, 2, 7, "\
Will you be able to place the arrow right into bull's eye?\n\
It is not that easy, but once you know how it's done,\n\
you will have a lot of fun with archery.");
BOOK("romance novel", 30, 55,c_ltblue, PAPER, MNULL,
4, 1, -2, 0, NULL, 0, 0, 2, 4, 15, "\
Drama and mild smut.");
@@ -3445,21 +3490,26 @@ A small cardboard box. No bigger than a foot in any dimension.");
CONT("plastic canteen", 20, 1000, c_green, PLASTIC,MNULL,
6, 2, -8, 1, 6, mfb(con_rigid)|mfb(con_wtight)|mfb(con_seals),"\
A large military-style water canteen, with a 1.5 litre capacity");
A large military-style water canteen, with a 1.5 liter capacity");
CONT("plastic jerrycan", 10, 2500, c_green, PLASTIC,MNULL,
40, 4, -2, -2, 40, mfb(con_rigid)|mfb(con_wtight)|mfb(con_seals),"\
A bulky plastic jerrycan, meant to carry fuel, but can carry other liquids\n\
in a pinch. It has a capacity of 10 litres.");
in a pinch. It has a capacity of 10 liters.");
CONT("plastic carboy", 10, 2500, c_ltcyan, PLASTIC,MNULL,
CONT("gallon jug", 10, 2500, c_ltcyan, PLASTIC,MNULL,
10, 2, -8, 1, 10, mfb(con_rigid)|mfb(con_wtight)|mfb(con_seals),"\
A 2.5 litre plastic carboy for household cleaning chemicals.");
A standard plastic jug used for household cleaning chemicals.");
CONT("glass flask", 10, 2500, c_ltcyan, GLASS,MNULL,
1, 0, 8, 1, 1, mfb(con_rigid)|mfb(con_wtight)|mfb(con_seals),"\
A 250 ml laboratory conical flask, with a rubber bung.");
CONT("waterskin", 0, 0, c_brown, LEATHER, MNULL,
// VOL WGT DAM HIT VOL FLAGS
2, 2, -8, -5, 6, mfb(con_wtight)|mfb(con_seals), "\
A watertight leather bag, can hold 1.5 liters of water.");
/* TOOLS
* MAX is the maximum number of charges help.
* DEF is the default number of charges--items will be generated with this
@@ -3530,7 +3580,7 @@ A small heating element. Indispensable for cooking and chemistry.");
// NAME RAR PRC SYM COLOR MAT1 MAT
TOOL("soldering iron", 70, 200,',', c_ltblue, IRON, MNULL,
// VOL WGT DAM CUT HIT MAX DEF USE SEC FUEL REVERT FUNCTION
3, 1, 2, 6, 0, 50, 20, 0, 0, AT_BATT, itm_null, &iuse::none,
3, 1, 2, 6, 0, 200, 20, 0, 0, AT_BATT, itm_null, &iuse::none,
mfb(IF_SPEAR), "\
A piece of metal that can get very hot. Necessary for electronics crafting.");
@@ -3556,6 +3606,11 @@ TOOL("radio (on)", 0, 420,';', c_yellow, PLASTIC, IRON,
This radio is turned on, and continually draining its batteries. It is\n\
playing the broadcast being sent from any nearby radio towers.");
TOOL("road map", 40, 10, ';', c_yellow, MNULL, MNULL,
1, 0, 0, 0, -1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::roadmap, 0, "\
A road map. Use it to read points of interest, including, but not\n\
limited to, location(s) of hospital(s) nearby.");
TOOL("crowbar", 18, 130,';', c_ltblue, IRON, MNULL,
4, 9, 16, 3, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::crowbar, 0,"\
A prying tool. Use it to open locked doors without destroying them, or to\n\
@@ -3587,12 +3642,12 @@ it off.");
TECH( mfb(TEC_SWEEP) );
TOOL("jackhammer", 2, 890,';', c_magenta, IRON, MNULL,
13, 54, 20, 6, -4, 120, 0,10, 0, AT_GAS, itm_null, &iuse::jackhammer,0,"\
26, 54, 20, 6, -4, 120, 0,10, 0, AT_GAS, itm_null, &iuse::jackhammer,0,"\
This jackhammer runs on gasoline. Use it (if loaded) to blast a hole in\n\
adjacent solid terrain.");
TOOL("jacqueshammer", 2, 890, ';', c_magenta, IRON, MNULL,
13, 54, 20, 6, -4, 120, 0,10, 0, AT_GAS, itm_null, &iuse::jacqueshammer,0,"\
26, 54, 20, 6, -4, 120, 0,10, 0, AT_GAS, itm_null, &iuse::jacqueshammer,0,"\
Ce marteau-piqueur fonctionne a l'essence.\n\
Utilisez-le (si charge) pour faire sauter un troudans\n\
adjacente terrain solide.");
@@ -3604,7 +3659,7 @@ ground, creating a trap that will warn you with noise when something steps on\n\
it.");
TOOL("bear trap", 5, 120,';', c_cyan, IRON, MNULL,
4, 12, 9, 1, -2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::set_trap,0,"\
12, 10, 9, 1, -2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::set_trap,0,"\
A spring-loaded pair of steel jaws. Use it to set it on the ground, creating\n\
a trap that will ensnare and damage anything that steps on it. If you are\n\
carrying a shovel, you will have the option of burying it.");
@@ -3637,15 +3692,27 @@ trigger is pulled, one or two may be used.");
// NAME RAR VAL SYM COLOR MAT1 MAT
TOOL("blade trap", 0,500, ';', c_ltgray, IRON, MNULL,
// VOL WGT DAM CUT HIT MAX DEF USE SEC FUEL REVERT FUNCTION
13, 21, 4, 16, -4, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::set_trap,0,"\
20, 21, 4, 16, -4, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::set_trap,0,"\
A machete is attached laterally to a motor, with a tripwire controlling its\n\
throttle. When the tripwire is pulled, the blade is swung around with great\n\
force. The trap forms a 3x3 area of effect.");
TOOL("light snare kit", 0,100, ';', c_brown, WOOD, MNULL,
// VOL WGT DAM CUT HIT MAX DEF USE SEC FUEL REVER FUNCTION
1, 3, 0, 10, 0, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::set_trap,0,"\
A kit for a simple trap consisting of a string noose and a snare trigger.\n\
Requires a young tree nearby. Effective at trapping and killing some small\n\
animals.");
TOOL("heavy snare kit", 0,250, ';', c_brown, WOOD, MNULL,
// VOL WGT DAM CUT HIT MAX DEF USE SEC FUEL REVER FUNCTION
1, 5, 0, 20, 0, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::set_trap,0,"\
A kit for a simple trap consisting of a rope noose and a snare trigger.\n\
Requires a tree nearby. Effective at trapping monsters.");
TOOL("land mine", 3,2400,';', c_red, IRON, MNULL,
3, 6, 10, 0, -1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::set_trap,0,"\
An explosive that is triggered when stepped upon. It must be partially\n\
buried to be effective, and so you will need a shovel to use it.");
5, 6, 10, 0, -1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::set_trap,0,"\
An anti-personnel mine that is triggered when stepped upon.");
TOOL("geiger ctr (off)", 8, 300,';', c_green, PLASTIC,STEEL,
2, 2, 2, 0, 0,100,100, 1, 0, AT_BATT, itm_null, &iuse::geiger,0,"\
@@ -3792,6 +3859,28 @@ TOOL("dynamite (lit)", 5, 0,'*', c_red, PLASTIC,MNULL,
6, 10, 4, 0, -3, 0, 0, 0, 1, AT_NULL, itm_null, &iuse::dynamite_act,0,
"The fuse on this dynamite is lit and hissing. It'll explode any moment now.");
TOOL("pack of firecrackers", 5, 100,'*', c_red, PAPER, MNULL,
0, 0, 1, 0, -3, 25, 25, 0, 0, AT_NULL, itm_null, &iuse::firecracker_pack,0,"\
A pack of 25 firecrackers with a starter fuse. Use this item to light the\n\
fuse; you will need a lighter of course. Shortly after you light the fuse\n\
they will begin to explode, so throw them quickly!");
TOOL("pack of firecrackers (lit)", 5, 0,'*', c_red, PAPER, MNULL,
0, 0, 0, 0, -3, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::firecracker_pack_act,0,"\
A pack of 25 firecrackers that has been lit, the fuse is hissing.\n\
Throw them quickly before the start to explode.");
TOOL("firecracker", 5, 2,';', c_red, PAPER, MNULL,
0, 0, 1, 0, -3, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::firecracker,0,"\
A firecracker with a short fuse. Use this item to light the fuse; you will\n\
need a lighter of course. Shortly after you light the fuse it will explode,\n\
so throw it quickly!");
TOOL("firecracker (lit)", 5, 0,';', c_red, PAPER, MNULL,
0, 0, 1, 0, -3, 0, 0, 0, 1, AT_NULL, itm_null, &iuse::firecracker_act,0,"\
A firecracker that has been lit, the fuse is hissing. Throw it quickly before\n\
it explodes.");
TOOL("mininuke", 1, 1800,'*', c_ltgreen, STEEL, PLASTIC,
3, 4, 8, 0, -2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::mininuke,0,"\
An extremely powerful weapon--essentially a hand-held nuclear bomb. Use it\n\
@@ -3917,7 +4006,69 @@ but much better than slumming it on the ground.");
TOOL("rollmat", 40,400,';', c_blue, MNULL, MNULL,
4, 3, 0, 0, -1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::set_trap,
0, "\
A thin rollmat, better than sleeping on the ground.");
A sheet of foam which can be rolled tightly for storage\n\
Insulates you from the floor, making it easier to sleep");
TOOL("X-Acto knife", 10, 40,';', c_dkgray, IRON, PLASTIC,
1, 0, 0, 14, -4, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_SPEAR), "\
A small, very sharp knife. Causes decent damage but is difficult to hit\n\
with. Its small tip allows for a precision strike in hands of the skill."
);
TECH(mfb(TEC_PRECISE));
TOOL("scalpel", 48, 40,',', c_cyan, STEEL, MNULL,
1, 0, 0, 18, -4, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_SPEAR), "\
A small, very sharp knife, used in surgery. Its small tip allows for a\n\
precision strike in the hands of the skilled.");
TECH(mfb(TEC_PRECISE));
TOOL("machete", 5, 280,'/', c_blue, IRON, MNULL,
8, 14, 6, 28, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, 0, "\
This huge iron knife makes an excellent melee weapon.");
TECH( mfb(TEC_WBLOCK_1) );
TOOL("katana", 2, 980,'/', c_ltblue, STEEL, MNULL,
16, 16, 4, 45, 1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_STAB), "\
A rare sword from Japan. Deadly against unarmored targets, and still very\n\
effective against the armored.");
TECH( mfb(TEC_RAPID)|mfb(TEC_WBLOCK_2) );
TOOL("knife spear", 5, 140,'/', c_ltred, WOOD, STEEL,
6, 6, 2, 28, 1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_SPEAR), "\
A simple wood pole made deadlier by the blade tied to it.");
TECH( mfb(TEC_WBLOCK_1) | mfb(TEC_RAPID) );
TOOL("rapier", 3, 980,'/', c_ltblue, STEEL, MNULL,
6, 9, 5, 28, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_STAB), "\
Preferred weapon of gentlemen and swashbucklers. Light and quick, it makes\n\
any battle a stylish battle.");
TECH( mfb(TEC_RAPID)|mfb(TEC_WBLOCK_1)|mfb(TEC_PRECISE) );
TOOL("awl pike", 5,2000,'/', c_ltcyan, IRON, WOOD,
14, 18, 8, 50, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_SPEAR), "\
A medieval weapon consisting of a wood shaft, tipped with an iron spike.\n\
Though large and heavy compared to other spears, its accuracy and damage\n\
are unparalled.");
TOOL("broadsword", 30,1200,'/',c_cyan, IRON, MNULL,
7, 11, 8, 35, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_STAB), "\
An early modern sword seeing use in the 16th, 17th ane 18th centuries.\n\
Called 'broad' to contrast with the slimmer rapiers.");
TECH( mfb(TEC_WBLOCK_1) );
TOOL("makeshift machete", 0, 100, '/', c_ltgray, IRON, MNULL,
// VOL WGT DAM CUT HIT MAX DEF USE SEC FUEL REVERT FUNCTION
7, 12, 4, 15, 1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife,
mfb(IF_STAB), "\
A large blade which has had a portion of the handle wrapped\n\
in duct tape, making it easier to wield as a rough machete.");
TOOL("makeshift halberd", 0, 100, '/', c_ltgray, IRON, MNULL,
// VOL WGT DAM CUT HIT MAX DEF USE SEC FUEL REVERT FUNCTION
13, 17, 4, 15, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_STAB), "\
A large blade attached to a long stick. Could do a considerable\n\
amount of damage.");
TECH( mfb(TEC_WBLOCK_1) );
TOOL("steak knife", 85, 25,';', c_ltcyan, STEEL, MNULL,
1, 2, 2, 10, -3, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife,
@@ -3944,7 +4095,7 @@ TOOL("wood saw", 15, 40, ';', c_cyan, IRON, WOOD,
A flimsy saw, useful for cutting through wood objects.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
TOOL("wood ax", 8, 105,'/', c_ltgray, WOOD, IRON,
TOOL("wood axe", 8, 105,'/', c_ltgray, WOOD, IRON,
// VOL WGT DAM CUT HIT FLAGS
17, 15, 24, 18, 1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::lumber,
0, "\
@@ -4018,6 +4169,10 @@ TOOL("wrench", 30, 86, ';', c_ltgray, IRON, MNULL,
An adjustable wrench. Makes a decent melee weapon, and is used in many\n\
mechanics crafting recipes.");
TOOL("snare trigger", 50, 15, ';', c_brown, WOOD, MNULL,
1, 0, 0, 0, -1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::none, 0, "\
A stick that has been cut into a trigger mechanism for a snare trap.");
TOOL("bolt cutters", 5, 100, ';', c_blue, STEEL, PLASTIC,
5, 4, 10, 4, 1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::boltcutters, 0, "\
A large pair of bolt cutters, you could use them to cut padlocks or heavy\n\
@@ -4061,10 +4216,54 @@ app on, and is providing light.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
TOOL("pocket knife", 14, 100,';', c_blue, STEEL, PLASTIC,
// VOL WGT DAM CUT HIT FLAGS
2, 2, 2, 10, -4, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife,
0, 2, 0, 10, -4, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife,
mfb(IF_STAB), "\
A small pocket knife.");
A small pocket knife, not great for combat, but better than nothing.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
TOOL("bone needle", 0, 0,';', c_white, FLESH, MNULL,
// VOL WGT DAM CUT HIT MAX DEF USE SEC FUEL REVERT FUNCTION
0, 0, 0, 0, 0, 200, 0, 1, 0, AT_THREAD, itm_null, &iuse::sew,
mfb(IF_STAB), "\
A sharp needle made from a bone. It would be useful for making rough\n\
clothing and items");
TOOL("stone hammer", 35, 70, ';', c_ltgray, STONE, WOOD,
// VOL WGT DAM CUT HIT MAX DEF USE SEC FUEL REVERT FUNCTION
2, 8, 12, 0, 0, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::hammer, 0, "\
A rock affixed to a stick, functions adequately as a hammer, but really\n\
can't compare to a proper hammer.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
TOOL("stone axe", 8, 105,'/', c_ltgray, WOOD, STONE,
// VOL WGT DAM CUT HIT MAX DEF USE SEC FUEL REVERT FUNCTION
17, 19, 15, 18, 0, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::lumber,
0, "\
A sharpened stone affixed to a stick, works passably well as ane axe\n\
but really can't compare to a proper axe..");
TOOL("stone shovel", 40, 100,'/', c_brown, STONE, WOOD,
16, 21, 15, 5, 3, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::dig, 0, "\
A flattened stone affixed to a stick, works passably well as a shovel\n\
but really can't compare to a real shovel.");
TOOL("digging stick", 40, 100,'/', c_brown, WOOD, MNULL,
6, 10, 12, 0, 3, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::dig, 0, "\
A large stick, with the end carved into a blade for digging. Can be used\n\
to dig shallow pits, but not deep ones.");
// NAME RAR PRC SYM COLOR MAT1 MAT
TOOL("shelter kit", 17, 65, ';', c_green, WOOD, LEATHER,
40, 20, 4, 0, -3, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::shelter,
0, "\
A small shelter, made of sticks and skins. (a)ctivate it to place.");
// NAME RAR PRC SYM COLOR MAT1 MAT
TOOL("damaged shelter kit", 17, 65, ';', c_green, WOOD, LEATHER,
40, 20, 4, 0, -3, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::none,
0, "\
A small shelter, made of sticks and skins. (a)ctivate it to place.\n\
This shelter has been damaged, and needs repairs.");
// BIONICS
// These are the modules used to install new bionics in the player. They're
// very simple and straightforward; a difficulty, followed by a NULL-terminated
@@ -4626,6 +4825,7 @@ std::string ammo_name(ammotype t)
case AT_SHOT: return "shot";
case AT_22: return ".22";
case AT_9MM: return "9mm";
case AT_762x25: return "7.62x25mm";
case AT_38: return ".38";
case AT_40: return ".40";
case AT_44: return ".44";
@@ -4659,6 +4859,7 @@ itype_id default_ammo(ammotype guntype)
case AT_SHOT: return itm_shot_00;
case AT_22: return itm_22_lr;
case AT_9MM: return itm_9mm;
case AT_762x25:return itm_762_25;
case AT_38: return itm_38_special;
case AT_40: return itm_10mm;
case AT_44: return itm_44magnum;
+646 -385
View File
File diff suppressed because it is too large Load Diff
+8
View File
@@ -25,6 +25,7 @@ class iuse
void pkill_l (game *g, player *p, item *it, bool t);
void xanax (game *g, player *p, item *it, bool t);
void cig (game *g, player *p, item *it, bool t);
void antibiotic (game *g, player *p, item *it, bool t);
void weed (game *g, player *p, item *it, bool t);
void coke (game *g, player *p, item *it, bool t);
void crack (game *g, player *p, item *it, bool t);
@@ -58,6 +59,8 @@ class iuse
void two_way_radio (game *g, player *p, item *it, bool t);
void radio_off (game *g, player *p, item *it, bool t);
void radio_on (game *g, player *p, item *it, bool t);
void roadmap (game *g, player *p, item *it, bool t);
void roadmap_a_target (game *g, player *p, item *it, bool t, int target);
void picklock (game *g, player *p, item *it, bool t);
void crowbar (game *g, player *p, item *it, bool t);
void makemound (game *g, player *p, item *it, bool t);
@@ -93,6 +96,10 @@ class iuse
void molotov_lit (game *g, player *p, item *it, bool t);
void dynamite (game *g, player *p, item *it, bool t);
void dynamite_act (game *g, player *p, item *it, bool t);
void firecracker_pack (game *g, player *p, item *it, bool t);
void firecracker_pack_act (game *g, player *p, item *it, bool t);
void firecracker (game *g, player *p, item *it, bool t);
void firecracker_act (game *g, player *p, item *it, bool t);
void mininuke (game *g, player *p, item *it, bool t);
void mininuke_act (game *g, player *p, item *it, bool t);
void pheromone (game *g, player *p, item *it, bool t);
@@ -111,6 +118,7 @@ class iuse
void lumber (game *g, player *p, item *it, bool t);
void hacksaw (game *g, player *p, item *it, bool t);
void tent (game *g, player *p, item *it, bool t);
void shelter (game *g, player *p, item *it, bool t);
void torch (game *g, player *p, item *it, bool t);
void torch_lit (game *g, player *p, item *it, bool t);
void candle (game *g, player *p, item *it, bool t);
+7 -48
View File
@@ -2,9 +2,12 @@
#include "action.h"
#include "game.h"
long input()
long input(long ch)
{
long ch = getch();
if (ch == -1) {
ch = getch();
}
switch (ch) {
case KEY_UP: return 'k';
case KEY_LEFT: return 'h';
@@ -17,7 +20,7 @@ long input()
bool input_wait(char & ret_ch, int delay_ms)
{
for(;;)
while(true)
{
ret_ch = '\0';
timeout(delay_ms);
@@ -53,51 +56,6 @@ bool input_wait(char & ret_ch, int delay_ms)
}
}
void get_direction(int &x, int &y, char ch)
{
x = 0;
y = 0;
switch (ch) {
case 'y':
x = -1;
y = -1;
return;
case 'u':
x = 1;
y = -1;
return;
case 'h':
x = -1;
return;
case 'j':
y = 1;
return;
case 'k':
y = -1;
return;
case 'l':
x = 1;
return;
case 'b':
x = -1;
y = 1;
return;
case 'n':
x = 1;
y = 1;
return;
case '.':
case ',':
case 'g':
x = 0;
y = 0;
return;
default:
x = -2;
y = -2;
}
}
void get_direction(game *g, int &x, int &y, char ch)
{
x = 0;
@@ -253,6 +211,7 @@ player_data @\n\
map m :\n\
missions M\n\
factions #\n\
kills )\n\
morale %\n\
messages P\n\
help ?\n\
+1 -3
View File
@@ -7,11 +7,9 @@
class game;
// Simple text input--translates numpad to vikeys
long input();
long input(long ch = -1);
bool input_wait(char & ret_ch, int timeout);
// If ch is vikey, x & y are set to corresponding direction; ch=='y'->x=-1,y=-1
void get_direction(int &x, int &y, char ch);
// Uses the keymap to figure out direction properly
void get_direction(game *g, int &x, int &y, char ch);
std::string default_keymap_txt();
+19 -20
View File
@@ -31,7 +31,7 @@ void light_map::generate(game* g, int x, int y, float natural_light, float lumin
for(int sx = x - SEEX; sx <= x + SEEX; ++sx) {
for(int sy = y - SEEY; sy <= y + SEEY; ++sy) {
// In bright light indoor light exists to some degree
if (!is_outside(sx - x + LIGHTMAP_RANGE_X, sy - y + LIGHTMAP_RANGE_Y))
if (!is_outside(sx - x, sy - y))
lm[sx - x + SEEX][sy - y + SEEY] = LIGHT_AMBIENT_LOW;
}
}
@@ -48,12 +48,12 @@ void light_map::generate(game* g, int x, int y, float natural_light, float lumin
const field current_field = g->m.field_at(sx, sy);
// When underground natural_light is 0, if this changes we need to revisit
if (natural_light > LIGHT_AMBIENT_LOW) {
if (!is_outside(sx - x + LIGHTMAP_RANGE_X, sy - y + LIGHTMAP_RANGE_Y)) {
if (!is_outside(sx - x, sy - y)) {
// Apply light sources for external/internal divide
for(int i = 0; i < 4; ++i) {
if (INBOUNDS_LARGE(sx - x + dir_x[i], sy - y + dir_y[i]) &&
is_outside(sx - x + LIGHTMAP_RANGE_X + dir_x[i], sy - y + LIGHTMAP_RANGE_Y + dir_y[i])) {
if (INBOUNDS(sx - x, sy - y) && is_outside(LIGHTMAP_RANGE_X, LIGHTMAP_RANGE_Y))
is_outside(sx - x + dir_x[i], sy - y + dir_y[i])) {
if (INBOUNDS(sx - x, sy - y) && is_outside(0, 0))
lm[sx - x + SEEX][sy - y + SEEY] = natural_light;
if (c[sx - x + LIGHTMAP_RANGE_X][sy - y + LIGHTMAP_RANGE_Y].transparency > LIGHT_TRANSPARENCY_SOLID)
@@ -383,15 +383,14 @@ void light_map::build_outside_cache(map *m, const int x, const int y, const int
{
const ter_id terrain = m->ter(sx, sy);
if( terrain == t_floor || terrain == t_rock_floor || terrain == t_floor_wax) {
for( int dx = -1; dx <=1; dx++ ) {
for( int dy = -1; dy <=1; dy++ ) {
if( INBOUNDS(x + dx, x + dy) ) {
outside_cache[x + dx][y + dy] = false;
}
if( terrain == t_floor || terrain == t_rock_floor || terrain == t_floor_wax ||
terrain == t_fema_groundsheet || terrain == t_dirtfloor) {
for( int dx = -1; dx <= 1; dx++ ) {
for( int dy = -1; dy <= 1; dy++ ) {
outside_cache[x + dx][y + dy] = false;
}
}
} else if(terrain == t_bed || terrain == t_groundsheet) {
} else if(terrain == t_bed || terrain == t_groundsheet || terrain == t_makeshift_bed) {
outside_cache[x][y] = false;
}
}
@@ -401,12 +400,12 @@ void light_map::build_outside_cache(map *m, const int x, const int y, const int
void light_map::build_light_cache(game* g, int cx, int cy)
{
// Clear cache
// Initialize cache of outside tiles
memset(outside_cache, true, sizeof(outside_cache));
for(int sx = cx - LIGHTMAP_RANGE_X; sx <= cx + LIGHTMAP_RANGE_X; ++sx) {
for(int sy = cy - LIGHTMAP_RANGE_Y; sy <= cy + LIGHTMAP_RANGE_Y; ++sy) {
int x = sx - cx + LIGHTMAP_RANGE_X;
int y = sy - cy + LIGHTMAP_RANGE_Y;
for(int x = 0; x < LIGHTMAP_CACHE_X; x++) {
for(int y = 0; y < LIGHTMAP_CACHE_Y; y++) {
int sx = x + g->u.posx - LIGHTMAP_RANGE_X;
int sy = y + g->u.posy - LIGHTMAP_RANGE_Y;
build_outside_cache(&g->m, x, y, sx, sy);
c[x][y].transparency = LIGHT_TRANSPARENCY_CLEAR;
@@ -449,10 +448,10 @@ void light_map::build_light_cache(game* g, int cx, int cy)
}
}
for(int sx = cx - LIGHTMAP_RANGE_X; sx <= cx + LIGHTMAP_RANGE_X; ++sx) {
for(int sy = cy - LIGHTMAP_RANGE_Y; sy <= cy + LIGHTMAP_RANGE_Y; ++sy) {
int x = sx - cx + LIGHTMAP_RANGE_X;
int y = sy - cy + LIGHTMAP_RANGE_Y;
for(int x = 0; x < LIGHTMAP_CACHE_X; x++) {
for(int y = 0; y < LIGHTMAP_CACHE_Y; y++) {
int sx = x + cx - LIGHTMAP_RANGE_X;
int sy = y + cy - LIGHTMAP_RANGE_Y;
if (c[x][y].veh) {
if (c[x][y].veh->part_flag(c[x][y].veh_part, vpf_opaque) &&
+8 -2
View File
@@ -1,5 +1,5 @@
#include "line.h"
#include "map.h"
#include <stdlib.h>
#define SGN(a) (((a)<0) ? -1 : 1)
@@ -192,7 +192,13 @@ rl_vec2d rl_vec2d::normalized(){
return ret;
}
float rl_vec2d::dot_product (rl_vec2d &v){
return x*v.x + y*v.y;
float dot = x*v.x + y*v.y;
// this is messy, but the dot of normalized rl_vecs should somehow be max 1
float tot1 = fabs(x) + fabs(y);
float tot2 = fabs(v.x) + fabs(v.y);
dot /= ((tot1+tot2)/2);
dot *= norm() * v.norm();
return dot;
}
bool rl_vec2d::is_null(){
return !(x || y);
+5 -3
View File
@@ -46,12 +46,14 @@ int main(int argc, char *argv[])
keypad(stdscr, true); // Numpad is numbers
init_colors(); // See color.cpp
curs_set(0); // Invisible cursor
set_escdelay(10); // Make escape actually responsive
std::srand(seed);
bool quit_game = false;
bool delete_world = false;
game *g = new game;
g->init_ui();
MAPBUFFER.set_game(g);
MAPBUFFER.load();
@@ -88,13 +90,13 @@ void exit_handler(int s) {
bool bExit = false;
if (s == 2) {
if (query_yn("Really Quit without saving?")) {
if (query_yn("Really Quit? All unsafed changes will be lost.")) {
bExit = true;
}
} else if (s == -999) {
bExit = true;
} else {
//query_yn("Signal received: %d", s);
//query_yn(g, "Signal received: %d", s);
bExit = true;
}
@@ -108,6 +110,6 @@ void exit_handler(int s) {
system("clear"); // Tell the terminal to clear itself
#endif
exit(1);
exit(0);
}
}
+426
View File
@@ -0,0 +1,426 @@
#include "game.h"
#include "input.h"
#include "keypress.h"
#include "debug.h"
#include "mapbuffer.h"
#include "cursesdef.h"
#include <sys/stat.h>
#include <dirent.h>
#define dbg(x) dout((DebugLevel)(x),D_GAME) << __FILE__ << ":" << __LINE__ << ": "
void game::print_menu(WINDOW* w_open, int iSel, const int iMenuOffsetX, int iMenuOffsetY, bool bShowDDA)
{
//Clear Lines
werase(w_open);
for (int i = 1; i < 79; i++)
mvwputch(w_open, 23, i, c_white, LINE_OXOX);
mvwprintz(w_open, 24, 5, c_red, "Please report bugs to TheDarklingWolf@gmail.com or post on the forums.");
int iLine = 0;
const int iOffsetX1 = 3;
const int iOffsetX2 = 4;
const int iOffsetX3 = 18;
const nc_color cColor1 = c_ltcyan;
const nc_color cColor2 = c_ltblue;
const nc_color cColor3 = c_ltblue;
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, "_________ __ .__ ");
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, "\\_ ___ \\ _____ _/ |_ _____ ____ | | ___.__ ______ _____ ");
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, "/ \\ \\/ \\__ \\ \\ __\\\\__ \\ _/ ___\\ | | < | | / ___/ / \\ ");
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, "\\ \\____ / __ \\_ | | / __ \\_\\ \\___ | |__ \\___ | \\___ \\ | Y Y \\");
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, " \\______ /(____ / |__| (____ / \\___ >|____/ / ____|/____ >|__|_| /");
mvwprintz(w_open, iLine++, iOffsetX1, cColor1, " \\/ \\/ \\/ \\/ \\/ \\/ \\/ ");
if (bShowDDA) {
iLine++;
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, "________ .__ ________ ");
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, "\\______ \\ _____ _______ | | __ \\______ \\ _____ ___.__ ______");
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, " | | \\ \\__ \\ \\_ __ \\| |/ / | | \\ \\__ \\ < | | / ___/");
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, " | ` \\ / __ \\_ | | \\/| < | ` \\ / __ \\_ \\___ | \\___ \\ ");
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, "/_______ /(____ / |__| |__|_ \\ /_______ /(____ / / ____|/____ >");
mvwprintz(w_open, iLine++, iOffsetX2, cColor2, " \\/ \\/ \\/ \\/ \\/ \\/ \\/ ");
iLine++;
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, " _____ .__ .___");
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, " / _ \\ | |__ ____ _____ __| _/");
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, " / /_\\ \\ | | \\ _/ __ \\ \\__ \\ / __ | ");
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, "/ | \\| Y \\\\ ___/ / __ \\_/ /_/ | ");
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, "\\____|__ /|___| / \\___ >(____ /\\____ | ");
mvwprintz(w_open, iLine++, iOffsetX3, cColor3, " \\/ \\/ \\/ \\/ \\/ ");
}
std::vector<std::string> vMenuItems;
vMenuItems.push_back("MOTD");
vMenuItems.push_back("New Game");
vMenuItems.push_back("Load");
vMenuItems.push_back("Reset");
vMenuItems.push_back("Special");
vMenuItems.push_back("Options");
vMenuItems.push_back("Help");
vMenuItems.push_back("Credits");
vMenuItems.push_back("Quit");
print_menu_items(w_open, vMenuItems, iSel, iMenuOffsetY, iMenuOffsetX);
refresh();
wrefresh(w_open);
refresh();
}
void game::print_menu_items(WINDOW* w_in, std::vector<std::string> vItems, int iSel, int iOffsetY, int iOffsetX)
{
mvwprintz(w_in, iOffsetY, iOffsetX, c_black, "");
for (int i=0; i < vItems.size(); i++) {
wprintz(w_in, c_ltgray, "[");
if (iSel == i) {
wprintz(w_in, h_white, vItems[i].c_str());
} else {
wprintz(w_in, c_white, (vItems[i].substr(0, 1)).c_str());
wprintz(w_in, c_ltgray, (vItems[i].substr(1)).c_str());
}
wprintz(w_in, c_ltgray, "] ");
}
}
bool game::opening_screen()
{
WINDOW* w_background = newwin(TERMY, TERMX, 0, 0);
werase(w_background);
wrefresh(w_background);
WINDOW* w_open = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
const int iMenuOffsetX = 2;
int iMenuOffsetY = 22;
std::vector<std::string> vSubItems;
vSubItems.push_back("Custom Character");
vSubItems.push_back("Preset Character");
vSubItems.push_back("Random Character");
print_menu(w_open, 0, iMenuOffsetX, iMenuOffsetY);
std::vector<std::string> savegames, templates;
std::string tmp;
dirent *dp;
DIR *dir = opendir("save");
if (!dir) {
#if (defined _WIN32 || defined __WIN32__)
mkdir("save");
#else
mkdir("save", 0777);
#endif
dir = opendir("save");
}
if (!dir) {
dbg(D_ERROR) << "game:opening_screen: Unable to make save directory.";
debugmsg("Could not make './save' directory");
endwin();
exit(1);
}
while ((dp = readdir(dir))) {
tmp = dp->d_name;
if (tmp.find(".sav") != std::string::npos)
savegames.push_back(tmp.substr(0, tmp.find(".sav")));
}
closedir(dir);
dir = opendir("data");
while ((dp = readdir(dir))) {
tmp = dp->d_name;
if (tmp.find(".template") != std::string::npos)
templates.push_back(tmp.substr(0, tmp.find(".template")));
}
int sel1 = 1, sel2 = 1, layer = 1;
InputEvent input;
int chInput;
bool start = false;
// Load MOTD and store it in a string
std::vector<std::string> motd;
std::ifstream motd_file;
motd_file.open("data/motd");
if (!motd_file.is_open())
motd.push_back("No message today.");
else {
while (!motd_file.eof()) {
std::string tmp;
getline(motd_file, tmp);
if (tmp[0] != '#')
motd.push_back(tmp);
}
}
// Load Credits and store it in a string
std::vector<std::string> credits;
std::ifstream credits_file;
credits_file.open("data/credits");
if (!credits_file.is_open())
credits.push_back("No message today.");
else {
while (!credits_file.eof()) {
std::string tmp;
getline(credits_file, tmp);
if (tmp[0] != '#')
credits.push_back(tmp);
}
}
while(!start) {
if (layer == 1) {
print_menu(w_open, sel1, iMenuOffsetX, iMenuOffsetY, (sel1 == 0 || sel1 == 7) ? false : true);
if (sel1 == 0) { // Print the MOTD.
for (int i = 0; i < motd.size() && i < 16; i++)
mvwprintz(w_open, i + 7, 8, c_ltred, motd[i].c_str());
wrefresh(w_open);
refresh();
} else if (sel1 == 7) { // Print the Credits.
for (int i = 0; i < credits.size() && i < 16; i++)
mvwprintz(w_open, i + 7, 8, c_ltred, credits[i].c_str());
wrefresh(w_open);
refresh();
}
chInput = getch();
if (chInput == 'm' || chInput == 'M') {
sel1 = 0;
chInput = '\n';
} else if (chInput == 'n' || chInput == 'N') {
sel1 = 1;
chInput = '\n';
} else if (chInput == 'L') {
sel1 = 2;
chInput = '\n';
} else if (chInput == 'r' || chInput == 'R') {
sel1 = 3;
chInput = '\n';
} else if (chInput == 's' || chInput == 'S') {
sel1 = 4;
chInput = '\n';
} else if (chInput == 'o' || chInput == 'O') {
sel1 = 5;
chInput = '\n';
} else if (chInput == 'H') {
sel1 = 6;
chInput = '\n';
} else if (chInput == 'c' || chInput == 'C') {
sel1 = 7;
chInput = '\n';
} else if (chInput == 'q' || chInput == 'Q' || chInput == KEY_ESCAPE) {
sel1 = 8;
chInput = '\n';
}
if (chInput == KEY_LEFT || chInput == 'h') {
if (sel1 > 0)
sel1--;
else
sel1 = 8;
} else if (chInput == KEY_RIGHT || chInput == 'l') {
if (sel1 < 8)
sel1++;
else
sel1 = 0;
} else if ((chInput == KEY_UP || chInput == 'k' || chInput == '\n') && sel1 > 0 && sel1 != 7) {
if (sel1 == 5) {
show_options();
} else if (sel1 == 6) {
help();
} else if (sel1 == 8) {
uquit = QUIT_MENU;
return false;
} else {
sel2 = 0;
layer = 2;
print_menu(w_open, sel1, iMenuOffsetX, iMenuOffsetY, (sel1 == 0 || sel1 == 7) ? false : true);
}
}
} else if (layer == 2) {
if (sel1 == 1) { // New Character
print_menu_items(w_open, vSubItems, sel2, iMenuOffsetY-2, iMenuOffsetX+7);
wrefresh(w_open);
refresh();
chInput = getch();
if (chInput == 'c' || chInput == 'C') {
sel2 = 0;
chInput = '\n' ;
} else if (chInput == 'p' || chInput == 'P') {
sel2 = 1;
chInput = '\n';
} else if (chInput == 'r' || chInput == 'R') {
sel2 = 2;
chInput = '\n';
}
if (chInput == KEY_LEFT || chInput == 'h') {
if (sel2 > 0)
sel2--;
else
sel2 = 2;
} if (chInput == KEY_RIGHT || chInput == 'l') {
if (sel2 < 2)
sel2++;
else
sel2 = 0;
} else if (chInput == KEY_DOWN || chInput == 'j' || chInput == KEY_ESCAPE) {
layer = 1;
sel1 = 1;
}
if (chInput == KEY_UP || chInput == 'k' || chInput == '\n') {
if (sel2 == 0 || sel2 == 2) {
if (!u.create(this, (sel2 == 0) ? PLTYPE_CUSTOM : PLTYPE_RANDOM)) {
u = player();
delwin(w_open);
return (opening_screen());
}
werase(w_background);
wrefresh(w_background);
start_game();
start = true;
} else if (sel2 == 1) {
layer = 3;
sel1 = 0;
print_menu_items(w_open, vSubItems, sel2, iMenuOffsetY-2, iMenuOffsetX+7);
}
}
} else if (sel1 == 2) { // Load Character
if (savegames.size() == 0)
mvwprintz(w_open, iMenuOffsetY - 2, 19 + iMenuOffsetX, c_red, "No save games found!");
else {
for (int i = 0; i < savegames.size(); i++) {
int line = iMenuOffsetY - 2 - i;
mvwprintz(w_open, line, 19 + iMenuOffsetX, (sel2 == i ? h_white : c_white), savegames[i].c_str());
}
}
wrefresh(w_open);
refresh();
input = get_input();
if (savegames.size() == 0 && (input == DirectionS || input == Confirm)) {
layer = 1;
} else if (input == DirectionS) {
if (sel2 > 0)
sel2--;
else
sel2 = savegames.size() - 1;
} else if (input == DirectionN) {
if (sel2 < savegames.size() - 1)
sel2++;
else
sel2 = 0;
} else if (input == DirectionW || input == Cancel) {
layer = 1;
}
if (input == DirectionE || input == Confirm) {
if (sel2 >= 0 && sel2 < savegames.size()) {
werase(w_background);
wrefresh(w_background);
load(savegames[sel2]);
start = true;
}
}
} else if (sel1 == 3) { // Delete world
if (query_yn("Delete the world and all saves?")) {
delete_save();
savegames.clear();
MAPBUFFER.reset();
MAPBUFFER.make_volatile();
}
layer = 1;
} else if (sel1 == 4) { // Special game
for (int i = 1; i < NUM_SPECIAL_GAMES; i++) {
mvwprintz(w_open, iMenuOffsetY-i-1, 34 + iMenuOffsetX, (sel2 == i-1 ? h_white : c_white),
special_game_name( special_game_id(i) ).c_str());
}
wrefresh(w_open);
refresh();
input = get_input();
if (input == DirectionS) {
if (sel2 > 0)
sel2--;
else
sel2 = NUM_SPECIAL_GAMES - 2;
} else if (input == DirectionN) {
if (sel2 < NUM_SPECIAL_GAMES - 2)
sel2++;
else
sel2 = 0;
} else if (input == DirectionW || input == Cancel) {
layer = 1;
}
if (input == DirectionE || input == Confirm) {
if (sel2 >= 0 && sel2 < NUM_SPECIAL_GAMES - 1) {
delete gamemode;
gamemode = get_special_game( special_game_id(sel2+1) );
if (!gamemode->init(this)) {
delete gamemode;
gamemode = new special_game;
u = player();
delwin(w_open);
return (opening_screen());
}
start = true;
}
}
}
} else if (layer == 3) { // Character Templates
if (templates.size() == 0)
mvwprintz(w_open, iMenuOffsetY-4, iMenuOffsetX+27, c_red, "No templates found!");
else {
for (int i = 0; i < templates.size(); i++) {
int line = iMenuOffsetY - 4 - i;
mvwprintz(w_open, line, 27 + iMenuOffsetX, (sel1 == i ? h_white : c_white), templates[i].c_str());
}
}
wrefresh(w_open);
refresh();
input = get_input();
if (input == DirectionS) {
if (sel1 > 0)
sel1--;
else
sel1 = templates.size() - 1;
} else if (templates.size() == 0 && (input == DirectionN || input == Confirm)) {
sel1 = 1;
layer = 2;
print_menu(w_open, sel1, iMenuOffsetX, iMenuOffsetY);
} else if (input == DirectionN) {
if (sel1 < templates.size() - 1)
sel1++;
else
sel1 = 0;
} else if (input == DirectionW || input == Cancel || templates.size() == 0) {
sel1 = 1;
layer = 2;
print_menu(w_open, sel1, iMenuOffsetX, iMenuOffsetY);
} else if (input == DirectionE || input == Confirm) {
if (!u.create(this, PLTYPE_TEMPLATE, templates[sel1])) {
u = player();
delwin(w_open);
return (opening_screen());
}
werase(w_background);
wrefresh(w_background);
start_game();
start = true;
}
}
}
delwin(w_open);
if (start == false)
uquit = QUIT_MENU;
return start;
}
+170 -73
View File
@@ -1,4 +1,4 @@
#include "map.h"
# include "map.h"
#include "lightmap.h"
#include "output.h"
#include "rng.h"
@@ -219,7 +219,7 @@ void map::board_vehicle(game *g, int x, int y, player *p)
return;
}
veh->parts[seat_part].set_flag(vehicle_part::passenger_flag);
veh->parts[seat_part].passenger_id = 0; // Player is 0
veh->parts[seat_part].passenger_id = p->id; // Player is 0
p->posx = x;
p->posy = y;
@@ -343,7 +343,7 @@ bool map::displace_vehicle (game *g, int &x, int &y, const int dx, const int dy,
g->u.posx, g->u.posy);
continue;
}
int trec = rec -psgs[i]->skillLevel("driving").level();
int trec = rec -psgs[i]->skillLevel("driving");
if (trec < 0) trec = 0;
// add recoil
psg->driving_recoil = rec;
@@ -515,10 +515,13 @@ bool map::vehproceed(game* g){
}
}
if (veh->skidding && one_in(4)) // might turn uncontrollably while skidding
veh->move.init (veh->move.dir() +
(one_in(2) ? -15 * rng(1, 3) : 15 * rng(1, 3)));
else if (pl_ctrl && rng(0, 4) > g->u.skillLevel("driving").level() && one_in(20)) {
if (veh->skidding){
if (one_in(4)){ // might turn uncontrollably while skidding
veh->move.init (veh->move.dir() +
(one_in(2) ? -15 * rng(1, 3) : 15 * rng(1, 3)));
}
}
else if (pl_ctrl && rng(0, 4) > g->u.skillLevel("driving") && one_in(20)) {
g->add_msg("You fumble with the %s's controls.", veh->name.c_str());
veh->turn (one_in(2) ? -15 : 15);
}
@@ -607,6 +610,8 @@ bool map::vehproceed(game* g){
//give veh2 the initiative to proceed next before veh1
float avg_of_turn = (veh2->of_turn + veh->of_turn) / 2;
if(avg_of_turn < .1)
avg_of_turn = .1;
veh->of_turn = avg_of_turn * .9;
veh2->of_turn = avg_of_turn * 1.1;
return true;
@@ -650,7 +655,7 @@ bool map::vehproceed(game* g){
} else if (veh->part_with_feature (ppl[ps], vpf_controls) >= 0) {
const int lose_ctrl_roll = rng (0, imp);
if (lose_ctrl_roll > psg->dex_cur * 2 + psg->skillLevel("driving").level() * 3) {
if (lose_ctrl_roll > psg->dex_cur * 2 + psg->skillLevel("driving") * 3) {
if (psgname.length())
g->add_msg ("%s lose%s control of the %s.", psgname.c_str(),
(psg == &g->u ? "" : "s"), veh->name.c_str());
@@ -707,8 +712,10 @@ bool map::vehproceed(game* g){
if (can_move) {
// accept new direction
if (veh->skidding)
if (veh->skidding){
veh->face.init (veh->turn_dir);
veh->possibly_recover_from_skid();
}
else
veh->face = mdir;
veh->move = mdir;
@@ -718,7 +725,7 @@ bool map::vehproceed(game* g){
}
// accept new position
// if submap changed, we need to process grid from the beginning.
int sm_change = displace_vehicle (g, x, y, dx, dy);
displace_vehicle (g, x, y, dx, dy);
} else { // can_move
veh->stop();
}
@@ -862,12 +869,13 @@ bool map::trans(const int x, const int y, char * trans_buf)
}
} else
tertr = terlist[ter(x, y)].flags & mfb(transparent);
if( tertr )
{ // Fields may obscure the view, too
// field & f(field_at(x, y));
// if(f.type == 0 || fieldlist[f.type].transparent[f.density - 1]); // TODO: Clarify function
if(trans_buf) trans_buf[x + (y * my_MAPSIZE * SEEX)] = 1;
return true;
if( tertr ){
// Fields may obscure the view, too
field & f(field_at(x, y));
if(f.type == 0 || fieldlist[f.type].transparent[f.density - 1]){
if(trans_buf) trans_buf[x + (y * my_MAPSIZE * SEEX)] = 1;
return true;
}
}
if(trans_buf) trans_buf[x + (y * my_MAPSIZE * SEEX)] = 0;
return false;
@@ -907,12 +915,13 @@ bool map::is_destructable_ter_only(const int x, const int y)
bool map::is_outside(const int x, const int y)
{
bool out = (ter(x, y) != t_bed && ter(x, y) != t_groundsheet);
bool out = (ter(x, y) != t_bed && ter(x, y) != t_groundsheet && ter(x, y) != t_makeshift_bed);
for(int i = -1; out && i <= 1; i++)
for(int j = -1; out && j <= 1; j++) {
const ter_id terrain = ter( x + i, y + j );
out = (terrain != t_floor && terrain != t_rock_floor && terrain != t_floor_wax);
out = (terrain != t_floor && terrain != t_rock_floor && terrain != t_floor_wax &&
terrain != t_fema_groundsheet && terrain != t_dirtfloor && terrain != t_skin_groundsheet);
}
if (out) {
int vpart;
@@ -1085,8 +1094,8 @@ bool map::bash(const int x, const int y, const int str, std::string &sound, int
return true;
}
break;
case t_palisade:
case t_palisade:
case t_palisade_gate:
result = rng(0, 120);
if (res) *res = result;
@@ -1100,8 +1109,8 @@ case t_palisade_gate:
sound += "whump!";
return true;
}
break;
break;
case t_wall_log:
result = rng(0, 120);
if (res) *res = result;
@@ -1144,7 +1153,7 @@ case t_wall_log:
return true;
}
break;
case t_chaingate_c:
result = rng(0, has_adjacent_furniture(x, y) ? 80 : 100);
@@ -1209,7 +1218,7 @@ case t_wall_log:
break;
case t_window_domestic:
case t_curtains:
case t_curtains:
case t_window_domestic_taped:
result = rng(0, 6);
if (res) *res = result;
@@ -1226,8 +1235,8 @@ case t_wall_log:
break;
case t_window:
case t_window_alarm:
case t_window_alarm_taped:
case t_window_alarm:
case t_window_alarm_taped:
case t_window_taped:
result = rng(0, 6);
if (res) *res = result;
@@ -1273,6 +1282,43 @@ case t_wall_log:
}
break;
case t_skin_wall:
case t_skin_door:
case t_skin_door_o:
case t_skin_groundsheet:
result = rng(0, 6);
if (res) *res = result;
if (str >= result)
{
// Special code to collapse the tent if destroyed
int tentx, tenty = -1;
// Find the center of the tent
for (int i = -1; i <= 1; i++)
for (int j = -1; j <= 1; j++)
if (ter(x + i, y + j) == t_skin_groundsheet){
tentx = x + i;
tenty = y + j;
break;
}
// Never found tent center, bail out
if (tentx == -1 && tenty == -1)
break;
// Take the tent down
for (int i = -1; i <= 1; i++)
for (int j = -1; j <= 1; j++) {
if (ter(tentx + i, tenty + j) == t_skin_groundsheet)
add_item(tentx + i, tenty + j, (*itypes)[itm_damaged_shelter_kit], 0);
ter(tentx + i, tenty + j) = t_dirt;
}
sound += "rrrrip!";
return true;
} else {
sound += "slap!";
return true;
}
break;
case t_canvas_wall:
case t_canvas_door:
case t_canvas_door_o:
@@ -1679,7 +1725,7 @@ void map::shoot(game *g, const int x, const int y, int &dam,
switch (ter(x, y)) {
case t_wall_wood_broken:
case t_wall_wood_broken:
case t_wall_log_broken:
case t_door_b:
if (hit_items || one_in(8)) { // 1 in 8 chance of hitting the door
@@ -1706,6 +1752,7 @@ void map::shoot(game *g, const int x, const int y, int &dam,
break;
case t_window:
case t_window_domestic:
case t_window_alarm:
dam -= rng(0, 5);
ter(x, y) = t_window_frame;
@@ -1867,6 +1914,7 @@ bool map::hit_with_acid(game *g, const int x, const int y)
case t_bathtub:
case t_gas_pump:
case t_gas_pump_smashed:
case t_gas_pump_empty:
return false;
case t_card_science:
@@ -1898,12 +1946,12 @@ bool map::open_door(const int x, const int y, const bool inside)
{
if (ter(x, y) == t_door_c) {
ter(x, y) = t_door_o;
return true;
} else if (ter(x, y) == t_palisade_gate) {
ter(x, y) = t_palisade_gate_o;
return true;
} else if (ter(x, y) == t_canvas_door) {
ter(x, y) = t_canvas_door_o;
ter(x, y) = t_canvas_door_o;
return true;
} else if (ter(x, y) == t_skin_door) {
ter(x, y) = t_skin_door_o;
return true;
} else if (inside && ter(x, y) == t_curtains) {
ter(x, y) = t_window_domestic;
@@ -1950,15 +1998,15 @@ bool map::close_door(const int x, const int y, const bool inside)
{
if (ter(x, y) == t_door_o) {
ter(x, y) = t_door_c;
return true;
} else if (ter(x, y) == t_palisade_gate_o) {
ter(x, y) = t_palisade_gate;
return true;
} else if (inside && ter(x, y) == t_window_domestic) {
ter(x, y) = t_curtains;
return true;
} else if (ter(x, y) == t_canvas_door_o) {
ter(x, y) = t_canvas_door;
ter(x, y) = t_canvas_door;
return true;
} else if (ter(x, y) == t_skin_door_o) {
ter(x, y) = t_skin_door;
return true;
} else if (inside && ter(x, y) == t_window_open) {
ter(x, y) = t_window_domestic;
@@ -2282,14 +2330,14 @@ void map::add_trap(const int x, const int y, const trap_id t)
void map::disarm_trap(game *g, const int x, const int y)
{
int skillLevel = g->u.skillLevel("traps").level();
int skillLevel = g->u.skillLevel("traps");
if (tr_at(x, y) == tr_null) {
debugmsg("Tried to disarm a trap where there was none (%d %d)", x, y);
return;
}
const int tSkillLevel = g->u.skillLevel("traps").level();
const int tSkillLevel = g->u.skillLevel("traps");
const int diff = g->traps[tr_at(x, y)]->difficulty;
int roll = rng(tSkillLevel, 4 * tSkillLevel);
@@ -2399,6 +2447,49 @@ computer* map::computer_at(const int x, const int y)
return &(grid[nonant]->comp);
}
bool map::allow_camp(const int x, const int y, const int radius)
{
return camp_at(x, y, radius) == NULL;
}
basecamp* map::camp_at(const int x, const int y, const int radius)
{
// locate the nearest camp in a CAMPSIZE radius
if (!INBOUNDS(x, y))
return NULL;
const int sx = std::max(0, x / SEEX - CAMPSIZE);
const int sy = std::max(0, y / SEEY - CAMPSIZE);
const int ex = std::min(MAPSIZE - 1, x / SEEX + CAMPSIZE);
const int ey = std::min(MAPSIZE - 1, y / SEEY + CAMPSIZE);
for( int ly = sy; ly < ey; ++ly )
{
for( int lx = sx; lx < ex; ++lx )
{
int nonant = lx + ly * my_MAPSIZE;
if (grid[nonant]->camp.is_valid())
{
// we only allow on camp per size radius, kinda
return &(grid[nonant]->camp);
}
}
}
return NULL;
}
void map::add_camp(const std::string& name, const int x, const int y)
{
if (!allow_camp(x, y)) {
dbg(D_ERROR) << "map::add_camp: Attempting to add camp when one in local area.";
return;
}
const int nonant = int(x / SEEX) + int(y / SEEY) * my_MAPSIZE;
grid[nonant]->camp = basecamp(name, x, y);
}
void map::debug()
{
mvprintw(0, 0, "MAP DEBUG");
@@ -2420,7 +2511,7 @@ void map::draw(game *g, WINDOW* w, const point center)
g->reset_light_level();
const int natural_sight_range = g->u.sight_range(1);
const int light_sight_range = g->u.sight_range(g->light_level());
int lowlight_sight_range = std::max((int)g->light_level() / 2, natural_sight_range);
const int lowlight_sight_range = std::max((int)g->light_level() / 2, natural_sight_range);
const int max_sight_range = g->u.unimpaired_range();
for (int i = 0; i < my_MAPSIZE * my_MAPSIZE; i++) {
@@ -2440,13 +2531,15 @@ void map::draw(game *g, WINDOW* w, const point center)
for (int realy = center.y - getmaxy(w)/2; realy <= center.y + getmaxy(w)/2; realy++) {
const int dist = rl_dist(g->u.posx, g->u.posy, realx, realy);
int sight_range = light_sight_range;
int low_sight_range = lowlight_sight_range;
bool bRainOutside = false;
// While viewing indoor areas use lightmap model
if (!g->lm.is_outside(realx - g->u.posx, realy - g->u.posy)) {
sight_range = natural_sight_range;
// Don't display area as shadowy if it's outside and illuminated by natural light
} else if (dist <= g->u.sight_range(g->natural_light_level())) {
lowlight_sight_range = std::max(g_light_level, natural_sight_range);
} else if (dist <= g->u.sight_range(g_light_level)) {
low_sight_range = std::max(g_light_level, natural_sight_range);
bRainOutside = true;
}
// I've moved this part above loops without even thinking that
@@ -2498,18 +2591,22 @@ void map::draw(game *g, WINDOW* w, const point center)
else
mvwputch(w, realy+getmaxy(w)/2 - center.y, realx+getmaxx(w)/2 - center.x, c_ltgray, '#');
} else if (dist <= u_clairvoyance || can_see) {
if (bRainOutside && INBOUNDS(realx, realy) && !has_flag(supports_roof, realx, realy))
g->mapRain[realy + getmaxy(w)/2 - g->u.posy][realx + getmaxx(w)/2 - g->u.posx] = true;
drawsq(w, g->u, realx, realy, false, true, center.x, center.y,
(dist > lowlight_sight_range && LL_LIT > lit) ||
(dist > low_sight_range && LL_LIT > lit) ||
(dist > sight_range && LL_LOW == lit),
LL_BRIGHT == lit);
} else {
mvwputch(w, realy+getmaxy(w)/2 - center.y, realx+getmaxx(w)/2 - center.x, c_black,'#');
mvwputch(w, realy+getmaxy(w)/2 - center.y, realx+getmaxx(w)/2 - center.x, c_black,' ');
}
}
}
int atx = getmaxx(w)/2 + g->u.posx - center.x, aty = getmaxy(w)/2 + g->u.posy - center.y;
if (atx >= 0 && atx < g->TERRAIN_WINDOW_WIDTH && aty >= 0 && aty < g->TERRAIN_WINDOW_HEIGHT)
if (atx >= 0 && atx < TERRAIN_WINDOW_WIDTH && aty >= 0 && aty < TERRAIN_WINDOW_HEIGHT) {
mvwputch(w, aty, atx, g->u.color(), '@');
g->mapRain[aty][atx] = false;
}
}
void map::drawsq(WINDOW* w, player &u, const int x, const int y, const bool invert_arg,
@@ -2775,10 +2872,10 @@ std::vector<point> map::route(const int Fx, const int Fy, const int Tx, const in
tername(Fx, Fy).c_str(), Tx, Ty);
*/
std::vector<point> open;
astar_list list[SEEX * my_MAPSIZE][SEEY * my_MAPSIZE];
int score [SEEX * my_MAPSIZE][SEEY * my_MAPSIZE];
int gscore [SEEX * my_MAPSIZE][SEEY * my_MAPSIZE];
point parent [SEEX * my_MAPSIZE][SEEY * my_MAPSIZE];
astar_list list[SEEX * MAPSIZE][SEEY * MAPSIZE];
int score [SEEX * MAPSIZE][SEEY * MAPSIZE];
int gscore [SEEX * MAPSIZE][SEEY * MAPSIZE];
point parent [SEEX * MAPSIZE][SEEY * MAPSIZE];
int startx = Fx - 4, endx = Tx + 4, starty = Fy - 4, endy = Ty + 4;
if (Tx < Fx) {
startx = Tx - 4;
@@ -2878,33 +2975,33 @@ std::vector<point> map::route(const int Fx, const int Fy, const int Tx, const in
return ret;
}
void map::save(overmap *om, unsigned const int turn, const int x, const int y)
void map::save(overmap *om, unsigned const int turn, const int x, const int y, const int z)
{
for (int gridx = 0; gridx < my_MAPSIZE; gridx++) {
for (int gridy = 0; gridy < my_MAPSIZE; gridy++)
saven(om, turn, x, y, gridx, gridy);
saven(om, turn, x, y, z, gridx, gridy);
}
}
void map::load(game *g, const int wx, const int wy, const bool update_vehicle)
void map::load(game *g, const int wx, const int wy, const int wz, const bool update_vehicle)
{
for (int gridx = 0; gridx < my_MAPSIZE; gridx++) {
for (int gridy = 0; gridy < my_MAPSIZE; gridy++) {
if (!loadn(g, wx, wy, gridx, gridy, update_vehicle))
loadn(g, wx, wy, gridx, gridy, update_vehicle);
if (!loadn(g, wx, wy, wz, gridx, gridy, update_vehicle))
loadn(g, wx, wy, wz, gridx, gridy, update_vehicle);
}
}
}
void map::shift(game *g, const int wx, const int wy, const int sx, const int sy)
void map::shift(game *g, const int wx, const int wy, const int wz, const int sx, const int sy)
{
// Special case of 0-shift; refresh the map
if (sx == 0 && sy == 0) {
return; // Skip this?
for (int gridx = 0; gridx < my_MAPSIZE; gridx++) {
for (int gridy = 0; gridy < my_MAPSIZE; gridy++) {
if (!loadn(g, wx+sx, wy+sy, gridx, gridy))
loadn(g, wx+sx, wy+sy, gridx, gridy);
if (!loadn(g, wx+sx, wy+sy, wz, gridx, gridy))
loadn(g, wx+sx, wy+sy, wz, gridx, gridy);
}
}
return;
@@ -2935,8 +3032,8 @@ void map::shift(game *g, const int wx, const int wy, const int sx, const int sy)
copy_grid(gridx + gridy * my_MAPSIZE,
gridx + sx + (gridy + sy) * my_MAPSIZE);
update_vehicle_list(gridx + gridy * my_MAPSIZE);
} else if (!loadn(g, wx + sx, wy + sy, gridx, gridy))
loadn(g, wx + sx, wy + sy, gridx, gridy);
} else if (!loadn(g, wx + sx, wy + sy, wz, gridx, gridy))
loadn(g, wx + sx, wy + sy, wz, gridx, gridy);
}
} else { // sy < 0; work through it backwards
for (int gridy = my_MAPSIZE - 1; gridy >= 0; gridy--) {
@@ -2949,8 +3046,8 @@ void map::shift(game *g, const int wx, const int wy, const int sx, const int sy)
copy_grid(gridx + gridy * my_MAPSIZE,
gridx + sx + (gridy + sy) * my_MAPSIZE);
update_vehicle_list(gridx + gridy * my_MAPSIZE);
} else if (!loadn(g, wx + sx, wy + sy, gridx, gridy))
loadn(g, wx + sx, wy + sy, gridx, gridy);
} else if (!loadn(g, wx + sx, wy + sy, wz, gridx, gridy))
loadn(g, wx + sx, wy + sy, wz, gridx, gridy);
}
}
}
@@ -2967,8 +3064,8 @@ void map::shift(game *g, const int wx, const int wy, const int sx, const int sy)
copy_grid(gridx + gridy * my_MAPSIZE,
gridx + sx + (gridy + sy) * my_MAPSIZE);
update_vehicle_list(gridx + gridy * my_MAPSIZE);
} else if (!loadn(g, wx + sx, wy + sy, gridx, gridy))
loadn(g, wx + sx, wy + sy, gridx, gridy);
} else if (!loadn(g, wx + sx, wy + sy, wz, gridx, gridy))
loadn(g, wx + sx, wy + sy, wz, gridx, gridy);
}
} else { // sy < 0; work through it backwards
for (int gridy = my_MAPSIZE - 1; gridy >= 0; gridy--) {
@@ -2981,8 +3078,8 @@ void map::shift(game *g, const int wx, const int wy, const int sx, const int sy)
copy_grid(gridx + gridy * my_MAPSIZE,
gridx + sx + (gridy + sy) * my_MAPSIZE);
update_vehicle_list(gridx + gridy * my_MAPSIZE);
} else if (!loadn(g, wx + sx, wy + sy, gridx, gridy))
loadn(g, wx + sx, wy + sy, gridx, gridy);
} else if (!loadn(g, wx + sx, wy + sy, wz, gridx, gridy))
loadn(g, wx + sx, wy + sy, wz, gridx, gridy);
}
}
}
@@ -2996,7 +3093,7 @@ void map::shift(game *g, const int wx, const int wy, const int sx, const int sy)
// 0,0 1,0 2,0
// 0,1 1,1 2,1
// 0,2 1,2 2,2
void map::saven(overmap *om, unsigned const int turn, const int worldx, const int worldy,
void map::saven(overmap *om, unsigned const int turn, const int worldx, const int worldy, const int worldz,
const int gridx, const int gridy)
{
dbg(D_INFO) << "map::saven(om[" << (void*)om << "], turn[" << turn <<"], worldx["<<worldx<<"], worldy["<<worldy<<"], gridx["<<gridx<<"], gridy["<<gridy<<"])";
@@ -3010,12 +3107,12 @@ void map::saven(overmap *om, unsigned const int turn, const int worldx, const in
dbg(D_ERROR) << "map::saven grid NULL!";
return;
}
const int abs_x = om->posx * OMAPX * 2 + worldx + gridx,
abs_y = om->posy * OMAPY * 2 + worldy + gridy;
const int abs_x = om->pos().x * OMAPX * 2 + worldx + gridx,
abs_y = om->pos().y * OMAPY * 2 + worldy + gridy;
dbg(D_INFO) << "map::saven abs_x: " << abs_x << " abs_y: " << abs_y;
MAPBUFFER.add_submap(abs_x, abs_y, om->posz, grid[n]);
MAPBUFFER.add_submap(abs_x, abs_y, worldz, grid[n]);
}
// worldx & worldy specify where in the world this is;
@@ -3023,19 +3120,19 @@ void map::saven(overmap *om, unsigned const int turn, const int worldx, const in
// 0,0 1,0 2,0
// 0,1 1,1 2,1
// 0,2 1,2 2,2 etc
bool map::loadn(game *g, const int worldx, const int worldy, const int gridx, const int gridy,
bool map::loadn(game *g, const int worldx, const int worldy, const int worldz, const int gridx, const int gridy,
const bool update_vehicles)
{
dbg(D_INFO) << "map::loadn(game[" << g << "], worldx["<<worldx<<"], worldy["<<worldy<<"], gridx["<<gridx<<"], gridy["<<gridy<<"])";
const int absx = g->cur_om.posx * OMAPX * 2 + worldx + gridx,
absy = g->cur_om.posy * OMAPY * 2 + worldy + gridy,
const int absx = g->cur_om.pos().x * OMAPX * 2 + worldx + gridx,
absy = g->cur_om.pos().y * OMAPY * 2 + worldy + gridy,
gridn = gridx + gridy * my_MAPSIZE;
dbg(D_INFO) << "map::loadn absx: " << absx << " absy: " << absy
<< " gridn: " << gridn;
submap *tmpsub = MAPBUFFER.lookup_submap(absx, absy, g->cur_om.posz);
submap *tmpsub = MAPBUFFER.lookup_submap(absx, absy, worldz);
if (tmpsub) {
grid[gridn] = tmpsub;
@@ -3081,7 +3178,7 @@ bool map::loadn(game *g, const int worldx, const int worldy, const int gridx, co
newmapx = worldx + gridx;
if (worldy + gridy < 0)
newmapy = worldy + gridy;
tmp_map.generate(g, this_om, newmapx, newmapy, int(g->turn));
tmp_map.generate(g, this_om, newmapx, newmapy, worldz, int(g->turn));
return false;
}
return true;
+18 -9
View File
@@ -19,6 +19,8 @@
#include "graffiti.h"
#define MAPSIZE 11
#define CAMPSIZE 1
#define CAMPCHECK 3
class player;
class item;
@@ -53,9 +55,9 @@ class map
const bool low_light = false, const bool bright_level = false);
// File I/O
virtual void save(overmap *om, unsigned const int turn, const int x, const int y);
virtual void load(game *g, const int wx, const int wy, const bool update_vehicles = true);
void shift(game *g, const int wx, const int wy, const int x, const int y);
virtual void save(overmap *om, unsigned const int turn, const int x, const int y, const int z);
virtual void load(game *g, const int wx, const int wy, const int wz, const bool update_vehicles = true);
void shift(game *g, const int wx, const int wy, const int wz, const int x, const int y);
void spawn_monsters(game *g);
void clear_spawns();
void clear_traps();
@@ -164,13 +166,20 @@ class map
// Computers
computer* computer_at(const int x, const int y);
// Camps
bool allow_camp(const int x, const int y, const int radius = CAMPCHECK);
basecamp* camp_at(const int x, const int y, const int radius = CAMPSIZE);
void add_camp(const std::string& name, const int x, const int y);
// Graffiti
graffiti graffiti_at(int x, int y);
bool add_graffiti(game *g, int x, int y, std::string contents);
// mapgen.cpp functions
void generate(game *g, overmap *om, const int x, const int y, const int turn);
void generate(game *g, overmap *om, const int x, const int y, const int z, const int turn);
void post_process(game *g, unsigned zones);
void place_spawns(game *g, std::string group, const int chance,
const int x1, const int y1, const int x2, const int y2, const float density);
void place_items(items_location loc, const int chance, const int x1, const int y1,
const int x2, const int y2, bool ongrass, const int turn);
// put_items_from puts exactly num items, based on chances
@@ -189,14 +198,14 @@ class map
bool veh_exists_at [SEEX * MAPSIZE][SEEY * MAPSIZE];
protected:
void saven(overmap *om, unsigned const int turn, const int x, const int y,
void saven(overmap *om, unsigned const int turn, const int x, const int y, const int z,
const int gridx, const int gridy);
bool loadn(game *g, const int x, const int y, const int gridx, const int gridy,
bool loadn(game *g, const int x, const int y, const int z, const int gridx, const int gridy,
const bool update_vehicles = true);
void copy_grid(const int to, const int from);
void draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
oter_id t_south, oter_id t_west, oter_id t_above, const int turn,
game *g);
void draw_map(const oter_id terrain_type, const oter_id t_north, const oter_id t_east,
const oter_id t_south, const oter_id t_west, const oter_id t_above, const int turn,
game *g, const float density);
void add_extra(map_extra type, game *g);
void rotate(const int turns);// Rotates the current map 90*turns degress clockwise
// Useful for houses, shops, etc
+7
View File
@@ -167,6 +167,10 @@ void mapbuffer::save()
if (sm->comp.name != "")
fout << "c " << sm->comp.save_data() << std::endl;
// Output base camp if any
if (sm->camp.is_valid())
fout << "B " << sm->camp.save_data() << std::endl;
// Output the graffiti
for (int j = 0; j < SEEY; j++) {
for (int i = 0; i < SEEX; i++) {
@@ -281,6 +285,9 @@ void mapbuffer::load()
} else if (string_identifier == "c") {
getline(fin, databuff);
sm->comp.load_data(databuff);
} else if (string_identifier == "B") {
getline(fin, databuff);
sm->camp.load_data(databuff);
} else if (string_identifier == "G") {
std::string s;
int j;
+35 -21
View File
@@ -11,6 +11,7 @@
#include "computer.h"
#include "vehicle.h"
#include "graffiti.h"
#include "basecamp.h"
#include <iosfwd>
class game;
@@ -58,6 +59,7 @@ enum t_flag {
collapses, // Tiles that have a roof over them (which can collapse)
flammable2, // Burn to ash rather than rubble.
deconstruct, // Can be deconstructed
reduce_scent, // Reduces the scent even more, only works if object is bashable as well
num_t_flags // MUST be last
};
@@ -88,10 +90,11 @@ t_slime,
t_bridge,
// Tent Walls & doors
t_canvas_wall, t_canvas_door, t_canvas_door_o, t_groundsheet, t_fema_groundsheet,
t_skin_wall, t_skin_door, t_skin_door_o, t_skin_groundsheet,
// Lighting related
t_skylight, t_emergency_light_flicker, t_emergency_light,
// Walls
t_wall_log_half, t_wall_log, t_wall_log_chipped, t_wall_log_broken, t_palisade, t_palisade_gate, t_palisade_gate_o,
// Walls
t_wall_log_half, t_wall_log, t_wall_log_chipped, t_wall_log_broken, t_palisade, t_palisade_gate,
t_wall_half, t_wall_wood, t_wall_wood_chipped, t_wall_wood_broken,
t_wall_v, t_wall_h, t_concrete_v, t_concrete_h,
t_wall_metal_v, t_wall_metal_h,
@@ -127,11 +130,11 @@ t_bed, t_toilet, t_makeshift_bed,
t_sink, t_oven, t_woodstove, t_bathtub, t_chair, t_armchair, t_sofa, t_cupboard, t_trashcan, t_desk,
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, t_gas_pump_smashed, t_gas_pump_empty,
t_missile, t_missile_exploded,
t_counter,
t_radio_tower, t_radio_controls,
t_console_broken, t_console, t_gates_mech_control, t_barndoor,
t_console_broken, t_console, t_gates_mech_control, t_barndoor, t_palisade_pulley,
t_sewage_pipe, t_sewage_pump,
t_centrifuge,
t_column,
@@ -160,7 +163,7 @@ num_terrain_types
const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
{"nothing", ' ', c_white, 2, tr_null,
mfb(transparent)|mfb(diggable)},
{"empty space", '#', c_black, 2, tr_ledge,
{"empty space", ' ', c_black, 2, tr_ledge,
mfb(transparent)},
{"dirt", '.', c_brown, 2, tr_null,
mfb(transparent)|mfb(diggable)|mfb(tentable)},
@@ -219,9 +222,17 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
{"open canvas flap", '.', c_blue, 2, tr_null,
mfb(transparent)},
{"groundsheet", ';', c_green, 2, tr_null,
mfb(transparent)|mfb(tentable)},
mfb(transparent)|mfb(tentable)},
{"groundsheet", ';', c_green, 2, tr_null,
mfb(transparent)},
{"animalskin wall", '#', c_brown, 0, tr_null,
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable)},
{"animalskin flap", '+', c_white, 0, tr_null,
mfb(l_flammable)|mfb(bashable)|mfb(noitem)|mfb(tentable)},
{"open animalskin flap", '.', c_white, 2, tr_null,
mfb(transparent)},
{"animalskin floor", ';', c_brown, 2, tr_null,
mfb(transparent)|mfb(tentable)},
{"floor", '.', c_white, 2, tr_null,
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses)}, // Skylight
{"floor", '.', c_white, 2, tr_null,
@@ -229,20 +240,18 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
{"floor", '.', c_white, 2, tr_null,
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses)}, // Regular Light
{"half-built wall", '#', c_brown, 4, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)},
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)},
{"log wall", '#', c_brown, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
{"chipped log wall",'#', c_brown, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
{"broken log wall", '&', c_brown, 0, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)|
mfb(supports_roof)},
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)|
mfb(supports_roof)},
{"palisade wall", '#', c_brown, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent)},
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent)},
{"palisade gate", '+', c_ltred, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(door)|mfb(transparent)},
{"open palisade gate", '#', c_ltred, 2, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent)},
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(door)|mfb(transparent)},
{"half-built wall", '#', c_ltred, 4, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)},
{"wooden wall", '#', c_ltred, 0, tr_null,
@@ -323,23 +332,23 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
mfb(transparent)},
{"window", '"', c_ltcyan, 0, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
mfb(supports_roof)|mfb(deconstruct)}, // Plain Ol' window
mfb(supports_roof)|mfb(deconstruct)}, // Plain Ol' window
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)}, // Regular window
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)| mfb(reduce_scent)}, // Regular window
{"window", '"', c_ltcyan, 0, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
mfb(supports_roof)|mfb(deconstruct)}, //has curtains
mfb(supports_roof)|mfb(deconstruct)}, //has curtains
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)}, // Curtain window
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)| mfb(reduce_scent)}, // Curtain window
{"open window", '\'', c_ltcyan, 4, tr_null,
mfb(transparent)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)},
{"closed curtains", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)},
{"window", '"', c_ltcyan, 0, tr_null, // Actually alarmed
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(alarmed)|mfb(noitem)|
mfb(supports_roof)},
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)|mfb(alarmed)}, //Alarmed, duh.
mfb(supports_roof)},
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)|mfb(alarmed)| mfb(reduce_scent)}, //Alarmed, duh.
{"empty window", '0', c_yellow, 8, tr_null,
mfb(transparent)|mfb(flammable)|mfb(supports_roof)},
{"window frame", '0', c_ltcyan, 8, tr_null,
@@ -464,6 +473,8 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
mfb(transparent)|mfb(explodes)|mfb(noitem)},
{"smashed gas pump", '&', c_ltred, 0, tr_null,
mfb(transparent)|mfb(noitem)},
{"out-of-order gasoline pump", '&', c_red, 0, tr_null,
mfb(transparent)|mfb(noitem)},
{"missile", '#', c_ltblue, 0, tr_null,
mfb(explodes)|mfb(noitem)},
{"blown-out missile",'#', c_ltgray, 0, tr_null,
@@ -480,7 +491,9 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
mfb(transparent)|mfb(console)|mfb(noitem)|mfb(collapses)},
{"mechanical winch", '6', c_cyan_red, 0, tr_null,
mfb(transparent)|mfb(noitem)|mfb(collapses)},
{"rope and pulley", '|', i_brown, 0, tr_null,
{"rope and pulley", '|', c_brown, 0, tr_null,
mfb(transparent)|mfb(noitem)|mfb(collapses)},
{"rope and pulley", '|', c_brown, 0, tr_null,
mfb(transparent)|mfb(noitem)|mfb(collapses)},
{"sewage pipe", '1', c_ltgray, 0, tr_null,
mfb(transparent)},
@@ -796,6 +809,7 @@ struct submap {
std::vector<spawn_point> spawns;
std::vector<vehicle*> vehicles;
computer comp;
basecamp camp; // only allowing one basecamp per submap
};
std::ostream & operator<<(std::ostream &, const submap *);
+134 -51
View File
@@ -6,6 +6,7 @@
#include "rng.h"
#include "line.h"
#include "debug.h"
#include "options.h"
#ifndef sgn
#define sgn(x) (((x) < 0) ? -1 : 1)
@@ -82,7 +83,7 @@ void square(map *m, ter_id type, int x1, int y1, int x2, int y2);
void rough_circle(map *m, ter_id type, int x, int y, int rad);
void add_corpse(game *g, map *m, int x, int y);
void map::generate(game *g, overmap *om, int x, int y, int turn)
void map::generate(game *g, overmap *om, const int x, const int y, const int z, const int turn)
{
dbg(D_INFO) << "map::generate( g["<<g<<"], om["<<(void*)om<<"], x["<<x<<"], "
<< "y["<<y<<"], turn["<<turn<<"] )";
@@ -97,6 +98,7 @@ void map::generate(game *g, overmap *om, int x, int y, int turn)
grid[i]->field_count = 0;
grid[i]->turn_last_touched = turn;
grid[i]->comp = computer();
grid[i]->camp = basecamp();
for (int x = 0; x < SEEX; x++) {
for (int y = 0; y < SEEY; y++) {
grid[i]->ter[x][y] = t_null;
@@ -132,66 +134,68 @@ void map::generate(game *g, overmap *om, int x, int y, int turn)
overy = (OMAPY * 2 + y) / 2;
sy = -1;
}
overmap tmp(g, om->posx + sx, om->posy + sy, om->posz);
terrain_type = tmp.ter(overx, overy);
overmap tmp(g, om->pos().x + sx, om->pos().y + sy);
terrain_type = tmp.ter(overx, overy, z);
//zones = tmp.zones(overx, overy);
if (om->posz < 0 || om->posz == 9) { // 9 is for tutorial overmap
overmap tmp2 = overmap(g, om->posx, om->posy, om->posz + 1);
t_above = tmp2.ter(overx, overy);
} else
t_above = ot_null;
t_above = tmp.ter(overx, overy, z + 1);
if (overy - 1 >= 0)
t_north = tmp.ter(overx, overy - 1);
t_north = tmp.ter(overx, overy - 1, z);
else
t_north = om->ter(overx, OMAPY - 1);
t_north = om->ter(overx, OMAPY - 1, z);
if (overx + 1 < OMAPX)
t_east = tmp.ter(overx + 1, overy - 1);
t_east = tmp.ter(overx + 1, overy - 1, z);
else
t_east = om->ter(0, overy);
t_east = om->ter(0, overy, z);
if (overy + 1 < OMAPY)
t_south = tmp.ter(overx, overy + 1);
t_south = tmp.ter(overx, overy + 1, z);
else
t_south = om->ter(overx, 0);
t_south = om->ter(overx, 0, z);
if (overx - 1 >= 0)
t_west = tmp.ter(overx - 1, overy);
t_west = tmp.ter(overx - 1, overy, z);
else
t_west = om->ter(OMAPX - 1, overy);
t_west = om->ter(OMAPX - 1, overy, z);
} else {
dbg(D_INFO) << "map::generate: In section 2";
if (om->posz < 0 || om->posz == 9) { // 9 is for tutorials
overmap tmp = overmap(g, om->posx, om->posy, om->posz + 1);
t_above = tmp.ter(overx, overy);
} else
t_above = ot_null;
terrain_type = om->ter(overx, overy);
t_above = om->ter(overx, overy, z + 1);
terrain_type = om->ter(overx, overy, z);
if (overy - 1 >= 0)
t_north = om->ter(overx, overy - 1);
t_north = om->ter(overx, overy - 1, z);
else {
overmap tmp(g, om->posx, om->posy - 1, 0);
t_north = tmp.ter(overx, OMAPY - 1);
overmap tmp(g, om->pos().x, om->pos().y - 1);
t_north = tmp.ter(overx, OMAPY - 1, z);
}
if (overx + 1 < OMAPX)
t_east = om->ter(overx + 1, overy);
t_east = om->ter(overx + 1, overy, z);
else {
overmap tmp(g, om->posx + 1, om->posy, 0);
t_east = tmp.ter(0, overy);
overmap tmp(g, om->pos().x + 1, om->pos().y);
t_east = tmp.ter(0, overy, z);
}
if (overy + 1 < OMAPY)
t_south = om->ter(overx, overy + 1);
t_south = om->ter(overx, overy + 1, z);
else {
overmap tmp(g, om->posx, om->posy + 1, 0);
t_south = tmp.ter(overx, 0);
overmap tmp(g, om->pos().x, om->pos().y + 1);
t_south = tmp.ter(overx, 0, z);
}
if (overx - 1 >= 0)
t_west = om->ter(overx - 1, overy);
t_west = om->ter(overx - 1, overy, z);
else {
overmap tmp(g, om->posx - 1, om->posy, 0);
t_west = tmp.ter(OMAPX - 1, overy);
overmap tmp(g, om->pos().x - 1, om->pos().y);
t_west = tmp.ter(OMAPX - 1, overy, z);
}
}
draw_map(terrain_type, t_north, t_east, t_south, t_west, t_above, turn, g);
// This attempts to scale density of zombies inversely with distance from the nearest city.
// In other words, make city centers dense and perimiters sparse.
city *closest_city = &om->cities[om->closest_city(point(overx, overy))];
float density = 0.0;
if (closest_city) {
float size = (float)closest_city->s;
float dist = (float)rl_dist(overx, overy, closest_city->x, closest_city->y);
density = log(1 + (size - dist) / size);
}
draw_map(terrain_type, t_north, t_east, t_south, t_west, t_above, turn, g, density);
if ( one_in( oterlist[terrain_type].embellishments.chance ))
add_extra( random_map_extra( oterlist[terrain_type].embellishments ), g);
@@ -207,16 +211,16 @@ void map::generate(game *g, overmap *om, int x, int y, int turn)
dbg(D_INFO) << grid[i+j];
if (i <= 1 && j <= 1)
saven(om, turn, x, y, i, j);
saven(om, turn, x, y, z, i, j);
else
delete grid[i + j * my_MAPSIZE];
}
}
}
void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
oter_id t_south, oter_id t_west, oter_id t_above, int turn,
game *g)
void map::draw_map(const oter_id terrain_type, const oter_id t_north, const oter_id t_east,
const oter_id t_south, const oter_id t_west, const oter_id t_above,
const int turn, game *g, const float density)
{
// Big old switch statement with a case for each overmap terrain type.
// Many of these can be copied from another type, then rotated; for instance,
@@ -283,7 +287,6 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
if (one_in(30))
{
ter(i, j) = t_shrub_blueberry;
add_item(i, j, (*itypes)[itm_blueberries], turn);
}
else
ter(i, j) = t_shrub;
@@ -729,6 +732,8 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
}
if (terrain_type == ot_road_ew)
rotate(1);
if(rn == 1)
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
place_items(mi_road, 5, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, false, turn);
break;
@@ -765,6 +770,8 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_road_wn)
rotate(3);
if(rn == 1)
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
place_items(mi_road, 5, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, false, turn);
break;
@@ -801,6 +808,8 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_road_new)
rotate(3);
if(rn == 1)
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
place_items(mi_road, 5, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, false, turn);
break;
@@ -861,6 +870,8 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
place_items(mi_trash, 5, 0, 0, SEEX * 2 -1, SEEX * 2 - 1, true, 0);
} else
place_items(mi_road, 5, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, false, turn);
if(rn == 1)
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
if (terrain_type == ot_road_nesw_manhole)
ter(rng(6, SEEX * 2 - 6), rng(6, SEEX * 2 - 6)) = t_manhole_cover;
break;
@@ -1268,6 +1279,8 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
}
}
place_items(mi_rare, 60, 0, 0, SEEX * 2 - 1, SEEY * 2 - 1, false, turn);
} else { // Just boring old zombies
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
}
if (terrain_type == ot_house_east || terrain_type == ot_house_base_east)
@@ -1477,6 +1490,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_gas_west)
rotate(3);
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_pharm_north:
@@ -1549,6 +1563,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_pharm_west)
rotate(3);
place_spawns(g, "GROUP_PHARM", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_grocery_north:
@@ -1615,6 +1630,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_grocery_west)
rotate(3);
place_spawns(g, "GROUP_GROCERY", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_hardware_north:
@@ -1738,6 +1754,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_hardware_west)
rotate(3);
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_electronics_north:
@@ -1783,6 +1800,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_electronics_west)
rotate(3);
place_spawns(g, "GROUP_ELECTRO", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_sports_north:
@@ -1852,6 +1870,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_sports_west)
rotate(3);
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_liquor_north:
@@ -1912,6 +1931,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_liquor_west)
rotate(3);
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_gun_north:
@@ -1965,6 +1985,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_gun_west)
rotate(3);
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_clothes_north:
@@ -2049,6 +2070,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_clothes_west)
rotate(3);
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_library_north:
@@ -2108,6 +2130,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_library_west)
rotate(3);
place_spawns(g, "GROUP_ZOMBIE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_restaurant_north:
@@ -2233,7 +2256,9 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_restaurant_west)
rotate(3);
} break;
}
place_spawns(g, "GROUP_GROCERY", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
//....
case ot_shelter: {
@@ -2267,7 +2292,8 @@ case ot_shelter: {
ter(SEEX+2, 4) = t_window_domestic;
line(this, t_counter, SEEX+3, 5, SEEX+3, SEEY-4);
ter(SEEX+6, 5) = t_console;
this->add_computer(SEEX+6, 5, "Evac shelter computer", 0);
tmpcomp = add_computer(SEEX+6, 5, "Evac shelter computer", 0);
tmpcomp->add_option("Emergency Message", COMPACT_EMERG_MESS, 0);
line(this, t_counter, SEEX+3, SEEY+3, SEEX+3, SEEY*2-6);
ter(SEEX+6, SEEY*2-6) = t_console_broken;
line(this, t_bench, 6,6, 6,SEEY-3);
@@ -4191,7 +4217,7 @@ case ot_lmoe: {
} else { // We're above ground!
// First, draw a forest
draw_map(ot_forest, t_north, t_east, t_south, t_west, t_above, turn, g);
draw_map(ot_forest, t_north, t_east, t_south, t_west, t_above, turn, g, density);
// Clear the center with some rocks
square(this, t_rock, SEEX - 6, SEEY - 6, SEEX + 5, SEEY + 5);
int pathx, pathy;
@@ -4763,7 +4789,9 @@ break;
rotate(2);
if (terrain_type == ot_police_east)
rotate(3);
} break;
place_spawns(g, "GROUP_POLICE", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
} break;
case ot_bank_north:
case ot_bank_east:
@@ -5560,6 +5588,10 @@ break;
line(this, t_counter, 15, 14, 17, 14);
place_items(mi_surgery, 60, 15, 14, 17, 14, false, 0);
square(this, t_bed, 18, 18, 19, 19);
// computer to begin healing broken bones,
tmpcomp = add_computer(16, 16, "Mr. Stem Cell", 3);
tmpcomp->add_option("Stem Cell Treatment", COMPACT_STEMCELL_TREATMENT, 3);
tmpcomp->add_failure(COMPFAIL_ALARM);
break;
@@ -5916,7 +5948,7 @@ break;
}
if(t_west == ot_fema && t_east == ot_fema && t_south != ot_fema){ //lab bottom side
square(this, t_dirt, 1, 1, 22, 22);
square(this, t_pavement, 4, 4, 19, 19);
square(this, t_floor, 4, 4, 19, 19);
line(this, t_concrete_h, 4, 4, 19, 4);
line(this, t_concrete_h, 4, 19, 19, 19);
line(this, t_concrete_v, 4, 5, 4, 18);
@@ -7264,6 +7296,38 @@ void map::post_process(game *g, unsigned zones)
}
void map::place_spawns(game *g, std::string group, const int chance,
const int x1, const int y1, const int x2, const int y2, const float density)
{
if (!OPTIONS[OPT_STATIC_SPAWN])
return;
if (one_in(chance))
{
int num = density * (float)rng(10, 50);
for (int i = 0; i < num; i++)
{
int tries = 10;
int x = 0;
int y = 0;
// Pick a spot for the spawn
do {
x = rng(x1, x2);
y = rng(y1, y2);
tries--;
} while( move_cost(x, y) == 0 && tries );
// Pick a monster type
mon_id monster = MonsterGroupManager::GetMonsterFromGroup(group, &g->mtypes);
add_spawn(monster, 1, x, y);
}
}
}
void map::place_items(items_location loc, int chance, int x1, int y1,
int x2, int y2, bool ongrass, int turn)
{
@@ -7423,7 +7487,7 @@ void map::rotate(int turns)
ter_id rotated [SEEX*2][SEEY*2];
trap_id traprot [SEEX*2][SEEY*2];
std::vector<item> itrot[SEEX*2][SEEY*2];
std::vector<spawn_point> sprot[my_MAPSIZE * my_MAPSIZE];
std::vector<spawn_point> sprot[MAPSIZE * MAPSIZE];
computer tmpcomp;
std::vector<vehicle*> tmpveh;
@@ -8811,6 +8875,7 @@ void map::add_extra(map_extra type, game *g)
case 3: extra_items = mi_allguns; break;
case 4: extra_items = mi_bionics; break;
}
place_spawns(g, "GROUP_MAYBE_MIL", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, 0.1);//0.1 = 1-5
place_items(extra_items, 70, cx - 4, cy - 4, cx + 4, cy + 4, true, 0);
}
break;
@@ -8833,6 +8898,7 @@ void map::add_extra(map_extra type, game *g)
add_item(x, y, (*itypes)[itm_id_military], 0);
}
}
place_spawns(g, "GROUP_MAYBE_MIL", 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, 0.1);//0.1 = 1-5
place_items(mi_rare, 25, 0, 0, SEEX * 2 - 1, SEEY * 2 - 1, true, 0);
}
break;
@@ -8895,7 +8961,7 @@ void map::add_extra(map_extra type, game *g)
}
if (placed == tr_beartrap && has_flag(diggable, i, j)) {
if (one_in(8))
placed = tr_landmine;
placed = tr_landmine_buried;
else
placed = tr_beartrap_buried;
}
@@ -8938,21 +9004,30 @@ void map::add_extra(map_extra type, game *g)
int num_bodies_b = dice(3, 3);
bool north_south = one_in(2);
bool a_has_drugs = one_in(2);
for (int i = 0; i < num_bodies_a; i++) {
int x, y, tries = 0;
int x, y, x_offset, y_offset, tries = 0;
do { // Loop until we find a valid spot to dump a body, or we give up
if (north_south) {
x = rng(0, SEEX * 2 - 1);
y = rng(0, SEEY - 4);
x_offset = 0;
y_offset = -1;
} else {
x = rng(0, SEEX - 4);
y = rng(0, SEEY * 2 - 1);
x_offset = -1;
y_offset = 0;
}
tries++;
} while (tries < 10 && move_cost(x, y) == 0);
if (tries < 10) { // We found a valid spot!
add_item(x, y, body);
int splatter_range = rng(1, 3);
for (int j = 0; j <= splatter_range; j++) {
add_field(g, x + (j * x_offset), y + (j * y_offset), fd_blood, 1);
}
place_items(mi_drugdealer, 75, x, y, x, y, true, 0);
if (a_has_drugs && num_drugs > 0) {
int drugs_placed = rng(2, 6);
@@ -8965,20 +9040,28 @@ void map::add_extra(map_extra type, game *g)
}
}
for (int i = 0; i < num_bodies_b; i++) {
int x, y, tries = 0;
int x, y, x_offset, y_offset, tries = 0;
do { // Loop until we find a valid spot to dump a body, or we give up
if (north_south) {
x = rng(0, SEEX * 2 - 1);
y = rng(SEEY + 3, SEEY * 2 - 1);
x_offset = 0;
y_offset = 1;
} else {
x = rng(SEEX + 3, SEEX * 2 - 1);
y = rng(0, SEEY * 2 - 1);
x_offset = 1;
y_offset = 0;
}
tries++;
} while (tries < 10 && move_cost(x, y) == 0);
if (tries < 10) { // We found a valid spot!
add_item(x, y, body);
int splatter_range = rng(1, 3);
for (int j = 0; j <= splatter_range; j++) {
add_field(g, x + (j * x_offset), y + (j * y_offset), fd_blood, 1);
}
place_items(mi_drugdealer, 75, x, y, x, y, true, 0);
if (!a_has_drugs && num_drugs > 0) {
int drugs_placed = rng(2, 6);
@@ -9055,9 +9138,9 @@ void map::add_extra(map_extra type, game *g)
}
for (int i = 0; i < num_mines; i++) {
int x = rng(0, SEEX * 2 - 1), y = rng(0, SEEY * 2 - 1);
if (!has_flag(diggable, x, y) || one_in(4))
if (!has_flag(diggable, x, y) || one_in(8))
ter(x, y) = t_dirtmound;
add_trap(x, y, tr_landmine);
add_trap(x, y, tr_landmine_buried);
}
}
break;
+5 -3
View File
@@ -1,10 +1,10 @@
#ifndef _MAPITEMS_H_
#define _MAPITEMS_H_
enum items_location {
mi_none,
mi_none, mi_child_items,
mi_field, mi_forest, mi_hive, mi_hive_center,
mi_road,
mi_livingroom, mi_kitchen, mi_fridge, mi_home_hw, mi_bedroom, mi_homeguns,
mi_livingroom, mi_kitchen, mi_knifeblock, mi_fridge, mi_home_hw, mi_bedroom, mi_homeguns,
mi_dresser, mi_dining,
mi_snacks, mi_fridgesnacks, mi_behindcounter, mi_magazines,
mi_softdrugs, mi_harddrugs,
@@ -40,7 +40,9 @@ enum items_location {
mi_spider,
mi_ant_food, mi_ant_egg,
// Monster drops
mi_biollante, mi_bugs, mi_bees, mi_wasps, mi_robots,
mi_biollante, mi_bugs, mi_bees, mi_wasps, mi_robots, mi_eyebot,
mi_manhack, mi_skitterbot, mi_secubot, mi_copbot, mi_molebot,
mi_tripod, mi_chickenbot, mi_tankbot, mi_turret,
// Map Extras
mi_helicopter, mi_military, mi_science, mi_rare, mi_stash_food, mi_stash_ammo,
mi_stash_wood, mi_stash_drugs, mi_drugdealer, mi_wreckage,
+67 -18
View File
@@ -6,6 +6,8 @@
void game::init_mapitems()
{
setvector(mapitems[mi_child_items],
itm_chocolate, itm_candy, itm_crack, itm_bat, itm_backpack, itm_pockknife, NULL);
setvector(
mapitems[mi_field],
@@ -53,12 +55,17 @@ void game::init_mapitems()
itm_tea_raw, itm_coffee_raw,
NULL);
setvector(
mapitems[mi_knifeblock],
itm_knife_steak, itm_knife_butcher, itm_knife_combat, itm_pockknife,
NULL);
setvector(
mapitems[mi_fridge],
itm_water_clean, itm_oj, itm_cola, itm_rootbeer, itm_milk, itm_V8, itm_apple,
itm_sandwich_t, itm_mushroom, itm_blueberries, itm_strawberries,
itm_tomato, itm_broccoli, itm_zucchini, itm_frozen_dinner, itm_vodka,
itm_apple_cider, NULL);
itm_apple_cider, itm_jihelucake, NULL);
setvector(
mapitems[mi_home_hw],
@@ -78,7 +85,7 @@ void game::init_mapitems()
itm_mag_news, itm_novel_romance, itm_novel_drama, itm_manual_mechanics,
itm_manual_speech, itm_manual_business, itm_manual_computers,
itm_lighter, itm_sewing_kit, itm_thread, itm_scissors, itm_soldering_iron,
itm_radio, itm_syringe, itm_mp3, itm_usb_drive,
itm_radio, itm_syringe, itm_mp3, itm_usb_drive, itm_firecracker_pack, itm_firecracker,
itm_sneakers_fit, itm_boots_fit, itm_boots_steel_fit, itm_boots_winter_fit,
itm_dress_shoes_fit, itm_heels_fit, itm_chips, itm_cola, itm_picklocks, NULL);
@@ -104,7 +111,7 @@ void game::init_mapitems()
itm_jacket_jean, itm_blazer, itm_jacket_leather, itm_poncho,
itm_trenchcoat, itm_peacoat, itm_vest, itm_mag_porn, itm_lighter,
itm_sewing_kit, itm_thread, itm_flashlight, itm_suit, itm_tophat,
itm_glasses_monocle, itm_duct_tape,
itm_glasses_monocle, itm_duct_tape, itm_firecracker_pack, itm_firecracker,
itm_jeans_fit, itm_pants_fit, itm_pants_cargo_fit,
itm_polo_shirt_fit, itm_sweatshirt_fit, itm_sweater_fit,
itm_jacket_light_fit, itm_tshirt_fit, itm_trenchcoat_fit,
@@ -131,12 +138,13 @@ void game::init_mapitems()
mapitems[mi_behindcounter],
itm_aspirin, itm_caffeine, itm_cig, itm_cigar, itm_battery,
itm_shotgun_sawn, itm_mag_porn, itm_lighter, itm_flashlight,
itm_extinguisher, itm_tazer, itm_mp3, NULL);
itm_extinguisher, itm_tazer, itm_mp3, itm_roadmap, NULL);
setvector(
mapitems[mi_magazines],
itm_mag_tv, itm_mag_news, itm_mag_cars, itm_mag_cooking,
itm_novel_romance, itm_novel_spy, itm_mag_carpentry, NULL);
itm_novel_romance, itm_novel_spy, itm_mag_carpentry,
itm_mag_guns, itm_mag_archery, NULL);
setvector(
mapitems[mi_softdrugs],
@@ -153,7 +161,7 @@ void game::init_mapitems()
mapitems[mi_cannedfood],
itm_can_beans, itm_can_corn, itm_can_spam, itm_can_pineapple,
itm_can_coconut, itm_can_sardine, itm_can_tuna, itm_can_catfood,
itm_broth, itm_soup, itm_flour, itm_sugar, itm_salt, NULL);
itm_broth, itm_soup_veggy, itm_soup_meat, itm_flour, itm_sugar, itm_salt, NULL);
setvector(
mapitems[mi_pasta],
@@ -217,7 +225,7 @@ void game::init_mapitems()
setvector(
mapitems[mi_camping],
itm_rope_30, itm_hatchet, itm_pot, itm_pan, itm_binoculars,
itm_rope_30, itm_hatchet, itm_pot, itm_pan, itm_binoculars, itm_firecracker_pack,
itm_hotplate, itm_knife_combat, itm_machete, itm_vest, itm_backpack,
itm_bb, itm_bolt_steel, itm_bbgun, itm_crossbow, itm_manual_knives,itm_manual_survival,
itm_manual_first_aid, itm_manual_traps, itm_lighter, itm_sewing_kit, itm_thread,
@@ -239,7 +247,7 @@ void game::init_mapitems()
itm_sewing_kit, itm_thread, itm_hammer, itm_flashlight, itm_water_purifier,
itm_radio, itm_beartrap, itm_extinguisher, itm_string_36, itm_longbow,
itm_compbow, itm_arrow_wood, itm_arrow_cf, itm_rollmat, itm_tent_kit,
itm_tshirt_fit, itm_foot_crank, NULL);
itm_tshirt_fit, itm_foot_crank, itm_mag_archery, NULL);
setvector(
mapitems[mi_alcohol],
@@ -255,7 +263,7 @@ void game::init_mapitems()
itm_glass_sheet, itm_stick, itm_muffler, itm_pipe, itm_bag_plastic,
itm_bottle_plastic, itm_bottle_glass, itm_can_drink, itm_can_food,
itm_box_small, itm_bubblewrap, itm_lighter, itm_syringe, itm_rag,
itm_software_hacking, itm_carboy_plastic, itm_spray_can, NULL);
itm_software_hacking, itm_jug_plastic, itm_spray_can, NULL);
setvector(
mapitems[mi_ammo],
@@ -307,7 +315,7 @@ void game::init_mapitems()
setvector(
mapitems[mi_gunxtras],
itm_glasses_safety, itm_goggles_nv, itm_holster, itm_bootstrap,
itm_mag_guns, itm_flashlight, itm_UPS_off, itm_silencer, itm_grip,
itm_mag_guns, itm_mag_archery, itm_flashlight, itm_UPS_off, itm_silencer, itm_grip,
itm_barrel_big, itm_barrel_small, itm_barrel_rifled, itm_clip, itm_spare_mag,
itm_clip2, itm_stablizer, itm_blowback, itm_autofire, itm_retool_45,
itm_retool_9mm, itm_retool_22, itm_retool_57, itm_retool_46,
@@ -456,10 +464,10 @@ void game::init_mapitems()
itm_chainsaw_off, itm_jackhammer, itm_jacqueshammer, itm_ring, itm_necklace, itm_usb_drive,
itm_broadsword, itm_morningstar, itm_helmet_plate, itm_cot, itm_rollmat, itm_tent_kit,
itm_boots_fit, itm_boots_steel_fit, itm_boots_winter_fit,
itm_dress_shoes_fit, itm_bat_metal, itm_jeans_fit, itm_pants_army_fit,
itm_polo_shirt_fit, itm_sweatshirt_fit, itm_sweater_fit,
itm_jacket_light_fit, itm_tshirt_fit, itm_trenchcoat_fit, itm_lawnmower,
itm_lawnmower_machete, itm_picklocks, itm_rucksack, itm_puller, itm_press, NULL);
itm_dress_shoes_fit, itm_bat_metal, itm_jeans_fit, itm_pants_army_fit,
itm_polo_shirt_fit, itm_sweatshirt_fit, itm_sweater_fit,
itm_jacket_light_fit, itm_tshirt_fit, itm_trenchcoat_fit, itm_lawnmower,
itm_makeshift_machete, itm_picklocks, itm_rucksack, itm_puller, itm_press, NULL);
setvector(
mapitems[mi_mil_surplus], // NOT food or armor!
@@ -471,7 +479,7 @@ void game::init_mapitems()
setvector(
mapitems[mi_shelter],
itm_water_clean, itm_soup, itm_chocolate, itm_ravioli, itm_can_beans,
itm_water_clean, itm_soup_veggy, itm_soup_meat, itm_chocolate, itm_ravioli, itm_can_beans,
itm_can_spam, itm_can_tuna, itm_coffee_raw, itm_bandages, itm_1st_aid,
itm_vitamins, itm_iodine, itm_dayquil, itm_screwdriver, itm_boots,
itm_boots_winter, itm_socks_wool, itm_jeans, itm_shorts, itm_tshirt, itm_sweatshirt, itm_sweater,
@@ -763,6 +771,47 @@ void game::init_mapitems()
itm_transponder, itm_receiver, itm_antenna, itm_steel_chunk, itm_spring,
itm_steel_lump, itm_motor, itm_battery, itm_plut_cell, NULL);
setvector(
mapitems[mi_eyebot],
itm_flashlight, NULL);
setvector(
mapitems[mi_manhack],
itm_knife_combat, NULL);
setvector(
mapitems[mi_skitterbot],
itm_tazer, NULL);
setvector(
mapitems[mi_secubot],
itm_9mm, itm_steel_plate, NULL);
setvector(
mapitems[mi_copbot],
itm_baton, itm_tazer, itm_alloy_plate, NULL);
setvector(
mapitems[mi_molebot],
itm_spiked_plate, itm_hard_plate, NULL);
setvector(
mapitems[mi_tripod],
itm_flamethrower, itm_alloy_plate, NULL);
setvector(
mapitems[mi_chickenbot],
itm_9mm, itm_alloy_plate, NULL);
setvector(
mapitems[mi_tankbot],
itm_tazer, itm_flamethrower, itm_9mm, itm_alloy_plate,
itm_hard_plate, NULL);
setvector(
mapitems[mi_turret],
itm_9mm, NULL);
setvector(
mapitems[mi_helicopter],
itm_chain, itm_power_supply, itm_antenna, itm_steel_chunk, itm_spring,
@@ -870,7 +919,7 @@ void game::init_mapitems()
itm_stick, itm_bag_plastic, itm_flashlight_on, itm_radio_on,
itm_chainsaw_on, itm_pipebomb_act, itm_grenade_act, itm_flashbang_act,
itm_EMPbomb_act, itm_gasbomb_act, itm_smokebomb_act, itm_molotov_lit,
itm_dynamite_act, itm_mininuke_act, itm_UPS_on, itm_mp3_on, itm_c4armed,
itm_apparatus, itm_brazier, itm_rag_bloody,
NULL);
itm_dynamite_act, itm_firecracker_pack_act, itm_firecracker_act,
itm_mininuke_act, itm_UPS_on, itm_mp3_on, itm_c4armed, itm_apparatus,
itm_brazier, itm_rag_bloody, NULL);
}
+61 -61
View File
@@ -47,7 +47,7 @@ int player::base_to_hit(bool real_life, int stat)
{
if (stat == -999)
stat = (real_life ? dex_cur : dex_max);
return 1 + int(stat / 2) + skillLevel("melee").level();
return 1 + int(stat / 2) + skillLevel("melee");
}
int player::hit_roll()
@@ -74,28 +74,28 @@ int player::hit_roll()
// Are we unarmed?
if (unarmed_attack()) {
best_bonus = skillLevel("unarmed").level();
if (skillLevel("unarmed").level() > 4)
best_bonus += skillLevel("unarmed").level() - 4; // Extra bonus for high levels
best_bonus = skillLevel("unarmed");
if (skillLevel("unarmed") > 4)
best_bonus += skillLevel("unarmed") - 4; // Extra bonus for high levels
}
// Using a bashing weapon?
if (weapon.is_bashing_weapon()) {
int bash_bonus = int(skillLevel("bashing").level() / 3);
int bash_bonus = int(skillLevel("bashing") / 3);
if (bash_bonus > best_bonus)
best_bonus = bash_bonus;
}
// Using a cutting weapon?
if (weapon.is_cutting_weapon()) {
int cut_bonus = int(skillLevel("cutting").level() / 2);
int cut_bonus = int(skillLevel("cutting") / 2);
if (cut_bonus > best_bonus)
best_bonus = cut_bonus;
}
// Using a spear?
if (weapon.has_flag(IF_SPEAR) || weapon.has_flag(IF_STAB)) {
int stab_bonus = int(skillLevel("stabbing").level() / 2);
int stab_bonus = int(skillLevel("stabbing") / 2);
if (stab_bonus > best_bonus)
best_bonus = stab_bonus;
}
@@ -335,8 +335,8 @@ void player::hit_player(game *g, player &p, bool allow_grab)
if (allow_grab && technique == TEC_GRAB) {
// Move our weapon to a temp slot, if it's not unarmed
if (p.weapon.has_technique(TEC_BREAK, &p) &&
dice(p.dex_cur + p.skillLevel("melee").level(), 12) >
dice(dex_cur + skillLevel("melee").level(), 10)) {
dice(p.dex_cur + p.skillLevel("melee"), 12) >
dice(dex_cur + skillLevel("melee"), 10)) {
if (is_u)
g->add_msg("%s break%s the grab!", target.c_str(), (p.is_npc() ? "s" : ""));
} else if (!unarmed_attack()) {
@@ -375,7 +375,7 @@ bool player::scored_crit(int target_dodge)
// Weapon to-hit roll
int chance = 25;
if (unarmed_attack()) { // Unarmed attack: 1/2 of unarmed skill is to-hit
for (int i = 1; i <= int(skillLevel("unarmed").level() * .5); i++)
for (int i = 1; i <= int(skillLevel("unarmed") * .5); i++)
chance += (50 / (2 + i));
}
if (weapon.type->m_to_hit > 0) {
@@ -421,17 +421,17 @@ bool player::scored_crit(int target_dodge)
// Skill level roll
int best_skill = 0;
if (weapon.is_bashing_weapon() && skillLevel("bashing").level() > best_skill)
best_skill = skillLevel("bashing").level();
if (weapon.is_cutting_weapon() && skillLevel("cutting").level() > best_skill)
best_skill = skillLevel("cutting").level();
if (weapon.is_bashing_weapon() && skillLevel("bashing") > best_skill)
best_skill = skillLevel("bashing");
if (weapon.is_cutting_weapon() && skillLevel("cutting") > best_skill)
best_skill = skillLevel("cutting");
if ((weapon.has_flag(IF_SPEAR) || weapon.has_flag(IF_STAB)) &&
skillLevel("stabbing").level() > best_skill)
best_skill = skillLevel("stabbing").level();
if (unarmed_attack() && skillLevel("unarmed").level() > best_skill)
best_skill = skillLevel("unarmed").level();
skillLevel("stabbing") > best_skill)
best_skill = skillLevel("stabbing");
if (unarmed_attack() && skillLevel("unarmed") > best_skill)
best_skill = skillLevel("unarmed");
best_skill += int(skillLevel("melee").level() / 2.5);
best_skill += int(skillLevel("melee") / 2.5);
chance = 25;
if (best_skill > 3) {
@@ -459,7 +459,7 @@ int player::dodge(game *g)
if (activity.type != ACT_NULL)
return 0;
int ret = 4 + (dex_cur / 2);
ret += skillLevel("dodge").level();
ret += skillLevel("dodge");
ret += disease_intensity(DI_DODGE_BOOST);
ret -= (encumb(bp_legs) / 2) + encumb(bp_torso);
ret += int(current_speed(g) / 150);
@@ -476,15 +476,15 @@ int player::dodge(game *g)
else if (str_max <= 5)
ret++; // Bonus if we're small
if (dodges_left <= 0) { // We already dodged this turn
if (rng(1, skillLevel("dodge").level() + dex_cur + 15) <= skillLevel("dodge").level() + dex_cur)
if (rng(1, skillLevel("dodge") + dex_cur + 15) <= skillLevel("dodge") + dex_cur)
ret = rng(0, ret);
else
ret = 0;
}
dodges_left--;
// If we're over our cap, average it with our cap
if (ret > int(dex_cur / 2) + skillLevel("dodge").level() * 2)
ret = ( ret + int(dex_cur / 2) + skillLevel("dodge").level() * 2 ) / 2;
if (ret > int(dex_cur / 2) + skillLevel("dodge") * 2)
ret = ( ret + int(dex_cur / 2) + skillLevel("dodge") * 2 ) / 2;
return ret;
}
@@ -512,9 +512,9 @@ int player::roll_bash_damage(monster *z, bool crit)
{
int ret = 0;
int stat = str_cur; // Which stat determines damage?
int skill = skillLevel("bashing").level(); // Which skill determines damage?
int skill = skillLevel("bashing"); // Which skill determines damage?
if (unarmed_attack())
skill = skillLevel("unarmed").level();
skill = skillLevel("unarmed");
switch (weapon.typeId()) { // Some martial arts change which stat
case itm_style_crane:
@@ -548,7 +548,7 @@ int player::roll_bash_damage(monster *z, bool crit)
bash_cap = 5 + stat + skill;
if (unarmed_attack())
bash_dam = rng(0, int(stat / 2) + skillLevel("unarmed").level());
bash_dam = rng(0, int(stat / 2) + skillLevel("unarmed"));
if (crit) {
bash_dam *= 1.5;
@@ -588,7 +588,7 @@ int player::roll_cut_damage(monster *z, bool crit)
{
if (weapon.has_flag(IF_SPEAR))
return 0; // Stabs, doesn't cut!
int z_armor_cut = (z == NULL ? 0 : z->armor_cut() - skillLevel("cutting").level() / 2);
int z_armor_cut = (z == NULL ? 0 : z->armor_cut() - skillLevel("cutting") / 2);
if (crit)
z_armor_cut /= 2;
@@ -601,7 +601,7 @@ int player::roll_cut_damage(monster *z, bool crit)
if (has_trait(PF_CLAWS))
ret += 6;
if (has_trait(PF_TALONS))
ret += 6 + (skillLevel("unarmed").level() > 8 ? 8 : skillLevel("unarmed").level());
ret += 6 + ((int)skillLevel("unarmed") > 8 ? 8 : (int)skillLevel("unarmed"));
if (has_trait(PF_SLIME_HANDS) && (z == NULL || !z->has_flag(MF_ACIDPROOF)))
ret += rng(4, 6);
}
@@ -610,13 +610,13 @@ int player::roll_cut_damage(monster *z, bool crit)
return 0; // No negative damage!
// 80%, 88%, 96%, 104%, 112%, 116%, 120%, 124%, 128%, 132%
if (skillLevel("cutting").level() <= 5)
ret *= double( 0.8 + 0.08 * skillLevel("cutting").level() );
if (skillLevel("cutting") <= 5)
ret *= double( 0.8 + 0.08 * skillLevel("cutting") );
else
ret *= double( 0.92 + 0.04 * skillLevel("cutting").level() );
ret *= double( 0.92 + 0.04 * skillLevel("cutting") );
if (crit)
ret *= double( 1.0 + double(skillLevel("cutting").level() / 12) );
ret *= double( 1.0 + double(skillLevel("cutting") / 12) );
return ret;
}
@@ -624,7 +624,7 @@ int player::roll_cut_damage(monster *z, bool crit)
int player::roll_stab_damage(monster *z, bool crit)
{
int ret = 0;
int z_armor = (z == NULL ? 0 : z->armor_cut() - 3 * skillLevel("stabbing").level());
int z_armor = (z == NULL ? 0 : z->armor_cut() - 3 * skillLevel("stabbing"));
if (crit)
z_armor /= 3;
@@ -657,7 +657,7 @@ int player::roll_stab_damage(monster *z, bool crit)
return 0; // No negative stabbing!
if (crit) {
int multiplier = double( 1.0 + double(skillLevel("stabbing").level() / 5) );
int multiplier = double( 1.0 + double(skillLevel("stabbing") / 5) );
if (multiplier > 2.5)
multiplier = 2.5;
ret *= multiplier;
@@ -673,10 +673,10 @@ int player::roll_stuck_penalty(monster *z, bool stabbing)
cutarm = (z == NULL ? 6 : z->armor_cut());
if (stabbing)
ret = weapon.damage_cut() * 3 + basharm * 3 + cutarm * 3 -
dice(skillLevel("stabbing").level(), 10);
dice(skillLevel("stabbing"), 10);
else
ret = weapon.damage_cut() * 4 + basharm * 5 + cutarm * 4 -
dice(skillLevel("cutting").level(), 10);
dice(skillLevel("cutting"), 10);
if (ret >= weapon.damage_cut() * 10)
return weapon.damage_cut() * 10;
@@ -714,7 +714,7 @@ technique_id player::pick_technique(game *g, monster *z, player *p,
possible.push_back(TEC_PRECISE);
if (weapon.has_technique(TEC_BRUTAL, this) && !downed &&
str_cur + skillLevel("melee").level() >= 4 + base_str_req)
str_cur + skillLevel("melee") >= 4 + base_str_req)
possible.push_back(TEC_BRUTAL);
}
@@ -723,8 +723,8 @@ technique_id player::pick_technique(game *g, monster *z, player *p,
if (weapon.has_technique(TEC_DISARM, this) && !z &&
p->weapon.typeId() != 0 && !p->weapon.has_flag(IF_UNARMED_WEAPON) &&
dice( dex_cur + skillLevel("unarmed").level(), 8) >
dice(p->dex_cur + p->skillLevel("melee").level(), 10))
dice( dex_cur + skillLevel("unarmed"), 8) >
dice(p->dex_cur + p->skillLevel("melee"), 10))
possible.push_back(TEC_DISARM);
if (weapon.has_technique(TEC_GRAB, this) && allowgrab)
@@ -734,7 +734,7 @@ technique_id player::pick_technique(game *g, monster *z, player *p,
possible.push_back(TEC_RAPID);
if (weapon.has_technique(TEC_THROW, this) && !downed &&
str_cur + skillLevel("melee").level() >= 4 + base_str_req * 4 + rng(-4, 4))
str_cur + skillLevel("melee") >= 4 + base_str_req * 4 + rng(-4, 4))
possible.push_back(TEC_THROW);
if (weapon.has_technique(TEC_WIDE, this)) { // Count monsters
@@ -888,7 +888,7 @@ technique_id player::pick_defensive_technique(game *g, monster *z, player *p)
if (z != NULL)
foe_melee_skill = z->type->melee_skill;
else if (p != NULL)
foe_melee_skill = p->dex_cur + p->skillLevel("melee").level();
foe_melee_skill = p->dex_cur + p->skillLevel("melee");
int foe_dodge = 0;
if (z != NULL)
@@ -909,26 +909,26 @@ technique_id player::pick_defensive_technique(game *g, monster *z, player *p)
blocks_left--;
if (weapon.has_technique(TEC_WBLOCK_3) &&
dice(dex_cur + skillLevel("melee").level(), 12) > dice(foe_melee_skill, 10))
dice(dex_cur + skillLevel("melee"), 12) > dice(foe_melee_skill, 10))
return TEC_WBLOCK_3;
if (weapon.has_technique(TEC_WBLOCK_2) &&
dice(dex_cur + skillLevel("melee").level(), 6) > dice(foe_melee_skill, 10))
dice(dex_cur + skillLevel("melee"), 6) > dice(foe_melee_skill, 10))
return TEC_WBLOCK_2;
if (weapon.has_technique(TEC_WBLOCK_1) &&
dice(dex_cur + skillLevel("melee").level(), 3) > dice(foe_melee_skill, 10))
dice(dex_cur + skillLevel("melee"), 3) > dice(foe_melee_skill, 10))
return TEC_WBLOCK_1;
if (weapon.has_technique(TEC_DEF_DISARM, this) &&
z == NULL && p->weapon.typeId() != 0 &&
!p->weapon.has_flag(IF_UNARMED_WEAPON) &&
dice( dex_cur + skillLevel("unarmed").level(), 8) >
dice(p->dex_cur + p->skillLevel("melee").level(), 10))
dice( dex_cur + skillLevel("unarmed"), 8) >
dice(p->dex_cur + p->skillLevel("melee"), 10))
return TEC_DEF_DISARM;
if (weapon.has_technique(TEC_DEF_THROW, this) &&
str_cur + skillLevel("melee").level() >= foe_size + rng(-4, 4) &&
str_cur + skillLevel("melee") >= foe_size + rng(-4, 4) &&
hit_roll() > rng(1, 5) + foe_dodge && !one_in(3))
return TEC_DEF_THROW;
@@ -938,13 +938,13 @@ technique_id player::pick_defensive_technique(game *g, monster *z, player *p)
if (weapon.has_technique(TEC_BLOCK_LEGS, this) &&
(hp_cur[hp_leg_l] >= 20 || hp_cur[hp_leg_r] >= 20) &&
dice(dex_cur + skillLevel("unarmed").level() + skillLevel("melee").level(), 13) >
dice(dex_cur + skillLevel("unarmed") + skillLevel("melee"), 13) >
dice(8 + foe_melee_skill, 10))
return TEC_BLOCK_LEGS;
if (weapon.has_technique(TEC_BLOCK, this) &&
(hp_cur[hp_arm_l] >= 20 || hp_cur[hp_arm_r] >= 20) &&
dice(dex_cur + skillLevel("unarmed").level() + skillLevel("melee").level(), 16) >
dice(dex_cur + skillLevel("unarmed") + skillLevel("melee"), 16) >
dice(6 + foe_melee_skill, 10))
return TEC_BLOCK;
@@ -988,7 +988,7 @@ void player::perform_defensive_technique(
// Special reductions for certain styles
if (weapon.typeId() == itm_style_tai_chi)
reduction -= double(0.08 * double(per_cur - 6));
if (weapon.typeId() == itm_style_taekwando)
if (weapon.typeId() == itm_style_taekwondo)
reduction -= double(0.08 * double(str_cur - 6));
if (reduction > 1.0)
reduction = 1.0;
@@ -1113,7 +1113,7 @@ void player::melee_special_effects(game *g, monster *z, player *p, bool crit,
// Bashing crit
if (crit && !unarmed_attack()) {
int turns_stunned = int(bash_dam / 20) + rng(0, int(skillLevel("bashing").level() / 2));
int turns_stunned = int(bash_dam / 20) + rng(0, int(skillLevel("bashing") / 2));
if (turns_stunned > 6)
turns_stunned = 6;
if (turns_stunned > 0) {
@@ -1239,7 +1239,7 @@ void player::melee_special_effects(game *g, monster *z, player *p, bool crit,
} else {
if (mon && (cut_dam >= z->hp || stab_dam >= z->hp)) {
cutting_penalty /= 2;
cutting_penalty -= rng(skillLevel("cutting").level(), skillLevel("cutting").level() * 2 + 2);
cutting_penalty -= rng(skillLevel("cutting"), skillLevel("cutting") * 2 + 2);
}
if (cutting_penalty > 0)
moves -= cutting_penalty;
@@ -1351,7 +1351,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
std::stringstream text;
if (has_trait(PF_FANGS) && !wearing_something_on(bp_mouth) &&
one_in(20 - dex_cur - skillLevel("unarmed").level())) {
one_in(20 - dex_cur - skillLevel("unarmed"))) {
special_attack tmp;
text << You << " sink" << (is_u ? " " : "s ") << your << " fangs into " <<
target << "!";
@@ -1360,7 +1360,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
ret.push_back(tmp);
}
if (has_trait(PF_MANDIBLES) && one_in(22 - dex_cur - skillLevel("unarmed").level())) {
if (has_trait(PF_MANDIBLES) && one_in(22 - dex_cur - skillLevel("unarmed"))) {
special_attack tmp;
text << You << " slice" << (is_u ? " " : "s ") << target << " with " <<
your << " mandibles!";
@@ -1369,7 +1369,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
ret.push_back(tmp);
}
if (has_trait(PF_BEAK) && one_in(15 - dex_cur - skillLevel("unarmed").level())) {
if (has_trait(PF_BEAK) && one_in(15 - dex_cur - skillLevel("unarmed"))) {
special_attack tmp;
text << You << " peck" << (is_u ? " " : "s ") << target << "!";
tmp.text = text.str();
@@ -1377,7 +1377,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
ret.push_back(tmp);
}
if (has_trait(PF_HOOVES) && one_in(25 - dex_cur - 2 * skillLevel("unarmed").level())) {
if (has_trait(PF_HOOVES) && one_in(25 - dex_cur - 2 * skillLevel("unarmed"))) {
special_attack tmp;
text << You << " kick" << (is_u ? " " : "s ") << target << " with " <<
your << " hooves!";
@@ -1388,7 +1388,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
ret.push_back(tmp);
}
if (has_trait(PF_HORNS) && one_in(20 - dex_cur - skillLevel("unarmed").level())) {
if (has_trait(PF_HORNS) && one_in(20 - dex_cur - skillLevel("unarmed"))) {
special_attack tmp;
text << You << " headbutt" << (is_u ? " " : "s ") << target << " with " <<
your << " horns!";
@@ -1398,7 +1398,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
ret.push_back(tmp);
}
if (has_trait(PF_HORNS_CURLED) && one_in(20 - dex_cur - skillLevel("unarmed").level())) {
if (has_trait(PF_HORNS_CURLED) && one_in(20 - dex_cur - skillLevel("unarmed"))) {
special_attack tmp;
text << You << " headbutt" << (is_u ? " " : "s ") << target << " with " <<
your << " curled horns!";
@@ -1407,7 +1407,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
ret.push_back(tmp);
}
if (has_trait(PF_HORNS_POINTED) && one_in(22 - dex_cur - skillLevel("unarmed").level())){
if (has_trait(PF_HORNS_POINTED) && one_in(22 - dex_cur - skillLevel("unarmed"))){
special_attack tmp;
text << You << " stab" << (is_u ? " " : "s ") << target << " with " <<
your << " pointed horns!";
@@ -1416,7 +1416,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
ret.push_back(tmp);
}
if (has_trait(PF_ANTLERS) && one_in(20 - dex_cur - skillLevel("unarmed").level())) {
if (has_trait(PF_ANTLERS) && one_in(20 - dex_cur - skillLevel("unarmed"))) {
special_attack tmp;
text << You << " butt" << (is_u ? " " : "s ") << target << " with " <<
your << " antlers!";
@@ -1454,7 +1454,7 @@ std::vector<special_attack> player::mutation_attacks(monster *z, player *p)
num_attacks--;
for (int i = 0; i < num_attacks; i++) {
if (one_in(18 - dex_cur - skillLevel("unarmed").level())) {
if (one_in(18 - dex_cur - skillLevel("unarmed"))) {
special_attack tmp;
text.str("");
text << You << " slap" << (is_u ? " " : "s ") << target << " with " <<
+12 -12
View File
@@ -44,13 +44,13 @@ void mission_start::place_dog(game *g, mission *miss)
// Make it seen on our map
for (int x = house.x - 6; x <= house.x + 6; x++) {
for (int y = house.y - 6; y <= house.y + 6; y++)
g->cur_om.seen(x, y) = true;
g->cur_om.seen(x, y, 0) = true;
}
tinymap doghouse(&(g->itypes), &(g->mapitems), &(g->traps));
doghouse.load(g, house.x * 2, house.y * 2, false);
doghouse.load(g, house.x * 2, house.y * 2, 0, false);
doghouse.add_spawn(mon_dog, 1, SEEX, SEEY, true, -1, miss->uid);
doghouse.save(&(g->cur_om), int(g->turn), house.x * 2, house.y * 2);
doghouse.save(&(g->cur_om), int(g->turn), house.x * 2, house.y * 2, 0);
}
void mission_start::place_zombie_mom(game *g, mission *miss)
@@ -62,13 +62,13 @@ void mission_start::place_zombie_mom(game *g, mission *miss)
// Make it seen on our map
for (int x = house.x - 6; x <= house.x + 6; x++) {
for (int y = house.y - 6; y <= house.y + 6; y++)
g->cur_om.seen(x, y) = true;
g->cur_om.seen(x, y, 0) = true;
}
tinymap zomhouse(&(g->itypes), &(g->mapitems), &(g->traps));
zomhouse.load(g, house.x * 2, house.y * 2, false);
zomhouse.load(g, house.x * 2, house.y * 2, 0, false);
zomhouse.add_spawn(mon_zombie, 1, SEEX, SEEY, false, -1, miss->uid, Name::get(nameIsFemaleName | nameIsGivenName));
zomhouse.save(&(g->cur_om), int(g->turn), house.x * 2, house.y * 2);
zomhouse.save(&(g->cur_om), int(g->turn), house.x * 2, house.y * 2, 0);
}
void mission_start::place_npc_software(game *g, mission *miss)
@@ -110,13 +110,13 @@ void mission_start::place_npc_software(game *g, mission *miss)
// Make it seen on our map
for (int x = place.x - 6; x <= place.x + 6; x++) {
for (int y = place.y - 6; y <= place.y + 6; y++)
g->cur_om.seen(x, y) = true;
g->cur_om.seen(x, y, 0) = true;
}
tinymap compmap(&(g->itypes), &(g->mapitems), &(g->traps));
compmap.load(g, place.x * 2, place.y * 2, false);
compmap.load(g, place.x * 2, place.y * 2, 0, false);
point comppoint;
switch (g->cur_om.ter(place.x, place.y)) {
switch (g->cur_om.ter(place.x, place.y, 0)) {
case ot_house_north:
case ot_house_east:
case ot_house_west:
@@ -196,7 +196,7 @@ void mission_start::place_npc_software(game *g, mission *miss)
tmpcomp->mission_id = miss->uid;
tmpcomp->add_option("Download Software", COMPACT_DOWNLOAD_SOFTWARE, 0);
compmap.save(&(g->cur_om), int(g->turn), place.x * 2, place.y * 2);
compmap.save(&(g->cur_om), int(g->turn), place.x * 2, place.y * 2, 0);
}
void mission_start::reveal_hospital(game *g, mission *miss)
@@ -211,7 +211,7 @@ void mission_start::reveal_hospital(game *g, mission *miss)
false);
for (int x = place.x - 3; x <= place.x + 3; x++) {
for (int y = place.y - 3; y <= place.y + 3; y++)
g->cur_om.seen(x, y) = true;
g->cur_om.seen(x, y, 0) = true;
}
miss->target = place;
}
@@ -231,7 +231,7 @@ void mission_start::find_safety(game *g, mission *miss)
case 2: check.y += dist; check.x -= radius; break;
case 3: check.y += dist; check.x += radius; break;
}
if (g->cur_om.is_safe(check.x, check.y)) {
if (g->cur_om.is_safe(check.x, check.y, g->levz)) {
miss->target = check;
done = true;
}
+41 -1
View File
@@ -135,6 +135,24 @@ void mattack::shockstorm(game *g, monster *z)
}
}
void mattack::smokecloud(game *g, monster *z)
{
z->sp_timeout = z->type->sp_freq; // Reset timer
for (int i = -3; i <= 3; i++) {
for (int j = -3; j <=3; j++) {
g->m.add_field(g, z->posx + i, z->posy + j, fd_smoke, 2);
}
}
//Round it out a bit
for (int i = -2; i <= 2; i++){
g->m.add_field(g, z->posx + i, z->posy + 4, fd_smoke, 2);
g->m.add_field(g, z->posx + i, z->posy - 4, fd_smoke, 2);
g->m.add_field(g, z->posx + 4, z->posy + i, fd_smoke, 2);
g->m.add_field(g, z->posx - 4, z->posy + i, fd_smoke, 2);
}
}
void mattack::boomer(game *g, monster *z)
{
int j;
@@ -717,7 +735,7 @@ void mattack::dermatik(game *g, monster *z)
// Can we swat the bug away?
int dodge_roll = z->dodge_roll();
int swat_skill = (g->u.skillLevel("melee").level() + g->u.skillLevel("unarmed").level() * 2) / 3;
int swat_skill = (g->u.skillLevel("melee") + g->u.skillLevel("unarmed") * 2) / 3;
int player_swat = dice(swat_skill, 10);
if (player_swat > dodge_roll) {
g->add_msg("The %s lands on you, but you swat it off.", z->name().c_str());
@@ -1363,3 +1381,25 @@ void mattack::breathe(game *g, monster *z)
g->z.push_back(spawned);
}
}
void mattack::bite(game *g, monster *z)
{
if (rl_dist(z->posx, z->posy, g->u.posx, g->u.posy) > 1)
return;
z->sp_timeout = z->type->sp_freq; // Reset timer
g->add_msg("The %s lunges forward attempting to bite you!", z->name().c_str());
z->moves -= 100;
if (rng(0, 20) > g->u.dodge(g) || one_in(g->u.dodge(g))) {
g->add_msg("You dodge it!");
return;
}
body_part hit = random_body_part();
int dam = rng(5, 10), side = rng(0, 1);
g->add_msg("Your %s is bitten for %d damage!", body_part_name(hit, side).c_str(),
dam);
g->u.hit(g, hit, side, dam, 0);
if(one_in(10)){
g->u.add_disease(DI_BITE, 3600, g);
}
}
+2
View File
@@ -13,6 +13,7 @@ class mattack
void shriek (game *g, monster *z);
void acid (game *g, monster *z);
void shockstorm (game *g, monster *z);
void smokecloud (game *g, monster *z);
void boomer (game *g, monster *z);
void resurrect (game *g, monster *z);
void science (game *g, monster *z);
@@ -44,6 +45,7 @@ class mattack
void generator (game *g, monster *z);
void upgrade (game *g, monster *z);
void breathe (game *g, monster *z);
void bite (game *g, monster *z);
};
#endif
+19 -1
View File
@@ -197,7 +197,7 @@ void mdeath::disappear(game *g, monster *z)
void mdeath::guilt(game *g, monster *z)
{
if (g->u.has_trait(PF_HEARTLESS))
if (g->u.has_trait(PF_CANNIBAL))
return; // We don't give a shit!
if (rl_dist(z->posx, z->posy, g->u.posx, g->u.posy) > 5)
return; // Too far away, we can deal with it
@@ -302,6 +302,24 @@ void mdeath::ratking(game *g, monster *z)
g->u.rem_disease(DI_RAT);
}
void mdeath::smokeburst(game *g, monster *z)
{
std::string tmp;
g->sound(z->posx, z->posy, 24, "a smoker explodes!");
for (int i = -1; i <= 1; i++) {
for (int j = -1; j <= 1; j++) {
g->m.add_field(g, z->posx + i, z->posy + j, fd_smoke, 3);
int mondex = g->mon_at(z->posx + i, z->posy +j);
if (mondex != -1) {
g->z[mondex].stumble(g, false);
g->z[mondex].moves -= 250;
}
}
}
}
void mdeath::gameover(game *g, monster *z)
{
g->add_msg("Your %s is destroyed! GAME OVER!", z->name().c_str());
+1
View File
@@ -27,6 +27,7 @@ public:
void explode (game *g, monster *z); // Damaging explosion
void ratking (game *g, monster *z); // Cure verminitis
void kill_breathers (game *g, monster *z); // All breathers die
void smokeburst (game *g, monster *z); //Explode like a huge smoke bomb.
void gameover (game *g, monster *z); // Game over! Defense mode
};
+49 -25
View File
@@ -3,49 +3,73 @@
#include "mtype.h"
#include <vector>
#include <map>
enum moncat_id {
mcat_null = 0,
mcat_forest,
mcat_ant,
mcat_bee,
mcat_worm,
mcat_zombie,
mcat_triffid,
mcat_fungi,
mcat_goo,
mcat_chud,
mcat_sewer,
mcat_swamp,
mcat_lab,
mcat_nether,
mcat_spiral,
mcat_vanilla_zombie, // Defense mode only
mcat_spider, // Defense mode only
mcat_robot, // Defense mode only
num_moncats
typedef std::map<mon_id, int> FreqDef;
typedef FreqDef::iterator FreqDef_iter;
struct MonsterGroup
{
std::string name;
mon_id defaultMonster;
FreqDef monsters;
};
bool moncat_is_safe(moncat_id id);
/*enum MonsterGroupType
{
GROUP_NULL = 0,
GROUP_FOREST,
GROUP_ANT,
GROUP_BEE,
GROUP_WORM,
GROUP_ZOMBIE,
GROUP_TRIFFID,
GROUP_FUNGI,
GROUP_GOO,
GROUP_CHUD,
GROUP_SEWER,
GROUP_SWAMP,
GROUP_LAB,
GROUP_NETHER,
GROUP_SPIRAL,
GROUP_VANILLA,
GROUP_SPIDER,
GROUP_ROBOT,
GROUP_COUNT
};*/
struct mongroup {
moncat_id type;
int posx, posy;
std::string type;
int posx, posy, posz;
unsigned char radius;
unsigned int population;
bool dying;
bool diffuse; // group size ind. of dist. from center and radius invariant
mongroup(moncat_id ptype, int pposx, int pposy, unsigned char prad,
mongroup(std::string ptype, int pposx, int pposy, int pposz, unsigned char prad,
unsigned int ppop) {
type = ptype;
posx = pposx;
posy = pposy;
posz = pposz;
radius = prad;
population = ppop;
dying = false;
diffuse = false;
}
bool is_safe() { return moncat_is_safe(type); };
bool is_safe() { return (type == "GROUP_NULL" || type == "GROUP_FOREST"); };
};
class MonsterGroupManager
{
public:
static void LoadJSONGroups();
static mon_id GetMonsterFromGroup(std::string, std::vector <mtype*> *, int turn = -1);
static bool IsMonsterInGroup(std::string, mon_id);
static std::string Monster2Group(mon_id);
static std::vector<mon_id> GetMonstersFromGroup(std::string);
static MonsterGroup GetMonsterGroup(std::string group);
private:
static std::map<std::string, MonsterGroup> monsterGroupMap;
};
#endif
+218 -67
View File
@@ -1,75 +1,226 @@
#include "game.h"
#include <fstream>
#include <vector>
#include "setvector.h"
#include "picojson.h"
#include "options.h"
void game::init_moncats()
//Adding a group:
// 1: Declare it in the MonsterGroupDefs enum in mongroup.h
// 2: Define it in here with the macro Group(your group, default monster)
// and AddMonster(your group, some monster, a frequency on 1000)
//
// Frequency: If you don't use the whole 1000 points of frequency for each of
// the monsters, the remaining points will go to the defaultMonster.
// Ie. a group with 1 monster at frequency will have 50% chance to spawn
// the default monster.
// In the same spirit, if you have a total point count of over 1000, the
// default monster will never get picked, and nor will the others past the
// monster that makes the point count go over 1000
std::map<std::string, MonsterGroup> MonsterGroupManager::monsterGroupMap;
void game::init_mongroups() { MonsterGroupManager::LoadJSONGroups(); }
mon_id MonsterGroupManager::GetMonsterFromGroup(std::string group, std::vector <mtype*> *mtypes, int turn)
{
setvector(
moncats[mcat_forest],
mon_squirrel, mon_rabbit, mon_deer, mon_wolf, mon_bear, mon_cougar, mon_spider_wolf,
mon_spider_jumping, mon_dog, mon_shia, NULL);
setvector(
moncats[mcat_ant],
mon_ant_larva, mon_ant, mon_ant_soldier, mon_ant_queen, NULL);
setvector(
moncats[mcat_bee],
mon_bee, NULL);
setvector(
moncats[mcat_worm],
mon_graboid, mon_worm, mon_halfworm, NULL);
setvector(
moncats[mcat_zombie],
mon_zombie, mon_zombie_cop, mon_zombie_shrieker, mon_zombie_spitter, mon_zombie_fast,
mon_zombie_electric, mon_zombie_brute, mon_zombie_hulk,
mon_zombie_necro, mon_boomer, mon_skeleton, mon_zombie_grabber,
mon_zombie_master, NULL);
setvector(
moncats[mcat_triffid],
mon_triffid, mon_triffid_young, mon_vinebeast, mon_triffid_queen, NULL);
setvector(
moncats[mcat_fungi],
mon_fungaloid, mon_fungaloid_dormant, mon_ant_fungus, mon_zombie_fungus,
mon_boomer_fungus, mon_spore, mon_fungaloid_queen, mon_fungal_wall,
NULL);
setvector(
moncats[mcat_goo],
mon_blob, NULL);
setvector(
moncats[mcat_chud],
mon_chud, mon_one_eye, mon_crawler, NULL);
setvector(
moncats[mcat_sewer],
mon_sewer_fish, mon_sewer_snake, mon_sewer_rat, NULL);
setvector(
moncats[mcat_swamp],
mon_mosquito, mon_dragonfly, mon_centipede, mon_frog, mon_slug,
mon_dermatik_larva, mon_dermatik, NULL);
setvector(
moncats[mcat_lab],
mon_zombie_scientist, mon_blob_small, mon_manhack, mon_skitterbot,
NULL);
setvector(
moncats[mcat_nether],
mon_flying_polyp, mon_hunting_horror, mon_mi_go, mon_yugg, mon_gelatin,
mon_flaming_eye, mon_kreck, mon_blank, mon_gozu, NULL);
setvector(
moncats[mcat_spiral],
mon_human_snail, mon_twisted_body, mon_vortex, NULL);
setvector(
moncats[mcat_vanilla_zombie],
mon_zombie, NULL);
setvector(
moncats[mcat_spider],
mon_spider_wolf, mon_spider_web, mon_spider_jumping, mon_spider_widow,
NULL);
setvector(
moncats[mcat_robot],
mon_manhack, mon_skitterbot, mon_secubot, mon_copbot, mon_molebot,
mon_tripod, mon_chickenbot, mon_tankbot, NULL);
int roll = rng(1, 1000);
MonsterGroup g = monsterGroupMap[group];
for (FreqDef_iter it = g.monsters.begin(); it != g.monsters.end(); ++it)
{
if((turn == -1 || (turn + 900 >= MINUTES(STARTING_MINUTES) + (*mtypes)[it->first]->difficulty)) &&
(!OPTIONS[OPT_CLASSIC_ZOMBIES] ||
(*mtypes)[it->first]->in_category(MC_CLASSIC) ||
(*mtypes)[it->first]->in_category(MC_WILDLIFE)))
{ //Not too hard for us (or we dont care)
if(it->second >= roll) return it->first;
else roll -= it->second;
}
}
return g.defaultMonster;
}
bool moncat_is_safe(moncat_id id)
bool MonsterGroupManager::IsMonsterInGroup(std::string group, mon_id monster)
{
if (id == mcat_null || id == mcat_forest)
return true;
return false;
MonsterGroup g = monsterGroupMap[group];
for (FreqDef_iter it = g.monsters.begin(); it != g.monsters.end(); ++it)
{
if(it->first == monster) return true;
}
return false;
}
std::string MonsterGroupManager::Monster2Group(mon_id monster)
{
for (std::map<std::string, MonsterGroup>::const_iterator it = monsterGroupMap.begin(); it != monsterGroupMap.end(); ++it)
{
if(IsMonsterInGroup(it->first, monster ))
{
return it->first;
}
}
return "GROUP_NULL";
}
std::vector<mon_id> MonsterGroupManager::GetMonstersFromGroup(std::string group)
{
MonsterGroup g = GetMonsterGroup(group);
std::vector<mon_id> monsters;
monsters.push_back(g.defaultMonster);
for (FreqDef_iter it = g.monsters.begin(); it != g.monsters.end(); ++it)
{
monsters.push_back(it->first);
}
return monsters;
}
MonsterGroup MonsterGroupManager::GetMonsterGroup(std::string group)
{
std::map<std::string, MonsterGroup>::iterator it = monsterGroupMap.find(group);
if(it == monsterGroupMap.end())
{
debugmsg("Unable to get the group '%s'", group.c_str());
return MonsterGroup();
}
else
{
return it->second;
}
}
//json loading
const char *monGroupFilePath = "data/raw/monstergroups.json";
std::map<std::string, mon_id> monStr2monId;
void init_translation();
std::string GetString(std::string, picojson::object *);
int GetInt(std::string, picojson::object *);
MonsterGroup GetMGroupFromJSON(picojson::object *jsonobj)
{
MonsterGroup g;
picojson::object jsonmonster;
picojson::value jsonval;
std::vector<picojson::value> jsonarray;
g.name = GetString("name", jsonobj);
g.defaultMonster = monStr2monId[GetString("default", jsonobj)];
if(jsonobj->find("monsters")->second.is<picojson::array>())
jsonarray = jsonobj->find("monsters")->second.get<picojson::array>();
else
{
printf("Fatal error, cannot get monster group array in %s", monGroupFilePath);
exit(1);
}
for (picojson::array::const_iterator it_mons = jsonarray.begin(); it_mons != jsonarray.end(); ++it_mons)
{
jsonmonster = it_mons->get<picojson::object>();
g.monsters[monStr2monId[GetString("monster",&jsonmonster)]] = GetInt("freq",&jsonmonster);
}
return g;
}
void MonsterGroupManager::LoadJSONGroups()
{
//open the file
std::ifstream file;
file.open(monGroupFilePath);
if(!file.good())
{
printf("Unable to load file %s\n",monGroupFilePath); return;
}
//load the data
picojson::value groupsRaw;
file >> groupsRaw;
std::string error = picojson::get_last_error();
if(! error.empty())
{
printf("'%s' : %s", monGroupFilePath, error.c_str());
return;
}
//check the data
if (! groupsRaw.is<picojson::array>()) {
printf("The monster group file '%s' does not contain the expected JSON data", monGroupFilePath);
return;
}
init_translation();
picojson::object jsonobj;
MonsterGroup g;
const picojson::array& groups = groupsRaw.get<picojson::array>();
for (picojson::array::const_iterator it_groups = groups.begin(); it_groups != groups.end(); ++it_groups)
{
jsonobj = it_groups->get<picojson::object>();
g = GetMGroupFromJSON(&jsonobj);
monsterGroupMap[g.name] = g;
}
}
std::string GetString(std::string key, picojson::object *obj)
{
if(obj->find(key)->second.is<std::string>())
return obj->find(key)->second.get<std::string>();
else
{
printf("Cannot get string '%s' in '%s'",key.c_str(), monGroupFilePath);
}
return "";
}
int GetInt(std::string key, picojson::object *obj)
{
if(obj->find(key)->second.is<double>())
return obj->find(key)->second.get<double>();
else
{
printf("Cannot get number '%s' in '%s'",key.c_str(), monGroupFilePath);
return 0;
}
}
void init_translation()
{
monStr2monId["mon_null"] = mon_null;
monStr2monId["mon_squirrel"] = mon_squirrel; monStr2monId["mon_rabbit"] = mon_rabbit; monStr2monId["mon_deer"] = mon_deer; monStr2monId["mon_wolf"] = mon_wolf; monStr2monId["mon_bear"] = mon_bear; monStr2monId["mon_cougar"] = mon_cougar; monStr2monId["mon_crow"] = mon_crow;
monStr2monId["mon_dog"] = mon_dog; monStr2monId["mon_cat"] = mon_cat;
monStr2monId["mon_ant_larva"] = mon_ant_larva; monStr2monId["mon_ant"] = mon_ant; monStr2monId["mon_ant_soldier"] = mon_ant_soldier; monStr2monId["mon_ant_queen"] = mon_ant_queen; monStr2monId["mon_ant_fungus"] = mon_ant_fungus;
monStr2monId["mon_fly"] = mon_fly; monStr2monId["mon_bee"] = mon_bee; monStr2monId["mon_wasp"] = mon_wasp;
monStr2monId["mon_graboid"] = mon_graboid; monStr2monId["mon_worm"] = mon_worm; monStr2monId["mon_halfworm"] = mon_halfworm;
monStr2monId["mon_zombie"] = mon_zombie; monStr2monId["mon_zombie_cop"] = mon_zombie_cop; monStr2monId["mon_zombie_shrieker"] = mon_zombie_shrieker; monStr2monId["mon_zombie_spitter"] = mon_zombie_spitter; monStr2monId["mon_zombie_electric"] = mon_zombie_electric;
monStr2monId["mon_zombie_smoker"] = mon_zombie_smoker;
monStr2monId["mon_zombie_fast"] = mon_zombie_fast; monStr2monId["mon_zombie_brute"] = mon_zombie_brute; monStr2monId["mon_zombie_hulk"] = mon_zombie_hulk; monStr2monId["mon_zombie_fungus"] = mon_zombie_fungus;
monStr2monId["mon_boomer"] = mon_boomer; monStr2monId["mon_boomer_fungus"] = mon_boomer_fungus; monStr2monId["mon_skeleton"] = mon_skeleton; monStr2monId["mon_zombie_necro"] = mon_zombie_necro;
monStr2monId["mon_zombie_scientist"] = mon_zombie_scientist; monStr2monId["mon_zombie_soldier"] = mon_zombie_soldier; monStr2monId["mon_zombie_grabber"] = mon_zombie_grabber;
monStr2monId["mon_zombie_master"] = mon_zombie_master; monStr2monId["mon_beekeeper"] = mon_beekeeper; monStr2monId["mon_zombie_child"] = mon_zombie_child;
monStr2monId["mon_triffid"] = mon_triffid; monStr2monId["mon_triffid_young"] = mon_triffid_young; monStr2monId["mon_triffid_queen"] = mon_triffid_queen; monStr2monId["mon_creeper_hub"] = mon_creeper_hub;
monStr2monId["mon_creeper_vine"] = mon_creeper_vine; monStr2monId["mon_biollante"] = mon_biollante; monStr2monId["mon_vinebeast"] = mon_vinebeast; monStr2monId["mon_triffid_heart"] = mon_triffid_heart;
monStr2monId["mon_fungaloid"] = mon_fungaloid; monStr2monId["mon_fungaloid_dormant"] = mon_fungaloid_dormant; monStr2monId["mon_fungaloid_young"] = mon_fungaloid_young; monStr2monId["mon_spore"] = mon_spore;
monStr2monId["mon_fungaloid_queen"] = mon_fungaloid_queen; monStr2monId["mon_fungal_wall"] = mon_fungal_wall;
monStr2monId["mon_blob"] = mon_blob; monStr2monId["mon_blob_small"] = mon_blob_small;
monStr2monId["mon_chud"] = mon_chud; monStr2monId["mon_one_eye"] = mon_one_eye; monStr2monId["mon_crawler"] = mon_crawler;
monStr2monId["mon_sewer_fish"] = mon_sewer_fish; monStr2monId["mon_sewer_snake"] = mon_sewer_snake; monStr2monId["mon_sewer_rat"] = mon_sewer_rat; monStr2monId["mon_rat_king"] = mon_rat_king;
monStr2monId["mon_mosquito"] = mon_mosquito; monStr2monId["mon_dragonfly"] = mon_dragonfly; monStr2monId["mon_centipede"] = mon_centipede; monStr2monId["mon_frog"] = mon_frog; monStr2monId["mon_slug"] = mon_slug;
monStr2monId["mon_dermatik_larva"] = mon_dermatik_larva; monStr2monId["mon_dermatik"] = mon_dermatik;
monStr2monId["mon_spider_wolf"] = mon_spider_wolf; monStr2monId["mon_spider_web"] = mon_spider_web; monStr2monId["mon_spider_jumping"] = mon_spider_jumping; monStr2monId["mon_spider_trapdoor"] = mon_spider_trapdoor;
monStr2monId["mon_spider_widow"] = mon_spider_widow;
monStr2monId["mon_dark_wyrm"] = mon_dark_wyrm; monStr2monId["mon_amigara_horror"] = mon_amigara_horror; monStr2monId["mon_dog_thing"] = mon_dog_thing; monStr2monId["mon_headless_dog_thing"] = mon_headless_dog_thing;
monStr2monId["mon_thing"] = mon_thing;
monStr2monId["mon_human_snail"] = mon_human_snail; monStr2monId["mon_twisted_body"] = mon_twisted_body; monStr2monId["mon_vortex"] = mon_vortex;
monStr2monId["mon_flying_polyp"] = mon_flying_polyp; monStr2monId["mon_hunting_horror"] = mon_hunting_horror; monStr2monId["mon_mi_go"] = mon_mi_go; monStr2monId["mon_yugg"] = mon_yugg; monStr2monId["mon_gelatin"] = mon_gelatin;
monStr2monId["mon_flaming_eye"] = mon_flaming_eye; monStr2monId["mon_kreck"] = mon_kreck; monStr2monId["mon_gracke"] = mon_gracke; monStr2monId["mon_blank"] = mon_blank; monStr2monId["mon_gozu"] = mon_gozu; monStr2monId["mon_shadow"] = mon_shadow; monStr2monId["mon_breather_hub"] = mon_breather_hub;
monStr2monId["mon_breather"] = mon_breather; monStr2monId["mon_shadow_snake"] = mon_shadow_snake;
monStr2monId["mon_eyebot"] = mon_eyebot; monStr2monId["mon_manhack"] = mon_manhack; monStr2monId["mon_skitterbot"] = mon_skitterbot; monStr2monId["mon_secubot"] = mon_secubot; monStr2monId["mon_copbot"] = mon_copbot; monStr2monId["mon_molebot"] = mon_molebot;
monStr2monId["mon_tripod"] = mon_tripod; monStr2monId["mon_chickenbot"] = mon_chickenbot; monStr2monId["mon_tankbot"] = mon_tankbot; monStr2monId["mon_turret"] = mon_turret; monStr2monId["mon_exploder"] = mon_exploder;
monStr2monId["mon_hallu_zom"] = mon_hallu_zom; monStr2monId["mon_hallu_bee"] = mon_hallu_bee; monStr2monId["mon_hallu_ant"] = mon_hallu_ant; monStr2monId["mon_hallu_mom"] = mon_hallu_mom;
monStr2monId["mon_generator"] = mon_generator;
}
+32 -11
View File
@@ -13,6 +13,9 @@ void game::init_monitems()
mi_softdrugs, 5,mi_harddrugs, 1,mi_tools, 20,mi_trash, 7,
mi_ammo, 1,mi_pistols, 1,mi_shotguns, 1,mi_smg, 1,
NULL);
setvector(monitems[mon_zombie_child],
mi_child_items,65, NULL);
monitems[mon_zombie_shrieker] = monitems[mon_zombie];
monitems[mon_zombie_spitter] = monitems[mon_zombie];
monitems[mon_zombie_electric] = monitems[mon_zombie];
@@ -25,7 +28,6 @@ void game::init_monitems()
monitems[mon_zombie_necro] = monitems[mon_zombie];
monitems[mon_zombie_grabber] = monitems[mon_zombie];
monitems[mon_zombie_master] = monitems[mon_zombie];
monitems[mon_zombie_child] = monitems[mon_zombie];
setvector(monitems[mon_beekeeper],
mi_hive, 80, NULL);
@@ -70,14 +72,33 @@ void game::init_monitems()
monitems[mon_spider_widow] = monitems[mon_dragonfly];
setvector(monitems[mon_eyebot],
mi_robots, 4, mi_ammo, 1,NULL);
monitems[mon_manhack] = monitems[mon_eyebot];
monitems[mon_skitterbot] = monitems[mon_eyebot];
monitems[mon_secubot] = monitems[mon_eyebot];
monitems[mon_copbot] = monitems[mon_eyebot];
monitems[mon_molebot] = monitems[mon_eyebot];
monitems[mon_tripod] = monitems[mon_eyebot];
monitems[mon_chickenbot] = monitems[mon_eyebot];
monitems[mon_tankbot] = monitems[mon_eyebot];
monitems[mon_turret] = monitems[mon_eyebot];
mi_robots,4, mi_eyebot, 1,NULL);
setvector(monitems[mon_manhack],
mi_robots,4, mi_manhack, 1, NULL);
setvector(monitems[mon_skitterbot],
mi_robots,4, mi_skitterbot, 1, NULL);
setvector(monitems[mon_secubot],
mi_robots,4, mi_secubot, 1, NULL);
setvector(monitems[mon_copbot],
mi_robots,4, mi_copbot, 1, NULL);
setvector(monitems[mon_molebot],
mi_robots,4, mi_molebot, 1, NULL);
setvector(monitems[mon_tripod],
mi_robots,4, mi_tripod, 1, NULL);
setvector(monitems[mon_chickenbot],
mi_robots,4, mi_chickenbot, 1, NULL);
setvector(monitems[mon_tankbot],
mi_robots,4, mi_tankbot, 1, NULL);
setvector(monitems[mon_turret],
mi_robots,4, mi_turret, 1, NULL);
}
+6 -2
View File
@@ -527,14 +527,14 @@ void monster::hit_player(game *g, player &p, bool can_grab)
if (has_flag(MF_BLEED) && dam > 6 && cut > 0) {
if (!is_npc)
g->add_msg("You're Bleeding!");
p.add_disease(DI_BLEED, 30, g);
p.add_disease(DI_BLEED, 60, g);
}
if (can_grab && has_flag(MF_GRABS) &&
dice(type->melee_dice, 10) > dice(p.dodge(g), 10)) {
if (!is_npc)
g->add_msg("The %s grabs you!", name().c_str());
if (p.weapon.has_technique(TEC_BREAK, &p) &&
dice(p.dex_cur + p.skillLevel("melee").level(), 12) > dice(type->melee_dice, 10)){
dice(p.dex_cur + p.skillLevel("melee"), 12) > dice(type->melee_dice, 10)){
if (!is_npc)
g->add_msg("You break the grab!");
} else
@@ -766,6 +766,10 @@ bool monster::will_reach(game *g, int x, int y)
if (has_flag(MF_IMMOBILE) && (posx != x || posy != y))
return false;
std::vector<point> path = g->m.route(posx, posy, x, y, has_flag(MF_BASHES));
if (path.size() == 0)
return false;
if (has_flag(MF_SMELLS) && g->scent(posx, posy) > 0 &&
g->scent(x, y) > g->scent(posx, posy))
return true;
+7 -27
View File
@@ -448,7 +448,8 @@ int monster::trigger_sum(game *g, std::vector<monster_trigger> *triggers)
for (int n = 0; n < items->size(); n++) {
if ((*items)[n].type->id == itm_corpse ||
(*items)[n].type->id == itm_meat ||
(*items)[n].type->id == itm_meat_tainted) {
(*items)[n].type->id == itm_meat_cooked ||
(*items)[n].type->id == itm_human_flesh) {
ret += 3;
check_meat = false;
}
@@ -655,34 +656,13 @@ void monster::die(game *g)
// If we're a queen, make nearby groups of our type start to die out
if (has_flag(MF_QUEEN)) {
std::vector<mongroup*> groups = g->cur_om.monsters_at(g->levx, g->levy);
for (int i = 0; i < groups.size(); i++) {
moncat_id moncat_type = groups[i]->type;
bool match = false;
for (int j = 0; !match && j < g->moncats[moncat_type].size(); j++) {
if (g->moncats[moncat_type][j] == type->id)
match = true;
}
if (match)
groups[i]->dying = true;
}
// Do it for overmap above/below too
overmap tmp;
if (g->cur_om.posz == 0)
tmp = overmap(g, g->cur_om.posx, g->cur_om.posy, -1);
else
tmp = overmap(g, g->cur_om.posx, g->cur_om.posy, 0);
groups = tmp.monsters_at(g->levx, g->levy);
for (int i = 0; i < groups.size(); i++) {
moncat_id moncat_type = groups[i]->type;
bool match = false;
for (int j = 0; !match && j < g->moncats[moncat_type].size(); j++) {
if (g->moncats[moncat_type][j] == type->id)
match = true;
}
if (match)
for(int z = 0; z >= -1; --z) {
std::vector<mongroup*> groups = g->cur_om.monsters_at(g->levx, g->levy, z);
for (int i = 0; i < groups.size(); i++) {
if (MonsterGroupManager::IsMonsterInGroup(groups[i]->type, mon_id(type->id)))
groups[i]->dying = true;
}
}
}
// If we're a mission monster, update the mission
+1
View File
@@ -23,6 +23,7 @@ enum morale_type
MORALE_CRAVING_CRACK,
MORALE_FOOD_BAD,
MORALE_CANNIBAL,
MORALE_VEGETARIAN,
MORALE_WET,
MORALE_COLD,
+1
View File
@@ -20,6 +20,7 @@ std::string morale_data[NUM_MORALE_TYPES] = {
"Crack Cocaine Craving",
"Disliked %i",
"Ate Human Flesh",
"Ate Meat",
"Wet",
"Cold",
+29 -6
View File
@@ -30,7 +30,7 @@ num_species
enum mon_id {
mon_null = 0,
// Wildlife
mon_squirrel, mon_rabbit, mon_deer, mon_wolf, mon_bear, mon_cougar,
mon_squirrel, mon_rabbit, mon_deer, mon_wolf, mon_bear, mon_cougar, mon_crow,
// Friendly animals
mon_dog, mon_cat,
// Ants
@@ -41,10 +41,11 @@ mon_fly, mon_bee, mon_wasp,
mon_graboid, mon_worm, mon_halfworm,
// Zombies
mon_zombie, mon_zombie_cop, mon_zombie_shrieker, mon_zombie_spitter, mon_zombie_electric,
mon_zombie_smoker,
mon_zombie_fast, mon_zombie_brute, mon_zombie_hulk, mon_zombie_fungus,
mon_boomer, mon_boomer_fungus, mon_skeleton, mon_zombie_necro,
mon_zombie_scientist, mon_zombie_soldier, mon_zombie_grabber,
mon_zombie_master, mon_beekeeper, mon_shia, mon_zombie_child,
mon_zombie_master, mon_beekeeper, mon_zombie_child,
// Triffids
mon_triffid, mon_triffid_young, mon_triffid_queen, mon_creeper_hub,
mon_creeper_vine, mon_biollante, mon_vinebeast, mon_triffid_heart,
@@ -120,6 +121,11 @@ std::vector<monster_trigger> default_fears(monster_species spec);
enum m_flag {
MF_NULL = 0, // Helps with setvector
MF_SEES, // It can see you (and will run/follow)
MF_VIS50, //Vision -10
MF_VIS40, //Vision -20
MF_VIS30, //Vision -30
MF_VIS20, //Vision -40
MF_VIS10, //Vision -50
MF_HEARS, // It can hear you
MF_GOODHEARING, // Pursues sounds more than most monsters
MF_SMELLS, // It can smell you
@@ -152,14 +158,24 @@ MF_QUEEN, // When it dies, local populations start to die off too
MF_ELECTRONIC, // e.g. a robot; affected by emp blasts, and other stuff
MF_FUR, // May produce fur when butchered.
MF_LEATHER, // May produce leather when butchered
MF_CBM, // May produce a cbm or two when butchered
MF_BONES, // May produce bones and sinews when butchered
MF_IMMOBILE, // Doesn't move (e.g. turrets)
MF_FRIENDLY_SPECIAL, // Use our special attack, even if friendly
MF_HIT_AND_RUN, // Flee for several turns after a melee attack
MF_GUILT, // You feel guilty for killing it
MF_HUMAN, // It's a live human
MF_NO_BREATHE, //Provides immunity to inhalation effects from gas, smoke, and poison
MF_MAX // Sets the length of the flags - obviously MUST be last
};
enum m_category {
MC_NULL = 0, // No category.
MC_CLASSIC, // Only monsters we expect in a classic zombie movie.
MC_WILDLIFE, // The natural animals.
MC_MAX // Size of flag array.
};
struct mtype {
int id;
std::string name;
@@ -171,11 +187,11 @@ struct mtype {
m_size size;
material mat; // See enums.h for material list. Generally, flesh; veggy?
std::vector<m_flag> flags;
std::vector<m_category> categories;
std::vector<monster_trigger> anger; // What angers us?
std::vector<monster_trigger> placate; // What reduces our anger?
std::vector<monster_trigger> fear; // What are we afraid of?
unsigned char frequency; // How often do these show up? 0 (never) to ??
int difficulty;// Used all over; 30 min + (diff-3)*30 min = earlist appearance
int agro; // How likely to attack; -100 to 100
int morale; // Default morale level
@@ -207,7 +223,6 @@ struct mtype {
size = MS_MEDIUM;
mat = FLESH;
difficulty = 0;
frequency = 0;
agro = 0;
morale = 0;
speed = 0;
@@ -228,7 +243,7 @@ struct mtype {
// Non-default (messy)
mtype (int pid, std::string pname, monster_species pspecies, char psym,
nc_color pcolor, m_size psize, material pmat,
unsigned char pfreq, unsigned int pdiff, signed char pagro,
unsigned int pdiff, signed char pagro,
signed char pmorale, unsigned int pspeed, unsigned char pml_skill,
unsigned char pml_dice, unsigned char pml_sides, unsigned char pml_cut,
unsigned char pdodge, unsigned char parmor_bash,
@@ -244,7 +259,6 @@ struct mtype {
color = pcolor;
size = psize;
mat = pmat;
frequency = pfreq;
difficulty = pdiff;
agro = pagro;
morale = pmorale;
@@ -275,6 +289,15 @@ struct mtype {
}
return false;
}
bool in_category(m_category category)
{
for (int i = 0; i < categories.size(); i++) {
if (categories[i] == category)
return true;
}
return false;
}
};
#endif
+339 -317
View File
File diff suppressed because it is too large Load Diff
+134 -190
View File
@@ -34,12 +34,12 @@
#define HIGH_STAT 14 // The point after which stats cost double
#define MAX_TRAIT_POINTS 12 // How many points from traits
void draw_tabs(WINDOW* w);
void draw_tabs(WINDOW* w, std::string sTab);
int set_stats(WINDOW* w, player *u, int &points);
int set_traits(WINDOW* w, player *u, int &points);
int set_skills(WINDOW* w, player *u, int &points);
int set_description(WINDOW* w, player *u, int &points);
int set_stats(WINDOW* w, game* g, player *u, int &points);
int set_traits(WINDOW* w, game* g, player *u, int &points);
int set_skills(WINDOW* w, game* g, player *u, int &points);
int set_description(WINDOW* w, game* g, player *u, int &points);
int random_skill();
@@ -50,7 +50,9 @@ void save_template(player *u);
bool player::create(game *g, character_type type, std::string tempname)
{
weapon = item(g->itypes[0], 0);
WINDOW* w = newwin(25, 80, 0, 0);
WINDOW* w = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
int tab = 0, points = 38;
if (type != PLTYPE_CUSTOM) {
switch (type) {
@@ -121,7 +123,7 @@ bool player::create(game *g, character_type type, std::string tempname)
rn = random_skill();
Skill *aSkill = Skill::skill(rn);
int level = skillLevel(aSkill).level();
int level = skillLevel(aSkill);
if (level < points) {
points -= level + 1;
@@ -152,13 +154,12 @@ bool player::create(game *g, character_type type, std::string tempname)
do {
werase(w);
draw_tabs(w);
wrefresh(w);
switch (tab) {
case 0: tab += set_stats (w, this, points); break;
case 1: tab += set_traits (w, this, points); break;
case 2: tab += set_skills (w, this, points); break;
case 3: tab += set_description(w, this, points); break;
case 0: tab += set_stats (w, g, this, points); break;
case 1: tab += set_traits (w, g, this, points); break;
case 2: tab += set_skills (w, g, this, points); break;
case 3: tab += set_description(w, g, this, points); break;
}
} while (tab >= 0 && tab < 4);
delwin(w);
@@ -208,7 +209,7 @@ End of cheatery */
itype_id ma_type;
do {
int choice = menu("Pick your style:",
"Karate", "Judo", "Aikido", "Tai Chi", "Taekwando", NULL);
"Karate", "Judo", "Aikido", "Tai Chi", "Taekwondo", NULL);
if (choice == 1)
ma_type = itm_style_karate;
if (choice == 2)
@@ -218,7 +219,7 @@ End of cheatery */
if (choice == 4)
ma_type = itm_style_tai_chi;
if (choice == 5)
ma_type = itm_style_taekwando;
ma_type = itm_style_taekwondo;
item tmpitem = item(g->itypes[ma_type], 0);
full_screen_popup(tmpitem.info(true).c_str());
} while (!query_yn("Use this style?"));
@@ -246,80 +247,60 @@ End of cheatery */
tmp = item(g->itypes[itm_inhaler], 0, 'a' + worn.size());
inv.push_back(tmp);
}
// Basic starter gear, added independently of profession.
tmp = item(g->itypes[itm_pockknife], 0,'a' + worn.size());
inv.push_back(tmp);
tmp = item(g->itypes[itm_lighter], 0,'a' + worn.size());
inv.push_back(tmp);
// make sure we have no mutations
for (int i = 0; i < PF_MAX2; i++)
my_mutations[i] = false;
return true;
}
void draw_tabs(WINDOW* w)
void draw_tabs(WINDOW* w, std::string sTab)
{
for (int i = 0; i < 16; i++) {
if (i < 9)
mvwputch(w, 0, i + 5, c_ltgray, LINE_OXOX);
if (i < 10) {
mvwputch(w, 0, i + 22, c_ltgray, LINE_OXOX);
mvwputch(w, 0, i + 40, c_ltgray, LINE_OXOX);
for (int i = 1; i < 79; i++) {
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
mvwputch(w, 24, i, c_ltgray, LINE_OXOX);
if (i > 2 && i < 24) {
mvwputch(w, i, 0, c_ltgray, LINE_XOXO);
mvwputch(w, i, 79, c_ltgray, LINE_XOXO);
}
mvwputch(w, 0, i + 57, c_ltgray, LINE_OXOX);
}
mvwputch(w, 0, 4, c_ltgray, LINE_OXXO);
mvwputch(w, 0,21, c_ltgray, LINE_OXXO);
mvwputch(w, 0,39, c_ltgray, LINE_OXXO);
mvwputch(w, 0,57, c_ltgray, LINE_OXXO);
mvwputch(w, 0,14, c_ltgray, LINE_OOXX);
mvwputch(w, 0,32, c_ltgray, LINE_OOXX);
mvwputch(w, 0,50, c_ltgray, LINE_OOXX);
mvwputch(w, 0,73, c_ltgray, LINE_OOXX);
draw_tab(w, 8, "STATS", (sTab == "STATS") ? true : false);
draw_tab(w, 24, "TRAITS", (sTab == "TRAITS") ? true : false);
draw_tab(w, 41, "SKILLS", (sTab == "SKILLS") ? true : false);
draw_tab(w, 58, "DESCRIPTION", (sTab == "DESCRIPTION") ? true : false);
mvwprintz(w, 1, 4, c_ltgray, "\
STATS TRAITS SKILLS DESCRIPTION ");
mvwputch(w, 2, 0, c_ltgray, LINE_OXXO); // |^
mvwputch(w, 2, 79, c_ltgray, LINE_OOXX); // ^|
mvwputch(w, 1, 4, c_ltgray, LINE_XOXO);
mvwputch(w, 1,14, c_ltgray, LINE_XOXO);
mvwputch(w, 1,21, c_ltgray, LINE_XOXO);
mvwputch(w, 1,32, c_ltgray, LINE_XOXO);
mvwputch(w, 1,39, c_ltgray, LINE_XOXO);
mvwputch(w, 1,50, c_ltgray, LINE_XOXO);
mvwputch(w, 1,57, c_ltgray, LINE_XOXO);
mvwputch(w, 1,73, c_ltgray, LINE_XOXO);
mvwputch(w, 4, 0, c_ltgray, LINE_XXXO); // |-
mvwputch(w, 4, 79, c_ltgray, LINE_XOXX); // -|
mvwputch(w, 24, 0, c_ltgray, LINE_XXOO); // |_
mvwputch(w, 24, 79, c_ltgray, LINE_XOOX); // _|
}
int set_stats(WINDOW* w, player *u, int &points)
int set_stats(WINDOW* w, game* g, player *u, int &points)
{
unsigned char sel = 1;
char ch;
// Draw horizontal lines, with a gap for the active tab
for (int i = 0; i < 80; i++) {
if (i < 4 || i > 14)
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
}
// Attaching lines for tabs
mvwputch(w, 1, 2, h_ltgray, '<');
mvwputch(w, 1, 16, h_ltgray, '>');
mvwputch(w, 2, 4, c_ltgray, LINE_XOOX);
mvwputch(w, 2, 14, c_ltgray, LINE_XXOO);
mvwputch(w, 2, 21, c_ltgray, LINE_XXOX);
mvwputch(w, 2, 32, c_ltgray, LINE_XXOX);
mvwputch(w, 2, 39, c_ltgray, LINE_XXOX);
mvwputch(w, 2, 50, c_ltgray, LINE_XXOX);
mvwputch(w, 2, 57, c_ltgray, LINE_XXOX);
mvwputch(w, 2, 73, c_ltgray, LINE_XXOX);
mvwprintz(w, 1, 5, h_ltgray, " STATS ");
mvwprintz(w, 11, 0, c_ltgray, "\
j/k, 8/2, or arrows select\n\
a statistic.\n\
l, 6, or right arrow\n\
increases the statistic.\n\
h, 4, or left arrow\n\
decreases the statistic.\n\
\n\
> Takes you to the next tab.\n\
< Returns you to the main menu.");
draw_tabs(w, "STATS");
mvwprintz(w, 11, 2, c_ltgray, "j/k, 8/2, or arrows select");
mvwprintz(w, 12, 2, c_ltgray, " a statistic.");
mvwprintz(w, 13, 2, c_ltgray, "l, 6, or right arrow");
mvwprintz(w, 14, 2, c_ltgray, " increases the statistic.");
mvwprintz(w, 15, 2, c_ltgray, "h, 4, or left arrow");
mvwprintz(w, 16, 2, c_ltgray, " decreases the statistic.");
mvwprintz(w, 18, 2, c_ltgray, "> Takes you to the next tab.");
mvwprintz(w, 19, 2, c_ltgray, "< Returns you to the main menu.");
do {
mvwprintz(w, 3, 2, c_ltgray, "Points left: %d ", points);
@@ -339,9 +320,9 @@ int set_stats(WINDOW* w, player *u, int &points)
u->weight_capacity(false) / 4);
mvwprintz(w, 8, 33, COL_STAT_ACT, "Melee damage: %d ",
u->base_damage(false));
mvwprintz(w, 9, 33, COL_STAT_ACT, " Strength also makes you more resistant to ");
mvwprintz(w,10, 33, COL_STAT_ACT, "many diseases and poisons, and makes actions");
mvwprintz(w,11, 33, COL_STAT_ACT, "which require brute force more effective. ");
mvwprintz(w,10, 33, COL_STAT_ACT, "Strength also makes you more resistant to ");
mvwprintz(w,11, 33, COL_STAT_ACT, "many diseases and poisons, and makes actions");
mvwprintz(w,12, 33, COL_STAT_ACT, "which require brute force more effective. ");
break;
case 2:
@@ -365,9 +346,10 @@ int set_stats(WINDOW* w, player *u, int &points)
(u->throw_dex_mod(false) <= 0 ? "bonus" : "penalty"),
(u->throw_dex_mod(false) <= 0 ? "+" : "-"),
abs(u->throw_dex_mod(false)));
mvwprintz(w, 9, 33, COL_STAT_ACT, " Dexterity also enhances many actions which");
mvwprintz(w,10, 33, COL_STAT_ACT, "require finesse. ");
mvwprintz(w,11, 33, COL_STAT_ACT, " ");
mvwprintz(w, 9, 33, COL_STAT_ACT, " ");
mvwprintz(w,10, 33, COL_STAT_ACT, "Dexterity also enhances many actions which ");
mvwprintz(w,11, 33, COL_STAT_ACT, "require finesse. ");
mvwprintz(w,12, 33, COL_STAT_ACT, " ");
break;
case 3:
@@ -379,14 +361,16 @@ int set_stats(WINDOW* w, player *u, int &points)
mvwprintz(w, 7, 2, c_ltgray, "Dexterity: %d ", u->dex_max);
mvwprintz(w, 8, 2, COL_STAT_ACT, "Intelligence: %d ", u->int_max);
mvwprintz(w, 9, 2, c_ltgray, "Perception: %d ", u->per_max);
mvwprintz(w, 6, 33, COL_STAT_ACT, "Skill comprehension: %d%%%% ",
u->skillLevel("melee").comprehension(u->int_max));
mvwprintz(w, 7, 33, COL_STAT_ACT, "Read times: %d%%%% ",
u->read_speed(false));
mvwprintz(w, 8, 33, COL_STAT_ACT, " Intelligence is also used when crafting, ");
mvwprintz(w, 9, 33, COL_STAT_ACT, "installing bionics, and interacting with ");
mvwprintz(w,10, 33, COL_STAT_ACT, "NPCs. ");
mvwprintz(w,11, 33, COL_STAT_ACT, " ");
mvwprintz(w, 8, 33, COL_STAT_ACT, " ");
mvwprintz(w, 9, 33, COL_STAT_ACT, "Intelligence is also used when crafting, ");
mvwprintz(w,10, 33, COL_STAT_ACT, "installing bionics, and interacting with ");
mvwprintz(w,11, 33, COL_STAT_ACT, "NPCs. ");
mvwprintz(w,12, 33, COL_STAT_ACT, " ");
break;
case 4:
@@ -403,11 +387,12 @@ int set_stats(WINDOW* w, player *u, int &points)
(u->ranged_per_mod(false) <= 0 ? "bonus" : "penalty"),
(u->ranged_per_mod(false) <= 0 ? "+" : "-"),
abs(u->ranged_per_mod(false)));
mvwprintz(w, 7, 33, COL_STAT_ACT, " Perception is also used for detecting ");
mvwprintz(w, 8, 33, COL_STAT_ACT, "traps and other things of interest. ");
mvwprintz(w, 9, 33, COL_STAT_ACT, " ");
mvwprintz(w, 7, 33, COL_STAT_ACT, " ");
mvwprintz(w, 8, 33, COL_STAT_ACT, "Perception is also used for detecting ");
mvwprintz(w, 9, 33, COL_STAT_ACT, "traps and other things of interest. ");
mvwprintz(w,10, 33, COL_STAT_ACT, " ");
mvwprintz(w,11, 33, COL_STAT_ACT, " ");
mvwprintz(w,12, 33, COL_STAT_ACT, " ");
break;
}
@@ -473,8 +458,11 @@ int set_stats(WINDOW* w, player *u, int &points)
} while (true);
}
int set_traits(WINDOW* w, player *u, int &points)
int set_traits(WINDOW* w, game* g, player *u, int &points)
{
draw_tabs(w, "TRAITS");
WINDOW* w_description = newwin(3, 78, 21 + getbegy(w), 1 + getbegx(w));
// Track how many good / bad POINTS we have; cap both at MAX_TRAIT_POINTS
int num_good = 0, num_bad = 0;
for (int i = 0; i < PF_SPLIT; i++) {
@@ -485,25 +473,6 @@ int set_traits(WINDOW* w, player *u, int &points)
if (u->has_trait(i))
num_bad += abs(traits[i].points);
}
// Draw horizontal lines, with a gap for the active tab
for (int i = 0; i < 80; i++) {
if (i < 21 || i > 32)
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
}
// Attaching lines for tabs
mvwputch(w, 1,19, h_ltgray, '<');
mvwputch(w, 1,34, h_ltgray, '>');
mvwputch(w, 2, 4, c_ltgray, LINE_XXOX);
mvwputch(w, 2,14, c_ltgray, LINE_XXOX);
mvwputch(w, 2,21, c_ltgray, LINE_XOOX);
mvwputch(w, 2,32, c_ltgray, LINE_XXOO);
mvwputch(w, 2,39, c_ltgray, LINE_XXOX);
mvwputch(w, 2,50, c_ltgray, LINE_XXOX);
mvwputch(w, 2,57, c_ltgray, LINE_XXOX);
mvwputch(w, 2,73, c_ltgray, LINE_XXOX);
mvwprintz(w, 1,22, h_ltgray, " TRAITS ");
for (int i = 0; i < 16; i++) {
mvwprintz(w, 5 + i, 40, c_dkgray, "\
@@ -528,25 +497,22 @@ int set_traits(WINDOW* w, player *u, int &points)
mvwprintz(w, 3,33, c_ltred, "%s%d/%d", (num_bad < 10 ? " " : ""),
num_bad, MAX_TRAIT_POINTS);
// Clear the bottom of the screen.
mvwprintz(w, 22, 0, c_ltgray, "\
");
mvwprintz(w, 23, 0, c_ltgray, "\
");
mvwprintz(w, 24, 0, c_ltgray, "\
");
mvwprintz(w_description, 0, 0, c_ltgray, " ");
mvwprintz(w_description, 1, 0, c_ltgray, " ");
mvwprintz(w_description, 2, 0, c_ltgray, " ");
if (using_adv) {
col_on = COL_TR_GOOD_ON;
col_off = COL_TR_GOOD_OFF;
hi_on = hilite(col_on);
hi_off = hilite(col_off);
xoff = 0;
xoff = 2;
cur_trait = cur_adv;
traitmin = 1;
traitmax = PF_SPLIT;
mvwprintz(w, 3, 40, c_ltgray, " ");
mvwprintz(w, 3, 40, c_ltgray, " ");
mvwprintz(w, 3, 40, COL_TR_GOOD, "%s costs %d points",
traits[cur_adv].name.c_str(), traits[cur_adv].points);
mvwprintz(w, 22, 0, COL_TR_GOOD, "%s", traits[cur_adv].description.c_str());
mvwprintz(w_description, 0, 0, COL_TR_GOOD, "%s", traits[cur_adv].description.c_str());
} else {
col_on = COL_TR_BAD_ON;
col_off = COL_TR_BAD_OFF;
@@ -556,15 +522,16 @@ int set_traits(WINDOW* w, player *u, int &points)
cur_trait = cur_dis;
traitmin = PF_SPLIT + 1;
traitmax = PF_MAX;
mvwprintz(w, 3, 40, c_ltgray, " ");
mvwprintz(w, 3, 40, c_ltgray, " ");
mvwprintz(w, 3, 40, COL_TR_BAD, "%s earns %d points",
traits[cur_dis].name.c_str(), traits[cur_dis].points * -1);
mvwprintz(w, 22, 0, COL_TR_BAD, "%s", traits[cur_dis].description.c_str());
mvwprintz(w_description, 0, 0, COL_TR_BAD, "%s", traits[cur_dis].description.c_str());
}
if (cur_trait <= traitmin + 7) {
for (int i = traitmin; i < traitmin + 16; i++) {
mvwprintz(w, 5 + i - traitmin, xoff, c_ltgray, "\
"); // Clear the line
"); // Clear the line
if (i == cur_trait) {
if (u->has_trait(i))
mvwprintz(w, 5 + i - traitmin, xoff, hi_on, traits[i].name.c_str());
@@ -580,7 +547,7 @@ int set_traits(WINDOW* w, player *u, int &points)
} else if (cur_trait >= traitmax - 9) {
for (int i = traitmax - 16; i < traitmax; i++) {
mvwprintz(w, 21 + i - traitmax, xoff, c_ltgray, "\
"); // Clear the line
"); // Clear the line
if (i == cur_trait) {
if (u->has_trait(i))
mvwprintz(w, 21 + i - traitmax, xoff, hi_on, traits[i].name.c_str());
@@ -596,7 +563,7 @@ int set_traits(WINDOW* w, player *u, int &points)
} else {
for (int i = cur_trait - 7; i < cur_trait + 9; i++) {
mvwprintz(w, 12 + i - cur_trait, xoff, c_ltgray, "\
"); // Clear the line
"); // Clear the line
if (i == cur_trait) {
if (u->has_trait(i))
mvwprintz(w, 12 + i - cur_trait, xoff, hi_on, traits[i].name.c_str());
@@ -612,6 +579,7 @@ int set_traits(WINDOW* w, player *u, int &points)
}
wrefresh(w);
wrefresh(w_description);
switch (input()) {
case 'h':
case 'l':
@@ -624,9 +592,9 @@ int set_traits(WINDOW* w, player *u, int &points)
}
} else {
for (int i = 0; i < 16; i++) {
mvwprintz(w, 5 + i, 0, c_dkgray, "\
mvwprintz(w, 5 + i, 2, c_dkgray, "\
");
mvwprintz(w, 5 + i, 0, c_dkgray, traits[i + 1].name.c_str());
mvwprintz(w, 5 + i, 2, c_dkgray, traits[i + 1].name.c_str());
}
}
using_adv = !using_adv;
@@ -687,27 +655,11 @@ int set_traits(WINDOW* w, player *u, int &points)
} while (true);
}
int set_skills(WINDOW* w, player *u, int &points)
int set_skills(WINDOW* w, game* g, player *u, int &points)
{
// Draw horizontal lines, with a gap for the active tab
for (int i = 0; i < 80; i++) {
if (i < 39 || i > 50)
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
}
// Attaching lines for tabs
mvwputch(w, 1,37, h_ltgray, '<');
mvwputch(w, 1,52, h_ltgray, '>');
mvwputch(w, 2, 4, c_ltgray, LINE_XXOX);
mvwputch(w, 2,14, c_ltgray, LINE_XXOX);
mvwputch(w, 2,21, c_ltgray, LINE_XXOX);
mvwputch(w, 2,32, c_ltgray, LINE_XXOX);
mvwputch(w, 2,39, c_ltgray, LINE_XOOX);
mvwputch(w, 2,50, c_ltgray, LINE_XXOO);
mvwputch(w, 2,57, c_ltgray, LINE_XXOX);
mvwputch(w, 2,73, c_ltgray, LINE_XXOX);
mvwprintz(w,1,40, h_ltgray, " SKILLS ");
draw_tabs(w, "SKILLS");
WINDOW* w_description = newwin(3, 78, 21 + getbegy(w), 1 + getbegx(w));
int cur_sk = 1;
Skill *currentSkill = Skill::skill(cur_sk);
@@ -715,72 +667,74 @@ int set_skills(WINDOW* w, player *u, int &points)
do {
mvwprintz(w, 3, 2, c_ltgray, "Points left: %d ", points);
// Clear the bottom of the screen.
mvwprintz(w, 22, 0, c_ltgray, "\
mvwprintz(w_description, 0, 0, c_ltgray, "\
");
mvwprintz(w, 23, 0, c_ltgray, "\
mvwprintz(w_description, 1, 0, c_ltgray, "\
");
mvwprintz(w, 24, 0, c_ltgray, "\
mvwprintz(w_description, 2, 0, c_ltgray, "\
");
if (points >= u->skillLevel(currentSkill).level() + 1)
mvwprintz(w, 3, 30, COL_SKILL_USED, "Upgrading %s costs %d points ",
skill_name(cur_sk).c_str(), u->skillLevel(currentSkill).level() + 1);
mvwprintz(w, 3, 40, c_ltgray, " ");
if (points >= u->skillLevel(currentSkill) + 1)
mvwprintz(w, 3, 30, COL_SKILL_USED, "Upgrading %s costs %d points",
skill_name(cur_sk).c_str(), u->skillLevel(currentSkill) + 1);
else
mvwprintz(w, 3, 30, c_ltred, "Upgrading %s costs %d points ",
skill_name(cur_sk).c_str(), u->skillLevel(currentSkill).level() + 1);
mvwprintz(w, 22, 0, COL_SKILL_USED, currentSkill->description().c_str());
mvwprintz(w, 3, 30, c_ltred, "Upgrading %s costs %d points",
skill_name(cur_sk).c_str(), u->skillLevel(currentSkill) + 1);
mvwprintz(w_description, 0, 0, COL_SKILL_USED, currentSkill->description().c_str());
if (cur_sk <= 7) {
for (int i = 1; i < 17; i++) {
Skill *thisSkill = Skill::skill(i);
mvwprintz(w, 4 + i, 0, c_ltgray, "\
mvwprintz(w, 4 + i, 2, c_ltgray, "\
"); // Clear the line
if (u->skillLevel(thisSkill) == 0) {
mvwprintz(w, 4 + i, 0, (i == cur_sk ? h_ltgray : c_ltgray),
mvwprintz(w, 4 + i, 2, (i == cur_sk ? h_ltgray : c_ltgray),
thisSkill->name().c_str());
} else {
mvwprintz(w, 4 + i, 0,
mvwprintz(w, 4 + i, 2,
(i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED),
"%s ", skill_name(i).c_str());
for (int j = 0; j < u->skillLevel(thisSkill).level(); j++)
for (int j = 0; j < u->skillLevel(thisSkill); j++)
wprintz(w, (i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED), "*");
}
}
} else if (cur_sk >= Skill::skills.size() - 9) {
for (int i = num_skill_types - 16; i < num_skill_types; i++) {
Skill *thisSkill = Skill::skill(i);
mvwprintz(w, 21 + i - num_skill_types, 0, c_ltgray, "\
mvwprintz(w, 21 + i - num_skill_types, 2, c_ltgray, "\
"); // Clear the line
if (u->skillLevel(thisSkill) == 0) {
mvwprintz(w, 21 + i - num_skill_types, 0,
mvwprintz(w, 21 + i - num_skill_types, 2,
(i == cur_sk ? h_ltgray : c_ltgray), thisSkill->name().c_str());
} else {
mvwprintz(w, 21 + i - num_skill_types, 0,
mvwprintz(w, 21 + i - num_skill_types, 2,
(i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED), "%s ",
thisSkill->name().c_str());
for (int j = 0; j < u->skillLevel(thisSkill).level(); j++)
for (int j = 0; j < u->skillLevel(thisSkill); j++)
wprintz(w, (i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED), "*");
}
}
} else {
for (int i = cur_sk - 7; i < cur_sk + 9; i++) {
Skill *thisSkill = Skill::skill(i);
mvwprintz(w, 12 + i - cur_sk, 0, c_ltgray, "\
mvwprintz(w, 12 + i - cur_sk, 2, c_ltgray, "\
"); // Clear the line
if (u->skillLevel(thisSkill) == 0) {
mvwprintz(w, 12 + i - cur_sk, 0, (i == cur_sk ? h_ltgray : c_ltgray),
mvwprintz(w, 12 + i - cur_sk, 2, (i == cur_sk ? h_ltgray : c_ltgray),
thisSkill->name().c_str());
} else {
mvwprintz(w, 12 + i - cur_sk, 0,
mvwprintz(w, 12 + i - cur_sk, 2,
(i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED),
"%s ", thisSkill->name().c_str());
for (int j = 0; j < u->skillLevel(thisSkill).level(); j++)
for (int j = 0; j < u->skillLevel(thisSkill); j++)
wprintz(w, (i == cur_sk ? hilite(COL_SKILL_USED) : COL_SKILL_USED), "*");
}
}
}
wrefresh(w);
wrefresh(w_description);
switch (input()) {
case 'j':
if (cur_sk < Skill::skills.size() - 1)
@@ -793,15 +747,15 @@ int set_skills(WINDOW* w, player *u, int &points)
currentSkill = Skill::skill(cur_sk);
break;
case 'h':
if (u->skillLevel(currentSkill).level()) {
u->skillLevel(currentSkill).level(u->skillLevel(currentSkill).level() - 2);
points += u->skillLevel(currentSkill).level() + 1;
if (u->skillLevel(currentSkill)) {
u->skillLevel(currentSkill).level(u->skillLevel(currentSkill) - 2);
points += u->skillLevel(currentSkill) + 1;
}
break;
case 'l':
if (points >= u->skillLevel(currentSkill).level() + 1) {
points -= u->skillLevel(currentSkill).level() + 1;
u->skillLevel(currentSkill).level(u->skillLevel(currentSkill).level() + 2);
if (points >= u->skillLevel(currentSkill) + 1) {
points -= u->skillLevel(currentSkill) + 1;
u->skillLevel(currentSkill).level(u->skillLevel(currentSkill) + 2);
}
break;
case '<':
@@ -812,27 +766,10 @@ int set_skills(WINDOW* w, player *u, int &points)
} while (true);
}
int set_description(WINDOW* w, player *u, int &points)
int set_description(WINDOW* w, game* g, player *u, int &points)
{
// Draw horizontal lines, with a gap for the active tab
for (int i = 0; i < 80; i++) {
if (i < 57 || i > 73)
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
mvwputch(w, 4, i, c_ltgray, LINE_OXOX);
mvwputch(w, 21, i, c_ltgray, LINE_OXOX);
}
// Attaching lines for tabs
mvwputch(w, 1,55, h_ltgray, '<');
mvwputch(w, 1,75, h_ltgray, '>');
mvwputch(w, 2, 4, c_ltgray, LINE_XXOX);
mvwputch(w, 2,14, c_ltgray, LINE_XXOX);
mvwputch(w, 2,21, c_ltgray, LINE_XXOX);
mvwputch(w, 2,32, c_ltgray, LINE_XXOX);
mvwputch(w, 2,39, c_ltgray, LINE_XXOX);
mvwputch(w, 2,50, c_ltgray, LINE_XXOX);
mvwputch(w, 2,57, c_ltgray, LINE_XOOX);
mvwputch(w, 2,73, c_ltgray, LINE_XXOO);
mvwprintz(w,1,58, h_ltgray, " DESCRIPTION ");
draw_tabs(w, "DESCRIPTION");
mvwprintz(w, 3, 2, c_ltgray, "Points left: %d ", points);
mvwprintz(w, 6, 2, c_ltgray, "\
@@ -880,10 +817,17 @@ To save this character as a template, press !.");
if (ch == '>') {
if (points > 0)
mvwprintz(w, 3, 2, c_red, "\
Points left: %d You must use the rest of your points!", points);
else if (u->name.size() == 0) {
if (points > 0 && query_yn("Remaining points will be discarded, are you sure you want to proceed?")) {
if (u->name.size() == 0) {
mvwprintz(w, 6, 8, h_ltgray, "______NO NAME ENTERED!!!!_____");
noname = true;
wrefresh(w);
if (query_yn("Are you SURE you're finished? Your name will be randomly generated."))
u->pick_name();
return 1;
} else
return 1;
} else if (u->name.size() == 0) {
mvwprintz(w, 6, 8, h_ltgray, "______NO NAME ENTERED!!!!_____");
noname = true;
wrefresh(w);
+38 -5
View File
@@ -31,6 +31,7 @@ npc::npc()
ity = -1;
goalx = 999;
goaly = 999;
goalz = 999;
fatigue = 0;
hunger = 0;
thirst = 0;
@@ -79,6 +80,7 @@ npc& npc::operator= (const npc & rhs)
ity = rhs.ity;
goalx = rhs.goalx;
goaly = rhs.goaly;
goalz = rhs.goalz;
path = rhs.path;
@@ -178,7 +180,7 @@ std::string npc::save_info()
int(personality.altruism) << " " << wandx << " " << wandy << " " <<
wandf << " " << omx << " " << omy << " " << omz << " " << mapx <<
" " << mapy << " " << plx << " " << ply << " " << goalx << " " <<
goaly << " " << int(mission) << " " << int(flags) << " ";
goaly << " " << goalz << " " << int(mission) << " " << int(flags) << " ";
if (my_fac == NULL)
dump << -1;
else
@@ -280,7 +282,7 @@ void npc::load_info(game *g, std::string data)
// Special NPC stuff
int misstmp, flagstmp, tmpatt, agg, bra, col, alt;
dump >> agg >> bra >> col >> alt >> wandx >> wandy >> wandf >> omx >> omy >>
omz >> mapx >> mapy >> plx >> ply >> goalx >> goaly >> misstmp >>
omz >> mapx >> mapy >> plx >> ply >> goalx >> goaly >> goalz >> misstmp >>
flagstmp >> fac_id >> tmpatt;
personality.aggression = agg;
personality.bravery = bra;
@@ -962,8 +964,8 @@ std::vector<item> starting_inv(npc *me, npc_class type, game *g)
void npc::spawn_at(overmap *o, int x, int y)
{
// First, specify that we are in this overmap!
omx = o->posx;
omy = o->posy;
omx = o->pos().x;
omy = o->pos().y;
mapx = x;
mapy = y;
if (x == -1 || y == -1) {
@@ -1303,6 +1305,37 @@ int npc::player_danger(player *u)
return ret;
}
int npc::vehicle_danger(game *g, int radius)
{
VehicleList vehicles = g->m.get_vehicles(posx - radius, posy - radius, posx + radius, posy + radius);
int danger = 0;
// TODO: check for most dangerous vehicle?
for(size_t i = 0; i < vehicles.size(); ++i)
if (vehicles[i].v->velocity > 0)
{
float facing = vehicles[i].v->face.dir();
int ax = vehicles[i].v->global_x();
int ay = vehicles[i].v->global_y();
int bx = ax + cos (facing * M_PI / 180.0) * radius;
int by = ay + sin (facing * M_PI / 180.0) * radius;
// fake size
int last_part = vehicles[i].v->external_parts.back();
int size = std::max(vehicles[i].v->parts[last_part].mount_dx, vehicles[i].v->parts[last_part].mount_dy);
float normal = sqrt((bx - ax) * (bx - ax) + (by - ay) * (by - ay));
int closest = abs((posx - ax) * (by - ay) - (posy - ay) * (bx - ax)) / normal;
if (size > closest)
danger = i;
}
return danger;
}
bool npc::turned_hostile()
{
return (op_of_u.anger >= hostile_anger_level());
@@ -1950,7 +1983,7 @@ void npc::die(game *g, bool your_fault)
int j;
if (g->u_see(posx, posy, j))
g->add_msg("%s dies!", name.c_str());
if (your_fault && !g->u.has_trait(PF_HEARTLESS)) {
if (your_fault && !g->u.has_trait(PF_CANNIBAL)) {
if (is_friend())
g->u.add_morale(MORALE_KILLED_FRIEND, -500);
else if (!is_enemy())
+14 -7
View File
@@ -62,6 +62,9 @@ enum npc_mission {
NPC_MISSION_MISSING, // Special; following player to finish mission
NPC_MISSION_KIDNAPPED, // Special; was kidnapped, to be rescued by player
NPC_MISSION_BASE, // Base Mission: unassigned
NUM_NPC_MISSIONS
};
@@ -90,9 +93,10 @@ enum npc_action {
npc_escape_item, npc_wield_melee, npc_wield_loaded_gun, npc_wield_empty_gun,
npc_heal, npc_use_painkiller, npc_eat, npc_drop_items, // 5 - 12
npc_flee, npc_melee, npc_shoot, npc_shoot_burst, npc_alt_attack, // 13 - 17
npc_look_for_player, npc_heal_player, npc_follow_player, npc_talk_to_player,
npc_mug_player, // 18 - 22
npc_goto_destination, npc_avoid_friendly_fire, // 23, 24
npc_look_for_player, npc_heal_player, npc_follow_player, npc_follow_embarked,
npc_talk_to_player, npc_mug_player, // 18 - 23
npc_goto_destination, npc_avoid_friendly_fire, // 24, 25
npc_base_idle, // 26
num_npc_actions
};
@@ -255,25 +259,27 @@ struct npc_combat_rules
combat_engagement engagement;
bool use_guns;
bool use_grenades;
bool use_silent;
npc_combat_rules()
{
engagement = ENGAGE_ALL;
use_guns = true;
use_grenades = true;
use_silent = false;
};
std::string save_info()
{
std::stringstream dump;
dump << engagement << " " << use_guns << " " << use_grenades << " ";
dump << engagement << " " << use_guns << " " << use_grenades << " " << use_silent;
return dump.str();
}
void load_info(std::istream &data)
{
int tmpen;
data >> tmpen >> use_guns >> use_grenades;
data >> tmpen >> use_guns >> use_grenades >> use_silent;
engagement = combat_engagement(tmpen);
}
};
@@ -431,6 +437,7 @@ public:
void form_opinion(player *u);
talk_topic pick_talk_topic(player *u);
int player_danger(player *u); // Comparable to monsters
int vehicle_danger(game *g, int radius);
bool turned_hostile(); // True if our anger is at least equal to...
int hostile_anger_level(); // ... this value!
void make_angry(); // Called if the player attacks us
@@ -497,7 +504,7 @@ public:
// Functions which choose an action for a particular goal
void choose_monster_target(game *g, int &enemy, int &danger,
int &total_danger);
npc_action method_of_fleeing (game *g, int enemy);
npc_action method_of_fleeing (game *g, int target);
npc_action method_of_attack (game *g, int enemy, int danger);
npc_action address_needs (game *g, int danger);
npc_action address_player (game *g);
@@ -562,7 +569,7 @@ public:
int mapx, mapy;// Which square in that overmap (e.g., m.0.0)
int plx, ply, plt;// Where we last saw the player, timeout to forgetting
int itx, ity; // The square containing an item we want
int goalx, goaly;// Which mapx:mapy square we want to get to
int goalx, goaly, goalz;// Which mapx:mapy square we want to get to
bool fetching_item;
bool has_new_items; // If true, we have something new and should re-equip
+103 -19
View File
@@ -29,6 +29,8 @@ itype_id ALT_ATTACK_ITEMS[NUM_ALT_ATTACK_ITEMS] = {
};
#endif
const int avoidance_vehicles_radius = 5;
std::string npc_action_name(npc_action action);
bool thrown_item(item *used);
@@ -63,7 +65,20 @@ void npc::move(game *g)
}
// TODO: Place player-aiding actions here, with a weight
/* NPCs are fairly suicidal so at this point we will do a quick check to see if
* something nasty is going to happen.
*/
int vehicle = vehicle_danger(g, avoidance_vehicles_radius);
if (vehicle) {
// TODO: Think about how this actually needs to work, for now assume flee from player
target = TARGET_PLAYER;
}
// TODO: morale breaking when surrounded by hostiles
//if (!bravery_check(danger) || !bravery_check(total_danger) ||
// TODO: near by active explosives spotted
if (target == TARGET_PLAYER && attitude == NPCATT_FLEE)
action = method_of_fleeing(g, target);
else if (danger > 0 || (target == TARGET_PLAYER && attitude == NPCATT_KILL))
@@ -86,7 +101,10 @@ void npc::move(game *g)
find_item(g);
if (g->debugmon)
debugmsg("find_item %s", npc_action_name(action).c_str());
if (fetching_item) // Set to true if find_item() found something
// check if in vehicle before rushing off to fetch things
if (is_following() && g->u.in_vehicle)
action = npc_follow_embarked;
else if (fetching_item) // Set to true if find_item() found something
action = npc_pickup;
else if (is_following()) // No items, so follow the player?
action = npc_follow_player;
@@ -100,9 +118,15 @@ void npc::move(game *g)
/* Sometimes we'll be following the player at this point, but close enough that
* "following" means standing still. If that's the case, if there are any
* monsters around, we should attack them after all!
*
* If we are following a embarked player and we are in a vehicle then shoot anyway
* as we are most likely riding shotgun
*/
if (action == npc_follow_player && danger > 0 &&
rl_dist(posx, posy, g->u.posx, g->u.posy) <= follow_distance())
if (danger > 0 && (
(action == npc_follow_embarked && in_vehicle) ||
(action == npc_follow_player &&
rl_dist(posx, posy, g->u.posx, g->u.posy) <= follow_distance())
))
action = method_of_attack(g, target, danger);
if (g->debugmon)
@@ -289,6 +313,39 @@ void npc::execute_action(game *g, npc_action action, int target)
move_pause();
break;
case npc_follow_embarked:
if (in_vehicle)
move_pause();
else {
int p1;
vehicle *veh = g->m.veh_at(g->u.posx, g->u.posy, p1);
if (!veh) {
debugmsg("Following an embarked player with no vehicle at their location?");
// TODO: change to wait? - for now pause
move_pause();
} else {
int p2 = veh->free_seat();
if (p2 < 0) {
// TODO: be angry at player, switch to wait or leave - for now pause
move_pause();
} else {
int px = veh->global_x() + veh->parts[p2].precalc_dx[0];
int py = veh->global_y() + veh->parts[p2].precalc_dy[0];
update_path(g, px, py);
// TODO: replace extra hop distance with finding the correct door
// Hop in the last few squares is mostly to avoid player clash
if (path.size() <= 2) {
g->m.board_vehicle(g, px, py, this);
move_pause();
} else
move_to_next(g);
}
}
}
break;
case npc_talk_to_player:
talk_to_u(g);
moves = 0;
@@ -312,6 +369,11 @@ void npc::execute_action(game *g, npc_action action, int target)
avoid_friendly_fire(g, target);
break;
case npc_base_idle:
// TODO: patrol or sleep or something?
move_pause();
break;
default:
debugmsg("Unknown NPC action (%d)", action);
}
@@ -349,7 +411,7 @@ void npc::choose_monster_target(game *g, int &enemy, int &danger,
priority -= 10;
monster_danger -= 10;
} else
priority *= 1 + (.1 * distance);
priority *= 1 + (.1 *use_escape_item distance);
*/
total_danger += int(monster_danger / (distance == 0 ? 1 : distance));
@@ -421,6 +483,7 @@ npc_action npc::method_of_attack(game *g, int target, int danger)
{
int tarx = posx, tary = posy;
bool can_use_gun = (!is_following() || combat_rules.use_guns);
bool use_silent = (is_following() && combat_rules.use_silent);
if (target == TARGET_PLAYER) {
tarx = g->u.posx;
@@ -444,16 +507,24 @@ npc_action npc::method_of_attack(game *g, int target, int danger)
return npc_reload;
if (emergency(danger_assessment(g)) && alt_attack_available(g))
return npc_alt_attack;
if (weapon.is_gun() && weapon.charges > 0) {
if (weapon.is_gun() && (!use_silent || weapon.is_silent()) && weapon.charges > 0) {
it_gun* gun = dynamic_cast<it_gun*>(weapon.type);
if (dist > confident_range()) {
if (can_reload() && enough_time_to_reload(g, target, weapon))
if (can_reload() && (enough_time_to_reload(g, target, weapon) || in_vehicle))
return npc_reload;
else if (in_vehicle && dist > 1)
return npc_pause;
else
return npc_melee;
}
if (!wont_hit_friend(g, tarx, tary))
return npc_avoid_friendly_fire;
if (in_vehicle)
if (can_reload())
return npc_reload;
else
return npc_pause; // wait for clear shot
else
return npc_avoid_friendly_fire;
else if (dist <= confident_range() / 3 && weapon.charges >= gun->burst &&
gun->burst > 1 &&
((weapon.curammo && target_HP >= weapon.curammo->damage * 3) || emergency(danger * 2)))
@@ -467,10 +538,10 @@ npc_action npc::method_of_attack(game *g, int target, int danger)
bool has_empty_gun = false, has_better_melee = false;
std::vector<int> empty_guns;
for (int i = 0; i < inv.size(); i++) {
if (can_use_gun && inv[i].is_gun() && inv[i].charges > 0)
bool allowed = can_use_gun && inv[i].is_gun() && (!use_silent || weapon.is_silent());
if (allowed && inv[i].charges > 0)
return npc_wield_loaded_gun;
else if (can_use_gun && inv[i].is_gun() &&
enough_time_to_reload(g, target, inv[i])) {
else if (allowed && enough_time_to_reload(g, target, inv[i])) {
has_empty_gun = true;
empty_guns.push_back(i);
} else if (inv[i].melee_value(sklevel) > weapon.melee_value(sklevel) * 1.1)
@@ -491,6 +562,8 @@ npc_action npc::method_of_attack(game *g, int target, int danger)
else if (has_better_melee)
return npc_wield_melee;
if (in_vehicle && dist > 1)
return npc_pause;
return npc_melee;
}
@@ -597,6 +670,8 @@ npc_action npc::long_term_goal_action(game *g)
// TODO: Follow / look for player
if (mission == NPC_MISSION_BASE)
return npc_base_idle;
if (!has_destination())
set_destination(g);
@@ -692,13 +767,13 @@ int npc::confident_range(int index)
// See game::fire (ranged.cpp) for where these computations come from
if (skillLevel(firing->skill_used) < 5)
deviation += 3.5 * (5 - skillLevel(firing->skill_used).level());
deviation += 3.5 * (5 - skillLevel(firing->skill_used));
else
deviation -= 2.5 * (skillLevel(firing->skill_used).level() - 5);
deviation -= 2.5 * (skillLevel(firing->skill_used) - 5);
if (sklevel[sk_gun] < 3)
deviation += 1.5 * (3 - skillLevel("gun").level());
deviation += 1.5 * (3 - skillLevel("gun"));
else
deviation -= .5 * (skillLevel("gun").level() - 3);
deviation -= .5 * (skillLevel("gun") - 3);
if (per_cur < 8)
deviation += 2 * (9 - per_cur);
@@ -862,6 +937,11 @@ bool npc::can_move_to(game *g, int x, int y)
void npc::move_to(game *g, int x, int y)
{
if (in_vehicle) {
// TODO: handle this nicely - npcs should not jump from moving vehicles
g->m.unboard_vehicle(g, posx, posy);
}
if (has_disease(DI_DOWNED)) {
moves -= 100;
return;
@@ -1318,15 +1398,17 @@ void npc::drop_items(game *g, int weight, int volume)
npc_action npc::scan_new_items(game *g, int target)
{
bool can_use_gun = (!is_following() || combat_rules.use_guns);
bool can_use_gun = (!is_following() || combat_rules.use_guns);
bool use_silent = (is_following() && combat_rules.use_silent);
// Check if there's something better to wield
bool has_empty_gun = false, has_better_melee = false;
std::vector<int> empty_guns;
for (int i = 0; i < inv.size(); i++) {
if (can_use_gun && inv[i].is_gun() && inv[i].charges > 0)
bool allowed = can_use_gun && inv[i].is_gun() && (!use_silent || inv[i].is_silent());
if (allowed && inv[i].charges > 0)
return npc_wield_loaded_gun;
else if (can_use_gun && inv[i].is_gun() &&
enough_time_to_reload(g, target, inv[i])) {
else if (allowed && enough_time_to_reload(g, target, inv[i])) {
has_empty_gun = true;
empty_guns.push_back(i);
} else if (inv[i].melee_value(sklevel) > weapon.melee_value(sklevel) * 1.1)
@@ -1885,7 +1967,7 @@ void npc::set_destination(game *g)
// all of the following luxuries are at ground level.
// so please wallow in hunger & fear if below ground.
if(g->cur_om.posz != 0){
if(g->levz != 0){
goalx = -1;
goaly = -1;
return;
@@ -1924,6 +2006,7 @@ void npc::set_destination(game *g)
point p = g->cur_om.find_closest(point(mapx, mapy),dest_type,4, dist, false);
goalx = p.x;
goaly = p.y;
goalz = g->levz;
}
void npc::go_to_destination(game *g)
@@ -1987,6 +2070,7 @@ std::string npc_action_name(npc_action action)
case npc_look_for_player: return "Look for player";
case npc_heal_player: return "Heal player";
case npc_follow_player: return "Follow player";
case npc_follow_embarked: return "Follow player (embarked)";
case npc_talk_to_player: return "Talk to player";
case npc_mug_player: return "Mug player";
case npc_goto_destination: return "Go to destination";
+59 -11
View File
@@ -5,6 +5,7 @@
#include "rng.h"
#include "line.h"
#include "keypress.h"
#include "debug.h"
#include <vector>
#include <string>
#include <sstream>
@@ -41,6 +42,8 @@
#define SUCCESS_MISSION(type) ret.back().miss = type
#define dbg(x) dout((DebugLevel)(x),D_GAME) << __FILE__ << ":" << __LINE__ << ": "
std::string dynamic_line(talk_topic topic, game *g, npc *p);
std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p);
int topic_category(talk_topic topic);
@@ -103,7 +106,7 @@ void npc::talk_to_u(game *g)
moves -= 100;
decide_needs();
d.win = newwin(25, 80, 0, 0);
d.win = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
wborder(d.win, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
for (int i = 1; i < 24; i++)
@@ -233,7 +236,7 @@ std::string dynamic_line(talk_topic topic, game *g, npc *p)
} break;
case TALK_TRAIN_START:
if (g->cur_om.is_safe(g->om_location().x, g->om_location().y))
if (g->cur_om.is_safe(g->om_location().x, g->om_location().y, g->levz))
return "Alright, let's begin.";
else
return "It's not safe here. Let's get to safety first.";
@@ -297,7 +300,8 @@ std::string dynamic_line(talk_topic topic, game *g, npc *p)
case ENGAGE_ALL: status << "engaging all enemies."; break;
}
status << " " << (p->male ? "He" : "She") << " will " <<
(p->combat_rules.use_guns ? "" : "not ") << "use firearms.";
(p->combat_rules.use_guns ? (p->combat_rules.use_silent ? "use silenced" : "use")
: "not use") << " firearms";
status << " " << (p->male ? "He" : "She") << " will " <<
(p->combat_rules.use_grenades ? "" : "not ") << "use grenades.";
@@ -661,6 +665,14 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
int score = p->op_of_u.trust + p->op_of_u.value * 3 +
p->personality.altruism * 2;
int missions_value = p->assigned_missions_value(g);
if (g->u.has_amount(itm_mininuke, 1)) {
RESPONSE("Because I'm holding a thermal detonator!");
SUCCESS(TALK_GIVE_EQUIPMENT);
SUCCESS_ACTION(&talk_function::give_equipment);
SUCCESS_OPINION(0, 0, -1, 0, score * 300);
FAILURE(TALK_DENY_EQUIPMENT);
FAILURE_OPINION(0, 0, -1, 0, 0);
}
RESPONSE("Because I'm your friend!");
TRIAL(TALK_TRIAL_PERSUADE, 10 + score);
SUCCESS(TALK_GIVE_EQUIPMENT);
@@ -732,6 +744,7 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
if (trainable.empty() && styles.empty()) {
RESPONSE("Oh, okay."); // Nothing to learn here
SUCCESS(TALK_NONE);
break;
}
int printed = 0;
int shift = p->chatbin.tempvalue;
@@ -772,7 +785,7 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
} break;
case TALK_TRAIN_START:
if (g->cur_om.is_safe(g->om_location().x, g->om_location().y)) {
if (g->cur_om.is_safe(g->om_location().x, g->om_location().y, g->levz)) {
RESPONSE("Sounds good.");
SUCCESS(TALK_DONE);
SUCCESS_ACTION(&talk_function::start_training);
@@ -927,6 +940,11 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
RESPONSE("Let's trade items.");
SUCCESS(TALK_NONE);
SUCCESS_ACTION(&talk_function::start_trade);
if (p->is_following() && g->m.camp_at(g->u.posx, g->u.posy)) {
RESPONSE("Wait at this base,");
SUCCESS(TALK_DONE);
SUCCESS_ACTION(&talk_function::assign_base);
}
RESPONSE("Let's go.");
SUCCESS(TALK_DONE);
break;
@@ -943,6 +961,15 @@ std::vector<talk_response> gen_responses(talk_topic topic, game *g, npc *p)
SUCCESS(TALK_COMBAT_COMMANDS);
SUCCESS_ACTION(&talk_function::toggle_use_guns);
}
if (p->combat_rules.use_silent) {
RESPONSE("Don't worry about noise.");
SUCCESS(TALK_COMBAT_COMMANDS);
SUCCESS_ACTION(&talk_function::toggle_use_silent);
} else {
RESPONSE("Use only silent weapons.");
SUCCESS(TALK_COMBAT_COMMANDS);
SUCCESS_ACTION(&talk_function::toggle_use_silent);
}
if (p->combat_rules.use_grenades) {
RESPONSE("Don't use grenades anymore.");
SUCCESS(TALK_COMBAT_COMMANDS);
@@ -1286,6 +1313,20 @@ void talk_function::start_trade(game *g, npc *p)
trade(g, p, trade_amount, "Trade");
}
void talk_function::assign_base(game *g, npc *p)
{
// TODO: decide what to do upon assign? maybe pathing required
basecamp* camp = g->m.camp_at(g->u.posx, g->u.posy);
if(!camp) {
dbg(D_ERROR) << "talk_function::assign_base: Assigned to base but no base here.";
return;
}
g->add_msg("%s waits at %s", p->name.c_str(), camp->camp_name().c_str());
p->mission = NPC_MISSION_BASE;
p->attitude = NPCATT_NULL;
}
void talk_function::give_equipment(game *g, npc *p)
{
std::vector<int> giving;
@@ -1392,6 +1433,7 @@ void talk_function::lead_to_safety(game *g, npc *p)
point target = g->find_mission( missid )->target;
p->goalx = target.x;
p->goaly = target.y;
p->goalz = g->levz;
p->attitude = NPCATT_LEAD;
}
@@ -1400,6 +1442,11 @@ void talk_function::toggle_use_guns(game *g, npc *p)
p->combat_rules.use_guns = !p->combat_rules.use_guns;
}
void talk_function::toggle_use_silent(game *g, npc *p)
{
p->combat_rules.use_silent = !p->combat_rules.use_silent;
}
void talk_function::toggle_use_grenades(game *g, npc *p)
{
p->combat_rules.use_grenades = !p->combat_rules.use_grenades;
@@ -1441,8 +1488,8 @@ void talk_function::start_training(game *g, npc *p)
time = 30000;
} else {
sk_used = skill(p->chatbin.tempvalue);
cost = -200 * (1 + g->u.skillLevel(Skill::skill(sk_used)).level());
time = 10000 + 5000 * g->u.skillLevel(Skill::skill(sk_used)).level();
cost = -200 * (1 + g->u.skillLevel(Skill::skill(sk_used)));
time = 10000 + 5000 * g->u.skillLevel(Skill::skill(sk_used));
}
// Pay for it
@@ -1451,7 +1498,7 @@ void talk_function::start_training(game *g, npc *p)
else if (!trade(g, p, cost, "Pay for training:"))
return;
// Then receive it
g->u.assign_activity(ACT_TRAIN, time, p->chatbin.tempvalue);
g->u.assign_activity(g, ACT_TRAIN, time, p->chatbin.tempvalue);
}
void parse_tags(std::string &phrase, player *u, npc *me)
@@ -1679,9 +1726,10 @@ talk_topic special_talk(char ch)
bool trade(game *g, npc *p, int cost, std::string deal)
{
WINDOW* w_head = newwin( 4, 80, 0, 0);
WINDOW* w_them = newwin(21, 40, 4, 0);
WINDOW* w_you = newwin(21, 40, 4, 40);
WINDOW* w_head = newwin(4, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
WINDOW* w_them = newwin(21, 40, 4+((TERMY > 25) ? (TERMY-25)/2 : 0), (TERMX > 80) ? (TERMX-80)/2 : 0);
WINDOW* w_you = newwin(21, 40, 4+((TERMY > 25) ? (TERMY-25)/2 : 0), 40+((TERMX > 80) ? (TERMX-80)/2 : 0));
WINDOW* w_tmp;
mvwprintz(w_head, 0, 0, c_white, "\
Trading with %s\n\
@@ -1809,7 +1857,7 @@ Tab key to switch lists, letters to pick items, Enter to finalize, Esc to quit\n
break;
case '?':
update = true;
w_tmp = newwin(3, 21, 1, 30);
w_tmp = newwin(3, 21, 1+(TERMY-25)/2, 30+(TERMX-80)/2);
mvwprintz(w_tmp, 1, 1, c_red, "Examine which item?");
wborder(w_tmp, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
+59 -62
View File
@@ -13,10 +13,6 @@
#define OMAPX 180
#define OMAPY 180
#define TUTORIAL_Z 10
#define DEFENSE_Z 20
#define NETHER_Z 30
class overmap;
struct oter_t {
@@ -268,7 +264,7 @@ const oter_t oterlist[num_ter_types] = {
{"mansion", 'M', c_ltgreen, 5, build_extras, false, false},
{"mansion", 'M', c_green, 5, build_extras, false, false},
{"fema camp", '+', c_blue, 5, build_extras, false, false},
{"fema camp", 'F', i_blue, 5, build_extras, false, false}, //Oddzball- Added fema graphic
{"fema camp", 'F', i_blue, 5, build_extras, false, false},
{"evac shelter", '+', c_white, 2, no_extras, true, false},
{"evac shelter", '+', c_white, 2, no_extras, false, true},
{"LMOE shelter", '+', c_red, 2, no_extras, true, false},
@@ -373,19 +369,20 @@ OMS_FLAG_BIG, // As big as possible
OMS_FLAG_ROAD, // Add a road_point here; connect to towns etc.
OMS_FLAG_PARKING_LOT, // Add a road_point to the north of here
OMS_FLAG_DIRT_LOT, // Dirt lot flag for specials
OMS_FLAG_CLASSIC, // Allow this location to spawn in classic mode
NUM_OMS_FLAGS
};
struct omspec_place
{
// Able functions - true if p is valid
bool never (overmap *om, point p) { return false; }
bool always (overmap *om, point p) { return true; }
bool water (overmap *om, point p); // Only on rivers
bool land (overmap *om, point p); // Only on land (no rivers)
bool forest (overmap *om, point p); // Forest
bool wilderness (overmap *om, point p); // Forest or fields
bool by_highway (overmap *om, point p); // Next to existing highways
bool never (overmap *om, tripoint p) { return false; }
bool always (overmap *om, tripoint p) { return true; }
bool water (overmap *om, tripoint p); // Only on rivers
bool land (overmap *om, tripoint p); // Only on land (no rivers)
bool forest (overmap *om, tripoint p); // Forest
bool wilderness (overmap *om, tripoint p); // Forest or fields
bool by_highway (overmap *om, tripoint p); // Next to existing highways
};
struct overmap_special
@@ -396,13 +393,13 @@ struct overmap_special
int min_dist_from_city;// Min distance from city limits
int max_dist_from_city;// Max distance from city limits
moncat_id monsters; // Type of monsters that appear here
std::string monsters; // Type of monsters that appear here
int monster_pop_min; // Minimum monster population
int monster_pop_max; // Maximum monster population
int monster_rad_min; // Minimum monster radius
int monster_rad_max; // Maximum monster radius
bool (omspec_place::*able) (overmap *om, point p); // See above
bool (omspec_place::*able) (overmap *om, tripoint p); // See above
unsigned flags : NUM_OMS_FLAGS; // See above
};
@@ -445,95 +442,95 @@ enum omspec_id
const overmap_special overmap_specials[NUM_OMSPECS] = {
// Terrain MIN MAX DISTANCE
{ot_crater, 0, 10, 0, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::land, mfb(OMS_FLAG_BLOB)},
{ot_crater, 0, 10, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::land, mfb(OMS_FLAG_BLOB) | mfb(OMS_FLAG_CLASSIC)},
{ot_hive, 0, 50, 10, -1, mcat_bee, 20, 60, 2, 4,
{ot_hive, 0, 50, 10, -1, "GROUP_BEE", 20, 60, 2, 4,
&omspec_place::forest, mfb(OMS_FLAG_3X3)},
{ot_house_north, 0,100, 0, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_ROTATE_ROAD)},
{ot_house_north, 0,100, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_ROTATE_ROAD) | mfb(OMS_FLAG_CLASSIC)},
{ot_s_gas_north, 0,100, 0, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_ROTATE_ROAD)},
{ot_s_gas_north, 0,100, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_ROTATE_ROAD) | mfb(OMS_FLAG_CLASSIC)},
{ot_cabin, 0, 30, 20, -1, mcat_null, 0, 0, 0, 0, // Woods cabin
{ot_cabin, 0, 30, 20, -1, "GROUP_NULL", 0, 0, 0, 0, // Woods cabin
&omspec_place::forest, mfb(OMS_FLAG_CLASSIC)},
{ot_lmoe, 0, 3, 20, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::land, mfb(OMS_FLAG_CLASSIC)},
{ot_farm, 0, 20, 20, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::wilderness, mfb(OMS_FLAG_3X3_SECOND) |mfb(OMS_FLAG_DIRT_LOT) | mfb(OMS_FLAG_CLASSIC)},
{ot_temple_stairs, 0, 3, 20, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::forest, 0},
{ot_lmoe, 0, 3, 20, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::land, 0},
{ot_farm, 0, 20, 20, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::wilderness, mfb(OMS_FLAG_3X3_SECOND) |mfb(OMS_FLAG_DIRT_LOT)},
{ot_temple_stairs, 0, 3, 20, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::forest, 0},
{ot_lab_stairs, 0, 30, 8, -1, mcat_null, 0, 0, 0, 0,
{ot_lab_stairs, 0, 30, 8, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::land, mfb(OMS_FLAG_ROAD)},
{ot_fema_entrance, 0, 5, 8, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::land, mfb(OMS_FLAG_3X3_SECOND)}, //Oddzball-Fema test
{ot_fema_entrance, 0, 5, 8, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::land, mfb(OMS_FLAG_3X3_SECOND) | mfb(OMS_FLAG_CLASSIC)},
// Terrain MIN MAX DISTANCE
{ot_bunker, 2, 10, 4, -1, mcat_null, 0, 0, 0, 0,
{ot_bunker, 2, 10, 4, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::land, mfb(OMS_FLAG_ROAD)},
{ot_outpost, 0, 10, 4, -1, mcat_null, 0, 0, 0, 0,
{ot_outpost, 0, 10, 4, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::wilderness, 0},
{ot_silo, 0, 1, 30, -1, mcat_null, 0, 0, 0, 0,
{ot_silo, 0, 1, 30, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::wilderness, mfb(OMS_FLAG_ROAD)},
{ot_radio_tower, 1, 5, 0, 20, mcat_null, 0, 0, 0, 0,
&omspec_place::by_highway, 0},
{ot_radio_tower, 1, 5, 0, 20, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_CLASSIC)},
{ot_mansion_entrance, 0, 8, 0, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND)},
{ot_mansion_entrance, 0, 8, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND) | mfb(OMS_FLAG_CLASSIC)},
{ot_mansion_entrance, 0, 4, 10, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::wilderness, mfb(OMS_FLAG_3X3_SECOND)},
{ot_mansion_entrance, 0, 4, 10, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::wilderness, mfb(OMS_FLAG_3X3_SECOND) | mfb(OMS_FLAG_CLASSIC)},
{ot_megastore_entrance, 0, 5, 0, 10, mcat_null, 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND)},
{ot_megastore_entrance, 0, 5, 0, 10, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND) | mfb(OMS_FLAG_CLASSIC)},
{ot_hospital_entrance, 1, 5, 3, 15, mcat_null, 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND)},
{ot_hospital_entrance, 1, 5, 3, 15, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::by_highway, mfb(OMS_FLAG_3X3_SECOND) | mfb(OMS_FLAG_CLASSIC)},
{ot_sewage_treatment, 1, 5, 10, 20, mcat_null, 0, 0, 0, 0,
&omspec_place::land, mfb(OMS_FLAG_PARKING_LOT)},
{ot_sewage_treatment, 1, 5, 10, 20, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::land, mfb(OMS_FLAG_PARKING_LOT) | mfb(OMS_FLAG_CLASSIC)},
{ot_mine_entrance, 0, 5, 15, -1, mcat_null, 0, 0, 0, 0,
{ot_mine_entrance, 0, 5, 15, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::wilderness, mfb(OMS_FLAG_PARKING_LOT)},
// Terrain MIN MAX DISTANCE
{ot_anthill, 0, 30, 10, -1, mcat_ant, 10, 30, 1000, 2000,
{ot_anthill, 0, 30, 10, -1, "GROUP_ANT", 10, 30, 1000, 2000,
&omspec_place::wilderness, 0},
{ot_spider_pit, 0,500, 0, -1, mcat_null, 0, 0, 0, 0,
{ot_spider_pit, 0,500, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::forest, 0},
{ot_slimepit, 0, 4, 0, -1, mcat_goo, 2, 10, 100, 200,
{ot_slimepit, 0, 4, 0, -1, "GROUP_GOO", 2, 10, 100, 200,
&omspec_place::land, 0},
{ot_fungal_bloom, 0, 3, 5, -1, mcat_fungi, 600, 1200, 30, 50,
{ot_fungal_bloom, 0, 3, 5, -1, "GROUP_FUNGI", 600, 1200, 30, 50,
&omspec_place::wilderness, 0},
{ot_triffid_grove, 0, 4, 0, -1, mcat_triffid, 800, 1300, 12, 20,
{ot_triffid_grove, 0, 4, 0, -1, "GROUP_TRIFFID", 800, 1300, 12, 20,
&omspec_place::forest, 0},
{ot_river_center, 0, 10, 10, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::always, mfb(OMS_FLAG_BLOB)},
{ot_river_center, 0, 10, 10, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::always, mfb(OMS_FLAG_BLOB) | mfb(OMS_FLAG_CLASSIC)},
// Terrain MIN MAX DISTANCE
{ot_shelter, 5, 10, 5, 10, mcat_null, 0, 0, 0, 0,
&omspec_place::wilderness, mfb(OMS_FLAG_ROAD)},
{ot_shelter, 5, 10, 5, 10, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::wilderness, mfb(OMS_FLAG_ROAD) | mfb(OMS_FLAG_CLASSIC)},
{ot_cave, 0, 30, 0, -1, mcat_null, 0, 0, 0, 0,
{ot_cave, 0, 30, 0, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::wilderness, 0},
{ot_toxic_dump, 0, 5, 15, -1, mcat_null, 0, 0, 0, 0,
&omspec_place::wilderness,0}
{ot_toxic_dump, 0, 5, 15, -1, "GROUP_NULL", 0, 0, 0, 0,
&omspec_place::wilderness, mfb(OMS_FLAG_CLASSIC)}
};
+185 -10
View File
@@ -1,6 +1,9 @@
#include "game.h"
#include "options.h"
#include "output.h"
#include "keypress.h"
#include <stdlib.h>
#include <fstream>
#include <string>
@@ -11,6 +14,120 @@ bool option_is_bool(option_key id);
void create_default_options();
std::string options_header();
void game::show_options()
{
WINDOW* w_options_border = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
WINDOW* w_options = newwin(23, 78, 1 + ((TERMY > 25) ? (TERMY-25)/2 : 0), 1 + ((TERMX > 80) ? (TERMX-80)/2 : 0));
int offset = 1;
int line = 0;
char ch = ' ';
bool changed_options = false;
bool needs_refresh = true;
do {
wborder(w_options_border, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX);
mvwprintz(w_options_border, 0, 36, c_ltred, " OPTIONS ");
wrefresh(w_options_border);
// TODO: change instructions
if (needs_refresh) {
werase(w_options);
mvwprintz(w_options, 0, 40, c_white, "Use up/down keys to scroll through");
mvwprintz(w_options, 1, 40, c_white, "available options.");
mvwprintz(w_options, 2, 40, c_white, "Use left/right keys to toggle.");
mvwprintz(w_options, 3, 40, c_white, "Press ESC or q to return. ");
// highlight options for option descriptions
std::string tmp = option_desc(option_key(offset + line));
std::string out;
size_t pos;
int displayline = 5;
do {
pos = tmp.find_first_of('\n');
out = tmp.substr(0, pos);
mvwprintz(w_options, displayline, 40, c_white, out.c_str());
tmp = tmp.substr(pos + 1);
displayline++;
} while (pos != std::string::npos && displayline < 12);
needs_refresh = false;
}
// Clear the lines
for (int i = 0; i < 25; i++)
mvwprintz(w_options, i, 0, c_black, " ");
int valid_option_count = 0;
// display options
for (int i = 0; i < 25 && offset + i < NUM_OPTION_KEYS; i++)
{
valid_option_count++;
mvwprintz(w_options, i, 0, c_white, "%s: ",
option_name( option_key(offset + i) ).c_str());
if (option_is_bool(option_key(offset + i)))
{
bool on = OPTIONS[ option_key(offset + i) ];
if (i == line)
mvwprintz(w_options, i, 30, hilite(c_ltcyan), (on ? "True" : "False"));
else
mvwprintz(w_options, i, 30, (on ? c_ltgreen : c_ltred), (on ? "True" : "False"));
} else {
char option_val = OPTIONS[ option_key(offset + i) ];
if (i == line)
mvwprintz(w_options, i, 30, hilite(c_ltcyan), "%d", option_val );
else
mvwprintz(w_options, i, 30, c_ltgreen, "%d", option_val );
}
}
wrefresh(w_options);
refresh();
ch = input();
needs_refresh = true;
refresh();
switch (ch) {
// move up and down
case 'j':
line++;
if (line == NUM_OPTION_KEYS - 1)
line = 0;
break;
case 'k':
line--;
if (line < 0)
line = NUM_OPTION_KEYS - 2;
break;
// toggle options with left/right keys
case 'h':
if (option_is_bool(option_key(offset + line)))
OPTIONS[ option_key(offset + line) ] = !(OPTIONS[ option_key(offset + line) ]);
else
{
OPTIONS[ option_key(offset + line) ]--;
if ((OPTIONS[ option_key(offset + line) ]) < 0 )
OPTIONS[ option_key(offset + line) ] = option_max_options(option_key(offset + line)) - 1;
}
changed_options = true;
break;
case 'l':
if (option_is_bool(option_key(offset + line)))
OPTIONS[ option_key(offset + line) ] = !(OPTIONS[ option_key(offset + line) ]);
else
{
OPTIONS[ option_key(offset + line) ]++;
if ((OPTIONS[ option_key(offset + line) ]) >= option_max_options(option_key(offset + line)))
OPTIONS[ option_key(offset + line) ] = 0;
}
changed_options = true;
break;
}
} while (ch != 'q' && ch != 'Q' && ch != KEY_ESCAPE);
if (changed_options && query_yn("Save changes?"))
save_options();
werase(w_options);
}
void load_options()
{
std::ifstream fin;
@@ -45,8 +162,15 @@ void load_options()
else
OPTIONS[key] = 0.;
} else {
std::string check;
double val;
fin >> val;
fin >> check;
if (check == "T" || check == "F")
val = (check == "T") ? 1.: 0.;
else
val = atoi(check.c_str());
OPTIONS[key] = val;
}
}
@@ -72,8 +196,12 @@ option_key lookup_option_key(std::string id)
return OPT_SNAP_TO_TARGET;
if (id == "safemode")
return OPT_SAFEMODE;
if (id == "safemodeproximity")
return OPT_SAFEMODEPROXIMITY;
if (id == "autosafemode")
return OPT_AUTOSAFEMODE;
if (id == "autosafemodeturns")
return OPT_AUTOSAFEMODETURNS;
if (id == "autosave")
return OPT_AUTOSAVE;
if (id == "gradual_night_light")
@@ -88,10 +216,16 @@ option_key lookup_option_key(std::string id)
return OPT_DELETE_WORLD;
if (id == "initial_points")
return OPT_INITIAL_POINTS;
if(id == "initial_time")
return OPT_INITIAL_TIME;
if (id == "viewport_x")
return OPT_VIEWPORT_X;
if (id == "viewport_y")
return OPT_VIEWPORT_Y;
if (id == "static_spawn")
return OPT_STATIC_SPAWN;
if (id == "classic_zombies")
return OPT_CLASSIC_ZOMBIES;
return OPT_NULL;
}
@@ -105,7 +239,9 @@ std::string option_string(option_key key)
case OPT_24_HOUR: return "24_hour";
case OPT_SNAP_TO_TARGET: return "snap_to_target";
case OPT_SAFEMODE: return "safemode";
case OPT_SAFEMODEPROXIMITY: return "safemodeproximity";
case OPT_AUTOSAFEMODE: return "autosafemode";
case OPT_AUTOSAFEMODETURNS: return "autosafemodeturns";
case OPT_AUTOSAVE: return "autosave";
case OPT_GRADUAL_NIGHT_LIGHT: return "gradual_night_light";
case OPT_QUERY_DISASSEMBLE: return "query_disassemble";
@@ -113,8 +249,11 @@ std::string option_string(option_key key)
case OPT_SKILL_RUST: return "skill_rust";
case OPT_DELETE_WORLD: return "delete_world";
case OPT_INITIAL_POINTS: return "initial_points";
case OPT_INITIAL_TIME: return "initial_time";
case OPT_VIEWPORT_X: return "viewport_x";
case OPT_VIEWPORT_Y: return "viewport_y";
case OPT_STATIC_SPAWN: return "static_spawn";
case OPT_CLASSIC_ZOMBIES: return "classic_zombies";
default: return "unknown_option";
}
return "unknown_option";
@@ -127,10 +266,12 @@ std::string option_desc(option_key key)
case OPT_USE_METRIC_SYS: return "If true, use Km/h not mph";
case OPT_FORCE_YN: return "If true, y/n prompts are case-sensitive\nand y and n are not accepted";
case OPT_NO_CBLINK: return "If true, bright backgrounds are not\nused--some consoles are not compatible";
case OPT_24_HOUR: return "If true, use military time, not AM/PM";
case OPT_24_HOUR: return "12h/24h Time:\n0 - AM/PM\n1 - 24h military\n2 - 24h normal";
case OPT_SNAP_TO_TARGET: return "If true, automatically follow the\ncrosshair when firing/throwing";
case OPT_SAFEMODE: return "If true, safemode will be on after\nstarting a new game or loading";
case OPT_SAFEMODEPROXIMITY: return "If safemode is enabled,\ndistance to hostiles when safemode\nshould show a warning (0=Viewdistance)";
case OPT_AUTOSAFEMODE: return "If true, auto-safemode will be on\nafter starting a new game or loading";
case OPT_AUTOSAFEMODETURNS: return "Number of turns after safemode\nis reenabled if no hostiles are\nin safemodeproximity distance";
case OPT_AUTOSAVE: return "If true, game will periodically\nsave the map";
case OPT_GRADUAL_NIGHT_LIGHT: return "If true will add nice gradual-lighting\n(should only make a difference @night)";
case OPT_QUERY_DISASSEMBLE: return "If true, will query before disassembling\nitems";
@@ -138,8 +279,11 @@ std::string option_desc(option_key key)
case OPT_SKILL_RUST: return "Set the level of skill rust\n0 - vanilla Cataclysm\n1 - capped at skill levels\n2 - none at all";
case OPT_DELETE_WORLD: return "Delete saves upon player death\n0 - no\n1 - yes\n2 - query";
case OPT_INITIAL_POINTS: return "Initial points available on character\ngeneration. Default is 6";
case OPT_VIEWPORT_X: return "Set the expansion of the viewport along\nthe X axis. Must restart for changes\nto take effect. Default is 12";
case OPT_VIEWPORT_Y: return "Set the expansion of the viewport along\nthe Y axis. Must restart for changes\nto take effect. Default is 12";
case OPT_INITIAL_TIME: return "Initial starting time of day on character\ngeneration. Default is 8:00";
case OPT_VIEWPORT_X: return "WINDOWS ONLY: Set the expansion of the viewport along\nthe X axis. Must restart for changes\nto take effect. Default is 12. POSIX\nsystems will use terminal size at startup.";
case OPT_VIEWPORT_Y: return "WINDOWS ONLY: Set the expansion of the viewport along\nthe Y axis. Must restart for changes\nto take effect. Default is 12. POSIX\nsystems will use terminal size at startup.";
case OPT_STATIC_SPAWN: return "Spawn zombies at game start instead of\nduring game. Must delete save directory\nafter changing for it to take effect.\nDefault is F";
case OPT_CLASSIC_ZOMBIES: return "Only spawn classic zombies and natural\nwildlife. Probably requires a reset of\nsave folder to take effect. Default is F";
default: return " ";
}
return "Big ol Bug";
@@ -155,7 +299,9 @@ std::string option_name(option_key key)
case OPT_24_HOUR: return "24 Hour Time";
case OPT_SNAP_TO_TARGET: return "Snap to Target";
case OPT_SAFEMODE: return "Safemode on by default";
case OPT_SAFEMODEPROXIMITY: return "Safemode proximity distance";
case OPT_AUTOSAFEMODE: return "Auto-Safemode on by default";
case OPT_AUTOSAFEMODETURNS: return "Turns to reenable safemode";
case OPT_AUTOSAVE: return "Periodically Autosave";
case OPT_GRADUAL_NIGHT_LIGHT: return "Gradual night light";
case OPT_QUERY_DISASSEMBLE: return "Query on disassembly";
@@ -163,8 +309,11 @@ std::string option_name(option_key key)
case OPT_SKILL_RUST: return "Skill Rust";
case OPT_DELETE_WORLD: return "Delete World";
case OPT_INITIAL_POINTS: return "Initial points";
case OPT_INITIAL_TIME: return "Initial time";
case OPT_VIEWPORT_X: return "Viewport width";
case OPT_VIEWPORT_Y: return "Viewport height";
case OPT_STATIC_SPAWN: return "Static spawn";
case OPT_CLASSIC_ZOMBIES: return "Classic zombies";
default: return "Unknown Option (BUG)";
}
return "Big ol Bug";
@@ -173,10 +322,14 @@ std::string option_name(option_key key)
bool option_is_bool(option_key id)
{
switch (id) {
case OPT_24_HOUR:
case OPT_SAFEMODEPROXIMITY:
case OPT_AUTOSAFEMODETURNS:
case OPT_SKILL_RUST:
case OPT_DROP_EMPTY:
case OPT_DELETE_WORLD:
case OPT_INITIAL_POINTS:
case OPT_INITIAL_TIME:
case OPT_VIEWPORT_X:
case OPT_VIEWPORT_Y:
return false;
@@ -195,9 +348,21 @@ char option_max_options(option_key id)
else
switch (id)
{
case OPT_24_HOUR:
ret = 3;
break;
case OPT_SAFEMODEPROXIMITY:
ret = 61;
break;
case OPT_AUTOSAFEMODETURNS:
ret = 51;
break;
case OPT_INITIAL_POINTS:
ret = 25;
break;
case OPT_INITIAL_TIME:
ret = 24; // 0h to 23h
break;
case OPT_DELETE_WORLD:
case OPT_DROP_EMPTY:
case OPT_SKILL_RUST:
@@ -205,8 +370,8 @@ char option_max_options(option_key id)
break;
case OPT_VIEWPORT_X:
case OPT_VIEWPORT_Y:
ret = 61; // TODO Set up min/max values so weird numbers don't have to be used.
break;
ret = 93; // TODO Set up min/max values so weird numbers don't have to be used.
break;
default:
ret = 2;
break;
@@ -230,14 +395,18 @@ use_metric_system F\n\
force_capital_yn T\n\
# If true, bright backgrounds are not used--some consoles are not compatible\n\
no_bright_backgrounds F\n\
# If true, use military time, not AM/PM\n\
24_hour F\n\
# 12h/24h Time: 0 = AM/PM, 1 = 24h military, 2 = 24h normal\n\
24_hour 0\n\
# If true, automatically follow the crosshair when firing/throwing\n\
snap_to_target F\n\
# If true, safemode will be on after starting a new game or loading\n\
safemode T\n\
# If safemode is enabled, distance to hostiles when safemode should show a warning (0=Viewdistance)\n\
safemodeproximity 0\n\
# If true, auto-safemode will be on after starting a new game or loading\n\
autosafemode F\n\
# Number of turns after safemode is reenabled when no zombies are in safemodeproximity distance\n\
autosafemodeturns 50\n\
# If true, game will periodically save the map\n\
autosave F\n\
# If true will add nice gradual-lighting (should only make a difference @night)\n\
@@ -255,10 +424,16 @@ skill_rust 0\n\
delete_world 0\n\
# Initial points available in character generation\n\
initial_points 6\n\
# How far to expand the viewport's width in each direction.\n\
# Initial time at character generation\n\
initial_time 8\n\
# The width of the terrain window in characters.\n\
viewport_x 12\n\
# Same as viewport_x, but in height.\n\
# The height of the terrain window, which is also the height of the main window, in characters.\n\
viewport_y 12\n\
# Spawn zombies at game start instead of during the game. You must create a new world after changing\n\
static_spawn T\n\
# Only spawn classic zombies and natural wildlife. You must create a new world after changing\n\
classic_zombies F\n\
";
fout.close();
}
+31 -17
View File
@@ -12,42 +12,56 @@ OPT_NO_CBLINK, // No bright backgrounds
OPT_24_HOUR, // 24 hour time
OPT_SNAP_TO_TARGET, // game::firing snaps to target
OPT_SAFEMODE, // Safemode on by default?
OPT_SAFEMODEPROXIMITY, //Range after which safemode kicks in
OPT_AUTOSAFEMODE, // Autosafemode on by default?
OPT_AUTOSAFEMODETURNS, //Number of turns untill safemode kicks back in
OPT_AUTOSAVE, // Automatically save the game on intervals.
OPT_GRADUAL_NIGHT_LIGHT, // be so cool at night :)
OPT_QUERY_DISASSEMBLE, // Query before disassembling items
OPT_DROP_EMPTY, // auto drop empty containers after use
OPT_SKILL_RUST, // level of skill rust
OPT_DELETE_WORLD,
OPT_INITIAL_POINTS,
OPT_VIEWPORT_X,
OPT_VIEWPORT_Y,
OPT_DELETE_WORLD, // Delete workd every time New Character is created
OPT_INITIAL_POINTS, // Set the number of character points
OPT_INITIAL_TIME, // Sets the starting hour (0-24)
OPT_VIEWPORT_X, // Set the width of the terrain window, in characters
OPT_VIEWPORT_Y, // Set the height of the terrain window, in characters
OPT_STATIC_SPAWN, // Makes zombies spawn using the new static system
OPT_CLASSIC_ZOMBIES, // Only spawn the more classic zombies
NUM_OPTION_KEYS
};
struct option_table
{
double options[NUM_OPTION_KEYS];
double options[NUM_OPTION_KEYS];
option_table() {
for (int i = 0; i < NUM_OPTION_KEYS; i++) {
if(i == OPT_VIEWPORT_X || i == OPT_VIEWPORT_Y) {
options[i] = 12;
}
else {
options[i] = 0;
}
}
};
option_table()
{
for (int i = 0; i < NUM_OPTION_KEYS; i++)
{ //setup default values where needed
switch(i)
{
case OPT_VIEWPORT_X:
case OPT_VIEWPORT_Y:
options[i] = 12;
break;
case OPT_INITIAL_TIME:
options[i] = 8;
break;
default:
options[i] = 0;
}
}
};
double& operator[] (option_key i) { return options[i]; };
double& operator[] (int i) { return options[i]; };
double& operator[] (option_key i) { return options[i]; };
double& operator[] (int i) { return options[i]; };
};
extern option_table OPTIONS;
bool option_is_bool(option_key id);
char option_max_options(option_key id);
void show_options();
void load_options();
void save_options();
std::string option_string(option_key key);
+94 -81
View File
@@ -26,6 +26,16 @@
#define LINE_OXXX 4194423
#define LINE_XXXX 4194414
// Display data
int TERMX;
int TERMY;
int VIEWX;
int VIEWY;
int VIEW_OFFSET_X;
int VIEW_OFFSET_Y;
int TERRAIN_WINDOW_WIDTH;
int TERRAIN_WINDOW_HEIGHT;
nc_color hilite(nc_color c)
{
switch (c) {
@@ -327,16 +337,17 @@ bool query_yn(const char *mes, ...)
vsprintf(buff, mes, ap);
va_end(ap);
int win_width = strlen(buff) + 26;
WINDOW* w = newwin(3, win_width, 11, 0);
WINDOW *w = newwin(3, win_width, (TERMY-3)/2, (TERMX > win_width) ? (TERMX-win_width)/2 : 0);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
mvwprintz(w, 1, 1, c_ltred, "%s (%s)", buff,
(force_uc ? "Y/N - Case Sensitive" : "y/n"));
mvwprintz(w, 1, 1, c_ltred, "%s (%s)", buff, (force_uc ? "Y/N - Case Sensitive" : "y/n"));
wrefresh(w);
char ch;
do
ch = getch();
while (ch != 'Y' && ch != 'N' && (force_uc || (ch != 'y' && ch != 'n')));
while (ch != '\n' && ch != ' ' && ch != KEY_ESCAPE && ch != 'Y' && ch != 'N' && (force_uc || (ch != 'y' && ch != 'n')));
werase(w);
wrefresh(w);
delwin(w);
@@ -354,7 +365,9 @@ int query_int(const char *mes, ...)
vsprintf(buff, mes, ap);
va_end(ap);
int win_width = strlen(buff) + 10;
WINDOW* w = newwin(3, win_width, 11, 0);
WINDOW *w = newwin(3, win_width, (TERMY-3)/2, 11+((TERMX > win_width) ? (TERMX-win_width)/2 : 0));
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
mvwprintz(w, 1, 1, c_ltred, "%s (0-9)", buff);
@@ -377,7 +390,7 @@ std::string string_input_popup(std::string title, int max_length, std::string in
std::string ret = input;
int startx = title.size() + 2;
WINDOW* w = newwin(3, 80, 11, 0);
WINDOW *w = newwin(3, 80, (TERMY-3)/2, ((TERMX > 80) ? (TERMX-80)/2 : 0));
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
for (int i = startx + 1; i < 79; i++)
@@ -443,8 +456,7 @@ char popup_getkey(const char *mes, ...)
width += 2;
if (height > 25)
height = 25;
WINDOW* w = newwin(height + 1, width, int((25 - height) / 2),
int((80 - width) / 2));
WINDOW *w = newwin(height+1, width, (TERMY-(height+1))/2, (TERMX > width) ? (TERMX-width)/2 : 0);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
tmp = buff;
@@ -481,7 +493,7 @@ int menu_vec(const char *mes, std::vector<std::string> options)
if (options[i].length() + 6 > width)
width = options[i].length() + 6;
}
WINDOW* w = newwin(height, width, 1, 10);
WINDOW *w = newwin(height, width, (TERMY-height)/2, (TERMX > width) ? (TERMX-width)/2 : 0);
wattron(w, c_white);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
@@ -555,7 +567,7 @@ void popup_top(const char *mes, ...)
if (width == 0 || tmp.length() > width)
width = tmp.length();
width += 2;
WINDOW* w = newwin(height + 1, width, 0, int((80 - width) / 2));
WINDOW *w = newwin(height+1, width, 0, (TERMX > width) ? (TERMX-width)/2 : 0);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
tmp = buff;
@@ -605,8 +617,7 @@ void popup(const char *mes, ...)
width += 2;
if (height > 25)
height = 25;
WINDOW* w = newwin(height + 1, width, int((25 - height) / 2),
int((80 - width) / 2));
WINDOW *w = newwin(height+1, width, (TERMY-(height+1))/2, (TERMX > width) ? (TERMX-width)/2 : 0);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
tmp = buff;
@@ -656,8 +667,7 @@ void popup_nowait(const char *mes, ...)
width += 2;
if (height > 25)
height = 25;
WINDOW* w = newwin(height + 1, width, int((25 - height) / 2),
int((80 - width) / 2));
WINDOW *w = newwin(height+1, width, (TERMY-(height+1))/2, (TERMX > width) ? (TERMX-width)/2 : 0);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
tmp = buff;
@@ -685,7 +695,8 @@ void full_screen_popup(const char* mes, ...)
vsprintf(buff, mes, ap);
va_end(ap);
std::string tmp = buff;
WINDOW* w = newwin(25, 80, 0, 0);
WINDOW *w = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
size_t pos = tmp.find_first_of('\n');
@@ -710,26 +721,34 @@ void full_screen_popup(const char* mes, ...)
refresh();
}
void compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare)
char compare_split_screen_popup(int iLeft, int iWidth, int iHeight, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare)
{
WINDOW* w = newwin(25, 40, 0, (bLeft) ? 0 : 40);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
WINDOW* w = newwin(iHeight, iWidth, VIEW_OFFSET_Y, iLeft + VIEW_OFFSET_X);
mvwprintz(w, 1, 2, c_white, sItemName.c_str());
int line_num = 3;
int iStartX = 0;
std::string sPlus;
bool bStartNewLine = true;
for (int i = 0; i < vItemDisplay.size(); i++) {
if (vItemDisplay[i].sType == "DESCRIPTION") {
if (vItemDisplay[i].sType == "MENU") {
if (vItemDisplay[i].sPre == "iOffsetY") {
line_num += vItemDisplay[i].iValue;
} else if (vItemDisplay[i].sPre == "iOffsetX") {
iStartX = vItemDisplay[i].iValue;
} else {
mvwprintz(w, line_num, iStartX, c_ltgreen, "%s", (vItemDisplay[i].sName).c_str());
wprintz(w, c_white, "%s", (vItemDisplay[i].sPre).c_str());
line_num++;
}
} else if (vItemDisplay[i].sType == "DESCRIPTION") {
std::string sText = vItemDisplay[i].sName;
std::replace(sText.begin(), sText.end(), '\n', ' ');
int iPos;
while (1) {
line_num++;
if (sText.size() > 36) {
int iPos = sText.find_last_of(' ', 36);
if (sText.size() > iWidth-4) {
int iPos = sText.find_last_of(' ', iWidth-4);
mvwprintz(w, line_num, 2, c_white, (sText.substr(0, iPos)).c_str());
sText = sText.substr(iPos+1, sText.size());
} else {
@@ -793,72 +812,21 @@ void compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<i
}
}
wrefresh(w);
if (!bLeft)
{
char ch;
do
ch = getch();
while(ch != ' ' && ch != '\n' && ch != KEY_ESCAPE);
werase(w);
wrefresh(w);
delwin(w);
refresh();
}
/*
std::string tmp = buff;
WINDOW* w = newwin(25, 40, 0, (bLeft) ? 0 : 40);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
size_t pos = tmp.find_first_of('\n');
mvwprintz(w, 1, 2, c_white, sItemName.c_str());
int line_num = 2;
while (pos != std::string::npos) {
std::string line = tmp.substr(0, pos);
line_num++;
if (line.size() > 36)
{
std::string sTemp;
do
{
sTemp += line;
tmp = tmp.substr(pos + 1);
pos = tmp.find_first_of('\n');
line = " " + tmp.substr(0, pos);
} while (pos != std::string::npos);
sTemp += line;
while (sTemp.size() > 0)
{
size_t iPos = sTemp.find_last_of(' ', 36);
if (iPos == 0)
iPos = sTemp.size();
mvwprintz(w, line_num, 2, c_white, (sTemp.substr(0, iPos)).c_str());
line_num++;
sTemp = sTemp.substr(iPos+1, sTemp.size());
}
}
else
{
mvwprintz(w, line_num, 2, c_white, (line).c_str());
}
tmp = tmp.substr(pos + 1);
pos = tmp.find_first_of('\n');
}
line_num++;
mvwprintz(w, line_num, 2, c_white, tmp.c_str());
char ch = ' ';
wrefresh(w);
if (!bLeft)
{
char ch;
do
ch = getch();
while(ch != ' ' && ch != '\n' && ch != KEY_ESCAPE);
if (iLeft > 0) {
ch = getch();
werase(w);
wrefresh(w);
delwin(w);
refresh();
}
*/
return ch;
}
char rand_char()
@@ -931,7 +899,52 @@ std::string word_rewrap (const std::string &in, int width){
return o.str();
}
void draw_tab(WINDOW *w, int iOffsetX, std::string sText, bool bSelected)
{
int iOffsetXRight = iOffsetX + sText.size() + 1;
mvwputch(w, 0, iOffsetX, c_ltgray, LINE_OXXO); // |^
mvwputch(w, 0, iOffsetXRight, c_ltgray, LINE_OOXX); // ^|
mvwputch(w, 1, iOffsetX, c_ltgray, LINE_XOXO); // |
mvwputch(w, 1, iOffsetXRight, c_ltgray, LINE_XOXO); // |
mvwprintz(w, 1, iOffsetX+1, (bSelected) ? h_ltgray : c_ltgray, sText.c_str());
for (int i = iOffsetX+1; i < iOffsetXRight; i++)
mvwputch(w, 0, i, c_ltgray, LINE_OXOX); // -
if (bSelected) {
mvwputch(w, 1, iOffsetX-1, h_ltgray, '<');
mvwputch(w, 1, iOffsetXRight+1, h_ltgray, '>');
for (int i = iOffsetX+1; i < iOffsetXRight; i++)
mvwputch(w, 2, i, c_black, ' ');
mvwputch(w, 2, iOffsetX, c_ltgray, LINE_XOOX); // _|
mvwputch(w, 2, iOffsetXRight, c_ltgray, LINE_XXOO); // |_
} else {
mvwputch(w, 2, iOffsetX, c_ltgray, LINE_XXOX); // _|_
mvwputch(w, 2, iOffsetXRight, c_ltgray, LINE_XXOX); // _|_
}
}
void hit_animation(int iX, int iY, nc_color cColor, char cTile, int iTimeout)
{
WINDOW *w_hit = newwin(1, 1, iY+VIEW_OFFSET_Y, iX+VIEW_OFFSET_X);
mvwputch(w_hit, 0, 0, cColor, cTile);
wrefresh(w_hit);
if (iTimeout <= 0 || iTimeout > 999) {
iTimeout = 70;
}
timeout(iTimeout);
getch(); //useing this, because holding down a key with nanosleep can get yourself killed
timeout(-1);
/*timespec ts;
ts.tv_sec = 0;
ts.tv_nsec = iTimeout * 1000 * 1000; //100ms
nanosleep(&ts, NULL);*/
}
+17 -1
View File
@@ -21,6 +21,16 @@
#define LINE_OXXX 4194423
#define LINE_XXXX 4194414
// Display data
extern int TERMX;
extern int TERMY;
extern int VIEWX;
extern int VIEWY;
extern int VIEW_OFFSET_X;
extern int VIEW_OFFSET_Y;
extern int TERRAIN_WINDOW_WIDTH;
extern int TERRAIN_WINDOW_HEIGHT;
void mvputch(int y, int x, nc_color FG, long ch);
void wputch(WINDOW* w, nc_color FG, long ch);
void mvwputch(WINDOW* w, int y, int x, nc_color FG, long ch);
@@ -51,7 +61,7 @@ void popup_top(const char *mes, ...); // Displayed at the top of the screen
void popup(const char *mes, ...);
void popup_nowait(const char *mes, ...); // Doesn't wait for spacebar
void full_screen_popup(const char *mes, ...);
void compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare);
char compare_split_screen_popup(int iLeft, int iWidth, int iHeight, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare);
nc_color hilite(nc_color c);
nc_color invert_color(nc_color c);
@@ -63,4 +73,10 @@ long special_symbol (char sym);
// utility: moves \n's around to fit string breaks within a certain width.
std::string word_rewrap (const std::string &in, int width);
// short visual animation (player, monster, ...) (hit, dodge, ...)
void hit_animation(int iX, int iY, nc_color cColor, char cTile, int iTimeout = 70);
void draw_tab(WINDOW *w, int iOffsetX, std::string sText, bool bSelected);
void clear_window(WINDOW* w);
#endif
+879 -828
View File
File diff suppressed because it is too large Load Diff
+78 -50
View File
@@ -13,6 +13,10 @@
class npc;
struct settlement;
#define OVERMAP_DEPTH 10
#define OVERMAP_HEIGHT 0
#define OVERMAP_LAYERS (1 + OVERMAP_DEPTH + OVERMAP_HEIGHT)
struct city {
int x;
int y;
@@ -38,19 +42,26 @@ struct radio_tower {
x (X), y (Y), strength (S), message (M) {}
};
struct map_layer {
oter_id terrain[OMAPX][OMAPY];
bool visible[OMAPX][OMAPY];
std::vector<om_note> notes;
map_layer() : terrain(), visible(), notes() {}
};
class overmap
{
public:
overmap();
overmap(const overmap & om);
overmap(game *g, int x, int y, int z);
overmap(game *g, int x, int y);
~overmap();
void save(std::string name);
void save(std::string name, int x, int y, int z);
void open(game *g, int x, int y, int z);
void generate(game *g, overmap* north, overmap* east, overmap* south,
overmap* west);
void generate_sub(overmap* above);
overmap& operator=(overmap const&);
point const& pos() const { return loc; }
void save();
void make_tutorial();
void first_house(int &x, int &y);
@@ -64,47 +75,62 @@ class overmap
* Use must_be_seen=true if only terrain seen by the player should be searched.
* If no such tile can be found, (-1, -1) is returned.
*/
// TODO: make this 3d
point find_closest(point origin, oter_id type, int type_range,
int &dist, bool must_be_seen);
std::vector<point> find_all(point origin, oter_id type, int type_range,
int &dist, bool must_be_seen);
std::vector<point> find_terrain(std::string term, int cursx, int cursy);
std::vector<point> find_terrain(std::string term, int cursx, int cursy, int zlevel);
int closest_city(point p);
point random_house_in_city(int city_id);
int dist_from_city(point p);
// Interactive point choosing; used as the map screen
point choose_point(game *g);
point choose_point(game *g, int const z);
bool ter_in_type_range(int x, int y, oter_id type, int type_range);
oter_id& ter(int x, int y);
unsigned zones(int x, int y);
std::vector<mongroup*> monsters_at(int x, int y);
bool is_safe(int x, int y); // true if monsters_at is empty, or only woodland
bool& seen(int x, int y);
bool ter_in_type_range(int x, int y, int z, oter_id type, int type_range);
oter_id& ter(int x, int y, int z);
bool& seen(int x, int y, int z);
std::vector<mongroup*> monsters_at(int x, int y, int z);
bool is_safe(int x, int y, int z); // true if monsters_at is empty, or only woodland
bool has_note(int x, int y);
std::string note(int x, int y);
void add_note(int x, int y, std::string message);
point find_note(point origin, std::string text);
void delete_note(int x, int y);
point display_notes();
bool has_note(int const x, int const y, int const z) const;
std::string const& note(int const x, int const y, int const z) const;
void add_note(int const x, int const y, int const z, std::string const& message);
void delete_note(int const x, int const y, int const z) { add_note(x, y, z, ""); }
point display_notes(game* g, int const z) const;
point find_note(int const x, int const y, int const z, std::string const& text) const;
// TODO: make private
std::vector<mongroup> zg;
std::vector<radio_tower> radios;
std::vector<npc> npcs;
std::vector<city> cities;
std::vector<city> roads_out;
std::vector<settlement> towns;
std::vector<mongroup> zg;
std::vector<radio_tower> radios;
int posx, posy, posz;
std::vector<npc> npcs;
private:
oter_id t[OMAPX][OMAPY];
point loc;
std::string prefix;
std::string name;
//map_layer layer[OVERMAP_LAYERS];
map_layer *layer;
oter_id nullret;
bool s[OMAPX][OMAPY];
bool nullbool;
std::vector<om_note> notes;
std::string nullstr;
// no copy constructor
overmap(overmap const&);
// Initialise
void init_layers();
void open(game *g);
void generate(game *g, overmap* north, overmap* east, overmap* south,
overmap* west);
bool generate_sub(int const z);
//Drawing
void draw(WINDOW *w, game *g, int &cursx, int &cursy,
void draw(WINDOW *w, game *g, int z, int &cursx, int &cursy,
int &origx, int &origy, char &ch, bool blink);
// Overall terrain
void place_river(point pa, point pb);
@@ -113,35 +139,37 @@ class overmap
void place_cities();
void put_buildings(int x, int y, int dir, city town);
void make_road(int cx, int cy, int cs, int dir, city town);
void build_lab(int x, int y, int s);
void build_anthill(int x, int y, int s);
void build_tunnel(int x, int y, int s, int dir);
void build_slimepit(int x, int y, int s);
void build_mine(int x, int y, int s);
void place_rifts();
bool build_lab(int x, int y, int z, int s);
void build_anthill(int x, int y, int z, int s);
void build_tunnel(int x, int y, int z, int s, int dir);
bool build_slimepit(int x, int y, int z, int s);
void build_mine(int x, int y, int z, int s);
void place_rifts(int const z);
// Connection highways
void place_hiways(std::vector<city> cities, oter_id base);
void place_hiways(std::vector<city> cities, int z, oter_id base);
void place_subways(std::vector<point> stations);
void make_hiway(int x1, int y1, int x2, int y2, oter_id base);
void make_hiway(int x1, int y1, int x2, int y2, int z, oter_id base);
void building_on_hiway(int x, int y, int dir);
// Polishing
bool is_road(oter_id base, int x, int y); // Dependant on road type
bool is_road(int x, int y);
void polish(oter_id min = ot_null, oter_id max = ot_tutorial);
void good_road(oter_id base, int x, int y);
void good_river(int x, int y);
bool is_road(oter_id base, int x, int y, int z); // Dependant on road type
bool is_road(int x, int y, int z);
void polish(int z, oter_id min = ot_null, oter_id max = ot_tutorial);
void good_road(oter_id base, int x, int y, int z);
void good_river(int x, int y, int z);
// Monsters, radios, etc.
void place_specials();
void place_special(overmap_special special, point p);
void place_special(overmap_special special, tripoint p);
void place_mongroups();
void place_radios();
// File I/O
friend std::ostream & operator<<(std::ostream &, const overmap *);
std::string terrain_filename(int const x, int const y) const;
std::string player_filename(int const x, int const y) const;
};
std::ostream & operator<<(std::ostream &, const overmap *);
std::ostream & operator<<(std::ostream &, const overmap &);
std::ostream & operator<<(std::ostream &, const city &);
// TODO: readd the stream operators
//std::ostream & operator<<(std::ostream &, const overmap *);
//std::ostream & operator<<(std::ostream &, const overmap &);
//std::ostream & operator<<(std::ostream &, const city &);
#endif
+510 -309
View File
File diff suppressed because it is too large Load Diff
+6 -2
View File
@@ -11,6 +11,7 @@
#include "inventory.h"
#include "artifact.h"
#include "mutation.h"
#include "crafting.h"
#include <vector>
#include <string>
#include <map>
@@ -56,11 +57,12 @@ public:
virtual std::string save_info(); // Save to file matching name
void disp_info(game *g); // '@' key; extended character info
void disp_morale(); // '%' key; morale info
void disp_morale(game *g); // '%' key; morale info
void disp_status(WINDOW* w, game *g = NULL);// On-screen data
void reset(game *g = NULL);// Resets movement points, stats, applies effects
void update_morale(); // Ticks down morale counters and removes them
void update_bodytemp(game *g); // Maintains body temperature
int current_speed(game *g = NULL); // Number of movement points we get a turn
int run_cost(int base_cost); // Adjust base_cost
int swim_speed(); // Our speed when swimming
@@ -208,7 +210,7 @@ public:
void practice(Skill *s, int amount);
void practice(std::string s, int amount);
void assign_activity(activity_type type, int moves, int index = -1);
void assign_activity(game* g, activity_type type, int moves, int index = -1);
void cancel_activity();
int weight_carried();
@@ -318,6 +320,8 @@ public:
std::vector <disease> illness;
std::vector <addiction> addictions;
recipe* lastrecipe;
};
#endif
+22 -21
View File
@@ -26,22 +26,22 @@ enum dis_type {
DI_NULL,
// Weather
DI_GLARE, DI_WET,
// Temperature, the order is important
// Temperature, the order is important (dependant on bodypart.h)
DI_COLD,
DI_COLD_HEAD, DI_COLD_EYES, DI_COLD_MOUTH, DI_COLD_TORSO,
DI_COLD_TORSO, DI_COLD_HEAD, DI_COLD_EYES, DI_COLD_MOUTH,
DI_COLD_ARMS, DI_COLD_HANDS, DI_COLD_LEGS, DI_COLD_FEET,
DI_FROSTBITE,
DI_FROSTBITE_HEAD, DI_FROSTBITE_EYES, DI_FROSTBITE_MOUTH, DI_FROSTBITE_TORSO,
DI_FROSTBITE_TORSO, DI_FROSTBITE_HEAD, DI_FROSTBITE_EYES, DI_FROSTBITE_MOUTH,
DI_FROSTBITE_ARMS, DI_FROSTBITE_HANDS, DI_FROSTBITE_LEGS, DI_FROSTBITE_FEET,
DI_HOT,
DI_HOT_HEAD, DI_HOT_EYES, DI_HOT_MOUTH, DI_HOT_TORSO,
DI_HOT_TORSO, DI_HOT_HEAD, DI_HOT_EYES, DI_HOT_MOUTH,
DI_HOT_ARMS, DI_HOT_HANDS, DI_HOT_LEGS, DI_HOT_FEET,
DI_BLISTERS,
DI_BLISTERS_HEAD, DI_BLISTERS_EYES, DI_BLISTERS_MOUTH, DI_BLISTERS_TORSO,
DI_BLISTERS_TORSO, DI_BLISTERS_HEAD, DI_BLISTERS_EYES, DI_BLISTERS_MOUTH,
DI_BLISTERS_ARMS, DI_BLISTERS_HANDS, DI_BLISTERS_LEGS, DI_BLISTERS_FEET,
// Diseases
DI_INFECTION,
DI_COMMON_COLD, DI_FLU,
DI_COMMON_COLD, DI_FLU, DI_RECOVER,
// Fields
DI_SMOKE, DI_ONFIRE, DI_TEARGAS,
// Monsters
@@ -51,18 +51,18 @@ enum dis_type {
DI_POISON, DI_BLEED, DI_BADPOISON, DI_FOODPOISON, DI_SHAKES,
DI_DERMATIK, DI_FORMICATION,
DI_WEBBED,
DI_RAT,
DI_RAT, DI_BITE,
// Food & Drugs
DI_PKILL1, DI_PKILL2, DI_PKILL3, DI_PKILL_L, DI_DRUNK, DI_CIG, DI_HIGH,
DI_HALLU, DI_VISUALS, DI_IODINE, DI_TOOK_XANAX, DI_TOOK_PROZAC,
DI_TOOK_FLUMED, DI_ADRENALINE, DI_ASTHMA, DI_GRACK, DI_METH,
// Traps
DI_BEARTRAP, DI_IN_PIT, DI_STUNNED, DI_DOWNED,
DI_BEARTRAP, DI_LIGHTSNARE, DI_HEAVYSNARE, DI_IN_PIT, DI_STUNNED, DI_DOWNED,
// Martial Arts
DI_ATTACK_BOOST, DI_DAMAGE_BOOST, DI_DODGE_BOOST, DI_ARMOR_BOOST,
DI_SPEED_BOOST, DI_VIPER_COMBO,
// Other
DI_AMIGARA, DI_TELEGLOW, DI_ATTENTION, DI_EVIL,
DI_AMIGARA, DI_STEMCELL_TREATMENT, DI_TELEGLOW, DI_ATTENTION, DI_EVIL, DI_INFECTED,
// Inflicted by an NPC
DI_ASKED_TO_FOLLOW, DI_ASKED_TO_LEAD, DI_ASKED_FOR_ITEM,
// NPC-only
@@ -179,12 +179,13 @@ enum pl_flag {
PF_TERRIFYING, // All creatures run away more
PF_DISRESISTANT,// Less likely to succumb to low health; TODO: Implement this
PF_ADRENALINE, // Big bonuses when low on HP
PF_SELFAWARE, // Let's you see exact HP totals
PF_INCONSPICUOUS,// Less spawns due to timeouts
PF_MASOCHIST, // Morale boost from pain
PF_LIGHTSTEP, // Less noise from movement
PF_HEARTLESS, // No morale penalty for murder &c
PF_ANDROID, // Start with two bionics (occasionally one)
PF_ROBUST, // Mutations tend to be good (usually they tend to be bad)
PF_CANNIBAL, // No penalty for eating human meat
PF_MARTIAL_ARTS, // Start with a martial art
PF_SPLIT, // Null trait, splits between bad & good
@@ -211,7 +212,6 @@ enum pl_flag {
PF_MOODSWINGS, // Big random shifts in morale
PF_WEAKSTOMACH,// More likely to throw up in all circumstances
PF_WOOLALLERGY,// Can't wear wool
PF_HPIGNORANT, // Don't get to see exact HP numbers, just colors & symbols
PF_TRUTHTELLER, // Worse at telling lies
PF_UGLY, // +1 grotesqueness
@@ -389,7 +389,7 @@ Your system is rather tolerant of poisons and toxins, and most will affect\n\
you less."},
{"Fast Reader", 1, 0, 0, "\
You're a quick reader, and can get through books a lot faster than most."},
{"Tough", 5, 0, 0, "\
{"Tough", 3, 0, 0, "\
It takes a lot to bring you down! You get a 20%% bonus to all hit points."},
{"Thick-Skinned", 2, 0, 0, "\
Your skin is tough. Cutting damage is slightly reduced for you."},
@@ -423,6 +423,9 @@ flu."},
{"High Adrenaline", 3, 0, 0, "\
If you are in a very dangerous situation, you may experience a temporary rush\n\
which increases your speed and strength significantly."},
{"Self-aware", 1, 0, 0, "\
You get to see your exact amount of HP remaining, instead of only having a\n\
vague idea of whether you're in good condition or not."},
{"Inconspicuous", 2, 0, 0, "\
While sleeping or staying still, it is less likely that monsters will wander\n\
close to you."},
@@ -431,18 +434,19 @@ Although you still suffer the negative effects of pain, it also brings a\n\
unique pleasure to you."},
{"Light Step", 1, 0, 0, "\
You make less noise while walking. You're also less likely to set off traps."},
{"Heartless", 2, 0, 0, "\
You have few qualms, and no capacity for pity. Killing the helpless, the\n\
young, and your friends will not affect your morale at all."},
{"Android", 4, 0, 0, "\
At some point in the past you had a bionic upgrade installed in your body.\n\
You start the game with a power system, and one random bionic enhancement."},
{"Robust Genetics", 2, 0, 0, "\
You have a very strong genetic base. If you mutate, the odds that the\n\
mutation will be beneficial are greatly increased."},
{"Cannibal", 3, 0, 0, "\
For your whole life you've been forbidden from indulging in your peculiar\n\
tastes. Now the world's ended, and you'll be damned if anyone is going to\n\
tell you you can't eat people."},
{"Martial Arts Training", 3, 0, 0, "\
You have receives some martial arts training at a local dojo. You will start\n\
with your choice of karate, judo, aikido, tai chi, or taekwando."},
You have received some martial arts training at a local dojo. You will start\n\
with your choice of karate, judo, aikido, tai chi, or taekwondo."},
{"NULL", 0, 0, 0, " -------------------------------------------------- "},
@@ -464,7 +468,7 @@ You never learned to read! Books and computers are off-limits to you."},
Your hearing is poor, and you may not hear quiet or far-off noises."},
{"Insomniac", -2, 0, 0, "\
You have a hard time falling asleep, even under the best circumstances!"},
{"Meat Allergy", -3, 0, 0, "\
{"Meat Intolerance", -3, 0, 0, "\
You have problems with eating meat, it's possible for you to eat it but\n\
you will suffer morale penalties due to nausea."},
{"Glass Jaw", -3, 0, 0, "\
@@ -511,9 +515,6 @@ You are more likely to throw up from food poisoning, alcohol, etc."},
{"Wool Allergy", -1, 0, 0, "\
You are badly allergic to wool, and can not wear any clothing made of the\n\
substance."},
{"HP Ignorant", -2, 0, 0, "\
You do not get to see your exact amount of HP remaining, but do have a vague\n\
idea of whether you're in good condition or not."},
{"Truth Teller", -2, 0, 0, "\
When you try to tell a lie, you blush, stammer, and get all shifty-eyed.\n\
Telling lies and otherwise bluffing will be much more difficult for you."},
+25 -26
View File
@@ -84,12 +84,6 @@ void game::fire(player &p, int tarx, int tary, std::vector<point> &trajectory,
// Bolts and arrows are silent
if (curammo->type == AT_BOLT || curammo->type == AT_ARROW)
is_bolt = true;
// TODO: Move this check to game::plfire
if ((weapon->has_flag(IF_STR8_DRAW) && p.str_cur < 4) ||
(weapon->has_flag(IF_STR10_DRAW) && p.str_cur < 5) ) {
add_msg("You're not strong enough to draw the bow!");
return;
}
int x = p.posx, y = p.posy;
// Have to use the gun, gunmods don't have a type
@@ -140,7 +134,7 @@ void game::fire(player &p, int tarx, int tary, std::vector<point> &trajectory,
(mon_at(tarx, tary) == -1 || z[mon_at(tarx, tary)].hp <= 0)) {
std::vector<point> new_targets;
int mondex;
for (int radius = 1; radius <= 2 + p.skillLevel("gun").level() && new_targets.empty();
for (int radius = 1; radius <= 2 + p.skillLevel("gun") && new_targets.empty();
radius++) {
for (int diff = 0 - radius; diff <= radius; diff++) {
mondex = mon_at(tarx + diff, tary - radius);
@@ -171,7 +165,7 @@ void game::fire(player &p, int tarx, int tary, std::vector<point> &trajectory,
else
trajectory = line_to(p.posx, p.posy, tarx, tary, 0);
} else if ((!p.has_trait(PF_TRIGGERHAPPY) || one_in(3)) &&
(p.skillLevel("gun") >= 7 || one_in(7 - p.skillLevel("gun").level())))
(p.skillLevel("gun") >= 7 || one_in(7 - p.skillLevel("gun"))))
return; // No targets, so return
}
@@ -370,7 +364,7 @@ void game::throw_item(player &p, int tarx, int tary, item &thrown,
int trange = 1.5 * rl_dist(p.posx, p.posy, tarx, tary);
// Throwing attempts below "Basic Competency" level are extra-bad
int skillLevel = p.skillLevel("throw").level();
int skillLevel = p.skillLevel("throw");
if (skillLevel < 3)
deviation += rng(0, 8 - skillLevel);
@@ -547,7 +541,7 @@ std::vector<point> game::target(int &x, int &y, int lowx, int lowy, int hix,
} else
target = -1; // No monsters in range, don't use target, reset to -1
WINDOW* w_target = newwin(13, 48, 12, TERRAIN_WINDOW_WIDTH + 7);
WINDOW* w_target = newwin(13, 48, 12 + VIEW_OFFSET_Y, TERRAIN_WINDOW_WIDTH + 7 + VIEW_OFFSET_X);
wborder(w_target, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
if (!relevent) // currently targetting vehicle to refill with fuel
@@ -723,32 +717,32 @@ int time_to_fire(player &p, it_gun* firing)
if (p.skillLevel("pistol") > 6)
time = 10;
else
time = (80 - 10 * p.skillLevel("pistol").level());
time = (80 - 10 * p.skillLevel("pistol"));
} else if (firing->skill_used == Skill::skill("shotgun")) {
if (p.skillLevel("shotgun") > 3)
time = 70;
else
time = (150 - 25 * p.skillLevel("shotgun").level());
time = (150 - 25 * p.skillLevel("shotgun"));
} else if (firing->skill_used == Skill::skill("smg")) {
if (p.skillLevel("smg") > 5)
time = 20;
else
time = (80 - 10 * p.skillLevel("smg").level());
time = (80 - 10 * p.skillLevel("smg"));
} else if (firing->skill_used == Skill::skill("rifle")) {
if (p.skillLevel("rifle") > 8)
time = 30;
else
time = (150 - 15 * p.skillLevel("rifle").level());
time = (150 - 15 * p.skillLevel("rifle"));
} else if (firing->skill_used == Skill::skill("archery")) {
if (p.skillLevel("archery") > 8)
time = 20;
else
time = (220 - 25 * p.skillLevel("archery").level());
time = (220 - 25 * p.skillLevel("archery"));
} else if (firing->skill_used == Skill::skill("launcher")) {
if (p.skillLevel("launcher") > 8)
time = 30;
else
time = (200 - 20 * p.skillLevel("launcher").level());
time = (200 - 20 * p.skillLevel("launcher"));
} else {
debugmsg("Why is shooting %s using %s skill?", (firing->name).c_str(), firing->skill_used->name().c_str());
time = 0;
@@ -822,14 +816,14 @@ double calculate_missed_by(player &p, int trange, item* weapon)
double deviation = 0.; // Measured in quarter-degrees
// Up to 1.5 degrees for each skill point < 4; up to 1.25 for each point > 4
if (p.skillLevel(firing->skill_used) < 4)
deviation += rng(0, 6 * (4 - p.skillLevel(firing->skill_used).level()));
deviation += rng(0, 6 * (4 - p.skillLevel(firing->skill_used)));
else if (p.skillLevel(firing->skill_used) > 4)
deviation -= rng(0, 5 * (p.skillLevel(firing->skill_used).level() - 4));
deviation -= rng(0, 5 * (p.skillLevel(firing->skill_used) - 4));
if (p.skillLevel("gun") < 3)
deviation += rng(0, 3 * (3 - p.skillLevel("gun").level()));
deviation += rng(0, 3 * (3 - p.skillLevel("gun")));
else
deviation -= rng(0, 2 * (p.skillLevel("gun").level() - 3));
deviation -= rng(0, 2 * (p.skillLevel("gun") - 3));
deviation += p.ranged_dex_mod();
deviation += p.ranged_per_mod();
@@ -856,7 +850,7 @@ int recoil_add(player &p)
// item::recoil() doesn't suport gunmods, so call it on player gun.
int ret = p.weapon.recoil();
ret -= rng(p.str_cur / 2, p.str_cur);
ret -= rng(0, p.skillLevel(firing->skill_used).level() / 2);
ret -= rng(0, p.skillLevel(firing->skill_used) / 2);
if (ret > 0)
return ret;
return 0;
@@ -913,15 +907,20 @@ void shoot_monster(game *g, player &p, monster &mon, int &dam, double goodhit, i
if (dam > 0) {
mon.moves -= dam * 5;
if (&p == &(g->u) && u_see_mon)
g->add_msg("%s You hit the %s for %d damage.", message.c_str(),
mon.name().c_str(), dam);
g->add_msg("%s You hit the %s for %d damage.", message.c_str(), mon.name().c_str(), dam);
else if (u_see_mon)
g->add_msg("%s %s shoots the %s.", message.c_str(), p.name.c_str(),
mon.name().c_str());
if (mon.hurt(dam))
g->add_msg("%s %s shoots the %s.", message.c_str(), p.name.c_str(), mon.name().c_str());
bool bMonDead = mon.hurt(dam);
hit_animation(mon.posx - g->u.posx + VIEWX - g->u.view_offset_x,
mon.posy - g->u.posy + VIEWY - g->u.view_offset_y,
red_background(mon.type->color), (bMonDead) ? '%' : mon.symbol());
if (bMonDead)
g->kill_mon(g->mon_at(mon.posx, mon.posy), (&p == &(g->u)));
else if (weapon->curammo->ammo_effects != 0)
g->hit_monster_with_flags(mon, weapon->curammo->ammo_effects);
dam = 0;
}
}
+4 -2
View File
@@ -32,9 +32,11 @@ int dice(int number, int sides)
// for world seeding.
int djb2_hash(unsigned char *str){
unsigned long hash = 5381;
int c;
while (c = *str++)
unsigned char c = *str++;
while (c != '\0'){
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
c = *str++;
}
return hash;
}
+10 -10
View File
@@ -98,6 +98,16 @@ void setvector(std::vector<m_flag> &vec, ... )
va_end(ap);
}
void setvector(std::vector<m_category> &vec, ... )
{
va_list ap;
va_start(ap, vec);
m_category tmp;
while ((tmp = (m_category)va_arg(ap, int)))
vec.push_back(tmp);
va_end(ap);
}
void setvector(std::vector<monster_trigger> &vec, ... )
{
va_list ap;
@@ -108,16 +118,6 @@ void setvector(std::vector<monster_trigger> &vec, ... )
va_end(ap);
}
void setvector(std::vector<moncat_id> &vec, ... )
{
va_list ap;
va_start(ap, vec);
moncat_id tmp;
while ((tmp = (moncat_id)va_arg(ap, int)))
vec.push_back(tmp);
va_end(ap);
}
void setvector(std::vector<style_move> &vec, ... )
{
va_list ap;
+1 -1
View File
@@ -14,8 +14,8 @@ void setvector(std::vector <mission_origin> &vec, ... );
void setvector(std::vector <std::string> &vec, ... );
void setvector(std::vector <pl_flag> &vec, ... );
void setvector(std::vector <m_flag> &vec, ... );
void setvector(std::vector <m_category> &vec, ... );
void setvector(std::vector <monster_trigger> &vec, ... );
void setvector(std::vector <moncat_id> &vec, ... );
void setvector(std::vector <style_move> &vec, ... );
template <class T> void setvec(std::vector<T> &vec, ... );
#endif
+3
View File
@@ -95,6 +95,9 @@ class SkillLevel {
bool operator!=(const int& b) const { return !(*this == b); }
bool operator<=(const int& b) const { return !(*this > b); }
bool operator>=(const int& b) const { return !(*this < b); }
// Make skillLevel act like a raw level by default.
operator int() const { return _level; }
};
std::istream& operator>>(std::istream& is, SkillLevel& obj);
+35
View File
@@ -0,0 +1,35 @@
# Make any tests, and possibly run them.
# A selection of variables are exported from the master Makefile
# libtap.so and tap.h must be in the local directory or on the system path.
# ODIR is realative, so we can use the one from the main Makefile
# As each test will have a main function we need to handle this file by file
TEST_SOURCES = $(wildcard *_test.cpp)
TEST_OBJS = $(TEST_SOURCES:%.cpp=$(ODIR)/%.o)
TESTS = $(TEST_SOURCES:.cpp=)
# Brute force solution, relative paths to EVERY .o file
#SOURCE_OBJS = $(patsubst %,../$(ODIR)/%,$(filter-out main.o,$(_OBJS)))
SOURCE_OBJS = ../obj/line.o
LDFLAGS += -L. -ltap -lpthread
CXXFLAGS += -I..
tests: $(TESTS)
%_test: $(ODIR) $(DDIR) $(SOURCE_OBJS) $(TEST_OBJS)
$(CXX) $(W32FLAGS) -o $@ $(DEFINES) $(ODIR)/$@.o $(SOURCE_OBJS) $(LDFLAGS)
check: $(TESTS)
LD_LIBRARY_PATH=/usr/local/lib ./$?
$(ODIR):
mkdir $(ODIR)
$(DDIR):
@mkdir $(DDIR)
$(ODIR)/%.o: %.cpp
$(CXX) $(DEFINES) $(CXXFLAGS) -c $< -o $@
+15
View File
@@ -0,0 +1,15 @@
/* libtap doesn't extern C their headers, so we do it for them. */
extern "C" {
#include "tap.h"
}
#include "line.h"
int main(int argc, char *argv[])
{
plan_tests(1);
ok1(trig_dist(0, 0, 0, 0) == 0);
return exit_status();
}
+7
View File
@@ -22,7 +22,10 @@ enum trap_id {
tr_shotgun_1,
tr_engine,
tr_blade,
tr_light_snare,
tr_heavy_snare,
tr_landmine,
tr_landmine_buried,
tr_telepad,
tr_goo,
tr_dissector,
@@ -49,6 +52,8 @@ struct trapfunc {
void none (game *g, int x, int y) { };
void bubble (game *g, int x, int y);
void beartrap (game *g, int x, int y);
void snare_light (game *g, int x, int y);
void snare_heavy (game *g, int x, int y);
void snare (game *g, int x, int y) { };
void board (game *g, int x, int y);
void tripwire (game *g, int x, int y);
@@ -85,6 +90,8 @@ struct trapfuncm {
void crossbow (game *g, monster *z, int x, int y);
void shotgun (game *g, monster *z, int x, int y);
void blade (game *g, monster *z, int x, int y);
void snare_light (game *g, monster *z, int x, int y);
void snare_heavy (game *g, monster *z, int x, int y);
void snare (game *g, monster *z, int x, int y) { };
void landmine (game *g, monster *z, int x, int y);
void telepad (game *g, monster *z, int x, int y);
+15 -2
View File
@@ -71,8 +71,21 @@ traps.push_back(new trap(id, sym, color, name, visibility, avoidance,\
&trapfunc::blade, &trapfuncm::blade,
NULL);
// Name Symbol Color Vis Avd Diff
TRAP("land mine", '_', c_red, 10, 14, 10,
TRAP("light snare trap", '^', c_brown, 5, 10, 2,
&trapfunc::snare_light, &trapfuncm::snare_light,
itm_light_snare_kit, NULL);
TRAP("heavy snare trap", '^', c_brown, 3, 10, 4,
&trapfunc::snare_heavy, &trapfuncm::snare_heavy,
itm_heavy_snare_kit, NULL);
// Name Symbol Color Vis Avd Diff
TRAP("land mine", '^', c_red, 1, 14, 10,
&trapfunc::landmine, &trapfuncm::landmine,
itm_landmine, NULL);
// Name Symbol Color Vis Avd Diff
TRAP("buried land mine", '_', c_red, 10, 14, 10,
&trapfunc::landmine, &trapfuncm::landmine,
itm_landmine, NULL);
+133 -7
View File
@@ -209,7 +209,7 @@ void trapfuncm::shotgun(game *g, monster *z, int x, int y)
void trapfunc::blade(game *g, int x, int y)
{
g->add_msg("A machete swings out and hacks your torso!");
g->add_msg("A blade swings out and hacks your torso!");
g->u.hit(g, bp_torso, 0, 12, 30);
}
@@ -217,7 +217,7 @@ void trapfuncm::blade(game *g, monster *z, int x, int y)
{
int t;
if (g->u_see(z, t))
g->add_msg("A machete swings out and hacks the %s!", z->name().c_str());
g->add_msg("A blade swings out and hacks the %s!", z->name().c_str());
int cutdam = 30 - z->armor_cut();
int bashdam = 12 - z->armor_bash();
if (cutdam < 0)
@@ -228,6 +228,132 @@ void trapfuncm::blade(game *g, monster *z, int x, int y)
g->kill_mon(g->mon_at(x, y));
}
void trapfunc::snare_light(game *g, int x, int y)
{
g->sound(x, y, 2, "Snap!");
g->add_msg("A snare closes on your leg.");
g->u.add_disease(DI_LIGHTSNARE, rng(10, 20), g);
g->m.tr_at(x, y) = tr_null;
g->m.add_item(x, y, g->itypes[itm_string_36], 0);
g->m.add_item(x, y, g->itypes[itm_snare_trigger], 0);
}
void trapfuncm::snare_light(game *g, monster *z, int x, int y)
{
int t;
bool seen = g->u_see(z, t);
g->sound(x, y, 2, "Snap!");
switch (z->type->size) {
case MS_TINY:
if(seen){
g->add_msg("The %s has been snared!", z->name().c_str());
}
if(z->hurt(10)){
g->kill_mon(g->mon_at(x, y));
} else {
z->add_effect(ME_BEARTRAP, -1);
}
break;
case MS_SMALL:
if(seen){
g->add_msg("The %s has been snared!", z->name().c_str());
}
z->moves = 0;
z->add_effect(ME_BEARTRAP, rng(100, 150));
break;
case MS_MEDIUM:
if(seen){
g->add_msg("The %s has been snared!", z->name().c_str());
}
z->moves = 0;
z->add_effect(ME_BEARTRAP, rng(20, 30));
break;
case MS_LARGE:
if(seen){
g->add_msg("The snare has no effect on the %s!", z->name().c_str());
}
break;
case MS_HUGE:
if(seen){
g->add_msg("The snare has no effect on the %s!", z->name().c_str());
}
break;
}
g->m.tr_at(x, y) = tr_null;
g->m.add_item(x, y, g->itypes[itm_string_36], 0);
g->m.add_item(x, y, g->itypes[itm_snare_trigger], 0);
}
void trapfunc::snare_heavy(game *g, int x, int y)
{
int side = one_in(2) ? 0 : 1;
body_part hit = bp_legs;
g->sound(x, y, 4, "Snap!");
g->add_msg("A snare closes on your %s.", body_part_name(hit, side).c_str());
g->u.hit(g, bp_legs, side, 15, 20);
g->u.add_disease(DI_HEAVYSNARE, rng(20, 30), g);
g->m.tr_at(x, y) = tr_null;
g->m.add_item(x, y, g->itypes[itm_rope_6], 0);
g->m.add_item(x, y, g->itypes[itm_snare_trigger], 0);
}
void trapfuncm::snare_heavy(game *g, monster *z, int x, int y)
{
int t;
bool seen = g->u_see(z, t);
g->sound(x, y, 4, "Snap!");
switch (z->type->size) {
case MS_TINY:
if(seen){
g->add_msg("The %s has been snared!", z->name().c_str());
}
if(z->hurt(20)){
g->kill_mon(g->mon_at(x, y));
} else {
z->moves = 0;
z->add_effect(ME_BEARTRAP, -1);
}
break;
case MS_SMALL:
if(seen){
g->add_msg("The %s has been snared!", z->name().c_str());
}
if(z->hurt(20)){
g->kill_mon(g->mon_at(x, y));
} else {
z->moves = 0;
z->add_effect(ME_BEARTRAP, -1);
}
break;
case MS_MEDIUM:
if(seen){
g->add_msg("The %s has been snared!", z->name().c_str());
}
if(z->hurt(10)){
g->kill_mon(g->mon_at(x, y));
} else {
z->moves = 0;
z->add_effect(ME_BEARTRAP, rng(100, 150));
}
break;
case MS_LARGE:
if(seen){
g->add_msg("The %s has been snared!", z->name().c_str());
}
z->moves = 0;
z->add_effect(ME_BEARTRAP, rng(20, 30));
break;
case MS_HUGE:
if(seen){
g->add_msg("The snare has no effect on the %s!", z->name().c_str());
}
break;
}
g->m.tr_at(x, y) = tr_null;
g->m.add_item(x, y, g->itypes[itm_snare_trigger], 0);
g->m.add_item(x, y, g->itypes[itm_rope_6], 0);
}
void trapfunc::landmine(game *g, int x, int y)
{
g->add_msg("You trigger a landmine!");
@@ -477,12 +603,12 @@ void trapfunc::sinkhole(game *g, int x, int y)
g->add_msg("You step into a sinkhole, and start to sink down!");
if (g->u.has_amount(itm_rope_30, 1) &&
query_yn("Throw your rope to try to catch soemthing?")) {
int throwroll = rng(g->u.skillLevel("throw").level(),
g->u.skillLevel("throw").level() + g->u.str_cur + g->u.dex_cur);
int throwroll = rng(g->u.skillLevel("throw"),
g->u.skillLevel("throw") + g->u.str_cur + g->u.dex_cur);
if (throwroll >= 12) {
g->add_msg("The rope catches something!");
if (rng(g->u.skillLevel("unarmed").level(),
g->u.skillLevel("unarmed").level() + g->u.str_cur) > 6) {
if (rng(g->u.skillLevel("unarmed"),
g->u.skillLevel("unarmed") + g->u.str_cur) > 6) {
// Determine safe places for the character to get pulled to
std::vector<point> safe;
for (int i = g->u.posx - 1; i <= g->u.posx + 1; i++) {
@@ -715,7 +841,7 @@ void trapfuncm::snake(game *g, monster *z, int x, int y)
bool trap::is_benign()
{
if (id == tr_rollmat || id == itm_cot)
if (id == tr_rollmat || id == tr_cot)
return true;
else
return false;
+7 -7
View File
@@ -5,6 +5,8 @@
bool tutorial_game::init(game *g)
{
// TODO: clean up old tutorial
g->turn = HOURS(12); // Start at noon
for (int i = 0; i < NUM_LESSONS; i++)
tutorials_seen[i] = false;
@@ -24,11 +26,9 @@ bool tutorial_game::init(game *g)
g->u.name = "John Smith";
g->levx = 100;
g->levy = 100;
g->cur_om = overmap(g, 0, 0, TUTORIAL_Z - 1);
g->cur_om.make_tutorial();
g->cur_om.save(g->u.name, 0, 0, TUTORIAL_Z - 1);
g->cur_om = overmap(g, 0, 0, TUTORIAL_Z);
g->cur_om = overmap(g, 0, 0);
g->cur_om.make_tutorial();
g->cur_om.save();
g->u.toggle_trait(PF_QUICK);
g->u.inv.push_back(item(g->itypes[itm_lighter], 0, 'e'));
g->u.skillLevel("gun").level(5);
@@ -37,15 +37,15 @@ bool tutorial_game::init(game *g)
for (int i = 0; i <= MAPSIZE; i += 2) {
for (int j = 0; j <= MAPSIZE; j += 2) {
tinymap tm(&g->itypes, &g->mapitems, &g->traps);
tm.generate(g, &(g->cur_om), g->levx + i - 1, g->levy + j - 1, int(g->turn));
tm.generate(g, &(g->cur_om), g->levx + i - 1, g->levy + j - 1, 0, int(g->turn));
}
}
// Start with the overmap revealed
for (int x = 0; x < OMAPX; x++) {
for (int y = 0; y < OMAPY; y++)
g->cur_om.seen(x, y) = true;
g->cur_om.seen(x, y, 0) = true;
}
g->m.load(g, g->levx, g->levy);
g->m.load(g, g->levx, g->levy, 0);
g->levz = 0;
g->u.posx = SEEX + 2;
g->u.posy = SEEY + 4;
+1 -1
View File
@@ -270,7 +270,7 @@ void veh_interact::do_repair(int reason)
werase (w_msg);
bool has_comps = true;
int dif = veh->part_info(sel_part).difficulty + (veh->parts[sel_part].hp <= 0? 0 : 2);
bool has_skill = g->u.skillLevel("mechanics").level() >= dif;
bool has_skill = g->u.skillLevel("mechanics") >= dif;
mvwprintz(w_msg, 0, 1, c_ltgray, "You need level %d skill in mechanics.", dif);
mvwprintz(w_msg, 0, 16, has_skill? c_ltgreen : c_red, "%d", dif);
if (veh->parts[sel_part].hp <= 0)
+3 -3
View File
@@ -204,11 +204,11 @@ const vpart_info vpart_list[num_vparts] =
mfb(vpf_external) | mfb(vpf_obstacle) | mfb(vpf_opaque) | mfb(vpf_openable) | mfb(vpf_roof) | mfb(vpf_no_reinforce) },
{ "windshield", '"', c_ltcyan, '0', c_ltgray, 70, 50, 0, 0, itm_glass_sheet, 1,
mfb(vpf_over) | mfb(vpf_obstacle) | mfb(vpf_no_reinforce) },
{ "blade", '-', c_white, 'x', c_white, 250, 100, 0, 0, itm_carblade, 2,
{ "blade", '-', c_white, 'x', c_white, 250, 100, 0, 0, itm_blade, 2,
mfb(vpf_external) | mfb(vpf_unmount_on_damage) | mfb(vpf_sharp) | mfb(vpf_no_reinforce) },
{ "blade", '|', c_white, 'x', c_white, 350, 100, 0, 0, itm_carblade, 2,
{ "blade", '|', c_white, 'x', c_white, 350, 100, 0, 0, itm_blade, 2,
mfb(vpf_external) | mfb(vpf_unmount_on_damage) | mfb(vpf_sharp) | mfb(vpf_no_reinforce) },
{ "spike", '.', c_white, 'x', c_white, 300, 100, 0, 0, itm_carspike, 2,
{ "spike", '.', c_white, 'x', c_white, 300, 100, 0, 0, itm_spike, 2,
mfb(vpf_external) | mfb(vpf_unmount_on_damage) | mfb(vpf_sharp) | mfb(vpf_no_reinforce) },
// wheel_width(inches)

Some files were not shown because too many files have changed in this diff Show More