mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-29 15:08:02 +01:00
Refactors signallers, assemblies, electropacks (#18689)
* Refactors signalers, assemblies, electropacks * Update code/game/objects/items/devices/radio/electropack.dm Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com> Co-authored-by: Sirryan2002 <80364400+Sirryan2002@users.noreply.github.com> Co-authored-by: Charlie <69320440+hal9000PR@users.noreply.github.com>
This commit is contained in:
co-authored by
Sirryan2002
Charlie
parent
98a143afb6
commit
aba452f785
@@ -79128,7 +79128,7 @@
|
||||
/obj/item/stack/sheet/metal{
|
||||
amount = 10
|
||||
},
|
||||
/obj/item/radio/electropack,
|
||||
/obj/item/electropack,
|
||||
/obj/machinery/firealarm{
|
||||
dir = 4;
|
||||
name = "east bump";
|
||||
|
||||
@@ -592,7 +592,7 @@
|
||||
/area/ruin/space/tcommsat)
|
||||
"bW" = (
|
||||
/obj/structure/table,
|
||||
/obj/item/radio/electropack,
|
||||
/obj/item/electropack,
|
||||
/turf/simulated/floor/plating/airless,
|
||||
/area/ruin/space/tcommsat)
|
||||
"bX" = (
|
||||
|
||||
@@ -53090,7 +53090,7 @@
|
||||
/area/toxins/hallway)
|
||||
"cBC" = (
|
||||
/obj/structure/table,
|
||||
/obj/item/radio/electropack,
|
||||
/obj/item/electropack,
|
||||
/obj/item/assembly/signaler,
|
||||
/obj/structure/cable{
|
||||
d1 = 4;
|
||||
|
||||
@@ -3605,7 +3605,7 @@
|
||||
/area/syndicate_mothership)
|
||||
"mq" = (
|
||||
/obj/structure/table,
|
||||
/obj/item/radio/electropack{
|
||||
/obj/item/electropack{
|
||||
pixel_x = -5
|
||||
},
|
||||
/obj/item/assembly/signaler{
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
var/frequency = rand(PUBLIC_LOW_FREQ, PUBLIC_HIGH_FREQ)
|
||||
if(ISMULTIPLE(frequency, 2))//signaller frequencies are always uneven!
|
||||
frequency++
|
||||
aSignal.set_frequency(frequency)
|
||||
aSignal.frequency = frequency
|
||||
|
||||
if(new_lifespan)
|
||||
lifespan = new_lifespan
|
||||
|
||||
@@ -1,43 +1,57 @@
|
||||
/obj/item/radio/electropack
|
||||
/obj/item/electropack
|
||||
name = "electropack"
|
||||
desc = "Dance my monkeys! DANCE!!!"
|
||||
icon = 'icons/obj/radio.dmi'
|
||||
icon_state = "electropack0"
|
||||
item_state = "electropack"
|
||||
frequency = AIRLOCK_FREQ
|
||||
flags = CONDUCT
|
||||
slot_flags = SLOT_BACK
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
materials = list(MAT_METAL=10000, MAT_GLASS=2500)
|
||||
var/code = 2
|
||||
materials = list(MAT_METAL = 10000, MAT_GLASS = 2500)
|
||||
/// The integrated signaler
|
||||
var/obj/item/assembly/signaler/electropack/integrated_signaler
|
||||
|
||||
/obj/item/radio/electropack/attack_hand(mob/user as mob)
|
||||
if(src == user.back)
|
||||
to_chat(user, "<span class='notice'>You need help taking this off!</span>")
|
||||
return 0
|
||||
/obj/item/electropack/Initialize(mapload)
|
||||
. = ..()
|
||||
integrated_signaler = new /obj/item/assembly/signaler/electropack(src, src) // Loc and the integrated one
|
||||
|
||||
/obj/item/radio/electropack/Destroy()
|
||||
if(istype(src.loc, /obj/item/assembly/shock_kit))
|
||||
var/obj/item/assembly/shock_kit/S = src.loc
|
||||
/obj/item/electropack/Destroy()
|
||||
integrated_signaler.owning_pack = null
|
||||
QDEL_NULL(integrated_signaler)
|
||||
|
||||
if(istype(loc, /obj/item/assembly/shock_kit))
|
||||
var/obj/item/assembly/shock_kit/S = loc
|
||||
if(S.part1 == src)
|
||||
S.part1 = null
|
||||
|
||||
else if(S.part2 == src)
|
||||
S.part2 = null
|
||||
|
||||
master = null
|
||||
|
||||
return ..()
|
||||
|
||||
/obj/item/radio/electropack/attackby(obj/item/W as obj, mob/user as mob, params)
|
||||
/obj/item/electropack/attack_hand(mob/user)
|
||||
if(src == user.back)
|
||||
to_chat(user, "<span class='notice'>You need help taking this off!</span>")
|
||||
return FALSE
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/electropack/attack_self(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/item/electropack/attackby(obj/item/W, mob/user, params)
|
||||
..()
|
||||
|
||||
if(istype(W, /obj/item/clothing/head/helmet))
|
||||
if(!b_stat)
|
||||
to_chat(user, "<span class='notice'>[src] is not ready to be attached!</span>")
|
||||
return
|
||||
var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit( user )
|
||||
var/obj/item/assembly/shock_kit/A = new /obj/item/assembly/shock_kit(user)
|
||||
A.icon = 'icons/obj/assemblies.dmi'
|
||||
|
||||
if(!user.unEquip(W))
|
||||
to_chat(user, "<span class='notice'>\the [W] is stuck to your hand, you cannot attach it to \the [src]!</span>")
|
||||
return
|
||||
|
||||
W.loc = A
|
||||
W.master = A
|
||||
A.part1 = W
|
||||
@@ -53,11 +67,12 @@
|
||||
A.flags |= NODROP
|
||||
|
||||
|
||||
/obj/item/radio/electropack/receive_signal(datum/signal/signal)
|
||||
if(!signal || signal.encryption != code)
|
||||
return
|
||||
/obj/item/electropack/proc/handle_shock()
|
||||
if(istype(master, /obj/item/assembly/shock_kit))
|
||||
var/obj/item/assembly/shock_kit/SK = master
|
||||
SK.shock_invoke()
|
||||
|
||||
if(isliving(loc) && on)
|
||||
if(isliving(loc))
|
||||
var/mob/living/M = loc
|
||||
var/turf/T = M.loc
|
||||
if(istype(T, /turf))
|
||||
@@ -67,58 +82,80 @@
|
||||
sleep(50)
|
||||
if(M)
|
||||
M.moved_recently = 0
|
||||
|
||||
to_chat(M, "<span class='danger'>You feel a sharp shock!</span>")
|
||||
do_sparks(3, 1, M)
|
||||
|
||||
M.Weaken(10 SECONDS)
|
||||
|
||||
if(master)
|
||||
master.receive_signal()
|
||||
return
|
||||
|
||||
|
||||
/obj/item/radio/electropack/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
|
||||
// This should honestly just proxy the UI to the internal signaler
|
||||
/obj/item/electropack/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = TRUE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.inventory_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "Electropack", name, 360, 150, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
/obj/item/radio/electropack/ui_data(mob/user)
|
||||
/obj/item/electropack/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["power"] = on
|
||||
data["frequency"] = frequency
|
||||
data["code"] = code
|
||||
data["power"] = integrated_signaler.receiving
|
||||
data["frequency"] = integrated_signaler.frequency
|
||||
data["code"] = integrated_signaler.code
|
||||
data["minFrequency"] = PUBLIC_LOW_FREQ
|
||||
data["maxFrequency"] = PUBLIC_HIGH_FREQ
|
||||
return data
|
||||
|
||||
/obj/item/radio/electropack/ui_act(action, params)
|
||||
/obj/item/electropack/ui_act(action, list/params)
|
||||
if(..())
|
||||
return
|
||||
|
||||
. = TRUE
|
||||
|
||||
switch(action)
|
||||
if("power")
|
||||
on = !on
|
||||
integrated_signaler.receiving = !integrated_signaler.receiving
|
||||
|
||||
if("freq")
|
||||
var/value = params["freq"]
|
||||
if(value)
|
||||
frequency = sanitize_frequency(value)
|
||||
set_frequency(frequency)
|
||||
integrated_signaler.frequency = sanitize_frequency(value)
|
||||
else
|
||||
. = FALSE
|
||||
|
||||
if("code")
|
||||
var/value = text2num(params["code"])
|
||||
if(value)
|
||||
value = round(value)
|
||||
code = clamp(value, 1, 100)
|
||||
integrated_signaler.code = clamp(value, 1, 100)
|
||||
else
|
||||
. = FALSE
|
||||
|
||||
if("reset")
|
||||
if(params["reset"] == "freq")
|
||||
frequency = initial(frequency)
|
||||
integrated_signaler.frequency = initial(integrated_signaler.frequency)
|
||||
else if(params["reset"] == "code")
|
||||
code = initial(code)
|
||||
integrated_signaler.code = initial(integrated_signaler.code)
|
||||
else
|
||||
. = FALSE
|
||||
|
||||
if(.)
|
||||
add_fingerprint(usr)
|
||||
|
||||
// Electropack signaller type
|
||||
/obj/item/assembly/signaler/electropack
|
||||
frequency = AIRLOCK_FREQ
|
||||
code = 2
|
||||
receiving = TRUE
|
||||
|
||||
var/obj/item/electropack/owning_pack
|
||||
|
||||
/obj/item/assembly/signaler/electropack/Initialize(mapload, holding_electropack)
|
||||
. = ..()
|
||||
owning_pack = holding_electropack
|
||||
|
||||
/obj/item/assembly/signaler/electropack/signal_callback()
|
||||
if(owning_pack)
|
||||
owning_pack.handle_shock()
|
||||
|
||||
/obj/item/assembly/signaler/electropack/Destroy()
|
||||
owning_pack = null
|
||||
return ..()
|
||||
|
||||
@@ -181,9 +181,9 @@
|
||||
|
||||
/obj/structure/closet/secure_closet/animal/populate_contents()
|
||||
new /obj/item/assembly/signaler(src)
|
||||
new /obj/item/radio/electropack(src)
|
||||
new /obj/item/radio/electropack(src)
|
||||
new /obj/item/radio/electropack(src)
|
||||
new /obj/item/electropack(src)
|
||||
new /obj/item/electropack(src)
|
||||
new /obj/item/electropack(src)
|
||||
|
||||
|
||||
/obj/structure/closet/secure_closet/chemical
|
||||
|
||||
@@ -40,7 +40,7 @@
|
||||
return FALSE
|
||||
break
|
||||
|
||||
if(rigged && locate(/obj/item/radio/electropack) in src)
|
||||
if(rigged && locate(/obj/item/electropack) in src)
|
||||
if(isliving(usr))
|
||||
var/mob/living/L = usr
|
||||
if(L.electrocute_act(17, src))
|
||||
@@ -105,7 +105,7 @@
|
||||
else
|
||||
to_chat(user, "<span class='warning'>You need atleast 15 wires to rig [src]!</span>")
|
||||
return TRUE
|
||||
if(istype(W, /obj/item/radio/electropack))
|
||||
if(istype(W, /obj/item/electropack))
|
||||
if(rigged)
|
||||
if(!user.drop_item())
|
||||
to_chat(user, "<span class='warning'>[W] seems to be stuck to your hand!</span>")
|
||||
@@ -140,7 +140,7 @@
|
||||
update_icon()
|
||||
return
|
||||
else
|
||||
if(rigged && locate(/obj/item/radio/electropack) in src)
|
||||
if(rigged && locate(/obj/item/electropack) in src)
|
||||
if(isliving(user))
|
||||
var/mob/living/L = user
|
||||
if(L.electrocute_act(17, src))
|
||||
|
||||
@@ -18,9 +18,9 @@
|
||||
if(isnull(part)) //This e-chair was not custom built
|
||||
part = new(src)
|
||||
var/obj/item/clothing/head/helmet/part1 = new(part)
|
||||
var/obj/item/radio/electropack/part2 = new(part)
|
||||
part2.set_frequency(1445)
|
||||
part2.code = 6
|
||||
var/obj/item/electropack/part2 = new(part)
|
||||
part2.integrated_signaler.frequency = 1445
|
||||
part2.integrated_signaler.code = 6
|
||||
part2.master = part
|
||||
part.part1 = part1
|
||||
part.part2 = part2
|
||||
|
||||
@@ -48,9 +48,6 @@
|
||||
/obj/item/assembly/proc/holder_movement() //Called when the holder is moved
|
||||
return
|
||||
|
||||
/obj/item/assembly/proc/describe() // Called by grenades to describe the state of the trigger (time left, etc)
|
||||
return "The trigger assembly looks broken!"
|
||||
|
||||
/obj/item/assembly/interact(mob/user) //Called when attack_self is called
|
||||
return
|
||||
|
||||
|
||||
@@ -4,10 +4,11 @@
|
||||
icon_state = "igniter"
|
||||
materials = list(MAT_METAL=500, MAT_GLASS=50)
|
||||
origin_tech = "magnets=1"
|
||||
var/datum/effect_system/spark_spread/sparks = new /datum/effect_system/spark_spread
|
||||
var/datum/effect_system/spark_spread/sparks
|
||||
|
||||
/obj/item/assembly/igniter/New()
|
||||
..()
|
||||
/obj/item/assembly/igniter/Initialize(mapload)
|
||||
. = ..()
|
||||
sparks = new /datum/effect_system/spark_spread
|
||||
sparks.set_up(2, 0, src)
|
||||
sparks.attach(src)
|
||||
|
||||
@@ -15,32 +16,36 @@
|
||||
QDEL_NULL(sparks)
|
||||
return ..()
|
||||
|
||||
|
||||
/obj/item/assembly/igniter/describe()
|
||||
return "The igniter is [secured ? "secured." : "unsecured."]"
|
||||
/obj/item/assembly/igniter/examine(mob/user)
|
||||
. = ..()
|
||||
. += "The igniter is [secured ? "secured." : "unsecured."]"
|
||||
|
||||
|
||||
/obj/item/assembly/igniter/activate()
|
||||
if(!..())
|
||||
return FALSE//Cooldown check
|
||||
return FALSE //Cooldown check
|
||||
|
||||
var/turf/location = get_turf(loc)
|
||||
if(location)
|
||||
location.hotspot_expose(1000,1000)
|
||||
location.hotspot_expose(1000, 1000)
|
||||
|
||||
sparks.start()
|
||||
|
||||
if(istype(loc, /obj/item/assembly_holder))
|
||||
var/locloc = loc.loc
|
||||
if(istype(locloc, /obj/structure/reagent_dispensers/fueltank))
|
||||
var/obj/structure/reagent_dispensers/fueltank/tank = locloc
|
||||
if(tank)
|
||||
tank.boom(TRUE) // this qdel's `src`
|
||||
|
||||
else if(istype(locloc, /obj/item/reagent_containers/glass/beaker))
|
||||
var/obj/item/reagent_containers/glass/beaker/beakerbomb = locloc
|
||||
if(beakerbomb)
|
||||
beakerbomb.heat_beaker()
|
||||
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/item/assembly/igniter/attack_self(mob/user)
|
||||
activate()
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
@@ -25,12 +25,9 @@
|
||||
fire_location = null
|
||||
return ..()
|
||||
|
||||
/obj/item/assembly/infra/describe()
|
||||
return "The assembly is [secured ? "secure" : "not secure"]. The infrared trigger is [on ? "on" : "off"]."
|
||||
|
||||
/obj/item/assembly/infra/examine(mob/user)
|
||||
. = ..()
|
||||
. += describe()
|
||||
. += "The assembly is [secured ? "secure" : "not secure"]. The infrared trigger is [on ? "on" : "off"]."
|
||||
|
||||
/obj/item/assembly/infra/activate()
|
||||
if(!..())
|
||||
|
||||
@@ -14,32 +14,32 @@
|
||||
. += "It looks like it's armed."
|
||||
|
||||
/obj/item/assembly/mousetrap/activate()
|
||||
if(..())
|
||||
armed = !armed
|
||||
if(!armed)
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/user = usr
|
||||
if((user.getBrainLoss() >= 60 || HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
|
||||
to_chat(user, "Your hand slips, setting off the trigger.")
|
||||
pulse(0)
|
||||
update_icon()
|
||||
if(usr)
|
||||
playsound(usr.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3)
|
||||
if(!..())
|
||||
return
|
||||
|
||||
armed = !armed
|
||||
if(!armed)
|
||||
if(ishuman(usr))
|
||||
var/mob/living/carbon/human/user = usr
|
||||
if((user.getBrainLoss() >= 60 || HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
|
||||
to_chat(user, "Your hand slips, setting off the trigger.")
|
||||
pulse(0)
|
||||
|
||||
update_icon()
|
||||
|
||||
if(usr)
|
||||
playsound(usr.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3)
|
||||
|
||||
/obj/item/assembly/mousetrap/describe()
|
||||
return "The pressure switch is [armed ? "primed" : "safe"]."
|
||||
|
||||
/obj/item/assembly/mousetrap/update_icon_state()
|
||||
if(armed)
|
||||
icon_state = "mousetraparmed"
|
||||
else
|
||||
icon_state = "mousetrap"
|
||||
icon_state = "mousetrap[armed ? "armed": ""]"
|
||||
if(holder)
|
||||
holder.update_icon()
|
||||
|
||||
/obj/item/assembly/mousetrap/proc/triggered(mob/target, type = "feet")
|
||||
if(!armed)
|
||||
return
|
||||
|
||||
var/obj/item/organ/external/affecting = null
|
||||
if(ishuman(target))
|
||||
var/mob/living/carbon/human/H = target
|
||||
@@ -49,22 +49,27 @@
|
||||
update_icon()
|
||||
pulse(FALSE)
|
||||
return FALSE
|
||||
|
||||
switch(type)
|
||||
if("feet")
|
||||
if(!H.shoes)
|
||||
affecting = H.get_organ(pick("l_leg", "r_leg"))
|
||||
H.Weaken(6 SECONDS)
|
||||
|
||||
if("l_hand", "r_hand")
|
||||
if(!H.gloves)
|
||||
affecting = H.get_organ(type)
|
||||
H.Stun(6 SECONDS)
|
||||
|
||||
if(affecting)
|
||||
affecting.receive_damage(1, 0)
|
||||
|
||||
else if(ismouse(target))
|
||||
var/mob/living/simple_animal/mouse/M = target
|
||||
visible_message("<span class='danger'>SPLAT!</span>")
|
||||
M.death()
|
||||
M.splat()
|
||||
|
||||
playsound(loc, 'sound/effects/snap.ogg', 50, 1)
|
||||
layer = MOB_LAYER - 0.2
|
||||
armed = FALSE
|
||||
@@ -79,11 +84,13 @@
|
||||
var/which_hand = "l_hand"
|
||||
if(!user.hand)
|
||||
which_hand = "r_hand"
|
||||
|
||||
triggered(user, which_hand)
|
||||
user.visible_message("<span class='warning'>[user] accidentally sets off [src], breaking [user.p_their()] fingers.</span>", \
|
||||
"<span class='warning'>You accidentally trigger [src]!</span>")
|
||||
user.visible_message("<span class='warning'>[user] accidentally sets off [src], breaking [user.p_their()] fingers.</span>", "<span class='warning'>You accidentally trigger [src]!</span>")
|
||||
return
|
||||
|
||||
to_chat(user, "<span class='notice'>You disarm [src].</span>")
|
||||
|
||||
armed = !armed
|
||||
update_icon()
|
||||
playsound(user.loc, 'sound/weapons/handcuffs.ogg', 30, 1, -3)
|
||||
@@ -94,9 +101,9 @@
|
||||
var/which_hand = "l_hand"
|
||||
if(!user.hand)
|
||||
which_hand = "r_hand"
|
||||
|
||||
triggered(user, which_hand)
|
||||
user.visible_message("<span class='warning'>[user] accidentally sets off [src], breaking [user.p_their()] fingers.</span>", \
|
||||
"<span class='warning'>You accidentally trigger [src]!</span>")
|
||||
user.visible_message("<span class='warning'>[user] accidentally sets off [src], breaking [user.p_their()] fingers.</span>", "<span class='warning'>You accidentally trigger [src]!</span>")
|
||||
return
|
||||
..()
|
||||
|
||||
@@ -106,25 +113,28 @@
|
||||
var/mob/living/carbon/H = AM
|
||||
if(H.m_intent == MOVE_INTENT_RUN)
|
||||
triggered(H)
|
||||
H.visible_message("<span class='warning'>[H] accidentally steps on [src].</span>", \
|
||||
"<span class='warning'>You accidentally step on [src]</span>")
|
||||
H.visible_message("<span class='warning'>[H] accidentally steps on [src].</span>", "<span class='warning'>You accidentally step on [src]</span>")
|
||||
|
||||
else if(ismouse(AM))
|
||||
triggered(AM)
|
||||
|
||||
else if(AM.density) // For mousetrap grenades, set off by anything heavy
|
||||
triggered(AM)
|
||||
|
||||
..()
|
||||
|
||||
/obj/item/assembly/mousetrap/on_found(mob/finder)
|
||||
if(armed)
|
||||
finder.visible_message("<span class='warning'>[finder] accidentally sets off [src], breaking [finder.p_their()] fingers.</span>", \
|
||||
"<span class='warning'>You accidentally trigger [src]!</span>")
|
||||
finder.visible_message("<span class='warning'>[finder] accidentally sets off [src], breaking [finder.p_their()] fingers.</span>", "<span class='warning'>You accidentally trigger [src]!</span>")
|
||||
triggered(finder, finder.hand ? "l_hand" : "r_hand")
|
||||
return TRUE //end the search!
|
||||
|
||||
return FALSE
|
||||
|
||||
/obj/item/assembly/mousetrap/hitby(atom/movable/AM, skipcatch, hitpush, blocked, datum/thrownthing/throwingdatum)
|
||||
if(!armed)
|
||||
return ..()
|
||||
|
||||
visible_message("<span class='warning'>[src] is triggered by [AM].</span>")
|
||||
triggered(null)
|
||||
|
||||
@@ -141,5 +151,5 @@
|
||||
if(usr.stat)
|
||||
return
|
||||
|
||||
layer = TURF_LAYER+0.2
|
||||
layer = TURF_LAYER + 0.2
|
||||
to_chat(usr, "<span class='notice'>You hide [src].</span>")
|
||||
|
||||
@@ -17,10 +17,12 @@
|
||||
. = ..()
|
||||
AddComponent(/datum/component/proximity_monitor, _always_active = TRUE)
|
||||
|
||||
/obj/item/assembly/prox_sensor/describe()
|
||||
/obj/item/assembly/prox_sensor/examine(mob/user)
|
||||
. = ..()
|
||||
if(timing)
|
||||
return "<span class='notice'>The proximity sensor is arming.</span>"
|
||||
return "The proximity sensor is [scanning ? "armed" : "disarmed"]."
|
||||
. += "<span class='notice'>The proximity sensor is arming.</span>"
|
||||
else
|
||||
. += "The proximity sensor is [scanning ? "armed" : "disarmed"]."
|
||||
|
||||
/obj/item/assembly/prox_sensor/activate()
|
||||
if(!..())
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
icon = 'icons/obj/assemblies.dmi'
|
||||
icon_state = "shock_kit"
|
||||
var/obj/item/clothing/head/helmet/part1 = null
|
||||
var/obj/item/radio/electropack/part2 = null
|
||||
var/obj/item/electropack/part2 = null
|
||||
var/status = FALSE
|
||||
w_class = WEIGHT_CLASS_HUGE
|
||||
flags = CONDUCT
|
||||
@@ -39,8 +39,7 @@
|
||||
add_fingerprint(user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/shock_kit/receive_signal()
|
||||
/obj/item/assembly/shock_kit/proc/shock_invoke()
|
||||
if(istype(loc, /obj/structure/chair/e_chair))
|
||||
var/obj/structure/chair/e_chair/C = loc
|
||||
C.shock()
|
||||
return
|
||||
|
||||
@@ -1,3 +1,5 @@
|
||||
GLOBAL_LIST_EMPTY(remote_signalers)
|
||||
|
||||
/obj/item/assembly/signaler
|
||||
name = "remote signaling device"
|
||||
desc = "Used to remotely activate devices."
|
||||
@@ -6,147 +8,92 @@
|
||||
materials = list(MAT_METAL=400, MAT_GLASS=120)
|
||||
origin_tech = "magnets=1;bluespace=1"
|
||||
wires = WIRE_RECEIVE | WIRE_PULSE | WIRE_RADIO_PULSE | WIRE_RADIO_RECEIVE
|
||||
|
||||
secured = TRUE
|
||||
var/receiving = FALSE
|
||||
|
||||
bomb_name = "remote-control bomb"
|
||||
|
||||
/// Are we set to receieve a signal?
|
||||
var/receiving = FALSE
|
||||
/// Signal code
|
||||
var/code = 30
|
||||
/// Signal freqency itself
|
||||
var/frequency = RSD_FREQ
|
||||
var/delay = 0
|
||||
var/datum/radio_frequency/radio_connection
|
||||
var/airlock_wire = null
|
||||
|
||||
/obj/item/assembly/signaler/New()
|
||||
..()
|
||||
if(SSradio)
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/item/assembly/signaler/Initialize()
|
||||
..()
|
||||
if(SSradio)
|
||||
set_frequency(frequency)
|
||||
. = ..()
|
||||
GLOB.remote_signalers |= src
|
||||
|
||||
/obj/item/assembly/signaler/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
GLOB.remote_signalers -= src
|
||||
return ..()
|
||||
|
||||
/obj/item/assembly/signaler/describe()
|
||||
return "[src]'s power light is [receiving ? "on" : "off"]"
|
||||
/obj/item/assembly/signaler/examine(mob/user)
|
||||
. = ..()
|
||||
. += "The power light is [receiving ? "on" : "off"]"
|
||||
|
||||
/// Called from activate(), actually invokes the signal on other signallers in the world
|
||||
/obj/item/assembly/signaler/proc/signal()
|
||||
for(var/obj/item/assembly/signaler/S as anything in GLOB.remote_signalers)
|
||||
if(S == src)
|
||||
continue
|
||||
if(S.receiving && (S.code == code) && (S.frequency == frequency))
|
||||
S.signal_callback()
|
||||
|
||||
var/turf/T = get_turf(src)
|
||||
GLOB.lastsignalers.Add("[SQLtime()] <B>:</B> [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) <B>:</B> [format_frequency(frequency)]/[code]")
|
||||
|
||||
/obj/item/assembly/signaler/proc/signal_callback()
|
||||
pulse(1)
|
||||
visible_message("[bicon(src)] *beep* *beep*")
|
||||
|
||||
// Activation pre-runner, handles cooldown and calls signal(), invoked from ui_act()
|
||||
/obj/item/assembly/signaler/activate()
|
||||
if(cooldown > 0)
|
||||
return FALSE
|
||||
return
|
||||
|
||||
cooldown = 2
|
||||
addtimer(CALLBACK(src, .proc/process_cooldown), 10)
|
||||
addtimer(CALLBACK(src, .proc/process_cooldown), 1 SECONDS)
|
||||
|
||||
signal()
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/signaler/update_icon_state()
|
||||
if(holder)
|
||||
holder.update_icon()
|
||||
|
||||
/obj/item/assembly/signaler/interact(mob/user, flag1)
|
||||
var/t1 = "-------"
|
||||
var/dat = {"
|
||||
<TT>
|
||||
"}
|
||||
if(!flag1)
|
||||
dat += {"
|
||||
<A href='byond://?src=[UID()];send=1'>Send Signal</A><BR>
|
||||
Receiver is <A href='byond://?src=[UID()];receive=1'>[receiving?"on":"off"]</A><BR>
|
||||
"}
|
||||
dat += {"
|
||||
<B>Frequency/Code</B> for signaler:<BR>
|
||||
Frequency:
|
||||
<A href='byond://?src=[UID()];freq=-10'>-</A>
|
||||
<A href='byond://?src=[UID()];freq=-2'>-</A>
|
||||
[format_frequency(frequency)]
|
||||
<A href='byond://?src=[UID()];freq=2'>+</A>
|
||||
<A href='byond://?src=[UID()];freq=10'>+</A><BR>
|
||||
// UI STUFF //
|
||||
|
||||
Code:
|
||||
<A href='byond://?src=[UID()];code=-5'>-</A>
|
||||
<A href='byond://?src=[UID()];code=-1'>-</A>
|
||||
[code]
|
||||
<A href='byond://?src=[UID()];code=1'>+</A>
|
||||
<A href='byond://?src=[UID()];code=5'>+</A><BR>
|
||||
[t1]
|
||||
</TT>
|
||||
"}
|
||||
var/datum/browser/popup = new(user, "radio", name, 400, 400)
|
||||
popup.set_content(dat)
|
||||
popup.open(0)
|
||||
onclose(user, "radio")
|
||||
/obj/item/assembly/signaler/attack_self(mob/user)
|
||||
ui_interact(user)
|
||||
|
||||
/obj/item/assembly/signaler/Topic(href, href_list)
|
||||
..()
|
||||
/obj/item/assembly/signaler/ui_interact(mob/user, ui_key = "main", datum/tgui/ui = null, force_open = FALSE, datum/tgui/master_ui = null, datum/ui_state/state = GLOB.deep_inventory_state)
|
||||
ui = SStgui.try_update_ui(user, src, ui_key, ui, force_open)
|
||||
if(!ui)
|
||||
ui = new(user, src, ui_key, "RemoteSignaler", name, 300, 200, master_ui, state)
|
||||
ui.open()
|
||||
|
||||
if(HAS_TRAIT(usr, TRAIT_HANDS_BLOCKED)|| usr.stat || usr.restrained() || !in_range(loc, usr))
|
||||
usr << browse(null, "window=radio")
|
||||
onclose(usr, "radio")
|
||||
/obj/item/assembly/signaler/ui_data(mob/user)
|
||||
var/list/data = list()
|
||||
data["on"] = receiving
|
||||
data["frequency"] = frequency
|
||||
data["code"] = code
|
||||
data["minFrequency"] = PUBLIC_LOW_FREQ
|
||||
data["maxFrequency"] = PUBLIC_HIGH_FREQ
|
||||
return data
|
||||
|
||||
/obj/item/assembly/signaler/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
||||
if(..())
|
||||
return
|
||||
|
||||
if(href_list["freq"])
|
||||
var/new_frequency = (frequency + text2num(href_list["freq"]))
|
||||
if(new_frequency < RADIO_LOW_FREQ || new_frequency > RADIO_HIGH_FREQ)
|
||||
new_frequency = sanitize_frequency(new_frequency, RADIO_LOW_FREQ, RADIO_HIGH_FREQ)
|
||||
set_frequency(new_frequency)
|
||||
. = TRUE
|
||||
|
||||
if(href_list["code"])
|
||||
code += text2num(href_list["code"])
|
||||
code = round(code)
|
||||
code = min(100, code)
|
||||
code = max(1, code)
|
||||
if(href_list["receive"])
|
||||
receiving = !receiving
|
||||
switch(action)
|
||||
if("recv_power")
|
||||
receiving = !receiving
|
||||
|
||||
if(href_list["send"])
|
||||
spawn( 0 )
|
||||
signal()
|
||||
if("signal")
|
||||
activate()
|
||||
|
||||
if(usr)
|
||||
attack_self(usr)
|
||||
if("freq")
|
||||
frequency = sanitize_frequency(text2num(params["freq"]) * 10)
|
||||
|
||||
/obj/item/assembly/signaler/proc/signal()
|
||||
if(!radio_connection)
|
||||
return
|
||||
if("code")
|
||||
code = clamp(text2num(params["code"]), 1, 100)
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.source = src
|
||||
signal.encryption = code
|
||||
signal.data["message"] = "ACTIVATE"
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
var/turf/T = get_turf(src)
|
||||
if(usr)
|
||||
GLOB.lastsignalers.Add("[time] <B>:</B> [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) <B>:</B> [format_frequency(frequency)]/[code]")
|
||||
|
||||
/obj/item/assembly/signaler/receive_signal(datum/signal/signal)
|
||||
if(!receiving || !signal)
|
||||
return FALSE
|
||||
|
||||
if(signal.encryption != code)
|
||||
return FALSE
|
||||
|
||||
if(!(wires & WIRE_RADIO_RECEIVE))
|
||||
return FALSE
|
||||
pulse(1)
|
||||
|
||||
for(var/mob/O in hearers(1, loc))
|
||||
O.show_message("[bicon(src)] *beep* *beep*", 3, "*beep* *beep*", 2)
|
||||
return TRUE
|
||||
|
||||
/obj/item/assembly/signaler/proc/set_frequency(new_frequency)
|
||||
if(!SSradio)
|
||||
sleep(20)
|
||||
if(!SSradio)
|
||||
return
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency, RADIO_CHAT)
|
||||
|
||||
@@ -14,10 +14,12 @@
|
||||
var/repeat = FALSE
|
||||
var/set_time = 10
|
||||
|
||||
/obj/item/assembly/timer/describe()
|
||||
/obj/item/assembly/timer/examine(mob/user)
|
||||
. = ..()
|
||||
if(timing)
|
||||
return "The timer is counting down from [time]!"
|
||||
return "The timer is set for [time] seconds."
|
||||
. += "The timer is counting down from [time]!"
|
||||
else
|
||||
. += "The timer is set for [time] seconds."
|
||||
|
||||
/obj/item/assembly/timer/activate()
|
||||
if(!..())
|
||||
|
||||
@@ -10,11 +10,12 @@
|
||||
|
||||
bomb_name = "voice-activated bomb"
|
||||
|
||||
/obj/item/assembly/voice/describe()
|
||||
/obj/item/assembly/voice/examine(mob/user)
|
||||
. = ..()
|
||||
if(recorded || listening)
|
||||
return "A meter on [src] flickers with every nearby sound."
|
||||
. += "A meter on it flickers with every nearby sound."
|
||||
else
|
||||
return "[src] is deactivated."
|
||||
. += "It is is deactivated."
|
||||
|
||||
/obj/item/assembly/voice/hear_talk(mob/living/M as mob, list/message_pieces)
|
||||
hear_input(M, multilingual_to_message(message_pieces), 0)
|
||||
@@ -25,12 +26,14 @@
|
||||
/obj/item/assembly/voice/proc/hear_input(mob/living/M as mob, msg, type)
|
||||
if(!istype(M,/mob/living))
|
||||
return
|
||||
|
||||
if(listening)
|
||||
recorded = msg
|
||||
recorded_type = type
|
||||
listening = FALSE
|
||||
var/turf/T = get_turf(src) //otherwise it won't work in hand
|
||||
T.visible_message("[bicon(src)] beeps, \"Activation message is [type ? "the sound when one [recorded]" : "'[recorded]'."]\"")
|
||||
|
||||
else if(findtext(msg, recorded) && type == recorded_type)
|
||||
var/turf/T = get_turf(src) //otherwise it won't work in hand
|
||||
T.visible_message("<span class='warning'>[bicon(src)] beeps!</span>")
|
||||
@@ -65,8 +68,9 @@
|
||||
/obj/item/assembly/voice/noise/attack_self(mob/user)
|
||||
return
|
||||
|
||||
/obj/item/assembly/voice/noise/describe()
|
||||
return "[src] does not appear to have any controls."
|
||||
/obj/item/assembly/voice/noise/examine(mob/user)
|
||||
. = ..()
|
||||
. += "It does not appear to have any controls."
|
||||
|
||||
/obj/item/assembly/voice/noise/hear_talk(mob/living/M as mob, list/message_pieces)
|
||||
return
|
||||
|
||||
@@ -65,7 +65,8 @@
|
||||
/// List of all installed software
|
||||
var/list/datum/pai_software/installed_software = list()
|
||||
|
||||
var/obj/item/integrated_radio/signal/sradio // AI's signaller
|
||||
/// Integrated remote signaler for signalling
|
||||
var/obj/item/assembly/signaler/integ_signaler
|
||||
|
||||
var/translator_on = FALSE // keeps track of the translator module
|
||||
var/flashlight_on = FALSE //keeps track of the flashlight module
|
||||
@@ -74,23 +75,27 @@
|
||||
var/custom_sprite = FALSE
|
||||
var/slowdown = 0
|
||||
|
||||
/mob/living/silicon/pai/New(obj/item/paicard)
|
||||
loc = paicard
|
||||
card = paicard
|
||||
/mob/living/silicon/pai/Initialize(mapload)
|
||||
. = ..()
|
||||
|
||||
if(istype(loc, /obj/item/paicard))
|
||||
card = loc
|
||||
|
||||
if(card)
|
||||
faction = card.faction.Copy()
|
||||
sradio = new(src)
|
||||
|
||||
integ_signaler = new(src)
|
||||
|
||||
if(card)
|
||||
if(!card.radio)
|
||||
card.radio = new /obj/item/radio(card)
|
||||
radio = card.radio
|
||||
|
||||
//Default languages without universal translator software
|
||||
add_language("Galactic Common", 1)
|
||||
add_language("Sol Common", 1)
|
||||
add_language("Tradeband", 1)
|
||||
add_language("Gutter", 1)
|
||||
add_language("Trinary", 1)
|
||||
add_language("Sol Common")
|
||||
add_language("Tradeband")
|
||||
add_language("Gutter")
|
||||
add_language("Trinary")
|
||||
|
||||
//Verbs for pAI mobile form, chassis and Say flavor text
|
||||
verbs += /mob/living/silicon/pai/proc/choose_chassis
|
||||
@@ -111,7 +116,6 @@
|
||||
installed_software[PSD.id] = PSD
|
||||
|
||||
active_software = installed_software["mainmenu"] // Default us to the main menu
|
||||
..()
|
||||
|
||||
/mob/living/silicon/pai/can_unbuckle()
|
||||
return FALSE
|
||||
@@ -177,11 +181,12 @@
|
||||
M.show_message("<span class='warning'>A shower of sparks spray from [src]'s inner workings.</span>", 3, "<span class='warning'>You hear and smell the ozone hiss of electrical sparks being expelled violently.</span>", 2)
|
||||
return death(0)
|
||||
|
||||
switch(pick(1,2,3))
|
||||
switch(pick(1, 2, 3))
|
||||
if(1)
|
||||
master = null
|
||||
master_dna = null
|
||||
to_chat(src, "<font color=green>You feel unbound.</font>")
|
||||
|
||||
if(2)
|
||||
var/command
|
||||
if(severity == 1)
|
||||
@@ -190,6 +195,7 @@
|
||||
command = pick("Serve", "Kill", "Love", "Hate", "Disobey", "Devour", "Fool", "Enrage", "Entice", "Observe", "Judge", "Respect", "Disrespect", "Consume", "Educate", "Destroy", "Disgrace", "Amuse", "Entertain", "Ignite", "Glorify", "Memorialize", "Analyze")
|
||||
pai_law0 = "[command] your master."
|
||||
to_chat(src, "<font color=green>Pr1m3 d1r3c71v3 uPd473D.</font>")
|
||||
|
||||
if(3)
|
||||
to_chat(src, "<font color=green>You feel an electric surge run through your circuitry and become acutely aware at how lucky you are that you can still feel at all.</font>")
|
||||
|
||||
@@ -198,20 +204,17 @@
|
||||
|
||||
switch(severity)
|
||||
if(1.0)
|
||||
if(stat != 2)
|
||||
if(stat != DEAD)
|
||||
adjustBruteLoss(100)
|
||||
adjustFireLoss(100)
|
||||
if(2.0)
|
||||
if(stat != 2)
|
||||
if(stat != DEAD)
|
||||
adjustBruteLoss(60)
|
||||
adjustFireLoss(60)
|
||||
if(3.0)
|
||||
if(stat != 2)
|
||||
if(stat != DEAD)
|
||||
adjustBruteLoss(30)
|
||||
|
||||
return
|
||||
|
||||
|
||||
// See software.dm for ui_act()
|
||||
|
||||
/mob/living/silicon/pai/attack_animal(mob/living/simple_animal/M)
|
||||
|
||||
@@ -257,8 +257,8 @@
|
||||
/datum/pai_software/signaler/get_app_data(mob/living/silicon/pai/user)
|
||||
var/list/data = list()
|
||||
|
||||
data["frequency"] = user.sradio.frequency
|
||||
data["code"] = user.sradio.code
|
||||
data["frequency"] = user.integ_signaler.frequency
|
||||
data["code"] = user.integ_signaler.code
|
||||
data["minFrequency"] = PUBLIC_LOW_FREQ
|
||||
data["maxFrequency"] = PUBLIC_HIGH_FREQ
|
||||
|
||||
@@ -270,14 +270,14 @@
|
||||
|
||||
switch(action)
|
||||
if("signal")
|
||||
pai_holder.sradio.send_signal("ACTIVATE")
|
||||
|
||||
pai_holder.integ_signaler.activate()
|
||||
|
||||
if("freq")
|
||||
var/new_frequency = sanitize_frequency(text2num(params["freq"]) * 10)
|
||||
pai_holder.sradio.set_frequency(new_frequency)
|
||||
pai_holder.integ_signaler.frequency = sanitize_frequency(text2num(params["freq"]) * 10)
|
||||
|
||||
if("code")
|
||||
pai_holder.sradio.code = clamp(text2num(params["code"]), 1, 100)
|
||||
pai_holder.integ_signaler.code = clamp(text2num(params["code"]), 1, 100)
|
||||
|
||||
// Door Jack //
|
||||
/datum/pai_software/door_jack
|
||||
|
||||
+118
-108
@@ -6,6 +6,9 @@
|
||||
item_state = "electronic"
|
||||
w_class = WEIGHT_CLASS_TINY
|
||||
|
||||
/// Integrated signaler for captain, science & generic signaler cartridge
|
||||
var/obj/item/assembly/signaler/integ_signaler
|
||||
|
||||
var/obj/item/integrated_radio/radio = null
|
||||
|
||||
var/charges = 0
|
||||
@@ -24,6 +27,7 @@
|
||||
for(var/A in programs)
|
||||
var/datum/data/pda/P = A
|
||||
P.pda = pda
|
||||
|
||||
for(var/A in messenger_plugins)
|
||||
var/datum/data/pda/messenger_plugin/P = A
|
||||
P.pda = pda
|
||||
@@ -32,32 +36,39 @@
|
||||
name = "Power-ON Cartridge"
|
||||
icon_state = "cart-e"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/power,
|
||||
new/datum/data/pda/utility/scanmode/halogen)
|
||||
new /datum/data/pda/app/power,
|
||||
new /datum/data/pda/utility/scanmode/halogen
|
||||
)
|
||||
|
||||
/obj/item/cartridge/atmos
|
||||
name = "BreatheDeep Cartridge"
|
||||
icon_state = "cart-a"
|
||||
programs = list(new/datum/data/pda/utility/scanmode/gas)
|
||||
programs = list(
|
||||
new /datum/data/pda/utility/scanmode/gas
|
||||
)
|
||||
|
||||
/obj/item/cartridge/medical
|
||||
name = "Med-U Cartridge"
|
||||
icon_state = "cart-m"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/crew_records/medical,
|
||||
new/datum/data/pda/utility/scanmode/medical)
|
||||
new /datum/data/pda/app/crew_records/medical,
|
||||
new /datum/data/pda/utility/scanmode/medical
|
||||
)
|
||||
|
||||
/obj/item/cartridge/chemistry
|
||||
name = "ChemWhiz Cartridge"
|
||||
icon_state = "cart-chem"
|
||||
programs = list(new/datum/data/pda/utility/scanmode/reagent)
|
||||
programs = list(
|
||||
new /datum/data/pda/utility/scanmode/reagent
|
||||
)
|
||||
|
||||
/obj/item/cartridge/security
|
||||
name = "R.O.B.U.S.T. Cartridge"
|
||||
icon_state = "cart-s"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/crew_records/security,
|
||||
new/datum/data/pda/app/secbot_control)
|
||||
new /datum/data/pda/app/crew_records/security,
|
||||
new /datum/data/pda/app/secbot_control
|
||||
)
|
||||
|
||||
/obj/item/cartridge/security/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -67,70 +78,75 @@
|
||||
name = "D.E.T.E.C.T. Cartridge"
|
||||
icon_state = "cart-s"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/crew_records/medical,
|
||||
new/datum/data/pda/utility/scanmode/medical,
|
||||
|
||||
new/datum/data/pda/app/crew_records/security)
|
||||
new /datum/data/pda/app/crew_records/medical,
|
||||
new /datum/data/pda/utility/scanmode/medical,
|
||||
new /datum/data/pda/app/crew_records/security
|
||||
)
|
||||
|
||||
|
||||
/obj/item/cartridge/janitor
|
||||
name = "CustodiPRO Cartridge"
|
||||
desc = "The ultimate in clean-room design."
|
||||
icon_state = "cart-j"
|
||||
programs = list(new/datum/data/pda/app/janitor)
|
||||
programs = list(
|
||||
new /datum/data/pda/app/janitor
|
||||
)
|
||||
|
||||
/obj/item/cartridge/lawyer
|
||||
name = "P.R.O.V.E. Cartridge"
|
||||
icon_state = "cart-s"
|
||||
programs = list(new/datum/data/pda/app/crew_records/security)
|
||||
programs = list(
|
||||
new /datum/data/pda/app/crew_records/security
|
||||
)
|
||||
|
||||
/obj/item/cartridge/clown
|
||||
name = "Honkworks 5.0"
|
||||
icon_state = "cart-clown"
|
||||
charges = 5
|
||||
programs = list(new/datum/data/pda/utility/honk)
|
||||
messenger_plugins = list(new/datum/data/pda/messenger_plugin/virus/clown)
|
||||
programs = list(
|
||||
new /datum/data/pda/utility/honk
|
||||
)
|
||||
messenger_plugins = list(
|
||||
new /datum/data/pda/messenger_plugin/virus/clown
|
||||
)
|
||||
|
||||
/obj/item/cartridge/mime
|
||||
name = "Gestur-O 1000"
|
||||
icon_state = "cart-mi"
|
||||
charges = 5
|
||||
messenger_plugins = list(new/datum/data/pda/messenger_plugin/virus/mime)
|
||||
|
||||
/*
|
||||
/obj/item/cartridge/botanist
|
||||
name = "Green Thumb v4.20"
|
||||
icon_state = "cart-b"
|
||||
access_flora = 1
|
||||
*/
|
||||
messenger_plugins = list(
|
||||
new /datum/data/pda/messenger_plugin/virus/mime
|
||||
)
|
||||
|
||||
/obj/item/cartridge/signal
|
||||
name = "generic signaler cartridge"
|
||||
desc = "A data cartridge with an integrated radio signaler module."
|
||||
programs = list(new/datum/data/pda/app/signaller)
|
||||
programs = list(
|
||||
new /datum/data/pda/app/signaller
|
||||
)
|
||||
|
||||
/obj/item/cartridge/signal/Initialize(mapload)
|
||||
. = ..()
|
||||
radio = new /obj/item/integrated_radio/signal(src)
|
||||
integ_signaler = new /obj/item/assembly/signaler(src)
|
||||
|
||||
/obj/item/cartridge/signal/toxins
|
||||
name = "Signal Ace 2"
|
||||
desc = "Complete with integrated radio signaler!"
|
||||
icon_state = "cart-tox"
|
||||
programs = list(
|
||||
new/datum/data/pda/utility/scanmode/gas,
|
||||
|
||||
new/datum/data/pda/utility/scanmode/reagent,
|
||||
|
||||
new/datum/data/pda/app/signaller)
|
||||
new /datum/data/pda/utility/scanmode/gas,
|
||||
new /datum/data/pda/utility/scanmode/reagent,
|
||||
new /datum/data/pda/app/signaller
|
||||
)
|
||||
|
||||
/obj/item/cartridge/quartermaster
|
||||
name = "Space Parts & Space Vendors Cartridge"
|
||||
desc = "Perfect for the Quartermaster on the go!"
|
||||
icon_state = "cart-q"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/supply,
|
||||
new/datum/data/pda/app/mule_control)
|
||||
new /datum/data/pda/app/supply,
|
||||
new /datum/data/pda/app/mule_control
|
||||
)
|
||||
|
||||
/obj/item/cartridge/quartermaster/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -139,20 +155,20 @@
|
||||
/obj/item/cartridge/head
|
||||
name = "Easy-Record DELUXE"
|
||||
icon_state = "cart-h"
|
||||
programs = list(new/datum/data/pda/app/status_display)
|
||||
programs = list(
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/hop
|
||||
name = "HumanResources9001"
|
||||
icon_state = "cart-h"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/crew_records/security,
|
||||
|
||||
new/datum/data/pda/app/janitor,
|
||||
|
||||
new/datum/data/pda/app/supply,
|
||||
new/datum/data/pda/app/mule_control,
|
||||
|
||||
new/datum/data/pda/app/status_display)
|
||||
new /datum/data/pda/app/crew_records/security,
|
||||
new /datum/data/pda/app/janitor,
|
||||
new /datum/data/pda/app/supply,
|
||||
new /datum/data/pda/app/mule_control,
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/hop/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -162,10 +178,10 @@
|
||||
name = "R.O.B.U.S.T. DELUXE"
|
||||
icon_state = "cart-hos"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/crew_records/security,
|
||||
new/datum/data/pda/app/secbot_control,
|
||||
|
||||
new/datum/data/pda/app/status_display)
|
||||
new /datum/data/pda/app/crew_records/security,
|
||||
new /datum/data/pda/app/secbot_control,
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/hos/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -175,99 +191,85 @@
|
||||
name = "Power-On DELUXE"
|
||||
icon_state = "cart-ce"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/power,
|
||||
new/datum/data/pda/utility/scanmode/halogen,
|
||||
|
||||
new/datum/data/pda/utility/scanmode/gas,
|
||||
|
||||
new/datum/data/pda/app/status_display)
|
||||
new /datum/data/pda/app/power,
|
||||
new /datum/data/pda/utility/scanmode/halogen,
|
||||
new /datum/data/pda/utility/scanmode/gas,
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/cmo
|
||||
name = "Med-U DELUXE"
|
||||
icon_state = "cart-cmo"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/crew_records/medical,
|
||||
new/datum/data/pda/utility/scanmode/medical,
|
||||
|
||||
new/datum/data/pda/utility/scanmode/reagent,
|
||||
|
||||
new/datum/data/pda/app/status_display)
|
||||
new /datum/data/pda/app/crew_records/medical,
|
||||
new /datum/data/pda/utility/scanmode/medical,
|
||||
new /datum/data/pda/utility/scanmode/reagent,
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/rd
|
||||
name = "Signal Ace DELUXE"
|
||||
icon_state = "cart-rd"
|
||||
programs = list(
|
||||
new/datum/data/pda/utility/scanmode/gas,
|
||||
|
||||
new/datum/data/pda/utility/scanmode/reagent,
|
||||
|
||||
new/datum/data/pda/app/signaller,
|
||||
|
||||
new/datum/data/pda/app/status_display)
|
||||
new /datum/data/pda/utility/scanmode/gas,
|
||||
new /datum/data/pda/utility/scanmode/reagent,
|
||||
new /datum/data/pda/app/signaller,
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/rd/Initialize(mapload)
|
||||
. = ..()
|
||||
radio = new /obj/item/integrated_radio/signal(src)
|
||||
integ_signaler = new /obj/item/assembly/signaler(src)
|
||||
|
||||
/obj/item/cartridge/captain
|
||||
name = "Value-PAK Cartridge"
|
||||
desc = "Now with 200% more value!"
|
||||
icon_state = "cart-c"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/power,
|
||||
new/datum/data/pda/utility/scanmode/halogen,
|
||||
|
||||
new/datum/data/pda/utility/scanmode/gas,
|
||||
|
||||
new/datum/data/pda/app/crew_records/medical,
|
||||
new/datum/data/pda/utility/scanmode/medical,
|
||||
|
||||
new/datum/data/pda/utility/scanmode/reagent,
|
||||
|
||||
new/datum/data/pda/app/crew_records/security,
|
||||
new/datum/data/pda/app/secbot_control,
|
||||
|
||||
new/datum/data/pda/app/janitor,
|
||||
|
||||
new/datum/data/pda/app/supply,
|
||||
|
||||
new/datum/data/pda/app/status_display)
|
||||
new /datum/data/pda/app/power,
|
||||
new /datum/data/pda/utility/scanmode/halogen,
|
||||
new /datum/data/pda/utility/scanmode/gas,
|
||||
new /datum/data/pda/app/crew_records/medical,
|
||||
new /datum/data/pda/utility/scanmode/medical,
|
||||
new /datum/data/pda/utility/scanmode/reagent,
|
||||
new /datum/data/pda/app/crew_records/security,
|
||||
new /datum/data/pda/app/secbot_control,
|
||||
new /datum/data/pda/app/janitor,
|
||||
new /datum/data/pda/app/supply,
|
||||
new /datum/data/pda/app/status_display,
|
||||
new /datum/data/pda/app/signaller
|
||||
)
|
||||
|
||||
/obj/item/cartridge/captain/Initialize(mapload)
|
||||
. = ..()
|
||||
radio = new /obj/item/integrated_radio/beepsky(src)
|
||||
integ_signaler = new /obj/item/assembly/signaler(src)
|
||||
|
||||
/obj/item/cartridge/supervisor
|
||||
name = "Easy-Record DELUXE"
|
||||
icon_state = "cart-h"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/crew_records/security,
|
||||
|
||||
new/datum/data/pda/app/status_display)
|
||||
new /datum/data/pda/app/crew_records/security,
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/centcom
|
||||
name = "Value-PAK Cartridge"
|
||||
desc = "Now with 200% more value!"
|
||||
icon_state = "cart-c"
|
||||
programs = list(
|
||||
new/datum/data/pda/app/power,
|
||||
new/datum/data/pda/utility/scanmode/halogen,
|
||||
|
||||
new/datum/data/pda/utility/scanmode/gas,
|
||||
|
||||
new/datum/data/pda/app/crew_records/medical,
|
||||
new/datum/data/pda/utility/scanmode/medical,
|
||||
|
||||
new/datum/data/pda/utility/scanmode/reagent,
|
||||
|
||||
new/datum/data/pda/app/crew_records/security,
|
||||
new/datum/data/pda/app/secbot_control,
|
||||
|
||||
new/datum/data/pda/app/janitor,
|
||||
|
||||
new/datum/data/pda/app/supply,
|
||||
|
||||
new/datum/data/pda/app/status_display)
|
||||
new /datum/data/pda/app/power,
|
||||
new /datum/data/pda/utility/scanmode/halogen,
|
||||
new /datum/data/pda/utility/scanmode/gas,
|
||||
new /datum/data/pda/app/crew_records/medical,
|
||||
new /datum/data/pda/utility/scanmode/medical,
|
||||
new /datum/data/pda/utility/scanmode/reagent,
|
||||
new /datum/data/pda/app/crew_records/security,
|
||||
new /datum/data/pda/app/secbot_control,
|
||||
new /datum/data/pda/app/janitor,
|
||||
new /datum/data/pda/app/supply,
|
||||
new /datum/data/pda/app/status_display
|
||||
)
|
||||
|
||||
/obj/item/cartridge/centcom/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -283,7 +285,9 @@
|
||||
name = "Nuclear Agent Detomatix Cartridge"
|
||||
desc = "The same reliable Detomatix program except with the added ability of remotely toggling your nuclear shuttle airlock from your PDA"
|
||||
var/initial_remote_door_id = "smindicate" //Make sure this matches the syndicate shuttle's shield/door id!! //don't ask about the name, testing.
|
||||
programs = list(new/datum/data/pda/utility/toggle_door)
|
||||
programs = list(
|
||||
new /datum/data/pda/utility/toggle_door
|
||||
)
|
||||
|
||||
/obj/item/cartridge/syndicate/nuclear/Initialize(mapload)
|
||||
. = ..()
|
||||
@@ -296,13 +300,17 @@
|
||||
icon_state = "cart"
|
||||
charges = 5
|
||||
var/telecrystals = 0
|
||||
messenger_plugins = list(new/datum/data/pda/messenger_plugin/virus/frame)
|
||||
messenger_plugins = list(
|
||||
new /datum/data/pda/messenger_plugin/virus/frame
|
||||
)
|
||||
|
||||
/obj/item/cartridge/mob_hunt_game
|
||||
name = "Nano-Mob Hunter GO! Cartridge"
|
||||
desc = "The hit new PDA game that lets you track down and capture your favorite Nano-Mobs living in your world!"
|
||||
icon_state = "cart-eye"
|
||||
programs = list(new/datum/data/pda/app/mob_hunter_game)
|
||||
programs = list(
|
||||
new /datum/data/pda/app/mob_hunter_game
|
||||
)
|
||||
|
||||
/obj/item/cartridge/mob_hunt_game/detailed_examine_antag()
|
||||
if(emagged)
|
||||
@@ -312,11 +320,13 @@
|
||||
if(istype(O, /obj/item/nanomob_card))
|
||||
var/obj/item/nanomob_card/card = O
|
||||
var/datum/data/pda/app/mob_hunter_game/my_game = programs[1]
|
||||
|
||||
if(my_game.register_capture(card.mob_data))
|
||||
to_chat(user, "<span class='notice'>Transfer successful!</span>")
|
||||
qdel(card)
|
||||
else
|
||||
to_chat(user, "<span class='warning'>Transfer failed. Could not read mob data from card.</span>")
|
||||
|
||||
else
|
||||
..()
|
||||
|
||||
|
||||
@@ -68,10 +68,10 @@
|
||||
category = "Utilities"
|
||||
|
||||
/datum/data/pda/app/signaller/update_ui(mob/user as mob, list/data)
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/signal))
|
||||
var/obj/item/integrated_radio/signal/R = pda.cartridge.radio
|
||||
data["frequency"] = R.frequency
|
||||
data["code"] = R.code
|
||||
if(pda?.cartridge?.integ_signaler)
|
||||
var/obj/item/assembly/signaler/S = pda.cartridge.integ_signaler // Simpler access
|
||||
data["frequency"] = S.frequency
|
||||
data["code"] = S.code
|
||||
data["minFrequency"] = PUBLIC_LOW_FREQ
|
||||
data["maxFrequency"] = PUBLIC_HIGH_FREQ
|
||||
|
||||
@@ -84,20 +84,18 @@
|
||||
if(!pda.silent)
|
||||
playsound(pda, 'sound/machines/terminal_select.ogg', 15, TRUE)
|
||||
|
||||
if(pda.cartridge && istype(pda.cartridge.radio, /obj/item/integrated_radio/signal))
|
||||
var/obj/item/integrated_radio/signal/R = pda.cartridge.radio
|
||||
if(pda?.cartridge?.integ_signaler)
|
||||
var/obj/item/assembly/signaler/S = pda.cartridge.integ_signaler // Simpler access
|
||||
|
||||
switch(action)
|
||||
if("signal")
|
||||
spawn(0)
|
||||
R.send_signal("ACTIVATE")
|
||||
S.activate()
|
||||
|
||||
if("freq")
|
||||
var/new_frequency = sanitize_frequency(text2num(params["freq"]) * 10)
|
||||
R.set_frequency(new_frequency)
|
||||
S.frequency = sanitize_frequency(text2num(params["freq"]) * 10)
|
||||
|
||||
if("code")
|
||||
R.code = clamp(text2num(params["code"]), 1, 100)
|
||||
S.code = clamp(text2num(params["code"]), 1, 100)
|
||||
|
||||
/datum/data/pda/app/power
|
||||
name = "Power Monitor"
|
||||
|
||||
@@ -143,54 +143,3 @@
|
||||
post_signal(control_freq, "command", "autopick", "active", active, "value", 1, s_filter = RADIO_MULEBOT)
|
||||
|
||||
post_signal(control_freq, "command", "bot_status", "active", active, s_filter = RADIO_MULEBOT)
|
||||
|
||||
|
||||
|
||||
/*
|
||||
* Radio Cartridge, essentially a signaler.
|
||||
*/
|
||||
|
||||
|
||||
/obj/item/integrated_radio/signal
|
||||
var/frequency = RSD_FREQ
|
||||
var/code = 30.0
|
||||
var/last_transmission
|
||||
var/datum/radio_frequency/radio_connection
|
||||
|
||||
/obj/item/integrated_radio/signal/Destroy()
|
||||
if(SSradio)
|
||||
SSradio.remove_object(src, frequency)
|
||||
radio_connection = null
|
||||
return ..()
|
||||
|
||||
/obj/item/integrated_radio/signal/Initialize(mapload)
|
||||
. = ..()
|
||||
if(!SSradio)
|
||||
return
|
||||
if(src.frequency < PUBLIC_LOW_FREQ || src.frequency > PUBLIC_HIGH_FREQ)
|
||||
src.frequency = sanitize_frequency(src.frequency)
|
||||
|
||||
set_frequency(frequency)
|
||||
|
||||
/obj/item/integrated_radio/signal/proc/set_frequency(new_frequency)
|
||||
SSradio.remove_object(src, frequency)
|
||||
frequency = new_frequency
|
||||
radio_connection = SSradio.add_object(src, frequency)
|
||||
|
||||
/obj/item/integrated_radio/signal/proc/send_signal(message="ACTIVATE")
|
||||
|
||||
if(last_transmission && world.time < (last_transmission + 5))
|
||||
return
|
||||
last_transmission = world.time
|
||||
|
||||
var/time = time2text(world.realtime,"hh:mm:ss")
|
||||
var/turf/T = get_turf(src)
|
||||
GLOB.lastsignalers.Add("[time] <B>:</B> [usr.key] used [src] @ location ([T.x],[T.y],[T.z]) <B>:</B> [format_frequency(frequency)]/[code]")
|
||||
|
||||
var/datum/signal/signal = new
|
||||
signal.source = src
|
||||
signal.encryption = code
|
||||
signal.data["message"] = message
|
||||
|
||||
spawn(0)
|
||||
radio_connection.post_signal(src, signal)
|
||||
|
||||
@@ -8,10 +8,10 @@
|
||||
receiving = TRUE
|
||||
var/anomaly_type = /obj/effect/anomaly
|
||||
|
||||
/obj/item/assembly/signaler/anomaly/receive_signal(datum/signal/signal)
|
||||
if(..())
|
||||
for(var/obj/effect/anomaly/A in get_turf(src))
|
||||
A.anomalyNeutralize()
|
||||
/obj/item/assembly/signaler/anomaly/signal_callback()
|
||||
if(istype(loc, /obj/effect/anomaly))
|
||||
var/obj/effect/anomaly/A = loc
|
||||
A.anomalyNeutralize()
|
||||
|
||||
/obj/item/assembly/signaler/anomaly/attack_self()
|
||||
return
|
||||
|
||||
@@ -676,7 +676,7 @@
|
||||
id = "electropack"
|
||||
build_type = AUTOLATHE
|
||||
materials = list(MAT_METAL = 10000, MAT_GLASS = 2500)
|
||||
build_path = /obj/item/radio/electropack
|
||||
build_path = /obj/item/electropack
|
||||
category = list("hacked", "Tools")
|
||||
|
||||
/datum/design/large_welding_tool
|
||||
|
||||
@@ -0,0 +1,31 @@
|
||||
import { useBackend } from '../backend';
|
||||
import { Button, LabeledList, Section } from '../components';
|
||||
import { Window } from '../layouts';
|
||||
import { Signaler } from './common/Signaler';
|
||||
|
||||
export const RemoteSignaler = (props, context) => {
|
||||
const { act, data } = useBackend(context);
|
||||
|
||||
const { on } = data;
|
||||
|
||||
return (
|
||||
<Window>
|
||||
<Window.Content>
|
||||
<Section>
|
||||
<LabeledList>
|
||||
<LabeledList.Item label="Receiver">
|
||||
<Button
|
||||
icon={'power-off'}
|
||||
content={on ? 'On' : 'Off'}
|
||||
color={on ? null : 'red'}
|
||||
selected={on}
|
||||
onClick={() => act('recv_power')}
|
||||
/>
|
||||
</LabeledList.Item>
|
||||
</LabeledList>
|
||||
<Signaler data={data} />
|
||||
</Section>
|
||||
</Window.Content>
|
||||
</Window>
|
||||
);
|
||||
}
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user