[MIRROR] Humans no longer "enter" mechs twice [MDB IGNORE] (#12427)

* Humans no longer "enter" mechs twice

* Update sealed.dm

* Update sealed.dm

Co-authored-by: TiviPlus <57223640+TiviPlus@users.noreply.github.com>
Co-authored-by: Gandalf <9026500+Gandalf2k15@users.noreply.github.com>
Co-authored-by: KathrinBailey <53862927+KathrinBailey@users.noreply.github.com>
This commit is contained in:
SkyratBot
2022-04-01 01:44:43 +01:00
committed by GitHub
co-authored by TiviPlus Gandalf KathrinBailey
parent 89138387cf
commit ddb79e8b27
2 changed files with 26 additions and 35 deletions
+20 -34
View File
@@ -297,6 +297,13 @@
if(driver_amount() < max_drivers)
add_control_flags(M, FULL_MECHA_CONTROL)
/obj/vehicle/sealed/mecha/generate_actions()
initialize_passenger_action_type(/datum/action/vehicle/sealed/mecha/mech_eject)
initialize_controller_action_type(/datum/action/vehicle/sealed/mecha/mech_toggle_internals, VEHICLE_CONTROL_SETTINGS)
initialize_controller_action_type(/datum/action/vehicle/sealed/mecha/mech_toggle_lights, VEHICLE_CONTROL_SETTINGS)
initialize_controller_action_type(/datum/action/vehicle/sealed/mecha/mech_view_stats, VEHICLE_CONTROL_SETTINGS)
initialize_controller_action_type(/datum/action/vehicle/sealed/mecha/strafe, VEHICLE_CONTROL_DRIVE)
/obj/vehicle/sealed/mecha/proc/get_mecha_occupancy_state()
if((mecha_flags & SILICON_PILOT) && silicon_icon_state)
return silicon_icon_state
@@ -985,8 +992,6 @@
pilot_mob.forceMove(get_turf(src))
update_appearance()
/obj/vehicle/sealed/mecha/mob_try_enter(mob/M)
if(!ishuman(M)) // no silicons or drones in mechas.
return
@@ -1004,39 +1009,24 @@
to_chat(M, span_warning("Access denied. Insufficient operation keycodes."))
log_message("Permission denied (No keycode).", LOG_MECHA)
return
. = ..()
if(.)
moved_inside(M)
/obj/vehicle/sealed/mecha/enter_checks(mob/M)
if(atom_integrity <= 0)
to_chat(M, span_warning("You cannot get in the [src], it has been destroyed!"))
return FALSE
if(M.buckled)
to_chat(M, span_warning("You are currently buckled and cannot move."))
to_chat(M, span_warning("You can't enter the exosuit while buckled."))
log_message("Permission denied (Buckled).", LOG_MECHA)
return
if(M.has_buckled_mobs()) //mob attached to us
return FALSE
if(M.has_buckled_mobs())
to_chat(M, span_warning("You can't enter the exosuit with other creatures attached to you!"))
log_message("Permission denied (Attached mobs).", LOG_MECHA)
return
return FALSE
return ..()
visible_message(span_notice("[M] starts to climb into [name]."))
if(do_after(M, enter_delay, target = src))
if(atom_integrity <= 0)
to_chat(M, span_warning("You cannot get in the [name], it has been destroyed!"))
else if(LAZYLEN(occupants) >= max_occupants)
to_chat(M, span_danger("[occupants[length(occupants)]] was faster! Try better next time, loser."))//get the last one that hopped in
else if(M.buckled)
to_chat(M, span_warning("You can't enter the exosuit while buckled."))
else if(M.has_buckled_mobs())
to_chat(M, span_warning("You can't enter the exosuit with other creatures attached to you!"))
else
moved_inside(M)
return ..()
else
to_chat(M, span_warning("You stop entering the exosuit!"))
/obj/vehicle/sealed/mecha/generate_actions()
initialize_passenger_action_type(/datum/action/vehicle/sealed/mecha/mech_eject)
initialize_controller_action_type(/datum/action/vehicle/sealed/mecha/mech_toggle_internals, VEHICLE_CONTROL_SETTINGS)
initialize_controller_action_type(/datum/action/vehicle/sealed/mecha/mech_toggle_lights, VEHICLE_CONTROL_SETTINGS)
initialize_controller_action_type(/datum/action/vehicle/sealed/mecha/mech_view_stats, VEHICLE_CONTROL_SETTINGS)
initialize_controller_action_type(/datum/action/vehicle/sealed/mecha/strafe, VEHICLE_CONTROL_DRIVE)
/obj/vehicle/sealed/mecha/proc/moved_inside(mob/living/newoccupant)
if(!(newoccupant?.client))
@@ -1129,10 +1119,6 @@
else if(isAI(M))
var/mob/living/silicon/ai/AI = M
if(forced)//This should only happen if there are multiple AIs in a round, and at least one is Malf.
//SKYRAT EDIT ADDITION BEGIN -- MECH CI
disable_ci(AI)
UnregisterSignal(AI, COMSIG_MOB_CI_TOGGLED) // Manual override because this doesn't finish the proc normally.
//SKYRAT EDIT ADDITION END
AI.gib() //If one Malf decides to steal a mech from another AI (even other Malfs!), they are destroyed, as they have nowhere to go when replaced.
AI = null
mecha_flags &= ~SILICON_PILOT
+6 -1
View File
@@ -54,14 +54,19 @@
to_chat(M, span_warning("You are far too big for this!"))
return FALSE
//SKYRAT EDIT END
if(do_after(M, get_enter_delay(M), src, timed_action_flags = IGNORE_HELD_ITEM))
if(do_after(M, get_enter_delay(M), src, timed_action_flags = IGNORE_HELD_ITEM, extra_checks = CALLBACK(src, .proc/enter_checks, M)))
mob_enter(M)
return TRUE
return FALSE
/// returns enter do_after delay for the given mob in ticks
/obj/vehicle/sealed/proc/get_enter_delay(mob/M)
return enter_delay
///Extra checks to perform during the do_after to enter the vehicle
/obj/vehicle/sealed/proc/enter_checks(mob/M)
return occupant_amount() < max_occupants
/obj/vehicle/sealed/proc/mob_enter(mob/M, silent = FALSE)
if(!istype(M))
return FALSE