From: TimePath Date: Tue, 12 May 2015 07:58:00 +0000 (+1000) Subject: Light refactoring: rename module roots to `all` for consistency X-Git-Tag: xonotic-v0.8.1~57^2 X-Git-Url: http://git.xonotic.org/?a=commitdiff_plain;h=ee6a8c2bec6a4fced519300c85a07a55405c93f7;p=xonotic%2Fxonotic-data.pk3dir.git Light refactoring: rename module roots to `all` for consistency --- diff --git a/qcsrc/client/_all.qh b/qcsrc/client/_all.qh index c8ff79d58..e758fdb7a 100644 --- a/qcsrc/client/_all.qh +++ b/qcsrc/client/_all.qh @@ -1,5 +1,5 @@ -#ifndef CLIENT___H -#define CLIENT___H +#ifndef CLIENT_ALL_H +#define CLIENT_ALL_H #include "autocvars.qh" #include "defs.qh" diff --git a/qcsrc/client/command/all.qc b/qcsrc/client/command/all.qc new file mode 100644 index 000000000..dcace6593 --- /dev/null +++ b/qcsrc/client/command/all.qc @@ -0,0 +1,5 @@ +#include "../_all.qh" + +#include "../../common/command/all.qc" + +#include "cl_cmd.qc" diff --git a/qcsrc/client/command/all.qh b/qcsrc/client/command/all.qh new file mode 100644 index 000000000..34fc423a4 --- /dev/null +++ b/qcsrc/client/command/all.qh @@ -0,0 +1,8 @@ +#ifndef CLIENT_COMMANDS_ALL_H +#define CLIENT_COMMANDS_ALL_H + +#include "../../common/command/all.qh" + +#include "cl_cmd.qh" + +#endif diff --git a/qcsrc/client/command/commands.qc b/qcsrc/client/command/commands.qc deleted file mode 100644 index dabf8f35a..000000000 --- a/qcsrc/client/command/commands.qc +++ /dev/null @@ -1,5 +0,0 @@ -#include "../_all.qh" - -#include "../../common/command/commands.qc" - -#include "cl_cmd.qc" diff --git a/qcsrc/client/command/commands.qh b/qcsrc/client/command/commands.qh deleted file mode 100644 index 65bf3dab9..000000000 --- a/qcsrc/client/command/commands.qh +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef CLIENT_COMMANDS_H -#define CLIENT_COMMANDS_H - -#include "../../common/command/commands.qh" - -#include "cl_cmd.qh" - -#endif diff --git a/qcsrc/client/damage.qc b/qcsrc/client/damage.qc index 924162138..39c422e1c 100644 --- a/qcsrc/client/damage.qc +++ b/qcsrc/client/damage.qc @@ -5,13 +5,13 @@ #include "movetypes.qh" #include "prandom.qh" -#include "vehicles/vehicles.qh" +#include "vehicles/all.qh" #include "../common/constants.qh" #include "../common/deathtypes.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" .entity tag_entity; diff --git a/qcsrc/client/hud.qh b/qcsrc/client/hud.qh index f880a810f..4e12dc56b 100644 --- a/qcsrc/client/hud.qh +++ b/qcsrc/client/hud.qh @@ -1,7 +1,7 @@ #ifndef HUD_H #define HUD_H -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" const int HUD_PANEL_MAX = 24; entity hud_panel[HUD_PANEL_MAX]; diff --git a/qcsrc/client/main.qc b/qcsrc/client/main.qc index 5343c180c..298bcdbef 100644 --- a/qcsrc/client/main.qc +++ b/qcsrc/client/main.qc @@ -25,21 +25,21 @@ #include "waypointsprites.qh" #include "vehicles/bumblebee.qh" -#include "vehicles/vehicles.qh" +#include "vehicles/all.qh" #include "weapons/projectile.qh" #include "../common/buffs.qh" #include "../common/deathtypes.qh" #include "../common/mapinfo.qh" -#include "../common/monsters/monsters.qh" +#include "../common/monsters/all.qh" #include "../common/nades.qh" #include "../common/net_notice.qh" #include "../common/notifications.qh" #include "../common/stats.qh" #include "../common/teams.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/cl_model.qh" #include "../csqcmodellib/interpolate.qh" diff --git a/qcsrc/client/progs.src b/qcsrc/client/progs.src index 36d159c75..843ae12a4 100644 --- a/qcsrc/client/progs.src +++ b/qcsrc/client/progs.src @@ -37,10 +37,10 @@ view.qc wall.qc waypointsprites.qc -command/commands.qc +command/all.qc vehicles/bumblebee.qc -vehicles/vehicles.qc +vehicles/all.qc weapons/projectile.qc // TODO @@ -55,9 +55,9 @@ weapons/projectile.qc // TODO ../common/urllib.qc ../common/util.qc -../common/monsters/monsters.qc +../common/monsters/all.qc -../common/weapons/weapons.qc // TODO +../common/weapons/all.qc // TODO ../csqcmodellib/cl_model.qc ../csqcmodellib/cl_player.qc diff --git a/qcsrc/client/t_items.qc b/qcsrc/client/t_items.qc index f9ebb9786..ca631fcbd 100644 --- a/qcsrc/client/t_items.qc +++ b/qcsrc/client/t_items.qc @@ -3,7 +3,7 @@ #include "movetypes.qh" #include "../common/buffs.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/cl_model.qh" #include "../csqcmodellib/common.qh" diff --git a/qcsrc/client/vehicles/all.qc b/qcsrc/client/vehicles/all.qc new file mode 100644 index 000000000..0af4d4b96 --- /dev/null +++ b/qcsrc/client/vehicles/all.qc @@ -0,0 +1,1054 @@ +#include "all.qh" +#include "../_all.qh" + +#include "../movetypes.qh" +#include "../movetypes.qh" +#include "../prandom.qh" +#include "../scoreboard.qh" +#include "../t_items.qh" + +#include "../../common/buffs.qh" +#include "../../common/constants.qh" +#include "../../common/stats.qh" +#include "../../common/util.qh" + +#include "../../csqcmodellib/cl_model.qh" + +.float cnt; + +const string hud_bg = "gfx/vehicles/frame.tga"; +const string hud_sh = "gfx/vehicles/vh-shield.tga"; + +const string hud_hp_bar = "gfx/vehicles/bar_up_left.tga"; +const string hud_hp_ico = "gfx/vehicles/health.tga"; +const string hud_sh_bar = "gfx/vehicles/bar_dwn_left.tga"; +const string hud_sh_ico = "gfx/vehicles/shield.tga"; + +const string hud_ammo1_bar = "gfx/vehicles/bar_up_right.tga"; +const string hud_ammo1_ico = "gfx/vehicles/bullets.tga"; +const string hud_ammo2_bar = "gfx/vehicles/bar_dwn_right.tga"; +const string hud_ammo2_ico = "gfx/vehicles/rocket.tga"; +const string hud_energy = "gfx/vehicles/energy.tga"; + +const int SBRM_FIRST = 1; +const int SBRM_VOLLY = 1; +const int SBRM_GUIDE = 2; +const int SBRM_ARTILLERY = 3; +const int SBRM_LAST = 3; + +const int RSM_FIRST = 1; +const int RSM_BOMB = 1; +const int RSM_FLARE = 2; +const int RSM_LAST = 2; + +entity dropmark; +float autocvar_cl_vehicles_hudscale = 0.5; +float autocvar_cl_vehicles_hudalpha = 0.75; + +const string raptor_ico = "gfx/vehicles/raptor.tga"; +const string raptor_gun = "gfx/vehicles/raptor_guns.tga"; +const string raptor_bomb = "gfx/vehicles/raptor_bombs.tga"; +const string raptor_drop = "gfx/vehicles/axh-dropcross.tga"; +string raptor_xhair; + + + +const int MAX_AXH = 4; +entity AuxiliaryXhairs[MAX_AXH]; + +entityclass(AuxiliaryXhair); +class(AuxiliaryXhair) .string axh_image; +class(AuxiliaryXhair) .float axh_fadetime; +class(AuxiliaryXhair) .float axh_drawflag; +class(AuxiliaryXhair) .float axh_scale; + +const string bumb_ico = "gfx/vehicles/bumb.tga"; +const string bumb_lgun = "gfx/vehicles/bumb_lgun.tga"; +const string bumb_rgun = "gfx/vehicles/bumb_rgun.tga"; + +const string bumb_gun_ico = "gfx/vehicles/bumb_side.tga"; +const string bumb_gun_gun = "gfx/vehicles/bumb_side_gun.tga"; + +const string spider_ico = "gfx/vehicles/sbot.tga"; +const string spider_rkt = "gfx/vehicles/sbot_rpods.tga"; +const string spider_mgun = "gfx/vehicles/sbot_mguns.tga"; +string spider_xhair; // = "gfx/vehicles/axh-special1.tga"; + +const string waki_ico = "gfx/vehicles/waki.tga"; +const string waki_eng = "gfx/vehicles/waki_e.tga"; +const string waki_gun = "gfx/vehicles/waki_guns.tga"; +const string waki_rkt = "gfx/vehicles/waki_rockets.tga"; +const string waki_xhair = "gfx/vehicles/axh-special1.tga"; + +float alarm1time; +float alarm2time; +int weapon2mode; + +void AuxiliaryXhair_Draw2D() +{ + vector loc, psize; + + psize = self.axh_scale * draw_getimagesize(self.axh_image); + loc = project_3d_to_2d(self.move_origin) - 0.5 * psize; + if (!(loc.z < 0 || loc.x < 0 || loc.y < 0 || loc.x > vid_conwidth || loc.y > vid_conheight)) + { + loc.z = 0; + psize.z = 0; + drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag); + } + + if(time - self.cnt > self.axh_fadetime) + self.draw2d = func_null; +} + +void Net_AuXair2(bool bIsNew) +{ + int axh_id = bound(0, ReadByte(), MAX_AXH); + entity axh = AuxiliaryXhairs[axh_id]; + + if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) + { + axh = spawn(); + axh.draw2d = func_null; + axh.drawmask = MASK_NORMAL; + axh.axh_drawflag = DRAWFLAG_ADDITIVE; + axh.axh_fadetime = 0.1; + axh.axh_image = "gfx/vehicles/axh-ring.tga"; + axh.axh_scale = 1; + axh.alpha = 1; + AuxiliaryXhairs[axh_id] = axh; + } + + axh.move_origin_x = ReadCoord(); + axh.move_origin_y = ReadCoord(); + axh.move_origin_z = ReadCoord(); + axh.colormod_x = ReadByte() / 255; + axh.colormod_y = ReadByte() / 255; + axh.colormod_z = ReadByte() / 255; + axh.cnt = time; + axh.draw2d = AuxiliaryXhair_Draw2D; +} + +void Net_VehicleSetup() +{ + int hud_id = ReadByte(); + + // Weapon update? + if(hud_id > HUD_VEHICLE_LAST) + { + weapon2mode = hud_id - HUD_VEHICLE_LAST; + return; + } + + // hud_id == 0 means we exited a vehicle, so stop alarm sound/s + if(hud_id == 0) + { + sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + return; + } + + hud_id = bound(HUD_VEHICLE_FIRST, hud_id, HUD_VEHICLE_LAST); + + // Init auxiliary crosshairs + int i; + for(i = 0; i < MAX_AXH; ++i) + { + entity axh = AuxiliaryXhairs[i]; + if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) + remove(axh); + + axh = spawn(); + axh.draw2d = func_null; + axh.drawmask = MASK_NORMAL; + axh.axh_drawflag = DRAWFLAG_NORMAL; + axh.axh_fadetime = 0.1; + axh.axh_image = "gfx/vehicles/axh-ring.tga"; + axh.axh_scale = 1; + axh.alpha = 1; + AuxiliaryXhairs[i] = axh; + } + + switch(hud_id) + { + case HUD_SPIDERBOT: + // Minigun1 + AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-ring.tga"; + AuxiliaryXhairs[0].axh_scale = 0.25; + // Minigun2 + AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-ring.tga"; + AuxiliaryXhairs[1].axh_scale = 0.25; + // Rocket + AuxiliaryXhairs[2].axh_image = "gfx/vehicles/axh-special1.tga"; + AuxiliaryXhairs[2].axh_scale = 0.5; + break; + + case HUD_WAKIZASHI: + AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-bracket.tga"; + AuxiliaryXhairs[0].axh_scale = 0.25; + break; + + case HUD_RAPTOR: + AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-special2.tga"; + AuxiliaryXhairs[0].axh_scale = 0.5; + //AuxiliaryXhair[0].alpha = 0.5; + + AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-bracket.tga"; + AuxiliaryXhairs[1].axh_scale = 0.25; + //AuxiliaryXhair[1].alpha = 0.75; + //AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL; + break; + + case HUD_BUMBLEBEE: + // Raygun-locked + AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-bracket.tga"; + AuxiliaryXhairs[0].axh_scale = 0.5; + + // Gunner1 + AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-target.tga"; + AuxiliaryXhairs[1].axh_scale = 0.75; + + // Gunner2 + AuxiliaryXhairs[2].axh_image = "gfx/vehicles/axh-target.tga"; + AuxiliaryXhairs[2].axh_scale = 0.75; + break; + case HUD_BUMBLEBEE_GUN: + // Plasma cannons + AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-bracket.tga"; + AuxiliaryXhairs[0].axh_scale = 0.25; + // Raygun + AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-bracket.tga"; + AuxiliaryXhairs[1].axh_scale = 0.25; + break; + } +} +#define HUD_GETSTATS \ + int vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \ + float shield = getstati(STAT_VEHICLESTAT_SHIELD); \ + noref int energy = getstati(STAT_VEHICLESTAT_ENERGY); \ + noref float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \ + noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \ + noref int ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \ + noref int reload2 = getstati(STAT_VEHICLESTAT_RELOAD2); + +void CSQC_BUMBLE_HUD() +{ +/* + drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); + drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); + drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL); + drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); +*/ + if(autocvar_r_letterbox) + return; + + vector picsize, hudloc = '0 0 0', pic2size, picloc; + + // Fetch health & ammo stats + HUD_GETSTATS + + picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; + hudloc.y = vid_conheight - picsize.y; + hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5; + + drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); + + shield *= 0.01; + vh_health *= 0.01; + energy *= 0.01; + reload1 *= 0.01; + + pic2size = draw_getimagesize(bumb_ico) * (autocvar_cl_vehicles_hudscale * 0.8); + picloc = picsize * 0.5 - pic2size * 0.5; + + if(vh_health < 0.25) + drawpic(hudloc + picloc, bumb_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, bumb_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); + + drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); + +// Health bar + picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); + drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; + picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; + if(vh_health < 0.25) + { + if(alarm1time < time) + { + alarm1time = time + 2; + sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); + } + + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + if(alarm1time) + { + sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + alarm1time = 0; + } + } + +// Shield bar + picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight); + drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; + if(shield < 0.25) + { + if(alarm2time < time) + { + alarm2time = time + 1; + sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE); + } + drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + if(alarm2time) + { + sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + alarm2time = 0; + } + } + + ammo1 *= 0.01; + ammo2 *= 0.01; + +// Gunner1 bar + picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; + picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * ammo1, vid_conheight); + drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); + +// Right gunner slot occupied? + if(!AuxiliaryXhairs[1].draw2d) + { + shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y)); + drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL); + drawstring(hudloc + picloc + '1 0 0' * shield, _("No right gunner!"), '1 0 0' * picsize.y + '0 1 0' * picsize.y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL); + } + +// .. and icon + picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale; + picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; + if(ammo1 < 0.2) + drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + +// Gunner2 bar + picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; + picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * ammo2, vid_conheight); + drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// Left gunner slot occupied? + if(!AuxiliaryXhairs[2].draw2d) + { + shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y)); + drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL); + drawstring(hudloc + picloc + '1 0 0' * shield, _("No left gunner!"), '1 0 0' * picsize.y + '0 1 0' * picsize.y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL); + } + +// .. and icon + picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale; + picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; + if(ammo2 < 0.2) + drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + + if (scoreboard_showscores) + HUD_DrawScoreboard(); + else + { + picsize = draw_getimagesize(waki_xhair); + picsize.x *= 0.5; + picsize.y *= 0.5; + drawpic('0.5 0 0' * (vid_conwidth - picsize.x) + '0 0.5 0' * (vid_conheight - picsize.y), waki_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + } + +} + +void CSQC_BUMBLE_GUN_HUD() +{ + + if(autocvar_r_letterbox) + return; + + vector picsize, hudloc = '0 0 0', pic2size, picloc; + + // Fetch health & ammo stats + HUD_GETSTATS + + picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; + hudloc.y = vid_conheight - picsize.y; + hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5; + + drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); + + shield *= 0.01; + vh_health *= 0.01; + energy *= 0.01; + reload1 *= 0.01; + + pic2size = draw_getimagesize(bumb_gun_ico) * (autocvar_cl_vehicles_hudscale * 0.8); + picloc = picsize * 0.5 - pic2size * 0.5; + + if(vh_health < 0.25) + drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); + + drawpic(hudloc + picloc, bumb_gun_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); + +// Health bar + picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); + drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; + picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; + if(vh_health < 0.25) + { + if(alarm1time < time) + { + alarm1time = time + 2; + sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); + } + + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + if(alarm1time) + { + sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + alarm1time = 0; + } + } + +// Shield bar + picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight); + drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; + if(shield < 0.25) + { + if(alarm2time < time) + { + alarm2time = time + 1; + sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE); + } + drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + if(alarm2time) + { + sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + alarm2time = 0; + } + } + +// Gun bar + picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; + picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * energy, vid_conheight); + drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); + +// .. and icon + picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale; + picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; + if(energy < 0.2) + drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + + if (scoreboard_showscores) + HUD_DrawScoreboard(); + /* + else + { + picsize = draw_getimagesize(waki_xhair); + picsize_x *= 0.5; + picsize_y *= 0.5; + + + drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), waki_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + } + */ +} + + + +void CSQC_SPIDER_HUD() +{ + if(autocvar_r_letterbox) + return; + + vector picsize, hudloc = '0 0 0', pic2size, picloc; + int i; + + // Fetch health & ammo stats + HUD_GETSTATS + + picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; + hudloc.y = vid_conheight - picsize.y; + hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5; + + drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); + + ammo1 *= 0.01; + shield *= 0.01; + vh_health *= 0.01; + reload2 *= 0.01; + + pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); + picloc = picsize * 0.5 - pic2size * 0.5; + if(vh_health < 0.25) + drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); + +// Health bar + picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); + drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; + picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; + if(vh_health < 0.25) + { + if(alarm1time < time) + { + alarm1time = time + 2; + sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); + } + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + if(alarm1time) + { + sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + alarm1time = 0; + } + } +// Shield bar + picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight); + drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; + if(shield < 0.25) + { + if(alarm2time < time) + { + alarm2time = time + 1; + sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE); + } + drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + if(alarm2time) + { + sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + alarm2time = 0; + } + } + +// Minigun bar + picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; + picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * ammo1, vid_conheight); + drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; + picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; + if(ammo1 < 0.2) + drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + +// Rocket ammo bar + picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; + ammo1 = picsize.x / 8; + picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x, hudloc.y + picloc.y, picsize.x * reload2, vid_conheight); + drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); + +// .. and icons + pic2size = 0.35 * draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; + picloc.x -= pic2size.x; + picloc.y += pic2size.y * 2.25; + if(ammo2 == 9) + { + for(i = 1; i < 9; ++i) + { + picloc.x += ammo1; + drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL); + } + } + else + { + for(i = 1; i < 9; ++i) + { + picloc.x += ammo1; + drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL); + } + } + pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; + picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; + if(ammo2 == 9) + drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL); + + if (scoreboard_showscores) + HUD_DrawScoreboard(); + else + { + switch(weapon2mode) + { + case SBRM_VOLLY: + spider_xhair = "gfx/vehicles/axh-bracket.tga"; + break; + case SBRM_GUIDE: + spider_xhair = "gfx/vehicles/axh-cross.tga"; + break; + case SBRM_ARTILLERY: + spider_xhair = "gfx/vehicles/axh-tag.tga"; + break; + default: + spider_xhair= "gfx/vehicles/axh-tag.tga"; + } + + picsize = draw_getimagesize(spider_xhair); + picsize.x *= autocvar_cl_vehicle_spiderbot_cross_size; + picsize.y *= autocvar_cl_vehicle_spiderbot_cross_size; + + drawpic('0.5 0 0' * (vid_conwidth - picsize.x) + '0 0.5 0' * (vid_conheight - picsize.y), spider_xhair, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_ADDITIVE); + } +} + +void CSQC_RAPTOR_HUD() +{ + if(autocvar_r_letterbox) + return; + + vector picsize, hudloc = '0 0 0', pic2size, picloc; + + // Fetch health & ammo stats + HUD_GETSTATS + + picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; + hudloc.y = vid_conheight - picsize.y; + hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5; + + drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); + + ammo1 *= 0.01; + ammo2 *= 0.01; + shield *= 0.01; + vh_health *= 0.01; + energy *= 0.01; + reload1 = reload2 * 0.01; + //reload2 *= 0.01; + + pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); + picloc = picsize * 0.5 - pic2size * 0.5; + if(vh_health < 0.25) + drawpic(hudloc + picloc, raptor_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); + +// Health bar + picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); + drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; + picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; + if(vh_health < 0.25) + { + if(alarm1time < time) + { + alarm1time = time + 2; + sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); + } + + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + if(alarm1time) + { + sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + alarm1time = 0; + } + } + +// Shield bar + picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight); + drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; + if(shield < 0.25) + { + if(alarm2time < time) + { + alarm2time = time + 1; + sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE); + } + drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + if(alarm2time) + { + sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + alarm2time = 0; + } + } + +// Gun bar + picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; + picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * energy, vid_conheight); + drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; + picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; + if(energy < 0.2) + drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + +// Bomb bar + picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; + picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x, hudloc.y + picloc.y, picsize.x * reload1, vid_conheight); + drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; + picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; + if(reload1 != 1) + drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL); + + if(weapon2mode == RSM_FLARE) + { + raptor_xhair = "gfx/vehicles/axh-bracket.tga"; + } + else + { + raptor_xhair = "gfx/vehicles/axh-ring.tga"; + + // Bombing crosshair + if(!dropmark) + { + dropmark = spawn(); + dropmark.owner = self; + dropmark.gravity = 1; + } + + if(reload2 == 100) + { + vector where; + + setorigin(dropmark, pmove_org); + dropmark.velocity = pmove_vel; + tracetoss(dropmark, self); + + where = project_3d_to_2d(trace_endpos); + + setorigin(dropmark, trace_endpos); + picsize = draw_getimagesize(raptor_drop) * 0.2; + + if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight)) + { + where.x -= picsize.x * 0.5; + where.y -= picsize.y * 0.5; + where.z = 0; + drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE); + } + dropmark.cnt = time + 5; + } + else + { + vector where; + if(dropmark.cnt > time) + { + where = project_3d_to_2d(dropmark.origin); + picsize = draw_getimagesize(raptor_drop) * 0.25; + + if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight)) + { + where.x -= picsize.x * 0.5; + where.y -= picsize.y * 0.5; + where.z = 0; + drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE); + } + } + } + } + + if (scoreboard_showscores) + HUD_DrawScoreboard(); + else + { + picsize = draw_getimagesize(raptor_xhair); + picsize.x *= 0.5; + picsize.y *= 0.5; + + drawpic('0.5 0 0' * (vid_conwidth - picsize.x) + '0 0.5 0' * (vid_conheight - picsize.y), raptor_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + } +} + +void CSQC_WAKIZASHI_HUD() +{ +/* + drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); + drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); + drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL); + drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); +*/ + if(autocvar_r_letterbox) + return; + + vector picsize, hudloc = '0 0 0', pic2size, picloc; + + // Fetch health & ammo stats + HUD_GETSTATS + + picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; + hudloc.y = vid_conheight - picsize.y; + hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5; + + drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); + + shield *= 0.01; + vh_health *= 0.01; + energy *= 0.01; + reload1 *= 0.01; + + pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); + picloc = picsize * 0.5 - pic2size * 0.5; + if(vh_health < 0.25) + drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL); + drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); + +// Health bar + picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); + drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; + picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; + if(vh_health < 0.25) + { + if(alarm1time < time) + { + alarm1time = time + 2; + sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); + } + + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + if(alarm1time) + { + sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + alarm1time = 0; + } + } + + +// Shield bar + picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; + picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight); + drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; + picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; + if(shield < 0.25) + { + if(alarm2time < time) + { + alarm2time = time + 1; + sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE); + } + drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + } + else + { + drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + if(alarm2time) + { + sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); + alarm2time = 0; + } + } + +// Gun bar + picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; + picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * energy, vid_conheight); + drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; + picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; + if(energy < 0.2) + drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + +// Bomb bar + picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; + picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; + drawsetcliparea(hudloc.x + picloc.x, hudloc.y + picloc.y, picsize.x * reload1, vid_conheight); + drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + drawresetcliparea(); +// .. and icon + pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; + picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; + if(reload1 != 1) + drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); + else + drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL); + + if (scoreboard_showscores) + HUD_DrawScoreboard(); + else + { + picsize = draw_getimagesize(waki_xhair); + picsize.x *= 0.5; + picsize.y *= 0.5; + + + drawpic('0.5 0 0' * (vid_conwidth - picsize.x) + '0 0.5 0' * (vid_conheight - picsize.y), waki_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); + } +} + +void Vehicles_Precache() +{ + precache_model("models/vehicles/bomblet.md3"); + precache_model("models/vehicles/clusterbomb.md3"); + precache_model("models/vehicles/clusterbomb_fragment.md3"); + precache_model("models/vehicles/rocket01.md3"); + precache_model("models/vehicles/rocket02.md3"); + + precache_sound ("vehicles/alarm.wav"); + precache_sound ("vehicles/alarm_shield.wav"); +} + +void RaptorCBShellfragDraw() +{ + if(wasfreed(self)) + return; + + Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy); + self.move_avelocity += randomvec() * 15; + self.renderflags = 0; + + if(self.cnt < time) + self.alpha = bound(0, self.nextthink - time, 1); + + if(self.alpha < ALPHA_MIN_VISIBLE) + remove(self); +} + +void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang) +{ + entity sfrag; + + sfrag = spawn(); + setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3"); + setorigin(sfrag, _org); + + sfrag.move_movetype = MOVETYPE_BOUNCE; + sfrag.gravity = 0.15; + sfrag.solid = SOLID_CORPSE; + + sfrag.draw = RaptorCBShellfragDraw; + + sfrag.move_origin = sfrag.origin = _org; + sfrag.move_velocity = _vel; + sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity); + sfrag.angles = self.move_angles = _ang; + + sfrag.move_time = time; + sfrag.damageforcescale = 4; + + sfrag.nextthink = time + 3; + sfrag.cnt = time + 2; + sfrag.alpha = 1; + sfrag.drawmask = MASK_NORMAL; +} diff --git a/qcsrc/client/vehicles/all.qh b/qcsrc/client/vehicles/all.qh new file mode 100644 index 000000000..f92ab82b3 --- /dev/null +++ b/qcsrc/client/vehicles/all.qh @@ -0,0 +1,16 @@ +#ifndef VEHICLES_ALL_H +#define VEHICLES_ALL_H + +void RaptorCBShellfragDraw(); +void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang); +void Vehicles_Precache(); +void Net_AuXair2(bool bIsNew); +void Net_VehicleSetup(); + +void CSQC_WAKIZASHI_HUD(); +void CSQC_SPIDER_HUD(); +void CSQC_RAPTOR_HUD(); +void CSQC_BUMBLE_HUD(); +void CSQC_BUMBLE_GUN_HUD(); + +#endif diff --git a/qcsrc/client/vehicles/vehicles.qc b/qcsrc/client/vehicles/vehicles.qc deleted file mode 100644 index 1582ecfcb..000000000 --- a/qcsrc/client/vehicles/vehicles.qc +++ /dev/null @@ -1,1054 +0,0 @@ -#include "vehicles.qh" -#include "../_all.qh" - -#include "../movetypes.qh" -#include "../movetypes.qh" -#include "../prandom.qh" -#include "../scoreboard.qh" -#include "../t_items.qh" - -#include "../../common/buffs.qh" -#include "../../common/constants.qh" -#include "../../common/stats.qh" -#include "../../common/util.qh" - -#include "../../csqcmodellib/cl_model.qh" - -.float cnt; - -const string hud_bg = "gfx/vehicles/frame.tga"; -const string hud_sh = "gfx/vehicles/vh-shield.tga"; - -const string hud_hp_bar = "gfx/vehicles/bar_up_left.tga"; -const string hud_hp_ico = "gfx/vehicles/health.tga"; -const string hud_sh_bar = "gfx/vehicles/bar_dwn_left.tga"; -const string hud_sh_ico = "gfx/vehicles/shield.tga"; - -const string hud_ammo1_bar = "gfx/vehicles/bar_up_right.tga"; -const string hud_ammo1_ico = "gfx/vehicles/bullets.tga"; -const string hud_ammo2_bar = "gfx/vehicles/bar_dwn_right.tga"; -const string hud_ammo2_ico = "gfx/vehicles/rocket.tga"; -const string hud_energy = "gfx/vehicles/energy.tga"; - -const int SBRM_FIRST = 1; -const int SBRM_VOLLY = 1; -const int SBRM_GUIDE = 2; -const int SBRM_ARTILLERY = 3; -const int SBRM_LAST = 3; - -const int RSM_FIRST = 1; -const int RSM_BOMB = 1; -const int RSM_FLARE = 2; -const int RSM_LAST = 2; - -entity dropmark; -float autocvar_cl_vehicles_hudscale = 0.5; -float autocvar_cl_vehicles_hudalpha = 0.75; - -const string raptor_ico = "gfx/vehicles/raptor.tga"; -const string raptor_gun = "gfx/vehicles/raptor_guns.tga"; -const string raptor_bomb = "gfx/vehicles/raptor_bombs.tga"; -const string raptor_drop = "gfx/vehicles/axh-dropcross.tga"; -string raptor_xhair; - - - -const int MAX_AXH = 4; -entity AuxiliaryXhairs[MAX_AXH]; - -entityclass(AuxiliaryXhair); -class(AuxiliaryXhair) .string axh_image; -class(AuxiliaryXhair) .float axh_fadetime; -class(AuxiliaryXhair) .float axh_drawflag; -class(AuxiliaryXhair) .float axh_scale; - -const string bumb_ico = "gfx/vehicles/bumb.tga"; -const string bumb_lgun = "gfx/vehicles/bumb_lgun.tga"; -const string bumb_rgun = "gfx/vehicles/bumb_rgun.tga"; - -const string bumb_gun_ico = "gfx/vehicles/bumb_side.tga"; -const string bumb_gun_gun = "gfx/vehicles/bumb_side_gun.tga"; - -const string spider_ico = "gfx/vehicles/sbot.tga"; -const string spider_rkt = "gfx/vehicles/sbot_rpods.tga"; -const string spider_mgun = "gfx/vehicles/sbot_mguns.tga"; -string spider_xhair; // = "gfx/vehicles/axh-special1.tga"; - -const string waki_ico = "gfx/vehicles/waki.tga"; -const string waki_eng = "gfx/vehicles/waki_e.tga"; -const string waki_gun = "gfx/vehicles/waki_guns.tga"; -const string waki_rkt = "gfx/vehicles/waki_rockets.tga"; -const string waki_xhair = "gfx/vehicles/axh-special1.tga"; - -float alarm1time; -float alarm2time; -int weapon2mode; - -void AuxiliaryXhair_Draw2D() -{ - vector loc, psize; - - psize = self.axh_scale * draw_getimagesize(self.axh_image); - loc = project_3d_to_2d(self.move_origin) - 0.5 * psize; - if (!(loc.z < 0 || loc.x < 0 || loc.y < 0 || loc.x > vid_conwidth || loc.y > vid_conheight)) - { - loc.z = 0; - psize.z = 0; - drawpic(loc, self.axh_image, psize, self.colormod, self.alpha, self.axh_drawflag); - } - - if(time - self.cnt > self.axh_fadetime) - self.draw2d = func_null; -} - -void Net_AuXair2(bool bIsNew) -{ - int axh_id = bound(0, ReadByte(), MAX_AXH); - entity axh = AuxiliaryXhairs[axh_id]; - - if(axh == world || wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) - { - axh = spawn(); - axh.draw2d = func_null; - axh.drawmask = MASK_NORMAL; - axh.axh_drawflag = DRAWFLAG_ADDITIVE; - axh.axh_fadetime = 0.1; - axh.axh_image = "gfx/vehicles/axh-ring.tga"; - axh.axh_scale = 1; - axh.alpha = 1; - AuxiliaryXhairs[axh_id] = axh; - } - - axh.move_origin_x = ReadCoord(); - axh.move_origin_y = ReadCoord(); - axh.move_origin_z = ReadCoord(); - axh.colormod_x = ReadByte() / 255; - axh.colormod_y = ReadByte() / 255; - axh.colormod_z = ReadByte() / 255; - axh.cnt = time; - axh.draw2d = AuxiliaryXhair_Draw2D; -} - -void Net_VehicleSetup() -{ - int hud_id = ReadByte(); - - // Weapon update? - if(hud_id > HUD_VEHICLE_LAST) - { - weapon2mode = hud_id - HUD_VEHICLE_LAST; - return; - } - - // hud_id == 0 means we exited a vehicle, so stop alarm sound/s - if(hud_id == 0) - { - sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - return; - } - - hud_id = bound(HUD_VEHICLE_FIRST, hud_id, HUD_VEHICLE_LAST); - - // Init auxiliary crosshairs - int i; - for(i = 0; i < MAX_AXH; ++i) - { - entity axh = AuxiliaryXhairs[i]; - if(axh != world && !wasfreed(axh)) // MADNESS? THIS IS QQQQCCCCCCCCC (wasfreed, why do you exsist?) - remove(axh); - - axh = spawn(); - axh.draw2d = func_null; - axh.drawmask = MASK_NORMAL; - axh.axh_drawflag = DRAWFLAG_NORMAL; - axh.axh_fadetime = 0.1; - axh.axh_image = "gfx/vehicles/axh-ring.tga"; - axh.axh_scale = 1; - axh.alpha = 1; - AuxiliaryXhairs[i] = axh; - } - - switch(hud_id) - { - case HUD_SPIDERBOT: - // Minigun1 - AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-ring.tga"; - AuxiliaryXhairs[0].axh_scale = 0.25; - // Minigun2 - AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-ring.tga"; - AuxiliaryXhairs[1].axh_scale = 0.25; - // Rocket - AuxiliaryXhairs[2].axh_image = "gfx/vehicles/axh-special1.tga"; - AuxiliaryXhairs[2].axh_scale = 0.5; - break; - - case HUD_WAKIZASHI: - AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-bracket.tga"; - AuxiliaryXhairs[0].axh_scale = 0.25; - break; - - case HUD_RAPTOR: - AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-special2.tga"; - AuxiliaryXhairs[0].axh_scale = 0.5; - //AuxiliaryXhair[0].alpha = 0.5; - - AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-bracket.tga"; - AuxiliaryXhairs[1].axh_scale = 0.25; - //AuxiliaryXhair[1].alpha = 0.75; - //AuxiliaryXhair[1].axh_drawflag = DRAWFLAG_NORMAL; - break; - - case HUD_BUMBLEBEE: - // Raygun-locked - AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-bracket.tga"; - AuxiliaryXhairs[0].axh_scale = 0.5; - - // Gunner1 - AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-target.tga"; - AuxiliaryXhairs[1].axh_scale = 0.75; - - // Gunner2 - AuxiliaryXhairs[2].axh_image = "gfx/vehicles/axh-target.tga"; - AuxiliaryXhairs[2].axh_scale = 0.75; - break; - case HUD_BUMBLEBEE_GUN: - // Plasma cannons - AuxiliaryXhairs[0].axh_image = "gfx/vehicles/axh-bracket.tga"; - AuxiliaryXhairs[0].axh_scale = 0.25; - // Raygun - AuxiliaryXhairs[1].axh_image = "gfx/vehicles/axh-bracket.tga"; - AuxiliaryXhairs[1].axh_scale = 0.25; - break; - } -} -#define HUD_GETSTATS \ - int vh_health = getstati(STAT_VEHICLESTAT_HEALTH); \ - float shield = getstati(STAT_VEHICLESTAT_SHIELD); \ - noref int energy = getstati(STAT_VEHICLESTAT_ENERGY); \ - noref float ammo1 = getstati(STAT_VEHICLESTAT_AMMO1); \ - noref float reload1 = getstati(STAT_VEHICLESTAT_RELOAD1); \ - noref int ammo2 = getstati(STAT_VEHICLESTAT_AMMO2); \ - noref int reload2 = getstati(STAT_VEHICLESTAT_RELOAD2); - -void CSQC_BUMBLE_HUD() -{ -/* - drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); - drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); - drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL); - drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); -*/ - if(autocvar_r_letterbox) - return; - - vector picsize, hudloc = '0 0 0', pic2size, picloc; - - // Fetch health & ammo stats - HUD_GETSTATS - - picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; - hudloc.y = vid_conheight - picsize.y; - hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5; - - drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); - - shield *= 0.01; - vh_health *= 0.01; - energy *= 0.01; - reload1 *= 0.01; - - pic2size = draw_getimagesize(bumb_ico) * (autocvar_cl_vehicles_hudscale * 0.8); - picloc = picsize * 0.5 - pic2size * 0.5; - - if(vh_health < 0.25) - drawpic(hudloc + picloc, bumb_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, bumb_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); - - drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, bumb_lgun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); - -// Health bar - picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; - picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); - drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; - picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; - if(vh_health < 0.25) - { - if(alarm1time < time) - { - alarm1time = time + 2; - sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); - } - - drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - if(alarm1time) - { - sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - alarm1time = 0; - } - } - -// Shield bar - picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; - picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight); - drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; - picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; - if(shield < 0.25) - { - if(alarm2time < time) - { - alarm2time = time + 1; - sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE); - } - drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - if(alarm2time) - { - sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - alarm2time = 0; - } - } - - ammo1 *= 0.01; - ammo2 *= 0.01; - -// Gunner1 bar - picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * ammo1, vid_conheight); - drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); - -// Right gunner slot occupied? - if(!AuxiliaryXhairs[1].draw2d) - { - shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No right gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y)); - drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL); - drawstring(hudloc + picloc + '1 0 0' * shield, _("No right gunner!"), '1 0 0' * picsize.y + '0 1 0' * picsize.y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL); - } - -// .. and icon - picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale; - picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; - if(ammo1 < 0.2) - drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - -// Gunner2 bar - picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * ammo2, vid_conheight); - drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// Left gunner slot occupied? - if(!AuxiliaryXhairs[2].draw2d) - { - shield = (picsize.x * 0.5) - (0.5 * stringwidth(_("No left gunner!"), false, '1 0 0' * picsize.y + '0 1 0' * picsize.y)); - drawfill(hudloc + picloc - '0.2 0.2 0', picsize + '0.4 0.4 0', '0.25 0.25 0.25', 0.75, DRAWFLAG_NORMAL); - drawstring(hudloc + picloc + '1 0 0' * shield, _("No left gunner!"), '1 0 0' * picsize.y + '0 1 0' * picsize.y, '1 0 0' + '0 1 1' * sin(time * 10), 1, DRAWFLAG_NORMAL); - } - -// .. and icon - picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale; - picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; - if(ammo2 < 0.2) - drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - - if (scoreboard_showscores) - HUD_DrawScoreboard(); - else - { - picsize = draw_getimagesize(waki_xhair); - picsize.x *= 0.5; - picsize.y *= 0.5; - drawpic('0.5 0 0' * (vid_conwidth - picsize.x) + '0 0.5 0' * (vid_conheight - picsize.y), waki_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - } - -} - -void CSQC_BUMBLE_GUN_HUD() -{ - - if(autocvar_r_letterbox) - return; - - vector picsize, hudloc = '0 0 0', pic2size, picloc; - - // Fetch health & ammo stats - HUD_GETSTATS - - picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; - hudloc.y = vid_conheight - picsize.y; - hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5; - - drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); - - shield *= 0.01; - vh_health *= 0.01; - energy *= 0.01; - reload1 *= 0.01; - - pic2size = draw_getimagesize(bumb_gun_ico) * (autocvar_cl_vehicles_hudscale * 0.8); - picloc = picsize * 0.5 - pic2size * 0.5; - - if(vh_health < 0.25) - drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, bumb_gun_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); - - drawpic(hudloc + picloc, bumb_gun_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); - -// Health bar - picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; - picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); - drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; - picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; - if(vh_health < 0.25) - { - if(alarm1time < time) - { - alarm1time = time + 2; - sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); - } - - drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - if(alarm1time) - { - sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - alarm1time = 0; - } - } - -// Shield bar - picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; - picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight); - drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; - picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; - if(shield < 0.25) - { - if(alarm2time < time) - { - alarm2time = time + 1; - sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE); - } - drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - if(alarm2time) - { - sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - alarm2time = 0; - } - } - -// Gun bar - picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * energy, vid_conheight); - drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); - -// .. and icon - picsize = 1.5 * draw_getimagesize(hud_energy) * autocvar_cl_vehicles_hudscale; - picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; - if(energy < 0.2) - drawpic(hudloc + picloc, hud_energy, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_energy, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - - if (scoreboard_showscores) - HUD_DrawScoreboard(); - /* - else - { - picsize = draw_getimagesize(waki_xhair); - picsize_x *= 0.5; - picsize_y *= 0.5; - - - drawpic('0.5 0 0' * (vid_conwidth - picsize_x) + '0 0.5 0' * (vid_conheight - picsize_y), waki_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - } - */ -} - - - -void CSQC_SPIDER_HUD() -{ - if(autocvar_r_letterbox) - return; - - vector picsize, hudloc = '0 0 0', pic2size, picloc; - int i; - - // Fetch health & ammo stats - HUD_GETSTATS - - picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; - hudloc.y = vid_conheight - picsize.y; - hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5; - - drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); - - ammo1 *= 0.01; - shield *= 0.01; - vh_health *= 0.01; - reload2 *= 0.01; - - pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); - picloc = picsize * 0.5 - pic2size * 0.5; - if(vh_health < 0.25) - drawpic(hudloc + picloc, spider_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, spider_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, spider_rkt, pic2size, '1 1 1' * reload2 + '1 0 0' * (1 - reload2), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, spider_mgun, pic2size, '1 1 1' * ammo1 + '1 0 0' * (1 - ammo1), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); - -// Health bar - picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; - picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); - drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; - picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; - if(vh_health < 0.25) - { - if(alarm1time < time) - { - alarm1time = time + 2; - sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); - } - drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - if(alarm1time) - { - sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - alarm1time = 0; - } - } -// Shield bar - picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; - picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight); - drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; - picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; - if(shield < 0.25) - { - if(alarm2time < time) - { - alarm2time = time + 1; - sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE); - } - drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - if(alarm2time) - { - sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - alarm2time = 0; - } - } - -// Minigun bar - picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * ammo1, vid_conheight); - drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; - picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; - if(ammo1 < 0.2) - drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - -// Rocket ammo bar - picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; - ammo1 = picsize.x / 8; - picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x, hudloc.y + picloc.y, picsize.x * reload2, vid_conheight); - drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); - -// .. and icons - pic2size = 0.35 * draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; - picloc.x -= pic2size.x; - picloc.y += pic2size.y * 2.25; - if(ammo2 == 9) - { - for(i = 1; i < 9; ++i) - { - picloc.x += ammo1; - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((8 * reload2 <= i) ? '0 0 0' : '1 1 1'), 0.75, DRAWFLAG_NORMAL); - } - } - else - { - for(i = 1; i < 9; ++i) - { - picloc.x += ammo1; - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, ((i >= ammo2) ? '1 1 1' : '0 0 0'), 0.75, DRAWFLAG_NORMAL); - } - } - pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; - picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; - if(ammo2 == 9) - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL); - - if (scoreboard_showscores) - HUD_DrawScoreboard(); - else - { - switch(weapon2mode) - { - case SBRM_VOLLY: - spider_xhair = "gfx/vehicles/axh-bracket.tga"; - break; - case SBRM_GUIDE: - spider_xhair = "gfx/vehicles/axh-cross.tga"; - break; - case SBRM_ARTILLERY: - spider_xhair = "gfx/vehicles/axh-tag.tga"; - break; - default: - spider_xhair= "gfx/vehicles/axh-tag.tga"; - } - - picsize = draw_getimagesize(spider_xhair); - picsize.x *= autocvar_cl_vehicle_spiderbot_cross_size; - picsize.y *= autocvar_cl_vehicle_spiderbot_cross_size; - - drawpic('0.5 0 0' * (vid_conwidth - picsize.x) + '0 0.5 0' * (vid_conheight - picsize.y), spider_xhair, picsize, '1 1 1', autocvar_cl_vehicle_spiderbot_cross_alpha, DRAWFLAG_ADDITIVE); - } -} - -void CSQC_RAPTOR_HUD() -{ - if(autocvar_r_letterbox) - return; - - vector picsize, hudloc = '0 0 0', pic2size, picloc; - - // Fetch health & ammo stats - HUD_GETSTATS - - picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; - hudloc.y = vid_conheight - picsize.y; - hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5; - - drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); - - ammo1 *= 0.01; - ammo2 *= 0.01; - shield *= 0.01; - vh_health *= 0.01; - energy *= 0.01; - reload1 = reload2 * 0.01; - //reload2 *= 0.01; - - pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); - picloc = picsize * 0.5 - pic2size * 0.5; - if(vh_health < 0.25) - drawpic(hudloc + picloc, raptor_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, raptor_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, raptor_bomb, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, raptor_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); - -// Health bar - picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; - picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); - drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; - picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; - if(vh_health < 0.25) - { - if(alarm1time < time) - { - alarm1time = time + 2; - sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); - } - - drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - if(alarm1time) - { - sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - alarm1time = 0; - } - } - -// Shield bar - picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; - picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight); - drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; - picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; - if(shield < 0.25) - { - if(alarm2time < time) - { - alarm2time = time + 1; - sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE); - } - drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - if(alarm2time) - { - sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - alarm2time = 0; - } - } - -// Gun bar - picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * energy, vid_conheight); - drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; - picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; - if(energy < 0.2) - drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - -// Bomb bar - picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x, hudloc.y + picloc.y, picsize.x * reload1, vid_conheight); - drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; - picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; - if(reload1 != 1) - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL); - - if(weapon2mode == RSM_FLARE) - { - raptor_xhair = "gfx/vehicles/axh-bracket.tga"; - } - else - { - raptor_xhair = "gfx/vehicles/axh-ring.tga"; - - // Bombing crosshair - if(!dropmark) - { - dropmark = spawn(); - dropmark.owner = self; - dropmark.gravity = 1; - } - - if(reload2 == 100) - { - vector where; - - setorigin(dropmark, pmove_org); - dropmark.velocity = pmove_vel; - tracetoss(dropmark, self); - - where = project_3d_to_2d(trace_endpos); - - setorigin(dropmark, trace_endpos); - picsize = draw_getimagesize(raptor_drop) * 0.2; - - if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight)) - { - where.x -= picsize.x * 0.5; - where.y -= picsize.y * 0.5; - where.z = 0; - drawpic(where, raptor_drop, picsize, '0 2 0', 1, DRAWFLAG_ADDITIVE); - } - dropmark.cnt = time + 5; - } - else - { - vector where; - if(dropmark.cnt > time) - { - where = project_3d_to_2d(dropmark.origin); - picsize = draw_getimagesize(raptor_drop) * 0.25; - - if (!(where.z < 0 || where.x < 0 || where.y < 0 || where.x > vid_conwidth || where.y > vid_conheight)) - { - where.x -= picsize.x * 0.5; - where.y -= picsize.y * 0.5; - where.z = 0; - drawpic(where, raptor_drop, picsize, '2 0 0', 1, DRAWFLAG_ADDITIVE); - } - } - } - } - - if (scoreboard_showscores) - HUD_DrawScoreboard(); - else - { - picsize = draw_getimagesize(raptor_xhair); - picsize.x *= 0.5; - picsize.y *= 0.5; - - drawpic('0.5 0 0' * (vid_conwidth - picsize.x) + '0 0.5 0' * (vid_conheight - picsize.y), raptor_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - } -} - -void CSQC_WAKIZASHI_HUD() -{ -/* - drawpic(hudloc, waki_s, picsize, '1 1 1', shield, DRAWFLAG_NORMAL); - drawpic(hudloc, waki_b, picsize, '0 1 0' * health + '1 0 0' * (1 - health), 1, DRAWFLAG_NORMAL); - drawpic(hudloc, waki_r, picsize, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL); - drawpic(hudloc, waki_e, picsize, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); -*/ - if(autocvar_r_letterbox) - return; - - vector picsize, hudloc = '0 0 0', pic2size, picloc; - - // Fetch health & ammo stats - HUD_GETSTATS - - picsize = draw_getimagesize(hud_bg) * autocvar_cl_vehicles_hudscale; - hudloc.y = vid_conheight - picsize.y; - hudloc.x = vid_conwidth * 0.5 - picsize.x * 0.5; - - drawpic(hudloc, hud_bg, picsize, '1 1 1', autocvar_cl_vehicles_hudalpha, DRAWFLAG_NORMAL); - - shield *= 0.01; - vh_health *= 0.01; - energy *= 0.01; - reload1 *= 0.01; - - pic2size = draw_getimagesize(spider_ico) * (autocvar_cl_vehicles_hudscale * 0.8); - picloc = picsize * 0.5 - pic2size * 0.5; - if(vh_health < 0.25) - drawpic(hudloc + picloc, waki_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, waki_ico, pic2size, '1 1 1' * vh_health + '1 0 0' * (1 - vh_health), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, waki_eng, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, waki_gun, pic2size, '1 1 1' * energy + '1 0 0' * (1 - energy), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, waki_rkt, pic2size, '1 1 1' * reload1 + '1 0 0' * (1 - reload1), 1, DRAWFLAG_NORMAL); - drawpic(hudloc + picloc, hud_sh, pic2size, '1 1 1', shield, DRAWFLAG_NORMAL); - -// Health bar - picsize = draw_getimagesize(hud_hp_bar) * autocvar_cl_vehicles_hudscale; - picloc = '69 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - vh_health)), 0, vid_conwidth, vid_conheight); - drawpic(hudloc + picloc, hud_hp_bar, picsize, '1 1 1', 1 , DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picsize = draw_getimagesize(hud_hp_ico) * autocvar_cl_vehicles_hudscale; - picloc = '37 65 0' * autocvar_cl_vehicles_hudscale; - if(vh_health < 0.25) - { - if(alarm1time < time) - { - alarm1time = time + 2; - sound(self, CH_PAIN_SINGLE, "vehicles/alarm.wav", VOL_BASEVOICE, ATTEN_NONE); - } - - drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + picloc, hud_hp_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - if(alarm1time) - { - sound(self, CH_PAIN_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - alarm1time = 0; - } - } - - -// Shield bar - picsize = draw_getimagesize(hud_sh_bar) * autocvar_cl_vehicles_hudscale; - picloc = '69 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x + (picsize.x * (1 - shield)), 0, vid_conwidth, vid_conheight); - drawpic(hudloc + picloc, hud_sh_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picloc = '40 136 0' * autocvar_cl_vehicles_hudscale; - picsize = draw_getimagesize(hud_sh_ico) * autocvar_cl_vehicles_hudscale; - if(shield < 0.25) - { - if(alarm2time < time) - { - alarm2time = time + 1; - sound(self, CH_TRIGGER_SINGLE, "vehicles/alarm_shield.wav", VOL_BASEVOICE, ATTEN_NONE); - } - drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - } - else - { - drawpic(hudloc + picloc, hud_sh_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - if(alarm2time) - { - sound(self, CH_TRIGGER_SINGLE, "misc/null.wav", VOL_BASEVOICE, ATTEN_NONE); - alarm2time = 0; - } - } - -// Gun bar - picsize = draw_getimagesize(hud_ammo1_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 69 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x, picloc.y, picsize.x * energy, vid_conheight); - drawpic(hudloc + picloc, hud_ammo1_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - picsize = draw_getimagesize(hud_ammo1_ico) * autocvar_cl_vehicles_hudscale; - picloc = '664 60 0' * autocvar_cl_vehicles_hudscale; - if(energy < 0.2) - drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_ammo1_ico, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - -// Bomb bar - picsize = draw_getimagesize(hud_ammo2_bar) * autocvar_cl_vehicles_hudscale; - picloc = '450 140 0' * autocvar_cl_vehicles_hudscale; - drawsetcliparea(hudloc.x + picloc.x, hudloc.y + picloc.y, picsize.x * reload1, vid_conheight); - drawpic(hudloc + picloc, hud_ammo2_bar, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - drawresetcliparea(); -// .. and icon - pic2size = draw_getimagesize(hud_ammo2_ico) * autocvar_cl_vehicles_hudscale; - picloc = '664 130 0' * autocvar_cl_vehicles_hudscale; - if(reload1 != 1) - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 0 0' + '0 1 1' * sin(time * 8), 1, DRAWFLAG_NORMAL); - else - drawpic(hudloc + picloc, hud_ammo2_ico, pic2size, '1 1 1', 1, DRAWFLAG_NORMAL); - - if (scoreboard_showscores) - HUD_DrawScoreboard(); - else - { - picsize = draw_getimagesize(waki_xhair); - picsize.x *= 0.5; - picsize.y *= 0.5; - - - drawpic('0.5 0 0' * (vid_conwidth - picsize.x) + '0 0.5 0' * (vid_conheight - picsize.y), waki_xhair, picsize, '1 1 1', 1, DRAWFLAG_NORMAL); - } -} - -void Vehicles_Precache() -{ - precache_model("models/vehicles/bomblet.md3"); - precache_model("models/vehicles/clusterbomb.md3"); - precache_model("models/vehicles/clusterbomb_fragment.md3"); - precache_model("models/vehicles/rocket01.md3"); - precache_model("models/vehicles/rocket02.md3"); - - precache_sound ("vehicles/alarm.wav"); - precache_sound ("vehicles/alarm_shield.wav"); -} - -void RaptorCBShellfragDraw() -{ - if(wasfreed(self)) - return; - - Movetype_Physics_MatchTicrate(autocvar_cl_gibs_ticrate, autocvar_cl_gibs_sloppy); - self.move_avelocity += randomvec() * 15; - self.renderflags = 0; - - if(self.cnt < time) - self.alpha = bound(0, self.nextthink - time, 1); - - if(self.alpha < ALPHA_MIN_VISIBLE) - remove(self); -} - -void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang) -{ - entity sfrag; - - sfrag = spawn(); - setmodel(sfrag, "models/vehicles/clusterbomb_fragment.md3"); - setorigin(sfrag, _org); - - sfrag.move_movetype = MOVETYPE_BOUNCE; - sfrag.gravity = 0.15; - sfrag.solid = SOLID_CORPSE; - - sfrag.draw = RaptorCBShellfragDraw; - - sfrag.move_origin = sfrag.origin = _org; - sfrag.move_velocity = _vel; - sfrag.move_avelocity = prandomvec() * vlen(sfrag.move_velocity); - sfrag.angles = self.move_angles = _ang; - - sfrag.move_time = time; - sfrag.damageforcescale = 4; - - sfrag.nextthink = time + 3; - sfrag.cnt = time + 2; - sfrag.alpha = 1; - sfrag.drawmask = MASK_NORMAL; -} diff --git a/qcsrc/client/vehicles/vehicles.qh b/qcsrc/client/vehicles/vehicles.qh deleted file mode 100644 index e8d3ddb4f..000000000 --- a/qcsrc/client/vehicles/vehicles.qh +++ /dev/null @@ -1,16 +0,0 @@ -#ifndef VEHICLES_H -#define VEHICLES_H - -void RaptorCBShellfragDraw(); -void RaptorCBShellfragToss(vector _org, vector _vel, vector _ang); -void Vehicles_Precache(); -void Net_AuXair2(bool bIsNew); -void Net_VehicleSetup(); - -void CSQC_WAKIZASHI_HUD(); -void CSQC_SPIDER_HUD(); -void CSQC_RAPTOR_HUD(); -void CSQC_BUMBLE_HUD(); -void CSQC_BUMBLE_GUN_HUD(); - -#endif diff --git a/qcsrc/client/view.qc b/qcsrc/client/view.qc index 3ffb4066c..d3bcf9244 100644 --- a/qcsrc/client/view.qc +++ b/qcsrc/client/view.qc @@ -9,7 +9,7 @@ #include "scoreboard.qh" #include "shownames.qh" #include "target_music.qh" -#include "vehicles/vehicles.qh" +#include "vehicles/all.qh" #include "waypointsprites.qh" #include "../common/constants.qh" @@ -19,7 +19,7 @@ #include "../common/teams.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/cl_player.qh" diff --git a/qcsrc/client/waypointsprites.qc b/qcsrc/client/waypointsprites.qc index dc38219b5..aed0865dd 100644 --- a/qcsrc/client/waypointsprites.qc +++ b/qcsrc/client/waypointsprites.qc @@ -8,7 +8,7 @@ #include "../common/constants.qh" #include "../common/teams.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/interpolate.qh" diff --git a/qcsrc/common/command/all.qc b/qcsrc/common/command/all.qc new file mode 100644 index 000000000..dc1c0441f --- /dev/null +++ b/qcsrc/common/command/all.qc @@ -0,0 +1,3 @@ +#include "generic.qc" +#include "markup.qc" +#include "rpn.qc" diff --git a/qcsrc/common/command/all.qh b/qcsrc/common/command/all.qh new file mode 100644 index 000000000..7eeb5c323 --- /dev/null +++ b/qcsrc/common/command/all.qh @@ -0,0 +1,8 @@ +#ifndef COMMON_COMMANDS_ALL_H +#define COMMON_COMMANDS_ALL_H + +#include "generic.qh" +#include "markup.qh" +#include "rpn.qh" + +#endif diff --git a/qcsrc/common/command/commands.qc b/qcsrc/common/command/commands.qc deleted file mode 100644 index dc1c0441f..000000000 --- a/qcsrc/common/command/commands.qc +++ /dev/null @@ -1,3 +0,0 @@ -#include "generic.qc" -#include "markup.qc" -#include "rpn.qc" diff --git a/qcsrc/common/command/commands.qh b/qcsrc/common/command/commands.qh deleted file mode 100644 index d434a8655..000000000 --- a/qcsrc/common/command/commands.qh +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef COMMON_COMMANDS_H -#define COMMON_COMMANDS_H - -#include "generic.qh" -#include "markup.qh" -#include "rpn.qh" - -#endif diff --git a/qcsrc/common/mapinfo.qc b/qcsrc/common/mapinfo.qc index c3f15d193..2e692d726 100644 --- a/qcsrc/common/mapinfo.qc +++ b/qcsrc/common/mapinfo.qc @@ -3,7 +3,7 @@ #include "../client/defs.qh" #include "util.qh" #include "buffs.qh" - #include "weapons/weapons.qh" + #include "weapons/all.qh" #include "mapinfo.qh" #elif defined(MENUQC) #elif defined(SVQC) @@ -11,7 +11,7 @@ #include "../dpdefs/dpextensions.qh" #include "util.qh" #include "buffs.qh" - #include "monsters/monsters.qh" + #include "monsters/all.qh" #include "mapinfo.qh" #endif diff --git a/qcsrc/common/monsters/all.qc b/qcsrc/common/monsters/all.qc new file mode 100644 index 000000000..37dbcb325 --- /dev/null +++ b/qcsrc/common/monsters/all.qc @@ -0,0 +1,47 @@ +#include "all.qh" + +#include "all.inc" + +// MONSTER PLUGIN SYSTEM +entity monster_info[MON_MAXCOUNT]; +entity dummy_monster_info; + +void register_monster(int id, float(float) func, int monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname) +{ + entity e; + monster_info[id - 1] = e = spawn(); + e.classname = "monster_info"; + e.monsterid = id; + e.netname = shortname; + e.monster_name = mname; + e.monster_func = func; + e.mdl = modelname; + e.spawnflags = monsterflags; + e.mins = min_s; + e.maxs = max_s; + e.model = strzone(strcat("models/monsters/", modelname)); +} +float m_null(float dummy) { return 0; } +void register_monsters_done() +{ + dummy_monster_info = spawn(); + dummy_monster_info.classname = "monster_info"; + dummy_monster_info.monsterid = 0; // you can recognize dummies by this + dummy_monster_info.netname = ""; + dummy_monster_info.monster_name = "Monster"; + dummy_monster_info.monster_func = m_null; + dummy_monster_info.mdl = ""; + dummy_monster_info.mins = '-0 -0 -0'; + dummy_monster_info.maxs = '0 0 0'; + dummy_monster_info.model = ""; +} +entity get_monsterinfo(int id) +{ + entity m; + if(id < MON_FIRST || id > MON_LAST) + return dummy_monster_info; + m = monster_info[id - 1]; + if(m) + return m; + return dummy_monster_info; +} diff --git a/qcsrc/common/monsters/all.qh b/qcsrc/common/monsters/all.qh new file mode 100644 index 000000000..ce02312f1 --- /dev/null +++ b/qcsrc/common/monsters/all.qh @@ -0,0 +1,73 @@ +#ifndef MONSTERS_ALL_H +#define MONSTERS_ALL_H + +#include "../util.qh" + +// monster requests +const int MR_SETUP = 1; // (SERVER) setup monster data +const int MR_THINK = 2; // (SERVER) logic to run every frame +const int MR_DEATH = 3; // (SERVER) called when monster dies +const int MR_PRECACHE = 4; // (BOTH) precaches models/sounds used by this monster + +// functions: +entity get_monsterinfo(float id); + +// special spawn flags +const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died +const int MONSTER_TYPE_FLY = 32; +const int MONSTER_TYPE_SWIM = 64; +const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced +const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster +const int MON_FLAG_RANGED = 512; // monster shoots projectiles +const int MON_FLAG_MELEE = 1024; + +// entity properties of monsterinfo: +.float monsterid; // MON_... +.string netname; // short name +.string monster_name; // human readable name +.float(float) monster_func; // m_... +.string mdl; // currently a copy of the model +.string model; // full name of model +.int spawnflags; +.vector mins, maxs; // monster hitbox size + +// other useful macros +#define MON_ACTION(monstertype,mrequest) (get_monsterinfo(monstertype)).monster_func(mrequest) +#define M_NAME(monstertype) (get_monsterinfo(monstertype)).monster_name + +// ===================== +// Monster Registration +// ===================== + +float m_null(float dummy); +void register_monster(float id, float(float) func, float monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname); +void register_monsters_done(); + +const int MON_MAXCOUNT = 24; +const int MON_FIRST = 1; +int MON_COUNT; +int MON_LAST; + +#define REGISTER_MONSTER_2(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \ + int id; \ + float func(float); \ + void RegisterMonsters_##id() \ + { \ + MON_LAST = (id = MON_FIRST + MON_COUNT); \ + ++MON_COUNT; \ + register_monster(id,func,monsterflags,min_s,max_s,modelname,shortname,mname); \ + } \ + ACCUMULATE_FUNCTION(RegisterMonsters, RegisterMonsters_##id) +#ifdef MENUQC +#define REGISTER_MONSTER(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \ + REGISTER_MONSTER_2(MON_##id,m_null,monsterflags,min_s,max_s,modelname,shortname,mname) +#else +#define REGISTER_MONSTER(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \ + REGISTER_MONSTER_2(MON_##id,func,monsterflags,min_s,max_s,modelname,shortname,mname) +#endif + +#include "all.inc" + +#undef REGISTER_MONSTER +ACCUMULATE_FUNCTION(RegisterMonsters, register_monsters_done); +#endif diff --git a/qcsrc/common/monsters/monsters.qc b/qcsrc/common/monsters/monsters.qc deleted file mode 100644 index 72c5ea870..000000000 --- a/qcsrc/common/monsters/monsters.qc +++ /dev/null @@ -1,47 +0,0 @@ -#include "monsters.qh" - -#include "all.inc" - -// MONSTER PLUGIN SYSTEM -entity monster_info[MON_MAXCOUNT]; -entity dummy_monster_info; - -void register_monster(int id, float(float) func, int monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname) -{ - entity e; - monster_info[id - 1] = e = spawn(); - e.classname = "monster_info"; - e.monsterid = id; - e.netname = shortname; - e.monster_name = mname; - e.monster_func = func; - e.mdl = modelname; - e.spawnflags = monsterflags; - e.mins = min_s; - e.maxs = max_s; - e.model = strzone(strcat("models/monsters/", modelname)); -} -float m_null(float dummy) { return 0; } -void register_monsters_done() -{ - dummy_monster_info = spawn(); - dummy_monster_info.classname = "monster_info"; - dummy_monster_info.monsterid = 0; // you can recognize dummies by this - dummy_monster_info.netname = ""; - dummy_monster_info.monster_name = "Monster"; - dummy_monster_info.monster_func = m_null; - dummy_monster_info.mdl = ""; - dummy_monster_info.mins = '-0 -0 -0'; - dummy_monster_info.maxs = '0 0 0'; - dummy_monster_info.model = ""; -} -entity get_monsterinfo(int id) -{ - entity m; - if(id < MON_FIRST || id > MON_LAST) - return dummy_monster_info; - m = monster_info[id - 1]; - if(m) - return m; - return dummy_monster_info; -} diff --git a/qcsrc/common/monsters/monsters.qh b/qcsrc/common/monsters/monsters.qh deleted file mode 100644 index 4aa1f7ef4..000000000 --- a/qcsrc/common/monsters/monsters.qh +++ /dev/null @@ -1,73 +0,0 @@ -#ifndef MONSTERS_H -#define MONSTERS_H - -#include "../util.qh" - -// monster requests -const int MR_SETUP = 1; // (SERVER) setup monster data -const int MR_THINK = 2; // (SERVER) logic to run every frame -const int MR_DEATH = 3; // (SERVER) called when monster dies -const int MR_PRECACHE = 4; // (BOTH) precaches models/sounds used by this monster - -// functions: -entity get_monsterinfo(float id); - -// special spawn flags -const int MONSTER_RESPAWN_DEATHPOINT = 16; // re-spawn where we died -const int MONSTER_TYPE_FLY = 32; -const int MONSTER_TYPE_SWIM = 64; -const int MONSTER_SIZE_BROKEN = 128; // TODO: remove when bad models are replaced -const int MON_FLAG_SUPERMONSTER = 256; // incredibly powerful monster -const int MON_FLAG_RANGED = 512; // monster shoots projectiles -const int MON_FLAG_MELEE = 1024; - -// entity properties of monsterinfo: -.float monsterid; // MON_... -.string netname; // short name -.string monster_name; // human readable name -.float(float) monster_func; // m_... -.string mdl; // currently a copy of the model -.string model; // full name of model -.int spawnflags; -.vector mins, maxs; // monster hitbox size - -// other useful macros -#define MON_ACTION(monstertype,mrequest) (get_monsterinfo(monstertype)).monster_func(mrequest) -#define M_NAME(monstertype) (get_monsterinfo(monstertype)).monster_name - -// ===================== -// Monster Registration -// ===================== - -float m_null(float dummy); -void register_monster(float id, float(float) func, float monsterflags, vector min_s, vector max_s, string modelname, string shortname, string mname); -void register_monsters_done(); - -const int MON_MAXCOUNT = 24; -const int MON_FIRST = 1; -int MON_COUNT; -int MON_LAST; - -#define REGISTER_MONSTER_2(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \ - int id; \ - float func(float); \ - void RegisterMonsters_##id() \ - { \ - MON_LAST = (id = MON_FIRST + MON_COUNT); \ - ++MON_COUNT; \ - register_monster(id,func,monsterflags,min_s,max_s,modelname,shortname,mname); \ - } \ - ACCUMULATE_FUNCTION(RegisterMonsters, RegisterMonsters_##id) -#ifdef MENUQC -#define REGISTER_MONSTER(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \ - REGISTER_MONSTER_2(MON_##id,m_null,monsterflags,min_s,max_s,modelname,shortname,mname) -#else -#define REGISTER_MONSTER(id,func,monsterflags,min_s,max_s,modelname,shortname,mname) \ - REGISTER_MONSTER_2(MON_##id,func,monsterflags,min_s,max_s,modelname,shortname,mname) -#endif - -#include "all.inc" - -#undef REGISTER_MONSTER -ACCUMULATE_FUNCTION(RegisterMonsters, register_monsters_done); -#endif diff --git a/qcsrc/common/monsters/spawn.qc b/qcsrc/common/monsters/spawn.qc index 8aee54b98..5bfef1b8f 100644 --- a/qcsrc/common/monsters/spawn.qc +++ b/qcsrc/common/monsters/spawn.qc @@ -3,7 +3,7 @@ #elif defined(SVQC) #include "../../dpdefs/progsdefs.qh" #include "../util.qh" - #include "monsters.qh" + #include "all.qh" #include "sv_monsters.qh" #include "spawn.qh" #include "../../server/autocvars.qh" diff --git a/qcsrc/common/monsters/sv_monsters.qc b/qcsrc/common/monsters/sv_monsters.qc index 3ff926bf6..ce254751b 100644 --- a/qcsrc/common/monsters/sv_monsters.qc +++ b/qcsrc/common/monsters/sv_monsters.qc @@ -7,9 +7,9 @@ #include "../constants.qh" #include "../teams.qh" #include "../util.qh" - #include "monsters.qh" + #include "all.qh" #include "sv_monsters.qh" - #include "../weapons/weapons.qh" + #include "../weapons/all.qh" #include "../../server/autocvars.qh" #include "../../server/defs.qh" #include "../deathtypes.qh" diff --git a/qcsrc/common/playerstats.qc b/qcsrc/common/playerstats.qc index 5890fb89e..e46e12fa1 100644 --- a/qcsrc/common/playerstats.qc +++ b/qcsrc/common/playerstats.qc @@ -6,7 +6,7 @@ #include "constants.qh" #include "util.qh" #include "urllib.qh" - #include "weapons/weapons.qh" + #include "weapons/all.qh" #include "../server/weapons/accuracy.qh" #include "../server/defs.qh" #include "playerstats.qh" diff --git a/qcsrc/common/weapons/all.qc b/qcsrc/common/weapons/all.qc new file mode 100644 index 000000000..847c8371d --- /dev/null +++ b/qcsrc/common/weapons/all.qc @@ -0,0 +1,375 @@ +#ifndef WEAPONS_ALL_C +#define WEAPONS_ALL_C + +#include "all.qh" + +#if defined(CSQC) + #include "../../dpdefs/csprogsdefs.qh" + #include "../../client/defs.qh" + #include "../constants.qh" + #include "../stats.qh" + #include "../../warpzonelib/anglestransform.qh" + #include "../../warpzonelib/mathlib.qh" + #include "../../warpzonelib/common.qh" + #include "../../warpzonelib/client.qh" + #include "../util.qh" + #include "../buffs.qh" + #include "../../client/autocvars.qh" + #include "../deathtypes.qh" + #include "../../csqcmodellib/interpolate.qh" + #include "../../client/movetypes.qh" + #include "../../client/main.qh" + #include "../../csqcmodellib/cl_model.qh" +#elif defined(MENUQC) +#elif defined(SVQC) + #include "../../dpdefs/progsdefs.qh" + #include "../../dpdefs/dpextensions.qh" + #include "../../warpzonelib/anglestransform.qh" + #include "../../warpzonelib/mathlib.qh" + #include "../../warpzonelib/common.qh" + #include "../../warpzonelib/util_server.qh" + #include "../../warpzonelib/server.qh" + #include "../constants.qh" + #include "../stats.qh" + #include "../teams.qh" + #include "../util.qh" + #include "../buffs.qh" + #include "../monsters/all.qh" + #include "config.qh" + #include "../../server/weapons/csqcprojectile.qh" + #include "../../server/weapons/tracing.qh" + #include "../../server/t_items.qh" + #include "../../server/autocvars.qh" + #include "../../server/constants.qh" + #include "../../server/defs.qh" + #include "../notifications.qh" + #include "../deathtypes.qh" + #include "../../server/mutators/mutators_include.qh" + #include "../mapinfo.qh" + #include "../../server/command/common.qh" + #include "../../csqcmodellib/sv_model.qh" + #include "../../server/portals.qh" + #include "../../server/g_hook.qh" +#endif +#ifndef MENUQC +#include "calculations.qc" +#endif +#include "all.inc" + +// WEAPON PLUGIN SYSTEM +entity weapon_info[WEP_MAXCOUNT]; +entity dummy_weapon_info; + +#if WEP_MAXCOUNT > 72 +# error Kein Weltraum links auf dem Gerät +#endif + +WepSet WepSet_FromWeapon(int a) { + a -= WEP_FIRST; +#if WEP_MAXCOUNT > 24 + if(a >= 24) { + a -= 24; +#if WEP_MAXCOUNT > 48 + if(a >= 24) { + a -= 24; + return '0 0 1' * power2of(a); + } +#endif + return '0 1 0' * power2of(a); + } +#endif + return '1 0 0' * power2of(a); +} +#ifdef SVQC +void WepSet_AddStat() +{ + addstat(STAT_WEAPONS, AS_INT, weapons_x); +#if WEP_MAXCOUNT > 24 + addstat(STAT_WEAPONS2, AS_INT, weapons_y); +#if WEP_MAXCOUNT > 48 + addstat(STAT_WEAPONS3, AS_INT, weapons_z); +#endif +#endif +} +void WriteWepSet(float dst, WepSet w) +{ +#if WEP_MAXCOUNT > 48 + WriteInt72_t(dst, w); +#elif WEP_MAXCOUNT > 24 + WriteInt48_t(dst, w); +#else + WriteInt24_t(dst, w.x); +#endif +} +#endif +#ifdef CSQC +WepSet WepSet_GetFromStat() +{ + WepSet w = '0 0 0'; + w.x = getstati(STAT_WEAPONS); +#if WEP_MAXCOUNT > 24 + w.y = getstati(STAT_WEAPONS2); +#if WEP_MAXCOUNT > 48 + w.z = getstati(STAT_WEAPONS3); +#endif +#endif + return w; +} +WepSet ReadWepSet() +{ +#if WEP_MAXCOUNT > 48 + return ReadInt72_t(); +#elif WEP_MAXCOUNT > 24 + return ReadInt48_t(); +#else + return ReadInt24_t() * '1 0 0'; +#endif +} +#endif + +void register_weapon( + int id, + WepSet bit, + bool(int) func, + .int ammotype, + int i, + int weapontype, + float pickupbasevalue, + vector clr, + string modelname, + string simplemdl, + string crosshair, + string wepimg, + string refname, + string wepname) +{ + entity e; + weapon_info[id - 1] = e = spawn(); + e.classname = "weapon_info"; + e.weapon = id; + e.weapons = bit; + e.weapon_func = func; + e.ammo_field = ammotype; + e.impulse = i; + e.spawnflags = weapontype; + e.bot_pickupbasevalue = pickupbasevalue; + e.wpcolor = clr; + e.wpmodel = strzone(strcat("wpn-", ftos(id))); + e.mdl = modelname; + e.model = strzone(strcat("models/weapons/g_", modelname, ".md3")); + e.w_simplemdl = strzone(simplemdl); // simpleitems weapon model/image + e.w_crosshair = strzone(car(crosshair)); + string s = cdr(crosshair); + e.w_crosshair_size = ((s != "") ? stof(s) : 1); // so that we can scale the crosshair from code (for compat) + e.model2 = strzone(wepimg); + e.netname = refname; + e.message = wepname; + + #ifdef CSQC + func(WR_INIT); + #endif +} +bool w_null(int dummy) +{ + return 0; +} +void register_weapons_done() +{ + dummy_weapon_info = spawn(); + dummy_weapon_info.classname = "weapon_info"; + dummy_weapon_info.weapon = 0; // you can recognize dummies by this + dummy_weapon_info.weapons = '0 0 0'; + dummy_weapon_info.netname = ""; + dummy_weapon_info.message = "AOL CD Thrower"; + dummy_weapon_info.weapon_func = w_null; + dummy_weapon_info.wpmodel = ""; + dummy_weapon_info.mdl = ""; + dummy_weapon_info.model = ""; + dummy_weapon_info.spawnflags = 0; + dummy_weapon_info.impulse = -1; + dummy_weapon_info.bot_pickupbasevalue = 0; + dummy_weapon_info.ammo_field = ammo_none; + + dummy_weapon_info.w_crosshair = "gfx/crosshair1"; + dummy_weapon_info.w_crosshair_size = 1; + dummy_weapon_info.model2 = ""; + + int i; + weaponorder_byid = ""; + for(i = WEP_MAXCOUNT; i >= 1; --i) + if(weapon_info[i-1]) + weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i)); + weaponorder_byid = strzone(substring(weaponorder_byid, 1, strlen(weaponorder_byid) - 1)); +} +entity get_weaponinfo(int id) +{ + entity w; + if(id < WEP_FIRST || id > WEP_LAST) + return dummy_weapon_info; + w = weapon_info[id - 1]; + if(w) + return w; + return dummy_weapon_info; +} +string W_FixWeaponOrder(string order, float complete) +{ + return fixPriorityList(order, WEP_FIRST, WEP_LAST, 230 - WEP_FIRST, complete); +} +string W_NameWeaponOrder_MapFunc(string s) +{ + entity wi; + if(s == "0" || stof(s)) + { + wi = get_weaponinfo(stof(s)); + if(wi != dummy_weapon_info) + return wi.netname; + } + return s; +} + +string W_UndeprecateName(string s) +{ + switch ( s ) + { + case "nex" : return "vortex"; + case "rocketlauncher" : return "devastator"; + case "laser" : return "blaster"; + case "minstanex" : return "vaporizer"; + case "grenadelauncher": return "mortar"; + case "uzi" : return "machinegun"; + default : return s; + } +} +string W_NameWeaponOrder(string order) +{ + return mapPriorityList(order, W_NameWeaponOrder_MapFunc); +} +string W_NumberWeaponOrder_MapFunc(string s) +{ + int i; + if(s == "0" || stof(s)) + return s; + s = W_UndeprecateName(s); + for(i = WEP_FIRST; i <= WEP_LAST; ++i) + if(s == get_weaponinfo(i).netname) + return ftos(i); + return s; +} +string W_NumberWeaponOrder(string order) +{ + return mapPriorityList(order, W_NumberWeaponOrder_MapFunc); +} + +float W_FixWeaponOrder_BuildImpulseList_buf[WEP_MAXCOUNT]; +string W_FixWeaponOrder_BuildImpulseList_order; +void W_FixWeaponOrder_BuildImpulseList_swap(int i, int j, entity pass) +{ + float h; + h = W_FixWeaponOrder_BuildImpulseList_buf[i]; + W_FixWeaponOrder_BuildImpulseList_buf[i] = W_FixWeaponOrder_BuildImpulseList_buf[j]; + W_FixWeaponOrder_BuildImpulseList_buf[j] = h; +} +float W_FixWeaponOrder_BuildImpulseList_cmp(int i, int j, entity pass) +{ + entity e1, e2; + float d; + e1 = get_weaponinfo(W_FixWeaponOrder_BuildImpulseList_buf[i]); + e2 = get_weaponinfo(W_FixWeaponOrder_BuildImpulseList_buf[j]); + d = (e1.impulse + 9) % 10 - (e2.impulse + 9) % 10; + if(d != 0) + return -d; // high impulse first! + return + strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "), sprintf(" %d ", W_FixWeaponOrder_BuildImpulseList_buf[i]), 0) + - + strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "), sprintf(" %d ", W_FixWeaponOrder_BuildImpulseList_buf[j]), 0) + ; // low char index first! +} +string W_FixWeaponOrder_BuildImpulseList(string o) +{ + int i; + W_FixWeaponOrder_BuildImpulseList_order = o; + for(i = WEP_FIRST; i <= WEP_LAST; ++i) + W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST] = i; + heapsort(WEP_LAST - WEP_FIRST + 1, W_FixWeaponOrder_BuildImpulseList_swap, W_FixWeaponOrder_BuildImpulseList_cmp, world); + o = ""; + for(i = WEP_FIRST; i <= WEP_LAST; ++i) + o = strcat(o, " ", ftos(W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST])); + W_FixWeaponOrder_BuildImpulseList_order = string_null; + return substring(o, 1, -1); +} + +string W_FixWeaponOrder_AllowIncomplete(string order) +{ + return W_FixWeaponOrder(order, 0); +} + +string W_FixWeaponOrder_ForceComplete(string order) +{ + if(order == "") + order = W_NumberWeaponOrder(cvar_defstring("cl_weaponpriority")); + return W_FixWeaponOrder(order, 1); +} + +void W_RandomWeapons(entity e, float n) +{ + int i, j; + WepSet remaining; + WepSet result; + remaining = e.weapons; + result = '0 0 0'; + for(i = 0; i < n; ++i) + { + RandomSelection_Init(); + for(j = WEP_FIRST; j <= WEP_LAST; ++j) + if(remaining & WepSet_FromWeapon(j)) + RandomSelection_Add(world, j, string_null, 1, 1); + result |= WepSet_FromWeapon(RandomSelection_chosen_float); + remaining &= ~WepSet_FromWeapon(RandomSelection_chosen_float); + } + e.weapons = result; +} + +string GetAmmoPicture(.int ammotype) +{ + switch(ammotype) + { + case ammo_shells: return "ammo_shells"; + case ammo_nails: return "ammo_bullets"; + case ammo_rockets: return "ammo_rockets"; + case ammo_cells: return "ammo_cells"; + case ammo_plasma: return "ammo_cells"; + case ammo_fuel: return "ammo_fuel"; + default: return ""; // wtf, no ammo type? + } +} + +#ifdef CSQC +.int GetAmmoFieldFromNum(int i) +{ + switch(i) + { + case 0: return ammo_shells; + case 1: return ammo_nails; + case 2: return ammo_rockets; + case 3: return ammo_cells; + case 4: return ammo_plasma; + case 5: return ammo_fuel; + default: return ammo_none; + } +} + +int GetAmmoStat(.int ammotype) +{ + switch(ammotype) + { + case ammo_shells: return STAT_SHELLS; + case ammo_nails: return STAT_NAILS; + case ammo_rockets: return STAT_ROCKETS; + case ammo_cells: return STAT_CELLS; + case ammo_plasma: return STAT_PLASMA; + case ammo_fuel: return STAT_FUEL; + default: return -1; + } +} +#endif +#endif diff --git a/qcsrc/common/weapons/all.qh b/qcsrc/common/weapons/all.qh new file mode 100644 index 000000000..154f8167e --- /dev/null +++ b/qcsrc/common/weapons/all.qh @@ -0,0 +1,217 @@ +#ifndef WEAPONS_ALL_H +#define WEAPONS_ALL_H + +#ifndef MENUQC +#include "calculations.qh" +#endif + +#include "../util.qh" +#ifdef SVQC +#include "../../server/bot/aim.qh" +#endif +const int MAX_SHOT_DISTANCE = 32768; + +// weapon pickup ratings for bot logic +const int BOT_PICKUP_RATING_LOW = 2500; +const int BOT_PICKUP_RATING_MID = 5000; +const int BOT_PICKUP_RATING_HIGH = 10000; + +// weapon flags +const int WEP_TYPE_OTHER = 0x00; // not for damaging people +const int WEP_TYPE_SPLASH = 0x01; // splash damage +const int WEP_TYPE_HITSCAN = 0x02; // hitscan +const int WEP_TYPEMASK = 0x0F; +const int WEP_FLAG_CANCLIMB = 0x10; // can be used for movement +const int WEP_FLAG_NORMAL = 0x20; // in "most weapons" set +const int WEP_FLAG_HIDDEN = 0x40; // hides from menu +const int WEP_FLAG_RELOADABLE = 0x80; // can has reload +const int WEP_FLAG_SUPERWEAPON = 0x100; // powerup timer +const int WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag) + +// weapon requests +const int WR_SETUP = 1; // (SERVER) setup weapon data +const int WR_THINK = 2; // (SERVER) logic to run every frame +const int WR_CHECKAMMO1 = 3; // (SERVER) checks ammo for weapon primary +const int WR_CHECKAMMO2 = 4; // (SERVER) checks ammo for weapon second +const int WR_AIM = 5; // (SERVER) runs bot aiming code for this weapon +const int WR_INIT = 6; // (BOTH) precaches models/sounds used by this weapon, also sets up weapon properties +const int WR_SUICIDEMESSAGE = 7; // (SERVER) notification number for suicide message (may inspect w_deathtype for details) +const int WR_KILLMESSAGE = 8; // (SERVER) notification number for kill message (may inspect w_deathtype for details) +const int WR_RELOAD = 9; // (SERVER) handles reloading for weapon +const int WR_RESETPLAYER = 10; // (SERVER) clears fields that the weapon may use +const int WR_IMPACTEFFECT = 11; // (CLIENT) impact effect for weapon explosion +const int WR_PLAYERDEATH = 12; // (SERVER) called whenever a player dies +const int WR_GONETHINK = 13; // (SERVER) logic to run when weapon is lost +const int WR_CONFIG = 14; // (ALL) dump weapon cvars to config in data directory (see: sv_cmd dumpweapons) +const int WR_ZOOMRETICLE = 15; // (CLIENT) weapon specific zoom reticle +const int WR_DROP = 16; // (SERVER) the weapon is dropped +const int WR_PICKUP = 17; // (SERVER) a weapon is picked up + +// variables: +string weaponorder_byid; + +// weapon sets +typedef vector WepSet; +WepSet WepSet_FromWeapon(int a); +#ifdef SVQC +void WepSet_AddStat(); +void WriteWepSet(float dest, WepSet w); +#endif +#ifdef CSQC +WepSet WepSet_GetFromStat(); +WepSet ReadWepSet(); +#endif + +// weapon name macros +#define WEP_FIRST 1 +#define WEP_MAXCOUNT 24 // Increase as needed. Can be up to three times as much. +int WEP_COUNT; +int WEP_LAST; +WepSet WEPSET_ALL; +WepSet WEPSET_SUPERWEAPONS; + +// functions: +entity get_weaponinfo(int id); +string W_FixWeaponOrder(string order, float complete); +string W_UndeprecateName(string s); +string W_NameWeaponOrder(string order); +string W_NumberWeaponOrder(string order); +string W_FixWeaponOrder_BuildImpulseList(string o); +string W_FixWeaponOrder_AllowIncomplete(string order); +string W_FixWeaponOrder_ForceComplete(string order); +void W_RandomWeapons(entity e, float n); + +string GetAmmoPicture(.int ammotype); + +#ifdef CSQC +.int GetAmmoFieldFromNum(int i); +int GetAmmoStat(.int ammotype); +#endif + +// ammo types +.int ammo_shells; +.int ammo_nails; +.int ammo_rockets; +.int ammo_cells; +.int ammo_plasma; +.int ammo_fuel; +.int ammo_none; + +// other useful macros +#define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest) +#define WEP_AMMO(wpn) ((get_weaponinfo(WEP_##wpn)).ammo_field) // only used inside weapon files/with direct name, don't duplicate prefix +#define WEP_NAME(wpn) ((get_weaponinfo(wpn)).message) + + +// ====================== +// Configuration Macros +// ====================== + +// create cvars for weapon settings +#define WEP_ADD_CVAR_NONE(wepname,name) [[last]] float autocvar_g_balance_##wepname##_##name; + +#define WEP_ADD_CVAR_PRI(wepname,name) WEP_ADD_CVAR_NONE(wepname, primary_##name) +#define WEP_ADD_CVAR_SEC(wepname,name) WEP_ADD_CVAR_NONE(wepname, secondary_##name) +#define WEP_ADD_CVAR_BOTH(wepname,name) \ + WEP_ADD_CVAR_PRI(wepname, name) \ + WEP_ADD_CVAR_SEC(wepname, name) + +#define WEP_ADD_CVAR(wepid,wepname,mode,name) WEP_ADD_CVAR_##mode(wepname, name) + +// create properties for weapon settings +#define WEP_ADD_PROP(wepid,wepname,type,prop,name) \ + .type prop; \ + [[last]] type autocvar_g_balance_##wepname##_##name; + +// read cvars from weapon settings +#define WEP_CVAR(wepname,name) autocvar_g_balance_##wepname##_##name +#define WEP_CVAR_PRI(wepname,name) WEP_CVAR(wepname, primary_##name) +#define WEP_CVAR_SEC(wepname,name) WEP_CVAR(wepname, secondary_##name) +#define WEP_CVAR_BOTH(wepname,isprimary,name) ((isprimary) ? WEP_CVAR_PRI(wepname, name) : WEP_CVAR_SEC(wepname, name)) + +// set initialization values for weapon settings +#define WEP_SKIP_CVAR(unuseda,unusedb,unusedc,unusedd) /* skip cvars */ +#define WEP_SET_PROP(wepid,wepname,type,prop,name) get_weaponinfo(WEP_##wepid).##prop = autocvar_g_balance_##wepname##_##name; + + +// ===================== +// Weapon Registration +// ===================== + +bool w_null(int dummy); + +void register_weapon( + int id, + WepSet bit, + bool(int) func, + .int ammotype, + int i, + int weapontype, + float pickupbasevalue, + vector clr, + string modelname, + string simplemdl, + string crosshair, + string wepimg, + string refname, + string wepname); + +void register_weapons_done(); + +// entity properties of weaponinfo: +// fields which are explicitly/manually set are marked with "M", fields set automatically are marked with "A" +.int weapon; // M: WEP_id // WEP_... +.WepSet weapons; // A: WEPSET_id // WEPSET_... +.float(float) weapon_func; // M: function // w_... +..int ammo_field; // M: ammotype // main ammo field +.int impulse; // M: impulse // weapon impulse +.int spawnflags; // M: flags // WEPSPAWNFLAG_... combined +.float bot_pickupbasevalue; // M: rating // bot weapon priority +.vector wpcolor; // M: color // waypointsprite color +.string wpmodel; // A: wpn-id // wpn- sprite name +.string mdl; // M: modelname // name of model (without g_ v_ or h_ prefixes) +.string model; // A: modelname // full path to g_ model +.string w_simplemdl; // M: simplemdl // simpleitems weapon model/image +.string w_crosshair; // M: crosshair // per-weapon crosshair: "CrosshairImage Size" +.float w_crosshair_size; // A: crosshair // per-weapon crosshair size (argument two of "crosshair" field) +.string model2; // M: wepimg // "weaponfoobar" side view image file of weapon // WEAPONTODO: Move out of skin files, move to common files +.string netname; // M: refname // reference name name +.string message; // M: wepname // human readable name + + +// note: the fabs call is just there to hide "if result is constant" warning +#define REGISTER_WEAPON_2(id,bit,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) \ + int id; \ + WepSet bit; \ + bool function(int); \ + void RegisterWeapons_##id() \ + { \ + WEP_LAST = (id = WEP_FIRST + WEP_COUNT); \ + bit = WepSet_FromWeapon(id); \ + WEPSET_ALL |= bit; \ + if((flags) & WEP_FLAG_SUPERWEAPON) \ + WEPSET_SUPERWEAPONS |= bit; \ + ++WEP_COUNT; \ + register_weapon(id,bit,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname); \ + } \ + ACCUMULATE_FUNCTION(RegisterWeapons, RegisterWeapons_##id) +#ifdef MENUQC +#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) \ + REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,w_null,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) +#else +#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) \ + REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) +#endif + +#include "all.inc" + +#undef WEP_ADD_CVAR_MO_PRI +#undef WEP_ADD_CVAR_MO_SEC +#undef WEP_ADD_CVAR_MO_BOTH +#undef WEP_ADD_CVAR_MO_NONE +#undef WEP_ADD_CVAR +#undef WEP_ADD_PROP +#undef REGISTER_WEAPON + +ACCUMULATE_FUNCTION(RegisterWeapons, register_weapons_done); +#endif diff --git a/qcsrc/common/weapons/config.qc b/qcsrc/common/weapons/config.qc index a314f036b..0448f4874 100644 --- a/qcsrc/common/weapons/config.qc +++ b/qcsrc/common/weapons/config.qc @@ -5,7 +5,7 @@ #include "../../dpdefs/dpextensions.qh" #include "../util.qh" #include "config.qh" - #include "weapons.qh" + #include "all.qh" #endif // ========================== diff --git a/qcsrc/common/weapons/weapons.qc b/qcsrc/common/weapons/weapons.qc deleted file mode 100644 index 58fdbaed4..000000000 --- a/qcsrc/common/weapons/weapons.qc +++ /dev/null @@ -1,375 +0,0 @@ -#ifndef WEAPONS_C -#define WEAPONS_C - -#include "weapons.qh" - -#if defined(CSQC) - #include "../../dpdefs/csprogsdefs.qh" - #include "../../client/defs.qh" - #include "../constants.qh" - #include "../stats.qh" - #include "../../warpzonelib/anglestransform.qh" - #include "../../warpzonelib/mathlib.qh" - #include "../../warpzonelib/common.qh" - #include "../../warpzonelib/client.qh" - #include "../util.qh" - #include "../buffs.qh" - #include "../../client/autocvars.qh" - #include "../deathtypes.qh" - #include "../../csqcmodellib/interpolate.qh" - #include "../../client/movetypes.qh" - #include "../../client/main.qh" - #include "../../csqcmodellib/cl_model.qh" -#elif defined(MENUQC) -#elif defined(SVQC) - #include "../../dpdefs/progsdefs.qh" - #include "../../dpdefs/dpextensions.qh" - #include "../../warpzonelib/anglestransform.qh" - #include "../../warpzonelib/mathlib.qh" - #include "../../warpzonelib/common.qh" - #include "../../warpzonelib/util_server.qh" - #include "../../warpzonelib/server.qh" - #include "../constants.qh" - #include "../stats.qh" - #include "../teams.qh" - #include "../util.qh" - #include "../buffs.qh" - #include "../monsters/monsters.qh" - #include "config.qh" - #include "../../server/weapons/csqcprojectile.qh" - #include "../../server/weapons/tracing.qh" - #include "../../server/t_items.qh" - #include "../../server/autocvars.qh" - #include "../../server/constants.qh" - #include "../../server/defs.qh" - #include "../notifications.qh" - #include "../deathtypes.qh" - #include "../../server/mutators/mutators_include.qh" - #include "../mapinfo.qh" - #include "../../server/command/common.qh" - #include "../../csqcmodellib/sv_model.qh" - #include "../../server/portals.qh" - #include "../../server/g_hook.qh" -#endif -#ifndef MENUQC -#include "calculations.qc" -#endif -#include "all.inc" - -// WEAPON PLUGIN SYSTEM -entity weapon_info[WEP_MAXCOUNT]; -entity dummy_weapon_info; - -#if WEP_MAXCOUNT > 72 -# error Kein Weltraum links auf dem Gerät -#endif - -WepSet WepSet_FromWeapon(int a) { - a -= WEP_FIRST; -#if WEP_MAXCOUNT > 24 - if(a >= 24) { - a -= 24; -#if WEP_MAXCOUNT > 48 - if(a >= 24) { - a -= 24; - return '0 0 1' * power2of(a); - } -#endif - return '0 1 0' * power2of(a); - } -#endif - return '1 0 0' * power2of(a); -} -#ifdef SVQC -void WepSet_AddStat() -{ - addstat(STAT_WEAPONS, AS_INT, weapons_x); -#if WEP_MAXCOUNT > 24 - addstat(STAT_WEAPONS2, AS_INT, weapons_y); -#if WEP_MAXCOUNT > 48 - addstat(STAT_WEAPONS3, AS_INT, weapons_z); -#endif -#endif -} -void WriteWepSet(float dst, WepSet w) -{ -#if WEP_MAXCOUNT > 48 - WriteInt72_t(dst, w); -#elif WEP_MAXCOUNT > 24 - WriteInt48_t(dst, w); -#else - WriteInt24_t(dst, w.x); -#endif -} -#endif -#ifdef CSQC -WepSet WepSet_GetFromStat() -{ - WepSet w = '0 0 0'; - w.x = getstati(STAT_WEAPONS); -#if WEP_MAXCOUNT > 24 - w.y = getstati(STAT_WEAPONS2); -#if WEP_MAXCOUNT > 48 - w.z = getstati(STAT_WEAPONS3); -#endif -#endif - return w; -} -WepSet ReadWepSet() -{ -#if WEP_MAXCOUNT > 48 - return ReadInt72_t(); -#elif WEP_MAXCOUNT > 24 - return ReadInt48_t(); -#else - return ReadInt24_t() * '1 0 0'; -#endif -} -#endif - -void register_weapon( - int id, - WepSet bit, - bool(int) func, - .int ammotype, - int i, - int weapontype, - float pickupbasevalue, - vector clr, - string modelname, - string simplemdl, - string crosshair, - string wepimg, - string refname, - string wepname) -{ - entity e; - weapon_info[id - 1] = e = spawn(); - e.classname = "weapon_info"; - e.weapon = id; - e.weapons = bit; - e.weapon_func = func; - e.ammo_field = ammotype; - e.impulse = i; - e.spawnflags = weapontype; - e.bot_pickupbasevalue = pickupbasevalue; - e.wpcolor = clr; - e.wpmodel = strzone(strcat("wpn-", ftos(id))); - e.mdl = modelname; - e.model = strzone(strcat("models/weapons/g_", modelname, ".md3")); - e.w_simplemdl = strzone(simplemdl); // simpleitems weapon model/image - e.w_crosshair = strzone(car(crosshair)); - string s = cdr(crosshair); - e.w_crosshair_size = ((s != "") ? stof(s) : 1); // so that we can scale the crosshair from code (for compat) - e.model2 = strzone(wepimg); - e.netname = refname; - e.message = wepname; - - #ifdef CSQC - func(WR_INIT); - #endif -} -bool w_null(int dummy) -{ - return 0; -} -void register_weapons_done() -{ - dummy_weapon_info = spawn(); - dummy_weapon_info.classname = "weapon_info"; - dummy_weapon_info.weapon = 0; // you can recognize dummies by this - dummy_weapon_info.weapons = '0 0 0'; - dummy_weapon_info.netname = ""; - dummy_weapon_info.message = "AOL CD Thrower"; - dummy_weapon_info.weapon_func = w_null; - dummy_weapon_info.wpmodel = ""; - dummy_weapon_info.mdl = ""; - dummy_weapon_info.model = ""; - dummy_weapon_info.spawnflags = 0; - dummy_weapon_info.impulse = -1; - dummy_weapon_info.bot_pickupbasevalue = 0; - dummy_weapon_info.ammo_field = ammo_none; - - dummy_weapon_info.w_crosshair = "gfx/crosshair1"; - dummy_weapon_info.w_crosshair_size = 1; - dummy_weapon_info.model2 = ""; - - int i; - weaponorder_byid = ""; - for(i = WEP_MAXCOUNT; i >= 1; --i) - if(weapon_info[i-1]) - weaponorder_byid = strcat(weaponorder_byid, " ", ftos(i)); - weaponorder_byid = strzone(substring(weaponorder_byid, 1, strlen(weaponorder_byid) - 1)); -} -entity get_weaponinfo(int id) -{ - entity w; - if(id < WEP_FIRST || id > WEP_LAST) - return dummy_weapon_info; - w = weapon_info[id - 1]; - if(w) - return w; - return dummy_weapon_info; -} -string W_FixWeaponOrder(string order, float complete) -{ - return fixPriorityList(order, WEP_FIRST, WEP_LAST, 230 - WEP_FIRST, complete); -} -string W_NameWeaponOrder_MapFunc(string s) -{ - entity wi; - if(s == "0" || stof(s)) - { - wi = get_weaponinfo(stof(s)); - if(wi != dummy_weapon_info) - return wi.netname; - } - return s; -} - -string W_UndeprecateName(string s) -{ - switch ( s ) - { - case "nex" : return "vortex"; - case "rocketlauncher" : return "devastator"; - case "laser" : return "blaster"; - case "minstanex" : return "vaporizer"; - case "grenadelauncher": return "mortar"; - case "uzi" : return "machinegun"; - default : return s; - } -} -string W_NameWeaponOrder(string order) -{ - return mapPriorityList(order, W_NameWeaponOrder_MapFunc); -} -string W_NumberWeaponOrder_MapFunc(string s) -{ - int i; - if(s == "0" || stof(s)) - return s; - s = W_UndeprecateName(s); - for(i = WEP_FIRST; i <= WEP_LAST; ++i) - if(s == get_weaponinfo(i).netname) - return ftos(i); - return s; -} -string W_NumberWeaponOrder(string order) -{ - return mapPriorityList(order, W_NumberWeaponOrder_MapFunc); -} - -float W_FixWeaponOrder_BuildImpulseList_buf[WEP_MAXCOUNT]; -string W_FixWeaponOrder_BuildImpulseList_order; -void W_FixWeaponOrder_BuildImpulseList_swap(int i, int j, entity pass) -{ - float h; - h = W_FixWeaponOrder_BuildImpulseList_buf[i]; - W_FixWeaponOrder_BuildImpulseList_buf[i] = W_FixWeaponOrder_BuildImpulseList_buf[j]; - W_FixWeaponOrder_BuildImpulseList_buf[j] = h; -} -float W_FixWeaponOrder_BuildImpulseList_cmp(int i, int j, entity pass) -{ - entity e1, e2; - float d; - e1 = get_weaponinfo(W_FixWeaponOrder_BuildImpulseList_buf[i]); - e2 = get_weaponinfo(W_FixWeaponOrder_BuildImpulseList_buf[j]); - d = (e1.impulse + 9) % 10 - (e2.impulse + 9) % 10; - if(d != 0) - return -d; // high impulse first! - return - strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "), sprintf(" %d ", W_FixWeaponOrder_BuildImpulseList_buf[i]), 0) - - - strstrofs(strcat(" ", W_FixWeaponOrder_BuildImpulseList_order, " "), sprintf(" %d ", W_FixWeaponOrder_BuildImpulseList_buf[j]), 0) - ; // low char index first! -} -string W_FixWeaponOrder_BuildImpulseList(string o) -{ - int i; - W_FixWeaponOrder_BuildImpulseList_order = o; - for(i = WEP_FIRST; i <= WEP_LAST; ++i) - W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST] = i; - heapsort(WEP_LAST - WEP_FIRST + 1, W_FixWeaponOrder_BuildImpulseList_swap, W_FixWeaponOrder_BuildImpulseList_cmp, world); - o = ""; - for(i = WEP_FIRST; i <= WEP_LAST; ++i) - o = strcat(o, " ", ftos(W_FixWeaponOrder_BuildImpulseList_buf[i - WEP_FIRST])); - W_FixWeaponOrder_BuildImpulseList_order = string_null; - return substring(o, 1, -1); -} - -string W_FixWeaponOrder_AllowIncomplete(string order) -{ - return W_FixWeaponOrder(order, 0); -} - -string W_FixWeaponOrder_ForceComplete(string order) -{ - if(order == "") - order = W_NumberWeaponOrder(cvar_defstring("cl_weaponpriority")); - return W_FixWeaponOrder(order, 1); -} - -void W_RandomWeapons(entity e, float n) -{ - int i, j; - WepSet remaining; - WepSet result; - remaining = e.weapons; - result = '0 0 0'; - for(i = 0; i < n; ++i) - { - RandomSelection_Init(); - for(j = WEP_FIRST; j <= WEP_LAST; ++j) - if(remaining & WepSet_FromWeapon(j)) - RandomSelection_Add(world, j, string_null, 1, 1); - result |= WepSet_FromWeapon(RandomSelection_chosen_float); - remaining &= ~WepSet_FromWeapon(RandomSelection_chosen_float); - } - e.weapons = result; -} - -string GetAmmoPicture(.int ammotype) -{ - switch(ammotype) - { - case ammo_shells: return "ammo_shells"; - case ammo_nails: return "ammo_bullets"; - case ammo_rockets: return "ammo_rockets"; - case ammo_cells: return "ammo_cells"; - case ammo_plasma: return "ammo_cells"; - case ammo_fuel: return "ammo_fuel"; - default: return ""; // wtf, no ammo type? - } -} - -#ifdef CSQC -.int GetAmmoFieldFromNum(int i) -{ - switch(i) - { - case 0: return ammo_shells; - case 1: return ammo_nails; - case 2: return ammo_rockets; - case 3: return ammo_cells; - case 4: return ammo_plasma; - case 5: return ammo_fuel; - default: return ammo_none; - } -} - -int GetAmmoStat(.int ammotype) -{ - switch(ammotype) - { - case ammo_shells: return STAT_SHELLS; - case ammo_nails: return STAT_NAILS; - case ammo_rockets: return STAT_ROCKETS; - case ammo_cells: return STAT_CELLS; - case ammo_plasma: return STAT_PLASMA; - case ammo_fuel: return STAT_FUEL; - default: return -1; - } -} -#endif -#endif diff --git a/qcsrc/common/weapons/weapons.qh b/qcsrc/common/weapons/weapons.qh deleted file mode 100644 index 5f17ccb8f..000000000 --- a/qcsrc/common/weapons/weapons.qh +++ /dev/null @@ -1,217 +0,0 @@ -#ifndef WEAPONS_H -#define WEAPONS_H - -#ifndef MENUQC -#include "calculations.qh" -#endif - -#include "../util.qh" -#ifdef SVQC -#include "../../server/bot/aim.qh" -#endif -const int MAX_SHOT_DISTANCE = 32768; - -// weapon pickup ratings for bot logic -const int BOT_PICKUP_RATING_LOW = 2500; -const int BOT_PICKUP_RATING_MID = 5000; -const int BOT_PICKUP_RATING_HIGH = 10000; - -// weapon flags -const int WEP_TYPE_OTHER = 0x00; // not for damaging people -const int WEP_TYPE_SPLASH = 0x01; // splash damage -const int WEP_TYPE_HITSCAN = 0x02; // hitscan -const int WEP_TYPEMASK = 0x0F; -const int WEP_FLAG_CANCLIMB = 0x10; // can be used for movement -const int WEP_FLAG_NORMAL = 0x20; // in "most weapons" set -const int WEP_FLAG_HIDDEN = 0x40; // hides from menu -const int WEP_FLAG_RELOADABLE = 0x80; // can has reload -const int WEP_FLAG_SUPERWEAPON = 0x100; // powerup timer -const int WEP_FLAG_MUTATORBLOCKED = 0x200; // hides from impulse 99 etc. (mutators are allowed to clear this flag) - -// weapon requests -const int WR_SETUP = 1; // (SERVER) setup weapon data -const int WR_THINK = 2; // (SERVER) logic to run every frame -const int WR_CHECKAMMO1 = 3; // (SERVER) checks ammo for weapon primary -const int WR_CHECKAMMO2 = 4; // (SERVER) checks ammo for weapon second -const int WR_AIM = 5; // (SERVER) runs bot aiming code for this weapon -const int WR_INIT = 6; // (BOTH) precaches models/sounds used by this weapon, also sets up weapon properties -const int WR_SUICIDEMESSAGE = 7; // (SERVER) notification number for suicide message (may inspect w_deathtype for details) -const int WR_KILLMESSAGE = 8; // (SERVER) notification number for kill message (may inspect w_deathtype for details) -const int WR_RELOAD = 9; // (SERVER) handles reloading for weapon -const int WR_RESETPLAYER = 10; // (SERVER) clears fields that the weapon may use -const int WR_IMPACTEFFECT = 11; // (CLIENT) impact effect for weapon explosion -const int WR_PLAYERDEATH = 12; // (SERVER) called whenever a player dies -const int WR_GONETHINK = 13; // (SERVER) logic to run when weapon is lost -const int WR_CONFIG = 14; // (ALL) dump weapon cvars to config in data directory (see: sv_cmd dumpweapons) -const int WR_ZOOMRETICLE = 15; // (CLIENT) weapon specific zoom reticle -const int WR_DROP = 16; // (SERVER) the weapon is dropped -const int WR_PICKUP = 17; // (SERVER) a weapon is picked up - -// variables: -string weaponorder_byid; - -// weapon sets -typedef vector WepSet; -WepSet WepSet_FromWeapon(int a); -#ifdef SVQC -void WepSet_AddStat(); -void WriteWepSet(float dest, WepSet w); -#endif -#ifdef CSQC -WepSet WepSet_GetFromStat(); -WepSet ReadWepSet(); -#endif - -// weapon name macros -#define WEP_FIRST 1 -#define WEP_MAXCOUNT 24 // Increase as needed. Can be up to three times as much. -int WEP_COUNT; -int WEP_LAST; -WepSet WEPSET_ALL; -WepSet WEPSET_SUPERWEAPONS; - -// functions: -entity get_weaponinfo(int id); -string W_FixWeaponOrder(string order, float complete); -string W_UndeprecateName(string s); -string W_NameWeaponOrder(string order); -string W_NumberWeaponOrder(string order); -string W_FixWeaponOrder_BuildImpulseList(string o); -string W_FixWeaponOrder_AllowIncomplete(string order); -string W_FixWeaponOrder_ForceComplete(string order); -void W_RandomWeapons(entity e, float n); - -string GetAmmoPicture(.int ammotype); - -#ifdef CSQC -.int GetAmmoFieldFromNum(int i); -int GetAmmoStat(.int ammotype); -#endif - -// ammo types -.int ammo_shells; -.int ammo_nails; -.int ammo_rockets; -.int ammo_cells; -.int ammo_plasma; -.int ammo_fuel; -.int ammo_none; - -// other useful macros -#define WEP_ACTION(wpn,wrequest) (get_weaponinfo(wpn)).weapon_func(wrequest) -#define WEP_AMMO(wpn) ((get_weaponinfo(WEP_##wpn)).ammo_field) // only used inside weapon files/with direct name, don't duplicate prefix -#define WEP_NAME(wpn) ((get_weaponinfo(wpn)).message) - - -// ====================== -// Configuration Macros -// ====================== - -// create cvars for weapon settings -#define WEP_ADD_CVAR_NONE(wepname,name) [[last]] float autocvar_g_balance_##wepname##_##name; - -#define WEP_ADD_CVAR_PRI(wepname,name) WEP_ADD_CVAR_NONE(wepname, primary_##name) -#define WEP_ADD_CVAR_SEC(wepname,name) WEP_ADD_CVAR_NONE(wepname, secondary_##name) -#define WEP_ADD_CVAR_BOTH(wepname,name) \ - WEP_ADD_CVAR_PRI(wepname, name) \ - WEP_ADD_CVAR_SEC(wepname, name) - -#define WEP_ADD_CVAR(wepid,wepname,mode,name) WEP_ADD_CVAR_##mode(wepname, name) - -// create properties for weapon settings -#define WEP_ADD_PROP(wepid,wepname,type,prop,name) \ - .type prop; \ - [[last]] type autocvar_g_balance_##wepname##_##name; - -// read cvars from weapon settings -#define WEP_CVAR(wepname,name) autocvar_g_balance_##wepname##_##name -#define WEP_CVAR_PRI(wepname,name) WEP_CVAR(wepname, primary_##name) -#define WEP_CVAR_SEC(wepname,name) WEP_CVAR(wepname, secondary_##name) -#define WEP_CVAR_BOTH(wepname,isprimary,name) ((isprimary) ? WEP_CVAR_PRI(wepname, name) : WEP_CVAR_SEC(wepname, name)) - -// set initialization values for weapon settings -#define WEP_SKIP_CVAR(unuseda,unusedb,unusedc,unusedd) /* skip cvars */ -#define WEP_SET_PROP(wepid,wepname,type,prop,name) get_weaponinfo(WEP_##wepid).##prop = autocvar_g_balance_##wepname##_##name; - - -// ===================== -// Weapon Registration -// ===================== - -bool w_null(int dummy); - -void register_weapon( - int id, - WepSet bit, - bool(int) func, - .int ammotype, - int i, - int weapontype, - float pickupbasevalue, - vector clr, - string modelname, - string simplemdl, - string crosshair, - string wepimg, - string refname, - string wepname); - -void register_weapons_done(); - -// entity properties of weaponinfo: -// fields which are explicitly/manually set are marked with "M", fields set automatically are marked with "A" -.int weapon; // M: WEP_id // WEP_... -.WepSet weapons; // A: WEPSET_id // WEPSET_... -.float(float) weapon_func; // M: function // w_... -..int ammo_field; // M: ammotype // main ammo field -.int impulse; // M: impulse // weapon impulse -.int spawnflags; // M: flags // WEPSPAWNFLAG_... combined -.float bot_pickupbasevalue; // M: rating // bot weapon priority -.vector wpcolor; // M: color // waypointsprite color -.string wpmodel; // A: wpn-id // wpn- sprite name -.string mdl; // M: modelname // name of model (without g_ v_ or h_ prefixes) -.string model; // A: modelname // full path to g_ model -.string w_simplemdl; // M: simplemdl // simpleitems weapon model/image -.string w_crosshair; // M: crosshair // per-weapon crosshair: "CrosshairImage Size" -.float w_crosshair_size; // A: crosshair // per-weapon crosshair size (argument two of "crosshair" field) -.string model2; // M: wepimg // "weaponfoobar" side view image file of weapon // WEAPONTODO: Move out of skin files, move to common files -.string netname; // M: refname // reference name name -.string message; // M: wepname // human readable name - - -// note: the fabs call is just there to hide "if result is constant" warning -#define REGISTER_WEAPON_2(id,bit,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) \ - int id; \ - WepSet bit; \ - bool function(int); \ - void RegisterWeapons_##id() \ - { \ - WEP_LAST = (id = WEP_FIRST + WEP_COUNT); \ - bit = WepSet_FromWeapon(id); \ - WEPSET_ALL |= bit; \ - if((flags) & WEP_FLAG_SUPERWEAPON) \ - WEPSET_SUPERWEAPONS |= bit; \ - ++WEP_COUNT; \ - register_weapon(id,bit,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname); \ - } \ - ACCUMULATE_FUNCTION(RegisterWeapons, RegisterWeapons_##id) -#ifdef MENUQC -#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) \ - REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,w_null,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) -#else -#define REGISTER_WEAPON(id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) \ - REGISTER_WEAPON_2(WEP_##id,WEPSET_##id,function,ammotype,impulse,flags,rating,color,modelname,simplemdl,crosshair,wepimg,refname,wepname) -#endif - -#include "all.inc" - -#undef WEP_ADD_CVAR_MO_PRI -#undef WEP_ADD_CVAR_MO_SEC -#undef WEP_ADD_CVAR_MO_BOTH -#undef WEP_ADD_CVAR_MO_NONE -#undef WEP_ADD_CVAR -#undef WEP_ADD_PROP -#undef REGISTER_WEAPON - -ACCUMULATE_FUNCTION(RegisterWeapons, register_weapons_done); -#endif diff --git a/qcsrc/menu/_all.qh b/qcsrc/menu/_all.qh index cc07017e1..a6903ae3d 100644 --- a/qcsrc/menu/_all.qh +++ b/qcsrc/menu/_all.qh @@ -1,5 +1,5 @@ -#ifndef CLIENT___H -#define CLIENT___H +#ifndef CLIENT_ALL_H +#define CLIENT_ALL_H #include "../dpdefs/menudefs.qh" #include "../dpdefs/keycodes.qh" diff --git a/qcsrc/menu/command/all.qc b/qcsrc/menu/command/all.qc new file mode 100644 index 000000000..711a747ea --- /dev/null +++ b/qcsrc/menu/command/all.qc @@ -0,0 +1,5 @@ +#include "../menu.qh" + +#include "../../common/command/all.qc" + +#include "menu_cmd.qc" diff --git a/qcsrc/menu/command/all.qh b/qcsrc/menu/command/all.qh new file mode 100644 index 000000000..7f116ae9f --- /dev/null +++ b/qcsrc/menu/command/all.qh @@ -0,0 +1,8 @@ +#ifndef MENU_COMMANDS_ALL_H +#define MENU_COMMANDS_ALL_H + +#include "../../common/command/commands.qh" + +#include "menu_cmd.qh" + +#endif diff --git a/qcsrc/menu/command/commands.qc b/qcsrc/menu/command/commands.qc deleted file mode 100644 index 5b5911fa9..000000000 --- a/qcsrc/menu/command/commands.qc +++ /dev/null @@ -1,5 +0,0 @@ -#include "../menu.qh" - -#include "../../common/command/commands.qc" - -#include "menu_cmd.qc" diff --git a/qcsrc/menu/command/commands.qh b/qcsrc/menu/command/commands.qh deleted file mode 100644 index 5ea300616..000000000 --- a/qcsrc/menu/command/commands.qh +++ /dev/null @@ -1,8 +0,0 @@ -#ifndef MENU_COMMANDS_H -#define MENU_COMMANDS_H - -#include "../../common/command/commands.qh" - -#include "menu_cmd.qh" - -#endif diff --git a/qcsrc/menu/menu.qc b/qcsrc/menu/menu.qc index 669e08fe7..70f4249d0 100644 --- a/qcsrc/menu/menu.qc +++ b/qcsrc/menu/menu.qc @@ -2,7 +2,7 @@ #include "oo/classes.qc" #include "xonotic/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../common/mapinfo.qh" /////////////////////////////////////////////// diff --git a/qcsrc/menu/progs.src b/qcsrc/menu/progs.src index abfb303db..636c862b7 100644 --- a/qcsrc/menu/progs.src +++ b/qcsrc/menu/progs.src @@ -9,7 +9,7 @@ oo/classes.qc draw.qc menu.qc -command/commands.qc +command/all.qc xonotic/util.qc @@ -21,8 +21,8 @@ xonotic/util.qc ../common/urllib.qc ../common/util.qc -../common/monsters/monsters.qc +../common/monsters/all.qc -../common/weapons/weapons.qc // TODO +../common/weapons/all.qc // TODO ../warpzonelib/mathlib.qc diff --git a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc index 449445225..8ab529638 100644 --- a/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc +++ b/qcsrc/menu/xonotic/dialog_multiplayer_create_mutators.qc @@ -1,4 +1,4 @@ -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" #ifndef DIALOG_MULTIPLAYER_CREATE_MUTATORS_H #define DIALOG_MULTIPLAYER_CREATE_MUTATORS_H diff --git a/qcsrc/server/_all.qh b/qcsrc/server/_all.qh index 6438a1094..a33136215 100644 --- a/qcsrc/server/_all.qh +++ b/qcsrc/server/_all.qh @@ -1,5 +1,5 @@ -#ifndef SERVER___H -#define SERVER___H +#ifndef SERVER_ALL_H +#define SERVER_ALL_H #include "autocvars.qh" #include "constants.qh" diff --git a/qcsrc/server/bot/bot.qc b/qcsrc/server/bot/bot.qc index 1879b1860..e42a50f6d 100644 --- a/qcsrc/server/bot/bot.qc +++ b/qcsrc/server/bot/bot.qc @@ -27,7 +27,7 @@ #include "../../common/teams.qh" #include "../../common/util.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" #include "../../csqcmodellib/sv_model.qh" diff --git a/qcsrc/server/cheats.qc b/qcsrc/server/cheats.qc index 75a93d267..d9eb75915 100644 --- a/qcsrc/server/cheats.qc +++ b/qcsrc/server/cheats.qc @@ -13,9 +13,9 @@ #include "../common/deathtypes.qh" #include "../common/util.qh" -#include "../common/monsters/monsters.qh" +#include "../common/monsters/all.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/sv_model.qh" diff --git a/qcsrc/server/cl_impulse.qc b/qcsrc/server/cl_impulse.qc index a02cf40ac..bb4c171c8 100644 --- a/qcsrc/server/cl_impulse.qc +++ b/qcsrc/server/cl_impulse.qc @@ -13,7 +13,7 @@ #include "vehicles/vehicle.qh" #include "waypointsprites.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" /* * Impulse map: diff --git a/qcsrc/server/cl_physics.qc b/qcsrc/server/cl_physics.qc index bbb730d31..67c57ae16 100644 --- a/qcsrc/server/cl_physics.qc +++ b/qcsrc/server/cl_physics.qc @@ -13,7 +13,7 @@ #include "../common/util.qh" #include "../common/animdecide.qh" #include "../common/monsters/sv_monsters.qh" - #include "../common/weapons/weapons.qh" + #include "../common/weapons/all.qh" #include "t_items.qh" #include "autocvars.qh" #include "defs.qh" diff --git a/qcsrc/server/command/all.qc b/qcsrc/server/command/all.qc new file mode 100644 index 000000000..ac37b6b2c --- /dev/null +++ b/qcsrc/server/command/all.qc @@ -0,0 +1,10 @@ +#include "../../common/command/all.qc" + +#include "sv_cmd.qc" + +#include "banning.qc" +#include "cmd.qc" +#include "common.qc" +#include "getreplies.qc" +#include "radarmap.qc" +#include "vote.qc" diff --git a/qcsrc/server/command/all.qh b/qcsrc/server/command/all.qh new file mode 100644 index 000000000..af87c24b1 --- /dev/null +++ b/qcsrc/server/command/all.qh @@ -0,0 +1,15 @@ +#ifndef SERVER_COMMANDS_ALL_H +#define SERVER_COMMANDS_ALL_H + +#include "../../common/command/commands.qh" + +#include "sv_cmd.qh" + +#include "banning.qh" +#include "cmd.qh" +#include "common.qh" +#include "getreplies.qh" +#include "radarmap.qh" +#include "vote.qh" + +#endif diff --git a/qcsrc/server/command/cmd.qc b/qcsrc/server/command/cmd.qc index d9eeea19e..4548bbf9b 100644 --- a/qcsrc/server/command/cmd.qc +++ b/qcsrc/server/command/cmd.qc @@ -27,7 +27,7 @@ #include "../../common/teams.qh" #include "../../common/util.qh" -#include "../../common/monsters/monsters.qh" +#include "../../common/monsters/all.qh" #include "../../common/monsters/spawn.qh" #include "../../common/monsters/sv_monsters.qh" diff --git a/qcsrc/server/command/commands.qc b/qcsrc/server/command/commands.qc deleted file mode 100644 index 1db4db181..000000000 --- a/qcsrc/server/command/commands.qc +++ /dev/null @@ -1,10 +0,0 @@ -#include "../../common/command/commands.qc" - -#include "sv_cmd.qc" - -#include "banning.qc" -#include "cmd.qc" -#include "common.qc" -#include "getreplies.qc" -#include "radarmap.qc" -#include "vote.qc" diff --git a/qcsrc/server/command/commands.qh b/qcsrc/server/command/commands.qh deleted file mode 100644 index d26468da2..000000000 --- a/qcsrc/server/command/commands.qh +++ /dev/null @@ -1,15 +0,0 @@ -#ifndef SERVER_COMMANDS_H -#define SERVER_COMMANDS_H - -#include "../../common/command/commands.qh" - -#include "sv_cmd.qh" - -#include "banning.qh" -#include "cmd.qh" -#include "common.qh" -#include "getreplies.qh" -#include "radarmap.qh" -#include "vote.qh" - -#endif diff --git a/qcsrc/server/command/getreplies.qc b/qcsrc/server/command/getreplies.qc index 12a31ca65..543f1db15 100644 --- a/qcsrc/server/command/getreplies.qc +++ b/qcsrc/server/command/getreplies.qc @@ -9,7 +9,7 @@ #include "../../common/mapinfo.qh" #include "../../common/util.qh" -#include "../../common/monsters/monsters.qh" +#include "../../common/monsters/all.qh" // ========================================================= // Reply messages for common commands, re-worked by Samual diff --git a/qcsrc/server/defs.qh b/qcsrc/server/defs.qh index 49e340c49..2ac72548e 100644 --- a/qcsrc/server/defs.qh +++ b/qcsrc/server/defs.qh @@ -1,7 +1,7 @@ #ifndef SERVER_DEFS_H #define SERVER_DEFS_H -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #define INDEPENDENT_ATTACK_FINISHED diff --git a/qcsrc/server/g_damage.qc b/qcsrc/server/g_damage.qc index 1e7e72a12..24bce642d 100644 --- a/qcsrc/server/g_damage.qc +++ b/qcsrc/server/g_damage.qc @@ -18,7 +18,7 @@ #include "../common/playerstats.qh" #include "../common/teams.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/sv_model.qh" #include "../warpzonelib/common.qh" diff --git a/qcsrc/server/g_damage.qh b/qcsrc/server/g_damage.qh index 49f495bc4..9dce060cc 100644 --- a/qcsrc/server/g_damage.qh +++ b/qcsrc/server/g_damage.qh @@ -10,7 +10,7 @@ #include "../common/constants.qh" #include "../common/teams.qh" #include "../common/util.qh" - #include "../common/weapons/weapons.qh" + #include "../common/weapons/all.qh" #include "weapons/accuracy.qh" #include "weapons/csqcprojectile.qh" #include "weapons/selection.qh" diff --git a/qcsrc/server/g_hook.qc b/qcsrc/server/g_hook.qc index c101236f8..4a3f3101a 100644 --- a/qcsrc/server/g_hook.qc +++ b/qcsrc/server/g_hook.qc @@ -12,7 +12,7 @@ #include "vehicles/vehicle.qh" #include "../common/constants.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../warpzonelib/common.qh" #include "../warpzonelib/server.qh" diff --git a/qcsrc/server/g_world.qc b/qcsrc/server/g_world.qc index 82a81776a..d9b3e3faf 100644 --- a/qcsrc/server/g_world.qc +++ b/qcsrc/server/g_world.qc @@ -25,14 +25,14 @@ #include "../common/constants.qh" #include "../common/deathtypes.qh" #include "../common/mapinfo.qh" -#include "../common/monsters/monsters.qh" +#include "../common/monsters/all.qh" #include "../common/monsters/sv_monsters.qh" #include "../common/notifications.qh" #include "../common/playerstats.qh" #include "../common/stats.qh" #include "../common/teams.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" const float LATENCY_THINKRATE = 10; .float latency_sum; diff --git a/qcsrc/server/item_key.qc b/qcsrc/server/item_key.qc index e0f79f114..1aa054d07 100644 --- a/qcsrc/server/item_key.qc +++ b/qcsrc/server/item_key.qc @@ -1,7 +1,7 @@ #include "item_key.qh" #include "_all.qh" -#include "../common/monsters/monsters.qh" +#include "../common/monsters/all.qh" #include "../common/notifications.qh" #include "../common/util.qh" #include "../warpzonelib/util_server.qh" diff --git a/qcsrc/server/miscfunctions.qc b/qcsrc/server/miscfunctions.qc index 41f388ed5..079df60f8 100644 --- a/qcsrc/server/miscfunctions.qc +++ b/qcsrc/server/miscfunctions.qc @@ -21,7 +21,7 @@ #include "../common/teams.qh" #include "../common/urllib.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/sv_model.qh" #include "../warpzonelib/anglestransform.qh" #include "../warpzonelib/server.qh" diff --git a/qcsrc/server/mutators/gamemode.qh b/qcsrc/server/mutators/gamemode.qh index 38e9ad8a3..101bdece8 100644 --- a/qcsrc/server/mutators/gamemode.qh +++ b/qcsrc/server/mutators/gamemode.qh @@ -25,7 +25,7 @@ #include "../command/vote.qh" -#include "../../common/monsters/monsters.qh" +#include "../../common/monsters/all.qh" #include "../command/common.qh" diff --git a/qcsrc/server/mutators/mutator.qh b/qcsrc/server/mutators/mutator.qh index 6cded5366..d7474fab4 100644 --- a/qcsrc/server/mutators/mutator.qh +++ b/qcsrc/server/mutators/mutator.qh @@ -37,7 +37,7 @@ #include "../../common/stats.qh" #include "../../common/teams.qh" -#include "../../common/monsters/monsters.qh" +#include "../../common/monsters/all.qh" #include "../../warpzonelib/anglestransform.qh" #include "../../warpzonelib/mathlib.qh" diff --git a/qcsrc/server/mutators/mutators_include.qc b/qcsrc/server/mutators/mutators_include.qc index 4c591446b..4debaa5a8 100644 --- a/qcsrc/server/mutators/mutators_include.qc +++ b/qcsrc/server/mutators/mutators_include.qc @@ -23,11 +23,11 @@ #include "../../common/command/command.qh" #include "../../common/net_notice.qh" #include "../../common/animdecide.qh" - #include "../../common/monsters/monsters.qh" + #include "../../common/monsters/all.qh" #include "../../common/monsters/sv_monsters.qh" #include "../../common/monsters/spawn.qh" #include "../../common/weapons/config.qh" - #include "../../common/weapons/weapons.qh" + #include "../../common/weapons/all.qh" #include "../weapons/accuracy.qh" #include "../weapons/common.qh" #include "../weapons/csqcprojectile.qh" diff --git a/qcsrc/server/portals.qc b/qcsrc/server/portals.qc index b9d32e106..cb671ddc7 100644 --- a/qcsrc/server/portals.qc +++ b/qcsrc/server/portals.qc @@ -9,7 +9,7 @@ #include "../common/deathtypes.qh" #include "../common/notifications.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/sv_model.qh" #include "../warpzonelib/anglestransform.qh" #include "../warpzonelib/util_server.qh" diff --git a/qcsrc/server/progs.src b/qcsrc/server/progs.src index 20b28a410..a812de46a 100644 --- a/qcsrc/server/progs.src +++ b/qcsrc/server/progs.src @@ -67,7 +67,7 @@ bot/havocbot/role_keyhunt.qc bot/havocbot/role_onslaught.qc bot/havocbot/roles.qc -command/commands.qc +command/all.qc mutators/mutators_include.qc mutators/mutators.qc @@ -97,7 +97,7 @@ weapons/weaponsystem.qc ../common/campaign_file.qc ../common/campaign_setup.qc ../common/mapinfo.qc -../common/monsters/monsters.qc +../common/monsters/all.qc ../common/monsters/spawn.qc ../common/monsters/sv_monsters.qc ../common/nades.qc @@ -108,7 +108,7 @@ weapons/weaponsystem.qc ../common/urllib.qc ../common/util.qc ../common/weapons/config.qc -../common/weapons/weapons.qc // TODO +../common/weapons/all.qc // TODO ../csqcmodellib/sv_model.qc diff --git a/qcsrc/server/sv_main.qc b/qcsrc/server/sv_main.qc index 5982d2028..0f7d1763b 100644 --- a/qcsrc/server/sv_main.qc +++ b/qcsrc/server/sv_main.qc @@ -18,7 +18,7 @@ #include "../common/mapinfo.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/sv_model.qh" diff --git a/qcsrc/server/t_items.qc b/qcsrc/server/t_items.qc index 6839091f4..515677bfa 100644 --- a/qcsrc/server/t_items.qc +++ b/qcsrc/server/t_items.qc @@ -20,9 +20,9 @@ #include "../common/notifications.qh" #include "../common/util.qh" - #include "../common/monsters/monsters.qh" + #include "../common/monsters/all.qh" - #include "../common/weapons/weapons.qh" + #include "../common/weapons/all.qh" #include "../warpzonelib/util_server.qh" #endif diff --git a/qcsrc/server/t_plats.qc b/qcsrc/server/t_plats.qc index cec1a7f6b..40d6a4d43 100644 --- a/qcsrc/server/t_plats.qc +++ b/qcsrc/server/t_plats.qc @@ -13,7 +13,7 @@ #include "../common/notifications.qh" #include "../common/util.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../csqcmodellib/sv_model.qh" diff --git a/qcsrc/server/t_quake.qc b/qcsrc/server/t_quake.qc index 9e68ac812..517b88082 100644 --- a/qcsrc/server/t_quake.qc +++ b/qcsrc/server/t_quake.qc @@ -1,6 +1,6 @@ #include "_all.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" void spawnfunc_weapon_electro(); void spawnfunc_weapon_hagar(); diff --git a/qcsrc/server/t_quake3.qc b/qcsrc/server/t_quake3.qc index 2c5bd894e..6908b6dbf 100644 --- a/qcsrc/server/t_quake3.qc +++ b/qcsrc/server/t_quake3.qc @@ -1,6 +1,6 @@ #include "_all.qh" -#include "../common/weapons/weapons.qh" +#include "../common/weapons/all.qh" #include "../common/buffs.qh" void spawnfunc_weapon_crylink(); diff --git a/qcsrc/server/t_swamp.qc b/qcsrc/server/t_swamp.qc index 1c80c3ac0..20b49ec6a 100644 --- a/qcsrc/server/t_swamp.qc +++ b/qcsrc/server/t_swamp.qc @@ -4,7 +4,7 @@ #include "_all.qh" #include "../warpzonelib/util_server.qh" - #include "../common/weapons/weapons.qh" + #include "../common/weapons/all.qh" #include "../common/deathtypes.qh" #endif diff --git a/qcsrc/server/vehicles/all.qh b/qcsrc/server/vehicles/all.qh index c675c9cbf..520306223 100644 --- a/qcsrc/server/vehicles/all.qh +++ b/qcsrc/server/vehicles/all.qh @@ -1,5 +1,5 @@ -#ifndef VEHICLES_H -#define VEHICLES_H +#ifndef VEHICLES_ALL_H +#define VEHICLES_ALL_H #if VEHICLES_ENABLED # include "racer.qh" diff --git a/qcsrc/server/weapons/accuracy.qc b/qcsrc/server/weapons/accuracy.qc index bfa18464f..1ef81a409 100644 --- a/qcsrc/server/weapons/accuracy.qc +++ b/qcsrc/server/weapons/accuracy.qc @@ -5,7 +5,7 @@ #include "../../common/constants.qh" #include "../../common/teams.qh" #include "../../common/util.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" float accuracy_byte(float n, float d) { diff --git a/qcsrc/server/weapons/common.qc b/qcsrc/server/weapons/common.qc index a837b2e47..cf49b54f8 100644 --- a/qcsrc/server/weapons/common.qc +++ b/qcsrc/server/weapons/common.qc @@ -6,7 +6,7 @@ #include "../../common/deathtypes.qh" #include "../../common/notifications.qh" #include "../../common/util.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" void W_GiveWeapon (entity e, float wep) { diff --git a/qcsrc/server/weapons/csqcprojectile.qc b/qcsrc/server/weapons/csqcprojectile.qc index fef16a833..507fc4a41 100644 --- a/qcsrc/server/weapons/csqcprojectile.qc +++ b/qcsrc/server/weapons/csqcprojectile.qc @@ -6,7 +6,7 @@ #include "../command/common.qh" #include "../../common/constants.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" .float csqcprojectile_type; diff --git a/qcsrc/server/weapons/hitplot.qc b/qcsrc/server/weapons/hitplot.qc index c93b31953..76e159738 100644 --- a/qcsrc/server/weapons/hitplot.qc +++ b/qcsrc/server/weapons/hitplot.qc @@ -3,7 +3,7 @@ #include "../antilag.qh" #include "../g_subs.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" vector W_HitPlotUnnormalizedUntransform(vector screenforward, vector screenright, vector screenup, vector v) { diff --git a/qcsrc/server/weapons/selection.qc b/qcsrc/server/weapons/selection.qc index da9b00a18..89c4253a1 100644 --- a/qcsrc/server/weapons/selection.qc +++ b/qcsrc/server/weapons/selection.qc @@ -6,7 +6,7 @@ #include "../waypointsprites.qh" #include "../../common/constants.qh" #include "../../common/util.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" // switch between weapons void Send_WeaponComplain(entity e, float wpn, float type) diff --git a/qcsrc/server/weapons/spawning.qc b/qcsrc/server/weapons/spawning.qc index 9d46475af..9096b2f9c 100644 --- a/qcsrc/server/weapons/spawning.qc +++ b/qcsrc/server/weapons/spawning.qc @@ -4,7 +4,7 @@ #include "weaponsystem.qh" #include "../mutators/mutators_include.qh" #include "../t_items.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" string W_Apply_Weaponreplace(string in) { diff --git a/qcsrc/server/weapons/throwing.qc b/qcsrc/server/weapons/throwing.qc index 6b549993a..1fea5fb39 100644 --- a/qcsrc/server/weapons/throwing.qc +++ b/qcsrc/server/weapons/throwing.qc @@ -9,7 +9,7 @@ #include "../../common/mapinfo.qh" #include "../../common/notifications.qh" #include "../../common/util.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" void thrown_wep_think() { diff --git a/qcsrc/server/weapons/tracing.qc b/qcsrc/server/weapons/tracing.qc index 2a3181d1b..0bdecfd0d 100644 --- a/qcsrc/server/weapons/tracing.qc +++ b/qcsrc/server/weapons/tracing.qc @@ -12,7 +12,7 @@ #include "../../common/constants.qh" #include "../../common/util.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" #include "../../warpzonelib/common.qh" diff --git a/qcsrc/server/weapons/weaponstats.qc b/qcsrc/server/weapons/weaponstats.qc index fb668ae7c..a84969904 100644 --- a/qcsrc/server/weapons/weaponstats.qc +++ b/qcsrc/server/weapons/weaponstats.qc @@ -4,7 +4,7 @@ #include "../g_world.qh" #include "../../common/urllib.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" void WeaponStats_Init() { diff --git a/qcsrc/server/weapons/weaponsystem.qc b/qcsrc/server/weapons/weaponsystem.qc index accf5b2f0..588c68acf 100644 --- a/qcsrc/server/weapons/weaponsystem.qc +++ b/qcsrc/server/weapons/weaponsystem.qc @@ -9,10 +9,10 @@ #include "../t_items.qh" #include "../../common/animdecide.qh" #include "../../common/constants.qh" -#include "../../common/monsters/monsters.qh" +#include "../../common/monsters/all.qh" #include "../../common/notifications.qh" #include "../../common/util.qh" -#include "../../common/weapons/weapons.qh" +#include "../../common/weapons/all.qh" #include "../../csqcmodellib/sv_model.qh" /* diff --git a/qcsrc/warpzonelib/common.qc b/qcsrc/warpzonelib/common.qc index 0734811c1..028724afb 100644 --- a/qcsrc/warpzonelib/common.qc +++ b/qcsrc/warpzonelib/common.qc @@ -5,7 +5,7 @@ #include "../server/t_items.qh" #elif defined(MENUQC) #elif defined(SVQC) - #include "../common/weapons/weapons.qh" + #include "../common/weapons/all.qh" #include "../dpdefs/dpextensions.qh" #include "../dpdefs/progsdefs.qh" #endif