TakeDamage() 공개 추상적인 메소드

public abstract TakeDamage ( byte damage, bool applyArmor, bool applyDefenceAction ) : void
damage byte
applyArmor bool
applyDefenceAction bool
리턴 void
예제 #1
0
        public void Execute(LivingBeing actor, LivingBeing target)
        {
            int damage = GodOfRandom.NumberBetween(_minDamage, _maxDamage);

            if (damage == 0)
            {
                ReportResult($"{actor.Name} missed");
            }
            else
            {
                ReportResult($"{actor.Name} hit {target.Name} for {damage}");
                target.TakeDamage(damage);
            }
        }
예제 #2
0
    void Attack(LivingBeing target, float damage, float accuracy)
    {
        if (Random.value < accuracy)
            target.TakeDamage((byte)damage, true, true);
        else
            EventManager.OnAttackMiss(transform.position);
        RemainingMoves = 0;
        MakingTurn = false;
        EventManager.OnBluesUnrender();
        EventManager.OnLivingBeingEndTurn();

        GetComponent<SpriteRenderer>().sprite = FightingSprite;
    }