Files
roll20-character-sheets/Moon Punk/moonpunk.html
T
2024-06-03 13:15:14 -04:00

1240 lines
36 KiB
HTML

<div class="sheet-wrapper">
<div class="flex">
<!--Top info-->
<div class="col100 flex-wrap">
<label class="col47">
<input type="text" spellcheck="false" name="attr_character_name"/>
<div class="label text title" data-i18n="name"></div>
</label>
<label class="col24b">
<input type="text" spellcheck="false" name="attr_pronouns"/>
<div class="label text title" data-i18n="pronouns"></div>
</label>
<div class="playbook-selector">
<select name="attr_playbook">
<optgroup>
<option>Select a Playbook</option>
<option value="duster">Duster</option>
<option value="enforcer">Enforcer</option>
<option value="guildy">Guildy</option>
<option value="labcoat">Labcoat</option>
<option value="mutant">Mutant</option>
<option value="newmooner">New Mooner</option>
<option value="oldtimer">Old Timer</option>
<option value="pilot">Pilot</option>
<option value="politician">Politician</option>
<option value="rocker">Rocker</option>
<option value="techie">Techie</option>
<option value="vendor">Vendor</option>
</optgroup>
</select>
</div>
<label class="col100">
<input type="text" spellcheck="false" name="attr_ethos"/>
<div class="label text title" data-i18n="ethos"></div>
</label>
<!--Left Column-->
<div class="col15">
<input class="statcheck" type="hidden" name="attr_chosestats" value="1"/>
<div class="stats">
<label class="col100 stats">
<input type="number" name="attr_presence"/>
<button class="statbutton" type="roll" name="roll_presence" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Presence}} {{stat_name=Presence}} {{result=[[2d6+@{presence}+?{roll_mod|0}]]}}" data-i18n="presence"></button>
<button class="moves" type="roll" name="roll_tanstaafl" value="&{template:mp} {{name=@{character_name}}} {{roll_name=TANSTAAFL}} {{stat_name=Presence}} {{result=[[2d6+@{presence}+?{roll_mod|0}]]}}" data-i18n="tanstaafl"></button>
<button class="moves" type="roll" name="roll_influencesomeone" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Influence Someone}} {{stat_name=Presence}} {{result=[[2d6+@{presence}+?{roll_mod|0}]]}}" data-i18n="influencesomeone"></button>
</label>
<label class="col100 stats">
<input type="number" name="attr_cool"/>
<button class="statbutton" type="roll" name="roll_cool" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Cool}} {{stat_name=Cool}} {{result=[[2d6+@{cool}+?{roll_mod|0}]]}}" data-i18n="cool"></button>
<button class="moves" type="roll" name="roll_thinkfast" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Think Fast}} {{stat_name=Cool}} {{result=[[2d6+@{cool}+?{roll_mod|0}]]}}" data-i18n="thinkfast"></button>
<button class="moves" type="roll" name="roll_actcasual" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Act Casual}} {{stat_name=Cool}} {{result=[[2d6+@{cool}+?{roll_mod|0}]]}}" data-i18n="actcasual"></button>
</label>
<label class="col100 stats">
<input type="number" name="attr_smarts"/>
<button class="statbutton" type="roll" name="roll_smarts" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Smarts}} {{stat_name=Smarts}} {{result=[[2d6+@{smarts}+?{roll_mod|0}]]}}" data-i18n="smarts"></button>
<button class="moves" type="roll" name="roll_usetech" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Use Tech}} {{stat_name=Smarts}} {{result=[[2d6+@{smarts}+?{roll_mod|0}]]}}" data-i18n="usetech"></button>
<button class="moves" type="roll" name="roll_readroom" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Read The Room}} {{stat_name=Smarts}} {{result=[[2d6+@{smarts}+?{roll_mod|0}]]}}" data-i18n="readroom"></button>
</label>
<label class="col100 stats">
<input type="number" name="attr_bones"/>
<button class="statbutton" type="roll" name="roll_bones" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Bones}} {{stat_name=Bones}} {{result=[[2d6+@{bones}+?{roll_mod|0}]]}}" data-i18n="bones"></button>
<button class="moves" type="roll" name="roll_throwdown" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Throw Down}} {{stat_name=Bones}} {{result=[[2d6+@{bones}+?{roll_mod|0}]]}}" data-i18n="throwdown"></button>
<button class="moves" type="roll" name="roll_protectsomeone" value="&{template:mp} {{name=@{character_name}}} {{roll_name=Protect Someone}} {{stat_name=Bones}} {{result=[[2d6+@{bones}+?{roll_mod|0}]]}}" data-i18n="protectsomeone"></button>
</label>
<label class="col100 stats">
<button class="statresetbutton" type="action" name="act_resetstats" data-i18n="resetstats"></button>
</label>
</div>
<div class="stat-selector">
<div class="label text" data-i18n="statdirections"></div>
<fieldset class="repeating_stats">
<button type="action" name="act_stats">
<textarea spellcheck="false" name="attr_name"></textarea>
</button>
<input type="hidden" name="attr_presence"/>
<input type="hidden" name="attr_cool"/>
<input type="hidden" name="attr_smarts"/>
<input type="hidden" name="attr_bones"/>
</fieldset>
</div>
</div>
<!--Center Column - Tanstaafl & XP-->
<div class="col45">
<div class="tanstaafl flex-wrap">
<div class="col100 section-head text" data-i18n="tanstaafl"></div>
<div class="col50 oweLabel" data-i18n="owe"></div>
<div class="col50 owedLabel" data-i18n="owed"></div>
<div class="col50 owe">
<fieldset class="repeating_owe">
<input type="text" spellcheck="false" name="attr_owe" data-i18n-placeholder="owe_placeholder"/>
</fieldset>
</div>
<div class="col50 owed">
<fieldset class="repeating_owed" data-i18n-placeholder="owed_placeholder">
<input type="text" spellcheck="false" name="attr_owed"/>
</fieldset>
</div>
</div>
<div class="col100 exp flex-wrap">
<div class="col100 section-head text" data-i18n="exp"></div>
<div class="col100 flex-wrap">
<div class="xpboxcontainer tanstbox">
<input class="xpbox" type="checkbox" name="attr_xp1" value="1"/><span class="xpbox"></span>
</div>
<div class="xpboxcontainer tanstbox">
<input class="xpbox" type="checkbox" name="attr_xp2" value="1"/><span class="xpbox"></span>
</div>
<div class="xpboxcontainer">
<input class="xpbox" type="checkbox" name="attr_xp3" value="1"/><span class="xpbox"></span>
</div>
<div class="xpboxcontainer">
<input class="xpbox" type="checkbox" name="attr_xp4" value="1"/><span class="xpbox"></span>
</div>
<div class="xpboxcontainer">
<input class="xpbox" type="checkbox" name="attr_xp5" value="1"/><span class="xpbox"></span>
</div>
<div class="xpboxcontainer">
<input class="xpbox" type="checkbox" name="attr_xp6" value="1"/><span class="xpbox"></span>
</div>
<div class="xpboxcontainer">
<input class="xpbox" type="checkbox" name="attr_xp7" value="1"/><span class="xpbox"></span>
</div>
</div>
</div>
<div class="col100 notes">
<div class="col100 section-head text" data-i18n="movesnotes"></div>
<textarea spellcheck="false" name="attr_notes"></textarea>
</div>
</div>
<!--Right Column - Harm & Gear-->
<div class="col40">
<div class="harm flex-wrap">
<div class="col100 section-head text" data-i18n="harm"></div>
<div class="col24b harmlabel text" data-i18n="minor"></div>
<div class="col24b harmboxcontainer">
<div class="harmboxsubcontainer">
<input class="harmbox" type="checkbox" name="attr_minor1" value="1"/><span class="harmbox"></span>
</div>
<div class="harmboxsubcontainer">
<input class="harmbox" type="checkbox" name="attr_minor2" value="1"/><span class="harmbox"></span>
</div>
</div>
<div class="col50 harmtags">
<div class="taglabel" data-i18n="tags"></div>
<textarea spellcheck="false" name="attr_minortags"></textarea>
</div>
<div class="col24b harmlabel text" data-i18n="moderate"></div>
<div class="col24b harmboxcontainer">
<div class="harmboxsubcontainer">
<input class="harmbox" type="checkbox" name="attr_moderate1" value="1"/><span class="harmbox"></span>
</div>
<div class="harmboxsubcontainer">
<input class="harmbox" type="checkbox" name="attr_moderate2" value="1"/><span class="harmbox"></span>
</div>
</div>
<div class="col50 harmtags">
<div class="taglabel smalltaglabel" data-i18n="temporary"></div>
<textarea spellcheck="false" name="attr_temporarytags"></textarea>
</div>
<div class="col24b harmlabel text" data-i18n="major"></div>
<div class="col24b harmboxcontainer">
<div class="harmboxsubcontainer">
<input class="harmbox" type="checkbox" name="attr_major1" value="1"/><span class="harmbox"></span>
</div>
<div class="harmboxsubcontainer">
<input class="harmbox" type="checkbox" name="attr_major2" value="1"/><span class="harmbox"></span>
</div>
</div>
<div class="col50 harmtags">
<div class="taglabel smalltaglabel" data-i18n="needsattention"></div>
<textarea spellcheck="false" name="attr_needattentiontags"></textarea>
</div>
<div class="col24b harmlabel text" data-i18n="dying"></div>
<div class="col24b harmboxcontainer">
<div class="harmboxsubcontainer">
<input class="harmbox" type="checkbox" name="attr_dying1" value="1"/><span class="harmbox"></span>
</div>
</div>
<div class="col50 harmtags">
<div class="taglabel smalltaglabel" data-i18n="permanent"></div>
<textarea spellcheck="false" name="attr_permanentags"></textarea>
</div>
</div>
<div class="col100">
<div class="section-head text" data-i18n="gear"></div>
<div class="gearsection">
<fieldset class="repeating_gear">
<input class="gearcheck" type="checkbox" name="attr_gearcheck" value="1"/><span class="gearcheck"></span>
<input type="text" spellcheck="false" name="attr_name" data-i18n-placeholder="gear_name"/>
</fieldset>
</div>
</div>
</div>
<!--Next Section-->
<div class="col100 bottomsection flex-wrap">
<div class="col33 flex-wrap">
<!--Playbook Moves-->
<div class="col50">
<div class="bottomsection-head text" data-i18n="playbookmoves"></div>
</div>
<div class="col50">
<div class="bottomsection-desc text" data-i18n="playbookmovesdesc"></div>
</div>
<div class="col100">
<div class="playbookmoves">
<fieldset class="repeating_moves">
<input class="btmcheck" type="checkbox" name="attr_movecheck" value="1"/><span class="btmcheck"></span>
<input type="text" spellcheck="false" name="attr_name" data-i18n-placeholder="moves_name"/>
<textarea spellcheck="false" name="attr_description" data-i18n-placeholder="moves_description"></textarea>
</fieldset>
</div>
</div>
</div>
<div class="col33 flex-wrap">
<!--Specialty Moves-->
<div class="col50">
<div class="bottomsection-head text" data-i18n="specialty"></div>
</div>
<div class="col50">
<div class="bottomsection-desc text" data-i18n="specialtydesc"></div>
</div>
<div class="col100">
<div class="playbookmoves">
<fieldset class="repeating_specialties">
<input class="btmcheck" type="checkbox" name="attr_speccheck" value="1"/><span class="btmcheck"></span>
<input type="text" spellcheck="false" name="attr_name" data-i18n-placeholder="moves_name"/>
<textarea spellcheck="false" name="attr_description" data-i18n-placeholder="moves_description"></textarea>
</fieldset>
</div>
</div>
<!--Leveling Up-->
<div class="col50">
<div class="bottomsection-head text" data-i18n="levelingup"></div>
</div>
<div class="col50">
<div class="bottomsection-desc text" data-i18n="levelingupdesc"></div>
</div>
<div class="col100">
<div class="levelingup">
<fieldset class="repeating_leveling">
<input class="btmcheck" type="checkbox" name="attr_levelupcheck" value="1"/><span class="btmcheck"></span>
<input type="text" spellcheck="false" name="attr_name"/>
</fieldset>
</div>
</div>
</div>
<div class="col33 flex-wrap">
<!--Links-->
<div class="col50">
<div class="bottomsection-head text" data-i18n="links"></div>
</div>
<div class="col50">
<div class="bottomsection-desc text" data-i18n="linksdesc"></div>
</div>
<div class="col100">
<div class="linksection">
<fieldset class="repeating_links">
<input type="text" spellcheck="false" name="attr_linkcharacter" data-i18n-placeholder="player"/>
<textarea spellcheck="false" name="attr_name" data-i18n-placeholder="links_name"></textarea>
</fieldset>
</div>
</div>
</div>
</div>
</div>
</div>
</div>
<!--Mail Roll Template-->
<!--roll_name is the name of the thing being roll-->
<!--name is the name of the character doing the rolling-->
<!--stat_name is the name of the stat added to the roll-->
<!--result is the die roll-->
<rolltemplate class="sheet-rolltemplate-mp">
<table>
<tr>
<th colspan="2">{{roll_name}}</th>
</tr>
<tr>
<td colspan="2">{{name}} rolled {{#stat_name}} {{stat_name}}{{/stat_name}}{{#roll_mod}}({{roll_mod}}){{/roll_mod}}</td>
</tr>
<tr>{{#rollGreater() result 9}}
<td class="result success">{{result}}</td>
<td>Success!</td>{{/rollGreater() result 9}}
{{#rollBetween() result 7 9}}
<td class="result">{{result}}</td>
<td>Partial Success</td>{{/rollBetween() result 7 9}}
{{#rollLess() result 7}}
<td class="result failure">{{result}}</td>
<td>Miss</td>{{/rollLess() result 7}}
</tr>
</table>
</rolltemplate>
<script type="text/worker">
"use strict";
const data = {
"leveling": {
"advanced_advancements": [
{"name":"change_class"},
{"name":"p1stat"},
{"name":"take_advanced_move"},
{"name":"take_advanced_move"},
{"name":"recruit_allies"},
{"name":"hang_jacket"}
],
"basic_advancements": [
{"name":"p1bones"},
{"name":"p1presence"},
{"name":"p1cool"},
{"name":"p1smarts"},
{"name":"take_another_move"},
{"name":"take_move_another_playbook"},
{"name":"take_move_another_playbook"}
]
},
"playbooks": {
"duster": {
"gear": [
{"name":"p:suit", "gearcheck":1},
{"name":"safety_tether", "gearcheck":1}
],
"links": [
{"name":"link_dust_1"},
{"name":"link_dust_2"},
{"name":"link_dust_3"},
{"name":"link_dust_4"},
{"name":"link_dust_5"},
{"name":"link_dust_6"},
{"name":"link_dust_7"},
{"name":"link_dust_8"}
],
"moves": [
{"name":"practiced_hand"},
{"name":"survival_kit"},
{"name":"running_on_instinct"},
{"name":"ice_in_my_veins"},
{"name":"danger_sense"},
{"name":"juke_box_hero"},
{"name":"space_cowboy"},
{"name":"rope_trick"},
{"name":"tell_me_i_cant"}
],
"specialties": [
{"name":"under_pressure", "speccheck":1}
],
"stats": [
{
"name":"p-1c2s1b1",
"presence": -1,
"cool": 2,
"smarts": 1,
"bones": 1,
"index":0
},
{
"name":"p-1c2s2b-1",
"presence": -1,
"cool": 2,
"smarts": 2,
"bones": -1,
"index":1
},
{
"name":"p0c2s1b0",
"presence": 0,
"cool": 2,
"smarts": 1,
"bones": 0,
"index":2
},
{
"name":"p1c2s1b-1",
"presence": 1,
"cool": 2,
"smarts": 1,
"bones": -1,
"index":3
}
]
},
"enforcer": {
"gear":[
{"name":"cool_outfit", "gearcheck":1},
{"name":"brass_knuckles", "gearcheck":1}
],
"links":[
{"name":"link_enforce_1"},
{"name":"link_enforce_2"},
{"name":"link_enforce_3"},
{"name":"link_enforce_4"},
{"name":"link_enforce_5"},
{"name":"link_enforce_6"},
{"name":"link_enforce_7"},
{"name":"link_enforce_8"}
],
"moves":[
{"name":"indomitable_will"},
{"name":"practice_makes_perfect"},
{"name":"buddy_system"},
{"name":"bash-baller"},
{"name":"you_talkin_to_me"},
{"name":"dont_touch_them"},
{"name":"i_thought_i_told_you"}
],
"specialties":[
{"name":"ex-military"},
{"name":"athlete"},
{"name":"cornfed"},
{"name":"brawler"}
],
"stats": [
{
"name":"p-1c1s1b2",
"presence": -1,
"cool": 1,
"smarts": 1,
"bones": 2
},
{
"name":"p-1c2s-1b2",
"presence": -1,
"cool": 2,
"smarts": -1,
"bones": 2
},
{
"name":"p0c1s0b2",
"presence": 0,
"cool": 1,
"smarts": 0,
"bones": 2
},
{
"name":"p1c1s-1b2",
"presence": 1,
"cool": 1,
"smarts": -1,
"bones": 2
}
]
},
"guildy": {
"gear":[
{"name":"work_uniform", "gearcheck":1}
],
"links":[
{"name":"link_guildy_1"},
{"name":"link_guildy_2"},
{"name":"link_guildy_3"},
{"name":"link_guildy_4"},
{"name":"link_guildy_5"},
{"name":"link_guildy_6"},
{"name":"link_guildy_7"},
{"name":"link_guildy_8"}
],
"moves":[
{"name":"i_know_somebody"},
{"name":"check_the_blueprint"},
{"name":"work_contact"},
{"name":"sterling_reputation"},
{"name":"professional_training"},
{"name":"proper_leverage"},
{"name":"picket_line"},
{"name":"bargaining_power"},
{"name":"cross_training"},
{"name":"seize_the_means"},
{"name":"si_se_puede"}
],
"specialties":[
{"name":"power_in_a_union","speccheck":1},
{"name":"union_dues","speccheck":1},
{"name":"call_your_map","speccheck":1}
],
"stats": [
{
"name":"p2c1s-1b1",
"presence": 2,
"cool": 1,
"smarts": -1,
"bones": 1
},
{
"name":"p2c2s-1b-1",
"presence": 2,
"cool": 2,
"smarts": -1,
"bones": -1
},
{
"name":"p2c1s0b0",
"presence": 2,
"cool": 1,
"smarts": 0,
"bones": 0
},
{
"name":"p2c1s1b-1",
"presence": 2,
"cool": 1,
"smarts": 1,
"bones": -1
}
]
},
"labcoat": {
"gear":[
{"name":"lab_tool" ,"gearcheck":1}
],
"links":[
{"name":"link_labcoat_1"},
{"name":"link_labcoat_2"},
{"name":"link_labcoat_3"},
{"name":"link_labcoat_4"},
{"name":"link_labcoat_5"},
{"name":"link_labcoat_6"},
{"name":"link_labcoat_7"},
{"name":"link_labcoat_8"}
],
"moves":[
{"name":"think_tank"},
{"name":"would_you_hit_someone_with_glasses"},
{"name":"hold_my_glasses"},
{"name":"sawbones"},
{"name":"actually"},
{"name":"whats_happening"}
],
"specialties":[
{"name":"laboratory", "speccheck":1},
{"name":"education", "speccheck":1}
],
"stats": [
{
"name":"p-1c1s2b1",
"presence": -1,
"cool": 1,
"smarts": 2,
"bones": 1
},
{
"name":"p-1c2s2b-1",
"presence": -1,
"cool": 2,
"smarts": 2,
"bones": -1
},
{
"name":"p0c1s2b0",
"presence": 0,
"cool": 1,
"smarts": 2,
"bones": 0
},
{
"name":"p1c1s2b-1",
"presence": 1,
"cool": 1,
"smarts": 2,
"bones": -1
}
]
},
"mutant": {
"gear":[],
"links":[
{"name":"link_mutant_1"},
{"name":"link_mutant_2"},
{"name":"link_mutant_3"},
{"name":"link_mutant_4"},
{"name":"link_mutant_5"},
{"name":"link_mutant_6"},
{"name":"link_mutant_7"},
{"name":"link_mutant_8"}
],
"moves":[
{"name":"always_on_the_run"},
{"name":"blend_in"},
{"name":"natural_armor"},
{"name":"hey_fuck_you"},
{"name":"strain"},
{"name":"inner_strength"},
{"name":"poke_the_pig"},
{"name":"born_leader"}
],
"specialties":[
{"name":"mutation", "speccheck":1},
{"name":"mut_support_structure", "speccheck":1},
{"name":"rising_from_hardship", "speccheck":1}
],
"stats": [
{
"name":"p-1c1s1b2",
"presence": -1,
"cool": 1,
"smarts": 1,
"bones": 2
},
{
"name":"p-1c-1s2b2",
"presence": -1,
"cool": -1,
"smarts": 2,
"bones": 2
},
{
"name":"p0c0s1b2",
"presence": 0,
"cool": 0,
"smarts": 1,
"bones": 2
},
{
"name":"p1c-1s1b2",
"presence": 1,
"cool": -1,
"smarts": 1,
"bones": 2
}
]
},
"newmooner": {
"gear":[
{"name":"sentimental_earth_item","gearcheck":1}
],
"links":[
{"name":"link_newmooner_1"},
{"name":"link_newmooner_2"},
{"name":"link_newmooner_3"},
{"name":"link_newmooner_4"},
{"name":"link_newmooner_5"},
{"name":"link_newmooner_6"},
{"name":"link_newmooner_7"},
{"name":"link_newmooner_8"}
],
"moves":[
{"name":"helpful_idiot"},
{"name":"greenhorn"},
{"name":"no_bullshit"},
{"name":"no_credit"},
{"name":"first_impressions"},
{"name":"high_gravity"},
{"name":"dense"}
],
"specialties":[
{"name":"pioneer"},
{"name":"migrant"},
{"name":"political_dissenter"},
{"name":"convict"}
],
"stats": [
{
"name":"p1c1s-1b2",
"presence":1,
"cool":1,
"smarts":-1,
"bones":2
},
{
"name":"p2c-1s-1b2",
"presence":2,
"cool":-1,
"smarts":-1,
"bones":2
},
{
"name":"p1c0s0b2",
"presence":1,
"cool":0,
"smarts":0,
"bones":2
},
{
"name":"p1c-1s1b2",
"presence":1,
"cool":-1,
"smarts":1,
"bones":2
}
]
},
"oldtimer": {
"gear":[
{"name":"sentimental_moon_item", "gearcheck":1}
],
"links":[
{"name":"link_oldtimer_1"},
{"name":"link_oldtimer_2"},
{"name":"link_oldtimer_3"},
{"name":"link_oldtimer_4"},
{"name":"link_oldtimer_5"},
{"name":"link_oldtimer_6"},
{"name":"link_oldtimer_7"},
{"name":"link_oldtimer_8"}
],
"moves":[
{"name":"experienced_loonie"},
{"name":"scarred"},
{"name":"spin_a_yarn"},
{"name":"ol_stomping_grounds"},
{"name":"you_know_i_used_to_know_someone"},
{"name":"social_call"},
{"name":"remember_the_fundamentals"}
],
"specialties":[
{"name":"ot_pioneer"},
{"name":"ot_migrant"},
{"name":"ot_political_dissenter"},
{"name":"ot_convict"}
],
"stats": [
{
"name":"p1c-1s2b1",
"presence":1,
"cool":-1,
"smarts":2,
"bones":1
},
{
"name":"p2c-1s2b-1",
"presence":2,
"cool":-1,
"smarts":2,
"bones":-1
},
{
"name":"p1c0s2b0",
"presence":1,
"cool":0,
"smarts":2,
"bones":0
},
{
"name":"p1c1s2b-1",
"presence":1,
"cool":1,
"smarts":2,
"bones":-1
}
]
},
"pilot": {
"gear":[
{"name":"flight_jacket", "gearcheck":1}
],
"links":[
{"name":"link_pilot_1"},
{"name":"link_pilot_2"},
{"name":"link_pilot_3"},
{"name":"link_pilot_4"},
{"name":"link_pilot_5"},
{"name":"link_pilot_6"},
{"name":"link_pilot_7"},
{"name":"link_pilot_8"}
],
"moves":[
{"name":"heres_a_cool_trick"},
{"name":"never_tell_me_the_odds"},
{"name":"bang"},
{"name":"everythings_fine_here_how_are_you"},
{"name":"professional_smuggler"},
{"name":"the_need"},
{"name":"dont_get_cocky_kid"},
{"name":"i_got_your_six"}
],
"specialties":[
{"name":"callsign", "speccheck":1},
{"name":"ship", "speccheck":1}
],
"stats": [
{
"name":"p1c2s0b-2",
"presence":1,
"cool":2,
"smarts":0,
"bones":-2
},
{
"name":"p1c2s-1b-1",
"presence":1,
"cool":2,
"smarts":-1,
"bones":-1
},
{
"name":"p1c2s-2b0",
"presence":1,
"cool":2,
"smarts":-2,
"bones":0
},
{
"name":"p0c2s0b1",
"presence":0,
"cool":2,
"smarts":0,
"bones":1
}
]
},
"politician": {
"gear":[],
"links":[
{"name":"link_politician_1"},
{"name":"link_politician_2"},
{"name":"link_politician_3"},
{"name":"link_politician_4"},
{"name":"link_politician_5"},
{"name":"link_politician_6"},
{"name":"link_politician_7"},
{"name":"link_politician_8"}
],
"moves":[
{"name":"think_of_the_cause"},
{"name":"diplomatic_immunity"},
{"name":"rousing_speech"},
{"name":"mudslinging"},
{"name":"we_need_you"},
{"name":"silver_tongued_devil"},
{"name":"campaign_promise"}
],
"specialties":[
{"name":"oppo_expert"},
{"name":"incumbent"},
{"name":"volunteer_brigade"},
{"name":"pollster"}
],
"stats": [
{
"name":"p2c-1s1b1",
"presence":2,
"cool":-1,
"smarts":1,
"bones":1
},
{
"name":"p2c-1s2b-1",
"presence":2,
"cool":-1,
"smarts":2,
"bones":-1
},
{
"name":"p2c0s1b0",
"presence":2,
"cool":0,
"smarts":1,
"bones":0
},
{
"name":"p2c1s1b-1",
"presence":2,
"cool":1,
"smarts":1,
"bones":-1
}
]
},
"rocker": {
"gear":[],
"links":[
{"name":"link_rocker_1"},
{"name":"link_rocker_2"},
{"name":"link_rocker_3"},
{"name":"link_rocker_4"},
{"name":"link_rocker_5"},
{"name":"link_rocker_6"},
{"name":"link_rocker_7"}
],
"moves":[
{"name":"grab_the_mic"},
{"name":"the_rawk_show"},
{"name":"redeption_song"},
{"name":"strange_things_happen_every_day"},
{"name":"vibe_check"},
{"name":"stay_close_to_me"},
{"name":"doesnt_make_it_allright"}
],
"specialties":[
{"name":"whats_my_name","speccheck":1},
{"name":"the_underground","speccheck":1}
],
"stats": [
{
"name":"p2c-1s1b1",
"presence":2,
"cool":-1,
"smarts":1,
"bones":1
},
{
"name":"p2c-1s-1b2",
"presence":2,
"cool":-1,
"smarts":-1,
"bones":2
},
{
"name":"p2c0s0b1",
"presence":2,
"cool":0,
"smarts":0,
"bones":1
},
{
"name":"p2c1s-1b1",
"presence":2,
"cool":1,
"smarts":-1,
"bones":1
}
]
},
"techie": {
"gear":[
{"name":"wrench","gearcheck":1}
],
"links":[
{"name":"link_techie_1"},
{"name":"link_techie_2"},
{"name":"link_techie_3"},
{"name":"link_techie_4"},
{"name":"link_techie_5"},
{"name":"link_techie_6"},
{"name":"link_techie_7"},
{"name":"link_techie_8"}
],
"moves":[
{"name":"mouse_trap"},
{"name":"macgyver"},
{"name":"instructions_not_included"},
{"name":"turn_it_up_to_11"},
{"name":"grease_monkey"},
{"name":"private_line"},
{"name":"transhumanist"}
],
"specialties":[
{"name":"magnum_opus", "speccheck":1},
{"name":"workshop", "speccheck":1}
],
"stats": [
{
"name":"p-1c1s2b1",
"presence":-1,
"cool":1,
"smarts":2,
"bones":1
},
{
"name":"p-1c-1s2b2",
"presence":-1,
"cool":-1,
"smarts":2,
"bones":2
},
{
"name":"p0c0s2b1",
"presence":0,
"cool":0,
"smarts":2,
"bones":1
},
{
"name":"p1c-1s2b1",
"presence":1,
"cool":-1,
"smarts":2,
"bones":1
}
]
},
"vendor": {
"gear":[],
"links":[
{"name":"link_vendor_1"},
{"name":"link_vendor_2"},
{"name":"link_vendor_3"},
{"name":"link_vendor_4"},
{"name":"link_vendor_5"},
{"name":"link_vendor_6"},
{"name":"link_vendor_7"},
{"name":"link_vendor_8"}
],
"moves":[
{"name":"i_got_just_the_thing"},
{"name":"high_pressure_sales_force"},
{"name":"reliable_front"},
{"name":"always_holding"},
{"name":"trade_secret"},
{"name":"case_the_joint"},
{"name":"size_em_up"},
{"name":"fake_smile"}
],
"specialties":[
{"name":"shop","speccheck":1},
{"name":"dirty_laundry", "speccheck":1}
],
"stats": [
{
"name":"p1c2s1b-1",
"presence":1,
"cool":2,
"smarts":1,
"bones":-1
},
{
"name":"p2c2s-1b-1",
"presence":2,
"cool":2,
"smarts":-1,
"bones":-1
},
{
"name":"p1c2s0b0",
"presence":1,
"cool":2,
"smarts":0,
"bones":0
},
{
"name":"p1c2s-1b1",
"presence":1,
"cool":2,
"smarts":-1,
"bones":1
}
]
}
}
};
const sheetVersion = "0.1";
const sheetName = "Moon Punk";
const getTranslation = (key) => (getTranslationByKey(key) || "NO_TRANSLATION_FOUND");
//Translate all of the data
data.leveling.advanced_advancements.forEach(item => {
item.name = getTranslation(item.name);
});
data.leveling.basic_advancements.forEach(item => {
item.name = getTranslation(item.name);
});
Object.keys(data.playbooks).forEach(playbook =>{
//translate the gear
data.playbooks[playbook].gear.forEach(item => {
item.name = getTranslation(item.name);
});
//translate links to toher characters
data.playbooks[playbook].links.forEach(item => {
item.name = getTranslation(item.name);
});
//translate moves
data.playbooks[playbook].moves.forEach(item => {
item.description = getTranslation(item.name+'_description');
item.name = getTranslation(item.name);
});
//translate specialties
data.playbooks[playbook].specialties.forEach(item => {
item.description = getTranslation(item.name+'_description');
item.name = getTranslation(item.name);
});
//translate stattext
data.playbooks[playbook].stats.forEach(item => {
item.name = getTranslation(item.name);
});
});
/* Utility functions - shouldn't need to touch most of these */
//Completely lifted from joesinghaus
//There are probably many that I don't need ¯\_(ツ)_/¯
const mySetAttrs = (attrs, options, callback) => {
const finalAttrs = Object.keys(attrs).reduce((m, k) => {
m[k] = String(attrs[k]);
return m;
}, {});
console.log(finalAttrs);
setAttrs(finalAttrs, options, callback);
},
setAttr = (name, value) => {
getAttrs([name], v => {
const setting = {};
if (v[name] !== String(value)) setting[name] = String(value);
setAttrs(setting);
});
},
fillRepeatingSectionFromData = (sectionName, dataList, autogen, callback) => {
callback = callback || (() => {});
getSectionIDs(`repeating_${sectionName}`, idList => {
const existingRowAttributes = [
...idList.map(id => `repeating_${sectionName}_${id}_name`),
...idList.map(id => `repeating_${sectionName}_${id}_autogen`)
];
getAttrs(existingRowAttributes, v => {
/* Delete auto-generated rows */
if (autogen) {
idList = idList.filter(id => {
if (v[`repeating_${sectionName}_${id}_autogen`]) {
removeRepeatingRow(`repeating_${sectionName}_${id}`);
return false;
}
else return true;
});
}
const existingRowNames = idList.map(id => v[`repeating_${sectionName}_${id}_name`]),
createdIDs = [],
setting = dataList.filter(o => !existingRowNames.includes(o.name))
.map(o => {
let rowID;
while (!rowID) {
let newID = generateRowID();
if (!createdIDs.includes(newID)) {
rowID = newID;
createdIDs.push(rowID);
}
}
const newAttrs = {};
if (autogen) {
newAttrs[`repeating_${sectionName}_${rowID}_autogen`] = "1";
}
return Object.keys(o).reduce((m, key) => {
m[`repeating_${sectionName}_${rowID}_${key}`] = o[key];
return m;
}, newAttrs);
})
.reduce((m, o) => Object.assign(m, o), {});
mySetAttrs(setting, {}, callback);
});
});
},
diceMagic = num => {
const range = end => [...Array(end + 1).keys()].slice(1);
if (num > 0) return `dice=${range(num).map(() => "[[d6]]").join("&"+"#44"+"; ")}`;
else return "zerodice=[[d6]]&"+"#44"+"; [[d6]]";
},
buildRollFormula = base => {
return ` {{?{@{bonusdice}|${
[0, 1, 2, 3, 4, 5, 6, -1, -2, -3].map(n => `${n},${diceMagic(n + (parseInt(base) || 0))}`).join("|")
}}}}`;
},
buildNumdiceFormula = () => {
return ` {{?{${getTranslation("numberofdice")}|${
[0, 1, 2, 3, 4, 5, 6].map(n => `${n},${diceMagic(n)}`).join("|")
}}}}`;
},
emptyFirstRowIfUnnamed = sectionName => {
getSectionIDs(`repeating_${sectionName}`, idList => {
const id = idList[0];
getAttrs([`repeating_${sectionName}_${id}_name`], v => {
if (!v[`repeating_${sectionName}_${id}_name`]) {
removeRepeatingRow(`repeating_${sectionName}_${id}`);
}
});
});
},
handleBoxesFill = (name, upToFour) => {
on(`change:${name}1 change:${name}2 change:${name}3 change:${name}4`, event => {
if (event.sourceType !== "player") return;
getAttrs([event.sourceAttribute], v => {
const rName = event.sourceAttribute.slice(0, -1),
setting = {};
if (String(v[event.sourceAttribute]) === "1") {
switch (event.sourceAttribute.slice(-1)) {
case "4":
setting[`${rName}3`] = 1;
/* falls through */
case "3":
setting[`${rName}2`] = 1;
/* falls through */
case "2":
setting[`${rName}1`] = 1;
}
}
if (String(v[event.sourceAttribute]) === "0") {
switch (event.sourceAttribute.slice(-1)) {
case "1":
setting[`${rName}2`] = 0;
/* falls through */
case "2":
setting[`${rName}3`] = 0;
/* falls through */
case "3":
if (upToFour) setting[`${rName}4`] = 0;
}
}
mySetAttrs(setting);
});
});
};
on("change:playbook", event => {
getAttrs(["playbook", "change_attributes"], v => {
console.log(v.playbook);
fillRepeatingSectionFromData("gear",data.playbooks[v.playbook].gear, true);
fillRepeatingSectionFromData("moves",data.playbooks[v.playbook].moves, true);
fillRepeatingSectionFromData("specialties",data.playbooks[v.playbook].specialties, true);
fillRepeatingSectionFromData("links",data.playbooks[v.playbook].links, true);
fillRepeatingSectionFromData("leveling",[].concat(data.leveling.basic_advancements,data.leveling.advanced_advancements), true);
fillRepeatingSectionFromData("stats", data.playbooks[v.playbook].stats, true);
});
setAttr("cool", 0);
setAttr("smarts", 0);
setAttr("bones", 0);
setAttr("presence", 0);
setAttr("chosestats", 0);
});
on('clicked:resetstats', function() {
setAttr("cool", 0);
setAttr("smarts", 0);
setAttr("bones", 0);
setAttr("presence", 0);
setAttr("chosestats", 0);
});
on('clicked:repeating_stats', function(eventInfo) {
console.log(eventInfo);
const trigger = eventInfo.sourceAttribute.split('_');
const rowid = trigger[2];
console.log(rowid);
getAttrs(["repeating_stats_" + rowid + "_name",
"repeating_stats_" + rowid + "_cool",
"repeating_stats_" + rowid + "_smarts",
"repeating_stats_" + rowid + "_bones",
"repeating_stats_" + rowid + "_presence",], s => {
Object.keys(s).forEach(key => {
if(key.includes("cool")){
setAttr("cool", s[key]);
}
if(key.includes("smarts")){
setAttr("smarts", s[key]);
}
if(key.includes("bones")){
setAttr("bones", s[key]);
}
if(key.includes("presence")){
setAttr("presence", s[key]);
}
});
});
setAttr("chosestats", 1);
});
</script>