Commit graph

861 commits

Author SHA1 Message Date
Kp d4e8a92932 Apply SoundFx control to in-game movies
lukeman3000 asked how to control the volume of the in-game movies.
Prior to this commit, there was no in-game solution to this.  This
change scales movie audio by the SoundFx slider.

Thanks to lukeman3000 for inspiring this change.  Thanks to Ryusei117
for explaining what videos needed to be affected, and for testing an
earlier iteration of the change.

Requested-by: lukeman3000 <https://forum.dxx-rebirth.com/showthread.php?tid=986>
2017-10-01 20:31:34 +00:00
Kp f60c783ef5 Move marker preservation into object lifeleft update 2017-09-30 18:00:15 +00:00
Kp d7e97ca299 Remove write-only Escort_kill_object
Parallax never implemented Escort_kill_object because it was considered
too much work.  Remove the write-only vestiges of that feature.
2017-09-26 04:15:50 +00:00
Kp a24490033f Allow players to remove thief at level start
Commit f4b21088a0 ("Track vulcan ammo explicitly") fixed an original
retail bug that prevented the thief from stealing energy weapons,
because the thief could only steal weapons for which the player had ammo
and energy weapons never have ammo.  This went unremarked for several
years, until a recent report of the new semantics as a game-breaking
regression because the thief is now "ridiculously potent".

Address this report, as well as an intermittently raised issue from
various users over time, by adding two new knobs to both the single
player "Gameplay" menu and the multiplayer setup screen: "Remove Thief
at level start" and "Prevent Thief Stealing Energy Weapons".

"Remove Thief" deletes the thief object during level load.  It has no
impact on save games, and changing it after entering a level has no
effect on any thief already in the level.

"Prevent Thief Stealing" is checked at the moment of theft and, when
enabled, prevents stealing primary weapons other than Vulcan/Gauss.
This can be changed at will in single player and is immediately
effective.  In multiplayer, this option can only be changed by the game
host in the pre-game setup.

For both knobs, there is one pair of checkboxes to control this as a
player preference, which applies in single player games.  There is a
second pair of checkboxes in the multiplayer setup, which applies only
to multiplayer games.  Therefore, in multiplayer, the host chooses thief
settings and all clients use the host's choice.  The host may configure
the thief differently in multiplayer from how the host plays in single
player.

For users who wanted to remove the thief, no specific tally has been
kept for who requested it or when.  Now that the code is being updated,
this is thrown in as an easy addition.

Reported-by: MegaDescent <http://forum.dxx-rebirth.com/showthread.php?tid=980> (for the thief stealing energy weapons as a game-breaking regression)
2017-08-26 19:47:52 +00:00
Kp 4ea9ef5b0c Use reference for robot_info 2017-08-26 19:47:51 +00:00
Kp aa56477742 Propagate objects_in arguments 2017-08-13 20:38:31 +00:00
Kp 8c350ed5a5 Split drop_powerup path for dropping robots 2017-08-11 23:43:53 +00:00
Kp 92d6234c6f Factor out thief steal sound 2017-08-06 17:25:46 +00:00
Kp 0a08c4fa06 Simplify thief primary weapon steal logic 2017-08-06 17:25:46 +00:00
Kp 7b12619c3a Unify resource file compilation 2017-08-02 02:49:12 +00:00
Kp 73d92bb509 Make wclip::num_frames uint16_t 2017-06-17 23:05:16 +00:00
Kp 7b16571cb2 Rename countarray method count -> size 2017-06-10 03:31:03 +00:00
Kp 430f7832aa Move valptridx factories into array_managed_type 2017-06-10 03:31:03 +00:00
Kp 599ac9dee0 Always qualify valptridx type/factory
Previously, valptridx used PREFIX for allow-invalid+mutable, c#PREFIX
for allow-invalid+const, v#PREFIX for require-valid+mutable, vc#PREFIX
for require-valid+const.  Convert the types, factories, and all usage
sites to specify a qualifier for all four combinations:

	im#PREFIX -> allow-invalid+mutable
	ic#PREFIX -> allow-invalid+const
	vm#PREFIX -> require-valid+mutable
	vc#PREFIX -> require-valid+const

Changes to common/include/valptridx.h and common/include/fwd-valptridx.h
are manual.  All other changes are generated by:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\(v\?\)\(\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/\1m\2/g'

for the 'm' prefix and:

	git grep -lz -e '\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\>' | xargs -0 sed -i -e 's/\<\([cm]\(obj\|seg\|clwall\|wall\|actdoor\|trg\)\(ptridx\|ptr\|idx\)\(_t\)\?\)\>/i&/g'

for the 'i' prefix.
2017-06-10 03:31:02 +00:00
Kp 170d0ac777 Pass canvas &to nm_draw_background 2017-04-08 16:48:20 +00:00
Kp d5ed019014 Add experimental MP-aware mouselook 2017-03-25 19:34:02 +00:00
Kp 829e95b6f8 Separate hoard/proximity tracking 2017-03-18 18:07:36 +00:00
Kp 34b603ad71 Expand bomb spin variance
Let D1 proximity bombs spin.  Let D2 smart mines and pre-placed mines
spin.
2017-03-11 19:56:26 +00:00
Kp f080508d6c Cache canvas in movie.cpp 2017-03-10 01:22:25 +00:00
Kp ba914fea81 Pass up various return values 2017-02-26 00:00:02 +00:00
Kp 9dbc7c5cfe Pass up return value of ok_for_buddy_to_talk 2017-02-26 00:00:02 +00:00
Kp c14002f10a Pass up return value of maybe_steal_primary_weapon 2017-02-26 00:00:02 +00:00
Kp 06e6a800db Pass up return value of maybe_steal_secondary_weapon 2017-02-26 00:00:01 +00:00
Kp c7d53e9401 Pass up return value of maybe_steal_flag_item 2017-02-26 00:00:01 +00:00
Kp 6cd6189681 Never pass nullptr to ai_door_is_openable
When objp is nullptr, ai_door_is_openable assumes Buddy_objnum is a
valid object number, but this assumption is not guaranteed to be true.
When it is false, the game crashes.  This crash can be triggered by a
brain robot trying to make nearby robots snipe.

Fix the crash by passing the robot of interest.

Reported-by: Yarn <http://www.dxx-rebirth.com/frm/index.php/topic,2165.0.html>
2017-02-19 19:33:45 +00:00
Kp 6b8f08142f Pass canvas to LINE_SPACING
Macro LINE_SPACING previously used global grd_curcanv implicitly.
Change it to take a canvas argument.  Change all callers to pass
grd_curcanv, so that usage is explicit.
2017-02-11 21:42:42 +00:00
Kp 6f81d13c41 Pass canvas to gr_set_curfont 2017-02-11 21:42:38 +00:00
Kp b2b19446de Cache canvas in show_escort_menu 2017-02-11 21:42:37 +00:00
Kp f8b057d43d Pass canvas to gr_bm_ubitbltm 2017-02-11 21:42:32 +00:00
Kp ae33aaafc1 Pass canvas to gr_set_fontcolor 2017-02-11 21:42:32 +00:00
Kp 9c330da29f Prevent guidebot crash on unattainable goal
Yarn reported that Descent 2: Counterstrike level 9 can place the
guidebot in a situation where

    (Escort_goal_index == object_guidebot_cannot_reach &&
    Escort_special_goal != ESCORT_GOAL_UNSPECIFIED)

If this happens and the player grabs a powerup, then the game crashes
trying to check if the grabbed powerup was of the type that the guidebot
sought.  Since the guidebot was not seeking any object, the answer is
that this is not the sought object.

The design ought not set Escort_goal_index to an invalid object index,
but it does.  Fixing that is too invasive for now.  Add a special case
to prevent this crash.

Reported-by: Yarn <http://www.dxx-rebirth.com/frm/index.php/topic,2158.0.html>
2017-01-29 18:54:52 +00:00
Chris Taylor 30b5ef7c73 Create robot_create function and use it 4x
Contains 2 calls - to obj_create and init_ai_object. For safety reasons and tidiness compared to using obj_create directly. The call to init_ai_object in recreate_thief was already redundant.
2017-01-22 17:56:50 +08:00
Kp 764d20d4e1 Make grs_bitmap::bm_flags private 2017-01-15 00:03:13 +00:00
Kp 5da784dbed Pass canvas to gr_{,u}string 2017-01-08 22:32:00 +00:00
Kp 1ef6b9d5bc Pass font to gr_get_string_size 2017-01-08 22:31:59 +00:00
Kp 0905aefa0a Pass canvas to gr_rect 2017-01-01 00:45:45 +00:00
Kp b3809266a3 Use enumerate in more loops 2016-12-11 01:56:44 +00:00
Kp 2f179b1f48 Simplify compute_average_pixel loop 2016-12-11 01:56:44 +00:00
Kp f3ebdca557 Return segidx from escort_get_goal_segment 2016-12-05 00:26:10 +00:00
zico ad5a5047d4 Improved handling for Guidebot goals that are not objects: Set object_none to Escort_goal_index for ESCORT_GOAL_EXIT, ESCORT_GOAL_ENERGYCEN and ESCORT_GOAL_SCRAM. Changed handling for ESCORT_GOAL_EXIT to work like ESCORT_GOALFUELCEN (without needing Escort_goal_index). Let detect_escort_goal_accomplished() bail if Escort_goal_index == object_none (replacing case ahndling for ESCORT_GOAL_SCRAM). Minor formatting improvements of detect_escort_goal_accomplished() and removal of stub case of ESCORT_GOAL_FUELCEN. 2016-11-29 19:30:16 +01:00
Kp f4b7b958cb Revert "Fold escort_set_goal_object calls to exists_in_mine"
This reverts commit 03b0222896.

Commit 03b0222 caused the guidebot to skip over later key goals if an
earlier key goal was unnecessary.  This is incorrect.  Revert it.

Reported-by: Mako88 <https://github.com/dxx-rebirth/dxx-rebirth/issues/271>
2016-11-21 01:57:08 +00:00
Kp dc881ec12d Merge pull #266 into master 2016-11-19 18:09:26 +00:00
Kp 223a9dfd56 Pass grs_bitmap &to piggy_register_bitmap 2016-11-19 17:24:53 +00:00
Chris Taylor cc3f35649f Change all occurrences of "Couldn't" to "Could not" for consistency ("Could not" is more common and wins).
Not touching TXT_COULDNT because it's stored separately in hog file.
2016-11-13 13:27:18 +08:00
Chris Taylor 143ed30fee Merging in unification/master, resolving conflict in similar/main/kmatrix.cpp 2016-11-06 14:20:18 +08:00
Kp 99114e643b Move escort_menu_handler into escort_menu 2016-10-29 23:16:15 +00:00
Chris Taylor 7ac820248c Use new event_process_all() for event loops that check for window_event_result::deleted (which is most of them) 2016-10-29 20:06:01 +08:00
Chris Taylor abd6d4a052 Check for window_event_result::deleted for RunMovie polling loop
This is instead of using window_exists, which could give a false positive if a new window was allocated with the same pointer value as a deleted one.
2016-10-28 15:37:38 +08:00
Kp b787a641e1 Pass player_info to escort_create_path_to_goal 2016-10-28 03:39:41 +00:00
Kp b362d67d84 Fold bm_load_sub call to gr_remap_bitmap_good 2016-10-28 03:39:40 +00:00