Пример #1
0
        public virtual void TrackFightMiss(FightMissEvent miss)
        {
            var f = AddFight(miss);

            if (f == null)
            {
                return;
            }

            var source = f.Participants.First(x => x.Name == miss.Source);

            source.AddMiss(miss);

            var target = f.Participants.First(x => x.Name == miss.Target);

            target.AddMiss(miss);

            // clear the critical in case a rune is present and the actual hit never lands
            LastCritical = null;

            // should runes count as hits? maybe this should be an option
            if (miss.Type == "rune")
            {
                //LastHit = new FightHitEvent { Timestamp = miss.Timestamp, Source = miss.Source, Target = miss.Target, Amount = 0, Type = "rune" };
            }
        }
Пример #2
0
        public void AddMiss(FightMissEvent miss)
        {
            if (miss.Source == Name)
            {
                SourceMissCount += 1;
            }
            else if (miss.Target == Name)
            {
                TargetMissCount += 1;

                var dt = DefenseTypes.FirstOrDefault(x => x.Type == miss.Type);
                if (dt == null)
                {
                    dt      = new CombatantMiss();
                    dt.Type = miss.Type;
                    DefenseTypes.Add(dt);
                }
                dt.Count += 1;
            }
        }
Пример #3
0
        public void FightMiss()
        {
            FightMissEvent miss   = null;
            var            parser = new LogParser(PLAYER);

            parser.OnFightMiss += (args) => miss = args;


            // [Thu May 19 10:30:15 2016] A darkmud watcher tries to hit Rumstil, but misses!

            // incoming miss
            miss = null;
            parser.ParseLine("[Thu Apr 21 20:56:17 2016] Commander Alast Degmar tries to punch YOU, but misses!");
            Assert.NotNull(miss);
            Assert.Equal("Commander Alast Degmar", miss.Source);
            Assert.Equal(PLAYER, miss.Target);
            Assert.Equal("miss", miss.Type);

            // outgoing miss
            miss = null;
            parser.ParseLine("[Thu May 19 15:32:30 2016] You try to pierce An ocean serpent, but miss!");
            Assert.NotNull(miss);
            Assert.Equal(PLAYER, miss.Source);
            Assert.Equal("An ocean serpent", miss.Target);
            Assert.Equal("miss", miss.Type);

            // incoming defense
            miss = null;
            parser.ParseLine("[Thu May 19 15:32:23 2016] An ocean serpent tries to hit YOU, but YOU parry!");
            Assert.NotNull(miss);
            Assert.Equal("An ocean serpent", miss.Source);
            Assert.Equal(PLAYER, miss.Target);
            Assert.Equal("parry", miss.Type);

            // outgoing defense
            // ...

            // 3rd party defense
            miss = null;
            parser.ParseLine("[Thu May 19 10:46:27 2016] Xenann tries to crush A fright funnel, but A fright funnel blocks!");
            Assert.NotNull(miss);
            Assert.Equal("Xenann", miss.Source);
            Assert.Equal("A fright funnel", miss.Target);
            Assert.Equal("block", miss.Type);

            // incoming rune
            miss = null;
            parser.ParseLine("[Thu May 19 10:30:26 2016] A darkmud watcher tries to hit YOU, but YOUR magical skin absorbs the blow!");
            Assert.NotNull(miss);
            Assert.Equal("A darkmud watcher", miss.Source);
            Assert.Equal(PLAYER, miss.Target);
            Assert.Equal("rune", miss.Type);

            // 3rd party rune
            miss = null;
            parser.ParseLine("[Thu May 19 15:33:13 2016] A coral serpent tries to hit Fourier, but Fourier's magical skin absorbs the blow!");
            Assert.NotNull(miss);
            Assert.Equal("A coral serpent", miss.Source);
            Assert.Equal("Fourier", miss.Target);
            Assert.Equal("rune", miss.Type);

            // frenzy on - 2 word attack skill
            miss = null;
            parser.ParseLine("[Thu May 19 10:46:27 2016] Xenann tries to frenzy on A fright funnel, but A fright funnel blocks!");
            Assert.NotNull(miss);
            Assert.Equal("Xenann", miss.Source);
            Assert.Equal("A fright funnel", miss.Target);
            Assert.Equal("block", miss.Type);

            // invulnerable
            miss = null;
            parser.ParseLine("[Thu May 26 09:28:23 2016] You try to pierce High Infectioner, but High Infectioner is INVULNERABLE!");
            Assert.NotNull(miss);
            Assert.Equal(PLAYER, miss.Source);
            Assert.Equal("High Infectioner", miss.Target);
            Assert.Equal("invul", miss.Type);
        }