* Refactored gib() and dust()

* Refactored ex_act(), for mobs, a little.
* Removed the code which gibbed dead bodies with any severity.
This commit is contained in:
Giacomand
2013-12-23 17:56:58 +00:00
parent 58d0ed5221
commit 173e1cb391
21 changed files with 139 additions and 346 deletions
+1 -1
View File
@@ -1,5 +1,5 @@
/mob/dead/dust() //ghosts can't be vaporised.
return
/mob/dead/gib() //ghosts can't be gibbed.
/mob/dead/gib(var/animation = 1) //ghosts can't be gibbed.
return
+3 -44
View File
@@ -1,54 +1,13 @@
//This is the proc for gibbing a mob. Cannot gib ghosts.
//added different sort of gibs and animations. N
/mob/proc/gib()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
gibs(loc, viruses)
dead_mob_list -= src
spawn(15)
if(animation) del(animation)
if(src) del(src)
return
//This is the proc for turning a mob into ash. Mostly a copy of gib code (above).
//Originally created for wizard disintegrate. I've removed the virus code since it's irrelevant here.
//Dusting robots does not eject the MMI, so it's a bit more powerful than gib() /N
/mob/proc/dust()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
// flick("dust-m", animation)
new /obj/effect/decal/cleanable/ash(loc)
dead_mob_list -= src
spawn(15)
if(animation) del(animation)
if(src) del(src)
return
/mob/proc/death(gibbed)
timeofdeath = world.time
living_mob_list -= src
dead_mob_list += src
return ..(gibbed)
return
+12 -36
View File
@@ -1,41 +1,17 @@
/mob/living/carbon/alien/gib()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
flick("gibbed-a", animation)
/mob/living/carbon/alien/spawn_gibs()
xgibs(loc, viruses)
dead_mob_list -= src
spawn(15)
if(animation) del(animation)
if(src) del(src)
/mob/living/carbon/alien/gib_animation(var/animate)
..(animate, "gibbed-a")
/mob/living/carbon/alien/dust()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
flick("dust-a", animation)
/mob/living/carbon/alien/spawn_dust()
new /obj/effect/decal/remains/xeno(loc)
dead_mob_list -= src
spawn(15)
if(animation) del(animation)
if(src) del(src)
/mob/living/carbon/alien/spawn_dust()
new /obj/effect/decal/remains/xeno(loc)
/mob/living/carbon/alien/dust_animation(var/animate)
..(animate, "dust-a")
/mob/living/carbon/alien/dust(var/animation = 1)
..()
@@ -59,17 +59,7 @@
..()
/mob/living/carbon/alien/humanoid/ex_act(severity)
if(!blinded)
flick("flash", flash)
if (stat == 2 && client)
gib()
return
else if (stat == 2 && !client)
xgibs(loc, viruses)
del(src)
return
..()
var/shielded = 0
@@ -77,7 +67,6 @@
var/f_loss = null
switch (severity)
if (1.0)
b_loss += 500
gib()
return
@@ -55,23 +55,12 @@
/mob/living/carbon/alien/larva/ex_act(severity)
if(!blinded)
flick("flash", flash)
if (stat == 2 && client)
gib()
return
else if (stat == 2 && !client)
gibs(loc, viruses)
del(src)
return
..()
var/b_loss = null
var/f_loss = null
switch (severity)
if (1.0)
b_loss += 500
gib()
return
+2 -20
View File
@@ -19,28 +19,10 @@
return ..(gibbed)
/mob/living/carbon/brain/gib()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
// flick("gibbed-m", animation)
gibs(loc, viruses, dna)
dead_mob_list -= src
/mob/living/carbon/brain/gib(var/animation = 0)
if(container && istype(container, /obj/item/device/mmi))
del(container)//Gets rid of the MMI if there is one
if(loc)
if(istype(loc,/obj/item/organ/brain))
del(loc)//Gets rid of the brain item
spawn(15)
if(animation) del(animation)
if(src) del(src)
..()
+1 -1
View File
@@ -38,7 +38,7 @@
stomach_contents.Remove(A)
src.gib()
/mob/living/carbon/gib()
/mob/living/carbon/gib(var/animation = 1)
for(var/mob/M in src)
if(M in stomach_contents)
stomach_contents.Remove(M)
+9 -35
View File
@@ -1,44 +1,18 @@
/mob/living/carbon/human/gib()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
/mob/living/carbon/human/gib_animation(var/animate)
..(animate, "gibbed-h")
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
/mob/living/carbon/human/dust_animation(var/animate)
..(animate, "dust-h")
flick("gibbed-h", animation)
/mob/living/carbon/human/dust(var/animation = 1)
..()
/mob/living/carbon/human/spawn_gibs()
hgibs(loc, viruses, dna)
spawn(15)
if(animation) del(animation)
if(src) del(src)
/mob/living/carbon/human/dust()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
flick("dust-h", animation)
/mob/living/carbon/human/spawn_dust()
new /obj/effect/decal/remains/human(loc)
spawn(15)
if(animation) del(animation)
if(src) del(src)
/mob/living/carbon/human/death(gibbed)
if(stat == DEAD) return
if(healths) healths.icon_state = "health5"
+2 -15
View File
@@ -129,20 +129,7 @@
/mob/living/carbon/human/ex_act(severity)
if(!blinded)
flick("flash", flash)
// /obj/item/clothing/suit/bomb_suit(src)
// /obj/item/clothing/head/bomb_hood(src)
if (stat == 2 && client)
gib()
return
else if (stat == 2 && !client)
gibs(loc, viruses)
del(src)
return
..()
var/shielded = 0
var/b_loss = null
@@ -480,4 +467,4 @@
. = 0
if(!. && error_msg && user)
// Might need re-wording.
user << "<span class='alert'>There is no exposed flesh or thin material [target_zone == "head" ? "on their head" : "on their body"].</span>"
user << "<span class='alert'>There is no exposed flesh or thin material [target_zone == "head" ? "on their head" : "on their body"].</span>"
@@ -210,19 +210,13 @@
..()
/mob/living/carbon/slime/ex_act(severity)
if (stat == 2 && client)
return
else if (stat == 2 && !client)
del(src)
return
..()
var/b_loss = null
var/f_loss = null
switch (severity)
if (1.0)
b_loss += 500
del(src)
return
if (2.0)
+6 -38
View File
@@ -1,43 +1,11 @@
/mob/living/carbon/monkey/gib()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
/mob/living/carbon/monkey/gib_animation(var/animate)
..(animate, "gibbed-m")
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
flick("gibbed-m", animation)
gibs(loc, viruses, dna)
spawn(15)
if(animation) del(animation)
if(src) del(src)
/mob/living/carbon/monkey/dust()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
flick("dust-m", animation)
new /obj/effect/decal/cleanable/ash(loc)
spawn(15)
if(animation) del(animation)
if(src) del(src)
/mob/living/carbon/monkey/dust_animation(var/animate)
..(animate, "dust-m")
/mob/living/carbon/monkey/dust(var/animation = 1)
..()
/mob/living/carbon/monkey/death(gibbed)
if(stat == DEAD) return
@@ -341,33 +341,18 @@
/mob/living/carbon/monkey/var/temperature_resistance = T0C+75
/mob/living/carbon/monkey/ex_act(severity)
if(!blinded)
flick("flash", flash)
if (stat == 2 && client)
gib()
return
if (stat == 2 && !client)
gibs(loc, viruses)
del(src)
return
..()
switch(severity)
if(1.0)
if (stat != 2)
adjustBruteLoss(200)
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
gib()
return
if(2.0)
if (stat != 2)
adjustBruteLoss(60)
adjustFireLoss(60)
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
adjustBruteLoss(60)
adjustFireLoss(60)
if(3.0)
if (stat != 2)
adjustBruteLoss(30)
health = 100 - getOxyLoss() - getToxLoss() - getFireLoss() - getBruteLoss()
adjustBruteLoss(30)
if (prob(50))
Paralyse(10)
else
return
/mob/living/carbon/monkey/blob_act()
+62
View File
@@ -0,0 +1,62 @@
/mob/living/gib(var/animation = 1)
var/prev_lying = lying
death(1)
var/atom/movable/overlay/animate = setup_animation(animation, prev_lying)
if(animate)
gib_animation(animate)
spawn_gibs()
end_animation(animate) // Will del(src)
/mob/living/proc/spawn_gibs()
gibs(loc, viruses)
/mob/living/proc/gib_animation(var/animate, var/flick_name = "gibbed")
flick(flick_name, animate)
/mob/living/dust(var/animation = 0)
death(1)
var/atom/movable/overlay/animate = setup_animation(animation, 0)
if(animate)
dust_animation(animate)
spawn_dust()
end_animation(animate)
/mob/living/proc/spawn_dust()
new /obj/effect/decal/cleanable/ash(loc)
/mob/living/proc/dust_animation(var/animate, var/flick_name = "")
flick(flick_name, animate)
/mob/living/death(gibbed)
timeofdeath = world.time
living_mob_list -= src
if(!gibbed)
dead_mob_list += src
/mob/living/proc/setup_animation(var/animation, var/prev_lying)
var/atom/movable/overlay/animate = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
if(!prev_lying && animation)
animate = new(loc)
animate.icon_state = "blank"
animate.icon = 'icons/mob/mob.dmi'
animate.master = src
return animate
/mob/living/proc/end_animation(var/animate)
if(!animate)
del(src)
else
spawn(15)
if(animate) del(animate)
if(src) del(src)
+3
View File
@@ -14,6 +14,9 @@
src << "\blue You have given up life and succumbed to death."
death()
/mob/living/ex_act(severity)
if(client && !blinded)
flick("flash", src.flash)
/mob/living/proc/updatehealth()
if(status_flags & GODMODE)
+3 -6
View File
@@ -305,14 +305,11 @@ var/list/ai_list = list()
..()
/mob/living/silicon/ai/ex_act(severity)
if(!blinded)
flick("flash", flash)
..()
switch(severity)
if(1.0)
if (stat != 2)
adjustBruteLoss(100)
adjustFireLoss(100)
gib()
if(2.0)
if (stat != 2)
adjustBruteLoss(60)
@@ -321,7 +318,7 @@ var/list/ai_list = list()
if (stat != 2)
adjustBruteLoss(30)
updatehealth()
return
/mob/living/silicon/ai/Topic(href, href_list)
+4 -37
View File
@@ -1,41 +1,8 @@
/mob/living/silicon/gib()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
// flick("gibbed-r", animation)
/mob/living/silicon/spawn_gibs()
robogibs(loc, viruses)
dead_mob_list -= src
spawn(15)
if(animation) del(animation)
if(src) del(src)
/mob/living/silicon/gib(var/animation = 0) // Please don't remove this thinking this proc does nothing, it is changing the default value for animation.
..()
/mob/living/silicon/dust()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
// flick("dust-r", animation)
/mob/living/silicon/spawn_dust()
new /obj/effect/decal/remains/robot(loc)
dead_mob_list -= src
spawn(15)
if(animation) del(animation)
if(src) del(src)
+2 -3
View File
@@ -143,8 +143,7 @@
src << "<font color=green>You feel an electric surge run through your circuitry and become acutely aware at how lucky you are that you can still feel at all.</font>"
/mob/living/silicon/pai/ex_act(severity)
if(!blinded)
flick("flash", src.flash)
..()
switch(severity)
if(1.0)
@@ -159,7 +158,7 @@
if (src.stat != 2)
adjustBruteLoss(30)
src.updatehealth()
return
// See software.dm for Topic()
+12 -37
View File
@@ -1,47 +1,22 @@
/mob/living/silicon/robot/gib()
//robots don't die when gibbed. instead they drop their MMI'd brain
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
/mob/living/silicon/robot/gib(var/animation = 1)
..()
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
flick("gibbed-r", animation)
/mob/living/silicon/robot/spawn_gibs()
robogibs(loc, viruses)
living_mob_list -= src
dead_mob_list -= src
spawn(15)
if(animation) del(animation)
if(src) del(src)
/mob/living/silicon/robot/gib_animation(var/animate)
..(animate, "gibbed-r")
/mob/living/silicon/robot/dust()
death(1)
var/atom/movable/overlay/animation = null
monkeyizing = 1
canmove = 0
icon = null
invisibility = 101
/mob/living/silicon/robot/dust(var/animation = 1)
if(mmi)
del(mmi)
..()
animation = new(loc)
animation.icon_state = "blank"
animation.icon = 'icons/mob/mob.dmi'
animation.master = src
flick("dust-r", animation)
/mob/living/silicon/robot/spawn_dust()
new /obj/effect/decal/remains/robot(loc)
if(mmi) del(mmi) //Delete the MMI first so that it won't go popping out.
dead_mob_list -= src
spawn(15)
if(animation) del(animation)
if(src) del(src)
/mob/living/silicon/robot/dust_animation(var/animate)
..(animate, "dust-r")
/mob/living/silicon/robot/death(gibbed)
if(stat == DEAD) return
+4 -16
View File
@@ -292,24 +292,12 @@
/mob/living/silicon/robot/ex_act(severity)
if(!blinded)
flick("flash", flash)
if (stat == 2 && client)
gib()
return
else if (stat == 2 && !client)
del(src)
return
..()
switch(severity)
if(1.0)
if (stat != 2)
adjustBruteLoss(100)
adjustFireLoss(100)
gib()
return
gib()
return
if(2.0)
if (stat != 2)
adjustBruteLoss(60)
@@ -318,7 +306,7 @@
if (stat != 2)
adjustBruteLoss(30)
updatehealth()
return
/mob/living/silicon/robot/meteorhit(obj/O as obj)
@@ -209,7 +209,7 @@
else
..()
/mob/living/simple_animal/gib()
/mob/living/simple_animal/gib(var/animation = 0)
if(icon_gib)
flick(icon_gib, src)
if(meat_amount && meat_type)
@@ -438,11 +438,9 @@
return
/mob/living/simple_animal/ex_act(severity)
if(!blinded)
flick("flash", flash)
..()
switch (severity)
if (1.0)
adjustBruteLoss(500)
gib()
return