예제 #1
0
        private void AddSkillCommands()
        {
#if DEBUG
            UnitCommandMenu.CheckValidCommands(SimpleCommands.Keys);
            UnitCommandMenu.CheckValidCommands(TargetCommands.Keys);
#endif

            // Skills: Savior
            TargetCommands.Add(UnitCommandMenu.SkillCommandId(SkillMenuIds.Shelter),
                               (Game_Unit unit, UnitCommandMenu menu) => Shelter(unit, menu));
            TargetCommands.Add(UnitCommandMenu.SkillCommandId(SkillMenuIds.Refuge),
                               (Game_Unit unit, UnitCommandMenu menu) => Refuge(unit, menu));
            // Skills: Dash
            SimpleCommands.Add(UnitCommandMenu.SkillCommandId(SkillMenuIds.Dash),
                               (Game_Unit unit) => Dash(unit));
            // Skills: Swoop
            SimpleCommands.Add(UnitCommandMenu.SkillCommandId(SkillMenuIds.Swoop),
                               (Game_Unit unit) => Swoop(unit));
            // Skills: Trample
            SimpleCommands.Add(UnitCommandMenu.SkillCommandId(SkillMenuIds.Trample),
                               (Game_Unit unit) => Trample(unit));
            // Skills: Sacrifice
            TargetCommands.Add(UnitCommandMenu.SkillCommandId(SkillMenuIds.Sacrifice),
                               (Game_Unit unit, UnitCommandMenu menu) => Sacrifice(unit, menu));
            // Skills: Old Swoop //@Debug
            SimpleCommands.Add(UnitCommandMenu.SkillCommandId(SkillMenuIds.OldSwoop),
                               (Game_Unit unit) => OldSwoop(unit));
        }
예제 #2
0
 private bool UnitMenuSelectSkill(int selectedOption, UnitCommandMenu unitMenu, Game_Unit unit)
 {
     // Skills: Masteries
     if (UnitCommandMenu.ValidMasteryCommand(selectedOption))
     {
         string skill = UnitCommandMenu.GetMastery(selectedOption);
         Mastery(unit, skill);
         return(true);
     }
     return(false);
 }
예제 #3
0
        private bool CancelCommandSkillCommand(UnitCommandMenu unitMenu)
        {
            Game_Unit unit = Global.game_map.units[unitMenu.UnitId];

            if (unit.DashActivated)
            {
                Global.game_system.Menu_Canto = unitMenu.Canto;
                menu_ClosedCanceled(unitMenu, new EventArgs());
                return(true);
            }
            return(false);
        }
예제 #4
0
        private void Sacrifice(Game_Unit unit, UnitCommandMenu unitMenu)
        {
            Global.game_system.play_se(System_Sounds.Confirm);
            var targetWindow = new Window_Target_Sacrifice(unit.id, new Vector2(0, 0));
            var targetMenu   = new UnitTargetMenu(targetWindow, unitMenu);

            targetMenu.Selected += sacrificeTargetMenu_Selected;
            targetMenu.Canceled += unitTargetMenu_Canceled;
            AddMenu(targetMenu);

            Global.player.facing = 4;
            Global.player.update_cursor_frame();
        }
예제 #5
0
        public bool ShowSkillRange(string skill)
        {
            for (int i = 0; i < Menus.Count; i++)
            {
                if (Menus.ElementAt(i) is UnitCommandMenu)
                {
                    var unitMenu = (Menus.ElementAt(i) as UnitCommandMenu);
                    switch (skill)
                    {
                    // Skills: Swoop
                    case "SWOOP":
                        if (unitMenu.CommandAtIndex ==
                            UnitCommandMenu.SkillCommandId(SkillMenuIds.Swoop))
                        {
                            return(true);
                        }
                        break;

                    // Skills: Trample
                    case "TRAMPLE":
                        if (unitMenu.CommandAtIndex ==
                            UnitCommandMenu.SkillCommandId(SkillMenuIds.Trample))
                        {
                            return(true);
                        }
                        break;

                    // Skills: Old Swoop //Debug
                    case "OLDSWOOP":
                        if (unitMenu.CommandAtIndex ==
                            UnitCommandMenu.SkillCommandId(SkillMenuIds.OldSwoop))
                        {
                            return(true);
                        }
                        break;
                    }
                    // Skills: Masteries
                    if (Game_Unit.MASTERIES.Contains(skill))
                    {
                        int index = Game_Unit.MASTERIES.IndexOf(skill);
                        if (unitMenu.CommandAtIndex == UnitCommandMenu.MasteryCommandId(skill))
                        {
                            return(true);
                        }
                    }
                    break;
                }
            }
            return(false);
        }