Persistent Trash/Dirt/Graffiti/Notices

This commit is contained in:
Cerebulon
2020-07-24 10:23:34 +01:00
committed by VirgoBot
parent 79de2902ba
commit 8b031dd8ad
58 changed files with 1166 additions and 190 deletions

View File

@@ -20,6 +20,8 @@ var/global/list/image/splatter_cache=list()
var/synthblood = 0
var/list/datum/disease2/disease/virus2 = list()
var/amount = 5
generic_filth = TRUE
persistent = FALSE
/obj/effect/decal/cleanable/blood/reveal_blood()
if(!fluorescent)

View File

@@ -5,6 +5,8 @@
icon_state = "gib1"
basecolor = SYNTH_BLOOD_COLOUR
random_icon_states = list("gib1", "gib2", "gib3", "gib4", "gib5", "gib6", "gib7")
generic_filth = FALSE
persistent = FALSE
/obj/effect/decal/cleanable/blood/gibs/robot/update_icon()
color = "#FFFFFF"
@@ -39,6 +41,8 @@
/obj/effect/decal/cleanable/blood/oil
basecolor = SYNTH_BLOOD_COLOUR
generic_filth = FALSE
persistent = FALSE
/obj/effect/decal/cleanable/blood/oil/dry()
return

View File

@@ -1,7 +1,22 @@
/obj/effect/decal/cleanable
plane = DIRTY_PLANE
var/persistent = FALSE
var/generic_filth = FALSE
var/age = 0
var/list/random_icon_states = list()
/obj/effect/decal/cleanable/Initialize(var/ml, var/_age)
if(!isnull(_age))
age = _age
if(random_icon_states && length(src.random_icon_states) > 0)
src.icon_state = pick(src.random_icon_states)
SSpersistence.track_value(src, /datum/persistent/filth)
. = ..()
/obj/effect/decal/cleanable/Destroy()
SSpersistence.forget_value(src, /datum/persistent/filth)
. = ..()
/obj/effect/decal/cleanable/clean_blood(var/ignore = 0)
if(!ignore)
qdel(src)

View File

@@ -10,7 +10,7 @@
origin_tech = list(TECH_ILLEGAL = 4, TECH_MAGNET = 4)
var/can_use = 1
var/obj/effect/dummy/chameleon/active_dummy = null
var/saved_item = /obj/item/weapon/cigbutt
var/saved_item = /obj/item/trash/cigbutt
var/saved_icon = 'icons/obj/clothing/masks.dmi'
var/saved_icon_state = "cigbutt"
var/saved_overlays

View File

@@ -7,6 +7,20 @@
w_class = ITEMSIZE_SMALL
desc = "This is rubbish."
drop_sound = 'sound/items/drop/wrapper.ogg'
var/age = 0
/obj/item/trash/New(var/newloc, var/_age)
..(newloc)
if(!isnull(_age))
age = _age
/obj/item/trash/Initialize()
SSpersistence.track_value(src, /datum/persistent/filth/trash)
. = ..()
/obj/item/trash/Destroy()
SSpersistence.forget_value(src, /datum/persistent/filth/trash)
. = ..()
/obj/item/trash/raisins
name = "\improper 4no raisins"

View File

@@ -150,7 +150,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
/obj/item/clothing/mask/smokable/examine(mob/user)
. = ..()
if(!is_pipe)
var/smoke_percent = round((smoketime / max_smoketime) * 100)
switch(smoke_percent)
@@ -283,7 +283,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
w_class = ITEMSIZE_TINY
slot_flags = SLOT_EARS | SLOT_MASK
attack_verb = list("burnt", "singed")
type_butt = /obj/item/weapon/cigbutt
type_butt = /obj/item/trash/cigbutt
chem_volume = 15
max_smoketime = 300
smoketime = 300
@@ -341,7 +341,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
name = "premium cigar"
desc = "A brown roll of tobacco and... well, you're not quite sure. This thing's huge!"
icon_state = "cigar2"
type_butt = /obj/item/weapon/cigbutt/cigarbutt
type_butt = /obj/item/trash/cigbutt/cigarbutt
throw_speed = 0.5
item_state = "cigar"
max_smoketime = 1500
@@ -369,7 +369,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
chem_volume = 30
nicotine_amt = 10
/obj/item/weapon/cigbutt
/obj/item/trash/cigbutt
name = "cigarette butt"
desc = "A manky old cigarette butt."
icon = 'icons/obj/clothing/masks.dmi'
@@ -379,12 +379,12 @@ CIGARETTE PACKETS ARE IN FANCY.DM
slot_flags = SLOT_EARS
throwforce = 1
/obj/item/weapon/cigbutt/Initialize()
/obj/item/trash/cigbutt/Initialize()
. = ..()
randpixel_xy()
transform = turn(transform,rand(0,360))
/obj/item/weapon/cigbutt/cigarbutt
/obj/item/trash/cigbutt/cigarbutt
name = "cigar butt"
desc = "A manky old cigar butt."
icon_state = "cigarbutt"

View File

@@ -46,7 +46,7 @@ var/global/list/ashtray_cache = list()
/obj/item/weapon/material/ashtray/attackby(obj/item/weapon/W as obj, mob/user as mob)
if (health <= 0)
return
if (istype(W,/obj/item/weapon/cigbutt) || istype(W,/obj/item/clothing/mask/smokable/cigarette) || istype(W, /obj/item/weapon/flame/match))
if (istype(W,/obj/item/trash/cigbutt) || istype(W,/obj/item/clothing/mask/smokable/cigarette) || istype(W, /obj/item/weapon/flame/match))
if (contents.len >= max_butts)
to_chat(user, "\The [src] is full.")
return

View File

@@ -209,7 +209,7 @@
throwforce = 2
slot_flags = SLOT_BELT
storage_slots = 6
can_hold = list(/obj/item/clothing/mask/smokable/cigarette, /obj/item/weapon/flame/lighter, /obj/item/weapon/cigbutt)
can_hold = list(/obj/item/clothing/mask/smokable/cigarette, /obj/item/weapon/flame/lighter, /obj/item/trash/cigbutt)
icon_type = "cigarette"
starts_with = list(/obj/item/clothing/mask/smokable/cigarette = 6)
var/brand = "\improper Trans-Stellar Duty-free"
@@ -316,7 +316,7 @@
throwforce = 2
slot_flags = SLOT_BELT
storage_slots = 7
can_hold = list(/obj/item/clothing/mask/smokable/cigarette/cigar, /obj/item/weapon/cigbutt/cigarbutt)
can_hold = list(/obj/item/clothing/mask/smokable/cigarette/cigar, /obj/item/trash/cigbutt/cigarbutt)
icon_type = "cigar"
starts_with = list(/obj/item/clothing/mask/smokable/cigarette/cigar = 7)

View File

@@ -126,7 +126,7 @@
return 1
/obj/item/weapon/tape_roll/proc/stick(var/obj/item/weapon/W, mob/user)
if(!istype(W, /obj/item/weapon/paper))
if(!istype(W, /obj/item/weapon/paper) || istype(W, /obj/item/weapon/paper/sticky) || !user.unEquip(W))
return
user.drop_from_inventory(W)
var/obj/item/weapon/ducttape/tape = new(get_turf(src))

View File

@@ -48,7 +48,6 @@ var/list/random_useful_
if(prob(70)) // Misc. junk
if(!random_junk_)
random_junk_ = subtypesof(/obj/item/trash)
random_junk_ += typesof(/obj/item/weapon/cigbutt)
random_junk_ += /obj/effect/decal/cleanable/spiderling_remains
random_junk_ += /obj/effect/decal/remains/mouse
random_junk_ += /obj/effect/decal/remains/robot

View File

@@ -542,8 +542,8 @@
/obj/item/device/assembly/mousetrap/armed,
/obj/effect/decal/cleanable/spiderling_remains,
/obj/effect/decal/cleanable/ash,
/obj/item/weapon/cigbutt,
/obj/item/weapon/cigbutt/cigarbutt,
/obj/item/trash/cigbutt,
/obj/item/trash/cigbutt/cigarbutt,
/obj/effect/decal/remains/mouse)
/obj/random/janusmodule

View File

@@ -1,98 +0,0 @@
/obj/structure/noticeboard
name = "notice board"
desc = "A board for pinning important notices upon."
icon = 'icons/obj/stationobjs.dmi'
icon_state = "nboard00"
density = 0
anchored = 1
var/notices = 0
/obj/structure/noticeboard/New(var/loc, var/dir, var/building = 0)
..()
if(building)
if(loc)
src.loc = loc
pixel_x = (dir & 3)? 0 : (dir == 4 ? -32 : 32)
pixel_y = (dir & 3)? (dir ==1 ? -27 : 27) : 0
update_icon()
return
/obj/structure/noticeboard/Initialize()
for(var/obj/item/I in loc)
if(notices > 4) break
if(istype(I, /obj/item/weapon/paper))
I.loc = src
notices++
icon_state = "nboard0[notices]"
. = ..()
//attaching papers!!
/obj/structure/noticeboard/attackby(var/obj/item/weapon/O as obj, var/mob/user as mob)
if(istype(O, /obj/item/weapon/paper))
if(notices < 5)
O.add_fingerprint(user)
add_fingerprint(user)
user.drop_from_inventory(O)
O.loc = src
notices++
icon_state = "nboard0[notices]" //update sprite
to_chat(user, "<span class='notice'>You pin the paper to the noticeboard.</span>")
else
to_chat(user, "<span class='notice'>You reach to pin your paper to the board but hesitate. You are certain your paper will not be seen among the many others already attached.</span>")
if(O.is_wrench())
to_chat(user, "<span class='notice'>You start to unwrench the noticeboard.</span>")
playsound(src, O.usesound, 50, 1)
if(do_after(user, 15 * O.toolspeed))
to_chat(user, "<span class='notice'>You unwrench the noticeboard.</span>")
new /obj/item/frame/noticeboard( src.loc )
qdel(src)
return
/obj/structure/noticeboard/attack_hand(var/mob/user)
user.examinate(src)
// Since Topic() never seems to interact with usr on more than a superficial
// level, it should be fine to let anyone mess with the board other than ghosts.
/obj/structure/noticeboard/examine(var/mob/user)
. = ..()
if(Adjacent(user))
var/dat = "<B>Noticeboard</B><BR>"
for(var/obj/item/weapon/paper/P in src)
dat += "<A href='?src=\ref[src];read=\ref[P]'>[P.name]</A> <A href='?src=\ref[src];write=\ref[P]'>Write</A> <A href='?src=\ref[src];remove=\ref[P]'>Remove</A><BR>"
user << browse("<HEAD><TITLE>Notices</TITLE></HEAD>[dat]","window=noticeboard")
onclose(user, "noticeboard")
/obj/structure/noticeboard/Topic(href, href_list)
..()
usr.set_machine(src)
if(href_list["remove"])
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
return
var/obj/item/P = locate(href_list["remove"])
if(P && P.loc == src)
P.loc = get_turf(src) //dump paper on the floor because you're a clumsy fuck
P.add_fingerprint(usr)
add_fingerprint(usr)
notices--
icon_state = "nboard0[notices]"
if(href_list["write"])
if((usr.stat || usr.restrained())) //For when a player is handcuffed while they have the notice window open
return
var/obj/item/P = locate(href_list["write"])
if((P && P.loc == src)) //ifthe paper's on the board
var/mob/living/M = usr
if(istype(M))
var/obj/item/weapon/pen/E = M.get_type_in_hands(/obj/item/weapon/pen)
if(E)
add_fingerprint(M)
P.attackby(E, usr)
else
to_chat(M, "<span class='notice'>You'll need something to write with!</span>")
if(href_list["read"])
var/obj/item/weapon/paper/P = locate(href_list["read"])
if((P && P.loc == src))
usr << browse("<HTML><HEAD><TITLE>[P.name]</TITLE></HEAD><BODY><TT>[P.info]</TT></BODY></HTML>", "window=[P.name]")
onclose(usr, "[P.name]")
return