function OnGameTick() for _, player in pairs(ents.GetAllPlayers()) do if player:IsValid() then if (player.m_iTeamNum ~= 1) then 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) else player:SetAttributeValue("healing received bonus", nil) player:SetAttributeValue("heal rate bonus", 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 ( provider:IsValid() ) 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 ( provider:IsValid() ) 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 ( provider:IsValid() ) 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 ) print( attr, player:GetPlayerName() ) 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 timer.Simple( 0.1, function() local attr = bot:GetAttributeValueByClass( "add_maxhealth", 0 ) print( attr, bot:GetPlayerName() ) if attr == 1 then bot.AntiSpy = true end end) end function OnPlayerConnected( player ) if player:IsRealPlayer() then player:AddCallback( ON_SPAWN, function( ent ) ent:SetAttributeValue( "max health additive bonus", nil ) end) end 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 ( 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