Esempio n. 1
0
        void HandleOtherPopoverItemClicked(object sender, ButtonStringPopover.PopoverEventArgs e)
        {
            ButtonStringPopover popover = (ButtonStringPopover)sender;
            GradientButton      b       = (GradientButton)popover.Button;

            switch (template)
            {
            case AdvancerTemplate.HalfDragon:
                _DragonColor = (string)e.Tag;
                break;

            case AdvancerTemplate.Skeleton:
                _SelectedSkeletonTypes[b.Tag] = (bool)e.Tag;
                break;

            case AdvancerTemplate.HalfCelestial:
            case AdvancerTemplate.HalfFiend:
                _SelectedStats[b.Tag] = (bool)e.Tag;
                break;

            case AdvancerTemplate.Zombie:
                _ZombieType = (Monster.ZombieType)e.Tag;
                break;
            }
            HandleChange();
        }
Esempio n. 2
0
        public string ZombieText(Monster.ZombieType type, bool append)
        {
            switch (type)
            {
            case Monster.ZombieType.Fast:
                return(append?"Fast Zombie":"Fast");

            case Monster.ZombieType.Normal:
                return(append?"Zombie": "Normal");

            case Monster.ZombieType.Plague:
                return(append?"Plague Zombie":"Plague");
            }
            return("");
        }
        Monster AdvanceMonster(Monster item)
        {
            Monster monster = item;

            if (monster != null && _AdvancerVisible)
            {
                monster = (Monster)item.Clone();

                if (_hdChange != 1)
                {
                    int dice = _hdCount * (_hdChange - 1);

                    Stat stat = (Stat)_bonusStat;

                    bool size = _sizeChange50HD;

                    int res = monster.AddRacialHD(dice, stat, size);

                    if (res != 0)
                    {
                        monster.Name = monster.Name + " " + CMStringUtilities.PlusFormatNumber(res) + " HD";
                    }
                }

                if (_selectedTemplate == 1)
                {
                    if (monster.MakeHalfDragon(_dragonColor))
                    {
                        monster.Name = "Half-Dragon " + monster.Name;
                    }
                }
                if (_selectedTemplate == 2)
                {
                    HashSet <Stat> bonusStats = new HashSet <Stat>();

                    if (AdvancerBoxChecked(Resource.Id.strBox))
                    {
                        bonusStats.Add(Stat.Strength);
                    }
                    if (AdvancerBoxChecked(Resource.Id.dexBox))
                    {
                        bonusStats.Add(Stat.Dexterity);
                    }
                    if (AdvancerBoxChecked(Resource.Id.conBox))
                    {
                        bonusStats.Add(Stat.Constitution);
                    }
                    if (AdvancerBoxChecked(Resource.Id.intBox))
                    {
                        bonusStats.Add(Stat.Intelligence);
                    }
                    if (AdvancerBoxChecked(Resource.Id.wisBox))
                    {
                        bonusStats.Add(Stat.Wisdom);
                    }
                    if (AdvancerBoxChecked(Resource.Id.chaBox))
                    {
                        bonusStats.Add(Stat.Charisma);
                    }

                    if (monster.MakeHalfFiend(bonusStats))
                    {
                        monster.Name = "Half-Fiend " + monster.Name;
                    }
                }
                if (_selectedTemplate == 3)
                {
                    HashSet <Stat> bonusStats = new HashSet <Stat>();

                    if (AdvancerBoxChecked(Resource.Id.strBox))
                    {
                        bonusStats.Add(Stat.Strength);
                    }
                    if (AdvancerBoxChecked(Resource.Id.dexBox))
                    {
                        bonusStats.Add(Stat.Dexterity);
                    }
                    if (AdvancerBoxChecked(Resource.Id.conBox))
                    {
                        bonusStats.Add(Stat.Constitution);
                    }
                    if (AdvancerBoxChecked(Resource.Id.intBox))
                    {
                        bonusStats.Add(Stat.Intelligence);
                    }
                    if (AdvancerBoxChecked(Resource.Id.wisBox))
                    {
                        bonusStats.Add(Stat.Wisdom);
                    }
                    if (AdvancerBoxChecked(Resource.Id.chaBox))
                    {
                        bonusStats.Add(Stat.Charisma);
                    }

                    if (monster.MakeHalfCelestial(bonusStats))
                    {
                        monster.Name = "Half-Celestial " + monster.Name;
                    }
                }
                if (_selectedTemplate == 4)
                {
                    bool bloody   = AdvancerBoxChecked(Resource.Id.bloodyBox);
                    bool burning  = AdvancerBoxChecked(Resource.Id.burningBox);
                    bool champion = AdvancerBoxChecked(Resource.Id.championBox);

                    if (monster.MakeSkeleton(bloody, burning, champion))
                    {
                        if (champion)
                        {
                            monster.Name = "Skeletal Champion " + monster.Name;
                        }
                        else
                        {
                            monster.Name += " Skeleton";
                        }


                        if (burning)
                        {
                            monster.Name = "Burning " + monster.Name;
                        }

                        if (bloody)
                        {
                            monster.Name = "Bloody " + monster.Name;
                        }
                    }
                }
                if (_selectedTemplate == 5)
                {
                    if (monster.MakeVampire())
                    {
                        monster.Name = "Vampire " + monster.Name;
                    }
                }
                if (_selectedTemplate == 6)
                {
                    Monster.ZombieType zt = (Monster.ZombieType)_zombieType;

                    if (monster.MakeZombie(zt))
                    {
                        monster.Name = "Zombie " + monster.Name;

                        if (zt == Monster.ZombieType.Fast)
                        {
                            monster.Name = "Fast " + monster.Name;
                        }
                        else if (zt == Monster.ZombieType.Plague)
                        {
                            monster.Name = "Plague " + monster.Name;
                        }
                    }
                }


                CheckBox cb = _AdvancerLayout.FindViewById <CheckBox>(Resource.Id.advancedBox);

                if (cb.Checked)
                {
                    for (int i = 0; i < _advMuliplier; i++)
                    {
                        monster.MakeAdvanced();
                    }
                    int advlevels = _advMuliplier;

                    monster.Name += " (Adv " + advlevels.PlusFormat() + ")";
                }
                int count = _sizeMultiplier;
                if (_sizeChange > 0)
                {
                    int added = 0;
                    for (int i = 0; i < count; i++)
                    {
                        if (monster.MakeGiant())
                        {
                            added++;
                        }
                    }
                    if (added == 1)
                    {
                        monster.Name = "Giant " + monster.Name;
                    }
                    if (added > 1)
                    {
                        monster.Name = "Giant x" + added + " " + monster.Name;
                    }
                }
                else if (_sizeChange < 0)
                {
                    int added = 0;
                    for (int i = 0; i < count; i++)
                    {
                        if (monster.MakeYoung())
                        {
                            added++;
                        }
                    }
                    if (added == 1)
                    {
                        monster.Name = "Young " + monster.Name;
                    }
                    if (added > 1)
                    {
                        monster.Name = "Young x" + added + " " + monster.Name;
                    }
                }

                if (_outsiderChange == 1)
                {
                    if (monster.MakeCelestial())
                    {
                        monster.Name = "Celestial " + monster.Name;
                    }
                }
                else if (_outsiderChange == 2)
                {
                    if (monster.MakeEntropic())
                    {
                        monster.Name = "Entopic " + monster.Name;
                    }
                }
                else if (_outsiderChange == 3)
                {
                    if (monster.MakeFiendish())
                    {
                        monster.Name = "Fiendish " + monster.Name;
                    }
                }
                else if (_outsiderChange == 4)
                {
                    if (monster.MakeResolute())
                    {
                        monster.Name = "Resolute " + monster.Name;
                    }
                }

                cb = _AdvancerLayout.FindViewById <CheckBox>(Resource.Id.augmentSummoningBox);
                if (cb.Checked)

                {
                    monster.AugmentSummoning();
                    monster.Name = "Augmented " + monster.Name;
                }
            }



            return(monster);
        }