mirror of
https://github.com/Azgaar/Fantasy-Map-Generator.git
synced 2026-04-05 06:57:24 +02:00
Fix formatting
This commit is contained in:
parent
ac187b2bbc
commit
85f52e81a6
2 changed files with 18 additions and 20 deletions
|
|
@ -1,5 +1,13 @@
|
||||||
|
import {
|
||||||
|
charges,
|
||||||
|
divisions,
|
||||||
|
lines,
|
||||||
|
ordinaries,
|
||||||
|
positions,
|
||||||
|
shields,
|
||||||
|
tinctures,
|
||||||
|
} from "armoria";
|
||||||
import { P, rw } from "../../utils";
|
import { P, rw } from "../../utils";
|
||||||
import { charges, divisions, lines, ordinaries, positions, shields, tinctures } from "armoria";
|
|
||||||
import { typeMapping } from "./typeMapping";
|
import { typeMapping } from "./typeMapping";
|
||||||
|
|
||||||
declare global {
|
declare global {
|
||||||
|
|
@ -171,13 +179,9 @@ class EmblemGeneratorModule {
|
||||||
!usedPattern && P(0.3)
|
!usedPattern && P(0.3)
|
||||||
? tOrdinary!
|
? tOrdinary!
|
||||||
: this.getTincture("charge", usedTinctures, coa.t1);
|
: this.getTincture("charge", usedTinctures, coa.t1);
|
||||||
} else if (
|
} else if (divisions.data[division]?.positions) {
|
||||||
divisions.data[division]?.positions
|
|
||||||
) {
|
|
||||||
// place charge in fields made by division
|
// place charge in fields made by division
|
||||||
p = rw(
|
p = rw(divisions.data[division].positions);
|
||||||
divisions.data[division].positions,
|
|
||||||
);
|
|
||||||
t = this.getTincture(
|
t = this.getTincture(
|
||||||
"charge",
|
"charge",
|
||||||
tOrdinary ? usedTinctures.concat(tOrdinary) : usedTinctures,
|
tOrdinary ? usedTinctures.concat(tOrdinary) : usedTinctures,
|
||||||
|
|
@ -247,11 +251,7 @@ class EmblemGeneratorModule {
|
||||||
const p2 =
|
const p2 =
|
||||||
p === "e" || P(0.5)
|
p === "e" || P(0.5)
|
||||||
? "e"
|
? "e"
|
||||||
: rw(
|
: rw(divisions.data[division].positions);
|
||||||
divisions.data[
|
|
||||||
division
|
|
||||||
].positions,
|
|
||||||
);
|
|
||||||
const chargeNew = this.selectCharge(charges.single);
|
const chargeNew = this.selectCharge(charges.single);
|
||||||
const tNew = this.getTincture(
|
const tNew = this.getTincture(
|
||||||
"charge",
|
"charge",
|
||||||
|
|
@ -444,7 +444,7 @@ class EmblemGeneratorModule {
|
||||||
|
|
||||||
// Size selection - must use sequential P() calls to match original behavior
|
// Size selection - must use sequential P() calls to match original behavior
|
||||||
if (P(0.1)) size = "-small";
|
if (P(0.1)) size = "-small";
|
||||||
// biome-ignore lint/suspicious/noDuplicateElseIf: <explanation>
|
// biome-ignore lint/suspicious/noDuplicateElseIf: false positive
|
||||||
else if (P(0.1)) size = "-smaller";
|
else if (P(0.1)) size = "-smaller";
|
||||||
else if (P(0.01)) size = "-big";
|
else if (P(0.01)) size = "-big";
|
||||||
else if (P(0.005)) size = "-smallest";
|
else if (P(0.005)) size = "-smallest";
|
||||||
|
|
@ -460,11 +460,11 @@ class EmblemGeneratorModule {
|
||||||
if (P(0.2)) {
|
if (P(0.2)) {
|
||||||
t1 = "gules";
|
t1 = "gules";
|
||||||
t2 = "or";
|
t2 = "or";
|
||||||
// biome-ignore lint/suspicious/noDuplicateElseIf: <explanation>
|
// biome-ignore lint/suspicious/noDuplicateElseIf: false positive
|
||||||
} else if (P(0.2)) {
|
} else if (P(0.2)) {
|
||||||
t1 = "argent";
|
t1 = "argent";
|
||||||
t2 = "sable";
|
t2 = "sable";
|
||||||
// biome-ignore lint/suspicious/noDuplicateElseIf: <explanation>
|
// biome-ignore lint/suspicious/noDuplicateElseIf: false positive
|
||||||
} else if (P(0.2)) {
|
} else if (P(0.2)) {
|
||||||
t1 = "azure";
|
t1 = "azure";
|
||||||
t2 = "argent";
|
t2 = "argent";
|
||||||
|
|
@ -473,7 +473,7 @@ class EmblemGeneratorModule {
|
||||||
if (P(0.3)) {
|
if (P(0.3)) {
|
||||||
t1 = "gules";
|
t1 = "gules";
|
||||||
t2 = "argent";
|
t2 = "argent";
|
||||||
// biome-ignore lint/suspicious/noDuplicateElseIf: <explanation>
|
// biome-ignore lint/suspicious/noDuplicateElseIf: false positive
|
||||||
} else if (P(0.3)) {
|
} else if (P(0.3)) {
|
||||||
t1 = "argent";
|
t1 = "argent";
|
||||||
t2 = "sable";
|
t2 = "sable";
|
||||||
|
|
@ -515,9 +515,7 @@ class EmblemGeneratorModule {
|
||||||
const type = this.getType(t);
|
const type = this.getType(t);
|
||||||
let n: string | null = null;
|
let n: string | null = null;
|
||||||
while (!n || n === t) {
|
while (!n || n === t) {
|
||||||
n = rw(
|
n = rw(tinctures[type] as Record<string, number>);
|
||||||
tinctures[type] as Record<string, number>,
|
|
||||||
);
|
|
||||||
}
|
}
|
||||||
return n;
|
return n;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -42,7 +42,7 @@ interface Emblem {
|
||||||
class EmblemRenderModule {
|
class EmblemRenderModule {
|
||||||
private async draw(id: string, coa: Emblem) {
|
private async draw(id: string, coa: Emblem) {
|
||||||
// insert coa svg to defs
|
// insert coa svg to defs
|
||||||
const svg = await renderCOA({...coa, seed: id}, 200);
|
const svg = await renderCOA({ ...coa, seed: id }, 200);
|
||||||
document.getElementById("coas")!.insertAdjacentHTML("beforeend", svg);
|
document.getElementById("coas")!.insertAdjacentHTML("beforeend", svg);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue