mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-10 15:17:57 -05:00
Jet Gun: move overheat/cooldown rate changes to weapon file
Jet Gun: no longer heats up when firing while meleeing
This commit is contained in:
@ -252,8 +252,6 @@ on_player_spawned()
|
||||
|
||||
self thread weapon_locker_give_ammo_after_rounds();
|
||||
|
||||
self thread jetgun_heatval_changes();
|
||||
|
||||
self thread additionalprimaryweapon_indicator();
|
||||
self thread additionalprimaryweapon_stowed_weapon_refill();
|
||||
|
||||
@ -3262,70 +3260,6 @@ remove_buildable_pieces( buildable_name )
|
||||
}
|
||||
}
|
||||
|
||||
jetgun_heatval_changes()
|
||||
{
|
||||
self endon("disconnect");
|
||||
|
||||
if(!maps\mp\zombies\_zm_weapons::is_weapon_included("jetgun_zm"))
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
vars = [];
|
||||
|
||||
vars["prev_heatval"] = 0;
|
||||
vars["cooldown_amount"] = 0.1;
|
||||
vars["melee_overheat_amount"] = 0.475;
|
||||
|
||||
while(1)
|
||||
{
|
||||
if(!IsDefined(self.jetgun_heatval))
|
||||
{
|
||||
vars["prev_heatval"] = 0;
|
||||
wait 0.05;
|
||||
continue;
|
||||
}
|
||||
|
||||
vars["curr_heatval"] = self.jetgun_heatval;
|
||||
vars["diff_heatval"] = vars["curr_heatval"] - vars["prev_heatval"];
|
||||
|
||||
if(self getCurrentWeapon() != "jetgun_zm")
|
||||
{
|
||||
self.jetgun_heatval -= vars["cooldown_amount"];
|
||||
}
|
||||
else if(self getCurrentWeapon() == "jetgun_zm" && self attackButtonPressed() && self isMeleeing())
|
||||
{
|
||||
self.jetgun_heatval += vars["melee_overheat_amount"];
|
||||
}
|
||||
else if(self getCurrentWeapon() == "jetgun_zm" && self attackButtonPressed())
|
||||
{
|
||||
self.jetgun_heatval -= abs(vars["diff_heatval"]) / 2;
|
||||
}
|
||||
else if(vars["diff_heatval"] < 0)
|
||||
{
|
||||
self.jetgun_heatval -= abs(vars["diff_heatval"]);
|
||||
}
|
||||
|
||||
if(self.jetgun_heatval < 0)
|
||||
{
|
||||
self.jetgun_heatval = 0;
|
||||
}
|
||||
else if(self.jetgun_heatval > 99.9)
|
||||
{
|
||||
self.jetgun_heatval = 99.9;
|
||||
}
|
||||
|
||||
if(self.jetgun_heatval != vars["curr_heatval"])
|
||||
{
|
||||
self setweaponoverheating(self.jetgun_overheating, self.jetgun_heatval);
|
||||
}
|
||||
|
||||
vars["prev_heatval"] = self.jetgun_heatval;
|
||||
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
jetgun_remove_forced_weapon_switch()
|
||||
{
|
||||
foreach (buildable in level.zombie_include_buildables)
|
||||
|
@ -3,6 +3,31 @@
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\zombies\_zm_utility;
|
||||
|
||||
watch_overheat()
|
||||
{
|
||||
self endon( "death_or_disconnect" );
|
||||
self endon( "weapon_change" );
|
||||
|
||||
while ( true )
|
||||
{
|
||||
if ( self getcurrentweapon() == "jetgun_zm" )
|
||||
{
|
||||
overheating = self isweaponoverheating( 0 );
|
||||
heat = self isweaponoverheating( 1 );
|
||||
self.jetgun_overheating = overheating;
|
||||
self.jetgun_heatval = heat;
|
||||
|
||||
if ( overheating )
|
||||
self notify( "jetgun_overheated" );
|
||||
|
||||
if ( heat > 75 )
|
||||
self thread play_overheat_fx();
|
||||
}
|
||||
|
||||
wait 0.05;
|
||||
}
|
||||
}
|
||||
|
||||
jetgun_firing()
|
||||
{
|
||||
if ( !isdefined( self.jetsound_ent ) )
|
||||
|
@ -52,6 +52,7 @@ main()
|
||||
replaceFunc(maps\mp\zombies\_zm_riotshield::trackriotshield, scripts\zm\replaced\_zm_riotshield::trackriotshield);
|
||||
replaceFunc(maps\mp\zombies\_zm_weap_riotshield::init, scripts\zm\replaced\_zm_weap_riotshield::init);
|
||||
replaceFunc(maps\mp\zombies\_zm_weap_riotshield::player_damage_shield, scripts\zm\replaced\_zm_weap_riotshield::player_damage_shield);
|
||||
replaceFunc(maps\mp\zombies\_zm_weap_jetgun::watch_overheat, scripts\zm\replaced\_zm_weap_jetgun::watch_overheat);
|
||||
replaceFunc(maps\mp\zombies\_zm_weap_jetgun::jetgun_firing, scripts\zm\replaced\_zm_weap_jetgun::jetgun_firing);
|
||||
replaceFunc(maps\mp\zombies\_zm_weap_jetgun::is_jetgun_firing, scripts\zm\replaced\_zm_weap_jetgun::is_jetgun_firing);
|
||||
replaceFunc(maps\mp\zombies\_zm_weap_jetgun::jetgun_check_enemies_in_range, scripts\zm\replaced\_zm_weap_jetgun::jetgun_check_enemies_in_range);
|
||||
|
Reference in New Issue
Block a user