Ejemplo n.º 1
0
 public void CopyTo(AIActionTable result)
 {
     if (result == null)
     {
         return;
     }
     result.actions.Clear();
     for (int index = 0; index < this.actions.Count; ++index)
     {
         AIAction aiAction = new AIAction();
         aiAction.skill       = this.actions[index].skill;
         aiAction.type        = this.actions[index].type;
         aiAction.turn        = this.actions[index].turn;
         aiAction.notBlock    = this.actions[index].notBlock;
         aiAction.noExecAct   = this.actions[index].noExecAct;
         aiAction.nextActIdx  = this.actions[index].nextActIdx;
         aiAction.nextTurnAct = this.actions[index].nextTurnAct;
         aiAction.turnActIdx  = this.actions[index].turnActIdx;
         if (this.actions[index].cond != null)
         {
             aiAction.cond = new SkillLockCondition();
             this.actions[index].cond.CopyTo(aiAction.cond);
         }
         result.actions.Add(aiAction);
     }
     result.looped = this.looped;
 }
Ejemplo n.º 2
0
        public void NextAction(bool isMove, BattleCore.SkillResult result)
        {
            if (this.m_Action == null)
            {
                return;
            }
            bool flag = (bool)this.m_Action.notBlock;

            if (isMove)
            {
                flag = (int)this.m_Action.type == 2 || flag;
            }
            else if (result != null && result.skill != null)
            {
                if (!string.IsNullOrEmpty((string)this.m_Action.skill))
                {
                    flag = (string)this.m_Action.skill == result.skill.SkillID || flag;
                }
                else if ((int)this.m_Action.type == 1)
                {
                    SkillData attackSkill = this.owner.GetAttackSkill();
                    if (attackSkill != null)
                    {
                        flag = attackSkill.SkillID == result.skill.SkillID || flag;
                    }
                }
                else if ((int)this.m_Action.type == 2)
                {
                    flag = true;
                }
            }
            else
            {
                flag = (int)this.m_Action.type == 0 || flag;
            }
            if (this.m_Action.nextTurnAct != eAIActionNextTurnAct.NONE && this.m_IsNoExecActionSkill)
            {
                flag = this.m_Action.nextTurnAct == eAIActionNextTurnAct.NEXT_ACTION;
                if (this.m_Action.nextTurnAct == eAIActionNextTurnAct.SPECIFIED_ACTION && this.m_Action.turnActIdx > 0 && this.m_Owner.SetAIAction(this.m_Action.turnActIdx - 1) != null)
                {
                    this.m_Action = (AIAction)null;
                    return;
                }
            }
            if (!flag)
            {
                return;
            }
            this.m_Action = (AIAction)null;
            this.m_Owner.NextAIAction();
        }
Ejemplo n.º 3
0
        public AIAction SetAction(int index)
        {
            if (this.m_Owner == null)
            {
                return((AIAction)null);
            }
            AIAction aiAction = this.m_Owner.SetAIAction(index);

            if (aiAction != null)
            {
                this.m_Action = aiAction;
            }
            return(aiAction);
        }
Ejemplo n.º 4
0
 public void Clear()
 {
     this.m_AllSkills.Clear();
     this.m_UseSkill    = (BattleCore.SkillResult)null;
     this.m_Action      = (AIAction)null;
     this.m_UseSkillNum = 0;
     this.m_UseSkillLists.Clear();
     this.m_ForceSkillList.Clear();
     this.m_HealSkills.Clear();
     this.m_DamageSkills.Clear();
     this.m_SupportSkills.Clear();
     this.m_CureConditionSkills.Clear();
     this.m_FailConditionSkills.Clear();
     this.m_DisableConditionSkills.Clear();
     this.m_ExeSkills.Clear();
     this.Reset();
 }
Ejemplo n.º 5
0
        public void NextAction(bool isMove, BattleCore.SkillResult result)
        {
            if (this.m_Action == null)
            {
                return;
            }
            bool flag = (bool)this.m_Action.notBlock;

            if (isMove)
            {
                flag = (int)this.m_Action.type == 2 || flag;
            }
            else if (result != null && result.skill != null)
            {
                if (!string.IsNullOrEmpty((string)this.m_Action.skill))
                {
                    flag = (string)this.m_Action.skill == result.skill.SkillID || flag;
                }
                else if ((int)this.m_Action.type == 1)
                {
                    SkillData attackSkill = this.owner.GetAttackSkill();
                    if (attackSkill != null)
                    {
                        flag = attackSkill.SkillID == result.skill.SkillID || flag;
                    }
                }
                else if ((int)this.m_Action.type == 2)
                {
                    flag = true;
                }
            }
            else
            {
                flag = (int)this.m_Action.type == 0 || flag;
            }
            if (!flag)
            {
                return;
            }
            this.m_Action = (AIAction)null;
            this.m_Owner.NextAIAction();
        }
Ejemplo n.º 6
0
 public void SetAction(AIAction action)
 {
     this.m_Action = action;
 }
Ejemplo n.º 7
0
 public NPCSetting(JSON_MapEnemyUnit json)
 {
     this.uniqname          = (OString)json.name;
     this.iname             = (OString)json.iname;
     this.side              = (OInt)json.side;
     this.lv                = (OInt)Math.Max(json.lv, 1);
     this.rare              = (OInt)json.rare;
     this.awake             = (OInt)json.awake;
     this.elem              = (OInt)json.elem;
     this.exp               = (OInt)json.exp;
     this.gems              = (OInt)json.gems;
     this.gold              = (OInt)json.gold;
     this.ai                = (OString)json.ai;
     this.pos.x             = (OInt)json.x;
     this.pos.y             = (OInt)json.y;
     this.dir               = (OInt)json.dir;
     this.search            = (OInt)json.search;
     this.control           = (OBool)(json.ctrl != 0);
     this.trigger           = (EventTrigger)null;
     this.abilities         = (EquipAbilitySetting[])null;
     this.waitEntryClock    = (OInt)json.wait_e;
     this.waitMoveTurn      = (OInt)json.wait_m;
     this.waitExitTurn      = (OInt)json.wait_exit;
     this.startCtCalc       = (eMapUnitCtCalcType)json.ct_calc;
     this.startCtVal        = (OInt)json.ct_val;
     this.DisableFirceVoice = json.fvoff != 0;
     this.ai_type           = (AIActionType)json.ai_type;
     this.ai_pos.x          = (OInt)json.ai_x;
     this.ai_pos.y          = (OInt)json.ai_y;
     this.ai_len            = (OInt)json.ai_len;
     this.parent            = (OString)json.parent;
     this.fskl              = (OString)json.fskl;
     this.notice_damage     = (OInt)json.notice_damage;
     if (json.notice_members != null)
     {
         this.notice_members = new List <OString>(json.notice_members.Length);
         for (int index = 0; index < json.notice_members.Length; ++index)
         {
             if (!string.IsNullOrEmpty(json.notice_members[index]))
             {
                 this.notice_members.Add((OString)json.notice_members[index]);
             }
         }
     }
     if (json.trg != null)
     {
         this.trigger = new EventTrigger();
         this.trigger.Deserialize(json.trg);
     }
     if (json.entries != null && json.entries.Length > 0)
     {
         this.entries     = new List <UnitEntryTrigger>((IEnumerable <UnitEntryTrigger>)json.entries);
         this.entries_and = (OInt)json.entries_and;
     }
     if (json.abils != null && json.abils.Length > 0)
     {
         this.abilities = new EquipAbilitySetting[json.abils.Length];
         for (int index1 = 0; index1 < json.abils.Length; ++index1)
         {
             this.abilities[index1]       = new EquipAbilitySetting();
             this.abilities[index1].iname = (OString)json.abils[index1].iname;
             this.abilities[index1].rank  = (OInt)json.abils[index1].rank;
             if (json.abils[index1].skills != null)
             {
                 this.abilities[index1].skills = new EquipSkillSetting[json.abils[index1].skills.Length];
                 for (int index2 = 0; index2 < json.abils[index1].skills.Length; ++index2)
                 {
                     this.abilities[index1].skills[index2]       = new EquipSkillSetting();
                     this.abilities[index1].skills[index2].iname = (OString)json.abils[index1].skills[index2].iname;
                     this.abilities[index1].skills[index2].rate  = (OInt)json.abils[index1].skills[index2].rate;
                     if (json.abils[index1].skills[index2].cond != null && json.abils[index1].skills[index2].cond.type != 0)
                     {
                         SkillLockCondition dsc = new SkillLockCondition();
                         json.abils[index1].skills[index2].cond.CopyTo(dsc);
                         this.abilities[index1].skills[index2].cond = dsc;
                     }
                 }
             }
         }
     }
     if (json.acttbl != null && json.acttbl.actions != null && json.acttbl.actions.Length > 0)
     {
         this.acttbl.actions.Clear();
         for (int index = 0; index < json.acttbl.actions.Length; ++index)
         {
             AIAction aiAction = new AIAction();
             aiAction.skill    = (OString)json.acttbl.actions[index].skill;
             aiAction.type     = (OInt)json.acttbl.actions[index].type;
             aiAction.turn     = (OInt)json.acttbl.actions[index].turn;
             aiAction.notBlock = (OBool)(json.acttbl.actions[index].notBlock != 0);
             if (json.acttbl.actions[index].cond != null && json.acttbl.actions[index].cond.type != 0)
             {
                 SkillLockCondition dsc = new SkillLockCondition();
                 json.acttbl.actions[index].cond.CopyTo(dsc);
                 aiAction.cond = dsc;
             }
             this.acttbl.actions.Add(aiAction);
         }
         this.acttbl.looped = json.acttbl.looped;
     }
     if (json.patrol != null && json.patrol.routes != null && json.patrol.routes.Length > 0)
     {
         json.patrol.CopyTo(this.patrol);
     }
     if (json.break_obj == null)
     {
         return;
     }
     this.break_obj = new MapBreakObj();
     json.break_obj.CopyTo(this.break_obj);
 }