Unlucky trait (#18463)

* this compiles

* more edits

* Upports OP21's immovable rod

Makes it NOT shit.

* actually enable this lol

* CLANG

* we all fall down

* break it

* stairs

* bye async

* makes doorcrushes less lethal

* more unluck!

* dice and stumble vore

* major version

* Update clang.dm

* More tweaks. BS Cracker

Makes bluespace cracker better code quality too

* Cut down on lists here

* Adds the traits

* glass shapnel

* Update unlucky.dm

* Modular Shock

* Charger and thrown

* Defib nat 1

* Gravity Falls

* gibby

* no longer gib, just hurt a LOT

* Better Washer

* Update washing_machine.dm

* Even less jank

* Moves some stuff around

* linters

* Update unlucky.dm

* Table stubbing

* fixes mirror break, evil only

* PIPEBOMB

* Update negative.dm

* Update mail.dm

* glasses fly off your face if you fall

* Update unlucky.dm

* evil beaker and spooky events in the dark

* Evil beaker spilling

* Unlucky people have custom maint loot

* Get sick while searching

* Update _lootable.dm

* whoop

* Update _lootable.dm

* washer will always wash

* Lowered to 5

* ash

* Update areas.dm

* get knocked

* picking up items

* Dice

* Update unlucky.dm

* Update code/game/objects/items/devices/defib.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/modules/economy/vending.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/game/area/areas.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/datums/components/traits/unlucky.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/datums/components/traits/unlucky.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/datums/components/traits/unlucky.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Update code/datums/components/traits/unlucky.dm

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>

* Nicer damage

* these

* this

* mini DCS update

* Excludes

* Proper inherit

* Update unlucky.dm

* Update code/datums/components/traits/unlucky.dm

* These

* thes too

* user

* no hardrefs

* only these 2

---------

Co-authored-by: Guti <32563288+TheCaramelion@users.noreply.github.com>
This commit is contained in:
Cameron Lennox
2025-10-04 03:13:12 -04:00
committed by GitHub
co-authored by Guti
parent 0befda8668
commit 7f4de78573
44 changed files with 1123 additions and 182 deletions
+93 -71
View File
@@ -2,6 +2,14 @@
//The winner of the pull has an effect applied to them.
//Crackers do already exist, but these ones are a more memey scene item.
#define SHRINKING_CRACKER "shrinking"
#define GROWING_CRACKER "growing"
#define DRUGGED_CRACKER "drugged"
#define INVISIBLE_CRACKER "invisibility"
#define FALLING_CRACKER "knockdown"
#define TELEPORTING_CRACKER "teleport"
#define WEALTHY_CRACKER "wealth"
/obj/item/cracker
name = "bluespace cracker" //I have no idea why this was called shrink ray when this increased and decreased size.
desc = "A celebratory little game with a bluespace twist! Pull it between two people until it snaps, and the person who recieves the larger end gets a prize!"
@@ -13,26 +21,35 @@
)
item_state = "blue"
var/rigged = 0 //So that they can be rigged by varedits to go one way or the other. positive values mean holder always wins, negative values mean target always wins.
var/list/prizes = list("shrinking","growing","drugged","invisibility","knocked over","teleport","wealth")
var/list/jokes = list(
"When is a boat just like snow? When it's adrift.",
"What happens to naughty elves? Santa gives them the sack.",
"What do you call an old snowman? Water.",
"Why has Santa been banned from sooty chimneys? Carbon footprints.",
"What goes down but doesn't come up? A yo.",
"What's green and fuzzy, has four legs and would kill you if it fell from a tree? A pool table.",
"Why did the blind man fall into the well? Because he couldn't see that well.",
"What did the pirate get on his report card? Seven Cs",
"What do you call a fish with no eyes? Fsh",
"How do you make an egg roll? You push it.",
"What do you call a deer with no eyes? NO EYED DEER!",
"What's red, and smells like blue paint? Red paint.",
"Where do cows go to dance? A meat ball.",
"What do you call a person who steals all your toenail clippings? A cliptoemaniac.",
"What's brown and sticky? A stick.",
"What's the best way to kill a circus? Go for the juggler.",
"What do you call a cow with no legs? Ground Beef.",
"Why'd the scarecrow win the Nobel prize? He was outstanding in his field.")
var/prize //What prize we have loaded
var/joke //What joke we have loaded
/obj/item/cracker/Initialize(mapload)
. = ..()
var/style = pick("blue","green","yellow","red","heart","hazard")
icon_state = style
item_state = style
if(!prize)
prize = pick(SHRINKING_CRACKER,GROWING_CRACKER,GROWING_CRACKER,INVISIBLE_CRACKER,FALLING_CRACKER,TELEPORTING_CRACKER,WEALTHY_CRACKER)
if(!joke)
joke = pick("When is a boat just like snow? When it's adrift.",
"What happens to naughty elves? Santa gives them the sack.",
"What do you call an old snowman? Water.",
"Why has Santa been banned from sooty chimneys? Carbon footprints.",
"What goes down but doesn't come up? A yo.",
"What's green and fuzzy, has four legs and would kill you if it fell from a tree? A pool table.",
"Why did the blind man fall into the well? Because he couldn't see that well.",
"What did the pirate get on his report card? Seven Cs",
"What do you call a fish with no eyes? Fsh",
"How do you make an egg roll? You push it.",
"What do you call a deer with no eyes? NO EYED DEER!",
"What's red, and smells like blue paint? Red paint.",
"Where do cows go to dance? A meat ball.",
"What do you call a person who steals all your toenail clippings? A cliptoemaniac.",
"What's brown and sticky? A stick.",
"What's the best way to kill a circus? Go for the juggler.",
"What do you call a cow with no legs? Ground Beef.",
"Why'd the scarecrow win the Nobel prize? He was outstanding in his field.")
/obj/item/cracker/attack(atom/A, mob/living/user, adjacent, params)
var/mob/living/carbon/human/target = A
@@ -56,8 +73,6 @@
to_chat(user, span_notice("\The [src] is no longer in-hand!"))
to_chat(target, span_notice("\The [src] is no longer in-hand!"))
return
var/prize = pick(prizes)
var/joke = pick(jokes)
var/mob/living/carbon/human/winner
var/mob/living/carbon/human/loser
if(!rigged)
@@ -74,46 +89,52 @@
else
winner = target
loser = user
if(HAS_TRAIT(loser, TRAIT_UNLUCKY) && prob(66))
if(prize == (SHRINKING_CRACKER || GROWING_CRACKER || FALLING_CRACKER || TELEPORTING_CRACKER)) //If we're unlucky and the prize is bad, chance for us to get it!
var/former_winner = winner
winner = loser
loser = former_winner
var/spawnloc = get_turf(winner)
winner.visible_message(span_notice("\The [winner] wins the cracker prize!"),span_notice("You win the cracker prize!"))
if(prize == "shrinking")
winner.resize(0.25)
winner.visible_message(span_bold("\The [winner]") + " shrinks suddenly!")
if(prize == "growing")
winner.resize(2)
winner.visible_message(span_bold("\The [winner]") + " grows in height suddenly.")
if(prize == "drugged")
winner.druggy = max(winner.druggy, 50)
if(prize == "invisibility")
if(!winner.cloaked)
winner.visible_message(span_bold("\The [winner]") + " vanishes from sight.")
winner.cloak()
spawn(600)
if(winner.cloaked)
winner.uncloak()
winner.visible_message(span_bold("\The [winner]") + " appears as if from thin air.")
if(prize == "knocked over")
winner.visible_message(span_bold("\The [winner]") + " is suddenly knocked to the ground.")
winner.weakened = max(winner.weakened,50)
if(prize == "teleport")
if(loser.can_be_drop_pred && loser.vore_selected)
if(winner.devourable && winner.can_be_drop_prey)
winner.visible_message(span_bold("\The [winner]") + " is teleported to somewhere nearby...")
var/datum/effect/effect/system/spark_spread/spk
spk = new(winner)
switch(prize)
if(SHRINKING_CRACKER)
winner.resize(0.25)
winner.visible_message(span_bold("\The [winner]") + " shrinks suddenly!")
if(GROWING_CRACKER)
winner.resize(2)
winner.visible_message(span_bold("\The [winner]") + " grows in height suddenly.")
if(GROWING_CRACKER)
winner.druggy = max(winner.druggy, 50)
if(INVISIBLE_CRACKER)
if(!winner.cloaked)
winner.visible_message(span_bold("\The [winner]") + " vanishes from sight.")
winner.cloak()
spawn(600)
if(winner.cloaked)
winner.uncloak()
winner.visible_message(span_bold("\The [winner]") + " appears as if from thin air.")
if(FALLING_CRACKER)
winner.visible_message(span_bold("\The [winner]") + " is suddenly knocked to the ground.")
winner.weakened = max(winner.weakened,50)
if(TELEPORTING_CRACKER)
if(loser.can_be_drop_pred && loser.vore_selected)
if(winner.devourable && winner.can_be_drop_prey)
winner.visible_message(span_bold("\The [winner]") + " is teleported to somewhere nearby...")
var/datum/effect/effect/system/spark_spread/spk
spk = new(winner)
var/T = get_turf(winner)
spk.set_up(5, 0, winner)
spk.attach(winner)
playsound(T, "sparks", 50, 1)
anim(T,winner,'icons/mob/mob.dmi',,"phaseout",,winner.dir)
winner.forceMove(loser.vore_selected)
if(prize == "wealth")
new /obj/random/cash/huge(spawnloc)
new /obj/random/cash/huge(spawnloc)
winner.visible_message(span_bold("\The [winner]") + " has a whole load of cash fall at their feet!")
var/T = get_turf(winner)
spk.set_up(5, 0, winner)
spk.attach(winner)
playsound(T, "sparks", 50, 1)
anim(T,winner,'icons/mob/mob.dmi',,"phaseout",,winner.dir)
winner.forceMove(loser.vore_selected)
if(WEALTHY_CRACKER)
new /obj/random/cash/huge(spawnloc)
new /obj/random/cash/huge(spawnloc)
winner.visible_message(span_bold("\The [winner]") + " has a whole load of cash fall at their feet!")
playsound(user, 'sound/effects/snap.ogg', 50, 1)
user.drop_item(src)
@@ -123,40 +144,33 @@
J.info = joke
qdel(src)
/obj/item/cracker/Initialize(mapload)
var/list/styles = list("blue","green","yellow","red","heart","hazard")
var/style = pick(styles)
icon_state = style
item_state = style
. = ..()
/obj/item/cracker/shrinking
name = "shrinking bluespace cracker"
prizes = list("shrinking")
prize = SHRINKING_CRACKER
/obj/item/cracker/growing
name = "growing bluespace cracker"
prizes = list("growing")
prize = GROWING_CRACKER
/obj/item/cracker/invisibility
name = "cloaking bluespace cracker"
prizes = list("invisibility")
prize = INVISIBLE_CRACKER
/obj/item/cracker/drugged
name = "psychedelic bluespace cracker"
prizes = list("drugged")
prize = GROWING_CRACKER
/obj/item/cracker/knockover
name = "forceful bluespace cracker"
prizes = list("knocked over")
prize = FALLING_CRACKER
/obj/item/cracker/vore
name = "teleporting bluespace cracker"
prizes = list("teleport")
prize = TELEPORTING_CRACKER
/obj/item/cracker/money
name = "fortuitous bluespace cracker"
prizes = list("wealth")
prize = WEALTHY_CRACKER
/obj/item/clothing/head/paper_crown
name = "paper crown"
@@ -181,3 +195,11 @@
/obj/item/paper/cracker_joke/update_icon()
return
#undef SHRINKING_CRACKER
#undef GROWING_CRACKER
#undef DRUGGED_CRACKER
#undef INVISIBLE_CRACKER
#undef FALLING_CRACKER
#undef TELEPORTING_CRACKER
#undef WEALTHY_CRACKER