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,7 +165,16 @@ impl RolePage for ActionPrompt {
character_id,
previous: Some(PreviousGuardianAction::Protect(target)),
..
} => Rc::new([
} => {
if character_id.character_id == target.character_id {
Rc::new([html! {
<>
{ident(character_id)}
<GuardianPagePreviousProtectSelf />
</>
}])
} else {
Rc::new([
html! {
<>
{ident(character_id)}
@ -178,7 +187,10 @@ impl RolePage for ActionPrompt {
<GuardianPagePreviousProtect2 previous={target.clone()}/>
</>
},
]),
])
}
}
ActionPrompt::Guardian {
character_id,
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]
pub fn GuardianPagePreviousProtect1(GuardianPageProps { previous }: &GuardianPageProps) -> Html {
html! {