Merge pull request #3178 from VOREStation/aro-sync

Polaris Sync
This commit is contained in:
Aronai Sieyes
2018-03-05 18:26:24 -05:00
committed by GitHub
131 changed files with 321018 additions and 5223 deletions
@@ -1557,13 +1557,13 @@
return species.fire_icon_state
// Called by job_controller. Makes drones start with a permit, might be useful for other people later too.
/mob/living/carbon/human/equip_post_job() //Drone Permit moved to equip_survival_gear()
/mob/living/carbon/human/equip_post_job()
var/braintype = get_FBP_type()
if(braintype == FBP_DRONE)
var/turf/T = get_turf(src)
var/obj/item/clothing/accessory/permit/drone/permit = new(T)
permit.set_name(real_name)
equip_to_appropriate_slot(permit) // If for some reason it can't find room, it'll still be on the floor.
equip_to_slot_or_del(permit, slot_in_backpack)
/mob/living/carbon/human/proc/update_icon_special(var/mutable_appearance/ma, var/update_icons = TRUE) //For things such as teshari hiding and whatnot.
if(hiding) // Hiding? Carry on.
@@ -1575,4 +1575,4 @@
//Can put special species icon update proc calls here, if any are ever invented.
if(update_icons)
update_icons()
update_icons()
@@ -17,31 +17,23 @@ core parts. The key difference is that when we generate overlays we do not gener
versions. Instead, we generate both and store them in two fixed-length lists, both using the same list-index
(The indexes are in update_icons.dm): Each list for humans is (at the time of writing) of length 19.
This will hopefully be reduced as the system is refined.
var/overlays_lying[19] //For the lying down stance
var/overlays_standing[19] //For the standing stance
When we call update_icons, the 'lying' variable is checked and then the appropriate list is assigned to our overlays!
That in itself uses a tiny bit more memory (no more than all the ridiculous lists the game has already mind you).
On the other-hand, it should be very CPU cheap in comparison to the old system.
In the old system, we updated all our overlays every life() call, even if we were standing still inside a crate!
or dead!. 25ish overlays, all generated from scratch every second for every xeno/human/monkey and then applied.
More often than not update_clothing was being called a few times in addition to that! CPU was not the only issue,
all those icons had to be sent to every client. So really the cost was extremely cumulative. To the point where
update_clothing would frequently appear in the top 10 most CPU intensive procs during profiling.
Another feature of this new system is that our lists are indexed. This means we can update specific overlays!
So we only regenerate icons when we need them to be updated! This is the main saving for this system.
In practice this means that:
everytime you fall over, we just switch between precompiled lists. Which is fast and cheap.
Everytime you do something minor like take a pen out of your pocket, we only update the in-hand overlay
etc...
There are several things that need to be remembered:
> Whenever we do something that should cause an overlay to update (which doesn't use standard procs
( i.e. you do something like l_hand = /obj/item/something new(src) )
You will need to call the relevant update_inv_* proc:
@@ -61,12 +53,9 @@ There are several things that need to be remembered:
update_inv_back()
update_inv_handcuffed()
update_inv_wear_mask()
All of these are named after the variable they update from. They are defined at the mob/ level like
update_clothing was, so you won't cause undefined proc runtimes with usr.update_inv_wear_id() if the usr is a
slime etc. Instead, it'll just return without doing any work. So no harm in calling it for slimes and such.
> There are also these special cases:
update_mutations() //handles updating your appearance for certain mutations. e.g TK head-glows
UpdateDamageIcon() //handles damage overlays for brute/burn damage //(will rename this when I geta round to it)
@@ -74,7 +63,6 @@ There are several things that need to be remembered:
update_hair() //Handles updating your hair overlay (used to be update_face, but mouth and
...eyes were merged into update_body)
update_targeted() // Updates the target overlay when someone points a gun at you
> All of these procs update our overlays_lying and overlays_standing, and then call update_icons() by default.
If you wish to update several overlays at once, you can set the argument to 0 to disable the update and call
it manually:
@@ -82,25 +70,20 @@ There are several things that need to be remembered:
update_inv_head(0)
update_inv_l_hand(0)
update_inv_r_hand() //<---calls update_icons()
or equivillantly:
update_inv_head(0)
update_inv_l_hand(0)
update_inv_r_hand(0)
update_icons()
> If you need to update all overlays you can use regenerate_icons(). it works exactly like update_clothing used to.
> I reimplimented an old unused variable which was in the code called (coincidentally) var/update_icon
It can be used as another method of triggering regenerate_icons(). It's basically a flag that when set to non-zero
will call regenerate_icons() at the next life() call and then reset itself to 0.
The idea behind it is icons are regenerated only once, even if multiple events requested it.
This system is confusing and is still a WIP. It's primary goal is speeding up the controls of the game whilst
reducing processing costs. So please bear with me while I iron out the kinks. It will be worth it, I promise.
If I can eventually free var/lying stuff from the life() process altogether, stuns/death/status stuff
will become less affected by lag-spikes and will be instantaneous! :3
If you have any questions/constructive-comments/bugs-to-report/or have a massivly devestated butt...
Please contact me on #coderbus IRC. ~Carn x
*/
@@ -423,24 +406,20 @@ var/global/list/damage_icon_parts = list()
var/icon/temp = part.get_icon(skeleton)
//That part makes left and right legs drawn topmost and lowermost when human looks WEST or EAST
//And no change in rendering for other parts (they icon_position is 0, so goes to 'else' part)
if(part.icon_position == RIGHT)
if(part.icon_position & (LEFT | RIGHT))
var/icon/temp2 = new('icons/mob/human.dmi',"blank")
var/icon/temp3 = new('icons/mob/human.dmi',"blank")
temp2.Insert(new/icon(temp,dir=NORTH),dir=NORTH)
temp2.Insert(new/icon(temp,dir=SOUTH),dir=SOUTH)
temp2.Insert(new/icon(temp,dir=EAST),dir=EAST)
if(!(part.icon_position & LEFT))
temp2.Insert(new/icon(temp,dir=EAST),dir=EAST)
if(!(part.icon_position & RIGHT))
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
base_icon.Blend(temp2, ICON_OVERLAY)
temp3.Insert(new/icon(temp,dir=WEST),dir=WEST)
base_icon.Blend(temp3, ICON_UNDERLAY)
else if(part.icon_position == LEFT)
var/icon/temp2 = new('icons/mob/human.dmi',"blank")
var/icon/temp3 = new('icons/mob/human.dmi',"blank")
temp2.Insert(new/icon(temp,dir=NORTH),dir=NORTH)
temp2.Insert(new/icon(temp,dir=SOUTH),dir=SOUTH)
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
base_icon.Blend(temp2, ICON_OVERLAY)
temp3.Insert(new/icon(temp,dir=EAST),dir=EAST)
base_icon.Blend(temp3, ICON_UNDERLAY)
if(part.icon_position & LEFT)
temp2.Insert(new/icon(temp,dir=EAST),dir=EAST)
if(part.icon_position & RIGHT)
temp2.Insert(new/icon(temp,dir=WEST),dir=WEST)
base_icon.Blend(temp2, ICON_UNDERLAY)
else if(part.icon_position & UNDER)
base_icon.Blend(temp, ICON_UNDERLAY)
else
@@ -947,7 +926,7 @@ var/global/list/damage_icon_parts = list()
else
overlays_standing[SHOES_LAYER] = null
overlays_standing[SHOES_LAYER_ALT] = null
if(update_icons) update_icons()
if(update_icons) update_icons_layers()
/mob/living/carbon/human/update_inv_s_store(var/update_icons=1)
if(QDESTROYING(src))
@@ -1612,4 +1591,4 @@ var/global/list/damage_icon_parts = list()
#undef TARGETED_LAYER
#undef FIRE_LAYER
#undef WATER_LAYER
#undef TOTAL_LAYERS
#undef TOTAL_LAYERS
@@ -5,7 +5,7 @@
// Default hivebot is melee, and a bit more meaty, so it can meatshield for their ranged friends.
/mob/living/simple_animal/hostile/hivebot
name = "hivebot"
desc = "A robot. It appears to be somewhat reslient, but lacking a true weapon."
desc = "A robot. It appears to be somewhat resilient, but lacks a true weapon."
icon = 'icons/mob/hivebot.dmi'
icon_state = "basic"
icon_living = "basic"
@@ -45,10 +45,10 @@
"No threats found.",
"Error: No targets found."
)
emote_hear = list("humms ominously", "whirrs softly", "grinds a gear")
emote_hear = list("hums ominously", "whirrs softly", "grinds a gear")
emote_see = list("looks around the area", "turns from side to side")
say_understood = list("Affirmative.", "Positive")
say_cannot = list("Denied.", "Negative")
say_understood = list("Affirmative.", "Positive.")
say_cannot = list("Denied.", "Negative.")
say_maybe_target = list("Possible threat detected. Investigating.", "Motion detected.", "Investigating.")
say_got_target = list("Threat detected.", "New task: Remove threat.", "Threat removal engaged.", "Engaging target.")
@@ -60,7 +60,7 @@
// Melee like the base type, but more fragile.
/mob/living/simple_animal/hostile/hivebot/swarm
name = "swarm hivebot"
desc = "A robot. It looks fragile and weak"
desc = "A robot. It looks fragile and weak"
maxHealth = 1 LASERS_TO_KILL
health = 1 LASERS_TO_KILL
melee_damage_lower = 3
@@ -86,7 +86,7 @@
// Shoots EMPs, to screw over other robots.
/mob/living/simple_animal/hostile/hivebot/range/ion
name = "engineering hivebot"
desc = "A robot. It has a tool which emits focused electromagnetic pulses, which are deadly to other synthetic adverseries."
desc = "A robot. It has a tool which emits focused electromagnetic pulses, which are deadly to synthetic adverseries."
projectiletype = /obj/item/projectile/ion/small //VOREStation Edit
projectilesound = 'sound/weapons/Laser.ogg'
icon_living = "engi"
@@ -97,7 +97,7 @@
// Shoots deadly lasers.
/mob/living/simple_animal/hostile/hivebot/range/laser
name = "laser hivebot"
desc = "A robot. It has an energy weapon."
desc = "A robot. It has an energy weapon."
projectiletype = /obj/item/projectile/beam/blue
projectilesound = 'sound/weapons/Laser.ogg'
maxHealth = 2 LASERS_TO_KILL
@@ -1,6 +1,6 @@
//Corgi
/mob/living/simple_animal/corgi
name = "\improper corgi"
name = "corgi"
real_name = "corgi"
desc = "It's a corgi."
intelligence_level = SA_ANIMAL
@@ -96,8 +96,8 @@
sleep(1)
/obj/item/weapon/reagent_containers/food/snacks/meat/corgi
name = "Corgi meat"
desc = "Tastes like... well you know..."
name = "corgi meat"
desc = "Tastes like... well, you know..."
/mob/living/simple_animal/corgi/attackby(var/obj/item/O as obj, var/mob/user as mob) //Marker -Agouri
if(istype(O, /obj/item/weapon/newspaper))
@@ -137,7 +137,7 @@
/mob/living/simple_animal/corgi/puppy
name = "\improper corgi puppy"
name = "corgi puppy"
real_name = "corgi"
desc = "It's a corgi puppy."
icon_state = "puppy"
@@ -170,7 +170,7 @@
//Lisa already has a cute bow!
/mob/living/simple_animal/corgi/Lisa/Topic(href, href_list)
if(href_list["remove_inv"] || href_list["add_inv"])
usr << "<font color='red'>[src] already has a cute bow!</font>"
to_chat(usr, "<font color='red'>[src] already has a cute bow!</font>")
return
..()
@@ -208,7 +208,7 @@
//Technically this should be like, its own file or something or a subset of dog but whatever. Not a coder.
/mob/living/simple_animal/corgi/tamaskan
name = "\improper tamaskan"
name = "tamaskan"
real_name = "tamaskan"
desc = "It's a tamaskan."
icon_state = "tamaskan"
@@ -78,6 +78,7 @@ Nurse Family
var/atom/cocoon_target
var/egg_inject_chance = 5
// VOREStation Edit - Keep Nurse Hat Spiders
/mob/living/simple_animal/hostile/giant_spider/nurse/medical
desc = "Furry and beige, it makes you shudder to look at it. This one has brilliant green eyes and a tiny nurse hat."
icon_state = "nursemed"
@@ -88,7 +89,7 @@ Nurse Family
melee_damage_upper = 16
poison_type = "tramadol"
poison_chance = 15
// VOREStation Edit End
/mob/living/simple_animal/hostile/giant_spider/nurse/queen
desc = "Absolutely gigantic, this creature is horror itself."