Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- public class Sack : ICreature
- {
- public int Count = 0;
- public string GetImageFileName()
- {
- return "Sack.png";
- }
- public int GetDrawingPriority()
- {
- return 1;
- }
- public CreatureCommand Act(int x, int y)
- {
- var isFell = false;
- if (y + 1 < Game.MapHeight)
- {
- if ((Count > 0) && (Game.Map[x, y + 1] is Player))
- {
- Count++;
- return new CreatureCommand { DeltaX = 0, DeltaY = 1 };
- }
- else if (Game.Map[x, y + 1] == null)
- {
- Count++;
- return new CreatureCommand { DeltaX = 0, DeltaY = 1 };
- }
- }
- if (Count > 1)
- {
- return new CreatureCommand { TransformTo = new Gold() };
- }
- else
- return new CreatureCommand { DeltaX = 0, DeltaY = 0 };
- }
- public bool DeadInConflict(ICreature conflictedObject)
- {
- Count++;
- return false;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement