`f`fff`ffffffffvwfvwwffffffff"""""232ff"2fV"2fuffV7ffu3uw3s333s""""#"#3y#"#"ݘwwwUfWefff`fffffffwwww""""""""2C"""""ffffffffffffwwww""""""""2C"""""fV7fu33V733w333"3"33"333"333>3333333333333333333333ww?3-"ލݘݍ݈""""~~"""""""""4#""""~""r"""r""4#""r".B""BB""""""."."""""wB""BB"""""".""""""qw"333"3>3>3333"333"333wFF63ff63FF63ff>ff63ff63qwww=44=33=44>33=33=33ww""..""qwww""$.""$$".""".""""""wwww"$."$$""""'r".'""r"̪̼̻̻ȼ̼̼ʬ̼˪˻̫˼˻ʺʪʜ˼̙ʜə  """ """"""D"""".""D""!D!BD@DD@DDDDD4DDDDCDD4DDNDDDNDADBDDMDLDDD $DDD "BD "D !D"DD "BD "D " D$"H$$K$$D$D"" ""(""!ADtDdDBD@DDDGF$D! @D@D@C,0DDDDDTDCUw4TUULDLCLLLDDC\DDDWEDDUUDD@@"((HD@@ڪ ̬L̪D @0DUVwDeWWeUV UV gV " """""UUDNgUEDUVECUDv"D""BD""@4""B@@DDD@DDD !""@""" """"""""" """"@""""""$"" """ """'"r"D "r&"""f%2""VC#"R4"""""""0333033323#3D0333#3223D33D D rBD"tD"D BD@DDD$"G$$K$$$$"D"r" """ ""   #CD03tD03dD03BD03CD03D030D43G44F44$43D3#33<33MD݄DTDDDMD}Dw}wwD H E D D t q ww NDDDNDADADDMDLDDD DDD@@03033233 MD33333"  @@tppwpwwwww3<0<|LwDwwwwww wq~w@wv@wvwwwwwwvwgGwD #3103#3323323333 03333233#332333#33gwwPwwwpwwwwwwwwwppwwwwwwwwwgwuww!  "!"! "!"DD NDDDBDND.D".""DIK$D$ !"",ODODD LADD"!.!@"!@"!""ٙ"" ""!"B"D DC4NA4DC DCDD؈DD1DDCDD N DYY@YYYCYYYYYYYYYYYYYYYY %&'()*+,56789:;<!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!111111111111111111111111111111   a a a aaa a aaa a aaa a aaa a aaaaaaaaaaaaaaaaaaaaaaaaa   aaaaaaaaaaaaaa a a a a a a a a a a a aaaaaaaaa a a a a a a a aaaaaaaaa a a a a a a a aaaaaaaaaBBBBBBBBBBBBBBBBBBBBbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbbb b b b bbbbb       AABABBAAAAAAAAAAAAAAAAAAA       b bbb bbb bbb bbbb b b bbb bbb bb a aaa a a aa a aaa a a a a a a a aaa aa2* Q0'( +? "  "   " ""    " "`ff`` "   " "ff`ff " """""f`ff``fff``  "`f`ffff  " """" ""    " ""    " """  " " "̻̼̻̻ȼ˪̼̼̼̪ʬ̻̼̼˼ȼ̻̻˪ə̫Ȭ̪̻˪̻ə """""" """.""""""DD"""""BDD$"""""NDD "DH$$"""2DDD !DK$$#"`ffff32ffuNDAD "DDD$#3fffvw"2fVwDAD "BDD"" y#"w`ffvww"2fu3sDDD "D""ݘ#"wffffffffV733MDD "("ݍ`ffffffffu33sL "ݘwffffffffV7>3 "ލ~~`ffffffffu33333(ݘ~ffffffffV7333333@(ݍwwwwwwwww3333333@H݈"""""""""3333D"""""""r""""""""""33333"""""""r"2C"2C""3333333""4#"4#"""""""""333ww?3-""""""""r".B"B"""333FF63=44"""$."$."BB"BB"""3>3ff63=33"""$$"$$"""""">3FF63=44."."""'"."""333ff>>33.""".r"."."""333ff63=33"""".'"""""""""333ff63=33"""""""r"@D@DwqwwqwwwDDDDwwqwwwwwwwUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWeUfWe """"""""""""""""""""""""""""""""""""""""ffffffffffffffffffffffffffffffffffffffff""""""""""""""""""""""""""""""""""""""""ffffffffffffffffffffffffffffffffffffffff""""""""""""""""""""""""""""""""""""""""ffffffffffffffffffffffffffffffffffffffff"""""""""""""""""""""""" """""""ffffffffff`ffffffffffff`ffffffffff"""""" "" " " " " " ""ffffffffff`ff`ff``f`fffffffff"""""" " " " ""  " """ ""ffffffffffff```f```f`f`fffffffff""""""""" " " ""  " "  "" ""fffffffffff`f```ff`f``f`fffffffff"""""""""""" "" """"ffffffffffff`fff`ffffffffff""""""""""""""""""""""""""""""""""""""""fffffffffffffffffffffffffffffffffffffff""""""""""""""""""""""""""""""""""""""""ffffffffffffffffffffffffffffffffffffffff""""""""""""""""""""""""""""""""""""""""ffffffffffffffffffffffffffffffffffffffff-- title: which is witch -- author: figgydevs -- desc: Make choices and prosecute witches -- site: website link -- license: CC BY-NC -- version: 0.1 -- script: lua -- music local current_music_phase = nil --disable mouse poke(0xFF9C,0) -- define clouds CLOUDS = { {x=40, y_base=10, amplitude=5, speed=0.05, offset=0}, -- cloud 1 {x=175, y_base=20, amplitude=3, speed=0.05, offset=1} -- cloud 2 } time = 0 -- suspects SUSPECTS = { {id=260,w=4,h=4}, {id=264,w=4,h=4}, {id=268,w=4,h=4}, {id=320,w=4,h=4}, {id=324,w=4,h=4}, {id=328,w=4,h=4}, {id=384,w=4,h=4}, {id=388,w=4,h=4} } current_suspect = 1 guilt, unrest = 0,0 max_bar = 3 phase = "intro" result_text = "" -- narrative data SUSPECTS_DATA = { { accusation = "Towne Champion: We cast her into the river,\nand she did rise and float upon the water.\nThat is proof sufficient!", condemn_truth = "Young maid did burn at the stake.\nYou were the one appointed to\nkindle the fire.", spare_truth = "Townfolk continue doing tests on her.\nThe townsfolk murmured of thy weakness..." }, { accusation = "Local astrologer: I saw this young mistress\nchuckle at how foolish and wicked\nthese witch trials are!", condemn_truth = "Thereof, town maids are scared to leave\ntheir houses and chuckle too hard.", spare_truth = "Astrologer rallies people, saying you\nare the Devil yourself\nand are not here to spare the town!" }, { accusation = "Mother of the accused: There is a big mark\non her face - a witch token!", condemn_truth = "You see young maid's own mother\nsmile as it happens.", spare_truth = "Everyone in town avoids young maid\nlike a plague. Townsfolk hold a protest\nrequiring thee leave the town." }, { accusation = "Local merchant: She doesnot return my\naffection, can you lend me your aid brotha?", condemn_truth = "Merchant is in shock: I JUST MEANT\nFRIGHTEN HER A LITTLE! WHAT HAVE YOU DONE?", spare_truth = "Merchant packs his bags\nand quits the town, great harm befalleth\nthe trade thereof.\nMany gents lose their labour." }, { accusation = "Host of the Taverne: She got red bloody haire.\nYou see it with thy own eyes, right?", condemn_truth = "All red-haired folk have fled the towne.\nIt is now full fraught with peril.", spare_truth = "Townsfolk deem thee witless.\nUnrest rises." }, { accusation = "Townsman: Yea, I saw her heal a childe\nwith herbales or somewhat of that kinde.\nI say to thee, she must be a witch!", condemn_truth = "The accused was stoned by\na raging multitude.\nThereafter the number of sick\nwithin the towne increased grievously.", spare_truth = "The accused goe on to heale the people.\nMore gents doubt thy authority." }, { accusation = "Local baker: I heard she quarreled with her\nhusband, who later fell from a horse\nand broke his bones.", condemn_truth = "You learn thereafter her husband\nwas always a terrible horseman.", spare_truth = "The townsfolk, in their fury, set her\nhouse aflame with their own hands.\nHer husband came to no harme." }, { accusation = "Local butcher: Your own daughter was found\nwith a book of spells! You have to do\nthe right thing.", condemn_truth = "Townsfolk are joyous, but you cannot begin\nto fathom your pain...", spare_truth = "Townsfolk accused you of partiality.\nBest keep one eye waked through the night..." } } -- executioner animations EXEC_FRAMES = {256, 332} exec_frame = 1 exec_anim_speed = 20 exec_anim_counter = 0 --draw character function draw_character(sx,sy,start_id) for row=0,3 do for col=0,3 do spr(start_id+col+row*16, sx+col*8,sy+row*8,0) end end end function draw_bars() -- guilt container rectb(10,20,8,24, 15) for i=1,guilt do rect(10,44-(i*8),8,8,6) end print("Guilt",2,8,6) -- unrest container rectb(222,20,8,24,15) for i=1,unrest do rect(222,44-(i*8),8,8,2) end print("Public\nUnrest",205,5,2) end function update_executioner() exec_anim_counter = exec_anim_counter + 1 if exec_anim_counter >= exec_anim_speed then exec_anim_counter = 0 exec_frame = exec_frame % #EXEC_FRAMES + 1 -- toggle frame end end function draw_cloud(x, y) local start_id = 64 for row = 0,3 do for col = 0,3 do local id = start_id + col + row*16 spr(id, x + col*8, y + row*8, 0) end end end function trigger_result(choice) local entry = SUSPECTS_DATA[((current_suspect-1) % #SUSPECTS_DATA)+1] if choice=="condemn" then result_text = entry.condemn_truth else result_text = entry.spare_truth end phase = "result" end function update_music() if phase == "menu" or phase == "intro" or phase == "over" then music(3, 0, -1, true) elseif phase == "game" then music(5, 0, -1, true) elseif phase == "result" then music(-1) else music(-1) end end function TIC() cls(0) -- music if phase ~= current_music_phase then current_music_phase = phase update_music() end if phase == "menu" then map(30, 0, 30, 17, 0, 0) print("WHICH IS WITCH?", 80, 30, 12) print("Press Z to start", 80, 100, 6) if btnp(4) then phase = "intro" end return end -- intro if phase=="intro" then print("The yeare of our Lord, 1645",45,20,12) print("In East Anglia thou are bid unto this towne",10,55,12) print("for a grave employ!",70,65,12) print("TO SAVE IT FROM FELL SHADOW OF WITCHCRAFT",10,80,12) print("How far art thou willing to go???",35,100,2) print("Press Z or X to begin",60,120,6) if btnp(4) or btnp(5) then phase="game" end return end -- game over if phase=="over" then print("GAME OVER",100,40,2) print(game_over_message, 43,60,12) print("Press Z to restart",80,110,6) if btnp(4) then guilt, unrest = 0,0 current_suspect = 1 phase="intro" game_over_message = nil end return end -- truth/result screen if phase=="result" then rect(20,50,200,60,0) print(result_text,20,60,12) print("Press Z to continue",60,110,6) if btnp(4) then phase="game" end return end -- check for last suspect local is_last = (current_suspect == #SUSPECTS) local change = is_last and 2 or 1 -- gameplay if phase=="game" then if btnp(5) then -- spare unrest = math.min(unrest+change,max_bar) guilt = math.max(guilt-change,0) trigger_result("spare") current_suspect = current_suspect + 1 end if btnp(4) then -- condemn guilt = math.min(guilt+change,max_bar) unrest = math.max(unrest-change,0) trigger_result("condemn") current_suspect = current_suspect +1 end if guilt >= max_bar then phase = "over" game_over_message = "Thou canst endure no more.\nWhat is this frenzie?\nThou depart the towne in disgrace\n-yet another hero shall soon arise\nto fill thy stead..." elseif unrest >= max_bar then phase = "over" game_over_message = "The townsfolk, weary by thy\npoor judgement, drive thee out with\nsticks and stones-yet another hero\nshall soon arise to fill thy stead..." elseif current_suspect > #SUSPECTS then phase = "over" game_over_message = "CONGRATULATIONS, OUR HERO.\nThou has delivered this towne.\nArt thou proud of thyself?\nWhere will thou journey next?" end end -- static map map(0,0,30,17,0,0) -- update time time = time + 1 -- draw clouds for i,cloud in ipairs(CLOUDS) do local y = cloud.y_base + math.sin(time*cloud.speed + cloud.offset)*cloud.amplitude draw_cloud(cloud.x, y) end -- executioner update_executioner() draw_character(56,48, EXEC_FRAMES[exec_frame]) -- executioner -- suspects if current_suspect >= 1 and current_suspect <= #SUSPECTS then local s = SUSPECTS[current_suspect] draw_character(152,48,s.id) end -- bars draw_bars() -- exposition + buttons local entry = SUSPECTS_DATA[((current_suspect-1) % #SUSPECTS_DATA)+1] rect(0,100,240,120,0) print(entry.accusation,0,100,12) rect(20,125,80,12,2) rect(140,125,80,12,6) print("Prosecute(Z)",30,128,0) print("Spare(X)",160,128,0) end