]> git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/blobdiff - qcsrc/server/compat/quake3.qc
target_give: support shield and strength powerups
[xonotic/xonotic-data.pk3dir.git] / qcsrc / server / compat / quake3.qc
index b1db26e822f08ea860b067c8471a090012f94d1d..a68cc8a339c987a3822617b78b5458e900164531 100644 (file)
 */
 
 // SG -> MG || SG
-SPAWNFUNC_ITEM_COND(ammo_shells, (q3compat & BIT(0)), ITEM_Bullets, ITEM_Shells)
-SPAWNFUNC_WEAPON_COND(weapon_shotgun, (q3compat & BIT(0)), WEP_MACHINEGUN, WEP_SHOTGUN)
+SPAWNFUNC_ITEM_COND(ammo_shells, (q3compat & Q3COMPAT_ARENA), ITEM_Bullets, ITEM_Shells)
+SPAWNFUNC_WEAPON_COND(weapon_shotgun, (q3compat & Q3COMPAT_ARENA), WEP_MACHINEGUN, WEP_SHOTGUN)
 
 // MG -> SG || MG
-SPAWNFUNC_ITEM_COND(ammo_bullets, (q3compat & BIT(0)), ITEM_Shells, ITEM_Bullets)
+SPAWNFUNC_ITEM_COND(ammo_bullets, (q3compat & Q3COMPAT_ARENA), ITEM_Shells, ITEM_Bullets)
 
 // GL -> Mortar
 SPAWNFUNC_ITEM(ammo_grenades, ITEM_Rockets)
 
-// Team Arena Proximity Launcher -> Mine Layer
-SPAWNFUNC_WEAPON(weapon_prox_launcher, WEP_MINE_LAYER)
+// Team Arena Proximity Launcher -> Mortar
+// It's more accurate to spawn Mine Layer but players prefer Mortar, and weapon_grenadelauncher is usually disabled by "notta" and weapon_prox_launcher placed at the same origin
+SPAWNFUNC_WEAPON(weapon_prox_launcher, WEP_MORTAR)
 SPAWNFUNC_ITEM(ammo_mines, ITEM_Rockets)
 
 // Team Arena Chaingun -> HLAC
@@ -240,10 +241,18 @@ void target_give_init(entity this)
                        this.netname = cons(this.netname, buff.netname);
                        STAT(BUFF_TIME, this) = it.count;
                }
+               else if (it.classname == "item_shield") {
+                       this.invincible_finished = it.count;
+                       this.netname = cons(this.netname, "invincible");
+               }
+               else if (it.classname == "item_strength") {
+                       this.strength_finished = it.count;
+                       this.netname = cons(this.netname, "strength");
+               }
 
                //remove(it); // removing ents in init functions causes havoc, workaround:
-        setthink(it, SUB_Remove);
-        it.nextthink = time;
+               setthink(it, SUB_Remove);
+               it.nextthink = time;
        });
        this.spawnflags = 2;
        this.spawnfunc_checked = true;