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 =
GetGame().GetNoiseSystem();
30 override void SetActions()
38 override string GetExplosiveTriggerSlotName()
40 return "TriggerKitchenTimer";
43 override string GetToggleSound()
48 override string GetRingingSound()
53 string GetRingingStopSound()
55 return "KitchenTimer_Ring_End_SoundSet";
58 override string GetDestroyedSound()
60 return DESTROYED_SOUND;
63 override string GetHitSound()
68 override string GetWorkingSound()
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);
89 override float GetRingingDurationMax()
94 override void TurnOff()
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 (
GetGame().IsDedicatedServer())
248 debug_output =
"alarm in: " + m_AlarmInSecs.ToString() +
" secs" +
"\n";
251 debug_output +=
"ringing max " + GetRingingDurationMax().ToString()+
" secs" +
"\n";
255 debug_output =
"this is client";
Param4< int, int, string, int > TSelectableActionInfoWithColor
eBleedingSourceType GetType()
ref NoiseParams m_NoisePar
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.
Serialization general interface. Serializer API works with:
EffectSound m_WorkingSound
EffectSound m_RingingSoundLoop
proto native CGame GetGame()
const int SAT_DEBUG_ACTION
class JsonUndergroundAreaTriggerData GetPosition
class NoiseSystem NoiseParams()
enum EObjectTemperatureState m_State
void SetState(bool state)