mirror of
https://github.com/SPLURT-Station/S.P.L.U.R.T-Station-13.git
synced 2025-12-09 16:07:40 +00:00
131 lines
4.5 KiB
Plaintext
131 lines
4.5 KiB
Plaintext
/obj/structure/closet/crate/secure
|
|
desc = "A secure crate."
|
|
name = "secure crate"
|
|
icon_state = "securecrate"
|
|
secure = TRUE
|
|
locked = TRUE
|
|
max_integrity = 500
|
|
armor = list(MELEE = 30, BULLET = 50, LASER = 50, ENERGY = 100, BOMB = 0, BIO = 0, RAD = 0, FIRE = 80, ACID = 80)
|
|
var/tamperproof = 0
|
|
|
|
/obj/structure/closet/crate/secure/run_obj_armor(damage_amount, damage_type, damage_flag = 0, attack_dir)
|
|
if(damage_flag == MELEE && damage_amount < 25)
|
|
return 0
|
|
. = ..()
|
|
|
|
/obj/structure/closet/crate/secure/update_overlays()
|
|
. += ..()
|
|
if(broken)
|
|
. += "securecrateemag"
|
|
else if(locked)
|
|
. += "securecrater"
|
|
else
|
|
. += "securecrateg"
|
|
|
|
/obj/structure/closet/crate/secure/take_damage(damage_amount, damage_type = BRUTE, damage_flag = 0, sound_effect = 1)
|
|
if(prob(tamperproof) && damage_amount >= DAMAGE_PRECISION)
|
|
boom()
|
|
else
|
|
..()
|
|
|
|
|
|
/obj/structure/closet/crate/secure/proc/boom(mob/user)
|
|
if(user)
|
|
to_chat(user, "<span class='danger'>The crate's anti-tamper system activates!</span>")
|
|
var/message = "[ADMIN_LOOKUPFLW(user)] has detonated [src.name]."
|
|
GLOB.bombers += message
|
|
message_admins(message)
|
|
log_game("[key_name(user)] has detonated [src.name].")
|
|
for(var/atom/movable/AM in src)
|
|
qdel(AM)
|
|
explosion(get_turf(src), 0, 1, 5, 5)
|
|
qdel(src)
|
|
|
|
/obj/structure/closet/crate/secure/weapon
|
|
desc = "A secure weapons crate."
|
|
name = "weapons crate"
|
|
icon_state = "weaponcrate"
|
|
|
|
/obj/structure/closet/crate/secure/plasma
|
|
desc = "A secure plasma crate."
|
|
name = "plasma crate"
|
|
icon_state = "plasmacrate"
|
|
|
|
/obj/structure/closet/crate/secure/gear
|
|
desc = "A secure gear crate."
|
|
name = "gear crate"
|
|
icon_state = "secgearcrate"
|
|
|
|
/obj/structure/closet/crate/secure/soviet
|
|
desc = "A crate, purportedly from Space Russia."
|
|
name = "soviet crate"
|
|
icon_state = "sovietcrate"
|
|
|
|
/obj/structure/closet/crate/secure/hydroponics
|
|
desc = "A crate with a lock on it, painted in the scheme of the station's botanists."
|
|
name = "secure hydroponics crate"
|
|
icon_state = "hydrosecurecrate"
|
|
|
|
/obj/structure/closet/crate/secure/engineering
|
|
desc = "A crate with a lock on it, painted in the scheme of the station's engineers."
|
|
name = "secure engineering crate"
|
|
icon_state = "engi_secure_crate"
|
|
|
|
/obj/structure/closet/crate/secure/science
|
|
name = "secure science crate"
|
|
desc = "A crate with a lock on it, painted in the scheme of the station's scientists."
|
|
icon_state = "scisecurecrate"
|
|
|
|
/obj/structure/closet/crate/secure/medical
|
|
desc = "A secure medical crate."
|
|
name = "medical crate"
|
|
icon_state = "medical_secure_crate"
|
|
|
|
/obj/structure/closet/crate/secure/owned
|
|
name = "private crate"
|
|
desc = "A crate cover designed to only open for who purchased its contents."
|
|
icon_state = "privatecrate"
|
|
///Account of the person buying the crate if private purchasing.
|
|
var/datum/bank_account/buyer_account
|
|
///Department of the person buying the crate if buying via the NIRN app.
|
|
var/datum/bank_account/department/department_account
|
|
///Is the secure crate opened or closed?
|
|
var/privacy_lock = TRUE
|
|
///Is the crate being bought by a person, or a budget card?
|
|
var/department_purchase = FALSE
|
|
|
|
/obj/structure/closet/crate/secure/owned/examine(mob/user)
|
|
. = ..()
|
|
. += "<span class='notice'>It's locked with a privacy lock, and can only be unlocked by the buyer's ID.</span>"
|
|
|
|
/obj/structure/closet/crate/secure/owned/Initialize(mapload, datum/bank_account/_buyer_account)
|
|
. = ..()
|
|
buyer_account = _buyer_account
|
|
if(istype(buyer_account, /datum/bank_account/department))
|
|
department_purchase = TRUE
|
|
department_account = buyer_account
|
|
|
|
/obj/structure/closet/crate/secure/owned/togglelock(mob/living/user, silent)
|
|
if(privacy_lock)
|
|
if(!broken)
|
|
var/obj/item/card/id/id_card = user.get_idcard(TRUE)
|
|
if(id_card)
|
|
if(id_card.registered_account)
|
|
if(id_card.registered_account == buyer_account || (department_purchase && (id_card.registered_account?.account_job?.paycheck_department) == (department_account.department_id)))
|
|
if(iscarbon(user))
|
|
add_fingerprint(user)
|
|
locked = !locked
|
|
user.visible_message("<span class='notice'>[user] unlocks [src]'s privacy lock.</span>",
|
|
"<span class='notice'>You unlock [src]'s privacy lock.</span>")
|
|
privacy_lock = FALSE
|
|
update_icon()
|
|
else if(!silent)
|
|
to_chat(user, "<span class='notice'>Bank account does not match with buyer!</span>")
|
|
else if(!silent)
|
|
to_chat(user, "<span class='notice'>No linked bank account detected!</span>")
|
|
else if(!silent)
|
|
to_chat(user, "<span class='notice'>No ID detected!</span>")
|
|
else if(!silent)
|
|
to_chat(user, "<span class='warning'>[src] is broken!</span>")
|
|
else ..()
|