/obj/structure icon = 'icons/obj/structures.dmi' pressure_resistance = 8 max_integrity = 300 face_while_pulling = TRUE var/climbable var/mob/climber var/broken = FALSE /obj/structure/New() ..() if(smooth) if(SSticker && SSticker.current_state == GAME_STATE_PLAYING) queue_smooth(src) queue_smooth_neighbors(src) icon_state = "" if(climbable) verbs += /obj/structure/proc/climb_on if(SSticker) GLOB.cameranet.updateVisibility(src) /obj/structure/Initialize(mapload) if(!armor) armor = list(MELEE = 0, BULLET = 0, LASER = 0, ENERGY = 0, BOMB = 0, BIO = 0, RAD = 0, FIRE = 50, ACID = 50) return ..() /obj/structure/Destroy() if(SSticker) GLOB.cameranet.updateVisibility(src) if(smooth) var/turf/T = get_turf(src) spawn(0) queue_smooth_neighbors(T) return ..() /obj/structure/proc/climb_on() set name = "Climb structure" set desc = "Climbs onto a structure." set category = null set src in oview(1) do_climb(usr) /obj/structure/MouseDrop_T(atom/movable/C, mob/user as mob) if(..()) return if(C == user) do_climb(user) /obj/structure/proc/density_check() for(var/obj/O in orange(0, src)) if(O.density && !istype(O, /obj/machinery/door/window)) //Ignores windoors, as those already block climbing, otherwise a windoor on the opposite side of a table would prevent climbing. return O var/turf/T = get_turf(src) if(T.density) return T return null /obj/structure/proc/do_climb(mob/living/user) if(!can_touch(user) || !climbable) return FALSE var/blocking_object = density_check() if(blocking_object) to_chat(user, "You cannot climb [src], as it is blocked by \a [blocking_object]!") return FALSE var/turf/T = src.loc if(!T || !istype(T)) return FALSE usr.visible_message("[user] starts climbing onto \the [src]!") climber = user if(!do_after(user, 50, target = src)) climber = null return FALSE if(!can_touch(user) || !climbable) climber = null return FALSE usr.loc = get_turf(src) if(get_turf(user) == get_turf(src)) usr.visible_message("[user] climbs onto \the [src]!") climber = null return TRUE /obj/structure/proc/structure_shaken() for(var/mob/living/M in get_turf(src)) if(M.lying) return //No spamming this on people. M.Weaken(5) to_chat(M, "You topple as \the [src] moves under you!") if(prob(25)) var/damage = rand(15,30) var/mob/living/carbon/human/H = M if(!istype(H)) to_chat(H, "You land heavily!") M.adjustBruteLoss(damage) return var/obj/item/organ/external/affecting switch(pick(list("ankle","wrist","head","knee","elbow"))) if("ankle") affecting = H.get_organ(pick("l_foot", "r_foot")) if("knee") affecting = H.get_organ(pick("l_leg", "r_leg")) if("wrist") affecting = H.get_organ(pick("l_hand", "r_hand")) if("elbow") affecting = H.get_organ(pick("l_arm", "r_arm")) if("head") affecting = H.get_organ("head") if(affecting) to_chat(M, "You land heavily on your [affecting.name]!") affecting.receive_damage(damage, 0) if(affecting.parent) affecting.parent.add_autopsy_data("Misadventure", damage) else to_chat(H, "You land heavily!") H.adjustBruteLoss(damage) H.UpdateDamageIcon() return /obj/structure/proc/can_touch(mob/user) if(!user) return 0 if(!Adjacent(user)) return 0 if(user.restrained() || user.buckled) to_chat(user, "You need your hands and legs free for this.") return 0 if(user.stat || user.paralysis || user.sleeping || user.lying || user.IsWeakened()) return 0 if(issilicon(user)) to_chat(user, "You need hands for this.") return 0 return 1 /obj/structure/examine(mob/user) . = ..() if(!(resistance_flags & INDESTRUCTIBLE)) if(resistance_flags & ON_FIRE) . += "It's on fire!" if(broken) . += "It appears to be broken." var/examine_status = examine_status(user) if(examine_status) . += examine_status /obj/structure/proc/examine_status(mob/user) //An overridable proc, mostly for falsewalls. var/healthpercent = (obj_integrity/max_integrity) * 100 switch(healthpercent) if(50 to 99) return "It looks slightly damaged." if(25 to 50) return "It appears heavily damaged." if(0 to 25) if(!broken) return "It's falling apart!" /obj/structure/proc/prevents_buckled_mobs_attacking() return FALSE /obj/structure/zap_act(power, zap_flags) if(zap_flags & ZAP_OBJ_DAMAGE) take_damage(power / 8000, BURN, ENERGY) power -= power / 2000 //walls take a lot out of ya . = ..()