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";
29 override protected void Do(PlayerBase player)
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();
65 override protected void Do(PlayerBase player)
69 string secondarySoundSet =
"SpookyArea_Hedgehog_SoundSet";
71 if (Math.RandomBool())
73 secondarySoundSet =
"SpookyArea_Badger_Voice_SoundSet";
76 EffectSound sound = SEffectManager.PlaySound(secondarySoundSet, soundPos);
106 for (
int i = 0; i < gatheredSurfaces.Count(); i++)
108 string currSurface = gatheredSurfaces.GetKey(i);
109 foreach (
string s:surfaces)
112 return gatheredSurfaces.Get(currSurface);
139 bool surfaceCheckResult = 1;
154 #ifdef DIAG_DEVELOPER
156 Print(
"Performing " +
this);
166 #ifdef DIAG_DEVELOPER
187 vector playerPos = player.GetPosition();
188 soundPos = playerPos + randomDir;
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)
310 selectedEvent = validEvents[randIndex];
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)
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
static Shape DrawSphere(vector pos, float size=1, int color=0x1fff7f7f, ShapeFlags flags=ShapeFlags.TRANSP|ShapeFlags.NOOUTLINE)
static Shape DrawLine(vector from, vector to, int color=0xFFFFFFFF, int flags=0)
override void SetAutodestroy(bool auto_destroy)
Sets whether Effect automatically cleans up when it stops.
Wrapper class for managing sound through SEffectManager.
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.
Manager class for managing Effect (EffectParticle, 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)
ref UniversalTemperatureSourceSettings m_UTSSettings
ref UniversalTemperatureSource m_UTSource
ref UniversalTemperatureSourceLambdaConstant m_UTSLConstant
this entity gets attached to each player while present in the spooky area
original Timer deletes m_params which is unwanted
Result for an object found in CGame.IsBoxCollidingGeometryProxy.
static vector RandomDir2D()
Returns randomly generated XZ unit vector with the Y(up) axis set to 0.
proto native CGame GetGame()
proto void Print(void var)
Prints content of variable to console/log.
array< string > TStringArray
map< string, vector > TStringVectorMap
array< vector > TVectorArray
static float RandomFloatInclusive(float min, float max)
Returns a random float number between and min [inclusive] and max [inclusive].
static int RandomIntInclusive(int min, int max)
Returns a random int number between and min [inclusive] and max [inclusive].
bool Contains(string sample)
Returns true if sample is substring of string.