1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Guest, PO has ceased our separate tiering and adopted Smogon tiers for SM. More information and updates here.

    Dismiss Notice

New Theme Coding Feature: Votemods

Discussion in 'Mafia' started by Veteran Padgett, Oct 14, 2018.

Moderators: heartbreaker, Water
  1. Veteran Padgett

    Veteran Padgett Daily Reminder... Developer Developer

    Joined:
    May 31, 2013
    Messages:
    294
    Likes Received:
    249
    PO Trainer Name:
    Veteran Padgett
    To get the second best sheep theme to work (after a few tries) I've coded a global votemod property which takes effect after the vote phase ends, but before anyone is lynched. I also, plan to add the ability to make these mods role specific. Let's have a look at the code from second best sheep.

    "votemods": [
    {
    "modtype": "votecountordinal",
    "ordinal": 2,
    "target": "votee",
    "effect": "add",
    "amount": 9999
    }
    ]

    This mod adds 9999 votes to the votees who have the second most votes. The main parts are the modtype, which will allow me to add different mods such as voter ordinal or vote count last later, and the effect which sets what will happen when the condition is met. Some other effects may be to multiply votes, or make someone immune to lynching.

    Global votemods apply to everyone, but when role votemods are added you will be able to do stuff like make a role that becomes kuja if they are the last to vote.

    I've only written "votecountordinal" and "votee" for now, but will add more in the future.

    I'm making this thread so that
    1) If you want to use a new votemod in your theme we can discuss how easy it would be to add, and I can prioritize which votemods to code next.
    2) People can pitch ideas for votemods and how the object should be structured to make it easier to write the JSON. It will be easier to code this if we have a better idea of the end result. If a new idea comes up when this is almost finished, parts of it may have to be rewritten to accommodate the new changes.
     
    heartbreaker likes this.
Moderators: heartbreaker, Water