diff --git a/project.godot b/project.godot index fd4110b3..05a9202d 100644 --- a/project.godot +++ b/project.godot @@ -11,7 +11,7 @@ config_version=5 [application] config/name="GameJamDungeon" -run/main_scene="uid://d1gjaijijd5ot" +run/main_scene="uid://bc1sp6xwe0j65" run/print_header=false config/features=PackedStringArray("4.4", "C#", "GL Compatibility") boot_splash/show_image=false diff --git a/src/enemy/ChintheModelView.cs b/src/enemy/ChintheModelView.cs new file mode 100644 index 00000000..9daeef90 --- /dev/null +++ b/src/enemy/ChintheModelView.cs @@ -0,0 +1,145 @@ +using Chickensoft.AutoInject; +using Chickensoft.Introspection; +using Godot; + +namespace GameJamDungeon; +[Meta(typeof(IAutoNode))] +public partial class ChintheModelView : EnemyModelView2D +{ + private const string INACTIVE_FRONT = "inactive_front"; + private const string INACTIVE_LEFT = "inactive_left"; + private const string INACTIVE_BACK = "inactive_back"; + + private const string ACTIVATE_FRONT = "activate_front"; + private const string ACTIVATE_LEFT = "activate_left"; + private const string ACTIVATE_BACK = "activate_back"; + + public const string TELEPORT = "teleport"; + + private const string PRIMARY_ATTACK = "primary_attack"; + private const string SECONDARY_ATTACK = "secondary_attack"; + private const string PRIMARY_SKILL = "primary_skill"; + private const string IDLE_FORWARD = "idle_front"; + private const string IDLE_LEFT = "idle_left"; + private const string IDLE_BACK = "idle_back"; + private const string IDLE_FORWARD_WALK = "idle_front_walk"; + private const string IDLE_LEFT_WALK = "idle_left_walk"; + private const string IDLE_BACK_WALK = "idle_back_walk"; + private const string PARAMETERS_PLAYBACK = "parameters/playback"; + + public override void _Notification(int what) => this.Notify(what); + + [Export] public bool CanMove = false; + + private bool _activated = false; + + public void OnReady() + { + AnimationTree.AnimationFinished += AnimationTree_AnimationFinished1; + } + + private void AnimationTree_AnimationFinished1(StringName animName) + { + if (animName == IDLE_FORWARD_WALK) + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(IDLE_FORWARD); + if (animName == IDLE_LEFT_WALK) + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(IDLE_LEFT); + if (animName == IDLE_BACK_WALK) + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(IDLE_BACK); + } + + public void PlayTeleportAnimation() + { + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(TELEPORT); + } + + public void PlayActivateFrontAnimation() + { + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(ACTIVATE_FRONT); + _activated = true; + } + + public void PlayActivateLeftAnimation() + { + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(ACTIVATE_LEFT); + _activated = true; + } + + public void PlayActivateBackAnimation() + { + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(ACTIVATE_BACK); + _activated = true; + } + + public override void RotateModel( + Basis enemyBasis, + Vector3 cameraDirection, + float rotateUpperThreshold, + float rotateLowerThreshold, + bool isWalking) + { + var enemyForwardDirection = enemyBasis.Z; + var enemyLeftDirection = enemyBasis.X; + + var leftDotProduct = enemyLeftDirection.Dot(cameraDirection); + var forwardDotProduct = enemyForwardDirection.Dot(cameraDirection); + + // Check if forward facing. If the dot product is -1, the enemy is facing the camera. + if (forwardDotProduct < -rotateUpperThreshold) + { + if (!_activated) + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(INACTIVE_FRONT); + else if (isWalking) + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(IDLE_FORWARD_WALK); + else + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(IDLE_FORWARD); + } + // Check if backward facing. If the dot product is 1, the enemy is facing the same direction as the camera. + else if (forwardDotProduct > rotateUpperThreshold) + { + if (!_activated) + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(INACTIVE_BACK); + else if (isWalking) + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(IDLE_BACK_WALK); + else + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(IDLE_BACK); + } + else + { + // If the dot product of the perpendicular direction is positive (up to 1), the enemy is facing to the left (since it's mirrored). + AnimatedSprite.FlipH = leftDotProduct > 0; + // Check if side facing. If the dot product is close to zero in the positive or negative direction, its close to the threshold for turning. + if (Mathf.Abs(forwardDotProduct) < rotateLowerThreshold) + { + if (!_activated) + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(INACTIVE_LEFT); + else if (isWalking) + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(IDLE_LEFT_WALK); + else + AnimationTree.Get(PARAMETERS_PLAYBACK).As().Travel(IDLE_LEFT); + } + } + } + + private void LoadShader(string shaderPath) + { + var shader = GD.Load(shaderPath); + AnimatedSprite.Material = new ShaderMaterial(); + var shaderMaterial = (ShaderMaterial)AnimatedSprite.Material; + shaderMaterial.Shader = shader; + } + + private void AnimationTree_AnimationFinished(StringName animName) + { + if (animName == PRIMARY_ATTACK || animName == SECONDARY_ATTACK || animName == PRIMARY_SKILL) + { + AnimationTree.Get("parameters/playback").As().Travel(IDLE_FORWARD); + } + } + + private void SetShaderValue(float shaderValue) + { + var shaderMaterial = (ShaderMaterial)AnimatedSprite.Material; + shaderMaterial.SetShaderParameter("progress", shaderValue); + } +} diff --git a/src/enemy/ChintheModelView.cs.uid b/src/enemy/ChintheModelView.cs.uid new file mode 100644 index 00000000..ac02262e --- /dev/null +++ b/src/enemy/ChintheModelView.cs.uid @@ -0,0 +1 @@ +uid://tcupay5n2quq diff --git a/src/enemy/EnemyModelView2D.cs b/src/enemy/EnemyModelView2D.cs index 07877c9c..3ab3cef3 100644 --- a/src/enemy/EnemyModelView2D.cs +++ b/src/enemy/EnemyModelView2D.cs @@ -67,7 +67,7 @@ public partial class EnemyModelView2D : Node3D, IEnemyModelView public void RotateModel(Basis enemyBasis, Vector3 cameraDirection, bool isWalking) => RotateModel(enemyBasis, cameraDirection, 0.55f, 0.45f, isWalking); - public void RotateModel( + public virtual void RotateModel( Basis enemyBasis, Vector3 cameraDirection, float rotateUpperThreshold, diff --git a/src/enemy/INavigationAgentClient.cs b/src/enemy/INavigationAgentClient.cs index 02f58246..56263918 100644 --- a/src/enemy/INavigationAgentClient.cs +++ b/src/enemy/INavigationAgentClient.cs @@ -4,7 +4,7 @@ namespace GameJamDungeon; public interface INavigationAgentClient { - public void CalculateVelocity(Vector3 currentPosition); + public void CalculateVelocity(Vector3 currentPosition, bool canMove); public void SetTarget(Vector3 target); diff --git a/src/enemy/NavigationAgentClient.cs b/src/enemy/NavigationAgentClient.cs index d69e9a90..08a06692 100644 --- a/src/enemy/NavigationAgentClient.cs +++ b/src/enemy/NavigationAgentClient.cs @@ -18,6 +18,7 @@ public partial class NavigationAgentClient : Node3D, INavigationAgentClient private Vector3 _currentTarget = Vector3.Zero; private Timer _thinkTimer; + private bool _canMove = false; public void Setup() { @@ -40,12 +41,16 @@ public partial class NavigationAgentClient : Node3D, INavigationAgentClient private void NavAgent_VelocityComputed(Vector3 safeVelocity) { + if (!_canMove) + return; + var enemy = GetParent() as IEnemy; enemy.Move(safeVelocity); } - public void CalculateVelocity(Vector3 currentPosition) + public void CalculateVelocity(Vector3 currentPosition, bool canMove) { + _canMove = canMove; var nextPathPosition = NavAgent.GetNextPathPosition(); var newVelocity = currentPosition.DirectionTo(nextPathPosition) * 2f; diff --git a/src/enemy/enemy_types/01. sproingy/Sproingy.cs b/src/enemy/enemy_types/01. sproingy/Sproingy.cs index abcb7281..c7c3e8b3 100644 --- a/src/enemy/enemy_types/01. sproingy/Sproingy.cs +++ b/src/enemy/enemy_types/01. sproingy/Sproingy.cs @@ -27,6 +27,9 @@ public partial class Sproingy : Enemy, IHasPrimaryAttack, ICanPatrol { _enemyLogic.Input(new EnemyLogic.Input.PhysicsTick(delta)); + if (_enemyLogic.Value is not EnemyLogic.State.Activated) + return; + if (_enemyLogic.Value is EnemyLogic.State.FollowPlayer && GlobalPosition.DistanceTo(_player.CurrentPosition) < 3.5f) _enemyLogic.Input(new EnemyLogic.Input.StartAttacking()); if (_enemyLogic.Value is EnemyLogic.State.FollowPlayer && GlobalPosition.DistanceTo(_player.CurrentPosition) > 30f) @@ -34,7 +37,7 @@ public partial class Sproingy : Enemy, IHasPrimaryAttack, ICanPatrol if (_enemyLogic.Value is EnemyLogic.State.Attacking && GlobalPosition.DistanceTo(_player.CurrentPosition) > 5f) _enemyLogic.Input(new EnemyLogic.Input.Alerted()); - _navigationAgentClient.CalculateVelocity(GlobalPosition); + _navigationAgentClient.CalculateVelocity(GlobalPosition, true); base._PhysicsProcess(delta); } diff --git a/src/enemy/enemy_types/02. michael/Michael.cs b/src/enemy/enemy_types/02. michael/Michael.cs index d53a6d92..c4aac820 100644 --- a/src/enemy/enemy_types/02. michael/Michael.cs +++ b/src/enemy/enemy_types/02. michael/Michael.cs @@ -32,7 +32,7 @@ public partial class Michael : Enemy, IHasPrimaryAttack, ICanPatrol if (_enemyLogic.Value is EnemyLogic.State.Attacking && GlobalPosition.DistanceTo(_player.CurrentPosition) > 3f) _enemyLogic.Input(new EnemyLogic.Input.Alerted()); - _navigationAgentClient.CalculateVelocity(GlobalPosition); + _navigationAgentClient.CalculateVelocity(GlobalPosition, true); base._PhysicsProcess(delta); } diff --git a/src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn b/src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn index 4d815850..82f9516f 100644 --- a/src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn +++ b/src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn @@ -1,6 +1,7 @@ -[gd_scene load_steps=229 format=3 uid="uid://byd7cwxq1be6f"] +[gd_scene load_steps=272 format=3 uid="uid://byd7cwxq1be6f"] -[ext_resource type="Script" uid="uid://cvr1qimxpignl" path="res://src/enemy/EnemyModelView2D.cs" id="1_js74g"] +[ext_resource type="Script" uid="uid://tcupay5n2quq" path="res://src/enemy/ChintheModelView.cs" id="1_ls38s"] +[ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="2_hr7xb"] [ext_resource type="Texture2D" uid="uid://8qj6se762l6e" path="res://src/enemy/enemy_types/07. chinthe/animations/ACTIVATE-BACK/ACTIVATE-BACK_page_0001.png" id="3_fn0g1"] [ext_resource type="Texture2D" uid="uid://bicx2m6q0vqdw" path="res://src/enemy/enemy_types/07. chinthe/animations/HOP FRONT/HOP-FRONT_page_0001.png" id="3_kc1ey"] [ext_resource type="Texture2D" uid="uid://u2xjqc5ksrms" path="res://src/enemy/enemy_types/07. chinthe/animations/HOP BACK/HOP-BACK_page_0001.png" id="3_wc61w"] @@ -161,6 +162,12 @@ [ext_resource type="Texture2D" uid="uid://xp31l3govdc6" path="res://src/enemy/enemy_types/07. chinthe/animations/TELEPORT/TELEPORT_page_0010.png" id="159_mmg6v"] [ext_resource type="Texture2D" uid="uid://cdv6qy3hdbqnb" path="res://src/enemy/enemy_types/07. chinthe/animations/TELEPORT/TELEPORT_page_0011.png" id="160_ugn17"] +[sub_resource type="Resource" id="Resource_dlf6r"] +script = ExtResource("2_hr7xb") +Name = "" +Description = "" +metadata/_custom_type_script = "uid://dlsgyx4i1jmp3" + [sub_resource type="ViewportTexture" id="ViewportTexture_h1kaf"] viewport_path = NodePath("Sprite3D/SubViewportContainer/SubViewport") @@ -237,6 +244,14 @@ animations = [{ }, { "frames": [{ "duration": 1.0, +"texture": ExtResource("116_8ver2") +}], +"loop": true, +"name": &"idle_back", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, "texture": ExtResource("3_wc61w") }, { "duration": 1.0, @@ -483,6 +498,14 @@ animations = [{ }, { "frames": [{ "duration": 1.0, +"texture": ExtResource("118_f7hsl") +}], +"loop": true, +"name": &"idle_left", +"speed": 5.0 +}, { +"frames": [{ +"duration": 1.0, "texture": ExtResource("39_bqkpb") }, { "duration": 1.0, @@ -766,6 +789,18 @@ tracks/4/keys = { "update": 1, "values": [true] } +tracks/5/type = "value" +tracks/5/imported = false +tracks/5/enabled = true +tracks/5/path = NodePath(".:CanMove") +tracks/5/interp = 1 +tracks/5/loop_wrap = true +tracks/5/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [false] +} [sub_resource type="Animation" id="Animation_1jyvf"] resource_name = "activate_back" @@ -854,10 +889,38 @@ tracks/1/keys = { "values": [0, 1, 2, 3, 4, 5] } +[sub_resource type="Animation" id="Animation_ls38s"] +resource_name = "idle_back" +length = 0.0833417 +step = 0.0833333 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:animation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"idle_back"] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:frame") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0] +} + [sub_resource type="Animation" id="Animation_wjklo"] resource_name = "idle_back_walk" length = 1.41668 -loop_mode = 1 step = 0.0833333 tracks/0/type = "value" tracks/0/imported = false @@ -895,6 +958,18 @@ tracks/2/keys = { "update": 0, "values": [Vector3(0, 0, 0), Vector3(0, 1.5, 0), Vector3(0, 0, 0)] } +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath(".:CanMove") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0, 0.167921, 0.417721), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 1, +"values": [false, true, false] +} [sub_resource type="Animation" id="Animation_fn0g1"] resource_name = "idle_front" @@ -929,7 +1004,6 @@ tracks/1/keys = { [sub_resource type="Animation" id="Animation_kc1ey"] resource_name = "idle_front_walk" length = 1.41668 -loop_mode = 1 step = 0.0833333 tracks/0/type = "value" tracks/0/imported = false @@ -967,11 +1041,22 @@ tracks/2/keys = { "update": 0, "values": [Vector3(0, 0, 0), Vector3(0, 1.5, 0), Vector3(0, 0, 0)] } +tracks/3/type = "value" +tracks/3/imported = false +tracks/3/enabled = true +tracks/3/path = NodePath(".:CanMove") +tracks/3/interp = 1 +tracks/3/loop_wrap = true +tracks/3/keys = { +"times": PackedFloat32Array(0, 0.166533, 0.417721), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 1, +"values": [false, true, false] +} [sub_resource type="Animation" id="Animation_sodds"] resource_name = "idle_left_walk" length = 1.41668 -loop_mode = 1 step = 0.0833333 tracks/0/type = "value" tracks/0/imported = false @@ -1021,6 +1106,18 @@ tracks/3/keys = { "update": 1, "values": [true] } +tracks/4/type = "value" +tracks/4/imported = false +tracks/4/enabled = true +tracks/4/path = NodePath(".:CanMove") +tracks/4/interp = 1 +tracks/4/loop_wrap = true +tracks/4/keys = { +"times": PackedFloat32Array(0, 0.167921, 0.417721), +"transitions": PackedFloat32Array(1, 1, 1), +"update": 1, +"values": [false, true, false] +} [sub_resource type="Animation" id="Animation_wn63w"] resource_name = "inactive_back" @@ -1179,15 +1276,47 @@ tracks/1/keys = { "values": [0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10] } +[sub_resource type="Animation" id="Animation_hr7xb"] +resource_name = "idle_left" +length = 0.0833417 +loop_mode = 1 +step = 0.0833333 +tracks/0/type = "value" +tracks/0/imported = false +tracks/0/enabled = true +tracks/0/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:animation") +tracks/0/interp = 1 +tracks/0/loop_wrap = true +tracks/0/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [&"idle_left"] +} +tracks/1/type = "value" +tracks/1/imported = false +tracks/1/enabled = true +tracks/1/path = NodePath("Sprite3D/SubViewportContainer/SubViewport/AnimatedSprite:frame") +tracks/1/interp = 1 +tracks/1/loop_wrap = true +tracks/1/keys = { +"times": PackedFloat32Array(0), +"transitions": PackedFloat32Array(1), +"update": 1, +"values": [0] +} + [sub_resource type="AnimationLibrary" id="AnimationLibrary_46p8q"] _data = { &"RESET": SubResource("Animation_46p8q"), &"activate_back": SubResource("Animation_1jyvf"), &"activate_front": SubResource("Animation_7d8af"), &"activate_left": SubResource("Animation_kek18"), +&"idle_back": SubResource("Animation_ls38s"), &"idle_back_walk": SubResource("Animation_wjklo"), &"idle_front": SubResource("Animation_fn0g1"), &"idle_front_walk": SubResource("Animation_kc1ey"), +&"idle_left": SubResource("Animation_hr7xb"), &"idle_left_walk": SubResource("Animation_sodds"), &"inactive_back": SubResource("Animation_wn63w"), &"inactive_front": SubResource("Animation_cd8wr"), @@ -1196,166 +1325,280 @@ _data = { &"teleport": SubResource("Animation_6avl1") } -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_53wuj"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ir1kj"] +animation = &"activate_back" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_e7bnp"] +animation = &"activate_front" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_tqing"] +animation = &"activate_left" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_68ypv"] animation = &"idle_back" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_o0tmb"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_87nns"] animation = &"idle_back_walk" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_d5bmw"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_2u7vh"] animation = &"idle_front" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_a6s5c"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_nkg7c"] animation = &"idle_front_walk" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_fpvxl"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8ghg4"] animation = &"idle_left" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_dvj10"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_a2ldk"] animation = &"idle_left_walk" -[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_erbrx"] +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_ls38s"] +animation = &"inactive_back" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_hr7xb"] +animation = &"inactive_front" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_dlf6r"] +animation = &"inactive_left" + +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_8pgfe"] animation = &"primary_attack" -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_3xv6a"] -switch_mode = 1 +[sub_resource type="AnimationNodeAnimation" id="AnimationNodeAnimation_p31d0"] +animation = &"teleport" -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_0h1op"] -switch_mode = 1 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_361b7"] -switch_mode = 1 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_wftla"] -switch_mode = 1 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_gqqkl"] -switch_mode = 1 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5cj36"] -switch_mode = 1 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4t05h"] - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8hgxu"] -switch_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_fq2yw"] -switch_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_yqm0k"] -switch_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_bmy1k"] -switch_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_mxl7w"] -switch_mode = 2 - -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_qq0ru"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ir1kj"] advance_mode = 2 -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_c54uj"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_e7bnp"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_qmo72"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_tqing"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_jyt1n"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2u7vh"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5un2v"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_68ypv"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2x3nl"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8ghg4"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6a5nw"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_87nns"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_0jqty"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_nkg7c"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_yjcrh"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_a2ldk"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2ybyh"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_8pgfe"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_n454k"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_p31d0"] +switch_mode = 2 +advance_mode = 2 -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_vrcjv"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5ho7k"] +switch_mode = 2 +advance_mode = 2 -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_h1yxw"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_l2luo"] +switch_mode = 2 +advance_mode = 2 -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_kg6hd"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ls38s"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_25i3y"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_hr7xb"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5g722"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_dlf6r"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_a6y4x"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_hpj0d"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_7y7m4"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xk3q3"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ldcvv"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_6dblq"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_aalmk"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_twmln"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2le5t"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_popn6"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4nmgu"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_hljis"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_mw5r6"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_rpl28"] +switch_mode = 2 -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_jbtxi"] -switch_mode = 1 +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5yoq7"] +switch_mode = 2 -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_mjxlk"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xcuat"] +switch_mode = 2 +advance_mode = 2 -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_al2xs"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_lck5b"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_afa0q"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_h2vv3"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_irq32"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_tfidx"] -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2khaq"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_i1mv4"] +switch_mode = 2 -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_k7x0x"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_v4rqj"] +switch_mode = 2 -[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_noc6c"] +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_pek67"] +switch_mode = 2 +advance_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xdrg8"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_2cdpv"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_eumr2"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_5co87"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_lgioh"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_wrqfd"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xrsnf"] +switch_mode = 2 +advance_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_a0mk1"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_26dsn"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_awhna"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_toru2"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_d8u8a"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_1ojs1"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_54c37"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_t3twv"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_qavl1"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_mm8gk"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ebm3m"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_7wupp"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_x6dpr"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_ieljd"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_jwd0p"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_wmnrx"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xi3ou"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_jfvyv"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_grym3"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_nqvtf"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_n4xgs"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_aalbj"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_wq8jy"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_gk0af"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_yu7s6"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_xkf77"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_yavlh"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_cjn2x"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_irhk2"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_bmmnl"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_crhi5"] +switch_mode = 2 + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_nqkvj"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_dv4bt"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_r1qxd"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_kxpwt"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_4ruei"] + +[sub_resource type="AnimationNodeStateMachineTransition" id="AnimationNodeStateMachineTransition_y8juo"] [sub_resource type="AnimationNodeStateMachine" id="AnimationNodeStateMachine_d5bmw"] -states/End/position = Vector2(1466, 104) +states/End/position = Vector2(1699, 225.181) states/Start/position = Vector2(92, 119) -states/idle_back/node = SubResource("AnimationNodeAnimation_53wuj") -states/idle_back/position = Vector2(180.116, -34) -states/idle_back_walk/node = SubResource("AnimationNodeAnimation_o0tmb") -states/idle_back_walk/position = Vector2(676, -8.0526) -states/idle_front/node = SubResource("AnimationNodeAnimation_d5bmw") -states/idle_front/position = Vector2(403.116, 43.9474) -states/idle_front_walk/node = SubResource("AnimationNodeAnimation_a6s5c") -states/idle_front_walk/position = Vector2(644, -100) -states/idle_left/node = SubResource("AnimationNodeAnimation_fpvxl") -states/idle_left/position = Vector2(367.116, 119) -states/idle_left_walk/node = SubResource("AnimationNodeAnimation_dvj10") -states/idle_left_walk/position = Vector2(438, 242.947) -states/primary_attack/node = SubResource("AnimationNodeAnimation_erbrx") -states/primary_attack/position = Vector2(1024, 92.9474) -transitions = ["idle_front_walk", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_3xv6a"), "idle_left_walk", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_0h1op"), "idle_front_walk", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_361b7"), "idle_back_walk", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_wftla"), "idle_back_walk", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_gqqkl"), "idle_left_walk", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_5cj36"), "idle_front_walk", "primary_attack", SubResource("AnimationNodeStateMachineTransition_4t05h"), "primary_attack", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_8hgxu"), "primary_attack", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_fq2yw"), "primary_attack", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_yqm0k"), "idle_back_walk", "primary_attack", SubResource("AnimationNodeStateMachineTransition_bmy1k"), "idle_left_walk", "primary_attack", SubResource("AnimationNodeStateMachineTransition_mxl7w"), "Start", "idle_front", SubResource("AnimationNodeStateMachineTransition_qq0ru"), "idle_front", "idle_back", SubResource("AnimationNodeStateMachineTransition_c54uj"), "idle_back", "idle_left", SubResource("AnimationNodeStateMachineTransition_qmo72"), "idle_left", "idle_front", SubResource("AnimationNodeStateMachineTransition_jyt1n"), "idle_left", "idle_back", SubResource("AnimationNodeStateMachineTransition_5un2v"), "idle_back", "idle_front", SubResource("AnimationNodeStateMachineTransition_2x3nl"), "idle_front", "idle_left", SubResource("AnimationNodeStateMachineTransition_6a5nw"), "idle_back", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_0jqty"), "idle_front", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_yjcrh"), "idle_back", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_2ybyh"), "idle_left", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_n454k"), "idle_back_walk", "idle_left", SubResource("AnimationNodeStateMachineTransition_vrcjv"), "idle_back_walk", "idle_front", SubResource("AnimationNodeStateMachineTransition_h1yxw"), "idle_back_walk", "idle_back", SubResource("AnimationNodeStateMachineTransition_kg6hd"), "idle_back", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_25i3y"), "idle_left", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_5g722"), "idle_front", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_a6y4x"), "idle_left_walk", "idle_front", SubResource("AnimationNodeStateMachineTransition_7y7m4"), "idle_left_walk", "idle_left", SubResource("AnimationNodeStateMachineTransition_ldcvv"), "idle_left_walk", "idle_back", SubResource("AnimationNodeStateMachineTransition_aalmk"), "idle_front_walk", "idle_back", SubResource("AnimationNodeStateMachineTransition_2le5t"), "idle_front_walk", "idle_front", SubResource("AnimationNodeStateMachineTransition_4nmgu"), "idle_front_walk", "idle_left", SubResource("AnimationNodeStateMachineTransition_mw5r6"), "idle_front", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_jbtxi"), "idle_left", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_mjxlk"), "idle_back", "primary_attack", SubResource("AnimationNodeStateMachineTransition_al2xs"), "primary_attack", "idle_back", SubResource("AnimationNodeStateMachineTransition_afa0q"), "idle_front", "primary_attack", SubResource("AnimationNodeStateMachineTransition_irq32"), "primary_attack", "idle_front", SubResource("AnimationNodeStateMachineTransition_2khaq"), "idle_left", "primary_attack", SubResource("AnimationNodeStateMachineTransition_k7x0x"), "primary_attack", "idle_left", SubResource("AnimationNodeStateMachineTransition_noc6c")] -graph_offset = Vector2(46.1163, -73.3694) +states/activate_back/node = SubResource("AnimationNodeAnimation_ir1kj") +states/activate_back/position = Vector2(801.116, 93.1813) +states/activate_front/node = SubResource("AnimationNodeAnimation_e7bnp") +states/activate_front/position = Vector2(806.116, 139.181) +states/activate_left/node = SubResource("AnimationNodeAnimation_tqing") +states/activate_left/position = Vector2(801.116, 187.181) +states/idle_back/node = SubResource("AnimationNodeAnimation_68ypv") +states/idle_back/position = Vector2(1169.12, 60.1813) +states/idle_back_walk/node = SubResource("AnimationNodeAnimation_87nns") +states/idle_back_walk/position = Vector2(1508.12, 72.1813) +states/idle_front/node = SubResource("AnimationNodeAnimation_2u7vh") +states/idle_front/position = Vector2(763.116, 325.181) +states/idle_front_walk/node = SubResource("AnimationNodeAnimation_nkg7c") +states/idle_front_walk/position = Vector2(1660.12, 647.897) +states/idle_left/node = SubResource("AnimationNodeAnimation_8ghg4") +states/idle_left/position = Vector2(1169.12, 231.181) +states/idle_left_walk/node = SubResource("AnimationNodeAnimation_a2ldk") +states/idle_left_walk/position = Vector2(1245.12, 596.897) +states/inactive_back/node = SubResource("AnimationNodeAnimation_ls38s") +states/inactive_back/position = Vector2(428.116, 60.1813) +states/inactive_front/node = SubResource("AnimationNodeAnimation_hr7xb") +states/inactive_front/position = Vector2(272.116, 119) +states/inactive_left/node = SubResource("AnimationNodeAnimation_dlf6r") +states/inactive_left/position = Vector2(406.116, 158.181) +states/primary_attack/node = SubResource("AnimationNodeAnimation_8pgfe") +states/primary_attack/position = Vector2(915.116, 634.033) +states/teleport/node = SubResource("AnimationNodeAnimation_p31d0") +states/teleport/position = Vector2(1675.12, 110.033) +transitions = ["Start", "inactive_front", SubResource("AnimationNodeStateMachineTransition_ir1kj"), "inactive_front", "inactive_back", SubResource("AnimationNodeStateMachineTransition_e7bnp"), "inactive_back", "inactive_front", SubResource("AnimationNodeStateMachineTransition_tqing"), "inactive_front", "inactive_left", SubResource("AnimationNodeStateMachineTransition_2u7vh"), "inactive_left", "inactive_front", SubResource("AnimationNodeStateMachineTransition_68ypv"), "inactive_left", "inactive_back", SubResource("AnimationNodeStateMachineTransition_8ghg4"), "inactive_back", "inactive_left", SubResource("AnimationNodeStateMachineTransition_87nns"), "inactive_front", "activate_front", SubResource("AnimationNodeStateMachineTransition_nkg7c"), "inactive_back", "activate_back", SubResource("AnimationNodeStateMachineTransition_a2ldk"), "inactive_left", "activate_left", SubResource("AnimationNodeStateMachineTransition_8pgfe"), "activate_front", "idle_front", SubResource("AnimationNodeStateMachineTransition_p31d0"), "activate_back", "idle_back", SubResource("AnimationNodeStateMachineTransition_5ho7k"), "activate_left", "idle_left", SubResource("AnimationNodeStateMachineTransition_l2luo"), "idle_back", "idle_front", SubResource("AnimationNodeStateMachineTransition_ls38s"), "idle_front", "idle_back", SubResource("AnimationNodeStateMachineTransition_hr7xb"), "idle_front", "idle_left", SubResource("AnimationNodeStateMachineTransition_dlf6r"), "idle_left", "idle_front", SubResource("AnimationNodeStateMachineTransition_hpj0d"), "idle_back", "idle_left", SubResource("AnimationNodeStateMachineTransition_xk3q3"), "idle_left", "idle_back", SubResource("AnimationNodeStateMachineTransition_6dblq"), "idle_front", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_twmln"), "idle_back", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_popn6"), "idle_left", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_hljis"), "idle_front_walk", "idle_back", SubResource("AnimationNodeStateMachineTransition_rpl28"), "idle_front_walk", "idle_left", SubResource("AnimationNodeStateMachineTransition_5yoq7"), "idle_front_walk", "idle_front", SubResource("AnimationNodeStateMachineTransition_xcuat"), "idle_back", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_lck5b"), "idle_front", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_h2vv3"), "idle_left", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_tfidx"), "idle_front_walk", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_i1mv4"), "idle_back_walk", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_v4rqj"), "idle_back_walk", "idle_back", SubResource("AnimationNodeStateMachineTransition_pek67"), "idle_back_walk", "idle_front", SubResource("AnimationNodeStateMachineTransition_xdrg8"), "idle_back_walk", "idle_left", SubResource("AnimationNodeStateMachineTransition_2cdpv"), "idle_front_walk", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_eumr2"), "idle_left_walk", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_5co87"), "idle_left_walk", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_lgioh"), "idle_back_walk", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_wrqfd"), "idle_left_walk", "idle_left", SubResource("AnimationNodeStateMachineTransition_xrsnf"), "idle_left_walk", "idle_back", SubResource("AnimationNodeStateMachineTransition_a0mk1"), "idle_left_walk", "idle_front", SubResource("AnimationNodeStateMachineTransition_26dsn"), "idle_front", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_awhna"), "idle_back", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_toru2"), "idle_left", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_d8u8a"), "idle_front", "primary_attack", SubResource("AnimationNodeStateMachineTransition_1ojs1"), "idle_back", "primary_attack", SubResource("AnimationNodeStateMachineTransition_54c37"), "idle_left", "primary_attack", SubResource("AnimationNodeStateMachineTransition_t3twv"), "idle_back_walk", "primary_attack", SubResource("AnimationNodeStateMachineTransition_qavl1"), "idle_front_walk", "primary_attack", SubResource("AnimationNodeStateMachineTransition_mm8gk"), "idle_left_walk", "primary_attack", SubResource("AnimationNodeStateMachineTransition_ebm3m"), "primary_attack", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_7wupp"), "primary_attack", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_x6dpr"), "primary_attack", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_ieljd"), "primary_attack", "idle_back", SubResource("AnimationNodeStateMachineTransition_jwd0p"), "primary_attack", "idle_front", SubResource("AnimationNodeStateMachineTransition_wmnrx"), "primary_attack", "idle_left", SubResource("AnimationNodeStateMachineTransition_xi3ou"), "idle_front", "teleport", SubResource("AnimationNodeStateMachineTransition_jfvyv"), "idle_back", "teleport", SubResource("AnimationNodeStateMachineTransition_grym3"), "idle_left", "teleport", SubResource("AnimationNodeStateMachineTransition_nqvtf"), "idle_back_walk", "teleport", SubResource("AnimationNodeStateMachineTransition_n4xgs"), "idle_front_walk", "teleport", SubResource("AnimationNodeStateMachineTransition_aalbj"), "idle_left_walk", "teleport", SubResource("AnimationNodeStateMachineTransition_wq8jy"), "teleport", "idle_back_walk", SubResource("AnimationNodeStateMachineTransition_gk0af"), "teleport", "idle_back", SubResource("AnimationNodeStateMachineTransition_yu7s6"), "teleport", "idle_front_walk", SubResource("AnimationNodeStateMachineTransition_xkf77"), "teleport", "idle_left_walk", SubResource("AnimationNodeStateMachineTransition_yavlh"), "teleport", "idle_left", SubResource("AnimationNodeStateMachineTransition_cjn2x"), "teleport", "idle_front", SubResource("AnimationNodeStateMachineTransition_irhk2"), "teleport", "primary_attack", SubResource("AnimationNodeStateMachineTransition_bmmnl"), "primary_attack", "teleport", SubResource("AnimationNodeStateMachineTransition_crhi5"), "inactive_back", "activate_front", SubResource("AnimationNodeStateMachineTransition_nqkvj"), "inactive_back", "activate_left", SubResource("AnimationNodeStateMachineTransition_dv4bt"), "inactive_left", "activate_front", SubResource("AnimationNodeStateMachineTransition_r1qxd"), "inactive_left", "activate_back", SubResource("AnimationNodeStateMachineTransition_kxpwt"), "inactive_front", "activate_back", SubResource("AnimationNodeStateMachineTransition_4ruei"), "inactive_front", "activate_left", SubResource("AnimationNodeStateMachineTransition_y8juo")] +graph_offset = Vector2(253.26, 9.5393) [node name="EnemyModelView" type="Node3D"] -script = ExtResource("1_js74g") +script = ExtResource("1_ls38s") +EnemyLoreInfo = SubResource("Resource_dlf6r") [node name="Sprite3D" type="Sprite3D" parent="."] transform = Transform3D(1.5, 0, 0, 0, 1.5, 0, 0, 0, 1.5, 0, 0, 0) @@ -1403,4 +1646,6 @@ libraries = { [node name="AnimationTree" type="AnimationTree" parent="."] unique_name_in_owner = true +root_node = NodePath("%AnimationTree/..") tree_root = SubResource("AnimationNodeStateMachine_d5bmw") +anim_player = NodePath("../AnimationPlayer") diff --git a/src/enemy/enemy_types/07. chinthe/Chinthe.cs b/src/enemy/enemy_types/07. chinthe/Chinthe.cs index 648a3298..782aac7b 100644 --- a/src/enemy/enemy_types/07. chinthe/Chinthe.cs +++ b/src/enemy/enemy_types/07. chinthe/Chinthe.cs @@ -1,46 +1,87 @@ using Chickensoft.AutoInject; using Chickensoft.Introspection; +using GameJamDungeon.src.enemy; using Godot; namespace GameJamDungeon; [Meta(typeof(IAutoNode))] -public partial class Chinte : Enemy, IHasPrimaryAttack +public partial class Chinthe : Enemy, IHasPrimaryAttack, ICanPatrol { public override void _Notification(int what) => this.Notify(what); + private const string PARAMETERS_PLAYBACK = "parameters/playback"; + [Export] public ElementType PrimaryAttackElementalType { get; set; } = ElementType.None; [Export] public double PrimaryAttackElementalDamageBonus { get; set; } = 1.0; + [Node] private INavigationAgentClient _navigationAgentClient { get; set; } = default!; + + [Node] private ChintheModelView EnemyModelView { get; set; } = default!; + public void OnReady() { SetPhysicsProcess(true); - ((EnemyModelView2D)_enemyModelView).Hitbox.AreaEntered += Hitbox_AreaEntered; + EnemyModelView.Hitbox.AreaEntered += Hitbox_AreaEntered; } public void OnPhysicsProcess(double delta) { _enemyLogic.Input(new EnemyLogic.Input.PhysicsTick(delta)); + if (_enemyLogic.Value is not EnemyLogic.State.Activated) + return; + if (_enemyLogic.Value is EnemyLogic.State.FollowPlayer && GlobalPosition.DistanceTo(_player.CurrentPosition) < 2.5f) _enemyLogic.Input(new EnemyLogic.Input.StartAttacking()); if (_enemyLogic.Value is EnemyLogic.State.FollowPlayer && GlobalPosition.DistanceTo(_player.CurrentPosition) > 45f) _enemyLogic.Input(new EnemyLogic.Input.LostPlayer()); if (_enemyLogic.Value is EnemyLogic.State.Attacking && GlobalPosition.DistanceTo(_player.CurrentPosition) > 2.5f) _enemyLogic.Input(new EnemyLogic.Input.Alerted()); + + _navigationAgentClient.CalculateVelocity(GlobalPosition, EnemyModelView.CanMove); + + base._PhysicsProcess(delta); } public override void TakeAction() { PrimaryAttack(); } + public void PrimaryAttack() { _enemyModelView.PlayPrimaryAttackAnimation(); } + public override void SetTarget(Vector3 target) => _navigationAgentClient.SetTarget(target); + + public void Patrol() + { + var rng = new RandomNumberGenerator(); + rng.Randomize(); + var randomizedSpot = new Vector3(rng.RandfRange(-5.0f, 5.0f), 0, rng.RandfRange(-5.0f, 5.0f)); + _enemyLogic.Input(new EnemyLogic.Input.PatrolToRandomSpot(GlobalPosition + randomizedSpot)); + _enemyLogic.Input(new EnemyLogic.Input.StartPatrol()); + } + + public void Activate() + { + if (EnemyModelView.AnimationTree.Get(PARAMETERS_PLAYBACK).As().GetCurrentNode().ToString().Contains("front")) + EnemyModelView.PlayActivateFrontAnimation(); + if (EnemyModelView.AnimationTree.Get(PARAMETERS_PLAYBACK).As().GetCurrentNode().ToString().Contains("left")) + EnemyModelView.PlayActivateLeftAnimation(); + if (EnemyModelView.AnimationTree.Get(PARAMETERS_PLAYBACK).As().GetCurrentNode().ToString().Contains("back")) + EnemyModelView.PlayActivateBackAnimation(); + } + + public void Teleport() + { + EnemyModelView.PlayTeleportAnimation(); + } + private void Hitbox_AreaEntered(Area3D area) { var target = area.GetOwner(); diff --git a/src/enemy/enemy_types/07. chinthe/Chinthe.tscn b/src/enemy/enemy_types/07. chinthe/Chinthe.tscn index a5163dac..9f8f7272 100644 --- a/src/enemy/enemy_types/07. chinthe/Chinthe.tscn +++ b/src/enemy/enemy_types/07. chinthe/Chinthe.tscn @@ -1,8 +1,29 @@ -[gd_scene load_steps=6 format=3 uid="uid://c6tqt27ql8s35"] +[gd_scene load_steps=11 format=3 uid="uid://c6tqt27ql8s35"] [ext_resource type="Script" uid="uid://fwtjthix6awv" path="res://src/enemy/enemy_types/07. chinthe/Chinthe.cs" id="1_vw2ww"] +[ext_resource type="Script" uid="uid://dnkmr0eq1sij0" path="res://src/enemy/EnemyStatResource.cs" id="2_120m2"] +[ext_resource type="Script" uid="uid://dlsgyx4i1jmp3" path="res://src/enemy/EnemyLoreInfo.cs" id="3_567xa"] +[ext_resource type="PackedScene" uid="uid://pbnsngx5jvrh" path="res://src/enemy/NavigationAgentClient.tscn" id="3_d665t"] [ext_resource type="PackedScene" uid="uid://byd7cwxq1be6f" path="res://src/enemy/enemy_types/07. chinthe/ChinteModelView.tscn" id="3_ncr2e"] +[sub_resource type="Resource" id="Resource_d665t"] +script = ExtResource("2_120m2") +CurrentHP = 200.0 +MaximumHP = 200.0 +CurrentAttack = 10 +CurrentDefense = 10 +MaxAttack = 10 +MaxDefense = 10 +ExpFromDefeat = 100 +Luck = 0.05 +TelluricResistance = 0.0 +AeolicResistance = 0.0 +HydricResistance = 0.0 +IgneousResistance = 0.0 +FerrumResistance = 0.0 +DropsSoulGemChance = 0.75 +metadata/_custom_type_script = "uid://dnkmr0eq1sij0" + [sub_resource type="CapsuleShape3D" id="CapsuleShape3D_cwfph"] radius = 0.226425 height = 2.02807 @@ -11,6 +32,12 @@ height = 2.02807 height = 5.0 radius = 1.0 +[sub_resource type="Resource" id="Resource_120m2"] +script = ExtResource("3_567xa") +Name = "Chinthe" +Description = "pupy" +metadata/_custom_type_script = "uid://dlsgyx4i1jmp3" + [sub_resource type="SphereShape3D" id="SphereShape3D_8vcnq"] radius = 1.20703 @@ -20,21 +47,19 @@ collision_layer = 10 collision_mask = 11 axis_lock_linear_y = true axis_lock_angular_x = true +axis_lock_angular_z = true +motion_mode = 1 script = ExtResource("1_vw2ww") +_enemyStatResource = SubResource("Resource_d665t") + +[node name="NavigationAgentClient" parent="." instance=ExtResource("3_d665t")] +unique_name_in_owner = true [node name="CollisionShape" type="CollisionShape3D" parent="."] unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0) shape = SubResource("CapsuleShape3D_cwfph") -[node name="NavAgent" type="NavigationAgent3D" parent="."] -unique_name_in_owner = true -path_max_distance = 3.01 -simplify_path = true -avoidance_enabled = true -radius = 2.0 -debug_path_custom_color = Color(1, 0, 0, 1) - [node name="LineOfSight" type="Area3D" parent="."] unique_name_in_owner = true transform = Transform3D(-1, 0, -8.74228e-08, 0, 1, 0, 8.74228e-08, 0, -1, 0, 0, 0) @@ -61,6 +86,8 @@ target_position = Vector3(0, 0, -5) collision_mask = 3 [node name="EnemyModelView" parent="." instance=ExtResource("3_ncr2e")] +unique_name_in_owner = true +EnemyLoreInfo = SubResource("Resource_120m2") [node name="Collision" type="Area3D" parent="."] collision_layer = 2048 diff --git a/src/enemy/enemy_types/07. chinthe/ChintheTest.tscn b/src/enemy/enemy_types/07. chinthe/ChintheTest.tscn new file mode 100644 index 00000000..b1bee330 --- /dev/null +++ b/src/enemy/enemy_types/07. chinthe/ChintheTest.tscn @@ -0,0 +1,11 @@ +[gd_scene load_steps=3 format=3 uid="uid://byqhrq73p1y7v"] + +[ext_resource type="PackedScene" uid="uid://c6tqt27ql8s35" path="res://src/enemy/enemy_types/07. chinthe/Chinthe.tscn" id="1_un7uu"] +[ext_resource type="PackedScene" uid="uid://cfecvvav8kkp6" path="res://src/player/Player.tscn" id="2_w0g4y"] + +[node name="ChintheTest" type="Node3D"] + +[node name="Chinthe" parent="." instance=ExtResource("1_un7uu")] + +[node name="Player" parent="." instance=ExtResource("2_w0g4y")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, -1.12146, 4.44506) diff --git a/src/enemy/state/states/EnemyLogic.State.Activated.cs b/src/enemy/state/states/EnemyLogic.State.Activated.cs index c175ba18..f3bf7bcf 100644 --- a/src/enemy/state/states/EnemyLogic.State.Activated.cs +++ b/src/enemy/state/states/EnemyLogic.State.Activated.cs @@ -10,6 +10,9 @@ public partial class EnemyLogic [Meta, Id("enemy_logic_state_activated")] public partial record Activated : Alive { + public Activated() + { + } } } } \ No newline at end of file diff --git a/src/enemy/state/states/EnemyLogic.State.Alive.cs b/src/enemy/state/states/EnemyLogic.State.Alive.cs index 8bb50e32..0f82b5ab 100644 --- a/src/enemy/state/states/EnemyLogic.State.Alive.cs +++ b/src/enemy/state/states/EnemyLogic.State.Alive.cs @@ -36,6 +36,8 @@ public partial class EnemyLogic var enemy = Get(); if (enemy is IHasRangedAttack rangedAttacker) rangedAttacker.RangedAttack(); + if (enemy is Chinthe chinthe) + chinthe.Activate(); return To(); } } diff --git a/src/map/dungeon/floors/Floor01.tscn b/src/map/dungeon/floors/Floor01.tscn index b8b3f801..c6e74b9a 100644 --- a/src/map/dungeon/floors/Floor01.tscn +++ b/src/map/dungeon/floors/Floor01.tscn @@ -1,10 +1,12 @@ -[gd_scene load_steps=13 format=3 uid="uid://bc1sp6xwe0j65"] +[gd_scene load_steps=15 format=3 uid="uid://bc1sp6xwe0j65"] [ext_resource type="Script" uid="uid://dwt6302nsf4vq" path="res://src/map/dungeon/code/DungeonFloor.cs" id="1_0ecnn"] [ext_resource type="Script" uid="uid://b1x125h0tya2w" path="res://addons/SimpleDungeons/DungeonGenerator3D.gd" id="2_cxmwa"] [ext_resource type="PackedScene" uid="uid://dpec2lbt83dhe" path="res://src/map/dungeon/rooms/Set A/03. Antechamber A.tscn" id="3_gkkr3"] [ext_resource type="PackedScene" uid="uid://b82dx66mgs2d7" path="res://src/map/dungeon/rooms/Set A/08. Basin Room.tscn" id="8_5rblf"] [ext_resource type="PackedScene" uid="uid://cmvimr0pvsgqy" path="res://src/enemy/enemy_types/10. Eden Pillar/Eden Pillar.tscn" id="10_atq1f"] +[ext_resource type="PackedScene" uid="uid://cfecvvav8kkp6" path="res://src/player/Player.tscn" id="11_sdyti"] +[ext_resource type="PackedScene" uid="uid://c6tqt27ql8s35" path="res://src/enemy/enemy_types/07. chinthe/Chinthe.tscn" id="12_1l8yt"] [ext_resource type="PackedScene" uid="uid://dbvr8ewajja6a" path="res://src/enemy/EnemyDatabase.tscn" id="12_aw26s"] [ext_resource type="PackedScene" uid="uid://cihbmyo0ltq4m" path="res://src/map/dungeon/rooms/Set A/19. Floor Exit A.tscn" id="12_n02rw"] [ext_resource type="PackedScene" uid="uid://bksq62muhk3h5" path="res://src/enemy/enemy_types/01. sproingy/Sproingy.tscn" id="13_kwaga"] @@ -176,3 +178,13 @@ EnemyList = Array[PackedScene]([ExtResource("13_kwaga"), ExtResource("14_gkkr3") [node name="Eden Pillar" parent="." instance=ExtResource("10_atq1f")] transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, -29.7976, -1.33866, 30.3232) + +[node name="Player" parent="." instance=ExtResource("11_sdyti")] +unique_name_in_owner = true +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 2.07588, -1.71359, 12.7507) + +[node name="Chinthe" parent="." instance=ExtResource("12_1l8yt")] +transform = Transform3D(1, 0, 0, 0, 1, 0, 0, 0, 1, 8.2934, -0.81355, 21.6535) +PrimaryAttackElementalType = 0 +PrimaryAttackElementalDamageBonus = 1.0 +_movementSpeed = 2.0