Exemplo n.º 1
0
 /// <summary>
 /// コンストラクタ
 /// </summary>
 /// <param name="name">ボーナス名</param>
 /// <param name="subAbility">適用するSubBattleAbitliy</param>
 /// <param name="limit">効果時間</param>
 /// <param name="bonusValue">ボーナス量</param>
 public SubBattleAbilityBonus(string name, SubBattleAbility subAbility, float limit, int bonusValue)
 {
     this.name             = name;
     this.BONUS_SUBABILITY = subAbility;
     this.limit            = limit;
     this.bonusValue       = bonusValue;
 }
Exemplo n.º 2
0
        /// <summary>
        /// 与えられたボーナスを追加します
        /// 引数がBattleAbilityBonusかSubBattleAbilityBonusかでオーバーロードします
        /// </summary>
        /// <param name="bonus">追加したいボーナス</param>
        public void setBonus(SubBattleAbilityBonus bonus)
        {
            UnityEngine.Debug.Log("setted bonus");
            SubBattleAbility bonusAbility = bonus.getBonusAbility();

            subAbilityBonusList [bonusAbility].Add(bonus);
        }
Exemplo n.º 3
0
        /// <summary>
        /// 与えられたsubBattleAbilityからボーナスを返します
        /// 引数がBattleAbilityかSubBattleAbilityかでオーバーロードします
        /// </summary>
        /// <returns> 補正値 </returns>
        /// <param name="ability"> 補正したいSubBattleAbility </param>
        public int getBonus(SubBattleAbility ability)
        {
            var bonuses  = subAbilityBonusList [ability];
            int sumBonus = 0;

            foreach (SubBattleAbilityBonus bonus in bonuses)
            {
                sumBonus += bonus.getBonusValue();
            }
            return(sumBonus);
        }
Exemplo n.º 4
0
 /// <summary>
 /// AbilityかSubのどっちかを判断して初期化します
 /// </summary>
 /// <param name="data"> AbilityもしかはSubAblitiyのstringデータ </param>
 protected void setBonusParameter(string data)
 {
     if (Enum.IsDefined(typeof(BattleAbility), data))
     {
         bonusAbility           = (BattleAbility)Enum.Parse(typeof(BattleAbility), data);
         this.isBonusForAbility = true;
     }
     else if (Enum.IsDefined(typeof(SubBattleAbility), data))
     {
         bonusSubAbility        = (SubBattleAbility)Enum.Parse(typeof(SubBattleAbility), data);
         this.isBonusForAbility = false;
     }
 }