diff --git a/code/game/mecha/equipment/tools/tools.dm b/code/game/mecha/equipment/tools/tools.dm index f3df144ea75..cc41d779dc7 100644 --- a/code/game/mecha/equipment/tools/tools.dm +++ b/code/game/mecha/equipment/tools/tools.dm @@ -57,6 +57,7 @@ M.adjustOxyLoss(round(dam_force/2)) M.updatehealth() occupant_message("You squeeze [target] with [src.name]. Something cracks.") + playsound(src.loc, "fracture", 5, 1, -2) //CRACK chassis.visible_message("[chassis] squeezes [target].") else step_away(M,chassis) @@ -408,7 +409,7 @@ /obj/item/mecha_parts/mecha_equipment/gravcatapult name = "gravitational catapult" - desc = "An exosuit mounted Gravitational Catapult." + desc = "An exosuit mounted gravitational catapult." icon_state = "mecha_teleport" origin_tech = list(TECH_BLUESPACE = 2, TECH_MAGNET = 3) equip_cooldown = 10 @@ -1041,7 +1042,7 @@ /obj/item/mecha_parts/mecha_equipment/tool/passenger name = "passenger compartment" - desc = "A mountable passenger compartment for exo-suits. Rather cramped." + desc = "A mountable passenger compartment for exosuits. Rather cramped." icon_state = "mecha_abooster_ccw" origin_tech = list(TECH_ENGINEERING = 1, TECH_BIO = 1) energy_drain = 10 @@ -1071,9 +1072,9 @@ log_message("[user] boarded.") occupant_message("[user] boarded.") else if(src.occupant != user) - user << "[src.occupant] was faster. Try better next time, loser." + to_chat(user, "[src.occupant] was faster. Try harder next time, loser.") else - user << "You stop entering the exosuit." + to_chat(user, "You stop entering the exosuit.") /obj/item/mecha_parts/mecha_equipment/tool/passenger/verb/eject() set name = "Eject" @@ -1083,7 +1084,7 @@ if(usr != occupant) return - occupant << "You climb out from \the [src]." + to_chat(occupant, "You climb out from \the [src].") go_out() occupant_message("[occupant] disembarked.") log_message("[occupant] disembarked.") @@ -1186,3 +1187,98 @@ #undef LOCKED #undef OCCUPIED + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack + name = "ion jetpack" + desc = "Using directed ion bursts and cunning solar wind reflection technique, this device enables controlled space flight." + icon_state = "mecha_jetpack" + equip_cooldown = 5 + energy_drain = 50 + var/wait = 0 + var/datum/effect/effect/system/ion_trail_follow/ion_trail + + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/can_attach(obj/mecha/M as obj) + if(!(locate(src.type) in M.equipment) && !M.proc_res["dyndomove"]) + return ..() + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/detach() + ..() + chassis.proc_res["dyndomove"] = null + return + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/attach(obj/mecha/M as obj) + ..() + if(!ion_trail) + ion_trail = new + ion_trail.set_up(chassis) + return + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/proc/toggle() + if(!chassis) + return + !equip_ready? turn_off() : turn_on() + return equip_ready + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/proc/turn_on() + set_ready_state(0) + chassis.proc_res["dyndomove"] = src + ion_trail.start() + occupant_message("Activated") + log_message("Activated") + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/proc/turn_off() + set_ready_state(1) + chassis.proc_res["dyndomove"] = null + ion_trail.stop() + occupant_message("Deactivated") + log_message("Deactivated") + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/proc/dyndomove(direction) + if(!action_checks()) + return chassis.dyndomove(direction) + var/move_result = 0 + if(chassis.hasInternalDamage(MECHA_INT_CONTROL_LOST)) + move_result = step_rand(chassis) + else if(chassis.dir!=direction) + chassis.set_dir(direction) + move_result = 1 + else + move_result = step(chassis,direction) + if(chassis.occupant) + for(var/obj/effect/speech_bubble/B in range(1, chassis)) + if(B.parent == chassis.occupant) + B.loc = chassis.loc + if(move_result) + wait = 1 + chassis.use_power(energy_drain) + if(!chassis.pr_inertial_movement.active()) + chassis.pr_inertial_movement.start(list(chassis,direction)) + else + chassis.pr_inertial_movement.set_process_args(list(chassis,direction)) + do_after_cooldown() + return 1 + return 0 + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/action_checks() + if(equip_ready || wait) + return 0 + if(energy_drain && !chassis.has_charge(energy_drain)) + return 0 + if(chassis.check_for_support()) + return 0 + return 1 + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/get_equip_info() + if(!chassis) return + return "* [src.name] \[Toggle\]" + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/Topic(href,href_list) + ..() + if(href_list["toggle"]) + toggle() + +/obj/item/mecha_parts/mecha_equipment/tool/jetpack/do_after_cooldown() + sleep(equip_cooldown) + wait = 0 + return 1 \ No newline at end of file diff --git a/code/game/mecha/equipment/tools/unused_tools.dm b/code/game/mecha/equipment/tools/unused_tools.dm index 1b6d8c9e23d..c7ef794c4e5 100644 --- a/code/game/mecha/equipment/tools/unused_tools.dm +++ b/code/game/mecha/equipment/tools/unused_tools.dm @@ -6,134 +6,6 @@ - -//NEEDS SPRITE! (When this gets ticked in search for 'TODO MECHA JETPACK SPRITE MISSING' through code to uncomment the place where it's missing.) -/obj/item/mecha_parts/mecha_equipment/jetpack - name = "jetpack" - desc = "Using directed ion bursts and cunning solar wind reflection technique, this device enables controlled space flight." - icon_state = "mecha_equip" - equip_cooldown = 5 - energy_drain = 50 - var/wait = 0 - var/datum/effect/effect/system/ion_trail_follow/ion_trail - - - can_attach(obj/mecha/M as obj) - if(!(locate(src.type) in M.equipment) && !M.proc_res["dyndomove"]) - return ..() - - detach() - ..() - chassis.proc_res["dyndomove"] = null - return - - attach(obj/mecha/M as obj) - ..() - if(!ion_trail) - ion_trail = new - ion_trail.set_up(chassis) - return - - proc/toggle() - if(!chassis) - return - !equip_ready? turn_off() : turn_on() - return equip_ready - - proc/turn_on() - set_ready_state(0) - chassis.proc_res["dyndomove"] = src - ion_trail.start() - occupant_message("Activated") - log_message("Activated") - - proc/turn_off() - set_ready_state(1) - chassis.proc_res["dyndomove"] = null - ion_trail.stop() - occupant_message("Deactivated") - log_message("Deactivated") - - proc/dyndomove(direction) - if(!action_checks()) - return chassis.dyndomove(direction) - var/move_result = 0 - if(chassis.hasInternalDamage(MECHA_INT_CONTROL_LOST)) - move_result = step_rand(chassis) - else if(chassis.dir!=direction) - chassis.set_dir(direction) - move_result = 1 - else - move_result = step(chassis,direction) - if(chassis.occupant) - for(var/obj/effect/speech_bubble/B in range(1, chassis)) - if(B.parent == chassis.occupant) - B.loc = chassis.loc - if(move_result) - wait = 1 - chassis.use_power(energy_drain) - if(!chassis.pr_inertial_movement.active()) - chassis.pr_inertial_movement.start(list(chassis,direction)) - else - chassis.pr_inertial_movement.set_process_args(list(chassis,direction)) - do_after_cooldown() - return 1 - return 0 - - action_checks() - if(equip_ready || wait) - return 0 - if(energy_drain && !chassis.has_charge(energy_drain)) - return 0 - if(chassis.check_for_support()) - return 0 - return 1 - - get_equip_info() - if(!chassis) return - return "* [src.name] \[Toggle\]" - - - Topic(href,href_list) - ..() - if(href_list["toggle"]) - toggle() - - do_after_cooldown() - sleep(equip_cooldown) - wait = 0 - return 1 - - -/obj/item/mecha_parts/mecha_equipment/defence_shocker - name = "exosuit defence shocker" - desc = "" - icon_state = "mecha_teleport" - equip_cooldown = 10 - energy_drain = 100 - range = RANGED - var/shock_damage = 15 - var/active - - can_attach(obj/mecha/M as obj) - if(..()) - if(!istype(M, /obj/mecha/combat/honker)) - if(!M.proc_res["dynattackby"] && !M.proc_res["dynattackhand"] && !M.proc_res["dynattackalien"]) - return 1 - return 0 - - attach(obj/mecha/M as obj) - ..() - chassis.proc_res["dynattackby"] = src - return - - proc/dynattackby(obj/item/weapon/W as obj, mob/user as mob) - if(!action_checks(user) || !active) - return - user.electrocute_act(shock_damage, src) - return chassis.dynattackby(W,user) - - /* /obj/item/mecha_parts/mecha_equipment/book_stocker diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm index 3b8cf65816b..50012fe95c8 100644 --- a/code/game/mecha/equipment/weapons/weapons.dm +++ b/code/game/mecha/equipment/weapons/weapons.dm @@ -117,20 +117,18 @@ projectile = /obj/item/projectile/beam/stun fire_sound = 'sound/weapons/Taser.ogg' -/* Commenting this out rather than removing it because it may be useful for reference. +/* /obj/item/mecha_parts/mecha_equipment/weapon/honker - name = "\improper HoNkER BlAsT 5000" + name = "sound emission device" icon_state = "mecha_honker" - energy_drain = 200 + energy_drain = 300 equip_cooldown = 150 range = MELEE|RANGED - construction_time = 500 - construction_cost = list("metal"=20000,"bananium"=10000) + origin_tech = list(TECH_MATERIAL = 2, TECH_COMBAT = 4, TECH_ILLEGAL = 1) - can_attach(obj/mecha/combat/honker/M as obj) - if(!istype(M)) - return 0 - return ..() + var/ear_safety = 0 + if(iscarbon(M)) + ear_safety = M.get_ear_protection() action(target) if(!chassis) @@ -140,25 +138,22 @@ if(!equip_ready) return 0 - playsound(chassis, 'sound/items/AirHorn.ogg', 100, 1) - chassis.occupant_message("HONK") + playsound(chassis, 'sound/effects/bang.ogg', 30, 1, 30) + chassis.occupant_message("You emit a high-pitched noise from the mech.") for(var/mob/living/carbon/M in ohearers(6, chassis)) if(istype(M, /mob/living/carbon/human)) var/mob/living/carbon/human/H = M - if(istype(H.l_ear, /obj/item/clothing/ears/earmuffs) || istype(H.r_ear, /obj/item/clothing/ears/earmuffs)) - continue - M << "HONK" + if(ear_safety > 0) + return + to_chat(M, "\Your ears feel like they're bleeding!") + playsound(M, 'sound/effects/bang.ogg', 70, 1, 30) M.sleeping = 0 - M.stuttering += 20 M.ear_deaf += 30 + M.ear_damage += rand(5, 20) M.Weaken(3) - if(prob(30)) - M.Stun(10) - M.Paralyse(4) - else - M.make_jittery(500) + M.Stun(5) chassis.use_power(energy_drain) - log_message("Honked from [src.name]. HONK!") + log_message("Used a sound emission device.") do_after_cooldown() return */ @@ -335,3 +330,35 @@ projectile = /obj/item/projectile/bullet/incendiary/flamethrower origin_tech = list(TECH_MATERIAL = 3, TECH_COMBAT = 3, TECH_PHORON = 3, TECH_ILLEGAL = 2) + +////////////// +//Defensive// +////////////// + +/obj/item/mecha_parts/mecha_equipment/shocker + name = "exosuit electrifier" + desc = "A device to electrify the external portions of a mecha in order to increase its defensive capabilities." + icon_state = "mecha_coil" + equip_cooldown = 10 + energy_drain = 100 + range = RANGED + origin_tech = list(TECH_COMBAT = 3, TECH_POWER = 6) + var/shock_damage = 15 + var/active + +/obj/item/mecha_parts/mecha_equipment/shocker/can_attach(obj/mecha/M as obj) + if(..()) + if(!M.proc_res["dynattackby"] && !M.proc_res["dynattackhand"] && !M.proc_res["dynattackalien"]) + return 1 + return 0 + +/obj/item/mecha_parts/mecha_equipment/shocker/attach(obj/mecha/M as obj) + ..() + chassis.proc_res["dynattackby"] = src + return + +/obj/item/mecha_parts/mecha_equipment/shocker/proc/dynattackby(obj/item/weapon/W, mob/living/user) + if(!action_checks(user) || !active) + return + user.electrocute_act(shock_damage, src) + return chassis.dynattackby(W,user) \ No newline at end of file diff --git a/code/modules/research/mechfab_designs.dm b/code/modules/research/mechfab_designs.dm index 8efeec6c0d5..5936c3c9bc3 100644 --- a/code/modules/research/mechfab_designs.dm +++ b/code/modules/research/mechfab_designs.dm @@ -290,6 +290,14 @@ id = "mech_taser" build_path = /obj/item/mecha_parts/mecha_equipment/weapon/energy/taser +/datum/design/item/mecha/shocker + name = "Exosuit Electrifier" + desc = "A device to electrify the external portions of a mecha in order to increase its defensive capabilities." + id = "mech_shocker" + req_tech = list(TECH_COMBAT = 3, TECH_POWER = 6, TECH_MAGNET = 1) + build_path = /obj/item/mecha_parts/mecha_equipment/shocker + materials = list(DEFAULT_WALL_MATERIAL = 3500, "gold" = 750, "glass" = 1000) + /datum/design/item/mecha/lmg name = "Ultra AC 2" id = "mech_lmg" @@ -407,7 +415,13 @@ materials = list(DEFAULT_WALL_MATERIAL = 7500, "gold" = 750, "silver" = 1500, "glass" = 3750) build_path = /obj/item/mecha_parts/mecha_equipment/repair_droid -//obj/item/mecha_parts/mecha_equipment/jetpack, //TODO MECHA JETPACK SPRITE MISSING +/datum/design/item/mecha/jetpack + name = "Ion Jetpack" + desc = "Using directed ion bursts and cunning solar wind reflection technique, this device enables controlled space flight." + id = "mech_jetpack" + req_tech = list(TECH_ENGINEERING = 3, TECH_MAGNET = 4) //One less magnet than the actual got-damn teleporter. + build_path = /obj/item/mecha_parts/mecha_equipment/tool/jetpack + materials = list(DEFAULT_WALL_MATERIAL = 7500, "silver" = 300, "glass" = 600) /datum/design/item/mecha/phoron_generator desc = "Phoron Reactor" diff --git a/icons/mecha/mecha_equipment.dmi b/icons/mecha/mecha_equipment.dmi index 930e724d220..d13c430c8ff 100644 Binary files a/icons/mecha/mecha_equipment.dmi and b/icons/mecha/mecha_equipment.dmi differ