mirror of
https://github.com/JezuzLizard/BO2-Reimagined.git
synced 2025-06-10 07:08:06 -05:00
Ballistic Knife: fix projectile pickup
This commit is contained in:
@ -89,6 +89,11 @@
|
||||
### B23R
|
||||
* Changed weapon cost to 900 on all maps
|
||||
|
||||
### Ballistic Knife
|
||||
* Projectiles are no longer picked up by other players
|
||||
* Projectiles can be picked up while the weapon is not reloaded
|
||||
* Projectiles can be picked up while the player is not on the ground
|
||||
|
||||
### Executioner
|
||||
* Increased penetration
|
||||
|
||||
|
@ -19,6 +19,7 @@
|
||||
#include scripts/zm/replaced/_zm_equipment;
|
||||
#include scripts/zm/replaced/_zm_spawner;
|
||||
#include scripts/zm/replaced/_zm_ai_basic;
|
||||
#include scripts/zm/replaced/_zm_weap_ballistic_knife;
|
||||
#include scripts/zm/replaced/_zm_weap_claymore;
|
||||
|
||||
main()
|
||||
@ -39,6 +40,7 @@ main()
|
||||
replaceFunc(maps/mp/zombies/_zm_laststand::revive_hud_think, scripts/zm/replaced/_zm_laststand::revive_hud_think);
|
||||
replaceFunc(maps/mp/zombies/_zm_weapons::get_upgraded_ammo_cost, scripts/zm/replaced/_zm_weapons::get_upgraded_ammo_cost);
|
||||
replaceFunc(maps/mp/zombies/_zm_weapons::makegrenadedudanddestroy, scripts/zm/replaced/_zm_weapons::makegrenadedudanddestroy);
|
||||
replaceFunc(maps/mp/zombies/_zm_weapons::createballisticknifewatcher_zm, scripts/zm/replaced/_zm_weapons::createballisticknifewatcher_zm);
|
||||
replaceFunc(maps/mp/zombies/_zm_magicbox::treasure_chest_move, scripts/zm/replaced/_zm_magicbox::treasure_chest_move);
|
||||
replaceFunc(maps/mp/zombies/_zm_magicbox::treasure_chest_timeout, scripts/zm/replaced/_zm_magicbox::treasure_chest_timeout);
|
||||
replaceFunc(maps/mp/zombies/_zm_magicbox::timer_til_despawn, scripts/zm/replaced/_zm_magicbox::timer_til_despawn);
|
||||
@ -60,6 +62,7 @@ main()
|
||||
replaceFunc(maps/mp/zombies/_zm_equipment::placed_equipment_think, scripts/zm/replaced/_zm_equipment::placed_equipment_think);
|
||||
replaceFunc(maps/mp/zombies/_zm_spawner::head_should_gib, scripts/zm/replaced/_zm_spawner::head_should_gib);
|
||||
replaceFunc(maps/mp/zombies/_zm_ai_basic::inert_wakeup, scripts/zm/replaced/_zm_ai_basic::inert_wakeup);
|
||||
replaceFunc(maps/mp/zombies/_zm_weap_ballistic_knife::watch_use_trigger, scripts/zm/replaced/_zm_weap_ballistic_knife::watch_use_trigger);
|
||||
replaceFunc(maps/mp/zombies/_zm_weap_claymore::claymore_detonation, scripts/zm/replaced/_zm_weap_claymore::claymore_detonation);
|
||||
}
|
||||
|
||||
|
112
scripts/zm/replaced/_zm_weap_ballistic_knife.gsc
Normal file
112
scripts/zm/replaced/_zm_weap_ballistic_knife.gsc
Normal file
@ -0,0 +1,112 @@
|
||||
#include maps\mp\_utility;
|
||||
#include common_scripts\utility;
|
||||
#include maps\mp\zombies\_zm_utility;
|
||||
#include maps/mp/zombies/_zm_weap_ballistic_knife;
|
||||
|
||||
on_spawn( watcher, player )
|
||||
{
|
||||
player endon( "death" );
|
||||
player endon( "disconnect" );
|
||||
player endon( "zmb_lost_knife" );
|
||||
level endon( "game_ended" );
|
||||
|
||||
is_upgraded = player maps/mp/zombies/_zm_melee_weapon::has_upgraded_ballistic_knife();
|
||||
|
||||
self waittill( "stationary", endpos, normal, angles, attacker, prey, bone );
|
||||
|
||||
if( is_upgraded && isDefined( prey ) && isplayer( prey ) && prey.team == player.team && prey maps/mp/zombies/_zm_laststand::player_is_in_laststand() )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isDefined( endpos ) )
|
||||
{
|
||||
retrievable_model = spawn( "script_model", endpos );
|
||||
retrievable_model setmodel( "t5_weapon_ballistic_knife_blade_retrieve" );
|
||||
retrievable_model setowner( player );
|
||||
retrievable_model.owner = player;
|
||||
retrievable_model.angles = angles;
|
||||
retrievable_model.name = watcher.weapon;
|
||||
isfriendly = 0;
|
||||
if ( isDefined( prey ) )
|
||||
{
|
||||
if ( isplayer( prey ) )
|
||||
{
|
||||
isfriendly = 1;
|
||||
}
|
||||
else if ( isai( prey ) && player.team == prey.team )
|
||||
{
|
||||
isfriendly = 1;
|
||||
}
|
||||
if ( isfriendly )
|
||||
{
|
||||
retrievable_model physicslaunch( normal, ( randomint( 10 ), randomint( 10 ), randomint( 10 ) ) );
|
||||
normal = ( 0, 0, 1 );
|
||||
}
|
||||
else
|
||||
{
|
||||
retrievable_model linkto( prey, bone );
|
||||
retrievable_model thread force_drop_knives_to_ground_on_death( player, prey );
|
||||
}
|
||||
}
|
||||
watcher.objectarray[ watcher.objectarray.size ] = retrievable_model;
|
||||
retrievable_model thread drop_knives_to_ground( player );
|
||||
if( isfriendly )
|
||||
{
|
||||
player notify( "ballistic_knife_stationary", retrievable_model, normal );
|
||||
}
|
||||
else
|
||||
{
|
||||
player notify( "ballistic_knife_stationary", retrievable_model, normal, prey );
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
watch_use_trigger( trigger, model, callback, weapon, playersoundonuse, npcsoundonuse )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "delete" );
|
||||
level endon( "game_ended" );
|
||||
autorecover = is_true( level.ballistic_knife_autorecover );
|
||||
while ( 1 )
|
||||
{
|
||||
trigger waittill( "trigger", player );
|
||||
if ( !isalive( player ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ( isDefined( trigger.triggerteam ) && player.team != trigger.triggerteam )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ( isDefined( trigger.claimedby ) && player != trigger.claimedby )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ( isDefined( trigger.owner ) && player != trigger.owner )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ( player getcurrentweapon() == weapon && player getweaponammostock( weapon ) >= weaponmaxammo( weapon ) )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
if ( !autorecover && !is_true( trigger.force_pickup ) )
|
||||
{
|
||||
if( player.throwinggrenade || player meleebuttonpressed() )
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
if ( isDefined( playersoundonuse ) )
|
||||
{
|
||||
player playlocalsound( playersoundonuse );
|
||||
}
|
||||
if ( isDefined( npcsoundonuse ) )
|
||||
{
|
||||
player playsound( npcsoundonuse );
|
||||
}
|
||||
player thread [[ callback ]]( weapon, model, trigger );
|
||||
return;
|
||||
}
|
||||
}
|
@ -23,4 +23,13 @@ makegrenadedudanddestroy()
|
||||
{
|
||||
self delete();
|
||||
}
|
||||
}
|
||||
|
||||
createballisticknifewatcher_zm( name, weapon )
|
||||
{
|
||||
watcher = self maps/mp/gametypes_zm/_weaponobjects::createuseweaponobjectwatcher( name, weapon, self.team );
|
||||
watcher.onspawn = scripts/zm/replaced/_zm_weap_ballistic_knife::on_spawn;
|
||||
watcher.onspawnretrievetriggers = maps/mp/zombies/_zm_weap_ballistic_knife::on_spawn_retrieve_trigger;
|
||||
watcher.storedifferentobject = 1;
|
||||
watcher.headicon = 0;
|
||||
}
|
Reference in New Issue
Block a user