diff --git a/DungeonShooting_Godot/prefab/effect/Blood.tscn b/DungeonShooting_Godot/prefab/effect/Blood.tscn index 88930aa9..76d93313 100644 --- a/DungeonShooting_Godot/prefab/effect/Blood.tscn +++ b/DungeonShooting_Godot/prefab/effect/Blood.tscn @@ -1,19 +1,13 @@ -[gd_scene load_steps=3 format=3] +[gd_scene load_steps=3 format=3 uid="uid://dmjlddmt2h1pa"] [ext_resource type="Texture2D" uid="uid://cgptnp74ive4r" path="res://resource/sprite/common/Circle.png" id="1"] [ext_resource type="Script" path="res://src/game/effects/Blood.cs" id="2"] - - [node name="Blood" type="CPUParticles2D"] z_index = -5 lifetime = 0.2 explosiveness = 0.9 -texture = ExtResource( 1 ) -gravity = Vector2( 0, 0 ) -initial_velocity = 150.0 -initial_velocity_random = 1.0 -scale_amount = 0.15 -scale_amount_random = 0.4 -color = Color( 0.627451, 0.0705882, 0.0705882, 0.705882 ) -script = ExtResource( 2 ) +texture = ExtResource("1") +gravity = Vector2(0, 0) +color = Color(0.627451, 0.0705882, 0.0705882, 0.705882) +script = ExtResource("2") diff --git a/DungeonShooting_Godot/scene/Hall.tscn b/DungeonShooting_Godot/scene/Hall.tscn index 920b9e59..263a5acb 100644 --- a/DungeonShooting_Godot/scene/Hall.tscn +++ b/DungeonShooting_Godot/scene/Hall.tscn @@ -86,7 +86,7 @@ metadata/_edit_group_ = true [node name="BirthMark" type="Marker2D" parent="." index="3"] z_as_relative = false -position = Vector2(535, 180) +position = Vector2(502, 214) [node name="DungeonEntrance" type="Area2D" parent="." index="4"] z_index = 15 diff --git a/DungeonShooting_Godot/src/game/activity/role/ai/AiRole.cs b/DungeonShooting_Godot/src/game/activity/role/ai/AiRole.cs index bbbd45fe..8a0738ce 100644 --- a/DungeonShooting_Godot/src/game/activity/role/ai/AiRole.cs +++ b/DungeonShooting_Godot/src/game/activity/role/ai/AiRole.cs @@ -369,7 +369,17 @@ public abstract partial class AiRole : Role AffiliationArea.RoomInfo.MarkTargetPosition[LookTarget.Id] = LookTarget.Position; } } - + + protected override void OnDie() + { + //扔掉所有武器 + ThrowAllWeapon(); + //创建金币 + Gold.CreateGold(Position, RoleState.Gold); + //销毁 + Destroy(); + } + // private void OnVelocityComputed(Vector2 velocity) // { // if (Mathf.Abs(velocity.X) >= 0.01f && Mathf.Abs(velocity.Y) >= 0.01f) diff --git a/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs b/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs index b18d1e3a..14c0bc57 100644 --- a/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs +++ b/DungeonShooting_Godot/src/game/activity/role/enemy/Enemy.cs @@ -110,9 +110,6 @@ public partial class Enemy : AiRole protected override void OnDie() { - //扔掉所有武器 - ThrowAllWeapon(); - var effPos = Position + new Vector2(0, -Altitude); //血液特效 var blood = ObjectManager.GetPoolItem(ResourcePath.prefab_effect_enemy_EnemyBlood0001_tscn); @@ -130,13 +127,10 @@ public partial class Enemy : AiRole debris.MoveController.AddForce(Velocity + realVelocity); } - //创建金币 - Gold.CreateGold(Position, RoleState.Gold); - //派发敌人死亡信号 EventManager.EmitEvent(EventEnum.OnEnemyDie, this); - Destroy(); - + + base.OnDie(); } protected override void Process(float delta)