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 18, 2011
1 parent b2ad8f9 commit 2c3c847
Show file tree
Hide file tree
Showing 19 changed files with 162 additions and 84 deletions.
3 changes: 2 additions & 1 deletion ns2/editor_setup.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,13 +5,14 @@
<model>
<file>model</file>
<scale>scale</scale>
<casts_shadows>castsShadows</casts_shadows>
</model>
<size>
<scale>scale</scale>
</size>
<parameter name="scale" type="vector" label="scale" default="1.0, 1.0, 1.0"/>
<parameter name="model" type="file" label="model" filter="*.model"/>
<parameter name="castsShadows" type="boolean" label="Casts Shadows" default="true"/>
<parameter name="castsShadows" type="boolean" label="Casts Shadows" default="true"/>


<!-- Allow prop to be shown or not for commander -->
Expand Down
8 changes: 2 additions & 6 deletions ns2/lua/AlienSpectator.lua
Original file line number Diff line number Diff line change
Expand Up @@ -14,10 +14,7 @@ class 'AlienSpectator' (Spectator)

AlienSpectator.kMapName = "alienspectator"

AlienSpectator.kBuyMenuFlash = "ui/alien_buymenu.swf"
AlienSpectator.kOpenSound = PrecacheAsset("sound/ns2.fev/alien/common/select")

local networkVars =
AlienSpectator.networkVars =
{
eggId = "entityid"
}
Expand Down Expand Up @@ -117,5 +114,4 @@ function AlienSpectator:SetOriginAnglesVelocity(input)

end


Shared.LinkClassToMap( "AlienSpectator", AlienSpectator.kMapName, networkVars )
Shared.LinkClassToMap( "AlienSpectator", AlienSpectator.kMapName, AlienSpectator.networkVars )
2 changes: 1 addition & 1 deletion ns2/lua/BalanceMisc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,7 @@ kScanRadius = 20

// Distress Beacon (from NS1)
kDistressBeaconRange = 15
kDistressBeaconTime = 4
kDistressBeaconTime = 3

kEnergizeRange = 10
kEnergizeDuration = 6
Expand Down
12 changes: 8 additions & 4 deletions ns2/lua/Client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -34,6 +34,7 @@ Client.ambientSoundList = {}
Client.particlesList = {}
Client.tracersList = {}
Client.rules = {}
Client.cinematics = {}

Client.timeOfLastPowerPoints = nil

Expand Down Expand Up @@ -77,11 +78,13 @@ function DestroyLevelObjects()
Client.DestroyRenderLight(light)
end
Client.lightList = { }

for index, cinematic in ipairs(Client.cinematics) do
Client.DestroyCinematic(cinematic)
end
Client.cinematics = { }

// Remove the skyboxes.
for index, skybox in ipairs(Client.skyBoxList) do
Client.DestroyCinematic(skybox)
end
Client.skyBoxList = { }

Client.particlesList = {}
Expand Down Expand Up @@ -189,10 +192,11 @@ function OnMapLoadEntity(className, groupName, values)
// Becuase we're going to hold onto the skybox, make sure it
// uses the endless repeat style so that it doesn't delete itself
repeatStyle = Cinematic.Repeat_Endless

end

cinematic:SetRepeatStyle(repeatStyle)
table.insert(Client.cinematics, cinematic)

elseif className == AmbientSound.kMapName then

Expand Down
7 changes: 4 additions & 3 deletions ns2/lua/DSPEffects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -43,6 +43,7 @@ function CreateDSPs()
end

// "ShadeDisorientFlange"
/*
dspId = Client.CreateDSP(SoundSystem.DSP_Flange)
if dspId ~= kDSPType.ShadeDisorientFlange then
Print("CreateDSPs(): ShadeDisorientFlange DSP id is %d instead of %d", dspId, kDSPType.ShadeDisorientFlange)
Expand All @@ -52,7 +53,7 @@ function CreateDSPs()
dspId = Client.CreateDSP(SoundSystem.DSP_LowPassSimple)
if dspId ~= kDSPType.ShadeDisorientLoPass then
Print("CreateDSPs(): ShadeDisorientLoPass DSP id is %d instead of %d", dspId, kDSPType.ShadeDisorientLoPass)
end
end*/

// "master"
dspId = Client.CreateDSP(SoundSystem.DSP_Compressor)
Expand Down Expand Up @@ -103,8 +104,8 @@ function UpdateDSPEffects()
// Near death
Client.SetDSPActive(kDSPType.NearDeath, player:GetGameEffectMask(kGameEffect.NearDeath))

// Shade
UpdateShadeDSPs()
// Removed because of over the top right now
//UpdateShadeDSPs()

end

3 changes: 2 additions & 1 deletion ns2/lua/Effects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ kEffectFilterClassName = "classname"
kEffectFilterDoerName = "doer"
kEffectFilterDamageType = "damagetype"
kEffectFilterIsAlien = "isalien"
kEffectFilterIsMarine = "ismarine"
kEffectFilterBuilt = "built"
kEffectFilterFlinchSevere = "flinch_severe"
kEffectFilterInAltMode = "alt_mode"
Expand All @@ -94,7 +95,7 @@ kEffectFilterEnemy = "enemy"

kEffectFilters =
{
kEffectFilterClassName, kEffectFilterDoerName, kEffectFilterDamageType, kEffectFilterIsAlien, kEffectFilterBuilt, kEffectFilterFlinchSevere,
kEffectFilterClassName, kEffectFilterDoerName, kEffectFilterDamageType, kEffectFilterIsAlien, kEffectFilterIsMarine, kEffectFilterBuilt, kEffectFilterFlinchSevere,
kEffectFilterInAltMode, kEffectFilterOccupied, kEffectFilterEmpty, kEffectFilterVariant, kEffectFilterFrom, kEffectFilterFromAnimation,
kEffectFilterFrom, kEffectFilterLeft, kEffectFilterActive, kEffectFilterHitSurface, kEffectFilterDeployed, kEffectFilterCloaked, kEffectFilterEnemy
}
Expand Down
6 changes: 5 additions & 1 deletion ns2/lua/Embryo.lua
Original file line number Diff line number Diff line change
Expand Up @@ -54,6 +54,10 @@ function Embryo:OnInit()

self.evolvePercentage = 0

self.evolveTime = 0

self.gestationTime = 0

end

function Embryo:GetBaseArmor()
Expand Down Expand Up @@ -167,7 +171,7 @@ if Server then
Alien.OnThink(self)

// Cannot spawn unless alive.
if self:GetIsAlive() then
if self:GetIsAlive() and self.gestationClass ~= nil then

// Take into account metabolize effects
local amount = GetAlienEvolveResearchTime(Embryo.kThinkTime, self)
Expand Down
2 changes: 1 addition & 1 deletion ns2/lua/Fade.lua
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ function Fade:OnInit()

end

function Fade:PreCopyPlayerDataFrom()
function Fade:PreCopyPlayerData()

// Reset visibility and gravity in case we were in ether mode.
self:SetIsVisible(true)
Expand Down
34 changes: 8 additions & 26 deletions ns2/lua/MarineStructureEffects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -466,27 +466,16 @@ kMarineStructureEffects =
{
distressBeaconEffect =
{
// Use parented_sound when triggering looping sounds, so it goes away when entity goes away
{parented_sound = "sound/ns2.fev/marine/common/distress_beacon"},
{looping_cinematic = "cinematics/marine/observatory/glowing_light_effect.cinematic"},
{sound = "sound/ns2.fev/marine/common/distress_beacon", done = true},
},
},

distress_beacon_cancel =
{
distressBeaconEffect =
{
{stop_sound = "sound/ns2.fev/marine/common/distress_beacon"},
{stop_cinematic = "cinematics/marine/observatory/glowing_light_effect.cinematic"},
},
},


distress_beacon_spawn =
{
playerSpawnEffect =
{
{cinematic = "cinematics/marine/infantryportal/player_spawn.cinematic"},
{sound = "sound/ns2.fev/marine/structures/infantry_portal_player_spawn"},
},
},

Expand All @@ -499,22 +488,15 @@ kMarineStructureEffects =
},
},

distress_beacon_player_start =
distress_beacon_complete =
{
distressBeaconEffect =
// Play one mega-spawn sound instead of spawn sounds for each player
distressBeaconComplete =
{
{private_sound = "sound/ns2.fev/marine/common/distress_beacon", volume = .4},
{sound = "sound/ns2.fev/marine/common/mega_teleport"},
},
},

distress_beacon_player_end =
{
distressBeaconEffect =
{
{stop_sound = "sound/ns2.fev/marine/common/distress_beacon"},
},
},

},

}

GetEffectManager():AddEffectData("MarineStructureEffects", kMarineStructureEffects)
1 change: 1 addition & 0 deletions ns2/lua/NS2Utility.lua
Original file line number Diff line number Diff line change
Expand Up @@ -1221,6 +1221,7 @@ function TriggerHitEffects(doer, target, origin, surface, melee)

if target and target.GetClassName then
tableParams[kEffectFilterClassName] = target:GetClassName()
tableParams[kEffectFilterIsMarine] = target:GetTeamType() == kMarineTeamType
tableParams[kEffectFilterIsAlien] = target:GetTeamType() == kAlienTeamType
end

Expand Down
28 changes: 9 additions & 19 deletions ns2/lua/Observatory.lua
Original file line number Diff line number Diff line change
Expand Up @@ -60,15 +60,13 @@ function Observatory:TriggerDistressBeacon()

if not self.distressBeaconTime then

// Trigger private sounds for all players to be affected
for index, player in ipairs(self:GetPlayersToBeacon()) do
if not self:GetIsPlayerNearby(player) then
player:TriggerEffects("distress_beacon_player_start")
end
end

// Play effects at beacon so enemies and Comm can hear it
self:TriggerEffects("distress_beacon_start")

// Trigger private sound effect for marines far from beacon, so they can hear it positionally at a distance
for index, player in ipairs(self:GetPlayersToBeacon()) do
player:TriggerEffects("distress_beacon_player_start")
end

// Beam all faraway players back in a few seconds!
self.distressBeaconTime = Shared.GetTime() + Observatory.kDistressBeaconTime
Expand Down Expand Up @@ -115,10 +113,11 @@ function Observatory:PerformDistressBeacon()

self:RespawnPlayer(player)

player:TriggerEffects("distress_beacon_player_end")

end

// Play mega-spawn sound
self:TriggerEffects("distress_beacon_complete")

end

// Spawn players near Observatory - not initial marine start like in NS1. Allows relocations and more versatile tactics.
Expand Down Expand Up @@ -157,7 +156,7 @@ function Observatory:OnPoweredChange(newPoweredState)
// Cancel distress beacon on power down
if not newPoweredState and self.distressBeaconTime then

self:TriggerEffects("distress_beacon_cancel")
self:TriggerEffects("distress_beacon_end")
self.distressBeaconTime = nil

end
Expand Down Expand Up @@ -207,15 +206,6 @@ function Observatory:GetIsBeaconing()
return (self.distressBeaconTime ~= nil)
end

// Temporary: don't check in. Allow testing more easily.
/*
function Observatory:OnUse(player, elapsedTime, useAttachPoint, usePoint)
if Server and Shared.GetDevMode() then
self:TriggerDistressBeacon()
end
end
*/

function Observatory:OnKill(damage, killer, doer, point, direction)

if self:GetIsBeaconing() then
Expand Down
3 changes: 2 additions & 1 deletion ns2/lua/Player.lua
Original file line number Diff line number Diff line change
Expand Up @@ -338,7 +338,8 @@ function Player:OnInit()

LiveScriptActor.OnInit(self)

if Server then
// Only give weapons when playing
if Server and self:GetTeamNumber() ~= kNeutralTeamType then

self:InitWeapons()

Expand Down
33 changes: 31 additions & 2 deletions ns2/lua/PlayerEffects.lua
Original file line number Diff line number Diff line change
Expand Up @@ -80,8 +80,37 @@ kPlayerEffectData =
{
{sound = "sound/ns2.fev/alien/skulk/land"},
}
}

},

// Played on player
distress_beacon_player_start =
{
distressBeaconPlayerStart =
{
// Play different sound effect for each player so aliens only hear it nearby, but marines
// hear it directionally from far away
{private_sound = "sound/ns2.fev/marine/common/distress_beacon_marine", ismarine = true, done = true},
},
},

// Triggered for local player
disorient_loop =
{
disorientFX =
{
{looping_sound = "sound/ns2.fev/alien/structures/shade/disorientate", active = true, done = true},
{stop_sound = "sound/ns2.fev/alien/structures/shade/disorientate", active = false, done = true},
},
},

cloak_loop =
{
cloakFX =
{
{looping_sound = "sound/ns2.fev/alien/structures/shade/cloak_loop", active = true, done = true},
{stop_sound = "sound/ns2.fev/alien/structures/shade/cloak_loop", active = false, done = true},
},
},
}

GetEffectManager():AddEffectData("PlayerEffectData", kPlayerEffectData)
36 changes: 34 additions & 2 deletions ns2/lua/Player_Client.lua
Original file line number Diff line number Diff line change
Expand Up @@ -799,8 +799,10 @@ function Player:UpdateScreenEffects(deltaTime)
local cloakScreenEffectState = (HasMixin(self, "Cloakable") and self:GetIsCloaked()) or (HasMixin(self, "Camouflage") and self:GetIsCamouflaged())
self:SetCloakShaderState(cloakScreenEffectState)

self:UpdateCloakSoundLoop(cloakScreenEffectState)

// Play disorient screen effect to show we're near a shade
self:UpdateDisorientShader()
self:UpdateDisorientFX()

end

Expand Down Expand Up @@ -1059,7 +1061,31 @@ function Player:SetCloakShaderState(cloaked)
end
end

function Player:UpdateDisorientShader()
function Player:UpdateDisorientSoundLoop(state)

// Start or stop sound effects
if state ~= self.playerDisorientSoundLoopPlaying then

self:TriggerEffects("disorient_loop", {active = state})
self.playerDisorientSoundLoopPlaying = state

end

end

function Player:UpdateCloakSoundLoop(state)

// Start or stop sound effects
if state ~= self.playerCloakSoundLoopPlaying then

self:TriggerEffects("cloak_loop", {active = state})
self.playerCloakSoundLoopPlaying = state

end

end

function Player:UpdateDisorientFX()

local amount = 0
if HasMixin(self, "Disorientable") then
Expand All @@ -1072,6 +1098,9 @@ function Player:UpdateDisorientShader()
end

self.screenEffects.disorient:SetParameter("amount", amount)

self:UpdateDisorientSoundLoop(state)

end

/**
Expand All @@ -1088,6 +1117,9 @@ function Player:OnDestroy()

self:DestroyScreenEffects()

self:UpdateCloakSoundLoop(false)
self:UpdateDisorientSoundLoop(false)

self:CloseMenu(kClassFlashIndex)

end
Expand Down
Loading

0 comments on commit 2c3c847

Please sign in to comment.