mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-13 03:42:18 +02:00
TSDoc commentation added
This commit is contained in:
parent
7fefaa13da
commit
6000c494a7
@ -1775,18 +1775,29 @@ export class ResetStatsAttr extends MoveEffectAttr {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Attribute used for moves which swap the user and the target's stat changes.
|
||||||
|
*/
|
||||||
export class SwapStatsAttr extends MoveEffectAttr
|
export class SwapStatsAttr extends MoveEffectAttr
|
||||||
{
|
{
|
||||||
|
/**
|
||||||
|
* 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 with this attribute
|
||||||
|
* @param args N/A
|
||||||
|
* @returns true if the function succeeds
|
||||||
|
*/
|
||||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any []): boolean
|
apply(user: Pokemon, target: Pokemon, move: Move, args: any []): boolean
|
||||||
{
|
{
|
||||||
if (!super.apply(user, target, move, args))
|
if (!super.apply(user, target, move, args))
|
||||||
return false;
|
return false; //Exits if the move can't apply
|
||||||
let priorBoostArray : integer[] = [ 0, 0, 0, 0, 0, 0, 0 ];
|
let priorBoostArray : integer[] = [ 0, 0, 0, 0, 0, 0, 0 ]; //For storing user stat boosts
|
||||||
for (let s = 0; s < target.summonData.battleStats.length; s++)
|
for (let s = 0; s < target.summonData.battleStats.length; s++)
|
||||||
{
|
{
|
||||||
priorBoostArray[s] = user.summonData.battleStats[s];
|
priorBoostArray[s] = user.summonData.battleStats[s]; //Store user stat boosts
|
||||||
user.summonData.battleStats[s] = target.summonData.battleStats[s];
|
user.summonData.battleStats[s] = target.summonData.battleStats[s]; //Applies target boosts to self
|
||||||
target.summonData.battleStats[s] = priorBoostArray[s];
|
target.summonData.battleStats[s] = priorBoostArray[s]; //Applies stored boosts to target
|
||||||
}
|
}
|
||||||
target.updateInfo();
|
target.updateInfo();
|
||||||
user.updateInfo();
|
user.updateInfo();
|
||||||
|
Loading…
Reference in New Issue
Block a user