aboutsummaryrefslogtreecommitdiff
path: root/src/unit
diff options
context:
space:
mode:
authorXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-27 13:54:57 +0100
committerXavier Del Campo Romero <xavi.dcr@tutanota.com>2024-01-27 17:38:11 +0100
commitb4f904ecdcf6b0857d28ab4a877ad0f3468153f7 (patch)
tree656b7c75ff57963e18dac972e38baf9ba3d46ddb /src/unit
parent69f753d26f44c28668d23e0ba40bb3994141df82 (diff)
downloadjancity-b4f904ecdcf6b0857d28ab4a877ad0f3468153f7.tar.gz
Remove hp
Diffstat (limited to 'src/unit')
-rw-r--r--src/unit/inc/unit.h4
-rw-r--r--src/unit/src/unit.c12
2 files changed, 0 insertions, 16 deletions
diff --git a/src/unit/inc/unit.h b/src/unit/inc/unit.h
index a200c63..d86704d 100644
--- a/src/unit/inc/unit.h
+++ b/src/unit/inc/unit.h
@@ -25,8 +25,6 @@ struct unit_target
{
struct instance *ins;
enum unit_state state;
- instance_sheltered_cb shelter;
- instance_attacked_cb attack;
instance_done_cb done;
void *op;
};
@@ -73,9 +71,7 @@ bool unit_can_harvest(const struct unit *u);
bool unit_target_valid(const struct unit *u, const struct unit_target *t);
void unit_set_target(struct unit *u, const struct unit_target *t);
void unit_move_to(struct unit *u, unsigned long x, unsigned long y);
-bool unit_attacked(struct instance *, instance_hp ap);
void unit_update(struct unit *u);
-instance_hp unit_maxhp(const struct unit *u);
const char *unit_str(const struct unit *u);
enum
diff --git a/src/unit/src/unit.c b/src/unit/src/unit.c
index 0590adb..a95cca3 100644
--- a/src/unit/src/unit.c
+++ b/src/unit/src/unit.c
@@ -216,16 +216,6 @@ void unit_move_to(struct unit *const u, const unsigned long x, const unsigned lo
u->ty = y > y_off ? fix16_from_int(y - y_off) : 0;
}
-instance_hp unit_maxhp(const struct unit *const u)
-{
- static const instance_hp hp[] =
- {
- [UNIT_TYPE_PEASANT] = 25
- };
-
- return hp[u->type];
-}
-
static int get_ux(const struct unit *const u)
{
switch (u->dir)
@@ -416,7 +406,6 @@ int unit_render(const struct unit *const u, const struct camera *const cam,
.prim = {.quad = &rcfg.qcfg},
.cam = cam,
.sel = sel,
- .max_hp = unit_maxhp(u),
.off = &rcfg.off
};
@@ -448,7 +437,6 @@ void unit_create(const struct unit_cfg *const cfg, struct unit *const u)
.instance =
{
.alive = true,
- .hp = unit_maxhp(u)
},
.type = cfg->type,