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

Pachka fixes and upgrades for mechs #727

Merged
merged 5 commits into from
Mar 6, 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
3 changes: 1 addition & 2 deletions code/modules/mechs/components/body.dm
Original file line number Diff line number Diff line change
Expand Up @@ -190,8 +190,7 @@
obj/item/mech_component/chassis/MouseDrop(atom/over)
if(!usr || !over) return
if(!Adjacent(usr) || !over.Adjacent(usr)) return

if(storage_compartment && LAZYLEN(owner.passenger_compartment.back_passengers) <= 0) //Багажник не откроется, пока на спине есть пассажир.
if(storage_compartment)
return storage_compartment.MouseDrop(over)

/obj/item/mech_component/chassis/return_diagnostics(mob/user)
Expand Down
15 changes: 9 additions & 6 deletions code/modules/mechs/components/head.dm
Original file line number Diff line number Diff line change
Expand Up @@ -38,16 +38,19 @@

/obj/item/mech_component/sensors/proc/get_sight(powered)
var/flags = 0
if(total_damage >= 0.8 * max_damage || !powered)
flags |= BLIND
else if(active_sensors && powered)
flags |= vision_flags
if(!powered) //Камера не работает/Ничего не запитано?
flags |= BLIND //включается слепота
if(!camera && powered) //Энергия есть но камера подбита
flags |= BLIND //включается слепота
if(powered && camera)
if(active_sensors) //SENSORS active? (Button)
flags |= vision_flags //Мех получает спец зрение от сенсоров

return flags

/obj/item/mech_component/sensors/proc/get_invisible(powered)
var/invisible = 0
if((total_damage <= 0.8 * max_damage) && active_sensors && powered)
if(active_sensors && powered)
invisible = see_invisible
return invisible

Expand Down Expand Up @@ -130,7 +133,7 @@

if(user)
to_chat(user, SPAN_NOTICE("You load \the [software] into \the [src]'s memory."))

software.forceMove(src)
update_software()

Expand Down
3 changes: 3 additions & 0 deletions code/modules/mechs/interface/screen_objects.dm
Original file line number Diff line number Diff line change
Expand Up @@ -325,6 +325,9 @@
if(!owner.get_cell())
to_chat(usr, SPAN_WARNING("The augmented vision systems are offline."))
return
if(!owner.head.camera)
to_chat(usr,SPAN_WARNING("ERROR, main camera damaged."))
return
owner.head.active_sensors = ..()
to_chat(usr, SPAN_NOTICE("[owner.head.name] advanced sensor mode is [owner.head.active_sensors ? "now" : "no longer" ] active."))

Expand Down
23 changes: 16 additions & 7 deletions code/modules/mechs/mech_damage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,13 +51,23 @@
. = ..()

/mob/living/exosuit/bullet_act(obj/item/projectile/P, def_zone, used_weapon)
//Проверяем, с какого направления прилетает атака!
var/local_dir = get_dir(src, get_turf(P)) // <- Узнаём направление от меха до пули
if(local_dir == turn(dir, -90) || local_dir == turn(dir, -135) || local_dir == turn(dir, 180) || local_dir == turn(dir, 90) || local_dir == turn(dir, 135))
// U U U
// U M U ↓ (Mech dir, look on SOUTH)
// D D D
// M - mech, U - unload passengers if was hit from this side, D - defense passengers(Dont unload) if was hit from this side
if(passengers_ammount > 0)
forced_leave_passenger(null,MECH_DROP_ALL_PASSENGER,"attack")
if(local_dir == turn(dir,-135) || local_dir == turn(dir,135) || local_dir == turn(dir,180))
P.damage = P.damage * 1.3
switch(def_zone)
if(BP_HEAD , BP_CHEST, BP_MOUTH, BP_EYES)
if(LAZYLEN(pilots) && (!hatch_closed || !prob(body.pilot_coverage)))
var/mob/living/pilot = pick(pilots)
return pilot.bullet_act(P, def_zone, used_weapon)
if(passengers_ammount > 0) // <- Если в меха выстрелили и были пассажиры,пассажирку меха опустошит
forced_leave_passenger(null , MECH_DROP_ALL_PASSENGER , "attack")


..()

Expand Down Expand Up @@ -126,24 +136,23 @@

var/obj/item/mech_component/target = zoneToComponent(def_zone)
if(target.total_damage >= target.max_damage)
if(target == head)
if(target == head && !head.camera && !head.radio)
body.take_brute_damage(damage/3)
arms.take_brute_damage(damage/3)
legs.take_brute_damage(damage/3)
else if(target == body)
else if(target == body && !body.m_armour && !body.diagnostics )
head.take_brute_damage(damage/1.5)
legs.take_brute_damage(damage/1.5)
arms.take_brute_damage(damage/1.5)
else if(target == arms)
else if(target == arms && !arms.motivator)
body.take_brute_damage(damage/3)
head.take_brute_damage(damage/3)
legs.take_brute_damage(damage/3)
else if(target == legs)
else if(target == legs && !legs.motivator)
body.take_brute_damage(damage/2)
head.take_brute_damage(damage/2)
arms.take_brute_damage(damage/2)
updatehealth()
return

//Only 3 types of damage concern mechs and vehicles
switch(damagetype)
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mechs/mech_icon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -51,15 +51,15 @@ proc/get_mech_images(var/list/components = list(), var/overlay_layer = FLOAT_LAY
var/obj/item/mech_equipment/hardpoint_object = hardpoints[hardpoint]
if(hardpoint_object)
//
if(hardpoint == "left hand")
if(dir == WEST || dir == SOUTHWEST || dir == NORTHWEST)
if(hardpoint == "left hand" || hardpoint == "left shoulder")
if(dir == WEST || dir == SOUTHWEST || dir == NORTHWEST || dir == SOUTH)
hardpoint_object.mech_layer = MECH_GEAR_LAYER
else if(dir == EAST || dir == SOUTHEAST || dir == NORTHEAST)
hardpoint_object.mech_layer = MECH_BACK_LAYER
if(hardpoint == "right hand")
if(hardpoint == "right hand" || hardpoint == "right shoulder")
if(dir == WEST || dir == SOUTHWEST || dir == NORTHWEST)
hardpoint_object.mech_layer = MECH_BACK_LAYER
else if(dir == EAST || dir == SOUTHEAST || dir == NORTHEAST)
else if(dir == EAST || dir == SOUTHEAST || dir == NORTHEAST || dir == SOUTH)
hardpoint_object.mech_layer = MECH_GEAR_LAYER
//
var/use_icon_state = "[hardpoint_object.icon_state]_[hardpoint]"
Expand Down
19 changes: 18 additions & 1 deletion code/modules/mechs/mech_interaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -305,7 +305,16 @@
if(LAZYLEN(pilots) >= LAZYLEN(body.pilot_positions))
to_chat(user, SPAN_WARNING("\The [src] is occupied to capacity."))
return FALSE
return TRUE
var/local_dir = get_dir(src, user) // <- Узнаём направление от меха до пули
if(local_dir == turn(dir, 0) || local_dir == turn(dir, 45) || local_dir == turn(dir, -45) || local_dir == turn(dir, 90) || local_dir == turn(dir, -90))
// B B B
// G M G ↓ (Mech dir, look on SOUTH)
// G G G
// M - mech, B - cant climb IN mech from this side, G - can climb in mech from this side
return TRUE
else
to_chat(user, SPAN_WARNING("You cant climb in [src ] from this side."))
return FALSE

/mob/living/exosuit/proc/enter(var/mob/user)
if(!check_enter(user))
Expand All @@ -329,6 +338,14 @@
return 1

/mob/living/exosuit/proc/check_passenger(var/mob/user) // Выбираем желаемое место, проверяем можно ли его занять, стартуем прок занятия
var/local_dir = get_dir(src, user)
if(local_dir != turn(dir, 90) && local_dir != turn(dir, -90) && local_dir != turn(dir, -135) && local_dir != turn(dir, 135) && local_dir != turn(dir, 180))
// G G G
// G M G ↓ (Mech dir, look on SOUTH)
// B B B
// M - mech, B - cant climb ON mech from this side, G - can climb ON mech from this side
to_chat(user, SPAN_WARNING("You cant climb in passenger place of [src ] from this side."))
return FALSE
var/choose
var/choosed_place = input(usr, "Choose passenger place which you want to take.", name, choose) as null|anything in passenger_places
if(!user.Adjacent(src)) // <- Мех рядом?
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mechs/mech_movement.dm
Original file line number Diff line number Diff line change
Expand Up @@ -145,7 +145,7 @@
if(exosuit.passengers_ammount > 0)
exosuit.update_passengers()
for(var/hardpoint in exosuit.hardpoints)
if(hardpoint == "left hand" || hardpoint == "right hand")
if(hardpoint == "left hand" || hardpoint == "right hand" || hardpoint == "left shoulder" || hardpoint == "right shoulder")
exosuit.update_icon()
exosuit.SetMoveCooldown(exosuit.legs.turn_delay)
//TURN
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mechs/premade/light.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@
icon_state = "light_arms"
melee_damage = 25
action_delay = 15
max_damage = 120
max_damage = 90
power_use = 10
allow_passengers = FALSE // Лёгкие слишком маленькие и лёгкие
desc = "As flexible as they are fragile, these Vey-Med manipulators can follow a pilot's movements in close to real time."
Expand All @@ -41,7 +41,7 @@
icon_state = "light_legs"
move_delay = 2
turn_delay = 3
max_damage = 120
max_damage = 90
power_use = 5
desc = "These Odysseus series legs are built from lightweight flexible polymers, making them capable of handling falls from up to 120 meters in 1g environments. Provided that the exosuit lands on its feet."
max_fall_damage = 0
Expand All @@ -55,7 +55,7 @@
gender = PLURAL
exosuit_desc_string = "advanced sensor array"
icon_state = "light_head"
max_damage = 120
max_damage = 90
vision_flags = SEE_TURFS
see_invisible = SEE_INVISIBLE_NOLIGHTING
power_use = 50
Expand All @@ -74,7 +74,7 @@
transparent_cabin = TRUE
exosuit_desc_string = "an open and light chassis"
icon_state = "light_body"
max_damage = 150
max_damage = 120
power_use = 5
has_hardpoints = list(HARDPOINT_BACK, HARDPOINT_LEFT_SHOULDER)
desc = "The Veymed Odysseus series cockpits combine ultralight materials and clear aluminum laminates to provide an optimized cockpit experience."
Expand Down
Loading