Changeset View
Changeset View
Standalone View
Standalone View
binaries/data/mods/public/simulation/components/Heal.js
function Heal() {} | function Heal() {} | ||||
Heal.prototype.Schema = | Heal.prototype.Schema = | ||||
"<a:help>Controls the healing abilities of the unit.</a:help>" + | "<a:help>Controls the healing abilities of the unit.</a:help>" + | ||||
"<a:example>" + | "<a:example>" + | ||||
"<Range>20</Range>" + | "<Range>20</Range>" + | ||||
"<RangeOverlay>" + | |||||
"<LineTexture>outline_border.png</LineTexture>" + | |||||
"<LineTextureMask>outline_border_mask.png</LineTextureMask>" + | |||||
"<LineThickness>0.2</LineThickness>" + | |||||
"</RangeOverlay>" + | |||||
"<HP>5</HP>" + | "<HP>5</HP>" + | ||||
"<Rate>2000</Rate>" + | "<Rate>2000</Rate>" + | ||||
"<UnhealableClasses datatype=\"tokens\">Cavalry</UnhealableClasses>" + | "<UnhealableClasses datatype=\"tokens\">Cavalry</UnhealableClasses>" + | ||||
"<HealableClasses datatype=\"tokens\">Support Infantry</HealableClasses>" + | "<HealableClasses datatype=\"tokens\">Support Infantry</HealableClasses>" + | ||||
"</a:example>" + | "</a:example>" + | ||||
"<element name='Range' a:help='Range (in metres) where healing is possible'>" + | "<element name='Range' a:help='Range (in metres) where healing is possible'>" + | ||||
"<ref name='nonNegativeDecimal'/>" + | "<ref name='nonNegativeDecimal'/>" + | ||||
"</element>" + | "</element>" + | ||||
"<optional>" + | |||||
"<element name='RangeOverlay'>" + | |||||
"<interleave>" + | |||||
"<element name='LineTexture'><text/></element>" + | |||||
"<element name='LineTextureMask'><text/></element>" + | |||||
"<element name='LineThickness'><ref name='nonNegativeDecimal'/></element>" + | |||||
"</interleave>" + | |||||
"</element>" + | |||||
"</optional>" + | |||||
"<element name='HP' a:help='Hitpoints healed per Rate'>" + | "<element name='HP' a:help='Hitpoints healed per Rate'>" + | ||||
"<ref name='nonNegativeDecimal'/>" + | "<ref name='nonNegativeDecimal'/>" + | ||||
"</element>" + | "</element>" + | ||||
"<element name='Rate' a:help='A heal is performed every Rate ms'>" + | "<element name='Rate' a:help='A heal is performed every Rate ms'>" + | ||||
"<ref name='nonNegativeDecimal'/>" + | "<ref name='nonNegativeDecimal'/>" + | ||||
"</element>" + | "</element>" + | ||||
"<element name='UnhealableClasses' a:help='If the target has any of these classes it can not be healed (even if it has a class from HealableClasses)'>" + | "<element name='UnhealableClasses' a:help='If the target has any of these classes it can not be healed (even if it has a class from HealableClasses)'>" + | ||||
"<attribute name='datatype'>" + | "<attribute name='datatype'>" + | ||||
▲ Show 20 Lines • Show All 45 Lines • ▼ Show 20 Lines | Heal.prototype.GetUnhealableClasses = function() | ||||
return this.template.UnhealableClasses._string || ""; | return this.template.UnhealableClasses._string || ""; | ||||
}; | }; | ||||
Heal.prototype.GetHealableClasses = function() | Heal.prototype.GetHealableClasses = function() | ||||
{ | { | ||||
return this.template.HealableClasses._string || ""; | return this.template.HealableClasses._string || ""; | ||||
}; | }; | ||||
Heal.prototype.GetLineTexture = function() | |||||
{ | |||||
return this.template.RangeOverlay ? this.template.RangeOverlay.LineTexture : "outline_border.png"; | |||||
}; | |||||
Heal.prototype.GetLineTextureMask = function() | |||||
{ | |||||
return this.template.RangeOverlay ? this.template.RangeOverlay.LineTextureMask : "outline_border_mask.png"; | |||||
}; | |||||
Heal.prototype.GetLineThickness = function() | |||||
{ | |||||
return this.template.RangeOverlay ? +this.template.RangeOverlay.LineThickness : 0.15; | |||||
elexis: After getting used to female auras, `0.2` seems a bit ugly, 0.15 looks better IMO.
(Apparently… | |||||
}; | |||||
/** | /** | ||||
* Heal the target entity. This should only be called after a successful range | * Heal the target entity. This should only be called after a successful range | ||||
* check, and should only be called after GetTimers().repeat msec has passed | * check, and should only be called after GetTimers().repeat msec has passed | ||||
* since the last call to PerformHeal. | * since the last call to PerformHeal. | ||||
*/ | */ | ||||
Heal.prototype.PerformHeal = function(target) | Heal.prototype.PerformHeal = function(target) | ||||
{ | { | ||||
let cmpHealth = Engine.QueryInterface(target, IID_Health); | let cmpHealth = Engine.QueryInterface(target, IID_Health); | ||||
Show All 30 Lines |
Wildfire Games · Phabricator
After getting used to female auras, 0.2 seems a bit ugly, 0.15 looks better IMO.
(Apparently it's appealing if the thickness increases proportional with the range)