mirror of
https://git.do.srb2.org/STJr/SRB2.git
synced 2025-01-21 17:00:59 +00:00
3d07915be2
Hardcoded VAda Flickies Many thanks to MI for his help, even if he has sinful opinions on what the collection of creatures should be called. ;P * Flickies are now handled via A_FlickySpawn instead of hardcoded in P_KillMobj, so there can be mobjtypes with MF_ENEMY which don't create flickies, or other mechanisms which can much easier. * Added map header "FlickyList" (aka "AnimalList") parameter, which can either be set to: * A species (eg: "Rabbit" or "Bluebird", amongst 17 currently supported types in dehacked.c table FLICKYTYPES - including the seed from Sonic CD, which isn't limited to 'soniccd on' in the console now) * Any valid mobjtype that isn't MT_NULL (eg: "MT_FLICKY_GHOST") * A comma-seperated list of either of the above, up to 64 entries long (eg: "Cow,MT_FLICKY_SPIDER,Chicken") * "All" - sets behind-the-scenes stuff to use every 'normal' type of flicky in FLICKYTYPES (a distinction which can be utilised to hide secret level flickies where they wouldn't be appropriate for the main game) * "Demo" - sets behind-the-scenes stuff to use the five flickies closest to the species used in the game's long history. * "None" - prevents any flickies from spawning. "Demo" is functionally the default value if you don't include a FlickyList parameter in the header at all. Of note, a bunch of functions are now created: * A_FlickySpawn - spawns flicky. * A_FlickyAim - aims for area near target, but not directly on them - turns around when hitting wall * A_FlickyFly - flies/swims around target (calls A_FlickyAim) * A_FlickySoar - hacky alternate fly (calls A_FlickyAim) * A_FlickyCoast - slowing down before going off again * A_FlickyHop - fracunit-scale precision for A_BunnyHop * A_FlickyFlounder - A_FlickyHop with randomisation * A_FlickyCheck - State-setter for falling, or being on-ground * A_FlickyHeightCheck - State-setter for falling, or being below a certain height relative to target * A_FlickyFlutter - A_FlickyCheck, but with a slow fall/movement (calls A_FlickyCheck and A_FlickyAim) I don't need to enumerate the object types and states that have been added, do I? Oh yeah, I also made it so get_mobjtype's failure value was MT_NULL and prohibited SOC from editing the properties of it to compensate. IN ADDITION: Killed "soniccd" console command, since it made things more complicated and honestly being able to specify Sonic CD seeds in the level header is a better option. See merge request !60
223 lines
6 KiB
C
223 lines
6 KiB
C
// SONIC ROBO BLAST 2
|
|
//-----------------------------------------------------------------------------
|
|
// Copyright (C) 1998-2000 by DooM Legacy Team.
|
|
// Copyright (C) 1999-2016 by Sonic Team Junior.
|
|
//
|
|
// This program is free software distributed under the
|
|
// terms of the GNU General Public License, version 2.
|
|
// See the 'LICENSE' file for more details.
|
|
//-----------------------------------------------------------------------------
|
|
/// \file d_netcmd.h
|
|
/// \brief host/client network commands
|
|
/// commands are executed through the command buffer
|
|
/// like console commands
|
|
|
|
#ifndef __D_NETCMD__
|
|
#define __D_NETCMD__
|
|
|
|
#include "command.h"
|
|
|
|
// console vars
|
|
extern consvar_t cv_playername;
|
|
extern consvar_t cv_playercolor;
|
|
#ifdef SEENAMES
|
|
extern consvar_t cv_seenames, cv_allowseenames;
|
|
#endif
|
|
extern consvar_t cv_usemouse;
|
|
extern consvar_t cv_usejoystick;
|
|
extern consvar_t cv_usejoystick2;
|
|
#ifdef LJOYSTICK
|
|
extern consvar_t cv_joyport;
|
|
extern consvar_t cv_joyport2;
|
|
#endif
|
|
extern consvar_t cv_joyscale;
|
|
extern consvar_t cv_joyscale2;
|
|
extern consvar_t cv_controlperkey;
|
|
|
|
// splitscreen with second mouse
|
|
extern consvar_t cv_mouse2port;
|
|
extern consvar_t cv_usemouse2;
|
|
#if (defined (__unix__) && !defined (MSDOS)) || defined (UNIXCOMMON)
|
|
extern consvar_t cv_mouse2opt;
|
|
#endif
|
|
extern consvar_t cv_invertmouse2;
|
|
extern consvar_t cv_alwaysfreelook2;
|
|
extern consvar_t cv_mousemove2;
|
|
extern consvar_t cv_mousesens2;
|
|
extern consvar_t cv_mouseysens2;
|
|
|
|
// normally in p_mobj but the .h is not read
|
|
extern consvar_t cv_itemrespawntime;
|
|
extern consvar_t cv_itemrespawn;
|
|
|
|
extern consvar_t cv_flagtime;
|
|
extern consvar_t cv_suddendeath;
|
|
|
|
extern consvar_t cv_skin;
|
|
|
|
// secondary splitscreen player
|
|
extern consvar_t cv_playername2;
|
|
extern consvar_t cv_playercolor2;
|
|
extern consvar_t cv_skin2;
|
|
|
|
extern consvar_t cv_touchtag;
|
|
extern consvar_t cv_hidetime;
|
|
|
|
extern consvar_t cv_friendlyfire;
|
|
extern consvar_t cv_pointlimit;
|
|
extern consvar_t cv_timelimit;
|
|
extern consvar_t cv_numlaps;
|
|
extern consvar_t cv_usemapnumlaps;
|
|
extern UINT32 timelimitintics;
|
|
extern consvar_t cv_allowexitlevel;
|
|
|
|
extern consvar_t cv_hazardlog;
|
|
|
|
extern consvar_t cv_autobalance;
|
|
extern consvar_t cv_teamscramble;
|
|
extern consvar_t cv_scrambleonchange;
|
|
|
|
extern consvar_t cv_useranalog, cv_useranalog2;
|
|
extern consvar_t cv_analog, cv_analog2;
|
|
|
|
extern consvar_t cv_netstat;
|
|
#ifdef WALLSPLATS
|
|
extern consvar_t cv_splats;
|
|
#endif
|
|
|
|
extern consvar_t cv_countdowntime;
|
|
extern consvar_t cv_runscripts;
|
|
extern consvar_t cv_mute;
|
|
extern consvar_t cv_killingdead;
|
|
extern consvar_t cv_pause;
|
|
|
|
extern consvar_t cv_restrictskinchange, cv_allowteamchange, cv_respawntime;
|
|
|
|
extern consvar_t cv_teleporters, cv_superring, cv_supersneakers, cv_invincibility;
|
|
extern consvar_t cv_jumpshield, cv_watershield, cv_ringshield, cv_forceshield, cv_bombshield;
|
|
extern consvar_t cv_1up, cv_eggmanbox;
|
|
extern consvar_t cv_recycler;
|
|
|
|
extern consvar_t cv_itemfinder;
|
|
|
|
extern consvar_t cv_inttime, cv_advancemap, cv_playersforexit;
|
|
extern consvar_t cv_match_scoring;
|
|
extern consvar_t cv_overtime;
|
|
extern consvar_t cv_startinglives;
|
|
|
|
// for F_finale.c
|
|
extern consvar_t cv_rollingdemos;
|
|
|
|
extern consvar_t cv_resetmusic;
|
|
|
|
extern consvar_t cv_ringslinger, cv_soundtest;
|
|
|
|
extern consvar_t cv_specialrings, cv_powerstones, cv_matchboxes, cv_competitionboxes;
|
|
|
|
#ifdef NEWPING
|
|
extern consvar_t cv_maxping;
|
|
#endif
|
|
|
|
extern consvar_t cv_skipmapcheck;
|
|
|
|
extern consvar_t cv_sleep, cv_screenshot_option, cv_screenshot_folder;
|
|
|
|
extern consvar_t cv_moviemode;
|
|
|
|
extern consvar_t cv_zlib_level, cv_zlib_memory, cv_zlib_strategy;
|
|
|
|
extern consvar_t cv_zlib_window_bits, cv_zlib_levela, cv_zlib_memorya;
|
|
|
|
extern consvar_t cv_zlib_strategya, cv_zlib_window_bitsa;
|
|
|
|
extern consvar_t cv_apng_delay;
|
|
|
|
typedef enum
|
|
{
|
|
XD_NAMEANDCOLOR = 1,
|
|
XD_WEAPONPREF, // 2
|
|
XD_KICK, // 3
|
|
XD_NETVAR, // 4
|
|
XD_SAY, // 5
|
|
XD_MAP, // 6
|
|
XD_EXITLEVEL, // 7
|
|
XD_ADDFILE, // 8
|
|
XD_PAUSE, // 9
|
|
XD_ADDPLAYER, // 10
|
|
XD_TEAMCHANGE, // 11
|
|
XD_CLEARSCORES, // 12
|
|
XD_LOGIN, // 13
|
|
XD_VERIFIED, // 14
|
|
XD_RANDOMSEED, // 15
|
|
XD_RUNSOC, // 16
|
|
XD_REQADDFILE, // 17
|
|
XD_DELFILE, // 18
|
|
XD_SETMOTD, // 19
|
|
XD_SUICIDE, // 20
|
|
#ifdef HAVE_BLUA
|
|
XD_LUACMD, // 21
|
|
XD_LUAVAR, // 22
|
|
#endif
|
|
MAXNETXCMD
|
|
} netxcmd_t;
|
|
|
|
extern const char *netxcmdnames[MAXNETXCMD - 1];
|
|
|
|
#if defined(_MSC_VER)
|
|
#pragma pack(1)
|
|
#endif
|
|
|
|
#ifdef _MSC_VER
|
|
#pragma warning(disable : 4214)
|
|
#endif
|
|
|
|
//Packet composition for Command_TeamChange_f() ServerTeamChange, etc.
|
|
//bitwise structs make packing bits a little easier, but byte alignment harder?
|
|
//todo: decide whether to make the other netcommands conform, or just get rid of this experiment.
|
|
typedef struct {
|
|
UINT32 playernum : 5; // value 0 to 31
|
|
UINT32 newteam : 5; // value 0 to 31
|
|
UINT32 verification : 1; // value 0 to 1
|
|
UINT32 autobalance : 1; // value 0 to 1
|
|
UINT32 scrambled : 1; // value 0 to 1
|
|
} ATTRPACK changeteam_packet_t;
|
|
|
|
#ifdef _MSC_VER
|
|
#pragma warning(default : 4214)
|
|
#endif
|
|
|
|
typedef struct {
|
|
UINT16 l; // liitle endian
|
|
UINT16 b; // big enian
|
|
} ATTRPACK changeteam_value_t;
|
|
|
|
//Since we do not want other files/modules to know about this data buffer we union it here with a Short Int.
|
|
//Other files/modules will hand the INT16 back to us and we will decode it here.
|
|
//We don't have to use a union, but we would then send four bytes instead of two.
|
|
typedef union {
|
|
changeteam_packet_t packet;
|
|
changeteam_value_t value;
|
|
} ATTRPACK changeteam_union;
|
|
|
|
#if defined(_MSC_VER)
|
|
#pragma pack()
|
|
#endif
|
|
|
|
// add game commands, needs cleanup
|
|
void D_RegisterServerCommands(void);
|
|
void D_RegisterClientCommands(void);
|
|
void D_SendPlayerConfig(void);
|
|
void Command_ExitGame_f(void);
|
|
void Command_Retry_f(void);
|
|
void D_GameTypeChanged(INT32 lastgametype); // not a real _OnChange function anymore
|
|
void D_MapChange(INT32 pmapnum, INT32 pgametype, boolean pultmode, boolean presetplayers, INT32 pdelay, boolean pskipprecutscene, boolean pfromlevelselect);
|
|
void ObjectPlace_OnChange(void);
|
|
void ItemFinder_OnChange(void);
|
|
void D_SetPassword(const char *pw);
|
|
|
|
// used for the player setup menu
|
|
UINT8 CanChangeSkin(INT32 playernum);
|
|
|
|
#endif
|
|
|
|
|