From e62938bc61e94d65cf77c1ff8f485240a8a399b5 Mon Sep 17 00:00:00 2001 From: Kates <24830358+lbnesquik@users.noreply.github.com> Date: Sat, 4 Jul 2020 00:28:08 +0200 Subject: [PATCH] Add clickable action buttons from /TG/, rework a lot of backend and other improvements. --- code/_onclick/hud/action.dm | 6 +- code/game/mecha/combat/durand.dm | 51 +-- code/game/mecha/combat/gorilla.dm | 277 +++++------- code/game/mecha/combat/gygax.dm | 73 +-- code/game/mecha/combat/marauder.dm | 99 +--- code/game/mecha/combat/phazon.dm | 50 +-- code/game/mecha/equipment/tools/speedboost.dm | 4 +- code/game/mecha/mecha.dm | 225 +++++++++- code/game/mecha/mecha_actions.dm | 421 ++++++++++++++++++ code/modules/mob/mob_defines.dm | 6 +- icons/effects/actions_mecha.dmi | Bin 0 -> 7707 bytes vorestation.dme | 1 + 12 files changed, 805 insertions(+), 408 deletions(-) create mode 100644 code/game/mecha/mecha_actions.dm create mode 100644 icons/effects/actions_mecha.dmi diff --git a/code/_onclick/hud/action.dm b/code/_onclick/hud/action.dm index c123790b51..160413135b 100644 --- a/code/_onclick/hud/action.dm +++ b/code/_onclick/hud/action.dm @@ -222,4 +222,8 @@ #undef AB_WEST_OFFSET #undef AB_NORTH_OFFSET -#undef AB_MAX_COLUMNS \ No newline at end of file +#undef AB_MAX_COLUMNS + + +/datum/action/innate/ + action_type = AB_INNATE \ No newline at end of file diff --git a/code/game/mecha/combat/durand.dm b/code/game/mecha/combat/durand.dm index ab46a48fbc..0b04b1be90 100644 --- a/code/game/mecha/combat/durand.dm +++ b/code/game/mecha/combat/durand.dm @@ -12,8 +12,6 @@ max_temperature = 30000 infra_luminosity = 8 force = 40 - var/defence = 0 - var/defence_deflect = 35 wreckage = /obj/effect/decal/mecha_wreckage/durand max_hull_equip = 2 @@ -22,6 +20,8 @@ max_universal_equip = 1 max_special_equip = 1 + defence_mode_possible = 1 + /* /obj/mecha/combat/durand/New() ..() @@ -31,40 +31,9 @@ return */ -/obj/mecha/combat/durand/relaymove(mob/user,direction) - if(defence) - if(world.time - last_message > 20) - src.occupant_message("Unable to move while in defence mode") - last_message = world.time - return 0 - . = ..() - return -/obj/mecha/combat/durand/verb/defence_mode() - set category = "Exosuit Interface" - set name = "Toggle defence mode" - set src = usr.loc - set popup_menu = 0 - if(usr!=src.occupant) - return - playsound(src, 'sound/mecha/duranddefencemode.ogg', 50, 1) - defence = !defence - if(defence) - deflect_chance = defence_deflect - src.occupant_message("You enable [src] defence mode.") - else - deflect_chance = initial(deflect_chance) - src.occupant_message("You disable [src] defence mode.") - src.log_message("Toggled defence mode.") - return - - -/obj/mecha/combat/durand/get_stats_part() - var/output = ..() - output += "Defence mode: [defence?"on":"off"]" - return output - +//This is for the Mech stats / Menu system. To be moved later on. /obj/mecha/combat/durand/get_commands() var/output = {"
Special
@@ -76,8 +45,20 @@ output += ..() return output + +//Not needed anymore but left for reference. +/* +/obj/mecha/combat/durand/get_stats_part() + var/output = ..() + output += "Defence mode: [defence?"on":"off"]" + return output +*/ + +/* + /obj/mecha/combat/durand/Topic(href, href_list) ..() if (href_list["toggle_defence_mode"]) src.defence_mode() - return \ No newline at end of file + return +*/ \ No newline at end of file diff --git a/code/game/mecha/combat/gorilla.dm b/code/game/mecha/combat/gorilla.dm index 2f75de4a15..4052afe8e6 100644 --- a/code/game/mecha/combat/gorilla.dm +++ b/code/game/mecha/combat/gorilla.dm @@ -1,3 +1,116 @@ + +/obj/mecha/combat/gorilla + name = "Gorilla" + desc = "Blitzkrieg!" //stop using all caps in item descs i will fight you. its redundant with the bold. + icon = 'icons/mecha/mecha64x64.dmi' + icon_state = "pzrmech" + initial_icon = "pzrmech" + pixel_x = -16 + step_in = 10 + health = 5000 + maxhealth = 5000 + opacity = 0 // Because there's big tall legs to look through. Also it looks fucky if this is set to 1. + deflect_chance = 50 + damage_absorption = list("brute"=0.1,"fire"=0.8,"bullet"=0.1,"laser"=0.6,"energy"=0.7,"bomb"=0.7) //values show how much damage will pass through, not how much will be absorbed. + max_temperature = 35000 //Just a bit better than the Durand. + infra_luminosity = 3 + wreckage = /obj/effect/decal/mecha_wreckage/gorilla + add_req_access = 0 + internal_damage_threshold = 25 + force = 60 + max_equip = 5 +//This will (Should) never be in the hands of players. If it is, the one who inflicted this monster upon the server can edit these vars to not be insane. + max_hull_equip = 5 + max_weapon_equip = 5 + max_utility_equip = 5 + max_universal_equip = 5 + max_special_equip = 2 + + smoke_possible = 1 + zoom_possible = 1 + thrusters_possible = 1 + +/obj/mecha/combat/gorilla/Initialize() + ..() + var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay(src) // This thing basically cannot function without an external power supply. + ME.attach(src) + ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/cannon(src) + ME.attach(src) + ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/cannon/weak(src) //Saves energy, I suppose. Anti-infantry. + ME.attach(src) + ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive(src) + ME.attach(src) + ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg(src) + ME.attach(src) + return + +/obj/mecha/combat/gorilla/mechstep(direction) + var/result = step(src,direction) + playsound(src,"mechstep",40,1) + return result + +/obj/mecha/combat/gorilla/mechturn(direction) + dir = direction + playsound(src,"mechstep",40,1) + + +/obj/mecha/combat/gorilla/relaymove(mob/user,direction) + if(user != src.occupant) + user.loc = get_turf(src) + to_chat(user, "You climb out from [src]") + return 0 + if(!can_move) + return 0 + if(zoom) + if(world.time - last_message > 20) + src.occupant_message("Unable to move while in zoom mode.") + last_message = world.time + return 0 + if(connected_port) + if(world.time - last_message > 20) + src.occupant_message("Unable to move while connected to the air system port") + last_message = world.time + return 0 + if(state || !has_charge(step_energy_drain)) + return 0 + var/tmp_step_in = step_in + var/tmp_step_energy_drain = step_energy_drain + var/move_result = 0 + if(internal_damage&MECHA_INT_CONTROL_LOST) + move_result = mechsteprand() + else if(src.dir!=direction) + move_result = mechturn(direction) + else + move_result = mechstep(direction) + if(move_result) + if(istype(src.loc, /turf/space)) + if(!src.check_for_support()) + src.pr_inertial_movement.start(list(src,direction)) + can_move = 0 + spawn(tmp_step_in) can_move = 1 + use_power(tmp_step_energy_drain) + return 1 + return 0 + + +/obj/mecha/combat/gorilla/get_stats_part() + var/output = ..() + output += {"Smoke: [smoke_reserve]"} + return output + + +/obj/mecha/combat/gorilla/get_commands() + var/output = {"
+
Special
+ +
+ "} + output += ..() + return output + /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/cannon name = "8.8cm KwK 47" desc = "Precision German engineering!" // Why would you ever take this off the mech, anyway? @@ -54,167 +167,3 @@ plane = MOB_PLANE pixel_x = -16 anchored = 1 // It's fucking huge. You aren't moving it. - -/obj/mecha/combat/gorilla - name = "Gorilla" - desc = "Blitzkrieg!" //stop using all caps in item descs i will fight you. its redundant with the bold. - icon = 'icons/mecha/mecha64x64.dmi' - icon_state = "pzrmech" - initial_icon = "pzrmech" - pixel_x = -16 - step_in = 10 - health = 5000 - maxhealth = 5000 - opacity = 0 // Because there's big tall legs to look through. Also it looks fucky if this is set to 1. - deflect_chance = 50 - damage_absorption = list("brute"=0.1,"fire"=0.8,"bullet"=0.1,"laser"=0.6,"energy"=0.7,"bomb"=0.7) //values show how much damage will pass through, not how much will be absorbed. - max_temperature = 35000 //Just a bit better than the Durand. - infra_luminosity = 3 - var/zoom = 0 - var/smoke = 5 - var/smoke_ready = 1 - var/smoke_cooldown = 100 - var/datum/effect/effect/system/smoke_spread/smoke_system = new - wreckage = /obj/effect/decal/mecha_wreckage/gorilla - add_req_access = 0 - internal_damage_threshold = 25 - force = 60 - max_equip = 5 -//This will (Should) never be in the hands of players. If it is, the one who inflicted this monster upon the server can edit these vars to not be insane. - max_hull_equip = 5 - max_weapon_equip = 5 - max_utility_equip = 5 - max_universal_equip = 5 - max_special_equip = 2 - -/obj/mecha/combat/gorilla/Initialize() - ..() - var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tesla_energy_relay(src) // This thing basically cannot function without an external power supply. - ME.attach(src) - ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/cannon(src) - ME.attach(src) - ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/cannon/weak(src) //Saves energy, I suppose. Anti-infantry. - ME.attach(src) - ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/missile_rack/explosive(src) - ME.attach(src) - ME = new /obj/item/mecha_parts/mecha_equipment/weapon/ballistic/lmg(src) - ME.attach(src) - src.smoke_system.set_up(3, 0, src) - src.smoke_system.attach(src) - return - -/obj/mecha/combat/gorilla/mechstep(direction) - var/result = step(src,direction) - playsound(src,"mechstep",40,1) - return result - -/obj/mecha/combat/gorilla/mechturn(direction) - dir = direction - playsound(src,"mechstep",40,1) - - -/obj/mecha/combat/gorilla/relaymove(mob/user,direction) - if(user != src.occupant) - user.loc = get_turf(src) - to_chat(user, "You climb out from [src]") - return 0 - if(!can_move) - return 0 - if(zoom) - if(world.time - last_message > 20) - src.occupant_message("Unable to move while in zoom mode.") - last_message = world.time - return 0 - if(connected_port) - if(world.time - last_message > 20) - src.occupant_message("Unable to move while connected to the air system port") - last_message = world.time - return 0 - if(state || !has_charge(step_energy_drain)) - return 0 - var/tmp_step_in = step_in - var/tmp_step_energy_drain = step_energy_drain - var/move_result = 0 - if(internal_damage&MECHA_INT_CONTROL_LOST) - move_result = mechsteprand() - else if(src.dir!=direction) - move_result = mechturn(direction) - else - move_result = mechstep(direction) - if(move_result) - if(istype(src.loc, /turf/space)) - if(!src.check_for_support()) - src.pr_inertial_movement.start(list(src,direction)) - can_move = 0 - spawn(tmp_step_in) can_move = 1 - use_power(tmp_step_energy_drain) - return 1 - return 0 - -/obj/mecha/combat/gorilla/verb/smoke() - set category = "Exosuit Interface" - set name = "Smoke" - set src = usr.loc - set popup_menu = 0 - if(usr!=src.occupant) - return - if(smoke_ready && smoke>0) - src.smoke_system.start() - smoke-- - smoke_ready = 0 - spawn(smoke_cooldown) - smoke_ready = 1 - return - -/obj/mecha/combat/gorilla/verb/zoom() - set category = "Exosuit Interface" - set name = "Zoom" - set src = usr.loc - set popup_menu = 0 - if(usr!=src.occupant) - return - if(src.occupant.client) - src.zoom = !src.zoom - src.log_message("Toggled zoom mode.") - src.occupant_message("Zoom mode [zoom?"en":"dis"]abled.") - if(zoom) - src.occupant.set_viewsize(12) - playsound(src, 'sound/mecha/imag_enh.ogg',50) - else - src.occupant.set_viewsize() // Reset to default - return - - -/obj/mecha/combat/gorilla/go_out() - if(src.occupant && src.occupant.client) - src.occupant.client.view = world.view - src.zoom = 0 - ..() - return - - -/obj/mecha/combat/gorilla/get_stats_part() - var/output = ..() - output += {"Smoke: [smoke]"} - return output - - -/obj/mecha/combat/gorilla/get_commands() - var/output = {"
-
Special
- -
- "} - output += ..() - return output - -/obj/mecha/combat/gorilla/Topic(href, href_list) - ..() - if (href_list["smoke"]) - src.smoke() - if (href_list["toggle_zoom"]) - src.zoom() - return \ No newline at end of file diff --git a/code/game/mecha/combat/gygax.dm b/code/game/mecha/combat/gygax.dm index d70c8f9e85..17255ef4b2 100644 --- a/code/game/mecha/combat/gygax.dm +++ b/code/game/mecha/combat/gygax.dm @@ -11,8 +11,6 @@ damage_absorption = list("brute"=0.75,"fire"=1,"bullet"=0.8,"laser"=0.7,"energy"=0.85,"bomb"=1) max_temperature = 25000 infra_luminosity = 6 - var/overload = 0 - var/overload_coeff = 2 wreckage = /obj/effect/decal/mecha_wreckage/gygax internal_damage_threshold = 35 max_equip = 3 @@ -23,6 +21,21 @@ max_universal_equip = 1 max_special_equip = 1 + overload_possible = 1 + +//Not quite sure how to move those yet. +/obj/mecha/combat/gygax/get_commands() + var/output = {"
+
Special
+ +
+ "} + output += ..() + return output + + /obj/mecha/combat/gygax/dark desc = "A lightweight exosuit used by Heavy Asset Protection. A significantly upgraded Gygax security mech." name = "Dark Gygax" @@ -66,62 +79,6 @@ cell.charge = 30000 cell.maxcharge = 30000 - -/obj/mecha/combat/gygax/verb/overload() - set category = "Exosuit Interface" - set name = "Toggle leg actuators overload" - set src = usr.loc - set popup_menu = 0 - if(usr!=src.occupant) - return - if(overload) - overload = 0 - step_in = initial(step_in) - step_energy_drain = initial(step_energy_drain) - src.occupant_message("You disable leg actuators overload.") - else - overload = 1 - step_in = min(1, round(step_in/2)) - step_energy_drain = step_energy_drain*overload_coeff - src.occupant_message("You enable leg actuators overload.") - src.log_message("Toggled leg actuators overload.") - playsound(src, 'sound/mecha/mechanical_toggle.ogg', 50, 1) - return - -/obj/mecha/combat/gygax/dyndomove(direction) - if(!..()) return - if(overload) - health-- - if(health < initial(health) - initial(health)/3) - overload = 0 - step_in = initial(step_in) - step_energy_drain = initial(step_energy_drain) - src.occupant_message("Leg actuators damage threshold exceded. Disabling overload.") - return - - -/obj/mecha/combat/gygax/get_stats_part() - var/output = ..() - output += "Leg actuators overload: [overload?"on":"off"]" - return output - -/obj/mecha/combat/gygax/get_commands() - var/output = {"
-
Special
- -
- "} - output += ..() - return output - -/obj/mecha/combat/gygax/Topic(href, href_list) - ..() - if (href_list["toggle_leg_overload"]) - src.overload() - return - /obj/mecha/combat/gygax/serenity desc = "A lightweight exosuit made from a modified Gygax chassis combined with proprietary VeyMed medical tech. It's faster and sturdier than most medical mechs, but much of the armor plating has been stripped out, leaving it more vulnerable than a regular Gygax." name = "Serenity" diff --git a/code/game/mecha/combat/marauder.dm b/code/game/mecha/combat/marauder.dm index 2b383379ad..546f77f4c5 100644 --- a/code/game/mecha/combat/marauder.dm +++ b/code/game/mecha/combat/marauder.dm @@ -11,12 +11,6 @@ damage_absorption = list("brute"=0.5,"fire"=0.7,"bullet"=0.45,"laser"=0.6,"energy"=0.7,"bomb"=0.7) max_temperature = 60000 infra_luminosity = 3 - var/zoom = 0 - var/thrusters = 0 - var/smoke = 5 - var/smoke_ready = 1 - var/smoke_cooldown = 100 - var/datum/effect/effect/system/smoke_spread/smoke_system = new operation_req_access = list(access_cent_specops) wreckage = /obj/effect/decal/mecha_wreckage/marauder add_req_access = 0 @@ -31,6 +25,10 @@ max_universal_equip = 1 max_special_equip = 1 + smoke_possible = 1 + zoom_possible = 1 + thrusters_possible = 1 + /obj/mecha/combat/marauder/seraph desc = "Heavy-duty, command-type exosuit. This is a custom model, utilized only by high-ranking military personnel." name = "Seraph" @@ -45,7 +43,7 @@ force = 55 max_equip = 5 - +//Note that is the Mauler /obj/mecha/combat/marauder/mauler desc = "Heavy-duty, combat exosuit, developed off of the existing Marauder model." name = "Mauler" @@ -55,6 +53,7 @@ wreckage = /obj/effect/decal/mecha_wreckage/mauler mech_faction = MECH_FACTION_SYNDI +//Note that is the default Marauder /obj/mecha/combat/marauder/Initialize() ..() var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/weapon/energy/pulse @@ -65,10 +64,9 @@ ME.attach(src) ME = new /obj/item/mecha_parts/mecha_equipment/antiproj_armor_booster(src) ME.attach(src) - src.smoke_system.set_up(3, 0, src) - src.smoke_system.attach(src) return +//Note that this is the seraph. /obj/mecha/combat/marauder/seraph/Initialize() ..()//Let it equip whatever is needed. var/obj/item/mecha_parts/mecha_equipment/ME @@ -88,10 +86,8 @@ ME.attach(src) return -/obj/mecha/combat/marauder/Destroy() - qdel(smoke_system) - ..() +//I'll break this down later /obj/mecha/combat/marauder/relaymove(mob/user,direction) if(user != src.occupant) //While not "realistic", this piece is player friendly. user.loc = get_turf(src) @@ -136,74 +132,7 @@ return 1 return 0 - -/obj/mecha/combat/marauder/verb/toggle_thrusters() - set category = "Exosuit Interface" - set name = "Toggle thrusters" - set src = usr.loc - set popup_menu = 0 - if(usr!=src.occupant) - return - if(src.occupant) - if(get_charge() > 0) - thrusters = !thrusters - src.log_message("Toggled thrusters.") - src.occupant_message("Thrusters [thrusters?"en":"dis"]abled.") - return - - -/obj/mecha/combat/marauder/verb/smoke() - set category = "Exosuit Interface" - set name = "Smoke" - set src = usr.loc - set popup_menu = 0 - if(usr!=src.occupant) - return - if(smoke_ready && smoke>0) - src.smoke_system.start() - smoke-- - smoke_ready = 0 - spawn(smoke_cooldown) - smoke_ready = 1 - return - -//TODO replace this with zoom code that doesn't increase peripherial vision -/obj/mecha/combat/marauder/verb/zoom() - set category = "Exosuit Interface" - set name = "Zoom" - set src = usr.loc - set popup_menu = 0 - if(usr!=src.occupant) - return - if(src.occupant.client) - src.zoom = !src.zoom - src.log_message("Toggled zoom mode.") - src.occupant_message("Zoom mode [zoom?"en":"dis"]abled.") - if(zoom) - src.occupant.set_viewsize(12) - src.occupant << sound('sound/mecha/imag_enh.ogg',volume=50) - else - src.occupant.set_viewsize() // Reset to default - return - - -/obj/mecha/combat/marauder/go_out() - if(src.occupant && src.occupant.client) - src.occupant.client.view = world.view - src.zoom = 0 - ..() - return - - -/obj/mecha/combat/marauder/get_stats_part() - var/output = ..() - output += {"Smoke: [smoke] -
- Thrusters: [thrusters?"on":"off"] - "} - return output - - +//To be kill ltr /obj/mecha/combat/marauder/get_commands() var/output = {"
Special
@@ -216,13 +145,3 @@ "} output += ..() return output - -/obj/mecha/combat/marauder/Topic(href, href_list) - ..() - if (href_list["toggle_thrusters"]) - src.toggle_thrusters() - if (href_list["smoke"]) - src.smoke() - if (href_list["toggle_zoom"]) - src.zoom() - return \ No newline at end of file diff --git a/code/game/mecha/combat/phazon.dm b/code/game/mecha/combat/phazon.dm index 48394f47f4..90ac9ad789 100644 --- a/code/game/mecha/combat/phazon.dm +++ b/code/game/mecha/combat/phazon.dm @@ -17,9 +17,6 @@ //operation_req_access = list() internal_damage_threshold = 25 force = 15 - var/phasing = 0 - var/can_phase = TRUE - var/phasing_energy_drain = 200 max_equip = 4 max_hull_equip = 3 @@ -28,6 +25,9 @@ max_universal_equip = 3 max_special_equip = 4 + phasing_possible = 1 + switch_dmg_type_possible = 1 + /obj/mecha/combat/phazon/equipped/Initialize() ..() var/obj/item/mecha_parts/mecha_equipment/ME = new /obj/item/mecha_parts/mecha_equipment/tool/rcd @@ -36,6 +36,7 @@ ME.attach(src) return +/* Leaving this until we are really sure we don't need it for reference. /obj/mecha/combat/phazon/Bump(var/atom/obstacle) if(phasing && get_charge()>=phasing_energy_drain) spawn() @@ -49,35 +50,8 @@ else . = ..() return +*/ -/obj/mecha/combat/phazon/click_action(atom/target,mob/user) - if(phasing) - src.occupant_message("Unable to interact with objects while phasing") - return - else - return ..() - -/obj/mecha/combat/phazon/verb/switch_damtype() - set category = "Exosuit Interface" - set name = "Change melee damage type" - set src = usr.loc - set popup_menu = 0 - if(usr!=src.occupant) - return - - query_damtype() - -/obj/mecha/combat/phazon/proc/query_damtype() - var/new_damtype = alert(src.occupant,"Melee Damage Type",null,"Brute","Fire","Toxic") - switch(new_damtype) - if("Brute") - damtype = "brute" - if("Fire") - damtype = "fire" - if("Toxic") - damtype = "tox" - src.occupant_message("Melee damage type switched to [new_damtype ]") - return /obj/mecha/combat/phazon/get_commands() var/output = {"
@@ -91,15 +65,7 @@ output += ..() return output -/obj/mecha/combat/phazon/Topic(href, href_list) - ..() - if (href_list["switch_damtype"]) - src.switch_damtype() - if (href_list["phasing"]) - phasing = !phasing - send_byjax(src.occupant,"exosuit.browser","phasing_command","[phasing?"Dis":"En"]able phasing") - src.occupant_message("En":"#f00\">Dis"]abled phasing.") - return + /obj/mecha/combat/phazon/janus name = "Phazon Prototype Janus Class" @@ -121,7 +87,6 @@ wreckage = /obj/effect/decal/mecha_wreckage/janus internal_damage_threshold = 25 force = 20 - phasing = FALSE phasing_energy_drain = 300 max_hull_equip = 2 @@ -130,6 +95,9 @@ max_universal_equip = 2 max_special_equip = 2 + phasing_possible = 1 + switch_dmg_type_possible = 1 + /obj/mecha/combat/phazon/janus/take_damage(amount, type="brute") ..() if(phasing) diff --git a/code/game/mecha/equipment/tools/speedboost.dm b/code/game/mecha/equipment/tools/speedboost.dm index 1cb0df9469..6e7ad06f69 100644 --- a/code/game/mecha/equipment/tools/speedboost.dm +++ b/code/game/mecha/equipment/tools/speedboost.dm @@ -10,9 +10,9 @@ /obj/item/mecha_parts/mecha_equipment/speedboost/attach(obj/mecha/M as obj) ..() if(enable_special) - chassis.step_in = (chassis.step_in-2) // Make the ripley as fast as a durand + chassis.step_in = 3 // As fast as a gygax without overload. Slower than Ody. else - chassis.step_in = (chassis.step_in+1) // Improper parts slow the mech down + chassis.step_in = 6 // Improper parts slow the mech down return /obj/item/mecha_parts/mecha_equipment/speedboost/detach() diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm index 1b00505bc9..f62262081d 100644 --- a/code/game/mecha/mecha.dm +++ b/code/game/mecha/mecha.dm @@ -80,6 +80,7 @@ var/obj/item/mecha_parts/mecha_equipment/selected var/max_equip = 2 var/datum/events/events + //mechaequipt2 stuffs var/list/hull_equipment = new var/list/weapon_equipment = new @@ -91,6 +92,7 @@ var/max_utility_equip = 2 var/max_universal_equip = 2 var/max_special_equip = 1 + //Working exosuit vars var/list/cargo = list() var/cargo_capacity = 3 @@ -100,8 +102,62 @@ var/static/image/radial_image_lighttoggle = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_light") var/static/image/radial_image_statpanel = image(icon = 'icons/mob/radial.dmi', icon_state = "radial_examine2") +<<<<<<< HEAD var/datum/mini_hud/mech/minihud //VOREStation Edit var/strafing = 0 +======= + +//Mech actions + + var/strafing = 0 //Are we strafing or not? + + var/defence_mode_possible = 0 //Can we even use defence mode? This is used to assign it to mechs and check for verbs. + var/defence_mode = 0 //Are we in defence mode + var/defence_deflect = 35 //How much it deflect + + var/overload_possible = 0 //Same as above. Don't forget to GRANT the verb&actions if you want everything to work proper. + var/overload = 0 //Are our legs overloaded + var/overload_coeff = 1 //How much extra energy you use when use the L E G + + var/zoom = 0 + var/zoom_possible = 0 + + var/thrusters = 0 + var/thrusters_possible = 0 + + var/phasing = 0 //Are we currently phasing + var/phasing_possible = 0 //This is to allow phasing. + var/can_phase = TRUE //This is an internal check during the relevant procs. + var/phasing_energy_drain = 200 + + var/switch_dmg_type_possible = 0 //Can you switch damage type? It is mostly for the Phazon and its children. + + var/smoke_possible = 0 + var/smoke_reserve = 5 //How many shots you have. Might make a reload later on. MIGHT. + var/smoke_ready = 1 //This is a check for the whether or not the cooldown is ongoing. + var/smoke_cooldown = 100 //How long you have between uses. + var/datum/effect/effect/system/smoke_spread/smoke_system = new + +////All of those are for the HUD buttons in the top left. See Grant and Remove procs in mecha_actions. + + var/datum/action/innate/mecha/mech_eject/eject_action = new + var/datum/action/innate/mecha/mech_toggle_internals/internals_action = new + var/datum/action/innate/mecha/mech_toggle_lights/lights_action = new + var/datum/action/innate/mecha/mech_view_stats/stats_action = new + var/datum/action/innate/mecha/strafe/strafing_action = new + + var/datum/action/innate/mecha/mech_defence_mode/defence_action = new + var/datum/action/innate/mecha/mech_overload_mode/overload_action = new + var/datum/action/innate/mecha/mech_smoke/smoke_action = new + var/datum/action/innate/mecha/mech_zoom/zoom_action = new + var/datum/action/innate/mecha/mech_toggle_thrusters/thrusters_action = new + var/datum/action/innate/mecha/mech_cycle_equip/cycle_action = new + var/datum/action/innate/mecha/mech_switch_damtype/switch_damtype_action = new + var/datum/action/innate/mecha/mech_toggle_phasing/phasing_action = new + + + +>>>>>>> ce9ceb4... Add clickable action buttons from /TG/, rework a lot of backend and other improvements. (#7315) /obj/mecha/drain_power(var/drain_check) @@ -123,8 +179,14 @@ if(!add_airtank()) //we check this here in case mecha does not have an internal tank available by default - WIP removeVerb(/obj/mecha/verb/connect_to_port) removeVerb(/obj/mecha/verb/toggle_internal_tank) + spark_system.set_up(2, 0, src) spark_system.attach(src) + + if(smoke_possible)//I am pretty sure that's needed here. + src.smoke_system.set_up(3, 0, src) + src.smoke_system.attach(src) + add_cell() add_iterators() removeVerb(/obj/mecha/verb/disconnect_from_port) @@ -192,6 +254,9 @@ cell = null internal_tank = null + if(smoke_possible) //Just making sure nothing is running. + qdel(smoke_system) + QDEL_NULL(pr_int_temp_processor) QDEL_NULL(pr_inertial_movement) QDEL_NULL(pr_give_air) @@ -283,11 +348,11 @@ if(65 to 85) . += "It's slightly damaged." if(45 to 65) - . += "It's badly damaged." + . += "It's badly damaged." if(25 to 45) - . += "It's heavily damaged." + . += "It's heavily damaged." else - . += "It's falling apart." + . += " It's falling apart. " if(equipment?.len) . += "It's equipped with:" for(var/obj/item/mecha_parts/mecha_equipment/ME in equipment) @@ -319,6 +384,7 @@ "Toggle Light" = radial_image_lighttoggle, "View Stats" = radial_image_statpanel ) + var/choice = show_radial_menu(user, src, choices, custom_check = CALLBACK(src, .proc/check_occupant_radial, user), require_near = TRUE, tooltips = TRUE) if(!check_occupant_radial(user)) return @@ -380,6 +446,11 @@ if(state) occupant_message("Maintenance protocols in effect") return + + if(phasing)//Phazon and other mechs with phasing. + src.occupant_message("Unable to interact with objects while phasing")//Haha dumbass. + return + if(!get_charge()) return if(src == target) return var/dir_to_target = get_dir(src,target) @@ -463,6 +534,13 @@ if(state) occupant_message("Maintenance protocols in effect") return +/* + if(zoom) + if(world.time - last_message > 20) + src.occupant_message("Unable to move while in zoom mode.") + last_message = world.time + return 0 +*/ return domove(direction) /obj/mecha/proc/can_ztravel() @@ -482,6 +560,32 @@ if(!has_charge(step_energy_drain)) return 0 + //Can we even move, below is if yes. + + if(defence_mode)//Check if we are currently locked down + if(world.time - last_message > 20) + src.occupant_message("Unable to move while in defence mode") + last_message = world.time + return 0 + + if(zoom)//:eyes: + if(world.time - last_message > 20) + src.occupant_message("Unable to move while in zoom mode.") + last_message = world.time + return 0 + + if(!thrusters && src.pr_inertial_movement.active()) //I think this mean 'if you try to move in space without thruster, u no move' + return 0 + + if(overload)//Check if you have leg overload + health-- + if(health < initial(health) - initial(health)/3) + overload = 0 + step_in = initial(step_in) + step_energy_drain = initial(step_energy_drain) + src.occupant_message("Leg actuators damage threshold exceded. Disabling overload.") + + var/move_result = 0 if(hasInternalDamage(MECHA_INT_CONTROL_LOST)) @@ -572,21 +676,35 @@ /obj/mecha/Bump(var/atom/obstacle) // src.inertia_dir = null - if(istype(obstacle, /obj)) + if(istype(obstacle, /mob))//First we check if it is a mob. Mechs mostly shouln't go through them, even while phasing. + var/mob/M = obstacle + M.Move(get_step(obstacle,src.dir)) + else if(istype(obstacle, /obj))//Then we check for regular obstacles. var/obj/O = obstacle - if(istype(O, /obj/effect/portal)) //derpfix - src.anchored = 0 + + if(phasing && get_charge()>=phasing_energy_drain)//Phazon check. This could use an improvement elsewhere. + spawn() + if(can_phase) + can_phase = FALSE + flick("[initial_icon]-phase", src) + src.loc = get_step(src,src.dir) + src.use_power(phasing_energy_drain) + sleep(step_in*3) + can_phase = TRUE + occupant_message("Phazed.") + . = ..(obstacle) + return + if(istype(O, /obj/effect/portal)) //derpfix + src.anchored = 0 //I have no idea what this really fix. O.Crossed(src) spawn(0)//countering portal teleport spawn(0), hurr src.anchored = 1 - else if(!O.anchored) - step(obstacle,src.dir) - else //I have no idea why I disabled this + else if(O.anchored) obstacle.Bumped(src) - else if(istype(obstacle, /mob)) - var/mob/M = obstacle - M.Move(get_step(obstacle,src.dir)) - else + else + step(obstacle,src.dir) + + else//No idea when this triggers, so i won't touch it. . = ..(obstacle) return @@ -1229,6 +1347,9 @@ set category = "Exosuit Interface" set src = usr.loc set popup_menu = 0 + lights() + +/obj/mecha/verb/lights() if(usr!=occupant) return lights = !lights if(lights) set_light(light_range + lights_power) @@ -1244,18 +1365,25 @@ set category = "Exosuit Interface" set src = usr.loc set popup_menu = 0 + internal_tank() + +/obj/mecha/proc/internal_tank() if(usr!=src.occupant) return use_internal_tank = !use_internal_tank src.occupant_message("Now taking air from [use_internal_tank?"internal airtank":"environment"].") src.log_message("Now taking air from [use_internal_tank?"internal airtank":"environment"].") + playsound(src, 'sound/mecha/gasdisconnected.ogg', 30, 1) return + /obj/mecha/verb/toggle_strafing() set name = "Toggle strafing" set category = "Exosuit Interface" set src = usr.loc set popup_menu = 0 + +/obj/mecha/proc/strafing() if(usr!=src.occupant) return strafing = !strafing @@ -1324,6 +1452,8 @@ if(enter_after(40,usr)) if(!src.occupant) moved_inside(usr) + if(ishuman(occupant)) //Aeiou + GrantActions(occupant, 1) else if(src.occupant!=usr) to_chat(usr, "[src.occupant] was faster. Try better next time, loser.") else @@ -1345,8 +1475,31 @@ src.verbs += /obj/mecha/verb/eject src.log_append_to_last("[H] moved in as pilot.") src.icon_state = src.reset_icon() +<<<<<<< HEAD if(occupant.hud_used) minihud = new (occupant.hud_used, src) +======= + +//This part removes all the verbs if you don't have them the _possible on your mech. This is a little clunky, but it lets you just add that to any mech. +//And it's not like this 10yo code wasn't clunky before. + + if(!smoke_possible) //Can't use smoke? No verb for you. + verbs -= /obj/mecha/verb/toggle_smoke + if(!thrusters_possible) //Can't use thrusters? No verb for you. + verbs -= /obj/mecha/verb/toggle_thrusters + if(!defence_mode_possible) //Do i need to explain everything? + verbs -= /obj/mecha/verb/toggle_defence_mode + if(!overload_possible) + verbs -= /obj/mecha/verb/toggle_overload + if(!zoom_possible) + verbs -= /obj/mecha/verb/toggle_zoom + if(!phasing_possible) + verbs -= /obj/mecha/verb/toggle_phasing + if(!switch_dmg_type_possible) + verbs -= /obj/mecha/verb/switch_damtype + + occupant.in_enclosed_vehicle = 1 //Useful for when you need to know if someone is in a mecho. +>>>>>>> ce9ceb4... Add clickable action buttons from /TG/, rework a lot of backend and other improvements. (#7315) update_cell_alerts() update_damage_alerts() set_dir(dir_in) @@ -1415,6 +1568,7 @@ QDEL_NULL(minihud) if(ishuman(occupant)) mob_container = src.occupant + RemoveActions(occupant, human_occupant=1)//AEIOU else if(istype(occupant, /mob/living/carbon/brain)) var/mob/living/carbon/brain/brain = occupant mob_container = brain.container @@ -1434,10 +1588,19 @@ occupant.canmove = 0 occupant.clear_alert("charge") occupant.clear_alert("mech damage") + occupant.in_enclosed_vehicle = 0 occupant = null icon_state = src.reset_icon()+"-open" set_dir(dir_in) verbs -= /obj/mecha/verb/eject + + //src.zoom = 0 + + // Doesn't seem needed. + if(src.occupant && src.occupant.client) + src.occupant.client.view = world.view + src.zoom = 0 + strafing = 0 return @@ -1567,7 +1730,18 @@ Lights: [lights?"on":"off"]
[src.dna?"DNA-locked:
[src.dna] \[Reset\]
":null] "} -//Cargo components. + + + if(defence_mode_possible) + output += "Defence mode: [defence_mode?"on":"off"]
" + if(overload_possible) + output += "Leg actuators overload: [overload?"on":"off"]
" + if(smoke_possible) + output += "Smoke: [smoke_reserve]
" + if(thrusters_possible) + output += "Thrusters: [thrusters?"on":"off"]
" + +//Cargo components. Keep this last otherwise it does weird alignment issues. output += "Cargo Compartment Contents:
" if(src.cargo.len) for(var/obj/O in src.cargo) @@ -1769,12 +1943,31 @@ return if(href_list["toggle_lights"]) if(usr != src.occupant) return - src.toggle_lights() + src.lights() return +/* + if(href_list["toggle_strafing"]) + if(usr != src.occupant) return + src.strafing() + return*/ + if(href_list["toggle_airtank"]) if(usr != src.occupant) return - src.toggle_internal_tank() + src.internal_tank() return + if (href_list["toggle_thrusters"]) + src.toggle_thrusters() + if (href_list["smoke"]) + src.smoke() + if (href_list["toggle_zoom"]) + src.zoom() + if(href_list["toggle_defence_mode"]) + src.defence_mode() + if(href_list["switch_damtype"]) + src.switch_damtype() + if(href_list["phasing"]) + src.phasing() + if(href_list["rmictoggle"]) if(usr != src.occupant) return radio.broadcasting = !radio.broadcasting diff --git a/code/game/mecha/mecha_actions.dm b/code/game/mecha/mecha_actions.dm new file mode 100644 index 0000000000..0d2034d790 --- /dev/null +++ b/code/game/mecha/mecha_actions.dm @@ -0,0 +1,421 @@ +//AEIOU +// +//THIS FILE CONTAINS THE CODE TO ADD THE HUD BUTTONS AND THE MECH ACTIONS THEMSELVES. +// +// +// I better get some free food for this.. + + + +// +/// Adding the buttons things to the player. The interactive, top left things, at least at time of writing. +/// If you want it to be only for a special mech, you have to go and make an override like in the durand mech. +// + +/obj/mecha/proc/GrantActions(mob/living/user, human_occupant = 0) + if(human_occupant) + eject_action.Grant(user, src) + internals_action.Grant(user, src) + cycle_action.Grant(user, src) + lights_action.Grant(user, src) + stats_action.Grant(user, src) + strafing_action.Grant(user, src)//The defaults. + + if(defence_mode_possible) + defence_action.Grant(user, src) + if(overload_possible) + overload_action.Grant(user, src) + if(smoke_possible) + smoke_action.Grant(user, src) + if(zoom_possible) + zoom_action.Grant(user, src) + if(thrusters_possible) + thrusters_action.Grant(user, src) + if(phasing_possible) + phasing_action.Grant(user, src) + if(switch_dmg_type_possible) + switch_damtype_action.Grant(user, src) + +/obj/mecha/proc/RemoveActions(mob/living/user, human_occupant = 0) + if(human_occupant) + eject_action.Remove(user, src) + internals_action.Remove(user, src) + cycle_action.Remove(user, src) + lights_action.Remove(user, src) + stats_action.Remove(user, src) + strafing_action.Remove(user, src) + + defence_action.Remove(user, src) + smoke_action.Remove(user, src) + zoom_action.Remove(user, src) + thrusters_action.Remove(user, src) + phasing_action.Remove(user, src) + switch_damtype_action.Remove(user, src) + overload_action.Remove(user, src) + + + +// +////BUTTONS STUFF +// + +/datum/action/innate/mecha + check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUNNED | AB_CHECK_ALIVE + button_icon = 'icons/effects/actions_mecha.dmi' + var/obj/mecha/chassis + +/datum/action/innate/mecha/Grant(mob/living/L, obj/mecha/M) + if(M) + chassis = M + ..() + + +/datum/action/innate/mecha/mech_toggle_lights + name = "Toggle Lights" + button_icon_state = "mech_lights_off" + +/datum/action/innate/mecha/mech_toggle_lights/Activate() + button_icon_state = "mech_lights_[chassis.lights ? "off" : "on"]" + button.UpdateIcon() + chassis.lights() + + + +/datum/action/innate/mecha/mech_toggle_internals + name = "Toggle Internal Airtank Usage" + button_icon_state = "mech_internals_off" + +/datum/action/innate/mecha/mech_toggle_internals/Activate() + button_icon_state = "mech_internals_[chassis.use_internal_tank ? "off" : "on"]" + button.UpdateIcon() + chassis.internal_tank() + + + +/datum/action/innate/mecha/mech_view_stats + name = "View stats" + button_icon_state = "mech_view_stats" + +/datum/action/innate/mecha/mech_view_stats/Activate() + chassis.view_stats() + + + +/datum/action/innate/mecha/mech_eject + name = "Eject From Mech" + button_icon_state = "mech_eject" + +/datum/action/innate/mecha/mech_eject/Activate() + chassis.go_out() + + + +/datum/action/innate/mecha/strafe + name = "Toggle Mech Strafing" + button_icon_state = "mech_strafe_off" + +/datum/action/innate/mecha/strafe/Activate() + button_icon_state = "mech_strafe_[chassis.strafing ? "off" : "on"]" + button.UpdateIcon() + chassis.strafing() + + + +/datum/action/innate/mecha/mech_defence_mode + name = "Toggle Mech defence mode" + button_icon_state = "mech_defense_mode_off" + +/datum/action/innate/mecha/mech_defence_mode/Activate() + button_icon_state = "mech_defense_mode_[chassis.defence_mode ? "off" : "on"]" + button.UpdateIcon() + chassis.defence_mode() + + + +/datum/action/innate/mecha/mech_overload_mode + name = "Toggle Mech Leg Overload" + button_icon_state = "mech_overload_off" + +/datum/action/innate/mecha/mech_overload_mode/Activate() + button_icon_state = "mech_overload_[chassis.overload ? "off" : "on"]" + button.UpdateIcon() + chassis.overload() + + + +/datum/action/innate/mecha/mech_smoke + name = "Toggle Mech Smoke" + button_icon_state = "mech_smoke_off" + +/datum/action/innate/mecha/mech_smoke/Activate() + //button_icon_state = "mech_smoke_[chassis.smoke ? "off" : "on"]" + //button.UpdateIcon() //Dual colors notneeded ATM + chassis.smoke() + + + +/datum/action/innate/mecha/mech_zoom + name = "Toggle Mech Zoom" + button_icon_state = "mech_zoom_off" + +/datum/action/innate/mecha/mech_zoom/Activate() + button_icon_state = "mech_zoom_[chassis.zoom ? "off" : "on"]" + button.UpdateIcon() + chassis.zoom() + + + +/datum/action/innate/mecha/mech_toggle_thrusters + name = "Toggle Mech thrusters" + button_icon_state = "mech_thrusters_off" + +/datum/action/innate/mecha/mech_toggle_thrusters/Activate() + button_icon_state = "mech_thrusters_[chassis.thrusters ? "off" : "on"]" + button.UpdateIcon() + chassis.thrusters() + + + +/datum/action/innate/mecha/mech_cycle_equip //I'll be honest, i don't understand this part, buuuuuut it works! + name = "Cycle Equipment" + button_icon_state = "mech_cycle_equip_off" + +/datum/action/innate/mecha/mech_cycle_equip/Activate() + + var/list/available_equipment = list() + available_equipment = chassis.equipment + + if(available_equipment.len == 0) + chassis.occupant_message("No equipment available.") + return + if(!chassis.selected) + chassis.selected = available_equipment[1] + chassis.occupant_message("You select [chassis.selected]") + send_byjax(chassis.occupant,"exosuit.browser","eq_list",chassis.get_equipment_list()) + button_icon_state = "mech_cycle_equip_on" + button.UpdateIcon() + return + var/number = 0 + for(var/A in available_equipment) + number++ + if(A == chassis.selected) + if(available_equipment.len == number) + chassis.selected = null + chassis.occupant_message("You switch to no equipment") + button_icon_state = "mech_cycle_equip_off" + else + chassis.selected = available_equipment[number+1] + chassis.occupant_message("You switch to [chassis.selected]") + button_icon_state = "mech_cycle_equip_on" + send_byjax(chassis.occupant,"exosuit.browser","eq_list",chassis.get_equipment_list()) + button.UpdateIcon() + return + + + +/datum/action/innate/mecha/mech_switch_damtype + name = "Reconfigure arm microtool arrays" + button_icon_state = "mech_damtype_brute" + + +/datum/action/innate/mecha/mech_switch_damtype/Activate() + + + button_icon_state = "mech_damtype_[chassis.damtype]" + playsound(src, 'sound/mecha/mechmove01.ogg', 50, 1) + button.UpdateIcon() + chassis.query_damtype() + + + +/datum/action/innate/mecha/mech_toggle_phasing + name = "Toggle Mech phasing" + button_icon_state = "mech_phasing_off" + +/datum/action/innate/mecha/mech_toggle_phasing/Activate() + button_icon_state = "mech_phasing_[chassis.phasing ? "off" : "on"]" + button.UpdateIcon() + chassis.phasing() + + + + + +///// +///// +///// ACTUAL MECANICS FOR THE ACTIONS +///// OVERLOAD, DEFENCE, SMOKE +///// +///// + + +/obj/mecha/verb/toggle_defence_mode() + set category = "Exosuit Interface" + set name = "Toggle defence mode" + set src = usr.loc + set popup_menu = 0 + defence_mode() + +/obj/mecha/proc/defence_mode() + if(usr!=src.occupant) + return + playsound(src, 'sound/mecha/duranddefencemode.ogg', 50, 1) + defence_mode = !defence_mode + if(defence_mode) + deflect_chance = defence_deflect + src.occupant_message("You enable [src] defence mode.") + else + deflect_chance = initial(deflect_chance) + src.occupant_message("You disable [src] defence mode.") + src.log_message("Toggled defence mode.") + return + + + +/obj/mecha/verb/toggle_overload() + set category = "Exosuit Interface" + set name = "Toggle leg actuators overload" + set src = usr.loc + set popup_menu = 0 + overload() + +/obj/mecha/proc/overload() + if(usr.stat == 1)//No manipulating things while unconcious. + return + if(usr!=src.occupant) + return + if(health < initial(health) - initial(health)/3)//Same formula as in movement, just beforehand. + src.occupant_message("Leg actuators damage critical, unable to engage overload.") + overload = 0 //Just to be sure + return + if(overload) + overload = 0 + step_in = initial(step_in) + step_energy_drain = initial(step_energy_drain) + src.occupant_message("You disable leg actuators overload.") + else + overload = 1 + step_in = min(1, round(step_in/2)) + step_energy_drain = step_energy_drain*overload_coeff + src.occupant_message("You enable leg actuators overload.") + src.log_message("Toggled leg actuators overload.") + playsound(src, 'sound/mecha/mechanical_toggle.ogg', 50, 1) + return + + +/obj/mecha/verb/toggle_smoke() + set category = "Exosuit Interface" + set name = "Activate Smoke" + set src = usr.loc + set popup_menu = 0 + smoke() + +/obj/mecha/proc/smoke() + if(usr!=src.occupant) + return + + if(smoke_reserve < 1) + src.occupant_message("You don't have any smoke left in stock!") + return + + if(smoke_ready) + smoke_reserve-- //Remove ammo + src.occupant_message("Smoke fired. [smoke_reserve] usages left.") + + var/datum/effect/effect/system/smoke_spread/smoke = new /datum/effect/effect/system/smoke_spread() + smoke.attach(src) + smoke.set_up(10, 0, usr.loc) + smoke.start() + playsound(src, 'sound/effects/smoke.ogg', 50, 1, -3) + + smoke_ready = 0 + spawn(smoke_cooldown) + smoke_ready = 1 + return + + + +/obj/mecha/verb/toggle_zoom() + set category = "Exosuit Interface" + set name = "Zoom" + set src = usr.loc + set popup_menu = 0 + zoom() + +/obj/mecha/proc/zoom()//This could use improvements but maybe later. + if(usr!=src.occupant) + return + if(src.occupant.client) + src.zoom = !src.zoom + src.log_message("Toggled zoom mode.") + src.occupant_message("Zoom mode [zoom?"en":"dis"]abled.") + if(zoom) + src.occupant.set_viewsize(12) + src.occupant << sound('sound/mecha/imag_enh.ogg',volume=50) + else + src.occupant.set_viewsize() // Reset to default + return + + + +/obj/mecha/verb/toggle_thrusters() + set category = "Exosuit Interface" + set name = "Toggle thrusters" + set src = usr.loc + set popup_menu = 0 + thrusters() + +/obj/mecha/proc/thrusters() + if(usr!=src.occupant) + return + if(src.occupant) + if(get_charge() > 0) + thrusters = !thrusters + src.log_message("Toggled thrusters.") + src.occupant_message("Thrusters [thrusters?"en":"dis"]abled.") + return + + + +/obj/mecha/verb/switch_damtype() + set category = "Exosuit Interface" + set name = "Change melee damage type" + set src = usr.loc + set popup_menu = 0 + query_damtype() + +/obj/mecha/proc/query_damtype() + if(usr!=src.occupant) + return + var/new_damtype = alert(src.occupant,"Melee Damage Type",null,"Brute","Fire","Toxic") + switch(new_damtype) + if("Brute") + damtype = "brute" + src.occupant_message("Your exosuit's hands form into fists.") + if("Fire") + damtype = "fire" + src.occupant_message("A torch tip extends from your exosuit's hand, glowing red.") + if("Toxic") + damtype = "tox" + src.occupant_message("A bone-chillingly thick plasteel needle protracts from the exosuit's palm.") + src.occupant_message("Melee damage type switched to [new_damtype]") + return + + + +/obj/mecha/verb/toggle_phasing() + set category = "Exosuit Interface" + set name = "Toggle phasing" + set src = usr.loc + set popup_menu = 0 + phasing() + +/obj/mecha/proc/phasing() + if(usr!=src.occupant) + return + phasing = !phasing + send_byjax(src.occupant,"exosuit.browser","phasing_command","[phasing?"Dis":"En"]able phasing") + src.occupant_message("En":"#f00\">Dis"]abled phasing.") + return + + diff --git a/code/modules/mob/mob_defines.dm b/code/modules/mob/mob_defines.dm index 0b516955ef..511073270f 100644 --- a/code/modules/mob/mob_defines.dm +++ b/code/modules/mob/mob_defines.dm @@ -224,4 +224,8 @@ var/registered_z - var/list/progressbars = null //for stacking do_after bars \ No newline at end of file +<<<<<<< HEAD + var/list/progressbars = null //for stacking do_after bars +======= + var/in_enclosed_vehicle = 0 //For mechs and fighters ambiance. Can be used in other cases. +>>>>>>> ce9ceb4... Add clickable action buttons from /TG/, rework a lot of backend and other improvements. (#7315) diff --git a/icons/effects/actions_mecha.dmi b/icons/effects/actions_mecha.dmi new file mode 100644 index 0000000000000000000000000000000000000000..0a505767a3021ec6bedfbb260e2edf3d19bc3b7d GIT binary patch literal 7707 zcmY*e2{=^W`@eSCC0mvuLiQ+2mOD!5YZ(er)>I1Fcbc*9Tge)R)YraONE!?gWm2|6 zW673%of&54{-@vX|NNil|2+5J^Pcsd^Pcy-pZ9%FvZaMFC);T@0020znHXNDrCqeQ zl$DwGy(Q=72mo}P;nsG6hW7&8{2%%TKJ@VhfY73xr`;ABx?4i!Q60ut7UzZL0%qh+BXXK9bsN{hh;@zt_tMy&8w00N2n@Os_ z)n7>voX0M&eG=aF%j$rDZ>_4)Dtvz?bk%bu$Coe1e79$Q$+VYmrh-1sN>?Hx z@!`pO$)<7pPTyQ}AkPo+l%{Cf^i_^rbGEauG)n-0=%;Ij2G*fP8;({<(*0r7!5d)2oOtq*CU+M72SVpoI^6(KojOYF_nO*#I+YR9 z^Y+nZM8Dsx7MGWGn_!@2{G+L8Xs$ESt(;pJ^$|^vngEifp;u31&?*Z!;*ELKsLrI+ zR?AcAwnrU9_l`r~KYt>pH|x?yq8s%{Tow>G!dOlRu(Qt*P@_ml>hW@T4!XGbz-iI{ zhazf{bJGTSKm22aJ=2gJYK7C{Ihw(CRAxAyf|H|CjiZpDXK=6p@YUmu@A9zN=vq*V zbJT~#F5L5i5;~wwOfbEZx$yYQlli=Ee6z8h>^$rZ9%9|PTQhdKX6&EZT{T*h4GW#7 zL2eyXeilo#)e$A0Im>pD?xp+(*I5GgwTLuUjzXmql>6kJ8DGh6);tx#Lp<@XgV=~R zFKTiN6MT=eCeJp0V#46rF^EyiY+uwaCubfZXfv_);I|g6E)%RAJ?g(>GdMH|zymNR zI__Yr5?Y;tUqOks=TsD~kg-X(zVN2#{LvQg=>@F{0if3DR$sijVB0;rTC~&6rL%F# zXyS72vM*&f$Xi(8w#e=4AEM|0$Me};VJ{Yw?WMOH*OF$f#SpW)BfGtdCq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