init
This commit is contained in:
921 files changed
+337975
No files matched your search
@@ -0,0 +1,60 @@
|
||||
#using scripts\codescripts\struct;
|
||||
|
||||
#using scripts\shared\callbacks_shared;
|
||||
#using scripts\shared\clientfield_shared;
|
||||
#using scripts\shared\filter_shared;
|
||||
#using scripts\shared\system_shared;
|
||||
#using scripts\shared\util_shared;
|
||||
#using scripts\shared\vehicle_shared;
|
||||
|
||||
Line truncated
|
||||
|
||||
|
||||
#namespace mechtank;
|
||||
|
||||
function autoexec __init__sytem__() { system::register("mechtank",&__init__,undefined,undefined); }
|
||||
|
||||
function __init__()
|
||||
{
|
||||
vehicle::add_vehicletype_callback( "mechtank", &_setup_ );
|
||||
}
|
||||
|
||||
function _setup_( localClientNum )
|
||||
{
|
||||
self thread player_enter( localClientNum );
|
||||
self thread player_exit( localClientNum );
|
||||
}
|
||||
|
||||
function player_enter( localClientNum )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "entityshutdown" );
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
self waittill( "enter_vehicle", player );
|
||||
|
||||
if( self IsLocalClientDriver( localClientNum ) )
|
||||
{
|
||||
self SetHighDetail( true );
|
||||
}
|
||||
|
||||
wait .016;
|
||||
}
|
||||
}
|
||||
|
||||
function player_exit( localClientNum )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "entityshutdown" );
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
self waittill( "exit_vehicle", player );
|
||||
if( isdefined( player ) && player islocalplayer() )
|
||||
{
|
||||
self SetHighDetail( false );
|
||||
}
|
||||
wait .016;
|
||||
}
|
||||
}
|
||||
@@ -0,0 +1,90 @@
|
||||
#using scripts\codescripts\struct;
|
||||
|
||||
#using scripts\shared\clientfield_shared;
|
||||
#using scripts\shared\gameskill_shared;
|
||||
#using scripts\shared\math_shared;
|
||||
#using scripts\shared\statemachine_shared;
|
||||
#using scripts\shared\system_shared;
|
||||
#using scripts\shared\util_shared;
|
||||
#using scripts\shared\turret_shared;
|
||||
#using scripts\shared\flag_shared;
|
||||
#using scripts\shared\damagefeedback_shared;
|
||||
#using scripts\shared\laststand_shared;
|
||||
#using scripts\shared\gameobjects_shared;
|
||||
|
||||
Line truncated
|
||||
|
||||
|
||||
|
||||
|
||||
#using scripts\shared\ai\systems\blackboard;
|
||||
#using scripts\shared\ai\blackboard_vehicle;
|
||||
|
||||
|
||||
#using scripts\shared\vehicle_shared;
|
||||
#using scripts\shared\vehicle_ai_shared;
|
||||
#using scripts\shared\vehicle_death_shared;
|
||||
|
||||
#using scripts\mp\killstreaks\_killstreaks;
|
||||
#using scripts\mp\killstreaks\_killstreak_bundles;
|
||||
|
||||
|
||||
|
||||
#namespace mechtank;
|
||||
|
||||
function autoexec __init__sytem__() { system::register("mechtank",&__init__,undefined,undefined); }
|
||||
|
||||
#using_animtree( "generic" );
|
||||
|
||||
function __init__()
|
||||
{
|
||||
vehicle::add_main_callback( "mechtank", &mechtank_initialize );
|
||||
}
|
||||
|
||||
function mechtank_initialize()
|
||||
{
|
||||
self useanimtree( #animtree );
|
||||
|
||||
self.targetOffset = ( 0, 0, 60 );
|
||||
|
||||
self EnableAimAssist();
|
||||
|
||||
self.fovcosine = 0; // +/-90 degrees = 180 fov, err 0 actually means 360 degree view
|
||||
self.fovcosinebusy = 0;
|
||||
self.maxsightdistsqrd = ( (10000) * (10000) );
|
||||
self.allow_movement = true;
|
||||
|
||||
assert( isdefined( self.scriptbundlesettings ) );
|
||||
|
||||
self.settings = struct::get_script_bundle( "vehiclecustomsettings", self.scriptbundlesettings );
|
||||
|
||||
self.overrideVehicleDamage = &MechtankCallback_VehicleDamage;
|
||||
|
||||
killstreak_bundles::register_killstreak_bundle( "mechtank" );
|
||||
self.maxhealth = killstreak_bundles::get_max_health( "mechtank" );
|
||||
self.heatlh = self.maxhealth;
|
||||
}
|
||||
|
||||
function MechtankCallback_VehicleDamage( eInflictor, eAttacker, iDamage, iDFlags, sMeansOfDeath, weapon, vPoint, vDir, sHitLoc, vDamageOrigin, psOffsetTime, damageFromUnderneath, modelIndex, partName, vSurfaceNormal )
|
||||
{
|
||||
if ( isdefined( eAttacker ) && ( eAttacker == self || isplayer( eAttacker ) && eAttacker.usingvehicle && eAttacker.viewlockedentity === self ) )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
if ( sMeansOfDeath === "MOD_MELEE" || sMeansOfDeath === "MOD_MELEE_WEAPON_BUTT" || sMeansOfDeath === "MOD_MELEE_ASSASSINATE" || sMeansOfDeath === "MOD_ELECTROCUTED" || sMeansOfDeath === "MOD_CRUSH" || weapon.isEmp )
|
||||
{
|
||||
return 0;
|
||||
}
|
||||
|
||||
iDamage = self killstreaks::OnDamagePerWeapon( "mechtank", eAttacker, iDamage, iDFlags, sMeansOfDeath, weapon, self.maxhealth, undefined, self.maxhealth * 0.4, undefined, 0, undefined, true, 1.0 );
|
||||
|
||||
|
||||
driver = self GetSeatOccupant( 0 );
|
||||
if ( isPlayer( driver ) )
|
||||
{
|
||||
driver vehicle::update_damage_as_occupant( self.maxhealth - ( self.health - iDamage ), self.maxhealth );
|
||||
}
|
||||
|
||||
return iDamage;
|
||||
}
|
||||
@@ -0,0 +1,146 @@
|
||||
#using scripts\codescripts\struct;
|
||||
|
||||
#using scripts\shared\callbacks_shared;
|
||||
#using scripts\shared\clientfield_shared;
|
||||
#using scripts\shared\filter_shared;
|
||||
#using scripts\shared\system_shared;
|
||||
#using scripts\shared\util_shared;
|
||||
#using scripts\shared\vehicle_shared;
|
||||
|
||||
Line truncated
|
||||
|
||||
|
||||
#namespace quadtank;
|
||||
|
||||
function autoexec __init__sytem__() { system::register("quadtank",&__init__,undefined,undefined); }
|
||||
|
||||
function __init__()
|
||||
{
|
||||
vehicle::add_vehicletype_callback( "quadtank", &_setup_ );
|
||||
clientfield::register( "toplayer", "player_shock_fx", 1, 1, "int", &player_shock_fx_handler, !true, !true );
|
||||
clientfield::register( "vehicle", "quadtank_trophy_state", 1, 1, "int", &update_trophy_system_state, !true, !true );
|
||||
}
|
||||
|
||||
function _setup_( localClientNum )
|
||||
{
|
||||
player = GetLocalPlayer( localClientNum );
|
||||
if( isdefined( player ) )
|
||||
{
|
||||
filter::init_filter_ev_interference( player );
|
||||
}
|
||||
//set code field to get notifies to play impact effects
|
||||
self.notifyOnBulletImpact = true;
|
||||
self thread wait_for_bullet_impact( localClientNum );
|
||||
|
||||
//trophy state
|
||||
self.trophy_on = false;
|
||||
|
||||
self thread player_enter( localClientNum );
|
||||
self thread player_exit( localClientNum );
|
||||
}
|
||||
|
||||
function player_enter( localClientNum )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "entityshutdown" );
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
self waittill( "enter_vehicle", player );
|
||||
|
||||
if( self IsLocalClientDriver( localClientNum ) )
|
||||
{
|
||||
self SetHighDetail( true );
|
||||
}
|
||||
|
||||
wait .016;
|
||||
}
|
||||
}
|
||||
|
||||
function player_exit( localClientNum )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "entityshutdown" );
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
self waittill( "exit_vehicle", player );
|
||||
if( isdefined( player ) && player islocalplayer() )
|
||||
{
|
||||
self SetHighDetail( false );
|
||||
}
|
||||
wait .016;
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
function update_trophy_system_state( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
|
||||
{
|
||||
}
|
||||
|
||||
function player_shock_fx_handler( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
|
||||
{
|
||||
if ( isdefined( self ) )
|
||||
{
|
||||
self thread player_shock_fx_fade_off( localClientNum, 1.0, 1.0 );
|
||||
}
|
||||
}
|
||||
|
||||
function player_shock_fx_fade_off( localClientNum, amount, fadeoutTime )
|
||||
{
|
||||
// not ending on death or shutdown, cause we have to clean ourselves up
|
||||
self endon( "disconnect" );
|
||||
self notify( "player_shock_fx_fade_off_end" ); // kill previous threads
|
||||
self endon( "player_shock_fx_fade_off_end" );
|
||||
|
||||
if ( !isAlive( self ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
startTime = GetTime();
|
||||
|
||||
filter::set_filter_ev_interference_amount( self, 4, amount );
|
||||
filter::enable_filter_ev_interference( self, 4 );
|
||||
|
||||
while ( GetTime() <= startTime + fadeoutTime * 1000 && isAlive( self ) )
|
||||
{
|
||||
ratio = ( GetTime() - startTime ) / ( fadeoutTime * 1000 );
|
||||
currentValue = LerpFloat( amount, 0, ratio );
|
||||
setfilterpassconstant( localClientNum, 4, 0, 0, currentValue ); // use code function instead of script wrapper cause player can be undefined
|
||||
|
||||
wait .016;
|
||||
}
|
||||
|
||||
setfilterpassenabled( localClientNum, 4, 0, false );
|
||||
}
|
||||
|
||||
function wait_for_bullet_impact( localClientNum )
|
||||
{
|
||||
self endon( "entityshutdown" );
|
||||
|
||||
if( isdefined( self.scriptbundlesettings ) )
|
||||
{
|
||||
settings = struct::get_script_bundle( "vehiclecustomsettings", self.scriptbundlesettings );
|
||||
}
|
||||
else
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
self waittill( "damage", attacker, impactPos, effectDir, partname );
|
||||
if( partName == "tag_target_lower" || partName == "tag_target_upper" || partName == "tag_defense_active" || partName == "tag_body_animate" )
|
||||
{
|
||||
if( self.trophy_on )
|
||||
{
|
||||
if( IsDefined( attacker ) && attacker IsPlayer() && attacker.team != self.team )
|
||||
{
|
||||
PlayFx( localClientNum, settings.weakspotfx, impactPos, effectDir );
|
||||
self playsound( 0, "veh_quadtank_panel_hit" );
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,159 @@
|
||||
Line truncated
|
||||
|
||||
#using scripts\codescripts\struct;
|
||||
|
||||
#using scripts\shared\clientfield_shared;
|
||||
#using scripts\shared\system_shared;
|
||||
#using scripts\shared\util_shared;
|
||||
#using scripts\shared\vehicle_shared;
|
||||
#using scripts\shared\callbacks_shared;
|
||||
|
||||
#using scripts\shared\weapons\spike_charge_siegebot;
|
||||
|
||||
#namespace siegebot;
|
||||
|
||||
function autoexec __init__sytem__() { system::register("siegebot_mp",&__init__,undefined,undefined); }
|
||||
|
||||
#using_animtree( "generic" );
|
||||
|
||||
function __init__()
|
||||
{
|
||||
vehicle::add_vehicletype_callback( "siegebot_mp", &_setup_ );
|
||||
|
||||
clientfield::register( "vehicle", "siegebot_retract_right_arm", 1, 1, "int", &update_right_arm, !true, !true );
|
||||
clientfield::register( "vehicle", "siegebot_retract_left_arm", 1, 1, "int", &update_left_arm, !true, !true );
|
||||
}
|
||||
|
||||
function _setup_( localClientNum )
|
||||
{
|
||||
if( isdefined( self.scriptbundlesettings ) )
|
||||
{
|
||||
settings = struct::get_script_bundle( "vehiclecustomsettings", self.scriptbundlesettings );
|
||||
}
|
||||
|
||||
if ( !isdefined( settings ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
self thread player_enter_exit( localClientNum );
|
||||
}
|
||||
|
||||
function player_enter_exit( localClientNum )
|
||||
{
|
||||
self endon( "death" );
|
||||
self endon( "entityshutdown" );
|
||||
|
||||
player = undefined;
|
||||
|
||||
while( 1 )
|
||||
{
|
||||
// perform exit steps here
|
||||
self player_exited( localClientNum, player );
|
||||
|
||||
self waittill( "enter_vehicle", player );
|
||||
|
||||
self player_entered( localClientNum, player );
|
||||
|
||||
self waittill( "exit_vehicle", player );
|
||||
}
|
||||
}
|
||||
|
||||
function player_entered( localClientNum, player )
|
||||
{
|
||||
self playsound( localClientNum, "evt_siegebot_bootup_1" );
|
||||
|
||||
local_player = GetLocalPlayer( localClientNum );
|
||||
|
||||
if( self IsLocalClientDriver( localClientNum ) )
|
||||
{
|
||||
//self SetHighDetail( true );
|
||||
}
|
||||
}
|
||||
|
||||
function player_exited( localClientNum, player )
|
||||
{
|
||||
self playsound( localClientNum, "evt_siegebot_shutdown_1" );
|
||||
|
||||
if( self IsLocalClientDriver( localClientNum ) )
|
||||
{
|
||||
//self SetHighDetail( false );
|
||||
}
|
||||
}
|
||||
|
||||
function retract_left_arm()
|
||||
{
|
||||
self UseAnimTree( #animtree );
|
||||
|
||||
self ClearAnim( %ai_siegebot_base_mp_left_arm_extend, 0.2 );
|
||||
self SetAnim( %ai_siegebot_base_mp_left_arm_retract, 1.0 );
|
||||
}
|
||||
|
||||
function extend_left_arm()
|
||||
{
|
||||
self UseAnimTree( #animtree );
|
||||
|
||||
self ClearAnim( %ai_siegebot_base_mp_left_arm_retract, 0.2 );
|
||||
self SetAnim( %ai_siegebot_base_mp_left_arm_extend, 1.0 );
|
||||
|
||||
wait 0.1;
|
||||
|
||||
if ( self clientfield::get( "siegebot_retract_left_arm" ) == 0 )
|
||||
self ClearAnim( %ai_siegebot_base_mp_left_arm_extend, 0.1 );
|
||||
}
|
||||
|
||||
function retract_right_arm()
|
||||
{
|
||||
self UseAnimTree( #animtree );
|
||||
|
||||
self ClearAnim( %ai_siegebot_base_mp_right_arm_extend, 0.2 );
|
||||
self SetAnim( %ai_siegebot_base_mp_right_arm_retract, 1.0 );
|
||||
}
|
||||
|
||||
function extend_right_arm()
|
||||
{
|
||||
self UseAnimTree( #animtree );
|
||||
|
||||
self ClearAnim( %ai_siegebot_base_mp_right_arm_retract, 0.2 );
|
||||
self SetAnim( %ai_siegebot_base_mp_right_arm_extend, 1.0 );
|
||||
|
||||
wait 0.1;
|
||||
|
||||
if ( self clientfield::get( "siegebot_retract_right_arm" ) == 0 )
|
||||
self ClearAnim( %ai_siegebot_base_mp_right_arm_extend, 0.1 );
|
||||
}
|
||||
|
||||
|
||||
function update_right_arm( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
|
||||
{
|
||||
self util::waittill_dobj( localClientNum );
|
||||
|
||||
if ( !isdefined(self) )
|
||||
return;
|
||||
|
||||
if ( newVal )
|
||||
{
|
||||
self thread retract_right_arm();
|
||||
}
|
||||
else
|
||||
{
|
||||
self thread extend_right_arm();
|
||||
}
|
||||
}
|
||||
|
||||
function update_left_arm( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
|
||||
{
|
||||
self util::waittill_dobj( localClientNum );
|
||||
|
||||
if ( !isdefined(self) )
|
||||
return;
|
||||
|
||||
if ( newVal )
|
||||
{
|
||||
self thread retract_left_arm();
|
||||
}
|
||||
else
|
||||
{
|
||||
self thread extend_left_arm();
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
@@ -0,0 +1,57 @@
|
||||
#using scripts\codescripts\struct;
|
||||
|
||||
#using scripts\shared\clientfield_shared;
|
||||
#using scripts\shared\filter_shared;
|
||||
#using scripts\shared\system_shared;
|
||||
#using scripts\shared\util_shared;
|
||||
#using scripts\shared\vehicle_shared;
|
||||
|
||||
Line truncated
|
||||
|
||||
|
||||
#namespace siegebot_theia;
|
||||
|
||||
function autoexec __init__sytem__() { system::register("siegebot_theia",&__init__,undefined,undefined); }
|
||||
|
||||
function __init__()
|
||||
{
|
||||
vehicle::add_vehicletype_callback( "siegebot_theia", &_setup_ );
|
||||
|
||||
clientfield::register( "vehicle", "sarah_rumble_on_landing", 1, 1, "counter", &sarah_rumble_on_landing, !true, !true );
|
||||
clientfield::register( "vehicle", "sarah_minigun_spin", 1, 1, "int", &sarah_minigun_spin, !true, !true );
|
||||
}
|
||||
|
||||
function _setup_( localClientNum )
|
||||
{
|
||||
}
|
||||
|
||||
//Rumble and quake when sarah jumps and lands
|
||||
function sarah_rumble_on_landing( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
|
||||
{
|
||||
self PlayRumbleOnEntity(localClientNum, "cp_infection_sarah_battle_land" );
|
||||
}
|
||||
|
||||
function sarah_minigun_spin( localClientNum, oldVal, newVal, bNewEnt, bInitialSnap, fieldName, bWasTimeJump )
|
||||
{
|
||||
if( !isdefined( self.scriptbundlesettings ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
settings = struct::get_script_bundle( "vehiclecustomsettings", self.scriptbundlesettings );
|
||||
|
||||
if ( !isdefined( settings ) )
|
||||
{
|
||||
return;
|
||||
}
|
||||
|
||||
if ( isdefined( self.minigun_spin_fx_handle ) )
|
||||
{
|
||||
DeleteFX( localClientNum, self.minigun_spin_fx_handle );
|
||||
}
|
||||
|
||||
if ( newVal )
|
||||
{
|
||||
self.minigun_spin_fx_handle = PlayFXOnTag( localClientNum, settings.spin, self, settings.tag_spin );
|
||||
}
|
||||
}
|
||||
File diff suppressed because it is too large.
Load diff
Reference in new issue
Block a user