Gestire l'iniziativa in Dungeons & Dragons con MapTool


 

 

I combattimenti sono una delle parti più complesse da gestire per un DM di Dungeons & Dragons.

In questo video vi mostro tre diversi modi per gestire l'iniziativa.

Di seguito potete trovare il testo delle macro descritte nel video.

 

 Iniziativa1.txt

[h: m_initiativeCache = "{}"]
[h, foreach(m_tokenId, getSelected("json")), code: {
    [m_tokenImageId = getTokenImage("", m_tokenId)]
    
    [if(json.contains(m_initiativeCache, m_tokenImageId) != 0), code: {
        [m_initiative = json.get(m_initiativeCache, m_tokenImageId)]
    };
    {
         [m_roll = 1d20]
        [dex = getProperty("Dexterity", m_tokenId)]
        [dex_mod = math.ceil((dex - 10) / 2)]
        [m_initiative = m_roll + dex_mod]
        [m_initiative = m_initiative + (dex_mod / 100)]
        [m_initiativeCache = json.set(m_initiativeCache, m_tokenImageId, m_initiative)]
    }]
    [addToInitiative(0, m_initiative, m_tokenId)]
}]

[h: sortInitiative()]
[h,foreach(m_tokenId, getSelected("json")), code: {
    [m_initiative = getInitiative(m_tokenId)]
    [m_initiative = floor(m_initiative)]
    [setInitiative(m_initiative, m_tokenId)]
}]


Iniziativa2.txt

[h: m_initiativeCache = "{}"]
[h, foreach(m_tokenId, getSelected("json")), code: {
    [m_tokenImageId = getTokenImage("", m_tokenId)]
    [if (isPC(m_tokenId)), code: {
        [abort(input("m_roll|0|Iniziativa per " + getName(m_tokenId)))]
        [m_initiativeCache = json.set(m_initiativeCache, m_tokenImageId, m_roll)]
    }]
 
    [if(json.contains(m_initiativeCache, m_tokenImageId) != 0), code: {
        [m_initiative = json.get(m_initiativeCache, m_tokenImageId)]
    };
    {
         [m_roll = 1d20]
        [dex = getProperty("Dexterity", m_tokenId)]
        [dex_mod = math.ceil((dex - 10) / 2)]
        [m_initiative = m_roll + dex_mod]
        [m_initiative = m_initiative + (dex_mod / 100)]
        [m_initiativeCache = json.set(m_initiativeCache, m_tokenImageId, m_initiative)]
    }]
    [addToInitiative(0, m_initiative, m_tokenId)]
}]

[h: sortInitiative()]
[h,foreach(m_tokenId, getSelected("json")), code: {
    [m_initiative = getInitiative(m_tokenId)]
    [m_initiative = floor(m_initiative)]
    [setInitiative(m_initiative, m_tokenId)]
}]

Comments

Popular posts from this blog

Trenitalia e gli Eurostar

Magicworks and patrons

Lo stato laico