Exemplo n.º 1
0
        public AttackSkill(string[] datas)
        {
            ID           = int.Parse(datas [0]);
            NAME         = datas [1];
            LEVEL        = int.Parse(datas[2]);
            atk          = int.Parse(datas [3]);
            RAW_ATK      = atk;
            RANGE        = int.Parse(datas [4]);
            hit          = int.Parse(datas [5]);
            RAW_HIT      = hit;
            delay        = float.Parse(datas [6]);
            RAW_DELAY    = delay;
            cost         = int.Parse(datas[7]);
            RAW_COST     = cost;
            DEPEND_ATK   = (datas[8] == "TRUE");
            DEPEND_HIT   = (datas [9] == "TRUE");
            DEPEND_RANGE = (datas [10] == "TRUE");
            DEPEND_DELAY = (datas[11] == "TRUE");
            ATTRIBUTE    = (AttackSkillAttribute)Enum.Parse(typeof(AttackSkillAttribute), datas[12]);

            if (datas[13] == "DEPEND")
            {
                DEPEND_ABILITY = true;
            }
            else
            {
                USE_ABILITY = (BattleAbility)Enum.Parse(typeof(BattleAbility), datas [13]);
            }

            EXTENT      = (Extent)Enum.Parse(typeof(Extent), datas[14]);
            DESCRIPTON  = datas [15];
            FLAVOR_TEXT = datas[16];

            observer = new AttackSkillObserver(ID);
        }
Exemplo n.º 2
0
    private bool judgeResistanceProsessed(AttackSkillAttribute attribute)
    {
        float probalityValue = (dammagedAttributeTimes[attribute] + killedNumber) / 2;
        float probality      = probalityValue / (50 * (observeEnemyBuilder.getLevel() / 3 + 1));
        float probalityRand  = Random.Range(0, 100);

        return(probality >= probalityRand);
    }
Exemplo n.º 3
0
    private float progressResistance(AttackSkillAttribute attribute)
    {
        float randAbs  = dammagedAttributeTimes[attribute] / 3;
        float rand     = Random.Range(-randAbs, randAbs);
        float progress = dammagedAttributeTimes[attribute] + rand / (20 * (observeEnemyBuilder.getLevel() / 3));

        progress = (progress < 0.05f) ? progress : 0.05f;
        return(progress);
    }
Exemplo n.º 4
0
        public int getAtk(AttackSkillAttribute attribute, BattleAbility useAbility, bool useWepon)
        {
            int atk = battleAbilities [useAbility] + UnityEngine.Random.Range(0, level);

            if (useWepon && weapon != null)
            {
                atk += this.weapon.attackWith();
            }
            return(atk);
        }
Exemplo n.º 5
0
        public int getAtk(AttackSkillAttribute attribute, BattleAbility useAbility, bool useWepon)
        {
            int atk = getAbilityContainsBonus(useAbility) + UnityEngine.Random.Range(0, LV) + bonusKeeper.getBonus(SubBattleAbility.ATK);

            if (useWepon)
            {
                atk += (equipedWeapon != null) ? equipedWeapon.attackWith() : 0;
            }
            return(atk);
        }
Exemplo n.º 6
0
        public void dammage(int dammage, AttackSkillAttribute attribute)
        {
            if (dammage < 0)
            {
                dammage = 0;
            }

            this.hp -= dammage;

            if (this.hp < 0)
            {
                this.hp = 0;
            }
        }
Exemplo n.º 7
0
        public void dammage(int dammage, AttackSkillAttribute attribute)
        {
            if (dammage < 0)
            {
                dammage = 0;
            }
            dammage = (int)((float)dammage * attributeResistances[attribute]);

            observer.dammaged(attribute);
            this.hp -= dammage;
            if (this.hp < 0)
            {
                this.hp = 0;
            }
        }
Exemplo n.º 8
0
 /// <summary>
 /// userにリアクションを起こさせます
 /// </summary>
 /// <param name="user">リアクションを起こさせるIBattleable</param>
 /// <param name="attack">攻撃を試みるスキルの攻撃値</param>
 /// <param name="hit">攻撃を試みるスキルの命中値</param>
 /// <param name="attribute">攻撃を試みるスキルの属性</param>
 public void reaction(IBattleable user, int attack, int hit, AttackSkillAttribute attribute)
 {
     if (this.CATEGORY == ReactionSkillType.DODGE)
     {
         //命中判定
         if (hit > user.getDodge() + DODGE)
         {
             //ダメージ処理
             user.dammage(attack, attribute);
         }
     }
     else if (this.CATEGORY == ReactionSkillType.GUARD)
     {
         int def     = user.getDef() + DEF;
         int dammage = attack - def;
         dammage = (dammage >= 0) ? dammage : 0;
         user.dammage(dammage, attribute);
     }
     else if (this.CATEGORY == ReactionSkillType.MISS)
     {
         user.dammage(attack, attribute);
     }
 }
Exemplo n.º 9
0
 public void dammaged(AttackSkillAttribute attribute)
 {
     dammagedAttributeTimes[attribute]++;
 }