mirror of
https://github.com/pagefaultgames/pokerogue.git
synced 2025-06-30 13:33:01 +02:00
Added some suggestions
This commit is contained in:
parent
28c04877db
commit
c3b303414e
@ -115,7 +115,7 @@ export class HeldItem implements Localizable {
|
||||
if (stackCount >= this.getMaxStackCount()) {
|
||||
text.setTint(0xf89890);
|
||||
}
|
||||
text.setOrigin(0, 0);
|
||||
text.setOrigin(0);
|
||||
|
||||
return text;
|
||||
}
|
||||
@ -206,21 +206,21 @@ export class TurnHealHeldItem extends HeldItem {
|
||||
}
|
||||
|
||||
apply(stackCount: number, pokemon: Pokemon): boolean {
|
||||
if (!pokemon.isFullHp()) {
|
||||
globalScene.unshiftPhase(
|
||||
new PokemonHealPhase(
|
||||
pokemon.getBattlerIndex(),
|
||||
toDmgValue(pokemon.getMaxHp() / 16) * stackCount,
|
||||
i18next.t("modifier:turnHealApply", {
|
||||
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
||||
typeName: this.name,
|
||||
}),
|
||||
true,
|
||||
),
|
||||
);
|
||||
return true;
|
||||
if (pokemon.isFullHp()) {
|
||||
return false;
|
||||
}
|
||||
return false;
|
||||
globalScene.unshiftPhase(
|
||||
new PokemonHealPhase(
|
||||
pokemon.getBattlerIndex(),
|
||||
toDmgValue(pokemon.getMaxHp() / 16) * stackCount,
|
||||
i18next.t("modifier:turnHealApply", {
|
||||
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
|
||||
typeName: this.name,
|
||||
}),
|
||||
true,
|
||||
),
|
||||
);
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
|
@ -1406,6 +1406,7 @@ class AttackTypeBoosterRewardGenerator extends ModifierTypeGenerator {
|
||||
return new AttackTypeBoosterReward(pregenArgs[0] as PokemonType, TYPE_BOOST_ITEM_BOOST_PERCENT);
|
||||
}
|
||||
|
||||
// TODO: make this consider moves or abilities that change types
|
||||
const attackMoveTypes = party.flatMap(p =>
|
||||
p
|
||||
.getMoveset()
|
||||
@ -1420,17 +1421,11 @@ class AttackTypeBoosterRewardGenerator extends ModifierTypeGenerator {
|
||||
const attackMoveTypeWeights = new Map<PokemonType, number>();
|
||||
let totalWeight = 0;
|
||||
for (const t of attackMoveTypes) {
|
||||
if (attackMoveTypeWeights.has(t)) {
|
||||
if (attackMoveTypeWeights.get(t)! < 3) {
|
||||
// attackMoveTypeWeights.has(t) was checked before
|
||||
attackMoveTypeWeights.set(t, attackMoveTypeWeights.get(t)! + 1);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
attackMoveTypeWeights.set(t, 1);
|
||||
const weight = attackMoveTypeWeights.get(t) ?? 0;
|
||||
if (weight < 3) {
|
||||
attackMoveTypeWeights.set(t, weight + 1);
|
||||
totalWeight++;
|
||||
}
|
||||
totalWeight++;
|
||||
}
|
||||
|
||||
if (!totalWeight) {
|
||||
@ -1477,17 +1472,11 @@ class AttackTypeBoosterModifierTypeGenerator extends ModifierTypeGenerator {
|
||||
const attackMoveTypeWeights = new Map<PokemonType, number>();
|
||||
let totalWeight = 0;
|
||||
for (const t of attackMoveTypes) {
|
||||
if (attackMoveTypeWeights.has(t)) {
|
||||
if (attackMoveTypeWeights.get(t)! < 3) {
|
||||
// attackMoveTypeWeights.has(t) was checked before
|
||||
attackMoveTypeWeights.set(t, attackMoveTypeWeights.get(t)! + 1);
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
} else {
|
||||
attackMoveTypeWeights.set(t, 1);
|
||||
const weight = attackMoveTypeWeights.get(t) ?? 0;
|
||||
if (weight < 3) {
|
||||
attackMoveTypeWeights.set(t, weight + 1);
|
||||
totalWeight++;
|
||||
}
|
||||
totalWeight++;
|
||||
}
|
||||
|
||||
if (!totalWeight) {
|
||||
|
Loading…
Reference in New Issue
Block a user