Merge pull request #7494 from lbnesquik/Kot-drill-zeven-tweak

Delete some duplication in the mech drill
This commit is contained in:
Atermonera
2020-08-20 19:17:47 -07:00
committed by GitHub
+9 -39
View File
@@ -5,6 +5,7 @@
equip_cooldown = 30
energy_drain = 10
force = 15
var/advanced = 0 //Determines if you can pierce the heavens or not. Used in diamond drill.
required_type = list(/obj/mecha/working/ripley)
/obj/item/mecha_parts/mecha_equipment/tool/drill/action(atom/target)
@@ -22,11 +23,17 @@
if(T == chassis.loc && src == chassis.selected)
if(istype(target, /turf/simulated/wall))
var/turf/simulated/wall/W = target
if(W.reinf_material)
if(W.reinf_material && !advanced)//R wall but no good drill
occupant_message("<span class='warning'>[target] is too durable to drill through.</span>")
return
else if((W.reinf_material && advanced) || do_after_cooldown(target))//R wall with good drill
log_message("Drilled through [target]")
target.ex_act(3)
else
log_message("Drilled through [target]")
target.ex_act(2)
else if(istype(target, /turf/simulated/mineral))
if(enable_special)
for(var/turf/simulated/mineral/M in range(chassis,1))
@@ -54,44 +61,7 @@
origin_tech = list(TECH_MATERIAL = 4, TECH_ENGINEERING = 3)
equip_cooldown = 10
force = 15
/obj/item/mecha_parts/mecha_equipment/tool/drill/diamonddrill/action(atom/target)
if(!action_checks(target)) return
if(isobj(target))
var/obj/target_obj = target
if(target_obj.unacidable) return
set_ready_state(0)
chassis.use_power(energy_drain)
chassis.visible_message("<span class='danger'>[chassis] starts to drill [target]</span>", "<span class='warning'>You hear the drill.</span>")
occupant_message("<span class='danger'>You start to drill [target]</span>")
var/T = chassis.loc
var/C = target.loc //why are these backwards? we may never know -Pete
if(do_after_cooldown(target))
if(T == chassis.loc && src == chassis.selected)
if(istype(target, /turf/simulated/wall))
var/turf/simulated/wall/W = target
if(!W.reinf_material || do_after_cooldown(target))//To slow down how fast mechs can drill through the station
log_message("Drilled through [target]")
target.ex_act(3)
else if(istype(target, /turf/simulated/mineral))
if(enable_special)
for(var/turf/simulated/mineral/M in range(chassis,1))
if(get_dir(chassis,M)&chassis.dir)
M.GetDrilled()
else
var/turf/simulated/mineral/M1 = target
M1.GetDrilled()
log_message("Drilled through [target]")
if(locate(/obj/item/mecha_parts/mecha_equipment/tool/hydraulic_clamp) in chassis.equipment)
var/obj/structure/ore_box/ore_box = locate(/obj/structure/ore_box) in chassis:cargo
if(ore_box)
for(var/obj/item/weapon/ore/ore in range(chassis,1))
if(get_dir(chassis,ore)&chassis.dir)
ore.forceMove(ore_box)
else if(target.loc == C)
log_message("Drilled through [target]")
target.ex_act(2)
return 1
advanced = 1
/obj/item/mecha_parts/mecha_equipment/tool/drill/bore
name = "depth bore"