mirror of
https://gitlab.com/MaddoScientisto/cirnogodot.git
synced 2026-06-04 12:05:54 +00:00
Trenchbroom support for health and destruction
This commit is contained in:
parent
e23d337a16
commit
823886b4ce
19 changed files with 2064 additions and 1398 deletions
|
|
@ -1,4 +1,5 @@
|
|||
using Cirno.Scripts.AttackPatterns;
|
||||
using System;
|
||||
using Cirno.Scripts.AttackPatterns;
|
||||
using Cirno.Scripts.Resources;
|
||||
using Cirno.Scripts.Resources.BulletScripts;
|
||||
using Godot;
|
||||
|
|
@ -7,7 +8,7 @@ using Godot.Collections;
|
|||
namespace Cirno.Scripts.Actors;
|
||||
|
||||
[Tool]
|
||||
public partial class ScriptableBulletsEmitter3D : Node3D, IActivable, IScriptHost3D
|
||||
public partial class ScriptableBulletsEmitter3D : Destructible3D, IActivable, IScriptHost3D
|
||||
{
|
||||
public Node3D ParentObject => this;
|
||||
|
||||
|
|
@ -21,6 +22,13 @@ public partial class ScriptableBulletsEmitter3D : Node3D, IActivable, IScriptHos
|
|||
|
||||
[Export]
|
||||
public bool EmitOnStart { get; set; } = false;
|
||||
|
||||
// [Export] public bool Indestructible { get; private set; } = false;
|
||||
// [Export] public float Health = 1f;
|
||||
//
|
||||
// [Export] public BulletResource ExplosionData { get; set; }
|
||||
// [Export] public BulletOwner BulletGroup { get; set; } = BulletOwner.None;
|
||||
// [Export] public Array<DamageResistance> DamageResistances { get; set; } = [];
|
||||
|
||||
[Signal]
|
||||
public delegate void StateChangedEventHandler(bool isEmitting);
|
||||
|
|
@ -53,17 +61,26 @@ public partial class ScriptableBulletsEmitter3D : Node3D, IActivable, IScriptHos
|
|||
EmitSignal(SignalName.StateChanged, _isActive);
|
||||
}
|
||||
|
||||
public virtual void _func_godot_apply_properties(Dictionary<string, Variant> props)
|
||||
public override void _func_godot_apply_properties(Dictionary<string, Variant> props)
|
||||
{
|
||||
ActivationGroup = props["targetname"].AsString();
|
||||
|
||||
var scriptPath = props["script_path"].AsString();
|
||||
Script = GD.Load<BulletScript3D>(scriptPath);
|
||||
if (!string.IsNullOrWhiteSpace(scriptPath))
|
||||
{
|
||||
Script = GD.Load<BulletScript3D>(scriptPath);
|
||||
}
|
||||
else
|
||||
{
|
||||
GD.PushWarning("Emitter has no script assigned");
|
||||
}
|
||||
|
||||
|
||||
EmitOnStart = props["emit_on_start"].AsBool();
|
||||
InvertSignal = props["invert_signal"].AsBool();
|
||||
//TargetFunc = props["targetfunc"];
|
||||
//TargetName = props["targetname"];
|
||||
SetProperties(props);
|
||||
}
|
||||
|
||||
public bool Activate(ActivationType activationType = ActivationType.Toggle)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue