fix: scale monster DEF with floor level like HP/ATK
This commit is contained in:
18
.claude/settings.local.json
Normal file
18
.claude/settings.local.json
Normal 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"
|
||||
]
|
||||
}
|
||||
BIN
catacombs.exe~
BIN
catacombs.exe~
Binary file not shown.
@@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
@@ -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)
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user