Compare commits

..

150 Commits

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

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

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

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

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

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

Further warning resolutions. A fix in items.h.

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

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

Further warning resolutions.

Further warning resolutions. Crazy source file is crazy.

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

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

Note: this could add time to the system, and with collisions being the
way they are, they could add energy to the system.
So hopefully the resonances don't cascade with too many vehicles.
2013-02-27 00:35:58 -05:00
Zach Morgan 5472cef101 fixing vehicle solar panels 2013-02-26 22:54:46 -05:00
Kevin Granade 6106145e3d Merge remote-tracking branch 'shoes/master' into dda-master
Conflicts:
	weather.h
2013-02-26 21:10:47 -06:00
Shoes01 16036327c8 Bodytemp is now updated every tick instead of every 10 ticks 2013-02-26 21:40:22 -08:00
Shoes01 5977e198e1 Documentation and cleanup of bodytemp stuff 2013-02-26 20:30:08 -08:00
Kevin Granade 2032dda642 Give gas pumps a chance of running out of gas. 2013-02-26 20:43:47 -06:00
Kevin Granade adac220862 Fix bionic description typo. 2013-02-26 20:43:47 -06:00
Shoes01 18e44e28c4 Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA 2013-02-24 08:13:58 -08:00
Shoes01 9ca4e46593 Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA 2013-02-24 01:23:51 -08:00
Shoes01 1f9907e39e Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA 2013-02-23 12:09:52 -08:00
Shoes01 76f7493899 Merge branch 'master' of github.com:TheDarklingWolf/Cataclysm-DDA 2013-02-23 07:25:50 -08:00
Shoes01 85b3b8e871 Added player complaints due to heat 2013-02-22 18:54:32 -08:00
54 changed files with 1618 additions and 1021 deletions
+2 -3
View File
@@ -64,9 +64,8 @@
<Unit filename="graffiti.cpp" />
<Unit filename="graffiti.h" />
<Unit filename="help.cpp" />
<Unit filename="icon.rc">
<Option compilerVar="WINDRES" />
</Unit>
<Unit filename="input.cpp" />
<Unit filename="input.h" />
<Unit filename="inventory.cpp" />
<Unit filename="inventory.h" />
<Unit filename="inventory_ui.cpp" />
+14 -2
View File
@@ -61,7 +61,7 @@ ifdef RELEASE
DEBUG =
endif
CXXFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS)
CXXFLAGS = $(WARNINGS) $(DEBUG) $(PROFILE) $(OTHERS) -MMD
BINDIST_EXTRAS = README data cataclysm-launcher
BINDIST = cataclysmdda-$(VERSION).tar.gz
@@ -125,7 +125,7 @@ $(ODIR)/%.o: %.cpp
$(CXX) $(DEFINES) $(CXXFLAGS) -c $< -o $@
clean:
rm -f $(TARGET) $(W32TARGET) $(ODIR)/*.o $(W32ODIR)/*.o $(W32BINDIST) \
rm -f $(TARGET) $(W32TARGET) $(ODIR)/*.o $(ODIR)/*.d $(W32ODIR)/*.o $(W32BINDIST) \
$(BINDIST)
rm -rf $(BINDIST_DIR)
@@ -137,4 +137,16 @@ $(BINDIST): $(TARGET) $(BINDIST_EXTRAS)
cp -R $(TARGET) $(BINDIST_EXTRAS) $(BINDIST_DIR)
$(BINDIST_CMD)
export ODIR _OBJS LDFLAGS CXX W32FLAGS DEFINES CXXFLAGS
tests: $(ODIR) $(DDIR) $(OBJS)
$(MAKE) -C tests
check: tests
$(MAKE) -C tests check
.PHONY: tests check
-include $(SOURCES:%.cpp=$(DEPDIR)/%.P)
-include ${OBJS:.o=.d}
+21 -17
View File
@@ -1,7 +1,7 @@
#include "player.h"
#include "game.h"
#include "rng.h"
#include "keypress.h"
#include "input.h"
#include "item.h"
#include "bionics.h"
#include "line.h"
@@ -49,6 +49,7 @@ void player::activate_bionic(int b, game *g)
std::vector<std::string> bad;
WINDOW* w;
int dirx, diry, t, l, index;
InputEvent input;
item tmp_item;
switch (bio.id) {
@@ -200,7 +201,8 @@ void player::activate_bionic(int b, game *g)
case bio_lighter:
g->draw();
mvprintw(0, 0, "Torch in which direction?");
get_direction(g, dirx, diry, input());
input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
g->add_msg("Invalid direction.");
power_level += bionics[bio_lighter].power_cost;
@@ -252,7 +254,8 @@ void player::activate_bionic(int b, game *g)
case bio_emp:
g->draw();
mvprintw(0, 0, "Fire EMP in which direction?");
get_direction(g, dirx, diry, input());
input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
g->add_msg("Invalid direction.");
power_level += bionics[bio_emp].power_cost;
@@ -337,7 +340,8 @@ void player::activate_bionic(int b, game *g)
case bio_lockpick:
g->draw();
mvprintw(0, 0, "Unlock in which direction?");
get_direction(g, dirx, diry, input());
input = get_input();
get_direction(dirx, diry, input);
if (dirx == -2) {
g->add_msg("Invalid direction.");
power_level += bionics[bio_lockpick].power_cost;
@@ -427,12 +431,12 @@ bool player::install_bionics(game *g, it_bionic* type)
Installing this bionic will increase your total battery capacity by %d.\n\
Batteries are necessary for most bionics to function. They also require a\n\
charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
char ch;
InputEvent input;
wrefresh(w);
do
ch = getch();
while (ch != 'q' && ch != '\n' && ch != KEY_ESCAPE);
if (ch == '\n') {
input = get_input();
while (input != Confirm && input != Close);
if (input == Confirm) {
practice("electronics", (100 - chance_of_success) * 1.5);
practice("firstaid", (100 - chance_of_success) * 1.0);
practice("mechanics", (100 - chance_of_success) * 0.5);
@@ -454,7 +458,7 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
}
int selection = 0;
char ch;
InputEvent input;
do {
@@ -471,10 +475,10 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
mvwprintz(w, 22, 0, c_ltblue, bionics[id].description.c_str());
wrefresh(w);
ch = input();
switch (ch) {
input = get_input();
switch (input) {
case 'j':
case DirectionS:
mvwprintz(w, 2 + selection, 0, (has_bionic(id) ? c_ltred : c_ltblue),
bionics[id].name.c_str());
if (selection == type->options.size() - 1)
@@ -483,7 +487,7 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
selection++;
break;
case 'k':
case DirectionN:
mvwprintz(w, 2 + selection, 0, (has_bionic(id) ? c_ltred : c_ltblue),
bionics[id].name.c_str());
if (selection == 0)
@@ -493,13 +497,13 @@ charge mechanism, which must be installed from another CBM.", BATTERY_AMOUNT);
break;
}
if (ch == '\n' && has_bionic(id)) {
if (input == Confirm && has_bionic(id)) {
popup("You already have a %s!", bionics[id].name.c_str());
ch = 'a';
input = Nothing;
}
} while (ch != '\n' && ch != 'q' && ch != KEY_ESCAPE);
} while (input != Cancel && input != Confirm);
if (ch == '\n') {
if (input == Confirm) {
practice("electronics", (100 - chance_of_success) * 1.5);
practice("firstaid", (100 - chance_of_success) * 1.0);
practice("mechanics", (100 - chance_of_success) * 0.5);
+1 -1
View File
@@ -234,7 +234,7 @@ anything else."},
Your left arm has been replaced by a heavy-duty fusion blaster! You may use\n\
your energy banks to fire a damaging heat ray; however, you are unable to use\n\
or carry two-handed items, and may only fire handguns."},
{"Finger-Mounter Laser", false, true, 2, 0, "\
{"Finger-Mounted Laser", false, true, 2, 0, "\
One of your fingers has a small high-powered laser embedded in it. This long\n\
range weapon is not incredibly damaging, but is very accurate, and has the\n\
potential to start fires."},
+2 -2
View File
@@ -4,10 +4,10 @@
#include <string>
enum body_part {
bp_head = 0,
bp_torso = 0,
bp_head,
bp_eyes,
bp_mouth,
bp_torso,
bp_arms,
bp_hands,
bp_legs,
+6 -3
View File
@@ -355,12 +355,15 @@ std::string calendar::print_time(bool twentyfour)
ret << "0";
ret << minute;
} else {
if (OPTIONS[OPT_24_HOUR]) {
if (OPTIONS[OPT_24_HOUR] == 1) {
int hours = hour % 24;
if (hours < 10)
ret << "0";
ret << hours;
} else {
} else if (OPTIONS[OPT_24_HOUR] == 2) {
int hours = hour % 24;
ret << hours << ":";
}else {
int hours = hour % 12;
if (hours == 0)
hours = 12;
@@ -369,7 +372,7 @@ std::string calendar::print_time(bool twentyfour)
if (minute < 10)
ret << "0";
ret << minute;
if (!OPTIONS[OPT_24_HOUR]) {
if (OPTIONS[OPT_24_HOUR] == 0) {
if (hour < 12)
ret << " AM";
else
+1
View File
@@ -807,5 +807,6 @@ void timeout(int delay)
{
inputdelay=delay;
};
void set_escdelay(int delay) { } //PORTABILITY, DUMMY FUNCTION
#endif
+1
View File
@@ -143,6 +143,7 @@ int getmaxx(WINDOW *win);
int getmaxy(WINDOW *win);
int move(int y, int x);
void timeout(int delay);//PORTABILITY, DUMMY FUNCTION
void set_escdelay(int delay);//PORTABILITY, DUMMY FUNCTION
//Window Functions, Do not call these outside of catacurse.cpp
void WinDestroy();
+7
View File
@@ -577,6 +577,13 @@ INITIATING STANDARD TREMOR TEST...");
g->u.add_disease(DI_AMIGARA, 20, g);
break;
case COMPACT_STEMCELL_TREATMENT:
g->u.add_disease(DI_STEMCELL_TREATMENT, 120, g);
print_line("The machine injects your eyeball with the solution \n\
of pureed bone & LSD.");
g->u.pain += rng(40,90);
break;
case COMPACT_DOWNLOAD_SOFTWARE:
if (!g->u.has_amount(itm_usb_drive, 1))
print_error("USB drive required!");
+1
View File
@@ -31,6 +31,7 @@ enum computer_action
COMPACT_AMIGARA_START,
COMPACT_DOWNLOAD_SOFTWARE,
COMPACT_BLOOD_ANAL,
COMPACT_STEMCELL_TREATMENT,
NUM_COMPUTER_ACTIONS
};
+33 -28
View File
@@ -107,7 +107,7 @@ void game::init_construction()
TOOL(itm_hammer, itm_hatchet, itm_nailgun, NULL);
COMP(itm_2x4, 10, NULL);
COMP(itm_nail, 20, NULL);
CONSTRUCT("Build Log Wall", 2, &construct::able_pit, &construct::done_nothing);
STAGE(t_wall_log_half, 20);
TOOL(itm_shovel, NULL);
@@ -116,20 +116,20 @@ void game::init_construction()
STAGE(t_wall_log, 20);
TOOL(itm_shovel, NULL);
COMP(itm_log, 2, NULL);
COMP(itm_stick, 3, NULL);
COMP(itm_stick, 3, NULL);
CONSTRUCT("Build Palisade Wall", 2, &construct::able_pit, &construct::done_nothing);
STAGE(t_palisade, 20);
TOOL(itm_shovel, NULL);
COMP(itm_log, 3, NULL);
COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);
COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);
CONSTRUCT("Build Palisade Gate", 2, &construct::able_pit, &construct::done_nothing);
STAGE(t_palisade_gate, 20);
TOOL(itm_shovel, NULL);
COMP(itm_log, 2, NULL);
COMP(itm_log, 2, NULL);
COMP(itm_2x4, 3, NULL);
COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);
COMP(itm_rope_30, 1, itm_rope_6, 5, NULL);
CONSTRUCT("Build Window", 2, &construct::able_empty,
&construct::done_nothing);
@@ -142,7 +142,7 @@ void game::init_construction()
STAGE(t_window_domestic, 5);
TOOL(itm_saw, NULL);
COMP(itm_nail, 4, NULL);
COMP(itm_sheet, 2, NULL);
COMP(itm_sheet, 2, NULL);
COMP(itm_stick, 1, NULL);
@@ -223,12 +223,12 @@ void game::init_construction()
COMP(itm_nail, 8, NULL);
COMP(itm_2x4, 10, NULL);
COMP(itm_sheet, 1, NULL);
CONSTRUCT("Tape up window", 0, &construct::able_window,
&construct::done_tape);
STAGE(t_null, 2);
COMP(itm_duct_tape, 50, NULL);
CONSTRUCT("Tape up window", 0, &construct::able_window,
&construct::done_tape);
STAGE(t_null, 2);
COMP(itm_duct_tape, 50, NULL);
CONSTRUCT("Deconstruct Furniture", 0, &construct::able_deconstruct,
&construct::done_deconstruct);
STAGE(t_null, 20);
@@ -431,7 +431,7 @@ void game::construction_menu()
case KEY_ESCAPE:
break;
default:
if (ch < 96 || ch > constructions.size() + 101) break;
if (ch < 97 || ch > constructions.size() + 101) break;
// Map menu items to hotkey letters, skipping j, k, l, and q.
char hotkey = ch - ((ch < 106) ? 97 : ((ch < 112) ? 100 : 101));
if (player_can_build(u, total_inv, constructions[hotkey])) {
@@ -648,12 +648,17 @@ bool construct::able_furniture(game *g, point p)
switch(g->m.ter(p.x, p.y)) {
case t_fridge:
case t_glass_fridge:
required_str = 10;
break;
case t_bookcase:
case t_locker:
required_str = 9;
break;
case t_dresser:
case t_rack:
case t_bookcase:
case t_locker:
case t_chair:
case t_chair:
case t_armchair:
case t_bench:
required_str = 8;
break;
default:
@@ -819,24 +824,24 @@ void construct::done_vehicle(game *g, point p)
}
veh->name = name;
veh->install_part (0, 0, vp_frame_v2);
}
}
void construct::done_tape(game *g, point p)
{
g->add_msg("You tape up the %s.", g->m.tername(p.x, p.y).c_str());
switch (g->m.ter(p.x, p.y))
{
case t_window_alarm:
g->m.ter(p.x, p.y) = t_window_alarm_taped;
case t_window_domestic:
g->m.ter(p.x, p.y) = t_window_domestic_taped;
case t_window:
case t_window_alarm:
g->m.ter(p.x, p.y) = t_window_alarm_taped;
case t_window_domestic:
g->m.ter(p.x, p.y) = t_window_domestic_taped;
case t_window:
g->m.ter(p.x, p.y) = t_window_taped;
}
}
}
void construct::done_deconstruct(game *g, point p)
{
@@ -861,7 +866,7 @@ void construct::done_deconstruct(game *g, point p)
case t_window_domestic:
g->m.add_item(p.x, p.y, g->itypes[itm_stick], 0);
g->m.add_item(p.x, p.y, g->itypes[itm_sheet], 0, 1);
g->m.add_item(p.x, p.y, g->itypes[itm_glass_sheet], 0);
g->m.add_item(p.x, p.y, g->itypes[itm_glass_sheet], 0);
g->m.add_item(p.x, p.y, g->itypes[itm_nail], 0, 3);
g->m.ter(p.x, p.y) = t_window_empty;
break;
+1 -1
View File
@@ -69,7 +69,7 @@ struct construct // Construction functions.
void done_vehicle(game *, point);
void done_tree(game *, point);
void done_log(game *, point);
void done_furniture(game *, point);
void done_furniture(game *, point);
void done_tape(game *, point);
void done_deconstruct(game *, point);
+43 -35
View File
@@ -1,6 +1,6 @@
#include <string>
#include <sstream>
#include "keypress.h"
#include "input.h"
#include "game.h"
#include "options.h"
#include "output.h"
@@ -40,9 +40,14 @@ RECIPE(itm_lawnmower, CC_NONCRAFT, NULL, NULL, 0, 1000, true);
RECIPE(itm_lighter, CC_NONCRAFT, NULL, NULL, 0, 100, true);
COMP(itm_pilot_light, 1, NULL);
RECIPE(itm_tshirt, CC_NONCRAFT, "tailor", NULL, 2, 38000, true);
TOOL(itm_sewing_kit, 4, NULL);
RECIPE(itm_tshirt, CC_NONCRAFT, "tailor", NULL, 0, 500, true);
COMP(itm_rag, 5, NULL);
RECIPE(itm_tshirt_fit, CC_NONCRAFT, "tailor", NULL, 0, 500, true);
COMP(itm_rag, 5, NULL);
RECIPE(itm_tank_top, CC_NONCRAFT, "tailor", NULL, 0, 500, true);
COMP(itm_rag, 5, NULL);
// CRAFTABLE
@@ -106,11 +111,11 @@ RECIPE(itm_tshirt, CC_NONCRAFT, "tailor", NULL, 2, 38000, true);
RECIPE(itm_shotgun_sawn, CC_WEAPON, "gun", NULL, 0, 2000, false);
TOOL(itm_hacksaw, -1, itm_toolset, -1, NULL);
COMP(itm_shotgun_d, 1, itm_remington_870, 1, itm_mossberg_500, 1, NULL);
RECIPE(itm_revolver_shotgun, CC_WEAPON, "gun", "mechanics", 2, 6000, false);
TOOL(itm_hacksaw, -1, itm_toolset, -1, NULL);
TOOL(itm_welder, 30, itm_toolset, 3, NULL);
COMP(itm_shotgun_s, 1, NULL);
RECIPE(itm_revolver_shotgun, CC_WEAPON, "gun", "mechanics", 2, 6000, false);
TOOL(itm_hacksaw, -1, itm_toolset, -1, NULL);
TOOL(itm_welder, 30, itm_toolset, 3, NULL);
COMP(itm_shotgun_s, 1, NULL);
RECIPE(itm_saiga_sawn, CC_WEAPON, "gun", NULL, 0, 2000, false);
TOOL(itm_hacksaw, -1, itm_toolset, -1, NULL);
@@ -463,7 +468,7 @@ RECIPE(itm_c4, CC_WEAPON, "mechanics", "electronics", 4, 8000);
TOOL(itm_hotplate, 6, itm_toolset, 1, itm_fire, -1, NULL);
TOOL(itm_pot, -1, NULL);
COMP(itm_meat, 1, NULL);
COMP(itm_veggy,1, NULL);
COMP(itm_veggy,1, itm_veggy_wild, 1,NULL);
COMP(itm_water,1, NULL);
RECIPE(itm_veggy_cooked, CC_FOOD, "cooking", NULL, 0, 4000, false);
@@ -540,14 +545,14 @@ RECIPE(itm_c4, CC_WEAPON, "mechanics", "electronics", 4, 8000);
TOOL(itm_hotplate, 5, itm_toolset, 1, itm_fire, -1, NULL);
TOOL(itm_pot, -1, NULL);
COMP(itm_water, 1, itm_water_clean, 1, NULL);
COMP(itm_broccoli, 1, itm_zucchini, 1, itm_veggy, 1, NULL);
COMP(itm_broccoli, 1, itm_zucchini, 1, itm_veggy, 1, itm_veggy_wild, 1, NULL);
RECIPE(itm_soup, CC_FOOD, "cooking", NULL, 2, 10000, false);
TOOL(itm_hotplate, 5, itm_toolset, 1, itm_fire, -1, NULL);
TOOL(itm_pot, -1, NULL);
COMP(itm_broth, 2, NULL);
COMP(itm_macaroni_raw, 1, itm_potato_raw, 1, NULL);
COMP(itm_tomato, 2, itm_broccoli, 2, itm_zucchini, 2, itm_veggy, 2, NULL);
COMP(itm_tomato, 2, itm_broccoli, 2, itm_zucchini, 2, itm_veggy, 2, itm_veggy_wild, 2, NULL);
RECIPE(itm_bread, CC_FOOD, "cooking", NULL, 4, 20000, false);
TOOL(itm_hotplate, 8, itm_toolset, 1, itm_fire, -1, NULL);
@@ -567,7 +572,7 @@ RECIPE(itm_c4, CC_WEAPON, "mechanics", "electronics", 4, 8000);
TOOL(itm_hotplate, 8, itm_toolset, 1, itm_fire, -1, NULL);
TOOL(itm_pan, -1, NULL);
COMP(itm_flour, 2, NULL);
COMP(itm_veggy, 1, itm_tomato, 2, itm_broccoli, 1, NULL);
COMP(itm_veggy, 1, itm_veggy_wild, 1, itm_tomato, 2, itm_broccoli, 1, NULL);
COMP(itm_sauce_pesto, 1, itm_sauce_red, 1, NULL);
COMP(itm_water, 1, itm_water_clean, 1, NULL);
@@ -801,11 +806,11 @@ RECIPE(itm_c4, CC_WEAPON, "mechanics", "electronics", 4, 8000);
RECIPE(itm_tank_top, CC_ARMOR, "tailor", NULL, 2, 38000, true);
TOOL(itm_sewing_kit, 4, NULL);
COMP(itm_rag, 4, NULL);
COMP(itm_rag, 4, NULL);
RECIPE(itm_tshirt_fit, CC_ARMOR, "tailor", NULL, 2, 38000, true);
TOOL(itm_sewing_kit, 4, NULL);
COMP(itm_rag, 5, NULL);
COMP(itm_rag, 5, NULL);
RECIPE(itm_hoodie_fit, CC_ARMOR, "tailor", NULL, 3, 40000, false);
TOOL(itm_sewing_kit, 14, NULL);
@@ -902,14 +907,21 @@ RECIPE(itm_tshirt_fit, CC_ARMOR, "tailor", NULL, 2, 38000, true);
COMP(itm_pipe, 10, NULL);
COMP(itm_steel_chunk, 12, NULL);
COMP(itm_wire, 3, NULL);
RECIPE(itm_string_6, CC_MISC, NULL, NULL, 0, 5000, true);
TOOL(itm_knife_steak, -1, itm_knife_combat, -1, NULL);
COMP(itm_thread, 50, NULL);
RECIPE(itm_string_36, CC_MISC, NULL, NULL, 0, 5000, false);
RECIPE(itm_string_36, CC_MISC, NULL, NULL, 0, 5000, true);
TOOL(itm_knife_steak, -1, itm_knife_combat, -1, NULL);
COMP(itm_string_6, 6, NULL);
RECIPE(itm_rope_6, CC_MISC, "tailor", NULL, 2, 5000, false);
RECIPE(itm_rope_6, CC_MISC, "tailor", NULL, 0, 5000, true);
TOOL(itm_knife_steak, -1, itm_knife_combat, -1, NULL);
COMP(itm_string_36, 6, NULL);
RECIPE(itm_rope_30, CC_MISC, "tailor", NULL, 2, 5000, false);
RECIPE(itm_rope_30, CC_MISC, "tailor", NULL, 0, 5000, true);
TOOL(itm_knife_steak, -1, itm_knife_combat, -1, NULL);
COMP(itm_rope_6, 5, NULL);
RECIPE(itm_torch, CC_MISC, NULL, NULL, 0, 2000, false);
@@ -1071,7 +1083,7 @@ void game::craft()
int line = 0, xpos, ypos;
bool redraw = true;
bool done = false;
char ch;
InputEvent input;
inventory crafting_inv = crafting_inventory();
@@ -1243,29 +1255,29 @@ Press ? to describe object. Press <ENTER> to attempt to craft object.");
}
wrefresh(w_data);
ch = input();
switch (ch) {
case '<':
input = get_input();
switch (input) {
case DirectionUp:
if (tab == CC_WEAPON)
tab = CC_MISC;
else
tab = craft_cat(int(tab) - 1);
redraw = true;
break;
case '>':
case DirectionDown:
if (tab == CC_MISC)
tab = CC_WEAPON;
else
tab = craft_cat(int(tab) + 1);
redraw = true;
break;
case 'j':
case DirectionS:
line++;
break;
case 'k':
case DirectionN:
line--;
break;
case '\n':
case Confirm:
if (!available[line])
popup("You can't do that!");
else
@@ -1285,7 +1297,7 @@ Press ? to describe object. Press <ENTER> to attempt to craft object.");
done = true;
}
break;
case '?':
case Help:
tmp = item(itypes[current[line]->result], 0);
full_screen_popup(tmp.info(true).c_str());
redraw = true;
@@ -1295,7 +1307,7 @@ Press ? to describe object. Press <ENTER> to attempt to craft object.");
line = current.size() - 1;
else if (line >= current.size())
line = 0;
} while (ch != KEY_ESCAPE && ch != 'q' && ch != 'Q' && !done);
} while (input != Cancel && !done);
werase(w_head);
werase(w_data);
@@ -1781,7 +1793,7 @@ void game::consume_tools(std::vector<component> tools)
void game::disassemble()
{
char ch = inv("Disassemble item:");
if (ch == KEY_ESCAPE) {
if (ch == 27) {
add_msg("Never mind.");
return;
}
@@ -1822,11 +1834,7 @@ void game::disassemble()
have_tool[j] = true;
k = recipes[i]->tools[j].size();
}
// if crafting recipe required a welder, disassembly requires a hacksaw or super toolkit
if (type == itm_sewing_kit)
{
have_tool[j] = true;
}
// if crafting recipe required a welder, disassembly requires a hacksaw or super toolkit
if (type == itm_welder)
{
if (crafting_inv.has_amount(itm_hacksaw, 1) ||
+1 -1
View File
@@ -14,4 +14,4 @@ http://www.cataclysm.glyphgryph.com/smf/index.php
Check out the options listing by pressing ?2
As always, please visit the forums at:
http://www.cataclysm.glyphgryph.com/smf/index.php
http://www.cataclysmdda.com/smf/index.php
+58 -16
View File
@@ -76,6 +76,10 @@ void dis_msg(game *g, dis_type type)
case DI_AMIGARA:
g->add_msg("You can't look away from the fautline...");
break;
case DI_STEMCELL_TREATMENT:
g->add_msg("You receive a pureed bone & enamel injection into your eyeball.");
g->add_msg("It is excruciating.");
break;
default:
break;
}
@@ -96,19 +100,19 @@ void dis_effect(game *g, player &p, disease &dis)
case DI_COLD_HEAD:
switch (dis.intensity) {
case 3 : p.int_cur -= 3; if (one_in(200)) g->add_msg("Your thoughts are unclear.");
case 3 : p.int_cur -= 3; if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your thoughts are unclear.");
case 2 : p.int_cur--;
case 1 : if (one_in(600)) g->add_msg("Brr.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
}
break;
case DI_COLD_TORSO:
switch (dis.intensity) {
case 3 : p.dex_cur -= 2; if (one_in(200)) g->add_msg("Your torso is burning up. You should remove some layers.");
case 3 : p.dex_cur -= 2; if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your torso is burning up. You should remove some layers.");
// Speed -20
case 2 : p.dex_cur -= 1;
// Speed -5
case 1 : p.dex_cur -= 1; if (one_in(600)) g->add_msg("Brr.");
case 1 : p.dex_cur -= 1; if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
// Speed -2
}
break;
@@ -117,7 +121,7 @@ void dis_effect(game *g, player &p, disease &dis)
switch (dis.intensity) {
case 3 : p.dex_cur -= 2;
case 2 : p.dex_cur--;
case 1 : if (one_in(600)) g->add_msg("Your arms are shivering.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("Your arms are shivering.");
}
break;
@@ -125,17 +129,17 @@ void dis_effect(game *g, player &p, disease &dis)
switch (dis.intensity) {
case 3 : p.dex_cur -= 2;
case 2 : p.dex_cur -= 2;
case 1 : if (one_in(600)) g->add_msg("Brr.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
}
break;
case DI_COLD_LEGS:
switch (dis.intensity) {
case 3 : p.str_cur--; if (one_in(200)) g->add_msg("Your legs are seizing from the incredible cold.");
case 3 : p.str_cur--; if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your legs are seizing from the incredible cold.");
// Speed -20
case 2 : p.str_cur--;
// Speed -5
case 1 : if (one_in(600)) g->add_msg("Your legs feel sluggish from the cold.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("Your legs feel sluggish from the cold.");
// Speed -2
}
break;
@@ -144,7 +148,7 @@ void dis_effect(game *g, player &p, disease &dis)
switch (dis.intensity) {
case 3 : p.str_cur--;
case 2 : p.str_cur--;
case 1 : if (one_in(600)) g->add_msg("Brr.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Brr.\"");
}
break;
@@ -153,7 +157,7 @@ void dis_effect(game *g, player &p, disease &dis)
case 2 : p.dex_cur -= 3;
case 1 :
if (p.temp_cur[bp_mouth] > BODYTEMP_COLD && p.pain < 40) p.pain++;
if (one_in(600)) g->add_msg("Your hands feel numb.");
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your hands feel numb.");
}
break;
@@ -162,7 +166,7 @@ void dis_effect(game *g, player &p, disease &dis)
case 2 : // -4 speed
case 1 :
if (p.temp_cur[bp_mouth] > BODYTEMP_COLD && p.pain < 40) p.pain++;
if (one_in(600)) g->add_msg("Your feet feel numb.");
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your feet feel numb.");
}
break;
@@ -171,7 +175,7 @@ void dis_effect(game *g, player &p, disease &dis)
case 2 : p.per_cur -= 3;
case 1 :
if (p.temp_cur[bp_mouth] > BODYTEMP_COLD && p.pain < 40) p.pain++;
if (one_in(600)) g->add_msg("Your face feels numb.");
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your face feels numb.");
}
break;
@@ -200,10 +204,17 @@ void dis_effect(game *g, player &p, disease &dis)
case 3 :
p.thirst--;
if (p.pain < 50) p.pain++;
if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("Your head is pounding from the heat.");
// Speed -20
case 2 :
p.thirst--;
if (one_in(1500 - p.temp_cur[bp_head])) p.vomit(g); // Hallucinations handled in game.cpp
if (one_in(15000 - p.temp_cur[bp_head])) p.vomit(g); // Hallucinations handled in game.cpp
if (p.pain < 20) p.pain++;
if (!p.has_disease(DI_SLEEP) && one_in(400)) g->add_msg("The heat is making you see things.");
// Speed -5
case 1 :
if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
// Speed -2
}
break;
@@ -212,17 +223,24 @@ void dis_effect(game *g, player &p, disease &dis)
case 3 :
p.thirst--;
p.str_cur--;
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("You are sweating profusely.");
// Speed -20
case 2 :
p.thirst--;
p.str_cur--;
// Speed -5
case 1 :
if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
// Speed -2
}
break;
case DI_HOT_ARMS:
switch (dis.intensity) {
case 3 : p.thirst--;
if (p.pain < 50) p.pain++;
if (p.pain < 50) p.pain++;
case 2 : p.thirst--;
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
}
break;
@@ -230,6 +248,7 @@ void dis_effect(game *g, player &p, disease &dis)
switch (dis.intensity) {
case 3 : p.dex_cur--;
case 2 : p.dex_cur--;
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
}
break;
@@ -237,14 +256,19 @@ void dis_effect(game *g, player &p, disease &dis)
switch (dis.intensity) {
case 3 : p.thirst--;
if (p.pain < 50) p.pain++;
if (one_in(200)) g->add_msg("Your legs are cramping up.");
case 2 : p.thirst--;
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
}
break;
case DI_HOT_FEET:
switch (dis.intensity) {
case 3 : if (p.pain < 50) p.pain++;
case 2 : if (p.pain < 30) p.pain++;
case 2 :
if (p.pain < 30) p.pain++;
if (!p.has_disease(DI_SLEEP) && one_in(200)) g->add_msg("Your feet are swelling in the heat.");
case 1 : if (!p.has_disease(DI_SLEEP) && one_in(600)) g->add_msg("\"Phew, it's hot warm.\"");
}
break;
@@ -489,6 +513,22 @@ void dis_effect(game *g, player &p, disease &dis)
}
break;
case DI_STEMCELL_TREATMENT:
//slightly repair broken limbs. (also nonbroken limbs (unless they're too healthy))
for (int i = 0; i < num_hp_parts; i++) {
if(one_in(6)){
if (p.hp_cur[i] < rng(0,40)){
g->add_msg("You feel your skeleton melt and mend.");
p.hp_cur[i]+= rng(1,8);
}
else if (p.hp_cur[i] > rng(10,2000)){
g->add_msg("You feel your skeleton melt");
p.hp_cur[i] -= rng(0,8);
}
}
}
break;
case DI_PKILL1:
if (dis.duration <= 70 && dis.duration % 7 == 0 && p.pkill < 15)
@@ -1128,7 +1168,7 @@ std::string dis_name(disease dis)
if (dis.duration > 800) return "Heavy Asthma";
return "Asthma";
case DI_GRACK: return "UNLEASH THE GRACKEN!!!!";
case DI_GRACK: return "RELEASE THE GRACKEN!!!!";
case DI_METH:
if (dis.duration > 600) return "High on Meth";
@@ -1136,6 +1176,8 @@ std::string dis_name(disease dis)
case DI_IN_PIT: return "Stuck in Pit";
case DI_STEMCELL_TREATMENT: return "Stem cell treatment";
case DI_ATTACK_BOOST: return "Hit Bonus";
case DI_DAMAGE_BOOST: return "Damage Bonus";
case DI_DODGE_BOOST: return "Dodge Bonus";
+569 -356
View File
File diff suppressed because it is too large Load Diff
+11 -8
View File
@@ -319,23 +319,25 @@ class game
// Pick where to put liquid; false if it's left where it was
bool handle_liquid(item &liquid, bool from_ground, bool infinite);
void compare(int iCompareX = -999, int iCompareY = -999); // Compare two Items 'I'
void drop(); // Drop an item 'd'
void drop(char chInput = '.'); // Drop an item 'd'
void drop_in_direction(); // Drop w/ direction 'D'
void reassign_item(); // Reassign the letter of an item '='
void butcher(); // Butcher a corpse 'B'
void complete_butcher(int index); // Finish the butchering process
void forage(); // Foraging ('a' on underbrush)
void eat(); // Eat food or fuel 'E' (or 'a')
void use_item();// Use item; also tries E,R,W 'a'
void eat(char chInput = '.'); // Eat food or fuel 'E' (or 'a')
void use_item(char chInput = '.');// Use item; also tries E,R,W 'a'
void use_wielded_item();
void wear(); // Wear armor 'W' (or 'a')
void takeoff(); // Remove armor 'T'
void wear(char chInput = '.'); // Wear armor 'W' (or 'a')
void takeoff(char chInput = '.'); // Remove armor 'T'
void reload(); // Reload a wielded gun/tool 'r'
void reload(char chInput);
void unload(); // Unload a wielded gun/tool 'U'
void wield(); // Wield a weapon 'w'
void unload(char chInput);
void wield(char chInput = '.'); // Wield a weapon 'w'
void read(); // Read a book 'R' (or 'a')
void chat(); // Talk to a nearby NPC 'C'
void plthrow(); // Throw an item 't'
void plthrow(char chInput = '.'); // Throw an item 't'
void help(); // Help screen '?'
// Target is an interactive function which allows the player to choose a nearby
@@ -349,6 +351,7 @@ class game
// Map updating and monster spawning
void replace_stair_monsters();
void update_stair_monsters();
void despawn_monsters(const bool stairs = false, const int shiftx = 0, const int shifty = 0);
void spawn_mon(int shift, int shifty); // Called by update_map, sometimes
mon_id valid_monster_from(std::vector<mon_id> group);
int valid_group(mon_id type, int x, int y);// Picks a group from cur_om
@@ -365,7 +368,7 @@ class game
void update_weather(); // Updates the temperature and weather patten
void hallucinate(const int x, const int y); // Prints hallucination junk to the screen
void mon_info(); // Prints a list of nearby monsters (top right)
input_ret get_input(int timeout_ms); // Gets player input and calls the proper function
bool handle_action();
void update_scent(); // Updates the scent map
bool is_game_over(); // Returns true if the player quit or died
void death_screen(); // Display our stats, "GAME OVER BOO HOO"
+2 -1
View File
@@ -22,4 +22,5 @@ graffiti graffiti::operator=(graffiti rhs)
this->contents = new std::string(*rhs.contents);
else
this->contents = 0;
}
return *this;
}
+21 -15
View File
@@ -26,21 +26,14 @@ void game::help()
Please press one of the following for help on that topic:\n\
Press q or ESC to return to the game.\n\
\n\
a: Introduction\n\
b: Movement\n\
c: Viewing\n\
d: Hunger, Thirst, and Sleep\n\
e: Pain and Stimulants\n\
f: Addiction\n\
g: Morale and XP\n\
a: Introduction i: Bionics\n\
b: Movement j: Crafting\n\
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\
h: Radioactivity and Mutation\n\
i: Bionics\n\
j: Crafting\n\
k: Traps\n\
l: Items overview\n\
m: Combat\n\
n: Unarmed Styles\n\
o: Survival tips\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\
@@ -335,6 +328,10 @@ 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...");
getch();
erase();
mvprintz(0, 0, c_white, "\
To wield an item as a weapon, press 'w' 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\
@@ -428,9 +425,18 @@ Irregular terrain, like forests, may help you lose monsters.\n\
Firearms are the easiest way to kill an enemy, but the sound will attract\n\
unwanted attention. Save the guns for emergencies, and melee when you can.\n\
\n\
Press any key for more...");
getch();
erase();
mvprintz(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.");
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 extremities\n\
from frostbite and to keep your distance from large fires.");
getch();
break;
+111
View File
@@ -0,0 +1,111 @@
#include "cursesdef.h"
#include "input.h"
/* TODO Replace the hardcoded values with an abstraction layer.
* Lower redundancy across the methods. */
InputEvent get_input(int ch)
{
if (ch == '\0')
ch = getch();
switch(ch)
{
case 'k':
case '8':
case KEY_UP:
return DirectionN;
case 'j':
case '2':
case KEY_DOWN:
return DirectionS;
case 'l':
case '6':
case KEY_RIGHT:
return DirectionE;
case 'h':
case '4':
case KEY_LEFT:
return DirectionW;
case 'y':
case '7':
return DirectionNW;
case 'u':
case '9':
return DirectionNE;
case 'b':
case '1':
return DirectionSW;
case 'n':
case '3':
return DirectionSE;
case '.':
case '5':
return DirectionNone;
case '>':
return DirectionDown;
case '<':
return DirectionUp;
case '\n':
return Confirm;
case ' ':
return Close;
case 27: /* TODO Fix delay */
case 'q':
return Cancel;
case '?':
return Help;
case ',':
case 'g':
return Pickup;
default:
return Undefined;
}
}
void get_direction(int &x, int &y, InputEvent &input)
{
x = 0;
y = 0;
switch(input) {
case DirectionN:
--y;
break;
case DirectionS:
++y;
break;
case DirectionE:
++x;
break;
case DirectionW:
--x;
break;
case DirectionNW:
--x;
--y;
break;
case DirectionNE:
++x;
--y;
break;
case DirectionSW:
--x;
++y;
break;
case DirectionSE:
++x;
++y;
break;
case DirectionNone:
case Pickup:
break;
default:
x = -2;
y = -2;
}
}
+31
View File
@@ -0,0 +1,31 @@
#ifndef _INPUT_H_
#define _INPUT_H_
enum InputEvent {
Confirm,
Cancel,
Close,
Help,
DirectionN,
DirectionS,
DirectionE,
DirectionW,
DirectionNW,
DirectionNE,
DirectionSE,
DirectionSW,
DirectionNone,
DirectionDown, /* Think stairs */
DirectionUp,
Pickup,
Nothing,
Undefined
};
InputEvent get_input(int ch = '\0');
void get_direction(int &x, int &y, InputEvent &input);
#endif
+35 -40
View File
@@ -32,15 +32,8 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
wprintz(w_inv, c_ltgray, "%d", g->u.volume_carried());
wprintw(w_inv, "/%d", g->u.volume_capacity() - 2);
// Print items carried
int n_items = 0;
for(int ch='a'; ch <= 'z'; ++ch)
n_items += ((g->u.inv.index_by_letter(ch) == -1) ? 0 : 1);
for(int ch='A'; ch <= 'Z'; ++ch)
n_items += ((g->u.inv.index_by_letter(ch) == -1) ? 0 : 1);
mvwprintw(w_inv, 1, 62, "Items: %d/52 ", n_items);
// Print our weapon
int n_items = 0;
mvwprintz(w_inv, 2, 45, c_magenta, "WEAPON:");
int dropping_weapon = false;
for (int i = 0; i < dropped_items.size() && !dropping_weapon; i++) {
@@ -48,21 +41,24 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
dropping_weapon = true;
}
if (g->u.is_armed()) {
n_items++;
if (dropping_weapon)
mvwprintz(w_inv, 3, 45, c_white, "%c + %s", g->u.weapon.invlet,
g->u.weapname().c_str());
else
mvwprintz(w_inv, 3, 45, g->u.weapon.color_in_inventory(&(g->u)), "%c - %s",
g->u.weapon.invlet, g->u.weapname().c_str());
} else if (g->u.weapon.is_style())
} else if (g->u.weapon.is_style()) {
n_items++;
mvwprintz(w_inv, 3, 45, c_ltgray, "%c - %s",
g->u.weapon.invlet, g->u.weapname().c_str());
else
mvwprintz(w_inv, 3, 42, c_ltgray, g->u.weapname().c_str());
} else
mvwprintz(w_inv, 3, 45, c_ltgray, g->u.weapname().c_str());
// Print worn items
if (g->u.worn.size() > 0)
mvwprintz(w_inv, 5, 45, c_magenta, "ITEMS WORN:");
for (int i = 0; i < g->u.worn.size(); i++) {
n_items++;
bool dropping_armor = false;
for (int j = 0; j < dropped_items.size() && !dropping_armor; j++) {
if (dropped_items[j] == g->u.worn[i].invlet)
@@ -75,6 +71,13 @@ void print_inv_statics(game *g, WINDOW* w_inv, std::string title,
mvwprintz(w_inv, 6 + i, 45, c_ltgray, "%c - %s", g->u.worn[i].invlet,
g->u.worn[i].tname(g).c_str());
}
// Print items carried
for(int ch='a'; ch <= 'z'; ++ch)
n_items += ((g->u.inv.index_by_letter(ch) == -1) ? 0 : 1);
for(int ch='A'; ch <= 'Z'; ++ch)
n_items += ((g->u.inv.index_by_letter(ch) == -1) ? 0 : 1);
mvwprintw(w_inv, 1, 62, "Items: %d/52 ", n_items);
}
std::vector<int> find_firsts(inventory &inv)
@@ -434,40 +437,32 @@ std::vector<item> game::multidrop()
int max_size = u.inv.size();
for (int i = 0; i < max_size; i++) {
if (dropping[i] == -1) // drop whole stack of charges
{
ret.push_back(u.inv.remove_item(current_stack));
current_stack--;
if (dropping[i] == -1) { // drop whole stack of charges
ret.push_back(u.inv.remove_item(current_stack));
current_stack--;
}
for (int j = 0; j < dropping[i]; j++) {
for (int j = 0; j < dropping[i]; j++) {
if (u.inv.stack_at(current_stack)[0].count_by_charges()) { // dropping parts of stacks
int tmpcount = dropping[i];
if (u.inv.stack_at(current_stack)[0].count_by_charges()) // dropping parts of stacks
{
int tmpcount = dropping[i];
if (tmpcount >= u.inv.stack_at(current_stack)[0].charges)
{
ret.push_back(u.inv.remove_item(current_stack));
current_stack--;
}
else
{
u.inv.stack_at(current_stack)[0].charges -= tmpcount;
ret.push_back(u.inv.remove_item_by_quantity(current_stack, tmpcount));
}
j = dropping[i];
if (tmpcount >= u.inv.stack_at(current_stack)[0].charges) {
ret.push_back(u.inv.remove_item(current_stack));
current_stack--;
} else {
u.inv.stack_at(current_stack)[0].charges -= tmpcount;
ret.push_back(u.inv.remove_item_by_quantity(current_stack, tmpcount));
}
else
{
if (current_stack >= 0) {
if (u.inv.stack_at(current_stack).size() == 1) {
ret.push_back(u.inv.remove_item(current_stack));
current_stack--;
} else
ret.push_back(u.inv.remove_item(current_stack));
}
j = dropping[i];
} else {
if (current_stack >= 0) {
if (u.inv.stack_at(current_stack).size() == 1) {
ret.push_back(u.inv.remove_item(current_stack));
current_stack--;
} else
ret.push_back(u.inv.remove_item(current_stack));
}
}
}
current_stack++;
}
+10 -9
View File
@@ -73,17 +73,16 @@ itm_wrapper, itm_withered, itm_syringe, itm_fur, itm_leather, itm_superglue,
itm_steel_lump, itm_scrap, itm_hose, itm_glass_sheet, itm_manhole_cover, itm_rock,
itm_stick, itm_broom,
itm_hammer_sledge, itm_hatchet, itm_nailboard, itm_nailbat,
itm_xacto, itm_scalpel, itm_pot, itm_pan, itm_knife_butter, itm_2x4, itm_muffler,
itm_pot, itm_pan, itm_knife_butter, itm_2x4, itm_muffler,
itm_pipe, itm_bat, itm_bat_metal,
itm_machete, itm_katana, itm_spear_wood, itm_spear_knife, itm_baton,
itm_spear_wood, itm_baton,
itm_bee_sting, itm_wasp_sting, itm_chitin_piece, itm_biollante_bud,
itm_canister_empty, itm_gold, itm_coal, itm_petrified_eye, itm_spiral_stone,
itm_rapier, itm_cane, itm_binoculars, itm_usb_drive, itm_pike, itm_broadsword,
itm_cane, itm_binoculars, itm_usb_drive,
itm_mace, itm_morningstar, itm_pool_cue, itm_pool_ball, itm_candlestick,
itm_carspike, itm_carblade, itm_wire, itm_wire_barbed, itm_rebar, itm_log,
itm_splinter, itm_skewer, itm_crackpipe, itm_torch_done,
itm_spring, itm_lawnmower, itm_lawnmower_blade, itm_lawnmower_machete,
itm_lawnmower_halberd, itm_sheet, itm_broketent, itm_element,
itm_spring, itm_lawnmower, itm_sheet, itm_broketent, itm_element,
itm_television, itm_pilot_light, itm_toaster, itm_microwave, itm_laptop,
itm_fan, itm_ceramic_plate, itm_ceramic_bowl, itm_ceramic_cup,
itm_glass_plate, itm_glass_bowl, itm_glass, itm_tin_plate, itm_fork, itm_spork,
@@ -168,7 +167,7 @@ itm_nailgun, itm_bbgun, itm_crossbow, itm_compbow, itm_longbow, itm_rifle_22,
itm_hk_g36, itm_ak47, itm_fn_fal, itm_acr, itm_ar15, itm_m4a1, itm_scar_l,
itm_scar_h, itm_steyr_aug, itm_m249, itm_v29, itm_ftk93, itm_nx17,
itm_flamethrower_simple, itm_flamethrower, itm_launcher_simple, itm_m79,
itm_m320, itm_mgl, itm_coilgun, itm_hk_g80, itm_plasma_rifle,
itm_m320, itm_mgl, itm_coilgun, itm_hk_g80, itm_plasma_rifle,
itm_revolver_shotgun,
// Gun modifications
itm_silencer, itm_grip, itm_barrel_big, itm_barrel_small, itm_barrel_rifled,
@@ -179,7 +178,7 @@ itm_silencer, itm_grip, itm_barrel_big, itm_barrel_small, itm_barrel_rifled,
// Books
itm_mag_porn, itm_mag_tv, itm_mag_news, itm_mag_cars, itm_mag_cooking,
itm_mag_carpentry,
itm_mag_guns, itm_novel_romance, itm_novel_spy, itm_novel_scifi,
itm_mag_guns, itm_mag_archery, itm_novel_romance, itm_novel_spy, itm_novel_scifi,
itm_novel_drama, itm_manual_brawl, itm_manual_knives, itm_manual_mechanics, itm_manual_survival,
itm_manual_speech, itm_manual_business, itm_manual_first_aid,
itm_manual_computers, itm_cookbook, itm_manual_electronics,
@@ -205,7 +204,9 @@ itm_lighter, itm_sewing_kit, itm_scissors, itm_hammer, itm_extinguisher,
itm_mininuke_act, itm_pheromone, itm_portal, itm_bot_manhack, itm_bot_turret,
itm_UPS_off, itm_UPS_on, itm_tazer, itm_mp3, itm_mp3_on, itm_vortex_stone,
itm_dogfood, itm_boobytrap, itm_c4, itm_c4armed, itm_dog_whistle,
itm_vacutainer, itm_welder, itm_cot, itm_rollmat, itm_knife_steak,
itm_vacutainer, itm_welder, itm_cot, itm_rollmat, itm_xacto, itm_scalpel,
itm_machete, itm_katana, itm_spear_knife, itm_rapier, itm_pike, itm_broadsword,
itm_lawnmower_blade, itm_lawnmower_machete, itm_lawnmower_halberd, itm_knife_steak,
itm_knife_butcher, itm_knife_combat, itm_saw, itm_ax, itm_hacksaw,
itm_tent_kit, itm_torch, itm_torch_lit, itm_candle, itm_candle_lit,
itm_brazier, itm_puller, itm_press, itm_screwdriver, itm_wrench,
@@ -323,7 +324,7 @@ IF_USE_UPS, // Draws power from a UPS
IF_RELOAD_AND_SHOOT, // Reloading and shooting is one action
IF_FIRE_100, // Fires 100 rounds at once! (e.g. flamethrower)
IF_GRENADE, // NPCs treat this as a grenade
IF_CHARGE, // For guns; charges up slowly
IF_CHARGE, // For guns; charges up slowly
IF_SHOCK, // Stuns and damages enemies, powers up shockers.
IF_UNARMED_WEAPON, // Counts as an unarmed weapon
+94 -91
View File
@@ -205,10 +205,11 @@ FOOD("chunk of meat", 50, 50, c_red, FLESH, itm_null,
1, 2, 0, 20, 24, 0, -1, 0, 1,-10, &iuse::none, ADD_NULL, "\
Freshly butchered meat. You could eat it raw, but cooking it is better.");
FOOD("chunk of veggy", 30, 60, c_green, VEGGY, itm_null,
FOOD("plant marrow", 30, 60, c_green, VEGGY, itm_null,
1, 2, 0, 20, 80, 0, 1, 0, 1, 0, &iuse::none, ADD_NULL, "\
A raw chunk of vegetable. Fine for eating raw, tastier when cooked.");
A nutrient rich chunk of plant matter, could be eaten raw or cooked.");
// NAME RAR PRC COLOR MAT1 CONTAINER
FOOD("human flesh", 50, 50, c_red, FLESH, itm_null,
// VOL WGT QUE NUT SPO STM HTH ADD CHG FUN use_func addiction type
1, 2, 0, 20, 24, 0, -1, 0, 1,-30, &iuse::none, ADD_NULL, "\
@@ -230,9 +231,9 @@ FOOD("cooked meat", 0, 75, c_red, FLESH, itm_null,
1, 2, 0, 50, 24, 0, 0, 0, 1, 8, &iuse::none, ADD_NULL, "\
Freshly cooked meat. Very nutritious.");
FOOD("cooked veggy", 0, 70, c_green, VEGGY, itm_null,
FOOD("cooked plant marrow", 0, 70, c_green, VEGGY, itm_null,
1, 2, 0, 40, 50, 0, 1, 0, 1, 0, &iuse::none, ADD_NULL, "\
Freshly cooked vegetables. Very nutritious.");
A freshly cooked chunk of plant matter, tasty and nutritious.");
FOOD("cooked wild vegetables", 0, 70, c_green, VEGGY, itm_null,
1, 2, 0, 40, 50, 0, 1, 0, 1, 0, &iuse::none, ADD_NULL, "\
@@ -836,19 +837,6 @@ MELEE("nail bat", 60, 160,'/', c_ltred, WOOD, MNULL,
12, 10, 28, 6, 3, mfb(IF_STAB), "\
A baseball bat with several nails driven through it, an excellent melee weapon.");
MELEE("X-Acto knife", 10, 40,';', c_dkgray, IRON, PLASTIC,
1, 0, 0, 14, -4, mfb(IF_SPEAR), "\
A small, very sharp knife. Causes decent damage but is difficult to hit\n\
with. Its small tip allows for a precision strike in hands of the skill."
);
TECH(mfb(TEC_PRECISE));
MELEE("scalpel", 48, 40,',', c_cyan, STEEL, MNULL,
1, 0, 0, 18, -4, mfb(IF_SPEAR), "\
A small, very sharp knife, used in surgery. Its small tip allows for a\n\
precision strike in the hands of the skilled.");
TECH(mfb(TEC_PRECISE));
MELEE("pot", 25, 45,')', c_ltgray, IRON, MNULL,
8, 6, 9, 0, 1, 0, "\
Useful for boiling water when cooking spaghetti and more.");
@@ -890,31 +878,11 @@ An aluminium baseball bat, smaller and lighter than a wooden bat\n\
and a little less damaging as a result.");
TECH( mfb(TEC_WBLOCK_1) );
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("machete", 5, 280,'/', c_blue, IRON, MNULL,
// VOL WGT DAM CUT HIT FLAGS
8, 14, 6, 28, 2, 0, "\
This huge iron knife makes an excellent melee weapon.");
TECH( mfb(TEC_WBLOCK_1) );
MELEE("katana", 2, 980,'/', c_ltblue, STEEL, MNULL,
16, 16, 4, 45, 1, mfb(IF_STAB), "\
A rare sword from Japan. Deadly against unarmored targets, and still very\n\
effective against the armored.");
TECH( mfb(TEC_RAPID)|mfb(TEC_WBLOCK_2) );
MELEE("wood spear", 5, 40,'/', c_ltred, WOOD, MNULL,
5, 3, 4, 18, 1, mfb(IF_SPEAR), "\
A simple wood pole with one end sharpened.");
TECH( mfb(TEC_WBLOCK_1) | mfb(TEC_RAPID) );
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("steel spear", 5, 140,'/', c_ltred, WOOD, STEEL,
// VOL WGT DAM CUT HIT FLAGS
6, 6, 2, 28, 1, mfb(IF_SPEAR), "\
A simple wood pole made deadlier by the knife tied to it.");
TECH( mfb(TEC_WBLOCK_1) | mfb(TEC_RAPID) );
MELEE("expandable baton",8, 175,'/', c_blue, STEEL, MNULL,
1, 4, 12, 0, 2, 0, "\
A telescoping baton that collapses for easy storage. Makes an excellent\n\
@@ -968,12 +936,6 @@ A rock the size of your fist. It is covered with intricate spirals; it is\n\
impossible to tell whether they are carved, naturally formed, or some kind of\n\
fossil.");
MELEE("rapier", 3, 980,'/', c_ltblue, STEEL, MNULL,
6, 9, 5, 28, 2, mfb(IF_STAB), "\
Preferred weapon of gentlemen and swashbucklers. Light and quick, it makes\n\
any battle a stylish battle.");
TECH( mfb(TEC_RAPID)|mfb(TEC_WBLOCK_1)|mfb(TEC_PRECISE) );
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("walking cane", 10, 160,'/', c_ltred, WOOD, MNULL,
// VOL WGT DAM CUT HIT FLAGS
@@ -992,19 +954,6 @@ MELEE("USB drive", 5, 100,',', c_white, PLASTIC,MNULL,
0, 0, 0, 0, 0, 0, "\
A USB thumb drive. Useful for holding software.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("awl pike", 5,2000,'/', c_ltcyan, IRON, WOOD,
// VOL WGT DAM CUT HIT FLAGS
14, 18, 8, 50, 2, mfb(IF_SPEAR), "\
A medieval weapon consisting of a wood shaft, tipped with an iron spike.\n\
Though large and heavy compared to other spears, its accuracy and damage\n\
are unparalled.");
MELEE("broadsword", 30,1200,'/',c_cyan, IRON, MNULL,
7, 11, 8, 35, 2, mfb(IF_STAB), "\
An early modern sword seeing use in the 16th, 17th ane 18th centuries.\n\
Called 'broad' to contrast with the slimmer rapiers.");
MELEE("mace", 20,1000,'/',c_dkgray, IRON, WOOD,
10, 18, 36, 0, 1, 0, "\
A medieval weapon consisting of a wood handle with a heavy iron end. It\n\
@@ -1093,21 +1042,6 @@ MELEE("lawnmower", 25, 100, ';', c_red, STEEL, IRON,
A motorized pushmower, it seems to be broken. You could\n\
take it apart if you had a wrench.");
MELEE("lawnmower blade", 0, 100, '/', c_ltgray, IRON, MNULL,
7, 5, 4, 15, -1, mfb(IF_STAB), "\
The blade of a lawnmower. It's not incredibly sharp, but\n\
it could still do some serious damage.");
MELEE("lawnmower machete", 0, 100, '/', c_ltgray, IRON, MNULL,
7, 5, 4, 15, 1, mfb(IF_STAB), "\
A lawnmower blade that's been fashioned into a makeshift\n\
machete, mainly by adding a handle for easier wielding.");
MELEE("lawnmower halberd", 0, 100, '/', c_ltgray, IRON, MNULL,
10, 7, 4, 15, 2, mfb(IF_STAB), "\
A lawnmower blade affixed to a long stick, in the right\n\
hands, this thing could do some massive damage.");
MELEE("sheet", 0, 100, ';', c_dkgray, COTTON, MNULL,
20, 2, 0, 0, -1, 0, "\
A large fabric sheet, could be used as a curtain or bedsheets;\n\
@@ -1201,15 +1135,15 @@ MELEE("blood soaked rag", 1, 0, ',', c_red, COTTON, MNULL,
0, 0, 0, 0, 0, 0, "\
A large rag, drenched in blood. It could be cleaned with\n\
boiling water.");
MELEE("clock", 60, 0, ';', c_ltcyan, PLASTIC, IRON,
1, 2, 0, 0, 0, 0, "\
A small mechanical clock, it's stopped at 10:10.");
MELEE("clockworks", 30, 0, ';', c_ltcyan, IRON, MNULL,
1, 1, 0, 0, 0, 0, "\
A small assortment of gears and other clockwork gubbins.");
MELEE("clock", 60, 0, ';', c_ltcyan, PLASTIC, IRON,
1, 2, 0, 0, 0, 0, "\
A small mechanical clock, it's stopped at 10:10.");
MELEE("clockworks", 30, 0, ';', c_ltcyan, IRON, MNULL,
1, 1, 0, 0, 0, 0, "\
A small assortment of gears and other clockwork gubbins.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
MELEE("steel frame", 20, 55, ']', c_cyan, STEEL, MNULL,
@@ -1894,7 +1828,7 @@ TECH( mfb(TEC_WBLOCK_1) );
ARMOR("bike helmet", 35, 140,C_HAT, PLASTIC, MNULL,
12, 2, 4, 0, 1, 8, 2, 0, 20, 0, mfb(bp_head), "\
A thick foam helmet. Designed to protect against percussion.");
A thick foam helmet. Designed to protect against concussion.");
TECH( mfb(TEC_WBLOCK_1) );
ARMOR("skid lid", 30, 190,C_HAT, PLASTIC, IRON,
@@ -1959,12 +1893,13 @@ A huge military rucksack, provides a lot of storage.");
// NAME RAR PRC COLOR MAT1 MAT2
ARMOR("purse", 40, 75,C_STORE, LEATHER, MNULL,
// VOL WGT DAM HIT ENC RES CUT ENV WRM STO COVERS
10, 3, 2, 2, 1, 0, 0, 0, 0, 20, mfb(bp_torso), "\
10, 3, 2, 2, 0, 0, 0, 0, 0, 20, mfb(bp_torso), "\
A bit encumbersome to wear, but provides lots of storage.");
ARMOR("messenger bag", 20, 110,C_STORE, PLASTIC, MNULL,
8, 2, 1, 1, 1, 0, 0, 0, 0, 30, mfb(bp_torso), "\
A bit encumbersome to wear, but provides lots of storage.");
// VOL WGT DAM HIT ENC RES CUT ENV WRM STO COVERS
8, 2, 1, 1, 0, 0, 0, 0, 0, 20, mfb(bp_torso), "\
Light and easy to wear, but doesn't offer much storage.");
ARMOR("fanny pack", 10, 100,C_STORE, PLASTIC, MNULL,
3, 1, 1, 2, 0, 0, 0, 0, 0, 6, 0, "\
@@ -3011,14 +2946,14 @@ GUN("Boeing XM-P Plasma Rifle", 1,13000,c_ltblue,STEEL, MNULL,
Boeing developed the focused plasma weaponry together with DARPA. It heats\n\
hydrogen to create plasma and envelops it with polymers to reduce blooming.\n\
While powerful, it suffers from short range. Powered by UPS.",
mfb(IF_USE_UPS)|mfb(IF_MODE_BURST));
mfb(IF_USE_UPS)|mfb(IF_MODE_BURST));
// NAME RAR PRC COLOR MAT1 MAT2
GUN("Shotgun Revolver",1,600,c_red,IRON, WOOD,
// SKILL AMMO VOL WGT MDG HIT DMG ACC REC DUR BST CLIP
"shotgun", AT_SHOT,12, 24, 14, 3, 0, 6, 5, 6, 0, 6, 100, "\
A shotgun modified to use a revolver cylinder mechanism, it can hold\n\
6 cartridges.",
A shotgun modified to use a revolver cylinder mechanism, it can hold\n\
6 cartridges.",
mfb(IF_RELOAD_ONE));
// GUN MODS
@@ -3284,6 +3219,12 @@ BOOK("Guns n Ammo", 20, 48,c_pink, PAPER, MNULL,
1, 1, -3, 1, "gun", 1, 0, 1, 2, 7, "\
Reviews of firearms, and various useful tips about their use.");
BOOK("Archery for Kids", 20, 48, c_pink, PAPER, MNULL,
1, 1, -3, 1, "archery", 1, 0, 1, 2, 7, "\
Will you be able to place the arrow right into bull's eye?\n\
It is not that easy, but once you know how it's done,\n\
you will have a lot of fun with archery.");
BOOK("romance novel", 30, 55,c_ltblue, PAPER, MNULL,
4, 1, -2, 0, NULL, 0, 0, 2, 4, 15, "\
Drama and mild smut.");
@@ -3917,7 +3858,69 @@ but much better than slumming it on the ground.");
TOOL("rollmat", 40,400,';', c_blue, MNULL, MNULL,
4, 3, 0, 0, -1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::set_trap,
0, "\
A thin rollmat, better than sleeping on the ground.");
A sheet of foam which can be rolled tightly for storage\n\
Insulates you from the floor, making it easier to sleep");
TOOL("X-Acto knife", 10, 40,';', c_dkgray, IRON, PLASTIC,
1, 0, 0, 14, -4, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_SPEAR), "\
A small, very sharp knife. Causes decent damage but is difficult to hit\n\
with. Its small tip allows for a precision strike in hands of the skill."
);
TECH(mfb(TEC_PRECISE));
TOOL("scalpel", 48, 40,',', c_cyan, STEEL, MNULL,
1, 0, 0, 18, -4, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_SPEAR), "\
A small, very sharp knife, used in surgery. Its small tip allows for a\n\
precision strike in the hands of the skilled.");
TECH(mfb(TEC_PRECISE));
TOOL("machete", 5, 280,'/', c_blue, IRON, MNULL,
8, 14, 6, 28, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, 0, "\
This huge iron knife makes an excellent melee weapon.");
TECH( mfb(TEC_WBLOCK_1) );
TOOL("katana", 2, 980,'/', c_ltblue, STEEL, MNULL,
16, 16, 4, 45, 1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_STAB), "\
A rare sword from Japan. Deadly against unarmored targets, and still very\n\
effective against the armored.");
TECH( mfb(TEC_RAPID)|mfb(TEC_WBLOCK_2) );
TOOL("steel spear", 5, 140,'/', c_ltred, WOOD, STEEL,
6, 6, 2, 28, 1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_SPEAR), "\
A simple wood pole made deadlier by the knife tied to it.");
TECH( mfb(TEC_WBLOCK_1) | mfb(TEC_RAPID) );
TOOL("rapier", 3, 980,'/', c_ltblue, STEEL, MNULL,
6, 9, 5, 28, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_STAB), "\
Preferred weapon of gentlemen and swashbucklers. Light and quick, it makes\n\
any battle a stylish battle.");
TECH( mfb(TEC_RAPID)|mfb(TEC_WBLOCK_1)|mfb(TEC_PRECISE) );
TOOL("awl pike", 5,2000,'/', c_ltcyan, IRON, WOOD,
14, 18, 8, 50, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_SPEAR), "\
A medieval weapon consisting of a wood shaft, tipped with an iron spike.\n\
Though large and heavy compared to other spears, its accuracy and damage\n\
are unparalled.");
TOOL("broadsword", 30,1200,'/',c_cyan, IRON, MNULL,
7, 11, 8, 35, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_STAB), "\
An early modern sword seeing use in the 16th, 17th ane 18th centuries.\n\
Called 'broad' to contrast with the slimmer rapiers.");
TOOL("lawnmower blade", 0, 100, '/', c_ltgray, IRON, MNULL,
7, 5, 4, 15, -1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_STAB), "\
The blade of a lawnmower. It's not incredibly sharp, but\n\
it could still do some serious damage.");
TOOL("lawnmower machete", 0, 100, '/', c_ltgray, IRON, MNULL,
7, 5, 4, 15, 1, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_STAB), "\
A lawnmower blade that's been fashioned into a makeshift\n\
machete, mainly by adding a handle for easier wielding.");
TOOL("lawnmower halberd", 0, 100, '/', c_ltgray, IRON, MNULL,
10, 7, 4, 15, 2, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife, mfb(IF_STAB), "\
A lawnmower blade affixed to a long stick, in the right\n\
hands, this thing could do some massive damage.");
TOOL("steak knife", 85, 25,';', c_ltcyan, STEEL, MNULL,
1, 2, 2, 10, -3, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife,
@@ -4061,9 +4064,9 @@ app on, and is providing light.");
// NAME RAR PRC SYM COLOR MAT1 MAT2
TOOL("pocket knife", 14, 100,';', c_blue, STEEL, PLASTIC,
// VOL WGT DAM CUT HIT FLAGS
2, 2, 2, 10, -4, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife,
0, 2, 0, 10, -4, 0, 0, 0, 0, AT_NULL, itm_null, &iuse::knife,
mfb(IF_STAB), "\
A small pocket knife.");
A small pocket knife, not great for combat, but butter than nothing.");
// BIONICS
// These are the modules used to install new bionics in the player. They're
+93 -129
View File
@@ -410,7 +410,10 @@ void iuse::alcohol(game *g, player *p, item *it, bool t)
void iuse::cig(game *g, player *p, item *it, bool t)
{
g->add_msg_if_player(p,"You light a cigarette and smoke it.");
if (it->type->id == itm_cig)
g->add_msg_if_player(p,"You light a cigarette and smoke it.");
else //cigar
g->add_msg_if_player(p,"You take a few puffs from your cigar.");
p->add_disease(DI_CIG, 200, g);
for (int i = 0; i < p->illness.size(); i++) {
if (p->illness[i].type == DI_CIG && p->illness[i].duration > 600 &&
@@ -804,36 +807,6 @@ void iuse::scissors(game *g, player *p, item *it, bool t)
g->add_msg_if_player(p,"There's no point in cutting a rag.");
return;
}
if (cut->type->id == itm_string_36 || cut->type->id == itm_rope_30) {
p->moves -= 150;
bool is_string = (cut->type->id == itm_string_36);
int pieces = (is_string ? 6 : 5);
g->add_msg_if_player(p,"You cut the %s into %d smaller pieces.",
(is_string ? "string" : "rope"), pieces);
itype_id piece_id = (is_string ? itm_string_6 : itm_rope_6);
item string(g->itypes[piece_id], int(g->turn), g->nextinv);
p->i_rem(ch);
bool drop = false;
for (int i = 0; i < pieces; i++) {
int iter = 0;
while (p->has_item(string.invlet)) {
string.invlet = g->nextinv;
g->advance_nextinv();
iter++;
}
if (!drop && (iter == 52 || p->volume_carried() >= p->volume_capacity()))
drop = true;
if (drop)
g->m.add_item(p->posx, p->posy, string);
else
p->i_add(string, g);
}
return;
}
if (!cut->made_of(COTTON) && !cut->made_of(LEATHER)) {
g->add_msg_if_player(p,"You can only slice items made of cotton or leather.");
return;
}
if (cut->made_of(COTTON)) {
p->moves -= 25 * cut->volume();
int count = cut->volume();
@@ -1199,29 +1172,46 @@ void iuse::picklock(game *g, player *p, item *it, bool t)
diry += p->posy;
ter_id type = g->m.ter(dirx, diry);
int npcdex = g->npc_at(dirx, diry);
if (npcdex != -1) {
g->add_msg_if_player(p, "You can pick your friends, and you can");
g->add_msg_if_player(p, "pick your nose, but you can't pick");
g->add_msg_if_player(p, "your friend's nose");
return;
if (npcdex != -1) {
g->add_msg_if_player(p, "You can pick your friends, and you can");
g->add_msg_if_player(p, "pick your nose, but you can't pick");
g->add_msg_if_player(p, "your friend's nose");
return;
}
const char *door_name;
ter_id new_type;
if (type == t_chaingate_l) {
if (dice(4, 6) < dice(4, p->dex_cur)) {
g->add_msg_if_player(p,"You pick the lock and the gate swings open.");
p->moves -= (400 - (p->dex_cur * 5));
g->m.ter(dirx, diry) = t_chaingate_o;
return;
}
}
if (type == t_door_locked || type == t_door_locked_alarm) {
if (dice(4, 6) < dice(4, p->dex_cur)) {
g->add_msg_if_player(p,"You pick the lock and the door swings open.");
p->moves -= (400 - (p->dex_cur * 5));
g->m.ter(dirx, diry) = t_door_o;
return;
}
door_name = "gate";
new_type = t_chaingate_c;
} else if (type == t_door_locked || type == t_door_locked_alarm) {
door_name = "door";
new_type = t_door_c;
} else {
g->add_msg("That cannot be picked.");
return;
}
p->practice("mechanics", 1);
p->moves -= 500 - (p->dex_cur + p->skillLevel("mechanics").level()) * 5;
if (dice(4, 6) < dice(2, p->skillLevel("mechanics").level()) + dice(2, p->dex_cur) - it->damage / 2) {
p->practice("mechanics", 1);
g->add_msg_if_player(p,"With a satisfying click, the lock on the %s opens.", door_name);
g->m.ter(dirx, diry) = new_type;
} else if (dice(4, 4) < dice(2, p->skillLevel("mechanics").level()) +
dice(2, p->dex_cur) - it->damage / 2 && it->damage < 100) {
it->damage++;
g->add_msg_if_player(p,"The lock stumps your efforts to pick it, and you damage your tool.");
} else {
g->add_msg_if_player(p,"The lock stumps your efforts to pick it.");
}
if ( type == t_door_locked_alarm &&
dice(4, 7) < dice(2, p->skillLevel("mechanics").level()) +
dice(2, p->dex_cur) - it->damage / 2 && it->damage < 100) {
g->sound(p->posx, p->posy, 30, "An alarm sounds!");
if (!g->event_queued(EVENT_WANTED)) {
g->add_event(EVENT_WANTED, int(g->turn) + 300, 0, g->levx, g->levy);
}
}
}
void iuse::crowbar(game *g, player *p, item *it, bool t)
@@ -1242,36 +1232,30 @@ if (dirx == 0 && diry == 0) {
dirx += p->posx;
diry += p->posy;
ter_id type = g->m.ter(dirx, diry);
if (type == t_door_c || type == t_door_locked || type == t_door_locked_alarm) {
if (dice(4, 6) < dice(4, p->str_cur)) {
g->add_msg_if_player(p,"You pry the door open.");
p->moves -= (150 - (p->str_cur * 5));
g->m.ter(dirx, diry) = t_door_o;
g->sound(dirx, diry, 8, "crunch!");
const char *door_name;
const char *action_name;
ter_id new_type;
bool noisy;
int difficulty;
} else {
g->add_msg_if_player(p,"You pry, but cannot open the door.");
p->moves -= 100;
}
} else if (g->m.ter(dirx, diry) == t_manhole_cover) {
if (dice(8, 8) < dice(8, p->str_cur)) {
g->add_msg_if_player(p,"You lift the manhole cover.");
p->moves -= (500 - (p->str_cur * 5));
g->m.ter(dirx, diry) = t_manhole;
g->m.add_item(p->posx, p->posy, g->itypes[itm_manhole_cover], 0);
} else {
g->add_msg_if_player(p,"You pry, but cannot lift the manhole cover.");
p->moves -= 100;
}
if (type == t_door_c || type == t_door_locked || type == t_door_locked_alarm) {
door_name = "door";
action_name = "pry open";
new_type = t_door_o;
noisy = true;
difficulty = 6;
} else if (type == t_manhole_cover) {
door_name = "manhole cover";
action_name = "lift";
new_type = t_manhole;
noisy = false;
difficulty = 12;
} else if (g->m.ter(dirx, diry) == t_crate_c) {
if (p->str_cur >= rng(3, 30)) {
g->add_msg_if_player(p,"You pop the crate open.");
p->moves -= (150 - (p->str_cur * 5));
g->m.ter(dirx, diry) = t_crate_o;
} else {
g->add_msg_if_player(p,"You pry, but cannot open the crate.");
p->moves -= 100;
}
door_name = "crate";
action_name = "pop open";
new_type = t_crate_o;
noisy = true;
difficulty = 6;
} else {
int nails = 0, boards = 0;
ter_id newter;
@@ -1296,15 +1280,35 @@ if (dirx == 0 && diry == 0) {
boards = 3;
newter = t_fence_post;
break;
default:
g->add_msg_if_player(p,"There's nothing to pry there.");
return;
}
if(p->skillLevel("carpentry").level() < 1)
p->practice("carpentry", 1);
p->moves -= 500;
g->m.add_item(p->posx, p->posy, g->itypes[itm_nail], 0, nails);
g->m.add_item(p->posx, p->posy, g->itypes[itm_2x4], 0, boards);
g->m.ter(dirx, diry) = newter;
g->m.ter(dirx, diry) = newter;
return;
}
p->practice("mechanics", 1);
p->moves -= (difficulty * 25) - ((p->str_cur + p->skillLevel("mechanics").level()) * 5);
if (dice(4, difficulty) < dice(2, p->skillLevel("mechanics").level()) + dice(2, p->str_cur)) {
p->practice("mechanics", 1);
g->add_msg_if_player(p,"You %s the %s.", action_name, door_name);
g->m.ter(dirx, diry) = new_type;
if (noisy)
g->sound(dirx, diry, 8, "crunch!");
if ( type == t_door_locked_alarm ) {
g->sound(p->posx, p->posy, 30, "An alarm sounds!");
if (!g->event_queued(EVENT_WANTED)) {
g->add_event(EVENT_WANTED, int(g->turn) + 300, 0, g->levx, g->levy);
}
}
} else {
g->add_msg_if_player(p,"You pry, but cannot %s the %s.", action_name, door_name);
}
}
@@ -1574,11 +1578,19 @@ That trap needs a 3x3 space to be clear, centered two tiles from you.");
practice = 12;
break;
case itm_landmine:
buried = (p->has_amount(itm_shovel, 1) &&
g->m.has_flag(diggable, posx, posy) &&
query_yn("Bury the landmine?"));
type = (buried ? tr_landmine_buried : tr_landmine);
message << "You " << (buried ? "bury" : "set") << " the landmine.";
practice = (buried ? 7 : 4);
break;
/*case itm_landmine:
buried = true;
message << "You bury the landmine.";
type = tr_landmine;
practice = 7;
break;
break;*/
default:
g->add_msg_if_player(p,"Tried to set a trap. But got confused! %s", it->tname().c_str());
return;
@@ -2345,54 +2357,6 @@ void iuse::vacutainer(game *g, player *p, item *it, bool t)
g->add_msg("There's no point in cutting a rag.");
return;
}
if (cut->type->id == itm_string_36 || cut->type->id == itm_rope_30) {
bool is_string = cut->type->id == itm_string_36;
int num_pieces = is_string ? 6 : 5;
p->moves -= is_string ? 150 : 300;
g->add_msg("You cut the %s into %d smaller pieces.", is_string
? "string" : "rope", num_pieces);
item string(g->itypes[is_string ?itm_string_6 : itm_rope_6],
int(g->turn), g->nextinv);
p->i_rem(ch);
bool drop = false;
for (int i = 0; i < num_pieces; i++) {
int iter = 0;
while (p->has_item(string.invlet)) {
string.invlet = g->nextinv;
g->advance_nextinv();
iter++;
}
if (!drop && (iter == 52 || p->volume_carried() >= p->volume_capacity()))
drop = true;
if (drop)
g->m.add_item(p->posx, p->posy, string);
else
p->i_add(string);
}
return;
}
if (cut->type->id == itm_rope_6) {
p->moves -= 150;
g->add_msg("You cut the rope in half and unbraid it into 6 pieces of string.");
item string(g->itypes[itm_string_36], int(g->turn), g->nextinv);
p->i_rem(ch);
bool drop = false;
for (int i = 0; i < 6; i++) {
int iter = 0;
while (p->has_item(string.invlet)) {
string.invlet = g->nextinv;
g->advance_nextinv();
iter++;
}
if (!drop && (iter == 52 || p->volume_carried() >= p->volume_capacity()))
drop = true;
if (drop)
g->m.add_item(p->posx, p->posy, string);
else
p->i_add(string);
}
return;
}
if (!cut->made_of(COTTON) && !cut->made_of(LEATHER)) {
g->add_msg("You can only slice items made of cotton.");
return;
+1 -46
View File
@@ -17,7 +17,7 @@ long input()
bool input_wait(char & ret_ch, int delay_ms)
{
for(;;)
while(true)
{
ret_ch = '\0';
timeout(delay_ms);
@@ -53,51 +53,6 @@ bool input_wait(char & ret_ch, int delay_ms)
}
}
void get_direction(int &x, int &y, char ch)
{
x = 0;
y = 0;
switch (ch) {
case 'y':
x = -1;
y = -1;
return;
case 'u':
x = 1;
y = -1;
return;
case 'h':
x = -1;
return;
case 'j':
y = 1;
return;
case 'k':
y = -1;
return;
case 'l':
x = 1;
return;
case 'b':
x = -1;
y = 1;
return;
case 'n':
x = 1;
y = 1;
return;
case '.':
case ',':
case 'g':
x = 0;
y = 0;
return;
default:
x = -2;
y = -2;
}
}
void get_direction(game *g, int &x, int &y, char ch)
{
x = 0;
-2
View File
@@ -10,8 +10,6 @@ class game;
long input();
bool input_wait(char & ret_ch, int timeout);
// If ch is vikey, x & y are set to corresponding direction; ch=='y'->x=-1,y=-1
void get_direction(int &x, int &y, char ch);
// Uses the keymap to figure out direction properly
void get_direction(game *g, int &x, int &y, char ch);
std::string default_keymap_txt();
+8 -2
View File
@@ -1,5 +1,5 @@
#include "line.h"
#include "map.h"
#include <stdlib.h>
#define SGN(a) (((a)<0) ? -1 : 1)
@@ -192,7 +192,13 @@ rl_vec2d rl_vec2d::normalized(){
return ret;
}
float rl_vec2d::dot_product (rl_vec2d &v){
return x*v.x + y*v.y;
float dot = x*v.x + y*v.y;
// this is messy, but the dot of normalized rl_vecs should somehow be max 1
float tot1 = fabs(x) + fabs(y);
float tot2 = fabs(v.x) + fabs(v.y);
dot /= ((tot1+tot2)/2);
dot *= norm() * v.norm();
return dot;
}
bool rl_vec2d::is_null(){
return !(x || y);
+1
View File
@@ -46,6 +46,7 @@ int main(int argc, char *argv[])
keypad(stdscr, true); // Numpad is numbers
init_colors(); // See color.cpp
curs_set(0); // Invisible cursor
set_escdelay(10); // Make escape actually responsive
std::srand(seed);
+37 -28
View File
@@ -1,4 +1,4 @@
#include "map.h"
# include "map.h"
#include "lightmap.h"
#include "output.h"
#include "rng.h"
@@ -515,9 +515,12 @@ bool map::vehproceed(game* g){
}
}
if (veh->skidding && one_in(4)) // might turn uncontrollably while skidding
veh->move.init (veh->move.dir() +
(one_in(2) ? -15 * rng(1, 3) : 15 * rng(1, 3)));
if (veh->skidding){
if (one_in(4)){ // might turn uncontrollably while skidding
veh->move.init (veh->move.dir() +
(one_in(2) ? -15 * rng(1, 3) : 15 * rng(1, 3)));
}
}
else if (pl_ctrl && rng(0, 4) > g->u.skillLevel("driving").level() && one_in(20)) {
g->add_msg("You fumble with the %s's controls.", veh->name.c_str());
veh->turn (one_in(2) ? -15 : 15);
@@ -607,6 +610,8 @@ bool map::vehproceed(game* g){
//give veh2 the initiative to proceed next before veh1
float avg_of_turn = (veh2->of_turn + veh->of_turn) / 2;
if(avg_of_turn < .1)
avg_of_turn = .1;
veh->of_turn = avg_of_turn * .9;
veh2->of_turn = avg_of_turn * 1.1;
return true;
@@ -707,8 +712,10 @@ bool map::vehproceed(game* g){
if (can_move) {
// accept new direction
if (veh->skidding)
if (veh->skidding){
veh->face.init (veh->turn_dir);
veh->possibly_recover_from_skid();
}
else
veh->face = mdir;
veh->move = mdir;
@@ -718,7 +725,7 @@ bool map::vehproceed(game* g){
}
// accept new position
// if submap changed, we need to process grid from the beginning.
int sm_change = displace_vehicle (g, x, y, dx, dy);
displace_vehicle (g, x, y, dx, dy);
} else { // can_move
veh->stop();
}
@@ -907,7 +914,7 @@ bool map::is_destructable_ter_only(const int x, const int y)
bool map::is_outside(const int x, const int y)
{
bool out = (ter(x, y) != t_bed && ter(x, y) != t_groundsheet);
bool out = (ter(x, y) != t_bed && ter(x, y) != t_groundsheet && ter(x, y) != t_fema_groundsheet);
for(int i = -1; out && i <= 1; i++)
for(int j = -1; out && j <= 1; j++) {
@@ -1085,8 +1092,8 @@ bool map::bash(const int x, const int y, const int str, std::string &sound, int
return true;
}
break;
case t_palisade:
case t_palisade:
case t_palisade_gate:
result = rng(0, 120);
if (res) *res = result;
@@ -1100,8 +1107,8 @@ case t_palisade_gate:
sound += "whump!";
return true;
}
break;
break;
case t_wall_log:
result = rng(0, 120);
if (res) *res = result;
@@ -1144,7 +1151,7 @@ case t_wall_log:
return true;
}
break;
case t_chaingate_c:
result = rng(0, has_adjacent_furniture(x, y) ? 80 : 100);
@@ -1209,7 +1216,7 @@ case t_wall_log:
break;
case t_window_domestic:
case t_curtains:
case t_curtains:
case t_window_domestic_taped:
result = rng(0, 6);
if (res) *res = result;
@@ -1226,8 +1233,8 @@ case t_wall_log:
break;
case t_window:
case t_window_alarm:
case t_window_alarm_taped:
case t_window_alarm:
case t_window_alarm_taped:
case t_window_taped:
result = rng(0, 6);
if (res) *res = result;
@@ -1679,7 +1686,7 @@ void map::shoot(game *g, const int x, const int y, int &dam,
switch (ter(x, y)) {
case t_wall_wood_broken:
case t_wall_wood_broken:
case t_wall_log_broken:
case t_door_b:
if (hit_items || one_in(8)) { // 1 in 8 chance of hitting the door
@@ -1706,6 +1713,7 @@ void map::shoot(game *g, const int x, const int y, int &dam,
break;
case t_window:
case t_window_domestic:
case t_window_alarm:
dam -= rng(0, 5);
ter(x, y) = t_window_frame;
@@ -1867,6 +1875,7 @@ bool map::hit_with_acid(game *g, const int x, const int y)
case t_bathtub:
case t_gas_pump:
case t_gas_pump_smashed:
case t_gas_pump_empty:
return false;
case t_card_science:
@@ -1898,12 +1907,12 @@ bool map::open_door(const int x, const int y, const bool inside)
{
if (ter(x, y) == t_door_c) {
ter(x, y) = t_door_o;
return true;
} else if (ter(x, y) == t_palisade_gate) {
ter(x, y) = t_palisade_gate_o;
return true;
} else if (ter(x, y) == t_palisade_gate) {
ter(x, y) = t_palisade_gate_o;
return true;
} else if (ter(x, y) == t_canvas_door) {
ter(x, y) = t_canvas_door_o;
ter(x, y) = t_canvas_door_o;
return true;
} else if (inside && ter(x, y) == t_curtains) {
ter(x, y) = t_window_domestic;
@@ -1950,15 +1959,15 @@ bool map::close_door(const int x, const int y, const bool inside)
{
if (ter(x, y) == t_door_o) {
ter(x, y) = t_door_c;
return true;
} else if (ter(x, y) == t_palisade_gate_o) {
ter(x, y) = t_palisade_gate;
return true;
} else if (ter(x, y) == t_palisade_gate_o) {
ter(x, y) = t_palisade_gate;
return true;
} else if (inside && ter(x, y) == t_window_domestic) {
ter(x, y) = t_curtains;
return true;
} else if (ter(x, y) == t_canvas_door_o) {
ter(x, y) = t_canvas_door;
ter(x, y) = t_canvas_door;
return true;
} else if (inside && ter(x, y) == t_window_open) {
ter(x, y) = t_window_domestic;
@@ -2775,10 +2784,10 @@ std::vector<point> map::route(const int Fx, const int Fy, const int Tx, const in
tername(Fx, Fy).c_str(), Tx, Ty);
*/
std::vector<point> open;
astar_list list[SEEX * my_MAPSIZE][SEEY * my_MAPSIZE];
int score [SEEX * my_MAPSIZE][SEEY * my_MAPSIZE];
int gscore [SEEX * my_MAPSIZE][SEEY * my_MAPSIZE];
point parent [SEEX * my_MAPSIZE][SEEY * my_MAPSIZE];
astar_list list[SEEX * MAPSIZE][SEEY * MAPSIZE];
int score [SEEX * MAPSIZE][SEEY * MAPSIZE];
int gscore [SEEX * MAPSIZE][SEEY * MAPSIZE];
point parent [SEEX * MAPSIZE][SEEY * MAPSIZE];
int startx = Fx - 4, endx = Tx + 4, starty = Fy - 4, endy = Ty + 4;
if (Tx < Fx) {
startx = Tx - 4;
+5 -3
View File
@@ -171,6 +171,8 @@ class map
// mapgen.cpp functions
void generate(game *g, overmap *om, const int x, const int y, const int turn);
void post_process(game *g, unsigned zones);
void place_spawns(game *g, const moncat_id monster_type, const int chance,
const int x1, const int y1, const int x2, const int y2, const float density);
void place_items(items_location loc, const int chance, const int x1, const int y1,
const int x2, const int y2, bool ongrass, const int turn);
// put_items_from puts exactly num items, based on chances
@@ -194,9 +196,9 @@ protected:
bool loadn(game *g, const int x, const int y, const int gridx, const int gridy,
const bool update_vehicles = true);
void copy_grid(const int to, const int from);
void draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
oter_id t_south, oter_id t_west, oter_id t_above, const int turn,
game *g);
void draw_map(const oter_id terrain_type, const oter_id t_north, const oter_id t_east,
const oter_id t_south, const oter_id t_west, const oter_id t_above, const int turn,
game *g, const float density);
void add_extra(map_extra type, game *g);
void rotate(const int turns);// Rotates the current map 90*turns degress clockwise
// Useful for houses, shops, etc
+15 -13
View File
@@ -90,7 +90,7 @@ t_bridge,
t_canvas_wall, t_canvas_door, t_canvas_door_o, t_groundsheet, t_fema_groundsheet,
// Lighting related
t_skylight, t_emergency_light_flicker, t_emergency_light,
// Walls
// Walls
t_wall_log_half, t_wall_log, t_wall_log_chipped, t_wall_log_broken, t_palisade, t_palisade_gate, t_palisade_gate_o,
t_wall_half, t_wall_wood, t_wall_wood_chipped, t_wall_wood_broken,
t_wall_v, t_wall_h, t_concrete_v, t_concrete_h,
@@ -127,7 +127,7 @@ t_bed, t_toilet, t_makeshift_bed,
t_sink, t_oven, t_woodstove, t_bathtub, t_chair, t_armchair, t_sofa, t_cupboard, t_trashcan, t_desk,
t_sandbox, t_slide, t_monkey_bars, t_backboard,
t_bench, t_table, t_pool_table,
t_gas_pump, t_gas_pump_smashed,
t_gas_pump, t_gas_pump_smashed, t_gas_pump_empty,
t_missile, t_missile_exploded,
t_counter,
t_radio_tower, t_radio_controls,
@@ -219,7 +219,7 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
{"open canvas flap", '.', c_blue, 2, tr_null,
mfb(transparent)},
{"groundsheet", ';', c_green, 2, tr_null,
mfb(transparent)|mfb(tentable)},
mfb(transparent)|mfb(tentable)},
{"groundsheet", ';', c_green, 2, tr_null,
mfb(transparent)},
{"floor", '.', c_white, 2, tr_null,
@@ -229,20 +229,20 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
{"floor", '.', c_white, 2, tr_null,
mfb(transparent)|mfb(l_flammable)|mfb(supports_roof)|mfb(collapses)}, // Regular Light
{"half-built wall", '#', c_brown, 4, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)},
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)},
{"log wall", '#', c_brown, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
{"chipped log wall",'#', c_brown, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)},
{"broken log wall", '&', c_brown, 0, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)|
mfb(supports_roof)},
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)|
mfb(supports_roof)},
{"palisade wall", '#', c_brown, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent)},
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent)},
{"palisade gate", '+', c_ltred, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(door)|mfb(transparent)},
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(door)|mfb(transparent)},
{"open palisade gate", '#', c_ltred, 2, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent)},
mfb(bashable)|mfb(flammable)|mfb(noitem)|mfb(supports_roof)|mfb(transparent)},
{"half-built wall", '#', c_ltred, 4, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable2)|mfb(noitem)},
{"wooden wall", '#', c_ltred, 0, tr_null,
@@ -323,12 +323,12 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
mfb(transparent)},
{"window", '"', c_ltcyan, 0, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
mfb(supports_roof)|mfb(deconstruct)}, // Plain Ol' window
mfb(supports_roof)|mfb(deconstruct)}, // Plain Ol' window
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)}, // Regular window
{"window", '"', c_ltcyan, 0, tr_null,
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(noitem)|
mfb(supports_roof)|mfb(deconstruct)}, //has curtains
mfb(supports_roof)|mfb(deconstruct)}, //has curtains
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)}, // Curtain window
{"open window", '\'', c_ltcyan, 4, tr_null,
@@ -337,8 +337,8 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)},
{"window", '"', c_ltcyan, 0, tr_null, // Actually alarmed
mfb(transparent)|mfb(bashable)|mfb(flammable)|mfb(alarmed)|mfb(noitem)|
mfb(supports_roof)},
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(supports_roof)},
{"taped window", '"', c_dkgray, 0, tr_null,
mfb(bashable)|mfb(flammable)|mfb(noitem)| mfb(supports_roof)|mfb(alarmed)}, //Alarmed, duh.
{"empty window", '0', c_yellow, 8, tr_null,
mfb(transparent)|mfb(flammable)|mfb(supports_roof)},
@@ -464,6 +464,8 @@ const ter_t terlist[num_terrain_types] = { // MUST match enum ter_id above!
mfb(transparent)|mfb(explodes)|mfb(noitem)},
{"smashed gas pump", '&', c_ltred, 0, tr_null,
mfb(transparent)|mfb(noitem)},
{"out-of-order gasoline pump", '&', c_red, 0, tr_null,
mfb(transparent)|mfb(noitem)},
{"missile", '#', c_ltblue, 0, tr_null,
mfb(explodes)|mfb(noitem)},
{"blown-out missile",'#', c_ltgray, 0, tr_null,
+90 -12
View File
@@ -6,6 +6,7 @@
#include "rng.h"
#include "line.h"
#include "debug.h"
#include "options.h"
#ifndef sgn
#define sgn(x) (((x) < 0) ? -1 : 1)
@@ -191,7 +192,13 @@ void map::generate(game *g, overmap *om, int x, int y, int turn)
}
}
draw_map(terrain_type, t_north, t_east, t_south, t_west, t_above, turn, g);
// This attempts to scale density of zombies inversely with distance from the nearest city.
// In other words, make city centers dense and perimiters sparse.
city *closest_city = &om->cities[om->closest_city(point(overx, overy))];
float size = (float)closest_city->s;
float dist = (float)rl_dist(overx, overy, closest_city->x, closest_city->y);
float density = log(1 + (size - dist) / size);
draw_map(terrain_type, t_north, t_east, t_south, t_west, t_above, turn, g, density);
if ( one_in( oterlist[terrain_type].embellishments.chance ))
add_extra( random_map_extra( oterlist[terrain_type].embellishments ), g);
@@ -214,9 +221,9 @@ void map::generate(game *g, overmap *om, int x, int y, int turn)
}
}
void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
oter_id t_south, oter_id t_west, oter_id t_above, int turn,
game *g)
void map::draw_map(const oter_id terrain_type, const oter_id t_north, const oter_id t_east,
const oter_id t_south, const oter_id t_west, const oter_id t_above,
const int turn, game *g, const float density)
{
// Big old switch statement with a case for each overmap terrain type.
// Many of these can be copied from another type, then rotated; for instance,
@@ -283,7 +290,6 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
if (one_in(30))
{
ter(i, j) = t_shrub_blueberry;
add_item(i, j, (*itypes)[itm_blueberries], turn);
}
else
ter(i, j) = t_shrub;
@@ -729,6 +735,8 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
}
if (terrain_type == ot_road_ew)
rotate(1);
if(rn == 1)
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
place_items(mi_road, 5, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, false, turn);
break;
@@ -765,6 +773,8 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_road_wn)
rotate(3);
if(rn == 1)
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
place_items(mi_road, 5, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, false, turn);
break;
@@ -801,6 +811,8 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_road_new)
rotate(3);
if(rn == 1)
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
place_items(mi_road, 5, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, false, turn);
break;
@@ -861,6 +873,8 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
place_items(mi_trash, 5, 0, 0, SEEX * 2 -1, SEEX * 2 - 1, true, 0);
} else
place_items(mi_road, 5, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, false, turn);
if(rn == 1)
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
if (terrain_type == ot_road_nesw_manhole)
ter(rng(6, SEEX * 2 - 6), rng(6, SEEX * 2 - 6)) = t_manhole_cover;
break;
@@ -1268,6 +1282,8 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
}
}
place_items(mi_rare, 60, 0, 0, SEEX * 2 - 1, SEEY * 2 - 1, false, turn);
} else { // Just boring old zombies
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
}
if (terrain_type == ot_house_east || terrain_type == ot_house_base_east)
@@ -1477,6 +1493,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_gas_west)
rotate(3);
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_pharm_north:
@@ -1549,6 +1566,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_pharm_west)
rotate(3);
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_grocery_north:
@@ -1615,6 +1633,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_grocery_west)
rotate(3);
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_hardware_north:
@@ -1738,6 +1757,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_hardware_west)
rotate(3);
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_electronics_north:
@@ -1783,6 +1803,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_electronics_west)
rotate(3);
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_sports_north:
@@ -1852,6 +1873,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_sports_west)
rotate(3);
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_liquor_north:
@@ -1912,6 +1934,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_liquor_west)
rotate(3);
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_gun_north:
@@ -1965,6 +1988,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_gun_west)
rotate(3);
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_clothes_north:
@@ -2049,6 +2073,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_clothes_west)
rotate(3);
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_library_north:
@@ -2108,6 +2133,7 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_library_west)
rotate(3);
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
case ot_s_restaurant_north:
@@ -2233,7 +2259,9 @@ void map::draw_map(oter_id terrain_type, oter_id t_north, oter_id t_east,
rotate(2);
if (terrain_type == ot_s_restaurant_west)
rotate(3);
} break;
}
place_spawns(g, mcat_zombie, 2, 0, 0, SEEX * 2 - 1, SEEX * 2 - 1, density);
break;
//....
case ot_shelter: {
@@ -4191,7 +4219,7 @@ case ot_lmoe: {
} else { // We're above ground!
// First, draw a forest
draw_map(ot_forest, t_north, t_east, t_south, t_west, t_above, turn, g);
draw_map(ot_forest, t_north, t_east, t_south, t_west, t_above, turn, g, density);
// Clear the center with some rocks
square(this, t_rock, SEEX - 6, SEEY - 6, SEEX + 5, SEEY + 5);
int pathx, pathy;
@@ -5560,6 +5588,10 @@ break;
line(this, t_counter, 15, 14, 17, 14);
place_items(mi_surgery, 60, 15, 14, 17, 14, false, 0);
square(this, t_bed, 18, 18, 19, 19);
// computer to begin healing broken bones,
tmpcomp = add_computer(16, 16, "Mr. Stem Cell", 3);
tmpcomp->add_option("Stem Cell Treatment", COMPACT_STEMCELL_TREATMENT, 3);
tmpcomp->add_failure(COMPFAIL_ALARM);
break;
@@ -5916,7 +5948,7 @@ break;
}
if(t_west == ot_fema && t_east == ot_fema && t_south != ot_fema){ //lab bottom side
square(this, t_dirt, 1, 1, 22, 22);
square(this, t_pavement, 4, 4, 19, 19);
square(this, t_floor, 4, 4, 19, 19);
line(this, t_concrete_h, 4, 4, 19, 4);
line(this, t_concrete_h, 4, 19, 19, 19);
line(this, t_concrete_v, 4, 5, 4, 18);
@@ -7264,6 +7296,52 @@ void map::post_process(game *g, unsigned zones)
}
void map::place_spawns(game *g, const moncat_id monster_type, const int chance,
const int x1, const int y1, const int x2, const int y2, const float density)
{
if (!OPTIONS[OPT_STATIC_SPAWN])
return;
if (one_in(chance))
{
const std::vector<mon_id> group = g->moncats[monster_type];
int num = density * (float)rng(10, 50);
int total_freq = 0;
for (int i = 0; i < group.size(); i++)
if (g->mtypes[group[i]]->frequency > 0)
total_freq += g->mtypes[group[i]]->frequency;
if( total_freq == 0)
return;
for (int i = 0; i < num; i++)
{
int tries = 10;
int x = 0;
int y = 0;
// Pick a spot for the spawn
do {
x = rng(x1, x2);
y = rng(y1, y2);
tries--;
} while( move_cost(x, y) == 0 && tries );
// Pick a monster type
int choice = rng(0, total_freq);
int monster_index = -1;
do {
monster_index++;
choice -= g->mtypes[group[monster_index]]->frequency;
} while (choice > 0);
add_spawn(group[monster_index], 1, x, y);
}
}
}
void map::place_items(items_location loc, int chance, int x1, int y1,
int x2, int y2, bool ongrass, int turn)
{
@@ -7423,7 +7501,7 @@ void map::rotate(int turns)
ter_id rotated [SEEX*2][SEEY*2];
trap_id traprot [SEEX*2][SEEY*2];
std::vector<item> itrot[SEEX*2][SEEY*2];
std::vector<spawn_point> sprot[my_MAPSIZE * my_MAPSIZE];
std::vector<spawn_point> sprot[MAPSIZE * MAPSIZE];
computer tmpcomp;
std::vector<vehicle*> tmpveh;
@@ -8895,7 +8973,7 @@ void map::add_extra(map_extra type, game *g)
}
if (placed == tr_beartrap && has_flag(diggable, i, j)) {
if (one_in(8))
placed = tr_landmine;
placed = tr_landmine_buried;
else
placed = tr_beartrap_buried;
}
@@ -9055,9 +9133,9 @@ void map::add_extra(map_extra type, game *g)
}
for (int i = 0; i < num_mines; i++) {
int x = rng(0, SEEX * 2 - 1), y = rng(0, SEEY * 2 - 1);
if (!has_flag(diggable, x, y) || one_in(4))
if (!has_flag(diggable, x, y) || one_in(8))
ter(x, y) = t_dirtmound;
add_trap(x, y, tr_landmine);
add_trap(x, y, tr_landmine_buried);
}
}
break;
+4 -3
View File
@@ -136,7 +136,8 @@ void game::init_mapitems()
setvector(
mapitems[mi_magazines],
itm_mag_tv, itm_mag_news, itm_mag_cars, itm_mag_cooking,
itm_novel_romance, itm_novel_spy, itm_mag_carpentry, NULL);
itm_novel_romance, itm_novel_spy, itm_mag_carpentry,
itm_mag_guns, itm_mag_archery, NULL);
setvector(
mapitems[mi_softdrugs],
@@ -239,7 +240,7 @@ void game::init_mapitems()
itm_sewing_kit, itm_thread, itm_hammer, itm_flashlight, itm_water_purifier,
itm_radio, itm_beartrap, itm_extinguisher, itm_string_36, itm_longbow,
itm_compbow, itm_arrow_wood, itm_arrow_cf, itm_rollmat, itm_tent_kit,
itm_tshirt_fit, itm_foot_crank, NULL);
itm_tshirt_fit, itm_foot_crank, itm_mag_archery, NULL);
setvector(
mapitems[mi_alcohol],
@@ -307,7 +308,7 @@ void game::init_mapitems()
setvector(
mapitems[mi_gunxtras],
itm_glasses_safety, itm_goggles_nv, itm_holster, itm_bootstrap,
itm_mag_guns, itm_flashlight, itm_UPS_off, itm_silencer, itm_grip,
itm_mag_guns, itm_mag_archery, itm_flashlight, itm_UPS_off, itm_silencer, itm_grip,
itm_barrel_big, itm_barrel_small, itm_barrel_rifled, itm_clip, itm_spare_mag,
itm_clip2, itm_stablizer, itm_blowback, itm_autofire, itm_retool_45,
itm_retool_9mm, itm_retool_22, itm_retool_57, itm_retool_46,
+2 -1
View File
@@ -448,7 +448,8 @@ int monster::trigger_sum(game *g, std::vector<monster_trigger> *triggers)
for (int n = 0; n < items->size(); n++) {
if ((*items)[n].type->id == itm_corpse ||
(*items)[n].type->id == itm_meat ||
(*items)[n].type->id == itm_meat_tainted) {
(*items)[n].type->id == itm_meat_cooked ||
(*items)[n].type->id == itm_human_flesh) {
ret += 3;
check_meat = false;
}
+4 -4
View File
@@ -234,7 +234,7 @@ FLAGS(MF_DIGS, MF_HEARS, MF_GOODHEARING, MF_WARM, MF_LEATHER);
// ZOMBIES
mon("zombie", species_zombie, 'Z', c_ltgreen, MS_MEDIUM, FLESH,
// frq dif agr mor spd msk mdi m## cut dge bsh cut itm HP special freq
90, 3,100,100, 70, 8, 1, 5, 0, 1, 0, 0, 40, 50, 0,
90, 3,100,100, 70, 8, 1, 5, 2, 1, 0, 0, 40, 50, 0,
&mdeath::normal, &mattack::none, "\
A human body, stumbling slowly forward on\n\
uncertain legs, possessed with an unstoppable\n\
@@ -432,13 +432,13 @@ Actual cannibal Shia LaBeouf!");
mon("child zombie",species_zombie, 'z', c_ltgreen, MS_SMALL, FLESH,
// frq dif agr mor spd msk mdi m## cut dge bsh cut itm HP special freq
10, 3,100,100,100, 8, 1, 3, 3, 4, 0, 0, 45, 25, 0,
5, 2, 65,100, 70, 8, 1, 3, 2, 2, 0, 0, 20, 25, 0,
&mdeath::normal, &mattack::none, "\
A horrifying child zombie, you feel\n\
a twinge of remorse looking at it."
);
FLAGS(MF_SEES, MF_HEARS, MF_SMELLS, MF_STUMBLES, MF_WARM, MF_BASHES, MF_POISON, MF_BLEED,
MF_HIT_AND_RUN, MF_GUILT);
FLAGS(MF_SEES, MF_HEARS, MF_SMELLS, MF_STUMBLES, MF_WARM, MF_BASHES, MF_BLEED,
MF_GUILT);
// PLANTS & FUNGI
+6 -1
View File
@@ -245,7 +245,12 @@ End of cheatery */
if (has_trait(PF_ASTHMA)) {
tmp = item(g->itypes[itm_inhaler], 0, 'a' + worn.size());
inv.push_back(tmp);
}
}
// Add starter gear, possibly tie this to profession setting later.
/* tmp = item(g->itypes[itm_pockknife], 0,'a' + worn.size());
inv.push_back(tmp);
tmp = item(g->itypes[itm_lighter], 0,'a' + worn.size());
inv.push_back(tmp); */
// make sure we have no mutations
for (int i = 0; i < PF_MAX2; i++)
my_mutations[i] = false;
+48 -8
View File
@@ -1,6 +1,7 @@
#include "options.h"
#include "output.h"
#include <stdlib.h>
#include <fstream>
#include <string>
@@ -45,8 +46,15 @@ void load_options()
else
OPTIONS[key] = 0.;
} else {
std::string check;
double val;
fin >> val;
fin >> check;
if (check == "T" || check == "F")
val = (check == "T") ? 1.: 0.;
else
val = atoi(check.c_str());
OPTIONS[key] = val;
}
}
@@ -72,8 +80,12 @@ option_key lookup_option_key(std::string id)
return OPT_SNAP_TO_TARGET;
if (id == "safemode")
return OPT_SAFEMODE;
if (id == "safemodeproximity")
return OPT_SAFEMODEPROXIMITY;
if (id == "autosafemode")
return OPT_AUTOSAFEMODE;
if (id == "autosafemodeturns")
return OPT_AUTOSAFEMODETURNS;
if (id == "autosave")
return OPT_AUTOSAVE;
if (id == "gradual_night_light")
@@ -92,6 +104,8 @@ option_key lookup_option_key(std::string id)
return OPT_VIEWPORT_X;
if (id == "viewport_y")
return OPT_VIEWPORT_Y;
if (id == "static_spawn")
return OPT_STATIC_SPAWN;
return OPT_NULL;
}
@@ -105,7 +119,9 @@ std::string option_string(option_key key)
case OPT_24_HOUR: return "24_hour";
case OPT_SNAP_TO_TARGET: return "snap_to_target";
case OPT_SAFEMODE: return "safemode";
case OPT_SAFEMODEPROXIMITY: return "safemodeproximity";
case OPT_AUTOSAFEMODE: return "autosafemode";
case OPT_AUTOSAFEMODETURNS: return "autosafemodeturns";
case OPT_AUTOSAVE: return "autosave";
case OPT_GRADUAL_NIGHT_LIGHT: return "gradual_night_light";
case OPT_QUERY_DISASSEMBLE: return "query_disassemble";
@@ -115,6 +131,7 @@ std::string option_string(option_key key)
case OPT_INITIAL_POINTS: return "initial_points";
case OPT_VIEWPORT_X: return "viewport_x";
case OPT_VIEWPORT_Y: return "viewport_y";
case OPT_STATIC_SPAWN: return "static_spawn";
default: return "unknown_option";
}
return "unknown_option";
@@ -127,10 +144,12 @@ std::string option_desc(option_key key)
case OPT_USE_METRIC_SYS: return "If true, use Km/h not mph";
case OPT_FORCE_YN: return "If true, y/n prompts are case-sensitive\nand y and n are not accepted";
case OPT_NO_CBLINK: return "If true, bright backgrounds are not\nused--some consoles are not compatible";
case OPT_24_HOUR: return "If true, use military time, not AM/PM";
case OPT_24_HOUR: return "12h/24h Time:\n0 - AM/PM\n1 - 24h military\n2 - 24h normal";
case OPT_SNAP_TO_TARGET: return "If true, automatically follow the\ncrosshair when firing/throwing";
case OPT_SAFEMODE: return "If true, safemode will be on after\nstarting a new game or loading";
case OPT_SAFEMODEPROXIMITY: return "If safemode is enabled,\ndistance to hostiles when safemode\nshould show a warning (0=Viewdistance)";
case OPT_AUTOSAFEMODE: return "If true, auto-safemode will be on\nafter starting a new game or loading";
case OPT_AUTOSAFEMODETURNS: return "Number of turns after safemode\nis reenabled if no hostiles are\nin safemodeproximity distance";
case OPT_AUTOSAVE: return "If true, game will periodically\nsave the map";
case OPT_GRADUAL_NIGHT_LIGHT: return "If true will add nice gradual-lighting\n(should only make a difference @night)";
case OPT_QUERY_DISASSEMBLE: return "If true, will query before disassembling\nitems";
@@ -140,6 +159,7 @@ std::string option_desc(option_key key)
case OPT_INITIAL_POINTS: return "Initial points available on character\ngeneration. Default is 6";
case OPT_VIEWPORT_X: return "Set the expansion of the viewport along\nthe X axis. Must restart for changes\nto take effect. Default is 12";
case OPT_VIEWPORT_Y: return "Set the expansion of the viewport along\nthe Y axis. Must restart for changes\nto take effect. Default is 12";
case OPT_STATIC_SPAWN: return "Spawn zombies at game start instead of\nduring game. Must delete save directory\nafter changing for it to take effect.\nDefault is 12";
default: return " ";
}
return "Big ol Bug";
@@ -155,7 +175,9 @@ std::string option_name(option_key key)
case OPT_24_HOUR: return "24 Hour Time";
case OPT_SNAP_TO_TARGET: return "Snap to Target";
case OPT_SAFEMODE: return "Safemode on by default";
case OPT_SAFEMODEPROXIMITY: return "Safemode proximity distance";
case OPT_AUTOSAFEMODE: return "Auto-Safemode on by default";
case OPT_AUTOSAFEMODETURNS: return "Turns to reenable safemode";
case OPT_AUTOSAVE: return "Periodically Autosave";
case OPT_GRADUAL_NIGHT_LIGHT: return "Gradual night light";
case OPT_QUERY_DISASSEMBLE: return "Query on disassembly";
@@ -165,6 +187,7 @@ std::string option_name(option_key key)
case OPT_INITIAL_POINTS: return "Initial points";
case OPT_VIEWPORT_X: return "Viewport width";
case OPT_VIEWPORT_Y: return "Viewport height";
case OPT_STATIC_SPAWN: return "Static spawn";
default: return "Unknown Option (BUG)";
}
return "Big ol Bug";
@@ -173,6 +196,9 @@ std::string option_name(option_key key)
bool option_is_bool(option_key id)
{
switch (id) {
case OPT_24_HOUR:
case OPT_SAFEMODEPROXIMITY:
case OPT_AUTOSAFEMODETURNS:
case OPT_SKILL_RUST:
case OPT_DROP_EMPTY:
case OPT_DELETE_WORLD:
@@ -195,6 +221,15 @@ char option_max_options(option_key id)
else
switch (id)
{
case OPT_24_HOUR:
ret = 3;
break;
case OPT_SAFEMODEPROXIMITY:
ret = 61;
break;
case OPT_AUTOSAFEMODETURNS:
ret = 51;
break;
case OPT_INITIAL_POINTS:
ret = 25;
break;
@@ -205,8 +240,8 @@ char option_max_options(option_key id)
break;
case OPT_VIEWPORT_X:
case OPT_VIEWPORT_Y:
ret = 61; // TODO Set up min/max values so weird numbers don't have to be used.
break;
ret = 61; // TODO Set up min/max values so weird numbers don't have to be used.
break;
default:
ret = 2;
break;
@@ -230,14 +265,18 @@ use_metric_system F\n\
force_capital_yn T\n\
# If true, bright backgrounds are not used--some consoles are not compatible\n\
no_bright_backgrounds F\n\
# If true, use military time, not AM/PM\n\
24_hour F\n\
# 12h/24h Time: 0 = AM/PM, 1 = 24h military, 2 = 24h normal\n\
24_hour 0\n\
# If true, automatically follow the crosshair when firing/throwing\n\
snap_to_target F\n\
# If true, safemode will be on after starting a new game or loading\n\
safemode T\n\
# If safemode is enabled, distance to hostiles when safemode should show a warning (0=Viewdistance)\n\
safemodeproximity 0\n\
# If true, auto-safemode will be on after starting a new game or loading\n\
autosafemode F\n\
# Number of turns after safemode is reenabled when no zombies are in safemodeproximity distance\n\
autosafemodeturns 50\n\
# If true, game will periodically save the map\n\
autosave F\n\
# If true will add nice gradual-lighting (should only make a difference @night)\n\
@@ -255,10 +294,11 @@ skill_rust 0\n\
delete_world 0\n\
# Initial points available in character generation\n\
initial_points 6\n\
# How far to expand the viewport's width in each direction.\n\
# The width of the terrain window in characters.\n\
viewport_x 12\n\
# Same as viewport_x, but in height.\n\
# The height of the terrain window, which is also the height of the main window, in characters.\n\
viewport_y 12\n\
# Spawn zombies at game start instead of during the game. You must create a new world after changing\n\
";
fout.close();
}
+7 -4
View File
@@ -12,16 +12,19 @@ OPT_NO_CBLINK, // No bright backgrounds
OPT_24_HOUR, // 24 hour time
OPT_SNAP_TO_TARGET, // game::firing snaps to target
OPT_SAFEMODE, // Safemode on by default?
OPT_SAFEMODEPROXIMITY, //Range after which safemode kicks in
OPT_AUTOSAFEMODE, // Autosafemode on by default?
OPT_AUTOSAFEMODETURNS, //Number of turns untill safemode kicks back in
OPT_AUTOSAVE, // Automatically save the game on intervals.
OPT_GRADUAL_NIGHT_LIGHT, // be so cool at night :)
OPT_QUERY_DISASSEMBLE, // Query before disassembling items
OPT_DROP_EMPTY, // auto drop empty containers after use
OPT_SKILL_RUST, // level of skill rust
OPT_DELETE_WORLD,
OPT_INITIAL_POINTS,
OPT_VIEWPORT_X,
OPT_VIEWPORT_Y,
OPT_DELETE_WORLD, // Delete workd every time New Character is created
OPT_INITIAL_POINTS, // Set the number of character points
OPT_VIEWPORT_X, // Set the width of the terrain window, in characters
OPT_VIEWPORT_Y, // Set the height of the terrain window, in characters
OPT_STATIC_SPAWN, // Makes zombies spawn using the new static system
NUM_OPTION_KEYS
};
+21 -64
View File
@@ -481,7 +481,7 @@ int menu_vec(const char *mes, std::vector<std::string> options)
if (options[i].length() + 6 > width)
width = options[i].length() + 6;
}
WINDOW* w = newwin(height, width, 1, 10);
WINDOW* w = newwin(height, width, 12-height/2, 40-width/2);
wattron(w, c_white);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
@@ -710,19 +710,27 @@ void full_screen_popup(const char* mes, ...)
refresh();
}
void compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare)
char compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare)
{
WINDOW* w = newwin(25, 40, 0, (bLeft) ? 0 : 40);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
mvwprintz(w, 1, 2, c_white, sItemName.c_str());
int line_num = 3;
int iStartX = 0;
std::string sPlus;
bool bStartNewLine = true;
for (int i = 0; i < vItemDisplay.size(); i++) {
if (vItemDisplay[i].sType == "DESCRIPTION") {
if (vItemDisplay[i].sType == "MENU") {
if (vItemDisplay[i].sPre == "iY") {
line_num += vItemDisplay[i].iValue;
} else if (vItemDisplay[i].sPre == "iX") {
iStartX = vItemDisplay[i].iValue;
} else {
mvwprintz(w, line_num, iStartX, c_ltgreen, "%s", (vItemDisplay[i].sName).c_str());
wprintz(w, c_white, "%s", (vItemDisplay[i].sPre).c_str());
line_num++;
}
} else if (vItemDisplay[i].sType == "DESCRIPTION") {
std::string sText = vItemDisplay[i].sName;
std::replace(sText.begin(), sText.end(), '\n', ' ');
int iPos;
@@ -793,72 +801,21 @@ void compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<i
}
}
wrefresh(w);
if (!bLeft)
{
char ch;
do
ch = getch();
while(ch != ' ' && ch != '\n' && ch != KEY_ESCAPE);
werase(w);
wrefresh(w);
delwin(w);
refresh();
}
/*
std::string tmp = buff;
WINDOW* w = newwin(25, 40, 0, (bLeft) ? 0 : 40);
wborder(w, LINE_XOXO, LINE_XOXO, LINE_OXOX, LINE_OXOX,
LINE_OXXO, LINE_OOXX, LINE_XXOO, LINE_XOOX );
size_t pos = tmp.find_first_of('\n');
mvwprintz(w, 1, 2, c_white, sItemName.c_str());
int line_num = 2;
while (pos != std::string::npos) {
std::string line = tmp.substr(0, pos);
line_num++;
if (line.size() > 36)
{
std::string sTemp;
do
{
sTemp += line;
tmp = tmp.substr(pos + 1);
pos = tmp.find_first_of('\n');
line = " " + tmp.substr(0, pos);
} while (pos != std::string::npos);
sTemp += line;
while (sTemp.size() > 0)
{
size_t iPos = sTemp.find_last_of(' ', 36);
if (iPos == 0)
iPos = sTemp.size();
mvwprintz(w, line_num, 2, c_white, (sTemp.substr(0, iPos)).c_str());
line_num++;
sTemp = sTemp.substr(iPos+1, sTemp.size());
}
}
else
{
mvwprintz(w, line_num, 2, c_white, (line).c_str());
}
tmp = tmp.substr(pos + 1);
pos = tmp.find_first_of('\n');
}
line_num++;
mvwprintz(w, line_num, 2, c_white, tmp.c_str());
char ch = ' ';
wrefresh(w);
if (!bLeft)
{
char ch;
do
ch = getch();
while(ch != ' ' && ch != '\n' && ch != KEY_ESCAPE);
if (!bLeft) {
ch = getch();
werase(w);
wrefresh(w);
delwin(w);
refresh();
}
*/
return ch;
}
char rand_char()
+1 -1
View File
@@ -51,7 +51,7 @@ void popup_top(const char *mes, ...); // Displayed at the top of the screen
void popup(const char *mes, ...);
void popup_nowait(const char *mes, ...); // Doesn't wait for spacebar
void full_screen_popup(const char *mes, ...);
void compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare);
char compare_split_screen_popup(bool bLeft, std::string sItemName, std::vector<iteminfo> vItemDisplay, std::vector<iteminfo> vItemCompare);
nc_color hilite(nc_color c);
nc_color invert_color(nc_color c);
+32 -18
View File
@@ -15,6 +15,7 @@
#include <ostream>
#include "debug.h"
#include "cursesdef.h"
#include "options.h"
#define STREETCHANCE 2
#define NUM_FOREST 250
@@ -615,7 +616,7 @@ void overmap::generate_sub(overmap* above)
else if (above->ter(i, j) == ot_shelter)
shelter_points.push_back( point(i, j) );
else if (above->ter(i, j) == ot_lmoe)
lmoe_points.push_back( point(i, j) );
@@ -907,7 +908,8 @@ void overmap::draw(WINDOW *w, game *g, int &cursx, int &cursy,
if (omx >= 0 && omx < OMAPX && omy >= 0 && omy < OMAPY) { // It's in-bounds
cur_ter = ter(omx, omy);
see = seen(omx, omy);
if (note_here = has_note(omx, omy))
note_here = has_note(omx, omy);
if (note_here)
note_text = note(omx, omy);
for (int n = 0; n < npcs.size(); n++) {
if ((npcs[n].mapx + 1) / 2 == omx && (npcs[n].mapy + 1) / 2 == omy) {
@@ -926,12 +928,14 @@ void overmap::draw(WINDOW *w, game *g, int &cursx, int &cursy,
omy += (omy < 0 ? OMAPY : 0 - OMAPY);
cur_ter = diag.ter(omx, omy);
see = diag.seen(omx, omy);
if ((note_here = diag.has_note(omx, omy)))
note_here = diag.has_note(omx, omy);
if (note_here)
note_text = diag.note(omx, omy);
} else {
cur_ter = hori.ter(omx, omy);
see = hori.seen(omx, omy);
if (note_here = hori.has_note(omx, omy))
note_here = hori.has_note(omx, omy);
if (note_here)
note_text = hori.note(omx, omy);
}
} else if (omx >= OMAPX) {
@@ -940,25 +944,29 @@ void overmap::draw(WINDOW *w, game *g, int &cursx, int &cursy,
omy += (omy < 0 ? OMAPY : 0 - OMAPY);
cur_ter = diag.ter(omx, omy);
see = diag.seen(omx, omy);
if (note_here = diag.has_note(omx, omy))
note_here = diag.has_note(omx, omy);
if (note_here)
note_text = diag.note(omx, omy);
} else {
cur_ter = hori.ter(omx, omy);
see = hori.seen(omx, omy);
if ((note_here = hori.has_note(omx, omy)))
note_here = hori.has_note(omx, omy);
if (note_here)
note_text = hori.note(omx, omy);
}
} else if (omy < 0) {
omy += OMAPY;
cur_ter = vert.ter(omx, omy);
see = vert.seen(omx, omy);
if ((note_here = vert.has_note(omx, omy)))
note_here = vert.has_note(omx, omy);
if (note_here)
note_text = vert.note(omx, omy);
} else if (omy >= OMAPY) {
omy -= OMAPY;
cur_ter = vert.ter(omx, omy);
see = vert.seen(omx, omy);
if ((note_here = vert.has_note(omx, omy)))
note_here = vert.has_note(omx, omy);
if (note_here)
note_text = vert.note(omx, omy);
} else
debugmsg("No data loaded! omx: %d omy: %d", omx, omy);
@@ -966,7 +974,10 @@ void overmap::draw(WINDOW *w, game *g, int &cursx, int &cursy,
if (see) {
if (note_here && blink) {
ter_color = c_yellow;
ter_sym = 'N';
if (note_text[1] == ':')
ter_sym = note_text[0];
else
ter_sym = 'N';
} else if (omx == origx && omy == origy && blink) {
ter_color = g->u.color();
ter_sym = '@';
@@ -1017,6 +1028,8 @@ void overmap::draw(WINDOW *w, game *g, int &cursx, int &cursy,
}
if (has_note(cursx, cursy)) {
note_text = note(cursx, cursy);
if (note_text[1] == ':')
note_text = note_text.substr(2, note_text.size());
for (int i = 0; i < note_text.length(); i++)
mvwputch(w, 1, i, c_white, LINE_OXOX);
mvwputch(w, 1, note_text.length(), c_white, LINE_XOOX);
@@ -1049,13 +1062,13 @@ void overmap::draw(WINDOW *w, game *g, int &cursx, int &cursy,
if (target.x != -1 && target.y != -1) {
int distance = rl_dist(origx, origy, target.x, target.y);
mvwprintz(w, 3, om_map_width, c_white, "Distance to target: %d", distance);
mvwprintz(w, 3, om_map_width + 1, c_white, "Distance to target: %d", distance);
}
mvwprintz(w, 17, om_map_width + 1, c_magenta, "Use movement keys to pan. ");
mvwprintz(w, 18, om_map_width + 1, c_magenta, "0 - Center map on character");
mvwprintz(w, 19, om_map_width + 1, c_magenta, "t - Toggle legend ");
mvwprintz(w, 20, om_map_width + 1, c_magenta, "/ - Search ");
mvwprintz(w, 21, om_map_width + 1, c_magenta, "N - Add a note ");
mvwprintz(w, 21, om_map_width + 1, c_magenta, "N - Add/Edit a note ");
mvwprintz(w, 22, om_map_width + 1, c_magenta, "D - Delete a note ");
mvwprintz(w, 23, om_map_width + 1, c_magenta, "L - List notes ");
mvwprintz(w, 24, om_map_width + 1, c_magenta, "Esc or q - Return to game ");
@@ -1095,7 +1108,7 @@ point overmap::choose_point(game *g)
ret = point(-1, -1);
else if (ch == 'N') {
timeout(-1);
add_note(cursx, cursy, string_input_popup("Enter note", 49)); // 49 char max
add_note(cursx, cursy, string_input_popup("Note (X:TEXT for custom symbol):", 49, note(cursx, cursy))); // 49 char max
timeout(BLINK_SPEED);
} else if(ch == 'D'){
timeout(-1);
@@ -2311,12 +2324,13 @@ void overmap::place_special(overmap_special special, point p)
void overmap::place_mongroups()
{
// Cities are full of zombies
for (int i = 0; i < cities.size(); i++) {
if (!one_in(16) || cities[i].s > 5)
zg.push_back(
mongroup(mcat_zombie, (cities[i].x * 2), (cities[i].y * 2),
int(cities[i].s * 2.5), cities[i].s * 80));
if (!OPTIONS[OPT_STATIC_SPAWN]) {
// Cities are full of zombies
for (unsigned int i = 0; i < cities.size(); i++) {
if (!one_in(16) || cities[i].s > 5)
zg.push_back (mongroup(mcat_zombie, (cities[i].x * 2), (cities[i].y * 2),
int(cities[i].s * 2.5), cities[i].s * 80));
}
}
// Figure out where swamps are, and place swamp monsters
+23 -19
View File
@@ -78,7 +78,7 @@ player::player()
}
for (int i = 0; i < num_bp; i++) {
temp_cur[i] = 500; ; frostbite_timer[i] = 0;
temp_cur[i] = BODYTEMP_NORM; ; frostbite_timer[i] = 0;
}
}
@@ -1564,7 +1564,7 @@ void player::disp_status(WINDOW *w, game *g)
mvwprintz(w, 2, 0, c_yellow, "Hungry");
else if (hunger < 0)
mvwprintz(w, 2, 0, c_green, "Full");
//Oddzball Temp in status
if (temp_cur[bp_torso] > BODYTEMP_SCORCHING)
mvwprintz(w, 1, 9, c_red, "Scorching!");
@@ -4298,25 +4298,29 @@ bool player::wear_item(game *g, item *to_wear)
bool player::takeoff(game *g, char let)
{
for (int i = 0; i < worn.size(); i++) {
if (worn[i].invlet == let) {
if (volume_capacity() - (dynamic_cast<it_armor*>(worn[i].type))->storage >
volume_carried() + worn[i].type->volume) {
inv.push_back(worn[i]);
worn.erase(worn.begin() + i);
inv_sorted = false;
return true;
} else if (query_yn("No room in inventory for your %s. Drop it?",
worn[i].tname(g).c_str())) {
g->m.add_item(posx, posy, worn[i]);
worn.erase(worn.begin() + i);
return true;
} else
return false;
if (weapon.invlet == let) {
return wield(g, -3);
} else {
for (int i = 0; i < worn.size(); i++) {
if (worn[i].invlet == let) {
if (volume_capacity() - (dynamic_cast<it_armor*>(worn[i].type))->storage >
volume_carried() + worn[i].type->volume) {
inv.push_back(worn[i]);
worn.erase(worn.begin() + i);
inv_sorted = false;
return true;
} else if (query_yn("No room in inventory for your %s. Drop it?",
worn[i].tname(g).c_str())) {
g->m.add_item(posx, posy, worn[i]);
worn.erase(worn.begin() + i);
return true;
} else
return false;
}
}
g->add_msg("You are not wearing that item.");
return false;
}
g->add_msg("You are not wearing that item.");
return false;
}
void player::use_wielded(game *g) {
+2 -2
View File
@@ -62,7 +62,7 @@ enum dis_type {
DI_ATTACK_BOOST, DI_DAMAGE_BOOST, DI_DODGE_BOOST, DI_ARMOR_BOOST,
DI_SPEED_BOOST, DI_VIPER_COMBO,
// Other
DI_AMIGARA, DI_TELEGLOW, DI_ATTENTION, DI_EVIL,
DI_AMIGARA, DI_STEMCELL_TREATMENT, DI_TELEGLOW, DI_ATTENTION, DI_EVIL,
// Inflicted by an NPC
DI_ASKED_TO_FOLLOW, DI_ASKED_TO_LEAD, DI_ASKED_FOR_ITEM,
// NPC-only
@@ -389,7 +389,7 @@ Your system is rather tolerant of poisons and toxins, and most will affect\n\
you less."},
{"Fast Reader", 1, 0, 0, "\
You're a quick reader, and can get through books a lot faster than most."},
{"Tough", 5, 0, 0, "\
{"Tough", 3, 0, 0, "\
It takes a lot to bring you down! You get a 20%% bonus to all hit points."},
{"Thick-Skinned", 2, 0, 0, "\
Your skin is tough. Cutting damage is slightly reduced for you."},
-6
View File
@@ -84,12 +84,6 @@ void game::fire(player &p, int tarx, int tary, std::vector<point> &trajectory,
// Bolts and arrows are silent
if (curammo->type == AT_BOLT || curammo->type == AT_ARROW)
is_bolt = true;
// TODO: Move this check to game::plfire
if ((weapon->has_flag(IF_STR8_DRAW) && p.str_cur < 4) ||
(weapon->has_flag(IF_STR10_DRAW) && p.str_cur < 5) ) {
add_msg("You're not strong enough to draw the bow!");
return;
}
int x = p.posx, y = p.posy;
// Have to use the gun, gunmods don't have a type
+4 -2
View File
@@ -32,9 +32,11 @@ int dice(int number, int sides)
// for world seeding.
int djb2_hash(unsigned char *str){
unsigned long hash = 5381;
int c;
while (c = *str++)
unsigned char c = *str++;
while (c != '\0'){
hash = ((hash << 5) + hash) + c; /* hash * 33 + c */
c = *str++;
}
return hash;
}
+35
View File
@@ -0,0 +1,35 @@
# Make any tests, and possibly run them.
# A selection of variables are exported from the master Makefile
# libtap.so and tap.h must be in the local directory or on the system path.
# ODIR is realative, so we can use the one from the main Makefile
# As each test will have a main function we need to handle this file by file
TEST_SOURCES = $(wildcard *_test.cpp)
TEST_OBJS = $(TEST_SOURCES:%.cpp=$(ODIR)/%.o)
TESTS = $(TEST_SOURCES:.cpp=)
# Brute force solution, relative paths to EVERY .o file
#SOURCE_OBJS = $(patsubst %,../$(ODIR)/%,$(filter-out main.o,$(_OBJS)))
SOURCE_OBJS = ../obj/line.o
LDFLAGS += -L. -ltap -lpthread
CXXFLAGS += -I..
tests: $(TESTS)
%_test: $(ODIR) $(DDIR) $(SOURCE_OBJS) $(TEST_OBJS)
$(CXX) $(W32FLAGS) -o $@ $(DEFINES) $(ODIR)/$@.o $(SOURCE_OBJS) $(LDFLAGS)
check: $(TESTS)
LD_LIBRARY_PATH=/usr/local/lib ./$?
$(ODIR):
mkdir $(ODIR)
$(DDIR):
@mkdir $(DDIR)
$(ODIR)/%.o: %.cpp
$(CXX) $(DEFINES) $(CXXFLAGS) -c $< -o $@
+15
View File
@@ -0,0 +1,15 @@
/* libtap doesn't extern C their headers, so we do it for them. */
extern "C" {
#include "tap.h"
}
#include "line.h"
int main(int argc, char *argv[])
{
plan_tests(1);
ok1(trig_dist(0, 0, 0, 0) == 0);
return exit_status();
}
+1
View File
@@ -23,6 +23,7 @@ enum trap_id {
tr_engine,
tr_blade,
tr_landmine,
tr_landmine_buried,
tr_telepad,
tr_goo,
tr_dissector,
+7 -2
View File
@@ -71,8 +71,13 @@ traps.push_back(new trap(id, sym, color, name, visibility, avoidance,\
&trapfunc::blade, &trapfuncm::blade,
NULL);
// Name Symbol Color Vis Avd Diff
TRAP("land mine", '_', c_red, 10, 14, 10,
// Name Symbol Color Vis Avd Diff
TRAP("land mine", '^', c_red, 1, 14, 10,
&trapfunc::landmine, &trapfuncm::landmine,
itm_landmine, NULL);
// Name Symbol Color Vis Avd Diff
TRAP("buried land mine", '_', c_red, 10, 14, 10,
&trapfunc::landmine, &trapfuncm::landmine,
itm_landmine, NULL);
+1 -1
View File
@@ -715,7 +715,7 @@ void trapfuncm::snake(game *g, monster *z, int x, int y)
bool trap::is_benign()
{
if (id == tr_rollmat || id == itm_cot)
if (id == tr_rollmat || id == tr_cot)
return true;
else
return false;
+59 -12
View File
@@ -264,8 +264,11 @@ const vpart_info& vehicle::part_info (int index)
return vpart_list[id];
}
// engines & solar panels all have power.
// engines consume, whilst panels provide.
int vehicle::part_power (int index){
if (!part_flag(index, vpf_engine))
if (!part_flag(index, vpf_engine) &&
!part_flag(index, vpf_solar_panel))
return 0; //not an engine.
if(parts[index].hp <= 0)
return 0; //broken.
@@ -1680,7 +1683,7 @@ void vehicle::refresh_insides ()
else
if (part_flag(pn, vpf_obstacle))
{ // found an obstacle, like board or windshield or door
if (parts[pn].inside || part_flag(pn, vpf_openable) && parts[pn].open)
if (parts[pn].inside || (part_flag(pn, vpf_openable) && parts[pn].open))
continue; // door and it's open -- can't cover
cover = true;
break;
@@ -1951,20 +1954,64 @@ bool vehicle::fire_turret_internal (int p, it_gun &gun, it_ammo &ammo, int charg
return true;
}
// a chance to stop skidding if moving in roughly the faced direction
void vehicle::possibly_recover_from_skid(){
if (last_turn > 13)
//turning on the initial skid is delayed, so move==face, initially. This filters out that case.
return;
rl_vec2d mv = move_vec();
rl_vec2d fv = face_vec();
float dot = mv.dot_product(fv);
//threshold of recovery is gaussianesque.
if (fabs(dot) * 100 > dice(9,20)){
g->add_msg("The %s recovers from its skid.", name.c_str());
skidding = false; //face_vec takes over.
velocity *= dot; //wheels absorb horizontal velocity.
if(dot < -.8){
//pointed backwards, velo-wise.
velocity *= -1; //move backwards.
}
move = face;
}
}
// if not skidding, move_vec == face_vec, mv <dot> fv == 1, velocity*1 is returned.
float vehicle::forward_velocity(){
rl_vec2d mv = move_vec();
rl_vec2d fv = face_vec();
float dot = mv.dot_product(fv);
return velocity * dot;
}
rl_vec2d vehicle::velo_vec(){
float vx,vy;
if(skidding){
vx = cos (move.dir() * M_PI/180);
vy = sin (move.dir() * M_PI/180);
} else {
vx = cos (face.dir() * M_PI/180);
vy = sin (face.dir() * M_PI/180);
}
rl_vec2d ret(vx,vy);
rl_vec2d ret;
if(skidding)
ret = move_vec();
else
ret = face_vec();
ret = ret.normalized();
ret = ret * velocity;
return ret;
}
//todO: face_vec()...
// normalized.
rl_vec2d vehicle::move_vec(){
float mx,my;
mx = cos (move.dir() * M_PI/180);
my = sin (move.dir() * M_PI/180);
rl_vec2d ret(mx,my);
ret = ret.normalized();
return ret;
}
// normalized.
rl_vec2d vehicle::face_vec(){
float fx,fy;
fx = cos (face.dir() * M_PI/180);
fy = sin (face.dir() * M_PI/180);
rl_vec2d ret(fx,fy);
ret = ret.normalized();
return ret;
}
+9
View File
@@ -298,6 +298,12 @@ public:
// thrust (1) or brake (-1) vehicle
void thrust (int thd);
// depending on skid vectors, chance to recover.
void possibly_recover_from_skid();
//forward component of velocity.
float forward_velocity();
// cruise control
void cruise_thrust (int amount);
@@ -362,6 +368,9 @@ public:
// return a vector w/ 'direction' & 'magnitude', in its own sense of the words.
rl_vec2d velo_vec();
//normalized vectors, from tilerays face & move
rl_vec2d face_vec();
rl_vec2d move_vec();
// config values
std::string name; // vehicle name
+11 -9
View File
@@ -1,16 +1,18 @@
#ifndef _WEATHER_H_
#define _WEATHER_H_
#define BODYTEMP_FREEZING 50
#define BODYTEMP_VERY_COLD 200
#define BODYTEMP_COLD 300
#define BODYTEMP_NORM 500
#define BODYTEMP_HOT 650
#define BODYTEMP_VERY_HOT 800
#define BODYTEMP_SCORCHING 950
#define BODYTEMP_FREEZING 500
#define BODYTEMP_VERY_COLD 2000 // This value means frostbite occurs at the warmest temperature of 1C. If changed, the temp_conv calculation should be reexamined.
#define BODYTEMP_COLD 3500
#define BODYTEMP_NORM 5000 // Do not change this value, it is an arbitrary anchor on which other calculations are made.
#define BODYTEMP_HOT 6500
#define BODYTEMP_VERY_HOT 8000
#define BODYTEMP_SCORCHING 9500
/*
Bodytemp is measured on a scale of 0u to 1000u, where 1u = 0.02C and 500u is 37C
Outdoor temperature uses simliar numbers, but on a different scale: 220u = 22C, where 1u = 0.1C.
Bodytemp is measured on a scale of 0u to 10000u, where 10u = 0.02C and 5000u is 37C
Outdoor temperature uses simliar numbers, but on a different scale: 2200u = 22C, where 10u = 0.1C.
Most values can be changed with no impact on calculations. Because of caluclations done in disease.cpp,
maximum heat cannot pass 15000u, otherwise the player will vomit to death.
*/
#include "color.h"