You are viewing the MafiaScum.net Wiki. To play the game, visit the forum.

Template:Rp/cot/doc

From MafiaWiki
Jump to navigation Jump to search
Name:
  • Rp/cot
Type:
Sub-Template:
  • Yes
Designer:

This template takes a role string as its first argument (required), and a component type as its second (optional, defaulting to g). There must be at most one component in the role string that has the given type (this template does not produce useful output if more than one such component exists). If such a component does exist, it will be output. If no such component exists, this template will output the null string.

This template is probably only useful for component codes that should only appear once, such as g and i. (You could in theory use it for f, but given that the faction must always appear first in a role string, it's simpler to just use the magic word #titleparts: to get at it.)

Test cases

Not very interesting, as most role strings don't have any components of code g

Town
Mafia
Town/Cop
Town/Bulletproof
Mafia/Loyal/Jailkeeper
Mafia/Bulletproof/Jailkeeper
Mafia/Multitasking/Jailkeeper
Mafia/Ninja
Town/Cop/Doctor
Town/Bulletproof/Enabler
Town/Odd Night/Doctor/Enabler
Town/Bulletproof/Activated
Town/Ascetic/Bulletproof
Town/Ascetic/Bulletproof/Enabler
Town/Cop/Odd Night/Doctor
Town/Even Night/Cop/Odd Night/Doctor
Mafia/Ascetic/Multitasking/Even Night/Cop/Odd Night/Doctor
Town/Loud/Multitasking/Jack of All Trades/Cop/Weak/Doctor/Innocent Child/Activated
Jack of All Trades
Serial Killer/Even Night/Ascetic/2-shot/Loud/Ninja/Weak/Rolecop/Odd Night/Doctor