Advertisement
KOTIK_HA_MAT-MEXE

Untitled

Nov 27th, 2016
75
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 1.19 KB | None | 0 0
  1. public CreatureCommand Act(int x, int y)
  2.         {
  3.             var action = new CreatureCommand();
  4.             if (y  < Game.MapHeight - 1)
  5.             {
  6.                 if ((Count > 0) && (Game.Map[x, y + 1] is Player || Game.Map[x, y + 1] is Monster))
  7.                 {
  8.                     //Game.IsOver = true;
  9.                     ContinueFalling(ref Count, ref action.DeltaY);
  10.                     return action;
  11.                 }
  12.                 else if (Game.Map[x, y + 1] == null)
  13.                 {
  14.                     ContinueFalling(ref Count, ref action.DeltaY);
  15.                     return action;
  16.                 }
  17.  
  18.                 if (Count > 1 && Game.Map[x, y] != null)
  19.                     return new CreatureCommand { TransformTo = new Gold() };
  20.                 else
  21.                     Count = 0;
  22.                 return action;
  23.             }
  24.             if (Count > 1 && Game.Map[x, y] != null)
  25.                 return new CreatureCommand { TransformTo = new Gold() };
  26.             else
  27.                 Count = 0;
  28.             //action.TransformTo = Count > 1 && Game.Map[x, y] != null
  29.             //    ? new Gold()
  30.             //    : null;
  31.             return action;
  32.         }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement