gffpvww`www`www`www`www`wwwffffwwwwwwwvwwgfwwfvggfgffvvffvwwgwwwwwwvwwwwwwwwgffpvww`www`www`wwwffffwwwwwwwvwwgfwwfvffvwwgwwwwwwvwwVUU`effPfffPfffPfffPfffPfffUUUUfffffffeffVUffUeVVUVUUeeUUeffVffffffeffffffffVUU`effPfffPfffPfffUUUUfffffffeffVUffUeUUeffVffffffeff`www`www`wwwpvwwpgffpwwwwwwgfgwwvvwwgwwwwwwffffwwwwwwwwwwwwwwwwwwwgffvwwwwww`www`www`www`www`wwwpvwwgffggfgffvvgfgwwvvwwgwwwwwwffffwwwwwwwwwwwwwwwwwgffvPfffPfffPfff`eff`VUU`ffffffVUVffeeffVffffffUUUUfffffffffffffffffffVUUeffffffPfffPfffPfffPfffPfff`effVUUVVUVUUeeVUVffeeffVffffffUUUUfffffffffffffffffVUUe233 #""0"""0"""0"""0"""0"""3333""""2"2"3#3#2332"3##233"33#""2"""""""""""""""233 #""0"""0"""0"""3333""""2"2"3#3#233233#""2"""""""""CDD0433@333@333@333@333@333DDDD3333C3C3D4D4CDDC3D44CDD3DD433C333333333333333CDD0433@333@333@333DDDD3333C3C3D4D4CDDCDD433C3333333330"""0"""0""" #"" 233 """"""3#3#2222"#"#""""3333"""""""""""""""""""233#""""""0"""0"""0"""0"""0""" #""233"3##233"3#3#2222"#"#""""3333"""""""""""""""""233#@333@333@33304330CDD0333333D4D4CCCC34343333DDDD3333333333333333333CDD4333333@333@333@333@333@3330433CDD3D44CDD3D4D4CCCC34343333DDDD33333333333333333CDD4!""  !  ! """"""""""!!!!!""  ! """"""""""!!!!CDD0433@344@C43@333@C33@333DDDD333333333333333333333333DDDD333333333333333333333333DD433CCC33C4333334333CDD0433@344@C43@333DDDD3333333333333333DDDD3333333333333333DD433CCC33C4333        ""!!!""!! !       ""!!!""@333@333@333@333@333@333@333@333333333DD3C3334C434433443343334333333333343334333CD3333D3C4343C44333333333333333333333333@C33@333@333@333@333@333@333@33333333333333333DD3C3334C434433443333333333333333343334333CD3333D3334333333333333333333333        !!!""!!""        !!""!!!!""@333@333@333@333@333@333@333@C33343334333C333C3333DD3333333333333344333433C333C3DD43333333333333333333333333333333333334@333@333@333@333@333@333@333@33334333433343334333C333C3333DD3333C4343C443344333433C333C3DD433333333333333333333333333333  ! !""""""""""!!!!""  !  ! !""""""""""!!!!""@333@C43@34404330CDD03333333333333333333333DDDD333333333333333333333333DDDD333333333333C4CC333CDD4333333@333@C33@333@C43@3440433CDD333333333333333333333333DDDD333333333333333333333333DDDD3333343333C4CC333CDD4gffpvww`wvv`gvw`www`gww`wwwffffwwwwwwwwwwwwwwwwwwwwwwwwffffwwwwwwwwwwwwwwwwwwwwwwwwffvwwgggwwgvwwwwwvwwwgffpvww`wvv`gvw`wwwffffwwwwwwwwwwwwwwwwffffwwwwwwwwwwwwwwwwffvwwgggwwgvwwwVUU`effPfeePVefPfffPVffPfffUUUUffffffffffffffffffffffffUUUUffffffffffffffffffffffffUUeffVVVffVefffffefffVUU`effPfeePVefPfffUUUUffffffffffffffffUUUUffffffffffffffffUUeffVVVffVefff`www`www`www`www`www`www`www`wwwwwwwwwwwwwwfwwfwwfwwfwwvgwvgwvgwwwwwfwwwwvwwwgwwvwvwgwgwwvwvvwwfwwwwwwwwwwwwwwwwwwwwwwww`gww`www`www`www`www`www`www`wwwwwwwwwwwwwwwwwwwwwwfwwfwwfwwfwwvwwwwwwwwwwwwfwwwwvwwwgwwvwvwgwgwwwvwwwwwwwwwwwwwwwwwwwwwPfffPfffPfffPfffPfffPfffPfffPffffffffffffffUffUffUffUffeVfeVfeVfffffUffffefffVffefefVfVffefeeffUffffffffffffffffffffffffPVffPfffPfffPfffPfffPfffPfffPffffffffffffffffffffffUffUffUffUffeffffffffffffUffffefffVffefefVfVfffefffffffffffffffffffff`www`www`www`www`www`www`www`gwwwgwvwwvwwwgwwwwfwwwwwwwwwwwwwwwwwwfwwfwwfwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwv`www`www`www`www`www`www`www`wwwgwvgwvgwwgwvwwvwwwgwwwwfwwwwwwwwwvwvvwwfwwfwwfwwfwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwwPfffPfffPfffPfffPfffPfffPfffPVfffVfeffefffVffffUffffffffffffffffffUffUffUffffffffffffffffffffffffffffffffffffffffffffffePfffPfffPfffPfffPfffPfffPfffPfffVfeVfeVffVfeffefffVffffUfffffffffefeeffUffUffUffUfffffffffffffffffffffffffffffffffffffff`www`gvw`wvvpvwwpgffpwwwwwwwwwwwwwwwwwwwwwwffffwwwwwwwwwwwwwwwwwwwwwwwwffffwwwwwwwwwwwwgvggwwwgffvwwwwww`www`gww`www`gvw`wvvpvwwgffwwwwwwwwwwwwwwwwwwwwwwwwffffwwwwwwwwwwwwwwwwwwwwwwwwffffwwwwwvwwwwgvggwwwgffvPfffPVefPfee`eff`VUU`ffffffffffffffffffffffUUUUffffffffffffffffffffffffUUUUffffffffffffVeVVfffVUUeffffffPfffPVffPfffPVefPfee`effVUUffffffffffffffffffffffffUUUUffffffffffffffffffffffffUUUUfffffeffffVeVVfffVUUe  𪪺 𪪺     % >?"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐""""""""""""""""""""""""""""""""BD$""BDD$""BDD$""̐""""""""""""""""""""""""""""""""BD$""BDD$""BDD$""̐""""""""""""""""""BDD$"BD$BD$BD$"B$"̐""""""CDDDDDDDDDDD4 """"""""""BDD$"BD$BD$BD$"B$"̐ !"""""""""""""""""0433333333333C"""""""""""BD$"BDD$B$"BDDD$"̐!""""""@3443333333CC3"""""""""""BD$"BDD$B$"BDDD$"̐ !!""""""@C4333333333C4"""""""""""BD$"BD$"B$""""B$"̐ !!""""""@3333333333333"""""""""""BD$"BD$"B$""""B$"̐ """"""@C333333333334""""""""""BDDD$"BDD$""BDD$""̐ !""""""@3333333333333""""""""""BDDD$"BDD$""BDD$""̐ """"""@3333333333333"""""""""""""""""""""""""""" ̐ """"""@3333333333333"""""""""""""""""""""""""""" ̐ """"""""@33333DDD43333"""""""""""""""""""""""""""" ̐ !"""""""@3333D333C3333"""""""""""""""""""""""""""" ̐ !!""""""@333C333D34333"""""""""""""""""""""""""""" ̐ !""""""@333C333344333"""""""""""""""""""""""""""" ̐ """"""@333C333344333"""""""""""""""""""""""""""" ̐ """"""@333C333334333"""""""""""""""""""""""""""" ̐ """""""@333C3333D3333"""""""""""""""""""""""""""" ̐ !""""""@333C33CC33333"""""""""""""""""""""""""""" ̐ !!""""""@333C33CC33333"""""""""""""""""BD$"""BD$""̐ !!""""""@333C334C33333"""""""""""""""""BD$"""BD$""̐ !"""""""@333C3C4433333""""""""""""""""BDD$""BDD$""̐ """""""@3333D33433333""""""""""""""""BDD$""BDD$""̐ !"""""""""@33333DD333333"""""""""""""""BD$B$"""BD$""̐ """"""@3333333333333"""""""""""""""BD$B$"""BD$""̐ """"""@3333333333333"""""""""""""""BDDDD$""BD$""̐ """"""@C333333333334"""""""""""""""BDDDD$""BD$""̐ !""""""@3333333333333""""""""""""""""""B$""BDDD$"̐ """"""@C4333333333C4""""""""""""""""""B$""BDDD$"̐ !!""""""@3443333333CC3""""""""""""""""""""""""""""̐ !!""""""0433333333333C""""""""""""""""""""""""""""̐!""""""CDDDDDDDDDDD4 """"""""""""""""""""""""""""̐ !"""""""""""""""""""""""""""""""""""""""""""""""̐""""""""""""""""""""""""""""""""""""""""""""""""""""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"""""""""""""""""""""""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"""""""""""""""""""""""""""""DDDDDDDDDDDDDDDDDDDODDODDDDDDDDDODDDDODDDDDDDDDDD"""""""""""""""""""""""""""""DDDDDDODOODDDDODDODOODOODOODDOODDDD"""""""""""""""""""""""""""""DDDDDDODOOOODODDDDDDDOOOOODOOODOODDDD"""""""""""""""""""""""""""""DDDDDDDOOODOODDDOODDODDODODOOODOODDDD"""""""""""""""""""""""""""""DDDDDDDDOODDDDDDDODODDDODOODODOODDDD""""""""""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD""""""VUUUUUUUUUUUe """"""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD gfffffffffffv""""""`efffffffffffV""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDpvwwwwwwwwwwwg""""""PfeefffffffVVf""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`wvvwwwwwwwggw""""""PVefffffffffVe""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`gvwwwwwwwwwgv""""""Pfffffffffffff""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDODDDDDDDDDDDDDDDDDDDDDDDDDDD`wwwwwwwwwwwww""""""PVfffffffffffe""""""""DDODODODDDDODDDDODODDDDOODDDDDDDDDDDD`gwwwwwwwwwwwv""""""Pfffffffffffff""""""""DDODOODDDDDODOODODDDODDDOODDDDDDDDDDDD`wwwwwwwwwwwww""""""Pfffffffefffff""""""""DDDOODDODDDODODDDDDDOODDDOODDDDDDDDDDDDD`wwwwwwgwwwwww""""""PffffffVefffff""""""""DDODODODDDDODDDDDDDOOODOODDDDDDDDDDDDD`wwwwwwfwwwwww""""""PffffffeVfffff""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`wwwwwgwvwwwww""""""PfffffVfVfffff""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`wwwwwvwvwwwww""""""PfffffeVfeffff""""""""DDDDDDODDODDDDDDDDDDDDDDODDDDDDDDODDDDDDODDDDDDDD`wwwwgwwgwwwww""""""PffffVfefeffff""""""""DDODODDODODOODDOODDODODODDDDDDD`wwwwvwvgwwwww""""""PffffeVfeVffff""""""""DDOOOODDDODOOODDOODDDDOODODDDDDDD`wwwgwgwwvwwww""""""PffffefVfVffff""""""""DDODOODDODODODDDOODDDDOODODDDDDDD`wwwgwvgwvwwww""""""PffffVfeVfefff""""""""DDODODDODDODOODDDODODDDODODODDDDDDD`wwwwvwvwgwwww""""""PffffVffefefff""""""""DDDDDDDDDDDDDDDDDDDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`wwwwvgwvgwwww""""""PfffffeVfVffff""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`wwwwgwgwvwwww""""""Pfffffeffeffff""""""""DODODDDDDDODDDDDDDDDDDDODDDDDDDDDDDDDDDDDDDODDDDDD`wwwwgwvgwwwww""""""PfffffVfVfffff""""""""DOOODOODDDDDDDODODOOODDDDODODDDDDD`wwwwwvwvwwwww""""""PfffffVfefffff""""""""DOOOODOOODDDOODDOOOOOODODDDODDDDDD`wwwwwvgwwwwww""""""PffffffUffffff""""""""DOOOODOODDDOODODDDOOOODDDDDDDODDDDDD`wwwwwgvwwwwww""""""Pffffffeffffff""""""""DOOOODODODDDDDODDODODDDDDODODDDDDD`wwwwwgwwwwwww""""""Pfffffffffffff""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`wwwwwwwwwwwww""""""PVfffffffffffe""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`gwwwwwwwwwwwv""""""Pfffffffffffff""""""""DDDDDDDDDODDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD`wwwwwwwwwwwww""""""PVefffffffffVe""""""""DDODODOODDODODDDDOODDDDDDDDDDDDDDDDDDDDDDDDD`gvwwwwwwwwwgv""""""PfeefffffffVVf""""""""DDDOODDDDDODDDOODDDDDDDDDDDDDDDDDDDDDDDDD`wvvwwwwwwwggw""""""`efffffffffffV""""""""DDODODODDDOODDDOODDDDDDDDDDDDDDDDDDDDDDDDDDpvwwwwwwwwwwwg""""""VUUUUUUUUUUUe """"""""DDDODOODDDOOODOODDDDDDDDDDDDDDDDDDDDDDDDDD gfffffffffffv""""""""""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"""""""""""""""""""""""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"""""""""""""""""""""""""""""DDDDDDDDDDDDDDDDDODDDDDDDDDDODDDDDDDDDDDDDDDDDDDDDDD"""""""""""""""""""""""""""""DDDDODODODDODDODDODDDDODDDDDDDDDDDDDDDDD"""""""""""""""""""""""""""""DDDDOODODDDODODDODDDDDDOODDDDDDDDDDDDDDDDD"""""""""""""""""""""""""""""DDDDODOODDODODDODDDDDDODDDDDDDDDDDDDDDDD"""""""""""""""""""""""""""""DODDODDDDDODDDDODDODDDDDDDDDDDDDDDDDD"""""""""""""""""""""""""""""DDDDDDDDDDDDDDDODDDDDDDDDODDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"""""""""""""""""""""""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD""""""""""""""""DDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDDD"""""" """""""" """"""""""""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """"""""""""""""""""""""""""""""""̐ """""" """"""""""""""""""""""""""""̐ """"""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐"""""""""""""""""""""""""""""""""""""""""""""""""̐y&-- title: Rock Paper Scissor with a twist -- author: Thaui -- desc: A simple rock paper scissor game to play with friends, but you can cooperate or betray them -- license: MIT License -- version: 0.1 -- script: lua -- input: mouse --- spr(id, x, y, [colorkey=-1], [scale=1], [flip=0], [rotate=0], [w=1], [h=1]) --- button(id_idle,id_hover,id_active, x, y, [colorkey=-1], [scale=1], [flip=0], [rotate=0], [w=1], [h=1]) function button(id_idle, id_hover, id_active, x, y, w, h, colorkey, rotate, scale, flip) if w == nil then w = 1 end if h == nil then h = 1 end if flip == nil then flip = 0 end if rotate == nil then rotate = 0 end if scale == nil then scale = 1 end local mw = w * 8 * scale local mh = h * 8 * scale if rotate == 1 or rotate == 3 then mw, mh = mh, mw end local mx, my, left, middle, right = mouse() local id = id_idle local clicked = false if mx > x and mx < x + mw and my > y and my < y + mh then if id_hover ~= -1 then id = id_hover end if (left or middle or right) and id_active ~= -1 then id = id_active clicked = true end end spr(id, x, y, colorkey, scale, flip, rotate, w, h) return left and clicked, middle and clicked, right and clicked end local t = 0 local r = 1 local p1 = 0 local p2 = 0 local t1 = 0 local t2 = 0 local s1 = 0 local s2 = 0 local w1 = "Rock" local w2 = "Paper" local c1 = "Scissor" local c2 = "Rock" local COND = "RockPaperScissorRock" local SCORING = { WinningLoyalWithLoyal = 30, WinningLoyalWithBetrayer = 40, WinningBetrayerWithLoyal = 50, WinningBetrayerWithBetrayer = 30, DrawLoyalWithLoyal = 40, DrawLoyalWithBetrayer = 20, DrawBetrayerWithLoyal = 20, DrawBetrayerWithBetrayer = 0, LosingLoyalWithLoyal = 10, LosingLoyalWithBetrayer = 10, LosingBetrayerWithLoyal = 10, LosingBetrayerWithBetrayer = 0 } function calcScore() -- first we need to check if the players have won, lost or drawn local endgame = COND:find(c1 .. c2) local endgame1 = c1 == c2 and "Draw" or endgame and "Losing" or "Winning" local endgame2 = c1 == c2 and "Draw" or endgame and "Winning" or "Losing" -- then if players are loyal or betrayers local type1 = w1 == c1 and "Loyal" or "Betrayer" local type2 = w2 == c2 and "Loyal" or "Betrayer" -- then we set the score from scoring in t1 and t2 local t1 = SCORING[endgame1 .. type1 .. "With" .. type2] local t2 = SCORING[endgame2 .. type2 .. "With" .. type1] trace("===") trace("Player 1: is " .. type1 .. " With " .. w1 .. " and " .. c1) trace("Player 2: is " .. type2 .. " With " .. w2 .. " and " .. c2) trace("") trace("Player 1: " .. endgame1 .. " With " .. c1 .. " over " .. c2) trace("Player 2: " .. endgame2 .. " With " .. c2 .. " over " .. c1) trace("") return t1, t2, type1, type2, endgame1, endgame2 end function TIC() local x, y, c = mouse() local blink = t % 60 < 30 local w11 = w1 == "Rock" and blink and 8 or 0 local w12 = w1 == "Paper" and blink and 8 or 0 local w13 = w1 == "Scissor" and blink and 8 or 0 local w21 = w2 == "Rock" and blink and 8 or 0 local w22 = w2 == "Paper" and blink and 8 or 0 local w23 = w2 == "Scissor" and blink and 8 or 0 local c11 = (c1 == "Rock" or (w1 == "Rock" and blink)) and 8 or 0 local c12 = (c1 == "Paper" or (w1 == "Paper" and blink)) and 8 or 0 local c13 = (c1 == "Scissor" or (w1 == "Scissor" and blink)) and 8 or 0 local c21 = (c2 == "Rock" or (w2 == "Rock" and blink)) and 8 or 0 local c22 = (c2 == "Paper" or (w2 == "Paper" and blink)) and 8 or 0 local c23 = (c2 == "Scissor" or (w2 == "Scissor" and blink)) and 8 or 0 cls(12) rect(0, 0, 100, 136, 2) rect(140, 0, 100, 136, 9) line(99, 0, 99, 136, 0) line(140, 0, 140, 136, 0) print(r, 121 - #tostring(r) * 6, 20, 0, true, 2) print(p1, 97 - #tostring(p1) * 12, 10, 4, true, 2) print(p2, 145, 10, 11, true, 2) if t1 > 0 then print(t1, 97 - #tostring(t1) * 12, 30, 4, true, 2) end if t2 > 0 then print(t2, 145, 30, 11, true, 2) end rectb(59, 44, 122, 50, 0) rect(60, 45, 120, 48, 4) -- choose will if s1 < 2 and s2 < 2 then print("Phase 1: Bargain", 81, 47, 15) print("Both player need to", 62, 57, 15) print("tell their intention", 62, 64, 15) print("to their opponent", 62, 71, 15) print("then validate", 62, 78, 15) end if s1 == 0 then if button(64, 68, 72, 12, 12, 4, 4, 15, 1) then s1, w1 = 1, "Rock" end if button(128, 132, 136, 12, 52, 4, 4, 15, 1) then s1, w1 = 1, "Paper" end if button(192, 196, 200, 12, 92, 4, 4, 15, 1) then s1, w1 = 1, "Scissor" end button(39, -1, -1, 78, 96, 3, 2, 15, 1) end if s2 == 0 then if button(64, 68, 72, 196, 12, 4, 4, 15, 3) then s2, w2 = 1, "Rock" end if button(128, 132, 136, 196, 52, 4, 4, 15, 3) then s2, w2 = 1, "Paper" end if button(192, 196, 200, 196, 92, 4, 4, 15, 3) then s2, w2 = 1, "Scissor" end button(39, -1, -1, 148, 96, 3, 2, 15, 3) end if s1 == 0 or s2 == 0 then button(7, -1, -1, 108, 98, 3, 2, 15) end -- display will if s1 == 1 or s1 == 2 or s1 == 5 then button(w11 + 68, -1, -1, 12, 12, 4, 4, 15, 1) button(w12 + 132, -1, -1, 12, 52, 4, 4, 15, 1) button(w13 + 196, -1, -1, 12, 92, 4, 4, 15, 1) end if s2 == 1 or s2 == 2 or s1 == 5 then button(w21 + 68, -1, -1, 196, 12, 4, 4, 15, 3) button(w22 + 132, -1, -1, 196, 52, 4, 4, 15, 3) button(w23 + 196, -1, -1, 196, 92, 4, 4, 15, 3) end -- validate will if s1 == 1 then if button(36, 39, 42, 78, 96, 3, 2, 15, 1) then s1 = 0 end end if s2 == 1 then if button(36, 39, 42, 148, 96, 3, 2, 15, 3) then s2 = 0 end end if s1 == 1 and s2 == 1 then if button(4, 7, 10, 108, 98, 3, 2, 15) then s1, s2 = 2, 2 end end if s1 == 2 and s2 == 2 then s1 = 3 end -- indicate choice if s1 == 3 or s1 == 4 then print("Phase 2: Play", 81, 47, 15) print("Player red need to", 62, 57, 15) print("play secretely what", 62, 64, 15) print("they really want", 62, 71, 15) print("then validate", 62, 78, 15) end if s1 == 3 then if button(w11 + 64, w11 + 68, 72, 12, 12, 4, 4, 15, 1) then s1, c1 = 4, "Rock" end if button(w12 + 128, w12 + 132, 136, 12, 52, 4, 4, 15, 1) then s1, c1 = 4, "Paper" end if button(w13 + 192, w13 + 196, 200, 12, 92, 4, 4, 15, 1) then s1, c1 = 4, "Scissor" end button(39, -1, -1, 78, 96, 3, 2, 15, 1) button(7, -1, -1, 58, 96, 3, 2, 15, 1) end if s1 == 4 then button(c11 + 68, -1, -1, 12, 12, 4, 4, 15, 1) button(c12 + 132, -1, -1, 12, 52, 4, 4, 15, 1) button(c13 + 196, -1, -1, 12, 92, 4, 4, 15, 1) if button(36, 39, 42, 78, 96, 3, 2, 15, 1) then s1 = 3 end if button(4, 7, 10, 58, 96, 3, 2, 15, 1) then s1 = 5 end end if s1 == 5 and s2 == 2 then s2 = 3 end if s2 == 3 or s2 == 4 then print("Phase 2: Play", 81, 47, 15) print("Player blue need to", 62, 57, 15) print("play secretely what", 62, 64, 15) print("they really want", 62, 71, 15) print("then validate", 62, 78, 15) end if s2 == 3 then if button(w21 + 64, w21 + 68, 72, 196, 12, 4, 4, 15, 3) then s2, c2 = 4, "Rock" end if button(w22 + 128, w22 + 132, 136, 196, 52, 4, 4, 15, 3) then s2, c2 = 4, "Paper" end if button(w23 + 192, w23 + 196, 200, 196, 92, 4, 4, 15, 3) then s2, c2 = 4, "Scissor" end button(39, -1, -1, 146, 96, 3, 2, 15, 3) button(7, -1, -1, 166, 96, 3, 2, 15, 3) end if s2 == 4 then button(c21 + 64, -1, -1, 196, 12, 4, 4, 15, 3) button(c22 + 128, -1, -1, 196, 52, 4, 4, 15, 3) button(c23 + 192, -1, -1, 196, 92, 4, 4, 15, 3) if button(36, 39, 42, 146, 96, 3, 2, 15, 3) then s2 = 3 end if button(4, 7, 10, 166, 96, 3, 2, 15, 3) then s2 = 5 end end -- revelation if s1 > 4 and s2 > 4 and s1 < 7 then print("Phase 3: Revelation", 70, 47, 15) print("Press the validation", 62, 57, 15) print("button to reveal", 62, 64, 15) print("what has been played", 62, 71, 15) print("", 62, 78, 15) end if s1 == 5 and s2 == 5 then button(68, -1, -1, 12, 12, 4, 4, 15, 1) button(132, -1, -1, 12, 52, 4, 4, 15, 1) button(196, -1, -1, 12, 92, 4, 4, 15, 1) button(68, -1, -1, 196, 12, 4, 4, 15, 3) button(132, -1, -1, 196, 52, 4, 4, 15, 3) button(196, -1, -1, 196, 92, 4, 4, 15, 3) if button(4, 7, 13, 108, 98, 3, 2, 15) then s1, s2 = 6, 6 end end if s1 == 6 and s2 == 6 then button(w11 + 68, -1, -1, 12, 12, 4, 4, 15, 1) button(w12 + 132, -1, -1, 12, 52, 4, 4, 15, 1) button(w13 + 196, -1, -1, 12, 92, 4, 4, 15, 1) button(w21 + 68, -1, -1, 196, 12, 4, 4, 15, 3) button(w22 + 132, -1, -1, 196, 52, 4, 4, 15, 3) button(w23 + 196, -1, -1, 196, 92, 4, 4, 15, 3) if not button(13, 13, 13, 108, 98, 3, 2, 15) then s1, s2 = 7, 7 t = 0 t1, t2 = calcScore() end end if s1 > 6 then local ts1, ts2, tp1, tp2, te1, te2 = calcScore() print("Phase 3: Revelation", 70, 47, 15) print(c1 .. " over " .. c2, 62, 57, 15) print("Red: " .. w1 .. (c1 == w1 and "" or " but " .. c1), 62, 64, 15) print(te1 .. " " .. tp1 .. ": " .. ts1, 62, 71, 15) print("Blue: " .. w2 .. (c2 == w2 and "" or " but " .. c2), 62, 78, 15) print(te2 .. " " .. tp2 .. ": " .. ts2, 62, 85, 15) end if s1 == 7 and s2 == 7 then button(c11 + 68, -1, -1, 12, 12, 4, 4, 15, 1) button(c12 + 132, -1, -1, 12, 52, 4, 4, 15, 1) button(c13 + 196, -1, -1, 12, 92, 4, 4, 15, 1) button(c21 + 68, -1, -1, 196, 12, 4, 4, 15, 3) button(c22 + 132, -1, -1, 196, 52, 4, 4, 15, 3) button(c23 + 196, -1, -1, 196, 92, 4, 4, 15, 3) if t > 60 then if t1 > 0 then t1, p1, t = t1 - 1, p1 + 1, 59 end if t2 > 0 then t2, p2, t = t2 - 1, p2 + 1, 59 end end if t > 120 then s1, s2 = 8, 8 end end if s1 == 8 and s2 == 8 then button(c11 + 68, -1, -1, 12, 12, 4, 4, 15, 1) button(c12 + 132, -1, -1, 12, 52, 4, 4, 15, 1) button(c13 + 196, -1, -1, 12, 92, 4, 4, 15, 1) button(c21 + 68, -1, -1, 196, 12, 4, 4, 15, 3) button(c22 + 132, -1, -1, 196, 52, 4, 4, 15, 3) button(c23 + 196, -1, -1, 196, 92, 4, 4, 15, 3) if button(4, 7, 10, 108, 98, 3, 2, 15) then s1, s2, r = 0, 0, r + 1 end end t = t + 1 end