more work
This commit is contained in:
34
hyperstation/code/modules/resize/resize_action.dm
Normal file
34
hyperstation/code/modules/resize/resize_action.dm
Normal file
@@ -0,0 +1,34 @@
|
||||
//This action is technically a duplicate of /action/small_sprite
|
||||
//However, we do our own things...
|
||||
|
||||
/datum/action/sizecode_resize
|
||||
name = "Toggle Giant Sprite"
|
||||
desc = "Others will continue to see you giant."
|
||||
icon_icon = 'icons/mob/screen_gen_old.dmi'
|
||||
button_icon_state = "health1" //You can change this if you want
|
||||
background_icon_state = "bg_alien" //But keep this as a distinct background
|
||||
var/small = FALSE
|
||||
var/image/small_icon
|
||||
|
||||
/datum/action/sizecode_resize/Grant(mob/M, safety=FALSE)
|
||||
if(ishuman(M) && !safety) //this probably gets called before a person gets overlays on roundstart, so try again
|
||||
if(!LAZYLEN(M.overlays))
|
||||
addtimer(CALLBACK(src,PROC_REF(Grant), M, TRUE), 5) //https://www.youtube.com/watch?v=QQ-aYZzlDeo
|
||||
return
|
||||
|
||||
..()
|
||||
if(!owner)
|
||||
return
|
||||
var/image/I = image(icon=owner.icon,icon_state=owner.icon_state,loc=owner,layer=owner.layer,pixel_x=owner.pixel_x,pixel_y=owner.pixel_y)
|
||||
I.overlays += owner.overlays
|
||||
I.override = TRUE
|
||||
small_icon = I
|
||||
|
||||
/datum/action/sizecode_resize/Trigger()
|
||||
..()
|
||||
if(!small)
|
||||
owner.add_alt_appearance(/datum/atom_hud/alternate_appearance/basic, "sizecode_smallsprite", small_icon)
|
||||
else
|
||||
owner.remove_alt_appearance("sizecode_smallsprite")
|
||||
small = !small
|
||||
return TRUE
|
||||
271
hyperstation/code/modules/resize/resizing.dm
Normal file
271
hyperstation/code/modules/resize/resizing.dm
Normal file
@@ -0,0 +1,271 @@
|
||||
//I am not a coder. Please fucking tear apart my code, and insult me for how awful I am at coding. Please and thank you. -Dahlular
|
||||
//alright bet -BoxBoy
|
||||
#define RESIZE_MACRO 6
|
||||
#define RESIZE_HUGE 4
|
||||
#define RESIZE_BIG 2
|
||||
#define RESIZE_NORMAL 1
|
||||
#define RESIZE_SMALL 0.75
|
||||
#define RESIZE_TINY 0.50
|
||||
#define RESIZE_MICRO 0.25
|
||||
|
||||
//Moving these here - Jay
|
||||
/mob/living
|
||||
var/size_multiplier = 1 //multiplier for the mob's icon size atm
|
||||
var/previous_size = 1
|
||||
|
||||
//Cyanosis - Action that resizes the sprite for the client but nobody else. Say goodbye to attacking yourself when someone's above you lmao
|
||||
var/datum/action/sizecode_resize/small_sprite
|
||||
|
||||
#define MOVESPEED_ID_SIZE "SIZECODE"
|
||||
#define MOVESPEED_ID_STOMP "STEPPY"
|
||||
|
||||
//averages
|
||||
#define RESIZE_A_MACROHUGE (RESIZE_MACRO + RESIZE_HUGE) / 2
|
||||
#define RESIZE_A_HUGEBIG (RESIZE_HUGE + RESIZE_BIG) / 2
|
||||
#define RESIZE_A_BIGNORMAL (RESIZE_BIG + RESIZE_NORMAL) / 2
|
||||
#define RESIZE_A_NORMALSMALL (RESIZE_NORMAL + RESIZE_SMALL) / 2
|
||||
#define RESIZE_A_SMALLTINY (RESIZE_SMALL + RESIZE_TINY) / 2
|
||||
#define RESIZE_A_TINYMICRO (RESIZE_TINY + RESIZE_MICRO) / 2
|
||||
|
||||
//Scale up a mob's icon by the size_multiplier
|
||||
/mob/living/update_transform()
|
||||
ASSERT(!iscarbon(src)) //the source isnt carbon should always be true
|
||||
var/matrix/M = matrix() //matrix (M) variable
|
||||
M.Scale(size_multiplier)
|
||||
M.Translate(0, 16*(size_multiplier-1)) //translate by 16 * size_multiplier - 1 on Y axis
|
||||
src.transform = M //the source of transform is M
|
||||
|
||||
/mob/proc/get_effective_size()
|
||||
return 100000
|
||||
|
||||
/mob/living/get_effective_size()
|
||||
return src.size_multiplier
|
||||
|
||||
/datum/movespeed_modifier/size
|
||||
id = MOVESPEED_ID_SIZE
|
||||
|
||||
/mob/living/proc/resize(var/new_size, var/animate = TRUE)
|
||||
size_multiplier = new_size //This will be passed into update_transform() and used to change health and speed.
|
||||
if(size_multiplier == previous_size)
|
||||
return TRUE
|
||||
src.update_transform() //WORK DAMN YOU
|
||||
src.update_mobsize()
|
||||
//Going to change the health and speed values too
|
||||
src.remove_movespeed_modifier(/datum/movespeed_modifier/size)
|
||||
src.add_or_update_variable_movespeed_modifier(/datum/movespeed_modifier/size, multiplicative_slowdown = (abs(size_multiplier - 1) * 0.3 )) //GS Change, reduces speed penalties for size from *.4 to *.3
|
||||
var/healthmod_old = ((previous_size * 35) - 75) //Get the old value to see what we must change.
|
||||
var/healthmod_new = ((size_multiplier * 35) - 75) //A size of one would be zero. Big boys get health, small ones lose health. //GS Change, reduces health penalties/buffs for size from *75 to *35
|
||||
var/healthchange = healthmod_new - healthmod_old //Get ready to apply the new value, and subtract the old one. (Negative values become positive)
|
||||
src.maxHealth += healthchange
|
||||
src.health += healthchange
|
||||
if(iscarbon(src))
|
||||
var/mob/living/carbon/C = src
|
||||
for(var/obj/item/organ/genital/G in C.internal_organs)
|
||||
G.update_appearance()
|
||||
//if(src.size_multiplier >= RESIZE_A_HUGEBIG || src.size_multiplier <= RESIZE_A_TINYMICRO) Will remove clothing when too big or small. Will do later.
|
||||
previous_size = size_multiplier //And, change this now that we are finally done.
|
||||
|
||||
SEND_SIGNAL(src, COMSIG_MOBSIZE_CHANGED, src) //This SHOULD allow other shit to check when a mob changes size -Capn
|
||||
|
||||
//Now check if the mob can get the size action
|
||||
if(!small_sprite)
|
||||
small_sprite = new(src)
|
||||
small_sprite.Remove(src)
|
||||
if(size_multiplier >= 1.25) //Anything bigger will start to block things
|
||||
small_sprite.Grant(src)
|
||||
|
||||
//handle the big steppy, except nice
|
||||
/mob/living/proc/handle_micro_bump_helping(var/mob/living/tmob)
|
||||
if(ishuman(src))
|
||||
var/mob/living/carbon/human/H = src
|
||||
|
||||
if(tmob.pulledby == H)
|
||||
return FALSE
|
||||
|
||||
//Micro is on a table.
|
||||
var/turf/steppyspot = tmob.loc
|
||||
for(var/thing in steppyspot.contents)
|
||||
if(istype(thing, /obj/structure/table))
|
||||
return TRUE
|
||||
|
||||
//Both small.
|
||||
if(H.get_effective_size() <= RESIZE_A_TINYMICRO && tmob.get_effective_size() <= RESIZE_A_TINYMICRO)
|
||||
now_pushing = 0
|
||||
H.forceMove(tmob.loc)
|
||||
return TRUE
|
||||
|
||||
//Doing messages
|
||||
if(abs(get_effective_size()/tmob.get_effective_size()) >= 2) //if the initiator is twice the size of the micro
|
||||
now_pushing = 0
|
||||
H.forceMove(tmob.loc)
|
||||
|
||||
//Smaller person being stepped on
|
||||
if(get_effective_size() > tmob.get_effective_size() && iscarbon(src))
|
||||
// GS13: Import Fat Naga & Alt Naga from VoreStation
|
||||
if(istype(H) && H.dna.features["taur"] == "Naga" || H.dna.features["taur"] == "Tentacle" || H.dna.features["taur"] == "Fat Naga" || H.dna.features["taur"] == "Alt Naga")
|
||||
tmob.visible_message("<span class='notice'>[src] carefully slithers around [tmob].</span>", "<span class='notice'>[src]'s huge tail slithers besides you.</span>")
|
||||
else
|
||||
tmob.visible_message("<span class='notice'>[src] carefully steps over [tmob].</span>", "<span class='notice'>[src] steps over you carefully.</span>")
|
||||
|
||||
return TRUE
|
||||
|
||||
//Smaller person stepping under a larger person
|
||||
if(abs(tmob.get_effective_size()/get_effective_size()) >= 2)
|
||||
H.forceMove(tmob.loc)
|
||||
now_pushing = 0
|
||||
micro_step_under(tmob)
|
||||
return TRUE
|
||||
|
||||
//Stepping on disarm intent -- TO DO, OPTIMIZE ALL OF THIS SHIT
|
||||
/mob/living/proc/handle_micro_bump_other(var/mob/living/tmob)
|
||||
ASSERT(isliving(tmob))
|
||||
if(ishuman(src))
|
||||
var/mob/living/carbon/human/H = src
|
||||
|
||||
if(tmob.pulledby == H)
|
||||
return FALSE
|
||||
|
||||
//If on a table, don't
|
||||
var/turf/steppyspot = tmob.loc
|
||||
for(var/thing in steppyspot.contents)
|
||||
if(istype(thing, /obj/structure/table))
|
||||
return TRUE
|
||||
|
||||
//Both small
|
||||
if(H.get_effective_size() <= RESIZE_A_TINYMICRO && tmob.get_effective_size() <= RESIZE_A_TINYMICRO)
|
||||
now_pushing = 0
|
||||
H.forceMove(tmob.loc)
|
||||
return TRUE
|
||||
|
||||
if(abs(get_effective_size()/tmob.get_effective_size()) >= 2)
|
||||
if(H.a_intent == "disarm" && H.canmove && !H.buckled)
|
||||
now_pushing = 0
|
||||
H.forceMove(tmob.loc)
|
||||
sizediffStamLoss(tmob)
|
||||
H.add_movespeed_modifier(MOVESPEED_ID_STOMP, multiplicative_slowdown = 10) //Full stop
|
||||
addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/, remove_movespeed_modifier), MOVESPEED_ID_STOMP), 3) //0.3 seconds
|
||||
if(get_effective_size() > tmob.get_effective_size() && iscarbon(H))
|
||||
if(istype(H) && H.dna.features["taur"] == "Naga" || H.dna.features["taur"] == "Tentacle" || H.dna.features["taur"] == "Fat Naga" || H.dna.features["taur"] == "Alt Naga")
|
||||
tmob.visible_message("<span class='danger'>[src] carefully rolls their tail over [tmob]!</span>", "<span class='danger'>[src]'s huge tail rolls over you!</span>")
|
||||
else
|
||||
tmob.visible_message("<span class='danger'>[src] carefully steps on [tmob]!</span>", "<span class='danger'>[src] steps onto you with force!</span>")
|
||||
|
||||
//horny traits
|
||||
/*
|
||||
if(HAS_TRAIT(src, TRAIT_MICROPHILE))
|
||||
src.adjust_arousal(8)
|
||||
if (src.getArousalLoss() >= 100 && ishuman(tmob) && tmob.has_dna())
|
||||
src.mob_climax(forced_climax=TRUE)
|
||||
|
||||
if(HAS_TRAIT(tmob, TRAIT_MACROPHILE))
|
||||
tmob.adjust_arousal(10)
|
||||
if (tmob.getArousalLoss() >= 100 && ishuman(tmob) && tmob.has_dna())
|
||||
tmob.mob_climax(forced_climax=TRUE)
|
||||
|
||||
return TRUE
|
||||
* commenting out for now.*/
|
||||
|
||||
if(H.a_intent == "harm" && H.canmove && !H.buckled)
|
||||
now_pushing = 0
|
||||
H.forceMove(tmob.loc)
|
||||
sizediffStamLoss(tmob)
|
||||
sizediffBruteloss(tmob)
|
||||
playsound(loc, 'sound/misc/splort.ogg', 50, 1)
|
||||
H.add_movespeed_modifier(MOVESPEED_ID_STOMP, multiplicative_slowdown = 10)
|
||||
addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/, remove_movespeed_modifier), MOVESPEED_ID_STOMP), 10) //1 second
|
||||
//H.Stun(20)
|
||||
if(get_effective_size() > tmob.get_effective_size() && iscarbon(H))
|
||||
if(istype(H) && H.dna.features["taur"] == "Naga" || H.dna.features["taur"] == "Tentacle" || H.dna.features["taur"] == "Fat Naga" || H.dna.features["taur"] == "Alt Naga")
|
||||
tmob.visible_message("<span class='danger'>[src] mows down [tmob] under their tail!</span>", "<span class='userdanger'>[src] plows their tail over you mercilessly!</span>")
|
||||
else
|
||||
tmob.visible_message("<span class='danger'>[src] slams their foot down on [tmob], crushing them!</span>", "<span class='userdanger'>[src] crushes you under their foot!</span>")
|
||||
|
||||
//horny traits
|
||||
/*
|
||||
if(HAS_TRAIT(src, TRAIT_MICROPHILE))
|
||||
src.adjust_arousal((get_effective_size()/tmob.get_effective_size()*3))
|
||||
if (src.getArousalLoss() >= 100 && ishuman(tmob) && tmob.has_dna())
|
||||
src.mob_climax(forced_climax=TRUE)
|
||||
|
||||
if(HAS_TRAIT(tmob, TRAIT_MACROPHILE))
|
||||
tmob.adjust_arousal((get_effective_size()/tmob.get_effective_size()*3))
|
||||
if (tmob.getArousalLoss() >= 100 && ishuman(tmob) && tmob.has_dna())
|
||||
tmob.mob_climax(forced_climax=TRUE)
|
||||
|
||||
commenting out for now */
|
||||
return TRUE
|
||||
|
||||
// if(H.a_intent == "grab" && H.canmove && !H.buckled)
|
||||
// now_pushing = 0
|
||||
// H.forceMove(tmob.loc)
|
||||
// sizediffStamLoss(tmob)
|
||||
// sizediffStun(tmob)
|
||||
// H.add_movespeed_modifier(MOVESPEED_ID_STOMP, multiplicative_slowdown = 10)
|
||||
// addtimer(CALLBACK(H, TYPE_PROC_REF(/mob/, remove_movespeed_modifier), MOVESPEED_ID_STOMP), 7)//About 3/4th a second
|
||||
// if(get_effective_size() > tmob.get_effective_size() && iscarbon(H))
|
||||
// var/feetCover = (H.wear_suit && (H.wear_suit.body_parts_covered & FEET)) || (H.w_uniform && (H.w_uniform.body_parts_covered & FEET) || (H.shoes && (H.shoes.body_parts_covered & FEET)))
|
||||
// if(feetCover)
|
||||
// if(istype(H) && H.dna.features["taur"] == "Naga" || H.dna.features["taur"] == "Tentacle" || H.dna.features["taur"] == "Fat Naga" || H.dna.features["taur"] == "Alt Naga")
|
||||
// tmob.visible_message("<span class='danger'>[src] pins [tmob] under their tail!</span>", "<span class='danger'>[src] pins you beneath their tail!</span>")
|
||||
// else
|
||||
// tmob.visible_message("<span class='danger'>[src] pins [tmob] helplessly underfoot!</span>", "<span class='danger'>[src] pins you underfoot!</span>")
|
||||
// return TRUE
|
||||
// else
|
||||
// if(istype(H) && H.dna.features["taur"] == "Naga" || H.dna.features["taur"] == "Tentacle" || H.dna.features["taur"] == "Fat Naga" || H.dna.features["taur"] == "Alt Naga")
|
||||
// tmob.visible_message("<span class='danger'>[src] snatches up [tmob] underneath their tail!</span>", "<span class='userdanger'>[src]'s tail winds around you and snatches you in its coils!</span>")
|
||||
// //tmob.mob_pickup_micro_feet(H)
|
||||
// SEND_SIGNAL(tmob, COMSIG_MICRO_PICKUP_FEET, H)
|
||||
// else
|
||||
// tmob.visible_message("<span class='danger'>[src] stomps down on [tmob], curling their toes and picking them up!</span>", "<span class='userdanger'>[src]'s toes pin you down and curl around you, picking you up!</span>")
|
||||
// //tmob.mob_pickup_micro_feet(H)
|
||||
// SEND_SIGNAL(tmob, COMSIG_MICRO_PICKUP_FEET, H)
|
||||
// return TRUE
|
||||
|
||||
if(abs(tmob.get_effective_size()/get_effective_size()) >= 2)
|
||||
H.forceMove(tmob.loc)
|
||||
now_pushing = 0
|
||||
micro_step_under(tmob)
|
||||
return TRUE
|
||||
|
||||
//smaller person stepping under another person... TO DO, fix and allow special interactions with naga legs to be seen
|
||||
/mob/living/proc/micro_step_under(var/mob/living/tmob)
|
||||
if(istype(tmob) && istype(tmob, /datum/sprite_accessory/taur/naga))
|
||||
src.visible_message("<span class='notice'>[src] bounds over [tmob]'s tail.</span>", "<span class='notice'>You jump over [tmob]'s thick tail.</span>")
|
||||
else
|
||||
src.visible_message("<span class='notice'>[src] runs between [tmob]'s legs.</span>", "<span class='notice'>You run between [tmob]'s legs.</span>")
|
||||
|
||||
//Proc for scaling stamina damage on size difference
|
||||
/mob/living/proc/sizediffStamLoss(var/mob/living/tmob)
|
||||
var/S = (get_effective_size()/tmob.get_effective_size()*25) //macro divided by micro, times 25
|
||||
tmob.Knockdown(S) //final result in stamina knockdown
|
||||
|
||||
//Proc for scaling stuns on size difference (for grab intent)
|
||||
/mob/living/proc/sizediffStun(var/mob/living/tmob)
|
||||
var/T = (get_effective_size()/tmob.get_effective_size()*2) //Macro divided by micro, times 2
|
||||
tmob.Stun(T)
|
||||
|
||||
//Proc for scaling brute damage on size difference
|
||||
/mob/living/proc/sizediffBruteloss(var/mob/living/tmob)
|
||||
var/B = (get_effective_size()/tmob.get_effective_size()*2) //macro divided by micro, times 3 //GS change, *2
|
||||
tmob.adjustBruteLoss(B) //final result in brute loss
|
||||
|
||||
//Proc for changing mob_size to be grabbed for item weight classes
|
||||
/mob/living/proc/update_mobsize(var/mob/living/tmob)
|
||||
if(size_multiplier <= 0.50)
|
||||
mob_size = 0
|
||||
else if(size_multiplier < 1)
|
||||
mob_size = 1
|
||||
else if(size_multiplier <= 2)
|
||||
mob_size = 2 //the default human size
|
||||
else if(size_multiplier > 2)
|
||||
mob_size = 3
|
||||
|
||||
//Proc for instantly grabbing valid size difference. Code optimizations soon(TM)
|
||||
/*
|
||||
/mob/living/proc/sizeinteractioncheck(var/mob/living/tmob)
|
||||
if(abs(get_effective_size()/tmob.get_effective_size())>=2.0 && get_effective_size()>tmob.get_effective_size())
|
||||
return FALSE
|
||||
else
|
||||
return TRUE
|
||||
*/
|
||||
//Clothes coming off at different sizes, and health/speed/stam changes as well
|
||||
134
hyperstation/code/modules/resize/sizechems.dm
Normal file
134
hyperstation/code/modules/resize/sizechems.dm
Normal file
@@ -0,0 +1,134 @@
|
||||
//Size Chemicals, now with better and less cringy names.
|
||||
//TO DO: USE BETTER FERMICHEM TO MAKE ALL OF THESE CHEMICALS MORE INTERACTIVE
|
||||
|
||||
//Sizechem reagent
|
||||
/datum/reagent/sizechem
|
||||
name = "Cell-Volume Altering Base"
|
||||
description = "A stabilized compound liquid, used as a basis for increasing or decreasing the size of living matter with more recipes."
|
||||
color = "#C900CC"
|
||||
taste_description = "regret"
|
||||
can_synth = FALSE
|
||||
metabolization_rate = 0.25
|
||||
|
||||
//Sizechem reaction
|
||||
/datum/chemical_reaction/sizechem
|
||||
name = "Cell-Volume Altering Base"
|
||||
id = /datum/reagent/sizechem
|
||||
mix_message = "the reaction rapidly alters in size!"
|
||||
required_reagents = list(/datum/reagent/growthserum = 0.15, /datum/reagent/medicine/clonexadone = 0.15, /datum/reagent/gold = 0.15, /datum/reagent/acetone = 0.15)
|
||||
results = list(/datum/reagent/sizechem = 0.3)
|
||||
required_temp = 1
|
||||
//Fermichem vars
|
||||
OptimalTempMin = 600 // Lower area of bell curve for determining heat based rate reactions
|
||||
OptimalTempMax = 630 // Upper end for above
|
||||
ExplodeTemp = 635 // Temperature at which reaction explodes
|
||||
OptimalpHMin = 5 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase)
|
||||
OptimalpHMax = 5.5 // Higest value for above
|
||||
ReactpHLim = 2 // How far out pH wil react, giving impurity place (Exponential phase)
|
||||
CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst)
|
||||
CurveSharpT = 4 // How sharp the temperature exponential curve is (to the power of value)
|
||||
CurveSharppH = 4 // How sharp the pH exponential curve is (to the power of value)
|
||||
ThermicConstant = -10 // Temperature change per 1u produced
|
||||
HIonRelease = 0.02 // pH change per 1u reaction (inverse for some reason)
|
||||
RateUpLim = 1 // Optimal/max rate possible if all conditions are perfect
|
||||
FermiChem = TRUE // If the chemical uses the Fermichem reaction mechanics
|
||||
FermiExplode = FALSE // If the chemical explodes in a special way
|
||||
PurityMin = 0.2
|
||||
|
||||
//Growthchem reagent
|
||||
/datum/reagent/growthchem
|
||||
name = "Prospacillin"
|
||||
description = "A stabilized altercation of size-altering liquids, this one appears to increase cell volume."
|
||||
color = "#E70C0C"
|
||||
taste_description = "a sharp, fiery and intoxicating flavour"
|
||||
overdose_threshold = 10
|
||||
metabolization_rate = 0.25
|
||||
can_synth = FALSE //DO NOT MAKE THIS SNYTHESIZABLE, THESE CHEMS ARE SUPPOSED TO NOT BE USED COMMONLY
|
||||
|
||||
//Growthchem reaction
|
||||
/datum/chemical_reaction/growthchem
|
||||
name = "Prospacillin"
|
||||
id = /datum/reagent/growthchem
|
||||
mix_message = "the reaction appears to grow!"
|
||||
required_reagents = list(/datum/reagent/sizechem = 0.15, /datum/reagent/consumable/condensedcapsaicin = 0.15, /datum/reagent/drug/aphrodisiac = 0.30)
|
||||
results = list(/datum/reagent/growthchem = 0.25)
|
||||
required_temp = 1
|
||||
OptimalTempMin = 700 // Lower area of bell curve for determining heat based rate reactions
|
||||
OptimalTempMax = 730 // Upper end for above
|
||||
ExplodeTemp = 735 // Temperature at which reaction explodes
|
||||
OptimalpHMin = 3 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase)
|
||||
OptimalpHMax = 3.5 // Higest value for above
|
||||
ReactpHLim = 2 // How far out pH wil react, giving impurity place (Exponential phase)
|
||||
CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst)
|
||||
CurveSharpT = 4 // How sharp the temperature exponential curve is (to the power of value)
|
||||
CurveSharppH = 4 // How sharp the pH exponential curve is (to the power of value)
|
||||
ThermicConstant = -10 // Temperature change per 1u produced
|
||||
HIonRelease = 0.02 // pH change per 1u reaction (inverse for some reason)
|
||||
RateUpLim = 1 // Optimal/max rate possible if all conditions are perfect
|
||||
FermiChem = TRUE // If the chemical uses the Fermichem reaction mechanics
|
||||
FermiExplode = FALSE // If the chemical explodes in a special way
|
||||
PurityMin = 0.2
|
||||
|
||||
//Growthchem effects
|
||||
/datum/reagent/growthchem/on_mob_add(mob/living/carbon/M)
|
||||
. = ..()
|
||||
if(ishuman(M))
|
||||
log_game("SIZECODE: [M] ckey: [M.key] has ingested growthchem.")
|
||||
|
||||
/datum/reagent/growthchem/on_mob_life(mob/living/carbon/M)
|
||||
if(!ishuman(M))
|
||||
return..()
|
||||
if(M.size_multiplier < RESIZE_MACRO)
|
||||
M.resize(M.size_multiplier+0.025)
|
||||
M.visible_message("<span class='danger'>[pick("[M] grows!", "[M] expands in size!", "[M] pushes outwards in stature!")]</span>", "<span class='danger'>[pick("You feel your body fighting for space and growing!", "The world contracts inwards in every direction!", "You feel your muscles expand, and your surroundings shrink!")]</span>")
|
||||
..()
|
||||
. = 1
|
||||
|
||||
//Shrinkchem reagent
|
||||
/datum/reagent/shrinkchem
|
||||
name = "Diminicillin"
|
||||
description = "A stabilized altercation of size-altering liquids, this one appears to decrease cell volume."
|
||||
color = "#0C26E7"
|
||||
taste_description = "a pungent, acidic and jittery flavour"
|
||||
overdose_threshold = 10
|
||||
metabolization_rate = 0.50
|
||||
can_synth = FALSE //SAME STORY AS ABOVE
|
||||
|
||||
//Shrinchem reaction
|
||||
/datum/chemical_reaction/shrinkchem
|
||||
name = "Diminicillin"
|
||||
id = /datum/reagent/shrinkchem
|
||||
mix_message = "the reaction appears to shrink!"
|
||||
required_reagents = list(/datum/reagent/sizechem = 0.15, /datum/reagent/consumable/frostoil = 0.15, /datum/reagent/drug/aphrodisiac = 0.30)
|
||||
results = list(/datum/reagent/shrinkchem = 0.25)
|
||||
required_temp = 1
|
||||
OptimalTempMin = 100 // Lower area of bell curve for determining heat based rate reactions
|
||||
OptimalTempMax = 150 // Upper end for above
|
||||
ExplodeTemp = 350 // Temperature at which reaction explodes
|
||||
OptimalpHMin = 3 // Lowest value of pH determining pH a 1 value for pH based rate reactions (Plateu phase)
|
||||
OptimalpHMax = 4.5 // Higest value for above
|
||||
ReactpHLim = 2 // How far out pH wil react, giving impurity place (Exponential phase)
|
||||
CatalystFact = 0 // How much the catalyst affects the reaction (0 = no catalyst)
|
||||
CurveSharpT = 4 // How sharp the temperature exponential curve is (to the power of value)
|
||||
CurveSharppH = 4 // How sharp the pH exponential curve is (to the power of value)
|
||||
ThermicConstant = -10 // Temperature change per 1u produced
|
||||
HIonRelease = 0.02 // pH change per 1u reaction (inverse for some reason)
|
||||
RateUpLim = 1 // Optimal/max rate possible if all conditions are perfect
|
||||
FermiChem = TRUE // If the chemical uses the Fermichem reaction mechanics
|
||||
FermiExplode = FALSE // If the chemical explodes in a special way
|
||||
PurityMin = 0.2
|
||||
|
||||
//Shrinkchem effects
|
||||
/datum/reagent/shrinkchem/on_mob_add(mob/living/carbon/M)
|
||||
. = ..()
|
||||
if(ishuman(M))
|
||||
log_game("SIZECODE: [M] ckey: [M.key] has ingested shrinkchem.")
|
||||
|
||||
/datum/reagent/shrinkchem/on_mob_life(mob/living/carbon/M)
|
||||
if(!ishuman(M))
|
||||
return..()
|
||||
if(M.size_multiplier > RESIZE_MICRO)
|
||||
M.resize(M.size_multiplier-0.025)
|
||||
M.visible_message("<span class='danger'>[pick("[M] shrinks down!", "[M] dwindles in size!", "[M] compresses down!")]</span>", "<span class='danger'>[pick("You feel your body compressing in size!", "The world pushes outwards in every direction!", "You feel your muscles contract, and your surroundings grow!")]</span>")
|
||||
..()
|
||||
. = 1
|
||||
88
hyperstation/code/modules/resize/sizegun.dm
Normal file
88
hyperstation/code/modules/resize/sizegun.dm
Normal file
@@ -0,0 +1,88 @@
|
||||
/obj/item/projectile/sizelaser
|
||||
name = "sizeray laser"
|
||||
icon_state = "omnilaser"
|
||||
hitsound = null
|
||||
damage = 5
|
||||
damage_type = STAMINA
|
||||
flag = "laser"
|
||||
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
|
||||
|
||||
//TO DO: make the size ray have a selection of a minimum size and maximum size, rather than two modes.
|
||||
/obj/item/projectile/sizelaser/shrinkray
|
||||
icon_state="bluelaser"
|
||||
|
||||
/obj/item/projectile/sizelaser/growthray
|
||||
icon_state="laser"
|
||||
|
||||
/obj/item/projectile/sizelaser/shrinkray/on_hit(var/atom/target, var/blocked = 0)
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
var/mob/living/M = target
|
||||
switch(M.size_multiplier)
|
||||
if(RESIZE_MACRO to INFINITY)
|
||||
M.resize(RESIZE_HUGE)
|
||||
if(RESIZE_HUGE to RESIZE_MACRO)
|
||||
M.resize(RESIZE_BIG)
|
||||
if(RESIZE_BIG to RESIZE_HUGE)
|
||||
M.resize(RESIZE_NORMAL)
|
||||
if(RESIZE_NORMAL to RESIZE_BIG)
|
||||
M.resize(RESIZE_SMALL)
|
||||
if(RESIZE_SMALL to RESIZE_NORMAL)
|
||||
M.resize(RESIZE_TINY)
|
||||
if(RESIZE_TINY to RESIZE_SMALL)
|
||||
M.resize(RESIZE_MICRO)
|
||||
if((0 - INFINITY) to RESIZE_NORMAL)
|
||||
M.resize(RESIZE_MICRO)
|
||||
M.update_transform()
|
||||
return TRUE
|
||||
|
||||
/obj/item/projectile/sizelaser/growthray/on_hit(var/atom/target, var/blocked = 0 )
|
||||
if(istype(target, /mob/living/carbon/human))
|
||||
var/mob/living/M = target
|
||||
switch(M.size_multiplier)
|
||||
if(RESIZE_HUGE to RESIZE_MACRO)
|
||||
M.resize(RESIZE_MACRO)
|
||||
if(RESIZE_BIG to RESIZE_HUGE)
|
||||
M.resize(RESIZE_HUGE)
|
||||
if(RESIZE_NORMAL to RESIZE_BIG)
|
||||
M.resize(RESIZE_BIG)
|
||||
if(RESIZE_SMALL to RESIZE_NORMAL)
|
||||
M.resize(RESIZE_NORMAL)
|
||||
if(RESIZE_TINY to RESIZE_SMALL)
|
||||
M.resize(RESIZE_SMALL)
|
||||
if(RESIZE_MICRO to RESIZE_TINY)
|
||||
M.resize(RESIZE_TINY)
|
||||
if((0 - INFINITY) to RESIZE_MICRO)
|
||||
M.resize(RESIZE_MICRO)
|
||||
M.update_transform()
|
||||
return TRUE
|
||||
|
||||
/obj/item/ammo_casing/energy/laser/growthray
|
||||
projectile_type = /obj/item/projectile/sizelaser/growthray
|
||||
select_name = "Growth"
|
||||
|
||||
/obj/item/ammo_casing/energy/laser/shrinkray
|
||||
projectile_type = /obj/item/projectile/sizelaser/shrinkray
|
||||
select_name = "Shrink"
|
||||
|
||||
//Gun
|
||||
/obj/item/gun/energy/laser/sizeray
|
||||
name = "size ray"
|
||||
icon = 'icons/obj/guns/energy.dmi'
|
||||
icon_state = "sizeshrink"
|
||||
desc = "An extremely-dangerous, almost-illegal size-altering device. You've either stolen this, or have the permits for it."
|
||||
item_state = null
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/shrinkray, /obj/item/ammo_casing/energy/laser/growthray)
|
||||
selfcharge = EGUN_SELFCHARGE
|
||||
charge_delay = 5
|
||||
ammo_x_offset = 2
|
||||
clumsy_check = 1
|
||||
|
||||
attackby(obj/item/W, mob/user)
|
||||
if(W==src)
|
||||
if(icon_state=="sizeshrink")
|
||||
icon_state="sizegrow"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/growthray)
|
||||
else
|
||||
icon_state="sizeshrink"
|
||||
ammo_type = list(/obj/item/ammo_casing/energy/laser/shrinkray)
|
||||
return ..()
|
||||
Reference in New Issue
Block a user