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:
Matthias Mailänder
2013-06-23 12:43:24 +02:00
parent 2b84dbfccf
commit e6bdacce9c
5 changed files with 11 additions and 9 deletions

View File

@@ -46,10 +46,10 @@ namespace OpenRA.Mods.RA.Activities
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);
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);
if (b != null && b.Locked)
@@ -57,7 +57,7 @@ namespace OpenRA.Mods.RA.Activities
}
else
{
int damage = (int)(health.MaxHP * capturesInfo.SabotageHPRemoval);
var damage = (int)(health.MaxHP * capturesInfo.SabotageHPRemoval);
target.Actor.InflictDamage(self, damage, null);
}

View File

@@ -23,7 +23,7 @@ namespace OpenRA.Mods.RA
public readonly bool AllowNeutral = true;
public readonly bool AllowEnemies = true;
[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); }
}

View File

@@ -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.")]
public readonly bool Sabotage = true;
[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); }
}

View File

@@ -92,7 +92,8 @@ V01:
IntoActor: v01.sniper
SkipMakeAnims: true
LegacyCapturable:
Type: civilianbuilding
Type: CivilianBuilding
CaptureThreshold: 1
EditorTilesetFilter:
ExcludeTilesets: DESERT

View File

@@ -480,6 +480,7 @@ SNIPER:
CloakSound:
UncloakSound:
UncloakOnMove: yes
Captures:
CaptureTypes: civilianbuilding
AllowAllies: true
LegacyCaptures:
CaptureTypes: CivilianBuilding
Sabotage: no
SabotageHPRemoval: 0