diff --git a/Client/origin-client/scenes/free_play/components/rules_editor_dialog.gd b/Client/origin-client/scenes/free_play/components/rules_editor_dialog.gd index b5d9f57..8780d0d 100644 --- a/Client/origin-client/scenes/free_play/components/rules_editor_dialog.gd +++ b/Client/origin-client/scenes/free_play/components/rules_editor_dialog.gd @@ -40,6 +40,8 @@ func _build_fields(r: Dictionary) -> void: return int(r[k]) if r.has(k) else d var get_b := func(k: String, d: bool) -> bool: return bool(r[k]) if r.has(k) else d + var get_s := func(k: String, d: String) -> String: + return str(r[k]) if r.has(k) and r[k] != null else d var add_int := func(label: String, key: String, min_v: int, max_v: int, def_v: int, note: String) -> void: var hbox := HBoxContainer.new() @@ -70,6 +72,22 @@ func _build_fields(r: Dictionary) -> void: fields_box.add_child(hbox) _controls[key] = chk + var add_option := func(label: String, key: String, options: Array, def_v: String) -> void: + var hbox := HBoxContainer.new() + var lbl := Label.new() + lbl.text = label + lbl.size_flags_horizontal = Control.SIZE_EXPAND_FILL + hbox.add_child(lbl) + var opt := OptionButton.new() + for o in options: + opt.add_item(o) + var cur := get_s.call(key, def_v) + var idx := options.find(cur) + opt.selected = idx if idx >= 0 else 0 + hbox.add_child(opt) + fields_box.add_child(hbox) + _controls[key] = opt + # ── Hand & Cards ────────────────────────────────────────────────────────── _section("HAND & CARDS") add_int.call("Opening Hand Size", "openingHandSize", 1, 20, 6, "") @@ -94,6 +112,7 @@ func _build_fields(r: Dictionary) -> void: add_int.call("Board Width", "boardWidth", 3, 12, 6, "") add_int.call("Board Height", "boardHeight", 3, 12, 6, "") add_int.call("Starting Tile Affinity %","startingRandomTilePct",0, 100, 0, "% of tiles with a random basic affinity") + add_option.call("Board Shape", "boardShape", ["Default", "Rectangle", "Cross", "Triangular", "RadialStar", "HexRing"], "Default") # ── Deck ─────────────────────────────────────────────────────────────────── _section("DECK") @@ -124,5 +143,7 @@ func _on_confirm() -> void: overrides[key] = int(ctrl.value) elif ctrl is CheckBox: overrides[key] = ctrl.button_pressed + elif ctrl is OptionButton: + overrides[key] = ctrl.get_item_text(ctrl.selected) confirmed.emit(overrides) queue_free() diff --git a/Client/origin-client/scenes/free_play/lobby_room_screen.gd b/Client/origin-client/scenes/free_play/lobby_room_screen.gd index 05eb115..9f96cd7 100644 --- a/Client/origin-client/scenes/free_play/lobby_room_screen.gd +++ b/Client/origin-client/scenes/free_play/lobby_room_screen.gd @@ -293,6 +293,7 @@ func _update_rules_label() -> void: "boardWidth": "Board W", "boardHeight": "Board H", "startingRandomTilePct":"Starting Tile %", + "boardShape": "Board Shape", } for key in fields: if _current_rules.has(key): @@ -378,6 +379,7 @@ func _format_rules_summary(rules: Dictionary) -> String: "boardWidth": "Board W", "boardHeight": "Board H", "startingRandomTilePct":"Starting Tile %", + "boardShape": "Board Shape", "firstPlayerSkipsDraw": "1st Player Skips Draw", "minDeckSize": "Min Deck", "maxDeckSize": "Max Deck", diff --git a/Server/src/SOR.Admin/Components/Pages/Cards/AbilityBuilder.razor b/Server/src/SOR.Admin/Components/Pages/Cards/AbilityBuilder.razor index 6a156ca..11ba1ff 100644 --- a/Server/src/SOR.Admin/Components/Pages/Cards/AbilityBuilder.razor +++ b/Server/src/SOR.Admin/Components/Pages/Cards/AbilityBuilder.razor @@ -932,6 +932,35 @@ +
Some trigger types expose extra filtering fields beyond Ownership and UnitType.
OnUnitSentToDiscard — CausedBy
Fires whenever a unit is sent to the discard pile from the battlefield. This includes:
+The optional CausedBy field narrows the trigger to units killed by a specific owner class:
| CausedBy value | Fires when the killer is… |
|---|---|
| (empty) | Any killer — trigger fires regardless of who caused the discard |
ExactSelf | This specific unit instance — the unit that owns this ability was the one that dealt the killing blow (Bloodlust pattern) |
Owner | Any unit controlled by the same player as this unit |
Enemy | Any opponent-controlled unit caused the discard |
Any | Same as empty — any killer |
Note: Ownership still filters the unit being discarded; CausedBy filters the killer. Use Ownership: Any, CausedBy: ExactSelf to react whenever this unit kills anything.
Bloodlust example — "When this spirit sends another spirit to the discard, gain +1 attack":
+{"$type":"OnUnitSentToDiscard","UnitType":"Spirit","Ownership":"Any","CausedBy":"ExactSelf"}
+ Action: Scope Battlefield, Ownership ExactSelf, Effect ModifyStat — Stat Damage, Amt +1, Duration PermanentInMatch (or UntilEndOfTurn for temporary buff).
OnUnitDeath vs OnUnitSentToDiscard
+Use OnUnitDeath to react to any unit being killed (e.g. opponent's unit dies anywhere). Use OnUnitSentToDiscard when you specifically want the killer identity via CausedBy, or when you need to distinguish combat-killed units from sacrificed/returned units (sacrificed units fire OnSpiritSacrificed, not OnUnitSentToDiscard).