Ejemplo n.º 1
0
        public void AdvancePointer(Pointer pointer, bool readDelayModifier)
        {
            if (pointer.GetMana() <= 0)
            {
                return;
            }
            if (pointer.GetDelayAmt() > 0)
            {
                return;
            }
            if (readDelayModifier)
            {
                pointer.direction = GetModifiedDirection(modifiers[pointer.position.x, pointer.position.y], pointer.direction);
                int j = GetDelayAmount(modifiers[pointer.position.x, pointer.position.y]);
                pointer.SetDelay(j);
                if (j > 0)
                {
                    return;
                }
            }
            pointer.position.x += DirectionHelper.GetX(pointer.direction);
            pointer.position.y += DirectionHelper.GetY(pointer.direction);
            int width  = runes.GetLength(0);
            int height = runes.GetLength(1);

            if (pointer.position.x >= width)
            {
                pointer.position.x = 0;
            }
            if (pointer.position.y >= height)
            {
                pointer.position.y = 0;
            }
            if (pointer.position.x < 0)
            {
                pointer.position.x = width - 1;
            }
            if (pointer.position.y < 0)
            {
                pointer.position.y = height - 1;
            }
        }
Ejemplo n.º 2
0
        public Direction GetModifiedDirection(char modifier, Direction original)
        {
            // a̖a̗a̩a̠a̻ àáa̍āå a̎a͈a̿a͇
            int       dir = (int)original;
            Direction ndir;

            switch (modifier)
            {
            case '͔':
            case '᷾':
                return(Direction.LEFT);

            case '͕':    //B̂B̌B᷾B͐
            case '͐':    //B̬B̭B͔B͕
                return(Direction.RIGHT);

            case '̭':
            case '̂':
                return(Direction.UP);

            case '̬':
            case '̌':
                return(Direction.DOWN);

            case '̖':
            case '̀':
                if (dir <= 1)
                {
                    return(DirectionHelper.RotateCCW(original));
                }
                else
                {
                    return(DirectionHelper.RotateCW(original));
                }

            case '̗':
            case '́':
                if (dir % 2 == 0)
                {
                    int a = 2 - dir;
                    return(DirectionHelper.Reflect((Direction)a));
                }
                else
                {
                    int a = 4 - dir;
                    return(DirectionHelper.Reflect((Direction)a));
                }

            case '̩':
            case '̍':
                ndir = Direction.RIGHT;
                if (original == ndir || original == DirectionHelper.Reflect(ndir))
                {
                    return(DirectionHelper.Reflect(original));
                }
                return(original);

            case '̠':
            case '̄':
                ndir = Direction.DOWN;
                if (original == ndir || original == DirectionHelper.Reflect(ndir))
                {
                    return(DirectionHelper.Reflect(original));
                }
                return(original);

            case '̻':
            case '̊':
                return(DirectionHelper.Reflect(original));
            }
            return(original);
        }