mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-01 08:55:35 +00:00
Enemy debris
This commit is contained in:
parent
54b4d94491
commit
0293291315
19 changed files with 175 additions and 27 deletions
File diff suppressed because one or more lines are too long
|
|
@ -67,7 +67,7 @@ script = ExtResource("16_e2nai")
|
|||
physics_interpolation_mode = 1
|
||||
transform = Transform3D(0.70710677, -0.49999994, 0.5, 0, 0.7071068, 0.7071067, -0.70710677, -0.49999994, 0.5, 83.9836, 7.935, -24.00831)
|
||||
projection = 1
|
||||
size = 7.537
|
||||
size = 8.0
|
||||
script = ExtResource("1_g4gcm")
|
||||
MaxAimOffsetDistance = 16.0
|
||||
CameraOffset = Vector3(8, 12, 8)
|
||||
|
|
|
|||
|
|
@ -7,18 +7,9 @@
|
|||
script = ExtResource("2_2eq50")
|
||||
BulletScene = ExtResource("1_ru0fo")
|
||||
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
|
||||
Attributes = 16
|
||||
TimeModifiers = []
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[gd_resource type="Resource" script_class="EnemyResource" load_steps=17 format=3 uid="uid://4qxicyti4hwr"]
|
||||
[gd_resource type="Resource" script_class="EnemyResource" load_steps=19 format=3 uid="uid://4qxicyti4hwr"]
|
||||
|
||||
[ext_resource type="SpriteFrames" uid="uid://chjsokgyo0e33" path="res://Resources/Sprites/base_fairy.tres" id="1_gbbb4"]
|
||||
[ext_resource type="Texture2D" uid="uid://xgxxdq37pykh" path="res://Sprites/Actors/Fairy.png" id="1_ihub2"]
|
||||
[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="2_gbbb4"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://bhpipyiuydlul" path="res://Resources/Sprites/Fairy_Base_Dead.tres" id="2_oni0r"]
|
||||
[ext_resource type="Resource" uid="uid://ct1fa2huvy34n" path="res://Resources/Items/Ammo1.tres" id="3_6fuej"]
|
||||
[ext_resource type="PackedScene" uid="uid://l7a5p3vfsbn0" path="res://Scenes/Actors/Generic_Enemy_Debris_3D.tscn" id="3_kno8n"]
|
||||
[ext_resource type="Resource" uid="uid://dy53gia1tmkah" path="res://Resources/Items/Points_Pickup.tres" id="4_oni0r"]
|
||||
[ext_resource type="Resource" uid="uid://bhbufxodybsw4" path="res://Resources/Items/Shield_Pickup.tres" id="5_kno8n"]
|
||||
[ext_resource type="Resource" uid="uid://dodwpect0ldjf" path="res://Resources/Items/Heart_Pickup.tres" id="6_jnpnu"]
|
||||
|
|
@ -63,4 +65,6 @@ MaxStrafeDistance = 1.0
|
|||
MinStrafeDistance = 0.2
|
||||
IconSprite = SubResource("AtlasTexture_ppsgt")
|
||||
AnimationFrames = ExtResource("1_gbbb4")
|
||||
DebrisScene = ExtResource("3_kno8n")
|
||||
DeathAnimation = ExtResource("2_oni0r")
|
||||
metadata/_custom_type_script = "uid://cd5o0ceb50jki"
|
||||
|
|
|
|||
|
|
@ -1,9 +1,11 @@
|
|||
[gd_resource type="Resource" script_class="EnemyResource" load_steps=17 format=3 uid="uid://c48vva6qw2h12"]
|
||||
[gd_resource type="Resource" script_class="EnemyResource" load_steps=19 format=3 uid="uid://c48vva6qw2h12"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://callpd48wwnlw" path="res://Sprites/Actors/Fairy_Special.png" id="1_0afqr"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://cnl6ju3qlr2bj" path="res://Resources/Sprites/base_fairy_special.tres" id="1_6r34r"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://bhpipyiuydlul" path="res://Resources/Sprites/Fairy_Base_Dead.tres" id="2_1l422"]
|
||||
[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="2_6r34r"]
|
||||
[ext_resource type="Resource" uid="uid://ct1fa2huvy34n" path="res://Resources/Items/Ammo1.tres" id="3_dkgyx"]
|
||||
[ext_resource type="PackedScene" uid="uid://l7a5p3vfsbn0" path="res://Scenes/Actors/Generic_Enemy_Debris_3D.tscn" id="3_fanfp"]
|
||||
[ext_resource type="Resource" uid="uid://dy53gia1tmkah" path="res://Resources/Items/Points_Pickup.tres" id="4_1l422"]
|
||||
[ext_resource type="Resource" uid="uid://bhbufxodybsw4" path="res://Resources/Items/Shield_Pickup.tres" id="5_fanfp"]
|
||||
[ext_resource type="Resource" uid="uid://dodwpect0ldjf" path="res://Resources/Items/Heart_Pickup.tres" id="6_y2gca"]
|
||||
|
|
@ -63,4 +65,6 @@ MaxStrafeDistance = 1.0
|
|||
MinStrafeDistance = 0.2
|
||||
IconSprite = SubResource("AtlasTexture_c0hok")
|
||||
AnimationFrames = ExtResource("1_6r34r")
|
||||
DebrisScene = ExtResource("3_fanfp")
|
||||
DeathAnimation = ExtResource("2_1l422")
|
||||
metadata/_custom_type_script = "uid://cd5o0ceb50jki"
|
||||
|
|
|
|||
|
|
@ -1,8 +1,10 @@
|
|||
[gd_resource type="Resource" script_class="EnemyResource" load_steps=17 format=3 uid="uid://ccym6mcq4fbul"]
|
||||
[gd_resource type="Resource" script_class="EnemyResource" load_steps=19 format=3 uid="uid://ccym6mcq4fbul"]
|
||||
|
||||
[ext_resource type="SpriteFrames" uid="uid://ch2ll1on8im2p" path="res://Resources/Sprites/FairyGuard.tres" id="1_b2551"]
|
||||
[ext_resource type="Texture2D" uid="uid://xhwfgbv0fjbr" path="res://Sprites/Actors/FairyGuard.png" id="2_c6xyh"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://xiirmmgfsya6" path="res://Resources/Sprites/Fairy_Guard_Dead.tres" id="2_juf1x"]
|
||||
[ext_resource type="Script" uid="uid://cq65aed620ijo" path="res://Scripts/Resources/Loot/LootDrop.cs" id="3_juf1x"]
|
||||
[ext_resource type="PackedScene" uid="uid://l7a5p3vfsbn0" path="res://Scenes/Actors/Generic_Enemy_Debris_3D.tscn" id="3_m2lqx"]
|
||||
[ext_resource type="Resource" uid="uid://ct1fa2huvy34n" path="res://Resources/Items/Ammo1.tres" id="4_m2lqx"]
|
||||
[ext_resource type="Resource" uid="uid://dy53gia1tmkah" path="res://Resources/Items/Points_Pickup.tres" id="5_80clb"]
|
||||
[ext_resource type="Resource" uid="uid://bhbufxodybsw4" path="res://Resources/Items/Shield_Pickup.tres" id="6_ili73"]
|
||||
|
|
@ -63,4 +65,6 @@ MaxStrafeDistance = 1.0
|
|||
MinStrafeDistance = 0.2
|
||||
IconSprite = SubResource("AtlasTexture_n54y5")
|
||||
AnimationFrames = ExtResource("1_b2551")
|
||||
DebrisScene = ExtResource("3_m2lqx")
|
||||
DeathAnimation = ExtResource("2_juf1x")
|
||||
metadata/_custom_type_script = "uid://cd5o0ceb50jki"
|
||||
|
|
|
|||
18
Resources/Sprites/Fairy_Base_Dead.tres
Normal file
18
Resources/Sprites/Fairy_Base_Dead.tres
Normal file
|
|
@ -0,0 +1,18 @@
|
|||
[gd_resource type="SpriteFrames" load_steps=3 format=3 uid="uid://bhpipyiuydlul"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://cpyt4ipdi4c4k" path="res://Sprites/Actors/Fairy_Dead.png" id="1_u2u64"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_y2gca"]
|
||||
atlas = ExtResource("1_u2u64")
|
||||
region = Rect2(0, 0, 16, 16)
|
||||
|
||||
[resource]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_y2gca")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
25
Resources/Sprites/Fairy_Guard_Dead.tres
Normal file
25
Resources/Sprites/Fairy_Guard_Dead.tres
Normal file
|
|
@ -0,0 +1,25 @@
|
|||
[gd_resource type="SpriteFrames" load_steps=4 format=3 uid="uid://xiirmmgfsya6"]
|
||||
|
||||
[ext_resource type="Texture2D" uid="uid://xhwfgbv0fjbr" path="res://Sprites/Actors/FairyGuard.png" id="1_3gu4u"]
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_jnpnu"]
|
||||
atlas = ExtResource("1_3gu4u")
|
||||
region = Rect2(0, 64, 16, 16)
|
||||
|
||||
[sub_resource type="AtlasTexture" id="AtlasTexture_rx5mb"]
|
||||
atlas = ExtResource("1_3gu4u")
|
||||
region = Rect2(16, 64, 16, 16)
|
||||
|
||||
[resource]
|
||||
animations = [{
|
||||
"frames": [{
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_jnpnu")
|
||||
}, {
|
||||
"duration": 1.0,
|
||||
"texture": SubResource("AtlasTexture_rx5mb")
|
||||
}],
|
||||
"loop": true,
|
||||
"name": &"default",
|
||||
"speed": 5.0
|
||||
}]
|
||||
|
|
@ -7,16 +7,7 @@
|
|||
script = ExtResource("2_6m4qy")
|
||||
Name = &"Enemy weapon with big bullets"
|
||||
BulletData = ExtResource("1_itg3a")
|
||||
Priority = 0
|
||||
AmmoPerShot = 1
|
||||
RateOfFire = 0.6
|
||||
BulletCapacity = 4
|
||||
ReloadTime = 1.0
|
||||
AutoReload = true
|
||||
InfiniteAmmo = true
|
||||
ItemKey = &""
|
||||
AmmoKey = &""
|
||||
BulletsPerShot = 1
|
||||
SpreadAngle = 0.0
|
||||
RandomSpread = 0.0
|
||||
_rotationOffset = 0.0
|
||||
|
|
|
|||
14
Scenes/Actors/Generic_Enemy_Debris_3D.tscn
Normal file
14
Scenes/Actors/Generic_Enemy_Debris_3D.tscn
Normal file
|
|
@ -0,0 +1,14 @@
|
|||
[gd_scene load_steps=3 format=3 uid="uid://l7a5p3vfsbn0"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cd2j7yiat8uuh" path="res://Scripts/Actors/DeathDebris3D.cs" id="1_k3yjv"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://xiirmmgfsya6" path="res://Resources/Sprites/Fairy_Guard_Dead.tres" id="2_is4qt"]
|
||||
|
||||
[node name="GenericEnemyDebris" type="Node3D" node_paths=PackedStringArray("Sprite")]
|
||||
script = ExtResource("1_k3yjv")
|
||||
Sprite = NodePath("AnimatedSprite3D")
|
||||
|
||||
[node name="AnimatedSprite3D" type="AnimatedSprite3D" parent="."]
|
||||
transform = Transform3D(0.70710677, -0.49999997, 0.49999997, 0, 0.70710677, 0.70710677, -0.70710677, -0.49999997, 0.49999997, 0, 0, 0)
|
||||
pixel_size = 0.05
|
||||
texture_filter = 0
|
||||
sprite_frames = ExtResource("2_is4qt")
|
||||
|
|
@ -1,7 +1,8 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://cmd3j4xc2f287"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://cmd3j4xc2f287"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cg6y36s7buapp" path="res://Scripts/Weapons/Bullet3D.cs" id="1_l2l87"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://lh1q76788ixw" path="res://Resources/Sprites/explosion_proc_1.tres" id="3_rmbhq"]
|
||||
[ext_resource type="AudioStream" uid="uid://ds84e0m5l4i5d" path="res://SFX/404752__owlstorm__retro-video-game-sfx-explode-3.wav" id="4_32284"]
|
||||
[ext_resource type="Script" uid="uid://cvk4jbit45sfi" path="res://Scripts/Components/Actors/PooledAnimatedSpritePlayer3D.cs" id="4_ny3mn"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_pklkt"]
|
||||
|
|
@ -27,7 +28,12 @@ sprite_frames = ExtResource("3_rmbhq")
|
|||
autoplay = "default"
|
||||
script = ExtResource("4_ny3mn")
|
||||
|
||||
[node name="ExplosionSound" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("4_32284")
|
||||
bus = &"Effects"
|
||||
|
||||
[connection signal="Initialized" from="." to="AnimatedSprite3D" method="PlayAnimation"]
|
||||
[connection signal="Initialized" from="." to="ExplosionSound" method="play"]
|
||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
[connection signal="screen_exited" from="VisibleOnScreenNotifier" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"]
|
||||
|
|
|
|||
|
|
@ -1,8 +1,9 @@
|
|||
[gd_scene load_steps=5 format=3 uid="uid://bu464cgcdnihv"]
|
||||
[gd_scene load_steps=6 format=3 uid="uid://bu464cgcdnihv"]
|
||||
|
||||
[ext_resource type="Script" uid="uid://cg6y36s7buapp" path="res://Scripts/Weapons/Bullet3D.cs" id="1_uud1m"]
|
||||
[ext_resource type="SpriteFrames" uid="uid://lh1q76788ixw" path="res://Resources/Sprites/explosion_proc_1.tres" id="3_qsphx"]
|
||||
[ext_resource type="Script" uid="uid://cvk4jbit45sfi" path="res://Scripts/Components/Actors/PooledAnimatedSpritePlayer3D.cs" id="4_5oowj"]
|
||||
[ext_resource type="AudioStream" uid="uid://ds84e0m5l4i5d" path="res://SFX/404752__owlstorm__retro-video-game-sfx-explode-3.wav" id="4_uud1m"]
|
||||
|
||||
[sub_resource type="SphereShape3D" id="SphereShape3D_pklkt"]
|
||||
radius = 2.00402
|
||||
|
|
@ -27,7 +28,13 @@ sprite_frames = ExtResource("3_qsphx")
|
|||
autoplay = "default"
|
||||
script = ExtResource("4_5oowj")
|
||||
|
||||
[node name="ExplosionSound" type="AudioStreamPlayer3D" parent="."]
|
||||
stream = ExtResource("4_uud1m")
|
||||
volume_db = -8.23
|
||||
bus = &"Effects"
|
||||
|
||||
[connection signal="Initialized" from="." to="AnimatedSprite3D" method="PlayAnimation"]
|
||||
[connection signal="Initialized" from="." to="ExplosionSound" method="play"]
|
||||
[connection signal="area_entered" from="." to="." method="_on_area_entered"]
|
||||
[connection signal="body_entered" from="." to="." method="_on_body_entered"]
|
||||
[connection signal="screen_exited" from="VisibleOnScreenNotifier" to="." method="_on_visible_on_screen_notifier_2d_screen_exited"]
|
||||
|
|
|
|||
22
Scripts/Actors/DeathDebris3D.cs
Normal file
22
Scripts/Actors/DeathDebris3D.cs
Normal file
|
|
@ -0,0 +1,22 @@
|
|||
using Cirno.Scripts.Resources;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Actors;
|
||||
|
||||
public partial class DeathDebris3D : Node3D
|
||||
{
|
||||
[Export] public EnemyResource EnemyResource { get; private set; }
|
||||
[Export] public AnimatedSprite3D Sprite { get; private set; }
|
||||
|
||||
public void Init(EnemyResource enemyResource)
|
||||
{
|
||||
EnemyResource = enemyResource;
|
||||
|
||||
if (EnemyResource.DeathAnimation is not null)
|
||||
{
|
||||
Sprite.SetSpriteFrames(enemyResource.DeathAnimation);
|
||||
}
|
||||
|
||||
Sprite.Play();
|
||||
}
|
||||
}
|
||||
1
Scripts/Actors/DeathDebris3D.cs.uid
Normal file
1
Scripts/Actors/DeathDebris3D.cs.uid
Normal file
|
|
@ -0,0 +1 @@
|
|||
uid://cd2j7yiat8uuh
|
||||
|
|
@ -1,4 +1,5 @@
|
|||
using Cirno.Scripts.Enums;
|
||||
using Cirno.Scripts.Actors;
|
||||
using Cirno.Scripts.Enums;
|
||||
using Godot;
|
||||
|
||||
namespace Cirno.Scripts.Components.FSM.Enemy._3D;
|
||||
|
|
@ -15,5 +16,15 @@ public partial class Dead : EnemyStateBase3D
|
|||
// player detection
|
||||
// damage receiver will be a module
|
||||
MainObject.Hide();
|
||||
if (Storage.EnemyData.DebrisScene is not null)
|
||||
{
|
||||
var debris = Storage.EnemyData.DebrisScene.Instantiate<DeathDebris3D>();
|
||||
MainObject.GetParent().AddChild(debris);
|
||||
debris.GlobalPosition = MainObject.GlobalPosition;
|
||||
debris.Init(Storage.EnemyData);
|
||||
}
|
||||
|
||||
|
||||
MainObject.QueueFree();
|
||||
}
|
||||
}
|
||||
|
|
@ -33,9 +33,13 @@ public partial class EnemyResource : Resource
|
|||
/// </summary>
|
||||
[Export] public float ResponseTime { get; private set; } = 0.5f;
|
||||
|
||||
[ExportCategory("Graphics")]
|
||||
[Export] public Texture2D IconSprite { get; private set; }
|
||||
[Export] public SpriteFrames AnimationFrames { get; private set; }
|
||||
|
||||
[Export] public PackedScene DebrisScene { get; private set; }
|
||||
[Export] public SpriteFrames DeathAnimation { get; private set; }
|
||||
[ExportCategory("Scripts")]
|
||||
[Export] public BossScript BossScript { get; private set; }
|
||||
|
||||
}
|
||||
BIN
Sprites/Actors/Fairy_Dead.aseprite
(Stored with Git LFS)
Normal file
BIN
Sprites/Actors/Fairy_Dead.aseprite
(Stored with Git LFS)
Normal file
Binary file not shown.
BIN
Sprites/Actors/Fairy_Dead.png
(Stored with Git LFS)
Normal file
BIN
Sprites/Actors/Fairy_Dead.png
(Stored with Git LFS)
Normal file
Binary file not shown.
40
Sprites/Actors/Fairy_Dead.png.import
Normal file
40
Sprites/Actors/Fairy_Dead.png.import
Normal file
|
|
@ -0,0 +1,40 @@
|
|||
[remap]
|
||||
|
||||
importer="texture"
|
||||
type="CompressedTexture2D"
|
||||
uid="uid://cpyt4ipdi4c4k"
|
||||
path="res://.godot/imported/Fairy_Dead.png-107dc9b6d905ca6ddf224c8d18db1f20.ctex"
|
||||
metadata={
|
||||
"vram_texture": false
|
||||
}
|
||||
|
||||
[deps]
|
||||
|
||||
source_file="res://Sprites/Actors/Fairy_Dead.png"
|
||||
dest_files=["res://.godot/imported/Fairy_Dead.png-107dc9b6d905ca6ddf224c8d18db1f20.ctex"]
|
||||
|
||||
[params]
|
||||
|
||||
compress/mode=3
|
||||
compress/high_quality=false
|
||||
compress/lossy_quality=0.7
|
||||
compress/uastc_level=0
|
||||
compress/rdo_quality_loss=0.0
|
||||
compress/hdr_compression=1
|
||||
compress/normal_map=0
|
||||
compress/channel_pack=0
|
||||
mipmaps/generate=true
|
||||
mipmaps/limit=-1
|
||||
roughness/mode=0
|
||||
roughness/src_normal=""
|
||||
process/channel_remap/red=0
|
||||
process/channel_remap/green=1
|
||||
process/channel_remap/blue=2
|
||||
process/channel_remap/alpha=3
|
||||
process/fix_alpha_border=true
|
||||
process/premult_alpha=false
|
||||
process/normal_map_invert_y=false
|
||||
process/hdr_as_srgb=false
|
||||
process/hdr_clamp_exposure=false
|
||||
process/size_limit=0
|
||||
detect_3d/compress_to=0
|
||||
Loading…
Add table
Add a link
Reference in a new issue