From d97bd6c0aedfaba002ff45b5b34dede2e86051cb Mon Sep 17 00:00:00 2001 From: kevinz000 <2003111+kevinz000@users.noreply.github.com> Date: Wed, 18 Jul 2018 14:46:53 -0700 Subject: [PATCH] Removes flightsuits (#39195) --- .../subsystem/processing/flightpacks.dm | 25 - code/datums/actions/flightsuit.dm | 117 -- .../effects/effect_system/effects_other.dm | 12 - code/modules/cargo/bounties/science.dm | 6 - .../modules/clothing/spacesuits/flightsuit.dm | 1119 ----------------- .../mob/living/carbon/carbon_movement.dm | 15 +- code/modules/mob/living/carbon/human/human.dm | 7 - .../mob/living/carbon/human/species.dm | 13 +- .../research/designs/equipment_designs.dm | 32 - code/modules/research/techweb/all_nodes.dm | 9 - tgstation.dme | 8 +- 11 files changed, 6 insertions(+), 1357 deletions(-) delete mode 100644 code/controllers/subsystem/processing/flightpacks.dm delete mode 100644 code/datums/actions/flightsuit.dm delete mode 100644 code/modules/clothing/spacesuits/flightsuit.dm delete mode 100644 code/modules/research/designs/equipment_designs.dm diff --git a/code/controllers/subsystem/processing/flightpacks.dm b/code/controllers/subsystem/processing/flightpacks.dm deleted file mode 100644 index a462e2b6450..00000000000 --- a/code/controllers/subsystem/processing/flightpacks.dm +++ /dev/null @@ -1,25 +0,0 @@ -PROCESSING_SUBSYSTEM_DEF(flightpacks) - name = "Flightpack Movement" - priority = FIRE_PRIORITY_FLIGHTPACKS - wait = 2 - stat_tag = "FM" - flags = SS_NO_INIT|SS_TICKER|SS_KEEP_TIMING - - var/flightsuit_processing = FLIGHTSUIT_PROCESSING_FULL - -/datum/controller/subsystem/processing/flightpacks/Initialize() - sync_flightsuit_processing() - -/datum/controller/subsystem/processing/flightpacks/vv_edit_var(var_name, var_value) - ..() - switch(var_name) - if("flightsuit_processing") - sync_flightsuit_processing() - -/datum/controller/subsystem/processing/flightpacks/proc/sync_flightsuit_processing() - for(var/obj/item/flightpack/FP in processing) - FP.sync_processing(src) - if(flightsuit_processing == FLIGHTSUIT_PROCESSING_NONE) //Don't even bother firing. - can_fire = FALSE - else - can_fire = TRUE diff --git a/code/datums/actions/flightsuit.dm b/code/datums/actions/flightsuit.dm deleted file mode 100644 index 85bd2ae72ab..00000000000 --- a/code/datums/actions/flightsuit.dm +++ /dev/null @@ -1,117 +0,0 @@ -/datum/action/item_action/flightsuit - icon_icon = 'icons/mob/actions/actions_flightsuit.dmi' - -/datum/action/item_action/flightsuit/toggle_boots - name = "Toggle Boots" - button_icon_state = "flightsuit_shoes" - background_icon_state = "bg_tech" - -/datum/action/item_action/flightsuit/toggle_boots/Trigger() - var/obj/item/clothing/suit/space/hardsuit/flightsuit/FS = target - if(istype(FS)) - FS.deployedshoes? FS.retract_flightshoes() : FS.extend_flightshoes() - return ..() - -/datum/action/item_action/flightsuit/toggle_helmet - name = "Toggle Helmet" - button_icon_state = "flightsuit_helmet" - background_icon_state = "bg_tech" - -/datum/action/item_action/flightsuit/toggle_helmet/Trigger() - var/obj/item/clothing/suit/space/hardsuit/flightsuit/FS = target - if(istype(FS)) - FS.ToggleHelmet() - return ..() - -/datum/action/item_action/flightsuit/toggle_flightpack - name = "Toggle Flightpack" - button_icon_state = "flightsuit_pack" - background_icon_state = "bg_tech" - -/datum/action/item_action/flightsuit/toggle_flightpack/Trigger() - var/obj/item/clothing/suit/space/hardsuit/flightsuit/FS = target - if(istype(FS)) - FS.deployedpack? FS.retract_flightpack() : FS.extend_flightpack() - return ..() - -/datum/action/item_action/flightsuit/lock_suit - name = "Lock Suit" - button_icon_state = "flightsuit_lock" - background_icon_state = "bg_tech" - -/datum/action/item_action/flightsuit/lock_suit/Trigger() - var/obj/item/clothing/suit/space/hardsuit/flightsuit/FS = target - if(istype(FS)) - FS.locked? FS.unlock_suit(owner) : FS.lock_suit(owner) - return ..() - -/datum/action/item_action/flightpack - icon_icon = 'icons/mob/actions/actions_flightsuit.dmi' - -/datum/action/item_action/flightpack/toggle_flight - name = "Toggle Flight" - button_icon_state = "flightpack_fly" - background_icon_state = "bg_tech_blue" - -/datum/action/item_action/flightpack/toggle_flight/Trigger() - var/obj/item/flightpack/F = target - if(istype(F)) - F.flight? F.disable_flight() : F.enable_flight() - return ..() - -/datum/action/item_action/flightpack/engage_boosters - name = "Toggle Boosters" - button_icon_state = "flightpack_boost" - background_icon_state = "bg_tech_blue" - -/datum/action/item_action/flightpack/engage_boosters/Trigger() - var/obj/item/flightpack/F = target - if(istype(F)) - F.boost? F.deactivate_booster() : F.activate_booster() - return ..() - -/datum/action/item_action/flightpack/toggle_stabilizers - name = "Toggle Stabilizers" - button_icon_state = "flightpack_stabilizer" - background_icon_state = "bg_tech_blue" - -/datum/action/item_action/flightpack/toggle_stabilizers/Trigger() - var/obj/item/flightpack/F = target - if(istype(F)) - F.stabilizer? F.disable_stabilizers() : F.enable_stabilizers() - return ..() - -/datum/action/item_action/flightpack/change_power - name = "Flight Power Setting" - button_icon_state = "flightpack_power" - background_icon_state = "bg_tech_blue" - -/datum/action/item_action/flightpack/change_power/Trigger() - var/obj/item/flightpack/F = target - if(istype(F)) - F.cycle_power() - return ..() - -/datum/action/item_action/flightpack/toggle_airbrake - name = "Toggle Airbrake" - button_icon_state = "flightpack_airbrake" - background_icon_state = "bg_tech_blue" - -/datum/action/item_action/flightpack/toggle_airbrake/Trigger() - var/obj/item/flightpack/F = target - if(istype(F)) - F.brake? F.disable_airbrake() : F.enable_airbrake() - return ..() - -/datum/action/item_action/flightpack/zoom - name = "Helmet Smart Zoom" - icon_icon = 'icons/mob/actions.dmi' - background_icon_state = "bg_tech_blue" - icon_icon = 'icons/mob/actions/actions_items.dmi' - button_icon_state = "sniper_zoom" - -/datum/action/item_action/flightpack/zoom/Trigger() - var/obj/item/clothing/head/helmet/space/hardsuit/flightsuit/FH = target - if(istype(FH)) - FH.toggle_zoom(owner) - return ..() diff --git a/code/game/objects/effects/effect_system/effects_other.dm b/code/game/objects/effects/effect_system/effects_other.dm index 373ebc76673..18c1ff58902 100644 --- a/code/game/objects/effects/effect_system/effects_other.dm +++ b/code/game/objects/effects/effect_system/effects_other.dm @@ -81,18 +81,6 @@ /datum/effect_system/trail_follow/proc/set_dir(obj/effect/particle_effect/ion_trails/I) I.setDir(holder.dir) -/datum/effect_system/trail_follow/ion/flight - effect_type = /obj/effect/particle_effect/ion_trails/flight - fadetype = "ion_fade_flight" - nograv_required = FALSE - auto_process = FALSE - -/datum/effect_system/trail_follow/ion/flight/set_dir(obj/effect/particle_effect/ion_trails/I) - if(istype(holder, /obj/item/flightpack)) - var/obj/item/flightpack/F = holder - if(istype(F.wearer)) - I.setDir(F.wearer.dir) - //Reagent-based explosion effect /datum/effect_system/reagents_explosion diff --git a/code/modules/cargo/bounties/science.dm b/code/modules/cargo/bounties/science.dm index a2b8676ce00..f6b3ea219e3 100644 --- a/code/modules/cargo/bounties/science.dm +++ b/code/modules/cargo/bounties/science.dm @@ -53,12 +53,6 @@ reward = 10000 wanted_types = list(/obj/item/janiupgrade) -/datum/bounty/item/science/flightsuit - name = "Flight Suit" - description = "According to all known laws of physics, flight suits are cool. CentCom will pay at a premium for them, so get shipping!" - reward = 30000 - wanted_types = list(/obj/item/clothing/suit/space/hardsuit/flightsuit) - /datum/bounty/item/science/advanced_mop name = "Advanced Mop" description = "Excuse me. I'd like to request $17 for a push broom rebristling. Either that, or an advanced mop." diff --git a/code/modules/clothing/spacesuits/flightsuit.dm b/code/modules/clothing/spacesuits/flightsuit.dm deleted file mode 100644 index 176bc816652..00000000000 --- a/code/modules/clothing/spacesuits/flightsuit.dm +++ /dev/null @@ -1,1119 +0,0 @@ - -#define FLIGHTPACK_SPRITE_ON_APPEND "_on" -#define FLIGHTPACK_SPRITE_BOOST_APPEND "_boost" -#define FLIGHTPACK_SPRITE_OFF_APPEND "_off" -#define FLIGHTPACK_SPRITE_BASE "flightpack" - -//So how this is planned to work is it is an item that allows you to fly with some interesting movement mechanics. -//You will still move instantly like usual, but when you move in a direction you gain "momentum" towards that direction -//Momentum will have a maximum value that it will be capped to, and will go down over time -//There is toggleable "stabilizers" that will make momentum go down FAST instead of its normal slow rate -//The suit is heavy and will slow you down on the ground but is a bit faster then usual in air -//The speed at which you drift is determined by your current momentum -//Also, I should probably add in some kind of limiting mechanic but I really don't like having to refill this all the time, expecially as it will be NODROP_1. -//Apparently due to code limitations you have to detect mob movement with.. shoes. -//The object that handles the flying itself - FLIGHT PACK -------------------------------------------------------------------------------------- -/obj/item/flightpack - name = "flight pack" - desc = "An advanced back-worn system that has dual ion engines powerful enough to grant a humanoid flight. Contains an internal self-recharging high-current capacitor for short, powerful boosts." - icon = 'icons/obj/device.dmi' - icon_state = FLIGHTPACK_SPRITE_BASE - item_state = FLIGHTPACK_SPRITE_BASE - actions_types = list(/datum/action/item_action/flightpack/toggle_flight, /datum/action/item_action/flightpack/engage_boosters, /datum/action/item_action/flightpack/toggle_stabilizers, /datum/action/item_action/flightpack/change_power, /datum/action/item_action/flightpack/toggle_airbrake) - armor = list("melee" = 20, "bullet" = 20, "laser" = 20, "energy" = 10, "bomb" = 30, "bio" = 100, "rad" = 75, "fire" = 100, "acid" = 75) - w_class = WEIGHT_CLASS_BULKY - slot_flags = ITEM_SLOT_BACK - resistance_flags = FIRE_PROOF - - var/processing_mode = FLIGHTSUIT_PROCESSING_FULL - var/obj/item/clothing/suit/space/hardsuit/flightsuit/suit = null - var/mob/living/carbon/human/wearer = null - var/slowdown_ground = 1 - var/slowdown_air = 0 - var/slowdown_brake = TRUE - var/flight = FALSE - var/flight_passflags = PASSTABLE - var/powersetting = 1 - var/powersetting_high = 3 - var/powersetting_low = 1 - var/override_safe = FALSE - - var/boost = FALSE - var/boost_maxcharge = 30 //Vroom! If you hit someone while boosting they'll likely be knocked flying. Fun. - var/boost_charge = 30 - var/boost_speed = 2 - var/boost_power = 50 - var/boost_chargerate = 0.3 - var/boost_drain = 6 //Keep in mind it charges and drains at the same time, so drain realistically is drain-charge=change - - var/momentum_x = 0 //Realistic physics. No more "Instant stopping while barreling down a hallway at Mach 1". - var/momentum_y = 0 - var/momentum_max = 500 - var/momentum_impact_coeff = 0.5 //At this speed you'll start coliding with people resulting in momentum loss and them being knocked back, but no injuries or knockdowns - var/momentum_impact_loss = 50 - var/momentum_crash_coeff = 0.8 //At this speed if you hit a dense object, you will careen out of control, while that object will be knocked flying. - var/momentum_drift_coeff = 0.04 - var/momentum_speed = 0 //How fast we are drifting around - var/momentum_speed_x = 0 - var/momentum_speed_y = 0 - var/momentum_passive_loss = 4 - var/momentum_gain = 20 - var/drift_tolerance = 2 - - var/stabilizer = TRUE - var/stabilizer_decay_amount = 11 - var/gravity = TRUE - var/gravity_decay_amount = 3 - var/pressure = TRUE - var/pressure_decay_amount = 3 - var/pressure_threshold = 30 - var/brake = FALSE - var/airbrake_decay_amount = 30 - - var/resync = FALSE //Used to resync the flight-suit every 30 seconds or so. - - var/disabled = FALSE //Whether it is disabled from crashes/emps/whatever - var/emp_disable_message = FALSE - - //This is probably too much code just for EMP damage. - var/emp_damage = 0 //One hit should make it hard to control, continuous hits will cripple it and then simply shut it off/make it crash. Direct hits count more. - var/emp_strong_damage = 4 - var/emp_weak_damage = 2.5 - var/emp_heal_amount = 0.06 //How much emp damage to heal per process. - var/emp_disable_threshold = 3 //3 weak ion, 2 strong ion hits. - var/emp_disabled = FALSE - - var/requires_suit = TRUE - - var/datum/effect_system/trail_follow/ion/flight/ion_trail - - var/assembled = FALSE - var/obj/item/stock_parts/manipulator/part_manip = null - var/obj/item/stock_parts/scanning_module/part_scan = null - var/obj/item/stock_parts/capacitor/part_cap = null - var/obj/item/stock_parts/micro_laser/part_laser = null - var/obj/item/stock_parts/matter_bin/part_bin = null - - var/crashing = FALSE //Are we currently getting wrecked? - - var/atom/movable/cached_pull //recipe for disaster again. - var/afterForceMove = FALSE - var/datum/component/mobhook - -/obj/item/flightpack/proc/changeWearer(mob/changeto) - if(wearer) - LAZYREMOVE(wearer.user_movement_hooks, src) - wearer = null - QDEL_NULL(mobhook) - cached_pull = null - if(istype(changeto)) - wearer = changeto - LAZYADD(wearer.user_movement_hooks, src) - cached_pull = changeto.pulling - mobhook = changeto.AddComponent(/datum/component/redirect, list(COMSIG_MOVABLE_MOVED), CALLBACK(src, .proc/on_mob_move, changeto)) - -/obj/item/flightpack/Initialize() - ion_trail = new - ion_trail.set_up(src) - START_PROCESSING(SSflightpacks, src) - update_parts() - sync_processing(SSflightpacks) - update_icon() - ..() - -/obj/item/flightpack/full/Initialize() - part_manip = new /obj/item/stock_parts/manipulator/pico(src) - part_scan = new /obj/item/stock_parts/scanning_module/phasic(src) - part_cap = new /obj/item/stock_parts/capacitor/super(src) - part_laser = new /obj/item/stock_parts/micro_laser/ultra(src) - part_bin = new /obj/item/stock_parts/matter_bin/super(src) - ..() - -/obj/item/flightpack/proc/usermessage(message, span = "boldnotice", mob/mob_override = null) - var/mob/targ = wearer - if(ismob(loc)) - targ = loc - if(istype(mob_override)) - targ = mob_override - if(!istype(targ)) - return - to_chat(targ, "[icon2html(src, targ)]|[message]") - -/obj/item/flightpack/proc/sync_processing(datum/controller/subsystem/processing/flightpacks/FPS) - processing_mode = FPS.flightsuit_processing - if(processing_mode == FLIGHTSUIT_PROCESSING_NONE) - momentum_x = 0 - momentum_y = 0 - momentum_speed_x = 0 - momentum_speed_y = 0 - momentum_speed = 0 - boost_charge = 0 - boost = FALSE - update_slowdown() - -/obj/item/flightpack/proc/update_parts() - boost_chargerate = initial(boost_chargerate) - boost_drain = initial(boost_drain) - powersetting_high = initial(powersetting_high) - emp_disable_threshold = initial(emp_disable_threshold) - stabilizer_decay_amount = initial(stabilizer_decay_amount) - airbrake_decay_amount = initial(airbrake_decay_amount) - assembled = FALSE //Ready? - if(part_manip && part_scan && part_cap && part_laser && part_bin) - var/manip = part_manip.rating - var/scan = part_scan.rating - var/cap = part_cap.rating - var/laser = part_laser.rating - var/bin = part_bin.rating - assembled = TRUE - boost_chargerate *= cap - boost_drain -= manip - powersetting_high = CLAMP(laser, 0, 3) - emp_disable_threshold = bin*1.25 - stabilizer_decay_amount = scan*3.5 - airbrake_decay_amount = manip*8 - -/obj/item/flightpack/Destroy() - if(suit) - delink_suit() - changeWearer() - disable_flight(TRUE) - QDEL_NULL(part_manip) - QDEL_NULL(part_scan) - QDEL_NULL(part_cap) - QDEL_NULL(part_laser) - QDEL_NULL(part_bin) - QDEL_NULL(ion_trail) - QDEL_NULL(mobhook) - STOP_PROCESSING(SSflightpacks, src) - . = ..() - -/obj/item/flightpack/emp_act(severity) - . = ..() - if(. & EMP_PROTECT_SELF) - return - var/damage = severity == 1 ? emp_strong_damage : emp_weak_damage - if(emp_damage <= (emp_disable_threshold * 1.5)) - emp_damage += damage - usermessage("WARNING: Class [severity] EMP detected! Circuit damage at [(emp_damage/emp_disable_threshold)*100]%!", "boldwarning") - -//Proc to change amount of momentum the wearer has, or dampen all momentum by a certain amount. -/obj/item/flightpack/proc/adjust_momentum(amountx, amounty, reduce_amount_total = 0) - if(reduce_amount_total != 0) - if(momentum_x > 0) - momentum_x = CLAMP(momentum_x - reduce_amount_total, 0, momentum_max) - else if(momentum_x < 0) - momentum_x = CLAMP(momentum_x + reduce_amount_total, -momentum_max, 0) - if(momentum_y > 0) - momentum_y = CLAMP(momentum_y - reduce_amount_total, 0, momentum_max) - else if(momentum_y < 0) - momentum_y = CLAMP(momentum_y + reduce_amount_total, -momentum_max, 0) - momentum_x = CLAMP(momentum_x + amountx, -momentum_max, momentum_max) - momentum_y = CLAMP(momentum_y + amounty, -momentum_max, momentum_max) - calculate_momentum_speed() - -//The wearer has momentum left. Move them and take some away, while negating the momentum that moving the wearer would gain. Or force the wearer to lose control if they are incapacitated. -/obj/item/flightpack/proc/momentum_drift() - if(!flight || !wearer || (momentum_speed == 0)) - return FALSE - else if(!wearer.canmove) - losecontrol() - var/drift_dir_x = 0 - var/drift_dir_y = 0 - if(momentum_x > 0) - drift_dir_x = EAST - else if(momentum_x < 0) - drift_dir_x = WEST - if(momentum_y > 0) - drift_dir_y = NORTH - else if(momentum_y < 0) - drift_dir_y = SOUTH - momentum_decay() - for(var/i in 1 to momentum_speed) - if(momentum_speed_x >= i) - step(wearer, drift_dir_x) - if(momentum_speed_y >= i) - step(wearer, drift_dir_y) - sleep(1) - if(prob(emp_damage * 15)) - step(wearer, pick(GLOB.alldirs)) - -/obj/item/flightpack/proc/on_mob_move(mob/mob, turf/oldLoc, dir, forced) - if(forced) - if(cached_pull && istype(oldLoc) && (get_dist(oldLoc, loc) <= 1) && !oldLoc.density) - cached_pull.forceMove(oldLoc) - mob.start_pulling(cached_pull, TRUE) - afterForceMove = TRUE - else - cached_pull = null - else - if(afterForceMove && !oldLoc.density) - cached_pull.forceMove(oldLoc) - wearer.start_pulling(cached_pull, TRUE) - cached_pull = null - else - cached_pull = wearer.pulling - afterForceMove = FALSE - if(flight) - ion_trail.generate_effect() - -/obj/item/flightpack/intercept_user_move(dir, mob, newLoc, oldLoc) - if(!flight) - return - var/momentum_increment = momentum_gain - if(boost) - momentum_increment = boost_power - if(brake) - momentum_increment = 0 - if(!gravity && !pressure) - momentum_increment -= 10 - switch(dir) - if(NORTH) - adjust_momentum(0, momentum_increment) - if(SOUTH) - adjust_momentum(0, -momentum_increment) - if(EAST) - adjust_momentum(momentum_increment, 0) - if(WEST) - adjust_momentum(-momentum_increment, 0) - -//Make the wearer lose some momentum. -/obj/item/flightpack/proc/momentum_decay() - var/amt = momentum_passive_loss - brake? (amt += airbrake_decay_amount) : 0 - gravity? (amt += gravity_decay_amount) : 0 - stabilizer? (amt += stabilizer_decay_amount) : 0 - pressure? (amt += pressure_decay_amount) : 0 - adjust_momentum(0, 0, amt) - -//Check for gravity, air pressure, and whether this is still linked to a suit. Also, resync the flightpack/flight suit every minute. -/obj/item/flightpack/proc/check_conditions() - if(flight && (!assembled || !wearer || (!suit && requires_suit))) - disable_flight(TRUE) - var/turf/T = get_turf(src) - if(T) - gravity = has_gravity() - var/datum/gas_mixture/gas = T.return_air() - var/envpressure = gas.return_pressure() - pressure = envpressure >= pressure_threshold - if(!pressure && brake) - brake = FALSE - usermessage("Airbrakes deactivated due to lack of pressure!", "boldwarning") - if(suit && !suit.deployedshoes && (brake || stabilizer)) - brake = FALSE - stabilizer = FALSE - usermessage("Warning: Sensor data is not being received from flight shoes. Stabilizers and airbrake modules deactivated!", "boldwarning") - - -/obj/item/flightpack/process() - if(processing_mode == FLIGHTSUIT_PROCESSING_NONE) - return FALSE - check_conditions() - calculate_momentum_speed() - momentum_drift() - handle_boost() - handle_damage() - -/obj/item/flightpack/proc/update_slowdown() - flight? (slowdown = slowdown_air) : (slowdown = slowdown_ground) - -/obj/item/flightpack/proc/handle_damage() - if(emp_damage) - emp_damage = CLAMP(emp_damage-emp_heal_amount, 0, emp_disable_threshold * 10) - if(emp_damage >= emp_disable_threshold) - emp_disabled = TRUE - if(emp_disabled && (emp_damage <= 0.5)) - emp_disabled = FALSE - emp_disable_message = FALSE - usermessage("Electromagnetic deflection system re-activated. Flight systems re-enabled.") - disabled = emp_disabled - if(disabled) - if(emp_disabled && (!emp_disable_message)) - usermessage("Electromagnetic deflectors overloaded. Short circuit detected in internal systems!", "boldwarning") - usermessage("Deactivating to prevent fatal power overload!", "boldwarning") - emp_disable_message = TRUE - if(flight) - disable_flight(TRUE) - -/obj/item/flightpack/update_icon() - if(!flight) - icon_state = "[FLIGHTPACK_SPRITE_BASE][FLIGHTPACK_SPRITE_OFF_APPEND]" - item_state = "[FLIGHTPACK_SPRITE_BASE][FLIGHTPACK_SPRITE_OFF_APPEND]" - if(flight) - if(!boost) - icon_state = "[FLIGHTPACK_SPRITE_BASE][FLIGHTPACK_SPRITE_ON_APPEND]" - item_state = "[FLIGHTPACK_SPRITE_BASE][FLIGHTPACK_SPRITE_ON_APPEND]" - else - icon_state = "[FLIGHTPACK_SPRITE_BASE][FLIGHTPACK_SPRITE_BOOST_APPEND]" - item_state = "[FLIGHTPACK_SPRITE_BASE][FLIGHTPACK_SPRITE_BOOST_APPEND]" - if(wearer) - wearer.update_inv_wear_suit() - wearer.update_inv_back() - -/obj/item/flightpack/proc/handle_boost() - if(boost) - boost_charge = CLAMP(boost_charge-boost_drain, 0, boost_maxcharge) - if(boost_charge < 1) - deactivate_booster() - if(boost_charge < boost_maxcharge) - boost_charge = CLAMP(boost_charge+boost_chargerate, 0, boost_maxcharge) - -/obj/item/flightpack/proc/cycle_power() - powersetting < powersetting_high? (powersetting++) : (powersetting = 1) - momentum_gain = powersetting * 10 - usermessage("Engine output set to [momentum_gain].") - momentum_drift_coeff = ((momentum_gain)*(drift_tolerance*1.1))/momentum_max - -/obj/item/flightpack/proc/crash_damage(density, anchored, speed, victim_name) - var/crashmessagesrc = "[wearer] violently crashes into [victim_name], " - var/userdamage = 10 - stabilizer * 3 - part_bin.rating - part_scan.rating * part_manip.rating + anchored * 2 + boost * 2 + speed * 2 - if(userdamage > 0) - crashmessagesrc += "that really must have hurt!" - wearer.adjustBruteLoss(userdamage) - else - crashmessagesrc += "but luckily [wearer]'s impact was absorbed by [wearer.p_their()] suit's stabilizers!" - wearer.visible_message(crashmessagesrc) - -/obj/item/flightpack/proc/userknockback(density, anchored, speed, dir) - dir = turn(dir, 180) - var/turf/target = get_edge_target_turf(get_turf(wearer), dir) - wearer.visible_message("[wearer] is knocked flying by the impact!") - wearer.throw_at(target, speed * 2 + density * 2 + anchored * 2, 2, wearer) - -/obj/item/flightpack/proc/flight_impact(atom/impacted_atom, crashdir) //Yes, victim. - if(!flight || (impacted_atom == wearer) || crashing || (processing_mode == FLIGHTSUIT_PROCESSING_NONE)) - return FALSE - crashing = TRUE - var/crashpower = 0 - if(crashdir == NORTH || crashdir == SOUTH) - crashpower = momentum_speed_y - else if(crashdir == EAST || crashdir == WEST) - crashpower = momentum_speed_x - if(boost) - crashpower = 3 - if(!crashpower) - crashing = FALSE - return FALSE - var/density = FALSE - var/anchored = TRUE //Just in case... - var/damage = FALSE - if(istype(impacted_atom, /obj/structure/grille) && (crashpower > 1)) - crash_grille(impacted_atom) - else if((istype(impacted_atom, /obj/machinery/door)) && (!istype(impacted_atom, /obj/machinery/door/poddoor))) - var/obj/machinery/door/D = impacted_atom - if(!airlock_pass(D) && (momentum_speed >= 3)) - damage = TRUE - anchored = TRUE - density = FALSE - else if(istype(impacted_atom, /obj/structure/mineral_door)) - door_pass(impacted_atom) - else if(isclosedturf(impacted_atom) && (crashpower >= 3)) - damage = TRUE - density = TRUE - anchored = TRUE - else if(ismovableatom(impacted_atom)) - var/atom/movable/impacted_AM = impacted_atom - if(!impacted_AM.throwing && (crashpower >= 3)) - density = impacted_AM.density - anchored = impacted_AM.anchored - damage = anchored - atom_impact(impacted_AM, crashpower, crashdir) - if(damage) - crash_damage(density, anchored, momentum_speed, impacted_atom.name) - userknockback(density, anchored, momentum_speed, crashdir) - losecontrol(knockdown = FALSE, move = FALSE) - crashing = FALSE - -/obj/item/flightpack/proc/door_pass(obj/structure/mineral_door/door) - INVOKE_ASYNC(door, /obj/structure/mineral_door.proc/Open) - var/turf/T = get_turf(door) - wearer.forceMove(T) - wearer.visible_message("[wearer] rolls to [wearer.p_their()] sides and slips past [door]!") - -/obj/item/flightpack/proc/crash_grille(obj/structure/grille/target) - target.hitby(wearer) - target.take_damage(60, BRUTE, "melee", 1) - if(wearer.Move(target.loc)) - wearer.visible_message("[wearer] smashes straight past [target]!") - -/obj/item/flightpack/proc/airlock_pass(obj/machinery/door/A) - var/nopass = FALSE - if(!A.density) - return TRUE - nopass = (A.locked || A.stat || (A.obj_flags & EMAGGED) || A.welded) - if(A.requiresID()) - if((!A.allowed(wearer)) && !A.emergency) - nopass = TRUE - if(!nopass) - INVOKE_ASYNC(A, /obj/machinery/door.proc/open) - wearer.visible_message("[wearer] rolls sideways and slips past [A]") - var/turf/target = get_turf(A) - if(istype(A, /obj/machinery/door/window) && (get_turf(wearer) == get_turf(A))) - target = get_step(A, A.dir) - wearer.forceMove(target) - return !nopass - -/obj/item/flightpack/proc/atom_impact(atom/movable/victim, power, direction) - if(!victim) - return FALSE - if(!victim.anchored) - var/knockback = (power + ((part_manip.rating + part_bin.rating) / 2) - (victim.density * 2)) * 2 - victim.visible_message("[victim.name] is sent flying by the impact!") - var/turf/target = get_turf(victim) - for(var/i in 1 to knockback) - target = get_step(target, direction) - for(var/i in 1 to knockback/3) - target = get_step(target, pick(GLOB.alldirs)) - victim.throw_at(target, knockback, part_manip.rating) - if(isobj(victim)) - var/obj/O = victim - O.take_damage(power * 14) - -/obj/item/flightpack/proc/losecontrol(knockdown = FALSE, move = TRUE) - usermessage("Warning: Control system not responding. Deactivating!", "boldwarning") - if(wearer) - wearer.visible_message("[wearer]'s flight suit abruptly shuts off and [wearer.p_they()] lose[wearer.p_s()] control!") - if(move) - while(momentum_x != 0 || momentum_y != 0) - sleep(2) - step(wearer, pick(GLOB.cardinals)) - momentum_decay() - adjust_momentum(0, 0, 10) - wearer.visible_message("[wearer]'s flight suit crashes into the ground!") - if(knockdown) - wearer.Knockdown(80) - momentum_x = 0 - momentum_y = 0 - calculate_momentum_speed() - if(flight) - disable_flight(FALSE) - -/obj/item/flightpack/proc/enable_flight(forced = FALSE) - if(!forced) - if(disabled) - usermessage("Internal systems recalibrating. Unable to safely proceed.", "boldwarning") - return FALSE - if(suit) - if(suit.shoes) - suit.shoes.toggle(TRUE) - else if(!requires_suit) - usermessage("Warning: Flightpack not linked to compatible flight-suit mount!", "boldwarning") - return FALSE - wearer.movement_type |= FLYING - wearer.pass_flags |= flight_passflags - usermessage("ENGAGING FLIGHT ENGINES.") - wearer.visible_message("[wearer]'s flight engines activate as [wearer.p_they()] lift[wearer.p_s()] into the air!") - flight = TRUE - update_slowdown() - update_icon() - ion_trail.start() - -/obj/item/flightpack/proc/disable_flight(forced = FALSE) - if(forced) - losecontrol(knockdown = TRUE) - return TRUE - calculate_momentum_speed() - if(momentum_speed == 0) - momentum_x = 0 - momentum_y = 0 - calculate_momentum_speed() - usermessage("DISENGAGING FLIGHT ENGINES.") - wearer.visible_message("[wearer] drops to the ground as [wearer.p_their()] flight engines cut out!") - wearer.movement_type &= ~FLYING - wearer.pass_flags &= ~flight_passflags - flight = FALSE - update_slowdown() - update_icon() - ion_trail.stop() - if(suit && suit.shoes) - suit.shoes.toggle(FALSE) - if(isturf(wearer.loc)) - var/turf/T = wearer.loc - T.Entered(src) - else - if(override_safe) - disable_flight(TRUE) - return TRUE - usermessage("Warning: Velocity too high to safely disengage. Retry to confirm emergency shutoff.", "boldwarning") - override_safe = TRUE - addtimer(CALLBACK(src, .proc/enable_safe), 50) - return FALSE - -/obj/item/flightpack/proc/enable_safe() - if(override_safe) - override_safe = FALSE - -/obj/item/flightpack/dropped(mob/wearer) - changeWearer() - ..() - -/obj/item/flightpack/item_action_slot_check(slot) - if(slot == ITEM_SLOT_BACK) - return TRUE - -/obj/item/flightpack/equipped(mob/user, slot) - changeWearer(user) - ..() - -/obj/item/flightpack/proc/calculate_momentum_speed() - if(abs(momentum_x) >= (momentum_crash_coeff*momentum_max)) //Calculate X - momentum_speed_x = 3 - else if(abs(momentum_x) >= (momentum_impact_coeff*momentum_max)) - momentum_speed_x = 2 - else if(abs(momentum_x) >= (momentum_drift_coeff*momentum_max)) - momentum_speed_x = 1 - else - momentum_speed_x = 0 - if(abs(momentum_y) >= (momentum_crash_coeff*momentum_max)) //Calculate Y - momentum_speed_y = 3 - else if(abs(momentum_y) >= (momentum_impact_coeff*momentum_max)) - momentum_speed_y = 2 - else if(abs(momentum_y) >= (momentum_drift_coeff*momentum_max)) - momentum_speed_y = 1 - else - momentum_speed_y = 0 - momentum_speed = max(momentum_speed_x, momentum_speed_y) - -/obj/item/flightpack/item_action_slot_check(slot) - return slot == SLOT_BACK - -/obj/item/flightpack/proc/enable_stabilizers() - if(requires_suit && suit && !suit.deployedshoes) - usermessage("Stabilizers requires flight shoes to be attached and deployed!", "boldwarning") - return FALSE - usermessage("Activating automatic stabilization controller and enabling maneuvering assistance.") - stabilizer = TRUE - return TRUE - -/obj/item/flightpack/proc/disable_stabilizers() - if(wearer) - if(brake) - disable_airbrake() - usermessage("Deactivating stabilization controllers!", "boldwarning") - stabilizer = FALSE - -/obj/item/flightpack/proc/activate_booster() - if(!flight) - usermessage("Error: Engines offline!", "boldwarning") - return FALSE - if(boost_charge < 5) - usermessage("Insufficient charge in boost capacitors to engage.", "boldwarning") - return FALSE - usermessage("Boosters engaged!") - boost = TRUE - update_slowdown() - update_icon() - -/obj/item/flightpack/proc/deactivate_booster() - usermessage("Boosters disengaged!") - boost = FALSE - update_slowdown() - update_icon() - -/obj/item/flightpack/proc/enable_airbrake() - if(wearer) - if(!stabilizer && !enable_stabilizers()) - usermessage("Airbrake deployment: Stabilizer Errored.", "boldwarning") - return FALSE - usermessage("Airbrakes extended!") - brake = TRUE - update_slowdown() - -/obj/item/flightpack/proc/disable_airbrake() - if(wearer) - usermessage("Airbrakes retracted!", "boldwarning") - brake = FALSE - update_slowdown() - -/obj/item/flightpack/proc/relink_suit(obj/item/clothing/suit/space/hardsuit/flightsuit/F) - if(suit && suit == F) - return FALSE - else - delink_suit() - if(istype(F)) - suit = F - suit.pack = src - else - suit = null - -/obj/item/flightpack/proc/delink_suit() - if(suit) - if(suit.pack && suit.pack == src) - suit.pack = null - suit = null - -/obj/item/flightpack/attackby(obj/item/I, mob/user, params) - var/const/SuccessMessage = " has been successfully installed into systems." - var/changed = FALSE - if(istype(I, /obj/item/stock_parts)) - var/obj/item/stock_parts/S = I - if(istype(S, /obj/item/stock_parts/manipulator)) - usermessage("[I][SuccessMessage]", mob_override = user) - if(user.transferItemToLoc(I, src)) - if(part_manip) - part_manip.forceMove(get_turf(src)) - part_manip = I - changed = TRUE - if(istype(S, /obj/item/stock_parts/scanning_module)) - usermessage("[I][SuccessMessage]", mob_override = user) - if(user.transferItemToLoc(I, src)) - if(part_scan) - part_scan.forceMove(get_turf(src)) - part_scan = I - changed = TRUE - if(istype(S, /obj/item/stock_parts/micro_laser)) - usermessage("[I][SuccessMessage]", mob_override = user) - if(user.transferItemToLoc(I, src)) - if(part_laser) - part_laser.forceMove(get_turf(src)) - part_laser = I - changed = TRUE - if(istype(S, /obj/item/stock_parts/matter_bin)) - usermessage("[I][SuccessMessage]", mob_override = user) - if(user.transferItemToLoc(I, src)) - if(part_bin) - part_bin.forceMove(get_turf(src)) - part_bin = I - changed = TRUE - if(istype(S, /obj/item/stock_parts/capacitor)) - usermessage("[I][SuccessMessage]", mob_override = user) - if(user.transferItemToLoc(I, src)) - if(part_cap) - part_cap.forceMove(get_turf(src)) - part_cap = I - changed = TRUE - if(changed) - update_parts() - ..() - -//MOB MOVEMENT STUFF---------------------------------------------------------------------------------------------------------------------------------------------- - -/mob/proc/get_flightpack() - return - -/mob/living/carbon/get_flightpack() - var/obj/item/flightpack/F = back - if(istype(F)) - return F - else - return FALSE - -/obj/item/flightpack/proc/allow_thrust(amount) - if(flight) - return TRUE - -//FLIGHT SHOES----------------------------------------------------------------------------------------------------------------------------------------------------- - -/obj/item/clothing/shoes/flightshoes - name = "flight shoes" - desc = "A pair of specialized boots that contain stabilizers and sensors necessary for flight gear to work." //Apparently you need these to detect mob movement. - icon_state = "flightshoes" - item_state = "flightshoes_mob" - var/obj/item/clothing/suit/space/hardsuit/flightsuit/suit = null - var/obj/item/flightpack/pack = null - var/mob/living/carbon/human/wearer = null - var/active = FALSE - permeability_coefficient = 0.01 - resistance_flags = FIRE_PROOF | ACID_PROOF - -/obj/item/clothing/shoes/flightshoes/Destroy() - pack = null - wearer = null - suit = null - . = ..() - -/obj/item/clothing/shoes/flightshoes/proc/toggle(toggle) - if(suit) - active = toggle - if(active) - clothing_flags |= NOSLIP - if(!active) - clothing_flags &= ~NOSLIP - -/obj/item/clothing/shoes/flightshoes/item_action_slot_check(slot) - return slot == SLOT_SHOES - -/obj/item/clothing/shoes/flightshoes/proc/delink_suit() - if(suit) - if(suit.shoes && suit.shoes == src) - suit.shoes = null - suit = null - -/obj/item/clothing/shoes/flightshoes/proc/relink_suit(obj/item/clothing/suit/space/hardsuit/flightsuit/F) - if(suit && suit == F) - return FALSE - else - delink_suit() - if(istype(F)) - suit = F - suit.shoes = src - else - suit = null - -//FLIGHT SUIT------------------------------------------------------------------------------------------------------------------------------------------------------ -//Flight pack and flight shoes/helmet are stored in here. This has to be locked to someone to use either. For both balance reasons and practical codewise reasons. - -/obj/item/clothing/suit/space/hardsuit/flightsuit - name = "flight suit" - desc = "An advanced suit that allows the wearer flight via two high powered miniature jet engines on a deployable back-mounted unit." - icon_state = "flightsuit" - item_state = "flightsuit" - strip_delay = 30 - w_class = WEIGHT_CLASS_BULKY - resistance_flags = FIRE_PROOF | ACID_PROOF - helmettype = /obj/item/clothing/head/helmet/space/hardsuit/flightsuit - jetpack = null - actions_types = list(/datum/action/item_action/flightsuit/toggle_helmet, /datum/action/item_action/flightsuit/toggle_boots, /datum/action/item_action/flightsuit/toggle_flightpack, /datum/action/item_action/flightsuit/lock_suit) - armor = list("melee" = 20, "bullet" = 20, "laser" = 20, "energy" = 10, "bomb" = 30, "bio" = 100, "rad" = 75, "fire" = 100, "acid" = 100) - max_heat_protection_temperature = FIRE_SUIT_MAX_TEMP_PROTECT - var/locked_strip_delay = 80 - var/obj/item/flightpack/pack = null - var/obj/item/clothing/shoes/flightshoes/shoes = null - var/mob/living/carbon/human/user = null - var/deployedpack = FALSE - var/deployedshoes = FALSE - var/locked = FALSE - var/flightpack - var/flight = FALSE - var/maint_panel = FALSE - -/obj/item/clothing/suit/space/hardsuit/flightsuit/Initialize() - . = ..() - allowed = GLOB.advanced_hardsuit_allowed - -/obj/item/clothing/suit/space/hardsuit/flightsuit/full/Initialize() - makepack() - makeshoes() - resync() - return ..() - -/obj/item/clothing/suit/space/hardsuit/flightsuit/ui_action_click() - return //Handled in action datums. - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/usermessage(message, span = "boldnotice") - var/mob/targ = user - if(ismob(loc)) - targ = loc - if(!istype(targ)) - return - to_chat(targ, "[icon2html(src, targ)]|[message]") - -/obj/item/clothing/suit/space/hardsuit/flightsuit/examine(mob/user) - ..() - to_chat(user, "SUIT: [locked ? "LOCKED" : "UNLOCKED"]") - to_chat(user, "FLIGHTPACK: [deployedpack ? "ENGAGED" : "DISENGAGED"] FLIGHTSHOES : [deployedshoes ? "ENGAGED" : "DISENGAGED"] HELMET : [suittoggled ? "ENGAGED" : "DISENGAGED"]") - to_chat(user, "Its maintainence panel is [maint_panel ? "OPEN" : "CLOSED"]") - -/obj/item/clothing/suit/space/hardsuit/flightsuit/Destroy() - dropped() - QDEL_NULL(pack) - QDEL_NULL(shoes) - return ..() - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/resync() - if(pack) - pack.relink_suit(src) - if(user) - if(pack) - pack.changeWearer(user) - if(shoes) - shoes.wearer = user - else - if(pack) - pack.changeWearer(null) - if(shoes) - shoes.wearer = null - if(shoes) - shoes.relink_suit(src) - -/obj/item/clothing/suit/space/hardsuit/flightsuit/allow_attack_hand_drop(user) - if(ishuman(user)) - var/mob/living/carbon/human/H = user - if(src == H.wear_suit && locked) - usermessage("You can not take a locked hardsuit off! Unlock it first!", "boldwarning") - return FALSE - return ..() - -/obj/item/clothing/suit/space/hardsuit/flightsuit/dropped() - if(deployedpack) - retract_flightpack(TRUE) - if(deployedshoes) - retract_flightshoes(TRUE) - if(locked) - unlock_suit(null) - if(user) - user = null - ..() - -/obj/item/clothing/suit/space/hardsuit/flightsuit/ToggleHelmet() - if(!suittoggled) - if(!locked) - usermessage("You must lock your suit before engaging the helmet!", "boldwarning") - return FALSE - ..() - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/lock_suit(mob/wearer) - user = wearer - user.visible_message("[wearer]'s flight suit locks around [wearer.p_them()], powered buckles and straps automatically adjusting to [wearer.p_their()] body!") - playsound(src.loc, 'sound/items/rped.ogg', 65, 1) - resync() - strip_delay = locked_strip_delay - locked = TRUE - return TRUE - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/unlock_suit(mob/wearer) - if(user) - if(suittoggled) - usermessage("You must retract the helmet before unlocking your suit!", "boldwarning") - return FALSE - if(pack && pack.flight) - usermessage("You must shut off the flight-pack before unlocking your suit!", "boldwarning") - return FALSE - if(deployedpack) - usermessage("Your flightpack must be fully retracted first!", "boldwarning") - return FALSE - if(deployedshoes) - usermessage("Your flight shoes must be fully retracted first!", "boldwarning") - return FALSE - if(wearer) - user.visible_message("[wearer]'s flight suit detaches from [wearer.p_their()] body, becoming nothing more then a bulky metal skeleton.") - playsound(src, 'sound/items/rped.ogg', 65, 1) - resync() - strip_delay = initial(strip_delay) - locked = FALSE - return TRUE - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/extend_flightpack(forced = FALSE) - if(!pack) - usermessage("There is no attached flightpack!", "boldwarning") - return FALSE - if(deployedpack) - retract_flightpack() - if(!locked) - usermessage("You must lock your flight suit first before deploying anything!", "boldwarning") - return FALSE - if(ishuman(user)) - if(user.back) - usermessage("You're already wearing something on your back!", "boldwarning") - return FALSE - user.equip_to_slot_if_possible(pack,SLOT_BACK,0,0,1) - pack.item_flags |= NODROP - resync() - user.visible_message("A [pack.name] extends from [user]'s [name] and clamps to [user.p_their()] back!") - user.update_inv_wear_suit() - playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1) - deployedpack = TRUE - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/retract_flightpack(forced = FALSE) - if(ishuman(user)) - if(pack.flight && !forced) - usermessage("You must disable the engines before retracting the flightpack!", "boldwarning") - return FALSE - if(pack.flight && forced) - pack.disable_flight(1) - pack.item_flags &= ~NODROP - resync() - if(user) - user.transferItemToLoc(pack, src, TRUE) - user.update_inv_wear_suit() - user.visible_message("[user]'s [pack.name] detaches from [user.p_their()] back and retracts into [user.p_their()] [src]!") - pack.forceMove(src) - playsound(src, 'sound/mecha/mechmove03.ogg', 50, 1) - deployedpack = FALSE - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/extend_flightshoes(forced = FALSE) - if(!shoes) - usermessage("Flight shoes are not installed", "boldwarning") - return FALSE - if(deployedshoes) - retract_flightshoes() - if(!locked) - usermessage("You must lock your flight suit first before deploying anything!", "boldwarning") - return FALSE - if(ishuman(user)) - if(user.shoes) - usermessage("You're already wearing something on your feet!", "boldwarning") - return FALSE - user.equip_to_slot_if_possible(shoes,SLOT_SHOES,0,0,1) - shoes.item_flags |= NODROP - user.visible_message("[user]'s [name] extends a pair of [shoes.name] over [user.p_their()] feet!") - user.update_inv_wear_suit() - playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1) - deployedshoes = TRUE - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/retract_flightshoes(forced = FALSE) - shoes.item_flags &= ~NODROP - playsound(src, 'sound/mecha/mechmove03.ogg', 50, 1) - if(user) - user.transferItemToLoc(shoes, src, TRUE) - user.update_inv_wear_suit() - user.visible_message("[user]'s [shoes.name] retracts back into [user.p_their()] [name]!") - shoes.forceMove(src) - deployedshoes = FALSE - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/makepack() - if(!pack) - pack = new /obj/item/flightpack/full(src) - pack.relink_suit(src) - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/makeshoes() - if(!shoes) - shoes = new /obj/item/clothing/shoes/flightshoes(src) - shoes.pack = pack - shoes.suit = src - -/obj/item/clothing/suit/space/hardsuit/flightsuit/equipped(mob/M, slot) - if(ishuman(M)) - user = M - if(slot != SLOT_WEAR_SUIT) - if(deployedpack) - retract_flightpack(TRUE) - if(deployedshoes) - retract_flightshoes(TRUE) - if(locked) - unlock_suit(user) - ..() - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/detach_pack() - pack.delink_suit() - pack.forceMove(get_turf(src)) - pack = null - usermessage("You detach the flightpack.") - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/attach_pack(obj/item/flightpack/F) - F.forceMove(src) - pack = F - pack.relink_suit(src) - usermessage("You attach and fasten the flightpack.") - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/detach_shoes() - shoes.delink_suit() - shoes.forceMove(get_turf(src)) - shoes = null - usermessage("You detach the flight shoes.") - -/obj/item/clothing/suit/space/hardsuit/flightsuit/proc/attach_shoes(obj/item/clothing/shoes/flightshoes/S) - S.forceMove(src) - shoes = S - shoes.relink_suit(src) - usermessage("You attach and fasten a pair of flight shoes.") - -/obj/item/clothing/suit/space/hardsuit/flightsuit/attackby(obj/item/I, mob/wearer, params) - user = wearer - if(src == user.get_item_by_slot(SLOT_WEAR_SUIT)) - usermessage("You can not perform any service without taking the suit off!", "boldwarning") - return FALSE - else if(locked) - usermessage("You can not perform any service while the suit is locked!", "boldwarning") - return FALSE - else if(istype(I, /obj/item/screwdriver)) - if(!maint_panel) - maint_panel = TRUE - else - maint_panel = FALSE - usermessage("You [maint_panel? "open" : "close"] the maintenance panel.") - return FALSE - else if(!maint_panel) - usermessage("The maintenance panel is closed!", "boldwarning") - return FALSE - else if(istype(I, /obj/item/crowbar)) - var/list/inputlist = list() - if(pack) - inputlist += "Pack" - if(shoes) - inputlist += "Shoes" - if(!inputlist.len) - usermessage("There is nothing inside the flightsuit to remove!", "boldwarning") - return FALSE - var/input = input(user, "What to remove?", "Removing module") as null|anything in list("Pack", "Shoes") - if(pack && input == "Pack") - if(pack.flight) - usermessage("You can not pry off an active flightpack!", "boldwarning") - return FALSE - if(deployedpack) - usermessage("Disengage the flightpack first!", "boldwarning") - return FALSE - detach_pack() - if(shoes && input == "Shoes") - if(deployedshoes) - usermessage("Disengage the shoes first!", "boldwarning") - return FALSE - detach_shoes() - return TRUE - else if(istype(I, /obj/item/flightpack)) - var/obj/item/flightpack/F = I - if(pack) - usermessage("[src] already has a flightpack installed!", "boldwarning") - return FALSE - if(!F.assembled) - var/addmsg = " It is missing a " - var/list/addmsglist = list() - if(!F.part_manip) - addmsglist += "manipulator" - if(!F.part_cap) - addmsglist += "capacitor" - if(!F.part_scan) - addmsglist += "scanning module" - if(!F.part_laser) - addmsglist += "micro-laser" - if(!F.part_bin) - addmsglist += "matter bin" - addmsg += english_list(addmsglist) - usermessage("The flightpack you are trying to install is not fully assembled and operational![addmsg].", "boldwarning") - return FALSE - if(user.temporarilyRemoveItemFromInventory(F)) - attach_pack(F) - return TRUE - else if(istype(I, /obj/item/clothing/shoes/flightshoes)) - var/obj/item/clothing/shoes/flightshoes/S = I - if(shoes) - usermessage("There are already shoes installed!", "boldwarning") - return FALSE - if(user.temporarilyRemoveItemFromInventory(S)) - attach_shoes(S) - return TRUE - . = ..() - -//FLIGHT HELMET---------------------------------------------------------------------------------------------------------------------------------------------------- -/obj/item/clothing/head/helmet/space/hardsuit/flightsuit - name = "flight helmet" - desc = "A sealed helmet attached to a flight suit for EVA usage scenarios. Its visor contains an information uplink HUD." - icon_state = "flighthelmet" - item_state = "flighthelmet" - item_color = "flight" - resistance_flags = FIRE_PROOF | ACID_PROOF - brightness_on = 7 - light_color = "#30ffff" - armor = list("melee" = 20, "bullet" = 20, "laser" = 20, "energy" = 10, "bomb" = 30, "bio" = 100, "rad" = 75, "fire" = 100, "acid" = 100) - max_heat_protection_temperature = FIRE_HELM_MAX_TEMP_PROTECT - var/list/datahuds = list(DATA_HUD_SECURITY_ADVANCED, DATA_HUD_MEDICAL_ADVANCED, DATA_HUD_DIAGNOSTIC_BASIC) - var/zoom_range = 12 - var/zoom = FALSE - actions_types = list(/datum/action/item_action/toggle_helmet_light, /datum/action/item_action/flightpack/zoom) - -/obj/item/clothing/head/helmet/space/hardsuit/flightsuit/equipped(mob/living/carbon/human/wearer, slot) - ..() - for(var/hudtype in datahuds) - var/datum/atom_hud/H = GLOB.huds[hudtype] - H.add_hud_to(wearer) - -/obj/item/clothing/head/helmet/space/hardsuit/flightsuit/dropped(mob/living/carbon/human/wearer) - ..() - if(wearer) - for(var/hudtype in datahuds) - var/datum/atom_hud/H = GLOB.huds[hudtype] - H.remove_hud_from(wearer) - if(zoom) - toggle_zoom(wearer, TRUE) - -/obj/item/clothing/head/helmet/space/hardsuit/flightsuit/proc/toggle_zoom(mob/living/user, force_off = FALSE) - if(zoom || force_off) - user.client.change_view(CONFIG_GET(string/default_view)) - to_chat(user, "Disabling smart zooming image enhancement...") - zoom = FALSE - return FALSE - else - user.client.change_view(zoom_range) - to_chat(user, "Enabling smart zooming image enhancement!") - zoom = TRUE - return TRUE diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm index 73344642357..e5444d32977 100644 --- a/code/modules/mob/living/carbon/carbon_movement.dm +++ b/code/modules/mob/living/carbon/carbon_movement.dm @@ -1,13 +1,6 @@ /mob/living/carbon/movement_delay() - var/FP = FALSE - var/obj/item/flightpack/F = get_flightpack() - if(istype(F) && F.flight) - FP = TRUE - . = ..(FP) - if(!FP) - . += grab_state * 1 //Flightpacks are too powerful to be slowed too much by the weight of a corpse. - else - . += grab_state * 3 //can't go fast while grabbing something. + . = ..() + . += grab_state * 3 //can't go fast while grabbing something. if(!get_leg_ignore()) //ignore the fact we lack legs var/leg_amount = get_num_legs() @@ -33,10 +26,6 @@ if(!isturf(loc)) return 0 - var/obj/item/flightpack/F = get_flightpack() - if(istype(F) && (F.flight) && F.allow_thrust(0.01, src)) - return 1 - // Do we have a jetpack implant (and is it on)? var/obj/item/organ/cyberimp/chest/thrusters/T = getorganslot(ORGAN_SLOT_THRUSTERS) if(istype(T) && movement_dir && T.allow_thrust(0.01)) diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm index 3f65c0c5268..b1293a2dba2 100644 --- a/code/modules/mob/living/carbon/human/human.dm +++ b/code/modules/mob/living/carbon/human/human.dm @@ -834,13 +834,6 @@ return 1 ..() -/mob/living/carbon/human/Bump(atom/A) - ..() - var/crashdir = get_dir(src, A) - var/obj/item/flightpack/FP = get_flightpack() - if(FP) - FP.flight_impact(A, crashdir) - /mob/living/carbon/human/vv_get_dropdown() . = ..() . += "---" diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm index 882abfa246d..54dd378037b 100644 --- a/code/modules/mob/living/carbon/human/species.dm +++ b/code/modules/mob/living/carbon/human/species.dm @@ -1065,18 +1065,14 @@ GLOBAL_LIST_EMPTY(roundstart_races) /datum/species/proc/movement_delay(mob/living/carbon/human/H) . = 0 //We start at 0. var/flight = 0 //Check for flight and flying items - var/flightpack = 0 var/ignoreslow = 0 var/gravity = 0 - var/obj/item/flightpack/F = H.get_flightpack() - if(istype(F) && F.flight) - flightpack = 1 if(H.movement_type & FLYING) flight = 1 gravity = H.has_gravity() - if(!flightpack && gravity) //Check for chemicals and innate speedups and slowdowns if we're moving using our body and not a flying suit + if(gravity && !flight) //Check for chemicals and innate speedups and slowdowns if we're on the ground if(H.has_trait(TRAIT_GOTTAGOFAST)) . -= 1 if(H.has_trait(TRAIT_GOTTAGOREALLYFAST)) @@ -1098,12 +1094,7 @@ GLOBAL_LIST_EMPTY(roundstart_races) else if(istype(T) && T.allow_thrust(0.01, H)) . -= 2 - if(flightpack && F.boost) - . -= F.boost_speed - else if(flightpack && F.brake) - . += 1 - - if(!ignoreslow && !flightpack && gravity) + if(!ignoreslow && gravity) if(H.wear_suit) . += H.wear_suit.slowdown if(H.shoes) diff --git a/code/modules/research/designs/equipment_designs.dm b/code/modules/research/designs/equipment_designs.dm deleted file mode 100644 index 4016e9d93fb..00000000000 --- a/code/modules/research/designs/equipment_designs.dm +++ /dev/null @@ -1,32 +0,0 @@ -/datum/design/flightsuit - name = "Flight Suit" - desc = "A specialized hardsuit that is able to attach a flightpack and accessories.." - id = "flightsuit" - build_type = PROTOLATHE - build_path = /obj/item/clothing/suit/space/hardsuit/flightsuit - materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_DIAMOND = 200, MAT_GOLD = 3000, MAT_SILVER = 3000, MAT_TITANIUM = 16000) //This expensive enough for you? - construction_time = 250 - category = list("Misc") - departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING - -/datum/design/flightpack - name = "Flight Pack" - desc = "An advanced back-worn system that has dual ion engines powerful enough to grant a humanoid flight. Contains an internal self-recharging high-current capacitor for short, powerful boosts." - id = "flightpack" - build_type = PROTOLATHE - build_path = /obj/item/flightpack - materials = list(MAT_METAL=16000, MAT_GLASS = 8000, MAT_DIAMOND = 4000, MAT_GOLD = 12000, MAT_SILVER = 12000, MAT_URANIUM = 20000, MAT_PLASMA = 16000, MAT_TITANIUM = 16000) //This expensive enough for you? - construction_time = 250 - category = list("Misc") - departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING - -/datum/design/flightshoes - name = "Flight Shoes" - desc = "Flight shoes, attachable to a flight suit to provide additional functions." - id = "flightshoes" - build_type = PROTOLATHE - build_path = /obj/item/clothing/shoes/flightshoes - materials = list(MAT_METAL = 5000, MAT_GLASS = 5000, MAT_GOLD = 1500, MAT_SILVER = 1500, MAT_PLASMA = 2000, MAT_TITANIUM = 2000) - construction_time = 100 - category = list("Misc") - departmental_flags = DEPARTMENTAL_FLAG_ENGINEERING diff --git a/code/modules/research/techweb/all_nodes.dm b/code/modules/research/techweb/all_nodes.dm index cfa7e349613..88bca62b2a1 100644 --- a/code/modules/research/techweb/all_nodes.dm +++ b/code/modules/research/techweb/all_nodes.dm @@ -501,15 +501,6 @@ research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 2500) export_price = 5000 -/datum/techweb_node/exp_flight - id = "exp_flight" - display_name = "Experimental Flight Equipment" - description = "Highly advanced construction tools." - design_ids = list("flightshoes", "flightpack", "flightsuit") - prereq_ids = list("adv_engi","integrated_HUDs", "adv_power" , "high_efficiency") - research_costs = list(TECHWEB_POINT_TYPE_GENERIC = 5000) - export_price = 5000 - /////////////////////////weaponry tech///////////////////////// /datum/techweb_node/weaponry id = "weaponry" diff --git a/tgstation.dme b/tgstation.dme index 3fb9016d265..19a805fe38e 100755 --- a/tgstation.dme +++ b/tgstation.dme @@ -20,12 +20,12 @@ #include "code\__DEFINES\_protect.dm" #include "code\__DEFINES\_tick.dm" #include "code\__DEFINES\access.dm" -#include "code\__DEFINES\bsql.config.dm" -#include "code\__DEFINES\bsql.dm" #include "code\__DEFINES\admin.dm" #include "code\__DEFINES\antagonists.dm" #include "code\__DEFINES\atmospherics.dm" #include "code\__DEFINES\atom_hud.dm" +#include "code\__DEFINES\bsql.config.dm" +#include "code\__DEFINES\bsql.dm" #include "code\__DEFINES\callbacks.dm" #include "code\__DEFINES\cinematics.dm" #include "code\__DEFINES\cleaning.dm" @@ -255,7 +255,6 @@ #include "code\controllers\subsystem\processing\circuit.dm" #include "code\controllers\subsystem\processing\fastprocess.dm" #include "code\controllers\subsystem\processing\fields.dm" -#include "code\controllers\subsystem\processing\flightpacks.dm" #include "code\controllers\subsystem\processing\networks.dm" #include "code\controllers\subsystem\processing\obj.dm" #include "code\controllers\subsystem\processing\processing.dm" @@ -303,7 +302,6 @@ #include "code\datums\weakrefs.dm" #include "code\datums\world_topic.dm" #include "code\datums\actions\beam_rifle.dm" -#include "code\datums\actions\flightsuit.dm" #include "code\datums\actions\ninja.dm" #include "code\datums\brain_damage\brain_trauma.dm" #include "code\datums\brain_damage\imaginary_friend.dm" @@ -1430,7 +1428,6 @@ #include "code\modules\clothing\shoes\miscellaneous.dm" #include "code\modules\clothing\spacesuits\_spacesuits.dm" #include "code\modules\clothing\spacesuits\chronosuit.dm" -#include "code\modules\clothing\spacesuits\flightsuit.dm" #include "code\modules\clothing\spacesuits\hardsuit.dm" #include "code\modules\clothing\spacesuits\miscellaneous.dm" #include "code\modules\clothing\spacesuits\plasmamen.dm" @@ -2388,7 +2385,6 @@ #include "code\modules\research\designs\comp_board_designs.dm" #include "code\modules\research\designs\computer_part_designs.dm" #include "code\modules\research\designs\electronics_designs.dm" -#include "code\modules\research\designs\equipment_designs.dm" #include "code\modules\research\designs\limbgrower_designs.dm" #include "code\modules\research\designs\machine_designs.dm" #include "code\modules\research\designs\mecha_designs.dm"