add Chance (%) value to Explodes:
This commit is contained in:
@@ -18,7 +18,9 @@ namespace OpenRA.Mods.RA
|
||||
[WeaponReference]
|
||||
public readonly string Weapon = "UnitExplode";
|
||||
[WeaponReference]
|
||||
public readonly string EmptyWeapon = "UnitExplode";
|
||||
public readonly string EmptyWeapon = "UnitExplode";
|
||||
|
||||
public readonly int Chance = 100;
|
||||
}
|
||||
|
||||
class Explodes : INotifyDamage
|
||||
@@ -26,7 +28,10 @@ namespace OpenRA.Mods.RA
|
||||
public void Damaged(Actor self, AttackInfo e)
|
||||
{
|
||||
if (e.DamageState == DamageState.Dead)
|
||||
{
|
||||
{
|
||||
if (self.World.SharedRandom.Next(100) > self.Info.Traits.Get<ExplodesInfo>().Chance)
|
||||
return;
|
||||
|
||||
var weapon = ChooseWeaponForExplosion(self);
|
||||
if (weapon != null)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user