Rework projectiles and fix some demon wall attacks

Still working on Demon Wall boss fight overall
This commit is contained in:
2026-03-09 22:05:53 -07:00
parent 2c26d6f548
commit f19cb7edda
81 changed files with 4608 additions and 5365 deletions

View File

@@ -0,0 +1,27 @@
using Chickensoft.AutoInject;
using Chickensoft.Introspection;
using Godot;
using Zennysoft.Game.Ma;
[Meta(typeof(IAutoNode))]
public partial class ProjectileSystem : Node3D
{
public override void _Notification(int what) => this.Notify(what);
[Dependency] protected IMap _map => this.DependOn<IMap>();
[Export] public PackedScene ProjectileScene { get; set; }
[Export] private float _projectileForce { get; set; } = 7f;
public void Fire()
{
var instantiator = new Instantiator(GetTree());
var projectile = instantiator.LoadAndInstantiate<RigidBody3D>(ProjectileScene.ResourcePath);
_map.AddChild(projectile);
projectile.GlobalPosition = GlobalPosition;
projectile.GlobalBasis = GlobalBasis;
projectile.ResetPhysicsInterpolation();
projectile.ApplyCentralImpulse(projectile.GlobalBasis.Z * _projectileForce);
}
}

View File

@@ -0,0 +1 @@
uid://chxka5g7yvcg