Example #1
0
        private void Main_PlayerMoved(object sender, MainGameWindow.PlayerMovementData e)
        {
            Point humanPoint = e.start.position;

            foreach (Point point in e.path)
            {
                humanPoint = humanPoint.Add(point);
                if (humanPoint == Position)
                {
                    if (!e.player.troop.statuses.Exists(s => s.name == Name))
                    {
                        main.WriteConsole($"{e.player.Name} has been put on fire!");
                        e.player.troop.statuses.Add(new FireStatus(turns + 1, damage, main, e.player));
                        if (e.player.Name == main.humanPlayer.Name)
                        {
                            main.UpdatePlayerView();
                        }
                    }
                    else
                    {
                        e.player.troop.statuses.Find(s => s.name == Name).turns = turns + 1;
                    }
                }
            }
        }
Example #2
0
        private void Main_PlayerMoved(object sender, MainGameWindow.PlayerMovementData e)
        {
            MainGameWindow main = sender as MainGameWindow;

            if (e.player.Name == player.Name && e.goal.type.FType == FieldType.water)
            {
                Point start = e.start.position;
                foreach (var field in e.path)
                {
                    start = start.Add(field);
                    if (main.map.map.Get(start).type.FType == FieldType.water)
                    {
                        RemoveEffect(sender as MainGameWindow);
                        return;
                    }
                }
            }
        }