Make mines targetable and removable.
Let AP mines do damage against vehicles. Let all mines do damage against friendly units.
This commit is contained in:
@@ -20,7 +20,6 @@ namespace OpenRA.Mods.RA
|
||||
class MineInfo : ITraitInfo
|
||||
{
|
||||
public readonly string[] CrushClasses = { };
|
||||
[WeaponReference] public readonly string Weapon = "ATMine";
|
||||
public readonly bool AvoidFriendly = true;
|
||||
public readonly string[] DetonateClasses = { };
|
||||
|
||||
@@ -44,15 +43,14 @@ namespace OpenRA.Mods.RA
|
||||
|
||||
public void OnCrush(Actor crusher)
|
||||
{
|
||||
if (crusher.HasTrait<MineImmune>() || self.Owner.Stances[crusher.Owner] == Stance.Ally)
|
||||
if (crusher.HasTrait<MineImmune>() || (self.Owner.Stances[crusher.Owner] == Stance.Ally && info.AvoidFriendly))
|
||||
return;
|
||||
|
||||
var mobile = crusher.TraitOrDefault<Mobile>();
|
||||
if (mobile != null && !info.DetonateClasses.Intersect(mobile.Info.Crushes).Any())
|
||||
return;
|
||||
|
||||
Combat.DoExplosion(self, info.Weapon, crusher.CenterLocation, 0);
|
||||
self.QueueActivity(new RemoveSelf());
|
||||
self.Kill(crusher);
|
||||
}
|
||||
|
||||
public bool CrushableBy(string[] crushClasses, Player owner)
|
||||
|
||||
@@ -651,12 +651,15 @@ World:
|
||||
|
||||
MINP:
|
||||
Mine:
|
||||
Weapon: APMine
|
||||
CrushClasses: apmine,atmine
|
||||
DetonateClasses: apmine
|
||||
AvoidFriendly: yes
|
||||
DetonateClasses: apmine,atmine
|
||||
AvoidFriendly: no
|
||||
Explodes:
|
||||
Weapon: APMine
|
||||
Health:
|
||||
HP: 1
|
||||
HP: 50
|
||||
Armor:
|
||||
Type: Light
|
||||
RenderSimple:
|
||||
BelowUnits:
|
||||
Cloak:
|
||||
@@ -668,15 +671,20 @@ MINP:
|
||||
Icon: jmin
|
||||
ProximityCaptor:
|
||||
Types: Mine
|
||||
TargetableUnit:
|
||||
TargetTypes: Ground
|
||||
|
||||
MINV:
|
||||
Mine:
|
||||
Weapon: ATMine
|
||||
CrushClasses: atmine,apmine
|
||||
DetonateClasses: atmine
|
||||
AvoidFriendly: yes
|
||||
AvoidFriendly: no
|
||||
Explodes:
|
||||
Weapon: ATMine
|
||||
Health:
|
||||
HP: 1
|
||||
HP: 50
|
||||
Armor:
|
||||
Type: Light
|
||||
RenderSimple:
|
||||
BelowUnits:
|
||||
Cloak:
|
||||
@@ -688,6 +696,8 @@ MINV:
|
||||
Icon: jmin
|
||||
ProximityCaptor:
|
||||
Types: Mine
|
||||
TargetableUnit:
|
||||
TargetTypes: Ground
|
||||
|
||||
CRATE:
|
||||
Tooltip:
|
||||
|
||||
@@ -1161,11 +1161,11 @@ ATMine:
|
||||
|
||||
APMine:
|
||||
Warhead:
|
||||
Damage: 700
|
||||
Damage: 500
|
||||
Versus:
|
||||
Wood: 0%
|
||||
Light: 0%
|
||||
Heavy: 0%
|
||||
Light: 10%
|
||||
Heavy: 10%
|
||||
Concrete: 0%
|
||||
ImpactSound: mine1
|
||||
InfDeath: 3
|
||||
|
||||
Reference in New Issue
Block a user