Add various money-related modifiers

Add various money-related modifiers; change grip claw to work with all attacks
This commit is contained in:
Flashfyre committed 2023-11-10 21:11:36 -05:00
1 parent 0c3d246b11
commit a113db5e3f
10 files changed
+3317 -3076

No files matched your search

+8 -1
View File
@@ -549,7 +549,7 @@ class EvolutionItemModifierTypeGenerator extends ModifierTypeGenerator {
export class ContactHeldItemTransferChanceModifierType extends PokemonHeldItemModifierType {
constructor(name: string, chancePercent: integer, iconImage?: string, group?: string, soundName?: string) {
super(name, `On contact, there is a ${chancePercent}% chance the foe's held item will be stolen`, (type, args) => new Modifiers.ContactHeldItemTransferChanceModifier(type, (args[0] as Pokemon).id, chancePercent), iconImage, group, soundName);
super(name, `Upon attacking, there is a ${chancePercent}% chance the foe's held item will be stolen`, (type, args) => new Modifiers.AttackHeldItemTransferChanceModifier(type, (args[0] as Pokemon).id, chancePercent), iconImage, group, soundName);
}
}
@@ -680,6 +680,10 @@ export const modifierTypes = {
LUCKY_EGG: () => new PokemonExpBoosterModifierType('Lucky Egg', 50),
GOLDEN_EGG: () => new PokemonExpBoosterModifierType('Golden Egg', 150),
AMULET_COIN: () => new ModifierType('Amulet Coin', 'Increases money rewards by 20%', (type, _args) => new Modifiers.MoneyMultiplierModifier(type)),
GOLDEN_PUNCH: () => new PokemonHeldItemModifierType('Golden Punch', 'Grants 20% of damage inflicted as money', (type, args) => new Modifiers.DamageMoneyRewardModifier(type, (args[0] as Pokemon).id)),
COIN_CASE: () => new ModifierType('Coin Case', 'After every 10th battle, receive money equivalent to 20% of your money', (type, _args) => new Modifiers.MoneyInterestModifier(type)),
GRIP_CLAW: () => new ContactHeldItemTransferChanceModifierType('Grip Claw', 10),
HEALING_CHARM: () => new ModifierType('Healing Charm', 'Increases the effectiveness of HP restoring moves and items by 100% (excludes revives)',
@@ -791,6 +795,7 @@ const modifierPool = {
new WeightedModifierType(modifierTypes.MAP, (party: Pokemon[]) => party[0].scene.gameMode === GameMode.CLASSIC ? 1 : 0),
new WeightedModifierType(modifierTypes.TM_GREAT, 2),
new WeightedModifierType(modifierTypes.EXP_SHARE, 1),
new WeightedModifierType(modifierTypes.AMULET_COIN, 1),
new WeightedModifierType(modifierTypes.BASE_STAT_BOOSTER, 3),
new WeightedModifierType(modifierTypes.REVERSE_DNA_SPLICERS, (party: Pokemon[]) => party[0].scene.gameMode === GameMode.SPLICED_ENDLESS && party.filter(p => p.fusionSpecies).length ? 4 : 0),
].map(m => { m.setTier(ModifierTier.GREAT); return m; }),
@@ -802,6 +807,7 @@ const modifierPool = {
new WeightedModifierType(modifierTypes.MEMORY_MUSHROOM, (party: Pokemon[]) => party.filter(p => p.getLearnableLevelMoves().length).length ? 4 : 0),
new WeightedModifierType(modifierTypes.REVIVER_SEED, 3),
new WeightedModifierType(modifierTypes.CANDY_JAR, 3),
new WeightedModifierType(modifierTypes.GOLDEN_PUNCH, 2),
new WeightedModifierType(modifierTypes.GRIP_CLAW, 2),
new WeightedModifierType(modifierTypes.HEALING_CHARM, 1),
new WeightedModifierType(modifierTypes.BATON, 1),
@@ -814,6 +820,7 @@ const modifierPool = {
new WeightedModifierType(modifierTypes.OVAL_CHARM, 2),
new WeightedModifierType(modifierTypes.ABILITY_CHARM, 2),
new WeightedModifierType(modifierTypes.EXP_BALANCE, 1),
new WeightedModifierType(modifierTypes.COIN_CASE, 1),
new WeightedModifierType(modifierTypes.REVERSE_DNA_SPLICERS, (party: Pokemon[]) => party[0].scene.gameMode !== GameMode.SPLICED_ENDLESS && party.filter(p => p.fusionSpecies).length ? 3 : 0),
new WeightedModifierType(modifierTypes.DNA_SPLICERS, (party: Pokemon[]) => party[0].scene.gameMode === GameMode.SPLICED_ENDLESS && party.filter(p => !p.fusionSpecies).length > 1 ? 6 : 0),
].map(m => { m.setTier(ModifierTier.ULTRA); return m; }),
+95 -14
View File
@@ -464,7 +464,7 @@ export class AttackTypeBoosterModifier extends PokemonHeldItemModifier {
this.boostMultiplier = boostPercent * 0.01;
}
matchType(modifier: Modifier) {
matchType(modifier: Modifier): boolean {
if (modifier instanceof AttackTypeBoosterModifier) {
const attackTypeBoosterModifier = modifier as AttackTypeBoosterModifier;
return attackTypeBoosterModifier.moveType === this.moveType && attackTypeBoosterModifier.boostMultiplier === this.boostMultiplier;
@@ -495,7 +495,7 @@ export class SurviveDamageModifier extends PokemonHeldItemModifier {
super(type, pokemonId, stackCount);
}
matchType(modifier: Modifier) {
matchType(modifier: Modifier): boolean {
return modifier instanceof SurviveDamageModifier;
}
@@ -1093,14 +1093,14 @@ export class ExpShareModifier extends PersistentModifier {
return modifier instanceof ExpShareModifier;
}
apply(_args: any[]): boolean {
return true;
}
clone(): ExpShareModifier {
return new ExpShareModifier(this.type, this.stackCount);
}
apply(_args: any[]): boolean {
return true;
}
getMaxStackCount(): integer {
return 5;
}
@@ -1115,19 +1115,100 @@ export class ExpBalanceModifier extends PersistentModifier {
return modifier instanceof ExpBalanceModifier;
}
apply(_args: any[]): boolean {
return true;
}
clone(): ExpBalanceModifier {
return new ExpBalanceModifier(this.type, this.stackCount);
}
apply(_args: any[]): boolean {
return true;
}
getMaxStackCount(): integer {
return 1;
}
}
export class MoneyMultiplierModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount);
}
match(modifier: Modifier): boolean {
return modifier instanceof MoneyMultiplierModifier;
}
clone(): MoneyMultiplierModifier {
return new MoneyMultiplierModifier(this.type, this.stackCount);
}
apply(args: any[]): boolean {
(args[0] as Utils.IntegerHolder).value += Math.floor((args[0] as Utils.IntegerHolder).value * 0.2 * this.getStackCount());
return true;
}
getMaxStackCount(): integer {
return 5;
}
}
export class DamageMoneyRewardModifier extends PokemonHeldItemModifier {
constructor(type: ModifierType, pokemonId: integer, stackCount?: integer) {
super(type, pokemonId, stackCount);
}
matchType(modifier: Modifier): boolean {
return modifier instanceof DamageMoneyRewardModifier;
}
clone(): DamageMoneyRewardModifier {
return new DamageMoneyRewardModifier(this.type, this.pokemonId, this.stackCount);
}
apply(args: any[]): boolean {
const scene = (args[0] as Pokemon).scene;
const moneyAmount = new Utils.IntegerHolder(Math.floor((args[1] as Utils.IntegerHolder).value * (0.2 * this.getStackCount())));
scene.applyModifiers(MoneyMultiplierModifier, true, moneyAmount);
scene.money += moneyAmount.value;
scene.updateMoneyText();
return true;
}
getMaxStackCount(): integer {
return 5;
}
}
export class MoneyInterestModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount);
}
match(modifier: Modifier): boolean {
return modifier instanceof MoneyInterestModifier;
}
apply(args: any[]): boolean {
const scene = args[0] as BattleScene;
const interestAmount = Math.floor(scene.money * 0.2 * this.getStackCount());
scene.money += interestAmount;
scene.updateMoneyText();
scene.queueMessage(`You received interest of ₽${interestAmount.toLocaleString('en-US')}\nfrom the ${this.type.name}!`, null, true);
return true;
}
clone(): MoneyInterestModifier {
return new MoneyInterestModifier(this.type, this.stackCount);
}
getMaxStackCount(): integer {
return 5;
}
}
export class HiddenAbilityRateBoosterModifier extends PersistentModifier {
constructor(type: ModifierType, stackCount?: integer) {
super(type, stackCount);
@@ -1274,7 +1355,7 @@ export class TurnHeldItemTransferModifier extends HeldItemTransferModifier {
}
}
export class ContactHeldItemTransferChanceModifier extends HeldItemTransferModifier {
export class AttackHeldItemTransferChanceModifier extends HeldItemTransferModifier {
private chance: number;
constructor(type: ModifierType, pokemonId: integer, chancePercent: number, stackCount?: integer) {
@@ -1284,11 +1365,11 @@ export class ContactHeldItemTransferChanceModifier extends HeldItemTransferModif
}
matchType(modifier: Modifier): boolean {
return modifier instanceof ContactHeldItemTransferChanceModifier;
return modifier instanceof AttackHeldItemTransferChanceModifier;
}
clone(): ContactHeldItemTransferChanceModifier {
return new ContactHeldItemTransferChanceModifier(this.type, this.pokemonId, this.chance * 100, this.stackCount);
clone(): AttackHeldItemTransferChanceModifier {
return new AttackHeldItemTransferChanceModifier(this.type, this.pokemonId, this.chance * 100, this.stackCount);
}
getArgs(): any[] {