mirror of
https://github.com/vgstation-coders/vgstation13.git
synced 2025-12-10 10:21:11 +00:00
You can now commit suicide using certain items! There will be more items to come, this really just lays the groundwork.
Credit goes to CodenameB and Spike68 for the original proposed commit. Althought it ended up changing, this commit still uses all of their suicide messages. Thanks to carn for pseudo-coding the base of the system that I ended up using to implement this. The suicide verb checks the item in your active hand and calls that item's suicide_act(). (/obj/item/proc/suicide_act(mob/user)) The proc displays the suicide message to any viewers and returns a damage type. The suicide verb then applies 175 damage to the mob divided by the number of damage types. If the proc returns null (meaning that the item does not have a suicide_act() defined) the regular suicide occurs. To any coder wanting to add items to this: - You MUST return one or more damage types. "return (BRUTELOSS|FIRELOSS)" for example. - Please do not manually type in the item's name; use [src] to refrence an it instead. It'll save time down the road if an item gets renamed. It also helps handle any child of that item without copy/pasting the proc to each child. - Please do not use 'usr' for anything. Parrots can now see which item they are holding onto in the stat panel. The toy crossbow should once again work properly. Fixes Issue 1227. git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5468 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -1217,6 +1217,10 @@
|
||||
reagents.add_reagent("pacid", round(potency, 1))
|
||||
force = round((5+potency/2.5), 1)
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is eating some of the [src]! It looks like \he's trying to commit suicide.</b>"
|
||||
return (BRUTELOSS|TOXLOSS)
|
||||
|
||||
// *************************************
|
||||
// Pestkiller defines for hydroponics
|
||||
// *************************************
|
||||
@@ -1284,6 +1288,10 @@
|
||||
var/toxicity = 4
|
||||
var/WeedKillStr = 2
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is huffing the [src]! It looks like \he's trying to commit suicide.</b>"
|
||||
return (TOXLOSS)
|
||||
|
||||
/obj/item/weapon/pestspray // -- Skie
|
||||
desc = "It's some pest eliminator spray! <I>Do not inhale!</I>"
|
||||
icon = 'icons/obj/hydroponics.dmi'
|
||||
@@ -1299,6 +1307,10 @@
|
||||
var/toxicity = 4
|
||||
var/PestKillStr = 2
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is huffing the [src]! It looks like \he's trying to commit suicide.</b>"
|
||||
return (TOXLOSS)
|
||||
|
||||
/obj/item/weapon/minihoe // -- Numbers
|
||||
name = "mini hoe"
|
||||
desc = "It's used for removing weeds or scratching your back."
|
||||
|
||||
@@ -223,6 +223,10 @@
|
||||
desc = "A trap used to catch bears and other legged creatures."
|
||||
var/armed = 0
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is putting the [src] on \his head! It looks like \he's trying to commit suicide.</b>"
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/legcuffs/beartrap/attack_self(mob/user as mob)
|
||||
..()
|
||||
if(ishuman(user) && !user.stat && !user.restrained())
|
||||
@@ -304,6 +308,11 @@
|
||||
g_amt = 3750
|
||||
attack_verb = list("stabbed", "slashed", "sliced", "cut")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << pick("/red <b>[user] is slitting \his wrists with the shard of glass! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[user] is slitting \his throat with the shard of glass! It looks like \he's trying to commit suicide.</b>")
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/shard/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
|
||||
return ..()
|
||||
@@ -428,6 +437,9 @@
|
||||
m_amt = 40
|
||||
attack_verb = list("whipped", "lashed", "disciplined", "tickled")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is strangling \himself with the [src]! It looks like \he's trying to commit suicide.</b>"
|
||||
return (OXYLOSS)
|
||||
|
||||
/obj/item/weapon/module
|
||||
icon = 'icons/obj/module.dmi'
|
||||
|
||||
@@ -61,6 +61,16 @@
|
||||
/obj/item/blob_act()
|
||||
return
|
||||
|
||||
//user: The mob that is suiciding
|
||||
//damagetype: The type of damage the item will inflict on the user
|
||||
//bruteloss = 1
|
||||
//fireloss = 2
|
||||
//toxloss = 4
|
||||
//oxyloss = 8
|
||||
//This proc will return an array. The first element of the list should always be the suicide message that players will see, next is the damagetype
|
||||
/obj/item/proc/suicide_act(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/verb/move_to_top()
|
||||
set name = "Move To Top"
|
||||
set category = "Object"
|
||||
|
||||
@@ -193,7 +193,7 @@
|
||||
* Toy crossbow
|
||||
*/
|
||||
|
||||
/obj/item/toy/crossbow
|
||||
/obj/item/toy/crossbow
|
||||
name = "foam dart crossbow"
|
||||
desc = "A weapon favored by many overactive children. Ages 8 and up."
|
||||
icon = 'icons/obj/gun.dmi'
|
||||
@@ -368,6 +368,10 @@
|
||||
var/instant = 0
|
||||
var/colourName = "red" //for updateIcon purposes
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is jaming the [src] up \his nose and into \his brain. It looks like \he's trying to commit suicide.</b>"
|
||||
return (BRUTELOSS|OXYLOSS)
|
||||
|
||||
/*
|
||||
* Snap pops
|
||||
*/
|
||||
|
||||
@@ -81,6 +81,12 @@
|
||||
force = 10.0
|
||||
throwforce = 10.0
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << pick("\red <b>[user] is slitting \his wrists with the [src]! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[user] is slitting \his throat with the [src]! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[user] is slitting \his stomach open with the [src]! It looks like \he's trying to commit seppuku.</b>")
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/kitchen/utensil/knife/attack(target as mob, mob/living/user as mob)
|
||||
if ((CLUMSY in user.mutations) && prob(50))
|
||||
user << "\red You accidentally cut yourself with the [src]."
|
||||
@@ -107,6 +113,12 @@
|
||||
origin_tech = "materials=1"
|
||||
attack_verb = list("slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << pick("\red <b>[user] is slitting \his wrists with the [src]! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[user] is slitting \his throat with the [src]! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[user] is slitting \his stomach open with the [src]! It looks like \he's trying to commit seppuku.</b>")
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/kitchenknife/ritual
|
||||
name = "ritual knife"
|
||||
desc = "The unearthly energies that once powered this blade are now dormant."
|
||||
|
||||
@@ -1,6 +1,11 @@
|
||||
/obj/item/weapon/melee/energy
|
||||
var/active = 0
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << pick("\red <b>[user] is slitting \his stomach open with the [src]! It looks like \he's trying to commit seppuku.</b>", \
|
||||
"\red <b>[user] is falling on the [src]! It looks like \he's trying to commit suicide.</b>")
|
||||
return (BRUTELOSS|FIRELOSS)
|
||||
|
||||
/obj/item/weapon/melee/energy/axe
|
||||
name = "energy axe"
|
||||
desc = "An energised battle axe."
|
||||
@@ -14,6 +19,10 @@
|
||||
origin_tech = "combat=3"
|
||||
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] swings the [src] towards /his head! It looks like \he's trying to commit suicide.</b>"
|
||||
return (BRUTELOSS|FIRELOSS)
|
||||
|
||||
/obj/item/weapon/melee/energy/sword
|
||||
color
|
||||
name = "energy sword"
|
||||
|
||||
@@ -9,4 +9,8 @@
|
||||
throwforce = 7
|
||||
w_class = 3
|
||||
origin_tech = "combat=4"
|
||||
attack_verb = list("flogged", "whipped", "lashed", "disciplined")
|
||||
attack_verb = list("flogged", "whipped", "lashed", "disciplined")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is strangling \himself with the [src]! It looks like \he's trying to commit suicide.</b>"
|
||||
return (OXYLOSS)
|
||||
@@ -21,6 +21,10 @@
|
||||
var/construction_cost = list("metal"=750,"glass"=75)
|
||||
var/construction_time=100
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is licking the electrodes of the [src]! It looks like \he's trying to commit suicide.</b>"
|
||||
return (FIRELOSS)
|
||||
|
||||
/obj/item/weapon/cell/crap
|
||||
name = "\improper Nanotrasen brand rechargable AA battery"
|
||||
desc = "You can't top the plasma top." //TOTALLY TRADEMARK INFRINGEMENT
|
||||
|
||||
@@ -12,6 +12,9 @@
|
||||
var/status = 0
|
||||
origin_tech = "combat=2"
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is putting the live [src] in \his mouth! It looks like \he's trying to commit suicide.</b>"
|
||||
return (FIRELOSS)
|
||||
|
||||
/obj/item/weapon/melee/baton/update_icon()
|
||||
if(status)
|
||||
|
||||
@@ -294,7 +294,10 @@
|
||||
origin_tech = "materials=1;biotech=1"
|
||||
attack_verb = list("drilled")
|
||||
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << pick("/red <b>[user] is pressing the [src] to \his temple and activating it! It looks like \he's trying to commit suicide.</b>", \
|
||||
"/red <b>[user] is pressing [src] to \his chest and activating it! It looks like \he's trying to commit suicide.</b>")
|
||||
return (BRUTELOSS)
|
||||
/*
|
||||
* Scalpel
|
||||
*/
|
||||
@@ -314,6 +317,12 @@
|
||||
origin_tech = "materials=1;biotech=1"
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << pick("\red <b>[user] is slitting \his wrists with the [src]! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[user] is slitting \his throat with the [src]! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[user] is slitting \his stomach open with the [src]! It looks like \he's trying to commit seppuku.</b>")
|
||||
return (BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/scalpel/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
if(!istype(M))
|
||||
return ..()
|
||||
|
||||
@@ -48,6 +48,11 @@
|
||||
m_amt = 75
|
||||
attack_verb = list("stabbed")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << pick("\red <b>[user] is stabbing the [src] into \his temple! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[user] is stabbing the [src] into \his heart! It looks like \he's trying to commit suicide.</b>")
|
||||
return(BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/screwdriver/New()
|
||||
switch(pick("red","blue","purple","brown","green","cyan","yellow"))
|
||||
if ("red")
|
||||
|
||||
@@ -10,6 +10,10 @@
|
||||
var/mode = 1 //0 = pick one at a time, 1 = pick all on tile
|
||||
var/capacity = 25 //the amount of trash it can carry.
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "/red <b>[user] has put the [src] over \his head and is starting to hyperventilate! It looks like \he's trying to commit suicide.</b>"
|
||||
return(OXYLOSS)
|
||||
|
||||
/obj/item/weapon/trashbag/update_icon()
|
||||
if(contents.len == 0)
|
||||
icon_state = "trashbag0"
|
||||
|
||||
@@ -11,6 +11,10 @@
|
||||
throw_range = 15
|
||||
attack_verb = list("banned")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is hitting \himself with the [src]! It looks like \he's trying to ban \himself from life.</b>"
|
||||
return (BRUTELOSS|FIRELOSS|TOXLOSS|OXYLOSS)
|
||||
|
||||
/obj/item/weapon/nullrod
|
||||
name = "null rod"
|
||||
desc = "A rod of pure obsidian, its very presence disrupts and dampens the powers of Nar-Sie's followers."
|
||||
@@ -24,6 +28,10 @@
|
||||
throwforce = 10
|
||||
w_class = 1
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is impaling \himself with the [src]! It looks like \he's trying to commit suicide.</b>"
|
||||
return (BRUTELOSS|FIRELOSS)
|
||||
|
||||
/obj/item/weapon/sord
|
||||
name = "\improper SORD"
|
||||
desc = "This thing is so unspeakably shitty you are having a hard time even holding it."
|
||||
@@ -36,6 +44,10 @@
|
||||
w_class = 3
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is impaling \himself with the [src]! It looks like \he's trying to commit suicide.</b>"
|
||||
return(BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/sord/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
|
||||
return ..()
|
||||
@@ -55,6 +67,10 @@
|
||||
IsShield()
|
||||
return 1
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is falling on the [src]! It looks like \he's trying to commit suicide.</b>"
|
||||
return(BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/claymore/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
|
||||
playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
|
||||
return ..()
|
||||
@@ -71,6 +87,10 @@
|
||||
w_class = 3
|
||||
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is slitting \his stomach open with the [src]! It looks like \he's trying to commit seppuku.</b>"
|
||||
return(BRUTELOSS)
|
||||
|
||||
/obj/item/weapon/katana/IsShield()
|
||||
return 1
|
||||
|
||||
|
||||
@@ -22,8 +22,53 @@
|
||||
src << "You can't commit suicide whilst restrained! ((You can type Ghost instead however.))"
|
||||
return
|
||||
suiciding = 1
|
||||
//instead of killing them instantly, just put them at -175 health and let 'em gasp for a while
|
||||
viewers(src) << "\red <b>[src] is attempting to bite \his tongue. It looks like \he's trying to commit suicide.</b>"
|
||||
var/obj/item/held_item = get_active_hand()
|
||||
if(held_item)
|
||||
var/damagetype = held_item.suicide_act(src)
|
||||
if(damagetype)
|
||||
var/damage_mod = 1
|
||||
switch(damagetype) //Sorry about the magic numbers.
|
||||
//brute = 1, burn = 2, tox = 4, oxy = 8
|
||||
if(15) //4 damage types
|
||||
damage_mod = 4
|
||||
|
||||
if(6, 11, 13, 14) //3 damage types
|
||||
damage_mod = 3
|
||||
|
||||
if(3, 5, 7, 9, 10, 12) //2 damage types
|
||||
damage_mod = 2
|
||||
|
||||
if(1, 2, 4, 8) //1 damage type
|
||||
damage_mod = 1
|
||||
|
||||
else //This should not happen, but if it does, everything should still work
|
||||
damage_mod = 1
|
||||
|
||||
//Do 175 damage divided by the number of damage types applied.
|
||||
if(damagetype & BRUTELOSS)
|
||||
adjustBruteLoss(175/damage_mod)
|
||||
|
||||
if(damagetype & FIRELOSS)
|
||||
adjustFireLoss(175/damage_mod)
|
||||
|
||||
if(damagetype & TOXLOSS)
|
||||
adjustToxLoss(175/damage_mod)
|
||||
|
||||
if(damagetype & OXYLOSS)
|
||||
adjustOxyLoss(175/damage_mod)
|
||||
|
||||
//If something went wrong, just do normal oxyloss
|
||||
if(!(damagetype | BRUTELOSS) && !(damagetype | FIRELOSS) && !(damagetype | TOXLOSS) && !(damagetype | OXYLOSS))
|
||||
adjustOxyLoss(max(175 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
|
||||
|
||||
updatehealth()
|
||||
return
|
||||
|
||||
|
||||
viewers(src) << pick("\red <b>[src] is attempting to bite \his tongue off! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[src] is jamming \his thumbs into \his eye sockets! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[src] is twisting \his own neck! It looks like \he's trying to commit suicide.</b>", \
|
||||
"\red <b>[src] is holding \his breath! It looks like \he's trying to commit suicide.</b>")
|
||||
adjustOxyLoss(max(175 - getToxLoss() - getFireLoss() - getBruteLoss() - getOxyLoss(), 0))
|
||||
updatehealth()
|
||||
|
||||
|
||||
@@ -191,7 +191,7 @@
|
||||
msg += "<span class='warning'>[t_He] [t_is] twitching ever so slightly.</span>\n"
|
||||
|
||||
if(suiciding)
|
||||
msg += "<span class='warning'>[t_He] [t_has] bitten off [t_his] own tongue and [t_has] suffered major bloodloss!</span>\n"
|
||||
msg += "<span class='warning'>[t_He] appears to have commited suicide... there is no hope of recovery.</span>\n"
|
||||
|
||||
if(stat == DEAD || (status_flags & FAKEDEATH))
|
||||
if(brain_op_stage != 4)//Only perform these checks if there is no brain
|
||||
|
||||
@@ -106,6 +106,10 @@
|
||||
walk(src,0)
|
||||
..()
|
||||
|
||||
/mob/living/simple_animal/parrot/Stat()
|
||||
..()
|
||||
stat("Held Item", held_item)
|
||||
|
||||
/*
|
||||
* Inventory
|
||||
*/
|
||||
|
||||
@@ -172,6 +172,10 @@
|
||||
item_state = "coil_red"
|
||||
attack_verb = list("whipped", "lashed", "disciplined", "flogged")
|
||||
|
||||
suicide_act(mob/user)
|
||||
viewers(user) << "\red <b>[user] is strangling \himself with the [src]! It looks like \he's trying to commit suicide.</b>"
|
||||
return(OXYLOSS)
|
||||
|
||||
|
||||
/obj/item/weapon/cable_coil/New(loc, length = MAXCOIL, var/param_color = null)
|
||||
..()
|
||||
|
||||
@@ -409,6 +409,7 @@ var/list/global_mutations = list() // list of hidden mutation things
|
||||
|
||||
|
||||
//Damage things //TODO: merge these down to reduce on defines
|
||||
//Way to waste perfectly good damagetype names (BRUTE) on this... If you were really worried about case sensitivity, you could have just used lowertext(damagetype) in the proc...
|
||||
#define BRUTE "brute"
|
||||
#define BURN "fire"
|
||||
#define TOX "tox"
|
||||
@@ -424,6 +425,12 @@ var/list/global_mutations = list() // list of hidden mutation things
|
||||
#define EYE_BLUR "eye_blur"
|
||||
#define DROWSY "drowsy"
|
||||
|
||||
//I hate adding defines like this but I'd much rather deal with bitflags than lists and string searches
|
||||
#define BRUTELOSS 1
|
||||
#define FIRELOSS 2
|
||||
#define TOXLOSS 4
|
||||
#define OXYLOSS 8
|
||||
|
||||
//Bitflags defining which status effects could be or are inflicted on a mob
|
||||
#define CANSTUN 1
|
||||
#define CANWEAKEN 2
|
||||
|
||||
Reference in New Issue
Block a user