This commit is contained in:
Putnam3145
2022-09-18 16:41:24 -07:00
129 changed files with 4688 additions and 194 deletions
+4
View File
@@ -864,6 +864,10 @@
return SEND_SIGNAL(src, COMSIG_ATOM_EMAG_ACT)
/atom/proc/rad_act(strength)
var/turf/open/pool/PL = get_turf(src)
if(istype(PL))
if(PL.filled == TRUE)
strength *= 0.15
SEND_SIGNAL(src, COMSIG_ATOM_RAD_ACT, strength)
/atom/proc/narsie_act()
@@ -210,10 +210,6 @@
candidates.Remove(candidate_player)
continue
if(ROLE_NO_ANTAGONISM in candidate_player.client.prefs.be_special)
candidates.Remove(candidate_player)
continue
if(antag_flag_override)
if(!(HAS_ANTAG_PREF(candidate_player.client, antag_flag_override)))
candidates.Remove(candidate_player)
@@ -14,8 +14,6 @@
candidates.Remove(P)
else if((exclusive_roles.len > 0) && !(P.mind.assigned_role in exclusive_roles)) // Is the rule exclusive to their job?
candidates.Remove(P)
else if(ROLE_NO_ANTAGONISM in P.client.prefs.be_special)
candidates.Remove(P)
else if(antag_flag_override)
if(!(HAS_ANTAG_PREF(P.client, antag_flag_override)))
candidates.Remove(P)
@@ -46,9 +46,6 @@
if(!mode.check_age(M.client, minimum_required_age))
trimmed_list.Remove(M)
continue
if(ROLE_NO_ANTAGONISM in M.client.prefs.be_special)
trimmed_list.Remove(M)
continue
if(antag_flag_override)
if(!(HAS_ANTAG_PREF(M.client, antag_flag_override)))
trimmed_list.Remove(M)
+9 -31
View File
@@ -348,8 +348,9 @@
var/list/curr_tickets = list() //how many tickets someone has for *this* antag roll, so with the free tickets
var/list/datum/mind/insufficient = list() //who got cucked out of an antag roll due to not having *any* tickets
for(var/datum/mind/M in candidates)
var/weight = clamp(candidates[M], 0, 1)
var/mind_ckey = ckey(M.key)
var/can_spend = min(prev_tickets[mind_ckey], additional_tickets) //they can only spend up to config/max_tickets_per_roll
var/can_spend = min(prev_tickets[mind_ckey], additional_tickets * weight) //they can only spend up to config/max_tickets_per_roll
var/amount = can_spend + free_tickets //but they get config/default_antag_tickets for free
if(amount <= 0) //if they don't have any
insufficient += M //too bad!
@@ -425,10 +426,11 @@
for(var/mob/dead/new_player/player in players)
if(player.client && player.ready == PLAYER_READY_TO_PLAY)
if((role in player.client.prefs.be_special) && !(ROLE_NO_ANTAGONISM in player.client.prefs.be_special))
if(HAS_ANTAG_PREF(player.client, role))
if(!jobban_isbanned(player, ROLE_SYNDICATE) && !QDELETED(player) && !jobban_isbanned(player, role) && !QDELETED(player)) //Nodrak/Carn: Antag Job-bans
if(age_check(player.client)) //Must be older than the minimum age
candidates += player.mind // Get a list of all the people who want to be the antagonist for this round
candidates[player.mind] = player.client.prefs.be_special[role]
if(restricted_jobs)
for(var/datum/mind/player in candidates)
@@ -449,35 +451,11 @@
if(player.assigned_role == job)
drafted -= player
drafted = shuffle(drafted) // Will hopefully increase randomness, Donkie
while(candidates.len < recommended_enemies) // Pick randomlly just the number of people we need and add them to our list of candidates
if(drafted.len > 0)
applicant = pick(drafted)
if(applicant)
candidates += applicant
drafted.Remove(applicant)
else // Not enough scrubs, ABORT ABORT ABORT
break
if(restricted_jobs)
for(var/datum/mind/player in drafted) // Remove people who can't be an antagonist
for(var/job in restricted_jobs)
if(player.assigned_role == job)
drafted -= player
drafted = shuffle(drafted) // Will hopefully increase randomness, Donkie
while(candidates.len < recommended_enemies) // Pick randomlly just the number of people we need and add them to our list of candidates
if(drafted.len > 0)
applicant = pick(drafted)
if(applicant)
candidates += applicant
drafted.Remove(applicant)
else // Not enough scrubs, ABORT ABORT ABORT
break
while(candidates.len < recommended_enemies && length(drafted)) // Pick randomlly just the number of people we need and add them to our list of candidates
applicant = pick_n_take(drafted)
if(applicant)
candidates += applicant
candidates[applicant] = 0
return candidates // Returns: The number of people who had the antagonist role set to yes, regardless of recomended_enemies, if that number is greater than recommended_enemies
// recommended_enemies if the number of people with that role set to yes is less than recomended_enemies,
@@ -100,6 +100,7 @@
var/new_x = text2num(params["x"])
var/new_y = text2num(params["y"])
current_pad.set_offset(new_x, new_y)
current_pad.update_indicator()
. = TRUE
if("move_pos")
var/plus_x = text2num(params["x"])
@@ -108,6 +109,7 @@
x = current_pad.x_offset + plus_x,
y = current_pad.y_offset + plus_y
)
current_pad.update_indicator()
. = TRUE
if("rename")
. = TRUE
@@ -119,12 +121,15 @@
if(usr && alert(usr, "Are you sure?", "Unlink Launchpad", "I'm Sure", "Abort") != "Abort")
launchpads -= current_pad
selected_id = null
current_pad.update_indicator()
. = TRUE
if("launch")
teleport(usr, current_pad, TRUE)
current_pad.update_indicator()
. = TRUE
if("pull")
teleport(usr, current_pad, FALSE)
current_pad.update_indicator()
. = TRUE
. = TRUE
+42
View File
@@ -6,6 +6,7 @@
use_power = TRUE
idle_power_usage = 200
active_power_usage = 2500
hud_possible = list(DIAG_LAUNCHPAD_HUD)
circuit = /obj/item/circuitboard/machine/launchpad
var/icon_teleport = "lpad-beam"
var/stationary = TRUE //to prevent briefcase pad deconstruction and such
@@ -24,6 +25,25 @@
E += M.rating*15
range = E
/obj/machinery/launchpad/Initialize()
. = ..()
prepare_huds()
for(var/datum/atom_hud/data/diagnostic/diag_hud in GLOB.huds)
diag_hud.add_to_hud(src)
var/image/holder = hud_list[DIAG_LAUNCHPAD_HUD]
var/mutable_appearance/MA = new /mutable_appearance()
MA.icon = 'icons/effects/effects.dmi'
MA.icon_state = "launchpad_target"
MA.layer = ABOVE_OPEN_TURF_LAYER
MA.plane = 0
holder.appearance = MA
update_indicator()
/obj/machinery/launchpad/Destroy()
qdel(hud_list[DIAG_LAUNCHPAD_HUD])
return ..()
/obj/machinery/launchpad/examine(mob/user)
. = ..()
if(in_range(user, src) || isobserver(user))
@@ -32,6 +52,7 @@
/obj/machinery/launchpad/attackby(obj/item/I, mob/user, params)
if(stationary)
if(default_deconstruction_screwdriver(user, "lpad-idle-o", "lpad-idle", I))
update_indicator()
return
if(panel_open)
@@ -63,6 +84,17 @@
return FALSE
return TRUE
/obj/machinery/launchpad/proc/update_indicator()
var/image/holder = hud_list[DIAG_LAUNCHPAD_HUD]
var/turf/target_turf
if(isAvailable())
target_turf = locate(x + x_offset, y + y_offset, z)
if(target_turf)
holder.icon_state = indicator_icon
holder.loc = target_turf
else
holder.icon_state = null
/obj/machinery/launchpad/proc/set_offset(x, y)
if(teleporting)
return
@@ -89,11 +121,13 @@
flick(icon_teleport, src)
//Change the indicator's icon to show that we're teleporting
if(sending)
indicator_icon = "launchpad_launch"
else
indicator_icon = "launchpad_pull"
update_indicator()
playsound(get_turf(src), 'sound/weapons/flash.ogg', 25, TRUE)
teleporting = TRUE
@@ -103,6 +137,7 @@
//Set the indicator icon back to normal
indicator_icon = "launchpad_target"
update_indicator()
if(QDELETED(src) || !isAvailable())
return
@@ -213,6 +248,7 @@
if(do_after(usr, 30, target = usr))
usr.put_in_hands(briefcase)
moveToNullspace() //hides it from suitcase contents
update_indicator()
closed = TRUE
/obj/machinery/launchpad/briefcase/attackby(obj/item/I, mob/user, params)
@@ -249,6 +285,7 @@
user.visible_message("<span class='notice'>[user] starts setting down [src]...", "You start setting up [pad]...</span>")
if(do_after(user, 30, target = user))
pad.forceMove(get_turf(src))
pad.update_indicator()
pad.closed = FALSE
user.transferItemToLoc(src, pad, TRUE)
SEND_SIGNAL(src, COMSIG_TRY_STORAGE_HIDE_ALL)
@@ -322,6 +359,7 @@
var/new_x = text2num(params["x"])
var/new_y = text2num(params["y"])
pad.set_offset(new_x, new_y)
pad.update_indicator()
. = TRUE
if("move_pos")
var/plus_x = text2num(params["x"])
@@ -330,6 +368,7 @@
x = pad.x_offset + plus_x,
y = pad.y_offset + plus_y
)
pad.update_indicator()
. = TRUE
if("rename")
. = TRUE
@@ -340,12 +379,15 @@
if("remove")
. = TRUE
if(usr && alert(usr, "Are you sure?", "Unlink Launchpad", "I'm Sure", "Abort") != "Abort")
pad.update_indicator()
pad = null
if("launch")
sending = TRUE
teleport(usr, pad)
pad.update_indicator()
. = TRUE
if("pull")
sending = FALSE
teleport(usr, pad)
pad.update_indicator()
. = TRUE
+112
View File
@@ -0,0 +1,112 @@
//ported from TG, credit to XDTM
/obj/item/swapper
name = "quantum spin inverter"
desc = "An experimental device that is able to swap the locations of two entities by switching their particles' spin values. Must be linked to another device to function."
icon = 'icons/obj/device.dmi'
icon_state = "swapper"
item_state = "electronic"
w_class = WEIGHT_CLASS_SMALL
item_flags = NOBLUDGEON
lefthand_file = 'icons/mob/inhands/misc/devices_lefthand.dmi'
righthand_file = 'icons/mob/inhands/misc/devices_righthand.dmi'
var/cooldown = 300
var/next_use = 0
var/obj/item/swapper/linked_swapper
/obj/item/swapper/Destroy()
if(linked_swapper)
linked_swapper.linked_swapper = null //*inception music*
linked_swapper.update_appearance()
linked_swapper = null
return ..()
/obj/item/swapper/update_icon_state()
icon_state = "swapper[linked_swapper ? "-linked" : null]"
return ..()
/obj/item/swapper/attackby(obj/item/I, mob/user, params)
if(istype(I, /obj/item/swapper))
var/obj/item/swapper/other_swapper = I
if(other_swapper.linked_swapper)
to_chat(user, span_warning("[other_swapper] is already linked. Break the current link to establish a new one."))
return
if(linked_swapper)
to_chat(user, span_warning("[src] is already linked. Break the current link to establish a new one."))
return
to_chat(user, span_notice("You establish a quantum link between the two devices."))
linked_swapper = other_swapper
other_swapper.linked_swapper = src
update_appearance()
linked_swapper.update_appearance()
else
return ..()
/obj/item/swapper/attack_self(mob/living/user)
if(world.time < next_use)
to_chat(user, span_warning("[src] is still recharging."))
return
if(QDELETED(linked_swapper))
to_chat(user, span_warning("[src] is not linked with another swapper."))
return
playsound(src, 'sound/weapons/flash.ogg', 25, TRUE)
to_chat(user, span_notice("You activate [src]."))
playsound(linked_swapper, 'sound/weapons/flash.ogg', 25, TRUE)
if(ismob(linked_swapper.loc))
var/mob/holder = linked_swapper.loc
to_chat(holder, span_notice("[linked_swapper] starts buzzing."))
next_use = world.time + cooldown //only the one used goes on cooldown
addtimer(CALLBACK(src, .proc/swap, user), 25)
/obj/item/swapper/examine(mob/user)
. = ..()
if(world.time < next_use)
. += span_warning("Time left to recharge: [DisplayTimeText(next_use - world.time)].")
if(linked_swapper)
. += span_notice("<b>Linked.</b> Alt-Click to break the quantum link.")
else
. += span_notice("<b>Not Linked.</b> Use on another quantum spin inverter to establish a quantum link.")
/obj/item/swapper/AltClick(mob/living/user)
if(!user.canUseTopic(src, BE_CLOSE, NO_DEXTERY,, FALSE, !iscyborg(user))) //someone mispelled dexterity
return
to_chat(user, span_notice("You break the current quantum link."))
if(!QDELETED(linked_swapper))
linked_swapper.linked_swapper = null
linked_swapper.update_appearance()
linked_swapper = null
update_appearance()
//Gets the topmost teleportable container
/obj/item/swapper/proc/get_teleportable_container()
var/atom/movable/teleportable = src
while(ismovable(teleportable.loc))
var/atom/movable/AM = teleportable.loc
if(AM.anchored)
break
if(isliving(AM))
var/mob/living/L = AM
if(L.buckled)
if(L.buckled.anchored)
break
else
var/obj/buckled_obj = L.buckled
buckled_obj.unbuckle_mob(L)
teleportable = AM
return teleportable
/obj/item/swapper/proc/swap(mob/user)
if(QDELETED(linked_swapper) || world.time < linked_swapper.cooldown)
return
var/atom/movable/A = get_teleportable_container()
var/atom/movable/B = linked_swapper.get_teleportable_container()
var/target_A = A.drop_location()
var/target_B = B.drop_location()
//TODO: add a sound effect or visual effect
if(do_teleport(A, target_B, channel = TELEPORT_CHANNEL_QUANTUM))
do_teleport(B, target_A, channel = TELEPORT_CHANNEL_QUANTUM)
if(ismob(B))
var/mob/M = B
to_chat(M, span_warning("[linked_swapper] activates, and you find yourself somewhere else."))
+32
View File
@@ -494,6 +494,38 @@
title = "Toxins or: How I Learned to Stop Worrying and Love the Maxcap"
page_link = "Guide_to_toxins"
/obj/item/book/manual/wiki/rbmk
name = "\improper Haynes nuclear reactor owner's manual"
icon_state = "bookEngineering2"
author = "CogWerk Engineering Reactor Design Department"
title = "Haynes nuclear reactor owner's manual"
page_link = "Guide_to_the_Nuclear_Reactor"
/obj/item/book/manual/wiki/rbmk/initialize_wikibook()
var/wikiurl = "https://nsv.beestation13.com/wiki"
if(wikiurl)
dat = {"
<html><head>
<meta http-equiv='Content-Type' content='text/html; charset=UTF-8'>
<style>
iframe {
display: none;
}
</style>
</head>
<body>
<script type="text/javascript">
function pageloaded(myframe) {
document.getElementById("loading").style.display = "none";
myframe.style.display = "inline";
}
</script>
<p id='loading'>You start skimming through the manual...</p>
<iframe width='100%' height='97%' onload="pageloaded(this)" src="[wikiurl]/[page_link]?printable=yes&remove_links=1" frameborder="0" id="main_frame"></iframe>
</body>
</html>
"}
/obj/item/book/manual/wiki/toxins/suicide_act(mob/user)
var/mob/living/carbon/human/H = user
user.visible_message("<span class='suicide'>[user] starts dancing to the Rhumba Beat! It looks like [user.p_theyre()] trying to commit suicide!</span>")