mirror of
https://github.com/DaInfLoop/Battler-Generator.git
synced 2024-11-23 22:29:58 +00:00
Add new Battler layout
This commit is contained in:
parent
dd53b46744
commit
7d6fe64cb3
16
types.ts
16
types.ts
|
@ -115,6 +115,18 @@ export enum Opponents {
|
||||||
HouseannorSupport = "HouseannorSupport",
|
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 = {
|
export type GenerateBattlerOptions = {
|
||||||
colour: Colour;
|
colour: Colour;
|
||||||
|
@ -127,6 +139,10 @@ export type GenerateBattlerOptions = {
|
||||||
neck?: ColouredOpt<Necks>;
|
neck?: ColouredOpt<Necks>;
|
||||||
glow?: Colour | "None";
|
glow?: Colour | "None";
|
||||||
eye?: ColouredOpt<Eyes>;
|
eye?: ColouredOpt<Eyes>;
|
||||||
|
|
||||||
|
hair?: ColouredOpt<Hair>;
|
||||||
|
upperBottom?: ColouredOpt<UpperBottom>;
|
||||||
|
upperTop?: ColouredOpt<UpperTop>;
|
||||||
};
|
};
|
||||||
|
|
||||||
export enum PlayerActions {
|
export enum PlayerActions {
|
||||||
|
|
38
utils.ts
38
utils.ts
|
@ -36,12 +36,36 @@ export async function generateBattler(
|
||||||
const base = await loadImage(`./assets/bases/${opts.colour || "Black"}.png`);
|
const base = await loadImage(`./assets/bases/${opts.colour || "Black"}.png`);
|
||||||
context.drawImage(base, 0, 0, canvas.width, canvas.height);
|
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]
|
// [Face]
|
||||||
if (opts.face && opts.face !== "None") {
|
if (opts.face && opts.face !== "None") {
|
||||||
const face = await loadImage(`./assets/faces/${opts.face}.png`);
|
const face = await loadImage(`./assets/faces/${opts.face}.png`);
|
||||||
context.drawImage(face, 0, 0, canvas.width, canvas.height);
|
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]
|
// [Hat]
|
||||||
if (opts.hat && opts.hat !== "None") {
|
if (opts.hat && opts.hat !== "None") {
|
||||||
const hat = await loadImage(`./assets/hats/${opts.hat}.png`);
|
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);
|
context.drawImage(eye, 0, 0, canvas.width, canvas.height);
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Bottom]
|
// [Upper Top]
|
||||||
if (opts.bottom && opts.bottom !== "None") {
|
if (opts.upperTop && opts.upperTop !== "None") {
|
||||||
const bottom = await loadImage(`./assets/bottoms/${opts.bottom}.png`);
|
const eye = await loadImage(`./assets/upperTop/${opts.upperTop}.png`);
|
||||||
context.drawImage(bottom, 0, 0, canvas.width, canvas.height);
|
context.drawImage(eye, 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);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
// [Neck]
|
// [Neck]
|
||||||
|
|
Loading…
Reference in a new issue