mirror of
https://github.com/VOREStation/VOREStation.git
synced 2026-08-29 06:58:30 +01:00
Fixing radiation death and keeping glow
This commit is contained in:
@@ -73,4 +73,173 @@
|
||||
|
||||
spawn(1)
|
||||
if(H)
|
||||
H.gib()
|
||||
H.gib()
|
||||
|
||||
// Helpers - Unsafe, WILL perform change.
|
||||
/mob/living/carbon/human/proc/prommie_intoblob(force)
|
||||
if(!force && !isturf(loc))
|
||||
to_chat(src,"<span class='warning'>You can't change forms while inside something.</span>")
|
||||
return
|
||||
|
||||
handle_grasp() //It's possible to blob out before some key parts of the life loop. This results in things getting dropped at null. TODO: Fix the code so this can be done better.
|
||||
remove_micros(src, src) //Living things don't fare well in roblobs.
|
||||
if(buckled)
|
||||
buckled.unbuckle_mob()
|
||||
if(LAZYLEN(buckled_mobs))
|
||||
for(var/buckledmob in buckled_mobs)
|
||||
riding_datum.force_dismount(buckledmob)
|
||||
if(pulledby)
|
||||
pulledby.stop_pulling()
|
||||
stop_pulling()
|
||||
|
||||
//Record where they should go
|
||||
var/atom/creation_spot = drop_location()
|
||||
|
||||
//Create our new blob
|
||||
var/mob/living/simple_mob/slime/promethean/blob = new(creation_spot,src)
|
||||
|
||||
//Drop all our things
|
||||
var/list/things_to_drop = contents.Copy()
|
||||
var/list/things_to_not_drop = list(w_uniform,nif,l_store,r_store,wear_id,l_ear,r_ear) //And whatever else we decide for balancing.
|
||||
var/obj/item/clothing/head/new_hat
|
||||
var/has_hat = FALSE
|
||||
things_to_drop -= things_to_not_drop //Crunch the lists
|
||||
things_to_drop -= organs //Mah armbs
|
||||
things_to_drop -= internal_organs //Mah sqeedily spooch
|
||||
|
||||
for(var/obj/item/clothing/head/H in things_to_drop)
|
||||
if(H)
|
||||
new_hat = H
|
||||
has_hat = TRUE
|
||||
drop_from_inventory(H)
|
||||
things_to_drop -= H
|
||||
|
||||
for(var/obj/item/I in things_to_drop) //rip hoarders
|
||||
drop_from_inventory(I)
|
||||
//for(var/obj/item/clothing/head/H in things_to_not_drop)
|
||||
// drop_from_inventory(H)
|
||||
//if(H)
|
||||
// new_hat = H
|
||||
// has_hat = TRUE
|
||||
|
||||
if(w_uniform && istype(w_uniform,/obj/item/clothing)) //No webbings tho. We do this after in case a suit was in the way
|
||||
var/obj/item/clothing/uniform = w_uniform
|
||||
if(LAZYLEN(uniform.accessories))
|
||||
for(var/obj/item/clothing/accessory/A in uniform.accessories)
|
||||
if(is_type_in_list(A, disallowed_protean_accessories))
|
||||
uniform.remove_accessory(null,A) //First param is user, but adds fingerprints and messages
|
||||
|
||||
//Size update
|
||||
blob.transform = matrix()*size_multiplier
|
||||
blob.size_multiplier = size_multiplier
|
||||
|
||||
if(l_hand) blob.prev_left_hand = l_hand //Won't save them if dropped above, but necessary if handdrop is disabled.
|
||||
if(r_hand) blob.prev_right_hand = r_hand
|
||||
|
||||
//Put our owner in it (don't transfer var/mind)
|
||||
qdel(blob.ai_holder)
|
||||
|
||||
blob.ai_holder = null
|
||||
if(has_hat)
|
||||
blob.hat = new_hat
|
||||
new_hat.forceMove(src)
|
||||
blob.ckey = ckey
|
||||
blob.name = name
|
||||
blob.nutrition = nutrition
|
||||
blob.color = rgb(r_skin, g_skin, b_skin)
|
||||
blob.mood = ":3"
|
||||
if(radiation)
|
||||
blob.rad_glow = CLAMP(radiation,0,250)
|
||||
blob.glow_intensity = max(1,min(5,blob.rad_glow/15))
|
||||
blob.glow_range = max(1,min(10,blob.rad_glow/25))
|
||||
blob.glow_toggle = TRUE
|
||||
set_light(0)
|
||||
blob.set_light(max(1,min(5,radiation/15)), max(1,min(10,radiation/25)), blob.color)
|
||||
blob.handle_light()
|
||||
blob.update_icon()
|
||||
blob.verbs -= /mob/living/proc/ventcrawl // Absolutely not.
|
||||
blob.verbs -= /mob/living/simple_mob/proc/set_name // We already have a name.
|
||||
temporary_form = blob
|
||||
|
||||
//Mail them to nullspace
|
||||
moveToNullspace()
|
||||
|
||||
//Message
|
||||
blob.visible_message("<b>[src.name]</b> squishes into their true form!")
|
||||
|
||||
//Transfer vore organs
|
||||
blob.vore_organs = vore_organs
|
||||
blob.vore_selected = vore_selected
|
||||
for(var/obj/belly/B as anything in vore_organs)
|
||||
B.forceMove(blob)
|
||||
B.owner = blob
|
||||
|
||||
//We can still speak our languages!
|
||||
blob.languages = languages.Copy()
|
||||
|
||||
//Return our blob in case someone wants it
|
||||
return blob
|
||||
|
||||
mob/living/carbon/human/proc/prommie_outofblob(var/mob/living/simple_mob/slime/promethean/blob, force)
|
||||
if(!istype(blob))
|
||||
return
|
||||
|
||||
if(!force && !isturf(blob.loc))
|
||||
to_chat(blob,"<span class='warning'>You can't change forms while inside something.</span>")
|
||||
return
|
||||
|
||||
if(buckled)
|
||||
buckled.unbuckle_mob()
|
||||
if(LAZYLEN(buckled_mobs))
|
||||
for(var/buckledmob in buckled_mobs)
|
||||
riding_datum.force_dismount(buckledmob)
|
||||
if(pulledby)
|
||||
pulledby.stop_pulling()
|
||||
stop_pulling()
|
||||
|
||||
//Message
|
||||
blob.visible_message("<b>[src.name]</b> pulls together, forming a humanoid shape!")
|
||||
|
||||
//Record where they should go
|
||||
var/atom/reform_spot = blob.drop_location()
|
||||
|
||||
//Size update
|
||||
resize(blob.size_multiplier, FALSE, ignore_prefs = TRUE)
|
||||
|
||||
//Move them back where the blob was
|
||||
forceMove(reform_spot)
|
||||
|
||||
//Put our owner in it (don't transfer var/mind)
|
||||
ckey = blob.ckey
|
||||
var/obj/item/hat = blob.hat
|
||||
blob.drop_hat()
|
||||
drop_from_inventory(hat) // Hat me baby
|
||||
equip_to_slot_if_possible(hat, slot_head)
|
||||
nutrition = blob.nutrition // food good
|
||||
|
||||
|
||||
temporary_form = null
|
||||
|
||||
shapeshifter_set_colour(blob.color)
|
||||
if(blob.rad_glow)
|
||||
radiation = CLAMP(blob.rad_glow,0,250)
|
||||
set_light(max(1,min(5,radiation/15)), max(1,min(10,radiation/25)), species.get_flesh_colour(src))
|
||||
update_icon()
|
||||
|
||||
//Transfer vore organs
|
||||
vore_selected = blob.vore_selected
|
||||
for(var/obj/belly/B as anything in blob.vore_organs)
|
||||
B.forceMove(src)
|
||||
B.owner = src
|
||||
|
||||
//vore_organs.Cut()
|
||||
if(blob.prev_left_hand) put_in_l_hand(blob.prev_left_hand) //The restore for when reforming.
|
||||
if(blob.prev_right_hand) put_in_r_hand(blob.prev_right_hand)
|
||||
|
||||
Life(1) //Fix my blindness right meow //Has to be moved up here, there exists a circumstance where blob could be deleted without vore organs moving right.
|
||||
|
||||
//Get rid of friend blob
|
||||
qdel(blob)
|
||||
|
||||
//Return ourselves in case someone wants it
|
||||
return src
|
||||
@@ -9,7 +9,7 @@
|
||||
water_resist = 100 // Lets not kill the prommies
|
||||
cores = 0
|
||||
movement_cooldown = 3
|
||||
appearance_flags = RADIATION_GLOWS
|
||||
//appearance_flags = RADIATION_GLOWS
|
||||
shock_resist = 0 // Lets not be immune to zaps.
|
||||
friendly = list("nuzzles", "glomps", "snuggles", "cuddles", "squishes") // lets be cute :3
|
||||
melee_damage_upper = 0
|
||||
@@ -17,6 +17,8 @@
|
||||
player_msg = "You're a little squisher! Your cuteness level has increased tenfold."
|
||||
heat_damage_per_tick = 20 // Hot and cold are bad, but cold is AS bad for prommies as it is for slimes.
|
||||
cold_damage_per_tick = 20
|
||||
//glow_range = 0
|
||||
//glow_intensity = 0
|
||||
|
||||
var/mob/living/carbon/human/humanform
|
||||
var/datum/modifier/healing
|
||||
@@ -26,6 +28,7 @@
|
||||
var/human_brute = 0
|
||||
var/human_burn = 0
|
||||
var/is_wide = FALSE
|
||||
var/rad_glow = 0
|
||||
|
||||
var/list/default_emotes = list(
|
||||
/decl/emote/audible/squish,
|
||||
@@ -50,18 +53,25 @@
|
||||
verbs += /mob/living/simple_mob/slime/promethean/proc/toggle_shine
|
||||
update_mood()
|
||||
glow_color = color
|
||||
handle_light()
|
||||
if(rad_glow)
|
||||
rad_glow = CLAMP(rad_glow,0,250)
|
||||
set_light(max(1,min(5,rad_glow/15)), max(1,min(10,rad_glow/25)), color)
|
||||
update_icon()
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_mob/slime/promethean/update_icon()
|
||||
icon_living = "[icon_state_override ? "[icon_state_override] slime" : "slime"] [is_wide ? "adult" : "baby"][""]"
|
||||
//if(rad_glow)
|
||||
// set_light(max(1,min(5,rad_glow/15)), max(1,min(10,rad_glow/25)), color)
|
||||
//else
|
||||
// set_light(0)
|
||||
..()
|
||||
|
||||
/mob/living/simple_mob/slime/promethean/Destroy()
|
||||
humanform = null
|
||||
vore_organs = null
|
||||
vore_selected = null
|
||||
set_light(0)
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_mob/slime/promethean/Stat()
|
||||
@@ -70,6 +80,11 @@
|
||||
humanform.species.Stat(humanform)
|
||||
|
||||
/mob/living/simple_mob/slime/promethean/handle_special() // Should disable default slime healing, we'll use nutrition based heals instead.
|
||||
if(rad_glow)
|
||||
rad_glow = CLAMP(rad_glow,0,250)
|
||||
set_light(max(1,min(5,rad_glow/15)), max(1,min(10,rad_glow/25)), color)
|
||||
else
|
||||
set_light(0)
|
||||
return
|
||||
|
||||
//Constructor allows passing the human to sync damages
|
||||
@@ -82,167 +97,6 @@
|
||||
else
|
||||
update_icon()
|
||||
|
||||
// Helpers - Unsafe, WILL perform change.
|
||||
/mob/living/carbon/human/proc/prommie_intoblob(force)
|
||||
if(!force && !isturf(loc))
|
||||
to_chat(src,"<span class='warning'>You can't change forms while inside something.</span>")
|
||||
return
|
||||
|
||||
handle_grasp() //It's possible to blob out before some key parts of the life loop. This results in things getting dropped at null. TODO: Fix the code so this can be done better.
|
||||
remove_micros(src, src) //Living things don't fare well in roblobs.
|
||||
if(buckled)
|
||||
buckled.unbuckle_mob()
|
||||
if(LAZYLEN(buckled_mobs))
|
||||
for(var/buckledmob in buckled_mobs)
|
||||
riding_datum.force_dismount(buckledmob)
|
||||
if(pulledby)
|
||||
pulledby.stop_pulling()
|
||||
stop_pulling()
|
||||
|
||||
//Record where they should go
|
||||
var/atom/creation_spot = drop_location()
|
||||
|
||||
//Create our new blob
|
||||
var/mob/living/simple_mob/slime/promethean/blob = new(creation_spot,src)
|
||||
|
||||
//Drop all our things
|
||||
var/list/things_to_drop = contents.Copy()
|
||||
var/list/things_to_not_drop = list(w_uniform,nif,l_store,r_store,wear_id,l_ear,r_ear) //And whatever else we decide for balancing.
|
||||
var/obj/item/clothing/head/new_hat
|
||||
var/has_hat = FALSE
|
||||
things_to_drop -= things_to_not_drop //Crunch the lists
|
||||
things_to_drop -= organs //Mah armbs
|
||||
things_to_drop -= internal_organs //Mah sqeedily spooch
|
||||
|
||||
for(var/obj/item/clothing/head/H in things_to_drop)
|
||||
if(H)
|
||||
new_hat = H
|
||||
has_hat = TRUE
|
||||
drop_from_inventory(H)
|
||||
things_to_drop -= H
|
||||
|
||||
for(var/obj/item/I in things_to_drop) //rip hoarders
|
||||
drop_from_inventory(I)
|
||||
//for(var/obj/item/clothing/head/H in things_to_not_drop)
|
||||
// drop_from_inventory(H)
|
||||
//if(H)
|
||||
// new_hat = H
|
||||
// has_hat = TRUE
|
||||
|
||||
if(w_uniform && istype(w_uniform,/obj/item/clothing)) //No webbings tho. We do this after in case a suit was in the way
|
||||
var/obj/item/clothing/uniform = w_uniform
|
||||
if(LAZYLEN(uniform.accessories))
|
||||
for(var/obj/item/clothing/accessory/A in uniform.accessories)
|
||||
if(is_type_in_list(A, disallowed_protean_accessories))
|
||||
uniform.remove_accessory(null,A) //First param is user, but adds fingerprints and messages
|
||||
|
||||
//Size update
|
||||
blob.transform = matrix()*size_multiplier
|
||||
blob.size_multiplier = size_multiplier
|
||||
|
||||
if(l_hand) blob.prev_left_hand = l_hand //Won't save them if dropped above, but necessary if handdrop is disabled.
|
||||
if(r_hand) blob.prev_right_hand = r_hand
|
||||
|
||||
//Put our owner in it (don't transfer var/mind)
|
||||
qdel(blob.ai_holder)
|
||||
blob.ai_holder = null
|
||||
if(has_hat)
|
||||
blob.hat = new_hat
|
||||
//unEquip(new_hat)
|
||||
new_hat.forceMove(src)
|
||||
blob.ckey = ckey
|
||||
blob.name = name
|
||||
blob.nutrition = nutrition
|
||||
blob.color = rgb(r_skin, g_skin, b_skin)
|
||||
blob.mood = ":3"
|
||||
|
||||
|
||||
blob.update_icon()
|
||||
blob.verbs -= /mob/living/proc/ventcrawl // Absolutely not.
|
||||
//blob.verbs -= /mob/living/simple_mob/slime/xenobio/verb/evolve // We aren't really xenobio, so none of this.
|
||||
//blob.verbs -= /mob/living/simple_mob/slime/xenobio/verb/reproduce
|
||||
blob.verbs -= /mob/living/simple_mob/proc/set_name // We already have a name.
|
||||
temporary_form = blob
|
||||
|
||||
//Mail them to nullspace
|
||||
moveToNullspace()
|
||||
|
||||
//Message
|
||||
blob.visible_message("<b>[src.name]</b> squishes into their true form!")
|
||||
|
||||
//Transfer vore organs
|
||||
blob.vore_organs = vore_organs
|
||||
blob.vore_selected = vore_selected
|
||||
for(var/obj/belly/B as anything in vore_organs)
|
||||
B.forceMove(blob)
|
||||
B.owner = blob
|
||||
|
||||
//We can still speak our languages!
|
||||
blob.languages = languages.Copy()
|
||||
|
||||
//Return our blob in case someone wants it
|
||||
return blob
|
||||
|
||||
mob/living/carbon/human/proc/prommie_outofblob(var/mob/living/simple_mob/slime/promethean/blob, force)
|
||||
if(!istype(blob))
|
||||
return
|
||||
|
||||
if(!force && !isturf(blob.loc))
|
||||
to_chat(blob,"<span class='warning'>You can't change forms while inside something.</span>")
|
||||
return
|
||||
|
||||
if(buckled)
|
||||
buckled.unbuckle_mob()
|
||||
if(LAZYLEN(buckled_mobs))
|
||||
for(var/buckledmob in buckled_mobs)
|
||||
riding_datum.force_dismount(buckledmob)
|
||||
if(pulledby)
|
||||
pulledby.stop_pulling()
|
||||
stop_pulling()
|
||||
|
||||
//Message
|
||||
blob.visible_message("<b>[src.name]</b> pulls together, forming a humanoid shape!")
|
||||
|
||||
//Record where they should go
|
||||
var/atom/reform_spot = blob.drop_location()
|
||||
|
||||
//Size update
|
||||
resize(blob.size_multiplier, FALSE, ignore_prefs = TRUE)
|
||||
|
||||
//Move them back where the blob was
|
||||
forceMove(reform_spot)
|
||||
|
||||
//Put our owner in it (don't transfer var/mind)
|
||||
ckey = blob.ckey
|
||||
var/obj/item/hat = blob.hat
|
||||
blob.drop_hat()
|
||||
drop_from_inventory(hat) // Hat me baby
|
||||
equip_to_slot_if_possible(hat, slot_head)
|
||||
nutrition = blob.nutrition // food good
|
||||
temporary_form = null
|
||||
|
||||
shapeshifter_set_colour(blob.color)
|
||||
|
||||
update_icon()
|
||||
|
||||
//Transfer vore organs
|
||||
vore_selected = blob.vore_selected
|
||||
for(var/obj/belly/B as anything in blob.vore_organs)
|
||||
B.forceMove(src)
|
||||
B.owner = src
|
||||
|
||||
//vore_organs.Cut()
|
||||
if(blob.prev_left_hand) put_in_l_hand(blob.prev_left_hand) //The restore for when reforming.
|
||||
if(blob.prev_right_hand) put_in_r_hand(blob.prev_right_hand)
|
||||
|
||||
Life(1) //Fix my blindness right meow //Has to be moved up here, there exists a circumstance where blob could be deleted without vore organs moving right.
|
||||
|
||||
//Get rid of friend blob
|
||||
qdel(blob)
|
||||
|
||||
//Return ourselves in case someone wants it
|
||||
return src
|
||||
|
||||
/mob/living/simple_mob/slime/promethean/updatehealth()
|
||||
if(!humanform)
|
||||
return ..()
|
||||
@@ -341,10 +195,10 @@ mob/living/carbon/human/proc/prommie_outofblob(var/mob/living/simple_mob/slime/p
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_mob/slime/promethean/rad_act(severity)
|
||||
if(humanform)
|
||||
return humanform.ex_act(severity)
|
||||
else
|
||||
return ..()
|
||||
rad_glow += severity
|
||||
rad_glow = CLAMP(rad_glow,0,250)
|
||||
if(rad_glow)
|
||||
set_light(max(1,min(5,rad_glow/15)), max(1,min(10,rad_glow/25)), color)
|
||||
|
||||
/mob/living/simple_mob/slime/promethean/bullet_act(obj/item/projectile/P)
|
||||
if(humanform)
|
||||
@@ -352,7 +206,7 @@ mob/living/carbon/human/proc/prommie_outofblob(var/mob/living/simple_mob/slime/p
|
||||
else
|
||||
return ..()
|
||||
|
||||
/mob/living/simple_mob/slime/promethean/death(gibbed, deathmessage = "dissolves away, leaving only a few spare parts!")
|
||||
/mob/living/simple_mob/slime/promethean/death(gibbed, deathmessage = "rapidly loses cohesion, splattering across the ground...")
|
||||
if(humanform)
|
||||
humanform.death(gibbed, deathmessage)
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user