Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ public override bool SetFPSWeapon(FPSWeapon target)
target.MetalType = MetalTypes.None;
target.DrawWeaponSound = SoundClips.None;
target.SwingWeaponSound = SoundClips.SwingHighPitch;
target.Reach = WeaponManager.defaultWeaponReach;
target.Reach = GameManager.Instance.WeaponManager.WeaponReach;
return true;
}

Expand Down
19 changes: 18 additions & 1 deletion Assets/Scripts/Game/WeaponManager.cs
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,23 @@ public class WeaponManager : MonoBehaviour
const float defaultBowReach = 50f;
public const float defaultWeaponReach = 2.25f;

float weaponReachOverride = 0;
public float WeaponReach
{
get
{
if (weaponReachOverride > 0)
return weaponReachOverride;

return defaultWeaponReach;
}
set
{
weaponReachOverride = value;
ScreenWeapon.Reach = WeaponReach;
}
}

// Equip delay times for weapons
public static ushort[] EquipDelayTimes = { 500, 700, 1200, 900, 900, 1800, 1600, 1700, 1700, 3000, 3400, 2000, 2200, 2000, 2200, 2000, 4000, 5000 };

Expand Down Expand Up @@ -754,7 +771,7 @@ void ApplyWeapon()
SetWeapon(ScreenWeapon, currentLeftHandWeapon);
}

ScreenWeapon.Reach = defaultWeaponReach;
ScreenWeapon.Reach = WeaponReach;
}

void SetMelee(FPSWeapon target)
Expand Down