Exemplo n.º 1
0
 private void TruncateStack(Pointer x, bool fromTop)
 {
     if (!fromTop)
     {
         x.ReverseStack();
     }
     while (x.GetStackSize() > x.GetMana() + 10)
     {
         x.Pop();
     }
     if (!fromTop)
     {
         x.ReverseStack();
     }
 }
Exemplo n.º 2
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;
            }
        }
Exemplo n.º 3
0
 public void Merge(Pointer newer)
 {
     mana += newer.GetMana();
     //keep stack?
 }