]> de.git.xonotic.org Git - xonotic/xonotic-data.pk3dir.git/commitdiff
Merge branch 'master' into martin-t/AMMO
authorMartin Taibr <taibr.martin@gmail.com>
Sun, 1 Sep 2019 14:03:14 +0000 (16:03 +0200)
committerMartin Taibr <taibr.martin@gmail.com>
Sun, 1 Sep 2019 14:03:14 +0000 (16:03 +0200)
13 files changed:
qcsrc/common/gamemodes/gamemode/clanarena/sv_clanarena.qc
qcsrc/common/gamemodes/gamemode/freezetag/sv_freezetag.qc
qcsrc/common/gamemodes/gamemode/lms/sv_lms.qc
qcsrc/common/items/item.qh
qcsrc/common/mutators/mutator/buffs/sv_buffs.qc
qcsrc/common/mutators/mutator/overkill/sv_overkill.qc
qcsrc/common/t_items.qc
qcsrc/common/weapons/weapon/seeker.qc
qcsrc/server/miscfunctions.qc
qcsrc/server/tests.qc
ruleset-XDF.cfg
ruleset-overkill.cfg
xonotic-server.cfg

index 4721cb38015ea7cb4ea306accd3f3389eaa14d14..c966e16d8059954fdd80058ed17d72e2edcac1d1 100644 (file)
@@ -333,7 +333,7 @@ MUTATOR_HOOKFUNCTION(ca, GiveFragsForKill, CBC_ORDER_FIRST)
 
 MUTATOR_HOOKFUNCTION(ca, SetStartItems)
 {
-       start_items       &= ~IT_UNLIMITED_AMMO;
+       start_items       &= ~IT_UNLIMITED_BOTH;
        start_health       = warmup_start_health       = cvar("g_lms_start_health");
        start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
        start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
index b1feaa9917c2cb913ce91f9465f795d6f40305ab..ed0209a7a7bf6a284dbedcdafe14093614ea055b 100644 (file)
@@ -549,7 +549,7 @@ MUTATOR_HOOKFUNCTION(ft, PlayerPreThink, CBC_ORDER_FIRST)
 
 MUTATOR_HOOKFUNCTION(ft, SetStartItems)
 {
-       start_items &= ~IT_UNLIMITED_AMMO;
+       start_items &= ~IT_UNLIMITED_BOTH;
        //start_health       = warmup_start_health       = cvar("g_lms_start_health");
        //start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
        start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
index bd6401d172931ea66eb07776258bc26258e8c1ca..6df1cb130943fe927f84f44a9670ce534015c316 100644 (file)
@@ -323,7 +323,7 @@ MUTATOR_HOOKFUNCTION(lms, GiveFragsForKill)
 
 MUTATOR_HOOKFUNCTION(lms, SetStartItems)
 {
-       start_items &= ~IT_UNLIMITED_AMMO;
+       start_items &= ~IT_UNLIMITED_BOTH;
        start_health       = warmup_start_health       = cvar("g_lms_start_health");
        start_armorvalue   = warmup_start_armorvalue   = cvar("g_lms_start_armor");
        start_ammo_shells  = warmup_start_ammo_shells  = cvar("g_lms_start_ammo_shells");
index cf4e288ba6cd1769c127ef9ca27ab16ca8411579..1f01790d24b26ea6609705ea4c07031aad7207e5 100644 (file)
@@ -44,8 +44,8 @@ const int IT_SUPERWEAPON                              = BIT(21); // suit
 const int IT_STRENGTH                                  = BIT(22);
 
 // item masks
-const int IT_UNLIMITED_AMMO                    = IT_UNLIMITED_WEAPON_AMMO | IT_UNLIMITED_SUPERWEAPONS;
-const int IT_PICKUPMASK                        = IT_UNLIMITED_AMMO | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
+const int IT_UNLIMITED_BOTH                    = IT_UNLIMITED_WEAPON_AMMO | IT_UNLIMITED_SUPERWEAPONS;
+const int IT_PICKUPMASK                        = IT_UNLIMITED_BOTH | IT_JETPACK | IT_FUEL_REGEN; // strength and invincible are handled separately
 
 #ifdef SVQC
 const .float strength_finished = _STAT(STRENGTH_FINISHED);
index 97df48106dcbc935fa4e38c0720f42b8cc3a0854..d25c3151f7edac55ee34808e30763b2f8fed6f27 100644 (file)
@@ -212,7 +212,7 @@ float buff_Available(entity buff)
 {
        if (buff == BUFF_Null)
                return false;
-       if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_WEAPON_AMMO) || (start_items & IT_UNLIMITED_AMMO) || (cvar("g_melee_only"))))
+       if (buff == BUFF_AMMO && ((start_items & IT_UNLIMITED_WEAPON_AMMO) || (start_items & IT_UNLIMITED_BOTH) || (cvar("g_melee_only"))))
                return false;
        if (buff == BUFF_VAMPIRE && cvar("g_vampire"))
                return false;
index cb9aea5cc3b3d69206e3cec18587f83a40bdb09e..dbcda2d59e1db202a53f5d33cb5a4419609b2731 100644 (file)
@@ -274,6 +274,10 @@ MUTATOR_HOOKFUNCTION(ok, SetStartItems, CBC_ORDER_LAST)
        if(WEP_OVERKILL_RPC.weaponstart > 0) { ok_start_items |= WEPSET(OVERKILL_RPC); }
        if(WEP_OVERKILL_HMG.weaponstart > 0) { ok_start_items |= WEPSET(OVERKILL_HMG); }
 
+       // this gives unlimited ammo (the 4 types) but not fuel
+       // using `g_use_ammunition` instead gives also fuel which is unnecessary and distracting in the HUD
+       start_items |= IT_UNLIMITED_WEAPON_AMMO;
+
        start_weapons = warmup_start_weapons = ok_start_items;
 }
 
index a5786888c18169abdfb93a44200b9383feab5a8d..663f14be89fd68a01422aa7416a6d7651eded7d8 100644 (file)
@@ -1497,7 +1497,7 @@ spawnfunc(target_items)
        {
                for(int j = 0; j < n; ++j)
                {
-                       if     (argv(j) == "unlimited_ammo")         this.items |= IT_UNLIMITED_AMMO;
+                       if     (argv(j) == "unlimited_ammo")         this.items |= IT_UNLIMITED_BOTH;
                        else if(argv(j) == "unlimited_weapon_ammo")  this.items |= IT_UNLIMITED_WEAPON_AMMO;
                        else if(argv(j) == "unlimited_superweapons") this.items |= IT_UNLIMITED_SUPERWEAPONS;
                        else if(argv(j) == "strength")               this.items |= ITEM_Strength.m_itemid;
@@ -1763,7 +1763,7 @@ float GiveItems(entity e, float beginarg, float endarg)
                                got += GiveValue(e, strength_finished, op, val);
                                got += GiveValue(e, invincible_finished, op, val);
                                got += GiveValue(e, superweapons_finished, op, val);
-                               got += GiveBit(e, items, IT_UNLIMITED_AMMO, op, val);
+                               got += GiveBit(e, items, IT_UNLIMITED_BOTH, op, val);
                        case "all":
                                got += GiveBit(e, items, ITEM_Jetpack.m_itemid, op, val);
                                got += GiveResourceValue(e, RES_HEALTH, op, val);
@@ -1781,7 +1781,7 @@ float GiveItems(entity e, float beginarg, float endarg)
                                got += GiveResourceValue(e, RES_FUEL, op, val);
                                break;
                        case "unlimited_ammo":
-                               got += GiveBit(e, items, IT_UNLIMITED_AMMO, op, val);
+                               got += GiveBit(e, items, IT_UNLIMITED_BOTH, op, val);
                                break;
                        case "unlimited_weapon_ammo":
                                got += GiveBit(e, items, IT_UNLIMITED_WEAPON_AMMO, op, val);
index f8c2be1d50777e1cea209366fe830aee87381009..648535eac08e29d216ab8d242a75faf3cd51edce 100644 (file)
@@ -348,7 +348,7 @@ void W_Seeker_Vollycontroller_Think(entity this) // TODO: Merge this with W_Seek
 
        Weapon thiswep = WEP_SEEKER;
        .entity weaponentity = this.weaponentity_fld;
-       if((!(this.realowner.items & IT_UNLIMITED_AMMO) && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(seeker, missile_ammo)) || (this.cnt <= -1) || (IS_DEAD(this.realowner)) || (this.realowner.(weaponentity).m_switchweapon != thiswep))
+       if((!(this.realowner.items & IT_UNLIMITED_BOTH) && GetResource(this.realowner, thiswep.ammo_type) < WEP_CVAR(seeker, missile_ammo)) || (this.cnt <= -1) || (IS_DEAD(this.realowner)) || (this.realowner.(weaponentity).m_switchweapon != thiswep))
        {
                delete(this);
                return;
index 4cc848b67342e53181701fe6b06f1463d9319db3..c82f076d39531003262d0671667806ccc29ef88c 100644 (file)
@@ -715,7 +715,7 @@ void readplayerstartcvars()
        {
                g_weapon_stay = 0; // incompatible
                start_weapons = g_weaponarena_weapons;
-               start_items |= IT_UNLIMITED_AMMO;
+               start_items |= IT_UNLIMITED_BOTH;
        }
        else
        {
@@ -735,7 +735,7 @@ void readplayerstartcvars()
                start_items |= IT_UNLIMITED_SUPERWEAPONS;
 
        if(!cvar("g_use_ammunition"))
-               start_items |= IT_UNLIMITED_AMMO;
+               start_items |= IT_UNLIMITED_WEAPON_AMMO;
 
        if(start_items & IT_UNLIMITED_WEAPON_AMMO)
        {
index 2f7dc88ba1436fffc693778aba98ddcdfad4100e..d4562dfc22af1ca9397d71b31dd2fb86d536208f 100644 (file)
@@ -23,7 +23,7 @@ TEST(Weapons, Hurt)
 
     it = a;
     PHYS_INPUT_BUTTON_ATCK(it) = true;
-    it.items |= IT_UNLIMITED_AMMO;
+    it.items |= IT_UNLIMITED_BOTH;
     Weapon wep = WEP_VORTEX;
     W_GiveWeapon(it, wep.m_id);
     W_SwitchWeapon_Force(it, wep, weaponentities[0]);
index a0cc24b7b991b2f32c025e75591c20e5f5f75e4d..843347eca90813878a3501a4b53a5cf5260742c3 100644 (file)
@@ -15,8 +15,8 @@ g_forced_respawn 1
 g_powerups 0  // set to -1 or patch xonotic
 g_spawnpoints_auto_move_out_of_solid 1
 g_start_delay 3
-g_use_ammunition 0 "if set to 0 all weapons have unlimited ammunition"
-g_weapon_stay 1 "1: ghost weapons can be picked up too but give no ammo, 2: ghost weapons refill ammo to one pickup size, thrown guns have no ammo"
+g_use_ammunition 0
+g_weapon_stay 1
 teamplay_mode 2 // friendly fire and self damage
 sv_vote_nospectators 1
 timelimit_override 20
index 28b3d90a5298cd967a2b766358ee2d0f41e9d763..5b71bb60a0576d40959a59b0a91d7e3404dc61f4 100644 (file)
@@ -10,8 +10,6 @@ if_dedicated exec help-overkill.cfg
 
 g_overkill 1
 
-g_use_ammunition 0
-
 // hack - eventually, we should be able to choose overkill models in menu like for vanilla
 sv_defaultcharacter 1
 sv_defaultplayermodel "models/ok_player/okrobot1.dpm models/ok_player/okrobot2.dpm models/ok_player/okrobot3.dpm models/ok_player/okrobot4.dpm models/ok_player/okmale1.dpm models/ok_player/okmale2.dpm models/ok_player/okmale3.dpm models/ok_player/okmale4.dpm"
index 158b32ecd597d837df4224d0dff3f96b29fa9515..59a455b6a3cf20d4dcce8282c5c2f3de34fd3942 100644 (file)
@@ -190,7 +190,7 @@ set g_pinata 0 "if set to 1 you will not only drop your current weapon when you
 set g_weapon_stay 0 "1: ghost weapons can be picked up too but give no ammo, 2: ghost weapons refill ammo to one pickup size, thrown guns have no ammo"
 set g_weapon_throwable 1 "if set to 1, weapons can be dropped"
 set g_powerups -1 "if set to 0 the strength and shield (invincibility) will not spawn on the map, if 1 they will spawn in all game modes, -1 is game mode default"
-set g_use_ammunition 1 "if set to 0 all weapons have unlimited ammunition"
+set g_use_ammunition 1 "if set to 0 all weapons have unlimited ammo"
 set g_pickup_items -1 "if set to 0 all items (health, armor, ammo, weapons...) are removed from the map, if 1 they are forced to spawn"
 set g_pickup_respawntime_scaling_reciprocal 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `reciprocal` (with `offset` and `linear` set to 0) can be used to achieve a constant number of items spawned *per player*"
 set g_pickup_respawntime_scaling_offset 0 "Multiply respawn time by `reciprocal / (p + offset) + linear` where `p` is the current number of players, takes effect with 2 or more players present, `offset` offsets the curve left or right - the results are not intuitive and I recommend plotting the respawn time and the number of items per player to see what's happening"