added shadowrun database

This commit is contained in:
2025-06-01 21:19:54 +02:00
parent 71f771b428
commit 69f7f625f8
20 changed files with 738 additions and 103 deletions

View File

@@ -0,0 +1,122 @@
#include <string>
#include <vector>
#include "HtmxShItemList.hpp"
#include "HtmxShAttributeList.hpp"
#include "HtmxShCondition.hpp"
#include "ShadowrunCharacterForm.hpp"
using namespace std;
static const vector<string> cCharacterInfo = {
"Name",
"Metatype",
"Age",
"Sex",
"Nuyen",
"Lifestyle",
"Total Karma",
"Current Karma",
"Street Cred",
"Notoriety",
"Public Awareness"
};
static const vector<string> cAttributes = {
"Body",
"Agility",
"Reaction",
"Strength",
"Charisma",
"Intuition",
"Logic",
"Willpower",
"Edge",
"Essence",
"Initiative"
};
static const vector<string> cSkillParameters = {
"Name",
"RTG.",
"ATT.",
};
static const vector<string> cContactsParameters = {
"Name",
"Loyalty",
};
static const vector<string> cRangedWeaponsParameters = {
"Weapon",
"Damage",
"AP",
"Mode",
"RC",
"Ammo"
};
static const vector<string> cImplantParameters = {
"Implant",
"Rating",
"Essence",
"Notes",
};
static const vector<string> cMeleeWeaponParameters = {
"Weapon",
"Reach",
"Damage",
"AP",
};
static const vector<string> cArmorParamters = {
"Armor",
"Ballistic",
"Impact",
"Notes",
};
ShadowrunCharacterForm::ShadowrunCharacterForm() {
html.reserve(30000);
html += "<form hx-post='/api/shadowrun/submit-character' hx-target='#form-response' hx-swap='innerHTML'>";
html += HtmxShAttributeList("Character Info", cCharacterInfo).htmx();
html += HtmxShAttributeList("Attributes", cAttributes).htmx();
html += "<div style='display: grid; grid-template-columns: 1fr 1fr; gap: 2em;'>";
html += HtmxShItemList("Active Skills", cSkillParameters, 6).htmx();
html += HtmxShItemList("Knowledge Skills", cSkillParameters, 6).htmx();
// add Qualities
html += "<div class='section'>"
"<h2>Qualities</h2>"
"<label>Positive Qualities:"
"<textarea name='positive_qualities' rows='4'></textarea>"
"</label>"
"<label>Negative Qualities:"
"<textarea name='negative_qualities' rows='4'></textarea>"
"</label>"
"</div>";
// add datapack notes
html += "<div class='section'>"
"<h2>Datajack / Commlink / Cyberdeck / Notes</h2>"
"<label>Notes:"
"<textarea name='datapack_notes' rows='6'></textarea>"
"</label>"
"</div>";
html += HtmxShCondition("Physical Condition", 18).htmx();
html += HtmxShCondition("Stun Condition", 12).htmx();
html += HtmxShItemList("Contacts", cContactsParameters, 6).htmx();
html += HtmxShItemList("Ranged Weapons", cRangedWeaponsParameters, 7).htmx();
html += HtmxShItemList("Cyberware and Bioware", cImplantParameters, 7).htmx();
html += HtmxShItemList("Melee Weapons", cMeleeWeaponParameters, 7).htmx();
html += HtmxShItemList("Armor", cArmorParamters , 3).htmx();
html += "</div>";
html += "<div style='text-align:center'>"
"<button type='submit'>Submit</button>"
"</div>"
"</form>";
}