diff --git a/code/modules/mechs/components/legs.dm b/code/modules/mechs/components/legs.dm index 37057f66d8..ef084de154 100644 --- a/code/modules/mechs/components/legs.dm +++ b/code/modules/mechs/components/legs.dm @@ -7,6 +7,8 @@ var/obj/item/robot_parts/robot_component/actuator/motivator power_use = 50 var/max_fall_damage = 30 + var/can_strafe = FALSE + var/good_in_strafe = FALSE //Влияет на эффективность стрейфа, используйте когда мир будет к нему готов. /obj/item/mech_component/propulsion/Destroy() QDEL_NULL(motivator) @@ -60,4 +62,4 @@ if(max_fall_damage > 0) var/mob/living/exosuit/E = loc if(istype(E)) //route it through exosuit for proper handling - E.apply_damage(rand(0, max_fall_damage), BRUTE, BP_R_LEG) //Any leg is good, will damage us correctly \ No newline at end of file + E.apply_damage(rand(0, max_fall_damage), BRUTE, BP_R_LEG) //Any leg is good, will damage us correctly diff --git a/code/modules/mechs/mech.dm b/code/modules/mechs/mech.dm index 5fd13aa78c..6d2315583a 100644 --- a/code/modules/mechs/mech.dm +++ b/code/modules/mechs/mech.dm @@ -214,12 +214,13 @@ if(.) update_pilots() -/mob/living/exosuit/proc/toggle_power(var/mob/user) +/mob/living/exosuit/proc/toggle_power(var/mob/user) //Отвечает за энергообеспечение меха, обновляет спрайты меха и его модулей при изменении питания if(power == MECH_POWER_TRANSITION) to_chat(user, SPAN_NOTICE("Power transition in progress. Please wait.")) else if(power == MECH_POWER_ON) //Turning it off is instant playsound(src, 'sound/mecha/mech-shutdown.ogg', 100, 0) power = MECH_POWER_OFF + update_icon() else if(get_cell(TRUE)) //Start power up sequence power = MECH_POWER_TRANSITION @@ -230,6 +231,7 @@ else to_chat(user, SPAN_WARNING("You abort the powerup sequence.")) power = MECH_POWER_OFF + update_icon() hud_power_control?.queue_icon_update() else to_chat(user, SPAN_WARNING("Error: No power cell was detected.")) diff --git a/code/modules/mechs/mech_icon.dm b/code/modules/mechs/mech_icon.dm index 1a607fe8c7..3f6264adba 100644 --- a/code/modules/mechs/mech_icon.dm +++ b/code/modules/mechs/mech_icon.dm @@ -48,8 +48,11 @@ proc/get_mech_images(var/list/components = list(), var/overlay_layer = FLOAT_LAY var/obj/item/mech_equipment/hardpoint_object = hardpoints[hardpoint] if(hardpoint_object) var/use_icon_state = "[hardpoint_object.icon_state]_[hardpoint]" - if(use_icon_state in GLOB.mech_weapon_overlays) - new_overlays += get_mech_image(null, use_icon_state, 'icons/mecha/mech_weapon_overlays.dmi', null, hardpoint_object.mech_layer ) + if(power == MECH_POWER_ON) + if(use_icon_state in GLOB.mech_weapon_overlays) + new_overlays += get_mech_image(null, use_icon_state, 'icons/mecha/mech_weapon_overlays.dmi', null, hardpoint_object.mech_layer ) + else + new_overlays += get_mech_image(null, use_icon_state, 'icons/mecha/mech_weapon_overlays_off.dmi', null, hardpoint_object.mech_layer ) overlays = new_overlays /mob/living/exosuit/proc/update_pilots(var/update_overlays = TRUE) @@ -76,4 +79,4 @@ proc/get_mech_images(var/list/components = list(), var/overlay_layer = FLOAT_LAY overlays += pilot_overlays /mob/living/exosuit/regenerate_icons() - return \ No newline at end of file + return diff --git a/code/modules/mechs/mech_movement.dm b/code/modules/mechs/mech_movement.dm index bc09218caa..b61f3979fe 100644 --- a/code/modules/mechs/mech_movement.dm +++ b/code/modules/mechs/mech_movement.dm @@ -12,7 +12,7 @@ playsound(src.loc, mech_step_sound, 40, 1) /mob/living/exosuit/can_ztravel() - if(Allow_Spacemove()) //Handle here + if(Allow_Spacemove()) //Handle here return TRUE /mob/living/exosuit/Allow_Spacemove(check_drift) @@ -43,7 +43,7 @@ /mob/living/exosuit/can_float() return FALSE //Nope - + /datum/movement_handler/mob/delay/exosuit expected_host_type = /mob/living/exosuit @@ -115,16 +115,43 @@ var/txt_dir = direction & UP ? "upwards" : "downwards" exosuit.visible_message(SPAN_NOTICE("\The [exosuit] moves [txt_dir].")) +//STRAFE + if(exosuit.legs.can_strafe) + for(var/thing in exosuit.pilots) //Для всех пилотов внутри + var/mob/pilot = thing + if(pilot && pilot.client) + for(var/key in pilot.client.keys_held) + if (key == "Space") + var/move_speed = exosuit.legs.move_delay + if(!exosuit.legs.good_in_strafe) + move_speed = move_speed * 2.5 + if(direction == NORTHWEST || direction == NORTHEAST || direction == SOUTHWEST || direction == SOUTHEAST) + move_speed = sqrt((move_speed*move_speed) + (move_speed * move_speed)) + if(move_speed > 12) + move_speed = 12 + exosuit.SetMoveCooldown(exosuit.legs ? move_speed : 3) + var/turf/target_loc = get_step(exosuit, direction) + if(target_loc && exosuit.legs && exosuit.legs.can_move_on(exosuit.loc, target_loc) && exosuit.MayEnterTurf(target_loc)) + exosuit.Move(target_loc) + return MOVEMENT_HANDLED +//STRAFE + +//TURN if(exosuit.dir != moving_dir && !(direction & (UP|DOWN))) playsound(exosuit.loc, exosuit.mech_turn_sound, 40,1) exosuit.set_dir(moving_dir) exosuit.SetMoveCooldown(exosuit.legs.turn_delay) +//TURN + +//MOVE else exosuit.SetMoveCooldown(exosuit.legs ? exosuit.legs.move_delay : 3) var/turf/target_loc = get_step(exosuit, direction) if(target_loc && exosuit.legs && exosuit.legs.can_move_on(exosuit.loc, target_loc) && exosuit.MayEnterTurf(target_loc)) exosuit.Move(target_loc) return MOVEMENT_HANDLED +//MOVE + /datum/movement_handler/mob/space/exosuit expected_host_type = /mob/living/exosuit @@ -140,7 +167,7 @@ return MOVEMENT_HANDLED else mob.inertia_dir = 0 //If not then we can reset inertia and move - else + else mob.anchored = TRUE mob.inertia_dir = 0 //Reset inertia values as we are not going to be treated as floating diff --git a/code/modules/mechs/premade/misc.dm b/code/modules/mechs/premade/misc.dm index ac1b84ba9b..fe2fb1b55e 100644 --- a/code/modules/mechs/premade/misc.dm +++ b/code/modules/mechs/premade/misc.dm @@ -7,6 +7,7 @@ move_delay = 4 turn_delay = 1 power_use = 25 + can_strafe = TRUE /obj/item/mech_component/propulsion/tracks name = "tracks" diff --git a/icons/mecha/mech_parts_held.dmi b/icons/mecha/mech_parts_held.dmi index 0276b3fb0a..65b1087996 100644 Binary files a/icons/mecha/mech_parts_held.dmi and b/icons/mecha/mech_parts_held.dmi differ diff --git a/icons/mecha/mech_parts_off.dmi b/icons/mecha/mech_parts_off.dmi new file mode 100644 index 0000000000..458fe59372 Binary files /dev/null and b/icons/mecha/mech_parts_off.dmi differ diff --git a/icons/mecha/mech_weapon_overlays_off.dmi b/icons/mecha/mech_weapon_overlays_off.dmi new file mode 100644 index 0000000000..ca6a6ff7ac Binary files /dev/null and b/icons/mecha/mech_weapon_overlays_off.dmi differ