diff options
author | Stijn Buys <ingar@osirion.org> | 2012-11-18 15:10:37 +0000 |
---|---|---|
committer | Stijn Buys <ingar@osirion.org> | 2012-11-18 15:10:37 +0000 |
commit | ab61530779c73e7e145193efcb1e23a47c16e7f3 (patch) | |
tree | 9aed75947be45585cf884effc3a59575a1b1bb8e /src/game/base/ship.h | |
parent | 69b0cd536aee5cf948e5a97af4df3dd75a545bd0 (diff) |
Implements server-side ship damage,
adds a damage key to the weapons.ini file,
configurable spacemine damage.
Diffstat (limited to 'src/game/base/ship.h')
-rw-r--r-- | src/game/base/ship.h | 59 |
1 files changed, 49 insertions, 10 deletions
diff --git a/src/game/base/ship.h b/src/game/base/ship.h index 2670ee2..d68c647 100644 --- a/src/game/base/ship.h +++ b/src/game/base/ship.h @@ -16,7 +16,9 @@ namespace game { -/// A ship in the game, controled by a player +/** + * @brief A ship in the game, controled by a player + * */ class Ship : public core::EntityControlable { public: @@ -26,45 +28,65 @@ public: /* -- inspectors ------------------------------------------- */ /// shipmodel - inline const ShipModel *shipmodel() const { + inline const ShipModel *shipmodel() const + { return ship_shipmodel; } /// impulse drive force - inline const float impulse_force() const { + inline const float impulse_force() const + { return ship_impulse_force; } /// thruster force - inline const float thrust_force() const { + inline const float thrust_force() const + { return ship_thrust_force; } /// strafe force - inline const float strafe_force() const { + inline const float strafe_force() const + { return ship_strafe_force; } /// turn force - inline const float turn_force() const { + inline const float turn_force() const + { return ship_turn_force; } /// roll force - inline const float roll_force() const { + inline const float roll_force() const + { return ship_roll_force; } /// entity the ship is currently docked at - inline core::Entity *dock() { + inline core::Entity *dock() + { return ship_dock; } /// (dockable) entity where the ship will respawn if destroyed - core::Entity *spawn() { + core::Entity *spawn() + { return ship_spawn; } + /// maximum amount of armor + inline const float maxarmor() const + { + return ship_maxarmor; + } + + /// current amount of armor + inline const float armor() const + { + return ship_armor; + } + /* -- mutators --------------------------------------------- */ /// physics frame @@ -112,6 +134,18 @@ public: ship_roll_force = roll; } + /// set maximal armor amount (100% health) + inline void set_maxarmor(const float maxarmor) + { + ship_maxarmor = maxarmor; + } + + /// set current armor amount (current health) + inline void set_armor(const float armor) + { + ship_armor = armor; + } + /// Initiate jump, departing from a jump point void initiate_jump(JumpPoint *depart); @@ -154,7 +188,6 @@ private: bool ship_jumpdrive; float ship_jumpdrive_timer; - float ship_impulsedrive_timer; JumpPoint *ship_jumpdepart; @@ -165,6 +198,12 @@ private: float ship_turn_force; float ship_roll_force; + float ship_maxarmor; + float ship_armor; + + float ship_maxshield; + float ship_shield; + core::Entity *ship_dock; core::Entity *ship_spawn; |