Skip to content
This repository has been archived by the owner on Aug 18, 2020. It is now read-only.

Commit

Permalink
Add initial Scattershock implementation
Browse files Browse the repository at this point in the history
  • Loading branch information
ForLoveOfCats committed Aug 8, 2019
1 parent b4f5bc5 commit 93e39f3
Show file tree
Hide file tree
Showing 10 changed files with 494 additions and 1 deletion.
11 changes: 10 additions & 1 deletion Items/Items.cs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ public static implicit operator ID(CustomItemEnum ItemEnum)
}


public enum ID {ERROR, PLATFORM, WALL, SLOPE, TRIANGLE_WALL, ROCKET_JUMPER, THUNDERBOLT}
public enum ID {ERROR, PLATFORM, WALL, SLOPE, TRIANGLE_WALL, ROCKET_JUMPER, THUNDERBOLT, SCATTERSHOCK}

public static Dictionary<ID, Mesh> Meshes = new Dictionary<ID, Mesh>();
public static Dictionary<ID, Texture> Thumbnails = new Dictionary<ID, Texture>();
Expand Down Expand Up @@ -214,6 +214,15 @@ public static void SetupItems()
UseDelegate = Thunderbolt.Fire,
CanAds = true
}
},

{
ID.SCATTERSHOCK,

new IdInfo {
UseDelegate = Scattershock.Fire,
CanAds = true
}
}
};

Expand Down
36 changes: 36 additions & 0 deletions Items/Logic/Hitscan/Scattershock.cs
Original file line number Diff line number Diff line change
@@ -0,0 +1,36 @@
using Godot;


public static class Scattershock
{
public static float VerticalRecoil = 22;
public static float RecoilLength = 4;
public static float Range = 500;
public static float AngularOffset = 2f;
public static float HeadshotDamage = 30;
public static float BodyshotDamage = 25;
public static float LegshotDamage = 10;
public static float FireCooldown = 55;

public static void Fire(Items.Instance Item, Player UsingPlayer)
{
{
float Multiplyer = 1;
if(Game.PossessedPlayer.Ads)
Multiplyer = Game.PossessedPlayer.AdsMultiplyer;

for(int x = -1; x <= 1; x++)
{
for(int y = -1; y <= 1; y++)
{
Hitscan.Fire(x*AngularOffset*Multiplyer, y*AngularOffset*Multiplyer, Range, HeadshotDamage, BodyshotDamage, LegshotDamage);
}
}
}

Hitscan.ApplyAdditiveRecoil(VerticalRecoil, RecoilLength);

UsingPlayer.SetCooldown(0, FireCooldown, true);
UsingPlayer.SfxManager.FpThunderboltFire(); //TODO: Add scattershock fire sfx
}
}
Loading

0 comments on commit 93e39f3

Please sign in to comment.