From: Juhu <5894800-Juhu_@users.noreply.gitlab.com> Date: Wed, 26 Jan 2022 14:38:14 +0000 (+0100) Subject: determine dropship speed based on map size X-Git-Url: https://git.rm.cloudns.org/?a=commitdiff_plain;h=95f1907a5b526f1b7cfb959b334d96a85288b5da;p=xonotic%2Fxonotic-data.pk3dir.git determine dropship speed based on map size --- diff --git a/gamemodes-server.cfg b/gamemodes-server.cfg index cefeb158d..f81313c0f 100644 --- a/gamemodes-server.cfg +++ b/gamemodes-server.cfg @@ -589,7 +589,7 @@ set g_br_revive_extra_size 100 "Distance in qu that you can stand from an injure set g_br_revive_health 0.25 "start health multiplier when revived" set g_br_dropship_color "0.5 0 0.5" "dropship color" set g_br_dropship_scale 3 "dropship scale" -set g_br_dropship_speed 200 "dropship speed" +set g_br_dropship_speed -1 "dropship speed, -1 to decide based on map size" set g_br_drop_damage 0.5 "multiplier of damage taken while dropping" set g_br_drop_speed_max 2 "max air speed multiplier while dropping" set g_br_drop_speed_min 1.25 "min air speed multiplier while dropping" diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc index 2f5e944fd..131e53576 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_br.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_br.qc @@ -258,7 +258,7 @@ MUTATOR_HOOKFUNCTION(br, PlayerPreThink, CBC_ORDER_FIRST) if(STAT(DROP, player) == DROP_TRANSPORT){ if(!(STAT(PRESSED_KEYS, player) & KEY_JUMP) && (dropship_path_length > player.br_squad.br_force_drop_distance)){ - player.velocity = dropship_path_direction * max(autocvar_g_br_dropship_speed, 0); + player.velocity = dropship_path_direction * dropship_speed; } else{ if(!(IN_SQUAD(player) && player.br_squad.br_squad_drop_leader)) diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_dropship.qc b/qcsrc/common/gamemodes/gamemode/br/sv_dropship.qc index 69d21a370..767b55121 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_dropship.qc +++ b/qcsrc/common/gamemodes/gamemode/br/sv_dropship.qc @@ -2,6 +2,7 @@ float autocvar_g_br_dropship_scale = 3; vector autocvar_g_br_dropship_color = '0.5 0 0.5'; +float autocvar_g_br_dropship_speed = -1; entity dropship_spawn(Vehicle info, float entity_scale, vector color); void dropship_think(entity this); @@ -45,6 +46,11 @@ entity dropship_initialize() this.angles = vectoangles(dropship_path_direction); this.velocity = '0 0 0'; + dropship_speed = autocvar_g_br_dropship_speed; + // if dropship_speed is negative adjust speed dependant on map size + if(dropship_speed < 0) + dropship_speed = vlen(vec2(world.maxs - world.mins)) / 60; // dropship needs one minute to diagonally fly over the whole map + return this; } @@ -93,8 +99,8 @@ void dropship_think(entity this) if(dropship_path_length > 0){ this.alpha = bound(0.01, dropship_path_length / autocvar_g_br_drop_distance_force, 1); - this.velocity = dropship_path_direction * autocvar_g_br_dropship_speed; - dropship_path_length -= autocvar_g_br_dropship_speed * frametime; + this.velocity = dropship_path_direction * dropship_speed; + dropship_path_length -= dropship_speed * frametime; } else{ delete(this); diff --git a/qcsrc/common/gamemodes/gamemode/br/sv_dropship.qh b/qcsrc/common/gamemodes/gamemode/br/sv_dropship.qh index 4aab1ab96..df7ac1d07 100644 --- a/qcsrc/common/gamemodes/gamemode/br/sv_dropship.qh +++ b/qcsrc/common/gamemodes/gamemode/br/sv_dropship.qh @@ -2,8 +2,8 @@ float dropship_path_length = 0; vector dropship_path_direction = '0 0 0'; +float dropship_speed = 0; float autocvar_g_br_drop_distance_force = 500; -float autocvar_g_br_dropship_speed = 200; entity dropship_initialize();