Exemplo n.º 1
0
	void OnHitExecution( AsIMessage _msg)
	{
		if( null == m_AttackSC)
			return;

		ProjectileHit();

		if( m_AttackSC.attacker_ == null || m_AttackSC.skillLv_ == null || m_AttackSC.action_ == null)
		{
			Debug.LogWarning( "AsMonsterFsm::OnHitExecution: error occured while processing npc attack msg.");
			return;
		}

		foreach( Msg_NpcAttackChar2 attack2 in m_AttackSC.bodyChar_)
		{
			AsEntityManager.Instance.DispatchMessageByUniqueKey( attack2.charUniqKey_, attack2);

//			if( AsUserInfo.Instance.GetCurrentUserEntity().UniqueId == attack2.charUniqKey_)
//			{
//				Debug.Log( "AsMonsterFsm::OnHitExecution: id:" + m_MonsterEntity.SessionId + " deals damage to user entity ( hp:" + attack2.hpCur_);
//			}

			if( attack2.reflection_ > 0 && Entity != null)
			{
				if( null != AsHUDController.Instance)
				{
					AsHUDController.Instance.panelManager.ShowNumberPanel( Entity.gameObject, ( int)attack2.reflection_, attack2.eDamageType_, true);	// need reflection font
					m_Entity.SetProperty( eComponentProperty.HP_CUR, m_AttackSC.hpCur_);
					AsEntityManager.Instance.MessageToPlayer( new Msg_ReflectionRefresh( Entity));
				}
			}
		}

		foreach( Msg_NpcAttackChar3 attack3 in m_AttackSC.bodyNpc_)
		{
			AsEntityManager.Instance.DispatchMessageByNpcSessionId( attack3.npcIdx_, attack3);
		}

		for( int i = 0; i < m_AttackSC.skill_.listSkillPotency.Count; ++i)
		{
			if( ePotency_Type.Heal == m_AttackSC.skill_.listSkillPotency[i].Potency_Type
				&& ePotency_Target.Self == m_AttackSC.skill_.listSkillPotency[i].Potency_Target)
			{
				if( m_MonsterEntity.GetInstanceID() == AsHUDController.Instance.targetInfo.getCurTargetEntity.GetInstanceID())
				{
					int nHealHP = ( int)( m_AttackSC.hpCur_ - AsHUDController.Instance.targetInfo.hp_cur);
					if( nHealHP > 0)
						AsHUDController.Instance.panelManager.ShowNumberPanel_HP( Entity.gameObject, nHealHP);

					AsHUDController.Instance.UpdateTargetSimpleInfo( m_MonsterEntity);
				}
				continue;
			}
		}

		if( 1 > m_AttackSC.hpCur_)
		{
			if( AsHUDController.Instance.targetInfo.getCurTargetEntity != null &&
				m_MonsterEntity.GetInstanceID() == AsHUDController.Instance.targetInfo.getCurTargetEntity.GetInstanceID())
			{
				AsHUDController.Instance.SetTargetInfo( null);
			}

			float curHP = m_MonsterEntity.GetProperty<float>( eComponentProperty.HP_CUR);
			if( curHP > m_AttackSC.hpCur_)
				m_MonsterEntity.SetProperty( eComponentProperty.HP_CUR, m_AttackSC.hpCur_);

			#region -MonsterLines
			if( m_AttackSC.charUniqKey_[0] == AsUserInfo.Instance.SavedCharStat.uniqKey_)
				PromptLines( AsMonsterLineManager.Instance.GetLine( m_MonsterEntity.TableIdx, eMonsterLineType.Death));
			#endregion

			DeathProcess( m_AttackSC);
		}

		m_AttackSC = null;
	}
Exemplo n.º 2
0
	void OnAttackIndication( AsIMessage _msg)
	{
		if( m_AttackSC != null && m_AttackSC.ready_ == false)
		{
			OnHitExecution( _msg);
		}

		m_AttackSC = _msg as Msg_NpcAttackChar1;
		
//		float animSpeed = GetCompleteAttackSpeed();
//		m_AttackSC.SetAnimSpeed( animSpeed);

		if( showLog_ == true)
			Debug.Log( "AsMonsterFsm::OnAttackIndication: m_AttackSc.ready_ == " + m_AttackSC.ready_ + "[" + Time.timeSinceLevelLoad + "]");

		if( m_AttackSC.ready_ == false)// || m_CurrentFsmState.FsmStateType == eMonsterFsmStateType.CONDITION_FORCEDMOVE)
		{
			OnHitExecution( m_AttackSC);
		}
		else
		{
			m_CurrentFsmState.MessageProcess( m_AttackSC);
		}

		#region -MonsterLines
		if( ( null != m_AttackSC) && ( m_AttackSC.charUniqKey_[0] == AsUserInfo.Instance.SavedCharStat.uniqKey_))
			PromptLines( AsMonsterLineManager.Instance.GetLine( m_MonsterEntity.TableIdx, eMonsterLineType.Skill, eConditionValueCheck.Equal, m_AttackSC.skill_.Index));
		#endregion
	}
Exemplo n.º 3
0
	public Msg_NpcAttackChar_Finish( Msg_NpcAttackChar1 _attack, Tbl_Action_Record _action, Tbl_MonsterSkillLevel_Record _skill)//, Msg_NpcMoveIndicate _move)
	{
		m_MessageType = eMessageType.NPC_ATTACK_FINISH;

		attack_ = _attack;
		action_ = _action;
		skill_ = _skill;
	}
Exemplo n.º 4
0
	public Msg_NpcAttackChar_Link( Msg_NpcAttackChar1 _attack)
	{
		m_MessageType = eMessageType.NPC_ATTACK_LINKACTION;

		attack_ = _attack;
	}
Exemplo n.º 5
0
	public Msg_NpcAttackChar_Hit( Msg_NpcAttackChar1 _attack, Tbl_Action_Record _action, Tbl_MonsterSkillLevel_Record _skill)
	{
		m_MessageType = eMessageType.NPC_ATTACK_HIT;

		attack_ = _attack;
		action_ = _action;
		skill_ = _skill;
	}
Exemplo n.º 6
0
	public Msg_NpcAttackChar3( Msg_NpcAttackChar1 _parent, AS_SC_NPC_ATTACK_CHAR_3 _info)
	{
		m_MessageType = eMessageType.NPC_ATTACK_CHAR3;

		parent_ = _parent;

		npcIdx_ = _info.nNpcIdx;

		hpCur_ = _info.fHpCur;
		hpHeal_ = _info.fHpHeal;
		mpHeal_ = _info.fMpHeal;
	}
Exemplo n.º 7
0
	//ADDITINAL INFO
//	public AsNpcEntity attacker_;
//	public Tbl_MonsterSkillLevel_Record skillLv_;
//	public Tbl_Action_Record action_;

	public Msg_NpcAttackChar2( Msg_NpcAttackChar1 _parent, AS_SC_NPC_ATTACK_CHAR_2 _info)
	{
		m_MessageType = eMessageType.NPC_ATTACK_CHAR2;

		parent_ = _parent;

		sessionId_ = _info.nSessionIdx;
		charUniqKey_ = _info.nCharUniqKey;

		hpCur_ = _info.fHpCur;
		mpCur_ = _info.fMpCur;

		eDamageType_ = ( eDAMAGETYPE)_info.eDamageType; // ilmeda, 20120731
		damage_ = _info.nDamage;

		hpHeal_ = _info.fHpHeal;
		mpHeal_ = _info.fMpHeal;

		reflection_ = _info.fReflection;
		drain_ = _info.fDrain;

		knockBack_ = _info.bKnockBack;
	}
Exemplo n.º 8
0
	void NpcAttackChar(byte[] _packet)
	{
//		Debug.Log("NpcAttackChar");

//		try{
		AS_SC_NPC_ATTACK_CHAR_1 attack = new AS_SC_NPC_ATTACK_CHAR_1();
		attack.PacketBytesToClass(_packet);
		Msg_NpcAttackChar1 msg = new Msg_NpcAttackChar1(attack);
		AsEntityManager.Instance.DispatchMessageByNpcSessionId(msg.npcId_, msg);
//		}
//		catch
//		{
//			Debug.Log("Error while npc_attack_char packet process.");
//
//			AS_SC_NPC_ATTACK_CHAR_1 attack = new AS_SC_NPC_ATTACK_CHAR_1();
//			attack.PacketBytesToClass(_packet);
//			Msg_NpcAttackChar1 msg = new Msg_NpcAttackChar1(attack);
//			AsEntityManager.Instance.DispatchMessageByNpcSessionId(msg.npcId_, msg);
//		}

//		foreach(AS_SC_NPC_ATTACK_CHAR_2 attack2 in attack.body)
//		{
//			NpcAttackCharMessage msg = new NpcAttackCharMessage(attack2);
//			AsEntityManager.Instance.DispatchMessageByUniqueKey(msg.charUniqKey_, msg);
//		}
	}
Exemplo n.º 9
0
	public Msg_Mob_Cast( Msg_NpcAttackChar1 info)
	{
		m_MessageType = eMessageType.MOB_CASTING;
		castInfo = info;
	}