public StatusEffect() { ID = Guid.NewGuid().ToString(); Effect = new TimedPassiveEffect(); Name = "New Status Effect"; DamageOverTime = new DamageOverTime(); CauseSilence = CauseStun = CauseAnimationFreeze = false; Image = new ImageContainer(); HasSkillMeta = false; }
//todo: public DamageOutcome TakeDoTDamage(BaseCharacter attacker, DamageOverTime dot) { var dotDamage = GeneralMethods.CopyObject(dot); dotDamage.DamagePerTick.SkillMetaID = dotDamage.SkillMetaID; if (attacker != null) { var outcome = TakeDamage(attacker, dotDamage.DamagePerTick); return(outcome); } //todo: test a dot with no attacker var outcomex = TakeDamage(null, dotDamage.DamagePerTick, false); Debug.Log(Character.Name + " took " + outcomex.DamageDealt + " from " + dot.DoTName); return(outcomex); }
public void AddDoT(DamageOverTime damageOverTime) { damageOverTime.HasDuration = true; damageOverTime.InstanceID = Guid.NewGuid().ToString(); if (!string.IsNullOrEmpty(damageOverTime.OnActivatePrefab)) { var o = SpawnPrefab(damageOverTime.OnActivatePrefab, CharacterMono.transform.position, Quaternion.identity, CharacterMono.transform); o.GetComponent <DestroyHelper>().Init(DestroyCondition.Time, ImpactPrefabTime); } if (!string.IsNullOrEmpty(damageOverTime.ActivePrefab)) { var o = SpawnPrefab(damageOverTime.ActivePrefab, CharacterMono.transform.position, Quaternion.identity, CharacterMono.transform); o.GetComponent <DestroyHelper>().Init(DestroyCondition.Time, damageOverTime.Duration); var secondCondition = o.AddComponent <DestroyHelper>(); secondCondition.Init(DestroyCondition.DoTNotActive, CharacterMono.Controller, damageOverTime.InstanceID); } CurrentDoTs.Add(damageOverTime); FullUpdateStats(); }