Add DamageTypes to Demolition
This commit is contained in:
committed by
abcdefg30
parent
54c4a05062
commit
8aeec24c9b
@@ -12,6 +12,7 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using OpenRA.Effects;
|
||||
using OpenRA.Primitives;
|
||||
using OpenRA.Traits;
|
||||
|
||||
namespace OpenRA.Mods.Common.Traits
|
||||
@@ -60,6 +61,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
int demolishStep;
|
||||
int demolishDelay;
|
||||
Actor demolishSaboteur;
|
||||
BitSet<DamageType> demolishDamageTypes;
|
||||
|
||||
public BridgeHut(World world, BridgeHutInfo info)
|
||||
{
|
||||
@@ -170,7 +172,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
return true;
|
||||
}
|
||||
|
||||
void IDemolishable.Demolish(Actor self, Actor saboteur, int delay)
|
||||
void IDemolishable.Demolish(Actor self, Actor saboteur, int delay, BitSet<DamageType> damageTypes)
|
||||
{
|
||||
// TODO: Handle using ITick
|
||||
self.World.Add(new DelayedAction(delay, () =>
|
||||
@@ -188,11 +190,12 @@ namespace OpenRA.Mods.Common.Traits
|
||||
{
|
||||
demolishStep = 0;
|
||||
demolishSaboteur = saboteur;
|
||||
demolishDamageTypes = damageTypes;
|
||||
DemolishStep();
|
||||
}
|
||||
else
|
||||
foreach (var s in segments.Values)
|
||||
s.Demolish(saboteur);
|
||||
s.Demolish(saboteur, damageTypes);
|
||||
}
|
||||
}));
|
||||
}
|
||||
@@ -214,7 +217,7 @@ namespace OpenRA.Mods.Common.Traits
|
||||
|
||||
if (demolishStep < segmentLocations.Count)
|
||||
foreach (var c in segmentLocations[demolishStep])
|
||||
segments[c].Demolish(demolishSaboteur);
|
||||
segments[c].Demolish(demolishSaboteur, demolishDamageTypes);
|
||||
|
||||
demolishDelay = Info.DemolishPropagationDelay;
|
||||
|
||||
|
||||
Reference in New Issue
Block a user