diff --git a/code/modules/spacepods/spacepod.dm b/code/modules/spacepods/spacepod.dm index a7cd09b63ac..0a89272f1bb 100644 --- a/code/modules/spacepods/spacepod.dm +++ b/code/modules/spacepods/spacepod.dm @@ -130,7 +130,7 @@ light_color = icon_light_color[src.icon_state] /obj/spacepod/bullet_act(var/obj/item/projectile/P) - if(P.damage && !P.nodamage) + if(P.damage_type == BRUTE || P.damage_type == BURN) deal_damage(P.damage) else if(P.flag == "energy" && istype(P,/obj/item/projectile/ion)) //needed to make sure ions work properly empulse(src, 1, 1) @@ -250,95 +250,99 @@ processing_objects.Add(src) /obj/spacepod/attackby(obj/item/W as obj, mob/user as mob, params) - if(iscrowbar(W)) - if(!equipment_system.lock_system || unlocked || hatch_open) - hatch_open = !hatch_open - playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) - to_chat(user, "You [hatch_open ? "open" : "close"] the maintenance hatch.") - else - to_chat(user, "The hatch is locked shut!") - return - if(istype(W, /obj/item/weapon/stock_parts/cell)) - if(!hatch_open) - to_chat(user, "\red The maintenance hatch is closed!") - return - if(battery) - to_chat(user, "The pod already has a battery.") - return - user.drop_item(W) - battery = W - W.forceMove(src) - return - if(istype(W, /obj/item/device/spacepod_equipment)) - if(!hatch_open) - to_chat(user, "\red The maintenance hatch is closed!") - return - if(!equipment_system) - to_chat(user, "The pod has no equipment datum, yell at the coders") - return - if(istype(W, /obj/item/device/spacepod_equipment/weaponry)) - add_equipment(user, W, "weapon_system") - return - if(istype(W, /obj/item/device/spacepod_equipment/misc)) - add_equipment(user, W, "misc_system") - return - if(istype(W, /obj/item/device/spacepod_equipment/cargo)) - add_equipment(user, W, "cargo_system") - return - if(istype(W, /obj/item/device/spacepod_equipment/sec_cargo)) - add_equipment(user, W, "sec_cargo_system") - return - if(istype(W, /obj/item/device/spacepod_equipment/lock)) - add_equipment(user, W, "lock_system") - return - - if(istype(W, /obj/item/device/spacepod_key) && istype(equipment_system.lock_system, /obj/item/device/spacepod_equipment/lock/keyed)) - var/obj/item/device/spacepod_key/key = W - if(key.id == equipment_system.lock_system.id) - lock_pod() - return - else - to_chat(user, "This is the wrong key!") - return - - if(istype(W, /obj/item/weapon/weldingtool)) - if(!hatch_open) - to_chat(user, "\red You must open the maintenance hatch before attempting repairs.") - return - var/obj/item/weapon/weldingtool/WT = W - if(!WT.isOn()) - to_chat(user, "\red The welder must be on for this task.") - return - if(health < initial(health)) - to_chat(user, "\blue You start welding the spacepod...") - playsound(loc, 'sound/items/Welder.ogg', 50, 1) - if(do_after(user, 20, target = src)) - if(!src || !WT.remove_fuel(3, user)) return - repair_damage(10) - to_chat(user, "\blue You mend some [pick("dents","bumps","damage")] with \the [WT]") - return - to_chat(user, "\blue \The [src] is fully repaired!") - return - - if(istype(W, /obj/item/device/lock_buster)) - var/obj/item/device/lock_buster/L = W - if(L.on && equipment_system.lock_system) - user.visible_message(user, "[user] is drilling through the [src]'s lock!", - "You start drilling through the [src]'s lock!") - if(do_after(user, 100, target = src)) - qdel(equipment_system.lock_system) - equipment_system.lock_system = null - user.visible_message(user, "[user] has destroyed the [src]'s lock!", - "You destroy the [src]'s lock!") + if(user.a_intent == I_HARM) + ..() + deal_damage(W.force) + else + if(iscrowbar(W)) + if(!equipment_system.lock_system || unlocked || hatch_open) + hatch_open = !hatch_open + playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) + to_chat(user, "You [hatch_open ? "open" : "close"] the maintenance hatch.") else - user.visible_message(user, "[user] fails to break through the [src]'s lock!", - "You were unable to break through the [src]'s lock!") + to_chat(user, "The hatch is locked shut!") return - to_chat(user, "Turn the [L] on first.") - return + if(istype(W, /obj/item/weapon/stock_parts/cell)) + if(!hatch_open) + to_chat(user, "\red The maintenance hatch is closed!") + return + if(battery) + to_chat(user, "The pod already has a battery.") + return + user.drop_item(W) + battery = W + W.forceMove(src) + return + if(istype(W, /obj/item/device/spacepod_equipment)) + if(!hatch_open) + to_chat(user, "\red The maintenance hatch is closed!") + return + if(!equipment_system) + to_chat(user, "The pod has no equipment datum, yell at the coders") + return + if(istype(W, /obj/item/device/spacepod_equipment/weaponry)) + add_equipment(user, W, "weapon_system") + return + if(istype(W, /obj/item/device/spacepod_equipment/misc)) + add_equipment(user, W, "misc_system") + return + if(istype(W, /obj/item/device/spacepod_equipment/cargo)) + add_equipment(user, W, "cargo_system") + return + if(istype(W, /obj/item/device/spacepod_equipment/sec_cargo)) + add_equipment(user, W, "sec_cargo_system") + return + if(istype(W, /obj/item/device/spacepod_equipment/lock)) + add_equipment(user, W, "lock_system") + return - if(cargo_hold.storage_slots > 0 && !hatch_open && unlocked) // must be the last option as all items not listed prior will be stored - cargo_hold.attackby(W, user, params) + if(istype(W, /obj/item/device/spacepod_key) && istype(equipment_system.lock_system, /obj/item/device/spacepod_equipment/lock/keyed)) + var/obj/item/device/spacepod_key/key = W + if(key.id == equipment_system.lock_system.id) + lock_pod() + return + else + to_chat(user, "This is the wrong key!") + return + + if(istype(W, /obj/item/weapon/weldingtool)) + if(!hatch_open) + to_chat(user, "\red You must open the maintenance hatch before attempting repairs.") + return + var/obj/item/weapon/weldingtool/WT = W + if(!WT.isOn()) + to_chat(user, "\red The welder must be on for this task.") + return + if(health < initial(health)) + to_chat(user, "\blue You start welding the spacepod...") + playsound(loc, 'sound/items/Welder.ogg', 50, 1) + if(do_after(user, 20, target = src)) + if(!src || !WT.remove_fuel(3, user)) return + repair_damage(10) + to_chat(user, "\blue You mend some [pick("dents","bumps","damage")] with \the [WT]") + return + to_chat(user, "\blue \The [src] is fully repaired!") + return + + if(istype(W, /obj/item/device/lock_buster)) + var/obj/item/device/lock_buster/L = W + if(L.on && equipment_system.lock_system) + user.visible_message(user, "[user] is drilling through the [src]'s lock!", + "You start drilling through the [src]'s lock!") + if(do_after(user, 100, target = src)) + qdel(equipment_system.lock_system) + equipment_system.lock_system = null + user.visible_message(user, "[user] has destroyed the [src]'s lock!", + "You destroy the [src]'s lock!") + else + user.visible_message(user, "[user] fails to break through the [src]'s lock!", + "You were unable to break through the [src]'s lock!") + return + to_chat(user, "Turn the [L] on first.") + return + + if(cargo_hold.storage_slots > 0 && !hatch_open && unlocked) // must be the last option as all items not listed prior will be stored + cargo_hold.attackby(W, user, params) obj/spacepod/proc/add_equipment(mob/user, var/obj/item/device/spacepod_equipment/SPE, var/slot) if(equipment_system.vars[slot]) @@ -370,7 +374,10 @@ obj/spacepod/proc/add_equipment(mob/user, var/obj/item/device/spacepod_equipment if(do_after(user, 50, target = src)) target.forceMove(get_turf(src)) target.Stun(1) - passengers -= target + if(pilot) + pilot = null + else + passengers -= target target.visible_message("[user] flings the door open and tears [target] out of the [src]", "The door flies open and you are thrown out of the [src] and to the ground!") return