thebigsleepjoe / TTT-Bots-2

Player bots for Garry's Mod TTT
Creative Commons Attribution Share Alike 4.0 International
11 stars 4 forks source link

[FEATURE] Support for "Sherrif" role #61

Closed ZeadenBeake closed 1 week ago

ZeadenBeake commented 1 week ago

What is the new feature? (required)

Support for the TTT2 role "Sherrif", an alternative detective. (As well as the included subrole, Deputy.)

Purpose/motivation (required)

Better role support! Sherrif specifically should be easy because...

How would you add this feature?

...Sherrif works very similarly to the Jackal, using a special weapon to shoot someone and turn them into a new role of the same team. The only difference is they both must also perform detective duties and handle being public roles (assuming the bots are even aware their role is public as a detective, I'm not sure). I'm not sure how the behavior for the bots is structured, but performing the deputizing shortly after the start of round then acting like a normal detective for the rest of the round shouldn't be too hard.

Additional context (optional)

If you wanted some more intelligent behavior, a Sherrif could hold off on deputizing to deputize a suspected jester or evil role, as some players do this. Otherwise, this addition should be quite straightforward.

ZeadenBeake commented 1 week ago

I've attempted to fix my own issue! Had to dust off some old Lua knowledge to get it done, but it works. I'll leave this open for now in case the PR (https://github.com/thebigsleepjoe/TTT-Bots-2/pull/62) gets rejected.

thebigsleepjoe commented 1 week ago

:eyes: This is the first time I've had a feature requester create a PR for what they're asking. Don't spoil me!

I'll take a look at your changes when I can.