From 1c5eec92279d36479baa4ec44929985a434c6d83 Mon Sep 17 00:00:00 2001 From: Artorp Date: Thu, 19 Feb 2015 14:46:39 +0100 Subject: [PATCH 1/3] Added repair functionality to spacepods - One welder use consumes 3 fuel and repairs 10 hull damage - Fully repairing a sec spacepod requires around 40-42 activations, welder must be refueled every 6 uses --- code/game/vehicles/spacepods/spacepod.dm | 31 ++++++++++++++++++++---- 1 file changed, 26 insertions(+), 5 deletions(-) diff --git a/code/game/vehicles/spacepods/spacepod.dm b/code/game/vehicles/spacepods/spacepod.dm index ca3b4e50c6e..cd9cbc606d1 100644 --- a/code/game/vehicles/spacepods/spacepod.dm +++ b/code/game/vehicles/spacepods/spacepod.dm @@ -61,15 +61,13 @@ pod_overlays = new/list(2) pod_overlays[DAMAGE] = image(icon, icon_state="pod_damage") pod_overlays[FIRE] = image(icon, icon_state="pod_fire") - + + overlays.Cut() + if(health <= round(initial(health)/2)) overlays += pod_overlays[DAMAGE] if(health <= round(initial(health)/4)) overlays += pod_overlays[FIRE] - else - overlays -= pod_overlays[FIRE] - else - overlays -= pod_overlays[DAMAGE] /obj/spacepod/bullet_act(var/obj/item/projectile/P) if(P.damage && !P.nodamage) @@ -133,6 +131,12 @@ update_icons() +/obj/spacepod/proc/repair_damage(var/repair_amount) + if(health) + health = min(initial(health), health + repair_amount) + update_icons() + + /obj/spacepod/ex_act(severity) switch(severity) if(1) @@ -185,6 +189,23 @@ equipment_system.weapon_system = W equipment_system.weapon_system.my_atom = src return + if(istype(W, /obj/item/weapon/weldingtool)) + if(!hatch_open) + user << "\red You must open the maintenance hatch before attempting repairs." + return + var/obj/item/weapon/weldingtool/WT = W + if(!WT.isOn()) + user << "\red The welder must be on for this task." + return + if (health < initial(health)) + user << "\blue You start welding the spacepod..." + playsound(loc, 'sound/items/Welder.ogg', 50, 1) + if(do_after(user, 20)) + if(!src || !WT.remove_fuel(3, user)) return + repair_damage(10) + user << "\blue You mend some [pick("dents","bumps","damage")] with \the [WT]" + else + user << "\blue \The [src] is fully repaired!" /obj/spacepod/attack_paw(mob/user as mob) return src.attack_hand(user) From 9c926342d0eb1a41c9c2d5f39e651ee052ddeab8 Mon Sep 17 00:00:00 2001 From: Artorp Date: Thu, 19 Feb 2015 15:11:00 +0100 Subject: [PATCH 2/3] Spacepod: Added more feedback when interacting --- code/game/vehicles/spacepods/spacepod.dm | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/code/game/vehicles/spacepods/spacepod.dm b/code/game/vehicles/spacepods/spacepod.dm index cd9cbc606d1..81a34290398 100644 --- a/code/game/vehicles/spacepods/spacepod.dm +++ b/code/game/vehicles/spacepods/spacepod.dm @@ -161,10 +161,12 @@ /obj/spacepod/attackby(obj/item/W as obj, mob/user as mob) if(iscrowbar(W)) hatch_open = !hatch_open + playsound(loc, 'sound/items/Crowbar.ogg', 50, 1) user << "You [hatch_open ? "open" : "close"] the maintenance hatch." if(istype(W, /obj/item/weapon/stock_parts/cell)) if(!hatch_open) - return ..() + user << "\red The maintenance hatch is closed!" + return if(battery) user << "The pod already has a battery." return @@ -174,7 +176,8 @@ return if(istype(W, /obj/item/device/spacepod_equipment)) if(!hatch_open) - return ..() + user << "\red The maintenance hatch is closed!" + return if(!equipment_system) user << "The pod has no equipment datum, yell at pomf" return From 8182592811c30d9749b12c5879b022c52e940ba3 Mon Sep 17 00:00:00 2001 From: Artorp Date: Thu, 19 Feb 2015 15:20:28 +0100 Subject: [PATCH 3/3] Fixed MouseDrop_T runtime error runtime error: undefined variable /obj/spacepod/sec/var/stat --- code/game/vehicles/spacepods/spacepod.dm | 1 + 1 file changed, 1 insertion(+) diff --git a/code/game/vehicles/spacepods/spacepod.dm b/code/game/vehicles/spacepods/spacepod.dm index 81a34290398..55a748b26c3 100644 --- a/code/game/vehicles/spacepods/spacepod.dm +++ b/code/game/vehicles/spacepods/spacepod.dm @@ -432,6 +432,7 @@ /obj/spacepod/MouseDrop_T(mob/M as mob, mob/user as mob) + if(!isliving(M)) return if(M != user) if(M.stat != 0) if(allow2enter)