summaryrefslogtreecommitdiff
path: root/Weapon.cs
diff options
context:
space:
mode:
Diffstat (limited to 'Weapon.cs')
-rw-r--r--Weapon.cs5
1 files changed, 4 insertions, 1 deletions
diff --git a/Weapon.cs b/Weapon.cs
index 194f907..7957749 100644
--- a/Weapon.cs
+++ b/Weapon.cs
@@ -3,7 +3,8 @@ using Godot;
public partial class Weapon : Node2D
{
[Export] public PackedScene BulletScene { get; set; }
-
+ [Export] public bool PierceEntity { get; set; } = false;
+ [Export] public bool PierceTerrain { get; set; } = false;
// Future-proofing: Different weapons can have different damage multipliers!
[Export] public float DamageMultiplier { get; set; } = 1.0f;
public override void _Process(double delta)
@@ -32,6 +33,8 @@ public partial class Weapon : Node2D
bullet.GlobalPosition = GlobalPosition; // Spawns right where the weapon node is!
bullet.Direction = Vector2.Right.Rotated(GlobalRotation);
bullet.Damage = finalDamage;
+ bullet.PierceEntity = PierceEntity;
+ bullet.PierceTerrain = PierceTerrain;
// 4. Add it to the world
GetTree().Root.AddChild(bullet);