Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- admins = { Heniyengui = true }
- playersMax = 6 --This is the max of players who can join a game. (The number of chairs in the map)
- --Recommended: 6 Players. Maximum: 11 Players. Minimum: 3 Players.
- --Remember that if there are more than 6 persons PLAYING, there won't be Pick 2 cards nor Gambling.
- repeatCards = true -- If true, White Cards will repeat every round.
- -- So you may get the same card this round and the next rounds.
- -- If false, White Cards will repeat every new game. (This is like discarding them every round)
- -- Note: If there isn't enough White Cards and this is set to false the game will crash.
- -----------------------------------------------------------------------------------------------
- -- Green Cards are White Cards.
- greenCard={}--You can add new cards by following this: greenCard[number]="White Card Text Here"
- greenCard[1]="The hiccups."
- greenCard[2]="Suicidal thoughts."
- greenCard[3]="Gladiatorial combat."
- greenCard[4]="Stockholm syndrome."
- greenCard[5]="Insatiable bloodlust."
- greenCard[6]="Quiche."
- greenCard[7]="Leveling up."
- greenCard[8]="Genetically engineered super-soldiers."
- greenCard[9]="Fabricating statistics."
- greenCard[10]="Gandalf."
- greenCard[11]="Jean-Claude."
- greenCard[12]="Ashton Kutcher."
- greenCard[13]="The Fanta® girls."
- greenCard[14]="Shaft."
- greenCard[15]="Eating an albino."
- greenCard[16]="Neil Patrick Harris."
- greenCard[17]="A web of lies."
- greenCard[18]="Ripping into a man's chest and pulling out his still-beating heart."
- greenCard[19]="Cutting."
- greenCard[20]="The harsh light of day."
- greenCard[21]="Clams."
- greenCard[22]="NOOOOOOOOOO!!!"
- greenCard[23]="24-hour media coverage."
- greenCard[24]="The economy."
- greenCard[25]="A plunger to the face."
- greenCard[26]="A smiling black man, a latina businesswoman, a cool asian, and some whites."
- greenCard[27]="Words, words, words."
- greenCard[28]="Dorito breath."
- greenCard[29]="My machete."
- greenCard[30]="Space muffins."
- greenCard[31]="Media coverage."
- greenCard[32]="A beached whale."
- greenCard[33]="Slow motion."
- greenCard[34]="A passionate Latino lover."
- greenCard[35]="Clenched butt cheeks."
- greenCard[36]="Appreciative snapping."
- greenCard[37]="Historical revisionism."
- greenCard[38]="Mom."
- greenCard[39]="The four arms of Vishnu."
- greenCard[40]="Getting abducted by Peter Pan."
- greenCard[41]="Mad hacky-sack skills."
- greenCard[42]="Being a dinosaur."
- greenCard[43]="Statistically validated stereotypes."
- greenCard[44]="A rival dojo."
- greenCard[45]="George Clooney's musk."
- greenCard[46]="This guy"
- greenCard[47]="Pistol-whipping a hostage."
- greenCard[48]="Sudden Poop Explosion Disease."
- greenCard[49]="Bosnian chicken farmers."
- greenCard[50]="A fat bald man from the internet."
- greenCard[51]="One thousand Slim Jims."
- greenCard[52]="Moral ambiguity."
- greenCard[53]="Dancing with a broom."
- greenCard[54]="Medieval Times® Dinner & Tournament."
- greenCard[55]="The shambling corpse of Larry King."
- greenCard[56]="A nuanced critique."
- greenCard[57]="Hipsters."
- greenCard[58]="Jafar."
- greenCard[59]="An atomic wedgie."
- greenCard[60]="Good grammar."
- greenCard[61]="Ominous background music."
- greenCard[62]="Savagely beating a mascot."
- greenCard[63]="Santa Claus."
- greenCard[64]="Apologizing."
- greenCard[65]="Enormous Scandinavian women."
- greenCard[66]="A low standard of living."
- greenCard[67]="Being a busy adult with many important things to do."
- greenCard[68]="Finding a skeleton."
- greenCard[69]="Ryan Gosling riding in on a white horse."
- greenCard[70]="Free samples."
- greenCard[71]="Natural selection."
- greenCard[72]="Italians."
- greenCard[73]="The Jews."
- greenCard[74]="Finger painting."
- greenCard[75]="Puppies"
- greenCard[76]="A disappointing birthday party."
- greenCard[77]="Science."
- greenCard[78]="Poor people."
- greenCard[79]="College."
- greenCard[80]="A moment of silence."
- greenCard[81]="Racism."
- greenCard[82]="Ghosts."
- greenCard[83]="Bacteria."
- greenCard[84]="Flash flooding."
- greenCard[85]="Barack Obama."
- greenCard[86]="High school."
- greenCard[87]="Homeless people."
- greenCard[88]="Darth Vader."
- greenCard[89]="Bill Nye the Science Guy."
- greenCard[90]="The Force."
- greenCard[91]="The Big Bang."
- greenCard[92]="Dropping a chandelier on your enemies and riding the rope up."
- greenCard[93]="Chainsaws for hands."
- greenCard[94]="A really cool hat."
- greenCard[95]="World peace."
- greenCard[96]="A tiny horse."
- greenCard[97]="A time travel paradox."
- greenCard[98]="Pretending to care."
- greenCard[99]="Being on fire."
- greenCard[100]="Substitue teachers."
- greenCard[101]="Sunshine and rainbows."
- greenCard[102]="Men."
- greenCard[103]="BATMAN!!!"
- greenCard[104]="Friends who eat all the snacks."
- greenCard[105]="Being rich."
- greenCard[106]="Over-sized lollipops."
- greenCard[107]="Doing the right thing."
- greenCard[108]="Republicans."
- greenCard[109]="A balanced breakfast."
- greenCard[110]="Grandma."
- greenCard[111]="Global warming."
- greenCard[112]="Explosions."
- greenCard[113]="Goblins."
- greenCard[114]="Tiger Woods."
- greenCard[115]="Racially-biased SAT questions."
- greenCard[116]="Hurricane Katrina."
- greenCard[117]="Geese."
- greenCard[118]="Obesity."
- greenCard[119]="A bag of magic beans."
- greenCard[120]="Whips."
- greenCard[121]="Helping yourself."
- greenCard[122]="Big hair."
- greenCard[123]="Donald Trump."
- greenCard[124]="Hillary Clinton."
- greenCard[125]="Coming soon."
- greenCard[126]="Passion Fruit."
- greenCard[127]="Prescription Drugs."
- greenCard[128]="Crabs."
- greenCard[129]="Something frilly."
- greenCard[130]="Beating a dead shaman."
- greenCard[131]="Heavy breathing."
- greenCard[132]="shippings <3"
- greenCard[133]="A burning sensation in an awkward place."
- greenCard[134]="Something fishy."
- greenCard[135]="Evil laughter."
- greenCard[136]="A coming out party."
- greenCard[137]="The 1%"
- greenCard[138]="Love is love."
- greenCard[139]="One of those trashy show about redneck women."
- greenCard[140]="Farting in public."
- greenCard[141]="Sir Lancelot."
- greenCard[142]="Mario and Princess Peach."
- greenCard[143]="Sonic the hedgehog."
- greenCard[144]="Black Butler."
- greenCard[145]="Anime."
- greenCard[146]="Magic fingers."
- greenCard[147]="Sucking at everything."
- greenCard[148]="A bomb shell."
- greenCard[149]="The root of all evil."
- greenCard[150]="Long John Silvers."
- greenCard[151]="Oddly shaped feet."
- greenCard[152]="A cracker."
- greenCard[153]="Swearing in sign language."
- greenCard[154]="The death penalty."
- greenCard[155]="HUMP DAY!"
- greenCard[156]="Slip'n'Slides"
- greenCard[157]="Prom night."
- greenCard[158]="Tipping a port-a-potty with someone inside."
- greenCard[159]="Tongs."
- greenCard[160]="Im a queen."
- greenCard[161]="Human sacrafices."
- greenCard[162]="None of your business."
- greenCard[163]="Toys."
- greenCard[164]="Hot co workers."
- greenCard[165]="A ken doll."
- greenCard[166]="Being sent to the penalty box."
- greenCard[167]="The unspoken language of love."
- greenCard[168]="Angel wing tattoos."
- greenCard[169]="A jar of vaseline."
- greenCard[170]="A peeping tom."
- greenCard[171]="breaking wind."
- greenCard[172]="Death by chocolate."
- greenCard[173]="My hot neighbor."
- greenCard[174]="Donald Trump's hair."
- greenCard[175]="Black magic."
- greenCard[176]="A racist family member."
- greenCard[177]="Victoria's Secret."
- greenCard[178]="The crack of dawn."
- greenCard[179]="Night moves."
- greenCard[180]="An animatronic snowman."
- greenCard[181]="Kim Jong-un."
- greenCard[182]="Fishnets."
- greenCard[183]="Affirmative Action."
- greenCard[184]="Deciding to become a professional wrestler."
- greenCard[185]="Acid."
- greenCard[186]="World religions."
- greenCard[187]="Artificial intelligence."
- greenCard[188]="Low impact aerobics."
- greenCard[189]="A naughty girl."
- greenCard[190]="The homeless."
- greenCard[191]="Poking a hole."
- greenCard[192]="Hanky-panky."
- greenCard[193]="Men in uniform."
- greenCard[194]="squishy things."
- greenCard[195]="America's sweetheart."
- greenCard[196]="A load of BS."
- greenCard[197]="Missionary."
- greenCard[198]="A little crack."
- greenCard[199]="Something stiff."
- greenCard[200]="Cold hard cash."
- greenCard[201]="Faking it."
- greenCard[202]="Play the race card."
- greenCard[203]="Waxing."
- greenCard[204]="Karma."
- greenCard[205]="The love canal."
- greenCard[206]="Taking it the wrong way."
- greenCard[207]="Seven deadly sins."
- greenCard[208]="Tooting your own horn."
- greenCard[209]="Grandma's hair."
- greenCard[210]="A booger."
- greenCard[211]="Eating boogers."
- greenCard[212]="A used diaper I found on the side of the road."
- -- Purple Cards Are Black Cards.
- purpleCard={}--You can add new cards by following this: purpleCard[number]="Black Card Text Here"
- purpleCard[1]="My plan for world domination begins with _____."
- purpleCard[2]="I learned the hard way that you can't cheer up a grieving friend with _____."
- purpleCard[3]="The socialist governments of Scandinavia have declared that access to _____ is a basic human right."
- purpleCard[4]="What's the gift that keeps on giving? _____."
- purpleCard[5]="He who controls _____ controls the world."
- purpleCard[6]="The CIA now interrogates enemy agents by repeatedly subjecting them to _____."
- purpleCard[7]="Science will never explain the origin of _____."
- purpleCard[8]="Next season on Man vs, Wild, Bear Grylls must survive the depths of the Amazon with only _____ and his wits."
- purpleCard[9]="In the distant future, historians will agree that _____ marked the beginning of America's decline."
- purpleCard[10]="When I pooped, what came out of my butt? _____."
- purpleCard[11]="In Rome, there are whisperings that the Vatican has a secret room devoted to _____."
- purpleCard[12]="And I would have gotten away with it, too, if it hadn't been for _____"
- purpleCard[13]="In his new self-produced album, Kanye West raps over the sounds of _____."
- purpleCard[14]="In its new tourism campaign, Detroit proudly proclaims that it has finally eliminated _____."
- purpleCard[15]="If I could have a secret power, I would have _____."
- purpleCard[16]="TSA guidelines now prohibit _____ on airplanes."
- purpleCard[17]="What would grandma find disturbing, yet oddly charming? _____"
- purpleCard[18]="I'm sorry, Professor, but I couldn't complete my homework because of _____."
- purpleCard[19]="Life was difficult for cavemen before _____."
- purpleCard[20]="What gets better with age? _____"
- purpleCard[21]="_____? There's an app for that."
- purpleCard[22]="When I am a billionare, I shall erect a 50-foot statue to commemorate _____."
- purpleCard[23]="What don't you want to find in your Chinese food? _____"
- purpleCard[24]="It's a pity that kids these days are all getting involved with _____."
- purpleCard[25]="Anthropologists have recently discovered a primitive tribe that worships _____."
- purpleCard[26]="When I am the President of the United States, I will create the Department of _____."
- purpleCard[27]="The class field trip was completely ruined by _____."
- purpleCard[28]="In 1,000 years, when paper money is but a distant memory, _____ will be our currency."
- purpleCard[29]="_____. It's a trap"
- purpleCard[30]="What's there a ton of in heaven? _____"
- purpleCard[31]="What will I bring back in time to convince people that I am a powerful wizard? _____"
- purpleCard[32]="_____: kid-tested, mother-approved."
- purpleCard[33]="When Pharaoh remained unmoved, Moses called down a plague of _____."
- purpleCard[34]="______ should be grounds for a national holiday."
- purpleCard[35]="Apply this medication three times a day to reduce _______."
- purpleCard[36]="Oddly enough, I've developed a taste for _______"
- purpleCard[37]="In my life, theres always room for more _____"
- purpleCard[38]="All you need is ____"
- purpleCard[39]="I'd love to celebrate valentines day with ____"
- purpleCard[40]="If I could take something to a deserted island, I would take ___"
- purpleCard[41]="You know what annoys me? ____"
- purpleCard[42]="I use ____ in a way that would make you blush"
- purpleCard[43]="I used to get in trouble for playing with ____"
- purpleCard[44]="This place smells like ____"
- purpleCard[45]="I may forget a name, I may forget a face, but I will never forget ___"
- purpleCard[46]="according to the doctor I have a problem with ___"
- purpleCard[47]="What do I want for my birthday? My birthday suit and ___'"
- purpleCard[48]="I can't be friends with people who are interested in ____"
- purpleCard[49]="What do I rub for good luck?"
- purpleCard[50]="____ will make anyone seem more attractive"
- purpleCard[51]="When I roleplay I like to pretend I'm ____"
- purpleCard[52]="My guidance counselor told me I should focus on ____ as a career choice"
- purpleCard[53]="Am I the only one who hates ____"
- purpleCard[54]="My ex broke up with me because of my fondness for ____"
- purpleCard[55]="Everyone thinks im all about ___ and for the most part they're right"
- purpleCard[56]="What do you not want to find on your pizza?"
- ---------------------------------------------------------------------------------------------------------------------------
- pick2Cards = {}
- pick2Cards[1]="I had a terrible nightmare about _____ and _____."
- pick2Cards[2]="We go together like _____ and _____."
- pick2Cards[3]="If I were a mad scientist, I would try to combine _____ and _____"
- pick2Cards[4]="Nothing is certain except _____ and _____"
- pick2Cards[5]="_____ would be woefully incomplete without _____."
- pick2Cards[6]="An international tribunal has found _____ guilty of _____."
- pick2Cards[7]="And the Academy Award for _____ goes to _____."
- pick2Cards[8]="I never truly understood _____ until I encountered _____."
- pick2Cards[9]="Dear Sir or Madam, We regret to inform you that the office of _____ has denied your request for _____."
- pick2Cards[10]="I spent my whole life working toward _____, only to have it ruined by _____."
- pick2Cards[11]="You haven't truly lived until you've experienced _____ and _____ at the same time."
- ---------------------------------------------------------------------------------------------------------------------------
- blackCardColor = 0x000000
- whiteCardColor = 0xFFFFFF
- move = false
- themaps = { [1] = { bg = "x_transformice/x_maps/x_peche2014/x_temple.jpg" , color = "67675F" , color2 = "AEBDA6" } ,
- [2] = { bg = "x_transformice/x_maps/x_peche2015/map-aventure-1.jpg" , color = "6598" , color2 = "5b91df" } ,
- [3] = { bg = "x_transformice/x_maps/x_papaques_2015/map2.jpg,0,-150" , color = "24ACA6" , color2 = "5FEFF8" } ,
- [4] = { bg = "x_bouboum/x_fond/x_f5.jpg" , color = "BA8973" , color2 = "DAB684" } ,
- [5] = { bg = "x_transformice/x_maps/x_halloween2015/eclairs.jpg" , color = "1C3934" , color2 = "264740" } ,
- [6] = { bg = "x_transformice/x_maps/x_papaques_2015/map1.jpg,0,-250" , color = "591F2D" , color2 = "DC4D64" } ,
- [7] = { bg = "x_transformice/x_maps/x_peche2014/x_nuages.jpg" , color = "33" , color2 = "52057" } ,
- [8] = { bg = "x_transformice/x_maps/x_rentree2015/map-proviseur.jpg,0,-55" , color = "743F24" , color2 = "AE663B" } ,
- }
- ----------------------------------------------------------------------------------------------------------------------------
- greencard={}
- purplecard={}
- tfm.exec.disableAutoNewGame(true)
- tfm.exec.disableAfkDeath(true)
- tfm.exec.disableAutoShaman(true)
- tfm.exec.disableAutoScore(true)
- tfm.exec.disableAutoTimeLeft(true)
- players = {}
- t = 0
- ban = {}
- getplace = {}
- pTime = 32
- newgame = 5
- for r = 1, #pick2Cards do
- purpleCard[#purpleCard + 1] = "PICK2"
- end
- if playersMax > 11 then
- playersMax = 11
- end
- if playersMax < 3 then
- playersMax = 3
- end
- function invert(t,v)
- for k,value in pairs(t) do
- if value==v then
- return k
- end
- end
- return nil
- end
- function banPlayer()
- for name in pairs(tfm.get.room.playerList) do
- if ban[name] then
- tfm.exec.killPlayer(name)
- for f = 500, 1500 do
- ui.removeTextArea(f , name)
- end
- end
- end
- end
- function firstToUpper(str)
- return (str:gsub("^%l", string.upper))
- end
- function eventNewPlayer(name)
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>Welcome to Cards Against Mice!</b></font></p>", name, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- for w = 1, #Pos do
- if Pos[w].taken then
- if Player[w] ~= nil then
- ui.addTextArea(19 + w, "<p align = 'center'><font size='10'><b>"..Player[w].."</b></font></p>", name, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
- else
- ui.addTextArea(19 + w, "<p align = 'center'><font size='10' color='#ff0000' ><b>"..Judger.."</b></font></p>", name, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
- end
- else
- if sTime <= 30 or ( getplace[w] and not start2 ) then
- ui.addTextArea(19 + w, "<p align = 'center'><font size='10'><b>[Space]</b></font></p>", name, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
- end
- end
- end
- if sTime == 31 then
- if pick2 then
- ui.addTextArea(1,"<p align='justify'><b><font size='11' color='#ffffff'>"..pick2Cards[cardn].."</font></b></p>", name, 6, 143, 160, 96, blackCardColor, 0xFFFFFF, 1, move)
- ui.addTextArea(2, "<p align='center'><font color='#ffffff' size='12'><b>PICK 2</b></font></p>", name, 110, 224, 63, 20, 0x324650, 0x000001, 0, move)
- else
- ui.addTextArea(1,"<p align='justify'><b><font size='11' color='#ffffff'>"..purpleCard[carde].."</font></b></p>", name, 6, 143, 160, 96, blackCardColor, 0xFFFFFF, 1, move)
- end
- for a = 1, #Pos do
- local namee, yyy = Player[a], 0
- if namee ~= nil then
- if pick2 then
- if players[namee].pick2 == 1 then
- yyy = 0
- ui.addTextArea(ids[a][1] + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",name,players[namee].xx + 180 , yyy + 143,110,64, whiteCardColor, 0x000000, 1, move)
- elseif players[namee].pick2 == 2 then
- yyy = 75
- ui.addTextArea(ids[a][2] + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",name,players[namee].xx + 180 , yyy + 143,110,64, whiteCardColor, 0x000000, 1, move)
- end
- else
- for k, v in pairs(ids[a]) do
- ui.addTextArea(ids[a][k] + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",name,players[namee].xx[k] + 180 , players[namee].yy[k] + 143,110,64, whiteCardColor, 0x000000, 1, move)
- end
- end
- end
- end
- if start2 then
- for a = 1, #Pos do
- if Player[a] ~= nil then
- if pick2 then
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",name)
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",name)
- else
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",name)
- if players[Player[a]].gamble then
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",name)
- end
- end
- end
- end
- end
- else
- ui.addTextArea(1, "<p align = 'justify'><b><font size='14' face='impact' color='#ffffff'>♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦</font></b></p>", name, 6, 143, 160, 96, blackCardColor, 0xFFFFFF, 1, move)
- ui.addTextArea(2, "<p align = 'center'><b><font size='19' face='impact' color='#ffffff'>Black Card</font></b></p>", name, 28, 177, 110, 30, blackCardColor, 0x000001, 1, move)
- end
- tfm.exec.bindKeyboard(name,32,true,true)
- banPlayer()
- t = t + 1
- players[name] = { vote = 0 , score = 0, gamble = false, xx = {} , yy={} }
- if not ban[name] then
- tfm.exec.respawnPlayer(name)
- end
- tfm.exec.setPlayerScore(name,0,false)
- ui.addPopup(0,0,"<p align = 'center'><font size='50' face='Agency FB'><b>Cards Against Mice</b></font></p><font size='20' color='#CC0000'><b>About it</b></font><font size='13'>\nCards Against Mice is an unofficial module. The game is supposed to be a cleaner version of the popular card game Cards Against Humanity. The purpose of the game is to get the most points by playing the card that the judger will think is the funniest! Every round, someone new will be the judger. The judger will play a black card randomly, and everyone else must submit a white card. The judger will not know whos card is which until he/she picks the one they like the best. There are currently "..#purpleCard.." Black Cards and "..#greenCard.." White Cards.</font>\n<font size='20' color='#CC0000'><b>Commands</b></font>\n<font size='13'><b>Type !commands to see the list of commands.</b>\n<font size='20' color='#CC0000'><b>Credits</b></font>\n<font size='15'>Created By <b>Heniyengui</b></font>\nThanks to forum members for helping.</font>",name,50,20,700,true)
- if t == 3 and not finish then
- chosen2 = true
- newgame2 = 0
- end
- if t >= 3 and i < 2 and sTime == 31 then
- chosen2 = true
- newgame2 = 0
- end
- end
- function deepCopy(object)
- local lookup_table = {}
- local function _copy(object)
- if type(object) ~= "table" then
- return object
- elseif lookup_table[object] then
- return lookup_table[object]
- end
- local new_table = {}
- lookup_table[object] = new_table
- for index, value in pairs(object) do
- new_table[_copy(index)] = _copy(value)
- end
- return setmetatable(new_table, getmetatable(object))
- end
- return _copy(object)
- end
- map = deepCopy(themaps)
- c = 0
- function cardsText()
- greencard = deepCopy(greenCard)
- if finish then
- Judgee = {}
- cards = {}
- i=0
- c=0
- Pos = {}
- for w = 1,playersMax do
- getplace[w] = false
- Pos[w] = { x1 = -22 + math.floor(800/playersMax)*(w) - math.floor((800/playersMax)/2) , x2 = 22 + math.floor(800/playersMax)*(w) - math.floor((800/playersMax)/2) , taken = false }
- ui.addTextArea(19 + w, "<p align = 'center'><font size='10'><b>[Space]</b></font></p>", nil, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
- end
- countdown = 2
- sTime = 30
- Player = { }
- purplecard = deepCopy(purpleCard)
- purplecard[0] = ""
- pick2cards = deepCopy(pick2Cards)
- pick2cards[0] = ""
- round = 0
- maxr = 5
- for name in pairs(tfm.get.room.playerList) do
- players[name] = { vote = 0 , score = 0 , gamble = false , xx={} , yy={} }
- tfm.exec.setPlayerScore(name,0,false)
- players[name].score = 0
- end
- local h = 0
- for k, v in pairs(map) do
- if map[k].bg == nil then
- h = k
- end
- end
- if h == #themaps then
- map = deepCopy(themaps)
- end
- mapo = math.random(1 , #themaps)
- while map[mapo].bg == nil do
- mapo = math.random(1 , #themaps)
- end
- local str = ''
- for i = 1 , playersMax do
- str = str .. "<P C=\"757575\" Y=\"123\" T=\"19\" X=\"".. Pos[i].x1 + 22 .."\" P=\"0,0\" />"
- end
- map1 = "<C><P D=\""..map[mapo].bg.."\" /><Z><S><S L=\"800\" o=\""..map[mapo].color.."\" H=\"37\" X=\"400\" Y=\"118\" T=\"12\" P=\"0,0,0.3,0.2,0,0,0,0\" /><S P=\"0,0,0.3,0.2,0,0,0,0\" L=\"800\" o=\""..map[mapo].color.."\" X=\"400\" Y=\"382\" T=\"12\" H=\"37\" /><S P=\"0,0,0,9999,0,0,0,0\" L=\"10\" o=\"6598\" X=\"-5\" Y=\"200\" T=\"12\" H=\"420\" /><S L=\"800\" o=\"6598\" X=\"400\" H=\"10\" Y=\"-5\" T=\"12\" P=\"0,0,0.3,0.2,0,0,0,0\" /><S P=\"0,0,0,9999,0,0,0,0\" L=\"10\" o=\"6598\" H=\"420\" Y=\"200\" T=\"12\" X=\"805\" /><S P=\"0,0,0.3,0.2,0,0,0,0\" L=\"800\" o=\"6598\" H=\"10\" Y=\"405\" T=\"12\" X=\"400\" /><S P=\"0,0,0.3,0.2,0,0,0,0\" L=\"500\" o=\"6a7495\" X=\"-250\" N=\"\" c=\"4\" Y=\"200\" T=\"12\" H=\"450\" /><S H=\"500\" L=\"1500\" o=\"6a7495\" X=\"400\" N=\"\" c=\"4\" Y=\"-250\" T=\"12\" P=\"0,0,0.3,0.2,0,0,0,0\" /><S H=\"450\" L=\"500\" o=\"6a7495\" X=\"1050\" N=\"\" c=\"4\" Y=\"200\" T=\"12\" P=\"0,0,0.3,0.2,0,0,0,0\" /></S><D><P C=\""..map[mapo].color2.."\" Y=\"99\" T=\"34\" P=\"0,0\" X=\"0\" /><DS Y=\"84\" X=\"412\" />"..str.."</D><O /></Z></C>"
- tfm.exec.newGame(map1)
- map[mapo].bg = nil
- end
- end
- finish = true
- cardsText()
- function setJudger(name)
- Judger = name
- ui.addTextArea(0, "<p align = 'center'><font size='16' color='#ffffff'><b>"..name.." is the new judger.</b></font></p>", nil, 6, 368, 790, 50, 0x324650, 0x212f36, 0, move)
- local b = 0
- for f in pairs(tfm.get.room.playerList) do
- if players[f].vote == 1 then
- b = b + 1
- if b == i and not chosen and not chosen2 then
- for c = 1, #Pos do
- if Player[c] ~= nil then
- if pick2 then
- ui.updateTextArea(ids[c][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[c]][1].."</font></b></p>",nil)
- ui.updateTextArea(ids[c][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[c].."'>"..Idea[Player[c]][1].."\n\n\n\n\n\n</a></font></b></p>",name)
- ui.updateTextArea(ids[c][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[c]][2].."</font></b></p>",nil)
- ui.updateTextArea(ids[c][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[c].."'>"..Idea[Player[c]][2].."\n\n\n\n\n\n</a></font></b></p>",name)
- else
- ui.updateTextArea(ids[c][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[c]][1].."</font></b></p>",nil)
- ui.updateTextArea(ids[c][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[c].."'>"..Idea[Player[c]][1].."\n\n\n\n\n\n</a></font></b></p>",name)
- if players[Player[c]].gamble then
- ui.updateTextArea(ids[c][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[c]][2].."</font></b></p>",nil)
- ui.updateTextArea(ids[c][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[c].."'>"..Idea[Player[c]][2].."\n\n\n\n\n\n</a></font></b></p>",name)
- end
- end
- end
- end
- end
- end
- end
- if Player[Judger] ~= nil then
- Judgee[Judger] = true
- ui.addTextArea(19 + Player[name], "<p align = 'center'><font size='10' color='#ff0000' ><b>"..name.."</b></font></p>", nil, Pos[Player[name]].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
- c = Player[Judger]
- Player[Judger] = nil
- Player[c] = nil
- i = i - 1
- end
- end
- function eventNewGame()
- pick2 = false
- tfm.exec.setUIMapName("Cards Against Mice!")
- maxPlayers = 0
- if c ~= 0 then
- Player[c] = Judger
- Player[Judger] = c
- i = i + 1
- ui.addTextArea(19 + c, "<p align = 'center'><font size='10'><b>"..Player[c].."</b></font></p>", nil, Pos[c].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
- end
- banPlayer()
- if t >= 3 then
- round = round + 1
- if round == maxr then
- ui.addTextArea(3, "<font size='36' face='Agency FB' color='#000000'><b>Last Round</b></font>", nil, 20, 240, 240, 50, 0x324650, 0x000000, 0, move)
- sTime = 0
- else
- if round ~= 1 then
- sTime = 0
- ui.addTextArea(3, "<font size='36' face='Agency FB' color='#000000'><b>Round "..round.."</b></font>", nil, 30, 240, 240, 50, 0x324650, 0x000000, 0, move)
- else
- ui.addTextArea(1, "<p align = 'justify'><b><font size='14' face='impact' color='#ffffff'>♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦♦</font></b></p>", nil, 6, 143, 160, 96, blackCardColor, 0xFFFFFF, 1, move)
- ui.addTextArea(2, "<p align = 'center'><b><font size='19' face='impact' color='#ffffff'>Black Card</font></b></p>", nil, 28, 177, 110, 30, blackCardColor, 0x000001, 1, move)
- i = 0
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>Press space to have a seat. (Players : "..i..")</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- ui.addTextArea(3, "<font size='36' face='Agency FB' color='#000000'><b>Round "..round.."</b></font>", nil, 30, 240, 240, 50, 0x324650, 0x000000, 0, move)
- end
- end
- else
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>3 Mice required to play the game!</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- end
- xx = 0
- y = 0
- start = false
- start2 = false
- finish = false
- countdown = 2
- newround = 7
- ids = {}
- Judger = ""
- won = ""
- chosen = false
- chosen2 = false
- newgame2 = 13
- newgame = 5
- pTime = 32
- jTime = 32
- Idea = {}
- end
- for name in pairs(tfm.get.room.playerList) do
- eventNewPlayer(name)
- end
- function eventPlayerDied(name)
- if not ban[name] then
- tfm.exec.respawnPlayer(name)
- end
- end
- function eventPlayerWon(name)
- if not ban[name] then
- tfm.exec.respawnPlayer(name)
- end
- end
- function eventKeyboard(name, key, down, px, py)
- if key == 32 then
- for w = 1, #Pos do
- if px >= Pos[w].x1 and px <= Pos[w].x2 and Player[name] == nil and t >= 3 and not ban[name] and not Pos[w].taken then
- if getplace[w] and not start and not start2 then
- Player[w] = name
- Player[name] = w
- getplace[w] = false
- Pos[w].taken = true
- ui.addTextArea(19 + w, "<p align = 'center'><font size='10'><b>"..name.."</b></font></p>", nil, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
- i = i + 1
- Idea[Player[p]] = {}
- ids[p] = {}
- local x = 0
- for s = w + (4 * (w - 1) ) , 5 * w do
- if cards[s] ~= nil then
- ui.addTextArea(s + 50 ,"<p align='left'><b><font size='9' color='#000000'><a href='event:card"..s.."'>"..cards[s].."\n\n\n\n\n\n</a></font></b></p>",Player[w],x + 180 , 284,111,64, whiteCardColor, 0x000000, 1, move)
- x = x + 125
- end
- end
- end
- if Player[name] == nil and sTime <= 30 then
- i = i + 1
- Player[name] = w
- Player[w] = name
- Pos[w].taken = true
- ui.addTextArea(19 + w, "<p align = 'center'><font size='10'><b>"..name.."</b></font></p>", nil, Pos[w].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>Press space to have a seat. (Players : "..i..")</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- for e = 1,#Pos do
- if not Pos[e].taken then
- ui.removeTextArea(19 + e, name)
- end
- end
- end
- end
- end
- end
- end
- function eventChatCommand(name, message)
- if message == "restart" and admins[name] and not ban[name] then
- chosen2 = true
- newgame2 = 0
- end
- if message == "mods" then
- local mod = ""
- for playermod in pairs(tfm.get.room.playerList) do
- if admins[playermod] then
- mod = ""..mod..""..playermod..", "
- end
- end
- ui.addPopup(0,0,"<b><font size='20' color='#CB546B'>The admins are:</font>\n"..mod.."",name,100,50,600,true)
- end
- if message == "help" then
- ui.addPopup(0,0,"<p align = 'center'><font size='50' face='Agency FB'><b>Cards Against Mice</b></font></p><font size='20' color='#CC0000'><b>About it</b></font><font size='13'>\nCards Against Mice is an unofficial module. The game is supposed to be a cleaner version of the popular card game Cards Against Humanity. The purpose of the game is to get the most points by playing the card that the judger will think is the funniest! Every round, someone new will be the judger. The judger will play a black card randomly, and everyone else must submit a white card. The judger will not know whos card is which until he/she picks the one they like the best. There are currently "..#purpleCard.." Black Cards and "..#greenCard.." White Cards.</font>\n<font size='20' color='#CC0000'><b>Commands</b></font>\n<font size='13'><b>Type !commands to see the list of commands.</b>\n<font size='20' color='#CC0000'><b>Credits</b></font>\n<font size='15'>Created By <b>Heniyengui</b></font>\nThanks to forum members for helping.</font>",name,50,20,700,true)
- end
- if message == "commands" and not admins[name] then
- ui.addPopup(0,0,"<b><font size='20' color='#CB546B'>Commands:</font>\n<font size='15' color='#BABD2F'>» Keyboard commands</font>\n<font color='#e68d43'>Spacebar</font> to have a seat and play.\n<font size='15' color='#BABD2F'>» Normal commands</font>\n<font color='#e68d43'>!mods</font> to see the current admins in the room.\n<font color='#e68d43'>!clear</font> to clear all shaman objects.\n<font color='#e68d43'>!help</font> to see informations about the game.",name,100,50,600,true)
- end
- if message == "commands" and admins[name] then
- ui.addPopup(0,0,"<b><font size='20' color='#CB546B'>Commands:</font>\n<font size='15' color='#BABD2F'>» Keyboard commands</font>\n<font color='#e68d43'>Spacebar</font> to have a seat and play.\n<font size='15' color='#BABD2F'>» Admin commands</font>\n<font color='#e68d43'>!s</font> to become shaman.\n<font color='#e68d43'>!restart</font> to restart the game.\n<font color='#e68d43'>!ban username</font> to not let someone play.\n<font color='#e68d43'>!unban username</font> to unban someone if he got banned.\n<font color='#e68d43'>!admin username</font> to make someone admin.\n<font color='#e68d43'>!unadmin admin_name</font> to make an admin a normal player.\n<font color='#e68d43'>!setround number</font> to change the number of the next round.\n<font color='#e68d43'>!maxround number</font> to change the number of total rounds (Last round number).\n<font size='15' color='#BABD2F'>» Normal commands</font>\n<font color='#e68d43'>!mods</font> to see the current admins in the room.\n<font color='#e68d43'>!clear</font> to clear all shaman objects.\n<font color='#e68d43'>!help</font> to see informations about the game.",name,100,50,600,true)
- end
- local IDList = {}
- if message=="clear" and not ban[name] then
- for id, object in pairs(tfm.get.room.objectList) do
- table.insert(IDList, id)
- end
- for i, id in pairs(IDList) do
- tfm.exec.removeObject(id)
- end
- end
- if message == "s" and admins[name] and not ban[name] then
- tfm.exec.setShaman(name)
- end
- local message_args = {}
- for arg in message:gmatch("[^%s]+") do
- table.insert(message_args, arg)
- end
- if message_args[2] ~= nil then
- if message_args[1] == "ban" and admins[name] and not ban[name] then
- message_args[2] = firstToUpper(message_args[2])
- ban[message_args[2]] = true
- admins[message_args[2]] = false
- banPlayer()
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..message_args[2].." has been banned! :(</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- eventPlayerLeft(message_args[2])
- end
- if message_args[1] == "admin" and admins[name] and not ban[name] then
- message_args[2] = firstToUpper(message_args[2])
- ban[message_args[2]] = false
- admins[message_args[2]] = true
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..message_args[2].." is now a moderator!</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- end
- if message_args[1] == "unadmin" and admins[name] and not ban[name] then
- message_args[2] = firstToUpper(message_args[2])
- admins[message_args[2]] = false
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..message_args[2].." is no longer a moderator! :(</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- end
- if message_args[1] == "unban" and admins[name] and not ban[name] then
- t = t + 1
- message_args[2] = firstToUpper(message_args[2])
- ban[message_args[2]] = false
- tfm.exec.respawnPlayer(message_args[2])
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..message_args[2].." has been unbanned! :(</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- end
- if message_args[1] == "setround" and admins[name] and not ban[name] then
- local number
- for yy = 0, 200 do
- if tostring(yy) == message_args[2] then
- number = tonumber(message_args[2])
- if number > 0 and number <= maxr then
- round = number - 1
- end
- end
- end
- end
- if message_args[1] == "maxround" and admins[name] and not ban[name] then
- local number
- for yy = 0, 200 do
- if tostring(yy) == message_args[2] then
- number = tonumber(message_args[2])
- if number > round then
- maxr = number
- end
- end
- end
- end
- end
- end
- function startGame1()
- maxPlayers = i
- if i >= 3 then
- local count = 0
- for k , v in pairs(Judgee) do
- if Judgee[k] then
- count = count + 1
- end
- end
- if count == i then
- Judgee = {}
- end
- local j = 0
- local Judge = {}
- for name in pairs(tfm.get.room.playerList) do
- players[name].vote = 0
- players[name].pick2 = 0
- players[name].xx = {}
- players[name].yy = {}
- players[name].gamble = false
- if Player[name] ~= nil and name ~= Player[c] and not Judgee[name] and not ban[name] then
- j = j + 1
- Judge[j] = name
- end
- end
- Judger = Judge[math.random(1 , #Judge)]
- Judgee[Judger] = true
- c = Player[Judger]
- Player[Player[Judger]] = nil
- Player[Judger] = nil
- ui.addTextArea(19 + c, "<p align = 'center'><font size='10' color='#ff0000' ><b>"..Judger.."</b></font></p>", nil, Pos[c].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
- i = i - 1
- ui.addTextArea(0, "<p align = 'center'><font size='14' color='#ffffff'><b>"..Judger.." will be judging this round. Waiting for players to choose a White card.</b></font></p>", nil, 6, 370, 790, 50, 0x324650, 0x212f36, 0, move)
- cardn = 0
- carde = 0
- while purplecard[carde] == "" do
- carde = math.random(1,#purplecard)
- if purplecard[carde] == "PICK2" then
- if i <= 5 then
- pick2 = true
- while pick2cards[cardn] == "" do
- cardn = math.random(1, #pick2cards)
- end
- purplecard[carde] = pick2cards[cardn]
- else
- purplecard[carde] = ""
- end
- end
- end
- ui.addTextArea(1,"<p align='justify'><b><font size='11' color='#ffffff'>"..purplecard[carde].."</font></b></p>", nil, 6, 143, 160, 96, blackCardColor, 0xFFFFFF, 1, move)
- purplecard[carde] = ""
- if pick2 then
- pick2cards[cardn] = ""
- ui.addTextArea(2, "<p align='center'><font color='#ffffff' size='12'><b>PICK 2</b></font></p>", nil, 110, 224, 63, 20, 0x324650, 0x000001, 0, move)
- else
- ui.removeTextArea(2, nil)
- end
- for p = 1, #Pos do
- if Player[p] ~= nil then
- ui.addTextArea(4 + p, "<p align='center'><b><font size='11' color='#d3d3d3'>Gamble</font></b></p>", Player[p], 723, 371, 72, 21, 0x000000, 0xd3d3d3, 1, move)
- Idea[Player[p]] = {}
- ids[p] = {}
- local x = 0
- for s = p + (4 * (p - 1) ) , 5 * p do
- if cards[s] == nil then
- local n = math.random(1,#greencard)
- while greencard[n] == "" do
- n = math.random(1,#greencard)
- end
- cards[s] = greencard[n]
- x = 125 * (s - 5 * ( p - 1 ) - 1)
- ui.addTextArea(s + 50 ,"<p align='left'><b><font size='9' color='#000000'><a href='event:card"..s.."'>"..cards[s].."\n\n\n\n\n\n</a></font></b></p>",Player[p],x + 180 , 284,110,64, whiteCardColor, 0x000000, 1, move)
- greencard[n] = ""
- end
- end
- if not pick2 and i <= 5 and players[Player[p]].score > 0 then
- ui.addTextArea(4 + p, "<p align='center'><b><font size='11' color='#ffffff'><a href='event:gamble'>Gamble</a></font></b></p>", Player[p], 723, 371, 72, 21, 0x000000, 0xffffff, 1, move)
- end
- end
- if not Pos[p].taken then
- ui.removeTextArea(19 + p, nil)
- end
- end
- end
- end
- function eventTextAreaCallback(id, name, cb)
- if cb == "gamble" and Player[name] ~= nil and not players[name].gamble and not ban[name] then
- ui.addTextArea(4 + Player[name], "<p align='center'><b><font size='11' color='#d3d3d3'>Gamble</font></b></p>", Player[p], 723, 371, 72, 21, 0x000000, 0xd3d3d3, 1, move)
- players[name].gamble = true
- players[name].vote = players[name].vote - 1
- players[name].score = players[name].score - 1
- tfm.exec.setPlayerScore(name,-1,true)
- end
- if cb == "card"..(id - 50).."" and players[name].vote <= 0 and not ban[name] and Player[name] ~= nil then
- if pick2 then
- players[name].pick2 = players[name].pick2 + 1
- Idea[name][players[name].pick2] = cards[id - 50]
- ids[Player[name]][players[name].pick2] = id
- if players[name].pick2 == 1 then
- y = 0
- ui.addTextArea(id + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",nil,xx + 180 , y + 143,110,64, whiteCardColor, 0x000000, 1, move)
- players[name].xx = xx
- xx = xx + 125
- else
- y = 75
- ui.addTextArea(id + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",nil,players[name].xx + 180 , y + 143,110,64, whiteCardColor, 0x000000, 1, move)
- players[name].vote = players[name].vote + 1
- end
- cards[id-50] = nil
- else
- if not players[name].gamble or players[name].vote == -1 then
- Idea[name][1] = cards[id - 50]
- ids[Player[name]][1] = id
- players[name].xx[1] = xx
- players[name].yy[1] = y
- else
- Idea[name][2] = cards[id - 50]
- ids[Player[name]][2] = id
- players[name].xx[2] = xx
- players[name].yy[2] = y
- end
- ui.addTextArea(id + 500,"<p align='center'><b><font size='18' color='#000000'>White</font>\n<font size='25' color='#000000'>Card</font></b></p>",nil,xx + 180 , y + 143,110,64, whiteCardColor, 0x000000, 1, move)
- xx = xx + 125
- if xx == 625 then
- xx = 0
- y = 75
- end
- players[name].vote = players[name].vote + 1
- cards[id-50] = nil
- end
- local h = 0
- for name in pairs(tfm.get.room.playerList) do
- if players[name].vote == 1 then
- h = h + 1
- if h == i then
- for a = 1, #Pos do
- getplace[a] = false
- if Player[a] ~= nil then
- ui.addTextArea(4 + a, "<p align='center'><b><font size='11' color='#d3d3d3'>Gamble</font></b></p>", Player[a], 723, 371, 72, 21, 0x000000, 0xd3d3d3, 1, move)
- if pick2 then
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",nil)
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][1].."\n\n\n\n\n\n</a></font></b></p>",Judger)
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",nil)
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][2].."\n\n\n\n\n\n</a></font></b></p>",Judger)
- else
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",nil)
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][1].."\n\n\n\n\n\n</a></font></b></p>",Judger)
- if players[Player[a]].gamble then
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",nil)
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][2].."\n\n\n\n\n\n</a></font></b></p>",Judger)
- end
- end
- end
- end
- ui.addTextArea(0, "<p align = 'center'><font size='14' color='#ffffff'><b>All the players chose a White card. Waiting for "..Judger.." to choose the funniest one.</b></font></p>", nil, 6, 370, 790, 50, 0x324650, 0x212f36, 00, move)
- start2 = true
- start = true
- end
- end
- end
- ui.removeTextArea(id, nil)
- end
- if start2 then
- for winner in pairs(tfm.get.room.playerList) do
- if cb==winner and winner ~= Judger and name == Judger and not chosen and not chosen2 then
- start = false
- jTime = 32
- won = winner
- for a = 1, #Pos do
- if Player[a] ~= nil then
- if pick2 then
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].." -"..Player[a].."</font></b></p>",nil)
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].." -"..Player[a].."</font></b></p>",nil)
- else
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].." -"..Player[a].."</font></b></p>",nil)
- if players[Player[a]].gamble then
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].." -"..Player[a].."</font></b></p>",nil)
- end
- end
- end
- end
- if pick2 then
- ui.updateTextArea(ids[Player[winner]][1] + 500,"<p align='left'><b><font size='9' color='#ff0000'>"..Idea[winner][1].." -"..winner.."</font></b></p>",nil)
- ui.updateTextArea(ids[Player[winner]][2] + 500,"<p align='left'><b><font size='9' color='#ff0000'>"..Idea[winner][2].." -"..winner.."</font></b></p>",nil)
- tfm.exec.setPlayerScore(winner,2,true)
- players[winner].score = players[winner].score + 2
- else
- ui.updateTextArea(id,"<p align='left'><b><font size='9' color='#ff0000'>"..Idea[winner][invert(ids[Player[winner]],id - 500)].." -"..winner.."</font></b></p>",nil)
- tfm.exec.setPlayerScore(winner,1,true)
- players[winner].score = players[winner].score + 1
- for pn in pairs(tfm.get.room.playerList) do
- if players[pn].gamble then
- tfm.exec.setPlayerScore(winner,1,true)
- players[winner].score = players[winner].score + 1
- end
- end
- end
- if round == maxr then
- ui.addTextArea(0,"<p align = 'center'><font size='18' color='#ff0000'>"..winner.." won this round. And the full game winner is...</font></p>", nil, 6, 367, 790, 50, 0x324650, 0x212f36, 0, move)
- chosen2 = true
- else
- ui.addTextArea(0,"<p align = 'center'><font size='18' color='#ff0000'>"..winner.." Won. Starting new round...</font></p>", nil, 6, 367, 790, 50, 0x324650, 0x212f36, 0, move)
- chosen = true
- end
- end
- end
- end
- end
- function eventLoop()
- for name in pairs(tfm.get.room.playerList) do
- if ban[name] then
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>You have been banned! :(</b></font></p>", name, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- end
- end
- if t <= 2 then
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>3 Mice required to play the game!</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- end
- if i < 2 and sTime==31 then
- chosen2 = true
- newgame2 = 0
- end
- if sTime <= 30 then
- countdown = countdown - 1
- if countdown == 0 then
- countdown = 2
- sTime = sTime - 1
- ui.addTextArea(18,"<p align = 'center'><font size='14' color='#000000' face='Agency FB'><b>Game starts in\n<font size='40' color='#ff0000' face='Agency FB'><b>"..sTime.."</b></font></b></font></p>", nil, 28, 280, 100, 100, 0x324650, 0x212f36, 0, move)
- if sTime <= 0 then
- if i <= 2 then
- chosen2 = true
- newgame2 = 0
- end
- startGame1()
- sTime = 31
- pTime = 30
- ui.removeTextArea(18, nil)
- end
- end
- end
- if pTime <= 30 and not start2 then
- countdown = countdown - 1
- if countdown == 0 then
- countdown = 2
- ui.addTextArea(18,"<p align = 'center'><font size='14' color='#000000' face='Agency FB'><b>Picking cards ends in\n<font size='40' color='#ff0000' face='Agency FB'><b>"..pTime.."</b></font></b></font></p>", nil, 3, 280, 150, 100, 0x324650, 0x212f36, 0, move)
- pTime = pTime - 1
- if pTime <= 0 then
- pTime = 32
- for a = 1, #Pos do
- if getplace[a] then
- ui.removeTextArea(19 + a, nil)
- getplace[a] = false
- end
- if Player[a] ~= nil then
- ui.addTextArea(4 + a, "<p align='center'><b><font size='11' color='#d3d3d3'>Gamble</font></b></p>", Player[a], 723, 371, 72, 21, 0x000000, 0xd3d3d3, 1, move)
- if players[Player[a]].vote == 0 then
- getplace[a] = false
- for s = a + (4 * (a - 1) ) , 5 * a do
- ui.removeTextArea(s + 50 ,Player[a])
- end
- Player[Player[a]] = nil
- Player[a] = nil
- ui.removeTextArea(19 + a, nil)
- ui.removeTextArea(4 + a, nil)
- Pos[a].taken = false
- i = i - 1
- end
- end
- end
- for a = 1, #Pos do
- if Player[a] ~= nil then
- if pick2 then
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",nil)
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][1].."\n\n\n\n\n\n</a></font></b></p>",Judger)
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",nil)
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][2].."\n\n\n\n\n\n</a></font></b></p>",Judger)
- else
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][1].."</font></b></p>",nil)
- ui.updateTextArea(ids[a][1] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][1].."\n\n\n\n\n\n</a></font></b></p>",Judger)
- if players[Player[a]].gamble then
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'>"..Idea[Player[a]][2].."</font></b></p>",nil)
- ui.updateTextArea(ids[a][2] + 500,"<p align='left'><b><font size='9' color='#000000'><a href='event:"..Player[a].."'>"..Idea[Player[a]][2].."\n\n\n\n\n\n</a></font></b></p>",Judger)
- end
- end
- end
- end
- ui.addTextArea(0, "<p align = 'center'><font size='14' color='#ffffff'><b>All the players chose a White card. Waiting for "..Judger.." to choose the funniest one.</b></font></p>", nil, 6, 370, 790, 50, 0x324650, 0x212f36, 00, move)
- start2 = true
- start = true
- end
- end
- end
- if start and sTime == 31 then
- countdown = countdown - 1
- if countdown == 0 then
- jTime = jTime - 1
- countdown = 2
- ui.addTextArea(18,"<p align = 'center'><font size='14' color='#000000' face='Agency FB'><b>Judger must pick a card before\n<font size='40' color='#ff0000' face='Agency FB'><b>"..jTime.."</b></font></b></font></p>", nil, 3, 280, 180, 100, 0x324650, 0x212f36, 0, move)
- if jTime <= 0 then
- Judgee[Judger] = false
- local count = 0
- for k , v in pairs(Judgee) do
- if Judgee[k] then
- count = count + 1
- end
- end
- if count == i then
- Judgee = {}
- end
- local Judge = {}
- jTime = 32
- j = 0
- ui.removeTextArea(19 + c, nil)
- c = 0
- for name in pairs(tfm.get.room.playerList) do
- if not ban[name] and Player[name] ~= nil and name ~= Judger and not Judgee[name] then
- j = j + 1
- Judge[j] = name
- end
- end
- setJudger(Judge[math.random(1 , #Judge)])
- end
- end
- end
- if chosen then
- countdown = countdown - 1
- if countdown == 0 then
- newround = newround - 1
- ui.addTextArea(0,"<p align = 'center'><font size='18' color='#ff0000'>"..won.." Won. Starting new round in "..newround.."</font></p>", nil, 6, 367, 790, 50, 0x324650, 0x212f36, 0, move)
- countdown = 2
- end
- if newround <= 0 then
- for f = 500, 1500 do
- ui.removeTextArea(f , nil)
- end
- eventNewGame()
- if repeatCards then
- cardsText()
- end
- end
- end
- if chosen2 then
- countdown = countdown - 1
- if countdown == 0 then
- newgame = newgame - 1
- newgame2 = newgame2 - 1
- countdown = 2
- end
- if newgame <= 0 then
- winners = {}
- local key = -math.huge
- local d = 0
- for name in pairs(tfm.get.room.playerList) do
- if players[name].score > key then
- key = players[name].score
- end
- end
- for name in pairs(tfm.get.room.playerList) do
- if players[name].score == key then
- d = d + 1
- winners[d] = name
- end
- end
- local wintext = ""
- for j = 1, #winners do
- wintext = ""..wintext..""..winners[j]..", "
- ui.addTextArea(0,"<p align = 'center'><font size='16' color='#ff0000'><b> "..wintext.." </b></font>\n<font size='11' color='#ffffff'>Starting new game in "..newgame2.."</font></p>", nil, 6, 361, 790, 50, 0x324650, 0x212f36, 0, move)
- end
- end
- if newgame2 <= 0 then
- for f = 0, 1500 do
- ui.removeTextArea(f , nil)
- end
- finish = true
- cardsText()
- end
- end
- end
- function eventPlayerLeft(name)
- t = t - 1
- if not ban[name] then
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..name.." has left! :(</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- else
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..name.." has been banned! :(</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- end
- if name == Judger then
- Judgee[Judger] = false
- if sTime == 31 and i >= 2 and not chosen and not chosen2 then
- jTime = 30
- local count = 0
- for k , v in pairs(Judgee) do
- if Judgee[k] then
- count = count + 1
- end
- end
- if count == i then
- Judgee = {}
- end
- while Judger == name do
- local Judge = {}
- j = 0
- for pname in pairs(tfm.get.room.playerList) do
- if not ban[pname] and Player[pname] ~= nil and pname ~= Judger and not Judgee[pname] then
- j = j + 1
- Judge[j] = pname
- end
- end
- setJudger(Judge[math.random(1 , #Judge)])
- end
- end
- if ban[name] then
- ui.addTextArea(0, "<p align = 'center'><font size='14' color='#ffffff'><b>"..name.." has been banned! "..Judger.." is the new judger.</b></font></p>", nil, 6, 370, 790, 50, 0x324650, 0x212f36, 0, move)
- else
- ui.addTextArea(0, "<p align = 'center'><font size='14' color='#ffffff'><b>"..name.." has left! "..Judger.." is the new judger.</b></font></p>", nil, 6, 370, 790, 50, 0x324650, 0x212f36, 0, move)
- end
- end
- for q = 1 , #Pos do
- if Player[q] == name then
- Pos[q].taken = false
- ui.removeTextArea(29+q, nil)
- i = i - 1
- if players[name].vote == 0 then
- if sTime == 31 then
- getplace[q] = true
- ui.addTextArea(19 + q, "<p align = 'center'><font size='10'><b>[Space]</b></font></p>", nil, Pos[q].x1 - 27, 102, 100, 50, 0x324650, 0x212f36, 0, move)
- if not ban[name] then
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..name.." has left! :( You can replace him.</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- else
- ui.addTextArea(0, "<p align = 'center'><font size='19' color='#ffffff'><b>"..name.." has been banned! :( You can replace him.</b></font></p>", nil, 6, 366, 790, 50, 0x324650, 0x212f36, 0, move)
- end
- end
- end
- Player[q] = nil
- Player[name] = nil
- end
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement