____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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"
#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. | |
Definition in file action_patrol.cpp.
| bool AutoRepair | ( | CUnit * | unit | ) |
Auto repair a unit if possible
Definition at line 106 of file action_still.cpp.
References CUnit::AutoRepair, AUTOREPAIRRANGE_INDEX, CommandRepair(), FlushCommands, NoUnitP, CUnit::Orders, CUnit::SavedOrder, CUnit::Type, UnitToRepairInRange(), CVariable::Value, and CUnitType::Variable.
Referenced by ActionStillGeneric(), CButtonPanel::DoClicked(), GetButtonStatus(), HandleActionPatrol(), and CUnit::Init().
| void HandleActionPatrol | ( | CUnit * | unit | ) |
Show attack animation.
Unit Patrol: The unit patrols between two points. Any enemy unit in reaction range is attacked.
| 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().
1.5.6