]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
determine dropship speed based on map size
authorJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Wed, 26 Jan 2022 14:38:14 +0000 (15:38 +0100)
committerJuhu <5894800-Juhu_@users.noreply.gitlab.com>
Wed, 26 Jan 2022 14:38:14 +0000 (15:38 +0100)
gamemodes-server.cfg
qcsrc/common/gamemodes/gamemode/br/sv_br.qc
qcsrc/common/gamemodes/gamemode/br/sv_dropship.qc
qcsrc/common/gamemodes/gamemode/br/sv_dropship.qh

index cefeb158d00186f33e75566bb0031b1a80284c0e..f81313c0f5e071403fd16815da17261af7959502 100644 (file)
@@ -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"
index 2f5e944fd6b24aea7dd4461ad1af531cc14ad6e5..131e53576f546e1578e8c2724e04c5f8ea8bfa1f 100644 (file)
@@ -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))
index 69d21a37020baba959c216dc8dbecc9f9c66e40c..767b5512102837d65cd33ac30c9dee7233b5560f 100644 (file)
@@ -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);
index 4aab1ab96cb1c9c6fa2fa9084849a88d697c0598..df7ac1d07340dc3104c058a1fbef4ac63baa3fbe 100644 (file)
@@ -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();