Remove ExcludedActors from crate actions. Use a tag trait for cloakable actors. Ban MCV from receiving cloak.
This commit is contained in:
@@ -59,7 +59,7 @@ namespace OpenRA.Mods.RA
|
|||||||
public void OnCrush(Actor crusher)
|
public void OnCrush(Actor crusher)
|
||||||
{
|
{
|
||||||
var shares = self.TraitsImplementing<CrateAction>().Select(
|
var shares = self.TraitsImplementing<CrateAction>().Select(
|
||||||
a => Pair.New(a, a.GetSelectionSharesOuter(crusher)));
|
a => Pair.New(a, a.GetSelectionShares(crusher)));
|
||||||
var totalShares = shares.Sum(a => a.Second);
|
var totalShares = shares.Sum(a => a.Second);
|
||||||
var n = self.World.SharedRandom.Next(totalShares);
|
var n = self.World.SharedRandom.Next(totalShares);
|
||||||
|
|
||||||
|
|||||||
@@ -19,7 +19,6 @@ namespace OpenRA.Mods.RA
|
|||||||
public int SelectionShares = 10;
|
public int SelectionShares = 10;
|
||||||
public string Effect = null;
|
public string Effect = null;
|
||||||
public string Notification = null;
|
public string Notification = null;
|
||||||
public string[] ExcludedActorTypes = { };
|
|
||||||
|
|
||||||
public virtual object Create(ActorInitializer init) { return new CrateAction(init.self, this); }
|
public virtual object Create(ActorInitializer init) { return new CrateAction(init.self, this); }
|
||||||
}
|
}
|
||||||
@@ -35,14 +34,6 @@ namespace OpenRA.Mods.RA
|
|||||||
this.info = info;
|
this.info = info;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int GetSelectionSharesOuter(Actor collector)
|
|
||||||
{
|
|
||||||
if (info.ExcludedActorTypes.Contains(collector.Info.Name))
|
|
||||||
return 0;
|
|
||||||
|
|
||||||
return GetSelectionShares(collector);
|
|
||||||
}
|
|
||||||
|
|
||||||
public virtual int GetSelectionShares(Actor collector)
|
public virtual int GetSelectionShares(Actor collector)
|
||||||
{
|
{
|
||||||
return info.SelectionShares;
|
return info.SelectionShares;
|
||||||
|
|||||||
@@ -32,8 +32,8 @@ namespace OpenRA.Mods.RA.Crates
|
|||||||
|
|
||||||
public override int GetSelectionShares(Actor collector)
|
public override int GetSelectionShares(Actor collector)
|
||||||
{
|
{
|
||||||
return collector.HasTrait<Cloak>()
|
return collector.HasTrait<AcceptsCloakCrate>() && !collector.HasTrait<Cloak>()
|
||||||
? 0 : base.GetSelectionShares(collector);
|
? base.GetSelectionShares(collector) : 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
public override void Activate(Actor collector)
|
public override void Activate(Actor collector)
|
||||||
@@ -61,4 +61,7 @@ namespace OpenRA.Mods.RA.Crates
|
|||||||
base.Activate(collector);
|
base.Activate(collector);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public class AcceptsCloakCrateInfo : TraitInfo<AcceptsCloakCrate> {}
|
||||||
|
public class AcceptsCloakCrate {}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -28,6 +28,7 @@
|
|||||||
ActorLostNotification:
|
ActorLostNotification:
|
||||||
Notification: unitlost.aud
|
Notification: unitlost.aud
|
||||||
AttackMove:
|
AttackMove:
|
||||||
|
AcceptsCloakCrate:
|
||||||
|
|
||||||
^Tank:
|
^Tank:
|
||||||
AppearsOnRadar:
|
AppearsOnRadar:
|
||||||
@@ -59,6 +60,7 @@
|
|||||||
ActorLostNotification:
|
ActorLostNotification:
|
||||||
Notification: unitlost.aud
|
Notification: unitlost.aud
|
||||||
AttackMove:
|
AttackMove:
|
||||||
|
AcceptsCloakCrate:
|
||||||
|
|
||||||
^Helicopter:
|
^Helicopter:
|
||||||
AppearsOnRadar:
|
AppearsOnRadar:
|
||||||
|
|||||||
@@ -184,7 +184,6 @@ CRATE:
|
|||||||
CloakSound: appear1.aud
|
CloakSound: appear1.aud
|
||||||
UncloakSound: appear1.aud
|
UncloakSound: appear1.aud
|
||||||
Effect: stealth
|
Effect: stealth
|
||||||
ExcludedActorTypes: e1,e2,e3,e4,e5,e6,rmbo,c1,c2,c3,c4,c5,c6,c7,c8,c9,c10
|
|
||||||
GiveMcvCrateAction:
|
GiveMcvCrateAction:
|
||||||
SelectionShares: 2
|
SelectionShares: 2
|
||||||
NoBaseSelectionShares: 9001
|
NoBaseSelectionShares: 9001
|
||||||
|
|||||||
@@ -34,6 +34,7 @@ MCV:
|
|||||||
LeavesHusk:
|
LeavesHusk:
|
||||||
HuskActor: MCV.Husk
|
HuskActor: MCV.Husk
|
||||||
-GainsExperience:
|
-GainsExperience:
|
||||||
|
-AcceptsCloakCrate:
|
||||||
|
|
||||||
HARV:
|
HARV:
|
||||||
Inherits: ^Tank
|
Inherits: ^Tank
|
||||||
|
|||||||
Reference in New Issue
Block a user