fix: scale monster DEF with floor level like HP/ATK

This commit is contained in:
2026-03-24 10:17:48 +09:00
parent e3e6c5105c
commit ae3375a023
4 changed files with 33 additions and 1 deletions

View File

@@ -0,0 +1,18 @@
{
"permissions": {
"allow": [
"Bash(go build:*)",
"Bash(find . -name \"*.go\" -type f -exec wc -l {} +)",
"Bash(sort -k2)",
"Bash(where go:*)",
"Read(//c/Users/SSAFY/sdk/**)",
"Read(//c/Users/98kim/**)",
"Bash(go test:*)",
"Bash(git add:*)",
"Bash(git commit:*)"
]
},
"disabledMcpjsonServers": [
"unity-mcp"
]
}

Binary file not shown.

View File

@@ -51,13 +51,14 @@ func NewMonster(mt MonsterType, floor int) *Monster {
}
hp := int(math.Round(float64(base.HP) * scale))
atk := int(math.Round(float64(base.ATK) * scale))
def := int(math.Round(float64(base.DEF) * scale))
return &Monster{
Name: base.Name,
Type: mt,
HP: hp,
MaxHP: hp,
ATK: atk,
DEF: base.DEF,
DEF: def,
IsBoss: base.IsBoss,
}
}

View File

@@ -23,3 +23,16 @@ func TestBossStats(t *testing.T) {
t.Errorf("Boss5: got HP=%d ATK=%d DEF=%d, want 150/15/8", boss.HP, boss.ATK, boss.DEF)
}
}
func TestMonsterDEFScaling(t *testing.T) {
// Slime base DEF=1, minFloor=1. At floor 5, scale = 1.15^4 ≈ 1.749
m := NewMonster(MonsterSlime, 5)
if m.DEF <= 1 {
t.Errorf("Slime DEF at floor 5 should be scaled above base 1, got %d", m.DEF)
}
// Boss DEF should NOT scale
boss := NewMonster(MonsterBoss5, 5)
if boss.DEF != 8 {
t.Errorf("Boss5 DEF should be base 8, got %d", boss.DEF)
}
}