| @@ -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,288 @@ | ||
|
|
||
| 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 | ||
|
|
||
|
|
||
| function Hive:UpdateAliensWeaponsManually() ///Seriously this makes more sense than spamming some complicated formula every 0.5 seconds no? | ||
| for _, alien in ientitylist(Shared.GetEntitiesWithClassname("Alien")) do | ||
| alien:HiveCompleteSoRefreshTechsManually() | ||
| end | ||
| 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) | ||
| 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 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,18 @@ | ||
|
|
||
| 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:AddResearchNode(kTechId.FlamethrowerRangeTech, kTechId.None) | ||
|
|
||
| self.techTree:SetComplete() | ||
| PlayingTeam.InitTechTree = orig_PlayingTeam_InitTechTree | ||
| end |
| @@ -0,0 +1,310 @@ | ||
| --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 = Marine.InitWeapons | ||
| function Marine:InitWeapons() | ||
| orig_Marine_InitWeapons(self) | ||
| self:GiveItem(Welder.kMapName) | ||
| self:SetQuickSwitchTarget(Pistol.kMapName) | ||
| self:SetActiveWeapon(Rifle.kMapName) | ||
| 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: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", storedWeaponsIds = self:GetWeaponsToStore() }) | ||
| return exo | ||
|
|
||
| end | ||
| function Marine:GiveDualFlamer(spawnPoint) | ||
|
|
||
| local exo = self:Replace(Exo.kMapName, self:GetTeamNumber(), false, spawnPoint, { layout = "FlamerFlamer", storedWeaponsIds = self:GetWeaponsToStore() }) | ||
| 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.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.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 | ||
|
|
| @@ -1,7 +1,3 @@ | ||
| function PowerPoint:CanBeCompletedByScriptActor(player) | ||
| return true | ||
| end | ||
| function UpdateAbilityAvailability(forAlien, tierOneTechId, tierTwoTechId, tierThreeTechId) | ||
|
|
||
| return | ||
| end |
| @@ -0,0 +1,91 @@ | ||
| // ======= Copyright (c) 2012, Unknown Worlds Entertainment, Inc. All rights reserved. ========== | ||
| // | ||
| // lua\GUILeftMinigunDisplay.lua | ||
| // | ||
| // Created by: Brian Cronin (brianc@unknownworlds.com) | ||
| // | ||
| // Displays the heat amount for the Exo's Minigun. | ||
| // | ||
| // ========= For more information, visit us at http://www.unknownworlds.com ===================== | ||
| local animHeatAmount = 0 | ||
| local animHeatDir = 1 | ||
| local background = nil | ||
| local foreground = nil | ||
| local foregroundMask = nil | ||
| local alertLight = nil | ||
| local time = 0 | ||
| local kTexture = "models/marine/exosuit/exosuit_view_panel_mini2.dds" | ||
| function UpdateOverHeat(dt, heatAmount) | ||
| PROFILE("GUILeftMinigunDisplay:Update") | ||
| foregroundMask:SetSize(Vector(242, 720 * (1 - heatAmount), 0)) | ||
| local alertColor = Color(1, 1, 1, 1) | ||
| if heatAmount > 0.5 then | ||
| animHeatAmount = animHeatAmount + ((animHeatDir * dt) * 10 * heatAmount) | ||
| if animHeatAmount > 1 then | ||
| animHeatAmount = 1 | ||
| animHeatDir = -1 | ||
| elseif animHeatAmount < 0 then | ||
| animHeatAmount = 0 | ||
| animHeatDir = 1 | ||
| end | ||
| alertColor = Color(heatAmount, animHeatAmount * (1 - ((heatAmount - 0.5) / 0.5)), 0, 1) | ||
| end | ||
| alertLight:SetColor(alertColor) | ||
| time = time + dt | ||
| end | ||
| function Initialize() | ||
| GUI.SetSize(242, 720) | ||
| background = GUI.CreateItem() | ||
| background:SetSize(Vector(242, 720, 0)) | ||
| background:SetPosition(Vector(0, 0, 0)) | ||
| background:SetTexturePixelCoordinates(0, 0, 230, 512) | ||
| background:SetTexture(kTexture) | ||
| foreground = GUI.CreateItem() | ||
| foreground:SetSize(Vector(230, 720, 0)) | ||
| foreground:SetPosition(Vector(0, 0, 0)) | ||
| foreground:SetTexturePixelCoordinates(300, 0, 512, 512) | ||
| foreground:SetTexture(kTexture) | ||
| foreground:SetStencilFunc(GUIItem.Equal) | ||
| foregroundMask = GUI.CreateItem() | ||
| foregroundMask:SetSize(Vector(242, 720, 0)) | ||
| foregroundMask:SetPosition(Vector(0, 0, 0)) | ||
| foregroundMask:SetIsStencil(true) | ||
| foregroundMask:SetClearsStencilBuffer(true) | ||
| foregroundMask:AddChild(foreground) | ||
| alertLight = GUI.CreateItem() | ||
| alertLight:SetSize(Vector(60, 720, 0)) | ||
| alertLight:SetPosition(Vector(0, 0, 0)) | ||
| alertLight:SetTexturePixelCoordinates(240, 0, 290, 512) | ||
| alertLight:SetTexture(kTexture) | ||
| background:AddChild(foregroundMask) | ||
| background:AddChild(alertLight) | ||
| end | ||
| Initialize() |
| @@ -0,0 +1,18 @@ | ||
| // ======= Copyright (c) 2012, Unknown Worlds Entertainment, Inc. All rights reserved. ========== | ||
| // | ||
| // lua\GUILeftMinigunDisplay.lua | ||
| // | ||
| // Created by: Brian Cronin (brianc@unknownworlds.com) | ||
| // | ||
| // Displays the heat amount for the Exo's Minigun. | ||
| // | ||
| // ========= For more information, visit us at http://www.unknownworlds.com ===================== | ||
| // Global state that can be externally set to adjust the display. | ||
| heatAmountleft = 0 | ||
| function Update(dt) | ||
| UpdateOverHeat(dt, heatAmountleft) | ||
| end | ||
| Script.Load("lua/ModularExo_GUIFlamer.lua") |
| @@ -0,0 +1,18 @@ | ||
| // ======= Copyright (c) 2012, Unknown Worlds Entertainment, Inc. All rights reserved. ========== | ||
| // | ||
| // lua\GUIRightMinigunDisplay.lua | ||
| // | ||
| // Created by: Andreas Urwalek(andi@unknownworlds.com) | ||
| // | ||
| // Displays the heat amount for the Exo's right Minigun. | ||
| // | ||
| // ========= For more information, visit us at http://www.unknownworlds.com ===================== | ||
| // Global state that can be externally set to adjust the display. | ||
| heatAmountright = 0 | ||
| function Update(dt) | ||
| UpdateOverHeat(dt, heatAmountright) | ||
| end | ||
| Script.Load("lua/ModularExo_GUIFlamer.lua") |
| @@ -0,0 +1,3 @@ | ||
| function Observatory:GetMinRangeAC() | ||
| return kScanRadius | ||
| end |
| @@ -0,0 +1,81 @@ | ||
| function PhaseGate:GetMinRangeAC() | ||
| return math.random(32, 54) | ||
| end | ||
|
|
||
|
|
||
| local function GetDestinationGate(self) | ||
| local phaseGates = {} | ||
| -- Find next phase gate to teleport to | ||
|
|
||
| if self:isa("PhaseAvoca") then | ||
|
|
||
| for index, ARC in ipairs( GetEntitiesForTeam("ARC", self:GetTeamNumber()) ) do | ||
| if ARC.avoca == true and GetIsUnitActive(ARC) then | ||
| return ARC | ||
| end | ||
| end | ||
|
|
||
| end | ||
|
|
||
| for index, phaseGate in ipairs( GetEntitiesForTeam("PhaseGate", self:GetTeamNumber()) ) do | ||
| if GetIsUnitActive(phaseGate) and not phaseGate:isa("PhaseAvoca") then | ||
| table.insert(phaseGates, phaseGate) | ||
| end | ||
| end | ||
|
|
||
|
|
||
|
|
||
| if table.count(phaseGates) < 2 then | ||
| return nil | ||
| end | ||
| -- Find our index and add 1 | ||
| local index = table.find(phaseGates, self) | ||
| if (index ~= nil) then | ||
|
|
||
| local nextIndex = ConditionalValue(index == table.count(phaseGates), 1, index + 1) | ||
| ASSERT(nextIndex >= 1) | ||
| ASSERT(nextIndex <= table.count(phaseGates)) | ||
| return phaseGates[nextIndex] | ||
|
|
||
| end | ||
|
|
||
| return nil | ||
| end | ||
|
|
||
| --So that we can teleport to the payload without having to run to it all the time :P | ||
| local function ComputeDestinationLocationId(self, destGate) | ||
|
|
||
| local destLocationId = Entity.invalidId | ||
| if destGate then | ||
|
|
||
| local location = GetLocationForPoint(destGate:GetOrigin()) | ||
| if location then | ||
| destLocationId = location:GetId() | ||
| end | ||
|
|
||
| end | ||
|
|
||
| return destLocationId | ||
|
|
||
| end | ||
| function PhaseGate:Update() | ||
|
|
||
| self.phase = (self.timeOfLastPhase ~= nil) and (Shared.GetTime() < (self.timeOfLastPhase + 0.3)) | ||
|
|
||
| local destinationPhaseGate = GetDestinationGate(self) | ||
| if destinationPhaseGate ~= nil and GetIsUnitActive(self) and self.deployed and (destinationPhaseGate.deployed or destinationPhaseGate:isa("ARC") ) then | ||
|
|
||
| self.destinationEndpoint = destinationPhaseGate:GetOrigin() | ||
| self.linked = true | ||
| self.targetYaw = destinationPhaseGate:GetAngles().yaw | ||
| self.destLocationId = ComputeDestinationLocationId(self, destinationPhaseGate) | ||
|
|
||
| else | ||
| self.linked = false | ||
| self.targetYaw = 0 | ||
| self.destLocationId = Entity.invalidId | ||
| end | ||
|
|
||
| return true | ||
|
|
||
| end |
| @@ -0,0 +1,71 @@ | ||
| local function SetLight(renderLight, intensity, color) | ||
|
|
||
| if intensity then | ||
| renderLight:SetIntensity(intensity) | ||
| end | ||
|
|
||
| if color then | ||
|
|
||
| renderLight:SetColor(color) | ||
|
|
||
| if renderLight:GetType() == RenderLight.Type_AmbientVolume then | ||
|
|
||
| renderLight:SetDirectionalColor(RenderLight.Direction_Right, color) | ||
| renderLight:SetDirectionalColor(RenderLight.Direction_Left, color) | ||
| renderLight:SetDirectionalColor(RenderLight.Direction_Up, color) | ||
| renderLight:SetDirectionalColor(RenderLight.Direction_Down, color) | ||
| renderLight:SetDirectionalColor(RenderLight.Direction_Forward, color) | ||
| renderLight:SetDirectionalColor(RenderLight.Direction_Backward, color) | ||
|
|
||
| end | ||
|
|
||
| end | ||
|
|
||
| end | ||
|
|
||
| local function RestoreColor(renderLight) | ||
|
|
||
| renderLight:SetColor(renderLight.originalColor) | ||
|
|
||
| if renderLight:GetType() == RenderLight.Type_AmbientVolume then | ||
|
|
||
| renderLight:SetDirectionalColor(RenderLight.Direction_Right, renderLight.originalRight) | ||
| renderLight:SetDirectionalColor(RenderLight.Direction_Left, renderLight.originalLeft) | ||
| renderLight:SetDirectionalColor(RenderLight.Direction_Up, renderLight.originalUp) | ||
| renderLight:SetDirectionalColor(RenderLight.Direction_Down, renderLight.originalDown) | ||
| renderLight:SetDirectionalColor(RenderLight.Direction_Forward, renderLight.originalForward) | ||
| renderLight:SetDirectionalColor(RenderLight.Direction_Backward, renderLight.originalBackward) | ||
|
|
||
| end | ||
|
|
||
| end | ||
|
|
||
| function PowerPointLightHandler:DiscoLights() | ||
| local purerandom = math.random(1,2) | ||
| local color = nil | ||
| if purerandom == 1 then | ||
| color = Color(math.random(0,255)/255, math.random(0,255)/255, math.random(0,255)/255, 1) | ||
| end | ||
| -- if self.timeofdisco == nil or (self.timeofdisco + 4) < Shared.GetTime() then | ||
| for renderLight,_ in pairs(self.lightTable) do | ||
| if purerandom == 2 then color = Color(math.random(0,255)/255, math.random(0,255)/255, math.random(0,255)/255, 1) end | ||
| local intensity = nil -- math.random(8,25) | ||
| SetLight(renderLight, intensity, color) | ||
| end | ||
| -- self.timeofdisco = Shared.GetTime() | ||
| -- end | ||
| end | ||
| function PowerPointLightHandler:RestoreColorDerp() | ||
| for renderLight,_ in pairs(self.lightTable) do | ||
| local color = nil | ||
| color = randomcolor | ||
| RestoreColor(renderLight) | ||
| end | ||
|
|
||
| end | ||
|
|
||
| function PowerPointLightHandler:SimpleLights() | ||
|
|
||
| self:DiscoLights() | ||
|
|
||
| end |
| @@ -0,0 +1,60 @@ | ||
| /* | ||
|
|
||
| function PowerPoint:OnAdjustModelCoords(modelCoords) | ||
| local coords = modelCoords | ||
| coords.xAxis = coords.xAxis * 2 | ||
| coords.yAxis = coords.yAxis * 1 | ||
| coords.zAxis = coords.zAxis * 2 | ||
| return coords | ||
| end | ||
|
|
||
| */ | ||
| local function FindNewParent(who) | ||
| local where = who:GetOrigin() | ||
| local player = GetNearest(where, "Player", 1, function(ent) return ent:GetIsAlive() end) | ||
| if player then | ||
| return player --who:SetOwner(player) | ||
| end | ||
| end | ||
|
|
||
| function PowerPoint:SpawnSurgeForEach(where, who) | ||
| local marine = FindNewParent(who) | ||
| local wherelocation = GetLocationForPoint(where) | ||
| wherelocation = wherelocation and wherelocation:GetName() or "" | ||
| if not wherelocation then return end | ||
|
|
||
| for _, eligable in ipairs(GetEntitiesWithMixinForTeamWithinRange("Construct", 2, where, 72)) do | ||
| -- if not eligable:isa("Harvester") and not eligable:isa("Cyst") and not eligable:isa("Hive") then --and not GetIsPointInMarineBase(eligable:GetOrigin()) then | ||
| local location = GetLocationForPoint(eligable:GetOrigin()) | ||
| local locationName = location and location:GetName() or "" | ||
| local sameLocation = locationName == wherelocation | ||
| if sameLocation then | ||
| eligable:DeductHealth(400, marine, nil, true, false, true) | ||
| eligable:TriggerEffects("arc_hit_primary") | ||
| end -- | ||
| -- end | ||
| end-- | ||
|
|
||
| end | ||
| local orig_PowerPoint_StopDamagedSound = PowerPoint.StopDamagedSound | ||
| function PowerPoint:StopDamagedSound() | ||
| orig_PowerPoint_StopDamagedSound(self) | ||
| if self:GetHealthScalar() ~= 1 then return end | ||
| self:SpawnSurgeForEach(self:GetOrigin(), self) | ||
| -- AddPayLoadTime(kTimeAddPowerBuilt) | ||
| -- local nearestHarvester = GetNearest(self:GetOrigin(), "Harvester", 2, function(ent) return LocationsMatch(self,ent) end) | ||
| -- if nearestHarvester then nearestHarvester:Kill() end | ||
| end | ||
|
|
||
| local orig_PowerPoint_OnKill = PowerPoint.OnKill | ||
| function PowerPoint:OnKill(attacker, doer, point, direction) | ||
| orig_PowerPoint_OnKill(self) | ||
| -- AddPayLoadTime(kTimeRemovePowerKilled) | ||
| --if not GetIsPointInMarineBase(self:GetOrigin()) then KillAllStructuresInLocation(self:GetOrigin(), 1) end | ||
|
|
||
| --local nearestExtractor = GetNearest(self:GetOrigin(), "Extractor", 1, function(ent) return LocationsMatch(self,ent) end) | ||
| -- if nearestExtractor then | ||
| -- nearestExtractor:Kill() | ||
| --end | ||
|
|
||
| end |
| @@ -0,0 +1,14 @@ | ||
| --derp | ||
|
|
||
| function PrototypeLab:GetMinRangeAC() | ||
| return 35 / 3 | ||
| end | ||
|
|
||
| local oldfunc = PrototypeLab.GetItemList | ||
| function PrototypeLab:GetItemList(forPlayer) | ||
| local otherbuttons = { kTechId.Jetpack, kTechId.DualMinigunExosuit, kTechId.DualRailgunExosuit, | ||
| kTechId.DualWelderExosuit, kTechId.DualFlamerExosuit} | ||
|
|
||
|
|
||
| return otherbuttons | ||
| end |
| @@ -0,0 +1,71 @@ | ||
|
|
||
| local function GetArcsAmount() | ||
| local total = 0 | ||
|
|
||
| for index, ARC in ientitylist(Shared.GetEntitiesWithClassname("ARC")) do | ||
| total = total + 1 | ||
| end | ||
| return total | ||
| end | ||
|
|
||
|
|
||
| /* | ||
| function RoboticsFactory:OnConstructionComplete() | ||
|
|
||
| self:UpgradeToTechId(kTechId.ARCRoboticsFactory) | ||
|
|
||
| end | ||
| */ | ||
|
|
||
| function RoboticsFactory:GetTechButtons(techId) | ||
|
|
||
| local techButtons = { kTechId.None, kTechId.None, kTechId.None, kTechId.None, | ||
| kTechId.None, kTechId.None, kTechId.None, kTechId.None } | ||
|
|
||
| if self:GetTechId() ~= kTechId.ARCRoboticsFactory then | ||
| techButtons[5] = kTechId.UpgradeRoboticsFactory | ||
| end | ||
| if GetArcsAmount() <= 11 then | ||
| techButtons[1] = kTechId.ARC | ||
| end | ||
| return techButtons | ||
|
|
||
| end | ||
|
|
||
| function RoboticsFactory:GetMinRangeAC() | ||
| return 54 / 2 | ||
| end | ||
|
|
||
|
|
||
| local kOpenSound = PrecacheAsset("sound/NS2.fev/marine/structures/roboticsfactory_open") | ||
| local kCloseSound = PrecacheAsset("sound/NS2.fev/marine/structures/roboticsfactory_close") | ||
|
|
||
|
|
||
| local function GetLocationsCount() | ||
| /* | ||
| local locations = {} | ||
| for _, location in ientitylist(Shared.GetEntitiesWithClassname("Location")) do | ||
| local locationName = location and location:GetName() or "" | ||
| table.insertunique(locations,locationName) | ||
| end | ||
|
|
||
| return table.count(locations) | ||
| */ | ||
| return 0 | ||
|
|
||
| end | ||
|
|
||
|
|
||
| if Server then | ||
| function RoboticsFactory:OnUpdate() | ||
| if self.timeOfLastMacCheck == nil or Shared.GetTime() > self.timeOfLastMacCheck + 8 then | ||
| if self:GetTechId() == kTechId.ARCRoboticsFactory and GetArcsAmount() <= 11 then | ||
| self:OverrideCreateManufactureEntity(kTechId.ARC) | ||
| --self:GetTeam():SetTeamResources(self:GetTeam():GetTeamResources() - cost) | ||
| end | ||
|
|
||
| self.timeOfLastMacCheck = Shared.GetTime() | ||
| end | ||
| end | ||
| end | ||
|
|
| @@ -0,0 +1,72 @@ | ||
| Script.Load("lua/Additions/CreditMixin.lua") | ||
| SentryBattery.kMarineCircleDecalName = PrecacheAsset("models/misc/circle/circle.material") | ||
|
|
||
| local networkVars = {} | ||
|
|
||
| AddMixinNetworkVars(CreditMixin, networkVars) | ||
|
|
||
|
|
||
| local originit = SentryBattery.OnInitialized | ||
| function SentryBattery:OnInitialized() | ||
| originit(self) | ||
| InitMixin(self, CreditMixin) | ||
| end | ||
|
|
||
| function SentryBattery:OnAdjustModelCoords(modelCoords) | ||
| local scale = 1.15 | ||
| local coords = modelCoords | ||
| coords.xAxis = coords.xAxis * scale | ||
| coords.yAxis = coords.yAxis * scale | ||
| coords.zAxis = coords.zAxis * scale | ||
|
|
||
| return coords | ||
|
|
||
| end | ||
|
|
||
| function SentryBattery:GetTechButtons(techId) | ||
|
|
||
| local techButtons = { kTechId.None, kTechId.None, kTechId.None, kTechId.None, | ||
| kTechId.None, kTechId.None, kTechId.None, kTechId.None } | ||
|
|
||
| return techButtons | ||
|
|
||
| end | ||
|
|
||
| local orig = SentryBattery.OnInitialized | ||
| function SentryBattery:OnInitialized() | ||
| orig(self) | ||
| if Client then self:AddPowerVisual() end | ||
| end | ||
|
|
||
|
|
||
|
|
||
| if Client then | ||
| function SentryBattery:AddPowerVisual() | ||
| local radius = 6 --kBatteryPowerRange | ||
| self.ghostGuides = Client.CreateRenderDecal() | ||
| self.ghostGuides.material = Client.CreateRenderMaterial() | ||
| local materialName = SentryBattery.kMarineCircleDecalName | ||
| self.ghostGuides:SetMaterial(materialName) | ||
| local coords = Coords.GetTranslation(self:GetOrigin()) | ||
| self.ghostGuides:SetCoords( coords ) | ||
| self.ghostGuides:SetExtents(Vector(1,1,1)*radius) | ||
| -- self.ghostGuides:SetIsVisible(false) | ||
| end | ||
|
|
||
| -- function SentryBattery:OnUpdate() | ||
| -- if self.ghostGuides then | ||
| -- local flashLightVisible = self:GetIsBuilt() | ||
| -- self.ghostGuides:SetIsVisible(flashLightVisible) | ||
| -- end | ||
| -- end | ||
|
|
||
| end | ||
| function SentryBattery:OnDestroy() | ||
|
|
||
| if self.ghostGuides then | ||
| Client.DestroyRenderMaterial(self.ghostGuides.material) | ||
| Client.DestroyRenderDecal(self.ghostGuides) | ||
| end | ||
| end | ||
|
|
||
| Shared.LinkClassToMap("SentryBattery", SentryBattery.kMapName, networkVars) |
| @@ -0,0 +1,30 @@ | ||
| function Sentry:GetFov() | ||
| return 360 | ||
| end | ||
| function Sentry:OnUpdateAnimationInput(modelMixin) | ||
|
|
||
| PROFILE("Sentry:OnUpdateAnimationInput") | ||
| modelMixin:SetAnimationInput("attack", self.attacking) | ||
| modelMixin:SetAnimationInput("powered", true) | ||
|
|
||
| end | ||
|
|
||
|
|
||
| if Server then | ||
| local origUpdate = Sentry.OnUpdate | ||
| function Sentry:OnUpdate(deltaTime) | ||
| origUpdate(self, deltaTime) | ||
| self.attachedToBattery = true | ||
| end | ||
|
|
||
| end | ||
|
|
||
| function Sentry:OnAdjustModelCoords(modelCoords) | ||
| local coords = modelCoords | ||
| local scale = 1.5 | ||
| coords.xAxis = coords.xAxis * scale | ||
| coords.yAxis = coords.yAxis * scale | ||
| coords.zAxis = coords.zAxis * scale | ||
|
|
||
| return coords | ||
| end |
| @@ -0,0 +1,46 @@ | ||
| Script.Load("lua/InfestationMixin.lua") | ||
|
|
||
|
|
||
| local networkVars = | ||
|
|
||
| { | ||
| shouldInk = "boolean", | ||
| lastInk = "time", | ||
| } | ||
|
|
||
| AddMixinNetworkVars(InfestationMixin, networkVars) | ||
|
|
||
| local origInit = Shade.OnInitialized | ||
|
|
||
| function Shade:OnInitialized() | ||
| origInit(self) | ||
| self.lastInk = 0 | ||
| self.shouldInk = false | ||
| InitMixin(self, InfestationMixin) | ||
| end | ||
|
|
||
|
|
||
| function Shade:GetInfestationRadius() | ||
| return kInfestationRadius | ||
| end | ||
|
|
||
| function Shade:GetMinRangeAC() | ||
| return 17 | ||
| end | ||
|
|
||
| if Server then | ||
|
|
||
|
|
||
| function Shade:OnUpdate(deltaTime) | ||
| if self.shouldInk and GetIsTimeUp(self.lastInk, kShadeInkCooldown) then | ||
| CreateEntity(ShadeInk.kMapName, self:GetOrigin() + Vector(0, 0.2, 0), 2) | ||
| self.lastInk = Shared.GetTime() | ||
| self:GetTeam():SetTeamResources(self:GetTeam():GetTeamResources() - LookupTechData(kTechId.ShadeInk, kTechDataCostKey)) | ||
| self.shouldInk = false | ||
| end | ||
|
|
||
| end | ||
|
|
||
| end | ||
|
|
||
| Shared.LinkClassToMap("Shade", Shade.kMapName, networkVars) |
| @@ -0,0 +1,161 @@ | ||
| Script.Load("lua/InfestationMixin.lua") | ||
|
|
||
| local networkVars = | ||
|
|
||
| { | ||
| } | ||
|
|
||
|
|
||
| AddMixinNetworkVars(InfestationMixin, networkVars) | ||
|
|
||
| local originit = Shift.OnInitialized | ||
| function Shift:OnInitialized() | ||
| originit(self) | ||
| InitMixin(self, InfestationMixin) | ||
| end | ||
|
|
||
| function Shift:GetInfestationRadius() | ||
| return kInfestationRadius | ||
| end | ||
|
|
||
| function Shift:GetMinRangeAC() | ||
| return 14 | ||
| end | ||
|
|
||
| Shared.LinkClassToMap("Shift", Shift.kMapName, networkVars) | ||
| /* | ||
| Script.Load("lua/Additions/SaltMixin.lua") | ||
| Script.Load("lua/InfestationMixin.lua") | ||
|
|
||
| local networkVars = {calling = "boolean", receiving = "boolean"} | ||
|
|
||
| AddMixinNetworkVars(InfestationMixin, networkVars) | ||
| local origcreate = Shift.OnCreate | ||
| function Shift:OnCreate() | ||
| origcreate(self) | ||
| InitMixin(self, SaltMixin) | ||
| end | ||
|
|
||
|
|
||
|
|
||
|
|
||
| local originit = Shift.OnInitialized | ||
| function Shift:OnInitialized() | ||
| originit(self) | ||
| self.calling = false | ||
| self.receiving = false | ||
| InitMixin(self, InfestationMixin) | ||
| end | ||
| function Shift:GetInfestationRadius() | ||
| if self:GetIsACreditStructure() then | ||
| return 1 | ||
| else | ||
| return 0 | ||
| end | ||
| end | ||
|
|
||
| function Shift:AutoCommCall() | ||
| -- if GetSiegeDoorOpen() then self.calling = false end | ||
| if not self.calling then return end | ||
| --Maybe require 0 struct to to receive and x+ to call? or as is :p | ||
| if GetIsOriginInHiveRoom(self:GetOrigin()) then return end --Maybe disable later? hm. | ||
| local location = GetLocationForPoint(self:GetOrigin()) | ||
| local conslocation = nil | ||
| local constructs = GetEntitiesWithMixinForTeamWithinRange("Construct", 2, self:GetOrigin(), 72) | ||
| if not constructs then return end | ||
| for _, construct in ipairs(constructs) do | ||
| if construct.GetCanShiftCallRec and construct:GetCanShiftCallRec() then | ||
| conslocation = GetLocationForPoint(construct:GetOrigin()) | ||
| if construct ~= self and self:GetDistance(construct) > kEchoRange and conslocation == location then | ||
| construct:GiveOrder(kTechId.Move, self:GetId(), FindFreeSpace(self:GetOrigin(), .5, 7), nil, true, true) | ||
| end | ||
| end | ||
| end | ||
| end | ||
| function Shift:GetCanShiftCallRec() | ||
| return self:GetIsBuilt() and not self.receiving | ||
| end | ||
| function Shift:GetUnitNameOverride(viewer) | ||
| local unitName = GetDisplayName(self) | ||
| if self.calling then | ||
| unitName = string.format(Locale.ResolveString("%s (Calling!)"), unitName) | ||
| elseif self.receiving then | ||
| unitName = string.format(Locale.ResolveString("%s (Receiving!!)"), unitName) | ||
| end | ||
| return unitName | ||
| end | ||
|
|
||
| function Shift:CheckForAndActOn() -- Insta Teleport with 0 tres cost OP? Add limit? Time Delay? if 12 then take 3 at a time? | ||
| --Print("Calling 3") | ||
| local receivingOrigin = nil | ||
| local origins = {} | ||
|
|
||
| for _, entity in ientitylist(Shared.GetEntitiesWithClassname("Shift")) do | ||
| if entity.receiving then table.insert(origins, entity:GetOrigin()) end --Print("Calling 4") break end | ||
| end | ||
|
|
||
|
|
||
| for _, entity in ientitylist(Shared.GetEntitiesWithClassname("Contamination")) do | ||
| -- local ARC = #GetEntitiesWithinRange( "ARC", entity:GetOrigin(), 18 ) | ||
| -- if not ARC then | ||
| table.insert(origins, entity:GetOrigin()) | ||
| -- end | ||
| end | ||
|
|
||
| receivingOrigin = table.random(origins) | ||
|
|
||
| if not receivingOrigin then return end | ||
| --Print("Calling 5") | ||
| local eligable = {} | ||
| local teleportAbles = GetEntitiesWithMixinForTeamWithinRange("Construct", 2, self:GetOrigin(), kEchoRange) | ||
| if not teleportAbles then return end | ||
| for _, teleportable in ipairs(teleportAbles) do | ||
| if teleportable.GetCanShiftCallRec and teleportable:GetCanShiftCallRec() and self ~= teleportable then | ||
| table.insert(eligable, teleportable) | ||
| end | ||
| end | ||
|
|
||
|
|
||
| for _, egg in ipairs(GetEntitiesForTeamWithinRange("Egg", 2, self:GetOrigin(), kEchoRange)) do | ||
| if egg then table.insert(eligable, egg) end | ||
| end | ||
| --Print("Calling 6") | ||
| for _, teleportable in ipairs(eligable) do | ||
|
|
||
| --Print("Calling 7") | ||
| teleportable:SetOrigin( FindFreeSpace(receivingOrigin, 1, kEchoRange, true)) | ||
| if HasMixin(teleportable, "Orders") then | ||
| -- Print("Calling 8") | ||
| teleportable:ClearCurrentOrder() | ||
| end | ||
| -- Print("Calling 9") | ||
| success = true | ||
| self.echoActive = true | ||
| end | ||
| if success then self:TriggerEffects("shift_echo") end | ||
| self.echoActive = false -- ? | ||
|
|
||
| end | ||
| local origupdate = Shift.OnUpdate | ||
| function Shift:OnUpdate(deltaTime) | ||
| origupdate(self, deltaTime) | ||
| if Server then | ||
| if self.calling then | ||
| --Print("Calling 1") | ||
| if not self.timelastCallCheck or self.timelastCallCheck + 4 < Shared.GetTime() then | ||
| self:CheckForAndActOn() | ||
| self.timelastCallCheck = Shared.GetTime() | ||
| -- Print("Calling 2") | ||
| end | ||
| --elseif self.receiving then | ||
|
|
||
| end | ||
| end | ||
| end | ||
|
|
||
| */ | ||
|
|
||
|
|
||
|
|
||
|
|
||
| --Shared.LinkClassToMap("Shift", Shift.kMapName, networkVars) |
| @@ -0,0 +1,123 @@ | ||
| --Kyle 'Avoca' Abent | ||
| //Well I am copying everything, you know. But I like my name cause it's a good one. | ||
| local networkVars = {lastswitch = "private time", nextangle = "private integer (0 to 8)", lockedId = "entityid"} | ||
| class 'AvocaSpectator' (Spectator) | ||
| AvocaSpectator.kMapName = "Spectator" | ||
| --AvocaSpectator.kModelName = PrecacheAsset("models/alien/fade/fade.model") | ||
| function AvocaSpectator:OnInitialized() | ||
| Spectator.OnInitialized(self) | ||
| end | ||
| function AvocaSpectator:GetControllerPhysicsGroup() | ||
| return PhysicsGroup.BigPlayerControllersGroup | ||
| end | ||
| function AvocaSpectator:OnCreate() | ||
| Spectator.OnCreate(self) | ||
| self.lastswitch = Shared.GetTime() | ||
| if Server then | ||
| self:AddTimedCallback( AvocaSpectator.UpdateCamera, 1 ) | ||
| end | ||
| self.nextangle = math.random(4,8) | ||
| self.lockedId = Entity.invalidI | ||
| end | ||
| function AvocaSpectator:SetLockOnTarget(userid) | ||
| self.lockedId = userid | ||
| end | ||
| function AvocaSpectator:BreakChains() | ||
| self.lockedId = Entity.invalidI | ||
| end | ||
| function AvocaSpectator:LockAngles() | ||
| local playerOfLock = Shared.GetEntity( self.lockedId ) | ||
| if playerOfLock ~= nil then | ||
| if (playerOfLock.GetIsAlive and playerOfLock:GetIsAlive()) then | ||
| local dir = GetNormalizedVector(playerOfLock:GetOrigin() - self:GetOrigin()) | ||
| local angles = Angles(GetPitchFromVector(dir), GetYawFromVector(dir), 0) | ||
| self:SetOffsetAngles(angles) | ||
| end | ||
| end | ||
| end | ||
| function AvocaSpectator:ChangeView(self, untilNext, betweenLast) | ||
| --Shine | ||
| end | ||
| function AvocaSpectator:LockAnglesTarget(who) | ||
| end | ||
| function AvocaSpectator:UnlockAngles() | ||
| end | ||
| function AvocaSpectator:OnEntityChange(oldId) | ||
| if self.lockedId == oldId then | ||
| self.lockedId = Entity.invalidId | ||
| self.lastswitch = Shared.GetTime() | ||
| self.nextangle = math.random(4,8) | ||
| self:ChangeView(self, self.nextangle, self.lastswitch ) | ||
| end | ||
| end | ||
| local function GetCDistance(target) | ||
| local dist = 5 | ||
| if target:isa("CommandStructure") then | ||
| dist = 8 | ||
| elseif target:isa("Contamination") then | ||
| dist = 3 | ||
| elseif target:isa("Marine") then | ||
| dist = 4 | ||
| elseif target:isa("Whip") then | ||
| dist = 5 | ||
| elseif target:isa("Shift") then | ||
| dist = 5 | ||
| end | ||
| return dist | ||
| end | ||
| function AvocaSpectator:OverrideInput(input) | ||
| ClampInputPitch(input) | ||
| //Attempts of Zooming in when outside radius | ||
| if self.lockedId ~= Entity.invalidI then | ||
| local target = Shared.GetEntity( self.lockedId ) | ||
| if target and ( target.GetIsAlive and target:GetIsAlive() ) then | ||
| if target:isa("Contamination") then input.move.x = input.move.x + 0.15 end | ||
| local distance = self:GetDistance(target) | ||
| if distance >= GetCDistance(target) then | ||
| // Print("Distance %s lastzoom %s", distance, self.lastzoom) //debug my ass | ||
| input.move.z = input.move.z + 0.5 | ||
| local ymove = 0 | ||
| local myY = self:GetOrigin().y | ||
| local urY = target:GetOrigin().y | ||
| local difference = urY - myY | ||
| if difference == 0 then | ||
| ymove = difference | ||
| elseif difference <= -1 then | ||
| ymove = -1 | ||
| elseif difference >= 1 then | ||
| ymove = 1 | ||
| end | ||
| input.move.y = input.move.y + (ymove) | ||
| elseif distance <= 1.8 then | ||
| input.move.z = input.move.z - 1 | ||
| // Print(" new distance is %s, new lastzoom is %s", distance, self.lastzoom) | ||
| end | ||
| end | ||
| end | ||
| return input | ||
| end | ||
| function AvocaSpectator:UpdateCamera() | ||
| self:LockAngles() | ||
| if GetIsTimeUp(self.lastswitch, self.nextangle ) then | ||
| -- Print("AvocaSpectator ChangeView") | ||
| self.nextangle = math.random(4,8) | ||
| self.lastswitch = Shared.GetTime() | ||
| self:ChangeView(self, self.nextangle, self.lastswitch ) | ||
| end | ||
| return true | ||
| end | ||
| Shared.LinkClassToMap("AvocaSpectator", AvocaSpectator.kMapName, networkVars) |
| @@ -0,0 +1 @@ | ||
| Script.Load("lua/TMckenna/Shared.lua") |
| @@ -0,0 +1 @@ | ||
| Script.Load("lua/TMckenna/Shared.lua") |
| @@ -0,0 +1 @@ | ||
| Script.Load("lua/TMckenna/Shared.lua") |
| @@ -1,6 +1,5 @@ | ||
| Script.Load("lua/AvocaClasses/Load.lua") | ||
| Script.Load("lua/ClassMods/LoadMoar.lua") | ||
| Script.Load("lua/Additions/Additions.lua") | ||
| Script.Load("lua/ClassMods/LoadMoar.lua") | ||
| Script.Load("lua/Overwrites/Overwrites.lua") | ||
| Script.Load("lua/Modifications/Modifications.lua") | ||
|
|
| @@ -0,0 +1,245 @@ | ||
| --Script.Load("lua/Weapons/Alien/PrimalScream.lua") | ||
| --Script.Load("lua/Additions/OnoGrow.lua") | ||
| --Script.Load("lua/Additions/Onocide.lua") | ||
| --Script.Load("lua/Additions/CragUmbra.lua") | ||
| --Script.Load("lua/Additions/CommVortex.lua") | ||
| --Script.Load("lua/Weapons/Alien/AcidRocket.lua") | ||
| --Script.Load("lua/Additions/LerkBileBomb.lua") | ||
| --Script.Load("lua/Additions/LayStructures.lua") | ||
| Script.Load("lua/Additions/ExoWelder.lua") | ||
| Script.Load("lua/Additions/ExoFlamer.lua") | ||
| Script.Load("lua/Additions/EggBeacon.lua") | ||
| Script.Load("lua/Additions/StructureBeacon.lua") | ||
|
|
||
|
|
||
|
|
||
| local kAvoca_TechData = | ||
| { | ||
|
|
||
|
|
||
|
|
||
|
|
||
| { [kTechDataId] = kTechId.DualWelderExosuit, | ||
| [kTechIDShowEnables] = false, | ||
| [kTechDataDisplayName] = "Dual Exo Welders", | ||
| [kTechDataMapName] = "exo", | ||
| [kTechDataCostKey] = kDualExosuitCost - 10, | ||
| [kTechDataHotkey] = Move.E, | ||
| [kTechDataTooltipInfo] = "Dual Welders yo", | ||
| [kTechDataSpawnHeightOffset] = kCommanderEquipmentDropSpawnHeight}, | ||
|
|
||
|
|
||
| { [kTechDataId] = kTechId.DualFlamerExosuit, | ||
| [kTechIDShowEnables] = false, | ||
| [kTechDataDisplayName] = "Dual Exo Flamer", | ||
| [kTechDataMapName] = "exo", | ||
| [kTechDataCostKey] = kDualExosuitCost - 5, | ||
| [kTechDataHotkey] = Move.E, | ||
| [kTechDataTooltipInfo] = "Dual Welders yo", | ||
| [kTechDataSpawnHeightOffset] = kCommanderEquipmentDropSpawnHeight}, | ||
|
|
||
|
|
||
| /* | ||
| { [kTechDataId] = kTechId.DamageResistance, | ||
| [kTechDataCategory] = kTechId.ShiftHiveTwo, | ||
| [kTechDataDisplayName] = "Damage Resistance", | ||
| [kTechDataSponitorCode] = "A", | ||
| [kTechDataCostKey] = kDamageResistanceCost, | ||
| [kTechDataTooltipInfo] = "5% damage resistance", }, | ||
| */ | ||
|
|
||
|
|
||
| /* | ||
| { [kTechDataId] = kTechId.ThickenedSkin, | ||
| [kTechDataCategory] = kTechId.ShiftHiveTwo, | ||
| [kTechDataDisplayName] = "Thickened Skin", | ||
| [kTechDataSponitorCode] = "A", | ||
| [kTechDataCostKey] = kThickenedSkinCost, | ||
| [kTechDataTooltipInfo] = "Another layer of +hp for each biomass level", }, | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| { [kTechDataId] = kTechId.Hunger, | ||
| [kTechDataCategory] = kTechId.CragHiveTwo, | ||
| [kTechDataDisplayName] = "Hunger", | ||
| [kTechDataSponitorCode] = "B", | ||
| [kTechDataCostKey] = kHungerCost, | ||
| [kTechDataTooltipInfo] = "10% health / energy gain, and effects of Enzyme on player kill (if gorge then structures not players) ", }, | ||
|
|
||
| */ | ||
|
|
||
|
|
||
|
|
||
| /* | ||
| { [kTechDataId] = kTechId.JumpPack, | ||
| [kTechDataCostKey] = kJumpPackCost, | ||
| [kTechDataDisplayName] = "Jump Pack", | ||
| [kTechDataHotkey] = Move.Z, | ||
| [kTechDataTooltipInfo] = "Mimics the NS1/HL1 JumpPack (With Attempted Balance Modifications WIP) - Press DUCK + Jump @ the same time to mindfuck the alien team."}, | ||
|
|
||
|
|
||
|
|
||
| { [kTechDataId] = kTechId.Rebirth, | ||
| [kTechDataCategory] = kTechId.CragHiveTwo, | ||
| [kTechDataDisplayName] = "Rebirth", | ||
| [kTechDataSponitorCode] = "A", | ||
| [kTechDataCostKey] = kRebirthCost, | ||
| [kTechDataTooltipInfo] = "Replaces death with gestation if cooldown is reached", }, | ||
|
|
||
| // Lifeform purchases | ||
| { [kTechDataId] = kTechId.Redemption, | ||
| [kTechDataCategory] = kTechId.CragHiveTwo, | ||
| [kTechDataDisplayName] = "Redemption", | ||
| [kTechDataSponitorCode] = "B", | ||
| [kTechDataCostKey] = kRedemptionCost, | ||
| [kTechDataTooltipInfo] = "a 3 second timer checks if your health is a random value less than or equal to 15-30% of your max hp. If so, then randomly tp to a egg spawn 1-4 seconds after.", }, | ||
|
|
||
|
|
||
|
|
||
|
|
||
| { [kTechDataId] = kTechId.AcidRocket, | ||
| [kTechDataCategory] = kTechId.Fade, | ||
| [kTechDataMapName] = AcidRocket.kMapName, | ||
| [kTechDataCostKey] = kStabResearchCost, | ||
| [kTechDataResearchTimeKey] = kStabResearchTime, | ||
| [kTechDataDamageType] = kDamageType.Corrode, | ||
| [kTechDataDisplayName] = "AcidRocket", | ||
| [kTechDataTooltipInfo] = "Ranged Projectile dealing damage only to armor and structures"}, | ||
|
|
||
| { [kTechDataId] = kTechId.LerkBileBomb, | ||
| [kTechDataCategory] = kTechId.Lerk, | ||
| [kTechDataMapName] = LerkBileBomb.kMapName, | ||
| [kTechDataCostKey] = kStabResearchCost, | ||
| [kTechDataResearchTimeKey] = kStabResearchTime, | ||
| [kTechDataDamageType] = kDamageType.Corrode, | ||
| [kTechDataDisplayName] = "LerkBileBomb", | ||
| [kTechDataTooltipInfo] = "Derp"}, | ||
|
|
||
|
|
||
|
|
||
| { [kTechDataId] = kTechId.CommVortex, | ||
| [kTechDataMapName] = CommVortex.kMapName, | ||
| [kTechDataAllowStacking] = true, | ||
| [kTechDataIgnorePathingMesh] = true, | ||
| [kTechDataCollideWithWorldOnly] = true, | ||
| [kTechDataRequiresInfestation] = true, | ||
| [kTechDataDisplayName] = "Etheral Gate", | ||
| [kTechDataCostKey] = kCommVortexCost, | ||
| [kTechDataCooldown] = kCommVortexCoolDown, | ||
| [kTechDataTooltipInfo] = "Temporarily places marine structures/macs/arcs in another dimension rendering them unable to function correctly. "}, | ||
| */ | ||
| /* | ||
|
|
||
| { [kTechDataId] = kTechId.CragUmbra, | ||
| [kTechDataDisplayName] = "UMBRA", | ||
| --[kVisualRange] = Crag.kHealRadius, | ||
| [kTechDataCooldown] = kCragUmbraCooldown, | ||
| [kTechDataCostKey] = kCragUmbraCost, | ||
| [kTechDataTooltipInfo] = "CRAG_UMBRA_TOOLTIP"}, | ||
|
|
||
|
|
||
|
|
||
|
|
||
|
|
||
| { [kTechDataId] = kTechId.OnoGrow, | ||
| [kTechDataCategory] = kTechId.Onos, | ||
| [kTechDataMapName] = OnoGrow.kMapName, | ||
| [kTechDataCostKey] = kStabResearchCost, | ||
| [kTechDataResearchTimeKey] = kStabResearchTime, | ||
| -- [kTechDataDamageType] = kStabDamageType, | ||
| [kTechDataDisplayName] = "OnoGrow", | ||
| [kTechDataTooltipInfo] = "wip"}, | ||
|
|
||
| { [kTechDataId] = kTechId.Onocide, | ||
| [kTechDataCategory] = kTechId.Onos, | ||
| [kTechDataMapName] = Onocide.kMapName, | ||
| [kTechDataCostKey] = 10, | ||
| [kTechDataResearchTimeKey] = 10, | ||
| -- [kTechDataDamageType] = kStabDamageType, | ||
| [kTechDataDisplayName] = "Onicide", | ||
| [kTechDataTooltipInfo] = "wip"}, | ||
|
|
||
| */ | ||
|
|
||
|
|
||
|
|
||
|
|
||
| { [kTechDataId] = kTechId.EggBeacon, | ||
| [kTechDataCooldown] = kEggBeaconCoolDown, | ||
| [kTechDataTooltipInfo] = "Eggs Spawn approximately at the placed Egg Beacon. Be careful as infestation is required.", | ||
| [kTechDataGhostModelClass] = "AlienGhostModel", | ||
| [kTechDataBuildRequiresMethod] = GetCheckEggBeacon, | ||
| [kTechDataMapName] = EggBeacon.kMapName, | ||
| [kTechDataDisplayName] = "Egg Beacon", | ||
| [kTechDataCostKey] = kEggBeaconCost, | ||
| [kTechDataRequiresInfestation] = true, | ||
| [kTechDataHotkey] = Move.C, | ||
| [kTechDataBuildTime] = kEggBeaconBuildTime, | ||
| [kTechDataModel] = EggBeacon.kModelName, | ||
| [kTechDataBuildMethodFailedMessage] = "1 at a time not in siege", | ||
| [kVisualRange] = 8, | ||
| [kTechDataMaxHealth] = kEggBeaconHealth, [kTechDataMaxArmor] = kEggBeaconArmor}, | ||
|
|
||
|
|
||
| { [kTechDataId] = kTechId.StructureBeacon, | ||
| [kTechDataCooldown] = kStructureBeaconCoolDown, | ||
| [kTechDataTooltipInfo] = "Structures move approximately at the placed location", | ||
| [kTechDataGhostModelClass] = "AlienGhostModel", | ||
| [kTechDataMapName] = StructureBeacon.kMapName, | ||
| [kTechDataDisplayName] = "Structure Beacon", [kTechDataCostKey] = kStructureBeaconCost, | ||
| [kTechDataRequiresInfestation] = true, [kTechDataHotkey] = Move.C, | ||
| [kTechDataBuildTime] = kStructureBeaconBuildTime, | ||
| [kTechDataModel] = StructureBeacon.kModelName, | ||
| [kTechDataBuildMethodFailedMessage] = "1 at a time not in siege", | ||
| [kVisualRange] = 8, | ||
| [kTechDataMaxHealth] = kStructureBeaconHealth, [kTechDataMaxArmor] = kStructureBeaconArmor}, | ||
|
|
||
|
|
||
| /* | ||
|
|
||
| --Thanks dragon ns2c | ||
| { [kTechDataId] = kTechId.PrimalScream, | ||
| [kTechDataCategory] = kTechId.Lerk, | ||
| [kTechDataDisplayName] = "Primal Scream", | ||
| [kTechDataMapName] = Primal.kMapName, | ||
| --[kTechDataCostKey] = kPrimalScreamCostKey, | ||
| -- [kTechDataResearchTimeKey] = kPrimalScreamTimeKey, | ||
| [kTechDataTooltipInfo] = "+Energy to teammates, enzyme cloud"}, | ||
|
|
||
|
|
||
| */ | ||
|
|
||
|
|
||
|
|
||
|
|
||
| } | ||
|
|
||
|
|
||
|
|
||
| local buildTechData = BuildTechData | ||
| function BuildTechData() | ||
|
|
||
| local defaultTechData = buildTechData() | ||
| local moddedTechData = {} | ||
| local usedTechIds = {} | ||
|
|
||
| for i = 1, #kAvoca_TechData do | ||
| local techEntry = kAvoca_TechData[i] | ||
| table.insert(moddedTechData, techEntry) | ||
| table.insert(usedTechIds, techEntry[kTechDataId]) | ||
| end | ||
|
|
||
| for i = 1, #defaultTechData do | ||
| local techEntry = defaultTechData[i] | ||
| if not table.contains(usedTechIds, techEntry[kTechDataId]) then | ||
| table.insert(moddedTechData, techEntry) | ||
| end | ||
| end | ||
|
|
||
| return moddedTechData | ||
|
|
||
| end | ||
|
|
||
|
|
| @@ -0,0 +1,61 @@ | ||
| --thank you last stand | ||
| local gTechIdToString = {} | ||
|
|
||
| local function createTechIdEnum(table) | ||
|
|
||
| for i = 1, #table do | ||
| gTechIdToString[table[i]] = i | ||
| end | ||
|
|
||
| return enum(table) | ||
|
|
||
| end | ||
|
|
||
| function StringToTechId(string) | ||
| return gTechIdToString[string] or kTechId.None | ||
| end | ||
|
|
||
| local techIdStrings = {} | ||
|
|
||
| for i = 1, #kTechId do | ||
| if kTechId[i] ~= "Max" then | ||
| table.insert(techIdStrings, kTechId[i]) | ||
| end | ||
| end | ||
|
|
||
| local kAvoca_TechIds = | ||
| { | ||
| -- 'PrimalScream', | ||
| -- 'EggBeacon', | ||
| -- 'StructureBeacon', | ||
| -- 'OnoGrow', | ||
| -- 'CommVortex', | ||
| -- 'AcidRocket', | ||
| -- 'Redemption', | ||
| -- 'Rebirth', | ||
| -- 'CragHiveTwo', | ||
| -- 'ThickenedSkin', | ||
| -- 'Hunger', | ||
| -- 'ShiftHiveTwo', | ||
| -- 'LayStructures', | ||
| -- 'Onocide', | ||
| 'DualWelderExosuit', | ||
| 'DualFlamerExosuit', | ||
| -- 'LerkBileBomb', | ||
| -- 'ElectrifyStructure', | ||
| -- 'HeavyArmor', | ||
| -- 'Resupply', | ||
| 'StructureBeacon', | ||
| 'EggBeacon', | ||
|
|
||
|
|
||
| } | ||
|
|
||
| for i = 1, #kAvoca_TechIds do | ||
| table.insert(techIdStrings, kAvoca_TechIds[i]) | ||
| end | ||
|
|
||
| techIdStrings[#techIdStrings + 1] = 'Max' | ||
|
|
||
| kTechId = createTechIdEnum(techIdStrings) | ||
| kTechIdMax = kTechId.Max |
| @@ -0,0 +1,62 @@ | ||
| //derp | ||
|
|
||
| local kDualWelderModelName = PrecacheAsset("models/marine/exosuit/exosuit_rr.model") | ||
| local kDualWelderAnimationGraph = PrecacheAsset("models/marine/exosuit/exosuit_rr.animation_graph") | ||
|
|
||
|
|
||
| if Server then | ||
| function ExoWeaponHolder:SetFlamerWeapons() | ||
|
|
||
|
|
||
| if self.leftWeaponId ~= Entity.invalidId then | ||
| DestroyEntity(Shared.GetEntity(self.leftWeaponId)) | ||
| end | ||
| local leftWeapon = CreateEntity(ExoFlamer.kMapName, Vector(), self:GetTeamNumber()) | ||
| leftWeapon:SetParent(self:GetParent()) | ||
| leftWeapon:SetExoWeaponSlot(ExoWeaponHolder.kSlotNames.Left) | ||
| self.leftWeaponId = leftWeapon:GetId() | ||
|
|
||
| if self.rightWeaponId ~= Entity.invalidId then | ||
| DestroyEntity(Shared.GetEntity(self.rightWeaponId)) | ||
| end | ||
| local rightWeapon = CreateEntity(ExoFlamer.kMapName, Vector(), self:GetTeamNumber()) | ||
| rightWeapon:SetParent(self:GetParent()) | ||
| rightWeapon:SetExoWeaponSlot(ExoWeaponHolder.kSlotNames.Right) | ||
| self.rightWeaponId = rightWeapon:GetId() | ||
|
|
||
| self.weaponSetupName = Railgun.kMapName .. "+" .. Railgun.kMapName | ||
|
|
||
| if self:GetIsActive() then | ||
| local player = self:GetParent() | ||
| player:SetViewModel(self:GetViewModelName(), self) | ||
| end | ||
|
|
||
| end | ||
| function ExoWeaponHolder:SetWelderWeapons() | ||
|
|
||
|
|
||
| if self.leftWeaponId ~= Entity.invalidId then | ||
| DestroyEntity(Shared.GetEntity(self.leftWeaponId)) | ||
| end | ||
| local leftWeapon = CreateEntity(ExoWelder.kMapName, Vector(), self:GetTeamNumber()) | ||
| leftWeapon:SetParent(self:GetParent()) | ||
| leftWeapon:SetExoWeaponSlot(ExoWeaponHolder.kSlotNames.Left) | ||
| self.leftWeaponId = leftWeapon:GetId() | ||
|
|
||
| if self.rightWeaponId ~= Entity.invalidId then | ||
| DestroyEntity(Shared.GetEntity(self.rightWeaponId)) | ||
| end | ||
| local rightWeapon = CreateEntity(ExoWelder.kMapName, Vector(), self:GetTeamNumber()) | ||
| rightWeapon:SetParent(self:GetParent()) | ||
| rightWeapon:SetExoWeaponSlot(ExoWeaponHolder.kSlotNames.Right) | ||
| self.rightWeaponId = rightWeapon:GetId() | ||
|
|
||
| self.weaponSetupName = Railgun.kMapName .. "+" .. Railgun.kMapName | ||
|
|
||
| if self:GetIsActive() then | ||
| local player = self:GetParent() | ||
| player:SetViewModel(self:GetViewModelName(), self) | ||
| end | ||
|
|
||
| end | ||
| end |
| @@ -0,0 +1,61 @@ | ||
| Script.Load("lua/Additions/FireGrenade.lua") | ||
| function Flamethrower:GetHasSecondary(player) | ||
| return true | ||
| end | ||
|
|
||
| function Flamethrower:GetSecondaryCanInterruptReload() | ||
| return true | ||
| end | ||
| function Flamethrower:SecondaryHere(player) | ||
| if Server or (Client and Client.GetIsControllingPlayer()) then | ||
| local viewCoords = player:GetViewCoords() | ||
| local eyePos = player:GetEyePos() | ||
|
|
||
| local startPointTrace = Shared.TraceCapsule(eyePos, eyePos + viewCoords.zAxis, 0.2, 0, CollisionRep.Move, PhysicsMask.PredictedProjectileGroup, EntityFilterTwo(self, player)) | ||
| local startPoint = startPointTrace.endPoint | ||
|
|
||
| local direction = viewCoords.zAxis | ||
|
|
||
| if startPointTrace.fraction ~= 1 then | ||
| direction = GetNormalizedVector(direction:GetProjection(startPointTrace.normal)) | ||
| end | ||
| local grenade = player:CreatePredictedProjectile("FireGrenade", startPoint, direction * 14, 1, 0.75, 8) | ||
| self.clip = self.clip - 15 | ||
| self:OnSecondaryAttackEnd(player) | ||
| end | ||
|
|
||
| end | ||
| local function CancelReload(self) | ||
|
|
||
| if self:GetIsReloading() then | ||
|
|
||
| self.reloading = false | ||
| if Client then | ||
| self:TriggerEffects("reload_cancel") | ||
| end | ||
| if Server then | ||
| self:TriggerEffects("reload_cancel") | ||
| end | ||
| end | ||
|
|
||
| end | ||
| function Flamethrower:OnSecondaryAttack(player) | ||
|
|
||
| local sprintedRecently = (Shared.GetTime() - self.lastTimeSprinted) < kMaxTimeToSprintAfterAttack | ||
| local attackAllowed = not sprintedRecently and (not self:GetIsReloading() or self:GetSecondaryCanInterruptReload()) and (not self:GetSecondaryAttackRequiresPress() or not player:GetSecondaryAttackLastFrame()) | ||
| local attackedRecently = (Shared.GetTime() - self.attackLastRequested) < 1 | ||
|
|
||
|
|
||
| if not player:GetIsSprinting() and self:GetIsDeployed() and attackAllowed and not self.primaryAttacking and not attackedRecently then | ||
|
|
||
| self.secondaryAttacking = true | ||
| self.attackLastRequested = Shared.GetTime() | ||
| CancelReload(self) | ||
| if self.clip >= 15 then self:SecondaryHere(player) end | ||
| else | ||
| self:OnSecondaryAttackEnd(player) | ||
| end | ||
|
|
||
|
|
||
|
|
||
| end |
| @@ -0,0 +1,61 @@ | ||
| --New class eventually? | ||
|
|
||
| Script.Load("lua/InfestationMixin.lua") | ||
|
|
||
| local networkVars = | ||
|
|
||
| { | ||
| } | ||
|
|
||
| AddMixinNetworkVars(InfestationMixin, networkVars) | ||
|
|
||
| function Whip:GetMinRangeAC() | ||
| return 14/3 | ||
| end | ||
|
|
||
|
|
||
| function Whip:OnConstructionComplete() | ||
|
|
||
| self:GiveUpgrade(kTechId.WhipBombard) | ||
|
|
||
| end | ||
|
|
||
|
|
||
| local orig_Whip_OnInit = Whip.OnInitialized | ||
| function Whip:OnInitialized() | ||
| orig_Whip_OnInit(self) | ||
| InitMixin(self, InfestationMixin) | ||
|
|
||
| end | ||
|
|
||
| function Whip:GetInfestationRadius() | ||
| return kInfestationRadius | ||
| end | ||
|
|
||
| if Server then | ||
|
|
||
| local origupdate = Whip.OnUpdate | ||
| function Whip:OnUpdate(deltaTime) | ||
| origupdate(self, deltaTime) | ||
| Whip.kDamage = kWhipSlapDamage * Clamp(self:GetHealthScalar(), .3, 1) | ||
| end | ||
|
|
||
| function Whip:UpdateRootState() | ||
|
|
||
| local infested = true --self:GetGameEffectMask(kGameEffect.OnInfestation) | ||
| local moveOrdered = self:GetCurrentOrder() and self:GetCurrentOrder():GetType() == kTechId.Move | ||
| -- unroot if we have a move order or infestation recedes | ||
| if self.rooted and (moveOrdered or not infested) then | ||
| self:Unroot() | ||
| end | ||
|
|
||
| -- root if on infestation and not moving/teleporting | ||
| if not self.rooted and infested and not (moveOrdered or self:GetIsTeleporting()) then | ||
| self:Root() | ||
| end | ||
|
|
||
| end | ||
| end | ||
| function Whip:OnKill(attacker, doer, point, direction) | ||
| --if attacker and attacker:isa("ARC") then AddPayLoadTime(1) end | ||
| end |