Chronosphere implementation plus supporting tweaks to Order
This commit is contained in:
39
OpenRa.Game/SupportPowers/ChronospherePower.cs
Normal file
39
OpenRa.Game/SupportPowers/ChronospherePower.cs
Normal file
@@ -0,0 +1,39 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Drawing;
|
||||
using OpenRa.Game.Orders;
|
||||
using OpenRa.Game.Traits;
|
||||
|
||||
namespace OpenRa.Game.SupportPowers
|
||||
{
|
||||
class ChronospherePower : ISupportPowerImpl
|
||||
{
|
||||
public void IsReadyNotification(SupportPower p) { Sound.Play("chrordy1.aud"); }
|
||||
public void IsChargingNotification(SupportPower p) { Sound.Play("chrochr1.aud"); }
|
||||
|
||||
public void OnFireNotification(Actor target, int2 xy)
|
||||
{
|
||||
p.FinishActivate();
|
||||
Game.controller.CancelInputMode();
|
||||
|
||||
Sound.Play("chrono2.aud");
|
||||
|
||||
foreach (var a in Game.world.Actors.Where(a => a.traits.Contains<ChronoshiftPaletteEffect>()))
|
||||
a.traits.Get<ChronoshiftPaletteEffect>().DoChronoshift();
|
||||
|
||||
// Play chronosphere active anim
|
||||
var chronosphere = Game.world.Actors.Where(a => a.Owner == p.Owner && a.traits.Contains<Chronosphere>()).FirstOrDefault();
|
||||
|
||||
if (chronosphere != null)
|
||||
chronosphere.traits.Get<RenderBuilding>().PlayCustomAnim(chronosphere, "active");
|
||||
}
|
||||
SupportPower p;
|
||||
public void Activate(SupportPower p)
|
||||
{
|
||||
this.p = p;
|
||||
Game.controller.orderGenerator = new ChronosphereSelectOrderGenerator(this);
|
||||
Sound.Play("slcttgt1.aud");
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user