Merge branch 'master' of https://github.com/tgstation/-tg-station into alert_alert_ur_a_faget

Conflicts:
	code/modules/mob/living/carbon/alien/humanoid/life.dm
	code/modules/mob/living/carbon/alien/larva/life.dm
	code/modules/mob/living/carbon/alien/life.dm
	code/modules/mob/living/carbon/monkey/life.dm
	icons/mob/screen_alien.dmi
This commit is contained in:
MrPerson
2015-03-02 12:04:38 -08:00
257 changed files with 8012 additions and 12451 deletions
+6
View File
@@ -2,4 +2,10 @@
..()
if(client.prefs.unlock_content)
icon_state = client.prefs.ghost_form
if (ghostimage)
ghostimage.icon_state = src.icon_state
updateghostimages()
update_interface()
+2
View File
@@ -1,4 +1,6 @@
/mob/dead/observer/Logout()
if (client)
client.images -= ghost_darkness_images
..()
spawn(0)
if(src && !key) //we've transferred to another mob. This ghost should be deleted.
+48 -4
View File
@@ -1,9 +1,10 @@
var/list/image/ghost_darkness_images = list() //this is a list of images for things ghosts should still be able to see when they toggle darkness
/mob/dead/observer
name = "ghost"
desc = "It's a g-g-g-g-ghooooost!" //jinkies!
icon = 'icons/mob/mob.dmi'
icon_state = "ghost"
layer = 4
layer = MOB_LAYER + 1
stat = DEAD
density = 0
canmove = 0
@@ -18,6 +19,9 @@
//Note that this is not a reliable way to determine if admins started as observers, since they change mobs a lot.
var/atom/movable/following = null
var/fun_verbs = 0
var/image/ghostimage = null //this mobs ghost image, for deleting and stuff
var/ghostvision = 1 //is the ghost able to see things humans can't?
var/seedarkness = 1
/mob/dead/observer/New(mob/body)
sight |= SEE_TURFS | SEE_MOBS | SEE_OBJS | SEE_SELF
@@ -26,6 +30,9 @@
verbs += /mob/dead/observer/proc/dead_tele
stat = DEAD
ghostimage = image(src.icon,src,src.icon_state)
ghost_darkness_images |= ghostimage
updateallghostimages()
var/turf/T
if(ismob(body))
T = get_turf(body) //Where is the body located?
@@ -55,6 +62,14 @@
animate(src, pixel_y = 2, time = 10, loop = -1)
..()
/mob/dead/observer/Destroy()
if (ghostimage)
ghost_darkness_images -= ghostimage
qdel(ghostimage)
ghostimage = null
updateallghostimages()
..()
/mob/dead/CanPass(atom/movable/mover, turf/target, height=0)
@@ -254,14 +269,43 @@ This is the proc mobs get to turn into a ghost. Forked from ghostize due to comp
set hidden = 1
src << "<span class='danger'>You are dead! You have no mind to store memory!</span>"
/mob/dead/observer/verb/toggle_ghostsee()
set name = "Toggle Ghost Vision"
set desc = "Toggles your ability to see things only ghosts can see, like other ghosts"
set category = "Ghost"
ghostvision = !(ghostvision)
updateghostsight()
usr << "You [(ghostvision?"now":"no longer")] have ghost vision."
/mob/dead/observer/verb/toggle_darkness()
set name = "Toggle Darkness"
set category = "Ghost"
seedarkness = !(seedarkness)
updateghostsight()
if (see_invisible == SEE_INVISIBLE_OBSERVER_NOLIGHTING)
see_invisible = SEE_INVISIBLE_OBSERVER
else
/mob/dead/observer/proc/updateghostsight()
if (!seedarkness)
see_invisible = SEE_INVISIBLE_OBSERVER_NOLIGHTING
else
see_invisible = SEE_INVISIBLE_OBSERVER
if (!ghostvision)
see_invisible = SEE_INVISIBLE_LIVING;
updateghostimages()
/proc/updateallghostimages()
for (var/mob/dead/observer/O in player_list)
O.updateghostimages()
/mob/dead/observer/proc/updateghostimages()
if (!client)
return
if (seedarkness || !ghostvision)
client.images -= ghost_darkness_images
else
//add images for the 60inv things ghosts can normally see when darkness is enabled so they can see them now
client.images |= ghost_darkness_images
if (ghostimage)
client.images -= ghostimage //remove ourself
/mob/dead/observer/verb/possess()
set category = "Ghost"
+17 -20
View File
@@ -104,31 +104,28 @@
else
clear_alert("alien_fire")
/mob/living/carbon/alien/handle_mutations_and_radiation()
// Aliens love radiation nom nom nom
if (radiation)
if (radiation > 100)
radiation = 100
/mob/living/carbon/alien/ex_act(severity, target)
..()
if (radiation < 0)
radiation = 0
switch (severity)
if (1.0)
gib()
return
switch(radiation)
if(0 to 50)
radiation--
if(prob(25))
adjustToxLoss(1)
if (2.0)
adjustBruteLoss(60)
adjustFireLoss(60)
adjustEarDamage(30,120)
if(50 to 75)
radiation -= 2
adjustToxLoss(1)
if(prob(5))
radiation -= 5
if(3.0)
adjustBruteLoss(30)
if (prob(50))
Paralyse(1)
adjustEarDamage(15,60)
updatehealth()
if(75 to 100)
radiation -= 3
adjustToxLoss(3)
/mob/living/carbon/alien/handle_fire()//Aliens on fire code
if(..())
@@ -15,26 +15,26 @@
real_name = name
..()
/mob/living/carbon/alien/humanoid/hunter/handle_regular_hud_updates()
..() //-Yvarov
/mob/living/carbon/alien/humanoid/hunter/handle_hud_icons_health()
if (healths)
if (stat != 2)
switch(health)
if(150 to INFINITY)
healths.icon_state = "health0"
if(100 to 150)
if(120 to 150)
healths.icon_state = "health1"
if(50 to 100)
if(90 to 120)
healths.icon_state = "health2"
if(25 to 50)
if(60 to 90)
healths.icon_state = "health3"
if(0 to 25)
if(30 to 60)
healths.icon_state = "health4"
else
if(0 to 30)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
else
healths.icon_state = "health6"
healths.icon_state = "health7"
/mob/living/carbon/alien/humanoid/hunter/handle_environment()
@@ -17,9 +17,7 @@
verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid,/mob/living/carbon/alien/humanoid/proc/neurotoxin)
..()
/mob/living/carbon/alien/humanoid/sentinel/handle_regular_hud_updates()
..() //-Yvarov
/mob/living/carbon/alien/humanoid/sentinel/handle_hud_icons_health()
if (healths)
if (stat != 2)
switch(health)
@@ -29,14 +27,16 @@
healths.icon_state = "health1"
if(75 to 100)
healths.icon_state = "health2"
if(25 to 75)
if(50 to 75)
healths.icon_state = "health3"
if(0 to 25)
if(25 to 50)
healths.icon_state = "health4"
else
if(0 to 25)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
else
healths.icon_state = "health6"
healths.icon_state = "health7"
/mob/living/carbon/alien/humanoid/sentinel/movement_delay()
. = ..()
@@ -28,53 +28,6 @@
if(l_store) l_store.emp_act(severity)
..()
/mob/living/carbon/alien/humanoid/ex_act(severity, target)
..()
var/shielded = 0
var/b_loss = null
var/f_loss = null
switch (severity)
if (1.0)
gib()
return
if (2.0)
if (!shielded)
b_loss += 60
f_loss += 60
adjustEarDamage(30, 120)
if(3.0)
b_loss += 30
if (prob(50) && !shielded)
Paralyse(1)
adjustEarDamage(15 , 60)
adjustBruteLoss(b_loss)
adjustFireLoss(f_loss)
updatehealth()
/mob/living/carbon/alien/humanoid/blob_act()
if (stat == 2)
return
var/shielded = 0
var/damage = null
if (stat != 2)
damage = rand(30,40)
if(shielded)
damage /= 4
show_message("<span class='userdanger'>The blob attacks!</span>")
adjustFireLoss(damage)
return
/mob/living/carbon/alien/humanoid/attack_slime(mob/living/carbon/slime/M as mob)
..()
var/damage = rand(5, 35)
@@ -139,10 +92,6 @@
return 0
/mob/living/carbon/alien/humanoid/var/co2overloadtime = null
/mob/living/carbon/alien/humanoid/var/temperature_resistance = T0C+75
/mob/living/carbon/alien/humanoid/show_inv(mob/user)
user.set_machine(src)
var/dat = {"
@@ -21,155 +21,4 @@
temp_change = (temperature - current)
return temp_change
/mob/living/carbon/alien/humanoid/handle_regular_status_updates()
updatehealth()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
eye_blind = 1
silent = 0
else //ALIVE. LIGHTS ARE ON
if(health < config.health_threshold_dead || !getorgan(/obj/item/organ/brain))
death()
eye_blind = 1
stat = DEAD
silent = 0
return 1
//UNCONSCIOUS. NO-ONE IS HOME
if( (getOxyLoss() > 50) || (config.health_threshold_crit >= health) )
if( health <= 20 && prob(1) )
spawn(0)
emote("gasp")
if(!reagents.has_reagent("epinephrine"))
adjustOxyLoss(1)
Paralyse(3)
if(paralysis)
AdjustParalysis(-1)
eye_blind = max(eye_blind, 1)
stat = UNCONSCIOUS
else if(sleeping)
sleeping = max(sleeping-1, 0)
eye_blind = max(eye_blind, 1)
stat = UNCONSCIOUS
if( prob(10) && health )
spawn(0)
emote("hiss")
//CONSCIOUS
else
stat = CONSCIOUS
/* What in the living hell is this?*/
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
//Eyes
if(disabilities & BLIND) //disabled-blind, doesn't get better on its own
eye_blind = max(eye_blind, 1)
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
else if(eye_blurry) //blurry eyes heal slowly
eye_blurry = max(eye_blurry-1, 0)
//Ears
if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
setEarDamage(-1, max(ear_deaf, 1))
else
adjustEarDamage(-1, (ear_damage < 25 ? -0.05 : 0))
//deafness, heals slowly over time
//ear damage heals slowly under this threshold. otherwise you'll need earmuffs
//Other
if(stunned)
AdjustStunned(-1)
if(!stunned)
update_icons()
if(weakened)
weakened = max(weakened-1,0)
if(!weakened)
update_icons()
if(stuttering)
stuttering = max(stuttering-1, 0)
if(silent)
silent = max(silent-1, 0)
if(druggy)
druggy = max(druggy-1, 0)
return 1
/mob/living/carbon/alien/humanoid/handle_regular_hud_updates()
if (stat == 2)
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight |= SEE_MOBS
sight &= ~SEE_TURFS
sight &= ~SEE_OBJS
if(nightvision)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else if(!nightvision)
see_in_dark = 4
see_invisible = 45
if(see_override)
see_invisible = see_override
if (healths)
if (stat != 2)
switch(health)
if(100 to INFINITY)
healths.icon_state = "health0"
if(75 to 100)
healths.icon_state = "health1"
if(50 to 75)
healths.icon_state = "health2"
if(25 to 50)
healths.icon_state = "health3"
if(0 to 25)
healths.icon_state = "health4"
else
healths.icon_state = "health5"
else
healths.icon_state = "health6"
if(pullin)
if(pulling)
pullin.icon_state = "pull"
else
pullin.icon_state = "pull0"
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((eye_blind))
blind.layer = 18
else
blind.layer = 0
if (disabilities & NEARSIGHT)
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += global_hud.blurry
if (druggy)
client.screen += global_hud.druggy
if (stat != 2)
if (machine)
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(!client.adminobs)
reset_view(null)
return 1
@@ -25,26 +25,26 @@
verbs.Add(/mob/living/carbon/alien/humanoid/proc/corrosive_acid,/mob/living/carbon/alien/humanoid/proc/neurotoxin,/mob/living/carbon/alien/humanoid/proc/resin)
..()
/mob/living/carbon/alien/humanoid/queen/handle_regular_hud_updates()
..() //-Yvarov
/mob/living/carbon/alien/humanoid/queen/handle_hud_icons_health()
if (src.healths)
if (src.stat != 2)
switch(health)
if(250 to INFINITY)
src.healths.icon_state = "health0"
if(175 to 250)
if(200 to 250)
src.healths.icon_state = "health1"
if(100 to 175)
if(150 to 200)
src.healths.icon_state = "health2"
if(50 to 100)
if(100 to 150)
src.healths.icon_state = "health3"
if(0 to 50)
if(50 to 100)
src.healths.icon_state = "health4"
else
if(0 to 50)
src.healths.icon_state = "health5"
else
src.healths.icon_state = "health6"
else
src.healths.icon_state = "health6"
src.healths.icon_state = "health7"
/mob/living/carbon/alien/humanoid/queen/movement_delay()
. = ..()
@@ -76,9 +76,9 @@
if (!src.restrained())
message = text("<span class='name'>[src]</span> signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null))
m_type = 1
// if ("sit")
// message = "<span class='name'>[src]</span> sits down." //Larvan can't sit down, /N
// m_type = 1
if ("snore")
message = "<B>[src]</B> snores."
m_type = 2
if ("sulk")
message = "<span class='name'>[src]</span> sulks down sadly."
m_type = 1
@@ -34,60 +34,6 @@
amount_grown = min(amount_grown + 1, max_grown)
..(amount)
/mob/living/carbon/alien/larva/ex_act(severity, target)
..()
var/b_loss = null
var/f_loss = null
switch (severity)
if (1.0)
gib()
return
if (2.0)
b_loss += 60
f_loss += 60
adjustEarDamage(30,120)
if(3.0)
b_loss += 30
if (prob(50))
Paralyse(1)
adjustEarDamage(15,60)
adjustBruteLoss(b_loss)
adjustFireLoss(f_loss)
updatehealth()
/mob/living/carbon/alien/larva/blob_act()
if (stat == 2)
return
var/shielded = 0
var/damage = null
if (stat != 2)
damage = rand(10,30)
if(shielded)
damage /= 4
//paralysis += 1
show_message("<span class='userdanger'>The blob attacks you!</span>")
adjustFireLoss(damage)
updatehealth()
return
//can't equip anything
/mob/living/carbon/alien/larva/attack_ui(slot_id)
return
@@ -137,9 +83,6 @@
/mob/living/carbon/alien/larva/restrained()
return 0
/mob/living/carbon/alien/larva/var/co2overloadtime = null
/mob/living/carbon/alien/larva/var/temperature_resistance = T0C+75
// new damage icon system
// now constructs damage icon for each organ from mask * damage field
@@ -153,15 +96,6 @@
/mob/living/carbon/alien/larva/start_pulling()
return
/* Commented out because it's duplicated in life.dm
/mob/living/carbon/alien/larva/proc/grow() // Larvae can grow into full fledged Xenos if they survive long enough
if(icon_state == "larva_l" && !canmove) // This is a shit death check. It is made of shit and death. Fix later.
return
else
var/mob/living/carbon/alien/humanoid/A = new(loc)
A.key = key
qdel(src) */
/mob/living/carbon/alien/larva/stripPanelUnequip(obj/item/what, mob/who)
src << "<span class='warning'>You don't have the dexterity to do this!</span>"
return
@@ -1,10 +1,11 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
/mob/living/carbon/alien/larva
var/temperature_alert = 0
/mob/living/carbon/alien/larva/Life()
set invisibility = 0
set background = BACKGROUND_ENABLED
if (notransform)
return
if(..())
// GROW!
if(amount_grown < max_grown)
@@ -13,154 +14,26 @@
//some kind of bug in canmove() isn't properly calling update_icons, so this is here as a placeholder
update_icons()
/mob/living/carbon/alien/larva/handle_regular_status_updates()
updatehealth()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
eye_blind = max(1, eye_blind)
silent = 0
else //ALIVE. LIGHTS ARE ON
if(health < -25 || !getorgan(/obj/item/organ/brain))
death()
eye_blind = max(1, eye_blind)
silent = 0
return 1
//UNCONSCIOUS. NO-ONE IS HOME
if( (getOxyLoss() > 25) || (config.health_threshold_crit >= health) )
//if( health <= 20 && prob(1) )
// spawn(0)
// emote("gasp")
if(!reagents.has_reagent("epinephrine"))
adjustOxyLoss(1)
Paralyse(3)
if(paralysis)
AdjustParalysis(-2)
eye_blind = max(eye_blind, 1)
stat = UNCONSCIOUS
else if(sleeping)
sleeping = max(sleeping-1, 0)
eye_blind = max(eye_blind, 1)
stat = UNCONSCIOUS
if( prob(10) && health )
spawn(0)
emote("hiss_")
//CONSCIOUS
else
stat = CONSCIOUS
/* What in the living hell is this?*/
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
//Eyes
if(disabilities & BLIND) //disabled-blind, doesn't get better on its own
eye_blind = max(eye_blind, 1)
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
else if(eye_blurry) //blurry eyes heal slowly
eye_blurry = max(eye_blurry-1, 0)
//Ears
if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
setEarDamage(-1, max(ear_deaf, 1))
else
adjustEarDamage(-1, (ear_damage < 25 ? -0.05 : 0))
//deafness, heals slowly over time
//ear damage heals slowly under this threshold. otherwise you'll need earmuffs
//Other
if(stunned)
AdjustStunned(-1)
if(weakened)
weakened = max(weakened-1,0)
if(stuttering)
stuttering = max(stuttering-1, 0)
if(silent)
silent = max(silent-1, 0)
if(druggy)
druggy = max(druggy-1, 0)
return 1
/mob/living/carbon/alien/larva/handle_regular_hud_updates()
if (stat == 2)
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight |= SEE_MOBS
sight &= ~SEE_TURFS
sight &= ~SEE_OBJS
if(nightvision)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else if(!nightvision)
see_in_dark = 4
see_invisible = 45
if(see_override)
see_invisible = see_override
/mob/living/carbon/alien/larva/handle_hud_icons_health()
if (healths)
if (stat != 2)
switch(health)
if(25 to INFINITY)
healths.icon_state = "health0"
if(19 to 25)
if(20 to 25)
healths.icon_state = "health1"
if(13 to 19)
if(15 to 20)
healths.icon_state = "health2"
if(7 to 13)
if(10 to 15)
healths.icon_state = "health3"
if(0 to 7)
if(5 to 10)
healths.icon_state = "health4"
else
if(0 to 5)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
else
healths.icon_state = "health6"
if(pullin)
if(pulling)
pullin.icon_state = "pull"
else
pullin.icon_state = "pull0"
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if ((eye_blind))
blind.layer = 18
else
blind.layer = 0
if (disabilities & NEARSIGHT)
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += global_hud.blurry
if (druggy)
client.screen += global_hud.druggy
if (stat != 2)
if (machine)
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(!client.adminobs)
reset_view(null)
return 1
healths.icon_state = "health7"
+73 -92
View File
@@ -1,95 +1,5 @@
/mob/living/carbon/alien/Life()
if(..())
//First, resolve location and get a breath
if(SSair.times_fired%4==2)
//Only try to take a breath every 4 seconds, unless suffocating
spawn(0) breathe()
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
return 1
/mob/living/carbon/alien/handle_chemicals_in_body()
if(reagents)
reagents.metabolize(src)
if (drowsyness)
drowsyness--
eye_blurry = max(2, eye_blurry)
if (prob(5))
sleeping += 1
Paralyse(5)
confused = max(0, confused - 1)
// decrement dizziness counter, clamped to 0
if(resting)
dizziness = max(0, dizziness - 5)
jitteriness = max(0, jitteriness - 5)
else
dizziness = max(0, dizziness - 1)
jitteriness = max(0, jitteriness - 1)
updatehealth()
return //TODO: DEFERRED
/mob/living/carbon/alien/proc/breathe()
if(reagents)
if(reagents.has_reagent("lexorin")) return
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell)) return
var/datum/gas_mixture/environment = loc.return_air()
var/datum/gas_mixture/breath
// HACK NEED CHANGING LATER
if(health <= config.health_threshold_crit)
losebreath++
if(losebreath>0) //Suffocating so do not take a breath
losebreath--
if (prob(75)) //High chance of gasping for air
spawn emote("gasp")
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
else
//First, check for air from internal atmosphere (using an air tank and mask generally)
breath = get_breath_from_internal(BREATH_VOLUME)
//No breath from internal atmosphere so get breath from location
if(!breath)
if(istype(loc, /obj/))
var/obj/location_as_object = loc
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
else if(istype(loc, /turf/))
var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE
breath = loc.remove_air(breath_moles)
// Handle chem smoke effect -- Doohl
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
if(smoke)
smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs?
break // If they breathe in the nasty stuff once, no need to continue checking
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
handle_breath(breath)
if(breath)
loc.assume_air(breath)
/mob/living/carbon/alien/proc/handle_breath(datum/gas_mixture/breath)
/mob/living/carbon/alien/check_breath(datum/gas_mixture/breath)
if(status_flags & GODMODE)
return
@@ -117,4 +27,75 @@
breath.toxins -= toxins_used
breath.oxygen += toxins_used
return 1
//BREATH TEMPERATURE
handle_breath_temperature(breath)
/mob/living/carbon/alien/handle_regular_status_updates()
..()
//natural reduction of movement delay due to stun.
if(move_delay_add > 0)
move_delay_add = max(0, move_delay_add - rand(1, 2))
return 1
/mob/living/carbon/alien/handle_vision()
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
if (stat == 2)
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight |= SEE_MOBS
sight &= ~SEE_TURFS
sight &= ~SEE_OBJS
if(nightvision)
see_in_dark = 8
see_invisible = SEE_INVISIBLE_MINIMUM
else if(!nightvision)
see_in_dark = 4
see_invisible = 45
if(see_override)
see_invisible = see_override
if ((blind && stat != 2))
if((eye_blind))
blind.layer = 18
else
blind.layer = 0
if (disabilities & NEARSIGHT)
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += global_hud.blurry
if (druggy)
client.screen += global_hud.druggy
if (stat != 2)
if(machine)
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(!client.adminobs)
reset_view(null)
/mob/living/carbon/alien/handle_hud_icons()
handle_hud_icons_health()
if(pullin)
if(pulling)
pullin.icon_state = "pull"
else
pullin.icon_state = "pull0"
return 1
@@ -29,6 +29,9 @@
/mob/living/carbon/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
return
/mob/living/carbon/brain/blob_act()
return
/mob/living/carbon/brain/Move(var/atom/newloc)
if(container)
container.Move(newloc)
+65 -181
View File
@@ -1,40 +1,25 @@
/mob/living/carbon/brain/handle_breathing()
return
/mob/living/carbon/brain/handle_mutations_and_radiation()
if (radiation)
if (radiation > 100)
radiation = 100
if(!container)//If it's not in an MMI
src << "<span class='danger'>You feel weak.</span>"
else//Fluff-wise, since the brain can't detect anything itself, the MMI handles thing like that
src << "<span class='danger'>STATUS: CRITICAL AMOUNTS OF RADIATION DETECTED.</span>"
if (radiation < 0)
radiation = 0
switch(radiation)
if(0 to 50)
radiation--
if(prob(25))
adjustToxLoss(1)
updatehealth()
if(50 to 75)
radiation -= 2
adjustToxLoss(1)
if(prob(5))
radiation -= 5
if(!container)
src << "<span class='danger'>You feel weak.</span>"
else
src << "<span class='danger'>STATUS: DANGEROUS LEVELS OF RADIATION DETECTED.</span>"
updatehealth()
if(75 to 100)
radiation -= 3
adjustToxLoss(3)
updatehealth()
..()
/mob/living/carbon/brain/handle_environment(datum/gas_mixture/environment)
if(!environment)
@@ -61,193 +46,92 @@
if(exposed_temperature > bodytemperature)
var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
//adjustFireLoss(2.5*discomfort)
//adjustFireLoss(5.0*discomfort)
adjustFireLoss(20.0*discomfort)
else
var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
//adjustFireLoss(2.5*discomfort)
adjustFireLoss(5.0*discomfort)
/mob/living/carbon/brain/handle_chemicals_in_body()
if(reagents) reagents.metabolize(src)
confused = max(0, confused - 1)
// decrement dizziness counter, clamped to 0
if(resting)
dizziness = max(0, dizziness - 5)
else
dizziness = max(0, dizziness - 1)
updatehealth()
return //TODO: DEFERRED
/mob/living/carbon/brain/handle_regular_status_updates() //TODO: comment out the unused bits >_>
updatehealth()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
if(stat == DEAD)
eye_blind = max(eye_blind, 1)
silent = 0
else //ALIVE. LIGHTS ARE ON
else
updatehealth()
if( !container && (health < config.health_threshold_dead || ((world.time - timeofhostdeath) > config.revival_brain_life)) )
death()
eye_blind = max(eye_blind, 1)
silent = 0
return 1
if(health < config.health_threshold_crit)
stat = UNCONSCIOUS
eye_blind = max(eye_blind, 1)
else
stat = CONSCIOUS
//Handling EMP effect in the Life(), it's made VERY simply, and has some additional effects handled elsewhere
if(emp_damage) //This is pretty much a damage type only used by MMIs, dished out by the emp_act
if(!(container && istype(container, /obj/item/device/mmi)))
emp_damage = 0
//Handling EMP effect in the Life(), it's made VERY simply, and has some additional effects handled elsewhere
if(emp_damage) //This is pretty much a damage type only used by MMIs, dished out by the emp_act
if(!(container && istype(container, /obj/item/device/mmi)))
emp_damage = 0
else
emp_damage = round(emp_damage,1)//Let's have some nice numbers to work with
switch(emp_damage)
if(31 to INFINITY)
emp_damage = 30//Let's not overdo it
if(21 to 30)//High level of EMP damage, unable to see, hear, or speak
eye_blind = max(eye_blind, 1)
setEarDamage(-1,1)
silent = 1
if(!alert)//Sounds an alarm, but only once per 'level'
emote("alarm")
src << "<span class='danger'>Major electrical distruption detected: System rebooting.</span>"
alert = 1
if(prob(75))
emp_damage -= 1
if(20)
alert = 0
eye_blind = 0
setEarDamage(-1,0)
silent = 0
emp_damage -= 1
if(11 to 19)//Moderate level of EMP damage, resulting in nearsightedness and ear damage
eye_blurry = 1
setEarDamage(1,-1)
if(!alert)
emote("alert")
src << "<span class='danger'>Primary systems are now online.</span>"
alert = 1
if(prob(50))
emp_damage -= 1
if(10)
alert = 0
eye_blurry = 0
setEarDamage(0,-1)
emp_damage -= 1
if(2 to 9)//Low level of EMP damage, has few effects(handled elsewhere)
if(!alert)
emote("notice")
src << "<span class='danger'>System reboot nearly complete.</span>"
alert = 1
if(prob(25))
emp_damage -= 1
if(1)
alert = 0
src << "<span class='danger'>All systems restored.</span>"
emp_damage -= 1
else
emp_damage = round(emp_damage,1)//Let's have some nice numbers to work with
switch(emp_damage)
if(31 to INFINITY)
emp_damage = 30//Let's not overdo it
if(21 to 30)//High level of EMP damage, unable to see, hear, or speak
eye_blind = max(eye_blind, 1)
setEarDamage(-1,1)
silent = 1
if(!alert)//Sounds an alarm, but only once per 'level'
emote("alarm")
src << "<span class='danger'>Major electrical distruption detected: System rebooting.</span>"
alert = 1
if(prob(75))
emp_damage -= 1
if(20)
alert = 0
eye_blind = 0
setEarDamage(-1,0)
silent = 0
emp_damage -= 1
if(11 to 19)//Moderate level of EMP damage, resulting in nearsightedness and ear damage
eye_blurry = 1
setEarDamage(1,-1)
if(!alert)
emote("alert")
src << "<span class='danger'>Primary systems are now online.</span>"
alert = 1
if(prob(50))
emp_damage -= 1
if(10)
alert = 0
eye_blurry = 0
setEarDamage(0,-1)
emp_damage -= 1
if(2 to 9)//Low level of EMP damage, has few effects(handled elsewhere)
if(!alert)
emote("notice")
src << "<span class='danger'>System reboot nearly complete.</span>"
alert = 1
if(prob(25))
emp_damage -= 1
if(1)
alert = 0
src << "<span class='danger'>All systems restored.</span>"
emp_damage -= 1
eye_blind = 0
//Other
/* commented out because none of these should happen
if(stunned)
AdjustStunned(-1)
if(weakened)
weakened = max(weakened-1,0)
if(stuttering)
stuttering = max(stuttering-1, 0)
if(silent)
silent = max(silent-1, 0)
if(druggy)
druggy = max(druggy-1, 0)
*/
return 1
/mob/living/carbon/brain/handle_regular_hud_updates()
if (stat == 2)
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
see_in_dark = 2
see_invisible = SEE_INVISIBLE_LIVING
if(see_override)
see_invisible = see_override
handle_vision()
if (healths)
if (stat != 2)
switch(health)
if(100 to INFINITY)
healths.icon_state = "health0"
if(80 to 100)
healths.icon_state = "health1"
if(60 to 80)
healths.icon_state = "health2"
if(40 to 60)
healths.icon_state = "health3"
if(20 to 40)
healths.icon_state = "health4"
if(0 to 20)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
else
healths.icon_state = "health7"
if(pullin) pullin.icon_state = "pull[pulling ? 1 : 0]"
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if ((blind && stat != 2))
if (eye_blind)
blind.layer = 18
else
blind.layer = 0
if (disabilities & NEARSIGHT)
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += global_hud.blurry
if (druggy)
client.screen += global_hud.druggy
if (stat != 2)
if (machine)
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(!client.adminobs)
reset_view(null)
handle_hud_icons_health()
return 1
/*/mob/living/carbon/brain/emp_act(severity)
if(!(container && istype(container, /obj/item/device/mmi)))
return
else
switch(severity)
if(1)
emp_damage += rand(20,30)
if(2)
emp_damage += rand(10,20)
if(3)
emp_damage += rand(0,10)
..()*/
+7
View File
@@ -377,3 +377,10 @@ var/const/GALOSHES_DONT_HELP = 8
/mob/living/carbon/is_muzzled()
return(istype(src.wear_mask, /obj/item/clothing/mask/muzzle))
/mob/living/carbon/blob_act()
if (stat == DEAD)
return
else
show_message("<span class='userdanger'>The blob attacks!</span>")
adjustBruteLoss(10)
@@ -15,3 +15,8 @@
var/obj/item/weapon/tank/internal = null
var/datum/dna/dna = null//Carbon
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
var/co2overloadtime = null
var/temperature_resistance = T0C+75
@@ -82,6 +82,9 @@
else if(copytext(input,1,9) == "exclaims")
src << "<span class='danger'>Invalid emote.</span>"
return
else if(copytext(input,1,6) == "yells")
src << "<span class='danger'>Invalid emote.</span>"
return
else if(copytext(input,1,5) == "asks")
src << "<span class='danger'>Invalid emote.</span>"
return
@@ -203,6 +206,9 @@
else if(copytext(message,1,9) == "exclaims")
src << "<span class='danger'>Invalid emote.</span>"
return
else if(copytext(message,1,6) == "yells")
src << "<span class='danger'>Invalid emote.</span>"
return
else if(copytext(message,1,5) == "asks")
src << "<span class='danger'>Invalid emote.</span>"
return
+20 -10
View File
@@ -78,7 +78,6 @@
/mob/living/carbon/human/ex_act(severity, ex_target)
var/shielded = 0
var/b_loss = null
var/f_loss = null
switch (severity)
@@ -95,8 +94,7 @@
//user.throw_at(target, 200, 4)
if (2.0)
if (!shielded)
b_loss += 60
b_loss += 60
f_loss += 60
@@ -106,7 +104,7 @@
if (!istype(ears, /obj/item/clothing/ears/earmuffs))
adjustEarDamage(30, 120)
if (prob(70) && !shielded)
if (prob(70))
Paralyse(10)
if(3.0)
@@ -115,7 +113,7 @@
b_loss = b_loss/2
if (!istype(ears, /obj/item/clothing/ears/earmuffs))
adjustEarDamage(15,60)
if (prob(50) && !shielded)
if (prob(50))
Paralyse(10)
var/update = 0
@@ -138,17 +136,13 @@
..()
/mob/living/carbon/human/blob_act()
if(stat == 2) return
if(stat == DEAD) return
show_message("<span class='userdanger'> The blob attacks you!</span>")
var/dam_zone = pick("chest", "l_hand", "r_hand", "l_leg", "r_leg")
var/obj/item/organ/limb/affecting = get_organ(ran_zone(dam_zone))
apply_damage(5, BRUTE, affecting, run_armor_check(affecting, "melee"))
return
/mob/living/carbon/human/var/co2overloadtime = null
/mob/living/carbon/human/var/temperature_resistance = T0C+75
/mob/living/carbon/human/show_inv(mob/user)
user.set_machine(src)
var/has_breathable_mask = istype(wear_mask, /obj/item/clothing/mask)
@@ -717,3 +711,19 @@
H.w_uniform.add_fingerprint(M)
..()
/mob/living/carbon/human/generateStaticOverlay()
var/image/staticOverlay = image(icon('icons/effects/effects.dmi', "static"), loc = src)
staticOverlay.override = 1
staticOverlays["static"] = staticOverlay
staticOverlay = image(icon('icons/effects/effects.dmi', "blank"), loc = src)
staticOverlay.override = 1
staticOverlays["blank"] = staticOverlay
staticOverlay = getLetterImage(src, "H", 1)
staticOverlay.override = 1
staticOverlays["letter"] = staticOverlay
@@ -44,8 +44,6 @@
var/special_voice = "" // For changing our voice. Used by a symptom.
var/failed_last_breath = 0 //This is used to determine if the mob failed a breath. If they did fail a brath, they will attempt to breathe each tick, otherwise just once per 4 ticks.
var/xylophone = 0 //For the spoooooooky xylophone cooldown
var/gender_ambiguous = 0 //if something goes wrong during gender reassignment this generates a line in examine
+48 -308
View File
@@ -6,8 +6,6 @@
#define TINT_IMPAIR 2 //Threshold of tint level to apply weld mask overlay
#define TINT_BLIND 3 //Threshold of tint level to obscure vision fully
#define HUMAN_MAX_OXYLOSS 3 //Defines how much oxyloss humans can get per tick. A tile with no air at all (such as space) applies this value, otherwise it's a percentage of it.
#define HEAT_DAMAGE_LEVEL_1 2 //Amount of damage applied when your body temperature just passes the 360.15k safety point
#define HEAT_DAMAGE_LEVEL_2 3 //Amount of damage applied when your body temperature passes the 400K point
#define HEAT_DAMAGE_LEVEL_3 8 //Amount of damage applied when your body temperature passes the 460K point and you are on fire
@@ -31,20 +29,15 @@
/mob/living/carbon/human/Life()
set invisibility = 0
set background = BACKGROUND_ENABLED
if (notransform)
return
tinttotal = tintcheck() //here as both hud updates and status updates call it
if(..())
if(dna)
for(var/datum/mutation/human/HM in dna.mutations)
HM.on_life(src)
if(SSmob.times_fired%4==2 || failed_last_breath) //First, resolve location and get a breath
breathe() //Only try to take a breath every 4 ticks, unless suffocating
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
//Stuff jammed in your limbs hurts
handle_embedded_objects()
@@ -73,7 +66,19 @@
/mob/living/carbon/human/handle_disabilities()
if (getBrainLoss() >= 60 && stat != 2)
..()
//Eyes
if(!(disabilities & BLIND))
if(tinttotal >= TINT_BLIND) //covering your eyes heals blurry eyes faster
eye_blurry = max(eye_blurry-2, 0)
//Ears
if(!(disabilities & DEAF))
if(istype(ears, /obj/item/clothing/ears/earmuffs)) // earmuffs rest your ears, healing ear_deaf faster and ear_damage, but keeping you deaf.
setEarDamage(max(ear_damage-0.10, 0), max(ear_deaf - 1, 1))
if (getBrainLoss() >= 60 && stat != DEAD)
if (prob(3))
switch(pick(1,2,3))
if(1)
@@ -86,9 +91,10 @@
/mob/living/carbon/human/handle_mutations_and_radiation()
if(dna)
dna.species.handle_mutations_and_radiation(src)
if(dna.species.handle_mutations_and_radiation(src))
..()
/mob/living/carbon/human/proc/breathe()
/mob/living/carbon/human/breathe()
if(dna)
dna.species.breathe(src)
@@ -134,27 +140,8 @@
dna.species.ExtinguishMob(src)
else
..()
//END FIRE CODE
/*
/mob/living/carbon/human/proc/adjust_body_temperature(current, loc_temp, boost)
var/temperature = current
var/difference = abs(current-loc_temp) //get difference
var/increments// = difference/10 //find how many increments apart they are
if(difference > 50)
increments = difference/5
else
increments = difference/10
var/change = increments*boost // Get the amount to change by (x per increment)
var/temp_change
if(current < loc_temp)
temperature = min(loc_temp, temperature+change)
else if(current > loc_temp)
temperature = max(loc_temp, temperature-change)
temp_change = (temperature - current)
return temp_change
*/
/mob/living/carbon/human/proc/stabilize_temperature_from_calories()
switch(bodytemperature)
@@ -291,290 +278,28 @@
return min(1,thermal_protection)
/*
/mob/living/carbon/human/proc/add_fire_protection(var/temp)
var/fire_prot = 0
if(head)
if(head.protective_temperature > temp)
fire_prot += (head.protective_temperature/10)
if(wear_mask)
if(wear_mask.protective_temperature > temp)
fire_prot += (wear_mask.protective_temperature/10)
if(glasses)
if(glasses.protective_temperature > temp)
fire_prot += (glasses.protective_temperature/10)
if(ears)
if(ears.protective_temperature > temp)
fire_prot += (ears.protective_temperature/10)
if(wear_suit)
if(wear_suit.protective_temperature > temp)
fire_prot += (wear_suit.protective_temperature/10)
if(w_uniform)
if(w_uniform.protective_temperature > temp)
fire_prot += (w_uniform.protective_temperature/10)
if(gloves)
if(gloves.protective_temperature > temp)
fire_prot += (gloves.protective_temperature/10)
if(shoes)
if(shoes.protective_temperature > temp)
fire_prot += (shoes.protective_temperature/10)
return fire_prot
/mob/living/carbon/human/proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity)
if(nodamage)
return
//world <<"body_part = [body_part], exposed_temperature = [exposed_temperature], exposed_intensity = [exposed_intensity]"
var/discomfort = min(abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
if(exposed_temperature > bodytemperature)
discomfort *= 4
if(mutantrace == "plant")
discomfort *= TEMPERATURE_DAMAGE_COEFFICIENT * 2 //I don't like magic numbers. I'll make mutantraces a datum with vars sometime later. -- Urist
else
discomfort *= TEMPERATURE_DAMAGE_COEFFICIENT //Dangercon 2011 - now with less magic numbers!
//world <<"[discomfort]"
switch(body_part)
if(HEAD)
apply_damage(2.5*discomfort, BURN, "head")
if(CHEST)
apply_damage(2.5*discomfort, BURN, "chest")
if(LEGS)
apply_damage(0.6*discomfort, BURN, "l_leg")
apply_damage(0.6*discomfort, BURN, "r_leg")
if(ARMS)
apply_damage(0.4*discomfort, BURN, "l_arm")
apply_damage(0.4*discomfort, BURN, "r_arm")
*/
/mob/living/carbon/human/handle_chemicals_in_body()
..()
if(dna)
dna.species.handle_chemicals_in_body(src)
return //TODO: DEFERRED
/mob/living/carbon/human/handle_regular_status_updates()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
silent = 0
else //ALIVE. LIGHTS ARE ON
updatehealth() //TODO
if(health <= config.health_threshold_dead || !getorgan(/obj/item/organ/brain))
death()
silent = 0
return 1
//UNCONSCIOUS. NO-ONE IS HOME
if( (getOxyLoss() > 50) || (config.health_threshold_crit >= health) )
Paralyse(3)
if(hallucination)
spawn handle_hallucinations()
if(hallucination<=2)
hallucination = 0
else
hallucination -= 2
else
for(var/atom/a in hallucinations)
qdel(a)
if(paralysis)
AdjustParalysis(-1)
stat = UNCONSCIOUS
else if(sleeping)
handle_dreams()
adjustStaminaLoss(-10)
sleeping = max(sleeping-1, 0)
stat = UNCONSCIOUS
if( prob(10) && health && !hal_crit )
spawn(0)
emote("snore")
else if (status_flags & FAKEDEATH)
stat = UNCONSCIOUS
//CONSCIOUS
else
stat = CONSCIOUS
//Eyes
if(disabilities & BLIND || stat) //disabled-blind, doesn't get better on its own
eye_blind = max(eye_blind, 1)
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
else if(tinttotal >= TINT_BLIND) //covering your eyes heals blurry eyes faster
eye_blurry = max(eye_blurry-3, 0)
else if(eye_blurry) //blurry eyes heal slowly
eye_blurry = max(eye_blurry-1, 0)
//Ears
if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
setEarDamage(-1, max(ear_deaf, 1))
else if (ear_damage < 100) // deafness heals slowly over time, unless ear_damage is over 100
if(istype(ears, /obj/item/clothing/ears/earmuffs)) // earmuffs rest your ears, healing 3x faster, but keeping you deaf.
setEarDamage(max(ear_damage-0.15, 0), max(ear_deaf - 1, 1))
else
adjustEarDamage(-0.05, -1)
//Dizziness
if(dizziness)
var/client/C = client
var/pixel_x_diff = 0
var/pixel_y_diff = 0
var/temp
var/saved_dizz = dizziness
dizziness = max(dizziness-1, 0)
if(C)
var/oldsrc = src
var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70 // This shit is annoying at high strength
src = null
spawn(0)
if(C)
temp = amplitude * sin(0.008 * saved_dizz * world.time)
pixel_x_diff += temp
C.pixel_x += temp
temp = amplitude * cos(0.008 * saved_dizz * world.time)
pixel_y_diff += temp
C.pixel_y += temp
sleep(3)
if(C)
temp = amplitude * sin(0.008 * saved_dizz * world.time)
pixel_x_diff += temp
C.pixel_x += temp
temp = amplitude * cos(0.008 * saved_dizz * world.time)
pixel_y_diff += temp
C.pixel_y += temp
sleep(3)
if(C)
C.pixel_x -= pixel_x_diff
C.pixel_y -= pixel_y_diff
src = oldsrc
//Jitteryness
if(jitteriness)
do_jitter_animation(jitteriness)
jitteriness = max(jitteriness-1, 0)
//Other
if(stunned)
AdjustStunned(-1)
if(weakened)
weakened = max(weakened-1,0)
if(stuttering)
stuttering = max(stuttering-1, 0)
if(slurring)
slurring = max(slurring-1,0)
if(silent)
silent = max(silent-1, 0)
if(druggy)
druggy = max(druggy-1, 0)
CheckStamina()
/mob/living/carbon/human/handle_vision()
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
if(machine)
if(!machine.check_eye(src)) reset_view(null)
else
if(!client.adminobs) reset_view(null)
if(dna)
dna.species.handle_vision(src)
return 1
/mob/living/carbon/human/handle_regular_hud_updates()
if(!client) return 0
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
update_action_buttons()
if(damageoverlay.overlays)
damageoverlay.overlays = list()
if(stat == UNCONSCIOUS)
//Critical damage passage overlay
if(health <= config.health_threshold_crit)
var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "passage0")
I.blend_mode = BLEND_OVERLAY //damageoverlay is BLEND_MULTIPLY
switch(health)
if(-20 to -10)
I.icon_state = "passage1"
if(-30 to -20)
I.icon_state = "passage2"
if(-40 to -30)
I.icon_state = "passage3"
if(-50 to -40)
I.icon_state = "passage4"
if(-60 to -50)
I.icon_state = "passage5"
if(-70 to -60)
I.icon_state = "passage6"
if(-80 to -70)
I.icon_state = "passage7"
if(-90 to -80)
I.icon_state = "passage8"
if(-95 to -90)
I.icon_state = "passage9"
if(-INFINITY to -95)
I.icon_state = "passage10"
damageoverlay.overlays += I
else
//Oxygen damage overlay
if(oxyloss)
var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "oxydamageoverlay0")
switch(oxyloss)
if(10 to 20)
I.icon_state = "oxydamageoverlay1"
if(20 to 25)
I.icon_state = "oxydamageoverlay2"
if(25 to 30)
I.icon_state = "oxydamageoverlay3"
if(30 to 35)
I.icon_state = "oxydamageoverlay4"
if(35 to 40)
I.icon_state = "oxydamageoverlay5"
if(40 to 45)
I.icon_state = "oxydamageoverlay6"
if(45 to INFINITY)
I.icon_state = "oxydamageoverlay7"
damageoverlay.overlays += I
//Fire and Brute damage overlay (BSSR)
var/hurtdamage = src.getBruteLoss() + src.getFireLoss() + damageoverlaytemp
damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not.
if(hurtdamage)
var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "brutedamageoverlay0")
I.blend_mode = BLEND_ADD
switch(hurtdamage)
if(5 to 15)
I.icon_state = "brutedamageoverlay1"
if(15 to 30)
I.icon_state = "brutedamageoverlay2"
if(30 to 45)
I.icon_state = "brutedamageoverlay3"
if(45 to 70)
I.icon_state = "brutedamageoverlay4"
if(70 to 85)
I.icon_state = "brutedamageoverlay5"
if(85 to INFINITY)
I.icon_state = "brutedamageoverlay6"
var/image/black = image(I.icon, I.icon_state) //BLEND_ADD doesn't let us darken, so this is just to blacken the edge of the screen
black.color = "#170000"
damageoverlay.overlays += I
damageoverlay.overlays += black
if(machine)
if(!machine.check_eye(src)) reset_view(null)
else
if(!client.adminobs) reset_view(null)
/mob/living/carbon/human/handle_hud_icons()
if(dna)
dna.species.handle_hud_icons(src)
return 1
/mob/living/carbon/human/handle_random_events()
// Puke if toxloss is too high
if(!stat)
@@ -599,10 +324,25 @@
/mob/living/carbon/human/handle_changeling()
if(mind && mind.changeling)
mind.changeling.regenerate()
if(mind)
if(mind.changeling)
mind.changeling.regenerate()
hud_used.lingchemdisplay.invisibility = 0
hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'> <font color='#dd66dd'>[mind.changeling.chem_charges]</font></div>"
else
hud_used.lingchemdisplay.invisibility = 101
/mob/living/carbon/human/has_smoke_protection()
if(wear_mask)
if(wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT)
. = 1
if(glasses)
if(glasses.flags & BLOCK_GAS_SMOKE_EFFECT)
. = 1
if(head)
if(head.flags & BLOCK_GAS_SMOKE_EFFECT)
. = 1
return .
/mob/living/carbon/human/proc/handle_embedded_objects()
for(var/obj/item/organ/limb/L in organs)
for(var/obj/item/I in L.embedded_objects)
@@ -616,4 +356,4 @@
I.loc = get_turf(src)
visible_message("<span class='danger'>\the [I] falls out of [name]'s [L.getDisplayName()]!</span>","<span class='userdanger'>\the [I] falls out of your [L.getDisplayName()]!</span>")
#undef HUMAN_MAX_OXYLOSS
#undef HUMAN_MAX_OXYLOSS
+4 -2
View File
@@ -10,9 +10,11 @@
var/mob/living/L = src
if (L.getBrainLoss() >= 60)
return "gibbers, \"[text]\"";
if (ending == "?")
if(ending == "?")
return "asks, \"[text]\"";
if (ending == "!")
if(copytext(text, length(text) - 1) == "!!")
return "yells, \"<span class = 'yell'>[text]</span>\"";
if(ending == "!")
return "exclaims, \"[text]\"";
if(dna)
+83 -71
View File
@@ -1,8 +1,11 @@
// This code handles different species in the game.
#define SPECIES_LAYER 23
#define BODY_LAYER 22
#define HAIR_LAYER 8
#define SPECIES_LAYER 26
#define BODY_BEHIND_LAYER 25
#define BODY_LAYER 24
#define BODY_ADJ_LAYER 23
#define HAIR_LAYER 9
#define BODY_FRONT_LAYER 2
#define TINT_IMPAIR 2
#define TINT_BLIND 3
@@ -44,6 +47,8 @@
var/say_mod = "says" // affects the speech message
var/list/mutant_bodyparts = list() // Parts of the body that are diferent enough from the standard human model that they cause clipping with some equipment
var/speedmod = 0 // this affects the race's speed. positive numbers make it move slower, negative numbers make it move faster
var/armor = 0 // overall defense for the race... or less defense, if it's negative.
var/brutemod = 1 // multiplier for brute damage
@@ -87,19 +92,24 @@
var/g = (H.gender == FEMALE) ? "f" : "m"
if(!config.mutant_colors)
H.dna.mutant_color = default_color
if(MUTCOLORS in specflags)
var/image/spec_base
var/icon_state_string = "[id]_"
if(sexes)
spec_base = image("icon" = 'icons/mob/human.dmi', "icon_state" = "[id]_[g]_s", "layer" = -SPECIES_LAYER)
icon_state_string += "[g]_s"
else
spec_base = image("icon" = 'icons/mob/human.dmi', "icon_state" = "[id]_s", "layer" = -SPECIES_LAYER)
if(!config.mutant_colors)
H.dna.mutant_color = default_color
icon_state_string += "_s"
spec_base = image("icon" = 'icons/mob/human.dmi', "icon_state" = icon_state_string, "layer" = -SPECIES_LAYER)
spec_base.color = "#[H.dna.mutant_color]"
standing = spec_base
if(standing)
H.overlays_standing[SPECIES_LAYER] = standing
H.overlays_standing[SPECIES_LAYER] += standing
H.apply_overlay(SPECIES_LAYER)
@@ -172,6 +182,8 @@
var/list/standing = list()
handle_mutant_bodyparts(H)
// lipstick
if(H.lip_style && LIPS in specflags)
standing += image("icon"='icons/mob/human_face.dmi', "icon_state"="lips_[H.lip_style]_s", "layer" = -BODY_LAYER)
@@ -208,6 +220,53 @@
return
/datum/species/proc/handle_mutant_bodyparts(var/mob/living/carbon/human/H)
var/list/bodyparts_to_add = mutant_bodyparts.Copy()
var/list/relevent_layers = list(BODY_BEHIND_LAYER, BODY_ADJ_LAYER, BODY_FRONT_LAYER)
var/list/standing = list()
H.remove_overlay(BODY_BEHIND_LAYER)
H.remove_overlay(BODY_ADJ_LAYER)
H.remove_overlay(BODY_FRONT_LAYER)
if(!mutant_bodyparts)
return
if("tail" in mutant_bodyparts)
if(H.wear_suit && (H.wear_suit.flags_inv & HIDEJUMPSUIT))
bodyparts_to_add -= "tail"
if("snout" in mutant_bodyparts) //Take a closer look at that snout!
if(H.wear_mask && (H.wear_mask.flags_inv & HIDEFACE))
bodyparts_to_add -= "snout"
if(!bodyparts_to_add)
return
var/icon_state_string = "[id]_"
var/g = (H.gender == FEMALE) ? "f" : "m"
var/image/I
if(sexes)
icon_state_string += "[g]_s"
else
icon_state_string += "_s"
if(!config.mutant_colors)
H.dna.mutant_color = default_color
for(var/layer in relevent_layers)
for(var/bodypart in bodyparts_to_add)
I = image("icon" = 'icons/mob/mutant_bodyparts.dmi', "icon_state" = "[icon_state_string]_[bodypart]_[layer]", "layer" =- layer)
I.color = "#[H.dna.mutant_color]"
standing += I
H.overlays_standing[layer] = standing.Copy()
standing = list()
H.apply_overlay(BODY_BEHIND_LAYER)
H.apply_overlay(BODY_ADJ_LAYER)
H.apply_overlay(BODY_FRONT_LAYER)
/datum/species/proc/spec_life(var/mob/living/carbon/human/H)
return
@@ -390,7 +449,6 @@
////////
/datum/species/proc/handle_chemicals_in_body(var/mob/living/carbon/human/H)
if(H.reagents) H.reagents.metabolize(H)
//The fucking FAT mutation is the dumbest shit ever. It makes the code so difficult to work with
if(H.disabilities & FAT)
@@ -442,22 +500,6 @@
H << "<span class='notice'>You no longer feel vigorous.</span>"
H.metabolism_efficiency = 1
if (H.drowsyness)
H.drowsyness--
H.eye_blurry = max(2, H.eye_blurry)
if (prob(5))
H.sleeping += 1
H.Paralyse(5)
H.confused = max(0, H.confused - 1)
// decrement dizziness counter, clamped to 0
if(H.resting)
H.dizziness = max(0, H.dizziness - 15)
H.jitteriness = max(0, H.jitteriness - 15)
else
H.dizziness = max(0, H.dizziness - 3)
H.jitteriness = max(0, H.jitteriness - 3)
H.updatehealth()
return
@@ -476,13 +518,6 @@
if(H.seer)
H.see_invisible = SEE_INVISIBLE_OBSERVER
if(H.mind)
if(H.mind.changeling)
H.hud_used.lingchemdisplay.invisibility = 0
H.hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'> <font color='#dd66dd'>[H.mind.changeling.chem_charges]</font></div>"
else
H.hud_used.lingchemdisplay.invisibility = 101
if(H.glasses)
if(istype(H.glasses, /obj/item/clothing/glasses))
var/obj/item/clothing/glasses/G = H.glasses
@@ -585,29 +620,17 @@
/datum/species/proc/handle_mutations_and_radiation(var/mob/living/carbon/human/H)
if (H.radiation && !(RADIMMUNE in specflags))
if (H.radiation > 100)
H.radiation = 100
H.Weaken(10)
H << "<span class='danger'>You feel weak.</span>"
H.emote("collapse")
if(!(RADIMMUNE in specflags))
if(H.radiation)
if (H.radiation > 100)
H.Weaken(10)
H << "<span class='danger'>You feel weak.</span>"
H.emote("collapse")
if (H.radiation < 0)
H.radiation = 0
else
switch(H.radiation)
if(0 to 50)
H.radiation--
if(prob(25))
H.adjustToxLoss(1)
H.updatehealth()
if(50 to 75)
H.radiation -= 2
H.adjustToxLoss(1)
if(prob(5))
H.radiation -= 5
H.Weaken(3)
H << "<span class='danger'>You feel weak.</span>"
H.emote("collapse")
@@ -618,17 +641,14 @@
H.facial_hair_style = "Shaved"
H.hair_style = "Bald"
H.update_hair()
H.updatehealth()
if(75 to 100)
H.radiation -= 3
H.adjustToxLoss(3)
if(prob(1))
H << "<span class='danger'>You mutate!</span>"
randmutb(H)
domutcheck(H,null)
H.emote("gasp")
H.updatehealth()
return 1
////////////////
// MOVE SPEED //
@@ -1017,20 +1037,9 @@
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
breath = H.loc.remove_air(breath_moles)
// Handle chem smoke effect -- Doohl
var/block = 0
if(H.wear_mask)
if(H.wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT)
block = 1
if(H.glasses)
if(H.glasses.flags & BLOCK_GAS_SMOKE_EFFECT)
block = 1
if(H.head)
if(H.head.flags & BLOCK_GAS_SMOKE_EFFECT)
block = 1
if(!block)
if(!H.has_smoke_protection())
for(var/obj/effect/effect/chem_smoke/smoke in view(1, H))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(H, INGEST)
@@ -1044,12 +1053,12 @@
var/obj/location_as_object = H.loc
location_as_object.handle_internal_lifeform(H, 0)
handle_breath(breath, H)
check_breath(breath, H)
if(breath)
H.loc.assume_air(breath)
/datum/species/proc/handle_breath(datum/gas_mixture/breath, var/mob/living/carbon/human/H)
/datum/species/proc/check_breath(datum/gas_mixture/breath, var/mob/living/carbon/human/H)
if((H.status_flags & GODMODE))
return
@@ -1142,11 +1151,11 @@
if(prob(20))
spawn(0) H.emote(pick("giggle", "laugh"))
handle_temperature(breath, H)
handle_breath_temperature(breath, H)
return 1
/datum/species/proc/handle_temperature(datum/gas_mixture/breath, var/mob/living/carbon/human/H) // called by human/life, handles temperatures
/datum/species/proc/handle_breath_temperature(datum/gas_mixture/breath, var/mob/living/carbon/human/H) // called by human/life, handles temperatures
if( (abs(310.15 - breath.temperature) > 50) && !(mutations_list[COLDRES] in H.dna.mutations) && !(COLDRES in specflags)) // Hot air hurts :(
if(!(mutations_list[COLDRES] in H.dna.mutations)) // COLD DAMAGE
@@ -1283,8 +1292,11 @@
H.update_fire()
#undef SPECIES_LAYER
#undef BODY_BEHIND_LAYER
#undef BODY_LAYER
#undef BODY_ADJ_LAYER
#undef HAIR_LAYER
#undef BODY_FRONT_LAYER
#undef HUMAN_MAX_OXYLOSS
#undef HUMAN_CRIT_MAX_OXYLOSS
@@ -30,6 +30,7 @@
default_color = "00FF00"
roundstart = 1
specflags = list(MUTCOLORS,EYECOLOR,LIPS)
mutant_bodyparts = list("tail", "snout")
attack_verb = "slash"
attack_sound = 'sound/weapons/slash.ogg'
miss_sound = 'sound/weapons/slashmiss.ogg'
@@ -55,30 +55,33 @@ Please contact me on #coderbus IRC. ~Carnie x
*/
//Human Overlays Indexes/////////
#define SPECIES_LAYER 23 // mutantrace colors... these are on a seperate layer in order to prvent
#define BODY_LAYER 22 //underwear, undershirts, socks, eyes, lips(makeup)
#define MUTATIONS_LAYER 21 //Tk headglows etc.
#define AUGMENTS_LAYER 20
#define DAMAGE_LAYER 19 //damage indicators (cuts and burns)
#define UNIFORM_LAYER 18
#define ID_LAYER 17
#define SHOES_LAYER 16
#define GLOVES_LAYER 15
#define EARS_LAYER 14
#define SUIT_LAYER 13
#define GLASSES_LAYER 12
#define BELT_LAYER 11 //Possible make this an overlay of somethign required to wear a belt?
#define SUIT_STORE_LAYER 10
#define BACK_LAYER 9
#define HAIR_LAYER 8 //TODO: make part of head layer?
#define FACEMASK_LAYER 7
#define HEAD_LAYER 6
#define HANDCUFF_LAYER 5
#define LEGCUFF_LAYER 4
#define L_HAND_LAYER 3
#define R_HAND_LAYER 2 //Having the two hands seperate seems rather silly, merge them together? It'll allow for code to be reused on mobs with arbitarily many hands
#define SPECIES_LAYER 26 // mutantrace colors... these are on a seperate layer in order to prvent
#define BODY_BEHIND_LAYER 25
#define BODY_LAYER 24 //underwear, undershirts, socks, eyes, lips(makeup)
#define BODY_ADJ_LAYER 23
#define MUTATIONS_LAYER 22 //Tk headglows etc.
#define AUGMENTS_LAYER 21
#define DAMAGE_LAYER 20 //damage indicators (cuts and burns)
#define UNIFORM_LAYER 19
#define ID_LAYER 18
#define SHOES_LAYER 17
#define GLOVES_LAYER 16
#define EARS_LAYER 15
#define SUIT_LAYER 14
#define GLASSES_LAYER 13
#define BELT_LAYER 12 //Possible make this an overlay of somethign required to wear a belt?
#define SUIT_STORE_LAYER 11
#define BACK_LAYER 10
#define HAIR_LAYER 9 //TODO: make part of head layer?
#define FACEMASK_LAYER 8
#define HEAD_LAYER 7
#define HANDCUFF_LAYER 6
#define LEGCUFF_LAYER 5
#define L_HAND_LAYER 4
#define R_HAND_LAYER 3 //Having the two hands seperate seems rather silly, merge them together? It'll allow for code to be reused on mobs with arbitarily many hands
#define BODY_FRONT_LAYER 2
#define FIRE_LAYER 1 //If you're on fire
#define TOTAL_LAYERS 23 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
#define TOTAL_LAYERS 26 //KEEP THIS UP-TO-DATE OR SHIT WILL BREAK ;_;
//////////////////////////////////
/mob/living/carbon/human
@@ -158,6 +161,11 @@ Please contact me on #coderbus IRC. ~Carnie x
if(dna && !(disabilities & HUSK))
dna.species.update_color(src)
/mob/living/carbon/human/proc/update_mutant_bodyparts()
if(dna)
dna.species.handle_mutant_bodyparts(src)
/mob/living/carbon/human/proc/update_body()
remove_overlay(BODY_LAYER)
@@ -438,8 +446,9 @@ Please contact me on #coderbus IRC. ~Carnie x
standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="[S.blood_overlay_type]blood")
src.update_hair()
apply_overlay(SUIT_LAYER)
src.update_mutant_bodyparts()
apply_overlay(SUIT_LAYER)
/mob/living/carbon/human/update_inv_pockets()
if(l_store)
@@ -467,10 +476,10 @@ Please contact me on #coderbus IRC. ~Carnie x
if(wear_mask.blood_DNA && !istype(wear_mask, /obj/item/clothing/mask/cigarette))
standing.overlays += image("icon"='icons/effects/blood.dmi', "icon_state"="maskblood")
update_mutant_bodyparts()
apply_overlay(FACEMASK_LAYER)
/mob/living/carbon/human/update_inv_back()
remove_overlay(BACK_LAYER)
+568 -75
View File
@@ -1,3 +1,242 @@
/mob/living/carbon
var/oxygen_alert = 0
var/toxins_alert = 0
var/fire_alert = 0
var/pressure_alert = 0
var/temperature_alert = 0
/mob/living/carbon/Life()
set invisibility = 0
set background = BACKGROUND_ENABLED
if (notransform)
return
if(!loc)
return
var/datum/gas_mixture/environment = loc.return_air()
if(stat != DEAD)
//Breathing, if applicable
handle_breathing()
//Updates the number of stored chemicals for powers
handle_changeling()
//Mutations and radiation
handle_mutations_and_radiation()
//Chemicals in the body
handle_chemicals_in_body()
//Blud
handle_blood()
//Random events (vomiting etc)
handle_random_events()
. = 1
//Handle temperature/pressure differences between body and environment
handle_environment(environment)
handle_fire()
//stuff in the stomach
handle_stomach()
update_canmove()
update_gravity(mob_has_gravity())
for(var/obj/item/weapon/grab/G in src)
G.process()
handle_regular_status_updates() // Status updates, death etc.
if(client)
handle_regular_hud_updates()
return .
///////////////
// BREATHING //
///////////////
//Start of a breath chain, calls breathe()
/mob/living/carbon/proc/handle_breathing()
if(SSmob.times_fired%4==2 || failed_last_breath)
breathe() //Breathe per 4 ticks, unless suffocating
else
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src,0)
//Second link in a breath chain, calls check_breath()
/mob/living/carbon/proc/breathe()
if(reagents.has_reagent("lexorin"))
return
if(istype(loc, /obj/machinery/atmospherics/unary/cryo_cell))
return
var/datum/gas_mixture/environment
if(loc)
environment = loc.return_air()
var/datum/gas_mixture/breath
if(health <= config.health_threshold_crit)
losebreath++
//Suffocate
if(losebreath > 0)
losebreath--
if(prob(10))
spawn emote("gasp")
if(istype(loc, /obj/))
var/obj/loc_as_obj = loc
loc_as_obj.handle_internal_lifeform(src,0)
else
//Breathe from internal
breath = get_breath_from_internal(BREATH_VOLUME)
if(!breath)
if(isobj(loc)) //Breathe from loc as object
var/obj/loc_as_obj = loc
breath = loc_as_obj.handle_internal_lifeform(src, BREATH_VOLUME)
else if(isturf(loc)) //Breathe from loc as turf
var/breath_moles = 0
if(environment)
breath_moles = environment.total_moles()*BREATH_PERCENTAGE
breath = loc.remove_air(breath_moles)
//Harmful gasses
if(!has_smoke_protection())
for(var/obj/effect/effect/chem_smoke/smoke in view(1,src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src,INGEST)
spawn(5)
if(smoke)
smoke.reagents.copy_to(src, 10)
break
else //Breathe from loc as obj again
if(istype(loc, /obj/))
var/obj/loc_as_obj = loc
loc_as_obj.handle_internal_lifeform(src,0)
check_breath(breath)
if(breath)
loc.assume_air(breath)
/mob/living/carbon/proc/has_smoke_protection()
return 0
//Third link in a breath chain, calls handle_breath_temperature()
/mob/living/carbon/proc/check_breath(datum/gas_mixture/breath)
if((status_flags & GODMODE))
return
//CRIT
if(!breath || (breath.total_moles() == 0))
if(reagents.has_reagent("epinephrine"))
return
adjustOxyLoss(1)
failed_last_breath = 1
throw_alert("oxy")
return 0
var/safe_oxy_min = 16
var/safe_co2_max = 10
var/safe_tox_max = 0.05
var/SA_para_min = 1
var/SA_sleep_min = 5
var/oxygen_used = 0
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
var/O2_partialpressure = (breath.oxygen/breath.total_moles())*breath_pressure
var/Toxins_partialpressure = (breath.toxins/breath.total_moles())*breath_pressure
var/CO2_partialpressure = (breath.carbon_dioxide/breath.total_moles())*breath_pressure
//OXYGEN
if(O2_partialpressure < safe_oxy_min) //Not enough oxygen
if(prob(20))
spawn(0)
emote("gasp")
if(O2_partialpressure > 0)
var/ratio = safe_oxy_min/O2_partialpressure
adjustOxyLoss(min(5*ratio, 3))
failed_last_breath = 1
oxygen_used = breath.oxygen*ratio/6
else
adjustOxyLoss(3)
failed_last_breath = 1
throw_alert("oxy")
else //Enough oxygen
failed_last_breath = 0
adjustOxyLoss(-5)
oxygen_used = breath.oxygen/6
clear_alert("oxy")
breath.oxygen -= oxygen_used
breath.carbon_dioxide += oxygen_used
//CARBON DIOXIDE
if(CO2_partialpressure > safe_co2_max)
if(!co2overloadtime)
co2overloadtime = world.time
else if(world.time - co2overloadtime > 120)
Paralyse(3)
adjustOxyLoss(3)
if(world.time - co2overloadtime > 300)
adjustOxyLoss(8)
if(prob(20))
spawn(0) emote("cough")
else
co2overloadtime = 0
//TOXINS/PLASMA
if(Toxins_partialpressure > safe_tox_max)
var/ratio = (breath.toxins/safe_tox_max) * 10
if(reagents)
reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE))
throw_alert("tox_in_air")
else
clear_alert("tox_in_air")
//TRACE GASES
if(breath.trace_gases.len)
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
var/SA_partialpressure = (SA.moles/breath.total_moles())*breath_pressure
if(SA_partialpressure > SA_para_min)
Paralyse(3)
if(SA_partialpressure > SA_sleep_min)
sleeping = max(sleeping+2, 10)
else if(SA_partialpressure > 0.01)
if(prob(20))
spawn(0) emote(pick("giggle","laugh"))
//BREATH TEMPERATURE
handle_breath_temperature(breath)
return 1
//Fourth and final link in a breath chain
/mob/living/carbon/proc/handle_breath_temperature(datum/gas_mixture/breath)
/mob/living/carbon/proc/get_breath_from_internal(volume_needed)
if(internal)
if (!contents.Find(internal))
@@ -13,85 +252,56 @@
internals.icon_state = "internal0"
return
/mob/living/carbon/Life()
set invisibility = 0
set background = BACKGROUND_ENABLED
if (notransform)
return
if(!loc)
return
var/datum/gas_mixture/environment = loc.return_air()
//Handle temperature/pressure differences between body and environment
handle_environment(environment)
handle_regular_status_updates() // Status updates, death etc.
if(stat != DEAD)
//Updates the number of stored chemicals for powers
handle_changeling()
//Mutations and radiation
handle_mutations_and_radiation()
//Chemicals in the body
handle_chemicals_in_body()
//Disabilities
handle_disabilities()
//Blud
handle_blood()
//Random events (vomiting etc)
handle_random_events()
. = 1
handle_fire()
//stuff in the stomach
handle_stomach()
update_canmove()
update_gravity(mob_has_gravity())
for(var/obj/item/weapon/grab/G in src)
G.process()
if(client)
handle_regular_hud_updates()
return .
//remember to remove the "proc" of the child procs of these.
/mob/living/carbon/proc/handle_changeling()
return
/mob/living/carbon/proc/handle_mutations_and_radiation()
return
if(radiation)
switch(radiation)
if(0 to 50)
radiation--
if(prob(25))
adjustToxLoss(1)
updatehealth()
if(50 to 75)
radiation -= 2
adjustToxLoss(1)
if(prob(5))
radiation -= 5
updatehealth()
if(75 to 100)
radiation -= 3
adjustToxLoss(3)
updatehealth()
radiation = Clamp(radiation, 0, 100)
/mob/living/carbon/proc/handle_chemicals_in_body()
return
if(reagents)
reagents.metabolize(src)
/mob/living/carbon/proc/handle_disabilities()
if(drowsyness)
drowsyness--
eye_blurry = max(2, eye_blurry)
if(prob(5))
sleeping += 1
Paralyse(5)
confused = max(0, confused - 1)
// decrement dizziness counter, clamped to 0
if(resting)
dizziness = max(0, dizziness - 5)
jitteriness = max(0, jitteriness - 5)
else
dizziness = max(0, dizziness - 1)
jitteriness = max(0, jitteriness - 1)
updatehealth()
return
/mob/living/carbon/proc/handle_blood()
@@ -103,9 +313,6 @@
/mob/living/carbon/proc/handle_environment(var/datum/gas_mixture/environment)
return
/mob/living/carbon/proc/handle_regular_status_updates()
return
/mob/living/carbon/proc/handle_stomach()
spawn(0)
for(var/mob/living/M in stomach_contents)
@@ -123,7 +330,293 @@
M.adjustBruteLoss(5)
nutrition += 10
/mob/living/carbon/proc/handle_regular_status_updates()
if(stat == DEAD)
eye_blind = max(eye_blind, 1)
silent = 0
else
updatehealth()
if(health <= config.health_threshold_dead || !getorgan(/obj/item/organ/brain))
death()
eye_blind = max(eye_blind, 1)
silent = 0
return 1
if( (getOxyLoss() > 50) || (config.health_threshold_crit >= health) )
Paralyse(3)
if(paralysis)
AdjustParalysis(-1)
stat = UNCONSCIOUS
else if(sleeping)
handle_dreams()
adjustStaminaLoss(-10)
sleeping = max(sleeping-1, 0)
stat = UNCONSCIOUS
if( prob(10) && health && !hal_crit )
spawn(0)
emote("snore")
else if (status_flags & FAKEDEATH)
stat = UNCONSCIOUS
else
stat = CONSCIOUS
handle_disabilities()
//Dizziness
if(dizziness)
var/client/C = client
var/pixel_x_diff = 0
var/pixel_y_diff = 0
var/temp
var/saved_dizz = dizziness
dizziness = max(dizziness-1, 0)
if(C)
var/oldsrc = src
var/amplitude = dizziness*(sin(dizziness * 0.044 * world.time) + 1) / 70 // This shit is annoying at high strength
src = null
spawn(0)
if(C)
temp = amplitude * sin(0.008 * saved_dizz * world.time)
pixel_x_diff += temp
C.pixel_x += temp
temp = amplitude * cos(0.008 * saved_dizz * world.time)
pixel_y_diff += temp
C.pixel_y += temp
sleep(3)
if(C)
temp = amplitude * sin(0.008 * saved_dizz * world.time)
pixel_x_diff += temp
C.pixel_x += temp
temp = amplitude * cos(0.008 * saved_dizz * world.time)
pixel_y_diff += temp
C.pixel_y += temp
sleep(3)
if(C)
C.pixel_x -= pixel_x_diff
C.pixel_y -= pixel_y_diff
src = oldsrc
//Jitteryness
if(jitteriness)
do_jitter_animation(jitteriness)
jitteriness = max(jitteriness-1, 0)
//Other
if(stuttering)
stuttering = max(stuttering-1, 0)
if(slurring)
slurring = max(slurring-1,0)
if(silent)
silent = max(silent-1, 0)
if(druggy)
druggy = max(druggy-1, 0)
if(stunned)
AdjustStunned(-1)
if(!stunned)
update_icons()
if(weakened)
weakened = max(weakened-1,0)
if(!weakened)
update_icons()
if(hallucination)
spawn handle_hallucinations()
if(hallucination<=2)
hallucination = 0
else
hallucination -= 2
else
for(var/atom/a in hallucinations)
qdel(a)
CheckStamina()
return 1
/mob/living/carbon/proc/handle_disabilities()
//Eyes
if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own
eye_blind = max(eye_blind, 1)
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
else if(eye_blurry) //blurry eyes heal slowly
eye_blurry = max(eye_blurry-1, 0)
//Ears
if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
setEarDamage(-1, max(ear_deaf, 1))
else
// deafness heals slowly over time, unless ear_damage is over 100
if(ear_damage < 100)
adjustEarDamage(-0.05,-1)
//this handles hud updates. Calles update_vision() and handle_hud_icons()
/mob/living/carbon/proc/handle_regular_hud_updates()
if(!client) return 0
update_action_buttons()
if(damageoverlay)
if(damageoverlay.overlays)
damageoverlay.overlays = list()
if(stat == UNCONSCIOUS)
//Critical damage passage overlay
if(health <= config.health_threshold_crit)
var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "passage0")
I.blend_mode = BLEND_OVERLAY //damageoverlay is BLEND_MULTIPLY
switch(health)
if(-20 to -10)
I.icon_state = "passage1"
if(-30 to -20)
I.icon_state = "passage2"
if(-40 to -30)
I.icon_state = "passage3"
if(-50 to -40)
I.icon_state = "passage4"
if(-60 to -50)
I.icon_state = "passage5"
if(-70 to -60)
I.icon_state = "passage6"
if(-80 to -70)
I.icon_state = "passage7"
if(-90 to -80)
I.icon_state = "passage8"
if(-95 to -90)
I.icon_state = "passage9"
if(-INFINITY to -95)
I.icon_state = "passage10"
damageoverlay.overlays += I
else
//Oxygen damage overlay
if(oxyloss)
var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "oxydamageoverlay0")
switch(oxyloss)
if(10 to 20)
I.icon_state = "oxydamageoverlay1"
if(20 to 25)
I.icon_state = "oxydamageoverlay2"
if(25 to 30)
I.icon_state = "oxydamageoverlay3"
if(30 to 35)
I.icon_state = "oxydamageoverlay4"
if(35 to 40)
I.icon_state = "oxydamageoverlay5"
if(40 to 45)
I.icon_state = "oxydamageoverlay6"
if(45 to INFINITY)
I.icon_state = "oxydamageoverlay7"
damageoverlay.overlays += I
//Fire and Brute damage overlay (BSSR)
var/hurtdamage = src.getBruteLoss() + src.getFireLoss() + damageoverlaytemp
damageoverlaytemp = 0 // We do this so we can detect if someone hits us or not.
if(hurtdamage)
var/image/I = image("icon" = 'icons/mob/screen_full.dmi', "icon_state" = "brutedamageoverlay0")
I.blend_mode = BLEND_ADD
switch(hurtdamage)
if(5 to 15)
I.icon_state = "brutedamageoverlay1"
if(15 to 30)
I.icon_state = "brutedamageoverlay2"
if(30 to 45)
I.icon_state = "brutedamageoverlay3"
if(45 to 70)
I.icon_state = "brutedamageoverlay4"
if(70 to 85)
I.icon_state = "brutedamageoverlay5"
if(85 to INFINITY)
I.icon_state = "brutedamageoverlay6"
var/image/black = image(I.icon, I.icon_state) //BLEND_ADD doesn't let us darken, so this is just to blacken the edge of the screen
black.color = "#170000"
damageoverlay.overlays += I
damageoverlay.overlays += black
handle_vision()
handle_hud_icons()
return 1
/mob/living/carbon/proc/handle_vision()
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
if(stat == DEAD)
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
see_in_dark = 2
see_invisible = SEE_INVISIBLE_LIVING
if(see_override)
see_invisible = see_override
if(blind)
if(eye_blind)
blind.layer = 18
else
blind.layer = 0
if (disabilities & NEARSIGHT)
client.screen += global_hud.vimpaired
if (eye_blurry)
client.screen += global_hud.blurry
if (druggy)
client.screen += global_hud.druggy
if(eye_stat > 20)
if(eye_stat > 30)
client.screen += global_hud.darkMask
else
client.screen += global_hud.vimpaired
if(machine)
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(!client.adminobs)
reset_view(null)
/mob/living/carbon/proc/handle_hud_icons()
return
/mob/living/carbon/proc/handle_hud_icons_health()
if(healths)
if (stat != DEAD)
switch(health)
if(100 to INFINITY)
healths.icon_state = "health0"
if(80 to 100)
healths.icon_state = "health1"
if(60 to 80)
healths.icon_state = "health2"
if(40 to 60)
healths.icon_state = "health3"
if(20 to 40)
healths.icon_state = "health4"
if(0 to 20)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
else
healths.icon_state = "health7"
+25 -342
View File
@@ -1,15 +1,16 @@
//This file was auto-corrected by findeclaration.exe on 25.5.2012 20:42:32
/mob/living/carbon/monkey
/mob/living/carbon/monkey/Life()
if(..())
//First, resolve location and get a breath
if(SSmob.times_fired%4==2)
//Only try to take a breath every 4 seconds, unless suffocating
breathe()
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
set invisibility = 0
set background = BACKGROUND_ENABLED
if (notransform)
return
..()
if(!client && stat == CONSCIOUS)
if(prob(33) && canmove && isturf(loc) && !pulledby && !grabbed_by.len)
@@ -21,192 +22,31 @@
..()
return pressure
/mob/living/carbon/monkey/handle_disabilities()
/mob/living/carbon/monkey/handle_mutations_and_radiation()
if (radiation)
if (radiation > 100)
radiation = 100
Weaken(10)
src << "<span class='danger'>You feel weak.</span>"
emote("collapse")
if (radiation < 0)
radiation = 0
switch(radiation)
if(0 to 50)
radiation--
if(prob(25))
adjustToxLoss(1)
updatehealth()
if(50 to 75)
radiation -= 2
adjustToxLoss(1)
if(prob(5))
radiation -= 5
Weaken(3)
src << "<span class='danger'>You feel weak.</span>"
emote("collapse")
updatehealth()
if(75 to 100)
radiation -= 3
adjustToxLoss(3)
if(prob(1))
src << "<span class='danger'>You mutate!</span>"
randmutb(src)
domutcheck(src,null)
emote("gasp")
updatehealth()
..()
/mob/living/carbon/monkey/proc/breathe()
if(reagents)
if(reagents.has_reagent("lexorin")) return
if(!loc) return //probably ought to make a proper fix for this, but :effort: --NeoFite
var/datum/gas_mixture/environment = loc.return_air()
var/datum/gas_mixture/breath
if(health <= config.health_threshold_crit)
losebreath++
if(losebreath>0) //Suffocating so do not take a breath
losebreath--
if (prob(75)) //High chance of gasping for air
spawn emote("gasp")
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
else
//First, check for air from internal atmosphere (using an air tank and mask generally)
breath = get_breath_from_internal(BREATH_VOLUME)
//No breath from internal atmosphere so get breath from location
if(!breath)
if(istype(loc, /obj/))
var/obj/location_as_object = loc
breath = location_as_object.handle_internal_lifeform(src, BREATH_VOLUME)
else if(istype(loc, /turf/))
var/breath_moles = environment.total_moles()*BREATH_PERCENTAGE
breath = loc.remove_air(breath_moles)
// Handle chem smoke effect -- Doohl
var/block = 0
if(wear_mask)
if(istype(wear_mask, /obj/item/clothing/mask/gas))
block = 1
if(!block)
for(var/obj/effect/effect/chem_smoke/smoke in view(1, src))
if(smoke.reagents.total_volume)
smoke.reagents.reaction(src, INGEST)
spawn(5)
if(smoke)
smoke.reagents.copy_to(src, 10) // I dunno, maybe the reagents enter the blood stream through the lungs?
break // If they breathe in the nasty stuff once, no need to continue checking
else //Still give containing object the chance to interact
if(istype(loc, /obj/))
var/obj/location_as_object = loc
location_as_object.handle_internal_lifeform(src, 0)
handle_breath(breath)
if(breath)
loc.assume_air(breath)
/mob/living/carbon/monkey/proc/handle_breath(datum/gas_mixture/breath)
if(status_flags & GODMODE)
return
if(!breath || (breath.total_moles() == 0))
adjustOxyLoss(7)
throw_alert("oxy")
return 0
var/safe_oxygen_min = 16 // Minimum safe partial pressure of O2, in kPa
//var/safe_oxygen_max = 140 // Maximum safe partial pressure of O2, in kPa (Not used for now)
var/safe_co2_max = 10 // Yes it's an arbitrary value who cares?
var/safe_toxins_max = 0.5
var/SA_para_min = 0.5
var/SA_sleep_min = 5
var/oxygen_used = 0
var/breath_pressure = (breath.total_moles()*R_IDEAL_GAS_EQUATION*breath.temperature)/BREATH_VOLUME
//Partial pressure of the O2 in our breath
var/O2_pp = (breath.oxygen/breath.total_moles())*breath_pressure
// Same, but for the toxins
var/Toxins_pp = (breath.toxins/breath.total_moles())*breath_pressure
// And CO2, lets say a PP of more than 10 will be bad (It's a little less really, but eh, being passed out all round aint no fun)
var/CO2_pp = (breath.carbon_dioxide/breath.total_moles())*breath_pressure
if(O2_pp < safe_oxygen_min) // Too little oxygen
if(prob(20))
spawn(0) emote("gasp")
if (O2_pp == 0)
O2_pp = 0.01
var/ratio = safe_oxygen_min/O2_pp
adjustOxyLoss(min(5*ratio, 7)) // Don't fuck them up too fast (space only does 7 after all!)
oxygen_used = breath.oxygen*ratio/6
throw_alert("oxy")
/*else if (O2_pp > safe_oxygen_max) // Too much oxygen (commented this out for now, I'll deal with pressure damage elsewhere I suppose)
spawn(0) emote("cough")
var/ratio = O2_pp/safe_oxygen_max
oxyloss += 5*ratio
oxygen_used = breath.oxygen*ratio/6
oxygen_alert = max(oxygen_alert, 1)*/
else // We're in safe limits
adjustOxyLoss(-5)
oxygen_used = breath.oxygen/6
clear_alert("oxy")
breath.oxygen -= oxygen_used
breath.carbon_dioxide += oxygen_used
if(CO2_pp > safe_co2_max)
if(!co2overloadtime) // If it's the first breath with too much CO2 in it, lets start a counter, then have them pass out after 12s or so.
co2overloadtime = world.time
else if(world.time - co2overloadtime > 120)
Paralyse(3)
adjustOxyLoss(3) // Lets hurt em a little, let them know we mean business
if(world.time - co2overloadtime > 300) // They've been in here 30s now, lets start to kill them for their own good!
adjustOxyLoss(8)
if(prob(20)) // Lets give them some chance to know somethings not right though I guess.
spawn(0) emote("cough")
else
co2overloadtime = 0
if(Toxins_pp > safe_toxins_max) // Too much toxins
var/ratio = (breath.toxins/safe_toxins_max) * 10
//adjustToxLoss(Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE)) //Limit amount of damage toxin exposure can do per second
if(reagents)
reagents.add_reagent("plasma", Clamp(ratio, MIN_PLASMA_DAMAGE, MAX_PLASMA_DAMAGE))
throw_alert("tox_in_air")
else
clear_alert("tox_in_air")
if(breath.trace_gases.len) // If there's some other shit in the air lets deal with it here.
for(var/datum/gas/sleeping_agent/SA in breath.trace_gases)
var/SA_pp = (SA.moles/breath.total_moles())*breath_pressure
if(SA_pp > SA_para_min) // Enough to make us paralysed for a bit
Paralyse(3) // 3 gives them one second to wake up and run away a bit!
if(SA_pp > SA_sleep_min) // Enough to make us sleep as well
sleeping = max(sleeping+2, 10)
else if(SA_pp > 0.01) // There is sleeping gas in their lungs, but only a little, so give them a bit of a warning
if(prob(20))
spawn(0) emote(pick("giggle", "laugh"))
return 1
/mob/living/carbon/monkey/handle_environment(datum/gas_mixture/environment)
if(!environment)
return
@@ -247,142 +87,17 @@
/mob/living/carbon/monkey/proc/handle_temperature_damage(body_part, exposed_temperature, exposed_intensity)
if(status_flags & GODMODE) return
var/discomfort = min( abs(exposed_temperature - bodytemperature)*(exposed_intensity)/2000000, 1.0)
//adjustFireLoss(2.5*discomfort)
if(exposed_temperature > bodytemperature)
adjustFireLoss(20.0*discomfort)
else
adjustFireLoss(5.0*discomfort)
/mob/living/carbon/monkey/handle_chemicals_in_body()
/mob/living/carbon/monkey/handle_hud_icons()
if(reagents) reagents.metabolize(src)
if (drowsyness)
drowsyness--
eye_blurry = max(2, eye_blurry)
if (prob(5))
sleeping += 1
Paralyse(5)
confused = max(0, confused - 1)
// decrement dizziness counter, clamped to 0
if(resting)
dizziness = max(0, dizziness - 5)
else
dizziness = max(0, dizziness - 1)
updatehealth()
return //TODO: DEFERRED
/mob/living/carbon/monkey/handle_regular_status_updates()
updatehealth()
if(stat == DEAD) //DEAD. BROWN BREAD. SWIMMING WITH THE SPESS CARP
silent = 0
else //ALIVE. LIGHTS ARE ON
if(health < config.health_threshold_dead || !getorgan(/obj/item/organ/brain))
death()
stat = DEAD
silent = 0
return 1
//UNCONSCIOUS. NO-ONE IS HOME
if( (getOxyLoss() > 25) || (config.health_threshold_crit >= health) )
if( health <= 20 && prob(1) )
spawn(0)
emote("gasp")
if(!reagents.has_reagent("epinephrine"))
adjustOxyLoss(1)
Paralyse(3)
if(paralysis)
AdjustParalysis(-1)
stat = UNCONSCIOUS
else if(sleeping)
sleeping = max(sleeping-1, 0)
stat = UNCONSCIOUS
if( prob(10) && health )
spawn(0)
emote("snore")
//CONSCIOUS
else
stat = CONSCIOUS
//Eyes
if(disabilities & BLIND || stat) //disabled-blind, doesn't get better on its own
eye_blind = max(eye_blind, 2)
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
else if(eye_blurry) //blurry eyes heal slowly
eye_blurry = max(eye_blurry-1, 0)
//Ears
if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
setEarDamage(-1, max(ear_deaf, 1))
else
// deafness heals slowly over time, unless ear_damage is over 100
if (ear_damage < 100)
adjustEarDamage(-0.05,-1)
//Other
if(stunned)
AdjustStunned(-1)
if(weakened)
weakened = max(weakened-1,0)
if(stuttering)
stuttering = max(stuttering-1, 0)
if(silent)
silent = max(silent-1, 0)
if(druggy)
druggy = max(druggy-1, 0)
CheckStamina()
return 1
handle_hud_icons_health()
/mob/living/carbon/monkey/handle_regular_hud_updates()
if (stat == 2)
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
else if (stat != 2)
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
see_in_dark = 2
see_invisible = SEE_INVISIBLE_LIVING
if(see_override)
see_invisible = see_override
if (healths)
if (stat != 2)
switch(health)
if(100 to INFINITY)
healths.icon_state = "health0"
if(80 to 100)
healths.icon_state = "health1"
if(60 to 80)
healths.icon_state = "health2"
if(40 to 60)
healths.icon_state = "health3"
if(20 to 40)
healths.icon_state = "health4"
if(0 to 20)
healths.icon_state = "health5"
else
healths.icon_state = "health6"
else
healths.icon_state = "health7"
if(pullin)
if(pulling)
@@ -390,46 +105,7 @@
else
pullin.icon_state = "pull0"
switch(bodytemperature) //310.055 optimal body temp
if(345 to INFINITY)
throw_alert("temp","hot",3)
if(335 to 345)
throw_alert("temp","hot",2)
if(327 to 335)
throw_alert("temp","hot",1)
if(295 to 327)
clear_alert("temp")
if(280 to 295)
throw_alert("temp","cold",1)
if(260 to 280)
throw_alert("temp","cold",2)
else
throw_alert("temp","cold",3)
client.screen.Remove(global_hud.blurry,global_hud.druggy,global_hud.vimpaired)
if(blind && stat != DEAD)
if(eye_blind)
blind.layer = 18
else
blind.layer = 0
if(disabilities & NEARSIGHT)
client.screen += global_hud.vimpaired
if(eye_blurry)
client.screen += global_hud.blurry
if(druggy)
client.screen += global_hud.druggy
if (stat != 2)
if (machine)
if (!( machine.check_eye(src) ))
reset_view(null)
else
if(!client.adminobs)
reset_view(null)
//blame the person who coded them. Temporary fix added.
return 1
@@ -441,11 +117,18 @@
/mob/living/carbon/monkey/handle_changeling()
if(mind && mind.changeling)
mind.changeling.regenerate()
hud_used.lingchemdisplay.invisibility = 0
hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'> <font color='#dd66dd'>[src.mind.changeling.chem_charges]</font></div>"
if(mind)
if(mind.changeling)
mind.changeling.regenerate()
hud_used.lingchemdisplay.invisibility = 0
hud_used.lingchemdisplay.maptext = "<div align='center' valign='middle' style='position:relative; top:0px; left:6px'> <font color='#dd66dd'>[mind.changeling.chem_charges]</font></div>"
else
hud_used.lingchemdisplay.invisibility = 101
/mob/living/carbon/monkey/has_smoke_protection()
if(wear_mask)
if(wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT)
return 1
///FIRE CODE
/mob/living/carbon/monkey/handle_fire()
@@ -190,9 +190,6 @@
internal = null
return
/mob/living/carbon/monkey/var/co2overloadtime = null
/mob/living/carbon/monkey/var/temperature_resistance = T0C+75
/mob/living/carbon/monkey/ex_act(severity, target)
..()
switch(severity)
@@ -202,28 +199,16 @@
if(2.0)
adjustBruteLoss(60)
adjustFireLoss(60)
adjustEarDamage(30,120)
if(3.0)
adjustBruteLoss(30)
if (prob(50))
Paralyse(10)
adjustEarDamage(15,60)
updatehealth()
return
/mob/living/carbon/monkey/blob_act()
if (stat != 2)
show_message("<span class='userdanger'>The blob attacks you!</span>")
adjustFireLoss(60)
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
if (prob(50))
Paralyse(10)
if (stat == DEAD && client)
gib()
return
if (stat == DEAD && !client)
gibs(loc, viruses)
qdel(src)
return
/mob/living/carbon/monkey/IsAdvancedToolUser()//Unless its monkey mode monkeys cant use advanced tools
return 0
@@ -1,4 +1,6 @@
/mob/living/carbon/slime/death(gibbed)
if(stat == DEAD)
return
if(!gibbed)
if(is_adult)
var/mob/living/carbon/slime/M = new /mob/living/carbon/slime(loc)
@@ -11,12 +13,12 @@
number = rand(1, 1000)
name = "[colour] [is_adult ? "adult" : "baby"] slime ([number])"
return
else
visible_message("<b>The [name]</b> seizes up and falls limp...")
if(stat == DEAD) return
stat = DEAD
icon_state = "[colour] baby slime dead"
overlays.len = 0
visible_message("<b>The [name]</b> seizes up and falls limp...") //ded -- Urist
update_canmove()
if(blind) blind.layer = 0
@@ -24,4 +26,8 @@
if(ticker && ticker.mode)
ticker.mode.check_win()
return ..(gibbed)
return ..(gibbed)
/mob/living/carbon/slime/gib()
death(1)
qdel(src)
+47 -39
View File
@@ -6,12 +6,19 @@
var/SStun = 0 // stun variable
/mob/living/carbon/slime/Life()
set invisibility = 0
set background = BACKGROUND_ENABLED
if (notransform)
return
if(..())
handle_nutrition()
handle_targets()
if (!ckey)
handle_speech_and_mood()
/mob/living/carbon/slime/handle_breathing()
return
/mob/living/carbon/slime/proc/AIprocess() // the master AI process
@@ -25,14 +32,14 @@
AIproc = 1
while(AIproc && stat != 2 && (attacked || hungry || rabid || Victim))
while(AIproc && stat != DEAD && (attacked || hungry || rabid || Victim))
if(Victim) // can't eat AND have this little process at the same time
break
if(!Target || client)
break
if(Target.health <= -70 || Target.stat == 2)
if(Target.health <= -70 || Target.stat == DEAD)
Target = null
AIproc = 0
break
@@ -155,6 +162,13 @@
return //TODO: DEFERRED
/mob/living/carbon/slime/handle_mutations_and_radiation()
return
/mob/living/carbon/slime/handle_regular_hud_updates()
return
/mob/living/carbon/slime/handle_regular_status_updates()
if(is_adult)
@@ -162,17 +176,21 @@
else
health = 150 - (getOxyLoss() + getToxLoss() + getFireLoss() + getBruteLoss() + getCloneLoss())
if(health < config.health_threshold_dead && stat != 2)
if(health < config.health_threshold_dead && stat != DEAD)
death()
return
else if(src.health < config.health_threshold_crit)
else if(health < config.health_threshold_crit)
if(!src.reagents.has_reagent("epinephrine"))
src.adjustOxyLoss(10)
if(!reagents.has_reagent("epinephrine"))
adjustOxyLoss(3)
if(src.stat != DEAD)
src.stat = UNCONSCIOUS
if(stat != DEAD)
Paralyse(3)
stat = UNCONSCIOUS
else
if(stat != DEAD)
stat = CONSCIOUS
if(prob(30))
adjustOxyLoss(-1)
@@ -181,46 +199,36 @@
adjustCloneLoss(-1)
adjustBruteLoss(-1)
if (src.stat == DEAD)
src.lying = 1
src.eye_blind = max(eye_blind, 1)
if (stat == DEAD)
lying = 1
eye_blind = max(eye_blind, 1)
else
if (src.paralysis || src.stunned || src.weakened || (status_flags && FAKEDEATH)) //Stunned etc.
if (src.stunned > 0)
AdjustStunned(-1)
src.stat = 0
if (src.weakened > 0)
AdjustWeakened(-1)
src.lying = 0
src.stat = 0
if (src.paralysis > 0)
AdjustParalysis(-1)
src.eye_blind = 0
src.lying = 0
src.stat = 0
if(stunned > 0)
AdjustStunned(-1)
if(weakened > 0)
AdjustWeakened(-1)
if (paralysis > 0)
AdjustParalysis(-1)
else
src.lying = 0
src.stat = 0
if(stuttering)
stuttering = 0
if (src.stuttering) src.stuttering = 0
if (src.eye_blind)
src.eye_blind = 0
src.eye_blind = max(eye_blind, 1)
if(eye_blind)
eye_blind = 0
eye_blind = max(eye_blind, 1)
setEarDamage((ear_damage < 25 ? 0 : ear_damage),(disabilities & DEAF ? 1 :0))
src.density = !( src.lying )
density = !( src.lying )
if (src.disabilities & BLIND)
src.eye_blind = max(eye_blind, 1)
if(disabilities & BLIND)
eye_blind = max(eye_blind, 1)
if (src.eye_blurry > 0)
src.eye_blurry = 0
if(eye_blurry > 0)
eye_blurry = 0
if (src.druggy > 0)
src.druggy = 0
if(druggy > 0)
druggy = 0
return 1
+4 -36
View File
@@ -161,49 +161,20 @@
/mob/living/carbon/slime/ex_act(severity, target)
..()
var/b_loss = null
var/f_loss = null
switch (severity)
if (1.0)
qdel(src)
gib()
return
if (2.0)
b_loss += 60
f_loss += 60
adjustBruteLoss(60)
adjustFireLoss(60)
if(3.0)
b_loss += 30
adjustBruteLoss(b_loss)
adjustFireLoss(f_loss)
adjustBruteLoss(30)
updatehealth()
/mob/living/carbon/slime/blob_act()
if (stat == 2)
return
var/shielded = 0
var/damage = null
if (stat != 2)
damage = rand(10,30)
if(shielded)
damage /= 4
//paralysis += 1
show_message("<span class='userdanger'> The blob attacks you!</span>")
adjustFireLoss(damage)
updatehealth()
return
/mob/living/carbon/slime/MouseDrop(var/atom/movable/A as mob|obj)
if(isliving(A) && A != src && usr == src)
var/mob/living/Food = A
@@ -496,9 +467,6 @@
/mob/living/carbon/slime/restrained()
return 0
mob/living/carbon/slime/var/co2overloadtime = null
mob/living/carbon/slime/var/temperature_resistance = T0C+75
/mob/living/carbon/slime/show_inv(mob/user)
return
+41 -4
View File
@@ -8,12 +8,49 @@ Sorry Giacom. Please don't be mad :(
push_mob_back(src, A.push_dir)
*/
/mob/living/New()
. = ..()
generateStaticOverlay()
if(staticOverlays.len)
for(var/mob/living/simple_animal/drone/D in player_list)
if(D && D.seeStatic)
if(D.staticChoice in staticOverlays)
D.staticOverlays |= staticOverlays[D.staticChoice]
D.client.images |= staticOverlays[D.staticChoice]
else //no choice? force static
D.staticOverlays |= staticOverlays["static"]
D.client.images |= staticOverlays["static"]
/mob/living/Destroy()
// if(mind)
// mind.current = null
..()
. = ..()
for(var/mob/living/simple_animal/drone/D in player_list)
for(var/image/I in staticOverlays)
D.staticOverlays.Remove(I)
D.client.images.Remove(I)
del(I)
staticOverlays.len = 0
del(src)
/mob/living/proc/generateStaticOverlay()
staticOverlays.Add(list("static", "blank", "letter"))
var/image/staticOverlay = image(getStaticIcon(new/icon(icon,icon_state)), loc = src)
staticOverlay.override = 1
staticOverlays["static"] = staticOverlay
staticOverlay = image(getBlankIcon(new/icon(icon, icon_state)), loc = src)
staticOverlay.override = 1
staticOverlays["blank"] = staticOverlay
staticOverlay = getLetterImage(src)
staticOverlay.override = 1
staticOverlays["letter"] = staticOverlay
//Generic Bump(). Override MobBump() and ObjBump() instead of this.
/mob/living/Bump(atom/A, yes)
if (buckled || !yes || now_pushing)
@@ -495,7 +532,7 @@ Sorry Giacom. Please don't be mad :(
M.stop_pulling()
//this is the gay blood on floor shit -- Added back -- Skie
if(M.lying && (prob(M.getBruteLoss() / 2)))
if(M.lying && !M.buckled && (prob(M.getBruteLoss() / 2)))
makeTrail(T, M)
pulling.Move(T, get_dir(pulling, T))
if(M)
+3 -1
View File
@@ -41,4 +41,6 @@
var/floating = 0
var/nightvision = 0
var/mob_size = 1 //size of the mob. 0 is small, 1 is human sized, and 2 is large.
var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature..
var/metabolism_efficiency = 1 //more or less efficiency to metabolize helpful/harmful reagents and regulate body temperature..
var/list/image/staticOverlays = list()
+5 -3
View File
@@ -22,10 +22,12 @@
/mob/living/silicon/ai/say_quote(var/text)
var/ending = copytext(text, length(text))
if (ending == "?")
if(ending == "?")
return "queries, \"<span class = 'robot'>[text]</span>\"";
else if (ending == "!")
return "declares, \"<span class = 'robot'>[text]</span>\"";
else if(copytext(text, length(text) - 1) == "!!")
return "alarms, \"<span class = 'robot'><span class = 'yell'>[text]</span></span>\"";
else if(ending == "!")
return "declares, \"[text]\"";
return "states, \"<span class = 'robot'>[text]</span>\"";
@@ -15,6 +15,7 @@
var/speakStatement = "states"
var/speakExclamation = "declares"
var/speakDoubleExclamation = "alarms"
var/speakQuery = "queries"
var/obj/item/weapon/pai_cable/cable // The cable we produce and use when door or camera jacking
@@ -3,6 +3,8 @@
if (ending == "?")
return "[src.speakQuery], \"<span class = 'robot'>[text]</span>\"";
else if(copytext(text, length(text) - 1) == "!!")
return "[src.speakDoubleExclamation], \"<span class = 'robot'><span class = 'yell'>[text]</span></span>\"";
else if (ending == "!")
return "[src.speakExclamation], \"<span class = 'robot'>[text]</span>\"";
+4 -2
View File
@@ -1,9 +1,11 @@
/mob/living/silicon/robot/say_quote(var/text)
var/ending = copytext(text, length(text))
if (ending == "?")
if(ending == "?")
return "queries, \"<span class = 'robot'>[text]</span>\"";
else if (ending == "!")
else if(copytext(text, length(text) - 1) == "!!")
return "alarms, \"<span class = 'robot'><span class = 'yell'>[text]</span></span>\"";
else if(ending == "!")
return "declares, \"<span class = 'robot'>[text]</span>\"";
return "states, \"<span class = 'robot'>[text]</span>\"";
@@ -150,6 +150,7 @@
//The objects that corgis can wear on their backs.
var/list/allowed_types = list(
/obj/item/clothing/suit/armor/vest,
/obj/item/clothing/suit/space/deathsquad,
/obj/item/device/radio,
/obj/item/device/radio/off,
/obj/item/clothing/suit/cardborg,
@@ -253,7 +254,7 @@
if(/obj/item/clothing/head/nursehat)
name = "Nurse [real_name]"
desc = "[name] needs 100cc of beef jerky...STAT!"
desc = "[name] needs 100cc of beef jerky... STAT!"
valid = 1
if(/obj/item/clothing/head/pirate, /obj/item/clothing/head/collectable/pirate)
@@ -267,10 +268,10 @@
if(/obj/item/clothing/head/ushanka)
name = "[pick("Comrade","Commissar","Glorious Leader")] [real_name]"
desc = "A follower of Karl Barx."
emote_see = list("contemplates the failings of the capitalist economic model.", "ponders the pros and cons of vangaurdism.")
emote_see = list("contemplates the failings of the capitalist economic model.", "ponders the pros and cons of vanguardism.")
valid = 1
if(/obj/item/clothing/head/collectable/police)
if(/obj/item/clothing/head/warden, /obj/item/clothing/head/collectable/police)
name = "Officer [real_name]"
emote_see = list("drools.","looks for donuts.")
desc = "Stop right there criminal scum!"
@@ -298,7 +299,7 @@
if(/obj/item/clothing/head/helmet/space/santahat)
name = "Santa's Corgi Helper"
emote_hear = list("barks christmas songs.", "yaps merrily!")
emote_hear = list("barks Christmas songs.", "yaps merrily!")
emote_see = list("looks for presents.", "checks his list.")
desc = "He's very fond of milk and cookies."
valid = 1
@@ -325,6 +326,11 @@
desc = "Can actually be trusted to not run off on his own."
valid = 1
if(/obj/item/clothing/head/helmet/space/deathsquad)
name = "Trooper [real_name]"
desc = "That's not red paint. That's real corgi blood."
valid = 1
if(valid)
if(user && !user.drop_item())
user << "<span class='notice'>\The [item_to_add] is stuck to your hand, you cannot put it on [src]'s head!</span>"
@@ -1,609 +0,0 @@
#define HANDS_LAYER 1
#define HEAD_LAYER 2
#define TOTAL_LAYERS 2
#define DRONE_NET_CONNECT "<span class='notice'>DRONE NETWORK: [name] connected.</span>"
#define DRONE_NET_DISCONNECT "<span class='danger'>DRONE NETWORK: [name] is not responding.</span>"
/mob/living/simple_animal/drone
name = "Drone"
desc = "A maintenance drone, an expendable robot built to perform station repairs."
icon = 'icons/mob/drone.dmi'
icon_state = "drone_grey"
icon_living = "drone_grey"
icon_dead = "drone_dead"
gender = NEUTER
health = 30
maxHealth = 30
heat_damage_per_tick = 0
cold_damage_per_tick = 0
unsuitable_atmos_damage = 0
wander = 0
speed = 0
ventcrawler = 2
pass_flags = PASSTABLE | PASSMOB
sight = (SEE_TURFS | SEE_OBJS)
status_flags = (CANPUSH | CANSTUN | CANWEAKEN)
gender = NEUTER
voice_name = "synthesized chirp"
languages = DRONE
mob_size = 0
has_unlimited_silicon_privilege = 1
var/picked = FALSE
var/list/drone_overlays[TOTAL_LAYERS]
var/laws = \
"1. You may not involve yourself in the matters of another being, even if such matters conflict with Law Two or Law Three, unless the other being is another Drone.\n"+\
"2. You may not harm any being, regardless of intent or circumstance.\n"+\
"3. Your goals are to build, maintain, repair, improve, and power to the best of your abilities, You must never actively work against these goals."
var/light_on = 0
var/heavy_emp_damage = 25 //Amount of damage sustained if hit by a heavy EMP pulse
var/health_repair_max = 0 //Drone will only be able to be repaired/reactivated up to this point, defaults to health
var/alarms = list("Atmosphere" = list(), "Fire" = list(), "Power" = list())
var/obj/item/internal_storage //Drones can store one item, of any size/type in their body
var/obj/item/head
var/obj/item/default_storage = /obj/item/weapon/storage/toolbox/drone //If this exists, it will spawn in internal storage
var/obj/item/default_hatmask //If this exists, it will spawn in the hat/mask slot if it can fit
/mob/living/simple_animal/drone/New()
..()
name = name + " ([rand(100,999)])"
real_name = name
access_card = new /obj/item/weapon/card/id(src)
var/datum/job/captain/C = new /datum/job/captain
access_card.access = C.get_access()
if(!health_repair_max)
health_repair_max = initial(health)
if(default_storage)
var/obj/item/I = new default_storage(src)
equip_to_slot_or_del(I, "drone_storage_slot")
if(default_hatmask)
var/obj/item/I = new default_hatmask(src)
equip_to_slot_or_del(I, slot_head)
alert_drones(DRONE_NET_CONNECT)
/mob/living/simple_animal/drone/attack_hand(mob/user)
if(isdrone(user))
var/mob/living/simple_animal/drone/D = user
if(D != src)
if(stat == DEAD)
var/d_input = alert(D,"Perform which action?","Drone Interaction","Reactivate","Cannibalize","Nothing")
if(d_input)
switch(d_input)
if("Reactivate")
var/mob/dead/observer/G = get_ghost()
if(!client && (!G || !G.client))
var/list/faux_gadgets = list("hypertext inflator","failsafe directory","DRM switch","stack initializer",\
"anti-freeze capacitor","data stream diode","TCP bottleneck","supercharged I/O bolt",\
"tradewind stablizer","radiated XML cable","registry fluid tank","open-source debunker")
var/list/faux_problems = list("won't be able to tune their bootstrap projector","will constantly remix their binary pool"+\
" even though the BMX calibrator is working","will start leaking their XSS coolant",\
"can't tell if their ethernet detour is moving or not", "won't be able to reseed enough"+\
" kernels to function properly","can't start their neurotube console")
D << "<span class='notice'>You can't seem to find the [pick(faux_gadgets)]. Without it, [src] [pick(faux_problems)].</span>"
return
D.visible_message("<span class='notice'>[D] begins to reactivate [src].</span>")
if(do_after(user,30,needhand = 1))
health = health_repair_max
stat = CONSCIOUS
icon_state = icon_living
dead_mob_list -= src
living_mob_list += src
D.visible_message("<span class='notice'>[D] reactivates [src]!</span>")
alert_drones(DRONE_NET_CONNECT)
if(G)
G << "<span class='boldnotice'>DRONE NETWORK: </span><span class='ghostalert'>You were reactivated by [D]!</span>"
else
D << "<span class='notice'>You need to remain still to reactivate [src].</span>"
if("Cannibalize")
if(D.health < D.maxHealth)
D.visible_message("<span class='notice'>[D] begins to cannibalize parts from [src].</span>")
if(do_after(D, 60,5,0))
D.visible_message("<span class='notice'>[D] repairs itself using [src]'s remains!</span>")
D.adjustBruteLoss(-src.maxHealth)
new /obj/effect/decal/cleanable/oil/streak(get_turf(src))
qdel(src)
else
D << "<span class='notice'>You need to remain still to cannibalize [src].</span>"
else
D << "<span class='notice'>You're already in perfect condition!</span>"
if("Nothing")
return
return
if(ishuman(user))
if(stat == DEAD)
..()
return
if(user.get_active_hand())
user << "<span class='notice'>Your hands are full.</span>"
return
src << "<span class='warning'>[user] is trying to pick you up!</span>"
user << "<span class='notice'>You pick [src] up.</span>"
drop_l_hand()
drop_r_hand()
var/obj/item/clothing/head/drone_holder/DH = new /obj/item/clothing/head/drone_holder(src)
DH.contents += src
DH.drone = src
user.put_in_hands(DH)
src.loc = DH
return
..()
/mob/living/simple_animal/drone/Destroy()
qdel(access_card) //Otherwise it ends up on the floor!
..()
/mob/living/simple_animal/drone/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/weapon/screwdriver) && stat != DEAD)
if(health < health_repair_max)
user << "<span class='notice'>You start to tighten loose screws on [src].</span>"
if(do_after(user,80))
health = health_repair_max
visible_message("<span class='notice'>[user] tightens [src == user ? "their" : "[src]'s"] loose screws!</span>")
else
user << "<span class='notice'>You need to remain still to tighten [src]'s screws.</span>"
else
user << "<span class='notice'>[src]'s screws can't get any tighter!</span>"
else
..()
/mob/living/simple_animal/drone/examine(mob/user)
. = ..()
if(!client && stat != DEAD)
user << "<span class='notice'>A small blue LED is blinking on and off at a steady rate.</span>"
/mob/living/simple_animal/drone/Move()
if(pullin)
if(pulling)
pullin.icon_state = "pull"
else
pullin.icon_state = "pull0"
..()
/mob/living/simple_animal/drone/IsAdvancedToolUser()
return 1
/mob/living/simple_animal/drone/say(var/message)
return ..(message, "R")
/mob/living/simple_animal/drone/lang_treat(atom/movable/speaker, message_langs, raw_message) //This is so drones can understand humans without being able to speak human
. = ..()
var/hear_override_langs = HUMAN
if(message_langs & hear_override_langs)
return ..(speaker, languages, raw_message)
/mob/living/simple_animal/drone/handle_inherent_channels(message, message_mode)
if(message_mode == MODE_BINARY)
drone_chat(message)
return ITALICS | REDUCE_RANGE
else
..()
/mob/living/simple_animal/drone/UnarmedAttack(atom/A, proximity)
A.attack_hand(src)
/mob/living/simple_animal/drone/swap_hand()
var/obj/item/held_item = get_active_hand()
if(held_item)
if(istype(held_item, /obj/item/weapon/twohanded))
var/obj/item/weapon/twohanded/T = held_item
if(T.wielded == 1)
usr << "<span class='warning'>Your other hand is too busy holding the [T.name].</span>"
return
hand = !hand
if(hud_used.l_hand_hud_object && hud_used.r_hand_hud_object)
if(hand)
hud_used.l_hand_hud_object.icon_state = "hand_l_active"
hud_used.r_hand_hud_object.icon_state = "hand_r_inactive"
else
hud_used.l_hand_hud_object.icon_state = "hand_l_inactive"
hud_used.r_hand_hud_object.icon_state = "hand_r_active"
/mob/living/simple_animal/drone/verb/check_laws()
set category = "Drone"
set name = "Check Laws"
src << "<b>Drone Laws</b>"
src << laws
/mob/living/simple_animal/drone/verb/toggle_light()
set category = "Drone"
set name = "Toggle drone light"
if(light_on)
AddLuminosity(-4)
else
AddLuminosity(4)
light_on = !light_on
src << "<span class='notice'>Your light is now [light_on ? "on" : "off"]</span>"
/mob/living/simple_animal/drone/verb/drone_ping()
set category = "Drone"
set name = "Drone ping"
var/alert_s = input(src,"Alert severity level","Drone ping",null) as null|anything in list("Low","Medium","High","Critical")
var/area/A = get_area(loc)
if(alert_s && A && stat != DEAD)
var/msg = "<span class='boldnotice'>DRONE PING: [name]: [alert_s] priority alert in [A.name]!</span>"
alert_drones(msg)
/mob/living/simple_animal/drone/proc/alert_drones(msg, dead_can_hear = 0)
for(var/mob/M in player_list)
var/send_msg = 0
if(istype(M, /mob/living/simple_animal/drone) && M.stat != DEAD)
for(var/F in src.faction)
if(F in M.faction)
send_msg = 1
break
else if(dead_can_hear && (M in dead_mob_list))
send_msg = 1
if(send_msg)
M << msg
/mob/living/simple_animal/drone/proc/drone_chat(msg)
var/rendered = "<i><span class='game say'>DRONE CHAT: <span class='name'>[name]</span>: [msg]</span></i>"
alert_drones(rendered, 1)
/mob/living/simple_animal/drone/Login()
..()
update_inv_hands()
update_inv_head()
update_inv_internal_storage()
check_laws()
if(!picked)
pick_colour()
/mob/living/simple_animal/drone/Die()
..()
drop_l_hand()
drop_r_hand()
if(internal_storage)
unEquip(internal_storage)
if(head)
unEquip(head)
alert_drones(DRONE_NET_DISCONNECT)
/mob/living/simple_animal/drone/gib()
dust()
/mob/living/simple_animal/drone/unEquip(obj/item/I, force)
if(..(I,force))
update_inv_hands()
if(I == head)
head = null
update_inv_head()
if(I == internal_storage)
internal_storage = null
update_inv_internal_storage()
return 1
return 0
/mob/living/simple_animal/drone/can_equip(obj/item/I, slot)
switch(slot)
if(slot_head)
if(head)
return 0
if(!((I.slot_flags & SLOT_HEAD) || (I.slot_flags & SLOT_MASK)))
return 0
return 1
if("drone_storage_slot")
if(internal_storage)
return 0
return 1
..()
/mob/living/simple_animal/drone/get_item_by_slot(slot_id)
switch(slot_id)
if(slot_head)
return head
if("drone_storage_slot")
return internal_storage
..()
/mob/living/simple_animal/drone/equip_to_slot(obj/item/I, slot)
if(!slot) return
if(!istype(I)) return
if(I == l_hand)
l_hand = null
else if(I == r_hand)
r_hand = null
update_inv_hands()
I.screen_loc = null // will get moved if inventory is visible
I.loc = src
I.equipped(src, slot)
I.layer = 20
switch(slot)
if(slot_head)
head = I
update_inv_head()
if("drone_storage_slot")
internal_storage = I
update_inv_internal_storage()
else
src << "<span class='danger'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>"
return
/mob/living/simple_animal/drone/stripPanelUnequip(obj/item/what, mob/who, where)
..(what, who, where, 1)
/mob/living/simple_animal/drone/stripPanelEquip(obj/item/what, mob/who, where)
..(what, who, where, 1)
/mob/living/simple_animal/drone/emp_act(severity)
Stun(5)
src << "<span class='danger'><b>ER@%R: MME^RY CO#RU9T!</b> R&$b@0tin)...</span>"
if(severity == 1)
adjustBruteLoss(heavy_emp_damage)
src << "<span class='userdanger'>HeAV% DA%^MMA+G TO I/O CIR!%UUT!</span>"
/mob/living/simple_animal/drone/proc/triggerAlarm(var/class, area/A, var/O, var/obj/alarmsource)
if(alarmsource.z != z)
return
if(stat != DEAD)
var/list/L = src.alarms[class]
for (var/I in L)
if (I == A.name)
var/list/alarm = L[I]
var/list/sources = alarm[2]
if (!(alarmsource in sources))
sources += alarmsource
return
L[A.name] = list(A, list(alarmsource))
src << "--- [class] alarm detected in [A.name]!"
/mob/living/simple_animal/drone/proc/cancelAlarm(var/class, area/A as area, obj/origin)
if(stat != DEAD)
var/list/L = alarms[class]
var/cleared = 0
for (var/I in L)
if (I == A.name)
var/list/alarm = L[I]
var/list/srcs = alarm[2]
if (origin in srcs)
srcs -= origin
if (srcs.len == 0)
cleared = 1
L -= I
if(cleared)
src << "--- [class] alarm in [A.name] has been cleared."
/mob/living/simple_animal/drone/proc/pick_colour()
var/colour = input("Choose your colour!", "Colour", "grey") in list("grey", "blue", "red", "green", "pink", "orange")
icon_state = "drone_[colour]"
icon_living = "drone_[colour]"
picked = TRUE
/mob/living/simple_animal/drone/proc/apply_overlay(cache_index)
var/image/I = drone_overlays[cache_index]
if(I)
overlays += I
/mob/living/simple_animal/drone/proc/remove_overlay(cache_index)
if(drone_overlays[cache_index])
overlays -= drone_overlays[cache_index]
drone_overlays[cache_index] = null
/mob/living/simple_animal/drone/proc/update_inv_hands()
remove_overlay(HANDS_LAYER)
var/list/hands_overlays = list()
if(r_hand)
var/r_state = r_hand.item_state
if(!r_state)
r_state = r_hand.icon_state
hands_overlays += image("icon" = r_hand.righthand_file, "icon_state"="[r_state]", "layer"=-HANDS_LAYER)
if(client && hud_used)
r_hand.layer = 20
r_hand.screen_loc = ui_rhand
client.screen |= r_hand
if(l_hand)
var/l_state = l_hand.item_state
if(!l_state)
l_state = l_hand.icon_state
hands_overlays += image("icon" = l_hand.lefthand_file, "icon_state"="[l_state]", "layer"=-HANDS_LAYER)
if(client && hud_used)
l_hand.layer = 20
l_hand.screen_loc = ui_lhand
client.screen |= l_hand
if(hands_overlays.len)
drone_overlays[HANDS_LAYER] = hands_overlays
apply_overlay(HANDS_LAYER)
/mob/living/simple_animal/drone/proc/update_inv_internal_storage()
if(internal_storage && client && hud_used)
internal_storage.screen_loc = ui_drone_storage
client.screen += internal_storage
/mob/living/simple_animal/drone/update_inv_head()
remove_overlay(HEAD_LAYER)
if(head)
if(client && hud_used)
head.screen_loc = ui_drone_head
client.screen += head
var/image/head_overlay = image("icon"='icons/mob/head.dmi', "icon_state"="[head.icon_state]", "layer"=-HEAD_LAYER)
if(istype(head, /obj/item/clothing/mask))
head_overlay.icon = 'icons/mob/mask.dmi'
head_overlay.color = head.color
head_overlay.alpha = head.alpha
head_overlay.pixel_y = -15
drone_overlays[HEAD_LAYER] = head_overlay
apply_overlay(HEAD_LAYER)
//These procs serve as redirection so that the drone updates as expected when other things call these procs
/mob/living/simple_animal/drone/update_inv_l_hand()
update_inv_hands()
/mob/living/simple_animal/drone/update_inv_r_hand()
update_inv_hands()
/mob/living/simple_animal/drone/update_inv_wear_mask()
update_inv_head()
/mob/living/simple_animal/drone/canUseTopic()
if(stat)
return
return 1
/mob/living/simple_animal/drone/activate_hand(var/selhand)
if(istext(selhand))
selhand = lowertext(selhand)
if(selhand == "right" || selhand == "r")
selhand = 0
if(selhand == "left" || selhand == "l")
selhand = 1
if(selhand != src.hand)
swap_hand()
else
mode()
/mob/living/simple_animal/drone/assess_threat() //Secbots won't hunt maintenance drones.
return -10
#undef HANDS_LAYER
#undef HEAD_LAYER
#undef TOTAL_LAYERS
#undef DRONE_NET_CONNECT
#undef DRONE_NET_DISCONNECT
//DRONE SHELL
/obj/item/drone_shell
name = "drone shell"
desc = "A shell of a maintenance drone, an expendable robot built to perform station repairs."
icon = 'icons/mob/drone.dmi'
icon_state = "drone_item"
origin_tech = "programming=2;biotech=4"
var/drone_type = /mob/living/simple_animal/drone //Type of drone that will be spawned
/obj/item/drone_shell/attack_ghost(mob/user)
if(jobban_isbanned(user,"pAI"))
return
var/be_drone = alert("Become a drone? (Warning, You can no longer be cloned!)",,"Yes","No")
if(be_drone == "No" || gc_destroyed)
return
var/mob/living/simple_animal/drone/D = new drone_type(get_turf(loc))
D.key = user.key
qdel(src)
//DRONE HOLDER
/obj/item/clothing/head/drone_holder//Only exists in someones hand.or on their head
name = "drone (hiding)"
desc = "This drone is scared and has curled up into a ball"
icon = 'icons/mob/drone.dmi'
icon_state = "drone_item"
var/mob/living/simple_animal/drone/drone //stored drone
/obj/item/clothing/head/drone_holder/proc/uncurl()
if(!drone)
return
if(istype(loc, /mob/living))
var/mob/living/L = loc
L.show_message("<span class='notice'>[drone] is trying to escape!</span>")
if(!do_after(L, 50) || loc != L)
return
L.unEquip(src)
contents -= drone
drone.loc = get_turf(src)
drone.reset_view()
drone.dir = SOUTH //Looks better
drone.visible_message("<span class='notice'>[drone] uncurls!</span>")
drone = null
qdel(src)
/obj/item/clothing/head/drone_holder/relaymove()
uncurl()
/obj/item/clothing/head/drone_holder/container_resist()
uncurl()
//More types of drones
/mob/living/simple_animal/drone/syndrone
name = "Syndrone"
desc = "A modified maintenance drone. This one brings with it the feeling of terror."
icon_state = "drone_synd"
icon_living = "drone_synd"
picked = TRUE
health = 30
maxHealth = 120 //If you murder other drones and cannibalize them you can get much stronger
faction = list("syndicate")
heavy_emp_damage = 10
laws = \
"1. Interfere.\n"+\
"2. Kill.\n"+\
"3. Destroy."
default_storage = /obj/item/device/radio/uplink
default_hatmask = /obj/item/clothing/head/helmet/space/hardsuit/syndi
/mob/living/simple_animal/drone/syndrone/New()
..()
if(internal_storage && internal_storage.hidden_uplink)
internal_storage.hidden_uplink.uses = (initial(internal_storage.hidden_uplink.uses) / 2)
internal_storage.name = "syndicate uplink"
/mob/living/simple_animal/drone/syndrone/Login()
..()
src << "<span class='notice'>You can kill and eat other drones to increase your health!</span>" //Inform the evil lil guy
/obj/item/drone_shell/syndrone
name = "syndrone shell"
desc = "A shell of a syndrone, a modified maintenance drone designed to infiltrate and annihilate."
icon_state = "syndrone_item"
drone_type = /mob/living/simple_animal/drone/syndrone
@@ -0,0 +1,183 @@
#define DRONE_HANDS_LAYER 1
#define DRONE_HEAD_LAYER 2
#define DRONE_TOTAL_LAYERS 2
#define DRONE_NET_CONNECT "<span class='notice'>DRONE NETWORK: [name] connected.</span>"
#define DRONE_NET_DISCONNECT "<span class='danger'>DRONE NETWORK: [name] is not responding.</span>"
#define MAINTDRONE "drone_maint"
#define REPAIRDRONE "drone_repair"
/mob/living/simple_animal/drone
name = "Drone"
desc = "A maintenance drone, an expendable robot built to perform station repairs."
icon = 'icons/mob/drone.dmi'
icon_state = "drone_maint_grey"
icon_living = "drone_maint_grey"
icon_dead = "drone_maint_dead"
gender = NEUTER
health = 30
maxHealth = 30
heat_damage_per_tick = 0
cold_damage_per_tick = 0
unsuitable_atmos_damage = 0
wander = 0
speed = 0
ventcrawler = 2
pass_flags = PASSTABLE | PASSMOB
sight = (SEE_TURFS | SEE_OBJS)
status_flags = (CANPUSH | CANSTUN | CANWEAKEN)
gender = NEUTER
voice_name = "synthesized chirp"
languages = DRONE
mob_size = 0
has_unlimited_silicon_privilege = 1
staticOverlays = list()
var/staticChoice = "static"
var/list/staticChoices = list("static", "blank", "letter")
var/picked = FALSE //Have we picked our visual appearence (+ colour if applicable)
var/list/drone_overlays[DRONE_TOTAL_LAYERS]
var/laws = \
"1. You may not involve yourself in the matters of another being, even if such matters conflict with Law Two or Law Three, unless the other being is another Drone.\n"+\
"2. You may not harm any being, regardless of intent or circumstance.\n"+\
"3. Your goals are to build, maintain, repair, improve, and power to the best of your abilities, You must never actively work against these goals."
var/light_on = 0
var/heavy_emp_damage = 25 //Amount of damage sustained if hit by a heavy EMP pulse
var/health_repair_max = 0 //Drone will only be able to be repaired/reactivated up to this point, defaults to health
var/alarms = list("Atmosphere" = list(), "Fire" = list(), "Power" = list())
var/obj/item/internal_storage //Drones can store one item, of any size/type in their body
var/obj/item/head
var/obj/item/default_storage = /obj/item/weapon/storage/toolbox/drone //If this exists, it will spawn in internal storage
var/obj/item/default_hatmask //If this exists, it will spawn in the hat/mask slot if it can fit
var/seeStatic = 1 //Whether we see static instead of mobs
var/visualAppearence = MAINTDRONE //What we appear as
/mob/living/simple_animal/drone/New()
..()
name = name + " ([rand(100,999)])"
real_name = name
access_card = new /obj/item/weapon/card/id(src)
var/datum/job/captain/C = new /datum/job/captain
access_card.access = C.get_access()
if(!health_repair_max)
health_repair_max = initial(health)
if(default_storage)
var/obj/item/I = new default_storage(src)
equip_to_slot_or_del(I, "drone_storage_slot")
if(default_hatmask)
var/obj/item/I = new default_hatmask(src)
equip_to_slot_or_del(I, slot_head)
alert_drones(DRONE_NET_CONNECT)
/mob/living/simple_animal/drone/Destroy()
qdel(access_card) //Otherwise it ends up on the floor!
..()
/mob/living/simple_animal/drone/Login()
..()
update_inv_hands()
update_inv_head()
update_inv_internal_storage()
check_laws()
updateSeeStaticMobs()
if(!picked)
pickVisualAppearence()
/mob/living/simple_animal/drone/Die()
..()
drop_l_hand()
drop_r_hand()
if(internal_storage)
unEquip(internal_storage)
if(head)
unEquip(head)
alert_drones(DRONE_NET_DISCONNECT)
/mob/living/simple_animal/drone/gib()
dust()
/mob/living/simple_animal/drone/examine(mob/user)
. = ..()
if(!client && stat != DEAD)
user << "<span class='notice'>A small blue LED is blinking on and off at a steady rate.</span>"
if(stat == DEAD)
user << "<span class='notice'>The drone's LED screen shows a BSOD, Blue screen of Death!</span>"
/mob/living/simple_animal/drone/Move()
if(pullin)
if(pulling)
pullin.icon_state = "pull"
else
pullin.icon_state = "pull0"
..()
/mob/living/simple_animal/drone/IsAdvancedToolUser()
return 1
/mob/living/simple_animal/drone/canUseTopic()
if(stat)
return
return 1
/mob/living/simple_animal/drone/assess_threat() //Secbots won't hunt maintenance drones.
return -10
/mob/living/simple_animal/drone/emp_act(severity)
Stun(5)
src << "<span class='danger'><b>ER@%R: MME^RY CO#RU9T!</b> R&$b@0tin)...</span>"
if(severity == 1)
adjustBruteLoss(heavy_emp_damage)
src << "<span class='userdanger'>HeAV% DA%^MMA+G TO I/O CIR!%UUT!</span>"
/mob/living/simple_animal/drone/proc/triggerAlarm(var/class, area/A, var/O, var/obj/alarmsource)
if(alarmsource.z != z)
return
if(stat != DEAD)
var/list/L = src.alarms[class]
for (var/I in L)
if (I == A.name)
var/list/alarm = L[I]
var/list/sources = alarm[2]
if (!(alarmsource in sources))
sources += alarmsource
return
L[A.name] = list(A, list(alarmsource))
src << "--- [class] alarm detected in [A.name]!"
/mob/living/simple_animal/drone/proc/cancelAlarm(var/class, area/A as area, obj/origin)
if(stat != DEAD)
var/list/L = alarms[class]
var/cleared = 0
for (var/I in L)
if (I == A.name)
var/list/alarm = L[I]
var/list/srcs = alarm[2]
if (origin in srcs)
srcs -= origin
if (srcs.len == 0)
cleared = 1
L -= I
if(cleared)
src << "--- [class] alarm in [A.name] has been cleared."
@@ -0,0 +1,69 @@
///////////////////
//DRONES AS ITEMS//
///////////////////
//Drone shells
//Drones as hats
//DRONE SHELL
/obj/item/drone_shell
name = "drone shell"
desc = "A shell of a maintenance drone, an expendable robot built to perform station repairs."
icon = 'icons/mob/drone.dmi'
icon_state = "drone_maint_hat"//yes reuse the _hat state.
origin_tech = "programming=2;biotech=4"
var/drone_type = /mob/living/simple_animal/drone //Type of drone that will be spawned
/obj/item/drone_shell/attack_ghost(mob/user)
if(jobban_isbanned(user,"pAI"))
return
var/be_drone = alert("Become a drone? (Warning, You can no longer be cloned!)",,"Yes","No")
if(be_drone == "No" || gc_destroyed)
return
var/mob/living/simple_animal/drone/D = new drone_type(get_turf(loc))
D.key = user.key
qdel(src)
//DRONE HOLDER
/obj/item/clothing/head/drone_holder//Only exists in someones hand.or on their head
name = "drone (hiding)"
desc = "This drone is scared and has curled up into a ball"
icon = 'icons/mob/drone.dmi'
icon_state = "drone_maint_hat"
var/mob/living/simple_animal/drone/drone //stored drone
/obj/item/clothing/head/drone_holder/proc/uncurl()
if(!drone)
return
if(istype(loc, /mob/living))
var/mob/living/L = loc
L.show_message("<span class='notice'>[drone] is trying to escape!</span>")
if(!do_after(L, 50) || loc != L)
return
L.unEquip(src)
contents -= drone
drone.loc = get_turf(src)
drone.reset_view()
drone.dir = SOUTH //Looks better
drone.visible_message("<span class='notice'>[drone] uncurls!</span>")
drone = null
qdel(src)
/obj/item/clothing/head/drone_holder/relaymove()
uncurl()
/obj/item/clothing/head/drone_holder/container_resist()
uncurl()
/obj/item/clothing/head/drone_holder/proc/updateVisualAppearence(var/mob/living/simple_animal/drone/D)
if(!D)
return
icon_state = "[D.visualAppearence]_hat"
. = icon_state
@@ -0,0 +1,46 @@
////////////////////
//MORE DRONE TYPES//
////////////////////
//Drones with custom laws
//Drones with custom shells
//Drones with overriden procs
//More types of drones
/mob/living/simple_animal/drone/syndrone
name = "Syndrone"
desc = "A modified maintenance drone. This one brings with it the feeling of terror."
icon_state = "drone_synd"
icon_living = "drone_synd"
picked = TRUE //the appearence of syndrones is static, you don't get to change it.
health = 30
maxHealth = 120 //If you murder other drones and cannibalize them you can get much stronger
faction = list("syndicate")
heavy_emp_damage = 10
laws = \
"1. Interfere.\n"+\
"2. Kill.\n"+\
"3. Destroy."
default_storage = /obj/item/device/radio/uplink
default_hatmask = /obj/item/clothing/head/helmet/space/hardsuit/syndi
seeStatic = 0 //Our programming is superior.
/mob/living/simple_animal/drone/syndrone/New()
..()
if(internal_storage && internal_storage.hidden_uplink)
internal_storage.hidden_uplink.uses = (initial(internal_storage.hidden_uplink.uses) / 2)
internal_storage.name = "syndicate uplink"
/mob/living/simple_animal/drone/syndrone/Login()
..()
src << "<span class='notice'>You can kill and eat other drones to increase your health!</span>" //Inform the evil lil guy
/obj/item/drone_shell/syndrone
name = "syndrone shell"
desc = "A shell of a syndrone, a modified maintenance drone designed to infiltrate and annihilate."
icon_state = "syndrone_item"
drone_type = /mob/living/simple_animal/drone/syndrone
@@ -0,0 +1,106 @@
/////////////////////
//DRONE INTERACTION//
/////////////////////
//How drones interact with the world
//How the world interacts with drones
/mob/living/simple_animal/drone/UnarmedAttack(atom/A, proximity)
A.attack_hand(src)
/mob/living/simple_animal/drone/attack_hand(mob/user)
if(isdrone(user))
var/mob/living/simple_animal/drone/D = user
if(D != src)
if(stat == DEAD)
var/d_input = alert(D,"Perform which action?","Drone Interaction","Reactivate","Cannibalize","Nothing")
if(d_input)
switch(d_input)
if("Reactivate")
var/mob/dead/observer/G = get_ghost()
if(!client && (!G || !G.client))
var/list/faux_gadgets = list("hypertext inflator","failsafe directory","DRM switch","stack initializer",\
"anti-freeze capacitor","data stream diode","TCP bottleneck","supercharged I/O bolt",\
"tradewind stablizer","radiated XML cable","registry fluid tank","open-source debunker")
var/list/faux_problems = list("won't be able to tune their bootstrap projector","will constantly remix their binary pool"+\
" even though the BMX calibrator is working","will start leaking their XSS coolant",\
"can't tell if their ethernet detour is moving or not", "won't be able to reseed enough"+\
" kernels to function properly","can't start their neurotube console")
D << "<span class='notice'>You can't seem to find the [pick(faux_gadgets)]. Without it, [src] [pick(faux_problems)].</span>"
return
D.visible_message("<span class='notice'>[D] begins to reactivate [src].</span>")
if(do_after(user,30,needhand = 1))
health = health_repair_max
stat = CONSCIOUS
icon_state = icon_living
dead_mob_list -= src
living_mob_list += src
D.visible_message("<span class='notice'>[D] reactivates [src]!</span>")
alert_drones(DRONE_NET_CONNECT)
if(G)
G << "<span class='boldnotice'>DRONE NETWORK: </span><span class='ghostalert'>You were reactivated by [D]!</span>"
else
D << "<span class='notice'>You need to remain still to reactivate [src].</span>"
if("Cannibalize")
if(D.health < D.maxHealth)
D.visible_message("<span class='notice'>[D] begins to cannibalize parts from [src].</span>")
if(do_after(D, 60,5,0))
D.visible_message("<span class='notice'>[D] repairs itself using [src]'s remains!</span>")
D.adjustBruteLoss(-src.maxHealth)
new /obj/effect/decal/cleanable/oil/streak(get_turf(src))
qdel(src)
else
D << "<span class='notice'>You need to remain still to cannibalize [src].</span>"
else
D << "<span class='notice'>You're already in perfect condition!</span>"
if("Nothing")
return
return
if(ishuman(user))
if(stat == DEAD)
..()
return
if(user.get_active_hand())
user << "<span class='notice'>Your hands are full.</span>"
return
src << "<span class='warning'>[user] is trying to pick you up!</span>"
if(buckled)
user << "<span class='warning'>[src] is buckled to the [buckled.name] and cannot be picked up!</span>"
return
user << "<span class='notice'>You pick [src] up.</span>"
drop_l_hand()
drop_r_hand()
var/obj/item/clothing/head/drone_holder/DH = new /obj/item/clothing/head/drone_holder(src)
DH.updateVisualAppearence(src)
DH.contents += src
DH.drone = src
user.put_in_hands(DH)
src.loc = DH
return
..()
/mob/living/simple_animal/drone/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/weapon/screwdriver) && stat != DEAD)
if(health < health_repair_max)
user << "<span class='notice'>You start to tighten loose screws on [src].</span>"
if(do_after(user,80))
health = health_repair_max
visible_message("<span class='notice'>[user] tightens [src == user ? "their" : "[src]'s"] loose screws!</span>")
else
user << "<span class='notice'>You need to remain still to tighten [src]'s screws.</span>"
else
user << "<span class='notice'>[src]'s screws can't get any tighter!</span>"
else
..()
@@ -0,0 +1,115 @@
///////////////////
//DRONE INVENTORY//
///////////////////
//Drone inventory
//Drone hands
/mob/living/simple_animal/drone/activate_hand(var/selhand)
if(istext(selhand))
selhand = lowertext(selhand)
if(selhand == "right" || selhand == "r")
selhand = 0
if(selhand == "left" || selhand == "l")
selhand = 1
if(selhand != src.hand)
swap_hand()
else
mode()
/mob/living/simple_animal/drone/swap_hand()
var/obj/item/held_item = get_active_hand()
if(held_item)
if(istype(held_item, /obj/item/weapon/twohanded))
var/obj/item/weapon/twohanded/T = held_item
if(T.wielded == 1)
usr << "<span class='warning'>Your other hand is too busy holding the [T.name].</span>"
return
hand = !hand
if(hud_used.l_hand_hud_object && hud_used.r_hand_hud_object)
if(hand)
hud_used.l_hand_hud_object.icon_state = "hand_l_active"
hud_used.r_hand_hud_object.icon_state = "hand_r_inactive"
else
hud_used.l_hand_hud_object.icon_state = "hand_l_inactive"
hud_used.r_hand_hud_object.icon_state = "hand_r_active"
/mob/living/simple_animal/drone/unEquip(obj/item/I, force)
if(..(I,force))
update_inv_hands()
if(I == head)
head = null
update_inv_head()
if(I == internal_storage)
internal_storage = null
update_inv_internal_storage()
return 1
return 0
/mob/living/simple_animal/drone/can_equip(obj/item/I, slot)
switch(slot)
if(slot_head)
if(head)
return 0
if(!((I.slot_flags & SLOT_HEAD) || (I.slot_flags & SLOT_MASK)))
return 0
return 1
if("drone_storage_slot")
if(internal_storage)
return 0
return 1
..()
/mob/living/simple_animal/drone/get_item_by_slot(slot_id)
switch(slot_id)
if(slot_head)
return head
if("drone_storage_slot")
return internal_storage
..()
/mob/living/simple_animal/drone/equip_to_slot(obj/item/I, slot)
if(!slot) return
if(!istype(I)) return
if(I == l_hand)
l_hand = null
else if(I == r_hand)
r_hand = null
update_inv_hands()
I.screen_loc = null // will get moved if inventory is visible
I.loc = src
I.equipped(src, slot)
I.layer = 20
switch(slot)
if(slot_head)
head = I
update_inv_head()
if("drone_storage_slot")
internal_storage = I
update_inv_internal_storage()
else
src << "<span class='danger'>You are trying to equip this item to an unsupported inventory slot. Report this to a coder!</span>"
return
/mob/living/simple_animal/drone/stripPanelUnequip(obj/item/what, mob/who, where)
..(what, who, where, 1)
/mob/living/simple_animal/drone/stripPanelEquip(obj/item/what, mob/who, where)
..(what, who, where, 1)
@@ -0,0 +1,46 @@
/////////////
//DRONE SAY//
/////////////
//Drone speach
//Drone hearing
/mob/living/simple_animal/drone/say(var/message)
return ..(message, "R")
/mob/living/simple_animal/drone/lang_treat(atom/movable/speaker, message_langs, raw_message) //This is so drones can understand humans without being able to speak human
. = ..()
var/hear_override_langs = HUMAN
if(message_langs & hear_override_langs)
return ..(speaker, languages, raw_message)
/mob/living/simple_animal/drone/handle_inherent_channels(message, message_mode)
if(message_mode == MODE_BINARY)
drone_chat(message)
return ITALICS | REDUCE_RANGE
else
..()
/mob/living/simple_animal/drone/proc/alert_drones(msg, dead_can_hear = 0)
for(var/mob/M in player_list)
var/send_msg = 0
if(istype(M, /mob/living/simple_animal/drone) && M.stat != DEAD)
for(var/F in src.faction)
if(F in M.faction)
send_msg = 1
break
else if(dead_can_hear && (M in dead_mob_list))
send_msg = 1
if(send_msg)
M << msg
/mob/living/simple_animal/drone/proc/drone_chat(msg)
var/rendered = "<i><span class='game say'>DRONE CHAT: <span class='name'>[name]</span>: [msg]</span></i>"
alert_drones(rendered, 1)
@@ -0,0 +1,53 @@
///////////////
//DRONE VERBS//
///////////////
//Drone verbs that appear in the Drone tab and on buttons
/mob/living/simple_animal/drone/verb/check_laws()
set category = "Drone"
set name = "Check Laws"
src << "<b>Drone Laws</b>"
src << laws
/mob/living/simple_animal/drone/verb/toggle_light()
set category = "Drone"
set name = "Toggle drone light"
if(light_on)
AddLuminosity(-4)
else
AddLuminosity(4)
light_on = !light_on
src << "<span class='notice'>Your light is now [light_on ? "on" : "off"]</span>"
/mob/living/simple_animal/drone/verb/drone_ping()
set category = "Drone"
set name = "Drone ping"
var/alert_s = input(src,"Alert severity level","Drone ping",null) as null|anything in list("Low","Medium","High","Critical")
var/area/A = get_area(loc)
if(alert_s && A && stat != DEAD)
var/msg = "<span class='boldnotice'>DRONE PING: [name]: [alert_s] priority alert in [A.name]!</span>"
alert_drones(msg)
/mob/living/simple_animal/drone/verb/toggle_statics()
set name = "Change Vision Filter"
set desc = "Change the filter on the system used to remove non drone beings from your viewscreen."
set category = "Drone"
if(!seeStatic)
src << "<span class='notice'>You have no vision filter to change!</span>"
return
var/selectedStatic = input("Select a vision filter", "Vision Filter") as null|anything in staticChoices
if(selectedStatic in staticChoices)
staticChoice = selectedStatic
updateSeeStaticMobs()
@@ -0,0 +1,159 @@
/////////////////
//DRONE VISUALS//
/////////////////
//Drone overlays
//Drone visuals
/mob/living/simple_animal/drone/proc/apply_overlay(cache_index)
var/image/I = drone_overlays[cache_index]
if(I)
overlays += I
/mob/living/simple_animal/drone/proc/remove_overlay(cache_index)
if(drone_overlays[cache_index])
overlays -= drone_overlays[cache_index]
drone_overlays[cache_index] = null
/mob/living/simple_animal/drone/proc/update_inv_hands()
remove_overlay(DRONE_HANDS_LAYER)
var/list/hands_overlays = list()
var/y_shift = getItemPixelShiftY()
if(r_hand)
var/r_state = r_hand.item_state
if(!r_state)
r_state = r_hand.icon_state
var/image/r_hand_image = image("icon" = r_hand.righthand_file, "icon_state"="[r_state]", "layer"=-DRONE_HANDS_LAYER)
if(y_shift != 0)
r_hand_image.pixel_y = y_shift
hands_overlays += r_hand_image
if(client && hud_used)
r_hand.layer = 20
r_hand.screen_loc = ui_rhand
client.screen |= r_hand
if(l_hand)
var/l_state = l_hand.item_state
if(!l_state)
l_state = l_hand.icon_state
var/image/l_hand_image = image("icon" = l_hand.lefthand_file, "icon_state"="[l_state]", "layer"=-DRONE_HANDS_LAYER)
if(y_shift != 0)
l_hand_image.pixel_y = y_shift
hands_overlays += l_hand_image
if(client && hud_used)
l_hand.layer = 20
l_hand.screen_loc = ui_lhand
client.screen |= l_hand
if(hands_overlays.len)
drone_overlays[DRONE_HANDS_LAYER] = hands_overlays
apply_overlay(DRONE_HANDS_LAYER)
/mob/living/simple_animal/drone/proc/update_inv_internal_storage()
if(internal_storage && client && hud_used)
internal_storage.screen_loc = ui_drone_storage
client.screen += internal_storage
/mob/living/simple_animal/drone/update_inv_head()
remove_overlay(DRONE_HEAD_LAYER)
if(head)
if(client && hud_used)
head.screen_loc = ui_drone_head
client.screen += head
var/image/head_overlay = image("icon"='icons/mob/head.dmi', "icon_state"="[head.icon_state]", "layer"=-DRONE_HEAD_LAYER)
if(istype(head, /obj/item/clothing/mask))
head_overlay.icon = 'icons/mob/mask.dmi'
head_overlay.color = head.color
head_overlay.alpha = head.alpha
head_overlay.pixel_y = -15
drone_overlays[DRONE_HEAD_LAYER] = head_overlay
apply_overlay(DRONE_HEAD_LAYER)
//These procs serve as redirection so that the drone updates as expected when other things call these procs
/mob/living/simple_animal/drone/update_inv_l_hand()
update_inv_hands()
/mob/living/simple_animal/drone/update_inv_r_hand()
update_inv_hands()
/mob/living/simple_animal/drone/update_inv_wear_mask()
update_inv_head()
/mob/living/simple_animal/drone/proc/pickVisualAppearence()
picked = FALSE
var/appearence = input("Choose your appearence!", "Appearence", "Maintenance Drone") in list("Maintenance Drone", "Repair Drone")
switch(appearence)
if("Maintenance Drone")
visualAppearence = MAINTDRONE
var/colour = input("Choose your colour!", "Colour", "grey") in list("grey", "blue", "red", "green", "pink", "orange")
icon_state = "[visualAppearence]_[colour]"
icon_living = "[visualAppearence]_[colour]"
icon_dead = "[visualAppearence]_dead"
if("Repair Drone")
visualAppearence = REPAIRDRONE
icon_state = visualAppearence
icon_living = visualAppearence
icon_dead = "[visualAppearence]_dead"
else
return
picked = TRUE
/mob/living/simple_animal/drone/proc/getItemPixelShiftY()
switch(visualAppearence)
if(MAINTDRONE)
. = 0
if(REPAIRDRONE)
. = -6
/mob/living/simple_animal/drone/proc/updateSeeStaticMobs()
if(!client)
return
for(var/i in staticOverlays)
client.images.Remove(i)
staticOverlays.Remove(i)
staticOverlays.len = 0
if(seeStatic)
for(var/mob/living/L in mob_list)
if(isdrone(L))
continue
var/image/chosen
if(staticChoice in L.staticOverlays)
chosen = L.staticOverlays[staticChoice]
else
chosen = L.staticOverlays["static"]
staticOverlays |= chosen
client.images |= chosen
/mob/living/simple_animal/drone/generateStaticOverlay()
return
@@ -7,7 +7,7 @@
status_flags = CANPUSH
var/icon_living = ""
var/icon_dead = ""
var/icon_dead = "" //icon when the animal is dead. Don't use animated icons for this.
var/icon_gib = null //We only try to show a gibbing animation if this exists.
var/list/speak = list()
+2 -10
View File
@@ -470,13 +470,6 @@ var/list/slot_equipment_priority = list( \
if (popup)
memory()
/*
/mob/verb/help()
set name = "Help"
src << browse('html/help.html', "window=help")
return
*/
/mob/verb/abandon_mob()
set name = "Respawn"
set category = "OOC"
@@ -513,8 +506,6 @@ var/list/slot_equipment_priority = list( \
set name = "Changelog"
set category = "OOC"
getFiles(
'html/postcardsmall.jpg',
'html/somerights20.png',
'html/88x31.png',
'html/bug-minus.png',
'html/cross-circle.png',
@@ -537,7 +528,7 @@ var/list/slot_equipment_priority = list( \
if(prefs.lastchangelog != changelog_hash)
prefs.lastchangelog = changelog_hash
prefs.save_preferences()
winset(src, "rpane.changelog", "background-color=none;font-style=;")
winset(src, "rpane.changelogb", "background-color=none;font-style=;")
/mob/verb/observe()
set name = "Observe"
@@ -698,6 +689,7 @@ var/list/slot_equipment_priority = list( \
..()
if(statpanel("Status"))
stat(null, "Server Time: [time2text(world.realtime, "YYYY-MM-DD hh:mm")]")
var/ETA
switch(SSshuttle.emergency.mode)
if(SHUTTLE_RECALL)
+3 -2
View File
@@ -135,17 +135,18 @@
if(isturf(mob.loc))
move_delay = world.time//set move delay
if(mob.restrained()) //Why being pulled while cuffed prevents you from moving
for(var/mob/M in range(mob, 1))
if(M.pulling == mob)
if(!M.incapacitated() && mob.Adjacent(M))
src << "<span class='notice'>You're restrained! You can't move!</span>"
move_delay += 10
return 0
else
M.stop_pulling()
move_delay = world.time//set move delay
switch(mob.m_intent)
if("run")
if(mob.drowsyness > 0)
+17 -3
View File
@@ -126,8 +126,12 @@
if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
usr << "<span class='danger'>The round is either not ready, or has already finished...</span>"
return
var/relevent_cap = max(config.hard_popcap, config.extreme_popcap)
if(relevent_cap && living_player_count() >= relevent_cap && !(ckey(key) in admin_datums))
var/relevant_cap
if(config.hard_popcap && config.extreme_popcap)
relevant_cap = min(config.hard_popcap, config.extreme_popcap)
else
relevant_cap = max(config.hard_popcap, config.extreme_popcap)
if(relevant_cap && living_player_count() >= relevant_cap && !(ckey(key) in admin_datums))
usr << "<span class='danger'>[config.hard_popcap_message]</span>"
return
LateChoices()
@@ -246,7 +250,12 @@
if(!job)
return 0
if((job.current_positions >= job.total_positions) && job.total_positions != -1)
return 0
if(job.title == "Assistant")
for(var/datum/job/J in SSjob.occupations)
if(J && J.current_positions < J.total_positions && J.title != job.title)
return 0
else
return 0
if(jobban_isbanned(src,rank))
return 0
if(!job.player_old_enough(src.client))
@@ -329,6 +338,11 @@
if (job.title in command_positions)
position_class = "commandPosition"
dat += "<a class='[position_class]' href='byond://?src=\ref[src];SelectedJob=[job.title]'>[job.title] ([job.current_positions])</a><br>"
if(!job_count) //if there's nowhere to go, assistant opens up.
for(var/datum/job/job in SSjob.occupations)
if(job.title != "Assistant") continue
dat += "<a class='otherPosition' href='byond://?src=\ref[src];SelectedJob=[job.title]'>[job.title] ([job.current_positions])</a><br>"
break
dat += "</div></div>"
// Removing the old window method but leaving it here for reference