* Repeating section items now can be dragged to macro quick bar

* Removed HP-lvlmod from sheet and autocalc hp_max with worker (fixes issues with HP recalc and tokens)
* Additional to STR and DEX also INT, WIS and CHA may be used as ability mods for basic attacks
This commit is contained in:
Thomas Seliger
2016-06-10 18:46:07 +02:00
parent 36d59e14d2
commit 3d91e95805
6 changed files with 85 additions and 85 deletions
+1 -1
View File
@@ -1,4 +1,4 @@
/* version: 1.5.1 */
/* version: 1.7.0 */
.sheet-13thAge {
padding-top: 10px;
+36 -17
View File
@@ -1,4 +1,4 @@
<!-- version: 1.5.1 -->
<!-- version: 1.7.0 -->
<div style="display:none;">
<b style="color:red;font-size:150%;">Attention: </b>
@@ -108,6 +108,9 @@
<select name="attr_BM-mod" style="width:3.25em;display:inlineblock;">
<option value="@{STR-mod}">STR</option>
<option value="@{DEX-mod}">DEX</option>
<option value="@{INT-mod}">INT</option>
<option value="@{WIS-mod}">WIS</option>
<option value="@{CHA-mod}">CHA</option>
</select>
</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{BM-misc}" type="number" name="attr_BM-misc" value="0"></span>
@@ -125,6 +128,9 @@
<select name="attr_BMDMG-mod" style="width:3.25em;display:inlineblock;">
<option value="@{STR-mod}">STR</option>
<option value="@{DEX-mod}">DEX</option>
<option value="@{INT-mod}">INT</option>
<option value="@{WIS-mod}">WIS</option>
<option value="@{CHA-mod}">CHA</option>
</select>
</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{BMDMG-misc}" type="number" name="attr_BMDMG-misc" value="0"></span>
@@ -166,6 +172,9 @@
<select name="attr_BR-mod" style="width:3.25em;display:inlineblock;">
<option value="@{DEX-mod}">DEX</option>
<option value="@{STR-mod}">STR</option>
<option value="@{INT-mod}">INT</option>
<option value="@{WIS-mod}">WIS</option>
<option value="@{CHA-mod}">CHA</option>
</select>
</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{BR-misc}" type="number" name="attr_BR-misc" value="0"></span>
@@ -183,6 +192,9 @@
<select name="attr_BRDMG-mod" style="width:3.25em;display:inlineblock;">
<option value="@{DEX-mod}">DEX</option>
<option value="@{STR-mod}">STR</option>
<option value="@{INT-mod}">INT</option>
<option value="@{WIS-mod}">WIS</option>
<option value="@{CHA-mod}">CHA</option>
</select>
</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{BRDMG-misc}" type="number" name="attr_BRDMG-misc" value="0"></span>
@@ -275,11 +287,7 @@
<span class="sheet-table-header sheet-table-padding">HP</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{HP}" type="number" name="attr_HP" value="10"></span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{HP-temp}" type="number" name="attr_HP-temp" value="0"></span>
<span class="sheet-table-data sheet-left">
<input style="width:100%;" title="@{HP-lvlmod}" name="attr_HP-lvlmod" value="0" type="hidden" />
<input style="width:100%;" title="@{HP-formula}" name="attr_HP-formula" value="((@{HP-base}+((@{CON-mod})+abs((@{CON-mod})))/2)*@{HP-lvlmod})+@{HP-misc}" type="hidden" />
<input style="width:100%;" class="sheet-total sheet-center" title="@{HP_max}" type="number" name="attr_HP_max" value="@{HP-formula}" disabled="true">
</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{HP_max}" type="number" name="attr_HP_max" readonly="readonly" /></span>
<span class="sheet-table-data sheet-table-padding"></span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{HP-base}" type="number" name="attr_HP-base" value="10"></span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{HP-misc}" type="number" name="attr_HP-misc" value="0"></span>
@@ -413,7 +421,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_class-feature_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -467,7 +475,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_talent_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -521,7 +529,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_power_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -575,7 +583,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_feat_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -609,6 +617,7 @@
<option value="[[1d6cs=6cf=5]] [[1d6cs=6cf=5]]">2</option>
<option value="[[1d6cs=6cf=5]] [[1d6cs=6cf=5]] [[1d6cs=6cf=5]]">3</option>
<option value="[[1d6cs=6cf=5]] [[1d6cs=6cf=5]] [[1d6cs=6cf=5]] [[1d6cs=6cf=5]]">4</option>
<option value="[[0d6cs=6cf=5]]">none</option>
</select>
</span>
<span style="width:20%" class="sheet-table-data sheet-center">
@@ -693,7 +702,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_magic-item_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -935,7 +944,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_npcpower_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -966,7 +975,7 @@
</div>
</div>
</div>
<div style="font-size:8px" class="sheet-right"><br>Sheet Version: 1.5.1</div>
<div style="font-size:8px" class="sheet-right"><br>Sheet Version: 1.7.0</div>
</div>
<!-- roll templates -->
@@ -1038,15 +1047,25 @@
<!-- WORKERS -->
<script type="text/worker">
on("change:level", function() {
getAttrs(["level"], function(v) {
on("change:level change:con-base change:con-misc change:con-item change:hp-base change:hp-misc sheet:opened", function() {
getAttrs(["level", "con-base", "con-misc", "con-item", "hp-base", "hp-misc"], function(v) {
level = v["level"] && isNaN(v["level"]) === false ? parseInt(v["level"], 10) : 1;
con_base = v["con-base"] && isNaN(v["con-base"]) === false ? parseInt(v["con-base"], 10) : 1;
con_misc = v["con-misc"] && isNaN(v["con-misc"]) === false ? parseInt(v["con-misc"], 10) : 1;
con_item = v["con-item"] && isNaN(v["con-item"]) === false ? parseInt(v["con-item"], 10) : 1;
hp_base = v["hp-base"] && isNaN(v["hp-base"]) === false ? parseInt(v["hp-base"], 10) : 1;
hp_misc = v["hp-misc"] && isNaN(v["hp-misc"]) === false ? parseInt(v["hp-misc"], 10) : 1;
if (level < 5) {lvlmod = level + 2;}
else if (level < 8) {lvlmod = ((level-4)*2) + 6;}
else {lvlmod = ((level-7)*4) + 12;};
console.log("setting HP-lvlmod" + lvlmod);
con_mod = Math.floor((con_base + con_misc + con_item) / 2) - 5;
console.log("lvlmod: " + lvlmod);
console.log("con_mod: " + con_mod);
console.log("hp_base: " + hp_base);
console.log("hp_misc: " + hp_misc);
hp_max = ((hp_base + ((con_mod + Math.abs(con_mod)) / 2)) * lvlmod) + hp_misc;
setAttrs({
"HP-lvlmod": lvlmod
"HP_max": hp_max
});
});
});
+12 -50
View File
@@ -1,59 +1,14 @@
# A new 13th Age Character Sheet for roll20.net
* [View Interactive Sheet Preview](http://neovatar.github.io/roll20-character-sheets/13th_Age-neovatar/testbed/)
* [Character sheets documentation in the Roll20 wiki](https://wiki.roll20.net/13th_Age_Character_Sheet_neovatar)
# A 13th Age Character Sheet for roll20.net
### Usage
This character sheet requires a modern web browser.
Please check the [character sheets documentation](https://wiki.roll20.net/13th_Age_Character_Sheet_neovatar) in the roll20 wiki.
#### Escalation Die Macro
### Preview
##### Default: Ask for Escalation Die value
[View Interactive Sheet Preview](http://neovatar.github.io/roll20-character-sheets/13th_Age-neovatar/testbed/)
You can define an escalation die macro in the sheets SETUP tab. The default value is:
```
?{Escalation die value|0}
```
This will ask the player to enter the escalation die value, before the roll is made. The basic melee and ranged attacks use this.
You can also use the escalation die macro in you own definitions via the ```@{escdie}``` attribute. The following sheet macro example will roll a d20 and add the escalation die value:
```
***Roll d20 and add escalation die***
[[1d20+@{escdie}]]
```
##### Advanced: Use Escalation Die Token
The basic idea is described in a [Youtube session with Roll20 devs Richard and Riley](https://www.youtube.com/watch?t=434&v=ODh7PN3DVcs).
###### Prepare the Escalation Die Token
* create a character named "Escalation Die"
* allow all players to view / edit this character (**This is important!!!**)
* via "Edit" -> "Attributes & Abilities", add an attribute "die"
* use a nifty die graphic as token image
* connect the escalation die token with the character "Escalation Die"
* set one of the bars to track the attribute "die"
* click on the token and enter the correct escalation die value in the bar
###### Use the Escalation Die Token
Now update all character sheets to use the "Escalation Die" character’s "die" value as escalation die: Go to "SETUP" Tab on your character sheet and enter the following as "Escalation die macro":
```
@{Escalation Die|die}
```
Now the basic attacks and the use of ```@{escdie}``` will pull the escalation die value from the escalation die token.
Don't forget to update the escalation die value each round.
#### Bugs and Suggestions
### Bugs and Suggestions
Report bugs or suggestions to the project’s [issue tracker](https://github.com/neovatar/roll20-character-sheets/issues).
@@ -94,7 +49,14 @@ This will create `13th_Age-neovatar.[css|html]` that you can copy and paste into
### Changelog
**1.7.0:**
* Repeating section items now can be dragged to macro quick bar
* Removed HP-lvlmod from sheet and autocalc hp_max with worker (fixes issues with HP recalc and tokens)
* Additional to STR and DEX also INT, WIS and CHA may be used as ability mods for basic attacks
**1.5.0:**
* Sheet workers are used to calculate HP per level and removed HP lvlmod field
**1.4.2:**
+1 -1
View File
@@ -1,6 +1,6 @@
{
"title": "13th Age Roll 20 Character Sheet - neovatar edition",
"version": "1.5.1",
"version": "1.7.0",
"name": "roll20-13th_Age-neovatar",
"author": {
"name": "Thomas Seliger"
+1 -1
View File
@@ -4,5 +4,5 @@
"authors": "Thomas Seliger (neovatar)",
"roll20userid": "388327",
"preview": "13th_Age-neovatar.jpg",
"instructions": "New edition of a 13th Age character sheet with some automation.\n\nVersion: 1.5.1\n\nIf you find bugs or have suggestions, please use the [Github issue tracker](https://github.com/neovatar/roll20-character-sheets/issues) for this sheet.\n\nFor changes in this version, please check the [CHANGELOG](https://github.com/Roll20/roll20-character-sheets/blob/master/13th_Age-neovatar/README.md#changelog) on Roll20.net Github repository."
"instructions": "New edition of a 13th Age character sheet with some automation.\n\nVersion: 1.7.0\n\nIf you find bugs or have suggestions, please use the [Github issue tracker](https://github.com/neovatar/roll20-character-sheets/issues) for this sheet.\n\nFor changes in this version, please check the [CHANGELOG](https://github.com/Roll20/roll20-character-sheets/blob/master/13th_Age-neovatar/README.md#changelog) on Roll20.net Github repository."
}
+34 -15
View File
@@ -108,6 +108,9 @@
<select name="attr_BM-mod" style="width:3.25em;display:inlineblock;">
<option value="@{STR-mod}">STR</option>
<option value="@{DEX-mod}">DEX</option>
<option value="@{INT-mod}">INT</option>
<option value="@{WIS-mod}">WIS</option>
<option value="@{CHA-mod}">CHA</option>
</select>
</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{BM-misc}" type="number" name="attr_BM-misc" value="0"></span>
@@ -125,6 +128,9 @@
<select name="attr_BMDMG-mod" style="width:3.25em;display:inlineblock;">
<option value="@{STR-mod}">STR</option>
<option value="@{DEX-mod}">DEX</option>
<option value="@{INT-mod}">INT</option>
<option value="@{WIS-mod}">WIS</option>
<option value="@{CHA-mod}">CHA</option>
</select>
</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{BMDMG-misc}" type="number" name="attr_BMDMG-misc" value="0"></span>
@@ -166,6 +172,9 @@
<select name="attr_BR-mod" style="width:3.25em;display:inlineblock;">
<option value="@{DEX-mod}">DEX</option>
<option value="@{STR-mod}">STR</option>
<option value="@{INT-mod}">INT</option>
<option value="@{WIS-mod}">WIS</option>
<option value="@{CHA-mod}">CHA</option>
</select>
</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{BR-misc}" type="number" name="attr_BR-misc" value="0"></span>
@@ -183,6 +192,9 @@
<select name="attr_BRDMG-mod" style="width:3.25em;display:inlineblock;">
<option value="@{DEX-mod}">DEX</option>
<option value="@{STR-mod}">STR</option>
<option value="@{INT-mod}">INT</option>
<option value="@{WIS-mod}">WIS</option>
<option value="@{CHA-mod}">CHA</option>
</select>
</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{BRDMG-misc}" type="number" name="attr_BRDMG-misc" value="0"></span>
@@ -275,11 +287,7 @@
<span class="sheet-table-header sheet-table-padding">HP</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{HP}" type="number" name="attr_HP" value="10"></span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{HP-temp}" type="number" name="attr_HP-temp" value="0"></span>
<span class="sheet-table-data sheet-left">
<input style="width:100%;" title="@{HP-lvlmod}" name="attr_HP-lvlmod" value="0" type="hidden" />
<input style="width:100%;" title="@{HP-formula}" name="attr_HP-formula" value="((@{HP-base}+((@{CON-mod})+abs((@{CON-mod})))/2)*@{HP-lvlmod})+@{HP-misc}" type="hidden" />
<input style="width:100%;" class="sheet-total sheet-center" title="@{HP_max}" type="number" name="attr_HP_max" value="@{HP-formula}" disabled="true">
</span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{HP_max}" type="number" name="attr_HP_max" readonly="readonly" /></span>
<span class="sheet-table-data sheet-table-padding"></span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{HP-base}" type="number" name="attr_HP-base" value="10"></span>
<span class="sheet-table-data sheet-left"><input style="width:100%;" class="sheet-total sheet-center" title="@{HP-misc}" type="number" name="attr_HP-misc" value="0"></span>
@@ -413,7 +421,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_class-feature_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -467,7 +475,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_talent_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -521,7 +529,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_power_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -575,7 +583,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_feat_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -609,6 +617,7 @@
<option value="[[1d6cs=6cf=5]] [[1d6cs=6cf=5]]">2</option>
<option value="[[1d6cs=6cf=5]] [[1d6cs=6cf=5]] [[1d6cs=6cf=5]]">3</option>
<option value="[[1d6cs=6cf=5]] [[1d6cs=6cf=5]] [[1d6cs=6cf=5]] [[1d6cs=6cf=5]]">4</option>
<option value="[[0d6cs=6cf=5]]">none</option>
</select>
</span>
<span style="width:20%" class="sheet-table-data sheet-center">
@@ -693,7 +702,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_magic-item_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -935,7 +944,7 @@
<br>&nbsp;Daily uses left
</span>
<span class="sheet-table-data sheet-right">
<button class="sheet-round-button" type="roll" value="@{macro-text}"></button>
<button name="attr_roll" title="%{selected|repeating_npcpower_$X_roll}" class="sheet-round-button" type="roll" value="@{macro-text}"></button>
</span>
</div>
</div>
@@ -1038,15 +1047,25 @@
<!-- WORKERS -->
<script type="text/worker">
on("change:level", function() {
getAttrs(["level"], function(v) {
on("change:level change:con-base change:con-misc change:con-item change:hp-base change:hp-misc sheet:opened", function() {
getAttrs(["level", "con-base", "con-misc", "con-item", "hp-base", "hp-misc"], function(v) {
level = v["level"] && isNaN(v["level"]) === false ? parseInt(v["level"], 10) : 1;
con_base = v["con-base"] && isNaN(v["con-base"]) === false ? parseInt(v["con-base"], 10) : 1;
con_misc = v["con-misc"] && isNaN(v["con-misc"]) === false ? parseInt(v["con-misc"], 10) : 1;
con_item = v["con-item"] && isNaN(v["con-item"]) === false ? parseInt(v["con-item"], 10) : 1;
hp_base = v["hp-base"] && isNaN(v["hp-base"]) === false ? parseInt(v["hp-base"], 10) : 1;
hp_misc = v["hp-misc"] && isNaN(v["hp-misc"]) === false ? parseInt(v["hp-misc"], 10) : 1;
if (level < 5) {lvlmod = level + 2;}
else if (level < 8) {lvlmod = ((level-4)*2) + 6;}
else {lvlmod = ((level-7)*4) + 12;};
console.log("setting HP-lvlmod" + lvlmod);
con_mod = Math.floor((con_base + con_misc + con_item) / 2) - 5;
console.log("lvlmod: " + lvlmod);
console.log("con_mod: " + con_mod);
console.log("hp_base: " + hp_base);
console.log("hp_misc: " + hp_misc);
hp_max = ((hp_base + ((con_mod + Math.abs(con_mod)) / 2)) * lvlmod) + hp_misc;
setAttrs({
"HP-lvlmod": lvlmod
"HP_max": hp_max
});
});
});