Hit chance: Difference between revisions

From Cassette Beasts
ExcaliburZero (talk | contribs)
m Change some frac to dfrac and use text for variables to improve readability
Lerycide (talk | contribs)
Rewritten some formulas
Line 3: Line 3:
== General Formulas ==
== General Formulas ==
<!-- Relevant code in global/BattleFormulas.gd and battle/fighter/StatusNode.gd -->
<!-- Relevant code in global/BattleFormulas.gd and battle/fighter/StatusNode.gd -->
If the attacker has the [[Locked On]] status, the hit chance is set to 100%. Otherwise, if the defender has the [[Cottoned On]] status, then the hit chance is set to 0%. When neither [[Status Effects|status effects]] are present, the hit chance is


<math>\text{HitChance} = \begin{cases}
<math>\text{HitChance} = \begin{cases}
\dfrac{\text{MoveAccuracy} + \text{AttackerAccuracy} - 100}{\text{DefenderEvasion}}, & : \text{If AttackerAccuracy greater than 100} \\
\dfrac{\text{MoveAccuracy} + \text{AttackerAccuracy} - 100}{\text{DefenderEvasion}}, & \text{AttackerAccuracy} > 100 \\[1em]
\dfrac{\text{MoveAccuracy} \times \text{AttackerAccuracy}}{100 \times \text{DefenderEvasion}}, & : \text{otherwise}
\dfrac{\text{MoveAccuracy} \times \text{AttackerAccuracy}}{100 \times \text{DefenderEvasion}}, & \text{otherwise}
\end{cases}</math>
\end{cases}</math>
===Accuracy and Evasion===
{{Main|Stat}}
The base values for the accuracy and evasion of tapes and characters are 100, so the formulas can be simplified as such:


If the attacker has the [[Locked On]] status, then the hit chance will be guaranteed to be 100%.
<math>\text{AttackerAccuracy} = 100 \times \prod_{ \text{m} \in \text{stickers} }\left(\frac{\text{AccuracyAttribute}_\text{m} + 100}{100}\right) \times \text{AccuracyStageMultiplier}</math>


If the defender has the [[Cottoned On]] status, then the hit chance will be guaranteed to be 0%.
*<math>\text{AccuracyAttribute}</math> accounts for the ''Passive: +x% Accuracy'' and ''Passive: +% Accuracy per empty slot'' attributes.
*<math>\text{AccuracyStageMultiplier}</math> is the multiplier from all present [[Stat Stages|stat stages]] that affect accuracy.


=== Accuracy and Evasion ===
<math>\text{MoveAccuracy} = \text{BaseMoveAccuracy} \times \prod_{\text{m} \in \text{stickers}} \left( \frac{ \text{MoveAccuracyAttribute}_\text{m} + 100 }{100} \right)</math>
{{IncompleteSection}}
<math>\begin{matrix}
\text{AttackerAccuracy} = & \left( \frac{\text{FormAccuracy} \times \text{CharacterAccuracy}}{100} \times \text{MovesAccuracyMultiplier} \times \text{AccuracyStageMultiplier} \times \text{StatusesAccuracyMultiplier} \right) \\
  & + \text{StatusesAccuracyOffsets} \\
\end{matrix}</math>


<!-- global/BattleFormulas.gd:get_stat_stage_multiplier -->
*<math>\text{MoveAccuracyAttribute}</math> accounts for the ''+x% Move accuracy'' and ''+x% Move accuracy per empty slot'' attributes.
<math>\text{AccuracyStageMultiplier} = \begin{cases}
*If the user has the [[Unitarget]] status, <math>\text{MoveAccuracy}</math> is halved.
\dfrac{4 + \text{AccuracyStage}}{4}, & : \text{If AccuracyStage greater than or equal to 0} \\
*When [[Fog (status effect)|Fog]] is in effect and the move's type is not in the list of exempted moves, <math>\text{MoveAccuracy}</math> is set to 0.
\dfrac{4}{4 - \text{AccuracyStage}}, & : \text{otherwise}
\end{cases}</math>


The formulas for defender evasion are the same as for attacker accuracy, but are based on the defender and evasion.
<math>\text{DefenderEvasion} = 100 \times \prod_{ \text{m} \in \text{stickers} } \left(\frac{\text{EvasionAttribute}_\text{m} + 100}{100} \times \text{EvasionStatModifier} \right) \times \text{EvasionStageMultiplier} \times \text{EvasionStatusMultiplier}</math>


{| class="wikitable"
*<math>\text{EvasionAttribute}</math> accounts for the ''Passive: +x% Evasion'' and ''Passive: +% Evasion per empty slot'' attributes.
|-
*<math display="inline">\text{EvasionStatModifier}</math> uses the multiplier from [[Shear Luck]] if present.
! Stage
*<math>\text{EvasionStageMultiplier}</math> is the multiplier from all present [[Stat Stages|stat stages]] that affect evasion
! Multiplier
*<math>\text{EvasionStatusMultiplier}</math> is a separate multiplier used by certain status effects.
|-
**[[Evasion Nullified]] gives a multiplier of 1/100.<!-- global/BattleFormulas.gd:get_stat_stage_multiplier -->
| 6
| +150 %
|-
| 4
| +100 %
|-
| 2
| +50 %
|-
| 0
| +0 %
|-
| -2
| -33.3 %
|-
| -4
| -66.7 %
|}


==== Accuracy Statuses ====
====Accuracy Statuses====
{{Main|Stat Stages}}
{| class="wikitable"
{| class="wikitable"
|-
|-
! Icon
!Icon
! Name
!Name
! Stages
!Stages
|-
|-
| [[File:Status Accuracy Up.png|42x42px]]
|[[File:Status Accuracy Up.png|42x42px]]
| [[Accuracy Up]]
|[[Accuracy Up]]
| align="center" | +2
| align="center" | +2
|-
|-
| [[File:Status Accuracy Down.png|42x42px]]
|[[File:Status Accuracy Down.png|42x42px]]
| [[Accuracy Down]]
|[[Accuracy Down]]
| align="center" | -2
| align="center" | -2
|-
|-
| [[File:Status Gambit.png|42x42px]]
|[[File:Status Gambit.png|42x42px]]
| [[Gambit (status effect)|Gambit]]
|[[Gambit (status effect)|Gambit]]
| align="center" | +4
| align="center" | +4
|}
|}


==== Evasion Statuses ====
====Evasion Statuses====
{{Main|Stat Stages}}
{| class="wikitable"
{| class="wikitable"
|-
|-
! Icon
!Icon
! Name
!Name
! Stages
!Stages
|-
|-
| [[File:Status Evasion Up.png|42x42px]]
|[[File:Status Evasion Up.png|42x42px]]
| [[Evasion Up]]
|[[Evasion Up]]
| align="center" | +4
| align="center" | +4
|-
|-
| [[File:Status Evasion Down.png|42x42px]]
|[[File:Status Evasion Down.png|42x42px]]
| [[Evasion Down]]
|[[Evasion Down]]
| align="center" | -4
| align="center" | -4
|-
|-
| [[File:Status Evasion Nullified.png|42x42px]]
|[[File:Status Evasion Nullified.png|42x42px]]
| [[Evasion Nullified]]
|[[Evasion Nullified]]
| align="center" | {{tt|*|Multiplies the defender evasion by 1%, accounted for in StatusesEvasionMultiplier}}
| align="center" |{{tt|*|Multiplies the defender evasion by 1%, accounted for in StatusesEvasionMultiplier}}
|}
|}



Revision as of 11:51, 24 January 2024

Hit chance determines the chance that a move will hit.

General Formulas

If the attacker has the Locked On status, the hit chance is set to 100%. Otherwise, if the defender has the Cottoned On status, then the hit chance is set to 0%. When neither status effects are present, the hit chance is

HitChance={MoveAccuracy+AttackerAccuracy−100DefenderEvasion,AttackerAccuracy>100MoveAccuracy×AttackerAccuracy100×DefenderEvasion,otherwise

Accuracy and Evasion

Main article: Stat

The base values for the accuracy and evasion of tapes and characters are 100, so the formulas can be simplified as such:

AttackerAccuracy=100×∏m∈stickers(AccuracyAttributem+100100)×AccuracyStageMultiplier

  • AccuracyAttribute accounts for the Passive: +x% Accuracy and Passive: +% Accuracy per empty slot attributes.
  • AccuracyStageMultiplier is the multiplier from all present stat stages that affect accuracy.

MoveAccuracy=BaseMoveAccuracy×∏m∈stickers(MoveAccuracyAttributem+100100)

  • MoveAccuracyAttribute accounts for the +x% Move accuracy and +x% Move accuracy per empty slot attributes.
  • If the user has the Unitarget status, MoveAccuracy is halved.
  • When Fog is in effect and the move's type is not in the list of exempted moves, MoveAccuracy is set to 0.

DefenderEvasion=100×∏m∈stickers(EvasionAttributem+100100×EvasionStatModifier)×EvasionStageMultiplier×EvasionStatusMultiplier

  • EvasionAttribute accounts for the Passive: +x% Evasion and Passive: +% Evasion per empty slot attributes.
  • EvasionStatModifier uses the multiplier from Shear Luck if present.
  • EvasionStageMultiplier is the multiplier from all present stat stages that affect evasion
  • EvasionStatusMultiplier is a separate multiplier used by certain status effects.

Accuracy Statuses

Main article: Stat Stages
Icon Name Stages
Accuracy Up +2
Accuracy Down -2
Gambit +4

Evasion Statuses

Main article: Stat Stages
Icon Name Stages
Evasion Up +4
Evasion Down -4
Evasion Nullified *


Mechanics
Battle Stats • Moves • Damage • AP • Stat Stages • Hit chance • Critical hits
Physicality • Priority • Types • Status Effects • Fusion • Experience
Recording • Fleeing • Slots • Sticker Attributes
Other Abilities • Bootlegs • Relationships • Weather • Multiplayer • Custom Game