guardian: new page night after self protect

This commit is contained in:
emilis 2025-11-07 21:17:01 +00:00
parent fc4da3bcc5
commit ac864a5fa5
No known key found for this signature in database
2 changed files with 39 additions and 14 deletions

View File

@ -165,20 +165,32 @@ impl RolePage for ActionPrompt {
character_id, character_id,
previous: Some(PreviousGuardianAction::Protect(target)), previous: Some(PreviousGuardianAction::Protect(target)),
.. ..
} => Rc::new([ } => {
html! { if character_id.character_id == target.character_id {
<> Rc::new([html! {
{ident(character_id)} <>
<GuardianPagePreviousProtect1 previous={target.clone()}/> {ident(character_id)}
</> <GuardianPagePreviousProtectSelf />
}, </>
html! { }])
<> } else {
{ident(character_id)} Rc::new([
<GuardianPagePreviousProtect2 previous={target.clone()}/> html! {
</> <>
}, {ident(character_id)}
]), <GuardianPagePreviousProtect1 previous={target.clone()}/>
</>
},
html! {
<>
{ident(character_id)}
<GuardianPagePreviousProtect2 previous={target.clone()}/>
</>
},
])
}
}
ActionPrompt::Guardian { ActionPrompt::Guardian {
character_id, character_id,
previous: Some(PreviousGuardianAction::Guard(target)), previous: Some(PreviousGuardianAction::Guard(target)),

View File

@ -38,6 +38,19 @@ pub fn GuardianPageNoPrevProtect() -> Html {
} }
} }
#[function_component]
pub fn GuardianPagePreviousProtectSelf() -> Html {
html! {
<div class="role-page">
<h1 class="defensive">{"GUARDIAN"}</h1>
<div class="information defensive faint">
<h2>{"LAST TIME YOU PROTECTED YOURSELF"}</h2>
<h3 class="yellow">{"YOU CANNOT PROTECT YOURSELF AGAIN TONIGHT"}</h3>
</div>
</div>
}
}
#[function_component] #[function_component]
pub fn GuardianPagePreviousProtect1(GuardianPageProps { previous }: &GuardianPageProps) -> Html { pub fn GuardianPagePreviousProtect1(GuardianPageProps { previous }: &GuardianPageProps) -> Html {
html! { html! {