Update with some bay optimizations for mobs.

Conflicts:
	code/defines/obj.dm
	code/modules/mob/living/carbon/human/human.dm
	code/modules/mob/living/carbon/human/life.dm
	code/modules/mob/living/carbon/species.dm
	code/modules/organs/blood.dm
	code/modules/organs/organ.dm
	code/modules/organs/organ_external.dm
	code/setup.dm
	compare_report.txt
This commit is contained in:
Rob Nelson
2014-04-27 15:59:01 -07:00
committed by ZomgPonies
parent fcdcef5931
commit 96d90dc28a
10 changed files with 117 additions and 105 deletions
+16 -7
View File
@@ -732,10 +732,10 @@
counter++
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], 2557<BR>[t1]")
R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], 2557<BR>[t1]")
R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.modtype] [U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
if (href_list["medical"])
if(hasHUD(usr,"medical"))
@@ -861,10 +861,18 @@
counter++
if(istype(usr,/mob/living/carbon/human))
var/mob/living/carbon/human/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], 2557<BR>[t1]")
R.fields[text("com_[counter]")] = text("Made by [U.get_authentification_name()] ([U.get_assignment()]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
if(istype(usr,/mob/living/silicon/robot))
var/mob/living/silicon/robot/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], 2557<BR>[t1]")
R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.modtype] [U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year]<BR>[t1]")
if (href_list["lookitem"])
var/obj/item/I = locate(href_list["lookitem"])
I.examine()
if (href_list["lookmob"])
var/mob/M = locate(href_list["lookmob"])
M.examine()
..()
return
@@ -1133,6 +1141,7 @@
O.status &= ~ORGAN_ATTACHABLE
if (!O.amputated)
O.status &= ~ORGAN_DESTROYED
O.destspawn = 0
O.wounds.Cut()
O.heal_damage(1000,1000,1,1)
@@ -1219,10 +1228,11 @@
verbs += /mob/living/carbon/human/proc/bloody_doodle
return 1 //we applied blood to the item
/mob/living/carbon/human/clean_blood()
/mob/living/carbon/human/clean_blood(var/clean_feet)
.=..()
if(istype(feet_blood_DNA, /list) && feet_blood_DNA.len)
if(clean_feet && !shoes && istype(feet_blood_DNA, /list) && feet_blood_DNA.len)
del(feet_blood_DNA)
update_inv_shoes(1)
return 1
/mob/living/carbon/human/get_visible_implants(var/class = 0)
@@ -1290,7 +1300,6 @@
else
usr << "\blue [self ? "Your" : "[src]'s"] pulse is [src.get_pulse(GETPULSE_HAND)]."
/mob/living/carbon/human/proc/set_species(var/new_species, var/force_organs)
if(!dna)
+60 -64
View File
@@ -132,6 +132,7 @@
if(life_tick > 5 && timeofdeath && (timeofdeath < 5 || world.time - timeofdeath > 6000)) //We are long dead, or we're junk mobs spawned like the clowns on the clown shuttle
return //We go ahead and process them 5 times for HUD images and other stuff though.
//Handle temperature/pressure differences between body and environment
handle_environment(environment) //Optimized a good bit.
@@ -282,7 +283,7 @@
var/rads = radiation/25
radiation -= rads
nutrition += rads
heal_overall_damage(rads,rads)
adjustBruteLoss(-(rads))
adjustOxyLoss(-(rads))
adjustToxLoss(-(rads))
updatehealth()
@@ -1256,8 +1257,8 @@
if(hud_updateflag)
handle_hud_list()
if(!client) return 0
if(!client) return 0
if(hud_updateflag)
handle_hud_list()
@@ -1267,7 +1268,7 @@
if(copytext(hud.icon_state,1,4) == "hud") //ugly, but icon comparison is worse, I believe
client.images.Remove(hud)
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask)
client.screen.Remove(global_hud.blurry, global_hud.druggy, global_hud.vimpaired, global_hud.darkMask/*, global_hud.nvg*/)
update_action_buttons()
@@ -1280,25 +1281,25 @@
var/image/I
switch(health)
if(-20 to -10)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "passage1")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage1")
if(-30 to -20)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "passage2")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage2")
if(-40 to -30)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "passage3")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage3")
if(-50 to -40)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "passage4")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage4")
if(-60 to -50)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "passage5")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage5")
if(-70 to -60)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "passage6")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage6")
if(-80 to -70)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "passage7")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage7")
if(-90 to -80)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "passage8")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage8")
if(-95 to -90)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "passage9")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage9")
if(-INFINITY to -95)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "passage10")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "passage10")
damageoverlay.overlays += I
else
//Oxygen damage overlay
@@ -1306,19 +1307,19 @@
var/image/I
switch(oxyloss)
if(10 to 20)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay1")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay1")
if(20 to 25)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay2")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay2")
if(25 to 30)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay3")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay3")
if(30 to 35)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay4")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay4")
if(35 to 40)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay5")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay5")
if(40 to 45)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay6")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay6")
if(45 to INFINITY)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay7")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "oxydamageoverlay7")
damageoverlay.overlays += I
//Fire and Brute damage overlay (BSSR)
@@ -1328,17 +1329,17 @@
var/image/I
switch(hurtdamage)
if(10 to 25)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay1")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay1")
if(25 to 40)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay2")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay2")
if(40 to 55)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay3")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay3")
if(55 to 70)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay4")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay4")
if(70 to 85)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay5")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay5")
if(85 to INFINITY)
I = image('icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay6")
I = image("icon" = 'icons/mob/screen1_full.dmi', "icon_state" = "brutedamageoverlay6")
damageoverlay.overlays += I
if( stat == DEAD )
@@ -1399,22 +1400,13 @@
if(!druggy) see_invisible = SEE_INVISIBLE_LIVING
if(glasses)
if(istype(glasses, /obj/item/clothing/glasses/meson))
sight |= SEE_TURFS
if(!druggy)
see_invisible = SEE_INVISIBLE_MINIMUM
else if(istype(glasses, /obj/item/clothing/glasses/night))
see_in_dark = 5
if(!druggy)
see_invisible = SEE_INVISIBLE_MINIMUM
else if(istype(glasses, /obj/item/clothing/glasses/thermal))
sight |= SEE_MOBS
if(!druggy)
see_invisible = SEE_INVISIBLE_MINIMUM
else if(istype(glasses, /obj/item/clothing/glasses/material))
sight |= SEE_OBJS
if(!druggy)
see_invisible = SEE_INVISIBLE_MINIMUM
var/obj/item/clothing/glasses/G = glasses
if(istype(G))
see_in_dark += G.darkness_view
if(G.vision_flags) // MESONS
sight |= G.vision_flags
if(!druggy)
see_invisible = SEE_INVISIBLE_MINIMUM
/* HUD shit goes here, as long as it doesn't modify sight flags */
// The purpose of this is to stop xray and w/e from preventing you from using huds -- Love, Doohl
@@ -1868,29 +1860,33 @@
if(hud_updateflag & 1 << SPECIALROLE_HUD)
var/image/holder = hud_list[SPECIALROLE_HUD]
holder.icon_state = "hudblank"
switch(mind.special_role)
if("traitor","Syndicate")
holder.icon_state = "hudsyndicate"
if("Revolutionary")
holder.icon_state = "hudrevolutionary"
if("Head Revolutionary")
holder.icon_state = "hudheadrevolutionary"
if("Cultist")
holder.icon_state = "hudcultist"
if("Changeling")
holder.icon_state = "hudchangeling"
if("Wizard","Fake Wizard")
holder.icon_state = "hudwizard"
if("Death Commando")
holder.icon_state = "huddeathsquad"
if("Ninja")
holder.icon_state = "hudninja"
if("Vampire")
holder.icon_state = "hudvampire"
if("VampThrall")
holder.icon_state = "hudvampthrall"
hud_list[SPECIALROLE_HUD] = holder
if(mind)
switch(mind.special_role)
if("traitor","Syndicate")
holder.icon_state = "hudsyndicate"
if("Revolutionary")
holder.icon_state = "hudrevolutionary"
if("Head Revolutionary")
holder.icon_state = "hudheadrevolutionary"
if("Cultist")
holder.icon_state = "hudcultist"
if("Changeling")
holder.icon_state = "hudchangeling"
if("Wizard","Fake Wizard")
holder.icon_state = "hudwizard"
if("Death Commando")
holder.icon_state = "huddeathsquad"
if("Ninja")
holder.icon_state = "hudninja"
if("Vampire") // TODO: Check this
holder.icon_state = "hudvampire"
if("VampThrall")
holder.icon_state = "hudvampthrall"
hud_list[SPECIALROLE_HUD] = holder
hud_updateflag = 0
@@ -357,13 +357,12 @@ proc/get_damage_icon_part(damage_state, body_part)
if(f_style)
var/datum/sprite_accessory/facial_hair_style = facial_hair_styles_list[f_style]
if(facial_hair_style)
if(src.species.name in facial_hair_style.species_allowed)
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
if(facial_hair_style.do_colouration)
facial_s.Blend(rgb(r_facial, g_facial, b_facial), ICON_ADD)
if(facial_hair_style && src.species.name in facial_hair_style.species_allowed)
var/icon/facial_s = new/icon("icon" = facial_hair_style.icon, "icon_state" = "[facial_hair_style.icon_state]_s")
if(facial_hair_style.do_colouration)
facial_s.Blend(rgb(r_facial, g_facial, b_facial), ICON_ADD)
face_standing.Blend(facial_s, ICON_OVERLAY)
face_standing.Blend(facial_s, ICON_OVERLAY)
if(h_style && !(head && (head.flags & BLOCKHEADHAIR)))
var/datum/sprite_accessory/hair_style = hair_styles_list[h_style]
@@ -387,6 +386,7 @@ proc/get_damage_icon_part(damage_state, body_part)
var/add_image = 0
var/g = "m"
if(gender == FEMALE) g = "f"
// DNA2 - Drawing underlays.
for(var/datum/dna/gene/gene in dna_genes)
if(!gene.block)
continue
@@ -83,6 +83,7 @@
for(var/datum/organ/internal/I in H.internal_organs)
I.mechanize()
return
/datum/species/proc/handle_post_spawn(var/mob/living/carbon/human/H) //Handles anything not already covered by basic species assignment.
@@ -91,6 +92,12 @@
/datum/species/proc/handle_death(var/mob/living/carbon/human/H) //Handles any species-specific death events (such as dionaea nymph spawns).
return
/datum/species/proc/say_filter(mob/M, message, datum/language/speaking)
return message
/datum/species/proc/equip(var/mob/living/carbon/human/H)
/datum/species/human
name = "Human"
icobase = 'icons/mob/human_races/r_human.dmi'
-2
View File
@@ -37,7 +37,6 @@
/mob/living/carbon/human/var/list/organs_by_name = list() // map organ names to organs
/mob/living/carbon/human/var/list/internal_organs_by_name = list() // so internal organs have less ickiness too
// Takes care of organ related updates, such as broken and missing limbs
/mob/living/carbon/human/proc/handle_organs()
number_wounds = 0
@@ -53,7 +52,6 @@
bad_external_organs.Cut()
for(var/datum/organ/external/Ex in organs)
bad_external_organs += Ex
for(var/datum/organ/external/E in bad_external_organs)
if(!E)
continue
+1 -1
View File
@@ -279,7 +279,7 @@ This function completely restores a damaged organ to perfect condition.
//Determines if we even need to process this organ.
/datum/organ/external/proc/need_process()
if(status && status != ORGAN_ROBOT) // If it's robotic, that's fine it will have a status.
if(status && status & ORGAN_ROBOT) // If it's robotic, that's fine it will have a status.
return 1
if(brute_dam || burn_dam)
return 1
+2
View File
@@ -9,6 +9,8 @@ mob/var/next_pain_time = 0
// amount is a num from 1 to 100
mob/living/carbon/proc/pain(var/partname, var/amount, var/force, var/burning = 0)
if(stat >= 2) return
if(reagents.has_reagent("paracetamol"))
return
if(reagents.has_reagent("tramadol"))
return
if(reagents.has_reagent("oxycodone"))