Overrides - Gender, Xp multiplier and arena tint (day & night) overrides (#1201)

* added override gender and arena tint (day & night)

* cleaner diff

* reset override

* fix gender override default value

* removed useless return variable

* also null for opponent

* add override tint, gender, xp multiplier

* remove condition duplicated + set overrides initial value to null

* added comments

* eslint

* Update overrides.ts

---------

Co-authored-by: Benjamin Odom <bennybroseph@gmail.com>
This commit is contained in:
Greenlamp2 2024-05-26 18:17:41 +02:00 committed by GitHub
parent bc773f07e3
commit 3120917368
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
4 changed files with 42 additions and 1 deletions

View File

@ -655,6 +655,9 @@ export default class BattleScene extends SceneBase {
species = getPokemonSpecies(Overrides.OPP_SPECIES_OVERRIDE);
}
const pokemon = new EnemyPokemon(this, species, level, trainerSlot, boss, dataSource);
if (Overrides.OPP_GENDER_OVERRIDE !== null) {
pokemon.gender = Overrides.OPP_GENDER_OVERRIDE;
}
overrideModifiers(this, false);
overrideHeldItems(this, pokemon, false);
if (boss && !dataSource) {

View File

@ -455,7 +455,26 @@ export class Arena {
}
}
overrideTint(): [integer, integer, integer] {
switch (Overrides.ARENA_TINT_OVERRIDE) {
case TimeOfDay.DUSK:
return [ 98, 48, 73 ].map(c => Math.round((c + 128) / 2)) as [integer, integer, integer];
break;
case (TimeOfDay.NIGHT):
return [ 64, 64, 64 ];
break;
case TimeOfDay.DAWN:
case TimeOfDay.DAY:
default:
return [ 128, 128, 128 ];
break;
}
}
getDayTint(): [integer, integer, integer] {
if (Overrides.ARENA_TINT_OVERRIDE !== null) {
return this.overrideTint();
}
switch (this.biomeType) {
case Biome.ABYSS:
return [ 64, 64, 64 ];
@ -465,6 +484,9 @@ export class Arena {
}
getDuskTint(): [integer, integer, integer] {
if (Overrides.ARENA_TINT_OVERRIDE) {
return this.overrideTint();
}
if (!this.isOutside()) {
return [ 0, 0, 0 ];
}
@ -476,6 +498,9 @@ export class Arena {
}
getNightTint(): [integer, integer, integer] {
if (Overrides.ARENA_TINT_OVERRIDE) {
return this.overrideTint();
}
switch (this.biomeType) {
case Biome.ABYSS:
case Biome.SPACE:

View File

@ -11,6 +11,8 @@ import { Type } from "./data/type";
import { Stat } from "./data/pokemon-stat";
import { PokeballCounts } from "./battle-scene";
import { PokeballType } from "./data/pokeball";
import {TimeOfDay} from "#app/data/enums/time-of-day";
import {Gender} from "pokenode-ts";
/**
* Overrides for testing different in game situations
@ -27,6 +29,9 @@ export const WEATHER_OVERRIDE: WeatherType = WeatherType.NONE;
export const DOUBLE_BATTLE_OVERRIDE: boolean = false;
export const STARTING_WAVE_OVERRIDE: integer = 0;
export const STARTING_BIOME_OVERRIDE: Biome = Biome.TOWN;
export const ARENA_TINT_OVERRIDE: TimeOfDay = null;
// Multiplies XP gained by this value including 0. Set to null to ignore the override
export const XP_MULTIPLIER_OVERRIDE: number = null;
// default 1000
export const STARTING_MONEY_OVERRIDE: integer = 0;
export const POKEBALL_OVERRIDE: { active: boolean, pokeballs: PokeballCounts } = {
@ -57,6 +62,7 @@ export const STARTING_LEVEL_OVERRIDE: integer = 0;
export const STARTER_SPECIES_OVERRIDE: Species | integer = 0;
export const ABILITY_OVERRIDE: Abilities = Abilities.NONE;
export const PASSIVE_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
export const GENDER_OVERRIDE: Gender = null;
export const MOVESET_OVERRIDE: Array<Moves> = [];
export const SHINY_OVERRIDE: boolean = false;
export const VARIANT_OVERRIDE: Variant = 0;
@ -68,6 +74,7 @@ export const VARIANT_OVERRIDE: Variant = 0;
export const OPP_SPECIES_OVERRIDE: Species | integer = 0;
export const OPP_ABILITY_OVERRIDE: Abilities = Abilities.NONE;
export const OPP_PASSIVE_ABILITY_OVERRIDE = Abilities.NONE;
export const OPP_GENDER_OVERRIDE: Gender = null;
export const OPP_MOVESET_OVERRIDE: Array<Moves> = [];
export const OPP_SHINY_OVERRIDE: boolean = false;
export const OPP_VARIANT_OVERRIDE: Variant = 0;

View File

@ -529,9 +529,12 @@ export class SelectStarterPhase extends Phase {
if (!i && Overrides.STARTER_SPECIES_OVERRIDE) {
starterFormIndex = Overrides.STARTER_FORM_OVERRIDE;
}
const starterGender = starter.species.malePercent !== null
let starterGender = starter.species.malePercent !== null
? !starterProps.female ? Gender.MALE : Gender.FEMALE
: Gender.GENDERLESS;
if (Overrides.GENDER_OVERRIDE !== null) {
starterGender = Overrides.GENDER_OVERRIDE;
}
const starterIvs = this.scene.gameData.dexData[starter.species.speciesId].ivs.slice(0);
const starterPokemon = this.scene.addPlayerPokemon(starter.species, this.scene.gameMode.getStartingLevel(), starter.abilityIndex, starterFormIndex, starterGender, starterProps.shiny, starterProps.variant, starterIvs, starter.nature);
starterPokemon.tryPopulateMoveset(starter.moveset);
@ -3630,6 +3633,9 @@ export class VictoryPhase extends PokemonPhase {
if (partyMember.pokerus) {
expMultiplier *= 1.5;
}
if (Overrides.XP_MULTIPLIER_OVERRIDE !== null) {
expMultiplier = Overrides.XP_MULTIPLIER_OVERRIDE;
}
const pokemonExp = new Utils.NumberHolder(expValue * expMultiplier);
this.scene.applyModifiers(PokemonExpBoosterModifier, true, partyMember, pokemonExp);
partyMemberExp.push(Math.floor(pokemonExp.value));