_________ __                 __
        /   _____//  |_____________ _/  |______     ____  __ __  ______
        \_____  \\   __\_  __ \__  \\   __\__  \   / ___\|  |  \/  ___/
        /        \|  |  |  | \// __ \|  |  / __ \_/ /_/  >  |  /\___ \
       /_______  /|__|  |__|  (____  /__| (____  /\___  /|____//____  >
               \/                  \/          \//_____/            \/
    ______________________                           ______________________
                          T H E   W A R   B E G I N S
                   Stratagus - A free fantasy real time strategy game engine

Classes
action_still.cpp File Reference
#include "stratagus.h"
#include "action/action_still.h"
#include "animation.h"
#include "commands.h"
#include "iolib.h"
#include "map.h"
#include "missile.h"
#include "player.h"
#include "script.h"
#include "settings.h"
#include "spells.h"
#include "tileset.h"
#include "unit.h"
#include "unit_find.h"
#include "unittype.h"
#include "video.h"

Classes

class  IsTargetInRange
 
class  IsAReparableUnitBy
 

action_still.cpp - The stand still action.

enum  { SUB_STILL_STANDBY = 0, SUB_STILL_ATTACK }
 
void UnHideUnit (CUnit &unit)
 
static bool MoveRandomly (CUnit &unit)
 
bool AutoCast (CUnit &unit)
 
static CUnitUnitToRepairInRange (const CUnit &unit, int range)
 
bool AutoRepair (CUnit &unit)
 
bool AutoAttack (CUnit &unit)
 

Enumeration Type Documentation

◆ anonymous enum

anonymous enum
Enumerator
SUB_STILL_STANDBY 
SUB_STILL_ATTACK 

Function Documentation

◆ AutoAttack()

bool AutoAttack ( CUnit unit)

Auto attack nearby units if possible

◆ AutoCast()

bool AutoCast ( CUnit unit)

Auto cast a spell if possible

Returns
true if a spell was auto cast, false otherwise

◆ AutoRepair()

bool AutoRepair ( CUnit unit)

Auto repair a unit if possible

Returns
true if the unit is repairing, false otherwise

◆ MoveRandomly()

static bool MoveRandomly ( CUnit unit)
static

Move in a random direction

Returns
true if the unit moves, false otherwise

◆ UnHideUnit()

void UnHideUnit ( CUnit unit)

◆ UnitToRepairInRange()

static CUnit* UnitToRepairInRange ( const CUnit unit,
int  range 
)
static

Try to find a repairable unit around and return it.

Parameters
unitunit which can repair.
rangerange to find a repairable unit.
Returns
unit to repair if found, NULL otherwise
Todo:
FIXME: find the best unit (most damaged, ...).
(C) Copyright 1998-2012 by The Stratagus Project under the GNU General Public License.
All trademarks and copyrights on this page are owned by their respective owners.