SupaLidlGame/Items/Weapons/Sword.tscn

451 lines
14 KiB
Plaintext
Raw Normal View History

2023-05-26 17:42:50 -07:00
[gd_scene load_steps=35 format=3 uid="uid://dvqap2uhcah63"]
2022-11-18 13:53:51 -08:00
[ext_resource type="Script" path="res://Items/Weapons/Sword.cs" id="1_mlo73"]
2023-05-26 17:42:50 -07:00
[ext_resource type="Script" path="res://State/Weapon/WeaponStateMachine.cs" id="2_vwirq"]
[ext_resource type="Script" path="res://State/Weapon/SwordIdleState.cs" id="3_nw6r0"]
2023-05-23 00:23:53 -07:00
[ext_resource type="Texture2D" uid="uid://dp7osg05ip5oo" path="res://Assets/Sprites/sword.png" id="3_r75ni"]
2022-11-18 13:53:51 -08:00
[ext_resource type="PackedScene" uid="uid://du5vhccg75nrq" path="res://BoundingBoxes/Hitbox.tscn" id="3_up3ob"]
2023-05-26 17:42:50 -07:00
[ext_resource type="Script" path="res://State/Weapon/SwordAnticipateState.cs" id="4_j3cud"]
2022-11-19 21:21:12 -08:00
[ext_resource type="PackedScene" uid="uid://cojxmcin13ihm" path="res://Utils/Trail.tscn" id="4_pt6lq"]
2023-05-26 17:42:50 -07:00
[ext_resource type="Script" path="res://State/Weapon/SwordAttackState.cs" id="5_hmisb"]
2022-11-25 09:11:46 -08:00
[ext_resource type="Texture2D" uid="uid://do1bui3bblkk7" path="res://Assets/Sprites/sword-swing.png" id="5_pywek"]
2022-11-26 14:53:24 -08:00
[ext_resource type="AudioStream" uid="uid://c4n7ioxpukdwi" path="res://Assets/Sounds/parry.wav" id="6_8nxjm"]
2022-11-18 13:53:51 -08:00
2023-05-23 00:23:53 -07:00
[sub_resource type="Environment" id="Environment_72txp"]
background_mode = 3
glow_enabled = true
glow_hdr_threshold = 1.42
2022-11-19 21:21:12 -08:00
[sub_resource type="Curve" id="Curve_4cxtp"]
_data = [Vector2(0.00687286, 1), 0.0, 0.0, 0, 0, Vector2(0.879725, 0.190909), -2.93145, -2.93145, 0, 0, Vector2(1, 0.0454545), 0.0483926, 0.0, 0, 0]
point_count = 3
[sub_resource type="Gradient" id="Gradient_2ablm"]
offsets = PackedFloat32Array(0.835938, 0.992188)
colors = PackedColorArray(1, 1, 1, 0.498039, 1, 1, 1, 0)
2023-04-23 21:10:37 -07:00
[sub_resource type="Gradient" id="Gradient_jjxq2"]
offsets = PackedFloat32Array(0, 0.945312)
colors = PackedColorArray(1, 1, 1, 1, 0.687215, 0.687215, 0.687215, 0)
2022-11-19 21:21:12 -08:00
[sub_resource type="Animation" id="Animation_b7327"]
length = 0.001
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Anchor:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
2023-05-23 00:23:53 -07:00
"update": 1,
"values": [-1.5708]
2022-11-19 21:21:12 -08:00
}
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
2022-11-25 09:11:46 -08:00
tracks/1/path = NodePath("SwingSprite:frame")
2022-11-19 21:21:12 -08:00
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
2022-11-25 09:11:46 -08:00
"update": 1,
"values": [0]
}
tracks/2/type = "value"
tracks/2/imported = false
tracks/2/enabled = true
2023-05-23 00:23:53 -07:00
tracks/2/path = NodePath("Anchor:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
2023-05-23 00:23:53 -07:00
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
2023-05-23 00:23:53 -07:00
"values": [Vector2(0, 0)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Anchor/Node2D:rotation")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.0001, 0.0002),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [0.0, 0.0, 0.0]
}
tracks/4/type = "method"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath(".")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"values": [{
"args": ["is_alternate", false],
"method": &"SetAnimationCondition"
}]
}
2023-05-23 00:23:53 -07:00
[sub_resource type="Animation" id="Animation_ameas"]
resource_name = "anticipate"
length = 0.1
2022-11-25 09:11:46 -08:00
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Anchor:rotation")
tracks/0/interp = 1
2023-05-23 00:23:53 -07:00
tracks/0/loop_wrap = true
2022-11-25 09:11:46 -08:00
tracks/0/keys = {
2023-05-23 00:23:53 -07:00
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(0.933033),
2022-11-25 09:11:46 -08:00
"update": 1,
2023-05-23 00:23:53 -07:00
"values": [-2.35619]
2022-11-19 21:21:12 -08:00
}
2023-05-23 00:23:53 -07:00
[sub_resource type="Animation" id="Animation_bj2ky"]
resource_name = "anticipate_alternate"
length = 0.1
2022-11-19 21:21:12 -08:00
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Anchor:rotation")
tracks/0/interp = 1
2023-05-23 00:23:53 -07:00
tracks/0/loop_wrap = true
2022-11-19 21:21:12 -08:00
tracks/0/keys = {
2023-05-23 00:23:53 -07:00
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 1,
"values": [2.35619]
2022-11-19 21:21:12 -08:00
}
2023-05-23 00:23:53 -07:00
tracks/1/type = "value"
2022-11-19 21:21:12 -08:00
tracks/1/imported = false
tracks/1/enabled = true
2023-05-23 00:23:53 -07:00
tracks/1/path = NodePath("Anchor/Node2D:rotation")
2022-11-19 21:21:12 -08:00
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
2023-05-23 00:23:53 -07:00
"times": PackedFloat32Array(0),
"transitions": PackedFloat32Array(1),
"update": 0,
"values": [3.14159]
2022-11-19 21:21:12 -08:00
}
2023-05-23 00:23:53 -07:00
[sub_resource type="Animation" id="Animation_b8r8j"]
resource_name = "anticipate_bot"
[sub_resource type="Animation" id="Animation_6jphj"]
resource_name = "attack"
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Anchor:rotation")
tracks/0/interp = 1
2022-11-27 19:37:16 -08:00
tracks/0/loop_wrap = true
tracks/0/keys = {
2023-05-23 00:23:53 -07:00
"times": PackedFloat32Array(0, 0.15, 0.35),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [-1.5708, 1.5708, 1.5708]
}
2023-05-23 00:23:53 -07:00
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
2023-05-23 00:23:53 -07:00
tracks/1/path = NodePath("SwingSprite:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
2023-05-23 00:23:53 -07:00
"times": PackedFloat32Array(0.1, 0.2, 0.4),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [1, 2, 0]
}
tracks/2/type = "value"
tracks/2/imported = false
2023-05-23 00:23:53 -07:00
tracks/2/enabled = false
tracks/2/path = NodePath("Anchor:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
2023-05-23 00:23:53 -07:00
"times": PackedFloat32Array(0, 0.1, 0.35),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [Vector2(0, 0), Vector2(0, -4), Vector2(0, 0)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Anchor/Node2D:rotation")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.15),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
2023-05-23 00:23:53 -07:00
"values": [0.0, 2.35619]
}
tracks/4/type = "method"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath(".")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(),
"transitions": PackedFloat32Array(),
"values": []
}
2023-05-23 00:23:53 -07:00
[sub_resource type="Animation" id="Animation_pclfs"]
resource_name = "attack_alternate"
step = 0.05
tracks/0/type = "value"
tracks/0/imported = false
tracks/0/enabled = true
tracks/0/path = NodePath("Anchor:rotation")
tracks/0/interp = 1
tracks/0/loop_wrap = true
tracks/0/keys = {
2023-05-23 00:23:53 -07:00
"times": PackedFloat32Array(0, 0.15, 0.35),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [1.5708, -1.5708, -1.5708]
}
2023-05-23 00:23:53 -07:00
tracks/1/type = "value"
tracks/1/imported = false
tracks/1/enabled = true
2023-05-23 00:23:53 -07:00
tracks/1/path = NodePath("SwingSprite:frame")
tracks/1/interp = 1
tracks/1/loop_wrap = true
tracks/1/keys = {
2023-05-23 00:23:53 -07:00
"times": PackedFloat32Array(0.1, 0.2, 0.4),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
"values": [1, 3, 0]
}
tracks/2/type = "value"
tracks/2/imported = false
2023-05-23 00:23:53 -07:00
tracks/2/enabled = false
tracks/2/path = NodePath("Anchor:position")
tracks/2/interp = 1
tracks/2/loop_wrap = true
tracks/2/keys = {
2023-05-23 00:23:53 -07:00
"times": PackedFloat32Array(0, 0.1, 0.35),
"transitions": PackedFloat32Array(1, 1, 1),
"update": 1,
2023-05-23 00:23:53 -07:00
"values": [Vector2(0, 0), Vector2(0, -4), Vector2(0, 0)]
}
tracks/3/type = "value"
tracks/3/imported = false
tracks/3/enabled = true
tracks/3/path = NodePath("Anchor/Node2D:rotation")
tracks/3/interp = 1
tracks/3/loop_wrap = true
tracks/3/keys = {
"times": PackedFloat32Array(0, 0.15),
"transitions": PackedFloat32Array(1, 1),
"update": 1,
"values": [3.14159, 0.785398]
}
tracks/4/type = "method"
tracks/4/imported = false
tracks/4/enabled = true
tracks/4/path = NodePath(".")
tracks/4/interp = 1
tracks/4/loop_wrap = true
tracks/4/keys = {
"times": PackedFloat32Array(0.2),
"transitions": PackedFloat32Array(1),
"values": [{
"args": ["is_alternate", false],
"method": &"SetAnimationCondition"
}]
}
2022-11-19 21:21:12 -08:00
[sub_resource type="AnimationLibrary" id="AnimationLibrary_tao4k"]
_data = {
"RESET": SubResource("Animation_b7327"),
2023-05-23 00:23:53 -07:00
"anticipate": SubResource("Animation_ameas"),
"anticipate_alternate": SubResource("Animation_bj2ky"),
"anticipate_bot": SubResource("Animation_b8r8j"),
"attack": SubResource("Animation_6jphj"),
"attack_alternate": SubResource("Animation_pclfs")
2022-11-19 21:21:12 -08:00
}
2023-05-23 00:23:53 -07:00
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_7lqgd"]
animation = &"RESET"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_0in44"]
animation = &"anticipate"
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2wqg6"]
animation = &"anticipate_bot"
2022-11-19 21:21:12 -08:00
2023-05-23 00:23:53 -07:00
[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2ei3g"]
animation = &"use"
2022-11-25 09:11:46 -08:00
2023-05-23 00:23:53 -07:00
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_esyoj"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_kg3rd"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_twtoe"]
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_73wvy"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4wst0"]
switch_mode = 2
advance_mode = 2
[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2lfol"]
switch_mode = 2
advance_mode = 2
advance_condition = &"is_player"
[sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_q4hbp"]
states/End/position = Vector2(717, 75)
states/RESET/node = SubResource("AnimationNodeAnimation_7lqgd")
states/RESET/position = Vector2(275, 190)
states/Start/position = Vector2(109, 75)
states/anticipate/node = SubResource("AnimationNodeAnimation_0in44")
states/anticipate/position = Vector2(275, 75)
states/anticipate_bot/node = SubResource("AnimationNodeAnimation_2wqg6")
states/anticipate_bot/position = Vector2(456, 18)
states/use/node = SubResource("AnimationNodeAnimation_2ei3g")
states/use/position = Vector2(609, 75)
transitions = ["Start", "anticipate", SubResource("AnimationNodeStateMachineTransition_esyoj"), "use", "RESET", SubResource("AnimationNodeStateMachineTransition_kg3rd"), "RESET", "anticipate", SubResource("AnimationNodeStateMachineTransition_twtoe"), "anticipate", "anticipate_bot", SubResource("AnimationNodeStateMachineTransition_73wvy"), "anticipate_bot", "use", SubResource("AnimationNodeStateMachineTransition_4wst0"), "anticipate", "use", SubResource("AnimationNodeStateMachineTransition_2lfol")]
graph_offset = Vector2(0, -104.073)
[sub_resource type="AnimationNodeStateMachinePlayback" id="AnimationNodeStateMachinePlayback_o5g2u"]
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_ic623"]
radius = 20.0
height = 48.0
2023-05-28 10:57:23 -07:00
[node name="Sword" type="Node2D" node_paths=PackedStringArray("Hitbox", "AnimationPlayer", "AnimationTree", "ParryParticles", "StateMachine", "Anchor")]
2022-12-04 20:12:34 -08:00
y_sort_enabled = true
2022-11-18 13:53:51 -08:00
texture_filter = 3
script = ExtResource("1_mlo73")
2022-11-25 09:11:46 -08:00
Hitbox = NodePath("Hitbox")
2022-11-19 21:21:12 -08:00
AnimationPlayer = NodePath("AnimationPlayer")
2023-05-23 00:23:53 -07:00
AnimationTree = NodePath("AnimationTree")
AttackTime = 0.2
2023-07-13 23:46:58 -07:00
AttackAnimationDuration = 0.75
2023-04-23 21:10:37 -07:00
ParryParticles = NodePath("Anchor/Node2D/Sprite2D/ParryParticles")
2023-05-26 22:28:08 -07:00
NPCAnticipateTime = 0.3
2023-05-23 00:23:53 -07:00
StateMachine = NodePath("State")
2023-05-26 22:28:08 -07:00
Anchor = NodePath("Anchor")
2022-12-04 20:12:34 -08:00
Damage = 20.0
2023-07-13 23:46:58 -07:00
UseTime = 0.55
2023-05-25 15:28:52 -07:00
Knockback = 64.0
2023-05-28 10:57:23 -07:00
ShouldHideIdle = true
2023-05-23 00:23:53 -07:00
[node name="State" type="Node" parent="." node_paths=PackedStringArray("InitialState")]
2023-05-26 17:42:50 -07:00
script = ExtResource("2_vwirq")
2023-05-23 00:23:53 -07:00
InitialState = NodePath("Idle")
[node name="Idle" type="Node" parent="State" node_paths=PackedStringArray("AnticipateState", "Sword")]
2023-05-26 17:42:50 -07:00
script = ExtResource("3_nw6r0")
2023-05-23 00:23:53 -07:00
AnticipateState = NodePath("../Anticipate")
Sword = NodePath("../..")
[node name="Anticipate" type="Node" parent="State" node_paths=PackedStringArray("Sword", "AttackState")]
2023-05-26 17:42:50 -07:00
script = ExtResource("4_j3cud")
2023-05-23 00:23:53 -07:00
Sword = NodePath("../..")
AttackState = NodePath("../Attack")
[node name="Attack" type="Node" parent="State" node_paths=PackedStringArray("Sword", "AnticipateState", "IdleState")]
2023-05-26 17:42:50 -07:00
script = ExtResource("5_hmisb")
2023-05-23 00:23:53 -07:00
Sword = NodePath("../..")
AnticipateState = NodePath("../Anticipate")
IdleState = NodePath("../Idle")
[node name="WorldEnvironment" type="WorldEnvironment" parent="."]
environment = SubResource("Environment_72txp")
2022-11-19 21:21:12 -08:00
[node name="Anchor" type="Node2D" parent="."]
y_sort_enabled = true
2023-05-23 00:23:53 -07:00
rotation = -1.5708
2022-11-18 13:53:51 -08:00
2023-04-23 21:10:37 -07:00
[node name="Trail" parent="Anchor" node_paths=PackedStringArray("Tracking") instance=ExtResource("4_pt6lq")]
position = Vector2(2.40734, -0.55655)
rotation = 0.945464
width_curve = SubResource("Curve_4cxtp")
gradient = SubResource("Gradient_2ablm")
Tracking = NodePath("../Node2D/Sprite2D")
[node name="Node2D" type="Node2D" parent="Anchor"]
2023-05-25 23:33:21 -07:00
y_sort_enabled = true
2023-05-23 00:23:53 -07:00
position = Vector2(8, 0)
2023-04-23 21:10:37 -07:00
[node name="Sprite2D" type="Sprite2D" parent="Anchor/Node2D"]
2022-11-19 21:21:12 -08:00
y_sort_enabled = true
2023-05-23 00:23:53 -07:00
position = Vector2(0, -8)
texture = ExtResource("3_r75ni")
2022-11-25 09:11:46 -08:00
2023-04-23 21:10:37 -07:00
[node name="ParryParticles" type="CPUParticles2D" parent="Anchor/Node2D/Sprite2D"]
2023-05-25 23:33:21 -07:00
modulate = Color(1.2, 1.2, 1.2, 1)
2022-11-25 09:11:46 -08:00
position = Vector2(-0.221825, -3.12132)
rotation = 0.785398
emitting = false
2023-03-19 23:36:36 -07:00
amount = 24
2022-11-25 09:11:46 -08:00
lifetime = 0.4
one_shot = true
explosiveness = 1.0
emission_shape = 1
emission_sphere_radius = 4.0
direction = Vector2(0, -1)
spread = 180.0
gravity = Vector2(0, 200)
initial_velocity_min = 8.0
initial_velocity_max = 64.0
color_ramp = SubResource("Gradient_jjxq2")
2022-11-19 21:21:12 -08:00
2022-11-18 13:53:51 -08:00
[node name="AnimationPlayer" type="AnimationPlayer" parent="."]
2022-11-19 21:21:12 -08:00
libraries = {
"": SubResource("AnimationLibrary_tao4k")
}
[node name="AnimationTree" type="AnimationTree" parent="."]
2023-05-23 00:23:53 -07:00
tree_root = SubResource("AnimationNodeStateMachine_q4hbp")
2022-11-19 21:21:12 -08:00
anim_player = NodePath("../AnimationPlayer")
active = true
2023-05-23 00:23:53 -07:00
parameters/playback = SubResource("AnimationNodeStateMachinePlayback_o5g2u")
parameters/conditions/is_player = false
2022-11-18 13:53:51 -08:00
2022-11-25 09:11:46 -08:00
[node name="Hitbox" parent="." instance=ExtResource("3_up3ob")]
IsDisabled = true
[node name="CollisionShape2D" parent="Hitbox" index="0"]
2023-05-23 00:23:53 -07:00
position = Vector2(4, 0)
rotation = 1.5708
shape = SubResource("CapsuleShape2D_ic623")
2022-11-25 09:11:46 -08:00
disabled = true
[node name="SwingSprite" type="Sprite2D" parent="."]
2023-05-23 00:23:53 -07:00
modulate = Color(2, 2, 2, 1)
2022-11-25 09:11:46 -08:00
texture = ExtResource("5_pywek")
2023-05-25 23:33:21 -07:00
offset = Vector2(8, 0)
2022-11-25 09:11:46 -08:00
hframes = 4
[node name="SwingSound" type="AudioStreamPlayer2D" parent="."]
2023-03-19 23:36:36 -07:00
max_distance = 256.0
2022-11-25 09:11:46 -08:00
[node name="ParrySound" type="AudioStreamPlayer2D" parent="."]
2022-11-26 14:53:24 -08:00
stream = ExtResource("6_8nxjm")
2023-03-19 23:36:36 -07:00
max_distance = 256.0
2022-11-25 09:11:46 -08:00
[connection signal="Hit" from="Hitbox" to="." method="_on_hitbox_hit"]
[editable path="Hitbox"]