$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
00001 // _________ __ __ 00002 // / _____// |_____________ _/ |______ ____ __ __ ______ 00003 // \_____ \\ __\_ __ \__ \\ __\__ \ / ___\| | \/ ___/ 00004 // / \| | | | \// __ \| | / __ \_/ /_/ > | /\___ | 00005 // /_______ /|__| |__| (____ /__| (____ /\___ /|____//____ > 00006 // \/ \/ \//_____/ \/ 00007 // ______________________ ______________________ 00008 // T H E W A R B E G I N S 00009 // Stratagus - A free fantasy real time strategy game engine 00010 // 00012 // 00013 // (c) Copyright 1998-2006 by Lutz Sammer and Jimmy Salmon 00014 // 00015 // This program is free software; you can redistribute it and/or modify 00016 // it under the terms of the GNU General Public License as published by 00017 // the Free Software Foundation; only version 2 of the License. 00018 // 00019 // This program is distributed in the hope that it will be useful, 00020 // but WITHOUT ANY WARRANTY; without even the implied warranty of 00021 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 00022 // GNU General Public License for more details. 00023 // 00024 // You should have received a copy of the GNU General Public License 00025 // along with this program; if not, write to the Free Software 00026 // Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 00027 // 02111-1307, USA. 00028 // 00029 00030 #ifndef __ACTIONS_H__ 00031 #define __ACTIONS_H__ 00032 00034 #ifndef __UNIT_CACHE_H__ 00035 #include "unit_cache.h" 00036 #endif 00037 00038 #ifndef __VEC2I_H__ 00039 #include "vec2i.h" 00040 #endif 00041 00042 //#include "vec2i.h" 00043 00044 /*---------------------------------------------------------------------------- 00045 -- Declarations 00046 ----------------------------------------------------------------------------*/ 00047 00048 enum _diplomacy_ { 00049 DiplomacyAllied, 00050 DiplomacyNeutral, 00051 DiplomacyEnemy, 00052 DiplomacyCrazy 00053 }; 00054 00055 class CUnit; 00056 class CUnitType; 00057 class CUpgrade; 00058 class SpellType; 00059 class CAnimation; 00060 00061 00062 /*---------------------------------------------------------------------------- 00063 -- Variables 00064 ----------------------------------------------------------------------------*/ 00065 00066 extern unsigned SyncHash; 00067 00068 /*---------------------------------------------------------------------------- 00069 -- Functions 00070 ----------------------------------------------------------------------------*/ 00071 00072 /*---------------------------------------------------------------------------- 00073 -- Commands: in command.c 00074 ----------------------------------------------------------------------------*/ 00075 00081 00082 extern void CommandQuit(int player); 00084 extern void CommandStopUnit(CUnit &unit); 00086 extern void CommandStandGround(CUnit &unit, int flush); 00088 extern void CommandFollow(CUnit &unit, CUnit &dest, int flush); 00090 extern void CommandMove(CUnit &unit, const Vec2i &pos, int flush); 00092 extern void CommandRepair(CUnit &unit, const Vec2i &pos, CUnit *dest, int flush); 00094 extern void CommandAutoRepair(CUnit &unit, int on); 00096 extern void CommandAttack(CUnit &unit, const Vec2i &pos, CUnit *dest, int flush); 00098 extern void CommandAttackGround(CUnit &unit, const Vec2i &pos, int flush); 00100 extern void CommandPatrolUnit(CUnit &unit, const Vec2i &pos, int flush); 00102 extern void CommandBoard(CUnit &unit, CUnit &dest, int flush); 00104 extern void CommandUnload(CUnit &unit, const Vec2i &pos, CUnit *what, int flush); 00106 extern void CommandBuildBuilding(CUnit &unit, const Vec2i &pos, CUnitType &, int flush); 00108 extern void CommandDismiss(CUnit &unit); 00110 extern void CommandResourceLoc(CUnit &unit, const Vec2i &pos, int flush); 00112 extern void CommandResource(CUnit &unit, CUnit &dest, int flush); 00114 extern void CommandReturnGoods(CUnit &unit, CUnit *goal, int flush); 00116 extern void CommandTrainUnit(CUnit &unit, CUnitType &what, int flush); 00118 extern void CommandCancelTraining(CUnit &unit, int slot, const CUnitType *type); 00120 extern void CommandUpgradeTo(CUnit &unit, CUnitType &what, int flush); 00122 extern void CommandTransformIntoType(CUnit &unit, CUnitType &type); 00124 extern void CommandCancelUpgradeTo(CUnit &unit); 00126 extern void CommandResearch(CUnit &unit, CUpgrade *what, int flush); 00128 extern void CommandCancelResearch(CUnit &unit); 00130 extern void CommandSpellCast(CUnit &unit, const Vec2i &pos, CUnit *dest, SpellType *spell, int flush); 00132 extern void CommandAutoSpellCast(CUnit &unit, int spellid, int on); 00134 extern void CommandDiplomacy(int player, int state, int opponent); 00136 extern void CommandSetResource(int player, int resource, int value); 00138 extern void CommandSharedVision(int player, bool state, int opponent); 00140 //extern void CommandAnyOrder(CUnit &unit, COrder *order, int flush); 00142 extern void CommandMoveOrder(CUnit &unit, int src, int dst); 00143 00144 /*---------------------------------------------------------------------------- 00145 -- Actions: in action_<name>.c 00146 ----------------------------------------------------------------------------*/ 00147 00148 extern void DropResource(CUnit &unit); 00149 extern void ResourceGiveUp(CUnit &unit); 00150 extern int GetNumWaitingWorkers(const CUnit &mine); 00151 extern void AutoAttack(CUnit &unit, CUnitCache &targets, bool stand_ground); 00152 extern void UnHideUnit(CUnit &unit); 00153 00155 extern void ActionStillGeneric(CUnit &unit, bool stand_ground); 00157 extern void HandleActionStill(CUnit &unit); 00159 extern void HandleActionStandGround(CUnit &unit); 00161 extern void HandleActionFollow(CUnit &unit); 00163 extern int DoActionMove(CUnit &unit); 00165 extern void HandleActionMove(CUnit &unit); 00167 extern void HandleActionRepair(CUnit &unit); 00169 extern void HandleActionPatrol(CUnit &unit); 00171 extern void AnimateActionAttack(CUnit &unit); 00173 extern void HandleActionAttack(CUnit &unit); 00175 extern void HandleActionBoard(CUnit &unit); 00177 extern void HandleActionUnload(CUnit &unit); 00179 extern void HandleActionResource(CUnit &unit); 00181 extern void HandleActionReturnGoods(CUnit &unit); 00183 extern void HandleActionDie(CUnit &unit); 00185 extern void HandleActionBuild(CUnit &unit); 00187 extern void HandleActionBuilt(CUnit &unit); 00189 extern void HandleActionTrain(CUnit &unit); 00191 extern void HandleActionUpgradeTo(CUnit &unit); 00193 extern void HandleActionTransformInto(CUnit &unit); 00195 extern void HandleActionUpgrade(CUnit &unit); 00197 extern void HandleActionResearch(CUnit &unit); 00199 extern void HandleActionSpellCast(CUnit &unit); 00200 00201 /*---------------------------------------------------------------------------- 00202 -- Actions: actions.c 00203 ----------------------------------------------------------------------------*/ 00204 00206 extern int UnitShowAnimationScaled(CUnit &unit, const CAnimation *anim, int scale); 00208 extern int UnitShowAnimation(CUnit &unit, const CAnimation *anim); 00210 extern void UnitActions(); 00211 00213 00214 #endif // !__ACTIONS_H__