Skip to content

Commit

Permalink
code cutdown ho!
Browse files Browse the repository at this point in the history
  • Loading branch information
SECBATON-GRIFFON committed Jan 1, 2025
1 parent a19cd85 commit da171d8
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 70 deletions.
37 changes: 2 additions & 35 deletions code/game/mecha/combat/roswell.dm
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@
max_equip = 3
plane = ABOVE_HUMAN_PLANE
layer = VEHICLE_LAYER
drifts = FALSE

/obj/mecha/combat/roswell/mechturn(direction)
dir = direction
Expand All @@ -25,46 +26,12 @@

/obj/mecha/combat/roswell/mechsteprand()
return step_rand(src)

/obj/mecha/combat/roswell/Process_Spacemove(var/check_drift = 0) //invaders from outer spaaace
if(has_charge(step_energy_drain))
return TRUE //doesn't drift in space if it has power
return FALSE

/obj/mecha/combat/roswell/can_apply_inertia()
/obj/mecha/combat/roswell/can_apply_inertia() //invaders from outer spaaace
if(has_charge(step_energy_drain))
return FALSE //doesn't drift in space if it has power
return TRUE

//duplicate of parent proc, but without space drifting
/obj/mecha/combat/roswell/dyndomove(direction)
stopMechWalking()
if(!can_move)
return 0
if(src.pr_inertial_movement.active())
return 0
if(!has_charge(step_energy_drain))
return 0
var/move_result = 0
startMechWalking()
if(hasInternalDamage(MECHA_INT_CONTROL_LOST))
move_result = mechsteprand()
else if(src.dir!=direction)
move_result = mechturn(direction)
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.")*/
spawn(step_in)
can_move = 1
return 1
return 0

/obj/mecha/combat/roswell/preloaded/New()
..()
new /obj/item/mecha_parts/mecha_equipment/tool/ayy/abductor(src)
Expand Down
5 changes: 4 additions & 1 deletion code/game/mecha/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -101,6 +101,7 @@

var/list/mech_sprites = list() //sprites alternatives for a given mech. Only have to enter the name of the paint scheme
var/paintable = 0
var/drifts = TRUE

/obj/mecha/get_cell()
return cell
Expand Down Expand Up @@ -199,6 +200,8 @@
throwing = 2//dashing through windows and grilles

/obj/mecha/can_apply_inertia()
if(!drifts && has_charge(step_energy_drain))
return 0 //doesn't drift in space if it has power and drifting is disabled
return 1 //No anchored check - so that mechas can fly off into space

/obj/mecha/is_airtight()
Expand Down Expand Up @@ -407,7 +410,7 @@
ME.on_mech_turn()
can_move = 0
use_power(step_energy_drain)
if(istype(src.loc, /turf/space))
if(drifts && 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.")
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,40 +7,12 @@
step_energy_drain = 2
step_in = 1
wreckage = /obj/effect/decal/mecha_wreckage/hoverpod
drifts = FALSE

/obj/mecha/working/hoverpod/Destroy()
new /datum/artifact_postmortem_data(src)
..()

//duplicate of parent proc, but without space drifting
/obj/mecha/working/hoverpod/dyndomove(direction)
stopMechWalking()
if(!can_move)
return 0
if(src.pr_inertial_movement.active())
return 0
if(!has_charge(step_energy_drain))
return 0
var/move_result = 0
startMechWalking()
if(hasInternalDamage(MECHA_INT_CONTROL_LOST))
move_result = mechsteprand()
else if(src.dir!=direction)
move_result = mechturn(direction)
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.")*/
spawn(step_in)
can_move = 1
return 1
return 0

/obj/mecha/working/hoverpod/startMechWalking()
..()
var/turf/mech_turf = get_turf(src)
Expand Down Expand Up @@ -72,11 +44,6 @@
playsound(src,'sound/machines/hiss.ogg',40,1)
return result

/obj/mecha/working/hoverpod/can_apply_inertia()
if(has_charge(step_energy_drain))
return 0 //doesn't drift in space if it has power
return 1

/obj/effect/decal/mecha_wreckage/hoverpod
name = "Hover pod wreckage"
icon_state = "engineering_pod-broken"
Expand Down

0 comments on commit da171d8

Please sign in to comment.