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

       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_still.cpp File Reference

The stand still action. More...

#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 CUnitUnitToRepairInRange (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.


Detailed Description

The stand still action.

Definition in file action_still.cpp.


Function Documentation

void ActionStillGeneric ( CUnit unit,
bool  stand_ground 
)

static void AutoAttack ( CUnit unit,
bool  stand_ground 
) [static]

static bool AutoCast ( CUnit unit  )  [static]

Auto cast a spell if possible

Returns:
true if a spell was auto cast, false otherwise

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  ) 

void HandleActionStill ( CUnit unit  ) 

Handle command stand ground.

Unit stands still!

Parameters:
unit Unit pointer for still action.

Definition at line 233 of file action_still.cpp.

References ActionStillGeneric().

static CUnit* UnitToRepairInRange ( CUnit unit,
int  range 
) [static]

Try to find a repairable unit around and return it.

Parameters:
unit unit which can repair.
range range to find a repairable unit.
Returns:
unit to repair if found, NoUnitP otherwise
Todo:
FIXME: find the best unit (most damaged, ...).

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().


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