ManaPlus
elementalrecv.cpp
Go to the documentation of this file.
1 /*
2  * The ManaPlus Client
3  * Copyright (C) 2011-2019 The ManaPlus Developers
4  * Copyright (C) 2019-2021 Andrei Karas
5  *
6  * This file is part of The ManaPlus Client.
7  *
8  * This program is free software; you can redistribute it and/or modify
9  * it under the terms of the GNU General Public License as published by
10  * the Free Software Foundation; either version 2 of the License, or
11  * any later version.
12  *
13  * This program is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
16  * GNU General Public License for more details.
17  *
18  * You should have received a copy of the GNU General Public License
19  * along with this program. If not, see <http://www.gnu.org/licenses/>.
20  */
21 
23 
24 #include "being/playerinfo.h"
25 
26 #include "net/messagein.h"
27 
28 #include "net/eathena/sp.h"
29 
30 #include "utils/checkutils.h"
31 
32 #include "debug.h"
33 
34 namespace EAthena
35 {
36 
37 #define setElementalStat(sp, stat) \
38  case sp: \
39  PlayerInfo::setStatBase(stat, \
40  val, \
41  Notify_true); \
42  break
43 
45 {
46  const int sp = msg.readInt16("type");
47  const int val = msg.readInt32("value");
48  switch (sp)
49  {
54  default:
55  reportAlways("Unknown elemental stat %d",
56  sp)
57  break;
58  }
59 }
60 
62 {
63  const BeingId id = msg.readBeingId("elemental id");
65  msg.readInt32("hp"),
66  Notify_true);
68  msg.readInt32("max hp"),
69  Notify_true);
71  msg.readInt32("sp"),
72  Notify_true);
74  msg.readInt32("max sp"),
75  Notify_true);
77 }
78 
79 } // namespace EAthena
int BeingId
Definition: beingid.h:30
#define reportAlways(...)
Definition: checkutils.h:253
#define setElementalStat(sp, stat)
bool msg(InputEvent &event)
Definition: chat.cpp:39
@ ELEMENTAL_MAX_MP
Definition: attributes.h:114
@ ELEMENTAL_MAX_HP
Definition: attributes.h:112
void processElementalInfo(Net::MessageIn &msg)
void processElementalUpdateStatus(Net::MessageIn &msg)
void setElemental(const BeingId id)
Definition: playerinfo.cpp:539
void setStatBase(const AttributesT id, const int value, const Notify notify)
Definition: playerinfo.cpp:143
@ MAXSP
Definition: sp.h:39
@ SP
Definition: sp.h:38
@ HP
Definition: sp.h:36
@ MAXHP
Definition: sp.h:37
const bool Notify_true
Definition: notify.h:30