aboutsummaryrefslogtreecommitdiff
path: root/Northstar.Custom/mod/scripts/vscripts/weapons
diff options
context:
space:
mode:
authorEladNLG <44613424+EladNLG@users.noreply.github.com>2022-01-12 20:09:08 +0200
committerGitHub <noreply@github.com>2022-01-12 15:09:08 -0300
commit7051354fd59254b51ae6abb3e829d03723845c18 (patch)
treeb8dcde62a56a80909c18fb2d67f2a6661435ecfb /Northstar.Custom/mod/scripts/vscripts/weapons
parent398b9439edc2fa51c284f09fa9ea30cfb0403043 (diff)
downloadNorthstarMods-7051354fd59254b51ae6abb3e829d03723845c18.tar.gz
NorthstarMods-7051354fd59254b51ae6abb3e829d03723845c18.zip
Peacekraber Bug fixing + balance update. (#103)
* peacekraber fix i have no idea why this works but it does and therefore I do not intend to take into calculation anyone else's opinion on the matter. * Balance update for peacekraber Now requires to hit weak spots to damage a titan. Increased fire rate (1.33 -> 4.0) and rechamber time (0.756 -> 0.924) to make it look more fluid. Increased damage (11 -> 15) to decrease the distance between it and the mastiff (as it is pretty much overall a slower mastiff that reaches further) Increased titan damage (20-15 -> 40-30). * Fix error when respawning after killreplay (PK) * Add OnWeaponOwnerChanged callback * Fixed crosshair persisting after picking up another weapon instead of the peacekraber
Diffstat (limited to 'Northstar.Custom/mod/scripts/vscripts/weapons')
-rw-r--r--Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_peacekraber.nut23
1 files changed, 20 insertions, 3 deletions
diff --git a/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_peacekraber.nut b/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_peacekraber.nut
index a9da541f..b910cff3 100644
--- a/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_peacekraber.nut
+++ b/Northstar.Custom/mod/scripts/vscripts/weapons/mp_weapon_peacekraber.nut
@@ -5,6 +5,7 @@ untyped
global function OnWeaponPrimaryAttack_peacekraber;
global function OnWeaponDeactivate_peacekraber
global function OnWeaponActivate_peacekraber
+global function OnWeaponOwnerChanged_weapon_peacekraber
#if SERVER
global function OnWeaponNpcPrimaryAttack_peacekraber
@@ -47,8 +48,19 @@ void function OnWeaponActivate_peacekraber (entity weapon) {
void function OnWeaponDeactivate_peacekraber (entity weapon) {
#if CLIENT
+ if (!IsValid( weapon.GetWeaponOwner() )) return
if (!weapon.GetWeaponOwner().IsPlayer() || weapon.GetWeaponOwner() != GetLocalViewPlayer()) return;
- isWeaponActive = false;
+ isWeaponActive = false
+ #endif
+}
+
+void function OnWeaponOwnerChanged_weapon_peacekraber (entity weapon, WeaponOwnerChangedParams changeParams)
+{
+ #if CLIENT
+ if (changeParams.oldOwner == GetLocalViewPlayer())
+ {
+ isWeaponActive = false
+ }
#endif
}
#if CLIENT
@@ -60,7 +72,11 @@ void function CrosshairCycle() {
int chargeLevel;
float chargeFrac;
while (isWeaponActive) {
- WaitFrame()
+ if (!IsValid( clientWeapon ))
+ {
+ isWeaponActive = false
+ continue
+ }
chargeLevel = clientWeapon.GetWeaponChargeLevel();
chargeFrac = clientWeapon.GetWeaponChargeFraction();
RuiSetFloat3(rui, "teamColor", colors[chargeLevel]);
@@ -89,6 +105,7 @@ void function CrosshairCycle() {
default:
break;
}
+ WaitFrame()
}
RuiDestroy(rui);
@@ -159,4 +176,4 @@ function FireWeaponPlayerAndNPC( WeaponPrimaryAttackParams attackParams, bool pl
}
return 1
-} \ No newline at end of file
+}