Files

15 lines
929 B
GDScript

extends GutTest
const ClassEngineType = preload("res://scripts/domain/progression/class_engine.gd")
func test_hero_conditions_report_eligible_hero_and_elite_notifications_once() -> void:
var engine := ClassEngineType.new([], [], [
{"id": "hero_vanguard", "tier": "hero", "base_archetype": "vanguard", "conditions": [{"type": "level", "min": 3}]},
{"id": "elite_any", "tier": "elite", "base_archetype": null, "conditions": [{"type": "flag", "flag": "floor_3", "equals": true}]},
])
var player := PlayerState.new({"archetype": "vanguard", "level": 3, "flags": {"floor_3": true}})
assert_eq(engine.eligible_evolutions(player).map(func(entry: Dictionary) -> StringName: return entry.id), [&"elite_any", &"hero_vanguard"])
assert_eq(engine.evolution_notifications(player).map(func(entry: Dictionary) -> StringName: return entry.id), [&"elite_any", &"hero_vanguard"])
assert_eq(engine.evolution_notifications(player), [])