Update jellypeople.dm

This commit is contained in:
LetterJay
2017-11-12 13:17:41 -06:00
committed by GitHub
parent 6da7d8e8b5
commit 8d78a999e1
@@ -1,340 +1,3 @@
<<<<<<< HEAD
/datum/species/jelly
// Entirely alien beings that seem to be made entirely out of gel. They have three eyes and a skeleton visible within them.
name = "Xenobiological Jelly Entity"
id = "jelly"
default_color = "00FF90"
say_mod = "chirps"
species_traits = list(MUTCOLORS,EYECOLOR,NOBLOOD,VIRUSIMMUNE,TOXINLOVER)
meat = /obj/item/reagent_containers/food/snacks/meat/slab/human/mutant/slime
exotic_blood = "slimejelly"
damage_overlay_type = ""
var/datum/action/innate/regenerate_limbs/regenerate_limbs
liked_food = MEAT
/datum/species/jelly/on_species_loss(mob/living/carbon/C)
if(regenerate_limbs)
regenerate_limbs.Remove(C)
..()
/datum/species/jelly/on_species_gain(mob/living/carbon/C, datum/species/old_species)
..()
if(ishuman(C))
regenerate_limbs = new
regenerate_limbs.Grant(C)
/datum/species/jelly/spec_life(mob/living/carbon/human/H)
if(H.stat == DEAD) //can't farm slime jelly from a dead slime/jelly person indefinitely
return
if(!H.blood_volume)
H.blood_volume += 5
H.adjustBruteLoss(5)
to_chat(H, "<span class='danger'>You feel empty!</span>")
if(H.blood_volume < BLOOD_VOLUME_NORMAL)
if(H.nutrition >= NUTRITION_LEVEL_STARVING)
H.blood_volume += 3
H.nutrition -= 2.5
if(H.blood_volume < BLOOD_VOLUME_OKAY)
if(prob(5))
to_chat(H, "<span class='danger'>You feel drained!</span>")
if(H.blood_volume < BLOOD_VOLUME_BAD)
Cannibalize_Body(H)
H.update_action_buttons_icon()
/datum/species/jelly/proc/Cannibalize_Body(mob/living/carbon/human/H)
var/list/limbs_to_consume = list("r_arm", "l_arm", "r_leg", "l_leg") - H.get_missing_limbs()
var/obj/item/bodypart/consumed_limb
if(!limbs_to_consume.len)
H.losebreath++
return
if(H.get_num_legs()) //Legs go before arms
limbs_to_consume -= list("r_arm", "l_arm")
consumed_limb = H.get_bodypart(pick(limbs_to_consume))
consumed_limb.drop_limb()
to_chat(H, "<span class='userdanger'>Your [consumed_limb] is drawn back into your body, unable to maintain its shape!</span>")
qdel(consumed_limb)
H.blood_volume += 20
/datum/action/innate/regenerate_limbs
name = "Regenerate Limbs"
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimeheal"
icon_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
/datum/action/innate/regenerate_limbs/IsAvailable()
if(..())
var/mob/living/carbon/human/H = owner
var/list/limbs_to_heal = H.get_missing_limbs()
if(limbs_to_heal.len < 1)
return 0
if(H.blood_volume >= BLOOD_VOLUME_OKAY+40)
return 1
return 0
/datum/action/innate/regenerate_limbs/Activate()
var/mob/living/carbon/human/H = owner
var/list/limbs_to_heal = H.get_missing_limbs()
if(limbs_to_heal.len < 1)
to_chat(H, "<span class='notice'>You feel intact enough as it is.</span>")
return
to_chat(H, "<span class='notice'>You focus intently on your missing [limbs_to_heal.len >= 2 ? "limbs" : "limb"]...</span>")
if(H.blood_volume >= 40*limbs_to_heal.len+BLOOD_VOLUME_OKAY)
H.regenerate_limbs()
H.blood_volume -= 40*limbs_to_heal.len
to_chat(H, "<span class='notice'>...and after a moment you finish reforming!</span>")
return
else if(H.blood_volume >= 40)//We can partially heal some limbs
while(H.blood_volume >= BLOOD_VOLUME_OKAY+40)
var/healed_limb = pick(limbs_to_heal)
H.regenerate_limb(healed_limb)
limbs_to_heal -= healed_limb
H.blood_volume -= 40
to_chat(H, "<span class='warning'>...but there is not enough of you to fix everything! You must attain more mass to heal completely!</span>")
return
to_chat(H, "<span class='warning'>...but there is not enough of you to go around! You must attain more mass to heal!</span>")
////////////////////////////////////////////////////////SLIME PEOPLE///////////////////////////////////////////////////////////////////
/datum/species/jelly/slime
// Humans mutated by slime mutagen, produced from green slimes. They are not targetted by slimes.
name = "Slimeperson"
id = "slime"
default_color = "00FFFF"
species_traits = list(MUTCOLORS,EYECOLOR,HAIR,FACEHAIR,NOBLOOD,VIRUSIMMUNE, TOXINLOVER)
say_mod = "says"
hair_color = "mutcolor"
hair_alpha = 150
ignored_by = list(/mob/living/simple_animal/slime)
burnmod = 0.5
coldmod = 2
heatmod = 0.5
var/datum/action/innate/split_body/slime_split
var/list/mob/living/carbon/bodies
var/datum/action/innate/swap_body/swap_body
/datum/species/jelly/slime/on_species_loss(mob/living/carbon/C)
if(slime_split)
slime_split.Remove(C)
if(swap_body)
swap_body.Remove(C)
bodies -= C // This means that the other bodies maintain a link
// so if someone mindswapped into them, they'd still be shared.
bodies = null
C.faction -= "slime"
C.blood_volume = min(C.blood_volume, BLOOD_VOLUME_NORMAL)
..()
/datum/species/jelly/slime/on_species_gain(mob/living/carbon/C, datum/species/old_species)
..()
if(ishuman(C))
/* slime_split = new
slime_split.Grant(C)
swap_body = new
swap_body.Grant(C) */
if(!bodies || !bodies.len)
bodies = list(C)
else
bodies |= C
C.faction |= "slime"
//If you're cloned you get your body pool back
/datum/species/jelly/slime/copy_properties_from(datum/species/jelly/slime/old_species)
bodies = old_species.bodies
/datum/species/jelly/slime/spec_life(mob/living/carbon/human/H)
/*if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT)
if(prob(5))
to_chat(H, "<span class='notice'>You feel very bloated!</span>")*/
if(H.nutrition >= NUTRITION_LEVEL_WELL_FED)
H.blood_volume += 3
H.nutrition -= 2.5
..()
/datum/action/innate/split_body
name = "Split Body"
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimesplit"
icon_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
/datum/action/innate/split_body/IsAvailable()
if(..())
var/mob/living/carbon/human/H = owner
if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT)
return 1
return 0
/datum/action/innate/split_body/Activate()
var/mob/living/carbon/human/H = owner
if(!isslimeperson(H))
return
CHECK_DNA_AND_SPECIES(H)
H.visible_message("<span class='notice'>[owner] gains a look of \
concentration while standing perfectly still.</span>",
"<span class='notice'>You focus intently on moving your body while \
standing perfectly still...</span>")
H.notransform = TRUE
if(do_after(owner, delay=60, needhand=FALSE, target=owner, progress=TRUE))
if(H.blood_volume >= BLOOD_VOLUME_SLIME_SPLIT)
make_dupe()
else
to_chat(H, "<span class='warning'>...but there is not enough of you to go around! You must attain more mass to split!</span>")
else
to_chat(H, "<span class='warning'>...but fail to stand perfectly still!</span>")
H.notransform = FALSE
/datum/action/innate/split_body/proc/make_dupe()
var/mob/living/carbon/human/H = owner
CHECK_DNA_AND_SPECIES(H)
var/mob/living/carbon/human/spare = new /mob/living/carbon/human(H.loc)
spare.underwear = "Nude"
H.dna.transfer_identity(spare, transfer_SE=1)
spare.dna.features["mcolor"] = pick("FFFFFF","7F7F7F", "7FFF7F", "7F7FFF", "FF7F7F", "7FFFFF", "FF7FFF", "FFFF7F")
spare.real_name = spare.dna.real_name
spare.name = spare.dna.real_name
spare.updateappearance(mutcolor_update=1)
spare.domutcheck()
spare.Move(get_step(H.loc, pick(NORTH,SOUTH,EAST,WEST)))
H.blood_volume = BLOOD_VOLUME_SAFE
H.notransform = 0
var/datum/species/jelly/slime/origin_datum = H.dna.species
origin_datum.bodies |= spare
var/datum/species/jelly/slime/spare_datum = spare.dna.species
spare_datum.bodies = origin_datum.bodies
H.mind.transfer_to(spare)
spare.visible_message("<span class='warning'>[H] distorts as a new body \
\"steps out\" of them.</span>",
"<span class='notice'>...and after a moment of disorentation, \
you're besides yourself!</span>")
/datum/action/innate/swap_body
name = "Swap Body"
check_flags = AB_CHECK_CONSCIOUS
button_icon_state = "slimeswap"
icon_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
/datum/action/innate/swap_body/Activate()
if(!isslimeperson(owner))
to_chat(owner, "<span class='warning'>You are not a slimeperson.</span>")
Remove(owner)
else
ui_interact(owner)
/datum/action/innate/swap_body/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.conscious_state)
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
if(!ui)
ui = new(user, src, ui_key, "slime_swap_body", name, 400, 400, master_ui, state)
ui.open()
/datum/action/innate/swap_body/ui_data(mob/user)
var/mob/living/carbon/human/H = owner
if(!isslimeperson(H))
return
var/datum/species/jelly/slime/SS = H.dna.species
var/list/data = list()
data["bodies"] = list()
for(var/b in SS.bodies)
var/mob/living/carbon/human/body = b
if(!body || QDELETED(body) || !isslimeperson(body))
SS.bodies -= b
continue
var/list/L = list()
// HTML colors need a # prefix
L["htmlcolor"] = "#[body.dna.features["mcolor"]]"
var/area/A = get_area(body)
L["area"] = A.name
var/stat = "error"
switch(body.stat)
if(CONSCIOUS)
stat = "Conscious"
if(UNCONSCIOUS)
stat = "Unconscious"
if(DEAD)
stat = "Dead"
var/current = body.mind
var/is_conscious = (body.stat == CONSCIOUS)
L["status"] = stat
L["exoticblood"] = body.blood_volume
L["name"] = body.name
L["ref"] = "\ref[body]"
L["is_current"] = current
var/button
if(current)
button = "selected"
else if(is_conscious)
button = null
else
button = "disabled"
L["swap_button_state"] = button
L["swappable"] = !current && is_conscious
data["bodies"] += list(L)
return data
/datum/action/innate/swap_body/ui_act(action, params)
if(..())
return
var/mob/living/carbon/human/H = owner
if(!isslimeperson(owner))
return
var/datum/species/jelly/slime/SS = H.dna.species
var/datum/mind/M
for(var/mob/living/L in SS.bodies)
if(L.mind && L.mind.active)
M = L.mind
if(!M)
return
if(!isslimeperson(M.current))
return
switch(action)
if("swap")
var/mob/living/carbon/human/selected = locate(params["ref"])
if(!(selected in SS.bodies))
return
if(!selected || QDELETED(selected) || !isslimeperson(selected))
SS.bodies -= selected
return
if(M.current == selected)
return
if(selected.stat != CONSCIOUS)
return
swap_to_dupe(M, selected)
/datum/action/innate/swap_body/proc/swap_to_dupe(datum/mind/M, mob/living/carbon/human/dupe)
M.current.visible_message("<span class='notice'>[M.current] \
stops moving and starts staring vacantly into space.</span>",
"<span class='notice'>You stop moving this body...</span>")
M.transfer_to(dupe)
dupe.visible_message("<span class='notice'>[dupe] blinks and looks \
around.</span>",
"<span class='notice'>...and move this one instead.</span>")
=======
/datum/species/jelly
// Entirely alien beings that seem to be made entirely out of gel. They have three eyes and a skeleton visible within them.
name = "Xenobiological Jelly Entity"
@@ -670,4 +333,3 @@
dupe.visible_message("<span class='notice'>[dupe] blinks and looks \
around.</span>",
"<span class='notice'>...and move this one instead.</span>")
>>>>>>> 626302c... Merge pull request #32161 from ninjanomnom/512-experimental