updated doccumentation

This commit is contained in:
Benjamin Odom 2024-05-13 21:06:54 -05:00
parent 8a7a5f24d5
commit 84137946fd
3 changed files with 18 additions and 10 deletions

View File

@ -544,6 +544,7 @@ export class AquaRingTag extends BattlerTag {
}
}
/** Tag used to allow moves that interact with {@link Moves.MINIMIZE} to function */
export class MinimizeTag extends BattlerTag {
constructor() {
super(BattlerTagType.MINIMIZED, BattlerTagLapseType.TURN_END, 1, Moves.MINIMIZE, undefined);
@ -1385,7 +1386,7 @@ export function getBattlerTag(tagType: BattlerTagType, turnCount: integer, sourc
case BattlerTagType.MAGNET_RISEN:
return new MagnetRisenTag(tagType, sourceMove);
case BattlerTagType.MINIMIZED:
return new MinimizeTag()
return new MinimizeTag();
case BattlerTagType.NONE:
default:
return new BattlerTag(tagType, BattlerTagLapseType.CUSTOM, turnCount, sourceMove, sourceId);

View File

@ -2374,17 +2374,15 @@ export class ThunderAccuracyAttr extends VariableAccuracyAttr {
/**
* Attribute used for moves which never miss
* against pokemon that used Minimize
* against Pokemon with the {@link BattlerTagType.MINIMIZED}
* @param user N/A
* @param target Target of the move
* @param move N/A
* @param args [0] Accuracy of the move to be modified
* @returns true if the function succeeds
*/
export class MinimizeAccuracyAttr extends VariableAccuracyAttr{
/**
* Swaps the user and the target's stat changes.
* @param user Pokemon that used the move
* @param target The target of the move
* @param move Move that never misses against Minimized targets
* @param args Accuracy of the move being used
* @returns true if the function succeeds
*/
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
if (target.getTag(BattlerTagType.MINIMIZED)){
const accuracy = args[0] as Utils.NumberHolder
@ -3111,8 +3109,11 @@ export class FaintCountdownAttr extends AddBattlerTagAttr {
}
}
/** Attribute used when a move hits a {@link BattlerTagType} for double damage */
export class HitsTagAttr extends MoveAttr {
/** The {@link BattlerTagType} this move hits */
public tagType: BattlerTagType;
/** Should this move deal double damage against {@link HitsTagAttr.tagType}? */
public doubleDamage: boolean;
constructor(tagType: BattlerTagType, doubleDamage?: boolean) {

View File

@ -1550,6 +1550,12 @@ export default abstract class Pokemon extends Phaser.GameObjects.Container {
applyPreAttackAbAttrs(DamageBoostAbAttr, source, this, battlerMove, damage);
/**
* For each {@link HitsTagAttr} the move has, doubles the damage of the move if:
* The target has a {@link BattlerTagType} that this move interacts with
* AND
* The move doubles damage when used against that tag
* */
move.getAttrs(HitsTagAttr).map(hta => hta as HitsTagAttr).filter(hta => hta.doubleDamage).forEach(hta => {
if (this.getTag(hta.tagType))
damage.value *= 2;