Items¶
Items data are split in 2 TextAssets in the game loaded on boot by SetVariables:
Ressources/data/ItemDataItemsfrom the corresponding dialogue directory of the current languageid
itemdata¶
The asset contains one line per Item whose id corresponds to the line index. Each line contains fields separated by @:
| Loaded index | Name | Type | Description |
|---|---|---|---|
| 4 | Value | int | The buying price of the item in berries (the selling price is half of it) |
| 5 | Effects | ; separated list of ItemUse |
The list of effects this item has (see below for details) |
| 6 | Target | AttackArea | The target this item can be used on |
The data will be loaded into itemdata[0, id, x] where id is the Item id and x is the loaded index. It should be noted that the id dimension of the array is overprovisioned to exactly 256 elements, this is hardcoded. The first dimension is hardcoded to only have one element, this is also hardcoded.
The attack area must be specified as a string or int representation of an AttackArea enum value. Here are the valid values, anything else is considered invalid:
| Value | Name |
|---|---|
| 0 | SingleEnemy |
| 1 | AllEnemy |
| 2 | SingleAlly |
| 3 | AllParty |
| 4 | All |
| 5 | None |
| 6 | User |
An ItemUse is defined by 2 fields separated by ,:
| Name | Type | Description |
|---|---|---|
| usetype | ItemUsage | The effect the item has |
| value | int | A value that influences the usetype (usually amount or amount of turns) |
The usetype must be specified as a string or int representation of an ItemUsage enum value. Here are the valid values, anything else is considered invalid:
| Value | Name |
|---|---|
| 0 | None |
| 1 | HPRecover |
| 2 | TPRecover |
| 3 | HPRecoverAll |
| 4 | HPRecoverFull |
| 5 | TPRecoverFull |
| 6 | HPUP |
| 7 | TPUP |
| 8 | AttackUp |
| 9 | DefenseUp |
| 10 | Battle |
| 11 | Revive |
| 12 | ReviveAll |
| 13 | AutoRevive |
| 14 | CurePoison |
| 15 | CureFreeze |
| 16 | CureNumb |
| 17 | CureSleep |
| 18 | CureParty |
| 19 | AddPoison |
| 20 | AddSleep |
| 21 | AddNumb |
| 22 | AddFreeze |
| 23 | HPto1 |
| 24 | TPto1 |
| 25 | HPto1All |
| 26 | GradualHP |
| 27 | GradualTP |
| 28 | GradualHPParty |
| 29 | DefUpStat |
| 30 | AtkUpStat |
| 31 | Sturdy |
| 32 | HPUPAll |
| 33 | MPUP |
| 34 | ChargeUp |
| 35 | AtkDownAfter |
| 36 | CureFire |
| 37 | CureAll |
| 38 | TurnNextTurn |
| 39 | HPorDamage |
| 40 | CurePoisonAll |
DoItemEffect¶
The ItemUse effects are applied in a static method on MainManager called DoItemEffect which applies no matter how the items was used (out or in battle). There are extra logic in battle managed by UseItem.
public static int DoItemEffect(ItemUsage type, int value, int? characterid)
The type and value comes from the ItemUse and the characterid is the playerdata index that is using the item. While the characterid is nullable, in practice, null is never sent and sending it leads to an exception being thrown the vast majority of the time.
Once the effect is applied, if battle is not null (a battle is in progress), UpdateConditionIcons is called on it which calls UpdateConditionBubbles on all battleentity (all playerdata with right to false and all enemydata with hp above 0 with right to true). Finally, the method returns the final value (which may be changed by the effects).
Here's all the ItemUsage's effects from this method:
HPRecover or Revive¶
- The
Healsound is played - If we are instance.
inbattle, value is incremented by the amount ofHealPlusmedal equipped onlastitemuser - The
hpof the characterid player party member is increased by value then clamped from 0 to itsmaxhp - If we are instance.
inbattleand theWeakStomachmedal is equipped on the characterid player party member, anAddPoisoneffect is processed with the current value and characterid. The only difference is ifEternalPoisonisn's equipped, the amount of turn to apply the Poison condition is always 3
HPorDamage¶
- If
battleis null (no battle is in progress):- value is incremented by the amount of
HealPlusmedal equipped onlastitemuser - An RNG check is performed with 2 possible outcomes at 59% and 41% respectively:
- 59%: The
Healsound is played followed by thehpof the characterid player party member being increased by value then clamped from 0 to itsmaxhp - 41%: The
Damage0sound is played followed by thehpof the characterid player party member being decreased by value then clamped from 1 to itsmaxhp
- 59%: The
- value is incremented by the amount of
- If we are instance.
inbattleand theWeakStomachmedal is equipped on the characterid player party member, anAddPoisoneffect is processed with the current value and characterid. The only difference is ifEternalPoisonisn's equipped, the amount of turn to apply the Poison condition is always 3
HPRecoverAll¶
- The
Healsound is played - If we are instance.
inbattle, value is incremented by the amount ofHealPlusmedal equipped onlastitemuser - For each player party member that isn't
eatenbywith anhpabove 0:- The
hpof the player party member is increased by value then clamped from 0 to itsmaxhp - If we are instance.
inbattleand theWeakStomachmedal is equipped on the player party member, anAddPoisoneffect is processed with the corresponding characterid being the player party member's. The only difference is ifEternalPoisonisn's equipped, the amount of turn to apply the Poison condition is always 3
- The
ReviveAll¶
The same then HPRecoverAll, but the player party members don't need an hp above 0 for the effects to apply.
TPRecover¶
- The
Heal2sound is played - instance.
tpis increased by value then clamped from 0 to instance.maxtp - If we are instance.
inbattleand theWeakStomachmedal is equipped on the characterid player party member, anAddPoisoneffect is processed with the current value and characterid. The only difference is ifEternalPoisonisn's equipped, the amount of turn to apply the Poison condition is always 3
TurnNextTurn¶
- The
Heal3sound is played - If we are instance.
inbattle, themoreturnnextturnof the characterid player party member is incremented
HPUP¶
- The
StatUpsound is played - An
HPstat bonus with the amount being the value is added to the characterid player party member (learn more here) - ApplyStatBonus is called
TPUP¶
- The
StatUpsound is played - An
TPstat bonus with the amount being the value is added to the party (learn more here) - ApplyStatBonus is called
HPUPAll¶
- The
StatUpsound is played - An
HPstat bonus with the amount being the value is added to the party (learn more here) - ApplyStatBonus is called
AttackUp¶
- The
StatUpsound is played - An
Attackstat bonus with the amount being the value is added to the characterid player party member (learn more here) - ApplyStatBonus is called
- If we are instance.
inbattleand theWeakStomachmedal is equipped on the characterid player party member, anAddPoisoneffect is processed with the current value and characterid. The only difference is ifEternalPoisonisn's equipped, the amount of turn to apply the Poison condition is always 3
AtkDownAfter¶
The atkdownonloseatkup of the characterid player party member is set to true
ChargeUp¶
- The
chargeof the characterid player party member is incremented then clamped from 0 to 3 - If we are instance.
inbattleand theWeakStomachmedal is equipped on the characterid player party member, anAddPoisoneffect is processed with the current value and characterid. The only difference is ifEternalPoisonisn's equipped, the amount of turn to apply the Poison condition is always 3
DefenseUp¶
- The
StatUpsound is played - An
Defensestat bonus with the amount being the value is added to the characterid player party member (learn more here) - ApplyStatBonus is called
- If we are instance.
inbattleand theWeakStomachmedal is equipped on the characterid player party member, anAddPoisoneffect is processed with the current value and characterid. The only difference is ifEternalPoisonisn's equipped, the amount of turn to apply the Poison condition is always 3
AddPoison¶
This effect only applies if we are instance.inbattle and the characterid player party member doesn't have the Sturdy condition
- The
Poisonsound is played - If the characterid player party member doesn't have any
PoisonResistanceorResistAllmedals equipped:- SetCondition is called with the Poison condition on the characterid player party member for value amount of turns. The amount is overriden to 9999999 if the characterid player party member has an
EternalPoisonmedals equipped and if not, it is increased by 1 if it has theWeakStomachmedal equipped
- SetCondition is called with the Poison condition on the characterid player party member for value amount of turns. The amount is overriden to 9999999 if the characterid player party member has an
AddNumb¶
This effect only applies if we are instance.inbattle and the characterid player party member doesn't have the Sturdy condition
- The
Shocksound is played - If the characterid player party member doesn't have any
NumbResisorResistAllmedals equipped:- SetCondition is called with the Numb condition on the characterid player party member for value amount of turns
AddFreeze¶
This effect only applies if we are instance.inbattle and the characterid player party member doesn't have the Sturdy condition
- The
Freezesound is played - If the characterid player party member doesn't have any
FreezeResistanceorResistAllmedals equipped:- SetCondition is called with the Freeze condition on the characterid player party member for value amount of turns
AddSleep¶
This effect only applies if we are instance.inbattle and the characterid player party member doesn't have the Sturdy condition
- The
Sleepsound is played - If the characterid player party member doesn't have any
SleepyResistanceorResistAllmedals equipped:- SetCondition is called with the Sleep condition on the characterid player party member for value amount of turns
CureFire¶
- The
Heal3sound is played - RemoveCondition is called on the characterid player party member to remove the Fire condition
- If we are instance.
inbattleand the characterid player party member'sfirepartisn't null, it is destroyed
CureAll¶
- The
Heal3sound is played - A bunch of RemoveCondition calls happens in sucession on the characterid player party member to remove the following condition:
- If we are instance.
inbattle, the following happens on the characterid player party member:- If
firepartisn't null, it is destroyed - BreakIce is called on the battleentity
isasleepis set to falseisnumbis set to false
- If
CurePoisonAll¶
- The
Heal3sound is played - RemoveCondition is called on each of the player party members to remove the Poison condition
CurePoison¶
- The
Heal3sound is played - RemoveCondition is called on the characterid player party member to remove the Poison condition
CureSleep¶
- The
Heal3sound is played - The characterid player party member's
isasleepis set to false - RemoveCondition is called on the characterid player party member to remove the Sleep
CureFreeze¶
- The
Heal3sound is played - RemoveCondition is called on the characterid player party member to remove the Freeze
- If we are instance.
inbattle, BreakIce is called on the battleentity of the characterid player party member
CureNumb¶
- The
Heal3sound is played - The characterid player party member's
isnumbis set to false - RemoveCondition is called on the characterid player party member to remove the Numb
CureParty¶
- The
Heal3sound is played - A bunch of RemoveCondition calls happens in sucession on each of the player party members that isn't
eatenbywith anhpabove 0 to remove the following condition: - If we are instance.
inbattle, the following happens on each of the player party members:- If
firepartisn't null, it is destroyed - BreakIce is called on the battleentity
isasleepis set to falseisnumbis set to false
- If
HPto1¶
- If we aren't instance.
inbattle, theDamage0sound is played - The
hpof the characterid player party member is set to 1
GradualHP¶
- If we are instance.
inbattle- The
Heal3sound is played - SetCondition is called to apply the GradualHP condition on the characterid player party member for value amount of turn
- If the
WeakStomachmedal is equipped on the characterid player party member, anAddPoisoneffect is processed with the current value and characterid. The only difference is ifEternalPoisonisn's equipped, the amount of turn to apply the Poison condition is always 3
- The
- Otherwise, an
HPRecoveris processed with the same characterid, but the value is doubled
GradualHPParty¶
- If we are instance.
inbattle- The
Heal3sound is played - SetCondition is called to apply the GradualHP condition on each player party members that have an
hpabove 0 for value amount of turn - If the
WeakStomachmedal is equipped on the characterid player party member, anAddPoisoneffect is processed with the current value and characterid. The only difference is ifEternalPoisonisn's equipped, the amount of turn to apply the Poison condition is always 3
- The
- Otherwise, an
HPRecoverAllis processed with the same characterid, but the value is doubled
GradualTP¶
- If we are instance.
inbattle- The
Heal3sound is played - SetCondition is called to apply the GradualTP condition on the characterid player party member for value amount of turn
- If the
WeakStomachmedal is equipped on the characterid player party member, anAddPoisoneffect is processed with the current value and characterid. The only difference is ifEternalPoisonisn's equipped, the amount of turn to apply the Poison condition is always 3
- The
- Otherwise, an
TPRecoveris processed with the same characterid, but the value is doubled
Items data¶
The asset contains one line per Item whose id corresponds to the line index. Each line contains fields separated by @:
| Loaded index | Name | Type | Description |
|---|---|---|---|
| 0 | Name | SetText string | The name of the item |
| 1 | Unused description | SetText string | An unused version of the item's description |
| 2 | Description | SetText string | The description of the item |
| 3 | Prepender | SetText string | The prepender string used with the Anstring command for this item |
The data will be loaded into itemdata[0, id, x] where id is the item id and x is the loaded index.
The unused description is, as its name says, not used in the game. It is safe to leave it empty or a dummy value, but its value must exist for the actual description which needs a valid value.
The prepender is optional: it will not be loaded if it does not exist. which leaves its spot in itemdata as null.