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:
johnsonmt88@gmail.com
2013-01-05 03:56:24 +00:00
parent 9cf23741ca
commit 2c3ae32f04
18 changed files with 174 additions and 6 deletions
+12
View File
@@ -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."
+12
View File
@@ -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'