예제 #1
0
 static public void MoveBlinkRender(BattleAnimation ba, SpriteBatch spriteBatch)
 {
     if (ba.IsModulo_Zero()) // This to make the animation a bit slower for the eyes.
     {
         spriteBatch.Draw(ba.anim_tex, ba.destRect, ba.sourceRect, Color.White, 0f, Vector2.Zero, SpriteEffects.None, 0f);
     }
 }
예제 #2
0
        public EffectQueueObject QueueMove(MoveArgs moveArgs, ContentManager contentManager)
        {
            string str = string.Format("sprites/moves/{0}", moveArgs.MoveUsed.asset_name);


            var anim_move = new BattleAnimation(2f, contentManager.Load <Texture2D>(str), moveArgs.Target.renderData.sprite_dest, moveArgs.Target.renderData.sprite_rect);


            // TODO: Implement more animations
            anim_move.HookRender(MoveDelegateBank.MoveBlinkRender);


            var moveResult = moveArgs.MoveUsed.moveDelegate(moveArgs);


            var anim_healthbar = new BattleAnimation(this, moveArgs.Target, moveResult.OutputDamage);


            if (moveArgs.MoveUsed.move_type == MOVE_TYPE.Damage)
            {
                anim_healthbar.HookUpdate(MoveDelegateBank.DamageUpdate);
            }



            BattleAnimation[] arr = new BattleAnimation[]
            {
                anim_move,
                anim_healthbar
            };


            var q = new EffectQueueObject()
            {
                Animations = arr,
                Move       = moveArgs.MoveUsed,
                MoveResult = moveResult,
                User       = moveArgs.User,
                Target     = moveArgs.Target
            };

            effect_que.Add(new List <EffectQueueObject>
            {
                q
            });

            return(q);
        }
예제 #3
0
        // DON'T TOUCH THIS
        /// <summary>
        /// This method is why the health bar is "animated"
        /// </summary>
        static public void DamageUpdate(BattleAnimation ba, float delta)
        {
            if (ba.IsModulo_Zero()) // This to make the animation a bit slower for the eyes.
            {
                if (ba.total_damage <= 0)
                {
                    ba.anim_duration      = 1f;
                    ba.anim_time          = 0f;
                    ba.animUpdateDelegate = null;



                    return; // Fast exit
                }

                ba.mon.stats.ReduceHealth(1);
                ba.total_damage -= 1;
            }
        }
예제 #4
0
 public static void Render_DeathAnimation(BattleAnimation ba, SpriteBatch spriteBatch)
 {
     ba.mon.renderData.sprite_dest.Y += 10;
 }