private void EffectDisplayed(EffectDisplayEvent args) { if (args.Effect is Effects.SpellCastEffect && args.Sprite.CanBeRotated) { args.Sprite.Rotation = -args.Sprite.Rotation; } }
protected virtual void Run(Vector2 position, Action <EffectDisplayEvent> initHandler = null) { var sprite = CreateSprite(position); var evt = new EffectDisplayEvent(this, sprite, TweenCommands); initHandler?.Invoke(evt); evt.Trigger(); Animate(sprite); ApplyTweens(sprite, evt.TweenCommands); }
protected static void Initialize(EffectDisplayEvent evt) { float duration = CDGMath.RandomFloat(0.5f, 1f); float scaleTo = CDGMath.RandomFloat(0f, 0.1f); var cmd = _defaultTweens[0]; cmd.Duration = duration; cmd.Properties[1] = scaleTo.ToString(); cmd.Properties[3] = scaleTo.ToString(); cmd = _defaultTweens[1]; cmd.Duration = duration; cmd.Properties[1] = CDGMath.RandomInt(-50, 50).ToString(); cmd.Properties[3] = CDGMath.RandomInt(-50, 50).ToString(); cmd = _defaultTweens[2]; cmd.Duration = duration - 0.1f; cmd.Properties[1] = CDGMath.RandomInt(145, 190).ToString(); cmd = _defaultTweens[3]; cmd.Duration = duration - 0.2f; }
protected virtual void EffectDisplay(EffectDisplayEvent args) { //if (args.Effect is SpellCastEffect) // args.Sprite.TextureColor = Color.Red; }
protected virtual void Run(Vector2 position, Action<EffectDisplayEvent> initHandler = null) { var sprite = CreateSprite(position); var evt = new EffectDisplayEvent(this, sprite, TweenCommands); initHandler?.Invoke(evt); evt.Trigger(); Animate(sprite); ApplyTweens(sprite, evt.TweenCommands); }