public string toString() { return(string.Format("時間:{0} skill:{1}, target:{2} agent:{3} state:{4} cancel:{5}\n", timer, skill, target.GetUnitName(), actor.GetUnitName(), actor.GetState().ToString(), actor.canCancelCurrentWork)); }
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(); } }