Skip to content
This repository was archived by the owner on Aug 12, 2024. It is now read-only.
Sam edited this page Sep 22, 2023 · 11 revisions

This page contains every new property and function added to item.lua.

Properties

Weapons and Armors

  • bolt_count: Determines the amount of bolts, or bars, this item adds to a battler's total bolts. Default value is 1 for weapons, 0 for armors. This should always be an integer.
  • bolt_speed: Determines how fast the bolts move, as well as how large the attack box is. Default value is 8 for weapons, 0 for armors. It's recommended to stick to multiples of 8 while changing this, as desynced bolts may become extremely difficult to hit.
  • bolt_offset: Affects the starting position of the first bolt. Default value is 0. Positive values move it right, negative values move it left.
  • critical_bonus: Adds extra points to a party member's attack if they get a crit. Default value is 0.

Weapons Only

  • bolt_accel: Determines the acceleration of every bolt in a battler's lane. Default value is 0. This tends to get fast quickly because of how acceleration works, so lower values (i.e. 0.6) are recommended.
  • bolt_target: Affects the position of the critical box. Default value is 0. Positive values move it right, negative values move it left.
  • bolt_miss_threshold: Determines how far a bolt must be from the crit box to count as a miss. Default value is -5.

Multibolt Weapons Only

  • critical_threshold: Determines the score leniency for a crit. Higher values mean it's harder to get a crit. Default value is 30.
  • multibolt_variance: A table of tables that determines the distance the next bolt spawns from the last. When getMultiboltVariance(index) is called, it picks a value from the table at the specified index, which corresponds to the current bolt. If there are more bolts than entries, the last table is repeated.
  • max_points: In most situations, you should leave this alone. Determines the max points of a multibolt weapon. Default value is critical_threshold * 3.5.

Getters

Weapons and Armors

  • getBoltCount(): returns bolt_count
  • getBoltSpeed(): returns bolt_speed
  • getBoltOffset(): returns bolt_offset
  • getBoltCriticalBonus(): returns critical_bonus

Weapons Only

  • getBoltBoltAcceleration(): returns bolt_accel
  • getBoltTarget(): returns bolt_target
  • getBoltMissThreshold(): returns -5 if nil, bolt_miss_threshold otherwise

Multibolt Weapons Only

  • getCriticalThreshold(): returns critical_threshold
  • getMultiboltVariance(index): If the index is valid, it returns a random entry from multibolt_variance[index]. Otherwise, it returns a random entry from the last entry (multibolt_variance[#multibolt_variance]).
  • getMaxPoints(): returns critical_threshold * 3.5 if nil, max_points otherwise

Callbacks

Functions

All Items

  • onHit(battler, score, bolts, close): Handles what a bolt should do when it's hit. Called for every equip. Must return score.
  • onWeaponMiss(battler, score, bolts, close): Weapons only. Called at the same time as onArmorMiss. Handles what a bolt should do when it's missed. Must return score.
  • onArmorMiss(battler, score, bolts, close): Armors only, empty by default, Called at the same time as onWeaponMiss. Handles what a bolt should do when it's missed. Must return score.
  • onDamage(action, battler, enemy, score, bolts, close): Weapon only. Called when a battler attacks.
  • onBoltBurst(battler, score, bolts, close): Called via onHit. Handles audiovisual effects for a bolt as it bursts and gets removed.

Multibolt Only

  • evaluateHit(battler, close): Called when a bolt is hit. Depending on how close the bolt is to the crit box, a higher score is added. Must return an integer.
  • checkAttackEnd(battler, score, bolts, close): Called via onHit. Checks if all of the bolts in a lane are gone. If they are, evaluateScore is called. Must return score.
  • evaluateScore(battler, score, bolts, close): Called via onAttack. Returns a score based on total points.

Arguments

  • battler: The battler who the AttackBox belongs to.
  • score: The current score of the battler's AttackBox.
  • bolts: A table of all of the bolts an AttackBox has.
  • close: An integer representing how close the bolt furthest to the left is to the crit box, rounded down. For reference, a value of 0 means that it's in the crit zone.

onDamage() Only

  • enemy: The targeted enemy.
  • action: The action of the battler.