diff --git a/types.ts b/types.ts index fb34140..f72ffd6 100644 --- a/types.ts +++ b/types.ts @@ -115,6 +115,18 @@ export enum Opponents { HouseannorSupport = "HouseannorSupport", } +export enum Hair { + BeginnerSpikes = "Beginner Spikes", + CasualFro = "Casual Fro", + ProCut = "Pro Cut", + SpecialHair = "Special Hair", + SupportShort = "Support Short", + BuilderTails = "Builder Tails", +} + +export enum UpperBottom {} + +export enum UpperTop {} export type GenerateBattlerOptions = { colour: Colour; @@ -127,6 +139,10 @@ export type GenerateBattlerOptions = { neck?: ColouredOpt; glow?: Colour | "None"; eye?: ColouredOpt; + + hair?: ColouredOpt; + upperBottom?: ColouredOpt; + upperTop?: ColouredOpt; }; export enum PlayerActions { diff --git a/utils.ts b/utils.ts index eeeb525..26bc945 100644 --- a/utils.ts +++ b/utils.ts @@ -36,12 +36,36 @@ export async function generateBattler( const base = await loadImage(`./assets/bases/${opts.colour || "Black"}.png`); context.drawImage(base, 0, 0, canvas.width, canvas.height); + // [Upper Bottom] + if (opts.upperBottom && opts.upperBottom !== "None") { + const face = await loadImage(`./assets/upperBottom/${opts.face}.png`); + context.drawImage(face, 0, 0, canvas.width, canvas.height); + } + + // [Bottom] + if (opts.bottom && opts.bottom !== "None") { + const bottom = await loadImage(`./assets/bottoms/${opts.bottom}.png`); + context.drawImage(bottom, 0, 0, canvas.width, canvas.height); + } + + // [Top] + if (opts.top && opts.top !== "None") { + const top = await loadImage(`./assets/tops/${opts.top}.png`); + context.drawImage(top, 0, 0, canvas.width, canvas.height); + } + // [Face] if (opts.face && opts.face !== "None") { const face = await loadImage(`./assets/faces/${opts.face}.png`); context.drawImage(face, 0, 0, canvas.width, canvas.height); } + // [Hair] + if (opts.hair && opts.hair !== "None") { + const face = await loadImage(`./assets/hair/${opts.hair}.png`); + context.drawImage(face, 0, 0, canvas.width, canvas.height); + } + // [Hat] if (opts.hat && opts.hat !== "None") { const hat = await loadImage(`./assets/hats/${opts.hat}.png`); @@ -54,16 +78,10 @@ export async function generateBattler( context.drawImage(eye, 0, 0, canvas.width, canvas.height); } - // [Bottom] - if (opts.bottom && opts.bottom !== "None") { - const bottom = await loadImage(`./assets/bottoms/${opts.bottom}.png`); - context.drawImage(bottom, 0, 0, canvas.width, canvas.height); - } - - // [Top] - if (opts.top && opts.top !== "None") { - const top = await loadImage(`./assets/tops/${opts.top}.png`); - context.drawImage(top, 0, 0, canvas.width, canvas.height); + // [Upper Top] + if (opts.upperTop && opts.upperTop !== "None") { + const eye = await loadImage(`./assets/upperTop/${opts.upperTop}.png`); + context.drawImage(eye, 0, 0, canvas.width, canvas.height); } // [Neck]