0% found this document useful (0 votes)
27 views3 pages

Dragonslayer Card

The document outlines the rules for a game called 'Dragon Slayer Card', including instructions for setting up and playing the game. Players can defeat a dragon, collect items, and interact with various elements within the game. Additionally, it provides a link to download the game code or play it online.

Uploaded by

coldcallmorelike
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
27 views3 pages

Dragonslayer Card

The document outlines the rules for a game called 'Dragon Slayer Card', including instructions for setting up and playing the game. Players can defeat a dragon, collect items, and interact with various elements within the game. Additionally, it provides a link to download the game code or play it online.

Uploaded by

coldcallmorelike
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 3

DRAGON

SLAYER
CARD
<!-- | Rules: 1. Write the code into a file with the name "index.html" | You cannot defeat the dragon? No problem!
,====================. | 2. Open the file with a web browser. | Just cut the card into little pieces.
,==| DRAGON SLAYER CARD |==.| 3. Kill the dragon! | But keep in mind: there is a kitten within
| '====================' || 4. After killing the dragon give the card to someone else. | the game.
'=====' '====='|===================================================================================================================
============================' NOTE: You can also download the code from https://pixelpaladin.itch.io/dragoncard or play the game online. -->
<html><body><div id='c'></div><script type="text/x">#AH(c){%E('c')%H+=c};AE=(t,a='',c='')=>{AH('<'+t+' '+a+'>'+c+'</'+t+'>')}; #PR( c ){ %E( 'a'
).value+=c+'\n';%E('a').%ZTop=%E('a').%ZHeight}#SH(a){a.sort(()=>Math.random()-0.5);->a}#RN(x){->Math.floor(Math.random()*(x+1))}#SD(i,w,c='') {
AE('div','id="'+i+'"style="width:'+w+'px;float:left;"',c)}#D9(c){->'<div style="width:110px;float:left;margin:5px;">'+c+'</div>'}SD('h',350);SD(
'k',125);SD('g',125);AE('br');SD('n',120,'\ud83c\udf92\xa0inventory:');SD('it',500);AE('br');AE('br');AE('textarea','id="a"rows="20"style="wid'+
'th:620px;"readonly');AE('br');AE('input','id="i"');mo=0;_W=0;pc=0;#HI(v){if(mo){if(v==_W){pc=1;PR('CORRECT')}~e{pc=0; PR('INCORRECT')}mo=0; ->}
try{$o=co[v];if(!o.C||o.C()){PR('>>> '+o.N()+'%.');o.E()}~e PR('ERROR')}catch(e){PR('ERROR')}}%i.focus();%i.addEventListener('keyup',(e)=>{ if (
e.keyCode===13){e.preventDefault();HI(%i.value);%i.value='';if(mo)PR('%P:');~e cr.LO()}});dn=['north','west','south','east'];#IR(r){r.cc=4;rl<-(
r);r.o={};if(r.id)rm[r.id]=r;if(!('de' in r))r.de=1;r.ao=[];r.AO=#(i,o){r.ao<-(i);o.r=r;r.o[i]=o;if(o.id)om[o.id]=o;if(o.I)o.I();->r};r.CR=#(x){
x.p=r;$d=['n','w','s','e'];$i=RN(4);[0,1,2,3]~f(#(n){$t=(i+n)%4;if(!r.o[d[t]]){r.AO(d[t],{N(){->'go '+dn[t]},C(){->r.de},E(){cr=x}});x.AO(d[(t+2
)%4],{N(){->'go '+dn[(t+2)%4]},C(){->x.de},E(){PR(dn[(t+2)%4]);cr=r}});~b}});r.cc--;x.cc--;if(r.cc<1)rl.splice(r,1);->x};r.SC=#(x){r.AO('d', {e:
1,N(){->'go downstairs'},C(){->r.de},E(){cr=x}});x.AO('u',{e:1,N(){->'go upstairs'},C(){->x.de},E(){cr=r}});->x};r.LO=#(){{$s='';for($i=0; i<mh;
i++){s+=i<ch?'\u2764\ufe0f':'\ud83d\udda4'}%E('h')%H='health: '+s}%E('k')%H='%ud\udd11 '+_k+' keys';%E('g')%H='%ud\udcb0 '+_g+' gold';{$s='';s+=
_p?D9(' %ue\uddea%xpotion'+(_p>1?'%x('+_p+')':'')):'';s+=_w?D9((_w==1?'%ud\udd2a%xknife':'%ud\udde1\ufe0f%x'+(_w==2?'%D':'%S'))):''; s += _f?D9(
' %ud\udcdc%x%F'+(_f>1?'%x('+_f+')':'')):'';s+=_i?D9(' %ud\udcdc%xice%xspike'+(_i>1?'%x('+_i+')':'')):'';s+=_S?D9((' %ud\udee1\ufe0f%xshield')):
'';s+=_H?D9((' \u26d1\ufe0f%xhelmet')):'';s+=_T?D9((' %ud\udc08%x%k')):'';%E('it')%H=(s?s:' -')}if(r.M)PR(r.M());co={};$l=[];$t=[]; $d=['n','s',
'e','w'];PR('options:');r.ao~f(#(i){if(!d%?(i)){t<-(i)}});d~f(#(i){if(r.o[i]){t<-(i)}});t~f(#(i){$o=r.o[i];if(!o.C||o.C()){l<-(i); co[ i ]=o}});
il~f(#(i){if(i.o&&!co[i.o]&&(!i.C||i.C())){l<-(i.o);co[i.o]=i}});l~f(#(o){PR(' ['+o+'] '+co[o].N())})};->r}#GR(){SH(rl); $r; rl~f(#( i ){ if(!(
i.o.w&&i.o.a&&i.o.s&&i.o.d)){r=i;~b}});->r}#RI(i){for($x=0;x<il.length;x++){if(il[x]===i){il.splice(x,1)}}}_G=99;#GI(){->++_G}#CH(i,d=0) {$t=GI(
);->IR({id:d,i:i,c:1,M(){->'%w'+(@c?'a closed %C':'an open %C'+(@i?'\nIn%t%C '+(i.n.match(/^\d+/)?'are ':'is a ') + i.n:'\nThe %C is%m'))}}).AO(
'o',{e:1,N(){->'open %C'},C(){->@e},E(){@e=0;@r.c=0;om[t].e=1}}).AO('t',{id:t,e:0,N(){->'take '+i.n},C(){->@e},E(){@e=0;il<-(i); @r.i=0;if(!i.o)
i.E()}})}#ER(m,d=0){->IR({id:d,M(){->m}})}#RC(i=0,d=0){->CH(i?i:LI(),d)}#EN(n,l,s,d,i,dr=0){->{m:l,l:l,s:s,d:d,i:i,n:n,N(){->(@l<=0?'dead ':'')+
n},L(){->@l<=0?'':' (lp '+@l+'/'+@m+')'},A(c){$a=(_w+RN(1))-s;a=a<0?0:a;if(c){a=(dr&&c==1)?1:7} PR((a>0?'%Ydeal '+a+' damage':'%Ymiss') + '%.');
@l-=a;if(@l>0){a=d-_s;a=a<0?0:a;PR('The '+n+(a>0?' deals '+a+' damage':' misses')+'%.');ch-=a;if(ch<=0){PR('%Ydied!');cr=go;ov=1}}~e{PR('%Ykil'+
'led%t'+n+'.');if(dr){cr=wo;ov=1}}}}}#RE(e,d=0){->IR({id:d,de:0,c:1,M(){->'%wa '+e.N()+e.L()+'.'+((e.l<=0&&e.i)?'\nThe '+e.n+' dropped '+(//1-->
e.i.n.match(/^\d+/)?'':'a ')+e.i.n+'.':'')}}).AO('a',{N(){->'attack '+e.N()},C(){->e.l>0},E(){e.A();if(e.l<=0) {@r.de=1}}}).AO('b',{N(){->'%F'},
C(){->_f&&e.l>0},E(){_f--;e.A(1);if(e.l<=0){@r.de=1}}}).AO('i',{N(){->'%I'},C(){->_i&&e.l>0},E(){_i--;e.A(2);if(e.l<=0){@r.de=1}}}).AO('f',{N(){
->'flee'},C(){->e.l>0},E(){cr=@r.p}}).AO('t',{N(){->'take '+e.i.n},C(){->e.l<=0&&e.i},E(){e.i.E();e.i=0}})}#LR(d = 0) {->IR({id:d,de:0,c:1,M() {
->@de?'%aan%m%r.':'There is a locked door.'}}).AO('o',{N(){->'open door'},C(){->!@r.de&&_k},E(){@r.de=1;_k--}}).AO('b',{N(){ ->'go back' }, C(){
->!@r.de},E(){cr=@r.p}})}#PO(){->{n:'health potion',E(){_p++}}}#GO(l,u=0){$g=l+(u?RN(u-l+1):0);->{n:g+' gold%ps',E(){_g+=g}}}#FB() {->{n:'%Z ('+
'%F)',E(){_f++}}}#IS(){->{n:'%Z (%I)',E(){_i++}}}#KY(){->{n:'key',E(){_k++}}}#HA(){->{n:'%A',E(){mh++;ch=mh}}}#LI(){->SH(RN(50)>7?[PO(),GO(15,25
)]:[FB(),IS()])[0]}#ML(){->RN(20)>5?GO(3,12):PO()}#E1(i){->EN(RN(99)<50?'rat':'bug',3,-1,1,i)}#E2(i) {->EN(RN(99)<50?'goblin':'spider',3,0,1,i)}
#E3(i){->EN(RN(99)<50?'orc':'skeleton',4,1,2,i)}#E4(){->EN('%d',30,2,5,HA(),1)}#SI(){->{n:'shield',E(){_s++;_S=1}}}#HE(){->{n:'helmet',E(){_s++;
_H=1}}}ov=0;#IN(){ov=0;mo=0;pc=0;T='dcrfphbaachbegfboroaalioenpoeaenouwagttyggetewntluxglm';r=RN(17);_W=T[r]+T[r+18]+T[r+36];_o=SH([0,1,2]);rl=[
];rm={};om={};il=[];mh=3;ch=mh;_p=0;_g=0;_k=0;_f=0;_i=0;_w=0;_s=0;_S=0;_H=0;_T=0;go=IR({M(){->'\n - GAME OVER - \n'},}).AO('n',{N(){->'new game'
},E(){ov=1;IN()}});wo=IR({M(){->'\n - YOU WON - \n'},}).AO('n',{N(){->'new game'},E(){ov=1;IN()}});il<-({o:'p',C(){->_p&&!ov},N(){->'drink hea'+
'lth potion'},E(){_p--;ch=Math.min(ch+3,mh)}});il<-({o:'k',p:4,C(){->@p&&_T&&!ov},N(){->'pat %k'},E(){@p--;PR(@p?' =^.^= cute!':" ='.'= well, "+
"that is%n%.")}});cr=ER('%Ysee%tdungeon entrance.').AO('e',{N(){->'enter'},E(){cr=r1}});rl=[];r1=ER('%wa %d%s');r2=~C(RE(E1(PO())));~C(RC(ML()))
rl=[];r2.CR(ER('%wa goblin%s'));~C(RC({n:'knife',E(){_w=_w>1?_w:1}}));~C(RE(E2(KY())));~C(ER('%L'+_W[0]+'"'));r3=~C(LR());r3=r3.SC(RC(ML()));rl=
[];r3.CR(IR($$M)$$P.AO('2',{N(){->'%b%S (50g)'},o:1,C(){->@o},E(){if(_g>=50){_w=3;@o=0;_g-=50}~e ~N}}).AO('3',$$H));~C(RC(GO(10,15))); ~C(RE(E2(
HA())));[1,2]~f(#(){~C(RE(E1(ML())));~C(RC(ML()))});~C(RC({n:'%D',E(){_w=_w>2?_w:2}}));~C(RE(E2(KY())));~C(ER('%L'+_W[1]+'"')); r4=~C(LR()); r4=
r4.SC(RC(ML()));rl=[];r4.CR(ER('%wan orc%s'));t1=~C(IR({M(){->'%wan '+(pc?'':'in')+'%c%eer.'},}).AO('t',{N(){->'%e'},C(){->pc},E(){cr=t2}}));~C(
IR($$M)$$P.AO('2',{N(){->'%b%Z %F (20g)'},E(){if(_g>=20){_f++;_g-=20}~e ~N}}).AO('3',{N(){->'%b%Z %I (25g)'},E(){if(_g>=25) {_i++;_g-=25}~e ~N}}
).AO('4',$$H));[1,2,3]~f(#(){~C(RE(E2(ML())));~C(RC(LI()))});~C(RE(E3(HA())));~C(RE(E3(KY())));~C(IR({M(){->'%wa terminal.'+(pc?'\nOn%tscreen '+
'is a message:\n %P CORRECT - TELEPORTER ACTIVATED!':'')},}).AO('i',{N(){->'input pas%S'},C(){->!pc},E(){mo=1}}));r5=~C(LR());r5=r5.SC(RC(LI())
);rl=[];r5.CR(ER('%wa broken%s'));[1,2,3,4,5]~f(#(){~C(RE(E3(LI())));~C(RC(LI()))});~C(RE(E3(SI())));~C(RE(E3(HE())));~C(ER('%L'+_W[2]+'"'));~C(
IR({M(){->'%a'+(_T?'an%m%r.':'a%r%ha %k.')},}).AO('t',{N(){->'take %k'},C(){->!_T},E(){_T=1}}));rl=[];t2=IR({M(){->'%wan '+(pc?'':'in')+'%c%ee'+
'r.'},}).AO('t',{N(){->'%e'},E(){cr=t1}});~C(ER('%wa %d%s')).CR(RC(HA())).CR(RE(E4(HA())));if(!ov)cr.LO()}IN();</script><script>var A=(t,s,r)=>{
return t.split(s).join(r)},K={'$$H':'{N(){->\'%b%A%p (20g)\'},o:1,C(){->@o},E(){if(_g>=20){mh++;ch=mh;@o=0;_g-=20}~e ~N}}','$$M':'{M(){->\'%wa'+
' merchant.\'},}','$$P':'.AO(\'1\',{N(){->\'%bpotion (5g)\'},E(){if(_g>=5){_p++;_g-=5}~e ~N}})'};('%E:document.getElementById|$:var |->:return'+
' |%?:.includes|@:this.|\r:|#:function |~f:.some|~b:->1|<-:.push|'+'%i:%E("i")|%H:.innerHTML|%Y:You |%a:%Yare in |%r: room|%w:%aa%r%h|%d:drago'+
'n|%s: statue.|%t: the |%L:%wa picture at%twall.\\nIt shows%tletter "|%P:PASSWORD|%e:teleport|%c:active |%n: enough|%.: ...|~N:PR(\'Not%n mone'+
'y%.\')|~e:else|%b:buy |%h: with |%m: empty|%k:kitten|%D:dagger|%S:sword|%Z:scroll|%F:fireball|%I:ice spike|%A:heart|%p: piece|~C:GR().CR|%C:c'+
'hest|%u:\\ud83|%x:\\xa0').split('|').forEach(function(e){t=e.split(':');K[t[0]]=t[1]});R=(x)=>{for(var i=0;i<9;i++)for(var k in K)x=A(x,k,K[k])
eval(x)},C=document.querySelectorAll('script[type="text/x"]');for(var i=0;i<C.length;i++)R(C[i].innerHTML)</script></body></html><!-- =^.^= 2-->

You might also like