X-Git-Url: https://de.git.xonotic.org/?a=blobdiff_plain;f=qcsrc%2Fcommon%2Fmutators%2Fmutator%2Foverkill%2Fsv_overkill.qc;h=e9106239467ffc7432cda21fa887481db192a6cc;hb=6e4c0c69ce16c05cdc8ce97c5287c848acfc3b1f;hp=120fabe569198b59b83a46f462b5024edc1b1805;hpb=1a02dfa42534cfd8697e6c4d0e1181e5ec6c1fc7;p=xonotic%2Fxonotic-data.pk3dir.git diff --git a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc index 120fabe56..e91062394 100644 --- a/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc +++ b/qcsrc/common/mutators/mutator/overkill/sv_overkill.qc @@ -17,6 +17,23 @@ REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !cvar("g_instagib") & { precache_all_playermodels("models/ok_player/*.dpm"); + if (autocvar_g_overkill_filter_healthmega) + { + ITEM_HealthMega.spawnflags |= ITEM_FLAG_MUTATORBLOCKED; + } + if (autocvar_g_overkill_filter_armormedium) + { + ITEM_ArmorMedium.spawnflags |= ITEM_FLAG_MUTATORBLOCKED; + } + if (autocvar_g_overkill_filter_armorbig) + { + ITEM_ArmorBig.spawnflags |= ITEM_FLAG_MUTATORBLOCKED; + } + if (autocvar_g_overkill_filter_armormega) + { + ITEM_ArmorMega.spawnflags |= ITEM_FLAG_MUTATORBLOCKED; + } + WEP_RPC.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED; WEP_HMG.spawnflags &= ~WEP_FLAG_MUTATORBLOCKED; @@ -27,6 +44,11 @@ REGISTER_MUTATOR(ok, expr_evaluate(autocvar_g_overkill) && !cvar("g_instagib") & MUTATOR_ONREMOVE { + ITEM_HealthMega.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED; + ITEM_ArmorMedium.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED; + ITEM_ArmorBig.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED; + ITEM_ArmorMega.spawnflags &= ~ITEM_FLAG_MUTATORBLOCKED; + WEP_RPC.spawnflags |= WEP_FLAG_MUTATORBLOCKED; WEP_HMG.spawnflags |= WEP_FLAG_MUTATORBLOCKED; } @@ -122,29 +144,18 @@ MUTATOR_HOOKFUNCTION(ok, PlayerPreThink) if(player.(weaponentity).m_weapon == WEP_Null && slot != 0) continue; - Weapon oldwep = player.(weaponentity).m_weapon; - player.(weaponentity).m_weapon = WEP_BLASTER; - W_Blaster_Attack( - player, - weaponentity, - WEP_BLASTER.m_id | HITTYPE_SECONDARY, - WEP_CVAR_SEC(vaporizer, shotangle), - WEP_CVAR_SEC(vaporizer, damage), - WEP_CVAR_SEC(vaporizer, edgedamage), - WEP_CVAR_SEC(vaporizer, radius), - WEP_CVAR_SEC(vaporizer, force), - WEP_CVAR_SEC(vaporizer, speed), - WEP_CVAR_SEC(vaporizer, spread), - WEP_CVAR_SEC(vaporizer, delay), - WEP_CVAR_SEC(vaporizer, lifetime) - ); - player.(weaponentity).m_weapon = oldwep; + BLASTER_SECONDARY_ATTACK(vaporizer, player, weaponentity); } } PHYS_INPUT_BUTTON_ATCK2(player) = false; } +MUTATOR_HOOKFUNCTION(ok, ForbidRandomStartWeapons) +{ + return true; +} + MUTATOR_HOOKFUNCTION(ok, PlayerWeaponSelect) { entity player = M_ARGV(0, entity); @@ -167,51 +178,6 @@ MUTATOR_HOOKFUNCTION(ok, PlayerWeaponSelect) } } -void self_spawnfunc_weapon_hmg(entity this) { spawnfunc_weapon_hmg(this); } -void self_spawnfunc_weapon_rpc(entity this) { spawnfunc_weapon_rpc(this); } - -MUTATOR_HOOKFUNCTION(ok, OnEntityPreSpawn) -{ - entity ent = M_ARGV(0, entity); - - if(autocvar_g_powerups) - if(autocvar_g_overkill_powerups_replace) - { - if(ent.classname == "item_strength") - { - entity wep = new(weapon_hmg); - setorigin(wep, ent.origin); - setmodel(wep, MDL_OK_HMG); - wep.ok_item = true; - wep.noalign = ent.noalign; - wep.cnt = ent.cnt; - wep.team = ent.team; - wep.respawntime = g_pickup_respawntime_superweapon; - wep.pickup_anyway = true; - wep.spawnfunc_checked = true; - setthink(wep, self_spawnfunc_weapon_hmg); - wep.nextthink = time + 0.1; - return true; - } - else if(ent.classname == "item_shield") - { - entity wep = new(weapon_rpc); - setorigin(wep, ent.origin); - setmodel(wep, MDL_OK_RPC); - wep.ok_item = true; - wep.noalign = ent.noalign; - wep.cnt = ent.cnt; - wep.team = ent.team; - wep.respawntime = g_pickup_respawntime_superweapon; - wep.pickup_anyway = true; - wep.spawnfunc_checked = true; - setthink(wep, self_spawnfunc_weapon_rpc); - wep.nextthink = time + 0.1; - return true; - } - } -} - bool ok_HandleItemWaypoints(entity e) { if(!autocvar_g_overkill_itemwaypoints) @@ -244,9 +210,10 @@ MUTATOR_HOOKFUNCTION(ok, FilterItem) { entity item = M_ARGV(0, entity); - if(item.ok_item) + if (item.ok_item) + { return false; - + } switch(item.itemdef) { case ITEM_HealthMega: return autocvar_g_overkill_filter_healthmega; @@ -254,7 +221,38 @@ MUTATOR_HOOKFUNCTION(ok, FilterItem) case ITEM_ArmorBig: return autocvar_g_overkill_filter_armorbig; case ITEM_ArmorMega: return autocvar_g_overkill_filter_armormega; } - + if (!autocvar_g_powerups || !autocvar_g_overkill_powerups_replace) + { + return true; + } + if (item.classname == "item_strength") + { + entity wep = new(weapon_hmg); + setorigin(wep, item.origin); + wep.ok_item = true; + wep.noalign = Item_ShouldKeepPosition(item); + wep.cnt = item.cnt; + wep.team = item.team; + wep.respawntime = g_pickup_respawntime_superweapon; + wep.pickup_anyway = true; + wep.spawnfunc_checked = true; + Item_Initialize(wep, "weapon_hmg"); + return true; + } + else if (item.classname == "item_shield") + { + entity wep = new(weapon_rpc); + setorigin(wep, item.origin); + wep.ok_item = true; + wep.noalign = Item_ShouldKeepPosition(item); + wep.cnt = item.cnt; + wep.team = item.team; + wep.respawntime = g_pickup_respawntime_superweapon; + wep.pickup_anyway = true; + wep.spawnfunc_checked = true; + Item_Initialize(wep, "weapon_rpc"); + return true; + } return true; }