Custodial Additions (#13612)

This commit is contained in:
SleepyGemmy
2022-06-09 12:46:14 +02:00
committed by GitHub
parent 3d9a17098c
commit 85298bc510
36 changed files with 513 additions and 290 deletions
+47 -51
View File
@@ -321,62 +321,68 @@
icon_state = "comicstormman"
item_state = "comicstormman"
/*
* Toy crossbow
*/
//
// Toy Crossbows
//
/obj/item/toy/crossbow
name = "foam dart crossbow"
desc = "A weapon favored by many overactive children. Ages 8 and up."
desc = "A foam dart crossbow."
icon = 'icons/obj/guns/crossbow.dmi'
icon_state = "crossbow"
item_state = "crossbow"
slot_flags = SLOT_BELT | SLOT_HOLSTER
drop_sound = 'sound/items/drop/gun.ogg'
pickup_sound = 'sound/items/pickup/gun.ogg'
contained_sprite = TRUE
w_class = ITEMSIZE_SMALL
attack_verb = list("attacked", "struck", "hit")
var/bullets = 5
var/dart_count = 5
/obj/item/toy/crossbow/examine(mob/user)
if(..(user, 2) && bullets)
to_chat(user, "<span class='notice'>It is loaded with [bullets] foam darts!</span>")
if(..(user, 2) && dart_count)
to_chat(user, "<span class='notice'>\The [src] is loaded with [dart_count] foam dart\s.</span>")
/obj/item/toy/crossbow/attackby(obj/item/I as obj, mob/user as mob)
/obj/item/toy/crossbow/attackby(obj/item/I, mob/user)
if(istype(I, /obj/item/toy/ammo/crossbow))
if(bullets <= 4)
user.drop_from_inventory(I,src)
if(dart_count <= 4)
user.drop_from_inventory(I, src)
qdel(I)
bullets++
to_chat(user, "<span class='notice'>You load the foam dart into the crossbow.</span>")
dart_count++
to_chat(user, "<span class='notice'>You load the foam dart into \the [src].</span>")
else
to_chat(usr, "<span class='warning'>It's already fully loaded.</span>")
to_chat(usr, "<span class='warning'>\The [src] is already fully loaded.</span>")
/obj/item/toy/crossbow/afterattack(atom/target as mob|obj|turf|area, mob/user as mob, flag)
if(!isturf(target.loc) || target == user) return
if(flag) return
if (locate (/obj/structure/table, src.loc))
/obj/item/toy/crossbow/afterattack(atom/target, mob/user, flag)
if(!isturf(target.loc) || target == user)
return
else if (bullets)
if(flag)
return
if(locate(/obj/structure/table) in get_turf(src))
return
else if(dart_count)
var/turf/trg = get_turf(target)
var/obj/effect/foam_dart_dummy/D = new/obj/effect/foam_dart_dummy(get_turf(src))
bullets--
dart_count--
D.icon_state = "foamdart"
D.name = "foam dart"
playsound(user.loc, 'sound/items/syringeproj.ogg', 50, 1)
playsound(src, 'sound/items/syringeproj.ogg', 50, TRUE)
for(var/i=0, i<6, i++)
for(var/i = 0, i < 6, i++)
if (D)
if(D.loc == trg) break
step_towards(D,trg)
step_towards(D, trg)
for(var/mob/living/M in D.loc)
if(!istype(M,/mob/living)) continue
if(M == user) continue
if(!istype(M, /mob/living))
continue
if(M == user)
continue
for(var/mob/O in viewers(world.view, D))
O.show_message(text("<span class='warning'>\The [] was hit by the foam dart!</span>", M), 1)
new /obj/item/toy/ammo/crossbow(M.loc)
@@ -384,7 +390,9 @@
return
for(var/atom/A in D.loc)
if(A == user) continue
if(A == user)
continue
if(A.density)
new /obj/item/toy/ammo/crossbow(A.loc)
qdel(D)
@@ -397,35 +405,24 @@
qdel(D)
return
else if (bullets == 0)
user.Weaken(5)
for(var/mob/O in viewers(world.view, user))
O.show_message(text("<span class='warning'>\The [] realized they were out of ammo and starting scrounging for some!</span>", user), 1)
/obj/item/toy/crossbow/attack(mob/M as mob, mob/user as mob)
/obj/item/toy/crossbow/attack(mob/M, mob/user)
src.add_fingerprint(user)
// ******* Check
if (src.bullets > 0 && M.lying)
if (src.dart_count > 0 && M.lying) // Check
for(var/mob/O in viewers(M, null))
if(O.client)
O.show_message(text("<span class='danger'>\The [] casually lines up a shot with []'s head and pulls the trigger!</span>", user, M), 1, "<span class='warning'>You hear the sound of foam against skull</span>", 2)
O.show_message(text("<span class='notice'>\The [] casually lines up a shot with []'s head and pulls the trigger.</span>", user, M), 1)
O.show_message(text("<span class='warning'>\The [] was hit in the head by the foam dart!</span>", M), 1)
playsound(user.loc, 'sound/items/syringeproj.ogg', 50, 1)
playsound(src, 'sound/items/syringeproj.ogg', 50, TRUE)
new /obj/item/toy/ammo/crossbow(M.loc)
src.bullets--
else if (M.lying && src.bullets == 0)
for(var/mob/O in viewers(M, null))
if (O.client) O.show_message(text("<span class='danger'>\The [] casually lines up a shot with []'s head, pulls the trigger, then realizes they are out of ammo and drops to the floor in search of some!</span>", user, M), 1, "<span class='warning'>You hear someone fall</span>", 2)
user.Weaken(5)
src.dart_count--
return
/obj/item/toy/ammo/crossbow
name = "foam dart"
desc = "It's nerf or nothing! Ages 8 and up."
desc = "A foam dart."
icon = 'icons/obj/toy.dmi'
icon_state = "foamdart"
w_class = ITEMSIZE_TINY
@@ -434,13 +431,12 @@
pickup_sound = 'sound/items/pickup/food.ogg'
/obj/effect/foam_dart_dummy
name = ""
desc = ""
name = null
desc = null
icon = 'icons/obj/toy.dmi'
icon_state = null
anchored = 1
density = 0
anchored = TRUE
density = FALSE
/*
* Toy swords
@@ -106,6 +106,19 @@ var/list/tape_roll_applications = list()
return
return ..()
/obj/item/taperoll/custodial
name = "custodial holographic tape"
desc = "A high-tech roll of custodial tape, used to prevent people from tracking dirt everywhere and getting their shoes dirty."
icon_state = "custodial_start"
tape_type = /obj/item/tape/custodial
icon_base = "custodial"
/obj/item/tape/custodial
name = "custodial holographic tape"
desc = "A length of custodial tape. Better not cross it."
req_one_access = list(access_janitor)
icon_base = "custodial"
/obj/item/taperoll/attack_self(mob/user as mob)
if(icon_state == "[icon_base]_start")
start = get_turf(src)
@@ -387,11 +387,12 @@
icon_state = "militarybelt_syndie"
item_state = "militarybelt_syndie"
/obj/item/storage/belt/janitor
name = "janibelt"
desc = "A belt used to hold most janitorial supplies."
icon_state = "janibelt"
item_state = "janibelt"
/obj/item/storage/belt/custodial
name = "custodial belt"
desc = "A utility belt designed for custodial use."
desc_fluff = "A custodial belt is similar to most utility belts, but designed with pockets and attachment points that can hold common custodial tools."
icon_state = "custodialbelt"
item_state = "custodialbelt"
storage_slots = 8
w_class = ITEMSIZE_NORMAL
max_w_class = ITEMSIZE_NORMAL
@@ -403,15 +404,16 @@
/obj/item/extinguisher/mini,
/obj/item/device/radio,
/obj/item/clothing/gloves,
/obj/item/clothing/glasses/material,
/obj/item/clothing/glasses,
/obj/item/reagent_containers/spray,
/obj/item/grenade/chem_grenade, //if I'm going to be doing a full allowance on one belt, I need to do the other.
/obj/item/grenade/chem_grenade,
/obj/item/device/lightreplacer,
/obj/item/soap,
/obj/item/storage/bag/trash,
/obj/item/reagent_containers/glass/rag,
/obj/item/gun/energy/mousegun
)
/obj/item/gun/energy/mousegun,
/obj/item/device/gps
)
/obj/item/storage/belt/mining
name = "explorer's belt"