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

       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"

actions.cpp File Reference

The actions. More...

#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "stratagus.h"
#include "version.h"
#include "unittype.h"
#include "animation.h"
#include "player.h"
#include "unit.h"
#include "actions.h"
#include "missile.h"
#include "interface.h"
#include "map.h"
#include "sound.h"
#include "spells.h"

Go to the source code of this file.

Functions

static void UnitRotate (CUnit *unit, int rotate)
int UnitShowAnimation (CUnit *unit, const CAnimation *anim)
 Handle the actions of all units each game cycle.
int UnitShowAnimationScaled (CUnit *unit, const CAnimation *anim, int scale)
 < Handle the animation of a unit
static void HandleActionNone (CUnit *unit)
static void HandleRegenerations (CUnit *unit)
static void HandleBuffs (CUnit *unit, int amount)
static void RunAction (unsigned char action, CUnit *unit)
static void HandleUnitAction (CUnit *unit)
void UnitActions (void)
 Unload a unit.

Variables

unsigned SyncHash
 Hash calculated to find sync failures.
static void(* HandleActionTable [])(CUnit *)


Detailed Description

The actions.

Definition in file actions.cpp.


Function Documentation

static void HandleActionNone ( CUnit unit  )  [static]

Unit does nothing!

Parameters:
unit Unit pointer for none action.

Definition at line 243 of file actions.cpp.

References _C_, DebugPrint, CUnitType::Ident, CUnit::Type, and UnitNumber.

static void HandleBuffs ( CUnit unit,
int  amount 
) [static]

Handle things about the unit that decay over time

Parameters:
unit The unit that the decay is handled for
amount The amount of time to make up for.(in cycles)

Definition at line 307 of file actions.cpp.

References _C_, DebugPrint, CVariable::Enable, GameCycle, HP_INDEX, CVariable::Increase, LetUnitDie(), CVariable::Max, CUnitTypeVar::NumberVariable, CUnit::TTL, UnitTypeVar, CVariable::Value, and CUnit::Variable.

Referenced by UnitActions().

static void HandleRegenerations ( CUnit unit  )  [static]

static void HandleUnitAction ( CUnit unit  )  [static]

static void RunAction ( unsigned char  action,
CUnit unit 
) [static]

Definition at line 337 of file actions.cpp.

References HandleActionTable.

Referenced by HandleUnitAction().

void UnitActions ( void   ) 

static void UnitRotate ( CUnit unit,
int  rotate 
) [static]

Rotate a unit

Parameters:
unit Unit to rotate
rotate Number of frames to rotate (>0 clockwise, <0 counterclockwise)

Definition at line 73 of file actions.cpp.

References CUnit::Direction, CUnitType::NumDirections, CUnit::Type, and UnitUpdateHeading().

Referenced by UnitShowAnimationScaled().

int UnitShowAnimation ( CUnit unit,
const CAnimation anim 
)

Handle the actions of all units each game cycle.

Show unit animation.

Parameters:
unit Unit of the animation.
anim Animation script to handle.
Returns:
The flags of the current script step.

Definition at line 87 of file actions.cpp.

References UnitShowAnimationScaled().

Referenced by ActionStillGeneric(), AnimateActionAttack(), AnimateActionHarvest(), AnimateActionRepair(), HandleActionBoard(), HandleActionDie(), HandleActionSpellCast(), and HandleActionTrain().

int UnitShowAnimationScaled ( CUnit unit,
const CAnimation anim,
int  scale 
)


Variable Documentation

void(* HandleActionTable[])(CUnit *) [static]

unsigned SyncHash

Hash calculated to find sync failures.

Definition at line 57 of file actions.cpp.

Referenced by CclSavedGameInfo(), CreateGame(), InitModules(), LoadGame(), NetworkSendCommands(), SaveGame(), and UnitActions().


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