Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Deletes station mechs and mech stuff. #865

Merged
merged 10 commits into from
Dec 26, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion _maps/map_files/deltastation/deltastation.dmm
Original file line number Diff line number Diff line change
Expand Up @@ -61185,7 +61185,7 @@
/turf/open/floor/iron/dark/smooth_large,
/area/deltastation/service/chapel/storage)
"myf" = (
/obj/vehicle/sealed/mecha/working/ripley/cargo,
/obj/vehicle/ridden/powerloader,
/turf/open/floor/mech_bay_recharge_floor,
/area/deltastation/cargo/storage)
"myj" = (
Expand Down
40 changes: 0 additions & 40 deletions code/__DEFINES/mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,22 +2,6 @@
#define MECHA_INT_SHORT_CIRCUIT (1<<1)
#define MECHA_INT_CONTROL_LOST (1<<2)

#define ADDING_ACCESS_POSSIBLE (1<<0)
#define ADDING_MAINT_ACCESS_POSSIBLE (1<<1)
#define CANSTRAFE (1<<2)
#define LIGHTS_ON (1<<3)
#define SILICON_PILOT (1<<4)
#define IS_ENCLOSED (1<<5)
#define HAS_LIGHTS (1<<6)
#define QUIET_STEPS (1<<7)
#define QUIET_TURNS (1<<8)
///blocks using equipment and melee attacking.
#define CANNOT_INTERACT (1<<9)
/// Can click from any direction and perform stuff
#define OMNIDIRECTIONAL_ATTACKS (1<<10)
///Do you need mech skill to pilot this mech
#define MECHA_SKILL_LOCKED (1<<11)

#define MECHA_MELEE (1 << 0)
#define MECHA_RANGED (1 << 1)

Expand Down Expand Up @@ -68,30 +52,6 @@
#define MECHA_AMMO_GRENADE "Frag grenade"
#define MECHA_AMMO_FLAMER "Napalm"

/// Module is compatible with Ripley Exosuit models
#define EXOSUIT_MODULE_RIPLEY (1<<0)
/// Module is compatible with Odyseeus Exosuit models
#define EXOSUIT_MODULE_ODYSSEUS (1<<1)
/// Module is compatible with Gygax Exosuit models
#define EXOSUIT_MODULE_GYGAX (1<<2)
/// Module is compatible with Durand Exosuit models
#define EXOSUIT_MODULE_DURAND (1<<3)
/// Module is compatible with H.O.N.K Exosuit models
#define EXOSUIT_MODULE_HONK (1<<4)
/// Module is compatible with Phazon Exosuit models
#define EXOSUIT_MODULE_PHAZON (1<<5)
/// Module is compatible with Savannah Exosuit models
#define EXOSUIT_MODULE_SAVANNAH (1<<6)
/// Module is compatible with Greyscale Exosuit models
#define EXOSUIT_MODULE_GREYSCALE (1<<7)

/// Module is compatible with "Working" Exosuit models - Ripley and Clarke
#define EXOSUIT_MODULE_WORKING EXOSUIT_MODULE_RIPLEY
/// Module is compatible with "Combat" Exosuit models - Gygax, H.O.N.K, Durand and Phazon
#define EXOSUIT_MODULE_COMBAT EXOSUIT_MODULE_GYGAX | EXOSUIT_MODULE_HONK | EXOSUIT_MODULE_DURAND | EXOSUIT_MODULE_PHAZON | EXOSUIT_MODULE_SAVANNAH
/// Module is compatible with "Medical" Exosuit modelsm - Odysseus
#define EXOSUIT_MODULE_MEDICAL EXOSUIT_MODULE_ODYSSEUS

///degree of cone in front of which mech is allowed to fire at
#define MECH_FIRE_CONE_ALLOWED 120

Expand Down
2 changes: 0 additions & 2 deletions code/modules/unit_tests/create_and_destroy.dm
Original file line number Diff line number Diff line change
Expand Up @@ -36,8 +36,6 @@ GLOBAL_VAR_INIT(running_create_and_destroy, FALSE)
ignore += typesof(/obj/effect/buildmode_line)
//Our system doesn't support it without warning spam from unregister calls on things that never registered
ignore += typesof(/obj/docking_port)
//Needs a linked mecha
ignore += typesof(/obj/effect/skyfall_landingzone)
//These shouldn't be spawned directly, rather they should be spawned through their weapon item counterparts
ignore += typesof(/obj/machinery/deployable/mounted)
//Various temporary effects that aren't meant to be spawned
Expand Down
104 changes: 11 additions & 93 deletions code/modules/vehicles/mecha/_mecha.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,6 @@
soft_armor = list(MELEE = 20, BULLET = 10, LASER = 0, ENERGY = 0, BOMB = 10, BIO = 0, FIRE = 100, ACID = 100)
force = 5
move_delay = 1 SECONDS
COOLDOWN_DECLARE(mecha_bump_smash)
light_system = MOVABLE_LIGHT
light_on = FALSE
light_range = 8
Expand All @@ -53,30 +52,19 @@
var/equipment_disabled = FALSE
/// Keeps track of the mech's cell
var/obj/item/cell/cell
/// Keeps track of the mech's scanning module
var/obj/item/stock_parts/scanning_module/scanmod
/// Keeps track of the mech's capacitor
var/obj/item/stock_parts/capacitor/capacitor
///Whether the mechs maintenance protocols are on or off
var/construction_state = MECHA_LOCKED
///Contains flags for the mecha
var/mecha_flags = ADDING_ACCESS_POSSIBLE | CANSTRAFE | IS_ENCLOSED | HAS_HEADLIGHTS
///Stores the DNA enzymes of a carbon so tht only they can access the mech
var/dna_lock
var/mecha_flags
///Spark effects are handled by this datum
var/datum/effect_system/spark_spread/spark_system = new
///How powerful our lights are
var/lights_power = 6
///Just stop the mech from doing anything
var/completely_disabled = FALSE
///Whether this mech is allowed to move diagonally
var/allow_diagonal_movement = FALSE
///Whether or not the mech destroys walls by running into it.
var/bumpsmash = FALSE

///Special version of the radio, which is unsellable
var/obj/item/radio/mech/radio
var/list/trackers = list()

///Bitflags for internal damage
var/internal_damage = NONE
Expand All @@ -94,10 +82,8 @@
///required access to change internal components
var/list/internals_req_access = list()

///Typepath for the wreckage it spawns when destroyed
var/wreckage
///single flag for the type of this mech, determines what kind of equipment can be attached to it
var/mech_type
//var/mech_type

///assoc list: key-typepathlist before init, key-equipmentlist after
var/list/equip_by_category = list(
Expand All @@ -116,8 +102,6 @@
///flat equipment for iteration
var/list/flat_equipment

///Whether our steps are silent due to no gravity
var/step_silent = FALSE
///Sound played when the mech moves
var/stepsound = 'sound/mecha/mechstep.ogg'
///Sound played when the mech walks
Expand All @@ -132,8 +116,6 @@
var/destruction_sleep_duration = 2 SECONDS
///Whether outside viewers can see the pilot inside
var/enclosed = TRUE
///In case theres a different iconstate for AI/MMI pilot(currently only used for ripley)
var/silicon_icon_state = null
///Currently ejecting, and unable to do things
var/is_currently_ejecting = FALSE
///Safety for weapons. Won't fire if enabled, and toggled by middle click.
Expand All @@ -142,8 +124,6 @@
var/datum/effect_system/smoke_spread/bad/smoke_system = new

////Action vars
///Bool for energy shield on/off
var/defense_mode = FALSE

///Bool for leg overload on/off
var/leg_overload_mode = FALSE
Expand All @@ -160,13 +140,6 @@
///Cooldown between using smoke
var/smoke_cooldown = 10 SECONDS

///check for phasing, if it is set to text (to describe how it is phasing: "flying", "phasing") it will let the mech walk through walls.
var/phasing = ""
///Power we use every time we phaze through something
var/phasing_energy_drain = 200
///icon_state for flick() when phazing
var/phase_state = ""

///Wether we are strafing
var/strafe = FALSE

Expand All @@ -179,6 +152,10 @@
var/ui_y = 600
/// ref to screen object that displays in the middle of the UI
var/atom/movable/screen/mech_view/ui_view
/// boolean: Can someone use the mech without skill? Used for shitspawn
var/skill_locked = TRUE
/// boolean: are light on?
var/lights_on = FALSE

/obj/item/radio/mech //this has to go somewhere
subspace_transmission = TRUE
Expand All @@ -199,8 +176,6 @@

GLOB.nightfall_toggleable_lights += src
add_cell()
add_scanmod()
add_capacitor()
START_PROCESSING(SSobj, src)
log_message("[src.name] created.", LOG_MECHA)
GLOB.mechas_list += src //global mech list
Expand Down Expand Up @@ -241,8 +216,6 @@
LAZYCLEARLIST(flat_equipment)

QDEL_NULL(cell)
QDEL_NULL(scanmod)
QDEL_NULL(capacitor)
QDEL_NULL(spark_system)
QDEL_NULL(smoke_system)
QDEL_NULL(ui_view)
Expand All @@ -255,33 +228,11 @@
/obj/vehicle/sealed/mecha/obj_destruction(damage_amount, damage_type, damage_flag)
spark_system?.start()

var/mob/living/silicon/ai/unlucky_ais
for(var/mob/living/occupant AS in occupants)
if(isAI(occupant))
unlucky_ais = occupant
occupant.gib() //No wreck, no AI to recover
continue
mob_exit(occupant, FALSE, TRUE)
occupant.SetSleeping(destruction_sleep_duration)

if(wreckage)
var/obj/structure/mecha_wreckage/WR = new wreckage(loc, unlucky_ais)
for(var/obj/item/mecha_parts/mecha_equipment/E in flat_equipment)
if(E.detachable && prob(30))
WR.crowbar_salvage += E
E.detach(WR) //detaches from src into WR
E.activated = TRUE
else
E.detach(loc)
qdel(E)
if(cell)
WR.crowbar_salvage += cell
cell.forceMove(WR)
cell.use(rand(0, cell.charge), TRUE)
cell = null
return ..()


/obj/vehicle/sealed/mecha/update_icon_state()
icon_state = get_mecha_occupancy_state()
return ..()
Expand Down Expand Up @@ -355,39 +306,17 @@
initialize_controller_action_type(/datum/action/vehicle/sealed/mecha/strafe, VEHICLE_CONTROL_DRIVE)

/obj/vehicle/sealed/mecha/proc/get_mecha_occupancy_state()
if((mecha_flags & SILICON_PILOT) && silicon_icon_state)
return silicon_icon_state
if(LAZYLEN(occupants))
return base_icon_state
return "[base_icon_state]-open"

/obj/vehicle/sealed/mecha/CanPassThrough(atom/blocker, movement_dir, blocker_opinion)
if(!phasing || get_charge() <= phasing_energy_drain || throwing)
return ..()
if(phase_state)
flick(phase_state, src)
return TRUE

/obj/vehicle/sealed/mecha/proc/restore_equipment()
equipment_disabled = FALSE
for(var/mob/mob_occupant AS in occupants)
SEND_SOUND(mob_occupant, sound('sound/items/timer.ogg', volume=50))
to_chat(mob_occupant, span_notice("Equipment control unit has been rebooted successfully."))
set_mouse_pointer()

///Updates the values given by scanning module and capacitor tier, called when a part is removed or inserted.
/obj/vehicle/sealed/mecha/proc/update_part_values()
if(scanmod)
normal_step_energy_drain = 20 - (5 * scanmod.rating) //10 is normal, so on lowest part its worse, on second its ok and on higher its real good up to 0 on best
step_energy_drain = normal_step_energy_drain
else
normal_step_energy_drain = 500
step_energy_drain = normal_step_energy_drain
if(capacitor)
soft_armor = soft_armor.modifyRating(energy = (capacitor.rating * 5)) //Each level of capacitor protects the mech against emp by 5%
else //because we can still be hit without a cap, even if we can't move
soft_armor = soft_armor.setRating(energy = 0)

/obj/vehicle/sealed/mecha/examine(mob/user)
. = ..()
var/integrity = obj_integrity * 100/ max_integrity
Expand All @@ -408,11 +337,8 @@
. += "[icon2html(ME, user)] \A [ME]."
if(enclosed)
return
if(mecha_flags & SILICON_PILOT)
. += "[src] appears to be piloting itself..."
else
for(var/occupante in occupants)
. += "You can see [occupante] inside."
for(var/occupante in occupants)
. += "You can see [occupante] inside."

//processing internal damage, alert updates, lights power use.
/obj/vehicle/sealed/mecha/process(delta_time)
Expand Down Expand Up @@ -469,7 +395,7 @@
break // all good
checking = checking.loc

if(mecha_flags & LIGHTS_ON)
if(!lights_on)
use_power(2*delta_time)

//Diagnostic HUD updates
Expand Down Expand Up @@ -497,10 +423,7 @@
. = COMSIG_MOB_CLICK_CANCELED
if(!isturf(target) && !isturf(target.loc)) // Prevents inventory from being drilled
return
if(completely_disabled || is_currently_ejecting || (mecha_flags & CANNOT_INTERACT))
return
if(phasing)
balloon_alert(user, "not while [phasing]!")
if(completely_disabled || is_currently_ejecting)
return
if(HAS_TRAIT(src, TRAIT_INCAPACITATED))
return
Expand All @@ -512,7 +435,7 @@
if(src == target)
return
var/dir_to_target = get_dir(src,target)
if(!(mecha_flags & OMNIDIRECTIONAL_ATTACKS) && dir_to_target && !(dir_to_target & dir))//wrong direction
if(dir_to_target && !(dir_to_target & dir))//wrong direction
return
if(internal_damage & MECHA_INT_CONTROL_LOST)
target = pick(view(3,target))
Expand Down Expand Up @@ -577,11 +500,6 @@
////// Access stuff /////
/////////////////////////

/obj/vehicle/sealed/mecha/proc/operation_allowed(mob/M)
req_access = operation_req_access
req_one_access = list()
return allowed(M)

/obj/vehicle/sealed/mecha/proc/internals_access_allowed(mob/M)
req_one_access = internals_req_access
req_access = list()
Expand Down
15 changes: 0 additions & 15 deletions code/modules/vehicles/mecha/combat/combat.dm

This file was deleted.

Loading
Loading