Buggy Sizecode Interactions 1

FUCK.
This commit is contained in:
Dahlular
2020-03-17 12:22:39 -06:00
parent 2979f20c49
commit 4d707fc18d
30 changed files with 889 additions and 244 deletions
@@ -0,0 +1,8 @@
// Micro Holders - Extends /obj/item/holder
/obj/item/clothing/head/mob_holder/micro
name = "micro"
desc = "Another person, small enough to fit in your hand."
icon = null // I forgot how to fix this.
icon_state = ""
slot_flags = ITEM_SLOT_FEET | ITEM_SLOT_HEAD | ITEM_SLOT_ID
@@ -0,0 +1,160 @@
//LETS GET THIS FUCKING SIZECONTENT GAMERS
var/const/RESIZE_MACRO = 6
var/const/RESIZE_HUGE = 4
var/const/RESIZE_BIG = 2
var/const/RESIZE_NORMAL = 1
var/const/RESIZE_SMALL = 0.75
var/const/RESIZE_TINY = 0.50
var/const/RESIZE_MICRO = 0.25
//averages
var/const/RESIZE_A_MACROHUGE = (RESIZE_MACRO + RESIZE_HUGE) / 2
var/const/RESIZE_A_HUGEBIG = (RESIZE_HUGE + RESIZE_BIG) / 2
var/const/RESIZE_A_BIGNORMAL = (RESIZE_BIG + RESIZE_NORMAL) / 2
var/const/RESIZE_A_NORMALSMALL = (RESIZE_NORMAL + RESIZE_SMALL) / 2
var/const/RESIZE_A_SMALLTINY = (RESIZE_SMALL + RESIZE_TINY) / 2
var/const/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
/mob/living/proc/resize(var/new_size, var/animate = TRUE)
if(size_multiplier == new_size)
return 1
size_multiplier = new_size //Change size_multiplier so that other items can interact with them
src.update_transform() //WORK DAMN YOU
//handle the big steppy, except nice
/mob/living/proc/handle_micro_bump_helping(var/mob/living/tmob)
//Both small.
if(src.get_effective_size() <= RESIZE_A_SMALLTINY && tmob.get_effective_size() <= RESIZE_A_SMALLTINY)
now_pushing = 0
src.forceMove(tmob.loc)
return 1
//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
src.forceMove(tmob.loc)
//Smaller person being stepped on
if(get_effective_size() > tmob.get_effective_size() && iscarbon(src))
if(istype(tmob) && istype(tmob, /datum/sprite_accessory/taur/naga))
to_chat(src,"<span class='notice'>You carefully slither around [tmob].</span>")
to_chat(tmob,"<span class='notice'>[src]'s huge tail slithers beside you!</span>")
else
to_chat(src,"<span class='notice'>You carefully step over [tmob].</span>")
to_chat(tmob,"<span class='notice'>[src] steps over you carefully!</span>")
return 1
//Smaller person stepping under a larger person
if(tmob.get_effective_size() > get_effective_size())
micro_step_under(tmob)
src.forceMove(tmob.loc)
now_pushing = 0
return 1
//Stepping on disarm intent
/mob/living/proc/handle_micro_bump_other(var/mob/living/tmob)
ASSERT(isliving(tmob))
//Both small
if(src.get_effective_size() <= RESIZE_A_SMALLTINY && tmob.get_effective_size() <= RESIZE_A_SMALLTINY)
now_pushing = 0
src.forceMove(tmob.loc)
return 1
if(abs(get_effective_size()/tmob.get_effective_size()) >= 2)
if(src.a_intent == "disarm" && src.canmove && !src.buckled)
now_pushing = 0
src.forceMove(tmob.loc)
if(get_effective_size() > tmob.get_effective_size() && iscarbon(src))
if(istype(tmob) && istype(tmob, /datum/sprite_accessory/taur/naga))
to_chat(src,"<span class='danger'>You carefully roll over [tmob] with your tail!</span>")
to_chat(tmob,"<span class='danger'>[src]'s huge tail rolls over you!</span>")
sizediffStamLoss(tmob)
else
to_chat(src,"<span class='danger'>You painfully but harmlessly step on [tmob]!<span>")
to_chat(tmob,"<span class='danger'>[src] steps onto you with force!</span>")
sizediffStamLoss(tmob)
return 1
if(src.a_intent == "harm" && src.canmove && !src.buckled)
now_pushing = 0
src.forceMove(tmob.loc)
if(get_effective_size() > tmob.get_effective_size() && iscarbon(src))
if(istype(tmob) && istype(tmob, /datum/sprite_accessory/taur/naga))
to_chat(src,"<span class='danger'>You grind [tmob] into the floor with your tail!</span>")
to_chat(tmob,"<span class='danger'>[src]'s massive tail plows you into the floor!</span>")
sizediffStamLoss(tmob)
sizediffBruteloss(tmob)
else
to_chat(src,"<span class='danger'>You pound [tmob] into the floor underfoot!</span>")
to_chat(tmob,"<span class='danger'>[src] slams you into the ground, crushing you!</span>")
sizediffStamLoss(tmob)
sizediffBruteloss(tmob)
return 1
// if(src.a_inent == "grab"... goes here
if(tmob.get_effective_size() > get_effective_size())
micro_step_under(tmob)
src.forceMove(tmob.loc)
now_pushing = 0
return 1
//smaller person stepping under another person
/mob/living/proc/micro_step_under(var/mob/living/tmob)
if(istype(tmob) && istype(tmob, /datum/sprite_accessory/taur/naga))
to_chat(src,"<span class='notice'>You jump over [tmob]'s thick tail.</span>")
to_chat(tmob,"<span class='notice'>[src] bounds over your tail.</span>")
else
to_chat(src,"<span class='notice'>You run between [tmob]'s legs.</span>")
to_chat(tmob,"<span class='notice'>[src] runs between your 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 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 2
tmob.adjustBruteLoss(B) //final result in brute loss
//Proc for picking up people. WIP.
/*
/mob/living/proc/attempt_to_scoop(var/mob/living/M)
var/sizediv = get_effective_size()/M.get_effective_size()
if(!holder_default && holder_type)
holder_default = holder_type
if(!istype(M))
return 0
if(buckled)
to_chat(src,"<span class='notice'>You have to unbuckle them before you can pick them up.</span>")
return 0
if(sizediv >= 2)
holder_type = /obj/item/holder/micro
var/obj/item/holder/m_holder = get_scooped(M)
holder_type = holder_default
if (m_holder)
return 1
else
return 0
*/
//Clothes coming off at different sizes, and health/speed/stam changes as well
@@ -0,0 +1,40 @@
//Size Chemicals, now with better and less cringy names.
/datum/reagent/dahl/growthchem
name = "Prospacillin"
id = "growthchem"
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
/datum/reagent/dahl/growthchem/on_mob_add(mob/living/carbon/M)
log_game("SIZECODE: [M] ckey: [M.key] has ingested growthchem.")
/datum/reagent/dahl/growthchem/on_mob_life(mob/living/carbon/M)
if(M.size_multiplier < RESIZE_MACRO)
M.resize(M.size_multiplier+0.01)
return
/datum/reagent/dahl/shrinkchem
name = "Diminicillin"
id = "shrinkchem"
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.25
can_synth = FALSE //SAME STORY AS ABOVE
/datum/reagent/dahl/shrinkchem/on_mob_add(mob/living/carbon/M)
log_game("SIZECODE: [M] ckey: [M.key] has ingested shrinkchem.")
/datum/reagent/dahl/shrinkchem/on_mob_life(mob/living/carbon/M)
if(M.size_multiplier > RESIZE_MICRO)
M.resize(M.size_multiplier-0.01)
return
@@ -0,0 +1,86 @@
/obj/item/projectile/sizelaser
name = "sizeray laser"
icon_state = "omnilaser"
hitsound = null
damage = 5
damage_type = STAMINA
flag = "laser"
pass_flags = PASSTABLE | PASSGLASS | PASSGRILLE
/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 1
/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 1
/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_state = "bluetag"
desc = "Debug size manipulator. You probably shouldn't have this!"
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=="bluetag")
icon_state="redtag"
ammo_type = list(/obj/item/ammo_casing/energy/laser/growthray)
else
icon_state="bluetag"
ammo_type = list(/obj/item/ammo_casing/energy/laser/shrinkray)
return ..()