]> git.rm.cloudns.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Classify arc and shockwave as "new toys"
authorbones_was_here <bones_was_here@xonotic.au>
Sun, 1 Sep 2024 04:35:28 +0000 (14:35 +1000)
committerbones_was_here <bones_was_here@xonotic.au>
Sun, 1 Sep 2024 12:58:57 +0000 (22:58 +1000)
These are very unfinished, some of the other "new toys" weapons are far
more polished. As with the others, they can be allowed to spawn as
placed with g_new_toys 1; g_new_toys_autoreplace 0.

Fixes item spawning and g_weaponarena all and all_available not
respecting WEP_FLAG_HIDDEN (g_warmup_allguns 1 did respect it).

Changes the pipeline hash because apparently bots have been using a
HIDDEN weapon due to g_weaponarena all in serverbench.cfg.

.gitlab-ci.yml
qcsrc/common/mutators/mutator/new_toys/sv_new_toys.qc
qcsrc/common/weapons/weapon/arc.qh
qcsrc/common/weapons/weapon/shockwave.qh
qcsrc/server/items/items.qc
qcsrc/server/weapons/spawning.qc
qcsrc/server/world.qc

index d96b58c55e4f71de6d2335ba10d1c94fb4f13af6..95476a8ccce2f7f7965f44bbf5bb5f9f50451f76 100644 (file)
@@ -36,7 +36,7 @@ test_compilation_units:
 test_sv_game:
   stage: test
   script:
-    - export EXPECT=28a49dd762a7a794f210eeadbbc37a8e
+    - export EXPECT=bbf98c6d16f911caaaa8a9db6bc2a779
     - qcsrc/tools/sv_game-hashtest.sh
     - exit $?
 
index c3e0083785692ef3bf8073b2eb1c1a6db1570b87..e2a5ea41a7717ebdc74828261f2ffdf752c83699 100644 (file)
@@ -123,6 +123,7 @@ bool nt_IsNewToy(int w)
                case WEP_HLAC.m_id:
                case WEP_RIFLE.m_id:
                case WEP_SHOCKWAVE.m_id:
+               case WEP_ARC.m_id:
                        return true;
                default:
                        return false;
index a7d289c079c7cce6484b71e06db3a192801a4c26..7932fd7d7273d5ec0a8ba9882d8db2ea7e33bc30 100644 (file)
@@ -4,7 +4,7 @@ CLASS(Arc, Weapon)
 /* spawnfunc */ ATTRIB(Arc, m_canonical_spawnfunc, string, "weapon_arc");
 /* ammotype  */ ATTRIB(Arc, ammo_type, Resource, RES_CELLS);
 /* impulse   */ ATTRIB(Arc, impulse, int, 3);
-/* flags     */ ATTRIB(Arc, spawnflags, int, WEP_TYPE_HITSCAN);
+/* flags     */ ATTRIB(Arc, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_TYPE_HITSCAN);
 /* rating    */ ATTRIB(Arc, bot_pickupbasevalue, float, 8000);
 /* color     */ ATTRIB(Arc, wpcolor, vector, '1 1 1');
 /* modelname */ ATTRIB(Arc, mdl, string, "arc");
index 76d3c3ef258a567b880ef445e60ba25d2e76c3a9..241187abc1e0ffe22453765d39f57828e6373c0d 100644 (file)
@@ -4,7 +4,7 @@ CLASS(Shockwave, Weapon)
 /* spawnfunc */ ATTRIB(Shockwave, m_canonical_spawnfunc, string, "weapon_shockwave");
 /* ammotype  */ //ATTRIB(Shockwave, ammo_type, Resource, RES_NONE);
 /* impulse   */ ATTRIB(Shockwave, impulse, int, 2);
-/* flags     */ ATTRIB(Shockwave, spawnflags, int, WEP_FLAG_HIDDEN | WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC);
+/* flags     */ ATTRIB(Shockwave, spawnflags, int, WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_TYPE_HITSCAN | WEP_FLAG_CANCLIMB | WEP_TYPE_MELEE_SEC);
 /* rating    */ ATTRIB(Shockwave, bot_pickupbasevalue, float, 3000);
 /* color     */ ATTRIB(Shockwave, wpcolor, vector, '0.5 0.25 0');
 /* modelname */ ATTRIB(Shockwave, mdl, string, "shotgun");
index 839f3ecc9d3ad4a95b9c40a2080700cb9fa9eee5..62d13fb27d1733f32ba7d79e1278edb5962b21ad 100644 (file)
@@ -1648,7 +1648,7 @@ float GiveItems(entity e, float beginarg, float endarg)
                                got += GiveResourceValue(e, RES_HEALTH, op, val);
                                got += GiveResourceValue(e, RES_ARMOR, op, val);
                        case "allweapons":
-                               FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK)), got += GiveWeapon(e, it.m_id, op, val));
+                               FOREACH(Weapons, it != WEP_Null && !(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK)), got += GiveWeapon(e, it.m_id, op, val));
                        //case "allbuffs": // all buffs makes a player god, do not want!
                                //FOREACH(StatusEffect, it.instanceOfBuff, got += GiveBuff(e, it, op, val));
                        case "allammo":
index e2a28f254ade99e3704d5b3880a113f8c3132b51..914b91966222ba995c8e05fcf511a358269b47f3 100644 (file)
@@ -33,7 +33,7 @@ void weapon_defaultspawnfunc(entity this, Weapon wpn)
        this.classname = wpn.m_canonical_spawnfunc;
        if (!ITEM_IS_LOOT(this) && !this.m_isreplaced)
        {
-               if (wpn.spawnflags & WEP_FLAG_MUTATORBLOCKED)
+               if (wpn.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN))
                {
                        //LOG_WARNF("Attempted to spawn a mutator-blocked weapon rejected: prvm_edict server %i", this);
                        startitem_failed = true;
index 930a3040cf008e1562958bf2ad6f4c3a2888d8ac..7f55d776076670964e8923d95b8773f23fbdb4ba 100644 (file)
@@ -1875,7 +1875,7 @@ WepSet weapons_all()
 {
        WepSet ret = '0 0 0';
        FOREACH(Weapons, it != WEP_Null, {
-               if (!(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_SPECIALATTACK)))
+               if (!(it.spawnflags & (WEP_FLAG_MUTATORBLOCKED | WEP_FLAG_HIDDEN | WEP_FLAG_SPECIALATTACK)))
                        ret |= it.m_wepset;
        });
        return ret;