mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2025-12-10 09:42:29 +00:00
* Staff of Shrinking for the wizard (#83115) <!-- Write **BELOW** The Headers and **ABOVE** The comments else it may not be viewable. --> <!-- You can view Contributing.MD for a detailed description of the pull request process. --> ## About The Pull Request Adds a new staff for the wizard that shoots shrink rays. Also a corresponding wand that comes with the wand belt. Shrinking is a mechanic already implemented by abductors, but it's not often used because it doesn't fit their kit super well. That's a huge shame because shrinking stuff/people is really funny. And you know where funny stuff fits well? The wizard kit. OH YEAH and being shrunken now gives you the squash component so you can be squashed as though you were a roach, though this only deals 10 damage instead of gibbing you tiny staff  tiny wand  exhausted wand turns back to a big wand sprite :)  ## Why It's Good For The Game Shrinking stuff is funny, plus it gives the wizard something new to do besides polymorphing everyone or turning everybody to stone or ei nathing people. ## Changelog <!-- If your PR modifies aspects of the game that can be concretely observed by players or admins you should add a changelog. If your change does NOT meet this description, remove this section. Be sure to properly mark your PRs to prevent unnecessary GBP loss. You can read up on GBP and it's effects on PRs in the tgstation guides for contributors. Please note that maintainers freely reserve the right to remove and add tags should they deem it appropriate. You can attempt to finagle the system all you want, but it's best to shoot for clear communication right off the bat. --> 🆑 add: New funny wizard staff/wand that shrinks stuff. add: Being shrunken now leaves you vulnerable to being crushed to death. /🆑 <!-- Both 🆑's are required for the changelog to work! You can put your name to the right of the first 🆑 if you want to overwrite your GitHub username as author ingame. --> <!-- You can use multiple of the same prefix (they're only used for the icon ingame) and delete the unneeded ones. Despite some of the tags, changelogs should generally represent how a player might be affected by the changes rather than a summary of the PR's contents. --> * Staff of Shrinking for the wizard --------- Co-authored-by: PKPenguin321 <pkpenguin321.git@gmail.com>
65 lines
2.4 KiB
Plaintext
65 lines
2.4 KiB
Plaintext
/datum/component/shrink
|
|
var/olddens
|
|
var/oldopac
|
|
/// Tracks the squashable component we apply when we make the small mob squashable
|
|
var/datum/component/squashable/newsquash
|
|
dupe_mode = COMPONENT_DUPE_HIGHLANDER
|
|
|
|
/datum/component/shrink/Initialize(shrink_time)
|
|
if(!isatom(parent))
|
|
return COMPONENT_INCOMPATIBLE
|
|
var/atom/parent_atom = parent
|
|
parent_atom.transform = parent_atom.transform.Scale(0.5,0.5)
|
|
olddens = parent_atom.density
|
|
oldopac = parent_atom.opacity
|
|
|
|
parent_atom.set_opacity(FALSE)
|
|
if(isliving(parent_atom))
|
|
var/mob/living/L = parent_atom
|
|
ADD_TRAIT(L, TRAIT_UNDENSE, SHRUNKEN_TRAIT)
|
|
RegisterSignal(L, COMSIG_MOB_SAY, PROC_REF(handle_shrunk_speech))
|
|
L.add_movespeed_modifier(/datum/movespeed_modifier/shrink_ray)
|
|
if(iscarbon(L))
|
|
var/mob/living/carbon/C = L
|
|
C.unequip_everything()
|
|
C.visible_message(span_warning("[C]'s belongings fall off of [C.p_them()] as they shrink down!"),
|
|
span_userdanger("Your belongings fall away as everything grows bigger!"))
|
|
if(ishuman(C))
|
|
var/mob/living/carbon/human/H = C
|
|
H.physiology.damage_resistance -= 100//carbons take double damage while shrunk
|
|
if(!L.GetComponent(/datum/component/squashable))
|
|
newsquash = L.AddComponent( \
|
|
/datum/component/squashable, \
|
|
squash_chance = 75, \
|
|
squash_damage = 10, \
|
|
squash_flags = SQUASHED_ALWAYS_IF_DEAD|SQUASHED_DONT_SQUASH_IN_CONTENTS, \
|
|
)
|
|
else
|
|
parent_atom.set_density(FALSE) // this is handled by the UNDENSE trait on mobs
|
|
parent_atom.visible_message(span_warning("[parent_atom] shrinks down to a tiny size!"),
|
|
span_userdanger("Everything grows bigger!"))
|
|
if(shrink_time >= 0) // negative shrink time is permanent
|
|
QDEL_IN(src, shrink_time)
|
|
|
|
/datum/component/shrink/proc/handle_shrunk_speech(mob/living/little_guy, list/speech_args)
|
|
SIGNAL_HANDLER
|
|
speech_args[SPEECH_SPANS] |= SPAN_SMALL_VOICE
|
|
|
|
/datum/component/shrink/Destroy()
|
|
if(newsquash)
|
|
qdel(newsquash)
|
|
var/atom/parent_atom = parent
|
|
parent_atom.transform = parent_atom.transform.Scale(2,2)
|
|
parent_atom.set_opacity(oldopac)
|
|
if(isliving(parent_atom))
|
|
var/mob/living/L = parent_atom
|
|
L.remove_movespeed_modifier(/datum/movespeed_modifier/shrink_ray)
|
|
REMOVE_TRAIT(L, TRAIT_UNDENSE, SHRUNKEN_TRAIT)
|
|
UnregisterSignal(L, COMSIG_MOB_SAY)
|
|
if(ishuman(L))
|
|
var/mob/living/carbon/human/H = L
|
|
H.physiology.damage_resistance += 100
|
|
else
|
|
parent_atom.set_density(olddens) // this is handled by the UNDENSE trait on mobs
|
|
return ..()
|