[DNM][DNM][WIP] Projectile backend code port and update
Ports#54924, #65061, #59804 from /tg. adds auxiliary code from /tg to make code work.
This commit is contained in:
@@ -97,11 +97,6 @@
|
||||
/obj/structure/alien/resin/attack_paw(mob/user)
|
||||
return attack_hand(user)
|
||||
|
||||
|
||||
/obj/structure/alien/resin/CanPass(atom/movable/mover, turf/target)
|
||||
return !density
|
||||
|
||||
|
||||
/*
|
||||
* Weeds
|
||||
*/
|
||||
|
||||
@@ -110,10 +110,10 @@
|
||||
if(HAS_TRAIT(user, TRAIT_SKITTISH))
|
||||
. += "<span class='notice'>If you bump into [p_them()] while running, you will jump inside.</span>"
|
||||
|
||||
/obj/structure/closet/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/structure/closet/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(wall_mounted)
|
||||
return TRUE
|
||||
return !density
|
||||
|
||||
/obj/structure/closet/proc/can_open(mob/living/user, force = FALSE)
|
||||
if(force)
|
||||
|
||||
@@ -26,15 +26,15 @@
|
||||
// AddElement(/datum/element/climbable, climb_time = crate_climb_time, climb_stun = 0)
|
||||
update_icon()
|
||||
|
||||
/obj/structure/closet/crate/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/structure/closet/crate/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(!istype(mover, /obj/structure/closet))
|
||||
var/obj/structure/closet/crate/locatedcrate = locate(/obj/structure/closet/crate) in get_turf(mover)
|
||||
if(locatedcrate) //you can walk on it like tables, if you're not in an open crate trying to move to a closed crate
|
||||
if(opened) //if we're open, allow entering regardless of located crate openness
|
||||
return 1
|
||||
return TRUE
|
||||
if(!locatedcrate.opened) //otherwise, if the located crate is closed, allow entering
|
||||
return 1
|
||||
return !density
|
||||
return TRUE
|
||||
|
||||
/obj/structure/closet/crate/update_icon_state()
|
||||
icon_state = "[initial(icon_state)][opened ? "open" : ""]"
|
||||
|
||||
@@ -296,14 +296,10 @@
|
||||
qdel(src)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/girder/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGRILLE))
|
||||
/obj/structure/girder/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if((mover.pass_flags & PASSGRILLE) || istype(mover, /obj/projectile))
|
||||
return prob(girderpasschance)
|
||||
else
|
||||
if(istype(mover, /obj/item/projectile))
|
||||
return prob(girderpasschance)
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/girder/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
|
||||
@@ -5,6 +5,7 @@
|
||||
icon_state = "grille"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
pass_flags_self = PASSGRILLE
|
||||
flags_1 = CONDUCT_1
|
||||
pressure_resistance = 5*ONE_ATMOSPHERE
|
||||
layer = BELOW_OBJ_LAYER
|
||||
@@ -124,14 +125,10 @@
|
||||
if(!shock(user, 70))
|
||||
take_damage(20, BRUTE, "melee", 1)
|
||||
|
||||
/obj/structure/grille/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGRILLE))
|
||||
return TRUE
|
||||
else
|
||||
if(istype(mover, /obj/item/projectile) && density)
|
||||
return prob(30)
|
||||
else
|
||||
return !density
|
||||
/obj/structure/grille/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(!. && istype(mover, /obj/projectile))
|
||||
return prob(30)
|
||||
|
||||
/obj/structure/grille/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
|
||||
@@ -51,20 +51,19 @@
|
||||
name = "holo barrier"
|
||||
desc = "A short holographic barrier which can only be passed by walking."
|
||||
icon_state = "holosign_sec"
|
||||
pass_flags = LETPASSTHROW
|
||||
pass_flags_self = PASSTABLE | PASSGRILLE | PASSGLASS | LETPASSTHROW
|
||||
density = TRUE
|
||||
max_integrity = 20
|
||||
var/allow_walk = 1 //can we pass through it on walk intent
|
||||
|
||||
/obj/structure/holosign/barrier/CanPass(atom/movable/mover, turf/target)
|
||||
if(!density)
|
||||
return 1
|
||||
if(mover.pass_flags & (PASSGLASS|PASSTABLE|PASSGRILLE))
|
||||
return 1
|
||||
/obj/structure/holosign/barrier/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(iscarbon(mover))
|
||||
var/mob/living/carbon/C = mover
|
||||
if(allow_walk && C.m_intent == MOVE_INTENT_WALK)
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
/obj/structure/holosign/barrier/engineering
|
||||
icon_state = "holosign_engi"
|
||||
@@ -149,22 +148,27 @@
|
||||
. = ..()
|
||||
. += "<span class='notice'>The biometric scanners are <b>[force_allaccess ? "off" : "on"]</b>.</span>"
|
||||
|
||||
/obj/structure/holosign/barrier/medical/CanPass(atom/movable/mover, turf/target)
|
||||
icon_state = "holo_medical"
|
||||
/obj/structure/holosign/barrier/medical/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(force_allaccess)
|
||||
return TRUE
|
||||
if(ishuman(mover))
|
||||
var/mob/living/carbon/human/sickboi = mover
|
||||
var/threat = sickboi.check_virus()
|
||||
switch(threat)
|
||||
if(DISEASE_SEVERITY_MINOR, DISEASE_SEVERITY_MEDIUM, DISEASE_SEVERITY_HARMFUL, DISEASE_SEVERITY_DANGEROUS, DISEASE_SEVERITY_BIOHAZARD)
|
||||
if(buzzcd < world.time)
|
||||
playsound(get_turf(src),'sound/machines/buzz-sigh.ogg',65,1,4)
|
||||
buzzcd = (world.time + 60)
|
||||
icon_state = "holo_medical-deny"
|
||||
return FALSE
|
||||
else
|
||||
return TRUE //nice or benign diseases!
|
||||
|
||||
return CheckHuman(mover)
|
||||
|
||||
/obj/structure/holosign/barrier/medical/Bumped(atom/movable/AM)
|
||||
. = ..()
|
||||
icon_state = "holo_medical"
|
||||
if(ishuman(AM) && !CheckHuman(AM))
|
||||
if(buzzcd < world.time)
|
||||
playsound(get_turf(src),'sound/machines/buzz-sigh.ogg',65,TRUE,4)
|
||||
buzzcd = (world.time + 60)
|
||||
icon_state = "holo_medical-deny"
|
||||
|
||||
/obj/structure/holosign/barrier/medical/proc/CheckHuman(mob/living/carbon/human/sickboi)
|
||||
var/threat = sickboi.check_virus()
|
||||
if(get_disease_severity_value(threat) > get_disease_severity_value(DISEASE_SEVERITY_MINOR))
|
||||
return FALSE
|
||||
return TRUE
|
||||
|
||||
/obj/structure/holosign/barrier/medical/on_attack_hand(mob/living/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
|
||||
@@ -53,10 +53,10 @@
|
||||
/obj/structure/mineral_door/on_attack_hand(mob/user, act_intent = user.a_intent, unarmed_attack_flags)
|
||||
return TryToSwitchState(user)
|
||||
|
||||
/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target)
|
||||
/obj/structure/mineral_door/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(istype(mover, /obj/effect/beam))
|
||||
return !opacity
|
||||
return !density
|
||||
|
||||
/obj/structure/mineral_door/proc/TryToSwitchState(atom/user)
|
||||
if(isSwitchingStates)
|
||||
|
||||
@@ -306,7 +306,7 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
layer = TRAY_LAYER
|
||||
var/obj/structure/bodycontainer/connected = null
|
||||
anchored = TRUE
|
||||
pass_flags = LETPASSTHROW
|
||||
pass_flags_self = LETPASSTHROW
|
||||
max_integrity = 350
|
||||
|
||||
/obj/structure/tray/Destroy()
|
||||
@@ -362,17 +362,11 @@ GLOBAL_LIST_EMPTY(crematoriums)
|
||||
name = "morgue tray"
|
||||
desc = "Apply corpse before closing."
|
||||
icon_state = "morguet"
|
||||
pass_flags_self = PASSTABLE
|
||||
|
||||
/obj/structure/tray/m_tray/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSTABLE))
|
||||
return 1
|
||||
/obj/structure/tray/m_tray/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(locate(/obj/structure/table) in get_turf(mover))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/tray/m_tray/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSTABLE)
|
||||
return TRUE
|
||||
|
||||
@@ -69,7 +69,9 @@
|
||||
return CanAStarPass(ID, to_dir, M.pulling)
|
||||
return 1 //diseases, stings, etc can pass
|
||||
|
||||
/obj/structure/plasticflaps/CanPass(atom/movable/A, turf/T)
|
||||
/obj/structure/plasticflaps/CanAllowThrough(atom/movable/A, turf/T)
|
||||
. = ..()
|
||||
|
||||
if(istype(A) && (A.pass_flags & PASSGLASS))
|
||||
return prob(60)
|
||||
|
||||
@@ -93,7 +95,6 @@
|
||||
return 1
|
||||
if(!M.lying && !(SEND_SIGNAL(M, COMSIG_CHECK_VENTCRAWL)) && M.mob_size != MOB_SIZE_TINY) //If your not laying down, or a ventcrawler or a small creature, no pass.
|
||||
return 0
|
||||
return ..()
|
||||
|
||||
/obj/structure/plasticflaps/deconstruct(disassembled = TRUE)
|
||||
if(!(flags_1 & NODECONSTRUCT_1))
|
||||
|
||||
@@ -78,7 +78,7 @@
|
||||
/obj/structure/railing/CheckExit(atom/movable/mover, turf/target)
|
||||
..()
|
||||
if(get_dir(loc, target) & dir)
|
||||
var/checking = UNSTOPPABLE | FLYING | FLOATING
|
||||
var/checking = PHASING | FLYING | FLOATING
|
||||
return !density || mover.throwing || mover.movement_type & checking || mover.move_force >= MOVE_FORCE_EXTREMELY_STRONG
|
||||
return TRUE
|
||||
|
||||
|
||||
@@ -19,10 +19,10 @@
|
||||
icon_state = "table"
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
pass_flags_self = PASSTABLE | LETPASSTHROW
|
||||
layer = TABLE_LAYER
|
||||
climbable = TRUE
|
||||
obj_flags = CAN_BE_HIT|SHOVABLE_ONTO
|
||||
pass_flags = LETPASSTHROW //You can throw objects over this, despite it's density.")
|
||||
attack_hand_speed = CLICK_CD_MELEE
|
||||
attack_hand_is_action = TRUE
|
||||
var/frame = /obj/structure/table_frame
|
||||
@@ -99,15 +99,14 @@
|
||||
/obj/structure/table/attack_tk()
|
||||
return FALSE
|
||||
|
||||
/obj/structure/table/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSTABLE))
|
||||
return 1
|
||||
/obj/structure/table/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(mover.throwing)
|
||||
return 1
|
||||
return TRUE
|
||||
if(locate(/obj/structure/table) in get_turf(mover))
|
||||
return 1
|
||||
else
|
||||
return !density
|
||||
return TRUE
|
||||
|
||||
/obj/structure/table/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
@@ -685,7 +684,7 @@
|
||||
layer = TABLE_LAYER
|
||||
density = TRUE
|
||||
anchored = TRUE
|
||||
pass_flags = LETPASSTHROW //You can throw objects over this, despite it's density.
|
||||
pass_flags_self = LETPASSTHROW //You can throw objects over this, despite it's density.
|
||||
max_integrity = 20
|
||||
attack_hand_speed = CLICK_CD_MELEE
|
||||
attack_hand_is_action = TRUE
|
||||
@@ -702,12 +701,6 @@
|
||||
else
|
||||
return 0
|
||||
|
||||
/obj/structure/rack/CanAStarPass(ID, dir, caller)
|
||||
. = !density
|
||||
if(ismovable(caller))
|
||||
var/atom/movable/mover = caller
|
||||
. = . || (mover.pass_flags & PASSTABLE)
|
||||
|
||||
/obj/structure/rack/MouseDrop_T(obj/O, mob/user)
|
||||
. = ..()
|
||||
if ((!( istype(O, /obj/item) ) || user.get_active_held_item() != O))
|
||||
|
||||
@@ -8,17 +8,13 @@
|
||||
layer = LOW_ITEM_LAYER
|
||||
anchored = TRUE
|
||||
climbable = 1
|
||||
pass_flags_self = PASSGLASS
|
||||
var/tube_construction = /obj/structure/c_transit_tube
|
||||
var/list/tube_dirs //list of directions this tube section can connect to.
|
||||
var/exit_delay = 1
|
||||
var/enter_delay = 0
|
||||
var/const/time_to_unwrench = 2 SECONDS
|
||||
|
||||
/obj/structure/transit_tube/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
return !density
|
||||
|
||||
/obj/structure/transit_tube/New(loc, newdirection)
|
||||
..(loc)
|
||||
if(newdirection)
|
||||
|
||||
@@ -50,11 +50,10 @@
|
||||
/obj/structure/windoor_assembly/update_icon_state()
|
||||
icon_state = "[facing]_[secure ? "secure_" : ""]windoor_assembly[state]"
|
||||
|
||||
/obj/structure/windoor_assembly/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
/obj/structure/windoor_assembly/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(get_dir(loc, target) == dir) //Make sure looking at appropriate border
|
||||
return !density
|
||||
return
|
||||
if(istype(mover, /obj/structure/window))
|
||||
var/obj/structure/window/W = mover
|
||||
if(!valid_window_location(loc, W.ini_dir))
|
||||
@@ -65,7 +64,6 @@
|
||||
return FALSE
|
||||
else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir))
|
||||
return FALSE
|
||||
return 1
|
||||
|
||||
/obj/structure/windoor_assembly/CanAtmosPass(turf/T)
|
||||
if(get_dir(loc, T) == dir)
|
||||
@@ -73,13 +71,13 @@
|
||||
else
|
||||
return 1
|
||||
|
||||
/obj/structure/windoor_assembly/CheckExit(atom/movable/mover as mob|obj, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
/obj/structure/windoor_assembly/CheckExit(atom/movable/mover, turf/target)
|
||||
if(mover.pass_flags & pass_flags_self)
|
||||
return TRUE
|
||||
if(get_dir(loc, target) == dir)
|
||||
return !density
|
||||
else
|
||||
return 1
|
||||
return TRUE
|
||||
|
||||
|
||||
/obj/structure/windoor_assembly/attackby(obj/item/W, mob/user, params)
|
||||
|
||||
@@ -18,6 +18,7 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
|
||||
pressure_resistance = 4*ONE_ATMOSPHERE
|
||||
anchored = TRUE //initially is 0 for tile smoothing
|
||||
max_integrity = 25
|
||||
pass_flags_self = PASSGLASS
|
||||
var/ini_dir = null
|
||||
var/state = WINDOW_OUT_OF_FRAME
|
||||
var/reinf = FALSE
|
||||
@@ -90,13 +91,13 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
|
||||
. = ..()
|
||||
if(direct)
|
||||
setDir(direct)
|
||||
|
||||
|
||||
if(extra_reinforced && anchored)
|
||||
state = PRWINDOW_SECURE
|
||||
|
||||
else if(reinf && anchored)
|
||||
state = WINDOW_SCREWED_TO_FRAME
|
||||
|
||||
|
||||
|
||||
if(mapload && electrochromatic_id && electrochromatic_id[1] == "!")
|
||||
electrochromatic_id = SSmapping.get_obfuscated_id(electrochromatic_id)
|
||||
@@ -159,13 +160,15 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
|
||||
else
|
||||
..(FULLTILE_WINDOW_DIR)
|
||||
|
||||
/obj/structure/window/CanPass(atom/movable/mover, turf/target)
|
||||
if(istype(mover) && (mover.pass_flags & PASSGLASS))
|
||||
return 1
|
||||
/obj/structure/window/CanAllowThrough(atom/movable/mover, turf/target)
|
||||
. = ..()
|
||||
if(.)
|
||||
return
|
||||
if(dir == FULLTILE_WINDOW_DIR)
|
||||
return 0 //full tile window, you can't move into it!
|
||||
if(get_dir(loc, target) == dir)
|
||||
return !density
|
||||
var/attempted_dir = get_dir(loc, target)
|
||||
if(attempted_dir == dir)
|
||||
return
|
||||
if(istype(mover, /obj/structure/window))
|
||||
var/obj/structure/window/W = mover
|
||||
if(!valid_window_location(loc, W.ini_dir))
|
||||
@@ -176,7 +179,8 @@ GLOBAL_LIST_EMPTY(electrochromatic_window_lookup)
|
||||
return FALSE
|
||||
else if(istype(mover, /obj/machinery/door/window) && !valid_window_location(loc, mover.dir))
|
||||
return FALSE
|
||||
return 1
|
||||
else if(attempted_dir != dir)
|
||||
return TRUE
|
||||
|
||||
/obj/structure/window/CheckExit(atom/movable/O, turf/target)
|
||||
if(istype(O) && (O.pass_flags & PASSGLASS))
|
||||
|
||||
Reference in New Issue
Block a user