mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-11 01:15:53 +00:00
Activable spawners
This commit is contained in:
parent
0b28127970
commit
467fb5be9d
10 changed files with 427 additions and 397 deletions
|
|
@ -62,10 +62,10 @@ public partial class ForceField3D : AnimatableBody3D, IActivable
|
|||
this.Activate();
|
||||
}
|
||||
|
||||
public void _func_godot_apply_properties(Dictionary props)
|
||||
public void _func_godot_apply_properties(Dictionary<string, Variant> props)
|
||||
{
|
||||
TargetName = (string)props["targetname"];
|
||||
StartActive = (bool)props["startenabled"];
|
||||
TargetName = props["targetname"].AsStringName();
|
||||
StartActive = props["startenabled"].AsBool();
|
||||
}
|
||||
|
||||
public override void _Ready()
|
||||
|
|
|
|||
|
|
@ -53,6 +53,8 @@ public partial class EnemyMarker3D : PreviewMarker3D, IActivable
|
|||
|
||||
private EnemyProxy3D _spawnedEnemy;
|
||||
|
||||
[Export] public StringName TargetName { get; set; }
|
||||
|
||||
public void _func_godot_apply_properties(Dictionary<string, Variant> props)
|
||||
{
|
||||
//GroupName = (string)props["targetname"];
|
||||
|
|
@ -69,6 +71,8 @@ public partial class EnemyMarker3D : PreviewMarker3D, IActivable
|
|||
GD.PushWarning($"Spawner {this.Name} has no enemy assigned");
|
||||
}
|
||||
|
||||
TargetName = props["targetname"].AsStringName();
|
||||
|
||||
Billboard = true;
|
||||
//MarkerId = props["id"].AsInt32();
|
||||
}
|
||||
|
|
@ -77,6 +81,11 @@ public partial class EnemyMarker3D : PreviewMarker3D, IActivable
|
|||
{
|
||||
base._Ready();
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(TargetName))
|
||||
{
|
||||
this.AddToGroup(TargetName);
|
||||
}
|
||||
|
||||
if (AutoSpawn)
|
||||
{
|
||||
Spawn(false);
|
||||
|
|
|
|||
|
|
@ -42,6 +42,11 @@ public partial class ScriptableBulletsEmitter3D : Destructible3D, IActivable, IS
|
|||
public override void _Ready()
|
||||
{
|
||||
if (Engine.IsEditorHint()) return;
|
||||
if (Script is null)
|
||||
{
|
||||
GD.PushWarning($"Emitter {Name} has no script assigned");
|
||||
return;
|
||||
}
|
||||
//_scriptInstance = Script.Duplicate(true) as BulletScript;
|
||||
|
||||
if (!string.IsNullOrWhiteSpace(ActivationGroup))
|
||||
|
|
|
|||
|
|
@ -23,7 +23,7 @@ public partial class Idle : EnemyStateBase3D
|
|||
|
||||
// player detection
|
||||
// damage receiver will be a module
|
||||
GD.Print("Entered Idle");
|
||||
//GD.Print("Entered Idle");
|
||||
|
||||
_ = DelayStart();
|
||||
}
|
||||
|
|
|
|||
|
|
@ -29,7 +29,7 @@ public partial class Idle : EnemyStateBase3D
|
|||
|
||||
// player detection
|
||||
// damage receiver will be a module
|
||||
GD.Print("Entered Idle");
|
||||
//GD.Print("Entered Idle");
|
||||
}
|
||||
|
||||
public override void ExitState()
|
||||
|
|
@ -60,7 +60,7 @@ public partial class Idle : EnemyStateBase3D
|
|||
private void PlayerDetectionOnPlayerInRange()
|
||||
{
|
||||
_isPlayerInRange = true;
|
||||
GD.Print("Player In Range");
|
||||
//GD.Print("Player In Range");
|
||||
}
|
||||
|
||||
private void PlayerDetectionOnPlayerOutOfRange()
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ public partial class Shooting : EnemyStateBase3D
|
|||
{
|
||||
base.EnterState();
|
||||
|
||||
GD.Print("Entering Shooting");
|
||||
//GD.Print("Entering Shooting");
|
||||
|
||||
PlayerDetection.PlayerOutOfRange += PlayerDetectionOnPlayerOutOfRange;
|
||||
|
||||
|
|
|
|||
|
|
@ -78,7 +78,7 @@ public partial class Idle : EnemyStateBase
|
|||
private void PlayerDetectionOnPlayerInRange()
|
||||
{
|
||||
_isPlayerInRange = true;
|
||||
GD.Print("Player In Range");
|
||||
//GD.Print("Player In Range");
|
||||
}
|
||||
|
||||
public override void PhysicsProcessState(double delta)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue