Parabomb crates. Multiple can be collected and queued. Support uncharged powers (0 charge time) with appropriate tooltip.
This commit is contained in:
@@ -10,32 +10,30 @@
|
|||||||
|
|
||||||
using System.Linq;
|
using System.Linq;
|
||||||
using OpenRA.Traits;
|
using OpenRA.Traits;
|
||||||
|
using OpenRA.FileFormats;
|
||||||
|
|
||||||
namespace OpenRA.Mods.RA.Crates
|
namespace OpenRA.Mods.RA.Crates
|
||||||
{
|
{
|
||||||
class SupportPowerCrateActionInfo : CrateActionInfo
|
class SupportPowerCrateActionInfo : CrateActionInfo
|
||||||
{
|
{
|
||||||
public readonly string Power = null;
|
public readonly string Proxy = null;
|
||||||
public override object Create(ActorInitializer init) { return new SupportPowerCrateAction(init.self, this); }
|
public override object Create(ActorInitializer init) { return new SupportPowerCrateAction(init.self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
class SupportPowerCrateAction : CrateAction
|
class SupportPowerCrateAction : CrateAction
|
||||||
{
|
{
|
||||||
|
SupportPowerCrateActionInfo Info;
|
||||||
public SupportPowerCrateAction(Actor self, SupportPowerCrateActionInfo info)
|
public SupportPowerCrateAction(Actor self, SupportPowerCrateActionInfo info)
|
||||||
: base(self, info) { }
|
: base(self, info) { Info = info; }
|
||||||
|
|
||||||
|
// The free unit crate requires same race, and the actor to be at least ITeleportable.
|
||||||
|
// We want neither of these properties for crate power proxies.
|
||||||
public override void Activate(Actor collector)
|
public override void Activate(Actor collector)
|
||||||
{
|
{
|
||||||
throw new System.NotImplementedException();
|
collector.World.AddFrameEndTask(w => w.CreateActor(Info.Proxy, new TypeDictionary
|
||||||
// shit and broken. if you have a single-use and a multi-use version of the same
|
{
|
||||||
// support power, this only works by order-coincidence. that's stupid.
|
new OwnerInit( collector.Owner )
|
||||||
|
}));
|
||||||
//var p = collector.Owner.PlayerActor.TraitsImplementing<SupportPower>()
|
|
||||||
// .FirstOrDefault(sp => sp.GetType().Name == (info as SupportPowerCrateActionInfo).Power);
|
|
||||||
|
|
||||||
//if (p != null) p.Give(1);
|
|
||||||
|
|
||||||
//base.Activate(collector);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -103,7 +103,9 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
var pos = drawPos.ToInt2();
|
var pos = drawPos.ToInt2();
|
||||||
var tl = new int2(pos.X-3,pos.Y-3);
|
var tl = new int2(pos.X-3,pos.Y-3);
|
||||||
var m = new int2(pos.X+64+3,pos.Y+48+3);
|
var m = new int2(pos.X+64+3,pos.Y+48+3);
|
||||||
var br = tl + new int2(64+3+20,60);
|
var br = tl + new int2(64+3+20,40);
|
||||||
|
if (sp.TotalTime > 0)
|
||||||
|
br += new int2(0,20);
|
||||||
|
|
||||||
if (sp.Info.LongDesc != null)
|
if (sp.Info.LongDesc != null)
|
||||||
br += Game.Renderer.RegularFont.Measure(sp.Info.LongDesc.Replace("\\n", "\n"));
|
br += Game.Renderer.RegularFont.Measure(sp.Info.LongDesc.Replace("\\n", "\n"));
|
||||||
@@ -122,9 +124,12 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
pos += new int2(77, 5);
|
pos += new int2(77, 5);
|
||||||
Game.Renderer.BoldFont.DrawText(sp.Info.Description, pos, Color.White);
|
Game.Renderer.BoldFont.DrawText(sp.Info.Description, pos, Color.White);
|
||||||
|
|
||||||
pos += new int2(0,20);
|
if (sp.TotalTime > 0)
|
||||||
Game.Renderer.BoldFont.DrawText(WidgetUtils.FormatTime(sp.RemainingTime).ToString(), pos, Color.White);
|
{
|
||||||
Game.Renderer.BoldFont.DrawText("/ {0}".F(WidgetUtils.FormatTime(sp.TotalTime)), pos + new int2(45,0), Color.White);
|
pos += new int2(0,20);
|
||||||
|
Game.Renderer.BoldFont.DrawText(WidgetUtils.FormatTime(sp.RemainingTime).ToString(), pos, Color.White);
|
||||||
|
Game.Renderer.BoldFont.DrawText("/ {0}".F(WidgetUtils.FormatTime(sp.TotalTime)), pos + new int2(45,0), Color.White);
|
||||||
|
}
|
||||||
|
|
||||||
if (sp.Info.LongDesc != null)
|
if (sp.Info.LongDesc != null)
|
||||||
{
|
{
|
||||||
@@ -136,7 +141,7 @@ namespace OpenRA.Mods.RA.Widgets
|
|||||||
WidgetUtils.DrawSHP(image, drawPos, wr);
|
WidgetUtils.DrawSHP(image, drawPos, wr);
|
||||||
|
|
||||||
clock.PlayFetchIndex("idle",
|
clock.PlayFetchIndex("idle",
|
||||||
() => (sp.TotalTime - sp.RemainingTime)
|
() => sp.TotalTime == 0 ? clock.CurrentSequence.Length - 1 : (sp.TotalTime - sp.RemainingTime)
|
||||||
* (clock.CurrentSequence.Length - 1) / sp.TotalTime);
|
* (clock.CurrentSequence.Length - 1) / sp.TotalTime);
|
||||||
clock.Tick();
|
clock.Tick();
|
||||||
|
|
||||||
|
|||||||
@@ -33,16 +33,6 @@ Player:
|
|||||||
# OneShot: yes
|
# OneShot: yes
|
||||||
# EndChargeSound: pulse1.aud
|
# EndChargeSound: pulse1.aud
|
||||||
# SelectTargetSound: slcttgt1.aud
|
# SelectTargetSound: slcttgt1.aud
|
||||||
# AirstrikePower:
|
|
||||||
# Image: pbmbicon
|
|
||||||
# ChargeTime: 1
|
|
||||||
# Description: Parabombs (Single Use)
|
|
||||||
# LongDesc: A Badger drops a load of parachuted bombs on your target.
|
|
||||||
# GivenAuto: no
|
|
||||||
# OneShot: yes
|
|
||||||
# UnitType: badr.bomber
|
|
||||||
# SelectTargetSound: slcttgt1.aud
|
|
||||||
# FlareType: flare
|
|
||||||
SupportPowerManager:
|
SupportPowerManager:
|
||||||
ConquestVictoryConditions:
|
ConquestVictoryConditions:
|
||||||
PowerManager:
|
PowerManager:
|
||||||
@@ -94,8 +84,8 @@ World:
|
|||||||
BridgeLayer:
|
BridgeLayer:
|
||||||
Bridges: bridge1, bridge2, br1, br2, br3
|
Bridges: bridge1, bridge2, br1, br2, br3
|
||||||
CrateDrop:
|
CrateDrop:
|
||||||
Minimum: 1
|
Minimum: 100
|
||||||
Maximum: 3
|
Maximum: 300
|
||||||
SpawnInterval: 120
|
SpawnInterval: 120
|
||||||
WaterChance: .2
|
WaterChance: .2
|
||||||
PaletteFromCurrentTileset:
|
PaletteFromCurrentTileset:
|
||||||
@@ -234,9 +224,9 @@ CRATE:
|
|||||||
SelectionShares: 1
|
SelectionShares: 1
|
||||||
Effect: reveal-map
|
Effect: reveal-map
|
||||||
SupportPowerCrateAction@parabombs:
|
SupportPowerCrateAction@parabombs:
|
||||||
Power: AirstrikePower
|
SelectionShares: 50000
|
||||||
SelectionShares: 5
|
Proxy: crateproxy.parabombs
|
||||||
Effect: parabombs
|
RequiresRace: no
|
||||||
GiveMcvCrateAction:
|
GiveMcvCrateAction:
|
||||||
SelectionShares: 2
|
SelectionShares: 2
|
||||||
NoBaseSelectionShares: 9001
|
NoBaseSelectionShares: 9001
|
||||||
@@ -281,3 +271,16 @@ FLARE:
|
|||||||
RenderFlare:
|
RenderFlare:
|
||||||
Image: smokland
|
Image: smokland
|
||||||
HiddenUnderFog:
|
HiddenUnderFog:
|
||||||
|
Tooltip:
|
||||||
|
Name: Flare
|
||||||
|
|
||||||
|
crateproxy.parabombs:
|
||||||
|
AirstrikePower:
|
||||||
|
Image: pbmbicon
|
||||||
|
Description: Parabombs (Single Use)
|
||||||
|
LongDesc: A Badger drops a load of parachuted\nbombs on your target.
|
||||||
|
OneShot: yes
|
||||||
|
AllowMultiple: yes
|
||||||
|
UnitType: badr.bomber
|
||||||
|
SelectTargetSound: slcttgt1.aud
|
||||||
|
FlareType: flare
|
||||||
Reference in New Issue
Block a user