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

Template:RoleParser: Difference between revisions

From MafiaWiki
Jump to navigation Jump to search
m (a few bugfixes)
(add ActiveCount here; Rp/Stage1 needs to mention it twice)
Line 1: Line 1:
{{{{{Test|Rp/Stage1}}}|{{{1}}}|{{Rp/LastRclIndex|{{{1}}}}}|{{Rp/LastRclIndex|{{{1}}}|g}}|{{{{{#titleparts:{{{1}}}|1|1}}Wincon|{{#titleparts:{{{1}}}|1|1}}}}}|{{{2|}}}}}<noinclude>{{RoleParser/doc}}</noinclude>
{{{{{Test|Rp/Stage1}}}|{{{1}}}|{{Rp/LastRclIndex|{{{1}}}}}|{{Rp/LastRclIndex|{{{1}}}|g}}|{{{{{#titleparts:{{{1}}}|1|1}}Wincon|{{#titleparts:{{{1}}}|1|1}}}}}|{{Rp/ActiveCount|{{{1}}}}}|{{{2|}}}}}<noinclude>{{RoleParser/doc}}</noinclude>

Revision as of 01:54, 28 May 2018

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

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:Rp/gpm/m

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:Rp/gpm2/m

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

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

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.
  • 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

  • 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/Enabler

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.

Template:RoleFragment/i/4

Town/Bulletproof/Activated

Template:RoleFragment/i/1

Town/Ascetic/Bulletproof

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.

Template:RoleFragment/i/4

Town/Cop/Odd Night/Doctor

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.)

Town/Even Night/Cop/Odd Night/Doctor
Template:Rp/gpm/s

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
Whenever you perform a targeted action, your target will learn that you targeted them (but not what action you targeted them with).

Template:RoleFragment/i/1

Serial Killer/Even Night/Ascetic/2-shot/Loud/Ninja/Weak/Rolecop/Odd Night/Doctor
Template:Rp/gpm/s

Template:RoleFragment/i/3

  • Each Night, you may target a player. Assuming no interference with your action, that player will die.
  • Template:Rp/gpm2/s


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=0
Mafia
1=Mafia; 2=1; 3=1; 4=Mafia; 5=1
Town/Cop
1=Town/Cop; 2=1; 3=1; 4=Town; 5=1
Town/Bulletproof
1=Town/Bulletproof; 2=2; 3=1; 4=Town; 5=0
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=0
Town/Odd Night/Doctor/Enabler
1=Town/Odd Night/Doctor/Enabler; 2=4; 3=1; 4=Town; 5=0
Town/Bulletproof/Activated
1=Town/Bulletproof/Activated; 2=1; 3=1; 4=Town; 5=1
Town/Ascetic/Bulletproof
1=Town/Ascetic/Bulletproof; 2=3; 3=1; 4=Town; 5=0
Town/Ascetic/Bulletproof/Enabler
1=Town/Ascetic/Bulletproof/Enabler; 2=4; 3=1; 4=Town; 5=0
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=3
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; 5=3
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=4