mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-08-24 00:09:31 +02:00
PR feedback
This commit is contained in:
parent
05b3affe66
commit
03eb2f6394
@ -1935,19 +1935,21 @@ export class IncrementMovePriorityAttr extends MoveAttr {
|
|||||||
* @see {@linkcode apply}
|
* @see {@linkcode apply}
|
||||||
*/
|
*/
|
||||||
export class MultiHitAttr extends MoveAttr {
|
export class MultiHitAttr extends MoveAttr {
|
||||||
private _intrinsicMultiHitType: MultiHitType;
|
/** This move's intrinsic multi-hit type. It should never be modified. */
|
||||||
private _multiHitType: MultiHitType;
|
private intrinsicMultiHitType: MultiHitType;
|
||||||
|
/** This move's current multi-hit type. It may be temporarily modified by abilities (e.g., Battle Bond). */
|
||||||
// Must be publicly readable for battle_bond.test.ts
|
private multiHitType: MultiHitType;
|
||||||
get multiHitType(): MultiHitType {
|
|
||||||
return this._multiHitType;
|
|
||||||
}
|
|
||||||
|
|
||||||
constructor(multiHitType?: MultiHitType) {
|
constructor(multiHitType?: MultiHitType) {
|
||||||
super();
|
super();
|
||||||
|
|
||||||
this._intrinsicMultiHitType = multiHitType !== undefined ? multiHitType : MultiHitType._2_TO_5;
|
this.intrinsicMultiHitType = multiHitType !== undefined ? multiHitType : MultiHitType._2_TO_5;
|
||||||
this._multiHitType = this._intrinsicMultiHitType;
|
this.multiHitType = this.intrinsicMultiHitType;
|
||||||
|
}
|
||||||
|
|
||||||
|
// Currently used by `battle_bond.test.ts`
|
||||||
|
getMultiHitType(): MultiHitType {
|
||||||
|
return this.multiHitType;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@ -1961,9 +1963,9 @@ export class MultiHitAttr extends MoveAttr {
|
|||||||
* @returns True
|
* @returns True
|
||||||
*/
|
*/
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||||
const hitType = new Utils.NumberHolder(this._intrinsicMultiHitType);
|
const hitType = new Utils.NumberHolder(this.intrinsicMultiHitType);
|
||||||
applyMoveAttrs(ChangeMultiHitTypeAttr, user, target, move, hitType);
|
applyMoveAttrs(ChangeMultiHitTypeAttr, user, target, move, hitType);
|
||||||
this._multiHitType = hitType.value;
|
this.multiHitType = hitType.value;
|
||||||
|
|
||||||
(args[0] as Utils.NumberHolder).value = this.getHitCount(user, target);
|
(args[0] as Utils.NumberHolder).value = this.getHitCount(user, target);
|
||||||
return true;
|
return true;
|
||||||
|
Loading…
Reference in New Issue
Block a user