3 const string RINGING_SOUND =
"KitchenTimer_Ring_Loop_SoundSet";
4 const string DESTROYED_SOUND =
"AlarmClock_Destroyed_SoundSet";
5 const string HIT_SOUND =
"AlarmClock_Hit_SoundSet";
6 const string WORKING_SOUND =
"KitchenTimer_Ticking_Loop_SoundSet";
20 m_NoiseSystem =
g_Game.GetNoiseSystem();
21 if ( m_NoiseSystem && !m_NoisePar)
25 m_NoisePar.LoadFromPath(
"cfgVehicles " +
GetType() +
" NoiseKitchenTimer");
38 override string GetExplosiveTriggerSlotName()
40 return "TriggerKitchenTimer";
53 string GetRingingStopSound()
55 return "KitchenTimer_Ring_End_SoundSet";
60 return DESTROYED_SOUND;
78 int Time01ToSeconds(
float time01)
80 return Math.Lerp(0,GetMinutesMax() * 60, time01);
84 float SecondsTo01(
int seconds)
86 return Math.InverseLerp(0,GetMinutesMax() * 60, seconds);
102 if (m_AlarmInSecs > 0)
104 m_AlarmInSecs -= UPDATE_TICK_RATE;
105 float time01 = SecondsTo01(m_AlarmInSecs);
106 SetAnimationPhaseNow(
"ClockAlarm", time01);
125 else if (m_NoiseSystem)
141 PlaySoundSet(m_RingingStopSound, GetRingingStopSound(), 0, 0);
143 super.OnRingingStopClient();
149 if (!super.OnStoreLoad(ctx, version))
159 if (!ctx.Read(state))
186 super.OnStoreSave(ctx);
189 ctx.Write(m_AlarmInSecs);
200 SetAnimationPhaseNow(
"ClockAlarm", time01);
201 m_AlarmInSecs = Time01ToSeconds(time01);
203 if (m_AlarmInSecs > 0)
224 super.GetDebugActions(outputList);
229 if (super.OnAction(action_id, player, ctx))
234 if (action_id ==
EActions.ALARM_SET_AHEAD)
246 if (
g_Game.IsDedicatedServer())
248 debug_output =
"alarm in: " + m_AlarmInSecs.ToString() +
" secs" +
"\n";
255 debug_output =
"this is client";
Param4< int, int, string, int > TSelectableActionInfoWithColor
eBleedingSourceType GetType()
ActionResetKitchenTimerClockCB ActionSingleUseBaseCB ActionResetKitchenTimer()
void AddAction(typename actionName)
Wrapper class for managing sound through SEffectManager.
override void SetAlarmTimeServer(float time01)
override string GetDebugText()
void SetAlarmTimeServerSecs(int inSecs)
override bool OnAction(int action_id, Man player, ParamsReadContext ctx)
override void OnStoreSave(ParamsWriteContext ctx)
void OnRingingStopClient()
override void GetDebugActions(out TSelectableActionInfoArrayEx outputList)
override bool OnStoreLoad(ParamsReadContext ctx, int version)
Manager class for managing Effect (EffectParticle, EffectSound).
static void DestroyEffect(Effect effect)
Unregisters, stops and frees the Effect.
EffectSound m_WorkingSound
float GetRingingDurationMax()
EffectSound m_RingingSoundLoop
string GetDestroyedSound()
Serializer ParamsReadContext
Serializer ParamsWriteContext
const int SAT_DEBUG_ACTION
vector GetPosition()
Get the world position of the Effect.
class NoiseSystem NoiseParams()
enum EObjectTemperatureState m_State
void SetState(bool state)