public IFighter CreateFighter(int lives, int attack, int defense, IEnumerable <string> options)
        {
            IFighter fighter = new Fighter(lives, attack, defense);

            foreach (var option in options)
            {
                switch (option)
                {
                case DOUBLE_HANDED:
                    fighter = new DoubleHandedDecorator(fighter);
                    break;

                case MINION:
                    fighter = new MinionDecorator(fighter, fighter.Lives / 2, fighter.AttackValue / 2);
                    break;

                case POISON:
                    fighter = new PoisonDecorator(fighter, 10);
                    break;

                case SHIELD:
                    fighter = new ShieldDecorator(fighter, 3);
                    break;

                case SHOTGUN:
                    fighter = new ShotgunDecorator(fighter);
                    break;

                case STRENGTHEN:
                    fighter = new StrengthenDecorator(fighter);
                    break;
                }
            }

            return(fighter);
        }
Beispiel #2
0
        public void PaintWorld(WorldLayer layer)
        {
            if ((Hud.Game.MapMode == MapMode.WaypointMap) || (Hud.Game.MapMode == MapMode.ActMap) || (Hud.Game.MapMode == MapMode.Map))
            {
                return;
            }
            var monsters = Hud.Game.AliveMonsters;

            foreach (var monster in monsters)
            {
                bool illusionist = false;
                if (monster.SummonerAcdDynamicId == 0)
                {
                    illusionist = false;
                }
                else
                {
                    illusionist = true;
                }
                if (monster.Rarity == ActorRarity.Normal || monster.Rarity == ActorRarity.Unique || monster.Rarity == ActorRarity.Boss)
                {
                    foreach (var snoMonsterAffix in monster.AffixSnoList)
                    {
                        WorldDecoratorCollection decorator;
                        if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                        {
                            continue;
                        }

                        string affixName = null;
                        if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                        {
                            affixName = CustomAffixNames[snoMonsterAffix.Affix];
                        }
                        else
                        {
                            affixName = snoMonsterAffix.NameLocalized;
                        }

                        decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                    }
                }

                if (monster.Rarity == ActorRarity.Champion)
                {
                    if (illusionist == false)
                    {
                        foreach (var snoMonsterAffix in monster.AffixSnoList)
                        {
                            WorldDecoratorCollection decorator;
                            if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                            {
                                continue;
                            }

                            string affixName = null;
                            if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                            {
                                affixName = CustomAffixNames[snoMonsterAffix.Affix];
                            }
                            else
                            {
                                affixName = snoMonsterAffix.NameLocalized;
                            }

                            decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                        }
                    }
                }
                if (monster.Rarity == ActorRarity.Rare)
                {
                    if (illusionist == false)
                    {
                        foreach (var snoMonsterAffix in monster.AffixSnoList)
                        {
                            WorldDecoratorCollection decorator;
                            if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                            {
                                continue;
                            }

                            string affixName = null;
                            if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                            {
                                affixName = CustomAffixNames[snoMonsterAffix.Affix];
                            }
                            else
                            {
                                affixName = snoMonsterAffix.NameLocalized;
                            }

                            decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                        }
                    }
                }
                if (monster.Rarity == ActorRarity.RareMinion)
                {
                    if (illusionist == false)
                    {
                        if (MinionType == 0)
                        {
                            continue;
                        }
                        if (MinionType == 1)
                        {
                            string affixName = "爪牙";
                            MinionDecorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                        }
                        if (MinionType == 2)
                        {
                            foreach (var snoMonsterAffix in monster.AffixSnoList)
                            {
                                WorldDecoratorCollection decorator;
                                if (!AffixDecorators.TryGetValue(snoMonsterAffix.Affix, out decorator))
                                {
                                    continue;
                                }

                                string affixName = null;
                                if (CustomAffixNames.ContainsKey(snoMonsterAffix.Affix))
                                {
                                    affixName = CustomAffixNames[snoMonsterAffix.Affix];
                                }
                                else
                                {
                                    affixName = snoMonsterAffix.NameLocalized;
                                }

                                decorator.Paint(layer, monster, monster.FloorCoordinate, affixName);
                            }
                        }
                    }
                }
            }
        }