feat: add combo skill system with 5 combos

Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
2026-03-25 15:06:56 +09:00
parent 22ebeb1d48
commit 69ac6cd383
3 changed files with 182 additions and 0 deletions

45
combat/combo_test.go Normal file
View File

@@ -0,0 +1,45 @@
package combat
import (
"testing"
"github.com/tolelom/catacombs/entity"
)
func TestDetectCombo_IceShatter(t *testing.T) {
actions := map[string]ComboAction{
"mage": {Class: entity.ClassMage, ActionType: "skill"},
"warrior": {Class: entity.ClassWarrior, ActionType: "attack"},
}
combos := DetectCombos(actions)
if len(combos) == 0 {
t.Fatal("expected Ice Shatter combo")
}
if combos[0].Name != "Ice Shatter" {
t.Errorf("expected 'Ice Shatter', got %q", combos[0].Name)
}
}
func TestDetectCombo_NoMatch(t *testing.T) {
actions := map[string]ComboAction{
"w1": {Class: entity.ClassWarrior, ActionType: "attack"},
"w2": {Class: entity.ClassWarrior, ActionType: "attack"},
}
combos := DetectCombos(actions)
if len(combos) != 0 {
t.Errorf("expected no combos, got %d", len(combos))
}
}
func TestDetectCombo_Multiple(t *testing.T) {
// Healer skill + Warrior attack + Rogue item → Holy Assault + Restoration
actions := map[string]ComboAction{
"healer": {Class: entity.ClassHealer, ActionType: "skill"},
"warrior": {Class: entity.ClassWarrior, ActionType: "attack"},
"rogue": {Class: entity.ClassRogue, ActionType: "item"},
}
combos := DetectCombos(actions)
if len(combos) != 2 {
t.Errorf("expected 2 combos, got %d", len(combos))
}
}