$treeview $search $mathjax
Stratagus
2.2.6
$projectbrief
|
$projectbrief
|
$searchbox |
_________ __ __ / _____// |_____________ _/ |______ ____ __ __ ______ \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ \ /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > \/ \/ \//_____/ \/ ______________________ ______________________ T H E W A R B E G I N S Stratagus - A free fantasy real time strategy game engine
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <time.h>
#include "stratagus.h"
#include "video.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"
actions.cpp - The actions. | |
unsigned | SyncHash |
static void(* | HandleActionTable [256])(CUnit &) |
static void | UnitRotate (CUnit &unit, int rotate) |
Hash calculated to find sync failures. | |
int | UnitShowAnimation (CUnit &unit, const CAnimation *anim) |
Handle the animation of a unit. | |
int | UnitShowAnimationScaled (CUnit &unit, const CAnimation *anim, int scale) |
Handle the animation of a unit. | |
static void | HandleActionNone (CUnit &unit) |
static void | HandleActionNotWritten (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 () |
Handle the actions of all units each game cycle. |
static void HandleActionNone | ( | CUnit & | unit | ) | [static] |
Unit does nothing!
unit | Unit pointer for none action. |
static void HandleActionNotWritten | ( | CUnit & | unit | ) | [static] |
Unit has not written function.
unit | Unit pointer for not written action. |
static void HandleBuffs | ( | CUnit & | unit, | |
int | amount | |||
) | [static] |
Handle things about the unit that decay over time
unit | The unit that the decay is handled for | |
amount | The amount of time to make up for.(in cycles) |
static void HandleRegenerations | ( | CUnit & | unit | ) | [static] |
Increment a unit's health
unit | the unit to operate on |
static void HandleUnitAction | ( | CUnit & | unit | ) | [static] |
Handle the action of a unit.
unit | Pointer to handled unit. |
static void RunAction | ( | unsigned char | action, | |
CUnit & | unit | |||
) | [static] |
void UnitActions | ( | ) |
Handle the actions of all units each game cycle.
Update the actions of all units each game cycle.
static void UnitRotate | ( | CUnit & | unit, | |
int | rotate | |||
) | [static] |
Hash calculated to find sync failures.
Rotate a unit
unit | Unit to rotate | |
rotate | Number of frames to rotate (>0 clockwise, <0 counterclockwise) |
int UnitShowAnimation | ( | CUnit & | unit, | |
const CAnimation * | anim | |||
) |
Handle the animation of a unit.
Show unit animation.
unit | Unit of the animation. | |
anim | Animation script to handle. |
int UnitShowAnimationScaled | ( | CUnit & | unit, | |
const CAnimation * | anim, | |||
int | scale | |||
) |
Handle the animation of a unit.
Show unit animation.
unit | Unit of the animation. | |
anim | Animation script to handle. | |
scale | Scaling factor of the wait times in animation (8 means no scaling). |
void(* HandleActionTable[256])(CUnit &) [static] |
Jump table for actions.
unsigned SyncHash |