//DOT //regenerator doing damage => has negative stats[0] public float Init(HitMe _hitme, float[] stats, RegeneratorType _type, Firearm firearm, int level) { repeat_rate = Get.regenerator_repeat_rate; heal_duration = -1; type = _type; my_hitme = _hitme; effect_type = EffectType.DOT; //if (_towerID != 0 && towerID != _towerID) //{ // towerID = _towerID; //my_firearm = getFirearm(towerID); // } my_firearm = firearm; monsters = null; this.level = level; duration = stats[1]; EnableVisuals(_hitme, duration); TIME = 0f; if (is_active) { if (my_lava != null) { my_lava.lifespan = duration; } return(0f); } float finisher_percent = (stats.Length == StaticStat.StatLength(EffectType.DOT, true)) ? stats[3] : 0; if (finisher_percent > 0 && UnityEngine.Random.RandomRange(0, 1) < finisher_percent) { // SetEverythingOnFire(stats); // Debug.Log("Fin\n"); } total_time = duration + .1f; // this isn only intended for 1 time use, not repeating period = -1; rate = Get.getRegeneratorModRate(repeat_rate, stats[0], duration); type = _type; done_for_good = false; is_active = true; am_doing_stuff = false; first_invoke = true; // Debug.Log("initializing regenerator total time " + total_time + " duration " + duration + " rate " + rate // + " repeat_rate " + repeat_rate + " stat " + stats[0] + "\n"); return(0); }
void Start() { if (auto_run) { done_for_good = false; } if (duration > period) { period = -1; //duration = -1; } //lol what heal_duration = -1; if (type != RegeneratorType.Self && range <= 0) { type = RegeneratorType.Self; } repeat_rate = Get.regenerator_repeat_rate; }