From d1a78e672ad4b8ce52ec113ddfe7f63afe999a63 Mon Sep 17 00:00:00 2001 From: dingo Date: Tue, 14 Apr 2026 09:41:52 -0400 Subject: [PATCH] update --- .../collection/components/CardWidget.tscn | 3 +- .../collection/components/card_widget.gd | 2 +- .../scenes/free_play/lobby_room_screen.gd | 2 +- .../origin-client/scenes/game/GameScreen.tscn | 63 +++++++++++++------ Server/src/SOR.Game/GameEngine.cs | 19 +++++- 5 files changed, 66 insertions(+), 23 deletions(-) diff --git a/Client/origin-client/scenes/collection/components/CardWidget.tscn b/Client/origin-client/scenes/collection/components/CardWidget.tscn index 15743cd..0c079e8 100644 --- a/Client/origin-client/scenes/collection/components/CardWidget.tscn +++ b/Client/origin-client/scenes/collection/components/CardWidget.tscn @@ -4,6 +4,8 @@ [node name="CardWidget" type="PanelContainer"] custom_minimum_size = Vector2(152, 238) +offset_right = 160.0 +offset_bottom = 257.0 script = ExtResource("1_cw") [node name="Margin" type="MarginContainer" parent="."] @@ -53,7 +55,6 @@ unique_name_in_owner = true custom_minimum_size = Vector2(12, 12) layout_mode = 2 expand_mode = 1 -stretch_mode = 5 [node name="SpLabel" type="Label" parent="Margin/VBox/HeaderRow/CostColumn/SpRow"] unique_name_in_owner = true diff --git a/Client/origin-client/scenes/collection/components/card_widget.gd b/Client/origin-client/scenes/collection/components/card_widget.gd index 909d736..aed21e1 100644 --- a/Client/origin-client/scenes/collection/components/card_widget.gd +++ b/Client/origin-client/scenes/collection/components/card_widget.gd @@ -312,7 +312,7 @@ func _format_genus(def: Dictionary) -> String: for tag in genus as Array: labels.append(str(tag)) return ", ".join(labels) - return "No Genus" + return "" func _format_range(def: Dictionary) -> String: 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 bebb557..b4fd2fd 100644 --- a/Client/origin-client/scenes/free_play/lobby_room_screen.gd +++ b/Client/origin-client/scenes/free_play/lobby_room_screen.gd @@ -578,7 +578,7 @@ func _on_add_ai_pressed() -> void: dlg.confirmed.connect(func(): var difficulty := diff_opts.selected + 1 # 1-indexed - var strategy := strategies[strat_opts.selected] + var strategy :Variant = strategies[strat_opts.selected] add_ai_btn.disabled = true CustomLobby.add_ai(difficulty, strategy, func(_d: Dictionary) -> void: diff --git a/Client/origin-client/scenes/game/GameScreen.tscn b/Client/origin-client/scenes/game/GameScreen.tscn index 2bac74a..9b41dd5 100644 --- a/Client/origin-client/scenes/game/GameScreen.tscn +++ b/Client/origin-client/scenes/game/GameScreen.tscn @@ -1,8 +1,9 @@ -[gd_scene load_steps=6 format=3 uid="uid://b17evi1hw4dqu"] +[gd_scene load_steps=7 format=3 uid="uid://b17evi1hw4dqu"] [ext_resource type="Script" uid="uid://b8x84lb58h6gx" path="res://scenes/game/game_screen.gd" id="1_gscr"] [ext_resource type="Texture2D" uid="uid://dvmripj4jux0b" path="res://icons/SP-Symbol-White.png" id="2_056su"] [ext_resource type="PackedScene" path="res://scenes/game/InGameSettings.tscn" id="2_igs"] +[ext_resource type="Texture2D" uid="uid://csvmdo2kwnh7c" path="res://icons/ST-Symbol-White.png" id="3_wukpb"] [sub_resource type="StyleBoxEmpty" id="StyleBoxEmpty_wukpb"] @@ -99,10 +100,12 @@ theme_override_font_sizes/font_size = 11 text = "Discard" [node name="SP-ST Panel Container" type="PanelContainer" parent="HUD"] -offset_left = 12.0 -offset_top = 374.0 -offset_right = 88.0 -offset_bottom = 508.0 +anchors_preset = -1 +anchor_top = 0.675 +anchor_bottom = 0.675 +offset_top = -156.40002 +offset_right = 76.0 +offset_bottom = -0.4000244 theme_override_styles/panel = SubResource("StyleBoxEmpty_wukpb") [node name="VBoxContainer" type="VBoxContainer" parent="HUD/SP-ST Panel Container"] @@ -122,19 +125,47 @@ expand_mode = 1 unique_name_in_owner = true layout_mode = 1 anchors_preset = -1 -anchor_left = -0.13100001 -anchor_top = 1.144 -anchor_right = -0.13100001 -anchor_bottom = 1.144 -offset_left = 24.956001 -offset_top = -81.944 -offset_right = 71.956 -offset_bottom = -35.944 +anchor_left = 0.513 +anchor_top = 0.36800003 +anchor_right = 0.513 +anchor_bottom = 0.36800003 +offset_left = -18.987999 +offset_top = -22.968002 +offset_right = 19.012001 +offset_bottom = 23.031998 theme_override_colors/font_color = Color(0.012617188, 0.012617188, 0.012617188, 1) theme_override_font_sizes/font_size = 33 text = "88" horizontal_alignment = 1 vertical_alignment = 1 +metadata/_edit_use_anchors_ = true + +[node name="TextureRect2" type="TextureRect" parent="HUD/SP-ST Panel Container/VBoxContainer"] +self_modulate = Color(0, 0.8117647, 0.77254903, 0.38039216) +texture_filter = 5 +custom_minimum_size = Vector2(1.78, 76) +layout_mode = 2 +theme = SubResource("Theme_056su") +texture = ExtResource("3_wukpb") +expand_mode = 1 + +[node name="StLabel" type="Label" parent="HUD/SP-ST Panel Container/VBoxContainer/TextureRect2"] +unique_name_in_owner = true +layout_mode = 1 +anchors_preset = -1 +anchor_left = 0.5 +anchor_top = 0.32200003 +anchor_right = 0.5 +anchor_bottom = 0.32200003 +offset_left = -20.0 +offset_top = -20.472002 +offset_right = 22.0 +offset_bottom = 25.527998 +theme_override_colors/font_color = Color(0.06469653, 0.06469653, 0.06469653, 1) +theme_override_font_sizes/font_size = 33 +text = "88" +horizontal_alignment = 1 +vertical_alignment = 1 [node name="HandArea" type="PanelContainer" parent="HUD"] anchors_preset = -1 @@ -179,12 +210,6 @@ theme_override_constants/margin_bottom = 8 layout_mode = 2 theme_override_constants/separation = 6 -[node name="StLabel" type="Label" parent="HUD/RightPanel/RightMargin/RightVBox"] -unique_name_in_owner = true -layout_mode = 2 -theme_override_font_sizes/font_size = 14 -text = "ST: 0" - [node name="DeckLabel" type="Label" parent="HUD/RightPanel/RightMargin/RightVBox"] unique_name_in_owner = true layout_mode = 2 diff --git a/Server/src/SOR.Game/GameEngine.cs b/Server/src/SOR.Game/GameEngine.cs index f62ad42..0b032eb 100644 --- a/Server/src/SOR.Game/GameEngine.cs +++ b/Server/src/SOR.Game/GameEngine.cs @@ -725,7 +725,24 @@ public static class GameEngine // Target counter-attacks if able and still alive. if (target.CurrentHealth > 0 && target.CanAttack && !target.IsExhausted) - ApplyDamage(attacker, target.Damage ?? 0); + { + var canCounterAttack = true; + + if (state.Board is not null && target.Position.HasValue && attacker.Position.HasValue) + { + var occupancy = state.Board.BuildOccupancyMap(); + var targetMinRange = target.MinAttackRange ?? 1; + var targetMaxRange = target.MaxAttackRange ?? 1; + + canCounterAttack = AttackSystem.CanAttack( + target.Position.Value, attacker.Position.Value, + targetMinRange, targetMaxRange, target.RequiresLos, + state.Board, occupancy); + } + + if (canCounterAttack) + ApplyDamage(attacker, target.Damage ?? 0); + } // Consume extra attack or exhaust normally. if (attacker.ExtraAttacksRemaining > 0)