コード例 #1
0
        public static void OnClick(AgentModel actor)
        {
            CommandWindow.CommandWindow CurrentWindow = CommandWindow.CommandWindow.CurrentWindow;

            if (CurrentWindow != null && CurrentWindow.CurrentTarget != null && CurrentWindow.CurrentSkill != null && actor != null && CurrentWindow.CurrentWindowType == CommandType.Management)
            {
                _instance.m_taskManager.AddWorkLog(new WorkLog(_instance.m_taskManager.recodeElapsed, CurrentWindow.SelectedWork, CurrentWindow.CurrentTarget, actor));
                // m_debuglog += CurrentWindow.CurrentTarget.GetUnitName() + "に"+CurrentWindow.CurrentSkill.name + "を"+actor.name+"に割り当てた\n";
            }


            _instance.BaseOnClick(actor);
        }
コード例 #2
0
        void BaseOnClick(AgentModel actor)
        {
            CommandWindow.CommandWindow CurrentWindow = CommandWindow.CommandWindow.CurrentWindow;

            if (actor == null || CurrentWindow == null)
            {
                return;
            }


            if (CurrentWindow.CurrentWindowType == CommandType.Management)
            {
                if (!actor.CheckWorkCommand())
                {
                    CurrentWindow.SetAgentList(CurrentWindow.CurrentWindowType, CurrentWindow.CurrentSefira);
                    return;
                }
                CreatureModel currentTarget = CurrentWindow.CurrentTarget as CreatureModel;
                if (actor.GetState() == AgentAIState.MANAGE)
                {
                    if (currentTarget == actor.target)
                    {
                        if (actor.currentSkill == null)
                        {
                            actor.ForcelyCancelWork();
                        }
                        return;
                    }
                    if (actor.currentSkill != null)
                    {
                        actor.StopAction();
                    }
                    else
                    {
                        actor.ForcelyCancelWork();
                    }
                }
                SkillTypeInfo data = SkillTypeList.instance.GetData(CurrentWindow.SelectedWork);
                actor.ManageCreature(currentTarget, data, CurrentWindow.GetWorkSprite((RwbpType)((int)CurrentWindow.SelectedWork)));
                actor.counterAttackEnabled = false;
                currentTarget.Unit.room.OnWorkAllocated(actor);
                currentTarget.script.OnWorkAllocated(data, actor);
                AngelaConversation.instance.MakeMessage(AngelaMessageState.MANAGE_START, new object[] { actor, data, CurrentWindow.CurrentTarget as CreatureModel });
                CurrentWindow.CloseWindow();
            }
            else if (CurrentWindow.CurrentWindowType != CommandType.KitCreature)
            {
                if (actor.GetState() == AgentAIState.SUPPRESS_CREATURE && actor.target == CurrentWindow.CurrentTarget)
                {
                    actor.ForcelyCancelSuppress();
                    return;
                }
                if (actor.GetState() == AgentAIState.SUPPRESS_WORKER && actor.targetWorker == CurrentWindow.CurrentTarget)
                {
                    actor.ForcelyCancelSuppress();
                    return;
                }
                actor.Suppress(CurrentWindow.CurrentTarget, false);
            }
            else
            {
                CreatureModel creatureModel = CurrentWindow.CurrentTarget as CreatureModel;
                if (actor.GetState() == AgentAIState.MANAGE)
                {
                    if (creatureModel == actor.target)
                    {
                        if (actor.currentSkill == null)
                        {
                            actor.ForcelyCancelWork();
                        }
                        return;
                    }
                    if (actor.currentSkill != null)
                    {
                        actor.StopAction();
                    }
                    else
                    {
                        actor.ForcelyCancelWork();
                    }
                }
                actor.ManageKitCreature(creatureModel);
                actor.counterAttackEnabled = false;
                creatureModel.Unit.room.OnWorkAllocated(actor);
                CurrentWindow.CloseWindow();
            }
        }