public override int OnTakeDamage(int damages) { if (IsApplyingEffect()) { EffectDuration = 0; CharacterBhv.Instantiator.NewEffect(InventoryItemType.Skill, CharacterBhv.transform.position, null, EffectId, Constants.GridMax - CharacterBhv.Y); CharacterBhv.LoseSkillEffect(Effect); return(0); } return(damages); }
public override int OnTakeDamage(int damages) { if (IsApplyingEffect()) { if (Helper.IsPosValid(_currentTargetX, _currentTargetX) && !GridBhv.IsOpponentOnCell(_currentTargetX, _currentTargetY, true, true)) { CharacterBhv.MoveToPosition(_currentTargetX, _currentTargetY, false); CharacterBhv.Instantiator.NewEffect(InventoryItemType.Skill, GridBhv.Cells[_currentTargetX, _currentTargetY].transform.position, null, EffectId, Constants.GridMax - _currentTargetY); } EffectDuration = 0; CharacterBhv.LoseSkillEffect(Effect); return(0); } return(damages); }
public virtual void OnStartTurn() { if ((CooldownType == CooldownType.Normal && IsUnderCooldown()) || (CooldownType == CooldownType.OnceAFight && IsUnderCooldown())) { --Cooldown; } if (Effect != SkillEffect.None) { --EffectDuration; if (ShouldLoseSkillEffect()) { CharacterBhv.LoseSkillEffect(Effect); } } }