Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Mirage.js
Show All 34 Lines | Mirage.prototype.Init = function() | ||||
this.isInfinite = null; | this.isInfinite = null; | ||||
this.killBeforeGather = null; | this.killBeforeGather = null; | ||||
this.maxGatherers = null; | this.maxGatherers = null; | ||||
this.numGatherers = null; | this.numGatherers = null; | ||||
this.traders = null; | this.traders = null; | ||||
this.marketType = null; | this.marketType = null; | ||||
this.internationalBonus = null; | this.internationalBonus = null; | ||||
this.armourStrengths = null; | |||||
}; | }; | ||||
Mirage.prototype.SetParent = function(ent) | Mirage.prototype.SetParent = function(ent) | ||||
{ | { | ||||
this.parent = ent; | this.parent = ent; | ||||
}; | }; | ||||
Mirage.prototype.GetPlayer = function() | Mirage.prototype.GetPlayer = function() | ||||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Lines | for (let trader of this.traders) | ||||
if (!cmpTrader) | if (!cmpTrader) | ||||
continue; | continue; | ||||
cmpTrader.SwitchMarket(this.entity, cmpMarket.entity); | cmpTrader.SwitchMarket(this.entity, cmpMarket.entity); | ||||
this.RemoveTrader(trader); | this.RemoveTrader(trader); | ||||
cmpMarket.AddTrader(trader); | cmpMarket.AddTrader(trader); | ||||
} | } | ||||
}; | }; | ||||
// Armour data | |||||
Mirage.prototype.CopyDamageReceiver = function(cmpDamageReceiver) | |||||
{ | |||||
this.miragedIids.add(IID_DamageReceiver); | |||||
this.armourStrengths = clone(cmpDamageReceiver.GetArmourStrengths()); | |||||
}; | |||||
Mirage.prototype.GetArmourStrengths = function() { return this.armourStrengths; }; | |||||
// ============================ | // ============================ | ||||
Mirage.prototype.OnVisibilityChanged = function(msg) | Mirage.prototype.OnVisibilityChanged = function(msg) | ||||
{ | { | ||||
// Mirages get VIS_HIDDEN when the original entity becomes VIS_VISIBLE. | // Mirages get VIS_HIDDEN when the original entity becomes VIS_VISIBLE. | ||||
if (msg.player != this.player || msg.newVisibility != VIS_HIDDEN) | if (msg.player != this.player || msg.newVisibility != VIS_HIDDEN) | ||||
return; | return; | ||||
Show All 10 Lines |
Wildfire Games · Phabricator