Merge pull request #3421 from VOREStation/aro-protwork

Some protean fixes (regen, size as blob, gender)
This commit is contained in:
Aronai Sieyes
2018-04-10 18:19:32 -04:00
committed by GitHub
4 changed files with 27 additions and 22 deletions
@@ -54,7 +54,6 @@
humanform = H
updatehealth()
refactory = locate() in humanform.internal_organs
verbs |= /mob/living/proc/nano_set_size
verbs |= /mob/living/proc/ventcrawl
verbs |= /mob/living/proc/hide
else
@@ -196,10 +196,14 @@
var/substance = matstack.material.name
var/actually_added = refactory.add_stored_material(substance,howmuch*matstack.perunit)
matstack.use(Ceiling(actually_added/matstack.perunit))
if(actually_added < howmuch)
if(actually_added && actually_added < howmuch)
to_chat(src,"<span class='warning'>Your refactory module is now full, so only [actually_added] units were stored.</span>")
else
visible_message(src,"<span class='notice'>[src] nibbles some of the [substance] right off the stack!</span>")
else if(actually_added)
to_chat(src,"<span class='notice'>You store [actually_added] units of [substance].</span>")
visible_message(src,"<span class='notice'>[src] devours some of the [substance] right off the stack!</span>")
else
to_chat(src,"<span class='notice'>You're completely capped out on [substance]!</span>")
////
// Blob Form
@@ -247,26 +251,28 @@
////
// Change size
////
/mob/living/proc/nano_set_size()
/mob/living/carbon/human/proc/nano_set_size()
set name = "Adjust Volume"
set category = "Abilities"
set hidden = TRUE
var/mob/living/user = temporary_form || src
var/obj/item/organ/internal/nano/refactory/refactory = nano_get_refactory()
//Missing the organ that does this
if(!istype(refactory))
to_chat(src,"<span class='warning'>You don't have a working refactory module!</span>")
to_chat(user,"<span class='warning'>You don't have a working refactory module!</span>")
return
var/nagmessage = "Adjust your mass to be a size between 25 to 200%. Up-sizing consumes metal, downsizing returns metal."
var/new_size = input(src, nagmessage, "Pick a Size", size_multiplier*100) as num|null
var/new_size = input(user, nagmessage, "Pick a Size", user.size_multiplier*100) as num|null
if(!new_size || !IsInRange(new_size,25,200))
return
var/size_factor = new_size/100
//Will be: -1.75 for 200->25, and 1.75 for 25->200
var/sizediff = size_factor - size_multiplier
var/sizediff = size_factor - user.size_multiplier
//Negative if shrinking, positive if growing
//Will be (PLSC*2)*-1.75 to 1.75
@@ -276,17 +282,19 @@
//Sizing up
if(cost > 0)
if(refactory.use_stored_material("steel",cost))
resize(size_factor)
user.resize(size_factor)
else
to_chat(src,"<span class='warning'>That size change would cost [cost] steel, which you don't have.</span>")
to_chat(user,"<span class='warning'>That size change would cost [cost] steel, which you don't have.</span>")
return
//Sizing down (or not at all)
if(cost <= 0)
cost = abs(cost)
var/actually_added = refactory.add_stored_material("steel",cost)
resize(size_factor)
user.resize(size_factor)
if(actually_added != cost)
to_chat(src,"<span class='warning'>Unfortunately, [cost-actually_added] steel was lost due to lack of storage space.</span>")
to_chat(user,"<span class='warning'>Unfortunately, [cost-actually_added] steel was lost due to lack of storage space.</span>")
user.visible_message("<span class='notice'>Black mist swirls around [user] as they change size.</span>")
/// /// /// A helper to reuse
/mob/living/proc/nano_get_refactory(obj/item/organ/internal/nano/refactory/R)
@@ -350,7 +358,7 @@
ability_name = "Change Volume"
desc = "Alter your size by consuming steel to produce additional nanites, or regain steel by reducing your size and reclaiming them."
icon_state = "volume"
to_call = /mob/living/proc/nano_set_size
to_call = /mob/living/carbon/human/proc/nano_set_size
/obj/effect/protean_ability/reform_limb
ability_name = "Ref - Single Limb"
@@ -86,12 +86,13 @@
/mob/living/carbon/human/proc/nano_partswap,
/mob/living/carbon/human/proc/nano_metalnom,
/mob/living/carbon/human/proc/nano_blobform,
/mob/living/proc/nano_set_size,
/mob/living/carbon/human/proc/nano_set_size,
/mob/living/carbon/human/proc/nano_change_fitting, //These verbs are displayed normally,
/mob/living/carbon/human/proc/shapeshifter_select_hair,
/mob/living/carbon/human/proc/shapeshifter_select_hair_colors,
/mob/living/carbon/human/proc/shapeshifter_select_colour,
/mob/living/carbon/human/proc/shapeshifter_select_eye_colour
/mob/living/carbon/human/proc/shapeshifter_select_eye_colour,
/mob/living/carbon/human/proc/shapeshifter_select_gender
)
var/global/list/abilities = list()
@@ -204,7 +205,7 @@
// Various modifiers
/datum/modifier/protean
stacks = MODIFIER_STACK_FORBID
var/material_use = 100
var/material_use = 150
var/material_name = DEFAULT_WALL_MATERIAL
/datum/modifier/protean/on_applied()
@@ -217,7 +218,7 @@
if(holder.temporary_form)
to_chat(holder.temporary_form,on_expired_text)
/datum/modifier/protean/tick()
/datum/modifier/protean/check_if_valid()
//No origin set
if(!istype(origin))
expire()
@@ -238,7 +239,6 @@
on_created_text = "<span class='notice'>You feel yourself accelerate, the metallic hydrogen increasing your speed temporarily.</span>"
on_expired_text = "<span class='notice'>Your refactory finishes consuming the metallic hydrogen, and you return to normal speed.</span>"
material_use = 100
material_name = "mhydrogen"
slowdown = -1
@@ -250,7 +250,6 @@
on_created_text = "<span class='notice'>You feel yourself become nearly impervious to physical attacks as plasteel nanites are made.</span>"
on_expired_text = "<span class='notice'>Your refactory finishes consuming the plasteel, and you return to your normal nanites.</span>"
material_use = 100
material_name = "plasteel"
incoming_brute_damage_percent = 0.5
@@ -262,7 +261,6 @@
on_created_text = "<span class='notice'>You feel yourself become more reflective, able to resist heat and fire better for a time.</span>"
on_expired_text = "<span class='notice'>Your refactory finishes consuming the diamond, and you return to your normal nanites.</span>"
material_use = 100
material_name = "diamond"
incoming_fire_damage_percent = 0.2
@@ -274,7 +272,6 @@
on_created_text = "<span class='notice'>You feel new nanites being produced from your stockpile of steel, healing you slowly.</span>"
on_expired_text = "<span class='notice'>Your steel supply has either run out, or is no longer needed, and your healing stops.</span>"
material_use = 100
material_name = "steel"
/datum/modifier/protean/steel/tick()
@@ -303,4 +300,4 @@
src.name += " ([new_name])"
desc += "\nVALID THROUGH END OF: [time2text(world.timeofday, "Month") +" "+ num2text(text2num(time2text(world.timeofday, "YYYY"))+544)]\nREGISTRANT: [new_name]"
#undef DAM_SCALE_FACTOR
#undef DAM_SCALE_FACTOR
+2 -1
View File
@@ -6,11 +6,12 @@
if (transforming)
return
handle_modifiers() //VOREStation Edit - Needs to be done even if in nullspace.
if(!loc)
return
var/datum/gas_mixture/environment = loc.return_air()
handle_modifiers() // Do this early since it might affect other things later.
//handle_modifiers() // Do this early since it might affect other things later. //VOREStation Edit
handle_light()