Example #1
0
    public int GetDamage(AttackAttrib attackedAttrib)
    {
        int addAttack = GetAddAttack(attrib, attackedAttrib);

        if (addAttack == 1)
        {
            damage *= 2;
        }
        else if (addAttack == -1)
        {
            damage = Mathf.FloorToInt((float)damage * 0.5f);
        }

        return(damage);
    }
Example #2
0
    // -1 : 데미지 감소 | 0 : 데미지 유지 | 1 : 추가 데미지
    int GetAddAttack(AttackAttrib my, AttackAttrib your)
    {
        switch (my)
        {
        case AttackAttrib.Fire:
            if (your == AttackAttrib.Wind)
            {
                return(1);
            }
            else if (your == AttackAttrib.Water)
            {
                return(-1);
            }
            return(0);

        case AttackAttrib.Water:
            if (your == AttackAttrib.Fire)
            {
                return(1);
            }
            else if (your == AttackAttrib.Wind)
            {
                return(-1);
            }
            return(0);

        case AttackAttrib.Wind:
            if (your == AttackAttrib.Water)
            {
                return(1);
            }
            else if (your == AttackAttrib.Fire)
            {
                return(-1);
            }
            return(0);

        default:
            return(0);
        }
    }
Example #3
0
 public AttackInfo(AttackAttrib attrib, int damage)
 {
     this.attrib = attrib;
     this.damage = damage;
 }