shotgun recoil
parent
87c6be6c1c
commit
673bebcabf
|
@ -67,6 +67,11 @@ public partial class ProjectileSpawner : Ranged
|
||||||
|
|
||||||
Vector2 target = Character.Target.Normalized();
|
Vector2 target = Character.Target.Normalized();
|
||||||
|
|
||||||
|
if (CharacterRecoil > 0)
|
||||||
|
{
|
||||||
|
Character.ApplyImpulse(-target * CharacterRecoil);
|
||||||
|
}
|
||||||
|
|
||||||
// avoid unnecessary math if only spawning 1 projectile
|
// avoid unnecessary math if only spawning 1 projectile
|
||||||
if (ProjectileCount == 1)
|
if (ProjectileCount == 1)
|
||||||
{
|
{
|
||||||
|
|
|
@ -4,6 +4,9 @@ namespace SupaLidlGame.Items.Weapons;
|
||||||
|
|
||||||
public abstract partial class Ranged : Weapon
|
public abstract partial class Ranged : Weapon
|
||||||
{
|
{
|
||||||
|
[Export]
|
||||||
|
public float CharacterRecoil { get; set; } = 0;
|
||||||
|
|
||||||
[Export]
|
[Export]
|
||||||
public float AngleDeviation { get; set; }
|
public float AngleDeviation { get; set; }
|
||||||
|
|
||||||
|
|
|
@ -253,6 +253,7 @@ script = ExtResource("1_4xyyt")
|
||||||
Projectile = ExtResource("2_p3wx2")
|
Projectile = ExtResource("2_p3wx2")
|
||||||
ProjectileCount = 3
|
ProjectileCount = 3
|
||||||
ProjectileAngleDeviation = 10.0
|
ProjectileAngleDeviation = 10.0
|
||||||
|
CharacterRecoil = 128.0
|
||||||
StateMachine = NodePath("State")
|
StateMachine = NodePath("State")
|
||||||
Damage = 12.0
|
Damage = 12.0
|
||||||
UseTime = 1.5
|
UseTime = 1.5
|
||||||
|
|
Loading…
Reference in New Issue