17 private string m_CreatureType;
18 private int m_CreatureHash = 0;
20 private const vector CAPTURE_VELOCITY = { 0, 0, 0 };
24 private float m_ParScale = 1;
25 private const float PARTICLE_SCALE_MULT = 0.1;
42 RegisterNetSyncVariableInt(
"m_CaptureState", 0,
eCaptureState.END );
43 RegisterNetSyncVariableInt(
"m_CreatureHash", 0, 0 );
44 RegisterNetSyncVariableFloat(
"m_ParScale", 0, 0, 0.1 );
45 RegisterNetSyncVariableBool(
"m_DangerSound" );
46 RegisterNetSyncVariableInt(
"m_CaptureSoundHash", 0, 0 );
47 RegisterNetSyncVariableInt(
"m_ReleaseSoundHash", 0, 0 );
49 RegisterSoundSetMap();
63 switch ( m_CaptureState )
67 if ( capAnimal && capAnimal.IsAlive() )
86 if ( m_CreatureHash != 0 )
121 if ( player_PB && player_PB.GetThrowing().IsThrowingAnimationPlaying() )
123 if ( m_CreatureType !=
"" )
149 super.EEItemLocationChanged(oldLoc, newLoc);
169 m_CreatureHash = m_CreatureType.Hash();
176 ResizeParticle( capAnimal );
185 private void Release(
vector pos )
193 GetGame().CreateObject( m_CreatureType, pos,
false,
true );
196 DecreaseHealth(
"",
"", GetMaxHealth() * 0.4 );
212 private void PlayVFX()
214 if ( !
GetGame().IsDedicatedServer() )
232 capAnimal.GetWorldBounds( mins, maxs );
233 m_ParScale =
vector.DistanceSq( mins, maxs );
236 m_ParScale *= PARTICLE_SCALE_MULT;
239 private void PlaySFX(
int releaseCase =
eCaptureState.CAPTURE )
241 if ( !
GetGame().IsDedicatedServer() )
243 string soundSet =
"";
262 PlaySoundSet(
m_CaptureSound,
"EasterEgg_Spawn_Danger_SoundSet", 0, 0 );
289 void RegisterSoundSetMap()
296 soundSet =
"CattleMooA_SoundSet";
298 soundSet =
"CattleBellow_SoundSet";
302 soundSet =
"DeerRoar_SoundSet";
304 soundSet =
"DeerBleat_SoundSet";
308 soundSet =
"GoatBleat_A_SoundSet";
310 soundSet =
"GoatBleat_B_SoundSet";
314 soundSet =
"HareChirp_SoundSet";
316 soundSet =
"HareSquawk_SoundSet";
320 soundSet =
"HenCluck_X_SoundSet";
322 soundSet =
"HenScream_SoundSet";
326 soundSet =
"HogGrunt_G_SoundSet";
328 soundSet =
"HogSqueal_SoundSet";
332 soundSet =
"SheepBleat_G_SoundSet";
334 soundSet =
"SheepBleat_E_SoundSet";
338 soundSet =
"WolfBark_SoundSet";
340 soundSet =
"WolfWhimper_SoundSet";
344 soundSet =
"ZmbF_Normal_CallToArmsShort_Soundset";
346 soundSet =
"ZmbF_Normal_HeavyHit_Soundset";
350 soundSet =
"ZmbM_Normal_CallToArmsShort_Soundset";
352 soundSet =
"ZmbM_Normal_HeavyHit_Soundset";
356 soundSet =
"BearRoarShort_SoundSet";
358 soundSet =
"BearSnarl_SoundSet";
368 super.OnStoreSave( ctx );
370 ctx.Write( m_CaptureState );
371 ctx.Write( m_CreatureType );
372 ctx.Write( m_ParScale );
380 if ( !super.OnStoreLoad( ctx, version ) )
383 if ( !ctx.Read( m_CaptureState ) )
386 if ( !ctx.Read( m_CreatureType ) )
389 if ( !ctx.Read( m_ParScale ) )
405 private void DestroyEg()
do not process rotations !
Wrapper class for managing sound through SEffectManager.
override bool OnStoreLoad(ParamsReadContext ctx, int version)
override void OnVariablesSynchronized()
override void OnStoreSave(ParamsWriteContext ctx)
override void EEItemLocationChanged(notnull InventoryLocation oldLoc, notnull InventoryLocation newLoc)
Legacy way of using particles in the game.
static Particle PlayInWorld(int particle_id, vector global_pos)
Creates a particle emitter on the given position and activates it.
void Stop()
Legacy function for backwards compatibility with 1.14 and below.
Serialization general interface. Serializer API works with:
EffectSound m_CreatureSound
override void EOnTouch(IEntity other, int extra)
void ContactEvent(IEntity other, vector pos)
ref map< int, string > m_CreatureSoundMap
enum eCaptureState m_StoredCreature
EffectSound m_CaptureSound
proto native CGame GetGame()
proto native void SetFlags(ShapeFlags flags)
EntityEvent
Entity events for event-mask, or throwing event from code.
proto native void SetVelocity(notnull IEntity ent, vector vel)
Sets linear velocity (for Rigid bodies)
class JsonUndergroundAreaTriggerData GetPosition
override bool SetQuantity(float value, bool destroy_config=true, bool destroy_forced=false, bool allow_client=false, bool clamp_to_stack_max=true)
Set item quantity[related to varQuantity... config entry], destroy_config = true > if the quantity re...
void OnInventoryEnter(Man player)
Event called on item when it is placed in the player(Man) inventory, passes the owner as a parameter.
override int GetQuantityMin()
void OnInventoryExit(Man player)
Event called on item when it is removed from the player(Man) inventory, passes the old owner as a par...
override int GetQuantityMax()
void ParticleManager(ParticleManagerSettings settings)
Constructor (ctor)