Have civilians come out of disturbed buildings
This commit is contained in:
@@ -505,7 +505,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
public object Create(ActorInitializer init) { return new Allies04TryRepairBuilding(this); }
|
||||
}
|
||||
|
||||
class Allies04TryRepairBuilding : INotifyDamage
|
||||
class Allies04TryRepairBuilding : INotifyDamageStateChanged
|
||||
{
|
||||
Allies04TryRepairBuildingInfo info;
|
||||
|
||||
@@ -514,7 +514,7 @@ namespace OpenRA.Mods.RA.Missions
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public void Damaged(Actor self, AttackInfo e)
|
||||
public void DamageStateChanged(Actor self, AttackInfo e)
|
||||
{
|
||||
if (self.HasTrait<RepairableBuilding>() && self.Owner.InternalName == info.Player && Game.IsHost
|
||||
&& e.DamageState > DamageState.Undamaged && e.PreviousDamageState == DamageState.Undamaged)
|
||||
|
||||
@@ -173,4 +173,40 @@ namespace OpenRA.Mods.RA.Missions
|
||||
});
|
||||
}
|
||||
}
|
||||
|
||||
class Soviet01ClassicContainsActorsInfo : ITraitInfo
|
||||
{
|
||||
public readonly string[] Actors = { };
|
||||
|
||||
public object Create(ActorInitializer init) { return new Soviet01ClassicContainsActors(this); }
|
||||
}
|
||||
|
||||
class Soviet01ClassicContainsActors : INotifyDamage
|
||||
{
|
||||
bool spawned;
|
||||
Soviet01ClassicContainsActorsInfo info;
|
||||
|
||||
public Soviet01ClassicContainsActors(Soviet01ClassicContainsActorsInfo info)
|
||||
{
|
||||
this.info = info;
|
||||
}
|
||||
|
||||
public void Damaged(Actor self, AttackInfo e)
|
||||
{
|
||||
if (spawned || self.IsDead())
|
||||
{
|
||||
return;
|
||||
}
|
||||
foreach (var actor in info.Actors)
|
||||
{
|
||||
var unit = self.World.CreateActor(actor, new TypeDictionary
|
||||
{
|
||||
new OwnerInit(self.Owner),
|
||||
new LocationInit(self.Location)
|
||||
});
|
||||
unit.Trait<Mobile>().Nudge(unit, unit, true);
|
||||
}
|
||||
spawned = true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -235,7 +235,7 @@ Actors:
|
||||
Owner: France
|
||||
Health: 0.5195313
|
||||
Facing: 0
|
||||
Actor54: v07
|
||||
Actor54: v07.civilians
|
||||
Location: 54,65
|
||||
Owner: France
|
||||
Health: 0.4375
|
||||
@@ -570,7 +570,7 @@ Actors:
|
||||
Owner: GoodGuy
|
||||
Health: 1
|
||||
Facing: 0
|
||||
Actor121: v05
|
||||
Actor121: v05.civilians
|
||||
Location: 48,62
|
||||
Owner: France
|
||||
Health: 0.4140625
|
||||
@@ -585,7 +585,7 @@ Actors:
|
||||
Owner: France
|
||||
Health: 0.6640625
|
||||
Facing: 96
|
||||
StartJeep: jeep.explodes
|
||||
StartJeep: jeep
|
||||
Location: 44,76
|
||||
Owner: France
|
||||
Health: 0.5195313
|
||||
@@ -910,13 +910,20 @@ Rules:
|
||||
YAK:
|
||||
Plane:
|
||||
RearmBuildings: afld.noproduction
|
||||
JEEP.Explodes:
|
||||
Inherits: JEEP
|
||||
RenderUnitTurreted:
|
||||
Image: JEEP
|
||||
Tooltip:
|
||||
Icon: jeepicon
|
||||
JEEP:
|
||||
Explodes:
|
||||
V05.Civilians:
|
||||
Inherits: V05
|
||||
RenderBuilding:
|
||||
Image: V05
|
||||
Soviet01ClassicContainsActors:
|
||||
Actors: c3, c4, c7
|
||||
V07.Civilians:
|
||||
Inherits: V07
|
||||
RenderBuilding:
|
||||
Image: V07
|
||||
Soviet01ClassicContainsActors:
|
||||
Actors: c1, c6
|
||||
|
||||
Sequences:
|
||||
|
||||
|
||||
Reference in New Issue
Block a user