Compare commits

..

10 Commits

Author SHA1 Message Date
Sirz Benjie
472eb01f8c
Merge 1373e07fcc into 907e3c8208 2025-08-12 21:56:25 +00:00
Sirz Benjie
1373e07fcc
Apply Kev's suggestions from code review
Co-authored-by: NightKev <34855794+DayKev@users.noreply.github.com>
2025-08-12 16:56:23 -05:00
Sirz Benjie
870fafa0bc
Add ribbons for each challenge 2025-08-12 15:24:28 -05:00
Sirz Benjie
e3bf7f7e97
Add tracking for each generational ribbon 2025-08-12 15:24:28 -05:00
Sirz Benjie
3a6b03e975
Replace mass getters with a single method 2025-08-12 15:24:27 -05:00
Sirz Benjie
db74938d56
fix overlapping flag set 2025-08-12 15:24:27 -05:00
Sirz Benjie
59c75e9602
Add tracking for friendship ribbon 2025-08-12 15:24:26 -05:00
Sirz Benjie
4dbfc9cb25
Add ribbon to legacy ui folder 2025-08-12 15:24:26 -05:00
Sirz Benjie
50026fb538
Add tracking for nuzlocke completion 2025-08-12 15:24:25 -05:00
Blitzy
907e3c8208
[Balance] Updates to Twins Trainer Class Pool (#6239)
* Update trainer-config.ts

* Update trainer-config.ts

* Update trainer-config.ts

* Update trainer-config.ts

---------

Co-authored-by: damocleas <damocleas25@gmail.com>
2025-08-12 01:10:35 -04:00
5 changed files with 74 additions and 15 deletions

View File

@ -103,7 +103,7 @@ export const ANTI_VARIANCE_WEIGHT_MODIFIER = 15;
export const FAKE_TITLE_LOGO_CHANCE = 10000;
/**
* The ceiling on friendshp amount that can be reached through the use of rare candies.
* The ceiling on friendship amount that can be reached through the use of rare candies.
* Using rare candies will never increase friendship beyond this value.
*/
export const RARE_CANDY_FRIENDSHIP_CAP = 200;

View File

@ -44,7 +44,7 @@ export abstract class Challenge {
public conditions: ChallengeCondition[];
/**
* The Ribbon awarded on challenge completion, or 0 if the challenge has no ribbon.
* The Ribbon awarded on challenge completion, or 0 if the challenge has no ribbon or is not enabled
*
* @defaultValue 0
*/
@ -434,8 +434,11 @@ type ChallengeCondition = (data: GameData) => boolean;
*/
export class SingleGenerationChallenge extends Challenge {
public override get ribbonAwarded(): RibbonFlag {
return RibbonData.MONO_GEN;
// NOTE: This logic will not work for the eventual mono gen 10 ribbon, as
// as its flag will not be in sequence with the other mono gen ribbons.
return this.value ? ((RibbonData.MONO_GEN_1 << (this.value - 1)) as RibbonFlag) : 0;
}
constructor() {
super(Challenges.SINGLE_GENERATION, 9);
}
@ -703,7 +706,7 @@ export class SingleTypeChallenge extends Challenge {
// `this.value` represents the 1-based index of pokemon type
// `RibbonData.MONO_NORMAL` starts the flag position for the types,
// and we shift it by 1 for the specific type.
return (RibbonData.MONO_NORMAL << (this.value - 1)) as RibbonFlag;
return this.value ? ((RibbonData.MONO_NORMAL << (this.value - 1)) as RibbonFlag) : 0;
}
private static TYPE_OVERRIDES: monotypeOverride[] = [
{ species: SpeciesId.CASTFORM, type: PokemonType.NORMAL, fusion: false },
@ -774,6 +777,9 @@ export class SingleTypeChallenge extends Challenge {
* Implements a fresh start challenge.
*/
export class FreshStartChallenge extends Challenge {
public override get ribbonAwarded(): RibbonFlag {
return this.value ? RibbonData.FRESH_START : 0;
}
constructor() {
super(Challenges.FRESH_START, 2);
}
@ -847,6 +853,9 @@ export class FreshStartChallenge extends Challenge {
* Implements an inverse battle challenge.
*/
export class InverseBattleChallenge extends Challenge {
public override get ribbonAwarded(): RibbonFlag {
return this.value ? RibbonData.INVERSE : 0;
}
constructor() {
super(Challenges.INVERSE_BATTLE, 1);
}
@ -880,6 +889,9 @@ export class InverseBattleChallenge extends Challenge {
* Implements a flip stat challenge.
*/
export class FlipStatChallenge extends Challenge {
public override get ribbonAwarded(): RibbonFlag {
return this.value ? RibbonData.FLIP_STATS : 0;
}
constructor() {
super(Challenges.FLIP_STAT, 1);
}
@ -960,6 +972,9 @@ export class LowerStarterPointsChallenge extends Challenge {
* Implements a No Support challenge
*/
export class LimitedSupportChallenge extends Challenge {
public override get ribbonAwarded(): RibbonFlag {
return this.value ? ((RibbonData.NO_HEAL << (this.value - 1)) as RibbonFlag) : 0;
}
constructor() {
super(Challenges.LIMITED_SUPPORT, 3);
}
@ -992,6 +1007,9 @@ export class LimitedSupportChallenge extends Challenge {
* Implements a Limited Catch challenge
*/
export class LimitedCatchChallenge extends Challenge {
public override get ribbonAwarded(): RibbonFlag {
return this.value ? RibbonData.LIMITED_CATCH : 0;
}
constructor() {
super(Challenges.LIMITED_CATCH, 1);
}
@ -1016,6 +1034,9 @@ export class LimitedCatchChallenge extends Challenge {
* Implements a Permanent Faint challenge
*/
export class HardcoreChallenge extends Challenge {
public override get ribbonAwarded(): RibbonFlag {
return this.value ? RibbonData.HARDCORE : 0;
}
constructor() {
super(Challenges.HARDCORE, 1);
}

View File

@ -1865,27 +1865,43 @@ export const trainerConfigs: TrainerConfigs = {
.setPartyMemberFunc(
0,
getRandomPartyMemberFunc([
SpeciesId.METAPOD,
SpeciesId.LEDYBA,
SpeciesId.CLEFFA,
SpeciesId.WOOPER,
SpeciesId.TEDDIURSA,
SpeciesId.REMORAID,
SpeciesId.HOUNDOUR,
SpeciesId.SILCOON,
SpeciesId.PLUSLE,
SpeciesId.VOLBEAT,
SpeciesId.PACHIRISU,
SpeciesId.SILCOON,
SpeciesId.METAPOD,
SpeciesId.IGGLYBUFF,
SpeciesId.SPINDA,
SpeciesId.BONSLY,
SpeciesId.PETILIL,
SpeciesId.EEVEE,
SpeciesId.SPRITZEE,
SpeciesId.MILCERY,
SpeciesId.PICHU,
]),
)
.setPartyMemberFunc(
1,
getRandomPartyMemberFunc(
[
SpeciesId.KAKUNA,
SpeciesId.SPINARAK,
SpeciesId.IGGLYBUFF,
SpeciesId.PALDEA_WOOPER,
SpeciesId.PHANPY,
SpeciesId.MANTYKE,
SpeciesId.ELECTRIKE,
SpeciesId.CASCOON,
SpeciesId.MINUN,
SpeciesId.ILLUMISE,
SpeciesId.EMOLGA,
SpeciesId.CASCOON,
SpeciesId.KAKUNA,
SpeciesId.CLEFFA,
SpeciesId.SPINDA,
SpeciesId.MIME_JR,
SpeciesId.COTTONEE,
SpeciesId.SWIRLIX,
SpeciesId.FIDOUGH,
SpeciesId.EEVEE,
],
TrainerSlot.TRAINER_PARTNER,

View File

@ -1,5 +1,6 @@
import type { Brander } from "#types/type-helpers";
export type RibbonFlag = number & Brander<"RibbonFlag">;
export type RibbonFlag = (number & Brander<"RibbonFlag">) | 0;
/**
* Class for ribbon data management. Usually constructed via the {@linkcode fromJSON} method.
@ -78,6 +79,27 @@ export class RibbonData {
public static readonly NUZLOCKE = 0x10000000 as RibbonFlag;
/** Ribbon for reaching max friendship */
public static readonly FRIENDSHIP = 0x20000000 as RibbonFlag;
/** Ribbon for winning the flip stats challenge */
public static readonly FLIP_STATS = 0x40000000 as RibbonFlag;
/** Ribbon for winning the inverse challenge */
public static readonly INVERSE = 0x80000000 as RibbonFlag;
/** Ribbon for winning the fresh start challenge */
public static readonly FRESH_START = 0x100000000 as RibbonFlag;
/** Ribbon for winning the hardcore challenge */
public static readonly HARDCORE = 0x200000000 as RibbonFlag;
/** Ribbon for winning the limited catch challenge */
public static readonly LIMITED_CATCH = 0x400000000 as RibbonFlag;
/** Ribbon for winning the limited support challenge set to no heal */
public static readonly NO_HEAL = 0x800000000 as RibbonFlag;
/** Ribbon for winning the limited uspport challenge set to no shop */
public static readonly NO_SHOP = 0x1000000000 as RibbonFlag;
/** Ribbon for winning the limited support challenge set to both*/
public static readonly NO_SUPPORT = 0x2000000000 as RibbonFlag;
// NOTE: max possible ribbon flag is 0x20000000000000 (53 total ribbons)
// Once this is exceeded, bitfield needs to be changed to a bigint or even a uint array
// Note that this has no impact on serialization as it is stored in hex.
//#endregion Ribbons
/** Create a new instance of RibbonData. Generally, {@linkcode fromJSON} is used instead. */

View File

@ -8,7 +8,7 @@ import { isNullOrUndefined } from "#utils/common";
* Award one or more ribbons to a species and its pre-evolutions
*
* @param id - The ID of the species to award ribbons to
* @param ribbons The ribbon(s) to award (use bitwise OR to combine multiple)
* @param ribbons - The ribbon(s) to award (use bitwise OR to combine multiple)
*/
export function awardRibbonsToSpeciesLine(id: SpeciesId, ribbons: RibbonFlag): void {
const dexData = globalScene.gameData.dexData;