various fixes towards LegacyCapture
- sniper using Captures, but churches using LegacyCapturable - unable to parse CaptureThreshold/SabotageHPRemoval from yaml - not firing up INotifyCapture and breaking: * sniper transforming the church on capture in ra * proc not giving away it's contents in cnc
This commit is contained in:
@@ -46,10 +46,10 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
|
|
||||||
target.Actor.ChangeOwner(self.Owner);
|
target.Actor.ChangeOwner(self.Owner);
|
||||||
|
|
||||||
foreach (var t in self.TraitsImplementing<INotifyCapture>())
|
foreach (var t in target.Actor.TraitsImplementing<INotifyCapture>())
|
||||||
t.OnCapture(target.Actor, self, oldOwner, self.Owner);
|
t.OnCapture(target.Actor, self, oldOwner, self.Owner);
|
||||||
|
|
||||||
foreach (var t in self.World.ActorsWithTrait<INotifyOtherCaptured>())
|
foreach (var t in target.Actor.World.ActorsWithTrait<INotifyOtherCaptured>())
|
||||||
t.Trait.OnActorCaptured(t.Actor, target.Actor, self, oldOwner, self.Owner);
|
t.Trait.OnActorCaptured(t.Actor, target.Actor, self, oldOwner, self.Owner);
|
||||||
|
|
||||||
if (b != null && b.Locked)
|
if (b != null && b.Locked)
|
||||||
@@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA.Activities
|
|||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
int damage = (int)(health.MaxHP * capturesInfo.SabotageHPRemoval);
|
var damage = (int)(health.MaxHP * capturesInfo.SabotageHPRemoval);
|
||||||
target.Actor.InflictDamage(self, damage, null);
|
target.Actor.InflictDamage(self, damage, null);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public readonly bool AllowNeutral = true;
|
public readonly bool AllowNeutral = true;
|
||||||
public readonly bool AllowEnemies = true;
|
public readonly bool AllowEnemies = true;
|
||||||
[Desc("Health percentage the target must be at (or below) before it can be captured.")]
|
[Desc("Health percentage the target must be at (or below) before it can be captured.")]
|
||||||
public readonly double CaptureThreshold = 0.5;
|
public readonly float CaptureThreshold = 0.5f;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new LegacyCapturable(init.self, this); }
|
public object Create(ActorInitializer init) { return new LegacyCapturable(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,7 +28,7 @@ namespace OpenRA.Mods.RA
|
|||||||
[Desc("Unit will do damage to the actor instead of capturing it. Unit is destroyed when sabotaging.")]
|
[Desc("Unit will do damage to the actor instead of capturing it. Unit is destroyed when sabotaging.")]
|
||||||
public readonly bool Sabotage = true;
|
public readonly bool Sabotage = true;
|
||||||
[Desc("Only used if Sabotage=true. Sabotage damage expressed as a percentage of enemy health removed.")]
|
[Desc("Only used if Sabotage=true. Sabotage damage expressed as a percentage of enemy health removed.")]
|
||||||
public readonly double SabotageHPRemoval = 0.5;
|
public readonly float SabotageHPRemoval = 0.5f;
|
||||||
|
|
||||||
public object Create(ActorInitializer init) { return new LegacyCaptures(init.self, this); }
|
public object Create(ActorInitializer init) { return new LegacyCaptures(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -92,7 +92,8 @@ V01:
|
|||||||
IntoActor: v01.sniper
|
IntoActor: v01.sniper
|
||||||
SkipMakeAnims: true
|
SkipMakeAnims: true
|
||||||
LegacyCapturable:
|
LegacyCapturable:
|
||||||
Type: civilianbuilding
|
Type: CivilianBuilding
|
||||||
|
CaptureThreshold: 1
|
||||||
EditorTilesetFilter:
|
EditorTilesetFilter:
|
||||||
ExcludeTilesets: DESERT
|
ExcludeTilesets: DESERT
|
||||||
|
|
||||||
|
|||||||
@@ -480,6 +480,7 @@ SNIPER:
|
|||||||
CloakSound:
|
CloakSound:
|
||||||
UncloakSound:
|
UncloakSound:
|
||||||
UncloakOnMove: yes
|
UncloakOnMove: yes
|
||||||
Captures:
|
LegacyCaptures:
|
||||||
CaptureTypes: civilianbuilding
|
CaptureTypes: CivilianBuilding
|
||||||
AllowAllies: true
|
Sabotage: no
|
||||||
|
SabotageHPRemoval: 0
|
||||||
|
|||||||
Reference in New Issue
Block a user