docs/modSyntax.md
This syntax is used all over the codebase, but there are two locations that hold the majority of them: ModParser and Skill Stats.
In ModParser, the standard format of a mod looks like this: mod(ModName, ModType, Value, source, modFlags, keywordFlags, extraTags) See the function declaration here
For Skills, the format is simplified slightly to remove the source parameter, as that is added in automatically based on the gem it came from.
Used as a key, so you can reference this mod elsewhere in PoB. Can really be anything, but look around the codebase to find ones you need (e.g. "Damage", "Life", "PhysicalDamageGainAsLightning", etc)
flag(name, source, modFlags, keywordFlags, extraTags) instead. This method shortens the code and clarifies the intent. For example, flag("ZealotsOath", { type = "Condition", var = "UsingFlask" }) is the same as mod("ZealotsOath", "FLAG", true, { type = "Condition", var = "UsingFlask" })"ImprovedMinionDamageAppliesToPlayer" for "Increases and Reductions to Minion Damage apply ... at X% of their value" or "PoisonStackLimit" for "Cannot Poison Enemies with at least X Poisons on them"This represents the raw value of the mod. When it's used in the skills to map from the skill data, this will be nil, as it pulls the number from the gem based on the level.
This is where the mod comes from. Often it will be automatically filled in, coming from a tree node, gem, or item. If you do need to specify it for some reason, it's a string, and you can use "Tree:[nodeId]" as a special value to show a tree inset on hover.
These are bitwise flags that say what the mod can apply to. See a full list here under ModFlag. If you want to use several flags at once, make use of bit.bor and bor (ModParser.lua uses this alias) to combine them. When combined, all of the flags have to match. If you only need one to match, use the "ModFlagOr" tag instead.
These function similarly to the mod flags, and use the KeywordFlag group in Global.lua. These are usually based off of the flags on the gem itself. If you want to use several flags at once, make use of bit.bor and bor (ModParser.lua uses this alias) to combine them. When combined, only one of the flags has to match. If you need them all to match, use the "KeywordFlagAnd" tag instead.
Often a mod will only apply under certain conditions, apply multiple times based on other stats, etc. The syntax for that depends heavily on the first parameter, "type". There can be an infinite number of these tags at the end of a mod, so multiple can apply at one time. Some parameters, like actor or neg can be used on all of the types. Below are different types and the other parameters they need to function.
mod("MinionModifier", "LIST", { mod = mod("Damage", "INC", num, { type = "ActorCondition", actor = "parent", var = "HavePhysicalGolem" }) }, { type = "SkillType", skillType = SkillType.Golem }),ramp = {{35,0},{70,1}} means the mod does nothing at 35 units, but has its full value at 70 units.["with axes or swords"] = { flags = ModFlag.Hit, tag = { type = "ModFlagOr", modFlags = bor(ModFlag.Axe, ModFlag.Sword) } }, needs Hit, but can use either of the other two flags
bor as if you were adding ModFlags normallybor as if you were adding KeywordFlags normally