@@ -0,0 +1,140 @@
Script.Load("lua/InfestationMixin.lua")


local networkVars =

{

lastCheck = "time",
bonusHeal = "integer (0 to 30)",

}

AddMixinNetworkVars(InfestationMixin, networkVars)

local originit = Crag.OnInitialized
function Crag:OnInitialized()
originit(self)
InitMixin(self, InfestationMixin)
self.lastCheck = 0



if GetConductor():GetIsPhaseFourBoolean() then
self.bonusHeal = 30
elseif GetConductor():GetIsPhaseThreeBoolean() then
self.bonusHeal = 20
elseif GetConductor():GetIsPhaseTwoBoolean() then
self.bonusHeal = 10
else
self.bonusHeal = 1
end

end

function Crag:GetInfestationRadius()
if GetConductor():GetIsPhaseTwoBoolean() then
return kInfestationRadius
elseif GetConductor():GetIsPhaseOneBoolean() then
return kInfestationRadius/3
else
return kInfestationRadius /4
end
end



function Crag:GetMinRangeAC()
return 14/5
end




function Crag:GetCragsInRange()
local crag = GetEntitiesWithinRange("Crag", self:GetOrigin(), Crag.kHealRadius)
return Clamp(#crag - 1, 0.1, 10)
end


function Crag:GetBonusAmt()
return (self:GetCragsInRange()/10)
end


function Crag:GetUnitNameOverride(viewer) --Triggerhappy stoner
local unitName = GetDisplayName(self)
--unitName = string.format(Locale.ResolveString("Crag (+%sS 0%)"), self:GetCragsInRange()) --, self:GetBonusAmt() )
unitName = "Crag (+"..self.bonusHeal.."% heal)" --, self:GetBonusAmt() )
return unitName
end


function Crag:TryHeal(target)

local unclampedHeal = target:GetMaxHealth() * Crag.kHealPercentage
local heal = Clamp(unclampedHeal, Crag.kMinHeal, Crag.kMaxHeal)

if self.healWaveActive then
heal = heal * Crag.kHealWaveMultiplier
end

--heal = heal * self:GetCragsInRange()/3 + heal
if self:GetCragsInRange() >= 1 then
heal = heal * (self.bonusHeal/100) + heal
end

-- if self:GetIsSiege() and self:IsInRangeOfHive() and target:isa("Hive") or target:isa("Crag") then
-- heal = heal * kCragSiegeBonus
-- end

if target:GetHealthScalar() ~= 1 and (not target.timeLastCragHeal or target.timeLastCragHeal + Crag.kHealInterval <= Shared.GetTime()) then
local amountHealed = target:AddHealth(heal)
target.timeLastCragHeal = Shared.GetTime()

return amountHealed
else
return 0
end

end



/*

function Crag:OnUpdate(deltaTime)
if GetIsTimeUp(self.lastCheck, 4) then
local bonus = ( self:GetCragsInRange()/10)
Crag.kHealRadius = 14 * bonus + 14
Print("Crag.kHealRadius is %s", Crag.kHealRadius)
Crag.kHealAmount = 10 * bonus + 10
Print("Crag.kHealAmount is %s", Crag.kHealRadius)
Crag.kHealWaveAmount = 50 * bonus + 50
Print("Crag.kHealWaveAmount is %s", Crag.kHealRadius)
Crag.kMaxTargets = 3 * bonus + 3
Print("Crag.kMaxTargets is %s", Crag.kHealRadius)
-- Crag.kThinkInterval = .25
-- Crag.kHealInterval = 2
-- Crag.kHealEffectInterval = 1
-- Crag.kHealWaveDuration = 8
Crag.kHealPercentage = 0.06 * bonus + 0.06
Print("Crag.kHealPercentage is %s", Crag.kHealRadius)
Crag.kMinHeal = 10 * bonus + 10
Print("Crag.kMinHeal is %s", Crag.kHealRadius)
Crag.kMaxHeal = 60 * bonus + 60
Print("Crag.kMaxHeal is %s", Crag.kHealRadius)
Crag.kHealWaveMultiplier = 1.3 * bonus + 1.3
Print("Crag.kHealWaveMultiplier is %s", Crag.kHealRadius)
self.lastCheck = Shared.GetTime()
end

end

*/




Shared.LinkClassToMap("Crag", Crag.kMapName, networkVars)

@@ -0,0 +1,20 @@
if Server then
function Cyst:GetIsActuallyConnected()
return true
end
end


function Cyst:GetInfestationRadius()
return math.max(kInfestationRadius, kCystRedeployRange)
end

function Cyst:GetCystParentRange()
return 999
end
function Cyst:GetCanAutoBuild()

return true

end

@@ -0,0 +1,244 @@
--All this just to make drifters stack, rediculous.
local kDetectInterval = 0.5
local kDetectRange = 1.5
local kDrifterConstructSound = PrecacheAsset("sound/NS2.fev/alien/drifter/drift")
Drifter.kOrdered2DSoundName = PrecacheAsset("sound/NS2.fev/alien/drifter/ordered_2d")
Drifter.kOrdered3DSoundName = PrecacheAsset("sound/NS2.fev/alien/drifter/ordered")
local function ScanForNearbyEnemy(self)

-- Check for nearby enemy units. Uncloak if we find any.
self.lastDetectedTime = self.lastDetectedTime or 0
if self.lastDetectedTime + kDetectInterval < Shared.GetTime() then

if #GetEntitiesForTeamWithinRange("Player", GetEnemyTeamNumber(self:GetTeamNumber()), self:GetOrigin(), kDetectRange) > 0 then

self:TriggerUncloak()

end
self.lastDetectedTime = Shared.GetTime()

end

end

local kDrifterSelfOrderRange = 12

local function IsBeingGrown(self, target)

if target.hasDrifterEnzyme then
return true
end

for _, drifter in ipairs(GetEntitiesForTeam("Drifter", target:GetTeamNumber())) do

if self ~= drifter then

local order = drifter:GetCurrentOrder()
if order and order:GetType() == kTechId.Grow then

local growTarget = Shared.GetEntity(order:GetParam())
if growTarget == target then
return true
end

end

end

end

return false

end
local function FindTask(self)

-- find ungrown structures
for _, structure in ipairs(GetEntitiesWithMixinForTeamWithinRange("Construct", self:GetTeamNumber(), self:GetOrigin(), kDrifterSelfOrderRange)) do

if not structure:GetIsBuilt() and (not structure.GetCanAutoBuild or structure:GetCanAutoBuild()) then

self:GiveOrder(kTechId.Grow, structure:GetId(), structure:GetOrigin(), nil, false, false)

return

end

end

end


local function UpdateTasks(self, deltaTime)

if not self:GetIsAlive() then
return
end

local currentOrder = self:GetCurrentOrder()
if currentOrder ~= nil then

local maxSpeedTable = { maxSpeed = Drifter.kMoveSpeed }
self:ModifyMaxSpeed(maxSpeedTable)
local drifterMoveSpeed = maxSpeedTable.maxSpeed

local currentOrigin = Vector(self:GetOrigin())

if currentOrder:GetType() == kTechId.Move or currentOrder:GetType() == kTechId.Patrol then
self:ProcessMoveOrder(drifterMoveSpeed, deltaTime)
elseif currentOrder:GetType() == kTechId.Follow then
self:ProcessFollowOrder(drifterMoveSpeed, deltaTime)
elseif currentOrder:GetType() == kTechId.EnzymeCloud or currentOrder:GetType() == kTechId.Hallucinate or currentOrder:GetType() == kTechId.MucousMembrane or currentOrder:GetType() == kTechId.Storm then
self:ProcessEnzymeOrder(drifterMoveSpeed, deltaTime)
elseif currentOrder:GetType() == kTechId.Grow then
self:ProcessGrowOrder(drifterMoveSpeed, deltaTime)
end

-- Check difference in location to set moveSpeed
local distanceMoved = (self:GetOrigin() - currentOrigin):GetLength()

self.moveSpeed = (distanceMoved / drifterMoveSpeed) / deltaTime

else

if not self.timeLastTaskCheck or self.timeLastTaskCheck + 2 < Shared.GetTime() then

FindTask(self)
self.timeLastTaskCheck = Shared.GetTime()

end

end

end
function Drifter:OnUpdate(deltaTime)

ScriptActor.OnUpdate(self, deltaTime)

-- Blend smoothly towards target value
self.moveSpeedParam = Clamp(Slerp(self.moveSpeedParam, self.moveSpeed, deltaTime), 0, 1)
--UpdateMoveYaw(self, deltaTime)

if Server then

self.constructing = false
UpdateTasks(self, deltaTime)

ScanForNearbyEnemy(self)

self.camouflaged = (not self:GetHasOrder() or self:GetCurrentOrder():GetType() == kTechId.HoldPosition ) and not self:GetIsInCombat()
--[[
self.hasCamouflage = GetHasTech(self, kTechId.ShadeHive) == true
self.hasCelerity = GetHasTech(self, kTechId.ShiftHive) == true
self.hasRegeneration = GetHasTech(self, kTechId.CragHive) == true
--]]
--if self.hasRegeneration then

if self:GetIsHealable() and ( not self.timeLastAlienAutoHeal or self.timeLastAlienAutoHeal + kAlienRegenerationTime <= Shared.GetTime() ) then

self:AddHealth(0.06 * self:GetMaxHealth())
self.timeLastAlienAutoHeal = Shared.GetTime()

end

--end

self.canUseAbilities = self.timeAbilityUsed + kDrifterAbilityCooldown < Shared.GetTime()

elseif Client then

self.trailCinematic:SetIsVisible(self:GetIsMoving() and self:GetIsVisible())

if self.constructing and not self.playingConstructSound then

Shared.PlaySound(self, kDrifterConstructSound)
self.playingConstructSound = true

elseif not self.constructing and self.playingConstructSound then

Shared.StopSound(self, kDrifterConstructSound)
self.playingConstructSound = false

end

end

end
local function PlayOrderedSounds(self)

StartSoundEffectOnEntity(Drifter.kOrdered3DSoundName, self)

local commanders = GetEntitiesForTeam("Commander", self:GetTeamNumber())
local currentComm = commanders and commanders[1] or nil

if currentComm then
Server.PlayPrivateSound(currentComm, Drifter.kOrdered2DSoundName, currentComm, 1.0, Vector(0, 0, 0))
end

end
function Drifter:OnOverrideOrder(order)

local orderTarget = nil

if order:GetParam() ~= nil then
orderTarget = Shared.GetEntity(order:GetParam())
end

local orderType = order:GetType()

if orderType == kTechId.Default or orderType == kTechId.Grow or orderType == kTechId.Move then

if orderTarget and HasMixin(orderTarget, "Construct") and not orderTarget:GetIsBuilt() and GetAreFriends(self, orderTarget) and (not orderTarget.GetCanAutoBuild or orderTarget:GetCanAutoBuild()) then
order:SetType(kTechId.Grow)
elseif orderTarget and orderTarget:isa("Alien") and orderTarget:GetIsAlive() then
order:SetType(kTechId.Follow)
else
order:SetType(kTechId.Move)
end

end

if GetAreEnemies(self, orderTarget) then
order.orderParam = -1
end

PlayOrderedSounds(self)

end
function Drifter:ProcessGrowOrder(moveSpeed, deltaTime)

local currentOrder = self:GetCurrentOrder()

if currentOrder ~= nil then

local target = Shared.GetEntity(currentOrder:GetParam())

if not target or target:GetIsBuilt() or not target:GetIsAlive() then
self:CompletedCurrentOrder()
else

local targetPos = target:GetOrigin()
local toTarget = targetPos - self:GetOrigin()
-- Continuously turn towards the target. But don't mess with path finding movement if it was done.

if (toTarget):GetLength() > 3 then
self:MoveToTarget(PhysicsMask.AIMovement, targetPos, moveSpeed, deltaTime)
else

if toTarget then
self:SmoothTurn(deltaTime, GetNormalizedVector(toTarget), 0)
end
local speed = 0.025
-- if target:isa("Hive") then
-- speed = speed / 4
-- end
if IsBeingGrown(self, target) then target:Construct(speed) end
target:RefreshDrifterConstruct()
self.constructing = true
end

end

end

end
--Shared.LinkClassToMap("Drifter", Drifter.kMapName, networkVars)
@@ -0,0 +1,72 @@
if Server then


local orig_Egg_OnResearchComplete = Egg.OnResearchComplete
function Egg:OnResearchComplete(researchId)
self:AddTimedCallback(Egg.ResearchSpecifics, 4 )
return orig_Egg_OnResearchComplete(self, researchId)
end

local origInit = Egg.OnInitialized
function Egg:OnInitialized()
origInit(self)
self:AddTimedCallback(Egg.ResearchSpecifics, 8 )
end

function Egg:GetClassToGestate()
return self:GetMapNameOf()
end

function Egg:GetMapNameOf()
local techId = self:GetTechId()
local mapanme = LookupTechData(self:GetGestateTechId(), kTechDataMapName, Skulk.kMapName)
--Print("mapanme is %s", mapanme)

if techId == kTechId.GorgeEgg then
-- Print("GorgeEgg")
return Gorge.kMapName
elseif techId == kTechId.LerkEgg then
-- Print("LerkEgg")
return Lerk.kMapName
elseif techId == kTechId.FadeEgg then
-- Print("FadeEgg")
return Fade.kMapName
elseif techId == kTechId.OnosEgg then
-- Print("OnosEgg")
return Onos.kMapName
end
return Skulk.kMapName
end

function Egg:ResearchSpecifics()

local techIds = {}
local tree = GetTechTree(2)

if self:GetTechId() == kTechId.Egg then
table.insert(techIds, kTechId.GorgeEgg )
elseif self:GetTechId() == kTechId.GorgeEgg then
table.insert(techIds, kTechId.LerkEgg )
elseif self:GetTechId() == kTechId.LerkEgg then --and GetHasTech(self, kTechId.BioMassNine) then
table.insert(techIds, kTechId.FadeEgg )
elseif self:GetTechId() == kTechId.FadeEgg then -- and GetHasTech(self, kTechId.BioMassNine) then
table.insert(techIds, kTechId.OnosEgg )
end

local random = table.random(techIds)
local techNode = tree:GetTechNode(random)

if techNode then
if GetConductor():GetIsPhaseTwoBoolean() then
self:UpgradeToTechId(random)
else
self:SetResearching(techNode, self)
end
self.Auto = false
end


return false
end

end
@@ -0,0 +1,4 @@
function Embryo:GetGestationTime(gestationTypeTechId)
local orig = LookupTechData(gestationTypeTechId, kTechDataGestateTime)
return ConditionalValue( GetConductor():GetIsPhaseTwoBoolean(),orig/2, orig)
end
@@ -0,0 +1,62 @@
if Server then


function Exosuit:OnUseDeferred()
-- Print("Derp")
local player = self.useRecipient
self.useRecipient = nil

if player and not player:GetIsDestroyed() and self:GetIsValidRecipient(player) then

local weapons = player:GetWeapons()
for i = 1, #weapons do
weapons[i]:SetParent(nil)
end

local exoPlayer = nil

if self.layout == "MinigunMinigun" then
exoPlayer = player:GiveDualExo()
elseif self.layout == "RailgunRailgun" then
exoPlayer = player:GiveDualRailgunExo()
elseif self.layout == "ClawRailgun" then
exoPlayer = player:GiveClawRailgunExo()
elseif self.layout == "WelderWelder" then
exoPlayer = player:GiveDualWelder()
elseif self.layout == "FlamerFlamer" then
exoPlayer = player:GiveDualFlamer()
elseif self.layout == "WelderFlamer" then
exoPlayer = player:GiveWelderFlamer()
else
exoPlayer = player:GiveExo()
end

if exoPlayer then

for i = 1, #weapons do
exoPlayer:StoreWeapon(weapons[i])
end

exoPlayer:SetMaxArmor(self:GetMaxArmor())
exoPlayer:SetArmor(self:GetArmor())
exoPlayer:SetFlashlightOn(self:GetFlashlightOn())
exoPlayer:TransferParasite(self)

local newAngles = player:GetViewAngles()
newAngles.pitch = 0
newAngles.roll = 0
newAngles.yaw = GetYawFromVector(self:GetCoords().zAxis)
exoPlayer:SetOffsetAngles(newAngles)
-- the coords of this entity are the same as the players coords when he left the exo, so reuse these coords to prevent getting stuck
exoPlayer:SetCoords(self:GetCoords())

self:TriggerEffects("pickup")
DestroyEntity(self)

end

end

end

end
@@ -0,0 +1,313 @@
Script.Load("lua/StunMixin.lua")
Script.Load("lua/PhaseGateUserMixin.lua")
Script.Load("lua/Mixins/LadderMoveMixin.lua")
Script.Load("lua/Additions/StunWall.lua")
Script.Load("lua/Additions/ExoWelder.lua")


local networkVars = {


--isLockedEjecting = "private boolean",

-- wallboots = "private boolean",
-- wallWalking = "compensated boolean",
-- timeLastWallWalkCheck = "private compensated time",

}
/*
local kNormalWallWalkFeelerSize = 0.25
local kNormalWallWalkRange = 0.3
local kJumpWallRange = 0.4
local kJumpWallFeelerSize = 0.1
local kWallJumpInterval = 0.4
local kWallJumpForce = 5.2 -- scales down the faster you are
local kMinWallJumpForce = 0.1
local kVerticalWallJumpForce = 4.3
*/

AddMixinNetworkVars(StunMixin, networkVars)
AddMixinNetworkVars(PhaseGateUserMixin, networkVars)
AddMixinNetworkVars(LadderMoveMixin, networkVars)

local kDualWelderModelName = PrecacheAsset("models/marine/exosuit/exosuit_rr.model")
local kDualWelderAnimationGraph = PrecacheAsset("models/marine/exosuit/exosuit_rr.animation_graph")

local kHoloMarineMaterialname = PrecacheAsset("cinematics/vfx_materials/marine_ip_spawn.material")



local origcreate = Exo.OnCreate
function Exo:OnCreate()
origcreate(self)
InitMixin(self, PhaseGateUserMixin)
InitMixin(self, LadderMoveMixin)
-- InitMixin(self, WallMovementMixin)
--self.isLockedEjecting = false
-- self.wallboots = true
-- self.wallWalking = false
-- self.wallWalkingNormalGoal = Vector.yAxis
-- self.timeLastWallJump = 0

end
/*
function Exo:GetIsWallWalking()
return self.wallWalking and self.wallboots
end
function Exo:GetIsWallWalkingPossible()
return true--not self:GetRecentlyJumped() and not self:GetCrouching() -- and self.wallboots
end
function Exo:GetPerformsVerticalMove()
return self:GetIsWallWalking()
end
function Exo:OverrideUpdateOnGround(onGround)
return onGround or self:GetIsWallWalking()
end
local origangles = Marine.GetDesiredAngles
function Exo:GetDesiredAngles()

if self:GetIsWallWalking() then return self.currentWallWalkingAngles end
return origangles(self)
end
function Exo:GetIsUsingBodyYaw()
return not self:GetIsWallWalking()
end
function Exo:GetIsUsingBodyYaw()
return not self:GetIsWallWalking()
end
function Exo:GetAngleSmoothingMode()

if self:GetIsWallWalking() then
return "quatlerp"
else
return "euler"
end

end
function Exo:OnWorldCollision(normal, impactForce, newVelocity)

PROFILE("Exo:OnWorldCollision")

self.wallWalking = self:GetIsWallWalkingPossible() and normal.y < 0.5

end
function Exo:PreUpdateMove(input, runningPrediction)
PROFILE("Exo:PreUpdateMove")
self.prevY = self:GetOrigin().y

if self:GetIsWallWalking() then

-- Most of the time, it returns a fraction of 0, which means
-- trace started outside the world (and no normal is returned)
local goal = self:GetAverageWallWalkingNormal(kNormalWallWalkRange, kNormalWallWalkFeelerSize)
if goal ~= nil then

self.wallWalkingNormalGoal = goal
self.wallWalking = true
-- self:SetEnergy(self:GetEnergy() - kWallWalkEnergyCost)

else
self.wallWalking = false
end

end

if not self:GetIsWallWalking() then
-- When not wall walking, the goal is always directly up (running on ground).
self.wallWalkingNormalGoal = Vector.yAxis
end



-- if self.leaping and Shared.GetTime() > self.timeOfLeap + kLeapTime then
-- self.leaping = false
-- end

self.currentWallWalkingAngles = self:GetAnglesFromWallNormal(self.wallWalkingNormalGoal or Vector.yAxis) or self.currentWallWalkingAngles


end
function Exo:GetMoveSpeedIs2D()
return not self:GetIsWallWalking()
end
function Exo:GetCanStep()
return not self:GetIsWallWalking()
end




local function HealSelf(self)


local toheal = true
-- Print("toheal is %s", toheal)
if toheal then
local amt = kNanoArmorHealPerSecond
amt = amt * ConditionalValue(self:GetIsInCombat(), 0, 2)
self:SetArmor(self:GetArmor() + amt, true)
end
return true
end

*/

local kPhaseDelay = 2

function Exo:GetCanPhase()

if Server then
return self:GetIsAlive() and Shared.GetTime() > self.timeOfLastPhase + kPhaseDelay and not GetConcedeSequenceActive()
else
return self:GetIsAlive() and Shared.GetTime() > self.timeOfLastPhase + kPhaseDelay
end
end

local oninit = Exo.OnInitialized
function Exo:OnInitialized()

oninit(self)
InitMixin(self, StunMixin)
self:SetTechId(kTechId.Exo)
-- self:AddTimedCallback(function() HealSelf(self) return true end, 1)
-- self.currentWallWalkingAngles = Angles(0.0, 0.0, 0.0)
-- self.timeLastWallJump = 0
end
local origmodel = Exo.InitExoModel

function Exo:InitExoModel()

local hasWelders = false
local modelName = kDualWelderModelName
local graphName = kDualWelderAnimationGraph

if self.layout == "WelderWelder" or self.layout == "FlamerFlamer" or self.layout == "WelderFlamer" then --!= Minigun, != Railgun
modelName = kDualWelderModelName
graphName = kDualWelderAnimationGraph
self.hasDualGuns = true
hasWelders = true
self:SetModel(modelName, graphName)
end


if hasWelders then
else
origmodel(self)
end




end
local origweapons = Exo.InitWeapons
function Exo:InitWeapons()

local weaponHolder = self:GetWeapon(ExoWeaponHolder.kMapName)
if not weaponHolder then
weaponHolder = self:GiveItem(ExoWeaponHolder.kMapName, false)
end


if self.layout == "WelderWelder" then
weaponHolder:SetWelderWeapons()
self:SetHUDSlotActive(1)
return
elseif self.layout == "FlamerFlamer" then
weaponHolder:SetFlamerWeapons()
self:SetHUDSlotActive(1)
return
elseif self.layout == "WelderFlamer" then
weaponHolder:SetWelderFlamer()
self:SetHUDSlotActive(1)
return
end




origweapons(self)


end



function Exo:GetIsStunAllowed()
return not self.timeLastStun or self.timeLastStun + 8 < Shared.GetTime()
end

function Exo:OnStun() --so the stunwall places the exo in the air making him unable to shoot. not good.
if Server then
local stunwall = CreateEntity(StunWall.kMapName, self:GetOrigin(), 2)
StartSoundEffectForPlayer(AlienCommander.kBoneWallSpawnSound, self)
end
end

/*
function Exo:EjectExo()

if self:GetCanEject() then

if Server then
self:PerformDelayedEject()
end

end

end
if Server then

function Exo:PerformDelayedEject()
self:SetCameraDistance(3)
if Client then CreateSpinEffect(self) end
self.isLockedEjecting = true
self:AddTimedCallback(function() self.isLockedEjecting = false self:SetCameraDistance(0) Exo.PerformEject(self) end, 1)

end
end
*/

function Exo:OnKill(attacker, doer, point, direction)


local reuseWeapons = self.storedWeaponsIds ~= nil

local marine = self:Replace(self.prevPlayerMapName or Marine.kMapName, self:GetTeamNumber(), false, self:GetOrigin() + Vector(0, 0.2, 0), { preventWeapons = reuseWeapons })
marine:SetHealth(self.prevPlayerHealth or kMarineHealth)
marine:SetMaxArmor(self.prevPlayerMaxArmor or kMarineArmor)
marine:SetArmor(self.prevPlayerArmor or kMarineArmor)

--exosuit:SetOwner(marine) --explode lol

marine.onGround = false
local initialVelocity = self:GetViewCoords().zAxis
initialVelocity:Scale(4)
initialVelocity.y = math.max(0,initialVelocity.y) + 9
marine:SetVelocity(initialVelocity)

if reuseWeapons then

for _, weaponId in ipairs(self.storedWeaponsIds) do

local weapon = Shared.GetEntity(weaponId)
if weapon then
marine:AddWeapon(weapon)
end

end

end

marine:SetHUDSlotActive(1)

if marine:isa("JetpackMarine") then
marine:SetFuel(0.25)
end


return false

end


Shared.LinkClassToMap("Exo", Exo.kMapName, networkVars)
@@ -0,0 +1,11 @@
function Fade:GetCanMetabolizeHealth()
return GetHasTech(self, kTechId.MetabolizeHealth)
end


function Fade:GetRebirthLength()
return 4
end
function Fade:GetRedemptionCoolDown()
return 20
end
@@ -0,0 +1,120 @@

ModLoader.SetupFileHook( "lua/CommAbilities/Alien/Contamination.lua", "lua/CommAbilities/Alien/Contamination_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Marine.lua", "lua/Marine_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Alien.lua", "lua/Alien_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Exo.lua", "lua/Exo_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Whip.lua", "lua/Whip_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/AmmoPack.lua", "lua/AmmoPack_Skynet.lua", "post" )

ModLoader.SetupFileHook( "lua/LiveMixin.lua", "lua/LiveMixin_Skynet.lua", "post" )


ModLoader.SetupFileHook( "lua/JetpackMarine.lua", "lua/JetpackMarine_Avoca.lua", "post" )


ModLoader.SetupFileHook( "lua/Hive.lua", "lua/Hive_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Armory.lua", "lua/Armory_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Skulk.lua", "lua/Skulk_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/ConstructMixin.lua", "lua/ConstructMixin_Siege19.lua", "post" )

ModLoader.SetupFileHook( "lua/Lerk.lua", "lua/Lerk_Avoca.lua", "post" )

--ModLoader.SetupFileHook( "lua/Egg.lua", "lua/Egg_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Embryo.lua", "lua/Embryo_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/NS2Utility.lua", "lua/NS2Utility_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/AlienTeam.lua", "lua/AlienTeam_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Alien_Upgrade.lua", "lua/Alien_Upgrade_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Location.lua", "lua/Location_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Cyst.lua", "lua/Cyst_Avoca.lua", "post" )


ModLoader.SetupFileHook( "lua/TechTreeButtons.lua", "lua/TechTreeButtons_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Balance.lua", "lua/Balance_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Balance.lua", "lua/Balance_Skynet.lua", "post" )

ModLoader.SetupFileHook( "lua/BalanceHealth.lua", "lua/BalanceHealth_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Shade.lua", "lua/Shade_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Shift.lua", "lua/Shift_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/AchievementGiverMixin.lua", "lua/AchievementGiverMixin_Siege19.lua", "post" )

ModLoader.SetupFileHook( "lua/AchievementReceiverMixin.lua", "lua/AchievementReceiverMixin_Siege19.lua", "post" )


ModLoader.SetupFileHook( "lua/ARC.lua", "lua/ARC_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/MAC.lua", "lua/MAC_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/PowerPointLightHandler.lua", "lua/PowerPointLightHandler_Avoca.lua", "post" )


ModLoader.SetupFileHook( "lua/RoboticsFactory.lua", "lua/RoboticsFactory_Avoca.lua", "post" )


ModLoader.SetupFileHook( "lua/PhaseGate.lua", "lua/PhaseGate_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Crag.lua", "lua/Crag_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Gorge.lua", "lua/Gorge_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/SentryBattery.lua", "lua/SentryBattery_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Drifter.lua", "lua/Drifter_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/PowerPoint.lua", "lua/PowerPoint_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Sentry.lua", "lua/Sentry_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Exo.lua", "lua/Exo_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Player.lua", "lua/Player_Skynet.lua", "post" )

ModLoader.SetupFileHook( "lua/CommandStation.lua", "lua/CommandStation_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/PrototypeLab.lua", "lua/PrototypeLab_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Weapons/Marine/ExoWeaponHolder.lua", "lua/Weapons/Marine/ExoWeaponHolder_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Weapons/Marine/Welder.lua", "lua/Weapons/Marine/Welder_Avoca.lua", "post" )


ModLoader.SetupFileHook( "lua/Weapons/Marine/GrenadeLauncher.lua", "lua/Weapons/Marine/GrenadeLauncher_Skynet.lua", "post" )

ModLoader.SetupFileHook( "lua/Weapons/Marine/Grenade.lua", "lua/Weapons/Marine/Grenade_Skynet.lua", "post" )

ModLoader.SetupFileHook( "lua/TechData.lua", "lua/TechData_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/MarineTeam.lua", "lua/MarineTeam_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Exosuit.lua", "lua/ExoSuit_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/InfantryPortal.lua", "lua/InfantryPortal_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/CommandStructure.lua", "lua/CommandStructure_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Spectator.lua", "lua/Spectator_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Onos.lua", "lua/Onos_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/Weapons/Marine/Flamethrower.lua", "lua/Weapons/Marine/Flamethrower_Avoca.lua", "post" )

ModLoader.SetupFileHook( "lua/TechTreeConstants.lua", "lua/TechTreeConstants_Avoca.lua", "post" )

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -0,0 +1,177 @@
-- ======= Copyright (c) 2003-2013, Unknown Worlds Entertainment, Inc. All rights reserved. =======
--
-- lua/GUIUpgradeChamberDisplay.lua
--
-- Shows how many shells, spurs, veils you have
--
-- Created by Andreas Urwalek (andi@unknownworlds.com)
--
-- ========= For more information, visit us at http:--www.unknownworlds.com =====================

Script.Load("lua/Globals.lua")
Script.Load("lua/GUIScript.lua")
Script.Load("lua/Hud/Alien/GUIAlienHUDStyle.lua")

class 'GUIUpgradeChamberDisplay' (GUIScript)

local kMinBioMass = 0
local kMaxBioMass = 9

local kBackgroundPos
local kBackgroundColor = Color(0, 0, 0, 0)

local kIconSize
local kIconTexture = "ui/buildmenu.dds"

local kIconOffset
local kIconColor = Color( 1, 190/255, 50/255, 1 ) --kIconColors[kAlienTeamType]

local kUpgradeLevelFunc =
{
GetShellLevel,
GetSpurLevel,
GetVeilLevel
}

-- first entry is tech id to use if the player has none of the upgrades in the list
local kIndexToUpgrades =
{
{kTechId.CragHiveTwo, kTechId.Redemption, kTechId.Rebirth}, --, kTechId.Hunger},
-- {kTechId.ShiftHiveTwo, kTechId.ThickenedSkin, kTechId.DamageResistance},
-- {kTechId.ShiftHiveTwo, }, -- kTechId.ThickenedSkin},
{ kTechId.Shell, kTechId.Crush, kTechId.Carapace, kTechId.Regeneration, },
{ kTechId.Spur, kTechId.Silence, kTechId.Celerity, kTechId.Adrenaline },
{ kTechId.Veil, kTechId.Vampirism, kTechId.Aura, kTechId.Focus },
}

local function CreateUpgradeIcon()

local icon = GetGUIManager():CreateGraphicItem()
icon:SetSize(Vector(kIconSize, kIconSize, 0))
icon:SetTexture(kIconTexture)
icon:SetPosition(kIconOffset)
icon:SetColor(kIconColor)

return icon

end

local function CreateIcons( background )

local icons = {}

for type = 1, 3 do

local category = {}

local upgradeLevelOne = CreateUpgradeIcon()
background:AddChild(upgradeLevelOne)
table.insert(category, upgradeLevelOne)

upgradeLevelTwo = CreateUpgradeIcon()
upgradeLevelOne:AddChild(upgradeLevelTwo)
table.insert(category, upgradeLevelTwo)

upgradeLevelThree = CreateUpgradeIcon()
upgradeLevelTwo:AddChild(upgradeLevelThree)
table.insert(category, upgradeLevelThree)

upgradeLevelOne:SetPosition( Vector(0, (type - 1) * ( kIconSize * 0.75 ), 0) )

table.insert(icons, category)

end

return icons

end

function GUIUpgradeChamberDisplay:Initialize()

kBackgroundPos = GUIScale( Vector( 8, 600, 0 ) )
kIconSize = GUIScale( 48 )
kIconOffset = GUIScale( Vector( 18, 2, 0 ) )

self.background = GetGUIManager():CreateGraphicItem()
self.background:SetAnchor( GUIItem.Left, GUIItem.Top )
self.background:SetPosition( kBackgroundPos )
self.background:SetColor( kBackgroundColor )

self.upgradeIcons = CreateIcons( self.background )

end

function GUIUpgradeChamberDisplay:Uninitialize()

if self.background then
GUI.DestroyItem(self.background)
self.background = nil
end

end

function GUIUpgradeChamberDisplay:OnResolutionChanged(oldX, oldY, newX, newY)
self:Uninitialize()
self:Initialize()
end

local function GetTechIdToUse(playerUpgrades, categoryUpgrades)

for i = 1, #categoryUpgrades do

if table.contains(playerUpgrades, categoryUpgrades[i]) then
return categoryUpgrades[i], true
end

end

return categoryUpgrades[1], false

end

function GUIUpgradeChamberDisplay:Update(deltaTime)
PROFILE("GUIUpgradeChamberDisplay:Update")
local player = Client.GetLocalPlayer()
if player then

local upgrades = player:GetUpgrades()

for i = 1, 3 do

local category = self.upgradeIcons[i]
local level = kUpgradeLevelFunc[i](player:GetTeamNumber())
local techId, upgraded = GetTechIdToUse(upgrades, kIndexToUpgrades[i])
local alpha = (upgraded or player:isa("Commander")) and 1 or (0.25 + (1 + math.sin(Shared.GetTime() * 5)) * 0.5) * 0.75

for upgradeLevel = 1, 3 do

if level == 0 then

self.upgradeIcons[i][upgradeLevel]:SetIsVisible(false)
break

else

local color = Color(kIconColor.r, kIconColor.g, kIconColor.b, alpha)
if level < upgradeLevel then

color.r = 0
color.g = 0
color.b = 0
color.a = 1

end

self.upgradeIcons[i][upgradeLevel]:SetTexturePixelCoordinates(unpack(GetTextureCoordinatesForIcon(techId)))
self.upgradeIcons[i][upgradeLevel]:SetColor(color)
self.upgradeIcons[i][upgradeLevel]:SetIsVisible(true)

end

end

end

end

end
@@ -0,0 +1,259 @@
--SiegeMod Kyle abent 2015
GlowMixin = CreateMixin( GlowMixin )
GlowMixin.type = "Glow"


----------------------Glow Purple----------------------
PrecacheAsset("Glow/purple/GlowTP.surface_shader")
PrecacheAsset("Glow/purple/GlowViewMarine.surface_shader")
PrecacheAsset("Glow/purple/GlowViewExo.surface_shader")
local kMaterialPurple = PrecacheAsset("Glow/purple/purple.material")
local kExoViewMaterialPurple = PrecacheAsset("Glow/purple/exoview_purple.material")
local kViewMaterialPurple = PrecacheAsset("Glow/purple/view_purple.material")
----------------------Glow Purple----------------------

----------------------Glow Green----------------------
PrecacheAsset("Glow/green/GlowTP.surface_shader")
PrecacheAsset("Glow/green/GlowViewMarine.surface_shader")
PrecacheAsset("Glow/green/GlowViewExo.surface_shader")
local kMaterialGreen = PrecacheAsset("Glow/green/green.material")
local kExoViewMaterialGreen = PrecacheAsset("Glow/green/exoview_green.material")
local kViewMaterialGreen = PrecacheAsset("Glow/green/view_green.material")
----------------------Glow Green----------------------

---------------------------Yellow--------------
PrecacheAsset("Glow/yellow/GlowTP.surface_shader")
PrecacheAsset("Glow/yellow/GlowViewMarine.surface_shader")
PrecacheAsset("Glow/yellow/GlowViewExo.surface_shader")
local kMaterialYellow = PrecacheAsset("Glow/yellow/yellow.material")
local kExoViewMaterialYellow = PrecacheAsset("Glow/yellow/exoview_yellow.material")
local kViewMaterialYellow = PrecacheAsset("Glow/yellow/view_yellow.material")
------------------------------------------------

--------------------------Red----------------------
PrecacheAsset("Glow/red/GlowTP.surface_shader")
PrecacheAsset("Glow/red/GlowViewMarine.surface_shader")
PrecacheAsset("Glow/red/GlowViewExo.surface_shader")
local kMaterialRed = PrecacheAsset("Glow/red/red.material")
local kExoViewMaterialRed = PrecacheAsset("Glow/red/exoview_red.material")
local kViewMaterialRed = PrecacheAsset("Glow/red/view_red.material")
--------------------------------------------

GlowMixin.overrideFunctions =
{
}

GlowMixin.expectedMixins =
{
}

GlowMixin.optionalCallbacks =
{
}

GlowMixin.networkVars =
{
Glowing = "boolean",
Color = "float (1 to 4 by 1)",
}

function GlowMixin:__initmixin()


self.timeofStartGlow = 0
self.Glowing = false
self.Color = 1

end

local function ClearGlow(self)

self.Glowing = false
self.timeofStartGlow = 0

if Client then
self:_RemoveGlow()
end


end

if Server then

function GlowMixin:CopyPlayerDataFrom(player)
self.Glowing = player.Glowing
self.Color = player.Color
self.timeofStartGlow = player.timeofStartGlow

end

end--server

function GlowMixin:OnDestroy()

if self:GetIsGlowing() then
ClearGlow(self)
end

end
function GlowMixin:GlowColor(color, duration)

self.Color = color
self.timeofStartGlow = Shared.GetTime() + duration
self.Glowing = true

end
function GlowMixin:ClearGlow()

ClearGlow(self)

end
function GlowMixin:GetIsGlowing()
return self.Glowing
end
function GlowMixin:GetColor()
return self.Color
end
local function UpdateClientGlowEffects(self)

assert(Client)

if self:GetIsGlowing() and self:GetIsAlive() then --and not (not self:GetHasRespawnProtection() and self:GetIsNanoShielded() ) then
self:_CreateGlow()
else
self:_RemoveGlow()
end

end

local function SharedUpdate(self)

if Server then

if not self:GetIsGlowing() then
return
end


if self.timeofStartGlow < Shared.GetTime() then
ClearGlow(self)
end

elseif Client and not Shared.GetIsRunningPrediction() then
UpdateClientGlowEffects(self)
end

end
function GlowMixin:OnUpdate(deltaTime)
SharedUpdate(self)
end

function GlowMixin:OnProcessMove(input)
SharedUpdate(self)
end

if Client then

local function AddGlow(entity, material, viewMaterial, entities)

local numChildren = entity:GetNumChildren()

if HasMixin(entity, "Model") then
local model = entity._renderModel
if model ~= nil then
if model:GetZone() == RenderScene.Zone_ViewModel then
model:AddMaterial(viewMaterial)
else
model:AddMaterial(material)
end
table.insert(entities, entity:GetId())
end
end

for i = 1, entity:GetNumChildren() do
local child = entity:GetChildAtIndex(i - 1)
AddGlow(child, material, viewMaterial, entities)
end

end

local function RemoveGlow(entities, material, viewMaterial)

for i =1, #entities do
local entity = Shared.GetEntity( entities[i] )
if entity ~= nil and HasMixin(entity, "Model") then
local model = entity._renderModel
if model ~= nil then
if model:GetZone() == RenderScene.Zone_ViewModel then
model:RemoveMaterial(viewMaterial)
else
model:RemoveMaterial(material)
end
end
end
end

end

function GlowMixin:_CreateGlow()

if not self.ColorMaterial then

local material = Client.CreateRenderMaterial()
if self.Color == 1 then
material:SetMaterial(kMaterialPurple)
elseif self.Color == 2 then
material:SetMaterial(kMaterialGreen)
elseif self.Color == 3 then
material:SetMaterial(kMaterialYellow)
elseif self.Color == 4 then
material:SetMaterial(kMaterialRed)
end

local viewMaterial = Client.CreateRenderMaterial()

if self:isa("Exo") then
if self.Color == 1 then
viewMaterial:SetMaterial(kExoViewMaterialPurple)
elseif self.Color == 2 then
viewMaterial:SetMaterial(kExoViewMaterialGreen)
elseif self.Color == 3 then
viewMaterial:SetMaterial(kExoViewMaterialYellow)
elseif self.Color == 4 then
viewMaterial:SetMaterial(kExoViewMaterialRed)
end
else
if self.Color == 1 then
viewMaterial:SetMaterial(kViewMaterialPurple)
elseif self.Color == 2 then
viewMaterial:SetMaterial(kViewMaterialGreen)
elseif self.Color == 3 then
viewMaterial:SetMaterial(kViewMaterialYellow)
elseif self.Color == 4 then
viewMaterial:SetMaterial(kViewMaterialRed)
end
end

self.GlowingEntities = {}
self.ColorMaterial = material
self.ColorViewMaterial = viewMaterial
AddGlow(self, material, viewMaterial, self.GlowingEntities)

end

end

function GlowMixin:_RemoveGlow()

if self.ColorMaterial then
RemoveGlow(self.GlowingEntities, self.ColorMaterial, self.ColorViewMaterial)
Client.DestroyRenderMaterial(self.ColorMaterial)
Client.DestroyRenderMaterial(self.ColorViewMaterial)
self.ColorMaterial = nil
self.ColorViewMaterial = nil
self.GlowingEntities = nil
end

end

end

Large diffs are not rendered by default.

@@ -0,0 +1,99 @@
Gorge.kCameraRollSpeedModifier = 0.5
Gorge.kCameraRollTiltModifier = 0.05

Gorge.kViewModelRollSpeedModifier = 7
Gorge.kViewModelRollTiltModifier = 0.15

function Gorge:GetHealthbarOffset()
return 0.7
end

function Gorge:GetHeadAttachpointName()
return "Bone_Tongue"
end

-- Tilt the camera based on the wall the Gorge is attached to.
function Gorge:PlayerCameraCoordsAdjustment(cameraCoords)

if self.currentCameraRoll ~= 0 then

local viewModelTiltAngles = Angles()
viewModelTiltAngles:BuildFromCoords(cameraCoords)

if self.currentCameraRoll then
viewModelTiltAngles.roll = viewModelTiltAngles.roll + self.currentCameraRoll
end

local viewModelTiltCoords = viewModelTiltAngles:GetCoords()
viewModelTiltCoords.origin = cameraCoords.origin

return viewModelTiltCoords

end

return cameraCoords

end

local function UpdateCameraTilt(self, deltaTime)

if self.currentCameraRoll == nil then
self.currentCameraRoll = 0
end
if self.goalCameraRoll == nil then
self.goalCameraRoll = 0
end
if self.currentViewModelRoll == nil then
self.currentViewModelRoll = 0
end

-- Don't rotate if too close to upside down (on ceiling).
if not Client.GetOptionBoolean("CameraAnimation", false) or math.abs(self.wallWalkingNormalGoal:DotProduct(Vector.yAxis)) > 0.9 then
self.goalCameraRoll = 0
else

local wallWalkingNormalCoords = Coords.GetLookIn( Vector.origin, self:GetViewCoords().zAxis, self.wallWalkingNormalGoal )
local wallWalkingRoll = Angles()
wallWalkingRoll:BuildFromCoords(wallWalkingNormalCoords)
self.goalCameraRoll = wallWalkingRoll.roll

end

self.currentCameraRoll = LerpGeneric(self.currentCameraRoll, self.goalCameraRoll * Gorge.kCameraRollTiltModifier, math.min(1, deltaTime * Gorge.kCameraRollSpeedModifier))
self.currentViewModelRoll = LerpGeneric(self.currentViewModelRoll, self.goalCameraRoll, math.min(1, deltaTime * Gorge.kViewModelRollSpeedModifier))

end

function Gorge:OnProcessIntermediate(input)

Alien.OnProcessIntermediate(self, input)
UpdateCameraTilt(self, input.time)

end

function Gorge:OnProcessSpectate(deltaTime)

Alien.OnProcessSpectate(self, deltaTime)
UpdateCameraTilt(self, deltaTime)

end


function Gorge:GetSpeedDebugSpecial()
return 0
end

function Gorge:ModifyViewModelCoords(viewModelCoords)

if self.currentViewModelRoll ~= 0 then

local roll = self.currentViewModelRoll and self.currentViewModelRoll * Gorge.kViewModelRollTiltModifier or 0
local rotationCoords = Angles(0, 0, roll):GetCoords()

return viewModelCoords * rotationCoords

end

return viewModelCoords

end
@@ -0,0 +1,298 @@

function Hive:OnAdjustModelCoords(modelCoords)
local coords = modelCoords
local scale = ConditionalValue(GetTechPoint(self:GetOrigin()) ~= nil, 1, 0.5)
coords.xAxis = coords.xAxis * scale
coords.yAxis = coords.yAxis * scale
coords.zAxis = coords.zAxis * scale

return coords
end

function Hive:ModifyDamageTaken(damageTable, attacker, doer, damageType, hitPoint)

-- webs can't be destroyed with bullet weapons
if doer ~= nil then
-- local scale = ConditionalValue(GetTechPoint(self:GetOrigin()) ~= nil, 1, 0.5)
-- damageTable.damage = damageTable.damage * scale

if doer:isa("ARC") and doer.avoca == true then
damageTable.damage = damageTable.damage * 2
end

end

end

if Server then



local orig_Hive_OnResearchComplete = Hive.OnResearchComplete
function Hive:OnResearchComplete(researchId)
--Print("HiveOnResearchComplete")
UpdateAliensWeaponsManually()
if researchId == kTechId.UpgradeToCragHive or researchId == kTechId.UpgradeToShadeHive or researchId == kTechId.UpgradeToShiftHive then
self:AddTimedCallback(Hive.CheckForDoubleUpG, 4)
-- Print("Started Callback Hive CheckForDoubleUpG")
end
--for now just updtate alien hp on all research completes b/c i dont feel like filtering the biomass -.-
-- IfBioMassThenAdjustHp(self)
return orig_Hive_OnResearchComplete(self, researchId)
end



local function LocationsMatch(who,whom)

local whoname = GetLocationForPoint(who:GetOrigin())
local whomname = GetLocationForPoint(whom:GetOrigin())
return true --whoname == whomname
end

/*

local function ToSpawnFormula(self,panicstospawn, where)
for i = 1, panicstospawn do
local bitch = GetPayLoadArc()
if bitch and GetIsPointWithinHiveRadius(bitch:GetOrigin()) then
local spawnpoint = FindFreeSpace(bitch:GetOrigin(), 4, 8)
if spawnpoint then
local panicattack = CreateEntity(PanicAttack.kMapName, spawnpoint, 2)
panicattack:SetConstructionComplete()
panicattack:SetMature()
end
end
end

end
local function GetRange(who, where)
local ArcFormula = (where - who:GetOrigin()):GetLengthXZ()
return ArcFormula
end
local function SendAnxietyAttack(self, where, who)
for i = 1, #who do
local panicattack = who[i]
-- local bitch = GetDeployedPayLoadArc()
-- if bitch and GetIsPointWithinHiveRadius(bitch:GetOrigin()) and GetRange(panicattack,bitch:GetOrigin()) >= 16 then
local spawnpoint = FindFreeSpace(where, 4, 8)
if spawnpoint then
panicattack:SetOrigin(spawnpoint)
end
-- end
end
end
local function PanicInitiate(self,where)
local panicattacks = {}

for _, panicattack in ipairs(GetEntitiesWithinRange("PanicAttack", where, 9999)) do
if panicattack:GetIsAlive() then
table.insert(panicattacks,panicattack)
end
end

local countofpanic = Clamp(table.count(panicattacks), 0, 8)
local maxpanic = 4
local panicstospawn = math.abs(maxpanic - countofpanic)
panicstospawn = Clamp(panicstospawn, 1, 2)

if panicstospawn >= 1 then ToSpawnFormula(self,panicstospawn, where) end

if countofpanic >= 1 then
SendAnxietyAttack(self, where, panicattacks) -- not sure
end

end

local orig_Hive_OnTakeDamage = Hive.OnTakeDamage
function Hive:OnTakeDamage(damage, attacker, doer, point)

if attacker then --and doer.avoca == true then
Print("PanicAttack Initiated")
PanicInitiate(self,attacker:GetOrigin())
--if self:GetIsBuilt() then AddPayLoadTime(10) end
end

return orig_Hive_OnTakeDamage(self,damage, attacker, doer, point)
end



*/



/*

local function DestroyAvocaArcInRadius(where)
for _, avocaarc in ipairs(GetEntitiesWithinRange("AvocaArc", where, kARCRange)) do
if avocaarc then avocaarc:Kill() end
end
end
*/




local kAuxPowerBackupSound = PrecacheAsset("sound/NS2.fev/marine/power_node/backup")

local function BuildRoomPower(who)

local nearestPower = GetNearest(who:GetOrigin(), "PowerPoint", 1, function(ent) return LocationsMatch(who,ent) end)
if nearestPower and nearestPower:GetIsDisabled() then
--local cheaptrick = CreateEntity(PowerPoint.kMapName, nearestPower:GetOrigin(), 1)
nearestPower:OnConstructionComplete()
nearestPower:SpawnSurgeForEach(nearestPower:GetOrigin(), nearestPower)
-- DestroyEntity(nearestPower)
end


-- who:AddTimedCallback(function()
-- local bigarc = CreateEntity(BigArc.kMapName, who:GetOrigin(), 1)
-- bigarc:GiveDeploy()
-- local cc = CreateEntity(CommandStation.kMapName, who:GetOrigin(), 1)
-- cc:SetConstructionComplete()
-- end, 8)

end



local orig_Hive_OnKill = Hive.OnKill
function Hive:OnKill(attacker, doer, point, direction)
--self:UpdateAliensWeaponsManually()
--if self:GetIsBuilt() then AddPayLoadTime(16) end
--local child = GetTechPoint(self:GetOrigin())
BuildRoomPower(self)
--DestroyAvocaArcInRadius(self:GetOrigin())
--child:SetIsVisible(false)
return orig_Hive_OnKill(self,attacker, doer, point, direction)
end
/*
local orig_Hive_OnResearchComplete = Hive.OnResearchComplete
function Hive:OnResearchComplete(researchId)
self:UpdateAliensWeaponsManually()
return orig_Hive_OnResearchComplete(researchId, self)
end
*/
local function TresCheck(cost)
return GetGamerules().team1:GetTeamResources() >= cost
end
local function DeductTres(cost,teamnum)
if teamnum == 1 then
local marineteam = GetGamerules().team1
marineteam:SetTeamResources(marineteam:GetTeamResources() - cost)
else
local alienteam = GetGamerules().team2
alienteam:SetTeamResources(alienteam:GetTeamResources() - cost)
end
end

local orig_Hive_OnDestroy = Hive.OnDestroy
function Hive:OnDEstroy()
orig_Hive_OnDestroy(self)
UpdateAliensWeaponsManually()
end

function Hive:OnConstructionComplete()
--biomass 0
-- Play special tech point animation at same time so it appears that we bash through it.
UpdateTypeOfHive(self)
self:AddTimedCallback(Hive.UpdateManually, 15)
local attachedTechPoint = self:GetAttached()
if attachedTechPoint then
attachedTechPoint:SetIsSmashed(true)
else
Print("Hive not attached to tech point")
end

local team = self:GetTeam()

if team then
team:OnHiveConstructed(self)
end

if self.hiveType == 1 then
self:OnResearchComplete(kTechId.UpgradeToCragHive)
elseif self.hiveType == 2 then
self:OnResearchComplete(kTechId.UpgradeToShadeHive)
elseif self.hiveType == 3 then
self:OnResearchComplete(kTechId.UpgradeToShiftHive)
end

local cysts = GetEntitiesForTeamWithinRange( "Cyst", self:GetTeamNumber(), self:GetOrigin(), self:GetCystParentRange())
for _, cyst in ipairs(cysts) do
cyst:ChangeParent(self)
end
end
function Hive:UpdateManually()
if Server then
self:UpdatePassive()
end
return self:GetIsAlive()
end

local function GetBioMassLevel()
local teamInfo = GetTeamInfoEntity(2)
local bioMass = (teamInfo and teamInfo.GetBioMassLevel) and teamInfo:GetBioMassLevel() or 0
return math.round(bioMass / 4, 1, 3)
end
function Hive:UpdatePassive()
if GetHasTech(self, kTechId.Xenocide) or not GetGamerules():GetGameStarted() or not self:GetIsBuilt() or self:GetIsResearching() then return true end

local teamInfo = GetTeamInfoEntity(2)
local teambioMass = (teamInfo and teamInfo.GetBioMassLevel) and teamInfo:GetBioMassLevel() or 0

local techid = nil


if teambioMass >= 2 and not GetHasTech(self, kTechId.Charge) then
techid = kTechId.Charge
elseif teambioMass >= 3 and not GetHasTech(self, kTechId.BileBomb) then
techid = kTechId.BileBomb
elseif teambioMass >= 3 and not GetHasTech(self, kTechId.MetabolizeEnergy) then
techid = kTechId.MetabolizeEnergy
elseif teambioMass >= 4 and not GetHasTech(self, kTechId.Leap) then
techid = kTechId.Leap
elseif teambioMass >= 4 and not GetHasTech(self, kTechId.Spores) then
techid = kTechId.Spores
elseif teambioMass >= 5 and not GetHasTech(self, kTechId.Umbra) then
techid = kTechId.Umbra
elseif teambioMass >= 5 and not GetHasTech(self, kTechId.MetabolizeHealth) then
techid = kTechId.MetabolizeHealth
elseif teambioMass >= 6 and not GetHasTech(self, kTechId.BoneShield) then
techid = kTechId.BoneShield
elseif teambioMass >= 7 and not GetHasTech(self, kTechId.Stab) then
techid = kTechId.Stab
elseif teambioMass >= 8 and not GetHasTech(self, kTechId.Stomp) then
techid = kTechId.Stomp
elseif teambioMass >= 9 and not GetHasTech(self, kTechId.Xenocide) then
techid = kTechId.Xenocide
end

if techid == nil and self.bioMassLevel <= 1 then
techid = kTechId.ResearchBioMassOne
elseif techid == nil and self.bioMassLevel == 2 then
techid = kTechId.ResearchBioMassTwo
elseif techid == nil and self.bioMassLevel == 3 then
techid = kTechId.ResearchBioMassThree
elseif techid == nil and self.bioMassLevel == 4 then
techid = kTechId.ResearchBioMassFour
end

if techid == nil then return true end
local cost = LookupTechData(techid, kTechDataCostKey, 0)
if TresCheck(cost) then
DeductTres(cost, 2)
local techNode = self:GetTeam():GetTechTree():GetTechNode( techid )
self:SetResearching(techNode, self)
end


end





end
@@ -0,0 +1,22 @@
local networkVars =

{
lastCheck = "time",
}

local origupdate = InfantryPortal.OnUpdate

function InfantryPortal:OnUpdate(deltaTime)
origupdate(self, deltaTime)

if Server then
if self:GetIsBuilt() and not self:GetIsPowered() and GetIsTimeUp(self.lastCheck, 8) then
self:SetPowerSurgeDuration(16)
self.lastCheck = Shared.GetTime()
end

end

end

Shared.LinkClassToMap("InfantryPortal", InfantryPortal.kMapName, networkVars)
@@ -0,0 +1,3 @@
JetpackMarine.kJetpackFuelReplenishDelay = .28
--JetpackMarine.kJetpackGravity = -11
JetpackMarine.kJetpackTakeOffTime = .27
@@ -0,0 +1,17 @@
function Lerk:GetRebirthLength()
return 4
end
function Lerk:GetRedemptionCoolDown()
return 15
end

if Server then

function Lerk:GetTierFourTechId()
return kTechId.PrimalScream
end




end
@@ -0,0 +1,63 @@
local origkill = LiveMixin.Kill
function LiveMixin:Kill(attacker, doer, point, direction)
if self:GetIsAlive() and self:GetCanDie() then
---Rebirth

if self:isa("Alien") then


if GetHasRebirthUpgrade(self) and self:GetEligableForRebirth() then
if Server then
if attacker and attacker:isa("Player") then
local points = self:GetPointValue()
attacker:AddScore(points)
end
end
self:TriggerRebirth()
return
end

if Server and GetConductor():GetIsPhaseTwoBoolean() and math.random(1,100) >= 30 then
if self:isa("Skulk") then
CreateEntity(Rupture.kMapName, point, 2)
elseif self:isa("Gorge") then
--CreateEntity(Babbler.kMapName, point, 2)
-- CreateEntity(Babbler.kMapName, point, 2)
--CreateEntity(Babbler.kMapName, point, 2)
--CreateEntity(Babbler.kMapName, point, 2)
end
end
end

--Hunger

if self:GetTeamNumber() == 1 then
-- if self:isa("Player") then
/*
if attacker and attacker:isa("Alien") and attacker:isa("Player") and GetHasHungerUpgrade(attacker) then
local duration = 6
if attacker:isa("Onos") then
duration = duration * .7
end
attacker:TriggerEnzyme(duration)

attacker:AddEnergy(attacker:GetMaxEnergy() * .10 )
attacker:AddHealth(attacker:GetHealth() * (10/100))
*/
--end
-- elseif
--Default
if ( HasMixin(self, "Construct") or self:isa("ARC") or self:isa("MAC") ) and attacker and attacker:isa("Player") then
--if GetHasHungerUpgrade(attacker) and attacker:isa("Gorge") and doer:isa("DotMarker") then
if attacker:isa("Gorge") and doer:isa("DotMarker") then
attacker:TriggerEnzyme(5)
attacker:AddEnergy(30)
end
end
end



end
return origkill(self, attacker, doer, point, direction)
end
@@ -0,0 +1,96 @@
-- Kyle 'Avoca' Abent
PrecacheAsset("materials/power/powered_decal.surface_shader")
local kAirLockMaterial = PrecacheAsset("materials/power/powered_decal.material")

local originit = Location.OnInitialized
function Location:OnInitialized()
originit(self)
end
local function IsPowerUp(self)
local powerpoint = GetPowerPointForLocation(self.name)

local boolean = false
if powerpoint and powerpoint:GetIsBuilt() and not powerpoint:GetIsDisabled() then boolean = true end
---Print("IsPowerUp in %s is %s", self.name, boolean)
return boolean
end


function Location:GetIsPowerUp()
return IsPowerUp(self)
end
function Location:GetIsAirLock()
local boolean = IsPowerUp(self)
-- Print("%s airlock is %s", self.name, boolean)
return boolean
end

if Server then

local function GetCanSpawn(self)
for _, conductor in ientitylist(Shared.GetEntitiesWithClassname("Conductor")) do
return not conductor:CounterComplete()
end
return true
end


local function GetRandom(self, nameofwhich)

local lottery = {}
for _, unit in ipairs(GetEntitiesWithMixinForTeamWithinRange("Live", 2, self:GetOrigin(), 24)) do

local location = GetLocationForPoint(unit:GetOrigin())
if location and location.name == nameofwhich then
table.insert(lottery, unit)
end
end

if table.count(lottery) ~= 0 then
local entity = table.random(lottery)
return entity:GetOrigin()
end

return nil
end
/*

function Location:InitiateDefense()
self:AddTimedCallback(Location.BaseDefense, 4)
end

function Location:BaseDefense()
-- Print("BaseDefense triggered")
local spawnpoint = GetRandom(self, self.name)
if spawnpoint ~= nil and IsPowerUp(self) then
-- Print("SpawnDefense triggered")
CreateEntity(FireFlameCloud.kMapName, spawnpoint, 1)
end
return GetCanSpawn(self)
end


*/


function Location:GetRandomMarine()
--Because when round starts, room is empty. Have marine in room first to tell it to be eligable.
local lottery = {}
for _, unit in ipairs(GetEntitiesWithMixinForTeamWithinRange("Live", 1, self:GetOrigin(), 24)) do

local location = GetLocationForPoint(unit:GetOrigin())
if location and location.name == self.name then
table.insert(lottery, unit)
end
end

if table.count(lottery) ~= 0 then
local entity = table.random(lottery)
return entity:GetOrigin()
end

return nil
end


end
@@ -0,0 +1,70 @@

local networkVars =
{
avoca = "boolean",

}

local origInit = MAC.OnInitialized

function MAC:OnInitialized()
origInit(self)
if GetAvocaMac() == nil then
self.avoca = true
-- MAC.kConstructRate = 0.4* 1.4
-- MAC.kWeldRate = 0.5 * 1.4
MAC.kRepairHealthPerSecond = 125
return
end




if GetConductor():GetIsPhaseFourBoolean() then
MAC.kConstructRate = 0.4* 1.30
MAC.kWeldRate = 0.5 * 1.30
MAC.kRepairHealthPerSecond = 50 * 1.30
elseif GetConductor():GetIsPhaseThreeBoolean() then
MAC.kConstructRate = 0.4* 1.20
MAC.kWeldRate = 0.5 * 1.20
MAC.kRepairHealthPerSecond = 50 * 1.20
elseif GetConductor():GetIsPhaseTwoBoolean() then
MAC.kConstructRate = 0.4* 1.10
MAC.kWeldRate = 0.5 * 1.10
MAC.kRepairHealthPerSecond = 50 * 1.10
end


end


function MAC:GetIsAvoca()
if self.avoca == true then
return true
else
return false
end
end

function MAC:OnUse(player, elapsedTime, useSuccessTable)
if Server then
self:GiveOrder(kTechId.FollowAndWeld, player:GetId(), player:GetOrigin(), nil, true, true)
end
end

function MAC:GetCanBeWeldedOverride()
return true --self.lastTakenDamageTime + 1 < Shared.GetTime()
end


function MAC:ModifyDamageTaken(damageTable, attacker, doer, damageType, hitPoint)

if hitPoint ~= nil and doer ~= nil and self:GetIsAvoca() then
-- if GetConductor():GetIsPhaseTwoBoolean() then
damageTable.damage = damageTable.damage * 0.25
--end
end

end

Shared.LinkClassToMap("MAC", MAC.kMapName, networkVars)
@@ -0,0 +1,19 @@

local orig_MarineTeam_InitTechTree = MarineTeam.InitTechTree
function MarineTeam:InitTechTree()
local orig_PlayingTeam_InitTechTree = PlayingTeam.InitTechTree
PlayingTeam.InitTechTree = function() end
orig_PlayingTeam_InitTechTree(self)
local orig_TechTree_SetComplete = self.techTree.SetComplete
self.techTree.SetComplete = function() end
orig_MarineTeam_InitTechTree(self)
self.techTree.SetComplete = orig_TechTree_SetComplete

self.techTree:AddBuyNode(kTechId.DualWelderExosuit, kTechId.ExosuitTech, kTechId.None)
self.techTree:AddBuyNode(kTechId.DualFlamerExosuit, kTechId.ExosuitTech, kTechId.None)
self.techTree:AddBuyNode(kTechId.WeldFlamerExosuit, kTechId.ExosuitTech, kTechId.None)
-- self.techTree:AddResearchNode(kTechId.FlamethrowerRangeTech, kTechId.None)

self.techTree:SetComplete()
PlayingTeam.InitTechTree = orig_PlayingTeam_InitTechTree
end
@@ -0,0 +1,333 @@
--Thanks for the trick, modular exo
local orig_Marine_GetMaxSpeed = Marine.GetMaxSpeed
function Marine:GetMaxSpeed(possible)
local original = orig_Marine_GetMaxSpeed(self)
local moveSpeed = (self:GetGameEffectMask(kGameEffect.OnInfestation) ) and original * 0.65 or original

return moveSpeed



end

local orig_Marine_OnCreate = Marine.OnCreate
function Marine:OnCreate()
orig_Marine_OnCreate(self)
end

local orig = Marine.InitWeapons
function Marine:InitWeapons()
orig(self)

-- if not self:isa("JetpackMarine") and Server then
-- self:GiveJetpack()

self:GiveItem(Welder.kMapName)
self:SetActiveWeapon(Rifle.kMapName)

--end

end

function Marine:ModifyGravityForce(gravityTable)
if self:GetIsOnGround() then
gravityTable.gravity = 0
elseif self:GetHasCatpackBoost() then
--self:AddArmor(1)
gravityTable.gravity = -5
end
end

function Marine:GetCanBotPhase()
if Server then
return self:GetIsAlive() and Shared.GetTime() > self.timeOfLastPhase + (2*3) and not GetConcedeSequenceActive()
else
return self:GetIsAlive() and Shared.GetTime() > self.timeOfLastPhase + (2*3)
end

end

function Marine:GetHasLayStructure()
local weapon = self:GetWeaponInHUDSlot(5)
local builder = false
if (weapon) then
builder = true
end

return builder
end

function Marine:GiveLayStructure(techid, mapname)
-- if not self:GetHasLayStructure() then
local laystructure = self:GiveItem(LayStructures.kMapName)
self:SetActiveWeapon(LayStructures.kMapName)
laystructure:SetTechId(techid)
laystructure:SetMapName(mapname)
-- else
-- self:TellMarine(self)
-- end
end


function Marine:GetWeaponsToStore()
local toReturn = {}
local weapons = self:GetWeapons()

if weapons then

for i = 1, #weapons do
weapons[i]:SetParent(nil)
local weapon
table.insert(toReturn, weapons[i]:GetId())
end

end

return toReturn
end
function Marine:GiveExo(spawnPoint)
local random = math.random(1,2)
if random == 1 then
local exo = self:Replace(Exo.kMapName, self:GetTeamNumber(), false, spawnPoint, { layout = "MinigunMinigun", storedWeaponsIds = self:GetWeaponsToStore() })
return exo
else
local exo = self:Replace(Exo.kMapName, self:GetTeamNumber(), false, spawnPoint, { layout = "RailgunRailgun", storedWeaponsIds = self:GetWeaponsToStore() })
return exo
end


end

function Marine:GiveDualExo(spawnPoint)

local exo = self:Replace(Exo.kMapName, self:GetTeamNumber(), false, spawnPoint, { layout = "MinigunMinigun", storedWeaponsIds = self:GetWeaponsToStore() })
return exo

end
function Marine:GiveDualWelder(spawnPoint)

local exo = self:Replace(Exo.kMapName, self:GetTeamNumber(), false, spawnPoint, { layout = "WelderWelder" })
return exo

end
function Marine:GiveDualFlamer(spawnPoint)

local exo = self:Replace(Exo.kMapName, self:GetTeamNumber(), false, spawnPoint, { layout = "FlamerFlamer" })
return exo

end

function Marine:GiveWelderFlamer(spawnPoint)

local exo = self:Replace(Exo.kMapName, self:GetTeamNumber(), false, spawnPoint, { layout = "WelderFlamer" })
return exo

end
function Marine:GiveClawRailgunExo(spawnPoint)

local exo = self:Replace(Exo.kMapName, self:GetTeamNumber(), false, spawnPoint, { layout = "ClawRailgun", storedWeaponsIds = self:GetWeaponsToStore() })
return exo

end

function Marine:GiveDualRailgunExo(spawnPoint)

local exo = self:Replace(Exo.kMapName, self:GetTeamNumber(), false, spawnPoint, { layout = "RailgunRailgun", storedWeaponsIds = self:GetWeaponsToStore() })
return exo

end
kIsExoTechId = { [kTechId.DualFlamerExosuit] = true, [kTechId.DualMinigunExosuit] = true, [kTechId.DualWelderExosuit] = true, [kTechId.WeldFlamerExosuit] = true,
[kTechId.DualRailgunExosuit] = true }

local function BuyExo(self, techId)

local maxAttempts = 100
for index = 1, maxAttempts do

-- Find open area nearby to place the big guy.
local capsuleHeight, capsuleRadius = self:GetTraceCapsule()
local extents = Vector(Exo.kXZExtents, Exo.kYExtents, Exo.kXZExtents)

local spawnPoint
local checkPoint = self:GetOrigin() + Vector(0, 0.02, 0)

if GetHasRoomForCapsule(extents, checkPoint + Vector(0, extents.y, 0), CollisionRep.Move, PhysicsMask.Evolve, self) then
spawnPoint = checkPoint
else
spawnPoint = GetRandomSpawnForCapsule(extents.y, extents.x, checkPoint, 0.5, 5, EntityFilterOne(self))
end

local weapons

if spawnPoint then

self:AddResources(-GetCostForTech(techId))

local exo = nil

if techId == kTechId.DualFlamerExosuit then
exo = self:GiveDualFlamer(spawnPoint)
elseif techId == kTechId.DualMinigunExosuit then
exo = self:GiveDualExo(spawnPoint)
elseif techId == kTechId.DualWelderExosuit then
exo = self:GiveDualWelder(spawnPoint)
elseif techId == kTechId.WeldFlamerExosuit then
exo = self:GiveWelderFlamer(spawnPoint)
elseif techId == kTechId.DualRailgunExosuit then
exo = self:GiveDualRailgunExo(spawnPoint)
end



exo:TriggerEffects("spawn_exo")

return

end

end

Print("Error: Could not find a spawn point to place the Exo")

end
local function GetHostSupportsTechId(forPlayer, host, techId)

if Shared.GetCheatsEnabled() then
return true
end

local techFound = false

if host.GetItemList then

for index, supportedTechId in ipairs(host:GetItemList(forPlayer)) do

if supportedTechId == techId then

techFound = true
break

end

end

end

return techFound

end



local origattemptbuy = Marine.AttemptToBuy
function Marine:AttemptToBuy(techIds)

local techId = techIds[1]

/*
if techId == kTechId.JumpPack then
-- StartSoundEffectForPlayer(Marine.activatedsound, self)
-- self:AddResources(-GetCostForTech(techId))
self.hasjumppack = true
-- Print("Bought jump pack")
return true
elseif techId == kTechId.Resupply then
self.hasresupply = true
self:AdjustDisplayRessuply(self:GetClient():GetControllingPlayer(), 5, self.hasresupply)
-- Print("bought resupply boolean is %s", self.hasresupply)
return true
elseif techId == kTechId.HeavyArmor then
self.heavyarmor = true
self.lightarmor = false
return true
elseif techId == kTechId.FireBullets then
self.hasfirebullets = true
return true
elseif techId == kTechId.RegenArmor then
self.nanoarmor = true
return true
elseif techId == kTechId.WallWalk then
self.wallboots = true
return true
elseif techId == kTechId.LightArmor then
self.lightarmor = true
self.heavyarmor = false
return true
end
*/
local hostStructure = GetHostStructureFor(self, techId)

if hostStructure then

local mapName = LookupTechData(techId, kTechDataMapName)

if mapName then

Shared.PlayPrivateSound(self, Marine.kSpendResourcesSoundName, nil, 1.0, self:GetOrigin())

if self:GetTeam() and self:GetTeam().OnBought then
self:GetTeam():OnBought(techId)
end


if kIsExoTechId[techId] then
BuyExo(self, techId)
else
if hostStructure:isa("Armory") then self:AddResources(-GetCostForTech(techId)) end
origattemptbuy(self, techIds)
end
end
end


end


if Client then



local orig_Marine_UpdateGhostModel = Marine.UpdateGhostModel
function Marine:UpdateGhostModel()

orig_Marine_UpdateGhostModel(self)

self.currentTechId = nil

self.ghostStructureCoords = nil
self.ghostStructureValid = false
self.showGhostModel = false

local weapon = self:GetActiveWeapon()

if weapon then
if weapon:isa("LayStructures") then
self.currentTechId = weapon:GetDropStructureId()
self.ghostStructureCoords = weapon:GetGhostModelCoords()
self.ghostStructureValid = weapon:GetIsPlacementValid()
self.showGhostModel = weapon:GetShowGhostModel()
elseif weapon:isa("LayMines") then
self.currentTechId = kTechId.Mine
self.ghostStructureCoords = weapon:GetGhostModelCoords()
self.ghostStructureValid = weapon:GetIsPlacementValid()
self.showGhostModel = weapon:GetShowGhostModel()
end
end




end --function


function Marine:AddGhostGuide(origin, radius)

return

end




end -- client

@@ -0,0 +1,3 @@
function PowerPoint:CanBeCompletedByScriptActor(player)
return true
end
@@ -0,0 +1,116 @@
local function AlreadySpawned(self, origin)
local ents = GetEntitiesWithMixinForTeamWithinRange("Construct", 1, origin, 18)
if ents and #ents >= 4 then return true else return false end

end



function Conductor:SpawnBaseEntities()
--messy and mir-air. But whatever. Requires GetGroundPosition
local techPointOrigin = nil
local cc = GetEntitiesForTeam("CommandStructure", 1)
if cc and #cc > 0 and not techPointOrigin then
techPointOrigin = cc[1]:GetOrigin()
end

CreateEntity(InfantryPortal.kMapName, FindFreeSpace(techPointOrigin,4), 1)
CreateEntity(InfantryPortal.kMapName, FindFreeSpace(techPointOrigin,4), 1)
CreateEntity(Armory.kMapName, FindFreeSpace(techPointOrigin,4), 1)
CreateEntity(ArmsLab.kMapName, FindFreeSpace(techPointOrigin,4), 1)
CreateEntity(RoboticsFactory.kMapName, FindFreeSpace(techPointOrigin,4), 1)

-- CreateEntity(BaseMac.kMapName, FindFreeSpace(techPointOrigin,4), 1)
-- CreateEntity(BaseMac.kMapName, FindFreeSpace(techPointOrigin,4), 1)

-- CreateEntity(BigMac.kMapName, FindFreeSpace(techPointOrigin,4), 1)

CreateEntity(PrototypeLab.kMapName, FindFreeSpace(techPointOrigin,4), 1)
CreateEntity(PhaseAvoca.kMapName, FindFreeSpace(techPointOrigin,4), 1)
CreateEntity(PhaseGate.kMapName, FindFreeSpace(techPointOrigin,4), 1)
CreateEntity(Observatory.kMapName, FindFreeSpace(techPointOrigin,4), 1)

--if #cc < 3 then
-- SpawnChairThenSpawnBase(self)
-- end


end



/*
local function SpawnAlienHives(self)
local hive = nil
local hives = GetEntitiesForTeam("Hive", 2)
if hives and #hives == 1 then
hive = hives[1]:GetOrigin()
end

for i = 1, 2 do
if Server then
local techpoint = CreateEntity(TechPoint.kMapName, FindFreeSpace(hive, 8), nil)
local hive = techpoint:SpawnCommandStructure(2)
hive:SetConstructionComplete()
techpoint:SetIsVisible(false)
end

end
end
*/

/*

local function TrySomethingElse(self)
local cc = nil
local ccs = GetEntitiesForTeam("CommandStation", 1)
if ccs and #ccs == 1 then
cc = ccs[1]:GetOrigin()
end

for i = 1, 2 do
if Server then
local techpoint = CreateEntity(TechPoint.kMapName, FindFreeSpace(cc, 8), nil)
local chair = techpoint:SpawnCommandStructure(1)
chair:SetConstructionComplete()
techpoint:SetIsVisible(false)
end
end



local ccs = GetEntitiesForTeam("CommandStation", 1)
for i = 1, #ccs do
local chair = ccs[i]
local vaporizer = CreateEntity(Vaporizer.kMapName, chair:GetOrigin(), 1)
end


--self:SpawnBaseEntities(self, cc)

local hive = nil
local tech = nil
local techPoints = EntityListToTable(Shared.GetEntitiesWithClassname("TechPoint"))
for i=1, #techPoints do
tech = techPoints[i]
if tech:GetAttached() == nil then
local hive = tech:SpawnCommandStructure(2)
-- hive:SetConstructionComplete()
end
end


end

*/


if Server then
function Conductor:SpawnInitialStructures()
self:SpawnBaseEntities()
-- TrySomethingElse(self)
--SpawnAlienHives(self)
end
end


@@ -0,0 +1,87 @@
-- Kyle 'Avoca' Abent :P
--Inspired by 'Dragon' 'GorgeZilla' mod which led to 'Modelsize' in 'SiegeModCommands' which I wrote, also 'RTD' roll, etc.

function Embryo:OnAdjustModelCoords(coords)
---Adjust Embryo modelsize with gestation percentage
coords.origin = coords.origin - Embryo.kSkinOffset

local scale = Clamp(self.evolvePercentage / 100, .05, 1)
coords.xAxis = coords.xAxis * scale
coords.yAxis = coords.yAxis * scale
coords.zAxis = coords.zAxis * scale

return coords

end
/*
function RoboticsFactory:OnAdjustModelCoords(coords)

local scale = 0.5
coords.xAxis = coords.xAxis * scale
coords.yAxis = coords.yAxis * scale
coords.zAxis = coords.zAxis * scale

return coords

end
function ARC:OnAdjustModelCoords(coords)

local scale = not (self.avoca == true) and not self:GetInAttackMode() and 0.5 or 1
coords.xAxis = coords.xAxis * scale
coords.yAxis = coords.yAxis * scale
coords.zAxis = coords.zAxis * scale

return coords

end

function PrototypeLab:OnAdjustModelCoords(coords)

local scale = 0.5
coords.xAxis = coords.xAxis * scale
coords.yAxis = coords.yAxis * scale
coords.zAxis = coords.zAxis * scale

return coords

end
function Armory:OnAdjustModelCoords(coords)

local scale = 0.5
coords.xAxis = coords.xAxis * scale
coords.yAxis = coords.yAxis * scale
coords.zAxis = coords.zAxis * scale

return coords

end
function InfantryPortal:OnAdjustModelCoords(coords)

local scale = 0.5
coords.xAxis = coords.xAxis * scale
coords.yAxis = coords.yAxis * scale
coords.zAxis = coords.zAxis * scale

return coords

end

*/

/*
function LiveMixin:OnAdjustModelCoords(modelCoords)
local coords = modelCoords
if self:GetTeamNumber() == 2 and not self:isa("PowerDrainer") and not self:isa("Hive") then
local isplayer = self:isa("Alien")
local value = Clamp(self:GetHealthScalar(), .3, 1)
local scale = Clamp(value + (isplayer and .8 or 0), value, 1) --Because I dont want 70%hp to drop to 70% size
coords.xAxis = coords.xAxis * scale --But instead have the drop enable at 70% hp and be
coords.yAxis = coords.yAxis * scale -- 100% size at 70% hp, but at 60% hp be 90% size, etc.
coords.zAxis = coords.zAxis * scale
end

return coords
end
*/