=5?(r("success"),s("attack",1,5)):r("notEnough"):2===e?c>=10?(r("success"),s("attack",3,10)):r("notEnough"):3===e&&(c>=5?(r("success"),s("health",10,5)):r("notEnough")):1===e?c>=10?(r("success"),s("attack",1,10)):r("notEnough"):2===e?c>=20?(r("success"),s("attack",3,20)):r("notEnough"):3===e&&(c>=5?(r("success"),s("health",5,5)):r("notEnough"))};return Object(g.jsx)(k.a,{onClose:function(){r(null),i()},open:t,children:Object(g.jsxs)("div",{style:{color:"white",backgroundColor:"#121E24",border:"2px solid white"},children:[Object(g.jsx)(O.a,{children:"store"}),Object(g.jsxs)(x.a,{children:[Object(g.jsxs)(m.a,{gutterBottom:!0,children:["buy more attack power",Object(g.jsxs)("button",{onClick:function(){return d(1)},children:["+1 (","easy"===a?"5":"10"," gold)"]}),Object(g.jsxs)("button",{onClick:function(){return d(2)},children:["+3 (","easy"===a?"10":"20"," gold)"]})]}),Object(g.jsxs)(m.a,{gutterBottom:!0,children:["buy more health","easy"===a?Object(g.jsx)("button",{onClick:function(){return d(3)},children:"+10 (5 gold)"}):Object(g.jsx)("button",{onClick:function(){return d(3)},children:"+5 (5 gold)"})]}),Object(g.jsx)(m.a,{gutterBottom:!0,children:"success"===u?Object(g.jsx)("small",{style:{color:"lightgreen"},children:"success!"}):"notEnough"===u?Object(g.jsx)("small",{style:{color:"red"},children:"not enough gold"}):Object(g.jsx)("small",{style:{visibility:"hidden"},children:"-"})})]})]})})},C=function(e){var i=e.onOpen,t=e.onClose;return Object(g.jsx)(k.a,{onClose:function(){t()},open:i,children:Object(g.jsxs)("div",{style:{color:"white",backgroundColor:"#121E24",border:"2px solid white"},children:[Object(g.jsx)(O.a,{children:"how to play"}),Object(g.jsxs)(x.a,{children:[Object(g.jsx)(m.a,{gutterBottom:!0,children:"clear the dungeon of all its monsters and treasures!"}),Object(g.jsx)(m.a,{gutterBottom:!0,children:'begin by receiving an initial health value, randomly selected from 1-20, and an inital attack power value, randomly selected from 1-8. the game is played out of a 52 standard card deck, shuffled up and laid face-down in a 5*10 grid. the last 2 cards are presented to you face-up at the beginning of the game as a "soft" entrance into the dungeon - you select the one you want and the other is discarded.'}),Object(g.jsx)(m.a,{gutterBottom:!0,children:"you then flip over each card and interact with it to clear it. you can only select those that are adjacent to an empty space except for the first card. hearts give you more health and diamonds give you more gold. you roll to determine how much health or gold you get depending on the card's value. for example, if you encountered the 5 of hearts, you will receive an increase in health - randomly selected from 1 to 5."}),Object(g.jsx)(m.a,{gutterBottom:!0,children:"spades and clubs are the enemies of the dungeon. the health of an enemy is equivalent to their card's value. the damage you do to an enemy will be a random value between 1 and the value of your attack power. the damage an enemy does to you will be a random value between 1 and their card's value. a battle between an enemy will end when their health reaches 0 or when your health reaches 0. when you defeat a spade, roll for health, according to the card's value. when defeating a club, roll for gold."}),Object(g.jsx)(m.a,{gutterBottom:!0,children:"use the gold you earn at the shop to upgrade your attack power or get more health. the difficulty of the game determines the prices at the shop."}),Object(g.jsxs)(m.a,{gutterBottom:!0,children:["any questions or concerns, contact me at shaefferjd at gmail dot com. the code for this project lives on"," ",Object(g.jsx)("a",{href:"https://github.com/jdshaeffer/dungeon-solitaire",children:"github"}),"."]})]})]})})},S=0,B=function(e){return Math.ceil(Math.random()*e)},E=function(){var e=Object(p.a)(y.a.mark((function e(){return y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=!0,e.next=3,new Promise((function(e){return setTimeout(e,1500)}));case 3:c=!1;case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),F=function(e){var i=e.difficulty,t=Object(n.useState)(0),o=Object(v.a)(t,2),u=o[0],r=o[1],d=Object(n.useState)(0),b=Object(v.a)(d,2),j=b[0],k=b[1],O=Object(n.useState)(0),x=Object(v.a)(O,2),m=x[0],F=x[1],N=Object(n.useState)(0),M=Object(v.a)(N,2),q=M[0],P=M[1],T=Object(n.useState)(null),A=Object(v.a)(T,2),I=A[0],J=A[1],L=Object(n.useState)("roll for initial health"),D=Object(v.a)(L,2),z=D[0],G=D[1],H=Object(n.useState)(0),K=Object(v.a)(H,2),Q=K[0],R=K[1],U=Object(n.useState)(!1),V=Object(v.a)(U,2),W=V[0],X=V[1],Y=Object(n.useState)(!1),Z=Object(v.a)(Y,2),$=Z[0],_=Z[1],ee=Object(n.useState)(function(e){for(var i,t=e.length;0!==t;){i=Math.floor(Math.random()*t),t--;var c=[e[i],e[t]];e[t]=c[0],e[i]=c[1]}return s=[e.pop(),e.pop()].map((function(e){return Object(f.a)(Object(f.a)({},e),{},{clicked:!0,display:"block",selected:!1})})),e}([{pow:2,value:"2",suit:"spades",clicked:!1,visibility:"visible"},{pow:3,value:"3",suit:"spades",clicked:!1,visibility:"visible"},{pow:4,value:"4",suit:"spades",clicked:!1,visibility:"visible"},{pow:5,value:"5",suit:"spades",clicked:!1,visibility:"visible"},{pow:6,value:"6",suit:"spades",clicked:!1,visibility:"visible"},{pow:7,value:"7",suit:"spades",clicked:!1,visibility:"visible"},{pow:8,value:"8",suit:"spades",clicked:!1,visibility:"visible"},{pow:9,value:"9",suit:"spades",clicked:!1,visibility:"visible"},{pow:10,value:"10",suit:"spades",clicked:!1,visibility:"visible"},{pow:11,value:"jack",suit:"spades",clicked:!1,visibility:"visible"},{pow:12,value:"queen",suit:"spades",clicked:!1,visibility:"visible"},{pow:13,value:"king",suit:"spades",clicked:!1,visibility:"visible"},{pow:14,value:"ace",suit:"spades",clicked:!1,visibility:"visible"},{pow:2,value:"2",suit:"clubs",clicked:!1,visibility:"visible"},{pow:3,value:"3",suit:"clubs",clicked:!1,visibility:"visible"},{pow:4,value:"4",suit:"clubs",clicked:!1,visibility:"visible"},{pow:5,value:"5",suit:"clubs",clicked:!1,visibility:"visible"},{pow:6,value:"6",suit:"clubs",clicked:!1,visibility:"visible"},{pow:7,value:"7",suit:"clubs",clicked:!1,visibility:"visible"},{pow:8,value:"8",suit:"clubs",clicked:!1,visibility:"visible"},{pow:9,value:"9",suit:"clubs",clicked:!1,visibility:"visible"},{pow:10,value:"10",suit:"clubs",clicked:!1,visibility:"visible"},{pow:11,value:"jack",suit:"clubs",clicked:!1,visibility:"visible"},{pow:12,value:"queen",suit:"clubs",clicked:!1,visibility:"visible"},{pow:13,value:"king",suit:"clubs",clicked:!1,visibility:"visible"},{pow:14,value:"ace",suit:"clubs",clicked:!1,visibility:"visible"},{pow:2,value:"2",suit:"hearts",clicked:!1,visibility:"visible"},{pow:3,value:"3",suit:"hearts",clicked:!1,visibility:"visible"},{pow:4,value:"4",suit:"hearts",clicked:!1,visibility:"visible"},{pow:5,value:"5",suit:"hearts",clicked:!1,visibility:"visible"},{pow:6,value:"6",suit:"hearts",clicked:!1,visibility:"visible"},{pow:7,value:"7",suit:"hearts",clicked:!1,visibility:"visible"},{pow:8,value:"8",suit:"hearts",clicked:!1,visibility:"visible"},{pow:9,value:"9",suit:"hearts",clicked:!1,visibility:"visible"},{pow:10,value:"10",suit:"hearts",clicked:!1,visibility:"visible"},{pow:11,value:"jack",suit:"hearts",clicked:!1,visibility:"visible"},{pow:12,value:"queen",suit:"hearts",clicked:!1,visibility:"visible"},{pow:13,value:"king",suit:"hearts",clicked:!1,visibility:"visible"},{pow:14,value:"ace",suit:"hearts",clicked:!1,visibility:"visible"},{pow:2,value:"2",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:3,value:"3",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:4,value:"4",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:5,value:"5",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:6,value:"6",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:7,value:"7",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:8,value:"8",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:9,value:"9",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:10,value:"10",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:11,value:"jack",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:12,value:"queen",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:13,value:"king",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:14,value:"ace",suit:"diamonds",clicked:!1,visibility:"visible"}])),ie=Object(v.a)(ee,2),te=ie[0],se=ie[1],ce=Object(n.useState)(s),ae=Object(v.a)(ce,2),le=ae[0],ne=ae[1],oe=Object(n.useState)(!1),ue=Object(v.a)(oe,2),re=ue[0],de=ue[1],be=function(e){var i=B(I.pow);"gold"===e?F(m+i):r(u+i),G("your ".concat(e," increased by ").concat(i)),a=!1,l=!1;var t=le.length?le[le.indexOf(I)]:te[te.indexOf(I)];t.visibility="hidden",te[te.indexOf(I)]=t,J(null),se(Object(h.a)(te))},he=function(){var e=Object(p.a)(y.a.mark((function e(){var i,t,s,n,o,d,b;return y.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==q){e.next=5;break}r(B(20)),G("roll for initial attack power"),e.next=60;break;case 5:if(1!==q){e.next=10;break}k(B(8)),G("select one of the above cards to begin"),e.next=60;break;case 10:if(!I||c){e.next=60;break}if(!a){e.next=15;break}be("gold"),e.next=49;break;case 15:if(!l){e.next=19;break}be("health"),e.next=49;break;case 19:if(i=I.pow,"diamonds"!==I.suit){e.next=26;break}t=B(i),F(m+t),G("your gold increased by ".concat(t)),e.next=48;break;case 26:if("hearts"!==I.suit){e.next=32;break}s=B(i),r(u+s),G("your health increased by ".concat(s)),e.next=48;break;case 32:if(n=B(j),R(Q-n<0?0:Q-n),!(Q-n<1)&&Q){e.next=39;break}G("you dealt ".concat(n," damage.\n\t\t\t\t\t\t\t\tyou defeated the ").concat(I.value," of ").concat(I.suit,".\n\t\t\t\t\t\t\t\troll for ").concat("clubs"===I.suit?"gold":"health",".")),"clubs"===I.suit?a=!0:l=!0,e.next=48;break;case 39:return G("you dealt ".concat(n," damage...")),e.next=42,E();case 42:return G("the enemy is now attacking..."),e.next=45,E();case 45:o=B(i),r(u-o<0?0:u-o),u-o<1?(G("the enemy dealt ".concat(o," damage. you died. refresh to try again.")),ne([]),se([]),c=!0):G("the enemy dealt ".concat(o," damage. attack again."));case 48:Q<1&&J(null);case 49:if(!(I.display&&Q<1&&0!==u)){e.next=59;break}return e.next=52,E();case 52:return G("entering the dungeon..."),e.next=55,E();case 55:ne([]),G("select any card to begin"),e.next=60;break;case 59:Q<1&&(d=Object(h.a)(te),(b=te[te.indexOf(I)]).visibility="hidden",te[te.indexOf(I)]=b,se(d));case 60:P(q+1);case 61:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.useEffect)((function(){te.every((function(e){return"hidden"===e.visibility}))&&u>0&&de(!0)}),[u,te]),Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("h1",{style:{display:re?"block":"none"},children:"bravo, you did it!"}),le.length||re?Object(g.jsx)(g.Fragment,{}):Object(g.jsx)("div",{className:"cards",children:te.map((function(e,i){return Object(g.jsx)("div",{className:"card",onClick:function(){return function(e){if(!e.clicked&&!I){var i=te.indexOf(e);if(te[i+1]&&"hidden"===te[i+1].visibility||te[i-1]&&"hidden"===te[i-1].visibility||te[i+10]&&"hidden"===te[i+10].visibility||te[Math.abs(i-10)]&&"hidden"===te[Math.abs(i-10)].visibility||0===S){var t=Object(h.a)(te),s=te[te.indexOf(e)];s.clicked=!0,te[te.indexOf(e)]=s,se(t),J(e),"spades"!==e.suit&&"clubs"!==e.suit||R(e.pow);var c="hearts"===e.suit?"for health":"diamonds"===e.suit?"for gold":"to attack";G("the ".concat(e.value," of ").concat(e.suit,". roll ").concat(c,".")),S++}else console.log("can't pick that one")}}(e)},style:{visibility:e.visibility},children:e.clicked?"".concat("10"===e.value?e.value.substring(0,2):e.value[0]," ").concat(e.suit[0]):""},i)}))}),q>1?Object(g.jsx)("div",{className:"entrance-cards",children:le.map((function(e,i){return Object(g.jsx)("div",{className:"card",onClick:function(){return function(e){if(!e.selected){var i=Object(h.a)(le),t=le[le.indexOf(e)];t.selected=!0,le[le.indexOf(e)]=t,ne(i.filter((function(e){return e.selected}))),J(e),"spades"!==e.suit&&"clubs"!==e.suit||R(e.pow);var s="hearts"===e.suit?"for health":"diamonds"===e.suit?"for gold":"to attack";G("you selected the ".concat(e.value," of ").concat(e.suit,". roll ").concat(s,"."))}}(e)},style:{display:e.display},children:e.clicked?"".concat("10"===e.value?e.value.substring(0,2):e.value[0]," ").concat(e.suit[0]):""},i)}))}):Object(g.jsx)(g.Fragment,{}),Object(g.jsxs)("div",{className:"stats-container",children:[Object(g.jsxs)("small",{className:"stat",children:["health: ",u]}),Object(g.jsxs)("small",{className:"stat",children:["attack: ",j]}),Object(g.jsxs)("small",{className:"stat",children:["gold: ",m]}),Q?Object(g.jsxs)("small",{className:"stat",children:["enemy health: ",Q]}):Object(g.jsx)(g.Fragment,{})]}),Object(g.jsx)("div",{children:Object(g.jsx)("small",{children:re?"refresh to play again, or try a different difficulty. thanks for playing!":z})}),Object(g.jsx)("div",{children:Object(g.jsx)("button",{onClick:he,style:{display:0===q||u>0&&!re?"block":"none"},children:"roll"})}),Object(g.jsx)("button",{onClick:function(){X(!0)},style:{position:"absolute",left:80,bottom:10,display:re?"none":"block "},children:"store"}),Object(g.jsx)("button",{onClick:function(){_(!0)},style:{position:"absolute",left:10,bottom:10},children:"help"}),Object(g.jsx)(w,{onOpen:W,onClose:function(){X(!1)},storeFunction:function(e,i,t){"attack"===e?k(j+i):"health"===e&&r(u+i),F(m-t)},gold:m,difficulty:i}),Object(g.jsx)(C,{onOpen:$,onClose:function(){_(!1)}})]})},N=function(){return Object(g.jsxs)(g.Fragment,{children:[Object(g.jsx)("h1",{children:"welcome to dungeon solitaire (in beta)"}),Object(g.jsx)("h3",{children:"pick a difficulty:"}),Object(g.jsxs)("div",{children:[Object(g.jsx)(d.b,{to:"/easy",children:Object(g.jsx)("button",{children:"easy"})}),Object(g.jsx)(d.b,{to:"/hard",children:Object(g.jsx)("button",{children:"hard"})})]})]})},M=function(){return Object(g.jsx)("div",{className:"App",children:Object(g.jsx)("header",{className:"App-header",children:Object(g.jsx)(d.a,{children:Object(g.jsxs)(b.c,{children:[Object(g.jsx)(b.a,{exact:!0,path:"/",children:Object(g.jsx)(N,{})}),Object(g.jsx)(b.a,{path:"/easy",children:Object(g.jsx)(F,{difficulty:"easy"})}),Object(g.jsx)(b.a,{path:"/hard",children:Object(g.jsx)(F,{difficulty:"hard"})})]})})})})},q=function(e){e&&e instanceof Function&&t.e(3).then(t.bind(null,88)).then((function(i){var t=i.getCLS,s=i.getFID,c=i.getFCP,a=i.getLCP,l=i.getTTFB;t(e),s(e),c(e),a(e),l(e)}))};r.a.render(Object(g.jsx)(o.a.StrictMode,{children:Object(g.jsx)(d.a,{children:Object(g.jsx)(M,{})})}),document.getElementById("root")),q()}},[[62,1,2]]]);
-//# sourceMappingURL=main.9584b9b0.chunk.js.map
\ No newline at end of file
diff --git a/static/js/main.9584b9b0.chunk.js.map b/static/js/main.9584b9b0.chunk.js.map
deleted file mode 100644
index 560cb5c..0000000
--- a/static/js/main.9584b9b0.chunk.js.map
+++ /dev/null
@@ -1 +0,0 @@
-{"version":3,"sources":["Game.js","Store.js","Tutorial.js","Intro.js","App.js","reportWebVitals.js","index.js"],"names":["enter","pause","goldAfterEnemy","healthAfterEnemy","Store","onClose","onOpen","storeFunction","gold","difficulty","useState","response","setResponse","handleStore","selection","Dialog","open","style","color","backgroundColor","border","DialogTitle","DialogContent","Typography","gutterBottom","onClick","visibility","Tutorial","href","cardCounter","rand","max","Math","ceil","random","sleep","a","Promise","r","setTimeout","Game","health","setHealth","attack","setAttack","setGold","counter","setCounter","currentCard","setCurrentCard","commentary","setCommentary","enemyHealth","setEnemyHealth","storeOpen","setStoreOpen","tutorialOpen","setTutorialOpen","arr","randomIndex","currentIndex","length","floor","pop","map","el","clicked","display","selected","shuffle","pow","value","suit","cards","setCards","entranceCards","setEntranceCards","win","setWin","afterEnemyPickup","type","increase","cardToChange","indexOf","roll","damage","enemyDamage","copyOfCards","useEffect","every","card","className","i","abs","action","console","log","onCardClick","substring","filter","onEntranceCardClick","position","left","bottom","amount","price","Intro","to","App","exact","path","reportWebVitals","onPerfEntry","Function","then","getCLS","getFID","getFCP","getLCP","getTTFB","ReactDOM","render","StrictMode","document","getElementById"],"mappings":"kLAIIA,EACAC,EACAC,EACAC,E,uJCuGWC,EArGD,SAAC,GAA0D,IAAxDC,EAAuD,EAAvDA,QAASC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,cAAeC,EAAuB,EAAvBA,KAAMC,EAAiB,EAAjBA,WAAiB,EACtCC,qBADsC,mBAC/DC,EAD+D,KACrDC,EADqD,KAQhEC,EAAc,SAACC,GACA,SAAfL,EACgB,IAAdK,EACEN,GAAQ,GACVI,EAAY,WACZL,EAAc,SAAU,EAAG,IAE3BK,EAAY,aAES,IAAdE,EACLN,GAAQ,IACVI,EAAY,WACZL,EAAc,SAAU,EAAG,KAE3BK,EAAY,aAES,IAAdE,IACLN,GAAQ,GACVI,EAAY,WACZL,EAAc,SAAU,GAAI,IAE5BK,EAAY,cAIE,IAAdE,EACEN,GAAQ,IACVI,EAAY,WACZL,EAAc,SAAU,EAAG,KAE3BK,EAAY,aAES,IAAdE,EACLN,GAAQ,IACVI,EAAY,WACZL,EAAc,SAAU,EAAG,KAE3BK,EAAY,aAES,IAAdE,IACLN,GAAQ,GACVI,EAAY,WACZL,EAAc,SAAU,EAAG,IAE3BK,EAAY,eAMpB,OACE,cAACG,EAAA,EAAD,CAAQV,QAxDU,WAClBO,EAAY,MACZP,KAsD8BW,KAAMV,EAApC,SACE,sBACEW,MAAO,CACLC,MAAO,QACPC,gBAAiB,UACjBC,OAAQ,mBAJZ,UAOE,cAACC,EAAA,EAAD,oBACA,eAACC,EAAA,EAAD,WACE,eAACC,EAAA,EAAD,CAAYC,cAAY,EAAxB,kCAEE,yBAAQC,QAAS,kBAAMZ,EAAY,IAAnC,iBACsB,SAAfJ,EAAwB,IAAM,KADrC,YAGA,yBAAQgB,QAAS,kBAAMZ,EAAY,IAAnC,iBACsB,SAAfJ,EAAwB,KAAO,KADtC,eAIF,eAACc,EAA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AAOqG,KAAK,QAAZ,SACE,cAAC,EAAD,CAAMrG,WAAW,qBCNhBsG,EAZS,SAACC,GACnBA,GAAeA,aAAuBC,UACxC,6BAAqBC,MAAK,YAAkD,IAA/CC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,OAAQC,EAA8B,EAA9BA,OAAQC,EAAsB,EAAtBA,OAAQC,EAAc,EAAdA,QAC3DJ,EAAOH,GACPI,EAAOJ,GACPK,EAAOL,GACPM,EAAON,GACPO,EAAQP,OCAdQ,IAASC,OACP,cAAC,IAAMC,WAAP,UACE,cAAC,IAAD,UACE,cAAC,EAAD,QAGJC,SAASC,eAAe,SAM1Bb,M","file":"static/js/main.9584b9b0.chunk.js","sourcesContent":["import { useState, useEffect } from 'react';\nimport Store from './Store';\nimport Tutorial from './Tutorial';\n\nlet enter;\nlet pause;\nlet goldAfterEnemy;\nlet healthAfterEnemy;\nlet cardCounter = 0;\n// the fisher-yates shuffle algorithm\nconst shuffle = (arr) => {\n let currentIndex = arr.length,\n randomIndex;\n // while there remain elements to shuffle\n while (currentIndex !== 0) {\n // pick a remaining element\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex--;\n // and swap it with the current element\n [arr[currentIndex], arr[randomIndex]] = [\n arr[randomIndex],\n arr[currentIndex],\n ];\n }\n\n enter = [arr.pop(), arr.pop()].map((el) => {\n return { ...el, clicked: true, display: 'block', selected: false };\n });\n return arr;\n};\n\nconst rand = (max) => {\n return Math.ceil(Math.random() * max);\n};\n\nconst sleep = async () => {\n pause = true;\n await new Promise((r) => setTimeout(r, 1500));\n pause = false;\n};\n\nconst Game = ({ difficulty }) => {\n const [health, setHealth] = useState(0);\n const [attack, setAttack] = useState(0);\n const [gold, setGold] = useState(0);\n const [counter, setCounter] = useState(0);\n const [currentCard, setCurrentCard] = useState(null);\n const [commentary, setCommentary] = useState('roll for initial health');\n const [enemyHealth, setEnemyHealth] = useState(0);\n const [storeOpen, setStoreOpen] = useState(false);\n const [tutorialOpen, setTutorialOpen] = useState(false);\n const [cards, setCards] = useState(\n shuffle([\n {\n pow: 2,\n value: '2',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 3,\n value: '3',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 4,\n value: '4',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 5,\n value: '5',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 6,\n value: '6',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 7,\n value: '7',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 8,\n value: '8',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 9,\n value: '9',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 10,\n value: '10',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 11,\n value: 'jack',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 12,\n value: 'queen',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 13,\n value: 'king',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 14,\n value: 'ace',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 2,\n value: '2',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 3,\n value: '3',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 4,\n value: '4',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 5,\n value: '5',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 6,\n value: '6',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 7,\n value: '7',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 8,\n value: '8',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 9,\n value: '9',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 10,\n value: '10',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 11,\n value: 'jack',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 12,\n value: 'queen',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 13,\n value: 'king',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 14,\n value: 'ace',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 2,\n value: '2',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 3,\n value: '3',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 4,\n value: '4',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 5,\n value: '5',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 6,\n value: '6',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 7,\n value: '7',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 8,\n value: '8',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 9,\n value: '9',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 10,\n value: '10',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 11,\n value: 'jack',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 12,\n value: 'queen',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 13,\n value: 'king',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 14,\n value: 'ace',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 2,\n value: '2',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 3,\n value: '3',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 4,\n value: '4',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 5,\n value: '5',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 6,\n value: '6',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 7,\n value: '7',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 8,\n value: '8',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 9,\n value: '9',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 10,\n value: '10',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 11,\n value: 'jack',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 12,\n value: 'queen',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 13,\n value: 'king',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 14,\n value: 'ace',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n ]),\n );\n const [entranceCards, setEntranceCards] = useState(enter);\n const [win, setWin] = useState(false);\n\n const onCardClick = (card) => {\n // flip over card\n if (!card.clicked && !currentCard) {\n // border check\n const i = cards.indexOf(card);\n if (\n (cards[i + 1] && cards[i + 1].visibility === 'hidden') ||\n (cards[i - 1] && cards[i - 1].visibility === 'hidden') ||\n (cards[i + 10] && cards[i + 10].visibility === 'hidden') ||\n (cards[Math.abs(i - 10)] &&\n cards[Math.abs(i - 10)].visibility === 'hidden') ||\n cardCounter === 0\n ) {\n let copyOfCards = [...cards];\n let cardToChange = cards[cards.indexOf(card)];\n cardToChange.clicked = true;\n cards[cards.indexOf(card)] = cardToChange;\n setCards(copyOfCards);\n setCurrentCard(card);\n\n // set up enemy health at card flip\n if (card.suit === 'spades' || card.suit === 'clubs') {\n setEnemyHealth(card.pow);\n }\n\n const action =\n card.suit === 'hearts'\n ? 'for health'\n : card.suit === 'diamonds'\n ? 'for gold'\n : 'to attack';\n setCommentary(`the ${card.value} of ${card.suit}. roll ${action}.`);\n cardCounter++;\n } else {\n console.log(`can't pick that one`);\n }\n }\n };\n\n const onEntranceCardClick = (card) => {\n if (!card.selected) {\n let copyOfCards = [...entranceCards];\n let cardToChange = entranceCards[entranceCards.indexOf(card)];\n cardToChange.selected = true;\n entranceCards[entranceCards.indexOf(card)] = cardToChange;\n setEntranceCards(copyOfCards.filter((card) => card.selected));\n setCurrentCard(card);\n\n // set up enemy health at card flip\n if (card.suit === 'spades' || card.suit === 'clubs') {\n setEnemyHealth(card.pow);\n }\n\n const action =\n card.suit === 'hearts'\n ? 'for health'\n : card.suit === 'diamonds'\n ? 'for gold'\n : 'to attack';\n setCommentary(\n `you selected the ${card.value} of ${card.suit}. roll ${action}.`,\n );\n }\n };\n\n const afterEnemyPickup = (type) => {\n // handling enemy drops - follows after enemy defeat - not super dry\n const increase = rand(currentCard.pow);\n type === 'gold' ? setGold(gold + increase) : setHealth(health + increase);\n setCommentary(`your ${type} increased by ${increase}`);\n goldAfterEnemy = false;\n healthAfterEnemy = false;\n\n let cardToChange = entranceCards.length\n ? entranceCards[entranceCards.indexOf(currentCard)]\n : cards[cards.indexOf(currentCard)];\n cardToChange.visibility = 'hidden';\n cards[cards.indexOf(currentCard)] = cardToChange;\n\n setCurrentCard(null);\n setCards([...cards]);\n };\n\n const roll = async () => {\n if (counter === 0) {\n // initial health set\n setHealth(rand(20));\n setCommentary(`roll for initial attack power`);\n } else if (counter === 1) {\n // initial attack set\n setAttack(rand(8));\n setCommentary(`select one of the above cards to begin`);\n } else {\n if (currentCard && !pause) {\n if (goldAfterEnemy) {\n afterEnemyPickup('gold');\n } else if (healthAfterEnemy) {\n afterEnemyPickup('health');\n } else {\n const value = currentCard.pow;\n if (currentCard.suit === 'diamonds') {\n // get gold\n const increase = rand(value);\n setGold(gold + increase);\n setCommentary(`your gold increased by ${increase}`);\n } else if (currentCard.suit === 'hearts') {\n // get health\n const increase = rand(value);\n setHealth(health + increase);\n setCommentary(`your health increased by ${increase}`);\n } else {\n // battle sequence\n const damage = rand(attack);\n setEnemyHealth(enemyHealth - damage < 0 ? 0 : enemyHealth - damage);\n\n if (enemyHealth - damage < 1 || !enemyHealth) {\n // when enemy dies\n setCommentary(`you dealt ${damage} damage.\n\t\t\t\t\t\t\t\tyou defeated the ${currentCard.value} of ${currentCard.suit}.\n\t\t\t\t\t\t\t\troll for ${currentCard.suit === 'clubs' ? 'gold' : 'health'}.`);\n if (currentCard.suit === 'clubs') {\n goldAfterEnemy = true;\n } else {\n healthAfterEnemy = true;\n }\n } else {\n setCommentary(`you dealt ${damage} damage...`);\n await sleep();\n setCommentary(`the enemy is now attacking...`);\n await sleep();\n const enemyDamage = rand(value);\n setHealth(health - enemyDamage < 0 ? 0 : health - enemyDamage);\n\n if (health - enemyDamage < 1) {\n // when player dies\n setCommentary(\n `the enemy dealt ${enemyDamage} damage. you died. refresh to try again.`,\n );\n setEntranceCards([]); // to cover entrance\n setCards([]);\n pause = true; // game end\n } else {\n setCommentary(\n `the enemy dealt ${enemyDamage} damage. attack again.`,\n ); // or roll away?\n }\n }\n }\n\n if (enemyHealth < 1) {\n setCurrentCard(null);\n }\n }\n\n if (currentCard.display && enemyHealth < 1 && health !== 0) {\n // handle entrance card disappearing after 1.5 seconds\n await sleep();\n setCommentary(`entering the dungeon...`);\n await sleep();\n setEntranceCards([]);\n setCommentary(`select any card to begin`);\n } else {\n // handle normal dissappearing of cards\n if (enemyHealth < 1) {\n let copyOfCards = [...cards];\n let cardToChange = cards[cards.indexOf(currentCard)];\n cardToChange.visibility = 'hidden';\n cards[cards.indexOf(currentCard)] = cardToChange;\n setCards(copyOfCards);\n }\n }\n }\n }\n\n setCounter(counter + 1);\n };\n\n const handleStoreOpen = () => {\n setStoreOpen(true);\n };\n\n const handleStoreClose = () => {\n setStoreOpen(false);\n };\n\n const storeFunction = (type, amount, price) => {\n if (type === 'attack') {\n setAttack(attack + amount);\n } else if (type === 'health') {\n setHealth(health + amount);\n }\n setGold(gold - price);\n };\n\n const handleTutorialOpen = () => {\n setTutorialOpen(true);\n };\n\n const handleTutorialClose = () => {\n setTutorialOpen(false);\n };\n\n useEffect(() => {\n if (cards.every((card) => card.visibility === 'hidden')) {\n if (health > 0) {\n setWin(true);\n }\n }\n }, [health, cards]);\n\n return (\n <>\n bravo, you did it!
\n {!entranceCards.length && !win ? (\n \n {cards.map((card, i) => {\n return (\n
onCardClick(card)}\n style={{ visibility: card.visibility }}\n >\n {card.clicked\n ? `${\n card.value === '10'\n ? card.value.substring(0, 2)\n : card.value[0]\n } ${card.suit[0]}`\n : ``}\n
\n );\n })}\n
\n ) : (\n <>>\n )}\n {counter > 1 ? (\n \n {entranceCards.map((card, i) => {\n return (\n
onEntranceCardClick(card)}\n style={{ display: card.display }}\n >\n {card.clicked\n ? `${\n card.value === '10'\n ? card.value.substring(0, 2)\n : card.value[0]\n } ${card.suit[0]}`\n : ``}\n
\n );\n })}\n
\n ) : (\n <>>\n )}\n \n health: {health}\n attack: {attack}\n gold: {gold}\n {enemyHealth ? (\n enemy health: {enemyHealth}\n ) : (\n <>>\n )}\n
\n \n \n {win\n ? 'refresh to play again, or try a different difficulty. thanks for playing!'\n : commentary}\n \n
\n \n \n
\n \n \n \n \n >\n );\n};\n\nexport default Game;\n","import { useState } from 'react';\nimport {\n Dialog,\n DialogContent,\n DialogTitle,\n Typography,\n} from '@material-ui/core';\nimport './App.css';\n\nconst Store = ({ onClose, onOpen, storeFunction, gold, difficulty }) => {\n const [response, setResponse] = useState();\n\n const handleClose = () => {\n setResponse(null);\n onClose();\n };\n\n const handleStore = (selection) => {\n if (difficulty === 'easy') {\n if (selection === 1) {\n if (gold >= 5) {\n setResponse('success');\n storeFunction('attack', 1, 5);\n } else {\n setResponse('notEnough');\n }\n } else if (selection === 2) {\n if (gold >= 10) {\n setResponse('success');\n storeFunction('attack', 3, 10);\n } else {\n setResponse('notEnough');\n }\n } else if (selection === 3) {\n if (gold >= 5) {\n setResponse('success');\n storeFunction('health', 10, 5);\n } else {\n setResponse('notEnough');\n }\n }\n } else {\n if (selection === 1) {\n if (gold >= 10) {\n setResponse('success');\n storeFunction('attack', 1, 10);\n } else {\n setResponse('notEnough');\n }\n } else if (selection === 2) {\n if (gold >= 20) {\n setResponse('success');\n storeFunction('attack', 3, 20);\n } else {\n setResponse('notEnough');\n }\n } else if (selection === 3) {\n if (gold >= 5) {\n setResponse('success');\n storeFunction('health', 5, 5);\n } else {\n setResponse('notEnough');\n }\n }\n }\n };\n\n return (\n \n );\n};\n\nexport default Store;\n","import {\n Dialog,\n DialogContent,\n DialogTitle,\n Typography,\n} from '@material-ui/core';\n\nconst Tutorial = ({ onOpen, onClose }) => {\n const handleClose = () => {\n onClose();\n };\n\n return (\n \n );\n};\n\nexport default Tutorial;\n","import { Link } from 'react-router-dom';\nimport './App.css';\n\nconst Intro = () => {\n return (\n <>\n welcome to dungeon solitaire (in beta)
\n pick a difficulty:
\n \n \n \n \n \n \n \n
\n >\n );\n};\n\nexport default Intro;\n","import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';\nimport Game from './Game';\nimport Intro from './Intro';\nimport './App.css';\n\nconst App = () => {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n );\n};\n\nexport default App;\n","const reportWebVitals = (onPerfEntry) => {\n if (onPerfEntry && onPerfEntry instanceof Function) {\n import('web-vitals').then(({ getCLS, getFID, getFCP, getLCP, getTTFB }) => {\n getCLS(onPerfEntry);\n getFID(onPerfEntry);\n getFCP(onPerfEntry);\n getLCP(onPerfEntry);\n getTTFB(onPerfEntry);\n });\n }\n};\n\nexport default reportWebVitals;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport reportWebVitals from './reportWebVitals';\nimport { BrowserRouter } from 'react-router-dom';\n\nReactDOM.render(\n \n \n \n \n ,\n document.getElementById('root'),\n);\n\n// If you want to start measuring performance in your app, pass a function\n// to log results (for example: reportWebVitals(console.log))\n// or send to an analytics endpoint. Learn more: https://bit.ly/CRA-vitals\nreportWebVitals();\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/static/js/main.ac38ef17.chunk.js b/static/js/main.ac38ef17.chunk.js
new file mode 100644
index 0000000..9d872e5
--- /dev/null
+++ b/static/js/main.ac38ef17.chunk.js
@@ -0,0 +1,2 @@
+(this["webpackJsonpdungeon-solitaire"]=this["webpackJsonpdungeon-solitaire"]||[]).push([[0],{34:function(e,i,t){},53:function(e,i,t){},64:function(e,i,t){"use strict";t.r(i);var s,c,a,l,n=t(0),o=t(11),u=t.n(o),r=(t(53),t(19)),d=t(4),b=t(26),h=t(7),v=t(25),j=t.n(v),y=t(35),p=t(38),f=t(88),k=t(86),O=t(87),x=t(66),m=(t(34),t(2)),g=function(e){var i=e.onClose,t=e.onOpen,s=e.storeFunction,c=e.gold,a=e.difficulty,l=Object(n.useState)(),o=Object(h.a)(l,2),u=o[0],r=o[1],d=function(e){"easy"===a?1===e?c>=5?(r("success"),s("attack",1,5)):r("notEnough"):2===e?c>=10?(r("success"),s("attack",3,10)):r("notEnough"):3===e&&(c>=5?(r("success"),s("health",10,5)):r("notEnough")):1===e?c>=10?(r("success"),s("attack",1,10)):r("notEnough"):2===e?c>=20?(r("success"),s("attack",3,20)):r("notEnough"):3===e&&(c>=5?(r("success"),s("health",5,5)):r("notEnough"))};return Object(m.jsx)(f.a,{onClose:function(){r(null),i()},open:t,children:Object(m.jsxs)("div",{style:{color:"white",backgroundColor:"#121E24",border:"2px solid white"},children:[Object(m.jsx)(k.a,{children:"store"}),Object(m.jsxs)(O.a,{children:[Object(m.jsxs)(x.a,{gutterBottom:!0,children:["buy more attack power",Object(m.jsxs)("button",{onClick:function(){return d(1)},children:["+1 (","easy"===a?"5":"10"," gold)"]}),Object(m.jsxs)("button",{onClick:function(){return d(2)},children:["+3 (","easy"===a?"10":"20"," gold)"]})]}),Object(m.jsxs)(x.a,{gutterBottom:!0,children:["buy more health","easy"===a?Object(m.jsx)("button",{onClick:function(){return d(3)},children:"+10 (5 gold)"}):Object(m.jsx)("button",{onClick:function(){return d(3)},children:"+5 (5 gold)"})]}),Object(m.jsx)(x.a,{gutterBottom:!0,children:"success"===u?Object(m.jsx)("small",{style:{color:"lightgreen"},children:"success!"}):"notEnough"===u?Object(m.jsx)("small",{style:{color:"red"},children:"not enough gold"}):Object(m.jsx)("small",{style:{visibility:"hidden"},children:"-"})})]})]})})},w=function(e){var i=e.onOpen,t=e.onClose;return Object(m.jsx)(f.a,{onClose:function(){t()},open:i,children:Object(m.jsxs)("div",{style:{color:"white",backgroundColor:"#121E24",border:"2px solid white"},children:[Object(m.jsx)(k.a,{children:"how to play"}),Object(m.jsxs)(O.a,{children:[Object(m.jsx)(x.a,{gutterBottom:!0,children:"clear the dungeon of all its monsters and treasures!"}),Object(m.jsx)(x.a,{gutterBottom:!0,children:'begin by receiving an initial health value, randomly selected from 1-20, and an inital attack power value, randomly selected from 1-8. the game is played out of a 52 standard card deck, shuffled up and laid face-down in a 5*10 grid. the last 2 cards are presented to you face-up at the beginning of the game as a "soft" entrance into the dungeon - you select the one you want and the other is discarded.'}),Object(m.jsx)(x.a,{gutterBottom:!0,children:"you then flip over each card and interact with it to clear it. you can only select those that are adjacent to an empty space except for the first card. hearts give you more health and diamonds give you more gold. you roll to determine how much health or gold you get depending on the card's value. for example, if you encountered the 5 of hearts, you will receive an increase in health - randomly selected from 1 to 5."}),Object(m.jsx)(x.a,{gutterBottom:!0,children:"spades and clubs are the enemies of the dungeon. the health of an enemy is equivalent to their card's value. the damage you do to an enemy will be a random value between 1 and the value of your attack power. the damage an enemy does to you will be a random value between 1 and their card's value. a battle between an enemy will end when their health reaches 0 or when your health reaches 0. when you defeat a spade, roll for health, according to the card's value. when defeating a club, roll for gold."}),Object(m.jsx)(x.a,{gutterBottom:!0,children:"use the gold you earn at the shop to upgrade your attack power or get more health. the difficulty of the game determines the prices at the shop."}),Object(m.jsxs)(x.a,{gutterBottom:!0,children:["any questions or concerns, contact me at shaefferjd at gmail dot com. the code for this project lives on"," ",Object(m.jsx)("a",{href:"https://github.com/jdshaeffer/dungeon-solitaire",children:"github"}),"."]})]})]})})},C=0,S=function(e){return Math.ceil(Math.random()*e)},E=function(){var e=Object(y.a)(j.a.mark((function e(){return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:return c=!0,e.next=3,new Promise((function(e){return setTimeout(e,1500)}));case 3:c=!1;case 4:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}(),N=function(e){var i=e.difficulty,t=Object(n.useState)(0),o=Object(h.a)(t,2),u=o[0],r=o[1],d=Object(n.useState)(0),v=Object(h.a)(d,2),f=v[0],k=v[1],O=Object(n.useState)(0),x=Object(h.a)(O,2),N=x[0],B=x[1],F=Object(n.useState)(0),q=Object(h.a)(F,2),M=q[0],A=q[1],J=Object(n.useState)(null),I=Object(h.a)(J,2),P=I[0],T=I[1],z=Object(n.useState)("roll for initial health"),D=Object(h.a)(z,2),G=D[0],H=D[1],K=Object(n.useState)(0),L=Object(h.a)(K,2),Q=L[0],R=L[1],U=Object(n.useState)(!1),V=Object(h.a)(U,2),W=V[0],X=V[1],Y=Object(n.useState)(!1),Z=Object(h.a)(Y,2),$=Z[0],_=Z[1],ee=Object(n.useState)(function(e){for(var i,t=e.length;0!==t;){i=Math.floor(Math.random()*t),t--;var c=[e[i],e[t]];e[t]=c[0],e[i]=c[1]}return s=[e.pop(),e.pop()].map((function(e){return Object(p.a)(Object(p.a)({},e),{},{clicked:!0,display:"block",selected:!1})})),e}([{pow:2,value:"2",suit:"spades",clicked:!1,visibility:"visible"},{pow:3,value:"3",suit:"spades",clicked:!1,visibility:"visible"},{pow:4,value:"4",suit:"spades",clicked:!1,visibility:"visible"},{pow:5,value:"5",suit:"spades",clicked:!1,visibility:"visible"},{pow:6,value:"6",suit:"spades",clicked:!1,visibility:"visible"},{pow:7,value:"7",suit:"spades",clicked:!1,visibility:"visible"},{pow:8,value:"8",suit:"spades",clicked:!1,visibility:"visible"},{pow:9,value:"9",suit:"spades",clicked:!1,visibility:"visible"},{pow:10,value:"10",suit:"spades",clicked:!1,visibility:"visible"},{pow:11,value:"jack",suit:"spades",clicked:!1,visibility:"visible"},{pow:12,value:"queen",suit:"spades",clicked:!1,visibility:"visible"},{pow:13,value:"king",suit:"spades",clicked:!1,visibility:"visible"},{pow:14,value:"ace",suit:"spades",clicked:!1,visibility:"visible"},{pow:2,value:"2",suit:"clubs",clicked:!1,visibility:"visible"},{pow:3,value:"3",suit:"clubs",clicked:!1,visibility:"visible"},{pow:4,value:"4",suit:"clubs",clicked:!1,visibility:"visible"},{pow:5,value:"5",suit:"clubs",clicked:!1,visibility:"visible"},{pow:6,value:"6",suit:"clubs",clicked:!1,visibility:"visible"},{pow:7,value:"7",suit:"clubs",clicked:!1,visibility:"visible"},{pow:8,value:"8",suit:"clubs",clicked:!1,visibility:"visible"},{pow:9,value:"9",suit:"clubs",clicked:!1,visibility:"visible"},{pow:10,value:"10",suit:"clubs",clicked:!1,visibility:"visible"},{pow:11,value:"jack",suit:"clubs",clicked:!1,visibility:"visible"},{pow:12,value:"queen",suit:"clubs",clicked:!1,visibility:"visible"},{pow:13,value:"king",suit:"clubs",clicked:!1,visibility:"visible"},{pow:14,value:"ace",suit:"clubs",clicked:!1,visibility:"visible"},{pow:2,value:"2",suit:"hearts",clicked:!1,visibility:"visible"},{pow:3,value:"3",suit:"hearts",clicked:!1,visibility:"visible"},{pow:4,value:"4",suit:"hearts",clicked:!1,visibility:"visible"},{pow:5,value:"5",suit:"hearts",clicked:!1,visibility:"visible"},{pow:6,value:"6",suit:"hearts",clicked:!1,visibility:"visible"},{pow:7,value:"7",suit:"hearts",clicked:!1,visibility:"visible"},{pow:8,value:"8",suit:"hearts",clicked:!1,visibility:"visible"},{pow:9,value:"9",suit:"hearts",clicked:!1,visibility:"visible"},{pow:10,value:"10",suit:"hearts",clicked:!1,visibility:"visible"},{pow:11,value:"jack",suit:"hearts",clicked:!1,visibility:"visible"},{pow:12,value:"queen",suit:"hearts",clicked:!1,visibility:"visible"},{pow:13,value:"king",suit:"hearts",clicked:!1,visibility:"visible"},{pow:14,value:"ace",suit:"hearts",clicked:!1,visibility:"visible"},{pow:2,value:"2",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:3,value:"3",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:4,value:"4",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:5,value:"5",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:6,value:"6",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:7,value:"7",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:8,value:"8",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:9,value:"9",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:10,value:"10",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:11,value:"jack",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:12,value:"queen",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:13,value:"king",suit:"diamonds",clicked:!1,visibility:"visible"},{pow:14,value:"ace",suit:"diamonds",clicked:!1,visibility:"visible"}])),ie=Object(h.a)(ee,2),te=ie[0],se=ie[1],ce=Object(n.useState)(s),ae=Object(h.a)(ce,2),le=ae[0],ne=ae[1],oe=Object(n.useState)(!1),ue=Object(h.a)(oe,2),re=ue[0],de=ue[1],be=function(e){var i=S(P.pow);"gold"===e?B(N+i):r(u+i),H("your ".concat(e," increased by ").concat(i)),a=!1,l=!1;var t=le.length?le[le.indexOf(P)]:te[te.indexOf(P)];t.visibility="hidden",te[te.indexOf(P)]=t,T(null),se(Object(b.a)(te))},he=function(){var e=Object(y.a)(j.a.mark((function e(){var i,t,s,n,o,d,h;return j.a.wrap((function(e){for(;;)switch(e.prev=e.next){case 0:if(0!==M){e.next=5;break}r(S(20)),H("roll for initial attack power"),e.next=60;break;case 5:if(1!==M){e.next=10;break}k(S(8)),H("select one of the above cards to begin"),e.next=60;break;case 10:if(!P||c){e.next=60;break}if(!a){e.next=15;break}be("gold"),e.next=49;break;case 15:if(!l){e.next=19;break}be("health"),e.next=49;break;case 19:if(i=P.pow,"diamonds"!==P.suit){e.next=26;break}t=S(i),B(N+t),H("your gold increased by ".concat(t)),e.next=48;break;case 26:if("hearts"!==P.suit){e.next=32;break}s=S(i),r(u+s),H("your health increased by ".concat(s)),e.next=48;break;case 32:if(n=S(f),R(Q-n<0?0:Q-n),!(Q-n<1)&&Q){e.next=39;break}H("you dealt ".concat(n," damage.\n\t\t\t\t\t\t\t\tyou defeated the ").concat(P.value," of ").concat(P.suit,".\n\t\t\t\t\t\t\t\troll for ").concat("clubs"===P.suit?"gold":"health",".")),"clubs"===P.suit?a=!0:l=!0,e.next=48;break;case 39:return H("you dealt ".concat(n," damage...")),e.next=42,E();case 42:return H("the enemy is now attacking..."),e.next=45,E();case 45:o=S(i),r(u-o<0?0:u-o),u-o<1?(H("the enemy dealt ".concat(o," damage. you died. refresh to try again.")),ne([]),se([]),c=!0):H("the enemy dealt ".concat(o," damage. attack again."));case 48:Q<1&&T(null);case 49:if(!(P.display&&Q<1&&0!==u)){e.next=59;break}return e.next=52,E();case 52:return H("entering the dungeon..."),e.next=55,E();case 55:ne([]),H("select any card to begin"),e.next=60;break;case 59:Q<1&&(d=Object(b.a)(te),(h=te[te.indexOf(P)]).visibility="hidden",te[te.indexOf(P)]=h,se(d));case 60:A(M+1);case 61:case"end":return e.stop()}}),e)})));return function(){return e.apply(this,arguments)}}();return Object(n.useEffect)((function(){te.every((function(e){return"hidden"===e.visibility}))&&u>0&&de(!0)}),[u,te]),Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)("h1",{style:{display:re?"block":"none"},children:"bravo, you did it!"}),le.length||re?Object(m.jsx)(m.Fragment,{}):Object(m.jsx)("div",{className:"cards",children:te.map((function(e,i){return Object(m.jsx)("div",{className:"card",onClick:function(){return function(e){if(!e.clicked&&!P){var i=te.indexOf(e);if(te[i+1]&&"hidden"===te[i+1].visibility||te[i-1]&&"hidden"===te[i-1].visibility||te[i+10]&&"hidden"===te[i+10].visibility||te[Math.abs(i-10)]&&"hidden"===te[Math.abs(i-10)].visibility||0===C){var t=Object(b.a)(te),s=te[te.indexOf(e)];s.clicked=!0,te[te.indexOf(e)]=s,se(t),T(e),"spades"!==e.suit&&"clubs"!==e.suit||R(e.pow);var c="hearts"===e.suit?"for health":"diamonds"===e.suit?"for gold":"to attack";H("the ".concat(e.value," of ").concat(e.suit,". roll ").concat(c,".")),C++}else console.log("can't pick that one")}}(e)},style:{visibility:e.visibility},children:e.clicked?"".concat("10"===e.value?e.value.substring(0,2):e.value[0]," ").concat(e.suit[0]):""},i)}))}),M>1?Object(m.jsx)("div",{className:"entrance-cards",children:le.map((function(e,i){return Object(m.jsx)("div",{className:"card",onClick:function(){return function(e){if(!e.selected){var i=Object(b.a)(le),t=le[le.indexOf(e)];t.selected=!0,le[le.indexOf(e)]=t,ne(i.filter((function(e){return e.selected}))),T(e),"spades"!==e.suit&&"clubs"!==e.suit||R(e.pow);var s="hearts"===e.suit?"for health":"diamonds"===e.suit?"for gold":"to attack";H("you selected the ".concat(e.value," of ").concat(e.suit,". roll ").concat(s,"."))}}(e)},style:{display:e.display},children:e.clicked?"".concat("10"===e.value?e.value.substring(0,2):e.value[0]," ").concat(e.suit[0]):""},i)}))}):Object(m.jsx)(m.Fragment,{}),Object(m.jsxs)("div",{className:"stats-container",children:[Object(m.jsxs)("small",{className:"stat",children:["health: ",u]}),Object(m.jsxs)("small",{className:"stat",children:["attack: ",f]}),Object(m.jsxs)("small",{className:"stat",children:["gold: ",N]}),Q?Object(m.jsxs)("small",{className:"stat",children:["enemy health: ",Q]}):Object(m.jsx)(m.Fragment,{})]}),Object(m.jsx)("div",{children:Object(m.jsx)("small",{children:re?"refresh to play again, or try a different difficulty. thanks for playing!":G})}),Object(m.jsx)("div",{children:Object(m.jsx)("button",{onClick:he,style:{display:0===M||u>0&&!re?"block":"none"},children:"roll"})}),Object(m.jsx)("button",{onClick:function(){X(!0)},style:{position:"absolute",left:80,bottom:10,display:re?"none":"block "},children:"store"}),Object(m.jsx)("button",{onClick:function(){_(!0)},style:{position:"absolute",left:10,bottom:10},children:"help"}),Object(m.jsx)(g,{onOpen:W,onClose:function(){X(!1)},storeFunction:function(e,i,t){"attack"===e?k(f+i):"health"===e&&r(u+i),B(N-t)},gold:N,difficulty:i}),Object(m.jsx)(w,{onOpen:$,onClose:function(){_(!1)}})]})},B=function(){return Object(m.jsxs)(m.Fragment,{children:[Object(m.jsx)("h1",{children:"welcome to dungeon solitaire (in beta)"}),Object(m.jsx)("h3",{children:"pick a difficulty:"}),Object(m.jsxs)("div",{children:[Object(m.jsx)(r.b,{to:"/easy",children:Object(m.jsx)("button",{children:"easy"})}),Object(m.jsx)(r.b,{to:"/hard",children:Object(m.jsx)("button",{children:"hard"})})]})]})},F=function(){return Object(m.jsx)("div",{className:"App",children:Object(m.jsx)("header",{className:"App-header",children:Object(m.jsx)(r.a,{children:Object(m.jsxs)(d.c,{children:[Object(m.jsx)(d.a,{exact:!0,path:"/dungeon-solitaire",children:Object(m.jsx)(B,{})}),Object(m.jsx)(d.a,{path:"/easy",children:Object(m.jsx)(N,{difficulty:"easy"})}),Object(m.jsx)(d.a,{path:"/hard",children:Object(m.jsx)(N,{difficulty:"hard"})})]})})})})};u.a.render(Object(m.jsx)(r.a,{children:Object(m.jsx)(F,{})}),document.getElementById("root"))}},[[64,1,2]]]);
+//# sourceMappingURL=main.ac38ef17.chunk.js.map
\ No newline at end of file
diff --git a/static/js/main.ac38ef17.chunk.js.map b/static/js/main.ac38ef17.chunk.js.map
new file mode 100644
index 0000000..70fe1fb
--- /dev/null
+++ b/static/js/main.ac38ef17.chunk.js.map
@@ -0,0 +1 @@
+{"version":3,"sources":["Game.js","Store.js","Tutorial.js","Intro.js","App.js","index.js"],"names":["enter","pause","goldAfterEnemy","healthAfterEnemy","Store","onClose","onOpen","storeFunction","gold","difficulty","useState","response","setResponse","handleStore","selection","Dialog","open","style","color","backgroundColor","border","DialogTitle","DialogContent","Typography","gutterBottom","onClick","visibility","Tutorial","href","cardCounter","rand","max","Math","ceil","random","sleep","a","Promise","r","setTimeout","Game","health","setHealth","attack","setAttack","setGold","counter","setCounter","currentCard","setCurrentCard","commentary","setCommentary","enemyHealth","setEnemyHealth","storeOpen","setStoreOpen","tutorialOpen","setTutorialOpen","arr","randomIndex","currentIndex","length","floor","pop","map","el","clicked","display","selected","shuffle","pow","value","suit","cards","setCards","entranceCards","setEntranceCards","win","setWin","afterEnemyPickup","type","increase","cardToChange","indexOf","roll","damage","enemyDamage","copyOfCards","useEffect","every","card","className","i","abs","action","console","log","onCardClick","substring","filter","onEntranceCardClick","position","left","bottom","amount","price","Intro","to","App","exact","path","ReactDOM","render","document","getElementById"],"mappings":"kLAIIA,EACAC,EACAC,EACAC,E,8ICuGWC,EArGD,SAAC,GAA0D,IAAxDC,EAAuD,EAAvDA,QAASC,EAA8C,EAA9CA,OAAQC,EAAsC,EAAtCA,cAAeC,EAAuB,EAAvBA,KAAMC,EAAiB,EAAjBA,WAAiB,EACtCC,qBADsC,mBAC/DC,EAD+D,KACrDC,EADqD,KAQhEC,EAAc,SAACC,GACA,SAAfL,EACgB,IAAdK,EACEN,GAAQ,GACVI,EAAY,WACZL,EAAc,SAAU,EAAG,IAE3BK,EAAY,aAES,IAAdE,EACLN,GAAQ,IACVI,EAAY,WACZL,EAAc,SAAU,EAAG,KAE3BK,EAAY,aAES,IAAdE,IACLN,GAAQ,GACVI,EAAY,WACZL,EAAc,SAAU,GAAI,IAE5BK,EAAY,cAIE,IAAdE,EACEN,GAAQ,IACVI,EAAY,WACZL,EAAc,SAAU,EAAG,KAE3BK,EAAY,aAES,IAAdE,EACLN,GAAQ,IACVI,EAAY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,EAAUD,EAAS+D,GAErB3D,EAAQrC,EAAOiG,IAuHXjG,KAAMA,EACNC,WAAYA,IAEd,cAAC,EAAD,CAAUH,OAAQkD,EAAcnD,QAnHR,WAC1BoD,GAAgB,UGzlBLiD,EAjBD,WACZ,OACE,qCACE,wEACA,oDACA,gCACE,cAAC,IAAD,CAAMC,GAAG,QAAT,SACE,4CAEF,cAAC,IAAD,CAAMA,GAAG,QAAT,SACE,mDCcKC,EAtBH,WACV,OACE,qBAAKjB,UAAU,MAAf,SACE,wBAAQA,UAAU,aAAlB,SACE,cAAC,IAAD,UACE,eAAC,IAAD,WACE,cAAC,IAAD,CAAOkB,OAAK,EAACC,KAAK,qBAAlB,SACE,cAAC,EAAD,MAEF,cAAC,IAAD,CAAOA,KAAK,QAAZ,SACE,cAAC,EAAD,CAAMrG,WAAW,WAEnB,cAAC,IAAD,CAAOqG,KAAK,QAAZ,SACE,cAAC,EAAD,CAAMrG,WAAW,qBCZ/BsG,IAASC,OACP,cAAC,IAAD,UACE,cAAC,EAAD,MAEFC,SAASC,eAAe,W","file":"static/js/main.ac38ef17.chunk.js","sourcesContent":["import { useState, useEffect } from 'react';\nimport Store from './Store';\nimport Tutorial from './Tutorial';\n\nlet enter;\nlet pause;\nlet goldAfterEnemy;\nlet healthAfterEnemy;\nlet cardCounter = 0;\n// the fisher-yates shuffle algorithm\nconst shuffle = (arr) => {\n let currentIndex = arr.length,\n randomIndex;\n // while there remain elements to shuffle\n while (currentIndex !== 0) {\n // pick a remaining element\n randomIndex = Math.floor(Math.random() * currentIndex);\n currentIndex--;\n // and swap it with the current element\n [arr[currentIndex], arr[randomIndex]] = [\n arr[randomIndex],\n arr[currentIndex],\n ];\n }\n\n enter = [arr.pop(), arr.pop()].map((el) => {\n return { ...el, clicked: true, display: 'block', selected: false };\n });\n return arr;\n};\n\nconst rand = (max) => {\n return Math.ceil(Math.random() * max);\n};\n\nconst sleep = async () => {\n pause = true;\n await new Promise((r) => setTimeout(r, 1500));\n pause = false;\n};\n\nconst Game = ({ difficulty }) => {\n const [health, setHealth] = useState(0);\n const [attack, setAttack] = useState(0);\n const [gold, setGold] = useState(0);\n const [counter, setCounter] = useState(0);\n const [currentCard, setCurrentCard] = useState(null);\n const [commentary, setCommentary] = useState('roll for initial health');\n const [enemyHealth, setEnemyHealth] = useState(0);\n const [storeOpen, setStoreOpen] = useState(false);\n const [tutorialOpen, setTutorialOpen] = useState(false);\n const [cards, setCards] = useState(\n shuffle([\n {\n pow: 2,\n value: '2',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 3,\n value: '3',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 4,\n value: '4',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 5,\n value: '5',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 6,\n value: '6',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 7,\n value: '7',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 8,\n value: '8',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 9,\n value: '9',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 10,\n value: '10',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 11,\n value: 'jack',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 12,\n value: 'queen',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 13,\n value: 'king',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 14,\n value: 'ace',\n suit: 'spades',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 2,\n value: '2',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 3,\n value: '3',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 4,\n value: '4',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 5,\n value: '5',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 6,\n value: '6',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 7,\n value: '7',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 8,\n value: '8',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 9,\n value: '9',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 10,\n value: '10',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 11,\n value: 'jack',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 12,\n value: 'queen',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 13,\n value: 'king',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 14,\n value: 'ace',\n suit: 'clubs',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 2,\n value: '2',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 3,\n value: '3',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 4,\n value: '4',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 5,\n value: '5',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 6,\n value: '6',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 7,\n value: '7',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 8,\n value: '8',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 9,\n value: '9',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 10,\n value: '10',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 11,\n value: 'jack',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 12,\n value: 'queen',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 13,\n value: 'king',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 14,\n value: 'ace',\n suit: 'hearts',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 2,\n value: '2',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 3,\n value: '3',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 4,\n value: '4',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 5,\n value: '5',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 6,\n value: '6',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 7,\n value: '7',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 8,\n value: '8',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 9,\n value: '9',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 10,\n value: '10',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 11,\n value: 'jack',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 12,\n value: 'queen',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 13,\n value: 'king',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n {\n pow: 14,\n value: 'ace',\n suit: 'diamonds',\n clicked: false,\n visibility: 'visible',\n },\n ]),\n );\n const [entranceCards, setEntranceCards] = useState(enter);\n const [win, setWin] = useState(false);\n\n const onCardClick = (card) => {\n // flip over card\n if (!card.clicked && !currentCard) {\n // border check\n const i = cards.indexOf(card);\n if (\n (cards[i + 1] && cards[i + 1].visibility === 'hidden') ||\n (cards[i - 1] && cards[i - 1].visibility === 'hidden') ||\n (cards[i + 10] && cards[i + 10].visibility === 'hidden') ||\n (cards[Math.abs(i - 10)] &&\n cards[Math.abs(i - 10)].visibility === 'hidden') ||\n cardCounter === 0\n ) {\n let copyOfCards = [...cards];\n let cardToChange = cards[cards.indexOf(card)];\n cardToChange.clicked = true;\n cards[cards.indexOf(card)] = cardToChange;\n setCards(copyOfCards);\n setCurrentCard(card);\n\n // set up enemy health at card flip\n if (card.suit === 'spades' || card.suit === 'clubs') {\n setEnemyHealth(card.pow);\n }\n\n const action =\n card.suit === 'hearts'\n ? 'for health'\n : card.suit === 'diamonds'\n ? 'for gold'\n : 'to attack';\n setCommentary(`the ${card.value} of ${card.suit}. roll ${action}.`);\n cardCounter++;\n } else {\n console.log(`can't pick that one`);\n }\n }\n };\n\n const onEntranceCardClick = (card) => {\n if (!card.selected) {\n let copyOfCards = [...entranceCards];\n let cardToChange = entranceCards[entranceCards.indexOf(card)];\n cardToChange.selected = true;\n entranceCards[entranceCards.indexOf(card)] = cardToChange;\n setEntranceCards(copyOfCards.filter((card) => card.selected));\n setCurrentCard(card);\n\n // set up enemy health at card flip\n if (card.suit === 'spades' || card.suit === 'clubs') {\n setEnemyHealth(card.pow);\n }\n\n const action =\n card.suit === 'hearts'\n ? 'for health'\n : card.suit === 'diamonds'\n ? 'for gold'\n : 'to attack';\n setCommentary(\n `you selected the ${card.value} of ${card.suit}. roll ${action}.`,\n );\n }\n };\n\n const afterEnemyPickup = (type) => {\n // handling enemy drops - follows after enemy defeat - not super dry\n const increase = rand(currentCard.pow);\n type === 'gold' ? setGold(gold + increase) : setHealth(health + increase);\n setCommentary(`your ${type} increased by ${increase}`);\n goldAfterEnemy = false;\n healthAfterEnemy = false;\n\n let cardToChange = entranceCards.length\n ? entranceCards[entranceCards.indexOf(currentCard)]\n : cards[cards.indexOf(currentCard)];\n cardToChange.visibility = 'hidden';\n cards[cards.indexOf(currentCard)] = cardToChange;\n\n setCurrentCard(null);\n setCards([...cards]);\n };\n\n const roll = async () => {\n if (counter === 0) {\n // initial health set\n setHealth(rand(20));\n setCommentary(`roll for initial attack power`);\n } else if (counter === 1) {\n // initial attack set\n setAttack(rand(8));\n setCommentary(`select one of the above cards to begin`);\n } else {\n if (currentCard && !pause) {\n if (goldAfterEnemy) {\n afterEnemyPickup('gold');\n } else if (healthAfterEnemy) {\n afterEnemyPickup('health');\n } else {\n const value = currentCard.pow;\n if (currentCard.suit === 'diamonds') {\n // get gold\n const increase = rand(value);\n setGold(gold + increase);\n setCommentary(`your gold increased by ${increase}`);\n } else if (currentCard.suit === 'hearts') {\n // get health\n const increase = rand(value);\n setHealth(health + increase);\n setCommentary(`your health increased by ${increase}`);\n } else {\n // battle sequence\n const damage = rand(attack);\n setEnemyHealth(enemyHealth - damage < 0 ? 0 : enemyHealth - damage);\n\n if (enemyHealth - damage < 1 || !enemyHealth) {\n // when enemy dies\n setCommentary(`you dealt ${damage} damage.\n\t\t\t\t\t\t\t\tyou defeated the ${currentCard.value} of ${currentCard.suit}.\n\t\t\t\t\t\t\t\troll for ${currentCard.suit === 'clubs' ? 'gold' : 'health'}.`);\n if (currentCard.suit === 'clubs') {\n goldAfterEnemy = true;\n } else {\n healthAfterEnemy = true;\n }\n } else {\n setCommentary(`you dealt ${damage} damage...`);\n await sleep();\n setCommentary(`the enemy is now attacking...`);\n await sleep();\n const enemyDamage = rand(value);\n setHealth(health - enemyDamage < 0 ? 0 : health - enemyDamage);\n\n if (health - enemyDamage < 1) {\n // when player dies\n setCommentary(\n `the enemy dealt ${enemyDamage} damage. you died. refresh to try again.`,\n );\n setEntranceCards([]); // to cover entrance\n setCards([]);\n pause = true; // game end\n } else {\n setCommentary(\n `the enemy dealt ${enemyDamage} damage. attack again.`,\n ); // or roll away?\n }\n }\n }\n\n if (enemyHealth < 1) {\n setCurrentCard(null);\n }\n }\n\n if (currentCard.display && enemyHealth < 1 && health !== 0) {\n // handle entrance card disappearing after 1.5 seconds\n await sleep();\n setCommentary(`entering the dungeon...`);\n await sleep();\n setEntranceCards([]);\n setCommentary(`select any card to begin`);\n } else {\n // handle normal dissappearing of cards\n if (enemyHealth < 1) {\n let copyOfCards = [...cards];\n let cardToChange = cards[cards.indexOf(currentCard)];\n cardToChange.visibility = 'hidden';\n cards[cards.indexOf(currentCard)] = cardToChange;\n setCards(copyOfCards);\n }\n }\n }\n }\n\n setCounter(counter + 1);\n };\n\n const handleStoreOpen = () => {\n setStoreOpen(true);\n };\n\n const handleStoreClose = () => {\n setStoreOpen(false);\n };\n\n const storeFunction = (type, amount, price) => {\n if (type === 'attack') {\n setAttack(attack + amount);\n } else if (type === 'health') {\n setHealth(health + amount);\n }\n setGold(gold - price);\n };\n\n const handleTutorialOpen = () => {\n setTutorialOpen(true);\n };\n\n const handleTutorialClose = () => {\n setTutorialOpen(false);\n };\n\n useEffect(() => {\n if (cards.every((card) => card.visibility === 'hidden')) {\n if (health > 0) {\n setWin(true);\n }\n }\n }, [health, cards]);\n\n return (\n <>\n bravo, you did it!
\n {!entranceCards.length && !win ? (\n \n {cards.map((card, i) => {\n return (\n
onCardClick(card)}\n style={{ visibility: card.visibility }}\n >\n {card.clicked\n ? `${\n card.value === '10'\n ? card.value.substring(0, 2)\n : card.value[0]\n } ${card.suit[0]}`\n : ``}\n
\n );\n })}\n
\n ) : (\n <>>\n )}\n {counter > 1 ? (\n \n {entranceCards.map((card, i) => {\n return (\n
onEntranceCardClick(card)}\n style={{ display: card.display }}\n >\n {card.clicked\n ? `${\n card.value === '10'\n ? card.value.substring(0, 2)\n : card.value[0]\n } ${card.suit[0]}`\n : ``}\n
\n );\n })}\n
\n ) : (\n <>>\n )}\n \n health: {health}\n attack: {attack}\n gold: {gold}\n {enemyHealth ? (\n enemy health: {enemyHealth}\n ) : (\n <>>\n )}\n
\n \n \n {win\n ? 'refresh to play again, or try a different difficulty. thanks for playing!'\n : commentary}\n \n
\n \n \n
\n \n \n \n \n >\n );\n};\n\nexport default Game;\n","import { useState } from 'react';\nimport {\n Dialog,\n DialogContent,\n DialogTitle,\n Typography,\n} from '@material-ui/core';\nimport './App.css';\n\nconst Store = ({ onClose, onOpen, storeFunction, gold, difficulty }) => {\n const [response, setResponse] = useState();\n\n const handleClose = () => {\n setResponse(null);\n onClose();\n };\n\n const handleStore = (selection) => {\n if (difficulty === 'easy') {\n if (selection === 1) {\n if (gold >= 5) {\n setResponse('success');\n storeFunction('attack', 1, 5);\n } else {\n setResponse('notEnough');\n }\n } else if (selection === 2) {\n if (gold >= 10) {\n setResponse('success');\n storeFunction('attack', 3, 10);\n } else {\n setResponse('notEnough');\n }\n } else if (selection === 3) {\n if (gold >= 5) {\n setResponse('success');\n storeFunction('health', 10, 5);\n } else {\n setResponse('notEnough');\n }\n }\n } else {\n if (selection === 1) {\n if (gold >= 10) {\n setResponse('success');\n storeFunction('attack', 1, 10);\n } else {\n setResponse('notEnough');\n }\n } else if (selection === 2) {\n if (gold >= 20) {\n setResponse('success');\n storeFunction('attack', 3, 20);\n } else {\n setResponse('notEnough');\n }\n } else if (selection === 3) {\n if (gold >= 5) {\n setResponse('success');\n storeFunction('health', 5, 5);\n } else {\n setResponse('notEnough');\n }\n }\n }\n };\n\n return (\n \n );\n};\n\nexport default Store;\n","import {\n Dialog,\n DialogContent,\n DialogTitle,\n Typography,\n} from '@material-ui/core';\n\nconst Tutorial = ({ onOpen, onClose }) => {\n const handleClose = () => {\n onClose();\n };\n\n return (\n \n );\n};\n\nexport default Tutorial;\n","import { Link } from 'react-router-dom';\nimport './App.css';\n\nconst Intro = () => {\n return (\n <>\n welcome to dungeon solitaire (in beta)
\n pick a difficulty:
\n \n \n \n \n \n \n \n
\n >\n );\n};\n\nexport default Intro;\n","import { BrowserRouter as Router, Switch, Route } from 'react-router-dom';\nimport Game from './Game';\nimport Intro from './Intro';\nimport './App.css';\n\nconst App = () => {\n return (\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n
\n );\n};\n\nexport default App;\n","import React from 'react';\nimport ReactDOM from 'react-dom';\nimport './index.css';\nimport App from './App';\nimport { BrowserRouter } from 'react-router-dom';\n\nReactDOM.render(\n \n \n ,\n document.getElementById('root'),\n);\n"],"sourceRoot":""}
\ No newline at end of file
diff --git a/static/js/runtime-main.b05e2006.js b/static/js/runtime-main.b05e2006.js
deleted file mode 100644
index 23f0f13..0000000
--- a/static/js/runtime-main.b05e2006.js
+++ /dev/null
@@ -1,2 +0,0 @@
-!function(e){function r(r){for(var n,i,a=r[0],c=r[1],l=r[2],f=0,p=[];f