added dice reset, player and gm

This commit is contained in:
Steve Day
2014-08-18 12:34:10 -05:00
parent 7dcd322d94
commit f166323344
2 changed files with 164 additions and 1 deletions
+4 -1
View File
@@ -82,7 +82,8 @@
<input type="hidden" name="attr_dicePool" value=" @{g}g @{y}y @{p}p @{r}r @{b}b @{blk}blk @{w}w upgrade(ability|@{upgradeAbility}) downgrade(proficiency|@{downgradeProficiency}) upgrade(difficulty|@{upgradeDifficulty}) downgrade(challenge|@{downgradeChallenge})"/>
<button type='roll' name='roll_DicePool' value='!eed characterID(@{characterID}) label(Dice Pool) @{dicePool} @{-dicepool|dicepoolgm}'></button>
<button type='roll' name='roll_ResetDicePool' value='!eed resetdice characterID(@{characterID})'></button>
</td>
<td colspan="3" class="sheet-downgrade sheet-dark">
<label>&nbsp;&nbsp;&nbsp;&nbsp;Upgrade:
@@ -4781,6 +4782,8 @@
<input type="hidden" name="attr_dicePoolgm" value=" @{ggm}g @{ygm}y @{pgm}p @{rgm}r @{bgm}b @{blkgm}blk @{wgm}w upgrade(ability|@{upgradeAbilitygm}) downgrade(proficiency|@{downgradeProficiencygm}) upgrade(difficulty|@{upgradeDifficultygm}) downgrade(challenge|@{downgradeChallengegm})"/>
<button type='roll' name='roll_DicePoolgm' value='!eed @{dicePoolgm}'></button>
<button type='roll' name='roll_ResetGMDicePool' value='!eed resetgmdice characterID(@{characterID})'></button>
</td>
<td colspan="3" class="sheet-downgrade sheet-dark">
+160
View File
@@ -103,6 +103,7 @@
log : /log (on|multi|single|off)/,
graphics : /graphics (on|off|s|m|l)/,
test : /test/,
resetdice : /(resetgmdice|resetdice)/,
initiative : /\bnpcinit|\bpcinit/,
characterID : /characterID\((.*?)\)/,
label : /label\((.*?)\)/,
@@ -380,6 +381,13 @@
* Description: Custom dice components have thier own message, results and
* often will return false to not allow proceeding scripts to fire
* --------------------------------------------------------------*/
var resetdiceMatch = cmd.match(eote.defaults.regex.resetdice);
if (resetdiceMatch) {
eote.process.resetdice(resetdiceMatch, diceObj);
return false;
}
var initiativeMatch = cmd.match(eote.defaults.regex.initiative);
if (initiativeMatch) {
@@ -539,6 +547,158 @@
}
eote.process.resetdice = function(cmd, diceObj){
var characterObj = [{name: diceObj.vars.characterName, id: diceObj.vars.characterID}];
//log(cmd);
if (cmd[1] == 'resetdice') {
var resetdice = [
{
name : "b",
current : 0,
max : "",
update : true
},
{
name : "g",
current : 0,
max : "",
update : true
},
{
name : "y",
current : 0,
max : "",
update : true
},
{
name : "blk",
current : 0,
max : "",
update : true
},
{
name : "r",
current : 0,
max : "",
update : true
},
{
name : "p",
current : 0,
max : "",
update : true
},
{
name : "w",
current : 0,
max : "",
update : true
},
{
name : "upgradeAbility",
current : 0,
max : "",
update : true
},
{
name : "downgradeProficiency",
current : 0,
max : "",
update : true
},
{
name : "upgradeDifficulty",
current : 0,
max : "",
update : true
},
{
name : "downgradeChallenge",
current : 0,
max : "",
update : true
}
]
}
if (cmd[1] == 'resetgmdice') {
var resetdice = [
{
name : "bgm",
current : 0,
max : "",
update : true
},
{
name : "ggm",
current : 0,
max : "",
update : true
},
{
name : "ygm",
current : 0,
max : "",
update : true
},
{
name : "blkgm",
current : 0,
max : "",
update : true
},
{
name : "rgm",
current : 0,
max : "",
update : true
},
{
name : "pgm",
current : 0,
max : "",
update : true
},
{
name : "wgm",
current : 0,
max : "",
update : true
},
{
name : "upgradeAbilitygm",
current : 0,
max : "",
update : true
},
{
name : "downgradeProficiencygm",
current : 0,
max : "",
update : true
},
{
name : "upgradeDifficultygm",
current : 0,
max : "",
update : true
},
{
name : "downgradeChallengegm",
current : 0,
max : "",
update : true
}
]
}
eote.updateAddAttribute(characterObj, resetdice);
}
eote.process.initiative = function(cmd, diceObj){
/* initiative