added stats to battle system

This commit is contained in:
2025-11-30 02:46:10 +01:00
parent 587a852ffb
commit 138db014ba
3 changed files with 16 additions and 4 deletions

View File

@@ -82,7 +82,10 @@ public class Entity {
if(this.type == EntityType.MONSTER && contactPlayer) {
if(panel.player.invincible) return;
panel.playSE(6);
panel.player.life -= 1;
int damage = attack - panel.player.defense;
panel.player.life -= Math.max(damage, 0);
panel.player.invincible = true;
}