Merge pull request #6030 from UberWaffe/CustomWarheads

Custom Warheads refactor
This commit is contained in:
Taryn Hill
2014-08-03 10:35:36 -05:00
59 changed files with 2275 additions and 1233 deletions

View File

@@ -10,6 +10,7 @@
using System.Collections.Generic;
using OpenRA.Effects;
using OpenRA.GameRules;
using OpenRA.Graphics;
using OpenRA.Mods.RA;
using OpenRA.Traits;
@@ -44,7 +45,8 @@ namespace OpenRA.Mods.Cnc.Effects
void Finish(World world)
{
world.AddFrameEndTask(w => w.Remove(this));
Combat.DoExplosion(firedBy.PlayerActor, weapon, target.CenterPosition);
var weapon = world.Map.Rules.Weapons[this.weapon.ToLowerInvariant()];
weapon.Impact(target.CenterPosition, firedBy.PlayerActor, 1f);
}
}
}

View File

@@ -11,6 +11,7 @@
using System.Linq;
using OpenRA.Traits;
using OpenRA.Mods.RA;
using OpenRA.GameRules;
namespace OpenRA.Mods.Cnc
{
@@ -42,8 +43,7 @@ namespace OpenRA.Mods.Cnc
if (!info.Resources.Contains(r.Info.Name)) return;
var weapon = self.World.Map.Rules.Weapons[info.Weapon.ToLowerInvariant()];
self.InflictDamage(self.World.WorldActor, weapon.Warheads[0].Damage, weapon.Warheads[0]);
weapon.Impact(self.CenterPosition, self.World.WorldActor, 1f);
poisonTicks = weapon.ROF;
}
}