Split bot actions script into 3 different scripts.

This commit is contained in:
JezuzLizard
2023-03-25 21:35:57 -07:00
parent 31c885a396
commit f75726147c
5 changed files with 626 additions and 83 deletions

View File

@ -0,0 +1,361 @@
bot_aimatsinglenormalzombie()
{
}
bot_aimatsinglenormalzombie_process_order()
{
return 0;
}
bot_should_aimatsinglenormalzombie()
{
return false;
}
bot_aimatsinglenormalzombie_on_completion()
{
}
bot_aimatsinglenormalzombie_should_cancel()
{
return false;
}
bot_aimatsinglenormalzombie_on_cancel()
{
}
bot_aimatsinglenormalzombie_should_postpone()
{
return false;
}
bot_aimatsinglenormalzombie_on_postpone()
{
}
bot_aimatsinglenormalzombie_priority()
{
return 0;
}
bot_shootsinglenormalzombie()
{
}
bot_shootsinglenormalzombie_process_order()
{
return 0;
}
bot_should_shootsinglenormalzombie()
{
return false;
}
bot_shootsinglenormalzombie_on_completion()
{
}
bot_shootsinglenormalzombie_should_cancel()
{
return false;
}
bot_shootsinglenormalzombie_on_cancel()
{
}
bot_shootsinglenormalzombie_should_postpone()
{
return false;
}
bot_shootsinglenormalzombie_on_postpone()
{
}
bot_shootsinglenormalzombie_priority()
{
return 0;
}
bot_aimatmultiplenormalzombies()
{
}
bot_aimatmultiplenormalzombies_process_order()
{
return 0;
}
bot_should_aimatmultiplenormalzombies()
{
return false;
}
bot_aimatmultiplenormalzombies_on_completion()
{
}
bot_aimatmultiplenormalzombies_should_cancel()
{
return false;
}
bot_aimatmultiplenormalzombies_on_cancel()
{
}
bot_aimatmultiplenormalzombies_should_postpone()
{
return false;
}
bot_aimatmultiplenormalzombies_on_postpone()
{
}
bot_aimatmultiplenormalzombies_priority()
{
return false;
}
bot_shootmultiplenormalzombies()
{
}
bot_shootmultiplenormalzombies_process_order()
{
return 0;
}
bot_should_shootmultiplenormalzombies()
{
return false;
}
bot_shootmultiplenormalzombie_on_completion()
{
}
bot_shootmultiplenormalzombie_should_cancel()
{
return false;
}
bot_shootmultiplenormalzombie_on_cancel()
{
}
bot_shootmultiplenormalzombie_should_postpone()
{
return false;
}
bot_shootmultiplenormalzombie_on_postpone()
{
}
bot_shootmultiplenormalzombie_priority()
{
return 0;
}
bot_meleesinglenormalzombie()
{
}
bot_meleesinglenormalzombie_process_order()
{
return 0;
}
bot_should_meleesinglenormalzombie()
{
}
bot_meleesinglenormalzombie_on_completion()
{
}
bot_meleesinglenormalzombie_should_cancel()
{
return false;
}
bot_meleesinglenormalzombie_on_cancel()
{
}
bot_meleesinglenormalzombie_should_postpone()
{
return false;
}
bot_meleesinglenormalzombie_on_postpone()
{
}
bot_meleesinglenormalzombie_priority()
{
return 0;
}
bot_shootsingledogzombie()
{
}
bot_shootsingledogzombie_process_order()
{
return 0;
}
bot_should_shootsingledogzombie()
{
return false;
}
bot_shootsingledogzombie_on_completion()
{
}
bot_shootsingledogzombie_should_cancel()
{
return false;
}
bot_shootsingledogzombie_on_cancel()
{
}
bot_shootsingledogzombie_should_postpone()
{
return false;
}
bot_shootsingledogzombie_on_postpone()
{
}
bot_shootsingledogzombie_priority()
{
return 0;
}
bot_shootmultipledogzombies()
{
}
bot_shootmultipledogzombies_process_order()
{
return 0;
}
bot_should_shootmultipledogzombies()
{
return false;
}
bot_shootmultipledogzombies_on_completion()
{
}
bot_shootmultipledogzombies_should_cancel()
{
return false;
}
bot_shootmultipledogzombies_on_cancel()
{
}
bot_shootmultipledogzombies_should_postpone()
{
return false;
}
bot_shootmultipledogzombies_on_postpone()
{
}
bot_shootmultipledogzombies_priority()
{
return 0;
}
bot_meleesingledogzombie()
{
}
bot_meleesingledogzombie_process_order()
{
return 0;
}
bot_should_meleesingledogzombie()
{
return false;
}
bot_meleesingledogzombie_on_completion()
{
}
bot_meleesingledogzombie_should_cancel()
{
return false;
}
bot_meleesingledogzombie_on_cancel()
{
}
bot_meleesingledogzombie_should_postpone()
{
return false;
}
bot_meleesingledogzombie_on_postpone()
{
}
bot_meleesingledogzombie_priority()
{
return 0;
}

View File

@ -0,0 +1,179 @@
bot_movetoobjective()
{
}
bot_movetoobjective_process_order()
{
return 0;
}
bot_should_movetoobjective()
{
return false;
}
bot_movetoobjective_on_completion()
{
}
bot_movetoobjective_should_cancel()
{
return false;
}
bot_movetoobjective_on_cancel()
{
}
bot_movetoobjective_should_postpone()
{
return false;
}
bot_movetoobjective_on_postpone()
{
}
bot_movetoobjective_priority()
{
return 0;
}
bot_train()
{
}
bot_train_process_order()
{
return 0;
}
bot_should_train()
{
return false;
}
bot_train_on_completion()
{
}
bot_train_should_cancel()
{
return false;
}
bot_train_on_cancel()
{
}
bot_train_should_postpone()
{
return false;
}
bot_train_on_postpone()
{
}
bot_train_priority()
{
return 0;
}
bot_camp()
{
}
bot_camp_process_order()
{
return 0;
}
bot_should_camp()
{
return false;
}
bot_camp_on_completion()
{
}
bot_camp_should_cancel()
{
return false;
}
bot_camp_on_cancel()
{
}
bot_camp_should_postpone()
{
return false;
}
bot_camp_on_postpone()
{
}
bot_camp_priority()
{
return 0;
}
bot_flee()
{
}
bot_flee_process_order()
{
return 0;
}
bot_should_flee()
{
return false;
}
bot_flee_on_completion()
{
}
bot_flee_should_cancel()
{
return false;
}
bot_flee_on_cancel()
{
}
bot_flee_should_postpone()
{
return false;
}
bot_flee_on_postpone()
{
}
bot_flee_priority()
{
return 0;
}

View File

@ -0,0 +1,701 @@
bot_magicbox_purchase()
{
self.target_pos = self.available_chests[ 0 ].origin;
}
bot_magicbox_process_order()
{
}
bot_should_purchase_magicbox()
{
if ( !level.enable_magic )
{
return false;
}
if ( level.chests.size <= 0 )
{
return false;
}
self.available_chests = [];
for ( i = 0; i < level.chests.size; i++ )
{
if ( level.chests[ i ].hidden )
{
continue;
}
if ( self.score < level.chests[ i ].zombie_cost )
{
continue;
}
self.available_chests[ self.available_chests.size ] = level.chests[ i ];
}
if ( self.available_chests.size > 0 )
{
for ( i = 0; i < self.available_chests.size; i++ )
{
if ( isDefined( self.available_chests[ i ].chest_user ) )
{
arrayRemoveIndex( self.available_chests, i );
i--;
}
}
}
return self.available_chests.size > 0;
}
bot_magicbox_purchase_on_completion()
{
}
bot_magicbox_purchase_should_cancel()
{
return false;
}
bot_magicbox_purchase_on_cancel()
{
}
bot_magicbox_purchase_should_postpone()
{
return false;
}
bot_magicbox_purchase_on_postpone()
{
}
bot_magicbox_purchase_priority()
{
priority = 0;
const LOW_AMMO_THRESHOLD = 0.3;
weapons = self getWeaponsListPrimaries();
if ( weapons.size < 2 )
{
priority += 1;
}
for ( j = 0; j < weapons.size; j++ )
{
if ( self getWeaponAmmoStock( weapons[ j ] ) <= int( weaponmaxammo( weapons[ j ] ) * LOW_AMMO_THRESHOLD ) )
{
priority += 1;
}
}
return priority;
}
bot_wallbuy_purchase()
{
}
bot_wallbuy_process_order()
{
return 0;
}
bot_should_purchase_wallbuy()
{
return false;
}
bot_wallbuy_purchase_on_completion()
{
}
bot_wallbuy_purchase_should_cancel()
{
return false;
}
bot_wallbuy_purchase_on_cancel()
{
}
bot_wallbuy_purchase_should_postpone()
{
return false;
}
bot_wallbuy_purchase_on_postpone()
{
}
bot_wallbuy_purchase_priority()
{
return 0;
}
bot_wallbuy_ammo_purchase()
{
}
bot_wallbuyammo_process_order()
{
return 0;
}
bot_should_purchase_wallbuy_ammo()
{
return false;
}
bot_wallbuy_ammo_purchase_on_completion()
{
}
bot_wallbuy_ammo_purchase_should_cancel()
{
return false;
}
bot_wallbuy_ammo_purchase_on_cancel()
{
}
bot_wallbuy_ammo_purchase_should_postpone()
{
return false;
}
bot_wallbuy_ammo_purchase_on_postpone()
{
}
bot_wallbuy_ammo_purchase_priority()
{
return 0;
}
bot_perk_purchase()
{
}
bot_perk_process_order()
{
return 0;
}
bot_should_purchase_perk()
{
return false;
}
bot_perk_purchase_on_completion()
{
}
bot_perk_purchase_should_cancel()
{
return false;
}
bot_perk_purchase_on_cancel()
{
}
bot_perk_purchase_should_postpone()
{
return false;
}
bot_perk_purchase_on_postpone()
{
}
bot_perk_purchase_priority()
{
return 0;
}
bot_door_purchase()
{
}
bot_door_process_order()
{
return 0;
}
bot_should_purchase_door()
{
return false;
}
bot_door_purchase_on_completion()
{
}
bot_door_purchase_should_cancel()
{
return false;
}
bot_door_purchase_on_cancel()
{
}
bot_door_purchase_should_postpone()
{
return false;
}
bot_door_purchase_on_postpone()
{
}
bot_door_purchase_priority()
{
return 0;
}
bot_debris_purchase()
{
}
bot_debris_process_order()
{
return 0;
}
bot_should_purchase_debris()
{
return false;
}
bot_debris_purchase_on_completion()
{
}
bot_debris_purchase_should_cancel()
{
return false;
}
bot_debris_purchase_on_cancel()
{
}
bot_debris_purchase_should_postpone()
{
return false;
}
bot_debris_purchase_on_postpone()
{
}
bot_debris_purchase_priority()
{
return 0;
}
bot_trap_purchase()
{
}
bot_trap_process_order()
{
return 0;
}
bot_should_purchase_trap()
{
return false;
}
bot_trap_purchase_on_completion()
{
}
bot_trap_purchase_should_cancel()
{
return false;
}
bot_trap_purchase_on_cancel()
{
}
bot_trap_purchase_should_postpone()
{
return false;
}
bot_trap_purchase_on_postpone()
{
}
bot_trap_purchase_priority()
{
return 0;
}
bot_packapunch_purchase()
{
}
bot_packapunch_process_order()
{
return 0;
}
bot_should_purchase_packapunch()
{
return false;
}
bot_packapunch_purchase_on_completion()
{
}
bot_packapunch_purchase_should_cancel()
{
return false;
}
bot_packapunch_purchase_on_cancel()
{
}
bot_packapunch_purchase_should_postpone()
{
return false;
}
bot_packapunch_purchase_on_postpone()
{
}
bot_packapunch_purchase_priority()
{
return 0;
}
bot_revive_player()
{
}
bot_revive_process_order()
{
return 0;
}
bot_should_revive_player()
{
return false;
}
bot_revive_player_on_completion()
{
}
bot_revive_player_should_cancel()
{
return false;
}
bot_revive_player_on_cancel()
{
}
bot_revive_player_should_postpone()
{
return false;
}
bot_revive_player_on_postpone()
{
}
bot_revive_player_priority()
{
return 0;
}
bot_grab_buildable()
{
}
bot_grabbuildable_process_order()
{
return 0;
}
bot_should_grab_buildable()
{
return false;
}
bot_grab_buildable_on_completion()
{
}
bot_grab_buildable_should_cancel()
{
return false;
}
bot_grabbuild_buildable_on_cancel()
{
}
bot_grab_buildable_should_postpone()
{
return false;
}
bot_grab_buildable_on_postpone()
{
}
bot_grab_buildable_priority()
{
return 0;
}
bot_build_buildable()
{
}
bot_buildbuildable_process_order()
{
return 0;
}
bot_should_build_buildable()
{
return false;
}
bot_build_buildable_on_completion()
{
}
bot_build_buildable_should_cancel()
{
return false;
}
bot_build_buildable_on_cancel()
{
}
bot_build_buildable_should_postpone()
{
return false;
}
bot_build_buildable_on_postpone()
{
}
bot_build_buildable_priority()
{
return 0;
}
bot_grab_part()
{
}
bot_part_process_order()
{
return 0;
}
bot_should_grab_part()
{
return false;
}
bot_part_on_completion()
{
}
bot_part_should_cancel()
{
return false;
}
bot_part_on_cancel()
{
}
bot_part_should_postpone()
{
return false;
}
bot_part_on_postpone()
{
}
bot_part_priority()
{
return 0;
}
bot_grab_powerup()
{
self endon( "disconnect" );
self endon( "new_objective" );
if ( !isDefined( self.available_powerups ) || self.available_powerups.size <= 0 )
{
return;
}
self.target_pos = self.available_powerups[ 0 ].origin;
self.target_powerup = self.available_powerups[ 0 ];
level.zbots_powerups_targeted_for_grab[ level.zbots_powerups_targeted_for_grab.size ] = self.available_powerups[ 0 ];
}
bot_powerup_process_order()
{
return 0;
}
bot_should_grab_powerup()
{
if ( !( isDefined( level.zbots_powerups ) && level.zbots_powerups.size > 0 ) )
{
return false;
}
const MAX_DISTANCE_SQ = 10000 * 10000;
const BOT_SPEED_WHILE_SPRINTING_SQ = 380 * 380;
self.available_powerups = [];
for ( i = 0; i < level.zbots_powerups.size; i++ )
{
if ( array_validate( level.zbots_powerups_targeted_for_grab ) )
{
already_targeted = false;
for ( j = 0; j < level.zbots_powerups_targeted_for_grab.size; j++ )
{
if ( level.zbots_powerups_targeted_for_grab[ j ] == level.zbots_powerups[ i ] )
{
already_targeted = true;
break;
}
}
if ( already_targeted )
{
continue;
}
}
time_left = level.zbots_powerups[ i ].time_left_until_timeout;
distance_required_to_reach_powerup = distanceSquared( level.zbots_powerups[ i ].origin, self.origin );
if ( distance_required_to_reach_powerup > BOT_SPEED_WHILE_SPRINTING_SQ * time_left )
{
continue;
}
if ( distanceSquared( level.zbots_powerups[ i ].origin, self.origin ) > MAX_DISTANCE_SQ )
{
continue;
}
if ( !findPath( self.origin, level.zbots_powerups[ i ].origin ) )
{
continue;
}
self.available_powerups[ self.available_powerups.size ] = level.zbots_powerups[ i ];
}
time_left = undefined;
distance_required_to_reach_powerup = undefined;
already_targeted = undefined;
return self.available_powerups.size > 0;
}
bot_powerup_on_completion()
{
level endon( "end_game" );
self endon( "disconnect" );
self notify( "powerup_completion_func" );
self endon( "powerup_completion_func" );
self endon( "pause_bot_think" );
self endon( "powerup_cancel" );
self endon( "powerup_postpone" );
while ( !isDefined( self.target_powerup ) )
{
wait 0.05;
}
self.target_powerup waittill( "death" );
self.actions_in_queue[ "powerup" ].queued = false;
self notify( "powerup_completion" );
self.available_powerups = undefined;
self.target_pos = undefined;
}
bot_powerup_should_cancel()
{
return false;
}
bot_powerup_on_cancel()
{
}
bot_powerup_should_postpone()
{
return false;
}
bot_powerup_on_postpone()
{
}
bot_powerup_priority()
{
if ( !isDefined( self.available_powerups ) )
{
return 0;
}
return self.available_powerups[ 0 ].priority;
}