Pol  Revision:cb584c9
vitalmod.h
Go to the documentation of this file.
1 
9 #ifndef VITALEMOD_H
10 #define VITALEMOD_H
11 
12 #include <stddef.h>
13 
14 #include "../../bscript/execmodl.h"
15 #include "uomod.h"
16 
17 namespace Pol
18 {
19 namespace Bscript
20 {
21 class BObjectImp;
22 class Executor;
23 } // namespace Bscript
24 namespace Module
25 {
26 class UOExecutorModule;
27 } // namespace Module
28 } // namespace Pol
29 
30 namespace Pol
31 {
32 namespace Mobile
33 {
34 class Character;
35 }
36 namespace Module
37 {
38 class VitalExecutorModule : public Bscript::TmplExecutorModule<VitalExecutorModule>
39 {
40 public:
42 
43  Bscript::BObjectImp* mf_ApplyRawDamage();
44  Bscript::BObjectImp* mf_ApplyDamage();
45 
46  Bscript::BObjectImp* mf_HealDamage();
47 
48  Bscript::BObjectImp* mf_ConsumeMana();
49 
50  Bscript::BObjectImp* mf_ConsumeVital( /* mob, vital, hundredths */ );
51  Bscript::BObjectImp* mf_RecalcVitals( /* mob, attributes, vitals */ );
52 
53  Bscript::BObjectImp* mf_GetVitalName( /*alias_name*/ );
54 
55  Bscript::BObjectImp* mf_GetVital( /* mob, vitalid */ );
56  Bscript::BObjectImp* mf_GetVitalMaximumValue( /* mob, vitalid */ );
57  Bscript::BObjectImp* mf_GetVitalRegenRate( /* mob, vitalid */ );
58 
59  Bscript::BObjectImp* mf_SetVitalMaximumValue( /* mob, vitalid, value */ );
60  Bscript::BObjectImp* mf_SetVital( /* mob, vitalid, value */ );
61  Bscript::BObjectImp* mf_SetVitalRegenRate( /* mob, vitalid, rate */ );
62 
63 private:
64  Mobile::Character* GetUOController();
65 };
66 
68 {
69  UOExecutorModule* uo_module = static_cast<UOExecutorModule*>( exec.findModule( "UO" ) );
70 
71  if ( uo_module != nullptr && uo_module->controller_.get() )
72  return uo_module->controller_.get();
73  else
74  return nullptr;
75 }
76 }
77 }
78 #endif
Core::CharacterRef controller_
Definition: uomod.h:314
Mobile::Character * GetUOController()
Definition: vitalmod.h:67
Definition: berror.cpp:12