Permalink
Browse files

Added plungers.

  • Loading branch information...
MistakeNot4892 committed Dec 14, 2017
1 parent 763b097 commit 38d79363ec29434a7f184d8dd4702b3c880d4ef9
@@ -658,6 +658,7 @@
#include "code\game\objects\items\glassjar.dm"
#include "code\game\objects\items\latexballoon.dm"
#include "code\game\objects\items\paintkit.dm"
#include "code\game\objects\items\plunger.dm"
#include "code\game\objects\items\shooting_range.dm"
#include "code\game\objects\items\toys.dm"
#include "code\game\objects\items\trash.dm"
@@ -0,0 +1,65 @@
/obj/item/clothing/plunger
name = "plunger"
desc = "This is possibly the least sanitary object around."
icon_state = "plunger_black"
icon = 'icons/obj/plunger.dmi'
attack_verb = list("plunged")
force = 1
w_class = 3
slot_flags = SLOT_HEAD | SLOT_MASK
flags = NOSLIP
climbing_effectiveness = 0.5 // You need shoes and feet both to be able to climb even easy surfaces.
hitsound = 'sound/effects/plunger.ogg'
var/taped = FALSE
var/doubled = FALSE
/obj/item/clothing/plunger/attackby(var/obj/item/thing, var/mob/user)
if(istype(thing, /obj/item/tape_roll))
if(taped)
to_chat(user, "<span class='warning'>\The [src] already has tape wrapped around it.</span>")
return
visible_message("<span class='notice'\The [user] wraps some tape around \the [src].</span>")
taped = TRUE
update_icon()
else if(thing.iswirecutter() && taped)
visible_message("<span class='notice'\The [user] snips the tape from \the [src].</span>")
taped = FALSE
if(doubled)
doubled = FALSE
for(var/obj/item/clothing/plunger/P in contents)
P.forceMove(get_turf(src))
update_state()
else if(istype(thing, /obj/item/clothing/plunger) && !doubled)
if(!taped)
to_chat(user, "<span class='warning'>\The [src] needs some tape to secure \the [thing], first.</span>")
return
user.drop_from_inventory(thing)
thing.forceMove(src)
doubled = TRUE
visible_message("<span class='notice'\The [user] attaches a second plunger to \the [src].</span>")
update_state()
else
. = ..()
/obj/item/clothing/plunger/update_icon()
icon_state = initial(icon_state)
if(doubled)
icon_state += "_doubled"
else if(taped)
icon_state += "_taped"
var/mob/living/carbon/human/H = loc
/obj/item/clothing/plunger/proc/update_state()
name = initial(name)
gender = NEUTER
slot_flags = initial(slot_flags)
if(doubled)
name += "s"
gender = PLURAL
slot_flags |= SLOT_GLOVES|SLOT_FEET
var/mob/living/carbon/human/H = loc
if(istype(H) && ((H.gloves == src && !(slot_flags & SLOT_GLOVES)) || (H.shoes == src && !(slot_flags & SLOT_FEET))))
H.drop_from_inventory(src)
update_icon()
@@ -117,8 +117,8 @@
// Species code.
/datum/species/proc/get_footstep_sound(var/mob/living/carbon/human/H, var/turf_type)
var/obj/item/clothing/shoes/shoes = H.shoes
if(turf_type == FOOTSTEPS_HARD && istype(shoes))
return shoes.get_footstep_sound()
if(shoes)
return shoes.get_footstep_sound(turf_type)
/datum/species/octopus/get_footstep_sound(var/mob/living/carbon/human/H, var/turf_type)
if(turf_type != FOOTSTEPS_WATER)
@@ -134,16 +134,21 @@
)
// Object code.
/obj/item/clothing/shoes/proc/get_footstep_sound()
/obj/item/clothing/proc/get_footstep_sound(var/turf_type)
return
/obj/item/clothing/shoes/jackboots/get_footstep_sound()
return pick( \
'sound/effects/footsteps/armor/gear1.ogg', \
'sound/effects/footsteps/armor/gear2.ogg', \
'sound/effects/footsteps/armor/gear3.ogg', \
'sound/effects/footsteps/armor/gear4.ogg' \
)
/obj/item/clothing/shoes/jackboots/get_footstep_sound(var/turf_type)
if(turf_type != FOOTSTEPS_WATER)
return pick( \
'sound/effects/footsteps/armor/gear1.ogg', \
'sound/effects/footsteps/armor/gear2.ogg', \
'sound/effects/footsteps/armor/gear3.ogg', \
'sound/effects/footsteps/armor/gear4.ogg' \
)
/obj/item/clothing/plunger/get_footstep_sound(var/turf_type)
if(turf_type != FOOTSTEPS_WATER)
return 'sound/effects/plunger.ogg'
// Flooring code.
/decl/flooring/var/footstep_type = FOOTSTEPS_HARD
@@ -101,6 +101,7 @@
break
if(!climb_failed)
usr.forceMove(above)
do_climb_sound()
to_chat(usr, "<span class='notice'>You climb upwards.</span>")
return
to_chat(usr, "<span class='warning'>You cannot scale any of the nearby walls.</span>")
@@ -127,15 +128,27 @@
break
if(!climb_failed)
usr.forceMove(below)
do_climb_sound()
to_chat(usr, "<span class='notice'>You climb downwards.</span>")
return
to_chat(usr, "<span class='warning'>You cannot descend from this position.</span>")
/mob/living/proc/do_climb_sound()
return
/mob/living/proc/can_climb(var/climb_degree)
return (climb_degree == CLIMBABLE_EASY)
/obj/item/clothing/shoes/var/climbing_effectiveness = 0
/obj/item/clothing/gloves/var/climbing_effectiveness = 0
/mob/living/carbon/human/do_climb_sound()
var/climb_sound
if(shoes)
climb_sound = shoes.hitsound
if(gloves && gloves.hitsound && (!climb_sound || prob(50)))
climb_sound = gloves.hitsound
if(climb_sound)
playsound(src.loc, climb_sound, 50, 1)
/obj/item/clothing/var/climbing_effectiveness = 0
/datum/species/proc/can_climb_unaided(climb_degree)
return FALSE
@@ -149,8 +162,8 @@
return FALSE
var/climb_score = 0
var/obj/item/clothing/shoes/S = shoes
var/obj/item/clothing/gloves/G = gloves
var/obj/item/clothing/S = shoes
var/obj/item/clothing/G = gloves
if(istype(G)) climb_score += G.climbing_effectiveness
if(istype(S)) climb_score += S.climbing_effectiveness
BIN +317 Bytes (100%) icons/mob/clothing/gloves.dmi
Binary file not shown.
BIN +566 Bytes (100%) icons/mob/clothing/head.dmi
Binary file not shown.
BIN +837 Bytes (100%) icons/mob/feet.dmi
Binary file not shown.
BIN +267 Bytes (100%) icons/mob/mask.dmi
Binary file not shown.
BIN +597 Bytes icons/obj/plunger.dmi
Binary file not shown.
Binary file not shown.

0 comments on commit 38d7936

Please sign in to comment.