Compare commits
No commits in common. "main" and "win-lose-tie" have entirely different histories.
main
...
win-lose-t
5 changed files with 22 additions and 39 deletions
|
|
@ -6,7 +6,7 @@
|
|||
|
||||
[resource]
|
||||
script = ExtResource("2_61mgn")
|
||||
scope = "turn"
|
||||
scope = "instant"
|
||||
type = "green"
|
||||
effects = Array[ExtResource("1_fd50n")]([null])
|
||||
name = "All-Out Attack"
|
||||
|
|
|
|||
|
|
@ -1,4 +1,4 @@
|
|||
[gd_scene load_steps=24 format=3 uid="uid://bgc0u117jqyr1"]
|
||||
[gd_scene load_steps=23 format=3 uid="uid://bgc0u117jqyr1"]
|
||||
|
||||
[ext_resource type="Script" path="res://demo_game.gd" id="1_jn16u"]
|
||||
[ext_resource type="Script" path="res://player_side.gd" id="2_w4tnt"]
|
||||
|
|
@ -159,7 +159,7 @@ offset_top = 24.0
|
|||
offset_right = 251.0
|
||||
offset_bottom = 47.0
|
||||
grow_horizontal = 2
|
||||
text = "HP +0"
|
||||
text = "HP: +0"
|
||||
|
||||
[node name="HBoxContainer" type="HBoxContainer" parent="Own"]
|
||||
visible = false
|
||||
|
|
@ -281,7 +281,7 @@ offset_right = 251.0
|
|||
offset_bottom = -29.0
|
||||
grow_horizontal = 2
|
||||
grow_vertical = 0
|
||||
text = "HP +0"
|
||||
text = "HP: +0"
|
||||
|
||||
[node name="StartGameButton" type="Button" parent="."]
|
||||
layout_mode = 1
|
||||
|
|
|
|||
|
|
@ -22,7 +22,6 @@ var match_manager: MatchManager
|
|||
var show_buttons: bool
|
||||
var signal_connected: bool
|
||||
var selected_card: Control
|
||||
var focused_card: Control
|
||||
|
||||
var hovering_cards_this_frame: Array[Control] = []
|
||||
var hovering_cards_duration: Dictionary = {}
|
||||
|
|
@ -43,14 +42,12 @@ func _ready():
|
|||
support1_green.visible = false
|
||||
support2_green.visible = false
|
||||
support2_red.visible = false
|
||||
incoming_damage_label.visible = false
|
||||
for child in deck.get_children():
|
||||
child.queue_free()
|
||||
|
||||
func _on_update(transition):
|
||||
hovering_cards_duration.clear()
|
||||
selected_card = null
|
||||
incoming_damage_label.visible = true
|
||||
|
||||
for child in deck.get_children():
|
||||
child.queue_free()
|
||||
|
|
@ -131,8 +128,6 @@ func _on_update(transition):
|
|||
_pop_this_card(monster_card)
|
||||
play_card.emit(card))
|
||||
monster_card.hovering.connect(func (delta): _do_hover(monster_card, delta))
|
||||
monster_card.right_clicked.connect(func(): _do_zoom(monster_card))
|
||||
monster_card.un_right_clicked.connect(_do_unzoom)
|
||||
deck.add_child(monster_card)
|
||||
|
||||
elif card is SupportCard and card.type == "red":
|
||||
|
|
@ -149,28 +144,12 @@ func _on_update(transition):
|
|||
_pop_this_card(btn)
|
||||
play_card.emit(card))
|
||||
btn.hovering.connect(func (delta): _do_hover(btn, delta))
|
||||
btn.right_clicked.connect(func(): _do_zoom(btn))
|
||||
btn.un_right_clicked.connect(_do_unzoom)
|
||||
|
||||
if rps_button_container:
|
||||
rps_button_container.visible = match_manager.phase == Match.Phase.RPS
|
||||
for button: TextureButton in rps_button_container.get_children():
|
||||
button.modulate = rps_grayed_color
|
||||
|
||||
func _do_zoom(card: Control):
|
||||
if focused_card:
|
||||
_do_unzoom()
|
||||
|
||||
var new_card: Control = card.duplicate()
|
||||
get_parent().add_child(new_card)
|
||||
new_card.set_anchors_and_offsets_preset(Control.PRESET_CENTER)
|
||||
new_card.scale = Vector2(2,2)
|
||||
focused_card = new_card
|
||||
|
||||
func _do_unzoom():
|
||||
if focused_card:
|
||||
focused_card.queue_free()
|
||||
focused_card = null
|
||||
|
||||
func _pop_this_card(control: Control):
|
||||
if selected_card:
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ class_name CardBase
|
|||
|
||||
signal left_clicked
|
||||
signal right_clicked
|
||||
signal un_right_clicked
|
||||
signal hovering(delta: float)
|
||||
|
||||
@export var card_name_label: Label
|
||||
|
|
@ -26,17 +25,20 @@ func _update(card: SupportCard):
|
|||
func _process(delta):
|
||||
var mouse_position = get_global_mouse_position()
|
||||
var rect = get_global_rect()
|
||||
if rect.has_point(mouse_position) and get_window().has_focus():
|
||||
if rect.has_point(mouse_position):
|
||||
hovering.emit(delta)
|
||||
|
||||
func _input(event):
|
||||
if event is InputEventMouseButton:
|
||||
if !event.is_pressed():
|
||||
return
|
||||
|
||||
var mouse_position = get_global_mouse_position()
|
||||
var rect = get_global_rect()
|
||||
if not rect.has_point(mouse_position):
|
||||
return
|
||||
|
||||
if rect.has_point(mouse_position) and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed() and get_window().has_focus():
|
||||
if event.button_index == MOUSE_BUTTON_LEFT:
|
||||
left_clicked.emit()
|
||||
elif rect.has_point(mouse_position) and event.button_index == MOUSE_BUTTON_RIGHT and event.is_pressed() and get_window().has_focus():
|
||||
elif event.button_index == MOUSE_BUTTON_RIGHT:
|
||||
right_clicked.emit()
|
||||
elif event.button_index == MOUSE_BUTTON_RIGHT and !event.is_pressed():
|
||||
un_right_clicked.emit()
|
||||
|
|
|
|||
|
|
@ -3,7 +3,6 @@ class_name MonsterCardUI
|
|||
|
||||
signal left_clicked
|
||||
signal right_clicked
|
||||
signal un_right_clicked
|
||||
signal hovering(delta: float)
|
||||
|
||||
@export var name_label : Label
|
||||
|
|
@ -38,17 +37,20 @@ func show_monster(monster: MatchMonster):
|
|||
func _process(delta):
|
||||
var mouse_position = get_global_mouse_position()
|
||||
var rect = get_global_rect()
|
||||
if rect.has_point(mouse_position) and get_window().has_focus():
|
||||
if rect.has_point(mouse_position):
|
||||
hovering.emit(delta)
|
||||
|
||||
func _input(event):
|
||||
if event is InputEventMouseButton:
|
||||
if !event.is_pressed():
|
||||
return
|
||||
|
||||
var mouse_position = get_global_mouse_position()
|
||||
var rect = get_global_rect()
|
||||
if not rect.has_point(mouse_position):
|
||||
return
|
||||
|
||||
if rect.has_point(mouse_position) and event.button_index == MOUSE_BUTTON_LEFT and event.is_pressed() and get_window().has_focus():
|
||||
if event.button_index == MOUSE_BUTTON_LEFT:
|
||||
left_clicked.emit()
|
||||
elif rect.has_point(mouse_position) and event.button_index == MOUSE_BUTTON_RIGHT and event.is_pressed() and get_window().has_focus():
|
||||
elif event.button_index == MOUSE_BUTTON_RIGHT:
|
||||
right_clicked.emit()
|
||||
elif event.button_index == MOUSE_BUTTON_RIGHT and !event.is_pressed():
|
||||
un_right_clicked.emit()
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue