Commit graph

183 commits

Author SHA1 Message Date
Kp 59bad96d5f Add back homing weapons cheat for D2
Kreator proposed restoring the Descent 2 cheat that grants homing
capability to all weapons.  This commit implements that proposition,
with some changes to the implementation details.

Based-on-patch-by: Chris Taylor <chris@icculus.org>
Requested-by: Chris Taylor <https://github.com/dxx-rebirth/dxx-rebirth/pull/318>
2017-01-29 21:02:48 +00:00
Chris Taylor 000ba37b42 Fix typo with cheat - should be 'ORALGROOVE' not 'ALGROOVE'
No noticeable effect in game, except that just typing 'ALGROOVE' will activate the cheat, which is different to original.
2017-01-29 15:19:02 +08:00
Chris Taylor 2ecc4c4a07 Remove call to window_close(Game_wind) when stopping demo playback
Replace call to window_close(Game_wind) with returning window_event_result::close to game_handler. Applies to whenever newdemo_stop_playback() is called. Closing a window within its handler is problematic - it can result in an unstable state.
2017-01-09 19:09:34 +08:00
kreatordxx f590ec45c6 Merge pull request #298 from dxx-rebirth/no_game_wind_close
Remove calls to window_close(Game_wind)
2017-01-09 09:32:24 +08:00
Kp 5da784dbed Pass canvas to gr_{,u}string 2017-01-08 22:32:00 +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 2c7e36ef1e Cache KEY_M vsegptridx 2017-01-01 00:45:45 +00:00
zico 24bd4170f4 Added debug key combo DEL+M to generate a morphing robot in the player segment, rotating through all available bots. Handy for testing purposes. 2016-12-30 14:45:47 +01:00
Kp 2ba300be8c Remove bogus demo messages
Demos do not record difficulty level or track hostages correctly.  Do
not show these fields in the demo pause dialog, since they reflect
the state of the player's last played game, not the state of the player
recording the demo.
2016-12-22 05:21:16 +00:00
Kp 442af298cb Pass player_info to allowed_to_fire_missile 2016-12-10 17:51:10 +00:00
Kp 7e6c9fb172 Pass player_info to allowed_to_fire_flare 2016-12-10 17:51:10 +00:00
Kp f8cc32a4af Merge pull #272 into master 2016-11-26 22:51:49 +00:00
Kp 48ac006c59 Remove obsolete and broken DOOR_DEBUGGING code
This code has been #ifdef'd out since 2002, relied on implicit-int in
its declaration (deprecated in C, forbidden in C++), and has been broken
for years due to vms_vector changes.  Remove it.
2016-11-26 22:51:46 +00:00
Chris Taylor bf6eb99d7a When switching to the editor in a game, use a proper saved game
This preserves virtually all game information, including active fire. The saved game 'gamesave.sge' can also be loaded with File->Restore Game State. The level can still be saved as usual (but it warns the user if there's an unsaved game state). This functionality may be useful for testing (or cheating! ;) )
2016-11-21 15:22:11 +08:00
Kp 4497812674 Use enum for object type 2016-11-20 23:12:00 +00:00
Chris Taylor cf0065da34 More efficiently check if editor loaded properly from within a game 2016-11-13 13:34:13 +08:00
Chris Taylor ac438f4cc2 Allow the user to carry on as usual if any of the editor files are missing (i.e. before editor was loaded).
If a game was playing, continue playing. If it was in the main menu, return to the main menu. (If all files are put in place the editor can load again.)
2016-11-11 16:09:57 +08:00
Chris Taylor 143ed30fee Merging in unification/master, resolving conflict in similar/main/kmatrix.cpp 2016-11-06 14:20:18 +08:00
Chris Taylor 9511f65a90 Declare some local window_event_result vars later (clarity) 2016-10-31 14:58:34 +08:00
Kp 8a2e15e20a Add message for when user disables full map cheat 2016-10-29 23:16:18 +00:00
Kp df8f93d63e Cache player object in FinalCheats 2016-10-28 03:39:41 +00:00
Kp c8dda073ca Pass player object to transfer_energy_to_shield 2016-10-28 03:39:41 +00:00
Chris Taylor 2d587de8dc Make call_default_handler return a window_event_result
Make call_default_handler return a window_event_result to inform the event system in future, particularly if a window was closed.
2016-10-27 16:36:24 +08:00
Kp 01f2932824 Pass grs_canvas &to window_create 2016-10-15 00:53:20 +00:00
Kp f21abc94cb Move player::hostages_on_board to player_info 2016-10-15 00:53:19 +00:00
Kp ecb91955ae Move player::score to player_info 2016-10-15 00:53:19 +00:00
Chris Taylor 60ac1eaad3 Replace delete dcx::window kludge with a better solution
Replace delete dcx::window kludge with a better solution: instead of requiring every handler to delete the window, add a window_event_result::deleted, which gets returned if the window was deleted by the handler, so window_close knows not to attempt to delete it again.
2016-10-04 14:05:44 +08:00
kreatordxx b87fcad332 Merge pull request #230 from dxx-rebirth/allow_window_subclasses_2
Allow window subclasses
2016-10-03 10:36:26 +08:00
Kp ec19a6947f Move more symbols to namespace dsx 2016-10-02 19:35:34 +00:00
Chris Taylor 87617e8ac9 Allow dcx::window struct to be subclassed - step 3
Allow dcx::window struct to be subclassed step 3. This step adds the window destructor and both requires and implements the window to be deleted by the event handler/client in all cases.
2016-10-02 17:49:19 +08:00
Kp 603159ec4b Pass secondary_weapon_index_t to do_secondary_weapon_select 2016-10-02 00:34:49 +00:00
Kp 3f27b6daac Pass player_info to CyclePrimary 2016-10-02 00:34:46 +00:00
Kp 2c37514235 Pass player_info to CycleSecondary 2016-10-02 00:34:46 +00:00
Kp e3c3e39045 Pass player_info to do_primary_weapon_select 2016-10-02 00:34:46 +00:00
Kp 86a4942883 Pass player_info to do_secondary_weapon_select 2016-10-02 00:34:45 +00:00
Kp 96651095e3 Pass player_info to DropCurrentWeapon, DropSecondaryWeapon 2016-10-02 00:34:44 +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 fe99fe232b Expand get_local_player_vulcan_ammo
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 1b321ac0c6 Expand get_local_player_secondary_ammo
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 b422db5500 Expand get_local_player_cloak_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-10-02 00:34:39 +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 4864f533cf Pass object_base &to fly_init 2016-09-11 18:49:13 +00:00
Kp 198b068da6 Expand get_local_player_energy
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-09-11 18:49:13 +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 b7a5f65d5b Move Secondary_weapon to player_info 2016-08-28 22:41:48 +00:00
Kp e7b881e5e6 Move Secondary_last_was_super into player_info 2016-08-28 22:41:48 +00:00
Kp ee1003f29f Move conditionally compiled code into namespace dsx 2016-08-25 04:05:32 +00:00
Kp c636dc4b98 Convert various static const expressions to constexpr 2016-07-16 16:52:04 +00:00
Kp 3272caed7d Cache reference to local player energy 2016-07-03 00:54:16 +00:00