mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Good code going for test merge
This commit is contained in:
@@ -84,7 +84,7 @@
|
||||
handle_shock()
|
||||
|
||||
handle_pain()
|
||||
|
||||
|
||||
handle_allergens()
|
||||
|
||||
handle_medical_side_effects()
|
||||
@@ -573,12 +573,12 @@
|
||||
else
|
||||
failed_last_breath = 0
|
||||
adjustOxyLoss(-5)
|
||||
|
||||
|
||||
if(!does_not_breathe && client) // If we breathe, and have an active client, check if we have synthetic lungs.
|
||||
var/obj/item/organ/internal/lungs/L = internal_organs_by_name[O_LUNGS]
|
||||
var/turf = get_turf(src)
|
||||
var/turf = get_turf(src)
|
||||
var/mob/living/carbon/human/M = src
|
||||
if(L.robotic < ORGAN_ROBOT && is_below_sound_pressure(turf) && M.internal) // Only non-synthetic lungs, please, and only play these while the pressure is below that which we can hear sounds normally AND we're on internals.
|
||||
if(L.robotic < ORGAN_ROBOT && is_below_sound_pressure(turf) && M.internal) // Only non-synthetic lungs, please, and only play these while the pressure is below that which we can hear sounds normally AND we're on internals.
|
||||
if(!failed_inhale && (world.time >= (last_breath_sound + 7 SECONDS))) // Were we able to inhale successfully? Play inhale.
|
||||
var/exhale = failed_exhale // Pass through if we passed exhale or not
|
||||
play_inhale(M, exhale)
|
||||
@@ -649,25 +649,25 @@
|
||||
|
||||
breath.update_values()
|
||||
return 1
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/play_inhale(var/mob/living/M, var/exhale)
|
||||
var/suit_inhale_sound
|
||||
if(species.suit_inhale_sound)
|
||||
suit_inhale_sound = species.suit_inhale_sound
|
||||
else // Failsafe
|
||||
suit_inhale_sound = 'sound/effects/mob_effects/suit_breathe_in.ogg'
|
||||
|
||||
|
||||
playsound_local(get_turf(src), suit_inhale_sound, 100, pressure_affected = FALSE, volume_channel = VOLUME_CHANNEL_AMBIENCE)
|
||||
if(!exhale) // Did we fail exhale? If no, play it after inhale finishes.
|
||||
addtimer(CALLBACK(src, .proc/play_exhale, M), 5 SECONDS)
|
||||
|
||||
|
||||
/mob/living/carbon/human/proc/play_exhale(var/mob/living/M)
|
||||
var/suit_exhale_sound
|
||||
if(species.suit_exhale_sound)
|
||||
suit_exhale_sound = species.suit_exhale_sound
|
||||
else // Failsafe
|
||||
suit_exhale_sound = 'sound/effects/mob_effects/suit_breathe_out.ogg'
|
||||
|
||||
|
||||
playsound_local(get_turf(src), suit_exhale_sound, 100, pressure_affected = FALSE, volume_channel = VOLUME_CHANNEL_AMBIENCE)
|
||||
|
||||
/mob/living/carbon/human/proc/handle_allergens()
|
||||
@@ -1100,7 +1100,7 @@
|
||||
return 1
|
||||
|
||||
//UNCONSCIOUS. NO-ONE IS HOME
|
||||
if((getOxyLoss() > (species.total_health/2)) || (health <= config.health_threshold_crit))
|
||||
if((getOxyLoss() > (species.total_health/2)) || (health <= (config.health_threshold_crit * species.crit_mod)))
|
||||
Paralyse(3)
|
||||
|
||||
if(hallucination)
|
||||
@@ -1661,12 +1661,12 @@
|
||||
if(status_flags & GODMODE) return 0 //godmode
|
||||
if(!can_feel_pain()) return
|
||||
|
||||
if(health < config.health_threshold_softcrit)// health 0 makes you immediately collapse
|
||||
if(health < (config.health_threshold_softcrit * species.crit_mod))// health 0 makes you immediately collapse //CHOMPEdit
|
||||
shock_stage = max(shock_stage, 61)
|
||||
|
||||
if(traumatic_shock >= 80)
|
||||
shock_stage += 1
|
||||
else if(health < config.health_threshold_softcrit)
|
||||
else if(health < (config.health_threshold_softcrit * species.crit_mod)) //CHOMPEdit - Why is this here twice, hello? Polaris?
|
||||
shock_stage = max(shock_stage, 61)
|
||||
else
|
||||
shock_stage = min(shock_stage, 160)
|
||||
|
||||
@@ -0,0 +1,2 @@
|
||||
/datum/species
|
||||
var/crit_mod = 1
|
||||
@@ -61,10 +61,8 @@
|
||||
humanform = H
|
||||
updatehealth()
|
||||
refactory = locate() in humanform.internal_organs
|
||||
// verbs |= /mob/living/proc/ventcrawl //CHOMP Removal
|
||||
verbs |= /mob/living/proc/hide
|
||||
verbs |= /mob/living/simple_mob/protean_blob/proc/rig_transform //CHOMP Addition
|
||||
verbs |= /mob/living/proc/usehardsuit //CHOMP Addition
|
||||
verbs |= /mob/living/proc/usehardsuit
|
||||
else
|
||||
update_icon()
|
||||
|
||||
@@ -414,25 +412,6 @@ var/global/list/disallowed_protean_accessories = list(
|
||||
if(istype(I, /obj/item/weapon/holder))
|
||||
root.remove_from_mob(I)
|
||||
|
||||
//CHOMP Add start
|
||||
/mob/living/simple_mob/protean_blob/proc/rig_transform() //CHOMP Add this whole block.
|
||||
set name = "Modify Form - Hardsuit"
|
||||
set desc = "Allows a protean blob to solidify its form into one extremely similar to a hardsuit."
|
||||
set category = "Abilities"
|
||||
|
||||
if(istype(loc, /obj/item/weapon/rig/protean))
|
||||
var/obj/item/weapon/rig/protean/prig = loc
|
||||
src.forceMove(get_turf(prig))
|
||||
qdel(prig)
|
||||
return
|
||||
|
||||
if(isturf(loc))
|
||||
var/obj/item/weapon/rig/protean/prig = new(loc)
|
||||
if(prig)
|
||||
prig.forceMove(get_turf(src))
|
||||
src.forceMove(prig)
|
||||
return
|
||||
|
||||
/mob/living/proc/usehardsuit()
|
||||
set name = "Utilize Hardsuit Interface"
|
||||
set desc = "Allows a protean blob to open hardsuit interface."
|
||||
|
||||
@@ -7,7 +7,7 @@
|
||||
set name = "Ref - Single Limb"
|
||||
set desc = "Allows you to replace and reshape your limbs as you see fit."
|
||||
set category = "Abilities"
|
||||
set hidden = TRUE
|
||||
set hidden = 1
|
||||
|
||||
if(stat)
|
||||
to_chat(src,"<span class='warning'>You must be awake and standing to perform this action!</span>")
|
||||
@@ -42,7 +42,7 @@
|
||||
qdel(oldlimb)
|
||||
|
||||
var/mob/living/simple_mob/protean_blob/blob = nano_intoblob()
|
||||
active_regen = TRUE
|
||||
active_regen = 1
|
||||
if(do_after(blob,5 SECONDS))
|
||||
var/list/limblist = species.has_limbs[choice]
|
||||
var/limbpath = limblist["path"]
|
||||
@@ -51,7 +51,7 @@
|
||||
new_eo.robotize(synthetic ? synthetic.company : null) //Use the base we started with
|
||||
new_eo.sync_colour_to_human(src)
|
||||
regenerate_icons()
|
||||
active_regen = FALSE
|
||||
active_regen = 0
|
||||
nano_outofblob(blob)
|
||||
return
|
||||
|
||||
@@ -81,108 +81,11 @@
|
||||
visible_message("<B>[src]</B>'s [choice] loses its shape, then reforms.")
|
||||
update_icons_body()
|
||||
|
||||
////
|
||||
// Full Refactor
|
||||
////
|
||||
/*
|
||||
/mob/living/carbon/human/proc/nano_regenerate()
|
||||
set name = "Regenerate"
|
||||
set desc = "Allows you to regrow limbs and replace organs."
|
||||
set category = "Abilities"
|
||||
set hidden = TRUE
|
||||
|
||||
if(nutrition < 250)
|
||||
to_chat(src, "<span class='warning'>You lack the energy to begin regeneration!</span>")
|
||||
return
|
||||
|
||||
if(active_regen)
|
||||
to_chat(src, "<span class='warning'>You are already regenerating!</span>")
|
||||
return
|
||||
else
|
||||
active_regen = TRUE
|
||||
src.visible_message("<B>[src]</B>'s nanites begin to regenerate...")
|
||||
|
||||
|
||||
var/mob/living/simple_mob/protean_blob/blob = nano_intoblob()
|
||||
var/delay_length = round(active_regen_delay * species.active_regen_mult)
|
||||
if(do_after(blob, delay_length, null, 0))
|
||||
if(stat != DEAD)
|
||||
adjust_nutrition(-200)
|
||||
species.create_organs(src)
|
||||
var/obj/item/organ/external/torso = organs_by_name[BP_TORSO]
|
||||
torso.robotize() //synthetic wasn't defined here.
|
||||
LAZYCLEARLIST(blood_DNA)
|
||||
LAZYCLEARLIST(feet_blood_DNA)
|
||||
blood_color = null
|
||||
feet_blood_color = null
|
||||
regenerate_icons() //Probably worth it, yeah.
|
||||
to_chat(src, "<span class='notice'>Your regeneration is complete.</span>") //Guarantees the message shows no matter how bad the timing.
|
||||
to_chat(blob, "<span class='notice'>Your regeneration is complete!</span>")
|
||||
else
|
||||
to_chat(src, "<span class='critical'>Your regeneration has failed.</span>")
|
||||
to_chat(blob, "<span class='critical'>Your regeneration has failed!</span>")
|
||||
else
|
||||
to_chat(src, "<span class='critical'>Your regeneration is interrupted.</span>")
|
||||
to_chat(blob, "<span class='critical'>Your regeneration is interrupted!</span>")
|
||||
active_regen = FALSE
|
||||
nano_outofblob(blob)
|
||||
|
||||
|
||||
|
||||
var/delay_length = round(active_regen_delay * species.active_regen_mult)
|
||||
if(do_after(src,delay_length))
|
||||
adjust_nutrition(-200)
|
||||
|
||||
for(var/obj/item/organ/I in internal_organs)
|
||||
if(I.robotic >= ORGAN_ROBOT) // No free robofix.
|
||||
continue
|
||||
if(I.damage > 0)
|
||||
I.damage = max(I.damage - 30, 0) //Repair functionally half of a dead internal organ.
|
||||
I.status = 0 // Wipe status, as it's being regenerated from possibly dead.
|
||||
to_chat(src, "<span class='notice'>You feel a soothing sensation within your [I.name]...</span>")
|
||||
|
||||
// Replace completely missing limbs.
|
||||
for(var/limb_type in src.species.has_limbs)
|
||||
var/obj/item/organ/external/E = src.organs_by_name[limb_type]
|
||||
|
||||
if(E && E.disfigured)
|
||||
E.disfigured = 0
|
||||
if(E && (E.is_stump() || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD|ORGAN_MUTATED))))
|
||||
E.removed()
|
||||
qdel(E)
|
||||
E = null
|
||||
if(!E)
|
||||
var/list/organ_data = src.species.has_limbs[limb_type]
|
||||
var/limb_path = organ_data["path"]
|
||||
var/obj/item/organ/O = new limb_path(src)
|
||||
organ_data["descriptor"] = O.name
|
||||
to_chat(src, "<span class='notice'>You feel a slithering sensation as your [O.name] reform.</span>")
|
||||
|
||||
var/agony_to_apply = round(0.66 * O.max_damage) // 66% of the limb's health is converted into pain.
|
||||
src.apply_damage(agony_to_apply, HALLOSS)
|
||||
|
||||
for(var/organtype in species.has_organ) // Replace completely missing internal organs. -After- external ones, so they all should exist.
|
||||
if(!src.internal_organs_by_name[organtype])
|
||||
var/organpath = species.has_organ[organtype]
|
||||
var/obj/item/organ/Int = new organpath(src, TRUE)
|
||||
|
||||
Int.rejuvenate(TRUE)
|
||||
|
||||
handle_organs() // Update everything
|
||||
|
||||
update_icons_body()
|
||||
active_regen = FALSE
|
||||
else
|
||||
to_chat(src, "<span class='critical'>Your regeneration is interrupted!</span>")
|
||||
adjust_nutrition(-75)
|
||||
active_regen = FALSE
|
||||
*/
|
||||
|
||||
/mob/living/carbon/human/proc/nano_regenerate() //fixed the proc, it used to leave active_regen true.
|
||||
set name = "Ref - Whole Body"
|
||||
set desc = "Allows you to regrow limbs and replace organs, given you have enough materials."
|
||||
set category = "Abilities"
|
||||
set hidden = TRUE
|
||||
set hidden = 1
|
||||
|
||||
|
||||
|
||||
@@ -233,13 +136,13 @@
|
||||
visible_message("<B>[src]</B>'s form collapses into an amorphous blob of black ichor...")
|
||||
|
||||
var/mob/living/simple_mob/protean_blob/blob = nano_intoblob()
|
||||
active_regen = TRUE
|
||||
active_regen = 1
|
||||
if(do_after(blob,5 SECONDS))
|
||||
synthetic = usable_manufacturers[manu_choice]
|
||||
torso.robotize(manu_choice) //Will cascade to all other organs.
|
||||
regenerate_icons()
|
||||
visible_message("<B>[src]</B>'s form reshapes into a new one...")
|
||||
active_regen = FALSE
|
||||
active_regen = 0
|
||||
nano_outofblob(blob)
|
||||
return
|
||||
|
||||
@@ -251,7 +154,7 @@
|
||||
var/delay_length = round(active_regen_delay * species.active_regen_mult)
|
||||
to_chat(src, "<span class='danger'>Remain still while the process takes place! It will take [delay_length/10] seconds.</span>")
|
||||
visible_message("<B>[src]</B>'s form begins to shift and ripple as if made of oil...")
|
||||
active_regen = TRUE
|
||||
active_regen = 1
|
||||
|
||||
var/mob/living/simple_mob/protean_blob/blob = nano_intoblob()
|
||||
if(do_after(blob, delay_length, null, 0))
|
||||
@@ -278,7 +181,7 @@
|
||||
else
|
||||
to_chat(src, "<span class='critical'>Your refactoring is interrupted.</span>")
|
||||
to_chat(blob, "<span class='critical'>Your refactoring is interrupted!</span>")
|
||||
active_regen = FALSE
|
||||
active_regen = 0
|
||||
nano_outofblob(blob)
|
||||
|
||||
////
|
||||
@@ -288,7 +191,7 @@
|
||||
set name = "Ref - Store Metals"
|
||||
set desc = "If you're holding a stack of material, you can consume some and store it for later."
|
||||
set category = "Abilities"
|
||||
set hidden = TRUE
|
||||
set hidden = 1
|
||||
|
||||
var/obj/item/organ/internal/nano/refactory/refactory = nano_get_refactory()
|
||||
//Missing the organ that does this
|
||||
@@ -303,9 +206,9 @@
|
||||
|
||||
var/obj/item/stack/material/matstack = held
|
||||
var/substance = matstack.material.name
|
||||
var allowed = FALSE
|
||||
var allowed = 0
|
||||
for(var/material in PROTEAN_EDIBLE_MATERIALS)
|
||||
if(material == substance) allowed = TRUE
|
||||
if(material == substance) allowed = 1
|
||||
if(!allowed)
|
||||
to_chat(src,"<span class='warning'>You can't process [substance]!</span>")
|
||||
return //Only a few things matter, the rest are best not cluttering the lists.
|
||||
@@ -332,7 +235,7 @@
|
||||
set name = "Toggle Blobform"
|
||||
set desc = "Switch between amorphous and humanoid forms."
|
||||
set category = "Abilities"
|
||||
set hidden = TRUE
|
||||
set hidden = 1
|
||||
|
||||
var/atom/movable/to_locate = temporary_form || src
|
||||
if(!isturf(to_locate.loc))
|
||||
@@ -374,6 +277,51 @@
|
||||
species?.base_species = new_species // Really though you better have a species
|
||||
regenerate_icons() //Expensive, but we need to recrunch all the icons we're wearing
|
||||
|
||||
////
|
||||
// Rig Transform
|
||||
////
|
||||
/mob/living/carbon/human/proc/nano_rig_transform()
|
||||
set name = "Modify Form - Hardsuit"
|
||||
set desc = "Allows a protean to retract its mass into its hardsuit module at will."
|
||||
set category = "Abilities"
|
||||
set hidden = 1
|
||||
|
||||
if(!temporary_form) //If you're human, force you into blob form before rig'ing
|
||||
nano_blobform()
|
||||
spawn(2)
|
||||
|
||||
|
||||
if(istype(src.species, /datum/species/protean))
|
||||
var/datum/species/protean/S = src.species
|
||||
var/mob/living/simple_mob/protean_blob/P = temporary_form
|
||||
if(S.OurRig) //Do we even have a RIG?
|
||||
if(P.loc == S.OurRig) //we're inside our own RIG
|
||||
message_admins("WE 1")
|
||||
if(S.OurRig.wearer) //We're being worn. Engulf em', if prefs align.. otherwise just drop off.
|
||||
message_admins("WE 2")
|
||||
var/mob/living/carbon/human/victim = S.OurRig.wearer
|
||||
victim.drop_from_inventory(S.OurRig)
|
||||
if(P.can_be_drop_pred && victim.devourable && victim.can_be_drop_prey)
|
||||
message_admins("WE VORE")
|
||||
if(P.vore_selected)
|
||||
perform_the_nom(P,victim,P,P.vore_selected,1)
|
||||
message_admins("WE 3")
|
||||
P.forceMove(get_turf(S.OurRig))
|
||||
S.OurRig.forceMove(src)
|
||||
S.OurRig.myprotean = null
|
||||
src.equip_to_slot_if_possible(S.OurRig, slot_back)
|
||||
else //We're not in our own RIG
|
||||
if(P.stat)
|
||||
to_chat(P,"<span class='warning'>You can only do this while not stunned.</span>")
|
||||
else
|
||||
S.OurRig.myprotean = P
|
||||
src.drop_from_inventory(S.OurRig)
|
||||
P.forceMove(S.OurRig)
|
||||
P.reset_view()
|
||||
else //Make one if not
|
||||
to_chat(temporary_form, "<span class='warning'>You somehow didn't have a RIG, a new one has been created for you. Try this verb again.</span>")
|
||||
new /obj/item/weapon/rig/protean(src,src)
|
||||
|
||||
////
|
||||
// Change size
|
||||
////
|
||||
@@ -381,7 +329,7 @@
|
||||
/mob/living/carbon/human/proc/nano_set_size()
|
||||
set name = "Adjust Volume"
|
||||
set category = "Abilities"
|
||||
set hidden = TRUE
|
||||
set hidden = 1
|
||||
|
||||
var/mob/living/user = temporary_form || src
|
||||
|
||||
@@ -409,14 +357,14 @@
|
||||
//Sizing up
|
||||
if(cost > 0)
|
||||
if(refactory.use_stored_material(MAT_STEEL,cost))
|
||||
user.resize(size_factor, ignore_prefs = TRUE)
|
||||
user.resize(size_factor, ignore_prefs = 1)
|
||||
else
|
||||
to_chat(user,"<span class='warning'>That size change would cost [cost] steel, which you don't have.</span>")
|
||||
//Sizing down (or not at all)
|
||||
else if(cost <= 0)
|
||||
cost = abs(cost)
|
||||
var/actually_added = refactory.add_stored_material(MAT_STEEL,cost)
|
||||
user.resize(size_factor, ignore_prefs = TRUE)
|
||||
user.resize(size_factor, ignore_prefs = 1)
|
||||
if(actually_added != cost)
|
||||
to_chat(user,"<span class='warning'>Unfortunately, [cost-actually_added] steel was lost due to lack of storage space.</span>")
|
||||
|
||||
@@ -470,7 +418,7 @@ CHOMP Removal end*/
|
||||
/obj/effect/protean_ability/proc/do_ability(var/mob/living/L)
|
||||
if(istype(L))
|
||||
call(L,to_call)()
|
||||
return FALSE
|
||||
return 0
|
||||
|
||||
/// The actual abilities
|
||||
/obj/effect/protean_ability/into_blob
|
||||
@@ -507,6 +455,6 @@ CHOMP Removal end*/
|
||||
ability_name = "Hardsuit Transform"
|
||||
desc = "Coalesce your naniteswarm into their control module, allowing others to wear you."
|
||||
icon_state = "rig"
|
||||
to_call = /mob/living/carbon/human/proc/nano_metalnom
|
||||
to_call = /mob/living/carbon/human/proc/nano_rig_transform
|
||||
|
||||
#undef PER_LIMB_STEEL_COST
|
||||
|
||||
@@ -30,14 +30,15 @@
|
||||
return
|
||||
forced_move(direction, user, FALSE)
|
||||
|
||||
/obj/item/weapon/rig/protean/check_suit_access(mob/living/carbon/human/user)
|
||||
/obj/item/weapon/rig/protean/check_suit_access(mob/living/user)
|
||||
if(user == myprotean)
|
||||
return TRUE
|
||||
return ..()
|
||||
|
||||
/obj/item/weapon/rig/protean/New(var/newloc, var/mob/living/carbon/human/P)
|
||||
if(P)
|
||||
myprotean = P
|
||||
var/datum/species/protean/S = P.species
|
||||
S.OurRig = src
|
||||
if(P.back)
|
||||
addtimer(CALLBACK(src, .proc/AssimilateBag, P, 1), 3)
|
||||
|
||||
|
||||
@@ -51,6 +51,9 @@
|
||||
|
||||
rarity_value = 5
|
||||
|
||||
crit_mod = 4 //Unable to go crit
|
||||
var/obj/item/weapon/rig/protean/OurRig
|
||||
|
||||
genders = list(MALE, FEMALE, PLURAL, NEUTER)
|
||||
|
||||
has_organ = list(
|
||||
|
||||
@@ -4463,6 +4463,7 @@
|
||||
#include "maps\~map_system\maps.dm"
|
||||
#include "modular_chomp\code\modules\admin\functions\modify_traits.dm"
|
||||
#include "modular_chomp\code\modules\clothing\spacesuits\rig\rig.dm"
|
||||
#include "modular_chomp\code\modules\mob\living\carbon\human\species\species.dm"
|
||||
#include "modular_chomp\code\modules\mob\living\carbon\human\species\station\protean\_protean_defines.dm"
|
||||
#include "modular_chomp\code\modules\mob\living\carbon\human\species\station\protean\protean_blob.dm"
|
||||
#include "modular_chomp\code\modules\mob\living\carbon\human\species\station\protean\protean_organs.dm"
|
||||
|
||||
Reference in New Issue
Block a user