Skip to content

Commit

Permalink
Updating to latest trunk
Browse files Browse the repository at this point in the history
  • Loading branch information
Andrew Spiering committed Aug 23, 2011
1 parent 2308fa6 commit a2b20ba
Show file tree
Hide file tree
Showing 93 changed files with 1,861 additions and 1,039 deletions.
41 changes: 13 additions & 28 deletions core/lua/Actor.lua
Original file line number Diff line number Diff line change
Expand Up @@ -15,14 +15,6 @@ class 'Actor' (Entity)

Actor.kMapName = "actor"

Actor.PhysicsType = enum
{
'None', // No physics representation.
'Dynamic', // Bones are driven by physics simulation (client-side only)
'DynamicServer', // Bones are driven by physics simulation (synced with server)
'Kinematic' // Physics model is updated by animation
}

// Maximum number of animations we support on in a model. This is
// limited for the sake of propagating animation indices.
Actor.maxAnimations = 72
Expand All @@ -38,7 +30,7 @@ Actor.networkVars =
// Reset to 1 every time a new animation is set.
animationSpeed = "compensated float",

physicsType = "enum Actor.PhysicsType",
physicsType = "enum PhysicsType",
physicsGroup = "integer (0 to 31)",
}

Expand All @@ -64,6 +56,8 @@ function Actor:OnCreate()

Entity.OnCreate(self)

InitMixin(self, TimedCallbackMixin)

self.modelIndex = 0
self.animationSequence = Model.invalidSequence
self.animationStart = 0
Expand All @@ -75,7 +69,7 @@ function Actor:OnCreate()
self.animationSpeed = 1.0
self.boneCoords = CoordsArray()
self.poseParams = PoseParams()
self.physicsType = Actor.PhysicsType.None
self.physicsType = PhysicsType.None
self.physicsModel = nil
self.physicsGroup = 0 //PhysicsGroup.DefaultGroup

Expand Down Expand Up @@ -103,8 +97,6 @@ end

function Actor:OnInit()

InitMixin(self, TimedCallbackMixin)

if Client then

self:TriggerEffects("on_init")
Expand Down Expand Up @@ -238,17 +230,17 @@ function Actor:UpdatePhysicsModelSimulation()

if (self.physicsModel ~= nil) then

if (self.physicsType == Actor.PhysicsType.None) then
if (self.physicsType == PhysicsType.None) then
self.physicsModel:SetPhysicsType(CollisionObject.None)
elseif (self.physicsType == Actor.PhysicsType.DynamicServer) then
elseif (self.physicsType == PhysicsType.DynamicServer) then
if (Server) then
self.physicsModel:SetPhysicsType(CollisionObject.Dynamic)
else
self.physicsModel:SetPhysicsType(CollisionObject.Kinematic)
end
elseif (self.physicsType == Actor.PhysicsType.Dynamic) then
elseif (self.physicsType == PhysicsType.Dynamic) then
self.physicsModel:SetPhysicsType(CollisionObject.Dynamic)
elseif (self.physicsType == Actor.PhysicsType.Kinematic) then
elseif (self.physicsType == PhysicsType.Kinematic) then
self.physicsModel:SetPhysicsType(CollisionObject.Kinematic)
end

Expand All @@ -259,9 +251,9 @@ end
function Actor:GetIsDynamic()

if (Server) then
return self.physicsType == Actor.PhysicsType.DynamicServer
return self.physicsType == PhysicsType.DynamicServer
else
return self.physicsType == Actor.PhysicsType.Dynamic
return self.physicsType == PhysicsType.Dynamic
end

end
Expand Down Expand Up @@ -592,13 +584,6 @@ function Actor:OnUpdate(deltaTime)

end

// Needed because of the problem where Actors can be created and updated on the client before being inited.
// "Spit created/destroyed in a single update" problem. Once that is fixed, this check won't be needed.
if HasMixin(self, "TimedCallback") then
// From TimedCallbackMixin.
self:UpdateTimedCallbacks(deltaTime)
end

end

if (Client) then
Expand Down Expand Up @@ -670,9 +655,9 @@ function Actor:UpdatePhysicsModelCoords()

if (self.physicsModel ~= nil) then

local update = self.physicsType == Actor.PhysicsType.Kinematic or self.physicsType == Actor.PhysicsType.None
local update = self.physicsType == PhysicsType.Kinematic or self.physicsType == PhysicsType.None

if Client and self.physicsType == Actor.PhysicsType.DynamicServer then
if Client and self.physicsType == PhysicsType.DynamicServer then
update = true
end

Expand Down Expand Up @@ -909,7 +894,7 @@ function Actor:OnUpdatePhysics()
self:UpdateBoneCoords()
self:UpdatePhysicsModel()

if (self.physicsType ~= Actor.PhysicsType.None) then
if (self.physicsType ~= PhysicsType.None) then

if (self.physicsModel ~= nil and self:GetIsDynamic()) then

Expand Down
13 changes: 7 additions & 6 deletions ns2/gamestrings/enUS.txt
Original file line number Diff line number Diff line change
Expand Up @@ -206,10 +206,10 @@ ENERGIZE = "Energize"

DISORIENT = "Disorient"
CLOACK = "Cloak"
PHANTASM = "Phantasm"
PHANTASM_FADE = "Phantasm Fade"
PHANTASM_ONOS = "Phantasm Onos"
PHANTASM_HIVE = "Phantasm Hive"
PHANTOM = "Phantom"
PHANTOM_FADE = "Phantom Fade"
PHANTOM_ONOS = "Phantom Onos"
PHANTOM_HIVE = "Phantom Hive"

UNROOT_WHIP = "Unroot Whip"
ROOT_WHIP = "Root Whip"
Expand Down Expand Up @@ -323,8 +323,8 @@ SHIFT_TOOLTIP = "Speeds energy recovery for units and shift units around map"
UPGRADE_SHIFT_TOOLTIP = "Increase Shift health and gain Echo ability"
MATURE_SHIFT_TOOLTIP = "Shift with Echo ability"
SHADE_TOOLTIP = "Cloaks nearby units and allows deception upgrades"
UPGRADE_SHADE_TOOLTIP = "Increase Shade health and grant Phantasm ability"
MATURE_SHADE_TOOLTIP = "Shade with Phantasm ability"
UPGRADE_SHADE_TOOLTIP = "Increase Shade health and grant Phantom ability"
MATURE_SHADE_TOOLTIP = "Shade with Phantom ability"
CRAG_HEAL_TOOLTIP = "Heals players and structures (+10 every 2 seconds, max 3 targets)"
SHIFT_ECHO_TOOLTIP = "Reposition structure elsewhere"
SHIFT_RECALL_TOOLTIP = "Aliens can use the shift to teleport to the nearest hive"
Expand Down Expand Up @@ -445,3 +445,4 @@ FOLLOWING = "Following %s"
BEACONING = "Commander issued Distress Beacon. Teleport imminent."
BEACONING_COMMANDER = "Distress Beacon triggered. Teleport imminent."
TOO_MANY_ENTITES = "Too many entities in area."
ALIEN_HUD_PHANTOM = "Phantom (no damage)"
14 changes: 11 additions & 3 deletions ns2/lua/ARC.lua
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,12 @@
Script.Load("lua/LiveScriptActor.lua")
Script.Load("lua/DoorMixin.lua")
Script.Load("lua/mixins/ControllerMixin.lua")
Script.Load("lua/RagdollMixin.lua")
Script.Load("lua/UpgradableMixin.lua")
Script.Load("lua/PointGiverMixin.lua")
Script.Load("lua/GameEffectsMixin.lua")
Script.Load("lua/FlinchMixin.lua")
Script.Load("lua/SelectableMixin.lua")
Script.Load("lua/TargetMixin.lua")

class 'ARC' (LiveScriptActor)
Expand Down Expand Up @@ -67,6 +71,7 @@ ARC.networkVars =
targetDirection = "vector",
}

PrepareClassForMixin(ARC, UpgradableMixin)
PrepareClassForMixin(ARC, GameEffectsMixin)
PrepareClassForMixin(ARC, FlinchMixin)

Expand All @@ -75,10 +80,13 @@ function ARC:OnCreate()
LiveScriptActor.OnCreate(self)

InitMixin(self, ControllerMixin)
InitMixin(self, RagdollMixin)
InitMixin(self, UpgradableMixin)
InitMixin(self, GameEffectsMixin)
InitMixin(self, FlinchMixin)
InitMixin(self, PointGiverMixin)
InitMixin(self, PathingMixin)

InitMixin(self, SelectableMixin)
if Server then
InitMixin(self, TargetMixin)
end
Expand All @@ -103,7 +111,7 @@ function ARC:OnInit()
{ kMarineStaticTargets, kMarineMobileTargets },
{ self.FilterTarget(self) })

self:SetPhysicsType(Actor.PhysicsType.Kinematic)
self:SetPhysicsType(PhysicsType.Kinematic)

// Cannons start out mobile
self:SetDesiredMode(ARC.kMode.UndeployedStationary)
Expand Down Expand Up @@ -211,7 +219,7 @@ function ARC:GetInAttackMode()
return (self.mode == ARC.kMode.Deployed or self.mode == ARC.kMode.Firing or self.mode == ARC.kMode.Targeting or self.mode == ARC.kMode.FireCooldown) and self.desiredMode ~= ARC.kMode.UndeployedStationary
end

function ARC:GetCanDoDamage()
function ARC:GetCanGiveDamageOverride()
return true
end

Expand Down
3 changes: 3 additions & 0 deletions ns2/lua/Alien.lua
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,7 @@
Script.Load("lua/Player.lua")
Script.Load("lua/CloakableMixin.lua")
Script.Load("lua/CamouflageMixin.lua")
Script.Load("lua/PhantomMixin.lua")

class 'Alien' (Player)
Alien.kMapName = "alien"
Expand Down Expand Up @@ -65,6 +66,7 @@ Alien.networkVars =

PrepareClassForMixin(Alien, CloakableMixin)
PrepareClassForMixin(Alien, CamouflageMixin)
PrepareClassForMixin(Alien, PhantomMixin)

function Alien:OnCreate()

Expand All @@ -87,6 +89,7 @@ function Alien:OnInit()

InitMixin(self, CloakableMixin)
InitMixin(self, CamouflageMixin)
InitMixin(self, PhantomMixin)

self.abilityEnergy = Ability.kMaxEnergy

Expand Down
18 changes: 8 additions & 10 deletions ns2/lua/AlienTeam.lua
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ function AlienTeam:UpdateTeamAutoHeal(timePassed)
if self.timeOfLastAutoHeal == nil or (time > (self.timeOfLastAutoHeal + AlienTeam.kAutoHealInterval)) then

// Heal all players by this amount
local teamEnts = GetEntitiesForTeam("LiveScriptActor", self:GetTeamNumber())
local teamEnts = GetEntitiesWithMixinForTeam("Live", self:GetTeamNumber())

for index, entity in ipairs(teamEnts) do

Expand Down Expand Up @@ -179,7 +179,7 @@ function AlienTeam:GetBlipType(entity)

local blipType = kBlipType.Undefined

if entity:isa("LiveScriptActor") and entity:GetIsVisible() and entity:GetIsAlive() and not entity:isa("Infestation") then
if entity:GetIsVisible() and HasMixin(entity, "Live") and entity:GetIsAlive() and not entity:isa("Infestation") then

if entity:GetTeamNumber() == self:GetTeamNumber() then

Expand Down Expand Up @@ -478,7 +478,7 @@ function AlienTeam:InitTechTree()
// Add special alien menus
self.techTree:AddMenu(kTechId.MarkersMenu)
self.techTree:AddMenu(kTechId.UpgradesMenu)
self.techTree:AddMenu(kTechId.ShadePhantasmMenu)
self.techTree:AddMenu(kTechId.ShadePhantomMenu)

// Add markers (orders)
self.techTree:AddSpecial(kTechId.ThreatMarker, true)
Expand Down Expand Up @@ -551,16 +551,14 @@ function AlienTeam:InitTechTree()

// Shade
self.techTree:AddUpgradeNode(kTechId.UpgradeShade, kTechId.Shade, kTechId.None)
self.techTree:AddBuildNode(kTechId.MatureShade, kTechId.None, kTechId.None)
self.techTree:AddBuildNode(kTechId.MatureShade, kTechId.TwoHives, kTechId.None)
self.techTree:AddActivation(kTechId.ShadeDisorient, kTechId.None, kTechId.None)
self.techTree:AddActivation(kTechId.ShadeCloak, kTechId.None, kTechId.None)

// Shade targeted abilities - treat phantasms as build nodes so we show ghost and attach points for fake hive
self.techTree:AddResearchNode(kTechId.PhantasmTech, kTechId.MatureShade, kTechId.None)
self.techTree:AddBuildNode(kTechId.ShadePhantasmFade, kTechId.PhantasmTech, kTechId.MatureShade)
self.techTree:AddBuildNode(kTechId.ShadePhantasmOnos, kTechId.None, kTechId.None)
self.techTree:AddBuildNode(kTechId.ShadePhantasmHive, kTechId.PhantasmTech, kTechId.MatureShade)

// Shade targeted abilities - treat Phantoms as build nodes so we show ghost and attach points for fake hive
self.techTree:AddResearchNode(kTechId.PhantomTech, kTechId.MatureShade, kTechId.None)
self.techTree:AddBuildNode(kTechId.ShadePhantomFade, kTechId.PhantomTech, kTechId.MatureShade)
self.techTree:AddBuildNode(kTechId.ShadePhantomOnos, kTechId.PhantomTech, kTechId.None)

// Crag upgrades
self.techTree:AddResearchNode(kTechId.AlienArmor1Tech, kTechId.Crag, kTechId.None)
Expand Down
7 changes: 4 additions & 3 deletions ns2/lua/AlienWeaponEffects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -354,11 +354,12 @@ kAlienWeaponEffects =
{
sporesAttackEffects =
{
{looping_sound = "sound/ns2.fev/alien/lerk/spore_spray"},
{overlay_animation = "spore"},

//{viewmodel_cinematic = "cinematics/alien/lerk/spore_view_fire.cinematic", attach_point = "?"},
//{weapon_cinematic = "cinematics/alien/lerk/spores.cinematic", attach_point = "?"},
{viewmodel_cinematic = "cinematics/alien/lerk/spore_view_fire.cinematic", attach_point = "fxnode_hole_left"},
{viewmodel_cinematic = "cinematics/alien/lerk/spore_view_fire.cinematic", attach_point = "fxnode_hole_right"},
{weapon_cinematic = "cinematics/alien/lerk/spore_fire.cinematic", attach_point = "fxnode_hole_left"},
{weapon_cinematic = "cinematics/alien/lerk/spore_fire.cinematic", attach_point = "fxnode_hole_right"},
},
},

Expand Down
4 changes: 2 additions & 2 deletions ns2/lua/Alien_Client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -420,8 +420,8 @@ end
// Bring up evolve menu
function Alien:Buy()

// Don't allow display in the ready room
if self:GetTeamNumber() ~= 0 and (Client.GetLocalPlayer() == self) then
// Don't allow display in the ready room, or as phantom
if self:GetTeamNumber() ~= 0 and (Client.GetLocalPlayer() == self) and (not HasMixin(self, "Phantom") or not self:GetIsPhantom()) then

if not self.buyMenu then
self.buyMenu = GetGUIManager():CreateGUIScript("GUIAlienBuyMenu")
Expand Down
14 changes: 12 additions & 2 deletions ns2/lua/Armory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,8 @@
//
// ========= For more information, visit us at http://www.unknownworlds.com =====================
Script.Load("lua/Structure.lua")
Script.Load("lua/RagdollMixin.lua")

class 'Armory' (Structure)
Armory.kMapName = "armory"

Expand Down Expand Up @@ -35,7 +37,7 @@ else
Script.Load("lua/Armory_Client.lua")
end

local networkVars =
Armory.networkVars =
{
// How far out the arms are for animation (0-1)
loggedInEast = "boolean",
Expand All @@ -59,6 +61,14 @@ function GetArmory(entity)

end

function Armory:OnCreate()

Structure.OnCreate(self)

InitMixin(self, RagdollMixin)

end

function Armory:OnInit()

self:SetModel(Armory.kModelName)
Expand Down Expand Up @@ -218,7 +228,7 @@ function Armory:OnUpdate(deltaTime)

end

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

class 'AdvancedArmory' (Armory)

Expand Down
10 changes: 10 additions & 0 deletions ns2/lua/ArmsLab.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,11 +6,21 @@
//
// ========= For more information, visit us at http://www.unknownworlds.com =====================
Script.Load("lua/Structure.lua")
Script.Load("lua/RagdollMixin.lua")

class 'ArmsLab' (Structure)
ArmsLab.kMapName = "armslab"

ArmsLab.kModelName = PrecacheAsset("models/marine/arms_lab/arms_lab.model")

function ArmsLab:OnCreate()

Structure.OnCreate(self)

InitMixin(self, RagdollMixin)

end

function ArmsLab:GetTechButtons(techId)

return { kTechId.Weapons1, kTechId.Weapons2, kTechId.Weapons3, kTechId.CatPackTech,
Expand Down
Loading

0 comments on commit a2b20ba

Please sign in to comment.