void OnSkillDoubleTap( AsIMessage _msg) { Msg_Input_DoubleTab doubleTap = _msg as Msg_Input_DoubleTab; if( AsPStoreManager.Instance.UnableActionByPStore() == true) { if( doubleTap.type_ == Msg_Input_DoubleTab.eDoubleTabType.Player) m_CurrentFsmState.MessageProcess( new Msg_OpenPrivateShopUI()); return; } if( CheckSpecificWindowOpened() == true) return; // if( CheckMap_Village() == true) // { // string content = AsTableManager.Instance.GetTbl_String(830); // AsChatManager.Instance.InsertChat( content, eCHATTYPE.eCHATTYPE_SYSTEM, true); // return; // } if( WeaponEquip == false) { AsMyProperty.Instance.AlertNoWeapon(); return; } eCLASS __class = UserEntity.GetProperty<eCLASS>( eComponentProperty.CLASS); Tbl_Skill_Record skill = null; int idx = -1; eCommandPicking_Type pickingType = eCommandPicking_Type.NONE; switch( doubleTap.type_) { case Msg_Input_DoubleTab.eDoubleTabType.Terrain: case Msg_Input_DoubleTab.eDoubleTabType.OtherUser: case Msg_Input_DoubleTab.eDoubleTabType.Monster: idx = (int)COMMAND_SKILL_TYPE._DOUBLE_TAP_MONSTER; pickingType = eCommandPicking_Type.FingerPoint; break; case Msg_Input_DoubleTab.eDoubleTabType.Player: idx = (int)COMMAND_SKILL_TYPE._DOUBLE_TAP_PLAYER; pickingType = eCommandPicking_Type.Self; break; // case Msg_Input_DoubleTab.eDoubleTabType.OtherUser: // idx = (int)COMMAND_SKILL_TYPE._DOUBLE_TAP_OTHERUSER; // break; // case Msg_Input_DoubleTab.eDoubleTabType.Monster: // idx = (int)COMMAND_SKILL_TYPE._DOUBLE_TAP_MONSTER; // pickingType = eCommandPicking_Type.Enemy; // break; } // skill = AsTableManager.Instance.GetTbl_Skill_RecordByPickingType( __class, pickingType); skill = SkillBook.Instance.GetLearnedDoubleTapSkill( pickingType); if( null == skill) return; if( SkillBook.Instance.dicCurSkill.ContainsKey( skill.Index) == false) return; else if( CheckMap_Village() == true) { // string content = AsTableManager.Instance.GetTbl_String(830); // AsChatManager.Instance.InsertChat( content, eCHATTYPE.eCHATTYPE_SYSTEM, true); AsMyProperty.Instance.AlertSkillInTown(); return; } if( AsUserInfo.Instance.CommandSkillCoolTimeCompletion[idx] == true) { if( false == IsAvailableDoubleTapSkill( __class, pickingType)) return; if( skill == null) { Debug.LogError( "AsPlayerFsm::OnSkillDoubleTap: this character[" + __class + "] doesnt have [" + doubleTap.type_ + "]type skill"); return; } eGENDER gender = UserEntity.GetProperty<eGENDER>( eComponentProperty.GENDER); AsBaseEntity entity = AsEntityManager.Instance.GetEntityByInstanceId( doubleTap.input_.inputObject_.GetInstanceID()); Vector3 skillPos = Vector3.zero; if( entity == null) skillPos = doubleTap.input_.worldPosition_; else skillPos = entity.transform.position; Msg_Player_Skill_Ready ready = new Msg_Player_Skill_Ready( skill, gender, 1, entity, skillPos, doubleTap.input_.screenPosition_, doubleTap.input_.screenPosition_, doubleTap.input_.screenPosition_, doubleTap.input_.worldPosition_ - m_Entity.transform.position, eClockWise.CW); // if( ready.constructSucceed == true) // m_CurrentFsmState.MessageProcess( ready); if( ready.constructSucceed == true) { if( TargetDecider.CheckDisableSkillByMap(ready.skillRecord) == true) return; if( AsCommonSender.CheckSkillUseProcessing() == true) return; if( m_Entity.CheckCondition( eSkillIcon_Enable_Condition.Movable) == false && ready.skillRecord.CheckSkillUsingOnly_Movable() == true) { AsMyProperty.Instance.AlertState(); return; } if( Vector3.Distance( Entity.transform.position, ready.picked) > ready.skillLvRecord.Usable_Distance * 0.01f)// * m_Character_Size) { Msg_Player_Skill_Target_Move targetMove = new Msg_Player_Skill_Target_Move( ready, AsPlayerState_BattleRun.eRunType.NonTarget); m_CurrentFsmState.MessageProcess( targetMove); } else m_CurrentFsmState.MessageProcess( ready); } } else { AsMyProperty.Instance.AlertCoolTime( ( COMMAND_SKILL_TYPE)idx); } }
void OnActionItem( AsIMessage _msg) { if( AsPStoreManager.Instance.UnableActionByPStore() == true) return; if( CheckSpecificWindowOpened() == true) return; Msg_Player_Use_ActionItem msg = _msg as Msg_Player_Use_ActionItem; ItemData itemData = msg.realItem.item.ItemData; Tbl_Skill_Record record = AsTableManager.Instance.GetTbl_Skill_Record( itemData.itemSkill); eGENDER gender = UserEntity.GetProperty<eGENDER>( eComponentProperty.GENDER); Msg_Player_Skill_Ready ready = new Msg_Player_Skill_Ready( itemData, msg.realItem.getSlot, gender); ready.SetCurrentTarget( Target); if( CheckMap_Village() == true && ready.constructSucceed == true) { // string content = AsTableManager.Instance.GetTbl_String(830); // AsChatManager.Instance.InsertChat( content, eCHATTYPE.eCHATTYPE_SYSTEM, true); AsMyProperty.Instance.AlertSkillInTown(); return; } // Msg_Player_Use_ActionItem msg = _msg as Msg_Player_Use_ActionItem; // ItemData itemData = msg.realItem.item.ItemData; // Tbl_Skill_Record record = AsTableManager.Instance.GetTbl_Skill_Record( itemData.itemSkill); bool permit = true; if( record.Skill_Type == eSKILL_TYPE.SlotBase && m_ElapsedCoolTime_BaseAttack > 0) permit = false; if( permit == true) { // eGENDER gender = UserEntity.GetProperty<eGENDER>( eComponentProperty.GENDER); // Msg_Player_Skill_Ready ready = new Msg_Player_Skill_Ready( itemData, msg.realItem.getSlot, gender); if( ready.constructSucceed == true) { if( WeaponEquip == false) { AsMyProperty.Instance.AlertNoWeapon(); return; } if( null == msg || null == msg.realItem || msg.realItem.CheckSkillUsable() == false) return; int iCurLevel = m_Entity.GetProperty<int>( eComponentProperty.LEVEL); if( iCurLevel < itemData.levelLimit) { AsChatManager.Instance.InsertChat( AsTableManager.Instance.GetTbl_String(1651), eCHATTYPE.eCHATTYPE_SYSTEM); AsEventNotifyMgr.Instance.CenterNotify.AddTradeMessage( AsTableManager.Instance.GetTbl_String(1651)); return; } if( AsCommonSender.CheckSkillUseProcessing() == true) return; if( m_Entity.CheckCondition( eSkillIcon_Enable_Condition.Movable) == false && ready.skillRecord.CheckSkillUsingOnly_Movable() == true) { AsMyProperty.Instance.AlertState(); return; } // if( SetTargetInActionItem( record) == false) // return; TargetDecider.sTargeting_AsSlot( this, ready.skillRecord); if( TargetDecider.CheckValidSkill( this, ready.skillRecord) == false) return; if( m_Target == null && ( ready.skillRecord.Skill_Type == eSKILL_TYPE.Target || ready.skillRecord.Skill_Type == eSKILL_TYPE.SlotBase)) return; if( TargetDecider.TargetSkillCheck( ready.skillRecord.Index, this) == false) return; if( ready.CheckValidTargeting( m_Target) == false) return; if( Target != null && m_Entity.GetNavPathDistance( Entity.transform.position, Target.transform.position, true) > ready.skillLvRecord.Usable_Distance * 0.01f)// * m_Character_Size) { Debug.Log( "AsPlayerFsm::OnSkillActive: msg.skillIdx_ = " + itemData.itemSkill + ", BattleRun state began [time:" + Time.realtimeSinceStartup + "]"); Msg_Player_Skill_Target_Move targetMove = new Msg_Player_Skill_Target_Move( ready); m_CurrentFsmState.MessageProcess( targetMove); } else { Debug.Log( "AsPlayerFsm::OnSkillActive: msg.skillIdx_ = " + itemData.itemSkill + ", SkillReady state began [time:" + Time.realtimeSinceStartup + "]"); m_CurrentFsmState.MessageProcess( ready); } } else if( ready.skillRecord.CheckNonAnimation() == true) { if( msg.realItem.CheckSkillUsable() == false) return; int iCurLevel = m_Entity.GetProperty<int>( eComponentProperty.LEVEL); if( iCurLevel < itemData.levelLimit) { AsChatManager.Instance.InsertChat( AsTableManager.Instance.GetTbl_String(1651), eCHATTYPE.eCHATTYPE_SYSTEM); AsEventNotifyMgr.Instance.CenterNotify.AddTradeMessage( AsTableManager.Instance.GetTbl_String(1651)); return; } if( AsCommonSender.CheckSkillUseProcessing() == true) return; TargetDecider.sTargeting_AsSlot( this, ready.skillRecord); if( TargetDecider.CheckValidSkill( this, ready.skillRecord) == false) return; if( TargetDecider.TargetSkillCheck( ready.skillRecord.Index, this) == false) return; int mainTargetIdxNpc = 0; uint mainTargetIdxUser = 0; TargetDecider decider = new TargetDecider(); if( decider.SetTarget( this, ready) == true) { mainTargetIdxNpc = decider.listTargets_Npc[0]; mainTargetIdxUser = decider.listTargets_User[0]; if( mainTargetIdxNpc != int.MaxValue && mainTargetIdxUser != uint.MaxValue) { AS_CS_CHAR_ATTACK_NPC attack = new AS_CS_CHAR_ATTACK_NPC( ready.skillLvRecord.Skill_GroupIndex, ready.skillLvRecord.Skill_Level, ready.actionRecord.Index, 0, false, false, ready.itemSlot, decider.listTargets_Npc , decider.listTargets_User, ready.picked, transform.forward, decider.decidedEntities.TargetCount, decider.decidedEntities.CharCount, decider.decidedEntities.listTarget.ToArray(), decider.decidedEntities.listChar.ToArray()); if( showSendingPacket == true) { Tbl_Action_Record action = AsTableManager.Instance.GetTbl_Action_Record( attack.nActionTableIdx); Debug.Log( "OnActionItem::SendingPacket: action name=" + action.ActionName + " skill index=" + attack.nSkillTableIdx + " skill level=" + attack.nSkillLevel + " action index=" + attack.nActionTableIdx + " charge step=" + attack.nChargeStep + " casting=" + attack.bCasting + " attack.nSlot =" + attack.nSlot + " main target id=" + attack.nNpcIdx[0] + " skill pos=" + attack.sTargeting + " transform.forward=" + transform.forward); } // byte[] bytes = attack.ClassToPacketBytes(); // AsCommonSender.Send( bytes); ePotency_Type potencyType = ready.skillRecord.listSkillPotency[0].Potency_Type; if( ePotency_Type.NormalHardPlayCount == potencyType || ePotency_Type.HellPlayCount == potencyType || ePotency_Type.HellPlayCountAll == potencyType) { if( null != AsHudDlgMgr.Instance && null != AsHudDlgMgr.Instance.invenDlg) { AsHudDlgMgr.Instance.invenDlg.ConfirmIndunCountItem( potencyType, attack, itemData, ready.skillRecord.Index); } } else { byte[] bytes = attack.ClassToPacketBytes(); AsCommonSender.Send( bytes); } } } } } }
void OnSkillActive( AsIMessage _msg) { // Msg_Input_Slot_Active __msg = _msg as Msg_Input_Slot_Active; // Debug.Log( "AsPlayerFsm::OnSkillActive: __msg.skillIdx_ = " + __msg.skillIdx_); if( AsPStoreManager.Instance.UnableActionByPStore() == true) return; if( CheckSpecificWindowOpened() == true) return; if( CheckMap_Village() == true) { // string content = AsTableManager.Instance.GetTbl_String(830); // AsChatManager.Instance.InsertChat( content, eCHATTYPE.eCHATTYPE_SYSTEM, true); AsMyProperty.Instance.AlertSkillInTown(); return; } if( WeaponEquip == false) { AsMyProperty.Instance.AlertNoWeapon(); return; } Msg_Input_Slot_Active msg = _msg as Msg_Input_Slot_Active; Tbl_Skill_Record record = AsTableManager.Instance.GetTbl_Skill_Record( msg.skillIdx_); bool permit = true; if( record.Skill_Type == eSKILL_TYPE.SlotBase && m_ElapsedCoolTime_BaseAttack > 0) { Debug.Log( "AsPlayerFsm::OnSkillActive: SlotBase skill is used in base attack cool time."); permit = false; } // if(record.Skill_Type == eSKILL_TYPE.Stance) // { // body_CS_CHAR_SKILL_STANCE stance = new body_CS_CHAR_SKILL_STANCE(); // byte[] bytes = stance.ClassToPacketBytes(); // AsCommonSender.Send(bytes); // //// AsCommonSender.BeginSkillUseProcess( record.Index); // } if( permit == true) { eGENDER gender = UserEntity.GetProperty<eGENDER>( eComponentProperty.GENDER); Msg_Player_Skill_Ready ready = new Msg_Player_Skill_Ready( record, gender, msg.step_, null, Vector3.zero, Vector3.zero, Vector3.zero, Vector3.zero, m_Entity.transform.forward, eClockWise.CW); if( ready.constructSucceed == true) { if( AsCommonSender.CheckSkillUseProcessing() == true) return; if( ready.CheckValidTargeting( m_Target) == false) { Debug.Log( "AsPlayerFsm::OnSkillActive: m_Target.GetInstanceID() = " + m_Target.GetInstanceID()); Target = null; return; } if( Target != null && m_Entity.GetNavPathDistance( Entity.transform.position, Target.transform.position, true) > ready.skillLvRecord.Usable_Distance * 0.01f)// * m_Character_Size) { // Debug.Log( "AsPlayerFsm::OnSkillActive: msg.skillIdx_ = " + msg.skillIdx_ + ", BattleRun state began [time:" + Time.realtimeSinceStartup + "]"); Msg_Player_Skill_Target_Move targetMove = new Msg_Player_Skill_Target_Move( ready); m_CurrentFsmState.MessageProcess( targetMove); } else { // Debug.Log( "AsPlayerFsm::OnSkillActive: msg.skillIdx_ = " + msg.skillIdx_ + ", SkillReady state began [time:" + Time.realtimeSinceStartup + "]"); m_CurrentFsmState.MessageProcess( ready); } } } }