diff --git a/code/game/objects/effects/spawners/lootdrop.dm b/code/game/objects/effects/spawners/lootdrop.dm index f3d7bfd2ec0..69944dd78c6 100644 --- a/code/game/objects/effects/spawners/lootdrop.dm +++ b/code/game/objects/effects/spawners/lootdrop.dm @@ -132,6 +132,7 @@ /obj/item/storage/bag/plasticbag = 20, /obj/item/storage/wallet = 20, /obj/item/storage/wallet/random = 5, + /obj/item/scratch = 10, /obj/item/caution = 10, /obj/item/mod/construction/broken_core = 4, /obj/effect/spawner/random_spawners/mod/maint = 10, diff --git a/code/game/objects/items/scratch_card.dm b/code/game/objects/items/scratch_card.dm new file mode 100644 index 00000000000..2a6f372fe7d --- /dev/null +++ b/code/game/objects/items/scratch_card.dm @@ -0,0 +1,50 @@ +/obj/item/scratch + name = "scratch card" + desc = "Scratch this with a card or coin to discover if you are the winner!" + icon = 'icons/obj/economy.dmi' + icon_state = "scard" + w_class = WEIGHT_CLASS_TINY + /// Has this been scratched yet? + var/scratched = FALSE + /// The prob chance for it to be the winner card + var/winning_chance = 1 + /// Is this the winner card? + var/winner = FALSE + +/obj/item/scratch/attackby(obj/item/I, mob/user, params) + . = ..() + if(scratched) + return + if(!(istype(I, /obj/item/card) || istype(I, /obj/item/coin))) // We scratch with cards or coins! + return + + if(prob(winning_chance)) + to_chat(user, "Congratulations! Redeem your prize at the nearest ATM!") + icon_state = "scard_winner" + winner = TRUE + else + to_chat(user, "Good luck next time.") + icon_state = "scard_loser" + playsound(user, 'sound/items/scratching.ogg', 25, TRUE) + scratched = TRUE + update_icon_state() + +/obj/item/scratch/attack_obj(obj/O, mob/living/user, params) + if(winner && istype(O, /obj/machinery/economy/atm)) + playsound(user, 'sound/machines/ping.ogg', 50, TRUE) + O.atom_say("Congratulations for winning the lottery!") + var/obj/item/reward = new /obj/item/stack/spacecash/c1000 + qdel(src) + user.put_in_hands(reward) + return + ..() + +/obj/item/storage/box/scratch_cards + name = "scratch cards box" + desc = "Try your luck with five scratch cards!" + w_class = WEIGHT_CLASS_SMALL + can_hold = list(/obj/item/scratch) + +/obj/item/storage/box/scratch_cards/populate_contents() + for(var/i in 1 to 5) + new /obj/item/scratch(src) diff --git a/code/game/objects/mail.dm b/code/game/objects/mail.dm index 254620415c0..10937972e55 100644 --- a/code/game/objects/mail.dm +++ b/code/game/objects/mail.dm @@ -65,7 +65,8 @@ /obj/item/grenade/barrier/dropwall, /obj/item/toy/figure/crew/detective, /obj/item/toy/figure/crew/hos, - /obj/item/toy/figure/crew/secofficer) + /obj/item/toy/figure/crew/secofficer, + /obj/item/storage/box/scratch_cards) job_list = list("Head of Security", "Security Officer", "Detective", "Warden") /obj/item/envelope/science @@ -82,8 +83,9 @@ /obj/item/toy/figure/crew/geneticist, /obj/item/toy/figure/crew/rd, /obj/item/toy/figure/crew/roboticist, - /obj/item/toy/figure/crew/scientist) - job_list = list("Research Director", "Roboticist", "Geneticist", "Scientist") + /obj/item/toy/figure/crew/scientist, + /obj/item/storage/box/scratch_cards) + job_list = list("Research Director", "Roboticist", "Geneticist", "Scientist") /obj/item/envelope/supply icon_state = "mail_sup" @@ -97,7 +99,8 @@ /obj/item/stack/wrapping_paper, /obj/item/toy/figure/crew/cargotech, /obj/item/toy/figure/crew/qm, - /obj/item/toy/figure/crew/miner) + /obj/item/toy/figure/crew/miner, + /obj/item/storage/box/scratch_cards) job_list = list("Quartermaster", "Cargo Technician", "Shaft Miner") /obj/item/envelope/medical @@ -114,7 +117,8 @@ /obj/item/toy/figure/crew/chemist, /obj/item/toy/figure/crew/geneticist, /obj/item/toy/figure/crew/md, - /obj/item/toy/figure/crew/virologist) + /obj/item/toy/figure/crew/virologist, + /obj/item/storage/box/scratch_cards) job_list = list("Chief Medical Officer", "Medical Doctor", "Coroner", "Chemist", "Virologist", "Psychiatrist", "Paramedic") /obj/item/envelope/engineering @@ -129,7 +133,8 @@ /obj/item/grenade/gas/oxygen, /obj/item/toy/figure/crew/atmos, /obj/item/toy/figure/crew/ce, - /obj/item/toy/figure/crew/engineer) + /obj/item/toy/figure/crew/engineer, + /obj/item/storage/box/scratch_cards) job_list = list("Chief Engineer", "Station Engineer", "Life Support Specialist") /obj/item/envelope/bread @@ -146,7 +151,8 @@ /obj/item/toy/figure/crew/botanist, /obj/item/toy/figure/crew/chef, /obj/item/toy/figure/crew/janitor, - /obj/item/toy/figure/crew/librarian) + /obj/item/toy/figure/crew/librarian, + /obj/item/storage/box/scratch_cards) job_list = list("Bartender", "Chef", "Botanist", "Janitor", "Barber", "Librarian", "Barber") /obj/item/envelope/circuses @@ -162,7 +168,8 @@ /obj/item/toy/figure/crew/clown, /obj/item/toy/figure/crew/hop, /obj/item/toy/figure/crew/chaplain, - /obj/item/toy/figure/crew/mime) + /obj/item/toy/figure/crew/mime, + /obj/item/storage/box/scratch_cards) job_list = list("Clown", "Mime", "Head of Personnel", "Chaplain") @@ -178,7 +185,8 @@ /obj/item/clothing/head/collectable/petehat, /obj/item/toy/figure/crew/captain, /obj/item/toy/figure/crew/lawyer, - /obj/item/toy/figure/crew/dsquad) + /obj/item/toy/figure/crew/dsquad, + /obj/item/storage/box/scratch_cards) job_list = list("Captain", "Magistrate", "Nanotrasen Representative", "Blueshield", "Internal Affairs Agent") /obj/item/envelope/misc @@ -192,7 +200,8 @@ /obj/item/clothing/head/cakehat, /obj/item/toy/figure/crew/assistant, /obj/item/toy/figure/owl, - /obj/item/toy/figure/griffin) + /obj/item/toy/figure/griffin, + /obj/item/storage/box/scratch_cards) job_list = list("Assistant", "Explorer") diff --git a/code/modules/economy/merch_items.dm b/code/modules/economy/merch_items.dm index 7273cd9cb1f..1951ab3cd0d 100644 --- a/code/modules/economy/merch_items.dm +++ b/code/modules/economy/merch_items.dm @@ -40,6 +40,13 @@ cost = 100 category = MERCH_CAT_TOY +/datum/merch_item/scratch_card + name = "Scratch Cards Box" + desc = "Contains 5 scratch cards. Become rich today!" + typepath = /obj/item/storage/box/scratch_cards + cost = 100 + category = MERCH_CAT_TOY + /datum/merch_item/nanomob_booster name = "Nano-Mob Hunter Trading Card Booster Pack" desc = "Contains 6 random Nano-Mob Hunter Trading Cards. May contain a holographic card!" diff --git a/icons/obj/economy.dmi b/icons/obj/economy.dmi index 4afae1bf129..06a2a97e883 100644 Binary files a/icons/obj/economy.dmi and b/icons/obj/economy.dmi differ diff --git a/paradise.dme b/paradise.dme index c8915258baa..805bd67a0a3 100644 --- a/paradise.dme +++ b/paradise.dme @@ -955,6 +955,7 @@ #include "code\game\objects\items\latexballoon.dm" #include "code\game\objects\items\mixing_bowl.dm" #include "code\game\objects\items\random_items.dm" +#include "code\game\objects\items\scratch_card.dm" #include "code\game\objects\items\shooting_range.dm" #include "code\game\objects\items\sport.dm" #include "code\game\objects\items\theft_items.dm" diff --git a/sound/items/scratching.ogg b/sound/items/scratching.ogg new file mode 100644 index 00000000000..762d39c47cb Binary files /dev/null and b/sound/items/scratching.ogg differ