![Image](https://pp.userapi.com/c824409/v824409746/cbba7/gr8HFoJLhsU.jpg)
The license is free, but I'll be glad if specify the author - = a = Firestorm (
https://vk.com/ a_firestorm)
In file
script.rpy
Code: Select all
define e = Character('Eileen', color="#c8ffc8")
###When you start the game in windowed mode, the window itself is sometimes on the edges,
### or somewhere in the corner, we'll, definitely not in the center. To fix this, just add these lines
init python hide:
import os
os.environ['SDL_VIDEO_CENTERED'] = '1'
init python:
import os
screen map:
add "map.webp"
imagebutton idle ("tb.webp") xalign .5 yalign .5 action [Return(),Jump("dom")]
screen tet:
$ line=renpy.get_filename_line()
text "[line]"
label start:
label kgames:
menu:
e "What will we play?"
"At 21 points":
$ renpy.call_in_new_context("card78")
"Fool":
$ renpy.call_in_new_context("card79")
"Drunkard":
$ renpy.call_in_new_context("card77")
jump kgames
return
1) 21 points or blackjack, in file card78.rpy
https://pp.userapi.com/c841623/v8416236 ... fY5t0g.jpg
Code: Select all
image tb = "tb.webp"
screen c78a:
if btnn<5:
textbutton "Another card" xalign .5 yalign .5 action [SetVariable("karta"+str(btnn),renpy.random.randint(2,11)),SetVariable("kartam"+str(btnn),renpy.random.choice([100,200,300,400])),SetVariable("kart"+str(btnn),renpy.random.randint(2,11)),SetVariable("kartm"+str(btnn),renpy.random.choice([100,200,300,400])),SetVariable("btnn",btnn+1),Jump("cpui")]
textbutton "Enough" xalign .5 yalign .54 action Jump("cstand")
screen c78:
hbox xalign .1:
add str(kart1+kartm1)+".png"
add str(kart2+kartm2)+".png"
add str(kart3+kartm3)+".png"
add str(kart4+kartm4)+".png"
hbox xalign .1 yalign .94:
add str(karta1+kartam1)+".png"
add str(karta2+kartam2)+".png"
add str(karta3+kartam3)+".png"
add str(karta4+kartam4)+".png"
label card78:
scene tb
$ btnn=2
$ kart1=renpy.random.randint(2,11)
$ kartm1=renpy.random.choice([100,200,300,400])
$ karta1=renpy.random.randint(2,11)
$ kartam1=renpy.random.choice([100,200,300,400])
$ kart2=0
$ kart3=0
$ kart4=0
$ kartm2=0
$ kartm3=0
$ kartm4=0
$ karta2=0
$ karta3=0
$ karta4=0
$ kartam2=0
$ kartam3=0
$ kartam4=0
$ cpupoint=kart1
$ ipoint=karta1
label bgme:
show screen c78
show screen c78a
e "Opponent - [cpupoint]\n Your cards - [ipoint]"
jump bgme
label cpui:
if cpupoint>16:
if btnn==4:
$ kart3=0
$ kartm3=0
if btnn==5:
$ kart4=0
$ kartm4=0
$ cpupoint=kart1+kart2+kart3+kart4
$ ipoint=karta1+karta2+karta3+karta4
if cpupoint>21:
if kart1==11:
$ kart1=1
elif kart2==11:
$ kart2=1
elif kart3==11:
$ kart3=1
elif kart4==11:
$ kart4=1
$ cpupoint=kart1+kart2+kart3+kart4
if ipoint>21:
if karta1==11:
$ karta1=1
elif karta2==11:
$ karta2=1
elif karta3==11:
$ karta3=1
elif karta4==11:
$ karta4=1
$ ipoint=karta1+karta2+karta3+karta4
jump bgme
label cstand:
hide screen c78a
$ cpupoint=kart1+kart2+kart3+kart4
$ ipoint=karta1+karta2+karta3+karta4
if ipoint>21:
if cpupoint>21:
e "Draw"
else:
e "Losing bust"
elif cpupoint>21:
e "Victory"
elif ipoint==cpupoint:
e "Draw"
elif ipoint>cpupoint:
if cpupoint<17:
if kart2==0:
$ kart2=renpy.random.randint(2,11)
$ kartm2=renpy.random.choice([100,200,300,400])
jump cstand
elif kart3==0:
$ kart3=renpy.random.randint(2,11)
$ kartm3=renpy.random.choice([100,200,300,400])
jump cstand
elif kart4==0:
$ kart4=renpy.random.randint(2,11)
$ kartm4=renpy.random.choice([100,200,300,400])
jump cstand
e "Victory"
else:
e "Loss"
return
2) Fool card, 1 on 1 card79.rpy
https://pp.userapi.com/c841623/v8416236 ... w23P_E.jpg
Code: Select all
### Card, background, main buttons
screen c79:
if cpua==1:
textbutton "Pick up" xalign .5 yalign .7 action [SetVariable("kstep",0),SetVariable("tblnmb",set([0])),Jump("khodv")]
else:
if len(tblkardal)>1:
textbutton "Finish the move" xalign .5 yalign .7 action [SetVariable("dhod",0),SetVariable("cpua",1),Jump("khodotb")]
hbox xalign .1:
if kart1!=0:
add "krb.webp"
if kart2!=0:
add "krb.webp"
if kart3!=0:
add "krb.webp"
if kart4!=0:
add "krb.webp"
if kart5!=0:
add "krb.webp"
if kart6!=0:
add "krb.webp"
if kart7!=0:
add "krb.webp"
if kart8!=0:
add "krb.webp"
if kart9!=0:
add "krb.webp"
if kart10!=0:
add "krb.webp"
if kart11!=0:
add "krb.webp"
if kart12!=0:
add "krb.webp"
hbox xpos .14 yalign .5:
if len(tblkardal)>1:
add str(tblkardal[1])+".png"
if len(tblkarda)>2:
add str(tblkardal[2])+".png"
if len(tblkarda)>3:
add str(tblkardal[3])+".png"
if len(tblkarda)>4:
add str(tblkardal[4])+".png"
if len(tblkarda)>5:
add str(tblkardal[5])+".png"
if len(tblkarda)>6:
add str(tblkardal[6])+".png"
if len(tblkarda)>7:
add str(tblkardal[7])+".png"
if len(tblkarda)>8:
add str(tblkardal[8])+".png"
if len(tblkarda)>9:
add str(tblkardal[9])+".png"
if len(tblkarda)>10:
add str(tblkardal[10])+".png"
if len(tblkarda)>11:
add str(tblkardal[11])+".png"
if len(tblkarda)>12:
add str(tblkardal[12])+".png"
hbox xpos .15 yalign .55:
if len(tblkardzl)>1:
add str(tblkardzl[1])+".png"
if len(tblkardz)>2:
add str(tblkardzl[2])+".png"
if len(tblkardz)>3:
add str(tblkardzl[3])+".png"
if len(tblkardz)>4:
add str(tblkardzl[4])+".png"
if len(tblkardz)>5:
add str(tblkardzl[5])+".png"
if len(tblkardz)>6:
add str(tblkardzl[6])+".png"
if len(tblkardz)>7:
add str(tblkardzl[7])+".png"
if len(tblkardz)>8:
add str(tblkardzl[8])+".png"
if len(tblkardz)>9:
add str(tblkardzl[9])+".png"
if len(tblkardz)>10:
add str(tblkardzl[10])+".png"
if len(tblkardz)>11:
add str(tblkardzl[11])+".png"
if len(tblkardz)>12:
add str(tblkardzl[12])+".png"
hbox yalign .5:
add str(kozir)+".png" rotate -90
if len(koloda)>0:
hbox yalign .5:
add "krb.webp"
hbox xalign .1 yalign .94:
if karta1!=0:
imagebutton idle str(karta1)+".png" action [SetVariable("kartah",karta1),SetVariable("knmb",1),Jump("khod0")]
if karta2!=0:
imagebutton idle str(karta2)+".png" action [SetVariable("kartah",karta2),SetVariable("knmb",2),Jump("khod0")]
if karta3!=0:
imagebutton idle str(karta3)+".png" action [SetVariable("kartah",karta3),SetVariable("knmb",3),Jump("khod0")]
if karta4!=0:
imagebutton idle str(karta4)+".png" action [SetVariable("kartah",karta4),SetVariable("knmb",4),Jump("khod0")]
if karta5!=0:
imagebutton idle str(karta5)+".png" action [SetVariable("kartah",karta5),SetVariable("knmb",5),Jump("khod0")]
if karta6!=0:
imagebutton idle str(karta6)+".png" action [SetVariable("kartah",karta6),SetVariable("knmb",6),Jump("khod0")]
if karta7!=0:
imagebutton idle str(karta7)+".png" action [SetVariable("kartah",karta7),SetVariable("knmb",7),Jump("khod0")]
if karta8!=0:
imagebutton idle str(karta8)+".png" action [SetVariable("kartah",karta8),SetVariable("knmb",8),Jump("khod0")]
if karta9!=0:
imagebutton idle str(karta9)+".png" action [SetVariable("kartah",karta9),SetVariable("knmb",9),Jump("khod0")]
if karta10!=0:
imagebutton idle str(karta10)+".png" action [SetVariable("kartah",karta10),SetVariable("knmb",10),Jump("khod0")]
if karta11!=0:
imagebutton idle str(karta11)+".png" action [SetVariable("kartah",karta11),SetVariable("knmb",11),Jump("khod0")]
if karta12!=0:
imagebutton idle str(karta12)+".png" action [SetVariable("kartah",karta12),SetVariable("knmb",12),Jump("khod0")]
####Here begins the game
label card79:
scene tb
$ cpukarn=set([])
$ knmb=0
####Cards register numbers
$ koloda=set([102,103,104,105,106,107,108,109,110,111,202,203,204,205,206,207,208,209,210,211,302,303,304,305,306,307,308,309,310,311,402,403,404,405,406,407,408,409,410,411])
###Prescribe the cards that will first drop to the player
$ kart1=renpy.random.choice(list(koloda))
$ koloda.remove(kart1)
$ kart2=renpy.random.choice(list(koloda))
$ koloda.remove(kart2)
$ kart3=renpy.random.choice(list(koloda))
$ koloda.remove(kart3)
$ kart4=renpy.random.choice(list(koloda))
$ koloda.remove(kart4)
$ kart5=renpy.random.choice(list(koloda))
$ koloda.remove(kart5)
$ kart6=renpy.random.choice(list(koloda))
$ koloda.remove(kart6)
$ kart7=0
$ kart8=0
$ kart9=0
$ kart10=0
$ kart11=0
$ kart12=0
###I prescribe the cards that first drop the computer
$ karta1=renpy.random.choice(list(koloda))
$ koloda.remove(karta1)
$ karta2=renpy.random.choice(list(koloda))
$ koloda.remove(karta2)
$ karta3=renpy.random.choice(list(koloda))
$ koloda.remove(karta3)
$ karta4=renpy.random.choice(list(koloda))
$ koloda.remove(karta4)
$ karta5=renpy.random.choice(list(koloda))
$ koloda.remove(karta5)
$ karta6=renpy.random.choice(list(koloda))
$ koloda.remove(karta6)
$ karta7=0
$ karta8=0
$ karta9=0
$ karta10=0
$ karta11=0
$ karta12=0
###Trumps
$ kozir=renpy.random.choice(list(koloda))
$ koloda.remove(kozir)
if kozir>400: ###If the card starts with 4
$ cozir=4
elif kozir>300: ###If the card starts with 3
$ cozir=3
elif kozir>200: ###If the card starts with 2
$ cozir=2
else: ###If the card starts with 1
$ cozir=1
$ koziri=set([0])
if karta1/100==cozir:
$ koziri.add(karta1)
if karta2/100==cozir:
$ koziri.add(karta2)
if karta3/100==cozir:
$ koziri.add(karta3)
if karta4/100==cozir:
$ koziri.add(karta4)
if karta5/100==cozir:
$ koziri.add(karta5)
if karta6/100==cozir:
$ koziri.add(karta6)
$ igkozir=max(koziri)
$ koziri=set([0])
if kart1/100==cozir:
$ koziri.add(kart1)
if kart2/100==cozir:
$ koziri.add(kart2)
if kart3/100==cozir:
$ koziri.add(kart3)
if kart4/100==cozir:
$ koziri.add(kart4)
if kart5/100==cozir:
$ koziri.add(kart5)
if kart6/100==cozir:
$ koziri.add(kart6)
$ cpukozir=max(koziri) ###computer all trumps
if igkozir==0: ###player
$ dhod=0
$ cpua=1
elif igkozir<cpukozir: ###player <computer
$ dhod=1
$ cpua=0
else:
$ dhod=0
$ cpua=1
$ tblkardz=set([0])
$ tblkarda=set([0])
$ tblkardzl=list("0")
$ tblkardal=list("0")
$ tblkarde=set([0])
$ kartah=0
$ kstep=0
$ tblnmb=set([0])
jump khod
label dgme:
show screen c79
e " "
jump dgme
label khod0:
if cpua==1:
$ tblkardale=len(tblkardal)
$ tblkardale=tblkardal[tblkardale-1]
if (kartah/100)==cozir:
if (tblkardale/100)==cozir:
if kartah>tblkardale:
jump khod0a
else:
jump khod0a
if tblkardale<200:
if kartah<200:
if kartah>tblkardale:
pass
else:
jump dgme
else:
jump dgme
elif tblkardale<300:
if 200<kartah<300:
if kartah>tblkardale:
pass
else:
jump dgme
else:
jump dgme
elif tblkardale<400:
if 300<kartah<400:
if kartah>tblkardale:
pass
else:
jump dgme
else:
jump dgme
else:
if kartah>400:
if kartah>tblkardale:
pass
else:
jump dgme
else:
jump dgme
label khod0a:
$ tblkardz.add(kartah)
$ tblkardzl.append(kartah)
else:
if len(tblkarda)>1:
$ tblnmb.discard(0)
$ tblnmb.add(tblkardal[kstep]%100)
$ tblnmb.add(tblkardzl[kstep]%100)
if kartah%100 not in(tblnmb):
jump dgme
$ kstep+=1
$ tblkarda.add(kartah)
$ tblkardal.append(kartah)
$ globals()[("karta%s"%(knmb))]=0
$ dhod=0
####Card when distributed here we get
label khod:
if dhod==0:
if cpua==1:
jump khod2
jump khod2i
jump dgme
label khod1a:
$ cpukarn=set([kart1,kart2,kart3,kart4,kart5,kart6,kart7,kart8,kart9,kart10,kart11,kart12])
$ cpukarn.discard(0)
$ igkarn=set([karta1,karta2,karta3,karta4,karta5,karta6,karta7,karta8,karta9,karta10,karta11,karta12])
$ igkarn.discard(0)
if len(cpukarn)<6:
if len(koloda)<1:
if len(igkarn)<1:
jump dgwin
if kozir==0:
if len(cpukarn)<1:
jump dglose
if cpua==0:
jump dgme
jump khod2
else:
$ kartavz=kozir
$ kozir=0
jump kartavz1
$ kartavz=renpy.random.choice(list(koloda))
$ koloda.remove(kartavz)
label kartavz1:
if kart1==0:
$ kart1=kartavz
elif kart2==0:
$ kart2=kartavz
elif kart3==0:
$ kart3=kartavz
elif kart4==0:
$ kart4=kartavz
elif kart5==0:
$ kart5=kartavz
else:
$ kart6=kartavz
if len(igkarn)<6:
if len(koloda)<1:
if kozir==0:
if len(igkarn)<1:
jump dgwin
if cpua==0:
jump dgme
jump khod2
else:
$ kartavz=kozir
$ kozir=0
jump kartavz2
$ kartavz=renpy.random.choice(list(koloda))
$ koloda.remove(kartavz)
label kartavz2:
if karta1==0:
$ karta1=kartavz
elif karta2==0:
$ karta2=kartavz
elif karta3==0:
$ karta3=kartavz
elif karta4==0:
$ karta4=kartavz
elif karta5==0:
$ karta5=kartavz
else:
$ karta6=kartavz
elif len(igkarn)<6:
if len(koloda)<1:
if kozir==0:
if len(igkarn)<1:
jump dgwin
if cpua==0:
jump dgme
jump khod2
else:
$ kartavz=kozir
$ kozir=0
jump kartavz3
$ kartavz=renpy.random.choice(list(koloda))
$ koloda.remove(kartavz)
label kartavz3:
if karta1==0:
$ karta1=kartavz
elif karta2==0:
$ karta2=kartavz
elif karta3==0:
$ karta3=kartavz
elif karta4==0:
$ karta4=kartavz
elif karta5==0:
$ karta5=kartavz
else:
$ karta6=kartavz
else:
if cpua==0:
jump dgme
jump khod2
jump khod1a
label khod2:
$ igkarn=set([karta1,karta2,karta3,karta4,karta5,karta6,karta7,karta8,karta9,karta10,karta11,karta12])
$ igkarn.discard(0)
if len(igkarn)<1:
$ dhod=1
$ cpua=0
jump khodotb
if len(tblkarda)>1+kstep:
$ tblnmb.discard(0)
$ cpukarn=set([])
$ tblnmb.add(tblkardal[kstep+1]%100)
$ tblnmb.add(tblkardzl[kstep+1]%100)
$ kstep+=1
if kart1%100 in tblnmb:
$ cpukarn.add(kart1)
if kart2%100 in tblnmb:
$ cpukarn.add(kart2)
if kart3%100 in tblnmb:
$ cpukarn.add(kart3)
if kart4%100 in tblnmb:
$ cpukarn.add(kart4)
if kart5%100 in tblnmb:
$ cpukarn.add(kart5)
if kart6%100 in tblnmb:
$ cpukarn.add(kart6)
if kart7%100 in tblnmb:
$ cpukarn.add(kart7)
if kart8%100 in tblnmb:
$ cpukarn.add(kart8)
if kart9%100 in tblnmb:
$ cpukarn.add(kart9)
if kart10%100 in tblnmb:
$ cpukarn.add(kart10)
if kart11%100 in tblnmb:
$ cpukarn.add(kart11)
if kart12%100 in tblnmb:
$ cpukarn.add(kart12)
if len(cpukarn)<1:
$ dhod=1
$ cpua=0
jump khodotb
jump khod2a
label khod2i:
$ cpukarn=set([kart1,kart2,kart3,kart4,kart5,kart6,kart7,kart8,kart9,kart10,kart11,kart12])
$ cpukarnc=set([])
$ cpukarn.discard(0)
if len(cpukarn)<1:
jump dglose
if kart1/100==cozir:
$ cpukarnc.add(kart1)
if kart2/100==cozir:
$ cpukarnc.add(kart2)
if kart3/100==cozir:
$ cpukarnc.add(kart3)
if kart4/100==cozir:
$ cpukarnc.add(kart4)
if kart5/100==cozir:
$ cpukarnc.add(kart5)
if kart6/100==cozir:
$ cpukarnc.add(kart6)
if kart7/100==cozir:
$ cpukarnc.add(kart7)
if kart8/100==cozir:
$ cpukarnc.add(kart8)
if kart9/100==cozir:
$ cpukarnc.add(kart9)
if kart10/100==cozir:
$ cpukarnc.add(kart10)
if kart11/100==cozir:
$ cpukarnc.add(kart11)
if kart12/100==cozir:
$ cpukarnc.add(kart12)
if cpua==0:
$ cpukarn=set([])
$ kartaa=len(tblkardal)-1
$ kartaa=tblkardal[kartaa]
if kartaa%100<kart1%100:
if kartaa/100==kart1/100:
$ cpukarn.add(kart1)
if kartaa%100<kart2%100:
if kartaa/100==kart2/100:
$ cpukarn.add(kart2)
if kartaa%100<kart3%100:
if kartaa/100==kart3/100:
$ cpukarn.add(kart3)
if kartaa%100<kart4%100:
if kartaa/100==kart4/100:
$ cpukarn.add(kart4)
if kartaa%100<kart5%100:
if kartaa/100==kart5/100:
$ cpukarn.add(kart5)
if kartaa%100<kart6%100:
if kartaa/100==kart6/100:
$ cpukarn.add(kart6)
if kartaa%100<kart7%100:
if kartaa/100==kart7/100:
$ cpukarn.add(kart7)
if kartaa%100<kart8%100:
if kartaa/100==kart8/100:
$ cpukarn.add(kart8)
if kartaa%100<kart9%100:
if kartaa/100==kart9/100:
$ cpukarn.add(kart9)
if kartaa%100<kart10%100:
if kartaa/100==kart10/100:
$ cpukarn.add(kart10)
if kartaa%100<kart11%100:
if kartaa/100==kart11/100:
$ cpukarn.add(kart11)
if kartaa%100<kart12%100:
if kartaa/100==kart12/100:
$ cpukarn.add(kart12)
jump khod2a
$ cpukarn-=cpukarnc
label khod2a:
if len(cpukarn)==0:
if kartaa/100==cozir:
if cpua==0:
jump khodvc
if len(cpukarnc)>0:
$ cpukar=min(cpukarnc)
jump khod2u
else:
jump khodvc
$ cpukarn=set([kart1,kart2,kart3,kart4,kart5,kart6,kart7,kart8,kart9,kart10,kart11,kart12])
$ cpukarn.discard(0)
$ cpukar=min(cpukarn)
label khod2u:
if cpukar==kart1:
$ kart1=0
elif cpukar==kart2:
$ kart2=0
elif cpukar==kart3:
$ kart3=0
elif cpukar==kart4:
$ kart4=0
elif cpukar==kart5:
$ kart5=0
elif cpukar==kart6:
$ kart6=0
elif cpukar==kart7:
$ kart7=0
elif cpukar==kart8:
$ kart8=0
elif cpukar==kart9:
$ kart9=0
elif cpukar==kart10:
$ kart10=0
elif cpukar==kart11:
$ kart11=0
else:
$ kart12=0
if cpua==1:
$ tblkarda.add(cpukar)
$ tblkardal.append(cpukar)
else:
$ tblkardz.add(cpukar)
$ tblkardzl.append(cpukar)
$ cpukarn=set([kart1,kart2,kart3,kart4,kart5,kart6,kart7,kart8,kart9,kart10,kart11,kart12])
$ cpukarn.discard(0)
if len(cpukarn)<1:
$ dhod=0
$ cpua=1
jump khodotb
$ dhod=1
jump khod
label khodv:
if len(tblkardal)>1:
$ kartavz=tblkardal[1]
$ tblkarda.remove(kartavz)
$ tblkardal.remove(kartavz)
jump khodv1
if len(tblkardzl)>1:
$ kartavz=list(tblkardz)
$ kartavz=kartavz[1]
$ tblkardz.remove(kartavz)
$ tblkardzl.remove(kartavz)
jump khodv1
jump khod1a
label khodv1:
if karta1==0:
$ karta1=kartavz
elif karta2==0:
$ karta2=kartavz
elif karta3==0:
$ karta3=kartavz
elif karta4==0:
$ karta4=kartavz
elif karta5==0:
$ karta5=kartavz
elif karta6==0:
$ karta6=kartavz
elif karta7==0:
$ karta7=kartavz
elif karta8==0:
$ karta8=kartavz
elif karta9==0:
$ karta9=kartavz
elif karta10==0:
$ karta10=kartavz
elif karta11==0:
$ karta11=kartavz
elif karta12==0:
$ karta12=kartavz
else:
jump dglose
jump khodv
label khodvc:
if len(tblkardal)>1:
$ kartavz=tblkardal[1]
$ tblkarda.remove(kartavz)
$ tblkardal.remove(kartavz)
jump khodv1c
if len(tblkardzl)>1:
$ kartavz=list(tblkardz)
$ kartavz=kartavz[1]
$ tblkardz.remove(kartavz)
$ tblkardzl.remove(kartavz)
jump khodv1c
$ tblnmb=set([0])
$ kstep=0
$ tblkarda=set([0])
$ tblkardal=list(["0"])
$ tblkardz=set([0])
$ tblkardzl=list(["0"])
jump khod1a
label khodv1c:
if kart1==0:
$ kart1=kartavz
elif kart2==0:
$ kart2=kartavz
elif kart3==0:
$ kart3=kartavz
elif kart4==0:
$ kart4=kartavz
elif kart5==0:
$ kart5=kartavz
elif kart6==0:
$ kart6=kartavz
elif kart7==0:
$ kart7=kartavz
elif kart8==0:
$ kart8=kartavz
elif kart9==0:
$ kart9=kartavz
elif kart10==0:
$ kart10=kartavz
elif kart11==0:
$ kart11=kartavz
elif kart12==0:
$ kart12=kartavz
else:
jump dgwin
jump khodvc
label khodotb:
$ tblnmb=set([0])
$ kstep=0
$ tblkarda=set([0])
$ tblkardal=list(["0"])
$ tblkardz=set([0])
$ tblkardzl=list(["0"])
jump khod1a
label dglose:
hide screen c79
e "Loss"
return
label dgwin:
hide screen c79
e "Victory"
return
label dgnich:
hide screen c79
e "Draw"
return
3) Drunkard, 1 on 1 card77.rpy
Code: Select all
screen c77:
if len(koloda)<1:
textbutton "Pass" xalign .5 yalign .7 action [SetVariable("dhod",0),SetVariable("igpass",1),Jump("khodp")]
else:
textbutton "Take a card" xalign .5 yalign .7 action Jump("khodvр")
hbox xalign .1:
if kart1!=0:
add "krb.webp"
if kart2!=0:
add "krb.webp"
if kart3!=0:
add "krb.webp"
if kart4!=0:
add "krb.webp"
if kart5!=0:
add "krb.webp"
if kart6!=0:
add "krb.webp"
if kart7!=0:
add "krb.webp"
if kart8!=0:
add "krb.webp"
if kart9!=0:
add "krb.webp"
if kart10!=0:
add "krb.webp"
if kart11!=0:
add "krb.webp"
if kart12!=0:
add "krb.png"
hbox yalign .5 xalign .44:
add str(kozir)+".png"
if len(koloda)>0:
hbox yalign .5 xalign .56:
add "krb.webp"
hbox xalign .1 yalign .94:
if karta1!=0:
imagebutton idle str(karta1)+".png" action [SetVariable("kartah",karta1),SetVariable("knmb",1),Jump("khodp")]
if karta2!=0:
imagebutton idle str(karta2)+".png" action [SetVariable("kartah",karta2),SetVariable("knmb",2),Jump("khodp")]
if karta3!=0:
imagebutton idle str(karta3)+".png" action [SetVariable("kartah",karta3),SetVariable("knmb",3),Jump("khodp")]
if karta4!=0:
imagebutton idle str(karta4)+".png" action [SetVariable("kartah",karta4),SetVariable("knmb",4),Jump("khodp")]
if karta5!=0:
imagebutton idle str(karta5)+".png" action [SetVariable("kartah",karta5),SetVariable("knmb",5),Jump("khodp")]
if karta6!=0:
imagebutton idle str(karta6)+".png" action [SetVariable("kartah",karta6),SetVariable("knmb",6),Jump("khodp")]
if karta7!=0:
imagebutton idle str(karta7)+".png" action [SetVariable("kartah",karta7),SetVariable("knmb",7),Jump("khodp")]
if karta8!=0:
imagebutton idle str(karta8)+".png" action [SetVariable("kartah",karta8),SetVariable("knmb",8),Jump("khodp")]
if karta9!=0:
imagebutton idle str(karta9)+".png" action [SetVariable("kartah",karta9),SetVariable("knmb",9),Jump("khodp")]
if karta10!=0:
imagebutton idle str(karta10)+".png" action [SetVariable("kartah",karta10),SetVariable("knmb",10),Jump("khodp")]
if karta11!=0:
imagebutton idle str(karta11)+".png" action [SetVariable("kartah",karta11),SetVariable("knmb",11),Jump("khodp")]
if karta12!=0:
imagebutton idle str(karta12)+".png" action [SetVariable("kartah",karta12),SetVariable("knmb",12),Jump("khodp")]
label card77:
scene tb
$ cpukarn=set([])
$ knmb=0
$ igpass=0
$ koloda=set([102,103,104,105,106,107,108,109,110,111,202,203,204,205,206,207,208,209,210,211,302,303,304,305,306,307,308,309,310,311,402,403,404,405,406,407,408,409,410,411])
$ kart1=renpy.random.choice(list(koloda))
$ koloda.remove(kart1)
$ kart2=renpy.random.choice(list(koloda))
$ koloda.remove(kart2)
$ kart3=renpy.random.choice(list(koloda))
$ koloda.remove(kart3)
$ kart4=renpy.random.choice(list(koloda))
$ koloda.remove(kart4)
$ kart5=renpy.random.choice(list(koloda))
$ koloda.remove(kart5)
$ kart6=renpy.random.choice(list(koloda))
$ koloda.remove(kart6)
$ kart7=renpy.random.choice(list(koloda))
$ koloda.remove(kart7)
$ kart8=0
$ kart9=0
$ kart10=0
$ kart11=0
$ kart12=0
$ karta1=renpy.random.choice(list(koloda))
$ koloda.remove(karta1)
$ karta2=renpy.random.choice(list(koloda))
$ koloda.remove(karta2)
$ karta3=renpy.random.choice(list(koloda))
$ koloda.remove(karta3)
$ karta4=renpy.random.choice(list(koloda))
$ koloda.remove(karta4)
$ karta5=renpy.random.choice(list(koloda))
$ koloda.remove(karta5)
$ karta6=renpy.random.choice(list(koloda))
$ koloda.remove(karta6)
$ karta7=renpy.random.choice(list(koloda))
$ koloda.remove(karta7)
$ karta8=0
$ karta9=0
$ karta10=0
$ karta11=0
$ karta12=0
$ kozir=renpy.random.choice(list(koloda))
$ koloda.remove(kozir)
$ igkozir=max(karta1,karta2,karta3,karta4,karta5,karta6,karta7)
$ cpukozir=max(kart1,kart2,kart3,kart4,kart5,kart6,kart7)
if igkozir>cpukozir:
$ dhod=1
else:
$ dhod=0
$ kartah=0
label khodp:
if dhod==0:
jump khod2ip
if kartah/100==kozir/100:
$ kozir=kartah
$ globals()[("karta%s"%(knmb))]=0
$ dhod=0
$ igkarn=set([karta1,karta2,karta3,karta4,karta5,karta6,karta7,karta8,karta9,karta10,karta11,karta12])
$ igkarn.discard(0)
if len(igkarn)<1:
jump pgwin
jump khod2ip
elif kartah%100==kozir%100:
$ kozir=kartah
$ globals()[("karta%s"%(knmb))]=0
$ dhod=0
$ igkarn=set([karta1,karta2,karta3,karta4,karta5,karta6,karta7,karta8,karta9,karta10,karta11,karta12])
$ igkarn.discard(0)
if len(igkarn)<1:
jump pgwin
jump khod2ip
label pgme:
show screen c77
e "..."
jump pgme
label khod2ip:
$ cpukarn=set([])
if kozir/100==kart1/100:
$ cpukarn.add(kart1)
if kozir/100==kart2/100:
$ cpukarn.add(kart2)
if kozir/100==kart3/100:
$ cpukarn.add(kart3)
if kozir/100==kart4/100:
$ cpukarn.add(kart4)
if kozir/100==kart5/100:
$ cpukarn.add(kart5)
if kozir/100==kart6/100:
$ cpukarn.add(kart6)
if kozir/100==kart7/100:
$ cpukarn.add(kart7)
if kozir/100==kart8/100:
$ cpukarn.add(kart8)
if kozir/100==kart9/100:
$ cpukarn.add(kart9)
if kozir/100==kart10/100:
$ cpukarn.add(kart10)
if kozir/100==kart11/100:
$ cpukarn.add(kart11)
if kozir/100==kart12/100:
$ cpukarn.add(kart12)
if kozir%100==kart1%100:
$ cpukarn.add(kart1)
if kozir%100==kart2%100:
$ cpukarn.add(kart2)
if kozir%100==kart3%100:
$ cpukarn.add(kart3)
if kozir%100==kart4%100:
$ cpukarn.add(kart4)
if kozir%100==kart5%100:
$ cpukarn.add(kart5)
if kozir%100==kart6%100:
$ cpukarn.add(kart6)
if kozir%100==kart7%100:
$ cpukarn.add(kart7)
if kozir%100==kart8%100:
$ cpukarn.add(kart8)
if kozir%100==kart9%100:
$ cpukarn.add(kart9)
if kozir%100==kart10%100:
$ cpukarn.add(kart10)
if kozir%100==kart11%100:
$ cpukarn.add(kart11)
if kozir%100==kart12%100:
$ cpukarn.add(kart12)
if len(cpukarn)<1:
if len(koloda)<1:
if igpass==1:
if kart1+kart2+kart3+kart4+kart5+kart6+kart7>karta1+karta2+karta3+karta4+karta5+karta6+karta7:
jump pgwin
jump pglose
jump pppas
$ kartavz=renpy.random.choice(list(koloda))
$ koloda.remove(kartavz)
if kart1==0:
$ kart1=kartavz
elif kart2==0:
$ kart2=kartavz
elif kart3==0:
$ kart3=kartavz
elif kart4==0:
$ kart4=kartavz
elif kart5==0:
$ kart5=kartavz
elif kart6==0:
$ kart6=kartavz
elif kart7==0:
$ kart7=kartavz
elif kart8==0:
$ kart8=kartavz
elif kart9==0:
$ kart9=kartavz
elif kart10==0:
$ kart10=kartavz
elif kart11==0:
$ kart11=kartavz
elif kart12==0:
$ kart12=kartavz
else:
jump pgwin
jump khod2ip
$ kozir=renpy.random.choice(list(cpukarn))
if kozir==kart1:
$ kart1=0
elif kozir==kart2:
$ kart2=0
elif kozir==kart3:
$ kart3=0
elif kozir==kart4:
$ kart4=0
elif kozir==kart5:
$ kart5=0
elif kozir==kart6:
$ kart6=0
elif kozir==kart7:
$ kart7=0
elif kozir==kart8:
$ kart8=0
elif kozir==kart9:
$ kart9=0
elif kozir==kart10:
$ kart10=0
elif kozir==kart11:
$ kart11=0
else:
$ kart12=0
$ cpukarn=set([kart1,kart2,kart3,kart4,kart5,kart6,kart7,kart8,kart9,kart10,kart11,kart12])
$ cpukarn.discard(0)
if len(cpukarn)<1:
jump pglose
label pppas:
$ dhod=1
$ igpass=0
jump pgme
label khodvр:
$ kartavz=renpy.random.choice(list(koloda))
$ koloda.remove(kartavz)
if karta1==0:
$ karta1=kartavz
elif karta2==0:
$ karta2=kartavz
elif karta3==0:
$ karta3=kartavz
elif karta4==0:
$ karta4=kartavz
elif karta5==0:
$ karta5=kartavz
elif karta6==0:
$ karta6=kartavz
elif karta7==0:
$ karta7=kartavz
elif karta8==0:
$ karta8=kartavz
elif karta9==0:
$ karta9=kartavz
elif karta10==0:
$ karta10=kartavz
elif karta11==0:
$ karta11=kartavz
elif karta12==0:
$ karta12=kartavz
else:
jump pglose
jump pgme
label pglose:
hide screen c77
e "Loss"
return
label pgwin:
hide screen c77
e "Victory"
return
Download the finished version (only the buttons there in Russian are made)
https://vk.com/doc189145553_451441774?h ... c0cff9b871