How To Make Mafia Themes (V 3.0)

Discussion in 'Theme Development' started by Shazan, May 15, 2014.

  1. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Double post because huge update (well, only huge because it has accumulated lots of smaller ones):

    ~Number~ on massconvertmsg: massconvertmsg and singlemassconvertmsg now allow for the use of ~Number~, which will say the number of players converted by that action. Be aware that, on massconvertmsg, ~Number~ will be displayed separately per role converted, while singlemassconvertmsg will show the overall number of converted players regardless of role.

    ~Sided~ on "info":You can now use ~Sided~ on a role's "info" property to automatically fill it with the "Sided with Good People" part.
    Code (text):
    1. {
    2.     "role": "hooker",
    3.     "translation": "Ice Kirby",
    4.     "side": "village",
    5.     "help": "Brrrr! Are you cold enough? If not, I can type /distract [name] during the night to freeze you for a entire night. And I can protect someone (even myself) with an Ice Wall by typing /protect [name] during the night, BUT I can only use it once every 3 nights.",
    6.     "info": "A distractor that can also protect once every 3 nights. ~Sided~",
    7.     "actions": {}
    8. }
    With the code above, typing '/roles Kirby:Ice' will display "A distractor that can also protect once every 3 nights. Sided with Kirby."
    This should save some time when writing a new role/theme and when changing things around (like a role's side or a side's name).

    Spawn Packs on /roles: Not much of a new coding stuff, but previously, the "±Players: " field on /roles would be unable to account for Spawn Packs. This is not the case anymore, so if you customized that field to manually write that spawn information, you no longer needs to.

    Protect and Safeguard Messages: You can now customize those messages. As with most messages related to night actions, you can use the stuff mentioned here: http://pokemon-online.eu/threads/mafia-theme-message-guide.24039/
    Code (text):
    1. "protect": {
    2.     "common": "Self",
    3.     "target": "AnyButSelf",
    4.     "priority": 4,
    5.     "protectmsg": "Your target (~Target~) was protected by the ~Role~!"
    6. }
    For safeguard, use "safeguardmsg".

    Tips: Theme authors can now add tips to the theme. They will be available by typing /tips [theme].
    Code (text):
    1. "tips": {
    2.     "Important Tip": "If you are Mike Kirby, claim immediately and ask that either Parasol or Ice Kirby protect you (but not both!).",
    3.     "Tip for scum": "If you are TAC or Waddle Doo, let King Dedede type the kills if he's alive, since he avoids hax."
    4. }
    Syntax is exactly the same as changelog, which means you can have it either as an object or an array.
    Be careful to not put too many tips, since all of them will be displayed when you type /tips.

    Check No Voters: Allows for the voting phase to finish earlier (or not even start) if all remaining players that still didn't vote have "noVote": true.
    Code (text):
    1. "checkNoVoters": true
    This is a global-level property (AKA same level as others like votesniping and theme's name).

    Silent OnDeadRoles: silentConvert is now available for onDeadRoles. This will make the converted player not receive the "You are Role!" and "You can use /blablabla" messages.
    Code (text):
    1. "onDeadRoles": {
    2.     "convertTo": {
    3.         "lucas2": ["ness", "ness2"]
    4.     },
    5.     "silentConvert": true,
    6.     "convertmsg": "Lucas' determination increased due to Ness' defeat!"
    7. }
    As with most game messages, if you set "convertmsg": "" (nothing between the quotation marks) then the public message will not be displayed as well.

    Also, there was a bug fixed with onDeadRoles: It would previously not trigger if the role that has that ability was listed as a role that must die too (since the player that has that would obviously still be alive). Now onDeadRoles will not count the own player with that role (but still will count other players with the same role). This should make it possible to have roles like "Converts if last villager alive" more easily.

    Quick onDeadRoles: You can now set your theme to check for onDeadRoles more often during the night. By default, onDeadRoles only triggers at the end of the night, but you can make it check after each player's night action too.
    Code (text):
    1. "quickOnDeadRoles": true
    This is a global-level property. You cannot set it individually per role.

    Vote Multiplier: A new type of vote. In addition to the player's normal vote, the person voted for will have their total received votes multiplied by this value.
    The code below will make the player cast 0 votes on their target, but at the end of the voting phase, all votes received by their target will be increased in 50%.
    Code (text):
    1. "actions": {
    2.     "vote": 0,
    3.     "voteMultiplier": 1.5
    4. }
    Guard (Night Action): A new night action. It's a simple action that protects the target, but with a difference: the author can decide which actions are blocked by this.
    The code below will guard the target from poison, inspections, protections (yes, it's possible) and kill2 (only if the command is /kill2, since /kill will still go through normally):
    Code (text):
    1. "night": {
    2.     "guard": {
    3.         "common": "Self",
    4.         "target": "Any",
    5.         "priority": "2",
    6.         "guardActions": [
    7.             "poison",
    8.             "inspect",
    9.             "protect",
    10.             "kill2"
    11.         ],
    12.         "guardmsg": "Your target (~Target~) was guarded from your ~Command~!"
    13.     }
    14. }
    "guardActions" is a mandatory array that lists the commands that will be blocked by this role's guard.
    Be aware that, similar to /shield, this action will block things based on the command's name, not action's effect. This means that, in the example above, if a player uses a poison command named /burn, this guard will not block it, even if it has "command": "poison".
    "guardmsg" is optional and works exactly like protectmsg, except that it also allows a ~Command~ parameter (shows the command that was blocked by this guard). If not defined, it will default to the message shown on the example above.

    Watch First and Last: There are now more options for /watch. You can set it to show the first X players to visit your target, or the last Y players (or even combine both).
    The code below will make the Watcher identify the first 2 and the last 3 person to visit their target:
    Code (text):
    1. "night": {
    2.     "watch": {
    3.         "target": "AnyButSelf",
    4.         "common": "Self",
    5.         "priority": 30,
    6.         "watchFirst": 2,
    7.         "watchLast": 3
    8.     }
    9. }
    Be careful when choosing those numbers, as it may reveal the entire mafia team if you watch the person killed by them.

    Prevent Teamvote: You can now make accidental teamvote less likely to happen on your theme. By adding this boolean to a role, that role will only be able to vote a teammate by using a different command (AKA /teamvote).
    Code (text):
    1. "actions": {
    2.     "startup": "team-reveal",
    3.     "preventTeamvote": true
    4. }
    Be aware that, like Team Reveal and Team Talk, this must be done on a per-role basis. Roles with that boolean enabled will be unable to vote a teammate with /vote and instead receive a message saying they have to use /teamvote to vote them.

    Update Team: A feature really useful for themes with lots of conversion. A role with this boolean enabled will receive their team-reveal message every night when a new player is added to their team.
    Code (text):
    1. "actions": {
    2.     "startup": "team-reveal",
    3.     "updateTeam": true
    4. }
    If the role with the code above gains any new teammate during the night, they will automatically receive the "Your team is: Player1, Player2" message. Useful for themes with Recruiter roles like Trainers, so whenever your Trainer catches a new Pokémon you will be updated on your team.
    Note that the team message will only be displayed when there's a new member on your team; losing a teammate will not trigger it.
    For now, this code only updates your team during the night; Standby/Voting phase may come later.
     
    Whereabouts Unknown likes this.
  2. Shazan

    Shazan Obey to Kyubey

    Joined:
    Jan 21, 2013
    Messages:
    591
    Likes Received:
    14
    PO Trainer Name:
    Obey to Kyubey
    About /teamvote , it is possible to write /tv or /tvote to make it shorter like /tt is for teamtalk ? Or you want it to stay /teamvote, because maybe this way people will think twice before to vote teammates ?
    P.S.
    Thanks, especially for the Check no Voters :rolleyes:
     
    Last edited: Jun 28, 2014
  3. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    For now you have to type /teamvote, no shorter command is available. That was indeed to make sure players know they are voting a teammate, but adding a shorter version should be easy if necessary (but IMO, it shouldn't be too short like /tv).
     
  4. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    I'd actually say leave it at /teamvote, no shorter command is necessary. The point is to deter possibly rulebreaking behavior. You won't be using it as much as /tt and the way it is helps with the conscious realization you are voting a teammate.
     
  5. Shazan

    Shazan Obey to Kyubey

    Joined:
    Jan 21, 2013
    Messages:
    591
    Likes Received:
    14
    PO Trainer Name:
    Obey to Kyubey
    I have another question @IceKirby and @Fuzzysqurl , from what I understand Fuzzy you want that the authors add the /teamvote feature to their teams, but I have a problem with 2 themes under mine Control : "FiM" and "RPS", in this themes there are mafia roles that knows only part of their teammates , so I wanted to ask if is it possible to code /teamvote to work only with some teammates instead then only with all the team, something like "preventTeamvote": [ "para", "para1", "discord"], ? Practically a little like TeamTalk is.
    Otherwise if it's impossible can I not add "preventTeamvote" to such teams? Because otherwise it could become too simple to connect each others.
     
  6. Pangaea

    Pangaea resto en peaco

    Joined:
    Mar 20, 2014
    Messages:
    329
    Likes Received:
    46
    Noticed the same thing with Chinchous. The Alliance don't know each other from the start and the Chinchous only partially know each other from the start. If we added that in, it would be too easy for them to connect if they tried voting for a teammate that they didn't know.
     
  7. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    preventTeamvote as an array is not available, but it could be coded in the future. For the time being, just add the preventTeamvote where applicable.

    BTW, in some of my themes where I have a mafia not fully connected I gave some of them preventTeamvote regardless, so they can use the Kefka/Kuja method of connecting (although you only get 1 chance per turn :x).
     
  8. Pangaea

    Pangaea resto en peaco

    Joined:
    Mar 20, 2014
    Messages:
    329
    Likes Received:
    46
    It kinda ruins the point of teams like Chinchous or Mantine, where they rely on the Remoraid or accidental friendly fire for connecting with each other. If they had preventTeamvote, too, it'd be too easy for them to connect early and they'd be even more powerful if they were able to connect everyone very early on.
     
  9. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    When I said to add where applicable, I meant on sides that get full team-reveal. For those that don't get, it shouldn't be a problem to leave it without preventTeamvote for now.
     
  10. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    Not necessarily. The preventTeamvote from acting as a means of connection isn't the whole problem, since you only get 1 shot a turn... and you don't want to vote too randomly else your intentions can be figured out. It's the fact that an unconnected team can no longer accidentally lynch an unconnected teammate in the case of a split vote.

    For example, FIM has Parasprites and Changeling, neither know each other. If a vote is split between Changeling and PR (obviously we're assuming neither player is 100% confirmed) then when Parasprites go to vote, if they choose Changeling, they connect. Now they can lynch the PR and connect at the same time.

    In some situations, it won't matter. Kefka having preventTeamvote on Kuja (though we made it mutual, but just as an example). Kefka's vote is meaningless against Kuja anyway (voteshield) and the massive vote makes the vote even more useless. Kefka can't accidentally lynch Kuja no matter how hard it tries.
     
  11. Pangaea

    Pangaea resto en peaco

    Joined:
    Mar 20, 2014
    Messages:
    329
    Likes Received:
    46
    The two methods of connection that I talked about were originally the only ways of connecting, and that's how the team is supposed to work, so I don't really want to change that. I'll add preventTeamvote to the mafia teams that get start-up reveal, however.
     
  12. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Some new stuff:

    Prevent Teamvote as Array: As requested, preventTeamvote can now be an array of roles. Player will be unable to vote roles on that array (regardless of side) unless they use /teamvote.
    In the example below, a player with that code cannot vote Weedle, Kakuna or Beedrill with /vote, but still can vote Shiny Beedrill.
    Code (text):
    1. "actions": {
    2.     "preventTeamvote": ["weedle", "beedrill", "kakuna"]
    3. }
    Team Utilities: Adding team-reveal, team talk, prevent teamvote and updateTeam is now simpler. Instead of adding all of those separately, you can simply add teamUtilities and all of them will be automatically enabled for the role.
    This code:
    Code (text):
    1. "actions": {
    2.     "teamUtilities": true
    3. }
    is the same as this:
    Code (text):
    1. "actions": {
    2.     "startup": "team-reveal-with-roles",
    3.     "teamTalk": true,
    4.     "preventTeamvote": true,
    5.     "updateTeam": true
    6. }
    changelog2: Not a new feature, it's just that the Mafia Checker won't throw a minor error for changelog2 anymore. This is useful if your changelog is already too long, but you don't want to simply delete the previous entries.
     
  13. Shazan

    Shazan Obey to Kyubey

    Joined:
    Jan 21, 2013
    Messages:
    591
    Likes Received:
    14
    PO Trainer Name:
    Obey to Kyubey
    I have noticed something that we could consider a bug on Curse but I am not sure.
    On both Trust and Chinchous when a role that has an initialCondition curse with a curse message gets cursed again by another role with a new curse without a curse message, when this new curse's countdown ends, instead to stay silent it reproduce the curse message of the old curse.
    So I wanted to know what would be the best way to solve this problem, should I add a dispel feature inside the curse command of the Curse user ? or am I forced to give a message to the new curse even if I want it Silent ? or there is some better solution ?
     
  14. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Dispell probably won't work as you want.
    A possible solution is to remove the silent: true from the curse and instead add a "curseConvertMessage": "", so the old curseConvertMessage will actually be replaced by an empty string.
     
  15. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    More stuff:

    Kill Message: For nightkills only, this message will override the theme's killmsg for a player killed by this action.
    For example, if the theme's killmsg is "~Player~ (~Role~) was found dead stabbed by dagger!", then whenever a player dies that message will be sent. But if a specific role has this code:
    Code (text):
    1. "kill": {
    2.   "common": "Self",
    3.   "target": "AnyButSelf",
    4.   "priority": 12,
    5.   "killmsg": "~Target~ (~TargetRole~) was killed by a hand-grenade!"
    6. }
    Then whoever this role kills will not die by the dagger, but by the grenade.

    I strongly suggest this feature is only used when really necessary, or this will get players confused.

    Hax Multiplier: Another small feature added on a whim :x You can modify the chances of a role's action being haxed. This modifier is set on the action itself, not on the haxer.
    The code below makes a role that has twice the chance of being haxed for any role that hax /kill.
    Code (text):
    1. "kill": {
    2.   "common": "Self",
    3.   "target": "AnyButSelf",
    4.   "priority": 12,
    5.   "haxMultiplier": 2
    6. }
    Bugs fixed:
    -Fixed a bug where startup.revealPlayersMsg would be displayed even if no one was being revealed by it.
    -Fixed a bug with lynch.killVoters.first, lynch.convertVoters.first and watch.watchFirst where setting it to 0 would reset the value to 1.

    EDIT because small stuff:

    spawnPack.chance is now optional. If you don't set it for a spawnPack, it will assume all lists have the same chance of being chosen.

    More bugs fixed:
    -Fixed role.players not working as Array.
    -Fixed inspect.revealAs: "*" having a chance to crash the game when activated by expose.
    -curse.silent will now properly erase any curseConvertMessage the player had from a previous curse.
    -Fixed a bug with spawnPacks where themes with spawn fully defined by packs would assign roles by joining order.

    EDIT 2 because even more stuff:

    clearCharges: Can be added either on night or standby actions. If a role with this attribute is converted from another role that had charges, the charges on that command will be cleared and the player will be able to use that actions unlimited times. In other words, this will make the player not carry the charges from previous roles.
    Code (text):
    1. "night": {
    2.   "kill": {
    3.   "common": "Self",
    4.   "target": "AnyButSelf",
    5.   "priority": 3,
    6.   "clearCharges": true
    7.   }
    8. }
    If a player had a role that could /kill 3 times per game and then converts into a role with the code above, then they will be able to /kill without any charge restriction.

    addCharges: Can be added either on night or standby actions. If a role with this attribute is converted from another role that had charges, then the charges will be increase/decreased by this value. In other words, they will have the charges from the previous role + charges from new role.
    Code (text):
    1. "night": {
    2.   "inspect": {
    3.   "common": "Self",
    4.   "target": "AnyButSelf",
    5.   "priority": 3,
    6.   "addCharges": 1
    7.   }
    8. }
    If a player had a role that could /inspect twice per game (like Rotom) and convert into another role with the code above, they will be able to inspect 3 times per game (2 inspections from first form + 1 from new form) regardless of when they use convert or use the action.
    'addCharges' can also be used with negative values (converting would make you lose charges).
    Please note that addCharges will only add charges to actions that had charges prior to the conversion. If a role with no charges converts into a role with addCharges, then nothing will happen.
     
    Last edited: Jul 27, 2014
  16. Scatterbrain

    Scatterbrain You only live once*

    Joined:
    Jul 5, 2012
    Messages:
    865
    Likes Received:
    4
    ty rice, will incorporate this in Time.

    in the meantime, how would a role with a set amount of charges and clearcharges work?
     
  17. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    The actual question is: Why would you set both charges and clearCharges to a same action?
    In any case, if 'charges' is defined, both addCharges and clearCharges will be completely ignored.
     
  18. Dreadpool

    Dreadpool Inb4 I die N1...

    Joined:
    Jun 21, 2014
    Messages:
    41
    Likes Received:
    4
    PO Trainer Name:
    Dreadpool
    Is it possible for a role to add charges to another roles night actions at all?

    For example:
    Ins has a daykill with 2 charges, n1 it used 1 and has one left.
    Bg uses a command, adds a charge to ins and they have two again.


    Also is it possible for roles to reset their charges when they are used up?
     
  19. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Both can be done with conversions. Make BG convert inspector into a variation with addCharges: 1 for the first question, and make a role convert into itself again for the second (charges are reset when you convert into a role with charges).
     
    Dreadpool likes this.
  20. The Pikachu Master

    The Pikachu Master New Member

    Joined:
    Jul 24, 2014
    Messages:
    8
    Likes Received:
    0
    PO Trainer Name:
    The Pikachu Master
    So I'm working on my theme and I want to buff a stalk command to have a 30% chance of also being an inspect. Here's what I came up with:

    Code (text):
    1. "command": {
    2.     "stalk": 0.7,
    3.     ["stalk", "inspect"]: 0.3
    4. }
    But I'm not sure it'll work because I'm not sure if the random command thing supports arrays. If it doesn't, how would I do this?
     
  21. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Your issue there is not even if the random object allows arrays. That's not even a proper JSON syntax, since you cannot use an array as the key for an property.

    If you don't have millers on your theme, then it's possible to do that with some slightly complex code. Just make it a "command": ["stalk", "dummy"] command which will give a dummy message similar to inspection for the user, and then have all roles have a 70% chance of evading that dummy.
     
  22. The Pikachu Master

    The Pikachu Master New Member

    Joined:
    Jul 24, 2014
    Messages:
    8
    Likes Received:
    0
    PO Trainer Name:
    The Pikachu Master
    (I'm confused. Aren't arrays used for mutliple actions in a command?)

    What if I made command variables ninja (stalk) and betterNinja (stalk+inspect) and instead had:
    Code (text):
    1. "command": {
    2.     "variable:ninja": 0.7,
    3.     "variable:betterNinja": 0.3
    4. }
     
  23. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    You can't simply put an array anywhere and expect it to work. For an object, you can only use strings or numbers for its keys. For reference, an object's keys are those higlighted parts:
    Putting variables there will not work either, as variables are only valid for properties, not for keys.
     
  24. The Pikachu Master

    The Pikachu Master New Member

    Joined:
    Jul 24, 2014
    Messages:
    8
    Likes Received:
    0
    PO Trainer Name:
    The Pikachu Master
    It was worth a try. Buffing the command a different way.
    (coughUPDATEBAITcough)
     
  25. Scatterbrain

    Scatterbrain You only live once*

    Joined:
    Jul 5, 2012
    Messages:
    865
    Likes Received:
    4
    How does specific evade chance work? I vaguely remember it, but it's not on here, and I'm not sure if I'm mixing it up with specific evade (without the "chance" part).
     
  26. Whereabouts Unknown

    Whereabouts Unknown Absolutely Stunning Forum Moderator Channel Leader Forum Moderator Channel Leader

    Joined:
    Aug 17, 2010
    Messages:
    1,008
    Likes Received:
    538
    PO Trainer Name:
    Miki Sayaka
    Copy is your friend, unless there's another way to do it. I haven't seen anything simple input for specific mode evade chance, but it's doable.

    With specific evades, you can put this in the code of the evading role.
    Code (text):
    1.  
    2.         "kill": {
    3.           "mode": {
    4.             "ignore": [
    5.                  "mafia1",
    6.                  "werewolf",
    7.             ]
    8.           }
    9.         }
    10.  
    which will make it evade kills from mafia1 and werewolf, but no other roles.

    Premise that you have a role mafia1, and that role has a kill. You want to make that role have a 30% chance to kill the above role (evader) with its kill command.

    What you can do is give this role (mafia1) a command kill. But in the command kill, you want to have this:
    Code (text):
    1.  
    2.           "kill": {
    3.               "command": ["copy", "kill"],
    4.               "canCopy": "evader",
    5.               "copyAs": "mafia2",
    6.               "silent": true,
    7.               "silentCopy": true
    8.             "target": "AnyButTeam",
    9.             "common": "Team",
    10.             "priority": 10,
    11.             "broadcast": "team"
    12.           }
    13.  
    Since mafia1 cannot kill evader, this instance of the kill will be automatically ignored (you will wish to silence it for the purposes of minimizing confusion). However, the role mafia2 can be given a kill as well, and mafia2 is not ignored by evader.

    So how to do you give it a 30% chance to kill?

    Since mafia2 is a later version of mafia1, the kill command submitted as role mafia1 should automatically be submitted to mafia2, as long as mafia2's command is later in priority (I haven't 100% verified this, but I think that's how it works). For mafia2, the command kill should simply look like
    Code (text):
    1.  
    2.           "kill": {
    3.               "command": ["kill"],
    4.             "target": "AnyButTeam",
    5.             "failChance": 0.7,
    6.             "common": "Team",
    7.             "priority": 11
    8.           }
    9.  
    You should give mafia2 an initialCondition silent Curse to revert it back to mafia1 at the end of the phase.

    What all this will do is have the role mafia1 check if the thing it's trying to kill is 'evader'. If it's not, it will simply kill the target. If it is, it will copy itself into mafia2, which has a kill which fails 70% of the time, but cannot be evaded. Since mafia2 won't exist unless hitting evader, the 70% failChance won't apply to other kills.

    Alternatively you can give evader a global evade and give mafia2:
    Code (text):
    1. "bypass": "ignore",
    inside the command kill alongside the 70% failChance.

    Sorry if this seems complicated, but it's the easiest way to do it afaik. If evadeChance can be specific, by all means skip the extra role, I'd like to be enlightened as well.
     
  27. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Wow it's been a while since I posted new features. So here we come:

    unlimitedSelfConvert: By default, the script prevents a players from self-converting twice at the same turn, since this used to cause undesired effects (Dark Knight Cecil converting to Paladin and then changing back at the same night). But in some cases you may want to allow that dual self-conversion, so this property allows you to bypass that restriction. To do that, you can use this boolean on the convert action:
    Code (text):
    1.  
    2. "convert": {
    3.   "target": "OnlySelf",
    4.   "common": "Self",
    5.   "priority": 4,
    6.   "newRole": "grass",
    7.   "silent": true,
    8.   "unlimitedSelfConvert": true
    9. }
    This is likely only useful for advanced coders, so most of you will rarely need it.

    standby.msg: This is not really a feature, but a change to an existing property. If you have a "msg" in a standby action, the player will receive it when the day begins (the typical "You can daykill now with /kill [name]" message). What changed is that if you has no charges left for that action, then that message will not be displayed, so if you used to take into consideration the charges when writing that message, then you no longer need to worry about that.

    Update Charges: If your theme uses lots of charges, then this is quite useful for you. By setting this to true, the player will be informed how many charges (if any) they have left for actions limited by charges whenever they use /myrole.
    So this:
    Code (text):
    1.  
    2. "actions": {
    3.   "kill": {
    4.   "target": "AnyButSelf",
    5.   "common": "Self",
    6.   "priority": 4,
    7.   "charges": 3
    8.   },
    9.   "updateCharges": true
    10. }
    Will make the player receive the following message when using /myrole:
    Actions that have are unlimited (no charges restriction) or have reached 0 charges are not displayed by that message.

    "random" for killVoters, convertVoters and watch: So far, lynch.killVoters and lynch.convertVoters could have "first" and "last" as parameters to define which players would be affected. Now there's also "random", which will make the action affect that number of players regardless of voting order (picked randomly).
    The code below will kill 2 random players that voted for this role, regardless of voting order.
    Code (text):
    1.  
    2. "actions": {
    3.   "lynch": {
    4.   "killVoters": {
    5.   "first": 0,
    6.   "last": 0,
    7.   "random": 2
    8.   }
    9.   }
    10. }
    If you have something like first: 1, last: 2 and random: 1 in the same action, then the script will pick the first voter, then the 2 last voters, and, if there are still more voters unpickedy, 1 of those will be chosen at random.

    There's also "watchRandom", which is the equivalent for "watchFirst" and "watchLast" for the "watch" night action.

    Ignore Distract: "But it's already possible to ignore distract!". Well, yeah, but it was only possible on a per-role basis. Now you can have it on a per-action basis. A night action with this property will not be interrupted when the player is distracted (even if other actions are blocked). This is useful for roles with 2 or more night actions where one of them shouldn't be stopped by distractors while the other should, but none of them can be faster than PLs.
    A good example for this is Trainers: the code below allows for a caught pokémon to /runaway even if distracted, but their normal action will still be blocked.
    Code (text):
    1. "night": {
    2.   "kill": {
    3.   "common": "Self",
    4.   "target": "AnyButTeam",
    5.   "priority": 13
    6.   },
    7.   "runaway": {
    8.   "command": "convert",
    9.   "pierce": true,
    10.   "common": "Self",
    11.   "target": "OnlySelf",
    12.   "priority": 17,
    13.   "newRole": "Wild_Exeggutor2",
    14.   "convertmsg": "With their trainer defeated, a ~New~ became wild again!",
    15.   "ignoreDistract": true
    16.   }
    17. }
    (If distracted, Exeggutor can still run, but not kill, even if both actions are slower than distract)
     
  28. VirajVora

    VirajVora VirajVora...

    Joined:
    Apr 29, 2014
    Messages:
    371
    Likes Received:
    75
    PO Trainer Name:
    Viraj / Virus
    Is there a way to switch the bot ±Game into some other bot completely...
    Even if try adding all messages, there remain many places where ±Game appears...
    Couldn't there be a single way to replace all ±Game by some other bot ?
     
  29. Fuzzysqurl

    Fuzzysqurl baa baa mareep I do what I want Server Owner Developer I do what I want Server Owner Developer

    Joined:
    Sep 12, 2012
    Messages:
    2,096
    Likes Received:
    967
    I thought I coded it so that everything except the summary of the theme could change the bot. Are you sure you're changing it correctly?
     
  30. Shazan

    Shazan Obey to Kyubey

    Joined:
    Jan 21, 2013
    Messages:
    591
    Likes Received:
    14
    PO Trainer Name:
    Obey to Kyubey
    I am unsure, but i think that what he wants is a feature able to change all the bots' names with a single command instead than changing all the messages one by one.
     
  31. VirajVora

    VirajVora VirajVora...

    Joined:
    Apr 29, 2014
    Messages:
    371
    Likes Received:
    75
    PO Trainer Name:
    Viraj / Virus
    Yes thats what I want...
    A single command to change all bots...
    If it is possible then I may use it...
    Otherwise I may leave it as it is...
     
  32. Whereabouts Unknown

    Whereabouts Unknown Absolutely Stunning Forum Moderator Channel Leader Forum Moderator Channel Leader

    Joined:
    Aug 17, 2010
    Messages:
    1,008
    Likes Received:
    538
    PO Trainer Name:
    Miki Sayaka
    Is there any equivalent of massconvert for curse? OnDeath is able to both convert and curse an unlimited amount of roles, but I can't figure out a way to simulate that effect without having someone die.
     
  33. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    No, there's none. If you need a curse for the timed aspect, you can use massconvert to change people into a version of their role with initialCondition.curse. Of course, that won't work if what you want is to use curse as an alternative convert to avoid conflict with other conversions.
     
  34. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    New batch of features:

    First of all, a small fix for evadeChance for night action. If you have seen cases where you use a shared kill/poison/any night action on someone with evade chance and they evade you but are still hit by your teammate, then know that those cases will not occur anymore. Either the player evades all players that share that action or none of them.

    Now for the actual new stuff:

    mode.die as Array: You can now use the "die" mode as an array, so a role will instantly die to an action only if it's from a specific role.
    The code below will make the player instantly die if inspected by Bulbasaur or Charmander, but not to any other inspector.
    Code (text):
    1.  
    2. "inspect": {
    3.   "mode": {
    4.   "die": ["bulbasaur", "charmander"]
    5.   },
    6.   "diemsg": "~Target~ tried to ~Action~ you, but you got scared and died!",
    7.   "targetdiemsg": "You tried to ~Action~ ~Self~, but they got scared and died!"
    8. }
    "diemsg" and "targetdiemsg" are optional.

    Custom Hax: You can have customized hax messages now. This works both for night and standby hax.
    A player with the code below will receive the usual "The Italian Mafia are going to kill Target!" hax at a 25% chance, and then a custom hax with that long message below at 6% chance.
    Code (text):
    1. "hax": {
    2.   "kill": {
    3.   "revealTeam": 0.25,
    4.   "Seems like ~Player~ (~Role~) is the one of the ~Side~ that is trying to ~Action~ ~Target~, the ~TargetRole~ of ~TargetSide~!": 0.06
    5.   }
    6. }
    The parameters like ~Player~ and ~Role~ that you can use for custom hax are those in the example above.

    inputmsg: You can now customize that "You decided to inspect Target!" message.
    The code below will change the usual "You have chosen to kill RiceKirby!" message into "Ok, so we will kill RiceKirby, right?". Reminder that this is only seen by the person who types the command.
    Code (text):
    1.  
    2. "night": {
    3.   "kill": {
    4.   "target": "AnyButTeam",
    5.   "common": "Team",
    6.   "priority": 3,
    7.   "inputmsg": "Ok, so we will ~Action~ ~Target~, right?"
    8.   }
    9. }
    Only parameters allowed as ~Target~ and ~Action~.

    Avoid repeated actions: A somehow advanced feature. Have you seen cases where you inspect or convert the same player twice in a turn because of some complex convert action? Well, this feature is used to avoid those situations.
    The code below will work exactly as you expect it to work, but if the user converts into another role that also has /copy at a lower priority, they would usually use it again, potentially converting into another role at an undesired moment. The "noRepeat" ensures that the same player will only use an action named "copy" once per night.
    Code (text):
    1.  
    2. "copy": {
    3.   "command": ["copy", "dummy"],
    4.   "dummybroadcastmsg": "Hello I'm now ~Role~!",
    5.   "target": "Any",
    6.   "common": "Self",
    7.   "priority": 27,
    8.   "broadcast": "role",
    9.   "copyAs": "bodyguard2",
    10.   "noRepeat": true
    11. }
    Important to note that this is completely different from "restrict". With "restrict", you are unable to type the command again, while noRepeat only affects things at the moment the night ends and the actions are executed.

    Compulsory Actions: A fairly old request that I even said "Good luck trying" when @Fuzzysqurl said he wanted to code it, but I finally decided to try it. It forces a player to use certain night actions every night, picking a random target as soon as the night begins.
    The code below will force the player to distract every night. As soon as the night begins, a target will be picked randomly, but the player still can change the target to someone else (unless you are an evil theme maker and put "restrict" in the action too).
    Code (text):
    1. "night": {
    2.   "distract": {
    3.   "target": "AnyButSelf",
    4.   "common": "Self",
    5.   "priority": 1,
    6.   "compulsory": true
    7.   }
    8. }
    Important to note that the action will work as if the person had actually typed it, so it can be haxed, fail due to lack of charges/recharge and any other property you add (like restrict or broadcast) to it will still be in effect. The action will be used even if the player is not on channel/server when the night starts.

    Variable Vote (or Vote Bonus, not sure about how to call it): This feature allow a player to gain a permanent vote or voteshield bonus that sticks to them even if they change roles. The simplest way to explain it is with the Badge item on Shop theme: you gain a permanent bonus to your total vote.
    The code below increases the player's vote by 1 each time the player converts into this role.
    Code (text):
    1. "actions": {
    2.   "addVote": 1,
    3.   "updateVote": true
    4. }
    Important: This bonus is tied to the player, not the role. This means if you change into this role once, your vote will be 2 (roles's vote = 1, player's bonus = 1). If after converting into this role you change into a role with "vote": 3, you will still have your bonus, so your vote will count as 4. If you then convert back into the role in the example above, your bonus will be 2.

    Important 2: The bonus is applied everytime you convert into that role. You could easily have a role that can convert into itself to increase its own vote each time. Also important to note that the bonus is not applied when the game starts, only during conversions.

    Yet another important thing: Vote Bonus is not considered by villageCantLoseRoles. Maybe sometime in the future, but for now remember to keep in mind roles that can gain that bonus.

    Other than "addVote", you can also use "addVoteshield" (increases your "voteshield") and "setVote" or "setVoteshield" to change your bonus to a specific value (e.g.: If your bonus is 3, you could use "setVote": 0 to clear it).
    There's also "updateVote", which will show your current vote/voteshield bonus whenever you use /myrole (similar to updateCharges). Important to note that updateVote will only show the bonus, not the final vote, so if your current role has a vote of 1 and you have a bonus of 2, it will only show the +2.

    And now for the main course for this patch:

    Convert and Copy for Standby Actions: Another long-awaited feature is finally here. Kinda. Those are not new actions, but things you can add to existing standby actions. For example, you could have an expose action that converts the target after revealing them, or a daykill that makes the user copy into another role.

    The example below will make the Samurai copy into a Murderer when they successfully kill someone.
    Code (text):
    1. "actions": {
    2.   "standby": {
    3.   "kill": {
    4.   "target": "AnyButSelf",
    5.   "msg": "You can kill now using /kill [name] :",
    6.   "killmsg": "~Self~ pulls out a sword and strikes it through ~Target~'s chest!",
    7.   "copyAs": "murderer",
    8.   "copyusermsg": "You have blood in your hands. You are a murderer now!"
    9.   }
    10.   }
    11. }
    To use convert/copy with standby actions, all you need to do is add "newRole" (for convert) or "copyAs" (for copy). They will work exactly the same as their night counter-parts*, which means you can use something like
    Code (text):
    1. "newRole": {
    2.     "exposed_villager": ["villager"],
    3.     "exposed_mafia": ["mafia"]
    4. }
    Just the same way you would use for the night action.

    Important to note that the order is always Standby Action -> Copy -> Convert, so if you have both copyAs and newRole in an expose action, you will expose a player, then copy them, then convert them. Also note that even targets daykill can get converted (they convert before dying, useful if you want it to trigger some onDeath action).

    *Practically any property you can use for night copy/convert can also be used here (like silent or silentCopy), with a few exceptions:
    -"convertfailmsg" and "copyfailmsg" are not available. If the target cannot be converted/copied, the user will not receive any message at all mentioning it failed.
    -Instead of "usermsg", use "copyusermsg" or "convertusermsg".

    Other than those, you can use
    -For convert: newRole, canConvert, silent, convertmsg, convertusermsg, tarmsg
    -For copy: copyAs, canCopy, silent, copymsg, copyusermsg
     
    Last edited: Jun 4, 2015
    Pangaea and Fate Testarossa like this.
  35. Scatterbrain

    Scatterbrain You only live once*

    Joined:
    Jul 5, 2012
    Messages:
    865
    Likes Received:
    4
    Will compulsory work with limit?
     
  36. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Compulsory will only trigger for one target even if the action can be used more than once per night.
     
  37. Pangaea

    Pangaea resto en peaco

    Joined:
    Mar 20, 2014
    Messages:
    329
    Likes Received:
    46
    This would've been useful while I was coding Luigi and Boo in Mario :c Oh well, I'll leave them how they are, no need to fix what isn't broken, but I'm glad this has been implemented.
     
  38. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    Someone stop IceKirby he's coding new features like crazy!

    First a small fix:
    -Compulsory Actions will now be used more than once per night if the action can be used more than once too.

    Then some customizations features:
    -inputmsg now accepts ~Self~.
    -usermsg for copy now accepts ~Old~, ~New~ and lots of other parameters that were already available for copymsg too.
    -tarmsg for convert now accepts the same ~parameters~ as convertmsg.
    -If you are using both convert and copy in a same action, you can use 'convertusermsg' and 'copyusermsg' instead of 'usermsg'.
    -You can now use 'tiedvotemsg' and 'novotemsg' as global properties to customize the "No one was voted off!" message when a vote ties. 'novotemsg' appears when no vote has been cast at all (or the vote tied at 0), while 'tiedvotemsg' is used when 2 or more players tie with the same number of votes (higher than 0). For tiedvotemsg, you can use ~Players~ for the names and ~Count~ for the number of votes each received.

    And now for the actual new stuff:

    Dummy Pierce: Same as pierce, but only for Dummy commands. The reason they need a specific pierce property is because dummy is usually blocked by safeguard, but with this you can have actions still being blocked by safeguard, but the dummy messages still go through.
    The example below will broadcast 2 messages if the target is unguarded, but only the "Bwahaha" one if the target was safeguarded.
    Code (text):
    1. "poison": {
    2.     "command": ["poison", "dummy", "dummy2"],
    3.     "target": "AnyButSelf",
    4.     "common": "Self",
    5.     "priority": 10,
    6.     "dummybroadcastmsg": "~Target~ has been poisoned!",
    7.     "dummy2broadcastmsg": "BWAHAHA!",
    8.     "dummy2Pierce": true
    9. }
    You can use dummyPierce, dummy2Pierce, dummy3Pierce, etc. to set the pierce property for each dummy separately.

    Target for standby actions: Standby Actions now accept the same values for 'target' that night actions does. You could now have an expose that can only be used on teammates, or a daykill that can only be used on self (stupid, I know, but possible). This means standby actions now accept "OnlySelf", "OnlyTeam" and "OnlyTeammates" for its 'target' property.

    Max Hax: No, this is not meant to maximize hax. On the contrary, it sets a maximum number of times the command is susceptible to hax each night.
    With the code below, that player can only be haxed on the first 2 times it types /kill during each night. From the 3rd time onwards, they are protected from hax for that night.
    Code (text):
    1. "night": {
    2.     "kill": {
    3.         "target": "AnyButTeam",
    4.         "common": "Team",
    5.         "priority": 12,
    6.         "broadcast": "team",
    7.         "maxHax": 2
    8.     }
    9. }
    Important to note that this is set on a per-player and per-command basis. Which means if the action is shared, each of the players has their own count, and the count is separate if they have another haxable action.

    Mass Convert for Standby: After Copy and Convert for standby, why not massconvert too? It works exactly the same as the night version, and it triggers after day-copy and day-convert.
    The code below will convert Mafias into Villagers and vice-versa when the this role daykill.
    Code (text):
    1. "standby": {
    2.     "kill": {
    3.         "target": "AnyButSelf",
    4.         "msg": "You can kill now using /kill [name] :",
    5.         "killmsg": "~Self~ pulls out a sword and strikes it through ~Target~'s chest!",
    6.         "limit": 2,
    7.         "convertRoles": {
    8.             "villager": "mafia",
    9.             "mafia": "villager"
    10.         },
    11.         "singlemassconvertmsg": "THAT'S CRAZY! VILLAGER IS MAFIA AND MAFIA IS VILLAGER NOW!"
    12.     }
    13. }
    Now for the main course:
    Disguise: A new night action. It makes the target get inspected or exposed as a different role for a certain period.
    The code below allows a player to /disguise [name] during the night. If the target is Villager, Miller or Mayor, they will be inspected as Mafia; if they are Mafia or Mafia Boss, they will be inspected as Villager; if they are neither, they will be inspected as Bodyguard.
    Code (text):
    1. "night": {
    2.     "disguise": {
    3.         "target": "AnyButSelf",
    4.         "common": "Self",
    5.         "priority": 5,
    6.         "disguiseRole": {
    7.             "villager": ["mafia", "mafiaboss"],
    8.             "mafia": ["villager", "miller", "mayor"],
    9.             "auto": "bodyguard"
    10.         },
    11.         "disguiseCount": 2,
    12.         "disguisemsg": "You disguised your target (~Target~) as ~Disguise~!"
    13.     }
    14. }
    15.  
    disguiseRole is mandatory, and can be used in 3 different ways. If you use the method above, you must have the "auto" property. It will specify the default role the target will be disguised as in case it's not in the arrays above it.

    If you are looking for a simpler disguise, you can use "disguiseRole": "bodyguard" (no objects/arrays).
    This way the person will always be disguised as Bodyguard regardless if their role.

    The third option is the random disguise:
    Code (text):
    1.  
    2. "night": {
    3.     "disguise": {
    4.         "target": "AnyButSelf",
    5.         "common": "Self",
    6.         "priority": 5,
    7.         "disguiseRole": {
    8.                 "random": {
    9.                 "prettylady": 0.3,
    10.                 "bodyguard": 0.3,
    11.                 "mafia": 0.4
    12.         }
    13.    }
    14. }
    This will make the target have a 30% chance of being disguised as PL, 30% as BG and 40% as Mafia.

    Lastly, disguise also allows 2 more properties:
    'disguiseCount' defines how long the disguise gets active. It defaults to 1 (expires at the end of the night it was used), and if set to 2 or more it can make the disguise work for exposes too.
    'disguisemsg' allows you to customize the message you receive when the disguise is successfully applied.
    Important to note that the target will not know they have been disguised.
     
  39. Yttrium

    Yttrium Well-Known Member Developer Developer

    Joined:
    Sep 29, 2010
    Messages:
    619
    Likes Received:
    283
    PO Trainer Name:
    Yttrium
    Does evading daykills use up the daykiller's kill and prevent them from retargeting someone else/is it possible to do that?
     
  40. IceKirby

    IceKirby A.K.A. RiceKirby

    Joined:
    Apr 26, 2011
    Messages:
    2,176
    Likes Received:
    635
    PO Trainer Name:
    RiceKirby
    If you use a simple "daykill": "evade", then the daykiller still can pick another target. To make the daykill get used, you can use use evadeChance: 1.
     
    Fate Testarossa likes this.