$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 "stratagus.h"
#include "player.h"
#include "unit.h"
#include "unittype.h"
#include "animation.h"
#include "actions.h"
#include "pathfinder.h"
#include "interface.h"
#include "sound.h"
#include "map.h"
action_resource.cpp - The generic resource action. | |
#define | SUB_START_RESOURCE 0 |
#define | SUB_MOVE_TO_RESOURCE 5 |
#define | SUB_UNREACHABLE_RESOURCE 31 |
#define | SUB_START_GATHERING 55 |
#define | SUB_GATHER_RESOURCE 60 |
#define | SUB_STOP_GATHERING 65 |
#define | SUB_MOVE_TO_DEPOT 70 |
#define | SUB_UNREACHABLE_DEPOT 100 |
#define | SUB_RETURN_RESOURCE 120 |
static int | MoveToResource (CUnit &unit) |
static void | UnitGotoGoal (CUnit &unit, CUnit *const goal, int mode) |
static int | StartGathering (CUnit &unit) |
static void | AnimateActionHarvest (CUnit &unit) |
static void | LoseResource (CUnit &unit, const CUnit &source) |
static int | GatherResource (CUnit &unit) |
int | GetNumWaitingWorkers (const CUnit &mine) |
static int | StopGathering (CUnit &unit) |
void | AiNewDepotRequest (CUnit &worker) |
static int | MoveToDepot (CUnit &unit) |
static int | WaitInDepot (CUnit &unit) |
void | DropResource (CUnit &unit) |
void | ResourceGiveUp (CUnit &unit) |
void | HandleActionResource (CUnit &unit) |
Handle command resource. |
#define SUB_GATHER_RESOURCE 60 |
#define SUB_MOVE_TO_DEPOT 70 |
#define SUB_MOVE_TO_RESOURCE 5 |
#define SUB_RETURN_RESOURCE 120 |
#define SUB_START_GATHERING 55 |
#define SUB_START_RESOURCE 0 |
#define SUB_STOP_GATHERING 65 |
#define SUB_UNREACHABLE_DEPOT 100 |
#define SUB_UNREACHABLE_RESOURCE 31 |
void AiNewDepotRequest | ( | CUnit & | worker | ) |
static void AnimateActionHarvest | ( | CUnit & | unit | ) | [static] |
Animate A unit that is harvesting
unit | Unit to animate |
void DropResource | ( | CUnit & | unit | ) |
static int GatherResource | ( | CUnit & | unit | ) | [static] |
Gather the resource
unit | Pointer to unit. |
int GetNumWaitingWorkers | ( | const CUnit & | mine | ) |
void HandleActionResource | ( | CUnit & | unit | ) |
Handle command resource.
Control the unit action: getting a resource.
This the generic function for oil, gold, ...
unit | Pointer to unit. |
Find something else to do when the resource is exhausted. This is called from GatherResorce when the resource is empty.
unit | pointer to harvester unit. | |
source | pointer to resource unit. |
static int MoveToDepot | ( | CUnit & | unit | ) | [static] |
Move to resource depot
unit | Pointer to unit. |
static int MoveToResource | ( | CUnit & | unit | ) | [static] |
Move unit to resource.
unit | Pointer to unit. |
void ResourceGiveUp | ( | CUnit & | unit | ) |
Give up on gathering.
unit | Pointer to unit. |
static int StartGathering | ( | CUnit & | unit | ) | [static] |
Start harvesting the resource.
unit | Pointer to unit. |
static int StopGathering | ( | CUnit & | unit | ) | [static] |
Stop gathering from the resource, go home.
unit | Poiner to unit. |
static int WaitInDepot | ( | CUnit & | unit | ) | [static] |
Wait in depot, for the resources stored.
unit | Pointer to unit. |