public void ModifyHealth(EffectHitInfo hitInfo) { if (!hitInfo.isHit) { return; } if (hitInfo.hitType == HitType.Heal) { currentHealth += hitInfo.hitValue; } if (hitInfo.hitType == HitType.Hit) { currentHealth -= hitInfo.hitValue; } if (CurrentHealth > MaxHealth) { CurrentHealth = MaxHealth; } if (CurrentHealth <= 0) { character.Die(); } character.onHealthChange(); }
public void SetupStatus(ICharacter unit, EffectHitInfo hitInfo, int duration, int modifier, Dice dice) { this.target = unit; this.duration = duration; this.dice = dice; this.modifier = modifier; this.hitInfo = hitInfo; }
public StatusEffect(ICharacter target, EffectHitInfo hitInfo, int duration, StatusType type, int modifier) { this.target = target; this.duration = duration; this.modifier = modifier; this.type = type; this.hitInfo = hitInfo; }
public override void ApplyEffect() { base.ApplyEffect(); hitInfo = new EffectHitInfo(0, new HitRoll(true, false), HitType.Hit); hitInfo.hitValue = dice.RollDice() + modifier; //Deal damage target.OnEffectOverTime(this); Debug.Log("Bleed damage!" + hitInfo.hitValue + " Duration left: " + duration); }
public void OnHit(EffectHitInfo hitInfo) { string value = hitInfo.hitValue.ToString(); CBTCrit.enabled = hitInfo.isCrit; if (!hitInfo.isHit) { value = "Miss"; CBTText.color = CBTColor[2]; CBTText.text = value; TriggerCBT(); return; } switch (hitInfo.hitType) { case HitType.Hit: CBTText.color = CBTColor[0]; break; case HitType.Heal: CBTText.color = CBTColor[1]; break; case HitType.DoT: Debug.Log("Dot Applied"); /* if(bleed) { * CBTText.color * }*/ /*if(poison) { * CBTText.color * * }*/ break; case HitType.HoT: // CBTText.color = CBTColor[4]; break; default: value = hitInfo.hitValue.ToString(); break; } CBTText.text = value; CBTCrit.color = CBTText.color; TriggerCBT(); }
/// <summary> /// The effect /// </summary> /// <param name="ability"></param> /// <param name="target"></param> public virtual void ApplyEffect(Ability ability, ICharacter target) { int effectValue = 0; effectValue = AbilityUtilities.EffectRoll(ability, this); if (ability.rollInfo.wasCrit) { effectValue = effectValue * 2; } hitInfo = new EffectHitInfo(effectValue, ability.rollInfo, hitType); target.ApplyEffect(this); }
public BleedStatus(ICharacter target, int duration, int modifier) : base(target, duration, modifier) { hitInfo = new EffectHitInfo(0, new HitRoll(true, false), HitType.Hit); }
public void OnHit(EffectHitInfo hitInfo) { CBT.OnHit(hitInfo); }