Exemple #1
0
        public void Perform()
        {
            if (!_v.Target.CheckUnsafetyOrMiss() || !_v.Target.CanBeAttacked() || _v.Target.HasCategory(EnemyCategory.Humanoid))
            {
                UiState.SetBattleFollowFormatMessage(BattleMesages.CannotEat);
                return;
            }

            if (_v.Target.CurrentHp > _v.Target.MaximumHp / _v.Command.Power)
            {
                UiState.SetBattleFollowFormatMessage(BattleMesages.CannotEatStrong);
                return;
            }

            BattleEnemyPrototype enemyPrototype = BattleEnemyPrototype.Find(_v.Target);
            Byte blueMagicId = enemyPrototype.BlueMagicId;

            _v.Target.Kill();

            if (blueMagicId == 0 || ff9abil.FF9Abil_IsMaster(_v.Caster.PlayerIndex, blueMagicId))
            {
                UiState.SetBattleFollowFormatMessage(BattleMesages.TasteBad);
                return;
            }

            ff9abil.FF9Abil_SetMaster(_v.Caster.PlayerIndex, blueMagicId);
            BattleState.RaiseAbilitiesAchievement(blueMagicId);
            UiState.SetBattleFollowFormatMessage(BattleMesages.Learned, FF9TextTool.ActionAbilityName(blueMagicId));
        }
Exemple #2
0
        public Single RateTarget()
        {
            if (!_v.Target.CheckUnsafetyOrMiss() || !_v.Target.CanBeAttacked() || _v.Target.HasCategory(EnemyCategory.Humanoid))
            {
                return(0);
            }

            if (_v.Target.CurrentHp > _v.Target.MaximumHp / _v.Command.Power)
            {
                return(0);
            }

            BattleEnemyPrototype enemyPrototype = BattleEnemyPrototype.Find(_v.Target);
            Byte blueMagicId = enemyPrototype.BlueMagicId;

            if (blueMagicId == 0 || ff9abil.FF9Abil_IsMaster(_v.Caster.PlayerIndex, blueMagicId))
            {
                return(0);
            }

            return(1);
        }