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

Template:RoleParser

From MafiaWiki
Revision as of 20:35, 27 May 2018 by Callforjudgement (talk | contribs) (a few bugfixes)
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

Town/Bulletproof

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.

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.

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.

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.

Town/Cop/Doctor

Template:RoleFragment/i/1

Town/Bulletproof/Enabler

Template:RoleFragment/i/3

Town/Odd Night/Doctor/Enabler

Template:RoleFragment/i/4

Town/Bulletproof/Activated

Template:RoleFragment/i/1

Town/Ascetic/Bulletproof

Template:RoleFragment/i/3

Town/Ascetic/Bulletproof/Enabler

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

  • 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/Loud/Multitasking/Jack of All Trades/Cop/Weak/Doctor/Innocent Child/Activated

Template:RoleFragment/i/1

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.


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
Mafia
1=Mafia; 2=1; 3=1; 4=Mafia
Town/Cop
1=Town/Cop; 2=1; 3=1; 4=Town
Town/Bulletproof
1=Town/Bulletproof; 2=2; 3=1; 4=Town
Mafia/Loyal/Jailkeeper
1=Mafia/Loyal/Jailkeeper; 2=1; 3=1; 4=Mafia
Mafia/Bulletproof/Jailkeeper
1=Mafia/Bulletproof/Jailkeeper; 2=2; 3=1; 4=Mafia
Mafia/Multitasking/Jailkeeper
1=Mafia/Multitasking/Jailkeeper; 2=1; 3=1; 4=Mafia
Mafia/Ninja
1=Mafia/Ninja; 2=1; 3=1; 4=Mafia
Town/Cop/Doctor
1=Town/Cop/Doctor; 2=1; 3=1; 4=Town
Town/Bulletproof/Enabler
1=Town/Bulletproof/Enabler; 2=3; 3=1; 4=Town
Town/Odd Night/Doctor/Enabler
1=Town/Odd Night/Doctor/Enabler; 2=4; 3=1; 4=Town
Town/Bulletproof/Activated
1=Town/Bulletproof/Activated; 2=1; 3=1; 4=Town
Town/Ascetic/Bulletproof
1=Town/Ascetic/Bulletproof; 2=3; 3=1; 4=Town
Town/Ascetic/Bulletproof/Enabler
1=Town/Ascetic/Bulletproof/Enabler; 2=4; 3=1; 4=Town
Town/Cop/Odd Night/Doctor
1=Town/Cop/Odd Night/Doctor; 2=1; 3=1; 4=Town
Town/Even Night/Cop/Odd Night/Doctor
1=Town/Even Night/Cop/Odd Night/Doctor; 2=1; 3=1; 4=Town
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
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=4; 4=Town
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