mirror of
https://github.com/Aurorastation/Aurora-Old.git
synced 2026-07-16 10:12:19 +01:00
Initial Commit
This commit is contained in:
@@ -0,0 +1,135 @@
|
||||
/obj/item/ashtray
|
||||
icon = 'icons/ashtray.dmi'
|
||||
var/
|
||||
max_butts = 0
|
||||
empty_desc = ""
|
||||
icon_empty = ""
|
||||
icon_half = ""
|
||||
icon_full = ""
|
||||
icon_broken = ""
|
||||
|
||||
/obj/item/ashtray/New()
|
||||
..()
|
||||
src.pixel_y = rand(-5, 5)
|
||||
src.pixel_x = rand(-6, 6)
|
||||
return
|
||||
|
||||
/obj/item/ashtray/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if (health < 1)
|
||||
return
|
||||
if (istype(W,/obj/item/weapon/cigbutt) || istype(W,/obj/item/clothing/mask/cigarette) || istype(W, /obj/item/weapon/match))
|
||||
if (contents.len >= max_butts)
|
||||
user << "This ashtray is full."
|
||||
return
|
||||
user.u_equip(W)
|
||||
W.loc = src
|
||||
|
||||
if (istype(W,/obj/item/clothing/mask/cigarette))
|
||||
var/obj/item/clothing/mask/cigarette/cig = W
|
||||
if (cig.lit == 1)
|
||||
src.visible_message("[user] crushes [cig] in [src], putting it out.")
|
||||
processing_objects.Remove(cig)
|
||||
var/obj/item/butt = new cig.type_butt(src)
|
||||
cig.transfer_fingerprints_to(butt)
|
||||
del(cig)
|
||||
else if (cig.lit == 0)
|
||||
user << "You place [cig] in [src] without even smoking it. Why would you do that?"
|
||||
|
||||
src.visible_message("[user] places [W] in [src].")
|
||||
user.update_inv_l_hand()
|
||||
user.update_inv_r_hand()
|
||||
add_fingerprint(user)
|
||||
if (contents.len == max_butts)
|
||||
icon_state = icon_full
|
||||
desc = empty_desc + " It's stuffed full."
|
||||
else if (contents.len > max_butts/2)
|
||||
icon_state = icon_half
|
||||
desc = empty_desc + " It's half-filled."
|
||||
else
|
||||
health = max(0,health - W.force)
|
||||
user << "You hit [src] with [W]."
|
||||
if (health < 1)
|
||||
die()
|
||||
return
|
||||
|
||||
/obj/item/ashtray/throw_impact(atom/hit_atom)
|
||||
if (health > 0)
|
||||
health = max(0,health - 3)
|
||||
if (health < 1)
|
||||
die()
|
||||
return
|
||||
if (contents.len)
|
||||
src.visible_message("\red [src] slams into [hit_atom] spilling its contents!")
|
||||
for (var/obj/item/clothing/mask/cigarette/O in contents)
|
||||
O.loc = src.loc
|
||||
icon_state = icon_empty
|
||||
return ..()
|
||||
|
||||
/obj/item/ashtray/proc/die()
|
||||
src.visible_message("\red [src] shatters spilling its contents!")
|
||||
for (var/obj/item/clothing/mask/cigarette/O in contents)
|
||||
O.loc = src.loc
|
||||
icon_state = icon_broken
|
||||
|
||||
/obj/item/ashtray/plastic
|
||||
name = "plastic ashtray"
|
||||
desc = "Cheap plastic ashtray."
|
||||
icon_state = "ashtray_bl"
|
||||
icon_empty = "ashtray_bl"
|
||||
icon_half = "ashtray_half_bl"
|
||||
icon_full = "ashtray_full_bl"
|
||||
icon_broken = "ashtray_bork_bl"
|
||||
max_butts = 14
|
||||
health = 24.0
|
||||
g_amt = 30
|
||||
m_amt = 30
|
||||
empty_desc = "Cheap plastic ashtray."
|
||||
throwforce = 3.0
|
||||
die()
|
||||
..()
|
||||
name = "pieces of plastic"
|
||||
desc = "Pieces of plastic with ash on them."
|
||||
return
|
||||
|
||||
|
||||
/obj/item/ashtray/bronze
|
||||
name = "bronze ashtray"
|
||||
desc = "Massive bronze ashtray."
|
||||
icon_state = "ashtray_br"
|
||||
icon_empty = "ashtray_br"
|
||||
icon_half = "ashtray_half_br"
|
||||
icon_full = "ashtray_full_br"
|
||||
icon_broken = "ashtray_bork_br"
|
||||
max_butts = 10
|
||||
health = 72.0
|
||||
m_amt = 80
|
||||
empty_desc = "Massive bronze ashtray."
|
||||
throwforce = 10.0
|
||||
|
||||
die()
|
||||
..()
|
||||
name = "pieces of bronze"
|
||||
desc = "Pieces of bronze with ash on them."
|
||||
return
|
||||
|
||||
|
||||
/obj/item/ashtray/glass
|
||||
name = "glass ashtray"
|
||||
desc = "Glass ashtray. Looks fragile."
|
||||
icon_state = "ashtray_gl"
|
||||
icon_empty = "ashtray_gl"
|
||||
icon_half = "ashtray_half_gl"
|
||||
icon_full = "ashtray_full_gl"
|
||||
icon_broken = "ashtray_bork_gl"
|
||||
max_butts = 12
|
||||
health = 12.0
|
||||
g_amt = 60
|
||||
empty_desc = "Glass ashtray. Looks fragile."
|
||||
throwforce = 6.0
|
||||
|
||||
die()
|
||||
..()
|
||||
name = "shards of glass"
|
||||
desc = "Shards of glass with ash on them."
|
||||
playsound(src, "shatter", 30, 1)
|
||||
return
|
||||
@@ -0,0 +1,186 @@
|
||||
/////////////////////////////////////////////
|
||||
//Guest pass ////////////////////////////////
|
||||
/////////////////////////////////////////////
|
||||
/obj/item/weapon/card/id/guest
|
||||
name = "guest pass"
|
||||
desc = "Allows temporary access to station areas."
|
||||
icon_state = "guest"
|
||||
|
||||
var/temp_access = list() //to prevent agent cards stealing access as permanent
|
||||
var/expiration_time = 0
|
||||
var/reason = "NOT SPECIFIED"
|
||||
|
||||
/obj/item/weapon/card/id/guest/GetAccess()
|
||||
if (world.time > expiration_time)
|
||||
return access
|
||||
else
|
||||
return temp_access
|
||||
|
||||
/obj/item/weapon/card/id/guest/examine()
|
||||
..()
|
||||
if (world.time < expiration_time)
|
||||
usr << "\blue This pass expires at [worldtime2text(expiration_time)]."
|
||||
else
|
||||
usr << "\red It expired at [worldtime2text(expiration_time)]."
|
||||
|
||||
/obj/item/weapon/card/id/guest/read()
|
||||
if (world.time > expiration_time)
|
||||
usr << "This pass expired at [worldtime2text(expiration_time)]."
|
||||
else
|
||||
usr << "This pass expires at [worldtime2text(expiration_time)]."
|
||||
|
||||
usr << "It grants access to following areas:"
|
||||
for (var/A in temp_access)
|
||||
usr << "[get_access_desc(A)]."
|
||||
usr << "Issuing reason: [reason]."
|
||||
return
|
||||
|
||||
/////////////////////////////////////////////
|
||||
//Guest pass terminal////////////////////////
|
||||
/////////////////////////////////////////////
|
||||
|
||||
/obj/machinery/computer/guestpass
|
||||
name = "guest pass terminal"
|
||||
icon_state = "guest"
|
||||
density = 0
|
||||
|
||||
|
||||
var/obj/item/weapon/card/id/giver
|
||||
var/list/accesses = list()
|
||||
var/giv_name = "NOT SPECIFIED"
|
||||
var/reason = "NOT SPECIFIED"
|
||||
var/duration = 0
|
||||
|
||||
var/list/internal_log = list()
|
||||
var/mode = 0 // 0 - making pass, 1 - viewing logs
|
||||
|
||||
/obj/machinery/computer/guestpass/New()
|
||||
..()
|
||||
uid = "[rand(100,999)]-G[rand(10,99)]"
|
||||
|
||||
/obj/machinery/computer/guestpass/attackby(obj/O, mob/user)
|
||||
if(istype(O, /obj/item/weapon/card/id))
|
||||
user.drop_item()
|
||||
O.loc = src
|
||||
giver = O
|
||||
updateUsrDialog()
|
||||
|
||||
/obj/machinery/computer/guestpass/attack_ai(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/guestpass/attack_paw(var/mob/user as mob)
|
||||
return attack_hand(user)
|
||||
|
||||
/obj/machinery/computer/guestpass/attack_hand(var/mob/user as mob)
|
||||
if(..())
|
||||
return
|
||||
|
||||
user.set_machine(src)
|
||||
var/dat
|
||||
|
||||
if (mode == 1) //Logs
|
||||
dat += "<h3>Activity log</h3><br>"
|
||||
for (var/entry in internal_log)
|
||||
dat += "[entry]<br><hr>"
|
||||
dat += "<a href='?src=\ref[src];action=print'>Print</a><br>"
|
||||
dat += "<a href='?src=\ref[src];mode=0'>Back</a><br>"
|
||||
else
|
||||
dat += "<h3>Guest pass terminal #[uid]</h3><br>"
|
||||
dat += "<a href='?src=\ref[src];mode=1'>View activity log</a><br><br>"
|
||||
dat += "Issuing ID: <a href='?src=\ref[src];action=id'>[giver]</a><br>"
|
||||
dat += "Issued to: <a href='?src=\ref[src];choice=giv_name'>[giv_name]</a><br>"
|
||||
dat += "Reason: <a href='?src=\ref[src];choice=reason'>[reason]</a><br>"
|
||||
dat += "Duration (minutes): <a href='?src=\ref[src];choice=duration'>[duration] m</a><br>"
|
||||
dat += "Access to areas:<br>"
|
||||
if (giver && giver.access)
|
||||
for (var/A in giver.access)
|
||||
var/area = get_access_desc(A)
|
||||
if (A in accesses)
|
||||
area = "<b>[area]</b>"
|
||||
dat += "<a href='?src=\ref[src];choice=access;access=[A]'>[area]</a><br>"
|
||||
dat += "<br><a href='?src=\ref[src];action=issue'>Issue pass</a><br>"
|
||||
|
||||
user << browse(dat, "window=guestpass;size=400x520")
|
||||
onclose(user, "guestpass")
|
||||
|
||||
|
||||
/obj/machinery/computer/guestpass/Topic(href, href_list)
|
||||
if(..())
|
||||
return
|
||||
usr.set_machine(src)
|
||||
if (href_list["mode"])
|
||||
mode = text2num(href_list["mode"])
|
||||
|
||||
if (href_list["choice"])
|
||||
switch(href_list["choice"])
|
||||
if ("giv_name")
|
||||
var/nam = input("Person pass is issued to", "Name", name)
|
||||
if (nam)
|
||||
giv_name = nam
|
||||
if ("reason")
|
||||
var/reas = input("Reason why pass is issued", "Reason", reason)
|
||||
reason = reas
|
||||
if ("duration")
|
||||
var/dur = input("Duration (in minutes) during which pass is valid.", "Duration") as num
|
||||
if (dur > 0 && dur < 30)
|
||||
duration = dur
|
||||
else
|
||||
usr << "\red Invalid duration."
|
||||
if ("access")
|
||||
var/A = text2num(href_list["access"])
|
||||
if (A in accesses)
|
||||
accesses.Remove(A)
|
||||
else
|
||||
accesses.Add(A)
|
||||
if (href_list["action"])
|
||||
switch(href_list["action"])
|
||||
if ("id")
|
||||
if (giver)
|
||||
if(ishuman(usr))
|
||||
giver.loc = usr.loc
|
||||
if(!usr.get_active_hand())
|
||||
usr.put_in_hands(giver)
|
||||
giver = null
|
||||
else
|
||||
giver.loc = src.loc
|
||||
giver = null
|
||||
else
|
||||
var/obj/item/I = usr.get_active_hand()
|
||||
if (istype(I, /obj/item/weapon/card/id))
|
||||
usr.drop_item()
|
||||
I.loc = src
|
||||
giver = I
|
||||
updateUsrDialog()
|
||||
|
||||
if ("print")
|
||||
var/dat = "<h3>Activity log of guest pass terminal #[uid]</h3><br>"
|
||||
for (var/entry in internal_log)
|
||||
dat += "[entry]<br><hr>"
|
||||
//usr << "Printing the log, standby..."
|
||||
//sleep(50)
|
||||
var/obj/item/weapon/paper/P = new/obj/item/weapon/paper( loc )
|
||||
P.name = "activity log"
|
||||
P.info = dat
|
||||
|
||||
if ("issue")
|
||||
if (giver)
|
||||
var/number = add_zero("[rand(0,9999)]", 4)
|
||||
var/entry = "\[[worldtime2text()]\] Pass #[number] issued by [giver.registered_name] ([giver.assignment]) to [giv_name]. Reason: [reason]. Grants access to following areas: "
|
||||
for (var/i=1 to accesses.len)
|
||||
var/A = accesses[i]
|
||||
if (A)
|
||||
var/area = get_access_desc(A)
|
||||
entry += "[i > 1 ? ", [area]" : "[area]"]"
|
||||
entry += ". Expires at [worldtime2text(world.time + duration*10*60)]."
|
||||
internal_log.Add(entry)
|
||||
|
||||
var/obj/item/weapon/card/id/guest/pass = new(src.loc)
|
||||
pass.temp_access = accesses.Copy()
|
||||
pass.registered_name = giv_name
|
||||
pass.expiration_time = world.time + duration*10*60
|
||||
pass.reason = reason
|
||||
pass.name = "guest pass #[number]"
|
||||
else
|
||||
usr << "\red Cannot issue pass without issuing ID."
|
||||
updateUsrDialog()
|
||||
return
|
||||
Reference in New Issue
Block a user