LET THEM BURN DEN
This commit is contained in:
parent
cfa35a7626
commit
82b6844216
|
|
@ -1,16 +1,16 @@
|
||||||
[gd_scene load_steps=11 format=3 uid="uid://de1jhrkfs5qc6"]
|
[gd_scene load_steps=10 format=3 uid="uid://de1jhrkfs5qc6"]
|
||||||
|
|
||||||
[ext_resource type="Material" uid="uid://clfshh25jwfm1" path="res://logic-scenes/card_burner/card_fire.material" id="1_5xkf6"]
|
[ext_resource type="Material" uid="uid://clfshh25jwfm1" path="res://logic-scenes/card_burner/card_fire.material" id="1_5xkf6"]
|
||||||
[ext_resource type="PackedScene" uid="uid://dy5rd437h5hsw" path="res://logic-scenes/board/card.tscn" id="2_wi77g"]
|
[ext_resource type="PackedScene" uid="uid://dy5rd437h5hsw" path="res://logic-scenes/board/card.tscn" id="2_wi77g"]
|
||||||
[ext_resource type="SpriteFrames" uid="uid://j7e7me3hl6xt" path="res://logic-scenes/board/card-textures/card-sprites.tres" id="3_2ph0d"]
|
[ext_resource type="SpriteFrames" uid="uid://j7e7me3hl6xt" path="res://logic-scenes/board/card-textures/card-sprites.tres" id="3_2ph0d"]
|
||||||
[ext_resource type="Material" uid="uid://0mocn41t2rq8" path="res://logic-scenes/card_burner/card_sut.material" id="3_5ktf7"]
|
[ext_resource type="PackedScene" uid="uid://bp6fd5lms3apa" path="res://logic-scenes/card_burner/card_sut.tscn" id="3_5xkf6"]
|
||||||
[ext_resource type="PackedScene" uid="uid://uc6urpgv7n1y" path="res://logic-scenes/card_burner/cursor_candle.tscn" id="3_f606e"]
|
[ext_resource type="PackedScene" uid="uid://uc6urpgv7n1y" path="res://logic-scenes/card_burner/cursor_candle.tscn" id="3_f606e"]
|
||||||
|
|
||||||
[sub_resource type="Gradient" id="Gradient_uu85p"]
|
[sub_resource type="Gradient" id="Gradient_pt3n6"]
|
||||||
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
|
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
|
||||||
|
|
||||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_f606e"]
|
[sub_resource type="GradientTexture2D" id="GradientTexture2D_f606e"]
|
||||||
gradient = SubResource("Gradient_uu85p")
|
gradient = SubResource("Gradient_pt3n6")
|
||||||
width = 407
|
width = 407
|
||||||
height = 315
|
height = 315
|
||||||
fill = 1
|
fill = 1
|
||||||
|
|
@ -28,14 +28,6 @@ func _process(delta: float) -> void:
|
||||||
$AnimatedSprite2D/Sprite2D.material.set_shader_parameter(\"fire_progression\", flame_progression)
|
$AnimatedSprite2D/Sprite2D.material.set_shader_parameter(\"fire_progression\", flame_progression)
|
||||||
"
|
"
|
||||||
|
|
||||||
[sub_resource type="GradientTexture2D" id="GradientTexture2D_wi77g"]
|
|
||||||
gradient = SubResource("Gradient_uu85p")
|
|
||||||
width = 407
|
|
||||||
height = 300
|
|
||||||
fill = 1
|
|
||||||
fill_from = Vector2(1, 0)
|
|
||||||
fill_to = Vector2(0, 1)
|
|
||||||
|
|
||||||
[sub_resource type="Environment" id="Environment_cfpbc"]
|
[sub_resource type="Environment" id="Environment_cfpbc"]
|
||||||
background_mode = 3
|
background_mode = 3
|
||||||
ambient_light_source = 2
|
ambient_light_source = 2
|
||||||
|
|
@ -65,11 +57,9 @@ position = Vector2(-9.06201, -0.589877)
|
||||||
scale = Vector2(0.647283, 0.589863)
|
scale = Vector2(0.647283, 0.589863)
|
||||||
sprite_frames = ExtResource("3_2ph0d")
|
sprite_frames = ExtResource("3_2ph0d")
|
||||||
|
|
||||||
[node name="Sprite2D" type="Sprite2D" parent="Sprite2D2/AnimatedSprite2D"]
|
[node name="Node2D" parent="Sprite2D2/AnimatedSprite2D" instance=ExtResource("3_5xkf6")]
|
||||||
material = ExtResource("3_5ktf7")
|
material = null
|
||||||
position = Vector2(6, -11)
|
position = Vector2(6, -11)
|
||||||
scale = Vector2(1.54492, 1.69531)
|
|
||||||
texture = SubResource("GradientTexture2D_wi77g")
|
|
||||||
|
|
||||||
[node name="CursorCandle" parent="." instance=ExtResource("3_f606e")]
|
[node name="CursorCandle" parent="." instance=ExtResource("3_f606e")]
|
||||||
position = Vector2(1206, 675)
|
position = Vector2(1206, 675)
|
||||||
|
|
|
||||||
|
|
@ -21,10 +21,11 @@ var _is_initialised: bool = false
|
||||||
set(value):
|
set(value):
|
||||||
mementos_complete = value
|
mementos_complete = value
|
||||||
if _is_initialised: changed.emit()
|
if _is_initialised: changed.emit()
|
||||||
@export var board_state: Dictionary = {"cards": {}, "stickies": {}}:
|
@export var board_state: Dictionary = {"cards": {}, "stickies": {}, "randoms": []}:
|
||||||
set(value):
|
set(value):
|
||||||
board_state = value
|
board_state = value
|
||||||
if _is_initialised: changed.emit()
|
if _is_initialised: changed.emit()
|
||||||
|
@export var is_childhood_board_complete: bool = false
|
||||||
@export var thumbnail: Texture = preload("res://import/interface-elements/empty_save_slot.png"):
|
@export var thumbnail: Texture = preload("res://import/interface-elements/empty_save_slot.png"):
|
||||||
set(value):
|
set(value):
|
||||||
thumbnail = value
|
thumbnail = value
|
||||||
|
|
@ -84,6 +85,7 @@ func read_save_file():
|
||||||
parsed["current_room"] is float and
|
parsed["current_room"] is float and
|
||||||
parsed["mementos_complete"] is float and
|
parsed["mementos_complete"] is float and
|
||||||
parsed["board_state"] is Dictionary and
|
parsed["board_state"] is Dictionary and
|
||||||
|
parsed["is_childhood_board_complete"] is bool and
|
||||||
parsed["last_saved"] is float and
|
parsed["last_saved"] is float and
|
||||||
parsed["demo"] is bool and last_saved != 0
|
parsed["demo"] is bool and last_saved != 0
|
||||||
)
|
)
|
||||||
|
|
@ -100,15 +102,19 @@ func read_save_file():
|
||||||
|
|
||||||
var cards: Dictionary[StringName, Variant]
|
var cards: Dictionary[StringName, Variant]
|
||||||
var stickies: Dictionary[StringName, Variant]
|
var stickies: Dictionary[StringName, Variant]
|
||||||
|
var randoms: Array[StringName]
|
||||||
|
|
||||||
for cardname:String in board_state["cards"]:
|
for cardname:String in board_state["cards"]:
|
||||||
cards[StringName(cardname)] = board_state["cards"][cardname]
|
cards[StringName(cardname)] = board_state["cards"][cardname]
|
||||||
for sticky_name:String in board_state["stickies"]:
|
for sticky_name:String in board_state["stickies"]:
|
||||||
stickies[StringName(sticky_name)] = board_state["stickies"][sticky_name]
|
stickies[StringName(sticky_name)] = board_state["stickies"][sticky_name]
|
||||||
|
for random_name:StringName in board_state["randoms"]:
|
||||||
|
randoms.append( board_state["randoms"][random_name] )
|
||||||
|
|
||||||
board_state = {
|
board_state = {
|
||||||
"cards": cards,
|
"cards": cards,
|
||||||
"stickies": stickies
|
"stickies": stickies,
|
||||||
|
"randoms": randoms
|
||||||
}
|
}
|
||||||
|
|
||||||
is_valid = are_types_valid \
|
is_valid = are_types_valid \
|
||||||
|
|
@ -131,6 +137,7 @@ func _get_save_dict() -> Dictionary:
|
||||||
"current_room": current_room,
|
"current_room": current_room,
|
||||||
"mementos_complete": mementos_complete,
|
"mementos_complete": mementos_complete,
|
||||||
"board_state": board_state,
|
"board_state": board_state,
|
||||||
|
"is_childhood_board_complete": is_childhood_board_complete,
|
||||||
"last_saved": last_saved,
|
"last_saved": last_saved,
|
||||||
"is_demo": is_demo
|
"is_demo": is_demo
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,7 +146,7 @@ func _ready():
|
||||||
#last_save_dict = get_save_dict()
|
#last_save_dict = get_save_dict()
|
||||||
|
|
||||||
|
|
||||||
func reclaim_lost_focus():
|
func reclaim_lost_focus(_thief):
|
||||||
if has_stage:
|
if has_stage:
|
||||||
grab_focus()
|
grab_focus()
|
||||||
|
|
||||||
|
|
@ -496,13 +496,13 @@ func get_save_dict() -> Dictionary:
|
||||||
# Save position of Card.
|
# Save position of Card.
|
||||||
cards[child.name] = child.transform.origin
|
cards[child.name] = child.transform.origin
|
||||||
if child.picked_random:
|
if child.picked_random:
|
||||||
randoms.append(child)
|
randoms.append(child.name)
|
||||||
|
|
||||||
if child.has_sticky_note_attached():
|
if child.has_sticky_note_attached():
|
||||||
# Saves Card Name as position of it's children.
|
# Saves Card Name as position of it's children.
|
||||||
stickies[child.get_attached_sticky_note().name] = child.name
|
stickies[child.get_attached_sticky_note().name] = child.name
|
||||||
if child.get_attached_sticky_note().picked_random:
|
if child.get_attached_sticky_note().picked_random:
|
||||||
randoms.append(child.get_attached_sticky_note().card_id)
|
randoms.append(child.get_attached_sticky_note().name)
|
||||||
|
|
||||||
elif child is StickyNote:
|
elif child is StickyNote:
|
||||||
# Save position of StickyNote.
|
# Save position of StickyNote.
|
||||||
|
|
@ -532,7 +532,7 @@ func rebuild_from_savedict(board_state:Dictionary):
|
||||||
if board_state["stickies"] != {} :
|
if board_state["stickies"] != {} :
|
||||||
stickies = board_state["stickies"]
|
stickies = board_state["stickies"]
|
||||||
var randoms: Array[StringName]
|
var randoms: Array[StringName]
|
||||||
if board_state["randoms"] != {} :
|
if board_state["randoms"] != [] :
|
||||||
randoms = board_state["randoms"]
|
randoms = board_state["randoms"]
|
||||||
|
|
||||||
if cards == null and stickies == null: return
|
if cards == null and stickies == null: return
|
||||||
|
|
|
||||||
|
|
@ -4,6 +4,13 @@ class_name Card
|
||||||
|
|
||||||
var card_id
|
var card_id
|
||||||
|
|
||||||
|
enum burned {
|
||||||
|
NOT,
|
||||||
|
SINGED,
|
||||||
|
BURNING,
|
||||||
|
TORCHED
|
||||||
|
}
|
||||||
|
|
||||||
#FIXME remove this legacy stuff without loosing the evil notes ...
|
#FIXME remove this legacy stuff without loosing the evil notes ...
|
||||||
var compatible_sticky_notes: Array[StickyNote] = []
|
var compatible_sticky_notes: Array[StickyNote] = []
|
||||||
@export var evil_sticky_notes: Array[StickyNote] = []
|
@export var evil_sticky_notes: Array[StickyNote] = []
|
||||||
|
|
@ -65,7 +72,57 @@ var background_sprite: AnimatedSprite2D
|
||||||
@export var voice_line: AudioStream = null
|
@export var voice_line: AudioStream = null
|
||||||
@export var is_dragable: bool = false
|
@export var is_dragable: bool = false
|
||||||
@export var diameter = 336.0
|
@export var diameter = 336.0
|
||||||
|
@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:
|
||||||
|
has_burned.emit()
|
||||||
|
burn_state = burning
|
||||||
|
|
||||||
|
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()
|
||||||
|
|
||||||
var sticky_note_position: Vector2 = Vector2(-66, 83)
|
var sticky_note_position: Vector2 = Vector2(-66, 83)
|
||||||
var collider: Shape2D
|
var collider: Shape2D
|
||||||
|
|
@ -92,6 +149,7 @@ func _ready():
|
||||||
|
|
||||||
background_sprite = AnimatedSprite2D.new()
|
background_sprite = AnimatedSprite2D.new()
|
||||||
background_sprite.sprite_frames = preload("res://logic-scenes/board/card-textures/card-sprites.tres")
|
background_sprite.sprite_frames = preload("res://logic-scenes/board/card-textures/card-sprites.tres")
|
||||||
|
background_sprite.clip_children = CanvasItem.CLIP_CHILDREN_AND_DRAW
|
||||||
|
|
||||||
label = Label.new()
|
label = Label.new()
|
||||||
label.theme_type_variation = "card_text"
|
label.theme_type_variation = "card_text"
|
||||||
|
|
@ -124,7 +182,6 @@ func _on_text_updated():
|
||||||
if text == "":
|
if text == "":
|
||||||
if background_sprite.get_child_count() == 0:
|
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)
|
background_sprite.add_child(load("res://logic-scenes/board/void_stuff.tscn").instantiate(), false, Node.INTERNAL_MODE_DISABLED)
|
||||||
background_sprite.clip_children = CanvasItem.CLIP_CHILDREN_AND_DRAW
|
|
||||||
else:
|
else:
|
||||||
if background_sprite.get_child_count() > 0:
|
if background_sprite.get_child_count() > 0:
|
||||||
background_sprite.get_child(0).queue_free()
|
background_sprite.get_child(0).queue_free()
|
||||||
|
|
@ -136,6 +193,8 @@ func _on_text_updated():
|
||||||
label.rotation = deg_to_rad(transfor_arr[curr_frame].get_rotation())
|
label.rotation = deg_to_rad(transfor_arr[curr_frame].get_rotation())
|
||||||
label.position = transfor_arr[curr_frame].origin
|
label.position = transfor_arr[curr_frame].origin
|
||||||
|
|
||||||
|
burn_progress = burn_progress
|
||||||
|
|
||||||
if not Engine.is_editor_hint():
|
if not Engine.is_editor_hint():
|
||||||
_handle_wiggle(0)
|
_handle_wiggle(0)
|
||||||
|
|
||||||
|
|
@ -186,6 +245,8 @@ func _on_mouse_entered():
|
||||||
func _on_mouse_exited():
|
func _on_mouse_exited():
|
||||||
highlighted = false
|
highlighted = false
|
||||||
is_mouse_entered = false
|
is_mouse_entered = false
|
||||||
|
if burn_state == burned.SINGED:
|
||||||
|
burn_state = burned.NOT
|
||||||
|
|
||||||
func _on_input_event(_viewport, event, _shape_idx):
|
func _on_input_event(_viewport, event, _shape_idx):
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,9 @@ size = Vector2(4262, 766.5)
|
||||||
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ivo5o"]
|
[sub_resource type="RectangleShape2D" id="RectangleShape2D_ivo5o"]
|
||||||
size = Vector2(4249, 766.5)
|
size = Vector2(4249, 766.5)
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_qjqy3"]
|
||||||
|
length = 0.001
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_2qppy"]
|
[sub_resource type="Animation" id="Animation_2qppy"]
|
||||||
resource_name = "complete"
|
resource_name = "complete"
|
||||||
length = 14.5
|
length = 14.5
|
||||||
|
|
@ -79,9 +82,6 @@ tracks/0/keys = {
|
||||||
}
|
}
|
||||||
tracks/0/use_blend = true
|
tracks/0/use_blend = true
|
||||||
|
|
||||||
[sub_resource type="Animation" id="Animation_qjqy3"]
|
|
||||||
length = 0.001
|
|
||||||
|
|
||||||
[sub_resource type="AnimationLibrary" id="AnimationLibrary_htay1"]
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_htay1"]
|
||||||
_data = {
|
_data = {
|
||||||
&"RESET": SubResource("Animation_qjqy3"),
|
&"RESET": SubResource("Animation_qjqy3"),
|
||||||
|
|
|
||||||
|
|
@ -6,7 +6,7 @@ var has_stage = false:
|
||||||
if focus:
|
if focus:
|
||||||
process_mode = Node.PROCESS_MODE_INHERIT
|
process_mode = Node.PROCESS_MODE_INHERIT
|
||||||
self.show()
|
self.show()
|
||||||
self.mouse_filter = Control.MOUSE_FILTER_STOP
|
self.mouse_filter = Control.MOUSE_FILTER_PASS
|
||||||
else:
|
else:
|
||||||
self.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
self.mouse_filter = Control.MOUSE_FILTER_IGNORE
|
||||||
self.hide()
|
self.hide()
|
||||||
|
|
@ -14,13 +14,42 @@ var has_stage = false:
|
||||||
has_stage = focus
|
has_stage = focus
|
||||||
|
|
||||||
func _ready():
|
func _ready():
|
||||||
Scenes.sign_up_for_sequence(burn_cards, Scenes.id.TRANSITION, 0)
|
Scenes.sign_up_for_sequence(burn_cards, Scenes.id.TRANSITION, 1)
|
||||||
|
%SkipButton.pressed.connect(card_burned.emit)
|
||||||
|
|
||||||
func burn_cards():
|
func burn_cards(_id, _repeat):
|
||||||
var random_card_names: Array[StringName] = State.active_save_game.board_state["randoms"]
|
var random_card_names: Array = State.active_save_game.board_state["randoms"]
|
||||||
|
|
||||||
for card_name in random_card_names:
|
for card_name in random_card_names:
|
||||||
if card_name.begins_with("c"):
|
if card_name.begins_with("p"):
|
||||||
random_card_names.erase(card_name)
|
random_card_names.erase(card_name)
|
||||||
|
|
||||||
var random_cards: Array[Card] = HardCards.get_cards_by_name_array(random_card_names)["cards"]
|
var random_cards: Array = HardCards.get_cards_by_name_array(random_card_names)["cards"]
|
||||||
|
|
||||||
|
random_cards.shuffle()
|
||||||
|
|
||||||
|
for ancor:Control in [%Ancor1, %Ancor2, %Ancor3, %Ancor4]:
|
||||||
|
if random_cards.size() > 0:
|
||||||
|
ancor.get_child(0).queue_free()
|
||||||
|
var new_child: Card = random_cards.pop_front()
|
||||||
|
ancor.add_child(new_child)
|
||||||
|
new_child.owner = self
|
||||||
|
new_child.has_burned.connect(card_burned.emit)
|
||||||
|
|
||||||
|
await card_burned
|
||||||
|
$AnimationPlayer.play("vanish")
|
||||||
|
await $AnimationPlayer.animation_finished
|
||||||
|
|
||||||
|
|
||||||
|
Scenes.continue_sequence(self)
|
||||||
|
|
||||||
|
signal card_burned
|
||||||
|
|
||||||
|
func handle_hover(to_handle: Area2D):
|
||||||
|
if to_handle is Card:
|
||||||
|
if to_handle.burn_state == Card.burned.NOT:
|
||||||
|
to_handle.burn_state = Card.burned.SINGED
|
||||||
|
|
||||||
|
func handle_mouse_button(event: InputEventMouseButton, card: Card):
|
||||||
|
if event.button_index == MOUSE_BUTTON_MASK_LEFT and event.is_pressed() and not event.is_echo():
|
||||||
|
card.burn_state = Card.burned.BURNING
|
||||||
|
|
|
||||||
|
|
@ -1,4 +1,4 @@
|
||||||
[gd_scene load_steps=8 format=3 uid="uid://g2a27jwdapai"]
|
[gd_scene load_steps=13 format=3 uid="uid://g2a27jwdapai"]
|
||||||
|
|
||||||
[ext_resource type="Script" uid="uid://bbia2hcdwctyn" path="res://logic-scenes/card_burner/card_burner.gd" id="1_copuj"]
|
[ext_resource type="Script" uid="uid://bbia2hcdwctyn" path="res://logic-scenes/card_burner/card_burner.gd" id="1_copuj"]
|
||||||
[ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="2_l4ogr"]
|
[ext_resource type="Script" uid="uid://2loic2eeec5b" path="res://logic-scenes/board/card.gd" id="2_l4ogr"]
|
||||||
|
|
@ -6,16 +6,60 @@
|
||||||
[ext_resource type="PackedScene" uid="uid://uc6urpgv7n1y" path="res://logic-scenes/card_burner/cursor_candle.tscn" id="3_l4ogr"]
|
[ext_resource type="PackedScene" uid="uid://uc6urpgv7n1y" path="res://logic-scenes/card_burner/cursor_candle.tscn" id="3_l4ogr"]
|
||||||
[ext_resource type="Script" uid="uid://bbs1u7ojno7xo" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="4_x6cxt"]
|
[ext_resource type="Script" uid="uid://bbs1u7ojno7xo" path="res://addons/input_prompts/action_prompt/action_prompt.gd" id="4_x6cxt"]
|
||||||
|
|
||||||
[sub_resource type="InputEventKey" id="InputEventKey_23lqb"]
|
[sub_resource type="InputEventKey" id="InputEventKey_ckmi5"]
|
||||||
device = -1
|
device = -1
|
||||||
physical_keycode = 88
|
physical_keycode = 88
|
||||||
unicode = 120
|
unicode = 120
|
||||||
|
|
||||||
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_57mhv"]
|
[sub_resource type="InputEventJoypadButton" id="InputEventJoypadButton_x6cxt"]
|
||||||
device = -1
|
device = -1
|
||||||
button_index = 2
|
button_index = 2
|
||||||
pressed = true
|
pressed = true
|
||||||
|
|
||||||
|
[sub_resource type="Gradient" id="Gradient_ckmi5"]
|
||||||
|
colors = PackedColorArray(0, 0, 0, 1, 0, 0, 0, 1)
|
||||||
|
|
||||||
|
[sub_resource type="GradientTexture2D" id="GradientTexture2D_x6cxt"]
|
||||||
|
gradient = SubResource("Gradient_ckmi5")
|
||||||
|
width = 100
|
||||||
|
height = 100
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_23lqb"]
|
||||||
|
resource_name = "vanish"
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:self_modulate")
|
||||||
|
tracks/0/interp = 2
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0, 1),
|
||||||
|
"transitions": PackedFloat32Array(1, 1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(1, 1, 1, 0), Color(1, 1, 1, 1)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="Animation" id="Animation_57mhv"]
|
||||||
|
length = 0.001
|
||||||
|
tracks/0/type = "value"
|
||||||
|
tracks/0/imported = false
|
||||||
|
tracks/0/enabled = true
|
||||||
|
tracks/0/path = NodePath("../Sprite2D:self_modulate")
|
||||||
|
tracks/0/interp = 1
|
||||||
|
tracks/0/loop_wrap = true
|
||||||
|
tracks/0/keys = {
|
||||||
|
"times": PackedFloat32Array(0),
|
||||||
|
"transitions": PackedFloat32Array(1),
|
||||||
|
"update": 0,
|
||||||
|
"values": [Color(1, 1, 1, 0)]
|
||||||
|
}
|
||||||
|
|
||||||
|
[sub_resource type="AnimationLibrary" id="AnimationLibrary_kaqqi"]
|
||||||
|
_data = {
|
||||||
|
&"RESET": SubResource("Animation_57mhv"),
|
||||||
|
&"vanish": SubResource("Animation_23lqb")
|
||||||
|
}
|
||||||
|
|
||||||
[node name="CardBurner" type="CenterContainer"]
|
[node name="CardBurner" type="CenterContainer"]
|
||||||
anchors_preset = 15
|
anchors_preset = 15
|
||||||
anchor_right = 1.0
|
anchor_right = 1.0
|
||||||
|
|
@ -46,6 +90,7 @@ You may try to burn one."
|
||||||
horizontal_alignment = 1
|
horizontal_alignment = 1
|
||||||
|
|
||||||
[node name="Ancor1" type="Control" parent="Control"]
|
[node name="Ancor1" type="Control" parent="Control"]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
offset_left = -518.0
|
offset_left = -518.0
|
||||||
|
|
@ -57,10 +102,10 @@ rotation = -0.0352522
|
||||||
[node name="Card" type="Area2D" parent="Control/Ancor1"]
|
[node name="Card" type="Area2D" parent="Control/Ancor1"]
|
||||||
script = ExtResource("2_l4ogr")
|
script = ExtResource("2_l4ogr")
|
||||||
text = "card"
|
text = "card"
|
||||||
picked_random = null
|
|
||||||
metadata/_custom_type_script = "uid://2loic2eeec5b"
|
metadata/_custom_type_script = "uid://2loic2eeec5b"
|
||||||
|
|
||||||
[node name="Ancor2" type="Control" parent="Control"]
|
[node name="Ancor2" type="Control" parent="Control"]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
offset_left = -183.0
|
offset_left = -183.0
|
||||||
|
|
@ -72,10 +117,10 @@ rotation = 0.0120591
|
||||||
[node name="card" type="Area2D" parent="Control/Ancor2"]
|
[node name="card" type="Area2D" parent="Control/Ancor2"]
|
||||||
script = ExtResource("2_l4ogr")
|
script = ExtResource("2_l4ogr")
|
||||||
text = "card"
|
text = "card"
|
||||||
picked_random = null
|
|
||||||
metadata/_custom_type_script = "uid://2loic2eeec5b"
|
metadata/_custom_type_script = "uid://2loic2eeec5b"
|
||||||
|
|
||||||
[node name="Ancor3" type="Control" parent="Control"]
|
[node name="Ancor3" type="Control" parent="Control"]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
offset_left = 153.0
|
offset_left = 153.0
|
||||||
|
|
@ -87,10 +132,10 @@ rotation = -0.0139755
|
||||||
[node name="card" type="Area2D" parent="Control/Ancor3"]
|
[node name="card" type="Area2D" parent="Control/Ancor3"]
|
||||||
script = ExtResource("2_l4ogr")
|
script = ExtResource("2_l4ogr")
|
||||||
text = "card"
|
text = "card"
|
||||||
picked_random = null
|
|
||||||
metadata/_custom_type_script = "uid://2loic2eeec5b"
|
metadata/_custom_type_script = "uid://2loic2eeec5b"
|
||||||
|
|
||||||
[node name="Ancor4" type="Control" parent="Control"]
|
[node name="Ancor4" type="Control" parent="Control"]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
anchors_preset = 0
|
anchors_preset = 0
|
||||||
offset_left = 495.0
|
offset_left = 495.0
|
||||||
|
|
@ -102,7 +147,6 @@ rotation = 0.0245775
|
||||||
[node name="card" type="Area2D" parent="Control/Ancor4"]
|
[node name="card" type="Area2D" parent="Control/Ancor4"]
|
||||||
script = ExtResource("2_l4ogr")
|
script = ExtResource("2_l4ogr")
|
||||||
text = "card"
|
text = "card"
|
||||||
picked_random = null
|
|
||||||
metadata/_custom_type_script = "uid://2loic2eeec5b"
|
metadata/_custom_type_script = "uid://2loic2eeec5b"
|
||||||
|
|
||||||
[node name="HSplitContainer" type="HSplitContainer" parent="Control"]
|
[node name="HSplitContainer" type="HSplitContainer" parent="Control"]
|
||||||
|
|
@ -121,15 +165,27 @@ layout_mode = 2
|
||||||
size_flags_horizontal = 3
|
size_flags_horizontal = 3
|
||||||
texture = ExtResource("3_ckmi5")
|
texture = ExtResource("3_ckmi5")
|
||||||
expand_mode = 2
|
expand_mode = 2
|
||||||
stretch_mode = 4
|
stretch_mode = 5
|
||||||
script = ExtResource("4_x6cxt")
|
script = ExtResource("4_x6cxt")
|
||||||
action = "skip"
|
action = "skip"
|
||||||
icon = 0
|
icon = 0
|
||||||
events = Array[InputEvent]([null, SubResource("InputEventKey_23lqb"), SubResource("InputEventJoypadButton_57mhv")])
|
events = Array[InputEvent]([null, SubResource("InputEventKey_ckmi5"), SubResource("InputEventJoypadButton_x6cxt")])
|
||||||
metadata/_custom_type_script = "uid://bbs1u7ojno7xo"
|
metadata/_custom_type_script = "uid://bbs1u7ojno7xo"
|
||||||
|
|
||||||
[node name="Button" type="Button" parent="Control/HSplitContainer"]
|
[node name="SkipButton" type="Button" parent="Control/HSplitContainer"]
|
||||||
|
unique_name_in_owner = true
|
||||||
layout_mode = 2
|
layout_mode = 2
|
||||||
text = "Keep all thoughts"
|
text = "Keep all thoughts"
|
||||||
|
|
||||||
|
[node name="Sprite2D" type="Sprite2D" parent="Control"]
|
||||||
|
self_modulate = Color(1, 1, 1, 0)
|
||||||
|
scale = Vector2(100, 100)
|
||||||
|
texture = SubResource("GradientTexture2D_x6cxt")
|
||||||
|
|
||||||
[node name="CursorCandle" parent="." instance=ExtResource("3_l4ogr")]
|
[node name="CursorCandle" parent="." instance=ExtResource("3_l4ogr")]
|
||||||
|
|
||||||
|
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
|
||||||
|
root_node = NodePath("../Control/HSplitContainer")
|
||||||
|
libraries = {
|
||||||
|
&"": SubResource("AnimationLibrary_kaqqi")
|
||||||
|
}
|
||||||
|
|
|
||||||
|
|
@ -0,0 +1,59 @@
|
||||||
|
shader_type canvas_item;
|
||||||
|
|
||||||
|
uniform float fire_progression = 0;
|
||||||
|
uniform sampler2D disp_noise: repeat_enable;
|
||||||
|
uniform sampler2D crackle_noise: repeat_enable;
|
||||||
|
uniform sampler2D ash_gradient: repeat_disable;
|
||||||
|
|
||||||
|
|
||||||
|
vec3 RNGV3(vec3 p) {
|
||||||
|
vec3 a = fract(sin(vec3(p.x, p.y, p.z)) * vec3(111.11,333.33,444.44));
|
||||||
|
a += dot(a, a+33.51);
|
||||||
|
return fract(vec3(a.x*a.y, a.y*a.z, a.z*a.x)); //outputs a random vec2 between 0 and 1
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 voronoy(vec3 loc, float scale){
|
||||||
|
loc = loc*scale;
|
||||||
|
vec4 output = vec4(0., 0., 0., 10.);
|
||||||
|
for(float y=-1.; y<=1.; y++){
|
||||||
|
for(float x=-1.; x<=1.; x++){
|
||||||
|
for(float z=-1.; z<=1.; z++){
|
||||||
|
vec3 offs = vec3(x,y,z);
|
||||||
|
vec3 n = RNGV3(floor(loc)+offs)*2.0-1.0;
|
||||||
|
vec3 p = offs+sin(n) * .5;
|
||||||
|
float d = length((fract(loc)-0.5)-p);
|
||||||
|
if(d<output.q){
|
||||||
|
vec3 rng = RNGV3(floor(loc)+offs);
|
||||||
|
output = vec4(rng.x, rng.y, rng.z, d);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return output;
|
||||||
|
}
|
||||||
|
|
||||||
|
vec4 smooth_voronoi(vec3 loc, float scale, int steps, float scatter){
|
||||||
|
vec4 result = vec4(.0);
|
||||||
|
scatter = scatter/float(steps)/scale;
|
||||||
|
|
||||||
|
for (float x = 0.0; x<float(steps); x++) {
|
||||||
|
for (float y = 0.0; y<float(steps); y++) {
|
||||||
|
for (float z = 0.0; z<float(steps); z++) {
|
||||||
|
result += voronoy(loc + vec3(x, y, z) * scatter, scale);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return result / pow(float(steps), 3.);
|
||||||
|
}
|
||||||
|
|
||||||
|
void fragment() {
|
||||||
|
//COLOR.w *= max(.0, 1.0-length(UV-0.5)*2.0);
|
||||||
|
vec2 card_uv = fract(UV*vec2(2, 3));
|
||||||
|
float burn_gradient = max(0, length(vec2(.7, .2) - card_uv) * 3.0) + sin(TIME*2.0)*.1 + sin(TIME*3.5)*.02;
|
||||||
|
float burn_texture = texture(crackle_noise, UV + (texture(disp_noise, UV).xy-.5)*fire_progression*0.3).r;
|
||||||
|
COLOR.w *= clamp(texture(crackle_noise, UV + (texture(disp_noise, UV).xy-.5)*fire_progression*0.2).r*3.0-(fire_progression+burn_gradient*.3-1.2)*3.0, .0, 1.0);
|
||||||
|
vec4 sut_texture = texture(ash_gradient, vec2(smooth_voronoi(vec3(UV, .0), 12.0, 2, .2).w * .6 - burn_gradient - fire_progression*2.0 + COLOR.w * 3.0));
|
||||||
|
COLOR = mix(COLOR.rgba, vec4(COLOR.rgb*sut_texture.rgb, COLOR.w), sut_texture.w);
|
||||||
|
//COLOR.rg = card_uv;
|
||||||
|
}
|
||||||
|
|
@ -0,0 +1 @@
|
||||||
|
uid://c107y36jbhmgx
|
||||||
Binary file not shown.
Binary file not shown.
|
|
@ -0,0 +1,19 @@
|
||||||
|
[gd_scene load_steps=4 format=3 uid="uid://dgj8krsb45s0l"]
|
||||||
|
|
||||||
|
[ext_resource type="Material" uid="uid://clfshh25jwfm1" path="res://logic-scenes/card_burner/card_fire.material" id="1_ktflc"]
|
||||||
|
|
||||||
|
[sub_resource type="Gradient" id="Gradient_uu85p"]
|
||||||
|
offsets = PackedFloat32Array(0.343681, 1)
|
||||||
|
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
|
||||||
|
|
||||||
|
[sub_resource type="GradientTexture2D" id="GradientTexture2D_av2w6"]
|
||||||
|
gradient = SubResource("Gradient_uu85p")
|
||||||
|
width = 400
|
||||||
|
height = 400
|
||||||
|
fill = 1
|
||||||
|
fill_from = Vector2(0.568376, 0.388889)
|
||||||
|
fill_to = Vector2(0.260684, 0.722222)
|
||||||
|
|
||||||
|
[node name="CardFire" type="Sprite2D"]
|
||||||
|
material = ExtResource("1_ktflc")
|
||||||
|
texture = SubResource("GradientTexture2D_av2w6")
|
||||||
|
|
@ -4,6 +4,7 @@ render_mode blend_mix;
|
||||||
uniform float fire_progression = 0;
|
uniform float fire_progression = 0;
|
||||||
uniform sampler2D flame_noise: repeat_enable;
|
uniform sampler2D flame_noise: repeat_enable;
|
||||||
uniform sampler2D ash_gradoent: repeat_disable;
|
uniform sampler2D ash_gradoent: repeat_disable;
|
||||||
|
uniform sampler2D help: hint_screen_texture;
|
||||||
|
|
||||||
vec3 RNGV3(vec3 p) {
|
vec3 RNGV3(vec3 p) {
|
||||||
vec3 a = fract(sin(vec3(p.x, p.y, p.z)) * vec3(111.11,333.33,444.44));
|
vec3 a = fract(sin(vec3(p.x, p.y, p.z)) * vec3(111.11,333.33,444.44));
|
||||||
|
|
@ -47,5 +48,5 @@ vec4 smooth_voronoi(vec3 loc, float scale, int steps, float scatter){
|
||||||
}
|
}
|
||||||
|
|
||||||
void fragment() {
|
void fragment() {
|
||||||
COLOR *= texture(ash_gradoent, vec2(smooth_voronoi(vec3(UV, .0), 5.0, 2, .2).w + COLOR.r*3.0 - pow(fire_progression, 2.2)*3.0 +.5));
|
COLOR *= texture(ash_gradoent, vec2(smooth_voronoi(vec3(UV, .0), 5.0, 2, .2).w * .6 + COLOR.r*3.0 - fire_progression*2.0 +.5));
|
||||||
}
|
}
|
||||||
Binary file not shown.
|
|
@ -0,0 +1,19 @@
|
||||||
|
[gd_scene load_steps=4 format=3 uid="uid://bp6fd5lms3apa"]
|
||||||
|
|
||||||
|
[ext_resource type="Material" uid="uid://0mocn41t2rq8" path="res://logic-scenes/card_burner/card_sut.material" id="3_u7lv4"]
|
||||||
|
|
||||||
|
[sub_resource type="Gradient" id="Gradient_pt3n6"]
|
||||||
|
colors = PackedColorArray(1, 1, 1, 1, 0, 0, 0, 1)
|
||||||
|
|
||||||
|
[sub_resource type="GradientTexture2D" id="GradientTexture2D_wi77g"]
|
||||||
|
gradient = SubResource("Gradient_pt3n6")
|
||||||
|
width = 407
|
||||||
|
height = 300
|
||||||
|
fill = 1
|
||||||
|
fill_from = Vector2(1, 0)
|
||||||
|
fill_to = Vector2(0, 1)
|
||||||
|
|
||||||
|
[node name="Sut" type="Sprite2D"]
|
||||||
|
material = ExtResource("3_u7lv4")
|
||||||
|
scale = Vector2(1.54492, 1.69531)
|
||||||
|
texture = SubResource("GradientTexture2D_wi77g")
|
||||||
|
|
@ -29,7 +29,7 @@ func _process(delta: float) -> void:
|
||||||
position = get_viewport().get_mouse_position() + noise_offset
|
position = get_viewport().get_mouse_position() + noise_offset
|
||||||
rotation = lerp(rotation, clamp(-PI/3, diff.x *.05, PI/3), delta*20.0)
|
rotation = lerp(rotation, clamp(-PI/3, diff.x *.05, PI/3), delta*20.0)
|
||||||
|
|
||||||
lifetime = lerp(lifetime, .25 * (1.0/(1.0+diff.length()*.1) - noise_offset.length()*.02), 0.2)
|
lifetime = max(0.01, lerp(lifetime, .25 * (1.0/(1.0+diff.length()*.1) - noise_offset.length()*.02), 0.2))
|
||||||
"
|
"
|
||||||
|
|
||||||
[node name="CursorCandle" type="CPUParticles2D"]
|
[node name="CursorCandle" type="CPUParticles2D"]
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue