Index: ps/trunk/binaries/data/mods/public/art/textures/selection/heal_overlay_range.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ps/trunk/binaries/data/mods/public/art/textures/selection/heal_overlay_range.png
===================================================================
--- ps/trunk/binaries/data/mods/public/art/textures/selection/heal_overlay_range.png (nonexistent)
+++ ps/trunk/binaries/data/mods/public/art/textures/selection/heal_overlay_range.png (revision 19708)
Property changes on: ps/trunk/binaries/data/mods/public/art/textures/selection/heal_overlay_range.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: ps/trunk/binaries/data/mods/public/art/textures/selection/heal_overlay_range_mask.png
===================================================================
Cannot display: file marked as a binary type.
svn:mime-type = application/octet-stream
Index: ps/trunk/binaries/data/mods/public/art/textures/selection/heal_overlay_range_mask.png
===================================================================
--- ps/trunk/binaries/data/mods/public/art/textures/selection/heal_overlay_range_mask.png (nonexistent)
+++ ps/trunk/binaries/data/mods/public/art/textures/selection/heal_overlay_range_mask.png (revision 19708)
Property changes on: ps/trunk/binaries/data/mods/public/art/textures/selection/heal_overlay_range_mask.png
___________________________________________________________________
Added: svn:mime-type
## -0,0 +1 ##
+application/octet-stream
\ No newline at end of property
Index: ps/trunk/binaries/data/mods/public/simulation/components/Heal.js
===================================================================
--- ps/trunk/binaries/data/mods/public/simulation/components/Heal.js (revision 19707)
+++ ps/trunk/binaries/data/mods/public/simulation/components/Heal.js (revision 19708)
@@ -1,142 +1,142 @@
function Heal() {}
Heal.prototype.Schema =
"Controls the healing abilities of the unit." +
"" +
"20" +
"" +
- "outline_border.png" +
- "outline_border_mask.png" +
- "0.2" +
+ "heal_overlay_range.png" +
+ "heal_overlay_range_mask.png" +
+ "0.35" +
"" +
"5" +
"2000" +
"Cavalry" +
"Support Infantry" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"" +
"tokens" +
"" +
"" +
"" +
"" +
"" +
"tokens" +
"" +
"" +
"";
Heal.prototype.Init = function()
{
};
Heal.prototype.Serialize = null; // we have no dynamic state to save
Heal.prototype.GetTimers = function()
{
return {
"prepare": 1000,
"repeat": this.GetRate()
};
};
Heal.prototype.GetHP = function()
{
return ApplyValueModificationsToEntity("Heal/HP", +this.template.HP, this.entity);
};
Heal.prototype.GetRate = function()
{
return ApplyValueModificationsToEntity("Heal/Rate", +this.template.Rate, this.entity);
};
Heal.prototype.GetRange = function()
{
return {
"min": 0,
"max": ApplyValueModificationsToEntity("Heal/Range", +this.template.Range, this.entity)
};
};
Heal.prototype.GetUnhealableClasses = function()
{
return this.template.UnhealableClasses._string || "";
};
Heal.prototype.GetHealableClasses = function()
{
return this.template.HealableClasses._string || "";
};
Heal.prototype.GetLineTexture = function()
{
- return this.template.RangeOverlay ? this.template.RangeOverlay.LineTexture : "outline_border.png";
+ return this.template.RangeOverlay ? this.template.RangeOverlay.LineTexture : "heal_overlay_range.png";
};
Heal.prototype.GetLineTextureMask = function()
{
- return this.template.RangeOverlay ? this.template.RangeOverlay.LineTextureMask : "outline_border_mask.png";
+ return this.template.RangeOverlay ? this.template.RangeOverlay.LineTextureMask : "heal_overlay_range_mask.png";
};
Heal.prototype.GetLineThickness = function()
{
- return this.template.RangeOverlay ? +this.template.RangeOverlay.LineThickness : 0.15;
+ return this.template.RangeOverlay ? +this.template.RangeOverlay.LineThickness : 0.35;
};
/**
* 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
* since the last call to PerformHeal.
*/
Heal.prototype.PerformHeal = function(target)
{
let cmpHealth = Engine.QueryInterface(target, IID_Health);
if (!cmpHealth)
return;
let targetState = cmpHealth.Increase(this.GetHP());
// Add XP
let cmpLoot = Engine.QueryInterface(target, IID_Loot);
let cmpPromotion = Engine.QueryInterface(this.entity, IID_Promotion);
if (targetState !== undefined && cmpLoot && cmpPromotion)
{
// HP healed * XP per HP
cmpPromotion.IncreaseXp((targetState.new - targetState.old) / cmpHealth.GetMaxHitpoints() * cmpLoot.GetXp());
}
//TODO we need a sound file
// PlaySound("heal_impact", this.entity);
};
Heal.prototype.OnValueModification = function(msg)
{
if (msg.component != "Heal" || msg.valueNames.indexOf("Heal/Range") === -1)
return;
let cmpUnitAI = Engine.QueryInterface(this.entity, IID_UnitAI);
if (!cmpUnitAI)
return;
cmpUnitAI.UpdateRangeQueries();
};
Engine.RegisterComponentType(IID_Heal, "Heal", Heal);