Skip to content

Commit

Permalink
Make new monsters into compile-time features. Make floater configurat…
Browse files Browse the repository at this point in the history
…ion dependant
  • Loading branch information
FreeSlave committed Sep 11, 2024
1 parent fd90ddb commit 1e135f8
Show file tree
Hide file tree
Showing 8 changed files with 63 additions and 6 deletions.
6 changes: 6 additions & 0 deletions dlls/bloater.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,8 @@
#include "soundent.h"
#include "scripted.h"
#include "studio.h"
#include "game.h"
#include "mod_features.h"

//=========================================================
// Monster's Anim Events Go Here
Expand Down Expand Up @@ -149,6 +151,8 @@ void CBloater::Precache()
// AI Schedules Specific to this monster
//=========================================================

#if FEATURE_FLOATER

#define BLOATING_TIME 2.1
#define BASE_FLOATER_SPEED 100
#define FLOATER_GLOW_SPRITE "sprites/glow02.spr"
Expand All @@ -169,6 +173,7 @@ class CFloater : public CBaseMonster

void Spawn( void );
void Precache( void );
bool IsEnabledInMod() { return g_modFeatures.IsMonsterEnabled("floater"); }
void SetYawSpeed( void );
int DefaultISoundMask();
int DefaultClassify( void );
Expand Down Expand Up @@ -1025,3 +1030,4 @@ void CFloater::AlertOthers()
}
}
}
#endif
4 changes: 4 additions & 0 deletions dlls/flybee.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
#include "soundent.h"
#include "game.h"
#include "decals.h"
#include "mod_features.h"

#if FEATURE_FLYBEE

#define FLYBEE_SPEED 150
#define PROBE_LENGTH 150
Expand Down Expand Up @@ -1349,3 +1352,4 @@ void CFlyBall::ExplodeTouch( CBaseEntity *pOther )
SetThink( &CBaseEntity::SUB_Remove );
pev->nextthink = gpGlobals->time + 0.01f; // let the sound play
}
#endif
25 changes: 23 additions & 2 deletions dlls/game.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -810,11 +810,13 @@ DECLARE_SKILL_VALUE(sk_bigmomma_radius_blast, "250")
DECLARE_SKILL_VALUE(sk_cleansuit_scientist_health, "0")
#endif

#if FEATURE_FLYBEE
// Flybee
DECLARE_SKILL_VALUE(sk_flybee_health, "0")
DECLARE_SKILL_VALUE(sk_flybee_dmg_kick, "20")
DECLARE_SKILL_VALUE(sk_flybee_dmg_beam, "50")
DECLARE_SKILL_VALUE(sk_flybee_dmg_flyball, "20")
#endif

// Gargantua
DECLARE_SKILL_VALUE(sk_gargantua_health, "0")
Expand Down Expand Up @@ -915,8 +917,11 @@ DECLARE_SKILL_VALUE(sk_otis_health, "0")
DECLARE_SKILL_VALUE(sk_kate_health, "0")
#endif

#if FEATURE_PANTHEREYE
// Panthereye
DECLARE_SKILL_VALUE(sk_panthereye_health, "150")
DECLARE_SKILL_VALUE(sk_panthereye_dmg_claw, "20")
#endif

#if FEATURE_PITDRONE
// Pitdrone
Expand Down Expand Up @@ -1005,8 +1010,11 @@ DECLARE_SKILL_VALUE(sk_gonome_dmg_guts, "0")
DECLARE_SKILL_VALUE(sk_gonome_dmg_one_bite, "0")
#endif

#if FEATURE_FLOATER
// Floater
DECLARE_SKILL_VALUE(sk_floater_health, "0")
DECLARE_SKILL_VALUE(sk_floater_explode, "0")
#endif

//Turret
DECLARE_SKILL_VALUE(sk_turret_health, "0")
Expand All @@ -1017,11 +1025,13 @@ DECLARE_SKILL_VALUE(sk_miniturret_health, "0")
// Sentry Turret
DECLARE_SKILL_VALUE(sk_sentry_health, "0")

#if FEATURE_ROBOCOP
// Robocop
DECLARE_SKILL_VALUE(sk_robocop_health, "0")
DECLARE_SKILL_VALUE(sk_robocop_dmg_mortar, "0")
DECLARE_SKILL_VALUE(sk_robocop_dmg_fist, "0")
DECLARE_SKILL_VALUE(sk_robocop_sw_radius, "0")
#endif

DECLARE_SKILL_VALUE(sk_zaptrap_sense_radius, "244")
DECLARE_SKILL_VALUE(sk_zaptrap_respawn_time, "18")
Expand Down Expand Up @@ -1545,6 +1555,7 @@ void GameDLLInit( void )
REGISTER_SKILL_CVARS(sk_cleansuit_scientist_health);
#endif

#if FEATURE_FLYBEE
// Flybee
if (g_modFeatures.IsMonsterEnabled("flybee"))
{
Expand All @@ -1553,6 +1564,7 @@ void GameDLLInit( void )
REGISTER_SKILL_CVARS(sk_flybee_dmg_beam);
REGISTER_SKILL_CVARS(sk_flybee_dmg_flyball);
}
#endif

// Gargantua
REGISTER_SKILL_CVARS(sk_gargantua_health);
Expand Down Expand Up @@ -1669,12 +1681,14 @@ void GameDLLInit( void )
REGISTER_SKILL_CVARS(sk_kate_health);
#endif

#if FEATURE_PANTHEREYE
// Panthereye
if (g_modFeatures.IsMonsterEnabled("panthereye"))
{
REGISTER_SKILL_CVARS(sk_panthereye_health);
REGISTER_SKILL_CVARS(sk_panthereye_dmg_claw);
}
#endif

#if FEATURE_PITDRONE
// Pitdrone
Expand Down Expand Up @@ -1795,8 +1809,13 @@ void GameDLLInit( void )
}
#endif

REGISTER_SKILL_CVARS(sk_floater_health);
REGISTER_SKILL_CVARS(sk_floater_explode);
#if FEATURE_FLOATER
if (g_modFeatures.IsMonsterEnabled("floater"))
{
REGISTER_SKILL_CVARS(sk_floater_health);
REGISTER_SKILL_CVARS(sk_floater_explode);
}
#endif

//Turret
REGISTER_SKILL_CVARS(sk_turret_health);
Expand All @@ -1807,6 +1826,7 @@ void GameDLLInit( void )
// Sentry Turret
REGISTER_SKILL_CVARS(sk_sentry_health);

#if FEATURE_ROBOCOP
// Robocop
if (g_modFeatures.IsMonsterEnabled("robocop"))
{
Expand All @@ -1815,6 +1835,7 @@ void GameDLLInit( void )
REGISTER_SKILL_CVARS(sk_robocop_dmg_fist);
REGISTER_SKILL_CVARS(sk_robocop_sw_radius);
}
#endif

REGISTER_SKILL_CVARS(sk_zaptrap_sense_radius);
REGISTER_SKILL_CVARS(sk_zaptrap_respawn_time);
Expand Down
16 changes: 13 additions & 3 deletions dlls/gamerules.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,7 @@ void CGameRules::RefreshSkillData ( void )
gSkillData.cleansuitScientistHealth = GetSkillCvar( "sk_cleansuit_scientist_health", "sk_scientist_health" );
#endif

#if FEATURE_FLYBEE
// Flybee
if (g_modFeatures.IsMonsterEnabled("flybee"))
{
Expand All @@ -178,6 +179,7 @@ void CGameRules::RefreshSkillData ( void )
gSkillData.flybeeDmgBeam = GetSkillCvar("sk_flybee_dmg_beam");
gSkillData.flybeeDmgFlyball = GetSkillCvar("sk_flybee_dmg_flyball");
}
#endif

// Gargantua
gSkillData.gargantuaHealth = GetSkillCvar( "sk_gargantua_health" );
Expand Down Expand Up @@ -269,13 +271,14 @@ void CGameRules::RefreshSkillData ( void )
// Nihilanth
gSkillData.nihilanthHealth = GetSkillCvar( "sk_nihilanth_health" );
gSkillData.nihilanthZap = GetSkillCvar( "sk_nihilanth_zap" );

#if FEATURE_PANTHEREYE
// Panthereye
if (g_modFeatures.IsMonsterEnabled("panthereye"))
{
gSkillData.panthereyeHealth = GetSkillCvar( "sk_panthereye_health" );
gSkillData.panthereyeDmgClaw = GetSkillCvar( "sk_panthereye_dmg_claw" );
}
#endif

#if FEATURE_PITDRONE
// Pitdrone
Expand Down Expand Up @@ -401,9 +404,14 @@ void CGameRules::RefreshSkillData ( void )
gSkillData.gonomeDmgOneBite = GetSkillCvar( "sk_gonome_dmg_one_bite" );
}
#endif
#if FEATURE_FLOATER
// Floater
gSkillData.floaterHealth = GetSkillCvar( "sk_floater_health" );
gSkillData.floaterExplode = GetSkillCvar( "sk_floater_explode" );
if (g_modFeatures.IsMonsterEnabled("floater"))
{
gSkillData.floaterHealth = GetSkillCvar( "sk_floater_health" );
gSkillData.floaterExplode = GetSkillCvar( "sk_floater_explode" );
}
#endif

//Turret
gSkillData.turretHealth = GetSkillCvar( "sk_turret_health" );
Expand All @@ -414,6 +422,7 @@ void CGameRules::RefreshSkillData ( void )
// Sentry Turret
gSkillData.sentryHealth = GetSkillCvar( "sk_sentry_health" );

#if FEATURE_ROBOCOP
// Robocop
if (g_modFeatures.IsMonsterEnabled("robocop"))
{
Expand All @@ -422,6 +431,7 @@ void CGameRules::RefreshSkillData ( void )
gSkillData.robocopDmgFist = GetSkillCvar( "sk_robocop_dmg_fist" );
gSkillData.robocopSWRadius = GetSkillCvar( "sk_robocop_sw_radius" );
}
#endif

// Zap ball trap
gSkillData.zaptrapSenseRadius = GetSkillCvar( "sk_zaptrap_sense_radius" );
Expand Down
4 changes: 4 additions & 0 deletions dlls/panthereye.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,9 @@
#include "monsters.h"
#include "game.h"
#include "common_soundscripts.h"
#include "mod_features.h"

#if FEATURE_PANTHEREYE

#define PANTHEREYE_AE_STRIKE_LEFT ( 1 )
#define PANTHEREYE_AE_STRIKE_RIGHT_LOW ( 2 )
Expand Down Expand Up @@ -237,3 +240,4 @@ Schedule_t* CPantherEye::GetScheduleOfType(int Type)
}
return CBaseMonster::GetScheduleOfType(Type);
}
#endif
5 changes: 4 additions & 1 deletion dlls/robocop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,9 @@
#include "explode.h"
#include "game.h"
#include "common_soundscripts.h"
#include "mod_features.h"

#if FEATURE_ROBOCOP

class CFireTrail : public CBaseEntity
{
Expand Down Expand Up @@ -999,4 +1002,4 @@ void CRoboCop::SetActivity( Activity NewActivity )
break;
}
}

#endif
5 changes: 5 additions & 0 deletions features/featureful_monsters.cfg
Original file line number Diff line number Diff line change
Expand Up @@ -38,3 +38,8 @@ babyvoltigore

//drillsergeant
//recruit

//floater
//flybee
//panthereye
//robocop
4 changes: 4 additions & 0 deletions game_shared/mod_features.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,10 @@
#define FEATURE_KELLER 1
#define FEATURE_BARNIEL 1
#define FEATURE_KATE 1
#define FEATURE_FLOATER 1
#define FEATURE_PANTHEREYE 1
#define FEATURE_FLYBEE 1
#define FEATURE_ROBOCOP 1

#define FEATURE_HOUNDEYE_DEAD (0 || FEATURE_OPFOR_MONSTERS)
#define FEATURE_SKELETON (0 || FEATURE_OPFOR_MONSTERS)
Expand Down

0 comments on commit 1e135f8

Please sign in to comment.