CharakterCreator: Unterschied zwischen den Versionen
Aus Dunkelherzen Wiki
DRP (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
DRP (Diskussion | Beiträge) Keine Bearbeitungszusammenfassung |
||
| (6 dazwischenliegende Versionen desselben Benutzers werden nicht angezeigt) | |||
| Zeile 1: | Zeile 1: | ||
<html> | <html> | ||
<head> | <head> | ||
| Zeile 9: | Zeile 8: | ||
font-family: sans-serif; | font-family: sans-serif; | ||
} | } | ||
.creator-form label { | .creator-form label { | ||
font-weight: bold; | font-weight: bold; | ||
| Zeile 15: | Zeile 13: | ||
margin-top: 10px; | margin-top: 10px; | ||
} | } | ||
.creator-form input, | .creator-form input, | ||
.creator-form select { | .creator-form select { | ||
| Zeile 22: | Zeile 19: | ||
margin-bottom: 10px; | margin-bottom: 10px; | ||
} | } | ||
.creator-form button { | .creator-form button { | ||
margin-top: 15px; | margin-top: 15px; | ||
| Zeile 28: | Zeile 24: | ||
width: 100%; | width: 100%; | ||
} | } | ||
.attribute-inputs { | .attribute-inputs { | ||
display: grid; | display: grid; | ||
| Zeile 34: | Zeile 29: | ||
gap: 10px; | gap: 10px; | ||
} | } | ||
.output { | .output { | ||
margin-top: 20px; | margin-top: 20px; | ||
| Zeile 42: | Zeile 36: | ||
white-space: pre-wrap; | white-space: pre-wrap; | ||
} | } | ||
.points-remaining { | .points-remaining { | ||
font-weight: bold; | font-weight: bold; | ||
| Zeile 67: | Zeile 60: | ||
<option value="Xeutano">Xeutano</option> | <option value="Xeutano">Xeutano</option> | ||
<option value="Androidenartige">Androidenartige</option> | <option value="Androidenartige">Androidenartige</option> | ||
<option value="Androidenartige">Androiden</option> | |||
</select> | </select> | ||
<label for="rasse"> | <label for="rasse">Spezies:</label> | ||
<select id="rasse"> | <select id="rasse"> | ||
<option value="">Keine</option> | <option value="">Keine</option> | ||
</select> | </select> | ||
| Zeile 149: | Zeile 141: | ||
"Stärke", "Wahrnehmung" | "Stärke", "Wahrnehmung" | ||
]; | ]; | ||
const basisPunkte = 160; | const basisPunkte = 160; | ||
| Zeile 168: | Zeile 159: | ||
const speziestypBoni = Object.fromEntries([ | const speziestypBoni = Object.fromEntries([ | ||
"Humanoid", "Ätherer", "Mensch-Ätherer", "Andere Ätherer", | "Humanoid", "Ätherer", "Mensch-Ätherer", "Andere Ätherer", | ||
"Non-Humanoide / Andere", "Xeutano", "Androidenartige" | "Non-Humanoide / Andere", "Xeutano", "Androidenartige", "Androiden" | ||
].map(name => [name, zeroBoni()])); | ].map(name => [name, zeroBoni()])); | ||
Object.assign(speziestypBoni, { | |||
"Humanoid": { "Agilität": 0, "Ausdauer": 0, "Charisma": 1, "Geschick": 0, "Intelligenz": 0, "Konstitution": 0, "Resistenz": 0, "Stärke": 0, "Wahrnehmung": 0 }, | |||
"Ätherer": { "Agilität": 0, "Ausdauer": 0, "Charisma": 0, "Geschick": 0, "Intelligenz": 1, "Konstitution": 0, "Resistenz": 0, "Stärke": 0, "Wahrnehmung": 0 }, | |||
"Mensch-Ätherer": { "Agilität": 0, "Ausdauer": 0, "Charisma": 0, "Geschick": 0, "Intelligenz": 1, "Konstitution": 0, "Resistenz": 0, "Stärke": 0, "Wahrnehmung": 0 }, | |||
"Andere Ätherer": { "Agilität": 0, "Ausdauer": 0, "Charisma": 0, "Geschick": 0, "Intelligenz": 0, "Konstitution": 1, "Resistenz": 0, "Stärke": 0, "Wahrnehmung": 0 }, | |||
"Andere": { "Agilität": 0, "Ausdauer": 0, "Charisma": 0, "Geschick": 0, "Intelligenz": 0, "Konstitution": 1, "Resistenz": 0, "Stärke": 0, "Wahrnehmung": 0 }, | |||
"Xeutano": { "Agilität": 0, "Ausdauer": 0, "Charisma": 0, "Geschick": 0, "Intelligenz": 0, "Konstitution": 1, "Resistenz": 0, "Stärke": 0, "Wahrnehmung": 0 }, | |||
"Androidenartige": { "Agilität": 0, "Ausdauer": 0, "Charisma": 0, "Geschick": 0, "Intelligenz": 0, "Konstitution": 1, "Resistenz": 0, "Stärke": 0, "Wahrnehmung": 0 }, | |||
"Androiden": { "Agilität": 0, "Ausdauer": 0, "Charisma": 0, "Geschick": 0, "Intelligenz": 0, "Konstitution": 1, "Resistenz": 0, "Stärke": 0, "Wahrnehmung": 0 } | |||
}); | |||
const speziesNachTyp = { | |||
"Humanoid": [ | |||
"Arcadier / Byzantone", "Astroma", "Caesaren", "Fijen", "Floratia", | |||
"Kalani", "Lugier", "Nore", "Pendräa", "Rubinnia", "Sowi", "Varene", "Zarcore" | |||
], | |||
"Ätherer": ["Maggarn", "Sapiée"], | |||
"Mensch-Ätherer": ["Cilina", "Gaimane"], | |||
"Andere Ätherer": ["Matari"], | |||
"Non-Humanoide / Andere": [], | |||
"Xeutano": [], | |||
"Androidenartige": [], | |||
"Androiden": [] | |||
}; | |||
const rassenBoni = { | const rassenBoni = { | ||
| Zeile 181: | Zeile 197: | ||
}; | }; | ||
attributeListe.forEach(attr => { | attributeListe.forEach(attr => { | ||
const input = document.createElement("input"); | const input = document.createElement("input"); | ||
| Zeile 211: | Zeile 226: | ||
if (!document.getElementById("subspezies").value) total += 20; | if (!document.getElementById("subspezies").value) total += 20; | ||
if (!document.getElementById("subklasse").value) total += 15; | if (!document.getElementById("subklasse").value) total += 15; | ||
total -= parseInt(document.getElementById("gegenstaende").value || "0") * 10; | |||
const used = sumUserInput(); | const used = sumUserInput(); | ||
document.getElementById("punkteInfo").textContent = `Verbleibende Punkte: ${total - used} / ${total}`; | |||
document.getElementById("punkteInfo").textContent = `Verbleibende Punkte: ${ | |||
} | } | ||
| Zeile 249: | Zeile 259: | ||
Name: name, | Name: name, | ||
Speziestyp: speziestyp, | Speziestyp: speziestyp, | ||
Spezies: rasse, | |||
Subspezies: subspezies || "Keine (20 Punkte erhalten)", | Subspezies: subspezies || "Keine (20 Punkte erhalten)", | ||
Klasse: klasse, | Klasse: klasse, | ||
| Zeile 277: | Zeile 287: | ||
} | } | ||
document.addEventListener("DOMContentLoaded", | document.getElementById("speziestyp").addEventListener("change", function () { | ||
const typ = this.value; | |||
const rasseSelect = document.getElementById("rasse"); | |||
rasseSelect.innerHTML = '<option value="">Keine</option>'; | |||
if (speziesNachTyp[typ]) { | |||
speziesNachTyp[typ].forEach(spezies => { | |||
const opt = document.createElement("option"); | |||
opt.value = spezies; | |||
opt.textContent = spezies; | |||
rasseSelect.appendChild(opt); | |||
}); | |||
} | |||
updateRemainingPoints(); | |||
}); | |||
document.addEventListener("DOMContentLoaded", () => { | |||
const inputs = document.querySelectorAll("select, input[type='number']"); | const inputs = document.querySelectorAll("select, input[type='number']"); | ||
inputs.forEach(el => { | inputs.forEach(el => { | ||
Aktuelle Version vom 29. Juli 2025, 19:59 Uhr
