Project::OSiRiON - Git repositories
Project::OSiRiON
News . About . Screenshots . Downloads . Forum . Wiki . Tracker . Git
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorStijn Buys <ingar@osirion.org>2013-11-10 19:01:43 +0000
committerStijn Buys <ingar@osirion.org>2013-11-10 19:01:43 +0000
commitf009487bbe6120f8f487302f5e1bb4ae606a51af (patch)
treeedb7d8a2bbbfba3adf5641180dc221a7269c74ab /src/game/base/npc.h
parentaaf57b8aa9cbc8287f298de2b19861eb23aec2f3 (diff)
Made NPCs only fire weapons on enemies within weapon range.
Diffstat (limited to 'src/game/base/npc.h')
-rw-r--r--src/game/base/npc.h9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/game/base/npc.h b/src/game/base/npc.h
index 68620e1..39395c0 100644
--- a/src/game/base/npc.h
+++ b/src/game/base/npc.h
@@ -76,7 +76,6 @@ public:
* */
virtual void frame(const unsigned long elapsed);
-
/**
* @brief factory function for wingman NPCs
* */
@@ -86,6 +85,12 @@ public:
* @brief aim at closest enemy in range, returns target
* */
Ship *target_closest_enemy();
+
+ /**
+ * @brief calculate weapon range
+ * Calling calculate_weapon_range() will set npc_weapon_range.
+ * */
+ void calculate_weapon_range();
private:
Mood npc_mood;
@@ -96,6 +101,8 @@ private:
unsigned long npc_destroyed_timestamp;
+ float npc_weapon_range;
+
}; // class NPC
} // namespace game