Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

Tyrion.ActionGoalAction


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
class ActionGoalAction extends TyrionScriptAction
	abstract;

var() editcombotype(enumTyrionTargets) Name target;

function AI_Goal postGoal(Actor a, AI_Goal goal)
{
	local Rook r;
	local SquadInfo si;
	local AI_Goal newGoal;

	r = Rook(a);
	si = SquadInfo(a);

	newGoal = AI_Goal( class'Engine.Tyrion_Setup'.static.shallowCopyGoal( goal ));

	if ( r != None )
	{
		newGoal.init( AI_Resource( newGoal.findResource( r, newGoal )));	// init called here because init is never called on "goal"
		newGoal.postGoal( None ).myAddRef();	// designer created goals should never get deleted
	}
	else if ( si != None )
	{
		newGoal.init( AI_Resource( si.squadAI ));
		newGoal.postGoal( None ).myAddRef();	// designer created goals should never get deleted
	}

	return newGoal;
}

function unpostGoal(Actor a, String goalName)
{
	local AI_Goal goal;

	goal = class'AI_Goal'.static.findGoalByName( a, goalName );
	if ( goal != None )
	{
		//if ( Pawn(a).logTyrion )
		//	log( "UNPOSTING" @ goal.name @ "from" @ a.name );

		if ( goal.resource == None )
		{
			// goal not yet initialized: resource.init will remove it
			goal.priority = -1;
		}
		else
			goal.unPostGoal( None );
	}
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: ne 5.9.2004 15:54:28.000 - Creation time: st 23.5.2018 00:10:40.314 - Created with UnCodeX