____ _ __
/ __ )____ _____ | | / /___ ___________
/ __ / __ \/ ___/ | | /| / / __ `/ ___/ ___/
/ /_/ / /_/ (__ ) | |/ |/ / /_/ / / (__ )
/_____/\____/____/ |__/|__/\__,_/_/ /____/
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 "missile.h"
#include "unittype.h"
#include "animation.h"
#include "actions.h"
#include "unit.h"
#include "unit_cache.h"
#include "map.h"
#include "pathfinder.h"
#include "spells.h"
#include "player.h"
Go to the source code of this file.
Functions | |
| static bool | AutoCast (CUnit *unit) |
| static CUnit * | UnitToRepairInRange (CUnit *unit, int range) |
| bool | AutoRepair (CUnit *unit) |
| static void | AutoAttack (CUnit *unit, bool stand_ground) |
| void | ActionStillGeneric (CUnit *unit, bool stand_ground) |
| < Generic still action | |
| void | HandleActionStill (CUnit *unit) |
| Handle command stand ground. | |
Definition in file action_still.cpp.
| void ActionStillGeneric | ( | CUnit * | unit, | |
| bool | stand_ground | |||
| ) |
< Generic still action
Unit stands still or stand ground.
| unit | Unit pointer for action. | |
| stand_ground | true if unit is standing ground. |
Definition at line 193 of file action_still.cpp.
References CUnitType::AirUnit, CUnit::Anim, AnimateActionAttack(), CUnitType::Animations, CUnitType::AttackFromTransporter, AutoAttack(), AutoCast(), AutoRepair(), CUnitType::CanTransport, MissileType::Class, CUnit::Container, CUnit::IY, MissileConfig::Missile, CUnitType::Missile, MissileClassNone, MyRand, CUnit::Removed, CUnitType::SeaUnit, CAnimations::Still, CUnit::SubAction, CUnit::Type, CUnit::_unit_anim_::Unbreakable, and UnitShowAnimation().
Referenced by HandleActionStandGround(), and HandleActionStill().
| static void AutoAttack | ( | CUnit * | unit, | |
| bool | stand_ground | |||
| ) | [static] |
Auto attack nearby units if possible
Definition at line 124 of file action_still.cpp.
References COrder::Action, Assert, AttackUnitsInRange(), AttackUnitsInReactRange(), CUnitType::CanAttack, CanMove(), CommandAttack(), CUnitType::Coward, FlushCommands, COrder::Goal, NoUnitP, CUnit::Orders, COrder::Range, CUnit::RefsDecrease(), CUnit::RefsIncrease(), CUnit::Removed, CUnit::SavedOrder, CUnit::State, CUnit::SubAction, CUnitType::TileHeight, CUnitType::TileWidth, CUnit::Type, UnitActionAttack, UnitActionDie, UnitActionStill, UnitHeadingFromDeltaXY(), CUnit::Wait, COrder::X, CUnit::X, COrder::Y, and CUnit::Y.
Referenced by ActionStillGeneric().
| static bool AutoCast | ( | CUnit * | unit | ) | [static] |
Auto cast a spell if possible
Definition at line 59 of file action_still.cpp.
References AutoCastSpell(), CUnit::AutoCastSpell, int(), and SpellTypeTable.
Referenced by ActionStillGeneric(), and CButtonPanel::DoClicked().
| 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 HandleActionStill | ( | CUnit * | unit | ) |
Handle command stand ground.
Unit stands still!
| unit | Unit pointer for still action. |
Definition at line 233 of file action_still.cpp.
References ActionStillGeneric().
Try to find a repairable unit around and return it.
| unit | unit which can repair. | |
| range | range to find a repairable unit. |
Definition at line 81 of file action_still.cpp.
References HP_INDEX, CUnit::IsVisibleAsGoal(), CVariable::Max, NoUnitP, CUnit::Player, CUnitCache::Select(), CUnitType::TileHeight, CUnitType::TileWidth, CUnit::Type, UnitCache, UnitMax, CVariable::Value, CUnit::Variable, CUnit::X, and CUnit::Y.
Referenced by AutoRepair().
1.5.6