D:\ValheimDev\Dumps\Old\assembly_valheim\RandomEvent.cs D:\ValheimDev\Dumps\Latest\assembly_valheim\RandomEvent.cs
using System; using System;
using System.Collections.Generic; using System.Collections.Generic;
using UnityEngine; using UnityEngine;
   
[Serializable] [Serializable]
public class RandomEvent public class RandomEvent
{ {
    public RandomEvent Clone()     public RandomEvent Clone()
    {     {
        RandomEvent randomEvent = base.MemberwiseClone() as RandomEvent;         RandomEvent randomEvent = base.MemberwiseClone() as RandomEvent;
        randomEvent.m_spawn = new List<SpawnSystem.SpawnData>();         randomEvent.m_spawn = new List<SpawnSystem.SpawnData>();
        foreach (SpawnSystem.SpawnData spawnData in this.m_spawn)         foreach (SpawnSystem.SpawnData spawnData in this.m_spawn)
        {         {
            randomEvent.m_spawn.Add(spawnData.Clone());             randomEvent.m_spawn.Add(spawnData.Clone());
        }         }
        return randomEvent;         return randomEvent;
    }     }
   
    public bool Update(bool server, bool active, bool playerInArea, float dt)     public bool Update(bool server, bool active, bool playerInArea, float dt)
    {     {
        if (this.m_pauseIfNoPlayerInArea && !playerInArea)         if (this.m_pauseIfNoPlayerInArea && !playerInArea)
        {         {
            return false;             return false;
        }         }
        this.m_time += dt;         this.m_time += dt;
.        return this.m_duration > 0f && this.m_time > this.m_duration;         if (this.m_duration > 0f && this.m_time > this.m_duration) 
          { 
              return true;
          } 
          if (this.m_cameraShakeCurve.length > 0) 
          { 
              GameCamera.instance.AddShake(this.m_pos, this.m_eventRange, this.m_cameraShakeCurve.Evaluate(this.m_time), false); 
          } 
          return false; 
    }     }
   
    public void OnActivate()     public void OnActivate()
    {     {
        this.m_active = true;         this.m_active = true;
        if (this.m_firstActivation)         if (this.m_firstActivation)
        {         {
            this.m_firstActivation = false;             this.m_firstActivation = false;
            if (this.m_startMessage != "")             if (this.m_startMessage != "")
            {             {
                MessageHud.instance.ShowMessage(MessageHud.MessageType.Center, this.m_startMessage, 0, null);                 MessageHud.instance.ShowMessage(MessageHud.MessageType.Center, this.m_startMessage, 0, null);
            }             }
        }         }
    }     }
   
    public void OnDeactivate(bool end)     public void OnDeactivate(bool end)
    {     {
        this.m_active = false;         this.m_active = false;
        if (end && this.m_endMessage != "")         if (end && this.m_endMessage != "")
        {         {
            MessageHud.instance.ShowMessage(MessageHud.MessageType.Center, this.m_endMessage, 0, null);             MessageHud.instance.ShowMessage(MessageHud.MessageType.Center, this.m_endMessage, 0, null);
        }         }
    }     }
   
    public string GetHudText()     public string GetHudText()
    {     {
        return this.m_startMessage;         return this.m_startMessage;
    }     }
   
    public void OnStart()     public void OnStart()
    {     {
.          this.m_time = 0f;
    }     }
   
    public void OnStop()     public void OnStop()
    {     {
    }     }
   
    public bool InEventBiome()     public bool InEventBiome()
    {     {
        return (EnvMan.instance.GetCurrentBiome() & this.m_biome) > Heightmap.Biome.None;         return (EnvMan.instance.GetCurrentBiome() & this.m_biome) > Heightmap.Biome.None;
    }     }
   
    public float GetTime()     public float GetTime()
    {     {
        return this.m_time;         return this.m_time;
    }     }
   
    public override string ToString()     public override string ToString()
    {     {
        return string.Format("{0} {1}, enabled: {2}, random: {3}", new object[] { "RandomEvent", this.m_name, this.m_enabled, this.m_random });         return string.Format("{0} {1}, enabled: {2}, random: {3}", new object[] { "RandomEvent", this.m_name, this.m_enabled, this.m_random });
    }     }
   
    public string m_name = "";     public string m_name = "";
   
    public bool m_enabled = true;     public bool m_enabled = true;
   
.      public bool m_devDisabled;
   
    public bool m_random = true;     public bool m_random = true;
   
    public float m_duration = 60f;     public float m_duration = 60f;
   
    public bool m_nearBaseOnly = true;     public bool m_nearBaseOnly = true;
   
    public bool m_pauseIfNoPlayerInArea = true;     public bool m_pauseIfNoPlayerInArea = true;
.   
      public float m_eventRange = 96f;
   
      public float m_standaloneInterval;
   
      public float m_standaloneChance = 100f;
   
      public float m_spawnerDelay;
   
      public AnimationCurve m_cameraShakeCurve = new AnimationCurve
      {
          postWrapMode = WrapMode.Once,
          preWrapMode = WrapMode.Once
      };
   
    [BitMask(typeof(Heightmap.Biome))]     [BitMask(typeof(Heightmap.Biome))]
    public Heightmap.Biome m_biome;     public Heightmap.Biome m_biome;
   
    [Header("( Keys required to be TRUE )")]     [Header("( Keys required to be TRUE )")]
    public List<string> m_requiredGlobalKeys = new List<string>();     public List<string> m_requiredGlobalKeys = new List<string>();
   
    [global::Tooltip("If PlayerEvents is set, instead only spawn this event at players know who at least one of each item on each list (or player key below).")]     [global::Tooltip("If PlayerEvents is set, instead only spawn this event at players know who at least one of each item on each list (or player key below).")]
    public List<ItemDrop> m_altRequiredKnownItems = new List<ItemDrop>();     public List<ItemDrop> m_altRequiredKnownItems = new List<ItemDrop>();
   
    [global::Tooltip("If PlayerEvents is set, instead only spawn this event at players know who have any of these keys set (or any known items above).")]     [global::Tooltip("If PlayerEvents is set, instead only spawn this event at players know who have any of these keys set (or any known items above).")]
    public List<string> m_altRequiredPlayerKeysAny = new List<string>();     public List<string> m_altRequiredPlayerKeysAny = new List<string>();
   
    [Header("( Keys required to be FALSE )")]     [Header("( Keys required to be FALSE )")]
    public List<string> m_notRequiredGlobalKeys = new List<string>();     public List<string> m_notRequiredGlobalKeys = new List<string>();
   
    [global::Tooltip("If PlayerEvents is set, instead require ALL of the items to be unknown on this list for a player to be able to get that event. (And below not known player keys)")]     [global::Tooltip("If PlayerEvents is set, instead require ALL of the items to be unknown on this list for a player to be able to get that event. (And below not known player keys)")]
    public List<ItemDrop> m_altRequiredNotKnownItems = new List<ItemDrop>();     public List<ItemDrop> m_altRequiredNotKnownItems = new List<ItemDrop>();
   
    [global::Tooltip("If PlayerEvents is set, instead require ALL of the playerkeys to be unknown on this list for a player to be able to get that event. (And above not known items)")]     [global::Tooltip("If PlayerEvents is set, instead require ALL of the playerkeys to be unknown on this list for a player to be able to get that event. (And above not known items)")]
    public List<string> m_altNotRequiredPlayerKeys = new List<string>();     public List<string> m_altNotRequiredPlayerKeys = new List<string>();
   
    [Space(20f)]     [Space(20f)]
    public string m_startMessage = "";     public string m_startMessage = "";
   
    public string m_endMessage = "";     public string m_endMessage = "";
   
    public string m_forceMusic = "";     public string m_forceMusic = "";
   
    public string m_forceEnvironment = "";     public string m_forceEnvironment = "";
   
    public List<SpawnSystem.SpawnData> m_spawn = new List<SpawnSystem.SpawnData>();     public List<SpawnSystem.SpawnData> m_spawn = new List<SpawnSystem.SpawnData>();
   
    private bool m_firstActivation = true;     private bool m_firstActivation = true;
   
    private bool m_active;     private bool m_active;
   
    [NonSerialized]     [NonSerialized]
    public float m_time;     public float m_time;
   
    [NonSerialized]     [NonSerialized]
    public Vector3 m_pos = Vector3.zero;     public Vector3 m_pos = Vector3.zero;
} }