Пример #1
0
 INT StdImpact017_T::OnFiltrateImpact(OWN_IMPACT& rImp, Obj_Character& rMe, OWN_IMPACT& rImpactNeedCheck) const
 {
     __ENTER_FUNCTION
     INT nImmunoLevel = GetImmunoLevel(rImp);
     INT nRate = GetRefixRate(rImp);
     nRate += 100;
     nImmunoLevel = Float2Int((nImmunoLevel*nRate)/100.0f);
     IDCollection_T const* pCollection = NULL;
     for(INT nIdx=0; COLLECTION_COUNT>nIdx; ++nIdx)
     {
         INT nCollectionID = GetCollectionByIndex(rImp, nIdx);
         if(INVALID_ID != nCollectionID)
         {
             pCollection = g_IDCollectionMgr.GetInstanceByID(nCollectionID);
             if(NULL!=pCollection)
             {
                 if(0<pCollection->GetCollectionSize())
                 {
                     if(nImmunoLevel>=Impact_GetLevel(rImpactNeedCheck))
                     {
                         if(TRUE==Impact_IsImpactInCollection(rImpactNeedCheck, nCollectionID))
                         {
                             return MissFlag_T::FLAG_IMMU; //免疫该效果
                         }
                     }
                 }
             }
         }
     }
     return FALSE;
     __LEAVE_FUNCTION
     return FALSE;
 }
Пример #2
0
		INT StdImpact004_T::GetDamageRefix( Obj_Character * pImpactSender, OWN_IMPACT& rImp ) const
		{
			if( pImpactSender->GetObjType() != Obj::OBJ_TYPE_HUMAN )
			{
				return 0;
			}
			Obj_Human* pHuman = static_cast<Obj_Human*>(pImpactSender);
			INT iDamage = 0;
			if( pHuman->GetMenPai() < 2 )
			{
				iDamage = pHuman->GetAttackNear();
			}
			else if(  pHuman->GetMenPai() < 4 )
			{
				iDamage = pHuman->GetAttackFar();
			}
			else 
			{
				iDamage = pHuman->GetAttackMagicNear();
			}

			INT iRefixRate = GetRefixRate( rImp );
			iDamage = (INT)(iDamage * iRefixRate / 100.0f);
			return iDamage;
		}
Пример #3
0
		BOOL StdImpact011_T::RefixPowerByRate(OWN_IMPACT & rImp, INT nRate) const
		{
			__ENTER_FUNCTION
			nRate += GetRefixRate(rImp);
			SetRefixRate(rImp, nRate);
			__LEAVE_FUNCTION
			return TRUE;
		}
Пример #4
0
		BOOL StdImpact013_T::GetIntAttrRefix(OWN_IMPACT & rImp, Obj_Character& rMe, CharIntAttrRefixs_T::Index_T nIdx, INT & rIntAttrRefix) const
		{
			__ENTER_FUNCTION
			INT nRefixRate = GetRefixRate(rImp);
			nRefixRate += 100;
			INT nValue = 0;
			switch (nIdx)
			{
				case CharIntAttrRefixs_T::REFIX_HIT:
					{
						if(0!=GetHitRefix(rImp))
						{
							nValue = Float2Int((GetHitRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_MISS:
					{
						if(0!=GetMissRefix(rImp))
						{
							nValue = Float2Int((GetMissRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_CRITICAL:
					{
						if(0!=GetCriticalRefix(rImp))
						{
							nValue = Float2Int((GetCriticalRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_TOUGHNESS:
					{
						if(0!=GetToughnessRefix(rImp))
						{
							nValue = Float2Int((GetToughnessRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
					
				default:
					break;
			}
			__LEAVE_FUNCTION
			return FALSE;
		}
Пример #5
0
		BOOL StdImpact011_T::GetIntAttrRefix(OWN_IMPACT & rImp, Obj_Character& rMe, CharIntAttrRefixs_T::Index_T nIdx, INT & rIntAttrRefix) const
		{
			__ENTER_FUNCTION
			INT nRefixRate = GetRefixRate(rImp);
			nRefixRate += 100;
			INT nValue = 0;
			switch (nIdx)
			{
				//Attacks
				case CharIntAttrRefixs_T::REFIX_ATTACK_NEAR:
					{
						if(0!=GetAttackNearRefix(rImp))
						{
							nValue = Float2Int((GetAttackNearRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_ATTACK_FAR:
					{
						if(0!=GetAttackFarRefix(rImp))
						{
							nValue = Float2Int((GetAttackFarRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_ATTACK_MAGIC_NEAR:
					{
						if(0!=GetAttackMagicNearRefix(rImp))
						{
							nValue = Float2Int((GetAttackMagicNearRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_ATTACK_MAGIC_FAR:
					{
						if(0!=GetAttackMagicFarRefix(rImp))
						{
							nValue = Float2Int((GetAttackMagicFarRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_ATTACK_GOLD:
					{
						if(0!=GetAttackGoldRefix(rImp))
						{
							nValue = Float2Int((GetAttackGoldRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_ATTACK_WOOD:
					{
						if(0!=GetAttackWoodRefix(rImp))
						{
							nValue = Float2Int((GetAttackWoodRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;

				case CharIntAttrRefixs_T::REFIX_ATTACK_WATER:
					{
						if(0!=GetAttackWaterRefix(rImp))
						{
							nValue = Float2Int((GetAttackWaterRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;

				case CharIntAttrRefixs_T::REFIX_ATTACK_SOIL:
					{
						if(0!=GetAttackSoilRefix(rImp))
						{
							nValue = Float2Int((GetAttackSoilRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;

				case CharIntAttrRefixs_T::REFIX_ATTACK_FIRE:
					{
						if(0!=GetAttackFireRefix(rImp))
						{
							nValue = Float2Int((GetAttackFireRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;

				//Defences
				case CharIntAttrRefixs_T::REFIX_DEFENCE_NEAR:
					{
						if(0!=GetDefenceNearRefix(rImp))
						{
							nValue = Float2Int((GetDefenceNearRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_DEFENCE_FAR:
					{
						if(0!=GetDefenceFarRefix(rImp))
						{
							nValue = Float2Int((GetDefenceFarRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_DEFENCE_MAGIC_NEAR:
					{
						if(0!=GetDefenceMagicNearRefix(rImp))
						{
							nValue = Float2Int((GetDefenceMagicNearRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_DEFENCE_MAGIC_FAR:
					{
						if(0!=GetDefenceMagicFarRefix(rImp))
						{
							nValue = Float2Int((GetDefenceMagicFarRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_RESIST_GOLD:
					{
						if(0!=GetResistGoldRefix(rImp))
						{
							nValue = Float2Int((GetResistGoldRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;
				case CharIntAttrRefixs_T::REFIX_RESIST_WOOD:
					{
						if(0!=GetResistWoodRefix(rImp))
						{
							nValue = Float2Int((GetResistWoodRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;

				case CharIntAttrRefixs_T::REFIX_RESIST_WATER:
					{
						if(0!=GetResistWaterRefix(rImp))
						{
							nValue = Float2Int((GetResistWaterRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;

				case CharIntAttrRefixs_T::REFIX_RESIST_FIRE:
					{
						if(0!=GetResistFireRefix(rImp))
						{
							nValue = Float2Int((GetResistFireRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;

				case CharIntAttrRefixs_T::REFIX_RESIST_SOIL:
					{
						if(0!=GetResistSoilRefix(rImp))
						{
							nValue = Float2Int((GetResistSoilRefix(rImp)*nRefixRate)/100.0f);
							rIntAttrRefix += nValue;
							return TRUE;
						}
					}
					break;

				default:
					break;
			}
			__LEAVE_FUNCTION
			return FALSE;
		}
Пример #6
0
 BOOL StdImpact056_T::GetIntAttrRefix(OWN_IMPACT & rImp, Obj_Character& rMe, CharIntAttrRefixs_T::Index_T nIdx, INT & rIntAttrRefix) const
 {
     __ENTER_FUNCTION
     INT nRefixRate = GetRefixRate(rImp);
     nRefixRate += 100;
     INT nValue = 0;
     switch (nIdx)
     {
         case CharIntAttrRefixs_T::REFIX_HIT:
             {
                 if(0!=GetHitRefix(rImp))
                 {
                     nValue = Float2Int((GetHitRefix(rImp)*nRefixRate)/100.0f);
                     rIntAttrRefix += nValue;
                     return TRUE;
                 }
             }
             break;
         case CharIntAttrRefixs_T::REFIX_MISS:
             {
                 if(0!=GetMissRefix(rImp))
                 {
                     nValue = Float2Int((GetMissRefix(rImp)*nRefixRate)/100.0f);
                     rIntAttrRefix += nValue;
                     return TRUE;
                 }
             }
             break;
         case CharIntAttrRefixs_T::REFIX_CRITICAL:
             {
                 if(0!=GetCriticalRefix(rImp))
                 {
                     nValue = Float2Int((GetCriticalRefix(rImp)*nRefixRate)/100.0f);
                     rIntAttrRefix += nValue;
                     return TRUE;
                 }
             }
             break;                
         //Attacks
         case CharIntAttrRefixs_T::REFIX_ATTACK_PHY:
             {
                 if(0!=GetAttackPhysicsRefix(rImp))
                 {
                     nValue = Float2Int((GetAttackPhysicsRefix(rImp)*nRefixRate)/100.0f);
                     nValue = Float2Int((rMe.GetBaseAttackPhysics()*nValue)/100.0f);
                     rIntAttrRefix += nValue;
                     return TRUE;
                 }
             }
             break;
         case CharIntAttrRefixs_T::REFIX_ATTACK_MAGIC:
             {
                 if(0!=GetAttackMagicRefix(rImp))
                 {
                     nValue = Float2Int((GetAttackMagicRefix(rImp)*nRefixRate)/100.0f);
                     nValue = Float2Int((rMe.GetBaseAttackMagic()*nValue)/100.0f);
                     rIntAttrRefix += nValue;
                     return TRUE;
                 }
             }
             break;
         //Defences
         case CharIntAttrRefixs_T::REFIX_DEFENCE_PHY:
             {
                 if(0!=GetDefencePhysicsRefix(rImp))
                 {
                     nValue = Float2Int((GetDefencePhysicsRefix(rImp)*nRefixRate)/100.0f);
                     nValue = Float2Int((rMe.GetBaseDefencePhysics()*nValue)/100.0f);
                     rIntAttrRefix += nValue;
                     return TRUE;
                 }
             }
             break;
         case CharIntAttrRefixs_T::REFIX_DEFENCE_MAGIC:
             {
                 if(0!=GetDefenceMagicRefix(rImp))
                 {
                     nValue = Float2Int((GetDefenceMagicRefix(rImp)*nRefixRate)/100.0f);
                     nValue = Float2Int((rMe.GetBaseDefenceMagic()*nValue)/100.0f);
                     rIntAttrRefix += nValue;
                     return TRUE;
                 }
             }
             break;
         // Maxes
         case CharIntAttrRefixs_T::REFIX_MAX_HP:
             {
                 if(0!=GetMaxHpRefix(rImp))
                 {
                     nValue = Float2Int((GetMaxHpRefix(rImp)*nRefixRate)/100.0f);
                     nValue = Float2Int((rMe.GetBaseMaxHP()*nValue)/100.0f);
                     rIntAttrRefix += nValue;
                     return TRUE;
                 }
             }
             break;
         default:
             break;
     }
     __LEAVE_FUNCTION
     return FALSE;
 }
Пример #7
0
				}
				if(0!=GetDexRefix(rImp))
				{
					rMe.MarkDexRefixDirtyFlag();
				}
			}
			__LEAVE_FUNCTION
		}
		BOOL StdImpact016_T::GetIntAttrRefix(OWN_IMPACT & rImp, Obj_Character& rMe, CharIntAttrRefixs_T::Index_T nIdx, INT & rIntAttrRefix) const
		{
			__ENTER_FUNCTION
			//只能使用在人身上	
			if(Obj::OBJ_TYPE_HUMAN==rMe.GetObjType())
			{
				Obj_Human & rMan = (Obj_Human &)rMe;
				INT nRefixRate = GetRefixRate(rImp);
				nRefixRate += 100;
				INT nValue = 0;
				switch (nIdx)
				{
					case CharIntAttrRefixs_T::REFIX_STR:
						{
							if(0!=GetStrRefix(rImp))
							{
								nValue = Float2Int((GetStrRefix(rImp)*nRefixRate)/100.0f);
								nValue = Float2Int((rMan.GetBaseStr2()*nValue)/100.0f);
								rIntAttrRefix += nValue;
								return TRUE;
							}
						}
						break;
Пример #8
0
        BOOL StdImpact012_T::GetIntAttrRefix(OWN_IMPACT & rImp, Obj_Character& rMe, CharIntAttrRefixs_T::Index_T nIdx, INT & rIntAttrRefix) const
        {
            __ENTER_FUNCTION
            INT nRefixRate = GetRefixRate(rImp);
            nRefixRate += 100;
            INT nValue = 0;
            switch (nIdx)
            {
                //Attacks
                case CharIntAttrRefixs_T::REFIX_ATTACK_PHY:
                    {
                        if(0!=GetAttackPhysicsRefix(rImp))
                        {
                            nValue = Float2Int((GetAttackPhysicsRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseAttackPhysics()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_ATTACK_MAGIC:
                    {
                        if(0!=GetAttackMagicRefix(rImp))
                        {
                            nValue = Float2Int((GetAttackMagicRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseAttackMagic()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_ATTACK_COLD:
                    {
                        if(0!=GetAttackColdRefix(rImp))
                        {
                            nValue = Float2Int((GetAttackColdRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseAttackCold()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_ATTACK_FIRE:
                    {
                        if(0!=GetAttackFireRefix(rImp))
                        {
                            nValue = Float2Int((GetAttackFireRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseAttackFire()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_ATTACK_LIGHT:
                    {
                        if(0!=GetAttackLightRefix(rImp))
                        {
                            nValue = Float2Int((GetAttackLightRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseAttackLight()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_ATTACK_POISON:
                    {
                        if(0!=GetAttackPoisonRefix(rImp))
                        {
                            nValue = Float2Int((GetAttackPoisonRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseAttackPoison()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;

                //Defences
                case CharIntAttrRefixs_T::REFIX_DEFENCE_PHY:
                    {
                        if(0!=GetDefencePhysicsRefix(rImp))
                        {
                            nValue = Float2Int((GetDefencePhysicsRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseDefencePhysics()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_DEFENCE_MAGIC:
                    {
                        if(0!=GetDefenceMagicRefix(rImp))
                        {
                            nValue = Float2Int((GetDefenceMagicRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseDefenceMagic()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_RESIST_COLD:
                    {
                        if(0!=GetResistColdRefix(rImp))
                        {
                            nValue = Float2Int((GetResistColdRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseDefenceCold()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_RESIST_FIRE:
                    {
                        if(0!=GetResistFireRefix(rImp))
                        {
                            nValue = Float2Int((GetResistFireRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseDefenceFire()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_RESIST_LIGHT:
                    {
                        if(0!=GetResistLightRefix(rImp))
                        {
                            nValue = Float2Int((GetResistLightRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseDefenceLight()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_RESIST_POISON:
                    {
                        if(0!=GetResistPoisonRefix(rImp))
                        {
                            nValue = Float2Int((GetResistPoisonRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseDefencePoison()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;

                // Maxes
                case CharIntAttrRefixs_T::REFIX_MAX_HP:
                    {
                        if(0!=GetMaxHpRefix(rImp))
                        {
                            nValue = Float2Int((GetMaxHpRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseMaxHP()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_MAX_MP:
                    {
                        if(0!=GetMaxMpRefix(rImp))
                        {
                            nValue = Float2Int((GetMaxMpRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseMaxMP()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_MAX_RAGE:
                    {
                        if(0!=GetMaxRageRefix(rImp))
                        {
                            nValue = Float2Int((GetMaxRageRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseMaxRage()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                case CharIntAttrRefixs_T::REFIX_MAX_STRIKE_POINT:
                    {
                        if(0!=GetMaxStrikePointRefix(rImp))
                        {
                            nValue = Float2Int((GetMaxStrikePointRefix(rImp)*nRefixRate)/100.0f);
                            nValue = Float2Int((rMe.GetBaseMaxStrikePoint()*nValue)/100.0f);
                            rIntAttrRefix += nValue;
                            return TRUE;
                        }
                    }
                    break;
                
                default:
                    break;
            }
            __LEAVE_FUNCTION
            return FALSE;
        }