public AnimationEffect(string spriteName, VisualEffectTarget target, int startFrameIndex, double hueShift = 0, double saturation = -1, double brightness = -1) { this.spriteName = spriteName; this.target = target; this.startFrameIndex = startFrameIndex; this.hueShift = hueShift; this.saturation = saturation; this.brightness = brightness; effectKind = EffectKind.Animation; }
public AnimationEffect() { spriteName = string.Empty; target = new VisualEffectTarget(960, 540); startFrameIndex = 0; hueShift = 0; saturation = 100; brightness = 100; effectKind = EffectKind.Animation; target = new VisualEffectTarget(); }
public void AddSpellEffect(VisualEffectTarget chestTarget, VisualEffectTarget bottomTarget, ref double scale, double scaleIncrement, ref double autoRotation, ref int timeOffset, SpellEffect spellHit) { string effectName; bool usingSpellHits = true; VisualEffectTarget target; if (!string.IsNullOrWhiteSpace(spellHit.EffectName)) { effectName = spellHit.EffectName; usingSpellHits = false; target = bottomTarget; } else { effectName = GetRandomHitSpellName(); target = chestTarget; } AnimationEffect effectBonus = AnimationEffect.CreateEffect(effectName, target, spellHit.Hue, spellHit.Saturation, spellHit.Brightness, spellHit.SecondaryHue, spellHit.SecondarySaturation, spellHit.SecondaryBrightness, spellHit.XOffset, spellHit.YOffset, spellHit.VelocityX, spellHit.VelocityY); if (usingSpellHits) { effectBonus.timeOffsetMs = timeOffset; effectBonus.scale = scale; effectBonus.autoRotation = autoRotation; autoRotation *= -1; scale *= scaleIncrement; timeOffset += 200; } else { if (spellHit.TimeOffset > int.MinValue) { effectBonus.timeOffsetMs = spellHit.TimeOffset; } else { effectBonus.timeOffsetMs = timeOffset; timeOffset += 200; } effectBonus.scale = spellHit.Scale; effectBonus.autoRotation = spellHit.AutoRotation; effectBonus.rotation = spellHit.Rotation; } this.Add(effectBonus); }
public static AnimationEffect CreateEffect(string spriteName, VisualEffectTarget target, int hueShift = 0, int saturation = 100, int brightness = 100, int secondaryHueShift = 0, int secondarySaturation = 100, int secondaryBrightness = 100, int xOffset = 0, int yOffset = 0, double velocityX = 0, double velocityY = 0) { AnimationEffect spellEffect = new AnimationEffect(); spellEffect.spriteName = spriteName; spellEffect.hueShift = hueShift; spellEffect.saturation = saturation; spellEffect.brightness = brightness; spellEffect.secondaryHueShift = secondaryHueShift; spellEffect.secondarySaturation = secondarySaturation; spellEffect.secondaryBrightness = secondaryBrightness; spellEffect.xOffset = xOffset; spellEffect.yOffset = yOffset; spellEffect.velocityX = velocityX; spellEffect.velocityY = velocityY; spellEffect.target = target; return(spellEffect); }
public EmitterEffect() { target = new VisualEffectTarget(); effectKind = EffectKind.Emitter; }