Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Lizard stretcher #2533

Closed
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions code/__DEFINES/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define TRAIT_FISH_CASE_COMPATIBILE "fish_case_compatibile"
/// Granted by prismwine
#define TRAIT_REFLECTIVE "reflective"
/// Granted by the Lizard Stretcher
#define TRAIT_STRETCHED "stretched"

/// Trait granted by [mob/living/silicon/ai]
/// Applied when the ai anchors itself
Expand Down
3 changes: 2 additions & 1 deletion code/_globalvars/traits.dm
Original file line number Diff line number Diff line change
Expand Up @@ -149,7 +149,8 @@ GLOBAL_LIST_INIT(traits_by_type, list(
"TRAIT_HOLDABLE" = TRAIT_HOLDABLE,
"TRAIT_SCOOPABLE" = TRAIT_SCOOPABLE,
"TRAIT_ANXIOUS" = TRAIT_ANXIOUS,
"TRAIT_KISS_OF_DEATH" = TRAIT_KISS_OF_DEATH
"TRAIT_KISS_OF_DEATH" = TRAIT_KISS_OF_DEATH,
"TRAIT_STRETCHED" = TRAIT_STRETCHED

),
/obj/item/bodypart = list(
Expand Down
7 changes: 3 additions & 4 deletions code/datums/elements/squish.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,15 +11,15 @@
/datum/element/squish
element_flags = ELEMENT_DETACH

/datum/element/squish/Attach(datum/target, duration=20 SECONDS, reverse=FALSE)
/datum/element/squish/Attach(datum/target, duration=20 SECONDS, reverse=FALSE, permanent=FALSE)
. = ..()
if(!iscarbon(target))
return ELEMENT_INCOMPATIBLE

var/mob/living/carbon/C = target
var/was_lying = C.body_position == LYING_DOWN
addtimer(CALLBACK(src, PROC_REF(Detach), C, was_lying, reverse), duration)

if(!permanent)
addtimer(CALLBACK(src, PROC_REF(Detach), C, was_lying, reverse), duration)
if(reverse)
C.transform = C.transform.Scale(SHORT, TALL)
else
Expand All @@ -32,7 +32,6 @@

if(reverse)
is_lying = !is_lying

if(was_lying == is_lying)
C.transform = C.transform.Scale(SHORT, TALL)
else
Expand Down
53 changes: 53 additions & 0 deletions code/game/machinery/lizard_stretcher.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
/obj/machinery/lizstretcher
name = "lizard stretcher"
desc = "A device designed to stretch out Sarathi. Why? That's a good question."
icon = 'icons/obj/machines/lizard_stretcher.dmi'
icon_state = "lizstretchoff"
max_integrity = 200
integrity_failure = 0.33
armor = list("melee" = 20, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 50, "acid" = 70)
//circuit = /obj/item/circuitboard/machine/lizstretcher
var/active = 0

/obj/machinery/lizstretcher/examine(mob/user)
. = ..()
if(occupant)
. += "<span class='notice'>There's someone inside!</span>"
else
. += "<span class='notice'>It's currently off.</span>"

/obj/machinery/sleeper/Initialize(mapload)
. = ..()
occupant_typecache = GLOB.typecache_living

/obj/machinery/lizstretcher/open_machine()
if(occupant)
occupant.AddElement(/datum/element/squish, 0 SECONDS, TRUE, TRUE)
ADD_TRAIT(occupant, TRAIT_STRETCHED, "lizstretcher")
occupant.forceMove(get_turf(src))
occupant = null

/obj/machinery/lizstretcher/MouseDrop_T(mob/target, mob/user)
if(HAS_TRAIT(user, TRAIT_UI_BLOCKED) || !Adjacent(user) || !user.Adjacent(target) || !user.IsAdvancedToolUser() || !islizard(target))
return
if(HAS_TRAIT(target, TRAIT_STRETCHED))
to_chat(target, "<span class='warning'>You've already been stretched, and don't plan on being stretched further!</span>")
if(user != target)
to_chat(user, "<span class='warning'>[target] refuses to go back in there!</span>")
return

close_machine(target)

/obj/machinery/lizstretcher/close_machine(mob/user)
if((isnull(user) || istype(user)) && !active)
..(user)
var/mob/living/mob_occupant = occupant
if(mob_occupant && mob_occupant.stat != DEAD)
to_chat(occupant, "<span class='notice'><b>You begin to be stretched by the stretcher!</b></span>")
active = TRUE
icon_state = "lizstretchon"
if(do_after(user, 30, target = src))
to_chat(occupant, "<span class='notice'><b>You emerge from the stretcher, much taller.</b></span>")
open_machine()
active = FALSE
icon_state = "lizstretchoff"
Binary file added icons/obj/machines/lizard_stretcher.dmi
Binary file not shown.
1 change: 1 addition & 0 deletions shiptest.dme
Original file line number Diff line number Diff line change
Expand Up @@ -870,6 +870,7 @@
#include "code\game\machinery\launch_pad.dm"
#include "code\game\machinery\lightswitch.dm"
#include "code\game\machinery\limbgrower.dm"
#include "code\game\machinery\lizard_stretcher.dm"
#include "code\game\machinery\mass_driver.dm"
#include "code\game\machinery\medical_kiosk.dm"
#include "code\game\machinery\medipen_refiller.dm"
Expand Down