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

Template:RoleParser

From MafiaWiki
Revision as of 20:20, 27 May 2018 by Callforjudgement (talk | contribs) (docs are noinclude, not includeonly)
Jump to navigation Jump to search

Template:Rp/Stage1

Name:
  • RoleParser
Types:
Sub-Template:
  • No
Designer:

The {{RoleParser}} template is the main entry point for producing formatted Role PMs from role strings.

The first argument is the role string to format. The second argument is the special rules in use in the setup; this can be empty, if none apply. (The purpose of this argument is to make necessary modifications to the role PM, e.g. removing the factional kill from the Mafia in a Nightless setup.) Possible values if nonempty:

Compulsive
Factional kills are compulsive.
Daytalk
Anti-town factions have daytalk in their factional communication threads.
Daytalk/Compulsive
A combination of the previous two special rules.
Nightless
Factional kills do not exist.
Solo
Anti-town factions do not have factional communication or knowledge of their team-mates (likely due to having only a single member).
Solo/Nightless
A combination of the previous two special rules.

There are also a few optional arguments. An argument with a name like TownWincon, MafiaWincon, etc., will override the win condition given in the role PM if the faction in the argument matches the faction of a role. This lets you specify the wincons for the various factions without having to parse the role string to see which faction matches. Finally, the Test argument is optional and rarely used, but will cause this template to dump out some of its internal state, making it possible to test it independently from the sub-templates it calls into.

Examples

Town

Template:RoleFragment/i/1

Mafia
Your team-mates are names. You may talk to them here during night phases and confirmations only.

Template:RoleFragment/i/1

  • Each Night, if no other member of your faction is performing this action, you may target a player. Assuming no interference with your action, that player will die.

Town/Cop

Template:RoleFragment/i/1

  • Template:RoleFragment/ag/1 you will learn whether that player wins with Town. (You will get "no result" if this action is blocked.)
  • Template:RoleFragment/ag/1 you will learn whether that player wins with Town. (You will get "no result" if this action is blocked.)
  • Template:RoleFragment/ag/1 you will learn whether that player wins with Town. (You will get "no result" if this action is blocked.)
  • Template:RoleFragment/ag/1 you will learn whether that player wins with Town. (You will get "no result" if this action is blocked.)
  • Template:RoleFragment/ag/1 you will learn whether that player wins with Town. (You will get "no result" if this action is blocked.)
  • Template:RoleFragment/ag/1 you will learn whether that player wins with Town. (You will get "no result" if this action is blocked.)
  • Template:RoleFragment/ag/1 you will learn whether that player wins with Town. (You will get "no result" if this action is blocked.)
  • Template:RoleFragment/ag/1 you will learn whether that player wins with Town. (You will get "no result" if this action is blocked.)
  • Template:RoleFragment/ag/1 you will learn whether that player wins with Town. (You will get "no result" if this action is blocked.)

Town/Bulletproof

You are protected from Template:RoleFragment/ps/Town.

You are protected from Template:RoleFragment/ps/Town.

You are protected from Template:RoleFragment/ps/Town.

You are protected from Template:RoleFragment/ps/Town.

You are protected from Template:RoleFragment/ps/Town.

You are protected from Template:RoleFragment/ps/Town.

You are protected from Template:RoleFragment/ps/Town.

You are protected from Template:RoleFragment/ps/Town.

You are protected from Template:RoleFragment/ps/Town.

Template:RoleFragment/i/2

Mafia/Loyal/Jailkeeper
Your team-mates are names. You may talk to them here during night phases and confirmations only.

Template:RoleFragment/i/1

  • Each Night, if no other member of your faction is performing this action, you may target a player. Assuming no interference with your action, that player will die.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night. This action will be blocked if used on a player who does not belong to your faction.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night. This action will be blocked if used on a player who does not belong to your faction.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night. This action will be blocked if used on a player who does not belong to your faction.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night. This action will be blocked if used on a player who does not belong to your faction.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night. This action will be blocked if used on a player who does not belong to your faction.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night. This action will be blocked if used on a player who does not belong to your faction.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night. This action will be blocked if used on a player who does not belong to your faction.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night. This action will be blocked if used on a player who does not belong to your faction.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night. This action will be blocked if used on a player who does not belong to your faction.

Mafia/Bulletproof/Jailkeeper
Your team-mates are names. You may talk to them here during night phases and confirmations only.

Template:RoleFragment/i/2

  • Each Night, if no other member of your faction is performing this action, you may target a player. Assuming no interference with your action, that player will die.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.

Mafia/Multitasking/Jailkeeper
Your team-mates are names. You may talk to them here during night phases and confirmations only.

Template:RoleFragment/i/1

  • Each Night, if no other member of your faction is performing this action, you may target a player. Assuming no interference with your action, that player will die.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.
  • Template:RoleFragment/ag/1 that player will be protected from kills that night, but all their actions will be blocked that night.

Mafia/Ninja
Your team-mates are names. You may talk to them here during night phases and confirmations only.

Template:RoleFragment/i/1

  • Each Night, if no other member of your faction is performing this action, you may target a player. Assuming no interference with your action, that player will die.
  • Template:RoleFragment/ug/1 if no other member of your faction is performing the factional kill action, you may target a player. Assuming no interference with your action, you will perform the factional kill. This action is not visible to Tracker-like and Watcher-like roles.
  • Template:RoleFragment/ug/1 if no other member of your faction is performing the factional kill action, you may target a player. Assuming no interference with your action, you will perform the factional kill. This action is not visible to Tracker-like and Watcher-like roles.
  • Template:RoleFragment/ug/1 if no other member of your faction is performing the factional kill action, you may target a player. Assuming no interference with your action, you will perform the factional kill. This action is not visible to Tracker-like and Watcher-like roles.
  • Template:RoleFragment/ug/1 if no other member of your faction is performing the factional kill action, you may target a player. Assuming no interference with your action, you will perform the factional kill. This action is not visible to Tracker-like and Watcher-like roles.
  • Template:RoleFragment/ug/1 if no other member of your faction is performing the factional kill action, you may target a player. Assuming no interference with your action, you will perform the factional kill. This action is not visible to Tracker-like and Watcher-like roles.
  • Template:RoleFragment/ug/1 if no other member of your faction is performing the factional kill action, you may target a player. Assuming no interference with your action, you will perform the factional kill. This action is not visible to Tracker-like and Watcher-like roles.
  • Template:RoleFragment/ug/1 if no other member of your faction is performing the factional kill action, you may target a player. Assuming no interference with your action, you will perform the factional kill. This action is not visible to Tracker-like and Watcher-like roles.
  • Template:RoleFragment/ug/1 if no other member of your faction is performing the factional kill action, you may target a player. Assuming no interference with your action, you will perform the factional kill. This action is not visible to Tracker-like and Watcher-like roles.
  • Template:RoleFragment/ug/1 if no other member of your faction is performing the factional kill action, you may target a player. Assuming no interference with your action, you will perform the factional kill. This action is not visible to Tracker-like and Watcher-like roles.

Town/Cop/Doctor

Template:RoleFragment/i/1

Town/Bulletproof/Enabler

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

Template:RoleFragment/i/3

Town/Odd Night/Doctor/Enabler

When you Template:RoleFragment/ps/Doctor, the role "Doctor" will cease to function for all players.

When you Template:RoleFragment/ps/Doctor, the role "Doctor" will cease to function for all players.

When you Template:RoleFragment/ps/Doctor, the role "Doctor" will cease to function for all players.

When you Template:RoleFragment/ps/Doctor, the role "Doctor" will cease to function for all players.

When you Template:RoleFragment/ps/Doctor, the role "Doctor" will cease to function for all players.

When you Template:RoleFragment/ps/Doctor, the role "Doctor" will cease to function for all players.

When you Template:RoleFragment/ps/Doctor, the role "Doctor" will cease to function for all players.

When you Template:RoleFragment/ps/Doctor, the role "Doctor" will cease to function for all players.

When you Template:RoleFragment/ps/Doctor, the role "Doctor" will cease to function for all players.

Template:RoleFragment/i/4

Town/Bulletproof/Activated

Template:RoleFragment/i/1

  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "You are protected from kills that target you."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "You are protected from kills that target you."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "You are protected from kills that target you."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "You are protected from kills that target you."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "You are protected from kills that target you."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "You are protected from kills that target you."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "You are protected from kills that target you."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "You are protected from kills that target you."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "You are protected from kills that target you."

Town/Ascetic/Bulletproof

You are protected from Template:RoleFragment/ps/Town/Ascetic.

You are protected from Template:RoleFragment/ps/Town/Ascetic.

You are protected from Template:RoleFragment/ps/Town/Ascetic.

You are protected from Template:RoleFragment/ps/Town/Ascetic.

You are protected from Template:RoleFragment/ps/Town/Ascetic.

You are protected from Template:RoleFragment/ps/Town/Ascetic.

You are protected from Template:RoleFragment/ps/Town/Ascetic.

You are protected from Template:RoleFragment/ps/Town/Ascetic.

You are protected from Template:RoleFragment/ps/Town/Ascetic.

Template:RoleFragment/i/3

Town/Ascetic/Bulletproof/Enabler

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

When you Template:RoleFragment/ps/Bulletproof, the role "Bulletproof" will cease to function for all players.

Template:RoleFragment/i/4

Town/Cop/Odd Night/Doctor

Template:RoleFragment/i/1

Town/Even Night/Cop/Odd Night/Doctor

Template:RoleFragment/i/1

Mafia/Ascetic/Multitasking/Even Night/Cop/Odd Night/Doctor
Your team-mates are names. You may talk to them here during night phases and confirmations only.

Template:RoleFragment/i/2

Town/Loud/Multitasking/Jack of All Trades/Cop/Weak/Doctor/Innocent Child/Activated

Template:RoleFragment/i/1

  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "The moderator will confirm your alignment."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "The moderator will confirm your alignment."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "The moderator will confirm your alignment."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "The moderator will confirm your alignment."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "The moderator will confirm your alignment."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "The moderator will confirm your alignment."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "The moderator will confirm your alignment."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "The moderator will confirm your alignment."
  • Template:RoleFragment/ug/1 you may choose to gain the following ability for that night: "The moderator will confirm your alignment."

Serial Killer/Even Night/Ascetic/2-shot/Loud/Ninja/Weak/Rolecop/Odd Night/Doctor

Template:RoleFragment/i/3

  • Each Night, you may target a player. Assuming no interference with your action, that player will die.
  • Template:RoleFragment/ag/1 that player will be protected from one kill that night. Your target will learn that you targeted them (but not what action you targeted them with). If you use this action on a player who cannot win with the Town, you will die.
  • Template:RoleFragment/ag/1 that player will be protected from one kill that night. Your target will learn that you targeted them (but not what action you targeted them with). If you use this action on a player who cannot win with the Town, you will die.
  • Template:RoleFragment/ag/1 that player will be protected from one kill that night. Your target will learn that you targeted them (but not what action you targeted them with). If you use this action on a player who cannot win with the Town, you will die.
  • Template:RoleFragment/ag/1 that player will be protected from one kill that night. Your target will learn that you targeted them (but not what action you targeted them with). If you use this action on a player who cannot win with the Town, you will die.
  • Template:RoleFragment/ag/1 that player will be protected from one kill that night. Your target will learn that you targeted them (but not what action you targeted them with). If you use this action on a player who cannot win with the Town, you will die.
  • Template:RoleFragment/ag/1 that player will be protected from one kill that night. Your target will learn that you targeted them (but not what action you targeted them with). If you use this action on a player who cannot win with the Town, you will die.
  • Template:RoleFragment/ag/1 that player will be protected from one kill that night. Your target will learn that you targeted them (but not what action you targeted them with). If you use this action on a player who cannot win with the Town, you will die.
  • Template:RoleFragment/ag/1 that player will be protected from one kill that night. Your target will learn that you targeted them (but not what action you targeted them with). If you use this action on a player who cannot win with the Town, you will die.
  • Template:RoleFragment/ag/1 that player will be protected from one kill that night. Your target will learn that you targeted them (but not what action you targeted them with). If you use this action on a player who cannot win with the Town, you will die.


Test of this template in isolation

This test replaces the call to {{Rp/Stage2}}, the template that does most of the actual work, with a list of its arguments instead.

These arguments are:

  1. The role string.
  2. The interaction modifier, if any (this could be blank).
  3. The general restriction, if any (this could be blank).
  4. The number of active abilities the role has (including a factional kill, if any).
  5. The list of indexes of ends of component groups (as output by {{Rp/gei}}).
  6. The list of special rules to use in the setup.
Town
1=Town; 2=1; 3=1; 4=Town}; 5={{{2}}}
Mafia
1=Mafia; 2=1; 3=1; 4=Mafia}; 5={{{2}}}
Town/Cop
1=Town/Cop; 2=1; 3=1; 4=Town}; 5={{{2}}}
Town/Bulletproof
1=Town/Bulletproof; 2=2; 3=1; 4=Town}; 5={{{2}}}
Mafia/Loyal/Jailkeeper
1=Mafia/Loyal/Jailkeeper; 2=1; 3=1; 4=Mafia}; 5={{{2}}}
Mafia/Bulletproof/Jailkeeper
1=Mafia/Bulletproof/Jailkeeper; 2=2; 3=1; 4=Mafia}; 5={{{2}}}
Mafia/Multitasking/Jailkeeper
1=Mafia/Multitasking/Jailkeeper; 2=1; 3=1; 4=Mafia}; 5={{{2}}}
Mafia/Ninja
1=Mafia/Ninja; 2=1; 3=1; 4=Mafia}; 5={{{2}}}
Town/Cop/Doctor
1=Town/Cop/Doctor; 2=1; 3=1; 4=Town}; 5={{{2}}}
Town/Bulletproof/Enabler
1=Town/Bulletproof/Enabler; 2=3; 3=1; 4=Town}; 5={{{2}}}
Town/Odd Night/Doctor/Enabler
1=Town/Odd Night/Doctor/Enabler; 2=4; 3=1; 4=Town}; 5={{{2}}}
Town/Bulletproof/Activated
1=Town/Bulletproof/Activated; 2=1; 3=1; 4=Town}; 5={{{2}}}
Town/Ascetic/Bulletproof
1=Town/Ascetic/Bulletproof; 2=3; 3=1; 4=Town}; 5={{{2}}}
Town/Ascetic/Bulletproof/Enabler
1=Town/Ascetic/Bulletproof/Enabler; 2=4; 3=1; 4=Town}; 5={{{2}}}
Town/Cop/Odd Night/Doctor
1=Town/Cop/Odd Night/Doctor; 2=1; 3=1; 4=Town}; 5={{{2}}}
Town/Even Night/Cop/Odd Night/Doctor
1=Town/Even Night/Cop/Odd Night/Doctor; 2=1; 3=1; 4=Town}; 5={{{2}}}
Mafia/Ascetic/Multitasking/Even Night/Cop/Odd Night/Doctor
1=Mafia/Ascetic/Multitasking/Even Night/Cop/Odd Night/Doctor; 2=2; 3=1; 4=Mafia}; 5={{{2}}}
Town/Loud/Multitasking/Jack of All Trades/Cop/Weak/Doctor/Innocent Child/Activated
1=Town/Loud/Multitasking/Jack of All Trades/Cop/Weak/Doctor/Innocent Child/Activated; 2=1; 3=1; 4=Town}; 5={{{2}}}
Serial Killer/Even Night/Ascetic/2-shot/Loud/Ninja/Weak/Rolecop/Odd Night/Doctor
1=Serial Killer/Even Night/Ascetic/2-shot/Loud/Ninja/Weak/Rolecop/Odd Night/Doctor; 2=3; 3=1; 4=Serial Killer}; 5={{{2}}}