Compare commits

...

1749 Commits

Author SHA1 Message Date
Kevin Granade 7c8d5009ac Release 0.7.1 2013-07-18 21:47:16 -05:00
Kevin Granade 210273f3ca Merge remote-tracking branch 'dda/master' into dda-master 2013-07-18 21:47:02 -05:00
GalenEvil 2bc5d630b5 Merge branch 'origin/master' 2013-07-18 21:35:02 -05:00
GalenEvil d9414565ff Merge remote-tracking branch 'origin/pr/2113' 2013-07-18 21:29:50 -05:00
Kevin Granade 5590d9beb9 Merge pull request #2098 from kevingranade/update-msvc-versioning
Update version for MSVC project builds.
2013-07-18 17:58:23 -07:00
Kevin Granade e62ca51fd6 Merge branch 'master' of github.com:CuriousRaven/Cataclysm-DDA into dda-master 2013-07-18 19:55:22 -05:00
GalenEvil 4d31482045 Merge branch 'origin/master' 2013-07-18 19:25:22 -05:00
GalenEvil f116c1bad6 Merge remote-tracking branch 'origin/pr/2105' 2013-07-18 19:19:34 -05:00
GalenEvil 93031408ff Merge remote-tracking branch 'origin/pr/2102' 2013-07-18 19:19:10 -05:00
Kevin Granade 76e3ca7292 Move check for ammo effect outside of time_to_fire() to avoid dereferencing (potentially null) currammo. 2013-07-18 19:09:34 -05:00
GalenEvil 220fec1701 Merge remote-tracking branches 'origin/pr/2104', 'origin/pr/2100' and 'origin/pr/2099' 2013-07-18 19:08:23 -05:00
Kevin Granade ab998b1734 Merge fix to gunmod attachment check. 2013-07-18 18:16:12 -05:00
somerandomlogin b052ca9871 Fix for weapon mods with no ammo types 2013-07-18 17:38:23 +04:00
GalenEvil 9396c17c02 Change in how Vehicle Examination window is displayed so it works in 12x12 View Screens
Added a logging ability for constant values to DebugLog.
2013-07-17 23:45:24 -05:00
Kevin Granade 734cfc40f9 Strip out references to a removed ammunition in spawn lists. 2013-07-17 22:40:02 -05:00
Kevin Granade 401dd4c319 Don't draw item glyphs on top of furniture glyphs. 2013-07-17 21:47:26 -05:00
Kevin Granade f830f19fe0 Merge some sleep fixes. 2013-07-17 20:51:01 -05:00
Kevin Granade 766a707722 Fix typo in spawn list. 2013-07-17 20:03:22 -05:00
Kevin Granade 03f59c5c4b Supress pickup from vehicle when doing autopickup. 2013-07-17 19:07:43 -05:00
Kevin Granade 336820e22e Remove coverage property from wristwatch to prevent ensumberance. 2013-07-17 18:56:58 -05:00
Kevin Granade eeede6a039 Update version for MSVC project builds. 2013-07-17 18:05:42 -05:00
Peter Lacey-Bordeaux 945fe528ff made coughing from smoke wake you up 2013-07-17 16:18:13 -04:00
somerandomlogin b2547996be Vehicle bed sleepiness fix. 2013-07-17 19:47:53 +04:00
Kevin Granade 7f7b54571b Final updates for 0.7 release. 2013-07-16 22:11:59 -05:00
Christian Buskirk ce89fe960d Merge PR #2078 - Autosave option fix 2013-07-16 19:31:13 -07:00
Christian Buskirk 66261402ff Merge PR #2080 - Vehicle saving 2013-07-16 19:30:17 -07:00
Christian Buskirk 7f46a542fe Merge PR #2077 - Folding bike improvements 2013-07-16 19:29:09 -07:00
Kevin Granade 40e85b0353 Allow saving while in a vehicle. Fixes #2064 2013-07-16 20:58:22 -05:00
Kevin Granade c00cd7b9bb Serialize flags and passenger_id members of vehicle components. 2013-07-16 20:57:40 -05:00
Kevin Granade a9e420dc61 Set minimum number of turns between autosave to 1 to prevent div/0 error. Fixes #1922. 2013-07-16 20:07:46 -05:00
Kevin Granade f0271b1cec Convert a manual check for watch flag to use a handy helper method. 2013-07-16 20:03:27 -05:00
Kevin Granade 824b10ea1d Merge remote-tracking branch 'dda/pr/2076' into dda-master 2013-07-16 19:41:19 -05:00
Kevin Granade 4e7d34e05e Merge Accuracy rebalance, AltGr fix, and Blade trap placement fix. 2013-07-16 19:25:35 -05:00
Kevin Granade 38d2a07c65 Drop folding bicycle box items on ground when folding bicycle. 2013-07-16 19:12:54 -05:00
Kevin Granade b2a08ee4e1 Add construction recipe for folding bicycle. 2013-07-16 19:12:01 -05:00
Kevin Granade f772977184 Add folding bicycle to a few spawn groups. 2013-07-16 19:11:33 -05:00
OzoneH3 d0c4519b0d Added wristwatch to itemgroups. 2013-07-16 21:08:01 +02:00
OzoneH3 9cac01cd22 Added a wristwatch. If worn show exact time, otherwise only show the current position of the sun/moon. 2013-07-16 20:59:16 +02:00
Peter Lacey-Bordeaux 7458ef8655 fixed blade trap problem 2013-07-16 12:24:43 -04:00
OzoneH3 8580f7f78f Sun/Moon position instead of precise time for people without a watch. 2013-07-16 17:13:07 +02:00
utunnels 2d200f5af7 Now use left alt to input alt+number because AltGr is right alt in sdl. 2013-07-16 16:17:06 +08:00
Christian Buskirk 3ae6a1a8de Extend rebalance to new weapons/ammo 2013-07-15 23:35:19 -07:00
Christian Buskirk 0667b20125 Solve merge conflicts 2013-07-15 23:32:19 -07:00
Christian Buskirk ff57ac89f5 Syntax fix 2013-07-15 22:52:37 -07:00
Christian Buskirk e09af5d70c Update NPC targeting confidence function 2013-07-15 22:27:38 -07:00
Christian Buskirk 5a689e44c8 Made perception and Dexterity no longer display 0 as a "bonus" 2013-07-15 21:57:20 -07:00
Christian Buskirk 682174ce74 Overall dispersion reduction
Total ammo+gun reduction of 14
2013-07-15 20:59:54 -07:00
Kevin Granade d2a3acd821 Catch up changelog to current feature list. 2013-07-15 22:51:46 -05:00
Stevensonz e91193ee04 New Revolvers Ammo, Recipe
Some Revolver love
2013-07-15 21:49:16 -05:00
Kevin Granade 9f03f153da Fix bad material labels, addresses #2028. 2013-07-15 19:29:01 -05:00
Kevin Granade c24c775694 Merge too much stuff to list. 2013-07-15 18:21:24 -05:00
Peter Lacey-Bordeaux 37fd1058cc removed unused variable 2013-07-15 13:27:15 -04:00
Peter Lacey-Bordeaux 8e4b775338 changed get_direction in bionics to choose_adjacent 2013-07-15 13:24:20 -04:00
Christian Buskirk 2218ca1009 Fix typo
Thanks to OzoneH3 for catching that.
2013-07-15 05:05:10 -07:00
Christian Buskirk a39dfc3ab4 Fix Advanced UPS plutonium cell duplication
Closes issue #1780
2013-07-15 04:55:23 -07:00
Christian Buskirk 95abc56e14 Unify painkiller usage
Closes issue #1880
2013-07-15 04:31:31 -07:00
Christian Buskirk 5ea66d8bdf Clean outside cache logic 2013-07-15 03:23:40 -07:00
Christian Buskirk 00e5091d61 Clean pocket logic 2013-07-15 03:23:31 -07:00
OzoneH3 9e32ac83d4 Fixed list items compare feature 2013-07-15 12:22:46 +02:00
OzoneH3 3c23b7dadb Added option to enable/disable zombie revival 2013-07-15 11:25:06 +02:00
utunnels 31899327e2 Quick fix to missing popup printf parameters. 2013-07-15 17:13:16 +08:00
carnie 94f93110b5 Split game::autosave() into two - quicksave() handles the vehicle, movement and item checks (i.e. anything that could potentially lead to problems by saving rapidly or due to bugs) and then handles the saving. autosave() handles the time-delay checks and then calls quicksave()
Removed some copypasta'd autosave() code and replaced it with quicksave().

keymap not updated, I'd recommend 'q' as the quicksave key.
2013-07-15 10:10:56 +01:00
Christian Buskirk 7081984ab4 Merge PR#1998 - Ammotype to std::string
Conflicts:
	data/raw/items/ammo.json
	veh_interact.cpp
	vehicle.cpp
2013-07-15 02:02:15 -07:00
OzoneH3 49448b0f54 Added Auto Pickup Safemode 2013-07-15 10:59:17 +02:00
Christian Buskirk cfa8ac17e3 Merge PR#2058 - Fix NPC item give crash 2013-07-15 01:42:00 -07:00
Christian Buskirk f14d24ec56 Mrege PR#2038 - Remove inside dynamic spawns 2013-07-15 01:32:45 -07:00
Christian Buskirk f5a8fe533b Merge PR#2056 - Turret drop nerf 2013-07-15 01:19:20 -07:00
Christian Buskirk 9ac3e63f0a Merge PR#2051 - Vehicle fling fix 2013-07-15 01:16:22 -07:00
Christian Buskirk 392ca258c0 Merge PR#2054 - Power armor/Mutation interaction 2013-07-15 01:10:22 -07:00
Christian Buskirk 0bac7ba12b Merge PR#2046 - Classic monster fix 2013-07-15 01:02:05 -07:00
OzoneH3 8b3eb919aa Added a border to the vehicle menu and centered it. 2013-07-15 10:01:49 +02:00
GalenEvil 12f57e1871 Fiddled with the popup message for when an NPC gives the player something to avert a segfault. 2013-07-15 01:18:33 -05:00
Kevin Granade eb37236a3a Merge text wrap and key entry fix, increased food ingredient spawns, destructable and stocked ovens, and a fix to a friendly monster movement induced hang. 2013-07-14 22:35:32 -05:00
Kevin Granade c5ecb9b2b5 Reduce volume of items dropped by turrets, and ratio of junk parts to ammo. 2013-07-14 14:31:09 -05:00
TireExaminer 82772439ba Fixes friendly monster movements. 2013-07-14 15:27:15 -04:00
Kevin Granade 16ae0f2ba0 Use player::takeoff() to handle shedding armor due to mutation. 2013-07-14 13:17:51 -05:00
Kevin Granade ad76ca8fea Auto-drop power-armor components if power armor is removed. 2013-07-14 13:17:20 -05:00
Kevin Granade 7ad9c75e7f Clear controlling_vehicle flag when dismounting a player from a vehicle. 2013-07-14 10:51:55 -05:00
somerandomlogin 4729e4ac69 Cleaning up. 2013-07-14 18:22:27 +04:00
somerandomlogin 441a6ee6ee Ovens and cupboards fixes. 2013-07-14 18:01:29 +04:00
utunnels 23a1d95d18 Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into wwfix 2013-07-14 10:58:59 +08:00
utunnels fb09d161e0 Fix % format string bug for @ menu info window. 2013-07-14 10:58:01 +08:00
Kevin Granade 0b4f01b5ee Disable monster spawn generation of non classic monsters in classic zombie mode. 2013-07-13 20:23:18 -05:00
Kevin Granade 4edd31d66c Make counterattacks a free action to avoid counter-locking the player. 2013-07-13 18:38:49 -05:00
cib be968a9dff Made salt more common. 2013-07-14 00:27:03 +02:00
Kevin Granade d7577cbae6 Prevent dynamic spawning creatures inside houses. 2013-07-13 17:05:57 -05:00
Christian Buskirk 44507e7a24 Merge PR#2034 - Examine crash fix 2013-07-13 13:56:58 -07:00
Christian Buskirk f399387738 Merge PR#1962 - No negative divergence 2013-07-13 13:48:50 -07:00
Christian Buskirk 39a2073959 Merge PR#2014 - FMJ cleanup 2013-07-13 13:24:22 -07:00
Christian Buskirk ff7d545aa3 Merge PR#2032 - new recipes 2013-07-13 13:03:53 -07:00
Christian Buskirk ac460114c5 Further merge fixes 2013-07-13 12:31:32 -07:00
Christian Buskirk e623d9285e Merge PR#1890 - Folding bicycles
Conflicts:
	data/raw/items/tools.json
	item_factory.cpp
	iuse.cpp
	iuse.h
2013-07-13 12:18:46 -07:00
somerandomlogin 0ddd311674 Bugfix: crash when listing items around the player 2013-07-13 22:49:45 +04:00
utunnels 020534ef18 Use only right alt key to input alt+number combinations. 2013-07-13 23:53:24 +08:00
utunnels 2a70cc6231 Merge branch 'wwfix' of github.com:utunnels/Cataclysm-DDA into wwfix 2013-07-13 23:51:20 +08:00
RexWolf163ru 27615c07b0 Some new crafting recipes. 2013-07-13 01:57:14 -05:00
Kevin Granade 6bb5133271 Rejigger towel effect to remove wet morale penalty instead of trying to counteract it. Spelling change. 2013-07-13 01:28:42 -05:00
Kevin Granade 755587c7ba Cleanup missing brackets and NPC skullsplosions (TM Nickboom). 2013-07-13 01:28:42 -05:00
Kevin Granade 6454dd6936 Merge towels, NPC vehicle interactions, cap smoke damage, and consumable accounting. 2013-07-13 01:26:12 -05:00
utunnels dd992ef821 Fix player info menu word wrapping. 2013-07-13 13:30:54 +08:00
Christian Buskirk 9ffd98c43b Merge PR#1833 - translation.h file addition 2013-07-12 21:57:32 -07:00
Kevin Granade b1289f2f0c Fix logic fail preventing removal of parts on mount points. 2013-07-12 22:12:54 -05:00
Kevin Granade a5d360858d Fix a typo. 2013-07-12 21:11:05 -05:00
Kevin Granade 6c2a0abc71 Move tire change operation to its own menu item. 2013-07-12 21:02:54 -05:00
cib 8d56d5fb94 Fix issue #2000
Only go into the new item use case for boots, not for any item that has an iuse.
2013-07-12 19:23:13 +02:00
cib be8e2a50dc Put a cap on the duration of smoke effect.
Losing the torso health bar 5x over fully because you spent a while in an underground cellar with fire, trying to wait for it to go out is ridiculous.
2013-07-12 15:39:02 +02:00
GalenEvil dd5a9aad31 Added missing iuse_function_list value for Towels so they can actually be used. 2013-07-11 21:07:47 -05:00
Kevin Granade 5cb0826632 Merge pull request #2015 from bxshi/fix_contributing_link_in_readme
change link of CONTRIBUTING.md to CleverRaven's repo
2013-07-11 16:56:10 -07:00
Kevin Granade 7a265293f9 Merge bionic menu simplification. 2013-07-11 18:55:23 -05:00
Costin Olteanu df871a1446 NPC checks path before attempting to leave vehicle 2013-07-11 10:22:37 +03:00
Christian Buskirk 44eaf8e4e9 Merge PR#2008 - Solar panel fix 2013-07-11 00:13:29 -07:00
Costin Olteanu f37a8d1feb NPCs no longer enter moving vehicles 2013-07-11 10:06:18 +03:00
Baoxu Shi ba33cf8704 change link of CONTRIBUTING.md to CleverRaven's repo 2013-07-11 14:01:44 +08:00
Kevin Granade d2978b2c19 Change ammo type identifiers to lower case. 2013-07-10 23:44:45 -05:00
Christian Buskirk 27b71c7703 Merge PR#2011 - Add skewers to food recipes 2013-07-10 20:29:56 -07:00
Christian Buskirk 1f4603ba26 Merge PR#2010 - Fix quest book materials 2013-07-10 20:29:12 -07:00
Kevin Granade f724c9da04 Remove some redundant FMJ variants, and make the descriptions clearer that FMJ isn't armor piercing. 2013-07-10 22:25:57 -05:00
Peter Lacey-Bordeaux e7b444debb fixed typo 2013-07-10 22:29:04 -04:00
Peter Lacey-Bordeaux fe37756898 fixed battery error 2013-07-10 22:15:12 -04:00
Peter Lacey-Bordeaux e64767b28c removed legacy bionics code 2013-07-10 22:08:06 -04:00
Kevin Granade 835e098b09 Add skewer to cooking recipes. 2013-07-10 21:04:33 -05:00
Kevin Granade 71b8df3f4b Fix incorrect material labels on quest targets. 2013-07-10 20:57:12 -05:00
Kevin Granade dc7ce68266 Remove redundant default argument assignment to make Clang happy. 2013-07-10 20:47:21 -05:00
Kevin Granade 8fe6aee088 Merge autopickup improvements. 2013-07-10 19:24:56 -05:00
Peter Lacey-Bordeaux 58e1a7dfc3 Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2013-07-10 20:22:26 -04:00
Kevin Granade efb547710a Towel function, typo corrections, container JSONification, and MAC compile fixes. 2013-07-10 18:58:18 -05:00
Kevin Granade 9d30a62045 Base power production from solar panels on sunlight at the panel's location instead of the vehicle origin, and ignore vehicle roof. 2013-07-10 17:47:35 -05:00
cib 90c6469c19 JSONize container templates. 2013-07-10 21:40:38 +02:00
Joseph C af817c6b6a Gihub, the best site for all your gi needs 2013-07-10 14:23:03 -05:00
OzoneH3 f7171fe70d Autopickup rules are now case insensitive. 2013-07-10 11:48:55 +02:00
mattbrk eaf93728ff Merge branch 'osx' of https://github.com/mattkelr/Cataclysm-DDA into osx 2013-07-10 02:07:37 -04:00
mattbrk 346f78da6b edit 2013-07-10 02:05:36 -04:00
Matt Keller f0bd034cb2 Update COMPILING_osx.md 2013-07-10 01:59:29 -04:00
Matt Keller 34ba3160d2 Update COMPILING_osx.md 2013-07-10 01:56:14 -04:00
mattbrk 482f33f92b tighten up howto 2013-07-10 01:52:28 -04:00
Kevin Granade b716753531 Convert ammotype from an enum to a std::string to allow more values. 2013-07-09 22:47:29 -05:00
GalenEvil 1ee77c56fd ... and left off the c_str() on the messages. Fixed now. 2013-07-09 19:17:30 -05:00
GalenEvil 50cb9acbec typo in morale modifier name 2013-07-09 19:14:58 -05:00
GalenEvil 640571556c Added iuse function for absorbant materials, namely towels, so that the player can dry themself. Adds morale bonus for going from wet->dry 2013-07-09 19:12:44 -05:00
OzoneH3 0fa471a267 Added funktion to test all items against a rule and see the matching results. 2013-07-09 20:30:38 +02:00
Peter Lacey-Bordeaux c31d362b05 Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2013-07-09 11:17:03 -04:00
OzoneH3 7c480131a3 Merge branch 'autopickup' of https://github.com/OzoneH3/Cataclysm-DDA into autopickup 2013-07-09 17:03:54 +02:00
OzoneH3 5d64700e69 Auto pickup with characterspecific rules. Advanced rules matching with * wildcard. 2013-07-09 17:03:21 +02:00
GalenEvil 8922640a45 Stupid additional typo... 2013-07-09 02:31:19 -05:00
GalenEvil ea27ba067f Fixed typos for floatation_vest armor id/name
Fixed typos for floatation_vest tag "FLOATATION" and references to it in game::vertical_move(...) and player::swim_speed(...)
2013-07-09 02:07:41 -05:00
mattbrk 510cdd5ec1 edit 2013-07-09 02:28:19 -04:00
mattbrk 8ce5a3a28a use -lSDL, -lSDL_ttf or frameworks for osx 2013-07-09 02:16:09 -04:00
GalenEvil 501cc69330 Signed SIGNOFF file 2013-07-08 23:43:20 -05:00
GalenEvil 280a27c422 Merge remote-tracking branch 'origin/pr/1979' 2013-07-08 22:34:51 -05:00
GlyphGryph 4e6bd58d2e Merge remote-tracking branch 'core/pr/1920'
Conflicts:
	data/raw/items/ammo.json
2013-07-08 22:37:01 -04:00
Kevin Granade 2f6895476c Merge code cleanups, performance enhancements, and pickles.
Conflicts:
	data/raw/item_groups.json
	data/raw/items/comestibles.json
2013-07-08 20:38:34 -05:00
Kevin Granade e2029587f0 Add floatation vest and associated logic. 2013-07-08 19:38:40 -05:00
OzoneH3 b6d8cd5978 Merge branch 'autopickup' of https://github.com/OzoneH3/Cataclysm-DDA into autopickup 2013-07-08 18:31:11 +02:00
OzoneH3 f76074b8bc Auto pickup preparations for characterspecific rules and options 2013-07-08 17:16:02 +02:00
Darth Servo 6d741ccb52 Directional Antenna fix 2013-07-08 10:55:54 -04:00
Peter Lacey-Bordeaux 94c06e68f2 Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2013-07-08 08:48:56 -04:00
utunnels 5ad6920325 Minor fix to waddch to avoid extra erease_utf8_by_cw call. 2013-07-08 11:43:49 +08:00
utunnels ab2d34ea01 Try to reduce cursorx_to_position call for map window. Move cursor options after sdl window is created to prevent random segfaults. 2013-07-08 11:32:13 +08:00
RJ Costanzo a738de0474 Pickles 2013-07-07 21:35:46 -04:00
Zaweri Runewright 9cc2d5ccd6 Add new fmj rounds to item spawn lists. 2013-07-07 18:12:59 -05:00
Zaweri Runewright caaea1f0f2 Add gold as a crafting material and add it to ammunition crafting recipes. 2013-07-07 18:12:58 -05:00
Zaweri Runewright 8cf7fada84 Add FMJ versions of many ammunition types. 2013-07-07 18:12:58 -05:00
Kevin Granade a022c908bd Merge pull request #1967 from narc0tiq/osx-cross-detect
Compiling OSX doesn't automatically imply OSX tar.
2013-07-07 16:12:17 -07:00
Octav Sandulescu 85e5683d46 Compiling OSX doesn't automatically imply OSX tar.
Hopefully, detecting the underlying OS will help there.
2013-07-08 00:02:04 +01:00
Peter Lacey-Bordeaux dec0d7a7e2 Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2013-07-07 16:12:04 -04:00
Kevin Granade e519a0fe77 Add entries for auto_pickup files to windows project files. 2013-07-07 15:06:48 -05:00
cib 811c412200 Removed game argument from player::add_disease 2013-07-07 21:59:46 +02:00
Kevin Granade 32c4ea9e54 Merge autopickup option menu. 2013-07-07 14:37:53 -05:00
Peter Lacey-Bordeaux a6ea4f7941 Merge remote-tracking branch 'myfork/master' into choose_adjacent 2013-07-07 15:22:00 -04:00
Peter Lacey-Bordeaux b19df88301 finished changing over getting direction inputs to choose_adjacent 2013-07-07 15:20:14 -04:00
Kevin Granade 186a5aa954 Remove unused variables. 2013-07-07 13:52:14 -05:00
Kevin Granade 9301114316 Merge a batch of small fixes. 2013-07-07 13:46:52 -05:00
Kevin Granade c0cfc62e10 Merge more i18n and disease identifier change. 2013-07-07 13:43:47 -05:00
Kevin Granade a15abe7185 Fix a typo in ranged.json. 2013-07-07 13:43:39 -05:00
Kevin Granade b802684082 Merge a pile of new items.
Conflicts:
	data/raw/recipes.json
2013-07-07 13:19:26 -05:00
Peter Lacey-Bordeaux 2bed854469 debugging direction changes 2013-07-07 13:55:10 -04:00
Peter Lacey-Bordeaux e60739392e Changed iuse and iexamine to use choose_adjacent 2013-07-07 13:25:41 -04:00
Kevin Granade 615feebe5f floor divergence contributed from skills and stats at 0, no negative divergence. 2013-07-07 11:31:48 -05:00
Peter Lacey-Bordeaux 4b29d396f3 Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2013-07-07 11:37:39 -04:00
mattbrk d1889b2061 Merge branch 'osx' of https://github.com/mattbrk/Cataclysm-DDA into osx 2013-07-07 10:47:07 -04:00
mattbrk 0c51a373da remove unneeded osx var, tar -s for osx bindist
use command line/env variables for osx CXXFLAGS, LDFLAGS.
`make bindist' works for osx build:
`tar --transform' doesn't work on osx, use `tar -s' instead.
add all targets/obj dirs to 'clean' target
2013-07-07 10:45:46 -04:00
Matt K 7433e4f552 Update COMPILING_osx.md 2013-07-07 10:43:31 -04:00
Matt K 0f8e60b717 Update COMPILING_osx.md 2013-07-07 09:50:42 -04:00
mattbrk 892cdb6237 remove unneeded osx var, tar -s for osx bindist
use command line/env variables for osx CXXFLAGS, LDFLAGS.
`make bindist' works for osx build:
`tar --transform' doesn't work on osx, use `tar -s' instead.
2013-07-07 09:29:54 -04:00
Voker57 35fc6ddd90 Make glass jars more common 2013-07-07 13:49:00 +04:00
Voker57 a48dda91dc Buffed wood burning to compensate for field code changes 2013-07-07 13:47:31 +04:00
Voker57 f4f411937a Added woods soup 2013-07-07 13:47:10 +04:00
Voker57 1bdcda2a7c Added kompot 2013-07-07 13:46:49 +04:00
OzoneH3 13847fb6a0 Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA into autopickup 2013-07-07 10:45:59 +02:00
RJ Costanzo 89ffbe1b8f Pipe shotgun+sawn version 2013-07-06 23:01:43 -04:00
Jonathan Frederick 5660c816e9 Fix spelling error in 'code_doc/GAME_BALANCE' 2013-07-06 18:50:10 -07:00
Vollch 0de109a437 Size check 2013-07-07 03:45:26 +04:00
Eric 5f4416c10a Monsters killed by bio_ods or quills/spines mutation drop corpses/loot 2013-07-06 16:26:03 -07:00
Kevin Granade 923db00ead Revert conditional setting of CXX and removal of CSSFLAGS from linker line. 2013-07-06 18:22:47 -05:00
Kevin Granade f8000e1438 Revert conditional assignment of LD, which is not working as expected. 2013-07-06 17:50:37 -05:00
Kevin Granade 472a993be6 New items, item name fix, clang build fix and sweep attack fix. 2013-07-06 17:42:00 -05:00
RJ Costanzo 4a111367d8 Nail rifle 2013-07-06 18:35:49 -04:00
Vollch 75cb306055 A bit cleaner and name fix 2013-07-07 01:17:29 +04:00
Kevin Granade ab10751ee6 Add folding bicycle and associated logic. 2013-07-06 15:28:01 -05:00
Kevin Granade 41426c2c99 Add vehicle tags field to hold vehicle metadata. 2013-07-06 15:22:03 -05:00
Kevin Granade 710c77fcb6 Cleanup veh_interact::cant_do() and fix tire change requirement checking. 2013-07-06 15:22:03 -05:00
Kevin Granade aaf4af0d8a Remove game *g parameter from palyer::i_rem(). 2013-07-06 15:15:57 -05:00
RJ Costanzo 1e410d8de1 Useful stuff final hopefully 2013-07-06 13:46:35 -04:00
Vollch 76642f5e89 Boot knife 2013-07-06 21:16:34 +04:00
cib fa893b308f Removed non-existing file from windows code::blocks project. 2013-07-06 17:44:43 +02:00
Eric 55c06c8802 Monsters killed by wide attacks drop corpses/loot 2013-07-06 08:34:58 -07:00
cib 8ef9408864 Merge remote-tracking branch 'main/master' into disease_as_string 2013-07-06 17:14:42 +02:00
OzoneH3 d27a45675d Remove Codeblocks file 2013-07-06 16:32:47 +02:00
OzoneH3 ca2f4f52bd Missing Files .. 2013-07-06 16:28:04 +02:00
OzoneH3 895ac666bd Added Auto Pickup Rules Manager in help menu ?3
Fixed an itemcompare Bug.
2013-07-06 16:26:42 +02:00
cib bf73d905c4 Converted disease identifiers from enum to string. 2013-07-06 15:21:58 +02:00
Tommy a59d6883ca Fix minor spacing issue and convert a couple missed strings. 2013-07-06 23:20:25 +12:00
cib b6bd2f3ea7 Make cataclysm compile in clang.
1. clang didn't like `point look_debug(point point=point(-256,-256));`
2. CXX is now set with ?= so if you have CXX=clang++ set in your environment, it won't be overriden.
3. Even though $(LD) was used to compile the cataclysm executable, it was passed arguments that only gcc and not ld accepts. Thus changed it from $(LD) to $(CXX)
2013-07-06 13:16:50 +02:00
cib a8c83640c4 item.name is now initialized from itype in constructor 2013-07-06 12:50:29 +02:00
Tommy 5f5a5c82a0 Update lang/po/cataclysm-dda.pot. 2013-07-06 18:05:50 +12:00
Tommy 2c5685be49 Finish i18n for newcharacter.cpp. 2013-07-06 18:04:24 +12:00
Tommy 71d8814b4a newcharacter.cpp: description tab i18n. 2013-07-06 17:52:31 +12:00
Tommy a416764149 newcharacter.cpp: skills tab i18n. 2013-07-06 17:28:56 +12:00
Tommy 6968084578 Remove unnecessary \n's from data/raw/skills.json. 2013-07-06 17:28:36 +12:00
Tommy 3ce1b2009a newcharacter.cpp: professions tab i18n. 2013-07-06 17:21:36 +12:00
Tommy 0543803a10 Remove unnecesary \n's from data/raw/professions.json. 2013-07-06 17:21:01 +12:00
Tommy 43e7c09cba newcharacter.cpp: traits tab i18n. 2013-07-06 17:12:17 +12:00
Tommy 0394870246 Getextify traits and mutations. 2013-07-06 17:03:26 +12:00
Tommy 180faffc65 newcharacter.cpp: stats tab i18n. 2013-07-06 16:42:59 +12:00
Tommy f925d544c5 Add skills, professions and bionics to lang/extract_json_strings.py. 2013-07-06 16:22:43 +12:00
Tommy 6814c82b4a utf8_width(): Try to continue parsing even when unknown character is found. 2013-07-06 14:54:47 +12:00
Tommy bad2f57b94 Fix utf8_getch incorrectly identifying some obscure characters as overlong. 2013-07-06 14:53:41 +12:00
Kevin Granade 13b3711822 Fix auto_pickup typo. 2013-07-05 21:42:04 -05:00
Kevin Granade 5286878d8a Merge autopickup, bionic cleanup, sludge crawler, new professions, fix monster group decay, and limit teleportation distance.
Conflicts:
	mapdata.h
2013-07-05 21:36:51 -05:00
Kevin Granade c43bfe41fd Merge removal of map::itypes. 2013-07-05 18:23:03 -05:00
Darth Servo 546a8a4a13 Recipes for Plastic and Steel Jerrycans 2013-07-05 15:17:39 -04:00
Eric 8565b77409 Woops, forgot to cancel the tunnel. Also, add different error message. 2013-07-05 11:57:48 -07:00
Eric d84bccd7aa Limit max probability travel distance 2013-07-05 11:49:04 -07:00
Octav Sandulescu 3625b660e4 Remove unused map.itypes; use g->itypes where needed.
It was only two places.
2013-07-05 19:21:20 +01:00
OzoneH3 7a37eb14e5 Merge pull request #1927 from yobbobanana/german
Add raw translation file for de_DE.
2013-07-05 11:00:34 -07:00
Tommy 58a1c6d486 Add raw translation file for de_DE. 2013-07-06 04:28:58 +12:00
Kevin Granade 75b5e97d7b Merge pull request #1897 from GlyphGryph/remove_fourth
Removed 4th of July profession.  Bit late, maybe no one will notice.
2013-07-05 08:31:56 -07:00
Fergus Dall c6499013f1 Make mongroups die propperly, even if the queen dies at a distance 2013-07-05 15:02:58 +09:30
Fergus Dall d50a0a3a8b Save/load monster group dying status properly 2013-07-05 15:02:57 +09:30
Fergus Dall f48fff8f42 Add triffid hearts and fungal spires to the appropriate monster groups 2013-07-05 15:02:48 +09:30
utunnels e2dab3aaaf Bind textdomain with UTF-8. 2013-07-05 11:47:45 +08:00
Kevin Granade 8c464145e7 Convert ammo_effects field to a tags set instead of a binary flag field. 2013-07-04 18:46:15 -05:00
Kevin Granade 829275266e Add tags_from_json() method to load a list of strings into a set. 2013-07-04 18:46:15 -05:00
Kevin Granade 3a1b75af35 Move final few ammo definitions to JSON. 2013-07-04 18:46:15 -05:00
GlyphGryph f360bb1195 Removed the speed penalty from the sludge field until the sludge crawler can ignore it. 2013-07-04 18:42:52 -04:00
GlyphGryph 3d48f8b209 Moved field definitions to their own header file. 2013-07-04 18:27:47 -04:00
GlyphGryph 78db4ecb9c Included logic for reducing moves based on fields.
Unfortunately, this logic leads to some making it extremely dfficult to track move penalty exclusions, so the sludge crawler currently slows himself to a standstill with his slime.
2013-07-04 18:06:15 -04:00
NicholasDV 7d11865807 Fix of syntax error in recipes.json
Closes #1911

First aid kit had a small syntax error in the form of a comma at
a place where a comma should not be. This fixes it.
2013-07-04 17:47:35 -04:00
Peter Lacey-Bordeaux 26a04f918f Merge branch 'master' of https://github.com/CleverRaven/Cataclysm-DDA 2013-07-04 16:59:43 -04:00
Peter Lacey-Bordeaux ba03815a81 moved +powerlvl outside of the for loop 2013-07-04 16:46:28 -04:00
Peter Lacey-Bordeaux 23d459606b fixed small bug with water extractor 2013-07-04 16:35:39 -04:00
Peter Lacey-Bordeaux 63ace3b7f6 simplified both of the bionics that handle water, now uses g->handle_liquid 2013-07-04 16:33:23 -04:00
OzoneH3 a05431eeab Auto Pickup all items with 0 Volume and Weight 2013-07-04 21:55:57 +02:00
Kevin Granade fbcd715536 Merge first aid recipe, opsolete code cleanup, monster property fixes, armor menu reformat, utf8 handling fixes, building positioning fix, and furniture handling fix. 2013-07-04 14:45:34 -05:00
GlyphGryph 98c812aae8 Added basic sludge crawler monster
Monster exists, drops fields appropriately, fields do nothing at the moment
2013-07-04 14:48:48 -04:00
Christian Buskirk 6f4e4a9332 Fix FEMA tents 2013-07-04 11:41:03 -07:00
Christian Buskirk 71333c8f9c Fix tents not counting as indoors 2013-07-04 11:40:56 -07:00
Vollch 9bc2402b22 Correct placement of big buildings 2013-07-04 20:58:50 +04:00
OzoneH3 2a6821ff56 Merge branch 'autopickup' of https://github.com/OzoneH3/Cataclysm-DDA into autopickup 2013-07-04 18:30:20 +02:00
utunnels 7f91455cf5 Merge branch 'patch-1' of github.com:utunnels/Cataclysm-DDA into test 2013-07-04 23:56:07 +08:00
utunnels ca2c33abbf Merge branch 'alt-code' of github.com:utunnels/Cataclysm-DDA into test 2013-07-04 23:53:48 +08:00
utunnels 68f25feb5f Misc fixes. 2013-07-04 23:44:49 +08:00
OzoneH3 4c7713ad20 Autopickup 0 Volume Items 2013-07-04 17:18:45 +02:00
utunnels eaf15056cf Misc fixes. New utf_substr function to cut utf8 string. Rewrite many scattered string wrapping code using functions from output.cpp. 2013-07-04 23:14:23 +08:00
OzoneH3 8281db69c4 Small Inventory menu display enahncement. 2013-07-04 12:28:12 +02:00
OzoneH3 12d061aaa1 Reworked sort_armor (+) page to fit on 80x25 and centered it. 2013-07-04 11:56:52 +02:00
cib 155b363140 Removed the mapitems global and all references to it.
This global has been superceded by data/raw/item_groups.json
2013-07-04 10:05:40 +02:00
NicholasDV fdee5ee937 Merge branch 'master' into smallFixes 2013-07-04 01:09:41 -04:00
GlyphGryph ad6b1aea7e Removed 4th of July profession 2013-07-04 00:39:05 -04:00
utunnels 6982c8eeb7 Terminus!
Since sdlcurse changes its font scanning order, fixedsys should be renamed to fixedsysTTF because there are system fonts called Fixedsys as well. Besides wincurse uses data/termfont as the default font, SDL can just use the same one to avoid troubles.
2013-07-04 12:33:38 +08:00
Christian Buskirk 5a7ec3edb1 Merge 4th of July Effects 2013-07-03 21:26:18 -07:00
NicholasDV 4b67092933 Fixes a few flag issues on monsters
Closes #1878
Closes #1879

Specifically deals with 1878 by making the moose aggressive to those that are
near it, and to those that harm it. Deals with 1879 by giving the jabberwock
the MF_POISON flag, so that when it is butchered it will give tainted flesh
rather than regular flesh.

Note: The fix to 1878 might need small balancing changes, and feel free to tell
me if it does so that I may fix it.
2013-07-04 00:15:56 -04:00
utunnels 8208cc6c3c Bug fix. 2013-07-04 11:50:27 +08:00
utunnels c1f2c34695 Simulate alt+number input for SDL version. 2013-07-04 11:17:07 +08:00
Kevin Granade 02e4099bb5 Merge too many fixes to name. 2013-07-03 21:40:56 -05:00
cib 1ca7f2a6c8 Generated item_groups.json weights based on item rarities. 2013-07-04 02:22:59 +02:00
utunnels 380b52643f Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into utf8 2013-07-04 08:18:37 +08:00
cib 3725fbc9e0 Completely converted over all item spawns to item_groups.json
This includes:
- Map spawn functions
- NPC random gear
- Monster clothing drops

Furthermore this commit includes:
- Replaced all mi_ enum instances with strings
- Added a helper function to check if an item is in a group
- Removed the mi_ enum itself
- Emptied mapitemsdef.cpp (will remove later)
2013-07-04 00:26:01 +02:00
Vollch 4dfd730eb2 Fixes #1884 2013-07-04 01:03:00 +04:00
GlyphGryph 40f73f671b Fixed accidently changing the chain smoker profession. 2013-07-03 16:38:56 -04:00
cib 9763d53e5f Monster drops now use item_groups.json
This requires several changes:
- monitemsdef.cpp to use strings for item groups instead of mi_foobar
- the spawn code in monster.cpp to use the new item_controller->id_from random item selection function instead of manually selecting an item
2013-07-03 22:22:27 +02:00
cib 7b7c95eedc Ported all the item groups from mapitemsdef.cpp to item_groups.json
Script used for conversion.
2013-07-03 22:17:43 +02:00
Voker57 ecae49a0c2 Restored burning wood yield buff, lost in merge 2013-07-04 00:15:19 +04:00
Darth Servo 4f66ede64a Recipe for First Aid 2013-07-03 14:51:15 -04:00
Voker57 f54ad1a0f5 150% more heat from fires
Because standing close to a raging fire at 18C shouldn't leave you chilly
2013-07-03 22:08:01 +04:00
Christian Buskirk f38fdeed58 Merge PR #1866 - Further recipe fixes
Conflicts:
	data/raw/recipes.json
2013-07-03 10:50:10 -07:00
Christian Buskirk 51c27dadbf Merge PR #1875 - Small Fixes 2013-07-03 10:31:44 -07:00
utunnels aabbec53b7 Filter out '\0' for wincurse, because unprintable characters causes deadly slowdown. 2013-07-03 23:51:49 +08:00
utunnels dc396fe954 Fix curses and cursesport conflict. 2013-07-03 23:28:19 +08:00
utunnels 7ba00561e8 Add missing cursesport.cpp. Remove unused headers in sdlcurse.cpp. 2013-07-03 21:28:19 +08:00
Tommy dec2dc7bf0 Tweak the curses header. 2013-07-03 23:10:21 +12:00
NicholasDV 46be778aee Added primitive_hammer as a possible tool for certain recipes
Recipes altered: stone hammer, brazier, metal tank, crowbar. Each of these
were capable of being built already by a regular 'hammer' object or by a
'rock'. As a result, the rock hammer (primitive_hammer) is completely reasonable
to be a possible tool as well.
2013-07-03 03:38:46 -04:00
utunnels eb8e823b66 Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into utf8 2013-07-03 15:22:50 +08:00
NicholasDV dbf295d0e2 Small fix to last commit
Specifically, forgot a few commas that led to syntax errors. My fault,
but fixed up in this small commit.
2013-07-03 03:06:31 -04:00
utunnels 64bf5e2306 GDI version can now print utf8 characters normally. 2013-07-03 14:54:22 +08:00
utunnels 12128cc347 Move shared code in wincurse.cpp and sdlcurse.cpp to cursesport.cpp. Let SDL version use same font file as GDI version. 2013-07-03 14:51:03 +08:00
NicholasDV c5132d553f Allows the Integrated Toolset to be used in a few newer crafting recipes
Fixes #1734

Specifically, adds it as an available tool in the chainsaw recipe, as well
as the three crossbow recipes to replace common tools.
2013-07-03 02:18:57 -04:00
NicholasDV d1d96ef1d0 Small correction to 'Survival' skill description
Closes #1751

Specifically removes the line about being able to 'clean' tainted meat
when you have a high survival skill, due to the fact that this is not
true. Easier (and frankly, makes more sense) to correct that small
detail than it is to add in a system of cleaning the tainted meat due
to it. If anyone does so, feel free to re-add the line, as it is only
a tiny change.
2013-07-03 01:55:26 -04:00
NicholasDV 26565dbef6 Small spelling error fixes
Closes #1853 by changing all instances of, "oepn_sarcophogus" with "open_sarcophogus",
thereby fixing the typo.
2013-07-03 01:45:08 -04:00
GlyphGryph 3f13bd6bc1 Added wine, a new shirt, and the patriot profession. The last bit should be removed after the 4th of July has passed, the wine can stay. 2013-07-03 00:30:31 -04:00
Kevin Granade 3d931cd9ab Merge pull request #1862 from yobbobanana/po_files_2
Commit raw translation files for fr_FR, ru_RU, zh_CN, pt_PT.
2013-07-02 21:01:20 -07:00
mattbrk 3c1251c366 edit 2013-07-02 23:06:00 -04:00
mattbrk 1b5d082db5 edit 2013-07-02 23:03:27 -04:00
mattbrk 001849272f edit 2013-07-02 23:02:48 -04:00
mattbrk 7d0983c839 edit 2013-07-02 22:59:16 -04:00
mattbrk 89d2f9893c learnin' markdown... 2013-07-02 22:53:28 -04:00
mattbrk 66a61e239f edit 2013-07-02 22:41:39 -04:00
mattbrk 51b7cef821 edit 2013-07-02 22:24:58 -04:00
mattbrk 07bd0879e9 edit 2013-07-02 22:23:39 -04:00
mattbrk 1b23bde3af edit 2013-07-02 22:21:26 -04:00
mattbrk 419db6875c edit 2013-07-02 22:15:09 -04:00
mattbrk db2c8526f6 edit 2013-07-02 22:03:19 -04:00
mattbrk 86f6857dd0 edit 2013-07-02 21:59:16 -04:00
mattbrk a397e1ea4a handle osx/sdl/libs 2013-07-02 21:46:04 -04:00
mattbrk 9a61b00dc1 edit howto 2013-07-02 21:44:14 -04:00
mattbrk ae64a3f61f rename 2013-07-02 21:42:22 -04:00
Vollch 468b3db3b7 Fixes #1864 2013-07-03 01:49:38 +04:00
Vollch 115252a149 Underground fix 2013-07-03 01:04:34 +04:00
Vollch d3e965ef1a Reworked road placement 2013-07-02 22:24:58 +04:00
Darth Servo 9fe6feb52f Edited recipes requiring hammers to be consistent. 2013-07-02 11:14:49 -04:00
utunnels 9b058378bf Bug fix. 2013-07-02 22:10:43 +08:00
utunnels 5e85552377 Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into utf8
Conflicts:
	output.cpp
2013-07-02 20:59:24 +08:00
Tommy a89185e056 Commit raw translation files for fr_FR, ru_RU, zh_CN, pt_PT.
Now with less FAIL.
2013-07-02 18:56:37 +12:00
Kevin Granade 4445f7f06f Merge a SDL OSX target and font size adjustment. 2013-07-01 20:02:14 -05:00
Kevin Granade f6bafa573b Merge some unification to text wrapping. 2013-07-01 19:32:13 -05:00
Kevin Granade 0c66a3db76 Merge more gettext annotation, soldering charge fix, phup/pgdown support for menus, URL fix, gibbing fix, and drawing fix. 2013-07-01 19:11:04 -05:00
Oddbjørn Olsen 98a51dfaab Made items draw infront of blood splatter
Fixes issue #1844.

The bug was introduced in f176e82253.
2013-07-02 02:01:49 +02:00
Kevin Granade b9220e7d8b Fixup get_combat_style() to no longer pass a game reference. 2013-07-01 18:46:15 -05:00
Goron 2c6ec43e1f remember combat style after cjaracter creation 2013-07-01 18:29:30 -05:00
Goron 3b21826b6a TODO comment to refactor handling of styles 2013-07-01 18:29:30 -05:00
Goron 317ba1c34c remove_weapon uses selected combat style 2013-07-01 18:29:30 -05:00
Goron 95808abc28 Use selected comat style when bio_claws are deactivated and processing active items 2013-07-01 18:29:30 -05:00
Goron 520b90e371 Let i_rem use selected combat style
this catches most cases of freeing hands
2013-07-01 18:29:30 -05:00
Goron b0c5eefee0 Use selected combat style after eating your weapon 2013-07-01 18:29:29 -05:00
Kevin Granade c915ec3af6 Use selected combat style after wearing or throwing your weapon
Conflicts:

	player.cpp
2013-07-01 18:29:20 -05:00
Kevin Granade dd3ea43ee3 Make g a global. 2013-07-01 18:21:10 -05:00
TireExaminer 5a667408f4 Fixed giblet spawning.
Monsters would gib only in respect to the x axis due to a typo.
2013-07-01 17:43:12 -04:00
lethosor be320a8540 Fix link to issue tracker 2013-07-01 11:48:25 -04:00
fnord 76c7519e11 uimenu: page up / page down support for large scrolling lists 2013-07-01 10:09:23 -05:00
Tommy adccca67f9 Gettextify main interface and inventory. 2013-07-02 00:10:56 +12:00
Tommy 470d948fe5 Add some missing full-stops and make some spacing more consistent. 2013-07-01 20:34:04 +12:00
Vollch 0755f6f8b3 Soldering iron fix 2013-07-01 12:29:02 +04:00
Tommy 36347ba62b Reindent dis_name() because i touched all of it. 2013-07-01 19:48:46 +12:00
Tommy 4577cceb9e Make disease descriptions much easier to translate. 2013-07-01 19:48:35 +12:00
Tommy 2f10f7907a Change dis_description() to 4-space indent because i touched most of it. 2013-07-01 18:54:40 +12:00
Tommy eee9970065 disease.cpp: Remove indent on some multiline strings. 2013-07-01 18:41:43 +12:00
Tommy d19c6cf1ab Add missing break statement to case DI_BOULDERING in dis_msg(). 2013-07-01 18:37:59 +12:00
Tommy 5cbe278548 Change dis_msg to 4-space indent because i touched so much of it anyway. 2013-07-01 18:37:04 +12:00
Tommy f44cd9e3d9 Gettextify the rest of disease.cpp. 2013-07-01 18:31:19 +12:00
utunnels 5232c34161 Merge branch 'utf8' of github.com:utunnels/Cataclysm-DDA into utf8
Conflicts:
	crafting.cpp
2013-07-01 12:51:08 +08:00
utunnels 0ed81e758a Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into utf8
Conflicts:
	output.cpp
2013-07-01 12:46:27 +08:00
mattbrk 83da2d8b1d SDL.h 2013-07-01 00:41:15 -04:00
mattbrk 3fbb690d76 edit readme 2013-07-01 00:13:46 -04:00
Tommy 158950e71d Gettextify most of disease.cpp. 2013-07-01 15:28:26 +12:00
utunnels c5b3f9e1ec Font size hack for bitmap fonts (.fon). Also make the font list shorter. 2013-07-01 10:57:10 +08:00
Kevin Granade 150d916981 Merge fire fixes. 2013-06-30 21:40:39 -05:00
TireExaminer 86db34bdf9 Webs burn away. 2013-06-30 22:38:54 -04:00
TireExaminer 51b8b40b68 More Fire Fixes 2013-06-30 22:28:51 -04:00
TireExaminer f27390f53a Gasoline adds to fires. 2013-06-30 20:02:22 -04:00
TireExaminer 1fc7546e96 Fixes Gasoline exploding and Furniture Burning 2013-06-30 20:00:15 -04:00
Kevin Granade 7d91d4f358 Merge furniture updates. 2013-06-30 15:39:19 -05:00
David Holmes 248f8a64f7 Allow deconstruction of refrigerators
...because when you think about it, smashing a refrigerator with the
screwdriver in your hand is not the most sensible way of getting a rubber
tube out of it.

Also enabled deconstruction of glass door refrigerators, in which case you
also get a pane of glass for your effort.
2013-06-30 20:06:33 +01:00
Kevin Granade a9512b5b4c Remove unused includes that might break windows builds. 2013-06-30 12:17:37 -05:00
Kevin Granade 1fcae4b4ef Switch to posix test for whether a path is a directory. 2013-06-30 12:07:18 -05:00
Vollch e6b98ee733 Limited fuel in gas pumps 2013-06-30 20:58:38 +04:00
Kevin Granade f459dabf9d Merge permissions fix, font handling, more i18n, and a vehicle fix. 2013-06-30 11:30:09 -05:00
utunnels a49b02060c Fix crafting menu position under utf8. 2013-06-30 23:00:14 +08:00
utunnels 8d667baf3c Bug fix. 2013-06-30 22:37:43 +08:00
Kevin Granade ad8fdd4819 Merge pull request #1843 from narc0tiq/osx-cross-jenkins
LDFLAGS, not CXXFLAGS
2013-06-30 06:55:01 -07:00
Octav Sandulescu 434ea30026 LDFLAGS, not CXXFLAGS 2013-06-30 14:53:11 +01:00
Kevin Granade 81ce7c6e9a Merge pull request #1842 from narc0tiq/osx-cross-jenkins
Change minimum OSX to 10.5 and add libintl to the Mac builds
2013-06-30 06:47:38 -07:00
Octav Sandulescu b4871d49d7 Change minimum OSX to 10.5 and add libintl to the Mac builds
This is what was necessary to get Cataclysm cross-compiling to OSX in my build environment.
2013-06-30 14:46:07 +01:00
Tommy 17e2380abf Don't let the player drive a vehicle if they won't be carried with it. 2013-07-01 01:29:45 +12:00
Tommy 5749a320bd Someone has been mixing line endings >:(. 2013-07-01 01:27:52 +12:00
Goron 0ecdc3891a added fold_and_print to reduce dublicated code 2013-06-30 15:00:07 +02:00
utunnels 5868686f9d Cache font list in data/fontlist.txt, delete it to rescan all font directories. 2013-06-30 20:09:26 +08:00
Tommy 3108e44fe0 Change en_UK to en_NZ in TRANSLATING.md, and add '-p' to the mkdir line. 2013-06-30 23:57:02 +12:00
Tommy aa50085573 Allow translating of JSON item names and descriptions. 2013-06-30 23:02:58 +12:00
utunnels 959f10e80b Add font blending option for data/FONTDATA 2013-06-30 17:06:30 +08:00
utunnels 4b30f55a72 Scan system font folder first before check font file names. 2013-06-30 16:34:49 +08:00
Tommy 4f0bf666cd Fix some file permissions (775 -> 664). 2013-06-30 20:00:31 +12:00
Kevin Granade 2f9e8e5c52 Work around Cygwin's lack of gettext support in glibc. 2013-06-30 00:28:06 -05:00
Kevin Granade a7f543d60a Merge the rest of new character invlet cleanup. 2013-06-29 22:47:11 -05:00
Kevin Granade f382badf7d Merge pull request #1835 from FunnyMan3595/win_load_gettext
Moved the -l flags for gettext on Windows to a better position.
2013-06-29 19:10:32 -07:00
Charlie Nolan (FunnyMan3595) a2993e3cd8 Moved the -l flags for gettext on Windows to a better position.
... and this should fix the OTHER build.
2013-06-29 20:57:54 -05:00
Kevin Granade da04c902e7 Merge pull request #1834 from FunnyMan3595/win_load_gettext
Added gettext -l flags for Windows builds.
2013-06-29 18:36:30 -07:00
Charlie Nolan (FunnyMan3595) 4059e16396 Added gettext -l flags for Windows builds. 2013-06-29 20:34:28 -05:00
Kevin Granade a47a920a02 Add new translations.h header to windows project files. 2013-06-29 20:17:47 -05:00
Kevin Granade 8600085be3 Merge new character invlet assignment fix, magic number removal, and a start at gettext support. 2013-06-29 19:52:13 -05:00
Kevin Granade aec5108fe9 Merge multi-field per tile support.
Conflicts:
	field.cpp
	game.cpp
	inventory.cpp
	mapdata.h
	npc.cpp
2013-06-29 19:28:54 -05:00
Charlie Nolan (FunnyMan3595) 930b4cf3a3 Merged PRs together (no new ones).
Conflicts:
	newcharacter.cpp
2013-06-29 17:56:38 -05:00
Charlie Nolan (FunnyMan3595) 84b9f4411f Merge PRs #1830 and #1832 2013-06-29 17:45:39 -05:00
Goron cc8006a2b0 replace magic numbers 80, 25 and related with FULL_SCREEN_WIDTH, FULL_SCREEN_HEIGHT 2013-06-29 23:39:34 +02:00
Tommy 5eb8e1ab41 oops 2013-06-30 08:28:45 +12:00
TireExaminer c909a0f713 Fixes NPC Morale Penalty 2013-06-29 14:53:46 -04:00
Tommy 377bac95d8 Gettext support!
For starters, the main menu is now translatable.

More strings may be made translatable by including "translations.h",
then surrounding strings to translate with _().
For example: add_msg("my message") becomes add_msg(_("my message")).

Instructions for translating, and maintaining translation files,
can be found in TRANSLATING.md.
2013-06-30 06:49:54 +12:00
Goron 8a17c9a0d3 Fix allignment of list_items output 2013-06-29 20:48:03 +02:00
Oddbjørn Olsen e6c3168956 Made advanced inventory sort items
Adresses issue #1826.
2013-06-29 20:43:38 +02:00
Oddbjørn Olsen 39292d183d Made player::create armor equip more robust
Now, the player's profession might give him 10 pairs of pants, but he
can't wear them all at character creation.
2013-06-29 20:25:32 +02:00
Oddbjørn Olsen 1099f6b527 Added non-interactive mode to player::wear
Now, we can use player::wear to "force" the player to wear stuff without
alerting him. Will be useful during character creation.
2013-06-29 20:11:55 +02:00
Oddbjørn Olsen 73a86971ac Converted player::wear to Allman style
Just making it easier for me to modify.
2013-06-29 19:49:23 +02:00
Oddbjørn Olsen 79debd29db Converted player::wear_item to Allman style
For future commits.
2013-06-29 19:44:16 +02:00
Goron ac3a92c219 Added newline befor style technique in itme::info 2013-06-29 19:29:46 +02:00
Goron 3bf8fda4df Removed leading space from item::info
leading space will be broken on line wrap, so lets output handle the placement
of the text
2013-06-29 19:29:46 +02:00
Goron 0086715750 Removed word_rewrap as it is not used anymore 2013-06-29 19:29:46 +02:00
Goron 8bba59aa72 remove word_rewrap from bio itypedef
is the only itypedef that used word_rewrap. Word_wrapping is done when
we know the width
2013-06-29 19:29:46 +02:00
Goron 8cabe87199 full_screen_popup and popup uses foldstring to wordwrap long lines
moved foldsring from ui.cpp to output.cpp
removed word_rewrap from item::info as we don't know the width and have to rewrap again
2013-06-29 19:29:24 +02:00
Kevin Granade 5604434130 Merge variable morale decay, probabilistic teleport fix, use ncursesw, and mapgen fixes. 2013-06-29 11:42:19 -05:00
Charlie Nolan (FunnyMan3595) 66d42195a9 Merge PR #1826 2013-06-29 10:55:41 -05:00
utunnels 4d55dc6fe0 More fix to half utf8 character. 2013-06-29 23:50:03 +08:00
Oddbjørn Olsen 69d48fe953 Corrected faulty invlet assignment in startup
There were some collisions between items in inv and items in worn. I
fixed this by prepopulating inv with every single item from character
creation, and then moving them to worn AFTER all the invlets had been
assigned by inv.
2013-06-29 17:48:24 +02:00
Vollch 10421d4fdc Fix broken parts of mapgen 2013-06-29 18:59:04 +04:00
Tommy 4d99cc7d20 Preliminary Linux unicode support? 2013-06-30 01:44:36 +12:00
Eric b38be2e57f Fix probability travel ending in tile with monster, fix typo in coords 2013-06-29 00:03:31 -07:00
Charlie Nolan (FunnyMan3595) 112e7a7239 Merge PR #1805 2013-06-28 23:31:40 -05:00
TireExaminer 6544b1911e Comments and monster field changes
If a field spawns ontop of you you will now be hit by it immediately.
Also commented things.
2013-06-29 00:25:40 -04:00
Vollch 195350b8af Added comments to quadrants house generator 2013-06-29 07:48:54 +04:00
Charlie Nolan (FunnyMan3595) 0a22d34b4b Merge PR #1816 2013-06-28 20:10:23 -05:00
TireExaminer be52063100 Fixed some weird spreading behavior with smoke and fire.
Smoke now lasts longer and generates faster indoors, but small fires are
much less likely to destroy a building (density 1 fires). Fire will last
a more reasonable length of time.
2013-06-28 20:54:54 -04:00
NaturesWitness 6ef1e6d68d Pistol Crossbow Recipe Skill Fix
Changed pistol crossbow recipe to use archery as secondary skill.
Didn't seem to make much sense that it required firearms skill and all
other bows required archery skill. Even if it's called a pistol crossbow
it's still a crossbow, not a pistol.   Unless there's some other reason
I'm not seeing in which case disregard this pull request.
2013-06-28 20:26:26 -04:00
Charlie Nolan (FunnyMan3595) 2d1c67cbd5 Merge PR #1813. 2013-06-28 15:04:14 -05:00
Peter Lacey-Bordeaux 9a74914720 updated how to start a new world with the option on the main menu. 2013-06-28 14:51:32 -04:00
Charlie Nolan (FunnyMan3595) be6de66c8a Merged PRs #1810, #1806, #1804, #1799, #1766. 2013-06-28 12:38:31 -05:00
TireExaminer 82f39cb588 Refactored fields to support any # of fields.
The field class is now a wrapper that contains a vector of any number of
fields at once. So now you can choke on smoke, burn in fire, and melt in
acid all at the same time. Fields now propagate additively... so if
something is spewing smoke instead of overwriting the old smoke, it adds
to its density.
2013-06-28 13:33:39 -04:00
Oddbjørn Olsen a6c5fb497e Made morale items load correctly 2013-06-28 17:28:24 +02:00
utunnels 79157104e0 Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into utf8 2013-06-28 23:18:41 +08:00
utunnels 4fcd90bb37 Revert two unrelated test changes. 2013-06-28 23:15:13 +08:00
utunnels 670135cf86 Fix font y/n window size. 2013-06-28 21:30:31 +08:00
utunnels 26e650d0ab Reuse word_rewrap in compare_split_screen_popup. 2013-06-28 20:58:21 +08:00
Oddbjørn Olsen 142f42c903 Made bionics manifest show correctly 2013-06-28 14:13:51 +02:00
Vollch 3c31a662de Some fixes and improvements to quadrants house generator 2013-06-28 15:12:12 +04:00
Oddbjørn Olsen 2e69cf70bd mp3 player won't be audible if we're deaf. 2013-06-28 12:03:03 +02:00
utunnels 1e204fb105 Update draw_tab to support utf8 string width. 2013-06-28 15:42:44 +08:00
utunnels e6e9feb586 Fix a bug that '\0' is ignored while copying utf8 lines. 2013-06-28 15:22:02 +08:00
mattbrk a4f2cb4972 add cataclysm-tiles to .gitignore 2013-06-28 01:44:39 -04:00
mattbrk 84767fb60c add files for os x/sdl build 2013-06-28 01:42:33 -04:00
mattbrk 695fc87f55 how to build on os x with sdl/sdl_ttf frameworks 2013-06-28 01:41:11 -04:00
mattbrk f1632bd090 update for macosx and tiles with sdl frameworks 2013-06-28 01:37:37 -04:00
mattbrk df837f15d8 update for macosx and tiles with sdl frameworks 2013-06-28 01:36:54 -04:00
mattbrk f01a835d47 update for macosx and tiles with sdl frameworks 2013-06-28 01:36:02 -04:00
Vollch e649f43dd5 Fixes #1798 2013-06-28 06:20:42 +04:00
Kevin Granade d1d6525bbf Merged seperate furniture layer, vehicle caching and interaction fixes, and extension to fire duration. 2013-06-27 18:43:23 -05:00
Charlie Nolan (FunnyMan3595) 570d0b6f72 Beginning to read now reinforces any existing reading morale.
Closes #1198
2013-06-27 16:15:04 -05:00
Peter Lacey-Bordeaux c6cb0b4930 changed add_item in veh_interact so it does not ignore weight/volume checks, overflow radius of 1 atm 2013-06-27 17:04:24 -04:00
Charlie Nolan (FunnyMan3595) 4a0964bd91 Fixed focus gain display when negative. 2013-06-27 15:55:13 -05:00
Charlie Nolan (FunnyMan3595) a9bf334674 Applied custom mood durations and decays.
They've all been looked at now, but a fair number were left at the
default.
2013-06-27 15:44:50 -05:00
Charlie Nolan (FunnyMan3595) 21e377356c Moved item_type to the end of add_morale's prameters.
Also corrected the "new entry" case to include the full moodlet details.
2013-06-27 15:44:50 -05:00
Charlie Nolan (FunnyMan3595) 4bd36d5407 Moodlets now last 60m and decay after 30m by default.
The previous intended behaviour was 30m with instant decay, but
it was actually set to 5h with instant decay.  Oops.
2013-06-27 14:31:31 -05:00
Charlie Nolan (FunnyMan3595) 1819060a76 Extracted the logistic function cutoff, reduced it to 4. 2013-06-27 14:12:22 -05:00
Charlie Nolan (FunnyMan3595) 0e6a8be822 Extended add_morale to support the new decay model. 2013-06-27 14:09:58 -05:00
Charlie Nolan (FunnyMan3595) 7a7e3ebc1a Apply persistent morale effects more aggressively.
Optimist wasn't showing up immediately on game start, and Hoarder
wasn't updating when you examined your morale.
2013-06-27 13:47:02 -05:00
Charlie Nolan (FunnyMan3595) f480c13d25 Save/load alterations for the new morale structure. 2013-06-27 13:38:45 -05:00
utunnels f23a086603 Experimental word_rewrap function with utf8 support (still buggy). 2013-06-28 01:24:31 +08:00
Voker57 91649fe933 Tweaked the fuel consumption code to make wood yield more 2013-06-27 20:32:10 +04:00
Oddbjørn Olsen ff7c2a81f2 Added *.cbTemp and gmon.out to .gitignore 2013-06-27 16:41:48 +02:00
Oddbjørn Olsen 1e4137c847 Made vehicle actually show up when constructing
The vehicle cache wasn't being updated. Fixes bug in issue #976.

Also, made a default vehicle name in case player leaves it blank.
2013-06-27 16:39:06 +02:00
utunnels 0d101e51b8 Move utf8 related functions to catacharset.cpp 2013-06-27 20:40:07 +08:00
Vollch f176e82253 Separate furniture and territory 2013-06-27 12:28:07 +04:00
utunnels 04955a421f Fix a bug utf8 line has an old byte limit. Limit key repeat rate, too fast. 2013-06-27 16:10:17 +08:00
Charlie Nolan (FunnyMan3595) fd59fba0d5 Added logistic-scaled morale decay. 2013-06-26 22:27:43 -05:00
Charlie Nolan (FunnyMan3595) e53e8de76a Comments for player::add_morale. 2013-06-26 22:27:43 -05:00
Charlie Nolan (FunnyMan3595) 8ea78461af Ran player::add_morale through astyle 2013-06-26 22:27:43 -05:00
Charlie Nolan (FunnyMan3595) b55fcbcea1 Extended morale_point structure. 2013-06-26 22:27:43 -05:00
Charlie Nolan (FunnyMan3595) 67d0317a87 Passed morale_point through astyle 2013-06-26 22:27:42 -05:00
utunnels f19762c67d Utf8 support. 2013-06-27 11:09:49 +08:00
Kevin Granade 4fc91e9207 Mergorama.
Conflicts:
	bionics.cpp
2013-06-26 20:15:05 -05:00
cib bb25bebac7 Fix bug with item group loading.
The loader was copying the group, and then adding the items to the copy(which would never be used again anywhere).
2013-06-27 00:26:11 +02:00
Charlie Nolan (FunnyMan3595) 8f439ac7e8 Changed Optimist to be more thematic and balanced.
Instead of a flat +20 to morale, Optimist now gives:

* All positive morale effects get a 25% boost.
* All negative morale effects are reduced by 25%.
* Permanent +4 morale (+5 after the boost)

This represents that optimism is less about always being happier and more
about focusing on good things while disregarding bad things.

Mechanically, the smaller flat boost means that you won't get a free 20%
boost to focus anymore.  This should give Optimist a distinct feel compared
to Fast Learner, rather than being a bigger boost under average conditions.
2013-06-26 16:01:29 -05:00
Charlie Nolan (FunnyMan3595) 51556b70a5 Added a couple coments to morale_level 2013-06-26 15:03:46 -05:00
Charlie Nolan (FunnyMan3595) 6ff073e8f3 Moved persistent morale effects to update_morale 2013-06-26 14:53:49 -05:00
Charlie Nolan (FunnyMan3595) 4c346ab6e3 Ran update_morale through astyle 2013-06-26 14:49:52 -05:00
Charlie Nolan (FunnyMan3595) 7d9b420d93 Removed an unused variable, fixed first morale_level call. 2013-06-26 14:46:18 -05:00
Charlie Nolan (FunnyMan3595) a2a2377a21 Passed player::morale_level through astyle 2013-06-26 14:38:35 -05:00
Charlie Nolan (FunnyMan3595) d7cdeb112c Simplified player::disp_morale, tweaked focus alignment. 2013-06-26 14:17:06 -05:00
Charlie Nolan (FunnyMan3595) a7df33c79c Added comments to player::disp_morale. 2013-06-26 13:51:42 -05:00
Charlie Nolan (FunnyMan3595) 2059b0eac4 Passed player::disp_morale through astyle. 2013-06-26 13:35:50 -05:00
fnord a510ada95e Also scroll if entries won't fit implicitly set w_height 2013-06-26 06:43:11 -05:00
fnord 32e29c9edf uimenu: scroll through entries if they exceed screen height. Title option makes use of the top border. 2013-06-26 06:14:25 -05:00
fnord 532c9f0096 Merge remote branch 'origin/master' into better_menu 2013-06-26 06:12:14 -05:00
Xommers 887338c198 Merge pull request #1 from atomicdryad/fix_cr_and_whitespace
fix cr and whitespace
2013-06-26 02:15:00 -07:00
Eric fc8b8170f7 save space by changing old flashbang() to just call flashbang(x,y,false) 2013-06-26 02:04:28 -07:00
fnord 55a7f31d1d fix cr and whitespace 2013-06-26 04:03:55 -05:00
Eric faa6e0a41f Fix CBM flashbang erroneous deafened message 2013-06-26 01:55:17 -07:00
Xommers c61b0ed4a8 Toggled Metabolic Interchange bionic, active power sources 2013-06-26 04:37:19 -04:00
Christian Buskirk 8531e1149b Nerf fluffy/long tail mutations. 2013-06-25 22:50:55 -07:00
Eric 42dcb1b529 Remove duplicate drowning messages by checking if target is dead 2013-06-25 19:33:09 -07:00
Christian Buskirk 8b3a6d8ce1 Merge PR #1730 - Overkill cap 2013-06-25 18:51:48 -07:00
Stevensonz b6beaa3f8e Display FLAMING TEC
removes A BUG and shows FLAMING TEC
2013-06-26 09:40:13 +08:00
Christian Buskirk d4198865f7 Merge PR #1693 - Streamline lumberjacking 2013-06-25 18:36:07 -07:00
MacrosBlackD b8f57d9bec Updated recipe for heavy field point arrow to require bone, rock, scrap or nails. 2013-06-25 20:16:24 -05:00
Kevin Granade fa9ce18623 So... many... PRs... 2013-06-25 20:00:25 -05:00
Oddbjørn Olsen 5dc2f67c66 Allow rng to accept parameters in swapped order 2013-06-26 02:35:29 +02:00
MacrosBlackD d4043c546b Updated difficulty of Heavy Wood Arrow. Fixes issue #1752 2013-06-25 19:16:25 -05:00
Oddbjørn Olsen a2b6b30794 Support chatting to more than 10 NPCS
Using menu_vec. menu_vec (and probably menu too) needs some work though,
it doesn't scroll if contents go beyond terminal size.
2013-06-26 02:08:53 +02:00
Eric c63088f288 Moved lightmap changes into one loop at end 2013-06-25 17:00:40 -07:00
Eric 682542ec45 Add active message to CBM artificial night 2013-06-25 16:47:20 -07:00
MacrosBlackD f1004a5e4e Added bone material to fix issue #1743 2013-06-25 18:41:19 -05:00
Oddbjørn Olsen f73fb793ff Allow player to cancel options/keybindings
As it was, the new settings were kept in memory (though not written to
disk) even if the player canceled out of options/keybindings.

Fixes issue #385.
2013-06-26 01:34:20 +02:00
Oddbjørn Olsen 7083594e96 Fixes infinite waiting when canceling wait menu
Fixes issue #1738.
2013-06-26 00:56:57 +02:00
Oddbjørn Olsen c0fdab7ce6 Crafting/disassembly now respects MAX_ITEM_IN_SQUARE
Crafting functions were calling map::add_item with default item limit,
which is still 64.

Fixes issue #1737.
2013-06-26 00:05:41 +02:00
Oddbjørn Olsen d63144b7e1 Fix item descriptions flowing off terminal
Fixes issues #1745 and #650.
2013-06-25 23:46:12 +02:00
Oddbjørn Olsen 9ab335dc82 Fixed inconsistent steel requirements in metal arrow shaft recipe
Fixed bug described in issue #1735.
2013-06-25 21:48:28 +02:00
Oddbjørn Olsen 346ea8583a tagging/inscribing no longer wastes charge when canceled.
Fixes bug described in issue #1728.
2013-06-25 21:39:37 +02:00
Hourousha 0759718bd8 Initial skeleton of a guide for editing features of the game that do NOT
require a recompilation of the source code.
2013-06-25 09:52:26 -05:00
zeroDivisible 39a49bbf37 reverted #188 as the flag introduced there is not supported on older versions of GCC (doesn't compile on OSX 10.7.5 and few others 2013-06-25 15:03:24 +01:00
Eric eb4cdbe904 Bio Night v2 2013-06-25 03:56:36 -07:00
Kevin Granade 2c126e7bf5 Cap overkill damage at base damage of attack, preventing gibbing from low-damage sources. 2013-06-25 00:02:49 -05:00
Kevin Granade ca2d29a024 Merge flaming weapons 2013-06-24 21:08:00 -05:00
Kevin Granade 729e9eda04 Merge CBM enhancements, butchering enhancements, drug craving abatement and flaming weapons.
Conflicts:
	bionics.cpp
2013-06-24 20:43:18 -05:00
MacrosBlackD ac24e389b3 Added advanced UPS that runs on plutonium at a rate of 1 plutonium per 500 charges. Doesn't allow the character to unload partially depleted plutonium and won't over fill the device if it can't fit a full plutonium. So no cheesing and no wasting materials :) 2013-06-24 18:49:04 -05:00
Vollch 0036a235ed Drugs remove craving when used 2013-06-25 02:50:14 +04:00
Stevensonz 2d39261a1e FIX #560
Fixes #560
2013-06-25 03:15:48 +08:00
Eric e9f030e164 Add CBM Artificial Night 2013-06-24 12:11:31 -07:00
fnord 2c87aec44a butcher: preserve mtype on meat. iteminfo: "Smells like <original mobtype>", for
players with carnivore, or scentmap, or cheating bastards
2013-06-24 14:09:30 -05:00
Oddbjørn Olsen c77c4d0b2d Updated code documentation for bionics
Why is the documentation stored both in DEVELOPER_FAQ.txt and in
EDITING? These two files should probably be consolidated.
2013-06-24 18:06:30 +02:00
Oddbjørn Olsen 926fdadd32 Made init_bionics() read from bionics.json 2013-06-24 18:06:29 +02:00
Oddbjørn Olsen bd4dc179b8 Added bionics.json 2013-06-24 18:06:29 +02:00
Eric 7f7a779825 minor fix to scentmap, added more colors to scentmap 2013-06-24 04:40:02 -07:00
Eric 23ba3c646b check remaining momentum before calling plswim() 2013-06-24 03:54:20 -07:00
Eric df51e0a4a7 Add check for water tiles in shockwave/knockback 2013-06-24 03:45:02 -07:00
Eric a700541abb Add flaming effect to wide technique attacks 2013-06-24 02:56:14 -07:00
Eric 2c4117cc50 Lit torches set enemies on fire 2013-06-24 02:38:38 -07:00
Eric e97af6b7a1 Add new ammo effects to item factory 2013-06-24 01:44:29 -07:00
Eric 3f1f5f6072 Add CBM Chain Lightning and related ammo effects 2013-06-23 23:48:08 -07:00
Kevin Granade 308f599683 Re-add carving a note into an item with a knife. 2013-06-23 22:00:08 -05:00
Kevin Granade 20577ba42b Extract code to add a note to an item to a helper function. 2013-06-23 21:59:45 -05:00
Kevin Granade c6831b3ea0 Merge converting note code to use marker instead of knife. 2013-06-23 19:57:47 -05:00
Kevin Granade 41aeb9aede Light refactoring on new spoiled food removal code. 2013-06-23 19:25:09 -05:00
Kevin Granade e9081452d5 Merge temperature conversion refactor, small-game arrows, shockwave improvements, and disappearing spoiled food. 2013-06-23 18:46:45 -05:00
MacrosBlackD 38151c4a45 Spoiled (rotten) items will now be removed from the map after twice the time it takes to spoil 2013-06-23 18:04:29 -05:00
fnord 1aff0cbe39 itemvars["carved_note"] > item_vars["item_note"], use marker instead 2013-06-23 17:06:58 -05:00
Eric 10c8928039 add blue shockwave() explosion, add player-victim collision messages 2013-06-23 14:55:04 -07:00
Kevin Granade f0600e428b Append carved message to the end of item description if present. 2013-06-23 16:47:30 -05:00
MacrosBlackD e170b54f9b Added small game arrow and NOGIB tag that caps damage at mon.HP + 10 2013-06-23 16:45:28 -05:00
Kevin Granade c6f4201fc0 Persistent item state tags. 2013-06-23 16:08:28 -05:00
fnord 1f1ac4be07 item_var comment cleanup 2013-06-23 16:06:53 -05:00
Kevin Granade 2afcd12df9 Fix merge error. 2013-06-23 15:11:44 -05:00
MacrosBlackD 6a31d3e093 Added missing check on STR12_DRAW to determine whether or not the player could actually use the bow 2013-06-23 15:10:43 -05:00
Kevin Granade 45266b3f63 Merge long-term healing, teleporting monsters fix, CBM recovery, shockwave generator, and viewport option bounds checking.
Conflicts:
	bionics.cpp
2013-06-23 15:02:08 -05:00
Oddbjørn Olsen 3f20273e38 Implemented print_temperature for conversions 2013-06-23 19:19:16 +02:00
Oddbjørn Olsen 515d7f0906 Added error-checking to load_options() ...
... and minimum values to VIEWPORT_X and VIEWPORT_Y
2013-06-23 17:02:29 +02:00
Eric 13eb8447ac Add CBM shockwave generator, add knockback() to implement it 2013-06-23 04:59:21 -07:00
Vollch df698e66cf Recover CBMs from butchered player corpses 2013-06-23 15:44:04 +04:00
fnord c817d06261 move real_coords to map.h, verbosely comment 2013-06-23 05:15:34 -05:00
Kevin Granade 3ec50c35c1 Adjust real_coords struct to handle arbitrarally negative values. 2013-06-23 05:15:12 -05:00
fnord 67c297c615 Fix: teleporting turrets, and static respawn inaccuracies. Add: real_coords()
to perform the voodoo required to figure out what the shifting player
centric coordinates actually mean in terms of submap & tile in submap
(in or out of bounds)
2013-06-23 05:14:59 -05:00
Julian Snitow d2266eef08 Merge branch 'master' into physician-heal-thyself 2013-06-22 23:15:54 -07:00
Julian Snitow 48d7715b21 Splints are now craftable and (slowly!) heal broken limbs. 2013-06-22 23:06:09 -07:00
Kevin Granade 399d3995c5 Adjust real_coords struct to handle arbitrarally negative values. 2013-06-23 00:02:57 -05:00
Kevin Granade efb83c5d9d Merge fix to longstanding turret and other monster migration bug. 2013-06-22 20:41:44 -05:00
Kevin Granade 0a6f9b3548 Merge improvised lockpick functionality into existing picklock method. 2013-06-22 20:19:58 -05:00
fnord 2befb7106c Fix: teleporting turrets, and static respawn inaccuracies. Add: real_coords()
to perform the voodoo required to figure out what the shifting player
centric coordinates actually mean in terms of submap & tile in submap
(in or out of bounds)
2013-06-22 16:56:29 -05:00
Kevin Granade a94a88d331 Merge remote-tracking branches 'dda/pr/1676', 'dda/pr/1677', 'dda/pr/1678', 'dda/pr/1679', 'dda/pr/1683', 'dda/pr/1684', 'dda/pr/1686', 'dda/pr/1689', 'dda/pr/1690', 'dda/pr/1691' and 'dda/pr/1692' into dda-master 2013-06-22 16:23:43 -05:00
Kevin Granade 2e1e4be90b Fix typo, thanks i2amroy. 2013-06-22 15:26:39 -05:00
Kevin Granade 1f8d32165e Add construction recipe for cutting tree trunk sections into planks in a single step. 2013-06-22 15:16:17 -05:00
Kevin Granade 946489a181 Extract code for cutting logs into planks into a seperate method. 2013-06-22 15:15:39 -05:00
Kevin Granade 7ee01d317d Replace t_log with t_trunk. 2013-06-22 15:10:35 -05:00
David Holmes de09ced18c Re-enable bulletin board base designation 2013-06-22 21:09:38 +01:00
David Holmes 303f6cf569 Update SIGNOFF 2013-06-22 21:09:38 +01:00
Oddbjørn Olsen 9a5694933b Updated Repo Paths in CONTRIBUTING.md
It was erronously referencing TheDarklingWolf's repo, even though the
master is now CleverRaven.
2013-06-22 21:46:59 +02:00
Christian Buskirk 64c61a4f43 Made wild Jabberwocks much more rare 2013-06-22 12:41:07 -07:00
Eric 656a72fb71 add CBM flashbang 2013-06-22 10:20:32 -07:00
Eric f95a2060df add penalty to CBM probability travel 2013-06-22 08:08:49 -07:00
Eric ccbbaeddd6 add CBM railgun 2013-06-22 07:58:53 -07:00
Eric 12b6415e78 check if cursor hidden before hiding in case there's overhead,start cursor hidden for options 1 & 2 2013-06-22 03:32:24 -07:00
Eric e0c988f550 fix saving of mouse options 2013-06-22 00:29:35 -07:00
Octav Sandulescu 73c398015e Set trig_dist to *not* be the default. 2013-06-22 07:53:29 +01:00
Eric a01e32f67b Add SDL mouse hiding options 2013-06-21 21:42:49 -07:00
Kevin Granade 8e898bd2de Final update to motd and makefile for v0.6. 2013-06-21 22:50:51 -05:00
Eric 77b8783db2 added probability travel bionic 2013-06-21 19:50:08 -07:00
Kevin Granade cf80a547ce Add description for stemcell treatment condition. Thanks to Slax for reporting. 2013-06-21 21:30:18 -05:00
Stevensonz 727cbaffa7 Typo Fix 2013-06-22 08:43:57 +08:00
Stevensonz d53896ab9b Lock Pick Changes and some noise balance
New Improvised lockpick! (Hard and slower to use unless skilled but has
benefit of lower alarms activation when picking alarmed doors)

Lockpick sets are now rarer but they now easier to use and more
resistant to
breaking. (Still set's off alarms though)

*Fun Fact*  3000 lockpicks and 5000 improvised lockpicks was used to
test this.

Changed crowbar recipe requirement to 0 as crafting improvised lock pick
is 0 in recipe. (Kind of gives you the path to choose between str or
dex)

added some additional noise to alarm and actions that involves crowbar
usage on prying also general actions regarding normal smashing of
windows.
(Generates a little more noise, fast and easy to use but not preferable
if you want stealth use lock picks) Based on that you are alone in the
game means the area is dead quiet and thus noise is easier to pick up.
2013-06-22 08:35:30 +08:00
Tommy 6dbcaeeeb0 Fix ranged_dex_mod() penalty for dex under 4. 2013-06-22 01:38:27 +12:00
Tommy bf186bf7c2 Don't return negative numbers for dispersion. 2013-06-22 01:34:59 +12:00
Vollch d519b1891b Fixes #1663, multiple gates near one handle work correctly 2013-06-21 17:08:46 +04:00
Tommy 47493be741 s/accuracy/dispersion/g because accuracy is not what it is. 2013-06-22 00:56:26 +12:00
Kevin Granade eb831f79c1 Nerf nailgun accuracy. 2013-06-20 22:04:46 -05:00
Kevin Granade 52cd8a9821 Correct description of static spawn option. 2013-06-20 21:57:08 -05:00
Kevin Granade 2ae4511c0c Update changelog for 0.6. 2013-06-20 21:28:56 -05:00
Kevin Granade 8954fa0d16 Don't target monsters we can't see when burst firing. 2013-06-20 20:22:00 -05:00
Kevin Granade 2a3a171ca3 Misc fixes. 2013-06-20 19:52:24 -05:00
Christian Buskirk 1fc6fc205b Merge PR #1647 - Fix drop query
Conflicts:
	player.cpp
	player.h
2013-06-20 17:43:45 -07:00
Kevin Granade 9f74a26b1f Make auto-drop in takeoff and wield always succeed regardless of volume. 2013-06-20 17:32:50 -05:00
fnord dbda99eb07 turret saftey: increase angle when player is close to compensate for increased fuzziness 2013-06-20 17:13:32 -05:00
Vollch f82e3df79f Fixes #1072 2013-06-21 01:59:22 +04:00
Stevensonz b514501496 Sign Off 2013-06-21 05:43:01 +08:00
Christian Buskirk cdc092218f Small grammar fix to innate trait message 2013-06-20 12:16:00 -07:00
Christian Buskirk e2d52fe785 Merge PR #1657 - Mutation/Purifier Fixes 2013-06-20 11:50:20 -07:00
Christian Buskirk a8a3fca9a0 Typo fix merge 2013-06-20 11:48:21 -07:00
Christian Buskirk 113dd51ea3 Merge PR #1648 - Filter hit notifications 2013-06-20 11:01:44 -07:00
fnord 4443556d2e turn off debug && cleanup 2013-06-20 07:16:08 -05:00
fnord ec0b4e53be Localized missed-so-lets-shoot-randomly x,y variables, which were resetting
burst
2013-06-20 07:15:58 -05:00
fnord f5fa8cbc5c ranged burst: did not properly aquire new target as it iterated from
shooter position, and limited range to 2+gun skill
2013-06-20 07:15:51 -05:00
fnord 1e5e0ca303 Add debug output to player::fire's burst retargeting code. Provves burst retargeting is completely broken 2013-06-20 07:15:10 -05:00
fnord c48b2ae0c9 uimenu wordwrap: Correct '\n' handling for strings < textwidth 2013-06-20 01:46:56 -05:00
Alex Casey d802fc9458 Fixed bug with traits cancelled by mutation 2013-06-20 15:14:37 +10:00
Kevin Granade 500539f9c8 Merge pull request #1642 from Stevensonz/Bow-Balance+Fixes
Bow Rebalances
2013-06-19 19:15:29 -07:00
Kevin Granade eba91edabb Streamline serialization of burnt item member since it's an int now. 2013-06-19 19:51:43 -05:00
Kevin Granade 7c274113eb Octomerge. 2013-06-19 19:29:50 -05:00
Fergus Dall 939d18d323 Make item::burnt int insread of char to prevent overflow
Fixes #1662
2013-06-20 08:07:46 +09:30
fnord 57057593e9 item.item_vars["lets_you_save"] = "arbritrary stringified data";
This uses item tags: on load, any tag starting with ascii 001 (^A) is instead
used to populate std::map<std::string, std::string> item_vars, as so:
"^AvariableName=string" => item.item_vars["variableName"] = "string";
Spaces, line feeds, and tabs are escaped as ^A + hex: ^A0D, ^A20, etc.

e are saved and loaded as special item tags that begin with ascii 001 (^A)
2013-06-19 12:23:16 -05:00
Alex Casey b5c8fc8be2 Reworked the trait/mutation system a bit more and fixed some bugs 2013-06-19 22:56:06 +10:00
Fergus Dall abd3c0174f Make lava count as a fire for crafting purposes
Fixes #801
2013-06-19 22:24:47 +09:30
Fergus Dall 67597003cf Highlight container tiles when the cursor is placed on them 2013-06-19 21:36:07 +09:30
fnord 826e865708 When deactivating a turret, add_item using x,y, not the z[mondex].x/y of the .erased() mob. 2013-06-19 07:04:15 -05:00
Fergus Dall bc48353cc5 Make cursor appear of player initially 2013-06-19 21:32:04 +09:30
Fergus Dall c9cc125a73 Draw player properly when cursor is ontop of them 2013-06-19 21:27:55 +09:30
Fergus Dall 6c59ecddd6 Stop player from building roofs ontop on impassable tiles 2013-06-19 19:17:22 +09:30
Alex Casey ea83616dde Fixes to mutation system, separates base traits and mutations 2013-06-19 19:33:44 +10:00
Fergus Dall b0ce537eb6 Replace "char" with "signed char" in several places to fix warnings on ARM
Fixes #156
2013-06-19 18:54:03 +09:30
Fergus Dall 48866df182 Suppress warning about va_list mangling in gcc 4.4
Fixes #188
2013-06-19 18:36:36 +09:30
Fergus Dall 2b0dadc3fb Stop giant ants and goo pit monsters from spawning hundreds of tiles away
Fixes #861
2013-06-19 18:24:02 +09:30
Julian Snitow 646b69e35e Two-by-fours no longer evaporate when unboarding doors and windows. 2013-06-19 01:21:33 -07:00
Kevin Granade 2ac080cb19 Supress melee messages when you can't see the target. 2013-06-18 23:16:07 -05:00
Kevin Granade 3956f65bd0 Clean up some commented out code. 2013-06-18 23:16:00 -05:00
Kevin Granade b1ea7ab8d7 Supress melee messages when you can't see the target. 2013-06-18 23:15:49 -05:00
Kevin Granade 50b3f2e38f Expand autodrop fix to include dropping weapon. 2013-06-18 22:00:25 -05:00
Stevensonz 92237f7634 Merge branch 'Bow-Balance+Fixes' of https://github.com/Stevensonz/Cataclysm-DDA into Bow-Balance+Fixes 2013-06-19 10:18:08 +08:00
Stevensonz b06c682cd5 Flaming and Explosive Arrow Fix
Fixes re-usability issue of arrows with special effects
2013-06-19 10:18:01 +08:00
Stevensonz bf52e6f7a9 Flaming and Explosive Ammo Fix
Fixes issue about being re-usable and not applying 1 shot use of special
effects
2013-06-19 10:17:04 +08:00
Kevin Granade caa0fa6e20 Fix name of recurve reflex bow, pointed out by Dunker. 2013-06-18 21:15:22 -05:00
Kevin Granade 4b91513410 Merge some menu enhancements 2013-06-18 21:00:42 -05:00
fnord 426fe81e54 updated uimenu: additional constructors, text word wrap, additional width options 2013-06-18 20:36:00 -05:00
Stevensonz cce7d4f63e No to Wolverine wannabe NPC's
Fixes Issue #1644
2013-06-18 20:10:25 -05:00
Christian Buskirk e76f73eb52 Merge PR #1563 - Vehicle spawning fix 2013-06-18 17:44:04 -07:00
Kevin Granade 17dd9f2e51 Remove only-used-once intermediate variables and const some stuff. 2013-06-18 19:37:57 -05:00
Kevin Granade 543381ffd7 Introduce intermediate variables for tile-local coordinates, leaving original x and y alone to correct collision calculation. 2013-06-18 19:35:00 -05:00
Christian Buskirk c5816a06c2 Merge PR #1626 - Profession skill support 2013-06-18 14:25:58 -07:00
Stevensonz c3743345ee New Ammo Effect Ignite!
Now you can set that monster on fire (normal burnable monsters that is)
and not have everything burn :)
2013-06-19 05:21:14 +08:00
Stevensonz 5b2530d6b2 Removed typo 2013-06-19 01:58:39 +08:00
Stevensonz 32bb1fada6 Bow Rebalances
Dmg Reduction on new arrows with Flaming and Explosion, Slight recipe
cost increase, moved Flammable arrow to Tools with new function that
will produce flaming arrows.
2013-06-19 01:49:35 +08:00
Leonid Vasilev 1df574a033 Fix newcharacter traits list
Both part of traits list (advantages, and disadvantages) scrolling
separatly
2013-06-18 16:59:57 +04:00
Leonid Vasilev a6191c6047 Fix inv and adv_inv UI text 2013-06-18 15:06:37 +04:00
fnord f3c582131f vehicle menu: more intuitive hotkeys, "let go" hilighted by default 2013-06-18 05:30:44 -05:00
Kevin Granade 92daf7bd16 Identifier typo and whitespace cleanup. 2013-06-17 23:32:18 -05:00
Kevin Granade 93c1bf4aee Fix a typo, reported by Dunker. 2013-06-17 23:31:43 -05:00
Kevin Granade 9a0d253c2c Complete merging archery additions. 2013-06-17 23:25:57 -05:00
fnord 95db5af92c what it says on the tin 2013-06-17 22:38:21 -05:00
Kevin Granade 081e3858cd Merge NPC recruit mission.
Conflicts:
	mission.h
	mission_start.cpp
2013-06-17 20:33:29 -05:00
Kevin Granade 50e7c00cac Merge fur and plastic repair enhancement.
Conflicts:
	iuse.cpp
2013-06-17 19:44:11 -05:00
Kevin Granade 3220c75c4e Merge archery items, crafting segfault fix, martial art trait rename, vaccine, and advanced inventory fix. 2013-06-17 19:09:36 -05:00
MacrosBlackD c5727c8437 More balancing on arrows, fixed some descriptions 2013-06-17 18:21:59 -05:00
fnord f05d52ccb1 Allow advanced_inv usage in vehicle 2013-06-17 15:33:00 -05:00
Stevensonz d24a6213a6 Vaccine Shots!
Long duration Health Booster
2013-06-18 04:25:51 +08:00
NaturesWitness 14e1163651 Martial Arts Traits Text Fix
Renamed specialized combat instruction to self-defense classes to fix
text overflow. Also cleaned up wording and grammer on other martial arts
traits.
2013-06-17 13:27:44 -04:00
Tommy 4c6b0aa0c8 Fix segfault when crafting uses up all of the first itemstack it checks. 2013-06-17 18:54:38 +12:00
Kevin Granade 04921b9b8f Merge foraging practice and vitamin balance fixes. 2013-06-16 21:14:21 -05:00
MacrosBlackD ee269b9ad5 Fixed merge fubar and moved crossbow items to archery.json. added *.opensdf to ingore
Fixed the arrowhead recipe cost, 1 steel_lump added up to 12 scrap. This has been changed to 1 steel_chunk which is equivalent to 3 scrap.
changed feathers to fletching and fixed the name of the exploding arrowhead.
Added 2 new bows and rebalanced a couple of stats.
Added Fletching item recipe and Fletching item
Merging and balancing archery mods from Flare and Isylwin
Broke out most archery related items into the archery.json file
Added a STR12_Draw flag for the new top tier bow.
2013-06-16 20:53:01 -05:00
acidia 359aca85de Added recruit NPC success dialogue 2013-06-16 19:46:34 -05:00
Hourousha 76f8f95769 Added skill support into professions; this moves professions toward being a class. 2013-06-16 16:49:31 -05:00
Flare 99e7891705 Added arrows from Flare's Archery mod 2013-06-16 12:14:27 -05:00
acidia acbc71f94b Removed testing values from new missions 2013-06-16 12:49:50 -04:00
acidia c683b3567a Added Recruit Tracker Mission, UPDATE NPC GENERATION 2013-06-16 11:47:14 -05:00
Christian Buskirk 010049efd4 Removed remnant of old vitamin code 2013-06-16 08:32:29 -07:00
Tommy 83fd08ec5d Picking underbrush trains, but has a 50% chance of destroying the bush. 2013-06-17 01:31:28 +12:00
Tommy 9b668a85e9 Picking underbrush only trains survival if you find something. 2013-06-17 00:12:17 +12:00
Tommy 07277e7107 Picking berry bushes trains survival (at low levels). 2013-06-17 00:07:21 +12:00
Kevin Granade 9d8fdc485e Stop shooting yourselves turrets. Remove spurrious prompt when simultaneously disrobing and dropping clothes. 2013-06-16 02:31:44 -05:00
Fergus Dall fab0754115 Suppress pop-up when dropping worn items
Fixes #1616
2013-06-16 16:35:55 +09:30
Kevin Granade 35b13f9927 New missions, leg guards, recalculate HP, and increase item stacking limits.
Conflicts:
	game.cpp
2013-06-16 01:48:40 -05:00
fnord 807bfc889d burst: eliminate redundant checks and suicidal turrets 2013-06-16 01:33:12 -05:00
acidia 9449806628 Fixed Small Typo 2013-06-15 21:45:55 -05:00
acidia 87af2671eb Added Basic Support for Recruit Missions 2013-06-15 21:29:18 -05:00
PiCroft 946bc3e75d sewing/repairing fixes 2013-06-16 03:28:37 +01:00
acidia 1f52a16ef1 Added Recruit Tracker Mission 2013-06-15 21:26:10 -05:00
acidia 444c73d6a5 Added Recruit Tracker Mission 2013-06-15 22:21:57 -04:00
PiCroft 899979491b metal and plural fix 2013-06-16 03:21:36 +01:00
acidia ed5088f49a Added Recruit Tracker Mission 2013-06-15 21:20:03 -05:00
acidia 0a1f8af4e0 Added Recruit Tracker Mission Dialogue 2013-06-15 21:17:55 -05:00
acidia cf2d0681a9 Added Recruit Tracker Mission Dialogue 2013-06-15 21:16:04 -05:00
Fergus Dall ec5d9bc7ef Make tough, glass jaw and hardcore traits trigger a recalculation of HP 2013-06-16 11:35:13 +09:30
Fergus Dall 2fabab8822 Update max and current HP when max strength changes 2013-06-16 11:28:53 +09:30
PiCroft 41409252da changed plastic/kevlar to soldering iron, added fur repair
general improvement of sewing to take into account secondary materials
2013-06-16 02:52:10 +01:00
origamiwolf c35132b2a9 remove item damage from gibbing 2013-06-16 08:10:35 +08:00
NaturesWitness 91810fd9ef Plastic/Kevlar Repair Fix
Fixed missing underscore preventing plastic chunks and kevlar plates
from being usable to repair or reinforce items.
2013-06-15 18:13:14 -04:00
Stevensonz e6ffa8171d Leg Guard Addition
Featuring Hard Leg Guards and Metal Leg guards (Metal Leg Guard recipe
Included)
2013-06-16 04:42:11 +08:00
fnord cfde4c9e52 Use 'add_item_or_charges' in drop, drop_in_direction, pickup ("drop
weapon?" prompt, unload (inventory full), and handle_liquid
2013-06-15 15:26:42 -05:00
fnord 736fd2a200 pickup: support huge item lists in legacy letter-selection via
extended 2 letter sequences for 64th item and beyond ( ie, `gY )
2013-06-15 14:41:08 -05:00
fnord a4a5a954e7 advanced_inv: support volume limitations in map tiles and vstorage,
refactor item movement, add safeguards against item loss, support
stupidly large numbers for headers and weight/volume columns.
2013-06-15 14:35:31 -05:00
fnord 1329d43de0 map::add_item_or_charges returns bool, checks maximum volume, handles
spillover if 4th arg is set.
add_item has optional max items argument (still defaults to 64)
add max_volume, free_volume, stored_volume, and is_full functions
2013-06-15 14:24:57 -05:00
fnord 7166f291b7 vehicle: add max_volume, free_volume, stored_volume, and is_full functions 2013-06-15 14:22:26 -05:00
acidia 7d5c4275c2 Added Martyr Mission 3 & 4 2013-06-15 13:31:38 -05:00
acidia 2f902d7390 Added Martyr Mission 3 & 4 2013-06-15 13:27:26 -05:00
acidia 6283dd2635 Added Martyr Mission 3 & 4 2013-06-15 13:25:52 -05:00
acidia 69be6a3f07 Added dialogue for Martyr Mission 3 & 4 2013-06-15 13:24:43 -05:00
acidia beb0c5ef09 Added 'Visions in Solitude' for martyr mission 2013-06-15 13:22:09 -05:00
acidia 7fa9422485 Added etched human skull for martyr mission 2013-06-15 13:21:07 -05:00
acidia 262ca3a99b Added Cult Monsters 2013-06-15 13:19:24 -05:00
acidia ee4d81fdea Added Cult Monsters 2013-06-15 13:16:15 -05:00
acidia 569dc15f4f Added cabin spawn 2013-06-15 13:08:29 -05:00
acidia a0500ee0d4 Added Cabin basement 2013-06-15 13:03:13 -05:00
acidia 10b39e1301 Added cabin and update to prison 2013-06-15 13:54:06 -04:00
Kevin Granade d69d9de4c6 Merge streamlining of save on sleep and power armor handling fix. 2013-06-15 10:34:43 -05:00
Kevin Granade d6c94ed314 Merge the tail end of pull request 1591. 2013-06-15 10:31:47 -05:00
Kevin Granade b7f3fb5deb Merge remote-tracking branches 'dda/pr/1591', 'dda/pr/1592', 'dda/pr/1597' and 'dda/pr/1581' into dda-master
Conflicts:
	mapitemsdef.cpp
2013-06-15 09:51:50 -05:00
Tommy 8c58dd00b5 Fix item factory to correctly store item birthdays. 2013-06-15 21:25:19 +12:00
Fergus Dall 12b145050f Make dropping armor go through player::takeoff first 2013-06-15 15:48:07 +09:30
Fergus Dall 34a44cefc4 Prevent player::takeoff from removing power armor when other components are worn 2013-06-15 14:43:04 +09:30
Tommy 8ff6ce2ff2 Spawn the correct number of sheets when smashing windows. 2013-06-15 14:28:08 +12:00
D Lue Choy dfdf8322d2 Save /on/ sleep
Unintentional easy saving was breaking my emmersion in the game, and may encourage savescumming.
Changed to make sleeping manditory, with saving optional.
Adjusted vehicle controlls message.
2013-06-14 21:21:25 -04:00
PiCroft 01e041efd6 kevlar and plastic items are now repairable. Use a knife to cut plastic
from plastic objects and ditto for kevlar and use a sewing kit/bone needle
to repair items
2013-06-15 00:58:31 +01:00
Stevensonz 1cbec25e35 Recipe missing ] fix
Recipes now working
2013-06-15 02:19:47 +08:00
Stevensonz e38daf8467 Recipe missing , fix 2013-06-15 02:17:21 +08:00
Stevensonz 40ff084785 was missing ,
sorry editing so late here
2013-06-15 01:57:17 +08:00
Stevensonz af83dee486 Removed typo again 2013-06-15 01:53:57 +08:00
Stevensonz 2081d3b18c some type fixing 2013-06-15 01:48:15 +08:00
Stevensonz 443b3fff0d Remove repeating crossbow spawn 2013-06-15 01:43:47 +08:00
Stevensonz ab3a2e704b Buffed Huge Crossbow
Okay everything should be set.
2013-06-15 01:17:07 +08:00
Tommy 590de892e6 Use new spawn_item() for feathers. 2013-06-15 02:44:38 +12:00
Tommy 06ece44d22 Merge branch 'master' into counter_disassembly 2013-06-15 02:41:15 +12:00
Tommy 224a3e35f2 Ensure PF_FLEET helps even if your legs are damaged. 2013-06-15 02:13:34 +12:00
Tommy 2013d93521 Fix diagonal movement cost for PF_FLEET and/or PF_PARKOUR. 2013-06-15 01:48:35 +12:00
Stevensonz d6083f3017 Merge branch 'Crossbow-Additions' of https://github.com/Stevensonz/Cataclysm-DDA into Crossbow-Additions 2013-06-14 21:43:37 +08:00
Stevensonz df86abf313 Crossbow Recipes!
Last Step for crossbows
2013-06-14 21:43:25 +08:00
Tommy 22a0e38fbb Fix run_cost() for diagonal moves. 2013-06-15 01:34:15 +12:00
fnord b183d5f141 vehicle::add_item limits volume per MAX_VOLUME_IN_VEHICLE_STORAGE (500),
items per MAX_VOLUME_IN_VEHICLE_STORAGE (1024)
2013-06-14 06:54:26 -05:00
Tommy 87a0cafd24 Spawn the correct number of items when deconstructing etc. Fixes #909. 2013-06-14 21:29:55 +12:00
fnord a6c20a66ed Change MAX_ITEMS_PER_TILE from 64 to 1024 2013-06-14 04:24:08 -05:00
Tommy edbb25441f Remove deprecated map::spawn_item(). 2013-06-14 20:52:11 +12:00
Kevin Granade 38922b9860 Power armor bugfix and new types of archery items.
Conflicts:
	game.cpp
2013-06-14 01:53:01 -05:00
Fergus Dall e5a5302284 Only stop the player from putting on power armor if it covers the same slot as other gear
Fixes #1588
2013-06-14 15:07:21 +09:30
Stevensonz b9dc7f9b81 Huge crossbow fix 2013-06-14 12:57:46 +08:00
Stevensonz 204aa7b154 Removed rep crossbow spawn 2013-06-14 12:16:08 +08:00
Kevin Granade 36b52dc240 Compilation fix. 2013-06-13 20:52:47 -05:00
Kevin Granade e3530fb537 Merge remote-tracking branch 'dda/master' into dda-master 2013-06-13 20:51:11 -05:00
Kevin Granade cbbcb0ebdd Merge pull request #1586 from acidia/difficulty-pat
Small tweaks to prison monsters
2013-06-13 18:50:09 -07:00
Kevin Granade e8789745aa Merge remote-tracking branch 'dda/pr/1570' into dda-master 2013-06-13 19:13:30 -05:00
Kevin Granade bd15789c4c Neat-o enhancements. 2013-06-13 18:53:34 -05:00
Kevin Granade 003b7670cb Merge remote-tracking branch 'dda/pr/1560' into dda-master 2013-06-13 18:41:08 -05:00
NaturesWitness 7d2efa2aa0 More Flamethrower Spawns
Added flamethrowers to military spawn list.  Cause, you know it seems
kind of silly that spider lairs are the only place they show up.
2013-06-13 18:06:33 -04:00
fnord ed58320403 rl_dist(point, point) - used once - calls rl_dist(int, int, int, int). 2013-06-13 14:23:26 -05:00
Stevensonz 0e983a2b62 changed huge crossbow weight and volume 2013-06-14 01:34:10 +09:00
utunnels 28c0732fd4 Limit sdl screen update rate if DrawWindow is called multiple times without a break. 2013-06-13 21:43:09 +08:00
Stevensonz 6170c8c5c6 Spawn for New Crossbows 2013-06-13 18:43:17 +08:00
Stevensonz ef4ef8a8b6 Crossbow- Additions
Featuring Pistol crossbow, Huge Crossbow and Repeating Crossbow
2013-06-13 17:28:29 +08:00
utunnels 2734a17368 Calculate font baseline offset manually. This should fix most font bugs. 2013-06-13 16:31:50 +08:00
Fergus Dall e5b892f37a Fix warning in output.cpp
Fixes #1579
2013-06-13 17:36:28 +09:30
utunnels 64e37e180a Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into sdl-font-fix 2013-06-13 13:15:26 +08:00
Kevin Granade 2993a9d7c8 Merge remote-tracking branch 'dda/pr/1570' into dda-master 2013-06-12 21:12:47 -05:00
acidia 05dbf9a83f increase difficulty of prison, typo fix 2013-06-12 20:30:13 -05:00
acidia bfda82c6f9 increase difficulty of prison 2013-06-12 20:24:13 -05:00
Kevin Granade f70437892a Print message about vehicle menu when boarding a vehicle. 2013-06-12 20:08:34 -05:00
acidia 036f8f2cf3 added rare jabberwock spawn to various forest types 2013-06-12 21:02:59 -04:00
Kevin Granade 98b146394f Display actual keybinding instead of the default. 2013-06-12 19:38:22 -05:00
Kevin Granade 549a46ffcc Death to trailing whitespace\! 2013-06-12 19:34:10 -05:00
Kevin Granade bb133844e4 Merge batch of the day.
Conflicts:
	game.cpp
2013-06-12 19:21:58 -05:00
origamiwolf 679398ab2a Missed out corpse drop check for non fles or veggy critters 2013-06-13 07:55:20 +08:00
Isylwin 5a1fc5d5ad ammo.json line 276, 298, 320
Made the weights of arrows and sorts more like real-life.
2013-06-13 01:28:10 +02:00
NaturesWitness 106bd6e1c3 Expanded Martial Arts Traits
Traits to make all martial arts styles selectable in-game.
Stopgap until NPCs are fixed.
2013-06-12 17:12:31 -04:00
NaturesWitness df72c2ccd4 Revert "Expanded Martial Arts Traits"
This reverts commit eb57f41857.
2013-06-12 17:02:16 -04:00
NaturesWitness eb57f41857 Expanded Martial Arts Traits
traits to make all martial arts usable in-game.
temporary fix until NPCs are working.
2013-06-12 17:01:18 -04:00
Isylwin 739af21685 Recipes.json line 1350-1352
Made the recipe for wooden arrows less harsh for you softcore people :P
2013-06-12 22:08:05 +02:00
Isylwin 739b802d0f Game.cpp line 8737 change
Made the amount of feather lost smaller.
2013-06-12 21:09:10 +02:00
Octav Sandulescu 19a60bcf7c Fix the 'Whoa.' text in ncurses.
Now it actually prints the first time around, instead of waiting until
you press a key or whatnot.
2013-06-12 17:57:25 +01:00
Isylwin 391df20a46 Bug fix ranged.json line 262
I'm stooopid
2013-06-12 18:48:02 +02:00
Isylwin f25f315639 Bug fix game.cpp line 8737
I'm stooopid
2013-06-12 18:35:26 +02:00
Isylwin 1c2e5d7d39 Additions of Fletching
Adds:
Arrowheads
Wooden Shafts
Feathers

Changes:
Crows now drop feathers
Wooden arrows have to be made from feathers, arrowheads and shafts

This has NOT been tested i.e compiled to see if the changes work.
2013-06-12 18:05:01 +02:00
utunnels 12c83f4a6f Try to fix a sdl font offset bug. Also update DrawWindow. 2013-06-12 23:31:23 +08:00
origamiwolf 17a2dd8e7a Added new fields for gibs, and only tiny and small critters are completely gibbed at high damage 2013-06-12 22:15:11 +08:00
Isylwin d8ecbb828f Test commit for myself
Just checking something
2013-06-12 14:45:42 +02:00
Isylwin de1c12786b Merge remote-tracking branch 'origin/master' into Archery 2013-06-12 14:29:08 +02:00
Octav Sandulescu e863e14093 Fucking underscore. 2013-06-12 13:02:53 +01:00
Octav Sandulescu dedb21de65 Okay, I basically rewrote the whole thing. May it be useful. 2013-06-12 12:53:21 +01:00
Octav Sandulescu 7fd77130b5 Fix the rest of the instructions, while I'm at it. 2013-06-12 09:56:15 +01:00
Octav Sandulescu 19ed69e870 Slight correction to cross-compiling instructions.
From the git-clone(1) manpage: "The 'humanish' part of the source
repository is used **if no directory is explicitly given**[...]". Since
we are explicitly giving it a directory, we need to give it the humanish
part, too.
2013-06-12 09:51:51 +01:00
Tommy 3729c5bb3f Make sure player is properly boarded when debug-spawning vehicles. 2013-06-12 20:45:10 +12:00
Tommy 9bceba1d9d Fix car doors magically closing behind the player. 2013-06-12 20:45:10 +12:00
Tommy b45a2a532a Automatically board and unboard vehicles.
* Separates the idea of vehicle control from being inside.
* No more "Board Y/N" prompt.
* Players can clamber around inside moving vehicles if they want.
* Boardable parts include seats, beds, boxes, aisles and doors.
  If the player is on any of these, they will be carried with the vehicle.
* Player can dismount by walking out of the vehicle.
* Suicidally moving onto moving frames etc is disallowed.
2013-06-12 20:45:10 +12:00
fnord 7c125f2aa8 fix fixes lost in hdd holocaust 2013-06-11 22:55:28 -05:00
Kevin Granade 8b9a842521 end 2013-06-11 22:46:42 -05:00
Kevin Granade f376787c57 Prisons\! 2013-06-11 21:46:12 -05:00
acidia 39e0e173bf Added Jail Bar Door Logic 2013-06-11 21:19:29 -05:00
Kevin Granade 319f13bf92 Another day, another huge batch of bugfixes from awesome people. 2013-06-11 21:16:13 -05:00
D Lue Choy 9132f5b057 from_sentance_case
I do not fully understand source of "17fe mode disabled".
cleaner method of changing case.
2013-06-11 20:13:23 -04:00
Kevin Granade 78b1dd3f88 Fix coordinate handling when avoiding spawning vehicles on top of each other. 2013-06-11 17:57:03 -05:00
D Lue Choy 285bcb5d5c ...
I don't know why this one file was not commited with the other. I built with it /before/ committing.
2013-06-11 18:15:36 -04:00
D Lue Choy b662d9ae12 ('Z'ing|zing) (\(X( or Y)\))
Additional press_x variant to handle 'w'ords that are words.
2013-06-11 17:55:23 -04:00
fnord fdc7b2c193 Burst fire will never populate new_targets[] with monsters at shooter coordinates 2013-06-11 16:30:56 -05:00
fnord 19b739e614 turrets no longer load 9mm_blanks 2013-06-11 15:35:07 -05:00
fnord 1bc5708920 Instead of helpfully shooting their owners in the face, friendly
turrets will hold their fire if player is within a 30 degree cone
of potential friendly fire 'mistakes'.
2013-06-11 15:19:07 -05:00
Shoes01 99703bfc7d Update changelog 2013-06-11 16:31:18 -03:00
Shoes01 1cf6a385a0 Merge branch 'master' into bug-fixes 2013-06-11 16:29:19 -03:00
D Lue Choy 6461427870 Merge branch 'upstream/master' 2013-06-11 14:44:51 -04:00
Isylwin 96b5ed86e8 Merge remote-tracking branch 'origin/master' into Archery 2013-06-11 16:37:03 +02:00
Shoes01 45025d7b5f Diseases no longer pile onto eachothers speed bonuses in the @ menu 2013-06-11 11:17:38 -03:00
Shoes01 cb7cd8ec71 Merge branch 'load-temp-fix' into bug-fixes 2013-06-11 10:42:52 -03:00
Shoes01 2a8688d39c Merge branch 'blister-fix' into bug-fixes 2013-06-11 10:42:44 -03:00
Shoes01 d014321afd Merge branch 'thirst-fix' into bug-fixes 2013-06-11 10:42:33 -03:00
Shoes01 f3e0581ac5 Save/load disease intensity, fixed blisters bug and breaks save 2013-06-11 09:44:05 -03:00
Shoes01 8db49bd998 temp_conv now saved to avoid strange behaviours on load 2013-06-11 09:14:54 -03:00
Fergus Dall 02df95256e Ensure that the player is always considered to be able to see themselves 2013-06-11 21:03:27 +09:30
Fergus Dall 25f9c3884a Add sound indicator
See #1543
2013-06-11 18:35:30 +09:30
Fergus Dall 8d5e6edd84 Make several types of light source respect OPT_CIRCLEDIST, including player held lightsources. 2013-06-11 17:50:04 +09:30
Williham Totland de0969d1de Brings back the code styling of building_generation.cpp. 2013-06-11 06:02:06 +02:00
Christian Buskirk 26879c46fc Added reasoning comments 2013-06-10 20:11:35 -07:00
Kevin Granade 2916482f8c Merge pull request #1548 from KA101/Mutation-proofreading
Effect-proofreading (You Feel X)
2013-06-10 19:51:36 -07:00
Kevin Granade f8a79ab175 Smaller enhancements make the project go round. 2013-06-10 21:46:16 -05:00
KA101 885ed7b51d Effect-proofreading
Mostly the new Mutagen flavors, but one or two other things cropped up.
Changed the Troglodyte message entirely.
2013-06-10 22:42:28 -04:00
acidia fa42b57dd3 Added Jail Bar Door Logic 2013-06-10 20:33:00 -05:00
acidia 064328b92e Added Jail Bar Door Logic 2013-06-10 20:27:50 -05:00
acidia d64370541e Added Jail Bar Door Logic 2013-06-10 20:25:00 -05:00
Kevin Granade f96d802182 Stop unnecessaraly saving adjacent overmaps every time they are potentially dirtied. 2013-06-10 20:24:53 -05:00
acidia fefa233d9c Added Prison Spawn 2013-06-10 20:18:33 -05:00
acidia 6fea0b6683 Added Prison Spawn 2013-06-10 20:15:46 -05:00
acidia 5290c2fc09 Added Prison 2013-06-10 20:09:05 -05:00
Kevin Granade 653190fa6e Merge Magnificent Mission Modifications. 2013-06-10 19:57:20 -05:00
Ethan "Soron" Kaminski fb089b9a71 Merge PR #1522 - category sorting in advanced inventory 2013-06-11 12:31:23 +12:00
Ethan "Soron" Kaminski 522960a2c0 Merge PR #1518 - coalesce some UI code 2013-06-11 12:30:02 +12:00
Ethan "Soron" Kaminski 705c202ba9 Merge PR #1524 - olfactory mask is no longer a scent sink 2013-06-11 12:26:29 +12:00
Ethan "Soron" Kaminski ef358767e0 Merge PR #1532 - neutral trait coloring 2013-06-11 12:15:47 +12:00
Quietust 9771340ba2 Add missing bits 2013-06-10 18:46:07 -05:00
Ethan "Soron" Kaminski d6b2f156ff Merge PR #1513 - radiation badges 2013-06-11 11:43:38 +12:00
teh-sam 1ce228614d Signoff 2013-06-10 17:53:04 -05:00
fnord c4ec82ecc6 Stop mutation from removing starting traits (such as optimist, robust
genetics, android)
2013-06-10 17:39:08 -05:00
Ethan "Soron" Kaminski f51c5f698f Merge PR #1526 - minor lightmap optimization 2013-06-11 10:01:35 +12:00
Ethan "Soron" Kaminski c9fed93159 Merge PR #1531 - obsolete function decl. cleanup 2013-06-11 09:59:28 +12:00
fnord e24c4655c7 fix silly enum assumptions 2013-06-10 16:46:47 -05:00
fnord a783d1b713 More descriptive name 2013-06-10 15:37:36 -05:00
fnord 46063018fe Cleanup 2013-06-10 15:35:02 -05:00
fnord d52baca0cb Merge remote branch 'origin/master' into map_editor 2013-06-10 15:31:23 -05:00
Quietust f3cfe0e2ab Display neutral traits in yellow instead of red 2013-06-10 13:39:49 -05:00
Quietust 909fce3119 Cleanup from mutation refactor 2013-06-10 12:15:13 -05:00
origamiwolf b0b0b5e839 Gibs 2013-06-10 22:16:14 +08:00
Isylwin 77028f2c29 Isy's Archery Addition
I've posted this earlier today on the forums but Williham pointed out to
me that I should be using github. I have no idea if I'm missing
something, so if you are reading this I'm probably a retard and should
ask first do later.
2013-06-10 15:53:16 +02:00
Quietust f6c6db2597 Minor optimization to lightmap generation 2013-06-10 08:36:34 -05:00
Quietust f697e55a95 Add ui.cpp/ui.h to MSVC build project files 2013-06-10 07:48:25 -05:00
D Lue Choy b6be7ae1ae Minor spelling changes. 2013-06-10 03:42:51 -04:00
Fergus Dall 12377e8f9e Stop olfactory mask from removing scent
Fixes #1512
2013-06-10 17:03:54 +09:30
Fergus Dall d816ee2b5d Fix seg-fault in mutation wish menu 2013-06-10 16:39:49 +09:30
Fergus Dall 16194ce2c3 Before removing a mutation, remove its dependencies
Fixes #1509
2013-06-10 16:39:02 +09:30
fnord 6a99d5629d ui.* now conforms to cataclysmic indentation and spacing convention 2013-06-10 02:00:18 -05:00
fnord dd8b9592e0 game.h: Remove #include "ui.h" as it piggybacks output.h 2013-06-10 01:59:19 -05:00
fnord 7526a3b16c Advanced inventory: Add [c]ategory sort 2013-06-10 01:57:41 -05:00
Fergus Dall 9da3a9a7cb Guarantee at least 5 bionics in lab finale
Fixes #1510
2013-06-10 16:01:55 +09:30
D Lue Choy 49dc280805 help texts now use current key config.
help text not updated to reflect new action options.
some help text reflowed.
helper function for unsentance casing.
helper function 'press_x' returns a string for message building.
2013-06-10 02:23:32 -04:00
fnord 16d8d18c0d Merge remote branch 'origin/master' into better_menu 2013-06-10 01:20:42 -05:00
Williham Totland 18eee8f2f9 Adds strawberry bushes. 2013-06-10 08:08:10 +02:00
fnord dfeea3184e Replace menu and menu_vec with calls to uimenu equivalents 2013-06-10 01:00:34 -05:00
Williham Totland f182b22b76 Significantly reduces the number of giant worms. 2013-06-10 07:34:07 +02:00
fnord 5f1e3b467e Leave KEY_LEFT unused for now 2013-06-10 00:25:38 -05:00
Williham Totland b41d35f05b Adds some new, useful entries to .gitignore 2013-06-10 07:21:26 +02:00
Ethan "Soron" Kaminski b69c583d22 Fix catacurse.h compilation with the new ui.cpp 2013-06-10 17:08:29 +12:00
Williham Totland bb99ae7e03 Resolves an issue where game::game_quit was hilariously redundant. 2013-06-10 07:07:29 +02:00
Williham Totland a126213ed5 Resolved an issue where mattack::bite would give the wrong message 2013-06-10 07:04:17 +02:00
Ethan "Soron" Kaminski d13ab0b992 Merge PR #1497 - monster save/load bugfix 2013-06-10 16:41:16 +12:00
Ethan "Soron" Kaminski f0d205b9f6 Merge PR #1504 - mutagen refactor 2013-06-10 16:34:45 +12:00
Tommy 0659912848 Automagically add new keybindings, so long as they don't conflict. 2013-06-10 16:33:57 +12:00
Ethan "Soron" Kaminski 5e7d36ab98 Merge PR #1488 - AtomicDryad's new UI menu 2013-06-10 16:22:55 +12:00
Kevin Granade e3b9b707e5 Add some consistency to JSON syntax of new mutagen types. 2013-06-09 21:28:40 -05:00
Kevin Granade c79768b2e0 Add radiation badge item and associated infrastructure. 2013-06-09 20:59:40 -05:00
Christian Buskirk 8dbec5230f Throwing bug-fix
Style updated as part of the bug-solving process.
2013-06-09 18:58:37 -07:00
Kevin Granade 51281e1850 Return pointers to items in player:inv_dump() and inventory::dump() instead of copies of items. 2013-06-09 19:57:59 -05:00
fnord 9f11df4d30 100% compatibility with menu() and menu_vec() 2013-06-09 17:15:28 -05:00
Christian Buskirk b102f5e622 Fixed copy/paste mishap 2013-06-09 15:03:26 -07:00
Christian Buskirk cbcd451dbd Made smashing sounds trigger on smash location instead of player's 2013-06-09 14:55:30 -07:00
Christian Buskirk f2f8474495 Made shooting interactions more realistic
Added some missing cases
Alarms sound at terrain location instead of players
Destroying things by shooting/throwing makes sound
Extremely high damage weapons can go through/destroy reinforced glass
Throwing no longer always breaks windows - Fixes issue #1122
Windows now drop items - Fixes issue #1240
2013-06-09 14:38:20 -07:00
Christian Buskirk 1588e8128d Fixed a few missing semicolons 2013-06-09 12:39:34 -07:00
Christian Buskirk 2222b28fdd Reduced number of item value checks in steel recycler function 2013-06-09 12:22:17 -07:00
Kevin Granade eb859cb53c Merge Misc aMendments. 2013-06-09 11:53:13 -05:00
Kevin Granade 4231e1bba5 Description tweak. 2013-06-09 11:17:46 -05:00
Kevin Granade 6ee6bc05b0 Streamline special mutagen type handling by routing them theough a single iuse function. 2013-06-09 11:09:08 -05:00
Kevin Granade 25666a1895 Clean plans member of monster object when loading from file.
Prevents pathological corner-case where
save -> exit -> start -> load -> repeat, with no intervening
player actions causes geometric growth of <player name>.sav
and the resulting monster array size.
2013-06-09 10:32:15 -05:00
origamiwolf c24e5b5cc3 Bugfix for incorrect item spawn location in mansion bedrooms 2013-06-09 21:35:11 +08:00
Fergus Dall 4fb09287b6 Changed M72 LAW description to be more accurate
Closes #1499
Closes #800
2013-06-09 19:58:17 +09:30
Tommy f6986c1bac Convert some more stuff to using choose_adjacent(). 2013-06-09 21:16:17 +12:00
Christian Buskirk 0e86cf801b Made gasoline pumps only break when used
Fixes issue #1427
2013-06-09 00:28:36 -07:00
Christian Buskirk 8355f3d3b4 Made high strength characters on meth not break the disease duration 2013-06-09 00:22:00 -07:00
Kevin Granade 8c4f5dbfd8 Don't despawn monsters when exiting the game, they're already saved elsewhere. 2013-06-09 01:58:27 -05:00
fnord c1b1055c1b Comment typo fixes 2013-06-09 00:19:06 -05:00
fnord 9a892424d3 Merge branch 'better_menu' into advanced_inv_better_popups 2013-06-09 00:17:32 -05:00
fnord 244aa81d1a Warning for (startx,width,starty,title,ents) constructor removed: tested ok. -1024 changed to UIMENU_INVALID in init(); 2013-06-09 00:16:39 -05:00
Kevin Granade 539afb5773 Merge enhancements to mutation system. 2013-06-08 23:16:36 -05:00
Kevin Granade 90c17258c2 Merge remote-tracking branch 'dda/master' into dda-master 2013-06-08 23:15:44 -05:00
Kevin Granade 2909795958 Merge pull request #1495 from yobbobanana/movecost_update
Oops.
2013-06-08 21:10:20 -07:00
Kevin Granade 87517c8247 Merge MK II power armor. 2013-06-08 23:05:02 -05:00
Tommy 015dd91cd8 Fix silly mistake. 2013-06-09 16:03:32 +12:00
Tommy 01d6fdacc0 Use calc_movecost() for path length estimation. 2013-06-09 15:59:11 +12:00
Tommy 2e62753e4d Move monster movecost calculation to its own function for consistency. 2013-06-09 15:19:19 +12:00
Tommy 962ed6ebf8 Also use combined_movecost() for NPC moves, and path length calculation. 2013-06-09 15:19:19 +12:00
Tommy 8641bee38a Make movement take half the cost of both the beginning and end tiles,
in stead of just taking the cost of the end tile.
2013-06-09 15:19:19 +12:00
acidia c9e5aad704 Re-Added Zombie Spawn to Sarcophagus Basement 2013-06-08 21:14:25 -04:00
Ethan "Soron" Kaminski d4cc36fbe8 Merge PR #1491 - brass catcher (collects spent ammo shells)
Conflicts:
	mapitemsdef.cpp
2013-06-09 12:47:23 +12:00
Ethan "Soron" Kaminski 42a38ba8d0 Merge PR #1486 - CBM crafting/disassembly 2013-06-09 12:34:05 +12:00
Ethan "Soron" Kaminski 483a1c3277 Merge PR #1492 - stop crashing with human flesh, couple other things 2013-06-09 12:32:43 +12:00
Ethan "Soron" Kaminski b132383344 Merge PR #1421 - elevators made more sane 2013-06-09 12:12:27 +12:00
Williham Totland 480ba538fa Only checks for radiation gear if the ground is irradiated 2013-06-09 01:36:24 +02:00
Ethan "Soron" Kaminski 896ebeccd0 Const a few more (required) item methods 2013-06-09 11:29:21 +12:00
Williham Totland 90b4a261f6 Brings disassembly in line with crafts 2013-06-09 01:16:51 +02:00
Ethan "Soron" Kaminski 23e05440cd Merge PRs #1474, #1470, #1467 - drawing efficiency boosts 2013-06-09 11:11:23 +12:00
Williham Totland 104c85ab84 Fixed minor spelling error, thanks to kevingranade 2013-06-09 01:05:15 +02:00
Williham Totland 1eeaf4e881 Adds Mk. II power armor to spawn lists 2013-06-09 00:36:24 +02:00
Williham Totland 63ec2d48c6 Adds power armor Mk. II; makes power armor impervious to radiation 2013-06-09 00:27:53 +02:00
Williham Totland fcbb998d72 Updates poppy picking to properly ponder infection resistance (see note in comments) 2013-06-09 00:24:53 +02:00
Williham Totland 24b674f99d Updates name of "canned cad" to "soylent slices" to properly fit the theme of To Serve Man 2013-06-09 00:24:00 +02:00
Williham Totland 22a1cbbf7e Resolves an issue where interacting with human flesh would crash the game 2013-06-09 00:23:01 +02:00
Williham Totland 1ba2641b5b Slight rebalancing, adds Power Armor Interface Mk. II 2013-06-09 00:18:03 +02:00
Kevin Granade 561f372e20 Merge remote-tracking branch 'CR/pr/1480' into dda-master 2013-06-08 15:57:22 -05:00
Kevin Granade 8fe7a5408c Duodecimerge\! 2013-06-08 15:18:07 -05:00
Kevin Granade 0c30276a39 Replace some of the melee weapons in gun nut basement with gun extras. 2013-06-08 14:43:54 -05:00
Kevin Granade e614dba6ba Add brass catcher item, functionality, craft recipe, and spawn locations. 2013-06-08 14:43:25 -05:00
Williham Totland c8ecb7b7c7 Blood Filter disassembly added 2013-06-08 19:35:02 +02:00
Tommy f58c769ce2 Fix some mindless copy-paste. 2013-06-09 05:15:00 +12:00
Tommy cbc4f65a43 Allow players to board the vehicle they are standing in/on with '^'. 2013-06-09 05:05:43 +12:00
fnord 0a12c9f43b Now using 'uimenu' class to query for sorting, or destination when moving
to an 'a'll area. Depends on pull 1487
2013-06-08 10:34:59 -05:00
fnord 98100189ec Add ui.cpp and ui.h to windows .cbp thingie 2013-06-08 10:23:48 -05:00
acidia 93120acbcf Commented out zombies for Sarcophagus basement till elevator bug fixed 2013-06-08 10:17:59 -05:00
fnord 244dfaf245 New uimenu class with options for colors, size, positioning, behavior, preselection, and per entry definitions for hotkey, disabling, etc.
Also supports quick and dirty invokation like menu();
2013-06-08 10:15:55 -05:00
Williham Totland 25b77cbf2a Assembly and disassembly recipes for a number of CBMs 2013-06-08 15:47:45 +02:00
Fergus Dall d6e359b460 Refund move points when aborting firing a bow 2013-06-08 22:51:24 +09:30
Fergus Dall 80e396ba67 Stop player from shooting themselves
Fixes #1482
2013-06-08 22:38:16 +09:30
Fergus Dall b6738b9e15 Replace OPTIONS[OPT_CIRCLEDIST] with trigdist 2013-06-08 22:26:54 +09:30
Fergus Dall fdddeb2e33 Use rl_dist to limit range on burst fired weapons 2013-06-08 22:23:09 +09:30
Fergus Dall 94953e6ce1 Merge remote-tracking branch 'atomicdryad/correcting_headlight_mangling' into headlight 2013-06-08 22:01:16 +09:30
fnord e3c3f7e2ad Fixed trig light arc ends 2013-06-08 07:22:38 -05:00
Fergus Dall ea842fdcd4 Stop burst-fire weapons from targeting things out of range
Fixes #1464
2013-06-08 21:39:33 +09:30
Fergus Dall 6bd2be6c19 Stop inverting lightrays in the wrong places in map::apply_light_arc 2013-06-08 21:23:14 +09:30
Fergus Dall 7ee5220010 Use sqrt instead of trig_dist, as trig_dist returns int 2013-06-08 21:01:20 +09:30
Fergus Dall e5188abc04 Re-write map::apply_light_arc to respond to circleLOS option
Fixes #1476
2013-06-08 20:50:07 +09:30
fnord 7db953b341 multidrop: only pad to screen width 2013-06-08 06:02:41 -05:00
fnord 29d91ec83b fix missing declartion 2013-06-08 06:01:41 -05:00
Octav Sandulescu e8af406e8c Return to the build dir after making win32 bindist. 2013-06-08 10:27:01 +01:00
Octav Sandulescu 66f85fd665 Clean up the bindist. 2013-06-08 10:22:23 +01:00
fnord b14e56e7ed trap and field editing 2013-06-08 03:56:29 -05:00
fnord 11917efbb1 Merge remote branch 'origin/master' into map_editor 2013-06-08 03:49:25 -05:00
Tommy c8a51d5272 Properly draw bullets when firing with a shifted viewport. 2013-06-08 19:42:05 +12:00
Kevin Granade 9d02380e5d Merge limiter to ranged targeting in trig distance mode. 2013-06-07 23:54:17 -05:00
Kevin Granade 346d3fc13c Add invalidation hook to player that is called every action. 2013-06-07 23:42:06 -05:00
Kevin Granade 6bda614fce Use new accessor to test for presence of nightvision tech. 2013-06-07 22:50:52 -05:00
Kevin Granade cbb79103d9 Add a caching accessor for whether the player has active night vision. 2013-06-07 22:45:50 -05:00
Fergus Dall 049e2dad48 Disable spawning and crafting of two-way radios
Fixes #1430
2013-06-08 12:18:11 +09:30
Fergus Dall 0c20b9e0e0 Make lava destroy any items placed on it
Fixes #1154
2013-06-08 11:55:23 +09:30
Tommy f4ec56896c Sign SIGNOFF. 2013-06-08 14:19:43 +12:00
Kevin Granade 7bb826d024 Marshall info about the current square at the start of drawsq() instead of calling the same methods multiple times. 2013-06-07 21:11:39 -05:00
Tommy c20a6d656b Display the number of movement points the player's last action used. 2013-06-08 13:51:27 +12:00
Fergus Dall 03a1ddb767 Don't clear the npc list while saving
Fixes #1336
2013-06-08 11:06:44 +09:30
Kevin Granade 3ff2841600 Nest trig_dist() in rl_dist() instead of replicating the implementation. 2013-06-07 20:06:03 -05:00
Kevin Granade a61050d0b7 Batch of bugfixes.
Conflicts:
	SIGNOFF
2013-06-07 19:07:59 -05:00
Kevin Granade 273cb19123 Despawn monsters when we change z-levels, and handle sticking them in the stair queue properly. 2013-06-07 18:57:20 -05:00
D Lue Choy 78598fc848 Save on sleep?
Option to save game before sleeping.
Sets values for autosave.
options.cpp styled using current ruleset.

Signed-off-by: D Lue Choy <dluechoy@>
2013-06-07 19:16:11 -04:00
Voker57 f5d43cbefd Signed off. 2013-06-08 02:32:24 +04:00
Ethan "Soron" Kaminski bdc508ca30 Merge PR #1455 - view centering while aiming 2013-06-08 10:11:38 +12:00
Christian Buskirk 6c7c5c92cd Merge PR #1456 - Cooking with Javelins 2013-06-07 14:21:00 -07:00
fnord cba216eea6 Add missing semicolon 2013-06-07 15:14:20 -05:00
fnord 9efd9c6cb1 ranged.cpp: target: Players can no longer aim horizontally beyond
the weapon's range if circular geometry is enabled.
2013-06-07 15:00:28 -05:00
Izicata db05859538 Changed trig_dist to rl_dist for range calculations
This should ensure both circular distances and roguelike distances use proper range calculations.
2013-06-07 16:50:06 -03:00
Izicata ec32cf4399 Use absolute-value based range calculation when circular distances is turned off.
If circular distances is on, use the old trig-based range calculation. 

If circular distances is off, use either the distance along the x axis or the distance along the y axis as the range value (whichever is bigger), because that's how non-Euclidean square-tile based systems work.
2013-06-07 16:39:37 -03:00
Christian Buskirk 569017d4b5 Merge pull request #1459 from fergus-dall/flamethrower 2013-06-07 11:23:03 -07:00
Shoes01 578b776f50 Thirst now occurs less frequently when hot 2013-06-07 14:29:45 -03:00
Fergus Dall 5bd3dd5389 Check AMMO_FLAME correctly in game::fire
Fixes #1457
2013-06-07 23:14:57 +09:30
Stevensonz c29f251e0c Cooking with Javelins Issue #1438 FIX
Add Javelins again which was lost due to oversight.
(Re--added Javelin to Cooked Meat ,Cooked Human Meat and Cooked Veggy
Recipe)
2013-06-07 20:47:29 +08:00
Tommy 7486b13eef Don't snap the view to the player when targeting. Fixes #90. 2013-06-08 00:10:50 +12:00
Ethan "Soron" Kaminski 7dca418f8f Remove the unused (and unlikely to be used) OutputText function 2013-06-07 23:52:15 +12:00
Ethan "Soron" Kaminski 43edb6e28e Use an explicitly unsigned char variable for array access 2013-06-07 23:50:57 +12:00
Ethan "Soron" Kaminski c87a4eb985 Use the prescribed method for converting from a string literal to a char* 2013-06-07 23:46:10 +12:00
utunnels f3bec68606 Wrap contents of case statements in braces. 2013-06-07 19:32:34 +08:00
utunnels d778c96f24 Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into sdl-window-fix 2013-06-07 19:31:26 +08:00
utunnels 5238680f4e Try to fix cross initialization issue which certain compilers complain about. 2013-06-07 19:27:46 +08:00
Fergus Dall c582ec1f00 Change X-Acto knife description
Closes #1451
2013-06-07 18:48:14 +09:30
utunnels d403dee27f Code/comment clean up. 2013-06-07 17:13:49 +08:00
utunnels 033c674821 sdl version now reads fontsize from FONTDATA instead of using fontheight directly. The default value is fontheight-1, if it is not provided. 2013-06-07 16:18:00 +08:00
Tommy 6b47b3ed04 Replace pl_choose_vehicle() with generic choose_adjacent(). 2013-06-07 19:53:48 +12:00
Tommy 20448bbb9f Move all the which-direction queries into a single function. 2013-06-07 19:32:08 +12:00
utunnels 99be2add0d Alt+F4 support for sdl version (old sdl version doesn't support that directly). Also center the window when start up. 2013-06-07 14:58:46 +08:00
Ethan "Soron" Kaminski 329879b152 Merge PR #1441 - more vehicle controls tweaks 2013-06-07 16:27:25 +12:00
Ethan "Soron" Kaminski 567a0cf048 Fix font paths 2013-06-07 16:14:42 +12:00
Ethan "Soron" Kaminski 241666ab45 Merge PR #1445 - updates to SDL font stuff 2013-06-07 16:06:23 +12:00
Izicata eb51a46b07 Signed off.
I am not going to include my email address, because reasons.
2013-06-06 23:56:53 -04:00
Kevin Granade 60bc5c0d01 Merge signoff from AtomicDryad.
Conflicts:
	SIGNOFF
2013-06-06 22:49:18 -05:00
utunnels 82c369f341 Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into sdl-font-fix 2013-06-07 11:43:44 +08:00
Kevin Granade f237dfbc7c Merge damaging radiation and optional mutations from rads. 2013-06-06 22:42:36 -05:00
utunnels fe5cd58192 Remove unnecessary fontpath from sdlcurse code. 2013-06-07 11:42:33 +08:00
Ethan "Soron" Kaminski 62dc4a0d3e Merge PR #1442 - lightmap fixes 2013-06-07 15:32:09 +12:00
utunnels 04c6035e79 Merge branch 'master' of github.com:CleverRaven/Cataclysm-DDA into sdl-font-fix 2013-06-07 11:14:45 +08:00
Kevin Granade 70be4e63a9 Stupid error is stupid. 2013-06-06 22:14:42 -05:00
utunnels 12bfcf4363 Re-commit unsaved file last time. 2013-06-07 11:13:27 +08:00
utunnels b0a2691a9b Make sdl FONDATA compatible with its gdi counterpart. Cache glyph data for sdl font to speed up DrawWindow. Filter shift, alt and ctrl keys. 2013-06-07 11:03:43 +08:00
Kevin Granade 7b043b8aad Batch of small fixes. 2013-06-06 21:38:53 -05:00
Kevin Granade 23fb52737b Apply transparency effects on horizontal-dominant rays as well. 2013-06-06 21:36:23 -05:00
Kevin Granade c1e849a701 Sanity check for map::apply_light_ray() to avoid lightmap hangs. 2013-06-06 21:36:12 -05:00
Kevin Granade 75bc1c5015 Merge pull request #1424 from ethankaminski/acid-resist-returnval
Actually return the ret value in item::acid_resist
2013-06-06 19:16:48 -07:00
Tommy 8a975d9829 Merge external vehicle control with new '^' key. Fixes #1395. 2013-06-07 14:05:15 +12:00
Ethan "Soron" Kaminski c26fb969c3 Merge PR #1432 - multidrop UI shows list of dropped items 2013-06-07 13:49:17 +12:00
Ethan "Soron" Kaminski 4544c029bf Merge PR #1411 - make max traits optional 2013-06-07 13:40:02 +12:00
Ethan "Soron" Kaminski af7eac439c Merge PR #1380 - Windows makefile gives the app an icon 2013-06-07 13:39:32 +12:00
Ethan "Soron" Kaminski 76bb7b8a60 Merge PR #1394 - catacurse wclear change 2013-06-07 13:12:44 +12:00
Ethan "Soron" Kaminski 8c1b90ac2a Catch a lingering reference to the old skill data structure
Should fix #1436.
2013-06-07 12:43:20 +12:00
Ethan "Soron" Kaminski 2242dc0558 Merge PR #1416 - unusing liquids (disinfectant) 2013-06-07 12:31:21 +12:00
Ethan "Soron" Kaminski efc9851ece Merge PR #1412 - fix blade trap disarming 2013-06-07 12:28:20 +12:00
Ethan "Soron" Kaminski d8da557343 Merge PR #1400 - vehicle updates 2013-06-07 12:15:20 +12:00
Ethan "Soron" Kaminski ca566baee7 Sort inventory by item charges, use low-charge items first
FINALLY got it so that low-charge items will consistently be used in favor of high-charge items.

Doesn't do anything for matches vs. lighter use, though (since it also sorts by item ID).
2013-06-07 12:01:10 +12:00
MacrosBlackD 6cfe4927ee Fixed loading of max trait points from options 2013-06-06 16:36:31 -05:00
Quietust 2f86ddf54d don't do pow(int, 2.0) - (int * int) is all but guaranteed to be faster 2013-06-06 13:59:36 -05:00
D Lue Choy 4efd4a1fbd Multidrop screen now shows a summary of what is about to be dropped
Wielded items highlighted in lightblue, and worn items are highlighted in cyan.
Partial quantities are shown with { } braces.
Redraw not optimized; does not interfere with 80 column display on Windows.

Signed-off-by: D Lue Choy <dluechoy@>
2013-06-06 14:37:11 -04:00
MacrosBlackD bfa463f427 Removed int& from set_traits 2013-06-06 08:57:07 -05:00
MacrosBlackD c36e1390eb Added max trait points to the options menu. Addresses issue #1410 2013-06-06 08:57:06 -05:00
Ethan "Soron" Kaminski d1bd12b0e2 Actually return the ret value in item::acid_resist 2013-06-06 19:02:40 +12:00
Ethan "Soron" Kaminski 9d9fec4c62 Merge PR #1422 - update .gitignore 2013-06-06 18:48:28 +12:00
Ethan "Soron" Kaminski dbc0eea563 Remove an extraneous close brace 2013-06-06 18:47:01 +12:00
Izicata 97d8766dc6 Dropped items no longer dissappear.
The directional drop code was substantively different from the regular drop code; directional drops do not duplicate items when dropping into full vehicle trunks, even on builds pre-#1401. Since the directional drop code actually works, I copy-pasted the relevant parts over the regular drop code, changed dirx/diry to u.posx/u.posy, and the result doesn't duplicate items and actually drops dropped items.

Hopefully I haven't horribly broken anything this time.
2013-06-06 02:07:20 -03:00
MacrosBlackD 0d95cb99fd Updated .gitignore to exlude user settings and artifacts from the visual studio build 2013-06-05 23:33:38 -05:00
Kevin Granade 06ebe00ed3 Call game::vertical_move() from iexamine::elevator() instead of trying to shift levels manually. 2013-06-05 23:19:38 -05:00
Kevin Granade a5eddf5e9a Add support for elevators to game::nertical_move(). 2013-06-05 23:18:45 -05:00
Ethan "Soron" Kaminski 5e8a75e6f4 Make SDL play nice with CPU usage while listening for events 2013-06-06 15:09:40 +12:00
Ethan "Soron" Kaminski 3061d2a15f Stop hiding the mouse cursor with SDL 2013-06-06 15:07:46 +12:00
Ethan "Soron" Kaminski a6359ab812 Merge PR #1417 - more SDL adjustments for MSVC 2013-06-06 15:01:12 +12:00
Quietust b767b19a22 Get SDL compile actually working this time - helps to include the libs 2013-06-05 21:56:16 -05:00
Tommy 9e7160f4e0 Roll backwards when exiting a reversing vehicle. 2013-06-06 14:38:14 +12:00
Kevin Granade 90b1454d3f Hackishly special case liquid un-use handling in iuse.cpp. 2013-06-05 21:28:51 -05:00
Tommy 0247a68bb2 Don't roll player if diving from a vehicle into water. 2013-06-06 14:16:42 +12:00
Tommy 55c5c9fb3d Safely hop from slow-moving vehicles, get hurt from quick ones. 2013-06-06 14:12:16 +12:00
Ethan "Soron" Kaminski 6791b36b20 Made font paths work for both SDL and wincurse.cpp 2013-06-06 13:32:24 +12:00
Kevin Granade a78d4ab6a5 Fix disarming blade trap as per issue #1403. 2013-06-05 19:29:32 -05:00
MacrosBlackD 8561b882d6 signed-off ;) 2013-06-05 19:27:47 -05:00
Kevin Granade 34ce78ca92 Merge fix to vehicle trunk duplication bug. 2013-06-05 18:55:50 -05:00
Kevin Granade bf96a523bf Merge blood analysis and filtering extensions. 2013-06-05 18:52:45 -05:00
Kevin Granade ea6fc565da Merge trig based distance option.
Conflicts:
	game.h
	lightmap.cpp
	map.h
2013-06-05 18:36:52 -05:00
Kevin Granade 0626768b17 Misc mergeomainia. 2013-06-05 18:07:17 -05:00
Ethan "Soron" Kaminski aebb05a22d Merge PR #1402 - fix cataclysm-launcher script 2013-06-06 10:48:19 +12:00
MacrosBlackD b4f69b80a6 Replaced electric motor on the chainsaw recipe with the 1 cylinder engine. This addresses issue 1405. 2013-06-05 17:34:45 -05:00
Ethan "Soron" Kaminski 1a28044b91 Merge PR #1396 - no more single-tile highways 2013-06-06 10:33:20 +12:00
Ethan "Soron" Kaminski ed9b4fd905 Merge PR #1393 - assorted fixes 2013-06-06 10:32:07 +12:00
Ethan "Soron" Kaminski b067ca460f Merge PR #1408 - make nights dark again 2013-06-06 10:29:38 +12:00
Ethan "Soron" Kaminski e3b897ced2 Merge PR #1407 - WinMain for MSVC builds 2013-06-06 10:26:56 +12:00
Ethan "Soron" Kaminski 6b59ed084a Merge PR #1397 - human meat fixes 2013-06-06 10:26:35 +12:00
MacrosBlackD 398dd3c5d4 Fix issue 1381; readded if check on light level return value 2013-06-05 17:11:31 -05:00
Quietust 64dd8e0466 Add USE_WINMAIN define for MSVC so it can run without creating a console window 2013-06-05 16:30:25 -05:00
Christian Buskirk fc497729fd Stopped bleeding and poison from applying when stopped by armor 2013-06-05 11:42:36 -07:00
Octav Sandulescu b2d5e59da0 Make the 'launcher' do things without spawning _two_ subshells. 2013-06-05 19:14:34 +01:00
Izicata 1d8aed0c37 Fixed #1088
When dropping vehicle trunk overflow items to ground, don't start dropping all of the items again. Only drop items that haven't already been dropped to the trunk.

Somebody please look this over to make sure I haven't broken anything.
2013-06-05 13:27:25 -03:00
Tommy 41f080ea36 Missed a return statement. 2013-06-06 03:18:20 +12:00
fnord 9ae0c84205 Graffiti written on the current ground square will now display below
the status line (on displays supporting 27 lines or more).
2013-06-05 09:58:54 -05:00
origamiwolf f2002aa178 Used materials acid resistance to determine how items react to acid fields 2013-06-05 22:26:58 +08:00
Tommy 62a497b1a3 Properly fling player when exiting a moving vehicle. 2013-06-06 02:14:28 +12:00
Tommy dd9ae34c02 * Split vehicle disembarking out of game::examine().
* Split vehicle control out of ACTION_SLEEP.
* Add new default keybinding for vehicle control: '^'.
* Allow vehicle disembark from vehicle control menu.
* Only query for disembarking moving vehicles.
2013-06-06 01:51:54 +12:00
origamiwolf b16960015e Fixed typo in mapitemsdef that prevented human cookbook from spawning 2013-06-05 21:29:39 +08:00
origamiwolf d7bbf9d357 Fixed order of material checks in complete_butcher 2013-06-05 21:28:21 +08:00
Fergus Dall 8f086dcd8a Don't attempt to make a highway if start and end points are the same
Fixes #1119
2013-06-05 21:08:57 +09:30
Fergus Dall 688e0c7506 Remove unnecessary check in SkillLevel::rust 2013-06-05 20:32:06 +09:30
Fergus Dall b34d1e275c Change wclear to call clearok instead of wrefresh
Fixes #1149
2013-06-05 20:28:17 +09:30
fnord 43036fb7fe Make sharpie markers write and spraycans spray 2013-06-05 05:57:32 -05:00
fnord 09eb756bc6 Behold, sharpie markers 2013-06-05 05:54:10 -05:00
Fergus Dall 570bc23f02 Make quench and nutrition of cooked foods more inline with their components.
See #1181
2013-06-05 20:19:20 +09:30
Fergus Dall 832e230cd8 Stop partially trained skills from rusting down a level when OPT_SKILL_RUST = 1
Fixes #1224
2013-06-05 19:51:39 +09:30
Fergus Dall 80ef38459c Make blood analysis detect all drugs 2013-06-05 19:32:21 +09:30
Fergus Dall a0ecb15c19 Make blood filter remove all other drug based diseases 2013-06-05 19:27:20 +09:30
Fergus Dall 02f1626fb8 Make blood analysis detect meth, and blood filter remove "High on meth" effect 2013-06-05 19:23:54 +09:30
Fergus Dall 5800c1d74d Make blood filter remove painkiller and stimulatnt totals 2013-06-05 19:23:22 +09:30
Christian Buskirk b95ed0f2dd Fixed cloak materials
Addresses issue #1359
2013-06-05 02:22:51 -07:00
Christian Buskirk 1293a4a327 Made bites no longer infect when canceled by armor
Also made bite infection chance based on damage dealt.
2013-06-05 02:14:00 -07:00
Christian Buskirk 18fc805a0f Made Gradual night light on by default
We have a fancy realistic light effect, lets use it (I'm not even sure
why this is even an option, the false version is horribly unrealistic).
2013-06-05 00:54:51 -07:00
Christian Buskirk 540a19cfaa Increased Auto Safe Mode max duration to 100 2013-06-05 00:30:08 -07:00
Quietust 218bfd1323 Add custom build step for MSVC to generate version.h 2013-06-04 23:12:42 -05:00
Quietust ca482d88d2 Add MSVC build targets for SDL version 2013-06-04 23:11:33 -05:00
fnord b50433ca19 avoid use of pow() in distance calculation, speeding them up an order of magnitude (thanks quietus!) 2013-06-04 22:06:49 -05:00
Ethan "Soron" Kaminski 2314c2c63f Blood splatter from pulping is possible with *any* non-zero damage level 2013-06-05 15:04:15 +12:00
Ethan "Soron" Kaminski 3de1a7f2c2 Merge PR #1382 - corpse smashing splatter 2013-06-05 14:37:23 +12:00
Ethan "Soron" Kaminski a6fad03602 Merge PR #1383 - GlyphGryph's signoff 2013-06-05 14:37:09 +12:00
GlyphGryph 5e8bce8c51 Merge branch 'master' of https://github.com/TheDarklingWolf/Cataclysm-DDA
Conflicts:
	SIGNOFF
2013-06-04 21:15:23 -04:00
GlyphGryph 85733dfa3c Signed off. 2013-06-04 21:09:24 -04:00
Kevin Granade c062c0f857 Splatter blood around when pulping corpses. Thanks to Wrath for the idea. 2013-06-04 19:44:00 -05:00
Kevin Granade 190cdee153 Fix some crazy indention. 2013-06-04 19:25:38 -05:00
RJ Costanzo 7107433dcd Chunk of steel recipe
See issue #1170

Conflicts:

	data/raw/recipes.json
2013-06-04 19:22:13 -05:00
Kevin Granade d1c9b8dbbe Today's small fixes and enhancements. 2013-06-04 18:57:26 -05:00
Justice- ed26c90816 Updated to attach resources to executable 2013-06-04 17:47:47 -05:00
Kevin Granade 0960f63f03 Merge SDL text support. 2013-06-04 17:24:29 -05:00
Justice- 2f3e4fc8c2 Added leather vest item and crafting recipe 2013-06-04 16:17:36 -05:00
Quietust c27e89a85c Don't recalculate sight range for every tile 2013-06-04 15:36:21 -05:00
Quietust 8f0077396e Don't decrement iterators pointing at the end of an empty list 2013-06-04 15:28:27 -05:00
fnord 35250f7334 +signoff 2013-06-04 02:20:32 -05:00
Ethan "Soron" Kaminski 2f4a211065 Merge PR #1363 - adv. inv. examining 2013-06-04 19:18:26 +12:00
fnord 2ae1f65705 Fitting screen now shows storage and encumbrance in item columns 2013-06-04 02:17:59 -05:00
Ethan "Soron" Kaminski 79654065b4 Merge PR #1367 - minor radiation tweak 2013-06-04 19:16:03 +12:00
Ethan "Soron" Kaminski 6a672affcd Bows are not ever one-handable.
Closes #665.
2013-06-04 18:52:57 +12:00
fnord 6094e56112 Performance enhanced 253% via #ifdef and comment cleanup =^.^= 2013-06-04 01:40:30 -05:00
Ethan "Soron" Kaminski fa4a3bf606 Fix swimming encumbrance penalty sign, displayed formula
Closes #1369
2013-06-04 18:31:40 +12:00
Ethan "Soron" Kaminski 7202b9da7a Make indents match surrounding code 2013-06-04 18:20:49 +12:00
Ethan "Soron" Kaminski 3bcd65bcb5 Remove obsolete/inactive "map legend" stuff 2013-06-04 18:19:22 +12:00
Ethan "Soron" Kaminski 39581a1d09 Remove another unused enum from game.h 2013-06-04 17:47:08 +12:00
Ethan "Soron" Kaminski 8627293874 Remove an unused tutorial-related enum 2013-06-04 17:34:53 +12:00
Ethan "Soron" Kaminski 82b6211c50 Make the windows in the tutorial room curtained 2013-06-04 17:26:23 +12:00
Ethan "Soron" Kaminski eac93274e6 Merge PR #1344 - apply circular lighting globally 2013-06-04 15:31:58 +12:00
Ethan "Soron" Kaminski 1345baa885 Fix a segfault with the material rewrite
Need to use <= instead of < on that bounds check
2013-06-04 15:19:00 +12:00
Kevin Granade b8f66b69e1 Eliminate radiation dosage saturation, halving dosage rate to compensate. 2013-06-03 21:25:22 -05:00
Quietust 4be8d6647d Tweak sqrt() usage to make MSVC be quiet (since it replaces <math.h> with <cmath> when compiling C++) 2013-06-03 20:43:39 -05:00
Ethan "Soron" Kaminski 9428f23d63 Use standard "!" for negation, not gcc "not" extension 2013-06-04 13:39:25 +12:00
Kevin Granade 38e261b283 Scale stuck cost based on a weapon's ratio of cutting to bashing damage. 2013-06-03 19:51:19 -05:00
Ethan "Soron" Kaminski c0fbf32c8f Update a few new items to the new lowercase materials 2013-06-04 12:40:07 +12:00
Ethan "Soron" Kaminski 1d5d5666fb Merge PR #1315 - material refactor (pushed to data files)
Conflicts:
	data/raw/items/tools.json
	game.cpp
	item.cpp
	mtypedef.cpp
2013-06-04 12:31:16 +12:00
Kevin Granade 16b9a17adc Merge corpse pulping. 2013-06-03 18:53:05 -05:00
Ethan "Soron" Kaminski 69f869ca16 Merge PR #1351 - sort skill list by level 2013-06-04 11:30:20 +12:00
Ethan "Soron" Kaminski eb8ff64592 Change how pulping works with damaged corpses and multiple corpses 2013-06-04 11:24:50 +12:00
Ethan "Soron" Kaminski 63afbe6d05 Make smash time depend on the player's weapon 2013-06-04 11:12:50 +12:00
Ethan "Soron" Kaminski 7db767b36c Merge PR #1358 - correct invlet displayed after crafting 2013-06-04 10:35:35 +12:00
Ethan "Soron" Kaminski 34ba91f8df Merge small fixes - PRs #1353, #1354, #1357, #1362 2013-06-04 09:56:02 +12:00
fnord 2849eb539c remove silly #ifdef that broke "e" for non-inv items 2013-06-03 16:47:59 -05:00
fnord 62db60c36f no unused has. Indeed. 2013-06-03 16:30:49 -05:00
fnord 9c343b5b58 Inventory: remembers last highlighted item 2013-06-03 16:15:55 -05:00
fnord 0e075582c6 Advanced inv: "e" pulls up inventory item menu. Help window displays feedback messages for actions taken. "?" toggles between help and msg viewer. 2013-06-03 16:12:30 -05:00
Quietust 6557b37f44 Fix hang in 64-bit builds when filtering [V] item list 2013-06-03 14:49:41 -05:00
fnord 4b30bb41a3 fix build error 2013-06-03 13:12:19 -05:00
fnord a59e0f6a84 Nuked #debug-ifs. Restored lightarc shape. Make lightsource downgrade less cpu intensive squares within huge-assed lava fields 2013-06-03 12:35:06 -05:00
fnord c7f727d974 Merge remote branch 'origin/master' into opt_circledist-wip 2013-06-03 10:23:22 -05:00
Tommy 77fefd9123 Display the correct inventory letter when crafting adds to a stack. 2013-06-04 02:04:27 +12:00
Quietust e65588ab65 South is "S", not "W" 2013-06-03 08:43:42 -05:00
origamiwolf 5d024eb583 Added density field, for use in vortex attacks 2013-06-03 21:24:23 +08:00
Christian Buskirk 10e323f80b Small typo fix for my updated FAQ. 2013-06-03 04:02:20 -07:00
Christian Buskirk 41a432a88a Fixed hacksaw name (was "hack saw", should be "hacksaw"). 2013-06-03 03:39:34 -07:00
Christian Buskirk e116197137 Added tiny pain effect to Acid Drizzle, raincoats now offer a bit of protection to acid rain/drizzle.
Raincoats give a 1/3rd chance of canceling the drizzle effect and a
1/10th for the rain one.
Also updated raincoat description.

This addresses issue #1161.
2013-06-03 03:25:13 -07:00
Christian Buskirk 89b769ec11 Fixed old mutation effect removal when upgrading mutations
Also fixes the permanent stat gain part of issue #1259.
2013-06-03 02:54:21 -07:00
Octav Sandulescu 9bcd254e1f Catch the other copy/paste, too 2013-06-03 10:49:34 +01:00
Octav Sandulescu 6e02f37876 Bugfixes 'cannot put %s over your tentacles' 2013-06-03 10:45:40 +01:00
Christian Buskirk 17064f496c Made multiple gasoline tanks drain properly.
Fixes issue #1084
2013-06-03 02:02:14 -07:00
Christian Buskirk 0b2a39755f Made vitamins have an effect again
Optimal dose is approximately twice a day (~13.8 hours per dose).
Also fixes issue #1136
2013-06-03 01:43:29 -07:00
Christian Buskirk c12bab5ede Remove old TODO comment 2013-06-02 23:51:14 -07:00
Ethan "Soron" Kaminski a90f8beca3 Make key handling work for non-ASCII characters 2013-06-03 18:40:36 +12:00
Christian Buskirk 417c2235f3 Updated FAQ 2013-06-02 23:27:02 -07:00
Ethan "Soron" Kaminski a6b43ca28e Make it possible to apply multiple damage levels to a corpse in one attempt
Can't believe I didn't code it this way to begin with >_>.
2013-06-03 18:24:02 +12:00
Ethan "Soron" Kaminski 252c3977f5 Move the corpse damage descriptors to the default case
Because for implementation reasons, corpses are made_of(FLESH) even though type->m1 == MNULL.
2013-06-03 18:09:07 +12:00
Ethan "Soron" Kaminski 583e94f8ca Don't drain mental focus if the amount to train is 0 2013-06-03 18:01:15 +12:00
Ethan "Soron" Kaminski a16b870c3c Don't bother targeting pulped corpses 2013-06-03 18:00:36 +12:00
Ethan "Soron" Kaminski 48f09cbda3 Apply a time penalty for smashing corpses 2013-06-03 18:00:10 +12:00
Ethan "Soron" Kaminski ccdbae085d Re-indent game::smash() 2013-06-03 17:59:13 +12:00
Tommy 1fa4cab410 Consistently display rusting skills. 2013-06-03 17:54:57 +12:00
Ethan "Soron" Kaminski 32a5b96f89 Smashing a corpse-containing tile now targets the corpse first 2013-06-03 17:53:14 +12:00
Tommy f5ccf0d0ef Sort the skills list by skill level. 2013-06-03 17:38:16 +12:00
Christian Buskirk c22cc8dd4a Stopped players from leaving slime trails or webs while in a vehicle. 2013-06-02 22:34:54 -07:00
Ethan "Soron" Kaminski 6dcd020977 Clean up a little of the smash code 2013-06-03 16:49:40 +12:00
Ethan "Soron" Kaminski 40cd3dec1a Make corpse damage impair revivification 2013-06-03 16:37:04 +12:00
Ethan "Soron" Kaminski ef5981e752 Add more damage descriptors for corpses 2013-06-03 16:31:14 +12:00
Kevin Granade 67c99cdff5 Merge medical item integration and small fixes. 2013-06-02 22:35:28 -05:00
Ethan "Soron" Kaminski e44c295ad8 Update the Windows project files to point to the new wincurse.cpp 2013-06-03 15:22:04 +12:00
Ethan "Soron" Kaminski edca8f0f33 Tweak how the makefile treats the obj directories 2013-06-03 15:10:50 +12:00
Ethan "Soron" Kaminski 7e5960c637 Merge remote-tracking branch 'origin/pr/3' into sdlcurses 2013-06-03 15:04:17 +12:00
Ethan "Soron" Kaminski 65ef0ffe81 Fix font sizing 2013-06-03 15:03:48 +12:00
Ethan "Soron" Kaminski 92758ac2aa Merge PR #1300 - remove an NPC deletion outside of the desiginated cleanup function 2013-06-03 14:48:33 +12:00
Kevin Granade 651d8779a8 Remove call to remove_npc() from npc::die().
It should only be called from cleanup_dead().
npc::die() merely marks the NPC as dead.
2013-06-02 21:45:44 -05:00
Ethan "Soron" Kaminski 5e80ca8573 Merge PR #1348 - ranged perception mod tweak 2013-06-03 14:43:32 +12:00
Kevin Granade 623a331ef5 Slight nerf to perception skill's effect on ranged accuracy. 2013-06-02 21:29:08 -05:00
Ethan "Soron" Kaminski 23b449951a Merge PR #1337 - weapon sticking rework 2013-06-03 14:24:56 +12:00
Ethan "Soron" Kaminski e638e812e2 Show driving skill again in the '@' screen
Closes #1343.
2013-06-03 14:14:40 +12:00
Ethan "Soron" Kaminski d113871810 Fix misfire message for turrets (turrets now considered "NPC"s, rather than "player"s) 2013-06-03 13:57:09 +12:00
Kevin Granade df4f271a7f Merge Herbert Jones' signoff.
Conflicts:
	SIGNOFF
2013-06-02 20:54:44 -05:00
Kevin Granade 0873d4ab8d A little cleanup of debug and prototype code I missed when merging the lighting rework. 2013-06-02 20:41:09 -05:00
Kevin Granade 28b1bb51ec Remove globally setting light level based on items the player is holding. 2013-06-02 20:38:21 -05:00
Kevin Granade 910215c7a2 Make circular lighting pattern the way lighting works. 2013-06-02 20:37:47 -05:00
Ethan "Soron" Kaminski 045fb50ac6 Add an iuse for disinfectant 2013-06-03 12:59:16 +12:00
Ethan "Soron" Kaminski 02d5cd9023 Only print new HP totals if the body part is damaged 2013-06-03 12:36:18 +12:00
Ethan "Soron" Kaminski 7a03540af7 There's code to print the new HP totals? Well, let's use it! 2013-06-03 12:35:28 +12:00
Ethan "Soron" Kaminski 6d2bc37c82 Clean up medical iuse, extract common bandage/first aid logic 2013-06-03 12:21:11 +12:00
Kevin Granade 662a977f2a Merge lightmap refactor to use trig functions instead of iterative methods. 2013-06-02 19:01:20 -05:00
Ethan "Soron" Kaminski 8e81ad1091 Add new medical items to spawn lists, fix some typos in descriptions 2013-06-03 11:46:41 +12:00
Ethan "Soron" Kaminski fb709da465 Merge PR #1339 - no misfires from muscle-powered firearms 2013-06-03 11:33:13 +12:00
Kevin Granade 8b2e421f59 Exempt archery and throwing-based weapons from misfire chance. 2013-06-02 18:24:36 -05:00
Ethan "Soron" Kaminski c40a5b413c Merge PR #1326 - Nickboom's medical items 2013-06-03 11:20:55 +12:00
Kevin Granade 1d89346337 Batch o fixes and enhancements. 2013-06-02 18:03:34 -05:00
Ethan "Soron" Kaminski abd5432247 Make the misfire message smart about player vs. non-player 2013-06-03 10:54:31 +12:00
Kevin Granade 6d60d22ee1 Rework how stuck chances is caclculated.
It's now based on weapon attack speed, weapon attack type, and player skill.
2013-06-02 17:50:36 -05:00
Kevin Granade fb4cbb0cd2 Remove redundant code penalizing cutting weapons for getting stuck. 2013-06-02 17:49:36 -05:00
Kevin Granade 01e4ab3c1c Serialize monster inventories so they don't evaporate across a save/load.
They still disappear when the monster goes off-map since it's saved as a spawn point, which doesn't contain the monster instance.
2013-06-02 17:49:07 -05:00
Kevin Granade b60b6933c6 Annotate various cuting weapons with their default attack mode. 2013-06-02 17:48:20 -05:00
Kevin Granade 971d5b79c5 Random cleanup of indentation in monster save method. 2013-06-02 16:36:09 -05:00
fnord a55c42808d Option documented 2013-06-02 16:31:54 -05:00
fnord a554eb6b75 advanced inventory: display graffiti label, misc ui shuffling 2013-06-02 16:16:34 -05:00
Quietust 9705ca763e Make zombie hulks a bit more visually distinctive 2013-06-02 13:56:35 -05:00
Philipp Grosenick 4790d40f22 Fixed typo. 2013-06-02 20:22:57 +02:00
fnord 5499eb30af Add 'bundle of 10 plastic bags' + recipe: 6 inches of string and (obviously) 10 bags. 2013-06-02 12:49:48 -05:00
fnord 342bebfd40 look debug menu look derivative: hit g to change a tiles ter_id 2013-06-02 12:40:56 -05:00
RJ Costanzo a643b5a0bf Medical items updated
This is the medical items updated to have some more uses gauzes act like
rags when used, disinfectant is now basically first aid (made a little
rarer).
2013-06-02 13:39:36 -04:00
fnord ab44abd652 advanced inventory secondary sorts by name, so the item list doesn't jump around when moving stuff 2013-06-02 12:36:02 -05:00
fnord ae20a06ce9 Merge branch 'mo_betta_headlights' into opt_circledist-wip 2013-06-02 12:28:45 -05:00
fnord b29e9f6dfc Option added 2013-06-02 11:31:39 -05:00
fnord ea288e8f9a circularize light sources, apply diagonal cost adjustment to npc movement 2013-06-02 08:25:42 -05:00
Philipp Grosenick da975c6b42 Added option to allow/disallow mutation by radiation.
Also some rebalancing and formatting.
2013-06-02 14:37:50 +02:00
Philipp Grosenick f711f996ef Added the remaining specific mutagens.
For now they use very general recipies.
2013-06-02 13:07:42 +02:00
RJ Costanzo ff69111bd2 New medical items
These are a few new medical items. A few Issues, I ment for medical tape
and gauzes to serve as a replacement for duct tape and rags
respectively. Disinfectant currently heals like bandages and doesnt
remove infection. None of these items have spawning thingys for them
yet, if any one could solve these problems I would really be thankful.
2013-06-02 03:02:26 -04:00
Ethan "Soron" Kaminski 155095b32a Fix viewport sizing with SDL-based Linux builds 2013-06-02 17:41:21 +12:00
acidia 989b9f37b6 Added a place holder for HWS basement mission 2013-06-02 00:14:52 -05:00
Ethan "Soron" Kaminski e1512a8825 Filter shift, etc., from getch() in sdlcurse.cpp 2013-06-02 17:05:33 +12:00
acidia 0f44c4ae13 Fixed Basement Level for HWS 2013-06-01 23:52:59 -05:00
acidia 2152f08eae Added Command to Activate Elevator in HWS 2013-06-01 23:51:08 -05:00
acidia 6874ae57b9 Added Command to Activate Elevator in HWS 2013-06-02 00:49:13 -04:00
acidia f8884ef1d2 Added HWS Basement Core 2013-06-01 23:47:43 -05:00
Ethan "Soron" Kaminski e1444d40da Update a few tutorial messages 2013-06-02 16:42:17 +12:00
fnord 45e8e6c391 circular distance pt1: plmove & monmove & rl_dist 2013-06-01 21:48:04 -05:00
acidia 716ec49d32 Added core chamber for Hazardous Waste Sarcophagus basement 2013-06-01 22:41:15 -04:00
acidia f4af0c831f Added hazardous waste sarcophagus basement 2013-06-01 21:38:13 -05:00
acidia 720317931e Added Patriot Mission 4, "Follow Sarcophagus Team" 2013-06-01 21:30:34 -05:00
acidia 323872c503 Added Patriot Mission 4, "Follow Sarcophagus Team" 2013-06-01 22:27:55 -04:00
acidia bdc66f1f7a Added open_sarcophagus for Patriot Mission 4, "Follow Sarcophagus Team" 2013-06-01 22:25:46 -04:00
acidia 0819b2cc67 Added dialogue for Patriot Mission 4, "Follow Sarcophagus Team" 2013-06-01 21:23:04 -05:00
acidia ddf15c3e67 Added sarcophagus_access_code for Patriot 4, "Follow Sarcophagus Team" 2013-06-01 21:19:31 -05:00
Kevin Granade cbed9f4de0 Today's batch of bugfixes and improvements. 2013-06-01 19:33:30 -05:00
Philipp Grosenick e650629cb6 Mutagens that cause mutation only in specific categories.
There are still a lot missing.
2013-06-02 01:25:32 +02:00
RJ Costanzo fd6f5e24ea Arm and Leg Splints
More or less a place holder for when Medical Treatment is expanded.
2013-06-01 17:09:57 -04:00
fnord 0858c1c06a apply_light_ray: trig_brightcalc argument (optional, default false)
apply_light_arc: use light rays with the above option = true
2013-06-01 14:04:01 -05:00
Philipp Grosenick 84b716bb81 Fixed Issue #999, wearing anything over Arm or Leg tentacles. 2013-06-01 20:51:16 +02:00
Octav Sandulescu b4c2a2240c First aid actually is not an antibiotic. 2013-06-01 19:09:26 +01:00
fnord 0d0c1f0303 Remove old code, set defaults to original "best looking" 2013-06-01 12:56:00 -05:00
fnord 382f779114 Merge remote branch 'origin/master' into mo_betta_headlights 2013-06-01 12:55:08 -05:00
Philipp Grosenick 336fd7ff39 Added more severe consequences of radioactivity.
A very high amount of radioactivity can actually kill you.
2013-06-01 19:13:25 +02:00
Philipp Grosenick cdc6107715 Made mutation categories actually matter.
The primary mutation category now has significant influence. Traits from
other categories have a high chance of being removed. It is now very
difficult to end up with every single trait in the entire game.
2013-06-01 17:57:10 +02:00
Octav Sandulescu e4b1dba228 Make the awesome version string work on Windows (when cross-compiling) 2013-06-01 14:03:18 +01:00
origamiwolf dbc97fb205 Materials refactoring 2013-06-01 20:44:17 +08:00
fnord 5eaebe59d2 Fixed erronious "destination area full" 2013-06-01 07:17:21 -05:00
Octav Sandulescu 8abd247968 These were needed for cross-compile.
It's possible they'd also be needed for a native compile, but someone else will have to test that.
2013-06-01 12:59:38 +01:00
Fergus Dall b8b9b1d8e2 Set known_down on ot_slimepit_down, and unset it on ot_slimepit 2013-06-01 20:26:04 +09:30
Fergus Dall 0df23b1b25 Stop ot_slimepit_down from appearing on the lowest z-level 2013-06-01 20:24:07 +09:30
Fergus Dall 089cb1582f Make surface slime pits ot_slimepit_down, as was presumably intended originally 2013-06-01 20:23:06 +09:30
Ethan "Soron" Kaminski 1259f07dbb Let the player see recent messages on death
Closes #1303.
2013-06-01 17:35:04 +12:00
acidia cb2a8e250d Added reference for kill_count 2013-06-01 00:26:50 -05:00
acidia 3f928b8be6 Added functions needed to reference kill counts for missions 2013-06-01 00:24:37 -05:00
acidia 690a76bcde Added Deputy Badge Spawn 2013-06-01 00:16:07 -05:00
acidia 691954f517 Added Vigilante Mission 3, "Find Deputy Badge" 2013-06-01 00:03:56 -05:00
acidia 0a9a69eb92 Added Vigilante Mission 3, "Find Deputy Badge" 2013-06-01 00:59:56 -04:00
Ethan "Soron" Kaminski d1cfc04f51 Fix components for fur blanket and fur sleeping bag
Closes #1271.
2013-06-01 16:59:42 +12:00
acidia 553acf35ca Added deposit_box for Vigilante Mission 2, "Retrieve Deposit Box" 2013-05-31 23:57:08 -05:00
acidia 41ba156fe4 Added Vigilante Mission 3, "Find Deputy Badge" 2013-05-31 23:55:58 -05:00
acidia 8283f207dc Added badge_deputy 2013-06-01 00:10:47 -04:00
acidia b7bacb74f7 Added place_deposit_box for Vigilante Mission 2, "Retrieve Deposit Box" 2013-05-31 22:58:09 -05:00
acidia 9628eb5902 Fixing Typos 2013-05-31 22:53:19 -05:00
acidia 7f758eb8c7 Added Vigilante Mission 2, "Retrieve Deposit Box" 2013-05-31 23:17:40 -04:00
acidia 9ab367b32d Added dialogue for Vigilante Mission 2, "Retrieve Safe Box" 2013-05-31 22:12:23 -05:00
acidia cb498936a1 Adding Safe Deposit Box for Vigilante Mission 2, "Retrieve Deposit Box" 2013-05-31 21:55:45 -05:00
acidia b26f0c3b53 Added place_priest_diary for Martyr Mission 2, "Recover Priest's Diary" 2013-05-31 22:24:21 -04:00
acidia 8bedbd1406 Fixed Small Typo 2013-05-31 22:15:56 -04:00
acidia a5ef4ff627 Fixed Small Typo 2013-05-31 21:14:58 -05:00
acidia 397deb2b2a Added Priest's Diary for Martyr Mission 2, "Recover Priest's Diary" 2013-05-31 20:48:48 -05:00
acidia ff35d368b3 Added Martyr Mission 2, "Recover Priest's Diary" 2013-05-31 20:44:00 -05:00
acidia e0a4cfd0a5 Added Martyr Mission 2, "Recover Priest's Diary" Dialogue 2013-05-31 20:41:03 -05:00
acidia c1c44af54d Added Martyr Mission 2, "Recover Priest's Diary" 2013-05-31 20:39:06 -05:00
Ethan "Soron" Kaminski f4166a796c Fix Windows cross-compilation from Linux 2013-06-01 13:35:00 +12:00
acidia c178b7f81e Added Kill Horde Master Mission Dialogue 2013-05-31 21:27:29 -04:00
acidia 6496b6b417 Added Kill Horde Master Mission 2013-05-31 20:23:58 -05:00
acidia 5d3067c98f Added Kill Horde Master Mission Start 2013-05-31 21:22:09 -04:00
acidia 50fe2024ec Added Kill Horde Master Mission 2013-05-31 20:19:05 -05:00
Ethan "Soron" Kaminski c84b0fcba7 Make the SDL version compatible with Linux, etc. 2013-06-01 12:23:28 +12:00
acidia 2c096cff92 Added the values needed to make "kill x of monster y" missions 2013-05-31 19:55:24 -04:00
acidia 540419ac5f adding demon slayer mission 2 def 2013-05-31 19:48:30 -04:00
acidia 42f7f3863e Added Zombie Sweep Mission Start Command 2013-05-31 18:45:07 -05:00
acidia 922c242c00 Added demon slayer mission 2 dialogue and numerous fixes 2013-05-31 18:43:07 -05:00
Ethan "Soron" Kaminski 6846b798ba SDL-based ASCII/pseudo-curses version by utunnels (forum user) 2013-06-01 11:27:12 +12:00
Ethan "Soron" Kaminski 36e02742b1 Copy catacurse.cpp to sdlcurse.cpp for history purposes 2013-06-01 11:24:17 +12:00
Kevin Granade e47e711cfa Merge string handling bugfixes. 2013-05-31 17:10:31 -05:00
Kevin Granade b57def4763 Merge notification that contents of containers aren't visible. 2013-05-31 17:05:55 -05:00
Kevin Granade e7d2913f33 Merge pull request #1302 from ethankaminski/delwin-adding-1
Stop some newwin memory leaks by adding delwin calls
2013-05-31 14:54:39 -07:00
Quietust f20118fed9 Fix recipe parsing - in MSVC, catajson.as_string().c_str() becomes invalid too soon 2013-05-31 10:37:38 -05:00
fnord 4bbf660067 Remove deprecated debugging vars, luminance multiplier 4=>3 2013-05-31 06:12:32 -05:00
atomicdryad ce5a1b4521 Merge pull request #3 from kevingranade/light_artifacts
Remove possibly premature optimization that is causing artifacts in light raytracing.
2013-05-31 04:08:01 -07:00
Fergus Dall afede12c04 Show a message when looking at container tiles 2013-05-31 19:13:04 +09:30
Ethan "Soron" Kaminski b03dff09b4 Stop some newwin memory leaks by adding delwin calls 2013-05-31 19:27:27 +12:00
Ethan "Soron" Kaminski 49217b652e Fix a chatbin save bug that got introduced 2013-05-31 19:01:34 +12:00
Ethan "Soron" Kaminski b0afac60ad Fix saving of null strings in player_activity 2013-05-31 18:41:24 +12:00
Ethan "Soron" Kaminski bee9f9c7c2 Add a debugmsg about null itypes in a constructor 2013-05-31 18:24:40 +12:00
Ethan "Soron" Kaminski 171f312097 Remove the old method of handling skills 2013-05-31 18:16:46 +12:00
Kevin Granade 9944213436 Remove turn cost for adjusting cruise control speed. 2013-05-30 22:01:12 -05:00
Kevin Granade 919b0c316c Remove possibly premature optimization that is causing artifacts in light raytracing. 2013-05-30 21:35:45 -05:00
Kevin Granade 1d1c1311a7 Merge mission and mapgen enhancements. 2013-05-30 20:02:44 -05:00
Kevin Granade fd30c6b272 Merge conforming monster density to nearby building type. 2013-05-30 19:59:46 -05:00
acidia 5ddceb2116 Fix PT. 2 2013-05-30 19:27:11 -05:00
acidia 27c494d808 MGOAL_GO_TO_TYPE Fix PT. 1 2013-05-30 19:23:21 -05:00
Kevin Granade 7d771106a1 Merge hands in pockets warmth boost. 2013-05-30 19:16:43 -05:00
Shoes01 3a2a94f637 Moved power_armor into in_climate_control for warmth control, also formatted stuff 2013-05-30 19:02:58 -07:00
Shoes01 2589f6b642 Merge branch 'master' of github.com:Shoes01/Cataclysm-DDA into pockets 2013-05-30 18:20:08 -07:00
Fergus Dall 6489762fa6 Move monster spawn radius to a #define 2013-05-31 08:52:18 +09:30
Kevin Granade 569c17eb59 Merge a ridiculously huge pile of bugfixes. 2013-05-30 18:12:07 -05:00
fnord b47167bffa Remove redundant redundancy. 2013-05-30 16:16:24 -05:00
fnord 117eb69d00 Advanced inv remembers areas and scroll position (until player moves).
Move trivial UI specific data to uistate struct.
2013-05-30 16:08:58 -05:00
fnord ca83dfed82 Segv fix 2013-05-30 15:56:53 -05:00
Quietust 90e6bdb34e Fix advanced_inv in MSVC - store item pointers instead of copying them 2013-05-30 13:18:19 -05:00
Quietust 9895370291 Add snprintf wrapper to game.cpp as well; also properly handle error condition 2013-05-30 11:27:26 -05:00
Julian Snitow b28ea74582 Fix advanced inventory 'East' square.
An error in commit 2eb0ad444e transposed
the x,y coordinates on the 'East' square in the advanced inventory
interface, making it a second 'South' square instead.
2013-05-30 07:11:18 -07:00
Fergus Dall e3f9ce548d Make burnt zombie corpses take longer, and be less likely, to revive
See #1144
2013-05-30 21:57:54 +09:30
Fergus Dall 93c6927326 Stop warning the player about monsters that are no longer in LOS
Fixes #664
2013-05-30 21:32:31 +09:30
Fergus Dall 41f0d9e2d7 Fixed unused variable warning 2013-05-30 21:05:25 +09:30
Fergus Dall f179a72a10 Make monster density depend on nearby buildings 2013-05-30 21:04:28 +09:30
Fergus Dall 6442e69bb5 Add options to controll autosave frequency
Closes #677
2013-05-30 20:14:03 +09:30
fnord b0769ed94b Car headlights cumulative. apply_light_arc: Optional 4th beam-width argument, cleanup, more experiments 2013-05-30 05:32:50 -05:00
Fergus Dall 0e7d333f88 Make cooked food's rotteness an average of the rotteness of the components
Fixes #1229
2013-05-30 19:29:14 +09:30
Ethan "Soron" Kaminski a7499b4002 Moving vehicle code also applies for reversing vehicles 2013-05-30 19:24:18 +12:00
Ethan "Soron" Kaminski 1cd0f1f61d Update changelog with everything since 602e64dafe 2013-05-30 19:01:23 +12:00
D Lue Choy 3de8d970af Examine vehicle controls without boarding.
Allows 'vehicles' to be used as lighting and turret platforms without a
seat.
Also in the future could be used with cruise control to add
car-missiles?

Signed-off-by: D Lue Choy <dluechoy@>
2013-05-30 02:21:49 -04:00
Ethan "Soron" Kaminski 783f0ef4a2 Merge PR #1216 - fix body temp equalization 2013-05-30 17:43:14 +12:00
Shoes01 4e65569bb0 Added description to items with POCKETS flag 2013-05-29 22:25:32 -07:00
Shoes01 be94cf3714 Warmth values in @ menu looks at warmth function, not encumb function 2013-05-29 22:25:32 -07:00
Shoes01 87c33c7616 Pockets can now be used, and power armor warmth calculated in warmth function 2013-05-29 22:25:32 -07:00
Shoes01 a449ab6310 Added POCKETS flags to certain items 2013-05-29 22:25:32 -07:00
Kevin Granade a98b011ed6 Merge pull request #1278 from dluechoy/keep_light_on
Vehicle head lights stay on after save and exit.
2013-05-29 21:28:31 -07:00
Tommy 492054b243 Display the correct inventory letter when picking up stacking items. 2013-05-30 16:20:43 +12:00
Kevin Granade c8b7515f38 Merge listing of all nearby items in advanced inventory. 2013-05-29 21:59:32 -05:00
Kevin Granade 78df118350 Merge pull request #1273 from i2amroy/Read-Time-INT-Effect
Read time INT penalty fix
2013-05-29 19:23:52 -07:00
D Lue Choy 0b035b344c Vehicle head lights stay on after save and exit.
They will also stay off.
This adds one integer to the "V ..."  entries of maps.txt

Signed-off-by: D Lue Choy <dluechoy@>
2013-05-29 22:15:05 -04:00
Kevin Granade afcec85b1c Mapgen enhancements and bugfixes. 2013-05-29 20:58:27 -05:00
Herbert Jones 040ff92099 Signing off on my patches to the code.
This covers all my patches to the Cataclysm/Cataclysm-DDA codebase.

Signed-off-by: Herbert Jones <jones.herbert@gmail.com>
2013-05-29 20:56:17 -05:00
Kevin Granade 29dcc1960c Merge fix to player exploration carrying over to later characters. 2013-05-29 19:58:43 -05:00
origamiwolf 45498558f9 Add zombie spawns to mansions 2013-05-30 07:47:29 +08:00
fnord d7b08463ea fix build breaking typo 2013-05-29 18:43:56 -05:00
fnord 6557b4e7f5 apply_light_arc: now using fancy math(tm) && adjustable beam width. Also, visual artifacts (this is a feature>.>) 2013-05-29 18:29:12 -05:00
fnord 2eb0ad444e advanced inventory: 'a' will now list everything in the surrounding
3x3 squares. defaults have changed from inventory, down, to down,
inventory (this fits my usage patterns better at least, can revert
if they're atypical). Color changes: The colors are subjectively
better.
2013-05-29 18:22:00 -05:00
origamiwolf 7b7b50dad7 Added more furnishings and items to mansion rooms 2013-05-30 00:34:06 +08:00
Fergus Dall a5620124d6 Stop generating extra lab levels after the finale 2013-05-29 20:58:48 +09:30
Fergus Dall 7642811bbf Generate extra downstairs in labs as needed to ensure connectivity 2013-05-29 20:58:09 +09:30
Christian Buskirk 9457aacdf0 Buffed INT penalty 2013-05-29 00:22:19 -07:00
acidia 445b576a58 Added t_gates_control_concrete 2013-05-28 21:26:44 -04:00
acidia 1ab05985ed Added t_gates_control_concrete 2013-05-28 21:24:46 -04:00
acidia c170f7bc6a Added Concrete Gate Control to fix bug in utility room for labs 2013-05-28 20:22:58 -05:00
Ilya Grigorev 9b15e7fcf8 fix crash 2013-05-28 17:49:04 +04:00
alex-gh 1f4459aafd Badly damaged clothing yields less raw materials when cut. Reinforced clothing yields more. 2013-05-28 09:57:44 +02:00
Ethan "Soron" Kaminski 8ab3b1a1cf Merge PR #1264 - show stat effects in @ screen 2013-05-28 18:47:39 +12:00
Ethan "Soron" Kaminski 085dcfd617 Merge PR #1263 - further refine rag requirements for sewing 2013-05-28 18:46:55 +12:00
Ethan "Soron" Kaminski 8e722ea716 Merge PR #1247 - spiral rooms now coded sanely 2013-05-28 18:46:36 +12:00
Ethan "Soron" Kaminski f15a4de104 Merge PR #1209 - avoid leaking seen overmap info 2013-05-28 18:46:16 +12:00
Fergus Dall 10e3ae9f33 Delete map exploration data on player death 2013-05-28 16:13:09 +09:30
veryinky 331bc16d61 Retry of player stat info on character screen 2013-05-27 23:25:11 -04:00
Reaper42 77c87667db Quickfix:sewing not require materials,if they are not nedded 2013-05-28 10:11:45 +07:00
acidia 56c820fb49 Removed testing values from new missions 2013-05-27 21:34:44 -05:00
acidia 66999b48f5 Rewrite Farms to allow for easier manipulate to turn into base 2013-05-27 19:46:36 -05:00
acidia c892792209 Added support for MGOAL_GO_TO_TYPE 2013-05-27 19:40:05 -05:00
acidia 2d70b5c477 Added support for DESTINATION, MGOAL_GO_TO_TYPE 2013-05-27 19:38:29 -05:00
acidia f7af08ba42 Added support for DESTINATION and filling in humanitarian 2 and 3 2013-05-27 19:35:35 -05:00
acidia 6da3697f9f Added humanitarian missions 2 and 3 and DESTINATION() 2013-05-27 19:29:42 -05:00
acidia 0e93b1b696 Added dialogue for humanitarian missions 2 and 3 2013-05-27 20:26:53 -04:00
acidia dd444125ab Added JOIN for NPC's joining your party for the mission 2013-05-27 19:24:55 -05:00
acidia 5d5a1d0960 Added NPC leaving at the end of mission 2013-05-27 19:22:43 -05:00
Kevin Granade c8ce78afd0 Merge pull request #1258 from quietust/msvcfix
Fix MSVC compile
2013-05-27 15:49:06 -07:00
Kevin Granade ef83b84f8b A plethora of small bugfixes. 2013-05-27 17:17:17 -05:00
Kevin Granade a395843c68 Merge pickup menu enhancements. 2013-05-27 17:07:41 -05:00
Quietust 7615f98ff7 Fix MSVC compile, and re-enable optimization on itypedef.cpp 2013-05-27 16:50:14 -05:00
Kevin Granade a6494f5ad5 Merge cleanup of unload code. 2013-05-27 16:44:06 -05:00
Kevin Granade 379c161446 Store the current terrain and trap value in a local for temperature and fatigue calculations. 2013-05-27 16:39:57 -05:00
Kevin Granade 0c734d6832 Fix ter_at/ter mixup. 2013-05-27 15:54:01 -05:00
Kevin Granade 06e7288463 Merge more temperature system adjustments.
Conflicts:
	player.cpp
2013-05-27 15:53:18 -05:00
Kevin Granade a1833b71bb Remove an unused variable. 2013-05-27 15:20:31 -05:00
Kevin Granade 47fb78f48f Allow reading books with no associated skill as a noop. 2013-05-27 15:20:09 -05:00
Kevin Granade 3062f7b1c5 Merge mission enhancements and new lab locations. 2013-05-27 13:29:56 -05:00
Kevin Granade 685d36e801 Merge remote-tracking branch 'dda/master' into clear-overmap-buffer 2013-05-27 11:08:45 -05:00
Reaper42 928fc755cc Rags are not used as thread 2013-05-27 21:50:37 +07:00
veryinky 3942bb6bde Added electric cars to town spawns 2013-05-27 06:50:15 -04:00
veryinky 740ccdeae5 Flatbed trucks now have rear windows 2013-05-27 06:27:00 -04:00
fnord 43ab59355c pickup: make use of top border of item info window, to display item name 2013-05-27 04:15:12 -05:00
fnord 01975326ff inventory item submenu: can scroll to "=", selection highliter visible by default 2013-05-27 04:00:14 -05:00
fnord d19eb1b420 pickup: corrected mistaken removal of weight/volume subtraction on deselect 2013-05-27 03:49:05 -05:00
veryinky 6d6df3b0e0 Update catacurse so title bar displays .6git instead of .5 2013-05-27 04:33:37 -03:00
veryinky 5ed3f2cdc3 fix for int display in chargen 2013-05-27 03:20:43 -04:00
veryinky fd856d47cd thingy 2013-05-27 02:33:01 -04:00
veryinky 432aa7a7f9 .6 now 2013-05-27 03:15:21 -03:00
fnord 60d84eb9c7 pickup: item info automatically displays highlighted item 2013-05-27 01:06:25 -05:00
fnord 22a998a486 pickup: pagination corrections 2013-05-27 01:06:25 -05:00
fnord 8d25113870 pickup: selection highlights first item by default, follows letter input 2013-05-27 01:06:25 -05:00
veryinky 8eed366797 The 0.4-Git was annoying me 2013-05-27 01:47:45 -04:00
acidia 829b4c4755 Cleaning //tribute 2013-05-26 23:07:05 -05:00
acidia 52db89f7c8 Deleted some code artifacts in //tribute 2013-05-26 23:04:22 -05:00
Kevin Granade 49e7c28584 Merge a batch of simple bugfixes and refactors.
Conflicts:
	item.h
	player.cpp
	player.h
2013-05-26 22:50:13 -05:00
Kevin Granade 6377d81abc Really fix spiral room generation. 2013-05-26 20:14:45 -05:00
Kevin Granade 3c1b528685 Indention fix in spiral room generation. 2013-05-26 20:14:14 -05:00
Ethan "Soron" Kaminski 8f290fcc86 Unify and make sane the gun/tool unloading code
Closes #1242. Also makes it so that liquids don't get dumped on the ground if you're over-volume (since they can just go in another container).
2013-05-27 12:12:03 +12:00
Shoes01 e0e1f3e654 Removed some VARSIZE tags that weren't supposed to be 2013-05-26 21:05:42 -03:00
Shoes01 b663eef6f0 Update changelog 2013-05-26 21:02:59 -03:00
Shoes01 0ff829de6a Merge branch 'warmth' into features-and-tweaks 2013-05-26 20:59:22 -03:00
Shoes01 c7e5684425 Merge branch 'sleep-fixes' into features-and-tweaks 2013-05-26 20:59:17 -03:00
Shoes01 3df4b1af97 Tweaked warmth values of footwear 2013-05-26 20:55:31 -03:00
Shoes01 35ae82ec91 player::warmth now handles warmth reduction due to rain; wool is not affected 2013-05-26 20:47:45 -03:00
Ethan "Soron" Kaminski 34f6fb4e8d Set curammo properly in item constructor
Closes #1228. ACTUALLY closes #1142.
2013-05-27 11:18:44 +12:00
Ethan "Soron" Kaminski 7e53e362b3 Use standard item spawning method in game::wish
Closes #1142. Also makes it so that jacqueshammer spawns with no gasoline, but that's due to the item definition file.
2013-05-27 11:08:30 +12:00
Ethan "Soron" Kaminski 6319f032ec Monster-triggered crossbow traps only drop 1 bolt
Closes #1241.
2013-05-27 10:25:55 +12:00
Ethan "Soron" Kaminski 26c3919ded Recipe name collision message gives better info 2013-05-27 10:11:43 +12:00
Ethan "Soron" Kaminski e9fe6943b3 Made a couple crafting-related methods take player*, for NPC future-proofing 2013-05-27 10:10:57 +12:00
Octav Sandulescu b5c37c493e Add acid-from-batteries recipe. 2013-05-26 23:08:13 +01:00
Kevin Granade 9a83ba77d2 Today's batch of bugfixes. 2013-05-26 16:58:12 -05:00
Ethan "Soron" Kaminski e397c29983 Merge PRs #1239 and #1230 - trivial fixes 2013-05-27 09:35:08 +12:00
Ethan "Soron" Kaminski a49daf240c Rename mapgen_helper to building_generation 2013-05-27 09:31:39 +12:00
acidia e0ee49cfef Added FOLLOWUP for stringing mission together and strung 'patriot' together 2013-05-26 14:51:58 -05:00
Shoes01 0ead765da9 While sleeping, the player is informed if he is too cold or warm 2013-05-26 14:46:34 -03:00
Shoes01 0ec54e1dcf Sleeping is only interrupted by very hot or cold temperatures 2013-05-26 14:23:10 -03:00
Shoes01 efe30fdc31 Sofa and armchair get comfort messages too 2013-05-26 14:19:58 -03:00
Shoes01 faf89f3c8e Sleeping on an armchair or sofa is now benificial 2013-05-26 14:18:38 -03:00
jason.gilbert@nbed.nb.ca 195a68e9e1 Cold and heat are now less likely to interrupt sleeping 2013-05-26 14:12:39 -03:00
acidia b804dde202 Left a Testing Value in mattack::parrot 2013-05-26 12:07:46 -05:00
acidia d95c55f8c4 Added 'parrot' attack that will allow Mi Go to 'call out' 2013-05-26 11:57:30 -05:00
acidia 195446684f Added 'parrot' attack that will allow Mi Go to 'call out' 2013-05-26 11:56:53 -05:00
acidia 447fa2e768 Added 'parrot' attack that will allow Mi Go to 'call out' 2013-05-26 11:55:42 -05:00
Jan Christian Kaessens 1035cc8ba6 Fix for #1237, uninitialized moveCount 2013-05-26 18:54:02 +02:00
acidia 7929120aa8 Swap Broken Gas Pump for Broken Generator in Lab Utility 2013-05-26 11:49:03 -04:00
acidia 0696961ea7 Added Broken Generator 2013-05-26 11:46:22 -04:00
acidia e558e38487 Adding the Two Black Box Missions 2013-05-26 10:11:10 -05:00
acidia df013ad57b Adding the Two Black Box Missions 2013-05-26 11:09:26 -04:00
acidia 06f5c8ddd7 Added Starting Script for Black Box Transcript Mission 2013-05-26 11:07:03 -04:00
acidia c5e5541282 Added the Two Black Box Missions 2013-05-26 10:04:56 -05:00
jason.gilbert@nbed.nb.ca ab984471bd Oversized clothing can be worn regardless of encumberance or anything 2013-05-26 11:37:44 -03:00
jason.gilbert@nbed.nb.ca ca48e195b2 Added comment to list item flags (current and future planned ones) 2013-05-26 11:25:23 -03:00
jason.gilbert@nbed.nb.ca 2ee0736a5a Added OVERSIZE flags to items 2013-05-26 11:24:49 -03:00
jason.gilbert@nbed.nb.ca 9d766a375f Merge branches 'fixes' and 'new' into fixes 2013-05-26 10:59:22 -03:00
Octav Sandulescu 89e2fabaf4 Remove batteries from acid bomb recipe. 2013-05-26 14:32:39 +01:00
jason.gilbert@nbed.nb.ca c91b3ebaa2 Being hot now makes your MORE thirsty, not less 2013-05-26 09:33:01 -03:00
Octav Sandulescu 77bb0fe85f Typo fix 2013-05-26 13:02:44 +01:00
Octav Sandulescu 678b3f5f5c Get acid water from funnels during acid rain. 2013-05-26 13:00:38 +01:00
Fergus Dall 17a6d312a7 Fixed defective spiral cavern spirals 2013-05-26 17:58:08 +09:30
acidia cc5bccdf33 Add Black Box Spawn for Helicopter Crashes 2013-05-26 02:01:09 -05:00
Ethan "Soron" Kaminski a62858a5a5 Merge PR #1214 - 'V' looks in nearby containers, lab coats fittable 2013-05-26 18:34:09 +12:00
Ethan "Soron" Kaminski ab6425d526 Remove a couple dangling braces. 2013-05-26 18:08:10 +12:00
Ethan "Soron" Kaminski 7bad2dfd0a Fix another case of rng() in for loop conditionals 2013-05-26 17:57:49 +12:00
Ethan "Soron" Kaminski ac4c9c60d3 Remove some needless iteration in mapgen item spawning 2013-05-26 17:55:28 +12:00
Ethan "Soron" Kaminski bc07a5179f Fix a bug in mapgen spawn with rng() used in for loop conditional 2013-05-26 17:51:17 +12:00
Ethan "Soron" Kaminski 61e4d140e3 Merge PR #1212 - armor display bug 2013-05-26 17:45:42 +12:00
Fergus Dall 07317608bc Stop clearing artifact_itype_ids after save
Fixes #1213
2013-05-26 14:57:57 +09:30
Ethan "Soron" Kaminski b32ff5badc Make sewing pluralization saner 2013-05-26 17:09:27 +12:00
Ethan "Soron" Kaminski 4653350687 Sewing uses rags/leather from far away 2013-05-26 17:06:59 +12:00
acidia 8a2cc5493c Added Computer Commands for New Lab Rooms 2013-05-25 23:54:40 -05:00
acidia a97b899e74 6 New Lab Rooms and Added Concrete Walls to Rotate 2013-05-26 00:51:14 -04:00
Kevin Granade fb3ba56953 Base body temperature equalization on body temperature instead of convergant temperature. 2013-05-25 23:42:38 -05:00
acidia 0ee8e83212 Added Computer Functions for Data Lab 2013-05-26 00:39:43 -04:00
origamiwolf 16ab75d7fa Condensed protection values into one line 2013-05-26 12:37:50 +08:00
acidia 3a4c5e8047 Added Black Box 2013-05-25 23:35:06 -05:00
acidia 26611e970f Added Black Box Transcript 2013-05-25 23:33:24 -05:00
origamiwolf 9d984bbd5f Revert window size expansion 2013-05-26 12:30:20 +08:00
Ethan "Soron" Kaminski 141d788990 Factor out a bit of common logic in iuse::sew 2013-05-26 16:06:05 +12:00
Ethan "Soron" Kaminski ef00549452 Save-breaking typo fix: "stablizer" -> "stabilizer" 2013-05-26 15:47:13 +12:00
Christian Buskirk 5f3ccbcf1c Stopped players from being able to (e)xamine sealed crates to see their contents 2013-05-25 20:42:22 -07:00
Christian Buskirk 552a6d3cd4 Removed extraneous spaces 2013-05-25 20:04:34 -07:00
Christian Buskirk efa46c5d62 Allows the V menu to see items in adjacent containers unless container is sealed
Addresses issue #272
2013-05-25 19:45:09 -07:00
origamiwolf 92739fdbeb Expand item examine window 2013-05-26 10:42:05 +08:00
Ethan "Soron" Kaminski 84a0becfe4 Add corpse revivification to active item handling in inventory 2013-05-26 13:59:10 +12:00
Christian Buskirk 31c5694c10 Allow lab coats to be fitted
Fixes problem #1160
2013-05-25 18:43:32 -07:00
Ethan "Soron" Kaminski 1c0e09c334 Extract common weapon/inventory active item code from player 2013-05-26 13:30:14 +12:00
Kevin Granade 5aa4104683 Clear overmap_buffer when exiting a game session to avoid leaking seen state to another character. 2013-05-25 19:59:07 -05:00
origamiwolf d626730dd2 Fixed incorrect armour documentation 2013-05-26 08:48:44 +08:00
Ethan "Soron" Kaminski f3b0bcb7c9 Merge PR #1204 - fix NPC segfault (in choose_escape_item()) 2013-05-26 12:46:01 +12:00
Kevin Granade 6db72c165c Also check for no item found in use_escape_item(). 2013-05-25 19:40:53 -05:00
Kevin Granade d67fc55322 Merge headlights for default vehicles.
Conflicts:
	veh_typedef.cpp
2013-05-25 19:05:20 -05:00
Kevin Granade 78942cc30f Merge a batch of minor fixes. 2013-05-25 19:04:01 -05:00
Kevin Granade 0f682ec45e Merge improved vehicle collision code. 2013-05-25 18:55:18 -05:00
D Lue Choy d4f500787b Road vehicles now have a non-zero number of headlights.
Scooter, Military Truck and Semi Truck templates now have a similar number of head lights as the vehicles they are inspired by.
The lights have not been repositioned optimally for the game.

Signed-off-by: D Lue Choy <dluechoy@>
2013-05-25 19:54:01 -04:00
Ethan "Soron" Kaminski 986b7a07f0 Merge PR #1147 - bicycle seats 2013-05-26 11:25:13 +12:00
Ethan "Soron" Kaminski 835652c5d2 Merge PR #1206 - percent signs in gunmod descriptions 2013-05-26 11:24:04 +12:00
Ethan "Soron" Kaminski 6f63dd7522 Merge PR #1163 - improved armor damage descriptions 2013-05-26 11:16:36 +12:00
Fergus Dall ab15f1a879 Make % sign appear properly for the magazine line in gunmod descriptions
Fixed #1179
2013-05-26 08:42:09 +09:30
Ethan "Soron" Kaminski 4f8010d0a0 Merge PR #1202 - fix firing into smoke 2013-05-26 11:01:22 +12:00
Ethan "Soron" Kaminski 0988944949 Merge PR #1165 - moving furniture causes noise 2013-05-26 10:56:36 +12:00
Ethan "Soron" Kaminski c52f6b9048 Merge PR #1164 - fix teleporting arrows, etc.
Conflicts:
	ranged.cpp
2013-05-26 10:56:11 +12:00
Williham Totland 1e07470c98 Resolves an issue where bearings would not spawn. 2013-05-26 00:53:36 +02:00
Williham Totland 61113a8dd9 Resolves an issue where saving would oblitterate skill practice 2013-05-26 00:46:41 +02:00
Williham Totland 5acbb5b3db Disassembling ammo gives firearms training. 2013-05-26 00:44:20 +02:00
Kevin Granade ebecd3b40e Prevent use of an invalid index in NPC AI code.
Thanks jkaessens for providing the backtrace that enabled solving it.
2013-05-25 17:42:27 -05:00
Williham Totland 01cc3f6bf7 Foraging gives survival exprience 2013-05-26 00:40:21 +02:00
Williham Totland fcee31c237 Imroves birthday math 2013-05-26 00:39:17 +02:00
Kevin Granade 21855e2176 Remove redundant check of map::sees() that was confusing us when targeting monsters standing in smoke. 2013-05-25 16:12:16 -05:00
Kevin Granade 68cadcb52c Clean up some comments in game::target(). 2013-05-25 16:11:25 -05:00
Kevin Granade a28693139d More small fixes. 2013-05-25 15:01:31 -05:00
fnord 2e3af258b4 switched back to debugmsg (disabled) 2013-05-25 14:13:41 -05:00
fnord 528edd10b2 Revert "Enabling collision logging": silly assumption about dbg()
This reverts commit 01bfde4bc7.
2013-05-25 14:09:59 -05:00
Kevin Granade 8bf2035d3c Merge remote-tracking branch 'dda/pr/1167' into dda-master 2013-05-25 14:09:26 -05:00
fnord 25c9986d4d Moving items to the ground via advanced inventory and drop will add charges if applicable (ammo etc) 2013-05-25 13:57:03 -05:00
fnord 0c759878bd fixed left/right miscounting in pickup 2013-05-25 13:08:07 -05:00
origamiwolf 903feb9bc1 Added notes on how armour protection works 2013-05-25 23:12:59 +08:00
jason.gilbert@nbed.nb.ca 23f088e938 Merge branch 'fire-head-fix' of github.com:Shoes01/Cataclysm-DDA into test
Conflicts:
	disease.cpp
2013-05-25 11:58:23 -03:00
Kevin Granade c9ef1d465b Simple bugfix megamerge. 2013-05-25 09:55:14 -05:00
origamiwolf 9d61f574e8 Fix segfault when trying to read a wielded book 2013-05-25 22:48:41 +08:00
fnord 01bfde4bc7 Enabling collision logging 2013-05-25 09:21:26 -05:00
Octav Sandulescu f673fe21d2 Fix the Code::Blocks project by including material.{h,cpp}. 2013-05-25 14:58:16 +01:00
Ethan "Soron" Kaminski 7f5d6f8383 Fix an occasional segfault due to improper vector bounds in rng()
Thanks to forum user utunnels for spotting this (see http://www.cataclysmdda.com/smf/index.php?topic=1478).
2013-05-26 00:16:36 +12:00
fnord a9606106cd Vehicle collisions no longer become insane ping-pong fests that generate
velocity out of nowhere: vector changes now derived from equations at
http://en.wikipedia.org/wiki/Elastic_collision
2013-05-25 04:15:35 -05:00
fnord 029ce0d948 Added missing break; that caused disassemble to prompt for reassign 2013-05-25 03:24:14 -05:00
Kevin Granade 97e822da48 Merge Cathedral and a batch of new missions. 2013-05-24 22:20:49 -05:00
Fergus Dall 25b58a0873 Make autosave save mapdata and artifacts properly
Fixes #1175
2013-05-25 12:42:50 +09:30
Fergus Dall d9dcdb8915 Make artifact loading work for artifacts on the ground 2013-05-25 12:27:36 +09:30
Williham Totland c02fd28af1 40mm acid bomb crafting 2013-05-25 02:56:53 +02:00
Williham Totland a22522a725 Adds acid bomb 40mm shells 2013-05-25 02:47:13 +02:00
Fergus Dall 8dc7cd36fe Separated t_locker and t_rack from t_fridge and t_glass_fridge in map::bash 2013-05-25 09:35:04 +09:30
Kevin Granade 49b3b63d72 Merge skill gain/morale refactor. 2013-05-24 18:51:21 -05:00
fnord d2501bc030 Advanced inventory takes equipped items plus weapon into account and limits pickups accordingly. (Until invlet indexing is eliminated) 2013-05-24 14:06:19 -05:00
D Lue Choy 97b9331afb 96% fix for issue #808
Unfortunately worn items with charges (not implemented) are not ejected
from inventory. And item letter collisions are not corrected.
2013-05-24 14:15:20 -04:00
Fergus Dall 6451098bd8 Make lockers and racks spawn pipe instead of hose
Fixes #1172
2013-05-24 22:37:59 +09:30
Steven Wu 510c759f64 Fixes #960 by removing (dam != 0) check 2013-05-24 00:04:04 -07:00
Fergus Dall 6363ad61f7 Prevent non-version tags from being used for version info.
Fixes #1141
2013-05-24 15:58:58 +09:30
origamiwolf 551fc095ac Armour layering UI now shows fitted encumbrance values and coverage 2013-05-24 13:10:26 +08:00
Kevin Granade 7cfb3e9369 Merge pull request #1162 from ethankaminski/fridge-hoses
Make fridges drop a hose when deconstructed/smashed
2013-05-23 21:26:14 -07:00
Kevin Granade 222ce076f5 Add noise when moving furniture. 2013-05-23 23:06:57 -05:00
Kevin Granade d7d7b8bf49 Refactor game::fire() to behave sensibly about trajectories. 2013-05-23 22:50:15 -05:00
Ethan "Soron" Kaminski b5ace4ad2a Extract mapgen to helper methods, up to ot_forest_water 2013-05-24 15:20:36 +12:00
Kevin Granade 35eea03570 Remove HP reference from bite attack. 2013-05-23 21:37:26 -05:00
Kevin Granade 91449a4fc0 Apply new damage verbs to feedback when armor is damaged. 2013-05-23 21:36:26 -05:00
Kevin Granade 3e835b85a0 Add strings describing how different matrials take damage to material_type. 2013-05-23 21:35:47 -05:00
Ethan "Soron" Kaminski 0816af5cb8 Use the helper files for helper functions 2013-05-24 14:34:45 +12:00
Ethan "Soron" Kaminski a783ea88d3 Add a proper struct for passing around neighbor data 2013-05-24 14:30:43 +12:00
Ethan "Soron" Kaminski 8e4024afb0 Extract ot_null generation to a helper method 2013-05-24 14:15:01 +12:00
Ethan "Soron" Kaminski d29b244ff3 Add a debugmsg call when generating ot_null terrain 2013-05-24 14:04:27 +12:00
Ethan "Soron" Kaminski 092793805b Make fridges drop a hose when deconstructed/smashed 2013-05-24 13:48:23 +12:00
acidia 3d5ba4eae8 Fixed Jabberwock Name Typo 2013-05-23 20:34:09 -05:00
acidia 4350320437 Moved Jabberwock entry 2013-05-23 20:24:10 -05:00
acidia 3153790ac8 Moved Jabberwock entry 2013-05-23 20:17:35 -05:00
acidia 2316fd5911 Moved Jabberwock entry 2013-05-23 20:15:52 -05:00
acidia b8519ed9c7 Added flesh golem attack, chance of roar and a swipe attack that can knock you down. 2013-05-23 19:54:54 -05:00
Ethan "Soron" Kaminski 4183d70999 Update the help text about XP and learning 2013-05-24 12:53:29 +12:00
acidia 9a8283e121 Added flesh_golem attack 2013-05-23 19:48:09 -05:00
acidia 6f96ab0173 Added flesh golem attack, chance of roar and a swipe attack that can knock you down. 2013-05-23 19:47:27 -05:00
acidia 9f48d73510 Made flag mission text a bit clearer 2013-05-23 19:41:24 -05:00
acidia 305d1f5cdd Fixed warning statments caused by stained glass windows code... 2013-05-23 19:37:35 -05:00
Ethan "Soron" Kaminski b1a8c6d395 Remove references to skill comprehension 2013-05-24 12:22:57 +12:00
Ethan "Soron" Kaminski bd364111dc Replace references to "XP" with "Focus" 2013-05-24 12:12:21 +12:00
Kevin Granade e9745bba42 Merge armor handling refactor. 2013-05-23 18:51:17 -05:00
Ethan "Soron" Kaminski 3882cb5cc2 Add missing break statements to item examination logic 2013-05-24 10:08:52 +12:00
Ethan "Soron" Kaminski 7920ca2d48 Merge PR #1126 - armor UI tweaks
Conflicts:
	data/changelog.txt
2013-05-24 09:39:04 +12:00
Ethan "Soron" Kaminski 8673eea0a1 Merge PR #1151 - switching levels during map view 2013-05-24 09:25:58 +12:00
Ethan "Soron" Kaminski dc2d6a7244 Merge PR #1158 - fix backspacing in empty text fields 2013-05-24 09:13:11 +12:00
fnord 34d4b97189 string input popup: Prevent junk (^, etc) from being added if backspace is hit
while line is blank.
2013-05-23 10:44:04 -05:00
origamiwolf eb0f327c49 Added disassembly recipe for vacuum sealer 2013-05-23 22:01:00 +08:00
origamiwolf 877b136f02 remove storage check to show all allowable clothing on specific body part 2013-05-23 21:20:56 +08:00
Fergus Dall 705a2f25d6 Add level indicator to overmap screen 2013-05-23 20:30:28 +09:30
TheDarklingWolf 10ce9024f4 Merge branch 'pr/1148' 2013-05-23 09:47:08 +01:00
Kyratzes Talvadore 40350df34f Merge pull request #1146 from ethankaminski/vehicle-animation
Remove the vehicle animation delay
2013-05-23 01:38:14 -07:00
Fergus Dall ad3c7828d4 Make debug menu "Reveal map" reveal different z-levels as well 2013-05-23 16:47:39 +09:30
Fergus Dall 25dd4be923 Make '<' and '>' show different z-levels on the overmap screen 2013-05-23 16:47:29 +09:30
Kevin Granade 9474e84e35 Another day, another bugfix merge.
Conflicts:
	game.cpp
2013-05-22 19:42:07 -05:00
Kevin Granade ede15e1a8f Don't limit trajectory drawing to erroneous sight range. 2013-05-22 18:53:12 -05:00
Kevin Granade b51549e20a Use game::u_see() to check visibility and map::sees() to draw line in targeting screen. 2013-05-22 18:53:12 -05:00
Kevin Granade b9f6c70b95 Use map::draw() in game::plthrow() and game::plshoot() instead of drawing manually. 2013-05-22 18:53:12 -05:00
Kevin Granade 6359d73864 Drow enemes even when they're out of range. 2013-05-22 18:53:12 -05:00
Kevin Granade f8a43b5053 Add a saddle item and vehicle part for bicycles and motorcycles.
It is smaller and lighter than a car seat, but cannot have a seatbelt attached.
Incidentally it also can't hold tems dropped on it.
2013-05-22 18:52:39 -05:00
Kevin Granade f7b4bb5635 Require an anchor point to be present to install a seatbelt. 2013-05-22 18:52:39 -05:00
Kevin Granade 27f6f4064a Add new anchor point flag and apply it to car seats. 2013-05-22 18:52:39 -05:00
Kevin Granade 783bc2cc18 Nuke some commented out debug code. 2013-05-22 18:52:39 -05:00
Ethan "Soron" Kaminski 524ad4a5e1 Remove the vehicle animation delay
Nobody seems to like the vehicle animation delay, and I'm not aware of any reason why it's in the code, other than slowing down the animation. Excising the code.
2013-05-23 11:25:50 +12:00
Ethan "Soron" Kaminski 3ed605f45f Typo fix ("ressign" -> "reassign") 2013-05-23 11:22:57 +12:00
Ethan "Soron" Kaminski dcca01a26d Merge PR #1134 - in-inventory invlet reassignment 2013-05-23 11:06:07 +12:00
Charlie Nolan (FunnyMan3595) deedf81e90 Fixed a bug that prevented books from giving experience at 0 skill. 2013-05-22 15:04:19 -05:00
Charlie Nolan (FunnyMan3595) bd387006f4 SkillLevel::train and _exercise have increased granularity. 2013-05-22 11:00:39 -05:00
Charlie Nolan (FunnyMan3595) ed149d8ef3 max_ex < min_ex produces strange results in rng() 2013-05-22 10:13:59 -05:00
Charlie Nolan (FunnyMan3595) 086e56c81d Styling fix. 2013-05-22 10:12:27 -05:00
Charlie Nolan (FunnyMan3595) 3b561a037e No need to check for XP in the pool anymore. 2013-05-22 10:00:42 -05:00
Charlie Nolan (FunnyMan3595) e97fd63d8b Minor fixes to learning's rng() calls. 2013-05-22 09:59:51 -05:00
Charlie Nolan (FunnyMan3595) 9475956cdc Bugfix and minor cleanup to player::calc_focus_equilibrium 2013-05-22 09:55:54 -05:00
origamiwolf f74a85320e sauces now spawn in glass jars 2013-05-22 22:38:25 +08:00
origamiwolf d314685789 Added detailed armor info 2013-05-22 21:01:06 +08:00
origamiwolf 42d5e77536 Ensure distinct colours for armour damage, and added color key 2013-05-22 19:22:53 +08:00
Ethan "Soron" Kaminski 6d35478837 Remove obsolete sklevel member from player class 2013-05-22 20:43:30 +12:00
fnord be01f5fcab reassign invlet inside inventory with "=" item menu option 2013-05-22 03:07:25 -05:00
Ethan "Soron" Kaminski ad9f771c02 Remove obsolete, unused skill-related members of player class 2013-05-22 18:38:07 +12:00
Ethan "Soron" Kaminski 268819aa44 Merge PR #1101 - correct behavior of wborder in catacurse 2013-05-22 17:51:59 +12:00
Ethan "Soron" Kaminski 865b5ec6ba Merge PR #1125 - arrow keys work in multidrop/pickup windows 2013-05-22 17:48:13 +12:00
Ethan "Soron" Kaminski d2d7cc175e Merge PR #1114 - catacurse color tweaks 2013-05-22 17:47:04 +12:00
Ethan "Soron" Kaminski a195837be5 Erase the item info window when closing the pickup UI 2013-05-22 17:41:19 +12:00
Ethan "Soron" Kaminski 3ee1b69be4 Fix pickup window flickering in slow contexts 2013-05-22 17:39:55 +12:00
Ethan "Soron" Kaminski cec14342fa Merge PR #1118 - bifocals 2013-05-22 16:49:22 +12:00
Ethan "Soron" Kaminski e6b8b4b858 Merge PR #1117 - gasoline lanterns 2013-05-22 16:25:32 +12:00
fnord 9d7ed3b561 Added declaration that got lost in manual patch 2013-05-21 22:34:05 -05:00
alex-gh 723002d92b Gasoline lantern no longer disappears when it runs out. 2013-05-22 02:38:17 +02:00
alex-gh 05037ceed2 Gasoline lantern actually produces light now. Updated indentation of player::active_light to indentation required by CODE_STYLE 2013-05-22 01:56:50 +02:00
Fergus Dall f4795426be Make bifocal glasses spawn in bedrooms, offices and churchs 2013-05-22 08:21:37 +09:30
alex-gh acdf2094d0 Gasoline lanterns can actually spawn now. 2013-05-22 00:25:44 +02:00
Ethan "Soron" Kaminski bbd5143dc3 Merge PR #1110 - sewing crash fix 2013-05-22 10:20:21 +12:00
Ethan "Soron" Kaminski 9e23cf1a92 Merge PR #1115 - excise silly rounding logic 2013-05-22 10:13:40 +12:00
Ethan "Soron" Kaminski edafe2e453 Only warn about exiting a moving vehicle if >= 1 mph 2013-05-22 09:56:03 +12:00
Ethan "Soron" Kaminski e11b84b982 Merge PR #1127 - vehicle flinging fix
Conflicts:
	game.cpp
2013-05-22 09:27:00 +12:00
Ethan "Soron" Kaminski 8c1751c0b5 Merge PR #1124 - healing fixes, toolset normalization, soldering iron decomp 2013-05-22 09:08:02 +12:00
Skyrunner eafd32048b Fixed issue # 1037. fling_player_or_monster now considers vehicle speed when flinging. 2013-05-21 23:56:31 +09:00
origamiwolf 8712b85bea Updated changelog 2013-05-21 22:18:20 +08:00
origamiwolf b9b08294c9 Fixed bug in armour sort reassignment 2013-05-21 22:16:19 +08:00
origamiwolf f162d0f195 Use itype names instead and colour to indicate damage status 2013-05-21 21:58:21 +08:00
fnord ff98c8c4db Corrected typo: '\n' exits, '\t' selects 2013-05-21 08:09:41 -05:00
fnord 3f13bb9f25 multidrop allows scrolling with up/down, and selection with left/right 2013-05-21 07:53:26 -05:00
fnord ce19e1bf8d Arrow selection in 'g'et command 2013-05-21 07:52:44 -05:00
Williham Totland f64cb83838 Resolves an issue where rags and patches would not be consumed. 2013-05-21 14:00:29 +02:00
Williham Totland d790f8f9ba Normalizes toolset usage, makes soldering iron learnable from decomp 2013-05-21 13:56:39 +02:00
Williham Totland f42e20b48d Made V. Fast Healer/Regeneration be more effective while sleeping also. 2013-05-21 13:52:24 +02:00
Ethan "Soron" Kaminski 5f6441214b Learning from skill books reduces mental focus equilibrium point 2013-05-21 21:09:54 +12:00
Fergus Dall ded915d780 Fixed compiler error 2013-05-21 17:46:45 +09:30
Fergus Dall a711120781 Add bifocal glasses
Closes #845
2013-05-21 16:24:16 +09:30
Joshua Hunter ec1e7b63e1 fixed comment above to show new values for rng 2013-05-20 23:47:50 -07:00
alex-gh 6479dfcbe2 Lowered the efficiency a bit. The lanterns were too efficient. 2013-05-21 06:29:37 +02:00
alex-gh d3462eca05 Added gasoline lanterns. 2013-05-21 06:11:43 +02:00
Joshua Hunter 479f6feb6c fixes rng rounding error on initial fuel state 2013-05-20 18:39:54 -07:00
Dirkkun d897f1b9cb Catacurses color tweaks
Brightens the darker colors to remove ninja bears and stealthy zombie
hulks. Also makes light gray a bit darker because it currently looks
white.
2013-05-20 20:56:03 -04:00
Ethan "Soron" Kaminski c37e641e6b Merge PR #1085 - shrub smashing tweak 2013-05-21 11:19:39 +12:00
Ethan "Soron" Kaminski e098d1d39b Add feedback about focus gain to the morale screen 2013-05-21 11:16:52 +12:00
Ethan "Soron" Kaminski a2727180df Fix an NPC initialization bug
Nasty little thing that could cause a crash at game start, due to an index being out-of-bounds.
2013-05-21 10:51:27 +12:00
Ethan "Soron" Kaminski 79fc31c74f Merge UI enhancements (PRs #1095, #1093, #1081) 2013-05-21 10:32:11 +12:00
fnord cda170ff64 Add missing check for empty list 2013-05-20 16:30:36 -05:00
Williham Totland 7fceef44f2 Resolves an issue where destroying an item while tailoring would crash the game. 2013-05-20 18:32:09 +02:00
origamiwolf d1e11bf78a Display coverage in item stats, and fixed parenthesis warning 2013-05-20 22:48:46 +08:00
origamiwolf 3957eb2bf6 Add a small luck factor for armour damage to prevent complete invulnerabilities 2013-05-20 22:33:30 +08:00
origamiwolf bb56645fb0 Indentation cleanup 2013-05-20 22:28:48 +08:00
origamiwolf 04bd38a2ab Use coverage to determine if armour is hit, and thickness to determine damage absorption and armour damage 2013-05-20 22:23:13 +08:00
fnord 78591cd9ca Changing square resets page and position in list. Active border color yellow. 2013-05-20 02:11:26 -05:00
fnord fe2b68697b item colors for active window (green for usable ammo, blue for useful books etc) 2013-05-20 01:57:36 -05:00
fnord 4d27d8a250 Currently active window border is green. For windows, this requires
dab2041d158d804ae1fec8af937af3f145ab1c44 ( catacurse_wborder_fix )
2013-05-20 01:51:41 -05:00
fnord c474d10f77 Restructuring sorting to add less clutter. 2013-05-20 01:50:11 -05:00
fnord 600130b1a1 wborder() should not wattron(win, c_white): ncurses does not, and it prevents custom border colors
via 'wattron(win, c_green);  wborder(win, ...);  wattroff(win, c_green);'
2013-05-20 01:34:46 -05:00
Ethan "Soron" Kaminski 602e64dafe Update changelog for everything since 0.5 2013-05-20 17:42:27 +12:00
acidia 22f93982df small mission dialogue edits 2013-05-19 20:39:05 -05:00
acidia 6bb10531bc Added Jabberwock monster 2013-05-19 19:43:39 -05:00
acidia eb345f04c2 Added Jabberwock monster 2013-05-19 19:42:36 -05:00
acidia 96a4d54295 Added Jabberwock monster 2013-05-19 19:41:23 -05:00
acidia ca9a57c684 Added Kill Jabberwock mission 2013-05-19 19:39:49 -05:00
acidia 9074961c55 Added Kill Jabberwock 2013-05-19 19:38:03 -05:00
acidia 909ca50c49 Adding place_jabberwock 2013-05-19 19:33:10 -05:00
acidia c0f8cea2cf Added Kill Jabberwock 2013-05-19 19:30:14 -05:00
origamiwolf c4318c4e3d Made bash_resist and cut_resist accessors const 2013-05-20 07:51:57 +08:00
acidia 14eb3ddd4f Added Corporate Accounting Ledger, Patient Records, and National Weather Transcripts 2013-05-19 17:49:23 -04:00
acidia 8a3bec3f62 Added spawning of unique items for quests 2013-05-19 16:43:08 -05:00
acidia 697cba3bb5 Added new missions to mission_id 2013-05-19 16:28:37 -05:00
acidia b5087e1ed4 Added new missions... 2013-05-19 16:27:27 -05:00
acidia fd689a4a3b Added dialogue for 4 of the new missions 2013-05-19 16:26:00 -05:00
acidia e38776ab89 Added Corporate Accounting Ledger, Patient Records, and National Weather Transcripts 2013-05-19 16:17:59 -05:00
acidia 06696b6002 Added the small relic for the cathedral fetch quest 2013-05-19 16:11:58 -04:00
acidia 491273bd35 Added Cathedral
The towers will get filled in with the addition of z-levels...
2013-05-19 16:08:24 -04:00
acidia 4182ff8bf5 Added Cathedral 2013-05-19 15:05:51 -05:00
acidia 49589a2406 Added Cathedral 2013-05-19 16:03:19 -04:00
fnord 65e992f0c2 Advanced inventory now remembers the last sorting method of each
pane. This is only per game session, pending a method to add trivial
variables without breaking savegames.
2013-05-19 14:04:29 -05:00
fnord 15df8f7f37 Typo correction(s) and sanity check 2013-05-19 12:11:43 -05:00
fnord 73378e1456 Documented sort key and current sorting method 2013-05-19 12:04:07 -05:00
fnord 6bf376f3cf Advanced inventory will now sort via the 's' key: unsorted (order that
items were added), by name, weight, volume, and charges. (pending more).
Also:
* up/down in the 'e'xamine window will move to the next / previous
item in the list.
* weight and volume are displayed for ground / car squares
2013-05-19 11:48:55 -05:00
acidia 1708fc2b3b Added find flag dialogue 2013-05-19 12:22:57 -04:00
acidia 91f2a5a00a Added Find Flag 2013-05-19 11:19:04 -05:00
acidia 748d7561d8 Added GET_FLAG 2013-05-19 11:18:14 -05:00
acidia 1faf1e61c0 Added American Flag 2013-05-19 11:14:54 -05:00
acidia 2dbd68c703 Added American Flag Spawn for School 2013-05-19 11:13:11 -05:00
origamiwolf 08e8426cbd Added a new function and UI to re-layer clothing 2013-05-20 00:00:57 +08:00
origamiwolf c68bb0f295 Fully separate armour geometry from materials 2013-05-19 14:47:20 +08:00
Ethan "Soron" Kaminski ef62aeaa65 Rework learning mechanics, following issue #613
Implements items 1 through 5, from issue #613.
2013-05-19 16:50:20 +12:00
origamiwolf c288630d74 outer layers of armour protect inner layers 2013-05-19 12:30:42 +08:00
Kevin Granade d9de70eb3f Merge remote-tracking branches 'dda/pr/1082' and 'dda/pr/1083' into dda-master
Conflicts:
	game.h
2013-05-18 21:57:57 -05:00
Kevin Granade 9e3482b8ef Reduce difficulty to smash a shrub into underbrush. 2013-05-18 20:48:29 -05:00
Ethan "Soron" Kaminski d578c09c85 Account for ingredient age during cooking 2013-05-19 11:50:14 +12:00
Ethan "Soron" Kaminski 3d03d8c2a7 Stop item tags from spreading during map load 2013-05-19 11:22:14 +12:00
Ethan "Soron" Kaminski 3c70c9475c Fix iuse::sew indentation 2013-05-19 11:02:22 +12:00
Ethan "Soron" Kaminski 68551c1145 Merge PR #1069 - rags and leather for sewing repairs 2013-05-19 10:59:11 +12:00
Ethan "Soron" Kaminski 348e83c86a Merge PR #1076 - scrolling in menus, inventory 2013-05-19 10:37:22 +12:00
Ethan "Soron" Kaminski 3983e49459 Merge PR #1080 - pit constructions 2013-05-19 10:32:09 +12:00
Ethan "Soron" Kaminski a09087b3f2 Merge PR #1038 - scentmap optimization 2013-05-19 10:25:42 +12:00
fnord 4e66ed5cb3 One can now choose to ignore further sound interruptions and complete current task. Example: reloading while dozens of zeds are beating down walls. 2013-05-18 14:16:57 -05:00
origamiwolf ff458e43ea separate out materials contributions to armour protection values 2013-05-19 01:42:44 +08:00
fnord 4466f7e315 Actually remembers selection now. Oops 2013-05-18 12:36:59 -05:00
origamiwolf 1140e5a28a Fixed material not being passed correctly, and added chitin to item factory 2013-05-19 01:06:42 +08:00
Kevin Granade 9bef3b10ef Merge remote-tracking branches 'dda/pr/1077' and 'dda/pr/1078' into dda-master 2013-05-18 10:06:20 -05:00
Kevin Granade eb27dae044 Add pit construction recipe to the start of constructions requiring a pit.
This is to avoid confusion about their apparent unbuildability.
Thanks vache for pointing out this solution.
2013-05-18 10:02:56 -05:00
origamiwolf 0a2bfc91f4 use materials functions in armour absorption code 2013-05-18 22:46:25 +08:00
Kevin Granade d0e47205ea Prevent navagable terrain from receiving the scent-blocking trait. 2013-05-18 09:38:09 -05:00
Kevin Granade 431c9cdb1f Merge remote-tracking branch 'dda/master' into scent-performance 2013-05-18 09:22:06 -05:00
Kevin Granade 2a77a1307e Merge pull request #1052 from ethankaminski/windows-fixes
Catacurse fixes (closes #1045)
2013-05-18 07:20:45 -07:00
fnord 4e964a58f9 inventory will remember last selection position when backing out of per item menu 2013-05-18 08:28:43 -05:00
fnord 37d1a0b365 The inventory now allows selection via up / down / enter keys. 2013-05-18 08:14:49 -05:00
origamiwolf aeee7fa419 Added more materials calls, moved material resistance matrix to json 2013-05-18 19:51:44 +08:00
Ethan "Soron" Kaminski af799bc6c4 Track used items in game::consume_items 2013-05-18 22:59:40 +12:00
fnord efd23ef434 Item menu in inventory allows up/down/enter selection as well. compare_split_screen_popup has been abused further, taking an additional optional argument and returning int instead of char. 2013-05-18 05:55:42 -05:00
Ethan "Soron" Kaminski 0cb717e342 Use a std::list for used item tracking (easier to combine) 2013-05-18 22:46:45 +12:00
Ethan "Soron" Kaminski d13ca72b67 Make containers unloadable again 2013-05-18 22:16:37 +12:00
Ethan "Soron" Kaminski d85b39e41f Use boolean rather than bitwise logic in a conditional 2013-05-18 21:57:47 +12:00
Ethan "Soron" Kaminski 6a570f0c53 Merge PR #1019 - weather handles non-default starting time 2013-05-18 21:42:13 +12:00
fnord 1ec122d162 Background for selected entry extends the entire line. 2013-05-18 04:30:55 -05:00
Ethan "Soron" Kaminski cf1fcdde28 Merge PR #1073 - spontaneous fitting fix 2013-05-18 21:30:35 +12:00
fnord 2dd42317ef menu function allows selection via up/down + enter in addition to
single character.
2013-05-18 03:50:44 -05:00
origamiwolf 7da807e1be set up JSON for materials 2013-05-18 16:38:49 +08:00
Kevin Granade 989be8275d Merge welder fix. 2013-05-17 23:56:16 -05:00
KA101 5485b75e2f Move the "good" appearance mutations to the "good" column 2013-05-17 23:54:25 -05:00
Kevin Granade 55e1197800 Move fitted clothing generation to item spawn method so dropped items don't become fitted. 2013-05-17 23:37:19 -05:00
Kevin Granade 3cb3dce7f2 Extract common code from the two spawn item methods. 2013-05-17 23:36:20 -05:00
Ethan "Soron" Kaminski 294c04cc1e Actually use the iterator variable in a for loop 2013-05-18 13:40:42 +12:00
Ethan "Soron" Kaminski 9bbefa16e8 Allow tracking of consumed items 2013-05-18 13:39:41 +12:00
Ethan "Soron" Kaminski b66fd49c8e Add a debug message if no components are available 2013-05-18 13:05:48 +12:00
Ethan "Soron" Kaminski 424bcf0b5d Re-indent game::consume_items 2013-05-18 13:04:16 +12:00
alex-gh 78d87c8e4c Make sewing use rags/leather. 2013-05-18 02:00:11 +02:00
alex-gh 11f18517f4 Check if we have enough rags/leather before sewing. 2013-05-18 01:44:39 +02:00
Kevin Granade 7eff9b9fe1 Merge remote-tracking branch 'dda/pr/1051' into dda-master 2013-05-17 18:16:59 -05:00
Kevin Granade fec629aa4f Merge remote-tracking branch 'dda/pr/1021' into dda-master 2013-05-17 18:15:17 -05:00
Ethan "Soron" Kaminski 66e8cdf26b Merge PR #929 - air conditioning 2013-05-18 10:58:49 +12:00
fnord 015a8b5284 initilization fix, redux 2013-05-17 17:27:14 -05:00
fnord 6ad3169434 Merge remote branch 'origin/master' into air_conditioning 2013-05-17 11:33:35 -05:00
maseck 0379189c17 Fixed errors in original commit 2013-05-17 11:06:56 -04:00
origamiwolf ac4c785fb8 Added chitin as a material 2013-05-17 21:26:39 +08:00
origamiwolf e08ceb81db Rewrite armour damage code 2013-05-17 21:13:23 +08:00
origamiwolf 4495a9369f Rewrite armor damage absorption code 2013-05-17 20:38:43 +08:00
Ethan "Soron" Kaminski 11fac6058d Fix welder charges, allow code to force-mark tools as available 2013-05-17 23:16:22 +12:00
alex-gh 098887a329 Moved bone broth to the food crafting category. 2013-05-17 13:13:15 +02:00
Ethan "Soron" Kaminski f394fa7b92 Make bone broth made of flesh, normalize toolset charges 2013-05-17 22:28:08 +12:00
Ethan "Soron" Kaminski 0da409648c Merge PR #1049 - add bone broth 2013-05-17 18:41:07 +12:00
Ethan "Soron" Kaminski 9108c53e5d Merge PR #1044 - advanced inventory changes 2013-05-17 18:23:55 +12:00
Ethan "Soron" Kaminski 22c3301c5b Make hoses usable (as a tool) to siphon gas 2013-05-17 16:06:25 +12:00
Ethan "Soron" Kaminski e22b6f6e81 Make siphoning take the same time as refueling 2013-05-17 15:29:39 +12:00
Ethan "Soron" Kaminski 2ab5e43c29 Siphoning is possible on any tile of the vehicle now 2013-05-17 15:26:58 +12:00
Ethan "Soron" Kaminski 40318b986d Add missing return statement to catacurse's getch() 2013-05-17 14:43:01 +12:00
maseck a8051ba330 Create arrays for n/e/s/w_fac and t_north/east/south/west 2013-05-16 22:26:13 -04:00
alex-gh d4bbbf352b Buffed bone broth to make up for a long cooking time 2013-05-17 03:06:35 +02:00
alex-gh 95b0f791c2 Added bone broth. 2013-05-17 03:05:12 +02:00
Ethan "Soron" Kaminski 6f1ddd2126 Make newwin in catacurse correctly handle 0 for ncols/nlines 2013-05-17 13:04:41 +12:00
Kevin Granade 03153ebfc5 Merge pull request #1046 from ethankaminski/bolt-category
Moved bolts to ammo category, like arrows
2013-05-16 17:36:58 -07:00
Kevin Granade 2e475fa83d Merge bugfixes du jour. 2013-05-16 19:19:25 -05:00
Kevin Granade b0345c2f7b Update unit test to use overmapbuffer. 2013-05-16 19:13:43 -05:00
Kevin Granade 9f94ff602b Exit early from map::field_at() if trhere are no fields in the current submap. 2013-05-16 19:13:09 -05:00
Kevin Granade ec1f8c0656 Further cleanup of update_scent, and handle barrier scent attenuation properly. 2013-05-16 19:12:31 -05:00
alex-gh 8f9f2b81fa random_good_bionic() should no longer return faulty bionics. 2013-05-17 01:28:41 +02:00
Kevin Granade 2e40eeaf57 Move STARTING_MINUTES to mongroupdef.cpp since it's the only place it's used now. 2013-05-16 17:52:11 -05:00
Kevin Granade 195d8caba5 Don't add in the starting time offset to the initial weather change calculation, it's alreadt in OPT_INITIAL_TIME. 2013-05-16 17:51:36 -05:00
Ethan "Soron" Kaminski f0eb67f2df Moved bolts to ammo category, like arrows 2013-05-17 10:41:22 +12:00
fnord aec010d4aa Unclobber cleanup 2013-05-16 10:35:30 -05:00
fnord 61d7722d58 advanced_inv: refactor. Struct contains all window pane specific variables,
eliminating code duplication in anticipation of further functionality.
Space now exits. 'i' selects inventory. Scrolling past end of page
advances to next page.
2013-05-16 10:26:44 -05:00
origamiwolf 5510fdda83 Alter glowstick behaviour to match reality 2013-05-16 21:30:32 +08:00
Ethan "Soron" Kaminski c2d5d6b845 Prevent unloading of M72 LAW and NX-17 Charge Rifle 2013-05-16 20:57:43 +12:00
Ethan "Soron" Kaminski 688263a4b2 Merge PR #1033 - item tags as sets 2013-05-16 18:20:56 +12:00
Ethan "Soron" Kaminski b505b82a6c Merge pull request #1035 from kevingranade/pad-oper
Add padding argument to coding style specification.
2013-05-15 22:58:48 -07:00
Kevin Granade ed4ca9497d Unrolled and refactored update_scent() to accelerate waiting, reading, etc. 2013-05-16 00:44:28 -05:00
Kevin Granade b04f51abe3 Merge todays bugfixes. 2013-05-15 21:09:59 -05:00
Kevin Granade 41950db139 Merge remote-tracking branch 'dda/pr/1023' into dda-master 2013-05-15 21:06:08 -05:00
Kevin Granade ac3bebf8bc Add padding argument to coding style specification. 2013-05-15 21:04:45 -05:00
Kevin Granade a9e0ee9515 Style cleanup. 2013-05-15 20:58:17 -05:00
Kevin Granade 1bfb4bec63 Merge remote-tracking branch 'dda/pr/986' into dda-master 2013-05-15 20:44:17 -05:00
Kevin Granade d62c714434 Merge remote-tracking branch 'dda/pr/1020' into dda-master 2013-05-15 20:17:49 -05:00
Kevin Granade 1d84ccf2b5 Clean up obsolete item flag enum and tag->enum mapping. 2013-05-15 20:08:04 -05:00
Kevin Granade 9a79713510 Convert item::item_flags to item::item_tags.
Also changing from a bit array to a set of strings.
Applying the same change to item::mode.
2013-05-15 20:08:03 -05:00
Kevin Granade 5f87fcd549 Move some library includes to the end of the list where they belong. 2013-05-15 20:08:03 -05:00
Kevin Granade 98779857d6 Remove obsolete item construction macros. 2013-05-15 20:08:03 -05:00
Kevin Granade e7fb33496e Remove unused flag parameter from item template constructors. 2013-05-15 20:08:03 -05:00
Kevin Granade 1bc4f249de Remove overloaded use of item::mode in preperation for turning it into a string field. 2013-05-15 20:08:03 -05:00
Kevin Granade d6b05e978e Add a catajson method to extract a list of strings as a set for use as tags. 2013-05-15 20:08:03 -05:00
Ethan "Soron" Kaminski 76bbf9779d Merge pull request #1026 from Voker57/fixes
Added missing break to season length option
2013-05-15 16:25:22 -07:00
Fergus Dall aaff40057e Make android give a power source even for passive bionics
Fixes #1027
2013-05-16 08:51:48 +09:30
Ethan "Soron" Kaminski 6dae388bcf Make signs in negative torso smart, like the rest 2013-05-16 11:21:07 +12:00
Voker57 32e2942650 Added missing break to season length option 2013-05-15 18:12:22 +04:00
fnord fd9975c5ff Debug spew removed. Oops 2013-05-15 06:34:50 -05:00
fnord db5c679e8d Dropping stuff into a vehicle container will add charges instead of adding
a new item, if applicable.
2013-05-15 04:24:17 -05:00
Ethan "Soron" Kaminski a6d32cde1a Add fuel siphoning to the game.
You can now siphon fuel from the vehicle examination screen. Requires a hose.

Eventually I'd like to add a Mechanics recipe to make an alternate siphon item out of pipe or something, because hoses are really too rare to be the sole item for something as important as fuel siphoning.
2013-05-15 19:23:20 +12:00
Ethan "Soron" Kaminski f34568ee60 Add a message when nearby corpses rez 2013-05-15 17:52:29 +12:00
Ethan "Soron" Kaminski bbbe83ffdc Fix zombie revival timing - no longer tuned for testing
Whoops, left the code in a testing state when I committed at some point.
2013-05-15 15:36:21 +12:00
Ethan "Soron" Kaminski 01f5296a1d Save state of zombie death drops 2013-05-15 15:30:52 +12:00
Ethan "Soron" Kaminski 3fbca61610 Fix some revification bugs 2013-05-15 15:28:35 +12:00
Ethan "Soron" Kaminski 3367e0cf13 Zombies rise from the dead after a certain amount of time 2013-05-15 14:06:24 +12:00
Ethan "Soron" Kaminski 98220d9e36 Extract corpse-revival code to a method of game 2013-05-15 13:02:59 +12:00
Kevin Granade 2d8967f603 Take starting time option into account when setting initial weather timeout. 2013-05-14 19:42:42 -05:00
Ethan "Soron" Kaminski cbfe708f36 Merge PR #1018 - vehicle collisions less crazy 2013-05-15 12:18:36 +12:00
Kevin Granade 2be2924e05 Merge remote-tracking branch 'dda/pr/1015' into dda-master 2013-05-14 19:10:19 -05:00
Kevin Granade ea7211ab97 Don't allow driverless vehicles to recover from skids. 2013-05-14 18:55:24 -05:00
Kevin Granade 8047cbf4ff Make skidding cause uncontrollable turning rather than uncontrollable impossible vector changes. 2013-05-14 18:55:23 -05:00
Ethan "Soron" Kaminski b7d0bae27e Use correct spelling of "acceptable" in JSON 2013-05-15 11:12:50 +12:00
Ethan "Soron" Kaminski ad1920876c Merge PR #1009 - ammo to JSON 2013-05-15 11:10:13 +12:00
Ethan "Soron" Kaminski 46bcc0845a Merge PR #1011 - purifier fix 2013-05-15 10:42:46 +12:00
Ethan "Soron" Kaminski 95f3b83ff3 Add missing semicolon after catacurse.h function declaration 2013-05-15 10:41:13 +12:00
Ethan "Soron" Kaminski 4ca94f6bb1 Merge PR #985 - more curses functions in catacurse 2013-05-15 10:34:39 +12:00
Ethan "Soron" Kaminski 5edcfdcd26 Change some more odd double vs. int stuff 2013-05-15 10:22:58 +12:00
Ethan "Soron" Kaminski 397b231583 Fix floating-point math to actually use floating point numbers 2013-05-15 10:13:54 +12:00
Herbert Jones e066f83cda Added license. 2013-05-14 09:13:47 -05:00
fnord 6402bcf27b Purifiers will no longer remove starting traits such as 'android',
'skilled liar' or 'nearsighted'
2013-05-14 09:09:44 -05:00
Fergus Dall a720914bb5 Move all gun mods into json raws 2013-05-14 17:41:32 +09:30
fnord e36d22b247 Advanced inventory's weight and volume columns will now display full
stack values. Oops. Small UI comprovements in addition to this:
* The 'same square!' popup can be ignored as it will pass the next
 keypress (except q and esc) and disappear.
* '0' for weight or volume will appear dimmed.
* current/max number of items displayed at top right
* current inventory total displayed above 'weight vol' header.
* [stack amount] moved to it's own column as it's easier to read.
2013-05-13 03:54:49 -05:00
Ben Fox-Moore 70ef2c462d Fix incorrect mvwgetch prototype 2013-05-13 00:12:30 +01:00
Ben Fox-Moore 68952a196e Add wgetch and mvwgetch functions 2013-05-12 23:48:20 +01:00
jason.gilbert@nbed.nb.ca 2054755efa Lowered homeostasis adjustement while hot 2013-05-11 18:24:36 -03:00
jason.gilbert@nbed.nb.ca 44d3adbc92 Tweaked pain due to heat 2013-05-11 18:23:21 -03:00
fnord 7b3f6542e7 Initialize cache vars in class 2013-05-10 21:04:56 -05:00
fnord ec96820550 Temperature: Bio climate mod will only modify comfort levels if active.
Traditional air conditioning will modify comfort levels in addition
to bio climate mod. This wraps the has_bionic("bio_climate") check in
a new player::in_climate_control(game g*) function, which will return
positive on has_active_bionic("bio_climate"). If not, it will perform
additional checks that are cached every 20-60 turns to save cpu and
simulate temperature acclimation.
Currently, it will check to see if the player is inside a vehicle
with no open doors, and a working engine with fuel (total_power(true)).
Later a requirement for an Air Conditioning vehicle item can be added,
as well as building checks if / when building power is added.
2013-05-10 07:44:00 -05:00
Shoes01 bb1872ac1a Disease.cpp fixes 2013-05-09 18:51:42 -07:00
192 changed files with 104300 additions and 18847 deletions
+20
View File
@@ -1,4 +1,5 @@
cataclysm
cataclysm-tiles
data/*.template
save/
obj/
@@ -12,3 +13,22 @@ version.h
Cataclysm.exe
CataclysmWin.depend
CataclysmWin.layout
# Visual Studio files
*.suo
*.user
Cataclysm.sdf
Release*/
Debug*/
*.opensdf
# Temporary and backup files
*~
\#*
*.bak
*.cbTemp
gmon.out
# System Files
Thumbs.db
.DS_Store
+1 -1
View File
@@ -2,7 +2,7 @@ Current policy is to update code to the standard style when changing a
substantial portion of it. Blocks of code can be passed through astyle
to ensure that their formatting is correct:
astyle --style=allman --indent=spaces=4 --add-brackets --align-pointer=name
astyle --style=allman --indent=spaces=4 --add-brackets --align-pointer=name -p
For example, from vi, set marks a and b around the block, then:
:'a,'b ! astyle --style=allman --indent=spaces=4 --add-brackets --align-pointer=name
-20
View File
@@ -1,20 +0,0 @@
Instructions for compiling on a Debian-based system. The package names here are for Ubuntu 12.10
Dependencies: libncurses
# Native build on current platform
sudo apt-get install libncurses5-dev
make
# Cross-compile to linux 32-bit from linux 64-bit
sudo apt-get install libc6-dev-i386 lib32ncurses5-dev lib32stdc++-dev g++-multilib
make NATIVE=linux32
# Cross-compile for Windows
sudo apt-get install autoconf bison flex cmake git automake intltool libtool scons yasm
mkdir -p ~/src
git clone -b stable https://github.com/mxe/mxe.git ~/src
cd ~/src/mxe
make gcc
PATH=${PATH}:~/src/mxe/usr/bin
make CROSS=win32
+84
View File
@@ -0,0 +1,84 @@
Instructions for compiling on a Debian-based system. The package names here are
valid for Ubuntu 12.10 and may or may not work on your system.
Building instructions, below, always assume you are running them from the
Cataclysm:DDA source directory.
## Linux (native) ncurses builds ##
Dependencies:
* ncurses
* build essentials
```
sudo apt-get install libncurses5-dev build-essential
```
### Building ###
```
make
```
## Cross-compiling to linux 32-bit from linux 64-bit ##
Dependencies:
* 32-bit toolchain
* 32-bit ncurses
```
sudo apt-get install libc6-dev-i386 lib32stdc++-dev g++-multilib lib32ncurses5-dev
```
### Building ###
```
make NATIVE=linux32
```
## Cross-compile to Windows from Linux ##
Dependencies:
* [mxe](http://mxe.cc)
```
sudo apt-get install autoconf bison flex cmake git automake intltool libtool scons yasm
mkdir -p ~/src/mxe
git clone -b stable https://github.com/mxe/mxe.git ~/src/mxe
cd ~/src/mxe
make gcc
```
### Building ###
```
PATH="${PATH}:~/src/mxe/usr/bin"
make CROSS=i686-pc-mingw32-
```
## Linux (native) SDL builds ##
Dependencies:
* SDL
* SDL_ttf
* build essentials
```
sudo apt-get install libsdl1.2-dev libsdl-ttf2.0-dev build-essential
```
### Building ###
```
make TILES=1
```
## Cross-compile to Windows SDL from Linux ##
Dependencies:
* [mxe](http://mxe.cc)
```
sudo apt-get install autoconf bison flex cmake git automake intltool libtool scons yasm
mkdir -p ~/src/mxe
git clone -b stable https://github.com/mxe/mxe.git ~/src/mxe
cd ~/src/mxe
make sdl sdl_ttf
```
### Building ###
```
PATH="${PATH}:~/src/mxe/usr/bin"
make TILES=1 CROSS=i686-pc-mingw32-
```
+73
View File
@@ -0,0 +1,73 @@
# Building Cataclysm-DDA on Mac OS X
Tested with OS X 10.8.4, Xcode 4.6.2.
I haven't played it extensively but it builds and runs.
Not sure if it compiles with older OS/XCode versions.
This worked for me, your mileage may vary.
## Requirements
Cataclysm-DDA uses SDL, SDL\_ttf, ncurses, and gettext.
SDL can be installed as frameworks or shared libraries.
### SDL Frameworks
[**SDL framework**](http://www.libsdl.org/download-1.2.php)
http://www.libsdl.org/release/SDL-1.2.15.dmg
[**SDL\_image framework**](http://www.libsdl.org/projects/SDL_ttf/)
http://www.libsdl.org/projects/SDL_ttf/release/SDL_ttf-2.0.11.dmg
Copy `SDL.framework` and `SDL_ttf.framework` to `/Library/Frameworks`
or `/Users/name/Library/Frameworks`.
### ncurses, gettext, libsdl, lib\_ttf
Using a package manager:
[Fink](http://fink.thetis.ig42.org), [Homebrew](http://mxcl.github.io/homebrew/),
[MacPorts](http://www.macports.org), or [pkgsrc](http://www.pkgsrc.org/).
Install gettext and ncurses. Also install libsdl and libsdl\_ttf if you're
not using frameworks as above.
Without a package manager, building from source isn't too difficult;
follow instructions in the source archives.
## Build
From the Cataclysm-DDA source folder:
$ export CXXFLAGS="-I/path/to/include" LDFLAGS="-L/path/to/lib"
This adds search paths to find shared libraries outside of /usr and /usr/local.
Multiple `-I/...` or `-L/...` paths can be specified.
$ make NATIVE=osx RELEASE=1 TILES=1 FRAMEWORK=1 OSX_MIN=10.6
## Run
$ ./cataclysm
or
$ ./cataclysm-tiles
### Options
`NATIVE=osx` builds for OS X.
`RELEASE=1` builds an optimized 'release' version.
`TILES=1` builds the SDL version; omit to build the ncurses/console version.
`FRAMEWORK=1` uses frameworks; omit for libsdl, libsdl\_ttf.
`OSX_MIN=version` sets `-mmacosx-version-min=` (mine needs to be 10.6); omit for 10.5.
### Archive
$ make bindist NATIVE=osx TILES=1
Create a .tar.gz archive of the build; omit `TILES=1` for the console version.
+3 -3
View File
@@ -39,7 +39,7 @@ For example, from vi, set marks a and b around the block, then:
$ cd Cataclysm-DDA
# Changes the active directory in the prompt to the newly cloned "Cataclysm-DDA" directory
$ git remote add -f upstream https://github.com/TheDarklingWolf/Cataclysm-DDA.git
$ git remote add -f upstream https://github.com/CleverRaven/Cataclysm-DDA.git
# Assigns the original repository to a remote called "upstream"
#### Update your `master` branch
@@ -113,7 +113,7 @@ You can also set the tracking information at the same time as creating the branc
* Note: Although this makes it easier to pull from `upstream/master`, it doesn't change anything with regards to pushing. `git push` fails because you don't have permission to push to `upstream/master`.
$ git push
error: The requested URL returned error: 403 while accessing https://github.com/TheDarklingWolf/Cataclysm-DDA.git
error: The requested URL returned error: 403 while accessing https://github.com/CleverRaven/Cataclysm-DDA.git
fatal: HTTP request failed
$ git push origin
....
@@ -128,7 +128,7 @@ You can also set the tracking information at the same time as creating the branc
If `git pull --ff-only` shows an error, it means that you've committed directly to your local `master` branch. To fix this, we create a new branch with these commits, find the point at which we diverged from `upstream/master`, and then reset `master` to that point.
$ git pull --ff-only upstream master
From https://github.com/TheDarklingWolf/Cataclysm-DDA
From https://github.com/CleverRaven/Cataclysm-DDA
* branch master -> FETCH_HEAD
fatal: Not possible to fast-forward, aborting.
$ git branch new_branch master # mark the current commit with a tmp branch
Executable → Regular
+25 -2
View File
@@ -19,6 +19,21 @@
<Add option="-static -lgdi32" />
</Linker>
</Target>
<Target title="Debug">
<Option output="Cataclysm" prefix_auto="1" extension_auto="1" />
<Option object_output="obj/Debug/" />
<Option type="0" />
<Option compiler="gcc" />
<Compiler>
<Add option="-pg" />
<Add option="-g" />
</Compiler>
<Linker>
<Add option="-pg -lgmon" />
<Add option="-Wl,-stack,12000000,-subsystem,windows" />
<Add option="-static -lgdi32" />
</Linker>
</Target>
</Build>
<Unit filename="action.cpp" />
<Unit filename="action.h" />
@@ -27,15 +42,18 @@
<Unit filename="artifact.cpp" />
<Unit filename="artifact.h" />
<Unit filename="artifactdata.h" />
<Unit filename="auto_pickup.cpp" />
<Unit filename="auto_pickup.h" />
<Unit filename="basecamp.cpp" />
<Unit filename="basecamp.h" />
<Unit filename="bionics.cpp" />
<Unit filename="bionics.h" />
<Unit filename="bodypart.cpp" />
<Unit filename="bodypart.h" />
<Unit filename="building_generation.cpp" />
<Unit filename="building_generation.h" />
<Unit filename="calendar.cpp" />
<Unit filename="calendar.h" />
<Unit filename="catacurse.cpp" />
<Unit filename="catacurse.h" />
<Unit filename="catajson.cpp" />
<Unit filename="catajson.h" />
@@ -106,6 +124,8 @@
<Unit filename="mapgenformat.h" />
<Unit filename="mapitems.h" />
<Unit filename="mapitemsdef.cpp" />
<Unit filename="material.cpp" />
<Unit filename="material.h" />
<Unit filename="melee.cpp" />
<Unit filename="mission.cpp" />
<Unit filename="mission.h" />
@@ -120,7 +140,6 @@
<Unit filename="mondeath.h" />
<Unit filename="mongroup.h" />
<Unit filename="mongroupdef.cpp" />
<Unit filename="monitemsdef.cpp" />
<Unit filename="monmove.cpp" />
<Unit filename="monster.cpp" />
<Unit filename="monster.h" />
@@ -171,11 +190,14 @@
<Unit filename="text_snippets.h" />
<Unit filename="tileray.cpp" />
<Unit filename="tileray.h" />
<Unit filename="translations.h" />
<Unit filename="trap.h" />
<Unit filename="trapdef.cpp" />
<Unit filename="trapfunc.cpp" />
<Unit filename="tutorial.cpp" />
<Unit filename="tutorial.h" />
<Unit filename="ui.cpp" />
<Unit filename="ui.h" />
<Unit filename="veh_interact.cpp" />
<Unit filename="veh_interact.h" />
<Unit filename="veh_type.h" />
@@ -187,6 +209,7 @@
<Unit filename="weather.cpp" />
<Unit filename="weather.h" />
<Unit filename="weather_data.cpp" />
<Unit filename="wincurse.cpp" />
<Unit filename="wish.cpp" />
<Extensions>
<code_completion />
+77 -1
View File
@@ -61,6 +61,82 @@
{ot_toxic_dump, 0, 5, 15, -1, mcat_null, 0, 0, 0, 0, &omspec_place::wilderness,0}
The comments given in source code to structure struct overmap_special explains the meaning of these constants in the example above.
1.4 Adding/editing armour and how armour protection is calculated
1) Edit armor.json and add your armor item near similar types.
2) The fields are:
"type" : "ARMOR", // this must be ARMOR
"id" : "socks", // the identifier used by the game. Must be one continuous word, use underscores if necessary
"name" : "socks", // the name appearing in the examine box. Can be more than one word separated by spaces
"weight" : 1, // weight of armour
"color" : "blue", // ascii character colour
"covers" : ["FEET"], // where it covers. Possible options are TORSO, HEAD, EYES, MOUTH, ARMS, HANDS, LEGS, FEET
"to_hit" : 0, // bonus if using it as a melee weapon (whatever for?)
"storage" : 0, // how many volume storage slots it adds
"symbol" : "[", // ascii character
"description" : "Socks. Put 'em on your feet.", // description of armour
"price" : 100, // price of armour, used when bartering with NPCs
"material" : ["COTTON", "NULL"], // material types. See materials.json for possible options
"volume" : 1, // volume occupied
"cutting" : 0, // cutting damage caused by using it as a melee weapon
"warmth" : 10, // how much warmth clothing provides
"phase" : "solid", // what phase it is
"enviromental_protection" : 0, // how much environmental protection it affords
"rarity" : 70, // determines how often it spawns
"encumberance" : 0, // base encumbrance (unfitted value)
"bashing" : -5, // bashing damage caused by using it as a melee weapon
"flags" : ["VARSIZE"] // used to indicate clothing type which can be fitted. Leave out the flags field entirely if clothing cannot be fitted
"coverage" : 80, // what percentage of body part
"material_thickness" : 1 // thickness of material, in millimetre units (approximately). Generally ranges between 1 - 5, more unusual armour types go up to 10 or more
3) When the player is hit at a specific body part, armour coverage determines whether the armour is hit, or an uncovered part of the player is hit (roll 1d100 against coverage)
4) If the above roll fails (ie roll value is above coverage), then the armour does not absorb any damage from the blow, neither does it become damaged
5) If the above roll succeeds, the armour is hit, possibly absorbing some damage and possibly getting damaged in the process
6) The above steps are repeated for each layer of armour on the body part
7) Armour protects against bash and cut damage. These are determined by multiplying the armour thickness by the material bash/cut resistance factor respectively, given in materials.json
8) If the armour is made from 2 materials types, then it takes a weighted average of the primary material (66%) and secondary material (33%).
9) Materials resistance factors are given relative to PAPER as a material (this probably needs some fine-tuning for balance).
1.5 Acid resistance
This determines how items react to acid fields. Item acid resistances are a weighted
average of the materials acid resistance (see item::acid_resist).
An item acid resistance of zero means it will get corroded every turn
An item acid resistance above zero means it has a chance of getting corroded every turn
An item acid resistance above 9 means completely acidproof
Acid resistance values are in materials.json, and defined as such:
0 - zero resistance to acid (metals)
1 - partly resistant to acid
2 - very resistant to acid
3 - complete acid resistance
1.6 Adding a bionic
1) Edit data/raw/bionics.json and add your bionic near similar types.
2) Add the required attributes
id : "bio_rocketlauncher" // Text string used as identifier in the code.
name : "CBM: Rocket Launcher" // The bionic's name, as showed to the player.
cost : 10 // How many PUs it costs to use the bionic.
time : 0 // How long, when activated, between drawing cost. If 0, it draws power once.
description : "It's a rocket launcher, inside your arm!!" // A brief description of the bionic, as showed to the player.
3) Add any otional attributes
flags : ["ACTIVE"] // Used to flag the bionic as a specific type.
Supported flags:
"ACTIVE" : The bionic can be manually activated and deactivated.
"POWER" : The bionic provides a source of power.
"FAULTY" : The bionic is an unwanted one, will typically have negative effects.
Flags can be combined like so: ["ACTIVE","POWER","FAULTY"] (Don't add all these at once)
4) If you want the bionic to be available in the gameworld as an item, add it to itypedef.cpp
BIO_SINGLE(id, rarity, price, color, difficulty)
See 1.1 for more information about adding items.
FAQ
Q: What the heck is up with the map objects?
@@ -84,4 +160,4 @@ An overmap encapsulates the large-scale structure of a map
FAQ
Q: what is the relation of NPCS/Monsters vs maps. How are they stored, where are they stored? Are they stored?
A: All npcs are now stored in the overmap. Active npcs only contain the currently active npcs. There is a difference between npc active npc coordinates, and overmap coordinates. So these will need to be changed when saving the npcs. Or else the npcs will be saved at the wrong location. And yes they are stored.
A: All npcs are now stored in the overmap. Active npcs only contain the currently active npcs. There is a difference between npc active npc coordinates, and overmap coordinates. So these will need to be changed when saving the npcs. Or else the npcs will be saved at the wrong location. And yes they are stored.
+106
View File
@@ -0,0 +1,106 @@
MODDING
Certain features of the game can be modified without rebuilding the game from
source code; you should be able to just modify the pertinent files and run the
game to see your changes. This attempts to document these features.
1.1 Adding a profession.
The data on professions is contained in data/raw/professions.json
The format of the file follows:
[
{
"ident" : "example", <-- This is a unique string that identifies the
profession; it is used internally by the game as
opposed to in the user interface.
"name": "Example Profession", <-- This is the name that will be displayed
on the user interface; this is
what you actually "see" in-game.
"description": "An example profession.", <-- This field contains the
description of the profession
that will be displayed in the
character creation screen.
"points" : 0, <-- This value describes the point cost of the profession;
note that negative numbers are accecptable. A positive
value will deduct points from the players total whereas
a negative one will give the player creation points.
"items": ["jeans", "tshirt", "sneakers"], <-- This list contains the items
a character will start with
if they choose this
profession.
"addictions" : [ <-- This is the OPTIONAL list of starting addictions.
{
"type": "nicotine", <-- The identifier of the addiction.
"intensity" : 10, <-- The intensity of the addiction.
}
],
"skills" : [ <-- This list is also OPTIONAL; it contains the starting
skills and their modified levels.
{
"name": "melee", <-- The identifier of the skill that will be modified.
"level" : 1 <-- The value that the skill will be modified; note that
this is NOT the starting level of the skill. It is
the value that the player's starting level will be
modified by. In other words, if the player puts 1
point into melee to give themselves level 2 melee,
taking this profession would add one additional level
resulting in level 3.
},
{
"name" : "dodge",
"level" : 1
}, <-- It is possible to list multiple skills for a single profession;
it's an unused feature in the current game.
]
},
]
1.2 Example of adding a profession.
Let's say we want to add a survivalist profession; this profession represents a
character who was already living off the land before the disaster struck. We'll
say this profession starts with archery, survival, traps, beef jerky
and a few survival items. We'll set the starting cost at 3 points since
it modifies skills and items. We could do that with the
following entries:
{
"ident" : "survivalist"
"name": "Wilderness Survivalist",
"description": "You live off the wild and wander the world; you've never
had\na place to live or items other than what you can
scavenge off the land. People called you crazy; now,
after the disaster, you're the sane one."
"points" : 3,
"items": ["pants_cargo", "boots", "beltrig", "selfbow", "jerky", "arrow_field_point"],
"skills" : [
{
"name": "archery",
"level" : 1
},
{
"name" : "survival",
"level" : 1
},
{
"name" : "traps",
"level" : 1
}
]
},
After adding this to the professions.json file, we should see the new profession
show up in the character creation screen.
1.3 IMPORTANT NOTE on JSON FILES:
The following characters: [ { , } ] : "
are *very* important when adding or modifying the JSON files for technical
reasons. This means a single missing , or [ or } can be the difference between
a working file and a hanging game at startup. Many editors have features
that let you track { [ and ] } to see if they're balanced (ie, have a matching
opposite); Notepad++ is a popular, free editor on Windows that contains
this feature. On Linux, there are a plethora of options, and you probably
already have a preferred one :-).
+84 -17
View File
@@ -20,6 +20,8 @@
# Default
# Release (turn on optimizations)
# make RELEASE=1
# Tiles (uses SDL rather than ncurses)
# make TILES=1
# comment these to toggle them as one sees fit.
@@ -49,16 +51,22 @@ DEBUG = -g
#DEFINES += -DDEBUG_ENABLE_MAP_GEN
#DEFINES += -DDEBUG_ENABLE_GAME
VERSION = 0.5
VERSION = 0.7.1
TARGET = cataclysm
TILESTARGET = cataclysm-tiles
W32TILESTARGET = cataclysm-tiles.exe
W32TARGET = cataclysm.exe
BINDIST_DIR = bindist
BUILD_DIR = $(CURDIR)
# tiles object directories are because gcc gets confused
# when preprocessor defines change, but the source doesn't
ODIR = obj
ODIRTILES = obj/tiles
W32ODIR = objwin
W32ODIRTILES = objwin/tiles
DDIR = .deps
OS = $(shell uname -o)
@@ -73,11 +81,11 @@ endif
CXXFLAGS += $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS) -MMD
BINDIST_EXTRAS = README data cataclysm-launcher
BINDIST_EXTRAS = README data
BINDIST = cataclysmdda-$(VERSION).tar.gz
W32BINDIST = cataclysmdda-$(VERSION).zip
BINDIST_CMD = tar -czvf $(BINDIST) $(BINDIST_DIR)
W32BINDIST_CMD = zip -r $(W32BINDIST) $(BINDIST_DIR)
BINDIST_CMD = tar --transform=s@^$(BINDIST_DIR)@cataclysmdda-$(VERSION)@ -czvf $(BINDIST) $(BINDIST_DIR)
W32BINDIST_CMD = cd $(BINDIST_DIR) && zip -r ../$(W32BINDIST) * && cd $(BUILD_DIR)
# is this section even being used anymore?
# SOMEBODY PLEASE CHECK
@@ -97,19 +105,27 @@ endif
# Linux 64-bit
ifeq ($(NATIVE), linux64)
CXXFLAGS += -m64
LDFLAGS += -m64
TARGETSYSTEM=LINUX
else
# Linux 32-bit
ifeq ($(NATIVE), linux32)
CXXFLAGS += -m32
LDFLAGS += -m32
TARGETSYSTEM=LINUX
endif
endif
# OSX
ifeq ($(NATIVE), osx)
CXXFLAGS += -mmacosx-version-min=10.6
OSX_MIN = 10.5
DEFINES += -DMACOSX
CXXFLAGS += -mmacosx-version-min=$(OSX_MIN)
LDFLAGS += -lintl
TARGETSYSTEM=LINUX
ifneq ($(OS), GNU/Linux)
BINDIST_CMD = tar -s"@^$(BINDIST_DIR)@cataclysmdda-$(VERSION)@" -czvf $(BINDIST) $(BINDIST_DIR)
endif
endif
# Win32 (mingw32?)
@@ -119,29 +135,77 @@ endif
# MXE cross-compile to win32
ifneq (,$(findstring mingw32,$(CROSS)))
DEFINES += -DCROSS_LINUX
TARGETSYSTEM=WINDOWS
endif
# Global settings for Linux targets
ifeq ($(TARGETSYSTEM),LINUX)
LDFLAGS += -lncurses
endif
# Global settings for Windows targets
ifeq ($(TARGETSYSTEM),WINDOWS)
TARGET = $(W32TARGET)
BINDIST = $(W32BINDIST)
BINDIST_CMD = $(W32BINDIST_CMD)
ODIR = $(W32ODIR)
LDFLAGS += -static -lgdi32
LDFLAGS += -static -lgdi32 -lintl -liconv
W32FLAGS += -Wl,-stack,12000000,-subsystem,windows
endif
ifdef TILES
ifeq ($(NATIVE),osx)
ifdef FRAMEWORK
DEFINES += -DOSX_SDL_FW
OSX_INC = -F/Library/Frameworks \
-F$(HOME)/Library/Frameworks \
-I/Library/Frameworks/SDL.framework/Headers \
-I$(HOME)/Library/Frameworks/SDL.framework/Headers \
-I/Library/Frameworks/SDL_ttf.framework/Headers \
-I$(HOME)/Library/Frameworks/SDL_ttf.framework/Headers
LDFLAGS += -F/Library/Frameworks \
-F$(HOME)/Library/Frameworks \
-framework SDL -framework SDL_ttf -framework Cocoa
CXXFLAGS += $(OSX_INC)
else
DEFINES += -DOSX_SDL_LIBS
CXXFLAGS += $(shell sdl-config --cflags)
LDFLAGS += $(shell sdl-config --libs) -lSDL_ttf
endif
else
LDFLAGS += -lSDL -lSDL_ttf -lfreetype -lz
endif
DEFINES += -DTILES
ifeq ($(TARGETSYSTEM),WINDOWS)
LDFLAGS += -lgdi32 -ldxguid -lwinmm
TARGET = $(W32TILESTARGET)
ODIR = $(W32ODIRTILES)
else
TARGET = $(TILESTARGET)
ODIR = $(ODIRTILES)
endif
else
# Link to ncurses if we're using a non-tiles, Linux build
ifeq ($(TARGETSYSTEM),LINUX)
LDFLAGS += -lncursesw
# Work around Cygwin not including gettext support in glibc
ifeq ($(shell sh -c 'uname -o 2>/dev/null || echo not'),Cygwin)
LDFLAGS += -lintl -liconv
endif
endif
endif
ifeq ($(TARGETSYSTEM),LINUX)
BINDIST_EXTRAS += cataclysm-launcher
endif
SOURCES = $(wildcard *.cpp)
HEADERS = $(wildcard *.h)
_OBJS = $(SOURCES:.cpp=.o)
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
ifdef TILES
ifeq ($(NATIVE),osx)
OBJS += $(ODIR)/SDLMain.o
endif
endif
all: version $(TARGET)
@
@@ -152,13 +216,13 @@ $(TARGET): $(ODIR) $(DDIR) $(OBJS)
.PHONY: version
version:
@( VERSION_STRING=$(VERSION) ; \
[ -e ".git" ] && GITVERSION=$$( git describe --tags --always --dirty ) && VERSION_STRING=$$GITVERSION ; \
[ -e ".git" ] && GITVERSION=$$( git describe --tags --always --dirty --match "[0-9]*.[0-9]*" ) && VERSION_STRING=$$GITVERSION ; \
[ -e "version.h" ] && OLDVERSION=$$(grep VERSION version.h|cut -d '"' -f2) ; \
if [ "x$$VERSION_STRING" != "x$$OLDVERSION" ]; then echo "#define VERSION \"$$VERSION_STRING\"" | tee version.h ; fi \
)
$(ODIR):
mkdir $(ODIR)
mkdir -p $(ODIR)
$(DDIR):
@mkdir $(DDIR)
@@ -166,12 +230,15 @@ $(DDIR):
$(ODIR)/%.o: %.cpp
$(CXX) $(DEFINES) $(CXXFLAGS) -c $< -o $@
$(ODIR)/SDLMain.o: SDLMain.m
$(CC) -c $(OSX_INC) $< -o $@
version.cpp: version
clean: clean-tests
rm -f $(TARGET) $(W32TARGET) $(ODIR)/*.o $(ODIR)/*.d $(W32ODIR)/*.o $(W32BINDIST) \
$(BINDIST)
rm -rf $(BINDIST_DIR)
rm -rf $(TARGET) $(TILESTARGET) $(W32TILESTARGET) $(W32TARGET)
rm -rf $(ODIR) $(W32ODIR) $(W32ODIRTILES)
rm -rf $(BINDIST) $(W32BINDIST) $(BINDIST_DIR)
rm -f version.h
bindist: $(BINDIST)
+8
View File
@@ -13,6 +13,7 @@ DDIR = .deps
TARGET = cataclysm.exe
CXX = g++
WNDRES = windres
LINKER = i486-mingw32-ld
LINKERFLAGS = -Wl,-stack,12000000,-subsystem,windows
@@ -20,6 +21,7 @@ LINKERFLAGS = -Wl,-stack,12000000,-subsystem,windows
CFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS)
LDFLAGS = -static -lgdi32
RFLAGS = -J rc -O coff
#ifeq ($(OS), Msys)
#LDFLAGS = -static -lpdcurses
@@ -29,6 +31,8 @@ LDFLAGS = -static -lgdi32
SOURCES = $(wildcard *.cpp)
_OBJS = $(SOURCES:.cpp=.o)
RSRC = $(wildcard *.rc)
_OBJS += $(RSRC:.rc=.res)
OBJS = $(patsubst %,$(ODIR)/%,$(_OBJS))
all: $(TARGET)
@@ -46,7 +50,11 @@ $(DDIR):
$(ODIR)/%.o: %.cpp
$(CXX) $(CFLAGS) -c $< -o $@
$(ODIR)/%.res: %.rc
$(WNDRES) $(RFLAGS) $< -o $@
clean:
rm -f $(TARGET) $(ODIR)/*.o
-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)
+3 -3
View File
@@ -20,7 +20,7 @@ The latest instructions on how to compile can be found on [our wiki](http://www.
## Contribute
Please see [CONTRIBUTING.md](https://github.com/TheDarklingWolf/Cataclysm-DDA/blob/master/CONTRIBUTING.md) for details.
Please see [CONTRIBUTING.md](https://github.com/CleverRaven/Cataclysm-DDA/blob/master/CONTRIBUTING.md) for details.
## Frequently Asked Questions
@@ -35,8 +35,8 @@ Press the `?` key, followed by the `1` key to see the full list of key commands.
#### How can I start a new world?
Simply delete the **save** folder, which can be found in the same directory as the executable.
**Reset** on the main menu will generate a fresh world for you.
#### I've found a bug / I would like to make a suggestion. What should I do?
Please submit an issue on [our GitHub page](https://github.com/TheDarklingWolf/Cataclysm-DDA/issues/). If you're not able to, send an email to `TheDarklingWolf@gmail.com`.
Please submit an issue on [our GitHub page](https://github.com/CleverRaven/Cataclysm-DDA/issues/). If you're not able to, send an email to `TheDarklingWolf@gmail.com`.
+16
View File
@@ -0,0 +1,16 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#ifndef _SDLMain_h_
#define _SDLMain_h_
#import <Cocoa/Cocoa.h>
@interface SDLMain : NSObject
@end
#endif /* _SDLMain_h_ */
+385
View File
@@ -0,0 +1,385 @@
/* SDLMain.m - main entry point for our Cocoa-ized SDL app
Initial Version: Darrell Walisser <dwaliss1@purdue.edu>
Non-NIB-Code & other changes: Max Horn <max@quendi.de>
Feel free to customize this file to suit your needs
*/
#if (defined OSX_SDL_FW)
#include "SDL.h"
#else
#include "SDL/SDL.h"
#endif
#include "SDLMain.h"
#include <sys/param.h> /* for MAXPATHLEN */
#include <unistd.h>
/* For some reaon, Apple removed setAppleMenu from the headers in 10.4,
but the method still is there and works. To avoid warnings, we declare
it ourselves here. */
@interface NSApplication(SDL_Missing_Methods)
- (void)setAppleMenu:(NSMenu *)menu;
@end
/* Use this flag to determine whether we use SDLMain.nib or not */
#define SDL_USE_NIB_FILE 0
/* Use this flag to determine whether we use CPS (docking) or not */
#define SDL_USE_CPS 1
#ifdef SDL_USE_CPS
/* Portions of CPS.h */
typedef struct CPSProcessSerNum
{
UInt32 lo;
UInt32 hi;
} CPSProcessSerNum;
extern OSErr CPSGetCurrentProcess( CPSProcessSerNum *psn);
extern OSErr CPSEnableForegroundOperation( CPSProcessSerNum *psn, UInt32 _arg2, UInt32 _arg3, UInt32 _arg4, UInt32 _arg5);
extern OSErr CPSSetFrontProcess( CPSProcessSerNum *psn);
#endif /* SDL_USE_CPS */
static int gArgc;
static char **gArgv;
static BOOL gFinderLaunch;
static BOOL gCalledAppMainline = FALSE;
static NSString *getApplicationName(void)
{
const NSDictionary *dict;
NSString *appName = 0;
/* Determine the application name */
dict = (const NSDictionary *)CFBundleGetInfoDictionary(CFBundleGetMainBundle());
if (dict)
appName = [dict objectForKey: @"CFBundleName"];
if (![appName length])
appName = [[NSProcessInfo processInfo] processName];
return appName;
}
#if SDL_USE_NIB_FILE
/* A helper category for NSString */
@interface NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString;
@end
#endif
@interface NSApplication (SDLApplication)
@end
@implementation NSApplication (SDLApplication)
/* Invoked from the Quit menu item */
- (void)terminate:(id)sender
{
/* Post a SDL_QUIT event */
SDL_Event event;
event.type = SDL_QUIT;
SDL_PushEvent(&event);
}
@end
/* The main class of the application, the application's delegate */
@implementation SDLMain
/* Set the working directory to the .app's parent directory */
- (void) setupWorkingDirectory:(BOOL)shouldChdir
{
if (shouldChdir)
{
char parentdir[MAXPATHLEN];
CFURLRef url = CFBundleCopyBundleURL(CFBundleGetMainBundle());
CFURLRef url2 = CFURLCreateCopyDeletingLastPathComponent(0, url);
if (CFURLGetFileSystemRepresentation(url2, 1, (UInt8 *)parentdir, MAXPATHLEN)) {
chdir(parentdir); /* chdir to the binary app's parent */
}
CFRelease(url);
CFRelease(url2);
}
}
#if SDL_USE_NIB_FILE
/* Fix menu to contain the real app name instead of "SDL App" */
- (void)fixMenu:(NSMenu *)aMenu withAppName:(NSString *)appName
{
NSRange aRange;
NSEnumerator *enumerator;
NSMenuItem *menuItem;
aRange = [[aMenu title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[aMenu setTitle: [[aMenu title] stringByReplacingRange:aRange with:appName]];
enumerator = [[aMenu itemArray] objectEnumerator];
while ((menuItem = [enumerator nextObject]))
{
aRange = [[menuItem title] rangeOfString:@"SDL App"];
if (aRange.length != 0)
[menuItem setTitle: [[menuItem title] stringByReplacingRange:aRange with:appName]];
if ([menuItem hasSubmenu])
[self fixMenu:[menuItem submenu] withAppName:appName];
}
}
#else
static void setApplicationMenu(void)
{
/* warning: this code is very odd */
NSMenu *appleMenu;
NSMenuItem *menuItem;
NSString *title;
NSString *appName;
appName = getApplicationName();
appleMenu = [[NSMenu alloc] initWithTitle:@""];
/* Add menu items */
title = [@"About " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(orderFrontStandardAboutPanel:) keyEquivalent:@""];
[appleMenu addItem:[NSMenuItem separatorItem]];
title = [@"Hide " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(hide:) keyEquivalent:@"h"];
menuItem = (NSMenuItem *)[appleMenu addItemWithTitle:@"Hide Others" action:@selector(hideOtherApplications:) keyEquivalent:@"h"];
[menuItem setKeyEquivalentModifierMask:(NSAlternateKeyMask|NSCommandKeyMask)];
[appleMenu addItemWithTitle:@"Show All" action:@selector(unhideAllApplications:) keyEquivalent:@""];
[appleMenu addItem:[NSMenuItem separatorItem]];
title = [@"Quit " stringByAppendingString:appName];
[appleMenu addItemWithTitle:title action:@selector(terminate:) keyEquivalent:@"q"];
/* Put menu into the menubar */
menuItem = [[NSMenuItem alloc] initWithTitle:@"" action:nil keyEquivalent:@""];
[menuItem setSubmenu:appleMenu];
[[NSApp mainMenu] addItem:menuItem];
/* Tell the application object that this is now the application menu */
[NSApp setAppleMenu:appleMenu];
/* Finally give up our references to the objects */
[appleMenu release];
[menuItem release];
}
/* Create a window menu */
static void setupWindowMenu(void)
{
NSMenu *windowMenu;
NSMenuItem *windowMenuItem;
NSMenuItem *menuItem;
windowMenu = [[NSMenu alloc] initWithTitle:@"Window"];
/* "Minimize" item */
menuItem = [[NSMenuItem alloc] initWithTitle:@"Minimize" action:@selector(performMiniaturize:) keyEquivalent:@"m"];
[windowMenu addItem:menuItem];
[menuItem release];
/* Put menu into the menubar */
windowMenuItem = [[NSMenuItem alloc] initWithTitle:@"Window" action:nil keyEquivalent:@""];
[windowMenuItem setSubmenu:windowMenu];
[[NSApp mainMenu] addItem:windowMenuItem];
/* Tell the application object that this is now the window menu */
[NSApp setWindowsMenu:windowMenu];
/* Finally give up our references to the objects */
[windowMenu release];
[windowMenuItem release];
}
/* Replacement for NSApplicationMain */
static void CustomApplicationMain (int argc, char **argv)
{
NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];
SDLMain *sdlMain;
/* Ensure the application object is initialised */
[NSApplication sharedApplication];
#ifdef SDL_USE_CPS
{
CPSProcessSerNum PSN;
/* Tell the dock about us */
if (!CPSGetCurrentProcess(&PSN))
if (!CPSEnableForegroundOperation(&PSN,0x03,0x3C,0x2C,0x1103))
if (!CPSSetFrontProcess(&PSN))
[NSApplication sharedApplication];
}
#endif /* SDL_USE_CPS */
/* Set up the menubar */
[NSApp setMainMenu:[[NSMenu alloc] init]];
setApplicationMenu();
setupWindowMenu();
/* Create SDLMain and make it the app delegate */
sdlMain = [[SDLMain alloc] init];
[NSApp setDelegate:sdlMain];
/* Start the main event loop */
[NSApp run];
[sdlMain release];
[pool release];
}
#endif
/*
* Catch document open requests...this lets us notice files when the app
* was launched by double-clicking a document, or when a document was
* dragged/dropped on the app's icon. You need to have a
* CFBundleDocumentsType section in your Info.plist to get this message,
* apparently.
*
* Files are added to gArgv, so to the app, they'll look like command line
* arguments. Previously, apps launched from the finder had nothing but
* an argv[0].
*
* This message may be received multiple times to open several docs on launch.
*
* This message is ignored once the app's mainline has been called.
*/
- (BOOL)application:(NSApplication *)theApplication openFile:(NSString *)filename
{
const char *temparg;
size_t arglen;
char *arg;
char **newargv;
if (!gFinderLaunch) /* MacOS is passing command line args. */
return FALSE;
if (gCalledAppMainline) /* app has started, ignore this document. */
return FALSE;
temparg = [filename UTF8String];
arglen = SDL_strlen(temparg) + 1;
arg = (char *) SDL_malloc(arglen);
if (arg == NULL)
return FALSE;
newargv = (char **) realloc(gArgv, sizeof (char *) * (gArgc + 2));
if (newargv == NULL)
{
SDL_free(arg);
return FALSE;
}
gArgv = newargv;
SDL_strlcpy(arg, temparg, arglen);
gArgv[gArgc++] = arg;
gArgv[gArgc] = NULL;
return TRUE;
}
/* Called when the internal event loop has just started running */
- (void) applicationDidFinishLaunching: (NSNotification *) note
{
int status;
/* Set the working directory to the .app's parent directory */
[self setupWorkingDirectory:gFinderLaunch];
#if SDL_USE_NIB_FILE
/* Set the main menu to contain the real app name instead of "SDL App" */
[self fixMenu:[NSApp mainMenu] withAppName:getApplicationName()];
#endif
/* Hand off to main application code */
gCalledAppMainline = TRUE;
status = SDL_main (gArgc, gArgv);
/* We're done, thank you for playing */
exit(status);
}
@end
@implementation NSString (ReplaceSubString)
- (NSString *)stringByReplacingRange:(NSRange)aRange with:(NSString *)aString
{
unsigned int bufferSize;
unsigned int selfLen = [self length];
unsigned int aStringLen = [aString length];
unichar *buffer;
NSRange localRange;
NSString *result;
bufferSize = selfLen + aStringLen - aRange.length;
buffer = (unichar *)NSAllocateMemoryPages(bufferSize*sizeof(unichar));
/* Get first part into buffer */
localRange.location = 0;
localRange.length = aRange.location;
[self getCharacters:buffer range:localRange];
/* Get middle part into buffer */
localRange.location = 0;
localRange.length = aStringLen;
[aString getCharacters:(buffer+aRange.location) range:localRange];
/* Get last part into buffer */
localRange.location = aRange.location + aRange.length;
localRange.length = selfLen - localRange.location;
[self getCharacters:(buffer+aRange.location+aStringLen) range:localRange];
/* Build output string */
result = [NSString stringWithCharacters:buffer length:bufferSize];
NSDeallocateMemoryPages(buffer, bufferSize);
return result;
}
@end
#ifdef main
# undef main
#endif
/* Main entry point to executable - should *not* be SDL_main! */
int main (int argc, char **argv)
{
/* Copy the arguments into a global variable */
/* This is passed if we are launched by double-clicking */
if ( argc >= 2 && strncmp (argv[1], "-psn", 4) == 0 ) {
gArgv = (char **) SDL_malloc(sizeof (char *) * 2);
gArgv[0] = argv[0];
gArgv[1] = NULL;
gArgc = 1;
gFinderLaunch = YES;
} else {
int i;
gArgc = argc;
gArgv = (char **) SDL_malloc(sizeof (char *) * (argc+1));
for (i = 0; i <= argc; i++)
gArgv[i] = argv[i];
gFinderLaunch = NO;
}
#if SDL_USE_NIB_FILE
NSApplicationMain (argc, argv);
#else
CustomApplicationMain (argc, argv);
#endif
return 0;
}
+12
View File
@@ -15,4 +15,16 @@ Jason Gilbert <0jason.gilbert@gmail.com>
Charlie Nolan (FunnyMan3595) <funnyman3595@gmail.com>
uzername (some_name) <ivanpost777@gmail.com>
Christian Buskirk (i2amroy) <i2amroy@gmail.com>
Kevin McKayven (GlyphGryph) <glyphgryph@gmail.com>
Ozone <satori.jj@gmail.com>
Herbert Jones <jones.herbert@gmail.com>
Justin "MacrosBlackD" Drury <macrosblackd@gmail.com>
AtomicDryad <fnord@fnord> / <atomicdryad@gmail.com>
Izicata
Voker57 <voker57@gmail.com>
Tommy <yobbobanana@gmx.com>
teh-sam
Alex Casey (Tamunshin) <tamunshin@hotmail.com>
Stevensonz <money3030@yahoo.com.>
David Holmes <dholmes@dholmes.us>
Sean McLaughlin <galenevil@hotmail.com> / <galenevil.eve@gmail.com>
+92
View File
@@ -0,0 +1,92 @@
Info on translating Cataclysm-DDA into another language.
TRANSLATORS
===========
If there is already a translation available for your language,
and you just want to update or improve it,
you can edit the .po file for your language,
found inside the "lang/po" subdirectory.
After editing this file,
if you are running the dev version and want to test your changes,
perform step 4 from the maintainers section below.
If there is no translation yet,
the .po file will need to be generated.
You can do this yourself by following the instructions below,
or ask one of the CleverRaven devs to do it for you.
When you are done translating,
submit the changes back to CleverRaven for inclusion in Cataclysm-DDA.
MAINTAINERS
===========
Step 1: Extract the translatable strings
----------------------------------------
First we have to extract the translatable strings from the .json files.
The python script lang/extract_json_strings.py will do this for us,
storing them in an intermediate form in lang/json for "xgettext" to read.
python lang/extract_json_strings.py
Now we can use xgettext to collate all the translatable strings,
and store them in the file lang/po/cataclysm-dda.pot.
This needs to be done every time translatable strings are added or modified.
All of the translations depend on this file.
xgettext -d cataclysm-dda -s -o lang/po/cataclysm-dda.pot --keyword=_ *.cpp *.h lang/json/*.py
Step 2(a): Initialize each language file
----------------------------------------
If we're starting a new translation from scratch,
we have to initialize the translation file.
In this example the translation is into New Zealand English (en_NZ).
For other languages change "en_NZ" to the relevant language identifier.
msginit -l en_NZ.utf8 -o lang/po/en_NZ.po -i lang/po/cataclysm-dda.pot
Step 2(b): Update an already existing language file
---------------------------------------------------
If we just want to update a translation,
we'll want to keep all the messages that have already been translated.
In this case we use "msgmerge" in stead of "msginit".
msgmerge -s -U lang/po/en_NZ.po lang/po/cataclysm-dda.pot
Step 3: Translate
-----------------
Now open the .po file in your favorite editor and translate!
The lines beginning with "msgid" must be left in the english form,
only the lines beginning with "msgstr" should be translated.
Step 4: Compile the .po file
----------------------------
If it is a new translation,
you will need to create a subdirectory in lang/mo for it,
and then a subdirectory called "LC_MESSAGES" inside that.
For example:
mkdir -p lang/mo/en_NZ/LC_MESSAGES
Now run the "msgfmt" program to compile the translations for use in game.
msgfmt -c -o lang/mo/en_NZ/LC_MESSAGES/cataclysm-dda.mo lang/po/en_NZ.po
Hooray, that's it :).
+57 -9
View File
@@ -1,9 +1,20 @@
#include "game.h"
#include "keypress.h"
#include "output.h"
#include <istream>
#include <sstream>
#include <fstream>
void parse_keymap(std::istream &keymap_txt, std::map<char, action_id> &kmap);
void game::load_keyboard_settings()
{
// Load the default keymap
std::istringstream sin;
sin.str(default_keymap_txt());
parse_keymap(sin, default_keymap);
// Load the player's actual keymap
std::ifstream fin;
fin.open("data/keymap.txt");
if (!fin) { // It doesn't exist
@@ -15,13 +26,37 @@ void game::load_keyboard_settings()
}
if (!fin) { // Still can't open it--probably bad permissions
debugmsg("Can't open data/keymap.txt. This may be a permissions issue.");
keymap = default_keymap;
return;
} else {
parse_keymap(fin, keymap);
}
while (!fin.eof()) {
// Check for new defaults, and automatically bind them if possible
std::map<char, action_id>::iterator d_it;
bool found;
for (d_it = default_keymap.begin(); d_it != default_keymap.end(); d_it++) {
found = false;
std::map<char, action_id>::iterator k_it;
for (k_it = keymap.begin(); k_it != keymap.end(); k_it++) {
if (d_it->second == k_it->second) {
found = true;
break;
}
}
if (!found && !keymap.count(d_it->first)) {
keymap[d_it->first] = d_it->second;
}
}
}
void parse_keymap(std::istream &keymap_txt, std::map<char, action_id> &kmap)
{
while (!keymap_txt.eof()) {
std::string id;
fin >> id;
keymap_txt >> id;
if (id == "")
getline(fin, id); // Empty line, chomp it
getline(keymap_txt, id); // Empty line, chomp it
else if (id[0] != '#') {
action_id act = look_up_action(id);
if (act == ACTION_NULL)
@@ -29,25 +64,25 @@ void game::load_keyboard_settings()
Warning! data/keymap.txt contains an unknown action, \"%s\"\n\
Fix data/keymap.txt at your next chance!", id.c_str());
else {
while (!fin.eof()) {
while (!keymap_txt.eof()) {
char ch;
fin >> std::noskipws >> ch >> std::skipws;
keymap_txt >> std::noskipws >> ch >> std::skipws;
if (ch == '\n') {
break;
} else if (ch != ' ' || fin.peek() == '\n') {
if (keymap.find(ch) != keymap.end()) {
} else if (ch != ' ' || keymap_txt.peek() == '\n') {
if (kmap.find(ch) != kmap.end()) {
debugmsg("\
Warning! '%c' assigned twice in the keymap!\n\
%s is being ignored.\n\
Fix data/keymap.txt at your next chance!", ch, id.c_str());
} else {
keymap[ ch ] = act;
kmap[ ch ] = act;
}
}
}
}
} else {
getline(fin, id); // Clear the whole line
getline(keymap_txt, id); // Clear the whole line
}
}
}
@@ -196,6 +231,8 @@ std::string action_ident(action_id act)
return "drop_adj";
case ACTION_BIONICS:
return "bionics";
case ACTION_SORT_ARMOR:
return "sort_armor";
case ACTION_WAIT:
return "wait";
case ACTION_CRAFT:
@@ -210,6 +247,8 @@ std::string action_ident(action_id act)
return "disassemble";
case ACTION_SLEEP:
return "sleep";
case ACTION_CONTROL_VEHICLE:
return "control_vehicle";
case ACTION_TOGGLE_SAFEMODE:
return "safemode";
case ACTION_TOGGLE_AUTOSAFE:
@@ -218,6 +257,8 @@ std::string action_ident(action_id act)
return "ignore_enemy";
case ACTION_SAVE:
return "save";
case ACTION_QUICKSAVE:
return "quicksave";
case ACTION_QUIT:
return "quit";
case ACTION_PL_INFO:
@@ -366,6 +407,8 @@ std::string action_name(action_id act)
return "Drop Item to Adjacent Tile";
case ACTION_BIONICS:
return "View/Activate Bionics";
case ACTION_SORT_ARMOR:
return "Re-layer armour/clothing";
case ACTION_WAIT:
return "Wait for Several Minutes";
case ACTION_CRAFT:
@@ -380,6 +423,8 @@ std::string action_name(action_id act)
return "Disassemble items";
case ACTION_SLEEP:
return "Sleep";
case ACTION_CONTROL_VEHICLE:
return "Control Vehicle";
case ACTION_TOGGLE_SAFEMODE:
return "Toggle Safemode";
case ACTION_TOGGLE_AUTOSAFE:
@@ -388,6 +433,8 @@ std::string action_name(action_id act)
return "Ignore Nearby Enemy";
case ACTION_SAVE:
return "Save and Quit";
case ACTION_QUICKSAVE:
return "Quicksave";
case ACTION_QUIT:
return "Commit Suicide";
case ACTION_PL_INFO:
@@ -417,3 +464,4 @@ std::string action_name(action_id act)
}
return "Someone forgot to name an action.";
}
+3
View File
@@ -58,6 +58,7 @@ ACTION_SELECT_FIRE_MODE,
ACTION_DROP,
ACTION_DIR_DROP,
ACTION_BIONICS,
ACTION_SORT_ARMOR,
// Long-term / special actions
ACTION_WAIT,
ACTION_CRAFT,
@@ -66,10 +67,12 @@ ACTION_LONGCRAFT,
ACTION_CONSTRUCT,
ACTION_DISASSEMBLE,
ACTION_SLEEP,
ACTION_CONTROL_VEHICLE,
ACTION_TOGGLE_SAFEMODE,
ACTION_TOGGLE_AUTOSAFE,
ACTION_IGNORE_ENEMY,
ACTION_SAVE,
ACTION_QUICKSAVE,
ACTION_QUIT,
// Info Screens
ACTION_PL_INFO,
+22 -8
View File
@@ -28,7 +28,7 @@ void addict_effect(game *g, addiction &add)
g->u.stim--;
if (rng(8, 400) < in) {
g->add_msg("Your hands start shaking... you need it bad!");
g->u.add_disease(DI_SHAKES, 20, g);
g->u.add_disease("shakes", 20);
}
}
break;
@@ -46,9 +46,9 @@ void addict_effect(game *g, addiction &add)
g->add_msg("Your hands start shaking... you need a drink bad!");
g->cancel_activity_query("You have an alcohol craving.");
g->u.add_morale(MORALE_CRAVING_ALCOHOL, -35, -120);
g->u.add_disease(DI_SHAKES, 50, g);
} else if (!g->u.has_disease(DI_HALLU) && rng(10, 1600) < in)
g->u.add_disease(DI_HALLU, 3600, g);
g->u.add_disease("shakes", 50);
} else if (!g->u.has_disease("hallu") && rng(10, 1600) < in)
g->u.add_disease("hallu", 3600);
break;
case ADD_SLEEP:
@@ -75,7 +75,7 @@ void addict_effect(game *g, addiction &add)
g->add_msg("Your hands start shaking... you need some painkillers.");
g->cancel_activity_query("You have an opiate craving.");
g->u.add_morale(MORALE_CRAVING_OPIATE, -40, -200);
g->u.add_disease(DI_SHAKES, 20 + in * 5, g);
g->u.add_disease("shakes", 20 + in * 5);
} else if (one_in(20) && dice(2, 30) < in) {
g->add_msg("You feel anxious. You need your painkillers!");
g->u.add_morale(MORALE_CRAVING_OPIATE, -30, -200);
@@ -107,14 +107,14 @@ void addict_effect(game *g, addiction &add)
g->add_msg("Your hands start shaking... you need a pick-me-up.");
g->cancel_activity_query("You have a speed craving.");
g->u.add_morale(MORALE_CRAVING_SPEED, -25, -200);
g->u.add_disease(DI_SHAKES, in * 20, g);
g->u.add_disease("shakes", in * 20);
} else if (one_in(50) && dice(2, 100) < in) {
g->add_msg("You stop suddenly, feeling bewildered.");
g->cancel_activity();
g->u.moves -= 300;
} else if (!g->u.has_disease(DI_HALLU) && one_in(20) &&
} else if (!g->u.has_disease("hallu") && one_in(20) &&
8 + dice(2, 80) < in)
g->u.add_disease(DI_HALLU, 3600, g);
g->u.add_disease("hallu", 3600);
} break;
case ADD_COKE:
@@ -165,6 +165,20 @@ std::string addiction_name(addiction cur)
}
}
morale_type addiction_craving(add_type cur)
{
switch (cur) {
case ADD_CIG: return MORALE_CRAVING_NICOTINE;
case ADD_CAFFEINE: return MORALE_CRAVING_CAFFEINE;
case ADD_ALCOHOL: return MORALE_CRAVING_ALCOHOL;
case ADD_PKILLER: return MORALE_CRAVING_OPIATE;
case ADD_SPEED: return MORALE_CRAVING_SPEED;
case ADD_COKE: return MORALE_CRAVING_COCAINE;
case ADD_CRACK: return MORALE_CRAVING_CRACK;
default: return MORALE_NULL;
}
}
add_type addiction_type(std::string name)
{
if (name == "nicotine")
+2
View File
@@ -12,6 +12,8 @@ void addict_effect(game *g, addiction &add);
std::string addiction_name(addiction cur);
morale_type addiction_craving(add_type cur);
add_type addiction_type(std::string name);
std::string addiction_text(addiction cur);
+63 -57
View File
@@ -225,78 +225,78 @@ artifact_property_datum artifact_property_data[ARTPROP_MAX] = {
};
artifact_tool_form_datum artifact_tool_form_data[NUM_ARTTOOLFORMS] = {
{"", '*', c_white, MNULL, MNULL, 0, 0, 0, 0, ARTWEAP_BULK,
{"", '*', c_white, "null", "null", 0, 0, 0, 0, ARTWEAP_BULK,
{ARTWEAP_NULL, ARTWEAP_NULL, ARTWEAP_NULL}},
{"Harp", ';', c_yellow, WOOD, MNULL, 20, 30, 10, 18, ARTWEAP_BULK,
{"Harp", ';', c_yellow, "wood", "null", 20, 30, 10, 18, ARTWEAP_BULK,
{ARTWEAP_SPEAR, ARTWEAP_SWORD, ARTWEAP_KNIFE}},
{"Staff", '/', c_brown, WOOD, MNULL, 6, 12, 4, 10, ARTWEAP_CLUB,
{"Staff", '/', c_brown, "wood", "null", 6, 12, 4, 10, ARTWEAP_CLUB,
{ARTWEAP_BULK, ARTWEAP_SPEAR, ARTWEAP_KNIFE}},
{"Sword", '/', c_ltblue, STEEL, MNULL, 8, 14, 8, 28, ARTWEAP_SWORD,
{"Sword", '/', c_ltblue, "steel", "null", 8, 14, 8, 28, ARTWEAP_SWORD,
{ARTWEAP_BULK, ARTWEAP_NULL, ARTWEAP_NULL}},
{"Dagger", ';', c_ltblue, STEEL, MNULL, 1, 4, 1, 6, ARTWEAP_KNIFE,
{"Dagger", ';', c_ltblue, "steel", "null", 1, 4, 1, 6, ARTWEAP_KNIFE,
{ARTWEAP_NULL, ARTWEAP_NULL, ARTWEAP_NULL}},
{"Cube", '*', c_white, STEEL, MNULL, 1, 3, 1, 20, ARTWEAP_BULK,
{"Cube", '*', c_white, "steel", "null", 1, 3, 1, 20, ARTWEAP_BULK,
{ARTWEAP_SPEAR, ARTWEAP_NULL, ARTWEAP_NULL}}
};
artifact_weapon_datum artifact_weapon_data[NUM_ARTWEAPS] = {
{"", 0, 0, 0, 0, 0, 0, 0, 0, 0},
{"", 0, 0, 0, 0, 0, 0, 0, 0, ""},
// Adjective Vol,wgt Bash Cut To-Hit
{"Heavy", 0, 12, 10, 20, 0, 0, -2, 0,
0},
""},
{"Knobbed", 1, 2, 14, 30, 0, 0, -1, 1,
0},
""},
{"Spiked", 1, 1, 0, 0, 20, 40, -1, 1,
mfb(IF_SPEAR)},
"SPEAR"},
{"Edged", 2, 4, 0, 0, 20, 50, -1, 2,
0},
""},
{"Bladed", 1, 2, 0, 0, 12, 30, -1, 1,
mfb(IF_STAB)}
"STAB"}
};
artifact_armor_form_datum artifact_armor_form_data[NUM_ARTARMFORMS] = {
{"", c_white, MNULL, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
{"", c_white, "null", "null", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, false,
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
// Name color Materials Vol Wgt Enc Dmg Cut Env Wrm Sto Bsh Cut Hit
{"Robe", c_red, WOOL, MNULL, 6, 6, 1, 3, 1, 0, 2, 0, -8, 0, -3,
// Name color Materials Vol Wgt Enc Cov Thk Env Wrm Sto Bsh Cut Hit
{"Robe", c_red, "wool", "null", 6, 6, 1, 3, 3, 0, 2, 0, -8, 0, -3,
mfb(bp_torso)|mfb(bp_legs), false,
{ARMORMOD_LIGHT, ARMORMOD_BULKY, ARMORMOD_POCKETED, ARMORMOD_FURRED,
ARMORMOD_PADDED}},
{"Coat", c_brown,LEATHER,MNULL, 14, 14, 2, 4, 12, 1, 4, 4, -6, 0, -3,
{"Coat", c_brown,"leather","null", 14, 14, 2, 3, 2, 1, 4, 4, -6, 0, -3,
mfb(bp_torso), false,
{ARMORMOD_LIGHT, ARMORMOD_POCKETED, ARMORMOD_FURRED, ARMORMOD_PADDED,
ARMORMOD_PLATED}},
{"Mask", c_white, WOOD, MNULL, 4, 1, 2, 2, 16, 1, 2, 0, 2, 0, -2,
{"Mask", c_white, "wood", "null", 4, 1, 2, 2, 2, 1, 2, 0, 2, 0, -2,
mfb(bp_eyes)|mfb(bp_mouth), false,
{ARMORMOD_FURRED, ARMORMOD_FURRED, ARMORMOD_NULL, ARMORMOD_NULL,
ARMORMOD_NULL}},
// Name color Materials Vol Wgt Enc Dmg Cut Env Wrm Sto Bsh Cut Hit
{"Helm", c_dkgray,SILVER, MNULL, 6, 6, 2, 4, 18, 0, 1, 0, 8, 0, -2,
// Name color Materials Vol Wgt Enc Cov Thk Env Wrm Sto Bsh Cut Hit
{"Helm", c_dkgray, "silver", "null", 6, 6, 2, 3, 3, 0, 1, 0, 8, 0, -2,
mfb(bp_head), false,
{ARMORMOD_BULKY, ARMORMOD_FURRED, ARMORMOD_PADDED, ARMORMOD_PLATED,
ARMORMOD_NULL}},
{"Gloves", c_ltblue,LEATHER,MNULL, 2, 1, 1, 6, 6, 1, 2, 0, -4, 0, -2,
{"Gloves", c_ltblue,"leather","null", 2, 1, 1, 3, 3, 1, 2, 0, -4, 0, -2,
mfb(bp_hands), true,
{ARMORMOD_BULKY, ARMORMOD_FURRED, ARMORMOD_PADDED, ARMORMOD_PLATED,
ARMORMOD_NULL}},
// Name color Materials Vol Wgt Enc Dmg Cut Env Wrm Sto Bsh Cut Hit
{"Boots", c_blue, LEATHER, MNULL, 6, 2, 1, 6, 6, 1, 3, 0, 4, 0, -1,
// Name color Materials Vol Wgt Enc Cov Thk Env Wrm Sto Bsh Cut Hit
{"Boots", c_blue, "leather", "null", 6, 2, 1, 3, 3, 1, 3, 0, 4, 0, -1,
mfb(bp_feet), true,
{ARMORMOD_LIGHT, ARMORMOD_BULKY, ARMORMOD_PADDED, ARMORMOD_PLATED,
ARMORMOD_NULL}},
{"Ring", c_ltgreen, SILVER, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
{"Ring", c_ltgreen, "silver", "null", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
0, true,
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}}
@@ -304,33 +304,33 @@ artifact_armor_form_datum artifact_armor_form_data[NUM_ARTARMFORMS] = {
artifact_armor_form_datum artifact_armor_mod_data[NUM_ARMORMODS] = {
{"", c_white, MNULL, MNULL, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false,
{"", c_white, "null", "null", 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, false,
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
// Description; "It is ..." or "They are ..."
{"very thin and light.", c_white, MNULL, MNULL,
// Vol Wgt Enc Dmg Cut Env Wrm Sto
{"very thin and light.", c_white, "null", "null",
// Vol Wgt Enc Cov Thk Env Wrm Sto
-4, -8, -2, -1, -1, -1, -1, 0, 0, 0, 0, 0, false,
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
{"extremely bulky.", c_white, MNULL, MNULL,
{"extremely bulky.", c_white, "null", "null",
8, 10, 2, 1, 1, 0, 1, 0, 0, 0, 0, 0, false,
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
{"covered in pockets.", c_white, MNULL, MNULL,
{"covered in pockets.", c_white, "null", "null",
1, 1, 1, 0, 0, 0, 0, 16, 0, 0, 0, 0, false,
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
{"disgustingly furry.", c_white, WOOL, MNULL,
{"disgustingly furry.", c_white, "wool", "null",
// Vol Wgt Enc Dmg Cut Env Wrm Sto
4, 2, 1, 4, 0, 1, 3, 0, 0, 0, 0, 0, false,
4, 2, 1, 1, 1, 1, 3, 0, 0, 0, 0, 0, false,
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
{"leather-padded.", c_white, LEATHER, MNULL,
4, 4, 1, 10, 4, 0, 1, -3, 0, 0, 0, 0, false,
{"leather-padded.", c_white, "leather", "null",
4, 4, 1, 1, 1, 0, 1, -3, 0, 0, 0, 0, false,
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
{"plated in iron.", c_white, IRON, MNULL,
4, 12, 3, 8, 14, 0, 1, -4, 0, 0, 0, 0, false,
{"plated in iron.", c_white, "iron", "null",
4, 12, 3, 2, 2, 0, 1, -4, 0, 0, 0, 0, false,
{ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL, ARMORMOD_NULL}},
};
@@ -372,7 +372,9 @@ itype* game::new_artifact()
art->melee_dam = rng(weapon->bash_min, weapon->bash_max);
art->melee_cut = rng(weapon->cut_min, weapon->cut_max);
art->m_to_hit = rng(weapon->to_hit_min, weapon->to_hit_max);
art->item_flags = weapon->flags;
if( weapon->tag != "" ) {
art->item_tags.insert(weapon->tag);
}
// Add an extra weapon perhaps?
if (one_in(2)) {
int select = rng(0, 2);
@@ -383,7 +385,9 @@ itype* game::new_artifact()
art->melee_dam += rng(weapon->bash_min, weapon->bash_max);
art->melee_cut += rng(weapon->bash_min, weapon->bash_max);
art->m_to_hit += rng(weapon->to_hit_min, weapon->to_hit_max);
art->item_flags |= weapon->flags;
if( weapon->tag != "" ) {
art->item_tags.insert(weapon->tag);
}
std::stringstream newname;
newname << weapon->adjective << " " << info->name;
art->name = artifact_name(newname.str());
@@ -503,11 +507,10 @@ It may have unknown powers; use 'a' to activate them.";
art->melee_dam = info->melee_bash;
art->melee_cut = info->melee_cut;
art->m_to_hit = info->melee_hit;
art->item_flags = 0;
art->covers = info->covers;
art->encumber = info->encumb;
art->dmg_resist = info->dmg_resist;
art->cut_resist = info->cut_resist;
art->coverage = info->coverage;
art->thickness = info->thickness;
art->env_resist = info->env_resist;
art->warmth = info->warmth;
art->storage = info->storage;
@@ -534,15 +537,15 @@ It may have unknown powers; use 'a' to activate them.";
art->encumber += modinfo->encumb;
if (modinfo->dmg_resist > 0 || art->dmg_resist > abs(modinfo->dmg_resist))
art->dmg_resist += modinfo->dmg_resist;
if (modinfo->coverage > 0 || art->coverage > abs(modinfo->coverage))
art->coverage += modinfo->coverage;
else
art->dmg_resist = 0;
art->coverage = 0;
if (modinfo->cut_resist > 0 || art->cut_resist > abs(modinfo->cut_resist))
art->cut_resist += modinfo->cut_resist;
if (modinfo->thickness > 0 || art->thickness > abs(modinfo->thickness))
art->thickness += modinfo->thickness;
else
art->cut_resist = 0;
art->thickness = 0;
if (modinfo->env_resist > 0 || art->env_resist > abs(modinfo->env_resist))
art->env_resist += modinfo->env_resist;
@@ -587,8 +590,10 @@ It may have unknown powers; use 'a' to activate them.";
art->effects_worn.push_back(passive_tmp);
}
art->id = itypes.size();
itypes[art->id]=art;
std::stringstream artid;
artid << "artifact" << artifact_itype_ids.size();
art->id = artid.str();
itypes[art->id] = art;
artifact_itype_ids.push_back(art->id);
return art;
}
@@ -609,14 +614,13 @@ itype* game::new_natural_artifact(artifact_natural_property prop)
art->sym = ':';
art->color = c_yellow;
art->m1 = STONE;
art->m2 = MNULL;
art->m1 = "stone";
art->m2 = "null";
art->volume = rng(shape_data->volume_min, shape_data->volume_max);
art->weight = rng(shape_data->weight_min, shape_data->weight_max);
art->melee_dam = 0;
art->melee_cut = 0;
art->m_to_hit = 0;
art->item_flags = 0;
art->name = property_data->name + " " + shape_data->name;
std::stringstream desc;
@@ -702,9 +706,11 @@ itype* game::new_natural_artifact(artifact_natural_property prop)
art->charge_type = art_charge( rng(ARTC_NULL + 1, NUM_ARTCS - 1) );
}
art->id = itypes.size();
std::stringstream artid;
artid << "artifact" << artifact_itype_ids.size();
art->id = artid.str();
artifact_itype_ids.push_back(art->id);
itypes[art->id]=art;
itypes[art->id] = art;
return art;
}
@@ -839,11 +845,11 @@ void game::process_artifact(item *it, player *p, bool wielded)
case AEP_EXTINGUISH:
for (int x = p->posx - 1; x <= p->posx + 1; x++) {
for (int y = p->posy - 1; y <= p->posy + 1; y++) {
if (m.field_at(x, y).type == fd_fire) {
if (m.field_at(x, y).density == 0)
m.remove_field(x, y);
if (m.field_at(x, y).findField(fd_fire)) {
if (m.field_at(x, y).findField(fd_fire)->getFieldDensity() == 0)
m.remove_field(x, y, fd_fire);
else
m.field_at(x, y).density--;
m.field_at(x, y).findField(fd_fire)->setFieldDensity(m.field_at(x, y).findField(fd_fire)->getFieldDensity() - 1);
}
}
}
@@ -861,7 +867,7 @@ void game::process_artifact(item *it, player *p, bool wielded)
case AEP_EVIL:
if (one_in(150)) { // Once every 15 minutes, on average
p->add_disease(DI_EVIL, 300, this);
p->add_disease("evil", 300);
if (!wielded && !it->is_armor())
add_msg("You have an urge to %s the %s.",
(it->is_armor() ? "wear" : "wield"), it->tname().c_str());
+12 -12
View File
@@ -48,8 +48,8 @@ struct artifact_tool_form_datum
std::string name;
char sym;
nc_color color;
material m1;
material m2;
std::string m1;
std::string m2;
int volume_min, volume_max;
int weight_min, weight_max;
artifact_weapon_type base_weapon;
@@ -57,7 +57,7 @@ struct artifact_tool_form_datum
/*
artifact_tool_form_datum
(std::string Name, char Sym, nc_color Color, material M1, material M2,
(std::string Name, char Sym, nc_color Color, std::string M1, std::string M2,
int Volmin, int Volmax, int Wgtmin, int Wgtmax, artifact_weapon_type Base,
artifact_weapon_type extra[3])
: name (Name), sym (Sym), color (Color), m1 (M1), m2 (M2),
@@ -87,7 +87,7 @@ struct artifact_weapon_datum
int bash_min, bash_max;
int cut_min, cut_max;
int to_hit_min, to_hit_max;
unsigned flags : NUM_ITEM_FLAGS;
std::string tag;
};
extern artifact_weapon_datum artifact_weapon_data[NUM_ARTWEAPS];
@@ -108,12 +108,12 @@ struct artifact_armor_form_datum
{
std::string name;
nc_color color;
material m1;
material m2;
std::string m1;
std::string m2;
int volume, weight;
int encumb;
int dmg_resist;
int cut_resist;
int coverage;
int thickness;
int env_resist;
int warmth;
int storage;
@@ -125,13 +125,13 @@ struct artifact_armor_form_datum
/*
// Constructor
artifact_armor_form_datum
(std::string Name, nc_color Color, material M1, material M2, int Volume,
(std::string Name, nc_color Color, std::string M1, std::string M2, int Volume,
int Weight, int Encumb, int Dmg_res, int Cut_res, int Env_res,
int Warmth, int Storage, int Bash, int Cut, int Hit, unsigned char Covers,
bool Plural, artifact_armor_mod Mods[5])
: name (Name), color (Color), m1 (M1), m2 (M2), volume (Volume),
weight (Weight), encumb (Encumb), dmg_resist (Dmg_res),
cut_resist (Cut_res), env_resist (Env_res), warmth (Warmth),
weight (Weight), encumb (Encumb), coverage (Coverage),
thickness (thickness), env_resist (Env_res), warmth (Warmth),
storage (Storage), melee_bash (Bash), melee_cut (Cut), melee_hit (Hit),
covers (Covers), plural (Plural), available_mods (Mods) { };
@@ -154,7 +154,7 @@ enum artifact_armor_form
extern artifact_armor_form_datum artifact_armor_form_data[NUM_ARTARMFORMS];
/* Armor mods alter the normal values of armor.
* If the basic armor type has MNULL as its second material, and the mod has a
* If the basic armor type has "null" as its second material, and the mod has a
* material attached, the second material will be changed.
*/
extern artifact_armor_form_datum artifact_armor_mod_data[NUM_ARMORMODS];
+755
View File
@@ -0,0 +1,755 @@
#include "game.h"
#include "auto_pickup.h"
#include "output.h"
#include "debug.h"
#include "keypress.h"
#include "item_factory.h"
#include <stdlib.h>
#include <fstream>
#include <string>
std::vector<cPickupRules> vAutoPickupRules[5];
void game::show_auto_pickup()
{
save_reset_changes(false);
const int iHeaderHeight = 4;
const int iContentHeight = FULL_SCREEN_HEIGHT-2-iHeaderHeight;
const int iOffsetX = (TERMX > FULL_SCREEN_WIDTH) ? (TERMX-FULL_SCREEN_WIDTH)/2 : 0;
const int iOffsetY = (TERMY > FULL_SCREEN_HEIGHT) ? (TERMY-FULL_SCREEN_HEIGHT)/2 : 0;
std::map<int, bool> mapLines;
mapLines[3] = true;
mapLines[50] = true;
mapLines[54] = true;
//mapLines[61] = true;
//mapLines[68] = true;
const int iTotalCols = mapLines.size()-1;
WINDOW* w_auto_pickup_options = newwin(FULL_SCREEN_HEIGHT/2, FULL_SCREEN_WIDTH/2, iOffsetY + (FULL_SCREEN_HEIGHT/2)/2, iOffsetX + (FULL_SCREEN_WIDTH/2)/2);
WINDOW* w_auto_pickup_help = newwin((FULL_SCREEN_HEIGHT/2)-2, FULL_SCREEN_WIDTH * 3/4, 8 + iOffsetY + (FULL_SCREEN_HEIGHT/2)/2, iOffsetX + 19/2);
WINDOW* w_auto_pickup_border = newwin(FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH, iOffsetY, iOffsetX);
WINDOW* w_auto_pickup_header = newwin(iHeaderHeight, FULL_SCREEN_WIDTH - 2, 1 + iOffsetY, 1 + iOffsetX);
WINDOW* w_auto_pickup = newwin(iContentHeight, FULL_SCREEN_WIDTH - 2, iHeaderHeight + 1 + iOffsetY, 1 + iOffsetX);
wborder(w_auto_pickup_border, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX, LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX);
mvwputch(w_auto_pickup_border, 3, 0, c_ltgray, LINE_XXXO); // |-
mvwputch(w_auto_pickup_border, 3, 79, c_ltgray, LINE_XOXX); // -|
for (std::map<int, bool>::iterator iter = mapLines.begin(); iter != mapLines.end(); ++iter) {
mvwputch(w_auto_pickup_border, FULL_SCREEN_HEIGHT-1, iter->first + 1, c_ltgray, LINE_XXOX); // _|_
}
mvwprintz(w_auto_pickup_border, 0, 29, c_ltred, " AUTO PICKUP MANAGER ");
wrefresh(w_auto_pickup_border);
mvwprintz(w_auto_pickup_header, 0, 0, c_ltgreen, " A");
wprintz(w_auto_pickup_header, c_white, "dd ");
wprintz(w_auto_pickup_header, c_ltgreen, "R");
wprintz(w_auto_pickup_header, c_white, "emove ");
wprintz(w_auto_pickup_header, c_ltgreen, "C");
wprintz(w_auto_pickup_header, c_white, "opy ");
wprintz(w_auto_pickup_header, c_ltgreen, "M");
wprintz(w_auto_pickup_header, c_white, "ove ");
wprintz(w_auto_pickup_header, c_ltgreen, "E");
wprintz(w_auto_pickup_header, c_white, "nable ");
wprintz(w_auto_pickup_header, c_ltgreen, "D");
wprintz(w_auto_pickup_header, c_white, "isable ");
wprintz(w_auto_pickup_header, c_ltgreen, "T");
wprintz(w_auto_pickup_header, c_white, "est ");
mvwprintz(w_auto_pickup_header, 1, 0, c_ltgreen, " +");
wprintz(w_auto_pickup_header, c_white, "/");
wprintz(w_auto_pickup_header, c_ltgreen, "-");
wprintz(w_auto_pickup_header, c_white, " Move up/down ");
wprintz(w_auto_pickup_header, c_ltgreen, "Enter");
wprintz(w_auto_pickup_header, c_white, "-Edit ");
wprintz(w_auto_pickup_header, c_ltgreen, "Tab");
wprintz(w_auto_pickup_header, c_white, "-Switch Page ");
for (int i = 0; i < 78; i++) {
if (mapLines[i]) {
mvwputch(w_auto_pickup_header, 2, i, c_ltgray, LINE_OXXX);
mvwputch(w_auto_pickup_header, 3, i, c_ltgray, LINE_XOXO);
} else {
mvwputch(w_auto_pickup_header, 2, i, c_ltgray, LINE_OXOX); // Draw line under header
}
}
mvwprintz(w_auto_pickup_header, 3, 0, c_white, "#");
mvwprintz(w_auto_pickup_header, 3, 7, c_white, "Rules");
mvwprintz(w_auto_pickup_header, 3, 51, c_white, "I/E");
//mvwprintz(w_auto_pickup_header, 3, 55, c_white, "Volume");
//mvwprintz(w_auto_pickup_header, 3, 62, c_white, "Weight");
wrefresh(w_auto_pickup_header);
int iCurrentPage = 1;
int iCurrentLine = 0;
int iCurrentCol = 1;
int iStartPos = 0;
bool bStuffChanged = false;
char ch = ' ';
std::stringstream sTemp;
do {
mvwprintz(w_auto_pickup_header, 2, 17 + 0, c_white, "[");
wprintz(w_auto_pickup_header, (iCurrentPage == 1) ? hilite(c_white) : c_white, "Global");
wprintz(w_auto_pickup_header, c_white, "]");
mvwprintz(w_auto_pickup_header, 2, 17 + 9, c_white, "[");
wprintz(w_auto_pickup_header, (iCurrentPage == 2) ? hilite(c_white) : c_white, "Character");
wprintz(w_auto_pickup_header, c_white, "]");
/*
mvwprintz(w_auto_pickup_header, 2, 12 + 21, c_white, "[");
wprintz(w_auto_pickup_header, (iCurrentPage == 3) ? hilite(c_white) : c_white, "Options");
wprintz(w_auto_pickup_header, c_white, "]");
*/
wrefresh(w_auto_pickup_header);
// Clear the lines
for (int i = 0; i < iContentHeight; i++) {
for (int j = 0; j < 79; j++) {
if (mapLines[j]) {
mvwputch(w_auto_pickup, i, j, c_ltgray, LINE_XOXO);
} else {
mvwputch(w_auto_pickup, i, j, c_black, ' ');
}
}
}
if (iCurrentPage == 1 || iCurrentPage == 2) {
if (iCurrentPage == 2 && g->u.name == "") {
vAutoPickupRules[2].clear();
mvwprintz(w_auto_pickup, 8, 15, c_white, "Please load a character first to use this page!");
}
if (vAutoPickupRules[iCurrentPage].size() > iContentHeight) {
iStartPos = iCurrentLine - (iContentHeight - 1) / 2;
if (iStartPos < 0) {
iStartPos = 0;
} else if (iStartPos + iContentHeight > vAutoPickupRules[iCurrentPage].size()) {
iStartPos = vAutoPickupRules[iCurrentPage].size() - iContentHeight;
}
}
// display auto pickup
for (int i = iStartPos; i < vAutoPickupRules[iCurrentPage].size(); i++) {
if (i >= iStartPos && i < iStartPos + ((iContentHeight > vAutoPickupRules[iCurrentPage].size()) ? vAutoPickupRules[iCurrentPage].size() : iContentHeight)) {
nc_color cLineColor = (vAutoPickupRules[iCurrentPage][i].bActive) ? c_white : c_ltgray;
sTemp.str("");
sTemp << i + 1;
mvwprintz(w_auto_pickup, i - iStartPos, 0, cLineColor, sTemp.str().c_str());
mvwprintz(w_auto_pickup, i - iStartPos, 4, cLineColor, "");
if (iCurrentLine == i) {
wprintz(w_auto_pickup, c_yellow, ">> ");
} else {
wprintz(w_auto_pickup, c_yellow, " ");
}
wprintz(w_auto_pickup, (iCurrentLine == i && iCurrentCol == 1) ? hilite(cLineColor) : cLineColor, "%s", ((vAutoPickupRules[iCurrentPage][i].sRule == "") ? "<empty rule>" : vAutoPickupRules[iCurrentPage][i].sRule).c_str());
mvwprintz(w_auto_pickup, i - iStartPos, 52, (iCurrentLine == i && iCurrentCol == 2) ? hilite(cLineColor) : cLineColor, "%s", ((vAutoPickupRules[iCurrentPage][i].bExclude) ? "E" : "I"));
}
}
wrefresh(w_auto_pickup);
} else if (iCurrentPage == 3) {
wborder(w_auto_pickup_options, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX, LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX);
mvwprintz(w_auto_pickup_options, 5, 10, c_white, "Under construction!");
wrefresh(w_auto_pickup);
wrefresh(w_auto_pickup_options);
}
ch = input();
if (iCurrentPage == 3) {
switch(ch) {
case '\t': //Switch to next Page
iCurrentPage++;
if (iCurrentPage > 3) {
iCurrentPage = 1;
iCurrentLine = 0;
}
break;
}
} else if (iCurrentPage == 1 || iCurrentPage == 2) {
if (iCurrentPage == 2 && g->u.name == "" && ch != '\t') {
//Only allow loaded games to use the char sheet
} else if (vAutoPickupRules[iCurrentPage].size() > 0 || ch == 'a' || ch == '\t') {
switch(ch) {
case 'j': //move down
iCurrentLine++;
iCurrentCol = 1;
if (iCurrentLine >= vAutoPickupRules[iCurrentPage].size()) {
iCurrentLine = 0;
}
break;
case 'k': //move up
iCurrentLine--;
iCurrentCol = 1;
if (iCurrentLine < 0) {
iCurrentLine = vAutoPickupRules[iCurrentPage].size()-1;
}
break;
case 'a': //add new rule
case 'A':
bStuffChanged = true;
vAutoPickupRules[iCurrentPage].push_back(cPickupRules("", true, false));
iCurrentLine = vAutoPickupRules[iCurrentPage].size()-1;
break;
case 'r': //remove rule
case 'R':
bStuffChanged = true;
vAutoPickupRules[iCurrentPage].erase(vAutoPickupRules[iCurrentPage].begin() + iCurrentLine);
if (iCurrentLine > vAutoPickupRules[iCurrentPage].size()-1) {
iCurrentLine--;
}
break;
case 'c': //copy rule
case 'C':
bStuffChanged = true;
vAutoPickupRules[iCurrentPage].push_back(cPickupRules(vAutoPickupRules[iCurrentPage][iCurrentLine].sRule, vAutoPickupRules[iCurrentPage][iCurrentLine].bActive, vAutoPickupRules[iCurrentPage][iCurrentLine].bExclude));
iCurrentLine = vAutoPickupRules[iCurrentPage].size()-1;
break;
case 'm': //move rule global <-> character
case 'M':
if ((iCurrentPage == 1 && g->u.name != "") || iCurrentPage == 2) {
bStuffChanged = true;
//copy over
vAutoPickupRules[(iCurrentPage == 1) ? 2 : 1].push_back(cPickupRules(vAutoPickupRules[iCurrentPage][iCurrentLine].sRule, vAutoPickupRules[iCurrentPage][iCurrentLine].bActive, vAutoPickupRules[iCurrentPage][iCurrentLine].bExclude));
//remove old
vAutoPickupRules[iCurrentPage].erase(vAutoPickupRules[iCurrentPage].begin() + iCurrentLine);
iCurrentLine = vAutoPickupRules[(iCurrentPage == 1) ? 2 : 1].size()-1;
iCurrentPage = (iCurrentPage == 1) ? 2 : 1;
}
break;
case '\t': //Switch to next Page
iCurrentPage++;
if (iCurrentPage > 2) {
iCurrentPage = 1;
iCurrentLine = 0;
}
break;
case '\n': //Edit Col in current line
bStuffChanged = true;
if (iCurrentCol == 1) {
mvwprintz(w_auto_pickup_help, 1, 1, c_white, "* is used as a Wildcard. A few Examples:");
mvwprintz(w_auto_pickup_help, 2, 1, c_white, "");
mvwprintz(w_auto_pickup_help, 3, 1, c_white, "wood arrow matches the itemname exactly");
mvwprintz(w_auto_pickup_help, 4, 1, c_white, "wood ar* matches items beginning with wood ar");
mvwprintz(w_auto_pickup_help, 5, 1, c_white, "*rrow matches items ending with rrow");
mvwprintz(w_auto_pickup_help, 6, 1, c_white, "*avy fle*fi*arrow multible * are allowed");
mvwprintz(w_auto_pickup_help, 7, 1, c_white, "heAVY*woOD*arrOW case insesitive search");
mvwprintz(w_auto_pickup_help, 8, 1, c_white, "");
wborder(w_auto_pickup_help, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX, LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX);
wrefresh(w_auto_pickup_help);
vAutoPickupRules[iCurrentPage][iCurrentLine].sRule = trim_rule(string_input_popup("Pickup Rule:", 30, vAutoPickupRules[iCurrentPage][iCurrentLine].sRule));
} else if (iCurrentCol == 2) {
vAutoPickupRules[iCurrentPage][iCurrentLine].bExclude = !vAutoPickupRules[iCurrentPage][iCurrentLine].bExclude;
}
break;
case 'e': //enable rule
case 'E':
bStuffChanged = true;
vAutoPickupRules[iCurrentPage][iCurrentLine].bActive = true;
break;
case 'd': //disable rule
case 'D':
bStuffChanged = true;
vAutoPickupRules[iCurrentPage][iCurrentLine].bActive = false;
break;
case 'h': //move left
iCurrentCol--;
if (iCurrentCol < 1) {
iCurrentCol = iTotalCols;
}
break;
case 'l': //move right
iCurrentCol++;
if (iCurrentCol > iTotalCols) {
iCurrentCol = 1;
}
break;
case '+': //move rule up
bStuffChanged = true;
if (iCurrentLine < vAutoPickupRules[iCurrentPage].size()-1) {
std::swap(vAutoPickupRules[iCurrentPage][iCurrentLine], vAutoPickupRules[iCurrentPage][iCurrentLine+1]);
iCurrentLine++;
iCurrentCol = 1;
}
break;
case '-': //move rule down
bStuffChanged = true;
if (iCurrentLine > 0) {
std::swap(vAutoPickupRules[iCurrentPage][iCurrentLine], vAutoPickupRules[iCurrentPage][iCurrentLine-1]);
iCurrentLine--;
iCurrentCol = 1;
}
break;
case 't': //test rule
case 'T':
test_pattern(iCurrentPage, iCurrentLine);
break;
}
}
}
} while(ch != 'q' && ch != 'Q' && ch != KEY_ESCAPE);
if (bStuffChanged) {
if(query_yn("Save changes?")) {
save_auto_pickup(false);
if (g->u.name != "") {
save_auto_pickup(true);
}
} else {
save_reset_changes(true);
}
}
werase(w_auto_pickup);
werase(w_auto_pickup_border);
werase(w_auto_pickup_header);
werase(w_auto_pickup_options);
werase(w_auto_pickup_help);
}
void test_pattern(int iCurrentPage, int iCurrentLine)
{
std::vector<std::string> vMatchingItems;
std::string sItemName = "";
if (vAutoPickupRules[iCurrentPage][iCurrentLine].sRule == "") {
return;
}
//Loop through all itemfactory items
for (int i = 0; i < standard_itype_ids.size(); i++) {
sItemName = item_controller->find_template(standard_itype_ids[i])->name;
if (auto_pickup_match(sItemName, vAutoPickupRules[iCurrentPage][iCurrentLine].sRule)) {
vMatchingItems.push_back(sItemName);
}
}
const int iOffsetX = 15 + ((TERMX > FULL_SCREEN_WIDTH) ? (TERMX-FULL_SCREEN_WIDTH)/2 : 0);
const int iOffsetY = 5 + ((TERMY > FULL_SCREEN_HEIGHT) ? (TERMY-FULL_SCREEN_HEIGHT)/2 : 0);
int iStartPos = 0;
const int iContentHeight = FULL_SCREEN_HEIGHT - 8;
const int iContentWidth = FULL_SCREEN_WIDTH - 30;
char ch;
std::stringstream sTemp;
WINDOW* w_test_rule_border = newwin(iContentHeight + 2, iContentWidth, iOffsetY, iOffsetX);
WINDOW* w_test_rule_content = newwin(iContentHeight, iContentWidth - 2, 1 + iOffsetY, 1 + iOffsetX);
wborder(w_test_rule_border, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX, LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX);
sTemp << vMatchingItems.size() << " items match: " << vAutoPickupRules[iCurrentPage][iCurrentLine].sRule;
mvwprintz(w_test_rule_border, 0, iContentWidth/2 - (sTemp.str()).length()/2, hilite(c_white), sTemp.str().c_str());
wrefresh(w_test_rule_border);
iCurrentLine = 0;
do {
// Clear the lines
for (int i = 0; i < iContentHeight; i++) {
for (int j = 0; j < 79; j++) {
mvwputch(w_test_rule_content, i, j, c_black, ' ');
}
}
if (vMatchingItems.size() > iContentHeight) {
iStartPos = iCurrentLine - (iContentHeight - 1) / 2;
if (iStartPos < 0) {
iStartPos = 0;
} else if (iStartPos + iContentHeight > vMatchingItems.size()) {
iStartPos = vMatchingItems.size() - iContentHeight;
}
}
// display auto pickup
for (int i = iStartPos; i < vMatchingItems.size(); i++) {
if (i >= iStartPos && i < iStartPos + ((iContentHeight > vMatchingItems.size()) ? vMatchingItems.size() : iContentHeight)) {
nc_color cLineColor = c_white;
sTemp.str("");
sTemp << i + 1;
mvwprintz(w_test_rule_content, i - iStartPos, 0, cLineColor, sTemp.str().c_str());
mvwprintz(w_test_rule_content, i - iStartPos, 4, cLineColor, "");
if (iCurrentLine == i) {
wprintz(w_test_rule_content, c_yellow, ">> ");
} else {
wprintz(w_test_rule_content, c_yellow, " ");
}
wprintz(w_test_rule_content, (iCurrentLine == i) ? hilite(cLineColor) : cLineColor, vMatchingItems[i].c_str());
}
}
wrefresh(w_test_rule_content);
ch = input();
switch(ch) {
case 'j': //move down
iCurrentLine++;
if (iCurrentLine >= vMatchingItems.size()) {
iCurrentLine = 0;
}
break;
case 'k': //move up
iCurrentLine--;
if (iCurrentLine < 0) {
iCurrentLine = vMatchingItems.size()-1;
}
break;
}
} while(ch == 'j' || ch == 'k');
werase(w_test_rule_border);
werase(w_test_rule_content);
}
void load_auto_pickup(bool bCharacter)
{
std::ifstream fin;
std::string sFile = "data/auto_pickup.txt";
if (bCharacter) {
sFile = "save/" + g->u.name + ".apu.txt";
}
fin.open(sFile.c_str());
if(!fin.is_open()) {
fin.close();
create_default_auto_pickup(bCharacter);
fin.open(sFile.c_str());
if(!fin.is_open()) {
DebugLog() << "Could neither read nor create " << sFile << "\n";
return;
}
}
vAutoPickupRules[(bCharacter) ? 2 : 1].clear();
while(!fin.eof()) {
std::string sLine;
fin >> sLine;
if(sLine == "") { // Empty line, chomp it
getline(fin, sLine);
} else if(sLine[0] == '#') { // # indicates a comment
getline(fin, sLine);
} else {
int iNum = std::count(sLine.begin(), sLine.end(), ';');
if(iNum != 2) {
/*int iNum = std::count(sLine.begin(), sLine.end(), ' ');
if(iNum == 1) { //its an option! hurray
} else {*/
DebugLog() << "Bad Rule: " << sLine << "\n";
getline(fin, sLine);
//}
} else {
std::string sRule = "";
bool bActive = true;
bool bExclude = false;
int iPos = 0;
int iCol = 1;
do {
iPos = sLine.find(";");
std::string sTemp = (iPos == std::string::npos) ? sLine : sLine.substr(0, iPos);
if (iCol == 1) {
sRule = sTemp;
} else if (iCol == 2) {
bActive = (sTemp == "T" || sTemp == "True") ? true : false;
} else if (iCol == 3) {
bExclude = (sTemp == "T" || sTemp == "True") ? true : false;
}
iCol++;
if (iPos != std::string::npos) {
sLine = sLine.substr(iPos+1, sLine.size());
}
} while(iPos != std::string::npos);
vAutoPickupRules[(bCharacter) ? 2 : 1].push_back(cPickupRules(sRule, bActive, bExclude));
}
}
if(fin.peek() == '\n') {
getline(fin, sLine); // Chomp
}
}
fin.close();
merge_vector();
}
void merge_vector()
{
vAutoPickupRules[0].clear();
for (int i=1; i <= 2; i++) { //Loop through global 1 and character 2
for (int j=0; j < vAutoPickupRules[i].size(); j++) {
if (vAutoPickupRules[i][j].sRule != "") {
vAutoPickupRules[0].push_back(cPickupRules(vAutoPickupRules[i][j].sRule, vAutoPickupRules[i][j].bActive, vAutoPickupRules[i][j].bExclude));
}
}
}
}
void save_reset_changes(bool bReset)
{
for (int i=1; i <= 2; i++) { //Loop through global 1 and character 2
vAutoPickupRules[i + ((bReset) ? 0: 2)].clear();
for (int j=0; j < vAutoPickupRules[i + ((bReset) ? 2: 0)].size(); j++) {
if (vAutoPickupRules[i + ((bReset) ? 2: 0)][j].sRule != "") {
vAutoPickupRules[i + ((bReset) ? 0: 2)].push_back(cPickupRules(vAutoPickupRules[i + ((bReset) ? 2: 0)][j].sRule, vAutoPickupRules[i + ((bReset) ? 2: 0)][j].bActive, vAutoPickupRules[i + ((bReset) ? 2: 0)][j].bExclude));
}
}
}
merge_vector();
}
std::string auto_pickup_header(bool bCharacter)
{
std::string sTemp = (bCharacter) ? "character": "global";
return "# This is the " + sTemp + " auto pickup rules file. The format is\n\
# <pickup rule>;<dis/enabled>;<in/exclude>\n\n\
# <pickup rule> Simple text. No other special characters except spaces and *\n\
# <dis/enabled> Can be T(rue) of F(alse)\n\
# <in/exclude> Can be T(rue) of F(alse)\n\
#\n\
# If # is at the start of a line, it is considered a comment and is ignored.\n\
# In-line commenting is not allowed. I think.\n\
#\n\
# If you want to restore the default auto pickup rules file, simply delete this file.\n\
# A new auto_pickup.txt will be created next time you play.\
\n\n";
}
void save_auto_pickup(bool bCharacter)
{
std::ofstream fout;
std::string sFile = "data/auto_pickup.txt";
if (bCharacter) {
sFile = "save/" + g->u.name + ".apu.txt";
std::ifstream fin;
fin.open(("save/" + g->u.name + ".sav").c_str());
if(!fin.is_open()) {
return;
}
fin.close();
}
fout.open(sFile.c_str());
if(!fout.is_open()) {
return;
}
fout << auto_pickup_header(bCharacter) << std::endl;
for(int i = 0; i < vAutoPickupRules[(bCharacter) ? 2 : 1].size(); i++) {
fout << vAutoPickupRules[(bCharacter) ? 2 : 1][i].sRule << ";";
fout << (vAutoPickupRules[(bCharacter) ? 2 : 1][i].bActive ? "T" : "F") << ";";
fout << (vAutoPickupRules[(bCharacter) ? 2 : 1][i].bExclude ? "T" : "F");
fout << "\n";
}
if (!bCharacter) {
merge_vector();
}
}
void create_default_auto_pickup(bool bCharacter)
{
std::ofstream fout;
std::string sFile = "data/auto_pickup.txt";
if (bCharacter) {
sFile = "save/" + g->u.name + ".apu.txt";
}
fout.open(sFile.c_str());
if(!fout.is_open()) {
return;
}
fout << auto_pickup_header(bCharacter);
fout.close();
}
std::string trim_rule(std::string sPattern)
{
size_t iPos = 0;
//Remove all double ** in pattern
while((iPos = sPattern.find("**")) != std::string::npos) {
sPattern = sPattern.substr(0, iPos) + sPattern.substr(iPos+1, sPattern.length()-iPos-1);
}
return sPattern;
}
bool auto_pickup_match(std::string sText, std::string sPattern)
{
//case insenitive search
/* Possible patterns
*
wooD
wood*
*wood
Wood*aRrOW
wood*arrow*
*wood*arrow
*wood*hard* *x*y*z*arrow*
*/
if (sText == "") {
return false;
} else if (sText == "*") {
return true;
}
size_t iPos;
std::vector<std::string> vPattern;
sPattern = trim_rule(sPattern);
split(sPattern, '*', vPattern);
size_t iNum = vPattern.size();
if (iNum == 0) { //should never happen
return false;
} else if (iNum == 1) { // no * found
if (sText.length() == vPattern[0].length() && ci_find_substr(sText, vPattern[0]) != -1) {
return true;
}
return false;
}
for (int i=0; i < vPattern.size(); i++) {
if (i==0 && vPattern[i] != "") { //beginning: ^vPat[i]
if (sText.length() < vPattern[i].length() || ci_find_substr(sText.substr(0, vPattern[i].length()), vPattern[i]) == -1) {
//debugmsg(("1: sText: " + sText + " | sPattern: ^" + vPattern[i] + " | no match").c_str());
return false;
}
sText = sText.substr(vPattern[i].length(), sText.length()-vPattern[i].length());
} else if (i==vPattern.size()-1 && vPattern[i] != "") { //linenend: vPat[i]$
if (sText.length() < vPattern[i].length() || ci_find_substr(sText.substr(sText.length()-vPattern[i].length(), vPattern[i].length()), vPattern[i]) == -1) {
//debugmsg(("2: sText: " + sText + " | sPattern: " + vPattern[i] + "$ | no match").c_str());
return false;
}
} else { //inbetween: vPat[i]
if ((iPos = ci_find_substr(sText, vPattern[i])) == -1) {
//debugmsg(("3: sText: " + sText + " | sPattern: " + vPattern[i] + " | no match").c_str());
return false;
}
sText = sText.substr(iPos+vPattern[i].length(), sText.length()-iPos);
}
}
return true;
}
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems) {
std::stringstream ss(s);
std::string item;
elems.clear();
while (std::getline(ss, item, delim)) {
elems.push_back(item);
}
if ( s.substr(s.length()-1, 1) == "*") {
elems.push_back("");
}
return elems;
}
/*
// string test
std::string str1 = "FIRST HELLO";
std::string str2 = "hello";
int f1 = ci_find_substr( str1, str2 );
// wstring test
std::wstring wstr1 = L"ОПЯТЬ ПРИВЕТ";
std::wstring wstr2 = L"привет";
int f2 = ci_find_substr( wstr1, wstr2 );
*/
// templated version of my_equal so it could work with both char and wchar_t
template<typename charT>
struct my_equal {
public:
my_equal( const std::locale& loc ) : loc_(loc) {}
bool operator()(charT ch1, charT ch2) {
return std::toupper(ch1, loc_) == std::toupper(ch2, loc_);
}
private:
const std::locale& loc_;
};
// find substring (case insensitive)
template<typename charT>
int ci_find_substr( const charT& str1, const charT& str2, const std::locale& loc )
{
typename charT::const_iterator it = std::search( str1.begin(), str1.end(), str2.begin(), str2.end(), my_equal<typename charT::value_type>(loc) );
if ( it != str1.end() ) return it - str1.begin();
else return -1; // not found
}
+46
View File
@@ -0,0 +1,46 @@
#ifndef _AUTO_PICKUP_H_
#define _AUTO_PICKUP_H_
#include <string>
#include <vector>
#include <locale>
#include <algorithm>
class cPickupRules {
public:
std::string sRule;
bool bActive;
bool bExclude;
cPickupRules() {
this->sRule = "";
this->bActive = false;
this->bExclude = false;
}
cPickupRules(std::string sRuleIn, bool bActiveIn, bool bExcludeIn) {
this->sRule = sRuleIn;
this->bActive = bActiveIn;
this->bExclude = bExcludeIn;
}
~cPickupRules() {};
};
extern std::vector<cPickupRules> vAutoPickupRules[5];
void test_pattern(int iCurrentPage, int iCurrentLine);
std::string trim_rule(std::string sPattern);
void merge_vector();
void save_reset_changes(bool bReset);
void show_auto_pickup();
void load_auto_pickup(bool bCharacter);
void save_auto_pickup(bool bCharacter);
std::string auto_pickup_header(bool bCharacter);
void create_default_auto_pickup(bool bCharacter);
bool auto_pickup_match(std::string sText, std::string sPattern);
std::vector<std::string> &split(const std::string &s, char delim, std::vector<std::string> &elems);
template<typename charT>
int ci_find_substr( const charT& str1, const charT& str2, const std::locale& loc = std::locale() );
#endif
+180 -531
View File
@@ -5,7 +5,8 @@
#include "keypress.h"
#include "item.h"
#include "bionics.h"
#include "line.h"
#include "line.h"
#include "catajson.h"
#define BATTERY_AMOUNT 4 // How much batteries increase your power
@@ -47,7 +48,7 @@ void show_power_level_in_titlebar(WINDOW* window, player* p)
void player::power_bionics(game *g)
{
int HEIGHT = TERMY;
int WIDTH = 80;
int WIDTH = FULL_SCREEN_WIDTH;
int START_X = (TERMX - WIDTH)/2;
int START_Y = (TERMY - HEIGHT)/2;
WINDOW* wBio = newwin(HEIGHT, WIDTH, START_Y, START_X);
@@ -69,7 +70,7 @@ void player::power_bionics(game *g)
show_power_level_in_titlebar(wBio, this);
int HEADER_LINE_Y = START_Y + 2;
int DESCRIPTION_LINE_Y = DESCRIPTION_START_Y - 1;
int DESCRIPTION_LINE_Y = DESCRIPTION_START_Y - 1;
for (int i = 1; i < 79; i++) {
mvwputch(wBio, HEADER_LINE_Y, i, c_ltgray, LINE_OXOX); // Draw line under title
mvwputch(wBio, DESCRIPTION_LINE_Y, i, c_ltgray, LINE_OXOX); // Draw line above description
@@ -83,8 +84,7 @@ void player::power_bionics(game *g)
mvwputch(wBio, DESCRIPTION_LINE_Y, 79, c_ltgray, LINE_XOXX); // -|
for (int i = 0; i < my_bionics.size(); i++) {
if ( bionics[my_bionics[i].id]->power_source ||
!bionics[my_bionics[i].id]->activated )
if (!bionics[my_bionics[i].id]->activated)
passive.push_back(my_bionics[i]);
else
active.push_back(my_bionics[i]);
@@ -104,10 +104,15 @@ void player::power_bionics(game *g)
if (active.size() > 0) {
mvwprintz(wBio, 3, 33, c_ltblue, "Active:");
for (int i = 0; i < active.size(); i++) {
if (active[i].powered)
if (active[i].powered && !bionics[active[i].id]->power_source)
type = c_red;
else if (bionics[active[i].id]->power_source && !active[i].powered)
type = c_ltcyan;
else if (bionics[active[i].id]->power_source && active[i].powered)
type = c_ltgreen;
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"),
@@ -210,7 +215,6 @@ 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;
if(bio.id == "bio_painkiller"){
@@ -220,6 +224,9 @@ void player::activate_bionic(int b, game *g)
pkill = pain;
} else if (bio.id == "bio_nanobots"){
healall(4);
} else if (bio.id == "bio_night"){
if (g->turn % 5)
g->add_msg("Artificial night generator active!");
} else if (bio.id == "bio_resonator"){
g->sound(posx, posy, 30, "VRRRRMP!");
for (int i = posx - 1; i <= posx + 1; i++) {
@@ -244,43 +251,51 @@ void player::activate_bionic(int b, game *g)
hurt(g, bp_torso, 0, rng(5, 15));
}
if (one_in(5))
add_disease(DI_TELEGLOW, rng(50, 400), g);
add_disease("teleglow", rng(50, 400));
} else if (bio.id == "bio_teleport"){
g->teleport();
add_disease(DI_TELEGLOW, 300, g);
add_disease("teleglow", 300);
}
// TODO: More stuff here (and bio_blood_filter)
else if(bio.id == "bio_blood_anal"){
w = newwin(20, 40, 3 + ((TERMY > 25) ? (TERMY-25)/2 : 0), 10+((TERMX > 80) ? (TERMX-80)/2 : 0));
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
if (has_disease(DI_FUNGUS))
if (has_disease("fungus"))
bad.push_back("Fungal Parasite");
if (has_disease(DI_DERMATIK))
if (has_disease("dermatik"))
bad.push_back("Insect Parasite");
if (has_disease(DI_POISON))
if (has_disease("poison"))
bad.push_back("Poison");
if (radiation > 0)
bad.push_back("Irradiated");
if (has_disease(DI_PKILL1))
if (has_disease("pkill1"))
good.push_back("Minor Painkiller");
if (has_disease(DI_PKILL2))
if (has_disease("pkill2"))
good.push_back("Moderate Painkiller");
if (has_disease(DI_PKILL3))
if (has_disease("pkill3"))
good.push_back("Heavy Painkiller");
if (has_disease(DI_PKILL_L))
if (has_disease("pkill_l"))
good.push_back("Slow-Release Painkiller");
if (has_disease(DI_DRUNK))
if (has_disease("drunk"))
good.push_back("Alcohol");
if (has_disease(DI_CIG))
if (has_disease("cig"))
good.push_back("Nicotine");
if (has_disease(DI_HIGH))
if (has_disease("meth"))
good.push_back("Methamphetamines");
if (has_disease("high"))
good.push_back("Intoxicant: Other");
if (has_disease(DI_TOOK_PROZAC))
if (has_disease("hallu") || has_disease("visuals"))
bad.push_back("Magic Mushroom");
if (has_disease("iodine"))
good.push_back("Iodine");
if (has_disease("took_xanax"))
good.push_back("Xanax");
if (has_disease("took_prozac"))
good.push_back("Prozac");
if (has_disease(DI_TOOK_FLUMED))
if (has_disease("took_flumed"))
good.push_back("Antihistamines");
if (has_disease(DI_ADRENALINE))
if (has_disease("adrenaline"))
good.push_back("Adrenaline Spike");
if (good.size() == 0 && bad.size() == 0)
mvwprintz(w, 1, 1, c_white, "No effects.");
@@ -297,69 +312,53 @@ void player::activate_bionic(int b, game *g)
getch();
delwin(w);
} else if(bio.id == "bio_blood_filter"){
rem_disease(DI_FUNGUS);
rem_disease(DI_POISON);
rem_disease(DI_PKILL1);
rem_disease(DI_PKILL2);
rem_disease(DI_PKILL3);
rem_disease(DI_PKILL_L);
rem_disease(DI_DRUNK);
rem_disease(DI_CIG);
rem_disease(DI_HIGH);
rem_disease(DI_TOOK_PROZAC);
rem_disease(DI_TOOK_FLUMED);
rem_disease(DI_ADRENALINE);
rem_disease("fungus");
rem_disease("poison");
rem_disease("pkill1");
rem_disease("pkill2");
rem_disease("pkill3");
rem_disease("pkill_l");
rem_disease("drunk");
rem_disease("cig");
rem_disease("high");
rem_disease("hallu");
rem_disease("visuals");
rem_disease("iodine");
rem_disease("took_xanax");
rem_disease("took_prozac");
rem_disease("took_flumed");
rem_disease("adrenaline");
rem_disease("meth");
pkill = 0;
stim = 0;
} else if(bio.id == "bio_evap"){
if (query_yn("Drink directly? Otherwise you will need a container.")) {
tmp_item = item(g->itypes["water_clean"], 0);
thirst -= 50;
if (has_trait(PF_GOURMAND) && thirst < -60) {
g->add_msg("You can't finish it all!");
thirst = -60;
} else if (!has_trait(PF_GOURMAND) && thirst < -20) {
g->add_msg("You can't finish it all!");
thirst = -20;
}
} else {
t = g->inv("Choose a container:");
if (i_at(t).type == 0) {
g->add_msg("You don't have that item!");
item water = item(g->itypes["water_clean"], 0);
if (g->handle_liquid(water, true, true))
{
moves -= 100;
}
else if (query_yn("Drink from your hands?"))
{
inv.push_back(water);
water = inv.item_by_type(water.typeId());
eat(g, water.invlet);
moves -= 350;
}
else
{
power_level += bionics["bio_evap"]->power_cost;
} else if (!i_at(t).is_container()) {
g->add_msg("That %s isn't a container!", i_at(t).tname().c_str());
power_level += bionics["bio_evap"]->power_cost;
} else {
it_container *cont = dynamic_cast<it_container*>(i_at(t).type);
if (i_at(t).volume_contained() + 1 > cont->contains) {
g->add_msg("There's no space left in your %s.", i_at(t).tname().c_str());
power_level += bionics["bio_evap"]->power_cost;
} else if (!(cont->flags & con_wtight)) {
g->add_msg("Your %s isn't watertight!", i_at(t).tname().c_str());
power_level += bionics["bio_evap"]->power_cost;
} else {
g->add_msg("You pour water into your %s.", i_at(t).tname().c_str());
i_at(t).put_in(item(g->itypes["water_clean"], 0));
}
}
}
} else if(bio.id == "bio_lighter"){
g->draw();
mvprintw(0, 0, "Torch in which direction?");
input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
g->add_msg("Invalid direction.");
power_level += bionics["bio_lighter"]->power_cost;
return;
if(!g->choose_adjacent("Start a fire", dirx, diry) ||
(!g->m.add_field(g, dirx, diry, fd_fire, 1))){
g->add_msg_if_player(this,"You can't light a fire there.");
power_level += bionics["bio_lighter"]->power_cost;
}
dirx += posx;
diry += posy;
if (!g->m.add_field(g, dirx, diry, fd_fire, 1)) // Unsuccessful.
g->add_msg("You can't light a fire there.");
} else if(bio.id == "bio_claws"){
if (weapon.type->id == "bio_claws_weapon") {
g->add_msg("You withdraw your claws.");
weapon = ret_null;
weapon = get_combat_style();
} else if(weapon.type->id != "null"){
g->add_msg("Your claws extend, forcing you to drop your %s.",
weapon.tname().c_str());
@@ -388,47 +387,38 @@ void player::activate_bionic(int b, game *g)
g->plfire(false);
weapon = tmp_item;
} else if (bio.id == "bio_emp"){
g->draw();
mvprintw(0, 0, "Fire EMP in which direction?");
input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
g->add_msg("Invalid direction.");
if(g->choose_adjacent("create an EMP", dirx, diry))
g->emp_blast(dirx, diry);
else{
power_level += bionics["bio_emp"]->power_cost;
return;
}
dirx += posx;
diry += posy;
g->emp_blast(dirx, diry);
} else if (bio.id == "bio_hydraulics"){
g->add_msg("Your muscles hiss as hydraulic strength fills them!");
} else if (bio.id == "bio_water_extractor"){
bool extracted = false;
for (int i = 0; i < g->m.i_at(posx, posy).size(); i++) {
item tmp = g->m.i_at(posx, posy)[i];
if (tmp.type->id == "corpse" && query_yn("Extract water from the %s",
tmp.tname().c_str())) {
i = g->m.i_at(posx, posy).size() + 1; // Loop is finished
t = g->inv("Choose a container:");
if (i_at(t).type == 0) {
g->add_msg("You don't have that item!");
power_level += bionics["bio_water_extractor"]->power_cost;
} else if (!i_at(t).is_container()) {
g->add_msg("That %s isn't a container!", i_at(t).tname().c_str());
power_level += bionics["bio_water_extractor"]->power_cost;
} else {
it_container *cont = dynamic_cast<it_container*>(i_at(t).type);
if (i_at(t).volume_contained() + 1 > cont->contains) {
g->add_msg("There's no space left in your %s.", i_at(t).tname().c_str());
power_level += bionics["bio_water_extractor"]->power_cost;
} else {
g->add_msg("You pour water into your %s.", i_at(t).tname().c_str());
i_at(t).put_in(item(g->itypes["water"], 0));
}
item water = item(g->itypes["water_clean"], 0);
if (g->handle_liquid(water, true, true))
{
moves -= 100;
}
else if (query_yn("Drink directly from the condensor?"))
{
inv.push_back(water);
water = inv.item_by_type(water.typeId());
eat(g, water.invlet);
moves -= 350;
}
extracted = true;
break;
}
if (i == g->m.i_at(posx, posy).size() - 1) // We never chose a corpse
power_level += bionics["bio_water_extractor"]->power_cost;
}
if (!extracted)
power_level += bionics["bio_water_extractor"]->power_cost;
} else if(bio.id == "bio_magnet"){
for (int i = posx - 10; i <= posx + 10; i++) {
for (int j = posy - 10; j <= posy + 10; j++) {
@@ -440,7 +430,7 @@ void player::activate_bionic(int b, game *g)
}
traj.insert(traj.begin(), point(i, j));
for (int k = 0; k < g->m.i_at(i, j).size(); k++) {
if (g->m.i_at(i, j)[k].made_of(IRON) || g->m.i_at(i, j)[k].made_of(STEEL)){
if (g->m.i_at(i, j)[k].made_of("iron") || g->m.i_at(i, j)[k].made_of("steel")){
tmp_item = g->m.i_at(i, j)[k];
g->m.i_rem(i, j, k);
for (l = 0; l < traj.size(); l++) {
@@ -466,208 +456,81 @@ void player::activate_bionic(int b, game *g)
}
}
} else if(bio.id == "bio_lockpick"){
g->draw();
mvprintw(0, 0, "Unlock in which direction?");
input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
g->add_msg("Invalid direction.");
if(!g->choose_adjacent("Activate your bio lockpick", dirx, diry)){
power_level += bionics["bio_lockpick"]->power_cost;
return;
}
dirx += posx;
diry += posy;
if (g->m.ter(dirx, diry) == t_door_locked) {
moves -= 40;
g->add_msg("You unlock the door.");
g->add_msg_if_player(this,"You unlock the door.");
g->m.ter_set(dirx, diry, t_door_c);
} else
g->add_msg("You can't unlock that %s.", g->m.tername(dirx, diry).c_str());
g->add_msg_if_player(this,"You can't unlock that %s.", g->m.tername(dirx, diry).c_str());
} else if(bio.id == "bio_flashbang") {
g->add_msg_if_player(this,"You activate your integrated flashbang generator!");
g->flashbang(posx, posy, true);
} else if(bio.id == "bio_shockwave") {
g->shockwave(posx, posy, 3, 4, 2, 8, true);
g->add_msg_if_player(this,"You unleash a powerful shockwave!");
} else if(bio.id == "bio_chain_lightning"){
tmp_item = weapon;
weapon = item(g->itypes["bio_lightning"], 0);
weapon.curammo = dynamic_cast<it_ammo*>(g->itypes["bio_lightning_ammo"]);
weapon.charges = 10;
g->refresh_all();
g->plfire(false);
weapon = tmp_item;
}
}
bool player::install_bionics(game *g, it_bionic* type)
{
if (type == NULL) {
debugmsg("Tried to install NULL bionic");
return false;
}
if (has_bionic(type->id)){
if (!(type->id == "bio_power_storage" || type->id == "bio_power_storage_mkII")){
popup("You have already installed this bionic.");
return false;
}
}
std::string bio_name = type->name.substr(5); // Strip off "CBM: "
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") * 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, 1, 1, c_white, "Installing bionics:");
mvwprintz(w, 1, 21, type->color, bio_name.c_str());
// Dividing bars
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 bio_id = type->options[i];
mvwprintz(w, i + 3, 1, (has_bionic(bio_id) ? c_ltred : c_ltblue),
bionics[bio_id]->name.c_str());
}
// Helper text
mvwprintz(w, 3, 39, c_white, "Difficulty of this module: %d",
type->difficulty);
mvwprintz(w, 4, 39, c_white, "Your installation skill: %d.%d",
skint, skdec);
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, 9, 39, c_white, "Chance of success:");
nc_color col_suc;
if (chance_of_success >= 95)
col_suc = c_green;
else if (chance_of_success >= 80)
col_suc = c_ltgreen;
else if (chance_of_success >= 60)
col_suc = c_yellow;
else if (chance_of_success >= 35)
col_suc = c_ltred;
else
col_suc = c_red;
mvwprintz(w, 9, 59, col_suc, "%d%%%%", chance_of_success);
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 == "bio_power_storage" || type->id == "bio_power_storage_mkII") { // No selection list; just confirm
int pow_up = BATTERY_AMOUNT;
if (!query_yn("WARNING: %i percent chance of genetic damage, blood loss, or damage to existing bionics! Install anyway?", 100 - chance_of_success))
return false;
int pow_up = 0;
if (type->id == "bio_power_storage" || type->id == "bio_power_storage_mkII") {
pow_up = BATTERY_AMOUNT;
if (type->id == "bio_power_storage_mkII") {
pow_up = 10;
}
mvwprintz(w, 3, 1, h_ltblue, "Power Storage +%d", pow_up);
mvwprintz(w_description, 0, 0, c_ltblue, "\
Installing this bionic will increase your total power storage by %d.\n\
Power is necessary for most bionics to function. You also require a\n\
charge mechanism, which must be installed from another CBM.", pow_up);
InputEvent input;
wrefresh(w_description);
wrefresh(w);
do
input = get_input();
while (input != Confirm && input != Cancel);
if (input == Confirm) {
practice(g->turn, "electronics", (100 - chance_of_success) * 1.5);
practice(g->turn, "firstaid", (100 - chance_of_success) * 1.0);
practice(g->turn, "mechanics", (100 - chance_of_success) * 0.5);
int success = chance_of_success - rng(1, 100);
if (success > 0) {
g->add_msg("Successfully installed batteries.");
max_power_level += pow_up;
} else
bionics_install_failure(g, this, success);
werase(w);
delwin(w);
g->refresh_all();
return true;
}
werase(w);
delwin(w);
g->refresh_all();
return false;
}
int selection = 0;
InputEvent input;
do {
bionic_id bio_id = type->options[selection];
mvwprintz(w, 3 + selection, 1, (has_bionic(bio_id) ? h_ltred : h_ltblue),
bionics[bio_id]->name.c_str());
// Clear the bottom three lines...
werase(w_description);
// ...and then fill them with the description of the selected bionic
mvwprintz(w_description, 0, 0, c_ltblue, bionics[bio_id]->description.c_str());
wrefresh(w_description);
wrefresh(w);
input = get_input();
switch (input) {
case DirectionS:
mvwprintz(w, 2 + selection, 0, (has_bionic(bio_id) ? c_ltred : c_ltblue),
bionics[bio_id]->name.c_str());
if (selection == type->options.size() - 1)
selection = 0;
else
selection++;
break;
case DirectionN:
mvwprintz(w, 2 + selection, 0, (has_bionic(bio_id) ? c_ltred : c_ltblue),
bionics[bio_id]->name.c_str());
if (selection == 0)
selection = type->options.size() - 1;
else
selection--;
break;
}
if (input == Confirm && has_bionic(bio_id)) {
popup("You already have a %s!", bionics[bio_id]->name.c_str());
input = Nothing;
}
} while (input != Cancel && input != Confirm);
if (input == Confirm) {
practice(g->turn, "electronics", (100 - chance_of_success) * 1.5);
practice(g->turn, "firstaid", (100 - chance_of_success) * 1.0);
practice(g->turn, "mechanics", (100 - chance_of_success) * 0.5);
bionic_id bio_id = type->options[selection];
int success = chance_of_success - rng(1, 100);
if (success > 0) {
g->add_msg("Successfully installed %s.", bionics[bio_id]->name.c_str());
add_bionic(bio_id);
} else
bionics_install_failure(g, this, success);
werase(w);
delwin(w);
g->refresh_all();
return true;
}
werase(w);
delwin(w);
practice(g->turn, "electronics", (100 - chance_of_success) * 1.5);
practice(g->turn, "firstaid", (100 - chance_of_success) * 1.0);
practice(g->turn, "mechanics", (100 - chance_of_success) * 0.5);
int success = chance_of_success - rng(1, 100);
if (success > 0) {
if (pow_up) {
max_power_level += pow_up;
g->add_msg_if_player(this, "Increased storage capacity by %i", pow_up);
} else{
g->add_msg("Successfully installed %s.", bionics[type->id]->name.c_str());
add_bionic(type->id);
}
} else
bionics_install_failure(g, this, success);
g->refresh_all();
return false;
return true;
}
void bionics_install_failure(game *g, player *u, int success)
@@ -757,264 +620,50 @@ void bionics_install_failure(game *g, player *u, int success)
}
void game::init_bionics(){
bionics["bio_null"] = new bionic_data("NULL bionics", false, false, 0, 0, "\
If you're seeing this, it's a bug. (game::init_bionics)");
// NAME ,PW_SRC, ACT ,COST, TIME,
bionics["bio_batteries"] = new bionic_data("Battery System", true, false, 0, 0, "\
You have a battery draining attachment, and thus can make use of the energy\n\
contained in normal, everyday batteries. Use 'E' to consume batteries.");
power_source_bionics.push_back("bio_batteries");
bionics["bio_metabolics"] = new bionic_data("Metabolic Interchange", true, false, 0, 0, "\
Your digestive system and power supply are interconnected. Any drain on\n\
energy instead increases your hunger.");
power_source_bionics.push_back("bio_metabolics");
bionics["bio_solar"] = new bionic_data("Solar Panels", true, false, 0, 0, "\
You have a few solar panels installed. While in direct sunlight, your power\n\
level will slowly recharge.");
power_source_bionics.push_back("bio_solar");
bionics["bio_torsionratchet"] = new bionic_data("Joint Torsion Ratchet", true, false, 0, 0, "\
Your joints have been equipped with torsion ratchets that generate power slowly\n\
when you move.");
power_source_bionics.push_back("bio_torsionratchet");
bionics["bio_furnace"] = new bionic_data("Internal Furnace", true, false, 0, 0, "\
You can burn nearly any organic material as fuel (use 'E'), recharging your\n\
power level. Some materials will burn better than others.");
power_source_bionics.push_back("bio_furnace");
bionics["bio_ethanol"] = new bionic_data("Ethanol Burner", true, false, 0, 0, "\
You burn alcohol as fuel in an extremely efficient reaction. However, you\n\
will still suffer the inebriating effects of the substance.");
power_source_bionics.push_back("bio_ethanol");
bionics["bio_memory"] = new bionic_data("Enhanced Memory Banks", false, false, 1, 0, "\
Your memory has been enhanced with small quantum storage drives. Any time\n\
you start to forget a skill, you have a chance at retaining all knowledge, at\n\
the cost of a small amount of poweron.");
unpowered_bionics.push_back("bio_memory");
bionics["bio_ears"] = new bionic_data("Enhanced Hearing", false, false, 0, 0, "\
Your hearing has been drastically improved, allowing you to hear ten times\n\
better than the average person. Additionally, high-intensity sounds will be\n\
automatically dampened before they can damage your hearing.");
unpowered_bionics.push_back("bio_ears");
void game::init_bionics()
{
catajson bionics_file("data/raw/bionics.json");
bionics["bio_eye_enhancer"] = new bionic_data("Diamond Cornea", false, false, 0, 0, "\
Your vision is greatly enhanced, giving you a +2 bonus to perception.");
unpowered_bionics.push_back("bio_eye_enhancer");
bionics["bio_membrane"] = new bionic_data("Nictating Membrane", false, false, 0, 0, "\
Your eyes have a thin membrane that closes over your eyes while underwater,\n\
negating any vision penalties.");
unpowered_bionics.push_back("bio_membrane");
bionics["bio_targeting"] = new bionic_data("Targeting System", false, false, 0, 0, "\
Your eyes are equipped with range finders, and their movement is synced with\n\
that of your arms, to a degree. Shots you fire will be much more accurate,\n\
particularly at long range.");
unpowered_bionics.push_back("bio_targeting");
bionics["bio_gills"] = new bionic_data("Membrane Oxygenator", false, false, 1, 0, "\
An oxygen interchange system automatically switches on while underwater,\n\
slowly draining your energy reserves but providing oxygen.");
unpowered_bionics.push_back("bio_gills");
bionics["bio_purifier"] = new bionic_data("Air Filtration System", false, false, 1, 0, "\
Implanted in your trachea is an advanced filtration system. If toxins find\n\
their way into your windpipe, the filter will attempt to remove them.");
unpowered_bionics.push_back("bio_purifier");
bionics["bio_climate"] = new bionic_data("Internal Climate Control", false, true, 1, 30, "\
Throughout your body lies a network of thermal piping which eases the effects\n\
of high and low ambient temperatures.");
unpowered_bionics.push_back("bio_climate");
for(bionics_file.set_begin(); bionics_file.has_curr(); bionics_file.next())
{
catajson bio = bionics_file.curr();
bionics["bio_storage"] = new bionic_data("Internal Storage", false, false, 0, 0, "\
Space inside your chest cavity has been converted into a storage area. You\n\
may carry an extra 8 units of volume.");
unpowered_bionics.push_back("bio_storage");
bionics["bio_recycler"] = new bionic_data("Recycler Unit", false, false, 0, 0, "\
Your digestive system has been outfitted with a series of filters and\n\
processors, allowing you to reclaim waste liquid and, to a lesser degree,\n\
nutrients. The net effect is a greatly reduced need to eat and drink.");
unpowered_bionics.push_back("bio_recycler");
bionics["bio_digestion"] = new bionic_data("Expanded Digestive System", false, false, 0, 0, "\
You have been outfitted with three synthetic stomachs and industrial-grade\n\
intestines. Not only can you extract much more nutrition from food, but you\n\
are highly resistant to foodborne illness, and can sometimes eat rotten food.");
unpowered_bionics.push_back("bio_digestion");
bionics["bio_tools"] = new bionic_data("Integrated Toolset", false, false, 0, 0, "\
Implanted in your hands and fingers is a complete tool set - screwdriver,\n\
hammer, wrench, and heating elements. You can use this in place of many\n\
tools when crafting.");
unpowered_bionics.push_back("bio_tools");
bionics["bio_shock"] = new bionic_data("Electroshock Unit", false, false, 1, 0, "\
While fighting unarmed, or with a weapon that conducts electricity, there is\n\
a chance that a successful hit will shock your opponent, inflicting extra\n\
damage and disabling them temporarily at the cost of some energy.");
unpowered_bionics.push_back("bio_shock");
bionics["bio_heat_absorb"] = new bionic_data("Heat Drain", false, false, 1, 0, "\
While fighting unarmed against a warm-blooded opponent, there is a chance\n\
that a successful hit will drain body heat, inflicting a small amount of\n\
extra damage, and increasing your power reserves slightly.");
unpowered_bionics.push_back("bio_heat_absorb");
bionics["bio_carbon"] = new bionic_data("Subdermal Carbon Filament", false, false, 0, 0, "\
Lying just beneath your skin is a thin armor made of carbon nanotubes. This\n\
reduces bashing damage by 2 and cutting damage by 4.");
unpowered_bionics.push_back("bio_carbon");
bionics["bio_armor_head"] = new bionic_data("Alloy Plating - Head", false, false, 0, 0, "\
The flesh on your head has been replaced by a strong armor, protecting both\n\
your head and jaw regions.");
unpowered_bionics.push_back("bio_armor_head");
bionics["bio_armor_torso"] = new bionic_data("Alloy Plating - Torso", false, false, 0, 0, "\
The flesh on your torso has been replaced by a strong armor, protecting you\n\
greatly.");
unpowered_bionics.push_back("bio_armor_torso");
bionics["bio_armor_arms"] = new bionic_data("Alloy Plating - Arms", false, false, 0, 0, "\
The flesh on your arms has been replaced by a strong armor, protecting you\n\
greatly.");
unpowered_bionics.push_back("bio_armor_arms");
bionics["bio_armor_legs"] = new bionic_data("Alloy Plating - Legs", false, false, 0, 0, "\
The flesh on your legs has been replaced by a strong armor, protecting you\n\
greatly.");
unpowered_bionics.push_back("bio_armor_legs");
std::set<std::string> tags;
bionics["bio_flashlight"] = new bionic_data("Cranial Flashlight", false, true, 1, 30, "\
Mounted between your eyes is a small but powerful LED flashlight.");
bionics["bio_night_vision"] = new bionic_data("Implanted Night Vision", false, true, 1, 20, "\
Your eyes have been modified to amplify existing light, allowing you to see\n\
in the dark.");
bionics["bio_infrared"] = new bionic_data("Infrared Vision", false, true, 1, 4, "\
Your range of vision extends into the infrared, allowing you to see warm-\n\
blooded creatures in the dark, and even through walls.");
bionics["bio_face_mask"] = new bionic_data("Facial Distortion", false, true, 1, 10, "\
Your face is actually made of a compound which may be molded by electrical\n\
impulses, making you impossible to recognize. While not powered, however,\n\
the compound reverts to its default shape.");
bionics["bio_ads"] = new bionic_data("Active Defense System", false, true, 1, 7, "\
A thin forcefield surrounds your body, continually draining power. Anything\n\
attempting to penetrate this field has a chance of being deflected at the\n\
cost of more energy. Melee attacks will be stopped more often than bullets.");
bionics["bio_ods"] = new bionic_data("Offensive Defense System", false, true, 1, 6, "\
A thin forcefield surrounds your body, continually draining power. This\n\
field does not deflect penetration, but rather delivers a very strong shock,\n\
damaging unarmed attackers and those with a conductive weapon.");
bionics["bio_scent_mask"] = new bionic_data("Olfactory Mask", false, true, 1, 8, "\
While this system is powered, your body will produce very little odor, making\n\
it nearly impossible for creatures to track you by scent.");
if(bio.has("flags"))
{
tags = bio.get("flags").as_tags();
}
bionics["bio_scent_vision"] = new bionic_data("Scent Vision", false, true, 1, 30, "\
While this system is powered, you're able to visually sense your own scent,\n\
making it possible for you to recognize your surroundings even if you can't\n\
see it.");
bionics["bio_cloak"] = new bionic_data("Cloaking System", false, true, 2, 1, "\
This high-power system uses a set of cameras and LEDs to make you blend into\n\
your background, rendering you fully invisible to normal vision. However,\n\
you may be detected by infrared, sonar, etc.");
bionics["bio_painkiller"] = new bionic_data("Sensory Dulling", false, true, 2, 0, "\
Your nervous system is wired to allow you to inhibit the signals of pain,\n\
allowing you to dull your senses at will. However, the use of this system\n\
may cause delayed reaction time and drowsiness.");
bionics["bio_nanobots"] = new bionic_data("Repair Nanobots", false, true, 5, 0, "\
Inside your body is a fleet of tiny dormant robots. Once charged from your\n\
energy banks, they will flit about your body, repairing any damage.");
bionics["bio_heatsink"] = new bionic_data("Thermal Dissapation", false, true, 1, 6, "\
Powerful heatsinks supermaterials are woven into your flesh. While powered,\n\
this system will prevent heat damage up to 2000 degrees fahrenheit. Note\n\
that this does not affect your internal temperature.");
bionics["bio_resonator"] = new bionic_data("Sonic Resonator", false, true, 4, 0, "\
Your entire body may resonate at very high power, creating a short-range\n\
shockwave. While it will not to much damage to flexible creatures, stiff\n\
items such as walls, doors, and even robots will be severely damaged.");
// set up all the bionic parameters
std::string id = bio.get("id").as_string();
std::string name = bio.get("name").as_string();
int cost = bio.get("cost").as_int();
int time = bio.get("time").as_int();
std::string description = bio.get("description").as_string();
bool faulty = (tags.find("FAULTY") != tags.end());
bool powersource = (tags.find("POWER") != tags.end());
bool active = (tags.find("ACTIVE") != tags.end());
bionics["bio_time_freeze"] = new bionic_data("Time Dilation", false, true, 3, 0, "\
At an immense cost of power, you may increase your body speed and reactions\n\
dramatically, essentially freezing time. You are still delicate, however,\n\
and violent or rapid movements may damage you due to friction.");
bionics["bio_teleport"] = new bionic_data("Teleportation Unit", false, true, 10, 0, "\
This highly experimental unit folds space over short distances, instantly\n\
transporting your body up to 25 feet at the cost of much power. Note that\n\
prolonged or frequent use may have dangerous side effects.");
bionics["bio_blood_anal"] = new bionic_data("Blood Analysis", false, true, 1, 0, "\
Small sensors have been implanted in your heart, allowing you to analyse your\n\
blood. This will detect many illnesses, drugs, and other conditions.");
bionics["bio_blood_filter"] = new bionic_data("Blood Filter", false, true, 3, 0, "\
A filtration system in your heart allows you to actively filter out chemical\n\
impurities, primarily drugs. It will have limited impact on viruses. Note\n\
that it is not a targeted filter; ALL drugs in your system will be affected.");
bionics["bio_alarm"] = new bionic_data("Alarm System", false, true, 1, 400, "\
A motion-detecting alarm system will notice almost all movement within a\n\
fifteen-foot radius, and will silently alert you. This is very useful during\n\
sleep, or if you suspect a cloaked pursuer.");
bionics["bio_evap"] = new bionic_data("Aero-Evaporator", false, true, 8, 0, "\
This unit draws moisture from the surrounding air, which then is poured from\n\
a fingertip in the form of water. It may fail in very dry environments.");
bionics["bio_lighter"] = new bionic_data("Mini-Flamethrower", false, true, 3, 0, "\
The index fingers of both hands have powerful fire starters which extend from\n\
the tip.");
bionics["bio_claws"] = new bionic_data("Adamantium Claws", false, true, 3, 0, "\
Your fingers can withdraw into your hands, allowing a set of vicious claws to\n\
extend. These do considerable cutting damage, but prevent you from holding\n\
anything else.");
bionics[id] = new bionic_data(name, powersource, active, cost, time, description, faulty);
bionics["bio_blaster"] = new bionic_data("Fusion Blaster Arm", false, true, 2, 0, "\
Your left arm has been replaced by a heavy-duty fusion blaster! You may use\n\
your energy banks to fire a damaging heat ray; however, you are unable to use\n\
or carry two-handed items, and may only fire handguns.");
bionics["bio_laser"] = new bionic_data("Finger-Mounted Laser", false, true, 2, 0, "\
One of your fingers has a small high-powered laser embedded in it. This long\n\
range weapon is not incredibly damaging, but is very accurate, and has the\n\
potential to start fires.");
bionics["bio_emp"] = new bionic_data("Directional EMP", false, true, 4, 0, "\
Mounted in the palms of your hand are small parabolic EMP field generators.\n\
You may use power to fire a short-ranged blast which will disable electronics\n\
and robots.");
bionics["bio_hydraulics"] = new bionic_data("Hydraulic Muscles", false, true, 1, 3, "\
While activated, the muscles in your arms will be greatly enchanced,\n\
increasing your strength by 20.");
bionics["bio_water_extractor"] = new bionic_data("Water Extraction Unit", false, true, 2, 0, "\
Nanotubes embedded in the palm of your hand will pump any available fluid out\n\
of a dead body, cleanse it of impurities and convert it into drinkable water.\n\
You must, however, have a container to store the water in.");
bionics["bio_magnet"] = new bionic_data("Electromagnetic Unit", false, true, 2, 0, "\
Embedded in your hand is a powerful electromagnet, allowing you to pull items\n\
made of iron over short distances.");
bionics["bio_fingerhack"] = new bionic_data("Fingerhack", false, true, 1, 0, "\
One of your fingers has an electrohack embedded in it; an all-purpose hacking\n\
unit used to override control panels and the like (but not computers). Skill\n\
in computers is important, and a failed use may damage your circuits.");
bionics["bio_lockpick"] = new bionic_data("Fingerpick", false, true, 1, 0, "\
One of your fingers has an electronic lockpick embedded in it. This auto-\n\
matic system will quickly unlock all but the most advanced key locks without\n\
any skill required on the part of the user.");
// Don't add bio_null to any vectors.
if(id != "bio_null")
{
if(faulty)
{
faulty_bionics.push_back(id);
}
else if(powersource)
{
power_source_bionics.push_back(id);
}
else if(!active)
{
unpowered_bionics.push_back(id);
}
}
bionics["bio_ground_sonar"] = new bionic_data("Terranian Sonar", false, true, 1, 5, "\
Your feet are equipped with precision sonar equipment, allowing you to detect\n\
the movements of creatures below the ground.");
bionics["bio_power_armor_interface"] = new bionic_data("Power Armor Interface", false, true, 1, 10, "\
Interfaces your power system with the internal charging port on suits of power armor.");
//Fault Bionics from here on out.
bionics["bio_dis_shock"] = new bionic_data("Electrical Discharge", false, false, 0, 0, "\
A malfunctioning bionic which occasionally discharges electricity through\n\
your body, causing pain and brief paralysis but no damage.");
faulty_bionics.push_back("bio_dis_shock");
bionics["bio_dis_acid"] = new bionic_data("Acidic Discharge", false, false, 0, 0, "\
A malfunctioning bionic which occasionally discharges acid into your muscles,\n\
causing sharp pain and minor damage.");
faulty_bionics.push_back("bio_dis_shock");
bionics["bio_drain"] = new bionic_data("Electrical Drain", false, false, 0, 0, "\
A malfunctioning bionic. It doesn't perform any useful function, but will\n\
occasionally draw power from your batteries.");
faulty_bionics.push_back("bio_drain");
bionics["bio_noise"] = new bionic_data("Noisemaker", false, false, 0, 0, "\
A malfunctioning bionic. It will occasionally emit a loud burst of noise.");
faulty_bionics.push_back("bio_noise");
bionics["bio_power_weakness"] = new bionic_data("Power Overload", false, false, 0, 0, "\
Damaged power circuits cause short-circuiting inside your muscles when your\n\
batteries are above 75%%%% capacity, causing greatly reduced strength. This\n\
has no effect if you have no internal batteries.");
faulty_bionics.push_back("bio_power_weakness");
bionics["bio_stiff"] = new bionic_data("Wire-induced Stiffness", false, false, 0, 0, "\
Improperly installed wires cause a physical stiffness in most of your body,\n\
causing increased encumberance.");
faulty_bionics.push_back("bio_stiff");
}
}
+388
View File
@@ -0,0 +1,388 @@
#include "building_generation.h"
#include "output.h"
#include "item_factory.h"
mapgendata::mapgendata(oter_id north, oter_id east, oter_id south, oter_id west)
{
t_nesw[0] = north;
t_nesw[1] = east;
t_nesw[2] = south;
t_nesw[3] = west;
n_fac = 0;
e_fac = 0;
s_fac = 0;
w_fac = 0;
}
void mapgendata::set_dir(int dir_in, int val)
{
switch (dir_in)
{
case 0:
n_fac = val;
break;
case 1:
e_fac = val;
break;
case 2:
s_fac = val;
break;
case 3:
w_fac = val;
break;
default:
debugmsg("Invalid direction for mapgendata::set_dir. dir_in = %d", dir_in);
break;
}
}
void mapgendata::fill(int val)
{
n_fac = val;
e_fac = val;
s_fac = val;
w_fac = val;
}
int& mapgendata::dir(int dir_in)
{
switch (dir_in)
{
case 0:
return n_fac;
break;
case 1:
return e_fac;
break;
case 2:
return s_fac;
break;
case 3:
return w_fac;
break;
default:
debugmsg("Invalid direction for mapgendata::set_dir. dir_in = %d", dir_in);
//return something just so the compiler doesn't freak out. Not really correct, though.
return n_fac;
break;
}
}
ter_id grass_or_dirt()
{
if (one_in(4))
return t_grass;
return t_dirt;
}
ter_id dirt_or_pile()
{
if (one_in(4))
return t_dirtmound;
return t_dirt;
}
// helper functions below
void mapgen_null(map *m)
{
debugmsg("Generating terrain for ot_null, please report this as a bug");
for (int i = 0; i < SEEX * 2; i++)
{
for (int j = 0; j < SEEY * 2; j++)
{
m->ter_set(i, j, t_null);
m->radiation(i, j) = 0;
}
}
}
void mapgen_crater(map *m, mapgendata dat)
{
for(int i = 0; i < 4; i++)
{
if(dat.t_nesw[i] != ot_crater)
{
dat.set_dir(i, 6);
}
}
for (int i = 0; i < SEEX * 2; i++)
{
for (int j = 0; j < SEEY * 2; j++)
{
if (rng(0, dat.w_fac) <= i && rng(0, dat.e_fac) <= SEEX * 2 - 1 - i &&
rng(0, dat.n_fac) <= j && rng(0, dat.s_fac) <= SEEX * 2 - 1 - j )
{
m->ter_set(i, j, t_rubble);
m->radiation(i, j) = rng(0, 4) * rng(0, 2);
}
else
{
m->ter_set(i, j, t_dirt);
m->radiation(i, j) = rng(0, 2) * rng(0, 2) * rng(0, 2);
}
}
}
m->place_items("wreckage", 83, 0, 0, SEEX * 2 - 1, SEEY * 2 - 1, true, 0);
}
void mapgen_field(map *m, int turn)
{
for (int i = 0; i < SEEX * 2; i++)
{
for (int j = 0; j < SEEY * 2; j++)
{
m->ter_set(i, j, grass_or_dirt());
if (one_in(120))
{
if (one_in(30))
{
m->ter_set(i, j, t_shrub_blueberry);
}
else
if (one_in(30))
{
m->ter_set(i, j, t_shrub_strawberry);
}
else
{
m->ter_set(i, j, t_shrub);
}
}
else
if (one_in(1000)) { m->furn_set(i,j, f_mutpoppy); }
}
}
m->place_items("field", 60, 0, 0, SEEX * 2 - 1, SEEY * 2 - 1, true, turn);
}
void mapgen_dirtlot(map *m, game *g)
{
for (int i = 0; i < SEEX * 2; i++)
{
for (int j = 0; j < SEEY * 2; j++)
{
m->ter_set(i, j, t_dirt);
if (one_in(120))
{
m->ter_set(i, j, t_pit_shallow);
}
else if (one_in(50))
{
m->ter_set(i,j, t_grass);
}
}
}
if (one_in(4))
{
m->add_vehicle (g, veh_truck, 12, 12, 90, -1, -1);
}
}
void mapgen_forest_general(map *m, oter_id terrain_type, mapgendata dat, int turn)
{
switch (terrain_type)
{
case ot_forest_thick:
dat.fill(8);
break;
case ot_forest_water:
dat.fill(4);
break;
case ot_forest:
dat.fill(0);
break;
}
for (int i = 0; i < 4; i++)
{
if (dat.t_nesw[i] == ot_forest || dat.t_nesw[i] == ot_forest_water)
{
dat.dir(i) += 14;
}
else if (dat.t_nesw[i] == ot_forest_thick)
{
dat.dir(i) += 18;
}
}
for (int i = 0; i < SEEX * 2; i++)
{
for (int j = 0; j < SEEY * 2; j++)
{
int forest_chance = 0, num = 0;
if (j < dat.n_fac)
{
forest_chance += dat.n_fac - j;
num++;
}
if (SEEX * 2 - 1 - i < dat.e_fac)
{
forest_chance += dat.e_fac - (SEEX * 2 - 1 - i);
num++;
}
if (SEEY * 2 - 1 - j < dat.s_fac)
{
forest_chance += dat.s_fac - (SEEY * 2 - 1 - j);
num++;
}
if (i < dat.w_fac)
{
forest_chance += dat.w_fac - i;
num++;
}
if (num > 0)
{
forest_chance /= num;
}
int rn = rng(0, forest_chance);
if ((forest_chance > 0 && rn > 13) || one_in(100 - forest_chance))
{
if (one_in(250))
{
m->ter_set(i, j, t_tree_apple);
m->spawn_item(i, j, "apple", turn);
}
else
{
m->ter_set(i, j, t_tree);
}
}
else if ((forest_chance > 0 && rn > 10) || one_in(100 - forest_chance))
{
m->ter_set(i, j, t_tree_young);
}
else if ((forest_chance > 0 && rn > 9) || one_in(100 - forest_chance))
{
if (one_in(250))
{
m->ter_set(i, j, t_shrub_blueberry);
}
else
{
m->ter_set(i, j, t_underbrush);
}
}
else
{
m->ter_set(i, j, t_dirt);
}
}
}
m->place_items("forest", 60, 0, 0, SEEX * 2 - 1, SEEY * 2 - 1, true, turn);
if (terrain_type == ot_forest_water)
{
// Reset *_fac to handle where to place water
for (int i = 0; i < 4; i++)
{
if (dat.t_nesw[i] == ot_forest_water)
{
dat.set_dir(i, 2);
}
else if (dat.t_nesw[i] >= ot_river_center && dat.t_nesw[i] <= ot_river_nw)
{
dat.set_dir(i, 3);
}
else if (dat.t_nesw[i] == ot_forest || dat.t_nesw[i] == ot_forest_thick)
{
dat.set_dir(i, 1);
}
else
{
dat.set_dir(i, 0);
}
}
int x = SEEX / 2 + rng(0, SEEX), y = SEEY / 2 + rng(0, SEEY);
for (int i = 0; i < 20; i++)
{
if (x >= 0 && x < SEEX * 2 && y >= 0 && y < SEEY * 2)
{
if (m->ter(x, y) == t_water_sh)
{
m->ter_set(x, y, t_water_dp);
}
else if (m->ter(x, y) == t_dirt || m->ter(x, y) == t_underbrush)
{
m->ter_set(x, y, t_water_sh);
}
}
else
{
i = 20;
}
x += rng(-2, 2);
y += rng(-2, 2);
if (x < 0 || x >= SEEX * 2)
{
x = SEEX / 2 + rng(0, SEEX);
}
if (y < 0 || y >= SEEY * 2)
{
y = SEEY / 2 + rng(0, SEEY);
}
for (int j = 0; j < dat.n_fac; j++)
{
int wx = rng(0, SEEX * 2 -1), wy = rng(0, SEEY - 1);
if (m->ter(wx, wy) == t_dirt || m->ter(wx, wy) == t_underbrush)
{
m->ter_set(wx, wy, t_water_sh);
}
}
for (int j = 0; j < dat.e_fac; j++)
{
int wx = rng(SEEX, SEEX * 2 - 1), wy = rng(0, SEEY * 2 - 1);
if (m->ter(wx, wy) == t_dirt || m->ter(wx, wy) == t_underbrush)
{
m->ter_set(wx, wy, t_water_sh);
}
}
for (int j = 0; j < dat.s_fac; j++)
{
int wx = rng(0, SEEX * 2 - 1), wy = rng(SEEY, SEEY * 2 - 1);
if (m->ter(wx, wy) == t_dirt || m->ter(wx, wy) == t_underbrush)
{
m->ter_set(wx, wy, t_water_sh);
}
}
for (int j = 0; j < dat.w_fac; j++)
{
int wx = rng(0, SEEX - 1), wy = rng(0, SEEY * 2 - 1);
if (m->ter(wx, wy) == t_dirt || m->ter(wx, wy) == t_underbrush)
{
m->ter_set(wx, wy, t_water_sh);
}
}
}
int rn = rng(0, 2) * rng(0, 1) * (rng(0, 1) + rng(0, 1));// Good chance of 0
for (int i = 0; i < rn; i++)
{
x = rng(0, SEEX * 2 - 1);
y = rng(0, SEEY * 2 - 1);
m->add_trap(x, y, tr_sinkhole);
if (m->ter(x, y) != t_water_sh)
{
m->ter_set(x, y, t_dirt);
}
}
}
if (one_in(10000)) { //1-2 per overmap, very bad day for low level characters
m->add_spawn(mon_jabberwock, 1, SEEX, SEEY);
}
if (one_in(100)) // One in 100 forests has a spider living in it :o
{
for (int i = 0; i < SEEX * 2; i++)
{
for (int j = 0; j < SEEX * 2; j++)
{
if ((m->ter(i, j) == t_dirt || m->ter(i, j) == t_underbrush) && !one_in(3))
{
m->add_field(NULL, i, j, fd_web, rng(1, 3));
}
}
}
m->add_spawn(mon_spider_web, rng(1, 2), SEEX, SEEY);
}
}
+32
View File
@@ -0,0 +1,32 @@
#ifndef _BUILDING_GENERATION_H_
#define _BUILDING_GENERATION_H_
#include "omdata.h"
#include "map.h"
struct mapgendata
{
public:
oter_id t_nesw[4];
int n_fac; // dir == 0
int e_fac; // dir == 1
int s_fac; // dir == 2
int w_fac; // dir == 3
mapgendata(oter_id north, oter_id east, oter_id south, oter_id west);
void set_dir(int dir_in, int val);
void fill(int val);
int& dir(int dir_in);
};
ter_id grass_or_dirt();
ter_id dirt_or_pile();
// helper functions for mapgen.cpp, so that we can avoid having a massive switch statement (sorta)
void mapgen_null(map *m);
void mapgen_crater(map *m, mapgendata dat);
void mapgen_field(map *m, int turn);
void mapgen_dirtlot(map *m, game *g);
void mapgen_forest_general(map *m, oter_id terrain_type, mapgendata dat, int turn);
#endif
+5
View File
@@ -198,6 +198,11 @@ void calendar::increment()
standardize();
}
int calendar::getHour()
{
return hour;
}
void calendar::standardize()
{
if (second >= 60) {
+2 -3
View File
@@ -3,9 +3,6 @@
#include <string>
// How many minutes exist when the game starts - 8:00 AM
#define STARTING_MINUTES 480
// Convert minutes, hours, days to turns
#define MINUTES(x) ((x) * 10)
#define HOURS(x) ((x) * 600)
@@ -78,6 +75,8 @@ public:
void standardize(); // Ensure minutes <= 59, hour <= 23, etc.
int getHour(); // return hour
// Sunlight and day/night calcuations
int minutes_past_midnight() const; // Useful for sunrise/set calculations
moon_phase moon() const; // Find phase of moon
+207
View File
@@ -0,0 +1,207 @@
#include "catacharset.h"
#include <string.h>
#include "wcwidth.c"
//copied from SDL2_ttf code
unsigned UTF8_getch(const char **src, int *srclen)
{
const unsigned char *p = *(const unsigned char**)src;
int left = 0;
bool overlong = false;
bool underflow = false;
unsigned ch = UNKNOWN_UNICODE;
if (*srclen == 0) {
return UNKNOWN_UNICODE;
}
if (p[0] >= 0xFC) {
if ((p[0] & 0xFE) == 0xFC) {
if (p[0] == 0xFC && (p[1] & 0xFC) == 0x80) {
overlong = true;
}
ch = (unsigned) (p[0] & 0x01);
left = 5;
}
} else if (p[0] >= 0xF8) {
if ((p[0] & 0xFC) == 0xF8) {
if (p[0] == 0xF8 && (p[1] & 0xF8) == 0x80) {
overlong = true;
}
ch = (unsigned) (p[0] & 0x03);
left = 4;
}
} else if (p[0] >= 0xF0) {
if ((p[0] & 0xF8) == 0xF0) {
if (p[0] == 0xF0 && (p[1] & 0xF0) == 0x80) {
overlong = true;
}
ch = (unsigned) (p[0] & 0x07);
left = 3;
}
} else if (p[0] >= 0xE0) {
if ((p[0] & 0xF0) == 0xE0) {
if (p[0] == 0xE0 && (p[1] & 0xE0) == 0x80) {
overlong = true;
}
ch = (unsigned) (p[0] & 0x0F);
left = 2;
}
} else if (p[0] >= 0xC0) {
if ((p[0] & 0xE0) == 0xC0) {
if ((p[0] & 0xDE) == 0xC0) {
overlong = true;
}
ch = (unsigned) (p[0] & 0x1F);
left = 1;
}
} else {
if ((p[0] & 0x80) == 0x00) {
ch = (unsigned) p[0];
}
}
++*src;
--*srclen;
while (left > 0 && *srclen > 0) {
++p;
if ((p[0] & 0xC0) != 0x80) {
ch = UNKNOWN_UNICODE;
break;
}
ch <<= 6;
ch |= (p[0] & 0x3F);
++*src;
--*srclen;
--left;
}
if (left > 0) {
underflow = true;
}
if (overlong || underflow ||
(ch >= 0xD800 && ch <= 0xDFFF) ||
(ch == 0xFFFE || ch == 0xFFFF) || ch > 0x10FFFF) {
ch = UNKNOWN_UNICODE;
}
return ch;
}
//Calculate width of a unicode string
//Latin characters have a width of 1
//CJK characters have a width of 2, etc
int utf8_width(const char* s)
{
int len = strlen(s);
const char* ptr = s;
int w = 0;
while(len>0)
{
unsigned ch = UTF8_getch(&ptr, &len);
if(ch!=UNKNOWN_UNICODE) {
w += mk_wcwidth((wchar_t)ch);
} else {
continue;
}
}
return w;
}
//Convert cursor position to byte offset
//returns the first character position in bytes behind the cursor position.
//If the cursor is not on the first half of the character,
//prevpos (which points to the first byte of the cursor located char)
// should be a different value.
int cursorx_to_position(const char* line, int cursorx, int* prevpos)
{
int dummy;
int i=0, c=0, *p=prevpos?prevpos:&dummy;
*p = 0;
while(c<cursorx)
{
const char* utf8str = line+i;
int len = ANY_LENGTH;
unsigned ch = UTF8_getch(&utf8str, &len);
int cw = mk_wcwidth((wchar_t)ch);
len = ANY_LENGTH-len;
if(len<=0) len=1;
i+=len;
if(cw<=0) cw=1;
c+=cw;
if(c<=cursorx) *p = i;
}
return i;
}
//Erase character by unicode char width.
//Fill the characters with spaces.
//returns length modified
int erease_utf8_by_cw( char* t, int cw, int clen, int maxlen)
{
static char buf[8000]; //LOL
int c=0,i=0;
while(c<cw)
{
const char* utf8str = t+i;
int len = ANY_LENGTH;
unsigned ch = UTF8_getch(&utf8str, &len);
int cw = mk_wcwidth((wchar_t)ch);
len = ANY_LENGTH-len;
if(len<=0) len=1;
i+=len;
if(cw<=0) cw=1;
c+=cw;
}
if(cw==c && clen==i)
{
memset(t, ' ', clen);
return 0;
}
else
{
int filled = clen+c-cw;
memcpy(buf, t+i, maxlen-i);
memset(t, ' ', filled);
memcpy(t+filled, buf, maxlen-filled);
return filled-i;
}
}
//cut ut8 string by character size
//utf8_substr("正正正正", 1, 4) returns
// " 正 "
// Broken characters will be filled with space
std::string utf8_substr(std::string s, int start, int size)
{
static char buf[8000];
int len = strlen(s.c_str());
int pos;
strcpy(buf, s.c_str());
int begin = cursorx_to_position(buf, start, &pos);
if(begin!=pos)
{
const char* ts = buf+pos;
int l = ANY_LENGTH;
unsigned tc = UTF8_getch(&ts, &l);
int tw = mk_wcwidth((wchar_t)tc);
erease_utf8_by_cw(buf+pos, tw, tw, len-pos-1);
begin = pos+tw-1;
}
if(size>0)
{
int end = cursorx_to_position(buf, start+size-1, &pos);
if(end!=pos)
{
const char* ts = buf+pos;
int l = ANY_LENGTH;
unsigned tc = UTF8_getch(&ts, &l);
int tw = mk_wcwidth((wchar_t)tc);
erease_utf8_by_cw(buf+pos, tw, tw, len-pos-1);
end = pos+tw-1;
}
buf[end+1] = '\0';
}
return std::string(buf+start);
}
+18
View File
@@ -0,0 +1,18 @@
#ifndef CATACHARSET_H
#define CATACHARSET_H
#include <wchar.h>
#include <string>
#define ANY_LENGTH 5
#define UNKNOWN_UNICODE 0xFFFD
// get a unicode character from a utf8 string
unsigned UTF8_getch(const char **src, int *srclen);
// from wcwidth.c, return "cell" width of a unicode char
int mk_wcwidth(wchar_t ucs);
// convert cursorx value to byte position
int cursorx_to_position(const char* line, int cursorx, int* prevppos=NULL);
//erease for characters insertion
int erease_utf8_by_cw( char* t, int cw, int len, int maxlen);
int utf8_width(const char* s);
std::string utf8_substr(std::string s, int start, int size=-1);
#endif
+2 -2
View File
@@ -1,3 +1,3 @@
#!/usr/bin/env sh
DIR="$( cd "$( dirname "${BASH_SOURCE[0]}" )" && pwd )"
#!/bin/sh
DIR=`dirname "$0"`
cd $DIR && ./cataclysm
+18 -7
View File
@@ -1,9 +1,11 @@
#ifndef __CATACURSE__
#define __CATACURSE__
#if (defined _WIN32 || defined WINDOWS)
#define _WIN32_WINNT 0x0500
#define WIN32_LEAN_AND_MEAN
//#define VC_EXTRALEAN
#include <windows.h>
#include "windows.h"
#endif
#include <stdio.h>
typedef int chtype;
typedef unsigned short attr_t;
@@ -43,6 +45,7 @@ typedef struct
typedef struct{
bool touched;
char *chars;
int width_in_bytes;
char *FG;
char *BG;
//cursechar chars [80];
@@ -99,6 +102,7 @@ typedef struct {
#define KEY_BACKSPACE 0x107 /* Backspace */ //<---------not used
#define KEY_NPAGE 0x152 /* page down */
#define KEY_PPAGE 0x153 /* page up */
#define KEY_ENTER 0x157 /* enter */
/* Curses external declarations. */
@@ -116,7 +120,9 @@ int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl,
int wrefresh(WINDOW *win);
int refresh(void);
int getch(void);
int wgetch(WINDOW* win);
int mvgetch(int y, int x);
int mvwgetch(WINDOW* win, int y, int x);
int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...);
int mvprintw(int y, int x, const char *fmt, ...);
int werase(WINDOW *win);
@@ -125,6 +131,7 @@ int init_pair(short pair, short f, short b);
int wmove(WINDOW *win, int y, int x);
int getnstr(char *str, int size);
int clear(void);
int clearok(WINDOW *win);
int erase(void);
int endwin(void);
int mvwaddch(WINDOW *win, int y, int x, const chtype ch);
@@ -150,10 +157,14 @@ void timeout(int delay);//PORTABILITY, DUMMY FUNCTION
void set_escdelay(int delay);//PORTABILITY, DUMMY FUNCTION
int echo(void);
int noecho(void);
//Window Functions, Do not call these outside of catacurse.cpp
void WinDestroy();
bool WinCreate(bool initgl);
void CheckMessages();
int FindWin(WINDOW *wnd);
LRESULT CALLBACK ProcessMessages(HWND__ *hWnd,u_int32_t Msg,WPARAM wParam, LPARAM lParam);
//non-curses functions, Do not call these in the main game code
extern WINDOW* mainwin;
extern pairs *colorpairs;
WINDOW* curses_init();
int curses_destroy();
void curses_drawwindow(WINDOW* win);
void curses_delay(int delay);
void curses_timeout(int t);
int curses_getch(WINDOW* win);
int curses_start_color();
#endif
+18
View File
@@ -91,6 +91,24 @@ double catajson::as_double() const
return 0;
}
std::set<std::string> catajson::as_tags()
{
std::set<std::string> tags;
if (is_array())
{
for (set_begin(); has_curr(); next())
{
tags.insert( curr().as_string() );
}
}
else
{
// We should have gotten a string, if not an array.
tags.insert( as_string() );
}
return tags;
}
catajson catajson::get(std::string key) const
{
if (val.is<picojson::object>())
+3
View File
@@ -2,6 +2,7 @@
#define _CATAJSON_H_
#include "picojson.h"
#include <set>
class catajson
{
@@ -16,6 +17,8 @@ public:
int as_int() const;
bool as_bool() const;
double as_double() const;
// accessor for not-so-simple type
std::set<std::string> as_tags();
// accessors in the case of array or object values
catajson get(std::string key) const;
catajson get(int index) const;
+63
View File
@@ -48,3 +48,66 @@ ADDITIONS
unique among the set of such recipes), "decomp_learn" (the level (if any)
when you can learn it from disassembly), "book_learn" (a list of books that
teach the recipe, and the level they teach it at).
1.4 Adding/editing armour and how armour protection is calculated
1) Edit armor.json and add your armor item near similar types.
2) The fields are:
"type" : "ARMOR", // this must be ARMOR
"id" : "socks", // the identifier used by the game. Must be one continuous word, use underscores if necessary
"name" : "socks", // the name appearing in the examine box. Can be more than one word separated by spaces
"weight" : 1, // weight of armour
"color" : "blue", // ascii character colour
"covers" : ["FEET"], // where it covers. Possible options are TORSO, HEAD, EYES, MOUTH, ARMS, HANDS, LEGS, FEET
"to_hit" : 0, // to-hit bonus if using it as a melee weapon (whatever for?)
"storage" : 0, // how many volume storage slots it adds
"symbol" : "[", // ascii character
"description" : "Socks. Put 'em on your feet.", // description of armour
"price" : 100, // price of armour, used when bartering with NPCs
"material" : ["COTTON", "NULL"], // material types. See materials.json for possible options
"volume" : 1, // volume occupied
"cutting" : 0, // cutting damage caused by using it as a melee weapon
"warmth" : 10, // how much warmth clothing provides
"phase" : "solid", // what phase it is
"enviromental_protection" : 0, // how much environmental protection it affords
"rarity" : 70, // determines how often it spawns
"encumberance" : 0, // base encumbrance (unfitted value)
"bashing" : -5, // bashing damage caused by using it as a melee weapon
"flags" : ["VARSIZE"] // used to indicate clothing type which can be fitted. Leave out the flags field entirely if clothing cannot be fitted
"coverage" : 80, // what percentage of body part
"material_thickness" : 1 // thickness of material, in millimetre units (approximately). Generally ranges between 1 - 5, more unusual armour types go up to 10 or more
3) When the player is hit at a specific body part, armour coverage determines whether the armour is hit, or an uncovered part of the player is hit (roll 1d100 against coverage)
4) If the above roll fails (ie roll value is above coverage), then the armour does not absorb any damage from the blow, neither does it become damaged
5) If the above roll succeeds, the armour is hit, possibly absorbing some damage and possibly getting damaged in the process
6) The above steps are repeated for each layer of armour on the body part
7) Armour protects against bash and cut damage. These are determined by multiplying the armour thickness by the material bash/cut resistance factor respectively, given in materials.json
8) If the armour is made from 2 materials types, then it takes a weighted average of the primary material (66%) and secondary material (33%).
9) Materials resistance factors are given relative to PAPER as a material (this probably needs some fine-tuning for balance).
1.5 Adding a bionic
1) Edit data/raw/bionics.json and add your bionic near similar types.
2) Add the required attributes
id : "bio_rocketlauncher" // Text string used as identifier in the code.
name : "CBM: Rocket Launcher" // The bionic's name, as showed to the player.
cost : 10 // How many PUs it costs to use the bionic.
time : 0 // How long, when activated, between drawing cost. If 0, it draws power once.
description : "It's a rocket launcher, inside your arm!!" // A brief description of the bionic, as showed to the player.
3) Add any otional attributes
flags : ["ACTIVE"] // Used to flag the bionic as a specific type.
Supported flags:
"ACTIVE" : The bionic can be manually activated and deactivated.
"POWER" : The bionic provides a source of power.
"FAULTY" : The bionic is an unwanted one, will typically have negative effects.
Flags can be combined like so: ["ACTIVE","POWER","FAULTY"] (Don't add all these at once)
4) If you want the bionic to be available in the gameworld as an item, add it to itypedef.cpp
BIO_SINGLE(id, rarity, price, color, difficulty)
See 1.1 for more information about adding items.
+1 -1
View File
@@ -18,7 +18,7 @@ Successful dodges negate the attack and impose a cumulative penalty on dodges wi
Dodge Use Cases:
An individual with no skill and nominal stats in ideal circumstances against a basic opponent should occasionally be able to dodge.
An individual with no skill and nominal stats in ideal corcumstances against a skilled opponent should rarely if ever be able to dodge.
An individual with no skill and nominal stats in ideal circumstances against a skilled opponent should rarely if ever be able to dodge.
An individual with world-class dodging ability, in ideal circumstances against a basic opponent should have a negligible chance of failure.
+113 -7
View File
@@ -70,7 +70,9 @@ void computer::shutdown_terminal()
void computer::use(game *g)
{
if (w_terminal == NULL)
w_terminal = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
w_terminal = newwin(FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH,
(TERMY > FULL_SCREEN_HEIGHT) ? (TERMY-FULL_SCREEN_HEIGHT)/2 : 0,
(TERMX > FULL_SCREEN_WIDTH) ? (TERMX-FULL_SCREEN_WIDTH)/2 : 0);
wborder(w_terminal, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
@@ -274,7 +276,7 @@ void computer::activate_function(game *g, computer_action action)
if (g->m.ter(x, y) == t_sewage_pump) {
for (int x1 = x - 1; x1 <= x + 1; x1++) {
for (int y1 = y - 1; y1 <= y + 1; y1++ ) {
if (g->m.ter(x1, y1) == t_counter) {
if (g->m.furn(x1, y1) == f_counter) {
bool found_item = false;
for (int i = 0; i < g->m.i_at(x1, y1).size(); i++) {
item *it = &(g->m.i_at(x1, y1)[i]);
@@ -470,7 +472,7 @@ void computer::activate_function(game *g, computer_action action)
// For each level between here and the surface, remove the missile
for (int level = g->levz; level <= 0; level++)
{
map tmpmap(&g->itypes, &g->mapitems, &g->traps);
map tmpmap(&g->traps);
tmpmap.load(g, g->levx, g->levy, level, false);
if(level < 0)
@@ -512,7 +514,7 @@ void computer::activate_function(game *g, computer_action action)
for (int y = 0; y < SEEY * MAPSIZE; y++) {
for (int i = 0; i < g->m.i_at(x, y).size(); i++) {
if (g->m.i_at(x, y)[i].is_bionic()) {
if (names.size() < 9)
if (names.size() < TERMY - 8)
names.push_back(g->m.i_at(x, y)[i].tname());
else
more++;
@@ -520,10 +522,22 @@ void computer::activate_function(game *g, computer_action action)
}
}
}
reset_terminal();
print_line("");
print_line("Bionic access - Manifest:");
print_line("");
for (int i = 0; i < names.size(); i++)
print_line(names[i].c_str());
if (more > 0)
print_line("%d OTHERS FOUND...", more);
print_line("");
print_line("Press any key...");
getch();
} break;
case COMPACT_ELEVATOR_ON:
@@ -624,11 +638,11 @@ INITIATING STANDARD TREMOR TEST...");
case COMPACT_AMIGARA_START:
g->add_event(EVENT_AMIGARA, int(g->turn) + 10, 0, 0, 0);
if (!g->u.has_artifact_with(AEP_PSYSHIELD))
g->u.add_disease(DI_AMIGARA, 20, g);
g->u.add_disease("amigara", 20);
break;
case COMPACT_STEMCELL_TREATMENT:
g->u.add_disease(DI_STEMCELL_TREATMENT, 120, g);
g->u.add_disease("stemcell_treatment", 120);
print_line("The machine injects your eyeball with the solution \n\
of pureed bone & LSD.");
g->u.pain += rng(40,90);
@@ -693,6 +707,53 @@ of pureed bone & LSD.");
}
}
break;
case COMPACT_DATA_ANAL:
for (int x = g->u.posx - 2; x <= g->u.posx + 2; x++) {
for (int y = g->u.posy - 2; y <= g->u.posy + 2; y++) {
if (g->m.ter(x, y) == t_floor_blue) {
print_error("PROCESSING DATA");
if (g->m.i_at(x, y).empty()){
print_error("ERROR: Please place memory bank in scan area.");
query_any("Press any key to continue...");}
else if (g->m.i_at(x, y).size() > 1){
print_error("ERROR: Please only scan one item at a time.");
query_any("Press any key to continue...");}
else if (g->m.i_at(x, y)[0].type->id != "usb_drive" && g->m.i_at(x, y)[0].type->id != "black_box"){
print_error("ERROR: Memory bank destroyed or not present.");
query_any("Press any key to continue...");}
else if (g->m.i_at(x, y)[0].type->id == "usb_drive" && g->m.i_at(x, y)[0].contents.empty()){
print_error("ERROR: Memory bank is empty.");
query_any("Press any key to continue...");}
else { // Success!
if (g->m.i_at(x, y)[0].type->id == "usb_drive"){
print_line("Memory Bank: Unencrypted\nNothing of interest.");
query_any("Press any key to continue...");}
if (g->m.i_at(x, y)[0].type->id == "black_box"){
print_line("Memory Bank: Military Hexron Encryption\nPrinting Transcript\n");
query_any("Press any key to continue...");
item transcript(g->itypes["black_box_transcript"], g->turn);
g->m.add_item(g->u.posx, g->u.posy, transcript);
} else
print_line("Memory Bank: Unencrypted\nNothing of interest.\n");
query_any("Press any key to continue...");
reset_terminal();
}
}
}
}
break;
case COMPACT_DISCONNECT:
reset_terminal();
print_line("\n\
ERROR: NETWORK DISCONNECT \n\
UNABLE TO REACH NETWORK ROUTER OR PROXY. PLEASE CONTACT YOUR\n\
SYSTEM ADMINISTRATOR TO RESOLVE THIS ISSUE.\n\
\n");
query_any("Press any key to continue...");
reset_terminal();
break;
case COMPACT_EMERG_MESS:
print_line("\
@@ -940,6 +1001,26 @@ SHORTLY. TO ENSURE YOUR SAFETY PLEASE FOLLOW THE BELOW STEPS. \n\
}
}
break;
case COMPACT_SRCF_ELEVATOR:
if (!g->u.has_amount("sarcophagus_access_code", 1)){
print_error("Access code required!");
query_any("Press any key to continue...");}
else{
g->u.use_amount("sarcophagus_access_code", 1);
reset_terminal();
print_line("\nPower: Backup Only\nRadion Level: Very Dangerous\nOperational: Overrided\n\n");
query_any("Press any key to continue...");
for (int x = 0; x < SEEX * MAPSIZE; x++) {
for (int y = 0; y < SEEY * MAPSIZE; y++) {
if (g->m.ter(x, y) == t_elevator_control_off) {
g->m.ter_set(x, y, t_elevator_control);
}
}
}
}
break;
} // switch (action)
}
@@ -1058,7 +1139,7 @@ void computer::activate_failure(game *g, computer_failure fail)
case COMPFAIL_AMIGARA:
g->add_event(EVENT_AMIGARA, int(g->turn) + 5, 0, 0, 0);
g->u.add_disease(DI_AMIGARA, 20, g);
g->u.add_disease("amigara", 20);
g->explosion(rng(0, SEEX * MAPSIZE), rng(0, SEEY * MAPSIZE), 10, 10, false);
g->explosion(rng(0, SEEX * MAPSIZE), rng(0, SEEY * MAPSIZE), 10, 10, false);
break;
@@ -1089,6 +1170,31 @@ void computer::activate_failure(game *g, computer_failure fail)
}
getch();
break;
case COMPFAIL_DESTROY_DATA:
print_error("ERROR: ACCESSING DATA MALFUNCTION");
for (int x = 0; x <= 23; x++) {
for (int y = 0; y <= 23; y++) {
if (g->m.ter(x, y) == t_floor_blue) {
for (int i = 0; i < g->m.i_at(x, y).size(); i++) {
if (g->m.i_at(x, y).empty())
print_error("ERROR: Please place memory bank in scan area.");
else if (g->m.i_at(x, y).size() > 1)
print_error("ERROR: Please only scan one item at a time.");
else if (g->m.i_at(x, y)[0].type->id != "usb_drive")
print_error("ERROR: Memory bank destroyed or not present.");
else if (g->m.i_at(x, y)[0].contents.empty())
print_error("ERROR: Memory bank is empty.");
else {
print_error("ERROR: Data bank destroyed.");
g->m.i_at(x, y)[i].contents.clear();
}
}
}
}
}
getch();
break;
}// switch (fail)
}
+4
View File
@@ -33,6 +33,8 @@ enum computer_action
COMPACT_AMIGARA_START,
COMPACT_DOWNLOAD_SOFTWARE,
COMPACT_BLOOD_ANAL,
COMPACT_DATA_ANAL,
COMPACT_DISCONNECT,
COMPACT_STEMCELL_TREATMENT,
COMPACT_EMERG_MESS,
COMPACT_TOWER_UNRESPONSIVE,
@@ -45,6 +47,7 @@ enum computer_action
COMPACT_SRCF_3_MESS,
COMPACT_SRCF_SEAL_ORDER,
COMPACT_SRCF_SEAL,
COMPACT_SRCF_ELEVATOR,
NUM_COMPUTER_ACTIONS
};
@@ -60,6 +63,7 @@ enum computer_failure
COMPFAIL_PUMP_LEAK,
COMPFAIL_AMIGARA,
COMPFAIL_DESTROY_BLOOD,
COMPFAIL_DESTROY_DATA,
NUM_COMPUTER_FAILURES
};
+232 -171
View File
@@ -8,6 +8,7 @@
#include "skill.h"
#include "crafting.h" // For the use_comps use_tools functions
#include "item_factory.h"
#include "catacharset.h"
bool will_flood_stop(map *m, bool (&fill)[SEEX * MAPSIZE][SEEY * MAPSIZE],
int x, int y);
@@ -69,14 +70,21 @@ void game::init_construction()
TOOLCONT("primitive_axe");
TOOLCONT("chainsaw_on");
CONSTRUCT("Chop Up Log", 0, &construct::able_log, &construct::done_log);
CONSTRUCT("Chop Tree trunk into logs", 0, &construct::able_trunk, &construct::done_trunk_log);
STAGE(t_dirt, 20);
TOOL("ax");
TOOLCONT("primitive_axe");
TOOLCONT("chainsaw_on");
CONSTRUCT("Move Furniture", -1, &construct::able_furniture, &construct::done_furniture);
STAGE(t_null, 1);
CONSTRUCT("Chop Tree trunk into planks", 0, &construct::able_trunk, &construct::done_trunk_plank);
STAGE(t_dirt, 23);
TOOL("ax");
TOOLCONT("primitive_axe");
TOOLCONT("chainsaw_on");
TOOLCONT("saw");
CONSTRUCT("Move Furniture", -1, &construct::able_move, &construct::done_move);
STAGE(1);
CONSTRUCT("Clean Broken Window", 0, &construct::able_broken_window,
&construct::done_nothing);
@@ -141,7 +149,14 @@ void game::init_construction()
COMP("2x4", 10);
COMP("nail", 20);
CONSTRUCT("Build Log Wall", 2, &construct::able_pit, &construct::done_nothing);
CONSTRUCT("Build Log Wall", 2, &construct::able_dig, &construct::done_nothing);
STAGE(t_pit_shallow, 10);
TOOL("shovel");
TOOLCONT("primitive_shovel");
TOOLCONT("digging_stick");
STAGE(t_pit, 10);
TOOL("shovel");
TOOLCONT("primitive_shovel");
STAGE(t_wall_log_half, 20);
TOOL("shovel");
TOOLCONT("primitive_shovel");
@@ -155,7 +170,14 @@ void game::init_construction()
COMP("stick", 3);
COMPCONT("2x4", 6);
CONSTRUCT("Build Palisade Wall", 2, &construct::able_pit, &construct::done_nothing);
CONSTRUCT("Build Palisade Wall", 2, &construct::able_dig, &construct::done_nothing);
STAGE(t_pit_shallow, 10);
TOOL("shovel");
TOOLCONT("primitive_shovel");
TOOLCONT("digging_stick");
STAGE(t_pit, 10);
TOOL("shovel");
TOOLCONT("primitive_shovel");
STAGE(t_palisade, 20);
TOOL("shovel");
TOOLCONT("primitive_shovel");
@@ -168,7 +190,14 @@ void game::init_construction()
COMP("stick", 8);
COMPCONT("2x4", 8);
CONSTRUCT("Build Palisade Gate", 2, &construct::able_pit, &construct::done_nothing);
CONSTRUCT("Build Palisade Gate", 2, &construct::able_dig, &construct::done_nothing);
STAGE(t_pit_shallow, 10);
TOOL("shovel");
TOOLCONT("primitive_shovel");
TOOLCONT("digging_stick");
STAGE(t_pit, 10);
TOOL("shovel");
TOOLCONT("primitive_shovel");
STAGE(t_palisade_gate, 20);
TOOL("shovel");
TOOLCONT("primitive_shovel");
@@ -273,7 +302,7 @@ void game::init_construction()
// Base stuff
CONSTRUCT("Build Bulletin Board", 0, &construct::able_empty,
&construct::done_nothing);
STAGE(t_bulletin, 10)
STAGE(f_bulletin, 10)
TOOL("saw");
TOOL("hammer");
TOOLCONT("hatchet");
@@ -282,9 +311,9 @@ void game::init_construction()
COMP("nail", 8);
// Household stuff
CONSTRUCT("Build Dresser", 1, &construct::able_indoors,
CONSTRUCT("Build Dresser", 1, &construct::able_empty,
&construct::done_nothing);
STAGE(t_dresser, 20);
STAGE(f_dresser, 20);
TOOL("saw");
TOOL("hammer");
TOOLCONT("primitive_hammer");
@@ -293,9 +322,9 @@ void game::init_construction()
COMP("nail", 8);
COMP("2x4", 6);
CONSTRUCT("Build Bookcase", 1, &construct::able_indoors,
CONSTRUCT("Build Bookcase", 1, &construct::able_empty,
&construct::done_nothing);
STAGE(t_bookcase, 20);
STAGE(f_bookcase, 20);
TOOL("saw");
TOOL("hammer");
TOOLCONT("primitive_hammer");
@@ -304,9 +333,9 @@ void game::init_construction()
COMP("nail", 16);
COMP("2x4", 12);
CONSTRUCT("Build Locker", 1, &construct::able_indoors,
CONSTRUCT("Build Locker", 1, &construct::able_empty,
&construct::done_nothing);
STAGE(t_locker, 20);
STAGE(f_locker, 20);
TOOL("hammer");
TOOLCONT("primitive_hammer");
TOOLCONT("hatchet");
@@ -314,18 +343,18 @@ void game::init_construction()
COMP("sheet_metal", 2);
COMP("pipe", 8);
CONSTRUCT("Build Metal Rack", 1, &construct::able_indoors,
CONSTRUCT("Build Metal Rack", 1, &construct::able_empty,
&construct::done_nothing);
STAGE(t_rack, 20);
STAGE(f_rack, 20);
TOOL("hammer");
TOOLCONT("primitive_hammer");
TOOLCONT("hatchet");
TOOL("wrench");
COMP("pipe", 12);
CONSTRUCT("Build Counter", 0, &construct::able_indoors,
CONSTRUCT("Build Counter", 0, &construct::able_empty,
&construct::done_nothing);
STAGE(t_counter, 20);
STAGE(f_counter, 20);
TOOL("hammer");
TOOLCONT("primitive_hammer");
TOOLCONT("hatchet");
@@ -333,9 +362,9 @@ void game::init_construction()
COMP("nail", 8);
COMP("2x4", 6);
CONSTRUCT("Build Makeshift Bed", 0, &construct::able_indoors,
CONSTRUCT("Build Makeshift Bed", 0, &construct::able_empty,
&construct::done_nothing);
STAGE(t_makeshift_bed, 20);
STAGE(f_makeshift_bed, 20);
TOOL("hammer");
TOOLCONT("primitive_hammer");
TOOLCONT("hatchet");
@@ -346,12 +375,12 @@ void game::init_construction()
CONSTRUCT("Tape up window", 0, &construct::able_window_pane,
&construct::done_tape);
STAGE(t_null, 2);
STAGE(2);
COMP("duct_tape", 50);
CONSTRUCT("Deconstruct Furniture", 0, &construct::able_deconstruct,
&construct::done_deconstruct);
STAGE(t_null, 20);
STAGE(20);
TOOL("hammer");
TOOLCONT("primitive_hammer");
TOOLCONT("hatchet");
@@ -360,7 +389,7 @@ void game::init_construction()
TOOLCONT("toolset");
CONSTRUCT("Start vehicle construction", 0, &construct::able_empty, &construct::done_vehicle);
STAGE(t_null, 10);
STAGE(10);
COMP("frame", 1);
CONSTRUCT("Fence Posts", 0, &construct::able_dig,
@@ -379,14 +408,14 @@ void game::init_construction()
CONSTRUCT("Build Wood Stove", 0, &construct::able_empty,
&construct::done_nothing);
STAGE(t_woodstove, 10);
STAGE(f_woodstove, 10);
TOOL("hacksaw");
COMP("metal_tank", 1);
COMP("pipe", 1);
CONSTRUCT("Build Stone Fireplace", 0, &construct::able_empty,
&construct::done_nothing);
STAGE(t_fireplace, 40);
STAGE(f_fireplace, 40);
TOOL("hammer");
TOOLCONT("primitive_hammer");
TOOLCONT("shovel");
@@ -422,7 +451,7 @@ void game::construction_menu()
long ch;
bool exit = false;
inventory total_inv = crafting_inventory();
inventory total_inv = crafting_inventory(&u);
do {
// Erase existing list of constructions
@@ -468,10 +497,16 @@ void game::construction_menu()
int posx = 33, posy = 2;
for (int n = 0; n < current_con->stages.size(); n++) {
nc_color color_stage = (player_can_build(u, total_inv, current_con, n,
false, true) ?
c_white : c_dkgray);
mvwprintz(w_con, posy, 31, color_stage, "Stage %d: %s", n + 1,
current_con->stages[n].terrain == t_null? "" : terlist[current_con->stages[n].terrain].name.c_str());
false, true) ? c_white : c_dkgray);
const char* mes;
if (current_con->stages[n].terrain != t_null)
mes = terlist[current_con->stages[n].terrain].name.c_str();
else if (current_con->stages[n].furniture != f_null)
mes = furnlist[current_con->stages[n].furniture].name.c_str();
else
mes = "";
mvwprintz(w_con, posy, 31, color_stage, "Stage %d: %s", n + 1, mes);
posy++;
// Print tools
construction_stage stage = current_con->stages[n];
@@ -496,7 +531,7 @@ void game::construction_menu()
has_tool[i] = true;
col = c_green;
}
int length = item_controller->find_template(tool)->name.length();
int length = utf8_width(item_controller->find_template(tool)->name.c_str());
if (posx + length > 79) {
posy++;
posx = 33;
@@ -541,7 +576,7 @@ void game::construction_menu()
has_component[i] = true;
col = c_green;
}
int length = item_controller->find_template(comp.type)->name.length();
int length = utf8_width(item_controller->find_template(comp.type)->name.c_str());
if (posx + length > 79) {
posy++;
posx = 33;
@@ -711,7 +746,7 @@ bool game::player_can_build(player &p, inventory pinv, constructable* con,
void game::place_construction(constructable *con)
{
refresh_all();
inventory total_inv = crafting_inventory();
inventory total_inv = crafting_inventory(&u);
std::vector<point> valid;
for (int x = u.posx - 1; x <= u.posx + 1; x++) {
@@ -721,7 +756,10 @@ void game::place_construction(constructable *con)
construct test;
bool place_okay = (test.*(con->able))(this, point(x, y));
for (int i = 0; i < con->stages.size() && !place_okay; i++) {
if (m.ter(x, y) == con->stages[i].terrain)
ter_id t = con->stages[i].terrain; furn_id f = con->stages[i].furniture;
if ((t != t_null || f != f_null) &&
(m.ter(x, y) == t || t == t_null) &&
(m.furn(x, y) == f || f == f_null))
place_okay = true;
}
@@ -729,7 +767,10 @@ void game::place_construction(constructable *con)
// Make sure we're not trying to continue a construction that we can't finish
int starting_stage = 0, max_stage = -1;
for (int i = 0; i < con->stages.size(); i++) {
if (m.ter(x, y) == con->stages[i].terrain)
ter_id t = con->stages[i].terrain; furn_id f = con->stages[i].furniture;
if ((t != t_null || f != f_null) &&
(m.ter(x, y) == t || t == t_null) &&
(m.furn(x, y) == f || f == f_null))
starting_stage = i + 1;
}
for(int i = starting_stage; i < con->stages.size(); i++) {
@@ -746,15 +787,9 @@ void game::place_construction(constructable *con)
}
}
}
mvprintz(0, 0, c_red, "Pick a direction in which to construct:");
int dirx, diry;
get_direction(this, dirx, diry, input());
if (dirx == -2) {
add_msg("Invalid direction.");
if (!choose_adjacent("Contruct", dirx, diry))
return;
}
dirx += u.posx;
diry += u.posy;
bool point_is_okay = false;
for (int i = 0; i < valid.size() && !point_is_okay; i++) {
if (valid[i].x == dirx && valid[i].y == diry)
@@ -776,7 +811,10 @@ void game::place_construction(constructable *con)
// Figure out what stage to start at, and what stage is the maximum
int starting_stage = 0, max_stage = 0;
for (int i = 0; i < con->stages.size(); i++) {
if (m.ter(dirx, diry) == con->stages[i].terrain)
ter_id t = con->stages[i].terrain; furn_id f = con->stages[i].furniture;
if ((t != t_null || f != f_null) &&
(m.ter(dirx, diry) == t || t == t_null) &&
(m.furn(dirx, diry) == f || f == f_null))
starting_stage = i + 1;
if (player_can_build(u, total_inv, con, i, true))
max_stage = i;
@@ -794,8 +832,6 @@ void game::place_construction(constructable *con)
void game::complete_construction()
{
inventory map_inv;
map_inv.form_from_map(this, point(u.posx, u.posy), PICKUP_RANGE);
int stage_num = u.activity.values[0];
constructable *built = constructions[u.activity.index];
construction_stage stage = built->stages[stage_num];
@@ -807,13 +843,15 @@ void game::complete_construction()
u.practice(turn, "carpentry", 10);
for (int i = 0; i < 10; i++) {
if (!stage.components[i].empty())
consume_items(stage.components[i]);
consume_items(&u, stage.components[i]);
}
// Make the terrain change
int terx = u.activity.placement.x, tery = u.activity.placement.y;
if (stage.terrain != t_null)
m.ter_set(terx, tery, stage.terrain);
if (stage.furniture != f_null)
m.furn_set(terx, tery, stage.furniture);
// Strip off the first stage in our list...
u.activity.values.erase(u.activity.values.begin());
@@ -832,7 +870,8 @@ void game::complete_construction()
bool construct::able_empty(game *g, point p)
{
return (g->m.move_cost(p.x, p.y) == 2);
return (g->m.has_flag(flat, p.x, p.y) && !g->m.has_furn(p.x, p.y) &&
g->is_empty(p.x, p.y) && g->m.tr_at(p.x, p.y) == tr_null);
}
bool construct::able_tree(game *g, point p)
@@ -840,15 +879,15 @@ bool construct::able_tree(game *g, point p)
return (g->m.ter(p.x, p.y) == t_tree);
}
bool construct::able_log(game *g, point p)
bool construct::able_trunk(game *g, point p)
{
return (g->m.ter(p.x, p.y) == t_log);
return (g->m.ter(p.x, p.y) == t_trunk);
}
bool construct::able_furniture(game *g, point p)
bool construct::able_move(game *g, point p)
{
ter_t terrain_type = terlist[g->m.ter(p.x, p.y)];
int required_str = terrain_type.move_str_req;
furn_t furniture_type = furnlist[g->m.furn(p.x, p.y)];
int required_str = furniture_type.move_str_req;
// Object can not be moved
if (required_str < 0)
@@ -917,11 +956,6 @@ bool construct::able_wall_wood(game *g, point p)
return (g->m.ter(p.x, p.y) == t_wall_wood);
}
bool construct::able_indoors(game *g, point p)
{
return g->m.has_flag(indoors, p.x, p.y) && able_empty(g, p);
}
bool construct::able_dig(game *g, point p)
{
return (g->m.has_flag(diggable, p.x, p.y));
@@ -944,7 +978,8 @@ bool construct::able_between_walls(game *g, point p)
(g->m.has_flag(supports_roof, p.x -1, p.y) && g->m.has_flag(supports_roof, p.x, p.y -1)) ||
(g->m.has_flag(supports_roof, p.x +1, p.y) && g->m.has_flag(supports_roof, p.x, p.y +1)) ||
(g->m.has_flag(supports_roof, p.x +1, p.y) && g->m.has_flag(supports_roof, p.x, p.y -1)) ||
(g->m.has_flag(supports_roof, p.x, p.y -1) && g->m.has_flag(supports_roof, p.x, p.y +1)));
(g->m.has_flag(supports_roof, p.x, p.y -1) && g->m.has_flag(supports_roof, p.x, p.y +1))) &&
(g->m.move_cost(p.x, p.y) != 0);
}
bool construct::able_deconstruct(game *g, point p)
@@ -954,10 +989,10 @@ bool construct::able_deconstruct(game *g, point p)
void construct::done_window_pane(game *g, point p)
{
g->m.spawn_item(g->u.posx, g->u.posy, item_controller->find_template("glass_sheet"), 0);
g->m.spawn_item(g->u.posx, g->u.posy, "glass_sheet", 0);
}
void construct::done_furniture(game *g, point p)
void construct::done_move(game *g, point p)
{
mvprintz(0, 0, c_red, "Press a direction for the furniture to move (. to cancel):");
int x = 0, y = 0;
@@ -970,15 +1005,16 @@ void construct::done_furniture(game *g, point p)
return;
x += p.x;
y += p.y;
if(g->m.ter(x, y) != t_floor || !g->is_empty(x, y)) {
if(!able_empty(g, point(x, y))) {
mvprintz(0, 0, c_red, "Can't move furniture there! Choose a direction with open floor.");
continue;
}
break;
}
g->m.ter_set(x, y, g->m.ter(p.x, p.y));
g->m.ter_set(p.x, p.y, t_floor);
g->sound(x, y, furnlist[g->m.furn(p.x, p.y)].move_str_req * 2, "a scraping noise");
g->m.furn_set(x, y, g->m.furn(p.x, p.y));
g->m.furn_set(p.x, p.y, f_null);
//Move all Items within a container
std::vector <item> vItemMove = g->m.i_at(p.x, p.y);
@@ -1000,19 +1036,33 @@ void construct::done_tree(game *g, point p)
std::vector<point> tree = line_to(p.x, p.y, x, y, rng(1, 8));
for (int i = 0; i < tree.size(); i++) {
g->m.destroy(g, tree[i].x, tree[i].y, true);
g->m.ter_set(tree[i].x, tree[i].y, t_log);
g->m.ter_set(tree[i].x, tree[i].y, t_trunk);
}
}
void construct::done_log(game *g, point p)
void construct::done_trunk_log(game *g, point p)
{
g->m.spawn_item(p.x, p.y, item_controller->find_template("log"), int(g->turn), rng(5, 15));
g->m.spawn_item(p.x, p.y, "log", int(g->turn), rng(5, 15));
}
void construct::done_trunk_plank(game *g, point p)
{
int num_logs = rng(5, 15);
for( int i = 0; i < num_logs; ++i ) {
item tmplog(g->itypes["log"], int(g->turn), g->nextinv);
iuse::cut_log_into_planks( g, &(g->u), &tmplog);
}
}
void construct::done_vehicle(game *g, point p)
{
std::string name = string_input_popup("Enter new vehicle name", 20);
std::string name = string_input_popup("Enter new vehicle name:", 20);
if(name.empty())
{
name = "Car";
}
vehicle *veh = g->m.add_vehicle (g, veh_custom, p.x, p.y, 270, 0, 0);
if (!veh)
{
@@ -1021,6 +1071,10 @@ void construct::done_vehicle(game *g, point p)
}
veh->name = name;
veh->install_part (0, 0, vp_frame_v2);
//Update the vehicle cache immediately, or the vehicle will be invisible for the first couple of turns.
g->m.update_vehicle_cache(veh, true);
}
void construct::done_tape(game *g, point p)
@@ -1042,110 +1096,117 @@ void construct::done_tape(game *g, point p)
void construct::done_deconstruct(game *g, point p)
{
g->add_msg("You disassemble the %s.", g->m.tername(p.x, p.y).c_str());
switch (g->m.ter(p.x, p.y))
{
case t_makeshift_bed:
case t_bed:
case t_armchair:
g->m.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 9);
g->m.spawn_item(p.x, p.y, item_controller->find_template("rag"), 0, 9);
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,8));
g->m.ter_set(p.x, p.y, t_floor);
break;
case t_door_c:
case t_door_o:
g->m.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 3);
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,12));
g->m.ter_set(p.x, p.y, t_door_frame);
break;
case t_window_domestic:
g->m.spawn_item(p.x, p.y, item_controller->find_template("stick"), 0);
g->m.spawn_item(p.x, p.y, item_controller->find_template("sheet"), 0, 1);
g->m.spawn_item(p.x, p.y, item_controller->find_template("glass_sheet"), 0);
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, 3);
g->m.spawn_item(p.x, p.y, item_controller->find_template("string_36"), 0, 0, 1);
g->m.ter_set(p.x, p.y, t_window_empty);
break;
case t_window:
g->m.spawn_item(p.x, p.y, item_controller->find_template("glass_sheet"), 0);
g->m.ter_set(p.x, p.y, t_window_empty);
break;
case t_backboard:
g->m.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 4);
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,10));
g->m.ter_set(p.x, p.y, t_pavement);
break;
case t_sandbox:
case t_bench:
case t_crate_o:
case t_crate_c:
g->m.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 4);
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,10));
g->m.ter_set(p.x, p.y, t_floor);
break;
case t_chair:
case t_cupboard:
case t_desk:
case t_bulletin:
g->m.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 4);
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,10));
g->m.ter_set(p.x, p.y, t_floor);
break;
case t_slide:
g->m.spawn_item(p.x, p.y, item_controller->find_template("sheet_metal"), 0);
g->m.spawn_item(p.x, p.y, item_controller->find_template("pipe"), 0, rng(4,8));
g->m.ter_set(p.x, p.y, t_grass);
break;
case t_locker:
g->m.spawn_item(p.x, p.y, item_controller->find_template("sheet_metal"), 0);
g->m.spawn_item(p.x, p.y, item_controller->find_template("pipe"), 0, rng(4,8));
g->m.ter_set(p.x, p.y, t_floor);
break;
case t_rack:
g->m.spawn_item(p.x, p.y, item_controller->find_template("pipe"), 0, rng(6,12));
g->m.ter_set(p.x, p.y, t_floor);
break;
case t_monkey_bars:
g->m.spawn_item(p.x, p.y, item_controller->find_template("pipe"), 0, rng(6,12));
g->m.ter_set(p.x, p.y, t_grass);
break;
case t_fridge:
g->m.spawn_item(p.x, p.y, item_controller->find_template("scrap"), 0, rng(2,6));
g->m.spawn_item(p.x, p.y, item_controller->find_template("steel_chunk"), 0, rng(2,3));
g->m.ter_set(p.x, p.y, t_floor);
break;
case t_counter:
case t_dresser:
case t_table:
g->m.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 6);
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,8));
g->m.ter_set(p.x, p.y, t_floor);
break;
case t_pool_table:
g->m.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 4);
g->m.spawn_item(p.x, p.y, item_controller->find_template("rag"), 0, 4);
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(6,10));
g->m.ter_set(p.x, p.y, t_floor);
break;
case t_bookcase:
g->m.spawn_item(p.x, p.y, item_controller->find_template("2x4"), 0, 12);
g->m.spawn_item(p.x, p.y, item_controller->find_template("nail"), 0, 0, rng(12,16));
g->m.ter_set(p.x, p.y, t_floor);
break;
if (g->m.has_furn(p.x, p.y)) {
g->add_msg("You disassemble the %s.", g->m.furnname(p.x, p.y).c_str());
switch (g->m.furn(p.x, p.y)){
case f_makeshift_bed:
case f_bed:
case f_armchair:
g->m.spawn_item(p.x, p.y, "2x4", 0, 10);
g->m.spawn_item(p.x, p.y, "rag", 0, rng(10,15));
g->m.spawn_item(p.x, p.y, "nail", 0, 0, rng(6,8));
g->m.furn_set(p.x, p.y, f_null);
case f_bench:
case f_crate_o:
case f_crate_c:
case f_chair:
case f_cupboard:
case f_desk:
case f_bulletin:
g->m.spawn_item(p.x, p.y, "2x4", 0, 4);
g->m.spawn_item(p.x, p.y, "nail", 0, 0, rng(6,10));
g->m.furn_set(p.x, p.y, f_null);
break;
case f_locker:
g->m.spawn_item(p.x, p.y, "sheet_metal", 0, rng(1,2));
g->m.spawn_item(p.x, p.y, "pipe", 0, rng(4,8));
g->m.furn_set(p.x, p.y, f_null);
break;
case f_rack:
g->m.spawn_item(p.x, p.y, "pipe", 0, rng(6,12));
g->m.furn_set(p.x, p.y, f_null);
break;
case f_oven:
g->m.spawn_item(p.x, p.y, "scrap", 0, rng(2,6));
g->m.spawn_item(p.x, p.y, "steel_chunk", 0, rng(2,3));
g->m.spawn_item(p.x, p.y, "element", 0, rng(1,4));
g->m.furn_set(p.x, p.y, f_null);
case f_fridge:
g->m.spawn_item(p.x, p.y, "scrap", 0, rng(2,6));
g->m.spawn_item(p.x, p.y, "steel_chunk", 0, rng(2,3));
g->m.spawn_item(p.x, p.y, "hose", 0, 1);
g->m.furn_set(p.x, p.y, f_null);
break;
case f_glass_fridge:
g->m.spawn_item(p.x, p.y, "scrap", 0, rng(2,6));
g->m.spawn_item(p.x, p.y, "steel_chunk", 0, rng(2,3));
g->m.spawn_item(p.x, p.y, "hose", 0, 1);
g->m.spawn_item(p.x, p.y, "glass_sheet", 0, 1);
g->m.furn_set(p.x, p.y, f_null);
break;
case f_counter:
case f_dresser:
case f_table:
g->m.spawn_item(p.x, p.y, "2x4", 0, 6);
g->m.spawn_item(p.x, p.y, "nail", 0, 0, rng(6,8));
g->m.furn_set(p.x, p.y, f_null);
break;
case f_pool_table:
g->m.spawn_item(p.x, p.y, "2x4", 0, 4);
g->m.spawn_item(p.x, p.y, "rag", 0, 4);
g->m.spawn_item(p.x, p.y, "nail", 0, 0, rng(6,10));
g->m.furn_set(p.x, p.y, f_null);
break;
case f_bookcase:
g->m.spawn_item(p.x, p.y, "2x4", 0, 12);
g->m.spawn_item(p.x, p.y, "nail", 0, 0, rng(12,16));
g->m.furn_set(p.x, p.y, f_null);
break;
default:
g->add_msg("You have to push away %s first.", g->m.furnname(p.x, p.y).c_str());
break;
}
} else {
g->add_msg("You disassemble the %s.", g->m.tername(p.x, p.y).c_str());
switch (g->m.ter(p.x, p.y))
{
case t_door_c:
case t_door_o:
g->m.spawn_item(p.x, p.y, "2x4", 0, 4);
g->m.spawn_item(p.x, p.y, "nail", 0, 0, rng(6,12));
g->m.ter_set(p.x, p.y, t_door_frame);
break;
case t_window_domestic:
g->m.spawn_item(p.x, p.y, "stick", 0);
g->m.spawn_item(p.x, p.y, "sheet", 0, 2);
g->m.spawn_item(p.x, p.y, "glass_sheet", 0);
g->m.spawn_item(p.x, p.y, "nail", 0, 0, rng(3,4));
g->m.spawn_item(p.x, p.y, "string_36", 0, 0, 1);
g->m.ter_set(p.x, p.y, t_window_empty);
break;
case t_window:
g->m.spawn_item(p.x, p.y, "glass_sheet", 0);
g->m.ter_set(p.x, p.y, t_window_empty);
break;
case t_backboard:
g->m.spawn_item(p.x, p.y, "2x4", 0, 4);
g->m.spawn_item(p.x, p.y, "nail", 0, 0, rng(6,10));
g->m.ter_set(p.x, p.y, t_pavement);
break;
case t_sandbox:
g->m.spawn_item(p.x, p.y, "2x4", 0, 4);
g->m.spawn_item(p.x, p.y, "nail", 0, 0, rng(6,10));
g->m.ter_set(p.x, p.y, t_floor);
break;
case t_slide:
g->m.spawn_item(p.x, p.y, "sheet_metal", 0);
g->m.spawn_item(p.x, p.y, "pipe", 0, rng(4,8));
g->m.ter_set(p.x, p.y, t_grass);
break;
case t_monkey_bars:
g->m.spawn_item(p.x, p.y, "pipe", 0, rng(6,12));
g->m.ter_set(p.x, p.y, t_grass);
break;
}
}
}
+11 -6
View File
@@ -7,12 +7,17 @@ struct construct;
struct construction_stage
{
ter_id terrain;
furn_id furniture;
int time; // In minutes, i.e. 10 turns
std::vector<component> tools[10];
std::vector<component> components[10];
construction_stage(ter_id Terrain, int Time) :
terrain (Terrain), time (Time) { };
terrain (Terrain), furniture(f_null), time (Time) { };
construction_stage(furn_id Furniture, int Time) :
terrain (t_null), furniture (Furniture), time (Time) { };
construction_stage(int Time) :
terrain (t_null), furniture (f_null), time (Time) { };
};
struct constructable
@@ -49,7 +54,6 @@ struct construct // Construction functions.
bool able_wall (game *, point); // Able if tile is wall
bool able_wall_wood(game *g, point); // Only player-built walls
bool able_indoors(game *g, point); // Able on floors
bool able_between_walls(game *, point); // Flood-fill contained by walls
@@ -58,9 +62,9 @@ struct construct // Construction functions.
bool able_pit(game *, point); // Able only on pits
bool able_tree(game *, point); // Able on trees
bool able_log(game *, point); // Able on logs
bool able_trunk(game *, point); // Able on tree trunks
bool able_furniture(game *, point); // Able on furniture
bool able_move(game *, point); // Able on furniture
bool able_deconstruct(game *, point);
@@ -69,8 +73,9 @@ struct construct // Construction functions.
void done_window_pane(game *, point);
void done_vehicle(game *, point);
void done_tree(game *, point);
void done_log(game *, point);
void done_furniture(game *, point);
void done_trunk_log(game *, point);
void done_trunk_plank(game *, point);
void done_move(game *, point);
void done_tape(game *, point);
void done_deconstruct(game *, point);
+262 -182
View File
@@ -10,6 +10,7 @@
#include "crafting.h"
#include "inventory.h"
#include "item_factory.h"
#include "catacharset.h"
//apparently we can't declare this in crafting.h? Complained about multiple definition.
std::vector<craft_cat> craft_cat_list;
@@ -44,8 +45,8 @@ void game::init_recipes()
bool autolearn = curr.get("autolearn").as_bool();
// optional fields
bool reversible = curr.has("reversible") ? curr.get("reversible").as_bool() : false;
const char *skill1 = curr.has("skill_pri") ? curr.get("skill_pri").as_string().c_str() : NULL;
const char *skill2 = curr.has("skill_sec") ? curr.get("skill_sec").as_string().c_str() : NULL;
std::string skill1 = curr.has("skill_pri") ? curr.get("skill_pri").as_string() : "";
std::string skill2 = curr.has("skill_sec") ? curr.get("skill_sec").as_string() : "";
std::string id_suffix = curr.has("id_suffix") ? curr.get("id_suffix").as_string() : "";
int learn_by_disassembly = curr.has("decomp_learn") ? curr.get("decomp_learn").as_int() : -1;
@@ -65,7 +66,7 @@ void game::init_recipes()
{
if ((*name_iter) == rec_name)
{
debugmsg("Recipe name collision: %s", rec_name.c_str());
debugmsg("Recipe name collision (set a unique value for the id_suffix field to fix): %s", rec_name.c_str());
}
}
@@ -186,7 +187,7 @@ bool game::making_would_work(recipe *making)
bool game::can_make(recipe *r)
{
bool RET_VAL = true;
inventory crafting_inv = crafting_inventory();
inventory crafting_inv = crafting_inventory(&u);
if(!u.knows_recipe(r))
{
return false;
@@ -355,7 +356,7 @@ bool game::check_enough_materials(recipe *r, inventory crafting_inv)
}
++comp_it;
}
if (!atleast_one_available)
// this set doesn't have any components available, so the recipe can't be crafted
{
@@ -364,7 +365,7 @@ bool game::check_enough_materials(recipe *r, inventory crafting_inv)
++comp_set_it;
}
std::vector<std::vector<component> > &tools = r->tools;
std::vector<std::vector<component> >::iterator tool_set_it = tools.begin();
while (tool_set_it != tools.end())
@@ -434,7 +435,7 @@ bool game::check_enough_materials(recipe *r, inventory crafting_inv)
}
++tool_it;
}
if (!atleast_one_available)
// this set doesn't have any tools available, so the recipe can't be crafted
{
@@ -442,7 +443,7 @@ bool game::check_enough_materials(recipe *r, inventory crafting_inv)
}
++tool_set_it;
}
return RET_VAL;
}
@@ -508,8 +509,8 @@ recipe* game::select_crafting_recipe()
const int dataLines=(int)(dataHalfLines*2); // old: 18
const int dataHeight=dataLines+4; // old: 22
WINDOW *w_head = newwin( 3, 80, 0, (TERMX > 80) ? (TERMX -80)/2 : 0);
WINDOW *w_data = newwin(dataHeight, 80, 3, (TERMX > 80) ? (TERMX -80)/2 : 0);
WINDOW *w_head = newwin( 3, FULL_SCREEN_WIDTH, 0, (TERMX > FULL_SCREEN_WIDTH) ? (TERMX-FULL_SCREEN_WIDTH)/2 : 0);
WINDOW *w_data = newwin(dataHeight, FULL_SCREEN_WIDTH, 3, (TERMX > FULL_SCREEN_WIDTH) ? (TERMX -FULL_SCREEN_WIDTH)/2 : 0);
craft_cat tab = "CC_WEAPON";
@@ -522,7 +523,7 @@ recipe* game::select_crafting_recipe()
recipe *chosen = NULL;
InputEvent input;
inventory crafting_inv = crafting_inventory();
inventory crafting_inv = crafting_inventory(&u);
std::string filterstring = "";
do {
if (redraw)
@@ -543,22 +544,22 @@ recipe* game::select_crafting_recipe()
mvwprintz(w_data, dataLines+1, 5, c_white, "[?/E]: Describe, [F]ind , [R]eset");
}
else
{
{
mvwprintz(w_data, dataLines+1, 5, c_white, "[?/E]: Describe, [F]ind");
}
mvwprintz(w_data, dataLines+2, 5, c_white, "Press <ENTER> to attempt to craft object.");
for (int i = 0; i < 80; i++)
for (int i = 0; i < FULL_SCREEN_WIDTH; i++)
{
mvwputch(w_data, dataHeight-1, i, c_ltgray, LINE_OXOX);
if (i < dataHeight-1)
{
mvwputch(w_data, i, 0, c_ltgray, LINE_XOXO);
mvwputch(w_data, i, 79, c_ltgray, LINE_XOXO);
mvwputch(w_data, i, FULL_SCREEN_WIDTH-1, c_ltgray, LINE_XOXO);
}
}
mvwputch(w_data, dataHeight-1, 0, c_ltgray, LINE_XXOO); // _|
mvwputch(w_data, dataHeight-1, 79, c_ltgray, LINE_XOOX); // |_
mvwputch(w_data, dataHeight-1, FULL_SCREEN_WIDTH-1, c_ltgray, LINE_XOOX); // |_
int recmin = 0, recmax = current.size();
if(recmax > dataLines)
@@ -682,7 +683,7 @@ recipe* game::select_crafting_recipe()
itype_id type = current[line]->tools[i][j].type;
int charges = current[line]->tools[i][j].count;
nc_color toolcol = c_red;
if (current[line]->tools[i][j].available == 0)
{
toolcol = c_brown;
@@ -704,16 +705,16 @@ recipe* game::select_crafting_recipe()
toolinfo << "(" << charges << " charges) ";
}
std::string toolname = toolinfo.str();
if (xpos + toolname.length() >= 80)
if (xpos + utf8_width(toolname.c_str()) >= FULL_SCREEN_WIDTH)
{
xpos = 32;
ypos++;
}
mvwprintz(w_data, ypos, xpos, toolcol, toolname.c_str());
xpos += toolname.length();
xpos += utf8_width(toolname.c_str());
if (j < current[line]->tools[i].size() - 1)
{
if (xpos >= 77)
if (xpos >= FULL_SCREEN_WIDTH-3)
{
xpos = 32;
ypos++;
@@ -758,16 +759,16 @@ recipe* game::select_crafting_recipe()
std::stringstream dump;
dump << abs(count) << "x " << item_controller->find_template(type)->name << " ";
std::string compname = dump.str();
if (xpos + compname.length() >= 80)
if (xpos + utf8_width(compname.c_str()) >= FULL_SCREEN_WIDTH)
{
ypos++;
xpos = 32;
}
mvwprintz(w_data, ypos, xpos, compcol, compname.c_str());
xpos += compname.length();
xpos += utf8_width(compname.c_str());
if (j < current[line]->components[i].size() - 1)
{
if (xpos >= 77)
if (xpos >= FULL_SCREEN_WIDTH-3)
{
ypos++;
xpos = 32;
@@ -848,7 +849,7 @@ recipe* game::select_crafting_recipe()
redraw = true;
break;
case Filter:
filterstring = string_input_popup("Search :",55,filterstring);
filterstring = string_input_popup("Search:", 55, filterstring);
redraw = true;
break;
case Reset:
@@ -879,7 +880,7 @@ recipe* game::select_crafting_recipe()
void draw_recipe_tabs(WINDOW *w, craft_cat tab,bool filtered)
{
werase(w);
for (int i = 0; i < 80; i++)
for (int i = 0; i < FULL_SCREEN_WIDTH; i++)
{
mvwputch(w, 2, i, c_ltgray, LINE_OXOX);
}
@@ -905,14 +906,14 @@ void draw_recipe_tabs(WINDOW *w, craft_cat tab,bool filtered)
wrefresh(w);
}
inventory game::crafting_inventory(){
inventory game::crafting_inventory(player *p){
inventory crafting_inv;
crafting_inv.form_from_map(this, point(u.posx, u.posy), PICKUP_RANGE);
crafting_inv += u.inv;
crafting_inv += u.weapon;
if (u.has_bionic("bio_tools")) {
crafting_inv.form_from_map(this, point(p->posx, p->posy), PICKUP_RANGE);
crafting_inv += p->inv;
crafting_inv += p->weapon;
if (p->has_bionic("bio_tools")) {
item tools(item_controller->find_template("toolset"), turn);
tools.charges = u.power_level;
tools.charges = p->power_level;
crafting_inv += tools;
}
return crafting_inv;
@@ -995,7 +996,8 @@ void game::complete_craft()
// farsightedness can impose a penalty on electronics and tailoring success
// it's equivalent to a 2-rank electronics penalty, 1-rank tailoring
if (u.has_trait(PF_HYPEROPIC) && !u.is_wearing("glasses_reading")) {
if (u.has_trait(PF_HYPEROPIC) && !u.is_wearing("glasses_reading")
&& !u.is_wearing("glasses_bifocal")) {
int main_rank_penalty = 0;
if (making->sk_primary == Skill::skill("electronics")) {
main_rank_penalty = 2;
@@ -1035,15 +1037,15 @@ void game::complete_craft()
if (making->difficulty != 0 && diff_roll > skill_roll * (1 + 0.1 * rng(1, 5))) {
add_msg("You fail to make the %s, and waste some materials.",
item_controller->find_template(making->result)->name.c_str());
for (int i = 0; i < making->components.size(); i++)
for (int i = 0; i < making->components.size(); i++)
{
if (making->components[i].size() > 0)
consume_items(making->components[i]);
}
consume_items(&u, making->components[i]);
}
for (int i = 0; i < making->tools.size(); i++) {
if (making->tools[i].size() > 0)
consume_tools(making->tools[i]);
consume_tools(&u, making->tools[i], false);
}
u.activity.type = ACT_NULL;
return;
@@ -1058,31 +1060,50 @@ void game::complete_craft()
}
// If we're here, the craft was a success!
// Use up the components and tools
std::list<item> used;
for (int i = 0; i < making->components.size(); i++) {
if (making->components[i].size() > 0)
consume_items(making->components[i]);
if (making->components[i].size() > 0) {
std::list<item> tmp = consume_items(&u, making->components[i]);
used.splice(used.end(), tmp);
}
}
for (int i = 0; i < making->tools.size(); i++) {
if (making->tools[i].size() > 0)
consume_tools(making->tools[i]);
consume_tools(&u, making->tools[i], false);
}
// Set up the new item, and pick an inventory letter
int iter = 0;
item newit(item_controller->find_template(making->result), turn, nextinv);
if (newit.is_armor() && newit.has_flag(IF_VARSIZE))
if (newit.is_armor() && newit.has_flag("VARSIZE"))
{
newit.item_flags |= mfb(IF_FIT);
newit.item_tags.insert("FIT");
}
float used_age_tally = 0;
int used_age_count = 0;
for (std::list<item>::iterator iter = used.begin(); iter != used.end(); ++iter)
{
if (iter->goes_bad())
{
used_age_tally += ((int)turn - iter->bday)/
(float)(dynamic_cast<it_comest*>(iter->type)->spoils);
++used_age_count;
}
}
if (used_age_count > 0 && newit.goes_bad())
{
const int average_used_age = (used_age_tally / used_age_count) * dynamic_cast<it_comest*>(newit.type)->spoils;
newit.bday = newit.bday - average_used_age;
}
// for food items
if (newit.is_food())
{
int bday_tmp = turn % 3600; // fuzzy birthday for stacking reasons
newit.bday = int(turn) + 3600 - bday_tmp;
int bday_tmp = newit.bday % 3600; // fuzzy birthday for stacking reasons
newit.bday = int(newit.bday) + 3600 - bday_tmp;
if (newit.has_flag(IF_EATEN_HOT)) { // hot foods generated
newit.item_flags |= mfb(IF_HOT);
if (newit.has_flag("EATEN_HOT")) { // hot foods generated
newit.item_tags.insert("HOT");
newit.active = true;
newit.item_counter = 600;
}
@@ -1102,175 +1123,231 @@ void game::complete_craft()
if (iter == inv_chars.size() || u.volume_carried()+newit.volume() > u.volume_capacity()) {
add_msg("There's no room in your inventory for the %s, so you drop it.",
newit.tname().c_str());
m.add_item(u.posx, u.posy, newit);
m.add_item(u.posx, u.posy, newit, MAX_ITEM_IN_SQUARE);
} else if (u.weight_carried() + newit.volume() > u.weight_capacity()) {
add_msg("The %s is too heavy to carry, so you drop it.",
newit.tname().c_str());
m.add_item(u.posx, u.posy, newit);
m.add_item(u.posx, u.posy, newit, MAX_ITEM_IN_SQUARE);
} else {
u.i_add(newit);
newit = u.i_add(newit);
add_msg("%c - %s", newit.invlet, newit.tname().c_str());
}
}
}
void game::consume_items(std::vector<component> components)
std::list<item> game::consume_items(player *p, std::vector<component> components)
{
// For each set of components in the recipe, fill you_have with the list of all
// matching ingredients the player has.
std::vector<component> player_has;
std::vector<component> map_has;
std::vector<component> mixed;
std::vector<component> player_use;
std::vector<component> map_use;
std::vector<component> mixed_use;
inventory map_inv;
map_inv.form_from_map(this, point(u.posx, u.posy), PICKUP_RANGE);
std::list<item> ret;
// For each set of components in the recipe, fill you_have with the list of all
// matching ingredients the player has.
std::vector<component> player_has;
std::vector<component> map_has;
std::vector<component> mixed;
std::vector<component> player_use;
std::vector<component> map_use;
std::vector<component> mixed_use;
inventory map_inv;
map_inv.form_from_map(this, point(p->posx, p->posy), PICKUP_RANGE);
for (int i = 0; i < components.size(); i++) {
itype_id type = components[i].type;
int count = abs(components[i].count);
bool pl = false, mp = false;
if (components[i].available != 1)
{
continue;
}
for (int i = 0; i < components.size(); i++)
{
itype_id type = components[i].type;
int count = abs(components[i].count);
bool pl = false, mp = false;
if (item_controller->find_template(type)->count_by_charges() && count > 0)
{
if (u.has_charges(type, count)) {
player_has.push_back(components[i]);
pl = true;
}
if (map_inv.has_charges(type, count)) {
map_has.push_back(components[i]);
mp = true;
}
if (!pl && !mp && u.charges_of(type) + map_inv.charges_of(type) >= count)
mixed.push_back(components[i]);
}
if (components[i].available != 1)
{
continue;
}
else { // Counting by units, not charges
if (item_controller->find_template(type)->count_by_charges() && count > 0)
{
if (p->has_charges(type, count))
{
player_has.push_back(components[i]);
pl = true;
}
if (map_inv.has_charges(type, count))
{
map_has.push_back(components[i]);
mp = true;
}
if (!pl && !mp && p->charges_of(type) + map_inv.charges_of(type) >= count)
{
mixed.push_back(components[i]);
}
}
else // Counting by units, not charges
{
if (u.has_amount(type, count)) {
player_has.push_back(components[i]);
pl = true;
}
if (map_inv.has_amount(type, count)) {
map_has.push_back(components[i]);
mp = true;
}
if (!pl && !mp && u.amount_of(type) + map_inv.amount_of(type) >= count)
mixed.push_back(components[i]);
if (p->has_amount(type, count))
{
player_has.push_back(components[i]);
pl = true;
}
if (map_inv.has_amount(type, count))
{
map_has.push_back(components[i]);
mp = true;
}
if (!pl && !mp && p->amount_of(type) + map_inv.amount_of(type) >= count)
{
mixed.push_back(components[i]);
}
}
}
}
}
if (player_has.size() + map_has.size() + mixed.size() == 1) { // Only 1 choice
if (player_has.size() == 1)
player_use.push_back(player_has[0]);
else if (map_has.size() == 1)
map_use.push_back(map_has[0]);
else
mixed_use.push_back(mixed[0]);
if (player_has.size() + map_has.size() + mixed.size() == 1) // Only 1 choice
{
if (player_has.size() == 1)
{
player_use.push_back(player_has[0]);
}
else if (map_has.size() == 1)
{
map_use.push_back(map_has[0]);
}
else
{
mixed_use.push_back(mixed[0]);
}
}
else // Let the player pick which component they want to use
{
std::vector<std::string> options; // List for the menu_vec below
// Populate options with the names of the items
for (int i = 0; i < map_has.size(); i++)
{
std::string tmpStr = item_controller->find_template(map_has[i].type)->name + " (nearby)";
options.push_back(tmpStr);
}
for (int i = 0; i < player_has.size(); i++)
{
options.push_back(item_controller->find_template(player_has[i].type)->name);
}
for (int i = 0; i < mixed.size(); i++)
{
std::string tmpStr = item_controller->find_template(mixed[i].type)->name +" (on person & nearby)";
options.push_back(tmpStr);
}
} else { // Let the player pick which component they want to use
std::vector<std::string> options; // List for the menu_vec below
// Populate options with the names of the items
for (int i = 0; i < map_has.size(); i++) {
std::string tmpStr = item_controller->find_template(map_has[i].type)->name + " (nearby)";
options.push_back(tmpStr);
}
for (int i = 0; i < player_has.size(); i++)
options.push_back(item_controller->find_template(player_has[i].type)->name);
for (int i = 0; i < mixed.size(); i++) {
std::string tmpStr = item_controller->find_template(mixed[i].type)->name +" (on person & nearby)";
options.push_back(tmpStr);
}
// unlike with tools, it's a bad thing if there aren't any components available
if (options.size() == 0)
{
debugmsg("Attempted a recipe with no available components!");
return ret;
}
if (options.size() == 0) // This SHOULD only happen if cooking with a fire,
return; // and the fire goes out.
// Get the selection via a menu popup
int selection = menu_vec(false, "Use which component?", options) - 1;
if (selection < map_has.size())
{
map_use.push_back(map_has[selection]);
}
else if (selection < map_has.size() + player_has.size())
{
selection -= map_has.size();
player_use.push_back(player_has[selection]);
}
else
{
selection -= map_has.size() + player_has.size();
mixed_use.push_back(mixed[selection]);
}
}
// Get the selection via a menu popup
int selection = menu_vec(false, "Use which component?", options) - 1;
if (selection < map_has.size())
map_use.push_back(map_has[selection]);
else if (selection < map_has.size() + player_has.size()) {
selection -= map_has.size();
player_use.push_back(player_has[selection]);
} else {
selection -= map_has.size() + player_has.size();
mixed_use.push_back(mixed[selection]);
}
}
for (int i = 0; i < player_use.size(); i++) {
if (item_controller->find_template(player_use[i].type)->count_by_charges() &&
player_use[i].count > 0)
u.use_charges(player_use[i].type, player_use[i].count);
else
u.use_amount(player_use[i].type, abs(player_use[i].count),
(player_use[i].count < 0));
}
for (int i = 0; i < map_use.size(); i++) {
if (item_controller->find_template(map_use[i].type)->count_by_charges() &&
map_use[i].count > 0)
m.use_charges(point(u.posx, u.posy), PICKUP_RANGE,
map_use[i].type, map_use[i].count);
else
m.use_amount(point(u.posx, u.posy), PICKUP_RANGE,
map_use[i].type, abs(map_use[i].count),
(map_use[i].count < 0));
}
for (int i = 0; i < mixed_use.size(); i++) {
if (item_controller->find_template(mixed_use[i].type)->count_by_charges() &&
mixed_use[i].count > 0) {
int from_map = mixed_use[i].count - u.charges_of(mixed_use[i].type);
u.use_charges(mixed_use[i].type, u.charges_of(mixed_use[i].type));
m.use_charges(point(u.posx, u.posy), PICKUP_RANGE,
mixed_use[i].type, from_map);
} else {
bool in_container = (mixed_use[i].count < 0);
int from_map = abs(mixed_use[i].count) - u.amount_of(mixed_use[i].type);
u.use_amount(mixed_use[i].type, u.amount_of(mixed_use[i].type),
in_container);
m.use_amount(point(u.posx, u.posy), PICKUP_RANGE,
mixed_use[i].type, from_map, in_container);
}
}
for (int i = 0; i < player_use.size(); i++)
{
if (item_controller->find_template(player_use[i].type)->count_by_charges() &&
player_use[i].count > 0)
{
std::list<item> tmp = p->use_charges(player_use[i].type, player_use[i].count);
ret.splice(ret.end(), tmp);
}
else
{
std::list<item> tmp = p->use_amount(player_use[i].type, abs(player_use[i].count),
(player_use[i].count < 0));
ret.splice(ret.end(), tmp);
}
}
for (int i = 0; i < map_use.size(); i++)
{
if (item_controller->find_template(map_use[i].type)->count_by_charges() &&
map_use[i].count > 0)
{
std::list<item> tmp = m.use_charges(point(p->posx, p->posy), PICKUP_RANGE,
map_use[i].type, map_use[i].count);
ret.splice(ret.end(), tmp);
}
else
{
std::list<item> tmp = m.use_amount(point(p->posx, p->posy), PICKUP_RANGE,
map_use[i].type, abs(map_use[i].count),
(map_use[i].count < 0));
ret.splice(ret.end(), tmp);
}
}
for (int i = 0; i < mixed_use.size(); i++)
{
if (item_controller->find_template(mixed_use[i].type)->count_by_charges() &&
mixed_use[i].count > 0)
{
int from_map = mixed_use[i].count - p->charges_of(mixed_use[i].type);
std::list<item> tmp;
tmp = p->use_charges(mixed_use[i].type, p->charges_of(mixed_use[i].type));
ret.splice(ret.end(), tmp);
tmp = m.use_charges(point(p->posx, p->posy), PICKUP_RANGE,
mixed_use[i].type, from_map);
ret.splice(ret.end(), tmp);
}
else
{
bool in_container = (mixed_use[i].count < 0);
int from_map = abs(mixed_use[i].count) - p->amount_of(mixed_use[i].type);
std::list<item> tmp;
tmp = p->use_amount(mixed_use[i].type, p->amount_of(mixed_use[i].type),
in_container);
ret.splice(ret.end(), tmp);
tmp = m.use_amount(point(p->posx, p->posy), PICKUP_RANGE,
mixed_use[i].type, from_map, in_container);
ret.splice(ret.end(), tmp);
}
}
return ret;
}
void game::consume_tools(std::vector<component> tools)
void game::consume_tools(player *p, std::vector<component> tools, bool force_available)
{
bool found_nocharge = false;
inventory map_inv;
map_inv.form_from_map(this, point(u.posx, u.posy), PICKUP_RANGE);
map_inv.form_from_map(this, point(p->posx, p->posy), PICKUP_RANGE);
std::vector<component> player_has;
std::vector<component> map_has;
// Use charges of any tools that require charges used
for (int i = 0; i < tools.size() && !found_nocharge; i++) {
if (tools[i].available != 1)
if (!force_available && tools[i].available != 1)
{
continue;
}
itype_id type = tools[i].type;
if (tools[i].count > 0) {
int count = tools[i].count;
if (u.has_charges(type, count))
if (p->has_charges(type, count))
player_has.push_back(tools[i]);
if (map_inv.has_charges(type, count))
map_has.push_back(tools[i]);
} else if (u.has_amount(type, 1) || map_inv.has_amount(type, 1))
} else if (p->has_amount(type, 1) || map_inv.has_amount(type, 1))
found_nocharge = true;
}
if (found_nocharge)
return; // Default to using a tool that doesn't require charges
if (player_has.size() == 1 && map_has.size() == 0)
u.use_charges(player_has[0].type, player_has[0].count);
p->use_charges(player_has[0].type, player_has[0].count);
else if (map_has.size() == 1 && player_has.size() == 0)
m.use_charges(point(u.posx, u.posy), PICKUP_RANGE,
m.use_charges(point(p->posx, p->posy), PICKUP_RANGE,
map_has[0].type, map_has[0].count);
else { // Variety of options, list them and pick one
// Populate the list
@@ -1288,11 +1365,11 @@ void game::consume_tools(std::vector<component> tools)
// Get selection via a popup menu
int selection = menu_vec(false, "Use which tool?", options) - 1;
if (selection < map_has.size())
m.use_charges(point(u.posx, u.posy), PICKUP_RANGE,
m.use_charges(point(p->posx, p->posy), PICKUP_RANGE,
map_has[selection].type, map_has[selection].count);
else {
selection -= map_has.size();
u.use_charges(player_has[selection].type, player_has[selection].count);
p->use_charges(player_has[selection].type, player_has[selection].count);
}
}
}
@@ -1330,7 +1407,7 @@ void game::disassemble(char ch)
{
// check tools are available
// loop over the tools and see what's required...again
inventory crafting_inv = crafting_inventory();
inventory crafting_inv = crafting_inventory(&u);
bool have_all_tools = true;
for (int j = 0; j < cur_recipe->tools.size(); j++)
{
@@ -1373,7 +1450,7 @@ void game::disassemble(char ch)
int req = cur_recipe->tools[j][0].count;
if (cur_recipe->tools[j][0].type == "welder")
{
add_msg("You need a hack saw to disassemble this.");
add_msg("You need a hacksaw to disassemble this.");
}
else
{
@@ -1394,7 +1471,7 @@ void game::disassemble(char ch)
// all tools present, so assign the activity
if (have_all_tools)
{
if (OPTIONS[OPT_QUERY_DISASSEMBLE] && !(query_yn("Really disassemble your %s?", dis_item->tname(this).c_str())))
{
return;
@@ -1421,7 +1498,7 @@ void game::complete_disassemble()
add_msg("You disassemble the item into its components.");
// remove any batteries or ammo first
if (dis_item->is_gun() && dis_item->curammo != NULL && dis_item->ammo_type() != AT_NULL)
if (dis_item->is_gun() && dis_item->curammo != NULL && dis_item->ammo_type() != "NULL")
{
item ammodrop;
ammodrop = item(dis_item->curammo, turn);
@@ -1429,17 +1506,20 @@ void game::complete_disassemble()
if (ammodrop.made_of(LIQUID))
handle_liquid(ammodrop, false, false);
else
m.add_item(u.posx, u.posy, ammodrop);
m.add_item(u.posx, u.posy, ammodrop, MAX_ITEM_IN_SQUARE);
}
if (dis_item->is_tool() && dis_item->charges > 0 && dis_item->ammo_type() != AT_NULL)
if (dis_item->is_tool() && dis_item->charges > 0 && dis_item->ammo_type() != "NULL")
{
item ammodrop;
ammodrop = item(item_controller->find_template(default_ammo(dis_item->ammo_type())), turn);
ammodrop.charges = dis_item->charges;
if (dis_item->typeId() == "adv_UPS_off" || dis_item->typeId() == "adv_UPS_on") {
ammodrop.charges /= 500;
}
if (ammodrop.made_of(LIQUID))
handle_liquid(ammodrop, false, false);
else
m.add_item(u.posx, u.posy, ammodrop);
m.add_item(u.posx, u.posy, ammodrop, MAX_ITEM_IN_SQUARE);
}
u.i_rem(u.activity.values[0]); // remove the item
@@ -1447,7 +1527,7 @@ void game::complete_disassemble()
for (int j = 0; j < dis->tools.size(); j++)
{
if (dis->tools[j].size() > 0)
consume_tools(dis->tools[j]);
consume_tools(&u, dis->tools[j], false);
}
// add the components to the map
@@ -1489,14 +1569,14 @@ void game::complete_disassemble()
if (newit.count_by_charges())
{
if (dis->difficulty == 0 || comp_success)
m.spawn_item(u.posx, u.posy, item_controller->find_template(dis->components[j][0].type), 0, 0, compcount);
m.spawn_item(u.posx, u.posy, dis->components[j][0].type, 0, 0, compcount);
else
add_msg("You fail to recover a component.");
compcount = 0;
} else
{
if (dis->difficulty == 0 || comp_success)
m.add_item(u.posx, u.posy, newit);
m.add_item(u.posx, u.posy, newit, MAX_ITEM_IN_SQUARE);
else
add_msg("You fail to recover a component.");
compcount--;
+4 -4
View File
@@ -49,14 +49,14 @@ struct recipe {
autolearn = false;
}
recipe(std::string pident, int pid, itype_id pres, craft_cat pcat, const char *p1,
const char *p2, int pdiff, int ptime, bool preversible, bool pautolearn,
recipe(std::string pident, int pid, itype_id pres, craft_cat pcat, std::string &p1,
std::string &p2, int pdiff, int ptime, bool preversible, bool pautolearn,
int plearn_dis) :
ident (pident), id (pid), result (pres), cat(pcat), difficulty (pdiff), time (ptime),
reversible (preversible), autolearn (pautolearn), learn_by_disassembly (plearn_dis)
{
sk_primary = p1?Skill::skill(p1):NULL;
sk_secondary = p2?Skill::skill(p2):NULL;
sk_primary = p1.size()?Skill::skill(p1):NULL;
sk_secondary = p2.size()?Skill::skill(p2):NULL;
}
};
+4 -4
View File
@@ -1,12 +1,12 @@
#ifndef _CURSES_DEF_H_
#define _CURSES_DEF_H_
#if (defined _WIN32 || defined WINDOWS)
#include "catacurse.h"
#if (defined TILES || defined _WIN32 || defined WINDOWS)
#include "catacurse.h"
#elif (defined __CYGWIN__)
#include "ncurses/curses.h"
#include "ncurses/curses.h"
#else
#include <curses.h>
#include <curses.h>
#endif
#endif // CURSES_DEF_H
+604
View File
@@ -0,0 +1,604 @@
#if (defined TILES || defined _WIN32 || defined WINDOWS)
#include "catacurse.h"
#include "output.h"
#include "color.h"
#include "catacharset.h"
//***********************************
//Globals *
//***********************************
WINDOW *mainwin;
pairs *colorpairs; //storage for pair'ed colored, should be dynamic, meh
int echoOn; //1 = getnstr shows input, 0 = doesn't show. needed for echo()-ncurses compatibility.
//***********************************
//Psuedo-Curses Functions *
//***********************************
//Basic Init, create the font, backbuffer, etc
WINDOW *initscr(void)
{
return curses_init();
}
WINDOW *newwin(int nlines, int ncols, int begin_y, int begin_x)
{
if (begin_y < 0 || begin_x < 0) {
return NULL; //it's the caller's problem now (since they have logging functions declared)
}
// default values
if (ncols == 0)
{
ncols = TERMX - begin_x;
}
if (nlines == 0)
{
nlines = TERMY - begin_y;
}
int i,j;
WINDOW *newwindow = new WINDOW;
//newwindow=&_windows[WindowCount];
newwindow->x=begin_x;
newwindow->y=begin_y;
newwindow->width=ncols;
newwindow->height=nlines;
newwindow->inuse=true;
newwindow->draw=false;
newwindow->BG=0;
newwindow->FG=8;
newwindow->cursorx=0;
newwindow->cursory=0;
newwindow->line = new curseline[nlines];
for (j=0; j<nlines; j++)
{
newwindow->line[j].chars= new char[ncols*4];
newwindow->line[j].FG= new char[ncols];
newwindow->line[j].BG= new char[ncols];
newwindow->line[j].touched=true;//Touch them all !?
newwindow->line[j].width_in_bytes = ncols;
for (i=0; i<ncols; i++)
{
newwindow->line[j].chars[i]=0;
newwindow->line[j].chars[i+1]=0;
newwindow->line[j].chars[i+2]=0;
newwindow->line[j].chars[i+3]=0;
newwindow->line[j].FG[i]=0;
newwindow->line[j].BG[i]=0;
}
}
//WindowCount++;
return newwindow;
}
//Deletes the window and marks it as free. Clears it just in case.
int delwin(WINDOW *win)
{
int j;
win->inuse=false;
win->draw=false;
for (j=0; j<win->height; j++){
delete win->line[j].chars;
delete win->line[j].FG;
delete win->line[j].BG;
}
delete win->line;
delete win;
return 1;
}
inline int newline(WINDOW *win){
if (win->cursory < win->height - 1){
win->cursory++;
win->cursorx=0;
return 1;
}
return 0;
}
inline void addedchar(WINDOW *win){
win->cursorx++;
win->line[win->cursory].touched=true;
if (win->cursorx > win->width)
newline(win);
}
//Borders the window with fancy lines!
int wborder(WINDOW *win, chtype ls, chtype rs, chtype ts, chtype bs, chtype tl, chtype tr, chtype bl, chtype br)
{
/*
ncurses does not do this, and this prevents: wattron(win, c_customBordercolor); wborder(win, ...); wattroff(win, c_customBorderColor);
wattron(win, c_white);
*/
int i, j;
int oldx=win->cursorx;//methods below move the cursor, save the value!
int oldy=win->cursory;//methods below move the cursor, save the value!
if (ls>0)
for (j=1; j<win->height-1; j++)
mvwaddch(win, j, 0, LINE_XOXO);
if (rs>0)
for (j=1; j<win->height-1; j++)
mvwaddch(win, j, win->width-1, LINE_XOXO);
if (ts>0)
for (i=1; i<win->width-1; i++)
mvwaddch(win, 0, i, LINE_OXOX);
if (bs>0)
for (i=1; i<win->width-1; i++)
mvwaddch(win, win->height-1, i, LINE_OXOX);
if (tl>0)
mvwaddch(win,0, 0, LINE_OXXO);
if (tr>0)
mvwaddch(win,0, win->width-1, LINE_OOXX);
if (bl>0)
mvwaddch(win,win->height-1, 0, LINE_XXOO);
if (br>0)
mvwaddch(win,win->height-1, win->width-1, LINE_XOOX);
//_windows[w].cursorx=oldx;//methods above move the cursor, put it back
//_windows[w].cursory=oldy;//methods above move the cursor, put it back
wmove(win,oldy,oldx);
wattroff(win, c_white);
return 1;
}
//Refreshes a window, causing it to redraw on top.
int wrefresh(WINDOW *win)
{
if (win==0) win=mainwin;
if (win->draw)
curses_drawwindow(win);
return 1;
}
//Refreshes window 0 (stdscr), causing it to redraw on top.
int refresh(void)
{
return wrefresh(mainwin);
}
int getch(void)
{
return wgetch(mainwin);
}
int wgetch(WINDOW* win)
{
return curses_getch(win);
}
int mvgetch(int y, int x)
{
move(y,x);
return getch();
}
int mvwgetch(WINDOW* win, int y, int x)
{
move(y, x);
return wgetch(win);
}
int getnstr(char *str, int size)
{
int startX = mainwin->cursorx;
int count = 0;
char input;
while(true)
{
input = getch();
// Carriage return, Line feed and End of File terminate the input.
if( input == '\r' || input == '\n' || input == '\x04' )
{
str[count] = '\x00';
return count;
}
else if( input == 127 ) // Backspace, remapped from \x8 in ProcessMessages()
{
if( count == 0 )
continue;
str[count] = '\x00';
if(echoOn == 1)
mvaddch(mainwin->cursory, startX + count, ' ');
--count;
if(echoOn == 1)
move(mainwin->cursory, startX + count);
}
else
{
if( count >= size - 1 ) // Still need space for trailing 0x00
continue;
str[count] = input;
++count;
if(echoOn == 1)
{
move(mainwin->cursory, startX + count);
mvaddch(mainwin->cursory, startX + count, input);
}
}
}
return count;
}
//The core printing function, prints characters to the array, and sets colors
inline int printstring(WINDOW *win, char *fmt)
{
int size = strlen(fmt);
if(size>0)
{
int j, i, p=win->cursorx;
int x = (win->line[win->cursory].width_in_bytes==win->width)?win->cursorx:cursorx_to_position(win->line[win->cursory].chars, win->cursorx, &p);
if(p!=x)//so we start inside a wide character, erase it for good
{
const char* ts = win->line[win->cursory].chars+p;
int len = ANY_LENGTH;
unsigned tc = UTF8_getch(&ts, &len);
int tw = mk_wcwidth((wchar_t)tc);
erease_utf8_by_cw(win->line[win->cursory].chars+p, tw, tw, win->width*4-p-1);
x = p+tw-1;
}
for (j=0; j<size; j++){
if (!(fmt[j]==10)){//check that this isnt a newline char
const char* utf8str = fmt+j;
int len = ANY_LENGTH;
unsigned ch = UTF8_getch(&utf8str, &len);
int cw = mk_wcwidth((wchar_t)ch);
len = ANY_LENGTH-len;
if(cw<1) cw = 1;
if(len<1) len = 1;
if (win->cursorx+cw <= win->width && win->cursory <= win->height - 1) {
win->line[win->cursory].width_in_bytes += erease_utf8_by_cw(win->line[win->cursory].chars+x, cw, len, win->width*4-x-1);
for(i=0; i<len; i++)
{
win->line[win->cursory].chars[x+i]=fmt[j+i];
}
for(i=0; i<cw; i++)
{
win->line[win->cursory].FG[win->cursorx]=win->FG;
win->line[win->cursory].BG[win->cursorx]=win->BG;
addedchar(win);
}
win->line[win->cursory].touched=true;
j += len-1;
x+=len;
} else if (win->cursory <= win->height - 1) {
// don't write outside the window, but don't abort if there are still lines to write.
//j += len-1;
//x+=len;
} else {
return 0; //if we try and write anything outside the window, abort completely
}
} else {// if the character is a newline, make sure to move down a line
if (newline(win)==0){
return 0;
}
x = 0;
}
}
}
win->draw=true;
return 1;
}
//Prints a formatted string to a window at the current cursor, base function
int wprintw(WINDOW *win, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
char printbuf[2048];
vsnprintf(printbuf, 2047, fmt, args);
va_end(args);
return printstring(win,printbuf);
}
//Prints a formatted string to a window, moves the cursor
int mvwprintw(WINDOW *win, int y, int x, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
char printbuf[2048];
vsnprintf(printbuf, 2047, fmt, args);
va_end(args);
if (wmove(win,y,x)==0) return 0;
return printstring(win,printbuf);
}
//Prints a formatted string to window 0 (stdscr), moves the cursor
int mvprintw(int y, int x, const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
char printbuf[2048];
vsnprintf(printbuf, 2047, fmt, args);
va_end(args);
if (move(y,x)==0) return 0;
return printstring(mainwin,printbuf);
}
//Prints a formatted string to window 0 (stdscr) at the current cursor
int printw(const char *fmt, ...)
{
va_list args;
va_start(args, fmt);
char printbuf[2078];
vsnprintf(printbuf, 2047, fmt, args);
va_end(args);
return printstring(mainwin,printbuf);
}
//erases a window of all text and attributes
int werase(WINDOW *win)
{
int j,i;
for (j=0; j<win->height; j++)
{
for (i=0; i<win->width; i++) {
win->line[j].chars[i]=0;
win->line[j].chars[i+1]=0;
win->line[j].chars[i+2]=0;
win->line[j].chars[i+3]=0;
win->line[j].FG[i]=0;
win->line[j].BG[i]=0;
}
win->line[j].touched=true;
win->line[j].width_in_bytes = win->width;
}
win->draw=true;
wmove(win,0,0);
// wrefresh(win);
return 1;
}
//erases window 0 (stdscr) of all text and attributes
int erase(void)
{
return werase(mainwin);
}
//pairs up a foreground and background color and puts it into the array of pairs
int init_pair(short pair, short f, short b)
{
colorpairs[pair].FG=f;
colorpairs[pair].BG=b;
return 1;
}
//moves the cursor in a window
int wmove(WINDOW *win, int y, int x)
{
if (x>=win->width)
{return 0;}//FIXES MAP CRASH -> >= vs > only
if (y>=win->height)
{return 0;}// > crashes?
if (y<0)
{return 0;}
if (x<0)
{return 0;}
win->cursorx=x;
win->cursory=y;
return 1;
}
//Clears windows 0 (stdscr) I'm not sure if its suppose to do this?
int clear(void)
{
return wclear(mainwin);
}
//Ends the terminal, destroy everything
int endwin(void)
{
return curses_destroy();
}
//adds a character to the window
int mvwaddch(WINDOW *win, int y, int x, const chtype ch)
{
if (wmove(win,y,x)==0) return 0;
return waddch(win, ch);
}
//clears a window
int wclear(WINDOW *win)
{
werase(win);
clearok(win);
return 1;
}
int clearok(WINDOW *win)
{
for (int i=0; i<win->y; i++)
{
win->line[i].touched = true;
}
return 1;
}
//gets the max x of a window (the width)
int getmaxx(WINDOW *win)
{
if (win==0) return mainwin->width; //StdScr
return win->width;
}
//gets the max y of a window (the height)
int getmaxy(WINDOW *win)
{
if (win==0) return mainwin->height; //StdScr
return win->height;
}
//gets the beginning x of a window (the x pos)
int getbegx(WINDOW *win)
{
if (win==0) return mainwin->x; //StdScr
return win->x;
}
//gets the beginning y of a window (the y pos)
int getbegy(WINDOW *win)
{
if (win==0) return mainwin->y; //StdScr
return win->y;
}
int start_color(void)
{
return curses_start_color();
}
int keypad(WINDOW *faux, bool bf)
{
return 1;
}
int cbreak(void)
{
return 1;
}
int keypad(int faux, bool bf)
{
return 1;
}
int curs_set(int visibility)
{
return 1;
}
int mvaddch(int y, int x, const chtype ch)
{
return mvwaddch(mainwin,y,x,ch);
}
int wattron(WINDOW *win, int attrs)
{
bool isBold = !!(attrs & A_BOLD);
bool isBlink = !!(attrs & A_BLINK);
int pairNumber = (attrs & A_COLOR) >> 17;
win->FG=colorpairs[pairNumber].FG;
win->BG=colorpairs[pairNumber].BG;
if (isBold) win->FG += 8;
if (isBlink) win->BG += 8;
return 1;
}
int wattroff(WINDOW *win, int attrs)
{
win->FG=8; //reset to white
win->BG=0; //reset to black
return 1;
}
int attron(int attrs)
{
return wattron(mainwin, attrs);
}
int attroff(int attrs)
{
return wattroff(mainwin,attrs);
}
int waddch(WINDOW *win, const chtype ch)
{
char charcode;
charcode=ch;
switch (ch){ //LINE_NESW - X for on, O for off
case LINE_XOXO: //#define LINE_XOXO 4194424
charcode=LINE_XOXO_C;
break;
case LINE_OXOX: //#define LINE_OXOX 4194417
charcode=LINE_OXOX_C;
break;
case LINE_XXOO: //#define LINE_XXOO 4194413
charcode=LINE_XXOO_C;
break;
case LINE_OXXO: //#define LINE_OXXO 4194412
charcode=LINE_OXXO_C;
break;
case LINE_OOXX: //#define LINE_OOXX 4194411
charcode=LINE_OOXX_C;
break;
case LINE_XOOX: //#define LINE_XOOX 4194410
charcode=LINE_XOOX_C;
break;
case LINE_XXOX: //#define LINE_XXOX 4194422
charcode=LINE_XXOX_C;
break;
case LINE_XXXO: //#define LINE_XXXO 4194420
charcode=LINE_XXXO_C;
break;
case LINE_XOXX: //#define LINE_XOXX 4194421
charcode=LINE_XOXX_C;
break;
case LINE_OXXX: //#define LINE_OXXX 4194423
charcode=LINE_OXXX_C;
break;
case LINE_XXXX: //#define LINE_XXXX 4194414
charcode=LINE_XXXX_C;
break;
default:
charcode = (char)ch;
break;
}
int cury=win->cursory;
int p = win->cursorx;
int curx=(win->line[cury].width_in_bytes==win->width)?win->cursorx:cursorx_to_position(win->line[cury].chars, win->cursorx, &p);
if(curx!=p)
{
const char* ts = win->line[cury].chars+p;
int len = ANY_LENGTH;
unsigned tc = UTF8_getch(&ts, &len);
int tw = mk_wcwidth((wchar_t)tc);
win->line[cury].width_in_bytes += erease_utf8_by_cw(win->line[cury].chars+p, tw, tw, win->width*4-p-1);
curx = p+tw-1;
}
else if(win->line[cury].width_in_bytes!=win->width)
{
win->line[cury].width_in_bytes += erease_utf8_by_cw(win->line[cury].chars+p, 1, 1, win->width*4-p-1);
}
//if (win2 > -1){
win->line[cury].chars[curx]=charcode;
win->line[cury].FG[win->cursorx]=win->FG;
win->line[cury].BG[win->cursorx]=win->BG;
win->draw=true;
addedchar(win);
return 1;
// else{
// win2=win2+1;
}
//Move the cursor of windows 0 (stdscr)
int move(int y, int x)
{
return wmove(mainwin,y,x);
}
//Set the amount of time getch waits for input
void timeout(int delay)
{
curses_timeout(delay);
}
void set_escdelay(int delay) { } //PORTABILITY, DUMMY FUNCTION
int echo()
{
echoOn = 1;
return 0; // 0 = OK, -1 = ERR
}
int noecho()
{
echoOn = 0;
return 0;
}
#endif
+3 -3
View File
@@ -1,3 +1,3 @@
Terminus
8
16
Terminus
8
16
Executable → Regular
View File

Before

Width:  |  Height:  |  Size: 66 KiB

After

Width:  |  Height:  |  Size: 66 KiB

Executable → Regular
+258 -1
View File
@@ -1,4 +1,261 @@
Changelog will be a little light for the early entries due to me being really bad at documenting things.
0.7.1 (bugfix point release)
Vehicle bed sleepiness fix.
Made coughing from smoke wake you up.
Update version for MSVC project builds.
Remove coverage property from wristwatch to prevent ensumberance.
Supress pickup from vehicle when doing autopickup.
Fix typo in spawn list.
Don't draw item glyphs on top of furniture glyphs.
Strip out references to a removed ammunition in spawn lists.
Change in how Vehicle Examination window is displayed so it works in 12x12 View Screens
Fix for weapon mods with no ammo types.
0.7
Highlights:
---
Use ncursesw and gettext for i18n support and expanded character palette.
Configurable Autopickup feature.
Configurable item spawning lists, now with more configurable spawn frequencies.
New advanced bionics.
Features:
---
Use ncursesw and gettext for i18n support and expanded character palette.
Configurable Autopickup feature.
Configurable item spawning lists, now with more configurable spawn frequencies.
Probability Travel Bionic (walk through walls!)
Railgun Bionic (throw metal items at the speed of electricity!)
Flashbang bionic.
Shockwave Generator bionic.
Chain Lightning bionic.
Artificial Night bionic.
Streamlined lumberjacking tasks.
Splints are now craftable and (slowly!) heal broken limbs.
Recover CBMs from butchered player corpses
Small game arrow.
Spoiled (rotten) items will now be removed from the map after twice the time it takes to spoil.
Lit torches set enemies on fire.
Toggled Metabolic Interchange bionic, active power sources.
Changed Optimist to be more thematic and balanced.
Morale effects have more flexible durations.
Extensively reworked fire handling, e.g. campfires should last a more reasonable duration.
Preserve martial art style selection across wielding/unwielding weapons.
Simulate alt+number input for SDL version.
Quicksave command.
Added basic sludge crawler monster
More crafting recipes.
Stash knives in your boots.
Folding bicycle you can stash in a trunk.
New improvised guns.
More survival-ish foods.
Added some more heavy pistols and ammunition.
New Improvised lockpick!
Floatation Vest.
Added wine and a new shirt.
Towels.
Fuzzy time display, and precise time with wristwatch item.
Bugfixes:
---
Multiple gates near one handle work correctly.
Made wild Jabberwocks much more rare.
Fix turrets shuffing around when off map.
Prevent gibbing from low-damage sources.
House generation fixes.
Allow deconstruction of refrigerators.
More consistent road placement.
Make mongroups die propperly, even if the queen dies at a distance
Monsters killed by wide attacks drop corpses/loot
Fix solar panel power production on vehicles.
Cleanup tire changing activity.
Fix stunlock caused by counterattacks.
Keep Jabberwocks from spawning in classic mode.
Fix turret drops.
Extensive text handling fixes.
Menu beautification.
Allow saving while in a vehicle.
Fix div0 on bad option setting.
======
0.6
Highlights:
---
* Zombies will revive after a time, if not butchered (or otherwise dealt with).
* The Android trait now behaves the way that the description indicates.
* Gasoline can be siphoned from vehicles. Requires a rubber hose for now - these are easier to acquire.
* Sewing requires materials other than thread - rags for cloth, leather patches for leather, kevlar bricks, plastic chunks.
* Leather/Kevlar/plastic/fur repair/reinforcement actually possible!
* Inventory management UI improvements, and a new screen to organize worn items.
* NPCs continue to be less buggy, but are still prone to crashes.
* Weapon firing code reworked a bit. UI improvements, and you should now be able to fire at anything within range.
* Reworked the armor/protection code.
* Reworked the learning system: replaced XP with Focus. See the relevant help text.
* Added a *bunch* of new multi-stage missions, for those who play with the shelter NPC turned on.
* Many new buildings (See full changelong list)
* Vehicle collision physics are now based on *actual* physics! Reduces collision insanity.
* Option to use triginometric distance instead of roguelike distance. In other words light, line of sight are circular instead of square.
* Zombie density in towns is based on nearby buildings instead of distance from town center.
* Higher-performance (on windows) SDL-based rendering as an optional build type.
* Movement on and around vehicles greatly streamlined.
* Sound indicator lets you know how much noise you're making.
* Turn cost indicator lets you know how long actions take.
* Overkilled monsters now spray gibs around instead of disapearing.
* Mostly remove limits on how many items fit in a tile of ground.
* As usual, many bugfixes.
Full list:
---
Purifier no longer removes traits available at chargen.
Fix some calculations that wanted floating-point math, and were using integer math.
Fix some vehicle collision craziness related to skids.
Added zombie revival. Chance of unbutchered zombie corpses rezzing, once 6 hours have passed.
Advanced inventory UI improvements/fixes.
Dropping count-by-charge items (batteries, meds, etc.) into vehicles will cause restacking.
Android trait always gives a power system bionic.
Fix torso encumbrance display (it's smart about sign use now).
Bitmask-based item flags no longer exist! Instead, we have string-based tags, that have no upper limit.
Tweaked glowstick behavior - can no longer deactivate, and they have a dead state.
Android trait should no longer give the player faulty bionics.
Bolts moved to ammo category, like arrows.
Added bone broth, and recipe.
Adjust how Climate Control bionic works, make vehicles have functioning (magic!) AC.
Added fuel siphoning using rubber hose.
Appearance-improving mutations are now flagged as being good mutations.
Welder charges are actually used during vehicle construction.
Items will no longer become erroneously fitted, and item tags should not spread during map loading.
Weather accounts for starting time properly.
Containers can be unloaded again (they were bugged).
Optimized scentmap updates, hopefully this speeds up certain activities.
Pit-requiring constructions have pit digging as their first two stages, to make it more obvious what the prereqs are.
Some menus (notably, inventory) can be navigated with arrow keys and enter.
Allowing sewing of leather items, make sewing require rags/patches.
Cooking rotten food does not make it magically fresh any more.
Resolves an issue where destroying an item while tailoring would crash the game.
New UI to sort clothing and automatically assign special characters to clothing (accessed via +)
Footwear warmth values tweaked to be more flexible.
Wool warmth is not reduced by rain.
Sofas and armchairs help with sleeping.
Temperature is less of an issue while sleeping.
Warning messages for when the player is cold/hot while sleeping.
Oversized clothing can be worn over anything (blankets, cloaks, etc).
Sound interruptions can be categorically ignored while crafting, reading, etc.
More improvements to the advanced inventory UI.
Shrubs less difficult to smash.
Upgraded versions of Fast Healer still give you bonuses while sleeping.
Soldering iron recipe learnable via disassembly.
Integrated toolset power usage normalized on a few recipes.
Vehicle speed is now taken into account when throwing a character that exits a moving vehicle.
Gasoline lanterns added to the game.
Bifocal glasses added to the game.
Tweak Windows (catacurse) colors.
Correct window border color behavior under Windows.
Add glass jars, make sauces spawn in them instead of in tin cans.
Removed a couple NPC crash bugs.
You can safely exit a vehicle moving less than 1 MPH.
Fix a pair of drawing glitches related to the item pickup window.
Remove the artificial delay when animating vehicle movement.
Out-of-range enemies are still drawn when firing a weapon.
Make it so that anything within range can be targeted with a ranged weapon.
Disassembly recipe for vacuum sealer.
Backspace no longer causes junk to be input during string entry.
The overmap screen now lets you use "<" and ">" to view different z-levels.
Reworked the armor/protection code.
Fridges drop rubber hose instead of pipe when destroyed.
Reworked the learning system: replaced XP with Focus. See the relevant help text.
Autosave should save everything now, rather than a subset.
Fix artifact saving/loading... again.
Added new missions.
Added cathedral to mapgen.
Fixed flamethrowers.
Add 40mm acid bomb shells.
Moving furniture causes noise.
Clothing damage descriptions now depend on the item's material.
Gunmods now show "%" properly in the magazine size line.
Add bicycle seats: low-mass seats that can't take a seatbelt.
Vehicle collision physics are now based on *actual* physics! Reduces collision insanity.
Foraging gives survival experience, even on failure.
Disassembling ammo gives firearms experience.
Ball bearings should hopefully drop now.
Added headlights to a few more default vehicles.
Lab coats can be fitted.
Items in adjacent containers (fridges, lockers, etc.) visible with 'V' screen.
Players can no longer examine sealed crates to see their contents.
Funnels give acid water during acid rain :).
Acid water (after refinement) now an alternate ingredient for acid bombs.
Corrected a few item name typos.
Cleaned up generation of a particular (spiral-y) underground room.
More temperature tweaks.
Being hot makes you MORE thirsty, not less.
Reworked item unloading and reloading a bit to remove bugs.
Flatbed trucks now have rear windows.
Electric cars added as potential vehicle spawns.
Fix some bugs related to known overmap data and leaking the state to other characters.
Effects of current stats are shown on the '@' screen.
Materials obtained from clothing depend on the clothing's damage level.
Fixed some lab mapgen bugs.
Mansions got a little love.
Having too little intelligence for a book is more of a penalty.
Vehicle headlight state is persistent after save-load.
Being hot no longer increases thirst by an unreasonable amount
Minor : temp_conv and dis.intensity are saved, fixing strange on-load inconsistencies
Minor : Diseases that affect speed no longer overwrite eachother in the @ menu
Clothing with pockets provides a bonus to hand warmth when not wielding a weapon.
New large building with basement: Prison
Basement level for hazardous waste sarcophagus.
New building with basement: musterious cabin.
Display recent log messages on player death.
Radiation exposure is now more dangerous
Mutations from radiation can be disabled.
Mutation categories now more dominant.
Added themed mutagens with recipes.
New medical items.
Bundle of plastic bags item for stowing bags.
Rebalance chance of cutting weapons getting stuck, much less likely now.
Smashing corpses prevents them from reviving.
Burning corpses prevents them from reviving.
Stopped players from leaving slime trails or webs while in a vehicle.
Made vitamins have an effect again.
Made multiple gasoline tanks drain properly.
Added tiny pain effect to Acid Drizzle, raincoats now offer a bit of protection to acid rain/drizzle.
Advanced inv: "e" pulls up inventory item menu. Help window displays feedback messages for actions taken. "?" toggles between help and msg viewer.
Eliminate radiation dosage saturation, halving dosage rate to compensate. (radiation is slower, but more implacable)
Fitting screen now shows storage and encumbrance in item columns.
Added leather vest item and crafting recipe.
avoid use of pow() in distance calculation, speeding them up an order of magnitude.
Make blood filter remove all other drug based diseases.
Make blood analysis detect all drugs.
Behold, sharpie markers.
Display actual keymapping instead of default one in most help text.
Stopped bleeding, bites, and poison from applying when stopped by armor.
Safely hop from slow-moving vehicles, get hurt from quick ones.
Multidrop screen now shows a summary of what is about to be dropped.
Sort inventory by item charges, use low-charge items first.
Option to auto-save before sleep.
Lava burns things and can be used for crafting.
Multiple fixes to burst-fire targeting.
Prevent turrets from shooting themselves.
Prevent friendly turrets from trying to shoot through the player.
Brasas catcher item to catch your brass for recrafting.
More power armor variants.
Make movement take half the cost of both the beginning and end tiles, instead of just taking the cost of the end tile.
Made shooting interactions more realistic.
Add radiation badge item and associated infrastructure.
Automagically add new keybindings, so long as they don't conflict.
Significantly reduces the number of giant worms.
Adds strawberry bushes.
Advanced inventory: Add [c]ategory sort.
Large number of added archery items: Wide range of bows crossbows, and arrows, and a multitude of crafting recipes.
Stop unnecessaraly saving adjacent overmaps every time they are potentially dirtied. (prevents periodic pauses!)
Hard Leg Guards and Metal Leg guards.
Picking berry bushes trains survival (at low levels).
Added skill support into professions.
======
0.5
+1 -1
View File
@@ -4,7 +4,7 @@
Original author: Project Manager: Website/Forum:
Whales (retired) TheDarklingWolf GlyphGryph
Main Developers/Gihub Managers:
Main Developers/Github Managers:
Kevingranade, Ozone, TheDarklingWolf, zpmorgan
Active Contributors:
Binary file not shown.
+8 -8
View File
@@ -1,18 +1,18 @@
# This message may be 16 lines long at maximum.
# Max length of a line is 68 characters; the following line is for reference
####################################################################
New features v0.5:
* Todo
* Fixes, fixes and more fixes.
New features v0.7 Lindqvist:
* Preliminary i18n support.
* More advanced bionics.
* Autopickup
For latest discussions and news on Cataclysm DDA, please visit:
Homepage: http://www.cataclysmdda.com/
Forum: http://www.cataclysmdda.com/smf/
Forum: http://smf.cataclysmdda.com/
Wiki: http://wiki.cataclysmdda.com/
The game now has new configurable options:
Customizeable Viewport, Spawntype: Classic/Static, Starting time
Static NPCs, Randomly spawning NPCs, Seasons
New configurable options:
Autosave frequency, Trigonometric (circular) distance,
Trait points cap, radiation lethality.
Ingame you can access the options via the help menu (?2).
+543
View File
@@ -0,0 +1,543 @@
[
{
"id" : "bio_null",
"name" : "NULL bionics",
"cost" : 0,
"time" : 0,
"description": "If you're seeing this, it's a bug. (game::init_bionics)"
},
{
"id" : "bio_batteries",
"name" : "Battery System",
"cost" : 0,
"time" : 0,
"flags" : ["POWER"],
"description": "You have a battery draining attachment, and thus can make use of the energy\ncontained in normal, everyday batteries. Use 'E' to consume batteries."
},
{
"id" : "bio_metabolics",
"name" : "Metabolic Interchange",
"cost" : 0,
"time" : 100,
"flags" : ["POWER", "ACTIVE"],
"description": "Your digestive system and power supply are interconnected. Any drain on\nenergy instead increases your hunger."
},
{
"id" : "bio_solar",
"name" : "Solar Panels",
"cost" : 0,
"time" : 0,
"flags" : ["POWER"],
"description": "You have a few solar panels installed. While in direct sunlight, your power\nlevel will slowly recharge."
},
{
"id" : "bio_torsionratchet",
"name" : "Joint Torsion Ratchet",
"cost" : 0,
"time" : 0,
"flags" : ["POWER"],
"description": "Your joints have been equipped with torsion ratchets that generate power slowly\nwhen you move."
},
{
"id" : "bio_furnace",
"name" : "Internal Furnace",
"cost" : 0,
"time" : 0,
"flags" : ["POWER"],
"description": "You can burn nearly any organic material as fuel (use 'E'), recharging your\npower level. Some materials will burn better than others."
},
{
"id" : "bio_ethanol",
"name" : "Ethanol Burner",
"cost" : 0,
"time" : 0,
"flags" : ["POWER"],
"description": "You burn alcohol as fuel in an extremely efficient reaction. However, you\nwill still suffer the inebriating effects of the substance."
},
{
"id" : "bio_memory",
"name" : "Enhanced Memory Banks",
"cost" : 1,
"time" : 0,
"description": "Your memory has been enhanced with small quantum storage drives. Any time\nyou start to forget a skill, you have a chance at retaining all knowledge, at\nthe cost of a small amount of poweron."
},
{
"id" : "bio_ears",
"name" : "Enhanced Hearing",
"cost" : 0,
"time" : 0,
"description": "Your hearing has been drastically improved, allowing you to hear ten times\nbetter than the average person. Additionally, high-intensity sounds will be\nautomatically dampened before they can damage your hearing."
},
{
"id" : "bio_eye_enhancer",
"name" : "Diamond Cornea",
"cost" : 0,
"time" : 0,
"description": "Your vision is greatly enhanced, giving you a +2 bonus to perception."
},
{
"id" : "bio_membrane",
"name" : "Nictating Membrane",
"cost" : 0,
"time" : 0,
"description": "Your eyes have a thin membrane that closes over your eyes while underwater,\nnegating any vision penalties."
},
{
"id" : "bio_targeting",
"name" : "Targeting System",
"cost" : 0,
"time" : 0,
"description": "Your eyes are equipped with range finders, and their movement is synced with\nthat of your arms, to a degree. Shots you fire will be much more accurate,\nparticularly at long range."
},
{
"id" : "bio_gills",
"name" : "Membrane Oxygenator",
"cost" : 1,
"time" : 0,
"description": "An oxygen interchange system automatically switches on while underwater,\nslowly draining your energy reserves but providing oxygen."
},
{
"id" : "bio_purifier",
"name" : "Air Filtration System",
"cost" : 1,
"time" : 0,
"description": "Implanted in your trachea is an advanced filtration system. If toxins find\ntheir way into your windpipe, the filter will attempt to remove them."
},
{
"id" : "bio_climate",
"name" : "Internal Climate Control",
"cost" : 1,
"time" : 30,
"flags" : ["ACTIVE"],
"description": "Throughout your body lies a network of thermal piping which eases the effects\nof high and low ambient temperatures."
},
{
"id" : "bio_storage",
"name" : "Internal Storage",
"cost" : 0,
"time" : 0,
"description": "Space inside your chest cavity has been converted into a storage area. You\nmay carry an extra 8 units of volume."
},
{
"id" : "bio_recycler",
"name" : "Recycler Unit",
"cost" : 0,
"time" : 0,
"description": "Your digestive system has been outfitted with a series of filters and\nprocessors, allowing you to reclaim waste liquid and, to a lesser degree,\nnutrients. The net effect is a greatly reduced need to eat and drink."
},
{
"id" : "bio_digestion",
"name" : "Expanded Digestive System",
"cost" : 0,
"time" : 0,
"description": "You have been outfitted with three synthetic stomachs and industrial-grade\nintestines. Not only can you extract much more nutrition from food, but you\nare highly resistant to foodborne illness, and can sometimes eat rotten food."
},
{
"id" : "bio_tools",
"name" : "Integrated Toolset",
"cost" : 0,
"time" : 0,
"description": "Implanted in your hands and fingers is a complete tool set - screwdriver,\nhammer, wrench, and heating elements. You can use this in place of many\ntools when crafting."
},
{
"id" : "bio_shock",
"name" : "Electroshock Unit",
"cost" : 1,
"time" : 0,
"description": "While fighting unarmed, or with a weapon that conducts electricity, there is\na chance that a successful hit will shock your opponent, inflicting extra\ndamage and disabling them temporarily at the cost of some energy."
},
{
"id" : "bio_heat_absorb",
"name" : "Heat Drain",
"cost" : 1,
"time" : 0,
"description": "While fighting unarmed against a warm-blooded opponent, there is a chance\nthat a successful hit will drain body heat, inflicting a small amount of\nextra damage, and increasing your power reserves slightly."
},
{
"id" : "bio_carbon",
"name" : "Subdermal Carbon Filament",
"cost" : 0,
"time" : 0,
"description": "Lying just beneath your skin is a thin armor made of carbon nanotubes. This\nreduces bashing damage by 2 and cutting damage by 4."
},
{
"id" : "bio_armor_head",
"name" : "Alloy Plating - Head",
"cost" : 0,
"time" : 0,
"description": "The flesh on your head has been replaced by a strong armor, protecting both\nyour head and jaw regions."
},
{
"id" : "bio_armor_torso",
"name" : "Alloy Plating - Torso",
"cost" : 0,
"time" : 0,
"description": "The flesh on your torso has been replaced by a strong armor, protecting you\ngreatly."
},
{
"id" : "bio_armor_arms",
"name" : "Alloy Plating - Arms",
"cost" : 0,
"time" : 0,
"description": "The flesh on your arms has been replaced by a strong armor, protecting you\ngreatly."
},
{
"id" : "bio_armor_legs",
"name" : "Alloy Plating - Legs",
"cost" : 0,
"time" : 0,
"description": "The flesh on your legs has been replaced by a strong armor, protecting you\ngreatly."
},
{
"id" : "bio_flashlight",
"name" : "Cranial Flashlight",
"cost" : 1,
"time" : 30,
"flags" : ["ACTIVE"],
"description": "Mounted between your eyes is a small but powerful LED flashlight."
},
{
"id" : "bio_night_vision",
"name" : "Implanted Night Vision",
"cost" : 1,
"time" : 20,
"flags" : ["ACTIVE"],
"description": "Your eyes have been modified to amplify existing light, allowing you to see\nin the dark."
},
{
"id" : "bio_infrared",
"name" : "Infrared Vision",
"cost" : 1,
"time" : 4,
"flags" : ["ACTIVE"],
"description": "Your range of vision extends into the infrared, allowing you to see warm-\nblooded creatures in the dark, and even through walls."
},
{
"id" : "bio_face_mask",
"name" : "Facial Distortion",
"cost" : 1,
"time" : 10,
"flags" : ["ACTIVE"],
"description": "Your face is actually made of a compound which may be molded by electrical\nimpulses, making you impossible to recognize. While not powered, however,\nthe compound reverts to its default shape."
},
{
"id" : "bio_ads",
"name" : "Active Defense System",
"cost" : 1,
"time" : 7,
"flags" : ["ACTIVE"],
"description": "A thin forcefield surrounds your body, continually draining power. Anything\nattempting to penetrate this field has a chance of being deflected at the\ncost of more energy. Melee attacks will be stopped more often than bullets."
},
{
"id" : "bio_ods",
"name" : "Offensive Defense System",
"cost" : 1,
"time" : 6,
"flags" : ["ACTIVE"],
"description": "A thin forcefield surrounds your body, continually draining power. This\nfield does not deflect penetration, but rather delivers a very strong shock,\ndamaging unarmed attackers and those with a conductive weapon."
},
{
"id" : "bio_scent_mask",
"name" : "Olfactory Mask",
"cost" : 1,
"time" : 8,
"flags" : ["ACTIVE"],
"description": "While this system is powered, your body will produce very little odor, making\nit nearly impossible for creatures to track you by scent."
},
{
"id" : "bio_scent_vision",
"name" : "Scent Vision",
"cost" : 1,
"time" : 30,
"flags" : ["ACTIVE"],
"description": "While this system is powered, you're able to visually sense your own scent,\nmaking it possible for you to recognize your surroundings even if you can't\nsee it."
},
{
"id" : "bio_cloak",
"name" : "Cloaking System",
"cost" : 2,
"time" : 1,
"flags" : ["ACTIVE"],
"description": "This high-power system uses a set of cameras and LEDs to make you blend into\nyour background, rendering you fully invisible to normal vision. However,\nyou may be detected by infrared, sonar, etc."
},
{
"id" : "bio_painkiller",
"name" : "Sensory Dulling",
"cost" : 2,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Your nervous system is wired to allow you to inhibit the signals of pain,\nallowing you to dull your senses at will. However, the use of this system\nmay cause delayed reaction time and drowsiness."
},
{
"id" : "bio_nanobots",
"name" : "Repair Nanobots",
"cost" : 5,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Inside your body is a fleet of tiny dormant robots. Once charged from your\nenergy banks, they will flit about your body, repairing any damage."
},
{
"id" : "bio_heatsink",
"name" : "Thermal Dissipation",
"cost" : 1,
"time" : 6,
"flags" : ["ACTIVE"],
"description": "Powerful heatsinks supermaterials are woven into your flesh. While powered,\nthis system will prevent heat damage up to 2000 degrees fahrenheit. Note\nthat this does not affect your internal temperature."
},
{
"id" : "bio_resonator",
"name" : "Sonic Resonator",
"cost" : 4,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Your entire body may resonate at very high power, creating a short-range\nshockwave. While it will not to much damage to flexible creatures, stiff\nitems such as walls, doors, and even robots will be severely damaged."
},
{
"id" : "bio_time_freeze",
"name" : "Time Dilation",
"cost" : 3,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "At an immense cost of power, you may increase your body speed and reactions\ndramatically, essentially freezing time. You are still delicate, however,\nand violent or rapid movements may damage you due to friction."
},
{
"id" : "bio_teleport",
"name" : "Teleportation Unit",
"cost" : 10,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "This highly experimental unit folds space over short distances, instantly\ntransporting your body up to 25 feet at the cost of much power. Note that\nprolonged or frequent use may have dangerous side effects."
},
{
"id" : "bio_blood_anal",
"name" : "Blood Analysis",
"cost" : 1,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Small sensors have been implanted in your heart, allowing you to analyse your\nblood. This will detect many illnesses, drugs, and other conditions."
},
{
"id" : "bio_blood_filter",
"name" : "Blood Filter",
"cost" : 3,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "A filtration system in your heart allows you to actively filter out chemical\nimpurities, primarily drugs. It will have limited impact on viruses. Note\nthat it is not a targeted filter; ALL drugs in your system will be affected."
},
{
"id" : "bio_alarm",
"name" : "Alarm System",
"cost" : 1,
"time" : 400,
"flags" : ["ACTIVE"],
"description": "A motion-detecting alarm system will notice almost all movement within a\nfifteen-foot radius, and will silently alert you. This is very useful during\nsleep, or if you suspect a cloaked pursuer."
},
{
"id" : "bio_evap",
"name" : "Aero-Evaporator",
"cost" : 8,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "This unit draws moisture from the surrounding air, which then is poured from\na fingertip in the form of water. It may fail in very dry environments."
},
{
"id" : "bio_lighter",
"name" : "Mini-Flamethrower",
"cost" : 3,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "The index fingers of both hands have powerful fire starters which extend from\nthe tip."
},
{
"id" : "bio_claws",
"name" : "Adamantium Claws",
"cost" : 3,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Your fingers can withdraw into your hands, allowing a set of vicious claws to\nextend. These do considerable cutting damage, but prevent you from holding\nanything else."
},
{
"id" : "bio_blaster",
"name" : "Fusion Blaster Arm",
"cost" : 2,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Your left arm has been replaced by a heavy-duty fusion blaster! You may use\nyour energy banks to fire a damaging heat ray; however, you are unable to use\nor carry two-handed items, and may only fire handguns."
},
{
"id" : "bio_laser",
"name" : "Finger-Mounted Laser",
"cost" : 2,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "One of your fingers has a small high-powered laser embedded in it. This long\nrange weapon is not incredibly damaging, but is very accurate, and has the\npotential to start fires."
},
{
"id" : "bio_emp",
"name" : "Directional EMP",
"cost" : 4,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Mounted in the palms of your hand are small parabolic EMP field generators.\nYou may use power to fire a short-ranged blast which will disable electronics\nand robots."
},
{
"id" : "bio_hydraulics",
"name" : "Hydraulic Muscles",
"cost" : 1,
"time" : 3,
"flags" : ["ACTIVE"],
"description": "While activated, the muscles in your arms will be greatly enchanced,\nincreasing your strength by 20."
},
{
"id" : "bio_water_extractor",
"name" : "Water Extraction Unit",
"cost" : 2,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Nanotubes embedded in the palm of your hand will pump any available fluid out\nof a dead body, cleanse it of impurities and convert it into drinkable water.\nYou must, however, have a container to store the water in."
},
{
"id" : "bio_magnet",
"name" : "Electromagnetic Unit",
"cost" : 2,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Embedded in your hand is a powerful electromagnet, allowing you to pull items\nmade of iron over short distances."
},
{
"id" : "bio_fingerhack",
"name" : "Fingerhack",
"cost" : 1,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "One of your fingers has an electrohack embedded in it; an all-purpose hacking\nunit used to override control panels and the like (but not computers). Skill\nin computers is important, and a failed use may damage your circuits."
},
{
"id" : "bio_lockpick",
"name" : "Fingerpick",
"cost" : 1,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "One of your fingers has an electronic lockpick embedded in it. This auto-\nmatic system will quickly unlock all but the most advanced key locks without\nany skill required on the part of the user."
},
{
"id" : "bio_ground_sonar",
"name" : "Terranian Sonar",
"cost" : 1,
"time" : 5,
"flags" : ["ACTIVE"],
"description": "Your feet are equipped with precision sonar equipment, allowing you to detect\nthe movements of creatures below the ground."
},
{
"id" : "bio_power_armor_interface",
"name" : "Power Armor Interface",
"cost" : 1,
"time" : 10,
"flags" : ["ACTIVE"],
"description": "Interfaces your power system with the internal charging port on suits of power armor."
},
{
"id" : "bio_power_armor_interface_mkII",
"name" : "Power Armor Interface Mk. II",
"cost" : 1,
"time" : 50,
"flags" : ["ACTIVE"],
"description": "Interfaces your power system with the internal charging port on suits of power armor.\nThe Mk. II was designed by DoubleTech Inc., to meet the popularity of the Mk. II\npower armor series."
},
{
"id" : "bio_flashbang",
"name" : "Flashbang Generator",
"cost" : 5,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Light emitting diodes integrated into your skin can release a flash comparable\nto a flashbang grenade, blinding nearby enemies. Speakers integrated into your\nbody mimic the loud sound, deafening those nearby."
},
{
"id" : "bio_railgun",
"name" : "Railgun",
"cost" : 1,
"time" : 100,
"flags" : ["ACTIVE"],
"description": "EM field generators in your arms double the range and damage of thrown\niron and steel objects at a cost of 1 power per throw, causing them to\nleave a trail of electricity that can cause additional damage."
},
{
"id" : "bio_probability_travel",
"name" : "Probability Travel",
"cost" : 1,
"time" : 100,
"flags" : ["ACTIVE"],
"description": "Increases your body's wavelength, allowing you to quantum tunnel through\nwalls, reappearing on the other side. Power drain in standby is minimal,\nbut each tile tunneled through costs 10 bionic power."
},
{
"id" : "bio_shockwave",
"name" : "Shockwave Generator",
"cost" : 10,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "You generate a powerful shockwave, knocking back all nearby creatures.\nTargets are stunned briefly, take damage and additional stun upon impact\nwith impassable terrain, and knockback any creatures they collide with."
},
{
"id" : "bio_chain_lightning",
"name" : "Chain Lightning",
"cost" : 5,
"time" : 0,
"flags" : ["ACTIVE"],
"description": "Your body is equipped with a chain lightning generator, allowing you to\n emit a blast of lightning at a target, leaving a trail of lightning in\n its wake, jumping to additional targets within 4 tiles of the previous target."
},
{
"id" : "bio_night",
"name" : "Artificial Night Generator",
"cost" : 1,
"time" : 2,
"flags" : ["ACTIVE"],
"description": "Destructive interference eliminates all light within a 15 tile radius."
},
{
"id" : "bio_dis_shock",
"name" : "Electrical Discharge",
"cost" : 0,
"time" : 0,
"flags" : ["FAULTY"],
"description": "A malfunctioning bionic which occasionally discharges electricity through\nyour body, causing pain and brief paralysis but no damage."
},
{
"id" : "bio_dis_acid",
"name" : "Acidic Discharge",
"cost" : 0,
"time" : 0,
"flags" : ["FAULTY"],
"description": "A malfunctioning bionic which occasionally discharges acid into your muscles,\ncausing sharp pain and minor damage."
},
{
"id" : "bio_drain",
"name" : "Electrical Drain",
"cost" : 0,
"time" : 0,
"flags" : ["FAULTY"],
"description": "A malfunctioning bionic. It doesn't perform any useful function, but will\noccasionally draw power from your batteries."
},
{
"id" : "bio_noise",
"name" : "Noisemaker",
"cost" : 0,
"time" : 0,
"flags" : ["FAULTY"],
"description": "A malfunctioning bionic. It will occasionally emit a loud burst of noise."
},
{
"id" : "bio_power_weakness",
"name" : "Power Overload",
"cost" : 0,
"time" : 0,
"flags" : ["FAULTY"],
"description": "Damaged power circuits cause short-circuiting inside your muscles when your\nbatteries are above 75%%%% capacity, causing greatly reduced strength. This\nhas no effect if you have no internal batteries."
},
{
"id" : "bio_stiff",
"name" : "Wire-induced Stiffness",
"cost" : 0,
"time" : 0,
"flags" : ["FAULTY"],
"description": "Improperly installed wires cause a physical stiffness in most of your body,\ncausing increased encumberance."
}
]
+3055 -10
View File
File diff suppressed because it is too large Load Diff
+565 -288
View File
File diff suppressed because it is too large Load Diff
+829
View File
@@ -0,0 +1,829 @@
[
{
"type" : "AMMO",
"id" : "arrowhead",
"rarity" : 0,
"price" : 30,
"name" : "arrowhead",
"symbol" : "=",
"color" : "light_gray",
"description" : "Heads for an arrow. Placing these on an arrow will make the arrow more damaging and piercing.",
"material" : "steel",
"volume" : 1,
"weight" : 1,
"bashing" : 1,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "NULL",
"damage" : 0,
"pierce" : 0,
"range" : 0,
"dispersion" : 0,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "fletching",
"rarity" : 0,
"price" : 30,
"name" : "fletching",
"symbol" : "=",
"color" : "white",
"description" : "Also known as a flight, this item provides aerodynamic stabilization of arrows.",
"material" : "leather",
"volume" : 1,
"weight" : 1,
"bashing" : 1,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "NULL",
"damage" : 0,
"pierce" : 0,
"range" : 0,
"dispersion" : 0,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "shaft_wood",
"rarity" : 0,
"price" : 20,
"name" : "wood arrow shaft",
"symbol" : "=",
"color" : "green",
"description" : "A crude shaft made from wood. It needs arrowheads and fletching to become a functional arrow. You can, however, fire it from a bow.",
"material" : "wood",
"volume" : 1,
"weight" : 12,
"bashing" : 1,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 0,
"pierce" : 0,
"range" : 0,
"dispersion" : 34,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "shaft_wood_heavy",
"rarity" : 0,
"price" : 20,
"name" : "heavy wood arrow shaft",
"symbol" : "=",
"color" : "green",
"description" : "A heavy shaft made from wood. It needs arrowheads and fletching to become a functional arrow. You can, however, fire it from a bow.",
"material" : "wood",
"volume" : 1,
"weight" : 14,
"bashing" : 2,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 2,
"pierce" : 0,
"range" : 1,
"dispersion" : 29,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "shaft_metal",
"rarity" : 0,
"price" : 20,
"name" : "metal arrow shaft",
"symbol" : "=",
"color" : "green",
"description" : "A heavy shaft made from scrap metal. It needs arrowheads and fletching to become a functional arrow. You can, however, fire it from a bow.",
"material" : "steel",
"volume" : 1,
"weight" : 19,
"bashing" : 3,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 3,
"pierce" : 0,
"range" : 3,
"dispersion" : 24,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_fire_hardened",
"rarity" : 0,
"price" : 25,
"name" : "fire hardened wood arrow",
"symbol" : "=",
"color" : "green",
"description" : "A simple arrow shaft that has had a point carved into it and then fire hardened.",
"material" : "wood",
"volume" : 1,
"weight" : 12,
"bashing" : 2,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 3,
"pierce" : 0,
"range" : 2,
"dispersion" : 29,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_field_point",
"rarity" : 0,
"price" : 30,
"name" : "field point wood arrow",
"symbol" : "=",
"color" : "green",
"description" : "A simple arrow shaft that has a crude arrow head. Useful for hunting small woodland creatures.",
"material" : "wood",
"volume" : 1,
"weight" : 13,
"bashing" : 3,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 6,
"pierce" : 1,
"range" : 2,
"dispersion" : 29,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_small_game",
"rarity" : 0,
"price" : 30,
"name" : "small game arrow",
"symbol" : "=",
"color" : "green",
"description" : "A simple arrow shaft that has a wide blunt head. Useful for hunting small woodland creatures without splattering them all over the ground.",
"material" : "wood",
"volume" : 1,
"weight" : 13,
"bashing" : 4,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 2,
"pierce" : 0,
"range" : 2,
"dispersion" : 29,
"recoil" : 0,
"count" : 10,
"flags" : ["NOGIB"]
},
{
"type" : "AMMO",
"id" : "arrow_fire_hardened_fletched",
"rarity" : 0,
"price" : 35,
"name" : "fletched fire hardened wood arrow",
"symbol" : "=",
"color" : "green",
"description" : "This simple arrow has a fire hardened point and some fletchings.",
"material" : "wood",
"volume" : 1,
"weight" : 13,
"bashing" : 3,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 4,
"pierce" : 0,
"range" : 6,
"dispersion" : 14,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_field_point_fletched",
"rarity" : 0,
"price" : 40,
"name" : "fletched field point wood arrow",
"symbol" : "=",
"color" : "green",
"description" : "A simple arrow shaft that has a crude arrow head and some fletchings. Useful for hunting small woodland creatures or as a last ditch defense against zombies.",
"material" : "wood",
"volume" : 1,
"weight" : 14,
"bashing" : 3,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 7,
"pierce" : 2,
"range" : 6,
"dispersion" : 14,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_wood",
"rarity" : 7,
"price" : 75,
"name" : "wood arrow",
"symbol" : "=",
"color" : "green",
"description" : "A basic wooden arrow, it has a metal arrow head and some fletchings. It's light-weight, does some damage, and is so-so on accuracy. Stands a good chance of remaining intact once fired.",
"material" : "wood",
"volume" : 1,
"weight" : 15,
"bashing" : 2,
"cutting" : 1,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 10,
"pierce" : 3,
"range" : 7,
"dispersion" : 9,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_heavy_fire_hardened_fletched",
"rarity" : 7,
"price" : 75,
"name" : "heavy fletched fire hardened arrow",
"symbol" : "=",
"color" : "green",
"description" : "This arrow is significantly sturdier than other wooden arrows. It has a firehardened point and some fletchings.",
"material" : "plastic",
"volume" : 1,
"weight" : 19,
"bashing" : 4,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 5,
"pierce" : 2,
"range" : 7,
"dispersion" : 9,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_heavy_field_point_fletched",
"rarity" : 7,
"price" : 75,
"name" : "heavy fletched field point arrow",
"symbol" : "=",
"color" : "green",
"description" : "This arrow is significantly sturdier than other wooden arrows. It has a crude field point head and some fletchings.",
"material" : "plastic",
"volume" : 1,
"weight" : 20,
"bashing" : 4,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 6,
"pierce" : 3,
"range" : 7,
"dispersion" : 9,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_wood_heavy",
"rarity" : 7,
"price" : 75,
"name" : "heavy wood arrow",
"symbol" : "=",
"color" : "green",
"description" : "A heavy wooden arrow, it has a metal arrow head and some fletchings. It's much heavier than other wooden arrows, as a result it does more damage and is more stable in flight, resulting in better accuracy over a longer range. Stands a very good chance of remaining intact once fired.",
"material" : "plastic",
"volume" : 1,
"weight" : 22,
"bashing" : 6,
"cutting" : 2,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 12,
"pierce" : 5,
"range" : 8,
"dispersion" : 4,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_metal_sharpened",
"rarity" : 7,
"price" : 50,
"name" : "sharpened metal arrow",
"symbol" : "=",
"color" : "green",
"description" : "This metal shaft has been carefully sharpened so that it has a crude point at the end.",
"material" : "steel",
"volume" : 1,
"weight" : 19,
"bashing" : 2,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 5,
"pierce" : 3,
"range" : 5,
"dispersion" : 19,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_metal",
"rarity" : 7,
"price" : 100,
"name" : "metal arrow",
"symbol" : "=",
"color" : "green",
"description" : "This metal arrow has a steel arrow head and some fletchings.",
"material" : "steel",
"volume" : 1,
"weight" : 21,
"bashing" : 3,
"cutting" : 2,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 14,
"pierce" : 7,
"range" : 10,
"dispersion" : 4,
"recoil" : 0,
"count" : 10
},
{
"type" : "AMMO",
"id" : "arrow_cf",
"rarity" : 5,
"price" : 150,
"name" : "carbon fiber arrow",
"symbol" : "=",
"color" : "green",
"description" : "High-tech carbon fiber shafts and 100 grain broadheads. Very light weight, fast, and notoriously fragile.",
"material" : "plastic",
"volume" : 2,
"weight" : 15,
"bashing" : 1,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 10,
"pierce" : 5,
"range" : 8,
"dispersion" : 9,
"recoil" : 0,
"count" : 8
},
{
"type" : "AMMO",
"id" : "arrow_exploding",
"rarity" : 5,
"price" : 350,
"name" : "exploding arrow",
"symbol" : "=",
"color" : "green",
"description" : "This arrow has a small IED strapped to its tip. Horribly inaccurate, heavy, and bulky, not only does this contraption require expert hands to pull off a shot, it requires one to loose this with a small measure of confidence the shooter won't be caught in the blast radius.",
"material" : "steel",
"volume" : 2,
"weight" : 40,
"bashing" : 2,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 15,
"pierce" : 9,
"range" : 5,
"dispersion" : 19,
"recoil" : 0,
"count" : 5,
"effects" : ["EXPLOSIVE"]
},
{
"id" : "exploding_arrow_warhead",
"symbol" : "=",
"color" : "green",
"name" : "exploding arrowhead",
"description" : "This simple IED is designed to be attached to an arrow and detonate on impact. Theoretically you could throw it but who would want to do that?",
"rarity" : 3,
"price" : 400,
"material" : "iron",
"weight" : 10,
"volume" : 1,
"bashing" : 10,
"cutting" : 0,
"to_hit" : -1,
"count" : 5,
"effects" : ["EXPLOSIVE"]
},
{
"type" : "AMMO",
"id" : "arrow_flamming",
"rarity" : 5,
"price" : 350,
"name" : "flaming arrow",
"symbol" : "=",
"color" : "green",
"description" : "This arrow has a flaming rag wrapped around the shaft near the head. You should shoot it soon before it burns your bow.",
"material" : "steel",
"volume" : 2,
"weight" : 40,
"bashing" : 2,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "arrow",
"damage" : 15,
"pierce" : 9,
"range" : 5,
"dispersion" : 19,
"recoil" : 0,
"count" : 5,
"effects" : ["IGNITE"]
},
{
"type" : "AMMO",
"id" : "bolt_wood",
"rarity" : 8,
"price" : 100,
"name" : "wood crossbow bolt",
"symbol" : "=",
"color" : "green",
"description" : "A sharpened bolt carved from wood. It's lighter than a steel bolt, but does less damage and is less accurate. Stands a good chance of remaining intact once fired.",
"material" : "wood",
"volume" : 1,
"weight" : 40,
"bashing" : 1,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "bolt",
"damage" : 10,
"pierce" : 1,
"range" : 0,
"dispersion" : 10,
"recoil" : 0,
"count" : 15
},
{
"type" : "AMMO",
"id" : "bolt_steel",
"rarity" : 7,
"price" : 400,
"name" : "steel crossbow bolt",
"symbol" : "=",
"color" : "green",
"description" : "A sharp bolt made from steel. Deadly in skilled hands. Stands an excellent chance of remaining intact once fired.",
"material" : "steel",
"volume" : 1,
"weight" : 25,
"bashing" : 5,
"cutting" : 0,
"to_hit" : 0,
"ammo_type" : "bolt",
"damage" : 20,
"pierce" : 10,
"range" : 6,
"dispersion" : 9,
"recoil" : 0,
"count" : 10
},
{
"id" : "selfbow",
"type" : "GUN",
"symbol" : "(",
"color" : "yellow",
"name" : "self bow",
"description" : "A bow made from a single piece of wood. It is made specifically for the person using it.",
"rarity" : 5,
"price" : 400,
"material" : "wood",
"flags" : ["ALWAYS_TWOHAND", "RELOAD_AND_SHOOT"],
"skill" : "archery",
"ammo" : "arrow",
"weight" : 8,
"volume" : 12,
"bashing" : 6,
"cutting" : 0,
"to_hit" : 0,
"ranged_damage" : 4,
"range" : 5,
"dispersion" : 20,
"recoil" : 0,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 70
},
{
"id" : "shortbow",
"type" : "GUN",
"symbol" : "(",
"color" : "yellow",
"name" : "short bow",
"description" : "A shorter bow than the longbow, easier to draw than the longbow but sacrifices power. Arrows fired from this weapon have a good chance of remaining intact for re-use. It requires 8 strength to fire",
"rarity" : 5,
"price" : 800,
"material" : "wood",
"flags" : ["ALWAYS_TWOHAND", "STR8_DRAW", "RELOAD_AND_SHOOT"],
"skill" : "archery",
"ammo" : "arrow",
"weight" : 3,
"volume" : 6,
"bashing" : 6,
"cutting" : 0,
"to_hit" : 0,
"ranged_damage" : 3,
"range" : 6,
"dispersion" : 14,
"recoil" : 0,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 60
},
{
"id" : "compbow",
"type" : "GUN",
"symbol" : "(",
"color" : "yellow",
"name" : "compound bow",
"description" : "A bow with cams that fires high velocity arrows. Weaker people can use compound bows more easily. Arrows fired from this weapon have a good chance of remaining intact for re-use. It requires 8 strength to fire",
"rarity" : 1,
"price" : 1800,
"material" : ["steel", "plastic"],
"flags" : ["ALWAYS_TWOHAND", "STR8_DRAW", "RELOAD_AND_SHOOT"],
"skill" : "archery",
"ammo" : "arrow",
"weight" : 8,
"volume" : 8,
"bashing" : 8,
"cutting" : 0,
"to_hit" : 1,
"ranged_damage" : 5,
"range" : 10,
"dispersion" : 12,
"recoil" : 0,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 100
},
{
"id" : "compositebow",
"type" : "GUN",
"symbol" : "(",
"color" : "yellow",
"name" : "composite bow",
"description" : "A bow made from more than one material so it is able to store more energy. Arrows fired from this weapon have a good chance of remaining intact for re-use. It requires 10 strength to fire",
"rarity" : 3,
"price" : 1200,
"material" : ["wood", "plastic"],
"flags" : ["ALWAYS_TWOHAND", "STR10_DRAW", "RELOAD_AND_SHOOT"],
"skill" : "archery",
"ammo" : "arrow",
"weight" : 6,
"volume" : 10,
"bashing" : 8,
"cutting" : 0,
"to_hit" : 0,
"ranged_damage" : 7,
"range" : 12,
"dispersion" : 10,
"recoil" : 0,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 110
},
{
"id" : "recurbow",
"type" : "GUN",
"symbol" : "(",
"color" : "yellow",
"name" : "recurve bow",
"description" : "A bow that curves away from the archer at the tips allowing more power to be stored in the bow. Arrows fired from this weapon have a good chance of remaining intact for re-use. It requires 10 strength to fire",
"rarity" : 2,
"price" : 1200,
"material" : ["steel", "plastic"],
"flags" : ["ALWAYS_TWOHAND", "STR10_DRAW", "RELOAD_AND_SHOOT"],
"skill" : "archery",
"ammo" : "arrow",
"weight" : 6,
"volume" : 10,
"bashing" : 12,
"cutting" : 0,
"to_hit" : 0,
"ranged_damage" : 9,
"range" : 14,
"dispersion" : 8,
"recoil" : 0,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 100
},
{
"id" : "reflexbow",
"type" : "GUN",
"symbol" : "(",
"color" : "yellow",
"name" : "reflex bow",
"description" : "A bow that has limbs which curve away from the archer sacrificing accuracy for power. Arrows fired from this weapon have a good chance of remaining intact for re-use. It requires 10 strength to fire",
"rarity" : 2,
"price" : 1200,
"material" : ["steel", "plastic"],
"flags" : ["ALWAYS_TWOHAND", "STR10_DRAW", "RELOAD_AND_SHOOT"],
"skill" : "archery",
"ammo" : "arrow",
"weight" : 6,
"volume" : 10,
"bashing" : 12,
"cutting" : 0,
"to_hit" : 0,
"ranged_damage" : 11,
"range" : 16,
"dispersion" : 6,
"recoil" : 0,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 100
},
{
"id" : "longbow",
"type" : "GUN",
"symbol" : "(",
"color" : "yellow",
"name" : "longbow",
"description" : "A six-foot wooden bow that fires arrows. This takes a fair amount of strength to draw. Arrows fired from this weapon have a good chance of remaining intact for re-use. It requires 10 strength to fire",
"rarity" : 5,
"price" : 800,
"material" : "wood",
"flags" : ["ALWAYS_TWOHAND", "STR10_DRAW", "RELOAD_AND_SHOOT"],
"skill" : "archery",
"ammo" : "arrow",
"weight" : 4,
"volume" : 8,
"bashing" : 10,
"cutting" : 0,
"to_hit" : 0,
"ranged_damage" : 7,
"range" : 20,
"dispersion" : 18,
"recoil" : 0,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 80
},
{
"id" : "reflexrecurvebow",
"type" : "GUN",
"symbol" : "(",
"color" : "yellow",
"name" : "reflex recurve bow",
"description" : "A bow that combines the traits from both the reflex and the recurve bows. Both the limbs and the tips curve away from the archer. This dramatically increases the power while increasing the strength to draw the bow significantly. It requires 12 strength to fire efficiently.",
"rarity" : 2,
"price" : 1200,
"material" : ["wood", "bone"],
"flags" : ["ALWAYS_TWOHAND", "STR12_DRAW", "RELOAD_AND_SHOOT"],
"skill" : "archery",
"ammo" : "arrow",
"weight" : 4,
"volume" : 5,
"bashing" : 12,
"cutting" : 0,
"to_hit" : 0,
"ranged_damage" : 15,
"range" : 18,
"dispersion" : 8,
"recoil" : 0,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 80
},
{
"id" : "hand_crossbow",
"type" : "GUN",
"symbol" : "(",
"color" : "green",
"name" : "pistol crossbow",
"description" : "A small concealable pistol like crossbow. It is weak due to it's small size and draw, good for hunting small game. Bolts fired from this weapon have a good chance of remaining intact for re-use.",
"rarity" : 1,
"price" : 1000,
"material" : ["iron", "wood"],
"flags" : "none",
"skill" : "archery",
"ammo" : "bolt",
"weight" : 5,
"volume" : 4,
"bashing" : 4,
"cutting" : 0,
"to_hit" : -0,
"ranged_damage" : -6,
"range" : 6,
"dispersion" : 12,
"recoil" : 0,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 100
},
{
"id" : "crossbow",
"type" : "GUN",
"symbol" : "(",
"color" : "green",
"name" : "crossbow",
"description" : "A slow-loading hand weapon that launches bolts. Stronger people can reload it much faster. Bolts fired from this weapon have a good chance of remaining intact for re-use.",
"rarity" : 2,
"price" : 1000,
"material" : ["iron", "wood"],
"flags" : "STR_RELOAD",
"skill" : "archery",
"ammo" : "bolt",
"weight" : 9,
"volume" : 6,
"bashing" : 11,
"cutting" : 0,
"to_hit" : 1,
"ranged_damage" : 0,
"range" : 10,
"dispersion" : 10,
"recoil" : 0,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 800
},
{
"id" : "huge_crossbow",
"type" : "GUN",
"symbol" : "(",
"color" : "green",
"name" : "Ganz-Rustung",
"description" : "A HUGE very slow-loading medieval crossbow from Germany. It's tension is so powerful that you feel it shake after firing. Un-skilled users will find it very hard to reload. Bolts fired from this weapon have a good chance of remaining intact for re-use.",
"rarity" : 2,
"price" : 1000,
"material" : ["iron", "wood"],
"flags" : ["ALWAYS_TWOHAND", "STR_RELOAD"],
"skill" : "archery",
"ammo" : "bolt",
"weight" : 60,
"volume" : 40,
"bashing" : 20,
"cutting" : 0,
"to_hit" : -1,
"ranged_damage" : 30,
"range" : 30,
"dispersion" : 22,
"recoil" : 30,
"durability" : 6,
"burst" : 0,
"clip_size" : 1,
"reload" : 6000
},
{
"id" : "rep_crossbow",
"type" : "GUN",
"symbol" : "(",
"color" : "green",
"name" : "repeating crossbow",
"description" : "A custom made mechanical large crossbow, with a wooden magazine that holds 10 bolts. Single bolt reload. Bolts fired from this weapon have a good chance of remaining intact for re-use.",
"rarity" : 1,
"price" : 1000,
"material" : ["iron", "wood"],
"flags" : ["ALWAYS_TWOHAND", "RELOAD_ONE", "MODE_BURST"],
"skill" : "archery",
"ammo" : "bolt",
"weight" : 16,
"volume" : 10,
"bashing" : 13,
"cutting" : 0,
"to_hit" : -1,
"ranged_damage" : -2,
"range" : 8,
"dispersion" : 22,
"recoil" : 15,
"durability" : 6,
"burst" : 3,
"clip_size" : 10,
"reload" : 100
}
]
+864 -415
View File
File diff suppressed because it is too large Load Diff
+176 -44
View File
@@ -10,7 +10,7 @@
"color" : "pink",
"intelligence" : 0,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -32,7 +32,7 @@
"color" : "pink",
"intelligence" : 3,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -54,7 +54,7 @@
"color" : "pink",
"intelligence" : 7,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -76,7 +76,7 @@
"color" : "pink",
"intelligence" : 2,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -98,7 +98,7 @@
"color" : "pink",
"intelligence" : 5,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -120,7 +120,7 @@
"color" : "pink",
"intelligence" : 5,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -142,7 +142,7 @@
"color" : "pink",
"intelligence" : 2,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -164,7 +164,7 @@
"color" : "pink",
"intelligence" : 2,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -186,7 +186,7 @@
"color" : "pink",
"intelligence" : 7,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -208,7 +208,7 @@
"color" : "pink",
"intelligence" : 0,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -230,7 +230,7 @@
"color" : "pink",
"intelligence" : 1,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -252,7 +252,7 @@
"color" : "pink",
"intelligence" : 2,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -274,7 +274,7 @@
"color" : "pink",
"intelligence" : 1,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -296,7 +296,7 @@
"color" : "pink",
"intelligence" : 1,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -3,
"cutting" : 0,
@@ -318,7 +318,7 @@
"color" : "light_blue",
"intelligence" : 4,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 4,
"bashing" : -2,
"cutting" : 0,
@@ -340,7 +340,7 @@
"color" : "light_blue",
"intelligence" : 5,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 4,
"bashing" : -2,
"cutting" : 0,
@@ -362,7 +362,7 @@
"color" : "light_blue",
"intelligence" : 6,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 3,
"bashing" : -3,
"cutting" : 0,
@@ -384,7 +384,7 @@
"color" : "light_blue",
"intelligence" : 7,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 4,
"bashing" : -2,
"cutting" : 0,
@@ -406,7 +406,7 @@
"color" : "light_blue",
"intelligence" : 7,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 4,
"bashing" : -2,
"cutting" : 0,
@@ -428,7 +428,7 @@
"color" : "light_blue",
"intelligence" : 7,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 4,
"bashing" : -2,
"cutting" : 0,
@@ -450,7 +450,7 @@
"color" : "light_blue",
"intelligence" : 7,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 4,
"bashing" : -2,
"cutting" : 0,
@@ -472,7 +472,7 @@
"color" : "green",
"intelligence" : 3,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 2,
"bashing" : -4,
"cutting" : 0,
@@ -494,7 +494,7 @@
"color" : "green",
"intelligence" : 4,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 1,
"bashing" : -5,
"cutting" : 0,
@@ -516,7 +516,7 @@
"color" : "green",
"intelligence" : 5,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 3,
"bashing" : -3,
"cutting" : 0,
@@ -538,7 +538,7 @@
"color" : "green",
"intelligence" : 4,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 3,
"bashing" : -3,
"cutting" : 0,
@@ -560,7 +560,7 @@
"color" : "green",
"intelligence" : 5,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 3,
"bashing" : -3,
"cutting" : 0,
@@ -582,7 +582,7 @@
"color" : "green",
"intelligence" : 6,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 3,
"bashing" : -3,
"cutting" : 0,
@@ -604,7 +604,7 @@
"color" : "green",
"intelligence" : 7,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 5,
"bashing" : -2,
"cutting" : 0,
@@ -626,7 +626,7 @@
"color" : "green",
"intelligence" : 5,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 3,
"bashing" : -3,
"cutting" : 0,
@@ -648,7 +648,7 @@
"color" : "green",
"intelligence" : 4,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 4,
"bashing" : -2,
"cutting" : 0,
@@ -670,7 +670,7 @@
"color" : "green",
"intelligence" : 4,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 4,
"bashing" : -2,
"cutting" : 0,
@@ -692,7 +692,7 @@
"color" : "green",
"intelligence" : 6,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 4,
"bashing" : -2,
"cutting" : 0,
@@ -714,7 +714,7 @@
"color" : "green",
"intelligence" : 7,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 3,
"bashing" : -3,
"cutting" : 0,
@@ -736,7 +736,7 @@
"color" : "green",
"intelligence" : 4,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 3,
"bashing" : -3,
"cutting" : 0,
@@ -758,7 +758,7 @@
"color" : "green",
"intelligence" : 4,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 2,
"bashing" : -3,
"cutting" : 0,
@@ -780,7 +780,7 @@
"color" : "green",
"intelligence" : 5,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 2,
"bashing" : -3,
"cutting" : 0,
@@ -802,7 +802,7 @@
"color" : "blue",
"intelligence" : 11,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 7,
"bashing" : 5,
"cutting" : 0,
@@ -824,7 +824,7 @@
"color" : "blue",
"intelligence" : 11,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 7,
"bashing" : 5,
"cutting" : 0,
@@ -846,7 +846,7 @@
"color" : "blue",
"intelligence" : 9,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 7,
"bashing" : 5,
"cutting" : 0,
@@ -868,7 +868,7 @@
"color" : "blue",
"intelligence" : 6,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 6,
"bashing" : 4,
"cutting" : 0,
@@ -890,7 +890,7 @@
"color" : "blue",
"intelligence" : 12,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 8,
"bashing" : 5,
"cutting" : 0,
@@ -912,7 +912,7 @@
"color" : "blue",
"intelligence" : 8,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 6,
"bashing" : 4,
"cutting" : 0,
@@ -934,7 +934,7 @@
"color" : "blue",
"intelligence" : 13,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 6,
"bashing" : 6,
"cutting" : 0,
@@ -956,7 +956,7 @@
"color" : "blue",
"intelligence" : 14,
"symbol" : "?",
"material" : ["PAPER", "NULL"],
"material" : ["paper", "null"],
"volume" : 8,
"bashing" : 8,
"cutting" : 0,
@@ -966,5 +966,137 @@
"rarity" : 1,
"price" : 920,
"required_level" : 5
},
{
"type" : "BOOK",
"id" : "record_weather",
"name" : "National Weather Transcripts",
"max_level" : 0,
"description" : "Old weather records are about as interesting as a rock.",
"weight" : 7,
"to_hit" : 1,
"color" : "blue",
"intelligence" : 0,
"symbol" : "?",
"material" : ["paper", "null"],
"volume" : 7,
"bashing" : 7,
"cutting" : 0,
"time" : 30,
"fun" : -1,
"skill" : "none",
"rarity" : 20,
"price" : 5,
"required_level" : 0
},
{
"type" : "BOOK",
"id" : "record_patient",
"name" : "Patient Treatment Records",
"max_level" : 0,
"description" : "A massive stack of medical records that contain every gory detail.",
"weight" : 6,
"to_hit" : 1,
"color" : "blue",
"intelligence" : 0,
"symbol" : "?",
"material" : ["paper", "null"],
"volume" : 6,
"bashing" : 6,
"cutting" : 0,
"time" : 30,
"fun" : -1,
"skill" : "none",
"rarity" : 20,
"price" : 5,
"required_level" : 0
},
{
"type" : "BOOK",
"id" : "record_accounting",
"name" : "Corporate Accounting Ledger",
"max_level" : 0,
"description" : "If you knew what to look for something might stand out...",
"weight" : 5,
"to_hit" : 1,
"color" : "blue",
"intelligence" : 0,
"symbol" : "?",
"material" : ["paper", "null"],
"volume" : 5,
"bashing" : 5,
"cutting" : 0,
"time" : 30,
"fun" : -1,
"skill" : "none",
"rarity" : 20,
"price" : 100,
"required_level" : 0
},
{
"type" : "BOOK",
"id" : "black_box_transcript",
"name" : "black box transcript",
"max_level" : 0,
"description" : "A full flight log for a military aircraft. Nothing of interest stands out.",
"weight" : 5,
"to_hit" : 1,
"color" : "blue",
"intelligence" : 0,
"symbol" : "?",
"material" : ["paper", "null"],
"volume" : 5,
"bashing" : 5,
"cutting" : 0,
"time" : 30,
"fun" : -1,
"skill" : "none",
"rarity" : 0,
"price" : 500,
"required_level" : 0
},
{
"type" : "BOOK",
"id" : "priest_diary",
"name" : "Priest's Diary",
"max_level" : 0,
"description" : "A small book filled with journal entries in Latin.",
"weight" : 3,
"to_hit" : 1,
"color" : "blue",
"intelligence" : 0,
"symbol" : "?",
"material" : ["paper", "null"],
"volume" : 3,
"bashing" : 3,
"cutting" : 0,
"time" : 30,
"fun" : -1,
"skill" : "none",
"rarity" : 0,
"price" : 500,
"required_level" : 0
},
{
"type" : "BOOK",
"id" : "visions_solitude",
"name" : "Visions in Solitude",
"max_level" : 0,
"description" : "A small book detailing 'visions' a prisoner had on death row.",
"weight" : 1,
"to_hit" : 1,
"color" : "blue",
"intelligence" : 0,
"symbol" : "?",
"material" : ["paper", "null"],
"volume" : 3,
"bashing" : 3,
"cutting" : 0,
"time" : 30,
"fun" : 2,
"skill" : "none",
"rarity" : 0,
"price" : 900,
"required_level" : 0
}
]
File diff suppressed because it is too large Load Diff
+253
View File
@@ -0,0 +1,253 @@
[
{
"id": "bag_plastic",
"type": "CONTAINER",
"symbol": ")",
"color": "light_gray",
"name": "plastic bag",
"description": "A small, open plastic bag. Essentially trash.",
"rarity": 90,
"price": 1,
"weight": 0,
"volume": 1,
"bashing": -4,
"cutting": 0,
"to_hit": -8,
"contains": 24,
"material": "plastic"
},
{
"id": "bottle_plastic",
"type": "CONTAINER",
"symbol": ")",
"color": "light_cyan",
"name": "plastic bottle",
"description": "A resealable plastic bottle, holds 500mls of liquid.",
"rarity": 90,
"price": 8,
"weight": 0,
"volume": 2,
"bashing": -8,
"cutting": 0,
"to_hit": 1,
"material": "plastic",
"contains": 2,
"flags": ["RIGID", "WATERTIGHT", "SEALS"]
},
{
"id": "bottle_glass",
"type": "CONTAINER",
"symbol": ")",
"color": "cyan",
"name": "glass bottle",
"description": "A resealable glass bottle, holds 750mls of liquid.",
"rarity": 90,
"price": 1,
"weight": 2,
"volume": 3,
"bashing": -8,
"cutting": 0,
"to_hit": 1,
"material": "glass",
"contains": 3,
"flags": ["RIGID", "WATERTIGHT", "SEALS"]
},
{
"id": "can_drink",
"type": "CONTAINER",
"symbol": ")",
"color": "light_blue",
"name": "aluminum can",
"description": "An aluminum can, like what soda comes in.",
"rarity": 70,
"price": 1,
"weight": 0,
"volume": 1,
"bashing": 0,
"cutting": 0,
"to_hit": 0,
"material": "steel",
"contains": 1,
"flags": ["RIGID", "WATERTIGHT"]
},
{
"id": "can_food",
"type": "CONTAINER",
"symbol": ")",
"color": "blue",
"name": "tin can",
"description": "A tin can, like what beans come in.",
"rarity": 65,
"price": 2,
"weight": 0,
"volume": 1,
"bashing": -1,
"cutting": 0,
"to_hit": 1,
"material": "iron",
"contains": 1,
"flags": ["RIGID", "WATERTIGHT"]
},
{
"id": "box_small",
"type": "CONTAINER",
"symbol": ")",
"color": "brown",
"name": "sm. cardboard box",
"description": "A small cardboard box. No bigger than a foot in dimension.",
"rarity": 50,
"price": 0,
"weight": 0,
"volume": 4,
"bashing": -5,
"cutting": 0,
"to_hit": 1,
"material": "paper",
"contains": 4,
"flags": ["RIGID"]
},
{
"id": "canteen",
"type": "CONTAINER",
"symbol": ")",
"color": "green",
"name": "plastic canteen",
"description": "A large military-style water canteen, with a 1.5 liter capacity and strap.",
"rarity": 20,
"price": 1000,
"weight": 2,
"volume": 6,
"bashing": -8,
"cutting": 0,
"to_hit": 1,
"material": "plastic",
"contains": 6,
"flags": ["RIGID", "SEALS", "WATERTIGHT"]
},
{
"id": "jerrycan",
"type": "CONTAINER",
"symbol": ")",
"color": "green",
"name": "plastic jerrycan",
"description": "A bulky plastic jerrycan, meant to carry fuel, but can carry other liquids\nin a pinch. It has a capacity of 10 liters.",
"rarity": 10,
"price": 2500,
"weight": 4,
"volume": 40,
"bashing": -2,
"cutting": 0,
"to_hit": -2,
"material": "plastic",
"contains": 40,
"flags": ["RIGID", "SEALS", "WATERTIGHT"]
},
{
"id": "jug_plastic",
"type": "CONTAINER",
"symbol": ")",
"color": "light_cyan",
"name": "gallon jug",
"description": "A standard plastic jug used for household cleaning chemicals.",
"rarity": 10,
"price": 2500,
"weight": 2,
"volume": 10,
"bashing": -8,
"cutting": 0,
"to_hit": 1,
"material": "plastic",
"contains": 10,
"flags": ["RIGID", "SEALS", "WATERTIGHT"]
},
{
"id": "flask_glass",
"type": "CONTAINER",
"symbol": ")",
"color": "light_cyan",
"name": "glass flask",
"description": "A 250 ml laboratory conical flask, with a rubber bung.",
"rarity": 10,
"price": 2500,
"weight": 0,
"volume": 1,
"bashing": 8,
"cutting": 0,
"to_hit": 1,
"material": "glass",
"contains": 1,
"flags": ["RIGID", "SEALS", "WATERTIGHT"]
},
{
"id": "waterskin",
"type": "CONTAINER",
"symbol": ")",
"color": "brown",
"name": "waterskin",
"description": "A watertight leather bag, can hold 1.5 liters of water.",
"rarity": 0,
"price": 0,
"weight": 4,
"volume": 6,
"bashing": -8,
"cutting": 0,
"to_hit": -5,
"material": "leather",
"contains": 6,
"flags": ["SEALS", "WATERTIGHT"]
},
{
"id": "jerrycan_big",
"type": "CONTAINER",
"symbol": ")",
"color": "green",
"name": "steel jerrycan",
"description": "A steel jerrycan, meant to carry fuel, but can carry other liquids\nin a pinch. It has a capacity of 25 liters.",
"rarity": 20,
"price": 5000,
"weight": 7,
"volume": 100,
"bashing": -3,
"cutting": 0,
"to_hit": -3,
"material": "steel",
"contains": 100,
"flags": ["RIGID", "SEALS", "WATERTIGHT"]
},
{
"id": "keg",
"type": "CONTAINER",
"symbol": ")",
"color": "light_cyan",
"name": "aluminum keg",
"description": "A reusable aluminum keg, used for shipping beer.\nIt has a capacity of 50 liters.",
"rarity": 20,
"price": 6000,
"weight": 12,
"volume": 200,
"bashing": -4,
"cutting": 0,
"to_hit": -4,
"material": "steel",
"contains": 200,
"flags": ["RIGID", "SEALS", "WATERTIGHT"]
},
{
"id": "jar_glass",
"type": "CONTAINER",
"symbol": ")",
"color": "light_cyan",
"name": "glass jar",
"description": "A half-litre glass jar with a metal screw top lid, used for canning.",
"rarity": 50,
"price": 2500,
"weight": 1,
"volume": 1,
"bashing": 8,
"cutting": 0,
"to_hit": 1,
"material": "glass",
"contains": 1,
"flags": ["RIGID", "SEALS", "WATERTIGHT"]
}
]
+2 -2
View File
@@ -5,7 +5,7 @@
"name":"Guitar",
"description":"An acoustic six-string guitar. A bit out of tune, but in good shape otherwise.",
"rarity": 60,
"material": "WOOD",
"material": "wood",
"weight": 13,
"volume": 24,
"damage": 14,
@@ -23,7 +23,7 @@
"name":"Bongo",
"description": "A handheld drum. Suitable for making loud noises into all hours of the night.",
"rarity": 60,
"material": ["WOOD", "STEEL"],
"material": ["wood", "steel"],
"weight": 10,
"volume": 10,
"damage": 11,
+225 -139
View File
File diff suppressed because it is too large Load Diff
+592 -5
View File
@@ -7,20 +7,607 @@
"description":"Replacing several key parts of a 9mm, .38, .40 or .44 firearm converts it to a .45 firearm. The conversion results in reduced accuracy and increased recoil.",
"rarity": 3,
"price": 480,
"material": "STEEL",
"material": "steel",
"weight": 2,
"volume": 2,
"bashing": 3,
"cutting": 0,
"to_hit": -1,
"accuracy_modifier": 2,
"dispersion_modifier": 2,
"damage_modifier": 0,
"loudness_modifier": 0,
"ammo_modifier": ".45",
"ammo_modifier": "45",
"recoil_modifier": 2,
"burst_modifier": 0,
"clip_size_modifier": 0,
"mod_targets": ["pistol", "smg"],
"ammo_types": ["9MM", "38", "40", "44"]
}
"acceptable_ammo": ["9mm", "38", "40", "44"]
},
{
"type" : "GUNMOD",
"id" : "suppressor",
"name" : "suppressor",
"clip_size_modifier" : 0,
"dispersion_modifier" : 1,
"damage_modifier" : -4,
"ammo_modifier" : "NULL",
"description" : "Using a suppressor is almost an imperative in zombie-infested regions. Gunfire is very noisy, and will attract predators. Its only drawback is a reduced muzzle velocity, resulting in less accuracy and damage.",
"weight" : 1,
"to_hit" : 2,
"color" : "dark_gray",
"symbol" : ":",
"material" : ["steel", "plastic"],
"mod_targets" : ["pistol", "smg", "rifle"],
"volume" : 2,
"bashing" : 3,
"cutting" : 0,
"burst_modifier" : 0,
"recoil_modifier" : 0,
"rarity" : 15,
"price" : 480,
"loudness_modifier" : -25
},
{
"type" : "GUNMOD",
"id" : "grip",
"name" : "enhanced grip",
"clip_size_modifier" : 0,
"dispersion_modifier" : -2,
"damage_modifier" : 0,
"ammo_modifier" : "NULL",
"description" : "A grip placed forward on the barrel allows for greater control and accuracy. Aside from increased weight, there are no drawbacks.",
"weight" : 1,
"to_hit" : -1,
"color" : "brown",
"symbol" : ":",
"material" : ["steel", "plastic"],
"mod_targets" : ["shotgun", "smg", "rifle"],
"volume" : 1,
"bashing" : 0,
"cutting" : 0,
"burst_modifier" : 0,
"recoil_modifier" : -2,
"rarity" : 12,
"price" : 280,
"loudness_modifier" : 0
},
{
"type" : "GUNMOD",
"id" : "barrel_big",
"name" : "barrel extension",
"clip_size_modifier" : 0,
"dispersion_modifier" : -6,
"damage_modifier" : 1,
"ammo_modifier" : "NULL",
"description" : "A longer barrel increases the muzzle velocity of a firearm, contributing to both accuracy and damage. However, the longer barrel tends to vibrate after firing, greatly increasing recoil.",
"weight" : 1,
"to_hit" : 2,
"color" : "light_gray",
"symbol" : ":",
"material" : ["steel", "null"],
"mod_targets" : ["smg", "rifle"],
"volume" : 4,
"bashing" : 5,
"cutting" : 0,
"burst_modifier" : 0,
"recoil_modifier" : 5,
"rarity" : 10,
"price" : 400,
"loudness_modifier" : 0
},
{
"type" : "GUNMOD",
"id" : "barrel_small",
"name" : "shortened barrel",
"clip_size_modifier" : 0,
"dispersion_modifier" : 5,
"damage_modifier" : 0,
"ammo_modifier" : "NULL",
"description" : "A shortened barrel results in markedly reduced accuracy, and a minor increase in noise, but also reduces recoil greatly as a result of the improved managability of the firearm.",
"weight" : 1,
"to_hit" : -1,
"color" : "light_gray",
"symbol" : ":",
"material" : ["steel", "null"],
"mod_targets" : ["smg", "rifle"],
"volume" : 1,
"bashing" : -2,
"cutting" : 0,
"burst_modifier" : 0,
"recoil_modifier" : -6,
"rarity" : 6,
"price" : 320,
"loudness_modifier" : 2
},
{
"type" : "GUNMOD",
"id" : "barrel_rifled",
"name" : "rifled barrel",
"clip_size_modifier" : 0,
"dispersion_modifier" : -10,
"damage_modifier" : -20,
"ammo_modifier" : "NULL",
"description" : "Rifling a shotgun barrel is mainly done in order to improve its accuracy when firing slugs. The rifling makes the gun less suitable for shot, however.",
"weight" : 1,
"to_hit" : 1,
"color" : "light_gray",
"symbol" : ":",
"material" : ["steel", "null"],
"mod_targets" : ["shotgun"],
"volume" : 2,
"bashing" : 3,
"cutting" : 0,
"burst_modifier" : -1,
"recoil_modifier" : 0,
"rarity" : 5,
"price" : 220,
"loudness_modifier" : 0
},
{
"type" : "GUNMOD",
"id" : "clip",
"name" : "extended magazine",
"clip_size_modifier" : 50,
"dispersion_modifier" : 1,
"damage_modifier" : 0,
"ammo_modifier" : "NULL",
"description" : "Increases the ammunition capacity of your firearm by 50%, but the added bulk reduces accuracy slightly.",
"weight" : 1,
"to_hit" : -1,
"color" : "light_gray",
"symbol" : ":",
"material" : ["steel", "plastic"],
"mod_targets" : ["pistol", "shotgun", "smg", "rifle"],
"volume" : 1,
"bashing" : -2,
"cutting" : 0,
"burst_modifier" : 0,
"recoil_modifier" : 0,
"rarity" : 8,
"price" : 560,
"loudness_modifier" : 0
},
{
"type" : "GUNMOD",
"id" : "clip2",
"name" : "double magazine",
"clip_size_modifier" : 100,
"dispersion_modifier" : 2,
"damage_modifier" : 0,
"ammo_modifier" : "NULL",
"description" : "Completely doubles the ammunition capacity of your firearm, but the added bulk reduces accuracy and increases recoil.",
"weight" : 2,
"to_hit" : 0,
"color" : "light_gray",
"symbol" : ":",
"material" : ["steel", "plastic"],
"mod_targets" : ["shotgun", "smg", "rifle"],
"volume" : 2,
"bashing" : 0,
"cutting" : 0,
"burst_modifier" : 0,
"recoil_modifier" : 2,
"rarity" : 4,
"price" : 720,
"loudness_modifier" : 0
},
{
"type" : "GUNMOD",
"id" : "spare_mag",
"name" : "spare magazine",
"clip_size_modifier" : 0,
"dispersion_modifier" : 0,
"damage_modifier" : 0,
"ammo_modifier" : "NULL",
"description" : "A spare magazine you can keep on hand to make reloads faster, but must itself be reloaded before it can be used again.",
"weight" : 1,
"to_hit" : 0,
"color" : "light_gray",
"symbol" : ":",
"material" : ["steel", "plastic"],
"mod_targets" : ["pistol", "shotgun", "smg", "rifle"],
"volume" : 1,
"bashing" : 0,
"cutting" : 0,
"burst_modifier" : 0,
"recoil_modifier" : 0,
"rarity" : 15,
"price" : 200,
"loudness_modifier" : 0
},
{
"type" : "GUNMOD",
"id" : "brass_catcher",
"name" : "brass catcher",
"clip_size_modifier" : 0,
"dispersion_modifier" : 0,
"damage_modifier" : 0,
"ammo_modifier" : "NULL",
"description" : "A bag that hangs off the side of your gun and catches ejected casings so you don't have to pick them up.",
"weight" : 1,
"to_hit" : 0,
"color" : "light_gray",
"symbol" : ":",
"material" : ["cotton", "null"],
"mod_targets" : ["shotgun", "smg", "rifle"],
"volume" : 1,
"bashing" : 0,
"cutting" : 0,
"burst_modifier" : 0,
"recoil_modifier" : 0,
"rarity" : 15,
"price" : 200,
"loudness_modifier" : 0
},
{
"type" : "GUNMOD",
"id" : "stabilizer",
"name" : "gyroscopic stabilizer",
"clip_size_modifier" : -10,
"dispersion_modifier" : -2,
"damage_modifier" : -2,
"ammo_modifier" : "NULL",
"description" : "An advanced unit that straps onto the side of your firearm and reduces vibration, greatly reducing recoil and increasing accuracy. However, it also takes up space in the magazine slot, reducing ammo capacity.",
"weight" : 2,
"to_hit" : -3,
"color" : "blue",
"symbol" : ":",
"material" : ["steel", "plastic"],
"mod_targets" : ["smg", "rifle"],
"volume" : 3,
"bashing" : 0,
"cutting" : 0,
"burst_modifier" : 0,
"recoil_modifier" : -8,
"rarity" : 4,
"price" : 680,
"loudness_modifier" : 0
},
{
"type" : "GUNMOD",
"id" : "blowback",
"name" : "rapid blowback",
"clip_size_modifier" : 0,
"dispersion_modifier" : 3,
"damage_modifier" : 0,
"ammo_modifier" : "NULL",
"description" : "An improved blowback mechanism makes your firearm's automatic fire faster, at the cost of reduced accuracy and increased noise.",
"weight" : 1,
"to_hit" : 0,
"color" : "red",
"symbol" : ":",
"material" : ["steel", "plastic"],
"mod_targets" : ["smg", "rifle"],
"volume" : 0,
"bashing" : 0,
"cutting" : 0,
"burst_modifier" : 6,
"recoil_modifier" : 0,
"rarity" : 3,
"price" : 700,
"loudness_modifier" : 4
},
{
"type" : "GUNMOD",
"id" : "autofire",
"name" : "auto-fire mechanism",
"weight" : 2,
"color" : "red",
"burst_modifier" : 3,
"loudness_modifier" : 2,
"to_hit" : -1,
"dispersion_modifier" : 2,
"price" : 650,
"clip_size_modifier" : 0,
"description" : "A simple mechanism that converts a pistol to a fully-automatic weapon, with a burst size of three rounds. However, it reduces accuracy, and increases noise and recoil.",
"symbol" : ":",
"material" : ["steel", "plastic"],
"volume" : 1,
"cutting" : 0,
"recoil_modifier" : 2,
"damage_modifier" : 0,
"acceptable_ammo" : ["22", "9mm", "38", "40", "57", "46"],
"mod_targets" : ["pistol"],
"rarity" : 2,
"bashing" : 2,
"ammo_modifier" : "NULL"
},
{
"type" : "GUNMOD",
"id" : "retool_9mm",
"name" : "9mm caliber retool",
"weight" : 1,
"color" : "green",
"burst_modifier" : 0,
"loudness_modifier" : 0,
"to_hit" : -1,
"dispersion_modifier" : 1,
"price" : 420,
"clip_size_modifier" : 0,
"description" : "Replacing several key parts of a .38, .40, .44 or .45 firearm converts it to a 9mm firearm. The conversion results in a slight reduction in accuracy.",
"symbol" : ":",
"material" : ["steel", "null"],
"volume" : 1,
"cutting" : 0,
"recoil_modifier" : 0,
"damage_modifier" : 0,
"acceptable_ammo" : ["38", "40", "44", "45"],
"mod_targets" : ["pistol", "smg"],
"rarity" : 3,
"bashing" : 0,
"ammo_modifier" : "9mm"
},
{
"type" : "GUNMOD",
"id" : "retool_22",
"name" : ".22 caliber retool",
"weight" : 1,
"color" : "green",
"burst_modifier" : 0,
"loudness_modifier" : 0,
"to_hit" : -1,
"dispersion_modifier" : 1,
"price" : 320,
"clip_size_modifier" : 0,
"description" : "Replacing several key parts of a 9mm, .38, .40, 5.7mm, 4.6mm, 7.62mm or .223 firearm converts it to a .22 firearm. The conversion results in a slight reduction in accuracy.",
"symbol" : ":",
"material" : ["steel", "null"],
"volume" : 1,
"cutting" : 0,
"recoil_modifier" : 0,
"damage_modifier" : 0,
"acceptable_ammo" : ["9mm", "38", "40", "57", "46", "762", "223"],
"mod_targets" : ["pistol", "smg", "rifle"],
"rarity" : 2,
"bashing" : -2,
"ammo_modifier" : "22"
},
{
"type" : "GUNMOD",
"id" : "retool_57",
"name" : "5.7mm caliber retool",
"weight" : 1,
"color" : "green",
"burst_modifier" : 0,
"loudness_modifier" : 0,
"to_hit" : -1,
"dispersion_modifier" : 1,
"price" : 460,
"clip_size_modifier" : 0,
"description" : "FN Hestal sells a conversion kit, used to convert .22, 9mm, or .38 firearms to their proprietary 5.7x28mm, a round designed for accuracy and armor penetration.",
"symbol" : ":",
"material" : ["steel", "null"],
"volume" : 1,
"cutting" : 0,
"recoil_modifier" : 0,
"damage_modifier" : 0,
"acceptable_ammo" : ["22", "9mm", "38"],
"mod_targets" : ["pistol", "smg"],
"rarity" : 1,
"bashing" : -3,
"ammo_modifier" : "57"
},
{
"type" : "GUNMOD",
"id" : "retool_46",
"name" : "4.6mm caliber retool",
"weight" : 1,
"color" : "green",
"burst_modifier" : 0,
"loudness_modifier" : 0,
"to_hit" : -1,
"dispersion_modifier" : 1,
"price" : 460,
"clip_size_modifier" : 0,
"description" : "Heckler and Koch sells a conversion kit, used to convert .22, 9mm, or .38 firearms to their proprietary 4.6x30mm, a round designed for accuracy and armor penetration.",
"symbol" : ":",
"material" : ["steel", "null"],
"volume" : 1,
"cutting" : 0,
"recoil_modifier" : 0,
"damage_modifier" : 0,
"acceptable_ammo" : ["22", "9mm", "38"],
"mod_targets" : ["pistol", "smg"],
"rarity" : 1,
"bashing" : -3,
"ammo_modifier" : "46"
},
{
"type" : "GUNMOD",
"id" : "retool_308",
"name" : ".308 caliber retool",
"weight" : 1,
"color" : "green",
"burst_modifier" : 0,
"loudness_modifier" : 0,
"to_hit" : 1,
"dispersion_modifier" : 2,
"price" : 520,
"clip_size_modifier" : -20,
"description" : "This kit is used to convert a shotgun or 7.62mm, .223 or .30-06 rifle to the popular and powerful .308 caliber. The conversion results in reduced ammo capacity and a slight reduction in accuracy.",
"symbol" : ":",
"material" : ["steel", "null"],
"volume" : 2,
"cutting" : 0,
"recoil_modifier" : 0,
"damage_modifier" : 0,
"acceptable_ammo" : ["shot", "762", "223", "3006"],
"mod_targets" : ["shotgun", "rifle"],
"rarity" : 2,
"bashing" : 4,
"ammo_modifier" : "308"
},
{
"type" : "GUNMOD",
"id" : "retool_223",
"name" : ".223 caliber retool",
"weight" : 1,
"color" : "green",
"burst_modifier" : 0,
"loudness_modifier" : 0,
"to_hit" : 1,
"dispersion_modifier" : 2,
"price" : 500,
"clip_size_modifier" : -10,
"description" : "This kit is used to convert a shotgun or 7.62mm, .30-06, or .308 rifle to the popular, accurate, and damaging .223 caliber. The conversion results in slight reductions in both accuracy and ammo capacity.",
"symbol" : ":",
"material" : ["steel", "null"],
"volume" : 2,
"cutting" : 0,
"recoil_modifier" : 0,
"damage_modifier" : 0,
"acceptable_ammo" : ["shot", "762", "3006", "308"],
"mod_targets" : ["shotgun", "rifle"],
"rarity" : 2,
"bashing" : 4,
"ammo_modifier" : "223"
},
{
"type" : "GUNMOD",
"id" : "conversion_battle",
"name" : "battle rifle conversion",
"clip_size_modifier" : 20,
"dispersion_modifier" : 6,
"damage_modifier" : 6,
"ammo_modifier" : "NULL",
"description" : "This is a complete conversion kit, designed to turn a rifle into a powerful battle rifle. It reduces accuracy, and increases noise and recoil, but also increases damage, ammo capacity, and fire rate.",
"weight" : 3,
"to_hit" : -1,
"color" : "magenta",
"symbol" : ":",
"material" : ["steel", "null"],
"mod_targets" : ["rifle"],
"volume" : 4,
"bashing" : 6,
"cutting" : 0,
"burst_modifier" : 4,
"recoil_modifier" : 4,
"rarity" : 1,
"price" : 680,
"loudness_modifier" : 4
},
{
"type" : "GUNMOD",
"id" : "conversion_sniper",
"name" : "sniper conversion",
"clip_size_modifier" : -15,
"dispersion_modifier" : -10,
"damage_modifier" : 8,
"ammo_modifier" : "NULL",
"description" : "This is a complete conversion kit, designed to turn a rifle into a deadly sniper rifle. It decreases ammo capacity, and removes any automatic fire capabilities, but also increases accuracy and damage.",
"weight" : 2,
"to_hit" : -1,
"color" : "green",
"symbol" : ":",
"material" : ["steel", "null"],
"mod_targets" : ["rifle"],
"volume" : 1,
"bashing" : 0,
"cutting" : 0,
"burst_modifier" : -99,
"recoil_modifier" : 0,
"rarity" : 1,
"price" : 660,
"loudness_modifier" : 3
},
{
"type" : "GUNMOD",
"id" : "m203",
"name" : "M203",
"weight" : 1,
"color" : "light_red",
"burst_modifier" : 0,
"loudness_modifier" : 0,
"to_hit" : -1,
"dispersion_modifier" : 2,
"price" : 650,
"clip_size_modifier" : 1,
"description" : "The M203 was originally designed for use with M16 variants but today can be attached to almost any rifle. It allows a single 40mm grenade to be loaded and fired.",
"symbol" : ":",
"material" : ["steel", "null"],
"volume" : 2,
"cutting" : 0,
"recoil_modifier" : 0,
"damage_modifier" : 0,
"mod_targets" : ["rifle"],
"rarity" : 2,
"bashing" : 2,
"flags" : ["MODE_AUX"],
"ammo_modifier" : "40mm"
},
{
"type" : "GUNMOD",
"id" : "bayonet",
"name" : "bayonet",
"weight" : 2,
"color" : "light_cyan",
"burst_modifier" : 0,
"loudness_modifier" : 0,
"to_hit" : -3,
"dispersion_modifier" : 0,
"price" : 400,
"clip_size_modifier" : 0,
"description" : "A bayonet is a stabbing weapon that can be attached to the front of a shotgun, sub-machinegun or rifle, allowing a melee attack to deal piercing damage. The added length increases recoil slightly.",
"symbol" : ":",
"material" : ["steel", "null"],
"volume" : 2,
"cutting" : 16,
"recoil_modifier" : 3,
"damage_modifier" : 0,
"mod_targets" : ["shotgun", "smg", "rifle"],
"rarity" : 6,
"bashing" : 0,
"flags" : ["STAB"],
"ammo_modifier" : "NULL"
},
{
"type" : "GUNMOD",
"id" : "u_shotgun",
"name" : "underslung shotgun",
"weight" : 1,
"color" : "light_red",
"burst_modifier" : 0,
"loudness_modifier" : 0,
"to_hit" : -1,
"dispersion_modifier" : 2,
"price" : 650,
"clip_size_modifier" : 2,
"description" : "A miniaturized shotgun with 2 barrels, which can be mounted under the barrel of many rifles. It allows two shotgun shells to be loaded and fired.",
"symbol" : ":",
"material" : ["steel", "null"],
"volume" : 2,
"cutting" : 0,
"recoil_modifier" : 0,
"damage_modifier" : 0,
"mod_targets" : ["rifle"],
"rarity" : 2,
"bashing" : 2,
"flags" : ["MODE_AUX"],
"ammo_modifier" : "shot"
},
{
"type" : "GUNMOD",
"id" : "gun_crossbow",
"name" : "rail-mounted crossbow",
"weight" : 1,
"color" : "light_red",
"burst_modifier" : 0,
"loudness_modifier" : 0,
"to_hit" : -1,
"dispersion_modifier" : 0,
"price" : 500,
"clip_size_modifier" : 1,
"description" : "A kit to attach a pair of crossbow arms and a firing rail to the barrel of a long firearm. It allows crossbow bolts to be fired.",
"symbol" : ":",
"material" : ["steel", "wood"],
"volume" : 2,
"cutting" : 0,
"recoil_modifier" : 0,
"damage_modifier" : 0,
"mod_targets" : ["shotgun", "rifle"],
"rarity" : 2,
"bashing" : 2,
"flags" : ["MODE_AUX", "STR_RELOAD"],
"ammo_modifier" : "bolt"
}
]
+324 -273
View File
File diff suppressed because it is too large Load Diff
+754 -296
View File
File diff suppressed because it is too large Load Diff
+262
View File
@@ -0,0 +1,262 @@
[
{
"ident" : "null",
"name" : "Null",
"bash_resist" : 0,
"cut_resist" : 0,
"bash_dmg_verb" : "damaged",
"cut_dmg_verb" : "damaged",
"dmg_adj" : ["lightly damaged", "damaged", "very damaged", "thoroughly damaged"],
"acid_resist" : 0,
"elec_resist" : 0,
"fire_resist" : 0,
"density" : 1
},
{
"ident" : "veggy",
"name" : "Plant Matter",
"bash_resist" : 1,
"cut_resist" : 1,
"bash_dmg_verb" : "ripped",
"cut_dmg_verb" : "cut",
"dmg_adj" : ["lightly damaged", "damaged", "very damaged", "thoroughly damaged"],
"acid_resist" : 1,
"elec_resist" : 1,
"fire_resist" : 0,
"density" : 4
},
{
"ident" : "flesh",
"name" : "Flesh",
"bash_resist" : 1,
"cut_resist" : 1,
"bash_dmg_verb" : "bruised",
"cut_dmg_verb" : "sliced",
"dmg_adj" : ["bruised", "mutilated", "badly mutilated", "thoroughly mutilated"],
"acid_resist" : 1,
"elec_resist" : 1,
"fire_resist" : 0,
"density" : 5
},
{
"ident" : "powder",
"name" : "Powder",
"bash_resist" : 1,
"cut_resist" : 1,
"bash_dmg_verb" : "damaged",
"cut_dmg_verb" : "damaged",
"dmg_adj" : ["lightly damaged", "damaged", "very damaged", "thoroughly damaged"],
"acid_resist" : 0,
"elec_resist" : 2,
"fire_resist" : 0,
"density" : 1
},
{
"ident" : "hflesh",
"name" : "Human Flesh",
"bash_resist" : 1,
"cut_resist" : 1,
"bash_dmg_verb" : "bruised",
"cut_dmg_verb" : "sliced",
"dmg_adj" : ["bruised", "mutilated", "badly mutilated", "thoroughly mutilated"],
"acid_resist" : 1,
"elec_resist" : 1,
"fire_resist" : 0,
"density" : 5
},
{
"ident" : "cotton",
"name" : "Cotton",
"bash_resist" : 1,
"cut_resist" : 1,
"bash_dmg_verb" : "ripped",
"cut_dmg_verb" : "cut",
"dmg_adj" : ["ripped", "torn", "shredded", "tattered"],
"acid_resist" : 1,
"elec_resist" : 2,
"fire_resist" : 0,
"density" : 3
},
{
"ident" : "wool",
"name" : "Wool",
"bash_resist" : 1,
"cut_resist" : 1,
"bash_dmg_verb" : "torn",
"cut_dmg_verb" : "cut",
"dmg_adj" : ["ripped", "torn", "shredded", "tattered"],
"acid_resist" : 1,
"elec_resist" : 2,
"fire_resist" : 0,
"density" : 9
},
{
"ident" : "leather",
"name" : "Leather",
"bash_resist" : 2,
"cut_resist" : 2,
"bash_dmg_verb" : "ripped",
"cut_dmg_verb" : "sliced",
"dmg_adj" : ["scratched", "cut", "shredded", "tattered"],
"acid_resist" : 1,
"elec_resist" : 2,
"fire_resist" : 1,
"density" : 6
},
{
"ident" : "kevlar",
"name" : "Kevlar",
"bash_resist" : 2,
"cut_resist" : 4,
"bash_dmg_verb" : "ripped",
"cut_dmg_verb" : "cut",
"dmg_adj" : ["marked", "dented", "scarred", "broken"],
"acid_resist" : 2,
"elec_resist" : 2,
"fire_resist" : 1,
"density" : 10
},
{
"ident" : "fur",
"name" : "Fur",
"bash_resist" : 2,
"cut_resist" : 2,
"bash_dmg_verb" : "ripped",
"cut_dmg_verb" : "sliced",
"dmg_adj" : ["ripped", "torn", "shredded", "tattered"],
"acid_resist" : 1,
"elec_resist" : 2,
"fire_resist" : 0,
"density" : 9
},
{
"ident" : "chitin",
"name" : "Chitin",
"bash_resist" : 3,
"cut_resist" : 4,
"bash_dmg_verb" : "cracked",
"cut_dmg_verb" : "chipped",
"dmg_adj" : ["scratched", "cut", "cracked", "shattered"],
"acid_resist" : 1,
"elec_resist" : 2,
"fire_resist" : 2,
"density" : 10
},
{
"ident" : "bone",
"name" : "Bone",
"bash_resist" : 2,
"cut_resist" : 3,
"bash_dmg_verb" : "cracked",
"cut_dmg_verb" : "chipped",
"dmg_adj" : ["scratched", "cut", "cracked", "shattered"],
"acid_resist" : 1,
"elec_resist" : 2,
"fire_resist" : 4,
"density" : 7
},
{
"ident" : "stone",
"name" : "Stone",
"bash_resist" : 6,
"cut_resist" : 6,
"bash_dmg_verb" : "cracked",
"cut_dmg_verb" : "chipped",
"dmg_adj" : ["scratched", "cut", "cracked", "shattered"],
"acid_resist" : 3,
"elec_resist" : 2,
"fire_resist" : 2,
"density" : 17
},
{
"ident" : "paper",
"name" : "Paper",
"bash_resist" : 1,
"cut_resist" : 1,
"bash_dmg_verb" : "ripped",
"cut_dmg_verb" : "cut",
"dmg_adj" : ["ripped", "torn", "shredded", "tattered"],
"acid_resist" : 1,
"elec_resist" : 2,
"fire_resist" : 0,
"density" : 4
},
{
"ident" : "wood",
"name" : "Wood",
"bash_resist" : 3,
"cut_resist" : 2,
"bash_dmg_verb" : "splintered",
"cut_dmg_verb" : "gouged",
"dmg_adj" : ["scratched", "chipped", "cracked", "splintered"],
"acid_resist" : 2,
"elec_resist" : 2,
"fire_resist" : 0,
"density" : 4
},
{
"ident" : "plastic",
"name" : "Plastic",
"bash_resist" : 2,
"cut_resist" : 2,
"bash_dmg_verb" : "dented",
"cut_dmg_verb" : "gouged",
"dmg_adj" : ["scratched", "cut", "cracked", "shattered"],
"acid_resist" : 2,
"elec_resist" : 2,
"fire_resist" : 0,
"density" : 8
},
{
"ident" : "glass",
"name" : "Glass",
"bash_resist" : 3,
"cut_resist" : 4,
"bash_dmg_verb" : "cracked",
"cut_dmg_verb" : "scratched",
"dmg_adj" : ["scratched", "cut", "cracked", "shattered"],
"acid_resist" : 3,
"elec_resist" : 2,
"fire_resist" : 2,
"density" : 14
},
{
"ident" : "iron",
"name" : "Iron",
"bash_resist" : 4,
"cut_resist" : 4,
"bash_dmg_verb" : "dented",
"cut_dmg_verb" : "scratched",
"dmg_adj" : ["marked", "dented", "smashed", "shattered"],
"acid_resist" : 0,
"elec_resist" : 0,
"fire_resist" : 2,
"density" : 52
},
{
"ident" : "steel",
"name" : "Steel",
"bash_resist" : 6,
"cut_resist" : 6,
"bash_dmg_verb" : "dented",
"cut_dmg_verb" : "scratched",
"dmg_adj" : ["marked", "dented", "smashed", "shattered"],
"acid_resist" : 0,
"elec_resist" : 0,
"fire_resist" : 2,
"density" : 52
},
{
"ident" : "silver",
"name" : "Silver",
"bash_resist" : 2,
"cut_resist" : 3,
"bash_dmg_verb" : "dented",
"cut_dmg_verb" : "scratched",
"dmg_adj" : ["marked", "dented", "smashed", "shattered"],
"acid_resist" : 2,
"elec_resist" : 0,
"fire_resist" : 2,
"density" : 70
}
]
+4 -2
View File
@@ -66,7 +66,8 @@
"monsters" : [
{ "monster" : "mon_triffid_young", "freq" : 300, "multiplier" : 0 },
{ "monster" : "mon_vinebeast", "freq" : 160, "multiplier" : 10 },
{ "monster" : "mon_triffid_queen", "freq" : 60, "multiplier" : 0 }
{ "monster" : "mon_triffid_queen", "freq" : 60, "multiplier" : 0 },
{ "monster" : "mon_triffid_heart", "freq" : 0, "multiplier" : 0 }
]
},
{
@@ -78,7 +79,8 @@
{ "monster" : "mon_zombie_fungus", "freq" : 300, "multiplier" : 0 },
{ "monster" : "mon_boomer_fungus", "freq" : 30, "multiplier" : 0 },
{ "monster" : "mon_spore", "freq" : 0, "multiplier" : 0 },
{ "monster" : "mon_fungal_wall", "freq" : 0, "multiplier" : 0 }
{ "monster" : "mon_fungal_wall", "freq" : 0, "multiplier" : 0 },
{ "monster" : "mon_fungaloid_queen", "freq" : 0, "multiplier" : 0 }
]
},
+15 -10
View File
@@ -3,7 +3,7 @@
"ident": "unemployed",
"name": "Unemployed",
"description":
"They say you don't have any 'useful skills', but at least your clothes fit\nwell.",
"They say you don't have any 'useful skills', but at least your clothes fit well.",
"points": 0,
"items": ["jeans", "tshirt", "sneakers"]
},
@@ -12,7 +12,7 @@
"ident": "tailor",
"name": "Tailor",
"description":
"You've made and adjusted clothing for some of the biggest names in town.\nNow, their undead bodies are trying to eat your brains. At least you'll be\nable to keep your own clothing repaired.",
"You've made and adjusted clothing for some of the biggest names in town. Now, their undead bodies are trying to eat your brains. At least you'll be able to keep your own clothing repaired.",
"points": 1,
"items": ["polo_shirt", "blazer", "pants", "dress_shoes", "sewing_kit", "scissors", "manual_tailor"]
},
@@ -21,7 +21,7 @@
"ident": "labtech",
"name": "Lab Technician",
"description":
"It was your first day in the lab when the cataclysm hit. You were evacuated\nwith all the civilians, but at least you kept your lab gear.",
"It was your first day in the lab when the cataclysm hit. You were evacuated with all the civilians, but at least you kept your lab gear.",
"points": 1,
"items": ["dress_shirt", "pants", "boots", "coat_lab", "gloves_rubber", "glasses_safety"]
},
@@ -30,7 +30,7 @@
"ident": "mechanic",
"name": "Wannabe Mechanic",
"description":
"Although you never got your driver's license, you've always loved cars.\nYou start with a wrench, a toolbelt, and some car-related reading material.",
"Although you never got your driver's license, you've always loved cars. You start with a wrench, a toolbelt, and some car-related reading material.",
"points": 2,
"items": ["tank_top", "jeans", "boots", "beltrig", "wrench", "mag_cars", "manual_mechanics"]
},
@@ -39,22 +39,27 @@
"ident": "scoundrel",
"name": "Scoundrel",
"description":
"Your flexible outlook on law has ensured your survival, but now what?\nYou start with cargo pants, a hoodie, and \"sundries\".",
"Your flexible outlook on law has ensured your survival, but now what? You start with cargo pants, a hoodie, \"sundries\", and one additional level of melee.",
"points": 2,
"items": ["tank_top", "hoodie", "pants_cargo", "sneakers", "weed", "picklocks"]
"items": ["tank_top", "hoodie", "pants_cargo", "sneakers", "weed", "picklocks"],
"skills" : [
{
"name" : "melee",
"level" : 1
}
]
},
{
"ident": "smoker",
"name": "Chain Smoker",
"description":
"Everyone at work knew you as the person who always had a cigarette or two\nin hand. Now, you're down to a single pack, and you hope you find more soon.\nYou start out with a strong nicotine addiction, and 10 cigarettes.",
"description": "Everyone at work knew you as the person who always had a cigarette or two in hand. now, you're down to a single pack, and you hope you find more soon. You start out with a strong nicotine addiction, and 10 cigarettes.",
"points": -1,
"items": ["pants", "dress_shirt", "dress_shoes", "cig"],
"addictions": [
{
"type": "nicotine",
"intensity": 10
"type": "nicotine",
"intensity": 10
}
]
}
+2794 -112
View File
File diff suppressed because it is too large Load Diff
+54 -27
View File
@@ -2,136 +2,163 @@
[
"dodge",
"dodge",
"Your skill at dodging, whether it be from an attack, a trap, or a natural\noccurrence. It is also used when attempting to fall gracefully, or in other\nacrobatic feats."
"Your skill at dodging, whether it be from an attack, a trap, or a natural occurrence. It is also used when attempting to fall gracefully, or in other acrobatic feats.",
[]
],
[
"melee",
"melee",
"Your skill at hand-to-hand combat, both with and without a weapon. At low\nlevels this merely increases your chance to hit, but at higher levels it also\nincreases the damage done significantly."
"Your skill at hand-to-hand combat, both with and without a weapon. At low levels this merely increases your chance to hit, but at higher levels it also increases the damage done significantly.",
[]
],
[
"unarmed",
"unarmed combat",
"Your skill at combat without a weapon. While at low levels, unarmed combat is\na good way to die quickly, those skilled in it can eventually use throws and\ncrushing blows to quickly dispatch enemies."
"Your skill at combat without a weapon. While at low levels, unarmed combat is a good way to die quickly, those skilled in it can eventually use throws and crushing blows to quickly dispatch enemies.",
[]
],
[
"bashing",
"bashing weapons",
"Your skill at combat with weapons that club or bash your enemies. This\nincludes everything from rocks to baseball bats, and even the butt of rifles.\nThis increases damage, and at higher levels will improve your chance to hit."
"Your skill at combat with weapons that club or bash your enemies. This includes everything from rocks to baseball bats, and even the butt of rifles. This increases damage, and at higher levels will improve your chance to hit.",
[]
],
[
"cutting",
"cutting weapons",
"Your skill at combat with weapons that cut or slice your enemies. At first\nthis will simply slightly increase accuracy and damage; later on it will\nhelp you bypass armor and thick hides."
"Your skill at combat with weapons that cut or slice your enemies. At first this will simply slightly increase accuracy and damage; later on it will help you bypass armor and thick hides.",
[]
],
[
"stabbing",
"piercing weapons",
"Your skill at combat that involves piercing weapons. This includes spears,\nwhich only have a stabbing attack, and things like knives, which can cut or\npierce. This increases your accuracy and chance of a deadly critical."
"Your skill at combat that involves piercing weapons. This includes spears, which only have a stabbing attack, and things like knives, which can cut or pierce. This increases your accuracy and chance of a deadly critical.",
[]
],
[
"throw",
"throwing",
"Your skill at throwing items and getting them to go where you want. Increases\nboth accuracy and, at higher levels, range."
"Your skill at throwing items and getting them to go where you want. Increases both accuracy and, at higher levels, range.",
[]
],
[
"gun",
"firearms",
"Your general skill at firearms. This increases your accuracy with any gun,\nbut not as much as the skill associated with the gun in question."
"Your general skill at firearms. This increases your accuracy with any gun, but not as much as the skill associated with the gun in question.",
[]
],
[
"pistol",
"handguns",
"Your skill with handguns. These have poor accuracy, but generally are fired\nand reloaded faster than other guns, and are good in close quarters."
"Your skill with handguns. These have poor accuracy, but generally are fired and reloaded faster than other guns, and are good in close quarters.",
["gun_type"]
],
[
"shotgun",
"shotguns",
"Your skill with shotguns. Shot is easy to hit with, and does massive damage,\nbut has short range. Shotguns may also be loaded with slugs, which go further\nand do as much damage, but are not very accurate."
"Your skill with shotguns. Shot is easy to hit with, and does massive damage, but has short range. Shotguns may also be loaded with slugs, which go further and do as much damage, but are not very accurate.",
["gun_type"]
],
[
"smg",
"submachine guns",
"Your skill with submachine guns and machine pistols. Halfway between a pistol\nand an assault rifle, these weapons fire and reload quickly, and may fire in\nbursts, but they are not very accurate."
"Your skill with submachine guns and machine pistols. Halfway between a pistol and an assault rifle, these weapons fire and reload quickly, and may fire in bursts, but they are not very accurate.",
["gun_type"]
],
[
"rifle",
"rifles",
"Your skill with rifles, both assault rifles and semi-auto hunting rifles.\nThese have terrific range and accuracy, but are very slow to fire and reload,\nand are not very good in close quarters."
"Your skill with rifles, both assault rifles and semi-auto hunting rifles. These have terrific range and accuracy, but are very slow to fire and reload, and are not very good in close quarters.",
["gun_type"]
],
[
"archery",
"archery",
"Your skill with all kinds of bows, from crossbows to handmade long bows.\nThese are quiet, but require some amount of strength to use, and are not\nterribly accurate. They can only be deadly in skilled hands."
"Your skill with all kinds of bows, from crossbows to handmade long bows. These are quiet, but require some amount of strength to use, and are not terribly accurate. They can only be deadly in skilled hands.",
[]
],
[
"launcher",
"grenade launcher",
"Your skill with grenade launchers, whether standalone or as a rifle mod.\nThese launchers fire a variety of 40mm grenades with different uses,\nbut they and their rounds are hard to find."
"Your skill with grenade launchers, whether standalone or as a rifle mod. These launchers fire a variety of 40mm grenades with different uses, but they and their rounds are hard to find.",
[]
],
[
"computer",
"computers",
"Your skill with computers, both in terms of legitimate use, and hacking. This\nwill help you use complex systems, and bypass their security."
"Your skill with computers, both in terms of legitimate use, and hacking. This will help you use complex systems, and bypass their security.",
[]
],
[
"mechanics",
"mechanics",
"Your skill with repairs to mechanical systems, and the crafting of many items\nthat use complex parts, but are not electronics."
"Your skill with repairs to mechanical systems, and the crafting of many items that use complex parts, but are not electronics.",
[]
],
[
"electronics",
"electronics",
"Your skill with repairs to electrical systems, and the crafting of many items\nthat use electrical parts."
"Your skill with repairs to electrical systems, and the crafting of many items that use electrical parts.",
[]
],
[
"cooking",
"cooking",
"Your skill in combining food ingredients to make other, tastier food items.\nThis may also be used in mixing chemicals and other more esoteric tasks."
"Your skill in combining food ingredients to make other, tastier food items. This may also be used in mixing chemicals and other more esoteric tasks.",
[]
],
[
"carpentry",
"construction",
"Your general knowledge in construction. This is used primarily when building\nterrain, via the * screen."
"Your general knowledge in construction. This is used primarily when building terrain, via the * screen.",
[]
],
[
"survival",
"survival",
"Your skill in wilderness survival. This helps you butcher meat from a corpse\nand craft various basic survival items. High levels may allow you to remove\npoison from tainted meat. Also used for skinning corpses to acquire pelts."
"Your skill in wilderness survival. This helps you butcher meat from a corpse and craft various basic survival items. Also used for skinning corpses to acquire pelts.",
[]
],
[
"traps",
"traps",
"Your skill at setting and disarming traps safely and effectively. Note that\nthis does not help you detect traps, or avoid their effects if you activate\nthem."
"Your skill at setting and disarming traps safely and effectively. Note that this does not help you detect traps, or avoid their effects if you activate them.",
[]
],
[
"tailor",
"tailoring",
"Your skill at repairing clothing, and at higher levels, creating clothing\nfrom basic materials. Generally a sewing kit is needed. Also applies to\nother methods of clothing repair and textile crafting."
"Your skill at repairing clothing, and at higher levels, creating clothing from basic materials. Generally a sewing kit is needed. Also applies to other methods of clothing repair and textile crafting.",
[]
],
[
"firstaid",
"first aid",
"Your skill at emergency medical treatment, such as that from first aid kits\nand bandages. High levels of this skill may help heal more HP. Some drugs\nmay be more effective as well."
"Your skill at emergency medical treatment, such as that from first aid kits and bandages. High levels of this skill may help heal more HP. Some drugs may be more effective as well.",
[]
],
[
"speech",
"speech",
"Your skill at talking to people, convincing them of things, lying, and many\nothers. Works best in conjunction with a high intelligence."
"Your skill at talking to people, convincing them of things, lying, and many others. Works best in conjunction with a high intelligence.",
[]
],
[
"barter",
"barter",
"Your skill at getting a good deal when trading with others. Very high levels\nmight even see you getting freebies."
"Your skill at getting a good deal when trading with others. Very high levels might even see you getting freebies.",
[]
],
[
"swimming",
"swimming",
"Your skill at swimming. This affects speed, your ability to swim while\nwearing clothes or carrying weights, and in-water combat."
"Your skill at swimming. This affects speed, your ability to swim while wearing clothes or carrying weights, and in-water combat.",
[]
],
[
"driving",
"driving",
"Your skill at driving. This affects how well you can control a vehicle,\nas well as the penalty of shooting while driving."
"Your skill at driving. This affects how well you can control a vehicle, as well as the penalty of shooting while driving.",
[]
]
]
+5
View File
@@ -94,6 +94,11 @@ struct DebugLog
fout << t;
return *this;
}
template <class T>
DebugLog& operator<<(const T& t){
fout << t;
return *this;
}
private:
std::ofstream fout;
+18 -18
View File
@@ -111,7 +111,7 @@ void defense_game::pre_action(game *g, action_id &act)
g->add_msg("You don't need to sleep!");
act = ACTION_NULL;
}
if (act == ACTION_SAVE) {
if (act == ACTION_SAVE || act == ACTION_QUICKSAVE) {
g->add_msg("You cannot save in defense mode!");
act = ACTION_NULL;
}
@@ -257,7 +257,7 @@ void defense_game::init_map(game *g)
// Round down to the nearest even number
mx -= mx % 2;
my -= my % 2;
tinymap tm(&g->itypes, &g->mapitems, &g->traps);
tinymap tm(&g->traps);
tm.generate(g, g->cur_om, mx, my, 0, int(g->turn));
tm.clear_spawns();
tm.clear_traps();
@@ -440,7 +440,7 @@ void defense_game::init_to_style(defense_style new_style)
void defense_game::setup()
{
WINDOW* w = newwin(25, 80, 0, 0);
WINDOW* w = newwin(FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH, 0, 0);
int selection = 1;
refresh_setup(w, selection);
@@ -801,7 +801,7 @@ void defense_game::caravan(game *g)
int total_price = 0;
WINDOW *w = newwin(25, 80, 0, 0);
WINDOW *w = newwin(FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH, 0, 0);
int offset = 0, item_selected = 0, category_selected = 0;
@@ -1117,25 +1117,25 @@ void draw_caravan_borders(WINDOW *w, int current_window)
mvwputch(w, i, 39, col, LINE_XOXO);
}
for (int i = 1; i <= 38; i++)
mvwputch(w, 24, i, c_ltgray, LINE_OXOX);
mvwputch(w, FULL_SCREEN_HEIGHT-1, i, c_ltgray, LINE_OXOX);
mvwputch(w, 24, 0, c_ltgray, LINE_XXOO);
mvwputch(w, 24, 39, c_ltgray, LINE_XXOX);
mvwputch(w, FULL_SCREEN_HEIGHT-1, 0, c_ltgray, LINE_XXOO);
mvwputch(w, FULL_SCREEN_HEIGHT-1, 39, c_ltgray, LINE_XXOX);
// Finally, draw the item section borders
for (int i = 40; i <= 78; i++) {
for (int i = 40; i <= FULL_SCREEN_WIDTH-2; i++) {
mvwputch(w, 0, i, col, LINE_OXOX);
mvwputch(w, 24, i, col, LINE_OXOX);
mvwputch(w, FULL_SCREEN_HEIGHT-1, i, col, LINE_OXOX);
}
for (int i = 1; i <= 23; i++)
mvwputch(w, i, 79, col, LINE_XOXO);
for (int i = 1; i <= FULL_SCREEN_HEIGHT-2; i++)
mvwputch(w, i, FULL_SCREEN_WIDTH-1, col, LINE_XOXO);
mvwputch(w, 24, 39, col, LINE_XXOX);
mvwputch(w, 0, 79, col, LINE_OOXX);
mvwputch(w, 24, 79, col, LINE_XOOX);
mvwputch(w, FULL_SCREEN_HEIGHT-1, 39, col, LINE_XXOX);
mvwputch(w, 0, FULL_SCREEN_WIDTH-1, col, LINE_OOXX);
mvwputch(w, FULL_SCREEN_HEIGHT-1, FULL_SCREEN_WIDTH-1, col, LINE_XOOX);
// Quick reminded about help.
mvwprintz(w, 24, 2, c_red, "Press ? for help.");
mvwprintz(w, FULL_SCREEN_HEIGHT-1, 2, c_red, "Press ? for help.");
wrefresh(w);
}
@@ -1165,7 +1165,7 @@ void draw_caravan_items(WINDOW *w, game *g, std::vector<itype_id> *items,
// will corrupt the item list.
// Actually, clear the item info first.
for (int i = 12; i <= 23; i++)
for (int i = 12; i <= FULL_SCREEN_HEIGHT-2; i++)
mvwprintz(w, i, 1, c_black, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
// THEN print it--if item_selected is valid
if (item_selected < items->size()) {
@@ -1173,10 +1173,10 @@ void draw_caravan_items(WINDOW *w, game *g, std::vector<itype_id> *items,
mvwprintz(w, 12, 0, c_white, tmp.info().c_str());
}
// Next, clear the item list on the right
for (int i = 1; i <= 23; i++)
for (int i = 1; i <= FULL_SCREEN_HEIGHT-2; i++)
mvwprintz(w, i, 40, c_black, "xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx");
// Finally, print the item list on the right
for (int i = offset; i <= offset + 23 && i < items->size(); i++) {
for (int i = offset; i <= offset + FULL_SCREEN_HEIGHT-2 && i < items->size(); i++) {
mvwprintz(w, i - offset + 1, 40, (item_selected == i ? h_white : c_white),
g->itypes[ (*items)[i] ]->name.c_str());
wprintz(w, c_white, " x %s%d", ((*counts)[i] >= 10 ? "" : " "), (*counts)[i]);
+3
View File
@@ -89,6 +89,7 @@ struct talk_response
int mission_index;
mission_id miss; // If it generates a new mission
int tempvalue; // Used for various stuff
Skill* skill;
npc_opinion opinion_success;
npc_opinion opinion_failure;
void (talk_function::*effect_success)(game *, npc *);
@@ -104,6 +105,7 @@ struct talk_response
mission_index = -1;
miss = MISSION_NULL;
tempvalue = -1;
skill = NULL;
effect_success = &talk_function::nothing;
effect_failure = &talk_function::nothing;
opinion_success = npc_opinion();
@@ -120,6 +122,7 @@ struct talk_response
mission_index = rhs.mission_index;
miss = rhs.miss;
tempvalue = rhs.tempvalue;
skill = rhs.skill;
effect_success = rhs.effect_success;
effect_failure = rhs.effect_failure;
opinion_success = rhs.opinion_success;
+1048 -714
View File
File diff suppressed because it is too large Load Diff
+2
View File
@@ -20,4 +20,6 @@ std::string dis_name(disease dis);
std::string dis_description(disease dis);
dis_type disease_for_body_part(dis_type base, int body_part);
#endif
+11 -10
View File
@@ -5,20 +5,21 @@
#define sgn(x) (((x) < 0) ? -1 : 1)
#endif
enum material {
MNULL = 0,
//Food Materials
VEGGY, FLESH, POWDER, HFLESH, //Human Flesh.
//Clothing
COTTON, WOOL, LEATHER, KEVLAR, FUR,
//Other
STONE, PAPER, WOOD, PLASTIC, GLASS, IRON, STEEL, SILVER
};
enum phase_id {
PNULL, SOLID, LIQUID, GAS, PLASMA
};
enum damage_type
{
DNULL = 0,
BASH,
CUT,
ACID,
ELECTRICITY,
FIRE,
NUM_DAM_TYPES
};
struct point {
int x;
int y;
+1111 -723
View File
File diff suppressed because it is too large Load Diff
+340
View File
@@ -0,0 +1,340 @@
#ifndef _FIELD_H_
#define _FIELD_H_
#include <vector>
#include <string>
#include "color.h"
#include "item.h"
#include "trap.h"
#include "monster.h"
#include "enums.h"
#include "computer.h"
#include "vehicle.h"
#include "graffiti.h"
#include "basecamp.h"
#include "iexamine.h"
#include <iosfwd>
/*
struct field_t
Used to store the master field effects list metadata. Not used to store a field, just queried to find out specifics
of an existing field.
*/
struct field_t {
std::string name[3]; //The display name of the given density (ie: light smoke, smoke, heavy smoke)
char sym; //The symbol to draw for this field. Note that some are reserved like * and %. You will have to check the draw function for specifics.
nc_color color[3]; //The color the field will be drawn as on the screen, by density.
/*
If true, does not invoke a check to block line of sight. If false, may block line of sight.
Note that this does nothing by itself. You must go to the code block in lightmap.cpp and modify
transparancy code there with a case statement as well!
*/
bool transparent[3];
//Dangerous tiles ask you before you step in them.
bool dangerous[3];
//Controls, albeit randomly, how long a field of a given type will last before going down in density.
int halflife; // In turns
//cost of moving into and out of this field
int move_cost[3];
};
//The master list of id's for a field, corresponding to the fieldlist array.
enum field_id {
fd_null = 0,
fd_blood,
fd_bile,
fd_gibs_flesh,
fd_gibs_veggy,
fd_web,
fd_slime,
fd_acid,
fd_sap,
fd_sludge,
fd_fire,
fd_rubble,
fd_smoke,
fd_toxic_gas,
fd_tear_gas,
fd_nuke_gas,
fd_gas_vent,
fd_fire_vent,
fd_flame_burst,
fd_electricity,
fd_fatigue,
fd_push_items,
fd_shock_vent,
fd_acid_vent,
num_fields
};
/*
Controls the master listing of all possible field effects, indexed by a field_id. Does not store active fields, just metadata.
*/
const field_t fieldlist[] = {
{
{"", "", ""}, '%',
{c_white, c_white, c_white}, {true, true, true}, {false, false, false}, 0,
{0,0,0}
},
{
{"blood splatter", "blood stain", "puddle of blood"}, '%',
{c_red, c_red, c_red}, {true, true, true}, {false, false, false}, 2500,
{0,0,0}
},
{
{"bile splatter", "bile stain", "puddle of bile"}, '%',
{c_pink, c_pink, c_pink}, {true, true, true}, {false, false, false},2500,
{0,0,0}
},
{
{"scraps of flesh", "bloody meat chunks", "heap of gore"}, '~',
{c_brown, c_ltred, c_red}, {true, true, true}, {false, false, false}, 2500,
{0,0,0}
},
{
{"shredded leaves and twigs", "shattered branches and leaves", "broken vegetation tangle"}, '~',
{c_ltgreen, c_ltgreen, c_green}, {true, true, true}, {false, false, false}, 2500,
{0,0,0}
},
{
{"cobwebs","webs", "thick webs"}, '}',
{c_white, c_white, c_white}, {true, true, false},{false, false, false}, 0,
{0,0,0}
},
{
{"slime trail", "slime stain", "puddle of slime"}, '%',
{c_ltgreen, c_ltgreen, c_green},{true, true, true},{false, false, false},2500,
{0,0,0}
},
{
{"acid splatter", "acid streak", "pool of acid"}, '5',
{c_ltgreen, c_green, c_green}, {true, true, true}, {true, true, true}, 10,
{0,0,0}
},
{
{"sap splatter", "glob of sap", "pool of sap"}, '5',
{c_yellow, c_brown, c_brown}, {true, true, true}, {true, true, true}, 20,
{0,0,0}
},
{
{"thin sludge trail", "sludge trail", "thick sludge trail"}, '5',
{c_ltgray, c_dkgray, c_black}, {true, true, true}, {false, false, false}, 900,
{0,0,0}
},
{
{"small fire", "fire", "raging fire"}, '4',
{c_yellow, c_ltred, c_red}, {true, true, true}, {true, true, true}, 800,
{0,0,0}
},
{
{"rubble heap", "rubble pile", "mountain of rubble"}, '#',
{c_dkgray, c_dkgray, c_dkgray}, {true, true, false},{false, false, false}, 0,
{0,0,0}
},
{
{"thin smoke", "smoke", "thick smoke"}, '8',
{c_white, c_ltgray, c_dkgray}, {true, false, false},{false, true, true}, 300,
{0,0,0}
},
{
{"hazy cloud","toxic gas","thick toxic gas"}, '8',
{c_white, c_ltgreen, c_green}, {true, false, false},{false, true, true}, 900,
{0,0,0}
},
{
{"hazy cloud","tear gas","thick tear gas"}, '8',
{c_white, c_yellow, c_brown}, {true, false, false},{true, true, true}, 600,
{0,0,0}
},
{
{"hazy cloud","radioactive gas", "thick radioactive gas"}, '8',
{c_white, c_ltgreen, c_green}, {true, true, false}, {true, true, true}, 1000,
{0,0,0}
},
{
{"gas vent", "gas vent", "gas vent"}, '%',
{c_white, c_white, c_white}, {true, true, true}, {false, false, false}, 0,
{0,0,0}
},
{ // Fire Vents
{"", "", ""}, '&',
{c_white, c_white, c_white}, {true, true, true}, {false, false, false}, 0,
{0,0,0}
},
{
{"fire", "fire", "fire"}, '5',
{c_red, c_red, c_red}, {true, true, true}, {true, true, true}, 0,
{0,0,0}
},
{
{"sparks", "electric crackle", "electric cloud"}, '9',
{c_white, c_cyan, c_blue}, {true, true, true}, {true, true, true}, 2,
{0,0,0}
},
{
{"odd ripple", "swirling air", "tear in reality"}, '*',
{c_ltgray, c_dkgray, c_magenta},{true, true, false},{false, false, false}, 0,
{0,0,0}
},
{ //Push Items
{"", "", ""}, '&',
{c_white, c_white, c_white}, {true, true, true}, {false, false, false}, 0,
{0,0,0}
},
{ // shock vents
{"", "", ""}, '&',
{c_white, c_white, c_white}, {true, true, true}, {false, false, false}, 0,
{0,0,0}
},
{ // acid vents
{"", "", ""}, '&',
{c_white, c_white, c_white}, {true, true, true}, {false, false, false}, 0,
{0,0,0}
}
};
/*
Class: field_entry
An active or passive effect existing on a tile. Multiple different types can exist on one tile
but there can be only one of each type (IE: one fire, one smoke cloud, etc). Each effect
can vary in intensity (density) and age (usually used as a time to live).
*/
class field_entry {
public:
field_entry() {
type = fd_null;
density = 1;
age = 0;
is_alive = false;
};
field_entry(field_id t, unsigned char d, unsigned int a) {
type = t;
density = d;
age = a;
is_alive = true;
}
//returns the move cost of this field
int move_cost() const;
//Returns the field_id of the current field entry.
field_id getFieldType() const;
//Returns the current density (aka intensity) of the current field entry.
signed char getFieldDensity() const;
//Returns the age (usually turns to live) of the current field entry.
int getFieldAge() const;
//Allows you to modify the field_id of the current field entry.
field_id setFieldType(const field_id new_field_id);
//Allows you to modify the density of the current field entry.
signed char setFieldDensity(const signed char new_density);
//Allows you to modify the age of the current field entry.
int setFieldAge(const int new_age);
//Get the move cost for this field
int getFieldMoveCost();
//Returns if the current field is dangerous or not.
bool is_dangerous() const
{
return fieldlist[type].dangerous[density - 1];
}
//Returns the display name of the current field given its current density.
//IE: light smoke, smoke, heavy smoke
std::string name() const
{
return fieldlist[type].name[density - 1];
}
//Returns true if this is an active field, false if it should be removed.
bool isAlive(){
return is_alive;
}
private:
field_id type; //The field identifier.
signed char density; //The density, or intensity (higher is stronger), of the field entry.
int age; //The age, or time to live, of the field effect. 0 is permanent.
bool is_alive; //True if this is an active field, false if it should be destroyed next check.
};
//Represents a variable sized collection of field entries on a given map square.
class field{
public:
//Field constructor
field();
//Frees all memory assigned to the field's field_entry vector and general cleanup.
~field();
//Returns a field entry corresponding to the field_id parameter passed in.
//If no fields are found then a field_entry with type fd_null is returned.
field_entry* findField(const field_id field_to_find);
const field_entry* findFieldc(const field_id field_to_find); //for when you want a const field_entry.
//Inserts the given field_id into the field list for a given tile if it does not already exist.
//Returns false if the field_id already exists, true otherwise.
//If you wish to modify an already existing field use findField and modify the result.
//Density defaults to 1, and age to 0 (permanent) if not specified.
bool addField(const field_id field_to_add,const unsigned char new_density=1, const int new_age=0);
//Removes the field entry with a type equal to the field_id parameter. Returns true if removed, false otherwise.
bool removeField(const field_id field_to_remove);
//Returns the number of fields existing on the current tile.
unsigned int fieldCount() const;
//Returns the last added field from the tile for drawing purposes.
//This can be changed to return whatever you think the most important field to draw is.
field_id fieldSymbol() const;
//Returns the vector iterator to begin searching through the list.
//Note: If you are using "field_at" function, set the return to a temporary field variable! If you somehow
//query an out of bounds field location it returns a different field every inquery. This means that
//the start and end iterators won't match up and will crash the system.
std::vector<field_entry*>::iterator getFieldStart();
//Returns the vector iterator to end searching through the list.
std::vector<field_entry*>::iterator getFieldEnd();
//Returns the total move cost from all fields
int move_cost() const;
private:
std::vector<field_entry*> field_list; //A listing of all field effects on the current tile.
//Draw_symbol currently is equal to the last field added to the square. You can modify this behavior in the class functions if you wish.
field_id draw_symbol;
bool dirty; //true if this is a copy of the class, false otherwise.
};
#endif
+3774 -1765
View File
File diff suppressed because it is too large Load Diff
+63 -19
View File
@@ -23,6 +23,7 @@
#include "mutation.h"
#include "gamemode.h"
#include "action.h"
#include "translations.h"
#include <vector>
#include <map>
#include <list>
@@ -47,8 +48,16 @@
#define BULLET_SPEED 10000000
#define EXPLOSION_SPEED 70000000
#define PICKUP_RANGE 2
#define MAX_ITEM_IN_SQUARE 1024 // really just a sanity check for functions not tested beyond this. in theory 4096 works (`InvletInvlet)
#define MAX_VOLUME_IN_SQUARE 1000 // 6.25 dead bears is enough for everybody!
#define MAX_ITEM_IN_VEHICLE_STORAGE MAX_ITEM_IN_SQUARE // no reason to differ
#define MAX_VOLUME_IN_VEHICLE_STORAGE 500 // todo: variation. semi trailer square could hold more. the real limit would be weight
// The reference to the one and only game instance.
extern game *g;
#define PICKUP_RANGE 2
extern bool trigdist;
enum tut_type {
TUT_NULL,
TUT_BASIC, TUT_COMBAT,
@@ -113,6 +122,12 @@ class game
void vadd_msg(const char* msg, va_list ap );
void add_msg(const char* msg, ...);
void add_msg_if_player(player *p, const char* msg, ...);
std::string press_x(action_id act); // (Press X (or Y)|Try) to Z
std::string press_x(action_id act, std::string key_bound,
std::string key_unbound);
std::string press_x(action_id act, std::string key_bound_pre,
std::string key_bound_suf, std::string key_unbound);
std::string press_x(action_id act, std::string act_desc); // ('Z'ing|zing) (X( or Y)))
void add_event(event_type type, int on_turn, int faction_id = -1,
int x = -1, int y = -1);
bool event_queued(event_type type);
@@ -127,7 +142,7 @@ class game
// Explosion at (x, y) of intensity (power), with (shrapnel) chunks of shrapnel
void explosion(int x, int y, int power, int shrapnel, bool fire);
// Flashback at (x, y)
void flashbang(int x, int y);
void flashbang(int x, int y, bool player_immune = false);
// Move the player vertically, if (force) then they fell
void vertical_move(int z, bool force);
void use_computer(int x, int y);
@@ -145,8 +160,10 @@ class game
// Kill that monster; fixes any pointers etc
void kill_mon(int index, bool player_did_it = false);
void explode_mon(int index); // Explode a monster; like kill_mon but messier
void revive_corpse(int x, int y, int n); // revives a corpse from an item pile
void revive_corpse(int x, int y, item *it); // revives a corpse by item pointer, caller handles item deletion
// hit_monster_with_flags processes ammo flags (e.g. incendiary, etc)
void hit_monster_with_flags(monster &z, unsigned int flags);
void hit_monster_with_flags(monster &z, const std::set<std::string> &effects);
void plfire(bool burst); // Player fires a gun (target selection)...
// ... a gun is fired, maybe by an NPC (actual damage, etc.).
void fire(player &p, int tarx, int tary, std::vector<point> &trajectory,
@@ -155,6 +172,11 @@ class game
std::vector<point> &trajectory);
void cancel_activity();
void cancel_activity_query(const char* message, ...);
bool cancel_activity_or_ignore_query(const char* reason, ...);
void moving_vehicle_dismount(int tox, int toy);
// Get input from the player to choose an adjacent tile (for examine() etc)
bool choose_adjacent(std::string verb, int &x, int&y);
int assign_mission_id(); // Just returns the next available one
void give_mission(mission_id type); // Create the mission and assign it
void assign_mission(int id); // Just assign an existing mission
@@ -165,6 +187,7 @@ class game
int reserve_random_mission(mission_origin origin, point p = point(-1, -1),
int npc_id = -1);
npc* find_npc(int id);
int kill_count(mon_id mon); // Return the number of kills of a given mon_id
mission* find_mission(int id); // Mission with UID=id; NULL if non-existant
mission_type* find_mission_type(int id); // Same, but returns its type
bool mission_complete(int id, int npc_id); // True if we made it
@@ -177,7 +200,7 @@ class game
void teleport(player *p = NULL);
void plswim(int x, int y); // Called by plmove. Handles swimming
// when player is thrown (by impact or something)
void fling_player_or_monster(player *p, monster *zz, int dir, int flvel);
void fling_player_or_monster(player *p, monster *zz, const int& dir, float flvel, bool controlled = false);
void nuke(int x, int y);
std::vector<faction *> factions_at(int x, int y);
@@ -206,6 +229,7 @@ class game
void add_artifact_messages(std::vector<art_effect_passive> effects);
void peek();
point look_debug(point pnt=point(-256,-256));
point look_around();// Look at nearby terrain ';'
void list_items(); //List all items around the player
bool list_items_match(std::string sText, std::string sPattern);
@@ -219,16 +243,17 @@ class game
std::string sFilter; // this is a member so that it's remembered over time
std::string list_item_upvote;
std::string list_item_downvote;
char inv(std::string title = "Inventory:");
char inv_type(std::string title = "Inventory:", item_cat inv_item_type = IC_NULL);
char inv(std::string title);
char inv_type(std::string title, item_cat inv_item_type = IC_NULL);
int inventory_item_menu(char chItem, int startx = 0, int width = 50);
std::vector<item> multidrop();
faction* list_factions(std::string title = "FACTIONS:");
point find_item(item *it);
void remove_item(item *it);
inventory crafting_inventory(); // inv_from_map, inv, & 'weapon'
void consume_items(std::vector<component> components);
void consume_tools(std::vector<component> tools);
inventory crafting_inventory(player *p); // inv_from_map, inv, & 'weapon'
std::list<item> consume_items(player *p, std::vector<component> components);
void consume_tools(player *p, std::vector<component> tools, bool force_available);
bool has_gametype() const { return gamemode && gamemode->id() != SGAME_NULL; }
special_game_id gametype() const { return (gamemode) ? gamemode->id() : SGAME_NULL; }
@@ -240,11 +265,11 @@ class game
recipe_map recipes; // The list of valid recipes
std::vector<constructable*> constructions; // The list of constructions
std::vector <itype_id> mapitems[num_itloc]; // Items at various map types
std::vector <items_location_and_chance> monitems[num_monsters];
std::vector <mission_type> mission_types; // The list of mission templates
mutation_branch mutation_data[PF_MAX2]; // Mutation data
std::map<char, action_id> keymap;
std::map<char, action_id> default_keymap;
calendar turn;
signed char temperature; // The air temperature
@@ -271,6 +296,7 @@ class game
std::map<int, std::map<int, bool> > mapRain;
int w_void_lines;
WINDOW *w_terrain;
WINDOW *w_minimap;
WINDOW *w_HP;
@@ -289,13 +315,29 @@ class game
bionic_id random_good_bionic() const; // returns a non-faulty, valid bionic
void load_artifacts(); // Load artifact data
// Needs to be called by main() before MAPBUFFER.load
// Knockback functions: knock target at (tx,ty) along a line, either calculated
// from source position (sx,sy) using force parameter or passed as an argument;
// force determines how far target is knocked, if trajectory is calculated
// force also determines damage along with dam_mult;
// stun determines base number of turns target is stunned regardless of impact
// stun == 0 means no stun, stun == -1 indicates only impact stun (wall or npc/monster)
void knockback(int sx, int sy, int tx, int ty, int force, int stun, int dam_mult);
void knockback(std::vector<point>& traj, int force, int stun, int dam_mult);
// shockwave applies knockback to all targets within radius of (x,y)
// parameters force, stun, and dam_mult are passed to knockback()
// ignore_player determines if player is affected, useful for bionic, etc.
void shockwave(int x, int y, int radius, int force, int stun, int dam_mult, bool ignore_player);
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_artifacts(); // Load artifact data
void load_weather(std::ifstream &fin);
void load(std::string name); // Load a player-specific save file
void start_game(); // Starts a new game
@@ -311,7 +353,6 @@ class game
void init_itypes(); // Initializes item types
void init_skills();
void init_bionics(); // Initializes bionics... for now.
void init_mapitems(); // Initializes item placement
void init_mtypes(); // Initializes monster types
void init_mongroups(); // Initualizes monster groups
void init_monitems(); // Initializes monster inventory selection
@@ -322,6 +363,7 @@ class game
void init_mutations(); // Initializes mutation "tech tree"
void init_vehicles(); // Initializes vehicle types
void init_autosave(); // Initializes autosave parameters
void init_diseases(); // Initializes disease lookup table.
void load_keyboard_settings(); // Load keybindings from disk
@@ -367,12 +409,12 @@ class game
void construction_menu(); // See construction.cpp
bool player_can_build(player &p, inventory inv, constructable* con,
const int level = -1, bool cont = false,
bool exact_level=false);
bool exact_level=false);
void place_construction(constructable *con); // See construction.cpp
void complete_construction(); // See construction.cpp
bool pl_choose_vehicle (int &x, int &y);
bool vehicle_near ();
void handbrake ();
void control_vehicle(); // Use vehicle controls '^'
void examine();// Examine nearby terrain 'e'
void advanced_inv();
// open vehicle interaction screen
@@ -383,7 +425,7 @@ class game
void compare(int iCompareX = -999, int iCompareY = -999); // Compare two Items 'I'
void drop(char chInput = '.'); // Drop an item 'd'
void drop_in_direction(); // Drop w/ direction 'D'
void reassign_item(); // Reassign the letter of an item '='
void reassign_item(char ch = '.'); // Reassign the letter of an item '='
void butcher(); // Butcher a corpse 'B'
void complete_butcher(int index); // Finish the butchering process
void forage(); // Foraging ('a' on underbrush)
@@ -401,7 +443,8 @@ class game
void chat(); // Talk to a nearby NPC 'C'
void plthrow(char chInput = '.'); // Throw an item 't'
void help(); // Help screen '?'
void show_options(); // Options screen '?'
void show_options(); // Options screen '?1'
void show_auto_pickup(); // Auto pickup manage screen '?3'
// 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
@@ -432,14 +475,16 @@ class game
bool handle_action();
void update_scent(); // Updates the scent map
bool is_game_over(); // Returns true if the player quit or died
void place_corpse(); // Place player corpse
void death_screen(); // Display our stats, "GAME OVER BOO HOO"
void gameover(); // Ends the game
void write_msg(); // Prints the messages in the messages list
void msg_buffer(); // Opens a window with old messages in it
void draw_minimap(); // Draw the 5x5 minimap
void draw_HP(); // Draws the player's HP and Power level
int autosave_timeout(); // If autosave enabled, how long we should wait for user inaction before saving.
void autosave(); // Saves map
// int autosave_timeout(); // If autosave enabled, how long we should wait for user inaction before saving.
void autosave(); // automatic quicksaves - Performs some checks before calling quicksave()
void quicksave(); // Saves the game without quitting
// On-request draw functions
void draw_overmap(); // Draws the overmap, allows note-taking etc.
@@ -476,7 +521,6 @@ class game
std::vector<event> events; // Game events to be processed
int kills[num_monsters]; // Player's kill count
std::string last_action; // The keypresses of last turn
int moves_since_last_save;
int item_exchanges_since_save;
time_t last_save_timestamp;
+296 -178
View File
@@ -18,14 +18,20 @@
void game::help()
{
WINDOW* w_help_border = newwin(25, 80, (TERMY > 25) ? (TERMY-25)/2 : 0, (TERMX > 80) ? (TERMX-80)/2 : 0);
WINDOW* w_help = newwin(23, 78, 1 + (int)((TERMY > 25) ? (TERMY-25)/2 : 0), 1 + (int)((TERMX > 80) ? (TERMX-80)/2 : 0));
WINDOW* w_help_border = newwin(FULL_SCREEN_HEIGHT, FULL_SCREEN_WIDTH,
(TERMY > FULL_SCREEN_HEIGHT) ? (TERMY-FULL_SCREEN_HEIGHT)/2 : 0,
(TERMX > FULL_SCREEN_WIDTH) ? (TERMX-FULL_SCREEN_WIDTH)/2 : 0);
WINDOW* w_help = newwin(FULL_SCREEN_HEIGHT-2, FULL_SCREEN_WIDTH-2,
1 + (int)((TERMY > FULL_SCREEN_HEIGHT) ? (TERMY-FULL_SCREEN_HEIGHT)/2 : 0),
1 + (int)((TERMX > FULL_SCREEN_WIDTH) ? (TERMX-FULL_SCREEN_WIDTH)/2 : 0));
char ch;
action_id movearray[] = {ACTION_MOVE_NW,ACTION_MOVE_N,ACTION_MOVE_NE,
ACTION_MOVE_W, ACTION_PAUSE, ACTION_MOVE_E,
ACTION_MOVE_SW,ACTION_MOVE_S,ACTION_MOVE_SE};
do {
wborder(w_help_border, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX);
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX);
mvwprintz(w_help_border, 0, 38, c_ltred, " HELP ");
wrefresh(w_help_border);
werase(w_help);
@@ -39,15 +45,16 @@ c: Viewing k: Traps\n\
d: Hunger, Thirst, and Sleep l: Items overview\n\
e: Pain and Stimulants m: Combat\n\
f: Addiction n: Unarmed Styles\n\
g: Morale and XP o: Survival tips\n\
g: Morale and Learning o: Survival tips\n\
h: Radioactivity and Mutation\n\
\n\
1: List of all commands (you can change key commands here)\n\
2: List of all options (you can change options here)\n\
3: List of item types and data\n\
4: Description of map symbols\n\
5: Description of gun types\n\
6: Frequently Asked Questions (Some spoilers!)\n\
3: Auto pickup manager (you can change pickup rules here)\n\
4: List of item types and data\n\
5: Description of map symbols\n\
6: Description of gun types\n\
7: Frequently Asked Questions (Some spoilers!)\n\
\n\
q: Return to game");
@@ -82,21 +89,38 @@ tools are all available to help you survive.");
mvwprintz(w_help, 0, 0, c_white, "\
Movement is performed using the numpad, or vikeys. Each step will take 100\n\
movement points (or more, depending on the terrain); you\n\
y k u 7 8 9 will then replenish a variable amount of movement points,\n\
\\ | / \\ | / depending on many factors (press '@' to see the exact\n\
will then replenish a variable amount of movement points,\n\
\\ | / \\ | / depending on many factors (%s to see the exact\n\
\\|/ \\|/ amount). To attempt to hit a monster with your weapon,\n\
h--.--l 4--5--6 simply move into it. You may find doors, ('+'); these may\n\
/|\\ /|\\ be opened with 'o' or closed with 'c'. Some doors are\n\
-- -- -- -- simply move into it. You may find doors, ('+'); these may\n\
/|\\ /|\\ be opened %s or closed %s. Some doors are\n\
/ | \\ / | \\ locked. Locked doors, windows, and some other obstacles\n\
b j n 1 2 3 can be destroyed by smashing them ('s', then choose a\n\
can be destroyed by smashing them (%sthen choose a\n\
direction). Smashing down obstacles is much easier with a\n\
good weapon or a strong character.\n\
\n\
There may be times when you want to move more quickly by holding down a\n\
movement key. However, fast movement in this fashion may lead to the player\n\
getting into a dangerous situation or even killed before they have a chance\n\
to react. Pressing '!' will toggle \"Run Mode.\" While this is on, any\n\
movement will be ignored if new monsters enter the player's view.");
to react. %s will toggle \"Run Mode.\" While this is on, any\n\
movement will be ignored if new monsters enter the player's view.",
press_x(ACTION_PL_INFO, "press ", "'View Player Info'").c_str(),
press_x(ACTION_OPEN, "with ", "").c_str(),
press_x(ACTION_CLOSE, "with ", "").c_str(),
press_x(ACTION_SMASH, "", ", ", "").c_str(),
press_x(ACTION_TOGGLE_SAFEMODE, "Pressing ", "'Toggle Safemode'" ).c_str());
for(int acty = 0; acty < 3; acty++) {
for(int actx = 0; actx < 3; actx++) {
std::vector<char> keys = keys_bound_to( movearray[acty*3+actx] );
if (keys.empty()) {
} else {
mvwputch(w_help, (acty * 3 + 2), (actx * 3), c_ltblue, keys[0]);
if (keys.size() >0) {
mvwputch(w_help, (acty * 3 + 2), (actx * 3 + 10), c_ltblue, keys[1]);
}
}
}
}
wrefresh(w_help);
refresh();
getch();
@@ -107,12 +131,14 @@ movement will be ignored if new monsters enter the player's view.");
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "\
The player can often see more than can be displayed on the screen at a time.\n\
Pressing ';' or 'x' enters look around mode, which allows you to scoll around\n\
using the movement keys and view irems on the map. Pressing 'V' provides a\n\
list of nearby visible items, though items shut away in crates, cubpoards,\n\
%s allows you to scroll around\n\
using the movement keys and view items on the map. %s provides a\n\
list of nearby visible items, though items shut away in crates, cupboards,\n\
refrigerators and the like will not be displayed. Pressing Shift+vikeys\n\
will scroll the view persistently, allowing you to keep an eye on things\n\
as you move around.");
as you move around.",
press_x(ACTION_LOOK, "Pressing ", " enters look around mode, which", "'Look Around' mode").c_str(),
press_x(ACTION_LIST_ITEMS, "Pressing ", "'List all items around the player'").c_str());
wrefresh(w_help);
refresh();
getch();
@@ -126,20 +152,23 @@ As time passes, you will begin to feel hunger and thirst. A status warning\n\
at the bottom of the screen will appear. As hunger and thirst reach critical\n\
levels, you will begin to suffer movement penalties. Thirst is more dangerous\n\
than hunger. Finding food in a city is usually easy; outside of a city, you\n\
may have to hunt an animal, then stand over its corpse and 'B'utcher it into\n\
may have to hunt an animal, then stand over its corpse and %s it into\n\
small chunks of meat. Likewise, outside of a city you may have to drink water\n\
from a river or other natural source; stand in shallow water and press 'g' or\n\
',' to pick it up. You'll need a watertight container. Be forewarned that\n\
some sources of water aren't trustworthy and may produce diseased water. To\n\
be sure it's healthy, run all water you collect through a water filter before\n\
drinking.\n\
from a river or other natural source; stand in shallow water and \n\
%s to pick it up. You'll need a watertight container. \n\
Be forewarned that some sources of water aren't trustworthy \n\
and may produce diseased water. To be sure it's healthy, \n\
run all water you collect through a water filter before drinking.\n\
\n\
Every 14 to 20 hours, you'll find yourself growing sleepy. If you do not\n\
sleep by pressing '$', you'll start suffering stat and movement penalties.\n\
sleep%s you'll start suffering stat and movement penalties.\n\
You may not always fall asleep right away. Sleeping indoors, especially on a\n\
bed, will help; or you can always use sleeping pills. While sleeping, you'll\n\
slowly replenish lost hit points. You'll also be vulnerable to attack, so\n\
try to find a safe place, or set traps for unwary intruders.");
try to find a safe place, or set traps for unwary intruders.",
press_x(ACTION_BUTCHER, "butcher").c_str(),
from_sentence_case(press_x(ACTION_PICKUP)).c_str(),
press_x(ACTION_SLEEP, " by pressing ", ",", "").c_str());
wrefresh(w_help);
refresh();
getch();
@@ -221,14 +250,24 @@ Press any key for more...");
getch();
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "\
Morale is also responsible for filling your XP pool. This XP pool is used\n\
for improving your skills; as you use your skills, points are taken from the\n\
XP pool and placed into the skill used. If your XP pool is empty, your\n\
skills cannot be improved except through the use of books.\n\
Morale is also responsible for ensuring you can learn effectively, via a\n\
mechanic referred to as 'focus'. Your focus level is a measure of how\n\
effectively you can learn. The natural level is 100, which indicates normal\n\
learning potential. Higher or lower focus levels make it easier or harder\n\
to learn from practical experience.\n\
\n\
Your XP pool will not fill unless your morale is at least 0. A morale level\n\
between 0 and 100 gives the percentage chance for your XP to increase by 1\n\
each turn. Above 100, you get 1 XP point each turn for every 100 morale.");
Your focus level has a natural set point that it converges towards. When your\n\
focus is much lower - or higher - than this set point, it will change faster\n\
than when it is near the set point. Having high morale will raise the set\n\
point, and having low morale will lower the set point. Pain is also factored\n\
into the set point calculation - it's harder to learn when you're in pain.\n\
\n\
Your focus is also lowered by certain activities. Training your skills\n\
through real-world practice lowers your focus gradually, by an amount that\n\
depends on your current level of focus (higher focus means larger decreases,\n\
as well as improved learning). Training your skills by reading books\n\
decreases your focus rapidly, by giving a significant penalty to the set\n\
point of your focus.");
wrefresh(w_help);
refresh();
getch();
@@ -238,7 +277,7 @@ each turn. Above 100, you get 1 XP point each turn for every 100 morale.");
case 'H':
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "\
Though it is relatively rare, certain areas of the world may be contamiated\n\
Though it is relatively rare, certain areas of the world may be contaminated\n\
with radiation. It will gradually accumulate in your body, weakening you\n\
more and more. While in radiation-free areas, your radiation level will\n\
slowly decrease. Taking iodine tablets will help speed the process.\n\
@@ -285,24 +324,27 @@ Many important items can be very hard to find, or will cost a great deal of\n\
money to trade for. Fortunately, it is possible to craft a wide variety of\n\
goods with the proper tools, materials, and training.\n\
\n\
Some recipes require a set of tools. These are not used up when crafting, so\n\
you can keep your tool set. All recipes require one or more ingredients.\n\
Some recipes require a set of tools. These are not used up when crafting,\n\
so you can keep your tool set. All recipes require one or more ingredients.\n\
These ARE used up in crafting.\n\
\n\
To craft items, press '&'. There are five categories; Weapons, Food,\n\
Electronics, Armor, and Miscellaneous. While a few items require no skill to\n\
create, the majority require you to have some knowledge:\n\
%sThere are five categories; Weapons, Food, \n\
Electronics, Armor, and Miscellaneous. While a few items require\n\
no skill to create, the majority require you to have some knowledge:\n\
\n\
->Mechanic skill is used for weapons, traps, and a few tools.\n\
->Cooking skill, at low levels, is used for making tasty recipes; at higher\n\
levels, you have an understanding of chemistry and can make chemical weapons\n\
and beneficial elixirs.\n\
->Cooking skill, at low levels, is used for making tasty recipes; \n\
at higher levels, you have an understanding of chemistry and can make\n\
chemical weapons and beneficial elixirs.\n\
->Electronics skill lets you make a wide variety of tools with intricate uses.\n\
->Tailoring skill is used to create basic clothing, and later tough armor.\n\
\n\
In addition to the primary crafting skills, other skills may be necessary to\n\
create certain items. Traps skill, Firearms skill, and First Aid skill are\n\
all required for certain items.");
In addition to the primary crafting skills, other skills may be necessary\n\
to create certain items. Traps skill, Firearms skill, and First Aid skill\n\
are all required for certain items.",
press_x(ACTION_CRAFT, "To craft items, press ", ". ", "").c_str()/*,
press_x(ACTION_RECRAFT).c_str(),
press_x(ACTION_LONGCRAFT).c_str()*/);
wrefresh(w_help);
refresh();
getch();
@@ -319,19 +361,22 @@ to wake you up) and bear traps (which make noise AND damage and trap anything\n\
that steps on them). Others need to be crafted; this requires the Traps skill\n\
and possibly Mechanics.\n\
\n\
To set a trap, simply use the item ('a') and choose a direction; the trap\n\
To set a trap, simply use the item%s and choose a direction; the trap\n\
will be placed on an adjacent tile. Some traps may require additional tools,\n\
like a shovel, to be set. Once set, a trap will remain in place until\n\
stepped on or disarmed.\n\
\n\
To disarm a trap, examine ('e') the space it is on. Your success depends\n\
To disarm a trap, examine%s the space it is on. Your success depends\n\
upon your Traps skill and Dexterity. If you succeed, the trap is removed\n\
and replaced by some or all of its constituent parts; however, if you fail,\n\
there is a chance that you will set off the trap, suffering the consequences.\n\
\n\
Many traps are fully or partially hidden. Your ability to detect traps is\n\
entirely dependent upon your Perception. Should you stumble into a trap, you\n\
may have a chance to avoid it, depending on your Dodge skill.");
may have a chance to avoid it, depending on your Dodge skill.",
press_x(ACTION_USE, " (", ")", "").c_str(),
press_x(ACTION_EXAMINE, " (", ")", "").c_str()/*,
press_x(ACTION_USE_WIELDED).c_str()*/);
wrefresh(w_help);
refresh();
getch();
@@ -342,39 +387,51 @@ may have a chance to avoid it, depending on your Dodge skill.");
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "\
There are a wide variety of items available for your use. You may find them\n\
lying on the ground; if so, simply press ',' or 'g' to pick up items on the\n\
lying on the ground; if so, simply %s to pick up items on the\n\
same square. Some items are found inside a container, drawn as a { with a\n\
blue background. Pressing 'e', then a direction, will allow you to examine\n\
blue background. %s, then a direction, will allow you to examine\n\
these containers and loot their contents.\n\
\n\
Pressing 'I' opens a comparison menu, where you can see two items\n\
%s opens a comparison menu, where you can see two items\n\
side-by-side with their attributes highlighted to indicate which is superior.\n\
You can also access the item comparison menu by pressing 'C' when the 'V'iew\n\
You can also access the item comparison menu by pressing 'C' when the %s\n\
nearby items menu is open and an item is selected.\n\
\n\
All items may be used as a melee weapon, though some are better than others.\n\
You can check the melee attributes of an item you're carrying by hitting 'i'\n\
You can check the melee attributes of an item you're carrying by %s\n\
to enter your inventory, then pressing the letter of the item. There are 3\n\
melee values, bashing, cutting, and to-hit bonus (or penalty).\n\
Bashing damage is universally effective, but is capped by low strength.\n\
Cutting damage is a guaranteed increase in damage, but it may be reduced by\n\
a monster's natural armor.\n\
\n\
Press any key for more...");
Press any key for more...",
from_sentence_case(press_x(ACTION_PICKUP)).c_str(),
press_x(ACTION_EXAMINE, "Pressing ", "'Examine Nearby Terrain'").c_str(),
press_x(ACTION_COMPARE, "Pressing ", "'Compare two Items'").c_str(),
press_x(ACTION_LIST_ITEMS, "view").c_str(),
press_x(ACTION_INVENTORY, "hitting ", "trying").c_str()/*,
press_x(ACTION_ADVANCEDINV).c_str(), //'Advanced Inventory management'"
press_x(ACTION_ORGANIZE).c_str()*/); //'Swap Inventory Letters'
wrefresh(w_help);
refresh();
getch();
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "\
To wield an item as a weapon, press 'w' then the proper letter. Pressing '-'\n\
To wield an item as a weapon, %s then the proper letter. Pressing '-'\n\
in lieu of a letter will make you wield nothing. A wielded weapon will not\n\
contribute to your volume carried, so holding a large item in your hands may\n\
be a good option for travel. When unwielding your weapon, it will go back in\n\
your inventory, or will be dropped on the ground if there is no space.\n\
\n\
To wear a piece of clothing, press 'W' then the proper letter. Armor reduces\n\
damage and helps you resist things like smoke. To take off an item, press\n\
'T' then the proper letter.");
To wear a piece of clothing, %s then the proper letter. Armor reduces\n\
damage and helps you resist things like smoke. To take off an item, %s\n\
then the proper letter.",
from_sentence_case(press_x(ACTION_WIELD)).c_str(),
from_sentence_case(press_x(ACTION_WEAR)).c_str(),
from_sentence_case(press_x(ACTION_TAKE_OFF)).c_str()/*,
press_x(ACTION_SORT_ARMOR).c_str(),
press_x(ACTION_PICK_STYLE).c_str()*/);
wrefresh(w_help);
refresh();
getch();
@@ -388,27 +445,37 @@ After 30 minutes of warmup time, monsters will begin to appear. They are\n\
represented by letters on your screen; a list of monster names, and their\n\
positions relative to you, is displayed on the right side of the screen.\n\
\n\
To attack a monster with a melee weapon, simply move into them. The time it\n\
takes to attack depends on the size and weight of your weapon. Small, light\n\
weapons are the fastest; unarmed attacks increase in speed with your Unarmed\n\
Combat skill, and will eventually be VERY fast. A successful hit with a\n\
bashing weapon may stun the monster temporarily, while cutting weapons may get\n\
stuck, possibly pulling the weapon from your hands--but a monster with a weapon\n\
stuck in it will move much more slowly. A miss may make you stumble and lose\n\
movement points. If a monster hits you, your clothing may absorb some damage,\n\
but you will absorb the excess.\n\
To attack a monster with a melee weapon, simply move into them. The time\n\
it takes to attack depends on the size and weight of your weapon. Small,\n\
light weapons are the fastest; unarmed attacks increase in speed with\n\
your Unarmed Combat skill, and will eventually be VERY fast. A successful\n\
hit with a bashing weapon may stun the monster temporarily, while cutting\n\
weapons may get stuck, possibly pulling the weapon from your hands-- but\n\
a monster with a weapon stuck in it will move much more slowly. A miss\n\
may make you stumble and lose movement points. If a monster hits you,\n\
your clothing may absorb some damage, but you will absorb the excess.\n\
\n\
Swarms of monsters may call for firearms. If you find one, wield it first,\n\
then reload by pressing 'r'. If you wish to change ammo, you must unload the\n\
weapon by pressing 'U', then reload again. To fire, press 'f', move the\n\
then reload%s. If you wish to change ammo, you must unload the\n\
weapon%s, then reload again. To fire%s, move the\n\
cursor to the relevant space, then hit '.' or 'f'. Some guns have alternate\n\
firing modes, such as burst fire; to cycle modes, press 'F'. Firing\n\
continuously, especially in bursts, will severely reduce accuracy.\n\
\n\
firing modes, such as burst fire; to cycle modes%s.\n\
Firing continuously, especially in bursts, will severely reduce accuracy.\n\
Press any key for more...",
press_x(ACTION_RELOAD, " by pressing ", "").c_str(),
press_x(ACTION_UNLOAD, " by pressing ", "").c_str(),
press_x(ACTION_FIRE, ", press ", "").c_str(),
press_x(ACTION_SELECT_FIRE_MODE, ", press ", " 'Toggle attack mode of Wielded Item'").c_str());
wrefresh(w_help);
refresh();
getch();
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "\
Unlike most roguelikes, fleeing will often be your best option, especially\n\
when overwhelmed by a swarm of zombies. Try to avoid getting cornered inside\n\
a building. Ducking down into the subways or sewers is often an excellent\n\
escape tactic.");
when overwhelmed by a swarm of zombies. Try to avoid getting cornered\n\
inside a building. Ducking down into the subways or sewers is often\n\
an excellent escape tactic."/*,
press_x(ACTION_USE_WIELDED).c_str()*/);
wrefresh(w_help);
refresh();
getch();
@@ -423,19 +490,23 @@ start with your choice of a single, commonly-taught style by starting with\n\
the Martial Arts Training trait. Many, many more can be taught by wandering\n\
masters.\n\
\n\
To select a fighting style, press _ (underscore). If you are already unarmed\n\
To select a fighting style%s. If you are already unarmed\n\
this will make you start using the style. Otherwise, it will be locked in as\n\
your default unarmed style; to start using it, press w-.\n\
your default unarmed style; to start using it, %s '-'.\n\
\n\
Most styles have a variety of special moves associated with them. Most have\n\
a skill requirement, and will be unavailable until you reach a level of\n\
unarmed skill. You can check the moves by examining your style via the\n\
inventory screen (i key).\n\
inventory screen%s.\n\
\n\
Many styles also have special effects unlocked under certain conditions.\n\
These are varied and unique to each style, and range from special combo moves\n\
to bonuses depending on the situation you are in. You can check these by\n\
examining your style.");
examining your style.",
press_x(ACTION_PICK_STYLE, ", press ", "").c_str(),
press_x(ACTION_WIELD, "press ", " then", "'Select Wielded Item' then press").c_str(),
press_x(ACTION_INVENTORY, " (", " key)", "").c_str()/*,
press_x(ACTION_THROW).c_str()*/);
wrefresh(w_help);
refresh();
getch();
@@ -455,8 +526,8 @@ as possible and load up on more than one type.\n\
It's also important to carry a few medications; painkillers are a must-have,\n\
and drugs such as cigarettes will make life easier (but beware addiction).\n\
Leave cities as soon as you have a good stockpile of equipment. Their high\n\
concentration of zombies makes them a deathtrap--but a necessary resource for\n\
food and ammunition.\n\
concentration of zombies makes them a deathtrap--but a necessary resource\n\
for food and ammunition.\n\
\n\
Combat is much easier if you can fight just one monster at once. Use doorways\n\
as a choke point, or stand behind a window and strike as the zombies slowly\n\
@@ -472,19 +543,24 @@ Press any key for more...");
getch();
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "\
Try to keep your inventory as full as possible without being overloaded. You\n\
never know when you might need an item, most are good to sell, and you can\n\
easily drop unwanted items on the floor.\n\
Try to keep your inventory as full as possible without being overloaded.\n\
You never know when you might need an item, most are good to sell, and\n\
you can easily drop unwanted items on the floor.\n\
\n\
Keep an eye on the weather. At night, sleeping might be difficult if you\n\
don't have a warm place to rest your head. Be sure to protect your\n\
Keep an eye on the weather. At night, sleeping might be difficult if\n\
you don't have a warm place to rest your head. Be sure to protect your\n\
extremities from frostbite and to keep your distance from large fires.");
wrefresh(w_help);
refresh();
getch();
break;
// Keybindings
case '1': {
// Remember what the keybindings were originally so we can restore them if player cancels.
std::map<char, action_id> keymap_old = keymap;
werase(w_help);
int offset = 1;
char remapch = ' ';
@@ -507,10 +583,10 @@ extremities from frostbite and to keep your distance from large fires.");
needs_refresh = false;
}
// Clear the lines
for (int i = 0; i < 23; i++)
for (int i = 0; i < FULL_SCREEN_HEIGHT-2; i++)
mvwprintz(w_help, i, 0, c_black, " ");
for (int i = 0; i < 23 && offset + i < NUM_ACTIONS; i++) {
for (int i = 0; i < FULL_SCREEN_HEIGHT-2 && offset + i < NUM_ACTIONS; i++) {
std::vector<char> keys = keys_bound_to( action_id(offset + i) );
nc_color col = (keys.empty() ? c_ltred : c_white);
mvwprintz(w_help, i, 3, col, "%s: ", action_name( action_id(offset + i) ).c_str());
@@ -535,7 +611,7 @@ extremities from frostbite and to keep your distance from large fires.");
offset++;
if (remapch == '-' || remapch == '+') {
needs_refresh = true;
for (int i = 0; i < 23 && i + offset < NUM_ACTIONS; i++) {
for (int i = 0; i < FULL_SCREEN_HEIGHT-2 && i + offset < NUM_ACTIONS; i++) {
mvwprintz(w_help, i, 0, c_ltblue, "%c", 'a' + i);
mvwprintz(w_help, i, 1, c_white, ":");
}
@@ -560,8 +636,21 @@ extremities from frostbite and to keep your distance from large fires.");
}
}
} while (remapch != 'q' && remapch != 'Q' && remapch != KEY_ESCAPE);
if (changed_keymap && query_yn("Save changes?"))
save_keymap();
if (changed_keymap)
{
if(query_yn("Save changes?"))
{
save_keymap();
}
else
{
// Player wants to keep the old keybindings. Revert!
keymap = keymap_old;
}
}
werase(w_help);
} break;
@@ -570,14 +659,19 @@ extremities from frostbite and to keep your distance from large fires.");
werase(w_help);
} break;
case '3':
case '3': {
show_auto_pickup();
werase(w_help);
} break;
case '4':
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "\
ITEM TYPES:\n\
~ Liquid\n\
%%%% Food\n\
! Medication\n\
These are all consumed by using 'E'. They provide a certain amount of\n\
These are all consumed by %s. They provide a certain amount of\n\
nutrition, quench your thirst, may be a stimulant or a depressant, and may\n\
provide morale. There may also be more subtle effects.\n\
\n\
@@ -586,13 +680,17 @@ ITEM TYPES:\n\
, Tiny item\n\
These are all generic items, useful only to be wielded as a weapon.\n\
However, some have special uses; they will show up under the TOOLS section\n\
in your inventory. Press 'a' to use these.\n\
in your inventory. %s to use these.\n\
\n\
) Container\n\
These items may hold other items. Someare passable weapons. Many will be\n\
listed with their contents, e.g. \"plastic bottle of water\". Those containing\n\
comestibles may be eaten with 'E'; this may leave you with an empty container.\n\
Press any key to continue...");
These items may hold other items. Some are passable weapons.\n\
Many will be listed with their contents, e.g. \"plastic bottle of water\".\n\
Those containing comestibles may be eaten%s;\n\
this may leave an empty container.\n\
Press any key to continue...",
press_x(ACTION_EAT, "using ", "eating").c_str(),
press_x(ACTION_USE).c_str(),
press_x(ACTION_EAT, " with ", "").c_str());
wrefresh(w_help);
refresh();
getch();
@@ -600,7 +698,7 @@ Press any key to continue...");
mvwprintz(w_help, 0, 0, c_white, "\
ITEM TYPES:\n\
[ Clothing\n\
This may be worn with the 'W' key or removed with the 'T' key. It may\n\
This may be worn%s or removed%s. It may\n\
cover one or more body parts; you can wear multiple articles of clothing on\n\
any given body part, but this will encumber you severely. Each article of\n\
clothing may provide storage space, warmth, an encumberment, and a resistance\n\
@@ -608,19 +706,27 @@ ITEM TYPES:\n\
effects.\n\
\n\
( Firearm\n\
This weapon may be loaded with ammunition with 'r', unloaded with 'U', and\n\
fired with 'f'. Some have automatic fire, which may be used with 'F' at a\n\
penalty to accuracy. The color refers to the type; handguns are gray, shotguns\n\
are red, submachine guns are cyan, rifles are brown, assault rifles are blue,\n\
and heavy machine guns are light red. Each has an accuracy rating, a bonus to\n\
damage, a rate of fire, and a maximum load. Note that most firearms load\n\
fully in one action, while shotguns must be loaded one shell at a time.\n\
This weapon may be loaded with ammunition%s, unloaded%s, and\n\
fired%s. Some have automatic fire, which may be used%s at a\n\
penalty to accuracy. The color refers to the type; handguns are gray,\n\
shotguns are red, submachine guns are cyan, rifles are brown, assault rifles\n\
are blue, and heavy machine guns are light red. Each has a dispersion rating,\n\
a bonus to damage, a rate of fire, and a maximum load. Note that most\n\
firearms load fully in one action, while shotguns must be loaded one\n\
shell at a time.\n\
\n\
= Ammunition\n\
Ammunition is worthless without a gun to load it into. Generally, there\n\
are several variants for any particular calibre. Ammunition has a damage\n\
rating, an accuracy, a range, and an armor-piercing quality.\n\
Press any key to continue...");
Ammunition is worthless without a gun to load it into. Generally,\n\
there are several variants for any particular calibre. Ammunition has\n\
damage, dispersion, and range ratings, and an armor-piercing quality.\n\
Press any key to continue...",
press_x(ACTION_WEAR, " with the ", " key","").c_str(),
press_x(ACTION_TAKE_OFF, " with the "," key","").c_str(),
press_x(ACTION_RELOAD, " with ", "").c_str(),
press_x(ACTION_UNLOAD, " with ", "").c_str(),
press_x(ACTION_FIRE, " with ", "").c_str(),
press_x(ACTION_SELECT_FIRE_MODE, " with ", "").c_str()/*,
press_x(ACTION_FIRE_BURST).c_str()*/);
wrefresh(w_help);
refresh();
getch();
@@ -630,35 +736,38 @@ ITEM TYPES:\n\
\n\
* Thrown weapon; simple projectile or grenade\n\
These items are suited for throwing, and many are only useful when\n\
thrown, such as grenades, molotov cocktails, or tear gas.\n\
thrown, such as grenades, molotov cocktails, or tear gas. Once activated\n\
be certain to throw these items%s.\n\
\n\
? Book or magazine\n\
This can be read for training or entertainment by pressing 'R'. Most\n\
This can be read for training or entertainment%s. Most\n\
require a basic level of intelligence; some require some base knowledge in\n\
the relevant subject.");
the relevant subject.",
press_x(ACTION_THROW, " by pressing ",", then the letter of the item to throw.",".").c_str(),
press_x(ACTION_READ, " by pressing ", "").c_str());
wrefresh(w_help);
refresh();
getch();
break;
case '4':
case '5':
werase(w_help);
mvwprintz(w_help, 0, 0, c_ltgray, "MAP SYMBOLS:");
mvwprintz(w_help, 1, 0, c_brown, "\
. Field - Empty grassland, occasional wild fruit.");
mvwprintz(w_help, 2, 0, c_green, "\
F Forest - May be dense or sparse. Slow moving; foragable food.");
mvputch(3, 0, c_dkgray, LINE_XOXO);
mvputch(3, 1, c_dkgray, LINE_OXOX);
mvputch(3, 2, c_dkgray, LINE_XXOO);
mvputch(3, 3, c_dkgray, LINE_OXXO);
mvputch(3, 4, c_dkgray, LINE_OOXX);
mvputch(3, 5, c_dkgray, LINE_XOOX);
mvputch(3, 6, c_dkgray, LINE_XXXO);
mvputch(3, 7, c_dkgray, LINE_XXOX);
mvputch(3, 8, c_dkgray, LINE_XOXX);
mvputch(3, 9, c_dkgray, LINE_OXXX);
mvputch(3, 10, c_dkgray, LINE_XXXX);
mvwputch(w_help, 3, 0, c_dkgray, LINE_XOXO);
mvwputch(w_help, 3, 1, c_dkgray, LINE_OXOX);
mvwputch(w_help, 3, 2, c_dkgray, LINE_XXOO);
mvwputch(w_help, 3, 3, c_dkgray, LINE_OXXO);
mvwputch(w_help, 3, 4, c_dkgray, LINE_OOXX);
mvwputch(w_help, 3, 5, c_dkgray, LINE_XOOX);
mvwputch(w_help, 3, 6, c_dkgray, LINE_XXXO);
mvwputch(w_help, 3, 7, c_dkgray, LINE_XXOX);
mvwputch(w_help, 3, 8, c_dkgray, LINE_XOXX);
mvwputch(w_help, 3, 9, c_dkgray, LINE_OXXX);
mvwputch(w_help, 3, 10, c_dkgray, LINE_XXXX);
mvwprintz(w_help, 3, 12, c_dkgray, "\
Road - Safe from burrowing animals.");
@@ -699,7 +808,7 @@ O Parking lot - Empty lot, few items. Mostly useless.");
getch();
break;
case '5':
case '6':
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "Gun types:");
mvwprintz(w_help, 2, 0, c_ltgray, "( Handguns");
@@ -714,17 +823,18 @@ several loaded handguns, switching from one to the next once their ammo is\n\
spent.");
mvwprintz(w_help, 12, 0, c_green, "( Crossbows");
mvwprintz(w_help, 13, 0, c_white, "\
The best feature of crossbows is their silence. The bolts they fire are only\n\
rarely destroyed; if you pick up the bolts after firing them, your ammunition\n\
will last much longer. Crossbows suffer from a short range and a very long\n\
reload time (modified by your strength); plus, most only hold a single round.\n\
The best feature of crossbows is their silence. The bolts they fire are\n\
only rarely destroyed; if you pick up the bolts after firing them, your \n\
ammunition will last much longer. Crossbows suffer from a short range and\n\
a very long reload time (modified by your strength); plus, most only hold\n\
a single round.\n\
For this reason, it is advisable to carry a few loaded crossbows.\n\
Crossbows can be very difficult to find; however, it is possible to craft one\n\
given enough Mechanics skill. Likewise, it is possible to make wooden bolts\n\
from any number of wooden objects, though these are much less effective than\n\
steel bolts.\n\
Crossbows can be very difficult to find; however, it is possible to craft\n\
one given enough Mechanics skill. Likewise, it is possible to make\n\
wooden bolts from any number of wooden objects, though these are much\n\
less effective than steel bolts.\n\
Crossbows use the handgun skill.");
mvwprintz(w_help, 24, 0, c_white, "Press any key to continue...");
mvwprintz(w_help, FULL_SCREEN_HEIGHT-1, 0, c_white, "Press any key to continue...");
wrefresh(w_help);
refresh();
@@ -737,8 +847,8 @@ Shotguns are one of the most powerful weapons in the game, capable of taking\n\
out almost any enemy with a single hit. Birdshot and 00 shot spread, making\n\
it very easy to hit nearby monsters. However, they are very ineffective\n\
against armor, and some armored monsters might shrug off 00 shot completely.\n\
Shotgun slugs are the answer to this problem; they also offer much better\n\
range than shot.\n\
Shotgun slugs are the answer to this problem; they also offer much\n\
better range than shot.\n\
The biggest drawback to shotguns is their noisiness. They are very loud,\n\
and impossible to silence. A shot that kills one zombie might attract three\n\
more! Because of this, shotguns are best reserved for emergencies.");
@@ -750,7 +860,7 @@ of bullets. However, they are more effective when firing single shots, so\n\
use discretion. They mainly use the 9mm and .45 ammunition; however, other\n\
SMGs exist. They reload moderately quickly, and are suitable for close or\n\
medium-long range combat.");
mvwprintz(w_help, 22, 0, c_white, "Press any key to continue...");
mvwprintz(w_help, FULL_SCREEN_HEIGHT-3, 0, c_white, "Press any key to continue...");
wrefresh(w_help);
refresh();
@@ -764,8 +874,8 @@ more, their scopes or sights make shots fired at targets more than 10 tiles\n\
away as accurate as those with a shorter range. However, they are very poor\n\
at hitting targets 4 squares or less from the player.\n\
Unlike assault rifles, hunting rifles have no automatic fire. They are also\n\
slow to reload and fire, so when facing a large group of nearby enemies, they\n\
are not the best pick.");
slow to reload and fire, so when facing a large group of nearby enemies,\n\
they are not the best pick.");
mvwprintz(w_help, 11, 0, c_blue, "( Assault Rifles");
mvwprintz(w_help, 12, 0, c_white, "\
Assault rifles are similar to hunting rifles in many ways; they are also\n\
@@ -776,7 +886,7 @@ fire, so save it for when you're highly skilled.\n\
Assault rifles are an excellent choice for medium or long range combat, or\n\
even close-range bursts again a large number of enemies. They are difficult\n\
to use, and are best saved for skilled riflemen.");
mvwprintz(w_help, 24, 0, c_white, "Press any key to continue...");
mvwprintz(w_help, FULL_SCREEN_HEIGHT-1, 0, c_white, "Press any key to continue...");
wrefresh(w_help);
refresh();
@@ -795,45 +905,44 @@ making them very good at clearing out large numbers of enemies.");
mvwprintz(w_help, 11, 0, c_white, "\
Energy weapons is an umbrella term used to describe a variety of rifles and\n\
handguns which fire lasers, plasma, or energy attacks. They started to\n\
appear in military use just prior to the start of the apocalypse, and as such\n\
are very difficult to find.\n\
appear in military use just prior to the start of the apocalypse, and\n\
as such are very difficult to find.\n\
Energy weapons have no recoil at all; they are nearly silent, have a long\n\
range, and are fairly damaging. The biggest drawback to energy weapons is\n\
scarcity of ammunition; it is wise to reserve the precious ammo for when you\n\
really need it.");
mvwprintz(w_help, 24, 0, c_white, "Press any key to continue...");
scarcity of ammunition; it is wise to reserve the precious ammo for when\n\
you really need it.");
mvwprintz(w_help, FULL_SCREEN_HEIGHT-1, 0, c_white, "Press any key to continue...");
wrefresh(w_help);
refresh();
getch();
break;
case '6':
case '7':
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "\
Q: What is Run Mode, and why does it prevent me from moving?\n\
A: Run Mode is a way to guarantee that you won't die by holding a movement\n\
Q: What is Safe Mode, and why does it prevent me from moving?\n\
A: Safe Mode is a way to guarantee that you won't die by holding a movement\n\
key down. When a monster comes into view, your movement will be ignored\n\
until Run Mode is turned off with the ! key. This ensures that the\n\
sudden appearence of a monster won't catch you off guard.\n\
until Safe Mode is turned off with the ! key. This ensures that\n\
the sudden appearence of a monster won't catch you off guard.\n\
\n\
Q: It seems like everything I eat makes me sick! What's wrong?\n\
A: Lots of the food found in towns is perishable, and will only last a few\n\
days after the start of a new game (July 12). Fruit, milk, and others are\n\
the first to go. After the first couple of days, you should switch to\n\
canned food, jerky, and hunting.\n\
days after the start of a new game (July 12). Fruit, milk, and others\n\
are the first to go. After the first couple of days, you should switch\n\
to canned food, jerky, and hunting.\n\
\n\
Q: Why doesn't reading a book seem to give me any training?\n\
A: Your skills will not be displayed in the @ screen until they reach level\n\
one. Generally it will take several reads of the same book to gain a\n\
single level in a skill.\n\
Q: How can I remove boards from boarded-up windows and doors?\n\
A: Use a hammer and choose the direction of the boarded-up window or\n\
door to remove the boards.\n\
\n\
Q: How can I board up windows and doors?\n\
A: You'll need a hammer, nails, and two by fours. Use the hammer and choose\n\
the direction in which the terrain you wish to barricade lies.\n\
Q: The game just told me to quit, and other weird stuff is happening.\n\
A: You have the Schizophrenic trait, which might make the game seem buggy.\n\
\n\
Q: How can I prevent monsters from attacking while I sleep?\n\
A: Find a safe place to sleep, in a building far from the front door. Set\n\
traps if you have them, or build a fire.");
A: Find a safe place to sleep, in a building far from the front door.\n\
Set traps if you have them, or build a fire.");
wrefresh(w_help);
refresh();
@@ -843,40 +952,49 @@ A: Find a safe place to sleep, in a building far from the front door. Set\n\
Q: Why do I always sink when I try to swim?\n\
A: Your swimming ability is reduced greatly by the weight you are carrying,\n\
and is also adversely affected by the clothing you wear. Until you reach\n\
a high level in the swimming skill, you'll need to drop your equipment and\n\
remove your clothing to swim, making it a last-ditch escape plan.\n\
a high level in the swimming skill, you'll need to drop your equipment \n\
and remove your clothing to swim, making it a last-ditch escape plan.\n\
\n\
Q: How can I cure a fungal infection?\n\
A: At present time, there is only one cure, royal jelly. You can find royal\n\
jelly in the bee hives which dot forests.\n\
\n\
Q: How do I get into science labs?\n\
A: You can enter the front door if you have an ID card by 'e'xamining the\n\
A: You can enter the front door if you have an ID card by %s the\n\
keypad. If you are skilled in computers and have an electrohack, it is\n\
possible to hack the keypad. An EMP blast has a chance to force the doors\n\
open, but it's more likely to break them. You can also sneak in through\n\
the sewers sometimes, or try to smash through the walls with explosions.\n\
\n\
Q: Why does my crafting fail so often?\n\
A: Check the difficulty of the recipe, and the primary skill used; your skill\n\
level should be around one and a half times the difficulty to be confident\n\
that it will succeed.");
A: Check the difficulty of the recipe, and the primary skill used; your\n\
skill level should be around one and a half times the difficulty to\n\
be confident that it will succeed.",
press_x(ACTION_EXAMINE, "examining").c_str());
wrefresh(w_help);
refresh();
getch();
werase(w_help);
mvwprintz(w_help, 0, 0, c_white, "\
Q: Shotguns bring in more zombies than they kill! What's the point?\n\
A: Shotguns are intended for emergency use. If you are cornered, use your\n\
shotgun to escape, then just run from the zombies it attracts.\n\
Q: Why can't I carry anything?\n\
A: At the start of the game you only have the space in your pockets.\n\
A good first goal of many survivors is to find a backpack or pouch to\n\
store things in. (The shelter basement is a good place to check first!)\n\
\n\
Q: The game just told me to quit, and other weird stuff is happening.\n\
A: You have the Schizophrenic trait, which might make the game seem buggy.\n\
Q: Shotguns bring in more zombies than they kill! What's the point?\n\
A: Shotguns are intended for emergency use. If you are cornered, use\n\
your shotgun to escape, then just run from the zombies it attracts.\n\
\n\
Q: Help! I started a fire and now my house is burning down!\n\
A: Fires will spread to nearby flammable tiles if they are able. Lighting a\n\
stop fire in a set-up brazier, wood stove, stone fireplace, or pit will\n\
it from spreading. Fire extinguishers can put out fires that get out\n\
of control.\n\
\n\
Q: I have a question that's not addressed here. How can I get an answer?\n\
A: Email your question to TheDarklingWolf@Gmail.com. I'll answer it for you,\n\
and possibly include it on this list.");
A: Ask the helpful people on the forum at smf.cataclysmdda.com or email\n\
your question to TheDarklingWolf@Gmail.com.");
wrefresh(w_help);
refresh();
Executable → Regular
View File
+120 -86
View File
@@ -17,7 +17,7 @@
#include <sstream>
void iexamine::none (game *g, player *p, map *m, int examx, int examy) {
g->add_msg("That is a %s.", m->tername(examx, examy).c_str());
g->add_msg("That is a %s.", m->name(examx, examy).c_str());
};
void iexamine::gaspump(game *g, player *p, map *m, int examx, int examy) {
@@ -25,35 +25,38 @@ void iexamine::gaspump(game *g, player *p, map *m, int examx, int examy) {
none(g, p, m, examx, examy);
return;
}
item gas(g->itypes["gasoline"], g->turn);
if (one_in(10 + p->dex_cur)) {
g->add_msg("You accidentally spill the gasoline.");
m->add_item(p->posx, p->posy, gas);
} else {
p->moves -= 300;
g->handle_liquid(gas, false, true);
}
if (one_in(10)) {
g->add_msg("With a clang and a shudder, the gas pump goes silent.");
m->ter_set(examx, examy, t_gas_pump_empty);
for (int i = 0; i < m->i_at(examx, examy).size(); i++) {
if (m->i_at(examx, examy)[i].made_of(LIQUID)) {
item* liq = &(m->i_at(examx, examy)[i]);
if (one_in(10 + p->dex_cur)) {
g->add_msg("You accidentally spill the %s.", liq->type->name.c_str());
item spill(liq->type, g->turn);
spill.charges = rng(dynamic_cast<it_ammo*>(liq->type)->count,
dynamic_cast<it_ammo*>(liq->type)->count * (float)(8 / p->dex_cur));
m->add_item_or_charges(p->posx, p->posy, spill, 1);
liq->charges -= spill.charges;
if (liq->charges < 1) {
m->i_at(examx, examy).erase(m->i_at(examx, examy).begin() + i);
}
} else {
p->moves -= 300;
if (g->handle_liquid(*liq, true, false)) {
g->add_msg("With a clang and a shudder, the %s pump goes silent.", liq->type->name.c_str());
m->i_at(examx, examy).erase(m->i_at(examx, examy).begin() + i);
}
}
return;
}
}
g->add_msg("Out of order.");
}
void iexamine::elevator(game *g, player *p, map *m, int examx, int examy){
if (!query_yn("Use the %s?",m->tername(examx, examy).c_str())) return;
int movez = (g->levz < 0 ? 2 : -2);
g->levz += movez;
m->load(g, g->levx, g->levy, g->levz);
g->update_map(p->posx, p->posy);
for (int x = 0; x < SEEX * MAPSIZE; x++) {
for (int y = 0; y < SEEY * MAPSIZE; y++) {
if (m->ter(x, y) == t_elevator) {
p->posx = x;
p->posy = y;
}
}
}
g->refresh_all();
g->vertical_move( movez, false );
}
void iexamine::controls_gate(game *g, player *p, map *m, int examx, int examy) {
@@ -184,21 +187,21 @@ void iexamine::tent(game *g, player *p, map *m, int examx, int examy) {
p->moves -= 200;
for (int i = -1; i <= 1; i++)
for (int j = -1; j <= 1; j++)
m->ter_set(examx + i, examy + j, t_dirt);
m->furn_set(examx + i, examy + j, f_null);
g->add_msg("You take down the tent");
item dropped(g->itypes["tent_kit"], g->turn);
m->add_item(examx, examy, dropped);
}
void iexamine::shelter(game *g, player *p, map *m, int examx, int examy) {
if (!query_yn("Take down %s?",m->tername(examx, examy).c_str())) {
if (!query_yn("Take down %s?",m->furnname(examx, examy).c_str())) {
none(g, p, m, examx, examy);
return;
}
p->moves -= 200;
for (int i = -1; i <= 1; i++)
for (int j = -1; j <= 1; j++)
m->ter_set(examx + i, examy + j, t_dirt);
m->furn_set(examx + i, examy + j, f_null);
g->add_msg("You take down the shelter");
item dropped(g->itypes["shelter_kit"], g->turn);
m->add_item(examx, examy, dropped);
@@ -530,52 +533,64 @@ void iexamine::fswitch(game *g, player *p, map *m, int examx, int examy) {
}
void iexamine::flower_poppy(game *g, player *p, map *m, int examx, int examy) {
if(!query_yn("Pick %s?",m->tername(examx, examy).c_str())) {
none(g, p, m, examx, examy);
return;
}
if(!query_yn("Pick %s?",m->furnname(examx, examy).c_str())) {
none(g, p, m, examx, examy);
return;
}
g->add_msg("This flower has a heady aroma");
if (!(p->is_wearing("mask_filter")||p->is_wearing("mask_gas") ||
one_in(3))) {
g->add_msg("You fall asleep...");
p->add_disease(DI_SLEEP, 1200, g);
g->add_msg("Your legs are covered by flower's roots!");
p->hurt(g,bp_legs, 0, 4);
p->moves-=50;
}
m->ter_set(examx, examy, t_dirt);
m->spawn_item(examx, examy, g->itypes["poppy_flower"],0);
m->spawn_item(examx, examy, g->itypes["poppy_bud"],0);
int resist = p->resist(bp_mouth);
if (resist < 10) {
// Can't smell the flowers with a gas mask on!
g->add_msg("This flower has a heady aroma");
}
if (one_in(3) && resist < 5) {
// Should user player::infect, but can't!
// player::infect needs to be restructured to return a bool indicating success.
g->add_msg("You fall asleep...");
p->add_disease("sleep", 1200);
g->add_msg("Your legs are covered by flower's roots!");
p->hurt(g,bp_legs, 0, 4);
p->moves-=50;
}
m->furn_set(examx, examy, f_null);
m->spawn_item(examx, examy, "poppy_flower", 0);
m->spawn_item(examx, examy, "poppy_bud", 0);
}
void iexamine::pick_plant(game *g, player *p, map *m, int examx, int examy, std::string itemType, int new_ter) {
if (!query_yn("Pick %s?", m->tername(examx, examy).c_str())) {
none(g, p, m, examx, examy);
return;
}
SkillLevel& survival = p->skillLevel("survival");
if (survival < 1)
p->practice(g->turn, "survival", rng(5, 12));
else if (survival < 6)
p->practice(g->turn, "survival", rng(1, 12 / survival));
int num_fruits = rng(1, survival);
if (num_fruits > 12)
num_fruits = 12;
m->spawn_item(examx, examy, itemType, g->turn, num_fruits);
m->ter_set(examx, examy, (ter_id)new_ter);
}
void iexamine::tree_apple(game *g, player *p, map *m, int examx, int examy) {
if(!query_yn("Pick %s?",m->tername(examx, examy).c_str())) return;
int num_apples = rng(1, p->skillLevel("survival"));
if (num_apples >= 12)
num_apples = 12;
for (int i = 0; i < num_apples; i++)
m->spawn_item(examx, examy, g->itypes["apple"], g->turn, 0);
m->ter_set(examx, examy, t_tree);
pick_plant(g, p, m, examx, examy, "apple", t_tree);
}
void iexamine::shrub_blueberry(game *g, player *p, map *m, int examx, int examy) {
if(!query_yn("Pick %s?",m->tername(examx, examy).c_str())) {
none(g, p, m, examx, examy);
return;
}
pick_plant(g, p, m, examx, examy, "blueberries", t_shrub);
}
int num_blueberries = rng(1, p->skillLevel("survival"));
if (num_blueberries >= 12)
num_blueberries = 12;
for (int i = 0; i < num_blueberries; i++)
m->spawn_item(examx, examy, g->itypes["blueberries"], g->turn, 0);
m->ter_set(examx, examy, t_shrub);
void iexamine::shrub_strawberry(game *g, player *p, map *m, int examx, int examy) {
pick_plant(g, p, m, examx, examy, "strawberries", t_shrub);
}
void iexamine::shrub_wildveggies(game *g, player *p, map *m, int examx, int examy) {
@@ -615,7 +630,7 @@ void iexamine::recycler(game *g, player *p, map *m, int examx, int examy) {
for (int i = 0; i < m->i_at(examx, examy).size(); i++)
{
item *it = &(m->i_at(examx, examy)[i]);
if (it->made_of(STEEL))
if (it->made_of("steel"))
steel_weight += it->weight();
m->i_at(examx, examy).erase(m->i_at(examx, examy).begin() + i);
i--;
@@ -633,16 +648,21 @@ void iexamine::recycler(game *g, player *p, map *m, int examx, int examy) {
g->sound(examx, examy, 80, "Ka-klunk!");
int lump_weight = item_controller->find_template("steel_lump")->weight;
int sheet_weight = item_controller->find_template("sheet_metal")->weight;
int chunk_weight = item_controller->find_template("steel_chunk")->weight;
int scrap_weight = item_controller->find_template("scrap")->weight;
switch(ch)
{
case 1: // 1 steel lump = weight 80
num_lumps = steel_weight / (item_controller->find_template("steel_lump")->weight);
steel_weight -= num_lumps * (item_controller->find_template("steel_lump")->weight);
num_sheets = steel_weight / (item_controller->find_template("sheet_metal")->weight);
steel_weight -= num_sheets * (item_controller->find_template("sheet_metal")->weight);
num_chunks = steel_weight / (item_controller->find_template("steel_chunk")->weight);
steel_weight -= num_chunks * (item_controller->find_template("steel_chunk")->weight);
num_scraps = steel_weight / (item_controller->find_template("scrap")->weight);
num_lumps = steel_weight / (lump_weight);
steel_weight -= num_lumps * (lump_weight);
num_sheets = steel_weight / (sheet_weight);
steel_weight -= num_sheets * (sheet_weight);
num_chunks = steel_weight / (chunk_weight);
steel_weight -= num_chunks * (chunk_weight);
num_scraps = steel_weight / (scrap_weight);
if (num_lumps == 0)
{
g->add_msg("The recycler beeps: \"Insufficient steel!\"");
@@ -651,11 +671,11 @@ void iexamine::recycler(game *g, player *p, map *m, int examx, int examy) {
break;
case 2: // 1 metal sheet = weight 20
num_sheets = steel_weight / (item_controller->find_template("sheet_metal")->weight);
steel_weight -= num_sheets * (item_controller->find_template("sheet_metal")->weight);
num_chunks = steel_weight / (item_controller->find_template("steel_chunk")->weight);
steel_weight -= num_chunks * (item_controller->find_template("sheet_chunk")->weight);
num_scraps = steel_weight / (item_controller->find_template("scrap")->weight);
num_sheets = steel_weight / (sheet_weight);
steel_weight -= num_sheets * (sheet_weight);
num_chunks = steel_weight / (chunk_weight);
steel_weight -= num_chunks * (chunk_weight);
num_scraps = steel_weight / (scrap_weight);
if (num_sheets == 0)
{
g->add_msg("The recycler beeps: \"Insufficient steel!\"");
@@ -664,9 +684,9 @@ void iexamine::recycler(game *g, player *p, map *m, int examx, int examy) {
break;
case 3: // 1 steel chunk = weight 6
num_chunks = steel_weight / (item_controller->find_template("steel_chunk")->weight);
steel_weight -= num_chunks * (item_controller->find_template("steel_chunk")->weight);
num_scraps = steel_weight / (item_controller->find_template("scrap")->weight);
num_chunks = steel_weight / (chunk_weight);
steel_weight -= num_chunks * (chunk_weight);
num_scraps = steel_weight / (scrap_weight);
if (num_chunks == 0)
{
g->add_msg("The recycler beeps: \"Insufficient steel!\"");
@@ -675,28 +695,28 @@ void iexamine::recycler(game *g, player *p, map *m, int examx, int examy) {
break;
case 4: // 1 metal scrap = weight 1
num_scraps = steel_weight / (item_controller->find_template("scrap")->weight);
num_scraps = steel_weight / (scrap_weight);
break;
}
for (int i = 0; i < num_lumps; i++)
{
m->spawn_item(p->posx, p->posy, item_controller->find_template("steel_lump"), 0);
m->spawn_item(p->posx, p->posy, "steel_lump", 0);
}
for (int i = 0; i < num_sheets; i++)
{
m->spawn_item(p->posx, p->posy, item_controller->find_template("sheet_metal"), 0);
m->spawn_item(p->posx, p->posy, "sheet_metal", 0);
}
for (int i = 0; i < num_chunks; i++)
{
m->spawn_item(p->posx, p->posy, item_controller->find_template("steel_chunk"), 0);
m->spawn_item(p->posx, p->posy, "steel_chunk", 0);
}
for (int i = 0; i < num_scraps; i++)
{
m->spawn_item(p->posx, p->posy, item_controller->find_template("scrap"), 0);
m->spawn_item(p->posx, p->posy, "scrap", 0);
}
}
@@ -713,6 +733,11 @@ void iexamine::trap(game *g, player *p, map *m, int examx, int examy) {
{
water_source(g, p, m, examx, examy);
}
else if (m->tr_at(examx, examy) == tr_funnel && m->is_outside(examx, examy) &&
(g->weather == WEATHER_ACID_DRIZZLE || g->weather == WEATHER_ACID_RAIN))
{
acid_source(g, p, m, examx, examy);
}
}
void iexamine::water_source(game *g, player *p, map *m, const int examx, const int examy)
@@ -732,3 +757,12 @@ void iexamine::water_source(game *g, player *p, map *m, const int examx, const i
p->moves -= 350;
}
}
void iexamine::acid_source(game *g, player *p, map *m, const int examx, const int examy)
{
item acid = m->acid_from(examx, examy);
if (g->handle_liquid(acid, true, true))
{
p->moves -= 100;
}
}
+3
View File
@@ -42,12 +42,15 @@ public:
void pedestal_temple (game *g, player *p, map *m, int examx, int examy);
void fswitch (game *g, player *p, map *m, int examx, int examy);
void flower_poppy (game *g, player *p, map *m, int examx, int examy);
void pick_plant(game *g, player *p, map *m, int examx, int examy, std::string itemType, int new_ter);
void tree_apple (game *g, player *p, map *m, int examx, int examy);
void shrub_blueberry (game *g, player *p, map *m, int examx, int examy);
void shrub_strawberry (game *g, player *p, map *m, int examx, int examy);
void shrub_wildveggies (game *g, player *p, map *m, int examx, int examy);
void recycler (game *g, player *p, map *m, int examx, int examy);
void trap(game *g, player *p, map *m, int examx, int examy);
void water_source (game *g, player *p, map *m, const int examx, const int examy);
void acid_source (game *g, player *p, map *m, const int examx, const int examy);
};
#endif /* defined(__Cataclysmic__iexamine__) */
+54 -26
View File
@@ -242,7 +242,7 @@ inventory inventory::filter_by_category(item_cat cat, const player& u) const
case IC_CONTAINER: // containers for liquid handling
if (it.is_tool() || it.is_gun())
{
if (it.ammo_type() == AT_GAS)
if (it.ammo_type() == "gasoline")
{
reduced_inv += *iter;
}
@@ -318,7 +318,7 @@ item& inventory::add_item(item newit, bool keep_invlet)
}
else if (it_ref->stacks_with(newit))
{
if (it_ref->is_food() && it_ref->has_flag(IF_HOT))
if (it_ref->is_food() && it_ref->has_flag("HOT"))
{
int tmpcounter = (it_ref->item_counter + newit.item_counter) / 2;
it_ref->item_counter = tmpcounter;
@@ -448,17 +448,20 @@ void inventory::form_from_map(game *g, point origin, int range)
items.clear();
for (int x = origin.x - range; x <= origin.x + range; x++) {
for (int y = origin.y - range; y <= origin.y + range; y++) {
if (g->m.has_flag(sealed, x, y))
continue;
for (int i = 0; i < g->m.i_at(x, y).size(); i++)
if (!g->m.i_at(x, y)[i].made_of(LIQUID))
add_item(g->m.i_at(x, y)[i]);
// Kludges for now!
if (g->m.field_at(x, y).type == fd_fire) {
ter_id terrain_id = g->m.ter(x, y);
furn_id furniture_id = g->m.furn(x, y);
if ((g->m.field_at(x, y).findField(fd_fire)) || (terrain_id == t_lava)) {
item fire(g->itypes["fire"], 0);
fire.charges = 1;
add_item(fire);
}
ter_id terrain_id = g->m.ter(x, y);
if (terrain_id == t_toilet || terrain_id == t_water_sh || terrain_id == t_water_dp){
if (furniture_id == f_toilet || terrain_id == t_water_sh || terrain_id == t_water_dp){
item water(g->itypes["water"], 0);
water.charges = 50;
add_item(water);
@@ -472,11 +475,11 @@ void inventory::form_from_map(game *g, point origin, int range)
if (kpart >= 0) {
item hotplate(g->itypes["hotplate"], 0);
hotplate.charges = veh->fuel_left(AT_BATT, true);
hotplate.charges = veh->fuel_left("battery", true);
add_item(hotplate);
item water(g->itypes["water_clean"], 0);
water.charges = veh->fuel_left(AT_WATER);
water.charges = veh->fuel_left("water");
add_item(water);
item pot(g->itypes["pot"], 0);
@@ -650,14 +653,14 @@ std::vector<item> inventory::remove_mission_items(int mission_id)
return ret;
}
void inventory::dump(std::vector<item>& dest) const
void inventory::dump(std::vector<item *>& dest)
{
for (invstack::const_iterator iter = items.begin(); iter != items.end(); ++iter)
for (invstack::iterator iter = items.begin(); iter != items.end(); ++iter)
{
for (std::list<item>::const_iterator stack_iter = iter->begin();
for (std::list<item>::iterator stack_iter = iter->begin();
stack_iter != iter->end(); ++stack_iter)
{
dest.push_back(*stack_iter);
dest.push_back(&(*stack_iter));
}
}
}
@@ -743,7 +746,7 @@ std::vector<item*> inventory::all_ammo(ammotype type)
}
// Handle gasoline nested in containers
else if (type == AT_GAS && stack_iter->is_container() &&
else if (type == "gasoline" && stack_iter->is_container() &&
!stack_iter->contents.empty() && stack_iter->contents[0].is_ammo() &&
dynamic_cast<it_ammo*>(stack_iter->contents[0].type)->type == type)
{
@@ -830,8 +833,10 @@ int inventory::charges_of(itype_id it) const
return count;
}
void inventory::use_amount(itype_id it, int quantity, bool use_container)
std::list<item> inventory::use_amount(itype_id it, int quantity, bool use_container)
{
sort();
std::list<item> ret;
for (invstack::iterator iter = items.begin(); iter != items.end() && quantity > 0; ++iter)
{
for (std::list<item>::iterator stack_iter = iter->begin();
@@ -844,6 +849,7 @@ void inventory::use_amount(itype_id it, int quantity, bool use_container)
{
if (stack_iter->contents[k].type->id == it)
{
ret.push_back(stack_iter->contents[k]);
quantity--;
stack_iter->contents.erase(stack_iter->contents.begin() + k);
k--;
@@ -854,31 +860,42 @@ void inventory::use_amount(itype_id it, int quantity, bool use_container)
if (use_container && used_item_contents)
{
stack_iter = iter->erase(stack_iter);
--stack_iter;
if (iter->empty())
{
iter = items.erase(iter);
--iter;
stack_iter = iter->begin();
break;
}
else
{
--stack_iter;
}
}
else if (stack_iter->type->id == it && quantity > 0)
{
ret.push_back(*stack_iter);
quantity--;
stack_iter = iter->erase(stack_iter);
--stack_iter;
if (iter->empty())
{
iter = items.erase(iter);
--iter;
break;
}
else
{
--stack_iter;
}
}
}
}
return ret;
}
void inventory::use_charges(itype_id it, int quantity)
std::list<item> inventory::use_charges(itype_id it, int quantity)
{
sort();
std::list<item> ret;
for (invstack::iterator iter = items.begin(); iter != items.end() && quantity > 0; ++iter)
{
for (std::list<item>::iterator stack_iter = iter->begin();
@@ -892,6 +909,7 @@ void inventory::use_charges(itype_id it, int quantity)
{
if (stack_iter->contents[k].charges <= quantity)
{
ret.push_back(stack_iter->contents[k]);
quantity -= stack_iter->contents[k].charges;
if (stack_iter->contents[k].destroyed_at_zero_charges())
{
@@ -905,8 +923,11 @@ void inventory::use_charges(itype_id it, int quantity)
}
else
{
item tmp = stack_iter->contents[k];
tmp.charges = quantity;
ret.push_back(tmp);
stack_iter->contents[k].charges -= quantity;
return;
return ret;
}
}
}
@@ -916,17 +937,21 @@ void inventory::use_charges(itype_id it, int quantity)
{
if (stack_iter->charges <= quantity)
{
ret.push_back(*stack_iter);
quantity -= stack_iter->charges;
if (stack_iter->destroyed_at_zero_charges())
{
stack_iter = iter->erase(stack_iter);
--stack_iter;
if (iter->empty())
{
iter = items.erase(iter);
--iter;
break;
}
else
{
--stack_iter;
}
}
else
{
@@ -935,12 +960,16 @@ void inventory::use_charges(itype_id it, int quantity)
}
else
{
item tmp = *stack_iter;
tmp.charges = quantity;
ret.push_back(tmp);
stack_iter->charges -= quantity;
return;
return ret;
}
}
}
}
return ret;
}
bool inventory::has_amount(itype_id it, int quantity) const
@@ -1037,7 +1066,7 @@ int inventory::butcher_factor() const
++stack_iter)
{
const item& cur_item = *stack_iter;
if (cur_item.damage_cut() >= 10 && !cur_item.has_flag(IF_SPEAR))
if (cur_item.damage_cut() >= 10 && !cur_item.has_flag("SPEAR"))
{
int factor = cur_item.volume() * 5 - cur_item.weight() * 1.5 -
cur_item.damage_cut();
@@ -1128,8 +1157,7 @@ item& inventory::watertight_container()
item& it = iter->front();
if (it.is_container() && it.contents.empty())
{
it_container* cont = dynamic_cast<it_container*>(it.type);
if (cont->flags & mfb(con_wtight) && cont->flags & mfb(con_seals))
if (it.has_flag("WATERTIGHT") && it.has_flag("SEALS"))
{
return it;
}
@@ -1206,13 +1234,13 @@ item& inventory::most_appropriate_painkiller(int pain)
return ret;
}
item& inventory::best_for_melee(int skills[num_skill_types])
item& inventory::best_for_melee(player *p)
{
item& ret = nullitem;
int best = 0;
for (invstack::iterator iter = items.begin(); iter != items.end(); ++iter)
{
int score = iter->front().melee_value(skills);
int score = iter->front().melee_value(p);
if (score > best)
{
best = score;
@@ -1245,7 +1273,7 @@ void inventory::rust_iron_items()
stack_iter != iter->end();
++stack_iter)
{
if (stack_iter->type->m1 == IRON && stack_iter->damage < 5 && one_in(8))
if (stack_iter->type->m1 == "iron" && stack_iter->damage < 5 && one_in(8))
{
stack_iter->damage++;
}
+4 -4
View File
@@ -76,8 +76,8 @@ class inventory
int amount_of (itype_id it) const;
int charges_of(itype_id it) const;
void use_amount (itype_id it, int quantity, bool use_container = false);
void use_charges(itype_id it, int quantity);
std::list<item> use_amount (itype_id it, int quantity, bool use_container = false);
std::list<item> use_charges(itype_id it, int quantity);
bool has_amount (itype_id it, int quantity) const;
bool has_charges(itype_id it, int quantity) const;
@@ -95,7 +95,7 @@ class inventory
int worst_item_value(npc* p) const;
bool has_enough_painkiller(int pain) const;
item& most_appropriate_painkiller(int pain);
item& best_for_melee(int skills[num_skill_types]);
item& best_for_melee(player *p);
item& most_loaded_gun();
void rust_iron_items();
@@ -104,7 +104,7 @@ class inventory
int volume() const;
int max_active_item_charges(itype_id id) const;
void dump(std::vector<item>& dest) const; // dumps contents into dest (does not delete contents)
void dump(std::vector<item*>& dest); // dumps contents into dest (does not delete contents)
// vector rather than list because it's NOT an item stack
std::vector<item*> active_items();
+316 -127
View File
@@ -1,6 +1,8 @@
#include "game.h"
#include "output.h"
#include "uistate.h"
#include "keypress.h"
#include "translations.h"
#include <string>
#include <vector>
#include <map>
@@ -9,8 +11,9 @@
const int iCategorieNum = 11;
std::string CATEGORIES[iCategorieNum] =
{"GROUND:", "FIREARMS:", "AMMUNITION:", "CLOTHING:", "FOOD/DRINKS:",
"TOOLS:", "BOOKS:", "WEAPONS:", "MODS/BIONICS", "MEDICINE/DRUGS", "OTHER:"};
{_("GROUND:"), _("FIREARMS:"), _("AMMUNITION:"), _("CLOTHING:"),
_("FOOD/DRINKS:"), _("TOOLS:"), _("BOOKS:"), _("WEAPONS:"),
_("MODS/BIONICS"), _("MEDICINE/DRUGS"), _("OTHER:")};
//TODO: make this function not have issues with items that are classed as multiple things
std::vector<int> find_firsts(invslice &slice)
@@ -56,7 +59,7 @@ std::vector<int> find_firsts(invslice &slice)
void print_inv_weight_vol(game *g, WINDOW* w_inv, int weight_carried, int vol_carried)
{
// Print weight
mvwprintw(w_inv, 0, 43, "Weight: ");
mvwprintw(w_inv, 0, 43, _("Weight: "));
if (weight_carried >= g->u.weight_capacity() * .25)
{
wprintz(w_inv, c_red, "%4d", weight_carried);
@@ -68,7 +71,7 @@ void print_inv_weight_vol(game *g, WINDOW* w_inv, int weight_carried, int vol_ca
wprintz(w_inv, c_ltgray, "/%-4d", int(g->u.weight_capacity() * .25));//, g->u.weight_capacity());
// Print volume
mvwprintw(w_inv, 0, 61, "Volume: ");
mvwprintw(w_inv, 0, 61, _("Volume: "));
if (vol_carried > g->u.volume_capacity() - 2)
{
wprintz(w_inv, c_red, "%3d", vol_carried);
@@ -90,7 +93,7 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
// Print our weapon
int n_items = 0;
mvwprintz(w_inv, 2, 45, c_magenta, "WEAPON:");
mvwprintz(w_inv, 2, 45, c_magenta, _("WEAPON:"));
int dropping_weapon = false;
for (int i = 0; i < dropped_items.size() && !dropping_weapon; i++) {
if (dropped_items[i] == g->u.weapon.invlet)
@@ -112,7 +115,7 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
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:");
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;
@@ -133,16 +136,16 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
invlet != inv_chars.end(); invlet++) {
n_items += ((g->u.inv.item_by_letter(*invlet).is_null()) ? 0 : 1);
}
mvwprintw(w_inv, 1, 62, "Items: %d/%d ", n_items, inv_chars.size());
mvwprintw(w_inv, 1, 62, _("Items: %d/%d "), n_items, inv_chars.size());
}
// Display current inventory.
char game::inv(std::string title)
{
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? FULL_SCREEN_WIDTH : 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 ch = (int)'.';
int start = 0, cur_it;
int start = 0, cur_it, max_it;
u.inv.sort();
u.inv.restack(&u);
invslice slice = u.inv.slice(0, u.inv.size());
@@ -150,8 +153,13 @@ char game::inv(std::string title)
print_inv_statics(this, w_inv, title, null_vector);
// Gun, ammo, weapon, armor, food, tool, book, other
std::vector<int> firsts = find_firsts(slice);
int selected=-1;
int selected_char=(int)' ';
if( uistate.last_inv_start >= 0 ) start = uistate.last_inv_start;
if( uistate.last_inv_sel >= 0 ) selected = uistate.last_inv_sel;
do {
selected_char=(int)' ';
if (( ch == '<' || ch == KEY_PPAGE ) && start > 0) { // Clear lines and shift
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
@@ -159,28 +167,32 @@ char game::inv(std::string title)
if (start < 0)
start = 0;
mvwprintw(w_inv, maxitems + 4, 0, " ");
if ( selected > -1 ) selected = start; // oy, the cheese
}
if ((ch == '>' || ch == KEY_NPAGE ) && cur_it < u.inv.size()) { // Clear lines and shift
start = cur_it;
mvwprintw(w_inv, maxitems + 4, 12, " ");
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
if ( selected < start && selected > -1 ) selected = start;
}
int cur_line = 2;
max_it = 0;
for (cur_it = start; cur_it < start + maxitems && cur_line < maxitems+3; cur_it++) {
// Clear the current line;
mvwprintw(w_inv, cur_line, 0, " ");
// Print category header
for (int i = 1; i < iCategorieNum; i++) {
if (cur_it == firsts[i-1]) {
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
mvwprintz(w_inv, cur_line, 0, c_magenta, _(CATEGORIES[i].c_str()));
cur_line++;
}
}
if (cur_it < slice.size()) {
item& it = slice[cur_it]->front();
mvwputch (w_inv, cur_line, 0, c_white, it.invlet);
mvwprintz(w_inv, cur_line, 1, it.color_in_inventory(&u), " %s",
if(cur_it==selected) selected_char=(int)it.invlet;
mvwputch (w_inv, cur_line, 0, (cur_it == selected ? h_white : c_white), it.invlet);
mvwprintz(w_inv, cur_line, 1, (cur_it == selected ? h_white : it.color_in_inventory(&u) ), " %s",
it.tname(this).c_str());
if (slice[cur_it]->size() > 1)
wprintw(w_inv, " [%d]", slice[cur_it]->size());
@@ -189,16 +201,53 @@ char game::inv(std::string title)
else if (it.contents.size() == 1 &&
it.contents[0].charges > 0)
wprintw(w_inv, " (%d)", it.contents[0].charges);
max_it=cur_it;
}
cur_line++;
}
if (start > 0)
mvwprintw(w_inv, maxitems + 4, 0, "< Go Back");
mvwprintw(w_inv, maxitems + 4, 0, _("< Go Back"));
if (cur_it < u.inv.size())
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
mvwprintw(w_inv, maxitems + 4, 12, _("> More items"));
wrefresh(w_inv);
ch = getch();
} while (ch == '<' || ch == '>' || ch == KEY_NPAGE || ch == KEY_PPAGE );
if ( ch == KEY_DOWN ) {
if ( selected < 0 ) {
selected = start;
} else {
selected++;
}
if ( selected > max_it ) {
if( cur_it < u.inv.size() ) {
ch='>';
} else {
selected = u.inv.size() - 1; // wraparound?
}
}
} else if ( ch == KEY_UP ) {
selected--;
if ( selected < -1 ) {
selected = -1; // wraparound?
} else if ( selected < start ) {
if ( start > 0 ) {
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
start -= maxitems;
if (start < 0)
start = 0;
mvwprintw(w_inv, maxitems + 4, 0, " ");
}
}
} else if ( ch == '\n' || ch == KEY_RIGHT ) {
// if ( uistate.last_inv_start > -2 && uistate.last_inv_sel > -2 ) {
uistate.last_inv_start=start;
uistate.last_inv_sel=selected;
// }
ch = selected_char;
}
} while (ch == '<' || ch == '>' || ch == KEY_NPAGE || ch == KEY_PPAGE || ch == KEY_UP || ch == KEY_DOWN );
werase(w_inv);
delwin(w_inv);
erase();
@@ -211,10 +260,10 @@ char game::inv_type(std::string title, item_cat inv_item_type)
// this function lists inventory objects by type
// refer to enum item_cat in itype.h for list of categories
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? FULL_SCREEN_WIDTH : 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 ch = (int)'.';
int start = 0, cur_it;
int start = 0, cur_it, max_it;
u.inv.sort();
u.inv.restack(&u);
std::vector<char> null_vector;
@@ -227,6 +276,8 @@ char game::inv_type(std::string title, item_cat inv_item_type)
invslice slice = reduced_inv.slice(0, reduced_inv.size());
std::vector<int> firsts = find_firsts(slice);
int selected=-1;
int selected_char=(int)' ';
do {
if (( ch == '<' || ch == KEY_PPAGE ) && start > 0) { // Clear lines and shift
for (int i = 1; i < maxitems+4; i++)
@@ -235,21 +286,24 @@ char game::inv_type(std::string title, item_cat inv_item_type)
if (start < 0)
start = 0;
mvwprintw(w_inv, maxitems + 4, 0, " ");
if ( selected > -1 ) selected = start; // oy, the cheese
}
if (( ch == '>' || ch == KEY_NPAGE ) && cur_it < reduced_inv.size()) { // Clear lines and shift
start = cur_it;
mvwprintw(w_inv, maxitems + 4, 12, " ");
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
if ( selected < start && selected > -1 ) selected = start;
}
int cur_line = 2;
max_it = 0;
for (cur_it = start; cur_it < start + maxitems && cur_line < maxitems+3; cur_it++) {
// Clear the current line;
mvwprintw(w_inv, cur_line, 0, " ");
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());
mvwprintz(w_inv, cur_line, 0, c_magenta, _(CATEGORIES[i].c_str()));
cur_line++;
}
}
@@ -257,8 +311,9 @@ char game::inv_type(std::string title, item_cat inv_item_type)
if (cur_it < slice.size())
{
item& it = slice[cur_it]->front();
mvwputch (w_inv, cur_line, 0, c_white, it.invlet);
mvwprintz(w_inv, cur_line, 1, it.color_in_inventory(&u), " %s",
if(cur_it==selected) selected_char=(int)it.invlet;
mvwputch (w_inv, cur_line, 0, (cur_it == selected ? h_white : c_white), it.invlet);
mvwprintz(w_inv, cur_line, 1, (cur_it == selected ? h_white : it.color_in_inventory(&u) ), " %s",
it.tname(this).c_str());
if (slice[cur_it]->size() > 1)
wprintw(w_inv, " [%d]", slice[cur_it]->size());
@@ -267,17 +322,51 @@ char game::inv_type(std::string title, item_cat inv_item_type)
else if (it.contents.size() == 1 &&
it.contents[0].charges > 0)
wprintw(w_inv, " (%d)", it.contents[0].charges);
cur_line++;
cur_line++;
max_it=cur_it;
}
// cur_line++;
}
if (start > 0)
mvwprintw(w_inv, maxitems + 4, 0, "< Go Back");
mvwprintw(w_inv, maxitems + 4, 0, _("< Go Back"));
if (cur_it < reduced_inv.size())
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
mvwprintw(w_inv, maxitems + 4, 12, _("> More items"));
wrefresh(w_inv);
ch = getch();
} while (ch == '<' || ch == '>' || ch == KEY_NPAGE || ch == KEY_PPAGE );
if ( ch == KEY_DOWN ) {
if ( selected < 0 ) {
selected = start;
} else {
selected++;
}
if ( selected > max_it ) {
if( cur_it < u.inv.size() ) {
ch='>';
} else {
selected = u.inv.size() - 1; // wraparound?
}
}
} else if ( ch == KEY_UP ) {
selected--;
if ( selected < -1 ) {
selected = -1; // wraparound?
} else if ( selected < start ) {
if ( start > 0 ) {
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
start -= maxitems;
if (start < 0)
start = 0;
mvwprintw(w_inv, maxitems + 4, 0, " ");
}
}
} else if ( ch == '\n' || ch == KEY_RIGHT ) {
ch = selected_char;
}
} while (ch == '<' || ch == '>' || ch == KEY_NPAGE || ch == KEY_PPAGE || ch == KEY_UP || ch == KEY_DOWN );
werase(w_inv);
delwin(w_inv);
erase();
@@ -289,20 +378,24 @@ std::vector<item> game::multidrop()
{
u.inv.sort();
u.inv.restack(&u);
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? 80 : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
WINDOW* w_inv = newwin(((VIEWY < 12) ? 25 : VIEWY*2+1), ((VIEWX < 12) ? FULL_SCREEN_WIDTH : VIEWX*2+56), VIEW_OFFSET_Y, VIEW_OFFSET_X);
int drp_line_width=getmaxx(w_inv)-90;
const std::string drp_line_padding = ( drp_line_width > 1 ? std::string(drp_line_width, ' ') : " ");
const int maxitems = (VIEWY < 12) ? 20 : VIEWY*2-4; // Number of items to show at one time.
std::map<char, int> dropping; // Count of how many we'll drop from each stack
int count = 0; // The current count
std::vector<char> weapon_and_armor; // Always single, not counted
bool warned_about_bionic = false; // Printed add_msg re: dropping bionics
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
print_inv_statics(this, w_inv, _("Multidrop:"), weapon_and_armor);
int base_weight = u.weight_carried();
int base_volume = u.volume_carried();
int ch = (int)'.';
int start = 0, cur_it;
int start = 0, cur_it, max_it;
invslice stacks = u.inv.slice(0, u.inv.size());
std::vector<int> firsts = find_firsts(stacks);
int selected=-1;
int selected_char=(int)' ';
do {
inventory drop_subset = u.inv.subset(dropping);
int new_weight = base_weight - drop_subset.weight();
@@ -311,40 +404,69 @@ std::vector<item> game::multidrop()
new_weight -= u.i_at(weapon_and_armor[i]).weight();
}
print_inv_weight_vol(this, w_inv, new_weight, new_volume);
if (( ch == '<' || ch == KEY_PPAGE ) && start > 0) {
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
start -= maxitems;
if (start < 0)
start = 0;
mvwprintw(w_inv, maxitems + 4, 0, " ");
}
if (( ch == '>' || ch == KEY_NPAGE ) && cur_it < u.inv.size()) {
start = cur_it;
mvwprintw(w_inv, maxitems + 4, 12, " ");
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
}
int cur_line = 2;
max_it = 0;
int drp_line = 1;
// Print weapon to be dropped, the first position is reserved for high visibility
mvwprintw(w_inv, 0, 90, "%s", drp_line_padding.c_str());
bool dropping_w = false;
for (int k = 0; k < weapon_and_armor.size() && !dropping_w; k++) {
if (weapon_and_armor[k] == u.weapon.invlet) {
dropping_w = true;
}
if (dropping_w && u.is_armed()) {
mvwprintz(w_inv, 0, 90, c_ltblue, "%c + %s", u.weapon.invlet, u.weapname().c_str());
}
}
// Print worn items to be dropped
if(dropping_w) {
mvwprintw(w_inv, drp_line, 90, "%s", drp_line_padding.c_str());
drp_line++;
}
bool dropping_a = false;
if (u.worn.size() > 0){
for (int k = 0; k < u.worn.size(); k++) {
bool dropping_w = false;
for (int j = 0; j < weapon_and_armor.size() && !dropping_w; j++) {
if (weapon_and_armor[j] == u.worn[k].invlet) {
dropping_w = true;
dropping_a = true;
mvwprintw(w_inv, drp_line, 90, "%s", drp_line_padding.c_str());
mvwprintz(w_inv, drp_line, 90, c_cyan, "%c + %s", u.worn[k].invlet, u.worn[k].tname(this).c_str());
drp_line++;
}
}
}
}
if(dropping_a) {
mvwprintw(w_inv, drp_line, 90, "%s", drp_line_padding.c_str());
drp_line++;
}
for (cur_it = start; cur_it < start + maxitems && cur_line < maxitems+3; cur_it++) {
// Clear the current line;
mvwprintw(w_inv, cur_line, 0, " ");
mvwprintw(w_inv, drp_line, 90, "%s", drp_line_padding.c_str());
mvwprintw(w_inv, drp_line + 1, 90, "%s", drp_line_padding.c_str());
// Print category header
for (int i = 1; i < iCategorieNum; i++) {
if (cur_it == firsts[i-1]) {
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
mvwprintz(w_inv, cur_line, 0, c_magenta, _(CATEGORIES[i].c_str()));
cur_line++;
}
}
if ( selected < start && selected > -1 ) selected = start;
if (cur_it < stacks.size()) {
item& it = stacks[cur_it]->front();
mvwputch (w_inv, cur_line, 0, c_white, it.invlet);
if(cur_it==selected) selected_char=(int)it.invlet;
mvwputch (w_inv, cur_line, 0, (cur_it == selected ? h_white : c_white), it.invlet);
char icon = '-';
if (dropping[it.invlet] >= (it.count_by_charges() ? it.charges : stacks[cur_it]->size()))
icon = '+';
else if (dropping[it.invlet] > 0)
icon = '#';
nc_color col = (dropping[it.invlet] == 0 ? c_ltgray : c_white);
nc_color col = ( cur_it == selected ? h_white : (dropping[it.invlet] == 0 ? c_ltgray : c_white ) );
mvwprintz(w_inv, cur_line, 1, col, " %c %s", icon,
it.tname(this).c_str());
if (stacks[cur_it]->size() > 1)
@@ -354,76 +476,146 @@ std::vector<item> game::multidrop()
else if (it.contents.size() == 1 &&
it.contents[0].charges > 0)
wprintw(w_inv, " (%d)", it.contents[0].charges);
if (icon=='+'||icon=='#') {
mvwprintz(w_inv, drp_line, 90, col, "%c %c %s", it.invlet, icon, it.tname(this).c_str());
if (icon=='+'){
if (stacks[cur_it]->size() > 1)
wprintz(w_inv, col, " [%d]", stacks[cur_it]->size());
if (it.charges > 0)
wprintz(w_inv, col, " (%d)", it.charges);
}
if (icon=='#') {
wprintz(w_inv, col, " {%d}", dropping[it.invlet]);
}
drp_line++;
}
}
cur_line++;
max_it=cur_it;
}
if (start > 0)
mvwprintw(w_inv, maxitems + 4, 0, "< Go Back");
mvwprintw(w_inv, maxitems + 4, 0, _("< Go Back"));
if (cur_it < u.inv.size())
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
mvwprintw(w_inv, maxitems + 4, 12, _("> More items"));
wrefresh(w_inv);
/* back to (int)getch() as input() mangles arrow keys
ch = input();
if (ch >= '0'&& ch <= '9') {
*/
ch = getch();
if ( ch == '<' || ch == KEY_PPAGE ) {
if( start > 0) {
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
start -= maxitems;
if (start < 0)
start = 0;
mvwprintw(w_inv, maxitems + 4, 0, " ");
if ( selected > -1 ) selected = start; // oy, the cheese
}
} else if ( ch == '>' || ch == KEY_NPAGE ) {
if ( cur_it < u.inv.size()) {
start = cur_it;
mvwprintw(w_inv, maxitems + 4, 12, " ");
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
if ( selected < start && selected > -1 ) selected = start;
}
} else if ( ch == KEY_DOWN ) {
if ( selected < 0 ) {
selected = start;
} else {
selected++;
}
if ( selected > max_it ) {
if( cur_it < u.inv.size() ) {
start = cur_it;
mvwprintw(w_inv, maxitems + 4, 12, " ");
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
} else {
selected = u.inv.size() - 1; // wraparound?
}
}
} else if ( ch == KEY_UP ) {
selected--;
if ( selected < -1 ) {
selected = -1; // wraparound?
} else if ( selected < start ) {
if ( start > 0 ) {
for (int i = 1; i < maxitems+4; i++)
mvwprintz(w_inv, i, 0, c_black, " ");
start -= maxitems;
if (start < 0)
start = 0;
mvwprintw(w_inv, maxitems + 4, 0, " ");
}
}
} else if (ch >= '0'&& ch <= '9') {
ch = (char)ch - '0';
count *= 10;
count += ch;
} else if (u.has_item(ch)) {
item& it = u.inv.item_by_letter(ch);
if (it.is_null()) { // Not from inventory
int found = false;
for (int i = 0; i < weapon_and_armor.size() && !found; i++) {
if (weapon_and_armor[i] == ch) {
weapon_and_armor.erase(weapon_and_armor.begin() + i);
found = true;
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
} else { // todo: reformat and maybe rewrite
if ( ch == '\t' || ch == KEY_RIGHT || ch == KEY_LEFT ) {
ch = selected_char;
}
}
if (!found) {
if ( ch == u.weapon.invlet &&
std::find(unreal_itype_ids.begin(), unreal_itype_ids.end(), u.weapon.type->id) != unreal_itype_ids.end()){
if (!warned_about_bionic)
add_msg("You cannot drop your %s.", u.weapon.tname(this).c_str());
warned_about_bionic = true;
} else {
weapon_and_armor.push_back(ch);
print_inv_statics(this, w_inv, "Multidrop:", weapon_and_armor);
}
}
} else {
int index = -1;
for (int i = 0; i < stacks.size(); ++i) {
if (stacks[i]->front().invlet == it.invlet) {
index = i;
break;
}
}
if (index == -1) {
debugmsg("Inventory got out of sync with inventory slice?");
}
if (count == 0) {
if (it.count_by_charges())
{
if (dropping[it.invlet] == 0)
dropping[it.invlet] = -1;
else
dropping[it.invlet] = 0;
}
else
{
if (dropping[it.invlet] == 0)
dropping[it.invlet] = stacks[index]->size();
else
dropping[it.invlet] = 0;
}
}
if (u.has_item(ch)) {
item& it = u.inv.item_by_letter(ch);
if (it.is_null()) { // Not from inventory
int found = false;
for (int i = 0; i < weapon_and_armor.size() && !found; i++) {
if (weapon_and_armor[i] == ch) {
weapon_and_armor.erase(weapon_and_armor.begin() + i);
found = true;
print_inv_statics(this, w_inv, _("Multidrop:"), weapon_and_armor);
}
}
if (!found) {
if ( ch == u.weapon.invlet &&
std::find(unreal_itype_ids.begin(), unreal_itype_ids.end(), u.weapon.type->id) != unreal_itype_ids.end()){
if (!warned_about_bionic)
add_msg(_("You cannot drop your %s."), u.weapon.tname(this).c_str());
warned_about_bionic = true;
} else {
weapon_and_armor.push_back(ch);
print_inv_statics(this, w_inv, _("Multidrop:"), weapon_and_armor);
}
}
} else {
int index = -1;
for (int i = 0; i < stacks.size(); ++i) {
if (stacks[i]->front().invlet == it.invlet) {
index = i;
break;
}
}
if (index == -1) {
debugmsg("Inventory got out of sync with inventory slice?");
}
if (count == 0) {
if (it.count_by_charges())
{
if (dropping[it.invlet] == 0)
dropping[it.invlet] = -1;
else
dropping[it.invlet] = 0;
}
else
{
if (dropping[it.invlet] == 0)
dropping[it.invlet] = stacks[index]->size();
else
dropping[it.invlet] = 0;
}
}
else if (count >= stacks[index]->size() && !it.count_by_charges())
dropping[it.invlet] = stacks[index]->size();
else
dropping[it.invlet] = count;
else if (count >= stacks[index]->size() && !it.count_by_charges())
dropping[it.invlet] = stacks[index]->size();
else
dropping[it.invlet] = count;
count = 0;
}
count = 0;
}
}
}
} while (ch != '\n' && ch != KEY_ESCAPE && ch != ' ');
werase(w_inv);
@@ -442,13 +634,24 @@ std::vector<item> game::multidrop()
else if (it->second && u.inv.item_by_letter( it->first).count_by_charges()) {
int charges = u.inv.item_by_letter( it->first).charges;// >= it->second ? : it->second;
ret.push_back( u.inv.remove_item_by_charges( it->first, it->second > charges ? charges : it->second));
} else if (it->second)
} else if (it->second)
for (int j = it->second; j > 0; j--)
ret.push_back( u.inv.remove_item_by_letter( it->first));
}
for (int i = 0; i < weapon_and_armor.size(); i++)
ret.push_back(u.i_rem(weapon_and_armor[i]));
{
if (!u.takeoff(this, weapon_and_armor[i], true))
{
continue;
}
// Item could have been dropped after taking it off
if (&u.inv.item_by_letter(weapon_and_armor[i]) != &u.inv.nullitem)
{
ret.push_back(u.i_rem(weapon_and_armor[i]));
}
}
return ret;
}
@@ -456,31 +659,17 @@ std::vector<item> game::multidrop()
void game::compare(int iCompareX, int iCompareY)
{
int examx, examy;
std::vector <item> grounditems;
int ch = (int)'.';
if (iCompareX != -999 && iCompareX != -999) {
examx = iCompareX;
examy = iCompareY;
} else {
mvwprintw(w_terrain, 0, 0, "Compare where? (Direction button)");
wrefresh(w_terrain);
ch = input();
last_action += ch;
if (ch == KEY_ESCAPE || ch == 'q')
return;
if (ch == '\n' || ch == 'I')
ch = '.';
get_direction(this, examx, examy, ch);
if (examx == -2 || examy == -2) {
add_msg("Invalid direction.");
return;
}
examx = u.posx + iCompareX;
examy = u.posy + iCompareY;
} else if (!choose_adjacent("Compare",examx,examy)) {
return;
}
examx += u.posx;
examy += u.posy;
std::vector <item> here = m.i_at(examx, examy);
std::vector <item> grounditems;
//Filter out items with the same name (keep only one of them)
std::map <std::string, bool> dups;
for (int i = 0; i < here.size(); i++) {
@@ -493,7 +682,7 @@ void game::compare(int iCompareX, int iCompareY)
const int groundsize = (grounditems.size() > 10 ? 10 : grounditems.size());
u.inv.sort();
u.inv.restack(&u);
invslice stacks = u.inv.slice(0, u.inv.size());
WINDOW* w_inv = newwin(TERMY-VIEW_OFFSET_Y*2, TERMX-VIEW_OFFSET_X*2, VIEW_OFFSET_Y, VIEW_OFFSET_X);
@@ -540,7 +729,7 @@ void game::compare(int iCompareX, int iCompareY)
// Print category header
for (int i = iHeaderOffset; i < iCategorieNum; i++) {
if (cur_it == firsts[i-iHeaderOffset]) {
mvwprintz(w_inv, cur_line, 0, c_magenta, CATEGORIES[i].c_str());
mvwprintz(w_inv, cur_line, 0, c_magenta, _(CATEGORIES[i].c_str()));
cur_line++;
}
}
@@ -571,9 +760,9 @@ void game::compare(int iCompareX, int iCompareY)
cur_line++;
}
if (start > 0)
mvwprintw(w_inv, maxitems + 4, 0, "< Go Back");
mvwprintw(w_inv, maxitems + 4, 0, _("< Go Back"));
if (cur_it < u.inv.size() + groundsize)
mvwprintw(w_inv, maxitems + 4, 12, "> More items");
mvwprintw(w_inv, maxitems + 4, 12, _("> More items"));
wrefresh(w_inv);
ch = getch();
if (u.has_item(ch)) {
+566 -301
View File
File diff suppressed because it is too large Load Diff
+32 -15
View File
@@ -10,6 +10,10 @@
class player;
class npc;
// Thresholds for radiation dosage for the radiation film badge.
const int rad_dosage_thresholds[] = { 0, 30, 60, 120, 240, 500};
const std::string rad_threshold_colors[] = { "green", "blue", "yellow", "orange", "red", "black"};
struct iteminfo{
public:
std::string sType; //Itemtype
@@ -41,11 +45,12 @@ public:
item(std::string itemdata, game *g);
~item();
void make(itype* it);
void clear(); // cleanup that's required to re-use an item variable
// returns the default container of this item, with this item in it
item in_its_container(std::map<std::string, itype*> *itypes);
nc_color color(player *u);
nc_color color(player *u) const;
nc_color color_in_inventory(player *u);
std::string tname(game *g = NULL); // g needed for rotten-test
void use(player &u);
@@ -54,7 +59,7 @@ public:
// Firearm specifics
int reload_time(player &u);
int clip_size();
int accuracy();
int dispersion();
int gun_damage(bool with_ammo = true);
int noise() const;
int burst_size();
@@ -69,9 +74,9 @@ public:
void load_info(std::string data, game *g);
//std::string info(bool showtext = false); // Formatted for human viewing
std::string info(bool showtext = false);
std::string info(bool showtext, std::vector<iteminfo> *dump);
char symbol();
nc_color color();
std::string info(bool showtext, std::vector<iteminfo> *dump, game *g = NULL, bool debug = false);
char symbol() const;
nc_color color() const;
int price() const;
bool invlet_is_okay();
@@ -84,7 +89,7 @@ public:
int attack_time();
int damage_bash();
int damage_cut() const;
bool has_flag(item_flag f) const;
bool has_flag(std::string f) const;
bool has_technique(technique_id t, player *p = NULL);
int has_gunmod(itype_id type);
item* active_gunmod();
@@ -95,17 +100,26 @@ public:
bool craft_has_charges();
int num_charges();
bool rotten(game *g);
bool ready_to_revive(game *g); // used for corpses
// Our value as a weapon, given particular skills
int weapon_value(int skills[num_skill_types]) const;
int weapon_value(player *p) const;
// As above, but discounts its use as a ranged weapon
int melee_value (int skills[num_skill_types]);
int melee_value (player *p);
// how resistant item is to bashing and cutting damage
int bash_resist() const;
int cut_resist() const;
// elemental resistances
int acid_resist() const;
// Returns the data associated with tech, if we are an it_style
style_move style_data(technique_id tech);
bool is_two_handed(player *u);
bool made_of(material mat) const;
bool made_of(std::string mat_ident) const;
std::string get_material(int m) const;
bool made_of(phase_id phase) const;
bool conductive(); // Electricity
bool conductive() const; // Electricity
bool flammable() const;
bool destroyed_at_zero_charges();
// Most of the is_whatever() functions call the same function in our itype
bool is_null() const; // True if type is NULL, or points to the null item (id == 0)
@@ -134,7 +148,7 @@ public:
bool is_other() const; // Doesn't belong in other categories
bool is_var_veh_part() const;
bool is_artifact() const;
bool operator<(const item& other) const;
itype_id typeId() const;
@@ -149,19 +163,22 @@ public:
int charges;
bool active; // If true, it has active effects to be processed
signed char damage; // How much damage it's sustained; generally, max is 5
char burnt; // How badly we're burnt
int burnt; // How badly we're burnt
unsigned int bday; // The turn on which it was created
int owned; // UID of NPC owner; 0 = player, -1 = unowned
union{
int poison; // How badly poisoned is it?
int bigness; // engine power, wheel size
int frequency; // Radio frequency
int note; // Associated dynamic text snippet.
int irridation; // Tracks radiation dosage.
};
int mode; // Mode of operation, can be changed by the player.
unsigned item_flags : NUM_ITEM_FLAGS; // generic item specific flags
std::string mode; // Mode of operation, can be changed by the player.
std::set<std::string> item_tags; // generic item specific flags
unsigned item_counter; // generic counter to be used with item flags
int mission_id;// Refers to a mission in game's master list
int player_id; // Only give a mission to the right player!
std::map<std::string, std::string> item_vars;
static itype * nullitem();
item clone();
+108 -243
View File
@@ -3,6 +3,7 @@
#include "enums.h"
#include "catajson.h"
#include "addiction.h"
#include "translations.h"
#include <algorithm>
#include <cstdlib>
#include <iostream>
@@ -20,8 +21,8 @@ Item_factory* item_controller = new Item_factory();
Item_factory::Item_factory(){
init();
m_missing_item = new itype();
m_missing_item->name = "Error: Item Missing.";
m_missing_item->description = "There is only the space where an object should be, but isn't. No item template of this type exists.";
m_missing_item->name = _("Error: Item Missing.");
m_missing_item->description = _("There is only the space where an object should be, but isn't. No item template of this type exists.");
m_templates["MISSING_ITEM"]=m_missing_item;
}
@@ -34,14 +35,11 @@ void Item_factory::init(){
iuse_function_list["ROYAL_JELLY"] = &iuse::royal_jelly;
iuse_function_list["BANDAGE"] = &iuse::bandage;
iuse_function_list["FIRSTAID"] = &iuse::firstaid;
iuse_function_list["DISINFECTANT"] = &iuse::disinfectant;
iuse_function_list["CAFF"] = &iuse::caff;
iuse_function_list["ALCOHOL"] = &iuse::alcohol;
iuse_function_list["ALCOHOL_WEAK"] = &iuse::alcohol_weak;
iuse_function_list["PKILL_1"] = &iuse::pkill_1;
iuse_function_list["PKILL_2"] = &iuse::pkill_2;
iuse_function_list["PKILL_3"] = &iuse::pkill_3;
iuse_function_list["PKILL_4"] = &iuse::pkill_4;
iuse_function_list["PKILL_L"] = &iuse::pkill_l;
iuse_function_list["PKILL"] = &iuse::pkill;
iuse_function_list["XANAX"] = &iuse::xanax;
iuse_function_list["CIG"] = &iuse::cig;
iuse_function_list["ANTIBIOTIC"] = &iuse::antibiotic;
@@ -50,6 +48,8 @@ void Item_factory::init(){
iuse_function_list["CRACK"] = &iuse::crack;
iuse_function_list["GRACK"] = &iuse::grack;
iuse_function_list["METH"] = &iuse::meth;
iuse_function_list["VITAMINS"] = &iuse::vitamins;
iuse_function_list["VACCINE"] = &iuse::vaccine;
iuse_function_list["POISON"] = &iuse::poison;
iuse_function_list["HALLU"] = &iuse::hallu;
iuse_function_list["THORAZINE"] = &iuse::thorazine;
@@ -61,7 +61,6 @@ void Item_factory::init(){
iuse_function_list["INHALER"] = &iuse::inhaler;
iuse_function_list["BLECH"] = &iuse::blech;
iuse_function_list["MUTAGEN"] = &iuse::mutagen;
iuse_function_list["MUTAGEN_3"] = &iuse::mutagen_3;
iuse_function_list["PURIFIER"] = &iuse::purifier;
iuse_function_list["MARLOSS"] = &iuse::marloss;
iuse_function_list["DOGFOOD"] = &iuse::dogfood;
@@ -76,6 +75,8 @@ void Item_factory::init(){
iuse_function_list["HAMMER"] = &iuse::hammer;
iuse_function_list["LIGHT_OFF"] = &iuse::light_off;
iuse_function_list["LIGHT_ON"] = &iuse::light_on;
iuse_function_list["GASOLINE_LANTERN_OFF"] = &iuse::gasoline_lantern_off;
iuse_function_list["GASOLINE_LANTERN_ON"] = &iuse::gasoline_lantern_on;
iuse_function_list["LIGHTSTRIP"] = &iuse::lightstrip;
iuse_function_list["LIGHTSTRIP_ACTIVE"] = &iuse::lightstrip_active;
iuse_function_list["GLOWSTICK"] = &iuse::glowstick;
@@ -83,6 +84,7 @@ void Item_factory::init(){
iuse_function_list["DIRECTIONAL_ANTENNA"] = &iuse::directional_antenna;
iuse_function_list["DEVAC"] = &iuse::devac;
iuse_function_list["CAUTERIZE_ELEC"] = &iuse::cauterize_elec;
iuse_function_list["SOLDER_WELD"] = &iuse::solder_weld;
iuse_function_list["WATER_PURIFIER"] = &iuse::water_purifier;
iuse_function_list["TWO_WAY_RADIO"] = &iuse::two_way_radio;
iuse_function_list["RADIO_OFF"] = &iuse::radio_off;
@@ -97,6 +99,7 @@ void Item_factory::init(){
iuse_function_list["CROWBAR"] = &iuse::crowbar;
iuse_function_list["MAKEMOUND"] = &iuse::makemound;
iuse_function_list["DIG"] = &iuse::dig;
iuse_function_list["SIPHON"] = &iuse::siphon;
iuse_function_list["CHAINSAW_OFF"] = &iuse::chainsaw_off;
iuse_function_list["CHAINSAW_ON"] = &iuse::chainsaw_on;
iuse_function_list["JACKHAMMER"] = &iuse::jackhammer;
@@ -124,6 +127,7 @@ void Item_factory::init(){
iuse_function_list["SMOKEBOMB_ACT"] = &iuse::smokebomb_act;
iuse_function_list["ACIDBOMB"] = &iuse::acidbomb;
iuse_function_list["ACIDBOMB_ACT"] = &iuse::acidbomb_act;
iuse_function_list["ARROW_FLAMABLE"] = &iuse::arrow_flamable;
iuse_function_list["MOLOTOV"] = &iuse::molotov;
iuse_function_list["MOLOTOV_LIT"] = &iuse::molotov_lit;
iuse_function_list["DYNAMITE"] = &iuse::dynamite;
@@ -140,6 +144,8 @@ void Item_factory::init(){
iuse_function_list["TURRET"] = &iuse::turret;
iuse_function_list["UPS_OFF"] = &iuse::UPS_off;
iuse_function_list["UPS_ON"] = &iuse::UPS_on;
iuse_function_list["adv_UPS_OFF"] = &iuse::adv_UPS_off;
iuse_function_list["adv_UPS_ON"] = &iuse::adv_UPS_on;
iuse_function_list["TAZER"] = &iuse::tazer;
iuse_function_list["MP3"] = &iuse::mp3;
iuse_function_list["MP3_ON"] = &iuse::mp3_on;
@@ -165,6 +171,10 @@ void Item_factory::init(){
iuse_function_list["LAW"] = &iuse::LAW;
iuse_function_list["HEATPACK"] = &iuse::heatpack;
iuse_function_list["DEJAR"] = &iuse::dejar;
iuse_function_list["RAD_BADGE"] = &iuse::rad_badge;
iuse_function_list["BOOTS"] = &iuse::boots;
iuse_function_list["ABSORBENT"] = &iuse::towel;
iuse_function_list["UNFOLD_BICYCLE"] = &iuse::unfold_bicycle;
// MACGUFFINS
iuse_function_list["MCG_NOTE"] = &iuse::mcg_note;
// ARTIFACTS
@@ -173,39 +183,6 @@ void Item_factory::init(){
// See artifact.h for a list
iuse_function_list["ARTIFACT"] = &iuse::artifact;
// ITEM FLAGS
item_flags_list["LIGHT_1"] = mfb(IF_LIGHT_1);
item_flags_list["LIGHT_4"] = mfb(IF_LIGHT_4);
item_flags_list["LIGHT_8"] = mfb(IF_LIGHT_8);
item_flags_list["LIGHT_20"] = mfb(IF_LIGHT_20);
item_flags_list["FIRE"] = mfb(IF_FIRE);
item_flags_list["SPEAR"] = mfb(IF_SPEAR);
item_flags_list["STAB"] = mfb(IF_STAB);
item_flags_list["WRAP"] = mfb(IF_WRAP);
item_flags_list["MESSY"] = mfb(IF_MESSY);
item_flags_list["RELOAD_ONE"] = mfb(IF_RELOAD_ONE);
item_flags_list["STR_RELOAD"] = mfb(IF_STR_RELOAD);
item_flags_list["STR8_DRAW"] = mfb(IF_STR8_DRAW);
item_flags_list["STR10_DRAW"] = mfb(IF_STR10_DRAW);
item_flags_list["USE_UPS"] = mfb(IF_USE_UPS);
item_flags_list["RELOAD_AND_SHOOT"] = mfb(IF_RELOAD_AND_SHOOT);
item_flags_list["FIRE_100"] = mfb(IF_FIRE_100);
item_flags_list["GRENADE"] = mfb(IF_GRENADE);
item_flags_list["CHARGE"] = mfb(IF_CHARGE);
item_flags_list["SHOCK"] = mfb(IF_SHOCK);
item_flags_list["UNARMED_WEAPON"] = mfb(IF_UNARMED_WEAPON);
item_flags_list["NO_UNWIELD"] = mfb(IF_NO_UNWIELD);
item_flags_list["NO_UNLOAD"] = mfb(IF_NO_UNLOAD);
item_flags_list["BACKBLAST"] = mfb(IF_BACKBLAST);
item_flags_list["MODE_AUX"] = mfb(IF_MODE_AUX);
item_flags_list["MODE_BURST"] = mfb(IF_MODE_BURST);
item_flags_list["HOT"] = mfb(IF_HOT);
item_flags_list["EATEN_HOT"] = mfb(IF_EATEN_HOT);
item_flags_list["ROTTEN"] = mfb(IF_ROTTEN);
item_flags_list["VARSIZE"] = mfb(IF_VARSIZE);
item_flags_list["FIT"] = mfb(IF_FIT);
item_flags_list["DOUBLE_AMMO"] = mfb(IF_DOUBLE_AMMO);
// Offensive Techniques
techniques_list["SWEEP"] = mfb(TEC_SWEEP);
techniques_list["PRECISE"] = mfb(TEC_PRECISE);
@@ -216,6 +193,7 @@ void Item_factory::init(){
techniques_list["FEINT"] = mfb(TEC_FEINT);
techniques_list["THROW"] = mfb(TEC_THROW);
techniques_list["DISARM"] = mfb(TEC_DISARM);
techniques_list["FLAMING"] = mfb(TEC_FLAMING);
// Defensive Techniques
techniques_list["BLOCK"] = mfb(TEC_BLOCK);
techniques_list["BLOCK_LEGS"] = mfb(TEC_BLOCK_LEGS);
@@ -227,53 +205,6 @@ void Item_factory::init(){
techniques_list["DEF_THROW"] = mfb(TEC_DEF_THROW);
techniques_list["DEF_DISARM"] = mfb(TEC_DEF_DISARM);
//Ammo lists
ammo_flags_list["NULL"] = mfb(AT_NULL);
ammo_flags_list["THREAD"] = mfb(AT_THREAD);
ammo_flags_list["BATT"] = mfb(AT_BATT);
ammo_flags_list["PLUT"] = mfb(AT_PLUT);
ammo_flags_list["NAIL"] = mfb(AT_NAIL);
ammo_flags_list["BB"] = mfb(AT_BB);
ammo_flags_list["BOLT"] = mfb(AT_BOLT);
ammo_flags_list["ARROW"] = mfb(AT_ARROW);
ammo_flags_list["SHOT"] = mfb(AT_SHOT);
ammo_flags_list["22"] = mfb(AT_22);
ammo_flags_list["9MM"] = mfb(AT_9MM);
ammo_flags_list["762x25"] = mfb(AT_762x25);
ammo_flags_list["38"] = mfb(AT_38);
ammo_flags_list["40"] = mfb(AT_40);
ammo_flags_list["44"] = mfb(AT_44);
ammo_flags_list["45"] = mfb(AT_45);
ammo_flags_list["57"] = mfb(AT_57);
ammo_flags_list["46"] = mfb(AT_46);
ammo_flags_list["762"] = mfb(AT_762);
ammo_flags_list["223"] = mfb(AT_223);
ammo_flags_list["3006"] = mfb(AT_3006);
ammo_flags_list["308"] = mfb(AT_308);
ammo_flags_list["40MM"] = mfb(AT_40MM);
ammo_flags_list["66MM"] = mfb(AT_66MM);
ammo_flags_list["GAS"] = mfb(AT_GAS);
ammo_flags_list["FUSION"] = mfb(AT_FUSION);
ammo_flags_list["MUSCLE"] = mfb(AT_MUSCLE);
ammo_flags_list["12MM"] = mfb(AT_12MM);
ammo_flags_list["PLASMA"] = mfb(AT_PLASMA);
ammo_flags_list["WATER"] = mfb(AT_WATER);
ammo_flags_list["PEBBLE"] = mfb(AT_PEBBLE);
ammo_effects_list["FLAME"] = mfb(AMMO_FLAME);
ammo_effects_list["INCENDIARY"] = mfb(AMMO_INCENDIARY);
ammo_effects_list["EXPLOSIVE"] = mfb(AMMO_EXPLOSIVE);
ammo_effects_list["FRAG"] = mfb(AMMO_FRAG);
ammo_effects_list["NAPALM"] = mfb(AMMO_NAPALM);
ammo_effects_list["EXPLOSIVE_BIG"] = mfb(AMMO_EXPLOSIVE_BIG);
ammo_effects_list["TEARGAS"] = mfb(AMMO_TEARGAS);
ammo_effects_list["SMOKE"] = mfb(AMMO_SMOKE);
ammo_effects_list["TRAIL"] = mfb(AMMO_TRAIL);
ammo_effects_list["FLASHBANG"] = mfb(AMMO_FLASHBANG);
ammo_effects_list["STREAM"] = mfb(AMMO_STREAM);
ammo_effects_list["COOKOFF"] = mfb(AMMO_COOKOFF);
ammo_effects_list["LASER"] = mfb(AMMO_LASER);
bodyparts_list["TORSO"] = mfb(bp_torso);
bodyparts_list["HEAD"] = mfb(bp_head);
bodyparts_list["EYES"] = mfb(bp_eyes);
@@ -338,7 +269,7 @@ const Item_tag Item_factory::id_from(const Item_tag group_tag){
item Item_factory::create(Item_tag id, int created_at){
return item(find_template(id),0);
return item(find_template(id), created_at);
}
Item_list Item_factory::create(Item_tag id, int created_at, int quantity){
Item_list new_items;
@@ -366,6 +297,15 @@ Item_list Item_factory::create_random(int created_at, int quantity){
return new_items;
}
bool Item_factory::group_contains_item(Item_tag group_tag, Item_tag item) {
Item_group *current_group = m_template_groups.find(group_tag)->second;
if(current_group) {
return current_group->has_item(item);
} else {
return 0;
}
}
///////////////////////
// DATA FILE READING //
///////////////////////
@@ -376,9 +316,11 @@ void Item_factory::load_item_templates(){
load_item_templates_from("data/raw/items/ammo.json");
load_item_templates_from("data/raw/items/mods.json");
load_item_templates_from("data/raw/items/tools.json");
load_item_templates_from("data/raw/items/containers.json");
load_item_templates_from("data/raw/items/comestibles.json");
load_item_templates_from("data/raw/items/armor.json");
load_item_templates_from("data/raw/items/books.json");
load_item_templates_from("data/raw/items/archery.json");
load_item_groups_from("data/raw/item_groups.json");
}
@@ -424,17 +366,19 @@ void Item_factory::load_item_templates_from(const std::string file_name){
it_gunmod* gunmod_template = new it_gunmod();
gunmod_template->damage = entry.get("damage_modifier").as_int();;
gunmod_template->loudness = entry.get("loudness_modifier").as_int();
gunmod_template->newtype = ammo_from_string(entry.get("ammo_modifier").as_string());
gunmod_template->newtype = entry.get("ammo_modifier").as_string();
gunmod_template->used_on_pistol = is_mod_target(entry.get("mod_targets"), "pistol");
gunmod_template->used_on_shotgun = is_mod_target(entry.get("mod_targets"), "shotgun");
gunmod_template->used_on_smg = is_mod_target(entry.get("mod_targets"), "smg");
gunmod_template->used_on_rifle = is_mod_target(entry.get("mod_targets"), "rifle");
gunmod_template->accuracy = entry.get("accuracy_modifier").as_int();
gunmod_template->dispersion = entry.get("dispersion_modifier").as_int();
gunmod_template->recoil = entry.get("recoil_modifier").as_int();
gunmod_template->burst = entry.get("burst_modifier").as_int();
gunmod_template->clip = entry.get("clip_size_modifier").as_int();
gunmod_template->techniques = (!entry.has("ammo") ? 0 :
flags_from_json(entry.get("techniques"), "ammo"));
if( entry.has("acceptable_ammo") ) {
tags_from_json( entry.get("acceptable_ammo"),
gunmod_template->acceptible_ammo_types );
}
new_item_template = gunmod_template;
}
else if (type_label == "COMESTIBLE")
@@ -457,11 +401,11 @@ void Item_factory::load_item_templates_from(const std::string file_name){
else if (type_label == "GUN")
{
it_gun* gun_template = new it_gun();
gun_template->ammo = ammo_from_string(entry.get("ammo").as_string());
gun_template->ammo = entry.get("ammo").as_string();
gun_template->skill_used = Skill::skill(entry.get("skill").as_string());
gun_template->dmg_bonus = entry.get("ranged_damage").as_int();
gun_template->range = entry.get("range").as_int();
gun_template->accuracy = entry.get("accuracy").as_int();
gun_template->dispersion = entry.get("dispersion").as_int();
gun_template->recoil = entry.get("recoil").as_int();
gun_template->durability = entry.get("durability").as_int();
gun_template->burst = entry.get("burst").as_int();
@@ -473,7 +417,7 @@ void Item_factory::load_item_templates_from(const std::string file_name){
else if (type_label == "TOOL")
{
it_tool* tool_template = new it_tool();
tool_template->ammo = ammo_from_string(entry.get("ammo").as_string());
tool_template->ammo = entry.get("ammo").as_string();
tool_template->max_charges = entry.get("max_charges").as_int();
tool_template->def_charges = entry.get("initial_charges").as_int();
tool_template->charges_per_use = entry.get("charges_per_use").as_int();
@@ -485,20 +429,17 @@ void Item_factory::load_item_templates_from(const std::string file_name){
else if (type_label == "AMMO")
{
it_ammo* ammo_template = new it_ammo();
ammo_template->type =
ammo_from_string(
entry.get("ammo_type").as_string());
ammo_template->type = entry.get("ammo_type").as_string();
ammo_template->damage = entry.get("damage").as_int();
ammo_template->pierce = entry.get("pierce").as_int();
ammo_template->range = entry.get("range").as_int();
ammo_template->accuracy =
entry.get("accuracy").as_int();
ammo_template->dispersion =
entry.get("dispersion").as_int();
ammo_template->recoil = entry.get("recoil").as_int();
ammo_template->count = entry.get("count").as_int();
ammo_template->ammo_effects =
(!entry.has("effects") ? 0 :
flags_from_json(entry.get("effects"),
"ammo_effects"));
if( entry.has("effects") ) {
tags_from_json(entry.get("effects"), ammo_template->ammo_effects);
}
new_item_template = ammo_template;
}
@@ -507,8 +448,8 @@ void Item_factory::load_item_templates_from(const std::string file_name){
it_armor* armor_template = new it_armor();
armor_template->encumber = entry.get("encumberance").as_int();
armor_template->dmg_resist = entry.get("bashing_protection").as_int();
armor_template->cut_resist = entry.get("cutting_protection").as_int();
armor_template->coverage = entry.get("coverage").as_int();
armor_template->thickness = entry.get("material_thickness").as_int();
armor_template->env_resist = entry.get("enviromental_protection").as_int();
armor_template->warmth = entry.get("warmth").as_int();
armor_template->storage = entry.get("storage").as_int();
@@ -531,6 +472,14 @@ void Item_factory::load_item_templates_from(const std::string file_name){
new_item_template = book_template;
}
else if (type_label == "CONTAINER")
{
it_container* container_template = new it_container();
container_template->contains = entry.get("contains").as_int();
new_item_template = container_template;
}
else
{
debugmsg("Item definition for %s skipped, unrecognized type: %s", new_id.c_str(),
@@ -544,15 +493,15 @@ void Item_factory::load_item_templates_from(const std::string file_name){
// And then proceed to assign the correct field
new_item_template->rarity = entry.get("rarity").as_int();
new_item_template->price = entry.get("price").as_int();
new_item_template->name = entry.get("name").as_string();
new_item_template->name = _(entry.get("name").as_string().c_str());
new_item_template->sym = entry.get("symbol").as_char();
new_item_template->color = color_from_string(entry.get("color").as_string());
new_item_template->description = entry.get("description").as_string();
new_item_template->description = _(entry.get("description").as_string().c_str());
if(entry.has("material")){
set_material_from_json(new_id, entry.get("material"));
} else {
new_item_template->m1 = MNULL;
new_item_template->m2 = MNULL;
new_item_template->m1 = "null";
new_item_template->m2 = "null";
}
Item_tag new_phase = "solid";
if(entry.has("phase")){
@@ -565,8 +514,26 @@ void Item_factory::load_item_templates_from(const std::string file_name){
new_item_template->melee_cut = entry.get("cutting").as_int();
new_item_template->m_to_hit = entry.get("to_hit").as_int();
new_item_template->item_flags = (!entry.has("flags") ? 0 :
flags_from_json(entry.get("flags")));
if( entry.has("flags") )
{
new_item_template->item_tags = entry.get("flags").as_tags();
/*
List of current flags
FIT - Reduces encumberance by one
VARSIZE - Can be made to fit via tailoring
OVERSIZE - Can always be worn no matter encumberance/mutations/bionics/etc
HOOD - Will increase warmth for head if head is cold and player is not wearing a helmet (headwear of material that is not wool or cotton)
POCKETS - Will increase warmth for hands if hands are cold and the player is wielding nothing
WATCH - Shows the current time, instead of sun/moon position
ALARM - Has a alarmclock feature
Container-only flags:
SEALS
RIGID
WATERTIGHT
*/
}
new_item_template->techniques = (!entry.has("techniques") ? 0 :
flags_from_json(entry.get("techniques"), "techniques"));
new_item_template->use = (!entry.has("use_action") ? &iuse::none :
@@ -599,6 +566,9 @@ void Item_factory::load_item_groups_from(const std::string file_name){
//Crawl through once and create an entry for every definition
const picojson::array& all_items = input_value.get<picojson::array>();
for (picojson::array::const_iterator entry = all_items.begin(); entry != all_items.end(); ++entry) {
// TODO: Make sure we have at least an item or group child, as otherwise
// later things will bug out.
if( !(entry->is<picojson::object>()) ){
std::cerr << "Invalid group definition, entry not a JSON object" << std::endl;
}
@@ -620,7 +590,7 @@ void Item_factory::load_item_groups_from(const std::string file_name){
const picojson::value::object& entry_body = entry->get<picojson::object>();
Item_tag group_id = entry_body.find("id")->second.get<std::string>();
Item_group current_group = *m_template_groups.find(group_id)->second;
Item_group *current_group = m_template_groups.find(group_id)->second;
//Add items
picojson::value::object::const_iterator key_pair = entry_body.find("items");
@@ -642,7 +612,7 @@ void Item_factory::load_item_groups_from(const std::string file_name){
if(!item_frequency_array[0].is<std::string>() || !item_frequency_array[1].is<double>() ){
std::cerr << "Invalid item list for group definition '"+group_id+"', element is not a valid tag/frequency pair." << std::endl;
} else {
current_group.add_entry(item_frequency_array[0].get<std::string>(), (int)item_frequency_array[1].get<double>());
current_group->add_entry(item_frequency_array[0].get<std::string>(), (int)item_frequency_array[1].get<double>());
}
}
}
@@ -670,7 +640,7 @@ void Item_factory::load_item_groups_from(const std::string file_name){
std::cerr << "Invalid group list for group definition '"+group_id+"', element is not a valid tag/frequency pair." << std::endl;
} else {
Item_group* subgroup = m_template_groups.find(item_frequency_array[0].get<std::string>())->second;
current_group.add_group(subgroup, (int)item_frequency_array[1].get<double>());
current_group->add_group(subgroup, (int)item_frequency_array[1].get<double>());
}
}
}
@@ -717,75 +687,6 @@ nc_color Item_factory::color_from_string(std::string new_color){
}
}
ammotype Item_factory::ammo_from_string(std::string new_ammo){
if("nail"==new_ammo){
return AT_NAIL;
} else if ("BB" == new_ammo) {
return AT_BB;
} else if ("pebble" == new_ammo) {
return AT_PEBBLE;
} else if ("bolt" == new_ammo) {
return AT_BOLT;
} else if ("arrow" == new_ammo) {
return AT_ARROW;
} else if ("shot" == new_ammo) {
return AT_SHOT;
} else if (".22" == new_ammo) {
return AT_22;
} else if ("9mm" == new_ammo) {
return AT_9MM;
} else if ("7.62x25mm" == new_ammo) {
return AT_762x25;
} else if (".38" == new_ammo) {
return AT_38;
} else if (".40" == new_ammo) {
return AT_40;
} else if (".44" == new_ammo) {
return AT_44;
} else if (".45" == new_ammo) {
return AT_45;
} else if ("5.7mm" == new_ammo) {
return AT_57;
} else if ("4.6mm" == new_ammo) {
return AT_46;
} else if ("7.62x39mm" == new_ammo) {
return AT_762;
} else if (".223" == new_ammo) {
return AT_223;
} else if (".30-06" == new_ammo) {
return AT_3006;
} else if (".308" == new_ammo) {
return AT_308;
} else if ("40mm" == new_ammo) {
return AT_40MM;
} else if ("66mm" == new_ammo) {
return AT_66MM;
} else if ("gasoline" == new_ammo) {
return AT_GAS;
} else if ("thread" == new_ammo) {
return AT_THREAD;
} else if ("battery" == new_ammo) {
return AT_BATT;
} else if ("plutonium" == new_ammo) {
return AT_PLUT;
} else if ("muscle" == new_ammo) {
return AT_MUSCLE;
} else if ("fusion" == new_ammo) {
return AT_FUSION;
} else if ("12mm" == new_ammo) {
return AT_12MM;
} else if ("plasma" == new_ammo) {
return AT_PLASMA;
} else if ("water" == new_ammo) {
return AT_WATER;
} else if ("none" == new_ammo) {
return AT_NULL; // NX17 and other special weapons
} else {
debugmsg("Read invalid ammo %s.", new_ammo.c_str());
return AT_NULL;
}
}
Use_function Item_factory::use_from_string(std::string function_name){
std::map<Item_tag, Use_function>::iterator found_function = iuse_function_list.find(function_name);
@@ -801,14 +702,9 @@ Use_function Item_factory::use_from_string(std::string function_name){
void Item_factory::set_flag_by_string(unsigned& cur_flags, std::string new_flag, std::string flag_type)
{
//Use the standard item flag list unless a valid alternative is provided
std::map<Item_tag, unsigned> flag_map = item_flags_list;
if(flag_type=="ammo"){
flag_map = ammo_flags_list;
} else if(flag_type=="techniques"){
std::map<Item_tag, unsigned> flag_map;
if(flag_type=="techniques"){
flag_map = techniques_list;
} else if(flag_type=="ammo_effects"){
flag_map = ammo_effects_list;
} else if(flag_type=="bodyparts"){
flag_map = bodyparts_list;
}
@@ -829,6 +725,22 @@ void Item_factory::set_bitmask_by_string(std::map<Item_tag, unsigned> flag_map,
}
}
void Item_factory::tags_from_json(catajson tag_list, std::set<std::string> &tags)
{
if (tag_list.is_array())
{
for (tag_list.set_begin(); tag_list.has_curr(); tag_list.next())
{
tags.insert( tag_list.curr().as_string() );
}
}
else
{
//we should have gotten a string, if not an array, and catajson will do error checking
tags.insert( tag_list.as_string() );
}
}
unsigned Item_factory::flags_from_json(catajson flag_list, std::string flag_type){
//If none is found, just use the standard none action
unsigned flag = 0;
@@ -872,7 +784,7 @@ bool Item_factory::is_mod_target(catajson targets, std::string weapon){
void Item_factory::set_material_from_json(Item_tag new_id, catajson mat_list){
//If the value isn't found, just return a group of null materials
material material_list[2] = {MNULL, MNULL};
std::string material_list[2] = {"null", "null"};
if (mat_list.is_array())
{
@@ -880,12 +792,12 @@ void Item_factory::set_material_from_json(Item_tag new_id, catajson mat_list){
{
debugmsg("Too many materials provided for item %s", new_id.c_str());
}
material_list[0] = material_from_tag(new_id, mat_list.get(0).as_string());
material_list[1] = material_from_tag(new_id, mat_list.get(1).as_string());
material_list[0] = mat_list.get(0).as_string();
material_list[1] = mat_list.get(1).as_string();
}
else
{
material_list[0] = material_from_tag(new_id, mat_list.as_string());
material_list[0] = mat_list.as_string();
}
itype* temp = find_template(new_id);
@@ -907,50 +819,3 @@ phase_id Item_factory::phase_from_tag(Item_tag name){
return PNULL;
}
};
material Item_factory::material_from_tag(Item_tag new_id, Item_tag name){
// Map the valid input tags to a valid material
// This should clearly be some sort of map, stored somewhere
// ...unless it can get replaced entirely, which would be nice.
// For now, though, that isn't the problem I'm solving.
if(name == "VEGGY"){
return VEGGY;
} else if(name == "FLESH"){
return FLESH;
} else if(name == "POWDER"){
return POWDER;
} else if(name == "HFLESH"){
return HFLESH;
} else if(name == "COTTON"){
return COTTON;
} else if(name == "WOOL"){
return WOOL;
} else if(name == "LEATHER"){
return LEATHER;
} else if(name == "KEVLAR"){
return KEVLAR;
} else if(name == "FUR"){
return FUR;
} else if(name == "STONE"){
return STONE;
} else if(name == "PAPER"){
return PAPER;
} else if(name == "WOOD"){
return WOOD;
} else if(name == "PLASTIC"){
return PLASTIC;
} else if(name == "GLASS"){
return GLASS;
} else if(name == "IRON"){
return IRON;
} else if(name == "STEEL"){
return STEEL;
} else if(name == "SILVER"){
return SILVER;
} else if(name == "NULL"){
return MNULL;
} else {
return MNULL;
}
}
+6 -12
View File
@@ -1,9 +1,6 @@
#ifndef _ITEM_FACTORY_H_
#define _ITEM_FACTORY_H_
#include <string>
#include <vector>
#include <map>
#include "game.h"
#include "itype.h"
#include "item.h"
@@ -11,7 +8,10 @@
#include "picojson.h"
#include "catajson.h"
#include "item_group.h"
#include "iuse.h"
#include "iuse.h"
#include <string>
#include <vector>
#include <map>
typedef std::string Item_tag;
typedef std::vector<item> Item_list;
@@ -35,6 +35,7 @@ public:
itype* template_from(Item_tag group_tag);
const Item_tag random_id();
const Item_tag id_from(Item_tag group_tag);
bool group_contains_item(Item_tag group_tag, Item_tag item);
//Production methods
item create(Item_tag id, int created_at);
@@ -56,12 +57,11 @@ private:
nc_color color_from_string(std::string color);
Use_function use_from_string(std::string name);
void tags_from_json(catajson tag_list, std::set<std::string> &tags);
unsigned flags_from_json(catajson flags, std::string flag_type="");
void set_material_from_json(Item_tag new_id, catajson mats);
bool is_mod_target(catajson targets, std::string weapon);
material material_from_tag(Item_tag new_id, Item_tag index);
phase_id phase_from_tag(Item_tag name);
ammotype ammo_from_string(std::string ammo);
//two convenience functions that just call into set_bitmask_by_string
void set_flag_by_string(unsigned& cur_flags, std::string new_flag, std::string flag_type);
@@ -71,14 +71,8 @@ private:
//iuse stuff
std::map<Item_tag, Use_function> iuse_function_list;
//flags stuff
std::map<Item_tag, unsigned> item_flags_list;
//techniques stuff
std::map<Item_tag, unsigned> techniques_list;
//ammo stuff
std::map<Item_tag, unsigned> ammo_flags_list;
//ammo effects
std::map<Item_tag, unsigned> ammo_effects_list;
//bodyparts
std::map<Item_tag, unsigned> bodyparts_list;
};
+10
View File
@@ -86,3 +86,13 @@ bool Item_group_group::check(int value) const{
const Item_tag Item_group_group::get(std::vector<Item_tag> recursion_list){
return m_group->get_id(recursion_list);
}
bool Item_group::has_item(const Item_tag item_id) {
for(int i=0; i<m_entries.size(); i++) {
if(m_entries[i]->get() == item_id) {
return 1;
}
}
return 0;
}
+3
View File
@@ -17,6 +17,9 @@ public:
const Item_tag get_id(std::vector<Item_tag> recursion_list);
void add_entry(const Item_tag item_id, int chance);
void add_group(Item_group*, int chance);
// Does this item group contain the given item?
bool has_item(const Item_tag item_id);
private:
const Item_tag m_id;
int m_max_odds;
+116 -204
View File
@@ -1,9 +1,6 @@
#ifndef _ITYPE_H_
#define _ITYPE_H_
#include <string>
#include <vector>
#include <sstream>
#include "color.h"
#include "enums.h"
#include "iuse.h"
@@ -13,6 +10,12 @@
#include "bionics.h"
#include "artifact.h"
#include "picojson.h"
#include "rng.h"
#include "material.h"
#include <string>
#include <vector>
#include <sstream>
#include <set>
// mfb(n) converts a flag to its appropriate position in covers's bitfield
#ifndef mfb
@@ -39,27 +42,7 @@ extern std::vector<std::string> artifact_itype_ids;
extern std::vector<std::string> standard_itype_ids;
extern std::vector<std::string> pseudo_itype_ids;
// IMPORTANT: If adding a new AT_*** ammotype, add it to the ammo_name function
// at the end of itypedef.cpp
enum ammotype {
AT_NULL, AT_THREAD,
AT_BATT, AT_PLUT,
AT_NAIL, AT_BB, AT_BOLT, AT_ARROW,
AT_SHOT,
AT_22, AT_9MM, AT_762x25, AT_38, AT_40, AT_44, AT_45,
AT_57, AT_46,
AT_762, AT_223, AT_3006, AT_308,
AT_40MM,
AT_66MM,
AT_GAS,
AT_FUSION,
AT_MUSCLE,
AT_12MM,
AT_PLASMA,
AT_WATER,
AT_PEBBLE,
NUM_AMMO_TYPES
};
typedef std::string ammotype;
enum software_type {
SW_NULL,
@@ -71,78 +54,6 @@ SW_DATA,
NUM_SOFTWARE_TYPES
};
enum item_flag {
IF_NULL,
IF_LIGHT_1, // Provides 1 tile of light
IF_LIGHT_4, // Provides 4 tiles of light
IF_LIGHT_8, // Provides 8 tiles of light
IF_LIGHT_20, // Provides 20 tiles of light
IF_FIRE, // Chance to set fire to tiles/enemies
IF_SPEAR, // Cutting damage is actually a piercing attack
IF_STAB, // This weapon *can* pierce, but also has normal cutting
IF_WRAP, // Can wrap around your target, costing you and them movement
IF_MESSY, // Splatters blood, etc.
IF_RELOAD_ONE, // Reload cartridge by cartridge (e.g. most shotguns)
IF_STR_RELOAD, // Reloading time is reduced by Strength * 20
IF_STR8_DRAW, // Requires strength 8 to draw
IF_STR10_DRAW, // Requires strength 10 to draw
IF_USE_UPS, // Draws power from a UPS
IF_RELOAD_AND_SHOOT, // Reloading and shooting is one action
IF_FIRE_100, // Fires 100 rounds at once! (e.g. flamethrower)
IF_GRENADE, // NPCs treat this as a grenade
IF_CHARGE, // For guns; charges up slowly
IF_SHOCK, // Stuns and damages enemies, powers up shockers.
IF_UNARMED_WEAPON, // Counts as an unarmed weapon
IF_NO_UNWIELD, // Impossible to unwield, e.g. bionic claws
IF_NO_UNLOAD, // Cannot be unloaded. For Fusion rifles and other ammo generating weapons.
IF_BACKBLAST, // Creates a backblast of smoke.
// Weapon mode flags
IF_MODE_AUX, // A gunmod with a firing mode
IF_MODE_BURST, // A burst of attacks
// Food status flags
IF_HOT, // hot food
IF_EATEN_HOT, // food meant to be eaten hot
IF_ROTTEN, // rotten food
// Clothing flags
IF_VARSIZE, // comes in variable sizes (item type flag)
IF_FIT, // clothing fits player (item specific flag)
//Book Flags
/*IF_READ_SKILLBOOK,
IF_READ_FUNBOOK,
*/
// Item mod flags
// has double the normal ammo capacity (item specific flag), only works with tools at the moment
// need to tweak a few things to make it work with guns as well
IF_DOUBLE_AMMO,
NUM_ITEM_FLAGS
};
enum ammo_effect {
AMMO_FLAME, // Sets fire to terrain and monsters
AMMO_INCENDIARY, // Sparks explosive terrain
AMMO_EXPLOSIVE, // Small explosion
AMMO_FRAG, // Frag explosion
AMMO_NAPALM, // Firey explosion
AMMO_EXPLOSIVE_BIG, // Big explosion!
AMMO_TEARGAS, // Teargas burst
AMMO_SMOKE, // Smoke burst
AMMO_TRAIL, // Leaves a trail of smoke
AMMO_FLASHBANG, // Disorients and blinds
AMMO_STREAM, // Doesn't stop once it hits a monster
AMMO_COOKOFF, // Explodes when burned instead of just burning
AMMO_LASER, // laser effects
NUM_AMMO_EFFECTS
};
enum technique_id {
TEC_NULL,
// Offensive Techniques
@@ -155,6 +66,7 @@ TEC_RAPID, // Hits faster
TEC_FEINT, // Misses take less time
TEC_THROW, // Attacks may throw your opponent
TEC_DISARM, // Remove an NPC's weapon
TEC_FLAMING, // Sets victim on fire
// Defensive Techniques
TEC_BLOCK, // Block attacks, reducing them to 25% damage
TEC_BLOCK_LEGS, // Block attacks, but with your legs
@@ -213,8 +125,8 @@ struct itype
char sym; // Symbol on the map
nc_color color; // Color on the map (color.h)
material m1; // Main material
material m2; // Secondary material -- MNULL if made of just 1 thing
std::string m1; // Main material
std::string m2; // Secondary material -- "null" if made of just 1 thing
phase_id phase; //e.g. solid, liquid, gas
@@ -227,7 +139,7 @@ struct itype
signed char melee_cut; // Cutting damage in melee
signed char m_to_hit; // To-hit bonus for melee combat; -5 to 5 is reasonable
unsigned item_flags : NUM_ITEM_FLAGS;
std::set<std::string> item_tags;
unsigned techniques : NUM_TECHNIQUES;
virtual bool is_food() { return false; }
@@ -251,6 +163,8 @@ struct itype
virtual bool count_by_charges() { return false; }
virtual picojson::value save_data() { return picojson::value(); }
std::string dmg_adj(int dam) { return material_type::find_material(m1)->dmg_adj(dam); }
void (iuse::*use)(game *, player *, item *, bool);// Special effects of use
itype() {
@@ -259,24 +173,23 @@ struct itype
name = "none";
sym = '#';
color = c_white;
m1 = MNULL;
m2 = MNULL;
m1 = "null";
m2 = "null";
phase = SOLID;
volume = 0;
weight = 0;
melee_dam = 0;
m_to_hit = 0;
item_flags = 0;
techniques = 0;
use = &iuse::none;
}
itype(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2, phase_id pphase,
char psym, nc_color pcolor, std::string pm1, std::string pm2, phase_id pphase,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
unsigned pitem_flags, unsigned ptechniques = 0) {
unsigned ptechniques = 0) {
id = pid;
rarity = prarity;
price = pprice;
@@ -292,7 +205,6 @@ struct itype
melee_dam = pmelee_dam;
melee_cut = pmelee_cut;
m_to_hit = pm_to_hit;
item_flags = pitem_flags;
techniques = ptechniques;
use = &iuse::none;
}
@@ -331,18 +243,18 @@ struct it_comest : public itype
it_comest(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, phase_id pphase,
char psym, nc_color pcolor, std::string pm1, phase_id pphase,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
signed char pm_to_hit,
signed char pquench, unsigned char pnutr, signed char pspoils,
signed char pstim, signed char phealthy, unsigned char paddict,
unsigned char pcharges, signed char pfun, itype_id pcontainer,
itype_id ptool, void (iuse::*puse)(game *, player *, item *, bool),
add_type padd, std::string pcomesttype)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, MNULL, pphase,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, "null", pphase,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit)
{
quench = pquench;
nutr = pnutr;
@@ -357,7 +269,6 @@ struct it_comest : public itype
use = puse;
add = padd;
comesttype = pcomesttype;
item_flags = pitem_flags;
}
it_comest() :itype() { };
@@ -372,7 +283,7 @@ struct it_var_veh_part: public itype
it_var_veh_part(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
char psym, nc_color pcolor, std::string pm1, std::string pm2,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
unsigned effects,
@@ -381,7 +292,7 @@ struct it_var_veh_part: public itype
unsigned int big_max,
bigness_property_aspect big_aspect)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, 0) {
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
min_bigness = big_min;
max_bigness = big_max;
bigness_aspect = big_aspect;
@@ -402,11 +313,11 @@ struct it_ammo : public itype
unsigned char damage; // Average damage done
unsigned char pierce; // Armor piercing; static reduction in armor
unsigned char range; // Maximum range
signed char accuracy; // Accuracy (low is good)
signed char dispersion;// Dispersion (low is good)
unsigned char recoil; // Recoil; modified by strength
unsigned char count; // Default charges
unsigned ammo_effects : NUM_AMMO_EFFECTS;
std::set<std::string> ammo_effects;
virtual bool is_ammo() { return true; }
// virtual bool count_by_charges() { return id != "gasoline"; }
@@ -414,33 +325,32 @@ struct it_ammo : public itype
it_ammo() : itype()
{
type = AT_NULL;
type = "NULL";
damage = 0;
pierce = 0;
range = 0;
accuracy = 0;
dispersion = 0;
recoil = 0;
count = 0;
ammo_effects = 0;
}
it_ammo(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, phase_id pphase,
char psym, nc_color pcolor, std::string pm1, phase_id pphase,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
unsigned effects,
std::set<std::string> effects,
ammotype ptype, unsigned char pdamage, unsigned char ppierce,
signed char paccuracy, unsigned char precoil, unsigned char prange,
signed char pdispersion, unsigned char precoil, unsigned char prange,
unsigned char pcount)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, MNULL, pphase,
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, "null", pphase,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, 0) {
type = ptype;
damage = pdamage;
pierce = ppierce;
range = prange;
accuracy = paccuracy;
dispersion = pdispersion;
recoil = precoil;
count = pcount;
ammo_effects = effects;
@@ -453,7 +363,7 @@ struct it_gun : public itype
Skill *skill_used;
signed char dmg_bonus;
signed char range;
signed char accuracy;
signed char dispersion;
signed char recoil;
signed char durability;
unsigned char burst;
@@ -464,21 +374,20 @@ struct it_gun : public itype
it_gun(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
char psym, nc_color pcolor, std::string pm1, std::string pm2,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
unsigned pitem_flags,
const char *pskill_used, ammotype pammo, signed char pdmg_bonus, signed char prange,
signed char paccuracy, signed char precoil, unsigned char pdurability,
signed char pdispersion, signed char precoil, unsigned char pdurability,
unsigned char pburst, int pclip, int preload_time)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
skill_used = pskill_used?Skill::skill(pskill_used):NULL;
ammo = pammo;
dmg_bonus = pdmg_bonus;
range = prange;
accuracy = paccuracy;
dispersion = pdispersion;
recoil = precoil;
durability = pdurability;
burst = pburst;
@@ -491,9 +400,9 @@ struct it_gun : public itype
struct it_gunmod : public itype
{
signed char accuracy, damage, loudness, clip, recoil, burst;
signed char dispersion, damage, loudness, clip, recoil, burst;
ammotype newtype;
unsigned acceptible_ammo_types : NUM_AMMO_TYPES;
std::set<std::string> acceptible_ammo_types;
bool used_on_pistol;
bool used_on_shotgun;
bool used_on_smg;
@@ -503,19 +412,19 @@ struct it_gunmod : public itype
it_gunmod(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
char psym, nc_color pcolor, std::string pm1, std::string pm2,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
signed char pm_to_hit,
signed char paccuracy, signed char pdamage, signed char ploudness,
signed char pdispersion, signed char pdamage, signed char ploudness,
signed char pclip, signed char precoil, signed char pburst,
ammotype pnewtype, long a_a_t, bool pistol,
ammotype pnewtype, std::set<std::string> a_a_t, bool pistol,
bool shotgun, bool smg, bool rifle)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
accuracy = paccuracy;
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
dispersion = pdispersion;
damage = pdamage;
loudness = ploudness;
clip = pclip;
@@ -536,8 +445,8 @@ struct it_armor : public itype
{
unsigned char covers; // Bitfield of enum body_part
signed char encumber;
unsigned char dmg_resist;
unsigned char cut_resist;
unsigned char coverage;
unsigned char thickness;
unsigned char env_resist; // Resistance to environmental effects
signed char warmth;
unsigned char storage;
@@ -548,13 +457,21 @@ struct it_armor : public itype
virtual bool is_power_armor() { return power_armor; }
virtual bool is_artifact() { return false; }
virtual picojson::value save_data() { return picojson::value(); }
std::string bash_dmg_verb() { return m2 == "null" || !one_in(3) ?
material_type::find_material(m1)->bash_dmg_verb() :
material_type::find_material(m2)->bash_dmg_verb();
}
std::string cut_dmg_verb() { return m2 == "null" || !one_in(3) ?
material_type::find_material(m1)->cut_dmg_verb() :
material_type::find_material(m2)->cut_dmg_verb();
}
it_armor() : itype()
{
covers = 0;
encumber = 0;
dmg_resist = 0;
cut_resist = 0;
coverage = 0;
thickness = 0;
env_resist = 0;
warmth = 0;
storage = 0;
@@ -563,21 +480,20 @@ struct it_armor : public itype
it_armor(itype_id pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
char psym, nc_color pcolor, std::string pm1, std::string pm2,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
unsigned pitem_flags,
unsigned char pcovers, signed char pencumber,
unsigned char pdmg_resist, unsigned char pcut_resist,
unsigned char pcoverage, unsigned char pthickness,
unsigned char penv_resist, signed char pwarmth,
unsigned char pstorage, bool ppower_armor = false)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
covers = pcovers;
encumber = pencumber;
dmg_resist = pdmg_resist;
cut_resist = pcut_resist;
coverage = pcoverage;
thickness = pthickness;
env_resist = penv_resist;
warmth = pwarmth;
storage = pstorage;
@@ -601,15 +517,14 @@ struct it_book : public itype
it_book() {}
it_book(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
char psym, nc_color pcolor, std::string pm1, std::string pm2,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
unsigned pitem_flags,
const char *ptype, unsigned char plevel, unsigned char preq,
signed char pfun, unsigned char pintel, unsigned char ptime)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
type = ptype?Skill::skill(ptype):NULL;
level = plevel;
req = preq;
@@ -619,31 +534,11 @@ struct it_book : public itype
}
};
enum container_flags {
con_rigid,
con_wtight,
con_seals,
num_con_flags
};
struct it_container : public itype
{
unsigned char contains; // Internal volume
unsigned flags : num_con_flags;
virtual bool is_container() { return true; }
it_container(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
unsigned char pcontains, unsigned pflags)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
contains = pcontains;
flags = pflags;
}
it_container() {};
};
struct it_tool : public itype
@@ -661,7 +556,7 @@ struct it_tool : public itype
it_tool() :itype()
{
ammo = AT_NULL;
ammo = "NULL";
max_charges = 0;
def_charges = 0;
charges_per_use = 0;
@@ -672,17 +567,16 @@ struct it_tool : public itype
it_tool(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2, phase_id pphase,
char psym, nc_color pcolor, std::string pm1, std::string pm2, phase_id pphase,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut, signed char pm_to_hit,
unsigned pitem_flags,
unsigned int pmax_charges, unsigned int pdef_charges,
unsigned char pcharges_per_use, unsigned char pturns_per_charge,
ammotype pammo, itype_id prevert_to,
void (iuse::*puse)(game *, player *, item *, bool))
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, pphase,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
max_charges = pmax_charges;
def_charges = pdef_charges;
ammo = pammo;
@@ -702,14 +596,14 @@ struct it_bionic : public itype
it_bionic(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
char psym, nc_color pcolor, std::string pm1, std::string pm2,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
signed char pm_to_hit,
int pdifficulty)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
difficulty = pdifficulty;
options.push_back(id);
}
@@ -723,15 +617,15 @@ struct it_macguffin : public itype
it_macguffin(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
char psym, nc_color pcolor, std::string pm1, std::string pm2,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
signed char pm_to_hit,
bool preadable,
void (iuse::*puse)(game *, player *, item *, bool))
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
readable = preadable;
use = puse;
}
@@ -746,14 +640,14 @@ struct it_software : public itype
it_software(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
char psym, nc_color pcolor, std::string pm1, std::string pm2,
unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
signed char pm_to_hit,
software_type pswtype, int ppower)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) {
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) {
swtype = pswtype;
power = ppower;
}
@@ -767,13 +661,13 @@ struct it_style : public itype
it_style(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
char psym, nc_color pcolor, std::string pm1, std::string pm2,
unsigned char pvolume, unsigned char pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags)
signed char pm_to_hit)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags) { }
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit) { }
};
struct it_stationary : public itype
@@ -784,14 +678,14 @@ struct it_stationary : public itype
it_stationary(std::string pid, unsigned char prarity, unsigned int pprice,
std::string pname, std::string pdes,
char psym, nc_color pcolor, material pm1, material pm2,
char psym, nc_color pcolor, std::string pm1, std::string pm2,
unsigned char pvolume, unsigned char pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
signed char pm_to_hit,
std::string pcategory)
:itype(pid, prarity, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags)
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit)
{
category = pcategory;
}
@@ -826,7 +720,15 @@ struct it_artifact_tool : public it_tool
data[std::string("melee_dam")] = picojson::value(melee_dam);
data[std::string("melee_cut")] = picojson::value(melee_cut);
data[std::string("m_to_hit")] = picojson::value(m_to_hit);
data[std::string("item_flags")] = picojson::value(item_flags);
std::vector<picojson::value> tags_json;
for(std::set<std::string>::iterator it = item_tags.begin();
it != item_tags.end(); ++it)
{
tags_json.push_back(picojson::value(*it));
}
data[std::string("item_flags")] = picojson::value(tags_json);
data[std::string("techniques")] = picojson::value(techniques);
// tool data
@@ -872,7 +774,7 @@ struct it_artifact_tool : public it_tool
}
it_artifact_tool() :it_tool(){
ammo = AT_NULL;
ammo = "NULL";
price = 0;
def_charges = 0;
charges_per_use = 1;
@@ -882,10 +784,10 @@ struct it_artifact_tool : public it_tool
};
it_artifact_tool(std::string pid, unsigned int pprice, std::string pname,
std::string pdes, char psym, nc_color pcolor, material pm1,
material pm2, unsigned short pvolume, unsigned short pweight,
std::string pdes, char psym, nc_color pcolor, std::string pm1,
std::string pm2, unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
signed char pm_to_hit, std::set<std::string> pitem_tags,
unsigned int pmax_charges, unsigned int pdef_charges,
unsigned char pcharges_per_use,
@@ -893,10 +795,11 @@ struct it_artifact_tool : public it_tool
ammotype pammo, itype_id prevert_to)
:it_tool(pid, 0, pprice, pname, pdes, psym, pcolor, pm1, pm2, SOLID,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit,
pmax_charges, pdef_charges, pcharges_per_use, pturns_per_charge,
pammo, prevert_to, &iuse::artifact)
{
item_tags = pitem_tags;
artifact_itype_ids.push_back(pid);
};
};
@@ -928,14 +831,22 @@ struct it_artifact_armor : public it_armor
data[std::string("melee_dam")] = picojson::value(melee_dam);
data[std::string("melee_cut")] = picojson::value(melee_cut);
data[std::string("m_to_hit")] = picojson::value(m_to_hit);
data[std::string("item_flags")] = picojson::value(item_flags);
std::vector<picojson::value> tags_json;
for(std::set<std::string>::iterator it = item_tags.begin();
it != item_tags.end(); ++it)
{
tags_json.push_back(picojson::value(*it));
}
data[std::string("item_flags")] = picojson::value(tags_json);
data[std::string("techniques")] = picojson::value(techniques);
// armor data
data[std::string("covers")] = picojson::value(covers);
data[std::string("encumber")] = picojson::value(encumber);
data[std::string("dmg_resist")] = picojson::value(dmg_resist);
data[std::string("cut_resist")] = picojson::value(cut_resist);
data[std::string("coverage")] = picojson::value(coverage);
data[std::string("material_thickness")] = picojson::value(thickness);
data[std::string("env_resist")] = picojson::value(env_resist);
data[std::string("warmth")] = picojson::value(warmth);
data[std::string("storage")] = picojson::value(storage);
@@ -960,20 +871,21 @@ struct it_artifact_armor : public it_armor
};
it_artifact_armor(std::string pid, unsigned int pprice, std::string pname,
std::string pdes, char psym, nc_color pcolor, material pm1,
material pm2, unsigned short pvolume, unsigned short pweight,
std::string pdes, char psym, nc_color pcolor, std::string pm1,
std::string pm2, unsigned short pvolume, unsigned short pweight,
signed char pmelee_dam, signed char pmelee_cut,
signed char pm_to_hit, unsigned pitem_flags,
signed char pm_to_hit, std::set<std::string> pitem_tags,
unsigned char pcovers, signed char pencumber,
unsigned char pdmg_resist, unsigned char pcut_resist,
unsigned char pcoverage, unsigned char pthickness,
unsigned char penv_resist, signed char pwarmth,
unsigned char pstorage)
:it_armor(pid, 0, pprice, pname, pdes, psym, pcolor, pm1, pm2,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit, pitem_flags,
pcovers, pencumber, pdmg_resist, pcut_resist, penv_resist, pwarmth,
pvolume, pweight, pmelee_dam, pmelee_cut, pm_to_hit,
pcovers, pencumber, pcoverage, pthickness, penv_resist, pwarmth,
pstorage)
{
item_tags = pitem_tags;
artifact_itype_ids.push_back(pid);
};
};
+112 -495
View File
@@ -34,71 +34,27 @@ void game::init_itypes ()
{
// First, the null object. NOT REALLY AN OBJECT AT ALL. More of a concept.
itypes["null"]=
new itype("null", 0, 0, "none", "", '#', c_white, MNULL, MNULL, PNULL, 0, 0, 0, 0, 0, 0);
new itype("null", 0, 0, "none", "", '#', c_white, "null", "null", PNULL, 0, 0, 0, 0, 0, 0);
// Corpse - a special item
itypes["corpse"]=
new itype("corpse", 0, 0, "corpse", "A dead body.", '%', c_white, MNULL, MNULL, PNULL, 0, 0,
new itype("corpse", 0, 0, "corpse", "A dead body.", '%', c_white, "null", "null", PNULL, 0, 0,
0, 0, 1, 0);
itypes["corpse"]->item_tags.insert("NO_UNLOAD");
// Fire - only appears in crafting recipes
itypes["fire"]=
new itype("fire", 0, 0, "nearby fire",
"Some fire - if you are reading this it's a bug! (itypdef:fire)",
'$', c_red, MNULL, MNULL, PNULL, 0, 0, 0, 0, 0, 0);
'$', c_red, "null", "null", PNULL, 0, 0, 0, 0, 0, 0);
// Integrated toolset - ditto
itypes["toolset"]=
new itype("toolset", 0, 0, "integrated toolset",
"A fake item. If you are reading this it's a bug! (itypdef:toolset)",
'$', c_red, MNULL, MNULL, PNULL, 0, 0, 0, 0, 0, 0);
'$', c_red, "null", "null", PNULL, 0, 0, 0, 0, 0, 0);
// For smoking crack or meth
itypes["apparatus"]=
new itype("apparatus", 0, 0, "something to smoke that from, and a lighter",
"A fake item. If you are reading this it's a bug! (itypdef:apparatus)",
'$', c_red, MNULL, MNULL, PNULL, 0, 0, 0, 0, 0, 0);
// Drinks
// Stim should be -8 to 8.
// quench MAY be less than zero--salt water and liquor make you thirstier.
// Thirst goes up by 1 every 5 minutes; so a quench of 12 lasts for 1 hour
// Any foods with a nutrition of lower than 5 will never prompt a 'You are full, force yourself to eat that?' message
#define DRINK(id, name,rarity,price,color,container,quench,nutr,spoils,stim,\
healthy,addict,charges,fun,use_func,addict_func,des, item_flags) \
itypes[id] = new it_comest(id,rarity,price,name,des,'~',\
color,MNULL,LIQUID,2,1,0,0,0,item_flags,quench,nutr,spoils,stim,healthy,addict,charges,\
fun,container,"null",use_func,addict_func,"DRINK");
#define FOOD(id, name, rarity,price,color,mat1,container,volume,weight,quench,\
nutr,spoils,stim,healthy,addict,charges,fun,use_func,addict_func,des, item_flags) \
itypes[id]=new it_comest(id,rarity,price,name,des,'%',\
color,mat1,SOLID,volume,weight,0,0,0,item_flags, quench,nutr,spoils,stim,healthy,addict,charges,\
fun,container,"null",use_func,addict_func,"FOOD");
// FOOD
// MEDS
#define MED(id, name,rarity,price,color,tool,mat,stim,healthy,addict,\
charges,fun,use_func,addict_func,des) \
itypes[id]=new it_comest(id,rarity,price,name,des,'!',\
color,mat,SOLID,1,1,0,0,0,0,0,0,0,stim,healthy,addict,charges,\
fun,"null",tool,use_func,addict_func,"MED");
/*MED("grack", "Grack Cocaine", 8,420, c_white, "apparatus",
POWDER, 200, -2, 80, 4, 50,&iuse::grack, ADD_CRACK, "\
Grack Cocaine, the strongest substance known to the multiverse\n\
this potent substance is refined from the sweat of the legendary\n\
gracken");
*/
// MELEE WEAPONS
// Only use secondary material if it will have a major impact.
// dam is a somewhat rigid bonus--anything above 30, tops, is ridiculous
// cut is even MORE rigid, and should be kept lower still
// to_hit (affects chances of hitting) should be kept small, -5 to +5
// Note that do-nothing objects (e.g. superglue) belong here too!
#define MELEE(id, name,rarity,price,sym,color,mat1,mat2,volume,wgt,dam,cut,to_hit,\
flags, des)\
itypes[id]=new itype(id,rarity,price,name,des,sym,\
color,mat1,mat2,SOLID,volume,wgt,dam,cut,to_hit,flags);
'$', c_red, "null", "null", PNULL, 0, 0, 0, 0, 0, 0);
#define VAR_VEH_PART(id, name,rarity,price,sym,color,mat1,mat2,volume,wgt,dam,cut,to_hit,\
flags, bigmin, bigmax, bigaspect, des)\
@@ -107,99 +63,62 @@ color,mat1,mat2,volume,wgt,dam,cut,to_hit,flags, bigmin, bigmax, bigaspect)
//"wheel", "wheel_wide", "wheel_bicycle", "wheel_motorbike", "wheel_small",
// NAME RAR PRC SYM COLOR MAT1 MAT2
VAR_VEH_PART("wheel", "wheel", 10, 100, ']', c_dkgray, STEEL, PLASTIC,
VAR_VEH_PART("wheel", "wheel", 10, 100, ']', c_dkgray, "steel", "plastic",
// VOL WGT DAM CUT HIT FLAGS BIGNESS_MIN BIGNESS_MAX BIGNESS_ASPECT
40, 140, 12, 0, -1, 0, 13, 20, BIGNESS_WHEEL_DIAMETER, "\
A car wheel");
// NAME RAR PRC SYM COLOR MAT1 MAT2
VAR_VEH_PART("wheel_wide", "wide wheel", 4, 340, ']', c_dkgray, STEEL, PLASTIC,
VAR_VEH_PART("wheel_wide", "wide wheel", 4, 340, ']', c_dkgray, "steel", "plastic",
// VOL WGT DAM CUT HIT FLAGS BIGNESS_MIN BIGNESS_MAX ASPECT
70, 260, 17, 0, -1, 0, 17, 36, BIGNESS_WHEEL_DIAMETER, "\
A wide wheel. \\o/ This wide.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
VAR_VEH_PART("wheel_bicycle", "bicycle wheel", 18, 40, ']', c_dkgray, STEEL, PLASTIC,
VAR_VEH_PART("wheel_bicycle", "bicycle wheel", 18, 40, ']', c_dkgray, "steel", "plastic",
// VOL WGT DAM CUT HIT FLAGS BIGNESS_MIN BIGNESS_MAX ASPECT
28, 45, 8, 0, -1, 0, 9, 18, BIGNESS_WHEEL_DIAMETER, "\
A bicycle wheel");
// NAME RAR PRC SYM COLOR MAT1 MAT2
VAR_VEH_PART("wheel_motorbike", "motorbike wheel", 13, 140, ']', c_dkgray, STEEL, PLASTIC,
VAR_VEH_PART("wheel_motorbike", "motorbike wheel", 13, 140, ']', c_dkgray, "steel", "plastic",
// VOL WGT DAM CUT HIT FLAGS BIGNESS_MIN BIGNESS_MAX ASPECT
33, 85, 10, 0, -1, 0, 9, 14, BIGNESS_WHEEL_DIAMETER, "\
A motorbike wheel");
// NAME RAR PRC SYM COLOR MAT1 MAT2
VAR_VEH_PART("wheel_small", "small wheel", 5, 140, ']', c_dkgray, STEEL, PLASTIC,
VAR_VEH_PART("wheel_small", "small wheel", 5, 140, ']', c_dkgray, "steel", "plastic",
// VOL WGT DAM CUT HIT FLAGS BIGNESS_MIN BIGNESS_MAX ASPECT
9, 42, 10, 0, -1, 0, 6, 14, BIGNESS_WHEEL_DIAMETER, "\
A pretty small wheel. Probably from one of those segway things.\
It is not very menacing.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
VAR_VEH_PART("1cyl_combustion", "1-cylinder engine", 3, 100, ':', c_ltcyan, IRON, MNULL,
VAR_VEH_PART("1cyl_combustion", "1-cylinder engine", 3, 100, ':', c_ltcyan, "iron", "null",
// VOL WGT DAM CUT HIT FLAGS 0BIGNESS_MIN BIGNESS_MAX ASPECT
6, 70, 4, 0, -1, 0, 28, 75, BIGNESS_ENGINE_DISPLACEMENT, "\
A single-cylinder 4-stroke combustion engine.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
VAR_VEH_PART("v2_combustion", "V-twin engine", 2, 100, ':', c_ltcyan, IRON, MNULL,
VAR_VEH_PART("v2_combustion", "V-twin engine", 2, 100, ':', c_ltcyan, "iron", "null",
// VOL WGT DAM CUT HIT FLAGS BIGNESS_MIN BIGNESS_MAX ASPECT
6, 70, 4, 0, -1, 0, 65, 260, BIGNESS_ENGINE_DISPLACEMENT, "\
A 2-cylinder 4-stroke combustion engine.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
VAR_VEH_PART("i4_combustion", "Inline-4 engine", 6, 150, ':', c_ltcyan, IRON, MNULL,
VAR_VEH_PART("i4_combustion", "Inline-4 engine", 6, 150, ':', c_ltcyan, "iron", "null",
// VOL WGT DAM CUT HIT FLAGS BIGNESS_MIN BIGNESS_MAX ASPECT
6, 160, 8, 0, -2, 0, 220, 350, BIGNESS_ENGINE_DISPLACEMENT, "\
A small, yet powerful 4-cylinder combustion engine.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
VAR_VEH_PART("v6_combustion", "V6 engine", 3, 180, ':', c_ltcyan, IRON, MNULL,
VAR_VEH_PART("v6_combustion", "V6 engine", 3, 180, ':', c_ltcyan, "iron", "null",
// VOL WGT DAM CUT HIT FLAGS BIGNESS_MIN BIGNESS_MAX ASPECT
14, 400, 12, 0, -3, 0, 250, 520, BIGNESS_ENGINE_DISPLACEMENT, "\
A powerful 6-cylinder combustion engine.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
VAR_VEH_PART("v8_combustion", "V8 engine", 2, 250, ':', c_ltcyan, IRON, MNULL,
VAR_VEH_PART("v8_combustion", "V8 engine", 2, 250, ':', c_ltcyan, "iron", "null",
// VOL WGT DAM CUT HIT FLAGS BIGNESS_MIN BIGNESS_MAX ASPECT
25, 600, 15, 0, -5, 0, 380, 700, BIGNESS_ENGINE_DISPLACEMENT, "\
A large and very powerful 8-cylinder combustion engine.");
// ARMOR
#define ARMOR(id, name, rarity,price,color,mat1,mat2,volume,wgt,dam,to_hit,\
encumber,dmg_resist,cut_resist,env,warmth,storage,covers,des,item_flags)\
itypes[id]=new it_armor(id, rarity,price,name,des,'[',\
color,mat1,mat2,volume,wgt,dam,0,to_hit,item_flags,covers,encumber,dmg_resist,cut_resist,\
env,warmth,storage)
#define POWER_ARMOR(id, name,rarity,price,color,mat1,mat2,volume,wgt,dam,to_hit,\
encumber,dmg_resist,cut_resist,env,warmth,storage,covers,des)\
itypes[id] = new it_armor(id,rarity,price,name,des,'[',\
color,mat1,mat2,volume,wgt,dam,0,to_hit,0,covers,encumber,dmg_resist,cut_resist,\
env,warmth,storage,true)
// 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.
// dmg is damage done, in an average hit. Note that the average human has
// 80 health. Headshots do 8x damage; vital hits do 2x-4x; glances do 0x-1x.
// Weight and price is per 100 rounds.
// AP is a reduction in the armor of the target.
// Accuracy is in quarter-degrees, and measures the maximum this ammo will
// contribute to the angle of difference. HIGH ACC IS BAD.
// Recoil is cumulative between shots. 4 recoil = 1 accuracy.
// IMPORTANT: If adding a new AT_*** ammotype, add it to the ammo_name function
// at the end of this file.
#define AMMO(id, name,rarity,price,ammo_type,color,mat,volume,wgt,dmg,AP,range,\
accuracy,recoil,count,des,effects) \
itypes[id]=new it_ammo(id,rarity,price,name,des,'=',\
color,mat,SOLID,volume,wgt,1,0,0,effects,ammo_type,dmg,AP,accuracy,recoil,range,count);
// FUEL
// Fuel is just a special type of ammo; liquid
#define FUEL(id, name,rarity,price,ammo_type,color,dmg,AP,range,accuracy,recoil,\
count,des,effects) \
itypes[id]=new it_ammo(id,rarity,price,name,des,'~',\
color,MNULL,LIQUID,1,1,0,0,0,effects,ammo_type,dmg,AP,accuracy,recoil,range,count)
// GUNS
// ammo_type matches one of the ammo_types above.
// dmg is ADDED to the damage of the corresponding ammo. +/-, should be small.
@@ -209,60 +128,11 @@ color,MNULL,LIQUID,1,1,0,0,0,effects,ammo_type,dmg,AP,accuracy,recoil,range,coun
// clip is how many shots we get before reloading.
#define GUN(id,name,rarity,price,color,mat1,mat2,skill,ammo,volume,wgt,melee_dam,\
to_hit,dmg,range,accuracy,recoil,durability,burst,clip,reload_time,des,flags) \
to_hit,dmg,range,dispersion,recoil,durability,burst,clip,reload_time,des) \
itypes[id]=new it_gun(id,rarity,price,name,des,'(',\
color,mat1,mat2,volume,wgt,melee_dam,0,to_hit,flags,skill,ammo,dmg,range,accuracy,\
color,mat1,mat2,volume,wgt,melee_dam,0,to_hit,skill,ammo,dmg,range,dispersion,\
recoil,durability,burst,clip,reload_time)
// GUN MODS
// Accuracy is inverted from guns; high values are a bonus, low values a penalty
// The clip modification is a percentage of the original clip size.
// The final variable is a bitfield of acceptable ammo types. Using 0 means
// that any ammo type is acceptable (so long as the mod works on the class of
// gun)
#define GUNMOD(id, name, rare, value, color, mat1, mat2, volume, weight, meleedam,\
meleecut, meleehit, acc, damage, loudness, clip, recoil, burst,\
newtype, pistol, shotgun, smg, rifle, a_a_t, des, flags)\
itypes[id]=new it_gunmod(id, rare, value, name, des, ':',\
color, mat1, mat2, volume, weight, meleedam,\
meleecut, meleehit, flags, acc, damage, loudness,\
clip, recoil, burst, newtype, a_a_t, pistol,\
shotgun, smg, rifle)
// BOOKS
// Try to keep colors consistant among types of books.
// TYPE is the skill type required to read, or trained via reading; see skill.h
// LEV is the skill level you can be brought to by this book; if your skill is
// already at LEV or higher, you may enjoy the book but won't learn anything.
// REQ is the skill level required to read this book, at all. If you lack the
// required skill level, you'll waste 10 (?) turns then quit.
// FUN is the fun had by reading;
// INT is an intelligence requirement.
// TIME is the time, in minutes (10 turns), taken to gain the fun/skill bonus.
#define BOOK(id, name,rarity,price,color,mat1,mat2,volume,wgt,melee_dam,to_hit,\
type,level,req,fun,intel,time,des) \
itypes[id]=new it_book(id,rarity,price,name,des,'?',\
color,mat1,mat2,volume,wgt,melee_dam,0,to_hit,0,type,level,req,fun,intel,time)
// NAME RAR PRC COLOR MAT1 MAT2
// CONTAINERS
// These are containers you hold in your hand--ones you wear are _armor_!
// These only have two attributes; contains, which is the volume it holds, and
// the flags. There are only three flags, con_rigid, con_wtight and con_seals.
// con_rigid is used if the item's total volume is constant.
// Otherwise, its volume is calculated as VOL + volume of the contents
// con_wtight is used if you can store liquids in this container
// con_seals is used if it seals--this has many implications
// * Won't spill
// * Can be used as an icebox
// * Others??
#define CONT(id, name,rarity,price,color,mat1,mat2,volume,wgt,melee_dam,to_hit,\
contains,flags,des) \
itypes[id]=new it_container(id,rarity,price,name,des,\
')',color,mat1,mat2,volume,wgt,melee_dam,0,to_hit,0,contains,flags)
// NAME RAR PRC COLOR MAT1 MAT2
/* TOOLS
* MAX is the maximum number of charges help.
* DEF is the default number of charges--items will be generated with this
@@ -270,7 +140,7 @@ itypes[id]=new it_container(id,rarity,price,name,des,\
* USE is how many charges are used up when 'a'pplying the object.
* SEC is how many turns will pass before a charge is drained if the item is
* active; generally only used in the "<whatever> (on)" forms
* FUEL is the type of charge the tool uses; set to AT_NULL if the item is
* FUEL is the type of charge the tool uses; set to "NULL" if the item is
* unable to be recharged.
* REVERT is the item type that the tool will revert to once its charges are
* drained
@@ -280,268 +150,14 @@ itypes[id]=new it_container(id,rarity,price,name,des,\
*/
#define TOOL(id, name,rarity,price,sym,color,mat1,mat2,volume,wgt,melee_dam,\
melee_cut,to_hit,max_charge,def_charge,charge_per_use,charge_per_sec,fuel,\
revert,func,flags,des) \
revert,func,des) \
itypes[id]=new it_tool(id,rarity,price,name,des,sym,\
color,mat1,mat2,SOLID,volume,wgt,melee_dam,melee_cut,to_hit,flags,max_charge,\
color,mat1,mat2,SOLID,volume,wgt,melee_dam,melee_cut,to_hit,max_charge,\
def_charge,charge_per_use,charge_per_sec,fuel,revert,func)
// NAME RAR PRC COLOR MAT1 MAT2 VOL WGT DAM CUT HIT
GUNMOD("suppressor", "suppressor", 15, 480, c_dkgray, STEEL, PLASTIC, 2, 1, 3, 0, 2,
// ACC DAM NOI CLP REC BST NEWTYPE, PISTOL SHOT SMG RIFLE
-1, -4,-25, 0, 0, 0, AT_NULL, true, false, true, true,
0, "\
Using a suppressor is almost an imperative in zombie-infested regions. Gunfire\n\
is very noisy, and will attract predators. Its only drawback is a reduced\n\
muzzle velocity, resulting in less accuracy and damage.",
0);
GUNMOD("grip", "enhanced grip", 12, 280, c_brown, STEEL, PLASTIC, 1, 1, 0, 0, -1,
2, 0, 0, 0, -2, 0, AT_NULL, false, true, true, true,
0, "\
A grip placed forward on the barrel allows for greater control and accuracy.\n\
Aside from increased weight, there are no drawbacks.",
0);
GUNMOD("barrel_big", "barrel extension",10,400, c_ltgray, STEEL, MNULL, 4, 1, 5, 0, 2,
6, 1, 0, 0, 5, 0, AT_NULL, false, false, true, true,
0, "\
A longer barrel increases the muzzle velocity of a firearm, contributing to\n\
both accuracy and damage. However, the longer barrel tends to vibrate after\n\
firing, greatly increasing recoil.",
0);
// NAME RAR PRC COLOR MAT1 MAT2 VOL WGT DAM CUT HIT
GUNMOD("barrel_small", "shortened barrel", 6, 320, c_ltgray, STEEL, MNULL, 1, 1, -2, 0, -1,
// ACC DAM NOI CLP REC BST NEWTYPE, PISTOL SHOT SMG RIFLE
-5, 0, 2, 0, -6, 0, AT_NULL, false, false, true, true,
0, "\
A shortened barrel results in markedly reduced accuracy, and a minor increase\n\
in noise, but also reduces recoil greatly as a result of the improved\n\
managability of the firearm.",
0);
GUNMOD("barrel_rifled", "rifled barrel", 5, 220, c_ltgray, STEEL, MNULL, 2, 1, 3, 0, 1,
10,-20, 0, 0, 0, -1, AT_NULL, false, true, false, false,
0, "\
Rifling a shotgun barrel is mainly done in order to improve its accuracy when\n\
firing slugs. The rifling makes the gun less suitable for shot, however.",
0);
GUNMOD("clip", "extended magazine", 8, 560, c_ltgray, STEEL, PLASTIC, 1, 1, -2, 0, -1,
-1, 0, 0, 50, 0, 0, AT_NULL, true, true, true, true,
0, "\
Increases the ammunition capacity of your firearm by 50%, but the added bulk\n\
reduces accuracy slightly.",
0);
// NAME RAR PRC COLOR MAT1 MAT2 VOL WGT DAM CUT HIT
GUNMOD("clip2", "double magazine", 4, 720, c_ltgray, STEEL, PLASTIC, 2, 2, 0, 0, 0,
// ACC DAM NOI CLP REC BST NEWTYPE, PISTOL SHOT SMG RIFLE
-2, 0, 0,100, 2, 0, AT_NULL, false, true, true, true,
0, "\
Completely doubles the ammunition capacity of your firearm, but the added\n\
bulk reduces accuracy and increases recoil.",
0);
GUNMOD("spare_mag", "spare magazine", 15, 200, c_ltgray, STEEL, PLASTIC, 1, 1, 0, 0, 0,
0, 0, 0, 0, 0, 0, AT_NULL, true, true, true, true,
0, "\
A spare magazine you can keep on hand to make reloads faster, but must itself\n\
be reloaded before it can be used again.",
0);
GUNMOD("stablizer", "gyroscopic stablizer",4,680,c_blue, STEEL, PLASTIC, 3, 2, 0, 0, -3,
2, -2, 0,-10, -8, 0, AT_NULL, false, false, true, true,
0, "\
An advanced unit that straps onto the side of your firearm and reduces\n\
vibration, greatly reducing recoil and increasing accuracy. However, it also\n\
takes up space in the magazine slot, reducing ammo capacity.",
0);
GUNMOD("blowback", "rapid blowback", 3, 700, c_red, STEEL, PLASTIC, 0, 1, 0, 0, 0,
-3, 0, 4, 0, 0, 6, AT_NULL, false, false, true, true,
0, "\
An improved blowback mechanism makes your firearm's automatic fire faster, at\n\
the cost of reduced accuracy and increased noise.",
0);
// NAME RAR PRC COLOR MAT1 MAT2 VOL WGT DAM CUT HIT
GUNMOD("autofire", "auto-fire mechanism",2,650,c_red, STEEL, PLASTIC, 1, 2, 2, 0, -1,
// ACC DAM NOI CLP REC BST NEWTYPE, PISTOL SHOT SMG RIFLE
-2, 0, 2, 0, 2, 3, AT_NULL, true, false, false, false,
(mfb(AT_22)|mfb(AT_9MM)|mfb(AT_38)|mfb(AT_40)|mfb(AT_57)|mfb(AT_46)), "\
A simple mechanism that converts a pistol to a fully-automatic weapon, with\n\
a burst size of three rounds. However, it reduces accuracy, and increases\n\
noise and recoil.",
0);
GUNMOD("retool_9mm", "9mm caliber retool",3,420, c_green, STEEL, MNULL, 1, 1, 0, 0, -1,
-1, 0, 0, 0, 0, 0, AT_9MM, true, false, true, false,
(mfb(AT_38)|mfb(AT_40)|mfb(AT_44)|mfb(AT_45)), "\
Replacing several key parts of a .38, .40, .44 or .45 firearm converts it to\n\
a 9mm firearm. The conversion results in a slight reduction in accuracy.",
0);
GUNMOD("retool_22", ".22 caliber retool",2,320, c_green, STEEL, MNULL, 1, 1, -2, 0, -1,
-1, 0, 0, 0, 0, 0, AT_22, true, false, true, true,
(mfb(AT_9MM)|mfb(AT_38)|mfb(AT_40)|mfb(AT_57)|mfb(AT_46)|mfb(AT_762)|
mfb(AT_223)), "\
Replacing several key parts of a 9mm, .38, .40, 5.7mm, 4.6mm, 7.62mm or .223\n\
firearm converts it to a .22 firearm. The conversion results in a slight\n\
reduction in accuracy.",
0);
// NAME RAR PRC COLOR MAT1 MAT2 VOL WGT DAM CUT HIT
GUNMOD("retool_57", "5.7mm caliber retool",1,460,c_green, STEEL, MNULL, 1, 1, -3, 0, -1,
// ACC DAM NOI CLP REC BST NEWTYPE, PISTOL SHOT SMG RIFLE
-1, 0, 0, 0, 0, 0, AT_57, true, false, true, false,
(mfb(AT_22)|mfb(AT_9MM)|mfb(AT_38)), "\
FN Hestal sells a conversion kit, used to convert .22, 9mm, or .38 firearms\n\
to their proprietary 5.7x28mm, a round designed for accuracy and armor\n\
penetration.",
0);
GUNMOD("retool_46", "4.6mm caliber retool",1,460,c_green, STEEL, MNULL, 1, 1, -3, 0, -1,
-1, 0, 0, 0, 0, 0, AT_46, true, false, true, false,
(mfb(AT_22)|mfb(AT_9MM)|mfb(AT_38)), "\
Heckler and Koch sells a conversion kit, used to convert .22, 9mm, or .38\n\
firearms to their proprietary 4.6x30mm, a round designed for accuracy and\n\
armor penetration.",
0);
// NAME RAR PRC COLOR MAT1 MAT2 VOL WGT DAM CUT HIT
GUNMOD("retool_308", ".308 caliber retool",2,520,c_green, STEEL, MNULL, 2, 1, 4, 0, 1,
// ACC DAM NOI CLP REC BST NEWTYPE PISTOL SHOT SMG RIFLE
-2, 0, 0,-20, 0, 0, AT_308, false, true, false, true,
(mfb(AT_SHOT)|mfb(AT_762)|mfb(AT_223)|mfb(AT_3006)), "\
This kit is used to convert a shotgun or 7.62mm, .223 or .30-06 rifle to the\n\
popular and powerful .308 caliber. The conversion results in reduced ammo\n\
capacity and a slight reduction in accuracy.",
0);
GUNMOD("retool_223", ".223 caliber retool",2,500,c_green, STEEL, MNULL, 2, 1, 4, 0, 1,
-2, 0, 0,-10, 0, 0, AT_223, false, true, false, true,
(mfb(AT_SHOT)|mfb(AT_762)|mfb(AT_3006)|mfb(AT_308)), "\
This kit is used to convert a shotgun or 7.62mm, .30-06, or .308 rifle to the\n\
popular, accurate, and damaging .223 caliber. The conversion results in\n\
slight reductions in both accuracy and ammo capacity.",
0);
// NAME RAR PRC COLOR MAT1 MAT2 VOL WGT DAM CUT HIT
GUNMOD("conversion_battle", "battle rifle conversion",1,680,c_magenta,STEEL,MNULL, 4, 3, 6, 0, -1,
// ACC DAM NOI CLP REC BST NEWTYPE PISTOL SHOT SMG RIFLE
-6, 6, 4, 20, 4, 4, AT_NULL, false, false, false, true,
0, "\
This is a complete conversion kit, designed to turn a rifle into a powerful\n\
battle rifle. It reduces accuracy, and increases noise and recoil, but also\n\
increases damage, ammo capacity, and fire rate.",
0);
GUNMOD("conversion_sniper", "sniper conversion",1,660, c_green, STEEL, MNULL, 1, 2, 0, 0, -1,
10, 8, 3,-15, 0,-99, AT_NULL, false, false, false, true,
0, "\
This is a complete conversion kit, designed to turn a rifle into a deadly\n\
sniper rifle. It decreases ammo capacity, and removes any automatic fire\n\
capabilities, but also increases accuracy and damage.",
0);
GUNMOD("m203", "M203", 2,650, c_ltred, STEEL, MNULL, 2, 1, 2, 0, -1,
-2, 0, 0, 1, 0, 0, AT_40MM, false, false, false, true,
0, "\
The M203 was originally designed for use with M16 variants but today can be\n\
attached to almost any rifle. It allows a single 40mm grenade to be loaded\n\
and fired.",
mfb(IF_MODE_AUX));
// NAME RAR PRC COLOR MAT1 MAT2 VOL WGT DAM CUT HIT
GUNMOD("bayonet", "bayonet", 6, 400, c_ltcyan, STEEL, MNULL, 2, 2, 0, 16, -3,
// ACC DAM NOI CLP REC BST NEWTYPE PISTOL SHOT SMG RIFLE
0, 0, 0, 0, 3, 0, AT_NULL, false, true, true, true,
0, "\
A bayonet is a stabbing weapon that can be attached to the front of a\n\
shotgun, sub-machinegun or rifle, allowing a melee attack to deal\n\
piercing damage. The added length increases recoil slightly.",
mfb(IF_STAB));
GUNMOD("u_shotgun", "underslung shotgun", 2,650, c_ltred, STEEL, MNULL, 2, 1, 2, 0, -1,
-2, 0, 0, 2, 0, 0, AT_SHOT, false, false, false, true,
0, "\
A miniaturized shotgun with 2 barrels, which can be mounted under the\n\
barrel of many rifles. It allows two shotgun shells to be loaded and fired.",
mfb(IF_MODE_AUX));
GUNMOD("gun_crossbow", "rail-mounted crossbow", 2, 500, c_ltred, STEEL, WOOD, 2, 1, 2, 0, -1,
0, 0, 0, 1, 0, 0, AT_BOLT, false, true, false, true,
0, "\
A kit to attach a pair of crossbow arms and a firing rail to\n\
the barrel of a long firearm. It allows crossbow bolts to be fired.",
mfb(IF_MODE_AUX)|mfb(IF_STR_RELOAD));
CONT("bag_plastic", "plastic bag", 50, 1, c_ltgray, PLASTIC,MNULL,
// VOL WGT DAM HIT VOL FLAGS
1, 0, -8, -4, 24, 0, "\
A small, open plastic bag. Essentially trash.");
CONT("bottle_plastic", "plastic bottle", 70, 8, c_ltcyan, PLASTIC,MNULL,
2, 0, -8, 1, 2, mfb(con_rigid)|mfb(con_wtight)|mfb(con_seals),"\
A resealable plastic bottle, holds 500mls of liquid.");
CONT("bottle_glass", "glass bottle", 70, 12, c_cyan, GLASS, MNULL,
3, 2, 8, 1, 3, mfb(con_rigid)|mfb(con_wtight)|mfb(con_seals),"\
A resealable glass bottle, holds 750mls of liquid.");
CONT("can_drink", "aluminum can", 70, 1, c_ltblue, STEEL, MNULL,
1, 0, 0, 0, 1, mfb(con_rigid)|mfb(con_wtight), "\
An aluminum can, like what soda comes in.");
CONT("can_food", "tin can", 65, 2, c_blue, IRON, MNULL,
1, 0, -1, 1, 1, mfb(con_rigid)|mfb(con_wtight), "\
A tin can, like what beans come in.");
CONT("box_small", "sm. cardboard box",50, 0, c_brown, PAPER, MNULL,
4, 0, -5, 1, 4, mfb(con_rigid), "\
A small cardboard box. No bigger than a foot in any dimension.");
CONT("canteen", "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 liter capacity and strap.");
CONT("jerrycan", "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 liters.");
CONT("jug_plastic", "gallon jug", 10, 2500, c_ltcyan, PLASTIC,MNULL,
10, 2, -8, 1, 10, mfb(con_rigid)|mfb(con_wtight)|mfb(con_seals),"\
A standard plastic jug used for household cleaning chemicals.");
CONT("flask_glass", "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", "waterskin", 0, 0, c_brown, LEATHER, MNULL,
// VOL WGT DAM HIT VOL FLAGS
6, 4, -8, -5, 6, mfb(con_wtight)|mfb(con_seals), "\
A watertight leather bag, can hold 1.5 liters of water.");
CONT("jerrycan_big", "steel jerrycan", 20, 5000, c_green, STEEL, MNULL,
100, 7, -3, -3, 100, mfb(con_rigid)|mfb(con_wtight)|mfb(con_seals),"\
A steel jerrycan, meant to carry fuel, but can carry other liquds\n\
in a pinch. It has a capacity of 25 liters.");
CONT("keg", "aluminum keg", 20, 6000, c_ltcyan, STEEL, MNULL,
200, 12, -4, -4, 200, mfb(con_rigid)|mfb(con_wtight)|mfb(con_seals),"\
A reusable aluminum keg, used for shipping beer.\n\
It has a capcity of 50 liters.");
CONT("jar_glass", "glass jar", 50, 2500, c_ltcyan, GLASS,MNULL,
1, 1, 8, 1, 1, mfb(con_rigid)|mfb(con_wtight)|mfb(con_seals),"\
A half-litre glass jar with a metal screw top lid, used for canning.");
TOOL("jack", "jack", 30, 86, ';', c_ltgray, IRON, MNULL,
TOOL("jack", "jack", 30, 86, ';', c_ltgray, "iron", "null",
// VOL WGT DAM CUT HIT FLAGS
5, 10, 11, 0, 2, 0, 0, 0, 0, AT_NULL, "null", &iuse::none, 0, "\
5, 10, 11, 0, 2, 0, 0, 0, 0, "NULL", "null", &iuse::none, "\
A common hydraulic jack, used when changing tires.");
// BIONICS
@@ -550,11 +166,11 @@ A common hydraulic jack, used when changing tires.");
// list of options.
#define BIO(id, name, rarity, price, color, difficulty, des) \
itypes[id]=new it_bionic(id, rarity,price,name,des,':',\
color, STEEL, PLASTIC, 10, 18, 8, 0, 0, 0, difficulty)
color, "steel", "plastic", 10, 18, 8, 0, 0, difficulty)
#define BIO_SINGLE(id,rarity,price,color,difficulty) \
BIO(id, std::string("CBM: ")+bionics[id]->name, rarity,price,color,difficulty, \
word_rewrap(bionics[id]->description, 50)) \
bionics[id]->description) \
// Name RAR PRICE COLOR DIFFICULTY
BIO("bio_power_storage", "CBM: Power Storage", 24, 3800, c_green, 1, "\
@@ -570,13 +186,13 @@ by 10 units."); // This is another special case, increases power capacity by 10
// SOFTWARE
#define SOFTWARE(id, name, price, swtype, power, description) \
itypes[id]=new it_software(id, 0, price, name, description,\
' ', c_white, MNULL, MNULL, 0, 0, 0, 0, 0, 0, swtype, power)
' ', c_white, "null", "null", 0, 0, 0, 0, 0, swtype, power)
//Macguffins
#define MACGUFFIN(id, name, price, sym, color, mat1, mat2, volume, wgt, dam, cut,\
to_hit, readable, function, description) \
itypes[id]=new it_macguffin(id, 0, price, name, description,\
sym, color, mat1, mat2, volume, wgt, dam, cut, to_hit, 0, readable,\
sym, color, mat1, mat2, volume, wgt, dam, cut, to_hit, readable,\
function)
// BIONIC IMPLANTS
@@ -628,6 +244,7 @@ BIO_SINGLE("bio_water_extractor", 3, 5500, c_green, 5);
BIO_SINGLE("bio_shock", 2, 5500, c_red, 5);
BIO_SINGLE("bio_heat_absorb", 2, 5500, c_red, 5);
BIO_SINGLE("bio_claws", 2, 5500, c_red, 5);
BIO_SINGLE("bio_shockwave", 2, 5500, c_red, 5);
// armor:
BIO_SINGLE("bio_carbon", 3, 7500, c_cyan, 9);
BIO_SINGLE("bio_armor_head", 3, 3500, c_cyan, 5);
@@ -638,7 +255,8 @@ BIO_SINGLE("bio_armor_legs", 3, 3500, c_cyan, 3);
BIO_SINGLE("bio_face_mask", 1, 8500, c_magenta, 5);
BIO_SINGLE("bio_scent_mask", 1, 8500, c_magenta, 5);
BIO_SINGLE("bio_cloak", 1, 8500, c_magenta, 5);
BIO_SINGLE("bio_fingerhack", 1, 3500, c_magenta, 2);
BIO_SINGLE("bio_fingerhack", 1, 3500, c_magenta, 2);
BIO_SINGLE("bio_night", 1, 8500, c_magenta, 5);
// defensive
BIO_SINGLE("bio_ads", 1, 9500, c_ltblue, 7);
BIO_SINGLE("bio_ods", 1, 9500, c_ltblue, 7);
@@ -650,13 +268,18 @@ BIO_SINGLE("bio_resonator", 2, 12000, c_dkgray, 11);
BIO_SINGLE("bio_hydraulics", 3, 4000, c_dkgray, 6);
// super soldier
BIO_SINGLE("bio_time_freeze", 1, 14000, c_white, 11);
BIO_SINGLE("bio_teleport", 1, 7000, c_white, 7);
BIO_SINGLE("bio_teleport", 1, 7000, c_white, 7);
BIO_SINGLE("bio_probability_travel", 1, 14000, c_white, 11);
// ranged combat
BIO_SINGLE("bio_blaster", 13, 2200, c_red, 3);
BIO_SINGLE("bio_laser", 2, 7200, c_red, 5);
BIO_SINGLE("bio_emp", 2, 7200, c_red, 5);
BIO_SINGLE("bio_emp", 2, 7200, c_red, 5);
BIO_SINGLE("bio_flashbang", 2, 7200, c_red, 5);
BIO_SINGLE("bio_railgun", 5, 2200, c_red, 3);
BIO_SINGLE("bio_chain_lightning", 5, 2200, c_red, 3);
// power armor
BIO_SINGLE("bio_power_armor_interface", 20, 1200, c_yellow, 1);
BIO_SINGLE("bio_power_armor_interface_mkII", 8, 10000, c_yellow, 8);
SOFTWARE("software_useless", "misc software", 300, SW_USELESS, 0, "\
A miscellaneous piece of hobby software. Probably useless.");
@@ -673,13 +296,13 @@ A piece of mathematical software.");
SOFTWARE("software_blood_data", "infection data", 200, SW_DATA, 5, "\
Medical data on zombie blood.");
MACGUFFIN("note", "note", 0, '?', c_white, PAPER, MNULL, 1, 0, 0, 0, 0,
MACGUFFIN("note", "note", 0, '?', c_white, "paper", "null", 1, 0, 0, 0, 0,
true, &iuse::mcg_note, "\
A hand-written paper note.");
#define STATIONARY(id, name, rarity, price, category, description) \
itypes[id] = new it_stationary(id, rarity, price, name, description,\
',', c_white, PAPER, MNULL, 0, 0, 0, 0, 0, 0, category)
',', c_white, "paper", "null", 0, 0, 0, 0, 0, category)
STATIONARY("flyer", "flyer", 5, 1, "flier", "A scrap of paper.");
@@ -692,28 +315,26 @@ for(std::map<std::string,itype*>::iterator iter = itypes.begin(); iter != itypes
}
}
// NAME RARE TYPE COLOR MAT
AMMO("bio_fusion_ammo", "Fusion blast", 0,0, AT_FUSION,c_dkgray, MNULL,
// VOL WGT DMG AP RNG ACC REC COUNT
0, 0, 40, 0, 10, 1, 0, 5, "", mfb(AMMO_INCENDIARY));
// NAME RARE COLOR MAT1 MAT2
GUN("bio_blaster_gun", "fusion blaster", 0,0,c_magenta, STEEL, PLASTIC,
GUN("bio_blaster_gun", "fusion blaster", 0,0,c_magenta, "steel", "plastic",
// SKILL AMMO VOL WGT MDG HIT DMG RNG ACC REC DUR BST CLIP REL
"rifle", AT_FUSION, 12, 0, 0, 0, 0, 0, 4, 0, 10, 0, 1, 500,
"",0);
"rifle", "fusion", 12, 0, 0, 0, 0, 0, 4, 0, 10, 0, 1, 500,
"");
// NAME RARE COLOR MAT1 MAT2
GUN("bio_lightning", "Chain Lightning", 0,0,c_magenta, "steel", "plastic",
// SKILL AMMO VOL WGT MDG HIT DMG RNG ACC REC DUR BST CLIP REL
"rifle", "fusion", 12, 0, 0, 0, 0, 0, 4, 0, 10, 1, 10, 500,
"");
// Unarmed Styles
// TODO: refactor handling of styles see #1771
#define STYLE(id, name, dam, description, ...) \
itypes[id]=new it_style(id, 0, 0, name, description, '$', \
c_white, MNULL, MNULL, 0, 0, dam, 0, 0, 0); \
c_white, "null", "null", 0, 0, dam, 0, 0); \
setvector(&((static_cast<it_style*>(itypes[id])))->moves, __VA_ARGS__, NULL); \
itypes[id]->item_flags |= mfb(IF_UNARMED_WEAPON); \
itypes[id]->item_tags.insert("UNARMED_WEAPON"); \
martial_arts_itype_ids.push_back(id)
STYLE("style_karate", "karate", 2, "\
@@ -930,73 +551,69 @@ attacks with no penalty.",
std::string ammo_name(ammotype t)
{
switch (t) {
case AT_NAIL: return "nails";
case AT_BB: return "BBs";
case AT_BOLT: return "bolts";
case AT_ARROW: return "arrows";
case AT_PEBBLE: return "pebbles";
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";
case AT_45: return ".45";
case AT_57: return "5.7mm";
case AT_46: return "4.6mm";
case AT_762: return "7.62x39mm";
case AT_223: return ".223";
case AT_3006: return ".30-06";
case AT_308: return ".308";
case AT_40MM: return "40mm grenade";
case AT_66MM: return "High Explosive Anti Tank Warhead";
case AT_GAS: return "gasoline";
case AT_THREAD: return "thread";
case AT_BATT: return "batteries";
case AT_PLUT: return "plutonium";
case AT_MUSCLE: return "Muscle";
case AT_FUSION: return "fusion cell";
case AT_12MM: return "12mm slugs";
case AT_PLASMA: return "hydrogen";
case AT_WATER: return "clean water";
default: return "XXX";
}
if( t == "nail") return "nails";
if( t == "BB" ) return "BBs";
if( t == "bolt" ) return "bolts";
if( t == "arrow" ) return "arrows";
if( t == "pebble" )return "pebbles";
if( t == "shot" ) return "shot";
if( t == "22" ) return ".22";
if( t == "9mm" ) return "9mm";
if( t == "762x25" )return "7.62x25mm";
if( t == "38" ) return ".38";
if( t == "40" ) return ".40";
if( t == "44" ) return ".44";
if( t == "45" ) return ".45";
if( t == "57" ) return "5.7mm";
if( t == "46" ) return "4.6mm";
if( t == "762" ) return "7.62x39mm";
if( t == "223" ) return ".223";
if( t == "3006" ) return ".30-06";
if( t == "308" ) return ".308";
if( t == "40mm" ) return "40mm grenade";
if( t == "66mm" ) return "High Explosive Anti Tank Warhead";
if( t == "gasoline" ) return "gasoline";
if( t == "THREAD" )return "thread";
if( t == "battery" ) return "batteries";
if( t == "plutonium" ) return "plutonium";
if( t == "muscle" )return "Muscle";
if( t == "fusion" )return "fusion cell";
if( t == "12mm" ) return "12mm slugs";
if( t == "plasma" )return "hydrogen";
if( t == "water" )return "clean water";
return "XXX";
}
itype_id default_ammo(ammotype guntype)
{
switch (guntype) {
case AT_NAIL: return "nail";
case AT_BB: return "bb";
case AT_BOLT: return "bolt_wood";
case AT_ARROW: return "arrow_wood";
case AT_PEBBLE:return "pebble";
case AT_SHOT: return "shot_00";
case AT_22: return "22_lr";
case AT_9MM: return "9mm";
case AT_762x25:return "762_25";
case AT_38: return "38_special";
case AT_40: return "10mm";
case AT_44: return "44magnum";
case AT_45: return "45_acp";
case AT_57: return "57mm";
case AT_46: return "46mm";
case AT_762: return "762_m43";
case AT_223: return "223";
case AT_308: return "308";
case AT_3006: return "270";
case AT_40MM: return "40mm_concussive";
case AT_66MM: return "66mm_HEAT";
case AT_BATT: return "battery";
case AT_FUSION:return "laser_pack";
case AT_12MM: return "12mm";
case AT_PLASMA:return "plasma";
case AT_PLUT: return "plut_cell";
case AT_GAS: return "gasoline";
case AT_THREAD:return "thread";
case AT_WATER:return "water_clean";
}
return "null";
if( guntype == "nail" ) return "nail";
if( guntype == "BB" ) return "bb";
if( guntype == "bolt" ) return "bolt_wood";
if( guntype == "arrow" ) return "arrow_wood";
if( guntype == "pebble" )return "pebble";
if( guntype == "shot" ) return "shot_00";
if( guntype == "22" ) return "22_lr";
if( guntype == "9mm" ) return "9mm";
if( guntype == "762x25" )return "762_25";
if( guntype == "38" ) return "38_special";
if( guntype == "40" ) return "10mm";
if( guntype == "44" ) return "44magnum";
if( guntype == "45" ) return "45_acp";
if( guntype == "57" ) return "57mm";
if( guntype == "46" ) return "46mm";
if( guntype == "762" ) return "762_m43";
if( guntype == "223" ) return "223";
if( guntype == "308" ) return "308";
if( guntype == "3006" ) return "270";
if( guntype == "40mm" ) return "40mm_concussive";
if( guntype == "66mm" ) return "66mm_HEAT";
if( guntype == "battery" ) return "battery";
if( guntype == "fusion" )return "laser_pack";
if( guntype == "12mm" ) return "12mm";
if( guntype == "plasma" )return "plasma";
if( guntype == "plutonium" ) return "plut_cell";
if( guntype == "gasoline" ) return "gasoline";
if( guntype == "THREAD" )return "thread";
if( guntype == "water" ) return "water_clean";
return "null";
}
+1331 -791
View File
File diff suppressed because it is too large Load Diff
+17 -7
View File
@@ -18,14 +18,11 @@ class iuse
void royal_jelly (game *g, player *p, item *it, bool t);
void bandage (game *g, player *p, item *it, bool t);
void firstaid (game *g, player *p, item *it, bool t);
void disinfectant (game *g, player *p, item *it, bool t);
void caff (game *g, player *p, item *it, bool t);
void alcohol (game *g, player *p, item *it, bool t);
void alcohol_weak (game *g, player *p, item *it, bool t);
void pkill_1 (game *g, player *p, item *it, bool t);
void pkill_2 (game *g, player *p, item *it, bool t);
void pkill_3 (game *g, player *p, item *it, bool t);
void pkill_4 (game *g, player *p, item *it, bool t);
void pkill_l (game *g, player *p, item *it, bool t);
void pkill (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);
@@ -34,6 +31,8 @@ class iuse
void crack (game *g, player *p, item *it, bool t);
void grack (game *g, player *p, item *it, bool t);
void meth (game *g, player *p, item *it, bool t);
void vitamins (game *g, player *p, item *it, bool t);
void vaccine (game *g, player *p, item *it, bool t);
void poison (game *g, player *p, item *it, bool t);
void hallu (game *g, player *p, item *it, bool t);
void thorazine (game *g, player *p, item *it, bool t);
@@ -45,7 +44,6 @@ class iuse
void inhaler (game *g, player *p, item *it, bool t);
void blech (game *g, player *p, item *it, bool t);
void mutagen (game *g, player *p, item *it, bool t);
void mutagen_3 (game *g, player *p, item *it, bool t);
void purifier (game *g, player *p, item *it, bool t);
void marloss (game *g, player *p, item *it, bool t);
void dogfood (game *g, player *p, item *it, bool t);
@@ -60,11 +58,14 @@ class iuse
void hammer (game *g, player *p, item *it, bool t);
void light_off (game *g, player *p, item *it, bool t);
void light_on (game *g, player *p, item *it, bool t);
void gasoline_lantern_off (game *g, player *p, item *it, bool t);
void gasoline_lantern_on (game *g, player *p, item *it, bool t);
void lightstrip (game *g, player *p, item *it, bool t);
void lightstrip_active(game *g, player *p, item *it, bool t);
void glowstick (game *g, player *p, item *it, bool t);
void glowstick_active(game *g, player *p, item *it, bool t);
void cauterize_elec (game *g, player *p, item *it, bool t);
void solder_weld (game *g, player *p, item *it, bool t);
void water_purifier (game *g, player *p, item *it, bool t);
void two_way_radio (game *g, player *p, item *it, bool t);
void directional_antenna (game *g, player *p, item *it, bool t);
@@ -76,9 +77,11 @@ class iuse
void roadmap_a_target (game *g, player *p, item *it, bool t, int target);
void roadmap_targets(game *g, player *p, item *it, bool t, int target, int target_range, int distance, int reveal_distance);
void picklock (game *g, player *p, item *it, bool t);
void improvised_picklock (game *g, player *p, item *it, bool t);
void crowbar (game *g, player *p, item *it, bool t);
void makemound (game *g, player *p, item *it, bool t);
void dig (game *g, player *p, item *it, bool t);
void siphon (game *g, player *p, item *it, bool t);
void chainsaw_off (game *g, player *p, item *it, bool t);
void chainsaw_on (game *g, player *p, item *it, bool t);
void jackhammer (game *g, player *p, item *it, bool t);
@@ -105,6 +108,7 @@ class iuse
void smokebomb (game *g, player *p, item *it, bool t);
void smokebomb_act (game *g, player *p, item *it, bool t);
void acidbomb (game *g, player *p, item *it, bool t);
void arrow_flamable (game *g, player *p, item *it, bool t);
void acidbomb_act (game *g, player *p, item *it, bool t);
void molotov (game *g, player *p, item *it, bool t);
void molotov_lit (game *g, player *p, item *it, bool t);
@@ -122,6 +126,8 @@ class iuse
void turret (game *g, player *p, item *it, bool t);
void UPS_off (game *g, player *p, item *it, bool t);
void UPS_on (game *g, player *p, item *it, bool t);
void adv_UPS_off (game *g, player *p, item *it, bool t);
void adv_UPS_on (game *g, player *p, item *it, bool t);
void tazer (game *g, player *p, item *it, bool t);
void mp3 (game *g, player *p, item *it, bool t);
void mp3_on (game *g, player *p, item *it, bool t);
@@ -129,6 +135,7 @@ class iuse
void dog_whistle (game *g, player *p, item *it, bool t);
void vacutainer (game *g, player *p, item *it, bool t);
void knife (game *g, player *p, item *it, bool t);
static void cut_log_into_planks(game *g, player *p, item *it);
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);
@@ -148,7 +155,10 @@ class iuse
void heatpack (game *g, player *p, item *it, bool t);
void dejar (game *g, player *p, item *it, bool t);
void devac (game *g, player *p, item *it, bool t);
void rad_badge (game *g, player *p, item *it, bool t);
void boots (game *g, player *p, item *it, bool t);
void towel (game *g, player *p, item *it, bool t);
void unfold_bicycle (game *g, player *p, item *it, bool t);
// MACGUFFINS
void mcg_note (game *g, player *p, item *it, bool t);
// ARTIFACTS
+5 -2
View File
@@ -8,8 +8,8 @@ long input(long ch)
ch = getch();
}
// Needs a totally seperate implementation for windows
#if !(defined _WIN32 || defined WINDOWS)
// Our current tiles and Windows code doesn't have ungetch()
#if !(defined TILES || defined _WIN32 || defined WINDOWS)
int newch;
// Clear the buffer of characters that match the one we're going to act on.
@@ -25,6 +25,7 @@ long input(long ch)
}
#endif
switch (ch) {
case KEY_UP: return 'k';
case KEY_LEFT: return 'h';
@@ -219,6 +220,7 @@ select_fire_mode F\n\
drop d\n\
drop_adj D\n\
bionics p\n\
sort_armor +\n\
\n\
# LONG TERM & SPECIAL ACTIONS\n\
wait |\n\
@@ -227,6 +229,7 @@ recraft -\n\
construct *\n\
disassemble (\n\
sleep $\n\
control_vehicle ^\n\
safemode !\n\
autosafe \"\n\
ignore_enemy '\n\
+63
View File
@@ -0,0 +1,63 @@
#!/usr/bin/env python
"Extract translatable strings from the .json files in data/raw."
from __future__ import print_function
import json
import os
# allow running from main directory, or from script subdirectory
if os.path.exists("data/raw"):
raw_folder = "data/raw"
to_folder = "lang/json"
elif os.path.exists("../data/raw"):
raw_folder = "../data/raw"
to_folder = "../lang/json"
else:
print("Error: Couldn't find the 'data/raw' subdirectory.")
exit(1)
def gettextify(string):
"Put the string in a fake gettext call, and add a newline."
return "_(%r)\n" % string
# create the output directory, if it does not already exist
if not os.path.exists(to_folder):
os.mkdir(to_folder)
# extract "name" and "description" fields from json to fake-python
def convert(infilename, outfile):
"open infilename, read data, write names and descriptions to outfile."
jsondata = json.loads(open(infilename).read())
names = [item["name"] for item in jsondata]
descriptions = [item["description"] for item in jsondata]
for n, d in zip(names, descriptions):
outfile.write(gettextify(n))
outfile.write(gettextify(d))
# data/raw/items/*
with open(os.path.join(to_folder,"json_items.py"), 'w') as items_jtl:
for filename in os.listdir(os.path.join(raw_folder,"items")):
jsonfile = os.path.join(raw_folder, "items", filename)
convert(jsonfile, items_jtl)
# data/raw/skills.json
with open(os.path.join(to_folder, "json_skills.py"), 'w') as skills_jtl:
jsonfile = os.path.join(raw_folder, "skills.json")
jsondata = json.loads(open(jsonfile).read())
names = [item[1] for item in jsondata]
descriptions = [item[2] for item in jsondata]
for n, d in zip(names, descriptions):
skills_jtl.write(gettextify(n))
skills_jtl.write(gettextify(d))
# data/raw/professions.json
with open(os.path.join(to_folder,"json_professions.py"), 'w') as prof_jtl:
prof_json = os.path.join(raw_folder, "professions.json")
convert(prof_json, prof_jtl)
# data/raw/bionics.json
with open(os.path.join(to_folder,"json_bionics.py"), 'w') as bio_jtl:
bio_json = os.path.join(raw_folder, "bionics.json")
convert(bio_json, bio_jtl)
+5
View File
@@ -0,0 +1,5 @@
# ignore everything in this directory
*
# except this file and the README
!.gitignore
!README
+5
View File
@@ -0,0 +1,5 @@
This directory is for storing translatable strings,
automatically generated from the .json files in data/raw.
Any files in here (other than this one) should not be edited by hand,
and should not be added to the git repository.

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