Compare commits
No commits in common. "f711ca0a553f6c35e8d13bed6d1aeeb3b5b8d541" and "f193e4e6912eef4d03d6e75c4894b9db6938bcac" have entirely different histories.
f711ca0a55
...
f193e4e691
|
|
@ -306,15 +306,6 @@ dependencies = [
|
||||||
"unicode-segmentation",
|
"unicode-segmentation",
|
||||||
]
|
]
|
||||||
|
|
||||||
[[package]]
|
|
||||||
name = "convert_case"
|
|
||||||
version = "0.9.0"
|
|
||||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
|
||||||
checksum = "db05ffb6856bf0ecdf6367558a76a0e8a77b1713044eb92845c692100ed50190"
|
|
||||||
dependencies = [
|
|
||||||
"unicode-segmentation",
|
|
||||||
]
|
|
||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "core-foundation-sys"
|
name = "core-foundation-sys"
|
||||||
version = "0.8.7"
|
version = "0.8.7"
|
||||||
|
|
@ -2424,7 +2415,7 @@ version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"chrono",
|
||||||
"ciborium",
|
"ciborium",
|
||||||
"convert_case 0.8.0",
|
"convert_case",
|
||||||
"futures",
|
"futures",
|
||||||
"getrandom 0.3.3",
|
"getrandom 0.3.3",
|
||||||
"gloo 0.11.0",
|
"gloo 0.11.0",
|
||||||
|
|
@ -2450,8 +2441,7 @@ dependencies = [
|
||||||
name = "werewolves-macros"
|
name = "werewolves-macros"
|
||||||
version = "0.1.0"
|
version = "0.1.0"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"chrono",
|
"convert_case",
|
||||||
"convert_case 0.9.0",
|
|
||||||
"proc-macro2",
|
"proc-macro2",
|
||||||
"quote",
|
"quote",
|
||||||
"syn 2.0.106",
|
"syn 2.0.106",
|
||||||
|
|
|
||||||
|
|
@ -10,5 +10,4 @@ proc-macro = true
|
||||||
proc-macro2 = "1"
|
proc-macro2 = "1"
|
||||||
quote = "1"
|
quote = "1"
|
||||||
syn = { version = "2", features = ["full", "extra-traits"] }
|
syn = { version = "2", features = ["full", "extra-traits"] }
|
||||||
convert_case = { version = "0.9" }
|
convert_case = { version = "0.8" }
|
||||||
chrono = { version = "0.4" }
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ use core::error::Error;
|
||||||
use std::{
|
use std::{
|
||||||
io,
|
io,
|
||||||
path::{Path, PathBuf},
|
path::{Path, PathBuf},
|
||||||
process::Command,
|
|
||||||
};
|
};
|
||||||
|
|
||||||
use convert_case::Casing;
|
use convert_case::Casing;
|
||||||
|
|
@ -575,73 +574,3 @@ pub fn ref_and_mut(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
||||||
let ref_and_mut = parse_macro_input!(input as RefAndMut);
|
let ref_and_mut = parse_macro_input!(input as RefAndMut);
|
||||||
quote! {#ref_and_mut}.into()
|
quote! {#ref_and_mut}.into()
|
||||||
}
|
}
|
||||||
#[proc_macro]
|
|
||||||
pub fn build_dirty(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
|
||||||
if !input.is_empty() {
|
|
||||||
panic!("build_dirty doesn't take arguments");
|
|
||||||
}
|
|
||||||
|
|
||||||
let git_state = Command::new("git")
|
|
||||||
.arg("diff")
|
|
||||||
.arg("--stat")
|
|
||||||
.output()
|
|
||||||
.unwrap();
|
|
||||||
if !git_state.status.success() {
|
|
||||||
panic!("git diff --stat failed");
|
|
||||||
}
|
|
||||||
let dirty = !git_state.stdout.is_empty();
|
|
||||||
|
|
||||||
quote! {#dirty}.into()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[proc_macro]
|
|
||||||
pub fn build_id(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
|
||||||
if !input.is_empty() {
|
|
||||||
panic!("build_id doesn't take arguments");
|
|
||||||
}
|
|
||||||
let output = Command::new("git")
|
|
||||||
.arg("rev-parse")
|
|
||||||
.arg("--short")
|
|
||||||
.arg("HEAD")
|
|
||||||
.output()
|
|
||||||
.unwrap();
|
|
||||||
if !output.status.success() {
|
|
||||||
panic!("git rev-parse --short HEAD failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
let output = String::from_utf8(output.stdout).unwrap();
|
|
||||||
let git_ref = output.trim();
|
|
||||||
|
|
||||||
quote! {#git_ref}.into()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[proc_macro]
|
|
||||||
pub fn build_id_long(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
|
||||||
if !input.is_empty() {
|
|
||||||
panic!("build_id doesn't take arguments");
|
|
||||||
}
|
|
||||||
let output = Command::new("git")
|
|
||||||
.arg("rev-parse")
|
|
||||||
.arg("HEAD")
|
|
||||||
.output()
|
|
||||||
.unwrap();
|
|
||||||
if !output.status.success() {
|
|
||||||
panic!("git rev-parse --short HEAD failed");
|
|
||||||
}
|
|
||||||
|
|
||||||
let output = String::from_utf8(output.stdout).unwrap();
|
|
||||||
let git_ref = output.trim();
|
|
||||||
|
|
||||||
quote! {#git_ref}.into()
|
|
||||||
}
|
|
||||||
|
|
||||||
#[proc_macro]
|
|
||||||
pub fn build_time(input: proc_macro::TokenStream) -> proc_macro::TokenStream {
|
|
||||||
if !input.is_empty() {
|
|
||||||
panic!("build_time doesn't take arguments");
|
|
||||||
}
|
|
||||||
|
|
||||||
let time = chrono::Utc::now().format("%d %b %Y %T UTC").to_string();
|
|
||||||
|
|
||||||
quote! {#time}.into()
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use quote::{ToTokens, quote};
|
use quote::{ToTokens, quote};
|
||||||
use syn::parse::Parse;
|
use syn::{parse::Parse, spanned::Spanned};
|
||||||
#[allow(unused)]
|
|
||||||
pub struct RefAndMut {
|
pub struct RefAndMut {
|
||||||
name: syn::Ident,
|
name: syn::Ident,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -9,7 +9,7 @@ log = { version = "0.4" }
|
||||||
serde_json = { version = "1.0" }
|
serde_json = { version = "1.0" }
|
||||||
serde = { version = "1.0", features = ["derive"] }
|
serde = { version = "1.0", features = ["derive"] }
|
||||||
uuid = { version = "1.17", features = ["v4", "serde"] }
|
uuid = { version = "1.17", features = ["v4", "serde"] }
|
||||||
rand = { version = "0.9", features = ["std_rng"] }
|
rand = { version = "0.9" }
|
||||||
werewolves-macros = { path = "../werewolves-macros" }
|
werewolves-macros = { path = "../werewolves-macros" }
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
|
|
|
||||||
|
|
@ -1,3 +1,5 @@
|
||||||
|
use core::fmt::Display;
|
||||||
|
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
// Copyright (C) 2025 Emilis Bliūdžius
|
||||||
//
|
//
|
||||||
// This program is free software: you can redistribute it and/or modify
|
// This program is free software: you can redistribute it and/or modify
|
||||||
|
|
@ -12,37 +14,33 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use core::fmt::Display;
|
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use werewolves_macros::{ChecksAs, Titles};
|
use werewolves_macros::ChecksAs;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
bag::DrunkBag,
|
|
||||||
game::{GameTime, Village},
|
game::{GameTime, Village},
|
||||||
role::{Alignment, Killer, Powerful},
|
role::{Alignment, Killer, Powerful},
|
||||||
team::Team,
|
team::Team,
|
||||||
};
|
};
|
||||||
const BLOODLET_DURATION_DAYS: u8 = 2;
|
const BLOODLET_DURATION_DAYS: u8 = 2;
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize, ChecksAs, Titles)]
|
#[derive(Debug, Clone, Copy, PartialEq, Eq, Serialize, Deserialize, ChecksAs)]
|
||||||
pub enum Aura {
|
pub enum Aura {
|
||||||
#[checks("assignable")]
|
|
||||||
Traitor,
|
Traitor,
|
||||||
#[checks("assignable")]
|
|
||||||
#[checks("cleansible")]
|
#[checks("cleansible")]
|
||||||
Drunk(DrunkBag),
|
Drunk,
|
||||||
#[checks("assignable")]
|
|
||||||
Insane,
|
Insane,
|
||||||
#[checks("cleansible")]
|
#[checks("cleansible")]
|
||||||
Bloodlet { night: u8 },
|
Bloodlet {
|
||||||
|
night: u8,
|
||||||
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl Display for Aura {
|
impl Display for Aura {
|
||||||
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
|
||||||
f.write_str(match self {
|
f.write_str(match self {
|
||||||
Aura::Traitor => "Traitor",
|
Aura::Traitor => "Traitor",
|
||||||
Aura::Drunk(_) => "Drunk",
|
Aura::Drunk => "Drunk",
|
||||||
Aura::Insane => "Insane",
|
Aura::Insane => "Insane",
|
||||||
Aura::Bloodlet { .. } => "Bloodlet",
|
Aura::Bloodlet { .. } => "Bloodlet",
|
||||||
})
|
})
|
||||||
|
|
@ -52,7 +50,7 @@ impl Display for Aura {
|
||||||
impl Aura {
|
impl Aura {
|
||||||
pub const fn expired(&self, village: &Village) -> bool {
|
pub const fn expired(&self, village: &Village) -> bool {
|
||||||
match self {
|
match self {
|
||||||
Aura::Traitor | Aura::Drunk(_) | Aura::Insane => false,
|
Aura::Traitor | Aura::Drunk | Aura::Insane => false,
|
||||||
Aura::Bloodlet {
|
Aura::Bloodlet {
|
||||||
night: applied_night,
|
night: applied_night,
|
||||||
} => match village.time() {
|
} => match village.time() {
|
||||||
|
|
@ -90,16 +88,8 @@ impl Auras {
|
||||||
&self.0
|
&self.0
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn list_mut(&mut self) -> &mut [Aura] {
|
pub fn remove_aura(&mut self, aura: Aura) {
|
||||||
&mut self.0
|
self.0.retain(|a| *a != aura);
|
||||||
}
|
|
||||||
|
|
||||||
pub fn remove_aura(&mut self, aura: AuraTitle) {
|
|
||||||
self.0.retain(|a| a.title() != aura);
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn get_mut(&mut self, aura: AuraTitle) -> Option<&mut Aura> {
|
|
||||||
self.0.iter_mut().find(|a| a.title() == aura)
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/// purges expired [Aura]s and returns the ones that were removed
|
/// purges expired [Aura]s and returns the ones that were removed
|
||||||
|
|
@ -139,7 +129,7 @@ impl Auras {
|
||||||
match aura {
|
match aura {
|
||||||
Aura::Traitor => return Some(Alignment::Traitor),
|
Aura::Traitor => return Some(Alignment::Traitor),
|
||||||
Aura::Bloodlet { .. } => return Some(Alignment::Wolves),
|
Aura::Bloodlet { .. } => return Some(Alignment::Wolves),
|
||||||
Aura::Drunk(_) | Aura::Insane => {}
|
Aura::Drunk | Aura::Insane => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
None
|
None
|
||||||
|
|
@ -161,14 +151,3 @@ impl Auras {
|
||||||
.then_some(Powerful::Powerful)
|
.then_some(Powerful::Powerful)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl AuraTitle {
|
|
||||||
pub fn into_aura(self) -> Aura {
|
|
||||||
match self {
|
|
||||||
AuraTitle::Traitor => Aura::Traitor,
|
|
||||||
AuraTitle::Drunk => Aura::Drunk(DrunkBag::default()),
|
|
||||||
AuraTitle::Insane => Aura::Insane,
|
|
||||||
AuraTitle::Bloodlet => Aura::Bloodlet { night: 0 },
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -1,156 +0,0 @@
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
use rand::{SeedableRng, rngs::SmallRng, seq::SliceRandom};
|
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
|
||||||
pub struct Bag<T>(Vec<T>);
|
|
||||||
|
|
||||||
impl<T> Bag<T> {
|
|
||||||
pub fn new(items: impl IntoIterator<Item = T>) -> Self {
|
|
||||||
Self(items.into_iter().collect())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn pull(&mut self) -> Option<T> {
|
|
||||||
self.0.pop()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn peek(&self) -> Option<&T> {
|
|
||||||
self.0.last()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const fn len(&self) -> usize {
|
|
||||||
self.0.len()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize, Default)]
|
|
||||||
pub enum DrunkRoll {
|
|
||||||
Drunk,
|
|
||||||
#[default]
|
|
||||||
Sober,
|
|
||||||
}
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize)]
|
|
||||||
pub struct DrunkBag {
|
|
||||||
#[serde(skip)]
|
|
||||||
rng: SmallRng,
|
|
||||||
seed: u64,
|
|
||||||
bag_number: usize,
|
|
||||||
bag: Bag<DrunkRoll>,
|
|
||||||
}
|
|
||||||
|
|
||||||
impl<'de> Deserialize<'de> for DrunkBag {
|
|
||||||
fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
|
|
||||||
where
|
|
||||||
D: serde::Deserializer<'de>,
|
|
||||||
{
|
|
||||||
#[derive(Deserialize)]
|
|
||||||
struct DrunkBagNoRng {
|
|
||||||
seed: u64,
|
|
||||||
bag_number: usize,
|
|
||||||
bag: Bag<DrunkRoll>,
|
|
||||||
}
|
|
||||||
let DrunkBagNoRng {
|
|
||||||
seed,
|
|
||||||
bag_number,
|
|
||||||
bag,
|
|
||||||
} = DrunkBagNoRng::deserialize(deserializer)?;
|
|
||||||
let mut rng = SmallRng::seed_from_u64(seed);
|
|
||||||
// Shuffle the default bag bag_number of times to get the smallrng to the same state
|
|
||||||
for _ in 0..bag_number {
|
|
||||||
Self::DEFAULT_BAG
|
|
||||||
.iter()
|
|
||||||
.copied()
|
|
||||||
.collect::<Box<[_]>>()
|
|
||||||
.shuffle(&mut rng);
|
|
||||||
}
|
|
||||||
Ok(Self {
|
|
||||||
rng,
|
|
||||||
seed,
|
|
||||||
bag_number,
|
|
||||||
bag,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Default for DrunkBag {
|
|
||||||
fn default() -> Self {
|
|
||||||
Self::new()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl DrunkBag {
|
|
||||||
const DEFAULT_BAG: &[DrunkRoll] = &[
|
|
||||||
DrunkRoll::Drunk,
|
|
||||||
DrunkRoll::Drunk,
|
|
||||||
DrunkRoll::Sober,
|
|
||||||
DrunkRoll::Sober,
|
|
||||||
DrunkRoll::Sober,
|
|
||||||
];
|
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
#[doc(hidden)]
|
|
||||||
pub fn all_drunk() -> Self {
|
|
||||||
Self {
|
|
||||||
rng: SmallRng::seed_from_u64(0),
|
|
||||||
seed: 0,
|
|
||||||
bag_number: 1,
|
|
||||||
bag: Bag::new([
|
|
||||||
DrunkRoll::Drunk,
|
|
||||||
DrunkRoll::Drunk,
|
|
||||||
DrunkRoll::Drunk,
|
|
||||||
DrunkRoll::Drunk,
|
|
||||||
DrunkRoll::Drunk,
|
|
||||||
]),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn new() -> Self {
|
|
||||||
let seed = rand::random();
|
|
||||||
let mut rng = SmallRng::seed_from_u64(seed);
|
|
||||||
let mut starting_bag = Self::DEFAULT_BAG.iter().copied().collect::<Box<[_]>>();
|
|
||||||
starting_bag.shuffle(&mut rng);
|
|
||||||
let bag = Bag::new(starting_bag);
|
|
||||||
|
|
||||||
Self {
|
|
||||||
rng,
|
|
||||||
seed,
|
|
||||||
bag,
|
|
||||||
bag_number: 1,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn peek(&self) -> DrunkRoll {
|
|
||||||
self.bag.peek().copied().unwrap_or_default()
|
|
||||||
}
|
|
||||||
|
|
||||||
fn next_bag(&mut self) {
|
|
||||||
let mut starting_bag = Self::DEFAULT_BAG.iter().copied().collect::<Box<[_]>>();
|
|
||||||
starting_bag.shuffle(&mut self.rng);
|
|
||||||
self.bag = Bag::new(starting_bag);
|
|
||||||
self.bag_number += 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn pull(&mut self) -> DrunkRoll {
|
|
||||||
if self.bag.len() < 2 {
|
|
||||||
*self = Self::new();
|
|
||||||
} else if self.bag.len() == 2 {
|
|
||||||
let pulled = self.bag.pull().unwrap_or_default();
|
|
||||||
self.next_bag();
|
|
||||||
return pulled;
|
|
||||||
}
|
|
||||||
self.bag.pull().unwrap_or_default()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -22,7 +22,7 @@ use rand::seq::SliceRandom;
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
aura::{Aura, AuraTitle, Auras},
|
aura::{Aura, Auras},
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
error::GameError,
|
error::GameError,
|
||||||
game::{GameTime, Village},
|
game::{GameTime, Village},
|
||||||
|
|
@ -207,10 +207,6 @@ impl Character {
|
||||||
self.auras.list()
|
self.auras.list()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn auras_mut(&mut self) -> &mut [Aura] {
|
|
||||||
self.auras.list_mut()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn role_change(&mut self, new_role: RoleTitle, at: GameTime) -> Result<()> {
|
pub fn role_change(&mut self, new_role: RoleTitle, at: GameTime) -> Result<()> {
|
||||||
let mut role = new_role.title_to_role_excl_apprentice();
|
let mut role = new_role.title_to_role_excl_apprentice();
|
||||||
core::mem::swap(&mut role, &mut self.role);
|
core::mem::swap(&mut role, &mut self.role);
|
||||||
|
|
@ -248,9 +244,9 @@ impl Character {
|
||||||
)
|
)
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mason_prompts(&self, village: &Village) -> Result<Vec<ActionPrompt>> {
|
fn mason_prompts(&self, village: &Village) -> Result<Box<[ActionPrompt]>> {
|
||||||
if !self.role.wakes(village) {
|
if !self.role.wakes(village) {
|
||||||
return Ok(Vec::new());
|
return Ok(Box::new([]));
|
||||||
}
|
}
|
||||||
let (recruits, recruits_available) = match &self.role {
|
let (recruits, recruits_available) = match &self.role {
|
||||||
Role::MasonLeader {
|
Role::MasonLeader {
|
||||||
|
|
@ -308,31 +304,22 @@ impl Character {
|
||||||
self.auras.add(aura);
|
self.auras.add(aura);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn remove_aura(&mut self, aura: AuraTitle) {
|
pub fn remove_aura(&mut self, aura: Aura) {
|
||||||
self.auras.remove_aura(aura);
|
self.auras.remove_aura(aura);
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn night_action_prompts(&self, village: &Village) -> Result<Box<[ActionPrompt]>> {
|
pub fn night_action_prompts(&self, village: &Village) -> Result<Box<[ActionPrompt]>> {
|
||||||
let mut prompts = Vec::new();
|
|
||||||
if self.mason_leader().is_ok() {
|
if self.mason_leader().is_ok() {
|
||||||
// add them here so masons wake up even with a dead leader
|
return self.mason_prompts(village);
|
||||||
prompts.append(&mut self.mason_prompts(village)?);
|
}
|
||||||
|
if !self.alive() || !self.role.wakes(village) {
|
||||||
|
return Ok(Box::new([]));
|
||||||
}
|
}
|
||||||
let night = match village.time() {
|
let night = match village.time() {
|
||||||
GameTime::Day { number: _ } => return Err(GameError::NotNight),
|
GameTime::Day { number: _ } => return Err(GameError::NotNight),
|
||||||
GameTime::Night { number } => number,
|
GameTime::Night { number } => number,
|
||||||
};
|
};
|
||||||
if night == 0 && self.auras.list().contains(&Aura::Traitor) {
|
Ok(Box::new([match &self.role {
|
||||||
log::info!("adding traitor prompt for {}", self.identity());
|
|
||||||
prompts.push(ActionPrompt::TraitorIntro {
|
|
||||||
character_id: self.identity(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
if !self.alive() || !self.role.wakes(village) {
|
|
||||||
return Ok(prompts.into_boxed_slice());
|
|
||||||
}
|
|
||||||
|
|
||||||
match &self.role {
|
|
||||||
Role::Empath { cursed: true }
|
Role::Empath { cursed: true }
|
||||||
| Role::Diseased
|
| Role::Diseased
|
||||||
| Role::Weightlifter
|
| Role::Weightlifter
|
||||||
|
|
@ -347,11 +334,11 @@ impl Character {
|
||||||
woken_for_reveal: true,
|
woken_for_reveal: true,
|
||||||
..
|
..
|
||||||
}
|
}
|
||||||
| Role::Villager => {}
|
| Role::Villager => return Ok(Box::new([])),
|
||||||
|
|
||||||
Role::Insomniac => prompts.push(ActionPrompt::Insomniac {
|
Role::Insomniac => ActionPrompt::Insomniac {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
}),
|
},
|
||||||
|
|
||||||
Role::Scapegoat { redeemed: true } => {
|
Role::Scapegoat { redeemed: true } => {
|
||||||
let mut dead = village.dead_characters();
|
let mut dead = village.dead_characters();
|
||||||
|
|
@ -360,47 +347,49 @@ impl Character {
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.find_map(|d| (d.is_village() && d.is_power_role()).then_some(d.role_title()))
|
.find_map(|d| (d.is_village() && d.is_power_role()).then_some(d.role_title()))
|
||||||
{
|
{
|
||||||
prompts.push(ActionPrompt::RoleChange {
|
ActionPrompt::RoleChange {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
new_role: pr,
|
new_role: pr,
|
||||||
});
|
}
|
||||||
|
} else {
|
||||||
|
return Ok(Box::new([]));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Role::Bloodletter => prompts.push(ActionPrompt::Bloodletter {
|
Role::Bloodletter => ActionPrompt::Bloodletter {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_villagers(),
|
living_players: village.living_villagers(),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Seer => prompts.push(ActionPrompt::Seer {
|
Role::Seer => ActionPrompt::Seer {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Arcanist => prompts.push(ActionPrompt::Arcanist {
|
Role::Arcanist => ActionPrompt::Arcanist {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: (None, None),
|
marked: (None, None),
|
||||||
}),
|
},
|
||||||
Role::Protector {
|
Role::Protector {
|
||||||
last_protected: Some(last_protected),
|
last_protected: Some(last_protected),
|
||||||
} => prompts.push(ActionPrompt::Protector {
|
} => ActionPrompt::Protector {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
targets: village.living_players_excluding(*last_protected),
|
targets: village.living_players_excluding(*last_protected),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Protector {
|
Role::Protector {
|
||||||
last_protected: None,
|
last_protected: None,
|
||||||
} => prompts.push(ActionPrompt::Protector {
|
} => ActionPrompt::Protector {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
targets: village.living_players(),
|
targets: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Apprentice(role) => match village.time() {
|
Role::Apprentice(role) => {
|
||||||
GameTime::Day { number: _ } => {}
|
let current_night = match village.time() {
|
||||||
GameTime::Night {
|
GameTime::Day { number: _ } => return Ok(Box::new([])),
|
||||||
number: current_night,
|
GameTime::Night { number } => number,
|
||||||
} => {
|
};
|
||||||
if village
|
return Ok(village
|
||||||
.characters()
|
.characters()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.filter(|c| c.role_title() == *role)
|
.filter(|c| c.role_title() == *role)
|
||||||
|
|
@ -409,45 +398,48 @@ impl Character {
|
||||||
GameTime::Day { number } => number.get() + 1 >= current_night,
|
GameTime::Day { number } => number.get() + 1 >= current_night,
|
||||||
GameTime::Night { number } => number + 1 >= current_night,
|
GameTime::Night { number } => number + 1 >= current_night,
|
||||||
})
|
})
|
||||||
{
|
.then(|| ActionPrompt::RoleChange {
|
||||||
prompts.push(ActionPrompt::RoleChange {
|
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
new_role: *role,
|
new_role: *role,
|
||||||
});
|
})
|
||||||
|
.into_iter()
|
||||||
|
.collect());
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
Role::Elder {
|
Role::Elder {
|
||||||
knows_on_night,
|
knows_on_night,
|
||||||
woken_for_reveal: false,
|
woken_for_reveal: false,
|
||||||
..
|
..
|
||||||
} => match village.time() {
|
} => {
|
||||||
GameTime::Day { number: _ } => {}
|
let current_night = match village.time() {
|
||||||
GameTime::Night { number } => {
|
GameTime::Day { number: _ } => return Ok(Box::new([])),
|
||||||
if number >= knows_on_night.get() {
|
GameTime::Night { number } => number,
|
||||||
prompts.push(ActionPrompt::ElderReveal {
|
};
|
||||||
|
return Ok((current_night >= knows_on_night.get())
|
||||||
|
.then_some({
|
||||||
|
ActionPrompt::ElderReveal {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
})
|
||||||
|
.into_iter()
|
||||||
|
.collect());
|
||||||
}
|
}
|
||||||
},
|
Role::Militia { targeted: None } => ActionPrompt::Militia {
|
||||||
Role::Militia { targeted: None } => prompts.push(ActionPrompt::Militia {
|
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Werewolf => prompts.push(ActionPrompt::WolfPackKill {
|
Role::Werewolf => ActionPrompt::WolfPackKill {
|
||||||
living_villagers: village.living_players(),
|
living_villagers: village.living_players(),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::AlphaWolf { killed: None } => prompts.push(ActionPrompt::AlphaWolf {
|
Role::AlphaWolf { killed: None } => ActionPrompt::AlphaWolf {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_villagers: village.living_players_excluding(self.character_id()),
|
living_villagers: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::DireWolf {
|
Role::DireWolf {
|
||||||
last_blocked: Some(last_blocked),
|
last_blocked: Some(last_blocked),
|
||||||
} => prompts.push(ActionPrompt::DireWolf {
|
} => ActionPrompt::DireWolf {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village
|
living_players: village
|
||||||
.living_players_excluding(self.character_id())
|
.living_players_excluding(self.character_id())
|
||||||
|
|
@ -455,124 +447,137 @@ impl Character {
|
||||||
.filter(|c| c.character_id != *last_blocked)
|
.filter(|c| c.character_id != *last_blocked)
|
||||||
.collect(),
|
.collect(),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::DireWolf { .. } => prompts.push(ActionPrompt::DireWolf {
|
Role::DireWolf { .. } => ActionPrompt::DireWolf {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Shapeshifter { shifted_into: None } => prompts.push(ActionPrompt::Shapeshifter {
|
Role::Shapeshifter { shifted_into: None } => ActionPrompt::Shapeshifter {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
}),
|
},
|
||||||
Role::Gravedigger => {
|
Role::Gravedigger => {
|
||||||
let dead = village.dead_targets();
|
let dead = village.dead_targets();
|
||||||
if !dead.is_empty() {
|
if dead.is_empty() {
|
||||||
prompts.push(ActionPrompt::Gravedigger {
|
return Ok(Box::new([]));
|
||||||
|
}
|
||||||
|
ActionPrompt::Gravedigger {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
dead_players: village.dead_targets(),
|
dead_players: village.dead_targets(),
|
||||||
marked: None,
|
marked: None,
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Role::Hunter { target } => prompts.push(ActionPrompt::Hunter {
|
Role::Hunter { target } => ActionPrompt::Hunter {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
current_target: target.as_ref().and_then(|t| village.target_by_id(*t).ok()),
|
current_target: target.as_ref().and_then(|t| village.target_by_id(*t).ok()),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::MapleWolf { last_kill_on_night } => prompts.push(ActionPrompt::MapleWolf {
|
Role::MapleWolf { last_kill_on_night } => ActionPrompt::MapleWolf {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
kill_or_die: last_kill_on_night + MAPLE_WOLF_ABSTAIN_LIMIT.get() == night,
|
kill_or_die: last_kill_on_night + MAPLE_WOLF_ABSTAIN_LIMIT.get() == night,
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Guardian {
|
Role::Guardian {
|
||||||
last_protected: Some(PreviousGuardianAction::Guard(prev_target)),
|
last_protected: Some(PreviousGuardianAction::Guard(prev_target)),
|
||||||
} => prompts.push(ActionPrompt::Guardian {
|
} => ActionPrompt::Guardian {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
previous: Some(PreviousGuardianAction::Guard(prev_target.clone())),
|
previous: Some(PreviousGuardianAction::Guard(prev_target.clone())),
|
||||||
living_players: village.living_players_excluding(prev_target.character_id),
|
living_players: village.living_players_excluding(prev_target.character_id),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Guardian {
|
Role::Guardian {
|
||||||
last_protected: Some(PreviousGuardianAction::Protect(prev_target)),
|
last_protected: Some(PreviousGuardianAction::Protect(prev_target)),
|
||||||
} => prompts.push(ActionPrompt::Guardian {
|
} => ActionPrompt::Guardian {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
previous: Some(PreviousGuardianAction::Protect(prev_target.clone())),
|
previous: Some(PreviousGuardianAction::Protect(prev_target.clone())),
|
||||||
living_players: village.living_players(),
|
living_players: village.living_players(),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Guardian {
|
Role::Guardian {
|
||||||
last_protected: None,
|
last_protected: None,
|
||||||
} => prompts.push(ActionPrompt::Guardian {
|
} => ActionPrompt::Guardian {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
previous: None,
|
previous: None,
|
||||||
living_players: village.living_players(),
|
living_players: village.living_players(),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Adjudicator => prompts.push(ActionPrompt::Adjudicator {
|
Role::Adjudicator => ActionPrompt::Adjudicator {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::PowerSeer => prompts.push(ActionPrompt::PowerSeer {
|
Role::PowerSeer => ActionPrompt::PowerSeer {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Mortician => {
|
Role::Mortician => ActionPrompt::Mortician {
|
||||||
|
character_id: self.identity(),
|
||||||
|
dead_players: {
|
||||||
let dead = village.dead_targets();
|
let dead = village.dead_targets();
|
||||||
if !dead.is_empty() {
|
if dead.is_empty() {
|
||||||
prompts.push(ActionPrompt::Mortician {
|
return Ok(Box::new([]));
|
||||||
character_id: self.identity(),
|
}
|
||||||
dead_players: dead,
|
dead
|
||||||
|
},
|
||||||
marked: None,
|
marked: None,
|
||||||
});
|
},
|
||||||
}
|
Role::Beholder => ActionPrompt::Beholder {
|
||||||
}
|
|
||||||
Role::Beholder => prompts.push(ActionPrompt::Beholder {
|
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::MasonLeader { .. } => {
|
Role::MasonLeader { .. } => {
|
||||||
log::error!(
|
log::error!(
|
||||||
"night_action_prompts got to MasonLeader, should be handled before the living check"
|
"night_action_prompts got to MasonLeader, should be handled before the living check"
|
||||||
);
|
);
|
||||||
|
return Ok(Box::new([]));
|
||||||
}
|
}
|
||||||
Role::Empath { cursed: false } => prompts.push(ActionPrompt::Empath {
|
Role::Empath { cursed: false } => ActionPrompt::Empath {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::Vindicator => {
|
Role::Vindicator => {
|
||||||
if night != 0
|
let last_day = match village.time() {
|
||||||
&& let Some(last_day) = NonZeroU8::new(night)
|
GameTime::Day { .. } => {
|
||||||
&& village
|
log::error!(
|
||||||
|
"vindicator trying to get a prompt during the day? village state: {village:?}"
|
||||||
|
);
|
||||||
|
return Ok(Box::new([]));
|
||||||
|
}
|
||||||
|
GameTime::Night { number } => {
|
||||||
|
if number == 0 {
|
||||||
|
return Ok(Box::new([]));
|
||||||
|
}
|
||||||
|
NonZeroU8::new(number).unwrap()
|
||||||
|
}
|
||||||
|
};
|
||||||
|
return Ok(village
|
||||||
.executions_on_day(last_day)
|
.executions_on_day(last_day)
|
||||||
.iter()
|
.iter()
|
||||||
.any(|c| c.is_village())
|
.any(|c| c.is_village())
|
||||||
{
|
.then(|| ActionPrompt::Vindicator {
|
||||||
prompts.push(ActionPrompt::Vindicator {
|
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
});
|
})
|
||||||
|
.into_iter()
|
||||||
|
.collect());
|
||||||
}
|
}
|
||||||
}
|
Role::PyreMaster { .. } => ActionPrompt::PyreMaster {
|
||||||
|
|
||||||
Role::PyreMaster { .. } => prompts.push(ActionPrompt::PyreMaster {
|
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
Role::LoneWolf => prompts.push(ActionPrompt::LoneWolfKill {
|
Role::LoneWolf => ActionPrompt::LoneWolfKill {
|
||||||
character_id: self.identity(),
|
character_id: self.identity(),
|
||||||
living_players: village.living_players_excluding(self.character_id()),
|
living_players: village.living_players_excluding(self.character_id()),
|
||||||
marked: None,
|
marked: None,
|
||||||
}),
|
},
|
||||||
}
|
}]))
|
||||||
Ok(prompts.into_boxed_slice())
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
#[cfg(test)]
|
||||||
|
|
@ -825,28 +830,6 @@ impl Character {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn maple_wolf_mut<'a>(&'a mut self) -> Result<MapleWolfMut<'a>> {
|
|
||||||
let title = self.role.title();
|
|
||||||
match &mut self.role {
|
|
||||||
Role::MapleWolf { last_kill_on_night } => Ok(MapleWolfMut(last_kill_on_night)),
|
|
||||||
_ => Err(GameError::InvalidRole {
|
|
||||||
expected: RoleTitle::MapleWolf,
|
|
||||||
got: title,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const fn protector_mut<'a>(&'a mut self) -> Result<ProtectorMut<'a>> {
|
|
||||||
let title = self.role.title();
|
|
||||||
match &mut self.role {
|
|
||||||
Role::Protector { last_protected } => Ok(ProtectorMut(last_protected)),
|
|
||||||
_ => Err(GameError::InvalidRole {
|
|
||||||
expected: RoleTitle::Protector,
|
|
||||||
got: title,
|
|
||||||
}),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const fn initial_shown_role(&self) -> RoleTitle {
|
pub const fn initial_shown_role(&self) -> RoleTitle {
|
||||||
self.role.initial_shown_role()
|
self.role.initial_shown_role()
|
||||||
}
|
}
|
||||||
|
|
@ -889,8 +872,6 @@ decl_ref_and_mut!(
|
||||||
Guardian, GuardianMut: Option<PreviousGuardianAction>;
|
Guardian, GuardianMut: Option<PreviousGuardianAction>;
|
||||||
Direwolf, DirewolfMut: Option<CharacterId>;
|
Direwolf, DirewolfMut: Option<CharacterId>;
|
||||||
Militia, MilitiaMut: Option<CharacterId>;
|
Militia, MilitiaMut: Option<CharacterId>;
|
||||||
MapleWolf, MapleWolfMut: u8;
|
|
||||||
Protector, ProtectorMut: Option<CharacterId>;
|
|
||||||
);
|
);
|
||||||
|
|
||||||
pub struct BlackKnightKill<'a> {
|
pub struct BlackKnightKill<'a> {
|
||||||
|
|
|
||||||
|
|
@ -73,8 +73,6 @@ pub enum GameError {
|
||||||
NightNeedsNext,
|
NightNeedsNext,
|
||||||
#[error("night zero actions can only be obtained on night zero")]
|
#[error("night zero actions can only be obtained on night zero")]
|
||||||
NotNightZero,
|
NotNightZero,
|
||||||
#[error("this action cannot happen on night zero")]
|
|
||||||
CannotHappenOnNightZero,
|
|
||||||
#[error("wolves intro in progress")]
|
#[error("wolves intro in progress")]
|
||||||
WolvesIntroInProgress,
|
WolvesIntroInProgress,
|
||||||
#[error("a game is still ongoing")]
|
#[error("a game is still ongoing")]
|
||||||
|
|
@ -99,10 +97,4 @@ pub enum GameError {
|
||||||
NoPreviousDuringDay,
|
NoPreviousDuringDay,
|
||||||
#[error("militia already spent")]
|
#[error("militia already spent")]
|
||||||
MilitiaSpent,
|
MilitiaSpent,
|
||||||
#[error("this role doesn't mark anyone")]
|
|
||||||
RoleDoesntMark,
|
|
||||||
#[error("cannot shapeshift on a non-shapeshifter prompt")]
|
|
||||||
ShapeshiftingIsForShapeshifters,
|
|
||||||
#[error("must select a target")]
|
|
||||||
MustSelectTarget,
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,17 +12,14 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use core::num::NonZeroU8;
|
use core::{num::NonZeroU8, ops::Not};
|
||||||
|
|
||||||
use super::Result;
|
use super::Result;
|
||||||
use crate::{
|
use crate::{
|
||||||
character::CharacterId,
|
character::CharacterId,
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
error::GameError,
|
error::GameError,
|
||||||
game::{
|
game::{Village, night::changes::ChangesLookup},
|
||||||
Village,
|
|
||||||
night::changes::{ChangesLookup, NightChange},
|
|
||||||
},
|
|
||||||
player::Protection,
|
player::Protection,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -39,11 +36,7 @@ pub enum KillOutcome {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl KillOutcome {
|
impl KillOutcome {
|
||||||
pub fn apply_to_village(
|
pub fn apply_to_village(self, village: &mut Village) -> Result<()> {
|
||||||
self,
|
|
||||||
village: &mut Village,
|
|
||||||
recorded_changes: Option<&mut Vec<NightChange>>,
|
|
||||||
) -> Result<()> {
|
|
||||||
match self {
|
match self {
|
||||||
KillOutcome::Single(character_id, died_to) => {
|
KillOutcome::Single(character_id, died_to) => {
|
||||||
village
|
village
|
||||||
|
|
@ -71,22 +64,15 @@ impl KillOutcome {
|
||||||
// check if guardian exists before we mutably borrow killer, which would
|
// check if guardian exists before we mutably borrow killer, which would
|
||||||
// prevent us from borrowing village to check after.
|
// prevent us from borrowing village to check after.
|
||||||
village.character_by_id(guardian)?;
|
village.character_by_id(guardian)?;
|
||||||
let guardian_kill = DiedTo::GuardianProtecting {
|
village
|
||||||
|
.character_by_id_mut(original_killer)?
|
||||||
|
.kill(DiedTo::GuardianProtecting {
|
||||||
night,
|
night,
|
||||||
source: guardian,
|
source: guardian,
|
||||||
protecting: original_target,
|
protecting: original_target,
|
||||||
protecting_from: original_killer,
|
protecting_from: original_killer,
|
||||||
protecting_from_cause: Box::new(original_kill.clone()),
|
protecting_from_cause: Box::new(original_kill.clone()),
|
||||||
};
|
|
||||||
if let Some(recorded_changes) = recorded_changes {
|
|
||||||
recorded_changes.push(NightChange::Kill {
|
|
||||||
target: original_killer,
|
|
||||||
died_to: guardian_kill.clone(),
|
|
||||||
});
|
});
|
||||||
}
|
|
||||||
village
|
|
||||||
.character_by_id_mut(original_killer)?
|
|
||||||
.kill(guardian_kill);
|
|
||||||
village.character_by_id_mut(guardian)?.kill(original_kill);
|
village.character_by_id_mut(guardian)?.kill(original_kill);
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
@ -122,7 +108,7 @@ fn resolve_protection(
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn resolve_kill(
|
pub fn resolve_kill(
|
||||||
changes: &ChangesLookup<'_>,
|
changes: &mut ChangesLookup<'_>,
|
||||||
target: CharacterId,
|
target: CharacterId,
|
||||||
died_to: &DiedTo,
|
died_to: &DiedTo,
|
||||||
night: u8,
|
night: u8,
|
||||||
|
|
@ -133,7 +119,7 @@ pub fn resolve_kill(
|
||||||
night,
|
night,
|
||||||
starves_if_fails: true,
|
starves_if_fails: true,
|
||||||
} = died_to
|
} = died_to
|
||||||
&& let Some(protection) = changes.protected(target)
|
&& let Some(protection) = changes.protected_take(target)
|
||||||
{
|
{
|
||||||
return Ok(Some(
|
return Ok(Some(
|
||||||
resolve_protection(*source, died_to, target, &protection, *night).unwrap_or(
|
resolve_protection(*source, died_to, target, &protection, *night).unwrap_or(
|
||||||
|
|
@ -149,7 +135,7 @@ pub fn resolve_kill(
|
||||||
{
|
{
|
||||||
let killing_wolf = village.character_by_id(*killing_wolf)?;
|
let killing_wolf = village.character_by_id(*killing_wolf)?;
|
||||||
|
|
||||||
match changes.protected(target) {
|
match changes.protected_take(target) {
|
||||||
Some(protection) => {
|
Some(protection) => {
|
||||||
return Ok(resolve_protection(
|
return Ok(resolve_protection(
|
||||||
killing_wolf.character_id(),
|
killing_wolf.character_id(),
|
||||||
|
|
@ -162,7 +148,7 @@ pub fn resolve_kill(
|
||||||
None => {
|
None => {
|
||||||
// Wolf kill went through -- can kill shifter
|
// Wolf kill went through -- can kill shifter
|
||||||
return Ok(Some(KillOutcome::Single(
|
return Ok(Some(KillOutcome::Single(
|
||||||
ss_source,
|
*ss_source,
|
||||||
DiedTo::Shapeshift {
|
DiedTo::Shapeshift {
|
||||||
into: target,
|
into: target,
|
||||||
night: *night,
|
night: *night,
|
||||||
|
|
@ -172,7 +158,7 @@ pub fn resolve_kill(
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
let protection = match changes.protected(target) {
|
let protection = match changes.protected_take(target) {
|
||||||
Some(prot) => prot,
|
Some(prot) => prot,
|
||||||
None => return Ok(Some(KillOutcome::Single(target, died_to.clone()))),
|
None => return Ok(Some(KillOutcome::Single(target, died_to.clone()))),
|
||||||
};
|
};
|
||||||
|
|
@ -187,7 +173,7 @@ pub fn resolve_kill(
|
||||||
.ok_or(GameError::GuardianInvalidOriginalKill)?,
|
.ok_or(GameError::GuardianInvalidOriginalKill)?,
|
||||||
original_target: target,
|
original_target: target,
|
||||||
original_kill: died_to.clone(),
|
original_kill: died_to.clone(),
|
||||||
guardian: *source,
|
guardian: source,
|
||||||
night: NonZeroU8::new(night).unwrap(),
|
night: NonZeroU8::new(night).unwrap(),
|
||||||
})),
|
})),
|
||||||
Protection::Guardian {
|
Protection::Guardian {
|
||||||
|
|
|
||||||
|
|
@ -72,15 +72,6 @@ impl Game {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
#[doc(hidden)]
|
|
||||||
pub const fn village_mut(&mut self) -> &mut Village {
|
|
||||||
match &mut self.state {
|
|
||||||
GameState::Day { village, marked: _ } => village,
|
|
||||||
GameState::Night { night } => night.village_mut(),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn process(&mut self, message: HostGameMessage) -> Result<ServerToHostMessage> {
|
pub fn process(&mut self, message: HostGameMessage) -> Result<ServerToHostMessage> {
|
||||||
match (&mut self.state, message) {
|
match (&mut self.state, message) {
|
||||||
(GameState::Night { night }, HostGameMessage::Night(HostNightMessage::NextPage)) => {
|
(GameState::Night { night }, HostGameMessage::Night(HostNightMessage::NextPage)) => {
|
||||||
|
|
@ -111,6 +102,7 @@ impl Game {
|
||||||
(GameState::Day { village, marked }, HostGameMessage::Day(HostDayMessage::Execute)) => {
|
(GameState::Day { village, marked }, HostGameMessage::Day(HostDayMessage::Execute)) => {
|
||||||
let time = village.time();
|
let time = village.time();
|
||||||
if let Some(outcome) = village.execute(marked)? {
|
if let Some(outcome) = village.execute(marked)? {
|
||||||
|
log::warn!("adding to history for {}", village.time());
|
||||||
self.history.add(
|
self.history.add(
|
||||||
village.time(),
|
village.time(),
|
||||||
GameActions::DayDetails(
|
GameActions::DayDetails(
|
||||||
|
|
@ -120,6 +112,7 @@ impl Game {
|
||||||
return Ok(ServerToHostMessage::GameOver(outcome));
|
return Ok(ServerToHostMessage::GameOver(outcome));
|
||||||
}
|
}
|
||||||
let night = Night::new(village.clone())?;
|
let night = Night::new(village.clone())?;
|
||||||
|
log::warn!("adding to history for {time}");
|
||||||
self.history.add(
|
self.history.add(
|
||||||
time,
|
time,
|
||||||
GameActions::DayDetails(
|
GameActions::DayDetails(
|
||||||
|
|
@ -169,13 +162,13 @@ impl Game {
|
||||||
Ok(_) => self.process(HostGameMessage::GetState),
|
Ok(_) => self.process(HostGameMessage::GetState),
|
||||||
Err(GameError::NightOver) => {
|
Err(GameError::NightOver) => {
|
||||||
let changes = night.collect_changes()?;
|
let changes = night.collect_changes()?;
|
||||||
let (village, recorded_changes) =
|
let village = night.village().with_night_changes(&changes)?;
|
||||||
night.village().with_night_changes(&changes)?;
|
log::warn!("adding to history for {}", night.village().time());
|
||||||
self.history.add(
|
self.history.add(
|
||||||
night.village().time(),
|
night.village().time(),
|
||||||
GameActions::NightDetails(NightDetails::new(
|
GameActions::NightDetails(NightDetails::new(
|
||||||
&night.used_actions(),
|
&night.used_actions(),
|
||||||
recorded_changes,
|
changes,
|
||||||
)),
|
)),
|
||||||
)?;
|
)?;
|
||||||
self.state = GameState::Day {
|
self.state = GameState::Day {
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
pub mod changes;
|
pub mod changes;
|
||||||
mod next;
|
|
||||||
mod process;
|
mod process;
|
||||||
|
|
||||||
use core::num::NonZeroU8;
|
use core::num::NonZeroU8;
|
||||||
|
|
@ -28,7 +27,7 @@ use crate::{
|
||||||
error::GameError,
|
error::GameError,
|
||||||
game::{
|
game::{
|
||||||
GameTime, Village,
|
GameTime, Village,
|
||||||
kill::{self, KillOutcome},
|
kill::{self},
|
||||||
night::changes::{ChangesLookup, NightChange},
|
night::changes::{ChangesLookup, NightChange},
|
||||||
},
|
},
|
||||||
message::night::{ActionPrompt, ActionPromptTitle, ActionResponse, ActionResult, Visits},
|
message::night::{ActionPrompt, ActionPromptTitle, ActionResponse, ActionResult, Visits},
|
||||||
|
|
@ -59,8 +58,7 @@ impl From<ActionComplete> for ResponseOutcome {
|
||||||
impl ActionPrompt {
|
impl ActionPrompt {
|
||||||
fn unless(&self) -> Option<Unless> {
|
fn unless(&self) -> Option<Unless> {
|
||||||
match &self {
|
match &self {
|
||||||
ActionPrompt::TraitorIntro { .. }
|
ActionPrompt::Insomniac { .. }
|
||||||
| ActionPrompt::Insomniac { .. }
|
|
||||||
| ActionPrompt::MasonsWake { .. }
|
| ActionPrompt::MasonsWake { .. }
|
||||||
| ActionPrompt::WolvesIntro { .. }
|
| ActionPrompt::WolvesIntro { .. }
|
||||||
| ActionPrompt::RoleChange { .. }
|
| ActionPrompt::RoleChange { .. }
|
||||||
|
|
@ -534,7 +532,13 @@ impl Night {
|
||||||
// role change associated with the shapeshift
|
// role change associated with the shapeshift
|
||||||
self.action_queue.push_front(last_prompt);
|
self.action_queue.push_front(last_prompt);
|
||||||
}
|
}
|
||||||
|
log::warn!(
|
||||||
|
"next prompts: {:?}",
|
||||||
|
self.action_queue
|
||||||
|
.iter()
|
||||||
|
.map(ActionPrompt::title)
|
||||||
|
.collect::<Box<[_]>>()
|
||||||
|
);
|
||||||
*current_result = CurrentResult::None;
|
*current_result = CurrentResult::None;
|
||||||
*current_changes = Vec::new();
|
*current_changes = Vec::new();
|
||||||
Ok(())
|
Ok(())
|
||||||
|
|
@ -588,7 +592,7 @@ impl Night {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn apply_shapeshift(&mut self, source: &CharacterId) -> Result<Option<ActionResult>> {
|
fn apply_shapeshift(&mut self, source: &CharacterId) -> Result<()> {
|
||||||
if let Some(kill_target) = self
|
if let Some(kill_target) = self
|
||||||
.changes_from_actions()
|
.changes_from_actions()
|
||||||
.into_iter()
|
.into_iter()
|
||||||
|
|
@ -612,7 +616,7 @@ impl Night {
|
||||||
_ => false,
|
_ => false,
|
||||||
}) {
|
}) {
|
||||||
// there is protection, so the kill doesn't happen -> no shapeshift
|
// there is protection, so the kill doesn't happen -> no shapeshift
|
||||||
return Ok(Some(ActionResult::ShiftFailed));
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
||||||
if self.changes_from_actions().into_iter().any(|c| {
|
if self.changes_from_actions().into_iter().any(|c| {
|
||||||
|
|
@ -663,7 +667,7 @@ impl Night {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self.action_queue = new_queue;
|
self.action_queue = new_queue;
|
||||||
Ok(None)
|
Ok(())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub const fn page(&self) -> Option<usize> {
|
pub const fn page(&self) -> Option<usize> {
|
||||||
|
|
@ -677,8 +681,8 @@ impl Night {
|
||||||
match &mut self.night_state {
|
match &mut self.night_state {
|
||||||
NightState::Active { current_result, .. } => match current_result {
|
NightState::Active { current_result, .. } => match current_result {
|
||||||
CurrentResult::None => self.received_response(ActionResponse::Continue),
|
CurrentResult::None => self.received_response(ActionResponse::Continue),
|
||||||
CurrentResult::GoBackToSleepAfterShown { .. }
|
CurrentResult::Result(ActionResult::Continue)
|
||||||
| CurrentResult::Result(ActionResult::Continue)
|
| CurrentResult::GoBackToSleepAfterShown { .. }
|
||||||
| CurrentResult::Result(ActionResult::GoBackToSleep) => {
|
| CurrentResult::Result(ActionResult::GoBackToSleep) => {
|
||||||
Err(GameError::NightNeedsNext)
|
Err(GameError::NightNeedsNext)
|
||||||
}
|
}
|
||||||
|
|
@ -693,24 +697,7 @@ impl Night {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn set_current_result(&mut self, result: CurrentResult) -> Result<()> {
|
|
||||||
match &mut self.night_state {
|
|
||||||
NightState::Active {
|
|
||||||
current_prompt: _,
|
|
||||||
current_result,
|
|
||||||
..
|
|
||||||
} => *current_result = result,
|
|
||||||
NightState::Complete => return Err(GameError::NightOver),
|
|
||||||
};
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn received_response(&mut self, resp: ActionResponse) -> Result<ServerAction> {
|
pub fn received_response(&mut self, resp: ActionResponse) -> Result<ServerAction> {
|
||||||
if let ActionResponse::ContinueToResult = &resp
|
|
||||||
&& let Some(result) = self.current_result()
|
|
||||||
{
|
|
||||||
return Ok(ServerAction::Result(result.clone()));
|
|
||||||
}
|
|
||||||
match self.received_response_with_role_blocks(resp)? {
|
match self.received_response_with_role_blocks(resp)? {
|
||||||
BlockResolvedOutcome::PromptUpdate(prompt) => match &mut self.night_state {
|
BlockResolvedOutcome::PromptUpdate(prompt) => match &mut self.night_state {
|
||||||
NightState::Active {
|
NightState::Active {
|
||||||
|
|
@ -728,18 +715,18 @@ impl Night {
|
||||||
NightState::Complete => Err(GameError::NightOver),
|
NightState::Complete => Err(GameError::NightOver),
|
||||||
},
|
},
|
||||||
BlockResolvedOutcome::ActionComplete(mut result, Some(change)) => {
|
BlockResolvedOutcome::ActionComplete(mut result, Some(change)) => {
|
||||||
self.set_current_result(result.clone().into())?;
|
match &mut self.night_state {
|
||||||
|
NightState::Active {
|
||||||
|
current_prompt: _,
|
||||||
|
current_result,
|
||||||
|
..
|
||||||
|
} => *current_result = result.clone().into(),
|
||||||
|
NightState::Complete => return Err(GameError::NightOver),
|
||||||
|
};
|
||||||
if let NightChange::Shapeshift { source, .. } = &change {
|
if let NightChange::Shapeshift { source, .. } = &change {
|
||||||
// needs to be resolved _now_ so that the target can be woken
|
// needs to be resolved _now_ so that the target can be woken
|
||||||
// for the role change with the wolves
|
// for the role change with the wolves
|
||||||
if let Some(result) = self.apply_shapeshift(source)? {
|
self.apply_shapeshift(source)?;
|
||||||
if let NightState::Active { current_result, .. } = &mut self.night_state {
|
|
||||||
*current_result = CurrentResult::None;
|
|
||||||
};
|
|
||||||
|
|
||||||
return Ok(ServerAction::Result(result));
|
|
||||||
}
|
|
||||||
|
|
||||||
return Ok(ServerAction::Result(
|
return Ok(ServerAction::Result(
|
||||||
self.action_queue
|
self.action_queue
|
||||||
.iter()
|
.iter()
|
||||||
|
|
@ -779,10 +766,10 @@ impl Night {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn outcome_consecutive_same_player_no_sleep(
|
fn received_response_consecutive_same_player_no_sleep(
|
||||||
&self,
|
&self,
|
||||||
outcome: ResponseOutcome,
|
resp: ActionResponse,
|
||||||
) -> ResponseOutcome {
|
) -> Result<ResponseOutcome> {
|
||||||
let same_char = self
|
let same_char = self
|
||||||
.current_character_id()
|
.current_character_id()
|
||||||
.and_then(|curr| {
|
.and_then(|curr| {
|
||||||
|
|
@ -793,31 +780,25 @@ impl Night {
|
||||||
})
|
})
|
||||||
.unwrap_or_default();
|
.unwrap_or_default();
|
||||||
|
|
||||||
match (outcome, same_char) {
|
match (
|
||||||
(ResponseOutcome::PromptUpdate(p), _) => ResponseOutcome::PromptUpdate(p),
|
self.received_response_consecutive_wolves_dont_sleep(resp)?,
|
||||||
|
same_char,
|
||||||
|
) {
|
||||||
|
(ResponseOutcome::PromptUpdate(p), _) => Ok(ResponseOutcome::PromptUpdate(p)),
|
||||||
(
|
(
|
||||||
ResponseOutcome::ActionComplete(ActionComplete {
|
ResponseOutcome::ActionComplete(ActionComplete {
|
||||||
result: ActionResult::GoBackToSleep,
|
result: ActionResult::GoBackToSleep,
|
||||||
change,
|
change,
|
||||||
}),
|
}),
|
||||||
true,
|
true,
|
||||||
) => ResponseOutcome::ActionComplete(ActionComplete {
|
) => Ok(ResponseOutcome::ActionComplete(ActionComplete {
|
||||||
result: ActionResult::Continue,
|
result: ActionResult::Continue,
|
||||||
change,
|
change,
|
||||||
}),
|
})),
|
||||||
(act, _) => act,
|
(act, _) => Ok(act),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
fn received_response_consecutive_same_player_no_sleep(
|
|
||||||
&self,
|
|
||||||
resp: ActionResponse,
|
|
||||||
) -> Result<ResponseOutcome> {
|
|
||||||
Ok(self.outcome_consecutive_same_player_no_sleep(
|
|
||||||
self.received_response_consecutive_wolves_dont_sleep(resp)?,
|
|
||||||
))
|
|
||||||
}
|
|
||||||
|
|
||||||
fn received_response_consecutive_wolves_dont_sleep(
|
fn received_response_consecutive_wolves_dont_sleep(
|
||||||
&self,
|
&self,
|
||||||
resp: ActionResponse,
|
resp: ActionResponse,
|
||||||
|
|
@ -845,11 +826,7 @@ impl Night {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
|
||||||
match (
|
match (self.process(resp)?, current_wolfy, next_wolfy) {
|
||||||
self.received_response_with_auras(resp)?,
|
|
||||||
current_wolfy,
|
|
||||||
next_wolfy,
|
|
||||||
) {
|
|
||||||
(ResponseOutcome::PromptUpdate(p), _, _) => Ok(ResponseOutcome::PromptUpdate(p)),
|
(ResponseOutcome::PromptUpdate(p), _, _) => Ok(ResponseOutcome::PromptUpdate(p)),
|
||||||
(
|
(
|
||||||
ResponseOutcome::ActionComplete(ActionComplete {
|
ResponseOutcome::ActionComplete(ActionComplete {
|
||||||
|
|
@ -934,12 +911,6 @@ impl Night {
|
||||||
&self.village
|
&self.village
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(test)]
|
|
||||||
#[doc(hidden)]
|
|
||||||
pub const fn village_mut(&mut self) -> &mut Village {
|
|
||||||
&mut self.village
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const fn current_result(&self) -> Option<&ActionResult> {
|
pub const fn current_result(&self) -> Option<&ActionResult> {
|
||||||
match &self.night_state {
|
match &self.night_state {
|
||||||
NightState::Active {
|
NightState::Active {
|
||||||
|
|
@ -986,11 +957,6 @@ impl Night {
|
||||||
.and_then(|id| self.village.character_by_id(id).ok())
|
.and_then(|id| self.village.character_by_id(id).ok())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn current_character_mut(&mut self) -> Option<&mut Character> {
|
|
||||||
self.current_character_id()
|
|
||||||
.and_then(|id| self.village.character_by_id_mut(id).ok())
|
|
||||||
}
|
|
||||||
|
|
||||||
pub const fn complete(&self) -> bool {
|
pub const fn complete(&self) -> bool {
|
||||||
matches!(self.night_state, NightState::Complete)
|
matches!(self.night_state, NightState::Complete)
|
||||||
}
|
}
|
||||||
|
|
@ -1002,24 +968,99 @@ impl Night {
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn append_change(&mut self, change: NightChange) -> Result<()> {
|
#[allow(clippy::should_implement_trait)]
|
||||||
match &mut self.night_state {
|
pub fn next(&mut self) -> Result<()> {
|
||||||
|
match &self.night_state {
|
||||||
NightState::Active {
|
NightState::Active {
|
||||||
current_changes, ..
|
current_prompt,
|
||||||
|
current_result: CurrentResult::Result(ActionResult::Continue),
|
||||||
|
current_changes,
|
||||||
|
..
|
||||||
} => {
|
} => {
|
||||||
current_changes.push(change);
|
self.used_actions.push((
|
||||||
|
current_prompt.clone(),
|
||||||
|
ActionResult::Continue,
|
||||||
|
current_changes.clone(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
NightState::Active {
|
||||||
|
current_prompt,
|
||||||
|
current_result: CurrentResult::Result(ActionResult::GoBackToSleep),
|
||||||
|
current_changes,
|
||||||
|
..
|
||||||
|
} => {
|
||||||
|
self.used_actions.push((
|
||||||
|
current_prompt.clone(),
|
||||||
|
ActionResult::GoBackToSleep,
|
||||||
|
current_changes.clone(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
NightState::Active {
|
||||||
|
current_result: CurrentResult::Result(_),
|
||||||
|
..
|
||||||
|
} => {
|
||||||
|
// needs Continue, not Next
|
||||||
|
return Err(GameError::AwaitingResponse);
|
||||||
|
}
|
||||||
|
NightState::Active {
|
||||||
|
current_prompt,
|
||||||
|
current_result: CurrentResult::GoBackToSleepAfterShown { result_with_data },
|
||||||
|
current_changes,
|
||||||
|
..
|
||||||
|
} => {
|
||||||
|
self.used_actions.push((
|
||||||
|
current_prompt.clone(),
|
||||||
|
result_with_data.clone(),
|
||||||
|
current_changes.clone(),
|
||||||
|
));
|
||||||
|
}
|
||||||
|
NightState::Active {
|
||||||
|
current_prompt: _,
|
||||||
|
current_result: CurrentResult::None,
|
||||||
|
..
|
||||||
|
} => return Err(GameError::AwaitingResponse),
|
||||||
|
NightState::Complete => return Err(GameError::NightOver),
|
||||||
|
}
|
||||||
|
if let Some(prompt) = self.action_queue.pop_front() {
|
||||||
|
if let ActionPrompt::Insomniac { character_id } = &prompt
|
||||||
|
&& self.get_visits_for(character_id.character_id).is_empty()
|
||||||
|
{
|
||||||
|
// skip!
|
||||||
|
self.used_actions.pop(); // it will be re-added
|
||||||
|
return self.next();
|
||||||
|
}
|
||||||
|
self.night_state = NightState::Active {
|
||||||
|
current_prompt: prompt,
|
||||||
|
current_result: CurrentResult::None,
|
||||||
|
current_changes: Vec::new(),
|
||||||
|
current_page: 0,
|
||||||
|
};
|
||||||
|
} else {
|
||||||
|
self.night_state = NightState::Complete;
|
||||||
|
}
|
||||||
|
|
||||||
Ok(())
|
Ok(())
|
||||||
}
|
}
|
||||||
NightState::Complete => Err(GameError::NightOver),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
/// resolves whether the target [CharacterId] dies tonight with the current
|
/// resolves whether the target [CharacterId] dies tonight with the current
|
||||||
/// state of the night and returns the [DiedTo] cause of death
|
/// state of the night
|
||||||
fn died_to_tonight(&self, character_id: CharacterId) -> Result<Option<DiedTo>> {
|
fn dies_tonight(&self, character_id: CharacterId) -> Result<bool> {
|
||||||
let ch = self.current_changes();
|
let ch = self.current_changes();
|
||||||
let mut changes = ChangesLookup::new(&ch);
|
let mut changes = ChangesLookup::new(&ch);
|
||||||
changes.died_to(character_id, self.night, &self.village)
|
if let Some(died_to) = changes.killed(character_id)
|
||||||
|
&& kill::resolve_kill(
|
||||||
|
&mut changes,
|
||||||
|
character_id,
|
||||||
|
died_to,
|
||||||
|
self.night,
|
||||||
|
&self.village,
|
||||||
|
)?
|
||||||
|
.is_some()
|
||||||
|
{
|
||||||
|
Ok(true)
|
||||||
|
} else {
|
||||||
|
Ok(false)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
/// returns the matching [Character] with the current night's aura changes
|
/// returns the matching [Character] with the current night's aura changes
|
||||||
|
|
@ -1044,16 +1085,6 @@ impl Night {
|
||||||
.iter()
|
.iter()
|
||||||
.flat_map(|(_, _, act)| act.iter())
|
.flat_map(|(_, _, act)| act.iter())
|
||||||
.cloned()
|
.cloned()
|
||||||
.chain(
|
|
||||||
match &self.night_state {
|
|
||||||
NightState::Active {
|
|
||||||
current_changes, ..
|
|
||||||
} => Some(current_changes.iter().cloned()),
|
|
||||||
NightState::Complete => None,
|
|
||||||
}
|
|
||||||
.into_iter()
|
|
||||||
.flatten(),
|
|
||||||
)
|
|
||||||
.collect()
|
.collect()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1061,9 +1092,6 @@ impl Night {
|
||||||
Visits::new(
|
Visits::new(
|
||||||
self.used_actions
|
self.used_actions
|
||||||
.iter()
|
.iter()
|
||||||
.filter(|(_, result, _)| {
|
|
||||||
!matches!(result, ActionResult::Drunk | ActionResult::RoleBlocked)
|
|
||||||
})
|
|
||||||
.filter_map(|(prompt, _, _)| match prompt {
|
.filter_map(|(prompt, _, _)| match prompt {
|
||||||
ActionPrompt::Arcanist {
|
ActionPrompt::Arcanist {
|
||||||
character_id,
|
character_id,
|
||||||
|
|
@ -1174,8 +1202,7 @@ impl Night {
|
||||||
..
|
..
|
||||||
} => (*marked == visit_char).then(|| character_id.clone()),
|
} => (*marked == visit_char).then(|| character_id.clone()),
|
||||||
|
|
||||||
ActionPrompt::TraitorIntro { .. }
|
ActionPrompt::Bloodletter { .. }
|
||||||
| ActionPrompt::Bloodletter { .. }
|
|
||||||
| ActionPrompt::WolfPackKill { marked: None, .. }
|
| ActionPrompt::WolfPackKill { marked: None, .. }
|
||||||
| ActionPrompt::Arcanist { marked: _, .. }
|
| ActionPrompt::Arcanist { marked: _, .. }
|
||||||
| ActionPrompt::LoneWolfKill { marked: None, .. }
|
| ActionPrompt::LoneWolfKill { marked: None, .. }
|
||||||
|
|
|
||||||
|
|
@ -12,9 +12,8 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use core::{num::NonZeroU8, ops::Not};
|
use core::ops::Not;
|
||||||
|
|
||||||
use super::Result;
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use werewolves_macros::Extract;
|
use werewolves_macros::Extract;
|
||||||
|
|
||||||
|
|
@ -22,10 +21,6 @@ use crate::{
|
||||||
aura::Aura,
|
aura::Aura,
|
||||||
character::CharacterId,
|
character::CharacterId,
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
game::{
|
|
||||||
Village,
|
|
||||||
kill::{self, KillOutcome},
|
|
||||||
},
|
|
||||||
player::Protection,
|
player::Protection,
|
||||||
role::{RoleBlock, RoleTitle},
|
role::{RoleBlock, RoleTitle},
|
||||||
};
|
};
|
||||||
|
|
@ -76,29 +71,6 @@ pub enum NightChange {
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
||||||
impl NightChange {
|
|
||||||
pub const fn target(&self) -> Option<CharacterId> {
|
|
||||||
match self {
|
|
||||||
NightChange::HunterTarget { target, .. }
|
|
||||||
| NightChange::Kill { target, .. }
|
|
||||||
| NightChange::RoleBlock { target, .. }
|
|
||||||
| NightChange::Shapeshift { into: target, .. }
|
|
||||||
| NightChange::Protection { target, .. }
|
|
||||||
| NightChange::MasonRecruit {
|
|
||||||
recruiting: target, ..
|
|
||||||
}
|
|
||||||
| NightChange::EmpathFoundScapegoat {
|
|
||||||
scapegoat: target, ..
|
|
||||||
}
|
|
||||||
| NightChange::ApplyAura { target, .. } => Some(*target),
|
|
||||||
|
|
||||||
NightChange::ElderReveal { .. }
|
|
||||||
| NightChange::RoleChange(..)
|
|
||||||
| NightChange::LostAura { .. } => None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub struct ChangesLookup<'a>(&'a [NightChange], Vec<usize>);
|
pub struct ChangesLookup<'a>(&'a [NightChange], Vec<usize>);
|
||||||
|
|
||||||
impl<'a> ChangesLookup<'a> {
|
impl<'a> ChangesLookup<'a> {
|
||||||
|
|
@ -106,67 +78,6 @@ impl<'a> ChangesLookup<'a> {
|
||||||
Self(changes, Vec::new())
|
Self(changes, Vec::new())
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn collect_remaining(&self) -> Box<[NightChange]> {
|
|
||||||
self.0
|
|
||||||
.iter()
|
|
||||||
.enumerate()
|
|
||||||
.filter_map(|(idx, c)| self.1.contains(&idx).not().then_some(c))
|
|
||||||
.cloned()
|
|
||||||
.collect()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn kill_outcomes(&self, night: u8, village: &Village) -> Result<Box<[KillOutcome]>> {
|
|
||||||
self.0
|
|
||||||
.iter()
|
|
||||||
.filter_map(|c| match c {
|
|
||||||
NightChange::Kill { target, died_to } => Some((*target, died_to.clone())),
|
|
||||||
_ => None,
|
|
||||||
})
|
|
||||||
.map(|(kill_target, died_to)| {
|
|
||||||
kill::resolve_kill(self, kill_target, &died_to, night, village)
|
|
||||||
})
|
|
||||||
.filter_map(|result| match result {
|
|
||||||
Ok(Some(outcome)) => Some(Ok(outcome)),
|
|
||||||
Ok(None) => None,
|
|
||||||
Err(err) => Some(Err(err)),
|
|
||||||
})
|
|
||||||
.collect::<Result<Box<[_]>>>()
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn died_to(
|
|
||||||
&self,
|
|
||||||
character_id: CharacterId,
|
|
||||||
night: u8,
|
|
||||||
village: &Village,
|
|
||||||
) -> Result<Option<DiedTo>> {
|
|
||||||
let kill_outcomes = self.kill_outcomes(night, village)?;
|
|
||||||
|
|
||||||
Ok(kill_outcomes.into_iter().find_map(|outcome| match outcome {
|
|
||||||
KillOutcome::Single(target, died_to) => (target == character_id).then_some(died_to),
|
|
||||||
KillOutcome::Guarding {
|
|
||||||
original_killer,
|
|
||||||
original_target,
|
|
||||||
original_kill,
|
|
||||||
guardian,
|
|
||||||
night,
|
|
||||||
} => {
|
|
||||||
if original_killer == character_id {
|
|
||||||
Some(DiedTo::GuardianProtecting {
|
|
||||||
source: guardian,
|
|
||||||
protecting: original_target,
|
|
||||||
protecting_from: original_killer,
|
|
||||||
protecting_from_cause: Box::new(original_kill),
|
|
||||||
night,
|
|
||||||
})
|
|
||||||
} else if guardian == character_id {
|
|
||||||
Some(original_kill)
|
|
||||||
} else {
|
|
||||||
None
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}))
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn killed(&self, target: CharacterId) -> Option<&'a DiedTo> {
|
pub fn killed(&self, target: CharacterId) -> Option<&'a DiedTo> {
|
||||||
self.0.iter().enumerate().find_map(|(idx, c)| {
|
self.0.iter().enumerate().find_map(|(idx, c)| {
|
||||||
self.1
|
self.1
|
||||||
|
|
@ -200,7 +111,7 @@ impl<'a> ChangesLookup<'a> {
|
||||||
None
|
None
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
pub fn protected(&self, target: CharacterId) -> Option<&'a Protection> {
|
pub fn protected(&self, target: &CharacterId) -> Option<&'a Protection> {
|
||||||
self.0.iter().enumerate().find_map(|(idx, c)| {
|
self.0.iter().enumerate().find_map(|(idx, c)| {
|
||||||
self.1
|
self.1
|
||||||
.contains(&idx)
|
.contains(&idx)
|
||||||
|
|
@ -209,27 +120,20 @@ impl<'a> ChangesLookup<'a> {
|
||||||
NightChange::Protection {
|
NightChange::Protection {
|
||||||
target: t,
|
target: t,
|
||||||
protection,
|
protection,
|
||||||
} => (*t == target).then_some(protection),
|
} => (t == target).then_some(protection),
|
||||||
_ => None,
|
_ => None,
|
||||||
})
|
})
|
||||||
.flatten()
|
.flatten()
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn shapeshifter(&self) -> Option<CharacterId> {
|
pub fn shapeshifter(&self) -> Option<&'a CharacterId> {
|
||||||
self.shapeshift_change().and_then(|c| match c {
|
|
||||||
NightChange::Shapeshift { source, .. } => Some(source),
|
|
||||||
_ => None,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
|
|
||||||
pub fn shapeshift_change(&self) -> Option<NightChange> {
|
|
||||||
self.0.iter().enumerate().find_map(|(idx, c)| {
|
self.0.iter().enumerate().find_map(|(idx, c)| {
|
||||||
self.1
|
self.1
|
||||||
.contains(&idx)
|
.contains(&idx)
|
||||||
.not()
|
.not()
|
||||||
.then_some(match c {
|
.then_some(match c {
|
||||||
NightChange::Shapeshift { .. } => Some(c.clone()),
|
NightChange::Shapeshift { source, .. } => Some(source),
|
||||||
_ => None,
|
_ => None,
|
||||||
})
|
})
|
||||||
.flatten()
|
.flatten()
|
||||||
|
|
|
||||||
|
|
@ -1,212 +0,0 @@
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
use core::num::NonZeroU8;
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
character::CharacterId,
|
|
||||||
diedto::DiedTo,
|
|
||||||
error::GameError,
|
|
||||||
game::night::{CurrentResult, Night, NightState, changes::NightChange},
|
|
||||||
message::night::{ActionPrompt, ActionResult},
|
|
||||||
role::{RoleBlock, RoleTitle},
|
|
||||||
};
|
|
||||||
|
|
||||||
use super::Result;
|
|
||||||
impl Night {
|
|
||||||
#[allow(clippy::should_implement_trait)]
|
|
||||||
pub fn next(&mut self) -> Result<()> {
|
|
||||||
self.retroactive_role_blocks()?;
|
|
||||||
self.next_state_process_maple_starving()?;
|
|
||||||
|
|
||||||
match &self.night_state {
|
|
||||||
NightState::Active {
|
|
||||||
current_prompt,
|
|
||||||
current_result: CurrentResult::Result(ActionResult::Continue),
|
|
||||||
current_changes,
|
|
||||||
..
|
|
||||||
} => {
|
|
||||||
self.used_actions.push((
|
|
||||||
current_prompt.clone(),
|
|
||||||
ActionResult::Continue,
|
|
||||||
current_changes.clone(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
NightState::Active {
|
|
||||||
current_prompt,
|
|
||||||
current_result: CurrentResult::Result(ActionResult::GoBackToSleep),
|
|
||||||
current_changes,
|
|
||||||
..
|
|
||||||
} => {
|
|
||||||
self.used_actions.push((
|
|
||||||
current_prompt.clone(),
|
|
||||||
ActionResult::GoBackToSleep,
|
|
||||||
current_changes.clone(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
NightState::Active {
|
|
||||||
current_result: CurrentResult::Result(_),
|
|
||||||
..
|
|
||||||
} => {
|
|
||||||
// needs Continue, not Next
|
|
||||||
return Err(GameError::AwaitingResponse);
|
|
||||||
}
|
|
||||||
NightState::Active {
|
|
||||||
current_prompt,
|
|
||||||
current_result: CurrentResult::GoBackToSleepAfterShown { result_with_data },
|
|
||||||
current_changes,
|
|
||||||
..
|
|
||||||
} => {
|
|
||||||
self.used_actions.push((
|
|
||||||
current_prompt.clone(),
|
|
||||||
result_with_data.clone(),
|
|
||||||
current_changes.clone(),
|
|
||||||
));
|
|
||||||
}
|
|
||||||
NightState::Active {
|
|
||||||
current_prompt: _,
|
|
||||||
current_result: CurrentResult::None,
|
|
||||||
..
|
|
||||||
} => return Err(GameError::AwaitingResponse),
|
|
||||||
NightState::Complete => return Err(GameError::NightOver),
|
|
||||||
}
|
|
||||||
if let Some(prompt) = self.pull_next_prompt_with_dead_ignore()? {
|
|
||||||
if let ActionPrompt::Insomniac { character_id } = &prompt
|
|
||||||
&& self.get_visits_for(character_id.character_id).is_empty()
|
|
||||||
{
|
|
||||||
// skip!
|
|
||||||
self.used_actions.pop(); // it will be re-added
|
|
||||||
return self.next();
|
|
||||||
}
|
|
||||||
self.night_state = NightState::Active {
|
|
||||||
current_prompt: prompt,
|
|
||||||
current_result: CurrentResult::None,
|
|
||||||
current_changes: Vec::new(),
|
|
||||||
current_page: 0,
|
|
||||||
};
|
|
||||||
} else {
|
|
||||||
self.night_state = NightState::Complete;
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn next_state_process_maple_starving(&mut self) -> Result<()> {
|
|
||||||
let (maple_id, target) = match self.current_prompt() {
|
|
||||||
Some((
|
|
||||||
ActionPrompt::MapleWolf {
|
|
||||||
character_id,
|
|
||||||
kill_or_die,
|
|
||||||
marked,
|
|
||||||
..
|
|
||||||
},
|
|
||||||
_,
|
|
||||||
)) => {
|
|
||||||
if *kill_or_die {
|
|
||||||
(character_id.character_id, *marked)
|
|
||||||
} else {
|
|
||||||
return Ok(());
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some(_) | None => return Ok(()),
|
|
||||||
};
|
|
||||||
|
|
||||||
let starve_change = if let Some(night) = NonZeroU8::new(self.night) {
|
|
||||||
NightChange::Kill {
|
|
||||||
target: maple_id,
|
|
||||||
died_to: DiedTo::MapleWolfStarved { night },
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
return Ok(());
|
|
||||||
};
|
|
||||||
|
|
||||||
let Some(target) = target else {
|
|
||||||
return self.append_change(starve_change);
|
|
||||||
};
|
|
||||||
match self.died_to_tonight(target)? {
|
|
||||||
Some(DiedTo::MapleWolf { source, .. }) => {
|
|
||||||
if source != maple_id {
|
|
||||||
self.append_change(starve_change)?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Some(_) | None => {
|
|
||||||
self.append_change(starve_change)?;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn retroactive_role_blocks(&mut self) -> Result<()> {
|
|
||||||
let blocks = match &self.night_state {
|
|
||||||
NightState::Active {
|
|
||||||
current_changes, ..
|
|
||||||
} => current_changes
|
|
||||||
.iter()
|
|
||||||
.filter_map(|c| match c {
|
|
||||||
NightChange::RoleBlock {
|
|
||||||
target, block_type, ..
|
|
||||||
} => Some((*target, *block_type)),
|
|
||||||
_ => None,
|
|
||||||
})
|
|
||||||
.collect::<Box<[_]>>(),
|
|
||||||
NightState::Complete => return Err(GameError::NightOver),
|
|
||||||
};
|
|
||||||
for (target, block_type) in blocks {
|
|
||||||
match block_type {
|
|
||||||
RoleBlock::Direwolf => self.apply_direwolf_block_retroactively(target),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn apply_direwolf_block_retroactively(&mut self, target: CharacterId) {
|
|
||||||
self.used_actions
|
|
||||||
.iter_mut()
|
|
||||||
.filter_map(|(prompt, res, changes)| match prompt.marked() {
|
|
||||||
Some((marked, None)) => (marked == target).then_some((res, changes)),
|
|
||||||
Some((marked1, Some(marked2))) => {
|
|
||||||
(marked1 == target || marked2 == target).then_some((res, changes))
|
|
||||||
}
|
|
||||||
None => None,
|
|
||||||
})
|
|
||||||
.for_each(|(result, changes)| {
|
|
||||||
changes.clear();
|
|
||||||
*result = ActionResult::RoleBlocked;
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
fn pull_next_prompt_with_dead_ignore(&mut self) -> Result<Option<ActionPrompt>> {
|
|
||||||
let has_living_beholder = self
|
|
||||||
.village
|
|
||||||
.characters()
|
|
||||||
.into_iter()
|
|
||||||
.any(|c| matches!(c.role_title(), RoleTitle::Beholder));
|
|
||||||
while let Some(prompt) = self.action_queue.pop_front() {
|
|
||||||
let Some(char_id) = prompt.character_id() else {
|
|
||||||
return Ok(Some(prompt));
|
|
||||||
};
|
|
||||||
match (self.died_to_tonight(char_id)?, has_living_beholder) {
|
|
||||||
(Some(_), false) => {}
|
|
||||||
(Some(DiedTo::Shapeshift { .. }), _) | (Some(_), true) | (None, _) => {
|
|
||||||
return Ok(Some(prompt));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
Ok(None)
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -16,7 +16,6 @@ use core::num::NonZeroU8;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
aura::Aura,
|
aura::Aura,
|
||||||
bag::DrunkRoll,
|
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
error::GameError,
|
error::GameError,
|
||||||
game::night::{
|
game::night::{
|
||||||
|
|
@ -80,7 +79,7 @@ impl Night {
|
||||||
.ok_or(GameError::InvalidTarget)?,
|
.ok_or(GameError::InvalidTarget)?,
|
||||||
}),
|
}),
|
||||||
})),
|
})),
|
||||||
_ => Err(GameError::ShapeshiftingIsForShapeshifters),
|
_ => Err(GameError::InvalidMessageForGameState),
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
ActionResponse::Continue => {
|
ActionResponse::Continue => {
|
||||||
|
|
@ -107,19 +106,13 @@ impl Night {
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
ActionResponse::ContinueToResult => return self.process(ActionResponse::Continue),
|
|
||||||
};
|
};
|
||||||
|
|
||||||
match current_prompt {
|
match current_prompt {
|
||||||
ActionPrompt::TraitorIntro { .. } => Ok(ActionComplete {
|
|
||||||
result: ActionResult::GoBackToSleep,
|
|
||||||
change: None,
|
|
||||||
}
|
|
||||||
.into()),
|
|
||||||
ActionPrompt::Bloodletter {
|
ActionPrompt::Bloodletter {
|
||||||
character_id,
|
character_id,
|
||||||
|
living_players,
|
||||||
marked: Some(marked),
|
marked: Some(marked),
|
||||||
..
|
|
||||||
} => Ok(ActionComplete {
|
} => Ok(ActionComplete {
|
||||||
result: ActionResult::GoBackToSleep,
|
result: ActionResult::GoBackToSleep,
|
||||||
change: Some(NightChange::ApplyAura {
|
change: Some(NightChange::ApplyAura {
|
||||||
|
|
@ -229,7 +222,7 @@ impl Night {
|
||||||
died_to: DiedTo::Militia {
|
died_to: DiedTo::Militia {
|
||||||
killer: character_id.character_id,
|
killer: character_id.character_id,
|
||||||
night: NonZeroU8::new(self.night)
|
night: NonZeroU8::new(self.night)
|
||||||
.ok_or(GameError::CannotHappenOnNightZero)?,
|
.ok_or(GameError::InvalidMessageForGameState)?,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
})),
|
})),
|
||||||
|
|
@ -243,11 +236,12 @@ impl Night {
|
||||||
..
|
..
|
||||||
} => Ok(ResponseOutcome::ActionComplete(ActionComplete {
|
} => Ok(ResponseOutcome::ActionComplete(ActionComplete {
|
||||||
result: ActionResult::GoBackToSleep,
|
result: ActionResult::GoBackToSleep,
|
||||||
change: NonZeroU8::new(self.night).map(|night| NightChange::Kill {
|
change: Some(NightChange::Kill {
|
||||||
target: *marked,
|
target: *marked,
|
||||||
died_to: DiedTo::MapleWolf {
|
died_to: DiedTo::MapleWolf {
|
||||||
night,
|
|
||||||
source: character_id.character_id,
|
source: character_id.character_id,
|
||||||
|
night: NonZeroU8::new(self.night)
|
||||||
|
.ok_or(GameError::InvalidMessageForGameState)?,
|
||||||
starves_if_fails: *kill_or_die,
|
starves_if_fails: *kill_or_die,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
|
|
@ -319,7 +313,7 @@ impl Night {
|
||||||
.ok_or(GameError::NoWolves)?
|
.ok_or(GameError::NoWolves)?
|
||||||
.character_id(),
|
.character_id(),
|
||||||
night: NonZeroU8::new(self.night)
|
night: NonZeroU8::new(self.night)
|
||||||
.ok_or(GameError::CannotHappenOnNightZero)?,
|
.ok_or(GameError::InvalidMessageForGameState)?,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
})),
|
})),
|
||||||
|
|
@ -342,7 +336,7 @@ impl Night {
|
||||||
})
|
})
|
||||||
.ok_or(GameError::InvalidTarget)?,
|
.ok_or(GameError::InvalidTarget)?,
|
||||||
}),
|
}),
|
||||||
_ => return Err(GameError::ShapeshiftingIsForShapeshifters),
|
_ => return Err(GameError::InvalidMessageForGameState),
|
||||||
},
|
},
|
||||||
}))
|
}))
|
||||||
}
|
}
|
||||||
|
|
@ -357,7 +351,7 @@ impl Night {
|
||||||
died_to: DiedTo::AlphaWolf {
|
died_to: DiedTo::AlphaWolf {
|
||||||
killer: character_id.character_id,
|
killer: character_id.character_id,
|
||||||
night: NonZeroU8::new(self.night)
|
night: NonZeroU8::new(self.night)
|
||||||
.ok_or(GameError::CannotHappenOnNightZero)?,
|
.ok_or(GameError::InvalidMessageForGameState)?,
|
||||||
},
|
},
|
||||||
}),
|
}),
|
||||||
})),
|
})),
|
||||||
|
|
@ -416,11 +410,10 @@ impl Night {
|
||||||
} => {
|
} => {
|
||||||
if let Some(result) = self.used_actions.iter().find_map(|(prompt, result, _)| {
|
if let Some(result) = self.used_actions.iter().find_map(|(prompt, result, _)| {
|
||||||
prompt.matches_beholding(*marked).then_some(result)
|
prompt.matches_beholding(*marked).then_some(result)
|
||||||
}) && self.died_to_tonight(*marked)?.is_some()
|
}) && self.dies_tonight(*marked)?
|
||||||
{
|
{
|
||||||
Ok(ActionComplete {
|
Ok(ActionComplete {
|
||||||
result: if matches!(result, ActionResult::RoleBlocked | ActionResult::Drunk)
|
result: if matches!(result, ActionResult::RoleBlocked) {
|
||||||
{
|
|
||||||
ActionResult::BeholderSawNothing
|
ActionResult::BeholderSawNothing
|
||||||
} else {
|
} else {
|
||||||
result.clone()
|
result.clone()
|
||||||
|
|
@ -538,57 +531,7 @@ impl Night {
|
||||||
| ActionPrompt::Guardian { marked: None, .. }
|
| ActionPrompt::Guardian { marked: None, .. }
|
||||||
| ActionPrompt::WolfPackKill { marked: None, .. }
|
| ActionPrompt::WolfPackKill { marked: None, .. }
|
||||||
| ActionPrompt::DireWolf { marked: None, .. }
|
| ActionPrompt::DireWolf { marked: None, .. }
|
||||||
| ActionPrompt::Seer { marked: None, .. } => Err(GameError::MustSelectTarget),
|
| ActionPrompt::Seer { marked: None, .. } => Err(GameError::InvalidMessageForGameState),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub(super) fn received_response_with_auras(
|
|
||||||
&self,
|
|
||||||
resp: ActionResponse,
|
|
||||||
) -> Result<ResponseOutcome> {
|
|
||||||
let outcome = self.process(resp)?;
|
|
||||||
if matches!(
|
|
||||||
self.current_prompt(),
|
|
||||||
Some((ActionPrompt::TraitorIntro { .. }, _))
|
|
||||||
| Some((ActionPrompt::RoleChange { .. }, _))
|
|
||||||
| Some((ActionPrompt::ElderReveal { .. }, _))
|
|
||||||
) {
|
|
||||||
return Ok(outcome);
|
|
||||||
}
|
|
||||||
let mut act = match outcome {
|
|
||||||
ResponseOutcome::PromptUpdate(prompt) => {
|
|
||||||
return Ok(ResponseOutcome::PromptUpdate(prompt));
|
|
||||||
}
|
|
||||||
ResponseOutcome::ActionComplete(ActionComplete {
|
|
||||||
result: ActionResult::Drunk,
|
|
||||||
..
|
|
||||||
})
|
|
||||||
| ResponseOutcome::ActionComplete(ActionComplete {
|
|
||||||
result: ActionResult::RoleBlocked,
|
|
||||||
..
|
|
||||||
}) => return Ok(outcome),
|
|
||||||
ResponseOutcome::ActionComplete(act) => act,
|
|
||||||
};
|
|
||||||
let Some(char) = self.current_character() else {
|
|
||||||
return Ok(ResponseOutcome::ActionComplete(act));
|
|
||||||
};
|
|
||||||
for aura in char.auras() {
|
|
||||||
match aura {
|
|
||||||
Aura::Traitor | Aura::Bloodlet { .. } => continue,
|
|
||||||
Aura::Drunk(bag) => {
|
|
||||||
if bag.peek() == DrunkRoll::Drunk {
|
|
||||||
act.change = None;
|
|
||||||
act.result = ActionResult::Drunk;
|
|
||||||
return Ok(ResponseOutcome::ActionComplete(act));
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Aura::Insane => {
|
|
||||||
if let Some(insane_result) = act.result.insane() {
|
|
||||||
act.result = insane_result;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
Ok(ResponseOutcome::ActionComplete(act))
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -23,7 +23,7 @@ use uuid::Uuid;
|
||||||
use werewolves_macros::{All, ChecksAs, Titles};
|
use werewolves_macros::{All, ChecksAs, Titles};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
aura::AuraTitle,
|
aura::Aura,
|
||||||
character::Character,
|
character::Character,
|
||||||
error::GameError,
|
error::GameError,
|
||||||
message::Identification,
|
message::Identification,
|
||||||
|
|
@ -157,46 +157,6 @@ pub enum SetupRole {
|
||||||
}
|
}
|
||||||
|
|
||||||
impl SetupRoleTitle {
|
impl SetupRoleTitle {
|
||||||
pub fn can_assign_aura(&self, aura: AuraTitle) -> bool {
|
|
||||||
if self.into_role().title().wolf() {
|
|
||||||
return match aura {
|
|
||||||
AuraTitle::Traitor | AuraTitle::Bloodlet | AuraTitle::Insane => false,
|
|
||||||
AuraTitle::Drunk => !matches!(self, SetupRoleTitle::Werewolf),
|
|
||||||
};
|
|
||||||
}
|
|
||||||
match aura {
|
|
||||||
AuraTitle::Traitor => true,
|
|
||||||
AuraTitle::Drunk => {
|
|
||||||
matches!(
|
|
||||||
self.category(),
|
|
||||||
Category::StartsAsVillager
|
|
||||||
| Category::Defensive
|
|
||||||
| Category::Intel
|
|
||||||
| Category::Offensive
|
|
||||||
) && !matches!(
|
|
||||||
self,
|
|
||||||
Self::Elder
|
|
||||||
| Self::BlackKnight
|
|
||||||
| Self::Diseased
|
|
||||||
| Self::Weightlifter
|
|
||||||
| Self::Insomniac
|
|
||||||
| Self::Mortician
|
|
||||||
)
|
|
||||||
}
|
|
||||||
AuraTitle::Insane => {
|
|
||||||
matches!(self.category(), Category::Intel)
|
|
||||||
&& !matches!(
|
|
||||||
self,
|
|
||||||
Self::MasonLeader
|
|
||||||
| Self::Empath
|
|
||||||
| Self::Insomniac
|
|
||||||
| Self::Mortician
|
|
||||||
| Self::Gravedigger
|
|
||||||
)
|
|
||||||
}
|
|
||||||
AuraTitle::Bloodlet => false,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub fn into_role(self) -> Role {
|
pub fn into_role(self) -> Role {
|
||||||
match self {
|
match self {
|
||||||
SetupRoleTitle::Bloodletter => Role::Bloodletter,
|
SetupRoleTitle::Bloodletter => Role::Bloodletter,
|
||||||
|
|
@ -419,7 +379,7 @@ impl SlotId {
|
||||||
pub struct SetupSlot {
|
pub struct SetupSlot {
|
||||||
pub slot_id: SlotId,
|
pub slot_id: SlotId,
|
||||||
pub role: SetupRole,
|
pub role: SetupRole,
|
||||||
pub auras: Vec<AuraTitle>,
|
pub auras: Vec<Aura>,
|
||||||
pub assign_to: Option<PlayerId>,
|
pub assign_to: Option<PlayerId>,
|
||||||
pub created_order: u32,
|
pub created_order: u32,
|
||||||
}
|
}
|
||||||
|
|
@ -443,10 +403,7 @@ impl SetupSlot {
|
||||||
Character::new(
|
Character::new(
|
||||||
ident.clone(),
|
ident.clone(),
|
||||||
self.role.into_role(roles_in_game)?,
|
self.role.into_role(roles_in_game)?,
|
||||||
self.auras
|
self.auras,
|
||||||
.into_iter()
|
|
||||||
.map(|aura| aura.into_aura())
|
|
||||||
.collect(),
|
|
||||||
)
|
)
|
||||||
.ok_or(GameError::PlayerNotAssignedNumber(ident.to_string()))
|
.ok_or(GameError::PlayerNotAssignedNumber(ident.to_string()))
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -84,18 +84,12 @@ pub enum StoryActionResult {
|
||||||
Insomniac { visits: Box<[CharacterId]> },
|
Insomniac { visits: Box<[CharacterId]> },
|
||||||
Empath { scapegoat: bool },
|
Empath { scapegoat: bool },
|
||||||
BeholderSawNothing,
|
BeholderSawNothing,
|
||||||
BeholderSawEverything,
|
|
||||||
Drunk,
|
|
||||||
ShiftFailed,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl StoryActionResult {
|
impl StoryActionResult {
|
||||||
pub fn new(result: ActionResult) -> Option<Self> {
|
pub fn new(result: ActionResult) -> Option<Self> {
|
||||||
Some(match result {
|
Some(match result {
|
||||||
ActionResult::ShiftFailed => Self::ShiftFailed,
|
|
||||||
ActionResult::BeholderSawNothing => Self::BeholderSawNothing,
|
ActionResult::BeholderSawNothing => Self::BeholderSawNothing,
|
||||||
ActionResult::BeholderSawEverything => Self::BeholderSawEverything,
|
|
||||||
ActionResult::Drunk => Self::Drunk,
|
|
||||||
ActionResult::RoleBlocked => Self::RoleBlocked,
|
ActionResult::RoleBlocked => Self::RoleBlocked,
|
||||||
ActionResult::Seer(alignment) => Self::Seer(alignment),
|
ActionResult::Seer(alignment) => Self::Seer(alignment),
|
||||||
ActionResult::PowerSeer { powerful } => Self::PowerSeer { powerful },
|
ActionResult::PowerSeer { powerful } => Self::PowerSeer { powerful },
|
||||||
|
|
@ -396,8 +390,7 @@ impl StoryActionPrompt {
|
||||||
character_id: character_id.character_id,
|
character_id: character_id.character_id,
|
||||||
},
|
},
|
||||||
|
|
||||||
ActionPrompt::TraitorIntro { .. }
|
ActionPrompt::Bloodletter { .. }
|
||||||
| ActionPrompt::Bloodletter { .. }
|
|
||||||
| ActionPrompt::Protector { .. }
|
| ActionPrompt::Protector { .. }
|
||||||
| ActionPrompt::Gravedigger { .. }
|
| ActionPrompt::Gravedigger { .. }
|
||||||
| ActionPrompt::Hunter { .. }
|
| ActionPrompt::Hunter { .. }
|
||||||
|
|
@ -455,7 +448,7 @@ impl GameStory {
|
||||||
village = match actions {
|
village = match actions {
|
||||||
GameActions::DayDetails(day_details) => village.with_day_changes(day_details)?,
|
GameActions::DayDetails(day_details) => village.with_day_changes(day_details)?,
|
||||||
GameActions::NightDetails(night_details) => {
|
GameActions::NightDetails(night_details) => {
|
||||||
village.with_night_changes(&night_details.changes)?.0
|
village.with_night_changes(&night_details.changes)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
@ -468,7 +461,7 @@ impl GameStory {
|
||||||
village = match actions {
|
village = match actions {
|
||||||
GameActions::DayDetails(day_details) => village.with_day_changes(day_details)?,
|
GameActions::DayDetails(day_details) => village.with_day_changes(day_details)?,
|
||||||
GameActions::NightDetails(night_details) => {
|
GameActions::NightDetails(night_details) => {
|
||||||
village.with_night_changes(&night_details.changes)?.0
|
village.with_night_changes(&night_details.changes)?
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
if time == at_time {
|
if time == at_time {
|
||||||
|
|
|
||||||
|
|
@ -20,6 +20,7 @@ use serde::{Deserialize, Serialize};
|
||||||
|
|
||||||
use super::Result;
|
use super::Result;
|
||||||
use crate::{
|
use crate::{
|
||||||
|
aura::Aura,
|
||||||
character::{Character, CharacterId},
|
character::{Character, CharacterId},
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
error::GameError,
|
error::GameError,
|
||||||
|
|
|
||||||
|
|
@ -12,15 +12,14 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use core::{num::NonZeroU8, ops::Not};
|
use core::num::NonZeroU8;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
aura::Aura,
|
aura::Aura,
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
error::GameError,
|
error::GameError,
|
||||||
game::{
|
game::{
|
||||||
GameTime, Village,
|
GameTime, Village, kill,
|
||||||
kill::{self, KillOutcome},
|
|
||||||
night::changes::{ChangesLookup, NightChange},
|
night::changes::{ChangesLookup, NightChange},
|
||||||
story::DayDetail,
|
story::DayDetail,
|
||||||
},
|
},
|
||||||
|
|
@ -44,41 +43,19 @@ impl Village {
|
||||||
|
|
||||||
Ok(new_village)
|
Ok(new_village)
|
||||||
}
|
}
|
||||||
pub fn with_night_changes(
|
pub fn with_night_changes(&self, all_changes: &[NightChange]) -> Result<Self> {
|
||||||
&self,
|
|
||||||
all_changes: &[NightChange],
|
|
||||||
) -> Result<(Self, Box<[NightChange]>)> {
|
|
||||||
let night = match self.time {
|
let night = match self.time {
|
||||||
GameTime::Day { .. } => return Err(GameError::NotNight),
|
GameTime::Day { .. } => return Err(GameError::NotNight),
|
||||||
GameTime::Night { number } => number,
|
GameTime::Night { number } => number,
|
||||||
};
|
};
|
||||||
let changes = ChangesLookup::new(all_changes);
|
let mut changes = ChangesLookup::new(all_changes);
|
||||||
|
|
||||||
let mut new_village = self.clone();
|
let mut new_village = self.clone();
|
||||||
|
|
||||||
// recorded changes: changes sans failed kills, actions failed due to blocks, etc
|
|
||||||
let mut recorded_changes = all_changes.to_vec();
|
|
||||||
|
|
||||||
// dispose of the current drunk token for every drunk in the village
|
|
||||||
new_village
|
|
||||||
.characters_mut()
|
|
||||||
.iter_mut()
|
|
||||||
.filter_map(|c| {
|
|
||||||
c.auras_mut().iter_mut().find_map(|a| match a {
|
|
||||||
Aura::Drunk(bag) => Some(bag),
|
|
||||||
_ => None,
|
|
||||||
})
|
|
||||||
})
|
|
||||||
.for_each(|bag| {
|
|
||||||
// dispose of a token
|
|
||||||
let _ = bag.pull();
|
|
||||||
});
|
|
||||||
|
|
||||||
for change in all_changes {
|
for change in all_changes {
|
||||||
match change {
|
match change {
|
||||||
NightChange::ApplyAura { target, aura, .. } => {
|
NightChange::ApplyAura { target, aura, .. } => {
|
||||||
let target = new_village.character_by_id_mut(*target)?;
|
let target = new_village.character_by_id_mut(*target)?;
|
||||||
target.apply_aura(aura.clone());
|
target.apply_aura(*aura);
|
||||||
}
|
}
|
||||||
NightChange::ElderReveal { elder } => {
|
NightChange::ElderReveal { elder } => {
|
||||||
new_village.character_by_id_mut(*elder)?.elder_reveal()
|
new_village.character_by_id_mut(*elder)?.elder_reveal()
|
||||||
|
|
@ -89,52 +66,29 @@ impl Village {
|
||||||
NightChange::HunterTarget { source, target } => {
|
NightChange::HunterTarget { source, target } => {
|
||||||
let hunter_character = new_village.character_by_id_mut(*source).unwrap();
|
let hunter_character = new_village.character_by_id_mut(*source).unwrap();
|
||||||
hunter_character.hunter_mut()?.replace(*target);
|
hunter_character.hunter_mut()?.replace(*target);
|
||||||
if changes
|
if changes.killed(*source).is_some()
|
||||||
.died_to(hunter_character.character_id(), night, self)?
|
&& changes.protected(source).is_none()
|
||||||
.is_some()
|
&& changes.protected(target).is_none()
|
||||||
&& let Some(kill) = kill::resolve_kill(
|
|
||||||
&changes,
|
|
||||||
*target,
|
|
||||||
&DiedTo::Hunter {
|
|
||||||
killer: *source,
|
|
||||||
night: NonZeroU8::new(night)
|
|
||||||
.ok_or(GameError::CannotHappenOnNightZero)?,
|
|
||||||
},
|
|
||||||
night,
|
|
||||||
&new_village,
|
|
||||||
)?
|
|
||||||
{
|
{
|
||||||
kill.apply_to_village(&mut new_village, Some(&mut recorded_changes))?;
|
new_village
|
||||||
|
.character_by_id_mut(*target)
|
||||||
|
.unwrap()
|
||||||
|
.kill(DiedTo::Hunter {
|
||||||
|
killer: *source,
|
||||||
|
night: NonZeroU8::new(night).unwrap(),
|
||||||
|
})
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NightChange::Kill { target, died_to } => {
|
NightChange::Kill { target, died_to } => {
|
||||||
if let Some(kill) = kill::resolve_kill(&changes, *target, died_to, night, self)?
|
if let Some(kill) =
|
||||||
|
kill::resolve_kill(&mut changes, *target, died_to, night, self)?
|
||||||
{
|
{
|
||||||
if let KillOutcome::Guarding {
|
kill.apply_to_village(&mut new_village)?;
|
||||||
guardian,
|
|
||||||
original_kill,
|
|
||||||
..
|
|
||||||
} = &kill
|
|
||||||
{
|
|
||||||
recorded_changes.retain(|c| c != change);
|
|
||||||
recorded_changes.push(NightChange::Kill {
|
|
||||||
target: *guardian,
|
|
||||||
died_to: original_kill.clone(),
|
|
||||||
});
|
|
||||||
}
|
|
||||||
kill.apply_to_village(&mut new_village, Some(&mut recorded_changes))?;
|
|
||||||
if let DiedTo::MapleWolf { source, .. } = died_to
|
|
||||||
&& let Ok(maple) = new_village.character_by_id_mut(*source)
|
|
||||||
{
|
|
||||||
*maple.maple_wolf_mut()? = night;
|
|
||||||
}
|
|
||||||
} else {
|
|
||||||
recorded_changes.retain(|c| c != change);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
NightChange::Shapeshift { source, into } => {
|
NightChange::Shapeshift { source, into } => {
|
||||||
if let Some(target) = changes.wolf_pack_kill_target()
|
if let Some(target) = changes.wolf_pack_kill_target()
|
||||||
&& changes.protected(*target).is_none()
|
&& changes.protected(target).is_none()
|
||||||
{
|
{
|
||||||
if *target != *into {
|
if *target != *into {
|
||||||
log::error!("shapeshift into({into}) != target({target})");
|
log::error!("shapeshift into({into}) != target({target})");
|
||||||
|
|
@ -147,8 +101,6 @@ impl Village {
|
||||||
night: NonZeroU8::new(night).unwrap(),
|
night: NonZeroU8::new(night).unwrap(),
|
||||||
});
|
});
|
||||||
// role change pushed in [apply_shapeshift]
|
// role change pushed in [apply_shapeshift]
|
||||||
} else {
|
|
||||||
recorded_changes.retain(|c| c != change);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -176,11 +128,6 @@ impl Village {
|
||||||
.character_by_id_mut(*source)?
|
.character_by_id_mut(*source)?
|
||||||
.direwolf_mut()?
|
.direwolf_mut()?
|
||||||
.replace(*target);
|
.replace(*target);
|
||||||
|
|
||||||
recorded_changes.retain(|c| {
|
|
||||||
matches!(c, NightChange::RoleBlock { .. })
|
|
||||||
|| c.target().map(|t| t == *target).unwrap_or_default().not()
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
|
|
||||||
NightChange::MasonRecruit {
|
NightChange::MasonRecruit {
|
||||||
|
|
@ -194,7 +141,6 @@ impl Village {
|
||||||
tried_recruiting: *recruiting,
|
tried_recruiting: *recruiting,
|
||||||
},
|
},
|
||||||
);
|
);
|
||||||
recorded_changes.retain(|c| c != change);
|
|
||||||
} else {
|
} else {
|
||||||
new_village
|
new_village
|
||||||
.character_by_id_mut(*mason_leader)?
|
.character_by_id_mut(*mason_leader)?
|
||||||
|
|
@ -211,38 +157,9 @@ impl Village {
|
||||||
NightChange::LostAura { character, aura } => {
|
NightChange::LostAura { character, aura } => {
|
||||||
new_village
|
new_village
|
||||||
.character_by_id_mut(*character)?
|
.character_by_id_mut(*character)?
|
||||||
.remove_aura(aura.title());
|
.remove_aura(*aura);
|
||||||
}
|
|
||||||
NightChange::Protection { protection, target } => {
|
|
||||||
let target_ident = new_village.character_by_id(*target)?.identity();
|
|
||||||
match protection {
|
|
||||||
Protection::Guardian {
|
|
||||||
source,
|
|
||||||
guarding: true,
|
|
||||||
} => {
|
|
||||||
new_village
|
|
||||||
.character_by_id_mut(*source)?
|
|
||||||
.guardian_mut()?
|
|
||||||
.replace(PreviousGuardianAction::Guard(target_ident));
|
|
||||||
}
|
|
||||||
Protection::Guardian {
|
|
||||||
source,
|
|
||||||
guarding: false,
|
|
||||||
} => {
|
|
||||||
new_village
|
|
||||||
.character_by_id_mut(*source)?
|
|
||||||
.guardian_mut()?
|
|
||||||
.replace(PreviousGuardianAction::Protect(target_ident));
|
|
||||||
}
|
|
||||||
Protection::Protector { source } => {
|
|
||||||
new_village
|
|
||||||
.character_by_id_mut(*source)?
|
|
||||||
.protector_mut()?
|
|
||||||
.replace(*target);
|
|
||||||
}
|
|
||||||
Protection::Vindicator { .. } => {}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
NightChange::Protection { .. } => {}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// black knights death
|
// black knights death
|
||||||
|
|
@ -286,6 +203,6 @@ impl Village {
|
||||||
if new_village.is_game_over().is_none() {
|
if new_village.is_game_over().is_none() {
|
||||||
new_village.to_day()?;
|
new_village.to_day()?;
|
||||||
}
|
}
|
||||||
Ok((new_village, recorded_changes.into_boxed_slice()))
|
Ok(new_village)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,311 +0,0 @@
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
use core::num::NonZeroU8;
|
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
diedto::DiedTo,
|
|
||||||
game::{
|
|
||||||
Game, GameSettings, SetupRole,
|
|
||||||
night::changes::{ChangesLookup, NightChange},
|
|
||||||
},
|
|
||||||
game_test::{GameExt, SettingsExt, gen_players, init_log},
|
|
||||||
player::Protection,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn shapeshift() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..10);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let target = player_ids.next().unwrap();
|
|
||||||
let shapeshifter = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::Villager, target);
|
|
||||||
settings.add_and_assign(SetupRole::Shapeshifter, shapeshifter);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(9);
|
|
||||||
let game = Game::new(&players, settings).unwrap();
|
|
||||||
|
|
||||||
let all_changes = [
|
|
||||||
NightChange::Kill {
|
|
||||||
target: game.character_by_player_id(target).character_id(),
|
|
||||||
died_to: DiedTo::Wolfpack {
|
|
||||||
killing_wolf: game.character_by_player_id(wolf).character_id(),
|
|
||||||
night: NonZeroU8::new(1).unwrap(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
NightChange::Shapeshift {
|
|
||||||
source: game.character_by_player_id(shapeshifter).character_id(),
|
|
||||||
into: game.character_by_player_id(target).character_id(),
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let changes = ChangesLookup::new(&all_changes);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(target).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(None)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(shapeshifter).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(Some(DiedTo::Shapeshift {
|
|
||||||
into: game.character_by_player_id(target).character_id(),
|
|
||||||
night: NonZeroU8::new(1).unwrap()
|
|
||||||
}))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn guardian_protect() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..10);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let target = player_ids.next().unwrap();
|
|
||||||
let guardian = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::Villager, target);
|
|
||||||
settings.add_and_assign(SetupRole::Guardian, guardian);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(9);
|
|
||||||
let game = Game::new(&players, settings).unwrap();
|
|
||||||
|
|
||||||
let all_changes = [
|
|
||||||
NightChange::Kill {
|
|
||||||
target: game.character_by_player_id(target).character_id(),
|
|
||||||
died_to: DiedTo::Wolfpack {
|
|
||||||
killing_wolf: game.character_by_player_id(wolf).character_id(),
|
|
||||||
night: NonZeroU8::new(1).unwrap(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
NightChange::Protection {
|
|
||||||
target: game.character_by_player_id(target).character_id(),
|
|
||||||
protection: Protection::Guardian {
|
|
||||||
source: game.character_by_player_id(guardian).character_id(),
|
|
||||||
guarding: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let changes = ChangesLookup::new(&all_changes);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(target).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(None)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(guardian).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(None)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn guardian_guard() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..10);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let target = player_ids.next().unwrap();
|
|
||||||
let guardian = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::Villager, target);
|
|
||||||
settings.add_and_assign(SetupRole::Guardian, guardian);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(9);
|
|
||||||
let game = Game::new(&players, settings).unwrap();
|
|
||||||
|
|
||||||
let all_changes = [
|
|
||||||
NightChange::Kill {
|
|
||||||
target: game.character_by_player_id(target).character_id(),
|
|
||||||
died_to: DiedTo::Wolfpack {
|
|
||||||
killing_wolf: game.character_by_player_id(wolf).character_id(),
|
|
||||||
night: NonZeroU8::new(1).unwrap(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
NightChange::Protection {
|
|
||||||
target: game.character_by_player_id(target).character_id(),
|
|
||||||
protection: Protection::Guardian {
|
|
||||||
source: game.character_by_player_id(guardian).character_id(),
|
|
||||||
guarding: true,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let changes = ChangesLookup::new(&all_changes);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(target).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(None)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(guardian).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(Some(DiedTo::Wolfpack {
|
|
||||||
killing_wolf: game.character_by_player_id(wolf).character_id(),
|
|
||||||
night: NonZeroU8::new(1).unwrap()
|
|
||||||
}))
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(wolf).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(Some(DiedTo::GuardianProtecting {
|
|
||||||
source: game.character_by_player_id(guardian).character_id(),
|
|
||||||
protecting: game.character_by_player_id(target).character_id(),
|
|
||||||
protecting_from: game.character_by_player_id(wolf).character_id(),
|
|
||||||
protecting_from_cause: Box::new(DiedTo::Wolfpack {
|
|
||||||
killing_wolf: game.character_by_player_id(wolf).character_id(),
|
|
||||||
night: NonZeroU8::new(1).unwrap(),
|
|
||||||
}),
|
|
||||||
night: NonZeroU8::new(1).unwrap(),
|
|
||||||
}))
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn guardian_protect_from_multiple_attackers() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..10);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let target = player_ids.next().unwrap();
|
|
||||||
let guardian = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let militia = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::Villager, target);
|
|
||||||
settings.add_and_assign(SetupRole::Villager, militia);
|
|
||||||
settings.add_and_assign(SetupRole::Guardian, guardian);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(9);
|
|
||||||
let game = Game::new(&players, settings).unwrap();
|
|
||||||
|
|
||||||
let all_changes = [
|
|
||||||
NightChange::Kill {
|
|
||||||
target: game.character_by_player_id(target).character_id(),
|
|
||||||
died_to: DiedTo::Wolfpack {
|
|
||||||
killing_wolf: game.character_by_player_id(wolf).character_id(),
|
|
||||||
night: NonZeroU8::new(1).unwrap(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
NightChange::Kill {
|
|
||||||
target: game.character_by_player_id(target).character_id(),
|
|
||||||
died_to: DiedTo::Militia {
|
|
||||||
killer: game.character_by_player_id(militia).character_id(),
|
|
||||||
night: NonZeroU8::new(1).unwrap(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
NightChange::Protection {
|
|
||||||
target: game.character_by_player_id(target).character_id(),
|
|
||||||
protection: Protection::Guardian {
|
|
||||||
source: game.character_by_player_id(guardian).character_id(),
|
|
||||||
guarding: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let changes = ChangesLookup::new(&all_changes);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(target).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(None)
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(guardian).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(None)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn guardian_protect_someone_else_unprotected_dies() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..10);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let target = player_ids.next().unwrap();
|
|
||||||
let guardian = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::Seer, target);
|
|
||||||
settings.add_and_assign(SetupRole::Guardian, guardian);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(9);
|
|
||||||
let game = Game::new(&players, settings).unwrap();
|
|
||||||
|
|
||||||
let all_changes = [
|
|
||||||
NightChange::Kill {
|
|
||||||
target: game.character_by_player_id(target).character_id(),
|
|
||||||
died_to: DiedTo::Wolfpack {
|
|
||||||
killing_wolf: game.character_by_player_id(wolf).character_id(),
|
|
||||||
night: NonZeroU8::new(1).unwrap(),
|
|
||||||
},
|
|
||||||
},
|
|
||||||
NightChange::Protection {
|
|
||||||
target: game.living_villager().character_id(),
|
|
||||||
protection: Protection::Guardian {
|
|
||||||
source: game.character_by_player_id(guardian).character_id(),
|
|
||||||
guarding: false,
|
|
||||||
},
|
|
||||||
},
|
|
||||||
];
|
|
||||||
let changes = ChangesLookup::new(&all_changes);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(target).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(Some(DiedTo::Wolfpack {
|
|
||||||
killing_wolf: game.character_by_player_id(wolf).character_id(),
|
|
||||||
night: NonZeroU8::new(1).unwrap()
|
|
||||||
}))
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
changes.died_to(
|
|
||||||
game.character_by_player_id(guardian).character_id(),
|
|
||||||
1,
|
|
||||||
game.village()
|
|
||||||
),
|
|
||||||
Ok(None)
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
mod changes;
|
|
||||||
mod night_order;
|
mod night_order;
|
||||||
mod previous;
|
mod previous;
|
||||||
mod revert;
|
mod revert;
|
||||||
|
|
@ -187,17 +186,9 @@ pub trait ActionResultExt {
|
||||||
fn adjudicator(&self) -> Killer;
|
fn adjudicator(&self) -> Killer;
|
||||||
fn mortician(&self) -> DiedToTitle;
|
fn mortician(&self) -> DiedToTitle;
|
||||||
fn empath(&self) -> bool;
|
fn empath(&self) -> bool;
|
||||||
fn drunk(&self);
|
|
||||||
fn shapeshift_failed(&self);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ActionResultExt for ActionResult {
|
impl ActionResultExt for ActionResult {
|
||||||
fn shapeshift_failed(&self) {
|
|
||||||
assert_eq!(*self, Self::ShiftFailed)
|
|
||||||
}
|
|
||||||
fn drunk(&self) {
|
|
||||||
assert_eq!(*self, Self::Drunk)
|
|
||||||
}
|
|
||||||
fn empath(&self) -> bool {
|
fn empath(&self) -> bool {
|
||||||
match self {
|
match self {
|
||||||
Self::Empath { scapegoat } => *scapegoat,
|
Self::Empath { scapegoat } => *scapegoat,
|
||||||
|
|
@ -260,7 +251,7 @@ impl ActionResultExt for ActionResult {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[allow(unused)]
|
|
||||||
pub trait AlignmentExt {
|
pub trait AlignmentExt {
|
||||||
fn village(&self);
|
fn village(&self);
|
||||||
fn wolves(&self);
|
fn wolves(&self);
|
||||||
|
|
@ -276,7 +267,6 @@ impl AlignmentExt for Alignment {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
pub trait ServerToHostMessageExt {
|
pub trait ServerToHostMessageExt {
|
||||||
fn prompt(self) -> ActionPrompt;
|
fn prompt(self) -> ActionPrompt;
|
||||||
fn result(self) -> ActionResult;
|
fn result(self) -> ActionResult;
|
||||||
|
|
@ -332,7 +322,6 @@ pub trait GameExt {
|
||||||
fn get_state(&mut self) -> ServerToHostMessage;
|
fn get_state(&mut self) -> ServerToHostMessage;
|
||||||
fn next_expect_game_over(&mut self) -> GameOver;
|
fn next_expect_game_over(&mut self) -> GameOver;
|
||||||
fn prev(&mut self) -> ServerToHostMessage;
|
fn prev(&mut self) -> ServerToHostMessage;
|
||||||
fn mark_villager(&mut self) -> ActionPrompt;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl GameExt for Game {
|
impl GameExt for Game {
|
||||||
|
|
@ -405,15 +394,10 @@ impl GameExt for Game {
|
||||||
.prompt()
|
.prompt()
|
||||||
}
|
}
|
||||||
|
|
||||||
fn mark_villager(&mut self) -> ActionPrompt {
|
|
||||||
self.mark(self.living_villager().character_id())
|
|
||||||
}
|
|
||||||
|
|
||||||
fn mark_and_check(&mut self, mark: CharacterId) {
|
fn mark_and_check(&mut self, mark: CharacterId) {
|
||||||
let prompt = self.mark(mark);
|
let prompt = self.mark(mark);
|
||||||
match prompt {
|
match prompt {
|
||||||
ActionPrompt::TraitorIntro { .. }
|
ActionPrompt::Insomniac { .. }
|
||||||
| ActionPrompt::Insomniac { .. }
|
|
||||||
| ActionPrompt::MasonsWake { .. }
|
| ActionPrompt::MasonsWake { .. }
|
||||||
| ActionPrompt::ElderReveal { .. }
|
| ActionPrompt::ElderReveal { .. }
|
||||||
| ActionPrompt::CoverOfDarkness
|
| ActionPrompt::CoverOfDarkness
|
||||||
|
|
@ -855,7 +839,7 @@ fn big_game_test_based_on_story_test() {
|
||||||
settings.add_and_assign(scapegoat.0, scapegoat.1);
|
settings.add_and_assign(scapegoat.0, scapegoat.1);
|
||||||
settings.add_and_assign(hunter.0, hunter.1);
|
settings.add_and_assign(hunter.0, hunter.1);
|
||||||
settings.fill_remaining_slots_with_villagers(players.len());
|
settings.fill_remaining_slots_with_villagers(players.len());
|
||||||
#[allow(unused)]
|
|
||||||
let (
|
let (
|
||||||
werewolf,
|
werewolf,
|
||||||
dire_wolf,
|
dire_wolf,
|
||||||
|
|
@ -939,9 +923,7 @@ fn big_game_test_based_on_story_test() {
|
||||||
game.r#continue().r#continue();
|
game.r#continue().r#continue();
|
||||||
|
|
||||||
game.next().title().shapeshifter();
|
game.next().title().shapeshifter();
|
||||||
game.response(ActionResponse::Shapeshift)
|
game.response(ActionResponse::Shapeshift).sleep();
|
||||||
.shapeshift_failed();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().seer();
|
game.next().title().seer();
|
||||||
game.mark(game.character_by_player_id(werewolf).character_id());
|
game.mark(game.character_by_player_id(werewolf).character_id());
|
||||||
|
|
|
||||||
|
|
@ -227,7 +227,7 @@ fn previous_prompt() {
|
||||||
settings.add_and_assign(scapegoat.0, scapegoat.1);
|
settings.add_and_assign(scapegoat.0, scapegoat.1);
|
||||||
settings.add_and_assign(hunter.0, hunter.1);
|
settings.add_and_assign(hunter.0, hunter.1);
|
||||||
settings.fill_remaining_slots_with_villagers(players.len());
|
settings.fill_remaining_slots_with_villagers(players.len());
|
||||||
#[allow(unused)]
|
|
||||||
let (
|
let (
|
||||||
werewolf,
|
werewolf,
|
||||||
dire_wolf,
|
dire_wolf,
|
||||||
|
|
@ -353,9 +353,7 @@ fn previous_prompt() {
|
||||||
game.r#continue().r#continue();
|
game.r#continue().r#continue();
|
||||||
|
|
||||||
game.next().title().shapeshifter();
|
game.next().title().shapeshifter();
|
||||||
game.response(ActionResponse::Shapeshift)
|
game.response(ActionResponse::Shapeshift).sleep();
|
||||||
.shapeshift_failed();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().seer();
|
game.next().title().seer();
|
||||||
game.mark(game.character_by_player_id(werewolf).character_id());
|
game.mark(game.character_by_player_id(werewolf).character_id());
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,7 @@ use crate::{
|
||||||
game_test::{
|
game_test::{
|
||||||
ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log,
|
ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log,
|
||||||
},
|
},
|
||||||
message::night::ActionPrompt,
|
message::{CharacterIdentity, night::ActionPrompt},
|
||||||
role::{Role, RoleTitle},
|
role::{Role, RoleTitle},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -12,14 +12,22 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
use core::num::NonZeroU8;
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
game::{Game, GameSettings, SetupRole},
|
diedto::DiedTo,
|
||||||
game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players},
|
game::{Game, GameSettings, OrRandom, SetupRole},
|
||||||
message::night::{ActionPrompt, ActionPromptTitle},
|
game_test::{
|
||||||
role::RoleTitle,
|
ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, ServerToHostMessageExt,
|
||||||
|
SettingsExt, gen_players,
|
||||||
|
},
|
||||||
|
message::{
|
||||||
|
host::{HostDayMessage, HostGameMessage},
|
||||||
|
night::{ActionPrompt, ActionPromptTitle, ActionResult},
|
||||||
|
},
|
||||||
|
role::{Role, RoleTitle},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -18,9 +18,16 @@ use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
game::{Game, GameSettings, SetupRole},
|
game::{Game, GameSettings, OrRandom, SetupRole},
|
||||||
game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players},
|
game_test::{
|
||||||
message::night::ActionPromptTitle,
|
ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, ServerToHostMessageExt,
|
||||||
|
SettingsExt, gen_players,
|
||||||
|
},
|
||||||
|
message::{
|
||||||
|
host::{HostDayMessage, HostGameMessage},
|
||||||
|
night::{ActionPrompt, ActionPromptTitle, ActionResult},
|
||||||
|
},
|
||||||
|
role::Role,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -1,123 +0,0 @@
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
game::{Game, GameSettings, OrRandom, SetupRole},
|
|
||||||
game_test::{
|
|
||||||
ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log,
|
|
||||||
},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn block_on_wolf_kill_target_prevents_kill() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..21);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let scapegoat = player_ids.next().unwrap();
|
|
||||||
let direwolf = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(
|
|
||||||
SetupRole::Scapegoat {
|
|
||||||
redeemed: OrRandom::Determined(false),
|
|
||||||
},
|
|
||||||
scapegoat,
|
|
||||||
);
|
|
||||||
settings.add_and_assign(SetupRole::DireWolf, direwolf);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(20);
|
|
||||||
let mut game = Game::new(&players, settings).unwrap();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
game.next().title().wolves_intro();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
|
|
||||||
game.next().title().direwolf();
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
let scapegoat_char_id = game.character_by_player_id(scapegoat).character_id();
|
|
||||||
game.mark(scapegoat_char_id);
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
|
|
||||||
game.next().title().direwolf();
|
|
||||||
game.mark(scapegoat_char_id);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
game.character_by_player_id(scapegoat).died_to().cloned(),
|
|
||||||
None
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn block_on_guardian_target_prevents_the_visit() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..21);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let scapegoat = player_ids.next().unwrap();
|
|
||||||
let guardian = player_ids.next().unwrap();
|
|
||||||
let direwolf = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(
|
|
||||||
SetupRole::Scapegoat {
|
|
||||||
redeemed: OrRandom::Determined(false),
|
|
||||||
},
|
|
||||||
scapegoat,
|
|
||||||
);
|
|
||||||
settings.add_and_assign(SetupRole::Guardian, guardian);
|
|
||||||
settings.add_and_assign(SetupRole::DireWolf, direwolf);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(20);
|
|
||||||
let mut game = Game::new(&players, settings).unwrap();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
game.next().title().wolves_intro();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
|
|
||||||
game.next().title().direwolf();
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
game.execute().title().guardian();
|
|
||||||
let scapegoat_char_id = game.character_by_player_id(scapegoat).character_id();
|
|
||||||
game.mark(scapegoat_char_id);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().wolf_pack_kill();
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
|
|
||||||
game.next().title().direwolf();
|
|
||||||
game.mark(scapegoat_char_id);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
game.character_by_player_id(guardian)
|
|
||||||
.guardian()
|
|
||||||
.unwrap()
|
|
||||||
.clone(),
|
|
||||||
None
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -18,15 +18,16 @@ use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
game::{Game, GameSettings, SetupRole},
|
game::{Game, GameSettings, OrRandom, SetupRole},
|
||||||
game_test::{
|
game_test::{
|
||||||
ActionPromptTitleExt, ActionResultExt, GameExt, ServerToHostMessageExt, SettingsExt,
|
ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, ServerToHostMessageExt,
|
||||||
gen_players,
|
SettingsExt, gen_players,
|
||||||
},
|
},
|
||||||
message::{
|
message::{
|
||||||
host::{HostDayMessage, HostGameMessage},
|
host::{HostDayMessage, HostGameMessage},
|
||||||
night::{ActionPrompt, ActionPromptTitle},
|
night::{ActionPrompt, ActionPromptTitle, ActionResult},
|
||||||
},
|
},
|
||||||
|
role::Role,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -18,7 +18,7 @@ use crate::{
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
game::{Game, GameSettings, SetupRole},
|
game::{Game, GameSettings, SetupRole},
|
||||||
game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players},
|
game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players},
|
||||||
message::night::ActionPromptTitle,
|
message::night::{ActionPrompt, ActionPromptTitle},
|
||||||
role::{Alignment, Role},
|
role::{Alignment, Role},
|
||||||
};
|
};
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,16 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
use core::num::NonZeroU8;
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
game::{Game, GameSettings, OrRandom, SetupRole},
|
game::{Game, GameSettings, OrRandom, SetupRole},
|
||||||
game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players},
|
game_test::{
|
||||||
message::night::{ActionPromptTitle, ActionResult},
|
ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, SettingsExt, gen_players,
|
||||||
|
},
|
||||||
|
message::night::{ActionPrompt, ActionPromptTitle, ActionResult},
|
||||||
role::Role,
|
role::Role,
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -14,9 +14,6 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use core::num::NonZeroU8;
|
use core::num::NonZeroU8;
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
error::GameError,
|
error::GameError,
|
||||||
|
|
@ -28,7 +25,7 @@ use crate::{
|
||||||
host::{HostGameMessage, HostNightMessage},
|
host::{HostGameMessage, HostNightMessage},
|
||||||
night::{ActionPromptTitle, ActionResponse},
|
night::{ActionPromptTitle, ActionResponse},
|
||||||
},
|
},
|
||||||
role::{PreviousGuardianAction, Role, RoleTitle},
|
role::{PreviousGuardianAction, Role},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
@ -218,54 +215,3 @@ fn cannot_visit_previous_nights_guard_target() {
|
||||||
Err(GameError::InvalidTarget)
|
Err(GameError::InvalidTarget)
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn protects_from_militia() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..21);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let guardian = player_ids.next().unwrap();
|
|
||||||
let militia = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::Militia, militia);
|
|
||||||
settings.add_and_assign(SetupRole::Guardian, guardian);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(20);
|
|
||||||
let mut game = Game::new(&players, settings).unwrap();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
game.next().title().wolves_intro();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
game.execute().title().guardian();
|
|
||||||
let mut villagers = game
|
|
||||||
.village()
|
|
||||||
.characters()
|
|
||||||
.into_iter()
|
|
||||||
.filter(|c| c.alive() && matches!(c.role().title(), RoleTitle::Villager));
|
|
||||||
let protected = villagers.next().unwrap();
|
|
||||||
game.mark(protected.character_id());
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().wolf_pack_kill();
|
|
||||||
game.mark(villagers.next().unwrap().character_id());
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().militia();
|
|
||||||
game.mark(protected.character_id());
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
game.character_by_player_id(protected.player_id())
|
|
||||||
.died_to()
|
|
||||||
.cloned(),
|
|
||||||
None
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
game.character_by_player_id(militia).role().clone(),
|
|
||||||
Role::Militia { targeted: None }
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,20 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
use core::num::NonZeroU8;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
diedto::DiedTo,
|
||||||
|
error::GameError,
|
||||||
game::{Game, GameSettings, SetupRole},
|
game::{Game, GameSettings, SetupRole},
|
||||||
game_test::{
|
game_test::{
|
||||||
ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log,
|
ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log,
|
||||||
},
|
},
|
||||||
message::night::ActionPromptTitle,
|
message::{
|
||||||
role::Role,
|
host::{HostGameMessage, HostNightMessage},
|
||||||
|
night::{ActionPromptTitle, ActionResponse},
|
||||||
|
},
|
||||||
|
role::{PreviousGuardianAction, Role},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,11 @@
|
||||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
game::{Game, GameSettings, SetupRole},
|
diedto::DiedTo,
|
||||||
game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players},
|
game::{Game, GameSettings, OrRandom, SetupRole},
|
||||||
|
game_test::{
|
||||||
|
ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, SettingsExt, gen_players,
|
||||||
|
},
|
||||||
message::night::{ActionPromptTitle, Visits},
|
message::night::{ActionPromptTitle, Visits},
|
||||||
role::{Role, RoleTitle},
|
role::{Role, RoleTitle},
|
||||||
};
|
};
|
||||||
|
|
|
||||||
|
|
@ -1,333 +0,0 @@
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
|
|
||||||
use core::num::NonZeroU8;
|
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
aura::Aura,
|
|
||||||
bag::DrunkBag,
|
|
||||||
diedto::DiedTo,
|
|
||||||
game::{Game, GameSettings, SetupRole},
|
|
||||||
game_test::{
|
|
||||||
ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log,
|
|
||||||
},
|
|
||||||
message::night::ActionPromptTitle,
|
|
||||||
};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn maple_starves() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..21);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let maple = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::MapleWolf, maple);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(20);
|
|
||||||
let mut game = Game::new(&players, settings).unwrap();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
assert_eq!(game.next().title(), ActionPromptTitle::WolvesIntro);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().maple_wolf();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
*game.character_by_player_id(maple).maple_wolf_mut().unwrap(),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().maple_wolf();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().maple_wolf();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
game.character_by_player_id(maple).died_to().cloned(),
|
|
||||||
Some(DiedTo::MapleWolfStarved {
|
|
||||||
night: NonZeroU8::new(3).unwrap()
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn maple_last_eat_counter_increments() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..21);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let maple = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::MapleWolf, maple);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(20);
|
|
||||||
let mut game = Game::new(&players, settings).unwrap();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
assert_eq!(game.next().title(), ActionPromptTitle::WolvesIntro);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
*game.character_by_player_id(maple).maple_wolf_mut().unwrap(),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
let (maple_kill, wolf_kill) = {
|
|
||||||
let mut cid = game
|
|
||||||
.villager_character_ids()
|
|
||||||
.into_iter()
|
|
||||||
.filter(|c| game.village().character_by_id(*c).unwrap().alive());
|
|
||||||
(cid.next().unwrap(), cid.next().unwrap())
|
|
||||||
};
|
|
||||||
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark(wolf_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().maple_wolf();
|
|
||||||
game.mark(maple_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
*game.character_by_player_id(maple).maple_wolf_mut().unwrap(),
|
|
||||||
1
|
|
||||||
);
|
|
||||||
|
|
||||||
let (maple_kill, wolf_kill) = {
|
|
||||||
let mut cid = game
|
|
||||||
.villager_character_ids()
|
|
||||||
.into_iter()
|
|
||||||
.filter(|c| game.village().character_by_id(*c).unwrap().alive());
|
|
||||||
(cid.next().unwrap(), cid.next().unwrap())
|
|
||||||
};
|
|
||||||
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark(wolf_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().maple_wolf();
|
|
||||||
game.mark(maple_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
*game.character_by_player_id(maple).maple_wolf_mut().unwrap(),
|
|
||||||
2
|
|
||||||
);
|
|
||||||
|
|
||||||
let (maple_kill, wolf_kill) = {
|
|
||||||
let mut cid = game
|
|
||||||
.villager_character_ids()
|
|
||||||
.into_iter()
|
|
||||||
.filter(|c| game.village().character_by_id(*c).unwrap().alive());
|
|
||||||
(cid.next().unwrap(), cid.next().unwrap())
|
|
||||||
};
|
|
||||||
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark(wolf_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().maple_wolf();
|
|
||||||
game.mark(maple_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
*game.character_by_player_id(maple).maple_wolf_mut().unwrap(),
|
|
||||||
3
|
|
||||||
);
|
|
||||||
let (maple_kill, wolf_kill) = {
|
|
||||||
let mut cid = game
|
|
||||||
.villager_character_ids()
|
|
||||||
.into_iter()
|
|
||||||
.filter(|c| game.village().character_by_id(*c).unwrap().alive());
|
|
||||||
(cid.next().unwrap(), cid.next().unwrap())
|
|
||||||
};
|
|
||||||
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark(wolf_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().maple_wolf();
|
|
||||||
game.mark(maple_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
*game.character_by_player_id(maple).maple_wolf_mut().unwrap(),
|
|
||||||
4
|
|
||||||
);
|
|
||||||
|
|
||||||
assert_eq!(game.character_by_player_id(maple).died_to().cloned(), None);
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn drunk_maple_doesnt_eat() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..21);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let maple = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::MapleWolf, maple);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(20);
|
|
||||||
let mut game = Game::new(&players, settings).unwrap();
|
|
||||||
game.village_mut()
|
|
||||||
.characters_mut()
|
|
||||||
.into_iter()
|
|
||||||
.find(|c| c.player_id() == maple)
|
|
||||||
.unwrap()
|
|
||||||
.apply_aura(Aura::Drunk(DrunkBag::all_drunk()));
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
assert_eq!(game.next().title(), ActionPromptTitle::WolvesIntro);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
*game.character_by_player_id(maple).maple_wolf_mut().unwrap(),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
let (maple_kill, wolf_kill) = {
|
|
||||||
let mut cid = game
|
|
||||||
.villager_character_ids()
|
|
||||||
.into_iter()
|
|
||||||
.filter(|c| game.village().character_by_id(*c).unwrap().alive());
|
|
||||||
(cid.next().unwrap(), cid.next().unwrap())
|
|
||||||
};
|
|
||||||
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark(wolf_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().maple_wolf();
|
|
||||||
game.mark(maple_kill);
|
|
||||||
game.r#continue().drunk();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
*game.character_by_player_id(maple).maple_wolf_mut().unwrap(),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
game.village()
|
|
||||||
.character_by_id(maple_kill)
|
|
||||||
.unwrap()
|
|
||||||
.died_to(),
|
|
||||||
None
|
|
||||||
);
|
|
||||||
|
|
||||||
let (maple_kill, wolf_kill) = {
|
|
||||||
let mut cid = game
|
|
||||||
.villager_character_ids()
|
|
||||||
.into_iter()
|
|
||||||
.filter(|c| game.village().character_by_id(*c).unwrap().alive());
|
|
||||||
(cid.next().unwrap(), cid.next().unwrap())
|
|
||||||
};
|
|
||||||
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark(wolf_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().maple_wolf();
|
|
||||||
game.mark(maple_kill);
|
|
||||||
game.r#continue().drunk();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
*game.character_by_player_id(maple).maple_wolf_mut().unwrap(),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
assert_eq!(
|
|
||||||
game.village()
|
|
||||||
.character_by_id(maple_kill)
|
|
||||||
.unwrap()
|
|
||||||
.died_to(),
|
|
||||||
None
|
|
||||||
);
|
|
||||||
|
|
||||||
let (maple_kill, wolf_kill) = {
|
|
||||||
let mut cid = game
|
|
||||||
.villager_character_ids()
|
|
||||||
.into_iter()
|
|
||||||
.filter(|c| game.village().character_by_id(*c).unwrap().alive());
|
|
||||||
(cid.next().unwrap(), cid.next().unwrap())
|
|
||||||
};
|
|
||||||
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark(wolf_kill);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().maple_wolf();
|
|
||||||
game.mark(maple_kill);
|
|
||||||
game.r#continue().drunk();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
*game.character_by_player_id(maple).maple_wolf_mut().unwrap(),
|
|
||||||
0
|
|
||||||
);
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
game.character_by_player_id(maple).died_to().cloned(),
|
|
||||||
Some(DiedTo::MapleWolfStarved {
|
|
||||||
night: NonZeroU8::new(3).unwrap()
|
|
||||||
})
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -18,7 +18,7 @@ use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
diedto::DiedTo,
|
diedto::DiedTo,
|
||||||
game::{Game, GameSettings, OrRandom, SetupRole},
|
game::{Game, GameSettings, SetupRole},
|
||||||
game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players},
|
game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players},
|
||||||
message::night::{ActionPrompt, ActionPromptTitle},
|
message::night::{ActionPrompt, ActionPromptTitle},
|
||||||
};
|
};
|
||||||
|
|
@ -243,63 +243,3 @@ fn masons_wake_even_if_leader_died() {
|
||||||
}
|
}
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn masons_get_go_back_to_sleep() {
|
|
||||||
let players = gen_players(1..21);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let mason = player_ids.next().unwrap();
|
|
||||||
let scapegoat = player_ids.next().unwrap();
|
|
||||||
let beholder = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(
|
|
||||||
SetupRole::MasonLeader {
|
|
||||||
recruits_available: NonZeroU8::new(1).unwrap(),
|
|
||||||
},
|
|
||||||
mason,
|
|
||||||
);
|
|
||||||
settings.add_and_assign(
|
|
||||||
SetupRole::Scapegoat {
|
|
||||||
redeemed: OrRandom::Determined(false),
|
|
||||||
},
|
|
||||||
scapegoat,
|
|
||||||
);
|
|
||||||
settings.add_and_assign(SetupRole::Beholder, beholder);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(20);
|
|
||||||
let mut game = Game::new(&players, settings).unwrap();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
game.next().title().wolves_intro();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(game.execute().title(), ActionPromptTitle::WolfPackKill);
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().masons_leader_recruit();
|
|
||||||
game.mark(game.character_by_player_id(scapegoat).character_id());
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
|
|
||||||
game.next().title().masons_wake();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().beholder();
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
game.execute().title().wolf_pack_kill();
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().masons_wake();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().beholder();
|
|
||||||
game.mark_villager();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,6 @@ mod apprentice;
|
||||||
mod beholder;
|
mod beholder;
|
||||||
mod black_knight;
|
mod black_knight;
|
||||||
mod bloodletter;
|
mod bloodletter;
|
||||||
mod direwolf;
|
|
||||||
mod diseased;
|
mod diseased;
|
||||||
mod elder;
|
mod elder;
|
||||||
mod empath;
|
mod empath;
|
||||||
|
|
@ -24,11 +23,9 @@ mod guardian;
|
||||||
mod hunter;
|
mod hunter;
|
||||||
mod insomniac;
|
mod insomniac;
|
||||||
mod lone_wolf;
|
mod lone_wolf;
|
||||||
mod maple_wolf;
|
|
||||||
mod mason;
|
mod mason;
|
||||||
mod militia;
|
mod militia;
|
||||||
mod mortician;
|
mod mortician;
|
||||||
mod protector;
|
|
||||||
mod pyremaster;
|
mod pyremaster;
|
||||||
mod scapegoat;
|
mod scapegoat;
|
||||||
mod shapeshifter;
|
mod shapeshifter;
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,15 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
use core::num::NonZeroU8;
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
|
diedto::DiedTo,
|
||||||
game::{Game, GameSettings, SetupRole},
|
game::{Game, GameSettings, SetupRole},
|
||||||
game_test::{ActionResultExt, GameExt, SettingsExt, gen_players},
|
game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players},
|
||||||
message::night::ActionPromptTitle,
|
message::night::{ActionPrompt, ActionPromptTitle},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -1,105 +0,0 @@
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
#[allow(unused)]
|
|
||||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
|
||||||
|
|
||||||
use crate::{
|
|
||||||
game::{Game, GameSettings, SetupRole},
|
|
||||||
game_test::{
|
|
||||||
ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players, init_log,
|
|
||||||
},
|
|
||||||
message::night::{ActionPrompt, ActionPromptTitle},
|
|
||||||
};
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn cannot_protect_same_target() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..21);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let protector = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::Protector, protector);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(20);
|
|
||||||
let mut game = Game::new(&players, settings).unwrap();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
assert_eq!(game.next().title(), ActionPromptTitle::WolvesIntro);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
game.execute().title().protector();
|
|
||||||
let prot = game.living_villager();
|
|
||||||
game.mark(prot.character_id());
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().wolf_pack_kill();
|
|
||||||
game.mark(prot.character_id());
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
game.character_by_player_id(protector)
|
|
||||||
.protector_mut()
|
|
||||||
.unwrap()
|
|
||||||
.clone(),
|
|
||||||
Some(prot.character_id())
|
|
||||||
);
|
|
||||||
|
|
||||||
match game.execute() {
|
|
||||||
ActionPrompt::Protector { targets, .. } => {
|
|
||||||
assert!(
|
|
||||||
!targets
|
|
||||||
.into_iter()
|
|
||||||
.any(|c| c.character_id == prot.character_id())
|
|
||||||
);
|
|
||||||
}
|
|
||||||
prompt => panic!("expected protector prompt, got {:?}", prompt.title()),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn can_self_protect() {
|
|
||||||
init_log();
|
|
||||||
let players = gen_players(1..21);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let protector = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::Protector, protector);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.fill_remaining_slots_with_villagers(20);
|
|
||||||
let mut game = Game::new(&players, settings).unwrap();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
assert_eq!(game.next().title(), ActionPromptTitle::WolvesIntro);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
game.execute().title().protector();
|
|
||||||
game.mark(game.character_by_player_id(protector).character_id());
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().wolf_pack_kill();
|
|
||||||
game.mark(game.character_by_player_id(protector).character_id());
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
assert_eq!(
|
|
||||||
game.character_by_player_id(protector).died_to().cloned(),
|
|
||||||
None
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
@ -100,6 +100,10 @@ fn redeemed_scapegoat_role_changes() {
|
||||||
game.mark_and_check(seer);
|
game.mark_and_check(seer);
|
||||||
game.r#continue().sleep();
|
game.r#continue().sleep();
|
||||||
|
|
||||||
|
assert_eq!(game.next().title(), ActionPromptTitle::Seer);
|
||||||
|
game.mark_and_check(wolf_char_id);
|
||||||
|
assert_eq!(game.r#continue().seer(), Alignment::Wolves);
|
||||||
|
game.r#continue().sleep();
|
||||||
game.next_expect_day();
|
game.next_expect_day();
|
||||||
|
|
||||||
assert_eq!(
|
assert_eq!(
|
||||||
|
|
|
||||||
|
|
@ -130,9 +130,7 @@ fn protect_stops_shapeshift() {
|
||||||
|
|
||||||
assert_eq!(game.next().title(), ActionPromptTitle::Shapeshifter,);
|
assert_eq!(game.next().title(), ActionPromptTitle::Shapeshifter,);
|
||||||
|
|
||||||
game.response(ActionResponse::Shapeshift)
|
game.response(ActionResponse::Shapeshift);
|
||||||
.shapeshift_failed();
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
game.next_expect_day();
|
||||||
|
|
||||||
|
|
@ -220,60 +218,3 @@ fn i_would_simply_refuse() {
|
||||||
|
|
||||||
game.next_expect_day();
|
game.next_expect_day();
|
||||||
}
|
}
|
||||||
|
|
||||||
#[test]
|
|
||||||
fn shapeshift_fail_can_continue() {
|
|
||||||
let players = gen_players(1..21);
|
|
||||||
let mut player_ids = players.iter().map(|p| p.player_id);
|
|
||||||
let shapeshifter = player_ids.next().unwrap();
|
|
||||||
let direwolf = player_ids.next().unwrap();
|
|
||||||
let wolf = player_ids.next().unwrap();
|
|
||||||
let protector = player_ids.next().unwrap();
|
|
||||||
let mut settings = GameSettings::empty();
|
|
||||||
settings.add_and_assign(SetupRole::Shapeshifter, shapeshifter);
|
|
||||||
settings.add_and_assign(SetupRole::DireWolf, direwolf);
|
|
||||||
settings.add_and_assign(SetupRole::Werewolf, wolf);
|
|
||||||
settings.add_and_assign(SetupRole::Protector, protector);
|
|
||||||
settings.fill_remaining_slots_with_villagers(20);
|
|
||||||
let mut game = Game::new(&players, settings).unwrap();
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
assert_eq!(game.next().title(), ActionPromptTitle::WolvesIntro);
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
|
|
||||||
game.next().title().direwolf();
|
|
||||||
let dw_target = game.living_villager();
|
|
||||||
game.mark(dw_target.character_id());
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
|
|
||||||
game.execute().title().protector();
|
|
||||||
let ss_target = game.living_villager();
|
|
||||||
game.mark(ss_target.character_id());
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next().title().wolf_pack_kill();
|
|
||||||
game.mark(ss_target.character_id());
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
|
|
||||||
game.next().title().shapeshifter();
|
|
||||||
match game
|
|
||||||
.process(HostGameMessage::Night(HostNightMessage::ActionResponse(
|
|
||||||
ActionResponse::Shapeshift,
|
|
||||||
)))
|
|
||||||
.unwrap()
|
|
||||||
{
|
|
||||||
ServerToHostMessage::ActionResult(_, ActionResult::ShiftFailed) => {}
|
|
||||||
other => panic!("expected shift fail, got {other:?}"),
|
|
||||||
};
|
|
||||||
game.r#continue().r#continue();
|
|
||||||
|
|
||||||
game.next().title().direwolf();
|
|
||||||
game.mark(
|
|
||||||
game.living_villager_excl(dw_target.player_id())
|
|
||||||
.character_id(),
|
|
||||||
);
|
|
||||||
game.r#continue().sleep();
|
|
||||||
|
|
||||||
game.next_expect_day();
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -12,13 +12,22 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
use core::num::NonZeroU8;
|
||||||
#[allow(unused)]
|
#[allow(unused)]
|
||||||
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
use pretty_assertions::{assert_eq, assert_ne, assert_str_eq};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
game::{Game, GameOver, GameSettings, SetupRole},
|
diedto::DiedTo,
|
||||||
game_test::{ActionPromptTitleExt, ActionResultExt, GameExt, SettingsExt, gen_players},
|
game::{Game, GameOver, GameSettings, OrRandom, SetupRole},
|
||||||
message::night::ActionPromptTitle,
|
game_test::{
|
||||||
|
ActionPromptTitleExt, ActionResultExt, AlignmentExt, GameExt, ServerToHostMessageExt,
|
||||||
|
SettingsExt, gen_players,
|
||||||
|
},
|
||||||
|
message::{
|
||||||
|
host::{HostDayMessage, HostGameMessage, ServerToHostMessage},
|
||||||
|
night::{ActionPrompt, ActionPromptTitle, ActionResult},
|
||||||
|
},
|
||||||
|
role::Role,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[test]
|
#[test]
|
||||||
|
|
|
||||||
|
|
@ -13,8 +13,8 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
#![allow(clippy::new_without_default)]
|
#![allow(clippy::new_without_default)]
|
||||||
|
|
||||||
pub mod aura;
|
pub mod aura;
|
||||||
pub mod bag;
|
|
||||||
pub mod character;
|
pub mod character;
|
||||||
pub mod diedto;
|
pub mod diedto;
|
||||||
pub mod error;
|
pub mod error;
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
use core::{num::NonZeroU8, ops::Deref};
|
use core::{num::NonZeroU8, ops::Deref};
|
||||||
|
|
||||||
use serde::{Deserialize, Serialize};
|
use serde::{Deserialize, Serialize};
|
||||||
use werewolves_macros::{ChecksAs, Extract, Titles};
|
use werewolves_macros::{ChecksAs, Titles};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
character::CharacterId,
|
character::CharacterId,
|
||||||
|
|
@ -32,7 +32,6 @@ pub enum ActionType {
|
||||||
Cover,
|
Cover,
|
||||||
#[checks("is_wolfy")]
|
#[checks("is_wolfy")]
|
||||||
WolvesIntro,
|
WolvesIntro,
|
||||||
TraitorIntro,
|
|
||||||
RoleChange,
|
RoleChange,
|
||||||
Protect,
|
Protect,
|
||||||
#[checks("is_wolfy")]
|
#[checks("is_wolfy")]
|
||||||
|
|
@ -56,7 +55,7 @@ pub enum ActionType {
|
||||||
Beholder,
|
Beholder,
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, ChecksAs, Titles, Extract)]
|
#[derive(Debug, Clone, Serialize, Deserialize, PartialEq, ChecksAs, Titles)]
|
||||||
pub enum ActionPrompt {
|
pub enum ActionPrompt {
|
||||||
#[checks(ActionType::Cover)]
|
#[checks(ActionType::Cover)]
|
||||||
CoverOfDarkness,
|
CoverOfDarkness,
|
||||||
|
|
@ -210,67 +209,12 @@ pub enum ActionPrompt {
|
||||||
living_players: Box<[CharacterIdentity]>,
|
living_players: Box<[CharacterIdentity]>,
|
||||||
marked: Option<CharacterId>,
|
marked: Option<CharacterId>,
|
||||||
},
|
},
|
||||||
#[checks(ActionType::TraitorIntro)]
|
|
||||||
TraitorIntro { character_id: CharacterIdentity },
|
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ActionPrompt {
|
impl ActionPrompt {
|
||||||
pub(crate) const fn marked(&self) -> Option<(CharacterId, Option<CharacterId>)> {
|
|
||||||
match self {
|
|
||||||
ActionPrompt::Seer { marked, .. }
|
|
||||||
| ActionPrompt::Protector { marked, .. }
|
|
||||||
| ActionPrompt::Gravedigger { marked, .. }
|
|
||||||
| ActionPrompt::Hunter { marked, .. }
|
|
||||||
| ActionPrompt::Militia { marked, .. }
|
|
||||||
| ActionPrompt::MapleWolf { marked, .. }
|
|
||||||
| ActionPrompt::Guardian { marked, .. }
|
|
||||||
| ActionPrompt::Adjudicator { marked, .. }
|
|
||||||
| ActionPrompt::PowerSeer { marked, .. }
|
|
||||||
| ActionPrompt::Mortician { marked, .. }
|
|
||||||
| ActionPrompt::Beholder { marked, .. }
|
|
||||||
| ActionPrompt::MasonLeaderRecruit { marked, .. }
|
|
||||||
| ActionPrompt::Empath { marked, .. }
|
|
||||||
| ActionPrompt::Vindicator { marked, .. }
|
|
||||||
| ActionPrompt::PyreMaster { marked, .. }
|
|
||||||
| ActionPrompt::WolfPackKill { marked, .. }
|
|
||||||
| ActionPrompt::AlphaWolf { marked, .. }
|
|
||||||
| ActionPrompt::DireWolf { marked, .. }
|
|
||||||
| ActionPrompt::LoneWolfKill { marked, .. }
|
|
||||||
| ActionPrompt::Bloodletter { marked, .. } => match *marked {
|
|
||||||
Some(marked) => Some((marked, None)),
|
|
||||||
None => None,
|
|
||||||
},
|
|
||||||
ActionPrompt::Arcanist {
|
|
||||||
marked: (None, Some(marked)),
|
|
||||||
..
|
|
||||||
}
|
|
||||||
| ActionPrompt::Arcanist {
|
|
||||||
marked: (Some(marked), None),
|
|
||||||
..
|
|
||||||
} => Some((*marked, None)),
|
|
||||||
ActionPrompt::Arcanist {
|
|
||||||
marked: (Some(marked1), Some(marked2)),
|
|
||||||
..
|
|
||||||
} => Some((*marked1, Some(*marked2))),
|
|
||||||
|
|
||||||
ActionPrompt::Arcanist {
|
|
||||||
marked: (None, None),
|
|
||||||
..
|
|
||||||
}
|
|
||||||
| ActionPrompt::CoverOfDarkness
|
|
||||||
| ActionPrompt::WolvesIntro { .. }
|
|
||||||
| ActionPrompt::RoleChange { .. }
|
|
||||||
| ActionPrompt::ElderReveal { .. }
|
|
||||||
| ActionPrompt::MasonsWake { .. }
|
|
||||||
| ActionPrompt::Shapeshifter { .. }
|
|
||||||
| ActionPrompt::Insomniac { .. }
|
|
||||||
| ActionPrompt::TraitorIntro { .. } => None,
|
|
||||||
}
|
|
||||||
}
|
|
||||||
pub(crate) const fn character_id(&self) -> Option<CharacterId> {
|
pub(crate) const fn character_id(&self) -> Option<CharacterId> {
|
||||||
match self {
|
match self {
|
||||||
ActionPrompt::TraitorIntro { character_id }
|
ActionPrompt::Insomniac { character_id, .. }
|
||||||
| ActionPrompt::Insomniac { character_id, .. }
|
|
||||||
| ActionPrompt::LoneWolfKill { character_id, .. }
|
| ActionPrompt::LoneWolfKill { character_id, .. }
|
||||||
| ActionPrompt::ElderReveal { character_id }
|
| ActionPrompt::ElderReveal { character_id }
|
||||||
| ActionPrompt::RoleChange { character_id, .. }
|
| ActionPrompt::RoleChange { character_id, .. }
|
||||||
|
|
@ -313,8 +257,7 @@ impl ActionPrompt {
|
||||||
| ActionPrompt::Mortician { character_id, .. }
|
| ActionPrompt::Mortician { character_id, .. }
|
||||||
| ActionPrompt::Vindicator { character_id, .. } => character_id.character_id == target,
|
| ActionPrompt::Vindicator { character_id, .. } => character_id.character_id == target,
|
||||||
|
|
||||||
ActionPrompt::TraitorIntro { .. }
|
ActionPrompt::Beholder { .. }
|
||||||
| ActionPrompt::Beholder { .. }
|
|
||||||
| ActionPrompt::CoverOfDarkness
|
| ActionPrompt::CoverOfDarkness
|
||||||
| ActionPrompt::WolvesIntro { .. }
|
| ActionPrompt::WolvesIntro { .. }
|
||||||
| ActionPrompt::RoleChange { .. }
|
| ActionPrompt::RoleChange { .. }
|
||||||
|
|
@ -335,28 +278,16 @@ impl ActionPrompt {
|
||||||
| ActionPrompt::LoneWolfKill { .. } => false,
|
| ActionPrompt::LoneWolfKill { .. } => false,
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn interactive(&self) -> bool {
|
|
||||||
match self {
|
|
||||||
Self::Shapeshifter { .. } => true,
|
|
||||||
_ => !matches!(
|
|
||||||
self.with_mark(CharacterId::new()),
|
|
||||||
Err(GameError::RoleDoesntMark)
|
|
||||||
),
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
pub(crate) fn with_mark(&self, mark: CharacterId) -> Result<ActionPrompt> {
|
pub(crate) fn with_mark(&self, mark: CharacterId) -> Result<ActionPrompt> {
|
||||||
let mut prompt = self.clone();
|
let mut prompt = self.clone();
|
||||||
match &mut prompt {
|
match &mut prompt {
|
||||||
ActionPrompt::TraitorIntro { .. }
|
ActionPrompt::Insomniac { .. }
|
||||||
| ActionPrompt::Insomniac { .. }
|
|
||||||
| ActionPrompt::MasonsWake { .. }
|
| ActionPrompt::MasonsWake { .. }
|
||||||
| ActionPrompt::ElderReveal { .. }
|
| ActionPrompt::ElderReveal { .. }
|
||||||
| ActionPrompt::WolvesIntro { .. }
|
| ActionPrompt::WolvesIntro { .. }
|
||||||
| ActionPrompt::RoleChange { .. }
|
| ActionPrompt::RoleChange { .. }
|
||||||
| ActionPrompt::Shapeshifter { .. }
|
| ActionPrompt::Shapeshifter { .. }
|
||||||
| ActionPrompt::CoverOfDarkness => Err(GameError::RoleDoesntMark),
|
| ActionPrompt::CoverOfDarkness => Err(GameError::InvalidMessageForGameState),
|
||||||
|
|
||||||
ActionPrompt::Guardian {
|
ActionPrompt::Guardian {
|
||||||
previous,
|
previous,
|
||||||
|
|
@ -553,13 +484,11 @@ pub enum ActionResponse {
|
||||||
MarkTarget(CharacterId),
|
MarkTarget(CharacterId),
|
||||||
Shapeshift,
|
Shapeshift,
|
||||||
Continue,
|
Continue,
|
||||||
ContinueToResult,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
pub enum ActionResult {
|
pub enum ActionResult {
|
||||||
RoleBlocked,
|
RoleBlocked,
|
||||||
Drunk,
|
|
||||||
Seer(Alignment),
|
Seer(Alignment),
|
||||||
PowerSeer { powerful: Powerful },
|
PowerSeer { powerful: Powerful },
|
||||||
Adjudicator { killer: Killer },
|
Adjudicator { killer: Killer },
|
||||||
|
|
@ -569,42 +498,10 @@ pub enum ActionResult {
|
||||||
Insomniac(Visits),
|
Insomniac(Visits),
|
||||||
Empath { scapegoat: bool },
|
Empath { scapegoat: bool },
|
||||||
BeholderSawNothing,
|
BeholderSawNothing,
|
||||||
BeholderSawEverything,
|
|
||||||
GoBackToSleep,
|
GoBackToSleep,
|
||||||
ShiftFailed,
|
|
||||||
Continue,
|
Continue,
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ActionResult {
|
|
||||||
pub fn insane(&self) -> Option<Self> {
|
|
||||||
Some(match self {
|
|
||||||
ActionResult::Seer(Alignment::Village) => ActionResult::Seer(Alignment::Wolves),
|
|
||||||
ActionResult::Seer(Alignment::Traitor) | ActionResult::Seer(Alignment::Wolves) => {
|
|
||||||
ActionResult::Seer(Alignment::Village)
|
|
||||||
}
|
|
||||||
ActionResult::PowerSeer { powerful } => ActionResult::PowerSeer {
|
|
||||||
powerful: !*powerful,
|
|
||||||
},
|
|
||||||
ActionResult::Adjudicator { killer } => ActionResult::Adjudicator { killer: !*killer },
|
|
||||||
ActionResult::Arcanist(alignment_eq) => ActionResult::Arcanist(!*alignment_eq),
|
|
||||||
ActionResult::Empath { scapegoat } => ActionResult::Empath {
|
|
||||||
scapegoat: !*scapegoat,
|
|
||||||
},
|
|
||||||
ActionResult::BeholderSawNothing => ActionResult::BeholderSawEverything,
|
|
||||||
ActionResult::BeholderSawEverything => ActionResult::BeholderSawNothing,
|
|
||||||
|
|
||||||
ActionResult::ShiftFailed
|
|
||||||
| ActionResult::RoleBlocked
|
|
||||||
| ActionResult::Drunk
|
|
||||||
| ActionResult::GraveDigger(_)
|
|
||||||
| ActionResult::Mortician(_)
|
|
||||||
| ActionResult::Insomniac(_)
|
|
||||||
| ActionResult::GoBackToSleep
|
|
||||||
| ActionResult::Continue => return None,
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
pub struct Visits(Box<[CharacterIdentity]>);
|
pub struct Visits(Box<[CharacterIdentity]>);
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -131,37 +131,31 @@ pub enum Role {
|
||||||
#[checks(Powerful::Powerful)]
|
#[checks(Powerful::Powerful)]
|
||||||
#[checks(Killer::NotKiller)]
|
#[checks(Killer::NotKiller)]
|
||||||
#[checks("is_mentor")]
|
#[checks("is_mentor")]
|
||||||
#[checks("doesnt_wake_if_died_tonight")]
|
|
||||||
Seer,
|
Seer,
|
||||||
#[checks(Alignment::Village)]
|
#[checks(Alignment::Village)]
|
||||||
#[checks(Powerful::Powerful)]
|
#[checks(Powerful::Powerful)]
|
||||||
#[checks(Killer::NotKiller)]
|
#[checks(Killer::NotKiller)]
|
||||||
#[checks("is_mentor")]
|
#[checks("is_mentor")]
|
||||||
#[checks("doesnt_wake_if_died_tonight")]
|
|
||||||
Arcanist,
|
Arcanist,
|
||||||
#[checks(Alignment::Village)]
|
#[checks(Alignment::Village)]
|
||||||
#[checks(Powerful::Powerful)]
|
#[checks(Powerful::Powerful)]
|
||||||
#[checks(Killer::NotKiller)]
|
#[checks(Killer::NotKiller)]
|
||||||
#[checks("is_mentor")]
|
#[checks("is_mentor")]
|
||||||
#[checks("doesnt_wake_if_died_tonight")]
|
|
||||||
Adjudicator,
|
Adjudicator,
|
||||||
#[checks(Alignment::Village)]
|
#[checks(Alignment::Village)]
|
||||||
#[checks(Powerful::Powerful)]
|
#[checks(Powerful::Powerful)]
|
||||||
#[checks(Killer::NotKiller)]
|
#[checks(Killer::NotKiller)]
|
||||||
#[checks("is_mentor")]
|
#[checks("is_mentor")]
|
||||||
#[checks("doesnt_wake_if_died_tonight")]
|
|
||||||
PowerSeer,
|
PowerSeer,
|
||||||
#[checks(Alignment::Village)]
|
#[checks(Alignment::Village)]
|
||||||
#[checks(Powerful::Powerful)]
|
#[checks(Powerful::Powerful)]
|
||||||
#[checks(Killer::NotKiller)]
|
#[checks(Killer::NotKiller)]
|
||||||
#[checks("is_mentor")]
|
#[checks("is_mentor")]
|
||||||
#[checks("doesnt_wake_if_died_tonight")]
|
|
||||||
Mortician,
|
Mortician,
|
||||||
#[checks(Alignment::Village)]
|
#[checks(Alignment::Village)]
|
||||||
#[checks(Powerful::Powerful)]
|
#[checks(Powerful::Powerful)]
|
||||||
#[checks(Killer::NotKiller)]
|
#[checks(Killer::NotKiller)]
|
||||||
#[checks("is_mentor")]
|
#[checks("is_mentor")]
|
||||||
#[checks("doesnt_wake_if_died_tonight")]
|
|
||||||
Beholder,
|
Beholder,
|
||||||
#[checks(Alignment::Village)]
|
#[checks(Alignment::Village)]
|
||||||
#[checks(Powerful::Powerful)]
|
#[checks(Powerful::Powerful)]
|
||||||
|
|
@ -203,7 +197,6 @@ pub enum Role {
|
||||||
#[checks(Powerful::Powerful)]
|
#[checks(Powerful::Powerful)]
|
||||||
#[checks(Killer::NotKiller)]
|
#[checks(Killer::NotKiller)]
|
||||||
#[checks("is_mentor")]
|
#[checks("is_mentor")]
|
||||||
#[checks("doesnt_wake_if_died_tonight")]
|
|
||||||
Gravedigger,
|
Gravedigger,
|
||||||
#[checks(Alignment::Village)]
|
#[checks(Alignment::Village)]
|
||||||
#[checks(Killer::Killer)]
|
#[checks(Killer::Killer)]
|
||||||
|
|
@ -248,7 +241,6 @@ pub enum Role {
|
||||||
#[checks(Alignment::Village)]
|
#[checks(Alignment::Village)]
|
||||||
#[checks(Powerful::Powerful)]
|
#[checks(Powerful::Powerful)]
|
||||||
#[checks(Killer::NotKiller)]
|
#[checks(Killer::NotKiller)]
|
||||||
#[checks("doesnt_wake_if_died_tonight")]
|
|
||||||
Insomniac,
|
Insomniac,
|
||||||
|
|
||||||
#[checks(Alignment::Wolves)]
|
#[checks(Alignment::Wolves)]
|
||||||
|
|
@ -326,7 +318,7 @@ impl Role {
|
||||||
|
|
||||||
Role::Werewolf => KillingWolfOrder::Werewolf,
|
Role::Werewolf => KillingWolfOrder::Werewolf,
|
||||||
Role::AlphaWolf { .. } => KillingWolfOrder::AlphaWolf,
|
Role::AlphaWolf { .. } => KillingWolfOrder::AlphaWolf,
|
||||||
Role::Bloodletter => KillingWolfOrder::Bloodletter,
|
Role::Bloodletter { .. } => KillingWolfOrder::Bloodletter,
|
||||||
Role::DireWolf { .. } => KillingWolfOrder::DireWolf,
|
Role::DireWolf { .. } => KillingWolfOrder::DireWolf,
|
||||||
Role::Shapeshifter { .. } => KillingWolfOrder::Shapeshifter,
|
Role::Shapeshifter { .. } => KillingWolfOrder::Shapeshifter,
|
||||||
Role::LoneWolf => KillingWolfOrder::LoneWolf,
|
Role::LoneWolf => KillingWolfOrder::LoneWolf,
|
||||||
|
|
@ -477,7 +469,7 @@ impl Display for Alignment {
|
||||||
match self {
|
match self {
|
||||||
Alignment::Village => f.write_str("Village"),
|
Alignment::Village => f.write_str("Village"),
|
||||||
Alignment::Wolves => f.write_str("Wolves"),
|
Alignment::Wolves => f.write_str("Wolves"),
|
||||||
Alignment::Traitor => f.write_str("Traitor"),
|
Alignment::Traitor => f.write_str("Damned"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -493,7 +485,7 @@ pub enum ArcanistCheck {
|
||||||
pub const MAPLE_WOLF_ABSTAIN_LIMIT: NonZeroU8 = NonZeroU8::new(3).unwrap();
|
pub const MAPLE_WOLF_ABSTAIN_LIMIT: NonZeroU8 = NonZeroU8::new(3).unwrap();
|
||||||
pub const PYREMASTER_VILLAGER_KILLS_TO_DIE: NonZeroU8 = NonZeroU8::new(2).unwrap();
|
pub const PYREMASTER_VILLAGER_KILLS_TO_DIE: NonZeroU8 = NonZeroU8::new(2).unwrap();
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
|
#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
|
||||||
pub enum RoleBlock {
|
pub enum RoleBlock {
|
||||||
Direwolf,
|
Direwolf,
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
use core::{net::SocketAddr, time::Duration};
|
use core::{net::SocketAddr, time::Duration};
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
AppState, XForwardedFor,
|
AppState, LogError, XForwardedFor,
|
||||||
connection::{ConnectionId, JoinedPlayer},
|
connection::{ConnectionId, JoinedPlayer},
|
||||||
runner::IdentifiedClientMessage,
|
runner::IdentifiedClientMessage,
|
||||||
};
|
};
|
||||||
|
|
@ -26,7 +26,7 @@ use axum::{
|
||||||
},
|
},
|
||||||
response::IntoResponse,
|
response::IntoResponse,
|
||||||
};
|
};
|
||||||
use axum_extra::TypedHeader;
|
use axum_extra::{TypedHeader, headers};
|
||||||
use chrono::Utc;
|
use chrono::Utc;
|
||||||
use colored::Colorize;
|
use colored::Colorize;
|
||||||
use tokio::sync::broadcast::{Receiver, Sender};
|
use tokio::sync::broadcast::{Receiver, Sender};
|
||||||
|
|
@ -34,6 +34,7 @@ use werewolves_proto::message::{ClientMessage, Identification, ServerMessage, Up
|
||||||
|
|
||||||
pub async fn handler(
|
pub async fn handler(
|
||||||
ws: WebSocketUpgrade,
|
ws: WebSocketUpgrade,
|
||||||
|
user_agent: Option<TypedHeader<headers::UserAgent>>,
|
||||||
x_forwarded_for: Option<TypedHeader<XForwardedFor>>,
|
x_forwarded_for: Option<TypedHeader<XForwardedFor>>,
|
||||||
ConnectInfo(addr): ConnectInfo<SocketAddr>,
|
ConnectInfo(addr): ConnectInfo<SocketAddr>,
|
||||||
State(state): State<AppState>,
|
State(state): State<AppState>,
|
||||||
|
|
@ -42,7 +43,12 @@ pub async fn handler(
|
||||||
.map(|x| x.to_string())
|
.map(|x| x.to_string())
|
||||||
.unwrap_or_else(|| addr.to_string())
|
.unwrap_or_else(|| addr.to_string())
|
||||||
.italic();
|
.italic();
|
||||||
|
// log::debug!(
|
||||||
|
// "{who}{} connected.",
|
||||||
|
// user_agent
|
||||||
|
// .map(|agent| format!(" (User-Agent: {})", agent.as_str()))
|
||||||
|
// .unwrap_or_default(),
|
||||||
|
// );
|
||||||
let player_list = state.joined_players;
|
let player_list = state.joined_players;
|
||||||
|
|
||||||
// finalize the upgrade process by returning upgrade callback.
|
// finalize the upgrade process by returning upgrade callback.
|
||||||
|
|
@ -202,7 +208,7 @@ impl Client {
|
||||||
|
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
Message::Close(Some(_)) => {
|
Message::Close(Some(close_frame)) => {
|
||||||
// log::debug!("sent close frame: {close_frame:?}");
|
// log::debug!("sent close frame: {close_frame:?}");
|
||||||
return Ok(());
|
return Ok(());
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use colored::Colorize;
|
|
||||||
use tokio::sync::{broadcast::Sender, mpsc::Receiver};
|
use tokio::sync::{broadcast::Sender, mpsc::Receiver};
|
||||||
use werewolves_proto::{
|
use werewolves_proto::{
|
||||||
error::GameError,
|
error::GameError,
|
||||||
|
|
@ -46,10 +45,6 @@ impl HostComms {
|
||||||
}
|
}
|
||||||
|
|
||||||
pub fn send(&mut self, message: ServerToHostMessage) -> Result<(), GameError> {
|
pub fn send(&mut self, message: ServerToHostMessage) -> Result<(), GameError> {
|
||||||
log::debug!(
|
|
||||||
"sending message to host: {}",
|
|
||||||
format!("{message:?}").dimmed()
|
|
||||||
);
|
|
||||||
self.send
|
self.send
|
||||||
.send(message)
|
.send(message)
|
||||||
.map_err(|err| GameError::GenericError(err.to_string()))?;
|
.map_err(|err| GameError::GenericError(err.to_string()))?;
|
||||||
|
|
|
||||||
|
|
@ -296,7 +296,7 @@ impl GameRunner {
|
||||||
HostMessage::GetState => self.game.process(HostGameMessage::GetState),
|
HostMessage::GetState => self.game.process(HostGameMessage::GetState),
|
||||||
HostMessage::InGame(msg) => self.game.process(msg),
|
HostMessage::InGame(msg) => self.game.process(msg),
|
||||||
HostMessage::Lobby(_) | HostMessage::PostGame(_) | HostMessage::ForceRoleAckFor(_) => {
|
HostMessage::Lobby(_) | HostMessage::PostGame(_) | HostMessage::ForceRoleAckFor(_) => {
|
||||||
Err(GameError::GameOngoing)
|
Err(GameError::InvalidMessageForGameState)
|
||||||
}
|
}
|
||||||
HostMessage::Echo(echo) => Ok(echo),
|
HostMessage::Echo(echo) => Ok(echo),
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -146,6 +146,7 @@ impl Host {
|
||||||
msg = self.server_recv.recv() => {
|
msg = self.server_recv.recv() => {
|
||||||
match msg {
|
match msg {
|
||||||
Ok(msg) => {
|
Ok(msg) => {
|
||||||
|
log::debug!("sending message to host: {}", format!("{msg:?}").dimmed());
|
||||||
if let Err(err) = self.send_message(&msg).await {
|
if let Err(err) = self.send_message(&msg).await {
|
||||||
log::error!("{} {err}", "[host::outgoing]".bold())
|
log::error!("{} {err}", "[host::outgoing]".bold())
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -2,9 +2,9 @@
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
<svg
|
<svg
|
||||||
width="58.49649mm"
|
width="45.363396mm"
|
||||||
height="55.059494mm"
|
height="45.36343mm"
|
||||||
viewBox="0 0 58.49649 55.059494"
|
viewBox="0 0 45.363396 45.36343"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
id="svg1"
|
id="svg1"
|
||||||
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||||
|
|
@ -24,9 +24,9 @@
|
||||||
inkscape:deskcolor="#d1d1d1"
|
inkscape:deskcolor="#d1d1d1"
|
||||||
inkscape:document-units="mm"
|
inkscape:document-units="mm"
|
||||||
showgrid="false"
|
showgrid="false"
|
||||||
inkscape:zoom="2.8284271"
|
inkscape:zoom="1"
|
||||||
inkscape:cx="470.75634"
|
inkscape:cx="1108.5"
|
||||||
inkscape:cy="2967.1969"
|
inkscape:cy="797.49998"
|
||||||
inkscape:window-width="1918"
|
inkscape:window-width="1918"
|
||||||
inkscape:window-height="1042"
|
inkscape:window-height="1042"
|
||||||
inkscape:window-x="0"
|
inkscape:window-x="0"
|
||||||
|
|
@ -35,8 +35,8 @@
|
||||||
inkscape:current-layer="layer4"><inkscape:grid
|
inkscape:current-layer="layer4"><inkscape:grid
|
||||||
id="grid1"
|
id="grid1"
|
||||||
units="mm"
|
units="mm"
|
||||||
originx="-29.360038"
|
originx="-266.17087"
|
||||||
originy="-825.92692"
|
originy="-217.22292"
|
||||||
spacingx="0.26458333"
|
spacingx="0.26458333"
|
||||||
spacingy="0.26458334"
|
spacingy="0.26458334"
|
||||||
empcolor="#0099e5"
|
empcolor="#0099e5"
|
||||||
|
|
@ -48,232 +48,46 @@
|
||||||
visible="false" /><inkscape:page
|
visible="false" /><inkscape:page
|
||||||
x="0"
|
x="0"
|
||||||
y="0"
|
y="0"
|
||||||
width="58.49649"
|
width="45.363396"
|
||||||
height="55.059494"
|
height="45.36343"
|
||||||
id="page2"
|
id="page2"
|
||||||
margin="0"
|
margin="0"
|
||||||
bleed="0" /></sodipodi:namedview><defs
|
bleed="0" /></sodipodi:namedview><defs
|
||||||
id="defs1"><inkscape:path-effect
|
id="defs1" /><g
|
||||||
effect="interpolate_points"
|
|
||||||
id="path-effect41-5"
|
|
||||||
is_visible="true"
|
|
||||||
lpeversion="1"
|
|
||||||
interpolator_type="CubicBezierJohan" /><inkscape:path-effect
|
|
||||||
effect="interpolate_points"
|
|
||||||
id="path-effect41-8"
|
|
||||||
is_visible="true"
|
|
||||||
lpeversion="1"
|
|
||||||
interpolator_type="CubicBezierJohan" /><inkscape:path-effect
|
|
||||||
effect="interpolate_points"
|
|
||||||
id="path-effect41-5-67"
|
|
||||||
is_visible="true"
|
|
||||||
lpeversion="1"
|
|
||||||
interpolator_type="CubicBezierJohan" /><inkscape:path-effect
|
|
||||||
effect="interpolate_points"
|
|
||||||
id="path-effect41-8-3"
|
|
||||||
is_visible="true"
|
|
||||||
lpeversion="1"
|
|
||||||
interpolator_type="CubicBezierJohan" /></defs><g
|
|
||||||
inkscape:groupmode="layer"
|
inkscape:groupmode="layer"
|
||||||
id="layer4"
|
id="layer4"
|
||||||
inkscape:label="Layer 4"
|
inkscape:label="Layer 4"
|
||||||
transform="translate(-29.360037,-825.92694)"><g
|
transform="translate(-266.17087,-217.22291)"><g
|
||||||
id="g43"
|
id="g61"
|
||||||
transform="translate(0.07389574)"><g
|
transform="translate(-56.091665,-3.7041666)"><path
|
||||||
id="g42-4"
|
d="m 347.07926,221.66934 c -0.45815,-0.0281 -0.90857,0.004 -1.35031,0.0992 -1.05487,0.22775 -2.05439,0.76275 -2.99671,1.56425 -1.13002,-0.2664 -2.18934,-0.42422 -3.16415,-0.46147 -0.97482,-0.0373 -1.86513,0.0461 -2.65772,0.26096 -0.38599,0.10465 -0.74872,0.24076 -1.08675,0.40928 -0.41079,0.20479 -0.78496,0.45722 -1.11983,0.76068 -0.79968,0.72467 -1.398,1.68777 -1.81333,2.85306 -2.22365,0.66859 -3.98388,1.57251 -5.1418,2.7373 -0.28196,0.28362 -0.52842,0.58265 -0.73691,0.89762 -0.25336,0.38274 -0.45083,0.7888 -0.58911,1.21904 -0.33021,1.02743 -0.36713,2.16074 -0.14418,3.37757 -1.59144,1.69085 -2.66416,3.35361 -3.08456,4.9413 -0.10237,0.38661 -0.16607,0.76866 -0.18914,1.14567 -0.028,0.45815 0.004,0.90857 0.0992,1.35031 0.22775,1.05487 0.76275,2.05439 1.56424,2.99671 -0.5328,2.26004 -0.63027,4.23669 -0.2005,5.82187 0.10465,0.38599 0.24024,0.74872 0.40876,1.08675 0.20479,0.41079 0.45773,0.78496 0.76119,1.11983 0.72468,0.79968 1.68778,1.398 2.85306,1.81333 0.6686,2.22365 1.57252,3.9844 2.7373,5.14232 0.28363,0.28196 0.58266,0.5279 0.89762,0.73639 0.38275,0.25336 0.7888,0.45083 1.21905,0.58911 1.02742,0.33021 2.16074,0.36713 3.37757,0.14418 1.69085,1.59144 3.35361,2.66417 4.9413,3.08456 0.3866,0.10237 0.76866,0.16607 1.14567,0.18914 0.45814,0.028 0.90856,-0.004 1.3503,-0.0992 1.05488,-0.22774 2.05439,-0.76274 2.99672,-1.56424 2.26004,0.5328 4.23668,0.63027 5.82186,0.2005 0.386,-0.10465 0.74873,-0.24024 1.08676,-0.40876 0.41079,-0.20479 0.78496,-0.45773 1.11983,-0.76119 0.79967,-0.72468 1.398,-1.68778 1.81332,-2.85306 2.22366,-0.6686 3.9844,-1.57252 5.14233,-2.7373 0.28195,-0.28363 0.5279,-0.58266 0.73639,-0.89762 0.25335,-0.38275 0.45083,-0.7888 0.58911,-1.21905 0.3302,-1.02742 0.36713,-2.16074 0.14417,-3.37757 1.59144,-1.69085 2.66417,-3.35361 3.08457,-4.9413 0.10237,-0.3866 0.16606,-0.76866 0.18914,-1.14567 0.028,-0.45814 -0.004,-0.90856 -0.0992,-1.3503 -0.22775,-1.05488 -0.76275,-2.05439 -1.56425,-2.99672 0.5328,-2.26003 0.63028,-4.23668 0.2005,-5.82186 -0.10465,-0.386 -0.24024,-0.74873 -0.40876,-1.08676 -0.20479,-0.41079 -0.45773,-0.78495 -0.76119,-1.11983 -0.72467,-0.79967 -1.68777,-1.39799 -2.85306,-1.81332 -0.66859,-2.22366 -1.57251,-3.98389 -2.7373,-5.14181 -0.28362,-0.28195 -0.58266,-0.52842 -0.89762,-0.7369 -0.38274,-0.25336 -0.7888,-0.45084 -1.21904,-0.58912 -1.02743,-0.3302 -2.16075,-0.36713 -3.37757,-0.14417 -1.69085,-1.59144 -3.35361,-2.66417 -4.94131,-3.08457 -0.3866,-0.10237 -0.76866,-0.16606 -1.14566,-0.18913 z m -2.62206,11.10371 c 1.90227,0.35928 3.73774,0.76228 5.48338,1.2082 1.46778,1.26227 2.85564,2.5294 4.14445,3.78839 0.63999,1.82705 1.20834,3.61793 1.69499,5.35265 -0.35928,1.90227 -0.76228,3.73723 -1.2082,5.48287 -1.26227,1.46777 -2.52889,2.85563 -3.78788,4.14445 -1.82705,0.63999 -3.61792,1.20833 -5.35264,1.69499 -1.90227,-0.35928 -3.73775,-0.76229 -5.48339,-1.2082 -1.46777,-1.26228 -2.85563,-2.52889 -4.14445,-3.78788 -0.63999,-1.82705 -1.20833,-3.61792 -1.69499,-5.35265 0.35928,-1.90226 0.76229,-3.73774 1.2082,-5.48338 1.26228,-1.46778 2.52889,-2.85564 3.78788,-4.14445 1.82705,-0.63999 3.61792,-1.20834 5.35265,-1.69499 z"
|
||||||
transform="matrix(0.70710678,0.70711411,-0.70710678,0.70711411,584.35218,19.075908)"><ellipse
|
style="fill:#d5ffc9;fill-opacity:1;stroke:#5fff32;stroke-width:1.465;stroke-opacity:1"
|
||||||
style="fill:#00c002;fill-opacity:1;stroke:#005c01;stroke-width:1.00001;stroke-dasharray:none;stroke-opacity:1"
|
id="path40-7" /><path
|
||||||
id="path30-7-7-7-0"
|
sodipodi:type="spiral"
|
||||||
cx="640.62866"
|
style="fill:none;fill-rule:evenodd;stroke:#86ff61;stroke-width:0.565;stroke-dasharray:none;stroke-opacity:1"
|
||||||
cy="431.71231"
|
id="path61"
|
||||||
rx="15.000077"
|
sodipodi:cx="342.65289"
|
||||||
ry="25.00013"
|
sodipodi:cy="241.25082"
|
||||||
transform="matrix(0.99999481,0,0,0.99999481,-426.68795,399.71083)" /><path
|
sodipodi:expansion="1"
|
||||||
style="fill:#008f01;fill-opacity:1;stroke:none;stroke-width:0.264582px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
sodipodi:revolution="9.8757124"
|
||||||
d="m 214.03823,813.19332 c 0.71309,-15.32992 8.97923,-0.53496 12.11391,4.16265 6.26402,9.3872 0.46548,27.18307 -0.66824,29.84063 -2.16386,5.07231 -9.57501,9.49461 -9.57501,9.49461 l -1.73056,0.14033 c 0.22402,-14.53822 -0.81593,-29.10943 -0.1401,-43.63822 z"
|
sodipodi:radius="19.917585"
|
||||||
id="path45-1"
|
sodipodi:argument="-17.350523"
|
||||||
sodipodi:nodetypes="sssccs" /><g
|
sodipodi:t0="0.0044709877"
|
||||||
id="g37-4"
|
d="m 342.63471,241.338 c -0.14905,0.28891 -0.50558,-0.0176 -0.56257,-0.20833 -0.14974,-0.50126 0.34837,-0.9171 0.80488,-0.95318 0.77741,-0.0615 1.34953,0.67239 1.34379,1.40143 -0.008,1.04713 -0.99858,1.78883 -1.99798,1.7344 -1.31593,-0.0717 -2.23097,-1.32542 -2.12501,-2.59452 0.1323,-1.58458 1.65253,-2.6746 3.19107,-2.51563 1.85321,0.19148 3.11907,1.9798 2.90624,3.78762 -0.24981,2.12187 -2.30716,3.56409 -4.38417,3.29685 -2.39056,-0.30758 -4.00948,-2.63459 -3.68746,-4.98072 0.36499,-2.65927 2.96206,-4.45512 5.57726,-4.07807 2.92802,0.42215 4.90096,3.28957 4.46869,6.17381 -0.47911,3.19677 -3.61711,5.34694 -6.77036,4.8593 -3.46555,-0.53593 -5.79303,-3.94466 -5.24992,-7.36691 0.59265,-3.73433 4.27224,-6.2392 7.96347,-5.64052 4.00312,0.64926 6.68544,4.59982 6.03113,8.56001 -0.70581,4.27192 -4.92742,7.13174 -9.15656,6.42174 -4.54073,-0.76231 -7.57809,-5.25502 -6.81236,-9.7531 0.81876,-4.80955 5.58264,-8.02449 10.34966,-7.20298 5.07837,0.87517 8.4709,5.91026 7.59358,10.94621 -0.93154,5.3472 -6.23788,8.91735 -11.54275,7.98419 -5.61603,-0.98788 -9.36382,-6.56551 -8.37481,-12.1393 1.04421,-5.88486 6.89315,-9.81031 12.73585,-8.76542 6.1537,1.10051 10.25683,7.22079 9.15603,13.3324 -1.15679,6.42254 -7.54842,10.70335 -13.92894,9.54665 -6.69138,-1.21307 -11.14989,-7.87608 -9.93726,-14.5255 1.26932,-6.96022 8.20372,-11.59645 15.12205,-10.32787 7.22906,1.32556 12.043,8.53137 10.71848,15.7186 -1.38179,7.49791 -8.85902,12.48958 -16.31515,11.10909 -7.76676,-1.43801 -12.93616,-9.18668 -11.4997,-16.91169 1.49422,-8.03561 9.51433,-13.38276 17.50824,-11.89032 8.30446,1.55042 13.82935,9.84199 12.28093,18.10479 -1.60662,8.57331 -10.16965,14.27596 -18.70134,12.67154 -8.84216,-1.66281 -14.72257,-10.4973 -13.06215,-19.29789 1.71899,-9.11102 10.82496,-15.16918 19.89443,-13.45276 9.37988,1.77516 15.61581,11.15262 13.84338,20.49098 -1.83134,9.64873 -11.48029,16.06243 -21.08753,14.23399 -9.91759,-1.88751 -16.50906,-11.80795 -14.6246,-21.68408 1.94367,-10.18644 12.13561,-16.95569 22.28063,-15.01521 10.4553,1.99983 17.40232,12.46328 15.40582,22.87718 -0.63903,3.33322 -2.14652,6.47994 -4.33787,9.07108"
|
||||||
inkscape:path-effect="#path-effect41-5"><path
|
transform="translate(1.7875357,2.8617786)" /><g
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
id="g59"><path
|
||||||
d="m 213.93749,856.03808 c 0,0 2e-5,-42.87351 2e-5,-42.87351"
|
d="m 344.4572,232.77302 c -1.73473,0.48665 -3.5256,1.055 -5.35265,1.69499 -1.25899,1.28881 -2.5256,2.67667 -3.78788,4.14445 -0.44591,1.74564 -0.84891,3.58112 -1.20819,5.48338 0.48665,1.73473 1.055,3.5256 1.69498,5.35265 1.28882,1.25899 2.67668,2.5256 4.14445,3.78788 1.74564,0.44591 3.58112,0.84892 5.48339,1.2082 1.73472,-0.48666 3.52559,-1.055 5.35264,-1.69499 1.25899,-1.28882 2.52561,-2.67668 3.78789,-4.14445 0.44591,-1.74564 0.84891,-3.5806 1.20819,-5.48287 -0.48665,-1.73472 -1.055,-3.52559 -1.69499,-5.35264 -1.28881,-1.25899 -2.67667,-2.52613 -4.14445,-3.7884 -1.74564,-0.44592 -3.58111,-0.84892 -5.48338,-1.2082 z"
|
||||||
id="path36-6-4"
|
style="fill:#26d734;fill-opacity:1;stroke:#9a9700;stroke-width:1.465;stroke-opacity:0.600002"
|
||||||
inkscape:original-d="m 213.93749,856.03808 2e-5,-42.87351" /><path
|
id="path42-5" /><path
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
sodipodi:type="spiral"
|
||||||
d="m 222.85539,838.83313 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
style="fill:none;fill-rule:evenodd;stroke:#fffa32;stroke-width:1.065;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="path37-2-6-1-5-3"
|
id="path59"
|
||||||
sodipodi:nodetypes="ccc"
|
sodipodi:cx="335.75626"
|
||||||
inkscape:original-d="m 222.85539,838.83313 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
sodipodi:cy="233.09792"
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
sodipodi:expansion="1"
|
||||||
d="m 222.85539,830.04627 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
sodipodi:revolution="3"
|
||||||
id="path37-2-6-4-6-0"
|
sodipodi:radius="10.089354"
|
||||||
sodipodi:nodetypes="ccc"
|
sodipodi:argument="-19.333729"
|
||||||
inkscape:original-d="m 222.85539,830.04627 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
sodipodi:t0="0"
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
d="m 335.75626,233.09792 c 0.44772,-0.23547 0.53829,0.48734 0.39136,0.74414 -0.39818,0.69589 -1.39291,0.51861 -1.87964,0.0386 -0.87067,-0.85865 -0.55945,-2.28928 0.31419,-3.01515 1.28209,-1.06524 3.19926,-0.60551 4.15065,0.66697 1.26805,1.69602 0.65405,4.11428 -1.01975,5.28616 -2.1063,1.47469 -5.03172,0.70392 -6.42166,-1.37253 -1.68339,-2.51485 -0.75456,-5.95055 1.7253,-7.55716 2.92244,-1.89333 6.87026,-0.8057 8.69267,2.07808 2.10404,3.32944 0.85716,7.79053 -2.43086,9.82817 -3.73605,2.31529 -8.71121,0.90885 -10.96367,-2.78363 -2.52692,-4.14241 -0.9607,-9.63219 3.13641,-12.09918 4.54858,-2.73883 10.55339,-1.01268 13.23468,3.48919"
|
||||||
d="m 222.85539,821.2594 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
transform="matrix(0.8,0,0,0.8,76.234013,57.800034)" /></g></g></g></svg>
|
||||||
id="path37-2-6-10-9-7"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,821.2594 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 220.85563,815.47302 c -1.38363,0 -5.5345,5.99535 -6.91813,5.99535 -1.38357,0 -5.5343,-5.99535 -6.91787,-5.99535"
|
|
||||||
id="path37-2-6-6-3-8"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 220.85563,815.47302 -6.91813,5.99535 -6.91787,-5.99535" /></g><ellipse
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#005c01;stroke-width:1;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-7"
|
|
||||||
cx="213.9375"
|
|
||||||
cy="831.42084"
|
|
||||||
rx="15"
|
|
||||||
ry="25"
|
|
||||||
transform="translate(7.5790061e-6)" /></g><g
|
|
||||||
id="g42-1"
|
|
||||||
transform="rotate(-45,70.430131,928.10363)"><ellipse
|
|
||||||
style="fill:#00c002;fill-opacity:1;stroke:#005c01;stroke-width:1.00001;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-7-0-9"
|
|
||||||
cx="-213.94203"
|
|
||||||
cy="831.42212"
|
|
||||||
rx="15.000077"
|
|
||||||
ry="25.00013"
|
|
||||||
transform="matrix(-1,5.1823562e-6,-5.1823562e-6,1,0,0)" /><path
|
|
||||||
style="fill:#008f01;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="m 213.63731,813.23745 c -0.71301,-15.33 -8.97927,-0.53492 -12.11399,4.16273 -6.2641,9.38728 -0.46562,27.18322 0.66809,29.84078 2.16384,5.07233 9.57501,9.49461 9.57501,9.49461 l 1.73057,0.14033 c -0.22395,-14.5383 0.81608,-29.10959 0.14032,-43.63845 z"
|
|
||||||
id="path45-1-7"
|
|
||||||
sodipodi:nodetypes="sssccs" /><g
|
|
||||||
id="g37-9"
|
|
||||||
inkscape:path-effect="#path-effect41-8"><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 213.93749,856.03808 c 0,0 2e-5,-42.87351 2e-5,-42.87351"
|
|
||||||
id="path36-6-2"
|
|
||||||
inkscape:original-d="m 213.93749,856.03808 2e-5,-42.87351" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,838.83313 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-1-5-0"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,838.83313 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,830.04627 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-4-6-6"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,830.04627 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,821.2594 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-10-9-8"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,821.2594 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 220.85563,815.47302 c -1.38363,0 -5.5345,5.99535 -6.91813,5.99535 -1.38357,0 -5.5343,-5.99535 -6.91787,-5.99535"
|
|
||||||
id="path37-2-6-6-3-9"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 220.85563,815.47302 -6.91813,5.99535 -6.91787,-5.99535" /></g><ellipse
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#005c01;stroke-width:1;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-4"
|
|
||||||
cx="213.9375"
|
|
||||||
cy="831.42084"
|
|
||||||
rx="15"
|
|
||||||
ry="25"
|
|
||||||
transform="translate(-9.3315134e-6)" /></g><g
|
|
||||||
id="g63"><path
|
|
||||||
id="rect33-6"
|
|
||||||
style="fill:#005c01;fill-opacity:1;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 57.136103,850.95756 -1.50032,-0.57183 -1.84004,1.853 3.34036,2.084 1.2e-4,13.42718 c 0,0 0.4451,1.28623 1.346,1.28623 0.83175,0 1.346,-1.28623 1.346,-1.28623 l -2.9e-4,-13.42718 2.71198,-2.084 -1.37887,-1.853 -1.33311,0.57183 z"
|
|
||||||
sodipodi:nodetypes="cccccscccccc" /><path
|
|
||||||
d="m 60.527143,867.65428 c 0,0 -1.28908,1.47478 -2.12083,1.47478 -0.9009,0 -1.99075,-1.42264 -1.99075,-1.42264 -4.65194,0.59664 -5.92716,3.58427 -8.28253,4.70926 -2.52584,1.20643 -11.53768,1.98812 -11.53779,3.7052 10e-6,2.41107 9.83202,4.36562 21.96041,4.36562 12.12839,0 21.96041,-1.95455 21.96042,-4.36562 10e-6,-1.68893 -9.37115,-3.14116 -11.61634,-3.7052 -2.57054,-0.64577 -3.5869,-4.17719 -8.37259,-4.7614 z"
|
|
||||||
style="fill:#8f4c00;stroke:#5c3100;stroke-linecap:round"
|
|
||||||
id="path57-3"
|
|
||||||
sodipodi:nodetypes="cscscsssc" /><g
|
|
||||||
id="g42-4-4"
|
|
||||||
transform="matrix(0.46393276,0.46393757,-0.46393276,0.46393757,360.22685,355.15504)"
|
|
||||||
style="stroke-width:1.52415;stroke-dasharray:none"><ellipse
|
|
||||||
style="fill:#00c002;fill-opacity:1;stroke:#005c01;stroke-width:1.52416;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-7-0-8"
|
|
||||||
cx="640.62866"
|
|
||||||
cy="431.71231"
|
|
||||||
rx="15.000077"
|
|
||||||
ry="25.00013"
|
|
||||||
transform="matrix(0.99999481,0,0,0.99999481,-426.68795,399.71083)" /><path
|
|
||||||
style="fill:#008f01;fill-opacity:1;stroke:none;stroke-width:1.52415;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 214.03823,813.19332 c 0.71309,-15.32992 8.97923,-0.53496 12.11391,4.16265 6.26402,9.3872 0.46548,27.18307 -0.66824,29.84063 -2.16386,5.07231 -9.57501,9.49461 -9.57501,9.49461 l -1.73056,0.14033 c 0.22402,-14.53822 -0.81593,-29.10943 -0.1401,-43.63822 z"
|
|
||||||
id="path45-1-1"
|
|
||||||
sodipodi:nodetypes="sssccs" /><g
|
|
||||||
id="g37-4-2"
|
|
||||||
inkscape:path-effect="#path-effect41-5-67"
|
|
||||||
style="stroke-width:1.52415;stroke-dasharray:none"><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52415;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 213.93749,856.03808 c 0,0 2e-5,-42.87351 2e-5,-42.87351"
|
|
||||||
id="path36-6-4-9"
|
|
||||||
inkscape:original-d="m 213.93749,856.03808 2e-5,-42.87351" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52415;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,838.83313 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-1-5-3-3"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,838.83313 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52415;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,830.04627 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-4-6-0-9"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,830.04627 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52415;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,821.2594 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-10-9-7-0"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,821.2594 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52415;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 220.85563,815.47302 c -1.38363,0 -5.5345,5.99535 -6.91813,5.99535 -1.38357,0 -5.5343,-5.99535 -6.91787,-5.99535"
|
|
||||||
id="path37-2-6-6-3-8-8"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 220.85563,815.47302 -6.91813,5.99535 -6.91787,-5.99535" /></g><ellipse
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#005c01;stroke-width:1.52415;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-7-8"
|
|
||||||
cx="213.9375"
|
|
||||||
cy="831.42084"
|
|
||||||
rx="15"
|
|
||||||
ry="25"
|
|
||||||
transform="translate(7.5790061e-6)" /></g><g
|
|
||||||
id="g42-1-5"
|
|
||||||
transform="matrix(0.46393276,-0.46393276,0.46393276,0.46393276,-441.6633,553.4829)"
|
|
||||||
style="stroke-width:1.52416;stroke-dasharray:none"><ellipse
|
|
||||||
style="fill:#00c002;fill-opacity:1;stroke:#005c01;stroke-width:1.52416;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-7-0-9-0"
|
|
||||||
cx="-213.94203"
|
|
||||||
cy="831.42212"
|
|
||||||
rx="15.000077"
|
|
||||||
ry="25.00013"
|
|
||||||
transform="matrix(-1,5.1823562e-6,-5.1823562e-6,1,0,0)" /><path
|
|
||||||
style="fill:#008f01;fill-opacity:1;stroke:none;stroke-width:1.52416;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 213.63731,813.23745 c -0.71301,-15.33 -8.97927,-0.53492 -12.11399,4.16273 -6.2641,9.38728 -0.46562,27.18322 0.66809,29.84078 2.16384,5.07233 9.57501,9.49461 9.57501,9.49461 l 1.73057,0.14033 c -0.22395,-14.5383 0.81608,-29.10959 0.14032,-43.63845 z"
|
|
||||||
id="path45-1-7-9"
|
|
||||||
sodipodi:nodetypes="sssccs" /><g
|
|
||||||
id="g37-9-6"
|
|
||||||
inkscape:path-effect="#path-effect41-8-3"
|
|
||||||
style="stroke-width:1.52416;stroke-dasharray:none"><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52416;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 213.93749,856.03808 c 0,0 2e-5,-42.87351 2e-5,-42.87351"
|
|
||||||
id="path36-6-2-3"
|
|
||||||
inkscape:original-d="m 213.93749,856.03808 2e-5,-42.87351" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52416;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,838.83313 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-1-5-0-8"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,838.83313 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52416;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,830.04627 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-4-6-6-5"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,830.04627 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52416;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,821.2594 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-10-9-8-6"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,821.2594 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52416;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 220.85563,815.47302 c -1.38363,0 -5.5345,5.99535 -6.91813,5.99535 -1.38357,0 -5.5343,-5.99535 -6.91787,-5.99535"
|
|
||||||
id="path37-2-6-6-3-9-1"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 220.85563,815.47302 -6.91813,5.99535 -6.91787,-5.99535" /></g><ellipse
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#005c01;stroke-width:1.52416;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-4-1"
|
|
||||||
cx="213.9375"
|
|
||||||
cy="831.42084"
|
|
||||||
rx="15"
|
|
||||||
ry="25"
|
|
||||||
transform="translate(-9.3315134e-6)" /></g></g></g></g></svg>
|
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 18 KiB After Width: | Height: | Size: 9.4 KiB |
|
|
@ -1,46 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8" standalone="no"?>
|
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
|
||||||
|
|
||||||
<svg
|
|
||||||
width="70.481842mm"
|
|
||||||
height="70.97554mm"
|
|
||||||
viewBox="0 0 70.481842 70.97554"
|
|
||||||
version="1.1"
|
|
||||||
id="svg1"
|
|
||||||
xml:space="preserve"
|
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
|
||||||
id="defs1" /><g
|
|
||||||
id="layer4"
|
|
||||||
transform="translate(-483.44732,-408.61381)"><g
|
|
||||||
id="g182"><path
|
|
||||||
id="path182"
|
|
||||||
style="fill:#c29c00;fill-opacity:1;stroke:#755e00;stroke-width:1.4;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 532.22935,429.6004 a 21,21 0 0 0 -21.00017,21.00017 21,21 0 0 0 21.00017,20.9998 21,21 0 0 0 20.99981,-20.9998 21,21 0 0 0 -20.99981,-21.00017 z m 0,7.0003 a 14,14 0 0 1 13.99987,13.99987 14,14 0 0 1 -13.99987,13.99987 14,14 0 0 1 -14.00023,-13.99987 14,14 0 0 1 14.00023,-13.99987 z" /><path
|
|
||||||
id="path178"
|
|
||||||
style="fill:#daaf00;fill-opacity:1;stroke:#755e00;stroke-width:2.21395;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 492.41992,423.0918 c -5.82792,15.71457 -3.5165,47.74793 4.98242,53.65625 1.6238,1.12884 6.50214,1.73437 15.82618,1.73437 9.32404,0 14.20041,-0.60553 15.82421,-1.73437 8.49892,-5.90832 10.81035,-37.94168 4.98243,-53.65625 h -20.80664 z" /><g
|
|
||||||
id="g181"
|
|
||||||
transform="translate(64.081238,-6.2578735)"
|
|
||||||
style="fill:#755e00;fill-opacity:0.496844;stroke:#755e00;stroke-opacity:1"><ellipse
|
|
||||||
style="fill:#755e00;fill-opacity:0.496844;stroke:#755e00;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path181"
|
|
||||||
cx="449.1463"
|
|
||||||
cy="457.04498"
|
|
||||||
rx="4"
|
|
||||||
ry="20" /><ellipse
|
|
||||||
style="fill:#755e00;fill-opacity:0.496844;stroke:#755e00;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path181-5"
|
|
||||||
cx="463.11505"
|
|
||||||
cy="457.04498"
|
|
||||||
rx="4"
|
|
||||||
ry="20" /><ellipse
|
|
||||||
style="fill:#755e00;fill-opacity:0.496844;stroke:#755e00;stroke-width:2;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path181-7"
|
|
||||||
cx="435.17755"
|
|
||||||
cy="457.04498"
|
|
||||||
rx="4"
|
|
||||||
ry="20" /></g><path
|
|
||||||
d="m 520.38364,409.61388 a 10,10 0 0 0 -8.32301,4.45657 10,10 0 0 0 -5.31647,-1.53065 10,10 0 0 0 -9.14414,5.95209 10,10 0 0 0 -3.15226,-0.50953 10,10 0 0 0 -10.00043,9.9999 10,10 0 0 0 10.00043,9.99991 10,10 0 0 0 1.16427,-0.0682 10,10 0 0 0 8.99893,5.63893 10,10 0 0 0 6.87503,-2.73833 10,10 0 0 0 7.97729,3.96978 10,10 0 0 0 9.41235,-6.62234 10,10 0 0 0 2.23759,0.25322 10,10 0 0 0 9.99991,-9.99991 10,10 0 0 0 -9.99991,-9.9999 10,10 0 0 0 -0.79789,0.032 10,10 0 0 0 -9.93169,-8.83357 z"
|
|
||||||
style="fill:#ffffff;fill-opacity:0.9;stroke:#b2b2b2;stroke-width:2;stroke-opacity:0.7"
|
|
||||||
id="path180" /></g></g></svg>
|
|
||||||
|
Before Width: | Height: | Size: 2.8 KiB |
|
|
@ -12,16 +12,15 @@
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
||||||
id="defs1" /><g
|
id="defs1" /><g
|
||||||
id="layer4"
|
id="layer4"
|
||||||
transform="translate(-50.121599,-612.75355)"><g
|
transform="translate(-50.121599,-612.75354)"><g
|
||||||
id="g9"
|
id="g9"><rect
|
||||||
style="stroke:#000000;stroke-opacity:1"><rect
|
style="fill:#3c34ff;fill-opacity:1;stroke:#0f07ff;stroke-width:1.561;stroke-dasharray:none;stroke-opacity:1"
|
||||||
style="fill:#3c34ff;fill-opacity:1;stroke:#000000;stroke-width:1.561;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="rect6"
|
id="rect6"
|
||||||
width="80"
|
width="80"
|
||||||
height="20"
|
height="20"
|
||||||
x="50.902103"
|
x="50.902103"
|
||||||
y="613.53406" /><rect
|
y="613.53406" /><rect
|
||||||
style="fill:#3c34ff;fill-opacity:1;stroke:#000000;stroke-width:1.561;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#3c34ff;fill-opacity:1;stroke:#0f07ff;stroke-width:1.561;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="rect6-1"
|
id="rect6-1"
|
||||||
width="80"
|
width="80"
|
||||||
height="20"
|
height="20"
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 979 B After Width: | Height: | Size: 932 B |
|
|
@ -2,29 +2,158 @@
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
<svg
|
<svg
|
||||||
width="29.583593mm"
|
width="24.399992mm"
|
||||||
height="29.755226mm"
|
height="24.399998mm"
|
||||||
viewBox="0 0 29.583593 29.755226"
|
viewBox="0 0 24.399992 24.399998"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
id="svg1"
|
id="svg1"
|
||||||
|
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||||
|
sodipodi:docname="icons.svg"
|
||||||
xml:space="preserve"
|
xml:space="preserve"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||||
id="defs1" /><g
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="true"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="2.8284272"
|
||||||
|
inkscape:cx="35.885668"
|
||||||
|
inkscape:cy="411.71291"
|
||||||
|
inkscape:window-width="1918"
|
||||||
|
inkscape:window-height="1042"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="17"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="layer4"><inkscape:grid
|
||||||
|
id="grid1"
|
||||||
|
units="mm"
|
||||||
|
originx="-1.6153444"
|
||||||
|
originy="-96.526486"
|
||||||
|
spacingx="0.26458333"
|
||||||
|
spacingy="0.26458334"
|
||||||
|
empcolor="#0099e5"
|
||||||
|
empopacity="0.30196078"
|
||||||
|
color="#0099e5"
|
||||||
|
opacity="0.14901961"
|
||||||
|
empspacing="5"
|
||||||
|
enabled="true"
|
||||||
|
visible="false" /><inkscape:page
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
width="24.399992"
|
||||||
|
height="24.399998"
|
||||||
|
id="page2"
|
||||||
|
margin="0"
|
||||||
|
bleed="0" /></sodipodi:namedview><defs
|
||||||
|
id="defs1"><inkscape:path-effect
|
||||||
|
effect="mirror_symmetry"
|
||||||
|
start_point="50.372741,180.48552"
|
||||||
|
end_point="50.372741,189.138"
|
||||||
|
center_point="50.372741,184.81176"
|
||||||
|
id="path-effect166-2"
|
||||||
|
is_visible="true"
|
||||||
|
lpeversion="1.2"
|
||||||
|
lpesatellites=""
|
||||||
|
mode="free"
|
||||||
|
discard_orig_path="false"
|
||||||
|
fuse_paths="true"
|
||||||
|
oposite_fuse="false"
|
||||||
|
split_items="false"
|
||||||
|
split_open="false"
|
||||||
|
link_styles="false" /></defs><g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
id="layer4"
|
id="layer4"
|
||||||
transform="translate(-151.13398,-751.15207)"><path
|
inkscape:label="Layer 4"
|
||||||
d="m 165.17026,751.95407 c -4.4181,2.7e-4 -7.99953,3.58193 -7.99951,8.00003 0.006,2.34034 1.03726,4.56053 2.82102,6.0756 -1.78376,1.51507 -2.81464,3.73526 -2.82102,6.0756 -2e-5,4.4181 3.58141,7.99976 7.99951,8.00003 0.61448,5e-5 1.22714,-0.0711 1.82543,-0.21119 -3.61703,-0.84782 -6.17466,-4.07378 -6.17452,-7.78884 0.006,-2.34034 1.03726,-4.56053 2.82102,-6.0756 -1.78376,-1.51507 -2.81464,-3.73526 -2.82102,-6.0756 -1.4e-4,-3.71506 2.55749,-6.94114 6.17452,-7.78896 -0.59829,-0.14014 -1.21095,-0.21112 -1.82543,-0.21107 z"
|
transform="translate(-1.6153444,-96.526492)"><g
|
||||||
style="fill:#070098;fill-opacity:1;stroke:#030033;stroke-width:1.604;stroke-opacity:1"
|
id="g166-2"
|
||||||
id="path36-1" /><path
|
inkscape:path-effect="#path-effect166-2"
|
||||||
id="rect83-5-3"
|
style="fill:#ff0707;fill-opacity:0.697154;stroke:#c10000;stroke-width:0.4;stroke-dasharray:none;stroke-opacity:1"
|
||||||
style="fill:#c04040;fill-opacity:1;stroke:#bf4141;stroke-width:0.399604;stroke-linecap:butt;stroke-dasharray:none;stroke-opacity:0.498353"
|
transform="matrix(1.728,0,0,1.728,-72.928813,-210.62831)"
|
||||||
d="m 172.72687,766.02988 c 0.20968,1.88003 7.36137,4.2774 7.36137,2.18354 0,-0.43048 0.002,-1.62424 0,-2.18355 0.002,-0.55929 0,-1.75348 0,-2.18395 0,-2.09388 -7.15169,0.30393 -7.36137,2.18396 z" /><path
|
inkscape:export-filename="hunter.svg"
|
||||||
id="path86-3"
|
inkscape:export-xdpi="900.08"
|
||||||
style="fill:#999999;fill-opacity:1;stroke:#000000;stroke-width:0.399604;stroke-opacity:0.498039"
|
inkscape:export-ydpi="900.08"><path
|
||||||
d="m 161.23317,763.86155 -10.0552,2.26911 10.0552,2.2686 z" /><path
|
id="path164-8"
|
||||||
id="path88"
|
style="fill:#ff0707;fill-opacity:0.697154;stroke:#c10000;stroke-width:0.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
||||||
style="fill:#070098;fill-opacity:1;stroke:#030033;stroke-width:0.419304;stroke-opacity:1"
|
d="m 50.373047,183.43359 c -1.534096,0.26874 -1.029204,1.24619 -1.832031,2.63672 -0.65564,1.13559 -1.854319,1.39291 -1.029297,2.41211 0.94012,1.1614 1.512735,0.45231 2.861328,0.33008 1.348593,0.12223 1.921208,0.83132 2.861328,-0.33008 0.825022,-1.0192 -0.373657,-1.27652 -1.029297,-2.41211 -0.802827,-1.39053 -0.297935,-2.36798 -1.832031,-2.63672 z"
|
||||||
d="m 157.61727,765.84131 v 0.57818 h 22.12149 c -1.2e-4,-0.20698 2.3e-4,-0.4071 5.8e-4,-0.57818 z" /><path
|
inkscape:original-d="m 50.372741,183.43371 c -1.534096,0.26874 -1.028586,1.24549 -1.831413,2.63602 -0.65564,1.13559 -1.854933,1.39253 -1.029911,2.41173 0.94012,1.1614 1.512731,0.45348 2.861324,0.33125 z" /><path
|
||||||
d="m 166.393,752.281 13.58876,13.749 -13.58376,13.75 c 0.14274,0.0419 0.28736,0.0802 0.43366,0.1145 L 180.5316,766.03 166.83166,752.16544 c -0.14795,0.0347 -0.29436,0.0731 -0.43866,0.11556 z"
|
sodipodi:type="star"
|
||||||
style="fill:#070098;fill-opacity:1;stroke:#030033;stroke-width:0.264583px;stroke-opacity:1"
|
style="fill:#ff0707;fill-opacity:0.697154;stroke:#c10000;stroke-width:0.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
||||||
id="path39-7" /></g></svg>
|
id="path165-3"
|
||||||
|
inkscape:flatsided="false"
|
||||||
|
sodipodi:sides="2"
|
||||||
|
sodipodi:cx="51.634216"
|
||||||
|
sodipodi:cy="182.45293"
|
||||||
|
sodipodi:r1="1.3725731"
|
||||||
|
sodipodi:r2="0.82291079"
|
||||||
|
sodipodi:arg1="1.1071487"
|
||||||
|
sodipodi:arg2="2.677945"
|
||||||
|
inkscape:rounded="0.5"
|
||||||
|
inkscape:randomized="0"
|
||||||
|
d="m 52.24805,183.68059 c -0.715701,0.35785 -0.992017,-0.14395 -1.349867,-0.85965 -0.357851,-0.7157 -0.593501,-1.23783 0.1222,-1.59568 0.715701,-0.35785 0.992017,0.14395 1.349867,0.85965 0.357851,0.7157 0.593501,1.23783 -0.1222,1.59568 z m 5.18186,0 c 0.7157,0.35785 0.992016,-0.14395 1.349867,-0.85965 0.35785,-0.7157 0.5935,-1.23783 -0.122201,-1.59568 -0.715701,-0.35785 -0.992016,0.14395 -1.349867,0.85965 -0.35785,0.7157 -0.5935,1.23783 0.122201,1.59568 z"
|
||||||
|
inkscape:transform-center-x="0.12681959"
|
||||||
|
inkscape:transform-center-y="0.079724714"
|
||||||
|
transform="translate(-4.4662386,1.8414355)" /><path
|
||||||
|
sodipodi:type="star"
|
||||||
|
style="fill:#ff0707;fill-opacity:0.697154;stroke:#c10000;stroke-width:0.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
||||||
|
id="path165-6-8"
|
||||||
|
inkscape:flatsided="false"
|
||||||
|
sodipodi:sides="2"
|
||||||
|
sodipodi:cx="51.634216"
|
||||||
|
sodipodi:cy="182.45293"
|
||||||
|
sodipodi:r1="1.3725731"
|
||||||
|
sodipodi:r2="0.82291079"
|
||||||
|
sodipodi:arg1="1.1071487"
|
||||||
|
sodipodi:arg2="2.677945"
|
||||||
|
inkscape:rounded="0.5"
|
||||||
|
inkscape:randomized="0"
|
||||||
|
d="m 52.24805,183.68059 c -0.715701,0.35785 -0.992017,-0.14395 -1.349867,-0.85965 -0.357851,-0.7157 -0.593501,-1.23783 0.1222,-1.59568 0.715701,-0.35785 0.992017,0.14395 1.349867,0.85965 0.357851,0.7157 0.593501,1.23783 -0.1222,1.59568 z m 2.374602,-1.10775 c 0.734072,-0.31847 0.527114,-0.85263 0.208644,-1.5867 -0.31847,-0.73407 -0.567138,-1.25013 -1.30121,-0.93166 -0.734072,0.31847 -0.527114,0.85263 -0.208644,1.5867 0.31847,0.73407 0.567138,1.25013 1.30121,0.93166 z"
|
||||||
|
inkscape:transform-center-x="0.14863452"
|
||||||
|
inkscape:transform-center-y="0.01863483"
|
||||||
|
transform="rotate(25.009099,51.670619,176.27381)" /></g><g
|
||||||
|
id="g6"
|
||||||
|
inkscape:export-filename="../../src/werewolves/werewolves/img/hunter.svg"
|
||||||
|
inkscape:export-xdpi="900.08"
|
||||||
|
inkscape:export-ydpi="900.08"><path
|
||||||
|
id="path166-0"
|
||||||
|
style="fill:#0f07ff;fill-opacity:0.496669;stroke:#05009e;stroke-width:0.5;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
||||||
|
d="m 13.815426,98.72668 c -5.522776,5e-5 -10.000374,4.47713 -10.000423,9.99991 4.9e-5,5.52277 4.477647,9.99985 10.000423,9.9999 5.522777,-5e-5 9.999857,-4.47713 9.999907,-9.9999 -5e-5,-5.52278 -4.47713,-9.99986 -9.999907,-9.99991 z m 0,1.99988 c 4.418297,-2e-5 8.000047,3.58172 8.000027,8.00003 2e-5,4.4183 -3.58173,8.00004 -8.000027,8.00002 -4.418301,2e-5 -8.000045,-3.58172 -8.000029,-8.00002 -1.6e-5,-4.41831 3.581728,-8.00005 8.000029,-8.00003 z" /><rect
|
||||||
|
style="fill:#0f07ff;fill-opacity:1;stroke:#05009e;stroke-width:0.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
||||||
|
id="rect167-8-0-4"
|
||||||
|
width="1.5"
|
||||||
|
height="6"
|
||||||
|
x="-109.47657"
|
||||||
|
y="19.815336"
|
||||||
|
transform="rotate(-90)"
|
||||||
|
ry="0" /><rect
|
||||||
|
style="fill:#0f07ff;fill-opacity:1;stroke:#05009e;stroke-width:0.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
||||||
|
id="rect167-8-0-9-2"
|
||||||
|
width="1.5"
|
||||||
|
height="6"
|
||||||
|
x="-109.47657"
|
||||||
|
y="1.8153445"
|
||||||
|
transform="rotate(-90)"
|
||||||
|
ry="0" /><rect
|
||||||
|
style="fill:#0f07ff;fill-opacity:1;stroke:#05009e;stroke-width:0.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
||||||
|
id="rect167-8-0-1-2"
|
||||||
|
width="1.5"
|
||||||
|
height="6"
|
||||||
|
x="-14.56517"
|
||||||
|
y="-120.72649"
|
||||||
|
transform="scale(-1)"
|
||||||
|
ry="0" /><rect
|
||||||
|
style="fill:#0f07ff;fill-opacity:1;stroke:#05009e;stroke-width:0.4;stroke-linecap:round;stroke-linejoin:round;stroke-dasharray:none;stroke-opacity:1;paint-order:normal"
|
||||||
|
id="rect167-8-0-1-7-2"
|
||||||
|
width="1.5"
|
||||||
|
height="6"
|
||||||
|
x="-14.56517"
|
||||||
|
y="-102.72649"
|
||||||
|
transform="scale(-1)"
|
||||||
|
ry="0" /></g></g></svg>
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 2.2 KiB After Width: | Height: | Size: 8.0 KiB |
|
Before Width: | Height: | Size: 7.0 KiB |
|
|
@ -2,9 +2,9 @@
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
<svg
|
<svg
|
||||||
width="32.022381mm"
|
width="44.180328mm"
|
||||||
height="20.678709mm"
|
height="65.150642mm"
|
||||||
viewBox="0 0 32.022381 20.678709"
|
viewBox="0 0 44.180328 65.150642"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
id="svg1"
|
id="svg1"
|
||||||
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||||
|
|
@ -24,9 +24,9 @@
|
||||||
inkscape:deskcolor="#d1d1d1"
|
inkscape:deskcolor="#d1d1d1"
|
||||||
inkscape:document-units="mm"
|
inkscape:document-units="mm"
|
||||||
showgrid="false"
|
showgrid="false"
|
||||||
inkscape:zoom="0.35355339"
|
inkscape:zoom="2"
|
||||||
inkscape:cx="660.43774"
|
inkscape:cx="93.5"
|
||||||
inkscape:cy="2131.2199"
|
inkscape:cy="1629.25"
|
||||||
inkscape:window-width="1918"
|
inkscape:window-width="1918"
|
||||||
inkscape:window-height="1042"
|
inkscape:window-height="1042"
|
||||||
inkscape:window-x="0"
|
inkscape:window-x="0"
|
||||||
|
|
@ -35,8 +35,8 @@
|
||||||
inkscape:current-layer="layer4"><inkscape:grid
|
inkscape:current-layer="layer4"><inkscape:grid
|
||||||
id="grid1"
|
id="grid1"
|
||||||
units="mm"
|
units="mm"
|
||||||
originx="-160.21693"
|
originx="-11.103428"
|
||||||
originy="-815.99713"
|
originy="-387.35551"
|
||||||
spacingx="0.26458333"
|
spacingx="0.26458333"
|
||||||
spacingy="0.26458334"
|
spacingy="0.26458334"
|
||||||
empcolor="#0099e5"
|
empcolor="#0099e5"
|
||||||
|
|
@ -47,268 +47,71 @@
|
||||||
enabled="true"
|
enabled="true"
|
||||||
visible="false" /><inkscape:page
|
visible="false" /><inkscape:page
|
||||||
x="0"
|
x="0"
|
||||||
y="-6.3560056e-12"
|
y="0"
|
||||||
width="32.022381"
|
width="44.180328"
|
||||||
height="20.678711"
|
height="65.150642"
|
||||||
id="page2"
|
id="page2"
|
||||||
margin="0"
|
margin="0"
|
||||||
bleed="0" /></sodipodi:namedview><defs
|
bleed="0" /></sodipodi:namedview><defs
|
||||||
id="defs1"><inkscape:path-effect
|
id="defs1" /><g
|
||||||
effect="interpolate_points"
|
|
||||||
id="path-effect41-5"
|
|
||||||
is_visible="true"
|
|
||||||
lpeversion="1"
|
|
||||||
interpolator_type="CubicBezierJohan" /><inkscape:path-effect
|
|
||||||
effect="interpolate_points"
|
|
||||||
id="path-effect41-8"
|
|
||||||
is_visible="true"
|
|
||||||
lpeversion="1"
|
|
||||||
interpolator_type="CubicBezierJohan" /><inkscape:path-effect
|
|
||||||
effect="interpolate_points"
|
|
||||||
id="path-effect41-5-67"
|
|
||||||
is_visible="true"
|
|
||||||
lpeversion="1"
|
|
||||||
interpolator_type="CubicBezierJohan" /><inkscape:path-effect
|
|
||||||
effect="interpolate_points"
|
|
||||||
id="path-effect41-8-3"
|
|
||||||
is_visible="true"
|
|
||||||
lpeversion="1"
|
|
||||||
interpolator_type="CubicBezierJohan" /></defs><g
|
|
||||||
inkscape:groupmode="layer"
|
inkscape:groupmode="layer"
|
||||||
id="layer4"
|
id="layer4"
|
||||||
inkscape:label="Layer 4"
|
inkscape:label="Layer 4"
|
||||||
transform="translate(-160.21694,-815.99709)"><path
|
transform="translate(-11.103428,-387.3555)"><g
|
||||||
id="path82-8"
|
id="g113"
|
||||||
style="fill:#cccccc;fill-opacity:1;stroke:#ffffff;stroke-linecap:round;stroke-opacity:0.7"
|
|
||||||
d="m 162.68403,816.49763 c -0.0381,-9.5e-4 -0.0769,-6.2e-4 -0.11679,0.002 -0.58468,0.0318 -0.9946,0.44045 -1.27951,0.92811 -0.38899,0.40947 -0.66926,0.91944 -0.53692,1.48983 0.31028,1.33731 2.14116,1.1325 2.88458,1.68207 v 5.73608 5.73815 c -0.74342,0.54957 -2.5743,0.34424 -2.88458,1.68155 -0.0248,0.10695 -0.0358,0.21228 -0.0336,0.31471 0.01,0.44389 0.25446,0.84295 0.57051,1.17564 0.28491,0.48766 0.69483,0.89632 1.27951,0.92811 1.2754,0.0694 1.63346,-1.49789 2.26911,-2.16834 h 11.39104 11.39258 c 0.63565,0.67045 0.99371,2.23774 2.26911,2.16834 0.58468,-0.0318 0.9946,-0.44045 1.27951,-0.92811 0.31605,-0.33269 0.56051,-0.73175 0.57051,-1.17564 0.002,-0.10243 -0.009,-0.20776 -0.0336,-0.31471 -0.31028,-1.33731 -2.14116,-1.13198 -2.88458,-1.68155 v -5.73815 -5.73608 c 0.74342,-0.54957 2.5743,-0.34476 2.88458,-1.68207 0.13234,-0.57039 -0.14793,-1.08036 -0.53692,-1.48983 -0.28491,-0.48766 -0.69483,-0.89631 -1.27951,-0.92811 -1.2754,-0.0694 -1.63346,1.49789 -2.26911,2.16834 h -11.39258 -11.39104 c -0.61579,-0.6495 -0.97116,-2.14045 -2.15232,-2.16989 z"
|
|
||||||
inkscape:export-filename="insomniac.svg"
|
inkscape:export-filename="insomniac.svg"
|
||||||
inkscape:export-xdpi="900.08"
|
inkscape:export-xdpi="900.08"
|
||||||
inkscape:export-ydpi="900.08" /><g
|
inkscape:export-ydpi="900.08"
|
||||||
id="g43"
|
style="stroke-width:1.3;stroke-dasharray:none"><path
|
||||||
transform="translate(0.07389574)"><g
|
id="path95-7"
|
||||||
id="g42-4"
|
style="fill:#b3b3b3;fill-opacity:1;stroke:#000000;stroke-width:1.3;stroke-dasharray:none;stroke-opacity:1"
|
||||||
transform="matrix(0.70710678,0.70711411,-0.70710678,0.70711411,584.35218,19.075908)"><ellipse
|
d="m 42.63286,411.37387 -30.86943,0.0811 v 36.01795 a 15.478125,4.2333331 0 0 0 -0.01,0.14986 15.478125,4.2333331 0 0 0 0.01,0.14935 v 0.015 h 0.002 a 15.478125,4.2333331 0 0 0 15.46675,4.06901 15.478125,4.2333331 0 0 0 15.47813,-4.23334 15.478125,4.2333331 0 0 0 -0.077,-0.42168 z" /><path
|
||||||
style="fill:#00c002;fill-opacity:1;stroke:#005c01;stroke-width:1.00001;stroke-dasharray:none;stroke-opacity:1"
|
id="path102"
|
||||||
id="path30-7-7-7-0"
|
style="fill:#808080;fill-opacity:1;stroke:#000000;stroke-width:1.3;stroke-dasharray:none;stroke-opacity:1"
|
||||||
cx="640.62866"
|
d="m 42.63398,417.52803 v 3.99975 a 8,8 0 0 1 8.00003,8.00003 8,8 0 0 1 -8.00003,8.00003 v 3.99976 A 12,12 0 0 0 54.63376,429.52781 12,12 0 0 0 42.63398,417.52803 Z" /><g
|
||||||
cy="431.71231"
|
id="g105"
|
||||||
rx="15.000077"
|
transform="translate(-334.81852,-83.628473)"
|
||||||
ry="25.00013"
|
style="stroke-width:1.3;stroke-dasharray:none"><ellipse
|
||||||
transform="matrix(0.99999481,0,0,0.99999481,-426.68795,399.71083)" /><path
|
style="fill:#808080;fill-opacity:1;stroke:#000000;stroke-width:1.3;stroke-dasharray:none;stroke-opacity:1"
|
||||||
style="fill:#008f01;fill-opacity:1;stroke:none;stroke-width:0.264582px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
id="path95"
|
||||||
d="m 214.03823,813.19332 c 0.71309,-15.32992 8.97923,-0.53496 12.11391,4.16265 6.26402,9.3872 0.46548,27.18307 -0.66824,29.84063 -2.16386,5.07231 -9.57501,9.49461 -9.57501,9.49461 l -1.73056,0.14033 c 0.22402,-14.53822 -0.81593,-29.10943 -0.1401,-43.63822 z"
|
cx="362.05063"
|
||||||
id="path45-1"
|
cy="495.0354"
|
||||||
sodipodi:nodetypes="sssccs" /><g
|
rx="15.478125"
|
||||||
id="g37-4"
|
ry="4.2333331" /><path
|
||||||
inkscape:path-effect="#path-effect41-5"><path
|
d="m 376.92945,495.93872 c -0.44231,-1.99962 -6.96407,-3.56361 -14.86007,-3.56361 -8.02391,-2e-5 -14.55676,1.54313 -14.8283,3.57717 1.94328,1.91824 7.94419,3.085 14.77662,3.08496 6.95042,10e-6 12.71785,-1.1183 14.91175,-3.09852 z"
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#804600;stroke:none;stroke-width:1.3;stroke-dasharray:none"
|
||||||
d="m 213.93749,856.03808 c 0,0 2e-5,-42.87351 2e-5,-42.87351"
|
id="path105"
|
||||||
id="path36-6-4"
|
sodipodi:nodetypes="cscsc" /></g><g
|
||||||
inkscape:original-d="m 213.93749,856.03808 2e-5,-42.87351" /><path
|
id="g103"
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
transform="translate(-332.61358,-85.305623)"
|
||||||
d="m 222.85539,838.83313 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
style="stroke-width:1.3;stroke-dasharray:none"><path
|
||||||
id="path37-2-6-1-5-3"
|
style="fill:none;stroke:#804600;stroke-width:1.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
||||||
sodipodi:nodetypes="ccc"
|
d="m 356.82899,473.29282 c -3.38145,0.8196 -7.31399,4.94369 -5.26687,8.00676 3.51296,5.25639 4.89649,7.3595 1.05739,12.10527"
|
||||||
inkscape:original-d="m 222.85539,838.83313 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
id="path103"
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
sodipodi:nodetypes="csc" /><path
|
||||||
d="m 222.85539,830.04627 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
style="fill:none;stroke:#804600;stroke-width:1.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="path37-2-6-4-6-0"
|
d="m 363.70426,473.29282 c -3.38145,0.8196 -7.31399,4.94369 -5.26687,8.00676 3.51296,5.25639 4.89649,7.3595 1.05739,12.10527"
|
||||||
sodipodi:nodetypes="ccc"
|
id="path103-2"
|
||||||
inkscape:original-d="m 222.85539,830.04627 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
sodipodi:nodetypes="csc" /><path
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:none;stroke:#804600;stroke-width:1.3;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
||||||
d="m 222.85539,821.2594 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
d="m 370.57952,473.29282 c -3.38145,0.8196 -7.31399,4.94369 -5.26687,8.00676 3.51296,5.25639 4.89649,7.3595 1.05739,12.10527"
|
||||||
id="path37-2-6-10-9-7"
|
id="path103-6"
|
||||||
sodipodi:nodetypes="ccc"
|
sodipodi:nodetypes="csc" /></g><path
|
||||||
inkscape:original-d="m 222.85539,821.2594 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
sodipodi:type="star"
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:none;fill-opacity:0;stroke:#4d2a00;stroke-width:3.17383;stroke-dasharray:none;stroke-opacity:0.698282"
|
||||||
d="m 220.85563,815.47302 c -1.38363,0 -5.5345,5.99535 -6.91813,5.99535 -1.38357,0 -5.5343,-5.99535 -6.91787,-5.99535"
|
id="path84"
|
||||||
id="path37-2-6-6-3-8"
|
inkscape:flatsided="false"
|
||||||
sodipodi:nodetypes="ccc"
|
sodipodi:sides="5"
|
||||||
inkscape:original-d="m 220.85563,815.47302 -6.91813,5.99535 -6.91787,-5.99535" /></g><ellipse
|
sodipodi:cx="358.90729"
|
||||||
style="fill:none;fill-opacity:1;stroke:#005c01;stroke-width:1;stroke-dasharray:none;stroke-opacity:1"
|
sodipodi:cy="61.780209"
|
||||||
id="path30-7-7-7"
|
sodipodi:r1="16.631435"
|
||||||
cx="213.9375"
|
sodipodi:r2="24.204502"
|
||||||
cy="831.42084"
|
sodipodi:arg1="-2.7064071"
|
||||||
rx="15"
|
sodipodi:arg2="0.21005099"
|
||||||
ry="25"
|
inkscape:rounded="0.6"
|
||||||
transform="translate(7.5790061e-6)" /></g><g
|
inkscape:randomized="0"
|
||||||
id="g42-1"
|
d="m 343.82604,54.76875 c 9.88839,22.253806 17.47085,23.892638 38.75374,12.058334 16.02631,-8.911392 -8.02828,-33.81664 -21.66456,-21.556656 -18.10895,16.281225 -17.32446,23.999 0.50741,40.58323 13.42764,12.488151 29.68066,-18.085265 13.80688,-27.265597 -21.08034,-12.191455 -28.17796,-9.06044 -38.44015,13.023483 -7.72757,16.629493 26.37194,22.63933 30.19768,4.70559 5.08058,-23.815959 -0.0905,-29.598661 -24.26472,-32.534276 -18.20354,-2.210558 -13.38191,32.077141 4.85631,30.173812 24.22031,-2.527617 28.12204,-9.232538 23.44372,-33.130771 -3.52283,-17.995694 -34.64241,-2.814567 -27.19631,13.942851 z"
|
||||||
transform="rotate(-45,70.430131,928.10363)"><ellipse
|
transform="matrix(0.40959999,0,0,0.40959999,-120.0474,406.73268)" /><path
|
||||||
style="fill:#00c002;fill-opacity:1;stroke:#005c01;stroke-width:1.00001;stroke-dasharray:none;stroke-opacity:1"
|
d="m 26.89965,426.0882 c -0.667117,0.62908 -1.259228,1.22677 -1.777669,1.80041 -1.449367,0.19777 -2.672199,0.97551 -3.838526,2.36885 0.392134,0.82886 0.777882,1.57708 1.163237,2.24741 -0.259786,1.43954 0.101868,2.84235 1.066601,4.38216 0.909469,-0.11681 1.740402,-0.252 2.497006,-0.41135 1.288809,0.69192 2.734836,0.78121 4.4974,0.33952 0.169949,-0.90105 0.29757,-1.73284 0.379821,-2.50166 1.056314,-1.01192 1.588482,-2.35957 1.713074,-4.17235 -0.804435,-0.44008 -1.556108,-0.8185 -2.261877,-1.1343 -0.635972,-1.31732 -1.753505,-2.24001 -3.439067,-2.91869 z"
|
||||||
id="path30-7-7-7-0-9"
|
style="fill:#804600;fill-opacity:0.701315;stroke:none;stroke-width:1.3;stroke-dasharray:none;stroke-opacity:0.497152"
|
||||||
cx="-213.94203"
|
id="path113" /></g></g></svg>
|
||||||
cy="831.42212"
|
|
||||||
rx="15.000077"
|
|
||||||
ry="25.00013"
|
|
||||||
transform="matrix(-1,5.1823562e-6,-5.1823562e-6,1,0,0)" /><path
|
|
||||||
style="fill:#008f01;fill-opacity:1;stroke:none;stroke-width:0.264583px;stroke-linecap:butt;stroke-linejoin:miter;stroke-opacity:1"
|
|
||||||
d="m 213.63731,813.23745 c -0.71301,-15.33 -8.97927,-0.53492 -12.11399,4.16273 -6.2641,9.38728 -0.46562,27.18322 0.66809,29.84078 2.16384,5.07233 9.57501,9.49461 9.57501,9.49461 l 1.73057,0.14033 c -0.22395,-14.5383 0.81608,-29.10959 0.14032,-43.63845 z"
|
|
||||||
id="path45-1-7"
|
|
||||||
sodipodi:nodetypes="sssccs" /><g
|
|
||||||
id="g37-9"
|
|
||||||
inkscape:path-effect="#path-effect41-8"><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 213.93749,856.03808 c 0,0 2e-5,-42.87351 2e-5,-42.87351"
|
|
||||||
id="path36-6-2"
|
|
||||||
inkscape:original-d="m 213.93749,856.03808 2e-5,-42.87351" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,838.83313 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-1-5-0"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,838.83313 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,830.04627 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-4-6-6"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,830.04627 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,821.2594 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-10-9-8"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,821.2594 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 220.85563,815.47302 c -1.38363,0 -5.5345,5.99535 -6.91813,5.99535 -1.38357,0 -5.5343,-5.99535 -6.91787,-5.99535"
|
|
||||||
id="path37-2-6-6-3-9"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 220.85563,815.47302 -6.91813,5.99535 -6.91787,-5.99535" /></g><ellipse
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#005c01;stroke-width:1;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-4"
|
|
||||||
cx="213.9375"
|
|
||||||
cy="831.42084"
|
|
||||||
rx="15"
|
|
||||||
ry="25"
|
|
||||||
transform="translate(-9.3315134e-6)" /></g><g
|
|
||||||
id="g63"
|
|
||||||
inkscape:export-filename="apprentice.svg"
|
|
||||||
inkscape:export-xdpi="900.08"
|
|
||||||
inkscape:export-ydpi="900.08"><path
|
|
||||||
id="rect33-6"
|
|
||||||
style="fill:#005c01;fill-opacity:1;stroke:#005c01;stroke-width:1;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 57.136103,850.95756 -1.50032,-0.57183 -1.84004,1.853 3.34036,2.084 1.2e-4,13.42718 c 0,0 0.4451,1.28623 1.346,1.28623 0.83175,0 1.346,-1.28623 1.346,-1.28623 l -2.9e-4,-13.42718 2.71198,-2.084 -1.37887,-1.853 -1.33311,0.57183 z"
|
|
||||||
sodipodi:nodetypes="cccccscccccc" /><path
|
|
||||||
d="m 60.527143,867.65428 c 0,0 -1.28908,1.47478 -2.12083,1.47478 -0.9009,0 -1.99075,-1.42264 -1.99075,-1.42264 -4.65194,0.59664 -5.92716,3.58427 -8.28253,4.70926 -2.52584,1.20643 -11.53768,1.98812 -11.53779,3.7052 10e-6,2.41107 9.83202,4.36562 21.96041,4.36562 12.12839,0 21.96041,-1.95455 21.96042,-4.36562 10e-6,-1.68893 -9.37115,-3.14116 -11.61634,-3.7052 -2.57054,-0.64577 -3.5869,-4.17719 -8.37259,-4.7614 z"
|
|
||||||
style="fill:#8f4c00;stroke:#5c3100;stroke-linecap:round"
|
|
||||||
id="path57-3"
|
|
||||||
sodipodi:nodetypes="cscscsssc" /><g
|
|
||||||
id="g42-4-4"
|
|
||||||
transform="matrix(0.46393276,0.46393757,-0.46393276,0.46393757,360.22685,355.15504)"
|
|
||||||
style="stroke-width:1.52415;stroke-dasharray:none"><ellipse
|
|
||||||
style="fill:#00c002;fill-opacity:1;stroke:#005c01;stroke-width:1.52416;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-7-0-8"
|
|
||||||
cx="640.62866"
|
|
||||||
cy="431.71231"
|
|
||||||
rx="15.000077"
|
|
||||||
ry="25.00013"
|
|
||||||
transform="matrix(0.99999481,0,0,0.99999481,-426.68795,399.71083)" /><path
|
|
||||||
style="fill:#008f01;fill-opacity:1;stroke:none;stroke-width:1.52415;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 214.03823,813.19332 c 0.71309,-15.32992 8.97923,-0.53496 12.11391,4.16265 6.26402,9.3872 0.46548,27.18307 -0.66824,29.84063 -2.16386,5.07231 -9.57501,9.49461 -9.57501,9.49461 l -1.73056,0.14033 c 0.22402,-14.53822 -0.81593,-29.10943 -0.1401,-43.63822 z"
|
|
||||||
id="path45-1-1"
|
|
||||||
sodipodi:nodetypes="sssccs" /><g
|
|
||||||
id="g37-4-2"
|
|
||||||
inkscape:path-effect="#path-effect41-5-67"
|
|
||||||
style="stroke-width:1.52415;stroke-dasharray:none"><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52415;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 213.93749,856.03808 c 0,0 2e-5,-42.87351 2e-5,-42.87351"
|
|
||||||
id="path36-6-4-9"
|
|
||||||
inkscape:original-d="m 213.93749,856.03808 2e-5,-42.87351" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52415;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,838.83313 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-1-5-3-3"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,838.83313 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52415;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,830.04627 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-4-6-0-9"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,830.04627 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52415;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,821.2594 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-10-9-7-0"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,821.2594 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52415;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 220.85563,815.47302 c -1.38363,0 -5.5345,5.99535 -6.91813,5.99535 -1.38357,0 -5.5343,-5.99535 -6.91787,-5.99535"
|
|
||||||
id="path37-2-6-6-3-8-8"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 220.85563,815.47302 -6.91813,5.99535 -6.91787,-5.99535" /></g><ellipse
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#005c01;stroke-width:1.52415;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-7-8"
|
|
||||||
cx="213.9375"
|
|
||||||
cy="831.42084"
|
|
||||||
rx="15"
|
|
||||||
ry="25"
|
|
||||||
transform="translate(7.5790061e-6)" /></g><g
|
|
||||||
id="g42-1-5"
|
|
||||||
transform="matrix(0.46393276,-0.46393276,0.46393276,0.46393276,-441.6633,553.4829)"
|
|
||||||
style="stroke-width:1.52416;stroke-dasharray:none"><ellipse
|
|
||||||
style="fill:#00c002;fill-opacity:1;stroke:#005c01;stroke-width:1.52416;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-7-0-9-0"
|
|
||||||
cx="-213.94203"
|
|
||||||
cy="831.42212"
|
|
||||||
rx="15.000077"
|
|
||||||
ry="25.00013"
|
|
||||||
transform="matrix(-1,5.1823562e-6,-5.1823562e-6,1,0,0)" /><path
|
|
||||||
style="fill:#008f01;fill-opacity:1;stroke:none;stroke-width:1.52416;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 213.63731,813.23745 c -0.71301,-15.33 -8.97927,-0.53492 -12.11399,4.16273 -6.2641,9.38728 -0.46562,27.18322 0.66809,29.84078 2.16384,5.07233 9.57501,9.49461 9.57501,9.49461 l 1.73057,0.14033 c -0.22395,-14.5383 0.81608,-29.10959 0.14032,-43.63845 z"
|
|
||||||
id="path45-1-7-9"
|
|
||||||
sodipodi:nodetypes="sssccs" /><g
|
|
||||||
id="g37-9-6"
|
|
||||||
inkscape:path-effect="#path-effect41-8-3"
|
|
||||||
style="stroke-width:1.52416;stroke-dasharray:none"><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52416;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 213.93749,856.03808 c 0,0 2e-5,-42.87351 2e-5,-42.87351"
|
|
||||||
id="path36-6-2-3"
|
|
||||||
inkscape:original-d="m 213.93749,856.03808 2e-5,-42.87351" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52416;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,838.83313 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-1-5-0-8"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,838.83313 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52416;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,830.04627 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-4-6-6-5"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,830.04627 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52416;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 222.85539,821.2594 c -1.78358,0 -7.13431,8.99583 -8.91789,8.99583 -1.78358,0 -7.13431,-8.99583 -8.91789,-8.99583"
|
|
||||||
id="path37-2-6-10-9-8-6"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 222.85539,821.2594 -8.91789,8.99583 -8.91789,-8.99583" /><path
|
|
||||||
style="fill:none;stroke:#005c01;stroke-width:1.52416;stroke-linecap:round;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
d="m 220.85563,815.47302 c -1.38363,0 -5.5345,5.99535 -6.91813,5.99535 -1.38357,0 -5.5343,-5.99535 -6.91787,-5.99535"
|
|
||||||
id="path37-2-6-6-3-9-1"
|
|
||||||
sodipodi:nodetypes="ccc"
|
|
||||||
inkscape:original-d="m 220.85563,815.47302 -6.91813,5.99535 -6.91787,-5.99535" /></g><ellipse
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#005c01;stroke-width:1.52416;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path30-7-7-4-1"
|
|
||||||
cx="213.9375"
|
|
||||||
cy="831.42084"
|
|
||||||
rx="15"
|
|
||||||
ry="25"
|
|
||||||
transform="translate(-9.3315134e-6)" /></g></g></g><g
|
|
||||||
id="g100-5"
|
|
||||||
transform="matrix(1.771561,0,0,1.771561,-126.11368,-663.87619)"><path
|
|
||||||
style="fill:none;fill-opacity:1;stroke:#000000;stroke-width:1;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path89-4-9"
|
|
||||||
sodipodi:arc-type="arc"
|
|
||||||
sodipodi:type="arc"
|
|
||||||
sodipodi:cx="170.66406"
|
|
||||||
sodipodi:cy="-843.37482"
|
|
||||||
sodipodi:rx="2"
|
|
||||||
sodipodi:ry="2"
|
|
||||||
sodipodi:start="0"
|
|
||||||
sodipodi:end="3.1415927"
|
|
||||||
d="m 172.66406,-843.37482 a 2,2 0 0 1 -1,1.73205 2,2 0 0 1 -2,0 2,2 0 0 1 -1,-1.73205"
|
|
||||||
sodipodi:open="true"
|
|
||||||
transform="scale(1,-1)" /><g
|
|
||||||
id="g97-4"><circle
|
|
||||||
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path90-6"
|
|
||||||
cx="169.00261"
|
|
||||||
cy="839.49762"
|
|
||||||
r="1" /><circle
|
|
||||||
style="fill:#000000;fill-opacity:1;stroke:none;stroke-width:1;stroke-linecap:round;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="path90-9-9"
|
|
||||||
cx="172.32553"
|
|
||||||
cy="839.49762"
|
|
||||||
r="1" /></g></g></g></svg>
|
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 20 KiB After Width: | Height: | Size: 6.5 KiB |
|
|
@ -3,8 +3,8 @@
|
||||||
|
|
||||||
<svg
|
<svg
|
||||||
width="81.560997mm"
|
width="81.560997mm"
|
||||||
height="79.989365mm"
|
height="79.98938mm"
|
||||||
viewBox="0 0 81.560997 79.989365"
|
viewBox="0 0 81.560997 79.98938"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
id="svg1"
|
id="svg1"
|
||||||
xml:space="preserve"
|
xml:space="preserve"
|
||||||
|
|
@ -13,21 +13,20 @@
|
||||||
id="defs1" /><g
|
id="defs1" /><g
|
||||||
id="layer4"
|
id="layer4"
|
||||||
transform="translate(-50.121599,-596.91049)"><g
|
transform="translate(-50.121599,-596.91049)"><g
|
||||||
id="g9"
|
id="g9"><rect
|
||||||
style="stroke:#000000;stroke-opacity:1"><rect
|
style="fill:#3c34ff;fill-opacity:1;stroke:#0f07ff;stroke-width:1.561;stroke-dasharray:none;stroke-opacity:1"
|
||||||
style="fill:#3c34ff;fill-opacity:1;stroke:#000000;stroke-width:1.561;stroke-dasharray:none;stroke-opacity:1"
|
|
||||||
id="rect6"
|
id="rect6"
|
||||||
width="80"
|
width="80"
|
||||||
height="20"
|
height="20"
|
||||||
x="50.902103"
|
x="50.902103"
|
||||||
y="613.53406" /><rect
|
y="613.53406" /><rect
|
||||||
style="fill:#3c34ff;fill-opacity:1;stroke:#000000;stroke-width:1.561;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#3c34ff;fill-opacity:1;stroke:#0f07ff;stroke-width:1.561;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="rect6-1"
|
id="rect6-1"
|
||||||
width="80"
|
width="80"
|
||||||
height="20"
|
height="20"
|
||||||
x="50.902103"
|
x="50.902103"
|
||||||
y="640.27625" /></g><rect
|
y="640.27625" /></g><rect
|
||||||
style="fill:#ff0707;fill-opacity:1;stroke:#000000;stroke-width:1.561;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#ff0707;fill-opacity:1;stroke:#c10000;stroke-width:1.561;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="rect6-3"
|
id="rect6-3"
|
||||||
width="100"
|
width="100"
|
||||||
height="10"
|
height="10"
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 1.2 KiB After Width: | Height: | Size: 1.2 KiB |
|
|
@ -2,26 +2,94 @@
|
||||||
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
<!-- Created with Inkscape (http://www.inkscape.org/) -->
|
||||||
|
|
||||||
<svg
|
<svg
|
||||||
width="22.945564mm"
|
width="22.945572mm"
|
||||||
height="28.246271mm"
|
height="28.24629mm"
|
||||||
viewBox="0 0 22.945564 28.246271"
|
viewBox="0 0 22.945572 28.24629"
|
||||||
version="1.1"
|
version="1.1"
|
||||||
id="svg1"
|
id="svg1"
|
||||||
|
inkscape:version="1.4.2 (ebf0e940d0, 2025-05-08)"
|
||||||
|
sodipodi:docname="icons.svg"
|
||||||
xml:space="preserve"
|
xml:space="preserve"
|
||||||
|
xmlns:inkscape="http://www.inkscape.org/namespaces/inkscape"
|
||||||
|
xmlns:sodipodi="http://sodipodi.sourceforge.net/DTD/sodipodi-0.dtd"
|
||||||
xmlns="http://www.w3.org/2000/svg"
|
xmlns="http://www.w3.org/2000/svg"
|
||||||
xmlns:svg="http://www.w3.org/2000/svg"><defs
|
xmlns:svg="http://www.w3.org/2000/svg"><sodipodi:namedview
|
||||||
|
id="namedview1"
|
||||||
|
pagecolor="#ffffff"
|
||||||
|
bordercolor="#666666"
|
||||||
|
borderopacity="1.0"
|
||||||
|
inkscape:showpageshadow="2"
|
||||||
|
inkscape:pageopacity="0.0"
|
||||||
|
inkscape:pagecheckerboard="true"
|
||||||
|
inkscape:deskcolor="#d1d1d1"
|
||||||
|
inkscape:document-units="mm"
|
||||||
|
showgrid="false"
|
||||||
|
inkscape:zoom="2.8284272"
|
||||||
|
inkscape:cx="329.68853"
|
||||||
|
inkscape:cy="1037.856"
|
||||||
|
inkscape:window-width="1918"
|
||||||
|
inkscape:window-height="1042"
|
||||||
|
inkscape:window-x="0"
|
||||||
|
inkscape:window-y="17"
|
||||||
|
inkscape:window-maximized="0"
|
||||||
|
inkscape:current-layer="layer4"><inkscape:grid
|
||||||
|
id="grid1"
|
||||||
|
units="mm"
|
||||||
|
originx="-84.294216"
|
||||||
|
originy="-256.51758"
|
||||||
|
spacingx="0.26458333"
|
||||||
|
spacingy="0.26458334"
|
||||||
|
empcolor="#0099e5"
|
||||||
|
empopacity="0.30196078"
|
||||||
|
color="#0099e5"
|
||||||
|
opacity="0.14901961"
|
||||||
|
empspacing="5"
|
||||||
|
enabled="true"
|
||||||
|
visible="false" /><inkscape:page
|
||||||
|
x="0"
|
||||||
|
y="0"
|
||||||
|
width="22.945572"
|
||||||
|
height="28.24629"
|
||||||
|
id="page2"
|
||||||
|
margin="0"
|
||||||
|
bleed="0" /></sodipodi:namedview><defs
|
||||||
id="defs1" /><g
|
id="defs1" /><g
|
||||||
|
inkscape:groupmode="layer"
|
||||||
id="layer4"
|
id="layer4"
|
||||||
transform="translate(-403.75417,-318.29373)"><g
|
inkscape:label="Layer 4"
|
||||||
id="g28"><path
|
transform="translate(-84.29421,-256.51757)"><g
|
||||||
id="path13-2-7"
|
id="g17"><path
|
||||||
|
id="path13-2"
|
||||||
style="fill:#ff0707;fill-opacity:0.796663;stroke:#ffbb33;stroke-width:0.665;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#ff0707;fill-opacity:0.796663;stroke:#ffbb33;stroke-width:0.665;stroke-linecap:butt;stroke-linejoin:miter;stroke-dasharray:none;stroke-opacity:1"
|
||||||
d="m 415.2262,319.4142 -4.65243,14.9748 c 0,0 -3.85341,-2.83967 -6.44147,-7.23625 -0.2812,4.36457 0.45945,18.75999 11.0939,19.05465 10.63444,-0.29466 11.37665,-14.69008 11.09545,-19.05465 -2.58806,4.39658 -6.44097,7.23625 -6.44096,7.23625 z m -6.89519,20.4246 h 4.97644 a 2.48832,2.48832 0 0 1 -2.48822,2.48822 2.48832,2.48832 0 0 1 -2.48822,-2.48822 z m 8.81548,0 h 4.97645 a 2.48832,2.48832 0 0 1 -2.48822,2.48822 2.48832,2.48832 0 0 1 -2.48823,-2.48822 z" /><path
|
d="m 102.26758,259.22827 -4.652431,14.9748 c 0,0 -3.853406,-2.83967 -6.441467,-7.23625 -0.281201,4.36457 0.45945,18.75999 11.093898,19.05465 10.63444,-0.29466 11.37665,-14.69008 11.09545,-19.05465 -2.58806,4.39658 -6.44097,7.23625 -6.44096,7.23625 z m -6.895188,20.4246 h 4.976438 a 2.48832,2.48832 0 0 1 -2.488217,2.48822 2.48832,2.48832 0 0 1 -2.488221,-2.48822 z m 8.815478,0 h 4.97645 a 2.48832,2.48832 0 0 1 -2.48822,2.48822 2.48832,2.48832 0 0 1 -2.48823,-2.48822 z"
|
||||||
|
transform="translate(-6.5013311,-1.5902536)" /><path
|
||||||
|
sodipodi:type="star"
|
||||||
style="fill:#ff0707;fill-opacity:0.796663;stroke:#ffbb33;stroke-width:0.665001;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#ff0707;fill-opacity:0.796663;stroke:#ffbb33;stroke-width:0.665001;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="path14-5"
|
id="path14"
|
||||||
transform="translate(345.42786,67.661219)"
|
inkscape:flatsided="false"
|
||||||
d="m 64.171412,262.11122 c -0.371671,0.14644 -0.815095,-1.38393 -1.090057,-1.67373 -0.307066,-0.32362 -1.843044,-0.90688 -1.777137,-1.34811 0.05902,-0.3951 1.606071,-0.0139 1.994519,-0.10715 0.433804,-0.10412 1.706909,-1.14268 2.05607,-0.86499 0.312654,0.24866 -0.790976,1.39786 -0.904463,1.78088 -0.126738,0.42774 0.136135,2.04957 -0.278932,2.2131 z" /><path
|
sodipodi:sides="3"
|
||||||
|
sodipodi:cx="63.610146"
|
||||||
|
sodipodi:cy="259.77261"
|
||||||
|
sodipodi:r1="2.4050174"
|
||||||
|
sodipodi:r2="0.8495208"
|
||||||
|
sodipodi:arg1="1.3352513"
|
||||||
|
sodipodi:arg2="2.2426747"
|
||||||
|
inkscape:rounded="0.2"
|
||||||
|
inkscape:randomized="0"
|
||||||
|
d="m 64.171412,262.11122 c -0.371671,0.14644 -0.815095,-1.38393 -1.090057,-1.67373 -0.307066,-0.32362 -1.843044,-0.90688 -1.777137,-1.34811 0.05902,-0.3951 1.606071,-0.0139 1.994519,-0.10715 0.433804,-0.10412 1.706909,-1.14268 2.05607,-0.86499 0.312654,0.24866 -0.790976,1.39786 -0.904463,1.78088 -0.126738,0.42774 0.136135,2.04957 -0.278932,2.2131 z"
|
||||||
|
transform="translate(25.967913,5.8850319)" /><path
|
||||||
|
sodipodi:type="star"
|
||||||
style="fill:#ff0707;fill-opacity:0.796663;stroke:#ffbb33;stroke-width:0.665001;stroke-dasharray:none;stroke-opacity:1"
|
style="fill:#ff0707;fill-opacity:0.796663;stroke:#ffbb33;stroke-width:0.665001;stroke-dasharray:none;stroke-opacity:1"
|
||||||
id="path15-9"
|
id="path15"
|
||||||
transform="translate(348.34768,68.803695)"
|
inkscape:flatsided="false"
|
||||||
d="m 74.180658,260.24033 c -0.269428,0.0674 -0.796295,-0.78347 -1.034437,-0.92636 -0.238143,-0.14288 -1.236814,-0.20738 -1.304171,-0.4768 -0.06736,-0.26943 0.783475,-0.7963 0.92636,-1.03444 0.142886,-0.23814 0.207377,-1.23681 0.476805,-1.30417 0.269427,-0.0674 0.796295,0.78347 1.034437,0.92636 0.238143,0.14289 1.236814,0.20738 1.304171,0.4768 0.06736,0.26943 -0.783475,0.7963 -0.926361,1.03444 -0.142885,0.23814 -0.207376,1.23682 -0.476804,1.30417 z" /></g></g></svg>
|
sodipodi:sides="4"
|
||||||
|
sodipodi:cx="73.712936"
|
||||||
|
sodipodi:cy="258.36945"
|
||||||
|
sodipodi:r1="1.9284658"
|
||||||
|
sodipodi:r2="1.1014973"
|
||||||
|
sodipodi:arg1="1.3258177"
|
||||||
|
sodipodi:arg2="2.1112159"
|
||||||
|
inkscape:rounded="0.2"
|
||||||
|
inkscape:randomized="0"
|
||||||
|
d="m 74.180658,260.24033 c -0.269428,0.0674 -0.796295,-0.78347 -1.034437,-0.92636 -0.238143,-0.14288 -1.236814,-0.20738 -1.304171,-0.4768 -0.06736,-0.26943 0.783475,-0.7963 0.92636,-1.03444 0.142886,-0.23814 0.207377,-1.23681 0.476805,-1.30417 0.269427,-0.0674 0.796295,0.78347 1.034437,0.92636 0.238143,0.14289 1.236814,0.20738 1.304171,0.4768 0.06736,0.26943 -0.783475,0.7963 -0.926361,1.03444 -0.142885,0.23814 -0.207376,1.23682 -0.476804,1.30417 z"
|
||||||
|
transform="translate(28.887732,7.0275078)" /></g></g></svg>
|
||||||
|
|
|
||||||
|
Before Width: | Height: | Size: 2.3 KiB After Width: | Height: | Size: 4.4 KiB |
|
|
@ -17,10 +17,6 @@ $offensive_color: color.adjust($village_color, $hue: 30deg);
|
||||||
$offensive_border: color.change($offensive_color, $alpha: 1.0);
|
$offensive_border: color.change($offensive_color, $alpha: 1.0);
|
||||||
$starts_as_villager_color: color.adjust($offensive_color, $hue: 30deg);
|
$starts_as_villager_color: color.adjust($offensive_color, $hue: 30deg);
|
||||||
$starts_as_villager_border: color.change($starts_as_villager_color, $alpha: 1.0);
|
$starts_as_villager_border: color.change($starts_as_villager_color, $alpha: 1.0);
|
||||||
$traitor_color: color.adjust($village_color, $hue: 45deg);
|
|
||||||
$traitor_border: color.change($traitor_color, $alpha: 1.0);
|
|
||||||
$drunk_color: color.adjust($village_color, $hue: 150deg);
|
|
||||||
$drunk_border: color.change($drunk_color, $alpha: 1.0);
|
|
||||||
|
|
||||||
$wolves_border_faint: color.change($wolves_border, $alpha: 0.3);
|
$wolves_border_faint: color.change($wolves_border, $alpha: 0.3);
|
||||||
$village_border_faint: color.change($village_border, $alpha: 0.3);
|
$village_border_faint: color.change($village_border, $alpha: 0.3);
|
||||||
|
|
@ -28,8 +24,6 @@ $offensive_border_faint: color.change($offensive_border, $alpha: 0.3);
|
||||||
$defensive_border_faint: color.change($defensive_border, $alpha: 0.3);
|
$defensive_border_faint: color.change($defensive_border, $alpha: 0.3);
|
||||||
$intel_border_faint: color.change($intel_border, $alpha: 0.3);
|
$intel_border_faint: color.change($intel_border, $alpha: 0.3);
|
||||||
$starts_as_villager_border_faint: color.change($starts_as_villager_border, $alpha: 0.3);
|
$starts_as_villager_border_faint: color.change($starts_as_villager_border, $alpha: 0.3);
|
||||||
$traitor_border_faint: color.change($traitor_border, $alpha: 0.3);
|
|
||||||
$drunk_border_faint: color.change($drunk_border, $alpha: 0.3);
|
|
||||||
|
|
||||||
$wolves_color_faint: color.change($wolves_color, $alpha: 0.1);
|
$wolves_color_faint: color.change($wolves_color, $alpha: 0.1);
|
||||||
$village_color_faint: color.change($village_color, $alpha: 0.1);
|
$village_color_faint: color.change($village_color, $alpha: 0.1);
|
||||||
|
|
@ -37,8 +31,7 @@ $offensive_color_faint: color.change($offensive_color, $alpha: 0.1);
|
||||||
$defensive_color_faint: color.change($defensive_color, $alpha: 0.1);
|
$defensive_color_faint: color.change($defensive_color, $alpha: 0.1);
|
||||||
$intel_color_faint: color.change($intel_color, $alpha: 0.1);
|
$intel_color_faint: color.change($intel_color, $alpha: 0.1);
|
||||||
$starts_as_villager_color_faint: color.change($starts_as_villager_color, $alpha: 0.1);
|
$starts_as_villager_color_faint: color.change($starts_as_villager_color, $alpha: 0.1);
|
||||||
$traitor_color_faint: color.change($traitor_color, $alpha: 0.1);
|
|
||||||
$drunk_color_faint: color.change($drunk_color, $alpha: 0.1);
|
|
||||||
|
|
||||||
@mixin flexbox() {
|
@mixin flexbox() {
|
||||||
display: -webkit-box;
|
display: -webkit-box;
|
||||||
|
|
@ -287,6 +280,7 @@ nav.host-nav {
|
||||||
align-self: center;
|
align-self: center;
|
||||||
margin-bottom: 30px;
|
margin-bottom: 30px;
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
|
// background-color: hsl(283, 100%, 80%);
|
||||||
border: 1px solid rgba(0, 255, 0, 0.7);
|
border: 1px solid rgba(0, 255, 0, 0.7);
|
||||||
background-color: black;
|
background-color: black;
|
||||||
color: rgba(0, 255, 0, 0.7);
|
color: rgba(0, 255, 0, 0.7);
|
||||||
|
|
@ -304,7 +298,6 @@ nav.host-nav {
|
||||||
border: 1px solid rgba(255, 0, 0, 1);
|
border: 1px solid rgba(255, 0, 0, 1);
|
||||||
color: rgba(255, 0, 0, 1);
|
color: rgba(255, 0, 0, 1);
|
||||||
filter: none;
|
filter: none;
|
||||||
background-color: rgba(255, 0, 0, 0.1);
|
|
||||||
|
|
||||||
&:hover {
|
&:hover {
|
||||||
background-color: rgba(255, 0, 0, 0.3);
|
background-color: rgba(255, 0, 0, 0.3);
|
||||||
|
|
@ -411,7 +404,6 @@ button {
|
||||||
border: 3px solid rgba(0, 0, 0, 0.4);
|
border: 3px solid rgba(0, 0, 0, 0.4);
|
||||||
// min-width: 20%;
|
// min-width: 20%;
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
flex-grow: 1;
|
|
||||||
|
|
||||||
.headline {
|
.headline {
|
||||||
display: flex;
|
display: flex;
|
||||||
|
|
@ -664,22 +656,19 @@ clients {
|
||||||
justify-content: space-evenly;
|
justify-content: space-evenly;
|
||||||
color: black;
|
color: black;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-content: center;
|
|
||||||
|
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
max-height: 100vh;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.role-reveal-card {
|
.role-reveal-card {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
// min-width: 5cm;
|
min-width: 5cm;
|
||||||
flex-grow: 1;
|
|
||||||
display: flex;
|
display: flex;
|
||||||
align-items: center;
|
align-items: center;
|
||||||
align-content: center;
|
align-content: center;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
padding: 20px;
|
padding: 1cm;
|
||||||
border: 1px solid $wolves_color;
|
border: 1px solid $wolves_color;
|
||||||
background-color: color.change($wolves_color, $alpha: 0.1);
|
background-color: color.change($wolves_color, $alpha: 0.1);
|
||||||
min-width: 100px;
|
min-width: 100px;
|
||||||
|
|
@ -820,9 +809,12 @@ clients {
|
||||||
}
|
}
|
||||||
|
|
||||||
.client-nav {
|
.client-nav {
|
||||||
|
// position: absolute;
|
||||||
|
// left: 0;
|
||||||
|
// top: 0;
|
||||||
max-width: 100%;
|
max-width: 100%;
|
||||||
padding: 10px;
|
padding: 10px;
|
||||||
height: 37px;
|
// background-color: rgba(255, 107, 255, 0.2);
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
justify-content: baseline;
|
justify-content: baseline;
|
||||||
|
|
@ -954,11 +946,6 @@ input {
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
align-content: stretch;
|
align-content: stretch;
|
||||||
margin: 0;
|
margin: 0;
|
||||||
position: absolute;
|
|
||||||
left: 0;
|
|
||||||
z-index: 3;
|
|
||||||
background-color: #000;
|
|
||||||
min-width: 2cm;
|
|
||||||
|
|
||||||
& * {
|
& * {
|
||||||
margin: 0;
|
margin: 0;
|
||||||
|
|
@ -1123,20 +1110,15 @@ input {
|
||||||
cursor: pointer;
|
cursor: pointer;
|
||||||
}
|
}
|
||||||
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
&>.submenu {
|
&>.submenu {
|
||||||
width: 30vw;
|
min-width: 30vw;
|
||||||
// position: absolute;
|
|
||||||
|
|
||||||
.assign-list {
|
.assign-list {
|
||||||
|
// min-width: 5cm;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
|
||||||
& .submenu button {
|
& .submenu button {
|
||||||
width: 10vw;
|
width: 5cm;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -1144,7 +1126,6 @@ input {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
flex-wrap: wrap;
|
flex-wrap: wrap;
|
||||||
justify-content: center;
|
|
||||||
gap: 5px;
|
gap: 5px;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1289,44 +1270,6 @@ input {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
.traitor {
|
|
||||||
background-color: $traitor_color;
|
|
||||||
border: 1px solid $traitor_border;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: white;
|
|
||||||
background-color: $traitor_border;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.faint {
|
|
||||||
border: 1px solid $traitor_border_faint;
|
|
||||||
background-color: $traitor_color_faint;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: $traitor_border_faint;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.drunk {
|
|
||||||
background-color: $drunk_color;
|
|
||||||
border: 1px solid $drunk_border;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
color: white;
|
|
||||||
background-color: $drunk_border;
|
|
||||||
}
|
|
||||||
|
|
||||||
&.faint {
|
|
||||||
border: 1px solid $drunk_border_faint;
|
|
||||||
background-color: $drunk_color_faint;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: $drunk_border_faint;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.assignments {
|
.assignments {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: row;
|
flex-direction: row;
|
||||||
|
|
@ -1442,23 +1385,6 @@ input {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
li.change,
|
|
||||||
li.choice {
|
|
||||||
width: fit-content;
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
.li-icon {
|
|
||||||
filter: brightness(5000%);
|
|
||||||
}
|
|
||||||
|
|
||||||
backdrop-filter: invert(15%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.li-icon {
|
|
||||||
filter: grayscale(100%) brightness(150%);
|
|
||||||
}
|
|
||||||
|
|
||||||
.icon {
|
.icon {
|
||||||
width: 32px;
|
width: 32px;
|
||||||
height: 32px;
|
height: 32px;
|
||||||
|
|
@ -1864,31 +1790,6 @@ li.choice {
|
||||||
flex-shrink: 1;
|
flex-shrink: 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
.info-icon-grow {
|
|
||||||
flex-grow: 1;
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
|
|
||||||
img {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-icon-list-grow {
|
|
||||||
padding: 20px 0 20px 0;
|
|
||||||
flex-grow: 1;
|
|
||||||
width: 100%;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
|
|
||||||
img {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.info-player-list {
|
.info-player-list {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
|
|
@ -1898,8 +1799,7 @@ li.choice {
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 10px;
|
gap: 10px;
|
||||||
|
|
||||||
&.masons,
|
&.masons {
|
||||||
&.large {
|
|
||||||
font-size: 2rem;
|
font-size: 2rem;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -1907,15 +1807,13 @@ li.choice {
|
||||||
.two-column {
|
.two-column {
|
||||||
display: grid;
|
display: grid;
|
||||||
grid-template-columns: 3fr 2fr;
|
grid-template-columns: 3fr 2fr;
|
||||||
height: 100%;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.seer-check {
|
.seer-check {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
height: 100%;
|
zoom: 90%;
|
||||||
justify-content: space-around;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.role-title-span {
|
.role-title-span {
|
||||||
|
|
@ -1962,7 +1860,6 @@ li.choice {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
justify-content: center;
|
justify-content: center;
|
||||||
gap: 10px;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
.add-player {
|
.add-player {
|
||||||
|
|
@ -2045,168 +1942,7 @@ li.choice {
|
||||||
display: flex;
|
display: flex;
|
||||||
flex-direction: column;
|
flex-direction: column;
|
||||||
flex-wrap: nowrap;
|
flex-wrap: nowrap;
|
||||||
justify-content: space-around;
|
justify-content: center;
|
||||||
align-items: center;
|
|
||||||
gap: 10px;
|
|
||||||
|
|
||||||
height: var(--information-height);
|
height: var(--information-height);
|
||||||
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5,
|
|
||||||
h6 {
|
|
||||||
margin: 0;
|
|
||||||
|
|
||||||
&:first-child {
|
|
||||||
padding-top: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
&:last-child {
|
|
||||||
padding-bottom: 10px;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.setup-aura {
|
|
||||||
&.active {
|
|
||||||
$active_color: color.change($connected_color, $alpha: 0.7);
|
|
||||||
border: $active_color 1px solid;
|
|
||||||
color: $active_color;
|
|
||||||
background-color: color.change($active_color, $alpha: 0.2);
|
|
||||||
|
|
||||||
&:hover {
|
|
||||||
background-color: $active_color;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.aura-title {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
gap: 3px;
|
|
||||||
// text-align: center;
|
|
||||||
align-items: center;
|
|
||||||
|
|
||||||
.title {
|
|
||||||
flex-grow: 1;
|
|
||||||
}
|
|
||||||
|
|
||||||
img,
|
|
||||||
.icon {
|
|
||||||
flex-shrink: 1;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.guardian-select {
|
|
||||||
max-height: 100vh;
|
|
||||||
}
|
|
||||||
|
|
||||||
.story-text {
|
|
||||||
font-size: 1.7em;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
|
||||||
.dialog {
|
|
||||||
z-index: 5;
|
|
||||||
width: 100vw;
|
|
||||||
height: 100vh;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
position: fixed;
|
|
||||||
top: 0;
|
|
||||||
left: 0;
|
|
||||||
align-items: center;
|
|
||||||
justify-content: center;
|
|
||||||
|
|
||||||
.dialog-box {
|
|
||||||
border: 1px solid white;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: center;
|
|
||||||
padding-left: 30px;
|
|
||||||
padding-right: 30px;
|
|
||||||
padding-top: 10px;
|
|
||||||
padding-bottom: 10px;
|
|
||||||
background-color: black;
|
|
||||||
|
|
||||||
.options {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: wrap;
|
|
||||||
gap: 20px;
|
|
||||||
|
|
||||||
&>button {
|
|
||||||
min-width: 4cm;
|
|
||||||
font-size: 1em;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.about {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
justify-content: center;
|
|
||||||
gap: 10px;
|
|
||||||
|
|
||||||
h1,
|
|
||||||
h2,
|
|
||||||
h3,
|
|
||||||
h4,
|
|
||||||
h5,
|
|
||||||
h6 {
|
|
||||||
margin: 0;
|
|
||||||
}
|
|
||||||
|
|
||||||
p {
|
|
||||||
margin: 0;
|
|
||||||
text-align: center;
|
|
||||||
}
|
|
||||||
|
|
||||||
a {
|
|
||||||
text-decoration: underline dotted;
|
|
||||||
color: white;
|
|
||||||
}
|
|
||||||
|
|
||||||
.links {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
align-items: center;
|
|
||||||
width: 100%;
|
|
||||||
gap: 10px;
|
|
||||||
}
|
|
||||||
|
|
||||||
.build-info {
|
|
||||||
display: flex;
|
|
||||||
flex-direction: column;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
justify-content: center;
|
|
||||||
text-align: center;
|
|
||||||
|
|
||||||
label {
|
|
||||||
color: hsl(280, 65%, 43%);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
.footer {
|
|
||||||
width: 100vw;
|
|
||||||
display: flex;
|
|
||||||
flex-direction: row;
|
|
||||||
flex-wrap: nowrap;
|
|
||||||
overflow: hidden;
|
|
||||||
max-height: 1cm;
|
|
||||||
justify-content: center;
|
|
||||||
background-color: #000;
|
|
||||||
z-index: 3;
|
|
||||||
padding: 10px 0 10px 0;
|
|
||||||
border-top: 1px solid white;
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,17 +0,0 @@
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
pub trait Class {
|
|
||||||
fn class(&self) -> Option<&'static str>;
|
|
||||||
}
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use core::sync::atomic::{AtomicBool, AtomicI64, Ordering};
|
use core::sync::atomic::{AtomicBool, AtomicI64, AtomicPtr, AtomicU64, AtomicUsize, Ordering};
|
||||||
use std::rc::Rc;
|
use std::rc::Rc;
|
||||||
|
|
||||||
use chrono::{DateTime, TimeDelta, Utc};
|
use chrono::{DateTime, TimeDelta, Utc};
|
||||||
|
|
@ -30,7 +30,7 @@ use crate::{
|
||||||
clients::client::connection::{Connection2, ConnectionError},
|
clients::client::connection::{Connection2, ConnectionError},
|
||||||
components::{
|
components::{
|
||||||
Button, CoverOfDarkness, Identity, Story,
|
Button, CoverOfDarkness, Identity, Story,
|
||||||
client::{ClientFooter, ClientNav, Signin},
|
client::{ClientNav, Signin},
|
||||||
},
|
},
|
||||||
storage::StorageKey,
|
storage::StorageKey,
|
||||||
};
|
};
|
||||||
|
|
@ -253,7 +253,6 @@ pub fn Client2(ClientProps { auto_join }: &ClientProps) -> Html {
|
||||||
<>
|
<>
|
||||||
{nav}
|
{nav}
|
||||||
{content}
|
{content}
|
||||||
<ClientFooter />
|
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -41,7 +41,7 @@ use yew::{html::Scope, prelude::*};
|
||||||
use crate::{
|
use crate::{
|
||||||
callback,
|
callback,
|
||||||
components::{
|
components::{
|
||||||
Button, Lobby, LobbyPlayerAction, RoleReveal, Settings, Story, Victory,
|
Button, CoverOfDarkness, Lobby, LobbyPlayerAction, RoleReveal, Settings, Story, Victory,
|
||||||
action::{ActionResultView, Prompt},
|
action::{ActionResultView, Prompt},
|
||||||
host::{DaytimePlayerList, Setup},
|
host::{DaytimePlayerList, Setup},
|
||||||
},
|
},
|
||||||
|
|
@ -224,7 +224,6 @@ pub enum HostState {
|
||||||
Result(Option<CharacterIdentity>, ActionResult),
|
Result(Option<CharacterIdentity>, ActionResult),
|
||||||
Story {
|
Story {
|
||||||
story: GameStory,
|
story: GameStory,
|
||||||
#[allow(unused)]
|
|
||||||
page: usize,
|
page: usize,
|
||||||
},
|
},
|
||||||
}
|
}
|
||||||
|
|
@ -312,7 +311,7 @@ impl Component for Host {
|
||||||
fn view(&self, _ctx: &Context<Self>) -> Html {
|
fn view(&self, _ctx: &Context<Self>) -> Html {
|
||||||
log::trace!("state: {:?}", self.state);
|
log::trace!("state: {:?}", self.state);
|
||||||
let content = match self.state.clone() {
|
let content = match self.state.clone() {
|
||||||
HostState::Story { story, .. } => {
|
HostState::Story { story, page } => {
|
||||||
if let Some(outcome) = story
|
if let Some(outcome) = story
|
||||||
.final_village()
|
.final_village()
|
||||||
.ok()
|
.ok()
|
||||||
|
|
@ -612,7 +611,8 @@ impl Component for Host {
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
HostEvent::Error(err) => {
|
HostEvent::Error(err) => {
|
||||||
self.error_callback.emit(Some(WerewolfError::Game(err)));
|
self.error_callback
|
||||||
|
.emit(Some(WerewolfError::GameError(err)));
|
||||||
false
|
false
|
||||||
}
|
}
|
||||||
HostEvent::SetBigScreenState(state) => {
|
HostEvent::SetBigScreenState(state) => {
|
||||||
|
|
|
||||||
|
|
@ -16,8 +16,8 @@ use core::num::NonZeroU8;
|
||||||
|
|
||||||
use werewolves_proto::{
|
use werewolves_proto::{
|
||||||
character::{Character, CharacterId},
|
character::{Character, CharacterId},
|
||||||
diedto::DiedToTitle,
|
diedto::{DiedTo, DiedToTitle},
|
||||||
game::{self, Game, GameOver, GameSettings, OrRandom, SetupRole, story::GameStory},
|
game::{self, Game, GameOver, GameSettings, OrRandom, SetupRole, Village, story::GameStory},
|
||||||
message::{
|
message::{
|
||||||
CharacterState, Identification, PublicIdentity,
|
CharacterState, Identification, PublicIdentity,
|
||||||
host::{HostDayMessage, HostGameMessage, HostNightMessage, ServerToHostMessage},
|
host::{HostDayMessage, HostGameMessage, HostNightMessage, ServerToHostMessage},
|
||||||
|
|
@ -121,7 +121,7 @@ pub fn test_story() -> GameStory {
|
||||||
settings.add_and_assign(hunter.0, hunter.1);
|
settings.add_and_assign(hunter.0, hunter.1);
|
||||||
settings.add_and_assign(diseased.0, diseased.1);
|
settings.add_and_assign(diseased.0, diseased.1);
|
||||||
settings.fill_remaining_slots_with_villagers(players.len());
|
settings.fill_remaining_slots_with_villagers(players.len());
|
||||||
#[allow(unused)]
|
|
||||||
let (
|
let (
|
||||||
werewolf,
|
werewolf,
|
||||||
dire_wolf,
|
dire_wolf,
|
||||||
|
|
@ -596,7 +596,6 @@ impl ActionPromptTitleExt for ActionPromptTitle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
pub trait ActionResultExt {
|
pub trait ActionResultExt {
|
||||||
fn sleep(&self);
|
fn sleep(&self);
|
||||||
fn r#continue(&self);
|
fn r#continue(&self);
|
||||||
|
|
@ -656,7 +655,7 @@ impl ActionResultExt for ActionResult {
|
||||||
|
|
||||||
fn seer(&self) -> Alignment {
|
fn seer(&self) -> Alignment {
|
||||||
match self {
|
match self {
|
||||||
ActionResult::Seer(a) => *a,
|
ActionResult::Seer(a) => a.clone(),
|
||||||
_ => panic!("expected a seer result"),
|
_ => panic!("expected a seer result"),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -675,7 +674,7 @@ impl ActionResultExt for ActionResult {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[allow(unused)]
|
|
||||||
pub trait AlignmentExt {
|
pub trait AlignmentExt {
|
||||||
fn village(&self);
|
fn village(&self);
|
||||||
fn wolves(&self);
|
fn wolves(&self);
|
||||||
|
|
@ -690,7 +689,7 @@ impl AlignmentExt for Alignment {
|
||||||
assert_eq!(*self, Alignment::Wolves)
|
assert_eq!(*self, Alignment::Wolves)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#[allow(unused)]
|
|
||||||
pub trait ServerToHostMessageExt {
|
pub trait ServerToHostMessageExt {
|
||||||
fn prompt(self) -> ActionPrompt;
|
fn prompt(self) -> ActionPrompt;
|
||||||
fn result(self) -> ActionResult;
|
fn result(self) -> ActionResult;
|
||||||
|
|
@ -726,7 +725,6 @@ impl ServerToHostMessageExt for ServerToHostMessage {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[allow(unused)]
|
|
||||||
pub trait GameExt {
|
pub trait GameExt {
|
||||||
fn villager_character_ids(&self) -> Box<[CharacterId]>;
|
fn villager_character_ids(&self) -> Box<[CharacterId]>;
|
||||||
fn character_by_player_id(&self, player_id: PlayerId) -> Character;
|
fn character_by_player_id(&self, player_id: PlayerId) -> Character;
|
||||||
|
|
@ -824,8 +822,7 @@ impl GameExt for Game {
|
||||||
fn mark_and_check(&mut self, mark: CharacterId) {
|
fn mark_and_check(&mut self, mark: CharacterId) {
|
||||||
let prompt = self.mark(mark);
|
let prompt = self.mark(mark);
|
||||||
match prompt {
|
match prompt {
|
||||||
ActionPrompt::TraitorIntro { .. }
|
ActionPrompt::Insomniac { .. }
|
||||||
| ActionPrompt::Insomniac { .. }
|
|
||||||
| ActionPrompt::MasonsWake { .. }
|
| ActionPrompt::MasonsWake { .. }
|
||||||
| ActionPrompt::ElderReveal { .. }
|
| ActionPrompt::ElderReveal { .. }
|
||||||
| ActionPrompt::CoverOfDarkness
|
| ActionPrompt::CoverOfDarkness
|
||||||
|
|
|
||||||
|
|
@ -22,6 +22,7 @@ use werewolves_proto::{
|
||||||
host::{HostGameMessage, HostMessage, HostNightMessage},
|
host::{HostGameMessage, HostMessage, HostNightMessage},
|
||||||
night::{ActionPrompt, ActionResponse},
|
night::{ActionPrompt, ActionResponse},
|
||||||
},
|
},
|
||||||
|
role::PreviousGuardianAction,
|
||||||
};
|
};
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
|
|
@ -30,7 +31,7 @@ use crate::{
|
||||||
Button, CoverOfDarkness, Identity,
|
Button, CoverOfDarkness, Identity,
|
||||||
action::{BinaryChoice, TargetPicker, WolvesIntro},
|
action::{BinaryChoice, TargetPicker, WolvesIntro},
|
||||||
},
|
},
|
||||||
pages::TraitorIntroPage,
|
pages::MasonsWake,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Properties)]
|
#[derive(Debug, Clone, PartialEq, Properties)]
|
||||||
|
|
@ -65,16 +66,9 @@ pub fn Prompt(props: &ActionPromptProps) -> Html {
|
||||||
if let Some(page) = props.pages.get(props.page_idx).map(|page| {
|
if let Some(page) = props.pages.get(props.page_idx).map(|page| {
|
||||||
let next = props.big_screen.not().then(|| {
|
let next = props.big_screen.not().then(|| {
|
||||||
let send = props.on_complete.clone();
|
let send = props.on_complete.clone();
|
||||||
let page_idx = props.page_idx;
|
|
||||||
let pages_total = props.pages.len();
|
|
||||||
let prompt = props.prompt.clone();
|
|
||||||
let on_page_next = Callback::from(move |_| {
|
let on_page_next = Callback::from(move |_| {
|
||||||
send.emit(HostMessage::InGame(HostGameMessage::Night(
|
send.emit(HostMessage::InGame(HostGameMessage::Night(
|
||||||
if page_idx + 1 >= pages_total && !prompt.interactive() {
|
HostNightMessage::NextPage,
|
||||||
HostNightMessage::ActionResponse(ActionResponse::ContinueToResult)
|
|
||||||
} else {
|
|
||||||
HostNightMessage::NextPage
|
|
||||||
},
|
|
||||||
)))
|
)))
|
||||||
});
|
});
|
||||||
html! {
|
html! {
|
||||||
|
|
@ -119,15 +113,6 @@ pub fn Prompt(props: &ActionPromptProps) -> Html {
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let (character_id, targets, marked, role_info) = match &props.prompt {
|
let (character_id, targets, marked, role_info) = match &props.prompt {
|
||||||
ActionPrompt::TraitorIntro { character_id } => {
|
|
||||||
return html! {
|
|
||||||
<div class="prompt">
|
|
||||||
{identity_html(props, Some(character_id))}
|
|
||||||
<TraitorIntroPage />
|
|
||||||
{cont}
|
|
||||||
</div>
|
|
||||||
};
|
|
||||||
}
|
|
||||||
ActionPrompt::CoverOfDarkness => {
|
ActionPrompt::CoverOfDarkness => {
|
||||||
return html! {
|
return html! {
|
||||||
<CoverOfDarkness next={continue_callback}/>
|
<CoverOfDarkness next={continue_callback}/>
|
||||||
|
|
@ -158,29 +143,41 @@ pub fn Prompt(props: &ActionPromptProps) -> Html {
|
||||||
ActionPrompt::RoleChange { .. }
|
ActionPrompt::RoleChange { .. }
|
||||||
| ActionPrompt::ElderReveal { .. }
|
| ActionPrompt::ElderReveal { .. }
|
||||||
| ActionPrompt::Insomniac { .. } => {
|
| ActionPrompt::Insomniac { .. } => {
|
||||||
if !props.big_screen {
|
if let Some(cb) = continue_callback {
|
||||||
props
|
cb.emit(());
|
||||||
.on_complete
|
|
||||||
.emit(HostMessage::InGame(HostGameMessage::Night(
|
|
||||||
HostNightMessage::ActionResponse(ActionResponse::ContinueToResult),
|
|
||||||
)));
|
|
||||||
}
|
}
|
||||||
return html! {
|
return html! {};
|
||||||
<CoverOfDarkness message={"oops".to_string()} />
|
|
||||||
};
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ActionPrompt::Guardian {
|
ActionPrompt::Guardian {
|
||||||
character_id,
|
character_id,
|
||||||
|
previous,
|
||||||
living_players,
|
living_players,
|
||||||
marked,
|
marked,
|
||||||
..
|
|
||||||
} => {
|
} => {
|
||||||
|
let last_protect = previous.as_ref().map(|prev| match prev {
|
||||||
|
PreviousGuardianAction::Protect(target) => {
|
||||||
|
html! {
|
||||||
|
<>
|
||||||
|
<b>{"last night you protected: "}</b>
|
||||||
|
<Identity ident={Into::<PublicIdentity>::into(target)}/>
|
||||||
|
</>
|
||||||
|
}
|
||||||
|
}
|
||||||
|
PreviousGuardianAction::Guard(target) => html! {
|
||||||
|
<>
|
||||||
|
<b>{"last night you guarded: "}</b>
|
||||||
|
<Identity ident={Into::<PublicIdentity>::into(target)}/>
|
||||||
|
</>
|
||||||
|
},
|
||||||
|
});
|
||||||
let marked = marked.iter().cloned().collect::<Box<[CharacterId]>>();
|
let marked = marked.iter().cloned().collect::<Box<[CharacterId]>>();
|
||||||
|
|
||||||
return html! {
|
return html! {
|
||||||
<div class="guardian-select">
|
<div>
|
||||||
{identity_html(props, Some(character_id))}
|
{identity_html(props, Some(character_id))}
|
||||||
|
<h2>{"guardian"}</h2>
|
||||||
|
{last_protect}
|
||||||
<TargetPicker
|
<TargetPicker
|
||||||
targets={living_players.clone()}
|
targets={living_players.clone()}
|
||||||
marked={marked}
|
marked={marked}
|
||||||
|
|
@ -406,26 +403,24 @@ pub fn Prompt(props: &ActionPromptProps) -> Html {
|
||||||
)));
|
)));
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
let choice = props.big_screen.not().then_some(html! {
|
|
||||||
<BinaryChoice on_chosen={on_select} />
|
|
||||||
});
|
|
||||||
return html! {
|
return html! {
|
||||||
<div class="role-page">
|
<div class="role-page">
|
||||||
{identity_html(props, Some(character_id))}
|
{identity_html(props, Some(character_id))}
|
||||||
<h1 class="wolves">{"SHAPESHIFTER"}</h1>
|
<h1 class="wolves">{"SHAPESHIFTER"}</h1>
|
||||||
<div class="information wolves faint">
|
<div class="information wolves faint">
|
||||||
<h2>
|
<h3>
|
||||||
{"WOULD YOU LIKE TO USE YOUR "}
|
{"WOULD YOU LIKE TO USE YOUR "}
|
||||||
<span class="yellow">{"ONCE PER GAME"}</span>
|
<span class="yellow">{"ONCE PER GAME"}</span>
|
||||||
{" SHAPESHIFT ABILITY?"}
|
{" SHAPESHIFT ABILITY?"}
|
||||||
</h2>
|
</h3>
|
||||||
<h2>
|
<h4>
|
||||||
<span class="yellow">{"YOU WILL DIE"}</span>{", AND THE "}
|
<span class="yellow">{"YOU WILL DIE"}</span>{", AND THE "}
|
||||||
{"TARGET OF THE WOLFPACK KILL"}
|
{"TARGET OF THE WOLFPACK KILL"}
|
||||||
{" SHALL INSTEAD BECOME A WOLF"}
|
{" SHALL INSTEAD BECOME A WOLF"}
|
||||||
</h2>
|
</h4>
|
||||||
</div>
|
</div>
|
||||||
{choice}
|
<BinaryChoice on_chosen={on_select}>
|
||||||
|
</BinaryChoice>
|
||||||
</div>
|
</div>
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,6 +14,7 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use core::ops::Not;
|
use core::ops::Not;
|
||||||
|
|
||||||
|
use convert_case::{Case, Casing};
|
||||||
use werewolves_proto::message::{
|
use werewolves_proto::message::{
|
||||||
PublicIdentity,
|
PublicIdentity,
|
||||||
host::{HostGameMessage, HostMessage, HostNightMessage},
|
host::{HostGameMessage, HostMessage, HostNightMessage},
|
||||||
|
|
@ -22,11 +23,10 @@ use werewolves_proto::message::{
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::{
|
use crate::{
|
||||||
components::{Button, CoverOfDarkness, Identity},
|
components::{Button, CoverOfDarkness, Icon, IconSource, Identity},
|
||||||
pages::{
|
pages::{
|
||||||
AdjudicatorResult, ArcanistResult, BeholderSawEverything, BeholderSawNothing, DrunkPage,
|
AdjudicatorResult, ArcanistResult, BeholderSawNothing, EmpathResult, GravediggerResultPage,
|
||||||
EmpathResult, GravediggerResultPage, InsomniacResult, MorticianResultPage, PowerSeerResult,
|
InsomniacResult, MorticianResultPage, PowerSeerResult, RoleblockPage, SeerResult,
|
||||||
RoleblockPage, SeerResult, ShiftFailed,
|
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
|
|
@ -58,15 +58,6 @@ pub fn ActionResultView(props: &ActionResultProps) -> Html {
|
||||||
.not()
|
.not()
|
||||||
.then(|| html! {<Button on_click={on_continue}>{"continue"}</Button>});
|
.then(|| html! {<Button on_click={on_continue}>{"continue"}</Button>});
|
||||||
let body = match &props.result {
|
let body = match &props.result {
|
||||||
ActionResult::ShiftFailed => html! {
|
|
||||||
<ShiftFailed />
|
|
||||||
},
|
|
||||||
ActionResult::Drunk => html! {
|
|
||||||
<DrunkPage />
|
|
||||||
},
|
|
||||||
ActionResult::BeholderSawEverything => html! {
|
|
||||||
<BeholderSawEverything />
|
|
||||||
},
|
|
||||||
ActionResult::BeholderSawNothing => html! {
|
ActionResult::BeholderSawNothing => html! {
|
||||||
<BeholderSawNothing />
|
<BeholderSawNothing />
|
||||||
},
|
},
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,6 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use convert_case::{Case, Casing};
|
|
||||||
use werewolves_proto::{
|
use werewolves_proto::{
|
||||||
message::{CharacterIdentity, PublicIdentity},
|
message::{CharacterIdentity, PublicIdentity},
|
||||||
role::RoleTitle,
|
role::RoleTitle,
|
||||||
|
|
@ -43,7 +42,7 @@ pub fn WolvesIntro(props: &WolvesIntroProps) -> Html {
|
||||||
{
|
{
|
||||||
props.wolves.iter().map(|w| html!{
|
props.wolves.iter().map(|w| html!{
|
||||||
<div class="character wolves faint">
|
<div class="character wolves faint">
|
||||||
<p class="role yellow">{w.1.to_string().to_case(Case::Title)}</p>
|
<p class="role">{w.1.to_string()}</p>
|
||||||
<Identity ident={Into::<PublicIdentity>::into(&w.0)} />
|
<Identity ident={Into::<PublicIdentity>::into(&w.0)} />
|
||||||
</div>
|
</div>
|
||||||
}).collect::<Html>()
|
}).collect::<Html>()
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,14 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use convert_case::{Case, Casing};
|
use convert_case::{Case, Casing};
|
||||||
use werewolves_proto::{diedto::DiedToTitle, game::SetupRoleTitle};
|
use werewolves_proto::{
|
||||||
|
diedto::{DiedTo, DiedToTitle},
|
||||||
|
game::{Category, SetupRoleTitle},
|
||||||
|
role,
|
||||||
|
};
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource, IconType, PartialAssociatedIcon};
|
use crate::components::{AssociatedIcon, Icon, IconSource, IconType, PartialAssociatedIcon};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Properties)]
|
#[derive(Debug, Clone, Copy, PartialEq, Properties)]
|
||||||
pub struct DiedToSpanProps {
|
pub struct DiedToSpanProps {
|
||||||
|
|
|
||||||
|
|
@ -12,7 +12,7 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use werewolves_proto::role::Killer;
|
use werewolves_proto::role::{self, Killer};
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{AssociatedIcon, Icon, IconType};
|
use crate::components::{AssociatedIcon, Icon, IconType};
|
||||||
|
|
|
||||||
|
|
@ -12,39 +12,28 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use werewolves_proto::aura::{self, Aura, AuraTitle};
|
use werewolves_proto::aura;
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::{
|
use crate::components::{Icon, IconType, PartialAssociatedIcon};
|
||||||
class::Class,
|
|
||||||
components::{Icon, IconType, PartialAssociatedIcon},
|
|
||||||
};
|
|
||||||
|
|
||||||
impl Class for AuraTitle {
|
|
||||||
fn class(&self) -> Option<&'static str> {
|
|
||||||
Some(match self {
|
|
||||||
aura::AuraTitle::Traitor => "traitor",
|
|
||||||
aura::AuraTitle::Drunk => "drunk",
|
|
||||||
aura::AuraTitle::Insane => "insane",
|
|
||||||
aura::AuraTitle::Bloodlet => "wolves",
|
|
||||||
})
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
impl Class for Aura {
|
|
||||||
fn class(&self) -> Option<&'static str> {
|
|
||||||
self.title().class()
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Properties)]
|
#[derive(Debug, Clone, PartialEq, Properties)]
|
||||||
pub struct AuraSpanProps {
|
pub struct AuraProps {
|
||||||
pub aura: aura::AuraTitle,
|
pub aura: aura::Aura,
|
||||||
|
}
|
||||||
|
|
||||||
|
fn aura_class(aura: &aura::Aura) -> Option<&'static str> {
|
||||||
|
Some(match aura {
|
||||||
|
aura::Aura::Traitor => "traitor",
|
||||||
|
aura::Aura::Drunk => "drunk",
|
||||||
|
aura::Aura::Insane => "insane",
|
||||||
|
aura::Aura::Bloodlet { .. } => "wolves",
|
||||||
|
})
|
||||||
}
|
}
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn AuraSpan(AuraSpanProps { aura }: &AuraSpanProps) -> Html {
|
pub fn Aura(AuraProps { aura }: &AuraProps) -> Html {
|
||||||
let class = aura.class();
|
let class = aura_class(aura);
|
||||||
let icon = aura.icon().map(|icon| {
|
let icon = aura.icon().map(|icon| {
|
||||||
html! {
|
html! {
|
||||||
<div>
|
<div>
|
||||||
|
|
|
||||||
|
|
@ -1,110 +0,0 @@
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
use yew::prelude::*;
|
|
||||||
|
|
||||||
use crate::components::{Dialog, WithConfirmation};
|
|
||||||
|
|
||||||
const SOURCE_CODE_URL: &str = "https://sectorinf.com/emilis/werewolves";
|
|
||||||
|
|
||||||
#[function_component]
|
|
||||||
pub fn ClientFooter() -> Html {
|
|
||||||
let about_dialog_state = use_state(|| false);
|
|
||||||
let about_dialog = about_dialog_state.then(|| {
|
|
||||||
let cancel_signout = {
|
|
||||||
let dialog = about_dialog_state.clone();
|
|
||||||
Callback::from(move |_| {
|
|
||||||
dialog.set(false);
|
|
||||||
})
|
|
||||||
};
|
|
||||||
let callback = Callback::from(move |_| ());
|
|
||||||
let options: Box<[String]> = Box::new([]);
|
|
||||||
html! {
|
|
||||||
<Dialog
|
|
||||||
options={options}
|
|
||||||
cancel_callback={Some(cancel_signout)}
|
|
||||||
callback={callback}
|
|
||||||
>
|
|
||||||
<About />
|
|
||||||
</Dialog>
|
|
||||||
}
|
|
||||||
});
|
|
||||||
let about_click = {
|
|
||||||
let dialog_set = about_dialog_state.setter();
|
|
||||||
move |_| {
|
|
||||||
dialog_set.set(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
|
|
||||||
html! {
|
|
||||||
<nav class="footer">
|
|
||||||
<button class="default-button solid" onclick={about_click}>{"about"}</button>
|
|
||||||
{about_dialog}
|
|
||||||
</nav>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[function_component]
|
|
||||||
pub fn About() -> Html {
|
|
||||||
let confirm_state = use_state(|| false);
|
|
||||||
let source_code_confirm = {
|
|
||||||
let confirm_callback = {
|
|
||||||
move |_| {
|
|
||||||
let _ = gloo::utils::window().location().set_href(SOURCE_CODE_URL);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let message = html! {
|
|
||||||
<>
|
|
||||||
<h1>{"this will take you away from the game"}</h1>
|
|
||||||
<h3>{"make sure this isn't an oopsie"}</h3>
|
|
||||||
</>
|
|
||||||
};
|
|
||||||
html! {
|
|
||||||
<WithConfirmation
|
|
||||||
state={confirm_state}
|
|
||||||
confirm_callback={confirm_callback}
|
|
||||||
message={message}
|
|
||||||
>
|
|
||||||
{"source code"}
|
|
||||||
</WithConfirmation>
|
|
||||||
}
|
|
||||||
};
|
|
||||||
let dirty = crate::BUILD_DIRTY.then_some(html! {
|
|
||||||
<>
|
|
||||||
{" "}
|
|
||||||
<span class="dirty">{"(dirty)"}</span>
|
|
||||||
</>
|
|
||||||
});
|
|
||||||
html! {
|
|
||||||
<div class="about">
|
|
||||||
<h1>{"werewolves"}</h1>
|
|
||||||
<div class="build-info">
|
|
||||||
<p class="build-id">
|
|
||||||
<label>{"build: "}</label>
|
|
||||||
<a href={format!("{SOURCE_CODE_URL}/commit/{}", crate::BUILD_ID_LONG)}>
|
|
||||||
{crate::BUILD_ID}
|
|
||||||
{dirty}
|
|
||||||
</a>
|
|
||||||
</p>
|
|
||||||
<p class="build-time">
|
|
||||||
<label>{"built at: "}</label>
|
|
||||||
<span class="time">{crate::BUILD_TIME}</span>
|
|
||||||
</p>
|
|
||||||
</div>
|
|
||||||
<nav class="links">
|
|
||||||
{source_code_confirm}
|
|
||||||
</nav>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -53,9 +53,6 @@ pub fn ClientNav(
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|
||||||
let number_open = use_state(|| false);
|
|
||||||
let name_open = use_state(|| false);
|
|
||||||
let pronouns_open = use_state(|| false);
|
|
||||||
let number = {
|
let number = {
|
||||||
let current_value = use_state(String::new);
|
let current_value = use_state(String::new);
|
||||||
let message_callback = message_callback.clone();
|
let message_callback = message_callback.clone();
|
||||||
|
|
@ -66,7 +63,8 @@ pub fn ClientNav(
|
||||||
.number
|
.number
|
||||||
.map(|v| v.to_string())
|
.map(|v| v.to_string())
|
||||||
.unwrap_or_else(|| String::from("???"));
|
.unwrap_or_else(|| String::from("???"));
|
||||||
let open_set = number_open.setter();
|
let open = use_state(|| false);
|
||||||
|
let open_set = open.setter();
|
||||||
let on_submit = {
|
let on_submit = {
|
||||||
let val = current_value.clone();
|
let val = current_value.clone();
|
||||||
Callback::from(move |_| {
|
Callback::from(move |_| {
|
||||||
|
|
@ -87,27 +85,19 @@ pub fn ClientNav(
|
||||||
open_set.set(false);
|
open_set.set(false);
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
let close_others = {
|
|
||||||
let name_open = name_open.clone();
|
|
||||||
let pronouns_open = pronouns_open.clone();
|
|
||||||
Callback::from(move |_| {
|
|
||||||
name_open.set(false);
|
|
||||||
pronouns_open.set(false);
|
|
||||||
})
|
|
||||||
};
|
|
||||||
html! {
|
html! {
|
||||||
<ClickableNumberEdit
|
<ClickableNumberEdit
|
||||||
value={current_value.clone()}
|
value={current_value.clone()}
|
||||||
field_name="number"
|
field_name="number"
|
||||||
on_submit={on_submit}
|
on_submit={on_submit}
|
||||||
state={number_open.clone()}
|
state={open}
|
||||||
on_open={close_others}
|
|
||||||
>
|
>
|
||||||
<div class="number">{current_num}</div>
|
<div class="number">{current_num}</div>
|
||||||
</ClickableNumberEdit>
|
</ClickableNumberEdit>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let name = {
|
let name = {
|
||||||
|
let open = use_state(|| false);
|
||||||
let name = use_state(String::new);
|
let name = use_state(String::new);
|
||||||
let on_submit = {
|
let on_submit = {
|
||||||
let ident = identity.clone();
|
let ident = identity.clone();
|
||||||
|
|
@ -125,29 +115,20 @@ pub fn ClientNav(
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
let close_others = {
|
|
||||||
let number_open = number_open.clone();
|
|
||||||
let pronouns_open = pronouns_open.clone();
|
|
||||||
Callback::from(move |_| {
|
|
||||||
number_open.set(false);
|
|
||||||
pronouns_open.set(false);
|
|
||||||
})
|
|
||||||
};
|
|
||||||
html! {
|
html! {
|
||||||
<ClickableTextEdit
|
<ClickableTextEdit
|
||||||
value={name.clone()}
|
value={name.clone()}
|
||||||
submit_ident={identity.clone()}
|
submit_ident={identity.clone()}
|
||||||
field_name="pronouns"
|
field_name="pronouns"
|
||||||
on_submit={on_submit}
|
on_submit={on_submit}
|
||||||
state={name_open.clone()}
|
state={open}
|
||||||
on_open={close_others}
|
|
||||||
>
|
>
|
||||||
<div class="name">{identity.1.name.as_str()}</div>
|
<div class="name">{identity.1.name.as_str()}</div>
|
||||||
</ClickableTextEdit>
|
</ClickableTextEdit>
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
let pronouns = {
|
let pronouns = {
|
||||||
let pronuns_state = use_state(String::new);
|
let pronouns_state = use_state(String::new);
|
||||||
|
|
||||||
let on_submit = {
|
let on_submit = {
|
||||||
let ident = identity.clone();
|
let ident = identity.clone();
|
||||||
|
|
@ -164,22 +145,14 @@ pub fn ClientNav(
|
||||||
})
|
})
|
||||||
})
|
})
|
||||||
};
|
};
|
||||||
let close_others = {
|
let open = use_state(|| false);
|
||||||
let number_open = number_open.clone();
|
|
||||||
let name_open = name_open.clone();
|
|
||||||
Callback::from(move |_| {
|
|
||||||
number_open.set(false);
|
|
||||||
name_open.set(false);
|
|
||||||
})
|
|
||||||
};
|
|
||||||
html! {
|
html! {
|
||||||
<ClickableTextEdit
|
<ClickableTextEdit
|
||||||
value={pronuns_state}
|
value={pronouns_state}
|
||||||
submit_ident={identity.clone()}
|
submit_ident={identity.clone()}
|
||||||
field_name="pronouns"
|
field_name="pronouns"
|
||||||
on_submit={on_submit}
|
on_submit={on_submit}
|
||||||
state={pronouns_open}
|
state={open}
|
||||||
on_open={close_others}
|
|
||||||
>
|
>
|
||||||
{pronouns}
|
{pronouns}
|
||||||
</ClickableTextEdit>
|
</ClickableTextEdit>
|
||||||
|
|
@ -226,8 +199,6 @@ struct ClickableTextEditProps {
|
||||||
pub state: UseStateHandle<bool>,
|
pub state: UseStateHandle<bool>,
|
||||||
#[prop_or(100)]
|
#[prop_or(100)]
|
||||||
pub max_length: usize,
|
pub max_length: usize,
|
||||||
#[prop_or_default]
|
|
||||||
pub on_open: Option<Callback<()>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
|
|
@ -240,7 +211,6 @@ fn ClickableTextEdit(
|
||||||
on_submit,
|
on_submit,
|
||||||
state,
|
state,
|
||||||
max_length,
|
max_length,
|
||||||
on_open,
|
|
||||||
}: &ClickableTextEditProps,
|
}: &ClickableTextEditProps,
|
||||||
) -> Html {
|
) -> Html {
|
||||||
let on_input = crate::components::input_element_string_oninput(value.setter(), *max_length);
|
let on_input = crate::components::input_element_string_oninput(value.setter(), *max_length);
|
||||||
|
|
@ -267,7 +237,7 @@ fn ClickableTextEdit(
|
||||||
</div>
|
</div>
|
||||||
};
|
};
|
||||||
html! {
|
html! {
|
||||||
<ClickableField options={options} state={state.clone()} on_open={on_open.clone()}>
|
<ClickableField options={options} state={state.clone()}>
|
||||||
{children.clone()}
|
{children.clone()}
|
||||||
</ClickableField>
|
</ClickableField>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -1,139 +0,0 @@
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
use web_sys::Element;
|
|
||||||
use yew::prelude::*;
|
|
||||||
|
|
||||||
use crate::components::Button;
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Properties)]
|
|
||||||
pub struct DialogProps {
|
|
||||||
#[prop_or_default]
|
|
||||||
pub children: Html,
|
|
||||||
pub options: Box<[String]>,
|
|
||||||
#[prop_or_default]
|
|
||||||
pub cancel_callback: Option<Callback<()>>,
|
|
||||||
pub callback: Callback<String>,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[function_component]
|
|
||||||
pub fn Dialog(
|
|
||||||
DialogProps {
|
|
||||||
children,
|
|
||||||
options,
|
|
||||||
cancel_callback,
|
|
||||||
callback,
|
|
||||||
}: &DialogProps,
|
|
||||||
) -> Html {
|
|
||||||
let options = options
|
|
||||||
.iter()
|
|
||||||
.map(|opt| {
|
|
||||||
let callback = callback.clone();
|
|
||||||
let option = opt.clone();
|
|
||||||
let cb = Callback::from(move |_| {
|
|
||||||
callback.emit(option.clone());
|
|
||||||
});
|
|
||||||
html! {
|
|
||||||
<Button on_click={cb}>{opt.clone()}</Button>
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect::<Html>();
|
|
||||||
let backdrop_click = cancel_callback.clone().map(|cancel_callback| {
|
|
||||||
Callback::from(move |ev: MouseEvent| {
|
|
||||||
if let Some(div) = ev.target_dyn_into::<Element>()
|
|
||||||
&& div.class_name() == "dialog"
|
|
||||||
{
|
|
||||||
ev.stop_propagation();
|
|
||||||
cancel_callback.emit(());
|
|
||||||
}
|
|
||||||
})
|
|
||||||
});
|
|
||||||
|
|
||||||
html! {
|
|
||||||
<div class="click-backdrop" onclick={backdrop_click}>
|
|
||||||
<div class="dialog">
|
|
||||||
<div class="dialog-box">
|
|
||||||
<div class="message">
|
|
||||||
{children.clone()}
|
|
||||||
</div>
|
|
||||||
<div class="options">
|
|
||||||
{options}
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Properties)]
|
|
||||||
pub struct WithConfirmationProps {
|
|
||||||
pub state: UseStateHandle<bool>,
|
|
||||||
#[prop_or_default]
|
|
||||||
pub children: Html,
|
|
||||||
pub confirm_callback: Callback<()>,
|
|
||||||
pub message: Html,
|
|
||||||
}
|
|
||||||
|
|
||||||
#[function_component]
|
|
||||||
pub fn WithConfirmation(
|
|
||||||
WithConfirmationProps {
|
|
||||||
state,
|
|
||||||
children,
|
|
||||||
confirm_callback,
|
|
||||||
message,
|
|
||||||
}: &WithConfirmationProps,
|
|
||||||
) -> Html {
|
|
||||||
let about_dialog_state = state.clone();
|
|
||||||
let confirmation_dialog = about_dialog_state.then(|| {
|
|
||||||
let cancel_signout = {
|
|
||||||
let dialog = about_dialog_state.clone();
|
|
||||||
Callback::from(move |_| {
|
|
||||||
dialog.set(false);
|
|
||||||
})
|
|
||||||
};
|
|
||||||
let confirm_callback = confirm_callback.clone();
|
|
||||||
let callback = {
|
|
||||||
let dialog = about_dialog_state.clone();
|
|
||||||
Callback::from(move |opt: String| {
|
|
||||||
if opt == "ok" {
|
|
||||||
confirm_callback.emit(());
|
|
||||||
} else {
|
|
||||||
dialog.set(false);
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
let options: Box<[String]> = Box::new([String::from("ok"), String::from("take me back")]);
|
|
||||||
html! {
|
|
||||||
<Dialog
|
|
||||||
options={options}
|
|
||||||
cancel_callback={Some(cancel_signout)}
|
|
||||||
callback={callback}
|
|
||||||
>
|
|
||||||
{message.clone()}
|
|
||||||
</Dialog>
|
|
||||||
}
|
|
||||||
});
|
|
||||||
let confirmation_click = {
|
|
||||||
let dialog_set = about_dialog_state.setter();
|
|
||||||
move |_| {
|
|
||||||
dialog_set.set(true);
|
|
||||||
}
|
|
||||||
};
|
|
||||||
html! {
|
|
||||||
<>
|
|
||||||
<Button on_click={confirmation_click}>{children.clone()}</Button>
|
|
||||||
{confirmation_dialog}
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -28,8 +28,6 @@ pub struct ClickableFieldProps {
|
||||||
#[prop_or_default]
|
#[prop_or_default]
|
||||||
pub with_backdrop_exit: bool,
|
pub with_backdrop_exit: bool,
|
||||||
pub state: UseStateHandle<bool>,
|
pub state: UseStateHandle<bool>,
|
||||||
#[prop_or_default]
|
|
||||||
pub on_open: Option<Callback<()>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
|
|
@ -41,20 +39,11 @@ pub fn ClickableField(
|
||||||
button_class,
|
button_class,
|
||||||
with_backdrop_exit,
|
with_backdrop_exit,
|
||||||
state,
|
state,
|
||||||
on_open,
|
|
||||||
}: &ClickableFieldProps,
|
}: &ClickableFieldProps,
|
||||||
) -> Html {
|
) -> Html {
|
||||||
let open = state.clone();
|
let open = state.clone();
|
||||||
let open_close = {
|
let on_click_open = open.clone();
|
||||||
let open = open.clone();
|
let open_close = Callback::from(move |_| on_click_open.set(!(*on_click_open)));
|
||||||
let on_open = on_open.clone();
|
|
||||||
Callback::from(move |_| {
|
|
||||||
if !*open && let Some(on_open) = on_open.as_ref() {
|
|
||||||
on_open.emit(());
|
|
||||||
}
|
|
||||||
open.set(!(*open));
|
|
||||||
})
|
|
||||||
};
|
|
||||||
let submenu_open_close = open_close.clone();
|
let submenu_open_close = open_close.clone();
|
||||||
let submenu = open.clone().then(|| {
|
let submenu = open.clone().then(|| {
|
||||||
let backdrop = with_backdrop_exit.then(|| {
|
let backdrop = with_backdrop_exit.then(|| {
|
||||||
|
|
@ -90,8 +79,6 @@ pub struct ClickableNumberEditProps {
|
||||||
pub on_submit: Callback<()>,
|
pub on_submit: Callback<()>,
|
||||||
pub field_name: &'static str,
|
pub field_name: &'static str,
|
||||||
pub state: UseStateHandle<bool>,
|
pub state: UseStateHandle<bool>,
|
||||||
#[prop_or_default]
|
|
||||||
pub on_open: Option<Callback<()>>,
|
|
||||||
}
|
}
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
|
|
@ -102,7 +89,6 @@ pub fn ClickableNumberEdit(
|
||||||
field_name,
|
field_name,
|
||||||
on_submit,
|
on_submit,
|
||||||
state,
|
state,
|
||||||
on_open,
|
|
||||||
}: &ClickableNumberEditProps,
|
}: &ClickableNumberEditProps,
|
||||||
) -> Html {
|
) -> Html {
|
||||||
let on_input = crate::components::input_element_string_oninput(value.setter(), 20);
|
let on_input = crate::components::input_element_string_oninput(value.setter(), 20);
|
||||||
|
|
@ -115,7 +101,7 @@ pub fn ClickableNumberEdit(
|
||||||
</div>
|
</div>
|
||||||
};
|
};
|
||||||
html! {
|
html! {
|
||||||
<ClickableField options={options} state={state.clone()} on_open={on_open.clone()}>
|
<ClickableField options={options} state={state.clone()}>
|
||||||
{children.clone()}
|
{children.clone()}
|
||||||
</ClickableField>
|
</ClickableField>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -24,6 +24,7 @@ use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{
|
use crate::components::{
|
||||||
AssociatedIcon, Button, Icon, IconType, Identity, PartialAssociatedIcon,
|
AssociatedIcon, Button, Icon, IconType, Identity, PartialAssociatedIcon,
|
||||||
|
attributes::RoleTitleSpan,
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Properties)]
|
#[derive(Debug, Clone, PartialEq, Properties)]
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,11 @@ use core::ops::Not;
|
||||||
use std::collections::HashMap;
|
use std::collections::HashMap;
|
||||||
|
|
||||||
use convert_case::{Case, Casing};
|
use convert_case::{Case, Casing};
|
||||||
use werewolves_proto::game::{Category, GameSettings, SetupRole, SetupRoleTitle};
|
use rand::Rng;
|
||||||
|
use werewolves_proto::{
|
||||||
|
game::{Category, GameSettings, SetupRole, SetupRoleTitle},
|
||||||
|
role::Alignment,
|
||||||
|
};
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{AssociatedIcon, Icon, IconSource, IconType};
|
use crate::components::{AssociatedIcon, Icon, IconSource, IconType};
|
||||||
|
|
@ -147,13 +151,16 @@ pub fn SetupCategory(
|
||||||
</div>
|
</div>
|
||||||
<div class="attributes">
|
<div class="attributes">
|
||||||
<div class="alignment">
|
<div class="alignment">
|
||||||
|
// <img class="icon" src={alignment} alt={"alignment"}/>
|
||||||
<Icon source={alignment} icon_type={IconType::Small}/>
|
<Icon source={alignment} icon_type={IconType::Small}/>
|
||||||
</div>
|
</div>
|
||||||
<div class={classes!("killer", killer_inactive)}>
|
<div class={classes!("killer", killer_inactive)}>
|
||||||
<Icon source={IconSource::Killer} icon_type={IconType::Small}/>
|
<Icon source={IconSource::Killer} icon_type={IconType::Small}/>
|
||||||
|
// <img class="icon" src="/img/killer.svg" alt="killer icon"/>
|
||||||
</div>
|
</div>
|
||||||
<div class={classes!("poweful", powerful_inactive)}>
|
<div class={classes!("poweful", powerful_inactive)}>
|
||||||
<Icon source={IconSource::Powerful} icon_type={IconType::Small}/>
|
<Icon source={IconSource::Powerful} icon_type={IconType::Small}/>
|
||||||
|
// <img class="icon" src="/img/powerful.svg" alt="powerful icon"/>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,7 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use werewolves_proto::{
|
use werewolves_proto::{
|
||||||
aura::AuraTitle,
|
aura::Aura,
|
||||||
diedto::DiedToTitle,
|
diedto::DiedToTitle,
|
||||||
role::{Alignment, Killer, Powerful, RoleTitle},
|
role::{Alignment, Killer, Powerful, RoleTitle},
|
||||||
};
|
};
|
||||||
|
|
@ -79,8 +79,6 @@ decl_icon!(
|
||||||
RedX: "/img/red-x.svg",
|
RedX: "/img/red-x.svg",
|
||||||
Traitor: "/img/traitor.svg",
|
Traitor: "/img/traitor.svg",
|
||||||
Bloodlet: "/img/bloodlet.svg",
|
Bloodlet: "/img/bloodlet.svg",
|
||||||
Drunk: "/img/drunk.svg",
|
|
||||||
Insane: "/img/insane.svg",
|
|
||||||
);
|
);
|
||||||
|
|
||||||
impl IconSource {
|
impl IconSource {
|
||||||
|
|
@ -97,6 +95,7 @@ impl IconSource {
|
||||||
pub enum IconType {
|
pub enum IconType {
|
||||||
List,
|
List,
|
||||||
Small,
|
Small,
|
||||||
|
RoleAdd,
|
||||||
Fit,
|
Fit,
|
||||||
Icon15Pct,
|
Icon15Pct,
|
||||||
Informational,
|
Informational,
|
||||||
|
|
@ -111,6 +110,7 @@ impl IconType {
|
||||||
IconType::Fit => "icon-fit",
|
IconType::Fit => "icon-fit",
|
||||||
IconType::List => "icon-in-list",
|
IconType::List => "icon-in-list",
|
||||||
IconType::Small => "icon",
|
IconType::Small => "icon",
|
||||||
|
IconType::RoleAdd => "icon-role-add",
|
||||||
IconType::Informational => "icon-info",
|
IconType::Informational => "icon-info",
|
||||||
IconType::RoleCheck => "check-icon",
|
IconType::RoleCheck => "check-icon",
|
||||||
}
|
}
|
||||||
|
|
@ -124,8 +124,6 @@ pub struct IconProps {
|
||||||
pub inactive: bool,
|
pub inactive: bool,
|
||||||
#[prop_or_default]
|
#[prop_or_default]
|
||||||
pub icon_type: IconType,
|
pub icon_type: IconType,
|
||||||
#[prop_or_default]
|
|
||||||
pub classes: Classes,
|
|
||||||
}
|
}
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn Icon(
|
pub fn Icon(
|
||||||
|
|
@ -133,13 +131,12 @@ pub fn Icon(
|
||||||
source,
|
source,
|
||||||
inactive,
|
inactive,
|
||||||
icon_type,
|
icon_type,
|
||||||
classes,
|
|
||||||
}: &IconProps,
|
}: &IconProps,
|
||||||
) -> Html {
|
) -> Html {
|
||||||
html! {
|
html! {
|
||||||
<img
|
<img
|
||||||
src={source.source()}
|
src={source.source()}
|
||||||
class={classes!(source.class(), icon_type.class(), inactive.then_some("inactive"), classes.clone())}
|
class={classes!(source.class(), icon_type.class(), inactive.then_some("inactive"))}
|
||||||
/>
|
/>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
@ -230,13 +227,13 @@ impl PartialAssociatedIcon for DiedToTitle {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl PartialAssociatedIcon for AuraTitle {
|
impl PartialAssociatedIcon for Aura {
|
||||||
fn icon(&self) -> Option<IconSource> {
|
fn icon(&self) -> Option<IconSource> {
|
||||||
match self {
|
match self {
|
||||||
AuraTitle::Traitor => Some(IconSource::Traitor),
|
Aura::Traitor => Some(IconSource::Traitor),
|
||||||
AuraTitle::Drunk => Some(IconSource::Drunk),
|
Aura::Drunk => todo!(),
|
||||||
AuraTitle::Insane => Some(IconSource::Insane),
|
Aura::Insane => todo!(),
|
||||||
AuraTitle::Bloodlet => Some(IconSource::Bloodlet),
|
Aura::Bloodlet { .. } => Some(IconSource::Bloodlet),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,7 +17,6 @@ use std::rc::Rc;
|
||||||
|
|
||||||
use convert_case::{Case, Casing};
|
use convert_case::{Case, Casing};
|
||||||
use werewolves_proto::{
|
use werewolves_proto::{
|
||||||
aura::AuraTitle,
|
|
||||||
error::GameError,
|
error::GameError,
|
||||||
game::{GameSettings, OrRandom, SetupRole, SetupSlot, SlotId},
|
game::{GameSettings, OrRandom, SetupRole, SetupSlot, SlotId},
|
||||||
message::{Identification, PlayerState, PublicIdentity},
|
message::{Identification, PlayerState, PublicIdentity},
|
||||||
|
|
@ -25,11 +24,9 @@ use werewolves_proto::{
|
||||||
};
|
};
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::{
|
use crate::components::{
|
||||||
class::Class,
|
Button, ClickableField, Icon, IconSource, IconType, Identity, PartialAssociatedIcon,
|
||||||
components::{
|
client::Signin,
|
||||||
Button, ClickableField, Icon, IconType, Identity, PartialAssociatedIcon, client::Signin,
|
|
||||||
},
|
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, PartialEq, Properties)]
|
#[derive(Debug, PartialEq, Properties)]
|
||||||
|
|
@ -349,7 +346,6 @@ pub fn SettingsSlot(
|
||||||
}: &SettingsSlotProps,
|
}: &SettingsSlotProps,
|
||||||
) -> Html {
|
) -> Html {
|
||||||
let open = use_state(|| false);
|
let open = use_state(|| false);
|
||||||
let aura_open = use_state(|| false);
|
|
||||||
let open_update = open.setter();
|
let open_update = open.setter();
|
||||||
let update = update.clone();
|
let update = update.clone();
|
||||||
let update = Callback::from(move |act| {
|
let update = Callback::from(move |act| {
|
||||||
|
|
@ -365,15 +361,9 @@ pub fn SettingsSlot(
|
||||||
on_kick_update.emit(SettingSlotAction::Remove(slot_id));
|
on_kick_update.emit(SettingSlotAction::Remove(slot_id));
|
||||||
open_update.set(false);
|
open_update.set(false);
|
||||||
});
|
});
|
||||||
let assign_to = assign_to_submenu(players_for_assign, slot, &update, &assign_open.setter());
|
let assign_to = assign_to_submenu(players_for_assign, slot, &update, &open.setter());
|
||||||
let options = setup_options_for_slot(
|
let options =
|
||||||
slot,
|
setup_options_for_slot(slot, &update, roles_in_setup, apprentice_open, open.clone());
|
||||||
&update,
|
|
||||||
roles_in_setup,
|
|
||||||
apprentice_open,
|
|
||||||
open.clone(),
|
|
||||||
aura_open.clone(),
|
|
||||||
);
|
|
||||||
let assign_text = slot
|
let assign_text = slot
|
||||||
.assign_to
|
.assign_to
|
||||||
.as_ref()
|
.as_ref()
|
||||||
|
|
@ -389,7 +379,7 @@ pub fn SettingsSlot(
|
||||||
.unwrap_or_else(|| html! {{"assign"}});
|
.unwrap_or_else(|| html! {{"assign"}});
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<Button on_click={on_kick} classes={classes!("red")}>
|
<Button on_click={on_kick}>
|
||||||
{"remove"}
|
{"remove"}
|
||||||
</Button>
|
</Button>
|
||||||
<ClickableField
|
<ClickableField
|
||||||
|
|
@ -457,71 +447,7 @@ fn setup_options_for_slot(
|
||||||
roles_in_setup: &[RoleTitle],
|
roles_in_setup: &[RoleTitle],
|
||||||
open_apprentice_assign: UseStateHandle<bool>,
|
open_apprentice_assign: UseStateHandle<bool>,
|
||||||
slot_field_open: UseStateHandle<bool>,
|
slot_field_open: UseStateHandle<bool>,
|
||||||
open_aura_assign: UseStateHandle<bool>,
|
|
||||||
) -> Html {
|
) -> Html {
|
||||||
let aura_assign = {
|
|
||||||
let options = AuraTitle::ALL
|
|
||||||
.into_iter()
|
|
||||||
.filter(AuraTitle::assignable)
|
|
||||||
// .map(AuraTitle::into_aura)
|
|
||||||
.filter(|aura| slot.role.title().can_assign_aura(*aura))
|
|
||||||
.map(|aura| {
|
|
||||||
let aura_active = slot.auras.contains(&aura);
|
|
||||||
let active_class = aura_active.then_some("active");
|
|
||||||
let toggle = {
|
|
||||||
let slot = slot.clone();
|
|
||||||
let update = update.clone();
|
|
||||||
Callback::from(move |_| {
|
|
||||||
let mut slot = slot.clone();
|
|
||||||
if aura_active {
|
|
||||||
slot.auras.retain(|a| *a != aura);
|
|
||||||
} else {
|
|
||||||
slot.auras.push(aura);
|
|
||||||
}
|
|
||||||
update.emit(SettingSlotAction::Update(slot))
|
|
||||||
})
|
|
||||||
};
|
|
||||||
let icon = aura
|
|
||||||
.icon()
|
|
||||||
.map(|icon| {
|
|
||||||
html! {
|
|
||||||
// <div
|
|
||||||
<Icon source={icon} icon_type={IconType::Small}/>
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.unwrap_or_else(|| {
|
|
||||||
html! {
|
|
||||||
<div class="icon inactive"/>
|
|
||||||
}
|
|
||||||
});
|
|
||||||
let aura_class = aura.class();
|
|
||||||
|
|
||||||
html! {
|
|
||||||
<Button
|
|
||||||
on_click={toggle}
|
|
||||||
classes={classes!(active_class, "setup-aura", aura_class, "faint")}
|
|
||||||
>
|
|
||||||
<span class="aura-title">
|
|
||||||
{icon}
|
|
||||||
<span class="title">{aura.to_string()}</span>
|
|
||||||
<div class="icon inactive"/>
|
|
||||||
</span>
|
|
||||||
</Button>
|
|
||||||
}
|
|
||||||
})
|
|
||||||
.collect::<Box<[_]>>();
|
|
||||||
options.is_empty().not().then(|| {
|
|
||||||
let options = options.into_iter().collect::<Html>();
|
|
||||||
html! {
|
|
||||||
<ClickableField
|
|
||||||
state={open_aura_assign}
|
|
||||||
options={options}
|
|
||||||
>
|
|
||||||
{"auras"}
|
|
||||||
</ClickableField>
|
|
||||||
}
|
|
||||||
})
|
|
||||||
};
|
|
||||||
let setup_options_for_role = match &slot.role {
|
let setup_options_for_role = match &slot.role {
|
||||||
SetupRole::MasonLeader { recruits_available } => {
|
SetupRole::MasonLeader { recruits_available } => {
|
||||||
let next = {
|
let next = {
|
||||||
|
|
@ -734,10 +660,5 @@ fn setup_options_for_slot(
|
||||||
_ => None,
|
_ => None,
|
||||||
};
|
};
|
||||||
|
|
||||||
html! {
|
setup_options_for_role.unwrap_or_default()
|
||||||
<>
|
|
||||||
{aura_assign}
|
|
||||||
{setup_options_for_role}
|
|
||||||
</>
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -17,20 +17,23 @@ use std::{collections::HashMap, rc::Rc};
|
||||||
|
|
||||||
use convert_case::{Case, Casing};
|
use convert_case::{Case, Casing};
|
||||||
use werewolves_proto::{
|
use werewolves_proto::{
|
||||||
aura::AuraTitle, character::{Character, CharacterId}, game::{
|
character::{Character, CharacterId},
|
||||||
|
game::{
|
||||||
GameTime, SetupRole,
|
GameTime, SetupRole,
|
||||||
night::changes::NightChange,
|
night::changes::NightChange,
|
||||||
story::{
|
story::{
|
||||||
DayDetail, GameActions, GameStory, NightChoice, StoryActionPrompt, StoryActionResult,
|
DayDetail, GameActions, GameStory, NightChoice, StoryActionPrompt, StoryActionResult,
|
||||||
},
|
},
|
||||||
}, role::Alignment
|
},
|
||||||
|
role::Alignment,
|
||||||
};
|
};
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{
|
use crate::components::{
|
||||||
AuraSpan, CharacterCard, Icon, IconSource, IconType, PartialAssociatedIcon, attributes::{
|
CharacterCard, Icon, IconSource, IconType, PartialAssociatedIcon,
|
||||||
|
attributes::{
|
||||||
AlignmentComparisonSpan, AlignmentSpan, CategorySpan, DiedToSpan, KillerSpan, PowerfulSpan,
|
AlignmentComparisonSpan, AlignmentSpan, CategorySpan, DiedToSpan, KillerSpan, PowerfulSpan,
|
||||||
}
|
},
|
||||||
};
|
};
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Properties)]
|
#[derive(Debug, Clone, PartialEq, Properties)]
|
||||||
|
|
@ -77,7 +80,9 @@ pub fn Story(StoryProps { story }: &StoryProps) -> Html {
|
||||||
.collect::<HashMap<_, _>>()));
|
.collect::<HashMap<_, _>>()));
|
||||||
let changes = match changes {
|
let changes = match changes {
|
||||||
GameActions::DayDetails(day_changes) => {
|
GameActions::DayDetails(day_changes) => {
|
||||||
let execute_list =
|
let execute_list = if day_changes.is_empty() {
|
||||||
|
html! {<span>{"no one was executed"}</span>}
|
||||||
|
} else {
|
||||||
day_changes
|
day_changes
|
||||||
.iter()
|
.iter()
|
||||||
.map(|c| match c {
|
.map(|c| match c {
|
||||||
|
|
@ -86,12 +91,15 @@ pub fn Story(StoryProps { story }: &StoryProps) -> Html {
|
||||||
.filter_map(|c| story.starting_village.character_by_id(c).ok())
|
.filter_map(|c| story.starting_village.character_by_id(c).ok())
|
||||||
.map(|c| {
|
.map(|c| {
|
||||||
html! {
|
html! {
|
||||||
|
// <span>
|
||||||
<CharacterCard faint=true char={c.clone()}/>
|
<CharacterCard faint=true char={c.clone()}/>
|
||||||
|
// </span>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.collect::<Html>();
|
.collect::<Html>()
|
||||||
|
};
|
||||||
|
|
||||||
day_changes.is_empty().not().then_some(html! {
|
Some(html! {
|
||||||
<div class="day">
|
<div class="day">
|
||||||
<h3>{"village executed"}</h3>
|
<h3>{"village executed"}</h3>
|
||||||
<div class="executed">
|
<div class="executed">
|
||||||
|
|
@ -116,11 +124,8 @@ pub fn Story(StoryProps { story }: &StoryProps) -> Html {
|
||||||
.iter()
|
.iter()
|
||||||
.map(|c| {
|
.map(|c| {
|
||||||
html! {
|
html! {
|
||||||
<li class="change">
|
<li>
|
||||||
<StoryNightChange
|
<StoryNightChange change={c.clone()} characters={characters.clone()}/>
|
||||||
change={c.clone()}
|
|
||||||
characters={characters.clone()}
|
|
||||||
/>
|
|
||||||
</li>
|
</li>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -176,7 +181,7 @@ fn StoryNightChange(StoryNightChangeProps { change, characters }: &StoryNightCha
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={character.clone()}/>
|
<CharacterCard faint=true char={character.clone()}/>
|
||||||
{"lost the"}
|
{"lost the"}
|
||||||
<AuraSpan aura={aura.title()}/>
|
<crate::components::Aura aura={*aura}/>
|
||||||
{"aura"}
|
{"aura"}
|
||||||
</>
|
</>
|
||||||
}).unwrap_or_default(),
|
}).unwrap_or_default(),
|
||||||
|
|
@ -184,9 +189,9 @@ fn StoryNightChange(StoryNightChangeProps { change, characters }: &StoryNightCha
|
||||||
html!{
|
html!{
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={target.clone()}/>
|
<CharacterCard faint=true char={target.clone()}/>
|
||||||
<span class="story-text">{"gained the"}</span>
|
{"gained the"}
|
||||||
<AuraSpan aura={aura.title()}/>
|
<crate::components::Aura aura={*aura}/>
|
||||||
<span class="story-text">{"aura from"}</span>
|
{"aura from"}
|
||||||
<CharacterCard faint=true char={source.clone()}/>
|
<CharacterCard faint=true char={source.clone()}/>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
@ -200,29 +205,26 @@ fn StoryNightChange(StoryNightChangeProps { change, characters }: &StoryNightCha
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={char.clone()}/>
|
<CharacterCard faint=true char={char.clone()}/>
|
||||||
<span class="story-text">{"is now"}</span>
|
{"is now"}
|
||||||
<CharacterCard faint=true char={new_char.clone()}/>
|
<CharacterCard faint=true char={new_char.clone()}/>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.unwrap_or_default(),
|
.unwrap_or_default(),
|
||||||
|
|
||||||
NightChange::Kill { target, died_to } => {
|
NightChange::Kill { target, died_to } => characters
|
||||||
|
|
||||||
characters
|
|
||||||
.get(target)
|
.get(target)
|
||||||
.map(|target| {
|
.map(|target| {
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<Icon source={IconSource::Skull} icon_type={IconType::Small}/>
|
<Icon source={IconSource::Skull} icon_type={IconType::Small}/>
|
||||||
<CharacterCard faint=true char={target.clone()}/>
|
<CharacterCard faint=true char={target.clone()}/>
|
||||||
<span class="story-text">{"died to"}</span>
|
{"died to"}
|
||||||
<DiedToSpan died_to={died_to.title()}/>
|
<DiedToSpan died_to={died_to.title()}/>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
.unwrap_or_default()
|
.unwrap_or_default(),
|
||||||
},
|
|
||||||
NightChange::RoleBlock { source, target, .. } => characters
|
NightChange::RoleBlock { source, target, .. } => characters
|
||||||
.get(source)
|
.get(source)
|
||||||
.and_then(|s| characters.get(target).map(|t| (s, t)))
|
.and_then(|s| characters.get(target).map(|t| (s, t)))
|
||||||
|
|
@ -230,7 +232,7 @@ fn StoryNightChange(StoryNightChangeProps { change, characters }: &StoryNightCha
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={source.clone()}/>
|
<CharacterCard faint=true char={source.clone()}/>
|
||||||
<span class="story-text">{"role blocked"}</span>
|
{"role blocked"}
|
||||||
<CharacterCard faint=true char={target.clone()}/>
|
<CharacterCard faint=true char={target.clone()}/>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
@ -243,7 +245,7 @@ fn StoryNightChange(StoryNightChangeProps { change, characters }: &StoryNightCha
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={source.clone()}/>
|
<CharacterCard faint=true char={source.clone()}/>
|
||||||
<span class="story-text">{"shapeshifted into"}</span>
|
{"shapeshifted into"}
|
||||||
<CharacterCard faint=true char={into.clone()}/>
|
<CharacterCard faint=true char={into.clone()}/>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
@ -256,7 +258,7 @@ fn StoryNightChange(StoryNightChangeProps { change, characters }: &StoryNightCha
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={elder.clone()}/>
|
<CharacterCard faint=true char={elder.clone()}/>
|
||||||
<span class="story-text">{"learned they are the Elder"}</span>
|
{"learned they are the Elder"}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -268,9 +270,9 @@ fn StoryNightChange(StoryNightChangeProps { change, characters }: &StoryNightCha
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={empath.clone()}/>
|
<CharacterCard faint=true char={empath.clone()}/>
|
||||||
<span class="story-text">{"found the scapegoat in"}</span>
|
{"found the scapegoat in"}
|
||||||
<CharacterCard faint=true char={scapegoat.clone()}/>
|
<CharacterCard faint=true char={scapegoat.clone()}/>
|
||||||
<span class="story-text">{"and took on their curse"}</span>
|
{"and took on their curse"}
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -291,29 +293,16 @@ struct StoryNightResultProps {
|
||||||
#[function_component]
|
#[function_component]
|
||||||
fn StoryNightResult(StoryNightResultProps { result, characters }: &StoryNightResultProps) -> Html {
|
fn StoryNightResult(StoryNightResultProps { result, characters }: &StoryNightResultProps) -> Html {
|
||||||
match result {
|
match result {
|
||||||
StoryActionResult::ShiftFailed => html!{
|
|
||||||
<span class="story-text">{"but it failed"}</span>
|
|
||||||
},
|
|
||||||
StoryActionResult::Drunk => html! {
|
|
||||||
<>
|
|
||||||
<span class="story-text">{"but got "}</span>
|
|
||||||
<AuraSpan aura={AuraTitle::Drunk}/>
|
|
||||||
<span class="story-text">{" instead"}</span>
|
|
||||||
</>
|
|
||||||
},
|
|
||||||
StoryActionResult::BeholderSawEverything => html!{
|
|
||||||
<span class="story-text">{"and saw everything 👁️"}</span>
|
|
||||||
},
|
|
||||||
StoryActionResult::BeholderSawNothing => html!{
|
StoryActionResult::BeholderSawNothing => html!{
|
||||||
<span class="story-text">{"but saw nothing"}</span>
|
<span>{"but saw nothing"}</span>
|
||||||
},
|
},
|
||||||
StoryActionResult::RoleBlocked => html! {
|
StoryActionResult::RoleBlocked => html! {
|
||||||
<span class="story-text">{"but was role blocked"}</span>
|
<span>{"but was role blocked"}</span>
|
||||||
},
|
},
|
||||||
StoryActionResult::Seer(alignment) => {
|
StoryActionResult::Seer(alignment) => {
|
||||||
html! {
|
html! {
|
||||||
<span>
|
<span>
|
||||||
<span class="story-text">{"and saw"}</span>
|
<span>{"and saw"}</span>
|
||||||
<AlignmentSpan alignment={*alignment}/>
|
<AlignmentSpan alignment={*alignment}/>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
|
|
@ -321,25 +310,25 @@ fn StoryNightResult(StoryNightResultProps { result, characters }: &StoryNightRes
|
||||||
StoryActionResult::PowerSeer { powerful } => {
|
StoryActionResult::PowerSeer { powerful } => {
|
||||||
html! {
|
html! {
|
||||||
<span>
|
<span>
|
||||||
<span class="story-text">{"and discovered they are"}</span>
|
<span>{"and discovered they are"}</span>
|
||||||
<PowerfulSpan powerful={*powerful}/>
|
<PowerfulSpan powerful={*powerful}/>
|
||||||
</span>
|
</span>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
StoryActionResult::Adjudicator { killer } => html! {
|
StoryActionResult::Adjudicator { killer } => html! {
|
||||||
<span>
|
<span>
|
||||||
<span class="story-text">{"and saw"}</span>
|
<span>{"and saw"}</span>
|
||||||
<KillerSpan killer={*killer}/>
|
<KillerSpan killer={*killer}/>
|
||||||
</span>
|
</span>
|
||||||
},
|
},
|
||||||
StoryActionResult::Arcanist(same) => html! {
|
StoryActionResult::Arcanist(same) => html! {
|
||||||
<span>
|
<span>
|
||||||
<span class="story-text">{"and saw"}</span>
|
<span>{"and saw"}</span>
|
||||||
<AlignmentComparisonSpan comparison={*same}/>
|
<AlignmentComparisonSpan comparison={*same}/>
|
||||||
</span>
|
</span>
|
||||||
},
|
},
|
||||||
StoryActionResult::GraveDigger(None) => html! {
|
StoryActionResult::GraveDigger(None) => html! {
|
||||||
<span class="story-text">
|
<span>
|
||||||
{"found an empty grave"}
|
{"found an empty grave"}
|
||||||
</span>
|
</span>
|
||||||
},
|
},
|
||||||
|
|
@ -347,7 +336,7 @@ fn StoryNightResult(StoryNightResultProps { result, characters }: &StoryNightRes
|
||||||
let category = Into::<SetupRole>::into(*role_title).category();
|
let category = Into::<SetupRole>::into(*role_title).category();
|
||||||
html! {
|
html! {
|
||||||
<span>
|
<span>
|
||||||
<span class="story-text">{"found the body of a"}</span>
|
<span>{"found the body of a"}</span>
|
||||||
<CategorySpan category={category} icon={role_title.icon()}>
|
<CategorySpan category={category} icon={role_title.icon()}>
|
||||||
{role_title.to_string().to_case(Case::Title)}
|
{role_title.to_string().to_case(Case::Title)}
|
||||||
</CategorySpan>
|
</CategorySpan>
|
||||||
|
|
@ -356,7 +345,7 @@ fn StoryNightResult(StoryNightResultProps { result, characters }: &StoryNightRes
|
||||||
}
|
}
|
||||||
StoryActionResult::Mortician(died_to_title) => html! {
|
StoryActionResult::Mortician(died_to_title) => html! {
|
||||||
<>
|
<>
|
||||||
<span class="story-text">{"and found the cause of death to be"}</span>
|
{"and found the cause of death to be"}
|
||||||
<DiedToSpan died_to={*died_to_title}/>
|
<DiedToSpan died_to={*died_to_title}/>
|
||||||
</>
|
</>
|
||||||
},
|
},
|
||||||
|
|
@ -377,7 +366,7 @@ fn StoryNightResult(StoryNightResultProps { result, characters }: &StoryNightRes
|
||||||
|
|
||||||
StoryActionResult::Empath { scapegoat: false } => html! {
|
StoryActionResult::Empath { scapegoat: false } => html! {
|
||||||
<>
|
<>
|
||||||
<span class="story-text">{"and saw that they are"}</span>
|
{"and saw that they are"}
|
||||||
<span class="attribute-span faint">
|
<span class="attribute-span faint">
|
||||||
<div class="inactive">
|
<div class="inactive">
|
||||||
<Icon source={IconSource::Heart} icon_type={IconType::Small}/>
|
<Icon source={IconSource::Heart} icon_type={IconType::Small}/>
|
||||||
|
|
@ -388,7 +377,7 @@ fn StoryNightResult(StoryNightResultProps { result, characters }: &StoryNightRes
|
||||||
},
|
},
|
||||||
StoryActionResult::Empath { scapegoat: true } => html! {
|
StoryActionResult::Empath { scapegoat: true } => html! {
|
||||||
<>
|
<>
|
||||||
<span class="story-text">{"and saw that they are"}</span>
|
{"and saw that they are"}
|
||||||
<span class="attribute-span faint wolves">
|
<span class="attribute-span faint wolves">
|
||||||
<div>
|
<div>
|
||||||
<Icon source={IconSource::Heart} icon_type={IconType::Small}/>
|
<Icon source={IconSource::Heart} icon_type={IconType::Small}/>
|
||||||
|
|
@ -407,7 +396,7 @@ struct StoryNightChoiceProps {
|
||||||
}
|
}
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
fn StoryNightChoice(StoryNightChoiceProps { choice, characters}: &StoryNightChoiceProps) -> Html {
|
fn StoryNightChoice(StoryNightChoiceProps { choice, characters }: &StoryNightChoiceProps) -> Html {
|
||||||
let generate = |character_id: &CharacterId, chosen: &CharacterId, action: &'static str| {
|
let generate = |character_id: &CharacterId, chosen: &CharacterId, action: &'static str| {
|
||||||
characters
|
characters
|
||||||
.get(character_id)
|
.get(character_id)
|
||||||
|
|
@ -416,7 +405,7 @@ fn StoryNightChoice(StoryNightChoiceProps { choice, characters}: &StoryNightChoi
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={char.clone()}/>
|
<CharacterCard faint=true char={char.clone()}/>
|
||||||
<span class="story-text">{action}</span>
|
<span>{action}</span>
|
||||||
<CharacterCard faint=true char={chosen.clone()}/>
|
<CharacterCard faint=true char={chosen.clone()}/>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
@ -438,9 +427,9 @@ fn StoryNightChoice(StoryNightChoiceProps { choice, characters}: &StoryNightChoi
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={arcanist.clone()}/>
|
<CharacterCard faint=true char={arcanist.clone()}/>
|
||||||
<span class="story-text">{"compared"}</span>
|
<span>{"compared"}</span>
|
||||||
<CharacterCard faint=true char={chosen1.clone()}/>
|
<CharacterCard faint=true char={chosen1.clone()}/>
|
||||||
<span class="story-text">{"and"}</span>
|
<span>{"and"}</span>
|
||||||
<CharacterCard faint=true char={chosen2.clone()}/>
|
<CharacterCard faint=true char={chosen2.clone()}/>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
|
|
@ -458,9 +447,9 @@ fn StoryNightChoice(StoryNightChoiceProps { choice, characters}: &StoryNightChoi
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={leader.clone()}/>
|
<CharacterCard faint=true char={leader.clone()}/>
|
||||||
<span class="story-text">{"'s masons"}</span>
|
<span>{"'s masons"}</span>
|
||||||
{masons}
|
{masons}
|
||||||
<span class="story-text">{"convened in secret"}</span>
|
<span>{"convened in secret"}</span>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
@ -511,9 +500,9 @@ fn StoryNightChoice(StoryNightChoiceProps { choice, characters}: &StoryNightChoi
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={char.clone()}/>
|
<CharacterCard faint=true char={char.clone()}/>
|
||||||
<span class="story-text">{"invited"}</span>
|
<span>{"invited"}</span>
|
||||||
<CharacterCard faint=true char={chosen.clone()}/>
|
<CharacterCard faint=true char={chosen.clone()}/>
|
||||||
<span class="story-text">{"for dinner"}</span>
|
<span>{"for dinner"}</span>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
}),
|
}),
|
||||||
|
|
@ -548,21 +537,18 @@ fn StoryNightChoice(StoryNightChoiceProps { choice, characters}: &StoryNightChoi
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<AlignmentSpan alignment={Alignment::Wolves}/>
|
<AlignmentSpan alignment={Alignment::Wolves}/>
|
||||||
<span class="story-text">{"attempted a kill on"}</span>
|
<span>{"attempted a kill on"}</span>
|
||||||
<CharacterCard faint=true char={chosen.clone()} />
|
<CharacterCard faint=true char={chosen.clone()} />
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
StoryActionPrompt::Shapeshifter { character_id } => {
|
StoryActionPrompt::Shapeshifter { character_id } => {
|
||||||
if choice.result.is_none() {
|
|
||||||
return html!{};
|
|
||||||
}
|
|
||||||
characters.get(character_id).map(|shifter| {
|
characters.get(character_id).map(|shifter| {
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={shifter.clone()} />
|
<CharacterCard faint=true char={shifter.clone()} />
|
||||||
<span class="story-text">{"decided to shapeshift into the wolf kill target"}</span>
|
<span>{"decided to shapeshift into the wolf kill target"}</span>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -584,7 +570,7 @@ fn StoryNightChoice(StoryNightChoiceProps { choice, characters}: &StoryNightChoi
|
||||||
html! {
|
html! {
|
||||||
<>
|
<>
|
||||||
<CharacterCard faint=true char={insomniac.clone()} />
|
<CharacterCard faint=true char={insomniac.clone()} />
|
||||||
<span class="story-text">{"witnessed visits from"}</span>
|
<span>{"witnessed visits from"}</span>
|
||||||
</>
|
</>
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
@ -598,12 +584,8 @@ fn StoryNightChoice(StoryNightChoiceProps { choice, characters}: &StoryNightChoi
|
||||||
choice_body
|
choice_body
|
||||||
.map(|choice_body| {
|
.map(|choice_body| {
|
||||||
html! {
|
html! {
|
||||||
<li class="choice">
|
<li>
|
||||||
<Icon
|
<Icon source={IconSource::ListItem} icon_type={IconType::Small}/>
|
||||||
source={IconSource::ListItem}
|
|
||||||
icon_type={IconType::Small}
|
|
||||||
classes={classes!("li-icon")}
|
|
||||||
/>
|
|
||||||
{choice_body}
|
{choice_body}
|
||||||
{result}
|
{result}
|
||||||
</li>
|
</li>
|
||||||
|
|
|
||||||
|
|
@ -13,7 +13,6 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
mod assets;
|
mod assets;
|
||||||
mod class;
|
|
||||||
mod clients;
|
mod clients;
|
||||||
mod storage;
|
mod storage;
|
||||||
mod components {
|
mod components {
|
||||||
|
|
@ -40,11 +39,6 @@ use pages::{ErrorComponent, WerewolfError};
|
||||||
use web_sys::Url;
|
use web_sys::Url;
|
||||||
use yew::{context::ContextProviderProps, prelude::*};
|
use yew::{context::ContextProviderProps, prelude::*};
|
||||||
|
|
||||||
const BUILD_ID: &str = werewolves_macros::build_id!();
|
|
||||||
const BUILD_ID_LONG: &str = werewolves_macros::build_id_long!();
|
|
||||||
const BUILD_DIRTY: bool = werewolves_macros::build_dirty!();
|
|
||||||
const BUILD_TIME: &str = werewolves_macros::build_time!();
|
|
||||||
|
|
||||||
use crate::clients::{
|
use crate::clients::{
|
||||||
client::{Client2, ClientContext},
|
client::{Client2, ClientContext},
|
||||||
host::{Host, HostEvent},
|
host::{Host, HostEvent},
|
||||||
|
|
@ -52,7 +46,6 @@ use crate::clients::{
|
||||||
|
|
||||||
fn main() {
|
fn main() {
|
||||||
wasm_logger::init(wasm_logger::Config::new(log::Level::Trace));
|
wasm_logger::init(wasm_logger::Config::new(log::Level::Trace));
|
||||||
log::debug!("starting werewolves build {BUILD_ID}");
|
|
||||||
let document = gloo::utils::document();
|
let document = gloo::utils::document();
|
||||||
let url = document.document_uri().expect("get uri");
|
let url = document.document_uri().expect("get uri");
|
||||||
let url_obj = Url::new(&url).unwrap();
|
let url_obj = Url::new(&url).unwrap();
|
||||||
|
|
|
||||||
|
|
@ -1,21 +0,0 @@
|
||||||
use werewolves_proto::aura::AuraTitle;
|
|
||||||
use yew::prelude::*;
|
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource, PartialAssociatedIcon};
|
|
||||||
|
|
||||||
#[function_component]
|
|
||||||
pub fn DrunkPage() -> Html {
|
|
||||||
let icon = AuraTitle::Drunk.icon().unwrap_or(IconSource::Roleblock);
|
|
||||||
html! {
|
|
||||||
<div class="role-page">
|
|
||||||
<h1 class="drunk">{"DRUNK"}</h1>
|
|
||||||
<div class="information drunk faint">
|
|
||||||
<h2>{"YOU GOT DRUNK INSTEAD"}</h2>
|
|
||||||
<div class="info-icon-grow">
|
|
||||||
<Icon source={icon}/>
|
|
||||||
</div>
|
|
||||||
<h3 class="yellow">{"YOUR NIGHT ACTION DID NOT TAKE PLACE"}</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -22,20 +22,22 @@ use crate::clients::client::connection::ConnectionError;
|
||||||
#[derive(Debug, Error)]
|
#[derive(Debug, Error)]
|
||||||
pub enum WerewolfError {
|
pub enum WerewolfError {
|
||||||
#[error("{0}")]
|
#[error("{0}")]
|
||||||
Game(#[from] GameError),
|
GameError(#[from] GameError),
|
||||||
#[error("local storage error: {0}")]
|
#[error("local storage error: {0}")]
|
||||||
LocalStorage(String),
|
LocalStorageError(String),
|
||||||
|
#[error("invalid target")]
|
||||||
|
InvalidTarget,
|
||||||
#[error("send error: {0}")]
|
#[error("send error: {0}")]
|
||||||
Send(#[from] futures::channel::mpsc::SendError),
|
SendError(#[from] futures::channel::mpsc::SendError),
|
||||||
#[error("send error: {0}")]
|
#[error("send error: {0}")]
|
||||||
ClientSend(#[from] yew::platform::pinned::mpsc::SendError<ClientMessage>),
|
ClientSendError(#[from] yew::platform::pinned::mpsc::SendError<ClientMessage>),
|
||||||
#[error("connection error: {0}")]
|
#[error("connection error: {0}")]
|
||||||
Connection(#[from] ConnectionError),
|
ConnectionError(#[from] ConnectionError),
|
||||||
}
|
}
|
||||||
|
|
||||||
impl From<StorageError> for WerewolfError {
|
impl From<StorageError> for WerewolfError {
|
||||||
fn from(storage_error: StorageError) -> Self {
|
fn from(storage_error: StorageError) -> Self {
|
||||||
Self::LocalStorage(storage_error.to_string())
|
Self::LocalStorageError(storage_error.to_string())
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -13,10 +13,13 @@
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use convert_case::{Case, Casing};
|
use convert_case::{Case, Casing};
|
||||||
use werewolves_proto::{game::SetupRole, role::RoleTitle};
|
use werewolves_proto::{
|
||||||
|
game::SetupRole,
|
||||||
|
role::{Alignment, RoleTitle},
|
||||||
|
};
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, PartialAssociatedIcon};
|
use crate::components::{AssociatedIcon, Icon, IconSource, IconType, PartialAssociatedIcon};
|
||||||
|
|
||||||
#[derive(Debug, Clone, Copy, PartialEq, Properties)]
|
#[derive(Debug, Clone, Copy, PartialEq, Properties)]
|
||||||
pub struct RoleChangePageProps {
|
pub struct RoleChangePageProps {
|
||||||
|
|
@ -28,21 +31,19 @@ pub fn RoleChangePage(RoleChangePageProps { role }: &RoleChangePageProps) -> Htm
|
||||||
let class = Into::<SetupRole>::into(*role).category().class();
|
let class = Into::<SetupRole>::into(*role).category().class();
|
||||||
let icon = role.icon().map(|icon| {
|
let icon = role.icon().map(|icon| {
|
||||||
html! {
|
html! {
|
||||||
<div class="info-icon-grow">
|
<h4 class="icons">
|
||||||
<Icon source={icon}/>
|
<Icon source={icon} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</h4>
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
html! {
|
html! {
|
||||||
<div class="role-page">
|
<div class="role-page">
|
||||||
<h1 class={classes!(class)}>{"ROLE CHANGE"}</h1>
|
<h1 class="intel">{"ROLE CHANGE"}</h1>
|
||||||
<div class={classes!("information", class, "faint")}>
|
<div class={classes!("information", class, "faint")}>
|
||||||
<h2>{"YOUR ROLE HAS CHANGED"}</h2>
|
<h2>{"YOUR ROLE HAS CHANGED"}</h2>
|
||||||
{icon}
|
{icon}
|
||||||
<h3>
|
<h3 class="yellow">{"YOUR NEW ROLE IS"}</h3>
|
||||||
<span>{"YOUR NEW ROLE IS "}</span>
|
<h3>{role.to_string().to_case(Case::Upper)}</h3>
|
||||||
<span class="yellow">{role.to_string().to_case(Case::Upper)}</span>
|
|
||||||
</h3>
|
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,12 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
use core::ops::Not;
|
||||||
|
|
||||||
use werewolves_proto::role::Killer;
|
use werewolves_proto::role::Killer;
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
use crate::components::{Icon, IconSource, IconType};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn AdjudicatorPage1() -> Html {
|
pub fn AdjudicatorPage1() -> Html {
|
||||||
|
|
@ -24,9 +26,10 @@ pub fn AdjudicatorPage1() -> Html {
|
||||||
<h1 class="defensive">{"ADJUDICATOR"}</h1>
|
<h1 class="defensive">{"ADJUDICATOR"}</h1>
|
||||||
<div class="information defensive faint">
|
<div class="information defensive faint">
|
||||||
<h2>{"PICK A PLAYER"}</h2>
|
<h2>{"PICK A PLAYER"}</h2>
|
||||||
<div class="info-icon-grow">
|
<h4 class="icons">
|
||||||
<Icon source={IconSource::Killer}/>
|
<Icon source={IconSource::Killer} icon_type={IconType::Informational}/>
|
||||||
</div>
|
<Icon source={IconSource::Killer} icon_type={IconType::Informational} inactive={true}/>
|
||||||
|
</h4>
|
||||||
<h3 class="yellow">{"YOU WILL CHECK IF THEY APPEAR AS A KILLER"}</h3>
|
<h3 class="yellow">{"YOU WILL CHECK IF THEY APPEAR AS A KILLER"}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -48,11 +51,13 @@ pub fn AdjudicatorResult(AdjudicatorResultProps { killer }: &AdjudicatorResultPr
|
||||||
Killer::Killer => html! {
|
Killer::Killer => html! {
|
||||||
<Icon
|
<Icon
|
||||||
source={IconSource::Killer}
|
source={IconSource::Killer}
|
||||||
|
icon_type={IconType::Informational}
|
||||||
/>
|
/>
|
||||||
},
|
},
|
||||||
Killer::NotKiller => html! {
|
Killer::NotKiller => html! {
|
||||||
<Icon
|
<Icon
|
||||||
source={IconSource::RedX}
|
source={IconSource::RedX}
|
||||||
|
icon_type={IconType::Informational}
|
||||||
/>
|
/>
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -61,7 +66,7 @@ pub fn AdjudicatorResult(AdjudicatorResultProps { killer }: &AdjudicatorResultPr
|
||||||
<h1 class="defensive">{"ADJUDICATOR"}</h1>
|
<h1 class="defensive">{"ADJUDICATOR"}</h1>
|
||||||
<div class="information defensive faint">
|
<div class="information defensive faint">
|
||||||
<h2>{"YOUR TARGET"}</h2>
|
<h2>{"YOUR TARGET"}</h2>
|
||||||
<div class="info-icon-grow">{icon}</div>
|
<h4>{icon}</h4>
|
||||||
<h3 class="yellow">{text}</h3>
|
<h3 class="yellow">{text}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@ pub fn AlphaWolfPage1() -> Html {
|
||||||
<span class="yellow">{"ONCE PER GAME"}</span>
|
<span class="yellow">{"ONCE PER GAME"}</span>
|
||||||
{" KILL ABILITY"}
|
{" KILL ABILITY"}
|
||||||
</h2>
|
</h2>
|
||||||
<h2>
|
<h3 class="yellow">
|
||||||
{"POINT AT YOUR TARGET "}
|
{"POINT AT YOUR TARGET "}
|
||||||
{"OR GO BACK TO SLEEP"}
|
{"OR GO BACK TO SLEEP"}
|
||||||
</h2>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -49,12 +49,22 @@ pub fn ArcanistResult(ArcanistResultProps { alignment_eq }: &ArcanistResultProps
|
||||||
};
|
};
|
||||||
let icons = match alignment_eq {
|
let icons = match alignment_eq {
|
||||||
AlignmentEq::Same => html! {
|
AlignmentEq::Same => html! {
|
||||||
<Icon source={IconSource::Equal} />
|
<>
|
||||||
|
// <Icon source={IconSource::Village} icon_type={IconType::Informational}/>
|
||||||
|
// <Icon source={IconSource::Village} icon_type={IconType::Informational}/>
|
||||||
|
// <span>{"OR"}</span>
|
||||||
|
// <Icon source={IconSource::Wolves} icon_type={IconType::Informational}/>
|
||||||
|
// <Icon source={IconSource::Wolves} icon_type={IconType::Informational}/>
|
||||||
|
<Icon source={IconSource::Equal} icon_type={IconType::Informational} />
|
||||||
|
</>
|
||||||
},
|
},
|
||||||
AlignmentEq::Different => html! {
|
AlignmentEq::Different => html! {
|
||||||
<>
|
<>
|
||||||
<Icon source={IconSource::Village} />
|
<Icon source={IconSource::Village} icon_type={IconType::Informational}/>
|
||||||
<Icon source={IconSource::Wolves} />
|
<Icon source={IconSource::Wolves} icon_type={IconType::Informational}/>
|
||||||
|
// {"OR"}
|
||||||
|
// <Icon source={IconSource::Wolves} icon_type={IconType::Informational}/>
|
||||||
|
// <Icon source={IconSource::Village} icon_type={IconType::Informational}/>
|
||||||
</>
|
</>
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -63,9 +73,9 @@ pub fn ArcanistResult(ArcanistResultProps { alignment_eq }: &ArcanistResultProps
|
||||||
<h1 class="intel">{"ARCANIST"}</h1>
|
<h1 class="intel">{"ARCANIST"}</h1>
|
||||||
<div class="information intel faint">
|
<div class="information intel faint">
|
||||||
<h2>{"YOUR TARGETS APPEAR AS"}</h2>
|
<h2>{"YOUR TARGETS APPEAR AS"}</h2>
|
||||||
<div class="info-icon-list-grow">
|
<h4 class="icons">
|
||||||
{icons}
|
{icons}
|
||||||
</div>
|
</h4>
|
||||||
<h1 class="yellow">{text}</h1>
|
<h1 class="yellow">{text}</h1>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -43,24 +43,3 @@ pub fn BeholderSawNothing() -> Html {
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[function_component]
|
|
||||||
pub fn BeholderSawEverything() -> Html {
|
|
||||||
html! {
|
|
||||||
<div class="role-page">
|
|
||||||
<h1 class="intel">{"BEHOLDER"}</h1>
|
|
||||||
<div class="information intel faint">
|
|
||||||
<h1>{"YOUR TARGET HAS DIED"}</h1>
|
|
||||||
<div class="info-icon-grow">
|
|
||||||
<Icon source={IconSource::Beholder}/>
|
|
||||||
</div>
|
|
||||||
<h1>
|
|
||||||
{"BUT SAW "}
|
|
||||||
<em class="red">
|
|
||||||
<strong>{"EVERYTHING"}</strong>
|
|
||||||
</em>
|
|
||||||
</h1>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
|
||||||
|
|
@ -24,8 +24,9 @@ pub fn BloodletterPage1() -> Html {
|
||||||
<div class="information wolves faint">
|
<div class="information wolves faint">
|
||||||
<h2>{"PICK A PLAYER"}</h2>
|
<h2>{"PICK A PLAYER"}</h2>
|
||||||
<h3>{"THEY WILL BE COVERED IN WOLF BLOOD"}</h3>
|
<h3>{"THEY WILL BE COVERED IN WOLF BLOOD"}</h3>
|
||||||
|
<h4>{"AND"}</h4>
|
||||||
<h2 class="yellow inline-icons">
|
<h2 class="yellow inline-icons">
|
||||||
{"AND APPEAR AS A WOLF "}
|
{"APPEAR AS A WOLF "}
|
||||||
<Icon source={IconSource::Wolves} icon_type={IconType::Fit}/>
|
<Icon source={IconSource::Wolves} icon_type={IconType::Fit}/>
|
||||||
{" KILLER "}
|
{" KILLER "}
|
||||||
<Icon source={IconSource::Killer} icon_type={IconType::Fit}/>
|
<Icon source={IconSource::Killer} icon_type={IconType::Fit}/>
|
||||||
|
|
|
||||||
|
|
@ -12,10 +12,11 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
use core::ops::Not;
|
||||||
|
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
use crate::components::{Icon, IconSource, IconType};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn EmpathPage1() -> Html {
|
pub fn EmpathPage1() -> Html {
|
||||||
|
|
@ -25,7 +26,7 @@ pub fn EmpathPage1() -> Html {
|
||||||
<div class="information intel faint">
|
<div class="information intel faint">
|
||||||
<h2>{"PICK A PLAYER"}</h2>
|
<h2>{"PICK A PLAYER"}</h2>
|
||||||
<h3 class="yellow">{"YOU WILL CHECK IF THEY ARE THE SCAPEGOAT"}</h3>
|
<h3 class="yellow">{"YOU WILL CHECK IF THEY ARE THE SCAPEGOAT"}</h3>
|
||||||
<h3>{"IF THEY ARE, YOU WILL TAKE ON THEIR CURSE"}</h3>
|
<h3>{"AND IF THEY ARE, TAKE ON THEIR CURSE"}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
@ -42,26 +43,18 @@ pub fn EmpathResult(EmpathResultProps { scapegoat }: &EmpathResultProps) -> Html
|
||||||
true => "THE SCAPEGOAT",
|
true => "THE SCAPEGOAT",
|
||||||
false => "NOT THE SCAPEGOAT",
|
false => "NOT THE SCAPEGOAT",
|
||||||
};
|
};
|
||||||
let icon = match scapegoat {
|
|
||||||
true => html! {
|
|
||||||
<Icon
|
|
||||||
source={IconSource::Scapegoat}
|
|
||||||
/>
|
|
||||||
},
|
|
||||||
false => html! {
|
|
||||||
<Icon
|
|
||||||
source={IconSource::RedX}
|
|
||||||
/>
|
|
||||||
},
|
|
||||||
};
|
|
||||||
html! {
|
html! {
|
||||||
<div class="role-page">
|
<div class="role-page">
|
||||||
<h1 class="intel">{"EMPATH"}</h1>
|
<h1 class="intel">{"EMPATH"}</h1>
|
||||||
<div class="information intel faint">
|
<div class="information intel faint">
|
||||||
<h2>{"YOUR TARGET IS"}</h2>
|
<h2>{"YOUR TARGET IS"}</h2>
|
||||||
<div class="info-icon-grow">
|
<h4>
|
||||||
{icon}
|
<Icon
|
||||||
</div>
|
source={IconSource::Scapegoat}
|
||||||
|
icon_type={IconType::Informational}
|
||||||
|
inactive={scapegoat.not()}
|
||||||
|
/>
|
||||||
|
</h4>
|
||||||
<h3 class="yellow">{text}</h3>
|
<h3 class="yellow">{text}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -16,7 +16,7 @@ use convert_case::{Case, Casing};
|
||||||
use werewolves_proto::role::RoleTitle;
|
use werewolves_proto::role::RoleTitle;
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource, PartialAssociatedIcon};
|
use crate::components::{Icon, IconSource, IconType, PartialAssociatedIcon};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn GravediggerPage1() -> Html {
|
pub fn GravediggerPage1() -> Html {
|
||||||
|
|
@ -29,8 +29,8 @@ pub fn GravediggerPage1() -> Html {
|
||||||
<span class="yellow">{"DEAD"}</span>
|
<span class="yellow">{"DEAD"}</span>
|
||||||
{" PLAYER"}
|
{" PLAYER"}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="info-icon-grow">
|
<div class="icons">
|
||||||
<Icon source={IconSource::Gravedigger}/>
|
<Icon source={IconSource::Gravedigger} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="yellow">
|
<h3 class="yellow">
|
||||||
{"YOU WILL LEARN THEIR ROLE"}
|
{"YOU WILL LEARN THEIR ROLE"}
|
||||||
|
|
@ -54,7 +54,7 @@ pub fn GravediggerResultPage(
|
||||||
.map(|r| {
|
.map(|r| {
|
||||||
html! {
|
html! {
|
||||||
<h4>
|
<h4>
|
||||||
{"AND FIND A "}
|
{"YOU DIG UP THE BODY OF A "}
|
||||||
<span class="yellow">
|
<span class="yellow">
|
||||||
{r.to_string().to_case(Case::Upper)}
|
{r.to_string().to_case(Case::Upper)}
|
||||||
</span>
|
</span>
|
||||||
|
|
@ -75,9 +75,12 @@ pub fn GravediggerResultPage(
|
||||||
<h1 class="intel">{"GRAVEDIGGER"}</h1>
|
<h1 class="intel">{"GRAVEDIGGER"}</h1>
|
||||||
<div class="information intel faint">
|
<div class="information intel faint">
|
||||||
<h2>{"YOU CHECK THE ROLE OF YOUR TARGET"}</h2>
|
<h2>{"YOU CHECK THE ROLE OF YOUR TARGET"}</h2>
|
||||||
<div class="info-icon-grow">
|
<h4>
|
||||||
<Icon source={icon} />
|
<Icon
|
||||||
</div>
|
source={icon}
|
||||||
|
icon_type={IconType::Informational}
|
||||||
|
/>
|
||||||
|
</h4>
|
||||||
{text}
|
{text}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
use werewolves_proto::message::CharacterIdentity;
|
use werewolves_proto::message::CharacterIdentity;
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{CharacterTargetCard, Icon, IconSource};
|
use crate::components::{CharacterTargetCard, Icon, IconSource, IconType};
|
||||||
|
|
||||||
#[derive(Debug, Clone, PartialEq, Properties)]
|
#[derive(Debug, Clone, PartialEq, Properties)]
|
||||||
pub struct GuardianPageProps {
|
pub struct GuardianPageProps {
|
||||||
|
|
@ -29,9 +29,9 @@ pub fn GuardianPageNoPrevProtect() -> Html {
|
||||||
<h1 class="defensive">{"GUARDIAN"}</h1>
|
<h1 class="defensive">{"GUARDIAN"}</h1>
|
||||||
<div class="information defensive faint">
|
<div class="information defensive faint">
|
||||||
<h2>{"PICK A PLAYER"}</h2>
|
<h2>{"PICK A PLAYER"}</h2>
|
||||||
<div class="info-icon-grow">
|
<h4 class="icons">
|
||||||
<Icon source={IconSource::ShieldAndSword}/>
|
<Icon source={IconSource::ShieldAndSword} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</h4>
|
||||||
<h3 class="yellow">{"CHOOSE SOMEONE TO PROTECT FROM DEATH"}</h3>
|
<h3 class="yellow">{"CHOOSE SOMEONE TO PROTECT FROM DEATH"}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -90,12 +90,12 @@ pub fn GuardianPagePreviousGuard(GuardianPageProps { previous }: &GuardianPagePr
|
||||||
<h1 class="defensive">{"GUARDIAN"}</h1>
|
<h1 class="defensive">{"GUARDIAN"}</h1>
|
||||||
<div class="information defensive faint">
|
<div class="information defensive faint">
|
||||||
<h2>{"LAST TIME YOU GUARDED"}</h2>
|
<h2>{"LAST TIME YOU GUARDED"}</h2>
|
||||||
<div class="info-icon-grow">
|
|
||||||
<Icon source={IconSource::ShieldAndSword} />
|
|
||||||
</div>
|
|
||||||
<div class="info-player-list">
|
<div class="info-player-list">
|
||||||
<CharacterTargetCard ident={previous.clone()} />
|
<CharacterTargetCard ident={previous.clone()} />
|
||||||
</div>
|
</div>
|
||||||
|
<h4 class="icons">
|
||||||
|
<Icon source={IconSource::ShieldAndSword} icon_type={IconType::Informational}/>
|
||||||
|
</h4>
|
||||||
<h3 class="yellow">{"YOU CANNOT PROTECT THEM TONIGHT"}</h3>
|
<h3 class="yellow">{"YOU CANNOT PROTECT THEM TONIGHT"}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
use crate::components::{Icon, IconSource, IconType};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn HunterPage1() -> Html {
|
pub fn HunterPage1() -> Html {
|
||||||
|
|
@ -23,12 +23,12 @@ pub fn HunterPage1() -> Html {
|
||||||
<h1 class="offensive">{"HUNTER"}</h1>
|
<h1 class="offensive">{"HUNTER"}</h1>
|
||||||
<div class="information offensive faint">
|
<div class="information offensive faint">
|
||||||
<h2>{"SET A HUNTER'S TRAP ON A PLAYER"}</h2>
|
<h2>{"SET A HUNTER'S TRAP ON A PLAYER"}</h2>
|
||||||
<div class="info-icon-grow">
|
<div class="icons">
|
||||||
<Icon source={IconSource::Hunter}/>
|
<Icon source={IconSource::Hunter} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="yellow">
|
<h3 class="yellow">
|
||||||
{"IF YOU DIE TONIGHT, OR ARE EXECUTED TOMORROW "}
|
{"IF YOU DIE TONIGHT, OR ARE EXECUTED TOMORROW"}
|
||||||
{"THIS PLAYER WILL DIE AT NIGHT"}
|
{"THIS PLAYER WILL DIE AT NIGHT AS WELL"}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,7 @@
|
||||||
use werewolves_proto::message::night::Visits;
|
use werewolves_proto::message::night::Visits;
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{CharacterTargetCard, Icon, IconSource};
|
use crate::components::CharacterTargetCard;
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn InsomniacPage1() -> Html {
|
pub fn InsomniacPage1() -> Html {
|
||||||
|
|
@ -23,12 +23,9 @@ pub fn InsomniacPage1() -> Html {
|
||||||
<div class="role-page">
|
<div class="role-page">
|
||||||
<h1 class="intel">{"INSOMNIAC"}</h1>
|
<h1 class="intel">{"INSOMNIAC"}</h1>
|
||||||
<div class="information intel faint">
|
<div class="information intel faint">
|
||||||
<h2>{"YOUR SLEEP IS INTERRUPTED"}</h2>
|
<h2>{"YOUR POOR SLEEP RESULTS IN BEING WOKEN BY VISITORS IN THE NIGHT"}</h2>
|
||||||
<div class="info-icon-grow">
|
|
||||||
<Icon source={IconSource::Insomniac}/>
|
|
||||||
</div>
|
|
||||||
<h3 class="yellow">
|
<h3 class="yellow">
|
||||||
{"THE FOLLOWING PEOPLE VISITED YOU TONIGHT"}
|
{"YOU WILL REMEMBER WHO VISITED YOU TONIGHT"}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -55,7 +52,7 @@ pub fn InsomniacResult(InsomniacResultProps { visits }: &InsomniacResultProps) -
|
||||||
<h1 class="intel">{"INSOMNIAC"}</h1>
|
<h1 class="intel">{"INSOMNIAC"}</h1>
|
||||||
<div class="information intel faint">
|
<div class="information intel faint">
|
||||||
<h2>{"YOU WERE VISITED IN THE NIGHT BY:"}</h2>
|
<h2>{"YOU WERE VISITED IN THE NIGHT BY:"}</h2>
|
||||||
<div class="info-player-list large">
|
<div class="info-player-list">
|
||||||
{visitors}
|
{visitors}
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -25,10 +25,10 @@ pub struct MapleWolfPage1Props {
|
||||||
pub fn MapleWolfPage1(MapleWolfPage1Props { starving }: &MapleWolfPage1Props) -> Html {
|
pub fn MapleWolfPage1(MapleWolfPage1Props { starving }: &MapleWolfPage1Props) -> Html {
|
||||||
let starving = starving
|
let starving = starving
|
||||||
.then_some(html! {
|
.then_some(html! {
|
||||||
<div>
|
<>
|
||||||
<h3 class="red">{"YOU ARE STARVING"}</h3>
|
<h3 class="red">{"YOU ARE STARVING"}</h3>
|
||||||
<h3>{"IF YOU FAIL TO EAT TONIGHT, YOU WILL DIE"}</h3>
|
<h3>{"IF YOU FAIL TO EAT TONIGHT, YOU WILL DIE"}</h3>
|
||||||
</div>
|
</>
|
||||||
})
|
})
|
||||||
.unwrap_or_else(|| {
|
.unwrap_or_else(|| {
|
||||||
html! {
|
html! {
|
||||||
|
|
@ -45,8 +45,8 @@ pub fn MapleWolfPage1(MapleWolfPage1Props { starving }: &MapleWolfPage1Props) ->
|
||||||
<h2>
|
<h2>
|
||||||
{"YOU CAN CHOOSE TO EAT A PLAYER TONIGHT"}
|
{"YOU CAN CHOOSE TO EAT A PLAYER TONIGHT"}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="info-icon-grow">
|
<div class="icons">
|
||||||
<Icon source={IconSource::MapleWolf} icon_type={IconType::Fit}/>
|
<Icon source={IconSource::MapleWolf} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</div>
|
||||||
{starving}
|
{starving}
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -53,7 +53,7 @@ pub fn MasonRecruitPage1(
|
||||||
<span class="yellow">{"EVERY NIGHT"}</span>
|
<span class="yellow">{"EVERY NIGHT"}</span>
|
||||||
{", AS LONG AS THEY ARE ALIVE AND REMAIN VILLAGE ALIGNED"}
|
{", AS LONG AS THEY ARE ALIVE AND REMAIN VILLAGE ALIGNED"}
|
||||||
</h4>
|
</h4>
|
||||||
<h2 class="yellow">{"WOULD YOU LIKE TO RECRUIT TONIGHT?"}</h2>
|
<h3 class="yellow">{"WOULD YOU LIKE TO RECRUIT TONIGHT?"}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
use crate::components::{Icon, IconSource, IconType};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn MilitiaPage1() -> Html {
|
pub fn MilitiaPage1() -> Html {
|
||||||
|
|
@ -27,8 +27,8 @@ pub fn MilitiaPage1() -> Html {
|
||||||
<span class="yellow">{"ONCE PER GAME"}</span>
|
<span class="yellow">{"ONCE PER GAME"}</span>
|
||||||
{" KILL ABILITY"}
|
{" KILL ABILITY"}
|
||||||
</h2>
|
</h2>
|
||||||
<div class="info-icon-grow">
|
<div class="icons">
|
||||||
<Icon source={IconSource::Sword}/>
|
<Icon source={IconSource::Sword} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</div>
|
||||||
<h3 class="yellow">
|
<h3 class="yellow">
|
||||||
{"POINT AT YOUR TARGET "}
|
{"POINT AT YOUR TARGET "}
|
||||||
|
|
|
||||||
|
|
@ -12,11 +12,12 @@
|
||||||
//
|
//
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
// You should have received a copy of the GNU Affero General Public License
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
|
use core::ops::Not;
|
||||||
|
|
||||||
use werewolves_proto::role::Powerful;
|
use werewolves_proto::role::Powerful;
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
use crate::components::{AssociatedIcon, Icon, IconSource, IconType};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn PowerSeerPage1() -> Html {
|
pub fn PowerSeerPage1() -> Html {
|
||||||
|
|
@ -25,9 +26,10 @@ pub fn PowerSeerPage1() -> Html {
|
||||||
<h1 class="intel">{"POWER SEER"}</h1>
|
<h1 class="intel">{"POWER SEER"}</h1>
|
||||||
<div class="information intel faint">
|
<div class="information intel faint">
|
||||||
<h2>{"PICK A PLAYER"}</h2>
|
<h2>{"PICK A PLAYER"}</h2>
|
||||||
<div class="info-icon-grow">
|
<h4 class="icons">
|
||||||
<Icon source={IconSource::Powerful} />
|
<Icon source={IconSource::Powerful} icon_type={IconType::Informational}/>
|
||||||
</div>
|
<Icon source={IconSource::Powerful} icon_type={IconType::Informational} inactive={true}/>
|
||||||
|
</h4>
|
||||||
<h3 class="yellow">{"YOU WILL CHECK IF THEY ARE POWERFUL"}</h3>
|
<h3 class="yellow">{"YOU WILL CHECK IF THEY ARE POWERFUL"}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
@ -49,13 +51,13 @@ pub fn PowerSeerResult(PowerSeerResultProps { powerful }: &PowerSeerResultProps)
|
||||||
Powerful::Powerful => html! {
|
Powerful::Powerful => html! {
|
||||||
<Icon
|
<Icon
|
||||||
source={IconSource::Powerful}
|
source={IconSource::Powerful}
|
||||||
// icon_type={IconType::Informational}
|
icon_type={IconType::Informational}
|
||||||
/>
|
/>
|
||||||
},
|
},
|
||||||
Powerful::NotPowerful => html! {
|
Powerful::NotPowerful => html! {
|
||||||
<Icon
|
<Icon
|
||||||
source={IconSource::RedX}
|
source={IconSource::RedX}
|
||||||
// icon_type={IconType::Informational}
|
icon_type={IconType::Informational}
|
||||||
/>
|
/>
|
||||||
},
|
},
|
||||||
};
|
};
|
||||||
|
|
@ -64,7 +66,7 @@ pub fn PowerSeerResult(PowerSeerResultProps { powerful }: &PowerSeerResultProps)
|
||||||
<h1 class="intel">{"POWER SEER"}</h1>
|
<h1 class="intel">{"POWER SEER"}</h1>
|
||||||
<div class="information intel faint">
|
<div class="information intel faint">
|
||||||
<h2>{"YOUR TARGET APPEARS AS"}</h2>
|
<h2>{"YOUR TARGET APPEARS AS"}</h2>
|
||||||
<div class="info-icon-grow">{icon}</div>
|
<h4>{icon}</h4>
|
||||||
<h3 class="yellow">{text}</h3>
|
<h3 class="yellow">{text}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
use crate::components::{Icon, IconSource, IconType};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn ProtectorPage1() -> Html {
|
pub fn ProtectorPage1() -> Html {
|
||||||
|
|
@ -23,9 +23,9 @@ pub fn ProtectorPage1() -> Html {
|
||||||
<h1 class="defensive">{"PROTECTOR"}</h1>
|
<h1 class="defensive">{"PROTECTOR"}</h1>
|
||||||
<div class="information defensive faint">
|
<div class="information defensive faint">
|
||||||
<h2>{"PICK A PLAYER"}</h2>
|
<h2>{"PICK A PLAYER"}</h2>
|
||||||
<div class="info-icon-grow">
|
<h4 class="icons">
|
||||||
<Icon source={IconSource::Shield} />
|
<Icon source={IconSource::Shield} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</h4>
|
||||||
<h3 class="yellow">{"YOU WILL PROTECT THEM FROM A DEATH TONIGHT"}</h3>
|
<h3 class="yellow">{"YOU WILL PROTECT THEM FROM A DEATH TONIGHT"}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
use crate::components::{Icon, IconSource, IconType};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn PyremasterPage1() -> Html {
|
pub fn PyremasterPage1() -> Html {
|
||||||
|
|
@ -22,14 +22,12 @@ pub fn PyremasterPage1() -> Html {
|
||||||
<div class="role-page">
|
<div class="role-page">
|
||||||
<h1 class="offensive">{"PYREMASTER"}</h1>
|
<h1 class="offensive">{"PYREMASTER"}</h1>
|
||||||
<div class="information offensive faint">
|
<div class="information offensive faint">
|
||||||
<h3>{"YOU CAN CHOOSE TO THROW A PLAYER ON THE PYRE"}</h3>
|
<h2>{"IF YOU WISH TO THROW A PLAYER ON THE PYRE"}</h2>
|
||||||
<div class="info-icon-grow">
|
<div class="icons">
|
||||||
<Icon source={IconSource::Pyremaster}/>
|
<Icon source={IconSource::Pyremaster} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</div>
|
||||||
<h3>
|
<h3 class="yellow">
|
||||||
{"IF YOU KILL "}
|
{"IF YOU KILL TWO GOOD VILLAGERS LIKE THIS "}
|
||||||
<span class="yellow">{"TWO"}</span>
|
|
||||||
{" GOOD VILLAGERS LIKE THIS "}
|
|
||||||
{"YOU WILL DIE AS WELL"}
|
{"YOU WILL DIE AS WELL"}
|
||||||
</h3>
|
</h3>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -15,7 +15,9 @@
|
||||||
use werewolves_proto::role::{Alignment, RoleTitle};
|
use werewolves_proto::role::{Alignment, RoleTitle};
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{AssociatedIcon, Icon, IconSource, IconType, attributes::RoleTitleSpan};
|
use crate::components::{
|
||||||
|
AssociatedIcon, Icon, IconSource, IconType, PartialAssociatedIcon, attributes::RoleTitleSpan,
|
||||||
|
};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn SeerPage1() -> Html {
|
pub fn SeerPage1() -> Html {
|
||||||
|
|
@ -24,10 +26,10 @@ pub fn SeerPage1() -> Html {
|
||||||
<h1 class="intel">{"SEER"}</h1>
|
<h1 class="intel">{"SEER"}</h1>
|
||||||
<div class="information intel faint">
|
<div class="information intel faint">
|
||||||
<h2>{"PICK A PLAYER"}</h2>
|
<h2>{"PICK A PLAYER"}</h2>
|
||||||
<div class="info-icon-list-grow">
|
<h4 class="icons">
|
||||||
<Icon source={IconSource::Village} />
|
<Icon source={IconSource::Village} icon_type={IconType::Informational}/>
|
||||||
<Icon source={IconSource::Wolves} />
|
<Icon source={IconSource::Wolves} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</h4>
|
||||||
<h3 class="yellow">{"YOU WILL CHECK IF THEY APPEAR AS A VILLAGER OR PART OF THE WOLFPACK"}</h3>
|
<h3 class="yellow">{"YOU WILL CHECK IF THEY APPEAR AS A VILLAGER OR PART OF THE WOLFPACK"}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
use crate::components::{Icon, IconSource, IconType};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn VindicatorPage1() -> Html {
|
pub fn VindicatorPage1() -> Html {
|
||||||
|
|
@ -24,9 +24,9 @@ pub fn VindicatorPage1() -> Html {
|
||||||
<div class="information defensive faint">
|
<div class="information defensive faint">
|
||||||
<h3>{"A VILLAGER WAS EXECUTED"}</h3>
|
<h3>{"A VILLAGER WAS EXECUTED"}</h3>
|
||||||
<h2>{"PICK A PLAYER"}</h2>
|
<h2>{"PICK A PLAYER"}</h2>
|
||||||
<div class="info-icon-grow">
|
<h4 class="icons">
|
||||||
<Icon source={IconSource::Vindicator} />
|
<Icon source={IconSource::Shield} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</h4>
|
||||||
<h3 class="yellow">{"YOU WILL PROTECT THEM FROM A DEATH TONIGHT"}</h3>
|
<h3 class="yellow">{"YOU WILL PROTECT THEM FROM A DEATH TONIGHT"}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -14,7 +14,7 @@
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
||||||
use yew::prelude::*;
|
use yew::prelude::*;
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
use crate::components::{Icon, IconSource, IconType};
|
||||||
|
|
||||||
#[function_component]
|
#[function_component]
|
||||||
pub fn RoleblockPage() -> Html {
|
pub fn RoleblockPage() -> Html {
|
||||||
|
|
@ -23,9 +23,9 @@ pub fn RoleblockPage() -> Html {
|
||||||
<h1 class="wolves">{"ROLE BLOCKED"}</h1>
|
<h1 class="wolves">{"ROLE BLOCKED"}</h1>
|
||||||
<div class="information wolves faint">
|
<div class="information wolves faint">
|
||||||
<h2>{"YOU WERE ROLE BLOCKED"}</h2>
|
<h2>{"YOU WERE ROLE BLOCKED"}</h2>
|
||||||
<div class="info-icon-grow">
|
<h4 class="icons">
|
||||||
<Icon source={IconSource::Roleblock} />
|
<Icon source={IconSource::Roleblock} icon_type={IconType::Informational}/>
|
||||||
</div>
|
</h4>
|
||||||
<h3 class="yellow">{"YOUR NIGHT ACTION DID NOT TAKE PLACE"}</h3>
|
<h3 class="yellow">{"YOUR NIGHT ACTION DID NOT TAKE PLACE"}</h3>
|
||||||
</div>
|
</div>
|
||||||
</div>
|
</div>
|
||||||
|
|
|
||||||
|
|
@ -1,35 +0,0 @@
|
||||||
// Copyright (C) 2025 Emilis Bliūdžius
|
|
||||||
//
|
|
||||||
// This program is free software: you can redistribute it and/or modify
|
|
||||||
// it under the terms of the GNU Affero General Public License as
|
|
||||||
// published by the Free Software Foundation, either version 3 of the
|
|
||||||
// License, or (at your option) any later version.
|
|
||||||
//
|
|
||||||
// This program is distributed in the hope that it will be useful,
|
|
||||||
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
||||||
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
||||||
// GNU Affero General Public License for more details.
|
|
||||||
//
|
|
||||||
// You should have received a copy of the GNU Affero General Public License
|
|
||||||
// along with this program. If not, see <https://www.gnu.org/licenses/>.
|
|
||||||
use yew::prelude::*;
|
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
|
||||||
|
|
||||||
#[function_component]
|
|
||||||
pub fn ShiftFailed() -> Html {
|
|
||||||
html! {
|
|
||||||
<div class="role-page">
|
|
||||||
<h1 class="wolves">{"SHIFT FAILED"}</h1>
|
|
||||||
<div class={classes!("information", "wolves", "faint")}>
|
|
||||||
<h2>{"YOUR SHIFT HAS FAILED"}</h2>
|
|
||||||
<div class="info-icon-grow">
|
|
||||||
<Icon source={IconSource::RedX}/>
|
|
||||||
</div>
|
|
||||||
<h3>
|
|
||||||
{"YOU RETAIN YOUR SHAPESHIFT ABILITY"}
|
|
||||||
</h3>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
@ -1,23 +0,0 @@
|
||||||
use yew::prelude::*;
|
|
||||||
|
|
||||||
use crate::components::{Icon, IconSource};
|
|
||||||
|
|
||||||
#[function_component]
|
|
||||||
pub fn TraitorIntroPage() -> Html {
|
|
||||||
html! {
|
|
||||||
<div class="role-page">
|
|
||||||
<h1 class="traitor">{"TRAITOR"}</h1>
|
|
||||||
<div class="information traitor faint">
|
|
||||||
<h2>{"YOU ARE A TRAITOR"}</h2>
|
|
||||||
<h3>{"YOU RETAIN YOUR ROLE AND WIN IF EVIL WINS"}</h3>
|
|
||||||
<div class="info-icon-grow">
|
|
||||||
<Icon source={IconSource::Traitor}/>
|
|
||||||
</div>
|
|
||||||
<h4>{"HOWEVER"}</h4>
|
|
||||||
<h2 class="yellow">
|
|
||||||
{"YOU CONTRIBUTE TO VILLAGE PARITY"}
|
|
||||||
</h2>
|
|
||||||
</div>
|
|
||||||
</div>
|
|
||||||
}
|
|
||||||
}
|
|
||||||