Compare commits

...

2 Commits

Author SHA1 Message Date
YK
9c211d46de remove debug code, fix <input> tag 2025-09-12 10:21:25 +03:00
YK
58879c7463 update entity defs, Name struct, mock data updated 2025-09-12 10:20:59 +03:00
3 changed files with 102 additions and 87 deletions

View File

@ -20,10 +20,6 @@ pub fn Header () -> impl IntoView {
}
});
Effect::new(move |_| {
logging::warn!("{}", campaign.get());
});
view! {
<header>
<Show when=move || !image.get().is_empty()>
@ -33,7 +29,7 @@ pub fn Header () -> impl IntoView {
</Show>
<section>
<h5 class="version">aex v{env!("CARGO_PKG_VERSION")} by mk</h5>
<input id="campaign-name" type="text" class="header-input header-input-1 campaign-name" bind:value=campaign></input>
<input id="campaign-name" type="text" class="header-input header-input-1 campaign-name" bind:value=campaign/>
<div class="game-date">
<h4>{move || format!("{}", date.get().format("%d/%m/%Y"))}</h4>
<button on:click=move |_| adjust_day(-1) title="Предыдущий день" class="adjust" id="date-back">"<"</button>

View File

@ -9,9 +9,11 @@ impl Dashboard {
session: 12,
date: NaiveDate::from_ymd_opt(1488, 3, 19).unwrap(),
player: PlayerData {
first_name: "Абоба".to_owned(),
last_name: "Амогус".to_owned(),
alias: "Такелажник".to_string(),
name: Name {
first: "Абоба".to_string(),
last: "Амогус".to_string(),
alias: "Такелажник".to_string(),
},
class: "Чувствительный молодой человек".to_string(),
image: "https://i.pinimg.com/736x/25/58/32/2558329d333fda61615da6ce50dcddda.jpg".to_owned(),
level: 8,
@ -31,19 +33,7 @@ impl Dashboard {
balance: Balance { platinum: 1312, gold: 3211200, electrum: 231, silver: 1, copper: 21021 },
inventory: generate_mock_inventory(),
},
quest_book: QuestBook(
vec![
Quest { title: "Slay the Bandit Chief".to_string(), location_taken: Some("Waterdeep".to_string()), location_task: Some("Phandalin".to_string()), date_taken: Some(NaiveDate::from_ymd_opt(1481, 4, 15).unwrap()), date_by: Some(NaiveDate::from_ymd_opt(1481, 5, 15).unwrap()), description: Some("Kill the bandit leader.".to_string()), from: Some("Lord Neverember".to_string()), reward: Some(Balance { platinum: 0, gold: 100, electrum: 0, silver: 0, copper: 0 }) },
Quest { title: "Find the Lost Artifact".to_string(), location_taken: Some("Baldur's Gate".to_string()), location_task: None, date_taken: Some(NaiveDate::from_ymd_opt(1481, 6, 1).unwrap()), date_by: None, description: Some("Seek a relic in ruins.".to_string()), from: Some("Elminster".to_string()), reward: Some(Balance { platinum: 10, gold: 50, electrum: 0, silver: 0, copper: 0 }) },
Quest { title: "Escort the Caravan".to_string(), location_taken: Some("Neverwinter".to_string()), location_task: Some("Luskan".to_string()), date_taken: None, date_by: Some(NaiveDate::from_ymd_opt(1481, 7, 30).unwrap()), description: Some("Protect traders.".to_string()), from: None, reward: Some(Balance { platinum: 0, gold: 20, electrum: 0, silver: 50, copper: 0 }) },
Quest { title: "Clear the Goblin Den".to_string(), location_taken: Some("Daggerford".to_string()), location_task: Some("Cragmaw Hideout".to_string()), date_taken: Some(NaiveDate::from_ymd_opt(1481, 3, 10).unwrap()), date_by: Some(NaiveDate::from_ymd_opt(1481, 4, 10).unwrap()), description: None, from: Some("Local Militia".to_string()), reward: Some(Balance { platinum: 0, gold: 30, electrum: 0, silver: 0, copper: 100 }) },
Quest { title: "Rescue the Noble".to_string(), location_taken: None, location_task: Some("Underdark".to_string()), date_taken: Some(NaiveDate::from_ymd_opt(1481, 5, 20).unwrap()), date_by: None, description: Some("Save a kidnapped noble.".to_string()), from: Some("Silverhand Family".to_string()), reward: Some(Balance { platinum: 5, gold: 200, electrum: 0, silver: 0, copper: 0 }) },
Quest { title: "Steal the Zhentarim Plans".to_string(), location_taken: Some("Zhentil Keep".to_string()), location_task: Some("Zhentil Keep".to_string()), date_taken: None, date_by: Some(NaiveDate::from_ymd_opt(1481, 8, 15).unwrap()), description: None, from: Some("Harpers".to_string()), reward: Some(Balance { platinum: 0, gold: 75, electrum: 0, silver: 0, copper: 0 }) },
Quest { title: "Hunt the Dire Wolf".to_string(), location_taken: Some("Silverymoon".to_string()), location_task: Some("Evermoors".to_string()), date_taken: Some(NaiveDate::from_ymd_opt(1481, 2, 5).unwrap()), date_by: None, description: Some("Track and kill a beast.".to_string()), from: None, reward: Some(Balance { platinum: 0, gold: 15, electrum: 0, silver: 20, copper: 50 }) },
Quest { title: "Recover the Spellbook".to_string(), location_taken: Some("Candlekeep".to_string()), location_task: None, date_taken: Some(NaiveDate::from_ymd_opt(1481, 1, 10).unwrap()), date_by: Some(NaiveDate::from_ymd_opt(1481, 2, 10).unwrap()), description: Some("Find a stolen tome.".to_string()), from: Some("Candlekeep Scholars".to_string()), reward: None },
Quest { title: "Guard the Temple".to_string(), location_taken: Some("Suzail".to_string()), location_task: Some("Temple of Lathander".to_string()), date_taken: None, date_by: None, description: Some("Protect the shrine.".to_string()), from: Some("Clerics of Lathander".to_string()), reward: Some(Balance { platinum: 0, gold: 50, electrum: 0, silver: 0, copper: 0 }) },
Quest { title: "Explore the Ruins".to_string(), location_taken: Some("Cormyr".to_string()), location_task: Some("Netherese Ruins".to_string()), date_taken: Some(NaiveDate::from_ymd_opt(1481, 9, 1).unwrap()), date_by: Some(NaiveDate::from_ymd_opt(1481, 10, 1).unwrap()), description: None, from: None, reward: None },
]),
quest_book: generate_mock_questbook(),
notes: generate_mock_notebook(),
people: generate_mock_contact_book(),
}
@ -78,68 +68,9 @@ fn generate_mock_inventory() -> Inventory {
}
fn generate_mock_contact_book() -> ContactBook {
let mut contacts = HashMap::new();
// 40 Characters Met by Party (80%)
contacts.insert("Elminster".to_string(), Contact { name: "Elminster".to_string(), image: None, alias: Some("The Sage of Shadowdale".to_string()), status: Some(ContactStatus::Alive), location: Some("Shadowdale".to_string()), notes: Some("Wise but cryptic wizard.".to_string()) });
contacts.insert("Drizzt Do'Urden".to_string(), Contact { name: "Drizzt Do'Urden".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Icewind Dale".to_string()), notes: Some("Renegade drow ranger.".to_string()) });
contacts.insert("Lord Neverember".to_string(), Contact { name: "Lord Neverember".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Neverwinter".to_string()), notes: Some("Ruler seeking bandit leader.".to_string()) });
contacts.insert("Minsc".to_string(), Contact { name: "Minsc".to_string(), image: None, alias: Some("Rascal of Rashemen".to_string()), status: Some(ContactStatus::Alive), location: Some("Baldur's Gate".to_string()), notes: Some("Loud warrior with hamster.".to_string()) });
contacts.insert("Jarlaxle".to_string(), Contact { name: "Jarlaxle".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Luskan".to_string()), notes: Some("Sly drow mercenary leader.".to_string()) });
contacts.insert("Volo".to_string(), Contact { name: "Volo".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Waterdeep".to_string()), notes: Some("Exaggerates his travel tales.".to_string()) });
contacts.insert("Laeral Silverhand".to_string(), Contact { name: "Laeral Silverhand".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Waterdeep".to_string()), notes: Some("Open Lord, powerful mage.".to_string()) });
contacts.insert("Hammond Ardeep".to_string(), Contact { name: "Hammond Ardeep".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Daggerford".to_string()), notes: Some("Militia leader vs. goblins.".to_string()) });
contacts.insert("Sister Garaele".to_string(), Contact { name: "Sister Garaele".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Harper agent in temple.".to_string()) });
contacts.insert("Gundren Rockseeker".to_string(), Contact { name: "Gundren Rockseeker".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Dwarf seeking lost mine.".to_string()) });
contacts.insert("Sildar Hallwinter".to_string(), Contact { name: "Sildar Hallwinter".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Lord's Alliance knight.".to_string()) });
contacts.insert("Qelline Alderleaf".to_string(), Contact { name: "Qelline Alderleaf".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Halfling farmer, kind.".to_string()) });
contacts.insert("Toblen Stonehill".to_string(), Contact { name: "Toblen Stonehill".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Innkeeper, knows rumors.".to_string()) });
contacts.insert("Darathra Shendrel".to_string(), Contact { name: "Darathra Shendrel".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Triboar".to_string()), notes: Some("Lord Protector, fair.".to_string()) });
contacts.insert("Ziraj the Hunter".to_string(), Contact { name: "Ziraj the Hunter".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Neverwinter Wood".to_string()), notes: Some("Tracks orcs.".to_string()) });
contacts.insert("Eldrin Thalindra".to_string(), Contact { name: "Eldrin Thalindra".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Silverymoon".to_string()), notes: Some("Arcane ward keeper.".to_string()) });
contacts.insert("Randal Morn".to_string(), Contact { name: "Randal Morn".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Daggerdale".to_string()), notes: Some("Fights Zhentarim.".to_string()) });
contacts.insert("Khelben Blackstaff".to_string(), Contact { name: "Khelben Blackstaff".to_string(), image: None, alias: Some("The Blackstaff".to_string()), status: Some(ContactStatus::Dead), location: Some("Waterdeep".to_string()), notes: Some("Former archmage, deceased.".to_string()) });
contacts.insert("Mirt the Moneylender".to_string(), Contact { name: "Mirt the Moneylender".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Waterdeep".to_string()), notes: Some("Harper ally, wealthy.".to_string()) });
contacts.insert("Durnan".to_string(), Contact { name: "Durnan".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Waterdeep".to_string()), notes: Some("Yawning Portal owner.".to_string()) });
contacts.insert("Fzoul Chembryl".to_string(), Contact { name: "Fzoul Chembryl".to_string(), image: None, alias: None, status: Some(ContactStatus::Dead), location: Some("Zhentil Keep".to_string()), notes: Some("Former Zhentarim leader.".to_string()) });
contacts.insert("Bruenor Battlehammer".to_string(), Contact { name: "Bruenor Battlehammer".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Mithral Hall".to_string()), notes: Some("Dwarf king, ally.".to_string()) });
contacts.insert("Catti-brie".to_string(), Contact { name: "Catti-brie".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Mithral Hall".to_string()), notes: Some("Skilled archer.".to_string()) });
contacts.insert("Regis".to_string(), Contact { name: "Regis".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Icewind Dale".to_string()), notes: Some("Halfling, sneaky.".to_string()) });
contacts.insert("Artemis Entreri".to_string(), Contact { name: "Artemis Entreri".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Calimport".to_string()), notes: Some("Dangerous assassin.".to_string()) });
contacts.insert("Storm Silverhand".to_string(), Contact { name: "Storm Silverhand".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Shadowdale".to_string()), notes: Some("Bard and Chosen.".to_string()) });
contacts.insert("Halia Thornton".to_string(), Contact { name: "Halia Thornton".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Zhentarim agent, subtle.".to_string()) });
contacts.insert("Darlia Greystone".to_string(), Contact { name: "Darlia Greystone".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Triboar".to_string()), notes: Some("Blacksmith, reliable.".to_string()) });
contacts.insert("Eldric Varn".to_string(), Contact { name: "Eldric Varn".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Luskan".to_string()), notes: Some("Ship captain, shady.".to_string()) });
contacts.insert("Tymoras Priest".to_string(), Contact { name: "Tymoras Priest".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Suzail".to_string()), notes: Some("Blesses adventurers.".to_string()) });
contacts.insert("Redbrand Leader".to_string(), Contact { name: "Redbrand Leader".to_string(), image: None, alias: Some("Glasstaff".to_string()), status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Runs thug gang.".to_string()) });
contacts.insert("Brynna of Lathander".to_string(), Contact { name: "Brynna of Lathander".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Suzail".to_string()), notes: Some("Temple cleric.".to_string()) });
contacts.insert("Korgul the Tumbler".to_string(), Contact { name: "Korgul the Tumbler".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Baldur's Gate".to_string()), notes: Some("Thieves guild contact.".to_string()) });
contacts.insert("Tharivol the Mage".to_string(), Contact { name: "Tharivol the Mage".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Silverymoon".to_string()), notes: Some("Studies arcane wards.".to_string()) });
contacts.insert("Gorlag the Orc".to_string(), Contact { name: "Gorlag the Orc".to_string(), image: None, alias: None, status: Some(ContactStatus::Dead), location: Some("Neverwinter Wood".to_string()), notes: Some("Slain orc chieftain.".to_string()) });
contacts.insert("Lhara the Merchant".to_string(), Contact { name: "Lhara the Merchant".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Cormyr".to_string()), notes: Some("Sells rare goods.".to_string()) });
contacts.insert("Ebon the Rogue".to_string(), Contact { name: "Ebon the Rogue".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Zhentil Keep".to_string()), notes: Some("Sneaky informant.".to_string()) });
contacts.insert("Father Llymic".to_string(), Contact { name: "Father Llymic".to_string(), image: None, alias: None, status: Some(ContactStatus::Dead), location: Some("Icewind Dale".to_string()), notes: Some("Evil priest, defeated.".to_string()) });
contacts.insert("Sylvara the Druid".to_string(), Contact { name: "Sylvara the Druid".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("High Forest".to_string()), notes: Some("Protects the woods.".to_string()) });
contacts.insert("Raul the Barkeep".to_string(), Contact { name: "Raul the Barkeep".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Daggerford".to_string()), notes: Some("Hears local gossip.".to_string()) });
// 5 Contacts (10%)
contacts.insert("Valthor the Fence".to_string(), Contact { name: "Valthor the Fence".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Baldur's Gate".to_string()), notes: Some("Buys stolen goods.".to_string()) });
contacts.insert("Zyra the Alchemist".to_string(), Contact { name: "Zyra the Alchemist".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Waterdeep".to_string()), notes: Some("Sells potions.".to_string()) });
contacts.insert("Kren the Smuggler".to_string(), Contact { name: "Kren the Smuggler".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Luskan".to_string()), notes: Some("Moves contraband.".to_string()) });
contacts.insert("Mira the Scribe".to_string(), Contact { name: "Mira the Scribe".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Candlekeep".to_string()), notes: Some("Deciphers texts.".to_string()) });
contacts.insert("Thok the Armorer".to_string(), Contact { name: "Thok the Armorer".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: Some("Neverwinter".to_string()), notes: Some("Crafts fine armor.".to_string()) });
// 3 Present-Day Legends (6%)
contacts.insert("Tiamat".to_string(), Contact { name: "Tiamat".to_string(), image: None, alias: Some("The Dragon Queen".to_string()), status: Some(ContactStatus::Alive), location: None, notes: Some("Evil dragon goddess.".to_string()) });
contacts.insert("Vecna".to_string(), Contact { name: "Vecna".to_string(), image: None, alias: None, status: Some(ContactStatus::Alive), location: None, notes: Some("Lich god of secrets.".to_string()) });
contacts.insert("Claugiyliamatar".to_string(), Contact { name: "Claugiyliamatar".to_string(), image: None, alias: Some("Old Gnawbone".to_string()), status: Some(ContactStatus::Alive), location: Some("Kryptgarden Forest".to_string()), notes: Some("Ancient green dragon.".to_string()) });
// 2 Past Legends (4%, DeadBygone)
contacts.insert("Manshoon".to_string(), Contact { name: "Manshoon".to_string(), image: None, alias: None, status: Some(ContactStatus::DeadBygone), location: Some("Zhentil Keep".to_string()), notes: Some("Zhentarim founder, long dead.".to_string()) });
contacts.insert("Netherese Archwizard".to_string(), Contact { name: "Netherese Archwizard".to_string(), image: None, alias: None, status: Some(ContactStatus::DeadBygone), location: None, notes: Some("Ancient mage of lost empire.".to_string()) });
ContactBook(contacts)
}
fn generate_mock_notebook() -> NoteBook {
fn generate_mock_notebook () -> NoteBook {
NoteBook(vec![
Note { session: 1, content: "Met Elminster in Waterdeep; hinted at Netherese ruin.".to_string(), date_ingame: NaiveDate::from_ymd_opt(1481, 4, 15).unwrap(), date_real: NaiveDateTime::parse_from_str("2025-09-01 14:30:00", "%Y-%m-%d %H:%M:%S").unwrap(), tags: HashSet::from_iter(vec!["Elminster".to_string(), "Waterdeep".to_string()]) },
Note { session: 2, content: "Zhentarim agents watching Baldur's Gate tavern.".to_string(), date_ingame: NaiveDate::from_ymd_opt(1481, 4, 16).unwrap(), date_real: NaiveDateTime::parse_from_str("2025-09-02 09:15:00", "%Y-%m-%d %H:%M:%S").unwrap(), tags: HashSet::from_iter(vec!["Zhentarim".to_string()]) },
@ -155,3 +86,78 @@ fn generate_mock_notebook() -> NoteBook {
Note { session: 12, content: "Shady Cormyr merchant; possible doppelganger.".to_string(), date_ingame: NaiveDate::from_ymd_opt(1481, 5, 17).unwrap(), date_real: NaiveDateTime::parse_from_str("2025-09-11 14:00:00", "%Y-%m-%d %H:%M:%S").unwrap(), tags: HashSet::new() },
])
}
fn generate_mock_questbook () -> QuestBook {
QuestBook(vec![
Quest { title: "Slay the Bandit Chief".to_string(), location_taken: Some("Waterdeep".to_string()), location_task: Some("Phandalin".to_string()), date_taken: Some(NaiveDate::from_ymd_opt(1481, 4, 15).unwrap()), date_by: Some(NaiveDate::from_ymd_opt(1481, 5, 15).unwrap()), description: Some("Kill the bandit leader.".to_string()), from: Some(Name { first: "Dagult".to_string(), last: "Neverember".to_string(), alias: "".to_string(), ..Default::default() }), reward: Some(Balance { platinum: 0, gold: 100, electrum: 0, silver: 0, copper: 0 }) },
Quest { title: "Find the Lost Artifact".to_string(), location_taken: Some("Baldur's Gate".to_string()), location_task: None, date_taken: Some(NaiveDate::from_ymd_opt(1481, 6, 1).unwrap()), date_by: None, description: Some("Seek a relic in ruins.".to_string()), from: Some(Name { first: "Elminster".to_string(), last: "".to_string(), alias: "The Sage of Shadowdale".to_string() }), reward: Some(Balance { platinum: 10, gold: 50, electrum: 0, silver: 0, copper: 0 }) },
Quest { title: "Escort the Caravan".to_string(), location_taken: Some("Neverwinter".to_string()), location_task: Some("Luskan".to_string()), date_taken: None, date_by: Some(NaiveDate::from_ymd_opt(1481, 7, 30).unwrap()), description: Some("Protect traders.".to_string()), from: None, reward: Some(Balance { platinum: 0, gold: 20, electrum: 0, silver: 50, copper: 0 }) },
Quest { title: "Clear the Goblin Den".to_string(), location_taken: Some("Daggerford".to_string()), location_task: Some("Cragmaw Hideout".to_string()), date_taken: Some(NaiveDate::from_ymd_opt(1481, 3, 10).unwrap()), date_by: Some(NaiveDate::from_ymd_opt(1481, 4, 10).unwrap()), description: None, from: Some(Name { first: "".to_string(), last: "".to_string(), alias: "Local Militia".to_string(), ..Default::default() }), reward: Some(Balance { platinum: 0, gold: 30, electrum: 0, silver: 0, copper: 100 }) },
Quest { title: "Rescue the Noble".to_string(), location_taken: None, location_task: Some("Underdark".to_string()), date_taken: Some(NaiveDate::from_ymd_opt(1481, 5, 20).unwrap()), date_by: None, description: Some("Save a kidnapped noble.".to_string()), from: Some(Name { first: "".to_string(), last: "Silverhand".to_string(), alias: "".to_string(), ..Default::default() }), reward: Some(Balance { platinum: 5, gold: 200, electrum: 0, silver: 0, copper: 0 }) },
Quest { title: "Steal the Zhentarim Plans".to_string(), location_taken: Some("Zhentil Keep".to_string()), location_task: Some("Zhentil Keep".to_string()), date_taken: None, date_by: Some(NaiveDate::from_ymd_opt(1481, 8, 15).unwrap()), description: None, from: Some(Name { first: "".to_string(), last: "".to_string(), alias: "Harpers".to_string(), ..Default::default() }), reward: Some(Balance { platinum: 0, gold: 75, electrum: 0, silver: 0, copper: 0 }) },
Quest { title: "Hunt the Dire Wolf".to_string(), location_taken: Some("Silverymoon".to_string()), location_task: Some("Evermoors".to_string()), date_taken: Some(NaiveDate::from_ymd_opt(1481, 2, 5).unwrap()), date_by: None, description: Some("Track and kill a beast.".to_string()), from: None, reward: Some(Balance { platinum: 0, gold: 15, electrum: 0, silver: 20, copper: 50 }) },
Quest { title: "Recover the Spellbook".to_string(), location_taken: Some("Candlekeep".to_string()), location_task: None, date_taken: Some(NaiveDate::from_ymd_opt(1481, 1, 10).unwrap()), date_by: Some(NaiveDate::from_ymd_opt(1481, 2, 10).unwrap()), description: Some("Find a stolen tome.".to_string()), from: Some(Name { first: "".to_string(), last: "".to_string(), alias: "Candlekeep Scholars".to_string(), ..Default::default() }), reward: None },
Quest { title: "Guard the Temple".to_string(), location_taken: Some("Suzail".to_string()), location_task: Some("Temple of Lathander".to_string()), date_taken: None, date_by: None, description: Some("Protect the shrine.".to_string()), from: Some(Name { first: "".to_string(), last: "".to_string(), alias: "Clerics of Lathander".to_string(), ..Default::default() }), reward: Some(Balance { platinum: 0, gold: 50, electrum: 0, silver: 0, copper: 0 }) },
Quest { title: "Explore the Ruins".to_string(), location_taken: Some("Cormyr".to_string()), location_task: Some("Netherese Ruins".to_string()), date_taken: Some(NaiveDate::from_ymd_opt(1481, 9, 1).unwrap()), date_by: Some(NaiveDate::from_ymd_opt(1481, 10, 1).unwrap()), description: None, from: None, reward: None },
])
}
fn generate_mock_contact_book () -> ContactBook {
let mut contacts = HashMap::new();
// 40 Characters Met by Party (80%)
contacts.insert("Elminster".to_string(), Contact { name: Name { first: "Elminster".to_string(), last: "".to_string(), alias: "The Sage of Shadowdale".to_string() }, image: None, status: Some(ContactStatus::Alive), location: Some("Shadowdale".to_string()), notes: Some("Wise but cryptic wizard.".to_string()) });
contacts.insert("Drizzt Do'Urden".to_string(), Contact { name: Name { first: "Drizzt".to_string(), last: "Do'Urden".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Icewind Dale".to_string()), notes: Some("Renegade drow ranger.".to_string()) });
contacts.insert("Lord Neverember".to_string(), Contact { name: Name { first: "Dagult".to_string(), last: "Neverember".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Neverwinter".to_string()), notes: Some("Ruler seeking bandit leader.".to_string()) });
contacts.insert("Minsc".to_string(), Contact { name: Name { first: "Minsc".to_string(), last: "".to_string(), alias: "Rascal of Rashemen".to_string() }, image: None, status: Some(ContactStatus::Alive), location: Some("Baldur's Gate".to_string()), notes: Some("Loud warrior with hamster.".to_string()) });
contacts.insert("Jarlaxle".to_string(), Contact { name: Name { first: "Jarlaxle".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Luskan".to_string()), notes: Some("Sly drow mercenary leader.".to_string()) });
contacts.insert("Volo".to_string(), Contact { name: Name { first: "Volothamp".to_string(), last: "Geddarm".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Waterdeep".to_string()), notes: Some("Exaggerates his travel tales.".to_string()) });
contacts.insert("Laeral Silverhand".to_string(), Contact { name: Name { first: "Laeral".to_string(), last: "Silverhand".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Waterdeep".to_string()), notes: Some("Open Lord, powerful mage.".to_string()) });
contacts.insert("Hammond Ardeep".to_string(), Contact { name: Name { first: "Hammond".to_string(), last: "Ardeep".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Daggerford".to_string()), notes: Some("Militia leader vs. goblins.".to_string()) });
contacts.insert("Sister Garaele".to_string(), Contact { name: Name { first: "Garaele".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Harper agent in temple.".to_string()) });
contacts.insert("Gundren Rockseeker".to_string(), Contact { name: Name { first: "Gundren".to_string(), last: "Rockseeker".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Dwarf seeking lost mine.".to_string()) });
contacts.insert("Sildar Hallwinter".to_string(), Contact { name: Name { first: "Sildar".to_string(), last: "Hallwinter".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Lord's Alliance knight.".to_string()) });
contacts.insert("Qelline Alderleaf".to_string(), Contact { name: Name { first: "Qelline".to_string(), last: "Alderleaf".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Halfling farmer, kind.".to_string()) });
contacts.insert("Toblen Stonehill".to_string(), Contact { name: Name { first: "Toblen".to_string(), last: "Stonehill".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Innkeeper, knows rumors.".to_string()) });
contacts.insert("Darathra Shendrel".to_string(), Contact { name: Name { first: "Darathra".to_string(), last: "Shendrel".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Triboar".to_string()), notes: Some("Lord Protector, fair.".to_string()) });
contacts.insert("Ziraj the Hunter".to_string(), Contact { name: Name { first: "Ziraj".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Neverwinter Wood".to_string()), notes: Some("Tracks orcs.".to_string()) });
contacts.insert("Eldrin Thalindra".to_string(), Contact { name: Name { first: "Eldrin".to_string(), last: "Thalindra".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Silverymoon".to_string()), notes: Some("Arcane ward keeper.".to_string()) });
contacts.insert("Randal Morn".to_string(), Contact { name: Name { first: "Randal".to_string(), last: "Morn".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Daggerdale".to_string()), notes: Some("Fights Zhentarim.".to_string()) });
contacts.insert("Khelben Blackstaff".to_string(), Contact { name: Name { first: "Khelben".to_string(), last: "Arunsun".to_string(), alias: "The Blackstaff".to_string() }, image: None, status: Some(ContactStatus::Dead), location: Some("Waterdeep".to_string()), notes: Some("Former archmage, deceased.".to_string()) });
contacts.insert("Mirt the Moneylender".to_string(), Contact { name: Name { first: "Mirt".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Waterdeep".to_string()), notes: Some("Harper ally, wealthy.".to_string()) });
contacts.insert("Durnan".to_string(), Contact { name: Name { first: "Durnan".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Waterdeep".to_string()), notes: Some("Yawning Portal owner.".to_string()) });
contacts.insert("Fzoul Chembryl".to_string(), Contact { name: Name { first: "Fzoul".to_string(), last: "Chembryl".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Dead), location: Some("Zhentil Keep".to_string()), notes: Some("Former Zhentarim leader.".to_string()) });
contacts.insert("Bruenor Battlehammer".to_string(), Contact { name: Name { first: "Bruenor".to_string(), last: "Battlehammer".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Mithral Hall".to_string()), notes: Some("Dwarf king, ally.".to_string()) });
contacts.insert("Catti-brie".to_string(), Contact { name: Name { first: "Catti-brie".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Mithral Hall".to_string()), notes: Some("Skilled archer.".to_string()) });
contacts.insert("Regis".to_string(), Contact { name: Name { first: "Regis".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Icewind Dale".to_string()), notes: Some("Halfling, sneaky.".to_string()) });
contacts.insert("Artemis Entreri".to_string(), Contact { name: Name { first: "Artemis".to_string(), last: "Entreri".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Calimport".to_string()), notes: Some("Dangerous assassin.".to_string()) });
contacts.insert("Storm Silverhand".to_string(), Contact { name: Name { first: "Storm".to_string(), last: "Silverhand".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Shadowdale".to_string()), notes: Some("Bard and Chosen.".to_string()) });
contacts.insert("Halia Thornton".to_string(), Contact { name: Name { first: "Halia".to_string(), last: "Thornton".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Zhentarim agent, subtle.".to_string()) });
contacts.insert("Darlia Greystone".to_string(), Contact { name: Name { first: "Darlia".to_string(), last: "Greystone".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Triboar".to_string()), notes: Some("Blacksmith, reliable.".to_string()) });
contacts.insert("Eldric Varn".to_string(), Contact { name: Name { first: "Eldric".to_string(), last: "Varn".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Luskan".to_string()), notes: Some("Ship captain, shady.".to_string()) });
contacts.insert("Tymoras Priest".to_string(), Contact { name: Name { first: "".to_string(), last: "".to_string(), alias: "Tymoras Priest".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Suzail".to_string()), notes: Some("Blesses adventurers.".to_string()) });
contacts.insert("Redbrand Leader".to_string(), Contact { name: Name { first: "".to_string(), last: "".to_string(), alias: "Glasstaff".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Phandalin".to_string()), notes: Some("Runs thug gang.".to_string()) });
contacts.insert("Brynna of Lathander".to_string(), Contact { name: Name { first: "Brynna".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Suzail".to_string()), notes: Some("Temple cleric.".to_string()) });
contacts.insert("Korgul the Tumbler".to_string(), Contact { name: Name { first: "Korgul".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Baldur's Gate".to_string()), notes: Some("Thieves guild contact.".to_string()) });
contacts.insert("Tharivol the Mage".to_string(), Contact { name: Name { first: "Tharivol".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Silverymoon".to_string()), notes: Some("Studies arcane wards.".to_string()) });
contacts.insert("Gorlag the Orc".to_string(), Contact { name: Name { first: "Gorlag".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Dead), location: Some("Neverwinter Wood".to_string()), notes: Some("Slain orc chieftain.".to_string()) });
contacts.insert("Lhara the Merchant".to_string(), Contact { name: Name { first: "Lhara".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Cormyr".to_string()), notes: Some("Sells rare goods.".to_string()) });
contacts.insert("Ebon the Rogue".to_string(), Contact { name: Name { first: "Ebon".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Zhentil Keep".to_string()), notes: Some("Sneaky informant.".to_string()) });
contacts.insert("Father Llymic".to_string(), Contact { name: Name { first: "Llymic".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Dead), location: Some("Icewind Dale".to_string()), notes: Some("Evil priest, defeated.".to_string()) });
contacts.insert("Sylvara the Druid".to_string(), Contact { name: Name { first: "Sylvara".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("High Forest".to_string()), notes: Some("Protects the woods.".to_string()) });
contacts.insert("Raul the Barkeep".to_string(), Contact { name: Name { first: "Raul".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Daggerford".to_string()), notes: Some("Hears local gossip.".to_string()) });
// 5 Contacts (10%)
contacts.insert("Valthor the Fence".to_string(), Contact { name: Name { first: "Valthor".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Baldur's Gate".to_string()), notes: Some("Buys stolen goods.".to_string()) });
contacts.insert("Zyra the Alchemist".to_string(), Contact { name: Name { first: "Zyra".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Waterdeep".to_string()), notes: Some("Sells potions.".to_string()) });
contacts.insert("Kren the Smuggler".to_string(), Contact { name: Name { first: "Kren".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Luskan".to_string()), notes: Some("Moves contraband.".to_string()) });
contacts.insert("Mira the Scribe".to_string(), Contact { name: Name { first: "Mira".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Candlekeep".to_string()), notes: Some("Deciphers texts.".to_string()) });
contacts.insert("Thok the Armorer".to_string(), Contact { name: Name { first: "Thok".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Neverwinter".to_string()), notes: Some("Crafts fine armor.".to_string()) });
// 3 Present-Day Legends (6%)
contacts.insert("Tiamat".to_string(), Contact { name: Name { first: "".to_string(), last: "".to_string(), alias: "The Dragon Queen".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: None, notes: Some("Evil dragon goddess.".to_string()) });
contacts.insert("Vecna".to_string(), Contact { name: Name { first: "".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: None, notes: Some("Lich god of secrets.".to_string()) });
contacts.insert("Claugiyliamatar".to_string(), Contact { name: Name { first: "".to_string(), last: "".to_string(), alias: "Old Gnawbone".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::Alive), location: Some("Kryptgarden Forest".to_string()), notes: Some("Ancient green dragon.".to_string()) });
// 2 Past Legends (4%, DeadBygone)
contacts.insert("Manshoon".to_string(), Contact { name: Name { first: "Manshoon".to_string(), last: "".to_string(), alias: "".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::DeadBygone), location: Some("Zhentil Keep".to_string()), notes: Some("Zhentarim founder, long dead.".to_string()) });
contacts.insert("Netherese Archwizard".to_string(), Contact { name: Name { first: "".to_string(), last: "".to_string(), alias: "Netherese Archwizard".to_string(), ..Default::default() }, image: None, status: Some(ContactStatus::DeadBygone), location: None, notes: Some("Ancient mage of lost empire.".to_string()) });
ContactBook(contacts)
}

View File

@ -52,9 +52,7 @@ pub struct Dashboard {
#[derive(Clone, Debug, Store)]
pub struct PlayerData {
pub first_name: String,
pub last_name: String,
pub alias: String,
pub name: Name,
pub class: String,
pub image: String,
pub level: u8,
@ -122,7 +120,7 @@ pub struct Quest {
pub date_taken: Option<NaiveDate>,
pub date_by: Option<NaiveDate>,
pub description: Option<String>,
pub from: Option<String>,
pub from: Option<Name>,
pub reward: Option<Balance>,
}
@ -178,9 +176,8 @@ pub struct ContactBook (pub HashMap<String, Contact>);
#[derive(Clone, Debug, Store)]
pub struct Contact {
pub name: String,
pub name: Name,
pub image: Option<String>,
pub alias: Option<String>,
pub status: Option<ContactStatus>,
pub location: Option<String>,
pub notes: Option<String>,
@ -193,3 +190,19 @@ pub enum ContactStatus {
Dead,
Alive,
}
#[derive(Clone, Debug, Store, Default)]
pub struct Name {
pub first: String,
pub last: String,
pub alias: String,
}
impl Name {
pub fn display_alias (&self) -> bool {
!self.alias.is_empty()
}
pub fn display_last (&self) -> bool {
!self.last.is_empty()
}
}