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,7 +206,9 @@ export class TurnHealHeldItem extends HeldItem {
} }
apply(stackCount: number, pokemon: Pokemon): boolean { apply(stackCount: number, pokemon: Pokemon): boolean {
if (!pokemon.isFullHp()) { if (pokemon.isFullHp()) {
return false;
}
globalScene.unshiftPhase( globalScene.unshiftPhase(
new PokemonHealPhase( new PokemonHealPhase(
pokemon.getBattlerIndex(), pokemon.getBattlerIndex(),
@ -220,8 +222,6 @@ export class TurnHealHeldItem extends HeldItem {
); );
return true; return true;
} }
return false;
}
} }
export function applyTurnHealHeldItem(pokemon: Pokemon) { export function applyTurnHealHeldItem(pokemon: Pokemon) {

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,18 +1421,12 @@ 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);
} else {
continue;
}
} else {
attackMoveTypeWeights.set(t, 1);
}
totalWeight++; totalWeight++;
} }
}
if (!totalWeight) { if (!totalWeight) {
return null; return null;
@ -1477,18 +1472,12 @@ 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);
} else {
continue;
}
} else {
attackMoveTypeWeights.set(t, 1);
}
totalWeight++; totalWeight++;
} }
}
if (!totalWeight) { if (!totalWeight) {
return null; return null;