mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-07-05 16:02:20 +02:00
switched to randSeedItem
This commit is contained in:
parent
e65ec66565
commit
ee99d0a323
@ -1011,20 +1011,14 @@ export class StatusEffectAttr extends MoveEffectAttr {
|
||||
|
||||
export class MultiStatusEffectAttr extends StatusEffectAttr {
|
||||
public effects: StatusEffect[];
|
||||
public cureTurn: integer;
|
||||
public overrideStatus: boolean;
|
||||
|
||||
constructor(effects: StatusEffect[], selfTarget?: boolean, cureTurn?: integer, overrideStatus?: boolean) {
|
||||
super(effects[0], selfTarget, cureTurn, overrideStatus);
|
||||
|
||||
this.effects = effects;
|
||||
this.cureTurn = cureTurn;
|
||||
this.overrideStatus = !!overrideStatus;
|
||||
}
|
||||
|
||||
apply(user: Pokemon, target: Pokemon, move: Move, args: any[]): boolean {
|
||||
const statusIndex = Math.floor((Utils.randSeedInt(100)*this.effects.length-1)/100)
|
||||
this.effect = this.effects[statusIndex] as StatusEffect;
|
||||
this.effect = Utils.randSeedItem(this.effects);
|
||||
const result = super.apply(user, target, move, args);
|
||||
return result;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user