Add damagetypes to repairing.
This commit is contained in:
committed by
atlimit8
parent
ca3cfc0184
commit
9e534f3804
@@ -267,7 +267,7 @@ namespace OpenRA.Mods.Common.Activities
|
||||
return;
|
||||
}
|
||||
|
||||
self.InflictDamage(host.Actor, new Damage(-hpToRepair));
|
||||
self.InflictDamage(host.Actor, new Damage(-hpToRepair, repairsUnits.Info.RepairDamageTypes));
|
||||
remainingTicks = repairsUnits.Info.Interval;
|
||||
}
|
||||
else
|
||||
|
||||
@@ -12,6 +12,7 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
@@ -28,6 +29,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("The maximum amount of HP to repair each step.")]
|
||||
public readonly int RepairStep = 7;
|
||||
|
||||
[Desc("Damage types used for the repair.")]
|
||||
public readonly BitSet<DamageType> RepairDamageTypes = default(BitSet<DamageType>);
|
||||
|
||||
[Desc("The percentage repair bonus applied with increasing numbers of repairers.")]
|
||||
public readonly int[] RepairBonuses = { 100, 150, 175, 200, 220, 240, 260, 280, 300 };
|
||||
|
||||
@@ -166,7 +170,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
// activePlayers won't cause IndexOutOfRange because we capped the max amount of players
|
||||
// to the length of the array
|
||||
self.InflictDamage(self, new Damage(-(hpToRepair * Info.RepairBonuses[activePlayers - 1] / 100)));
|
||||
self.InflictDamage(self, new Damage(-(hpToRepair * Info.RepairBonuses[activePlayers - 1] / 100), Info.RepairDamageTypes));
|
||||
|
||||
if (health.DamageState == DamageState.Undamaged)
|
||||
{
|
||||
|
||||
@@ -9,6 +9,7 @@
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
@@ -23,6 +24,9 @@ namespace OpenRA.Mods.Common.Traits
|
||||
[Desc("Time (in ticks) between two repair steps.")]
|
||||
public readonly int Interval = 24;
|
||||
|
||||
[Desc("Damage types used for the repair.")]
|
||||
public readonly BitSet<DamageType> RepairDamageTypes = default(BitSet<DamageType>);
|
||||
|
||||
[NotificationReference("Speech")]
|
||||
[Desc("The sound played when starting to repair a unit.")]
|
||||
public readonly string StartRepairingNotification = null;
|
||||
|
||||
Reference in New Issue
Block a user