Added some suggestions

This commit is contained in:
Wlowscha 2025-05-31 01:33:28 +02:00
parent 28c04877db
commit c3b303414e
No known key found for this signature in database
GPG Key ID: 3C8F1AD330565D04
2 changed files with 24 additions and 35 deletions

View File

@ -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;
}
}

View File

@ -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) {