@Override public void notify_event(Event e) { super.notify_event(e); if (e instanceof ETakeDamage) { ETakeDamage dmg_event = (ETakeDamage) e; if (dmg_event.ent.equals(Player.get_ent())) { update_stats(); } } }
public static void update_stats() { Combat combat = Player.get_ent().get_combat(); if (combat == null) { return; } String[] stats = Stats.stats; for (int i = 0; i < stats.length; i++) { int stat_value = combat.stats.get_stat(stats[i]); update_stat(stats[i], stat_value); } hp_val.text = combat.get_hp() + "/" + combat.get_max_hp(); }