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();
67 vector soundPos = GetSoundPos(player);
69 string secondarySoundSet =
"SpookyArea_Hedgehog_SoundSet";
71 if (
Math.RandomBool())
73 secondarySoundSet =
"SpookyArea_Badger_Voice_SoundSet";
77 sound.SetAutodestroy(
true );
89 protected float m_PerformedTimestamp;
90 protected int m_Cooldown;
92 protected string m_SoundSet;
94 protected vector m_MatchingSurfacePos;
101 protected void Init();
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);
119 protected void SetCoolDown(
float secs)
124 protected bool HasSurfaces()
126 return (m_Surfaces && m_Surfaces.Count() > 0);
139 bool surfaceCheckResult = 1;
143 m_MatchingSurfacePos = GetMatchingSurfacePos(m_Surfaces, surfaceTypes);
144 surfaceCheckResult = m_MatchingSurfacePos !=
vector.Zero;
148 return ( currentTime > (m_PerformedTimestamp +
m_Cooldown) && surfaceCheckResult && CanDo(player, surfaceTypes) );
154 #ifdef DIAG_DEVELOPER
156 Print(
"Performing " +
this);
158 m_PerformedTimestamp = currentTime;
162 vector soundPos = GetSoundPos(player);
164 sound.SetAutodestroy(
true );
166 #ifdef DIAG_DEVELOPER
181 soundPos = m_MatchingSurfacePos;
185 float distance =
Math.RandomFloatInclusive(5,15);
187 vector playerPos = player.GetPosition();
188 soundPos = playerPos + randomDir;
248 gatheredGurfaces.Clear();
253 positions.Insert(playerPos);
259 foreach (
vector pos : positions)
262 GetGame().SurfaceGetType3D(pos[0],pos[1], pos[2], surfaceType);
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(
"--------------------------------------------------------------------");
297 float currentTime =
GetGame().GetTime();
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];
314 selectedEvent.Perform(
m_Player, currentTime, gatheredSurfaces);
329 protected ref UniversalTemperatureSourceLambdaConstant m_UTSLConstant;
332 override void EEInit()
348 m_UTSLConstant =
new UniversalTemperatureSourceLambdaConstant();