Changeset View
Changeset View
Standalone View
Standalone View
ps/trunk/binaries/data/mods/public/simulation/components/Player.js
Show First 20 Lines • Show All 927 Lines • ▼ Show 20 Lines | if (this.startingTechnologies.indexOf(tech) == -1) | ||||
this.startingTechnologies.push(tech); | this.startingTechnologies.push(tech); | ||||
}; | }; | ||||
Player.prototype.SetStartingTechnologies = function(techs) | Player.prototype.SetStartingTechnologies = function(techs) | ||||
{ | { | ||||
this.startingTechnologies = techs; | this.startingTechnologies = techs; | ||||
}; | }; | ||||
Player.prototype.OnGlobalPlayerDefeated = function(msg) | |||||
{ | |||||
let cmpSound = Engine.QueryInterface(this.entity, IID_Sound); | |||||
if (!cmpSound) | |||||
return; | |||||
let soundGroup = cmpSound.GetSoundGroup(this.playerID === msg.playerId ? "defeated" : this.IsAlly(msg.playerId) ? "defeated_ally" : this.state === "won" ? "won" : "defeated_enemy"); | |||||
if (soundGroup) | |||||
Engine.QueryInterface(SYSTEM_ENTITY, IID_SoundManager).PlaySoundGroupForPlayer(soundGroup, this.playerID); | |||||
}; | |||||
Engine.RegisterComponentType(IID_Player, "Player", Player); | Engine.RegisterComponentType(IID_Player, "Player", Player); |
Wildfire Games · Phabricator