public SprinklerProjectile(Piece parent, double timeToLiveInSeconds) : base(parent, timeToLiveInSeconds) { Color = GsMath.Lerp(GsColor.LightBlue, GsColor.DarkBlue, .65f); Size = new GsSize(10f, 8f); ImageKey = "fragment"; }
protected override void UpgradeProjectileVariables(float factor) { base.UpgradeProjectileVariables(factor); float mu = (float)Level / (float)MaxLevel; ProjectileSpeed = GsMath.Lerp(MinVelocity, MaxVelocity, mu); mPiePieces = GsMath.Lerp(MinPieSlices, MaxPieSlices, mu); NumberProjectilesToFire = 1; ProjectilesPerSecond = TotalSeconds * mPiePieces; }
public DebriProjectile(Piece parent, Projectile projectile, float orientation) : base(parent, .3) { Velocity = Calculator.ComputeProjectileDirection(orientation) * 100f; Attack = projectile.Attack * 3f; Color = GsMath.Lerp(GsColor.Yellow, GsColor.Black, .55f); Orientation = orientation; Position = projectile.Position; Size = new GsSize(3.5f, 3.5f); ImageKey = "debri"; }
protected void DrawProgressState(DrawParams dparams, GsRectangle bounds, GsRectangle inside) { float width = inside.Width; float height = (float)Math.Round(inside.Height / 3f); float x = inside.X + ((inside.Width / 2f) - (width / 2f)); float y = inside.Y + ((inside.Height / 2f) - (height / 2f)); float progressWidth = width * Calculator.CalculatePercent(ProgressValue, 0, MaxProgress); float factor = ProgressValue / (MaxProgress); GsColor barFill = GsMath.Lerp(GsColor.Red, GsColor.DarkGreen, factor); GsColor barBder = GsColor.Black; dparams.Graphics.FillRectangle(barFill, x, y, progressWidth, height); dparams.Graphics.DrawRectangle(barBder, x, y, width, height); }
public override void Update(TimeSpan elapsed) { // let the base update base.Update(elapsed); // if we're idle, then we COULD be firing if (State == PieceState.Idle) { UpdateTeslaState(elapsed); } else { mTeslaState = TeslaState.Idle; mIndex = 0; } float factor = ((float)mIndex) / ((float)NumberIndexFrames); Color = GsMath.Lerp(GsColor.Beige, LightningColor, factor); }
public TeslaCoilPiece() { // setup the description StringBuilder sb = new StringBuilder(); sb.AppendLine("Fires a charged burst of electricity. The burst is very effective against ground units."); // set the properties needed Attack = 9000; Price = 2500; Radius = 250; UpgradePercent = 45; LevelVisibility = 75; Description = sb.ToString(); ProjectileLifeInSeconds = 6.7f; CanFireProjectiles = false; Name = TeslaCoilName; UltimateName = UltimateTeslaCoilName; Grouping = PieceGrouping.Three; ImageKey = "teslaCoil"; Element = Element.Electricity; Specialty = PieceSpecialty.Both; // set the properties of the piece mIndex = 0; mAggregateTimeSinceUpdate = 0; mTeslaState = TeslaState.Idle; Color = GsColor.White; // get the image var image = GetImage(); var imageSize = ImageProvider.GetSize(image); FrameSize = new GsSize(imageSize.Width / (NumberIndexFrames + 1), imageSize.Height); LightningColor = GsMath.Lerp(GsColor.Purple, GsColor.DarkBlue, .5f); LightningColor = GsMath.Lerp(LightningColor, GsColor.Red, .75f); }
public RailgunProjectile(Piece parent, double timeToLiveInSeconds) : base(parent, timeToLiveInSeconds) { Color = GsMath.Lerp(GsColor.Yellow, GsColor.Red, .65f); ImageKey = "pulse"; }