mirror of
https://github.com/ptitSeb/Serious-Engine
synced 2024-11-26 04:05:53 +01:00
262 lines
12 KiB
C++
262 lines
12 KiB
C++
/*
|
|
* This file is generated by Entity Class Compiler, (c) CroTeam 1997-98
|
|
*/
|
|
|
|
#line 4 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
|
|
#include "StdH.h"
|
|
#include "Models/Items/ItemHolder/ItemHolder.h"
|
|
|
|
#include <EntitiesMP/AmmoPack.h>
|
|
#include <EntitiesMP/AmmoPack_tables.h>
|
|
CEntityEvent *EAmmoPackItem::MakeCopy(void) { CEntityEvent *peeCopy = new EAmmoPackItem(*this); return peeCopy;}
|
|
EAmmoPackItem::EAmmoPackItem() : CEntityEvent(EVENTCODE_EAmmoPackItem) {;
|
|
ClearToDefault(iShells);
|
|
ClearToDefault(iBullets);
|
|
ClearToDefault(iRockets);
|
|
ClearToDefault(iGrenades);
|
|
ClearToDefault(iNapalm);
|
|
ClearToDefault(iElectricity);
|
|
ClearToDefault(iIronBalls);
|
|
ClearToDefault(iSniperBullets);
|
|
};
|
|
void CAmmoPack::SetDefaultProperties(void) {
|
|
m_aptPackType = APT_CUSTOM ;
|
|
m_iShells = MAX_SHELLS ;
|
|
m_iBullets = MAX_BULLETS ;
|
|
m_iRockets = MAX_ROCKETS ;
|
|
m_iGrenades = MAX_GRENADES ;
|
|
m_iNapalm = MAX_NAPALM ;
|
|
m_iElectricity = MAX_ELECTRICITY ;
|
|
m_iIronBalls = MAX_IRONBALLS ;
|
|
m_iSniperBullets = MAX_SNIPERBULLETS ;
|
|
CItem::SetDefaultProperties();
|
|
}
|
|
|
|
#line 66 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
void CAmmoPack::Precache(void) {
|
|
#line 67 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
PrecacheSound (SOUND_PICK );
|
|
#line 68 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
|
|
#line 71 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
void CAmmoPack::RenderParticles(void)
|
|
#line 72 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
{
|
|
#line 74 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(GetRenderType () != CEntity :: RT_MODEL || GetSP () -> sp_gmGameMode > CSessionProperties :: GM_COOPERATIVE
|
|
#line 75 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
|| ! ShowItemParticles ())
|
|
#line 76 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
{
|
|
#line 77 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
return ;
|
|
#line 78 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
#line 80 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
Particles_Spiral (this , 3.0f * 0.5 , 2.5f * 0.5 , PT_STAR04 , 10);
|
|
#line 81 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
|
|
#line 84 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
BOOL CAmmoPack::FillEntityStatistics(EntityStats * pes)
|
|
#line 85 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
{
|
|
#line 86 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
pes -> es_ctCount = 1;
|
|
#line 87 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
pes -> es_ctAmmount = 1;
|
|
#line 93 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
pes -> es_strName . PrintF ("Back pack: %d Shells, %d Bullets, %d Rockets, %d Grenades, %d Napalm, %d Electricity, %d Iron balls, %d Sniper bullets" ,
|
|
#line 94 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iShells , m_iBullets , m_iRockets , m_iGrenades , m_iNapalm , m_iElectricity , m_iIronBalls , m_iSniperBullets );
|
|
#line 97 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
pes -> es_fValue =
|
|
#line 98 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iShells * AV_SHELLS +
|
|
#line 99 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iBullets * AV_BULLETS +
|
|
#line 100 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iRockets * AV_ROCKETS +
|
|
#line 101 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iGrenades * AV_GRENADES +
|
|
#line 102 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iNapalm * AV_NAPALM +
|
|
#line 103 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iElectricity * AV_ELECTRICITY +
|
|
#line 104 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iIronBalls * AV_IRONBALLS +
|
|
#line 105 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iSniperBullets * AV_SNIPERBULLETS
|
|
#line 106 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
;
|
|
#line 108 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
pes -> es_iScore = 0;
|
|
#line 109 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
return TRUE ;
|
|
#line 110 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
|
|
#line 113 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
void CAmmoPack::SetProperties(void)
|
|
#line 114 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
{
|
|
#line 115 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
switch(m_aptPackType )
|
|
#line 116 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
{
|
|
#line 117 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
case APT_SERIOUS :
|
|
#line 118 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_strDescription = "Serious:";
|
|
#line 120 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
AddItem (MODEL_SERIOUSPACK , TEXTURE_SERIOUSPACK , 0 , 0 , 0);
|
|
#line 121 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
AddFlare (MODEL_FLARE , TEXTURE_FLARE , FLOAT3D (0 , 0.75f , 0) , FLOAT3D (2 , 2 , 1.3f));
|
|
#line 122 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
StretchItem (FLOAT3D (0.5f , 0.5f , 0.5f));
|
|
#line 123 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
break ;
|
|
#line 124 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
case APT_CUSTOM :
|
|
#line 125 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_strDescription = "Custom:";
|
|
#line 127 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
AddItem (MODEL_BACKPACK , TEXTURE_BACKPACK , 0 , 0 , 0);
|
|
#line 128 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
AddFlare (MODEL_FLARE , TEXTURE_FLARE , FLOAT3D (0 , 0.75f , 0) , FLOAT3D (2 , 2 , 1.3f));
|
|
#line 129 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
StretchItem (FLOAT3D (0.5f , 0.5f , 0.5f));
|
|
#line 130 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
break ;
|
|
#line 131 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
default : ASSERTALWAYS ("Uknown ammo");
|
|
#line 132 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
#line 134 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_fValue = 1.0f;
|
|
#line 135 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_fRespawnTime = (m_fCustomRespawnTime > 0) ? m_fCustomRespawnTime : 30.0f;
|
|
#line 136 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(m_iShells != 0){m_strDescription . PrintF ("%s: Shells (%d)" , m_strDescription , m_iShells );}
|
|
#line 137 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(m_iBullets != 0){m_strDescription . PrintF ("%s: Bullets (%d)" , m_strDescription , m_iBullets );}
|
|
#line 138 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(m_iRockets != 0){m_strDescription . PrintF ("%s: Rockets (%d)" , m_strDescription , m_iRockets );}
|
|
#line 139 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(m_iGrenades != 0){m_strDescription . PrintF ("%s: Grenades (%d)" , m_strDescription , m_iGrenades );}
|
|
#line 140 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(m_iNapalm != 0){m_strDescription . PrintF ("%s: Napalm (%d)" , m_strDescription , m_iNapalm );}
|
|
#line 141 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(m_iElectricity != 0){m_strDescription . PrintF ("%s: Electricity (%d)" , m_strDescription , m_iElectricity );}
|
|
#line 142 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(m_iIronBalls != 0){m_strDescription . PrintF ("%s: Iron balls (%d)" , m_strDescription , m_iIronBalls );}
|
|
#line 144 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(m_iSniperBullets != 0){m_strDescription . PrintF ("%s: Sniper bullets (%d)" , m_strDescription , m_iSniperBullets );}
|
|
#line 145 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
|
|
#line 147 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
void CAmmoPack::AdjustDifficulty(void)
|
|
#line 148 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
{
|
|
#line 151 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(GetSP () -> sp_bInfiniteAmmo && m_penTarget == NULL ){
|
|
#line 152 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
Destroy ();
|
|
#line 153 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
#line 154 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
BOOL CAmmoPack::
|
|
#line 157 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
ItemCollected(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CAmmoPack_ItemCollected
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EPass, "CAmmoPack::ItemCollected expects 'EPass' as input!"); const EPass &epass = (const EPass &)__eeInput;
|
|
#line 159 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
ASSERT (epass . penOther != NULL );
|
|
#line 162 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(GetSP () -> sp_bAmmoStays && ! (m_bPickupOnce || m_bRespawn )){
|
|
#line 164 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
BOOL bWasPicked = MarkPickedBy (epass . penOther );
|
|
#line 165 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(bWasPicked ){
|
|
#line 167 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 167 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
return TRUE;
|
|
#line 168 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
#line 169 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
#line 172 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
EAmmoPackItem eAmmo ;
|
|
#line 173 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
eAmmo . iShells = m_iShells ;
|
|
#line 174 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
eAmmo . iBullets = m_iBullets ;
|
|
#line 175 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
eAmmo . iRockets = m_iRockets ;
|
|
#line 176 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
eAmmo . iGrenades = m_iGrenades ;
|
|
#line 177 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
eAmmo . iNapalm = m_iNapalm ;
|
|
#line 178 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
eAmmo . iElectricity = m_iElectricity ;
|
|
#line 179 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
eAmmo . iIronBalls = m_iIronBalls ;
|
|
#line 181 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
eAmmo . iSniperBullets = m_iSniperBullets ;
|
|
#line 183 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(epass . penOther -> ReceiveItem (eAmmo )){
|
|
#line 185 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_soPick . Set3DParameters (50.0f , 1.0f , 1.0f , 1.0f);
|
|
#line 186 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
PlaySound (m_soPick , SOUND_PICK , SOF_3D );
|
|
#line 187 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_fPickSoundLen = GetSoundLength (SOUND_PICK );
|
|
#line 188 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
if(! GetSP () -> sp_bAmmoStays || (m_bPickupOnce || m_bRespawn )){
|
|
#line 189 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
Jump(STATE_CURRENT, STATE_CItem_ItemReceived, FALSE, EVoid());return TRUE;
|
|
#line 190 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
#line 191 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
}
|
|
#line 192 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
Return(STATE_CURRENT,EVoid());
|
|
#line 192 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
return TRUE; ASSERT(FALSE); return TRUE;};BOOL CAmmoPack::
|
|
#line 195 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
Main(const CEntityEvent &__eeInput) {
|
|
#undef STATE_CURRENT
|
|
#define STATE_CURRENT STATE_CAmmoPack_Main
|
|
ASSERTMSG(__eeInput.ee_slEvent==EVENTCODE_EVoid, "CAmmoPack::Main expects 'EVoid' as input!"); const EVoid &e = (const EVoid &)__eeInput;
|
|
#line 196 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iShells = Clamp (m_iShells , INDEX (0) , MAX_SHELLS );
|
|
#line 197 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iBullets = Clamp (m_iBullets , INDEX (0) , MAX_BULLETS );
|
|
#line 198 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iRockets = Clamp (m_iRockets , INDEX (0) , MAX_ROCKETS );
|
|
#line 199 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iGrenades = Clamp (m_iGrenades , INDEX (0) , MAX_GRENADES );
|
|
#line 200 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iNapalm = Clamp (m_iNapalm , INDEX (0) , MAX_NAPALM );
|
|
#line 201 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iElectricity = Clamp (m_iElectricity , INDEX (0) , MAX_ELECTRICITY );
|
|
#line 202 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iIronBalls = Clamp (m_iIronBalls , INDEX (0) , MAX_IRONBALLS );
|
|
#line 204 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
m_iSniperBullets = Clamp (m_iSniperBullets , INDEX (0) , MAX_SNIPERBULLETS );
|
|
#line 206 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
Initialize ();
|
|
#line 207 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
StartModelAnim (ITEMHOLDER_ANIM_MEDIUMOSCILATION , AOF_LOOPING | AOF_NORESTART );
|
|
#line 208 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
ForceCollisionBoxIndexChange (ITEMHOLDER_COLLISION_BOX_MEDIUM );
|
|
#line 209 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
SetProperties ();
|
|
#line 211 "D:/SE1_GPL/Sources/EntitiesMP/AmmoPack.es"
|
|
Jump(STATE_CURRENT, STATE_CItem_ItemLoop, FALSE, EVoid());return TRUE; ASSERT(FALSE); return TRUE;}; |