JNR
laMonster.h
1 /*
2 
3 Jump'n'Run Engine
4 http://www.atanaslaskov.com/jnr/
5 
6 BSD LICENSE
7 Copyright (c) 2007-2013, Atanas Laskov
8 All rights reserved.
9 
10 Redistribution and use in source and binary forms, with or without
11 modification, are permitted provided that the following conditions are met:
12 1. Redistributions of source code must retain the above copyright notice,
13 this list of conditions and the following disclaimer.
14 2. Redistributions in binary form must reproduce the above copyright notice,
15 this list of conditions and the following disclaimer in the documentation
16 and/or other materials provided with the distribution.
17 THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
18 ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
19 WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
20 DISCLAIMED. IN NO EVENT SHALL ATANAS LASKOV BE LIABLE FOR ANY
21 DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
22 (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
23 LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
24 ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
25 (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
26 SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
27 
28 */
29 #ifndef M_MONSTER_H
30 #define M_MONSTER_H
31 
33 
34 
40 
41 #define M_MATTACK_TOUCH 0
42 #define M_MATTACK_MAIN 1
43 #define M_MATTACK_ALT 2
44 
45 class laMonster :
46  public laFightingCreature
47 {
48  //Can be constructed from class name
49  CLASS_NAME(laMonster);
50 
51  M_BOOL _isInRange(laFightingCreature* pAgressor, laFightingCreature* pTarget);
52 
53 protected:
54  // Monster Variation
55  // double _dSpeedVar;
56 
57  // Monster territory
58  //
59  double _dDeltaL;
60  double _dDeltaR;
61 
62  // GUI objects
63  //
64  static laTexture _texInRange;
65  static laTexture _texNPCInRange;
66 
67  cuiProgressBar _IndicatorHP;
68  cuiProgressBar _IndicatorAttack;
69 
70  // Aggressive mode
71  // Note: This can affect player interaction
72  // and the visiblility of battle GUI
73  M_BOOL _bAgressiveMode;
74  M_BOOL _bEnable_Battle_GUI;
75  M_BOOL _bEnable_NPC_GUI;
76 
77  // Draw battle GUI
78  void _draw_battle_gui(laRenderer *r);
79  void _draw_npc_gui(laRenderer *r);
80 
81  virtual void _execute_ai(laTimer &t);
82 
83 public:
84  laMonster(void);
85  ~laMonster(void);
86 
87  // This method is part of the laLoadableObj interface
88  virtual void load(class laFileParser *fp);
89 
90  // Respawn
91  virtual void respawn();
92 
93  //Get range
94  double getLeftRange() {return _dDeltaL; };
95  double getRightRange() {return _dDeltaR; };
96 
97  // Draw
98  virtual void _drawFx_positioned(laRenderer *r);
99  virtual void drawInterface(laRenderer *r, laPoint3 ptBasePos);
100 
101  //Enable battle GUI
102  void agressive(M_BOOL bOn) { _bAgressiveMode = bOn; }
103  M_BOOL isAgressive() { return _bAgressiveMode; }
104 
105  void enableBattleGUI(M_BOOL on = M_TRUE) { _bEnable_Battle_GUI = on; };
106  void enableNPCGUI(M_BOOL on = M_TRUE) { _bEnable_NPC_GUI = on; };
107 };
109 #endif
2D Texture
Definition: laTexture.h:45
Adds capabilities and percepts specific to monster creatures.
Definition: laMonster.h:45
Virtual interface for the Engine graphics renderer.
Definition: laRenderer.h:98
File Parser.
Definition: laFileParser.h:41