Last active
October 31, 2020 19:38
-
-
Save BoltsJ/33cb0d6a442f31eb3f5e46739bf35ada to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Overheating", | |
"sort": 100001, | |
"flags": { | |
"exportSource": { | |
"world": "gfr", | |
"system": "lancer", | |
"coreVersion": "0.7.5", | |
"systemVersion": "0.1.12" | |
} | |
}, | |
"img": "systems/lancer/assets/icons/reactor.svg", | |
"description": "", | |
"results": [ | |
{ | |
"_id": "VSALejrdY5KOxRiS", | |
"flags": {}, | |
"type": 0, | |
"text": "<div class=\"lancer-stat-header clipped-top\">// IRREVERSIBLE MELTDOWN //</div><div class=\"effect-text\"><p>The reactor goes critical – your mech suffers a <b>reactor meltdown</b> at the end of your next turn.</p></div>", | |
"img": "systems/lancer/assets/icons/reactor.svg", | |
"resultId": "", | |
"weight": 1, | |
"range": [ | |
0, | |
0 | |
], | |
"drawn": false | |
}, | |
{ | |
"_id": "xYgdswXH5Eu06b3L", | |
"flags": {}, | |
"type": 0, | |
"text": "<div class=\"lancer-stat-header clipped-top\">// MELTDOWN //</div><p>The result depends on your mech’s remaining STRESS:</p> <p><b>3+ STRESS:</b> Your mech becomes EXPOSED.</p> <p><b>2 STRESS:</b> Roll an ENGINEERING check. On a success, your mech is EXPOSED ; on a failure, it suffers a reactor meltdown after 1d6 of your turns (rolled by the GM). A reactor meltdown can be prevented by retrying the ENGINEERING check as a free action.</p> <p><b>1 STRESS:</b> Your mech suffers a reactor meltdown at the end of your next turn.</p>", | |
"img": "systems/lancer/assets/icons/reactor.svg", | |
"resultId": "", | |
"weight": 1, | |
"range": [ | |
1, | |
1 | |
], | |
"drawn": false | |
}, | |
{ | |
"_id": "OZv2Y6dO2SRiHXiK", | |
"flags": {}, | |
"type": 0, | |
"text": "<div class=\"lancer-stat-header clipped-top\">// DESTABILIZED POWER PLANT //</div> <p>The power plant becomes unstable, beginning to eject jets of plasma. Your mech becomes EXPOSED , taking double kinetic, explosive and energy damage until the status is cleared.</p>", | |
"img": "systems/lancer/assets/icons/reactor.svg", | |
"resultId": "", | |
"weight": 1, | |
"range": [ | |
2, | |
4 | |
], | |
"drawn": false | |
}, | |
{ | |
"_id": "XowQ1Q5nsA2fA5Me", | |
"flags": {}, | |
"type": 0, | |
"text": "<div class=\"lancer-stat-header clipped-top\">// EMERGENCY SHUNT //</div><p>Your mech’s cooling systems manage to contain the increasing heat; however, your mech becomes IMPAIRED until the end of your next turn.</p>", | |
"img": "systems/lancer/assets/icons/reactor.svg", | |
"resultId": "", | |
"weight": 1, | |
"range": [ | |
5, | |
6 | |
], | |
"drawn": false | |
} | |
], | |
"formula": "1d6kl1", | |
"replacement": true, | |
"displayRoll": true, | |
"_id": "afsQUcSKkwQwYzZw" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{ | |
"name": "Structure Damage", | |
"sort": 100001, | |
"flags": { | |
"exportSource": { | |
"world": "gfr", | |
"system": "lancer", | |
"coreVersion": "0.7.5", | |
"systemVersion": "0.1.12" | |
} | |
}, | |
"img": "systems/lancer/assets/icons/structure.svg", | |
"results": [ | |
{ | |
"_id": "VSALejrdY5KOxRiS", | |
"flags": {}, | |
"type": 0, | |
"text": "<div class=\"lancer-stat-header clipped-top\">// CRUSHING HIT //</div><div class=\"effect-text\"><p>Your mech is damaged beyond repair – it is destroyed. You may still exit it as normal.</p></div>", | |
"img": "systems/lancer/assets/icons/structure.svg", | |
"resultId": "", | |
"weight": 1, | |
"range": [ | |
0, | |
0 | |
], | |
"drawn": false | |
}, | |
{ | |
"_id": "xYgdswXH5Eu06b3L", | |
"flags": {}, | |
"type": 0, | |
"text": "<div class=\"lancer-stat-header clipped-top\">// DIRECT HIT //</div> <p>The result depends on your mech’s remaining STRUCTURE: </p> <p><b>3+ STRUCTURE:</b> Your mech is STUNNED until the end of your next turn. </p> <p><b>2 STRUCTURE:</b> Roll a HULL check. On a success, your mech is STUNNED until the end of your next turn. On a failure, your mech is destroyed. </p> <p><b>1 STRUCTURE:</b> Your mech is destroyed. </p>", | |
"img": "systems/lancer/assets/icons/structure.svg", | |
"resultId": "", | |
"weight": 1, | |
"range": [ | |
1, | |
1 | |
], | |
"drawn": false | |
}, | |
{ | |
"_id": "OZv2Y6dO2SRiHXiK", | |
"flags": {}, | |
"type": 0, | |
"text": "<div class=\"lancer-stat-header clipped-top\">// SYSTEM TRAUMA //</div> <p>Parts of your mech are torn off by the damage. </p> <p>[[ 1d6 ]]: On a <b>1–3</b>, all weapons on one mount of your choice are destroyed; on a <b>4–6</b>, a system of your choice is destroyed. <b>LIMITED</b> systems and weapons that are out of charges are not valid choices. If there are no valid choices remaining, it becomes the other result. If there are no valid systems or weapons remaining, this result becomes a <b>DIRECT HIT</b> instead</p>", | |
"img": "systems/lancer/assets/icons/structure.svg", | |
"resultId": "", | |
"weight": 1, | |
"range": [ | |
2, | |
4 | |
], | |
"drawn": false | |
}, | |
{ | |
"_id": "XowQ1Q5nsA2fA5Me", | |
"flags": {}, | |
"type": 0, | |
"text": "<div class=\"lancer-stat-header clipped-top\">// GLANCING BLOW //</div> <p>Emergency systems kick in and stabilize your mech, but it’s IMPAIRED until the end of your next turn.</p>", | |
"img": "systems/lancer/assets/icons/structure.svg", | |
"resultId": "", | |
"weight": 1, | |
"range": [ | |
5, | |
6 | |
], | |
"drawn": false | |
} | |
], | |
"replacement": true, | |
"displayRoll": true, | |
"_id": "0RuZFhjly6kNE9oZ", | |
"description": "", | |
"formula": "1d6kl1", | |
"resultId": "" | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async ()=>{ | |
let table = game.tables.entities.find( | |
t => t.name === "Overheating" | |
); | |
if (canvas.tokens.controlled.length !== 1) { | |
ui.notifications.error("Select one and only one token"); | |
return; | |
} | |
let actor = canvas.tokens.controlled[0].actor; | |
if (!("mech" in actor.data.data)) { | |
ui.notifications.error("Selected token is not a mech"); | |
return; | |
} | |
if (actor.data.data.mech.stress.value === | |
actor.data.data.mech.stress.max) { | |
ui.notifications.error("Selected token is at full stress"); | |
return; | |
} | |
let damage = actor.data.data.mech.stress.max | |
- actor.data.data.mech.stress.value; | |
let roll = new Roll(`${damage}d6kl1`); | |
let result = table.roll({roll: roll}); | |
let total = result.roll.total; | |
let tt = await result.roll.getTooltip(); | |
let text = result.results[0].text; // as normal | |
// Crushing hits | |
let one_count = result.roll.terms[0].results.reduce((a, v) => { | |
return v.result === 1 ? a + 1 : a; | |
}, 0); | |
if (one_count > 1) { | |
text = table.results[0].text; | |
total = "Multiple 1s"; | |
} | |
let card = ` | |
<div class="card clipped-bot" style="margin: 0px;"> | |
<div class="lancer-stat-header clipped-top">// OVERHEATING //</div> | |
<div class="dice-roll lancer-dice-roll"> | |
<div class="dice-result"> | |
<div class="dice-formula lancer-dice-formula flexrow"> | |
<span style="text-align: left; margin-left: 5px;">${result.roll.formula}</span> | |
<span class="dice-total lancer-dice-total major">${total}</span> | |
</div> | |
<div style="text-align: left;"> | |
${tt} | |
</div> | |
</div> | |
</div> | |
${text} | |
</div> | |
` | |
ChatMessage.create( | |
{ | |
roll: result.roll, | |
speaker: ChatMessage.getSpeaker(), | |
content: card | |
} | |
); | |
})(); |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
(async ()=>{ | |
let table = game.tables.entities.find( | |
t => t.name === "Structure Damage" | |
); | |
if (canvas.tokens.controlled.length !== 1) { | |
ui.notifications.error("Select one and only one token"); | |
return; | |
} | |
let actor = canvas.tokens.controlled[0].actor; | |
if (!("mech" in actor.data.data)) { | |
ui.notifications.error("Selected token is not a mech"); | |
return; | |
} | |
if (actor.data.data.mech.structure.value === | |
actor.data.data.mech.structure.max) { | |
ui.notifications.error("Selected token is at full structure"); | |
return; | |
} | |
let damage = actor.data.data.mech.structure.max | |
- actor.data.data.mech.structure.value; | |
let roll = new Roll(`${damage}d6kl1`); | |
let result = table.roll({roll: roll}); | |
let total = result.roll.total; | |
let tt = await result.roll.getTooltip(); | |
let text = result.results[0].text; // as normal | |
// Crushing hits | |
let one_count = result.roll.terms[0].results.reduce((a, v) => { | |
return v.result === 1 ? a + 1 : a; | |
}, 0); | |
if (one_count > 1) { | |
text = table.results[0].text; | |
total = "Multiple 1s"; | |
} | |
let card = ` | |
<div class="card clipped-bot" style="margin: 0px;"> | |
<div class="lancer-stat-header clipped-top">// STRUCTURE DAMAGE //</div> | |
<div class="dice-roll lancer-dice-roll"> | |
<div class="dice-result"> | |
<div class="dice-formula lancer-dice-formula flexrow"> | |
<span style="text-align: left; margin-left: 5px;">${result.roll.formula}</span> | |
<span class="dice-total lancer-dice-total major">${total}</span> | |
</div> | |
<div style="text-align: left;"> | |
${tt} | |
</div> | |
</div> | |
</div> | |
${text} | |
</div> | |
` | |
ChatMessage.create( | |
{ | |
roll: result.roll, | |
speaker: ChatMessage.getSpeaker(), | |
content: card | |
} | |
); | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment