⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 skillobjectfirstunit_attack.cpp

📁 墨香最新私服
💻 CPP
字号:
// SkillObjectFirstUnit_Attack.cpp: implementation of the CSkillObjectFirstUnit_Attack class.
//
//////////////////////////////////////////////////////////////////////

#include "stdafx.h"
#include "SkillObjectFirstUnit_Attack.h"
#include "SkillInfo.h"
#include "Battle.h"
#include "..\[CC]Header\CommonCalcFunc.h"
#include "Object.h"



//////////////////////////////////////////////////////////////////////
// Construction/Destruction
//////////////////////////////////////////////////////////////////////

CSkillObjectFirstUnit_Attack::CSkillObjectFirstUnit_Attack(SKILLINFO* pSkillInfo)
: CSkillObjectFirstUnit(pSkillInfo)
{
	
}

CSkillObjectFirstUnit_Attack::~CSkillObjectFirstUnit_Attack()
{

}

void CSkillObjectFirstUnit_Attack::Init(CSkillInfo* pSkillInfo,WORD SkillLevel)
{
	m_bMugong = pSkillInfo->GetSkillInfo()->ComboNum == SKILL_COMBO_NUM;
	m_PhysicalAttack = pSkillInfo->GetSkillInfo()->FirstPhyAttack[SkillLevel-1];	
	WORD mi,ma;
	mi = pSkillInfo->GetSkillInfo()->FirstAttAttackMin[SkillLevel-1];
	ma = pSkillInfo->GetSkillInfo()->FirstAttAttackMax[SkillLevel-1];
	m_AttribAttack.SetValue(mi,ma);
	m_CriticalRate = pSkillInfo->GetCriticalRate(SkillLevel);
	m_AttAttackRate = pSkillInfo->GetFirstAttAttack(SkillLevel);

	CSkillObjectFirstUnit::Init(pSkillInfo,SkillLevel);
}


#ifdef _MAPSERVER_

#include "AttackManager.h"
#include "StateMachinen.h"

void CSkillObjectFirstUnit_Attack::ExcuteFirstUnit(CObject* pOperator,CSkillObjectTargetList* pTargetList,
												   MSG_SKILLOBJECT_ADD* pAddMsg)
{
	CTargetListIterator iter(&pAddMsg->TargetList);
	STLIST* pList;
	RESULTINFO DamageInfo;
	
	DWORD AmplifiedPower = 0;
	DWORD AmplifiedPowerAtt = 0;
	float AmplifiedPowerAttRate = 0;
	if(m_PhysicalAttack)		// 拱府 傍拜老锭父
		AmplifiedPower = pOperator->GetSpecialStateParam1(eSpecialState_AmplifiedPowerPhy);

	WORD Attrib = m_Attrib;
	if( m_AttribAttack.GetMax() == 0 && m_AttAttackRate == 0)
		Attrib = pOperator->GetSpecialStateParam2(eSpecialState_AmplifiedPowerAtt);

	if( Attrib == pOperator->GetSpecialStateParam2(eSpecialState_AmplifiedPowerAtt) )
	{
		AmplifiedPowerAtt = pOperator->GetSpecialStateParam1(eSpecialState_AmplifiedPowerAtt);
		AmplifiedPowerAttRate = pOperator->GetSpecialStateParam3(eSpecialState_AmplifiedPowerAtt);
	}

	
	LEVELTYPE OperLevel = pOperator->GetLevel();
	pTargetList->SetPositionHead();
	while(pList = pTargetList->GetNextTargetList())
	{
		DamageInfo.Clear();

		if(pOperator->GetBattle()->IsEnemy(pOperator,pList->pObject))
		{
			ATTACKMGR->Attack(m_bMugong,
				pOperator,pList->pObject, AmplifiedPower,
				m_PhysicalAttack,
				Attrib,
				m_AttribAttack.GetMin()+AmplifiedPowerAtt,
				m_AttribAttack.GetMax()+AmplifiedPowerAtt,
				m_AttAttackRate+AmplifiedPowerAttRate,
				m_CriticalRate,
				&DamageInfo,
				TRUE);	// TRUE 绰 First Unit篮 墨款磐 单固瘤 乐澜
		}

		DefaultFirstEffect(pOperator,pList,&DamageInfo);
		
		iter.AddTargetWithResultInfo(pList->pObject->GetID(),pList->bTargetKind,&DamageInfo);
	}
	iter.Release();
}

#endif

#ifdef _MHCLIENT_
void CSkillObjectFirstUnit_Attack::StartFirstEffect(CObject* pOperator,CTargetList* pTList,MAINTARGET* pMainTarget)
{
	CSkillObjectFirstUnit::StartFirstEffect(pOperator,pTList,pMainTarget);

	// for delete Effect
	pOperator->GetSpecialStateParam1(eSpecialState_AmplifiedPowerPhy);
}
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -