nickmattinson / ZXYZ

Top-Down 2D Dungeon Crawler
1 stars 0 forks source link

EntityDefenseAttackMax #72

Closed MikeMMattinson closed 5 months ago

MikeMMattinson commented 5 months ago

defense 15 attack 20

git fetch origin
git checkout 72-entitydefenseattackmax
MikeMMattinson commented 5 months ago

image

MikeMMattinson commented 5 months ago
    public void AttackUp(int increase = 1, int max = 20){
        SetAttack(Mathf.Min(GetAttack()+increase, max));
    }

    public void SetDefense(int defense)
    {
        this.defense = defense;
    }

    public int GetDefense()
    {
        return defense;
    }

    public void DefenseUp(int increase = 1, int max = 15){
        SetDefense(Mathf.Min(GetDefense()+increase, max));        
    }