Permalink
Browse files

Merge #82

82: Dev r=HiddenKn a=HiddenKn

Merge from upstream

Co-authored-by: Unknown <orelvitinfm@gmail.com>
Co-authored-by: Orelbon <orelbon@users.noreply.github.com>
Co-authored-by: comma <krauchinsky@gmail.com>
Co-authored-by: afterthought <afterthought@linuxmail.org>
Co-authored-by: PurpleMartinJCK <purplemartinjck@gmail.com>
Co-authored-by: sabira <sabiramalak@gmail.com>
Co-authored-by: Hubblenaut <aschnelle@web.de>
Co-authored-by: Zuhayr <agmogett@gmail.com>
Co-authored-by: PsiOmegaDelta <git@psiomega.se>
  • Loading branch information...
9 people committed Jul 11, 2018
2 parents b231dd2 + f8ff4fc commit 006736c0e825c21a5ed34f689eab5db3410a9168
@@ -9,18 +9,22 @@
var/mute_setting
var/show_preference_setting
/decl/communication_channel/proc/can_ignore_OOC(var/client/C)
/decl/communication_channel/proc/can_ignore(var/client/C)
if (!C)
return TRUE
// Channels that cannot be toggled can never be ignored
if(!show_preference_setting)
return FALSE
// If you're trying to see the channel, you can't ignore it
if (C.get_preference_value(show_preference_setting) == GLOB.PREF_SHOW)
return FALSE
// I suppose the host is more equal than others
if (check_rights(R_HOST, 0, C))
return TRUE
// Admins without ban permissions may ignore OOC
// Admins without ban permissions may ignore communication channels
if (check_rights(R_ADMIN, 0, C) && (!check_rights(R_BAN, 0, C)))
return TRUE
// Anyone else with investigation status may not ignore OOC
// Anyone else with investigation status may not ignore communication channels
return !check_rights(R_INVESTIGATE, 0, C)
/*
@@ -46,7 +50,7 @@
var/client/C = communicator.get_client()
if(can_ignore_OOC(C))
if(can_ignore(C))
to_chat(communicator, "<span class='warning'>Couldn't send message - you have [name] muted.</span>")
return FALSE
@@ -83,7 +87,7 @@
/decl/communication_channel/proc/can_receive_communication(var/datum/receiver)
if(show_preference_setting)
var/client/C = receiver.get_client()
if(can_ignore_OOC(C))
if(can_ignore(C))
return FALSE
return TRUE
@@ -2,7 +2,7 @@ var/bomb_set
/obj/machinery/nuclearbomb
name = "\improper Nuclear Fission Explosive"
desc = "Uh oh. RUN!!!!"
desc = "Uh oh. RUN!"
icon = 'icons/obj/nuke.dmi'
icon_state = "idle"
density = 1
@@ -47,8 +47,8 @@ var/bomb_set
/obj/machinery/nuclearbomb/attackby(obj/item/weapon/O as obj, mob/user as mob, params)
if(isScrewdriver(O))
src.add_fingerprint(user)
if(src.auth)
add_fingerprint(user)
if(auth)
if(panel_open == 0)
panel_open = 1
overlays |= "panel_open"
@@ -73,15 +73,15 @@ var/bomb_set
if(panel_open && isMultitool(O) || isWirecutter(O))
return attack_hand(user)
if(src.extended)
if(extended)
if(istype(O, /obj/item/weapon/disk/nuclear))
if(!user.unEquip(O, src))
return
src.auth = O
src.add_fingerprint(user)
auth = O
add_fingerprint(user)
return attack_hand(user)
if(src.anchored)
if(anchored)
switch(removal_stage)
if(0)
if(isWelder(O))
@@ -208,12 +208,12 @@ var/bomb_set
if(usr.incapacitated())
return
if(src.deployable)
if(deployable)
to_chat(usr, "<span class='warning'>You close several panels to make [src] undeployable.</span>")
src.deployable = 0
deployable = 0
else
to_chat(usr, "<span class='warning'>You adjust some panels to make [src] deployable.</span>")
src.deployable = 1
deployable = 1
return
/obj/machinery/nuclearbomb/proc/is_auth(var/mob/user)
@@ -281,23 +281,9 @@ var/bomb_set
to_chat(usr, "<span class='warning'>Nothing happens, something might be wrong with the wiring.</span>")
return 1
if(!timing && !safety)
if(istype(src, /obj/machinery/nuclearbomb/station))
var/obj/machinery/nuclearbomb/station/B = src
for(var/inserter in B.inserters)
var/obj/machinery/self_destruct/sd = inserter
if(!istype(sd) || !sd.armed)
to_chat(usr, "<span class='warning'>An inserter has not been armed or is damaged.</span>")
return
timing = 1
log_and_message_admins("activated the detonation countdown of \the [src]")
bomb_set++ //There can still be issues with this resetting when there are multiple bombs. Not a big deal though for Nuke/N
var/decl/security_state/security_state = decls_repository.get_decl(GLOB.using_map.security_state)
original_level = security_state.current_security_level
security_state.set_security_level(security_state.severe_security_level, TRUE)
update_icon()
else
secure_device()
start_bomb()
else
check_cutoff()
if(href_list["safety"])
if (wires.IsIndexCut(NUCLEARBOMB_WIRE_SAFETY))
to_chat(usr, "<span class='warning'>Nothing happens, something might be wrong with the wiring.</span>")
@@ -323,6 +309,18 @@ var/bomb_set
to_chat(usr, "<span class='warning'>There is nothing to anchor to!</span>")
return 1
/obj/machinery/nuclearbomb/proc/start_bomb()
timing = 1
log_and_message_admins("activated the detonation countdown of \the [src]")
bomb_set++ //There can still be issues with this resetting when there are multiple bombs. Not a big deal though for Nuke/N
var/decl/security_state/security_state = decls_repository.get_decl(GLOB.using_map.security_state)
original_level = security_state.current_security_level
security_state.set_security_level(security_state.severe_security_level, TRUE)
update_icon()
/obj/machinery/nuclearbomb/proc/check_cutoff()
secure_device()
/obj/machinery/nuclearbomb/proc/secure_device()
if(timing <= 0)
return
@@ -339,12 +337,12 @@ var/bomb_set
#define NUKERANGE 80
/obj/machinery/nuclearbomb/proc/explode()
if (src.safety)
if (safety)
timing = 0
return
src.timing = -1
src.yes_code = 0
src.safety = 1
timing = -1
yes_code = 0
safety = 1
update_icon()
SetUniversalState(/datum/universal_state/nuclear_explosion, arguments=list(src))
@@ -419,9 +417,9 @@ var/bomb_set
. = ..()
var/obj/item/weapon/paper/R = new(src)
R.set_content("<center><img src=sollogo.png><br><br>\
<b>Warning: Classified<br>[GLOB.using_map.station_name] Self Destruct System - Instructions</b></center><br><br>\
<b>Warning: Classified<br>[GLOB.using_map.station_name] Self-Destruct System - Instructions</b></center><br><br>\
In the event of a Delta-level emergency, this document will guide you through the activation of the vessel's \
on-board nuclear self destruct system. Please read carefully.<br><br>\
on-board nuclear self-destruct system. Please read carefully.<br><br>\
1) (Optional) Announce the imminent activation to any surviving crew members, and begin evacuation procedures.<br>\
2) Notify two heads of staff, both with ID cards with access to the ship's Keycard Authentication Devices.<br>\
3) Proceed to the self-destruct chamber, located on Deck One by the stairwell.<br>\
@@ -457,8 +455,12 @@ var/bomb_set
extended = 1
var/list/flash_tiles = list()
var/last_turf_state
var/list/inserters = list()
var/last_turf_state
var/announced = 0
var/time_to_explosion = 0
var/self_destruct_cutoff = 60 //Seconds
/obj/machinery/nuclearbomb/station/Initialize()
. = ..()
@@ -485,16 +487,58 @@ var/bomb_set
if(timing)
to_chat(usr, "<span class='warning'>Cannot alter the timing during countdown.</span>")
return
var/time = text2num(href_list["time"])
timeleft += time
timeleft = Clamp(timeleft, 300, 900)
return 1
/obj/machinery/nuclearbomb/station/start_bomb()
for(var/inserter in inserters)
var/obj/machinery/self_destruct/sd = inserter
if(!istype(sd) || !sd.armed)
to_chat(usr, "<span class='warning'>An inserter has not been armed or is damaged.</span>")
return
visible_message("<span class='warning'>Warning. The self-destruct sequence override will be disabled [self_destruct_cutoff] seconds before detonation.</span>")
..()
/obj/machinery/nuclearbomb/station/check_cutoff()
if(timeleft <= self_destruct_cutoff)
visible_message("<span class='warning'>Self-Destruct abort is no longer possible.</span>")
return
..()
/obj/machinery/nuclearbomb/station/Destroy()
flash_tiles.Cut()
return ..()
/obj/machinery/nuclearbomb/station/Process()
..()
if(timeleft > 0 && ticker.current_state != GAME_STATE_FINISHED)
if(timeleft <= self_destruct_cutoff)
if(!announced)
priority_announcement.Announce("The self-destruct sequence has reached terminal countdown, abort systems have been disabled.", "Self-Destruct Control Computer")
announced = 1
if(world.time >= time_to_explosion)
var/range
var/high_intensity
var/low_intensity
if(timeleft <= (self_destruct_cutoff/2))
range = rand(2, 3)
high_intensity = rand(5,8)
low_intensity = rand(7,10)
time_to_explosion = world.time + 2 SECONDS
else
range = rand(1, 2)
high_intensity = rand(3, 6)
low_intensity = rand(5, 8)
time_to_explosion = world.time + 5 SECONDS
var/turf/T = pick_area_and_turf(GLOB.is_station_but_not_space_or_shuttle_area)
explosion(T, range, high_intensity, low_intensity)
/obj/machinery/nuclearbomb/station/secure_device()
..()
announced = 0
/obj/machinery/nuclearbomb/station/update_icon()
var/target_icon_state
if(lighthack)
@@ -55,6 +55,12 @@
spawn(1) qdel(src)
return 1
/obj/structure/proc/can_visually_connect()
return anchored
/obj/structure/proc/can_visually_connect_to(var/obj/structure/S)
return istype(S, src)
/obj/structure/proc/update_connections(propagate = 0)
var/list/dirs = list()
var/list/other_dirs = list()
@@ -63,8 +69,8 @@
return
for(var/obj/structure/S in orange(src, 1))
if(istype(S, src))
if(S.anchored)
if(can_visually_connect_to(S))
if(S.can_visually_connect())
if(propagate)
S.update_connections()
S.update_icon()
@@ -384,6 +384,13 @@
verbs += /obj/structure/window/proc/rotate
verbs += /obj/structure/window/proc/revrotate
// Visually connect with every type of window as long as it's full-tile.
/obj/structure/window/can_visually_connect()
return ..() && is_fulltile()
/obj/structure/window/can_visually_connect_to(var/obj/structure/S)
return istype(S, /obj/structure/window)
//merges adjacent full-tile windows into one (blatant ripoff from game/smoothwall.dm)
/obj/structure/window/update_icon()
//A little cludge here, since I don't know how it will work with slim windows. Most likely VERY wrong.
@@ -395,24 +402,23 @@
layer = SIDE_WINDOW_LAYER
icon_state = "[basestate]"
return
var/image/I
icon_state = ""
if(on_frame)
for(var/i = 1 to 4)
if(other_connections[i] != "0")
I = image(icon, "[basestate]_other_onframe[connections[i]]", dir = 1<<(i-1))
else
I = image(icon, "[basestate]_onframe[connections[i]]", dir = 1<<(i-1))
overlays += I
else
var/image/I
icon_state = ""
if(on_frame)
for(var/i = 1 to 4)
if(other_connections[i] != "0")
I = image(icon, "[basestate]_other_onframe[connections[i]]", dir = 1<<(i-1))
else
I = image(icon, "[basestate]_onframe[connections[i]]", dir = 1<<(i-1))
overlays += I
else
for(var/i = 1 to 4)
if(other_connections[i] != "0")
I = image(icon, "[basestate]_other[connections[i]]", dir = 1<<(i-1))
else
I = image(icon, "[basestate][connections[i]]", dir = 1<<(i-1))
overlays += I
return
for(var/i = 1 to 4)
if(other_connections[i] != "0")
I = image(icon, "[basestate]_other[connections[i]]", dir = 1<<(i-1))
else
I = image(icon, "[basestate][connections[i]]", dir = 1<<(i-1))
overlays += I
/obj/structure/window/fire_act(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > maximal_heat)
@@ -117,6 +117,8 @@
. = ..()
if(!victim)
return
if(victim.get_helm_skill() == SKILL_PROF)
. = round(. * 0.5)
if(victim.is_still()) //Standing still means less shit flies your way
. = round(. * 0.25)
if(victim.get_speed() < 0.3) //Slow and steady
@@ -169,7 +169,7 @@
//Override will make checks from different location used for prediction
if(location_override)
if(locate(/obj/structure/lattice, location_override) || locate(/obj/structure/catwalk, location_override))
if(locate(/obj/structure/lattice, location_override) || locate(/obj/structure/catwalk, location_override) || locate(/obj/structure/ladder, location_override))
return FALSE
var/turf/below = GetBelow(location_override)
@@ -26,6 +26,8 @@
if(L.allowed_directions & UP)
target_down = L
L.target_up = src
var/turf/T = get_turf(src)
T.ReplaceWithLattice()
return
update_icon()
@@ -91,7 +93,7 @@
instant_climb(M)
/obj/structure/ladder/proc/getTargetLadder(var/mob/M)
if((!target_up && !target_down) || (target_up && !istype(target_up.loc, /turf) || (target_down && !istype(target_down.loc,/turf))))
if((!target_up && !target_down) || (target_up && !istype(target_up.loc, /turf/simulated/open) || (target_down && !istype(target_down.loc, /turf))))
to_chat(M, "<span class='notice'>\The [src] is incomplete and can't be climbed.</span>")
return
if(target_down && target_up)
@@ -8,6 +8,8 @@
var/list/obj/structure/fuel_port/fuel_ports //the fuel ports of the shuttle (but usually just one)
category = /datum/shuttle/autodock/overmap
var/skill_needed = SKILL_BASIC
var/operator_skill = SKILL_MIN
/datum/shuttle/autodock/overmap/New(var/_name, var/obj/effect/shuttle_landmark/start_waypoint)
..(_name, start_waypoint)
@@ -42,10 +44,21 @@
/datum/shuttle/autodock/overmap/can_force()
return ..() && can_go()
/datum/shuttle/autodock/overmap/get_travel_time()
var/distance_mod = get_dist(waypoint_sector(current_location),waypoint_sector(next_location))
var/skill_mod = 0.2*(skill_needed - operator_skill)
return move_time * (1 + distance_mod + skill_mod)
/datum/shuttle/autodock/overmap/process_launch()
if(prob(10*max(0, operator_skill - skill_needed)))
var/places = get_possible_destinations()
var/place = pick(places)
set_destination(places[place])
..()
/datum/shuttle/autodock/overmap/proc/set_destination(var/obj/effect/shuttle_landmark/A)
if(A != current_location)
next_location = A
move_time = initial(move_time) * (1 + get_dist(waypoint_sector(current_location),waypoint_sector(next_location)))
/datum/shuttle/autodock/overmap/proc/get_possible_destinations()
var/list/res = list()
Oops, something went wrong.

0 comments on commit 006736c

Please sign in to comment.