Merge pull request #3077 from Citadel-Station-13/upstream-merge-31192

[MIRROR] ismecha define
This commit is contained in:
LetterJay
2017-10-02 21:11:59 -04:00
committed by GitHub
30 changed files with 1166 additions and 1172 deletions
+2
View File
@@ -140,6 +140,8 @@
#define isstructure(A) (istype(A, /obj/structure)) #define isstructure(A) (istype(A, /obj/structure))
#define ismecha(A) (istype(A, /obj/mecha))
#define is_cleanable(A) (istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/rune)) //if something is cleanable #define is_cleanable(A) (istype(A, /obj/effect/decal/cleanable) || istype(A, /obj/effect/rune)) //if something is cleanable
#define isorgan(A) (istype(A, /obj/item/organ)) #define isorgan(A) (istype(A, /obj/item/organ))
+1 -1
View File
@@ -96,7 +96,7 @@
if(!modifiers["catcher"] && A.IsObscured()) if(!modifiers["catcher"] && A.IsObscured())
return return
if(istype(loc, /obj/mecha)) if(ismecha(loc))
var/obj/mecha/M = loc var/obj/mecha/M = loc
return M.click_action(A,src,params) return M.click_action(A,src,params)
+1 -1
View File
@@ -28,7 +28,7 @@
icon_state = "act_equip" icon_state = "act_equip"
/obj/screen/human/equip/Click() /obj/screen/human/equip/Click()
if(istype(usr.loc, /obj/mecha)) // stops inventory actions in a mech if(ismecha(usr.loc)) // stops inventory actions in a mech
return 1 return 1
var/mob/living/carbon/human/H = usr var/mob/living/carbon/human/H = usr
H.quick_equip() H.quick_equip()
File diff suppressed because it is too large Load Diff
@@ -27,7 +27,7 @@
probability = 90 probability = 90
/datum/weather/ash_storm/proc/is_ash_immune(mob/living/L) /datum/weather/ash_storm/proc/is_ash_immune(mob/living/L)
if(istype(L.loc, /obj/mecha)) //Mechs are immune if(ismecha(L.loc)) //Mechs are immune
return TRUE return TRUE
if(ishuman(L)) //Are you immune? if(ishuman(L)) //Are you immune?
var/mob/living/carbon/human/H = L var/mob/living/carbon/human/H = L
@@ -75,7 +75,7 @@
if(GLOB.ratvar_awakens && L) if(GLOB.ratvar_awakens && L)
L.adjust_fire_stacks(damage_per_tick) L.adjust_fire_stacks(damage_per_tick)
L.IgniteMob() L.IgniteMob()
else if(istype(target, /obj/mecha)) else if(ismecha(target))
var/obj/mecha/M = target var/obj/mecha/M = target
M.take_damage(damage_per_tick * get_efficiency_mod(), BURN, "melee", 1, get_dir(src, M)) M.take_damage(damage_per_tick * get_efficiency_mod(), BURN, "melee", 1, get_dir(src, M))
@@ -90,7 +90,7 @@
if(isliving(target)) if(isliving(target))
var/mob/living/L = target var/mob/living/L = target
to_chat(L, "<span class='neovgre'>\"I SEE YOU!\"</span>\n<span class='userdanger'>[src]'s gaze [GLOB.ratvar_awakens ? "melts you alive" : "burns you"]!</span>") to_chat(L, "<span class='neovgre'>\"I SEE YOU!\"</span>\n<span class='userdanger'>[src]'s gaze [GLOB.ratvar_awakens ? "melts you alive" : "burns you"]!</span>")
else if(istype(target, /obj/mecha)) else if(ismecha(target))
var/obj/mecha/M = target var/obj/mecha/M = target
to_chat(M.occupant, "<span class='neovgre'>\"I SEE YOU!\"</span>" ) to_chat(M.occupant, "<span class='neovgre'>\"I SEE YOU!\"</span>" )
else if(prob(0.5)) //Extremely low chance because of how fast the subsystem it uses processes else if(prob(0.5)) //Extremely low chance because of how fast the subsystem it uses processes
+1 -1
View File
@@ -83,7 +83,7 @@
bumpopen(M) bumpopen(M)
return return
if(istype(AM, /obj/mecha)) if(ismecha(AM))
var/obj/mecha/mecha = AM var/obj/mecha/mecha = AM
if(density) if(density)
if(mecha.occupant) if(mecha.occupant)
+1 -1
View File
@@ -62,7 +62,7 @@
if( operating || !src.density ) if( operating || !src.density )
return return
if (!( ismob(AM) )) if (!( ismob(AM) ))
if(istype(AM, /obj/mecha)) if(ismecha(AM))
var/obj/mecha/mecha = AM var/obj/mecha/mecha = AM
if(mecha.occupant && src.allowed(mecha.occupant)) if(mecha.occupant && src.allowed(mecha.occupant))
open_and_close() open_and_close()
+1 -1
View File
@@ -20,7 +20,7 @@
var/O_limit var/O_limit
var/atom/target = get_edge_target_turf(src, dir) var/atom/target = get_edge_target_turf(src, dir)
for(var/atom/movable/O in loc) for(var/atom/movable/O in loc)
if(!O.anchored || istype(O, /obj/mecha)) //Mechs need their launch platforms. if(!O.anchored || ismecha(O)) //Mechs need their launch platforms.
O_limit++ O_limit++
if(O_limit >= 20) if(O_limit >= 20)
audible_message("<span class='notice'>[src] lets out a screech, it doesn't seem to be able to handle the load.</span>") audible_message("<span class='notice'>[src] lets out a screech, it doesn't seem to be able to handle the load.</span>")
@@ -390,7 +390,7 @@
if(!in_faction(C)) if(!in_faction(C))
targets += C targets += C
if(istype(A, /obj/mecha)) if(ismecha(A))
var/obj/mecha/M = A var/obj/mecha/M = A
//If there is a user and they're not in our faction //If there is a user and they're not in our faction
if(M.occupant && !in_faction(M.occupant)) if(M.occupant && !in_faction(M.occupant))
+135 -135
View File
@@ -1,137 +1,137 @@
/obj/machinery/computer/mecha /obj/machinery/computer/mecha
name = "exosuit control console" name = "exosuit control console"
desc = "Used to remotely locate or lockdown exosuits." desc = "Used to remotely locate or lockdown exosuits."
icon_screen = "mecha" icon_screen = "mecha"
icon_keyboard = "tech_key" icon_keyboard = "tech_key"
req_access = list(ACCESS_ROBOTICS) req_access = list(ACCESS_ROBOTICS)
circuit = /obj/item/circuitboard/computer/mecha_control circuit = /obj/item/circuitboard/computer/mecha_control
var/list/located = list() var/list/located = list()
var/screen = 0 var/screen = 0
var/stored_data var/stored_data
/obj/machinery/computer/mecha/attack_hand(mob/user) /obj/machinery/computer/mecha/attack_hand(mob/user)
if(..()) if(..())
return return
user.set_machine(src) user.set_machine(src)
var/dat = "<html><head><title>[src.name]</title><style>h3 {margin: 0px; padding: 0px;}</style></head><body>" var/dat = "<html><head><title>[src.name]</title><style>h3 {margin: 0px; padding: 0px;}</style></head><body>"
if(screen == 0) if(screen == 0)
dat += "<h3>Tracking beacons data</h3>" dat += "<h3>Tracking beacons data</h3>"
var/list/trackerlist = list() var/list/trackerlist = list()
for(var/obj/mecha/MC in GLOB.mechas_list) for(var/obj/mecha/MC in GLOB.mechas_list)
trackerlist += MC.trackers trackerlist += MC.trackers
for(var/obj/item/mecha_parts/mecha_tracking/TR in trackerlist) for(var/obj/item/mecha_parts/mecha_tracking/TR in trackerlist)
var/answer = TR.get_mecha_info() var/answer = TR.get_mecha_info()
if(answer) if(answer)
dat += {"<hr>[answer]<br/> dat += {"<hr>[answer]<br/>
<a href='?src=\ref[src];send_message=\ref[TR]'>Send message</a><br/> <a href='?src=\ref[src];send_message=\ref[TR]'>Send message</a><br/>
<a href='?src=\ref[src];get_log=\ref[TR]'>Show exosuit log</a> | <a style='color: #f00;' href='?src=\ref[src];shock=\ref[TR]'>(EMP pulse)</a><br>"} <a href='?src=\ref[src];get_log=\ref[TR]'>Show exosuit log</a> | <a style='color: #f00;' href='?src=\ref[src];shock=\ref[TR]'>(EMP pulse)</a><br>"}
if(screen==1) if(screen==1)
dat += "<h3>Log contents</h3>" dat += "<h3>Log contents</h3>"
dat += "<a href='?src=\ref[src];return=1'>Return</a><hr>" dat += "<a href='?src=\ref[src];return=1'>Return</a><hr>"
dat += "[stored_data]" dat += "[stored_data]"
dat += "<A href='?src=\ref[src];refresh=1'>(Refresh)</A><BR>" dat += "<A href='?src=\ref[src];refresh=1'>(Refresh)</A><BR>"
dat += "</body></html>" dat += "</body></html>"
user << browse(dat, "window=computer;size=400x500") user << browse(dat, "window=computer;size=400x500")
onclose(user, "computer") onclose(user, "computer")
return return
/obj/machinery/computer/mecha/Topic(href, href_list) /obj/machinery/computer/mecha/Topic(href, href_list)
if(..()) if(..())
return return
var/datum/topic_input/filter = new /datum/topic_input(href,href_list) var/datum/topic_input/filter = new /datum/topic_input(href,href_list)
if(href_list["send_message"]) if(href_list["send_message"])
var/obj/item/mecha_parts/mecha_tracking/MT = filter.getObj("send_message") var/obj/item/mecha_parts/mecha_tracking/MT = filter.getObj("send_message")
var/message = stripped_input(usr,"Input message","Transmit message") var/message = stripped_input(usr,"Input message","Transmit message")
var/obj/mecha/M = MT.in_mecha() var/obj/mecha/M = MT.in_mecha()
if(trim(message) && M) if(trim(message) && M)
M.occupant_message(message) M.occupant_message(message)
return return
if(href_list["shock"]) if(href_list["shock"])
var/obj/item/mecha_parts/mecha_tracking/MT = filter.getObj("shock") var/obj/item/mecha_parts/mecha_tracking/MT = filter.getObj("shock")
MT.shock() MT.shock()
if(href_list["get_log"]) if(href_list["get_log"])
var/obj/item/mecha_parts/mecha_tracking/MT = filter.getObj("get_log") var/obj/item/mecha_parts/mecha_tracking/MT = filter.getObj("get_log")
stored_data = MT.get_mecha_log() stored_data = MT.get_mecha_log()
screen = 1 screen = 1
if(href_list["return"]) if(href_list["return"])
screen = 0 screen = 0
updateUsrDialog() updateUsrDialog()
return return
/obj/item/mecha_parts/mecha_tracking /obj/item/mecha_parts/mecha_tracking
name = "exosuit tracking beacon" name = "exosuit tracking beacon"
desc = "Device used to transmit exosuit data." desc = "Device used to transmit exosuit data."
icon = 'icons/obj/device.dmi' icon = 'icons/obj/device.dmi'
icon_state = "motion2" icon_state = "motion2"
w_class = WEIGHT_CLASS_SMALL w_class = WEIGHT_CLASS_SMALL
origin_tech = "programming=2;magnets=2" origin_tech = "programming=2;magnets=2"
var/ai_beacon = FALSE //If this beacon allows for AI control. Exists to avoid using istype() on checking. var/ai_beacon = FALSE //If this beacon allows for AI control. Exists to avoid using istype() on checking.
/obj/item/mecha_parts/mecha_tracking/proc/get_mecha_info() /obj/item/mecha_parts/mecha_tracking/proc/get_mecha_info()
if(!in_mecha()) if(!in_mecha())
return 0 return 0
var/obj/mecha/M = src.loc var/obj/mecha/M = src.loc
var/cell_charge = M.get_charge() var/cell_charge = M.get_charge()
var/answer = {"<b>Name:</b> [M.name] var/answer = {"<b>Name:</b> [M.name]
<b>Integrity:</b> [M.obj_integrity/M.max_integrity*100]% <b>Integrity:</b> [M.obj_integrity/M.max_integrity*100]%
<b>Cell charge:</b> [isnull(cell_charge)?"Not found":"[M.cell.percent()]%"] <b>Cell charge:</b> [isnull(cell_charge)?"Not found":"[M.cell.percent()]%"]
<b>Airtank:</b> [M.return_pressure()]kPa <b>Airtank:</b> [M.return_pressure()]kPa
<b>Pilot:</b> [M.occupant||"None"] <b>Pilot:</b> [M.occupant||"None"]
<b>Location:</b> [get_area(M)||"Unknown"] <b>Location:</b> [get_area(M)||"Unknown"]
<b>Active equipment:</b> [M.selected||"None"] "} <b>Active equipment:</b> [M.selected||"None"] "}
if(istype(M, /obj/mecha/working/ripley)) if(istype(M, /obj/mecha/working/ripley))
var/obj/mecha/working/ripley/RM = M var/obj/mecha/working/ripley/RM = M
answer += "<b>Used cargo space:</b> [RM.cargo.len/RM.cargo_capacity*100]%<br>" answer += "<b>Used cargo space:</b> [RM.cargo.len/RM.cargo_capacity*100]%<br>"
return answer return answer
/obj/item/mecha_parts/mecha_tracking/emp_act() /obj/item/mecha_parts/mecha_tracking/emp_act()
qdel(src) qdel(src)
/obj/item/mecha_parts/mecha_tracking/Destroy() /obj/item/mecha_parts/mecha_tracking/Destroy()
if(istype(loc, /obj/mecha)) if(ismecha(loc))
var/obj/mecha/M = loc var/obj/mecha/M = loc
if(src in M.trackers) if(src in M.trackers)
M.trackers -= src M.trackers -= src
return ..() return ..()
/obj/item/mecha_parts/mecha_tracking/proc/in_mecha() /obj/item/mecha_parts/mecha_tracking/proc/in_mecha()
if(istype(src.loc, /obj/mecha)) if(ismecha(loc))
return src.loc return loc
return 0 return 0
/obj/item/mecha_parts/mecha_tracking/proc/shock() /obj/item/mecha_parts/mecha_tracking/proc/shock()
var/obj/mecha/M = in_mecha() var/obj/mecha/M = in_mecha()
if(M) if(M)
M.emp_act(EMP_LIGHT) M.emp_act(EMP_LIGHT)
qdel(src) qdel(src)
/obj/item/mecha_parts/mecha_tracking/proc/get_mecha_log() /obj/item/mecha_parts/mecha_tracking/proc/get_mecha_log()
if(!istype(loc, /obj/mecha)) if(!ismecha(loc))
return 0 return 0
var/obj/mecha/M = src.loc var/obj/mecha/M = src.loc
return M.get_log_html() return M.get_log_html()
/obj/item/mecha_parts/mecha_tracking/ai_control /obj/item/mecha_parts/mecha_tracking/ai_control
name = "exosuit AI control beacon" name = "exosuit AI control beacon"
desc = "A device used to transmit exosuit data. Also allows active AI units to take control of said exosuit." desc = "A device used to transmit exosuit data. Also allows active AI units to take control of said exosuit."
origin_tech = "programming=3;magnets=2;engineering=2" origin_tech = "programming=3;magnets=2;engineering=2"
ai_beacon = TRUE ai_beacon = TRUE
/obj/item/storage/box/mechabeacons /obj/item/storage/box/mechabeacons
name = "exosuit tracking beacons" name = "exosuit tracking beacons"
/obj/item/storage/box/mechabeacons/New() /obj/item/storage/box/mechabeacons/New()
..() ..()
new /obj/item/mecha_parts/mecha_tracking(src) new /obj/item/mecha_parts/mecha_tracking(src)
new /obj/item/mecha_parts/mecha_tracking(src) new /obj/item/mecha_parts/mecha_tracking(src)
new /obj/item/mecha_parts/mecha_tracking(src) new /obj/item/mecha_parts/mecha_tracking(src)
new /obj/item/mecha_parts/mecha_tracking(src) new /obj/item/mecha_parts/mecha_tracking(src)
new /obj/item/mecha_parts/mecha_tracking(src) new /obj/item/mecha_parts/mecha_tracking(src)
new /obj/item/mecha_parts/mecha_tracking(src) new /obj/item/mecha_parts/mecha_tracking(src)
new /obj/item/mecha_parts/mecha_tracking(src) new /obj/item/mecha_parts/mecha_tracking(src)
+154 -156
View File
@@ -1,156 +1,154 @@
/proc/create_portal_pair(turf/source, turf/destination, _creator = null, _lifespan = 300, accuracy = 0, newtype = /obj/effect/portal)
/proc/create_portal_pair(turf/source, turf/destination, _creator = null, _lifespan = 300, accuracy = 0, newtype = /obj/effect/portal) if(!istype(source) || !istype(destination))
if(!istype(source) || !istype(destination)) return
return var/turf/actual_destination = get_teleport_turf(destination, accuracy)
var/turf/actual_destination = get_teleport_turf(destination, accuracy) var/obj/effect/portal/P1 = new newtype(source, _creator, _lifespan, null, FALSE)
var/obj/effect/portal/P1 = new newtype(source, _creator, _lifespan, null, FALSE) var/obj/effect/portal/P2 = new newtype(actual_destination, _creator, _lifespan, P1, TRUE)
var/obj/effect/portal/P2 = new newtype(actual_destination, _creator, _lifespan, P1, TRUE) if(!istype(P1)||!istype(P2))
if(!istype(P1)||!istype(P2)) return
return P1.link_portal(P2)
P1.link_portal(P2) P1.hardlinked = TRUE
P1.hardlinked = TRUE return list(P1, P2)
return list(P1, P2)
/obj/effect/portal
/obj/effect/portal name = "portal"
name = "portal" desc = "Looks unstable. Best to test it with the clown."
desc = "Looks unstable. Best to test it with the clown." icon = 'icons/obj/stationobjs.dmi'
icon = 'icons/obj/stationobjs.dmi' icon_state = "portal"
icon_state = "portal" anchored = TRUE
anchored = TRUE var/mech_sized = FALSE
var/mech_sized = FALSE var/obj/effect/portal/linked
var/obj/effect/portal/linked var/hardlinked = TRUE //Requires a linked portal at all times. Destroy if there's no linked portal, if there is destroy it when this one is deleted.
var/hardlinked = TRUE //Requires a linked portal at all times. Destroy if there's no linked portal, if there is destroy it when this one is deleted. var/creator
var/creator var/turf/hard_target //For when a portal needs a hard target and isn't to be linked.
var/turf/hard_target //For when a portal needs a hard target and isn't to be linked. var/atmos_link = FALSE //Link source/destination atmos.
var/atmos_link = FALSE //Link source/destination atmos. var/turf/open/atmos_source //Atmos link source
var/turf/open/atmos_source //Atmos link source var/turf/open/atmos_destination //Atmos link destination
var/turf/open/atmos_destination //Atmos link destination
/obj/effect/portal/anom
/obj/effect/portal/anom name = "wormhole"
name = "wormhole" icon = 'icons/obj/objects.dmi'
icon = 'icons/obj/objects.dmi' icon_state = "anom"
icon_state = "anom" mech_sized = TRUE
mech_sized = TRUE
/obj/effect/portal/Move(newloc)
/obj/effect/portal/Move(newloc) for(var/T in newloc)
for(var/T in newloc) if(istype(T, /obj/effect/portal))
if(istype(T, /obj/effect/portal)) return FALSE
return FALSE return ..()
return ..()
/obj/effect/portal/attackby(obj/item/W, mob/user, params)
/obj/effect/portal/attackby(obj/item/W, mob/user, params) if(user && Adjacent(user))
if(user && Adjacent(user)) teleport(user)
teleport(user)
/obj/effect/portal/Crossed(atom/movable/AM, oldloc)
/obj/effect/portal/Crossed(atom/movable/AM, oldloc) if(get_turf(oldloc) == get_turf(linked))
if(get_turf(oldloc) == get_turf(linked)) return ..()
return ..() if(!teleport(AM))
if(!teleport(AM)) return ..()
return ..()
/obj/effect/portal/attack_tk(mob/user)
/obj/effect/portal/attack_tk(mob/user) return
return
/obj/effect/portal/attack_hand(mob/user)
/obj/effect/portal/attack_hand(mob/user) if(Adjacent(user))
if(Adjacent(user)) teleport(user)
teleport(user)
/obj/effect/portal/Initialize(mapload, _creator, _lifespan = 0, obj/effect/portal/_linked, automatic_link = FALSE, turf/hard_target_override, atmos_link_override)
/obj/effect/portal/Initialize(mapload, _creator, _lifespan = 0, obj/effect/portal/_linked, automatic_link = FALSE, turf/hard_target_override, atmos_link_override) . = ..()
. = ..() GLOB.portals += src
GLOB.portals += src if(!istype(_linked) && automatic_link)
if(!istype(_linked) && automatic_link) . = INITIALIZE_HINT_QDEL
. = INITIALIZE_HINT_QDEL CRASH("Somebody fucked up.")
CRASH("Somebody fucked up.") if(_lifespan > 0)
if(_lifespan > 0) QDEL_IN(src, _lifespan)
QDEL_IN(src, _lifespan) if(!isnull(atmos_link_override))
if(!isnull(atmos_link_override)) atmos_link = atmos_link_override
atmos_link = atmos_link_override link_portal(_linked)
link_portal(_linked) hardlinked = automatic_link
hardlinked = automatic_link creator = _creator
creator = _creator if(isturf(hard_target_override))
if(isturf(hard_target_override)) hard_target = hard_target_override
hard_target = hard_target_override
/obj/effect/portal/proc/link_portal(obj/effect/portal/newlink)
/obj/effect/portal/proc/link_portal(obj/effect/portal/newlink) linked = newlink
linked = newlink if(atmos_link)
if(atmos_link) link_atmos()
link_atmos()
/obj/effect/portal/proc/link_atmos()
/obj/effect/portal/proc/link_atmos() if(atmos_source || atmos_destination)
if(atmos_source || atmos_destination) unlink_atmos()
unlink_atmos() if(!isopenturf(get_turf(src)))
if(!isopenturf(get_turf(src))) return FALSE
return FALSE if(linked)
if(linked) if(isopenturf(get_turf(linked)))
if(isopenturf(get_turf(linked))) atmos_source = get_turf(src)
atmos_source = get_turf(src) atmos_destination = get_turf(linked)
atmos_destination = get_turf(linked) else if(hard_target)
else if(hard_target) if(isopenturf(hard_target))
if(isopenturf(hard_target)) atmos_source = get_turf(src)
atmos_source = get_turf(src) atmos_destination = hard_target
atmos_destination = hard_target else
else return FALSE
return FALSE if(!istype(atmos_source) || !istype(atmos_destination))
if(!istype(atmos_source) || !istype(atmos_destination)) return FALSE
return FALSE LAZYINITLIST(atmos_source.atmos_adjacent_turfs)
LAZYINITLIST(atmos_source.atmos_adjacent_turfs) LAZYINITLIST(atmos_destination.atmos_adjacent_turfs)
LAZYINITLIST(atmos_destination.atmos_adjacent_turfs) if(atmos_source.atmos_adjacent_turfs[atmos_destination] || atmos_destination.atmos_adjacent_turfs[atmos_source]) //Already linked!
if(atmos_source.atmos_adjacent_turfs[atmos_destination] || atmos_destination.atmos_adjacent_turfs[atmos_source]) //Already linked! return FALSE
return FALSE atmos_source.atmos_adjacent_turfs[atmos_destination] = TRUE
atmos_source.atmos_adjacent_turfs[atmos_destination] = TRUE atmos_destination.atmos_adjacent_turfs[atmos_source] = TRUE
atmos_destination.atmos_adjacent_turfs[atmos_source] = TRUE atmos_source.air_update_turf(FALSE)
atmos_source.air_update_turf(FALSE) atmos_destination.air_update_turf(FALSE)
atmos_destination.air_update_turf(FALSE)
/obj/effect/portal/proc/unlink_atmos()
/obj/effect/portal/proc/unlink_atmos() if(istype(atmos_source))
if(istype(atmos_source)) if(istype(atmos_destination) && !atmos_source.Adjacent(atmos_destination) && !CANATMOSPASS(atmos_destination, atmos_source))
if(istype(atmos_destination) && !atmos_source.Adjacent(atmos_destination) && !CANATMOSPASS(atmos_destination, atmos_source)) LAZYREMOVE(atmos_source.atmos_adjacent_turfs, atmos_destination)
LAZYREMOVE(atmos_source.atmos_adjacent_turfs, atmos_destination) atmos_source = null
atmos_source = null if(istype(atmos_destination))
if(istype(atmos_destination)) if(istype(atmos_source) && !atmos_destination.Adjacent(atmos_source) && !CANATMOSPASS(atmos_source, atmos_destination))
if(istype(atmos_source) && !atmos_destination.Adjacent(atmos_source) && !CANATMOSPASS(atmos_source, atmos_destination)) LAZYREMOVE(atmos_destination.atmos_adjacent_turfs, atmos_source)
LAZYREMOVE(atmos_destination.atmos_adjacent_turfs, atmos_source) atmos_destination = null
atmos_destination = null
/obj/effect/portal/Destroy() //Calls on_portal_destroy(destroyed portal, location of destroyed portal) on creator if creator has such call.
/obj/effect/portal/Destroy() //Calls on_portal_destroy(destroyed portal, location of destroyed portal) on creator if creator has such call. if(creator && hascall(creator, "on_portal_destroy"))
if(creator && hascall(creator, "on_portal_destroy")) call(creator, "on_portal_destroy")(src, src.loc)
call(creator, "on_portal_destroy")(src, src.loc) creator = null
creator = null GLOB.portals -= src
GLOB.portals -= src unlink_atmos()
unlink_atmos() if(hardlinked && !QDELETED(linked))
if(hardlinked && !QDELETED(linked)) QDEL_NULL(linked)
QDEL_NULL(linked) else
else linked = null
linked = null return ..()
return ..()
/obj/effect/portal/proc/teleport(atom/movable/M)
/obj/effect/portal/proc/teleport(atom/movable/M) if(!istype(M) || istype(M, /obj/effect) || (ismecha(M) && !mech_sized) || (!isobj(M) && !ismob(M))) //Things that shouldn't teleport.
if(!istype(M) || istype(M, /obj/effect) || (istype(M, /obj/mecha) && !mech_sized) || (!isobj(M) && !ismob(M))) //Things that shouldn't teleport. return
return var/turf/real_target = get_link_target_turf()
var/turf/real_target = get_link_target_turf() if(!istype(real_target))
if(!istype(real_target)) return FALSE
return FALSE if(ismegafauna(M))
if(ismegafauna(M)) message_admins("[M] has used a portal at [ADMIN_COORDJMP(src)] made by [usr].")
message_admins("[M] has used a portal at [ADMIN_COORDJMP(src)] made by [usr].") if(do_teleport(M, real_target, 0))
if(do_teleport(M, real_target, 0)) if(istype(M, /obj/item/projectile))
if(istype(M, /obj/item/projectile)) var/obj/item/projectile/P = M
var/obj/item/projectile/P = M P.ignore_source_check = TRUE
P.ignore_source_check = TRUE return TRUE
return TRUE return FALSE
return FALSE
/obj/effect/portal/proc/get_link_target_turf()
/obj/effect/portal/proc/get_link_target_turf() var/turf/real_target
var/turf/real_target if(!istype(linked) || QDELETED(linked))
if(!istype(linked) || QDELETED(linked)) if(hardlinked)
if(hardlinked) qdel(src)
qdel(src) if(!istype(hard_target) || QDELETED(hard_target))
if(!istype(hard_target) || QDELETED(hard_target)) hard_target = null
hard_target = null return
return else
else real_target = hard_target
real_target = hard_target linked = null
linked = null else
else real_target = get_turf(linked)
real_target = get_turf(linked) return real_target
return real_target
+1 -1
View File
@@ -34,7 +34,7 @@
if(!over_object) if(!over_object)
return return
if (istype(usr.loc, /obj/mecha)) // stops inventory actions in a mech if (ismecha(M.loc)) // stops inventory actions in a mech
return return
// this must come before the screen objects only block, dunno why it wasn't before // this must come before the screen objects only block, dunno why it wasn't before
+223 -223
View File
@@ -1,232 +1,232 @@
//NOT using the existing /obj/machinery/door type, since that has some complications on its own, mainly based on its //NOT using the existing /obj/machinery/door type, since that has some complications on its own, mainly based on its
//machineryness //machineryness
/obj/structure/mineral_door /obj/structure/mineral_door
name = "metal door" name = "metal door"
density = TRUE density = TRUE
anchored = TRUE anchored = TRUE
opacity = TRUE opacity = TRUE
icon = 'icons/obj/doors/mineral_doors.dmi' icon = 'icons/obj/doors/mineral_doors.dmi'
icon_state = "metal" icon_state = "metal"
var/initial_state var/initial_state
var/state = 0 //closed, 1 == open var/state = 0 //closed, 1 == open
var/isSwitchingStates = 0 var/isSwitchingStates = 0
var/close_delay = -1 //-1 if does not auto close. var/close_delay = -1 //-1 if does not auto close.
max_integrity = 200 max_integrity = 200
armor = list(melee = 10, bullet = 0, laser = 0, energy = 100, bomb = 10, bio = 100, rad = 100, fire = 50, acid = 50) armor = list(melee = 10, bullet = 0, laser = 0, energy = 100, bomb = 10, bio = 100, rad = 100, fire = 50, acid = 50)
var/sheetType = /obj/item/stack/sheet/metal var/sheetType = /obj/item/stack/sheet/metal
var/sheetAmount = 7 var/sheetAmount = 7
var/openSound = 'sound/effects/stonedoor_openclose.ogg' var/openSound = 'sound/effects/stonedoor_openclose.ogg'
var/closeSound = 'sound/effects/stonedoor_openclose.ogg' var/closeSound = 'sound/effects/stonedoor_openclose.ogg'
CanAtmosPass = ATMOS_PASS_DENSITY CanAtmosPass = ATMOS_PASS_DENSITY
/obj/structure/mineral_door/New(location) /obj/structure/mineral_door/New(location)
..() ..()
initial_state = icon_state initial_state = icon_state
air_update_turf(1) air_update_turf(1)
/obj/structure/mineral_door/Destroy() /obj/structure/mineral_door/Destroy()
density = FALSE density = FALSE
air_update_turf(1) air_update_turf(1)
return ..() return ..()
/obj/structure/mineral_door/Move() /obj/structure/mineral_door/Move()
var/turf/T = loc var/turf/T = loc
..() ..()
move_update_air(T) move_update_air(T)
/obj/structure/mineral_door/CollidedWith(atom/movable/AM) /obj/structure/mineral_door/CollidedWith(atom/movable/AM)
..() ..()
if(!state) if(!state)
return TryToSwitchState(AM) return TryToSwitchState(AM)
/obj/structure/mineral_door/attack_ai(mob/user) //those aren't machinery, they're just big fucking slabs of a mineral /obj/structure/mineral_door/attack_ai(mob/user) //those aren't machinery, they're just big fucking slabs of a mineral
if(isAI(user)) //so the AI can't open it if(isAI(user)) //so the AI can't open it
return return
else if(iscyborg(user)) //but cyborgs can else if(iscyborg(user)) //but cyborgs can
if(get_dist(user,src) <= 1) //not remotely though if(get_dist(user,src) <= 1) //not remotely though
return TryToSwitchState(user) return TryToSwitchState(user)
/obj/structure/mineral_door/attack_paw(mob/user) /obj/structure/mineral_door/attack_paw(mob/user)
return TryToSwitchState(user) return TryToSwitchState(user)
/obj/structure/mineral_door/attack_hand(mob/user) /obj/structure/mineral_door/attack_hand(mob/user)
return TryToSwitchState(user) return TryToSwitchState(user)
/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target) /obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target)
if(istype(mover, /obj/effect/beam)) if(istype(mover, /obj/effect/beam))
return !opacity return !opacity
return !density return !density
/obj/structure/mineral_door/proc/TryToSwitchState(atom/user) /obj/structure/mineral_door/proc/TryToSwitchState(atom/user)
if(isSwitchingStates) if(isSwitchingStates)
return return
if(isliving(user)) if(isliving(user))
var/mob/living/M = user var/mob/living/M = user
if(world.time - M.last_bumped <= 60) if(world.time - M.last_bumped <= 60)
return //NOTE do we really need that? return //NOTE do we really need that?
if(M.client) if(M.client)
if(iscarbon(M)) if(iscarbon(M))
var/mob/living/carbon/C = M var/mob/living/carbon/C = M
if(!C.handcuffed) if(!C.handcuffed)
SwitchState() SwitchState()
else else
SwitchState() SwitchState()
else if(istype(user, /obj/mecha)) else if(ismecha(user))
SwitchState() SwitchState()
/obj/structure/mineral_door/proc/SwitchState() /obj/structure/mineral_door/proc/SwitchState()
if(state) if(state)
Close() Close()
else else
Open() Open()
/obj/structure/mineral_door/proc/Open() /obj/structure/mineral_door/proc/Open()
isSwitchingStates = 1 isSwitchingStates = 1
playsound(src, openSound, 100, 1) playsound(src, openSound, 100, 1)
set_opacity(FALSE) set_opacity(FALSE)
flick("[initial_state]opening",src) flick("[initial_state]opening",src)
sleep(10) sleep(10)
density = FALSE density = FALSE
state = 1 state = 1
air_update_turf(1) air_update_turf(1)
update_icon() update_icon()
isSwitchingStates = 0 isSwitchingStates = 0
if(close_delay != -1) if(close_delay != -1)
addtimer(CALLBACK(src, .proc/Close), close_delay) addtimer(CALLBACK(src, .proc/Close), close_delay)
/obj/structure/mineral_door/proc/Close() /obj/structure/mineral_door/proc/Close()
if(isSwitchingStates || state != 1) if(isSwitchingStates || state != 1)
return return
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
for(var/mob/living/L in T) for(var/mob/living/L in T)
return return
isSwitchingStates = 1 isSwitchingStates = 1
playsound(loc, closeSound, 100, 1) playsound(loc, closeSound, 100, 1)
flick("[initial_state]closing",src) flick("[initial_state]closing",src)
sleep(10) sleep(10)
density = TRUE density = TRUE
set_opacity(TRUE) set_opacity(TRUE)
state = 0 state = 0
air_update_turf(1) air_update_turf(1)
update_icon() update_icon()
isSwitchingStates = 0 isSwitchingStates = 0
/obj/structure/mineral_door/update_icon() /obj/structure/mineral_door/update_icon()
if(state) if(state)
icon_state = "[initial_state]open" icon_state = "[initial_state]open"
else else
icon_state = initial_state icon_state = initial_state
/obj/structure/mineral_door/attackby(obj/item/W, mob/user, params) /obj/structure/mineral_door/attackby(obj/item/W, mob/user, params)
if(istype(W, /obj/item/pickaxe)) if(istype(W, /obj/item/pickaxe))
var/obj/item/pickaxe/digTool = W var/obj/item/pickaxe/digTool = W
to_chat(user, "<span class='notice'>You start digging the [name]...</span>") to_chat(user, "<span class='notice'>You start digging the [name]...</span>")
if(do_after(user,digTool.digspeed*(1+round(max_integrity*0.01)), target = src) && src) if(do_after(user,digTool.digspeed*(1+round(max_integrity*0.01)), target = src) && src)
to_chat(user, "<span class='notice'>You finish digging.</span>") to_chat(user, "<span class='notice'>You finish digging.</span>")
deconstruct(TRUE) deconstruct(TRUE)
else if(user.a_intent != INTENT_HARM) else if(user.a_intent != INTENT_HARM)
attack_hand(user) attack_hand(user)
else else
return ..() return ..()
/obj/structure/mineral_door/deconstruct(disassembled = TRUE) /obj/structure/mineral_door/deconstruct(disassembled = TRUE)
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
if(disassembled) if(disassembled)
new sheetType(T, sheetAmount) new sheetType(T, sheetAmount)
else else
new sheetType(T, max(sheetAmount - 2, 1)) new sheetType(T, max(sheetAmount - 2, 1))
qdel(src) qdel(src)
/obj/structure/mineral_door/iron /obj/structure/mineral_door/iron
name = "iron door" name = "iron door"
max_integrity = 300 max_integrity = 300
/obj/structure/mineral_door/silver /obj/structure/mineral_door/silver
name = "silver door" name = "silver door"
icon_state = "silver" icon_state = "silver"
sheetType = /obj/item/stack/sheet/mineral/silver sheetType = /obj/item/stack/sheet/mineral/silver
max_integrity = 300 max_integrity = 300
/obj/structure/mineral_door/gold /obj/structure/mineral_door/gold
name = "gold door" name = "gold door"
icon_state = "gold" icon_state = "gold"
sheetType = /obj/item/stack/sheet/mineral/gold sheetType = /obj/item/stack/sheet/mineral/gold
/obj/structure/mineral_door/uranium /obj/structure/mineral_door/uranium
name = "uranium door" name = "uranium door"
icon_state = "uranium" icon_state = "uranium"
sheetType = /obj/item/stack/sheet/mineral/uranium sheetType = /obj/item/stack/sheet/mineral/uranium
max_integrity = 300 max_integrity = 300
light_range = 2 light_range = 2
/obj/structure/mineral_door/sandstone /obj/structure/mineral_door/sandstone
name = "sandstone door" name = "sandstone door"
icon_state = "sandstone" icon_state = "sandstone"
sheetType = /obj/item/stack/sheet/mineral/sandstone sheetType = /obj/item/stack/sheet/mineral/sandstone
max_integrity = 100 max_integrity = 100
/obj/structure/mineral_door/transparent /obj/structure/mineral_door/transparent
opacity = FALSE opacity = FALSE
/obj/structure/mineral_door/transparent/Close() /obj/structure/mineral_door/transparent/Close()
..() ..()
set_opacity(FALSE) set_opacity(FALSE)
/obj/structure/mineral_door/transparent/plasma /obj/structure/mineral_door/transparent/plasma
name = "plasma door" name = "plasma door"
icon_state = "plasma" icon_state = "plasma"
sheetType = /obj/item/stack/sheet/mineral/plasma sheetType = /obj/item/stack/sheet/mineral/plasma
/obj/structure/mineral_door/transparent/plasma/attackby(obj/item/W, mob/user, params) /obj/structure/mineral_door/transparent/plasma/attackby(obj/item/W, mob/user, params)
if(W.is_hot()) if(W.is_hot())
var/turf/T = get_turf(src) var/turf/T = get_turf(src)
message_admins("Plasma mineral door ignited by [ADMIN_LOOKUPFLW(user)] in [ADMIN_COORDJMP(T)]",0,1) message_admins("Plasma mineral door ignited by [ADMIN_LOOKUPFLW(user)] in [ADMIN_COORDJMP(T)]",0,1)
log_game("Plasma mineral door ignited by [key_name(user)] in [COORD(T)]") log_game("Plasma mineral door ignited by [key_name(user)] in [COORD(T)]")
TemperatureAct() TemperatureAct()
else else
return ..() return ..()
/obj/structure/mineral_door/transparent/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume) /obj/structure/mineral_door/transparent/plasma/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > 300) if(exposed_temperature > 300)
TemperatureAct() TemperatureAct()
/obj/structure/mineral_door/transparent/plasma/proc/TemperatureAct() /obj/structure/mineral_door/transparent/plasma/proc/TemperatureAct()
atmos_spawn_air("plasma=500;TEMP=1000") atmos_spawn_air("plasma=500;TEMP=1000")
deconstruct(FALSE) deconstruct(FALSE)
/obj/structure/mineral_door/transparent/diamond /obj/structure/mineral_door/transparent/diamond
name = "diamond door" name = "diamond door"
icon_state = "diamond" icon_state = "diamond"
sheetType = /obj/item/stack/sheet/mineral/diamond sheetType = /obj/item/stack/sheet/mineral/diamond
max_integrity = 1000 max_integrity = 1000
/obj/structure/mineral_door/wood /obj/structure/mineral_door/wood
name = "wood door" name = "wood door"
icon_state = "wood" icon_state = "wood"
openSound = 'sound/effects/doorcreaky.ogg' openSound = 'sound/effects/doorcreaky.ogg'
closeSound = 'sound/effects/doorcreaky.ogg' closeSound = 'sound/effects/doorcreaky.ogg'
sheetType = /obj/item/stack/sheet/mineral/wood sheetType = /obj/item/stack/sheet/mineral/wood
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
max_integrity = 200 max_integrity = 200
/obj/structure/mineral_door/paperframe /obj/structure/mineral_door/paperframe
name = "paper frame door" name = "paper frame door"
icon_state = "paperframe" icon_state = "paperframe"
openSound = 'sound/effects/doorcreaky.ogg' openSound = 'sound/effects/doorcreaky.ogg'
closeSound = 'sound/effects/doorcreaky.ogg' closeSound = 'sound/effects/doorcreaky.ogg'
sheetType = /obj/item/stack/sheet/paperframes sheetType = /obj/item/stack/sheet/paperframes
sheetAmount = 3 sheetAmount = 3
resistance_flags = FLAMMABLE resistance_flags = FLAMMABLE
max_integrity = 20 max_integrity = 20
/obj/structure/mineral_door/paperframe/Initialize() /obj/structure/mineral_door/paperframe/Initialize()
. = ..() . = ..()
queue_smooth_neighbors(src) queue_smooth_neighbors(src)
/obj/structure/mineral_door/paperframe/Destroy() /obj/structure/mineral_door/paperframe/Destroy()
queue_smooth_neighbors(src) queue_smooth_neighbors(src)
return ..() return ..()
+1 -1
View File
@@ -76,7 +76,7 @@
if(C.move_delay) if(C.move_delay)
return 0 return 0
if(istype(A, /obj/mecha)) if(ismecha(A))
return 0 return 0
-6
View File
@@ -111,12 +111,6 @@
if(istype(R.module_active, /obj/item/pickaxe)) if(istype(R.module_active, /obj/item/pickaxe))
src.attackby(R.module_active,R) src.attackby(R.module_active,R)
return return
/* else if(istype(AM, /obj/mecha))
var/obj/mecha/M = AM
if(istype(M.selected, /obj/item/mecha_parts/mecha_equipment/drill))
src.attackby(M.selected,M)
return*/
//Aparantly mechs are just TOO COOL to call Collide())
else else
return return
+1 -1
View File
@@ -48,7 +48,7 @@
if(pockets && over_object == M) if(pockets && over_object == M)
return pockets.MouseDrop(over_object) return pockets.MouseDrop(over_object)
if(istype(usr.loc, /obj/mecha)) // stops inventory actions in a mech if(ismecha(M.loc)) // stops inventory actions in a mech
return return
if(!M.incapacitated() && loc == M && istype(over_object, /obj/screen/inventory/hand)) if(!M.incapacitated() && loc == M && istype(over_object, /obj/screen/inventory/hand))
+1 -1
View File
@@ -58,7 +58,7 @@
if(istype(M, /obj/effect)) //sparks don't teleport if(istype(M, /obj/effect)) //sparks don't teleport
return return
if(M.anchored) if(M.anchored)
if(!(istype(M, /obj/mecha) && mech_sized)) if(!(ismecha(M) && mech_sized))
return return
if(ismovableatom(M)) if(ismovableatom(M))
@@ -94,7 +94,7 @@
if(!ismob(M) && !isobj(M)) //No don't teleport lighting and effects! if(!ismob(M) && !isobj(M)) //No don't teleport lighting and effects!
return return
if(M.anchored && (!ismob(M) || (istype(M, /obj/mecha) && !mech_sized))) if(M.anchored && (!ismob(M) || (ismecha(M) && !mech_sized)))
return return
if(do_teleport(M, hard_target, 6)) if(do_teleport(M, hard_target, 6))
@@ -435,7 +435,7 @@
if(!over_object) if(!over_object)
return return
if (istype(usr.loc, /obj/mecha)) if(ismecha(usr.loc))
return return
if(!M.incapacitated()) if(!M.incapacitated())
@@ -29,7 +29,7 @@
dizziness = 0 dizziness = 0
jitteriness = 0 jitteriness = 0
if(istype(loc, /obj/mecha)) if(ismecha(loc))
var/obj/mecha/M = loc var/obj/mecha/M = loc
if(M.occupant == src) if(M.occupant == src)
M.go_out() M.go_out()
@@ -165,7 +165,7 @@
return chosen_target return chosen_target
// Please do not add one-off mob AIs here, but override this function for your mob // Please do not add one-off mob AIs here, but override this function for your mob
/mob/living/simple_animal/hostile/CanAttack(atom/the_target)//Can we actually attack a possible target? /mob/living/simple_animal/hostile/CanAttack(atom/the_target)//Can we actually attack a possible target?
if(isturf(the_target) || !the_target || the_target.type == /atom/movable/lighting_object) // bail out on invalids if(isturf(the_target) || !the_target || the_target.type == /atom/movable/lighting_object) // bail out on invalids
return FALSE return FALSE
@@ -187,7 +187,7 @@
return FALSE return FALSE
return TRUE return TRUE
if(istype(the_target, /obj/mecha)) if(ismecha(the_target))
var/obj/mecha/M = the_target var/obj/mecha/M = the_target
if(M.occupant)//Just so we don't attack empty mechs if(M.occupant)//Just so we don't attack empty mechs
if(CanAttack(M.occupant)) if(CanAttack(M.occupant))
@@ -184,7 +184,7 @@
mecha_face_target(target) mecha_face_target(target)
target.mech_melee_attack(mecha) target.mech_melee_attack(mecha)
else else
if(istype(target, /obj/mecha)) if(ismecha(target))
var/obj/mecha/M = target var/obj/mecha/M = target
if(is_valid_mecha(M)) if(is_valid_mecha(M))
enter_mecha(M) enter_mecha(M)
@@ -259,7 +259,7 @@
//Yes they actually try and pull this shit //Yes they actually try and pull this shit
//~simple animals~ //~simple animals~
/mob/living/simple_animal/hostile/syndicate/mecha_pilot/CanAttack(atom/the_target) /mob/living/simple_animal/hostile/syndicate/mecha_pilot/CanAttack(atom/the_target)
if(istype(the_target, /obj/mecha)) if(ismecha(the_target))
var/obj/mecha/M = the_target var/obj/mecha/M = the_target
if(mecha) if(mecha)
if(M == mecha || !CanAttack(M.occupant)) if(M == mecha || !CanAttack(M.occupant))
@@ -1,47 +1,47 @@
/mob/living/simple_animal/hostile/retaliate /mob/living/simple_animal/hostile/retaliate
var/list/enemies = list() var/list/enemies = list()
/mob/living/simple_animal/hostile/retaliate/Found(atom/A) /mob/living/simple_animal/hostile/retaliate/Found(atom/A)
if(isliving(A)) if(isliving(A))
var/mob/living/L = A var/mob/living/L = A
if(!L.stat) if(!L.stat)
return L return L
else else
enemies -= L enemies -= L
else if(istype(A, /obj/mecha)) else if(ismecha(A))
var/obj/mecha/M = A var/obj/mecha/M = A
if(M.occupant) if(M.occupant)
return A return A
/mob/living/simple_animal/hostile/retaliate/ListTargets() /mob/living/simple_animal/hostile/retaliate/ListTargets()
if(!enemies.len) if(!enemies.len)
return list() return list()
var/list/see = ..() var/list/see = ..()
see &= enemies // Remove all entries that aren't in enemies see &= enemies // Remove all entries that aren't in enemies
return see return see
/mob/living/simple_animal/hostile/retaliate/proc/Retaliate() /mob/living/simple_animal/hostile/retaliate/proc/Retaliate()
var/list/around = view(src, vision_range) var/list/around = view(src, vision_range)
for(var/atom/movable/A in around) for(var/atom/movable/A in around)
if(A == src) if(A == src)
continue continue
if(isliving(A)) if(isliving(A))
var/mob/living/M = A var/mob/living/M = A
if(faction_check_mob(M) && attack_same || !faction_check_mob(M)) if(faction_check_mob(M) && attack_same || !faction_check_mob(M))
enemies |= M enemies |= M
else if(istype(A, /obj/mecha)) else if(ismecha(A))
var/obj/mecha/M = A var/obj/mecha/M = A
if(M.occupant) if(M.occupant)
enemies |= M enemies |= M
enemies |= M.occupant enemies |= M.occupant
for(var/mob/living/simple_animal/hostile/retaliate/H in around) for(var/mob/living/simple_animal/hostile/retaliate/H in around)
if(faction_check_mob(H) && !attack_same && !H.attack_same) if(faction_check_mob(H) && !attack_same && !H.attack_same)
H.enemies |= enemies H.enemies |= enemies
return 0 return 0
/mob/living/simple_animal/hostile/retaliate/adjustHealth(amount, updating_health = TRUE, forced = FALSE) /mob/living/simple_animal/hostile/retaliate/adjustHealth(amount, updating_health = TRUE, forced = FALSE)
. = ..() . = ..()
if(. > 0 && stat == CONSCIOUS) if(. > 0 && stat == CONSCIOUS)
Retaliate() Retaliate()
@@ -317,7 +317,7 @@
var/mob/living/L = the_target var/mob/living/L = the_target
if(L.stat != CONSCIOUS) if(L.stat != CONSCIOUS)
return 0 return 0
if (istype(the_target, /obj/mecha)) if (ismecha(the_target))
var/obj/mecha/M = the_target var/obj/mecha/M = the_target
if (M.occupant) if (M.occupant)
return 0 return 0
+1 -1
View File
@@ -386,7 +386,7 @@
set category = "Object" set category = "Object"
set src = usr set src = usr
if(istype(loc, /obj/mecha)) if(ismecha(loc))
return return
if(incapacitated()) if(incapacitated())
+1 -1
View File
@@ -278,7 +278,7 @@
//dist_check - set to only shock mobs within 1 of source (vendors, airlocks, etc.) //dist_check - set to only shock mobs within 1 of source (vendors, airlocks, etc.)
//No animations will be performed by this proc. //No animations will be performed by this proc.
/proc/electrocute_mob(mob/living/carbon/M, power_source, obj/source, siemens_coeff = 1, dist_check = FALSE) /proc/electrocute_mob(mob/living/carbon/M, power_source, obj/source, siemens_coeff = 1, dist_check = FALSE)
if(istype(M.loc, /obj/mecha)) if(ismecha(M.loc))
return 0 //feckin mechs are dumb return 0 //feckin mechs are dumb
if(dist_check) if(dist_check)
if(!in_range(source,M)) if(!in_range(source,M))
@@ -58,7 +58,7 @@
if(isliving(mover)) if(isliving(mover))
shock(mover) shock(mover)
if(istype(mover, /obj/machinery) || isstructure(mover) || istype(mover, /obj/mecha)) if(istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover))
bump_field(mover) bump_field(mover)
/obj/machinery/field/containment/proc/set_master(master1,master2) /obj/machinery/field/containment/proc/set_master(master1,master2)
@@ -90,13 +90,13 @@
if(isliving(mover)) if(isliving(mover))
shock(mover) shock(mover)
return return
if(istype(mover, /obj/machinery) || isstructure(mover) || istype(mover, /obj/mecha)) if(istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover))
bump_field(mover) bump_field(mover)
return return
/obj/machinery/field/CanPass(atom/movable/mover, turf/target) /obj/machinery/field/CanPass(atom/movable/mover, turf/target)
if(hasShocked || isliving(mover) || istype(mover, /obj/machinery) || isstructure(mover) || istype(mover, /obj/mecha)) if(hasShocked || isliving(mover) || istype(mover, /obj/machinery) || isstructure(mover) || ismecha(mover))
return FALSE return FALSE
return ..() return ..()
+1 -1
View File
@@ -144,7 +144,7 @@
ignore_source_check = TRUE ignore_source_check = TRUE
return FALSE return FALSE
if(firer && !ignore_source_check) if(firer && !ignore_source_check)
if(A == firer || (A == firer.loc && istype(A, /obj/mecha))) //cannot shoot yourself or your mech if(A == firer || (A == firer.loc && ismecha(A))) //cannot shoot yourself or your mech
loc = A.loc loc = A.loc
return FALSE return FALSE
@@ -45,7 +45,7 @@
..() ..()
explosion(target, -1, 1, 3, 1, 0, flame_range = 4) explosion(target, -1, 1, 3, 1, 0, flame_range = 4)
if(istype(target, /obj/mecha)) if(ismecha(target))
var/obj/mecha/M = target var/obj/mecha/M = target
M.take_damage(anti_armour_damage) M.take_damage(anti_armour_damage)
if(issilicon(target)) if(issilicon(target))