Exemple #1
0
    public static void Player_Character(byte Index)
    {
        byte  Coluna = Jogo.Animation_Stop;
        int   x, y;
        short x2 = Lists.Player[Index].X2, y2 = Lists.Player[Index].Y2;
        bool  Suffering = false;
        short Texture   = Player.Character_Texture(Index);

        // Previni sobrecargas
        if (Texture <= 0 || Texture > Tex_Character.GetUpperBound(0))
        {
            return;
        }

        // Define a Animation
        if (Lists.Player[Index].Atacando && Lists.Player[Index].Attack_Time + Jogo.Attack_Velocity / 2 > Environment.TickCount)
        {
            Coluna = Jogo.Animation_Attack;
        }
        else
        {
            if (x2 > 8 && x2 < Jogo.Grade)
            {
                Coluna = Lists.Player[Index].Animation;
            }
            if (x2 < -8 && x2 > Jogo.Grade * -1)
            {
                Coluna = Lists.Player[Index].Animation;
            }
            if (y2 > 8 && y2 < Jogo.Grade)
            {
                Coluna = Lists.Player[Index].Animation;
            }
            if (y2 < -8 && y2 > Jogo.Grade * -1)
            {
                Coluna = Lists.Player[Index].Animation;
            }
        }

        // Demonstra que o Character está Suffering dano
        if (Lists.Player[Index].Suffering > 0)
        {
            Suffering = true;
        }

        // Desenha o Player
        x = Lists.Player[Index].X * Jogo.Grade + Lists.Player[Index].X2;
        y = Lists.Player[Index].Y * Jogo.Grade + Lists.Player[Index].Y2;
        Character(Texture, new Point(Jogo.ConvertX(x), Jogo.ConvertY(y)), Lists.Player[Index].Direction, Coluna, Suffering);
        Player_Name(Index, x, y);
        Player_Bars(Index, x, y);
    }
Exemple #2
0
    private static void NPC(byte Index)
    {
        int   x2 = Lists.Temp_Map.NPC[Index].X2, y2 = Lists.Temp_Map.NPC[Index].Y2;
        byte  Column  = 0;
        bool  Hurt    = false;
        short Texture = Lists.NPC[Lists.Temp_Map.NPC[Index].Index].Texture;

        // Previne sobrecargas
        if (Texture <= 0 || Texture > Tex_Character.GetUpperBound(0))
        {
            return;
        }

        // Define a animação
        if (Lists.Temp_Map.NPC[Index].Attacking && Lists.Temp_Map.NPC[Index].Attack_Timer + Game.Attack_Speed / 2 > Environment.TickCount)
        {
            Column = Game.Animation_Attack;
        }
        else
        {
            if (x2 > 8 && x2 < Game.Grid)
            {
                Column = Lists.Temp_Map.NPC[Index].Animation;
            }
            else if (x2 < -8 && x2 > Game.Grid * -1)
            {
                Column = Lists.Temp_Map.NPC[Index].Animation;
            }
            else if (y2 > 8 && y2 < Game.Grid)
            {
                Column = Lists.Temp_Map.NPC[Index].Animation;
            }
            else if (y2 < -8 && y2 > Game.Grid * -1)
            {
                Column = Lists.Temp_Map.NPC[Index].Animation;
            }
        }

        // Demonstra que o personagem está sofrendo dano
        if (Lists.Temp_Map.NPC[Index].Hurt > 0)
        {
            Hurt = true;
        }

        // Desenha o jogador
        int x = Lists.Temp_Map.NPC[Index].X * Game.Grid + x2;
        int y = Lists.Temp_Map.NPC[Index].Y * Game.Grid + y2;

        Character(Texture, new Point(Game.ConvertX(x), Game.ConvertY(y)), Lists.Temp_Map.NPC[Index].Direction, Column, Hurt);
        NPC_Name(Index, x, y);
        NPC_Bars(Index, x, y);
    }
Exemple #3
0
    private static void Player_Texture(byte Index)
    {
        byte  Column = Game.Animation_Stopped;
        int   x = Lists.Player[Index].X * Game.Grid + Lists.Player[Index].X2, y = Lists.Player[Index].Y * Game.Grid + Lists.Player[Index].Y2;
        short x2 = Lists.Player[Index].X2, y2 = Lists.Player[Index].Y2;
        bool  Hurt    = false;
        short Texture = Lists.Player[Index].Texture_Num;

        // Previne sobrecargas
        if (Texture <= 0 || Texture > Tex_Character.GetUpperBound(0))
        {
            return;
        }

        // Define a animação
        if (Lists.Player[Index].Attacking && Lists.Player[Index].Attack_Timer + Game.Attack_Speed / 2 > Environment.TickCount)
        {
            Column = Game.Animation_Attack;
        }
        else
        {
            if (x2 > 8 && x2 < Game.Grid)
            {
                Column = Lists.Player[Index].Animation;
            }
            if (x2 < -8 && x2 > Game.Grid * -1)
            {
                Column = Lists.Player[Index].Animation;
            }
            if (y2 > 8 && y2 < Game.Grid)
            {
                Column = Lists.Player[Index].Animation;
            }
            if (y2 < -8 && y2 > Game.Grid * -1)
            {
                Column = Lists.Player[Index].Animation;
            }
        }

        // Demonstra que o personagem está sofrendo dano
        if (Lists.Player[Index].Hurt > 0)
        {
            Hurt = true;
        }

        // Desenha o jogador
        Character(Texture, new Point(Game.ConvertX(x), Game.ConvertY(y)), Lists.Player[Index].Direction, Column, Hurt);
    }