Elin:Code Analysis/Feats

From Ylvapedia
Version EA23.67: This article is up to date for the latest stable release of Elin.

Feat can mean a few things at the same time:

  1. Racial feat, which is gained at race selection;
  2. Class feat, which is gained with different character class;
  3. Gained feat, which is gained through level up and spending feat points.

This page review some of the feats, which have their actual effects hidden from player view.

Depiction of Feats in code: an Index

public const int featStamina = 1612; x
public const int featCHA = 1627; x
public const int featWIL = 1626; x
public const int featMAG = 1625; x
public const int featLER = 1624; x
public const int featPER = 1623; x
public const int featEND = 1622; x
public const int featDEX = 1621; x
public const int featSTR = 1620; x
public const int featLuck = 1628; x
public const int featSwordsage = 1418; *
public const int featLife = 1610; x
public const int featManaMeat = 1421; *
public const int featExecutioner = 1420; *
public const int featMilitant = 1419; 
public const int featWitch = 1417; x
public const int featInquisitor = 1416; x
public const int featFoxMaid = 1415;
public const int featWhiteVixen = 1414;
public const int featFairysan = 1413;
public const int featLuckyCat = 1412;
public const int featSPD = 1629; x
public const int featMana = 1611; x
public const int featHardy = 1630; x
public const int featLonelySoul = 1646; 
public const int featEvade = 1632; x
public const int featEarthStrength = 1411;
public const int featChef = 1658;
public const int featManaCost = 1657; x
public const int featScavenger = 1656; 
public const int featModelBeliever = 1655; x
public const int featDreamWaker = 1653;
public const int featRapidArrow = 1652;
public const int featMagicManner = 1651;
public const int featGourmet = 1650;
public const int featDefender = 1649;
public const int featDefense = 1631;
public const int featRapidMagic = 1648;
public const int featParty = 1645;
public const int featBodyParts = 1644;
public const int featSorter = 1643;
public const int featSleeper = 1642;
public const int featResCurse = 1641;
public const int featAnimalLover = 1640;
public const int featFaith = 1636;
public const int featMartial = 1635;
public const int featNegotiate = 1634;
public const int featSpotting = 1633;
public const int featSummoner = 1647;
public const int featReboot = 1410;
public const int featHeavyCasting = 1654;
public const int featPaladin2 = 1408;
public const int featShiva = 1224;
public const int featLoyal = 1225;
public const int featUnderground = 1226;
public const int featServant = 1227;
public const int featDemigod = 1228;
public const int featLittleOne = 1229;
public const int featAdam = 1230;
public const int featNirvana = 1231;
public const int featCosmicHorror = 1233;
public const int featAcidBody = 1223;
public const int featHeavyEater = 1234;
public const int featNorland = 1236;
public const int featRoran = 1237;
public const int featGod_element1 = 1300;
public const int featGod_earth1 = 1305;
public const int featGod_wind1 = 1310;
public const int featGod_machine1 = 1315;
public const int featGod_healing1 = 1320;
public const int featGod_harvest1 = 1325;
public const int featGod_luck1 = 1330;
public const int featGod_moonshadow1 = 1350;
public const int featGod_trickery1 = 1345;
public const int featGod_strife1 = 1355;
public const int featGod_harmony1 = 1335;
public const int featGod_oblivion1 = 1340;
public const int featLightEater = 1235;
public const int featSplit = 1222;
public const int featSpike = 1221;
public const int featFate = 1220;
public const int featBoost = 1409;
public const int featSlowFood = 1200;
public const int featManaBond = 1201;
public const int featFastLearner = 1202;
public const int featGrowParts = 1203;
public const int featFairyWeak = 1204;
public const int featCannibalism = 1205;
public const int featMelilithCurse = 1206;
public const int featFoxBless = 1207;
public const int featFoxLearn = 1208;
public const int featFluffyTail = 1209;
public const int featUndead = 1210;
public const int featSnail = 1211;
public const int featFairyResist = 1212;
public const int featElea = 1213;
public const int featManaPrecision = 1214;
public const int featDwarf = 1215;
public const int featSuccubus = 1216;
public const int featGolem = 1217;
public const int featMetal = 1218;
public const int featElderCrab = 1219;
public const int featBaby = 1232;
public const int featWarrior = 1400;
public const int featThief = 1401;
public const int featFarmer = 1403;
public const int featArcher = 1404;
public const int featPianist = 1405;
public const int featTourist = 1406; *
public const int featWizard = 1402; x 
public const int featPaladin = 1407; *
  • All feats are depicted with integer (i.e. level). There are 111 kinds of feats. We will only review the ones with "*" mark beside it. If there is a "x" beside it, all the effects are shown to the player in game. If there is nothing beside it, then the code analyzer hasn't get to that feat yet.
  • If you want to see for the effect yourself, just search for that number in code.

Class feats

featSwordsage (Talisman Mastery)

    case MixType.Talisman:
		{
			int num2 = EClass.pc.Evalue(1418);
			Thing thing4 = ai.ings[1];
			SourceElement.Row source2 = (thing4.trait as TraitSpellbook).source;
			int num3 = thing4.c_charges * source2.charge * (100 + num2 * 50) / 500 + 1;
			int num4 = 100;
			Thing thing5 = ThingGen.Create("talisman").SetNum(num3);
			thing5.refVal = source2.id;
			thing5.encLV = num4 * (100 + num2 * 10) / 100;
			thing.ammoData = thing5;
			thing.c_ammo = num3;
			EClass.pc.Say("talisman", thing, thing5);
			thing4.Destroy();
			break;
		}
  • The "talisman mastery 2" trait of swordmage positively influence the effect of created talismans. Specifically:
    • The number of charges created by swordmage will be (magic_book_charges * num_of_charge_gained_if_read * 2 / 5) + 1.
    • For a normal PC, the number of charges will be (magic_book_charges * num_of_charge_gained_if_read * 1 / 5) + 1.
      • For example, for a magic book with 3 reads left with each read giving PC 10 charges, the number of talisman charge by swordmage would be 13, while by normal PC would be 7.
    • The talisman level created by swordmage is fixed at 120, while fixed at 100 by normal PC.

featManameat (Mana Body)

	if (Evalue(1421) >= 2 && base.hp <= MaxHP / (9 - Evalue(1421) * 2))
		{
			num4 /= 2;
		}
	PlayEffect("cast");
	mana.Mod(-num4);
  • If the feat Mana body is of level more than 2, then if the character's HP is lower than a threshold, all mana cost is cut by 50%.
    • Specifically, if feat Level is 2, when HP <= 20% Maximum HP, if feat Level is 3, when HP <= 33% Maximum HP.
    if (Evalue(1421) > 0)
		{
			int num6 = 0;
			int num7 = dmg;
			if (hp > 0)
			{
				num7 = dmg - hp;
				hp -= dmg;
				num6 += dmg;
				if (hp < 0 && Chara.mana.value >= 0)
				{
					num6 += hp;
					hp = 0;
				}
			}
			if (hp <= 0)
			{
				if (Evalue(1421) >= 2)
				{
					num7 /= 2;
				}
				dmg = num7;
				if (Chara.mana.value > 0)
				{
					num7 -= Chara.mana.value;
					Chara.mana.value -= dmg;
					num6 += dmg;
				}
				if (Chara.mana.value <= 0)
				{
					hp -= num7;
					num6 += num7;
				}
			}
			dmg = num6;
		}
  • It seems, that this mana cost reduction by 50% is also applied when HP is equal or less than 0 (only when Mana body >= level 2).
    • This effectively cut the damage these character recieved when HP is 0 by 50%.

featExecutioner (Heart of Death)

    if (CC.Evalue(1420) > 0)
		{
			int num3 = Mathf.Min(100, 100 - CC.hp * 100 / CC.MaxHP);
			if (num3 >= 50 && num3 * num3 * num3 * num3 / 3 > EClass.rnd(100000000))
			{
				return Crit();
			}
		}
		return true;
  • This is calculated after ALL other calculation is done. Such as Natural 20 hit, Natural 1 miss, etc.
    • A number (num3) is calculated through the percentage of HP left of a character. For example, if a character has 10% HP, that number is 90.
  • If the number is >= 50 (Character have less than 50% Max HP), we generate a random number, and test if num3^4 /3 is bigger than that number.
    • This effectively translate to a 33% Critical chance at 0 HP, a about 2% Critical chance at 50% HP.
  • Remember, this calculation is done after all other calculations, including all evasions. If player doesn't have this feat, this attack will hit anyway.
    • In other words, in order to trigger this effect, you have to first hit the enemy.

featPaladin (Devout)

	public void RefreshFaithElement()
	{
        ...
		SourceElement.Row row2 = EClass.sources.elements.alias.TryGetValue("featGod_" + row.id + "1");
		if (row2 != null)
		{
			faithElements.SetBase(row2.id, 1);
		}
		if (!HasCondition<ConExcommunication>())
		{
			int[] array = row.elements;
			int num = GetPietyValue() * (120 + Evalue(1407) * 15) / 100;
			for (int i = 0; i < array.Length; i += 2)
			{
				int num2 = array[i + 1] * num / 50;
				if (array[i] == 79)
				{
					num2 = EClass.curve(num2, array[i + 1] * 2, 10, 50);
				}
				if (num2 >= 20 && array[i] >= 950 && array[i] < 970)
				{
					num2 = 20;
				}
				faithElements.SetBase(array[i], Mathf.Max(num2, 1));
			}
		}
		faithElements.SetParent(this);
	}
  • The benefit of feat Devout is about 12.5% per level of that feat (15 of 120).