Пример #1
0
        public static List <BattlerSerializable> GetAliveRivalBattlers(BattlerEnum.BattlerType battlerType)
        {
            var battlers = GetRivalBattlers(battlerType);

            battlers.RemoveAll(x => BattlerDictionary.IsDead(x.uniqId));
            return(battlers);
        }
Пример #2
0
        public static bool IsActor(int uniqId)
        {
            if (BattlerDictionary.GetBattlerByUniqId(uniqId).battlerType == BattlerEnum.BattlerType.Actor)
            {
                return(true);
            }

            return(false);
        }
Пример #3
0
        /// <summary>
        /// 対象の中からランダムで生きているのを返す
        /// 敵対値が考慮される
        /// </summary>
        /// <returns></returns>
        public static BattlerSerializable GetAliveBattlerByRandom(List <BattlerSerializable> battlers)
        {
            WeightChoice <BattlerSerializable> weightChoice = new WeightChoice <BattlerSerializable>();

            battlers.ForEach(battler =>
            {
                if (BattlerDictionary.IsDeadByUniqId(battler.uniqId) == false)
                {
                    weightChoice.Add(battler.parameter.hostile, battler);
                }
            });
            if (weightChoice.Count == 0)
            {
                return(null);
            }
            return(weightChoice.ChoiceOne());
        }
Пример #4
0
        public static bool IsAppropriate(string skillId, int fromUniqId, int toUniqId)
        {
            var skill       = SkillsDicionary.GetSkillById(skillId);
            var fromBattler = BattlerDictionary.GetBattlerByUniqId(fromUniqId);
            var toBattler   = BattlerDictionary.GetBattlerByUniqId(toUniqId);

            if ((skill.target == SkillConsts.ENEMY || skill.target == SkillConsts.ALL_ENEMY ||
                 skill.target == SkillConsts.RANDOM_ENEMY) && toBattler.battlerType != fromBattler.battlerType)
            {
                return(true);
            }

            if ((skill.target == SkillConsts.MEMBER || skill.target == SkillConsts.ALL_MEMBER ||
                 skill.target == SkillConsts.RANDOM_MEMBER) && toBattler.battlerType == fromBattler.battlerType)
            {
                return(true);
            }

            return(false);
        }