Skip to content

Commit

Permalink
Merge pull request #13641 from bhuesemann/tor2e_03-13-00
Browse files Browse the repository at this point in the history
[Tor 2e] - added taint rating (new feature)
  • Loading branch information
NorWhal authored Jan 7, 2025
2 parents 46d4f3f + f1978af commit 576a1bd
Show file tree
Hide file tree
Showing 5 changed files with 42 additions and 13 deletions.
4 changes: 4 additions & 0 deletions The One Ring 2e/release-notes.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,10 @@ This is a rewrite based on the early 2e (basic) and 1e edition that also include

# Release History

## 03.13.00 (Build 35)

- added "Taint" of items that will add to shadow / scars and leads to miserable / ill-favoured rolls when >= hope / hope_max

## 03.12.00 (Build 34)

- added "Favoured" modifier for pc combat proficiencies to allow handling of specific cultural virtues (e.g. Hobbit Cultural Virtue Sure At The Mark)
Expand Down
45 changes: 34 additions & 11 deletions The One Ring 2e/sheet.html
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<input type="hidden" name="attr_version" value="03-12-00" />
<input type="hidden" name="attr_version" value="03-13-00" />
<input type="hidden" class="sheet-tabstoggle" name="attr_sheetTab" />
<input type="checkbox" name="attr_parsedrolls" value="1" class="hidden config-parsed-rolls" checked="checked" hidden
readonly />
Expand Down Expand Up @@ -238,8 +238,12 @@ <h1 data-i18n="heart" data-i18n-title="heart-description">Heart</h1>
<label data-i18n="shadow" class="right">Shadow</label>
<span class="diamond-small">
<span><input name="attr_shadow" value="0" type="number"></span></span>
<div></div>
<span class="diamond-small">
<div class="center">
<span class="diamond-small">
<span><input name="attr_taint" value="0" type="number"></span></span>
<label data-i18n="taint" data-i18n-title="taint-title" class="center">Taint</label>
</div>
<span class="diamond-small">
<span><input name="attr_shadowscar" value="0" type="number"></span></span>
<label data-i18n="scars" class="left">Scars</label>
</div>
Expand Down Expand Up @@ -1719,15 +1723,15 @@ <h2 data-i18n="notes">Notes</h2>

// ATTRIBUTES
const attrs = await asw.getAttrs([
"favorill", "weary", "miserable", "hope", "shadow", "shadowscar", "favourill_id",
"favorill", "weary", "miserable", "hope", "shadow", "shadowscar", "taint", "favourill_id",
"stanceattack_active", "stanceattackbonus", "stancedamagebonus", "whisper"
]);
let wearyStr = (attrs.weary == "on" || attrs.weary == 1) ? "{{weary=Weary}}" : "",
weary = (attrs.weary == "on" || attrs.weary == 1) ? 1 : 0;
miserableStr = (attrs.miserable == "on" || attrs.miserable == 1) ? "{{miserable=Miserable}}" : "",
miserable = (attrs.miserable == "on" || attrs.miserable == 1) ? 1 : 0,
hope = int(attrs.hope),
shadow = int(attrs.shadow) + int(attrs.shadowscars),
shadow = int(attrs.shadow) + int(attrs.shadowscars) + int(attrs.taint),
favourill_id = int(attrs.favourill_id),
stanceAttackActive = int(attrs.stanceattack_active),
stanceAttackBonus = int(attrs.stanceattackbonus),
Expand Down Expand Up @@ -2089,34 +2093,35 @@ <h2 data-i18n="notes">Notes</h2>
});

// calc miserable and favourill_id
on("change:hope change:shadow change:shadowscars change:favorill sheet:opened", () => {
getAttrs(["hope", "hope_max", "shadow", "shadowscar", "favourill_id", "favorill", "sheetTab" ], (values) => {
on("change:hope change:shadow change:shadowscars change:taint change:favorill sheet:opened", () => {
getAttrs(["hope", "hope_max", "shadow", "shadowscar", "taint", "favourill_id", "favorill", "sheetTab" ], (values) => {
if (values.sheetTab ==="isPC"){
const hope = int(values.hope),
hope_max = int(values.hope_max),
shadow = int(values.shadow),
scars = int(values.shadowscar),
taint = int(values.taint),
favorill = values.favorill,
favourill_id = int(values.favourill_id),
maxshadow = hope_max - scars;
// miserable
if ( (shadow + scars) >= hope ) {
if ( (shadow + scars + taint) >= hope ) {
setAttrs({
miserable: 1,
});
clog(`Set miserable based on shadow score: shadow ${shadow} + scars ${scars} higher than current hope ${hope}.`);
clog(`Set miserable based on shadow score: shadow ${shadow} + scars ${scars} + taint ${taint} higher than current hope ${hope}.`);
} else {
setAttrs({
miserable: 0,
});
};
// favourill
if ( (shadow + scars) >= hope_max || favorill === "{2t[feat]}kl1") {
if ( (shadow + scars + taint) >= hope_max || favorill === "{2t[feat]}kl1") {
setAttrs({
favourill_id: 0,
favorill : "{2t[feat]}kl1" // to make table rolls consistent
});
clog(`Set illfavoured rolls global state or shadow score: shadow ${shadow} + scars ${scars} higher than maximum hope ${hope_max}.`);
clog(`Set illfavoured rolls global state or shadow score: shadow ${shadow} + scars ${scars} + taint ${taint} higher than maximum hope ${hope_max}.`);
} else if (favorill === "{1t[feat]}"){
setAttrs({
favourill_id: 1,
Expand Down Expand Up @@ -3204,6 +3209,24 @@ <h2 data-i18n="notes">Notes</h2>
});
}
}
if (build < 35) {
attrs["build"] = 35;
let releaselog = {msg:""};
hlog(`Release 03.13.00 - ${new Date().toLocaleString()}`, releaselog);
if (v.sheettab === "isPC"){
getAttrs(['releaselog'], function(values){
hlog(`
### New
- added "Taint" of items that will add to shadow / scars and leads to miserable / ill-favoured state when >= hope / hope_max
`, releaselog);
hlog("==============", releaselog);
attrs['releaselog'] = releaselog.msg + values['releaselog'];
if (Object.keys(attrs).length) {
setAttrs(attrs);
}
});
}
}
/*
if (build === 9) {
attrs["build"] = 8;
Expand Down
2 changes: 1 addition & 1 deletion The One Ring 2e/sheet.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"title": "The One Ring 2e",
"version": "3.12.0",
"version": "3.13.0",
"html": "sheet.html",
"css": "sheet.css",
"authors": "Bodo Hüsemann, Richard W, Michael (aka Aragent) I, Paul Venner, Michael Heilemann, Stefan Unterhuber, Stuart Johnson, David Domínguez, Eric Le Bourvellec",
Expand Down
Binary file modified The One Ring 2e/sheet.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 3 additions & 1 deletion The One Ring 2e/translation.json
Original file line number Diff line number Diff line change
Expand Up @@ -264,5 +264,7 @@
"daunted": "Daunted",
"daunted-title": "If you are daunted, you can't spend hope!",
"name": "Name",
"darkmode": "Dark Mode"
"darkmode": "Dark Mode",
"taint": "Taint",
"taint-title": "Taint of items adds to the shadow points of the character"
}

0 comments on commit 576a1bd

Please sign in to comment.