Add damagetypes to repairing.
This commit is contained in:
committed by
atlimit8
parent
ca3cfc0184
commit
9e534f3804
@@ -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)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user