Esempio n. 1
0
    public override void OnTriggerHitted(GameObject obj, int[] param)
    {
        base.OnTriggerHitted(obj, param);

        // 杀死所有怪物aa
        sdMainChar kMainChar             = sdGameLevel.instance.mainChar;
        List <sdActorInterface> lstActor =
            sdGameLevel.instance.actorMgr.FindActor(
                kMainChar,
                HeaderProto.ESkillObjType.SKILL_OBJ_ENEMY,
                kMainChar.transform.position,
                Vector3.zero,
                1,
                0,
                10000.0f,
                true);

        if (lstActor != null)
        {
            foreach (sdActorInterface a in lstActor)
            {
                if (a.actorType == ActorType.AT_Monster)
                {
                    int hp = a["HP"];
                    a.AddHP(-hp);
                }
            }
        }

        // 禁用所有的按键和手势响应aa
        sdGameLevel.instance.DestroyFingerObject();
        sdGameLevel.instance.mainChar.AddDebuffState(HeaderProto.ECreatureActionState.CREATURE_ACTION_STATE_STAY);
        sdGameLevel.instance.mainChar.AddDebuffState(HeaderProto.ECreatureActionState.CREATURE_ACTION_STATE_LIMIT_SKILL);
        GPUSH_API.Vibrate(500);

        // 初始化胜利动画aa
        sdGameMonster kMonster = obj.GetComponent <sdGameMonster>();

        sdGameLevel.instance.mainCamera.InitVictory(kMonster);

        // 请求结算aa
        if (sdUICharacter.Instance.GetBattleType() == (byte)HeaderProto.LEVEL_BATTLE_TYPE.LEVEL_BATTLE_TYPE_WORLD_BOSS)
        {
            sdActGameMsg.Send_CS_WB_RESULT_REQ(0);
            sdActGameMsg.OnWorldBossBeKilled();
        }
        else
        {
            Debug.Log("TuituEnd and Request Jiesuan!");
            sdGameLevel.instance.tuiTuLogic.ShowFightResult(obj);
        }
    }
Esempio n. 2
0
    void PT_End()
    {
        // 禁用所有的按键和手势响应aa
        sdGameLevel.instance.DestroyFingerObject();
        sdGameLevel.instance.mainChar.AddDebuffState(HeaderProto.ECreatureActionState.CREATURE_ACTION_STATE_STAY);
        sdGameLevel.instance.mainChar.AddDebuffState(HeaderProto.ECreatureActionState.CREATURE_ACTION_STATE_LIMIT_SKILL);
        GPUSH_API.Vibrate(500);

        // 初始化胜利动画aa
        sdGameLevel.instance.mainCamera.InitVictory(null);

        // 请求结算aa
        Debug.Log("TuituEnd and Request Jiesuan!");
        sdGameLevel.instance.tuiTuLogic.ShowFightResult(null);
    }
Esempio n. 3
0
    protected virtual void OnPress(bool isDown)
    {
        if (type == ShortCutType.Type_Skill && id == 1001 && !sdGameLevel.instance.AutoMode)
        {
            if (isDown)
            {
                needspell = true;
            }
            else
            {
                needspell = false;
            }
        }

        if (!isDown)
        {
            if (type == ShortCutType.Type_Skill && isBig)
            {
                gameObject.transform.localScale /= 1.2f;
                isBig = false;
            }
            return;
        }

        if (type == ShortCutType.Type_Skill)
        {
            if (isDown)
            {
                GPUSH_API.Vibrate(25);
            }
            if (!isBig)
            {
                gameObject.transform.localScale *= 1.2f;
                isBig = true;
            }

            // CD尚未结束,则直接返回aa
            if (maxCd > 0 && bIsShowCd)
            {
                return;
            }

            // 检查场景和主角战斗控制器aa
            if (sdGameLevel.instance == null)
            {
                return;
            }

            FingerControl kFingerControl = sdGameLevel.instance.GetFingerControl();;
            if (kFingerControl == null)
            {
                return;
            }

            // 自动打怪模式下:自动寻路攻击最近的目标aa
            int iSkillID = (int)id / 100;
            if (sdGameLevel.instance.AutoMode && iSkillID != 1002)
            {
                if (!kFingerControl.AttackNearest(iSkillID))
                {
                    return;
                }
            }

            // 自动打怪模式下:调整方向aa
            if (sdGameLevel.instance.AutoMode)
            {
                kFingerControl.AdjustDirection(iSkillID);
            }

            // 释放技能(自动模式下普通攻击不再强制施放)aa
            if (!sdGameLevel.instance.AutoMode || iSkillID != 1001)
            {
                sdMainChar mainChar = sdGameLevel.instance.mainChar;
                if (mainChar != null)
                {
                    sdGameSkill skill = sdGameSkillMgr.Instance.GetSkill((int)id);
                    if (skill != null)
                    {
                        int error = -1;
                        if (!mainChar.CastSkill(skill.classId, ref error))
                        {
                            string msg = string.Format("Error_{0}", error);
                            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr(msg), Color.yellow);
                        }
                    }
                    else
                    {
                        int error = -1;
                        if (!mainChar.CastSkill((int)id, ref error))
                        {
                            string msg = string.Format("Error_{0}", error);
                            sdUICharacter.Instance.ShowMsgLine(sdConfDataMgr.Instance().GetShowStr(msg), Color.yellow);
                        }
                    }
                    //sdSkill skill = mainChar.skillTree.getSkill((int)id);
                    //if (skill != null)
                    //{
                    //	skill.spell(mainChar);
                    //}
                }
            }
        }
        else if (type == ShortCutType.Type_Pet)
        {
        }
        else if (type == ShortCutType.Type_PetSkill)
        {
        }
    }