コード例 #1
0
	INT CombatCore_T::FireDamage(Obj_Character& rMe,Obj_Character& rTar, INT nAdditionalAttack, INT nAdditionalResist)
	{
		INT nDamage;
		INT nAttack = Attr_VerifyTraitAttack(rMe.GetAttackFire()+nAdditionalAttack);
		INT nResist = Attr_VerifyResist(rTar.GetDefenceFire()+nAdditionalResist);
		nDamage = AttrDamage(rMe, nResist, nAttack, IATTRIBUTE_SHIELD_FIRE);

		INT nIgnoreRate = 0;
		if(Obj::OBJ_TYPE_HUMAN==rTar.GetObjType())
		{
			nIgnoreRate= (INT)(rTar.ItemValue(IATTRIBUTE_RATE_FIREATT_REDUCE).m_Value);
		}
		nDamage = nDamage*(100.0-((double)nIgnoreRate))/100.0f;

		return nDamage;
	}
コード例 #2
0
ファイル: Combat_Core.cpp プロジェクト: brock7/TianLong
	INT CombatCore_T::FireDamage(Obj_Character& rMe,Obj_Character& rTar, INT nAdditionalAttack, INT nAdditionalResist)
	{
		INT nDamage;
		INT nAttack = Attr_VerifyTraitAttack(rMe.GetAttackFire()+nAdditionalAttack);
		INT nResist = Attr_VerifyResist(rTar.GetDefenceFire()+nAdditionalResist);
		if(MAX_EFFECTIVE_RESIST<nResist)
		{
			nResist = MAX_EFFECTIVE_RESIST;
		}
		if(-MAX_EFFECTIVE_RESIST>nResist)
		{
			nResist = -MAX_EFFECTIVE_RESIST;
		}
		nDamage = Float2Int(nAttack*(100-nResist)/100);
		0>nDamage?nDamage=0:NULL;
		return nDamage;
	}
コード例 #3
0
ファイル: StdImpact069.cpp プロジェクト: uvbs/wx2Server
VOID StdImpact069_T::FinalDamage( INT * vDamage, Obj_Character &rMe ) const
{
    vDamage[DAMAGE_TYPE_NEAR]	-= rMe.GetDefenceNear();
    if( rMe.GetNearAttReduce() != 0 )
        vDamage[DAMAGE_TYPE_NEAR]	/= rMe.GetNearAttReduce();

    vDamage[DAMAGE_TYPE_FAR]	-= rMe.GetDefenceFar();
    if( rMe.GetNearAttReduce() != 0 )
        vDamage[DAMAGE_TYPE_FAR]	/= rMe.GetFarAttReduce();

    vDamage[DAMAGE_TYPE_MAGIC_NEAR]		-= rMe.GetDefenceMagicNear();
    if( rMe.GetNearAttReduce() != 0 )
        vDamage[DAMAGE_TYPE_MAGIC_NEAR]		/= rMe.GetMagicNearAttReduce();

    vDamage[DAMAGE_TYPE_MAGIC_FAR]		-= rMe.GetDefenceMagicFar();
    if( rMe.GetFarAttReduce() != 0 )
        vDamage[DAMAGE_TYPE_MAGIC_FAR]		/= rMe.GetMagicFarAttReduce();

    vDamage[DAMAGE_TYPE_GOLD]	-= rMe.GetDefenceGold();
    vDamage[DAMAGE_TYPE_WOOD]	-= rMe.GetDefenceWood();
    vDamage[DAMAGE_TYPE_WATER]	-= rMe.GetDefenceWater();
    vDamage[DAMAGE_TYPE_FIRE]	-= rMe.GetDefenceFire();
    vDamage[DAMAGE_TYPE_SOIL]	-= rMe.GetDefenceSoil();
}