Peoplemon  0.1.0
Peoplemon 3 game source documentation
Message.hpp
Go to the documentation of this file.
1 #ifndef GAME_BATTLES_COMMANDS_MESSAGE_HPP
2 #define GAME_BATTLES_COMMANDS_MESSAGE_HPP
3 
4 #include <Core/Items/Id.hpp>
9 #include <cstdint>
10 #include <string>
11 #include <variant>
12 
13 namespace core
14 {
15 namespace battle
16 {
17 namespace cmd
18 {
26 class Message {
27 public:
32  enum struct Type : std::uint8_t {
33  _ERROR = 0,
34 
35  Attack = 1,
41 
42  Callback,
43  SendOut,
44 
46  WildIntro,
48 
51 
59 
66  RandomMove,
67  Absorb,
68  NoPPDeath,
73 
77 
78  Guarded,
82 
91 
94 
101 
104 
106  PeanutAte,
107 
108  EncoreStart,
109  EncoreFailed,
110 
114 
118 
119  GambleOne,
120  GambleTwenty,
121  GambleMiddle,
122 
123  BallServed,
124  BallBumped,
125  BallSet,
126  BallSetFail,
127  BallSpiked,
129  BallSwiped,
131  BallBlocked,
135  BallKillSelf,
140 
141  PPLowered,
142  PPLowerFail,
143 
144  EndureStart,
145  Endured,
146  EndureFail,
147 
149  SpikesFailed,
150  SpikesDamage,
151 
154  HealNextFail,
155 
156  Roar,
159 
162 
163  SleepHealed,
165 
166  WokeUp,
168 
169  Fainted,
170  TrainerLost,
171  WonMoney,
172  WhiteoutA,
173  WhiteoutB,
175 
176  AwardedXp,
177  LevelUp,
180  ForgotMove,
181  LearnedMove,
183 
184  IsConfused,
187 
191  AnnoyAilment,
194 
196  ThawedOut,
197 
201  GoonDamage,
204  SassyDamage,
205  BeefyPower,
207  DukeOfJokes,
210  KlutzDrop,
233 
234  PreUseItem,
236  ItemNoEffect,
237 
241  GlassesAcc,
242  SpoonDamage,
245  SketchySack,
247  WakeUpBelle,
248  PowerJuice,
249  IcedTea,
250  SpeedJuice,
251 
253  RunFailed,
254  RunAway,
255 
265  };
266 
272  Message(Type type);
273 
280  Message(pplmn::MoveId move, bool forHost);
281 
289  Message(Type type, pplmn::MoveId oldMove, pplmn::MoveId newMove);
290 
297  Message(Type type, bool forHost);
298 
306  Message(Type type, pplmn::Ailment ailment, bool forHost);
307 
315  Message(Type type, pplmn::PassiveAilment ailment, bool forHost);
316 
324  Message(Type type, pplmn::Stat stat, bool forHost);
325 
333  Message(Type type, std::int16_t ival, bool forHost);
334 
344  Message(Type type, std::uint8_t index, unsigned int ival, bool forHost);
345 
354  Message(Type type, std::uint8_t index, pplmn::MoveId move, bool forHost);
355 
363  Message(Type type, pplmn::MoveId move, bool forHost);
364 
372  Message(Type type, item::Id item, bool forHost);
373 
382  Message(Type type, std::uint8_t index, item::Id item, bool forHost);
383 
388  Type getType() const;
389 
394  pplmn::MoveId getMoveId() const;
395 
400  bool forHostBattler() const;
401 
406  std::uint8_t forIndex() const;
407 
412  pplmn::Ailment getAilment() const;
413 
419 
424  pplmn::Stat getStat() const;
425 
431 
436  pplmn::MoveId getNewMove() const;
437 
442  std::int16_t getInt() const;
443 
448  std::uint16_t getUnsigned() const;
449 
454  item::Id getItem() const;
455 
456 private:
457  struct Empty {};
458 
459  Type type;
461  std::pair<pplmn::MoveId, pplmn::MoveId>, std::int16_t, std::uint16_t, item::Id>
462  data;
463  bool forHost;
464  std::uint8_t pplIndex;
465 };
466 
467 } // namespace cmd
468 } // namespace battle
469 } // namespace core
470 
471 #endif
Id
Represents an item in its simplist form.
Definition: Id.hpp:24
PassiveAilment
Represents a passive ailment a Peoplemon can have.
Stat
Represents a single stat. Used as an offset to access Stats as an array.
Definition: Stat.hpp:16
Ailment
Represents an ailment that a Peoplemon can have.
Definition: Ailment.hpp:16
MoveId
The id of a move.
Definition: MoveId.hpp:16
Core classes and functionality for both the editor and game.
Represents a message to be displayed. The actual message text is generated by the battle controller.
Definition: Message.hpp:26
pplmn::MoveId getMoveId() const
Returns the move id of the message.
Definition: Message.cpp:81
Type
The type of message to display.
Definition: Message.hpp:32
Message(Type type)
Construct a new Message.
Definition: Message.cpp:11
std::uint16_t getUnsigned() const
Returns the unsigned int value stored in this message.
Definition: Message.cpp:120
item::Id getItem() const
Returns the item for this message.
Definition: Message.cpp:125
pplmn::MoveId getOriginalMove() const
Returns the original move for the message.
Definition: Message.cpp:105
std::int16_t getInt() const
Returns the integer bundled with this message.
Definition: Message.cpp:115
pplmn::Ailment getAilment() const
Returns the ailment for this message.
Definition: Message.cpp:90
pplmn::PassiveAilment getPassiveAilment() const
Returns the passive ailment for this message.
Definition: Message.cpp:95
pplmn::Stat getStat() const
Returns the stat for this message.
Definition: Message.cpp:100
std::uint8_t forIndex() const
Returns the peoplemon index the message is for.
Definition: Message.cpp:88
bool forHostBattler() const
Returns whether or not this message is for the active battler or not.
Definition: Message.cpp:86
Type getType() const
Returns the type of message this is.
Definition: Message.cpp:79
pplmn::MoveId getNewMove() const
Returns the new move for the message.
Definition: Message.cpp:110