From 95f7280781523c0fb16579f3946166b05583e7d1 Mon Sep 17 00:00:00 2001 From: Jesus Hussein Chris Date: Wed, 22 Jan 2014 19:00:31 +1300 Subject: [PATCH] Generic attack sounds for all melee weapons Overrides the generic sounds with more suitable ones where needed. Weapons that do no damage don't have sound effects. Conflicts: code/game/gamemodes/wizard/artefact.dm code/game/objects/items/stacks/sheets/glass.dm code/game/objects/items/weapons/melee/misc.dm code/game/objects/items/weapons/storage/toolbox.dm code/game/objects/items/weapons/stunbaton.dm code/game/objects/items/weapons/weaponry.dm code/game/objects/weapons.dm code/modules/hydroponics/hydroitemdefines.dm code/modules/surgery/tools.dm --- code/_onclick/item_attack.dm | 2 +- code/defines/obj/weapon.dm | 6 +- code/game/gamemodes/cult/cult_items.dm | 4 +- code/game/gamemodes/wizard/artefact.dm | 3 +- .../game/objects/items/stacks/sheets/glass.dm | 1 + code/game/objects/items/toys.dm | 1 + code/game/objects/items/weapons/kitchen.dm | 1 + code/game/objects/items/weapons/melee/misc.dm | 2 + .../objects/items/weapons/storage/toolbox.dm | 1 + code/game/objects/items/weapons/stunbaton.dm | 1 + .../game/objects/items/weapons/tanks/tanks.dm | 1 + code/game/objects/items/weapons/tools.dm | 1 + code/game/objects/items/weapons/twohanded.dm | 1 + code/game/objects/items/weapons/weaponry.dm | 5 +- code/game/objects/weapons.dm | 1 + code/modules/hydroponics/hydroitemdefines.dm | 188 ++++++++++++++++++ .../reagent_containers/food/drinks/bottle.dm | 6 +- code/modules/surgery/tools.dm | 112 +++++++++++ 18 files changed, 319 insertions(+), 18 deletions(-) create mode 100644 code/modules/hydroponics/hydroitemdefines.dm create mode 100644 code/modules/surgery/tools.dm diff --git a/code/_onclick/item_attack.dm b/code/_onclick/item_attack.dm index bd3bee2839d..33289c34591 100644 --- a/code/_onclick/item_attack.dm +++ b/code/_onclick/item_attack.dm @@ -33,7 +33,7 @@ if (istype(M,/mob/living/carbon/brain)) messagesource = M:container - if (hitsound) + if (hitsound && force > 0) playsound(loc, hitsound, 50, 1, -1) ///////////////////////// user.lastattacked = M diff --git a/code/defines/obj/weapon.dm b/code/defines/obj/weapon.dm index fc5ad29d195..d4104f4bee9 100644 --- a/code/defines/obj/weapon.dm +++ b/code/defines/obj/weapon.dm @@ -525,10 +525,7 @@ m_amt = 15000 origin_tech = "materials=2;combat=1" attack_verb = list("chopped", "torn", "cut") - -/obj/item/weapon/hatchet/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) - playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1) - return ..() + hitsound = 'sound/weapons/bladeslice.ogg' /obj/item/weapon/hatchet/unathiknife name = "duelling knife" @@ -550,6 +547,7 @@ slot_flags = SLOT_BACK origin_tech = "materials=2;combat=2" attack_verb = list("chopped", "sliced", "cut", "reaped") + hitsound = 'sound/weapons/bladeslice.ogg' /obj/item/weapon/scythe/afterattack(atom/A, mob/user as mob, proximity) if(!proximity) return diff --git a/code/game/gamemodes/cult/cult_items.dm b/code/game/gamemodes/cult/cult_items.dm index 014371cabf9..99bc4154cd8 100644 --- a/code/game/gamemodes/cult/cult_items.dm +++ b/code/game/gamemodes/cult/cult_items.dm @@ -7,12 +7,12 @@ w_class = 4 force = 30 throwforce = 10 + hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") /obj/item/weapon/melee/cultblade/attack(mob/living/target as mob, mob/living/carbon/human/user as mob) if(iscultist(user)) - playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1) return ..() else user.Paralyse(5) @@ -101,4 +101,4 @@ allowed = list(/obj/item/weapon/tome,/obj/item/weapon/melee/cultblade,/obj/item/weapon/tank/emergency_oxygen) slowdown = 1 armor = list(melee = 60, bullet = 50, laser = 30,energy = 15, bomb = 30, bio = 30, rad = 30) - siemens_coefficient = 0 \ No newline at end of file + siemens_coefficient = 0 diff --git a/code/game/gamemodes/wizard/artefact.dm b/code/game/gamemodes/wizard/artefact.dm index ace9429c751..37b2de5a3ee 100644 --- a/code/game/gamemodes/wizard/artefact.dm +++ b/code/game/gamemodes/wizard/artefact.dm @@ -1,4 +1,3 @@ - /////////Apprentice Contract////////// /obj/item/weapon/contract @@ -121,6 +120,7 @@ throwforce = 10 w_class = 3 var/charged = 1 + hitsound = 'sound/weapons/bladeslice.ogg' /obj/effect/rend name = "tear in the fabric of reality" @@ -203,4 +203,3 @@ user << "\blue You can see...everything!" visible_message("\red [usr] stares into [src], their eyes glazing over.") user.ghostize(1) - return \ No newline at end of file diff --git a/code/game/objects/items/stacks/sheets/glass.dm b/code/game/objects/items/stacks/sheets/glass.dm index f0d3d00f4ec..6c8f6423fa9 100644 --- a/code/game/objects/items/stacks/sheets/glass.dm +++ b/code/game/objects/items/stacks/sheets/glass.dm @@ -255,6 +255,7 @@ item_state = "shard-glass" g_amt = 3750 attack_verb = list("stabbed", "slashed", "sliced", "cut") + hitsound = 'sound/weapons/bladeslice.ogg' suicide_act(mob/user) viewers(user) << pick("[user] is slitting \his wrists with the shard of glass! It looks like \he's trying to commit suicide.", \ diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm index cda1ff18659..85e4defe35d 100644 --- a/code/game/objects/items/toys.dm +++ b/code/game/objects/items/toys.dm @@ -381,6 +381,7 @@ throwforce = 5 w_class = 3 attack_verb = list("attacked", "slashed", "stabbed", "sliced") + hitsound = 'sound/weapons/bladeslice.ogg' /* * Crayons diff --git a/code/game/objects/items/weapons/kitchen.dm b/code/game/objects/items/weapons/kitchen.dm index 446865a5de9..49ba964c555 100644 --- a/code/game/objects/items/weapons/kitchen.dm +++ b/code/game/objects/items/weapons/kitchen.dm @@ -25,6 +25,7 @@ flags = FPRINT | TABLEPASS | CONDUCT origin_tech = "materials=1" attack_verb = list("attacked", "stabbed", "poked") + hitsound = 'sound/weapons/bladeslice.ogg' /obj/item/weapon/kitchen/utensil/New() if (prob(60)) diff --git a/code/game/objects/items/weapons/melee/misc.dm b/code/game/objects/items/weapons/melee/misc.dm index 9ce1885e814..6b80edd6fd0 100644 --- a/code/game/objects/items/weapons/melee/misc.dm +++ b/code/game/objects/items/weapons/melee/misc.dm @@ -10,12 +10,14 @@ w_class = 3 origin_tech = "combat=4" attack_verb = list("flogged", "whipped", "lashed", "disciplined") + hitsound = 'sound/weapons/slash.ogg' //pls replace /obj/item/weapon/melee/chainofcommand/suicide_act(mob/user) viewers(user) << "[user] is strangling \himself with the [src.name]! It looks like \he's trying to commit suicide." return (OXYLOSS) + /obj/item/weapon/melee/icepick name = "ice pick" desc = "Used for chopping ice. Also excellent for mafia esque murders." diff --git a/code/game/objects/items/weapons/storage/toolbox.dm b/code/game/objects/items/weapons/storage/toolbox.dm index 2c25e8adacb..3d6e62b6948 100644 --- a/code/game/objects/items/weapons/storage/toolbox.dm +++ b/code/game/objects/items/weapons/storage/toolbox.dm @@ -12,6 +12,7 @@ w_class = 4.0 origin_tech = "combat=1" attack_verb = list("robusted") + hitsound = "swing_hit" New() ..() diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm index 792388313e1..90901aec0db 100644 --- a/code/game/objects/items/weapons/stunbaton.dm +++ b/code/game/objects/items/weapons/stunbaton.dm @@ -221,3 +221,4 @@ icon_state = "stunprod_nocell" else icon_state = "stunprod" + diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm index 64cb94b4f8b..d96095849f2 100644 --- a/code/game/objects/items/weapons/tanks/tanks.dm +++ b/code/game/objects/items/weapons/tanks/tanks.dm @@ -6,6 +6,7 @@ icon = 'icons/obj/tank.dmi' flags = FPRINT | TABLEPASS | CONDUCT slot_flags = SLOT_BACK + hitsound = 'sound/weapons/smash.ogg' pressure_resistance = ONE_ATMOSPHERE*5 diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm index a41bda3d37e..78c2429f80d 100644 --- a/code/game/objects/items/weapons/tools.dm +++ b/code/game/objects/items/weapons/tools.dm @@ -48,6 +48,7 @@ g_amt = 0 m_amt = 75 attack_verb = list("stabbed") + hitsound = 'sound/weapons/bladeslice.ogg' suicide_act(mob/user) viewers(user) << pick("[user] is stabbing the [src.name] into \his temple! It looks like \he's trying to commit suicide.", \ diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm index 8eb439e36f9..f08f3ae262f 100644 --- a/code/game/objects/items/weapons/twohanded.dm +++ b/code/game/objects/items/weapons/twohanded.dm @@ -114,6 +114,7 @@ force_unwielded = 10 force_wielded = 40 attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut") + hitsound = 'sound/weapons/bladeslice.ogg' /obj/item/weapon/twohanded/fireaxe/update_icon() //Currently only here to fuck with the on-mob icons. icon_state = "fireaxe[wielded]" diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm index e945ae56ed9..10a8bfc6951 100644 --- a/code/game/objects/items/weapons/weaponry.dm +++ b/code/game/objects/items/weapons/weaponry.dm @@ -95,6 +95,7 @@ icon_state = "claymore" item_state = "claymore" flags = FPRINT | TABLEPASS | CONDUCT + hitsound = 'sound/weapons/bladeslice.ogg' slot_flags = SLOT_BELT force = 40 throwforce = 10 @@ -108,10 +109,6 @@ viewers(user) << "[user] is falling on the [src.name]! It looks like \he's trying to commit suicide." 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 ..() - /obj/item/weapon/katana name = "katana" desc = "Woefully underpowered in D20" diff --git a/code/game/objects/weapons.dm b/code/game/objects/weapons.dm index f9404c18259..b62efa1c049 100644 --- a/code/game/objects/weapons.dm +++ b/code/game/objects/weapons.dm @@ -1,6 +1,7 @@ /obj/item/weapon name = "weapon" icon = 'icons/obj/weapons.dmi' + hitsound = "swing_hit" /obj/item/weapon/Bump(mob/M as mob) spawn(0) diff --git a/code/modules/hydroponics/hydroitemdefines.dm b/code/modules/hydroponics/hydroitemdefines.dm new file mode 100644 index 00000000000..ea31ece535a --- /dev/null +++ b/code/modules/hydroponics/hydroitemdefines.dm @@ -0,0 +1,188 @@ +// Plant analyzer +/obj/item/device/analyzer/plant_analyzer + name = "plant analyzer" + desc = "A scanner used to evaluate a plant's various areas of growth." + icon = 'icons/obj/device.dmi' + icon_state = "hydro" + item_state = "analyzer" + origin_tech = "magnets=1;biotech=1" + + attack_self(mob/user as mob) + return 0 + +// ************************************* +// Hydroponics Tools +// ************************************* + +/obj/item/weapon/weedspray // -- Skie + desc = "It's a toxic mixture, in spray form, to kill small weeds." + icon = 'icons/obj/hydroponics.dmi' + name = "weed-spray" + icon_state = "weedspray" + item_state = "spray" + flags = OPENCONTAINER + slot_flags = SLOT_BELT + throwforce = 4 + w_class = 2.0 + throw_speed = 2 + throw_range = 10 + var/toxicity = 4 + var/WeedKillStr = 2 + + suicide_act(mob/user) + viewers(user) << "[user] is huffing the [src.name]! It looks like \he's trying to commit suicide." + return (TOXLOSS) + +/obj/item/weapon/pestspray // -- Skie + desc = "It's some pest eliminator spray! Do not inhale!" + icon = 'icons/obj/hydroponics.dmi' + name = "pest-spray" + icon_state = "pestspray" + item_state = "spray" + flags = OPENCONTAINER + slot_flags = SLOT_BELT + throwforce = 4 + w_class = 2.0 + throw_speed = 2 + throw_range = 10 + var/toxicity = 4 + var/PestKillStr = 2 + + suicide_act(mob/user) + viewers(user) << "[user] is huffing the [src.name]! It looks like \he's trying to commit suicide." + return (TOXLOSS) + +/obj/item/weapon/minihoe // -- Numbers + name = "mini hoe" + desc = "It's used for removing weeds or scratching your back." + icon = 'icons/obj/weapons.dmi' + icon_state = "hoe" + item_state = "hoe" + flags = CONDUCT + force = 5.0 + throwforce = 7.0 + w_class = 2.0 + m_amt = 50 + attack_verb = list("slashed", "sliced", "cut", "clawed") + hitsound = 'sound/weapons/bladeslice.ogg' + +// ************************************* +// Nutrient defines for hydroponics +// ************************************* + +/obj/item/nutrient + name = "bottle of nutrient" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle16" + w_class = 1.0 + var/mutmod = 0 + var/yieldmod = 0 + New() + src.pixel_x = rand(-5.0, 5) + src.pixel_y = rand(-5.0, 5) + +/obj/item/nutrient/ez + name = "bottle of E-Z-Nutrient" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle16" + mutmod = 1 + yieldmod = 1 + New() + src.pixel_x = rand(-5.0, 5) + src.pixel_y = rand(-5.0, 5) + +/obj/item/nutrient/l4z + name = "bottle of Left 4 Zed" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle18" + mutmod = 2 + yieldmod = 0 + New() + src.pixel_x = rand(-5.0, 5) + src.pixel_y = rand(-5.0, 5) + +/obj/item/nutrient/rh + name = "bottle of Robust Harvest" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle15" + mutmod = 0 + yieldmod = 2 + New() + src.pixel_x = rand(-5.0, 5) + src.pixel_y = rand(-5.0, 5) + +// ************************************* +// Pestkiller defines for hydroponics +// ************************************* + +/obj/item/pestkiller + name = "bottle of pestkiller" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle16" + var/toxicity = 0 + var/PestKillStr = 0 + New() + src.pixel_x = rand(-5.0, 5) + src.pixel_y = rand(-5.0, 5) + +/obj/item/pestkiller/carbaryl + name = "bottle of carbaryl" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle16" + toxicity = 4 + PestKillStr = 2 + New() + src.pixel_x = rand(-5.0, 5) + src.pixel_y = rand(-5.0, 5) + +/obj/item/pestkiller/lindane + name = "bottle of lindane" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle18" + toxicity = 6 + PestKillStr = 4 + New() + src.pixel_x = rand(-5.0, 5) + src.pixel_y = rand(-5.0, 5) + +/obj/item/pestkiller/phosmet + name = "bottle of phosmet" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle15" + toxicity = 8 + PestKillStr = 7 + New() + src.pixel_x = rand(-5.0, 5) + src.pixel_y = rand(-5.0, 5) + +// ************************************* +// Weedkiller defines for hydroponics +// ************************************* + +/obj/item/weedkiller + name = "bottle of weedkiller" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle16" + var/toxicity = 0 + var/WeedKillStr = 0 + +/obj/item/weedkiller/glyphosate + name = "bottle of glyphosate" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle16" + toxicity = 4 + WeedKillStr = 2 + +/obj/item/weedkiller/triclopyr + name = "bottle of triclopyr" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle18" + toxicity = 6 + WeedKillStr = 4 + +/obj/item/weedkiller/D24 + name = "bottle of 2,4-D" + icon = 'icons/obj/chemical.dmi' + icon_state = "bottle15" + toxicity = 8 + WeedKillStr = 7 \ No newline at end of file diff --git a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm index 6cefca65541..98375edfb78 100644 --- a/code/modules/reagents/reagent_containers/food/drinks/bottle.dm +++ b/code/modules/reagents/reagent_containers/food/drinks/bottle.dm @@ -128,14 +128,10 @@ throw_speed = 3 throw_range = 5 item_state = "beer" + hitsound = 'sound/weapons/bladeslice.ogg' attack_verb = list("stabbed", "slashed", "attacked") var/icon/broken_outline = icon('icons/obj/drinks.dmi', "broken") -/obj/item/weapon/broken_bottle/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob) - playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1) - return ..() - - /obj/item/weapon/reagent_containers/food/drinks/bottle/gin name = "Griffeater Gin" desc = "A bottle of high quality gin, produced in the New London Space Station." diff --git a/code/modules/surgery/tools.dm b/code/modules/surgery/tools.dm new file mode 100644 index 00000000000..f1f4d2972e4 --- /dev/null +++ b/code/modules/surgery/tools.dm @@ -0,0 +1,112 @@ +/obj/item/weapon/retractor + name = "retractor" + desc = "Retracts stuff." + icon = 'icons/obj/surgery.dmi' + icon_state = "retractor" + m_amt = 10000 + g_amt = 5000 + flags = CONDUCT + w_class = 1.0 + origin_tech = "materials=1;biotech=1" + + +/obj/item/weapon/hemostat + name = "hemostat" + desc = "You think you have seen this before." + icon = 'icons/obj/surgery.dmi' + icon_state = "hemostat" + m_amt = 5000 + g_amt = 2500 + flags = CONDUCT + w_class = 1.0 + origin_tech = "materials=1;biotech=1" + attack_verb = list("attacked", "pinched") + + +/obj/item/weapon/cautery + name = "cautery" + desc = "This stops bleeding." + icon = 'icons/obj/surgery.dmi' + icon_state = "cautery" + m_amt = 5000 + g_amt = 2500 + flags = CONDUCT + w_class = 1.0 + origin_tech = "materials=1;biotech=1" + attack_verb = list("burnt") + + +/obj/item/weapon/surgicaldrill + name = "surgical drill" + desc = "You can drill using this item. You dig?" + icon = 'icons/obj/surgery.dmi' + icon_state = "drill" + hitsound = 'sound/weapons/circsawhit.ogg' + m_amt = 15000 + g_amt = 10000 + flags = CONDUCT + force = 15.0 + w_class = 3.0 + origin_tech = "materials=1;biotech=1" + attack_verb = list("drilled") + + suicide_act(mob/user) + viewers(user) << pick("[user] is pressing [src] to \his temple and activating it! It looks like \he's trying to commit suicide.", \ + "[user] is pressing [src] to \his chest and activating it! It looks like \he's trying to commit suicide.") + return (BRUTELOSS) + + +/obj/item/weapon/scalpel + name = "scalpel" + desc = "Cut, cut, and once more cut." + icon = 'icons/obj/surgery.dmi' + icon_state = "scalpel" + flags = CONDUCT + force = 10.0 + w_class = 1.0 + throwforce = 5.0 + throw_speed = 3 + throw_range = 5 + m_amt = 10000 + g_amt = 5000 + origin_tech = "materials=1;biotech=1" + attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut") + hitsound = 'sound/weapons/bladeslice.ogg' + + suicide_act(mob/user) + viewers(user) << pick("[user] is slitting \his wrists with [src]! It looks like \he's trying to commit suicide.", \ + "[user] is slitting \his throat with [src]! It looks like \he's trying to commit suicide.", \ + "[user] is slitting \his stomach open with [src]! It looks like \he's trying to commit seppuku.") + return (BRUTELOSS) + + +/obj/item/weapon/circular_saw + name = "circular saw" + desc = "For heavy duty cutting." + icon = 'icons/obj/surgery.dmi' + icon_state = "saw" + hitsound = 'sound/weapons/circsawhit.ogg' + flags = CONDUCT + force = 15.0 + w_class = 3.0 + throwforce = 9.0 + throw_speed = 3 + throw_range = 5 + m_amt = 20000 + g_amt = 10000 + origin_tech = "materials=1;biotech=1" + attack_verb = list("attacked", "slashed", "sawed", "cut") + + +/obj/item/weapon/surgical_drapes + name = "surgical drapes" + desc = "Nanotrasen brand surgical drapes provide optimal safety and infection control." + icon = 'icons/obj/surgery.dmi' + icon_state = "surgical_drapes" + w_class = 1.0 + origin_tech = "biotech=1" + attack_verb = list("slapped") + +/obj/item/weapon/surgical_drapes/attack(mob/living/M, mob/user) + if(!attempt_initiate_surgery(src, M, user)) + ..() \ No newline at end of file