Makes borgs take damage from being flung into objects (#23000)

* we are so back

* Makes it compile

* Vendors, walls, windows and consoles done

* Blob and living mobs

* Magpulses are now based on traits

* Gives borgs the trait by action button

* Fixes modsuits

* Update code/game/objects/objs.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/game/turfs/turf.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Update code/modules/mob/living/living.dm

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>

* Fixes Thunk

* Actually fixes it

* I took an L (away from the trait)

* One proc now

* Update code/modules/clothing/shoes/magboots.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

* Update code/modules/clothing/shoes/magboots.dm

Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>

---------

Co-authored-by: Burzah <116982774+Burzah@users.noreply.github.com>
Co-authored-by: Henri215 <77684085+Henri215@users.noreply.github.com>
This commit is contained in:
DGamerL
2023-12-13 16:22:02 +01:00
committed by GitHub
parent 2c85645444
commit 962e78a363
23 changed files with 108 additions and 70 deletions
@@ -210,32 +210,25 @@ Pipelines + Other Objects -> Pipe network
playsound(loc, W.usesound, 50, 1)
to_chat(user, "<span class='notice'>You begin to unfasten \the [src]...</span>")
for(var/obj/item/clothing/shoes/magboots/usermagboots in user.get_equipped_items())
if(usermagboots.magpulse)
safefromgusts = TRUE
for(var/obj/item/clothing/shoes/mod/usermodboots in user.get_equipped_items())
if(usermodboots.magbooted)
safefromgusts = TRUE
if(HAS_TRAIT(user, TRAIT_MAGPULSE))
safefromgusts = TRUE
if(internal_pressure > 2*ONE_ATMOSPHERE)
if(internal_pressure > 2 * ONE_ATMOSPHERE)
unsafe_wrenching = TRUE //Oh dear oh dear
if(internal_pressure > 1750 && !safefromgusts) // 1750 is the pressure limit to do 60 damage when thrown
to_chat(user, "<span class='userdanger'>As you struggle to unwrench \the [src] a huge gust of gas blows in your face! This seems like a terrible idea!</span>")
to_chat(user, "<span class='userdanger'>As you struggle to unwrench [src] a huge gust of gas blows in your face! This seems like a terrible idea!</span>")
else
to_chat(user, "<span class='warning'>As you begin unwrenching \the [src] a gust of air blows in your face... maybe you should reconsider?</span>")
to_chat(user, "<span class='warning'>As you begin unwrenching [src] a gust of air blows in your face... maybe you should reconsider?</span>")
if(do_after(user, 40 * W.toolspeed, target = src) && !QDELETED(src))
safefromgusts = FALSE
for(var/obj/item/clothing/shoes/magboots/usermagboots in user.get_equipped_items())
if(usermagboots.magpulse) // Check again, incase they change magpulse mid-wrench
safefromgusts = TRUE
for(var/obj/item/clothing/shoes/mod/usermodboots in user.get_equipped_items())
if(usermodboots.magbooted)
safefromgusts = TRUE
if(HAS_TRAIT(user, TRAIT_MAGPULSE))
safefromgusts = TRUE
user.visible_message( \
"<span class='notice'>[user] unfastens \the [src].</span>", \
"<span class='notice'>You have unfastened \the [src].</span>", \
"<span class='notice'>[user] unfastens [src].</span>", \
"<span class='notice'>You have unfastened [src].</span>", \
"<span class='italics'>You hear ratcheting.</span>")
investigate_log("was <span class='warning'>REMOVED</span> by [key_name(usr)]", "atmos")
+26 -11
View File
@@ -13,31 +13,31 @@
put_on_delay = 70
resistance_flags = FIRE_PROOF
/obj/item/clothing/shoes/magboots/Destroy()
STOP_PROCESSING(SSobj, src)
return ..()
/obj/item/clothing/shoes/magboots/water_act(volume, temperature, source, method)
. = ..()
if(magpulse && slowdown_active > SHOES_SLOWDOWN)
slowdown = slowdown_active
/obj/item/clothing/shoes/magboots/atmos
desc = "Magnetic boots, made to withstand gusts of space wind over 500kmph."
name = "atmospheric magboots"
icon_state = "atmosmagboots0"
magboot_state = "atmosmagboots"
/obj/item/clothing/shoes/magboots/equipped(mob/user, slot, initial)
. = ..()
if(slot != SLOT_HUD_SHOES || !ishuman(user))
return
check_mag_pulse()
/obj/item/clothing/shoes/magboots/dropped(mob/user, silent)
. = ..()
if(!ishuman(user))
return
check_mag_pulse()
/obj/item/clothing/shoes/magboots/attack_self(mob/user, forced = FALSE)
toggle_magpulse(user, forced)
/obj/item/clothing/shoes/magboots/proc/toggle_magpulse(mob/user, forced)
if(magpulse)
START_PROCESSING(SSobj, src) //Gravboots
flags &= ~NOSLIP
slowdown = slowdown_passive
else
STOP_PROCESSING(SSobj, src)
flags |= NOSLIP
slowdown = slowdown_active
magpulse = !magpulse
@@ -49,6 +49,16 @@
for(var/X in actions)
var/datum/action/A = X
A.UpdateButtonIcon()
check_mag_pulse(user)
/obj/item/clothing/shoes/magboots/proc/check_mag_pulse(mob/user)
if(!user)
return
if(magpulse)
ADD_TRAIT(user, TRAIT_MAGPULSE, "magboots")
return
if(HAS_TRAIT(user, TRAIT_MAGPULSE)) // User has trait and the magboots were turned off, remove trait
REMOVE_TRAIT(user, TRAIT_MAGPULSE, "magboots")
/obj/item/clothing/shoes/magboots/negates_gravity()
return flags & NOSLIP
@@ -57,6 +67,11 @@
. = ..()
. += "Its [magpulse_name] appears to be [magpulse ? "enabled" : "disabled"]."
/obj/item/clothing/shoes/magboots/atmos
name = "atmospheric magboots"
desc = "Magnetic boots, made to withstand gusts of space wind over 500kmph."
icon_state = "atmosmagboots0"
magboot_state = "atmosmagboots"
/obj/item/clothing/shoes/magboots/advance
name = "advanced magboots"
+1 -1
View File
@@ -267,7 +267,7 @@ GLOBAL_LIST_EMPTY(blob_nodes)
return B.blob_reagent_datum.description
return "something unknown"
/obj/structure/blob/hit_by_thrown_carbon(mob/living/carbon/human/C, datum/thrownthing/throwingdatum, damage, mob_hurt, self_hurt)
/obj/structure/blob/hit_by_thrown_mob(mob/living/C, datum/thrownthing/throwingdatum, damage, mob_hurt, self_hurt)
damage *= 0.25 // Lets not have sorium be too much of a blender / rapidly kill itself
return ..()
+2 -2
View File
@@ -612,9 +612,9 @@ GLOBAL_LIST_INIT(ventcrawl_machinery, list(/obj/machinery/atmospherics/unary/ven
var/damage = 10 + 1.5 * speed // speed while thrower is standing still is 2, while walking with an aggressive grab is 2.4, highest speed is 14
hit_atom.hit_by_thrown_carbon(src, throwingdatum, damage, FALSE, FALSE)
hit_atom.hit_by_thrown_mob(src, throwingdatum, damage, FALSE, FALSE)
/mob/living/carbon/hit_by_thrown_carbon(mob/living/carbon/human/C, datum/thrownthing/throwingdatum, damage, mob_hurt, self_hurt)
/mob/living/carbon/hit_by_thrown_mob(mob/living/C, datum/thrownthing/throwingdatum, damage, mob_hurt, self_hurt)
for(var/obj/item/dualsaber/D in contents)
if(HAS_TRAIT(D, TRAIT_WIELDED) && D.force)
visible_message("<span class='danger'>[src] impales [C] with [D], before dropping them on the ground!</span>")
+7 -3
View File
@@ -1102,7 +1102,7 @@
stop_pulling()
return ..()
/mob/living/hit_by_thrown_carbon(mob/living/carbon/human/C, datum/thrownthing/throwingdatum, damage, mob_hurt, self_hurt)
/mob/living/hit_by_thrown_mob(mob/living/C, datum/thrownthing/throwingdatum, damage, mob_hurt, self_hurt)
if(C == src || flying || !density)
return
playsound(src, 'sound/weapons/punch1.ogg', 50, 1)
@@ -1110,8 +1110,12 @@
return
if(!self_hurt)
take_organ_damage(damage)
C.take_organ_damage(damage)
C.KnockDown(3 SECONDS)
if(issilicon(C))
C.adjustBruteLoss(damage)
C.Weaken(3 SECONDS)
else
C.take_organ_damage(damage)
C.KnockDown(3 SECONDS)
C.visible_message("<span class='danger'>[C] crashes into [src], knocking them both over!</span>", "<span class='userdanger'>You violently crash into [src]!</span>")
/**
@@ -15,7 +15,6 @@
has_camera = FALSE
req_one_access = list(ACCESS_ENGINE, ACCESS_ROBOTICS)
ventcrawler = VENTCRAWLER_ALWAYS
magpulse = TRUE
mob_size = MOB_SIZE_SMALL
pull_force = MOVE_FORCE_VERY_WEAK // Can only drag small items
modules_break = FALSE
@@ -79,7 +78,9 @@
module = new /obj/item/robot_module/drone(src)
// Give us our action button
var/datum/action/innate/hide/drone_hide/hide = new()
var/datum/action/innate/robot_magpulse/pulse = new()
hide.Grant(src)
pulse.Grant(src)
//Allows Drones to hear the Engineering channel.
module.channels = list("Engineering" = 1)
@@ -105,7 +105,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
hud_possible = list(SPECIALROLE_HUD, DIAG_STAT_HUD, DIAG_HUD, DIAG_BATT_HUD)
var/default_cell_type = /obj/item/stock_parts/cell/high
var/magpulse = FALSE
var/ionpulse = FALSE // Jetpack-like effect.
var/ionpulse_on = FALSE // Jetpack-like effect.
/// Does it clean the tile under it?
@@ -463,7 +462,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
module.channels = list("Engineering" = 1)
if(camera && ("Robots" in camera.network))
camera.network += "Engineering"
magpulse = TRUE
if("Janitor")
module = new /obj/item/robot_module/janitor(src)
module.channels = list("Service" = 1)
@@ -543,7 +541,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
speed = 0 // Remove upgrades.
ionpulse = FALSE
magpulse = FALSE
weapons_unlock = FALSE
add_language("Robot Talk", TRUE)
if("lava" in weather_immunities) // Remove the lava-immunity effect given by a printable upgrade
@@ -1366,7 +1363,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
has_camera = FALSE
req_one_access = list(ACCESS_CENT_SPECOPS)
ionpulse = TRUE
magpulse = TRUE
pdahide = TRUE
eye_protection = 2 // Immunity to flashes and the visual part of flashbangs
ear_protection = TRUE // Immunity to the audio part of flashbangs
@@ -1446,7 +1442,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
force_modules = list("Combat", "Engineering", "Medical")
damage_protection = 5 // Reduce all incoming damage by this number
eprefix = "Gamma"
magpulse = TRUE
/mob/living/silicon/robot/destroyer
@@ -1460,7 +1455,6 @@ GLOBAL_LIST_INIT(robot_verbs_default, list(
has_camera = FALSE
req_one_access = list(ACCESS_CENT_SPECOPS)
ionpulse = TRUE
magpulse = TRUE
pdahide = TRUE
eye_protection = 2 // Immunity to flashes and the visual part of flashbangs
ear_protection = TRUE // Immunity to the audio part of flashbangs
@@ -35,3 +35,25 @@
sight_mode = BORGMESON
icon_icon = 'icons/obj/clothing/glasses.dmi'
button_icon_state = "meson"
/datum/action/innate/robot_magpulse
name = "Magnetic pulse"
icon_icon = 'icons/obj/clothing/shoes.dmi'
button_icon_state = "magboots0"
var/slowdown_active = 2 // Same as magboots
/datum/action/innate/robot_magpulse/Activate()
ADD_TRAIT(owner, TRAIT_MAGPULSE, "innate boots")
to_chat(owner, "You turn your magboots on.")
var/mob/living/silicon/robot/robot = owner
robot.speed += slowdown_active
button_icon_state = "magboots1"
active = TRUE
/datum/action/innate/robot_magpulse/Deactivate()
REMOVE_TRAIT(owner, TRAIT_MAGPULSE, "innate boots")
to_chat(owner, "You turn your magboots off.")
var/mob/living/silicon/robot/robot = owner
robot.speed -= slowdown_active
button_icon_state = initial(button_icon_state)
active = FALSE
@@ -385,7 +385,7 @@
name = "engineering robot module"
module_type = "Engineer"
subsystems = list(/mob/living/silicon/proc/subsystem_power_monitor)
module_actions = list(/datum/action/innate/robot_sight/meson)
module_actions = list(/datum/action/innate/robot_sight/meson, /datum/action/innate/robot_magpulse)
basic_modules = list(
/obj/item/flash/cyborg,
/obj/item/rpd,
@@ -615,7 +615,7 @@
/obj/item/robot_module/deathsquad
name = "NT advanced combat module"
module_type = "Malf"
module_actions = list(/datum/action/innate/robot_sight/thermal)
module_actions = list(/datum/action/innate/robot_sight/thermal, /datum/action/innate/robot_magpulse)
basic_modules = list(
/obj/item/flash/cyborg,
/obj/item/melee/energy/sword/cyborg,
@@ -706,7 +706,7 @@
/obj/item/robot_module/destroyer
name = "destroyer robot module"
module_type = "Malf"
module_actions = list(/datum/action/innate/robot_sight/thermal)
module_actions = list(/datum/action/innate/robot_sight/thermal, /datum/action/innate/robot_magpulse)
basic_modules = list(
/obj/item/flash/cyborg,
/obj/item/gun/energy/immolator/multi/cyborg, // See comments on /robot_module/combat below
@@ -723,6 +723,7 @@
/obj/item/robot_module/combat
name = "combat robot module"
module_type = "Malf"
module_actions = list(/datum/action/innate/robot_magpulse)
basic_modules = list(
/obj/item/flash/cyborg,
/obj/item/gun/energy/immolator/multi/cyborg, // primary weapon, strong at close range (ie: against blob/terror/xeno), but consumes a lot of energy per shot.
@@ -14,11 +14,11 @@
. += GLOB.configuration.movement.robot_delay
/mob/living/silicon/robot/mob_negates_gravity()
return magpulse
return HAS_TRAIT(src, TRAIT_MAGPULSE)
/mob/living/silicon/robot/mob_has_gravity()
return ..() || mob_negates_gravity()
/mob/living/silicon/robot/experience_pressure_difference(pressure_difference, direction)
if(!magpulse)
if(!HAS_TRAIT(src, TRAIT_MAGPULSE))
return ..()
@@ -432,3 +432,8 @@
/mob/living/silicon/on_standing_up()
return // Silicons are always standing by default.
/mob/living/silicon/throw_impact(atom/hit_atom, throwingdatum, speed = 1)
. = ..()
var/damage = 10 + 1.5 * speed
hit_atom.hit_by_thrown_mob(src, throwingdatum, damage, FALSE, FALSE)
-4
View File
@@ -83,7 +83,3 @@
"Unathi" = 'icons/mob/clothing/modsuit/species/modsuits_younahthee.dmi',
"Vox" = 'icons/mob/clothing/modsuit/species/vox_modsuits.dmi'
)
var/magbooted
/obj/item/clothing/shoes/mod/negates_gravity()
return magbooted
@@ -59,7 +59,7 @@
return
mod.boots.flags |= NOSLIP
mod.slowdown += slowdown_active
mod.boots.magbooted = TRUE
ADD_TRAIT(mod.wearer, TRAIT_MAGPULSE, "magbooted")
/obj/item/mod/module/magboot/on_deactivation(display_message = TRUE, deleting = FALSE)
. = ..()
@@ -67,7 +67,7 @@
return
mod.boots.flags ^= NOSLIP
mod.slowdown -= slowdown_active
mod.boots.magbooted = FALSE
REMOVE_TRAIT(mod.wearer, TRAIT_MAGPULSE, "magbooted")
/obj/item/mod/module/magboot/advanced
name = "MOD advanced magnetic stability module"