Esempio n. 1
0
        private void PCMove_PlayerCommanding(object sender,
                                             PlayerCommandingEventArgs e)
        {
            if (!GetComponent <LocalManager>().MatchID(e.ObjectID))
            {
                return;
            }
            if (!IsValidCommand(e.Command))
            {
                return;
            }

            int[] source = GetComponent <MetaInfo>().Position;
            int[] target = GetNewPosition(source, e.Command);

            if (!GetComponent <LocalManager>().IsPassable(target))
            {
                return;
            }

            ActionTag action  = ActionTag.Move;
            MainTag   mainTag = GetComponent <MetaInfo>().MainTag;
            SubTag    subTag  = GetComponent <MetaInfo>().SubTag;
            int       id      = GetComponent <MetaInfo>().ObjectID;

            GetComponent <LocalManager>().SetPosition(target);
            GetComponent <LocalManager>().TakenAction(
                new TakenActionEventArgs(action, mainTag, subTag, id));
            GameCore.AxeManCore.GetComponent <TileOverlay>().TryHideTile(source);
            GameCore.AxeManCore.GetComponent <TileOverlay>().TryHideTile(target);
        }
Esempio n. 2
0
        private void ListenPCInput(PlayerCommandingEventArgs e)
        {
            if (e.SubTag != SubTag.PC)
            {
                return;
            }

            switch (e.Command)
            {
            case CommandTag.Reload:
                SceneManager.LoadSceneAsync(0);
                break;

            case CommandTag.PrintSchedule:
                GetComponent <Schedule>().Print();
                break;

            case CommandTag.ChangeHP:
                TestHP();
                break;

            case CommandTag.PrintSkill:
                PrintSkill();
                break;

            default:
                break;
            }
        }
Esempio n. 3
0
 private void AimMode_PlayerCommanding(object sender,
                                       PlayerCommandingEventArgs e)
 {
     if (EnterMode(e))
     {
         OnEnteringAimMode(new EnteringAimModeEventArgs(
                               e.SubTag, e.Command));
     }
     else if (LeaveMode(e))
     {
         OnLeavingAimMode(EventArgs.Empty);
     }
 }
Esempio n. 4
0
        private bool LeaveMode(PlayerCommandingEventArgs e)
        {
            if (e.SubTag != SubTag.AimMarker)
            {
                return(false);
            }
            switch (e.Command)
            {
            case CommandTag.Confirm:
                return(VerifySkill(pcUseSkill));

            case CommandTag.Cancel:
                pcUseSkill = CommandTag.INVALID;
                return(true);

            default:
                return(false);
            }
        }
Esempio n. 5
0
        private bool EnterMode(PlayerCommandingEventArgs e)
        {
            if ((e.SubTag != SubTag.PC) && (e.SubTag != SubTag.AimMarker))
            {
                return(false);
            }

            switch (e.Command)
            {
            case CommandTag.SkillQ:
            case CommandTag.SkillW:
            case CommandTag.SkillE:
            case CommandTag.SkillR:
                pcUseSkill = e.Command;
                return(true);

            default:
                return(false);
            }
        }
Esempio n. 6
0
 private void Wizard_PlayerCommanding(object sender,
                                      PlayerCommandingEventArgs e)
 {
     ListenPCInput(e);
 }