Linux multi-monitor fullscreen support
[ryzomcore.git] / ryzom / common / src / game_share / outpost.h
bloba951d1afb4690127428413ba4cce04d84b150f70
1 // Ryzom - MMORPG Framework <http://dev.ryzom.com/projects/ryzom/>
2 // Copyright (C) 2010 Winch Gate Property Limited
3 //
4 // This program is free software: you can redistribute it and/or modify
5 // it under the terms of the GNU Affero General Public License as
6 // published by the Free Software Foundation, either version 3 of the
7 // License, or (at your option) any later version.
8 //
9 // This program is distributed in the hope that it will be useful,
10 // but WITHOUT ANY WARRANTY; without even the implied warranty of
11 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 // GNU Affero General Public License for more details.
14 // You should have received a copy of the GNU Affero General Public License
15 // along with this program. If not, see <http://www.gnu.org/licenses/>.
17 /** @page outpost
19 The new outpost system is defined by the document outpost-v2.doc.
23 #ifndef RY_OUTPOSTENUMS_H
24 #define RY_OUTPOSTENUMS_H
26 #include "nel/misc/types_nl.h"
28 namespace OUTPOSTENUMS
30 const uint32 MAX_OUTPOST = 16; // Same as (#x) in the database SERVER:GUILD:OUTPOST:O#x:S see (database.xml)
32 const uint32 OUTPOST_MAX_SPAWN_ZONE = 16; // Same as (#y) in the database SERVER:GUILD:OUTPOST:O#x:SPAWN_ZONE:#y see (database.xml)
33 const uint32 OUTPOST_MAX_SQUAD_SHOP = 16; // Same as (#y) in the database SERVER:GUILD:OUTPOST:O#x:SQUAD_SHOP:#y see (database.xml)
35 const uint32 OUTPOST_NB_SQUAD_SLOTS = 12;
36 const uint32 OUTPOST_MAX_SQUAD_TRAINING = OUTPOST_NB_SQUAD_SLOTS * 2; // Same as (#y) in the database SERVER:GUILD:OUTPOST:O#x:S:T#y see (database.xml)
37 const uint32 OUTPOST_MAX_SQUAD_SPAWNED = OUTPOST_MAX_SQUAD_TRAINING; // Same as (#y) in the database SERVER:GUILD:OUTPOST:O#x:S:S#y see (database.xml)
39 const uint32 OUTPOST_MAX_BUILDINGS = 4; // Same as (#y) in the database SERVER:GUILD:OUTPOST:O#x:BUILDINGS:#y see (database.xml)
42 // :NOTE: All enums fisrt entry is the undefined state. Uninitialized
43 // enums would be created in that state, which is invalid. It will
44 // consistently take the value 0.
46 /// PVP type of the outpost
47 enum TPVPType
49 UnknownPVPType,
50 PVE, // can only be attacked if the outpost is held by a tribe and if the attacking guild comes from the same continent as the outpost
51 PVP, // can only be attacked if the attacking guild comes from the same continent as the outpost
52 RVR, // can only be attacked if the attacking guild comes from another continent as the outpost
53 Full // same as RVR but cant be set by the high council
56 enum TPVPSide
58 OutpostOwner = 0,
59 OutpostAttacker = 1,
60 UnknownPVPSide
63 // :NOTE: The outpost state machine is defined by a list of possible
64 // states for the outpost, a list of possible events, a list of possible
65 // actions (which can change the state of the outpost), and some event
66 // handlers. It is possible to associate an event handler to a state/event
67 // pair. An event handler can call some actions, which may affect the
68 // current state of the outpost or some internal variables of it.
70 /// current state of the outpost
71 enum TOutpostState
73 UnknownOutpostState,
74 Peace, // nothing happens
75 WarDeclaration, // a guild declared war on the outpost
76 AttackBefore, // the delay between war declaration and war has elapsed. Attacker tries to take the outpost
77 AttackRound, // ...
78 AttackAfter,
79 DefenseBefore, // the attack was successful. The attacker must now defend the outpost
80 DefenseRound, // ...
81 DefenseAfter
84 /// events that can affect outpost state
85 enum TOutpostEvent
87 UnknownOutpostEvent,
88 StartOfState, // this is when the state starts
89 EndOfState, // this is when the state ends
90 Challenged, // the outpost was challenged
91 OwnerVanished, // the owner guild vanished
92 AttackerVanished, // the attacker guild vanished
93 Timer0End, // the current state timer reached its end, there may
94 Timer1End, // be 3 concurrent timers, one for the phase, one
95 Timer2End, // for the combat round, and one for the squad spawn
96 AttackerGiveUp, // the attack guild gave up the attack
97 OwnerGiveUp, // the owner guild gave up the outpost
98 SquadKilled, // a defending squad was killed
99 EventAisUp, // the ais of the outpost started (or we did)
100 EventAisDown, // the ais of the outpost stopped
101 // AllSquadsKilled, // all defending squads were killed
104 /// type of the squad
105 enum TSquadType
107 UnknownSquadType,
108 Default, // squad recruited automatically when the outpost is taken
109 Recruited, // squad recruited by the guild
110 Mercenary // a special mercenary squad
113 /// current state of a building used for database
114 enum TOutpostBuildingState
116 UnknownOutpostBuildingState,
117 BuildingInPlace, // In place (constructed)
118 BuildingConstructing // Constructing
121 /// current state of a state
122 enum TSquadState
124 UnknownSquadState,
125 NotCreated, // squad has not been created in AIS
126 NotReady, // squad is not ready to be spawned
127 NotSpawned, // squad is ready and waiting to be spawned
128 Spawning, // spawn order has been issued but not yet confirmed
129 Spawned, // squad is spawned
130 Dead // squad is dead
133 /// events that can affect outpost state
134 enum TSpecialOutpostEvent
136 UnknownSpecialOutpostEvent,
137 PeaceStateBegin, // State of outpost is now peace
138 PeaceStateEnd, // State of outpost is no more peace
139 TribeOwnershipBegin, // Owner of the outpost is now a tribe (even if not in peace)
140 TribeOwnershipEnd, // Owner of the outpost is no more a tribe
141 GuildOwnershipBegin, // Owner of the outpost is now a guild (even if not in peace)
142 GuildOwnershipEnd, // Owner of the outpost is no more a guild
143 StateChanged, // State of outpost changed
144 OwnerChanged, // Owner of outpost changed
145 AttackerChanged // Attacker of outpost changed
148 std::string const& toString(TPVPType val);
149 TPVPType toPVPType(std::string const& val);
150 std::string const& toString(TPVPSide val);
151 TPVPSide toPVPSide(std::string const& val);
152 std::string const& toString(TOutpostState val);
153 TOutpostState toOutpostState(std::string const& val);
154 std::string const& toString(TOutpostEvent val);
155 TOutpostEvent toOutpostEvent(std::string const& val);
156 std::string const& toString(TSquadType val);
157 TSquadType toSquadType(std::string const& val);
158 std::string const& toString(TSquadState val);
159 TSquadState toSquadState(std::string const& val);
160 std::string const& toString(TSpecialOutpostEvent val);
161 TSpecialOutpostEvent toSpecialOutpostEvent(std::string const& val);
165 #endif