t_unit: removed min and max damage. units now do exact damage.
authorLukas Krickl <lukas@krickl.dev>
Mon, 23 Feb 2026 19:00:44 +0000 (20:00 +0100)
committerLukas Krickl <lukas@krickl.dev>
Mon, 23 Feb 2026 19:00:44 +0000 (20:00 +0100)
src/t_unit.h

index 6335bbe573b6a79399fd31dc2f65bb72142e58b8..42d09a2cda5ee0236123377d6dcda7a339e3078b 100644 (file)
@@ -19,10 +19,24 @@ enum t_unit_damage_type {
        T_UNIT_SIEGE
 };
 
+/* 
+ * unit class
+ * each class has weaknesses to 
+ * certain damage types
+ */
+enum t_unit_class {
+       T_UNIT_CLASS_INFANTRY,
+       T_UNIT_CLASS_MOUNTED,
+       T_UNIT_CLASS_SIEGE,
+       T_UNIT_CLASS_BUILDING
+};
+
 struct t_unit {
        unsigned int id;
        enum t_unit_type type;
        enum t_unit_flags flags;
+       enum t_unit_class unit_class;
+       enum t_unit_damage_type damage_type;
        
        i16 view_radius;
 
@@ -31,12 +45,7 @@ struct t_unit {
        i16 armor;
 
        /* Unit damage type and damage range */
-       i16 damage_min;
-       i16 damage_max;
-       enum t_unit_damage_type damage_type;
-
-       /* a unit can be reistant to certain damage types */
-       enum t_unit_damage_type res;
+       i16 damage;
 
        struct t_command_queue commands;
 };