Advertisement
KOTIK_HA_MAT-MEXE

Untitled

Nov 27th, 2016
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C# 0.76 KB | None | 0 0
  1. public class Sack : ICreature
  2. {
  3. public int Count = 0;
  4. public string GetImageFileName()
  5. {
  6. return "Sack.png";
  7. }
  8.  
  9. public int GetDrawingPriority()
  10. {
  11. return 1;
  12. }
  13. public CreatureCommand Act(int x, int y)
  14. {
  15. var isFell = false;
  16. if (y + 1 < Game.MapHeight)
  17. {
  18. if ((Count > 0) && (Game.Map[x, y + 1] is Player))
  19. {  
  20.  Count++;
  21.  return new CreatureCommand { DeltaX = 0, DeltaY = 1 };
  22. }
  23. else if (Game.Map[x, y + 1] == null)
  24. {
  25. Count++;
  26. return new CreatureCommand { DeltaX = 0, DeltaY = 1 };
  27. }
  28. }
  29. if (Count > 1)
  30. {
  31.  return new CreatureCommand { TransformTo = new Gold() };
  32.  }
  33. else
  34.  return new CreatureCommand { DeltaX = 0, DeltaY = 0 };
  35. }
  36. public bool DeadInConflict(ICreature conflictedObject)
  37. {
  38. Count++;
  39. return false;
  40. }
  41. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement