Fix attack type boosters applying universally and buff Soul Dew
This commit is contained in:
1 parent
925bb73f0b
commit
e76fa25bc8
7 files changed
+19
-15
No files matched your search
+3
-2
@@ -1,6 +1,7 @@
|
||||
import { Stat, getStatName } from "./pokemon-stat";
|
||||
import * as Utils from "../utils";
|
||||
import { TextStyle, getBBCodeFrag } from "../ui/text";
|
||||
import { UiTheme } from "#app/enums/ui-theme";
|
||||
|
||||
export enum Nature {
|
||||
HARDY,
|
||||
@@ -30,7 +31,7 @@ export enum Nature {
|
||||
QUIRKY
|
||||
}
|
||||
|
||||
export function getNatureName(nature: Nature, includeStatEffects: boolean = false, forStarterSelect: boolean = false, ignoreBBCode: boolean = false): string {
|
||||
export function getNatureName(nature: Nature, includeStatEffects: boolean = false, forStarterSelect: boolean = false, ignoreBBCode: boolean = false, uiTheme: UiTheme = UiTheme.DEFAULT): string {
|
||||
let ret = Utils.toReadableString(Nature[nature]);
|
||||
if (includeStatEffects) {
|
||||
const stats = Utils.getEnumValues(Stat).slice(1);
|
||||
@@ -44,7 +45,7 @@ export function getNatureName(nature: Nature, includeStatEffects: boolean = fals
|
||||
decreasedStat = stat;
|
||||
}
|
||||
const textStyle = forStarterSelect ? TextStyle.SUMMARY_ALT : TextStyle.WINDOW;
|
||||
const getTextFrag = !ignoreBBCode ? getBBCodeFrag : (text: string, style: TextStyle) => text;
|
||||
const getTextFrag = !ignoreBBCode ? (text: string, style: TextStyle) => getBBCodeFrag(text, style, uiTheme) : (text: string, style: TextStyle) => text;
|
||||
if (increasedStat && decreasedStat)
|
||||
ret = `${getTextFrag(`${ret}${!forStarterSelect ? '\n' : ' '}(`, textStyle)}${getTextFrag(`+${getStatName(increasedStat, true)}`, TextStyle.SUMMARY_PINK)}${getTextFrag('/', textStyle)}${getTextFrag(`-${getStatName(decreasedStat, true)}`, TextStyle.SUMMARY_BLUE)}${getTextFrag(')', textStyle)}`;
|
||||
else
|
||||
|
||||
Reference in new issue
Block a user