diff --git a/code/__DEFINES/mecha.dm b/code/__DEFINES/mecha.dm index 9acc9bfa9b9..4a90a32d084 100644 --- a/code/__DEFINES/mecha.dm +++ b/code/__DEFINES/mecha.dm @@ -15,6 +15,8 @@ #define QUIET_TURNS (1<<8) ///blocks using equipment and melee attacking. #define CANNOT_INTERACT (1<<9) +/// posibrains can drive this mecha +#define MMI_COMPATIBLE (1<<10) #define MECHA_MELEE (1 << 0) #define MECHA_RANGED (1 << 1) diff --git a/code/modules/vehicles/mecha/_mecha.dm b/code/modules/vehicles/mecha/_mecha.dm index 0ac9c640ce7..65d545dfac1 100644 --- a/code/modules/vehicles/mecha/_mecha.dm +++ b/code/modules/vehicles/mecha/_mecha.dm @@ -58,7 +58,7 @@ ///Whether the mechs maintenance protocols are on or off var/construction_state = MECHA_LOCKED ///Contains flags for the mecha - var/mecha_flags = ADDING_ACCESS_POSSIBLE | CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS + var/mecha_flags = ADDING_ACCESS_POSSIBLE | CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS | MMI_COMPATIBLE ///Stores the DNA enzymes of a carbon so tht only they can access the mech var/dna_lock ///Spark effects are handled by this datum @@ -978,15 +978,17 @@ SEND_SOUND(newoccupant, sound('sound/mecha/nominal.ogg',volume=50)) return TRUE -/obj/vehicle/sealed/mecha/proc/mmi_move_inside(obj/item/mmi/M, mob/user) - if(!M.brain_check(user)) +/obj/vehicle/sealed/mecha/proc/mmi_move_inside(obj/item/mmi/brain_obj, mob/user) + if(!(mecha_flags & MMI_COMPATIBLE)) + to_chat(user, span_warning("This mecha is not compatible with MMIs!")) return FALSE - - var/mob/living/brain/B = M.brainmob + if(!brain_obj.brain_check(user)) + return FALSE + var/mob/living/brain/brain_mob = brain_obj.brainmob if(LAZYLEN(occupants) >= max_occupants) to_chat(user, span_warning("It's full!")) return FALSE - if(dna_lock && (!B.stored_dna || (dna_lock != B.stored_dna.unique_enzymes))) + if(dna_lock && (!brain_mob.stored_dna || (dna_lock != brain_mob.stored_dna.unique_enzymes))) to_chat(user, span_warning("Access denied. [name] is secured with a DNA lock.")) return FALSE @@ -996,32 +998,32 @@ to_chat(user, span_notice("You stop inserting the MMI.")) return FALSE if(LAZYLEN(occupants) < max_occupants) - return mmi_moved_inside(M, user) + return mmi_moved_inside(brain_obj, user) to_chat(user, span_warning("Maximum occupants exceeded!")) return FALSE -/obj/vehicle/sealed/mecha/proc/mmi_moved_inside(obj/item/mmi/M, mob/user) - if(!(Adjacent(M) && Adjacent(user))) +/obj/vehicle/sealed/mecha/proc/mmi_moved_inside(obj/item/mmi/brain_obj, mob/user) + if(!(Adjacent(brain_obj) && Adjacent(user))) return FALSE - if(!M.brain_check(user)) + if(!brain_obj.brain_check(user)) return FALSE - var/mob/living/brain/B = M.brainmob - if(!user.transferItemToLoc(M, src)) - to_chat(user, span_warning("\the [M] is stuck to your hand, you cannot put it in \the [src]!")) + var/mob/living/brain/brain_mob = brain_obj.brainmob + if(!user.transferItemToLoc(brain_obj, src)) + to_chat(user, span_warning("[brain_obj] is stuck to your hand, you cannot put it in [src]!")) return FALSE - M.set_mecha(src) - add_occupant(B)//Note this forcemoves the brain into the mech to allow relaymove + brain_obj.set_mecha(src) + add_occupant(brain_mob)//Note this forcemoves the brain into the mech to allow relaymove mecha_flags |= SILICON_PILOT - B.reset_perspective(src) - B.remote_control = src - B.update_mouse_pointer() + brain_mob.reset_perspective(src) + brain_mob.remote_control = src + brain_mob.update_mouse_pointer() setDir(dir_in) - log_message("[M] moved in as pilot.", LOG_MECHA) + log_message("[brain_obj] moved in as pilot.", LOG_MECHA) if(!internal_damage) - SEND_SOUND(M, sound('sound/mecha/nominal.ogg',volume=50)) - log_game("[key_name(user)] has put the MMI/posibrain of [key_name(B)] into [src] at [AREACOORD(src)]") + SEND_SOUND(brain_obj, sound('sound/mecha/nominal.ogg',volume=50)) + log_game("[key_name(user)] has put the MMI/posibrain of [key_name(brain_mob)] into [src] at [AREACOORD(src)]") return TRUE /obj/vehicle/sealed/mecha/container_resist_act(mob/living/user) diff --git a/code/modules/vehicles/mecha/combat/honker.dm b/code/modules/vehicles/mecha/combat/honker.dm index edf276ed706..f14bedce1b6 100644 --- a/code/modules/vehicles/mecha/combat/honker.dm +++ b/code/modules/vehicles/mecha/combat/honker.dm @@ -12,7 +12,7 @@ operation_req_access = list(ACCESS_THEATRE) internals_req_access = list(ACCESS_MECH_SCIENCE, ACCESS_THEATRE) wreckage = /obj/structure/mecha_wreckage/honker - mecha_flags = CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS + mecha_flags = CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS | MMI_COMPATIBLE max_equip = 3 var/squeak = TRUE diff --git a/code/modules/vehicles/mecha/combat/marauder.dm b/code/modules/vehicles/mecha/combat/marauder.dm index c24f50fee7e..01fe013df47 100644 --- a/code/modules/vehicles/mecha/combat/marauder.dm +++ b/code/modules/vehicles/mecha/combat/marauder.dm @@ -12,7 +12,7 @@ operation_req_access = list(ACCESS_CENT_SPECOPS) internals_req_access = list(ACCESS_CENT_SPECOPS) wreckage = /obj/structure/mecha_wreckage/marauder - mecha_flags = CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS + mecha_flags = CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS | MMI_COMPATIBLE internal_damage_threshold = 25 force = 45 max_equip = 5 diff --git a/code/modules/vehicles/mecha/combat/reticence.dm b/code/modules/vehicles/mecha/combat/reticence.dm index 1c59ce817b6..10561e6ad15 100644 --- a/code/modules/vehicles/mecha/combat/reticence.dm +++ b/code/modules/vehicles/mecha/combat/reticence.dm @@ -12,7 +12,7 @@ wreckage = /obj/structure/mecha_wreckage/reticence operation_req_access = list(ACCESS_THEATRE) internals_req_access = list(ACCESS_MECH_SCIENCE, ACCESS_THEATRE) - mecha_flags = CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS | QUIET_STEPS | QUIET_TURNS + mecha_flags = CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS | QUIET_STEPS | QUIET_TURNS | MMI_COMPATIBLE internal_damage_threshold = 25 max_equip = 2 step_energy_drain = 3 diff --git a/code/modules/vehicles/mecha/combat/savannah_ivanov.dm b/code/modules/vehicles/mecha/combat/savannah_ivanov.dm index 032c8756852..712db29df03 100644 --- a/code/modules/vehicles/mecha/combat/savannah_ivanov.dm +++ b/code/modules/vehicles/mecha/combat/savannah_ivanov.dm @@ -22,6 +22,8 @@ icon = 'icons/mecha/coop_mech.dmi' base_icon_state = "savannah_ivanov" icon_state = "savannah_ivanov_0_0" + //does not include mmi compatibility + mecha_flags = ADDING_ACCESS_POSSIBLE | CANSTRAFE | IS_ENCLOSED | HAS_LIGHTS movedelay = 3 dir_in = 2 //Facing South. max_integrity = 450 //really tanky, like damn diff --git a/code/modules/vehicles/mecha/working/clarke.dm b/code/modules/vehicles/mecha/working/clarke.dm index 78b113fb6d7..9bb9d7f9381 100644 --- a/code/modules/vehicles/mecha/working/clarke.dm +++ b/code/modules/vehicles/mecha/working/clarke.dm @@ -15,7 +15,7 @@ max_equip = 7 wreckage = /obj/structure/mecha_wreckage/clarke enter_delay = 40 - mecha_flags = ADDING_ACCESS_POSSIBLE | IS_ENCLOSED | HAS_LIGHTS + mecha_flags = ADDING_ACCESS_POSSIBLE | IS_ENCLOSED | HAS_LIGHTS | MMI_COMPATIBLE internals_req_access = list(ACCESS_MECH_ENGINE, ACCESS_MECH_SCIENCE, ACCESS_MECH_MINING) /obj/vehicle/sealed/mecha/working/clarke/Initialize()