bool CEnemy::update(float time_elapsed_ms,CNode * nodes)
{
	if(!isDead())
	{
		//update position
		updatePos(time_elapsed_ms);
		//if at each waypoint
		if(DistanceCheck())
		{
			setCurrNode(&nodes[getNodeIndex()+1]);
			setNodeIndex(getNodeIndex()+1);
			//special check for end waypoint
			//if at the end waypoint
			if(getNodeIndex() == ENDNODE)
			{
				if(!isDead())
				{
					setDead(true);
				}
				return true;
				//life minuses here
				//reset mob
				//change to wavemanager later
			//	enemyArray[i].spawn(currType,currLevel);
			//	enemyArray[i].setNodeIndex(0);
			//	enemyArray[i].setPos(NodeArray[0].getPos());
			}
		}
	}
	return false;
}
Beispiel #2
0
        void FilterTargets(std::list<WorldObject*>& targets)
        {
            if (!GetCaster())
                return;

            if (!targets.empty())
                targets.remove_if(DistanceCheck(GetCaster()));
        }
Beispiel #3
0
 void FilterTargetsInitial(std::list<Unit*>& unitList)
 {
     unitList.remove_if(DistanceCheck(GetCaster()));
     sharedUnitList = unitList;
 }
Beispiel #4
0
 void FilterTargetsInitial(std::list<WorldObject*>& targets)
 {
     targets.remove_if(DistanceCheck(GetCaster()));
     sharedTargets = targets;
 }
Beispiel #5
0
 void FilterTargets(std::list<WorldObject*>& unitList)
 {
     unitList.remove_if(DistanceCheck(x, y));
 }