Esempio n. 1
0
        public void healed(int heal, HealSkillAttribute attribute)
        {
            Debug.Log("heal " + heal + " attribute ");

            if (heal < 0)
            {
                heal = 0;
            }


            if (attribute == HealSkillAttribute.HP_HEAL || attribute == HealSkillAttribute.BOTH)
            {
                if (this.hp != 0)
                {
                    this.hp += heal;
                }
            }
            if (attribute == HealSkillAttribute.MP_HEAL || attribute == HealSkillAttribute.BOTH)
            {
                this.mp += heal;
            }
            if (attribute == HealSkillAttribute.RESURRECTITION)
            {
                if (this.hp == 0)
                {
                    this.hp += heal;
                }
            }

            hp = (hp > maxHp) ? hp = maxHp : hp;
            mp = (mp > maxMp) ? mp = maxMp : mp;
        }
Esempio n. 2
0
        public HealItem(HealItemBuilder builder, HealItemObserver observer)
        {
            ID             = builder.getId();
            NAME           = builder.getName();
            HEAL           = builder.getHeal();
            ITEM_VALUE     = builder.getItemValue();
            MASS           = builder.getMass();
            DESCRITION     = builder.getDescription();
            FLAVOR_TEXT    = builder.getFlavorText();
            ATTRIBUTE      = builder.getAttribute();
            LEVEL          = builder.getLevel();
            ITEM_ATTRIBUTE = builder.getItemAttribute();

            this.observer = observer;
        }
Esempio n. 3
0
        /// <summary>
        /// コンストラクタ
        /// csvから初期化します
        /// </summary>
        /// <param name="datas">csvによるstring配列データ</param>
        public HealItemBuilder(string[] datas)
        {
            ID             = int.Parse(datas[0]);
            NAME           = datas[1];
            heal           = int.Parse(datas[2]);
            RAW_HEAL       = heal;
            itemValue      = int.Parse(datas[3]);
            RAW_ITEM_VALUE = itemValue;
            MASS           = int.Parse(datas[4]);
            level          = int.Parse(datas[5]);
            ATTRIBUTE      = (HealAttribute)Enum.Parse(typeof(HealAttribute), datas[6]);
            ITEM_ATTRIBUTE = (ItemAttribute)System.Enum.Parse(typeof(ItemAttribute), datas[7]);
            DESCRIPTION    = datas[8];
            FLAVOR_TEXT    = datas[9];

            observer = new HealItemObserver(ID);
        }
Esempio n. 4
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="datas">csvによるstring配列データ</param>
        public HealSkill(string[] datas)
        {
            ID             = int.Parse(datas[0]);
            NAME           = datas [1];
            LEVEL          = int.Parse(datas[2]);
            RAW_HEAL_VALUE = int.Parse(datas[3]);
            healValue      = RAW_HEAL_VALUE;
            RANGE          = int.Parse(datas[4]);
            RAW_DELAY      = float.Parse(datas[5]);
            delay          = RAW_DELAY;
            RAW_COST       = int.Parse(datas[6]);
            cost           = RAW_COST;
            ATTRIBUTE      = (HealAttribute)Enum.Parse(typeof(HealAttribute), datas [7]);
            EXTENT         = (Extent)Enum.Parse(typeof(Extent), datas [8]);
            USE_ABILITY    = (BattleAbility)Enum.Parse(typeof(BattleAbility), datas[9]);
            DESCRIPTION    = datas [10];
            FLAVOR_TEXT    = datas[11];

            observer = new HealSkillObserver(ID);
        }
Esempio n. 5
0
 public void healed(int heal, HealSkillAttribute attribute)
 {
     if (attribute == HealSkillAttribute.HP_HEAL || attribute == HealSkillAttribute.BOTH)
     {
         if (this.hp != 0)
         {
             this.hp += heal;
         }
     }
     if (attribute == HealSkillAttribute.MP_HEAL || attribute == HealSkillAttribute.BOTH)
     {
         this.mp += heal;
     }
     if (attribute == HealSkillAttribute.RESURRECTITION)
     {
         if (this.hp == 0)
         {
             this.hp += heal;
         }
     }
 }