2026-01-16 21:05:21 +00:00
|
|
|
extends Draggable
|
2023-04-19 16:53:24 +00:00
|
|
|
class_name Card
|
2025-04-07 15:26:06 +00:00
|
|
|
|
|
|
|
|
var card_id
|
|
|
|
|
|
2025-06-03 21:18:34 +00:00
|
|
|
enum burned {
|
|
|
|
|
NOT,
|
|
|
|
|
SINGED,
|
|
|
|
|
BURNING,
|
|
|
|
|
TORCHED
|
|
|
|
|
}
|
|
|
|
|
|
2025-04-07 15:26:06 +00:00
|
|
|
#FIXME remove this legacy stuff without loosing the evil notes ...
|
2023-10-12 16:25:21 +00:00
|
|
|
var compatible_sticky_notes: Array[StickyNote] = []
|
2025-02-24 15:14:08 +00:00
|
|
|
@export var evil_sticky_notes: Array[StickyNote] = []
|
2023-10-12 16:25:21 +00:00
|
|
|
var own_sticky_notes: Array[StickyNote] = []
|
|
|
|
|
var current_sticky_note: StickyNote = null
|
2023-06-29 15:35:30 +00:00
|
|
|
var wiggle_pos: float = 0
|
2023-06-28 09:44:55 +00:00
|
|
|
var wiggle_intensity: float = 0
|
|
|
|
|
var noise: Noise = FastNoiseLite.new()
|
2026-01-11 21:09:19 +00:00
|
|
|
var wiggle_tween : Tween
|
|
|
|
|
var scale_tween : Tween
|
2026-01-16 16:08:48 +00:00
|
|
|
var brightness_tween : Tween
|
2023-04-19 16:53:24 +00:00
|
|
|
|
2024-02-03 21:00:44 +00:00
|
|
|
var transfor_arr: Array[Transform2D] = [
|
2024-09-15 09:30:31 +00:00
|
|
|
Transform2D(0.9, Vector2(-125, -83)),
|
|
|
|
|
Transform2D(-0.3, Vector2(-126, -75)),
|
|
|
|
|
Transform2D(-0.3, Vector2(-126, -74)),
|
|
|
|
|
Transform2D(-0.3, Vector2(-126, -73)),
|
|
|
|
|
Transform2D(0.5, Vector2(-126, -77))
|
2024-02-03 21:00:44 +00:00
|
|
|
]
|
|
|
|
|
|
2023-04-19 16:53:24 +00:00
|
|
|
@export var text: String = "" :
|
2024-09-15 09:30:31 +00:00
|
|
|
set(value):
|
|
|
|
|
text = value
|
2026-01-11 20:42:06 +00:00
|
|
|
_on_text_updated.call_deferred()
|
2026-01-11 20:33:37 +00:00
|
|
|
|
|
|
|
|
@onready var label: Label = $Label
|
|
|
|
|
@onready var background_sprite: AnimatedSprite2D = $AnimatedSprite2D
|
|
|
|
|
|
2025-06-02 23:48:52 +00:00
|
|
|
@export var picked_random: bool = false
|
|
|
|
|
|
2023-06-28 09:44:55 +00:00
|
|
|
@export var wiggle_strength: float = 0.2
|
|
|
|
|
@export var wiggle_speed: float = 5
|
|
|
|
|
@export_range(1, 2) var scale_bump: float = 1.05
|
2023-07-14 17:13:08 +00:00
|
|
|
@export_range(1.0, 10.0) var bounce_speed: float = 5
|
2026-01-16 16:08:48 +00:00
|
|
|
@export_range(1.0, 2.0) var highlight_brightness: float = 1.4
|
2023-06-28 09:44:55 +00:00
|
|
|
@export var highlighted: bool = false:
|
2024-09-15 09:30:31 +00:00
|
|
|
set(highlight):
|
|
|
|
|
if highlight != highlighted:
|
|
|
|
|
highlighted = highlight
|
|
|
|
|
|
|
|
|
|
if is_inside_tree() and is_node_ready():
|
|
|
|
|
if scale_tween: scale_tween.kill()
|
|
|
|
|
if wiggle_tween: wiggle_tween.kill()
|
2026-01-16 16:08:48 +00:00
|
|
|
if brightness_tween: brightness_tween.kill()
|
2024-09-15 09:30:31 +00:00
|
|
|
if highlighted:
|
|
|
|
|
scale_tween = get_tree().create_tween()
|
|
|
|
|
scale_tween.tween_property(self, "scale", Vector2(scale_bump, scale_bump), 0.1)
|
|
|
|
|
wiggle_tween = get_tree().create_tween()
|
|
|
|
|
wiggle_tween.tween_property(self, "wiggle_intensity", 1, 0.2)
|
2026-01-16 16:08:48 +00:00
|
|
|
brightness_tween = get_tree().create_tween()
|
|
|
|
|
brightness_tween.set_parallel(true)
|
|
|
|
|
brightness_tween.tween_property(background_sprite, "modulate", Color(highlight_brightness, highlight_brightness, highlight_brightness), 0.15)
|
|
|
|
|
brightness_tween.tween_property(label, "modulate", Color(highlight_brightness, highlight_brightness, highlight_brightness), 0.15)
|
2024-09-15 09:30:31 +00:00
|
|
|
else:
|
|
|
|
|
scale_tween = get_tree().create_tween()
|
|
|
|
|
scale_tween.tween_property(self, "scale", Vector2(1, 1), 0.3)
|
|
|
|
|
wiggle_tween = get_tree().create_tween()
|
|
|
|
|
wiggle_tween.tween_property(self, "wiggle_intensity", 0, 0.5)
|
2026-01-16 16:08:48 +00:00
|
|
|
brightness_tween = get_tree().create_tween()
|
|
|
|
|
brightness_tween.set_parallel(true)
|
|
|
|
|
brightness_tween.tween_property(background_sprite, "modulate", Color.WHITE, 0.2)
|
|
|
|
|
brightness_tween.tween_property(label, "modulate", Color.WHITE, 0.2)
|
2024-09-15 09:30:31 +00:00
|
|
|
else:
|
|
|
|
|
if highlighted:
|
|
|
|
|
scale = Vector2(scale_bump, scale_bump)
|
|
|
|
|
wiggle_intensity = 1
|
2026-01-16 16:08:48 +00:00
|
|
|
if background_sprite:
|
|
|
|
|
background_sprite.modulate = Color(highlight_brightness, highlight_brightness, highlight_brightness)
|
|
|
|
|
if label:
|
|
|
|
|
label.modulate = Color(highlight_brightness, highlight_brightness, highlight_brightness)
|
2024-09-15 09:30:31 +00:00
|
|
|
else:
|
|
|
|
|
scale = Vector2(1,1)
|
|
|
|
|
wiggle_intensity = 0
|
2026-01-16 16:08:48 +00:00
|
|
|
if background_sprite:
|
|
|
|
|
background_sprite.modulate = Color.WHITE
|
|
|
|
|
if label:
|
|
|
|
|
label.modulate = Color.WHITE
|
2024-09-15 09:30:31 +00:00
|
|
|
|
2023-04-19 16:53:24 +00:00
|
|
|
@export var voice_line: AudioStream = null
|
2023-06-29 20:19:58 +00:00
|
|
|
@export var is_dragable: bool = false
|
2026-01-11 20:33:37 +00:00
|
|
|
@export var diameter := 336.0
|
2025-06-03 21:18:34 +00:00
|
|
|
@export_range(0, 2) var burn_progress: float = 0:
|
|
|
|
|
set(burn):
|
|
|
|
|
if is_node_ready():
|
|
|
|
|
if burn > 0 and background_sprite.material == null:
|
|
|
|
|
if background_sprite != null:
|
|
|
|
|
background_sprite.material = crumble_material.duplicate()
|
|
|
|
|
add_child(card_fire, false, Node.INTERNAL_MODE_FRONT)
|
|
|
|
|
card_fire.material = card_fire.material.duplicate()
|
|
|
|
|
elif burn_progress > 0 and burn <= 0:
|
|
|
|
|
background_sprite.material.set_shader_parameter("fire_progression", 0)
|
|
|
|
|
card_fire.material.set_shader_parameter("fire_progression", 0)
|
|
|
|
|
background_sprite.material = null
|
|
|
|
|
remove_child(card_fire)
|
|
|
|
|
|
|
|
|
|
burn_progress = burn
|
|
|
|
|
if background_sprite != null and card_fire != null and burn_progress > 0:
|
|
|
|
|
background_sprite.material.set_shader_parameter("fire_progression", burn_progress)
|
|
|
|
|
card_fire.material.set_shader_parameter("fire_progression", burn_progress)
|
|
|
|
|
background_sprite.visible = burn_progress < 2
|
|
|
|
|
card_fire.visible = burn_progress < 2
|
|
|
|
|
label.modulate = Color.WHITE.lerp(Color(0,0,0,0), clampf(burn_progress*3-3, 0, 1))
|
|
|
|
|
|
|
|
|
|
var burn_tween: Tween
|
|
|
|
|
signal has_burned
|
|
|
|
|
@export var burn_state: burned = burned.NOT:
|
|
|
|
|
set(burning):
|
|
|
|
|
if burning != burn_state:
|
|
|
|
|
if burn_tween != null:
|
|
|
|
|
burn_tween.kill()
|
|
|
|
|
match burning:
|
|
|
|
|
burned.NOT:
|
|
|
|
|
burn_tween = get_tree().create_tween()
|
|
|
|
|
burn_tween.tween_property(self, "burn_progress", 0, 0.5)
|
|
|
|
|
burned.SINGED:
|
|
|
|
|
burn_tween = get_tree().create_tween()
|
|
|
|
|
burn_tween.set_ease(Tween.EASE_OUT)
|
|
|
|
|
burn_tween.set_trans(Tween.TRANS_SINE)
|
|
|
|
|
burn_tween.tween_property(self, "burn_progress", 0.5, 2)
|
|
|
|
|
burned.BURNING:
|
|
|
|
|
burn_tween = get_tree().create_tween()
|
|
|
|
|
burn_tween.tween_property(self, "burn_progress", 2.0, 2)
|
|
|
|
|
burn_tween.tween_callback(_torch).set_delay(1.0)
|
|
|
|
|
burned.TORCHED:
|
2025-12-13 10:06:15 +00:00
|
|
|
print_debug("Card %s has been burned." % HardCards.get_obscure_name(name))
|
2025-06-03 21:18:34 +00:00
|
|
|
has_burned.emit()
|
|
|
|
|
burn_state = burning
|
2025-04-13 17:07:31 +00:00
|
|
|
|
2025-06-03 21:18:34 +00:00
|
|
|
func _torch():
|
|
|
|
|
burn_state = burned.TORCHED
|
|
|
|
|
|
|
|
|
|
var crumble_material: ShaderMaterial = preload("res://logic-scenes/card_burner/card_crumble.material")
|
|
|
|
|
var card_fire: Sprite2D = preload("res://logic-scenes/card_burner/card_fire.tscn").instantiate()
|
2025-06-02 23:48:52 +00:00
|
|
|
|
2025-04-13 17:07:31 +00:00
|
|
|
var sticky_note_position: Vector2 = Vector2(-66, 83)
|
2023-07-14 17:13:08 +00:00
|
|
|
|
2023-07-14 19:20:04 +00:00
|
|
|
var mouse_offset: Vector2
|
2023-07-14 17:13:08 +00:00
|
|
|
|
2026-01-11 21:47:56 +00:00
|
|
|
func init(card_name: String = "card", own_id:StringName = "-1") -> void:
|
2025-05-16 21:50:19 +00:00
|
|
|
if card_name != "c_void":
|
2025-04-13 17:07:31 +00:00
|
|
|
text = card_name
|
2026-01-12 00:22:25 +00:00
|
|
|
if !card_name.begins_with("c"):
|
|
|
|
|
push_error("Illegal card.")
|
2025-04-07 15:26:06 +00:00
|
|
|
card_id = own_id
|
2025-05-16 21:50:19 +00:00
|
|
|
name = card_name
|
2025-04-07 15:26:06 +00:00
|
|
|
|
|
|
|
|
|
2023-06-28 09:44:55 +00:00
|
|
|
func _ready():
|
2025-01-31 02:22:07 +00:00
|
|
|
input_event.connect(_on_input_event)
|
|
|
|
|
|
2026-01-11 20:33:37 +00:00
|
|
|
_handle_wiggle(0)
|
|
|
|
|
_on_text_updated.call_deferred()
|
2025-04-04 21:17:31 +00:00
|
|
|
|
2025-04-13 17:07:31 +00:00
|
|
|
func _on_text_updated():
|
|
|
|
|
if is_node_ready():
|
2026-01-11 20:33:37 +00:00
|
|
|
var curr_frame := text.hash() % background_sprite.sprite_frames.get_frame_count(background_sprite.animation)
|
2025-04-13 17:07:31 +00:00
|
|
|
background_sprite.frame = curr_frame
|
|
|
|
|
|
|
|
|
|
if text == "":
|
|
|
|
|
if background_sprite.get_child_count() == 0:
|
|
|
|
|
background_sprite.add_child(load("res://logic-scenes/board/void_stuff.tscn").instantiate(), false, Node.INTERNAL_MODE_DISABLED)
|
|
|
|
|
else:
|
|
|
|
|
if background_sprite.get_child_count() > 0:
|
|
|
|
|
background_sprite.get_child(0).queue_free()
|
|
|
|
|
|
|
|
|
|
label.text = text
|
|
|
|
|
|
|
|
|
|
wiggle_pos = float(text.hash() % 100)
|
|
|
|
|
|
|
|
|
|
label.rotation = deg_to_rad(transfor_arr[curr_frame].get_rotation())
|
2026-01-11 21:47:56 +00:00
|
|
|
#label.position = transfor_arr[curr_frame].origin
|
2025-04-13 17:07:31 +00:00
|
|
|
|
2025-06-03 21:18:34 +00:00
|
|
|
burn_progress = burn_progress
|
|
|
|
|
|
2025-04-13 17:07:31 +00:00
|
|
|
if not Engine.is_editor_hint():
|
|
|
|
|
_handle_wiggle(0)
|
2023-04-19 16:53:24 +00:00
|
|
|
|
|
|
|
|
func _process(delta: float) -> void:
|
2024-09-15 09:30:31 +00:00
|
|
|
if highlighted:
|
|
|
|
|
_handle_wiggle(delta)
|
|
|
|
|
|
|
|
|
|
if get_overlapping_areas().size() > 0 and is_dragable:
|
|
|
|
|
for area in get_overlapping_areas():
|
2026-01-16 21:05:21 +00:00
|
|
|
if area is Card:
|
|
|
|
|
if not (area.highlighted or self.highlighted) and area.is_dragable:
|
2024-09-15 09:30:31 +00:00
|
|
|
var diff:Vector2 = position - area.position
|
|
|
|
|
position -= diff.normalized() * ((diff.length()-diameter)/diameter) * bounce_speed * (delta/(1.0/60))
|
|
|
|
|
|
|
|
|
|
_move_card()
|
2023-06-28 09:44:55 +00:00
|
|
|
|
|
|
|
|
func _handle_wiggle(delta):
|
2024-09-15 09:30:31 +00:00
|
|
|
wiggle_pos += delta * wiggle_speed * wiggle_intensity
|
|
|
|
|
|
|
|
|
|
rotation = noise.get_noise_1d(wiggle_pos)*wiggle_strength
|
2023-04-19 16:53:24 +00:00
|
|
|
|
2025-01-31 02:22:07 +00:00
|
|
|
|
|
|
|
|
func _input(event: InputEvent) -> void:
|
|
|
|
|
if event is InputEventMouseButton:
|
|
|
|
|
if event.button_index == MOUSE_BUTTON_LEFT and not event.pressed:
|
|
|
|
|
is_dragged = false
|
|
|
|
|
|
2026-01-11 21:47:56 +00:00
|
|
|
func _on_mouse_entered() -> void:
|
2024-09-15 09:30:31 +00:00
|
|
|
if not Input.is_action_pressed("mouse_left"):
|
2026-01-16 16:08:48 +00:00
|
|
|
# Do nothing if mouse hovers over sticky_note (it has higher priority)
|
2024-09-15 09:30:31 +00:00
|
|
|
if has_sticky_note_attached():
|
2026-01-11 21:47:56 +00:00
|
|
|
if current_sticky_note and current_sticky_note.highlighted:
|
2024-09-15 09:30:31 +00:00
|
|
|
return
|
|
|
|
|
if "handle_hover" in owner:
|
|
|
|
|
owner.handle_hover(self)
|
2023-06-29 20:19:58 +00:00
|
|
|
|
|
|
|
|
func _on_mouse_exited():
|
2024-09-15 09:30:31 +00:00
|
|
|
highlighted = false
|
2025-06-03 21:18:34 +00:00
|
|
|
if burn_state == burned.SINGED:
|
|
|
|
|
burn_state = burned.NOT
|
2023-06-29 20:19:58 +00:00
|
|
|
|
2025-03-23 14:43:04 +00:00
|
|
|
func _on_input_event(_viewport, event, _shape_idx):
|
2026-01-16 16:08:48 +00:00
|
|
|
if event is InputEventMouseButton and event.button_index == MOUSE_BUTTON_LEFT and event.pressed:
|
|
|
|
|
if "handle_mouse_button" in owner and highlighted:
|
|
|
|
|
mouse_offset = get_viewport().get_mouse_position() - position
|
|
|
|
|
owner.handle_mouse_button(event, self)
|
2023-06-29 20:19:58 +00:00
|
|
|
|
2023-07-02 08:42:58 +00:00
|
|
|
func _move_card():
|
2024-09-15 09:30:31 +00:00
|
|
|
if is_dragged:
|
2026-01-16 19:46:16 +00:00
|
|
|
update_drag_position(get_viewport().get_mouse_position())
|
2023-07-02 09:50:19 +00:00
|
|
|
|
2023-10-12 16:25:21 +00:00
|
|
|
func has_sticky_note_attached() -> bool:
|
2026-01-12 21:50:49 +00:00
|
|
|
return get_attached_sticky_note() != null
|
2023-08-30 09:07:22 +00:00
|
|
|
|
2024-10-02 23:12:24 +00:00
|
|
|
func get_attached_sticky_note() -> StickyNote:
|
2026-01-12 00:22:25 +00:00
|
|
|
for child in get_children(false):
|
|
|
|
|
if child is StickyNote:
|
|
|
|
|
return child
|
|
|
|
|
return null
|
|
|
|
|
|
2024-10-02 23:12:24 +00:00
|
|
|
|
2023-10-12 16:25:21 +00:00
|
|
|
func preview_sticky_note(sticky_note: StickyNote):
|
2026-01-16 21:05:21 +00:00
|
|
|
if not is_instance_valid(sticky_note):
|
|
|
|
|
return
|
2024-09-15 09:30:31 +00:00
|
|
|
sticky_note.reparent(self.get_parent())
|
2025-02-24 15:14:08 +00:00
|
|
|
sticky_note.attached_to = self
|
2026-01-16 21:05:21 +00:00
|
|
|
# Use a safe transform with validated position
|
|
|
|
|
var target_pos := global_position + sticky_note_position
|
|
|
|
|
if is_finite(target_pos.x) and is_finite(target_pos.y):
|
|
|
|
|
sticky_note.tween_transform_to(Transform2D(0, target_pos))
|
|
|
|
|
else:
|
|
|
|
|
push_warning("Card.preview_sticky_note: Invalid position calculated, skipping tween")
|
2023-08-30 09:07:22 +00:00
|
|
|
|
2023-10-12 16:25:21 +00:00
|
|
|
func attach_sticky_note(sticky_note: StickyNote) -> bool:
|
2024-09-15 09:30:31 +00:00
|
|
|
if has_sticky_note_attached():
|
|
|
|
|
return false
|
2025-08-18 18:59:47 +00:00
|
|
|
|
2025-04-13 17:07:31 +00:00
|
|
|
sticky_note.reparent(self)
|
|
|
|
|
sticky_note.position = sticky_note_position
|
2024-09-15 09:30:31 +00:00
|
|
|
sticky_note.on_board = false
|
2025-04-30 14:34:00 +00:00
|
|
|
sticky_note.is_dragable = false
|
2024-09-15 09:30:31 +00:00
|
|
|
current_sticky_note = sticky_note
|
2025-12-13 11:52:25 +00:00
|
|
|
#var former_parent = sticky_note.attached_to
|
2024-09-15 09:30:31 +00:00
|
|
|
sticky_note.attached_to = self
|
2025-02-24 15:14:08 +00:00
|
|
|
|
2025-06-04 12:00:02 +00:00
|
|
|
if name == "c_hit" and sticky_note.name == "c_effort" and Steamworks.has_initialized:
|
2025-04-07 15:26:06 +00:00
|
|
|
Steam.setAchievement("FIGHT_FOR_GOOD")
|
|
|
|
|
Steam.storeStats()
|
2025-02-24 15:14:08 +00:00
|
|
|
|
2024-09-15 09:30:31 +00:00
|
|
|
return true
|
2023-08-30 09:07:22 +00:00
|
|
|
|
2023-10-12 16:25:21 +00:00
|
|
|
func remove_sticky_note() -> StickyNote:
|
2026-01-12 22:00:29 +00:00
|
|
|
var former_child:StickyNote = get_attached_sticky_note()
|
2024-09-15 09:30:31 +00:00
|
|
|
current_sticky_note = null
|
|
|
|
|
former_child.reparent(get_parent())
|
|
|
|
|
former_child.owner = self.owner
|
|
|
|
|
former_child.on_board = true
|
2025-03-31 19:31:09 +00:00
|
|
|
former_child.attached_to = owner
|
2024-09-15 09:30:31 +00:00
|
|
|
return former_child
|
2023-09-23 14:19:58 +00:00
|
|
|
|
2023-10-12 16:25:21 +00:00
|
|
|
func exchange_sticky_note_with(new_note: StickyNote) -> StickyNote:
|
2025-12-13 19:11:51 +00:00
|
|
|
var tmp := remove_sticky_note()
|
2024-09-15 09:30:31 +00:00
|
|
|
attach_sticky_note(new_note)
|
|
|
|
|
return tmp
|
2023-09-24 10:23:26 +00:00
|
|
|
|
2025-01-31 02:22:07 +00:00
|
|
|
# This makes sure this node highlights itself when focus has left the sticky note.
|
2023-07-14 20:03:09 +00:00
|
|
|
func check_hover():
|
2026-01-16 16:08:48 +00:00
|
|
|
# Re-trigger hover handling - owner will decide if this should be highlighted
|
|
|
|
|
_on_mouse_entered()
|
2023-11-01 22:19:47 +00:00
|
|
|
|
|
|
|
|
func reclaim_sticky_note():
|
2024-09-15 09:30:31 +00:00
|
|
|
current_sticky_note.on_board = false
|
2025-04-13 17:07:31 +00:00
|
|
|
current_sticky_note.tween_transform_to(Transform2D(0, to_global(sticky_note_position)))
|
2024-09-15 09:30:31 +00:00
|
|
|
await current_sticky_note.transform_tween_finished
|
|
|
|
|
current_sticky_note.reparent(self)
|
|
|
|
|
current_sticky_note.owner = self.owner
|
2026-01-16 19:46:16 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
# === DROP TARGET PATTERN IMPLEMENTATION ===
|
|
|
|
|
|
|
|
|
|
## Temporary storage for exchanged sticky during drop operation
|
|
|
|
|
var _last_exchanged_sticky: StickyNote = null
|
|
|
|
|
|
|
|
|
|
## Checks if this card can accept the given draggable
|
|
|
|
|
func can_accept_drop(draggable: Draggable) -> bool:
|
|
|
|
|
return draggable is StickyNote
|
|
|
|
|
|
|
|
|
|
## Handles dropping a sticky note onto this card
|
|
|
|
|
## Returns DropResult indicating success, rejection, or exchange
|
|
|
|
|
func handle_drop(draggable: StickyNote) -> int:
|
|
|
|
|
if not can_accept_drop(draggable):
|
|
|
|
|
return Draggable.DropResult.REJECTED
|
|
|
|
|
|
|
|
|
|
if has_sticky_note_attached():
|
|
|
|
|
# Exchange: remove current, attach new, store old for retrieval
|
|
|
|
|
_last_exchanged_sticky = exchange_sticky_note_with(draggable)
|
|
|
|
|
# Reset z_index for newly attached sticky
|
|
|
|
|
draggable.z_index = 0
|
|
|
|
|
return Draggable.DropResult.EXCHANGED
|
|
|
|
|
else:
|
|
|
|
|
# Simple attach
|
|
|
|
|
if attach_sticky_note(draggable):
|
|
|
|
|
# Reset z_index for newly attached sticky
|
|
|
|
|
draggable.z_index = 0
|
|
|
|
|
return Draggable.DropResult.ACCEPTED
|
|
|
|
|
else:
|
|
|
|
|
# Attach failed (shouldn't happen, but handle it)
|
|
|
|
|
return Draggable.DropResult.REJECTED
|
|
|
|
|
|
|
|
|
|
## Retrieves the sticky that was exchanged during last drop
|
|
|
|
|
## Clears the reference after retrieval
|
|
|
|
|
func get_last_exchanged_sticky() -> StickyNote:
|
|
|
|
|
var result = _last_exchanged_sticky
|
|
|
|
|
_last_exchanged_sticky = null
|
|
|
|
|
return result
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# === DRAG LIFECYCLE OVERRIDES ===
|
|
|
|
|
|
|
|
|
|
## Cards always drop back to board dropzone
|
|
|
|
|
func find_drop_target() -> Node:
|
|
|
|
|
return owner if owner is CardBoard else get_parent()
|