mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-10 18:22:39 +00:00
Small mech tweaks
This commit is contained in:
@@ -27,16 +27,16 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid/attach(obj/mecha/M as obj)
|
||||
..()
|
||||
droid_overlay = new(src.icon, icon_state = "repair_droid")
|
||||
M.overlays += droid_overlay
|
||||
M.add_overlay(droid_overlay)
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid/destroy()
|
||||
chassis.overlays -= droid_overlay
|
||||
chassis.cut_overlay(droid_overlay)
|
||||
..()
|
||||
return
|
||||
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid/detach()
|
||||
chassis.overlays -= droid_overlay
|
||||
chassis.cut_overlay(droid_overlay)
|
||||
pr_repair_droid.stop()
|
||||
..()
|
||||
return
|
||||
@@ -49,7 +49,7 @@
|
||||
/obj/item/mecha_parts/mecha_equipment/repair_droid/Topic(href, href_list)
|
||||
..()
|
||||
if(href_list["toggle_repairs"])
|
||||
chassis.overlays -= droid_overlay
|
||||
chassis.cut_overlay(droid_overlay)
|
||||
if(pr_repair_droid.toggle())
|
||||
droid_overlay = new(src.icon, icon_state = "repair_droid_a")
|
||||
log_message("Activated.")
|
||||
@@ -57,7 +57,7 @@
|
||||
droid_overlay = new(src.icon, icon_state = "repair_droid")
|
||||
log_message("Deactivated.")
|
||||
set_ready_state(1)
|
||||
chassis.overlays += droid_overlay
|
||||
chassis.add_overlay(droid_overlay)
|
||||
send_byjax(chassis.occupant,"exosuit.browser","\ref[src]",src.get_equip_info())
|
||||
return
|
||||
|
||||
|
||||
@@ -259,7 +259,9 @@
|
||||
|
||||
|
||||
/obj/mecha/proc/check_for_support()
|
||||
if(locate(/obj/structure/grille, orange(1, src)) || locate(/obj/structure/lattice, orange(1, src)) || locate(/turf/simulated, orange(1, src)) || locate(/turf/unsimulated, orange(1, src)))
|
||||
var/list/things = orange(1, src)
|
||||
|
||||
if(locate(/obj/structure/grille in things) || locate(/obj/structure/lattice in things) || locate(/turf/simulated in things) || locate(/turf/unsimulated in things))
|
||||
return 1
|
||||
else
|
||||
return 0
|
||||
@@ -397,21 +399,26 @@
|
||||
/obj/mecha/relaymove(mob/user,direction)
|
||||
if(user != src.occupant) //While not "realistic", this piece is player friendly.
|
||||
if(istype(user,/mob/living/carbon/brain))
|
||||
to_chat(user, "You try to move, but you are not the pilot! The exosuit doesn't respond.")
|
||||
to_chat(user, "<span class='warning'>You try to move, but you are not the pilot! The exosuit doesn't respond.</span>")
|
||||
return 0
|
||||
user.forceMove(get_turf(src))
|
||||
to_chat(user, "You climb out from [src]")
|
||||
return 0
|
||||
if(connected_port)
|
||||
if(world.time - last_message > 20)
|
||||
src.occupant_message("Unable to move while connected to the air system port")
|
||||
src.occupant_message("<span class='warning'>Unable to move while connected to the air system port</span>")
|
||||
last_message = world.time
|
||||
return 0
|
||||
if(state)
|
||||
occupant_message("<font color='red'>Maintenance protocols in effect</font>")
|
||||
occupant_message("<span class='warning'>Maintenance protocols in effect</span>")
|
||||
return
|
||||
return domove(direction)
|
||||
|
||||
/obj/mecha/proc/can_ztravel()
|
||||
for(var/obj/item/mecha_parts/mecha_equipment/tool/jetpack/jp in equipment)
|
||||
return jp.equip_ready
|
||||
return FALSE
|
||||
|
||||
/obj/mecha/proc/domove(direction)
|
||||
|
||||
return call((proc_res["dyndomove"]||src), "dyndomove")(direction)
|
||||
@@ -423,20 +430,51 @@
|
||||
return 0
|
||||
if(!has_charge(step_energy_drain))
|
||||
return 0
|
||||
|
||||
var/move_result = 0
|
||||
|
||||
if(hasInternalDamage(MECHA_INT_CONTROL_LOST))
|
||||
move_result = mechsteprand()
|
||||
else if(src.dir!=direction)
|
||||
//Up/down zmove
|
||||
else if(direction & UP || direction & DOWN)
|
||||
if(!can_ztravel())
|
||||
occupant_message("<span class='warning'>Your vehicle lacks the capacity to move in that direction!</span>")
|
||||
return FALSE
|
||||
|
||||
//We're using locs because some mecha are 2x2 turfs. So thicc!
|
||||
var/result = TRUE
|
||||
|
||||
for(var/turf/T in locs)
|
||||
if(!T.CanZPass(src,direction))
|
||||
occupant_message("<span class='warning'>You can't move that direction from here!</span>")
|
||||
result = FALSE
|
||||
break
|
||||
var/turf/dest = direction & UP ? GetAbove(T) : GetBelow(T)
|
||||
if(!dest)
|
||||
occupant_message("<span class='notice'>There is nothing of interest in this direction.</span>")
|
||||
result = FALSE
|
||||
break
|
||||
if(!dest.CanZPass(src,direction))
|
||||
occupant_message("<span class='warning'>There's something blocking your movement in that direction!</span>")
|
||||
result = FALSE
|
||||
break
|
||||
if(result)
|
||||
move_result = mechstep(direction)
|
||||
//Turning
|
||||
else if(src.dir != direction)
|
||||
move_result = mechturn(direction)
|
||||
//Stepping
|
||||
else
|
||||
move_result = mechstep(direction)
|
||||
|
||||
|
||||
if(move_result)
|
||||
can_move = 0
|
||||
use_power(step_energy_drain)
|
||||
if(istype(src.loc, /turf/space))
|
||||
if(!src.check_for_support())
|
||||
src.pr_inertial_movement.start(list(src,direction))
|
||||
src.log_message("Movement control lost. Inertial movement started.")
|
||||
src.log_message("<span class='warning'>Movement control lost. Inertial movement started.</span>")
|
||||
if(do_after(step_in))
|
||||
can_move = 1
|
||||
return 1
|
||||
|
||||
@@ -26,11 +26,20 @@
|
||||
max_universal_equip = 1
|
||||
max_special_equip = 1
|
||||
|
||||
/obj/mecha/working/hoverpod/New()
|
||||
..()
|
||||
/obj/mecha/working/hoverpod/Initialize()
|
||||
. = ..()
|
||||
ion_trail = new /datum/effect/effect/system/ion_trail_follow()
|
||||
ion_trail.set_up(src)
|
||||
ion_trail.start()
|
||||
|
||||
/obj/mecha/working/hoverpod/moved_inside(var/mob/living/carbon/human/H as mob)
|
||||
. = ..(H)
|
||||
if(.)
|
||||
ion_trail.start()
|
||||
|
||||
/obj/mecha/working/hoverpod/go_out()
|
||||
. = ..()
|
||||
if(!occupant)
|
||||
ion_trail.stop()
|
||||
|
||||
//Modified phazon code
|
||||
/obj/mecha/working/hoverpod/Topic(href, href_list)
|
||||
@@ -52,6 +61,9 @@
|
||||
output += ..()
|
||||
return output
|
||||
|
||||
/obj/mecha/working/hoverpod/can_ztravel()
|
||||
return (stabilization_enabled && has_charge(step_energy_drain))
|
||||
|
||||
// No space drifting
|
||||
/obj/mecha/working/hoverpod/check_for_support()
|
||||
//does the hoverpod have enough charge left to stabilize itself?
|
||||
@@ -106,7 +118,7 @@
|
||||
max_special_equip = 1
|
||||
|
||||
/obj/mecha/working/hoverpod/combatpod/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/laser
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive
|
||||
@@ -117,7 +129,7 @@
|
||||
desc = "Who knew a tiny ball could fit three people?"
|
||||
|
||||
/obj/mecha/working/hoverpod/shuttlepod/Initialize()
|
||||
..()
|
||||
. = ..()
|
||||
var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger
|
||||
ME.attach(src)
|
||||
ME = new /obj/item/mecha_parts/mecha_equipment/tool/passenger
|
||||
|
||||
@@ -41,44 +41,30 @@
|
||||
max_universal_equip = 1
|
||||
max_special_equip = 1
|
||||
|
||||
/obj/mecha/working/hoverpod/Initialize()
|
||||
..()
|
||||
ion_trail.stop()
|
||||
|
||||
/obj/mecha/working/hoverpod/shuttlecraft/moved_inside(var/mob/living/carbon/human/H as mob)
|
||||
. = ..(H)
|
||||
if(.)
|
||||
ion_trail.start()
|
||||
|
||||
/obj/mecha/working/hoverpod/shuttlecraft/go_out()
|
||||
. = ..()
|
||||
if(!occupant)
|
||||
ion_trail.stop()
|
||||
|
||||
/obj/mecha/working/hoverpod/shuttlecraft/update_icon()
|
||||
overlays.Cut()
|
||||
cut_overlays()
|
||||
..()
|
||||
|
||||
if(base_paint)
|
||||
if(!base_paint_mask)
|
||||
base_paint_mask = image(icon, "[initial_icon]-mask+base", src.layer + 1)
|
||||
base_paint_mask.color = base_paint
|
||||
overlays |= base_paint_mask
|
||||
add_overlay(base_paint_mask)
|
||||
if(front_paint)
|
||||
if(!front_paint_mask)
|
||||
front_paint_mask = image(icon, "[initial_icon]-mask+front", src.layer + 1)
|
||||
front_paint_mask.color = front_paint
|
||||
overlays |= front_paint_mask
|
||||
add_overlay(front_paint_mask)
|
||||
if(engine_paint)
|
||||
if(!engine_paint_mask)
|
||||
engine_paint_mask = image(icon, "[initial_icon]-mask+engine", src.layer + 1)
|
||||
engine_paint_mask.color = engine_paint
|
||||
overlays |= engine_paint_mask
|
||||
add_overlay(engine_paint_mask)
|
||||
if(central_paint)
|
||||
if(!engine_paint_mask)
|
||||
central_paint_mask = image(icon, "[initial_icon]-mask+central", src.layer + 2)
|
||||
central_paint_mask.color = central_paint
|
||||
overlays |= central_paint_mask
|
||||
add_overlay(central_paint_mask)
|
||||
|
||||
/obj/mecha/working/hoverpod/shuttlecraft/attackby(obj/item/weapon/W as obj, mob/user as mob)
|
||||
if(istype(W,/obj/item/device/multitool) && state == 1)
|
||||
|
||||
@@ -15,6 +15,10 @@
|
||||
/mob/proc/zMove(direction)
|
||||
if(eyeobj)
|
||||
return eyeobj.zMove(direction)
|
||||
if(istype(loc,/obj/mecha))
|
||||
var/obj/mecha/mech = loc
|
||||
return mech.relaymove(src,direction)
|
||||
|
||||
if(!can_ztravel())
|
||||
to_chat(src, "<span class='warning'>You lack means of travel in that direction.</span>")
|
||||
return
|
||||
|
||||
Reference in New Issue
Block a user