local PIPEBLIMP_VALUES_TABLE = { PIPEBLIMP_MODEL = "models/bots/boss_bot/boss_blimp_pure.mdl" PIPEBLIMP_MODEL_DAMAGE1 = "models/bots/boss_bot/boss_blimp_main_damage1.mdl" PIPEBLIMP_MODEL_DAMAGE2 = "models/bots/boss_bot/boss_blimp_main_damage2.mdl" PIPEBLIMP_MODEL_DAMAGE3 = "models/bots/boss_bot/boss_blimp_main_damage3.mdl" PIPEBLIMP_TURRET_MODEL = "models/props_frontline/tank_turret.mdl" PIPEBLIMP_HELMET_MODEL = "models/workshop/player/items/demo/sum22_head_banger/sum22_head_banger.mdl" PIPEBLIMP_SND_SHOOT_CRIT = "weapons/loch_n_load_shoot_crit.wav" PIPEBLIMP_SND_SHOOT = "weapons/loch_n_load_shoot.wav" PIPEBLIMP_PROJECTILE_SPREAD = 4 PIPEBLIMP_PROJECTILE_SPLASH_RADIUS = 180 PIPEBLIMP_PROJECTILE_SPEED = 512 PIPEBLIMP_PROJECTILE_DAMAGE = 120 PIPEBLIMP_SKIN_RED = 0 PIPEBLIMP_SKIN_BLUE = 1 } foreach(k,v in PIPEBLIMP_VALUES_TABLE) if(!(k in TankExt.ValueOverrides)) ROOT[k] <- v PrecacheModel(PIPEBLIMP_MODEL) PrecacheModel(PIPEBLIMP_MODEL_DAMAGE1) PrecacheModel(PIPEBLIMP_MODEL_DAMAGE2) PrecacheModel(PIPEBLIMP_MODEL_DAMAGE3) PrecacheSound(PIPEBLIMP_SND_SHOOT) PrecacheSound(PIPEBLIMP_SND_SHOOT_CRIT) TankExt.NewTankScript("pipeblimp", { Model = { Default = PIPEBLIMP_MODEL_DEFAULT Damage1 = PIPEBLIMP_MODEL_DAMAGE1 Damage2 = PIPEBLIMP_MODEL_DAMAGE2 Damage3 = PIPEBLIMP_MODEL_DAMAGE3 } OnSpawn = function(hTank, sName, hPath) { local bBlueTeam = hTank.GetTeam() == 3 hTank.SetAbsAngles(QAngle(0, hTank.GetAbsAngles().y, 0)) hTank.SetSkin(hTank.GetTeam() == 3 ? PIPEBLIMP_SKIN_BLUE : PIPEBLIMP_SKIN_RED) for(local hChild = hTank.FirstMoveChild(); hChild != null; hChild = hChild.NextMovePeer()) hChild.DisableDraw() local hTank_scope = hTank.GetScriptScope() local flSpeed = GetPropFloat(hTank, "m_speed") local hModel1 = SpawnEntityFromTable("prop_dynamic", { origin = "60 -65 30", angles = "-25 0 -90", model = PIPEBLIMP_TURRET_MODEL, skin = bBlueTeam ? 2 : 0 }) local hModel2 = SpawnEntityFromTable("prop_dynamic", { origin = "60 65 30", angles = "-25 0 90", model = PIPEBLIMP_TURRET_MODEL, skin = bBlueTeam ? 2 : 0 }) local hModel3 = SpawnEntityFromTable("prop_dynamic", { origin = "-50 0 170", angles = "0 0 180", modelscale = "2.2", model = PIPEBLIMP_HELMET_MODEL, skin = 1 }) hTank_scope.hMimic1 <- SpawnEntityFromTable("tf_point_weapon_mimic", { origin = "168 -56 86", angles = "-58.5 359 180", damage = PIPEBLIMP_PROJECTILE_DAMAGE, modelscale = 1, speedmax = PIPEBLIMP_PROJECTILE_SPEED, speedmin = PIPEBLIMP_PROJECTILE_SPEED, splashradius = PIPEBLIMP_PROJECTILE_SPLASH_RADIUS, weapontype = 1, spreadangle = PIPEBLIMP_PROJECTILE_SPREAD }) hTank_scope.hMimic2 <- SpawnEntityFromTable("tf_point_weapon_mimic", { origin = "168 56 84", angles = "-56.5 359 0", damage = PIPEBLIMP_PROJECTILE_DAMAGE, modelscale = 1, speedmax = PIPEBLIMP_PROJECTILE_SPEED, speedmin = PIPEBLIMP_PROJECTILE_SPEED, splashradius = PIPEBLIMP_PROJECTILE_SPLASH_RADIUS, weapontype = 1, spreadangle = PIPEBLIMP_PROJECTILE_SPREAD }) TankExt.SetParentArray([hTank_scope.hMimic1, hTank_scope.hMimic2, hModel1, hModel2, hModel3], hTank) hTank_scope.hStickies <- [] hTank_scope.flTimeNext <- Time() hTank_scope.hTrackTrain <- SpawnEntityFromTable("func_tracktrain", { origin = hTank.GetOrigin() speed = flSpeed startspeed = flSpeed target = hPath.GetName() }) hTank_scope.flLastSpeed <- flSpeed hTank_scope.ShootStickies <- function(iStickyCount = 1, bCrit = false) { local sMultiple = iStickyCount > 1 ? "FireMultiple" : "FireOnce" local sStickyCount = iStickyCount.tostring() SetPropBool(hMimic1, "m_bCrits", bCrit) SetPropBool(hMimic2, "m_bCrits", bCrit) hMimic1.AcceptInput(sMultiple, sStickyCount, null, null) hMimic2.AcceptInput(sMultiple, sStickyCount, null, null) EmitSoundEx({ sound_name = bCrit ? PIPEBLIMP_SND_SHOOT_CRIT : PIPEBLIMP_SND_SHOOT entity = self filter_type = RECIPIENT_FILTER_GLOBAL sound_level = 82 }) } hTank_scope.PipeThink <- function() { foreach(i, hSticky in hStickies) if(!(hSticky && hSticky.IsValid())) hStickies.remove(i) local FindStickies = function(hMimic) { for(local hSticky; hSticky = FindByClassnameWithin(hSticky, "tf_projectile_pipe", hMimic.GetOrigin(), 32);) if(GetPropEntity(hSticky, "m_hThrower") == null && hSticky.GetOwner() == null) { hSticky.SetTeam(self.GetTeam()) hSticky.SetOwner(self) hStickies.append(hSticky) } } if(hMimic1 && hMimic1.IsValid()) FindStickies(hMimic1) if(hMimic2 && hMimic2.IsValid()) FindStickies(hMimic2) if(Time() >= flTimeNext) { flTimeNext += 7 EntFireByHandle(self, "CallScriptFunction", "ShootStickies", -1, null, null) EntFireByHandle(self, "CallScriptFunction", "ShootStickies", 0.1, null, null) EntFireByHandle(self, "CallScriptFunction", "ShootStickies", 0.2, null, null) EntFireByHandle(self, "CallScriptFunction", "ShootStickies", 0.3, null, null) EntFireByHandle(self, "CallScriptFunction", "ShootStickies", 0.4, null, null) EntFireByHandle(self, "RunScriptCode", "ShootStickies(4)", 0.5, null, null) EntFireByHandle(self, "CallScriptFunction", "ShootStickies", 0.6, null, null) EntFireByHandle(self, "CallScriptFunction", "ShootStickies", 0.7, null, null) EntFireByHandle(self, "CallScriptFunction", "ShootStickies", 0.8, null, null) EntFireByHandle(self, "CallScriptFunction", "ShootStickies", 0.9, null, null) EntFireByHandle(self, "RunScriptCode", "ShootStickies(4)", 1, null, null) EntFireByHandle(self, "RunScriptCode", "ShootStickies(1, true)", 1.5, null, null) EntFireByHandle(self, "RunScriptCode", "ShootStickies(2, true)", 2, null, null) EntFireByHandle(self, "RunScriptCode", "ShootStickies(3, true)", 2.5, null, null) EntFireByHandle(self, "RunScriptCode", "ShootStickies(6, true)", 3, null, null) } local vecTrackTrain = hTrackTrain.GetOrigin() self.SetAbsOrigin(vecTrackTrain) self.GetLocomotionInterface().Reset() local flSpeed = GetPropFloat(self, "m_speed") if(flSpeed == 0) flSpeed = 0.0001 if(flSpeed != flLastSpeed) { flLastSpeed = flSpeed SetPropFloat(hTrackTrain, "m_flSpeed", flSpeed) } return -1 } hTank_scope.Think <- function() { if(self.GetModelName() != PIPEBLIMP_MODEL) TankExt.SetTankModel(self, PIPEBLIMP_MODEL) local vecTrackTrain = hTrackTrain.GetOrigin() self.SetAbsOrigin(vecTrackTrain) self.GetLocomotionInterface().Reset() local flSpeed = GetPropFloat(self, "m_speed") if(flSpeed == 0) flSpeed = 0.001 if(flSpeed != flLastSpeed) { flLastSpeed = flSpeed SetPropFloat(hTrackTrain, "m_flSpeed", flSpeed) } return -1 } TankExt.AddThinkToEnt(hTank, "PipeThink") TankExt.AddThinkToEnt(hTank, "Think") } OnDeath = function() { if(hTrackTrain && hTrackTrain.IsValid()) hTrackTrain.Destroy() local hDestruction = FindByClassnameNearest("tank_destruction", self.GetOrigin(), 16) if(hDestruction && hDestruction.IsValid()) hDestruction.Destroy() } })