void OnHitExecution( AsIMessage _msg) { if( m_AttackSC == null) return; // if( m_AttackSC.action_.HitAnimation != null && // m_AttackSC.action_.HitAnimation.hitInfo != null && // m_AttackSC.action_.HitAnimation.hitInfo.HitType == eHitType.ProjectileTarget) // { // Tbl_Action_HitInfo hitInfo = m_AttackSC.action_.HitAnimation.hitInfo; // // Debug.Log( "AsPlayerFsm::OnAttackSC: ( time:" + System.DateTime.Now + ") projectile target = " + hitInfo.HitProjectileHitFileName); // } Int32 mainTargetId = m_AttackSC.npcIdx_[0]; ProjectileHit(); if( m_AttackSC.hpHeal_ > 0) { AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity(); AsHUDController.Instance.panelManager.ShowNumberPanel( userEntity, (int)( m_AttackSC.hpHeal_), eATTRCHANGECONTENTS.eATTRCHANGECONTENTS_USING_SKILL, AsPanelManager.eCustomFontType.eCustomFontType_HP); // userEntity.SetProperty( eComponentProperty.HP_CUR, m_AttackSC.hpCur_); } //npc foreach( Msg_OtherCharAttackNpc2 attack2 in m_AttackSC.npcBody_) { AsEntityManager.Instance.DispatchMessageByNpcSessionId( attack2.npcIdx_, attack2); #region - hud - // < ilmeda 20120425 if( null != AsHUDController.Instance) { AsNpcEntity npcEntity = AsEntityManager.Instance.GetNpcEntityBySessionId( attack2.npcIdx_); if( null != npcEntity) { AsHUDController.Instance.panelManager.ShowNumberPanel( npcEntity.gameObject, (int)attack2.damage_, attack2.eDamageType_, attack2.parent_.action_, true);//, m_AttackSC.actionTableIdx_); if(attack2.heal_ < 0f) AsHUDController.Instance.panelManager.ShowNumberPanel( npcEntity.gameObject, (int)-attack2.heal_, attack2.eDamageType_, attack2.parent_.action_, true);//, m_AttackSC.actionTableIdx_); if( (int)attack2.reflection_ > 0) { AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity(); AsHUDController.Instance.panelManager.ShowNumberPanel( userEntity.transform.gameObject, (int)( attack2.reflection_), attack2.eDamageType_, false); } if( null != AsHUDController.Instance.targetInfo.getCurTargetEntity) { if( AsHUDController.Instance.targetInfo.getCurTargetEntity.GetInstanceID() == ( ( AsBaseEntity)npcEntity).GetInstanceID()) AsHUDController.Instance.targetInfo.UpdateTargetSimpleInfo( ( AsBaseEntity)npcEntity); } } } // ilmeda 20120425 > if( attack2.npcIdx_ == mainTargetId) { if( null != AsHUDController.Instance) { AsHUDController.Instance.targetInfo.HpCur = (int)attack2.hpCur_; if( 0 >= attack2.hpCur_) { m_Target = null; AsHUDController.Instance.targetInfo.Enable = false; } else { if( false == AsHUDController.Instance.targetInfo.Enable) AsHUDController.Instance.targetInfo.Enable = true; } } } #endregion } //pc foreach( Msg_OtherCharAttackNpc3 attack3 in m_AttackSC.charBody_) { AsEntityManager.Instance.DispatchMessageByUniqueKey( attack3.charUniqKey_, attack3); #region - hud - if( attack3.reflection_ > 0 && Entity != null) { if( null != AsHUDController.Instance) { AsHUDController.Instance.panelManager.ShowNumberPanel( Entity.gameObject, (int)attack3.reflection_, attack3.eDamageType, true); // need reflection font m_Entity.SetProperty( eComponentProperty.HP_CUR, m_AttackSC.hpCur_); AsEntityManager.Instance.MessageToPlayer( new Msg_ReflectionRefresh( Entity)); } } #endregion } m_Entity.SetProperty( eComponentProperty.HP_CUR, m_AttackSC.hpCur_);// life steal AsUserInfo.Instance.SavedCharStat.hpCur_ = m_AttackSC.hpCur_; if( m_AttackSC.hpCur_ < 1) { UserEntity.SetProperty( eComponentProperty.LIVING, false); #region - quest - ArkQuestmanager.instance.QuestFailByDeath(); #endregion StartCoroutine( DeathProcess( _msg)); } m_AttackSC = null;//release }
public void PotencyProcess(Msg_OtherCharAttackNpc3 _attack) { Tbl_Skill_Record skill = _attack.parent_.skill_; m_OtherCharAttackNpc1 = _attack.parent_; for(int i=0; i<skill.listSkillPotency.Count; ++i) { Tbl_Skill_Potency potency = skill.listSkillPotency[i]; Tbl_SkillLevel_Potency lvPotency = _attack.parent_.skillLv_.listSkillLevelPotency[i]; if(potency.Potency_DurationType == ePotency_DurationType.Moment) { Tbl_SkillLevel_Record skillLv = _attack.parent_.skillLv_; Tbl_Action_Record action = _attack.parent_.action_; if(TargetDecider.CheckAffectingUserIsEnemy(m_Owner, _attack.parent_.charUniqKey_) == true) // attack from user { switch(potency.Potency_Target) { case ePotency_Target.Enemy: case ePotency_Target.All: if(PlayPotency(_attack, action.HitAnimation.hitInfo, skillLv.listSkillLevelPotency[i].Potency_EffectIndex, lvPotency) == false) { Debug.LogError("PotencyProcessor: delivered message is Msg_OtherCharAttackNpc2(Skill level table record:[index:" + skillLv.Index + "][action index:" + skillLv.SkillAction_Index + "][skill index:" + skillLv.Skill_GroupIndex + "]"); } break; } if(_attack.knockBack_ == true && _attack.parent_.attacker_ != null) { switch(potency.Potency_Type) { case ePotency_Type.Move: ForcedMoveProcess(lvPotency, _attack.parent_.attacker_.transform.position); break; case ePotency_Type.PointMove: ForcedMoveProcess(lvPotency, _attack.parent_.targeting_); break; } } } else { switch(potency.Potency_Target) { case ePotency_Target.Alliance: case ePotency_Target.Party: case ePotency_Target.Self: case ePotency_Target.All: if(PlayPotency(action.HitAnimation.hitInfo, skillLv.listSkillLevelPotency[i].Potency_EffectIndex, lvPotency) == false) { Debug.LogError("PotencyProcessor: delivered message is Msg_OtherCharAttackNpc2(Skill level table record:[index:" + skillLv.Index + "][action index:" + skillLv.SkillAction_Index + "][skill index:" + skillLv.Skill_GroupIndex + "]"); } break; } } } } BalloonProcess( _attack.parent_.skill_, _attack.parent_.skillLv_); }
void OnAttackSC( AsIMessage _msg) { if( m_AttackSC != null && m_AttackSC.ready_ == false) { OnHitExecution( _msg); } m_AttackSC = _msg as Msg_OtherCharAttackNpc1; if( m_AttackSC.ready_ == false) OnHitExecution( _msg); }
void OnHitExecution( AsIMessage _msg) { if( m_AttackSC == null) { // Debug.LogWarning( "AsOtherUserFsm::OnHitExecution: no saved attack packet."); return; } ProjectileHit(); #region - hud - // // < ilmeda 20120425 // if( null != AsHUDController.Instance) // { // AsNpcEntity npcEntity = AsEntityManager.Instance.GetNpcEntityBySessionId( attack2.npcIdx_); // if( null != npcEntity) // { // AsHUDController.Instance.panelManager.ShowNumberPanel( npcEntity.gameObject, ( int)attack2.damage_, attack2.eDamageType, attack2.parent_.action_, true);//, m_AttackSC.actionTableIdx_); // // if( ( int)attack2.reflection_ > 0) // { // AsUserEntity userEntity = AsUserInfo.Instance.GetCurrentUserEntity(); // AsHUDController.Instance.panelManager.ShowNumberPanel( userEntity.transform.gameObject, ( int)( attack2.reflection_), attack2.eDamageType, false); // } // // if( null != AsHUDController.Instance.targetInfo.getCurTargetEntity) // { // if( AsHUDController.Instance.targetInfo.getCurTargetEntity.GetInstanceID() == ( ( AsBaseEntity)npcEntity).GetInstanceID()) // AsHUDController.Instance.targetInfo.UpdateTargetSimpleInfo( ( AsBaseEntity)npcEntity); // } // } // } #endregion foreach( Msg_OtherCharAttackNpc2 attack2 in m_AttackSC.npcBody_) { AsEntityManager.Instance.DispatchMessageByNpcSessionId( attack2.npcIdx_, attack2); AsPlayerFsm playerFsm = AsEntityManager.Instance.GetPlayerCharFsm(); if( null != playerFsm) playerFsm.UpdateTargetInfoByOtherUser( attack2); } //pc foreach( Msg_OtherCharAttackNpc3 attack3 in m_AttackSC.charBody_) { AsEntityManager.Instance.DispatchMessageByUniqueKey( attack3.charUniqKey_, attack3); if( attack3.reflection_ > 0 && Entity != null) { if( null != AsHUDController.Instance) { AsHUDController.Instance.panelManager.ShowNumberPanel( Entity.gameObject, ( int)attack3.reflection_, attack3.eDamageType, true); // need reflection font m_Entity.SetProperty( eComponentProperty.HP_CUR, m_AttackSC.hpCur_); AsEntityManager.Instance.MessageToPlayer( new Msg_ReflectionRefresh( Entity)); } } } m_AttackSC = null;//release }
public void PotencyProcess(Msg_OtherCharAttackNpc2 _attack) { Tbl_Skill_Record skill = _attack.parent_.skill_; m_OtherCharAttackNpc1 = _attack.parent_; for(int i=0; i<skill.listSkillPotency.Count; ++i) { Tbl_Skill_Potency potency = skill.listSkillPotency[i]; Tbl_SkillLevel_Potency lvPotency = _attack.parent_.skillLv_.listSkillLevelPotency[i]; if(potency.Potency_DurationType == ePotency_DurationType.Moment) { Tbl_SkillLevel_Record skillLv = _attack.parent_.skillLv_; Tbl_Action_Record action = _attack.parent_.action_; if(m_Owner.FsmType == eFsmType.MONSTER) { switch(potency.Potency_Target) { case ePotency_Target.Enemy: case ePotency_Target.All: if(PlayPotency(action.HitAnimation.hitInfo, skillLv.listSkillLevelPotency[i].Potency_EffectIndex, _attack.eDamageType_, lvPotency) == false) { Debug.LogError("PotencyProcessor: delivered message is Msg_OtherCharAttackNpc2(Skill level table record:[index:" + skillLv.Index + "][action index:" + skillLv.SkillAction_Index + "][skill index:" + skillLv.Skill_GroupIndex + "]"); } break; } } } } BalloonProcess( _attack.parent_.skill_, _attack.parent_.skillLv_); }
void OnAttack( AsIMessage _msg) { if( m_AttackSC != null && m_AttackSC.ready_ == false) OnHitExecution( _msg); m_AttackSC = _msg as Msg_OtherCharAttackNpc1; m_OtherUserEntity.HandleMessage( new Msg_CombatBegin()); if( m_AttackSC.ready_ == true) { // float attackSpeed = m_Entity.GetProperty<float>( eComponentProperty.ATTACK_SPEED); Msg_OtherCharAttackNpc_Ready ready = new Msg_OtherCharAttackNpc_Ready( m_AttackSC);//, attackSpeed); if( ready.CheckNonAnimation() == false) m_CurrentFsmState.MessageProcess( ready); } else { // AsTimerManager.Instance.SetTimer( 3, Timer_LateExecution); // int actionIdx = m_AttackSC.actionTableIdx_; // Tbl_Action_Record record = AsTableManager.Instance.GetTbl_Action_Record( actionIdx); // if( record.HitAnimation.hitInfo.HitType != eHitType.ProjectileTarget) // { OnHitExecution( _msg); // } } if( showReceiveAttackMsg == true) { Debug.Log( "AsOtherUserFsm::OnAttack: session id=" + m_AttackSC.sessionId_ + " charUniqKey_" + m_AttackSC.charUniqKey_ + " npc id=" + m_AttackSC.npcIdx_ + " target pos=" + m_AttackSC.targeting_ + " direction=" + m_AttackSC.direction_ + " skill table idx=" + m_AttackSC.skillTableIdx_ + " skill level=" + m_AttackSC.skillLevel_ + " action table idx=" + m_AttackSC.actionTableIdx_ + " charge step=" + m_AttackSC.chargeStep_ + " casting=" + m_AttackSC.casting_ + " ready=" + m_AttackSC.ready_ + " cur hp=" + m_AttackSC.hpCur_ + " npc cnt=" + m_AttackSC.npcCnt_ + " char cnt=" + m_AttackSC.charCnt_); } }
void OnStance( AsIMessage _msg) { Msg_OtherCharSkillStance stance = _msg as Msg_OtherCharSkillStance; m_StanceInfo = new StanceInfo( stance); m_OtherUserEntity.SetStance( m_StanceInfo); // Tbl_Skill_Record skill = AsTableManager.Instance.GetTbl_Skill_Record( stance.stanceSkill_); // eGENDER gender = m_Entity.GetProperty<eGENDER>(eComponentProperty.GENDER); Msg_OtherCharAttackNpc1 attack = new Msg_OtherCharAttackNpc1( stance); Msg_OtherCharAttackNpc_Ready ready = new Msg_OtherCharAttackNpc_Ready( attack); m_CurrentFsmState.MessageProcess( ready); m_OtherUserEntity.HandleMessage( new Msg_CombatBegin()); m_ElementProcessor.PotencyProcess( stance); }
public Msg_OtherCharAttackNpc_Ready( Msg_OtherCharAttackNpc1 _msg)//, float _animSpeed) { try { m_MessageType = eMessageType.OTHER_CHAR_ATTACK_READY; attack_ = _msg; skill_ = AsTableManager.Instance.GetTbl_Skill_Record( attack_.skillTableIdx_); skillLv_ = AsTableManager.Instance.GetTbl_SkillLevel_Record( attack_.skillLevel_, attack_.skillTableIdx_, attack_.chargeStep_); action_ = AsTableManager.Instance.GetTbl_Action_Record( _msg.actionTableIdx_); animSpeed_ = 1f; if( animSpeed_ == 0f) { Debug.LogError( "Msg_OtherCharAttackNpc_Ready::constructor: animSpeed_ is set as 0. instead set animSpeed_ 1f"); animSpeed_ = 1f; } } catch { Debug.Log( "Msg_OtherCharAttackNpc_Ready:constructor: error occured"); } }
public Msg_OtherCharAttackNpc3( Msg_OtherCharAttackNpc1 _parent, AS_SC_CHAR_ATTACK_NPC_3 _info) { m_MessageType = eMessageType.CHAR_ATTACK_NPC3; parent_ = _parent; sessionIdx_ = _info.nSessionIdx; charUniqKey_ = _info.nCharUniqKey; hpCur_ = _info.fHpCur; mpCur_ = _info.fMpCur; eDamageType = ( eDAMAGETYPE)_info.eDamageType; damage_ = _info.fDamage; hpHeal_ = _info.fHpHeal; mpHeal_ = _info.fMpHeal; reflection_ = _info.fReflection; drain_ = _info.fDrain; knockBack_ = _info.bKnockBack; }
// public Vector3 position_; // //ADDITONAL // public Tbl_SkillLevel_Record skillLv_; // public Tbl_Action_Record action_; // public Msg_OtherCharAttackNpc2( AS_SC_CHAR_ATTACK_NPC_2 _info) // { // m_MessageType = eMessageType.CHAR_ATTACK_NPC2; // // npcIdx_ = _info.nNpcIdx; // // hpCur_ = _info.nHpCur; // eDamageType = ( eDAMAGETYPE)_info.eDamageType; // damage_ = _info.nDamage; // // reflection_ = _info.fReflection; // drain_ = _info.fDrain; // // position_ = _info.vPosition; // } public Msg_OtherCharAttackNpc2( Msg_OtherCharAttackNpc1 _parent, AS_SC_CHAR_ATTACK_NPC_2 _info, UInt32 charUniqKey) { m_MessageType = eMessageType.CHAR_ATTACK_NPC2; parent_ = _parent; npcIdx_ = _info.nNpcIdx; hpCur_ = _info.nHpCur; eDamageType_ = ( eDAMAGETYPE)_info.eDamageType; damage_ = _info.nDamage; heal_ = _info.fHpHeal; reflection_ = _info.fReflection; drain_ = _info.fDrain; #region -Authority authorityOwnerIsMe = ( charUniqKey == AsUserInfo.Instance.GetCurrentUserEntity().UniqueId) ? true : false; if( true == authorityOwnerIsMe) authorityInMe = _info.bAggroMyself; #endregion // position_ = _info.vPosition; }