From d0b10b50a5d982dd4e7851d5ef0906be4f64fa47 Mon Sep 17 00:00:00 2001 From: bgobandit Date: Tue, 28 May 2019 01:55:40 -0400 Subject: [PATCH] Fixes Cards Against Spess and refreshes cards. (#44158) * Fixes CAS and refreshes cards. * fixes for loops, adds more cards * fixes bug, adjusts prices --- code/game/objects/items/toys.dm | 6 ++++++ code/modules/games/cas.dm | 16 ++++++---------- code/modules/vending/games.dm | 4 ++-- strings/cas_black.txt | 18 ++++++++++++------ strings/cas_white.txt | 32 ++++++++++++++++++++------------ 5 files changed, 46 insertions(+), 30 deletions(-) diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index f8ee7f8425f..a91f7194820 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -651,6 +651,9 @@ /obj/item/toy/cards/deck/Initialize() . = ..() + populate_deck() + +/obj/item/toy/cards/deck/proc/populate_deck() icon_state = "deck_[deckstyle]_full" for(var/i in 2 to 10) cards += "[i] of Hearts" @@ -677,6 +680,9 @@ //ATTACK HAND IGNORING PARENT RETURN VALUE //ATTACK HAND NOT CALLING PARENT /obj/item/toy/cards/deck/attack_hand(mob/user) + draw_card(user) + +/obj/item/toy/cards/deck/proc/draw_card(mob/user) if(isliving(user)) var/mob/living/L = user if(!(L.mobility_flags & MOBILITY_PICKUP)) diff --git a/code/modules/games/cas.dm b/code/modules/games/cas.dm index df47998cb2b..ff90ce9c8e1 100644 --- a/code/modules/games/cas.dm +++ b/code/modules/games/cas.dm @@ -31,18 +31,17 @@ decksize = 50 card_text_file = "strings/cas_black.txt" -/obj/item/toy/cards/deck/cas/Initialize() - . = ..() +/obj/item/toy/cards/deck/cas/populate_deck() var/static/list/cards_against_space = list("cas_white" = world.file2list("strings/cas_white.txt"),"cas_black" = world.file2list("strings/cas_black.txt")) allcards = cards_against_space[card_face] var/list/possiblecards = allcards.Copy() if(possiblecards.len < decksize) // sanity check decksize = (possiblecards.len - 1) var/list/randomcards = list() - while (randomcards.len < decksize) + for(var/x in 1 to decksize) randomcards += pick_n_take(possiblecards) - for(var/i=1 to randomcards.len) - var/cardtext = randomcards[i] + for(var/x in 1 to randomcards.len) + var/cardtext = randomcards[x] var/datum/playingcard/P P = new() P.name = "[cardtext]" @@ -50,7 +49,7 @@ cards += P if(!blanks) return - for(var/x=1 to blanks) + for(var/x in 1 to blanks) var/datum/playingcard/P P = new() P.name = "Blank Card" @@ -58,10 +57,7 @@ cards += P shuffle_inplace(cards) // distribute blank cards throughout deck -/obj/item/toy/cards/deck/cas/attack_hand(mob/user) - . = ..() - if(.) - return +/obj/item/toy/cards/deck/cas/draw_card(mob/user) if(isliving(user)) var/mob/living/L = user if(!(L.mobility_flags & MOBILITY_PICKUP)) diff --git a/code/modules/vending/games.dm b/code/modules/vending/games.dm index 7f8069e52df..f4f1b419f91 100644 --- a/code/modules/vending/games.dm +++ b/code/modules/vending/games.dm @@ -9,8 +9,8 @@ /obj/item/toy/cards/deck/cas/black = 3) contraband = list(/obj/item/dice/fudge = 9) refill_canister = /obj/item/vending_refill/games - default_price = 25 - extra_price = 50 + default_price = 10 + extra_price = 25 payment_department = ACCOUNT_SRV /obj/item/vending_refill/games diff --git a/strings/cas_black.txt b/strings/cas_black.txt index b63e33cdf21..734222d1fd1 100644 --- a/strings/cas_black.txt +++ b/strings/cas_black.txt @@ -1,13 +1,13 @@ Today, Security killed ____. Security, the clown's breaking into ____. -The Chaplain is worshiping the Church of _____. +Our last Chaplain believed in nothing but _____. What angered the gods this time? Why didn't engineering set up the singularity? What does the traitor steal this time? Cargo: There's a galaxy-wide shortage of _______. I don't care what they called me back on the station, I'm not a traitor. I'm a man of _________. The Syndicate is offering crew members _________ to defect. -Cargo ordered a crate full of _____. +What is Nanotrasen's highest-priority bounty? What is the gray tide protesting this time? If the Space Gods didn't want _________ they wouldn't have given us __________. Why was the death squad sent in? @@ -30,11 +30,10 @@ What made the nuclear operatives fluke? Why did the Chief Engineer disable comms? Every spaceman receives an internals box and ________. What brought the space orgy to a grinding halt? -Scientists are no longer allowed to make _____. +Scientists are no longer allowed to make ______. What was the clown's best joke? The HoP is now hiring assistants for __________. What happens when you emag an emag? -Our gang doesn't wear uniforms. Our gang wears ___________. No matter how many lizards you have, _____ is never acceptable. No, the AI's second law is NOT to serve _____. First CentCom came for the ________. Now they're coming for the __________. @@ -109,5 +108,12 @@ The auxiliary base was disabled after landing in the middle of _______. Xenobiologists have found slimes to be exceptionally responsive to _______. Why did the captain give me a medal? The curator's new exhibit is devoted solely to _________. -There's no ______ on the new escape shuttle, but there is plenty of _________! -What made me sell my soul to the devil? \ No newline at end of file +What made me sell my soul to the devil? +The engineers are testing an experimental supermatter setup involving _________. +I'm __________ in the streets, __________ in the sheets. +What's my family heirloom? +The Lawyer was fired for messaging the entire station a picture of ___________. +On Lavaland, it is rumored that ashwalkers roam, worshipping _________. +How did the traitor die a glorious death? +Nanotrasen's new state-of-the-art emergency shuttle was repurposed from _________ and _________. +What caused my brain trauma? \ No newline at end of file diff --git a/strings/cas_white.txt b/strings/cas_white.txt index 3a7f9456c95..b2e074ce40b 100644 --- a/strings/cas_white.txt +++ b/strings/cas_white.txt @@ -2,6 +2,7 @@ Those motherfucking carp. Having sex in the maintenance tunnels. Space 'Nam. Space lesbians. +Space NEETs. Space Hitler. Space Asshole. Ragin' mages. @@ -57,7 +58,6 @@ Defusing a syndicate bomb with another bomb. Going braindead mid-murder. A petsplosion. Meat spikes. -Collecting the crew's brains. Lopping off the Captain's johnson and shooting it out a pneumatic cannon. The secret monkey technique. Putting the pAI's doorjack where it don't belong. @@ -84,7 +84,6 @@ Paranoia. Putting the boots to him, medium style. ERP-seeking meteors. Paperwork HoPs. -A sexy clown. Rampant vending machines. The prisoner transfer center. Nations. @@ -186,7 +185,6 @@ A big, black shadowling dick. Emagging. Dead lizard storage. Dermal armor. -Energy balls. Fisting somebody until they gib. Alternate uses for defibrillator paddles. Breaking spacetime with thousands of bluespace tomatoes. @@ -197,7 +195,7 @@ Plasmaman strippers. A Quartermaster who WON'T STOP ordering guns. Space lag. Polishing the captain's laser rifle. -That one asshole double agent. +That one asshole nuke op. A surprise visit from Nanotrasen's CEO. The bleeding, dismembered, beautiful corpse of the clown. A glass of ...what? @@ -220,20 +218,18 @@ Welderbombing. Validhunting. Nar'Sie making love to Lord Singulo. Fun. -Crashing the stock market. HONK! -Enough morphine to put the entire station down. +Enough morphine to make the entire station comatose. A defective comdom. Cleanbot. A beaker of dried space carp penis. An Ian storm. -voxtest2. Nuking it from orbit. My senpAI. Harmbatonning. A Nanotrasen D-Notice. TALKING MIMES. -The lusty xenomorph maid, +The lusty xenomorph maid. Using assistants as human shields. Sentient securitrons. Piloting the station into the nearest sun. @@ -251,7 +247,7 @@ NAR'SIE HAS RISEN. Pierrot's Throat. A clown bomb. Space bees? -The entire engineering team having unprotected group sex. +Driving the clown car full speed into the engine. IC in OOC. The best cookie. The wizard with his staff inserted into his anus. @@ -276,9 +272,8 @@ Draconic. Riding borgs, cowgirl style. The Voice of God. Overpowered stuns. -Unironically reading library smut. +Unironically enjoying library smut. Spiritual journeys with BZ. -Freon. Deep-fried body parts. Suit sensor unit gas chambers. Moonlighting. @@ -293,4 +288,17 @@ A salt overdose. Mindswap. Potassium in the toilet bowls. Giving head to the heads. -A lizard wearing cat ears. \ No newline at end of file +A lizard wearing cat ears. +Precious clown gold. +Dabbing on a pile of corpses. +Tactical chairs. +The sweet, forbidden meat of the gondola. +Turning tricks for holocredits. +A captain that doesn't secure the disk. +A positive moodlet. +Hygiene. +The Oh Hi Mark shuttle. +The asteroid shuttle. +Razoring the wings off the moths. +Wiring the ethereals into the powernet. +Well-aged miasma. \ No newline at end of file