From ff9a27dc2a6fb2f6afffcc28e1c39d2a17d263ca Mon Sep 17 00:00:00 2001 From: Salvador Melo Date: Thu, 31 Dec 2020 17:46:06 -0500 Subject: [PATCH] actions --- Wicked Ones/translation.json | 2 +- Wicked Ones/wicked-ones.css | 77 ++++++++++++++++++++-- Wicked Ones/wicked-ones.html | 124 ++++++++++++++++++++++++++++++++++- 3 files changed, 194 insertions(+), 9 deletions(-) diff --git a/Wicked Ones/translation.json b/Wicked Ones/translation.json index 22eebb3b1e..e62f2da744 100644 --- a/Wicked Ones/translation.json +++ b/Wicked Ones/translation.json @@ -1 +1 @@ -{"name":"Name","race-look":"Race & Look","dark-impulse":"Dark Impulse","revelry":"Revelry","gear":"Gear","supply":"Supply","slots":" Slots","extra-slots":"Extra Slots","stress":"Stress","go-feral":"When the Clock is full, you Go Feral.","resistance-rolls":"Resistance Rolls","failure":"Failure","resist-failure":": Partial Resist, take 3 Stress.","mixed":"Mixed","resist-mixed":": Partial Resist, take 2 Stress.","success":"Success","resist-success":": Full Resist, take 1 Stress","critical":"Critical","resist-critical":": Full Resist, clear 1 Stress","resisting-death":"Resisting Death","resist-death-failure":": You die.","resist-death-mixed":": Knocked out of the scene.","defenses":"Defenses","dungeon-duties":"Dungeon Duties","tier":"Tier","type":"Type","description":"Description","downtime-projects":"Downtime Projects","brew-project":"Brew Potions and Alchemicals","build-project":"Build Locks, Traps, Tricks, and Rooms.","contact-project":"Contact Vile Friends, NPCs, or Factions.","craft-project":"Craft an Item, Edge, or Contraption","incant-project":"Incant a Ritual.","recruit-project":"Recruit a Pack of Minions","torture-project":"Torture a Prisoner","project":"Project","risk-it-downtime":"Risk it: Re-roll a Downtime Action but lose its Dominant Position.","bigmouth":"Bigmouth","cruel":"Cruel","deranged":"Deranged","fickle":"Fickle","obsessed":"Obsessed","paranoid":"Paranoid","reckless":"Reckless","vengeful":"Vengeful","craving":"Craving","drinking":"Drinking","gambling":"Gambling","occult":"Occult","violence":"Violence","worship":"Worship","notes":"Notes"} \ No newline at end of file +{"name":"Name","race-look":"Race & Look","dark-impulse":"Dark Impulse","revelry":"Revelry","bigmouth":"Bigmouth","cruel":"Cruel","deranged":"Deranged","fickle":"Fickle","obsessed":"Obsessed","paranoid":"Paranoid","reckless":"Reckless","vengeful":"Vengeful","craving":"Craving","drinking":"Drinking","gambling":"Gambling","occult":"Occult","violence":"Violence","worship":"Worship","gear":"Gear","supply":"Supply","slots":" Slots","extra-slots":"Extra Slots","stress":"Stress","go-feral":"When the Clock is full, you Go Feral.","resistance-rolls":"Resistance Rolls","failure":"Failure","resist-failure":": Partial Resist, take 3 Stress.","mixed":"Mixed","resist-mixed":": Partial Resist, take 2 Stress.","success":"Success","resist-success":": Full Resist, take 1 Stress","critical":"Critical","resist-critical":": Full Resist, clear 1 Stress","resisting-death":"Resisting Death","resist-death-failure":": You die.","resist-death-mixed":": Knocked out of the scene.","defenses":"Defenses","notes":"Notes","dungeon-duties":"Dungeon Duties","tier":"Tier","type":"Type","description":"Description","downtime-projects":"Downtime Projects","brew-project":"Brew Potions and Alchemicals","build-project":"Build Locks, Traps, Tricks, and Rooms.","contact-project":"Contact Vile Friends, NPCs, or Factions.","craft-project":"Craft an Item, Edge, or Contraption","incant-project":"Incant a Ritual.","recruit-project":"Recruit a Pack of Minions","torture-project":"Torture a Prisoner","project":"Project","risk-it-downtime":"Risk it: Re-roll a Downtime Action but lose its Dominant Position.","brains":"Brains","brains-desc":"Smarts, Awareness, Insight","scan":"Scan","perceptively":" / perceptively","tinker":"Tinker","cleverly":" / cleverly","trick":"Trick","slyly":" / slyly","muscles":"Muscles","muscles-desc":"Strength, Agility, Speed","finesse":"Finesse","precisely":" / precisely","skulk":"Skulk","sneakily":" / sneakily","smash":"Smash","powerfully":" / powerfully","guts":"Guts","guts-desc":"Personality, Mettle, Magic","banter":"Banter","affably":" / affably","invoke":"Invoke","magically":" / magically","threaten":"Threaten","forecefully":" / forecefully","forcefully":" / forcefully"} \ No newline at end of file diff --git a/Wicked Ones/wicked-ones.css b/Wicked Ones/wicked-ones.css index bc934c231f..600d8336e6 100644 --- a/Wicked Ones/wicked-ones.css +++ b/Wicked Ones/wicked-ones.css @@ -27,6 +27,10 @@ grid-area: right; } +.sheet-middle { + grid-area: middle; +} + .sheet-calling { grid-area: calling; background-color: darkgrey; @@ -126,8 +130,18 @@ } .sheet-actions { - background-color: goldenrod; - min-height: 500px; + display:grid; + grid-template-rows: repeat(7, min-content); + grid-template-columns: repeat(2, auto); + width: 100%; +} + +.sheet-actions > div { + grid-column: 1 / span 2; +} + +.sheet-actions > div > div:not(:first-of-type) { + margin-left: 7px; } .sheet-friend { @@ -203,6 +217,13 @@ ul > li.sheet-subheader { font-weight: bolder; font-size: large; display: flex; + align-items: baseline; +} + +.sheet-header > .sheet-subheader { + font-size: x-small; + font-weight: normal; + align-self: center; } .sheet-header > .sheet-spacer { @@ -214,8 +235,8 @@ ul > li.sheet-subheader { font-weight: normal; } -.sheet-header .sheet-normal { - align-self: center; +.sheet-header > button.sheet-diamond + * { + margin-left: 4px } /* Inputs */ @@ -430,17 +451,61 @@ input[type="radio"]:checked ~ input[type="radio"] + span::before { /* Fake Checkboxes */ -button.sheet-square { +button.sheet-square, button.sheet-diamond { border: 1px solid black; width: 10px; height: 10px; margin: auto 2px; } -input[value="used"] + button.sheet-square.sheet-square { +input[value="used"] + button.sheet-square, +input[value="used"] + button.sheet-diamond, +input[value="1"] ~ button.sheet-action1, +input[value="2"] ~ button.sheet-action2, input[value="2"] ~ button.sheet-action1, +input[value="3"] ~ button.sheet-action3, input[value="3"] ~ button.sheet-action2, input[value="3"] ~ button.sheet-action1 { background-color: black; } +button.sheet-practice { + display: grid; +} + +button.sheet-practice > span { + width: 100%; + height: 100%; + grid-area: 1 /1; +} + +input.sheet-action[value="0.1"] ~ button.sheet-practice { + background: + linear-gradient(to top left, + rgba(0,0,0,0) 0%, + rgba(0,0,0,0) calc(50% - 0.8px), + rgba(0,0,0,1) 50%, + rgba(0,0,0,0) calc(50% + 0.8px), + rgba(0,0,0,0) 100%); +} + +input.sheet-action[value="0.2"] ~ button.sheet-practice { + background: + linear-gradient(to top left, + rgba(0,0,0,0) 0%, + rgba(0,0,0,0) calc(50% - 0.8px), + rgba(0,0,0,1) 50%, + rgba(0,0,0,0) calc(50% + 0.8px), + rgba(0,0,0,0) 100%), + linear-gradient(to top right, + rgba(0,0,0,0) 0%, + rgba(0,0,0,0) calc(50% - 0.8px), + rgba(0,0,0,1) 50%, + rgba(0,0,0,0) calc(50% + 0.8px), + rgba(0,0,0,0) 100%); +} + +button.sheet-diamond { + transform: rotate(45deg); +} + button.sheet-symbol > span { font-family: pictos; opacity: 0.35; diff --git a/Wicked Ones/wicked-ones.html b/Wicked Ones/wicked-ones.html index 8f9d6b0a5a..bb3de26720 100644 --- a/Wicked Ones/wicked-ones.html +++ b/Wicked Ones/wicked-ones.html @@ -296,7 +296,93 @@
- Actions +
+
+ + + Brains   + Smarts, Awareness, Insight +
+
+ + + + + Scan   / perceptively +
+
+ + + + + Tinker   / cleverly +
+
+ + + + + Trick   / slyly +
+
+
+
+ + + Muscles   + Strength, Agility, Speed +
+
+ + + + + Finesse   / precisely +
+
+ + + + + Skulk   / sneakily +
+
+ + + + + Smash   / powerfully +
+
+
+
+ + + Guts   + Personality, Mettle, Magic +
+
+ + + + + Banter   / affably +
+
+ + + + + Invoke   / magically +
+
+ + + + + Threaten   / forcefully +
+
Vile Friend @@ -340,7 +426,13 @@ } function eventList(count, ...events) { - var nums = [...Array(count).keys()].map(v => v + 1); + if (isNaN(events[0])){ + var nums = [...Array(count).keys()]; + } else { + var nums = [...Array(events[0]).keys()].slice(count-1); + events = events.slice(1); + } + nums = nums.map(v => v + 1); return events.flatMap( e => nums.map( v => e + v)).join(" "); } @@ -374,4 +466,32 @@ }); }); + on("clicked:toggle-brains-shock clicked:toggle-muscles-shock clicked:toggle-guts-shock", function(eventInfo){ + var attr = eventInfo.triggerName.replace("clicked:toggle-", "") + toggle(attr,"used","0") + console.log(attr) + }); + + on(eventList(3,"clicked:scan","clicked:tinker","clicked:trick","clicked:finesse","clicked:skulk","clicked:smash","clicked:banter","clicked:invoke","clicked:threaten"), function(eventInfo){ + var match = eventInfo.triggerName.match(/clicked:(.+)(\d)/) + var attr = match[1] + var set = {} + if (match[2] == "1"){ + getAttrs([attr], v => { + switch(v[attr]){ + case "0": set[attr] = "0.1"; break; + case "0.1": set[attr] = "0.2"; break; + case "0.2": set[attr] = "1"; break; + case "1": set[attr] = "0"; break; + default: set[attr] = "1"; break; + } + setAttrs(set); + }); + } else { + set[attr] = match[2]; + setAttrs(set); + } + console.log(match) + }); + \ No newline at end of file