Example #1
0
    /// <summary>
    /// 宠物休息
    /// </summary>
    public void petRest(int mIndex)
    {
        PetUseLogic logic = getPet(mIndex);

        if (logic == null)
        {
            me.showInfoCode(InfoCodeType.PetReset_notExist);
            return;
        }

        if (!logic.isWorking())
        {
            me.showInfoCode(InfoCodeType.PetReset_isNotWorkingNow);
            return;
        }

        me.send(PetRestRequest.create(mIndex));
    }
Example #2
0
    /// <summary>
    /// 宠物出战
    /// </summary>
    public void petWork(int mIndex)
    {
        PetUseLogic logic = getPet(mIndex);

        if (logic == null)
        {
            me.showInfoCode(InfoCodeType.PetWork_notExist);
            return;
        }

        if (logic.isWorking())
        {
            me.showInfoCode(InfoCodeType.PetWork_isWorkingNow);
            return;
        }

        if (!checkCanWork(logic))
        {
            me.showInfoCode(InfoCodeType.PetWork_cantWork);
            return;
        }

        me.send(PetWorkRequest.create(logic.index));
    }