2006-03-20 16:43:15 +00:00
/*
2014-06-01 17:55:23 +00:00
* Portions of this file are copyright Rebirth contributors and licensed as
* described in COPYING . txt .
* Portions of this file are copyright Parallax Software and licensed
* according to the Parallax license below .
* See COPYING . txt for license details .
2006-03-20 16:43:15 +00:00
THE COMPUTER CODE CONTAINED HEREIN IS THE SOLE PROPERTY OF PARALLAX
SOFTWARE CORPORATION ( " PARALLAX " ) . PARALLAX , IN DISTRIBUTING THE CODE TO
END - USERS , AND SUBJECT TO ALL OF THE TERMS AND CONDITIONS HEREIN , GRANTS A
ROYALTY - FREE , PERPETUAL LICENSE TO SUCH END - USERS FOR USE BY SUCH END - USERS
IN USING , DISPLAYING , AND CREATING DERIVATIVE WORKS THEREOF , SO LONG AS
SUCH USE , DISPLAY OR CREATION IS FOR NON - COMMERCIAL , ROYALTY OR REVENUE
FREE PURPOSES . IN NO EVENT SHALL THE END - USER USE THE COMPUTER CODE
CONTAINED HEREIN FOR REVENUE - BEARING PURPOSES . THE END - USER UNDERSTANDS
2013-02-24 02:39:48 +00:00
AND AGREES TO THE TERMS HEREIN AND ACCEPTS THE SAME BY USE OF THIS FILE .
2013-03-03 01:03:33 +00:00
COPYRIGHT 1993 - 1999 PARALLAX SOFTWARE CORPORATION . ALL RIGHTS RESERVED .
2006-03-20 16:43:15 +00:00
*/
2008-04-06 20:23:28 +00:00
2006-03-20 16:43:15 +00:00
/*
*
2008-04-06 20:23:28 +00:00
* Header for playsave . c
2006-03-20 16:43:15 +00:00
*
*/
2015-01-12 00:26:02 +00:00
# pragma once
2006-03-20 16:43:15 +00:00
2015-09-26 21:17:12 +00:00
# if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_I)
# include "pstypes.h"
2008-04-24 14:27:54 +00:00
# include "player.h"
2013-03-03 01:03:33 +00:00
# elif defined(DXX_BUILD_DESCENT_II)
# include "escort.h"
2015-09-26 21:17:14 +00:00
enum class MissileViewMode : uint8_t
{
None ,
EnabledSelfOnly ,
EnabledSelfAndAllies ,
} ;
2013-03-03 01:03:33 +00:00
# endif
2008-04-13 00:28:36 +00:00
2020-04-19 20:47:07 +00:00
# include "gameplayopt.h"
2020-08-10 03:45:13 +00:00
# include "gauges.h"
2015-07-25 23:10:45 +00:00
# include <cstdint>
2012-11-11 22:12:51 +00:00
2013-02-21 00:20:26 +00:00
# define N_SAVE_SLOTS 10
# define GAME_NAME_LEN 25 // +1 for terminating zero = 26
2006-03-20 16:43:15 +00:00
2016-10-02 19:35:34 +00:00
# ifdef dsx
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_I)
2016-10-02 19:35:34 +00:00
namespace dsx {
2010-12-22 00:17:49 +00:00
// NOTE: Obsolete structure - only kept for compability of shareware plr file
2013-12-22 22:03:07 +00:00
struct saved_game_sw
{
2008-04-13 00:28:36 +00:00
char name [ GAME_NAME_LEN + 1 ] ; //extra char for terminating zero
2010-12-22 00:17:49 +00:00
struct player_rw sg_player ;
2008-04-13 00:28:36 +00:00
int difficulty_level ; //which level game is played at
int primary_weapon ; //which weapon selected
int secondary_weapon ; //which weapon selected
int cockpit_mode ; //which cockpit mode selected
int window_w , window_h ; //size of player's window
int next_level_num ; //which level we're going to
int auto_leveling_on ; //does player have autoleveling on?
2013-12-22 22:03:07 +00:00
} __pack__ ;
2008-04-13 00:28:36 +00:00
2013-03-03 01:03:33 +00:00
void plyr_save_stats ( ) ;
2016-10-02 19:35:34 +00:00
}
# endif
2013-03-03 01:03:33 +00:00
# endif
2013-12-22 22:03:07 +00:00
struct hli
{
2020-05-02 21:18:42 +00:00
std : : array < char , 9 > Shortname ;
2015-07-25 23:10:45 +00:00
uint8_t LevelNum ;
2013-12-22 22:03:07 +00:00
} ;
2008-04-13 00:28:36 +00:00
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_I) || defined(DXX_BUILD_DESCENT_II)
2015-04-19 04:18:50 +00:00
# include "kconfig.h"
2013-07-21 00:03:38 +00:00
# include "multi.h"
2015-07-25 23:10:45 +00:00
# include "fwd-weapon.h"
2020-07-05 23:34:33 +00:00
# include "d_array.h"
2012-07-15 03:51:54 +00:00
2020-12-19 16:13:26 +00:00
namespace dcx {
2015-10-18 18:11:57 +00:00
enum class FiringAutoselectMode : uint8_t
{
Immediate ,
Never ,
Delayed ,
} ;
2015-11-14 18:17:22 +00:00
enum class HudType : uint8_t
{
Standard ,
Alternate1 ,
Alternate2 ,
Hidden ,
} ;
2015-11-21 18:12:13 +00:00
enum class RespawnPress : uint8_t
{
Any ,
Fire ,
} ;
2017-03-25 19:34:02 +00:00
enum MouselookMode : uint8_t
{
Singleplayer = 1 ,
MPCoop = 2 ,
MPAnarchy = 4 ,
} ;
2020-12-19 16:13:26 +00:00
}
namespace dsx {
2015-09-26 21:17:14 +00:00
struct player_config : prohibit_void_ptr < player_config >
2008-04-13 00:28:36 +00:00
{
ubyte ControlType ;
2015-11-14 18:17:22 +00:00
HudType HudMode ;
2015-11-21 18:12:13 +00:00
RespawnPress RespawnMode ;
2017-03-25 19:34:02 +00:00
uint8_t MouselookFlags ;
2020-05-02 21:18:42 +00:00
using primary_weapon_order = std : : array < uint8_t , MAX_PRIMARY_WEAPONS + 1 > ;
using secondary_weapon_order = std : : array < uint8_t , MAX_SECONDARY_WEAPONS + 1 > ;
2016-01-17 17:36:48 +00:00
primary_weapon_order PrimaryOrder ;
secondary_weapon_order SecondaryOrder ;
2017-12-05 05:29:55 +00:00
struct KeySettings {
2020-07-05 23:34:33 +00:00
enumerated_array < uint8_t , MAX_CONTROLS , dxx_kconfig_ui_kc_keyboard > Keyboard ;
2017-12-05 05:29:55 +00:00
# if DXX_MAX_JOYSTICKS
2020-07-05 23:34:33 +00:00
enumerated_array < uint8_t , MAX_CONTROLS , dxx_kconfig_ui_kc_joystick > Joystick ;
2017-12-05 05:29:55 +00:00
# endif
2020-07-05 23:34:33 +00:00
enumerated_array < uint8_t , MAX_CONTROLS , dxx_kconfig_ui_kc_mouse > Mouse ;
2017-12-05 05:29:55 +00:00
} KeySettings ;
2020-07-05 23:34:33 +00:00
std : : array < uint8_t , MAX_DXX_REBIRTH_CONTROLS > KeySettingsRebirth ;
2018-05-12 18:24:19 +00:00
Difficulty_level_type DefaultDifficulty ;
2008-04-13 00:28:36 +00:00
int AutoLeveling ;
2014-12-08 04:49:20 +00:00
uint16_t NHighestLevels ;
2020-05-02 21:18:42 +00:00
std : : array < hli , MAX_MISSIONS > HighestLevels ;
std : : array < int , 5 > KeyboardSens ;
std : : array < int , 6 > JoystickSens ;
std : : array < int , 6 > JoystickDead ;
std : : array < int , 6 > JoystickLinear ;
std : : array < int , 6 > JoystickSpeed ;
2011-01-04 10:43:30 +00:00
ubyte MouseFlightSim ;
2020-05-02 21:18:42 +00:00
std : : array < int , 6 > MouseSens ;
std : : array < int , 6 > MouseOverrun ;
2011-01-04 10:43:30 +00:00
int MouseFSDead ;
2011-01-10 15:12:00 +00:00
int MouseFSIndicator ;
2020-05-02 21:18:42 +00:00
std : : array < cockpit_mode_t , 2 > CockpitMode ; // 0 saves the "real" cockpit, 1 also saves letterbox and rear. Used to properly switch between modes and restore the real one.
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_II)
2020-08-10 03:45:13 +00:00
enumerated_array < int , 2 , gauge_inset_window_view > Cockpit3DView ;
2013-03-03 01:03:33 +00:00
# endif
2020-05-02 21:18:42 +00:00
std : : array < ntstring < MAX_MESSAGE_LEN - 1 > , 4 > NetworkMessageMacro ;
2008-04-13 00:28:36 +00:00
int NetlifeKills ;
int NetlifeKilled ;
2011-01-10 15:12:00 +00:00
ubyte ReticleType ;
2020-05-02 21:18:42 +00:00
std : : array < int , 4 > ReticleRGBA ;
2011-01-10 15:12:00 +00:00
int ReticleSize ;
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_II)
2015-09-26 21:17:14 +00:00
MissileViewMode MissileViewEnabled ;
Allow players to remove thief at level start
Commit f4b21088a039 ("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
uint8_t ThiefModifierFlags ;
2013-03-03 01:03:33 +00:00
int HeadlightActiveDefault ;
int GuidedInBigWindow ;
2015-01-12 00:26:02 +00:00
ntstring < GUIDEBOT_NAME_LEN > GuidebotName , GuidebotNameReal ;
2013-03-03 01:03:33 +00:00
int EscortHotKeys ;
# endif
2008-04-13 00:28:36 +00:00
int PersistentDebris ;
2008-10-28 17:04:35 +00:00
int PRShot ;
2011-01-03 01:01:09 +00:00
ubyte NoRedundancy ;
ubyte MultiMessages ;
2016-03-30 18:09:46 +00:00
ubyte MultiPingHud ;
2013-04-08 10:46:05 +00:00
ubyte NoRankings ;
2013-03-03 01:03:33 +00:00
# if defined(DXX_BUILD_DESCENT_I)
2011-01-03 01:01:09 +00:00
ubyte BombGauge ;
2013-03-03 01:03:33 +00:00
# endif
2011-05-20 10:23:22 +00:00
ubyte AutomapFreeFlight ;
2015-10-18 18:11:57 +00:00
FiringAutoselectMode NoFireAutoselect ;
2013-04-08 13:04:19 +00:00
ubyte CycleAutoselectOnly ;
2015-10-03 17:17:49 +00:00
uint8_t CloakInvulTimer ;
2015-08-21 03:12:35 +00:00
union {
/* For now, manage all these choices in a single variable, but
* give them separate names to make them easier to find .
*/
int AlphaEffects ;
int AlphaBlendMineExplosion ;
int AlphaBlendMarkers ;
int AlphaBlendFireballs ;
int AlphaBlendPowerups ;
int AlphaBlendLasers ;
int AlphaBlendWeapons ;
int AlphaBlendEClips ;
} ;
2011-04-07 20:32:47 +00:00
int DynLightColor ;
2020-04-19 20:47:07 +00:00
d_sp_gameplay_options SPGameplayOptions ;
2013-12-22 22:03:07 +00:00
} ;
2020-12-19 16:13:26 +00:00
}
2013-03-03 01:03:33 +00:00
# endif
2008-04-13 00:28:36 +00:00
extern struct player_config PlayerCfg ;
2006-03-20 16:43:15 +00:00
# ifndef EZERO
# define EZERO 0
# endif
2013-02-21 00:20:26 +00:00
// Used to save kconfig values to disk.
2016-08-25 04:05:32 +00:00
# ifdef dsx
namespace dsx {
2017-12-05 05:29:55 +00:00
extern const struct player_config : : KeySettings DefaultKeySettings ;
2013-10-06 17:47:56 +00:00
void write_player_file ( ) ;
2006-03-20 16:43:15 +00:00
int new_player_config ( ) ;
int read_player_file ( ) ;
2013-02-21 00:20:26 +00:00
// set a new highest level for player for this mission
2016-08-25 04:05:32 +00:00
}
# endif
2019-08-24 04:32:24 +00:00
void set_highest_level ( uint8_t levelnum ) ;
2006-03-20 16:43:15 +00:00
2013-02-21 00:20:26 +00:00
// gets the player's highest level from the file for this mission
2006-03-20 16:43:15 +00:00
int get_highest_level ( void ) ;
2015-12-13 18:00:49 +00:00
namespace dsx {
2013-07-21 00:03:38 +00:00
struct netgame_info ;
void read_netgame_profile ( struct netgame_info * ng ) ;
void write_netgame_profile ( struct netgame_info * ng ) ;
2015-12-13 18:00:48 +00:00
}
2011-04-22 15:14:27 +00:00
2012-11-11 22:12:51 +00:00
# endif