aboutsummaryrefslogtreecommitdiff
path: root/gst/info.c
diff options
context:
space:
mode:
Diffstat (limited to 'gst/info.c')
-rw-r--r--gst/info.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/gst/info.c b/gst/info.c
index eab41a2..2329baf 100644
--- a/gst/info.c
+++ b/gst/info.c
@@ -238,6 +238,17 @@ float info_unit_get_range(infos *info, info_unit *u, int w) {
return sum;
}
+float info_unit_get_maxrange(infos *info, info_unit *u) {
+ int lc = u->levels[LEVEL_CHASSIS];
+ float sum = 0;
+ for(int i=0; i<info->chassis[u->chassis].slot_weapon[lc]; i++) {
+ if (u->weapons[i] != -1) {
+ sum += info_unit_get_range(info, u, i);
+ }
+ }
+ return sum;
+}
+
float info_unit_get_charge_per_shot (infos *info, info_unit *u, int w) {
float sum = 0;
int lw = u->levels[LEVEL_WEAPONS+w];
@@ -311,6 +322,7 @@ float info_unit_get_cost (infos *info, info_unit *u) {
}
+
void weapon_init (info_weapon *w) {
strcpy(w->name, "nameless");
for (int l=0; l<MAXLEVEL; l++) {