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()) { if (stackCount >= this.getMaxStackCount()) {
text.setTint(0xf89890); text.setTint(0xf89890);
} }
text.setOrigin(0, 0); text.setOrigin(0);
return text; return text;
} }
@ -206,21 +206,21 @@ export class TurnHealHeldItem extends HeldItem {
} }
apply(stackCount: number, pokemon: Pokemon): boolean { apply(stackCount: number, pokemon: Pokemon): boolean {
if (!pokemon.isFullHp()) { if (pokemon.isFullHp()) {
globalScene.unshiftPhase( return false;
new PokemonHealPhase(
pokemon.getBattlerIndex(),
toDmgValue(pokemon.getMaxHp() / 16) * stackCount,
i18next.t("modifier:turnHealApply", {
pokemonNameWithAffix: getPokemonNameWithAffix(pokemon),
typeName: this.name,
}),
true,
),
);
return true;
} }
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); 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 => const attackMoveTypes = party.flatMap(p =>
p p
.getMoveset() .getMoveset()
@ -1420,17 +1421,11 @@ class AttackTypeBoosterRewardGenerator extends ModifierTypeGenerator {
const attackMoveTypeWeights = new Map<PokemonType, number>(); const attackMoveTypeWeights = new Map<PokemonType, number>();
let totalWeight = 0; let totalWeight = 0;
for (const t of attackMoveTypes) { for (const t of attackMoveTypes) {
if (attackMoveTypeWeights.has(t)) { const weight = attackMoveTypeWeights.get(t) ?? 0;
if (attackMoveTypeWeights.get(t)! < 3) { if (weight < 3) {
// attackMoveTypeWeights.has(t) was checked before attackMoveTypeWeights.set(t, weight + 1);
attackMoveTypeWeights.set(t, attackMoveTypeWeights.get(t)! + 1); totalWeight++;
} else {
continue;
}
} else {
attackMoveTypeWeights.set(t, 1);
} }
totalWeight++;
} }
if (!totalWeight) { if (!totalWeight) {
@ -1477,17 +1472,11 @@ class AttackTypeBoosterModifierTypeGenerator extends ModifierTypeGenerator {
const attackMoveTypeWeights = new Map<PokemonType, number>(); const attackMoveTypeWeights = new Map<PokemonType, number>();
let totalWeight = 0; let totalWeight = 0;
for (const t of attackMoveTypes) { for (const t of attackMoveTypes) {
if (attackMoveTypeWeights.has(t)) { const weight = attackMoveTypeWeights.get(t) ?? 0;
if (attackMoveTypeWeights.get(t)! < 3) { if (weight < 3) {
// attackMoveTypeWeights.has(t) was checked before attackMoveTypeWeights.set(t, weight + 1);
attackMoveTypeWeights.set(t, attackMoveTypeWeights.get(t)! + 1); totalWeight++;
} else {
continue;
}
} else {
attackMoveTypeWeights.set(t, 1);
} }
totalWeight++;
} }
if (!totalWeight) { if (!totalWeight) {