____                _       __
    / __ )____  _____   | |     / /___ ___________
   / __  / __ \/ ___/   | | /| / / __ `/ ___/ ___/
  / /_/ / /_/ (__  )    | |/ |/ / /_/ / /  (__  )
 /_____/\____/____/     |__/|__/\__,_/_/  /____/

       A futuristic real-time strategy game.
          This file is part of Bos Wars.
(C) Copyright 2001-2007 by the Bos Wars and Stratagus Project. Distributed under the "GNU General Public License"

action_patrol.cpp File Reference

The patrol action. More...

#include <stdio.h>
#include <stdlib.h>
#include "stratagus.h"
#include "unit.h"
#include "unittype.h"
#include "actions.h"
#include "pathfinder.h"
#include "map.h"

Go to the source code of this file.

Functions

bool AutoRepair (CUnit *unit)
static void SwapPatrolPoints (CUnit *unit)
void HandleActionPatrol (CUnit *unit)
 Show attack animation.


Detailed Description

The patrol action.

Definition in file action_patrol.cpp.


Function Documentation

bool AutoRepair ( CUnit unit  ) 

void HandleActionPatrol ( CUnit unit  ) 

Show attack animation.

Unit Patrol: The unit patrols between two points. Any enemy unit in reaction range is attacked.

Todo:
FIXME: Should do some tries to reach the end-points. Should support patrol between more points! Patrol between units.
Parameters:
unit Patroling unit pointer.

Definition at line 80 of file action_patrol.cpp.

References _C_, CUnit::Anim, AttackUnitsInReactRange(), AutoRepair(), CUnitType::CanAttack, CUnit::ClearAction(), CommandAttack(), DebugPrint, DoActionMove(), FlushCommands, CMap::Info, Map, CMapInfo::MapHeight, CMapInfo::MapWidth, NewResetPath, NoUnitP, CUnit::Orders, PF_FAILED, PF_REACHED, PF_UNREACHABLE, PF_WAIT, CUnit::SavedOrder, CUnit::SubAction, SwapPatrolPoints(), CUnit::Type, CUnit::_unit_anim_::Unbreakable, UnitNumber, CUnit::Wait, CUnit::X, and CUnit::Y.

static void SwapPatrolPoints ( CUnit unit  )  [static]

Swap the patrol points.

Definition at line 55 of file action_patrol.cpp.

References NewResetPath, and CUnit::Orders.

Referenced by HandleActionPatrol().


Generated on Sat Feb 21 00:28:15 2009 for Bos Wars by  doxygen 1.5.6