Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/helpers/Player.js
Show First 20 Lines • Show All 281 Lines • ▼ Show 20 Lines | function IsOwnedByAllyOfEntity(entity, target) | ||||
return IsOwnedByEntityHelper(entity, target, "IsAlly"); | return IsOwnedByEntityHelper(entity, target, "IsAlly"); | ||||
} | } | ||||
function IsOwnedByMutualAllyOfEntity(entity, target) | function IsOwnedByMutualAllyOfEntity(entity, target) | ||||
{ | { | ||||
return IsOwnedByEntityHelper(entity, target, "IsMutualAlly"); | return IsOwnedByEntityHelper(entity, target, "IsMutualAlly"); | ||||
} | } | ||||
function IsOwnedByNeutralOfEntity(entity, target) | |||||
{ | |||||
return IsOwnedByEntityHelper(entity, target, "IsNeutral"); | |||||
} | |||||
function IsOwnedByEnemyOfEntity(entity, target) | |||||
{ | |||||
return IsOwnedByEntityHelper(entity, target, "IsEnemy"); | |||||
} | |||||
function IsOwnedByEntityHelper(entity, target, check) | function IsOwnedByEntityHelper(entity, target, check) | ||||
{ | { | ||||
// Figure out which player controls us | // Figure out which player controls us | ||||
let owner = 0; | let owner = 0; | ||||
let cmpOwnership = Engine.QueryInterface(entity, IID_Ownership); | let cmpOwnership = Engine.QueryInterface(entity, IID_Ownership); | ||||
if (cmpOwnership) | if (cmpOwnership) | ||||
owner = cmpOwnership.GetOwner(); | owner = cmpOwnership.GetOwner(); | ||||
▲ Show 20 Lines • Show All 60 Lines • ▼ Show 20 Lines | |||||
Engine.RegisterGlobal("LoadPlayerSettings", LoadPlayerSettings); | Engine.RegisterGlobal("LoadPlayerSettings", LoadPlayerSettings); | ||||
Engine.RegisterGlobal("QueryOwnerEntityID", QueryOwnerEntityID); | Engine.RegisterGlobal("QueryOwnerEntityID", QueryOwnerEntityID); | ||||
Engine.RegisterGlobal("QueryOwnerInterface", QueryOwnerInterface); | Engine.RegisterGlobal("QueryOwnerInterface", QueryOwnerInterface); | ||||
Engine.RegisterGlobal("QueryPlayerIDInterface", QueryPlayerIDInterface); | Engine.RegisterGlobal("QueryPlayerIDInterface", QueryPlayerIDInterface); | ||||
Engine.RegisterGlobal("QueryMiragedInterface", QueryMiragedInterface); | Engine.RegisterGlobal("QueryMiragedInterface", QueryMiragedInterface); | ||||
Engine.RegisterGlobal("QueryBuilderListInterface", QueryBuilderListInterface); | Engine.RegisterGlobal("QueryBuilderListInterface", QueryBuilderListInterface); | ||||
Engine.RegisterGlobal("IsOwnedByAllyOfEntity", IsOwnedByAllyOfEntity); | Engine.RegisterGlobal("IsOwnedByAllyOfEntity", IsOwnedByAllyOfEntity); | ||||
Engine.RegisterGlobal("IsOwnedByMutualAllyOfEntity", IsOwnedByMutualAllyOfEntity); | Engine.RegisterGlobal("IsOwnedByMutualAllyOfEntity", IsOwnedByMutualAllyOfEntity); | ||||
Engine.RegisterGlobal("IsOwnedByNeutralOfEntity", IsOwnedByNeutralOfEntity); | |||||
Engine.RegisterGlobal("IsOwnedByEnemyOfEntity", IsOwnedByEnemyOfEntity); | |||||
Engine.RegisterGlobal("IsOwnedByPlayer", IsOwnedByPlayer); | Engine.RegisterGlobal("IsOwnedByPlayer", IsOwnedByPlayer); | ||||
Engine.RegisterGlobal("IsOwnedByGaia", IsOwnedByGaia); | Engine.RegisterGlobal("IsOwnedByGaia", IsOwnedByGaia); | ||||
Engine.RegisterGlobal("IsOwnedByAllyOfPlayer", IsOwnedByAllyOfPlayer); | Engine.RegisterGlobal("IsOwnedByAllyOfPlayer", IsOwnedByAllyOfPlayer); | ||||
Engine.RegisterGlobal("IsOwnedByMutualAllyOfPlayer", IsOwnedByMutualAllyOfPlayer); | Engine.RegisterGlobal("IsOwnedByMutualAllyOfPlayer", IsOwnedByMutualAllyOfPlayer); | ||||
Engine.RegisterGlobal("IsOwnedByNeutralOfPlayer", IsOwnedByNeutralOfPlayer); | Engine.RegisterGlobal("IsOwnedByNeutralOfPlayer", IsOwnedByNeutralOfPlayer); | ||||
Engine.RegisterGlobal("IsOwnedByEnemyOfPlayer", IsOwnedByEnemyOfPlayer); | Engine.RegisterGlobal("IsOwnedByEnemyOfPlayer", IsOwnedByEnemyOfPlayer); |
Wildfire Games · Phabricator