Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- using System.Collections.Generic;
- using OpenRA.Traits;
- namespace OpenRA.Mods.Common.Traits
- {
- class GivesBloodBountyInfo : ITraitInfo
- {
- public object Create(ActorInitializer init) { return new GivesBloodBounty(init.Self, this); }
- }
- class GivesBloodBounty : INotifyKilled
- {
- // readonly GivesBloodBountyInfo info;
- public GivesBloodBounty(Actor self, GivesBloodBountyInfo info)
- {
- // this.info = info;
- }
- void INotifyKilled.Killed(Actor self, AttackInfo e)
- {
- Log.Write("debug", "GivesBloodBounty: I was killed");
- var map = self.World.Map;
- var targetCells = map.FindTilesInCircle(self.Location, 7);
- foreach (var cell in targetCells)
- {
- foreach (var otherActor in self.World.ActorMap.GetActorsAt(cell))
- {
- var bloodDrinker = otherActor.TraitOrDefault<BloodCashTrickler>();
- if (bloodDrinker != null)
- {
- bloodDrinker.GiveBloodCash(self.GetSellValue());
- return;
- }
- }
- }
- }
- }
- }
Add Comment
Please, Sign In to add comment