Merge branch 'master' of https://github.com/Citadel-Station-13/Citadel-Station-13 into Ghommie-cit685
This commit is contained in:
@@ -196,12 +196,16 @@
|
||||
|
||||
switch(tdir)
|
||||
if(NORTH)
|
||||
pixel_x = 0
|
||||
pixel_y = 23
|
||||
if(SOUTH)
|
||||
pixel_x = 0
|
||||
pixel_y = -23
|
||||
if(EAST)
|
||||
pixel_y = 0
|
||||
pixel_x = 24
|
||||
if(WEST)
|
||||
pixel_y = 0
|
||||
pixel_x = -25
|
||||
|
||||
/obj/machinery/power/apc/Destroy()
|
||||
@@ -593,19 +597,15 @@
|
||||
user.visible_message("[user.name] adds cables to the APC frame.", \
|
||||
"<span class='notice'>You start adding cables to the APC frame...</span>")
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
if(do_after(user, 20, target = src))
|
||||
if (C.get_amount() < 10 || !C)
|
||||
if(C.use_tool(src, user, 20, 10) && !terminal && opened && has_electronics)
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/structure/cable/N = T.get_cable_node()
|
||||
if (prob(50) && electrocute_mob(usr, N, N, 1, TRUE))
|
||||
do_sparks(5, TRUE, src)
|
||||
return
|
||||
if (C.get_amount() >= 10 && !terminal && opened && has_electronics)
|
||||
var/turf/T = get_turf(src)
|
||||
var/obj/structure/cable/N = T.get_cable_node()
|
||||
if (prob(50) && electrocute_mob(usr, N, N, 1, TRUE))
|
||||
do_sparks(5, TRUE, src)
|
||||
return
|
||||
C.use(10)
|
||||
to_chat(user, "<span class='notice'>You add cables to the APC frame.</span>")
|
||||
make_terminal()
|
||||
terminal.connect_to_network()
|
||||
to_chat(user, "<span class='notice'>You add cables to the APC frame.</span>")
|
||||
make_terminal()
|
||||
terminal.connect_to_network()
|
||||
else if (istype(W, /obj/item/electronics/apc) && opened)
|
||||
if (has_electronics)
|
||||
to_chat(user, "<span class='warning'>There is already a board inside the [src]!</span>")
|
||||
|
||||
@@ -91,6 +91,21 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
d1 = _d1
|
||||
d2 = _d2
|
||||
|
||||
if(dir != SOUTH)
|
||||
var/angle_to_turn = dir2angle(dir)
|
||||
if(angle_to_turn == 0 || angle_to_turn == 180)
|
||||
angle_to_turn += 180
|
||||
// direct dir set instead of setDir intentional
|
||||
dir = SOUTH
|
||||
if(d1)
|
||||
d1 = turn(d1, angle_to_turn)
|
||||
if(d2)
|
||||
d2 = turn(d2, angle_to_turn)
|
||||
if(d1 > d2)
|
||||
var/temp = d2
|
||||
d2 = d1
|
||||
d1 = temp
|
||||
|
||||
var/turf/T = get_turf(src) // hide if turf is not intact
|
||||
if(level==1)
|
||||
hide(T.intact)
|
||||
@@ -496,6 +511,7 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
full_w_class = WEIGHT_CLASS_SMALL
|
||||
grind_results = list(/datum/reagent/copper = 2) //2 copper per cable in the coil
|
||||
usesound = 'sound/items/deconstruct.ogg'
|
||||
used_skills = list(/datum/skill/level/job/wiring)
|
||||
|
||||
/obj/item/stack/cable_coil/cyborg
|
||||
is_cyborg = 1
|
||||
@@ -577,8 +593,6 @@ By design, d1 is the smallest direction and d2 is the highest
|
||||
amount += extra
|
||||
update_icon()
|
||||
|
||||
|
||||
|
||||
///////////////////////////////////////////////
|
||||
// Cable laying procedures
|
||||
//////////////////////////////////////////////
|
||||
|
||||
@@ -15,8 +15,7 @@
|
||||
state = FLOODLIGHT_NEEDS_WIRES
|
||||
desc = "A bare metal frame looking vaguely like a floodlight. Requires wiring."
|
||||
else if(istype(O, /obj/item/stack/cable_coil) && (state == FLOODLIGHT_NEEDS_WIRES))
|
||||
var/obj/item/stack/S = O
|
||||
if(S.use(5))
|
||||
if(O.use_tool(src, user, 0, 5))
|
||||
to_chat(user, "<span class='notice'>You wire [src].</span>")
|
||||
name = "wired [name]"
|
||||
desc = "A bare metal frame looking vaguely like a floodlight. Requires securing with a screwdriver."
|
||||
|
||||
@@ -118,8 +118,7 @@
|
||||
return
|
||||
|
||||
if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/coil = W
|
||||
if(coil.use(1))
|
||||
if(W.use_tool(src, user, 0, 1, max_level = JOB_SKILL_TRAINED))
|
||||
icon_state = "[fixture_type]-construct-stage2"
|
||||
stage = 2
|
||||
user.visible_message("[user.name] adds wires to [src].", \
|
||||
@@ -193,7 +192,7 @@
|
||||
var/on = FALSE // 1 if on, 0 if off
|
||||
var/on_gs = FALSE
|
||||
var/static_power_used = 0
|
||||
var/brightness = 11 // luminosity when on, also used in power calculation
|
||||
var/brightness = 9 // luminosity when on, also used in power calculation
|
||||
var/bulb_power = 0.75 // basically the alpha of the emitted light source
|
||||
var/bulb_colour = "#FFF6ED" // befault colour of the light.
|
||||
var/status = LIGHT_OK // LIGHT_OK, _EMPTY, _BURNED or _BROKEN
|
||||
@@ -232,7 +231,8 @@
|
||||
icon_state = "bulb"
|
||||
base_state = "bulb"
|
||||
fitting = "bulb"
|
||||
brightness = 6
|
||||
brightness = 5
|
||||
nightshift_brightness = 4
|
||||
bulb_colour = "#FFDDBB"
|
||||
desc = "A small lighting fixture."
|
||||
light_type = /obj/item/light/bulb
|
||||
@@ -274,11 +274,11 @@
|
||||
spawn(2)
|
||||
switch(fitting)
|
||||
if("tube")
|
||||
brightness = 11
|
||||
brightness = 9
|
||||
if(prob(2))
|
||||
break_light_tube(1)
|
||||
if("bulb")
|
||||
brightness = 6
|
||||
brightness = 5
|
||||
if(prob(5))
|
||||
break_light_tube(1)
|
||||
spawn(1)
|
||||
@@ -361,11 +361,11 @@
|
||||
set_light(0)
|
||||
update_icon()
|
||||
|
||||
active_power_usage = (brightness * 7.2)
|
||||
active_power_usage = (brightness * 10)
|
||||
if(on != on_gs)
|
||||
on_gs = on
|
||||
if(on)
|
||||
static_power_used = brightness * 14.4 * (hijacked ? 2 : 1) //20W per unit luminosity
|
||||
static_power_used = brightness * 20 * (hijacked ? 2 : 1) //20W per unit luminosity
|
||||
addStaticPower(static_power_used, STATIC_LIGHT)
|
||||
else
|
||||
removeStaticPower(static_power_used, STATIC_LIGHT)
|
||||
@@ -748,7 +748,7 @@
|
||||
icon_state = "ltube"
|
||||
base_state = "ltube"
|
||||
item_state = "c_tube"
|
||||
brightness = 11
|
||||
brightness = 9
|
||||
|
||||
/obj/item/light/tube/broken
|
||||
status = LIGHT_BROKEN
|
||||
@@ -761,7 +761,7 @@
|
||||
item_state = "contvapour"
|
||||
lefthand_file = 'icons/mob/inhands/equipment/medical_lefthand.dmi'
|
||||
righthand_file = 'icons/mob/inhands/equipment/medical_righthand.dmi'
|
||||
brightness = 6
|
||||
brightness = 5
|
||||
|
||||
/obj/item/light/bulb/broken
|
||||
status = LIGHT_BROKEN
|
||||
@@ -830,7 +830,8 @@
|
||||
icon = 'icons/obj/lighting.dmi'
|
||||
base_state = "floor" // base description and icon_state
|
||||
icon_state = "floor"
|
||||
brightness = 6
|
||||
brightness = 5
|
||||
nightshift_brightness = 4
|
||||
layer = 2.5
|
||||
light_type = /obj/item/light/bulb
|
||||
fitting = "bulb"
|
||||
|
||||
@@ -28,11 +28,19 @@
|
||||
var/bitcoinproduction_drain = 0.15
|
||||
var/bitcoinmining = FALSE
|
||||
rad_insulation = RAD_EXTREME_INSULATION
|
||||
var/obj/item/radio/Radio
|
||||
|
||||
/obj/machinery/power/rad_collector/anchored
|
||||
anchored = TRUE
|
||||
|
||||
/obj/machinery/power/rad_collector/Initialize()
|
||||
. = ..()
|
||||
Radio = new /obj/item/radio(src)
|
||||
Radio.listening = 0
|
||||
Radio.set_frequency(FREQ_ENGINEERING)
|
||||
|
||||
/obj/machinery/power/rad_collector/Destroy()
|
||||
QDEL_NULL(Radio)
|
||||
return ..()
|
||||
|
||||
/obj/machinery/power/rad_collector/process()
|
||||
@@ -42,6 +50,7 @@
|
||||
if(!loaded_tank.air_contents.gases[/datum/gas/plasma])
|
||||
investigate_log("<font color='red'>out of fuel</font>.", INVESTIGATE_SINGULO)
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, 1)
|
||||
Radio.talk_into(src, "Insufficient plasma in [get_area(src)] [src], ejecting \the [loaded_tank].", FREQ_ENGINEERING)
|
||||
eject()
|
||||
else
|
||||
var/gasdrained = min(powerproduction_drain*drainratio,loaded_tank.air_contents.gases[/datum/gas/plasma])
|
||||
@@ -55,6 +64,7 @@
|
||||
else if(is_station_level(z) && SSresearch.science_tech)
|
||||
if(!loaded_tank.air_contents.gases[/datum/gas/tritium] || !loaded_tank.air_contents.gases[/datum/gas/oxygen])
|
||||
playsound(src, 'sound/machines/ding.ogg', 50, 1)
|
||||
Radio.talk_into(src, "Insufficient oxygen and tritium in [get_area(src)] [src] to produce research points, ejecting \the [loaded_tank].", FREQ_ENGINEERING)
|
||||
eject()
|
||||
else
|
||||
var/gasdrained = bitcoinproduction_drain*drainratio
|
||||
|
||||
@@ -79,8 +79,7 @@
|
||||
construction_state = PA_CONSTRUCTION_UNSECURED
|
||||
did_something = TRUE
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/CC = W
|
||||
if(CC.use(1))
|
||||
if(W.use_tool(src, user, 0, 1))
|
||||
user.visible_message("[user.name] adds wires to the [name].", \
|
||||
"You add some wires.")
|
||||
construction_state = PA_CONSTRUCTION_PANEL_OPEN
|
||||
|
||||
@@ -288,8 +288,7 @@
|
||||
construction_state = PA_CONSTRUCTION_UNSECURED
|
||||
did_something = TRUE
|
||||
else if(istype(W, /obj/item/stack/cable_coil))
|
||||
var/obj/item/stack/cable_coil/CC = W
|
||||
if(CC.use(1))
|
||||
if(W.use_tool(src, user, 0, 1))
|
||||
user.visible_message("[user.name] adds wires to the [name].", \
|
||||
"You add some wires.")
|
||||
construction_state = PA_CONSTRUCTION_PANEL_OPEN
|
||||
|
||||
@@ -119,14 +119,13 @@
|
||||
|
||||
|
||||
/obj/singularity/Bump(atom/A)
|
||||
set waitfor = FALSE
|
||||
consume(A)
|
||||
return
|
||||
|
||||
|
||||
/obj/singularity/Bumped(atom/movable/AM)
|
||||
set waitfor = FALSE
|
||||
consume(AM)
|
||||
|
||||
|
||||
/obj/singularity/process()
|
||||
if(current_size >= STAGE_TWO)
|
||||
move()
|
||||
@@ -268,6 +267,7 @@
|
||||
|
||||
|
||||
/obj/singularity/proc/eat()
|
||||
set waitfor = FALSE
|
||||
for(var/tile in spiral_range_turfs(grav_pull, src))
|
||||
var/turf/T = tile
|
||||
if(!T || !isturf(loc))
|
||||
@@ -284,8 +284,6 @@
|
||||
else
|
||||
consume(X)
|
||||
CHECK_TICK
|
||||
return
|
||||
|
||||
|
||||
/obj/singularity/proc/consume(atom/A)
|
||||
var/gain = A.singularity_act(current_size, src)
|
||||
@@ -295,8 +293,6 @@
|
||||
name = "supermatter-charged [initial(name)]"
|
||||
consumedSupermatter = 1
|
||||
set_light(10)
|
||||
return
|
||||
|
||||
|
||||
/obj/singularity/proc/move(force_move = 0)
|
||||
if(!move_self)
|
||||
|
||||
@@ -125,15 +125,12 @@
|
||||
to_chat(user, "<span class='notice'>You start building the power terminal...</span>")
|
||||
playsound(src.loc, 'sound/items/deconstruct.ogg', 50, 1)
|
||||
|
||||
if(do_after(user, 20, target = src) && C.get_amount() >= 10)
|
||||
if(C.get_amount() < 10 || !C)
|
||||
return
|
||||
if(C.use_tool(src, user, 20, 10))
|
||||
var/obj/structure/cable/N = T.get_cable_node() //get the connecting node cable, if there's one
|
||||
if (prob(50) && electrocute_mob(usr, N, N, 1, TRUE)) //animate the electrocution if uncautious and unlucky
|
||||
do_sparks(5, TRUE, src)
|
||||
return
|
||||
|
||||
C.use(10)
|
||||
user.visible_message(\
|
||||
"[user.name] has built a power terminal.",\
|
||||
"<span class='notice'>You build the power terminal.</span>")
|
||||
|
||||
@@ -66,8 +66,6 @@
|
||||
|
||||
#define SUPERMATTER_COUNTDOWN_TIME 30 SECONDS
|
||||
|
||||
#define SUPERMATTER_INTEGRITY_MULT 1.3 //(loss of integrity / 10) ^ 1.3
|
||||
|
||||
GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
|
||||
/obj/machinery/power/supermatter_crystal
|
||||
@@ -160,8 +158,6 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
var/datum/looping_sound/supermatter/soundloop
|
||||
|
||||
var/moveable = FALSE
|
||||
var/min_damage = 0
|
||||
var/power_calc = 0
|
||||
|
||||
/obj/machinery/power/supermatter_crystal/Initialize()
|
||||
. = ..()
|
||||
@@ -253,7 +249,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
add_overlay(causality_field, TRUE)
|
||||
|
||||
var/speaking = "[emergency_alert] The supermatter has reached critical integrity failure. Emergency causality destabilization field has been activated."
|
||||
radio.talk_into(src, speaking, common_channel, language = get_default_language())
|
||||
radio.talk_into(src, speaking, common_channel, language = get_selected_language())
|
||||
for(var/i in SUPERMATTER_COUNTDOWN_TIME to 0 step -10)
|
||||
if(damage < explosion_point) // Cutting it a bit close there engineers
|
||||
radio.talk_into(src, "[safe_alert] Failsafe has been disengaged.", common_channel)
|
||||
@@ -356,7 +352,6 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
|
||||
//capping damage
|
||||
damage = min(damage_archived + (DAMAGE_HARDCAP * explosion_point),damage)
|
||||
damage = max(min_damage, damage) //max integrity
|
||||
if(damage > damage_archived && prob(10))
|
||||
playsound(get_turf(src), 'sound/effects/empulse.ogg', 50, 1)
|
||||
|
||||
@@ -396,7 +391,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
|
||||
if(matter_power)
|
||||
var/removed_matter = max(matter_power/MATTER_POWER_CONVERSION, 40)
|
||||
power_calc = max(power_calc + removed_matter, 0)
|
||||
power = max(power + removed_matter, 0)
|
||||
matter_power = max(matter_power - removed_matter, 0)
|
||||
|
||||
var/temp_factor = 50
|
||||
@@ -409,7 +404,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
temp_factor = 30
|
||||
icon_state = base_icon_state
|
||||
|
||||
power_calc = max( (removed.temperature * temp_factor / T0C) * gasmix_power_ratio + power_calc, 0) //Total laser power plus an overload
|
||||
power = max( (removed.temperature * temp_factor / T0C) * gasmix_power_ratio + power, 0) //Total laser power plus an overload
|
||||
|
||||
if(prob(50))
|
||||
radiation_pulse(src, power * (1 + (tritiumcomp * TRITIUM_RADIOACTIVITY_MODIFIER) + ((pluoxiumcomp * PLUOXIUM_RADIOACTIVITY_MODIFIER) * pluoxiumbonus) * (power_transmission_bonus/(10-(bzcomp * BZ_RADIOACTIVITY_MODIFIER))))) // Rad Modifiers BZ(500%), Tritium(300%), and Pluoxium(-200%)
|
||||
@@ -441,19 +436,15 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
for(var/mob/living/carbon/human/l in view(src, HALLUCINATION_RANGE(power))) // If they can see it without mesons on. Bad on them.
|
||||
if(!istype(l.glasses, /obj/item/clothing/glasses/meson))
|
||||
var/D = sqrt(1 / max(1, get_dist(l, src)))
|
||||
l.hallucination += power_calc * config_hallucination_power * D
|
||||
l.hallucination += power * config_hallucination_power * D
|
||||
l.hallucination = clamp(0, 200, l.hallucination)
|
||||
|
||||
for(var/mob/living/l in range(src, round((power / 100) ** 0.25)))
|
||||
var/rads = (power / 10) * sqrt( 1 / max(get_dist(l, src),1) )
|
||||
l.rad_act(rads)
|
||||
|
||||
power_calc -= ((power_calc/500)**3) * powerloss_inhibitor
|
||||
if ((100-get_integrity()) < 75)
|
||||
power = (power_calc * ((100 - (0.15*(100-get_integrity()) - 5)**2) / 100)) + power_calc*0.1
|
||||
else
|
||||
power = power_calc * (((100-get_integrity())**((3*(100-get_integrity()))/1000) + 2*(100-get_integrity()))/100) //new and improved, more linear
|
||||
//power = power_calc * ((((100-get_integrity())**1.3)-(2*(100-get_integrity())))/100)
|
||||
power -= ((power/500)**3) * powerloss_inhibitor
|
||||
|
||||
if(power > POWER_PENALTY_THRESHOLD || damage > damage_penalty_point)
|
||||
|
||||
if(power > POWER_PENALTY_THRESHOLD)
|
||||
@@ -476,9 +467,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
supermatter_anomaly_gen(src, GRAVITATIONAL_ANOMALY, rand(5, 10))
|
||||
if(power > SEVERE_POWER_PENALTY_THRESHOLD && prob(2) || prob(0.3) && power > POWER_PENALTY_THRESHOLD)
|
||||
supermatter_anomaly_gen(src, PYRO_ANOMALY, rand(5, 10))
|
||||
if (damage - damage_archived > 0)
|
||||
min_damage += ((damage - damage_archived) / 9) * SUPERMATTER_INTEGRITY_MULT
|
||||
if(damage > (min_damage < 200 ? min_damage : 0) + warning_point) // while the core is still damaged and it's still worth noting its status
|
||||
if(damage > warning_point) // while the core is still damaged and it's still worth noting its status
|
||||
if((REALTIMEOFDAY - lastwarning) / 10 >= WARNING_DELAY)
|
||||
alarm()
|
||||
|
||||
@@ -517,7 +506,7 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
if(!istype(Proj.firer, /obj/machinery/power/emitter))
|
||||
investigate_log("has been hit by [Proj] fired by [key_name(Proj.firer)]", INVESTIGATE_SUPERMATTER)
|
||||
if(Proj.flag != "bullet")
|
||||
power_calc += Proj.damage * config_bullet_energy
|
||||
power += Proj.damage * config_bullet_energy
|
||||
if(!has_been_powered)
|
||||
investigate_log("has been powered for the first time.", INVESTIGATE_SUPERMATTER)
|
||||
message_admins("[src] has been powered for the first time [ADMIN_JMP(src)].")
|
||||
@@ -618,17 +607,6 @@ GLOBAL_DATUM(main_supermatter_engine, /obj/machinery/power/supermatter_crystal)
|
||||
to_chat(user, "<span class='notice'>You extract a sliver from \the [src]. \The [src] begins to react violently!</span>")
|
||||
new /obj/item/nuke_core/supermatter_sliver(drop_location())
|
||||
matter_power += 200
|
||||
if (istype(W, /obj/item/supermatterspray))
|
||||
var/obj/item/supermatterspray/S = W
|
||||
if (S.usesleft > 0 && do_after(user, 60, target=src))
|
||||
min_damage = max(0,min_damage - 10)
|
||||
to_chat(user, "<span class='notice'>You spray \the [src] with [S].</span>")
|
||||
playsound(user.loc,'sound/effects/spray2.ogg',50,1,-6)
|
||||
S.usesleft--
|
||||
if (prob(10))
|
||||
to_chat(user, "<span class='warning'>Your hands slip and you drop [S] into \the [src]!</span>")
|
||||
Consume(S)
|
||||
return
|
||||
else if(user.dropItemToGround(W))
|
||||
user.visible_message("<span class='danger'>As [user] touches \the [src] with \a [W], silence fills the room...</span>",\
|
||||
"<span class='userdanger'>You touch \the [src] with \the [W], and everything suddenly goes silent.</span>\n<span class='notice'>\The [W] flashes into dust as you flinch away from \the [src].</span>",\
|
||||
|
||||
Reference in New Issue
Block a user