Aura.Channel.World.Entities.Creature.CalculateElementalDamageMultiplier C# (CSharp) Method

CalculateElementalDamageMultiplier() public method

Calculates the elemental damage modifier, between the "my" and the "target" affinities.
Since nobody seems to know the exact way elementals work, this function is mostly based on guess. First, all elementals are stacked against each other. If you have 1 affinity for an element that the enemy has as well, you lose 11.1% damage. Afterwards, you gain 11.1% for each very effective combination, and 3.7% for each slightly effective combination. The basic idea is that the same elements cancel each other out, while Fire and Ice are very, and Ice and Lightning are slightly effective against each other, as is hinted at in the in-game book "Understanding Elementals". The book also mentions that Fire and Lightning don't affect each other. The acual values, 11.1 and 3.7 (11.1 / 3) are based on the max affinity number 9, 11.1 * 9 being 99.9, and findings of the community, stating the need for at least 3 affinity for a noticible effect.
public CalculateElementalDamageMultiplier ( int myLightning, int myFire, int myIce, int targetLightning, int targetFire, int targetIce ) : float
myLightning int
myFire int
myIce int
targetLightning int
targetFire int
targetIce int
return float
		public float CalculateElementalDamageMultiplier(int myLightning, int myFire, int myIce, int targetLightning, int targetFire, int targetIce)
		{
			var result = 0f;

			// Element vs Element
			result -= Math.Min(myLightning, targetLightning);
			result -= Math.Min(myFire, targetFire);
			result -= Math.Min(myIce, targetIce);

			// Fire >> Ice
			result += Math.Min(myFire, targetIce);

			// Ice >> Fire
			result += Math.Min(myIce, targetFire);

			// Ice > Lightning
			result += Math.Min(myIce, targetLightning) / 3f;

			// Lightning > Ice
			result += Math.Min(myLightning, targetIce) / 3f;

			return 1f + (result / 9f);
		}

Same methods

Creature::CalculateElementalDamageMultiplier ( Creature target ) : float
Creature::CalculateElementalDamageMultiplier ( int myLightning, int myFire, int myIce, Creature target ) : float

Usage Example

示例#1
0
		/// <summary>
		/// Returns elemental damage multiplier for this skill.
		/// </summary>
		/// <param name="attacker"></param>
		/// <param name="target"></param>
		/// <returns></returns>
		protected override float GetElementalDamageMultiplier(Creature attacker, Creature target)
		{
			return attacker.CalculateElementalDamageMultiplier(Creature.MaxElementalAffinity, 0, 0, target);
		}
All Usage Examples Of Aura.Channel.World.Entities.Creature::CalculateElementalDamageMultiplier