Exemple #1
0
        public static void Add(MVPTypes type, string hero)
        {
            if (type == MVPTypes.GHOSTKILL && Displaying == true)
            {
                new Thread(() => {
                    Thread.CurrentThread.Name = "Ghostkill!";
                    DisplayText = "";
                    int tick    = Tick + 1;
                    SpinWait.SpinUntil(() => Tick > tick || !ApplicationRunning);

                    // okay, so one can win with a ghostkill. help
                    // copy paste of Analyze
                    Keys leader = Keys.None;
                    Keys second = Keys.None;

                    foreach (Keys p in InactiveKeys)
                    {
                        if (leader == Keys.None || HEADS[leader].Points < HEADS[p].Points)
                        {
                            second = leader;
                            leader = p;
                        }
                        else if (second == Keys.None || HEADS[second].Points < HEADS[p].Points)
                        {
                            second = p;
                        }
                    }

                    if (Head.getKeyString(leader) == hero && HEADS[leader].Points > HEADS[second].Points + 1 && HEADS[leader].Points >= Map.MaxPoints)
                    {
                        // won with a ghostkill O_o
                        DisplayText = $"Ghostkill win by {hero}";
                        Map.EndGame();
                        Leader = leader;
                        Clear();
                    }
                    else if (Map.phase == Phases.ENDGAME && HEADS[leader].Points - HEADS[second].Points < 2)
                    {
                        // so leader won, but now seconds is in reached because of the ghostkill O_o
                        Map.phase = Phases.ENDROUND;
                        Map.RoundsPassed--;
                        DisplayText = $"{hero} denied the win";
                    }
                    else
                    {
                        DisplayText = "Ghostkill!";
                    }
                }).Start();
            }
            else
            {
                records.Add(new Stat(hero, type));
            }
        }
Exemple #2
0
 public static void Add(MVPTypes type) => records.Add(new Stat(type));
Exemple #3
0
 public Stat(string hero, MVPTypes type, string special)
 {
     this.Hero    = hero;
     this.Type    = type;
     this.Special = special;
 }
Exemple #4
0
 public Stat(string hero, MVPTypes type)
 {
     this.Hero    = hero;
     this.Type    = type;
     this.Special = "";
 }
Exemple #5
0
 public Stat(MVPTypes type)
 {
     this.Hero    = "";
     this.Type    = type;
     this.Special = "";
 }
Exemple #6
0
 public static void Add(MVPTypes type, string hero, string special) => records.Add(new Stat(hero, type, special));