added firepower & armor crates
This commit is contained in:
@@ -10,7 +10,6 @@ Armor=10,ARMOR,2.0 ; armor of nearby objects increased (armor multi
|
|||||||
Cloak=0,STEALTH2 ; enable cloaking on nearby objects
|
Cloak=0,STEALTH2 ; enable cloaking on nearby objects
|
||||||
Darkness=1,EMPULSE ; cloak entire radar map
|
Darkness=1,EMPULSE ; cloak entire radar map
|
||||||
Explosion=5,NONE,500 ; high explosive baddie (damage per explosion)
|
Explosion=5,NONE,500 ; high explosive baddie (damage per explosion)
|
||||||
Firepower=10,FPOWER,2.0 ; firepower of nearby objects increased (firepower multiplier)
|
|
||||||
HealBase=1,INVUN ; all buildings to full strength
|
HealBase=1,INVUN ; all buildings to full strength
|
||||||
ICBM=1,MISSILE2 ; nuke missile one time shot
|
ICBM=1,MISSILE2 ; nuke missile one time shot
|
||||||
Napalm=5,NONE,600 ; fire explosion baddie (damage)
|
Napalm=5,NONE,600 ; fire explosion baddie (damage)
|
||||||
|
|||||||
48
OpenRa.Mods.RA/Crate Actions/ArmorUpgradeCrateAction.cs
Normal file
48
OpenRa.Mods.RA/Crate Actions/ArmorUpgradeCrateAction.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using OpenRa.Traits;
|
||||||
|
using OpenRa.Mods.RA.Effects;
|
||||||
|
|
||||||
|
namespace OpenRa.Mods.RA
|
||||||
|
{
|
||||||
|
class ArmorUpgradeCrateActionInfo : ITraitInfo
|
||||||
|
{
|
||||||
|
public float Multiplier = 2.0f;
|
||||||
|
public int SelectionShares = 10;
|
||||||
|
public object Create(Actor self) { return new ArmorUpgradeCrateAction(self); }
|
||||||
|
}
|
||||||
|
|
||||||
|
class ArmorUpgradeCrateAction : ICrateAction
|
||||||
|
{
|
||||||
|
Actor self;
|
||||||
|
public ArmorUpgradeCrateAction(Actor self)
|
||||||
|
{
|
||||||
|
this.self = self;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int SelectionShares
|
||||||
|
{
|
||||||
|
get { return self.Info.Traits.Get<ArmorUpgradeCrateActionInfo>().SelectionShares; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Activate(Actor collector)
|
||||||
|
{
|
||||||
|
Sound.PlayToPlayer(collector.Owner, "armorup1.aud");
|
||||||
|
collector.World.AddFrameEndTask(w =>
|
||||||
|
{
|
||||||
|
var multiplier = self.Info.Traits.Get<ArmorUpgradeCrateActionInfo>().Multiplier;
|
||||||
|
collector.traits.Add(new ArmorUpgrade(multiplier));
|
||||||
|
w.Add(new CrateEffect(collector, "armor"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class ArmorUpgrade : IDamageModifier
|
||||||
|
{
|
||||||
|
float multiplier;
|
||||||
|
public ArmorUpgrade(float multiplier) { this.multiplier = 1/multiplier; }
|
||||||
|
public float GetArmorModifier() { return multiplier; }
|
||||||
|
}
|
||||||
|
}
|
||||||
48
OpenRa.Mods.RA/Crate Actions/FirepowerUpgradeCrateAction.cs
Normal file
48
OpenRa.Mods.RA/Crate Actions/FirepowerUpgradeCrateAction.cs
Normal file
@@ -0,0 +1,48 @@
|
|||||||
|
using System;
|
||||||
|
using System.Collections.Generic;
|
||||||
|
using System.Linq;
|
||||||
|
using System.Text;
|
||||||
|
using OpenRa.Traits;
|
||||||
|
using OpenRa.Mods.RA.Effects;
|
||||||
|
|
||||||
|
namespace OpenRa.Mods.RA
|
||||||
|
{
|
||||||
|
class FirepowerUpgradeCrateActionInfo : ITraitInfo
|
||||||
|
{
|
||||||
|
public float Multiplier = 2.0f;
|
||||||
|
public int SelectionShares = 10;
|
||||||
|
public object Create(Actor self) { return new FirepowerUpgradeCrateAction(self); }
|
||||||
|
}
|
||||||
|
|
||||||
|
class FirepowerUpgradeCrateAction : ICrateAction
|
||||||
|
{
|
||||||
|
Actor self;
|
||||||
|
public FirepowerUpgradeCrateAction(Actor self)
|
||||||
|
{
|
||||||
|
this.self = self;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int SelectionShares
|
||||||
|
{
|
||||||
|
get { return self.Info.Traits.Get<FirepowerUpgradeCrateActionInfo>().SelectionShares; }
|
||||||
|
}
|
||||||
|
|
||||||
|
public void Activate(Actor collector)
|
||||||
|
{
|
||||||
|
Sound.PlayToPlayer(collector.Owner, "firepo1.aud");
|
||||||
|
collector.World.AddFrameEndTask(w =>
|
||||||
|
{
|
||||||
|
var multiplier = self.Info.Traits.Get<FirepowerUpgradeCrateActionInfo>().Multiplier;
|
||||||
|
collector.traits.Add(new FirepowerUpgrade(multiplier));
|
||||||
|
w.Add(new CrateEffect(collector, "fpower"));
|
||||||
|
});
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
class FirepowerUpgrade : IFirepowerModifier
|
||||||
|
{
|
||||||
|
float multiplier;
|
||||||
|
public FirepowerUpgrade(float multiplier) { this.multiplier = multiplier; }
|
||||||
|
public float GetFirepowerModifier() { return multiplier; }
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -28,7 +28,7 @@ namespace OpenRa.Mods.RA
|
|||||||
Sound.PlayToPlayer(collector.Owner, "unitspd1.aud");
|
Sound.PlayToPlayer(collector.Owner, "unitspd1.aud");
|
||||||
collector.World.AddFrameEndTask(w =>
|
collector.World.AddFrameEndTask(w =>
|
||||||
{
|
{
|
||||||
float multiplier = self.Info.Traits.Get<SpeedUpgradeCrateActionInfo>().Multiplier;
|
var multiplier = self.Info.Traits.Get<SpeedUpgradeCrateActionInfo>().Multiplier;
|
||||||
collector.traits.Add(new SpeedUpgrade(multiplier));
|
collector.traits.Add(new SpeedUpgrade(multiplier));
|
||||||
w.Add(new CrateEffect(collector, "speed"));
|
w.Add(new CrateEffect(collector, "speed"));
|
||||||
});
|
});
|
||||||
|
|||||||
@@ -52,6 +52,8 @@
|
|||||||
<Compile Include="Activities\LayMine.cs" />
|
<Compile Include="Activities\LayMine.cs" />
|
||||||
<Compile Include="Activities\Steal.cs" />
|
<Compile Include="Activities\Steal.cs" />
|
||||||
<Compile Include="C4Demolition.cs" />
|
<Compile Include="C4Demolition.cs" />
|
||||||
|
<Compile Include="Crate Actions\ArmorUpgradeCrateAction.cs" />
|
||||||
|
<Compile Include="Crate Actions\FirepowerUpgradeCrateAction.cs" />
|
||||||
<Compile Include="Crate Actions\GiveCashCrateAction.cs" />
|
<Compile Include="Crate Actions\GiveCashCrateAction.cs" />
|
||||||
<Compile Include="Effects\CrateEffect.cs" />
|
<Compile Include="Effects\CrateEffect.cs" />
|
||||||
<Compile Include="Effects\GpsSatellite.cs" />
|
<Compile Include="Effects\GpsSatellite.cs" />
|
||||||
|
|||||||
@@ -556,6 +556,12 @@ CRATE:
|
|||||||
GiveCashCrateAction:
|
GiveCashCrateAction:
|
||||||
Amount: 2000
|
Amount: 2000
|
||||||
SelectionShares: 50
|
SelectionShares: 50
|
||||||
|
FirepowerUpgradeCrateAction:
|
||||||
|
Multiplier: 2.0
|
||||||
|
SelectionShares: 10
|
||||||
|
ArmorUpgradeCrateAction:
|
||||||
|
Multiplier: 2.0
|
||||||
|
SelectionShares: 10
|
||||||
Unit:
|
Unit:
|
||||||
HP: 1
|
HP: 1
|
||||||
RenderUnit:
|
RenderUnit:
|
||||||
|
|||||||
Reference in New Issue
Block a user