nextAction nextAction = _nextAction;
Object nextAction_arg0 = _nextAction_arg0;
Object nextAction_arg1 = _nextAction_arg1;
boolean nextAction_arg2 = _nextAction_arg2;
boolean nextAction_arg3 = _nextAction_arg3;
Playable actor = getActor();
if ((nextAction == null) || actor.isActionsDisabled())
{
return false;
}
Skill skill;
Creature target;
GameObject object;
switch (nextAction)
{
case ATTACK:
if (nextAction_arg0 == null)
{
return false;
}
target = (Creature) nextAction_arg0;
_forceUse = nextAction_arg2;
_dontMove = nextAction_arg3;
clearNextAction();
setIntention(AI_INTENTION_ATTACK, target);
break;
case CAST:
if ((nextAction_arg0 == null) || (nextAction_arg1 == null))
{
return false;
}
skill = (Skill) nextAction_arg0;
target = (Creature) nextAction_arg1;
_forceUse = nextAction_arg2;
_dontMove = nextAction_arg3;
clearNextAction();
if (!skill.checkCondition(actor, target, _forceUse, _dontMove, true))
{
if ((skill.getNextAction() == NextAction.ATTACK) && !actor.equals(target))
{
setNextAction(PlayableAI.nextAction.ATTACK, target, null, _forceUse, false);
return setNextIntention();
}
return false;
}
setIntention(AI_INTENTION_CAST, skill, target);
break;
case MOVE:
if ((nextAction_arg0 == null) || (nextAction_arg1 == null))
{
return false;
}
Location loc = (Location) nextAction_arg0;
Integer offset = (Integer) nextAction_arg1;
clearNextAction();
actor.moveToLocation(loc, offset, nextAction_arg2);
break;
case REST:
actor.sitDown(null);
break;
case INTERACT:
if (nextAction_arg0 == null)
{
return false;