10const STANDARD :=
"standard"
19func select_mode(selected_mode:String) -> void:
20 mode = selected_mode
if selected_mode
in [STANDARD, RAID]
else STANDARD
25func start_sequence(selected_mode:String) -> void:
26 select_mode(selected_mode)
32func complete_fight(player_won:bool) -> void:
36 if mode == RAID
and raid_step > 0
and raid_step < raid_total:
43func is_raid_active() -> bool:
44 return mode == RAID
and raid_step > 0
47func is_sequence_complete() -> bool:
48 return mode == STANDARD
or raid_step == 0
52func get_reward_multiplier() -> float:
54 return 1.0 + (float(max(raid_step, 1) - 1) * 0.55)
59func tune_opponent(card:Dictionary) -> Dictionary:
60 var tuned = card.duplicate(true)
63 var step = max(raid_step, 1)
64 tuned[
"health"] = int(tuned.get(
"health", 1)) + ((step - 1) * 7)
65 tuned[
"attack"] = int(tuned.get(
"attack", 1)) + (step - 1) * 2
66 tuned[
"defense"] = int(tuned.get(
"defense", 0)) + int((step - 1) / 2)
67 tuned[
"name"] =
"%s Raid %d" % [tuned.get(
"name",
"Opponent"), step]
71func get_label() -> String:
73 return "Raid %d/%d" % [max(raid_step, 1), raid_total]
74 return "Standard Battle"
78func get_state() -> Dictionary:
81 "raid_total": raid_total,
82 "raid_step": raid_step
87func apply_state(state:Dictionary) -> void:
88 mode = str(state.get(
"mode", STANDARD))
89 raid_total = int(state.get(
"raid_total", 3))
90 raid_step = int(state.get(
"raid_step", 0))