From 23550f8120ebb41b1732d63d6d09c21bdb314c1a Mon Sep 17 00:00:00 2001 From: jacopo grandi Date: Thu, 25 Feb 2021 12:46:55 +0100 Subject: component representation revolution! Vive la révolution MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- gst/info.h | 55 ++++++++++++++++++++++++++++++++++++++++++++++++++++++- 1 file changed, 54 insertions(+), 1 deletion(-) (limited to 'gst/info.h') diff --git a/gst/info.h b/gst/info.h index 6417cda..825f48c 100644 --- a/gst/info.h +++ b/gst/info.h @@ -13,7 +13,57 @@ #define LEVEL_ARMOR 11 #define LEVEL_AUGS 19 -typedef struct { +#define STATS_CHASSIS 0 +#define STATS_BRAIN 1 +#define STATS_BATTERY 2 +#define STATS_WEAPONS 3 +#define STATS_ARMOR 4 +#define STATS_AUGS 5 + +// loaded stats +typedef struct { + float damage[7]; + float cooldown; + float aoe; + float knockback; + float damage_battery; + float stun; + float armor_reduce[7]; + float charge_per_shot; +} stats_weapon; + +typedef struct { + float hp; + float weight; + float weight_max; + int slot_weapon; + int slot_armor; + int slot_aug; + float speed; + float upkeep; + float capacity; + float recharge; + float armor[7]; +} stats_frame; + +typedef struct { + char name[32]; + char description[256]; + stats_frame base[MAXLEVEL]; + stats_frame perc[MAXLEVEL]; + stats_weapon base_weapon[MAXLEVEL]; + stats_weapon perc_weapon[MAXLEVEL]; +} stats_comp; + + +// computed stats ready for army use +typedef struct { + stats_frame frame; + stats_weapon weapon[8]; +} stats_unit; + + +typedef struct { char name[32]; // indexes of info.* int8_t chassis; @@ -100,6 +150,9 @@ typedef struct { int augslen; info_brain brains[32]; int brainslen; + + stats_comp *stats[5]; + int statslen[5]; } infos; void info_unit_init (info_unit *u); -- cgit v1.2.3-54-g00ecf