Files
CultManor/game/characters/player/player.tscn
T

278 lines
14 KiB
Plaintext

[gd_scene format=3 uid="uid://dtcad8tdx78tg"]
[ext_resource type="Script" uid="uid://bb8kc32sggrn2" path="res://game/characters/player/player.gd" id="1_xln5q"]
[ext_resource type="PackedScene" uid="uid://8yd8f5x1hujv" path="res://game/characters/water_splash.tscn" id="2_eeksw"]
[ext_resource type="PackedScene" uid="uid://5qlocc0yu8ug" path="res://game/collision_switcher.tscn" id="2_j06tb"]
[ext_resource type="PackedScene" uid="uid://cvx6akiplg21s" path="res://game/characters/player/player_sprite.tscn" id="2_n6ad3"]
[ext_resource type="Shader" uid="uid://cdakbomof1cc6" path="res://game/shaders/invert.gdshader" id="4_v4yks"]
[ext_resource type="PackedScene" uid="uid://bdk23k2bypj8w" path="res://game/characters/player/state_machine/player_state_machine.tscn" id="4_ybe51"]
[ext_resource type="PackedScene" uid="uid://c0d4wfdg7xjti" path="res://game/characters/player/state_machine/player_state.tscn" id="5_65114"]
[ext_resource type="Script" uid="uid://bnxccvt265hlu" path="res://game/characters/player/state_machine/idle_state.gd" id="6_3qf5w"]
[ext_resource type="Script" uid="uid://nc62375vpnsw" path="res://game/characters/player/state_machine/walk_left_state.gd" id="7_btbyc"]
[ext_resource type="Script" uid="uid://cbv84l1duwfep" path="res://game/characters/player/state_machine/look_around_state.gd" id="7_ybe51"]
[ext_resource type="Script" uid="uid://cxa3hf7tqpeoa" path="res://game/characters/player/state_machine/jump_state.gd" id="8_ebhjm"]
[ext_resource type="Script" uid="uid://d2uiegcx4jeuk" path="res://game/characters/player/state_machine/dead_state.gd" id="9_gdxv1"]
[ext_resource type="Script" uid="uid://kufq6bwnv80t" path="res://game/characters/player/state_machine/walk_right_state.gd" id="9_wdx7h"]
[ext_resource type="Script" uid="uid://c0bbmif5ucw28" path="res://game/characters/player/state_machine/jump_left_state.gd" id="11_q2504"]
[ext_resource type="Script" uid="uid://cr0hkb4wggcys" path="res://game/characters/player/state_machine/jump_right_state.gd" id="12_l8uo5"]
[ext_resource type="Script" uid="uid://c7myrm50fnpfn" path="res://game/characters/player/state_machine/falingl_state.gd" id="13_m2bqk"]
[ext_resource type="Script" uid="uid://cmimnl6jf78ao" path="res://game/characters/player/state_machine/falling_left_state.gd" id="14_2lnxg"]
[ext_resource type="Script" uid="uid://5s7ko6pcqagy" path="res://game/characters/player/state_machine/falling_right_state.gd" id="15_bfpdl"]
[sub_resource type="ShaderMaterial" id="ShaderMaterial_eeksw"]
shader = ExtResource("4_v4yks")
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_bhunq"]
lifetime_randomness = 0.5
particle_flag_disable_z = true
emission_shape = 1
emission_sphere_radius = 2.0
spread = 15.0
initial_velocity_min = -25.0
initial_velocity_max = 25.0
gravity = Vector3(0, 9.8, 0)
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_bfpdl"]
particle_flag_disable_z = true
emission_shape = 3
emission_box_extents = Vector3(4, 14, 1)
inherit_velocity_ratio = 0.25
direction = Vector3(0, -1, 0)
initial_velocity_min = 15.0
initial_velocity_max = 15.0
gravity = Vector3(0, 0, 0)
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_xln5q"]
radius = 4.0
[sub_resource type="CapsuleShape2D" id="CapsuleShape2D_t6gq4"]
radius = 2.0
height = 20.0
[node name="Player" type="CharacterBody2D" unique_id=508706417]
collision_layer = 128
collision_mask = 33
script = ExtResource("1_xln5q")
[node name="PlayerSprite" parent="." unique_id=237719081 instance=ExtResource("2_n6ad3")]
animation = &"jump_right"
[node name="WaterSplash" parent="." unique_id=658940825 instance=ExtResource("2_eeksw")]
position = Vector2(0, -16)
[node name="BloodSplash" type="GPUParticles2D" parent="." unique_id=218762198]
material = SubResource("ShaderMaterial_eeksw")
position = Vector2(0, -4)
emitting = false
amount = 32
one_shot = true
preprocess = 0.2
explosiveness = 1.0
fixed_fps = 10
process_material = SubResource("ParticleProcessMaterial_bhunq")
[node name="SwitchEffect" type="GPUParticles2D" parent="." unique_id=405618377]
emitting = false
amount = 16
lifetime = 0.25
one_shot = true
explosiveness = 0.5
fixed_fps = 10
process_material = SubResource("ParticleProcessMaterial_bfpdl")
[node name="CollisionShape2D" type="CollisionShape2D" parent="." unique_id=1101386361]
position = Vector2(0, 1)
shape = SubResource("CapsuleShape2D_xln5q")
[node name="CollisionSwitcher" parent="." unique_id=601548821 node_paths=PackedStringArray("objects") instance=ExtResource("2_j06tb")]
objects = [NodePath("..")]
[node name="Camera2D" type="Camera2D" parent="." unique_id=45512317]
process_callback = 0
position_smoothing_enabled = true
position_smoothing_speed = 25.0
drag_horizontal_enabled = true
drag_vertical_enabled = true
drag_left_margin = 0.1
drag_top_margin = 0.1
drag_right_margin = 0.1
drag_bottom_margin = 0.1
[node name="Pickups" type="Node2D" parent="." unique_id=958829860]
position = Vector2(0, -24)
[node name="SwitchBufferTimer" type="Timer" parent="." unique_id=115300327]
process_callback = 0
wait_time = 0.5
one_shot = true
[node name="JumpBufferTimer" type="Timer" parent="." unique_id=740877224]
process_callback = 0
wait_time = 0.1
one_shot = true
[node name="CoyoteTimeTimer" type="Timer" parent="." unique_id=117837002]
process_callback = 0
wait_time = 0.1
one_shot = true
[node name="CenterArea2D" type="Area2D" parent="." unique_id=490866430]
collision_layer = 0
collision_mask = 35
[node name="CollisionShape2D" type="CollisionShape2D" parent="CenterArea2D" unique_id=1350886064]
position = Vector2(0, 1)
shape = SubResource("CapsuleShape2D_t6gq4")
[node name="PlayerStateMachine" parent="." unique_id=633169960 node_paths=PackedStringArray("player", "initial_state") instance=ExtResource("4_ybe51")]
player = NodePath("..")
initial_state = NodePath("IdleState")
[node name="IdleState" parent="PlayerStateMachine" unique_id=739226464 node_paths=PackedStringArray("look_around_state", "player", "idle_state", "walk_left_state", "walk_right_state", "dead_state", "jump_state", "jump_left_state", "jump_right_state", "fall_state", "fall_left_state", "fall_right_state") instance=ExtResource("5_65114")]
script = ExtResource("6_3qf5w")
look_around_state = NodePath("../LookAroundState")
player = NodePath("../..")
idle_state = NodePath(".")
walk_left_state = NodePath("../WalkLeftState")
walk_right_state = NodePath("../WalkRightState")
dead_state = NodePath("../DeadState")
jump_state = NodePath("../JumpState")
jump_left_state = NodePath("../JumpLeftState")
jump_right_state = NodePath("../JumpRightState")
fall_state = NodePath("../FallState")
fall_left_state = NodePath("../FallLeftState")
fall_right_state = NodePath("../FallRightState")
[node name="WalkLeftState" parent="PlayerStateMachine" unique_id=195513070 node_paths=PackedStringArray("player", "idle_state", "walk_left_state", "walk_right_state", "dead_state", "jump_state", "jump_left_state", "jump_right_state", "fall_state", "fall_left_state", "fall_right_state") instance=ExtResource("5_65114")]
script = ExtResource("7_btbyc")
player = NodePath("../..")
idle_state = NodePath("../IdleState")
walk_left_state = NodePath(".")
walk_right_state = NodePath("../WalkRightState")
dead_state = NodePath("../DeadState")
jump_state = NodePath("../JumpState")
jump_left_state = NodePath("../JumpLeftState")
jump_right_state = NodePath("../JumpRightState")
fall_state = NodePath("../FallState")
fall_left_state = NodePath("../FallLeftState")
fall_right_state = NodePath("../FallRightState")
[node name="WalkRightState" parent="PlayerStateMachine" unique_id=224236087 node_paths=PackedStringArray("player", "idle_state", "walk_left_state", "walk_right_state", "dead_state", "jump_state", "jump_left_state", "jump_right_state", "fall_state", "fall_left_state", "fall_right_state") instance=ExtResource("5_65114")]
script = ExtResource("9_wdx7h")
player = NodePath("../..")
idle_state = NodePath("../IdleState")
walk_left_state = NodePath("../WalkLeftState")
walk_right_state = NodePath(".")
dead_state = NodePath("../DeadState")
jump_state = NodePath("../JumpState")
jump_left_state = NodePath("../JumpLeftState")
jump_right_state = NodePath("../JumpRightState")
fall_state = NodePath("../FallState")
fall_left_state = NodePath("../FallLeftState")
fall_right_state = NodePath("../FallRightState")
[node name="DeadState" parent="PlayerStateMachine" unique_id=2135733235 node_paths=PackedStringArray("player") instance=ExtResource("5_65114")]
script = ExtResource("9_gdxv1")
player = NodePath("../..")
[node name="JumpState" parent="PlayerStateMachine" unique_id=1592631166 node_paths=PackedStringArray("player", "idle_state", "walk_left_state", "walk_right_state", "dead_state", "jump_state", "jump_left_state", "jump_right_state", "fall_state", "fall_left_state", "fall_right_state") instance=ExtResource("5_65114")]
script = ExtResource("8_ebhjm")
player = NodePath("../..")
idle_state = NodePath("../IdleState")
walk_left_state = NodePath("../WalkLeftState")
walk_right_state = NodePath("../WalkRightState")
dead_state = NodePath("../DeadState")
jump_state = NodePath(".")
jump_left_state = NodePath("../JumpLeftState")
jump_right_state = NodePath("../JumpRightState")
fall_state = NodePath("../FallState")
fall_left_state = NodePath("../FallLeftState")
fall_right_state = NodePath("../FallRightState")
[node name="JumpLeftState" parent="PlayerStateMachine" unique_id=609248752 node_paths=PackedStringArray("player", "idle_state", "walk_left_state", "walk_right_state", "dead_state", "jump_state", "jump_left_state", "jump_right_state", "fall_state", "fall_left_state", "fall_right_state") instance=ExtResource("5_65114")]
script = ExtResource("11_q2504")
player = NodePath("../..")
idle_state = NodePath("../IdleState")
walk_left_state = NodePath("../WalkLeftState")
walk_right_state = NodePath("../WalkRightState")
dead_state = NodePath("../DeadState")
jump_state = NodePath(".")
jump_left_state = NodePath(".")
jump_right_state = NodePath("../JumpRightState")
fall_state = NodePath("../FallState")
fall_left_state = NodePath("../FallLeftState")
fall_right_state = NodePath("../FallRightState")
[node name="JumpRightState" parent="PlayerStateMachine" unique_id=1936273065 node_paths=PackedStringArray("player", "idle_state", "walk_left_state", "walk_right_state", "dead_state", "jump_state", "jump_left_state", "jump_right_state", "fall_state", "fall_left_state", "fall_right_state") instance=ExtResource("5_65114")]
script = ExtResource("12_l8uo5")
player = NodePath("../..")
idle_state = NodePath("../IdleState")
walk_left_state = NodePath("../WalkLeftState")
walk_right_state = NodePath("../WalkRightState")
dead_state = NodePath("../DeadState")
jump_state = NodePath(".")
jump_left_state = NodePath("../JumpLeftState")
jump_right_state = NodePath(".")
fall_state = NodePath("../FallState")
fall_left_state = NodePath("../FallLeftState")
fall_right_state = NodePath("../FallRightState")
[node name="FallState" parent="PlayerStateMachine" unique_id=329927506 node_paths=PackedStringArray("player", "idle_state", "walk_left_state", "walk_right_state", "dead_state", "jump_state", "jump_left_state", "jump_right_state", "fall_state", "fall_left_state", "fall_right_state") instance=ExtResource("5_65114")]
script = ExtResource("13_m2bqk")
player = NodePath("../..")
idle_state = NodePath("../IdleState")
walk_left_state = NodePath("../WalkLeftState")
walk_right_state = NodePath("../WalkRightState")
dead_state = NodePath("../DeadState")
jump_state = NodePath(".")
jump_left_state = NodePath("../JumpLeftState")
jump_right_state = NodePath("../JumpRightState")
fall_state = NodePath(".")
fall_left_state = NodePath("../FallLeftState")
fall_right_state = NodePath("../FallRightState")
[node name="FallLeftState" parent="PlayerStateMachine" unique_id=730552947 node_paths=PackedStringArray("player", "idle_state", "walk_left_state", "walk_right_state", "dead_state", "jump_state", "jump_left_state", "jump_right_state", "fall_state", "fall_left_state", "fall_right_state") instance=ExtResource("5_65114")]
script = ExtResource("14_2lnxg")
player = NodePath("../..")
idle_state = NodePath("../IdleState")
walk_left_state = NodePath("../WalkLeftState")
walk_right_state = NodePath("../WalkRightState")
dead_state = NodePath("../DeadState")
jump_state = NodePath(".")
jump_left_state = NodePath("../JumpLeftState")
jump_right_state = NodePath("../JumpRightState")
fall_state = NodePath("../FallState")
fall_left_state = NodePath(".")
fall_right_state = NodePath("../FallRightState")
[node name="FallRightState" parent="PlayerStateMachine" unique_id=347081029 node_paths=PackedStringArray("player", "idle_state", "walk_left_state", "walk_right_state", "dead_state", "jump_state", "jump_left_state", "jump_right_state", "fall_state", "fall_left_state", "fall_right_state") instance=ExtResource("5_65114")]
script = ExtResource("15_bfpdl")
player = NodePath("../..")
idle_state = NodePath("../IdleState")
walk_left_state = NodePath("../WalkLeftState")
walk_right_state = NodePath("../WalkRightState")
dead_state = NodePath("../DeadState")
jump_state = NodePath(".")
jump_left_state = NodePath("../JumpLeftState")
jump_right_state = NodePath("../JumpRightState")
fall_state = NodePath("../FallState")
fall_left_state = NodePath("../FallLeftState")
fall_right_state = NodePath(".")
[node name="LookAroundState" parent="PlayerStateMachine" unique_id=946166563 node_paths=PackedStringArray("player", "idle_state", "walk_left_state", "walk_right_state", "dead_state", "jump_state", "jump_left_state", "jump_right_state", "fall_state", "fall_left_state", "fall_right_state") instance=ExtResource("5_65114")]
script = ExtResource("7_ybe51")
player = NodePath("../..")
idle_state = NodePath("../IdleState")
walk_left_state = NodePath("../WalkLeftState")
walk_right_state = NodePath("../WalkRightState")
dead_state = NodePath("../DeadState")
jump_state = NodePath("../JumpState")
jump_left_state = NodePath("../JumpLeftState")
jump_right_state = NodePath("../JumpRightState")
fall_state = NodePath("../FallState")
fall_left_state = NodePath("../FallLeftState")
fall_right_state = NodePath("../FallRightState")
[connection signal="switched" from="CollisionSwitcher" to="." method="_on_collision_switched"]
[connection signal="timeout" from="SwitchBufferTimer" to="." method="_on_switch_buffer_timer_timeout"]