4 override protected void Init()
7 m_SoundSet =
"SpookyArea_WhistlingWind_SoundSet";
12 return player.IsSoundInsideBuilding();
23 override protected void Init()
26 m_SoundSet =
"SpookyArea_Whispering_SoundSet";
38 override protected void Init()
41 m_SoundSet =
"SpookyArea_RunOnConcrete_SoundSet";
42 m_Surfaces = {
"stone",
"gravel",
"concrete",
"wood",
"asphalt",
"tiles",
"textile"};
53 override protected void Init()
56 m_SoundSet =
"SpookyArea_IntenseFoliageRustle_SoundSet";
57 m_Surfaces = {
"grass",
"dirt",
"forest",
"soil"};
62 return !player.IsSoundInsideBuilding();
69 string secondarySoundSet =
"SpookyArea_Hedgehog_SoundSet";
71 if (
Math.RandomBool())
73 secondarySoundSet =
"SpookyArea_Badger_Voice_SoundSet";
106 for (
int i = 0; i < gatheredSurfaces.Count(); i++)
108 string currSurface = gatheredSurfaces.GetKey(i);
109 foreach (
string s:surfaces)
111 if (currSurface.Contains(s))
112 return gatheredSurfaces.Get(currSurface);
139 bool surfaceCheckResult = 1;
154 #ifdef DIAG_DEVELOPER
156 Print(
"Performing " +
this);
166 #ifdef DIAG_DEVELOPER
185 float distance =
Math.RandomFloatInclusive(5,15);
187 vector playerPos = player.GetPosition();
188 soundPos = playerPos + randomDir;
233 void Update(
float deltaTime)
248 gatheredGurfaces.Clear();
253 positions.Insert(playerPos);
259 foreach (
vector pos : positions)
264 if (!gatheredGurfaces.Contains(surfaceType))
265 gatheredGurfaces.Insert(surfaceType, pos);
268 #ifdef DIAG_DEVELOPER
271 foreach (
vector p:positions)
283 #ifdef DIAG_DEVELOPER
286 for(
int i = 0; i < gatheredSurfaces.Count(); i++)
288 Print(gatheredSurfaces.GetKey(i));
289 Print(gatheredSurfaces.Get(gatheredSurfaces.GetKey(i)));
292 Print(
"--------------------------------------------------------------------");
300 if (spookyEvent.CanPerform(
m_Player, currentTime, gatheredSurfaces))
301 validEvents.Insert(spookyEvent);
307 if (validEvents.Count() > 0)
309 int randIndex =
Math.RandomIntInclusive(0, validEvents.Count() - 1);
310 selectedEvent = validEvents[randIndex];
proto float SurfaceGetType3D(float x, float y, float z, out string type)
Y input: Maximum Y to trace down from; Returns: Y position the surface was found.
proto int GetTime()
returns mission time in milliseconds
Wrapper class for managing sound through SEffectManager.
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Manager class for managing Effect (EffectParticle, EffectSound)
static EffectSound PlaySound(string sound_set, vector position, float play_fade_in=0, float stop_fade_out=0, bool loop=false)
Create and play an EffectSound.
bool CanDo(PlayerBase player, TStringVectorMap surfaceTypes)
bool CanPerform(PlayerBase player, float currentTime, TStringVectorMap surfaceTypes)
void Do(PlayerBase player)
ref TStringArray m_Surfaces
vector GetSoundPos(PlayerBase player)
vector m_MatchingSurfacePos
vector GetMatchingSurfacePos(TStringArray surfaces, TStringVectorMap gatheredSurfaces)
void SetCoolDown(float secs)
void Perform(PlayerBase player, float currentTime, TStringVectorMap gatheredSurfaces)
float m_PerformedTimestamp
void Do(PlayerBase player)
bool CanDo(PlayerBase player, TStringVectorMap surfaceTypes)
void Do(PlayerBase player)
this entity gets attached to each player while present in the spooky area
ref UniversalTemperatureSourceSettings m_UTSSettings
ref UniversalTemperatureSource m_UTSource
ref UniversalTemperatureSourceLambdaConstant m_UTSLConstant
original Timer deletes m_params which is unwanted
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
map< string, vector > TStringVectorMap
array< vector > TVectorArray
const float SURFACE_CHECK_POINT_DISTANCE
const float FIRST_EVENT_CHECK_DELAY
const float EVENT_CHECK_FREQUENCY
void GatherSurfaces(notnull TStringVectorMap gatheredGurfaces)
void ~SpookyTriggerEventsHandler()
class SpookyEventBase m_SoundEvents
const float CONSECUTIVE_EVENTS_COOLDOWN
void SpookyTriggerEventsHandler(notnull PlayerBase player)