X-Git-Url: https://git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fserver%2Fcompat%2Fquake3.qc;h=ae9dbd35760faf0e834f184d5f64d16fcac65d82;hb=c58baab5bd2dc4a77eb7d8e97824621d887c8e75;hp=112a7f039d95cee3c5ab34820011a0a1a7dd20d4;hpb=1236b060b5cde5ec310492417f2f4a03c367a423;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/server/compat/quake3.qc b/qcsrc/server/compat/quake3.qc index 112a7f039..ae9dbd357 100644 --- a/qcsrc/server/compat/quake3.qc +++ b/qcsrc/server/compat/quake3.qc @@ -1,13 +1,21 @@ #include "quake3.qh" -#include -#include -#include -#include -#include -#include +#include +#include #include +#include +#include +#include +#include +#include +#include +#include #include +#include +#include +#include +#include +#include //*********************** //QUAKE 3 ENTITIES - So people can play quake3 maps with the xonotic weapons @@ -57,10 +65,7 @@ SPAWNFUNC_ITEM(item_armor_shard, ITEM_ArmorSmall) SPAWNFUNC_ITEM(item_enviro, ITEM_Shield) // medkit -> armor (we have no holdables) -SPAWNFUNC_ITEM(holdable_medkit, ITEM_ArmorMega) - -// doubler -> strength -SPAWNFUNC_ITEM(item_doubler, ITEM_Strength) +SPAWNFUNC_ITEM(holdable_medkit, ITEM_ArmorBig) .float wait; .float delay; @@ -101,25 +106,44 @@ void target_init_use(entity this, entity actor, entity trigger) if (!(this.spawnflags & 4)) { - SetResource(actor, RES_SHELLS, start_ammo_shells); - SetResource(actor, RES_BULLETS, start_ammo_nails); - SetResource(actor, RES_ROCKETS, start_ammo_rockets); - SetResource(actor, RES_CELLS, start_ammo_cells); - SetResource(actor, RES_PLASMA, start_ammo_plasma); - SetResource(actor, RES_FUEL, start_ammo_fuel); - - STAT(WEAPONS, actor) = start_weapons; - if (this.spawnflags & 32) + if(this.spawnflags & 32) // spawn with only melee { - // TODO + SetResource(actor, RES_SHELLS, 0); + SetResource(actor, RES_BULLETS, 0); + SetResource(actor, RES_ROCKETS, 0); + SetResource(actor, RES_CELLS, 0); + SetResource(actor, RES_PLASMA, 0); + SetResource(actor, RES_FUEL, 0); + + STAT(WEAPONS, actor) = WEPSET(SHOTGUN); + } + else + { + SetResource(actor, RES_SHELLS, start_ammo_shells); + SetResource(actor, RES_BULLETS, start_ammo_nails); + SetResource(actor, RES_ROCKETS, start_ammo_rockets); + SetResource(actor, RES_CELLS, start_ammo_cells); + SetResource(actor, RES_PLASMA, start_ammo_plasma); + SetResource(actor, RES_FUEL, start_ammo_fuel); + + STAT(WEAPONS, actor) = start_weapons; } } if (!(this.spawnflags & 8)) { - actor.strength_finished = 0; - actor.invincible_finished = 0; - STAT(BUFFS, actor) = 0; + StatusEffects_remove(STATUSEFFECT_Strength, actor, STATUSEFFECT_REMOVE_NORMAL); + StatusEffects_remove(STATUSEFFECT_Shield, actor, STATUSEFFECT_REMOVE_NORMAL); + entity heldbuff = buff_FirstFromFlags(actor); + if(heldbuff) // TODO: make a dropbuffs function to handle this + { + int buffid = heldbuff.m_id; + Send_Notification(NOTIF_ONE, actor, MSG_MULTI, ITEM_BUFF_DROP, buffid); + sound(actor, CH_TRIGGER, SND_BUFF_LOST, VOL_BASE, ATTN_NORM); + if(!IS_INDEPENDENT_PLAYER(actor)) + Send_Notification(NOTIF_ALL_EXCEPT, actor, MSG_INFO, INFO_ITEM_BUFF_LOST, actor.netname, buffid); + buff_RemoveAll(actor, STATUSEFFECT_REMOVE_NORMAL); + } } if (!(this.spawnflags & 16)) @@ -165,10 +189,20 @@ void target_give_init(entity this) SetResourceExplicit(this, RES_ROCKETS, GetResource(this, RES_ROCKETS) + it.count * WEP_CVAR_PRI(mortar, ammo)); // WEAPONTODO this.netname = cons(this.netname, "mortar"); } + else if (it.classname == "weapon_shotgun") { + SetResourceExplicit(this, RES_SHELLS, GetResource(this, RES_SHELLS) + it.count * WEP_CVAR_PRI(shotgun, ammo)); // WEAPONTODO + this.netname = cons(this.netname, "shotgun"); + } else if (it.classname == "item_armor_mega") SetResourceExplicit(this, RES_ARMOR, 100); else if (it.classname == "item_health_mega") SetResourceExplicit(this, RES_HEALTH, 200); + else if (it.classname == "item_buff") { + entity buff = it.buffdef; + this.netname = cons(this.netname, buff.netname); + this.buffs_finished = it.count; + } + //remove(it); // removing ents in init functions causes havoc, workaround: setthink(it, SUB_Remove); it.nextthink = time; @@ -216,11 +250,12 @@ spawnfunc(target_fragsFilter) } //spawnfunc(item_flight) /* handled by buffs mutator */ +//spawnfunc(item_doubler) /* handled by buffs mutator */ //spawnfunc(item_haste) /* handled by buffs mutator */ //spawnfunc(item_health) /* handled in t_quake.qc */ -//spawnfunc(item_health_large) /* handled in t_items.qc */ -//spawnfunc(item_health_small) /* handled in t_items.qc */ -//spawnfunc(item_health_mega) /* handled in t_items.qc */ +//spawnfunc(item_health_large) /* handled in items.qc */ +//spawnfunc(item_health_small) /* handled in items.qc */ +//spawnfunc(item_health_mega) /* handled in items.qc */ //spawnfunc(item_invis) /* handled by buffs mutator */ //spawnfunc(item_regen) /* handled by buffs mutator */ @@ -265,11 +300,13 @@ bool DoesQ3ARemoveThisEntity(entity this) gametypename = "team"; if(g_ctf) gametypename = "ctf"; + if(g_ctf && ctf_oneflag) + gametypename = "oneflag"; if(g_duel) gametypename = "tournament"; if(maxclients == 1) gametypename = "single"; - // we do not have the other types (oneflag, obelisk, harvester, teamtournament) + // we do not have the other types (obelisk, harvester, teamtournament) if(strstrofs(this.gametype, gametypename, 0) < 0) return true; }