mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-01-01 20:42:08 +00:00
* Starting on the rework * Reworks the Ark * Work on Reebe * More Ark stuff * this too * Removes ark silliness, remaps Reebe a tad * Spawning mechanics * Work on gamemode code * Finishes up ark stuff * Removes Judgement, and lots of other changes * New Ark activation sounds, Ratvar text * Spawn protection! * Adds the abscondence bijou * Bijou stuff * well, this is it * somewhat absentminded coder * Remaps the Reebe z * replica fabricators now work! * Guide paper! * Now they're clockwork floors * Infirmary, tweaks, numbers * A new thing! * this is ok for now * I was gonna whine but it's actually necessary * Adds damage scaling to ocular wardens * I missed a thing * you can go back too * New clockwork armor sprites * Weapons, scripture, oh my! * no! shoo! * hey, I forgot about you! * this looks much better, I'll give you that * no teleporting into the void! * we have no need of you anymore * Conflicteroos * AUTOMATIC SPINNING CHAIRS * how many times do we have to teach you this LESSON OLD MAN * flagged! * last time, meesa promise * Conflicts 1 * wood filling * Kindle is a projectile, and other stuff * Chameleon jumpsuit, some small changes * 150 hours of testing * Curious is the trapmaker's art * Conflicts 1 * naaah * Fixes an ark sound * Removes the prolonging prism * Adds a delay to warping in * First steps towards changing the power system * Removes power from sigils, moves to global * Conflicts 1 * zoom zoom * Adds the stargazer, re-adds conversion * conflicts? more like CLOCK-flicts * get it? clockflicts? * Daemon tuning * Scraps components, 1/? * A grace period, among other things * You can't get to reebe from space no stop bad * Adds some cogscarab shells to Reebe - yes, I get the sounds * FUCK * Chairs are very important. * Clock golems, sound improvement, intercoms * Sounds, floor fixes, conflicts * Fixes the conflicts * Prevents intercom use during non-clock rounds * Wiki, HUD timer, tweaks, golems * Components, removes unused structures, rep. fab power * go-time * Ending the round is not a good idea * whoops, forgot about you * ssh is ok * this works too
154 lines
5.4 KiB
Plaintext
154 lines
5.4 KiB
Plaintext
/obj/item/device/radio/intercom
|
|
name = "station intercom"
|
|
desc = "Talk through this."
|
|
icon_state = "intercom"
|
|
anchored = TRUE
|
|
w_class = WEIGHT_CLASS_BULKY
|
|
canhear_range = 2
|
|
var/number = 0
|
|
var/anyai = 1
|
|
var/mob/living/silicon/ai/ai = list()
|
|
var/last_tick //used to delay the powercheck
|
|
dog_fashion = null
|
|
var/unfastened = FALSE
|
|
|
|
/obj/item/device/radio/intercom/unscrewed
|
|
unfastened = TRUE
|
|
|
|
/obj/item/device/radio/intercom/ratvar
|
|
name = "hierophant intercom"
|
|
desc = "A modified intercom that uses the Hierophant network instead of subspace tech. Can listen to and broadcast on any frequency."
|
|
icon_state = "intercom_ratvar"
|
|
freerange = TRUE
|
|
|
|
/obj/item/device/radio/intercom/ratvar/attackby(obj/item/I, mob/living/user, params)
|
|
if(istype(I, /obj/item/screwdriver))
|
|
to_chat(user, "<span class='danger'>[src] is fastened to the wall with [is_servant_of_ratvar(user) ? "replicant alloy" : "some material you've never seen"], and can't be removed.</span>")
|
|
return //no unfastening!
|
|
. = ..()
|
|
|
|
/obj/item/device/radio/intercom/ratvar/process()
|
|
if(!istype(SSticker.mode, /datum/game_mode/clockwork_cult))
|
|
invisibility = INVISIBILITY_OBSERVER
|
|
alpha = 125
|
|
emped = TRUE
|
|
else
|
|
invisibility = initial(invisibility)
|
|
alpha = initial(alpha)
|
|
emped = FALSE
|
|
..()
|
|
|
|
/obj/item/device/radio/intercom/Initialize(mapload, ndir, building)
|
|
. = ..()
|
|
if(building)
|
|
setDir(ndir)
|
|
START_PROCESSING(SSobj, src)
|
|
|
|
/obj/item/device/radio/intercom/Destroy()
|
|
STOP_PROCESSING(SSobj, src)
|
|
return ..()
|
|
|
|
/obj/item/device/radio/intercom/examine(mob/user)
|
|
..()
|
|
if(!unfastened)
|
|
to_chat(user, "<span class='notice'>It's <b>screwed</b> and secured to the wall.</span>")
|
|
else
|
|
to_chat(user, "<span class='notice'>It's <i>unscrewed</i> from the wall, and can be <b>detached</b>.</span>")
|
|
|
|
/obj/item/device/radio/intercom/attackby(obj/item/I, mob/living/user, params)
|
|
if(istype(I, /obj/item/screwdriver))
|
|
var/obj/item/screwdriver/S = I
|
|
if(unfastened)
|
|
user.visible_message("<span class='notice'>[user] starts tightening [src]'s screws...</span>", "<span class='notice'>You start screwing in [src]...</span>")
|
|
playsound(src, S.usesound, 50, 1)
|
|
if(!do_after(user, 30 * S.toolspeed, target = src))
|
|
return
|
|
user.visible_message("<span class='notice'>[user] tightens [src]'s screws!</span>", "<span class='notice'>You tighten [src]'s screws.</span>")
|
|
playsound(src, 'sound/items/screwdriver2.ogg', 50, 1)
|
|
unfastened = FALSE
|
|
else
|
|
user.visible_message("<span class='notice'>[user] starts loosening [src]'s screws...</span>", "<span class='notice'>You start unscrewing [src]...</span>")
|
|
playsound(src, S.usesound, 50, 1)
|
|
if(!do_after(user, 60 * S.toolspeed, target = src))
|
|
return
|
|
user.visible_message("<span class='notice'>[user] loosens [src]'s screws!</span>", "<span class='notice'>You unscrew [src], loosening it from the wall.</span>")
|
|
playsound(src, 'sound/items/screwdriver2.ogg', 50, 1)
|
|
unfastened = TRUE
|
|
return
|
|
else if(istype(I, /obj/item/wrench))
|
|
if(!unfastened)
|
|
to_chat(user, "<span class='warning'>You need to unscrew [src] from the wall first!</span>")
|
|
return
|
|
var/obj/item/wrench/W = I
|
|
user.visible_message("<span class='notice'>[user] starts unsecuring [src]...</span>", "<span class='notice'>You start unsecuring [src]...</span>")
|
|
playsound(src, W.usesound, 50, 1)
|
|
if(!do_after(user, 80 * W.toolspeed, target = src))
|
|
return
|
|
user.visible_message("<span class='notice'>[user] unsecures [src]!</span>", "<span class='notice'>You detach [src] from the wall.</span>")
|
|
playsound(src, 'sound/items/deconstruct.ogg', 50, 1)
|
|
new/obj/item/wallframe/intercom(get_turf(src))
|
|
qdel(src)
|
|
return
|
|
return ..()
|
|
|
|
/obj/item/device/radio/intercom/attack_ai(mob/user)
|
|
interact(user)
|
|
|
|
/obj/item/device/radio/intercom/attack_hand(mob/user)
|
|
interact(user)
|
|
|
|
/obj/item/device/radio/intercom/interact(mob/user)
|
|
..()
|
|
ui_interact(user, state = GLOB.default_state)
|
|
|
|
/obj/item/device/radio/intercom/receive_range(freq, level)
|
|
if(!on)
|
|
return -1
|
|
if(wires.is_cut(WIRE_RX))
|
|
return -1
|
|
if(!(0 in level))
|
|
var/turf/position = get_turf(src)
|
|
if(isnull(position) || !(position.z in level))
|
|
return -1
|
|
if(!src.listening)
|
|
return -1
|
|
if(freq == GLOB.SYND_FREQ)
|
|
if(!(src.syndie))
|
|
return -1//Prevents broadcast of messages over devices lacking the encryption
|
|
|
|
return canhear_range
|
|
|
|
|
|
/obj/item/device/radio/intercom/Hear(message, atom/movable/speaker, message_langs, raw_message, radio_freq, list/spans, message_mode)
|
|
if(!anyai && !(speaker in ai))
|
|
return
|
|
..()
|
|
|
|
/obj/item/device/radio/intercom/process()
|
|
if(((world.timeofday - last_tick) > 30) || ((world.timeofday - last_tick) < 0))
|
|
last_tick = world.timeofday
|
|
|
|
var/area/A = get_area(src)
|
|
if(!A || emped)
|
|
on = FALSE
|
|
else
|
|
on = A.powered(EQUIP) // set "on" to the power status
|
|
|
|
if(!on)
|
|
icon_state = "intercom-p"
|
|
else
|
|
icon_state = initial(icon_state)
|
|
|
|
/obj/item/device/radio/intercom/add_blood(list/blood_dna)
|
|
return 0
|
|
|
|
//Created through the autolathe or through deconstructing intercoms. Can be applied to wall to make a new intercom on it!
|
|
/obj/item/wallframe/intercom
|
|
name = "intercom frame"
|
|
desc = "A ready-to-go intercom. Just slap it on a wall and screw it in!"
|
|
icon_state = "intercom"
|
|
result_path = /obj/item/device/radio/intercom/unscrewed
|
|
pixel_shift = 29
|
|
inverse = TRUE
|
|
materials = list(MAT_METAL = 75, MAT_GLASS = 25)
|