Skip to content

Commit

Permalink
Add placements and fix bugs
Browse files Browse the repository at this point in the history
  • Loading branch information
m-biernat committed Jun 30, 2022
1 parent 198bf5b commit 39c796f
Show file tree
Hide file tree
Showing 11 changed files with 22 additions and 13 deletions.
2 changes: 1 addition & 1 deletion src/Game.js
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ export function newPlacement() {
}

export function uncheck() {
return new Array(Object.keys(placements).length).fill(false);
return new Array(Object.keys(setup).length).fill(false);
}

export function endTurn() {
Expand Down
2 changes: 1 addition & 1 deletion src/data/effects.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"E01":{"name":"Healing [HP +1]","onAdd":[["modAttr","hp",1]],"quantity":0},"E02":{"name":"Damage [HP -1]","onAdd":[["modAttr","hp",-1]],"quantity":0},"E03":{"name":"Deathmatch [MP +1]","onAdd":[["modAttr","mp",1]],"quantity":0}}
{"E.01":{"name":"Healing [HP +1]","onAdd":[["modAttr","hp",1]],"quantity":0},"E.02":{"name":"Damage [HP -1]","onAdd":[["modAttr","hp",-1]],"quantity":0},"E.03":{"name":"Deathmatch [MP +1]","onAdd":[["modAttr","mp",1]],"quantity":0}}
2 changes: 1 addition & 1 deletion src/data/enemies.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"N01":{"placement":"P03","description":"A powerful enemy","ap":2,"dp":5}}
{"N.03":{"placement":"P.03","description":"pirates description","ap":3,"dp":4},"N.04":{"placement":"P.04","description":"pirates description","ap":3,"dp":4},"N.06":{"placement":"P.06","description":"kappa description","ap":4,"dp":4},"N.08":{"placement":"P.08","description":"stone giant desc","ap":5,"dp":5},"N.09":{"placement":"P.09","description":"centaur desc","ap":6,"dp":4},"N.10":{"placement":"P.10","description":"manticore desc","ap":8,"dp":7},"N.11":{"placement":"P.11","description":"sea serpent desc","ap":5,"dp":3}}
2 changes: 1 addition & 1 deletion src/data/placements.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"P01":{"token":"T01","values":["A2","C3","B4"]},"P02":{"token":"T01","values":["A3","C4","B5"]},"P03":{"token":"T02","values":["A1","C3","B4"]}}
{"P.01":{"token":"T.01","values":["P16","G23","Q15","K27"]},"P.02":{"token":"T.02","values":["K23","K23","K23","K23"]},"P.03":{"token":"T.03","values":["S13","B20","U19","G02"]},"P.04":{"token":"T.04","values":["K01","S05","T04","S13"]},"P.05":{"token":"T.05","values":["E05","D08","G17","E21"]},"P.06":{"token":"T.06","values":["G19","H16","J12","H18"]},"P.07":{"token":"T.07","values":["F30","Q27","F30","N28"]},"P.08":{"token":"T.08","values":["N28","E29","L30","P24"]},"P.09":{"token":"T.09","values":["J14","R20","I27","M17"]},"P.10":{"token":"T.10","values":["P08","K07","O05","P12"]},"P.11":{"token":"T.11","values":["B24","J30","B10","B24"]},"P.12":{"token":"T.12","values":["D12","L14","R22","F10"]},"P.13":{"token":"T.13","values":["I07","N08","J08","Q07"]},"P.14":{"token":"T.14","values":["E17","E17","E17","E17"]},"P.15":{"token":"T.14","values":["J28","J28","J28","J28"]},"P.16":{"token":"T.14","values":["R16","R16","R16","R16"]}}
2 changes: 1 addition & 1 deletion src/data/quests.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"Q.01":{"name":"Rightful Owner","description":"Hey! That belonges to me NOW. Defeat any player and steal one of their items.","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":3},"Q.02":{"name":"The Catcher in the Rye","description":"Take the mischievous gnome out of the farmland and lead him 10 hexes away from the crops.","behaviour":"<em>Draw an item card on complete</em>","onComplete":"","quantity":1},"Q.03":{"name":"Breaking the Ice","description":"There is always a good time for a fight. Win a duel with another player.","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":3},"Q.04":{"name":"Finding Nemo","description":"Escort the goldfish from the lake to the sea in the north. Move only through hexes along the longest river!","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":1},"Q.05":{"name":"Parley?","description":"A hidee hidee hidee ho! Find pirates and offer them an item.","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":1},"Q.06":{"name":"Wanted!","description":"Find these pirates and send them straight to the Davy Jones' Locker! For defeating them you'll be awarded.","behaviour":"<em>Draw an item card on complete</em>","onComplete":"","quantity":1},"Q.07":{"name":"Self-sacrifice","description":"You're a madman. Sacrifice your life for eternal glory!","behaviour":"Removes <b>2 HP</b></br>Adds <b>1 MP</b> on complete","onComplete":[["modAttr","hp",-2],["modAttr","mp",1]],"quantity":1},"Q.08":{"name":"Your Lucky Day","description":"Leprechaun has appeared! Pick 3 item cards and choose one. Then the next player in line chooses from remaining cards.","behaviour":"<em>Draw an item card on complete</em>","onComplete":"","quantity":1},"Q.09":{"name":"Kiss of Love","description":"Go to the marshes and kiss the princess who was turned into a poisonous frog. Be a man and break her curse.","behaviour":"Removes <b>1 HP</b></br>Adds <b>1 MP</b> on complete","onComplete":[["modAttr","hp",-1],["modAttr","mp",1]],"quantity":1},"Q.10":{"name":"Find the Drunk Master","description":"Psst! There is a rumor that the Drunk Master is back in town. Always roll the dice when you step into the town. If you roll 6, he'll give you a present.","behaviour":"<em>Draw an item card on complete</em>","onComplete":"","quantity":2},"Q.11":{"name":"Smells like Seafood","description":"The old hermit crab has left its treasures for you. Find and search his shell (U07).","behaviour":"<em>Draw <b>2 </b> item cards on complete</em>","onComplete":"","quantity":1},"Q.12":{"name":"Sailor's Repose","description":"The lighthouse keeper took an arrow in the knee! He asks you to be the one to light the northern lighthouse today (B14).","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":1},"Q.13":{"name":"Hey Kappa Kappa","description":"The vicious Kappa is attacking innocent residents of the nearby town. Defeat the creature and gain the citizens' favour!","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":1},"Q.14":{"name":"The Olympic Cruise","description":"Hold your horses and find yourself a ship. This is a time to sink into the real adventure! Swim through five ice rocks.","behaviour":"Adds <b>2 MP</b> on complete","onComplete":[["modAttr","mp",2]],"quantity":2},"Q.15":{"name":"You've Got a Friend in Me","description":"Little Yeti is lonely and would like to have someone to play with. Stay with him on his mountain for two turns.","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":2},"WQ.1":{"name":"Tough One","description":"Hunt down the stone giant in the highlands. But be ready for some tough fight.","behaviour":"Adds <b>2 MP</b> on complete","onComplete":[["modAttr","mp",2]],"quantity":1},"WQ.2":{"name":"Waidmanns Heil","description":"The hunters' song has risen. The hunt for the centaur in the forest has started!","behaviour":"Adds <b>2 MP</b> on complete","onComplete":[["modAttr","mp",2]],"quantity":1},"WQ.3":{"name":"Venomous Foe","description":"Beware of the Great Manticore! The monster lies in the desert. Hunt it down if you can...","behaviour":"Adds <b>3 MP</b> on complete","onComplete":[["modAttr","mp",3]],"quantity":1},"WQ.4":{"name":"Aquatic Noodle","description":"The sea serpent is sinking ships. Kill it and restore a peace to the seas.","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":1},"WQ.5":{"name":"Friends with nature","description":"Generous Leshy will give the items he found in his forest to the first person who finds him!","behaviour":"<em>Draw an item card on complete</em>","onComplete":"","quantity":2},"WQ.6":{"name":"A Song of Ice and Fire","description":"Seek one stone cold and the other hot-blooded. Stand once on both vulcanos (G33 & I31).","behaviour":"Adds <b>2 MP</b> on complete","onComplete":[["modAttr","mp",2]],"quantity":1},"WQ.7":{"name":"Time for Castling","description":"Stand on the castle field and defend it for 3 turns. Be careful! The sands are hot and the countdown resets if you leave the castle grounds.","behaviour":"Adds <b>3 MP</b> on complete","onComplete":[["modAttr","mp",3]],"quantity":1}}
{"Q.01":{"name":"Rightful Owner","description":"Hey! That belonges to me NOW. Defeat any player and steal one of their items.","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":3},"Q.02":{"name":"The Catcher in the Rye","description":"Take the mischievous gnome out of the farmland and lead him 10 hexes away from the crops.","behaviour":"<em>Draw an item card on complete</em>","onComplete":"","quantity":1},"Q.03":{"name":"Breaking the Ice","description":"There is always a good time for a fight. Win a duel with another player.","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":4},"Q.04":{"name":"Finding Nemo","description":"Escort the goldfish from the lake to the sea in the north. Move only through hexes along the longest river!","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":1},"Q.05":{"name":"Parley?","description":"A hidee hidee hidee ho! Find pirates and offer them an item.","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":1},"Q.06":{"name":"Wanted!","description":"Find these pirates and send them straight to the Davy Jones' Locker! For defeating them you'll be awarded.","behaviour":"<em>Draw an item card on complete</em>","onComplete":"","quantity":1},"Q.07":{"name":"Self-sacrifice","description":"You're a madman. Sacrifice your life for eternal glory!","behaviour":"Removes <b>2 HP</b></br>Adds <b>1 MP</b> on complete","onComplete":[["modAttr","hp",-2],["modAttr","mp",1]],"quantity":2},"Q.08":{"name":"Your Lucky Day","description":"Leprechaun has appeared! Pick 3 item cards and choose one. Then the next player in line chooses one card from remaining cards.","behaviour":"<em>Draw an item card on complete</em>","onComplete":"","quantity":1},"Q.09":{"name":"Kiss of Love","description":"Go to the marshes and kiss the princess who was turned into a poisonous frog. Be a man and break her curse.","behaviour":"Removes <b>1 HP</b></br>Adds <b>1 MP</b> on complete","onComplete":[["modAttr","hp",-1],["modAttr","mp",1]],"quantity":1},"Q.10":{"name":"Find the Drunk Master","description":"Psst! There is a rumor that the Drunk Master is back in town. Always roll the dice when you step into the town. If you roll 6, he'll give you a present.","behaviour":"<em>Draw an item card on complete</em>","onComplete":"","quantity":2},"Q.11":{"name":"Smells like Seafood","description":"The old hermit crab has left its treasures for you. Find and search his shell (U07).","behaviour":"<em>Draw <b>2 </b> item cards on complete</em>","onComplete":"","quantity":1},"Q.12":{"name":"Sailor's Repose","description":"The lighthouse keeper took an arrow in the knee! He asks you to be the one to light the northern lighthouse today (B14).","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":1},"Q.13":{"name":"Hey Kappa Kappa","description":"The vicious Kappa is attacking innocent residents of the nearby town. Defeat the creature and gain the citizens' favour!","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":1},"Q.14":{"name":"The Olympic Cruise","description":"Hold your horses and find yourself a ship. This is a time to sink into the real adventure! Swim through five ice rocks.","behaviour":"Adds <b>2 MP</b> on complete","onComplete":[["modAttr","mp",2]],"quantity":2},"Q.15":{"name":"You've Got a Friend in Me","description":"Little Yeti is lonely and would like to have someone to play with. Stay with him on his mountain for two turns.","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":2},"WQ.1":{"name":"Tough One","description":"Hunt down the stone giant in the highlands. But be ready for some tough fight.","behaviour":"Adds <b>2 MP</b> on complete","onComplete":[["modAttr","mp",2]],"quantity":1},"WQ.2":{"name":"Waidmanns Heil","description":"The hunters' song has risen. The hunt for the centaur in the forest has begun!","behaviour":"Adds <b>2 MP</b> on complete","onComplete":[["modAttr","mp",2]],"quantity":1},"WQ.3":{"name":"Venomous Foe","description":"Beware of the Great Manticore! The monster lies in the desert. Hunt it down if you can...","behaviour":"Adds <b>3 MP</b> on complete","onComplete":[["modAttr","mp",3]],"quantity":1},"WQ.4":{"name":"Aquatic Noodle","description":"The sea serpent is sinking ships. Kill it and restore a peace to the seas.","behaviour":"Adds <b>1 MP</b> on complete","onComplete":[["modAttr","mp",1]],"quantity":1},"WQ.5":{"name":"Friends with nature","description":"Generous Leshy will give the items he found in his forest to the first person who finds him!","behaviour":"<em>Draw an item card on complete</em>","onComplete":"","quantity":2},"WQ.6":{"name":"A Song of Ice and Fire","description":"Seek one stone cold and the other hot-blooded. Stand once on both vulcanos (G33 & I31).","behaviour":"Adds <b>2 MP</b> on complete","onComplete":[["modAttr","mp",2]],"quantity":1},"WQ.7":{"name":"Time for Castling","description":"Stand on the castle field and defend it for 3 turns. Be careful! The sands are hot and the countdown resets if you leave the castle grounds.","behaviour":"Adds <b>3 MP</b> on complete","onComplete":[["modAttr","mp",3]],"quantity":1}}
2 changes: 1 addition & 1 deletion src/data/setup.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"P01":{},"P02":{},"P03":{}}
{"P.01":{},"P.02":{},"P.03":{},"P.04":{},"P.05":{},"P.07":{},"P.12":{},"P.13":{},"P.14":{},"P.15":{},"P.16":{}}
2 changes: 1 addition & 1 deletion src/data/tokens.json
Original file line number Diff line number Diff line change
@@ -1 +1 @@
{"T01":{"name":"Test"},"T02":{"name":"Test Monster"}}
{"T.01":{"name":"Gnome"},"T.02":{"name":"Goldfish"},"T.03":{"name":"Pirates"},"T.04":{"name":"Pirates"},"T.05":{"name":"Princess Frog"},"T.06":{"name":"Kappa"},"T.07":{"name":"Yeti"},"T.08":{"name":"Stone Giant"},"T.09":{"name":"Centaur"},"T.10":{"name":"Manticore"},"T.11":{"name":"Sea Serpent"},"T.12":{"name":"Leshy"},"T.13":{"name":"Castle"},"T.14":{"name":"Ship"}}
7 changes: 7 additions & 0 deletions src/index.css
Original file line number Diff line number Diff line change
Expand Up @@ -90,11 +90,18 @@
.playing-card {
width: 70mm;
height: 97mm;
}

.playing-card-front {
box-shadow: inset 0 0 1em gray;
border-radius: 0.5em;
border-width: 0.15em;
}

.playing-card-reverse {
border: none;
}

@media print
{
.no-print, .no-print *
Expand Down
4 changes: 3 additions & 1 deletion src/pages/Deck.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ function Deck() {

function Reverses(props) {
return (
<div class="row">
<div class="row me-2" style="transform: scaleX(-1); -webkit-transform: scaleX(-1);">
<For each={props.batch}>
{(card)=>
<Reverse id={card.id} category={keys[card.key]}/>
Expand Down Expand Up @@ -88,7 +88,9 @@ function Deck() {
<>
<Faces batch={batch} />
<br />
<div>
<Reverses batch={batch} />
</div>
<br />
</>
}
Expand Down
6 changes: 3 additions & 3 deletions src/pages/components/Cards.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { parseHTML } from "../../Utils";
export function Face(props) {
const card = categories[props.category][props.id];
return(
<div class="card border-secondary playing-card ms-1 my-1">
<div class="card border-secondary playing-card playing-card-front ms-1 my-1">
<h5 class="my-2">{props.id}</h5>
<div class="pe-2 ps-2">
<h5 class="card-title text-center mb-2 my-2" style="font-family: 'Cinzel', serif;">{card.name}</h5>
Expand All @@ -21,8 +21,8 @@ export function Face(props) {
export function Reverse(props) {
const id = props.id.substring(0, props.id.indexOf('.'));
return(
<div class="card border-secondary playing-card ms-1 my-1">
<div class="text-center my-auto" style="filter: invert(71%) sepia(3%) saturate(22%) hue-rotate(328deg) brightness(101%) contrast(86%);">
<div class="card playing-card playing-card-reverse ms-1 my-1">
<div class="text-center my-auto ms-1" style="filter: invert(71%) sepia(3%) saturate(22%) hue-rotate(328deg) brightness(101%) contrast(86%); transform: scaleX(-1); -webkit-transform: scaleX(-1);">
<img src={reverses[id]?.url} width="100" height="100" />
</div>
</div>
Expand Down
4 changes: 2 additions & 2 deletions src/pages/components/EnemyManagement.jsx
Original file line number Diff line number Diff line change
Expand Up @@ -63,8 +63,8 @@ export function EnemyList() {

<ModalOk id="enemy-place-token" title="Place token" body={
<div>
<p class="text-center">Place token on board:</p>
<Label id={placement(active().id).token} name={token(active().id).name} />
<p class="text-center">Place following token at <strong>{placement(value()).values[game.placement]}</strong>:</p>
<Label id={placement(value()).token} name={token(value()).name} />
</div>
}/>

Expand Down

0 comments on commit 39c796f

Please sign in to comment.