Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Red herrings #770

Open
wants to merge 31 commits into
base: main
Choose a base branch
from
Open

Red herrings #770

wants to merge 31 commits into from

Conversation

Apersoma
Copy link
Collaborator

added red herrings for gossip, detective, & philosopher.

@Apersoma
Copy link
Collaborator Author

this also makes a change to confusion & drunk aura that allows you apply them to a player temporarily.

@Apersoma Apersoma added the New Feature New feature or request label Feb 24, 2025
@Apersoma Apersoma self-assigned this Feb 24, 2025
@Apersoma
Copy link
Collaborator Author

includes stuff in #763

@Apersoma
Copy link
Collaborator Author

It should be good now

@Apersoma Apersoma requested a review from ItsSammyM February 25, 2025 04:17
@Apersoma Apersoma added the Balance/Rework Balance changes & Reworks label Feb 26, 2025
Copy link
Collaborator

@ItsSammyM ItsSammyM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Split this into multiple PRs. Red herrings should be its own
However i have alot to talk about with this so can i just call you

There should be able to be multiple red herrings
Red herrings should not be stored on rolestate, instead we can make a new "component"
I dont like duration but i also dont get it. Duration is a bad name because there is a rust type in std called duration

@Apersoma Apersoma requested a review from ItsSammyM March 3, 2025 18:42
Copy link
Collaborator

@ItsSammyM ItsSammyM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can you remove the status duration thing
Put drunk aura back to what it was before if you can

If you want status duration thing, put it in another PR
Also it should iterate the timer on its own

is_evil is a bad name. What is evil?
Can you just make it so floor(1/3) of the lobby is a red herring for now
Especially because red-herring might mess with different roles in different ways

Also can you make Detective::player_is_suspicious_confused(game, target_ref) to just make the code cleaner. Do this for all the other red-herring roles

The detective game logic for determining if a player is suspicious should be RedHerring OR Suspicious Aura!
Gossip should just call the detective functions instead of repeating the code
For philosopher, treat RedHerring the same as suspicious aura, like detective

If i wasn't clear please ask

Remove all the extra println!
Move VecMap stuff to another PR you dont need it here

Address comments

Please dont put multiple things in PR

Dispite all the negative feedback this looks pretty good i wanna add this alot. Keep it up!

@@ -104,6 +109,10 @@ impl<K, V> VecMap<K, V> where K: Eq {
self.vec.retain(|(k, v)| f(k, v));
}

pub fn retain_mut<F>(&mut self, mut f: F) where F: FnMut(&mut K, &mut V) -> bool {
self.vec.retain_mut(|(k, v)| f(k, v));
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this shouldnt have a mutable reference to the key, key should be immutable
Also this should not be in this PR

self.vec.push((key, value));
}
}

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Almost never use [i] and if you do, put it in an unsafe block i think

Also move all this stuff to another PR

Copy link
Collaborator Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

if I had it as get, the other half of the match statement would be an unreachable macro, its also completely safe because its accessing a value that must be in bound because position got it.

…out the player changes. added get_confusion_data func. updated tests
Copy link
Collaborator

@ItsSammyM ItsSammyM left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Regarding the chat message rename
You need to do it in ChatMessage.tsx in 2 locations (switch statement and type)
I still dont like the is_evil function name, especially because that would need to be explained in the manual.

If you want to keep it your way instead of being 1/3 of the lobby. (im starting to see your vision)
Rename is_evil to this

    adds_red_herring(outline: &RoleOutline)->bool

and move the function to be inside an implementation of confused

Also dont forget about the manual & my other review

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Balance/Rework Balance changes & Reworks New Feature New feature or request
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants