Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Mirage.js
Show All 20 Lines | Mirage.prototype.Init = function() | ||||
this.buildTime = {}; | this.buildTime = {}; | ||||
this.maxHitpoints = null; | this.maxHitpoints = null; | ||||
this.hitpoints = null; | this.hitpoints = null; | ||||
this.repairable = null; | this.repairable = null; | ||||
this.unhealable = null; | this.unhealable = null; | ||||
this.injured = null; | this.injured = null; | ||||
this.resistanceStrengths = {}; | |||||
this.invulnerable = null; | |||||
this.capturePoints = []; | this.capturePoints = []; | ||||
this.maxCapturePoints = 0; | this.maxCapturePoints = 0; | ||||
this.maxAmount = null; | this.maxAmount = null; | ||||
this.amount = null; | this.amount = null; | ||||
this.type = null; | this.type = null; | ||||
this.isInfinite = null; | this.isInfinite = null; | ||||
this.killBeforeGather = null; | this.killBeforeGather = null; | ||||
▲ Show 20 Lines • Show All 71 Lines • ▼ Show 20 Lines | |||||
Mirage.prototype.CopyHealth = function(cmpHealth) | Mirage.prototype.CopyHealth = function(cmpHealth) | ||||
{ | { | ||||
this.miragedIids.add(IID_Health); | this.miragedIids.add(IID_Health); | ||||
this.maxHitpoints = cmpHealth.GetMaxHitpoints(); | this.maxHitpoints = cmpHealth.GetMaxHitpoints(); | ||||
this.hitpoints = cmpHealth.GetHitpoints(); | this.hitpoints = cmpHealth.GetHitpoints(); | ||||
this.repairable = cmpHealth.IsRepairable(); | this.repairable = cmpHealth.IsRepairable(); | ||||
this.injured = cmpHealth.IsInjured(); | this.injured = cmpHealth.IsInjured(); | ||||
this.unhealable = cmpHealth.IsUnhealable(); | this.unhealable = cmpHealth.IsUnhealable(); | ||||
this.CanDamage = Health.prototype.CanDamage; | |||||
bb: nuke | |||||
this.GetRelativeDamage = Health.prototype.GetRelativeDamage; | |||||
}; | }; | ||||
Mirage.prototype.GetMaxHitpoints = function() { return this.maxHitpoints; }; | Mirage.prototype.GetMaxHitpoints = function() { return this.maxHitpoints; }; | ||||
Mirage.prototype.GetHitpoints = function() { return this.hitpoints; }; | Mirage.prototype.GetHitpoints = function() { return this.hitpoints; }; | ||||
Mirage.prototype.IsRepairable = function() { return this.repairable; }; | Mirage.prototype.IsRepairable = function() { return this.repairable; }; | ||||
Mirage.prototype.IsInjured = function() { return this.injured; }; | Mirage.prototype.IsInjured = function() { return this.injured; }; | ||||
Mirage.prototype.IsUnhealable = function() { return this.unhealable; }; | Mirage.prototype.IsUnhealable = function() { return this.unhealable; }; | ||||
// Resistance data | |||||
Mirage.prototype.CopyResistance = function(cmpResistance) | |||||
{ | |||||
this.miragedIids.add(IID_Resistance); | |||||
this.resistanceStrengths = cmpResistance.GetEffectiveResistance(); | |||||
this.invulnerable = cmpResistance.IsInvulnerable(); | |||||
}; | |||||
Mirage.prototype.IsInvulnerable = function() { return this.invulnerable; }; | |||||
Mirage.prototype.GetEffectiveResistance = function() { return this.resistanceStrengths; }; | |||||
// Capture data | // Capture data | ||||
Mirage.prototype.CopyCapturable = function(cmpCapturable) | Mirage.prototype.CopyCapturable = function(cmpCapturable) | ||||
{ | { | ||||
this.miragedIids.add(IID_Capturable); | this.miragedIids.add(IID_Capturable); | ||||
this.capturePoints = clone(cmpCapturable.GetCapturePoints()); | this.capturePoints = clone(cmpCapturable.GetCapturePoints()); | ||||
this.maxCapturePoints = cmpCapturable.GetMaxCapturePoints(); | this.maxCapturePoints = cmpCapturable.GetMaxCapturePoints(); | ||||
this.CanCapture = Capturable.prototype.CanCapture; | |||||
this.GetRelativeCapture = Capturable.prototype.GetRelativeCapture; | |||||
}; | }; | ||||
Mirage.prototype.GetMaxCapturePoints = function() { return this.maxCapturePoints; }; | Mirage.prototype.GetMaxCapturePoints = function() { return this.maxCapturePoints; }; | ||||
Mirage.prototype.GetCapturePoints = function() { return this.capturePoints; }; | Mirage.prototype.GetCapturePoints = function() { return this.capturePoints; }; | ||||
Mirage.prototype.CanCapture = Capturable.prototype.CanCapture; | // StatusEffects data | ||||
Mirage.prototype.CopyStatusEffectsReceiver = function(cmpStatusEffectsReceiver) | |||||
{ | |||||
this.miragedIids.add(IID_StatusEffectsReceiver); | |||||
this.GetRelativeStatusEffect = StatusEffectsReceiver.prototype.GetRelativeStatusEffect; | |||||
}; | |||||
// ResourceSupply data | // ResourceSupply data | ||||
Mirage.prototype.CopyResourceSupply = function(cmpResourceSupply) | Mirage.prototype.CopyResourceSupply = function(cmpResourceSupply) | ||||
{ | { | ||||
this.miragedIids.add(IID_ResourceSupply); | this.miragedIids.add(IID_ResourceSupply); | ||||
this.maxAmount = cmpResourceSupply.GetMaxAmount(); | this.maxAmount = cmpResourceSupply.GetMaxAmount(); | ||||
this.amount = cmpResourceSupply.GetCurrentAmount(); | this.amount = cmpResourceSupply.GetCurrentAmount(); | ||||
▲ Show 20 Lines • Show All 89 Lines • Show Last 20 Lines |
Wildfire Games · Phabricator
nuke