This commit is contained in:
vm-silicons
2025-12-19 21:53:57 -08:00
parent ada5c19928
commit c90f9d8a92
38 changed files with 158 additions and 127 deletions
+15 -15
View File
@@ -18,17 +18,17 @@
* * exclude: If we want to avoid a specific turf, like if we're a mulebot who already got blocked by some turf
* * skip_first: Whether or not to delete the first item in the path. This would be done because the first item is the starting tile, which can break movement for some creatures.
*/
/proc/get_path_to(caller, end, max_distance = 30, mintargetdist, id=null, simulated_only = TRUE, turf/exclude, skip_first=TRUE)
if(!caller || !get_turf(end))
/proc/get_path_to(caller1, end, max_distance = 30, mintargetdist, id=null, simulated_only = TRUE, turf/exclude, skip_first=TRUE)
if(!caller1 || !get_turf(end))
return
var/l = SSpathfinder.mobs.getfree(caller)
var/l = SSpathfinder.mobs.getfree(caller1)
while(!l)
stoplag(3)
l = SSpathfinder.mobs.getfree(caller)
l = SSpathfinder.mobs.getfree(caller1)
var/list/path
var/datum/pathfind/pathfind_datum = new(caller, end, id, max_distance, mintargetdist, simulated_only, exclude)
var/datum/pathfind/pathfind_datum = new(caller1, end, id, max_distance, mintargetdist, simulated_only, exclude)
path = pathfind_datum.search()
qdel(pathfind_datum)
@@ -44,7 +44,7 @@
* Note that this can only be used inside the [datum/pathfind][pathfind datum] since it uses variables from said datum.
* If you really want to optimize things, optimize this, cuz this gets called a lot.
*/
#define CAN_STEP(cur_turf, next) (next && !next.density && !(simulated_only && SSpathfinder.space_type_cache[next.type]) && !cur_turf.LinkBlockedWithAccess(next,caller, id) && (next != avoid))
#define CAN_STEP(cur_turf, next) (next && !next.density && !(simulated_only && SSpathfinder.space_type_cache[next.type]) && !cur_turf.LinkBlockedWithAccess(next,caller1, id) && (next != avoid))
/// Another helper macro for JPS, for telling when a node has forced neighbors that need expanding
#define STEP_NOT_HERE_BUT_THERE(cur_turf, dirA, dirB) ((!CAN_STEP(cur_turf, get_step(cur_turf, dirA)) && CAN_STEP(cur_turf, get_step(cur_turf, dirB))))
@@ -97,7 +97,7 @@
/// The datum used to handle the JPS pathfinding, completely self-contained
/datum/pathfind
/// The thing that we're actually trying to path for
var/atom/movable/caller
var/atom/movable/caller1
/// The turf where we started at
var/turf/start
/// The turf we're trying to path to (note that this won't track a moving target)
@@ -121,8 +121,8 @@
/// A specific turf we're avoiding, like if a mulebot is being blocked by someone t-posing in a doorway we're trying to get through
var/turf/avoid
/datum/pathfind/New(atom/movable/caller, atom/goal, id, max_distance, mintargetdist, simulated_only, avoid)
src.caller = caller
/datum/pathfind/New(atom/movable/caller1, atom/goal, id, max_distance, mintargetdist, simulated_only, avoid)
src.caller1 = caller1
end = get_turf(goal)
open = new /datum/heap(/proc/HeapPathWeightCompare)
sources = new()
@@ -139,7 +139,7 @@
* return null, which [/proc/get_path_to] translates to an empty list (notable for simple bots, who need empty lists)
*/
/datum/pathfind/proc/search()
start = get_turf(caller)
start = get_turf(caller1)
if(!start || !end)
stack_trace("Invalid A* start or destination")
return
@@ -155,7 +155,7 @@
//then run the main loop
while(!open.is_empty() && !path)
if(!caller)
if(!caller1)
return
current_processed_node = open.pop() //get the lower f_value turf in the open list
if(max_distance && (current_processed_node.number_tiles > max_distance))//if too many steps, don't process that path
@@ -333,11 +333,11 @@
* For seeing if we can actually move between 2 given turfs while accounting for our access and the caller's pass_flags
*
* Arguments:
* * caller: The movable, if one exists, being used for mobility checks to see what tiles it can reach
* * caller1: The movable, if one exists, being used for mobility checks to see what tiles it can reach
* * ID: An ID card that decides if we can gain access to doors that would otherwise block a turf
* * simulated_only: Do we only worry about turfs with simulated atmos, most notably things that aren't space?
*/
/turf/proc/LinkBlockedWithAccess(turf/destination_turf, caller, ID)
/turf/proc/LinkBlockedWithAccess(turf/destination_turf, caller1, ID)
if(destination_turf.x != x && destination_turf.y != y) //diagonal
var/in_dir = get_dir(destination_turf,src) // eg. northwest (1+8) = 9 (00001001)
var/first_step_direction_a = in_dir & 3 // eg. north (1+8)&3 (0000 0011) = 1 (0000 0001)
@@ -345,7 +345,7 @@
for(var/first_step_direction in list(first_step_direction_a,first_step_direction_b))
var/turf/midstep_turf = get_step(destination_turf,first_step_direction)
var/way_blocked = midstep_turf.density || LinkBlockedWithAccess(midstep_turf,caller,ID) || midstep_turf.LinkBlockedWithAccess(destination_turf,caller,ID)
var/way_blocked = midstep_turf.density || LinkBlockedWithAccess(midstep_turf,caller1,ID) || midstep_turf.LinkBlockedWithAccess(destination_turf,caller1,ID)
if(!way_blocked)
return FALSE
return TRUE
@@ -372,7 +372,7 @@
// Destination blockers check
var/reverse_dir = get_dir(destination_turf, src)
for(var/obj/iter_object in destination_turf)
if(!iter_object.CanAStarPass(ID, reverse_dir, caller))
if(!iter_object.CanAStarPass(ID, reverse_dir, caller1))
return TRUE
return FALSE
+2 -2
View File
@@ -28,10 +28,10 @@
if(!hook_path)
CRASH("Invalid hook '/hook/[hook]' called.")
var/caller = new hook_path
var/caller1 = new hook_path
var/status = 1
for(var/P in typesof("[hook_path]/proc"))
if(!call(caller, P)(arglist(args)))
if(!call(caller1, P)(arglist(args)))
CRASH("Hook '[P]' failed or runtimed.")
return status
+2 -2
View File
@@ -895,13 +895,13 @@
return PreActivate(owner)
/// Intercepts client owner clicks to activate the ability
/datum/action/cooldown/proc/InterceptClickOn(mob/living/caller, params, atom/target)
/datum/action/cooldown/proc/InterceptClickOn(mob/living/, params, atom/target)
if(!IsAvailable())
return FALSE
if(!target)
return FALSE
PreActivate(target)
caller.click_intercept = null
.click_intercept = null
return TRUE
/// For signal calling
+1 -1
View File
@@ -27,10 +27,10 @@
/// Deactivates the functionality defines by the element on the given datum
/datum/element/proc/Detach(datum/source, force)
SHOULD_CALL_PARENT(TRUE)
SIGNAL_HANDLER
SEND_SIGNAL(source, COMSIG_ELEMENT_DETACH, src)
SHOULD_CALL_PARENT(TRUE)
UnregisterSignal(source, COMSIG_PARENT_QDELETING)
/datum/element/Destroy(force)
+2 -2
View File
@@ -35,9 +35,9 @@
var/head_call = FALSE //calls from a head of staff autoconnect, if the receiving pad is not secure.
//creates a holocall made by `caller` from `calling_pad` to `callees`
/datum/holocall/New(mob/living/caller, obj/machinery/holopad/calling_pad, list/callees, elevated_access = FALSE)
/datum/holocall/New(mob/living/, obj/machinery/holopad/calling_pad, list/callees, elevated_access = FALSE)
call_start_time = world.time
user = caller
user =
calling_pad.outgoing_call = src
calling_holopad = calling_pad
head_call = elevated_access
+1 -1
View File
@@ -1295,7 +1295,7 @@
assemblytype = initial(airlock.assemblytype)
update_icon()
/obj/machinery/door/airlock/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
/obj/machinery/door/airlock/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller1)
//Airlock is passable if it is open (!density), bot has access, and is not bolted shut or powered off)
return !density || (check_access(ID) && !locked && hasPower())
+1 -1
View File
@@ -264,7 +264,7 @@ Possible to do for anyone motivated enough:
for(var/I in holo_calls)
var/datum/holocall/HC = I
var/list/call_data = list(
caller = HC.user,
= HC.user,
connected = HC.connected_holopad == src ? TRUE : FALSE,
ref = REF(HC)
)
@@ -725,13 +725,13 @@ DEFINE_BITFIELD(turret_flags, list(
remote_controller = null
return TRUE
/obj/machinery/porta_turret/proc/InterceptClickOn(mob/living/caller, params, atom/A)
/obj/machinery/porta_turret/proc/InterceptClickOn(mob/living/caller1, params, atom/A)
if(!manual_control)
return FALSE
if(!can_interact(caller))
if(!can_interact(caller1))
remove_control()
return FALSE
log_combat(caller,A,"fired with manual turret control at")
log_combat(caller1,A,"fired with manual turret control at")
target(A)
return TRUE
+4 -4
View File
@@ -261,11 +261,11 @@
* Arguments:
* * ID- An ID card representing what access we have (and thus if we can open things like airlocks or windows to pass through them). The ID card's physical location does not matter, just the reference
* * to_dir- What direction we're trying to move in, relevant for things like directional windows that only block movement in certain directions
* * caller- The movable we're checking pass flags for, if we're making any such checks
* * caller1- The movable we're checking pass flags for, if we're making any such checks
**/
/obj/proc/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
if(ismovable(caller))
var/atom/movable/AM = caller
/obj/proc/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller1)
if(ismovable(caller1))
var/atom/movable/AM = caller1
if(AM.pass_flags & pass_flags_self)
return TRUE
. = !density
+3 -3
View File
@@ -301,10 +301,10 @@
if((mover.pass_flags & PASSGRILLE) || istype(mover, /obj/item/projectile))
return prob(girderpasschance)
/obj/structure/girder/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
/obj/structure/girder/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller1)
. = !density
if(istype(caller))
. = . || (caller.pass_flags & PASSGRILLE)
if(istype(caller1))
. = . || (caller1.pass_flags & PASSGRILLE)
/obj/structure/girder/deconstruct(disassembled = TRUE)
if(!(flags_1 & NODECONSTRUCT_1))
+3 -3
View File
@@ -130,10 +130,10 @@
if(!. && istype(mover, /obj/item/projectile))
return prob(30)
/obj/structure/grille/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
/obj/structure/grille/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller1)
. = !density
if(istype(caller))
. = . || (caller.pass_flags & PASSGRILLE)
if(istype(caller1))
. = . || (caller1.pass_flags & PASSGRILLE)
/obj/structure/grille/attackby(obj/item/W, mob/user, params)
user.DelayNextAction(CLICK_CD_MELEE)
+3 -3
View File
@@ -385,7 +385,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
else
return FALSE
/obj/structure/tray/m_tray/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
/obj/structure/tray/m_tray/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller1)
. = !density
if(istype(caller))
. = . || (caller.pass_flags & PASSTABLE)
if(istype(caller1))
. = . || (caller1.pass_flags & PASSTABLE)
+7 -7
View File
@@ -56,17 +56,17 @@
return FALSE
return TRUE
/obj/structure/plasticflaps/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
if(isliving(caller))
if(isbot(caller))
/obj/structure/plasticflaps/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller1)
if(isliving(caller1))
if(isbot(caller1))
return TRUE
var/mob/living/living_caller = caller
if(!(SEND_SIGNAL(living_caller, COMSIG_CHECK_VENTCRAWL)) && living_caller.mob_size != MOB_SIZE_TINY)
var/mob/living/living_caller1 = caller1
if(!(SEND_SIGNAL(living_caller1, COMSIG_CHECK_VENTCRAWL)) && living_caller1.mob_size != MOB_SIZE_TINY)
return FALSE
if(caller?.pulling)
return CanAStarPass(ID, to_dir, caller.pulling)
if(caller1?.pulling)
return CanAStarPass(ID, to_dir, caller1.pulling)
return TRUE //diseases, stings, etc can pass
/obj/structure/plasticflaps/CanAllowThrough(atom/movable/A, turf/T)
+6 -6
View File
@@ -118,10 +118,10 @@
if(locate(/obj/structure/table) in get_turf(mover))
return TRUE
/obj/structure/table/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
/obj/structure/table/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller1)
. = !density
if(istype(caller))
. = . || (caller.pass_flags & PASSTABLE)
if(istype(caller1))
. = . || (caller1.pass_flags & PASSTABLE)
/obj/structure/table/proc/tableplace(mob/living/user, mob/living/pushed_mob)
pushed_mob.forceMove(loc)
@@ -747,10 +747,10 @@
else
return FALSE
/obj/structure/rack/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
/obj/structure/rack/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller1)
. = !density
if(istype(caller))
. = . || (caller.pass_flags & PASSTABLE)
if(istype(caller1))
. = . || (caller1.pass_flags & PASSTABLE)
/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
. = ..()
+1 -1
View File
@@ -570,7 +570,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
/obj/structure/window/get_dumping_location(obj/item/storage/source,mob/user)
return null
/obj/structure/window/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
/obj/structure/window/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/)
if(!density)
return TRUE
if((dir == FULLTILE_WINDOW_DIR) || (dir == to_dir))
+2 -2
View File
@@ -634,7 +634,7 @@ GLOBAL_LIST_EMPTY(station_turfs)
* * ID: An ID card that decides if we can gain access to doors that would otherwise block a turf
* * simulated_only: Do we only worry about turfs with simulated atmos, most notably things that aren't space?
*/
/turf/proc/reachableAdjacentTurfs(caller, ID, simulated_only)
/turf/proc/reachableAdjacentTurfs(, ID, simulated_only)
var/static/space_type_cache = typecacheof(/turf/open/space)
. = list()
@@ -642,6 +642,6 @@ GLOBAL_LIST_EMPTY(station_turfs)
var/turf/turf_to_check = get_step(src,iter_dir)
if(!turf_to_check || (simulated_only && space_type_cache[turf_to_check.type]))
continue
if(turf_to_check.density || LinkBlockedWithAccess(turf_to_check, caller, ID))
if(turf_to_check.density || LinkBlockedWithAccess(turf_to_check, , ID))
continue
. += turf_to_check
@@ -71,10 +71,10 @@
/obj/structure/blob/CanAtmosPass(turf/T)
return !atmosblock
/obj/structure/blob/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/caller)
/obj/structure/blob/CanAStarPass(obj/item/card/id/ID, to_dir, atom/movable/)
. = FALSE
if(istype(caller))
. = . || (caller.pass_flags & PASSBLOB)
if(istype())
. = . || (.pass_flags & PASSBLOB)
/obj/structure/blob/update_icon() //Updates color based on overmind color if we have an overmind.
. = ..()
@@ -266,5 +266,5 @@
..()
linked_power.DeactivatePower()
/obj/effect/proc_holder/bloodsucker/InterceptClickOn(mob/living/caller, params, atom/A)
/obj/effect/proc_holder/bloodsucker/InterceptClickOn(mob/living/, params, atom/A)
return linked_power.ClickWithPower(A)
@@ -14,7 +14,7 @@
finished = TRUE
QDEL_IN(src, 6)
/obj/effect/proc_holder/slab/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/slab/InterceptClickOn(mob/living/caller1, params, atom/target)
if(..() || in_progress)
return TRUE
if(ranged_ability_user.incapacitated() || !slab || !(slab in ranged_ability_user.held_items) || target == slab)
@@ -24,7 +24,7 @@
//For the Hateful Manacles scripture; applies replicant handcuffs to the target.
/obj/effect/proc_holder/slab/hateful_manacles
/obj/effect/proc_holder/slab/hateful_manacles/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/slab/hateful_manacles/InterceptClickOn(mob/living/caller1, params, atom/target)
if(..())
return TRUE
@@ -79,7 +79,7 @@
/obj/effect/proc_holder/slab/compromise
ranged_mousepointer = 'icons/effects/compromise_target.dmi'
/obj/effect/proc_holder/slab/compromise/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/slab/compromise/InterceptClickOn(mob/living/caller1, params, atom/target)
if(..())
return TRUE
@@ -138,7 +138,7 @@
/obj/effect/proc_holder/slab/volt
ranged_mousepointer = 'icons/effects/volt_target.dmi'
/obj/effect/proc_holder/slab/volt/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/slab/volt/InterceptClickOn(mob/living/caller1, params, atom/target)
if(target == slab || ..()) //we can't cancel
return TRUE
@@ -161,7 +161,7 @@
/obj/effect/proc_holder/slab/kindle
ranged_mousepointer = 'icons/effects/volt_target.dmi'
/obj/effect/proc_holder/slab/kindle/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/slab/kindle/InterceptClickOn(mob/living/caller1, params, atom/target)
if(..())
return TRUE
@@ -179,7 +179,7 @@
log_combat(ranged_ability_user, U, "fired at with Kindle")
playsound(ranged_ability_user, 'sound/magic/blink.ogg', 50, TRUE, frequency = 0.5)
var/obj/item/projectile/kindle/A = new(T)
A.preparePixelProjectile(target, caller, params)
A.preparePixelProjectile(target, caller1, params)
A.fire()
remove_ranged_ability()
@@ -243,7 +243,7 @@
/obj/effect/proc_holder/slab/vanguard
ranged_mousepointer = 'icons/effects/vanguard_target.dmi'
/obj/effect/proc_holder/slab/vanguard/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/slab/vanguard/InterceptClickOn(mob/living/caller1, params, atom/target)
if(..())
return TRUE
@@ -286,7 +286,7 @@
/obj/effect/proc_holder/slab/judicial
ranged_mousepointer = 'icons/effects/visor_reticule.dmi'
/obj/effect/proc_holder/slab/judicial/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/slab/judicial/InterceptClickOn(mob/living/caller1, params, atom/target)
if(..())
return TRUE
@@ -112,7 +112,7 @@
message = "<span class='brass'><i>You harness [visor]'s power.</i> <b>Left-click to place a judicial marker!</b></span>"
add_ranged_ability(user, message)
/obj/effect/proc_holder/judicial_visor/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/judicial_visor/InterceptClickOn(mob/living/, params, atom/target)
if(..())
return
if(ranged_ability_user.incapacitated() || !visor || visor != ranged_ability_user.get_item_by_slot(ITEM_SLOT_EYES))
+2 -2
View File
@@ -252,10 +252,10 @@
else
add_ranged_ability(user, "<span class='cult'>You prepare to horrify a target...</span>")
/obj/effect/proc_holder/horror/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/horror/InterceptClickOn(mob/living/, params, atom/target)
if(..())
return
if(ranged_ability_user.incapacitated() || !iscultist(caller))
if(ranged_ability_user.incapacitated() || !iscultist())
remove_ranged_ability()
return
var/turf/T = get_turf(ranged_ability_user)
+6 -6
View File
@@ -256,7 +256,7 @@
else
add_ranged_ability(user, "<span class='cult'>You prepare to mark a target for your cult...</span>")
/obj/effect/proc_holder/cultmark/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/cultmark/InterceptClickOn(mob/living/, params, atom/target)
if(..())
return
if(ranged_ability_user.incapacitated())
@@ -266,7 +266,7 @@
if(!isturf(T))
return FALSE
var/datum/antagonist/cult/C = caller.mind.has_antag_datum(/datum/antagonist/cult,TRUE)
var/datum/antagonist/cult/C = .mind.has_antag_datum(/datum/antagonist/cult,TRUE)
if(!C.cult_team)
to_chat(ranged_ability_user, "<span class='cultlarge'>What is the point of marking a target for yourself?</span>")
remove_ranged_ability()
@@ -437,7 +437,7 @@
else
add_ranged_ability(user, "<span class='cult'>You prepare to tear through the fabric of reality...</span>")
/obj/effect/proc_holder/pulse/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/pulse/InterceptClickOn(mob/living/, params, atom/target)
if(..())
return
if(ranged_ability_user.incapacitated())
@@ -447,7 +447,7 @@
if(!isturf(T))
return FALSE
if(target in view(7, get_turf(ranged_ability_user)))
if((!(iscultist(target) || istype(target, /obj/structure/destructible/cult)) || target == caller) && !(attached_action.throwing))
if((!(iscultist(target) || istype(target, /obj/structure/destructible/cult)) || target == ) && !(attached_action.throwing))
return
if(!attached_action.throwing)
attached_action.throwing = TRUE
@@ -467,5 +467,5 @@
attached_action.throwing = FALSE
attached_action.cooldown = world.time + attached_action.base_cooldown
remove_ranged_ability("<span class='cult'>A pulse of blood magic surges through you as you shift [attached_action.throwee] through time and space.</span>")
caller.update_action_buttons_icon()
addtimer(CALLBACK(caller, TYPE_PROC_REF(/mob, update_action_buttons_icon)), attached_action.base_cooldown)
.update_action_buttons_icon()
addtimer(CALLBACK(, TYPE_PROC_REF(/mob, update_action_buttons_icon)), attached_action.base_cooldown)
@@ -147,9 +147,9 @@
*
* Automatically creates more reality smashes
*/
/datum/reality_smash_tracker/proc/Generate(mob/caller)
if(istype(caller))
targets += caller
/datum/reality_smash_tracker/proc/Generate(mob/)
if(istype())
targets +=
var/targ_len = length(targets)
var/smash_len = length(smashes)
var/number = max(targ_len * (6-(targ_len-1)) - smash_len,1)
@@ -597,7 +597,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
enable_text = "<span class='notice'>You tap into the station's powernet. Click on a machine to detonate it, or use the ability again to cancel.</span>"
disable_text = "<span class='notice'>You release your hold on the powernet.</span>"
/obj/effect/proc_holder/ranged_ai/overload_machine/InterceptClickOn(mob/living/caller, params, obj/machinery/target)
/obj/effect/proc_holder/ranged_ai/overload_machine/InterceptClickOn(mob/living/, params, obj/machinery/target)
if(..())
return
if(ranged_ability_user.incapacitated())
@@ -644,7 +644,7 @@ GLOBAL_LIST_INIT(blacklisted_malf_machines, typecacheof(list(
enable_text = "<span class='notice'>You tap into the station's powernet. Click on a machine to animate it, or use the ability again to cancel.</span>"
disable_text = "<span class='notice'>You release your hold on the powernet.</span>"
/obj/effect/proc_holder/ranged_ai/override_machine/InterceptClickOn(mob/living/caller, params, obj/machinery/target)
/obj/effect/proc_holder/ranged_ai/override_machine/InterceptClickOn(mob/living/, params, obj/machinery/target)
if(..())
return
if(ranged_ability_user.incapacitated())
+1 -1
View File
@@ -367,7 +367,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
if(character_settings_tab == LOADOUT_CHAR_TAB) //if loadout
//calculate your gear points from the chosen item
gear_points = CONFIG_GET(number/initial_gear_points)
var/list/chosen_gear = loadout_data["SAVE_[loadout_slot]"]
var/list/chosen_gear = loadout_data?["SAVE_[loadout_slot]"]
if(islist(chosen_gear))
loadout_errors = 0
for(var/loadout_item in chosen_gear)
+1 -1
View File
@@ -1,7 +1,7 @@
//Vars that will not be copied when using /DuplicateObject
GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
"tag", "datum_components", "area", "type", "loc", "locs", "vars", "parent", "parent_type", "verbs", "ckey", "key",
"power_supply", "contents", "reagents", "stat", "x", "y", "z", "group", "atmos_adjacent_turfs", "comp_lookup"
"power_supply", "contents", "reagents", "stat", "x", "y", "z", "group", "atmos_adjacent_turfs", "comp_lookup", "pixloc"
))
GLOBAL_LIST_INIT(duplicate_forbidden_vars_by_type, typecacheof_assoc_list(list(
+1 -1
View File
@@ -180,7 +180,7 @@
var/obj/effect/holodeck_effect/HE = e
HE.tick()
active_power_usage = 50 + spawned.len * 3 + effects.len * 5
active_power_usage = 50 + spawned?.len * 3 + effects?.len * 5
/obj/machinery/computer/holodeck/emag_act(mob/user)
. = ..()
@@ -203,7 +203,7 @@ Doesn't work on other aliens/AI.*/
action.button_icon_state = "alien_neurotoxin_[active]"
action.UpdateButtons()
/obj/effect/proc_holder/alien/neurotoxin/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/alien/neurotoxin/InterceptClickOn(mob/living/, params, atom/target)
if(..())
return
var/p_cost = 50
@@ -543,7 +543,7 @@ Pass a positive integer as an argument to override a bot's default speed.
if(mode != BOT_SUMMON && mode != BOT_RESPONDING)
access_card.access = prev_access
/mob/living/simple_animal/bot/proc/call_bot(caller, turf/waypoint, message=TRUE)
/mob/living/simple_animal/bot/proc/call_bot(, turf/waypoint, message=TRUE)
bot_reset() //Reset a bot before setting it to call mode.
//For giving the bot temporary all-access.
@@ -552,7 +552,7 @@ Pass a positive integer as an argument to override a bot's default speed.
all_access.access = All.get_access()
set_path(get_path_to(src, waypoint, 200, id=all_access))
calling_ai = caller //Link the AI to the bot!
calling_ai = //Link the AI to the bot!
ai_waypoint = waypoint
if(path && path.len) //Ensures that a valid path is calculated!
@@ -562,7 +562,7 @@ Pass a positive integer as an argument to override a bot's default speed.
access_card = all_access //Give the bot all-access while under the AI's command.
if(client)
reset_access_timer_id = addtimer(CALLBACK (src, PROC_REF(bot_reset)), 600, TIMER_UNIQUE|TIMER_OVERRIDE|TIMER_STOPPABLE) //if the bot is player controlled, they get the extra access for a limited time
to_chat(src, "<span class='notice'><span class='big'>Priority waypoint set by [icon2html(calling_ai, src)] <b>[caller]</b>. Proceed to <b>[end_area]</b>.</span><br>[path.len-1] meters to destination. You have been granted additional door access for 60 seconds.</span>")
to_chat(src, "<span class='notice'><span class='big'>Priority waypoint set by [icon2html(calling_ai, src)] <b>[]</b>. Proceed to <b>[end_area]</b>.</span><br>[path.len-1] meters to destination. You have been granted additional door access for 60 seconds.</span>")
if(message)
to_chat(calling_ai, "<span class='notice'>[icon2html(src, calling_ai)] [name] called to [end_area]. [path.len-1] meters to destination.</span>")
pathset = 1
@@ -421,7 +421,7 @@
add_ranged_ability(user, message, TRUE)
return TRUE
/obj/effect/proc_holder/wrap/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/wrap/InterceptClickOn(mob/living/, params, atom/target)
if(..())
return
if(ranged_ability_user.incapacitated() || !istype(ranged_ability_user, /mob/living/simple_animal/hostile/poison/giant_spider/nurse))
@@ -307,14 +307,14 @@
* The message that the program wishes to display.
*/
/obj/item/modular_computer/proc/alert_call(datum/computer_file/program/caller, alerttext, sound = 'sound/machines/twobeep_high.ogg')
if(!caller || !caller.alert_able || caller.alert_silenced || !alerttext) //Yeah, we're checking alert_able. No, you don't get to make alerts that the user can't silence.
/obj/item/modular_computer/proc/alert_call(datum/computer_file/program/, alerttext, sound = 'sound/machines/twobeep_high.ogg')
if(! || !.alert_able || .alert_silenced || !alerttext) //Yeah, we're checking alert_able. No, you don't get to make alerts that the user can't silence.
return
playsound(src, sound, 50, TRUE)
visible_message(span_notice("The [src] displays a [caller.filedesc] notification: [alerttext]"))
visible_message(span_notice("The [src] displays a [.filedesc] notification: [alerttext]"))
var/mob/living/holder = loc
if(istype(holder))
to_chat(holder, "[icon2html(src)] [span_notice("The [src] displays a [caller.filedesc] notification: [alerttext]")]")
to_chat(holder, "[icon2html(src)] [span_notice("The [src] displays a [.filedesc] notification: [alerttext]")]")
// Function used by NanoUI's to obtain data for header. All relevant entries begin with "PC_"
/obj/item/modular_computer/proc/get_header_data()
@@ -53,8 +53,8 @@
/obj/item/modular_computer/processor/attack_ghost(mob/user)
ui_interact(user)
/obj/item/modular_computer/processor/alert_call(datum/computer_file/program/caller, alerttext)
if(!caller || !caller.alert_able || caller.alert_silenced || !alerttext)
/obj/item/modular_computer/processor/alert_call(datum/computer_file/program/, alerttext)
if(! || !.alert_able || .alert_silenced || !alerttext)
return
playsound(src, 'sound/machines/twobeep_high.ogg', 50, TRUE)
machinery_computer.visible_message(span_notice("The [src] displays a [caller.filedesc] notification: [alerttext]"))
machinery_computer.visible_message(span_notice("The [src] displays a [.filedesc] notification: [alerttext]"))
@@ -225,11 +225,11 @@
borgo.toggle_headlamp(FALSE, TRUE)
return TRUE
/obj/item/modular_computer/tablet/integrated/alert_call(datum/computer_file/program/caller, alerttext, sound = 'sound/machines/twobeep_high.ogg')
if(!caller || !caller.alert_able || caller.alert_silenced || !alerttext) //Yeah, we're checking alert_able. No, you don't get to make alerts that the user can't silence.
/obj/item/modular_computer/tablet/integrated/alert_call(datum/computer_file/program/, alerttext, sound = 'sound/machines/twobeep_high.ogg')
if(! || !.alert_able || .alert_silenced || !alerttext) //Yeah, we're checking alert_able. No, you don't get to make alerts that the user can't silence.
return
borgo.playsound_local(src, sound, 50, TRUE)
to_chat(borgo, span_notice("The [src] displays a [caller.filedesc] notification: [alerttext]"))
to_chat(borgo, span_notice("The [src] displays a [.filedesc] notification: [alerttext]"))
/obj/item/modular_computer/tablet/integrated/syndicate
+4 -4
View File
@@ -52,10 +52,10 @@ GLOBAL_LIST_INIT(spells, typesof(/obj/effect/proc_holder/spell)) //needed for th
/obj/effect/proc_holder/proc/Trigger(mob/user)
return TRUE
/obj/effect/proc_holder/proc/InterceptClickOn(mob/living/caller, params, atom/A)
if(caller.ranged_ability != src || ranged_ability_user != caller) //I'm not actually sure how these would trigger, but, uh, safety, I guess?
to_chat(caller, "<span class='warning'><b>[caller.ranged_ability.name]</b> has been disabled.</span>")
caller.ranged_ability.remove_ranged_ability()
/obj/effect/proc_holder/proc/InterceptClickOn(mob/living/, params, atom/A)
if(.ranged_ability != src || ranged_ability_user != ) //I'm not actually sure how these would trigger, but, uh, safety, I guess?
to_chat(, "<span class='warning'><b>[.ranged_ability.name]</b> has been disabled.</span>")
.ranged_ability.remove_ranged_ability()
return TRUE //TRUE for failed, FALSE for passed.
return FALSE
+1 -1
View File
@@ -46,7 +46,7 @@
action.button_icon_state = "[base_icon_state][active]"
action.UpdateButtons()
/obj/effect/proc_holder/spell/aimed/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/spell/aimed/InterceptClickOn(mob/living/, params, atom/target)
if(..())
return FALSE
var/ran_out = (current_amount <= 0)
@@ -66,21 +66,21 @@
action.button_icon_state = "[action_icon_state]"
action.UpdateButtons()
/obj/effect/proc_holder/spell/pointed/InterceptClickOn(mob/living/caller, params, atom/target)
/obj/effect/proc_holder/spell/pointed/InterceptClickOn(mob/living/, params, atom/target)
if(..())
return TRUE
if(aim_assist && isturf(target))
var/list/possible_targets = list()
for(var/A in target)
if(intercept_check(caller, A, TRUE))
if(intercept_check(, A, TRUE))
possible_targets += A
if(possible_targets.len == 1)
target = possible_targets[1]
if(!intercept_check(caller, target))
if(!intercept_check(, target))
return TRUE
if(!cast_check(FALSE, caller))
if(!cast_check(FALSE, ))
return TRUE
perform(list(target), user = caller)
perform(list(target), user = )
remove_ranged_ability()
return TRUE // Do not do any underlying actions after the spell cast
+2 -2
View File
@@ -46,10 +46,10 @@ The hooks you're calling should return nonzero values on success.
if(!hook_path)
CRASH("hook_vr: Invalid hook '/hook/[hook]' called.")
var/caller = new hook_path
var/caller1 = new hook_path
var/status = 1
for(var/P in typesof("[hook_path]/proc"))
if(!call(caller, P)(arglist(args)))
if(!call(caller1, P)(arglist(args)))
stack_trace("hook_vr: Hook '[P]' failed or runtimed.")
status = 0
+46 -15
View File
@@ -60,7 +60,10 @@ const getDmPath = async () => {
/**
* @param {string} dmeFile
* @param {{ defines?: string[] }} options
* @param {{
* defines?: string[];
* warningsAsErrors?: boolean;
* }} options
*/
export const DreamMaker = async (dmeFile, options = {}) => {
const dmPath = await getDmPath();
@@ -85,31 +88,59 @@ export const DreamMaker = async (dmeFile, options = {}) => {
};
testOutputFile(`${dmeBaseName}.dmb`);
testOutputFile(`${dmeBaseName}.rsc`);
const runWithWarningChecks = async (dmeFile, args) => {
const execReturn = await Juke.exec(dmeFile, args);
if (options.warningsAsErrors) {
const ignoredWarningCodes = options.ignoreWarningCodes ?? [];
if (ignoredWarningCodes.length > 0) {
Juke.logger.info(
"Ignored warning codes:",
ignoredWarningCodes.join(", ")
);
}
const base_regex = "\\d+:warning( \\([a-z_]*\\))?:";
const with_ignores = `\\d+:warning( \\([a-z_]*\\))?:(?!(${ignoredWarningCodes
.map((x) => `.*${x}.*$`)
.join("|")}))`;
const reg =
ignoredWarningCodes.length > 0
? new RegExp(with_ignores, "m")
: new RegExp(base_regex, "m");
if (options.warningsAsErrors && execReturn.combined.match(reg)) {
Juke.logger.error(`Compile warnings treated as errors`);
throw new Juke.ExitCode(2);
}
}
return execReturn;
}
// Compile
const { defines } = options;
if (defines && defines.length > 0) {
const injectedContent = defines
.map(x => `#define ${x}\n`)
.join('');
fs.writeFileSync(`${dmeBaseName}.m.dme`, injectedContent);
const dmeContent = fs.readFileSync(`${dmeBaseName}.dme`);
fs.appendFileSync(`${dmeBaseName}.m.dme`, dmeContent);
await Juke.exec(dmPath, [`${dmeBaseName}.m.dme`]);
fs.writeFileSync(`${dmeBaseName}.dmb`, fs.readFileSync(`${dmeBaseName}.m.dmb`));
fs.writeFileSync(`${dmeBaseName}.rsc`, fs.readFileSync(`${dmeBaseName}.m.rsc`));
fs.unlinkSync(`${dmeBaseName}.m.dmb`);
fs.unlinkSync(`${dmeBaseName}.m.rsc`);
fs.unlinkSync(`${dmeBaseName}.m.dme`);
Juke.logger.info('Using defines:', defines.join(', '));
try {
const injectedContent = defines
.map(x => `#define ${x}\n`)
.join('');
fs.writeFileSync(`${dmeBaseName}.m.dme`, injectedContent);
const dmeContent = fs.readFileSync(`${dmeBaseName}.dme`);
fs.appendFileSync(`${dmeBaseName}.m.dme`, dmeContent);
await runWithWarningChecks(dmPath, [`${dmeBaseName}.m.dme`]);
fs.writeFileSync(`${dmeBaseName}.dmb`, fs.readFileSync(`${dmeBaseName}.m.dmb`));
fs.writeFileSync(`${dmeBaseName}.rsc`, fs.readFileSync(`${dmeBaseName}.m.rsc`));
}
finally {
Juke.rm(`${dmeBaseName}.m.*`);
}
}
else {
await Juke.exec(dmPath, [dmeFile]);
await runWithWarningChecks(dmPath, [dmeFile]);
}
};
export const DreamDaemon = async (dmbFile, ...args) => {
const dmPath = await getDmPath();
const baseDir = path.dirname(dmPath);
const ddExeName = process.platform === 'win32' ? 'dd.exe' : 'DreamDaemon';
const ddExeName = process.platform === 'win32' ? 'dreamdaemon.exe' : 'DreamDaemon';
const ddExePath = baseDir === '.' ? ddExeName : path.join(baseDir, ddExeName);
return Juke.exec(ddExePath, [dmbFile, ...args]);
};