Files
Bubberstation/code/modules/client/verbs/suicide.dm
T
phil235 443a4501ec Carbon Dismemberment , second attempt. (#20461)
* - I rearranged X_defense.dm mob files, more damage_procs.dm.Here's what's inside:
* X_defense.dm: is for the procs of attacks onto the mob, all the XXX_act() proc (things happening to the mob), as well as protection check and get procs (armor, ear prot, projectile dismemberment)
* damage_procs.dm: actual damage procs like adjustBruteLoss() getfireloss, any proc that handles damaging.

- some bugfixes with gibspawner effects.
- monkey's bodyparts can be dismembered and are used to create its icon.
- brains are no longer carbons.
- all carbon have bodyparts that can be dropped when the mob is gibbed.
- adminspawned bodyparts now have a default icon.
- robotic parts are now a child of bodyparts.
- health analyzer on alien/monkey shows damage on each limb
- added admin option to add/remove bodyparts for all carbon (instead of just remove on humans)
- Fixes keycheck message spam for janicart and all when trying to move.
- Fixes bug with buckling to a scooter while limbless.
- removed arg "hit_zone" in proj's on_hit() because we can already use the def_zone var (where hit_zone got its value)
- Fixes mob not getting any damage when hit by a projectile on their missing limb, despite a hit message shown). carbon/apply_damage() now when we specify a def_zone and the corresponding BP is missing we default to the chest instead of stopping the proc. Consistently with how human/attacked_by() default to its attack to chest if missing limb.
- Fixes mini uzi icon when empty and no mag (typo).
- I renamed and changed a bit check_eye_prot and ear prot
- renamed flash_eyes to flash_act()
- I made a soundbang_act() similar to flash_act but for loud bangs.
- added a gib and dust animation to larva.
- husked monkeys
- no damage overlay for husk or skeleton.
- damage overlay for robotic limb now.
- no damage overlay when organic bodypart husked.
- one handed human with a bloody hand still get a bloody single hand overlay.
- fix admin heal being unable to heal robotic bodyparts.
- slightly touched robotic bodypart sprites (head one pixel too high)
- Fixes 18532 "beheaded husk has hair".
- Fixes 18584 "Ling stasis appearance bug"
- no more eyes or lipstick on husks.
- can remove flashes/wires/cells from robot chest and head with crowbar.
- Fixes not being able to surgically amputate robotic arm/leg.

* More merge conflict fixes and adding the new files I forgot to add.

* of course I forgot birdstation

* More typos and stuff I forgot to undo.

* Fixing a typo in examine.dm
Removing an unnecessary check.
Making admin heal regenerate limbs on all carbons.
Monkey-human transformation now transfer missing limbs info and presence of a cavity implant.
NODISMEMBER species can still lack a limb if the mob lacked a limb and changed into that new species.
Changeling Regenerate ability now also regenerate limbs when in monkey form. (and remove some cryptic useless code)

* Fixing more conflicts with remie's multihands PR.

* Fixes runtime with hud when calling build_hand_slots().
Fixes lightgeist healing not working.
Fixes null.handle_fall() runtimes with pirate mobs.
Fixes typo in has_left_hadn() and has_right_hand().

* Derp, forgot to remove debug message.
2016-09-12 19:33:50 +02:00

174 lines
6.6 KiB
Plaintext

/mob/var/suiciding = 0
/mob/living/carbon/human/verb/suicide()
set hidden = 1
if(!canSuicide())
return
var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
if(!canSuicide())
return
if(confirm == "Yes")
suiciding = 1
log_game("[key_name(src)] (job: [job ? "[job]" : "None"]) commited suicide at [get_area(src)].")
var/obj/item/held_item = get_active_held_item()
if(held_item)
var/damagetype = held_item.suicide_act(src)
if(damagetype)
if(damagetype & SHAME)
adjustStaminaLoss(200)
suiciding = 0
return
var/damage_mod = 0
for(var/T in list(BRUTELOSS, FIRELOSS, TOXLOSS, OXYLOSS))
damage_mod += (T & damagetype) ? 1 : 0
damage_mod = max(1, damage_mod)
//Do 200 damage divided by the number of damage types applied.
if(damagetype & BRUTELOSS)
adjustBruteLoss(200/damage_mod)
if(damagetype & FIRELOSS)
adjustFireLoss(200/damage_mod)
if(damagetype & TOXLOSS)
adjustToxLoss(200/damage_mod)
if(damagetype & OXYLOSS)
adjustOxyLoss(200/damage_mod)
//If something went wrong, just do normal oxyloss
if(!(damagetype & (BRUTELOSS | FIRELOSS | TOXLOSS | OXYLOSS) ))
adjustOxyLoss(max(200 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(0)
return
var/suicide_message = pick("[src] is attempting to bite \his tongue off! It looks like \he's trying to commit suicide.", \
"[src] is jamming \his thumbs into \his eye sockets! It looks like \he's trying to commit suicide.", \
"[src] is twisting \his own neck! It looks like \he's trying to commit suicide.", \
"[src] is holding \his breath! It looks like \he's trying to commit suicide.")
visible_message("<span class='danger'>[suicide_message]</span>", "<span class='userdanger'>[suicide_message]</span>")
adjustOxyLoss(max(200 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(0)
/mob/living/brain/verb/suicide()
set hidden = 1
if(!canSuicide())
return
var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
if(!canSuicide())
return
if(confirm == "Yes")
suiciding = 1
visible_message("<span class='danger'>[src]'s brain is growing dull and lifeless. It looks like it's lost the will to live.</span>", \
"<span class='userdanger'>[src]'s brain is growing dull and lifeless. It looks like it's lost the will to live.</span>")
spawn(50)
death(0)
/mob/living/carbon/monkey/verb/suicide()
set hidden = 1
if(!canSuicide())
return
var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
if(!canSuicide())
return
if(confirm == "Yes")
suiciding = 1
//instead of killing them instantly, just put them at -175 health and let 'em gasp for a while
visible_message("<span class='danger'>[src] is attempting to bite \his tongue. It looks like \he's trying to commit suicide.</span>", \
"<span class='userdanger'>[src] is attempting to bite \his tongue. It looks like \he's trying to commit suicide.</span>")
adjustOxyLoss(max(200- getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(0)
/mob/living/silicon/ai/verb/suicide()
set hidden = 1
if(!canSuicide())
return
var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
if(!canSuicide())
return
if(confirm == "Yes")
suiciding = 1
visible_message("<span class='danger'>[src] is powering down. It looks like \he's trying to commit suicide.</span>", \
"<span class='userdanger'>[src] is powering down. It looks like \he's trying to commit suicide.</span>")
//put em at -175
adjustOxyLoss(max(maxHealth * 2 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(0)
/mob/living/silicon/robot/verb/suicide()
set hidden = 1
if(!canSuicide())
return
var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
if(!canSuicide())
return
if(confirm == "Yes")
suiciding = 1
visible_message("<span class='danger'>[src] is powering down. It looks like \he's trying to commit suicide.</span>", \
"<span class='userdanger'>[src] is powering down. It looks like \he's trying to commit suicide.</span>")
//put em at -175
adjustOxyLoss(max(maxHealth * 2 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(0)
/mob/living/silicon/pai/verb/suicide()
set category = "pAI Commands"
set desc = "Kill yourself and become a ghost (You will receive a confirmation prompt)"
set name = "pAI Suicide"
var/answer = input("REALLY kill yourself? This action can't be undone.", "Suicide", "No") in list ("Yes", "No")
if(answer == "Yes")
card.removePersonality()
var/turf/T = get_turf(src.loc)
T.visible_message("<span class='notice'>[src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\"</span>", "<span class='notice'>[src] bleeps electronically.</span>")
death(0)
else
src << "Aborting suicide attempt."
/mob/living/carbon/alien/humanoid/verb/suicide()
set hidden = 1
if(!canSuicide())
return
var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
if(!canSuicide())
return
if(confirm == "Yes")
suiciding = 1
visible_message("<span class='danger'>[src] is thrashing wildly! It looks like \he's trying to commit suicide.</span>", \
"<span class='userdanger'>[src] is thrashing wildly! It looks like \he's trying to commit suicide.</span>", \
"<span class='italics'>You hear thrashing.</span>")
//put em at -175
adjustOxyLoss(max(200 - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
death(0)
/mob/living/simple_animal/verb/suicide()
set hidden = 1
if(!canSuicide())
return
var/confirm = alert("Are you sure you want to commit suicide?", "Confirm Suicide", "Yes", "No")
if(!canSuicide())
return
if(confirm == "Yes")
suiciding = 1
visible_message("<span class='danger'>[src] begins to fall down. It looks like \he's lost the will to live.</span>", \
"<span class='userdanger'>[src] begins to fall down. It looks like \he's lost the will to live.</span>")
death(0)
/mob/living/proc/canSuicide()
if(stat == CONSCIOUS)
return 1
else if(stat == DEAD)
src << "You're already dead!"
else if(stat == UNCONSCIOUS)
src << "You need to be conscious to suicide!"
return
/mob/living/carbon/canSuicide()
if(!..())
return
if(!canmove || restrained()) //just while I finish up the new 'fun' suiciding verb. This is to prevent metagaming via suicide
src << "You can't commit suicide whilst restrained! ((You can type Ghost instead however.))"
return
return 1