Looking at the code, it's mostly makes sense to me, but I don't get quite how you use CharacterHasStatus though.
CharacterHasStatus(_Char, CONSUME, LynnBoost_BurningTempest)
Other places I see this used with only two parts, like (_Char, CHILLED). Are the all caps things hardcoded status functions or defined elsewhere, and you have to essentially define the status in the function otherwise?
In general, I don't really understand what "consume" means, and why it's used and sometimes not. Is consume, like CharacterHasStatus, just used for the non hardcoded/otherwise defined elsewhere statuses (e.g., "skillboost" statuses.)
I didn't get it either until I started looking at the skilldata and how some skills applied statuses.
There are some hardcoded statuses like BURNED, STUNNED, CHILLED, CONSUME, STANCE, etc., and as far as I can tell those are all caps like that. However, for "custom" status effects the game utilizes the potions file to supply them.
CharacterHasStatus() can be supplied with either two or three parameters.
The first use is like you see in most instances with (_Char, CHILLED) this checks if _Char has the hardcoded Chilled status. The second use is like you see with (_Char, CONSUME, LynnBoost_BurningTempest). STANCE is the same way, it takes three parameters to check. CONSUME is the hardcoded status effect that pulls it's status data from the potions.txt file. STANCE is the same way.
Because we don't have any way to make new hardcoded status effects like BURNED we have to utilize the potions.txt and CONSUME/STANCE status to apply new status effects. It's basically a hacky, but intended, workaround to making custom skills that may just be one-off effects. Incidentally, it's also how spells like the Avatar line are modified.
data "SkillProperties" "Consume,100,3,SKILLBOOST_ImmuneToFreezing"
The long and short of it is CONSUME is the hardcoded status effect that is applying the potion effect of SKILLBOOST_ImmuneToFreezing with a 100% chance of success and lasts for a duration of 3 turns whenever Avatar of Frost is cast on someone.
STANCE is the same way, the only difference is stances are can be toggled on and off and new stances overwrite the previous. Technically speaking you can bypass this by using Consume, 100, -1, someNewStance to make sub-stances with infinite duration and use a custom StackID to overwrite it in potions, but uh, something something monkey-dragon-tiger-llama-sloth stance is getting a little too meta there.
I'm trying to make a skill that lets a character cleanse statuses off an ally but they take those statuses for one round. I'm having it set a status on the cleansee (LeadersCleanse), trying to figure out the statuses removed, but not sure if I need to set a duration or not. Still trying stuff, will see tomorrow if I can figure it out.
The only way I can, at the moment, think of accomplishing something like this would be to use a really hacky implementation of OnDamage() as we aren't able to create custom functions just yet with no editor and we don't have a trigger that checks when cast on. OnVitalityChanged() wouldn't work as we aren't able to specify a source.
CHARACTER:__Me
EXTERN FLOAT:%CleanseHealAmount = -0.01
EVENT StatusCleanse
VARS
FLOAT:_Damage
CHARACTER:_Char
ON
OnDamage(_, _Damage, _Char, _)
ACTIONS
IF "c1&c2"
IsLessThen(_Damage, %CleanseHealAmount) // Was I healed for less than 1% of my vitality?
CharacterHasStatus(_Char, CONSUME, LaelaBoost_Cleanser) // And does the person healing me have LaelaBoost_Cleanser on them?
THEN
IF "c1"
CharacterHasStatus(__Me, BURNED) // Do I have burn?
THEN
CharacterRemoveStatus(__Me, BURNED) // Then remove burned from me
CharacterApplyStatus(_Char, BURNED, 2, 1) // And apply BURNED to _Char for 2 turns and ignore saves/immunities.
ENDIF
ENDIF
// And so on for each debuff you want to cleanse.
LaelaBoost_Cleanser would be a one turn, no effect status that the person cleansing would apply to themselves that way the script has a way to differentiate between, say, chugging a potion and being cleansed. Because we don't have any way to make new On triggers yet you would have to apply a very small heal component to the spell. Super small, even a heal of 1 hp would work.
Another possible way to go about it might be a rolling cleanse:
new entry "LynnBoost_StatusTransfer"
type "Potion"
using "_SkillBoost"
data "Duration" "1"
CHARACTER:__Me
EXTERN CHARACTER:%Cleanser = null
EXTERN FLOAT:%CleanseHealAmount = -0.01
EVENT RollingCleanse
VARS
FLOAT:_Damage
CHARACTER:_Char
ON
OnDamage(_, _Damage, _Char, _)
ACTIONS
IF "c1&c2"
IsLessThen(_Damage, %CleanseHealAmount) // Was I healed for less than 1% of my vitality?
CharacterHasStatus(_Char, CONSUME, LaelaBoost_Cleanser) // And does the person healing me have LaelaBoost_Cleanser on them?
THEN
Set(%Cleanser, _Char) // Set Laela as Lynn's Cleanser
CharacterConsume(__Me, LynnBoost_StatusTransfer)
ENDIF
CallFunction("StatusTransfer") // Call a new function from here to facilitate transfering of buffs.
EVENT RollingCleanseWhenAttacking
ON
OnDamage(_, _, _, _)
ACTIONS
IF "c1"
CharacterHasStatus(__Me, CONSUME, LynnBoost_StatusTransfer) // I was set to BURNED because I hit something with BurnContact on it. Do I have LynnBoost_StatusTransfer?
THEN
CallFunction("StatusTransfer")
ENDIF
EVENT RollingCleanseWhenDebuffed
ON
OnCharacterStatus(__Me, _) // I'm not actually sure this works. OnCharacterStatus requires a CHARACTER and a STATUS, but it should be possible to just use _ to denote any status.
ACTIONS
IF "c1"
CharacterHasStatus(__Me, CONSUME, LynnBoost_StatusTransfer) // I was set to BURNED. Do I have LynnBoost_StatusTransfer?
THEN
CallFunction("StatusTransfer")
ENDIF
EVENT StatusTransfer
ON
OnFunction("StatusTransfer")
ACTIONS
IF "c1&!c2"
CharacterHasStatus(__Me, BURNED) // Do I have burn?
IsEqual(%Cleanser, null)
THEN
CharacterRemoveStatus(__Me, BURNED) // Then remove burned from me
CharacterApplyStatus(%Cleanser, BURNED, 2, 1) // And apply BURNED to _Char for 2 turns and ignore saves/immunities.
ENDIF
// And so on for each buff.
EVENT EndOfTurnCheck
ON
OnTurnEnded()
ACTIONS
IF "c1"
CharacterHasStatus(__Me, CONSUME, LynnBoost_StatusTransfer) // Transfer any remaining debuffs at the end of my turn.
THEN
CallFunction("StatusTransfer")
ELSE
Set(%Cleanser, null) // If I no longer have LynnBoost_StatusTransfer, set %Cleanser to null as it is no longer needed.
ENDIF
I... can't actually check if this works or not as, well, I'm at work but logically, I think it's right.