diff --git a/code/_onclick/hud/alert.dm b/code/_onclick/hud/alert.dm index 0ededa09c22..3081880394f 100644 --- a/code/_onclick/hud/alert.dm +++ b/code/_onclick/hud/alert.dm @@ -322,7 +322,7 @@ Recharging stations are available in robotics, the dormitory bathrooms, and the /obj/screen/alert/nymph/Click() if(!usr || !usr.client) - return + return if(isnymph(usr)) var/mob/living/simple_animal/diona/D = usr return D.resist() @@ -412,6 +412,26 @@ so as to remain in compliance with the most up-to-date laws." else to_chat(usr, "[M] is not connected to a port at the moment.") +/obj/screen/alert/mech_nocell + name = "Missing Power Cell" + desc = "Mech has no power cell." + icon_state = "nocell" + +/obj/screen/alert/mech_emptycell + name = "Out of Power" + desc = "Mech is out of power." + icon_state = "emptycell" + +/obj/screen/alert/mech_lowcell + name = "Low Charge" + desc = "Mech is running out of power." + icon_state = "lowcell" + +/obj/screen/alert/mech_maintenance + name = "Maintenance Protocols" + desc = "Maintenance protocols are currently in effect, most actions disabled." + icon_state = "locked" + //GUARDIANS /obj/screen/alert/cancharge name = "Charge Ready" diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm index c930df4b97b..1afdc52a34a 100644 --- a/code/game/mecha/combat/gygax.dm +++ b/code/game/mecha/combat/gygax.dm @@ -48,6 +48,7 @@ wreckage = /obj/effect/decal/mecha_wreckage/gygax/dark max_equip = 4 maxsize = 2 + starting_voice = /obj/item/mecha_modkit/voice/syndicate /obj/mecha/combat/gygax/dark/loaded/New() ..() diff --git a/code/game/mecha/combat/honker.dm b/code/game/mecha/combat/honker.dm index 751d93c944a..ce33ba75e91 100644 --- a/code/game/mecha/combat/honker.dm +++ b/code/game/mecha/combat/honker.dm @@ -15,6 +15,7 @@ wreckage = /obj/effect/decal/mecha_wreckage/honker add_req_access = 0 max_equip = 3 + starting_voice = /obj/item/mecha_modkit/voice/honk var/squeak = 0 /obj/mecha/combat/honker/loaded/New() diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm index 8e16b6128dd..aee96d7a7ae 100644 --- a/code/game/mecha/combat/marauder.dm +++ b/code/game/mecha/combat/marauder.dm @@ -17,6 +17,7 @@ internal_damage_threshold = 25 force = 45 max_equip = 5 + starting_voice = /obj/item/mecha_modkit/voice/nanotrasen /obj/mecha/combat/marauder/GrantActions(mob/living/user, human_occupant = 0) . = ..() @@ -89,6 +90,7 @@ initial_icon = "mauler" operation_req_access = list(access_syndicate) wreckage = /obj/effect/decal/mecha_wreckage/mauler + starting_voice = /obj/item/mecha_modkit/voice/syndicate /obj/mecha/combat/marauder/mauler/loaded/New() ..() diff --git a/code/game/mecha/combat/reticence.dm b/code/game/mecha/combat/reticence.dm index ba4566a1e91..436f60d90b2 100644 --- a/code/game/mecha/combat/reticence.dm +++ b/code/game/mecha/combat/reticence.dm @@ -15,10 +15,11 @@ add_req_access = 0 internal_damage_threshold = 60 max_equip = 3 - step_energy_drain = 3 + step_energy_drain = 3 normal_step_energy_drain = 3 stepsound = null turnsound = null + starting_voice = /obj/item/mecha_modkit/voice/silent /obj/mecha/combat/reticence/loaded/New() ..() diff --git a/code/game/mecha/equipment/mecha_equipment.dm b/code/game/mecha/equipment/mecha_equipment.dm index 743b8a097e6..7b3dcbf899d 100644 --- a/code/game/mecha/equipment/mecha_equipment.dm +++ b/code/game/mecha/equipment/mecha_equipment.dm @@ -34,9 +34,9 @@ chassis.occupant_message("The [src] is destroyed!") chassis.log_append_to_last("[src] is destroyed.",1) if(istype(src, /obj/item/mecha_parts/mecha_equipment/weapon)) - chassis.occupant << sound('sound/mecha/weapdestr.ogg', volume = 50) + chassis.occupant << sound(chassis.weapdestrsound, volume = 50) else - chassis.occupant << sound('sound/mecha/critdestr.ogg', volume = 50) + chassis.occupant << sound(chassis.critdestrsound, volume = 50) detach(chassis) return ..() diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 998228beee5..32ee1c19cde 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -76,6 +76,15 @@ var/stepsound = 'sound/mecha/mechstep.ogg' var/turnsound = 'sound/mecha/mechturn.ogg' + var/nominalsound = 'sound/mecha/nominal.ogg' + var/zoomsound = 'sound/mecha/imag_enh.ogg' + var/critdestrsound = 'sound/mecha/critdestr.ogg' + var/weapdestrsound = 'sound/mecha/weapdestr.ogg' + var/lowpowersound = 'sound/mecha/lowpower.ogg' + var/longactivationsound = 'sound/mecha/nominal.ogg' + var/starting_voice = /obj/item/mecha_modkit/voice + var/activated = FALSE + var/power_warned = FALSE var/melee_cooldown = 10 var/melee_can_hit = 1 @@ -121,6 +130,10 @@ diag_hud_set_mechstat() diag_hud_set_mechtracking() + var/obj/item/mecha_modkit/voice/V = new starting_voice(src) + V.install(src) + qdel(V) + //////////////////////// ////// Helpers ///////// //////////////////////// @@ -872,6 +885,16 @@ user.drop_item() qdel(P) + else if(istype(W, /obj/item/mecha_modkit)) + if(occupant) + to_chat(user, "You can't access the mech's modification port while it is occupied.") + return + var/obj/item/mecha_modkit/M = W + if(do_after_once(user, M.install_time, target = src)) + M.install(src, user) + else + to_chat(user, "You stop installing [M].") + else return attacked_by(W, user) @@ -993,7 +1016,7 @@ icon_state = initial(icon_state) playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) if(!hasInternalDamage()) - occupant << sound('sound/mecha/nominal.ogg',volume=50) + occupant << sound(nominalsound, volume = 50) AI.cancel_camera() AI.controlled_mech = src AI.remote_control = src @@ -1151,8 +1174,13 @@ icon_state = reset_icon() dir = dir_in playsound(src, 'sound/machines/windowdoor.ogg', 50, 1) - if(!hasInternalDamage()) - occupant << sound('sound/mecha/nominal.ogg', volume = 50) + if(!activated) + occupant << sound(longactivationsound, volume = 50) + activated = TRUE + else if(!hasInternalDamage()) + occupant << sound(nominalsound, volume = 50) + if(state) + H.throw_alert("locked", /obj/screen/alert/mech_maintenance) return 1 else return 0 @@ -1208,7 +1236,7 @@ dir = dir_in log_message("[mmi_as_oc] moved in as pilot.") if(!hasInternalDamage()) - to_chat(occupant, sound('sound/mecha/nominal.ogg',volume=50)) + to_chat(occupant, sound(nominalsound, volume=50)) GrantActions(brainmob) return 1 else @@ -1235,6 +1263,7 @@ return var/atom/movable/mob_container occupant.clear_alert("charge") + occupant.clear_alert("locked") occupant.clear_alert("mech damage") occupant.clear_alert("mechaport") occupant.clear_alert("mechaport_d") @@ -1349,15 +1378,39 @@ /obj/mecha/proc/use_power(amount) if(get_charge()) cell.use(amount) + update_cell() return 1 return 0 /obj/mecha/proc/give_power(amount) if(!isnull(get_charge())) cell.give(amount) + update_cell() return 1 return 0 +/obj/mecha/proc/update_cell() + if(cell) + var/cellcharge = cell.charge/cell.maxcharge + switch(cellcharge) + if(0.75 to INFINITY) + occupant.clear_alert("charge") + if(0.5 to 0.75) + occupant.throw_alert("charge", /obj/screen/alert/mech_lowcell, 1) + if(0.25 to 0.5) + occupant.throw_alert("charge", /obj/screen/alert/mech_lowcell, 2) + if(power_warned) + power_warned = FALSE + if(0.01 to 0.25) + occupant.throw_alert("charge", /obj/screen/alert/mech_lowcell, 3) + if(!power_warned) + occupant << sound(lowpowersound, volume = 50) + power_warned = TRUE + else + occupant.throw_alert("charge", /obj/screen/alert/mech_emptycell) + else + occupant.throw_alert("charge", /obj/screen/alert/mech_nocell) + /obj/mecha/proc/reset_icon() if(initial_icon) icon_state = initial_icon diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm index db807634102..c7ab5ac6620 100644 --- a/code/game/mecha/mecha_actions.dm +++ b/code/game/mecha/mecha_actions.dm @@ -187,7 +187,7 @@ chassis.occupant_message("Zoom mode [chassis.zoom_mode ? "en" : "dis"]abled.") if(chassis.zoom_mode) owner.client.AddViewMod("mecha", 12) - SEND_SOUND(owner, sound('sound/mecha/imag_enh.ogg',volume=50)) + SEND_SOUND(owner, sound(chassis.zoomsound, volume = 50)) else owner.client.RemoveViewMod("mecha") UpdateButtonIcon() diff --git a/code/game/mecha/mecha_modkit.dm b/code/game/mecha/mecha_modkit.dm new file mode 100644 index 00000000000..9a75fc75077 --- /dev/null +++ b/code/game/mecha/mecha_modkit.dm @@ -0,0 +1,78 @@ +/obj/item/mecha_modkit + name = "mecha modification kit" + desc = "A kit to modify your mech. This one doesn't do anything." + icon = 'icons/obj/module.dmi' + icon_state = "harddisk_mini" + var/install_time = 15 + +/obj/item/mecha_modkit/proc/install(var/obj/mecha/mech, var/mob/user) + if(user) + to_chat(user, "You install [src] into [mech].") + return TRUE + +/obj/item/mecha_modkit/voice + name = "mecha voice modification kit : Standard" + desc = "This modification kit updates a mech's onboard voice to Standard." + var/nominalsound = 'sound/mecha/nominal.ogg' + var/zoomsound = 'sound/mecha/imag_enh.ogg' + var/critdestrsound = 'sound/mecha/critdestr.ogg' + var/weapdestrsound = 'sound/mecha/weapdestr.ogg' + var/lowpowersound = 'sound/mecha/lowpower.ogg' + var/longactivationsound = 'sound/mecha/nominal.ogg' + +/obj/item/mecha_modkit/voice/install(var/obj/mecha/mech, var/mob/living/carbon/user) + if(istype(mech, /obj/mecha/combat/reticence) && user) + to_chat(user, "You attempt to install [src] into [mech], but an invisible barrier prevents you from doing so!") + return FALSE + if(istype(mech, /obj/mecha/combat/honker) && user) + to_chat(user, "You attempt to install [src] into [mech], but you somehow trip before you get it in!") + user.slip("your own foot", 8, 5, 0, 0, 1, "trip") + return FALSE + mech.nominalsound = nominalsound + mech.zoomsound = zoomsound + mech.critdestrsound = critdestrsound + mech.weapdestrsound = weapdestrsound + mech.lowpowersound = lowpowersound + mech.longactivationsound = longactivationsound + ..() + +/obj/item/mecha_modkit/voice/nanotrasen + name = "mecha voice modification kit : Nanotrasen" + desc = "This modification kit updates a mech's onboard voice to Nanotrasen." + nominalsound = 'sound/mecha/nominalnano.ogg' + zoomsound = 'sound/mecha/imag_enhnano.ogg' + critdestrsound = 'sound/mecha/critdestrnano.ogg' + weapdestrsound = 'sound/mecha/weapdestrnano.ogg' + lowpowersound = 'sound/mecha/lowpowernano.ogg' + longactivationsound = 'sound/mecha/LongNanoActivation.ogg' + +/obj/item/mecha_modkit/voice/syndicate + name = "mecha voice modification kit : Syndicate" + desc = "This suspicious modification kit updates a mech's onboard voice to Syndicate." + origin_tech = "syndicate=1" + nominalsound = 'sound/mecha/nominalsyndi.ogg' + zoomsound = 'sound/mecha/imag_enhsyndi.ogg' + critdestrsound = 'sound/mecha/critdestrsyndi.ogg' + weapdestrsound = 'sound/mecha/weapdestrsyndi.ogg' + lowpowersound = 'sound/mecha/lowpowersyndi.ogg' + longactivationsound = 'sound/mecha/LongSyndiActivation.ogg' + +/obj/item/mecha_modkit/voice/honk + name = "mecha voice modification kit : Honk" + desc = "This modification kit updates a mech's onboard voice to Honk. Why?" + nominalsound = 'sound/items/bikehorn.ogg' + zoomsound = 'sound/items/bikehorn.ogg' + critdestrsound = 'sound/items/Airhorn2.ogg' + weapdestrsound = 'sound/items/Airhorn2.ogg' + lowpowersound = 'sound/items/Airhorn2.ogg' + longactivationsound = 'sound/items/bikehorn.ogg' + +/obj/item/mecha_modkit/voice/silent + name = "mecha voice modification kit : Silent" + desc = "This modification kit silences a mech's onboard voice." + nominalsound = null + zoomsound = null + critdestrsound = null + weapdestrsound = null + lowpowersound = null + longactivationsound = null \ No newline at end of file diff --git a/code/game/mecha/mecha_topic.dm b/code/game/mecha/mecha_topic.dm index 41d4c3aa540..36269a11303 100644 --- a/code/game/mecha/mecha_topic.dm +++ b/code/game/mecha/mecha_topic.dm @@ -195,7 +195,7 @@ [add_req_access?"Edit operation keycodes":null] - [maint_access?"Initiate maintenance protocol":null] + [maint_access?"Initiate/Stop maintenance protocol":null] [(state>0) ?"Set Cabin Air Pressure":null] "} @@ -317,9 +317,13 @@ if(state==0) state = 1 to_chat(user, "The securing bolts are now exposed.") + if(occupant) + occupant.throw_alert("locked", /obj/screen/alert/mech_maintenance) else if(state==1) state = 0 to_chat(user, "The securing bolts are now hidden.") + if(occupant) + occupant.clear_alert("locked") output_maintenance_dialog(afilter.getObj("id_card"),user) return if(href_list["set_internal_tank_valve"] && state >=1) diff --git a/code/modules/research/designs/mechfabricator_designs.dm b/code/modules/research/designs/mechfabricator_designs.dm index 315a2e70aa0..983323035f1 100644 --- a/code/modules/research/designs/mechfabricator_designs.dm +++ b/code/modules/research/designs/mechfabricator_designs.dm @@ -1185,3 +1185,54 @@ construction_time = 100 build_path = /obj/item/flash/synthetic category = list("Misc") + +/datum/design/voice_standard + name = "Voice Modkit : Standard" + desc = "A modification kit that updates a mech's onboard voice to Standard." + id = "voice_standard" + build_type = MECHFAB + materials = list(MAT_METAL = 500) + construction_time = 50 + build_path = /obj/item/mecha_modkit/voice + category = list("Misc") + +/datum/design/voice_nanotrasen + name = "Voice Modkit : Nanotrasen" + desc = "A modification kit that updates a mech's onboard voice to Nanotrasen." + id = "voice_nanotrasen" + build_type = MECHFAB + materials = list(MAT_METAL = 500) + construction_time = 50 + build_path = /obj/item/mecha_modkit/voice/nanotrasen + category = list("Misc") + +/datum/design/voice_silent + name = "Voice Modkit : Silent" + desc = "A modification kit that silences a mech's onboard voice." + id = "voice_silent" + build_type = MECHFAB + materials = list(MAT_METAL = 500) + construction_time = 50 + build_path = /obj/item/mecha_modkit/voice/silent + category = list("Misc") + +/datum/design/voice_honk + name = "Voice Modkit : Honk" + desc = "A modification kit that updates a mech's onboard voice to Honk. This is a terrible idea." + id = "voice_honk" + build_type = MECHFAB + materials = list(MAT_METAL = 400, MAT_BANANIUM = 100) + construction_time = 50 + build_path = /obj/item/mecha_modkit/voice/honk + category = list("Misc") + +/datum/design/voice_syndicate + name = "Voice Modkit : Syndicate" + desc = "A modification kit that updates a mech's onboard voice to Syndicate." + id = "voice_syndicate" + build_type = MECHFAB + materials = list(MAT_METAL = 400, MAT_TITANIUM = 100) + req_tech = list("syndicate" = 2) + construction_time = 50 + build_path = /obj/item/mecha_modkit/voice/syndicate + category = list("Misc") diff --git a/paradise.dme b/paradise.dme index dc78d020ad1..3d9f758719f 100644 --- a/paradise.dme +++ b/paradise.dme @@ -708,6 +708,7 @@ #include "code\game\mecha\mecha_actions.dm" #include "code\game\mecha\mecha_construction_paths.dm" #include "code\game\mecha\mecha_control_console.dm" +#include "code\game\mecha\mecha_modkit.dm" #include "code\game\mecha\mecha_parts.dm" #include "code\game\mecha\mecha_topic.dm" #include "code\game\mecha\mecha_wreckage.dm"