TTT-2 / ttt2-role_pha

2 stars 7 forks source link

Graverobber: Added logic to give gravs their original role back if no ankhs and "opt-out" hook #17

Closed AaronMcKenney closed 3 years ago

AaronMcKenney commented 3 years ago

This pull request makes two changes to the Graverobber:

  1. Implements Tim's idea mentioned in https://github.com/TTT-2/ttt2-role_pha/pull/16, wherein if all ankhs are destroyed all Graverobbers are given back their original roles (I believe this implementation was their intention).
  2. Adds the "TTT2GraverobberPreventSelection" hook, which can be used by special traitor roles to "opt-out" of being selected to become Graverobbers. I added this primarily for the Defective, as losing their Detective status right as an ankh is placed down is extremely sus and has no meaningful counterplay.

My local implementation of the above hook in the Defective code is as follows:

hook.Add("TTT2GraverobberPreventSelection", "DefectiveGraverobberPreventSelection", function(ply)
    if ply:GetSubRole() == ROLE_DEFECTIVE then
        return true
    end
end)
TimGoll commented 3 years ago

Thank you!