source-engine/game/server/stargate/sg_kawoosh.cpp
Deploy Bot 44cb9a4837 StargateTC port — initial integration into nillerusr/source-engine
P1: Source files
- Copy 9 server stargate files + sg_constants.h + sg_weapons.cpp from
  StargateTCSource/sourcecode/ into game/server/stargate/ and
  game/shared/stargate/.
- Add $Folder "Stargate" block to server_hl2mp.vpc and client_hl2mp.vpc.
- Extend $AdditionalIncludeDirectories with stargate paths.

P2/P3: Gamerules + player patches
- hl2mp_gamerules.h: add TEAM_JAFFA=4, TEAM_UNAS=5 to team enum.
- hl2mp_gamerules.cpp: preserve 5 Stargate spawn classnames in
  s_PreserveEnts[]; rename teams to Tau'ri/Goa'uld/Jaffa/Unas;
  rename game description to "StargateTC"/"StargateTC Teamplay".
- hl2mp_player.cpp: EntSelectSpawnPoint now searches Stargate spawn
  classnames first (torri/goauld/marine/unas) with per-team fallback
  chain to combine/rebel/deathmatch.

Build: 0 errors. Server.dll 13.19MB, client.dll 9.85MB.
Runtime test: window title "StargateTC", live game launches,
HEALTH 100 HUD renders, HL2MP MOTD shown, sky/world geometry renders.
Response system loads 217 rules without crashing (was the original
Mapbase+VS2022 heap-corruption point).

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
2026-05-25 14:08:44 +01:00

55 lines
1.6 KiB
C++

//============= Copyright (c) StargateTC Source Team ==========================
//
// stargate_kawoosh - unstable vortex damage volume. The original GoldSrc DLL
// exposes this as a custom gate entity; this Source pass makes it operational
// through normal inputs so stargate_event can trigger it from Hammer I/O.
//
//=============================================================================
#include "cbase.h"
#include "stargate/sg_constants.h"
class CStargateKawoosh : public CBaseEntity
{
public:
DECLARE_CLASS( CStargateKawoosh, CBaseEntity );
DECLARE_DATADESC();
void Spawn() override;
void InputFire( inputdata_t &inputdata );
void CollapseThink();
private:
float m_flRadius;
};
LINK_ENTITY_TO_CLASS( stargate_kawoosh, CStargateKawoosh );
BEGIN_DATADESC( CStargateKawoosh )
DEFINE_KEYFIELD( m_flRadius, FIELD_FLOAT, "radius" ),
DEFINE_INPUTFUNC( FIELD_VOID, "Fire", InputFire ),
DEFINE_THINKFUNC( CollapseThink ),
END_DATADESC()
void CStargateKawoosh::Spawn()
{
BaseClass::Spawn();
SetSolid( SOLID_NONE );
SetMoveType( MOVETYPE_NONE );
if ( m_flRadius <= 0.0f )
m_flRadius = StargateTC::KAWOOSH_RADIUS;
}
void CStargateKawoosh::InputFire( inputdata_t & )
{
CTakeDamageInfo info( this, this, StargateTC::KAWOOSH_DAMAGE, DMG_ENERGYBEAM | DMG_DISSOLVE );
RadiusDamage( info, GetAbsOrigin(), m_flRadius, CLASS_NONE, NULL );
SetThink( &CStargateKawoosh::CollapseThink );
SetNextThink( gpGlobals->curtime + StargateTC::KAWOOSH_DURATION );
}
void CStargateKawoosh::CollapseThink()
{
SetThink( NULL );
}