Commit graph

208 commits

Author SHA1 Message Date
Kp 829e95b6f8 Separate hoard/proximity tracking 2017-03-18 18:07:36 +00:00
Kp f03fee7eca Fix ordering of boss weapon collision test
Reported-by: ryusei117 <https://github.com/dxx-rebirth/dxx-rebirth/issues/332>
Fixes: 1f929796c3 ("Fix excess fusion reflection")
2017-03-04 22:25:54 +00:00
Kp 673baa15e9 Clear FakingInvul when enabling real invulnerability 2017-02-26 00:00:01 +00:00
Kp 08e4a6e620 Use stdint constants for some INT*_MAX
clang becomes confused trying to determine which vm_distance_squared
constructor to use for a literal input of 0x7fffffffffffffff, even
though the size of the input requires it to be `long` and only one
constructor can take a `long`.  Switch from an explicit
0x7fffffffffffffff to the symbolic constant INT64_MAX, which has the
same value, but a platform-appropriate suffix to force the compiler to
pick the right type.

For general clarity, switch some other instances of integer maximum
literals to symbolic constants of the same value.

This commit has no effect on the generated code (except for changes to
line numbers).

Reported-by: kreatordxx <https://github.com/dxx-rebirth/dxx-rebirth/pull/324>
Fixes: 17208cca79 ("Disallow int for vm_distance_squared")
2017-02-22 03:05:43 +00:00
zico b36c6f20c7 Made scrape_player_on_wall() based on a timer. Due to the player being pushed away from the lava/water surface in every frame in a random vector (wrong, too), player movement per frame was not enough to counter this on FPS rates > ~120 which made damage scaling per frame nonsensical in these situations. Instead, execute scrape results in intevals based on DESIGNATED_GAME_FRAMETIME (or per frame if FrameTime>DESIGNATED_GAME_FRAMETIME) which fixes the issues and generally works much better for the purpose of this function. 2017-02-13 11:00:21 +01:00
Kp 98c9374a12 Simplify powerup_grab_cheat_all path
Movement handling has an ugly hack that tries to grab powerups near the
console player, but it reuses general collision handling and fails to
check whether the player is alive.

Add a liveness check.  Place the check so that it happens once, before
the objects are scanned, rather than being needlessly repeated for every
object.

Refactor the collision code to let the movement hack skip the parts it
does not need.

Reported-by: ryusei117 <https://github.com/dxx-rebirth/dxx-rebirth/issues/302#issuecomment-275816259>
2017-02-04 23:10:29 +00:00
Kp 6d3fb34268 Abstract out last_hitobj management 2017-01-15 00:03:13 +00:00
Chris Taylor 4cc801f42f Remove calls to window_close(Game_wind) when game finished or over
Replace calls to window_close(Game_wind) with returning window_event_result::close to game handler. Applies to when DoEndGame() is called, DoGameOver() is called, aborting in the kmatrix screen (multiplayer game) during AdvanceLevel() and playing one demo frame causes playback to stop in GameProcessFrame(). Closing a window within its handler is problematic - it can result in an unstable state.
2017-01-08 21:08:50 +08:00
Kp 515476f02b Propagate constant third parameter of call_object_create_egg 2016-12-05 00:26:11 +00:00
zico ffb68756e3 Changed handling of scrape_player_on_wall(), preventing it to occur multiple times per frame. 2016-12-02 13:37:08 +01:00
Kp 495bf624d2 Shorten collide_weapon_and_controlcen hitobj test 2016-11-19 17:24:54 +00:00
Kp 1f929796c3 Fix excess fusion reflection 2016-11-19 17:24:53 +00:00
Kp 8c4d24ea6f Shorten collide_robot_and_weapon hitobj test 2016-11-19 17:24:53 +00:00
Kp 33bba1fa61 Map boss-gated robots across players 2016-10-29 23:16:16 +00:00
Kp 2b9a86abe3 Factor out buddy hints about invulnerable boss 2016-10-29 23:16:16 +00:00
Kp 25f5fc231a Pass player_info to add_points_to_score 2016-10-15 00:53:19 +00:00
Kp 31d2b5cfb2 Use correct get_*_id function for collide_robot_and_weapon 2016-10-07 02:08:56 +00:00
Kp 815a26f32d Expand and cache various uses of get_local_plrobj() 2016-10-02 00:34:48 +00:00
Kp 1dcacefc9c Pass player object to check_trigger 2016-10-02 00:34:47 +00:00
Kp 038a6e3261 Pass player powerup_flags to wall_hit_process 2016-10-02 00:34:46 +00:00
Kp a62cc369ab Expand get_local_player_shields
It was a convenient transition macro, but its presence was always
intended to be temporary.  Expand it to ease the conversion of usage
sites that already have access to local player data through a local
variable.
2016-10-02 00:34:40 +00:00
Kp ce65735c04 Expand get_local_player_flags
It was a convenient transition macro, but its presence was always
intended to be temporary.  Expand it to ease the conversion of usage
sites that already have access to local player data through a local
variable.
2016-10-02 00:34:40 +00:00
Kp 6a3ded191f Move EDITOR to dxxsconf.h; rename to DXX_USE_EDITOR
Rename symbol EDITOR to DXX_USE_EDITOR to show that it is a DXX
symbol, not one inherited from a library.  Move it to dxxsconf.h to
shorten the command line.

This is a mostly automated transform, but the changes to SConstruct were
manual.

git grep -wl EDITOR -- '*.h' '*.cpp' | xargs sed -i -e 's/^\s*#ifdef \(EDITOR\)\>/#if DXX_USE_\1/' -e 's/\s*#\(el\)\?if \(.*\)defined(\(EDITOR\))/#\1if \2DXX_USE_\3/' -e 's/^\s*#ifndef \(EDITOR\)\>/#if !DXX_USE_\1/'
2016-09-11 18:49:16 +00:00
Kp c484c55153 Expand get_local_player_invulnerable_time
It was a convenient transition macro, but its presence was always
intended to be temporary.  Expand it to ease the conversion of usage
sites that already have access to local player data through a local
variable.
2016-08-28 22:41:49 +00:00
Kp 8248438ffa Move Omega_charge to player_info 2016-08-28 22:41:47 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp ea65c74ba9 Move last_player_bump into player_info.Last_bumped_local_player 2016-07-25 03:48:08 +00:00
Kp f671e6781d Narrow scope of random vectors 2016-07-24 04:04:25 +00:00
Kp 99bbd0cf26 Mark global constants as constexpr
s/^const \([^*]*=.*;\)/constexpr \1/
2016-07-23 04:10:42 +00:00
Kp a1f67167ce Use static_cast for check_effect_blowup 2016-07-06 01:54:25 +00:00
Kp 15f2471be0 Cache reference to local player shields 2016-07-03 00:54:16 +00:00
Kp 96b258e958 Cache reference to local player flags 2016-07-03 00:54:15 +00:00
Kp 5b437592b0 Simplify test for vulcan|gauss 2016-06-12 03:45:36 +00:00
zico 416ea963c8 When building D2X, before dropping Vulcan ammo check for presence of Gauss cannon, too. 2016-06-06 15:43:38 +02:00
Kp ae7e808a24 Factor out apply_force_damage calls to apply_damage_to_robot 2016-04-23 17:59:47 +00:00
Kp 5f51e4d683 Fix ordering of collide_player_and_controlcen arguments 2016-04-23 17:59:47 +00:00
Kp 3677e7036e Pass object &to collide_player_and_powerup 2016-04-23 17:59:47 +00:00
Kp b3d40ff5c4 Pass object_base &to drop_missile_1_or_4 2016-04-23 17:59:47 +00:00
Kp 4153c65f57 Pass object_base &to maybe_drop_primary_weapon_egg 2016-04-23 17:59:47 +00:00
Kp 5682d9f7d7 Simplify boss weapon matter test 2016-04-23 17:59:47 +00:00
Kp a6ad28c255 Pass object_base &to do_boss_weapon_collision 2016-04-23 17:59:47 +00:00
Kp e2fce58d6d Pass object_base &to collide_robot_and_controlcen 2016-04-23 17:59:47 +00:00
Kp 2fb0e77028 Simplify collide_robot_and_controlcen
Caller collide_two_objects swaps the inputs to ensure A.type <= B.type.
OBJ_ROBOT = 2, OBJ_CNTRLCEN = 9, so A will always be the robot and B
will always be the controlcen.  Rename the parameters accordingly.  Add
assert statements to check this.
2016-04-23 17:59:47 +00:00
Kp 34d2c5b8e2 Pass object_base &to collide_weapon_and_clutter 2016-04-23 17:59:47 +00:00
Kp a1dac4c254 Pass object_base &to collide_player_and_marker 2016-04-23 17:59:47 +00:00
Kp a152ef009b Pass object_base &to maybe_kill_weapon 2016-04-23 17:59:47 +00:00
Kp 7ea89fda9f Pass object_base &to bump_one_object 2016-04-23 17:59:47 +00:00
Kp 835a9f33d9 Pass object &to collide_robot_and_wall 2016-04-23 17:59:47 +00:00
Kp 3828b8ec96 Simplify bump_two_objects conditional 2016-04-06 03:34:14 +00:00
Kp 0c299248d4 Pass object &to apply_damage_to_player 2016-04-06 03:34:14 +00:00