CEntity.HasAttribute = function(self, attribute) return ( self:GetAttributeValue( attribute, true ) ~= nil ) end function GetNumberOfBurning() local count = 0 for _, player in pairs(ents.GetAllPlayers()) do if IsValid( player ) and player:IsBot() and player:InCond(22) then count = count + 1 end end return count end function OnGameTick() PlayerLogic() --CleaverRechargeLogic() ScreenText() AdrenalineJunkie() RechargeBattery() ExplosiveGroundSlam() ApplyBotEffects() MineLayer() for _, player in pairs(ents.GetAllPlayers()) do if player:IsValid() then if (player.m_iTeamNum ~= 1) then if ( IsValidAlivePlayer( player ) ) then if not (tobool( player.m_bIsMiniBoss ) ) then player:SetAttributeValue("max health additive penalty", nil ) end if ( IsValid( player:GetPlayerItemBySlot(2) ) ) and ( player:HasAttribute("kill eater user 2" ) ) and ( player.m_iClass == TF_CLASS_SCOUT ) then player:GetPlayerItemBySlot(2):SetAttributeValue( "mark for death", 1 ) end if ( IsValid( player:GetPlayerItemBySlot(1) ) ) and ( IsValid( player:GetPlayerItemBySlot(0) ) ) and ( player:HasAttribute("kill eater user 2" ) ) and ( player.m_iClass == TF_CLASS_PYRO ) then player:GetPlayerItemBySlot(1):SetAttributeValue( "fire input on hit", "popscript^$StunCombo^" ) player:GetPlayerItemBySlot(0):SetAttributeValue( "airblast pushback scale", 2 ) end if ( IsValid( player:GetPlayerItemBySlot(2) ) ) and ( player:HasAttribute("kill eater user 2" ) ) and ( player.m_iClass == TF_CLASS_DEMOMAN ) then player:GetPlayerItemBySlot(2):SetAttributeValue( "critboost on kill", 2 ) end if ( IsValid( player:GetPlayerItemBySlot(1) ) ) and ( player:HasAttribute("kill eater user 2" ) ) and ( player.m_iClass == TF_CLASS_MEDIC ) then player:GetPlayerItemBySlot(1):SetAttributeValue( "medigun passive attributes", "CARD: Damage Bonus|1.15" ) end if ( IsValid( player:GetPlayerItemBySlot(1) ) ) and ( player:HasAttribute("kill eater user 3" ) ) and ( player.m_iClass == TF_CLASS_MEDIC ) then player:GetPlayerItemBySlot(1):SetAttributeValue( "uber duration bonus", 1.5 ) end if ( IsValid( player:GetPlayerItemBySlot(4) ) ) and ( player:HasAttribute("kill eater user 2" ) ) and ( player.m_iClass == TF_CLASS_SPY ) then player:GetPlayerItemBySlot(4):SetAttributeValue( "effect cond override", 12 ) player:GetPlayerItemBySlot(4):SetAttributeValue( "effect add attributes", "SET BONUS: move speed set bonus|1.3|fire rate bonus HIDDEN|0.6|reload time increased hidden|0.4" ) end if ( IsValid( player:GetPlayerItemBySlot(6) ) ) and ( player:HasAttribute("kill eater user 3" ) ) and ( player.m_iClass == TF_CLASS_SPY ) then player:GetPlayerItemBySlot(6):SetAttributeValue( "effect add attributes", "ignored by bots|1" ) end if ( player:HasAttribute("kill eater user score type 2" ) ) and ( player.m_iClass == TF_CLASS_PYRO ) then player:SetAttributeValue( "damage bonus HIDDEN", 1 + ( 0.15 * GetNumberOfBurning() ) ) end if ( player:HasAttribute("kill eater user score type 2" ) ) and ( player.m_iClass == TF_CLASS_MEDIC ) then player:SetAttributeValue( "revive rate", nil ) else player:SetAttributeValue( "revive rate", 0.0001 ) end end if ( IsValidAlivePlayer( player ) ) and ( IsValid( player:GetPlayerItemBySlot(1) ) ) and ( player:GetPlayerItemBySlot(1):GetItemName() == "Tri-Healer" ) then if player:InCond( TF_COND_MEDIGUN_UBER_BULLET_RESIST ) then player:AddCond( TF_COND_INVULNERABLE_CARD_EFFECT, 0.1, player ) end if player:InCond( TF_COND_MEDIGUN_UBER_BLAST_RESIST ) then player:AddCond( TF_COND_CRITBOOSTED_CARD_EFFECT, 0.1, player ) end if player:InCond( TF_COND_MEDIGUN_UBER_FIRE_RESIST ) then player:AddCond( TF_COND_HALLOWEEN_QUICK_HEAL, 0.1, player ) end if player:InCond( TF_COND_HALLOWEEN_QUICK_HEAL ) then player:SetAttributeValue("healing received bonus", 3) player:SetAttributeValue("heal rate bonus", 3) if player:GetTeam() == 2 then player:SetAttributeValue( "hud overlay", "effects/invuln_overlay_red" ) else player:SetAttributeValue( "hud overlay", "effects/invuln_overlay_blue" ) end else player:SetAttributeValue("healing received bonus", nil) player:SetAttributeValue("heal rate bonus", nil) player:SetAttributeValue("hud overlay", nil) end player:SetAttributeValue("uber duration bonus", -0.5) end if ( IsValidAlivePlayer( player ) ) then if ( player:InCond( TF_COND_MEDIGUN_UBER_BULLET_RESIST ) ) then local provider = player:GetConditionProvider( TF_COND_MEDIGUN_UBER_BULLET_RESIST ) if ( IsValid( provider ) ) and ( player ~= provider ) and ( IsValid( provider:GetPlayerItemBySlot(1) ) ) and ( provider:GetPlayerItemBySlot(1):GetItemName() == "Tri-Healer" ) then player:AddCond( TF_COND_INVULNERABLE_CARD_EFFECT, 0.1, provider ) end end if ( player:InCond( TF_COND_MEDIGUN_UBER_BLAST_RESIST ) ) then local provider = player:GetConditionProvider( TF_COND_MEDIGUN_UBER_BLAST_RESIST ) if ( IsValid( provider ) ) and ( player ~= provider ) and ( IsValid( provider:GetPlayerItemBySlot(1) ) ) and ( provider:GetPlayerItemBySlot(1):GetItemName() == "Tri-Healer" ) then player:AddCond( TF_COND_CRITBOOSTED_CARD_EFFECT, 0.1, provider ) end end if ( player:InCond( TF_COND_MEDIGUN_UBER_FIRE_RESIST ) ) then local provider = player:GetConditionProvider( TF_COND_MEDIGUN_UBER_FIRE_RESIST ) if ( IsValid( provider ) ) and ( player ~= provider ) and ( IsValid( provider:GetPlayerItemBySlot(1) ) ) and ( provider:GetPlayerItemBySlot(1):GetItemName() == "Tri-Healer" ) then player:AddCond( TF_COND_MEGAHEAL, 0.1, provider ) end end end if ( IsValidAlivePlayer( player ) ) and ( IsValid( player:GetPlayerItemBySlot(1) ) ) and ( player:GetPlayerItemBySlot(1):GetItemName() == "Cardiac Arrest" ) then player:GetPlayerItemBySlot(1):SetAttributeValue("reload time increased hidden", lerp( 0.33, 1, player.m_iHealth / player.m_iMaxHealth ) ) end if ( IsValidAlivePlayer( player ) ) and ( ( IsValid( player:GetPlayerItemBySlot(1) ) ) and ( not player:GetPlayerItemBySlot(1):GetItemName() == "Cardiac Arrest" ) ) then player:GetPlayerItemBySlot(1):SetAttributeValue("reload time increased hidden", nil ) end if ( IsValidAlivePlayer( player ) ) and ( ( IsValid( player:GetPlayerItemBySlot(1) ) ) and ( not player:GetPlayerItemBySlot(1):GetItemName() == "Tri-Healer" ) ) then player:SetAttributeValue("uber duration bonus", nil) end end if player:IsBot() then if player:InCond(71) and player.m_bIsMiniBoss == 1 then player:RemoveCond(71) end if player:InCond(43) and ( not player.Recoded ) then player:AcceptInput("$BotCommand","switch_action Mobber") player.Recoded = true elseif ( not player:InCond(43) ) and ( player.Recoded ) then player:AcceptInput("$BotCommand","switch_action Default") player.Recoded = false player:AddCond(71, 3) end if player.AntiSpy == true then if player.m_iTeamNum == 1 then player.AntiSpy = false; return end local attr = player:GetAttributeValueByClass( "add_maxhealth", 0 ) if attr == 0 then player:WeaponSwitchSlot(0) player:WeaponStripSlot(1) player.AntiSpy = false end end end end end end function DispShieldHurt( damage, activator, caller ) for _, building in pairs( ents.FindAllByClass("obj_dispenser") ) do if IsValid( building.m_hBuilder ) then local owner = building.m_hBuilder if ( owner:GetPlayerItemBySlot( LOADOUT_POSITION_PDA ):GetItemName() == "Shield Projector" ) and ( activator:GetTeam() ~= owner:GetTeam() ) then local dmg_info = { Attacker = activator, Damage = damage / 1 } building:TakeDamage( dmg_info ) end end end end function RepairAllBuildings( percent, activator, caller ) --activator is the one with the weapon for _, building in pairs( ents.FindAllByClass("obj_dispenser") ) do if IsValid( building.m_hBuilder ) then local owner = building.m_hBuilder if owner == activator then building:AcceptInput("AddHealth", ( building.m_iMaxHealth * ( percent / 100 ) ) ) end end end for _, building in pairs( ents.FindAllByClass("obj_teleporter") ) do if IsValid( building.m_hBuilder ) then local owner = building.m_hBuilder if owner == activator then building:AcceptInput("AddHealth", ( building.m_iMaxHealth * ( percent / 100 ) ) ) end end end for _, building in pairs( ents.FindAllByClass("obj_sentrygun") ) do if IsValid( building.m_hBuilder ) then local owner = building.m_hBuilder if owner == activator then building:AcceptInput("AddHealth", ( building.m_iMaxHealth * ( percent / 100 ) ) ) end end end end function OnWaveSpawnBot(bot, wave, tags) bot.Recoded = false bot.Infected = false bot.AntiSpy = false GiveCallbacks( bot, tags ) timer.Simple( 0.1, function() local attr = bot:GetAttributeValueByClass( "add_maxhealth", 0 ) if attr == 1 then bot.AntiSpy = true end end) end function OnPlayerConnected( player ) if player:IsBot() then SetUpCallBacks( player ) SetUpCallNetpropsBot( player ) end if player:IsRealPlayer() then SetUpPlayerCallBacks( player ) SetUpPlayerNetprops( player ) end SetUpSharedCallBacks( player ) end function AddHealth( health, activator, caller ) local attr = activator:GetAttributeValue( "max health additive bonus" ) or 0 activator:SetAttributeValue( "max health additive bonus", math.min( attr + health, 60 ) ) end function Recode(_, activator, caller) if ( activator:IsValid() ) and ( caller:IsValid() ) and ( IsValid(activator:GetPlayerItemBySlot(4)) ) then local AddTime = activator:GetPlayerItemBySlot(4):GetAttributeValue("robo sapper") if AddTime == nil then AddTime = 0 else AddTime = AddTime * 2 end if caller.m_bIsMiniBoss == 1 then caller:AddCond(43, 5 + ( AddTime * 0.5 )) else caller:AddCond(43, 10 + AddTime) end end end function InfectSapper( _, activator, caller ) --activator is the one with the weapon, caller is the one that got hit if ( activator:IsValid() ) and ( caller:IsValid() ) and ( IsValid(activator:GetPlayerItemBySlot(4)) ) then caller:PlaySound("weapons/breadmonster/gloves/bm_gloves_on.wav") caller:PlaySound("weapons/breadmonster/gloves/bm_gloves_on.wav") util.ParticleEffect( "breadjar_impact", caller:GetEyePos() ) util.ParticleEffect( "bread_gloves_goop", caller:GetEyePos() , caller:GetEyeAngles() ) Infect( nil, activator, caller ) end end function Infect( _, activator, caller ) --activator is the one with the weapon, caller is the one that got hit if ( activator:IsValid() ) and ( caller:IsValid() ) and ( caller:IsAlive() ) and ( caller.m_iTeamNum ~= 1 ) and ( IsValid(activator:GetPlayerItemBySlot(4)) ) and ( not caller.Infected ) then caller.Infected = true caller.Infector = activator util.ParticleEffect( "breadjar_impact", caller:GetEyePos() ) util.ParticleEffect( "bread_gloves_goop", caller:GetEyePos(), caller:GetEyeAngles() ) end end function OnPlayerDeath(player, attacker, weapon, dmgtype, assister, crit_type, silent_kill) if player and IsValidPlayer(player) and ( attacker and IsValidPlayer(attacker) ) and ( weapon ) then if crit_type == 1 and ( weapon == "back_scatter" ) then attacker.StoredCrits = math.min( attacker.StoredCrits + 1, 30 ) end end if ( player ) and ( player:IsValid() ) and ( player:IsBot() ) and ( player.Infected ) then player.Infected = false local Infector = player.Infector local Blast_Radius = 128 * ( Infector:GetPlayerItemBySlot(4):GetAttributeValueByClass("mult_explosion_radius", 1 ) ) local Blast_Damage = 40 * ( Infector:GetPlayerItemBySlot(4):GetAttributeValueByClass("mult_dmg", 1 ) ) local dmg_info = { Attacker = Infector, Damage = Blast_Damage, DamageType = DMG_BLAST, DamageCustom = TF_DMG_CUSTOM_SAPPER_RECORDER_DEATH } util.ParticleEffect( "mvm_loot_explosion", player:GetAbsOrigin() + Vector(0,0,64) ) util.ParticleEffect( "breadjar_impact", player:GetEyePos() + Vector(0,0,64) ) util.ParticleEffect( "bread_gloves_goop", player:GetEyePos() + Vector(0,0,64), player:GetEyeAngles() ) player:PlaySound("Weapon_Airstrike.Explosion") player:PlaySound("Weapon_Airstrike.Explosion") player:PlaySound("weapons/breadmonster/throwable/bm_throwable_smash.wav") for _, others in pairs( ents.FindInSphere( player:GetAbsOrigin(), Blast_Radius ) ) do if ( others:IsBot() ) and ( others:IsAlive() ) and ( others ~= player ) then others:TakeDamage( dmg_info ) Infect( nil, Infector, others ) end end end end function StunCombo(damage, activator, caller ) if IsValidPlayer( caller ) and IsValidPlayer( activator ) and caller:IsMidair() and ( caller ~= activator ) then if ( not tobool( caller.m_bIsMiniBoss )) then caller:StunPlayer( 3, 1, TF_STUNFLAGS_NORMALBONK, activator ) else caller:StunPlayer( 3, 0.65, TF_STUNFLAG_SLOWDOWN, activator ) end end end function CounterStun( damage, activator, caller ) if activator:IsRealPlayer() and caller:IsBot() and ( caller:GetPlayerName() == "Goobert" ) then caller:StunPlayer( 5.2, 1, TF_STUNFLAGS_BIGBONK, activator ) caller:AddCond( TF_COND_MARKEDFORDEATH, 6, activator ) timer.Simple( 2, function() util.ParticleEffect( "charge_up", caller:GetAbsOrigin() + Vector(0, 0, caller["m_vecViewOffset[2]"] / 2 ) ) end) timer.Simple( 6, function() caller:AddCond( 57, 6, activator ) caller:AddCond( 8, 6, activator ) caller:AddCond( TF_COND_RUNE_STRENGTH, 6, activator ) -- caller:ChangeAttributes("Enraged") caller:GetPlayerItemBySlot(1):SetAttributeValue( "mult projectile count", 4 ) caller:GetPlayerItemBySlot(1):SetAttributeValue( "projectile spread angle penalty", 10 ) caller:GetPlayerItemBySlot(1):SetAttributeValue( "projectile health", 150 ) caller:GetPlayerItemBySlot(1):SetAttributeValue( "fire input on hit", nil ) caller:GetPlayerItemBySlot(1):SetAttributeValue( "damage bonus", 2 ) caller:GetPlayerItemBySlot(1):SetAttributeValue( "fire rate penalty hidden", nil ) caller:GetPlayerItemBySlot(2):SetAttributeValue( "fire rate penalty hidden", nil ) timer.Simple(6, function() -- caller:ChangeAttributes("Defualt") caller:GetPlayerItemBySlot(1):SetAttributeValue( "mult projectile count", nil ) caller:GetPlayerItemBySlot(1):SetAttributeValue( "projectile spread angle penalty", nil ) caller:GetPlayerItemBySlot(1):SetAttributeValue( "projectile health", 50 ) caller:GetPlayerItemBySlot(1):SetAttributeValue( "fire input on hit", "popscript^$CounterStun^" ) caller:GetPlayerItemBySlot(1):SetAttributeValue( "damage bonus", 5 ) caller:GetPlayerItemBySlot(1):SetAttributeValue( "fire rate penalty hidden", 2 ) caller:GetPlayerItemBySlot(2):SetAttributeValue( "fire rate penalty hidden", 2 ) end) end) end if activator:IsRealPlayer() and caller:IsBot() and ( caller:GetPlayerName() == "Gooblet" ) then caller:StunPlayer( 5.2, 1, TF_STUNFLAGS_BIGBONK, activator ) caller:AddCond( TF_COND_MARKEDFORDEATH, 6, activator ) end end