adds /mob/living/proc/attacked_by()

updates attack and defense code
adds missing sounds to some items, code cleanup, lowered volume for some sounds (from /tg/)
hitsound and attack_verb updates, weapons given hitsound on New() according to damage type
This commit is contained in:
uraniummeltdown
2018-03-04 13:52:52 +05:00
parent fc1b024e73
commit e6ded64e4a
10 changed files with 126 additions and 173 deletions
+5 -5
View File
@@ -151,21 +151,21 @@
icon = 'icons/obj/weapons.dmi'
icon_state = "sword0"
item_state = "sword0"
var/active = 0.0
var/active = FALSE
w_class = WEIGHT_CLASS_SMALL
attack_verb = list("attacked", "struck", "hit")
/obj/item/toy/sword/attack_self(mob/user as mob)
active = !(active)
/obj/item/toy/sword/attack_self(mob/user)
active = !active
if(active)
to_chat(user, "<span class='notice'>You extend the plastic blade with a quick flick of your wrist.</span>")
playsound(user, 'sound/weapons/saberon.ogg', 50, 1)
playsound(user, 'sound/weapons/saberon.ogg', 20, 1)
icon_state = "swordblue"
item_state = "swordblue"
w_class = WEIGHT_CLASS_BULKY
else
to_chat(user, "<span class='notice'>You push the plastic blade back down into the handle.</span>")
playsound(user, 'sound/weapons/saberoff.ogg', 50, 1)
playsound(user, 'sound/weapons/saberoff.ogg', 20, 1)
icon_state = "sword0"
item_state = "sword0"
w_class = WEIGHT_CLASS_SMALL
+7 -2
View File
@@ -22,7 +22,7 @@ LIGHTERS ARE IN LIGHTERS.DM
slot_flags = SLOT_EARS|SLOT_MASK
w_class = WEIGHT_CLASS_TINY
body_parts_covered = null
attack_verb = list("burnt", "singed")
attack_verb = null
var/lit = 0
var/icon_on = "cigon" //Note - these are in masks.dmi not in cigarette.dmi
var/icon_off = "cigoff"
@@ -128,7 +128,12 @@ LIGHTERS ARE IN LIGHTERS.DM
/obj/item/clothing/mask/cigarette/proc/light(flavor_text = null)
if(!src.lit)
src.lit = 1
damtype = "fire"
name = "lit [name]"
if(!istype(src, /obj/item/clothing/mask/cigarette/pipe)) //can't burn people with pipes
attack_verb = list("burnt", "singed")
hitsound = 'sound/items/welder.ogg'
damtype = "fire"
force = 4
if(reagents.get_reagent_amount("plasma")) // the plasma explodes when exposed to fire
var/datum/effect_system/reagents_explosion/e = new()
e.set_up(round(reagents.get_reagent_amount("plasma") / 2.5, 1), get_turf(src), 0, 0)
+18 -4
View File
@@ -13,7 +13,7 @@
throwforce = 4
flags = CONDUCT
slot_flags = SLOT_BELT
attack_verb = list("burnt", "singed")
attack_verb = null
var/lit = 0
/obj/item/weapon/lighter/zippo
@@ -38,6 +38,10 @@
w_class = WEIGHT_CLASS_BULKY
icon_state = icon_on
item_state = icon_on
force = 5
damtype = "fire"
hitsound = 'sound/items/welder.ogg'
attack_verb = list("burnt", "singed")
if(istype(src, /obj/item/weapon/lighter/zippo) )
user.visible_message("<span class='rose'>Without even breaking stride, [user] flips open and lights [src] in one smooth movement.</span>")
playsound(src.loc, 'sound/items/ZippoLight.ogg', 25, 1)
@@ -62,6 +66,9 @@
w_class = WEIGHT_CLASS_TINY
icon_state = icon_off
item_state = icon_off
hitsound = "swing_hit"
force = 0
attack_verb = null //human_defense.dm takes care of it
if(istype(src, /obj/item/weapon/lighter/zippo) )
user.visible_message("<span class='rose'>You hear a quiet click, as [user] shuts off [src] without even looking at what they're doing. Wow.")
playsound(src.loc, 'sound/items/ZippoClose.ogg', 25, 1)
@@ -149,21 +156,27 @@
var/smoketime = 5
w_class = WEIGHT_CLASS_TINY
origin_tech = "materials=1"
attack_verb = list("burnt", "singed")
attack_verb = null
/obj/item/weapon/match/process()
var/turf/location = get_turf(src)
smoketime--
if(smoketime < 1)
icon_state = "match_burnt"
lit = -1
damtype = "brute"
force = 0
icon_state = "match_burnt"
item_state = "cigoff"
name = "burnt match"
desc = "A match. This one has seen better days."
attack_verb = null
processing_objects.Remove(src)
return
if(location)
location.hotspot_expose(700, 5)
return
/obj/item/weapon/match/dropped(mob/user as mob)
/obj/item/weapon/match/dropped(mob/user)
if(lit == 1)
lit = -1
damtype = "brute"
@@ -171,6 +184,7 @@
item_state = "cigoff"
name = "burnt match"
desc = "A match. This one has seen better days."
attack_verb = null
processing_objects.Remove(src)
return ..()
@@ -12,7 +12,7 @@
light_power = 2
var/brightness_on = 2
var/colormap = list(red=LIGHT_COLOR_RED, blue=LIGHT_COLOR_LIGHTBLUE, green=LIGHT_COLOR_GREEN, purple=LIGHT_COLOR_PURPLE, rainbow=LIGHT_COLOR_WHITE)
/obj/item/weapon/melee/energy/suicide_act(mob/user)
user.visible_message(pick("<span class='suicide'>[user] is slitting \his stomach open with the [src.name]! It looks like \he's trying to commit seppuku.</span>", \
"<span class='suicide'>[user] is falling on the [src.name]! It looks like \he's trying to commit suicide.</span>"))
@@ -70,7 +70,7 @@
throw_range = 5
w_class = WEIGHT_CLASS_NORMAL
w_class_on = WEIGHT_CLASS_HUGE
hitsound = "swing_hit"
hitsound = 'sound/weapons/bladeslice.ogg'
flags = CONDUCT
armour_penetration = 100
origin_tech = "combat=4;magnets=3"
@@ -639,19 +639,25 @@
slot_flags = SLOT_BELT
can_hold = list(/obj/item/weapon/match)
New()
..()
for(var/i=1; i <= storage_slots; i++)
new /obj/item/weapon/match(src)
/obj/item/weapon/storage/box/matches/New()
..()
for(var/i in 1 to storage_slots)
new /obj/item/weapon/match(src)
attackby(obj/item/weapon/match/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/match) && W.lit == 0)
W.lit = 1
W.icon_state = "match_lit"
processing_objects.Add(W)
playsound(user.loc, 'sound/goonstation/misc/matchstick_light.ogg', 50, 1)
W.update_icon()
return
/obj/item/weapon/storage/box/matches/attackby(obj/item/weapon/match/W, mob/user, params)
if(istype(W, /obj/item/weapon/match) && W.lit == 0)
W.lit = 1
W.icon_state = "match_lit"
W.damtype = "fire"
W.force = 3
W.item_state = "cigon"
W.name = "lit match"
W.desc = "A match. This one is lit."
W.attack_verb = list("burnt","singed")
processing_objects.Add(W)
playsound(user.loc, 'sound/goonstation/misc/matchstick_light.ogg', 50, 1)
W.update_icon()
return
/obj/item/weapon/storage/box/autoinjectors
name = "box of injectors"
@@ -7,9 +7,10 @@
/*
* Banhammer
*/
/obj/item/weapon/banhammer/attack(mob/M as mob, mob/user as mob)
/obj/item/weapon/banhammer/attack(mob/M, mob/user)
to_chat(M, "<font color='red'><b> You have been banned FOR NO REISIN by [user]<b></font>")
to_chat(user, "<font color='red'> You have <b>BANNED</b> [M]</font>")
playsound(loc, 'sound/effects/adminhelp.ogg', 15) //keep it at 15% volume so people don't jump out of their skin too much
/*
* Classic Baton