mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-21 22:03:47 +00:00
Teleport spawner tweaks
This commit is contained in:
parent
57cd2d797b
commit
2ba95ee922
5 changed files with 53 additions and 16 deletions
|
|
@ -7,13 +7,13 @@
|
||||||
script = ExtResource("2_8ycgt")
|
script = ExtResource("2_8ycgt")
|
||||||
Name = "Enemy Weapon"
|
Name = "Enemy Weapon"
|
||||||
BulletData = ExtResource("1_eps1c")
|
BulletData = ExtResource("1_eps1c")
|
||||||
RateOfFire = 0.4
|
RateOfFire = 0.3
|
||||||
BulletCapacity = 4
|
BulletCapacity = 4
|
||||||
ReloadTime = 1.0
|
ReloadTime = 1.0
|
||||||
AutoReload = true
|
AutoReload = true
|
||||||
InfiniteAmmo = true
|
InfiniteAmmo = true
|
||||||
BulletsPerShot = 5
|
BulletsPerShot = 1
|
||||||
SpreadAngle = 180.0
|
SpreadAngle = 0.0
|
||||||
RandomSpread = 0.0
|
RandomSpread = 0.0
|
||||||
ItemKey = "EnemyWeapon"
|
ItemKey = "EnemyWeapon"
|
||||||
AmmoKey = ""
|
AmmoKey = ""
|
||||||
|
|
|
||||||
|
|
@ -60,6 +60,7 @@ collision_layer = 16
|
||||||
collision_mask = 113
|
collision_mask = 113
|
||||||
script = ExtResource("1_ugrra")
|
script = ExtResource("1_ugrra")
|
||||||
MovementSpeed = 30.0
|
MovementSpeed = 30.0
|
||||||
|
Health = 2.0
|
||||||
|
|
||||||
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
[node name="AnimatedSprite2D" type="AnimatedSprite2D" parent="."]
|
||||||
sprite_frames = ExtResource("2_i2plx")
|
sprite_frames = ExtResource("2_i2plx")
|
||||||
|
|
@ -134,7 +135,7 @@ script = ExtResource("15_17yce")
|
||||||
|
|
||||||
[node name="LootDrops" type="Node2D" parent="."]
|
[node name="LootDrops" type="Node2D" parent="."]
|
||||||
script = ExtResource("16_76vwd")
|
script = ExtResource("16_76vwd")
|
||||||
LootDrops = Array[ExtResource("17_gsthm")]([SubResource("Resource_lh4qp"), SubResource("Resource_fmqd5"), SubResource("Resource_gry1a"), SubResource("Resource_6b6qx")])
|
LootDrops = [SubResource("Resource_lh4qp"), SubResource("Resource_fmqd5"), SubResource("Resource_gry1a"), SubResource("Resource_6b6qx")]
|
||||||
|
|
||||||
[connection signal="area_entered" from="PlayerDetection" to="PlayerDetection" method="_on_area_entered"]
|
[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_exited" from="PlayerDetection" to="PlayerDetection" method="_on_area_exited"]
|
||||||
|
|
|
||||||
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
|
|
@ -1,4 +1,5 @@
|
||||||
using Cirno.Scripts.Activables;
|
using System.Threading.Tasks;
|
||||||
|
using Cirno.Scripts.Activables;
|
||||||
using Godot;
|
using Godot;
|
||||||
|
|
||||||
namespace Cirno.Scripts.Actors;
|
namespace Cirno.Scripts.Actors;
|
||||||
|
|
@ -13,6 +14,8 @@ public partial class AlarmTeleporterActorSpawner : ActorSpawner
|
||||||
[Export]
|
[Export]
|
||||||
public float ActivationRange { get; private set; }
|
public float ActivationRange { get; private set; }
|
||||||
|
|
||||||
|
[Export] public float ActivationDelay { get; private set; } = 2f;
|
||||||
|
|
||||||
public override void _Ready()
|
public override void _Ready()
|
||||||
{
|
{
|
||||||
_alarmManager = this.GetAlarmManager();
|
_alarmManager = this.GetAlarmManager();
|
||||||
|
|
@ -22,6 +25,13 @@ public partial class AlarmTeleporterActorSpawner : ActorSpawner
|
||||||
private void AlarmManagerOnAlarmEnabled(Vector2 location)
|
private void AlarmManagerOnAlarmEnabled(Vector2 location)
|
||||||
{
|
{
|
||||||
if (!(location.DistanceTo(this.GlobalPosition) <= ActivationRange)) return;
|
if (!(location.DistanceTo(this.GlobalPosition) <= ActivationRange)) return;
|
||||||
|
|
||||||
|
_ = DelaySpawn();
|
||||||
|
}
|
||||||
|
|
||||||
|
private async Task DelaySpawn()
|
||||||
|
{
|
||||||
|
await Task.Delay((int)(1000 * ActivationDelay));
|
||||||
Teleporter?.FireParticles();
|
Teleporter?.FireParticles();
|
||||||
Spawn();
|
Spawn();
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue