Starshatter_Open
Open source Starshatter engine
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Friends Macros
Shield.h
Go to the documentation of this file.
1 /* Project Starshatter 4.5
2  Destroyer Studios LLC
3  Copyright © 1997-2004. All Rights Reserved.
4 
5  SUBSYSTEM: Stars.exe
6  FILE: Shield.h
7  AUTHOR: John DiCamillo
8 
9 
10  OVERVIEW
11  ========
12  Conventional Shield (system) class
13 */
14 
15 #ifndef Shield_h
16 #define Shield_h
17 
18 #include "Types.h"
19 #include "System.h"
20 #include "Geometry.h"
21 
22 // +--------------------------------------------------------------------+
23 
24 class Shot;
25 class Sound;
26 
27 // +--------------------------------------------------------------------+
28 
29 class Shield : public System
30 {
31 public:
33 
34  Shield(SUBTYPE s);
35  Shield(const Shield& rhs);
36  virtual ~Shield();
37 
38  virtual void ExecFrame(double seconds);
39  double DeflectDamage(Shot* shot, double shot_damage);
40 
41  double ShieldLevel() const { return shield_level * 100; }
42  double ShieldFactor() const { return shield_factor; }
43  double ShieldCurve() const { return shield_curve; }
44  void SetShieldFactor(double f) { shield_factor = (float) f; }
45  void SetShieldCurve(double c) { shield_curve = (float) c; }
46  double ShieldCutoff() const { return shield_cutoff; }
47  void SetShieldCutoff(double f) { shield_cutoff = (float) f; }
48  double Capacity() const { return capacity; }
49  double Consumption() const { return sink_rate; }
50  void SetConsumption(double r) { sink_rate = (float)r; }
51  bool ShieldCapacitor() const { return shield_capacitor; }
52  void SetShieldCapacitor(bool c);
53  bool ShieldBubble() const { return shield_bubble; }
54  void SetShieldBubble(bool b) { shield_bubble = b; }
55  double DeflectionCost() const { return deflection_cost; }
56  void SetDeflectionCost(double c) { deflection_cost = (float) c; }
57 
58  // override from System:
59  virtual void SetPowerLevel(double level);
60  virtual void SetNetShieldLevel(int level);
61 
62  virtual void Distribute(double delivered_energy, double seconds);
63  virtual void DoEMCON(int emcon);
64 
65 protected:
69  float shield_level;
70  float shield_curve;
74 };
75 
76 #endif Shield_h
77