mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-08-24 05:30:05 +01:00
@@ -284,12 +284,6 @@
|
||||
|
||||
/datum/config_entry/flag/maprotation
|
||||
|
||||
/datum/config_entry/number/maprotatechancedelta
|
||||
config_entry_value = 0.75
|
||||
min_val = 0
|
||||
max_val = 1
|
||||
integer = FALSE
|
||||
|
||||
/datum/config_entry/number/soft_popcap
|
||||
config_entry_value = null
|
||||
min_val = 0
|
||||
|
||||
@@ -180,8 +180,14 @@
|
||||
var/list/mobs = list()
|
||||
var/blueprints = FALSE
|
||||
var/clone_area = SSmapping.RequestBlockReservation(size_x * 2 + 1, size_y * 2 + 1)
|
||||
for(var/turf/T in block(locate(target_turf.x - size_x, target_turf.y - size_y, target_turf.z), locate(target_turf.x + size_x, target_turf.y + size_y, target_turf.z)))
|
||||
if((ai_user && GLOB.cameranet.checkTurfVis(T)) || (T in seen))
|
||||
for(var/turf/placeholder in block(locate(target_turf.x - size_x, target_turf.y - size_y, target_turf.z), locate(target_turf.x + size_x, target_turf.y + size_y, target_turf.z)))
|
||||
var/turf/T = placeholder
|
||||
while(istype(T, /turf/open/openspace)) //Multi-z photography
|
||||
T = SSmapping.get_turf_below(T)
|
||||
if(!T)
|
||||
break
|
||||
|
||||
if(T && ((ai_user && GLOB.cameranet.checkTurfVis(placeholder)) || (placeholder in seen)))
|
||||
turfs += T
|
||||
for(var/mob/M in T)
|
||||
mobs += M
|
||||
|
||||
@@ -1,42 +1,106 @@
|
||||
#define RELAY_OK 1
|
||||
#define RELAY_ADD_CABLE 2
|
||||
#define RELAY_ADD_METAL 3
|
||||
|
||||
/obj/machinery/power/deck_relay //This bridges powernets
|
||||
name = "Multi-deck power adapter"
|
||||
desc = "A huge bundle of double insulated cabling which seems to run up into the ceiling."
|
||||
icon = 'icons/obj/power.dmi'
|
||||
icon_state = "cablerelay-off"
|
||||
max_integrity = 350
|
||||
integrity_failure = 0.25
|
||||
var/broken_status = RELAY_OK
|
||||
var/obj/machinery/power/deck_relay/below ///The relay that's below us (for bridging powernets)
|
||||
var/obj/machinery/power/deck_relay/above ///The relay that's above us (for bridging powernets)
|
||||
anchored = TRUE
|
||||
density = FALSE
|
||||
|
||||
/obj/machinery/power/deck_relay/attackby(obj/item/I,mob/user)
|
||||
/obj/machinery/power/deck_relay/examine(mob/user)
|
||||
. += ..()
|
||||
if(!anchored)
|
||||
. += "<span class='notice'>The securing bolts are undone.</span>"
|
||||
if(broken_status == RELAY_ADD_CABLE)
|
||||
. += "<span class='notice'>The cable insulation is torn apart and the wires are frayed beyond use.</span>"
|
||||
if(broken_status == RELAY_ADD_METAL)
|
||||
. += "<span class='notice'>The cable insulation is torn apart and the wiring is exposed.</span>"
|
||||
|
||||
/obj/machinery/power/deck_relay/attackby(obj/item/I, mob/user, params)
|
||||
if(default_unfasten_wrench(user, I))
|
||||
if(!anchored && broken_status == RELAY_OK)
|
||||
break_connections()
|
||||
return
|
||||
return FALSE
|
||||
. = ..()
|
||||
if(istype(I, /obj/item/stack/cable_coil) && broken_status == RELAY_ADD_CABLE)
|
||||
var/obj/item/stack/C = I
|
||||
if(C.use(15))
|
||||
to_chat(user, "<span class='notice'>You fix the frayed wires inside [src].</span>")
|
||||
icon_state = "cablerelay-broken-cable"
|
||||
broken_status = RELAY_ADD_METAL
|
||||
return
|
||||
else
|
||||
to_chat(user, "You need 15 cables to rewire [src].")
|
||||
return
|
||||
if(istype(I, /obj/item/stack/sheet/metal) && broken_status == RELAY_ADD_METAL)
|
||||
var/obj/item/stack/S = I
|
||||
if(S.use(10))
|
||||
to_chat(user, "<span class='notice'>You reseal the insulation for [src].</span>")
|
||||
icon_state = "cablerelay"
|
||||
broken_status = RELAY_OK
|
||||
obj_integrity = max_integrity
|
||||
return
|
||||
else
|
||||
to_chat(user, "You need 10 metal to mend [src].")
|
||||
return
|
||||
. = ..()
|
||||
|
||||
/obj/machinery/power/deck_relay/process()
|
||||
if(!anchored)
|
||||
icon_state = "cablerelay-off"
|
||||
if(above) //Lose connections
|
||||
above.below = null
|
||||
if(below)
|
||||
below.above = null
|
||||
return
|
||||
refresh() //Sometimes the powernets get lost, so we need to keep checking.
|
||||
if(powernet && (powernet.avail <= 0)) // is it powered?
|
||||
icon_state = "cablerelay-off"
|
||||
else
|
||||
icon_state = "cablerelay-on"
|
||||
if(!below || QDELETED(below) || !above || QDELETED(above))
|
||||
icon_state = "cablerelay-off"
|
||||
find_relays()
|
||||
/obj/machinery/power/deck_relay/obj_break()
|
||||
..()
|
||||
if(broken_status == RELAY_OK)
|
||||
break_connections()
|
||||
visible_message("<span class='warning'>[src]'s insulation breaks, fraying and severing the cable bundle!</span>")
|
||||
playsound(loc, 'sound/effects/glassbr3.ogg', 100, TRUE)
|
||||
icon_state = "cablerelay-broken"
|
||||
broken_status = RELAY_ADD_CABLE
|
||||
|
||||
///Allows you to scan the relay with a multitool to see stats.
|
||||
/obj/machinery/power/deck_relay/obj_destruction()
|
||||
return //this shouldn't break under usual means
|
||||
|
||||
/obj/machinery/power/deck_relay/Destroy()
|
||||
break_connections()
|
||||
return ..()
|
||||
|
||||
///Lose connections and reset the merged powernet so it makes 2 new seperated ones
|
||||
/obj/machinery/power/deck_relay/proc/break_connections()
|
||||
if(above)
|
||||
var/turf/above_deck_relay = get_turf(above)
|
||||
var/obj/structure/cable/above_cable = above_deck_relay.get_cable_node()
|
||||
if(above_cable)
|
||||
var/datum/powernet/above_powernet = new()
|
||||
propagate_network(above_cable, above_powernet)
|
||||
above.below = null
|
||||
above = null
|
||||
if(below)
|
||||
var/turf/below_deck_relay = get_turf(below)
|
||||
var/obj/structure/cable/below_cable = below_deck_relay.get_cable_node()
|
||||
if(below_cable)
|
||||
var/datum/powernet/below_powernet = new()
|
||||
propagate_network(below_cable, below_powernet)
|
||||
below.above = null
|
||||
below = null
|
||||
|
||||
///Allows you to scan the relay with a multitool to see stats/reconnect relays
|
||||
/obj/machinery/power/deck_relay/multitool_act(mob/user, obj/item/I)
|
||||
if(powernet && (powernet.avail > 0)) // is it powered?
|
||||
if(!anchored)
|
||||
to_chat(user, "<span class='danger'>You need to wrench this into place before getting a reading!</span>")
|
||||
return TRUE
|
||||
if(broken_status == RELAY_ADD_CABLE || broken_status == RELAY_ADD_METAL)
|
||||
to_chat(user, "<span class='danger'>The [src] isn't in proper shape to get a reading!</span>")
|
||||
return TRUE
|
||||
if(powernet && (above || below))//we have a powernet and at least one connected relay
|
||||
to_chat(user, "<span class='danger'>Total power: [DisplayPower(powernet.avail)]\nLoad: [DisplayPower(powernet.load)]\nExcess power: [DisplayPower(surplus())]</span>")
|
||||
if(!powernet || below.powernet != powernet)
|
||||
icon_state = "cablerelay-off"
|
||||
to_chat(user, "<span class='danger'>Powernet connection lost. Attempting to re-establish. Ensure the relays below this one are connected too.</span>")
|
||||
if(!above && !below)
|
||||
to_chat(user, "<span class='danger'>Cannot access valid powernet. Attempting to re-establish. Ensure any relays above and below are aligned properly and on cable nodes.</span>")
|
||||
find_relays()
|
||||
addtimer(CALLBACK(src, .proc/refresh), 20) //Wait a bit so we can find the one below, then get powering
|
||||
return TRUE
|
||||
@@ -53,6 +117,7 @@
|
||||
if(below)
|
||||
below.merge(src)
|
||||
|
||||
///Merges the two powernets connected to the deck relays
|
||||
/obj/machinery/power/deck_relay/proc/merge(var/obj/machinery/power/deck_relay/DR)
|
||||
if(!DR)
|
||||
return
|
||||
@@ -69,6 +134,7 @@
|
||||
if(!T || !istype(T))
|
||||
return FALSE
|
||||
below = null //in case we're re-establishing
|
||||
above = null
|
||||
var/obj/structure/cable/C = T.get_cable_node() //check if we have a node cable on the machine turf, the first found is picked
|
||||
if(C && C.powernet)
|
||||
C.powernet.add_machine(src) //Nice we're in.
|
||||
|
||||
@@ -213,6 +213,16 @@
|
||||
anchored = FALSE
|
||||
var/tracker = 0
|
||||
var/glass_type = null
|
||||
var/random_offset = 6 //amount in pixels an unanchored assembly may be offset by
|
||||
|
||||
/obj/item/solar_assembly/Initialize(mapload)
|
||||
. = ..()
|
||||
if(!anchored && !pixel_x && !pixel_y)
|
||||
randomise_offset(random_offset)
|
||||
|
||||
/obj/item/solar_assembly/proc/randomise_offset(amount)
|
||||
pixel_x = rand(-amount,amount)
|
||||
pixel_y = rand(-amount,amount)
|
||||
|
||||
// Give back the glass type we were supplied with
|
||||
/obj/item/solar_assembly/proc/give_glass(device_broken)
|
||||
@@ -234,9 +244,12 @@
|
||||
if(anchored)
|
||||
user.visible_message("<span class='notice'>[user] wrenches the solar assembly into place.</span>", "<span class='notice'>You wrench the solar assembly into place.</span>")
|
||||
W.play_tool_sound(src, 75)
|
||||
pixel_x = 0
|
||||
pixel_y = 0
|
||||
else
|
||||
user.visible_message("<span class='notice'>[user] unwrenches the solar assembly from its place.</span>", "<span class='notice'>You unwrench the solar assembly from its place.</span>")
|
||||
W.play_tool_sound(src, 75)
|
||||
randomise_offset(random_offset)
|
||||
return 1
|
||||
|
||||
if(istype(W, /obj/item/stack/sheet/glass) || istype(W, /obj/item/stack/sheet/rglass))
|
||||
|
||||
@@ -381,12 +381,6 @@ MAPROTATION
|
||||
## When it's set to zero, the map will be randomly picked each round
|
||||
PREFERENCE_MAP_VOTING 1
|
||||
|
||||
## Map rotate chance delta
|
||||
## This is the chance of map rotation factored to the round length.
|
||||
## A value of 1 would mean the map rotation chance is the round length in minutes (hour long round == 60% rotation chance)
|
||||
## A value of 0.5 would mean the map rotation chance is half of the round length in minutes (hour long round == 30% rotation chance)
|
||||
#MAPROTATIONCHANCEDELTA 0.75
|
||||
|
||||
## AUTOADMIN
|
||||
## The default admin rank
|
||||
AUTOADMIN_RANK Game Master
|
||||
|
||||
@@ -0,0 +1,4 @@
|
||||
author: "MMMiracles"
|
||||
delete-after: True
|
||||
changes:
|
||||
- tweak: "Multi-Z power relays can repaired but must be manually updated with a multi-tool when reinstalling/moving around."
|
||||
@@ -0,0 +1,4 @@
|
||||
author: "ike709"
|
||||
delete-after: True
|
||||
changes:
|
||||
- bugfix: "Taking pictures of openspace turfs works now."
|
||||
@@ -0,0 +1,4 @@
|
||||
author: "Skoglol"
|
||||
delete-after: True
|
||||
changes:
|
||||
- bugfix: "Contractor tablet should now properly let you shop for rep."
|
||||
@@ -0,0 +1,4 @@
|
||||
author: "cacogen"
|
||||
delete-after: True
|
||||
changes:
|
||||
- tweak: "Unanchored solar assemblies go off-centre to indicate they need securing. Secured ones centre themselves"
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 33 KiB After Width: | Height: | Size: 33 KiB |
@@ -350,7 +350,7 @@ export const SyndPane = props => {
|
||||
)}
|
||||
<Button
|
||||
content="Purchase"
|
||||
disabled={data.redeemable_tc < item.cost
|
||||
disabled={data.contract_rep < item.cost
|
||||
|| (limited && item.limited <= 0)}
|
||||
onClick={() => act('buy_hub', {
|
||||
item: item.name,
|
||||
|
||||
File diff suppressed because one or more lines are too long
Reference in New Issue
Block a user