Example #1
0
        void HandleSkill(SkillButton button)
        {
            switch (button.Skill.Name)
            {
            case "zap":
                foreach (Fighter fighter in Save.GetRoom().Entities.FindAll(entity => entity is Fighter))
                {
                    if (MouseOver(fighter))
                    {
                        if (Save.Kevin.Power >= 1)
                        {
                            Save.Kevin.Power -= 1;
                            Deal(fighter, 5);
                            if (fighter.HP <= 0)
                            {
                                UpdateOptions = true;
                            }
                        }
                    }
                }
                break;

            case "zaproom":
                if (MegaMapMode)
                {
                    foreach (RoomButton roombutton in MegaMapButtons.FindAll(butt => butt is RoomButton))
                    {
                        if (MouseOver(roombutton) && Save.Kevin.Power >= 2 || (PlayerHasSkill("zapcheaper") && Save.Kevin.Power >= 1))
                        {
                            Save.Kevin.Power -= 2;
                            if (PlayerHasSkill("zapcheaper"))
                            {
                                Save.Kevin.Power++;
                            }
                            foreach (Fighter fighter in roombutton.Room.Entities.FindAll(entity => entity is Fighter))
                            {
                                fighter.HP -= 3;
                                if (fighter.HP <= 0)
                                {
                                    UpdateOptions = true;
                                }
                            }
                            if (PlayerHasSkill("zapsafe"))
                            {
                                Save.Kevin.HP += 3;
                            }
                        }
                    }
                }
                break;
            }
        }
Example #2
0
        void InitializeSkillButtons(Class playerclass)
        {
            SkillButtons = new List <SkillButton>();
            switch (playerclass)
            {
            case Class.MASTERMIND:
                SkillButton zaproom = new SkillButton(Content.Load <Texture2D>("textures/game/skills/mayor/zaproom"), new Vector2(880, 110), new Skill("zaproom", 10), Keys.Z);
                SkillButtons.Add(zaproom);

                SkillButton zapsafe = new SkillButton(Content.Load <Texture2D>("textures/game/skills/mayor/safe"), new Vector2(860, 80), new Skill("zapsafe", 5));
                SkillButtons.Add(zapsafe);

                SkillButton zap = new SkillButton(Content.Load <Texture2D>("textures/game/skills/mayor/zap"), new Vector2(920, 110), new Skill("zap", 5), Keys.Z);
                SkillButtons.Add(zap);

                SkillButton zapstronger = new SkillButton(Content.Load <Texture2D>("textures/game/skills/mayor/stronger"), new Vector2(900, 80), new Skill("zapstronger", 15));
                SkillButtons.Add(zapstronger);

                SkillButton zapcheaper = new SkillButton(Content.Load <Texture2D>("textures/game/skills/mayor/cheaper"), new Vector2(940, 80), new Skill("zapcheaper", 5));
                SkillButtons.Add(zapcheaper);

                SkillButton zapinspect = new SkillButton(Content.Load <Texture2D>("textures/game/skills/mayor/inspect"), new Vector2(980, 110), new Skill("zapinspect", 5));
                SkillButtons.Add(zapcheaper);
                break;

            case Class.PHARMACIST:
                SkillButton grogsoakedblade = new SkillButton(Content.Load <Texture2D>("textures/game/skills/pharmacist/grogsoakedblade"), new Vector2(880, 110), new Skill("grogsoakedblade", 15));
                SkillButtons.Add(grogsoakedblade);

                SkillButton prescription = new SkillButton(Content.Load <Texture2D>("textures/game/skills/pharmacist/prescriptiononly"), new Vector2(900, 110), new Skill("prescription", 15));
                SkillButtons.Add(prescription);

                SkillButton fda = new SkillButton(Content.Load <Texture2D>("textures/game/skills/pharmacist/fda"), new Vector2(920, 110), new Skill("fda", 10));
                SkillButtons.Add(fda);

                SkillButton degree = new SkillButton(Content.Load <Texture2D>("textures/game/skills/pharmacist/degree"), new Vector2(910, 80), new Skill("degree", 10));
                SkillButtons.Add(degree);
                break;
            }
        }