Migrate Captures.SabotageHPRemoval and Capturable.CaptureThreshold to int percentages

This commit is contained in:
reaperrr
2016-03-24 14:25:00 +01:00
parent 82f23210d9
commit 4894211789
13 changed files with 44 additions and 16 deletions

View File

@@ -53,7 +53,7 @@ namespace OpenRA.Mods.Common.Activities
if (actor.IsDead || capturable.BeingCaptured)
return;
var lowEnoughHealth = health.HP <= capturable.Info.CaptureThreshold * health.MaxHP;
var lowEnoughHealth = health.HP <= capturable.Info.CaptureThreshold * health.MaxHP / 100;
if (!capturesInfo.Sabotage || lowEnoughHealth || actor.Owner.NonCombatant)
{
var oldOwner = actor.Owner;
@@ -68,7 +68,7 @@ namespace OpenRA.Mods.Common.Activities
}
else
{
var damage = (int)(health.MaxHP * capturesInfo.SabotageHPRemoval);
var damage = health.MaxHP * capturesInfo.SabotageHPRemoval / 100;
actor.InflictDamage(self, damage, null);
}