From 5c665599224538abe66adbcc67f57718f814baa6 Mon Sep 17 00:00:00 2001 From: cypress Date: Mon, 1 Jan 2024 16:01:24 -0500 Subject: [PATCH] SERVER: Scale Mystery Box down in NZ:P Beta --- source/server/entities/mystery_box.qc | 18 +++++++++- source/server/utilities/map_compatibility.qc | 35 ++++++++++++++++++++ 2 files changed, 52 insertions(+), 1 deletion(-) diff --git a/source/server/entities/mystery_box.qc b/source/server/entities/mystery_box.qc index f098bbb..72553db 100644 --- a/source/server/entities/mystery_box.qc +++ b/source/server/entities/mystery_box.qc @@ -101,6 +101,7 @@ void(entity ent) MBOX_FreeEnt = ent.classname = "freeMboxEntity"; ent.touch = SUB_Null; ent.think = SUB_Null; + ent.scale = 1; ent.effects = 0; ent.frame = 0; @@ -237,6 +238,10 @@ void() findboxspot = setmodel (newspot, mystery_box_model); newspot.frame = 0; setsize (newspot, VEC_HULL2_MIN, VEC_HULL2_MAX); + + // Scale down for NZ:P Beta + if (map_compatibility_mode == MAP_COMPAT_BETA) + newspot.scale = 0.75; } // @@ -276,6 +281,10 @@ void() MBOX_FindNewSpot = setmodel(new_box, mystery_box_model); setsize(new_box, VEC_HULL2_MIN, VEC_HULL2_MAX); + // Scale down for NZ:P Beta + if (map_compatibility_mode == MAP_COMPAT_BETA) + new_box.scale = 0.75; + // Spawn the Box Glow if permitted if (!(new_box.spawnflags & MBOX_SPAWNFLAG_NOLIGHT)) { @@ -590,7 +599,14 @@ void() Create_Floating_Weapon = gun.movetype = MOVETYPE_NOCLIP; gun.solid = SOLID_NOT; makevectors(self.angles); - gun.velocity = v_up*15; + + // Float up less in NZ:P Beta, and scale down. + if (map_compatibility_mode == MAP_COMPAT_BETA) { + gun.velocity = v_up*10; + gun.scale = 0.75; + } else { + gun.velocity = v_up*15; + } gun.owner = self; self.boxweapon = gun; diff --git a/source/server/utilities/map_compatibility.qc b/source/server/utilities/map_compatibility.qc index cb80cfc..d8218ba 100644 --- a/source/server/utilities/map_compatibility.qc +++ b/source/server/utilities/map_compatibility.qc @@ -290,6 +290,40 @@ void() Compat_ConvertBetaBarricade = void() item_cover = {map_compatibility_mode = MAP_COMPAT_BETA; item_barricade(); Compat_ConvertBetaBarricade();}; +// +// NZ:P Beta Mystery Box +// + +// +// Compat_FixMysteryBox +// Fixes the Mystery Box scale, and removes glow from +// all of the spawn points. +// +void() Compat_FixMysteryBox = +{ + entity mystery_box = find(world, classname, "mystery"); + + while(mystery_box != world) { + mystery_box.scale = 0.75; + mystery_box.spawnflags += MBOX_SPAWNFLAG_NOLIGHT; + + if (mystery_box.goaldummy) { + MBOX_FreeEnt(mystery_box.goaldummy); + mystery_box.goaldummy = world; + } + + mystery_box = find(mystery_box, classname, "mystery"); + } + + entity mystery_box_spots = find(world, classname, "mystery_box_tp_spot"); + + while(mystery_box_spots != world) { + mystery_box_spots.spawnflags += MBOX_SPAWNFLAG_NOLIGHT; + + mystery_box_spots = find(mystery_box_spots, classname, "mystery_box_tp_spot"); + } +} + // // NZ:P Beta Power Switch // @@ -375,4 +409,5 @@ void() Compat_Init = Compat_ConvertBetaWallWeapons(); Compat_ConvertPropScaling(); Compat_FixPowerSwitch(); + Compat_FixMysteryBox(); } \ No newline at end of file