SKILL_RESULT_CODE CastOnCasterSingle(KCharacter pDisplayCaster, KCharacter pLogicCaster) { SKILL_RESULT_CODE nResult = SKILL_RESULT_CODE.srcFailed; int nRetCode = 0; KSKILL_BULLET pBullet = new KSKILL_BULLET(); KTarget pTarget = new KTarget(); nRetCode = pTarget.SetTarget(pDisplayCaster); if (nRetCode == 0) { goto Exit0; } nRetCode = SetupBullet(pBullet, pLogicCaster, ref pTarget); if (nRetCode == 0) { goto Exit0; } if (pBullet.nEndFrame > FirstFightMgr.Instance().m_nGameLoop) { pLogicCaster.AddBullet(pBullet); } else { ApplyOnSingle(pBullet); } nResult = SKILL_RESULT_CODE.srcSuccess; Exit0: return(nResult); }
SKILL_RESULT_CODE CastOnSector(KCharacter pDisplayCaster, KCharacter pLogicCaster) { SKILL_RESULT_CODE nResult = SKILL_RESULT_CODE.srcFailed; int nRetCode = 0; KSKILL_BULLET pBullet = new KSKILL_BULLET(); KTarget pTarget = new KTarget(); nRetCode = pTarget.SetTarget(pDisplayCaster); if (nRetCode == 0) { return(SKILL_RESULT_CODE.srcFailed); } nRetCode = SetupBullet(pBullet, pLogicCaster, ref pTarget); if (nRetCode == 0) { goto Exit0; } nRetCode = (int)ApplyOnSector(pBullet); if (nRetCode != (int)SKILL_RESULT_CODE.srcSuccess) { return((SKILL_RESULT_CODE)nRetCode); } nResult = SKILL_RESULT_CODE.srcSuccess; Exit0: return(nResult); }
SKILL_RESULT_CODE CastOnCasterArea(KCharacter pDisplayCaster, KCharacter pLogicCaster) { SKILL_RESULT_CODE nResult = SKILL_RESULT_CODE.srcFailed; int nRetCode = 0; KTarget pTarget = new KTarget(); KSKILL_BULLET pBullet = new KSKILL_BULLET(); float fX = 0f; float fZ = 0f; nRetCode = pTarget.SetTarget(pDisplayCaster); if (nRetCode == 0) { goto Exit0; } nRetCode = SetupBullet(pBullet, pLogicCaster, ref pTarget); if (nRetCode == 0) { goto Exit0; } if (pBullet.nEndFrame > FirstFightMgr.Instance().m_nGameLoop) { pLogicCaster.AddBullet(pBullet); } else { pDisplayCaster.GetAbsoluteCoordinate(ref fX, ref fZ); nRetCode = (int)ApplyOnArea(pBullet, fX, fZ); } nResult = SKILL_RESULT_CODE.srcSuccess; Exit0: return(nResult); }
//测试代码 //void Test_ConcludeResult() //{ // m_nCurrentLife -= 256; // if ((m_eMoveState != CHARACTER_MOVE_STATE.cmsOnDeath) && (m_nCurrentLife <= 0)) // { // Test_GoToHell(); // } //} //bool Test_GoToHell() //{ // bool bResult = false; // m_nCurrentLife = 0; // if ((!m_bToDie) == false) // { // goto Exit0; // } // m_bToDie = true; // bResult = true; //Exit0: // return bResult; //} public int SelectTarget(TARGET_TYPE eTargetType, uint dwTargetID) { int nResult = 0; int nRetCode = 0; nRetCode = m_pSelectTarget.SetTarget(eTargetType, dwTargetID); if (nRetCode == 0) { goto Exit0; } nResult = 1; Exit0: return(nResult); }