Fixes does_not_breathe, Toggle breathing is an active power (#2240)

* Fixes does_not_breathe

* Fixes things, Changelings can toggle breathing

* Changelog
This commit is contained in:
Anewbe
2016-08-02 12:41:24 -05:00
committed by Yoshax
parent a4d38d6374
commit 88b7f0e678
6 changed files with 64 additions and 7 deletions

View File

@@ -2,15 +2,30 @@
name = "Self Respiration"
desc = "We evolve our body to no longer require drawing oxygen from the atmosphere."
helptext = "We will no longer require internals, and we cannot inhale any gas, including harmful ones."
ability_icon_state = "ling_toggle_breath"
genomecost = 0
isVerb = 0
verbpath = /mob/proc/changeling_self_respiration
//No breathing required
/mob/proc/changeling_self_respiration()
set category = "Changeling"
set name = "Toggle Breathing"
set desc = "We choose whether or not to breathe."
var/datum/changeling/changeling = changeling_power(0,0,100,UNCONSCIOUS)
if(!changeling)
return 0
if(istype(src,/mob/living/carbon))
var/mob/living/carbon/C = src
C.does_not_breathe = 1
src << "<span class='notice'>We stop breathing, as we no longer need to.</span>"
return 1
if(C.suiciding)
src << "You're committing suicide, this isn't going to work."
return 0
if(C.does_not_breathe == 0)
C.does_not_breathe = 1
src << "<span class='notice'>We stop breathing, as we no longer need to.</span>"
return 1
else
C.does_not_breathe = 0
src << "<span class='notice'>We resume breathing, as we now need to again.</span>"
return 0

View File

@@ -27,6 +27,7 @@
src << "You can't commit suicide whilst restrained! ((You can type Ghost instead however.))"
return
suiciding = 1
does_not_breathe = 0 //Prevents ling-suicide zombies, or something
var/obj/item/held_item = get_active_hand()
if(held_item)
var/damagetype = held_item.suicide_act(src)

View File

@@ -7,7 +7,7 @@
/mob/living/carbon/proc/breathe()
//if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
if(!should_have_organ(O_LUNGS) || does_not_breathe) return
if(!should_have_organ(O_LUNGS)) return
var/datum/gas_mixture/breath = null

View File

@@ -327,6 +327,11 @@
if(status_flags & GODMODE)
return
if(does_not_breathe)
failed_last_breath = 0
adjustOxyLoss(-5)
return
if(!breath || (breath.total_moles == 0) || suiciding)
failed_last_breath = 1
if(suiciding)
@@ -1184,10 +1189,10 @@
// if(resting || lying || sleeping) rest.icon_state = "rest1"
// else rest.icon_state = "rest0"
if(toxin)
if(hal_screwyhud == 4 || phoron_alert) toxin.icon_state = "tox1"
if(hal_screwyhud == 4 || (phoron_alert && !does_not_breathe)) toxin.icon_state = "tox1"
else toxin.icon_state = "tox0"
if(oxygen)
if(hal_screwyhud == 3 || oxygen_alert) oxygen.icon_state = "oxy1"
if(hal_screwyhud == 3 || (oxygen_alert && !does_not_breathe)) oxygen.icon_state = "oxy1"
else oxygen.icon_state = "oxy0"
if(fire)
if(fire_alert) fire.icon_state = "fire[fire_alert]" //fire_alert is either 0 if no alert, 1 for cold and 2 for heat.