Generic enemies

This commit is contained in:
Marco 2025-06-03 10:11:09 +02:00
commit d99c773641
55 changed files with 968 additions and 204 deletions

View file

@ -60,6 +60,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = []
metadata/_custom_type_script = "uid://dslyrfcej3g2n"
@ -138,6 +139,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = []
metadata/_custom_type_script = "uid://dslyrfcej3g2n"
@ -183,6 +185,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = []
metadata/_custom_type_script = "uid://dslyrfcej3g2n"

View file

@ -37,6 +37,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_cj86d")])
[sub_resource type="Resource" id="Resource_puvpt"]
@ -87,6 +88,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_pbgtt")])
[sub_resource type="Resource" id="Resource_44j24"]
@ -130,6 +132,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_cj86d")])
[sub_resource type="Resource" id="Resource_wkxow"]
@ -173,6 +176,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_pbgtt")])
[sub_resource type="Resource" id="Resource_gcqck"]
@ -216,6 +220,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_cj86d")])
[sub_resource type="Resource" id="Resource_bxbto"]
@ -259,6 +264,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_pbgtt")])
[sub_resource type="Resource" id="Resource_q48s1"]
@ -324,6 +330,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_ln27r"), SubResource("Resource_nal31")])
[sub_resource type="Resource" id="Resource_mpjrl"]
@ -375,6 +382,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_ln27r"), SubResource("Resource_nal31")])
[sub_resource type="Resource" id="Resource_ncfnl"]
@ -426,6 +434,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_ln27r"), SubResource("Resource_nal31")])
[sub_resource type="Resource" id="Resource_vkthc"]
@ -477,6 +486,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_ln27r"), SubResource("Resource_nal31")])
[sub_resource type="Resource" id="Resource_n2gn4"]

View file

@ -52,6 +52,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
Modifier = SubResource("Resource_80ngy")
TimeModifiers = Array[Object]([])
@ -104,6 +105,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
Modifier = SubResource("Resource_e6jj0")
TimeModifiers = []

View file

@ -25,6 +25,8 @@ BulletScene = ExtResource("1_w3uhv")
BulletSpeed = 40.0
Direction = Vector2(1, 0)
BulletDamage = 20.0
MaxDamage = 1.0
Knockback = 1.0
LifeTime = 20.0
DestroyOnCollision = false
Owner = 2
@ -34,4 +36,5 @@ Controllable = false
Freezable = true
Grazeable = false
GrazeValue = 0.2
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_3a5dw"), SubResource("Resource_rtncg")])

View file

@ -33,5 +33,6 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 0.2
Attributes = 34
Modifier = SubResource("Resource_jeq72")
TimeModifiers = Array[Object]([SubResource("Resource_edsop")])

View file

@ -20,4 +20,5 @@ Controllable = false
Freezable = true
Grazeable = false
GrazeValue = 0.2
Attributes = 2
TimeModifiers = Array[Object]([])

View file

@ -9,11 +9,16 @@ BulletScene = ExtResource("1_bca33")
BulletSpeed = 0.0
Direction = Vector2(1, 0)
BulletDamage = 8.0
MaxDamage = 1.0
Knockback = 1.0
LifeTime = 0.4
DestroyOnCollision = false
Owner = 0
DamageType = 4
RotateSprite = false
Controllable = false
Freezable = true
Grazeable = false
GrazeValue = 1.0
TimeModifiers = null
Attributes = 16
TimeModifiers = []

View file

@ -9,11 +9,16 @@ BulletScene = ExtResource("1_flnsi")
BulletSpeed = 0.0
Direction = Vector2(1, 0)
BulletDamage = 0.0
MaxDamage = 1.0
Knockback = 1.0
LifeTime = 1.0
DestroyOnCollision = false
Owner = 0
DamageType = 4
RotateSprite = false
Controllable = false
Freezable = true
Grazeable = false
GrazeValue = 1.0
TimeModifiers = null
Attributes = 16
TimeModifiers = []

View file

@ -9,12 +9,17 @@ BulletScene = ExtResource("1_yoaa8")
BulletSpeed = 0.0
Direction = Vector2(1, 0)
BulletDamage = 10.0
MaxDamage = 1.0
Knockback = 1.0
LifeTime = 1.0
DestroyOnCollision = false
Owner = 0
DamageType = 2
RotateSprite = false
Controllable = false
Freezable = true
Grazeable = false
GrazeValue = 0.2
TimeModifiers = null
Attributes = 16
TimeModifiers = []
metadata/_custom_type_script = "uid://dslyrfcej3g2n"

View file

@ -20,5 +20,6 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 96
TimeModifiers = []
metadata/_custom_type_script = "uid://dslyrfcej3g2n"

View file

@ -22,5 +22,6 @@ Controllable = true
Freezable = true
Grazeable = false
GrazeValue = 0.2
Attributes = 4
TimeModifiers = []
metadata/_custom_type_script = "uid://dslyrfcej3g2n"

View file

@ -34,4 +34,5 @@ Controllable = false
Freezable = true
Grazeable = false
GrazeValue = 1.0
Attributes = 0
TimeModifiers = Array[Object]([SubResource("Resource_26vvh")])

View file

@ -22,4 +22,5 @@ Controllable = false
Freezable = true
Grazeable = false
GrazeValue = 0.2
Attributes = 0
TimeModifiers = []

View file

@ -22,4 +22,5 @@ Controllable = false
Freezable = false
Grazeable = false
GrazeValue = 1.0
Attributes = 64
TimeModifiers = []

View file

@ -9,6 +9,8 @@ BulletScene = ExtResource("1_vsj6i")
BulletSpeed = 60.0
Direction = Vector2(1, 0)
BulletDamage = 12.0
MaxDamage = 1.0
Knockback = 1.0
LifeTime = 10.0
DestroyOnCollision = true
Owner = 2
@ -18,4 +20,5 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 34
TimeModifiers = []

View file

@ -9,6 +9,8 @@ BulletScene = ExtResource("1_qhpt3")
BulletSpeed = 70.0
Direction = Vector2(1, 0)
BulletDamage = 12.0
MaxDamage = 1.0
Knockback = 1.0
LifeTime = 10.0
DestroyOnCollision = true
Owner = 2
@ -18,4 +20,5 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
TimeModifiers = null
Attributes = 34
TimeModifiers = []

View file

@ -34,4 +34,5 @@ Controllable = false
Freezable = true
Grazeable = false
GrazeValue = 1.0
Attributes = 8
TimeModifiers = Array[Object]([SubResource("Resource_lcgqc")])

View file

@ -1,4 +1,4 @@
[gd_resource type="Resource" script_class="EnemyResource" load_steps=16 format=3 uid="uid://cocl3qontm3be"]
[gd_resource type="Resource" script_class="EnemyResource" load_steps=17 format=3 uid="uid://cocl3qontm3be"]
[ext_resource type="Resource" uid="uid://ct1fa2huvy34n" path="res://Resources/Items/Ammo1.tres" id="1_q1ekm"]
[ext_resource type="Texture2D" uid="uid://xgxxdq37pykh" path="res://Sprites/Actors/Fairy.png" id="1_sxbtw"]
@ -9,6 +9,7 @@
[ext_resource type="Resource" uid="uid://clr1gln7nxa1o" path="res://Resources/Items/Power_Pickup.tres" id="6_qvgac"]
[ext_resource type="Resource" uid="uid://cdfmedtgp2rcn" path="res://Resources/Weapons/EnemyWeapon.tres" id="7_xkg5o"]
[ext_resource type="Script" uid="uid://cd5o0ceb50jki" path="res://Scripts/Resources/EnemyResource.cs" id="8_241b0"]
[ext_resource type="PackedScene" uid="uid://cm1edol8wvxjp" path="res://Scenes/Actors/Generic_Enemy_FSM.tscn" id="8_ppsgt"]
[sub_resource type="AtlasTexture" id="AtlasTexture_ppsgt"]
atlas = ExtResource("1_sxbtw")
@ -48,7 +49,8 @@ metadata/_custom_type_script = "uid://cq65aed620ijo"
script = ExtResource("8_241b0")
EnemyName = &"Fairy"
EnemyKey = &"FAIRY_BASE"
PrefabPath = &"uid://clieeuln36a7a"
PrefabPath = &"uid://cm1edol8wvxjp"
Prefab = ExtResource("8_ppsgt")
MaxHealth = 4.0
MovementSpeed = 30.0
Weapon = ExtResource("7_xkg5o")

View file

@ -1,4 +1,4 @@
[gd_resource type="Resource" script_class="EnemyResource" load_steps=16 format=3 uid="uid://cqfyuurvqb8m6"]
[gd_resource type="Resource" script_class="EnemyResource" load_steps=17 format=3 uid="uid://cqfyuurvqb8m6"]
[ext_resource type="Texture2D" uid="uid://callpd48wwnlw" path="res://Sprites/Actors/Fairy_Special.png" id="1_kekqr"]
[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="1_tf7s2"]
@ -9,6 +9,7 @@
[ext_resource type="Resource" uid="uid://clr1gln7nxa1o" path="res://Resources/Items/Power_Pickup.tres" id="6_1cdvd"]
[ext_resource type="Resource" uid="uid://d27t8ruig8lie" path="res://Resources/Weapons/EnemyShotgun.tres" id="7_tf7s2"]
[ext_resource type="Script" uid="uid://cd5o0ceb50jki" path="res://Scripts/Resources/EnemyResource.cs" id="8_8fxhl"]
[ext_resource type="PackedScene" uid="uid://cm1edol8wvxjp" path="res://Scenes/Actors/Generic_Enemy_FSM.tscn" id="8_c0hok"]
[sub_resource type="AtlasTexture" id="AtlasTexture_c0hok"]
atlas = ExtResource("1_kekqr")
@ -49,6 +50,7 @@ script = ExtResource("8_8fxhl")
EnemyName = &"Special Fairy"
EnemyKey = &"FAIRY_BASE_SPECIAL"
PrefabPath = &"uid://bq4r28ikbmn0r"
Prefab = ExtResource("8_c0hok")
MaxHealth = 12.0
MovementSpeed = 30.0
Weapon = ExtResource("7_tf7s2")

View file

@ -1,7 +1,8 @@
[gd_resource type="Resource" script_class="EnemyResource" load_steps=6 format=3 uid="uid://ng3lpe8ifbsn"]
[gd_resource type="Resource" script_class="EnemyResource" load_steps=7 format=3 uid="uid://ng3lpe8ifbsn"]
[ext_resource type="Texture2D" uid="uid://p6cs703f5m3n" path="res://ExternalMaterial/RoboBoss/RoboBoss.png" id="1_bmkgj"]
[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="2_3teuq"]
[ext_resource type="PackedScene" uid="uid://d2xmlov4ee2fc" path="res://Scenes/Actors/Generic_Boss.tscn" id="3_r3p0s"]
[ext_resource type="Resource" uid="uid://b54lru8ulinjl" path="res://Resources/Weapons/EnemyWeapon_Big.tres" id="8_w06jt"]
[ext_resource type="Script" uid="uid://cd5o0ceb50jki" path="res://Scripts/Resources/EnemyResource.cs" id="9_vykx5"]
@ -14,6 +15,7 @@ script = ExtResource("9_vykx5")
EnemyName = &"Boss 1"
EnemyKey = &"BOSS_1"
PrefabPath = &"uid://clyrne78j3f5a"
Prefab = ExtResource("3_r3p0s")
MaxHealth = 100.0
MovementSpeed = 40.0
Weapon = ExtResource("8_w06jt")

View file

@ -1,6 +1,7 @@
[gd_resource type="Resource" script_class="EnemyResource" load_steps=16 format=3 uid="uid://qbo6avc7x64b"]
[gd_resource type="Resource" script_class="EnemyResource" load_steps=17 format=3 uid="uid://qbo6avc7x64b"]
[ext_resource type="Texture2D" uid="uid://xhwfgbv0fjbr" path="res://Sprites/Actors/FairyGuard.png" id="1_ivudp"]
[ext_resource type="SpriteFrames" uid="uid://ch2ll1on8im2p" path="res://Resources/Sprites/FairyGuard.tres" id="1_n54y5"]
[ext_resource type="Script" uid="uid://cd5o0ceb50jki" path="res://Scripts/Resources/EnemyResource.cs" id="1_p31tv"]
[ext_resource type="Resource" uid="uid://ct1fa2huvy34n" path="res://Resources/Items/Ammo1.tres" id="1_u7yd8"]
[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="2_ivudp"]
@ -48,7 +49,7 @@ metadata/_custom_type_script = "uid://cq65aed620ijo"
script = ExtResource("1_p31tv")
EnemyName = &"Fairy Guard"
EnemyKey = &"FAIRY_GUARD"
PrefabPath = &"uid://bb32f4p5e671j"
PrefabPath = &"uid://cm1edol8wvxjp"
MaxHealth = 10.0
MovementSpeed = 40.0
Weapon = ExtResource("7_u7yd8")
@ -64,4 +65,5 @@ MaxStrafeDistance = 32.0
MinStrafeDistance = 16.0
ResponseTime = 0.5
IconSprite = SubResource("AtlasTexture_n54y5")
AnimationFrames = ExtResource("1_n54y5")
metadata/_custom_type_script = "uid://cd5o0ceb50jki"

View file

@ -0,0 +1,59 @@
[gd_resource type="Resource" script_class="EnemyResource" load_steps=10 format=3 uid="uid://bqdvyxs8sj3qa"]
[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="1_0qdnn"]
[ext_resource type="Resource" uid="uid://dlhe7by67eu4v" path="res://Resources/BossPhases/Reimu/Reimu_Boss_Script.tres" id="1_amg33"]
[ext_resource type="Texture2D" uid="uid://bbdrws471xslc" path="res://Sprites/Actors/Rumia-world.png" id="1_gjra5"]
[ext_resource type="Resource" uid="uid://b54lru8ulinjl" path="res://Resources/Weapons/EnemyWeapon_Big.tres" id="2_amg33"]
[ext_resource type="Script" uid="uid://cd5o0ceb50jki" path="res://Scripts/Resources/EnemyResource.cs" id="3_gjra5"]
[sub_resource type="AtlasTexture" id="AtlasTexture_lukoi"]
atlas = ExtResource("1_gjra5")
region = Rect2(0, 0, 8, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_wegsk"]
atlas = ExtResource("1_gjra5")
region = Rect2(8, 0, 8, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_a6ruk"]
atlas = ExtResource("1_gjra5")
region = Rect2(16, 0, 8, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_v6t43"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_lukoi")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wegsk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a6ruk")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[resource]
script = ExtResource("3_gjra5")
EnemyName = &"Reimu"
EnemyKey = &"REIMU"
PrefabPath = &"uid://d2xmlov4ee2fc"
MaxHealth = 500.0
MovementSpeed = 20.0
Weapon = ExtResource("2_amg33")
LootDrops = Array[ExtResource("1_0qdnn")]([])
MotivationReward = 4.0
PredictPlayer = false
PlayerDetectionRange = 90.0
ViewRange = 120.0
AlarmReactRange = 0.0
PlayerDisengageRange = 0.0
StrafeSpeed = 25.0
MaxStrafeDistance = 64.0
MinStrafeDistance = 16.0
ResponseTime = 0.5
AnimationFrames = SubResource("SpriteFrames_v6t43")
BossScript = ExtResource("1_amg33")
metadata/_custom_type_script = "uid://cd5o0ceb50jki"

View file

@ -0,0 +1,59 @@
[gd_resource type="Resource" script_class="EnemyResource" load_steps=10 format=3 uid="uid://1jtogtbjk2r5"]
[ext_resource type="Texture2D" uid="uid://bbdrws471xslc" path="res://Sprites/Actors/Rumia-world.png" id="1_6mall"]
[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="1_ibtcs"]
[ext_resource type="Resource" uid="uid://d2l607uabv3d6" path="res://Resources/BossPhases/Rumia_Boss_Script.tres" id="1_xjekt"]
[ext_resource type="Resource" uid="uid://b54lru8ulinjl" path="res://Resources/Weapons/EnemyWeapon_Big.tres" id="2_xjekt"]
[ext_resource type="Script" uid="uid://cd5o0ceb50jki" path="res://Scripts/Resources/EnemyResource.cs" id="3_6mall"]
[sub_resource type="AtlasTexture" id="AtlasTexture_lukoi"]
atlas = ExtResource("1_6mall")
region = Rect2(0, 0, 8, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_wegsk"]
atlas = ExtResource("1_6mall")
region = Rect2(8, 0, 8, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_a6ruk"]
atlas = ExtResource("1_6mall")
region = Rect2(16, 0, 8, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_v6t43"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_lukoi")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wegsk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a6ruk")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[resource]
script = ExtResource("3_6mall")
EnemyName = &"Rumia"
EnemyKey = &"RUMIA"
PrefabPath = &"uid://d2xmlov4ee2fc"
MaxHealth = 500.0
MovementSpeed = 20.0
Weapon = ExtResource("2_xjekt")
LootDrops = Array[ExtResource("1_ibtcs")]([])
MotivationReward = 4.0
PredictPlayer = false
PlayerDetectionRange = 90.0
ViewRange = 120.0
AlarmReactRange = 0.0
PlayerDisengageRange = 0.0
StrafeSpeed = 25.0
MaxStrafeDistance = 64.0
MinStrafeDistance = 16.0
ResponseTime = 0.5
AnimationFrames = SubResource("SpriteFrames_v6t43")
BossScript = ExtResource("1_xjekt")
metadata/_custom_type_script = "uid://cd5o0ceb50jki"

View file

@ -24,6 +24,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = []
[sub_resource type="Resource" id="Resource_ne4q3"]
@ -67,6 +68,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = []
[sub_resource type="Resource" id="Resource_kohuh"]
@ -110,6 +112,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = []
[sub_resource type="Resource" id="Resource_depjj"]

View file

@ -27,6 +27,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
Modifier = SubResource("Resource_ktwe0")
TimeModifiers = Array[Object]([])
metadata/_custom_type_script = "uid://dslyrfcej3g2n"

View file

@ -0,0 +1,274 @@
[gd_scene load_steps=45 format=3 uid="uid://d2xmlov4ee2fc"]
[ext_resource type="Script" uid="uid://bi2edpdosngll" path="res://Scripts/Components/FSM/Enemy/EnemyFSMProxy.cs" id="1_c4gmu"]
[ext_resource type="Resource" uid="uid://bqdvyxs8sj3qa" path="res://Resources/Enemies/Reimu_Boss.tres" id="2_glyek"]
[ext_resource type="Script" uid="uid://dn6dbog1s2818" path="res://Scripts/Components/FSM/Enemy/EnemyStateMachine.cs" id="5_5ay45"]
[ext_resource type="Script" uid="uid://rrelumir3g6n" path="res://Scripts/Components/FSM/Enemy/Init.cs" id="6_m4swb"]
[ext_resource type="Script" uid="uid://cprumccndvblc" path="res://Scripts/Components/FSM/Boss/Idle.cs" id="7_6x5ge"]
[ext_resource type="Script" uid="uid://dbmc3klko5x18" path="res://Scripts/Components/FSM/Enemy/Alert.cs" id="8_yc20b"]
[ext_resource type="Script" uid="uid://difn6d5np1pui" path="res://Scripts/Components/FSM/Boss/Shooting.cs" id="9_afh63"]
[ext_resource type="Resource" uid="uid://dlhe7by67eu4v" path="res://Resources/BossPhases/Reimu/Reimu_Boss_Script.tres" id="10_3f6i0"]
[ext_resource type="Script" uid="uid://4hwtlc1ftjsc" path="res://Scripts/Components/FSM/Enemy/Dead.cs" id="11_t2767"]
[ext_resource type="Script" uid="uid://dj37rup1ibnn6" path="res://Scripts/Components/FSM/Enemy/Controlled.cs" id="12_4svw5"]
[ext_resource type="Texture2D" uid="uid://bbdrws471xslc" path="res://Sprites/Actors/Rumia-world.png" id="13_xltp3"]
[ext_resource type="Script" uid="uid://dathhlufbe6gr" path="res://Scripts/Components/FSM/Enemy/EnemyFSMAnimatedSprite.cs" id="14_p6xck"]
[ext_resource type="Script" uid="uid://mb4ugq74a17c" path="res://Scripts/Components/FSM/Enemy/PlayerDetectionModule.cs" id="15_dueum"]
[ext_resource type="Script" uid="uid://bflvr26h52c55" path="res://Scripts/Components/FSM/Enemy/EnemyStorageModule.cs" id="16_xyblu"]
[ext_resource type="Script" uid="uid://cq3hkweplldbr" path="res://Scripts/Components/Actors/GenericDamageReceiver.cs" id="17_afda6"]
[ext_resource type="PackedScene" uid="uid://cm564ue740cpx" path="res://Scenes/Actors/DeadFairyGuard.tscn" id="18_ptfne"]
[ext_resource type="Script" uid="uid://cqwvssstkrdmw" path="res://Scripts/Components/Actors/ActorResourceProvider.cs" id="19_q036b"]
[ext_resource type="Script" uid="uid://ik7s65de723k" path="res://Scripts/Components/FSM/Enemy/NavigationMovementModule.cs" id="20_yquox"]
[ext_resource type="PackedScene" uid="uid://cj63k0dmk7tl1" path="res://Scenes/Weapons/enemy_weapon_base.tscn" id="21_f5ifd"]
[ext_resource type="Resource" uid="uid://csdlihliv4cr8" path="res://Resources/Weapons/EnemyWeapon_simple.tres" id="22_7xl5u"]
[ext_resource type="Script" uid="uid://dhsqsajq537qn" path="res://Scripts/Components/FSM/Enemy/EnemyAlarmModule.cs" id="23_2tfq0"]
[ext_resource type="Script" uid="uid://bo5sgbv1t8ril" path="res://Scripts/Components/Actors/PlayerAnimationProvider.cs" id="24_1mfov"]
[ext_resource type="Material" uid="uid://dnvwgyt2tbqmr" path="res://Resources/Materials/Player_Blink_Teleport_Material.tres" id="25_7jo7s"]
[ext_resource type="Script" uid="uid://dncdgq843sj2f" path="res://Scripts/Components/FSM/Enemy/AnimationModule.cs" id="26_bta7h"]
[ext_resource type="Script" uid="uid://bw4t2clyr6lib" path="res://Scripts/Components/FSM/Enemy/EnemyDropsProvider.cs" id="27_50307"]
[ext_resource type="Texture2D" uid="uid://b2v6j7lsyltrc" path="res://Sprites/Actors/CirnoWings.png" id="28_e4y58"]
[ext_resource type="Script" uid="uid://dq338w2lw5phl" path="res://Scripts/Components/Actors/KeyboardInputProvider.cs" id="29_drs60"]
[ext_resource type="Script" uid="uid://d208gvthkstvc" path="res://Scripts/Components/Actors/PlayerCrosshairProvider.cs" id="30_vipg1"]
[ext_resource type="Texture2D" uid="uid://cf2855sd3hqty" path="res://Sprites/Actors/Aiming_Reticule_Small.png" id="31_o8tp4"]
[ext_resource type="Script" uid="uid://c2mngevyoefky" path="res://Scripts/Components/FSM/Boss/BossScriptHostModule.cs" id="32_vhb3d"]
[ext_resource type="Script" uid="uid://c6467d6yx50qh" path="res://Scripts/Components/BulletSpawner.cs" id="33_a65yl"]
[ext_resource type="PackedScene" uid="uid://cuixq5ex0j40h" path="res://Scenes/enemyBullet.tscn" id="34_vm1xw"]
[sub_resource type="CircleShape2D" id="CircleShape2D_pnkma"]
radius = 23.0217
[sub_resource type="AtlasTexture" id="AtlasTexture_lukoi"]
atlas = ExtResource("13_xltp3")
region = Rect2(0, 0, 8, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_wegsk"]
atlas = ExtResource("13_xltp3")
region = Rect2(8, 0, 8, 16)
[sub_resource type="AtlasTexture" id="AtlasTexture_a6ruk"]
atlas = ExtResource("13_xltp3")
region = Rect2(16, 0, 8, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_v6t43"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_lukoi")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_wegsk")
}, {
"duration": 1.0,
"texture": SubResource("AtlasTexture_a6ruk")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="CircleShape2D" id="CircleShape2D_5wstg"]
radius = 92.0054
[sub_resource type="CircleShape2D" id="CircleShape2D_6x22m"]
radius = 24.0156
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_poxpj"]
particle_flag_disable_z = true
emission_shape = 2
emission_sphere_radius = 16.0
orbit_velocity_min = -1.0
orbit_velocity_max = 1.098
gravity = Vector3(0, 0, 0)
color = Color(0.0392157, 0.380392, 1, 1)
[sub_resource type="AtlasTexture" id="AtlasTexture_urwql"]
atlas = ExtResource("28_e4y58")
region = Rect2(0, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_wafqr"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_urwql")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_12erk"]
atlas = ExtResource("31_o8tp4")
region = Rect2(0, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_biwfl"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_12erk")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="Boss" type="CharacterBody2D" node_paths=PackedStringArray("EnemyFSM")]
collision_layer = 16
collision_mask = 33
script = ExtResource("1_c4gmu")
EnemyFSM = NodePath("StateMachine")
EnemyResource = ExtResource("2_glyek")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_pnkma")
[node name="StateMachine" type="Node2D" parent="."]
script = ExtResource("5_5ay45")
[node name="Init" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("DamageReceiver", "StorageModule")]
script = ExtResource("6_m4swb")
DamageReceiver = NodePath("../../DamageReceiver")
StorageModule = NodePath("../../Storage")
[node name="Idle" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("StorageModule", "DamageReceiver", "_moduleNodes")]
script = ExtResource("7_6x5ge")
StorageModule = NodePath("../../Storage")
DamageReceiver = NodePath("../../DamageReceiver")
_moduleNodes = [NodePath("../../AnimationModule")]
[node name="Alert" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("StorageModule", "PlayerDetection", "DamageReceiver", "NavigationModule", "_moduleNodes")]
script = ExtResource("8_yc20b")
StorageModule = NodePath("../../Storage")
PlayerDetection = NodePath("../../PlayerDetection")
DamageReceiver = NodePath("../../DamageReceiver")
NavigationModule = NodePath("../../NavigationModule")
_moduleNodes = [NodePath("../../AnimationModule")]
[node name="Shooting" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("DamageReceiver", "EquippedWeapon", "StorageModule", "BossScriptHostModule", "_moduleNodes")]
script = ExtResource("9_afh63")
DamageReceiver = NodePath("../../DamageReceiver")
EquippedWeapon = NodePath("../../EnemyWeapon")
StorageModule = NodePath("../../Storage")
BossScriptHostModule = NodePath("../../ScriptHostModule")
BossScript = ExtResource("10_3f6i0")
_moduleNodes = [NodePath("../../AnimationModule"), NodePath("../../ScriptHostModule")]
[node name="Dead" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("StorageModule", "DropsProvider")]
script = ExtResource("11_t2767")
StorageModule = NodePath("../../Storage")
DropsProvider = NodePath("../../DropsProvider")
[node name="Controlled" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("StorageModule", "DamageReceiver", "_inputProvider", "CrosshairProvider", "EquippedWeapon", "_moduleNodes")]
script = ExtResource("12_4svw5")
StorageModule = NodePath("../../Storage")
DamageReceiver = NodePath("../../DamageReceiver")
_inputProvider = NodePath("../../InputProvider")
CrosshairProvider = NodePath("../../CrosshairProvider")
EquippedWeapon = NodePath("../../EnemyWeapon")
_moduleNodes = [NodePath("../../AnimationModule")]
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_v6t43")
script = ExtResource("14_p6xck")
[node name="PlayerDetection" type="Area2D" parent="."]
visible = false
collision_layer = 0
collision_mask = 2
script = ExtResource("15_dueum")
ObstaclesCollisionMask = 81
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerDetection"]
shape = SubResource("CircleShape2D_5wstg")
[node name="Storage" type="Node2D" parent="." node_paths=PackedStringArray("Root")]
script = ExtResource("16_xyblu")
Root = NodePath("..")
[node name="DamageReceiver" type="Area2D" parent="." node_paths=PackedStringArray("HealthProvider")]
collision_layer = 64
collision_mask = 136
script = ExtResource("17_afda6")
HealthProvider = NodePath("Health")
BulletGroup = 2
Debris = ExtResource("18_ptfne")
DeleteParentOnDeath = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageReceiver"]
position = Vector2(0, 3.865)
shape = SubResource("CircleShape2D_6x22m")
[node name="Health" type="Node2D" parent="DamageReceiver"]
script = ExtResource("19_q036b")
ResourceName = "Health"
[node name="NavigationModule" type="Node2D" parent="." node_paths=PackedStringArray("StorageModule")]
script = ExtResource("20_yquox")
StorageModule = NodePath("../Storage")
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="NavigationModule"]
target_desired_distance = 8.0
path_max_distance = 800.0
path_postprocessing = 1
avoidance_enabled = true
debug_path_custom_color = Color(1, 0, 0, 1)
[node name="EnemyWeapon" parent="." instance=ExtResource("21_f5ifd")]
WeaponData = ExtResource("22_7xl5u")
[node name="AlarmModule" type="Node2D" parent="." node_paths=PackedStringArray("PlayerDetection")]
script = ExtResource("23_2tfq0")
PlayerDetection = NodePath("../PlayerDetection")
[node name="AnimationProvider" type="Node2D" parent="." node_paths=PackedStringArray("_animatedSprite", "_shieldParticles")]
script = ExtResource("24_1mfov")
_animatedSprite = NodePath("../AnimatedSprite2D")
_shieldParticles = NodePath("ShieldParticles")
WalkRightAnimationName = &"right"
WalkLeftAnimationName = &"left"
WalkDownAnimationName = &"down"
WalkUpAnimationName = &"up"
BlinkMaterial = ExtResource("25_7jo7s")
[node name="ShieldParticles" type="GPUParticles2D" parent="AnimationProvider"]
emitting = false
amount = 32
lifetime = 0.4
one_shot = true
process_material = SubResource("ParticleProcessMaterial_poxpj")
[node name="AnimationModule" type="Node2D" parent="." node_paths=PackedStringArray("AnimationProvider", "StorageModule")]
script = ExtResource("26_bta7h")
AnimationProvider = NodePath("../AnimationProvider")
StorageModule = NodePath("../Storage")
[node name="DropsProvider" type="Node2D" parent="." node_paths=PackedStringArray("StorageModule")]
script = ExtResource("27_50307")
StorageModule = NodePath("../Storage")
[node name="PossessionWings" type="AnimatedSprite2D" parent="."]
visible = false
sprite_frames = SubResource("SpriteFrames_wafqr")
[node name="InputProvider" type="Node2D" parent="."]
script = ExtResource("29_drs60")
[node name="CrosshairProvider" type="Node2D" parent="." node_paths=PackedStringArray("AnimatedSprite")]
visible = false
script = ExtResource("30_vipg1")
AnimatedSprite = NodePath("Crosshair")
CrosshairDistance = 35.0
[node name="Crosshair" type="AnimatedSprite2D" parent="CrosshairProvider"]
sprite_frames = SubResource("SpriteFrames_biwfl")
[node name="ScriptHostModule" type="Node2D" parent="." node_paths=PackedStringArray("StorageModule")]
script = ExtResource("32_vhb3d")
StorageModule = NodePath("../Storage")
[node name="BulletSpawner" type="Node2D" parent="ScriptHostModule"]
script = ExtResource("33_a65yl")
BulletScene = ExtResource("34_vm1xw")
[connection signal="area_entered" from="PlayerDetection" to="PlayerDetection" method="_on_area_entered"]
[connection signal="area_exited" from="PlayerDetection" to="PlayerDetection" method="_on_area_exited"]
[connection signal="area_entered" from="DamageReceiver" to="DamageReceiver" method="_on_damage_hitbox_area_entered"]
[connection signal="velocity_computed" from="NavigationModule/NavigationAgent2D" to="NavigationModule" method="_on_navigation_agent_2d_velocity_computed"]

View file

@ -0,0 +1,239 @@
[gd_scene load_steps=38 format=3 uid="uid://cm1edol8wvxjp"]
[ext_resource type="Script" uid="uid://bi2edpdosngll" path="res://Scripts/Components/FSM/Enemy/EnemyFSMProxy.cs" id="1_tao0j"]
[ext_resource type="Resource" uid="uid://qbo6avc7x64b" path="res://Resources/Enemies/Fairy_Guard.tres" id="2_hcd4s"]
[ext_resource type="Script" uid="uid://dn6dbog1s2818" path="res://Scripts/Components/FSM/Enemy/EnemyStateMachine.cs" id="3_7aslx"]
[ext_resource type="Script" uid="uid://rrelumir3g6n" path="res://Scripts/Components/FSM/Enemy/Init.cs" id="4_kvine"]
[ext_resource type="Script" uid="uid://bjrh5q24nuoec" path="res://Scripts/Components/FSM/Enemy/Idle.cs" id="5_i2lcq"]
[ext_resource type="Script" uid="uid://dbmc3klko5x18" path="res://Scripts/Components/FSM/Enemy/Alert.cs" id="6_7k6o5"]
[ext_resource type="Script" uid="uid://7mig30eneu8x" path="res://Scripts/Components/FSM/Enemy/Shooting.cs" id="7_3q5aq"]
[ext_resource type="Script" uid="uid://4hwtlc1ftjsc" path="res://Scripts/Components/FSM/Enemy/Dead.cs" id="8_yyxln"]
[ext_resource type="Script" uid="uid://dj37rup1ibnn6" path="res://Scripts/Components/FSM/Enemy/Controlled.cs" id="9_7h4b6"]
[ext_resource type="SpriteFrames" uid="uid://ch2ll1on8im2p" path="res://Resources/Sprites/FairyGuard.tres" id="10_w7hi2"]
[ext_resource type="Script" uid="uid://mb4ugq74a17c" path="res://Scripts/Components/FSM/Enemy/PlayerDetectionModule.cs" id="11_go0pp"]
[ext_resource type="Script" uid="uid://dathhlufbe6gr" path="res://Scripts/Components/FSM/Enemy/EnemyFSMAnimatedSprite.cs" id="11_hcd4s"]
[ext_resource type="Script" uid="uid://bflvr26h52c55" path="res://Scripts/Components/FSM/Enemy/EnemyStorageModule.cs" id="12_sd60t"]
[ext_resource type="Script" uid="uid://cq3hkweplldbr" path="res://Scripts/Components/Actors/GenericDamageReceiver.cs" id="13_f8y0l"]
[ext_resource type="PackedScene" uid="uid://cm564ue740cpx" path="res://Scenes/Actors/DeadFairyGuard.tscn" id="14_5fbry"]
[ext_resource type="Script" uid="uid://cqwvssstkrdmw" path="res://Scripts/Components/Actors/ActorResourceProvider.cs" id="15_1tcjf"]
[ext_resource type="Script" uid="uid://ik7s65de723k" path="res://Scripts/Components/FSM/Enemy/NavigationMovementModule.cs" id="16_bpjio"]
[ext_resource type="PackedScene" uid="uid://cj63k0dmk7tl1" path="res://Scenes/Weapons/enemy_weapon_base.tscn" id="17_r8s15"]
[ext_resource type="Resource" uid="uid://csdlihliv4cr8" path="res://Resources/Weapons/EnemyWeapon_simple.tres" id="18_hgqoq"]
[ext_resource type="Script" uid="uid://dhsqsajq537qn" path="res://Scripts/Components/FSM/Enemy/EnemyAlarmModule.cs" id="19_rkhkm"]
[ext_resource type="Script" uid="uid://bo5sgbv1t8ril" path="res://Scripts/Components/Actors/PlayerAnimationProvider.cs" id="20_h5uc0"]
[ext_resource type="Material" uid="uid://dnvwgyt2tbqmr" path="res://Resources/Materials/Player_Blink_Teleport_Material.tres" id="21_wuf7p"]
[ext_resource type="Script" uid="uid://dncdgq843sj2f" path="res://Scripts/Components/FSM/Enemy/AnimationModule.cs" id="22_sh6bv"]
[ext_resource type="Script" uid="uid://bw4t2clyr6lib" path="res://Scripts/Components/FSM/Enemy/EnemyDropsProvider.cs" id="23_v2y61"]
[ext_resource type="Texture2D" uid="uid://b2v6j7lsyltrc" path="res://Sprites/Actors/CirnoWings.png" id="24_8r23r"]
[ext_resource type="Script" uid="uid://dq338w2lw5phl" path="res://Scripts/Components/Actors/KeyboardInputProvider.cs" id="25_nwo8y"]
[ext_resource type="Script" uid="uid://d208gvthkstvc" path="res://Scripts/Components/Actors/PlayerCrosshairProvider.cs" id="26_kedky"]
[ext_resource type="Texture2D" uid="uid://cf2855sd3hqty" path="res://Sprites/Actors/Aiming_Reticule_Small.png" id="27_bfvsw"]
[ext_resource type="Script" uid="uid://by1w0oo6nguyv" path="res://Scripts/Components/FSM/Enemy/EnemyKnockbackProvider.cs" id="28_tdhrj"]
[sub_resource type="CircleShape2D" id="CircleShape2D_pnkma"]
[sub_resource type="CircleShape2D" id="CircleShape2D_5wstg"]
radius = 29.0
[sub_resource type="CircleShape2D" id="CircleShape2D_6x22m"]
radius = 5.0
[sub_resource type="ParticleProcessMaterial" id="ParticleProcessMaterial_poxpj"]
particle_flag_disable_z = true
emission_shape = 2
emission_sphere_radius = 16.0
orbit_velocity_min = -1.0
orbit_velocity_max = 1.098
gravity = Vector3(0, 0, 0)
color = Color(0.0392157, 0.380392, 1, 1)
[sub_resource type="AtlasTexture" id="AtlasTexture_urwql"]
atlas = ExtResource("24_8r23r")
region = Rect2(0, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_wafqr"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_urwql")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[sub_resource type="AtlasTexture" id="AtlasTexture_12erk"]
atlas = ExtResource("27_bfvsw")
region = Rect2(0, 0, 16, 16)
[sub_resource type="SpriteFrames" id="SpriteFrames_biwfl"]
animations = [{
"frames": [{
"duration": 1.0,
"texture": SubResource("AtlasTexture_12erk")
}],
"loop": true,
"name": &"default",
"speed": 5.0
}]
[node name="FairyGuardFsm" type="CharacterBody2D" node_paths=PackedStringArray("EnemyFSM")]
collision_layer = 16
collision_mask = 33
script = ExtResource("1_tao0j")
EnemyFSM = NodePath("StateMachine")
EnemyResource = ExtResource("2_hcd4s")
[node name="CollisionShape2D" type="CollisionShape2D" parent="."]
shape = SubResource("CircleShape2D_pnkma")
[node name="StateMachine" type="Node2D" parent="."]
script = ExtResource("3_7aslx")
[node name="Init" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("DamageReceiver", "StorageModule")]
script = ExtResource("4_kvine")
DamageReceiver = NodePath("../../DamageReceiver")
StorageModule = NodePath("../../Storage")
[node name="Idle" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("StorageModule", "PlayerDetection", "DamageReceiver", "_moduleNodes")]
script = ExtResource("5_i2lcq")
StorageModule = NodePath("../../Storage")
PlayerDetection = NodePath("../../PlayerDetection")
DamageReceiver = NodePath("../../DamageReceiver")
_moduleNodes = [NodePath("../../AlarmModule"), NodePath("../../AnimationModule"), NodePath("../../Knockbackprovider")]
[node name="Alert" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("StorageModule", "PlayerDetection", "DamageReceiver", "NavigationModule", "_moduleNodes")]
script = ExtResource("6_7k6o5")
StorageModule = NodePath("../../Storage")
PlayerDetection = NodePath("../../PlayerDetection")
DamageReceiver = NodePath("../../DamageReceiver")
NavigationModule = NodePath("../../NavigationModule")
_moduleNodes = [NodePath("../../AnimationModule"), NodePath("../../Knockbackprovider")]
[node name="Shooting" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("StorageModule", "PlayerDetection", "DamageReceiver", "NavigationModule", "EquippedWeapon", "_moduleNodes")]
script = ExtResource("7_3q5aq")
StorageModule = NodePath("../../Storage")
PlayerDetection = NodePath("../../PlayerDetection")
DamageReceiver = NodePath("../../DamageReceiver")
NavigationModule = NodePath("../../NavigationModule")
EquippedWeapon = NodePath("../../EnemyWeapon")
_moduleNodes = [NodePath("../../AnimationModule"), NodePath("../../Knockbackprovider")]
[node name="Dead" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("StorageModule", "DropsProvider")]
script = ExtResource("8_yyxln")
StorageModule = NodePath("../../Storage")
DropsProvider = NodePath("../../DropsProvider")
[node name="Controlled" type="Node2D" parent="StateMachine" node_paths=PackedStringArray("StorageModule", "DamageReceiver", "_inputProvider", "CrosshairProvider", "EquippedWeapon", "_moduleNodes")]
script = ExtResource("9_7h4b6")
StorageModule = NodePath("../../Storage")
DamageReceiver = NodePath("../../DamageReceiver")
_inputProvider = NodePath("../../InputProvider")
CrosshairProvider = NodePath("../../CrosshairProvider")
EquippedWeapon = NodePath("../../EnemyWeapon")
_moduleNodes = [NodePath("../../AnimationModule")]
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = ExtResource("10_w7hi2")
animation = &"down"
script = ExtResource("11_hcd4s")
[node name="PlayerDetection" type="Area2D" parent="."]
collision_layer = 0
collision_mask = 2
script = ExtResource("11_go0pp")
ObstaclesCollisionMask = 81
[node name="CollisionShape2D" type="CollisionShape2D" parent="PlayerDetection"]
shape = SubResource("CircleShape2D_5wstg")
[node name="Storage" type="Node2D" parent="." node_paths=PackedStringArray("Root")]
script = ExtResource("12_sd60t")
Root = NodePath("..")
[node name="DamageReceiver" type="Area2D" parent="." node_paths=PackedStringArray("HealthProvider")]
collision_layer = 64
collision_mask = 136
script = ExtResource("13_f8y0l")
HealthProvider = NodePath("Health")
BulletGroup = 2
Debris = ExtResource("14_5fbry")
DeleteParentOnDeath = false
[node name="CollisionShape2D" type="CollisionShape2D" parent="DamageReceiver"]
position = Vector2(0, 3.865)
shape = SubResource("CircleShape2D_6x22m")
[node name="Health" type="Node2D" parent="DamageReceiver"]
script = ExtResource("15_1tcjf")
ResourceName = "Health"
[node name="NavigationModule" type="Node2D" parent="." node_paths=PackedStringArray("StorageModule")]
script = ExtResource("16_bpjio")
StorageModule = NodePath("../Storage")
[node name="NavigationAgent2D" type="NavigationAgent2D" parent="NavigationModule"]
target_desired_distance = 8.0
path_max_distance = 800.0
path_postprocessing = 1
avoidance_enabled = true
debug_path_custom_color = Color(1, 0, 0, 1)
[node name="EnemyWeapon" parent="." instance=ExtResource("17_r8s15")]
WeaponData = ExtResource("18_hgqoq")
[node name="AlarmModule" type="Node2D" parent="." node_paths=PackedStringArray("PlayerDetection")]
script = ExtResource("19_rkhkm")
PlayerDetection = NodePath("../PlayerDetection")
[node name="AnimationProvider" type="Node2D" parent="." node_paths=PackedStringArray("_animatedSprite", "_shieldParticles")]
script = ExtResource("20_h5uc0")
_animatedSprite = NodePath("../AnimatedSprite2D")
_shieldParticles = NodePath("ShieldParticles")
WalkRightAnimationName = &"right"
WalkLeftAnimationName = &"left"
WalkDownAnimationName = &"down"
WalkUpAnimationName = &"up"
BlinkMaterial = ExtResource("21_wuf7p")
[node name="ShieldParticles" type="GPUParticles2D" parent="AnimationProvider"]
emitting = false
amount = 32
lifetime = 0.4
one_shot = true
process_material = SubResource("ParticleProcessMaterial_poxpj")
[node name="AnimationModule" type="Node2D" parent="." node_paths=PackedStringArray("AnimationProvider", "StorageModule", "HealthProvider")]
script = ExtResource("22_sh6bv")
AnimationProvider = NodePath("../AnimationProvider")
StorageModule = NodePath("../Storage")
HealthProvider = NodePath("../DamageReceiver/Health")
[node name="DropsProvider" type="Node2D" parent="." node_paths=PackedStringArray("StorageModule")]
script = ExtResource("23_v2y61")
StorageModule = NodePath("../Storage")
[node name="PossessionWings" type="AnimatedSprite2D" parent="."]
visible = false
sprite_frames = SubResource("SpriteFrames_wafqr")
[node name="InputProvider" type="Node2D" parent="."]
script = ExtResource("25_nwo8y")
[node name="CrosshairProvider" type="Node2D" parent="." node_paths=PackedStringArray("AnimatedSprite")]
script = ExtResource("26_kedky")
AnimatedSprite = NodePath("Crosshair")
CrosshairDistance = 35.0
[node name="Crosshair" type="AnimatedSprite2D" parent="CrosshairProvider"]
sprite_frames = SubResource("SpriteFrames_biwfl")
[node name="Knockbackprovider" type="Node2D" parent="." node_paths=PackedStringArray("DamageReceiver", "StorageModule")]
script = ExtResource("28_tdhrj")
DamageReceiver = NodePath("../DamageReceiver")
StorageModule = NodePath("../Storage")
[connection signal="area_entered" from="PlayerDetection" to="PlayerDetection" method="_on_area_entered"]
[connection signal="area_exited" from="PlayerDetection" to="PlayerDetection" method="_on_area_exited"]
[connection signal="area_entered" from="DamageReceiver" to="DamageReceiver" method="_on_damage_hitbox_area_entered"]
[connection signal="velocity_computed" from="NavigationModule/NavigationAgent2D" to="NavigationModule" method="_on_navigation_agent_2d_velocity_computed"]

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=47 format=3 uid="uid://culg3euj7mdv3"]
[gd_scene load_steps=48 format=3 uid="uid://culg3euj7mdv3"]
[ext_resource type="Script" uid="uid://bi2edpdosngll" path="res://Scripts/Components/FSM/Enemy/EnemyFSMProxy.cs" id="1_0gxmm"]
[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="2_wegsk"]
@ -16,6 +16,7 @@
[ext_resource type="Script" uid="uid://mb4ugq74a17c" path="res://Scripts/Components/FSM/Enemy/PlayerDetectionModule.cs" id="12_ip1so"]
[ext_resource type="Script" uid="uid://bflvr26h52c55" path="res://Scripts/Components/FSM/Enemy/EnemyStorageModule.cs" id="13_7ebnx"]
[ext_resource type="Script" uid="uid://cq3hkweplldbr" path="res://Scripts/Components/Actors/GenericDamageReceiver.cs" id="14_7d52v"]
[ext_resource type="Script" uid="uid://dathhlufbe6gr" path="res://Scripts/Components/FSM/Enemy/EnemyFSMAnimatedSprite.cs" id="14_a6ruk"]
[ext_resource type="PackedScene" uid="uid://cm564ue740cpx" path="res://Scenes/Actors/DeadFairyGuard.tscn" id="15_8sayc"]
[ext_resource type="Script" uid="uid://cqwvssstkrdmw" path="res://Scripts/Components/Actors/ActorResourceProvider.cs" id="16_xnpg3"]
[ext_resource type="Script" uid="uid://ik7s65de723k" path="res://Scripts/Components/FSM/Enemy/NavigationMovementModule.cs" id="17_tmqpi"]
@ -189,6 +190,7 @@ _moduleNodes = [NodePath("../../AnimationModule")]
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
sprite_frames = SubResource("SpriteFrames_v6t43")
script = ExtResource("14_a6ruk")
[node name="PlayerDetection" type="Area2D" parent="."]
visible = false

View file

@ -1,4 +1,4 @@
[gd_scene load_steps=133 format=4 uid="uid://dqyfnby0t7gu1"]
[gd_scene load_steps=127 format=4 uid="uid://dqyfnby0t7gu1"]
[ext_resource type="Script" uid="uid://doxmbokehw8ci" path="res://Scripts/GameManager.cs" id="1_c3v4x"]
[ext_resource type="Script" uid="uid://epnwjptvks3t" path="res://Scripts/Resources/LootItem.cs" id="2_g20dv"]
@ -71,9 +71,7 @@
[ext_resource type="PackedScene" uid="uid://du37oyues6klq" path="res://Scenes/Weapons/BaseAutonomousBulletEmitter.tscn" id="56_amdeb"]
[ext_resource type="PackedScene" uid="uid://iooa4gqy2uu2" path="res://Scenes/Items/Nuclear_Gun_Pickup.tscn" id="56_iv5wi"]
[ext_resource type="Script" uid="uid://rqtkxuqmo7gi" path="res://Scripts/Resources/ScriptableBullets/ParallelPatternGroup.cs" id="56_vto58"]
[ext_resource type="Resource" uid="uid://bpc2kyft8q2qq" path="res://Resources/Bullets/simple_enemy_bullet_big.tres" id="57_0e6ic"]
[ext_resource type="Script" uid="uid://ca6atry8iniub" path="res://Scripts/AttackPatterns/CreateEmitterPattern.cs" id="58_6khjs"]
[ext_resource type="Script" uid="uid://bgwt0pml2omnf" path="res://Scripts/AttackPatterns/NodeMovementPattern.cs" id="58_rgw1q"]
[ext_resource type="PackedScene" uid="uid://ey71mxa5ocpn" path="res://Scenes/Items/Shield_Extend_Pickup.tscn" id="60_bjd5y"]
[ext_resource type="PackedScene" uid="uid://ck6f08w1fy5fa" path="res://Scenes/Weapons/Bullets/enemyBullet_rice_yellow.tscn" id="60_rgw1q"]
[ext_resource type="Script" uid="uid://dslyrfcej3g2n" path="res://Scripts/Resources/BulletResource.cs" id="61_g20dv"]
@ -88,7 +86,7 @@
script = ExtResource("4_u1i8n")
EggIndex = 0
StartingEquipment = Array[ExtResource("2_g20dv")]([ExtResource("3_6314l")])
RemoveEquipment = Array[ExtResource("2_g20dv")]([])
RemoveEquipment = []
metadata/_custom_type_script = "uid://mja0rk7n2kln"
[sub_resource type="Resource" id="Resource_1tvdd"]
@ -290,63 +288,18 @@ script = ExtResource("39_83jc5")
Patterns = Array[Object]([SubResource("Resource_4mkc6")])
metadata/_custom_type_script = "uid://bngko08ho85p6"
[sub_resource type="Resource" id="Resource_g20dv"]
script = ExtResource("58_rgw1q")
relativeTargetPosition = Vector2(60, 0)
moveDuration = 2.0
EaseType = 0
WaitForCompletion = false
metadata/_custom_type_script = "uid://bgwt0pml2omnf"
[sub_resource type="Resource" id="Resource_tf3yy"]
script = ExtResource("40_o56je")
BulletResource = ExtResource("57_0e6ic")
EmitterOffset = Vector2(0, 0)
bulletCount = 16
rotationSpeed = 0.0
_rotationOffset = 0.0
duration = 3.0
spread = 360.0
burstInterval = 0.5
ShotsPerBurst = 100
BurstRate = 0.0
_targetPlayer = false
_predictPlayer = false
OverrideOwner = false
Owner = 0
OverrideDamageType = false
DamageType = 0
OverrideControllable = false
Controllable = false
OverrideCreationModifier = false
TimeModifiers = Array[ExtResource("50_6khjs")]([])
WaitForCompletion = true
metadata/_custom_type_script = "uid://c0ndqalsc4jve"
[sub_resource type="Resource" id="Resource_56glb"]
script = ExtResource("39_83jc5")
Patterns = Array[Object]([SubResource("Resource_g20dv"), SubResource("Resource_tf3yy")])
metadata/_custom_type_script = "uid://bngko08ho85p6"
[sub_resource type="Resource" id="Resource_w73bs"]
script = ExtResource("58_6khjs")
SpawnOffset = Vector2(-96, 0)
Script = SubResource("Resource_56glb")
Prefab = ExtResource("56_amdeb")
CreateAsChild = false
LifeTime = 10.0
WaitForCompletion = false
metadata/_custom_type_script = "uid://ca6atry8iniub"
[sub_resource type="Resource" id="Resource_6khjs"]
script = ExtResource("39_83jc5")
Patterns = Array[Object]([SubResource("Resource_g20dv"), SubResource("Resource_tf3yy")])
metadata/_custom_type_script = "uid://bngko08ho85p6"
[sub_resource type="Resource" id="Resource_n5tt7"]
script = ExtResource("58_6khjs")
SpawnOffset = Vector2(96, 0)
Script = SubResource("Resource_6khjs")
Prefab = ExtResource("56_amdeb")
CreateAsChild = false
LifeTime = 10.0
@ -370,6 +323,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = []
[sub_resource type="Resource" id="Resource_8qe0x"]
@ -414,6 +368,7 @@ Controllable = false
Freezable = true
Grazeable = true
GrazeValue = 1.0
Attributes = 0
TimeModifiers = []
[sub_resource type="Resource" id="Resource_v4yda"]
@ -478,7 +433,7 @@ TimeModifiers = Array[ExtResource("50_6khjs")]([])
WaitForCompletion = true
metadata/_custom_type_script = "uid://c0ndqalsc4jve"
[sub_resource type="Resource" id="Resource_okvfm"]
[sub_resource type="Resource" id="Resource_6khjs"]
resource_local_to_scene = true
script = ExtResource("39_83jc5")
Patterns = Array[Object]([SubResource("Resource_kuo18")])
@ -812,7 +767,7 @@ InvertSignal = true
[node name="FloorEmitter2" parent="Tilemaps/Actors" instance=ExtResource("44_b8ffn")]
position = Vector2(601, 147)
Script = SubResource("Resource_okvfm")
Script = SubResource("Resource_6khjs")
InvertSignal = true
[node name="Camera" parent="Tilemaps/Actors" instance=ExtResource("48_r562v")]

File diff suppressed because one or more lines are too long

View file

@ -26,6 +26,8 @@ public partial class RogueliteEnemySpawner : Marker2D
}
}
[Export] public bool AutoSpawn { get; set; } = false;
[Export] public int Wave { get; private set; } = 0;
public bool Spawned { get; private set; } = false;
@ -48,32 +50,51 @@ public partial class RogueliteEnemySpawner : Marker2D
QueueRedraw();
}
public EnemyFSMProxy Spawn(RogueliteMapTheme mapTheme)
public override void _Ready()
{
if (Engine.IsEditorHint()) return;
if (!AutoSpawn) return;
Spawn();
}
public EnemyFSMProxy Spawn()
{
if (Engine.IsEditorHint()) return null;
if (Spawned) return _spawnedEnemy;
var enemyScene = GD.Load<PackedScene>(Enemy.PrefabPath);
_spawnedEnemy = this.CreateSibling<EnemyFSMProxy>(enemyScene);
_spawnedEnemy.Init(Enemy);
Spawned = true;
_spawnedEnemy.Death += SpawnedEnemyOnDeath;
return _spawnedEnemy;
}
_spawnedEnemy.OverrideLoot = true;
_spawnedEnemy.ExtraLoot.Add(new LootDrop()
public EnemyFSMProxy Spawn(RogueliteMapTheme mapTheme)
{
if (Engine.IsEditorHint()) return null;
if (Spawned) return _spawnedEnemy;
var spawnedEnemy = Spawn();
spawnedEnemy.OverrideLoot = true;
spawnedEnemy.ExtraLoot.Add(new LootDrop()
{
Item = mapTheme.EnemiesLootTable.Items.ToList().Shuffle().First(),
Chance = mapTheme.EnemyDropChance
});
_spawnedEnemy.ExtraLoot.Add(new LootDrop()
spawnedEnemy.ExtraLoot.Add(new LootDrop()
{
Item = mapTheme.PointItemResource,
Chance = 100
});
Spawned = true;
_spawnedEnemy.Death += SpawnedEnemyOnDeath;
return _spawnedEnemy;
return spawnedEnemy;
}
private void SpawnedEnemyOnDeath(EnemyFSMProxy enemy)

View file

@ -6,6 +6,7 @@ using Godot.Collections;
namespace Cirno.Scripts.AttackPatterns;
[GlobalClass]
[Tool]
public partial class CreateEmitterPattern : AttackPattern
{
[Export] public Vector2 SpawnOffset { get; set; }

View file

@ -4,6 +4,7 @@ using Godot;
namespace Cirno.Scripts.AttackPatterns;
[GlobalClass]
[Tool]
public partial class LaserPattern : SpiralPattern
{
[ExportGroup("Laser")][Export] public float SpawnDelay { get; set; } = 0.3f; // Delay before beam appears

View file

@ -5,6 +5,7 @@ using Godot;
namespace Cirno.Scripts.AttackPatterns;
[GlobalClass]
[Tool]
public partial class MovementPattern : AttackPattern
{
[Export] public Vector2 relativeTargetPosition;

View file

@ -8,6 +8,7 @@ using GTweensGodot.Extensions;
namespace Cirno.Scripts.AttackPatterns;
[GlobalClass]
[Tool]
public partial class NodeMovementPattern : AttackPattern
{
[Export] private Vector2 relativeTargetPosition;

View file

@ -12,6 +12,7 @@ using Array = System.Array;
namespace Cirno.Scripts.AttackPatterns;
[GlobalClass]
[Tool]
public partial class SpiralPattern : AttackPattern
{
[Export] public BulletResource BulletResource { get; set; }

View file

@ -0,0 +1,14 @@
using System;
namespace Cirno.Scripts.Components;
[Flags]
public enum BulletFlags
{
Freezable = 1 << 1,
Controllable = 1 << 2,
Bouncy = 1 << 3,
Piercing = 1 << 4,
Grazeable = 1 << 5,
Rotateable = 1 << 6,
}

View file

@ -0,0 +1 @@
uid://d6fmk6vngnxi

View file

@ -0,0 +1,45 @@
using System.Collections.Generic;
using Cirno.Scripts.Resources;
using Godot;
namespace Cirno.Scripts.Components;
public class BulletInfo(BulletResource originalBulletResource)
{
public BulletResource OriginalBulletResource { get; set; } = originalBulletResource;
public Vector2 Position { get; set; }
public Vector2 Direction { get; set; }
public float Speed { get; set; }
public float LifeTime { get; set; }
public bool DestroyOnCollision { get; set; }
public BulletOwner Owner { get; set; }
public DamageType DamageType { get; set; }
public float Damage { get; set; }
public float Knockback { get; set; }
public int BulletCount { get; set; }
public float RotationSpeed { get; set; }
public float RotationOffset { get; set; }
//public double Time { get; set; }
public float Spread { get; set; }
public bool RotateSprite { get; set; } = false;
public bool Controllabe { get; set; } = false;
public bool Freezable { get; set; } = true;
public PackedScene BulletScene { get; set; }
public PackedScene DestructionParticlesScene { get; set; }
public IBulletModifier Modifier { get; set; }
public List<TimeModifier> TimeModifiers { get; set; } = new List<TimeModifier>();
public bool Grazeable { get; set; }
public float GrazeValue { get; set; }
public BulletFlags Attributes { get; set; }
#region Laser
public bool IsLaser { get; set; }
public float SpawnDelay { get; set; } = 0.3f; // Delay before beam appears
public float PreFireTime { get; set; } = 0.5f; // Time before laser becomes lethal
public float LethalTime { get; set; } = 1.5f; // Time laser remains lethal
public Color PreFireColor { get; set; } = new Color(1, 0, 0, 0.5f); // Thin red beam
public Color LethalColor { get; set; } = new Color(1, 0, 0, 1.0f); // Thicker beam
#endregion
}

View file

@ -0,0 +1 @@
uid://r80khe0f3jj8

View file

@ -1,6 +1,4 @@
using System;
using System.Collections.Generic;
using Cirno.Scripts.Resources;
using Cirno.Scripts.Weapons;
using Godot;
using Godot.Collections;
@ -90,42 +88,4 @@ public partial class BulletSpawner : Node2D
// Vector2 direction = (target - position).Normalized();
// SpawnBullet(position, direction, speed, owner, burstCount, spread: spread, bulletScene: bulletScene, modifier: modifier);
// }
}
public class BulletInfo(BulletResource originalBulletResource)
{
public BulletResource OriginalBulletResource { get; set; } = originalBulletResource;
public Vector2 Position { get; set; }
public Vector2 Direction { get; set; }
public float Speed { get; set; }
public float LifeTime { get; set; }
public bool DestroyOnCollision { get; set; }
public BulletOwner Owner { get; set; }
public DamageType DamageType { get; set; }
public float Damage { get; set; }
public float Knockback { get; set; }
public int BulletCount { get; set; }
public float RotationSpeed { get; set; }
public float RotationOffset { get; set; }
//public double Time { get; set; }
public float Spread { get; set; }
public bool RotateSprite { get; set; } = false;
public bool Controllabe { get; set; } = false;
public bool Freezable { get; set; } = true;
public PackedScene BulletScene { get; set; }
public PackedScene DestructionParticlesScene { get; set; }
public IBulletModifier Modifier { get; set; }
public List<TimeModifier> TimeModifiers { get; set; } = new List<TimeModifier>();
public bool Grazeable { get; set; }
public float GrazeValue { get; set; }
#region Laser
public bool IsLaser { get; set; }
public float SpawnDelay { get; set; } = 0.3f; // Delay before beam appears
public float PreFireTime { get; set; } = 0.5f; // Time before laser becomes lethal
public float LethalTime { get; set; } = 1.5f; // Time laser remains lethal
public Color PreFireColor { get; set; } = new Color(1, 0, 0, 0.5f); // Thin red beam
public Color LethalColor { get; set; } = new Color(1, 0, 0, 1.0f); // Thicker beam
#endregion
}
}

View file

@ -36,6 +36,16 @@ public partial class Shooting : EnemyStateBase
public float CurrentHealth => DamageReceiver.HealthProvider.CurrentResource;
public override void Init(IStateMachine<EnemyState, CharacterBody2D> machine)
{
base.Init(machine);
if (StorageModule.Root.EnemyResource.BossScript is not null)
{
this.BossScript = StorageModule.Root.EnemyResource.BossScript;
}
}
public override void EnterState()
{
base.EnterState();

View file

@ -0,0 +1,16 @@
using Godot;
namespace Cirno.Scripts.Components.FSM.Enemy;
public partial class EnemyFSMAnimatedSprite : AnimatedSprite2D
{
public override void _Ready()
{
var enemyFsmProxy = this.GetParentOrNull<EnemyFSMProxy>();
if (enemyFsmProxy?.EnemyResource?.AnimationFrames != null)
{
this.SpriteFrames = enemyFsmProxy.EnemyResource.AnimationFrames;
}
}
}

View file

@ -0,0 +1 @@
uid://dathhlufbe6gr

View file

@ -27,6 +27,12 @@ public partial class EnemyFSMProxy : CharacterBody2D, IActivable
[Signal] public delegate void DeathEventHandler(EnemyFSMProxy enemy);
public void Init(EnemyResource enemyResource)
{
this.EnemyResource = enemyResource;
}
public void TriggerDeath()
{
EmitSignalDeath(this);

View file

@ -5,6 +5,7 @@ using Godot;
namespace Cirno.Scripts.Resources;
[GlobalClass]
[Tool]
public abstract partial class AttackPattern : Resource
{
//public Node2D Parent;

View file

@ -6,6 +6,7 @@ using Godot.Collections;
namespace Cirno.Scripts.Resources;
[GlobalClass]
[Tool]
public partial class BossPhase : Resource
{
[Export] public string PhaseName = string.Empty;

View file

@ -28,6 +28,8 @@ public partial class BulletResource : Resource
[Export] public bool Grazeable { get; set; } = true;
[Export] public float GrazeValue { get; set; } = 0.2f;
[Export] public BulletFlags Attributes { get; set; }
[Export]
public BulletCreationModifier Modifier;
[Export] public Array<TimeModifier> TimeModifiers;
@ -57,6 +59,7 @@ public partial class BulletResource : Resource
TimeModifiers = TimeModifiers.Select(x => x).ToList(),
Grazeable = Grazeable,
GrazeValue = GrazeValue,
Attributes = Attributes,
// TimeModifiers = TimeModifiers?.Where(mod => mod is TimeModifier).Cast<TimeModifier>().Select(m => new ModifierWrapper()
// {
// TimeModifier = m,

View file

@ -6,6 +6,7 @@ using Godot.Collections;
namespace Cirno.Scripts.Resources;
[GlobalClass]
[Tool]
public partial class BulletScript : Resource
{
[Export]

View file

@ -1,4 +1,5 @@
using Cirno.Scripts.Resources.Loot;
using Cirno.Scripts.Resources.ScriptableBullets;
using Godot;
using Godot.Collections;
@ -33,5 +34,8 @@ public partial class EnemyResource : Resource
[Export] public float ResponseTime { get; private set; } = 0.5f;
[Export] public Texture2D IconSprite { get; private set; }
[Export] public SpriteFrames AnimationFrames { get; private set; }
[Export] public BossScript BossScript { get; private set; }
}

View file

@ -5,6 +5,7 @@ using Godot;
namespace Cirno.Scripts.Resources;
[GlobalClass]
[Tool]
public partial class FSMMovementPattern : AttackPattern
{
[Export] private Vector2 relativeTargetPosition;

View file

@ -7,6 +7,7 @@ using Godot.Collections;
namespace Cirno.Scripts.Resources;
[GlobalClass]
[Tool]
public partial class PatternGroup : AttackPattern
{
[Export] private Array<AttackPattern> patterns;

View file

@ -4,6 +4,7 @@ using Godot.Collections;
namespace Cirno.Scripts.Resources.ScriptableBullets;
[GlobalClass]
[Tool]
public partial class BossScript : Resource
{
[Export]

View file

@ -6,6 +6,7 @@ using Godot.Collections;
namespace Cirno.Scripts.Resources.ScriptableBullets;
[GlobalClass]
[Tool]
public partial class ParallelPatternGroup : AttackPattern
{
[Export(PropertyHint.None, "suffix:s")] public float Duration { get; private set; } = 10f;

View file

@ -5,6 +5,7 @@ using Godot;
namespace Cirno.Scripts.Resources;
[GlobalClass]
[Tool]
public partial class SimpleMovementPattern : AttackPattern
{
[Export] private Vector2 relativeTargetPosition;