NOTICE - Cyborg lockdown lifted" : "ALERT - Cyborg lockdown detected"]: [R.name]
")
else
to_chat(usr, "Access Denied.")
diff --git a/code/game/machinery/cryopod.dm b/code/game/machinery/cryopod.dm
index 92927d047d..118145ed88 100644
--- a/code/game/machinery/cryopod.dm
+++ b/code/game/machinery/cryopod.dm
@@ -287,6 +287,7 @@
#define CRYO_PRESERVE 1
#define CRYO_OBJECTIVE 2
#define CRYO_IGNORE 3
+#define CRYO_DESTROY_LATER 4
/obj/machinery/cryopod/proc/should_preserve_item(obj/item/I)
for(var/datum/objective_item/steal/T in control_computer.theft_cache)
@@ -308,8 +309,8 @@
if(iscyborg(mob_occupant))
var/mob/living/silicon/robot/R = mob_occupant
if(R.mmi?.brain)
- cryo_items[R.mmi] = CRYO_IGNORE
- cryo_items[R.mmi.brain] = CRYO_IGNORE
+ cryo_items[R.mmi] = CRYO_DESTROY_LATER
+ cryo_items[R.mmi.brain] = CRYO_DESTROY_LATER
for(var/obj/item/I in R.module) // the tools the borg has; metal, glass, guns etc
for(var/obj/item/O in I) // the things inside the tools, if anything; mainly for janiborg trash bags
cryo_items[O] = should_preserve_item(O)
@@ -318,7 +319,7 @@
//Drop all items into the pod.
for(var/obj/item/I in mob_occupant)
- if(cryo_items[I] == CRYO_IGNORE)
+ if(cryo_items[I] == CRYO_IGNORE || cryo_items[I] ==CRYO_DESTROY_LATER)
continue
cryo_items[I] = should_preserve_item(I)
mob_occupant.transferItemToLoc(I, src, TRUE)
@@ -334,17 +335,19 @@
if(QDELETED(I)) //edge cases and DROPDEL.
continue
var/preserve = cryo_items[I]
- if(preserve == CRYO_IGNORE)
+ if(preserve == CRYO_DESTROY_LATER)
continue
- else if(preserve == CRYO_DESTROY)
- qdel(I)
- else if(control_computer?.allow_items)
- control_computer.frozen_items += I
- if(preserve == CRYO_OBJECTIVE)
- control_computer.objective_items += I
- I.moveToNullspace()
- else
- I.forceMove(loc)
+ if(preserve != CRYO_IGNORE)
+ if(preserve == CRYO_DESTROY)
+ qdel(I)
+ else if(control_computer?.allow_items)
+ control_computer.frozen_items += I
+ if(preserve == CRYO_OBJECTIVE)
+ control_computer.objective_items += I
+ I.moveToNullspace()
+ else
+ I.forceMove(loc)
+ cryo_items -= I
//Update any existing objectives involving this mob.
for(var/datum/objective/O in GLOB.objectives)
@@ -405,6 +408,10 @@
mob_occupant.ghostize(FALSE, penalize = TRUE)
QDEL_NULL(occupant)
+ for(var/I in cryo_items) //only "CRYO_DESTROY_LATER" atoms are left)
+ var/atom/A = I
+ if(!QDELETED(A))
+ qdel(A)
open_machine()
name = initial(name)
@@ -412,6 +419,7 @@
#undef CRYO_PRESERVE
#undef CRYO_OBJECTIVE
#undef CRYO_IGNORE
+#undef CRYO_DESTROY_LATER
/obj/machinery/cryopod/MouseDrop_T(mob/living/target, mob/user)
if(!istype(target) || user.incapacitated() || !target.Adjacent(user) || !Adjacent(user) || !ismob(target) || (!ishuman(user) && !iscyborg(user)) || !istype(user.loc, /turf) || target.buckled)
diff --git a/code/game/machinery/dance_machine.dm b/code/game/machinery/dance_machine.dm
index ea14031603..9ecc19e40f 100644
--- a/code/game/machinery/dance_machine.dm
+++ b/code/game/machinery/dance_machine.dm
@@ -433,5 +433,5 @@
. = ..()
if(active)
for(var/mob/living/M in rangers)
- if(prob(5+(allowed(M)*4)) && M.canmove)
+ if(prob(5+(allowed(M)*4)) && CHECK_MOBILITY(M, MOBILITY_MOVE))
dance(M)
diff --git a/code/game/machinery/doors/airlock.dm b/code/game/machinery/doors/airlock.dm
index 85063b27c5..3bc8aff809 100644
--- a/code/game/machinery/doors/airlock.dm
+++ b/code/game/machinery/doors/airlock.dm
@@ -428,7 +428,7 @@
else
return FALSE
-/obj/machinery/door/airlock/update_icon_state(state=0, override=0)
+/obj/machinery/door/airlock/update_icon(state=0, override=0)
if(operating && !override)
return
switch(state)
@@ -769,7 +769,7 @@
if(!istype(H.head, /obj/item/clothing/head/helmet))
H.visible_message("[user] headbutts the airlock.", \
"You headbutt the airlock!")
- H.Knockdown(100)
+ H.DefaultCombatKnockdown(100)
H.apply_damage(10, BRUTE, BODY_ZONE_HEAD)
else
visible_message("[user] headbutts the airlock. Good thing [user.p_theyre()] wearing a helmet.")
@@ -1033,7 +1033,7 @@
if(!I.use_tool(src, user, 150, volume=50))
to_chat(user, "You slip and [charge] detonates!")
charge.ex_act(EXPLODE_DEVASTATE)
- user.Knockdown(60)
+ user.DefaultCombatKnockdown(60)
return
user.visible_message("[user] removes [charge] from [src].", \
"You gently pry out [charge] from [src] and unhook its wires.")
diff --git a/code/game/machinery/doors/airlock_types.dm b/code/game/machinery/doors/airlock_types.dm
index 50ae7dab18..530a287134 100644
--- a/code/game/machinery/doors/airlock_types.dm
+++ b/code/game/machinery/doors/airlock_types.dm
@@ -508,7 +508,7 @@
throwtarget = get_edge_target_turf(src, get_dir(src, get_step_away(L, src)))
SEND_SOUND(L, sound(pick('sound/hallucinations/turn_around1.ogg','sound/hallucinations/turn_around2.ogg'),0,1,50))
flash_color(L, flash_color="#960000", flash_time=20)
- L.Knockdown(40)
+ L.DefaultCombatKnockdown(40)
L.throw_at(throwtarget, 5, 1)
return 0
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index d2f98a868b..c4c712ca25 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -319,10 +319,10 @@
else if(ishuman(L)) //For humans
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
L.emote("scream")
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
else if(ismonkey(L)) //For monkeys
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
else //for simple_animals & borgs
L.adjustBruteLoss(DOOR_CRUSH_DAMAGE)
var/turf/location = get_turf(src)
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 9cc4fc43ac..7bef255aff 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -115,7 +115,7 @@
continue
if(L.flash_act(affect_silicon = 1))
- L.Knockdown(strength)
+ L.DefaultCombatKnockdown(strength)
flashed = TRUE
if(flashed)
diff --git a/code/game/machinery/pipe/construction.dm b/code/game/machinery/pipe/construction.dm
index 937e3909b0..8b6c2180d9 100644
--- a/code/game/machinery/pipe/construction.dm
+++ b/code/game/machinery/pipe/construction.dm
@@ -90,7 +90,8 @@ Buildable meters
set name = "Flip Pipe"
set src in view(1)
- if ( usr.stat || usr.restrained() || !usr.canmove )
+ var/mob/living/L = usr
+ if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
return
do_a_flip()
diff --git a/code/game/machinery/pipe/pipe_dispenser.dm b/code/game/machinery/pipe/pipe_dispenser.dm
index 4cba24bac7..b0e26ce129 100644
--- a/code/game/machinery/pipe/pipe_dispenser.dm
+++ b/code/game/machinery/pipe/pipe_dispenser.dm
@@ -34,7 +34,8 @@
/obj/machinery/pipedispenser/Topic(href, href_list)
if(..())
return 1
- if(!anchored|| !usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
+ var/mob/living/L = usr
+ if(!anchored || !istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
usr << browse(null, "window=pipedispenser")
return 1
usr.set_machine(src)
@@ -93,14 +94,14 @@
//Allow you to drag-drop disposal pipes and transit tubes into it
-/obj/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/pipe, mob/usr)
- if(!usr.canmove || usr.stat || usr.restrained())
+/obj/machinery/pipedispenser/disposal/MouseDrop_T(obj/structure/pipe, mob/living/user)
+ if(!istype(user) || !CHECK_MOBILITY(user, MOBILITY_USE))
return
if (!istype(pipe, /obj/structure/disposalconstruct) && !istype(pipe, /obj/structure/c_transit_tube) && !istype(pipe, /obj/structure/c_transit_tube_pod))
return
- if (get_dist(usr, src) > 1 || get_dist(src,pipe) > 1 )
+ if (get_dist(user, src) > 1 || get_dist(src,pipe) > 1 )
return
if (pipe.anchored)
diff --git a/code/game/machinery/porta_turret/portable_turret.dm b/code/game/machinery/porta_turret/portable_turret.dm
index f07f946d0f..47caea1b25 100644
--- a/code/game/machinery/porta_turret/portable_turret.dm
+++ b/code/game/machinery/porta_turret/portable_turret.dm
@@ -705,7 +705,7 @@
/obj/machinery/porta_turret/syndicate/energy/pirate
max_integrity = 260
- integrity_failure = 20
+ integrity_failure = 0.08
armor = list("melee" = 50, "bullet" = 30, "laser" = 30, "energy" = 30, "bomb" = 50, "bio" = 0, "rad" = 0, "fire" = 90, "acid" = 90)
diff --git a/code/game/machinery/telecomms/machines/allinone.dm b/code/game/machinery/telecomms/machines/allinone.dm
index c2dd9a7828..fbb5505586 100644
--- a/code/game/machinery/telecomms/machines/allinone.dm
+++ b/code/game/machinery/telecomms/machines/allinone.dm
@@ -35,8 +35,6 @@
signal.data["compression"] = 0
signal.mark_done()
- if(signal.data["slow"] > 0)
- sleep(signal.data["slow"]) // simulate the network lag if necessary
signal.broadcast()
/obj/machinery/telecomms/allinone/attackby(obj/item/P, mob/user, params)
diff --git a/code/game/machinery/telecomms/machines/broadcaster.dm b/code/game/machinery/telecomms/machines/broadcaster.dm
index 0abe97c72e..6b03bcc880 100644
--- a/code/game/machinery/telecomms/machines/broadcaster.dm
+++ b/code/game/machinery/telecomms/machines/broadcaster.dm
@@ -41,9 +41,6 @@ GLOBAL_VAR_INIT(message_delay, 0) // To make sure restarting the recentmessages
return
GLOB.recentmessages.Add(signal_message)
- if(signal.data["slow"] > 0)
- sleep(signal.data["slow"]) // simulate the network lag if necessary
-
signal.broadcast()
if(!GLOB.message_delay)
diff --git a/code/game/machinery/telecomms/machines/bus.dm b/code/game/machinery/telecomms/machines/bus.dm
index ed7c33d50a..ce5ed31094 100644
--- a/code/game/machinery/telecomms/machines/bus.dm
+++ b/code/game/machinery/telecomms/machines/bus.dm
@@ -31,17 +31,10 @@
if(relay_information(signal, /obj/machinery/telecomms/processor))
return
- // failed to send to a processor, relay information anyway
- signal.data["slow"] += rand(1, 5) // slow the signal down only slightly
-
// Try sending it!
var/list/try_send = list(signal.server_type, /obj/machinery/telecomms/hub, /obj/machinery/telecomms/broadcaster)
- var/i = 0
for(var/send in try_send)
- if(i)
- signal.data["slow"] += rand(0, 1) // slow the signal down only slightly
- i++
if(relay_information(signal, send))
break
@@ -79,4 +72,4 @@
/obj/machinery/telecomms/bus/preset_one/birdstation
name = "Bus"
autolinkers = list("processor1", "common")
- freq_listening = list()
\ No newline at end of file
+ freq_listening = list()
diff --git a/code/game/machinery/telecomms/machines/processor.dm b/code/game/machinery/telecomms/machines/processor.dm
index 2362273469..a09b3ca8fb 100644
--- a/code/game/machinery/telecomms/machines/processor.dm
+++ b/code/game/machinery/telecomms/machines/processor.dm
@@ -28,7 +28,6 @@
if(istype(machine_from, /obj/machinery/telecomms/bus))
relay_direct_information(signal, machine_from) // send the signal back to the machine
else // no bus detected - send the signal to servers instead
- signal.data["slow"] += rand(5, 10) // slow the signal down
relay_information(signal, signal.server_type)
//Preset Processors
diff --git a/code/game/machinery/telecomms/telecomunications.dm b/code/game/machinery/telecomms/telecomunications.dm
index 70b785ea21..d21edffea1 100644
--- a/code/game/machinery/telecomms/telecomunications.dm
+++ b/code/game/machinery/telecomms/telecomunications.dm
@@ -39,11 +39,6 @@ GLOBAL_LIST_EMPTY(telecomms_list)
return
var/send_count = 0
- // Apply some lag based on traffic rates
- var/netlag = round(traffic / 50)
- if(netlag > signal.data["slow"])
- signal.data["slow"] = netlag
-
// Loop through all linked machines and send the signal or copy.
for(var/obj/machinery/telecomms/machine in links)
if(filter && !istype( machine, filter ))
diff --git a/code/game/machinery/toylathe.dm b/code/game/machinery/toylathe.dm
index a286bcdc25..87ab3cadd8 100644
--- a/code/game/machinery/toylathe.dm
+++ b/code/game/machinery/toylathe.dm
@@ -121,7 +121,7 @@
return ..()
/obj/machinery/autoylathe/proc/AfterMaterialInsert(obj/item/item_inserted, id_inserted, amount_inserted)
- if(item_inserted.custom_materials?.len && item_inserted.custom_materials[getmaterialref(/datum/material/glass)])
+ if(item_inserted.custom_materials?.len && item_inserted.custom_materials[SSmaterials.GetMaterialRef(/datum/material/glass)])
flick("autolathe_r",src)//plays glass insertion animation by default otherwise
else
flick("autolathe_o",src)//plays metal insertion animation
diff --git a/code/game/mecha/equipment/tools/medical_tools.dm b/code/game/mecha/equipment/tools/medical_tools.dm
index 5f6b709d1a..7d44e7611c 100644
--- a/code/game/mecha/equipment/tools/medical_tools.dm
+++ b/code/game/mecha/equipment/tools/medical_tools.dm
@@ -226,8 +226,7 @@
return
if(M.health > 0)
M.adjustOxyLoss(-1)
- M.AdjustStun(-80)
- M.AdjustKnockdown(-80)
+ M.AdjustAllImmobility(-80)
M.AdjustUnconscious(-80)
if(M.reagents.get_reagent_amount(/datum/reagent/medicine/epinephrine) < 5)
M.reagents.add_reagent(/datum/reagent/medicine/epinephrine, 5)
diff --git a/code/game/mecha/equipment/weapons/weapons.dm b/code/game/mecha/equipment/weapons/weapons.dm
index 978825c546..f1fa5ddd20 100644
--- a/code/game/mecha/equipment/weapons/weapons.dm
+++ b/code/game/mecha/equipment/weapons/weapons.dm
@@ -177,7 +177,7 @@
M.SetSleeping(0)
M.stuttering += 20
M.adjustEarDamage(0, 30)
- M.Knockdown(60)
+ M.DefaultCombatKnockdown(60)
if(prob(30))
M.Stun(200)
M.Unconscious(80)
diff --git a/code/game/mecha/mecha.dm b/code/game/mecha/mecha.dm
index 669bc89875..02115d3e30 100644
--- a/code/game/mecha/mecha.dm
+++ b/code/game/mecha/mecha.dm
@@ -755,7 +755,7 @@
AI.cancel_camera()
AI.controlled_mech = src
AI.remote_control = src
- AI.canmove = 1 //Much easier than adding AI checks! Be sure to set this back to 0 if you decide to allow an AI to leave a mech somehow.
+ AI.mobility_flags = MOBILITY_FLAGS_DEFAULT //Much easier than adding AI checks! Be sure to set this back to 0 if you decide to allow an AI to leave a mech somehow.
AI.can_shunt = 0 //ONE AI ENTERS. NO AI LEAVES.
to_chat(AI, AI.can_dominate_mechs ? "Takeover of [name] complete! You are now loaded onto the onboard computer. Do not attempt to leave the station sector!" :\
"You have been uploaded to a mech's onboard computer.")
@@ -927,7 +927,7 @@
brainmob.forceMove(src) //should allow relaymove
brainmob.reset_perspective(src)
brainmob.remote_control = src
- brainmob.update_canmove()
+ brainmob.update_mobility()
brainmob.update_mouse_pointer()
icon_state = initial(icon_state)
update_icon()
@@ -941,7 +941,6 @@
/obj/mecha/container_resist(mob/living/user)
go_out()
-
/obj/mecha/Exited(atom/movable/M, atom/newloc)
if(occupant && occupant == M) // The occupant exited the mech without calling go_out()
go_out(TRUE, newloc)
@@ -993,7 +992,7 @@
L.reset_perspective()
mmi.mecha = null
mmi.update_icon()
- L.canmove = 0
+ L.mobility_flags = NONE
icon_state = initial(icon_state)+"-open"
setDir(dir_in)
diff --git a/code/game/objects/buckling.dm b/code/game/objects/buckling.dm
index 416644cada..0e14af75a9 100644
--- a/code/game/objects/buckling.dm
+++ b/code/game/objects/buckling.dm
@@ -36,8 +36,7 @@
//procs that handle the actual buckling and unbuckling
/atom/movable/proc/buckle_mob(mob/living/M, force = FALSE, check_loc = TRUE)
- if(!buckled_mobs)
- buckled_mobs = list()
+ LAZYINITLIST(buckled_mobs)
if(!istype(M))
return FALSE
@@ -66,7 +65,7 @@
M.buckled = src
M.setDir(dir)
buckled_mobs |= M
- M.update_canmove()
+ M.update_mobility()
M.throw_alert("buckled", /obj/screen/alert/restrained/buckled)
post_buckle_mob(M)
@@ -85,7 +84,7 @@
. = buckled_mob
buckled_mob.buckled = null
buckled_mob.anchored = initial(buckled_mob.anchored)
- buckled_mob.update_canmove()
+ buckled_mob.update_mobility()
buckled_mob.clear_alert("buckled")
buckled_mobs -= buckled_mob
SEND_SIGNAL(src, COMSIG_MOVABLE_UNBUCKLE, buckled_mob, force)
diff --git a/code/game/objects/effects/anomalies.dm b/code/game/objects/effects/anomalies.dm
index fbe25c5d1b..8c3ffa3cfc 100644
--- a/code/game/objects/effects/anomalies.dm
+++ b/code/game/objects/effects/anomalies.dm
@@ -113,7 +113,7 @@
/obj/effect/anomaly/grav/proc/gravShock(mob/living/A)
if(boing && isliving(A) && !A.stat)
- A.Knockdown(40)
+ A.DefaultCombatKnockdown(40)
var/atom/target = get_edge_target_turf(A, get_dir(src, get_step_away(A, src)))
A.throw_at(target, 5, 1)
boing = 0
diff --git a/code/game/objects/effects/contraband.dm b/code/game/objects/effects/contraband.dm
index eea3bace98..48cf0b4a8b 100644
--- a/code/game/objects/effects/contraband.dm
+++ b/code/game/objects/effects/contraband.dm
@@ -409,6 +409,21 @@
desc = "A poster advertising a movie about some masked men."
icon_state = "poster44"
+/obj/structure/sign/poster/contraband/buzzfuzz
+ name = "Buzz Fuzz"
+ desc = "A poster advertising the newest drink \"Buzz Fuzz\" with its iconic slogan of ~A Hive of Flavour~."
+ icon_state = "poster45"
+
+/obj/structure/sign/poster/contraband/scum
+ name = "Security are Scum"
+ desc = "Anti-security propaganda. Features a human NanoTrasen security officer being shot in the head, with the words 'Scum' and a short inciteful manifesto. Used to anger security."
+ icon_state = "poster46"
+
+/obj/structure/sign/poster/contraband/syndicate_logo
+ name = "Syndicate"
+ desc = "A poster decipting a snake shaped into an ominous 'S'!"
+ icon_state = "poster47"
+
/obj/structure/sign/poster/official
poster_item_name = "motivational poster"
poster_item_desc = "An official Nanotrasen-issued poster to foster a compliant and obedient workforce. It comes with state-of-the-art adhesive backing, for easy pinning to any vertical surface."
@@ -595,4 +610,49 @@
desc = "This informational poster teaches the viewer what carbon dioxide is."
icon_state = "poster35_legit"
+/obj/structure/sign/poster/official/spiderlings
+ name = "Spiderlings"
+ desc = "This poster informs the crew of the dangers of spiderlings."
+ icon_state = "poster36_legit"
+
+/obj/structure/sign/poster/official/duelshotgun
+ name = "Cycler Shotgun Ad"
+ desc = "A poster advertising an advanced dual magazine tubes shotgun, boasting about how easy it is to swap between the two tubes."
+ icon_state = "poster37_legit"
+
+/obj/structure/sign/poster/official/fashion
+ name = "Fashion!"
+ desc = "An advertisement for 'Fashion!', a popular fashion magazine, depicting a woman with a black dress with a golden trim, she also has a red poppy in her hair."
+ icon_state = "poster38_legit"
+
+/obj/structure/sign/poster/official/pda_ad600
+ name = "NT PDA600 Ad"
+ desc = "A poster advertising an old discounted Nanotrasen PDA. This is the old 600 model, it has a small screen and suffered from security and networking issues."
+ icon_state = "poster39_legit"
+
+/obj/structure/sign/poster/official/pda_ad800
+ name = "NT PDA800 Ad"
+ desc = "An advertisement on an old Nanotrasen PDA model. The 800 fixed a lot of security flaws that the 600 had; it also had large touchscreen and hot-swappable cartridges."
+ icon_state = "poster40_legit"
+
+/obj/structure/sign/poster/official/hydro_ad
+ name = "Hydroponics Tray"
+ desc = "An advertisement for hydroponics trays. Space Station 13's botanical department uses a slightly newer model, but the principles are the same. From left to right: Green means the plant is done, red means the plant is unhealthy, flashing red means pests or weeds, yellow means the plant needs nutriment and blue means the plant needs water."
+ icon_state = "poster41_legit"
+
+/obj/structure/sign/poster/official/medical_green_cross
+ name = "Medical"
+ desc = "A green cross, one of the interplanetary symbol of health and aid. It has a bunch of common languages at the top with translations." // Didn't the American Heart Foundation trademark red crosses? I'm playing it safe with green, not that they'll notice spacegame13 poster.
+ icon_state = "poster42_legit"
+
+/obj/structure/sign/poster/official/nt_storm_officer
+ name = "NT Storm Ad"
+ desc = "An advertisement for NanoTrasen Storm. A premium infantry helmet, This is the officer variant. I comes with a better radio, better HUD software and better targeting sensors."
+ icon_state = "poster43_legit"
+
+/obj/structure/sign/poster/official/nt_storm
+ name = "NT Storm Ad"
+ desc = "An advertisement for NanoTrasen Storm. A premium infantry helmet, It contains a rebreather and full head coverage for use on harsh environments where the air isn't always safe to breathe."
+ icon_state = "poster44_legit"
+
#undef PLACE_SPEED
diff --git a/code/game/objects/effects/decals/cleanable/gibs.dm b/code/game/objects/effects/decals/cleanable/gibs.dm
index b6b93850f1..7df0153ddc 100644
--- a/code/game/objects/effects/decals/cleanable/gibs.dm
+++ b/code/game/objects/effects/decals/cleanable/gibs.dm
@@ -17,7 +17,7 @@
if(gibs_reagent_id)
reagents.add_reagent(gibs_reagent_id, 5)
if(gibs_bloodtype)
- add_blood_DNA(list("Non-human DNA" = gibs_bloodtype, diseases))
+ add_blood_DNA(list("Non-human DNA" = gibs_bloodtype), diseases)
update_icon()
/obj/effect/decal/cleanable/blood/gibs/update_icon()
diff --git a/code/game/objects/effects/effect_system/effects_other.dm b/code/game/objects/effects/effect_system/effects_other.dm
index dbc9b35275..c62dddfdb2 100644
--- a/code/game/objects/effects/effect_system/effects_other.dm
+++ b/code/game/objects/effects/effect_system/effects_other.dm
@@ -104,4 +104,5 @@
if(explosion_message)
location.visible_message("The solution violently explodes!", \
"You hear an explosion!")
- dyn_explosion(location, amount, flashing_factor)
\ No newline at end of file
+ dyn_explosion(location, amount, flashing_factor)
+
diff --git a/code/game/objects/effects/mines.dm b/code/game/objects/effects/mines.dm
index 6b94c65f49..2fb068a29b 100644
--- a/code/game/objects/effects/mines.dm
+++ b/code/game/objects/effects/mines.dm
@@ -48,7 +48,7 @@
/obj/effect/mine/stun/mineEffect(mob/living/victim)
if(isliving(victim))
- victim.Knockdown(stun_time)
+ victim.DefaultCombatKnockdown(stun_time)
/obj/effect/mine/kickmine
name = "kick mine"
diff --git a/code/game/objects/effects/step_triggers.dm b/code/game/objects/effects/step_triggers.dm
index 8c3503367e..01edd82ccb 100644
--- a/code/game/objects/effects/step_triggers.dm
+++ b/code/game/objects/effects/step_triggers.dm
@@ -61,10 +61,11 @@
if(AM in T.affecting)
return
- if(ismob(AM))
- var/mob/M = AM
+ if(isliving(AM))
+ var/mob/living/M = AM
if(immobilize)
- M.canmove = 0
+ ADD_TRAIT(M, TRAIT_MOBILITY_NOMOVE, src)
+ M.update_mobility()
affecting.Add(AM)
while(AM && !stopthrow)
@@ -98,10 +99,11 @@
affecting.Remove(AM)
- if(ismob(AM))
- var/mob/M = AM
+ if(isliving(AM))
+ var/mob/living/M = AM
if(immobilize)
- M.canmove = 1
+ REMOVE_TRAIT(M, TRAIT_MOBILITY_NOMOVE, src)
+ M.update_mobility()
/* Stops things thrown by a thrower, doesn't do anything */
diff --git a/code/game/objects/items.dm b/code/game/objects/items.dm
index 8dfb36ce8a..fd1d2fc43d 100644
--- a/code/game/objects/items.dm
+++ b/code/game/objects/items.dm
@@ -175,14 +175,13 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
set category = "Object"
set src in oview(1)
- if(!isturf(loc) || usr.stat || usr.restrained() || !usr.canmove)
+ var/mob/living/L = usr
+ if(!istype(L) || !isturf(loc) || !CHECK_MOBILITY(L, MOBILITY_USE))
return
- var/turf/T = src.loc
-
- src.loc = null
-
- src.loc = T
+ var/turf/T = loc
+ loc = null
+ loc = T
/obj/item/examine(mob/user) //This might be spammy. Remove?
. = ..()
@@ -544,7 +543,7 @@ GLOBAL_VAR_INIT(rpg_loot_items, FALSE)
to_chat(M, "You drop what you're holding and clutch at your eyes!")
M.adjust_blurriness(10)
M.Unconscious(20)
- M.Knockdown(40)
+ M.DefaultCombatKnockdown(40)
if (prob(eyes.damage - 10 + 1))
M.become_blind(EYE_DAMAGE)
to_chat(M, "You go blind!")
diff --git a/code/game/objects/items/RCL.dm b/code/game/objects/items/RCL.dm
index e4c7382b3b..9513519fa9 100644
--- a/code/game/objects/items/RCL.dm
+++ b/code/game/objects/items/RCL.dm
@@ -2,8 +2,8 @@
name = "rapid cable layer"
desc = "A device used to rapidly deploy cables. It has screws on the side which can be removed to slide off the cables. Do not use without insulation!"
icon = 'icons/obj/tools.dmi'
- icon_state = "rcl-empty"
- item_state = "rcl-0"
+ icon_state = "rcl"
+ item_state = "rcl"
var/obj/structure/cable/last
var/obj/item/stack/cable_coil/loaded
opacity = FALSE
@@ -23,6 +23,10 @@
var/datum/radial_menu/persistent/wiring_gui_menu
var/mob/listeningTo
+/obj/item/twohanded/rcl/Initialize()
+ . = ..()
+ update_icon()
+
/obj/item/twohanded/rcl/ComponentInitialize()
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
@@ -105,7 +109,15 @@
. = ..()
if(!loaded || !loaded.amount)
return
- var/mutable_appearance/cable_overlay = mutable_appearance(icon, "rcl-[max(CEILING(loaded.amount/(max_amount/3), 1), 3)]")
+ var/mutable_appearance/cable_overlay = mutable_appearance(icon, "[initial(icon_state)]-[CEILING(loaded.amount/(max_amount/3), 1)]")
+ cable_overlay.color = GLOB.cable_colors[colors[current_color_index]]
+ . += cable_overlay
+
+/obj/item/twohanded/rcl/worn_overlays(isinhands, icon_file, style_flags = NONE)
+ . = ..()
+ if(!isinhands || !(loaded?.amount))
+ return
+ var/mutable_appearance/cable_overlay = mutable_appearance(icon, "rcl-[CEILING(loaded.amount/(max_amount/3), 1)]")
cable_overlay.color = GLOB.cable_colors[colors[current_color_index]]
. += cable_overlay
@@ -279,18 +291,6 @@ obj/item/twohanded/rcl/proc/getMobhook(mob/to_hook)
wiringGuiUpdate(user)
-
-/obj/item/twohanded/rcl/pre_loaded/Initialize() //Comes preloaded with cable, for testing stuff
- . = ..()
- loaded = new()
- loaded.max_amount = max_amount
- loaded.amount = max_amount
- update_icon()
-
-/obj/item/twohanded/rcl/Initialize()
- . = ..()
- update_icon()
-
/obj/item/twohanded/rcl/ui_action_click(mob/user, action)
if(istype(action, /datum/action/item_action/rcl_col))
current_color_index++;
@@ -309,10 +309,15 @@ obj/item/twohanded/rcl/proc/getMobhook(mob/to_hook)
else //open the menu
showWiringGui(user)
+/obj/item/twohanded/rcl/pre_loaded/Initialize() //Comes preloaded with cable, for testing stuff
+ loaded = new()
+ loaded.max_amount = max_amount
+ loaded.amount = max_amount
+ return ..()
+
/obj/item/twohanded/rcl/ghetto
actions_types = list()
max_amount = 30
name = "makeshift rapid cable layer"
icon_state = "rclg"
- item_state = "rclg"
ghetto = TRUE
diff --git a/code/game/objects/items/apc_frame.dm b/code/game/objects/items/apc_frame.dm
index 3b1d9a8096..1f6dff490d 100644
--- a/code/game/objects/items/apc_frame.dm
+++ b/code/game/objects/items/apc_frame.dm
@@ -66,8 +66,8 @@
if(iswallturf(T))
T.attackby(src, user, params)
- var/metal_amt = round(custom_materials[getmaterialref(/datum/material/iron)]/MINERAL_MATERIAL_AMOUNT)
- var/glass_amt = round(custom_materials[getmaterialref(/datum/material/glass)]/MINERAL_MATERIAL_AMOUNT)
+ var/metal_amt = round(custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)]/MINERAL_MATERIAL_AMOUNT)
+ var/glass_amt = round(custom_materials[SSmaterials.GetMaterialRef(/datum/material/glass)]/MINERAL_MATERIAL_AMOUNT)
if(istype(W, /obj/item/wrench) && (metal_amt || glass_amt))
to_chat(user, "You dismantle [src].")
diff --git a/code/game/objects/items/cigs_lighters.dm b/code/game/objects/items/cigs_lighters.dm
index ac666f04db..5b7c70b1b6 100644
--- a/code/game/objects/items/cigs_lighters.dm
+++ b/code/game/objects/items/cigs_lighters.dm
@@ -856,7 +856,7 @@ CIGARETTE PACKETS ARE IN FANCY.DM
if(prob(5))//small chance for the vape to break and deal damage if it's emagged
playsound(get_turf(src), 'sound/effects/pop_expl.ogg', 50, 0)
M.apply_damage(20, BURN, BODY_ZONE_HEAD)
- M.Knockdown(300, 1, 0)
+ M.DefaultCombatKnockdown(300, 1, 0)
var/datum/effect_system/spark_spread/sp = new /datum/effect_system/spark_spread
sp.set_up(5, 1, src)
sp.start()
diff --git a/code/game/objects/items/crayons.dm b/code/game/objects/items/crayons.dm
index f81268f1dc..f5b13d4e3e 100644
--- a/code/game/objects/items/crayons.dm
+++ b/code/game/objects/items/crayons.dm
@@ -694,7 +694,7 @@
C.blind_eyes(1)
if(C.get_eye_protection() <= 0) // no eye protection? ARGH IT BURNS.
C.confused = max(C.confused, 3)
- C.Knockdown(60)
+ C.DefaultCombatKnockdown(60)
if(ishuman(C) && actually_paints)
var/mob/living/carbon/human/H = C
H.lip_style = "spray_face"
diff --git a/code/game/objects/items/defib.dm b/code/game/objects/items/defib.dm
index b1e86d6643..3ac3347222 100644
--- a/code/game/objects/items/defib.dm
+++ b/code/game/objects/items/defib.dm
@@ -449,7 +449,7 @@
M.visible_message("[user] zaps [M] with [src]!", \
"[user] zaps [M] with [src]!")
M.adjustStaminaLoss(50)
- M.Knockdown(100)
+ M.DefaultCombatKnockdown(100)
M.updatehealth() //forces health update before next life tick
playsound(src, 'sound/machines/defib_zap.ogg', 50, 1, -1)
M.emote("gasp")
@@ -506,7 +506,7 @@
H.set_heartattack(TRUE)
H.apply_damage(50, BURN, BODY_ZONE_CHEST)
log_combat(user, H, "overloaded the heart of", defib)
- H.Knockdown(100)
+ H.DefaultCombatKnockdown(100)
H.Jitter(100)
if(req_defib)
defib.deductcharge(revivecost)
diff --git a/code/game/objects/items/devices/PDA/PDA.dm b/code/game/objects/items/devices/PDA/PDA.dm
index eed4f2ce80..2b76a925e8 100644
--- a/code/game/objects/items/devices/PDA/PDA.dm
+++ b/code/game/objects/items/devices/PDA/PDA.dm
@@ -9,7 +9,6 @@ GLOBAL_LIST_EMPTY(PDAs)
#define PDA_SCANNER_HALOGEN 4
#define PDA_SCANNER_GAS 5
#define PDA_SPAM_DELAY 2 MINUTES
-#define PDA_STANDARD_OVERLAYS list("pda-r", "blank", "id_overlay", "insert_overlay", "light_overlay", "pai_overlay")
//pda icon overlays list defines
#define PDA_OVERLAY_ALERT 1
@@ -33,14 +32,14 @@ GLOBAL_LIST_EMPTY(PDAs)
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 100)
resistance_flags = FIRE_PROOF | ACID_PROOF
-
//Main variables
var/owner = null // String name of owner
var/default_cartridge = 0 // Access level defined by cartridge
var/obj/item/cartridge/cartridge = null //current cartridge
var/mode = 0 //Controls what menu the PDA will display. 0 is hub; the rest are either built in or based on cartridge.
var/list/overlays_icons = list('icons/obj/pda_alt.dmi' = list("pda-r", "screen_default", "id_overlay", "insert_overlay", "light_overlay", "pai_overlay"))
- var/current_overlays = PDA_STANDARD_OVERLAYS
+ var/static/list/standard_overlays_icons = list("pda-r", "blank", "id_overlay", "insert_overlay", "light_overlay", "pai_overlay")
+ var/list/current_overlays //set on Initialize.
//variables exclusively used on 'update_overlays' (which should never be called directly, and 'update_icon' doesn't use args anyway)
var/new_overlays = FALSE
@@ -164,7 +163,7 @@ GLOBAL_LIST_EMPTY(PDAs)
overlays_x_offset = new_offsets[1]
overlays_y_offset = new_offsets[2]
if(!(icon in overlays_icons))
- current_overlays = PDA_STANDARD_OVERLAYS
+ current_overlays = standard_overlays_icons
return
current_overlays = overlays_icons[icon]
@@ -228,8 +227,11 @@ GLOBAL_LIST_EMPTY(PDAs)
if(new_overlays)
set_new_overlays()
. += new_alert ? current_overlays[PDA_OVERLAY_ALERT] : current_overlays[PDA_OVERLAY_SCREEN]
- var/mutable_appearance/overlay = new()
+ var/screen_state = new_alert ? current_overlays[PDA_OVERLAY_ALERT] : current_overlays[PDA_OVERLAY_SCREEN]
+ var/mutable_appearance/overlay = mutable_appearance(icon, screen_state)
overlay.pixel_x = overlays_x_offset
+ overlay.pixel_y = overlays_y_offset
+ . += overlay
if(id)
overlay.icon_state = current_overlays[PDA_OVERLAY_ID]
. += new /mutable_appearance(overlay)
@@ -469,7 +471,7 @@ GLOBAL_LIST_EMPTY(PDAs)
var/mob/living/U = usr
//Looking for master was kind of pointless since PDAs don't appear to have one.
- if(usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK) && !href_list["close"])
+ if(usr.canUseTopic(src, BE_CLOSE, FALSE, NO_TK, FALSE) && !href_list["close"])
add_fingerprint(U)
U.set_machine(src)
@@ -757,7 +759,7 @@ GLOBAL_LIST_EMPTY(PDAs)
var/t = stripped_input(U, "Please enter message", name)
if (!t || toff)
return
- if(!U.canUseTopic(src, BE_CLOSE))
+ if(!U.canUseTopic(src, BE_CLOSE, FALSE, NO_TK, FALSE))
return
if(emped)
t = Gibberish(t, 100)
@@ -1223,7 +1225,6 @@ GLOBAL_LIST_EMPTY(PDAs)
#undef PDA_SCANNER_HALOGEN
#undef PDA_SCANNER_GAS
#undef PDA_SPAM_DELAY
-#undef PDA_STANDARD_OVERLAYS
#undef PDA_OVERLAY_ALERT
#undef PDA_OVERLAY_SCREEN
diff --git a/code/game/objects/items/devices/PDA/PDA_types.dm b/code/game/objects/items/devices/PDA/PDA_types.dm
index b604bec258..23ebaec3c2 100644
--- a/code/game/objects/items/devices/PDA/PDA_types.dm
+++ b/code/game/objects/items/devices/PDA/PDA_types.dm
@@ -193,8 +193,6 @@
/obj/item/pda/curator
name = "curator PDA"
icon_state = "pda-library"
- overlays_icons = list('icons/obj/pda.dmi' = list("pda-r-library","blank","id_overlay","insert_overlay", "light_overlay", "pai_overlay"),
- 'icons/obj/pda_alt.dmi' = list("pda-r","screen_default","id_overlay","insert_overlay", "light_overlay", "pai_overlay"))
current_overlays = list("pda-r-library","blank","id_overlay","insert_overlay", "light_overlay", "pai_overlay")
default_cartridge = /obj/item/cartridge/curator
inserted_item = /obj/item/pen/fountain
diff --git a/code/game/objects/items/devices/laserpointer.dm b/code/game/objects/items/devices/laserpointer.dm
index 5b23f6f169..a3cfdb9177 100644
--- a/code/game/objects/items/devices/laserpointer.dm
+++ b/code/game/objects/items/devices/laserpointer.dm
@@ -116,7 +116,7 @@
//chance to actually hit the eyes depends on internal component
if(prob(effectchance * diode.rating))
S.flash_act(affect_silicon = 1)
- S.Knockdown(rand(100,200))
+ S.DefaultCombatKnockdown(rand(100,200))
to_chat(S, "Your sensors were overloaded by a laser!")
outmsg = "You overload [S] by shining [src] at [S.p_their()] sensors."
else
@@ -152,8 +152,7 @@
if(prob(50))
C.visible_message("[C] pounces on the light!","LIGHT!")
C.Move(targloc)
- C.resting = TRUE
- C.update_canmove()
+ C.set_resting(TRUE)
else
C.visible_message("[C] looks uninterested in your games.","You spot [user] shining [src] at you. How insulting!")
diff --git a/code/game/objects/items/devices/radio/electropack.dm b/code/game/objects/items/devices/radio/electropack.dm
index a173453f1c..914f2a149a 100644
--- a/code/game/objects/items/devices/radio/electropack.dm
+++ b/code/game/objects/items/devices/radio/electropack.dm
@@ -118,7 +118,7 @@
s.set_up(3, 1, L)
s.start()
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
if(master)
master.receive_signal()
@@ -192,7 +192,7 @@ Code:
s.set_up(3, 1, L)
s.start()
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
if(master)
master.receive_signal()
diff --git a/code/game/objects/items/devices/scanners.dm b/code/game/objects/items/devices/scanners.dm
index 1b8058e3d4..556080168f 100644
--- a/code/game/objects/items/devices/scanners.dm
+++ b/code/game/objects/items/devices/scanners.dm
@@ -484,7 +484,8 @@ SLIME SCANNER
set name = "Switch Verbosity"
set category = "Object"
- if(usr.stat || !usr.canmove || usr.restrained())
+ var/mob/living/L = usr
+ if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
return
mode = !mode
diff --git a/code/game/objects/items/devices/traitordevices.dm b/code/game/objects/items/devices/traitordevices.dm
index 1d42198a23..4bab5a5bcd 100644
--- a/code/game/objects/items/devices/traitordevices.dm
+++ b/code/game/objects/items/devices/traitordevices.dm
@@ -44,7 +44,7 @@ effective or pretty fucking useless.
for(var/mob/living/carbon/human/M in urange(10, user, 1))
if(prob(50))
- M.Knockdown(rand(200,400))
+ M.DefaultCombatKnockdown(rand(200,400))
to_chat(M, "You feel a tremendous, paralyzing wave flood your mind.")
else
diff --git a/code/game/objects/items/granters.dm b/code/game/objects/items/granters.dm
index 24fc1043d8..0907a18fdd 100644
--- a/code/game/objects/items/granters.dm
+++ b/code/game/objects/items/granters.dm
@@ -294,7 +294,7 @@
/obj/item/book/granter/spell/knock/recoil(mob/living/user)
..()
to_chat(user,"You're knocked down!")
- user.Knockdown(40)
+ user.DefaultCombatKnockdown(40)
/obj/item/book/granter/spell/barnyard
spell = /obj/effect/proc_holder/spell/targeted/barnyardcurse
diff --git a/code/game/objects/items/grenades/flashbang.dm b/code/game/objects/items/grenades/flashbang.dm
index 67036bd604..6f79df28fe 100644
--- a/code/game/objects/items/grenades/flashbang.dm
+++ b/code/game/objects/items/grenades/flashbang.dm
@@ -31,7 +31,7 @@
M.show_message("BANG", MSG_AUDIBLE)
var/distance = get_dist(get_turf(M), source)
if(!distance || loc == M || loc == M.loc) //Stop allahu akbarring rooms with this.
- M.Knockdown(200)
+ M.DefaultCombatKnockdown(200)
M.soundbang_act(1, 200, 10, 15)
else
M.soundbang_act(1, max(200/max(1,distance), 60), rand(0, 5))
@@ -41,4 +41,4 @@
return
var/distance = get_dist(get_turf(M), source)
if(M.flash_act(affect_silicon = 1))
- M.Knockdown(max(200/max(1,distance), 60))
+ M.DefaultCombatKnockdown(max(200/max(1,distance), 60))
diff --git a/code/game/objects/items/handcuffs.dm b/code/game/objects/items/handcuffs.dm
index b4074737e5..ee25cbb985 100644
--- a/code/game/objects/items/handcuffs.dm
+++ b/code/game/objects/items/handcuffs.dm
@@ -349,7 +349,7 @@
C.update_inv_legcuffed()
SSblackbox.record_feedback("tally", "handcuffs", 1, type)
to_chat(C, "\The [src] ensnares you!")
- C.Knockdown(knockdown)
+ C.DefaultCombatKnockdown(knockdown)
/obj/item/restraints/legcuffs/bola/tactical//traitor variant
name = "reinforced bola"
diff --git a/code/game/objects/items/his_grace.dm b/code/game/objects/items/his_grace.dm
index da572d4d61..c961134244 100644
--- a/code/game/objects/items/his_grace.dm
+++ b/code/game/objects/items/his_grace.dm
@@ -92,7 +92,7 @@
master.emote("scream")
master.remove_status_effect(STATUS_EFFECT_HISGRACE)
REMOVE_TRAIT(src, TRAIT_NODROP, HIS_GRACE_TRAIT)
- master.Knockdown(60)
+ master.DefaultCombatKnockdown(60)
master.adjustBruteLoss(master.maxHealth)
playsound(master, 'sound/effects/splat.ogg', 100, 0)
else
diff --git a/code/game/objects/items/holy_weapons.dm b/code/game/objects/items/holy_weapons.dm
index 45abd4fb49..4d275e2034 100644
--- a/code/game/objects/items/holy_weapons.dm
+++ b/code/game/objects/items/holy_weapons.dm
@@ -64,16 +64,16 @@
else
playsound(src, 'sound/machines/buzz-sigh.ogg', 40, 1)
-/obj/item/holybeacon/proc/beacon_armor(mob/M)
+/obj/item/holybeacon/proc/beacon_armor(mob/living/L)
var/list/holy_armor_list = typesof(/obj/item/storage/box/holy)
var/list/display_names = list()
for(var/V in holy_armor_list)
var/atom/A = V
display_names += list(initial(A.name) = A)
- var/choice = input(M,"What holy armor kit would you like to order?","Holy Armor Theme") as null|anything in display_names
- var/turf/T = get_turf(M)
- if(!T || QDELETED(src) || !choice || M.stat || !in_range(M, src) || M.restrained() || !M.canmove || GLOB.holy_armor_type)
+ var/choice = input(L,"What holy armor kit would you like to order?","Holy Armor Theme") as null|anything in display_names
+ var/turf/T = get_turf(src)
+ if(!T || QDELETED(src) || !choice || !CHECK_MOBILITY(L, MOBILITY_USE) || !in_range(L, src) || GLOB.holy_armor_type)
return
var/index = display_names.Find(choice)
@@ -86,7 +86,7 @@
if(holy_armor_box)
qdel(src)
- M.put_in_hands(holy_armor_box)
+ L.put_in_hands(holy_armor_box)
/obj/item/storage/box/holy
name = "Templar Kit"
@@ -244,7 +244,7 @@
if(user.mind && (user.mind.isholy) && !reskinned)
reskin_holy_weapon(user)
-/obj/item/nullrod/proc/reskin_holy_weapon(mob/M)
+/obj/item/nullrod/proc/reskin_holy_weapon(mob/living/L)
if(GLOB.holy_weapon_type)
return
var/obj/item/holy_weapon
@@ -255,8 +255,8 @@
if (initial(rodtype.chaplain_spawnable))
display_names[initial(rodtype.name)] = rodtype
- var/choice = input(M,"What theme would you like for your holy weapon?","Holy Weapon Theme") as null|anything in display_names
- if(QDELETED(src) || !choice || M.stat || !in_range(M, src) || M.restrained() || !M.canmove || reskinned)
+ var/choice = input(L, "What theme would you like for your holy weapon?","Holy Weapon Theme") as null|anything in display_names
+ if(QDELETED(src) || !choice || !in_range(L, src) || !CHECK_MOBILITY(L, MOBILITY_USE) || reskinned)
return
var/A = display_names[choice] // This needs to be on a separate var as list member access is not allowed for new
@@ -269,7 +269,7 @@
if(holy_weapon)
holy_weapon.reskinned = TRUE
qdel(src)
- M.put_in_active_hand(holy_weapon)
+ L.put_in_active_hand(holy_weapon)
/obj/item/nullrod/proc/jedi_spin(mob/living/user)
for(var/i in list(NORTH,SOUTH,EAST,WEST,EAST,SOUTH,NORTH,SOUTH,EAST,WEST,EAST,SOUTH))
@@ -674,7 +674,7 @@
add_fingerprint(user)
if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
to_chat(user, "You club yourself over the head with [src].")
- user.Knockdown(60)
+ user.DefaultCombatKnockdown(60)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.apply_damage(2*force, BRUTE, BODY_ZONE_HEAD)
diff --git a/code/game/objects/items/hot_potato.dm b/code/game/objects/items/hot_potato.dm
index 8f1d968991..5f74830c99 100644
--- a/code/game/objects/items/hot_potato.dm
+++ b/code/game/objects/items/hot_potato.dm
@@ -71,8 +71,7 @@
if(stimulant)
if(isliving(loc))
var/mob/living/L = loc
- L.SetStun(0)
- L.SetKnockdown(0)
+ L.SetAllImmobility(0)
L.SetSleeping(0)
L.SetUnconscious(0)
L.reagents.add_reagent(/datum/reagent/medicine/muscle_stimulant, CLAMP(5 - L.reagents.get_reagent_amount(/datum/reagent/medicine/muscle_stimulant), 0, 5)) //If you don't have legs or get bola'd, tough luck!
diff --git a/code/game/objects/items/implants/implant_explosive.dm b/code/game/objects/items/implants/implant_explosive.dm
index bf8d215a11..370924063d 100644
--- a/code/game/objects/items/implants/implant_explosive.dm
+++ b/code/game/objects/items/implants/implant_explosive.dm
@@ -78,7 +78,7 @@
return
if(message && imp_in.stat == CONSCIOUS)
imp_in.visible_message("[imp_in] doubles over in pain!")
- imp_in.Knockdown(140)
+ imp_in.DefaultCombatKnockdown(140)
/obj/item/implant/explosive/proc/boom_goes_the_weasel()
explosion(get_turf(imp_in ? imp_in : src), heavy, medium, weak, weak, flame_range = weak)
diff --git a/code/game/objects/items/kitchen.dm b/code/game/objects/items/kitchen.dm
index 22a8d2c92a..5f3524d1c3 100644
--- a/code/game/objects/items/kitchen.dm
+++ b/code/game/objects/items/kitchen.dm
@@ -138,6 +138,12 @@
throwforce = 15
custom_materials = null
+/obj/item/kitchen/knife/combat/bone/plastic
+ name = "plastic knife"
+ desc = "A plastic knife. Rather harmless to anything."
+ force = 1
+ bayonet = FALSE
+
/obj/item/kitchen/knife/combat/cyborg
name = "cyborg knife"
icon = 'icons/obj/items_cyborg.dmi'
diff --git a/code/game/objects/items/melee/energy.dm b/code/game/objects/items/melee/energy.dm
index 405e3737d0..aba07c9120 100644
--- a/code/game/objects/items/melee/energy.dm
+++ b/code/game/objects/items/melee/energy.dm
@@ -7,7 +7,6 @@
var/brightness_on = 3
total_mass = 0.4 //Survival flashlights typically weigh around 5 ounces.
-
/obj/item/melee/transforming/energy/Initialize()
. = ..()
total_mass_on = (total_mass_on ? total_mass_on : (w_class_on * 0.75))
@@ -107,8 +106,12 @@
/obj/item/melee/transforming/energy/sword/transform_weapon(mob/living/user, supress_message_text)
. = ..()
- if(. && active && item_color)
- icon_state = "sword[item_color]"
+ if(active)
+ if(. && item_color)
+ icon_state = "sword[item_color]"
+ AddElement(/datum/element/sword_point)
+ else
+ RemoveElement(/datum/element/sword_point)
/obj/item/melee/transforming/energy/sword/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(active)
@@ -267,11 +270,6 @@
altafterattack(A, user, TRUE, params)
return TRUE
-/obj/item/melee/transforming/energy/sword/cx/altafterattack(atom/target, mob/living/carbon/user, proximity_flag, click_parameters) //does right click memes
- if(istype(user))
- user.visible_message("[user] points the tip of [src] at [target].", "You point the tip of [src] at [target].")
- return TRUE
-
/obj/item/melee/transforming/energy/sword/cx/transform_weapon(mob/living/user, supress_message_text)
active = !active //I'd use a ..() here but it'd inherit from the regular esword's proc instead, so SPAGHETTI CODE
if(active) //also I'd need to rip out the iconstate changing bits
diff --git a/code/game/objects/items/melee/misc.dm b/code/game/objects/items/melee/misc.dm
index 20df761643..3dcf6d36e7 100644
--- a/code/game/objects/items/melee/misc.dm
+++ b/code/game/objects/items/melee/misc.dm
@@ -73,6 +73,7 @@
/obj/item/melee/sabre/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 30, 95, 5) //fast and effective, but as a sword, it might damage the results.
+ AddElement(/datum/element/sword_point)
/obj/item/melee/sabre/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(attack_type == PROJECTILE_ATTACK)
@@ -246,7 +247,7 @@
add_fingerprint(user)
if((HAS_TRAIT(user, TRAIT_CLUMSY)) && prob(50))
to_chat(user, "You club yourself over the head.")
- user.Knockdown(60 * force)
+ user.DefaultCombatKnockdown(60 * force)
if(ishuman(user))
var/mob/living/carbon/human/H = user
H.apply_damage(2*force, BRUTE, BODY_ZONE_HEAD)
@@ -287,7 +288,7 @@
if(stun_animation)
user.do_attack_animation(target)
playsound(get_turf(src), on_stun_sound, 75, 1, -1)
- target.Knockdown(softstun_ds, TRUE, FALSE, hardstun_ds, stam_dmg)
+ target.DefaultCombatKnockdown(softstun_ds, TRUE, FALSE, hardstun_ds, stam_dmg)
additional_effects_carbon(target, user)
log_combat(user, target, "stunned", src)
add_fingerprint(user)
@@ -620,7 +621,7 @@
item_state = "mace_greyscale"
lefthand_file = 'icons/mob/inhands/weapons/melee_lefthand.dmi'
righthand_file = 'icons/mob/inhands/weapons/melee_righthand.dmi'
- material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR //Material type changes the prefix as well as the color.
+ material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS //Material type changes the prefix as well as the color.
custom_materials = list(/datum/material/iron = 12000) //Defaults to an Iron Mace.
slot_flags = ITEM_SLOT_BELT
force = 14
diff --git a/code/game/objects/items/pneumaticCannon.dm b/code/game/objects/items/pneumaticCannon.dm
index dae4c9a137..342f756ffc 100644
--- a/code/game/objects/items/pneumaticCannon.dm
+++ b/code/game/objects/items/pneumaticCannon.dm
@@ -168,7 +168,7 @@
if(pressureSetting >= 3 && iscarbon(user))
var/mob/living/carbon/C = user
C.visible_message("[C] is thrown down by the force of the cannon!", "[src] slams into your shoulder, knocking you down!")
- C.Knockdown(60)
+ C.DefaultCombatKnockdown(60)
/obj/item/pneumatic_cannon/proc/fire_items(turf/target, mob/user)
if(fire_mode == PCANNON_FIREALL)
diff --git a/code/game/objects/items/religion.dm b/code/game/objects/items/religion.dm
index ac490b0122..cc466d73fc 100644
--- a/code/game/objects/items/religion.dm
+++ b/code/game/objects/items/religion.dm
@@ -64,8 +64,7 @@
/obj/item/banner/proc/inspiration(mob/living/carbon/human/H)
H.adjustBruteLoss(-15)
H.adjustFireLoss(-15)
- H.AdjustStun(-40)
- H.AdjustKnockdown(-40)
+ H.AdjustAllImmobility(-40)
H.AdjustUnconscious(-40)
playsound(H, 'sound/magic/staff_healing.ogg', 25, FALSE)
diff --git a/code/game/objects/items/robot/robot_items.dm b/code/game/objects/items/robot/robot_items.dm
index 48c16190d9..d3e966f2fa 100644
--- a/code/game/objects/items/robot/robot_items.dm
+++ b/code/game/objects/items/robot/robot_items.dm
@@ -20,7 +20,7 @@
return
user.do_attack_animation(M)
- M.Knockdown(100)
+ M.DefaultCombatKnockdown(100)
M.apply_effect(EFFECT_STUTTER, 5)
M.visible_message("[user] has prodded [M] with [src]!", \
@@ -81,8 +81,7 @@
user.visible_message("[user] hugs [M] to make [M.p_them()] feel better!", \
"You hug [M] to make [M.p_them()] feel better!")
if(M.resting && !M.recoveringstam)
- M.resting = FALSE
- M.update_canmove()
+ M.set_resting(FALSE, TRUE)
else
user.visible_message("[user] pets [M]!", \
"You pet [M]!")
@@ -100,9 +99,8 @@
else
user.visible_message("[user] hugs [M] in a firm bear-hug! [M] looks uncomfortable...", \
"You hug [M] firmly to make [M.p_them()] feel better! [M] looks uncomfortable...")
- if(M.resting && !M.recoveringstam)
- M.resting = FALSE
- M.update_canmove()
+ if(!CHECK_MOBILITY(M, MOBILITY_STAND) && !M.recoveringstam)
+ M.set_resting(FALSE, TRUE)
else
user.visible_message("[user] bops [M] on the head!", \
"You bop [M] on the head!")
@@ -114,7 +112,6 @@
M.electrocute_act(5, "[user]", safety = 1)
user.visible_message("[user] electrocutes [M] with [user.p_their()] touch!", \
"You electrocute [M] with your touch!")
- M.update_canmove()
else
if(!iscyborg(M))
M.adjustFireLoss(10)
@@ -326,7 +323,7 @@
C.stuttering += 10
C.Jitter(10)
if(2)
- C.Knockdown(40)
+ C.DefaultCombatKnockdown(40)
C.confused += 10
C.stuttering += 15
C.Jitter(25)
diff --git a/code/game/objects/items/robot/robot_parts.dm b/code/game/objects/items/robot/robot_parts.dm
index 54f0dc600d..6621095b72 100644
--- a/code/game/objects/items/robot/robot_parts.dm
+++ b/code/game/objects/items/robot/robot_parts.dm
@@ -317,8 +317,7 @@
O.robot_suit = src
if(!locomotion)
- O.lockcharge = 1
- O.update_canmove()
+ O.SetLockdown(TRUE)
to_chat(O, "Error: Servo motors unresponsive.")
else
@@ -356,8 +355,7 @@
forceMove(O)
O.robot_suit = src
if(!locomotion)
- O.lockcharge = TRUE
- O.update_canmove()
+ O.SetLockdown(TRUE)
else if(istype(W, /obj/item/pen))
to_chat(user, "You need to use a multitool to name [src]!")
diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm
index 18568b3d0f..56af03139a 100644
--- a/code/game/objects/items/robot/robot_upgrades.dm
+++ b/code/game/objects/items/robot/robot_upgrades.dm
@@ -577,7 +577,7 @@
return FALSE
R.notransform = TRUE
- var/prev_lockcharge = R.lockcharge
+ var/prev_locked_down = R.locked_down
R.SetLockdown(1)
R.anchored = TRUE
var/datum/effect_system/smoke_spread/smoke = new
@@ -587,7 +587,7 @@
for(var/i in 1 to 4)
playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1)
sleep(12)
- if(!prev_lockcharge)
+ if(!prev_locked_down)
R.SetLockdown(0)
R.anchored = FALSE
R.notransform = FALSE
diff --git a/code/game/objects/items/shields.dm b/code/game/objects/items/shields.dm
index 4f5f264c0e..07f4cb4e40 100644
--- a/code/game/objects/items/shields.dm
+++ b/code/game/objects/items/shields.dm
@@ -237,3 +237,19 @@
w_class = WEIGHT_CLASS_HUGE
item_flags = SLOWS_WHILE_IN_HAND
transparent = FALSE
+
+/obj/item/shield/riot/implant
+ name = "riot tower shield"
+ desc = "A massive shield that can block a lot of attacks and can take a lot of abuse before breaking." //It cant break unless it is removed from the implant
+ item_state = "metal"
+ icon_state = "metal"
+ icon = 'icons/obj/items_and_weapons.dmi'
+ block_chance = 30 //May be big but hard to move around to block.
+ slowdown = 1
+ transparent = FALSE
+ item_flags = SLOWS_WHILE_IN_HAND
+
+/obj/item/shield/riot/implant/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
+ if(attack_type == PROJECTILE_ATTACK)
+ final_block_chance = 60 //Massive shield
+ return ..()
diff --git a/code/game/objects/items/stacks/sheets/sheet_types.dm b/code/game/objects/items/stacks/sheets/sheet_types.dm
index 0eefb88417..d6c9a94273 100644
--- a/code/game/objects/items/stacks/sheets/sheet_types.dm
+++ b/code/game/objects/items/stacks/sheets/sheet_types.dm
@@ -33,6 +33,12 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
new /datum/stack_recipe("sofa (corner)", /obj/structure/chair/sofa/corner, one_per_turf = TRUE, on_floor = TRUE), \
)), \
//END OF CIT CHANGES
+ new/datum/stack_recipe_list("fancy sofas", list( \
+ new /datum/stack_recipe("sofa (middle)", /obj/structure/chair/sofa/corp, one_per_turf = TRUE, on_floor = TRUE), \
+ new /datum/stack_recipe("sofa (left)", /obj/structure/chair/sofa/corp/left, one_per_turf = TRUE, on_floor = TRUE), \
+ new /datum/stack_recipe("sofa (right)", /obj/structure/chair/sofa/corp/right, one_per_turf = TRUE, on_floor = TRUE), \
+ new /datum/stack_recipe("sofa (corner)", /obj/structure/chair/sofa/corp/corner, one_per_turf = TRUE, on_floor = TRUE), \
+ )), \
null, \
new/datum/stack_recipe_list("office chairs", list( \
new/datum/stack_recipe("dark office chair", /obj/structure/chair/office/dark, 5, one_per_turf = TRUE, on_floor = TRUE), \
@@ -42,8 +48,10 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
new/datum/stack_recipe("beige comfy chair", /obj/structure/chair/comfy/beige, 2, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("black comfy chair", /obj/structure/chair/comfy/black, 2, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("brown comfy chair", /obj/structure/chair/comfy/brown, 2, one_per_turf = TRUE, on_floor = TRUE), \
+ new/datum/stack_recipe("green comfy chair", /obj/structure/chair/comfy/green, 2, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("lime comfy chair", /obj/structure/chair/comfy/lime, 2, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("teal comfy chair", /obj/structure/chair/comfy/teal, 2, one_per_turf = TRUE, on_floor = TRUE), \
+ new/datum/stack_recipe("purple comfy chair", /obj/structure/chair/comfy/purple, 2, one_per_turf = TRUE, on_floor = TRUE), \
)), \
null, \
new/datum/stack_recipe("rack parts", /obj/item/rack_parts), \
@@ -96,6 +104,21 @@ GLOBAL_LIST_INIT(metal_recipes, list ( \
new/datum/stack_recipe("extinguisher cabinet frame", /obj/item/wallframe/extinguisher_cabinet, 2), \
new/datum/stack_recipe("button frame", /obj/item/wallframe/button, 1), \
null, \
+ new /datum/stack_recipe_list("chess pieces", list( \
+ new /datum/stack_recipe("White Pawn", /obj/structure/chess/whitepawn, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("White Rook", /obj/structure/chess/whiterook, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("White Knight", /obj/structure/chess/whiteknight, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("White Bishop", /obj/structure/chess/whitebishop, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("White Queen", /obj/structure/chess/whitequeen, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("White King", /obj/structure/chess/whiteking, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("Black Pawn", /obj/structure/chess/blackpawn, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("Black Rook", /obj/structure/chess/blackrook, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("Black Knight", /obj/structure/chess/blackknight, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("Black Bishop", /obj/structure/chess/blackbishop, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("Black Queen", /obj/structure/chess/blackqueen, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ new /datum/stack_recipe("Black King", /obj/structure/chess/blackking, 2, time = 10, one_per_turf = 1, on_floor = 1), \
+ )), \
+ null, \
new/datum/stack_recipe("iron door", /obj/structure/mineral_door/iron, 20, one_per_turf = TRUE, on_floor = TRUE), \
new/datum/stack_recipe("floodlight frame", /obj/structure/floodlight_frame, 5, one_per_turf = TRUE, on_floor = TRUE), \
))
@@ -347,6 +370,7 @@ GLOBAL_LIST_INIT(cloth_recipes, list ( \
new/datum/stack_recipe("black gloves", /obj/item/clothing/gloves/color/black, 3), \
null, \
new/datum/stack_recipe("blindfold", /obj/item/clothing/glasses/sunglasses/blindfold, 2), \
+ null, \
))
/obj/item/stack/sheet/cloth
@@ -738,6 +762,7 @@ GLOBAL_LIST_INIT(plastic_recipes, list(
new /datum/stack_recipe("opaque plastic flaps", /obj/structure/plasticflaps/opaque, 5, one_per_turf = TRUE, on_floor = TRUE, time = 40), \
new /datum/stack_recipe("water bottle", /obj/item/reagent_containers/glass/beaker/waterbottle/empty), \
new /datum/stack_recipe("large water bottle", /obj/item/reagent_containers/glass/beaker/waterbottle/large/empty,3), \
+ new /datum/stack_recipe("shower curtain", /obj/structure/curtain, 10, time = 10, one_per_turf = 1, on_floor = 1), \
new /datum/stack_recipe("wet floor sign", /obj/item/caution, 2)))
/obj/item/stack/sheet/plastic
@@ -790,6 +815,7 @@ new /datum/stack_recipe("paper frame door", /obj/structure/mineral_door/paperfra
/obj/item/stack/sheet/cotton
name = "raw cotton bundle"
desc = "A bundle of raw cotton ready to be spun on the loom."
+ max_amount = 80
singular_name = "raw cotton ball"
icon_state = "sheet-cotton"
is_fabric = TRUE
diff --git a/code/game/objects/items/stacks/stack.dm b/code/game/objects/items/stacks/stack.dm
index f07b9bfd33..f707c02ce9 100644
--- a/code/game/objects/items/stacks/stack.dm
+++ b/code/game/objects/items/stacks/stack.dm
@@ -48,7 +48,7 @@
merge_type = type
if(custom_materials && custom_materials.len)
for(var/i in custom_materials)
- custom_materials[getmaterialref(i)] = mats_per_stack * amount
+ custom_materials[SSmaterials.GetMaterialRef(i)] = mats_per_stack * amount
. = ..()
if(merge)
for(var/obj/item/stack/S in loc)
@@ -57,7 +57,7 @@
var/list/temp_recipes = get_main_recipes()
recipes = temp_recipes.Copy()
if(material_type)
- var/datum/material/M = getmaterialref(material_type) //First/main material
+ var/datum/material/M = SSmaterials.GetMaterialRef(material_type) //First/main material
for(var/i in M.categories)
switch(i)
if(MAT_CATEGORY_RIGID)
@@ -225,7 +225,7 @@
if(R.applies_mats && custom_materials && custom_materials.len)
var/list/used_materials = list()
for(var/i in custom_materials)
- used_materials[getmaterialref(i)] = R.req_amount / R.res_amount * (MINERAL_MATERIAL_AMOUNT / custom_materials.len)
+ used_materials[SSmaterials.GetMaterialRef(i)] = R.req_amount / R.res_amount * (MINERAL_MATERIAL_AMOUNT / custom_materials.len)
O.set_custom_materials(used_materials)
//START: oh fuck i'm so sorry
@@ -347,7 +347,7 @@
src.amount += amount
if(custom_materials && custom_materials.len)
for(var/i in custom_materials)
- custom_materials[getmaterialref(i)] = MINERAL_MATERIAL_AMOUNT * src.amount
+ custom_materials[SSmaterials.GetMaterialRef(i)] = MINERAL_MATERIAL_AMOUNT * src.amount
set_custom_materials() //Refresh
update_icon()
update_weight()
diff --git a/code/game/objects/items/storage/bags.dm b/code/game/objects/items/storage/bags.dm
index b2fbbc8117..7a6e1e3db6 100644
--- a/code/game/objects/items/storage/bags.dm
+++ b/code/game/objects/items/storage/bags.dm
@@ -246,7 +246,8 @@
set name = "Activate Seed Extraction"
set category = "Object"
set desc = "Activate to convert your plants into plantable seeds."
- if(usr.stat || !usr.canmove || usr.restrained())
+ var/mob/living/L = usr
+ if(istype(L) && !CHECK_MOBILITY(L, MOBILITY_USE))
return
for(var/obj/item/O in contents)
seedify(O, 1)
@@ -353,7 +354,7 @@
if(ishuman(M) || ismonkey(M))
if(prob(10))
- M.Knockdown(40)
+ M.DefaultCombatKnockdown(40)
update_icon()
/obj/item/storage/bag/tray/update_overlays()
diff --git a/code/game/objects/items/storage/fancy.dm b/code/game/objects/items/storage/fancy.dm
index b4fe6b8f85..f2c50b359e 100644
--- a/code/game/objects/items/storage/fancy.dm
+++ b/code/game/objects/items/storage/fancy.dm
@@ -170,7 +170,7 @@
. = ..()
if(!fancy_open || !contents.len)
return
- . *= "[icon_state]_open"
+ . += "[icon_state]_open"
var/cig_position = 1
for(var/C in contents)
var/mutable_appearance/inserted_overlay = mutable_appearance(icon)
diff --git a/code/game/objects/items/stunbaton.dm b/code/game/objects/items/stunbaton.dm
index c48122fb0e..78ba6d4f5f 100644
--- a/code/game/objects/items/stunbaton.dm
+++ b/code/game/objects/items/stunbaton.dm
@@ -191,7 +191,7 @@
if(!disarming)
if(knockdown)
- L.Knockdown(50, override_stamdmg = 0) //knockdown
+ L.DefaultCombatKnockdown(50, override_stamdmg = 0) //knockdown
L.adjustStaminaLoss(stunpwr)
else
L.drop_all_held_items() //no knockdown/stamina damage, instead disarm.
@@ -218,7 +218,7 @@
user.visible_message("[user] accidentally hits [user.p_them()]self with [src]!", \
"You accidentally hit yourself with [src]!")
SEND_SIGNAL(user, COMSIG_LIVING_MINOR_SHOCK)
- user.Knockdown(stamforce*6)
+ user.DefaultCombatKnockdown(stamforce*6)
playsound(loc, 'sound/weapons/egloves.ogg', 50, 1, -1)
deductcharge(hitcost)
diff --git a/code/game/objects/items/teleprod.dm b/code/game/objects/items/teleprod.dm
index bab4d6a488..63bde36976 100644
--- a/code/game/objects/items/teleprod.dm
+++ b/code/game/objects/items/teleprod.dm
@@ -16,7 +16,7 @@
user.visible_message("[user] accidentally hits [user.p_them()]self with [src]!", \
"You accidentally hit yourself with [src]!")
SEND_SIGNAL(user, COMSIG_LIVING_MINOR_SHOCK)
- user.Knockdown(stamforce * 6)
+ user.DefaultCombatKnockdown(stamforce * 6)
playsound(loc, 'sound/weapons/egloves.ogg', 50, 1, -1)
if(do_teleport(user, get_turf(user), 50, channel = TELEPORT_CHANNEL_BLUESPACE))
deductcharge(hitcost)
diff --git a/code/game/objects/items/toys.dm b/code/game/objects/items/toys.dm
index 1a5f97c4e0..ba51fa3d65 100644
--- a/code/game/objects/items/toys.dm
+++ b/code/game/objects/items/toys.dm
@@ -228,26 +228,39 @@
var/hacked = FALSE
total_mass = 0.4
var/total_mass_on = TOTAL_MASS_TOY_SWORD
+ var/activation_sound = 'sound/weapons/saberon.ogg'
+ var/deactivation_sound = 'sound/weapons/saberoff.ogg'
+ var/activation_message = "You extend the plastic blade with a quick flick of your wrist."
+ var/deactivation_message = "You push the plastic blade back down into the handle."
+ var/transform_volume = 20
/obj/item/toy/sword/attack_self(mob/user)
- active = !( active )
+ active = !active
if (active)
- to_chat(user, "You extend the plastic blade with a quick flick of your wrist.")
- playsound(user, 'sound/weapons/saberon.ogg', 20, 1)
+ to_chat(user, "[activation_message]")
+ playsound(user, activation_sound, transform_volume, 1)
+ w_class = WEIGHT_CLASS_BULKY
+ AddElement(/datum/element/sword_point)
+ else
+ to_chat(user, "[deactivation_message]")
+ playsound(user, deactivation_sound, transform_volume, 1)
+ w_class = WEIGHT_CLASS_SMALL
+ RemoveElement(/datum/element/sword_point)
+
+ update_icon()
+ add_fingerprint(user)
+
+/obj/item/toy/sword/update_icon_state()
+ if(active)
if(hacked)
icon_state = "swordrainbow"
item_state = "swordrainbow"
else
icon_state = "swordblue"
item_state = "swordblue"
- w_class = WEIGHT_CLASS_BULKY
else
- to_chat(user, "You push the plastic blade back down into the handle.")
- playsound(user, 'sound/weapons/saberoff.ogg', 20, 1)
icon_state = "sword0"
item_state = "sword0"
- w_class = WEIGHT_CLASS_SMALL
- add_fingerprint(user)
// Copied from /obj/item/melee/transforming/energy/sword/attackby
/obj/item/toy/sword/attackby(obj/item/W, mob/living/user, params)
@@ -270,7 +283,7 @@
to_chat(user, "RNBW_ENGAGE")
if(active)
- icon_state = "swordrainbow"
+ update_icon()
user.update_inv_hands()
else
to_chat(user, "It's already fabulous!")
@@ -290,38 +303,24 @@
w_class = WEIGHT_CLASS_SMALL
attack_verb = list("poked", "jabbed", "hit")
light_color = "#37FFF7"
+ activation_sound = 'sound/weapons/nebon.ogg'
+ deactivation_sound = 'sound/weapons/neboff.ogg'
+ transform_volume = 50
+ activation_message = "You activate the holographic blade with a press of a button."
+ deactivation_message = "You deactivate the holographic blade with a press of a button."
var/light_brightness = 3
actions_types = list()
-/obj/item/toy/sword/cx/alt_pre_attack(atom/A, mob/living/user, params) //checks if it can do right click memes
- altafterattack(A, user, TRUE, params)
- return TRUE
-
-/obj/item/toy/sword/cx/altafterattack(atom/target, mob/living/carbon/user, proximity_flag, click_parameters) //does right click memes
- if(istype(user))
- user.visible_message("[user] points the tip of [src] at [target].", "You point the tip of [src] at [target].")
- return TRUE
+/obj/item/toy/sword/cx/ComponentInitialize()
+ . = ..()
+ AddElement(/datum/element/update_icon_updates_onmob)
/obj/item/toy/sword/cx/attack_self(mob/user)
- active = !( active )
+ . = ..()
+ set_light(active ? light_brightness : 0)
- if (active)
- to_chat(user, "You activate the holographic blade with a press of a button.")
- playsound(user, 'sound/weapons/nebon.ogg', 50, 1)
- w_class = WEIGHT_CLASS_BULKY
- attack_verb = list("slashed", "stabbed", "ravaged")
- set_light(light_brightness)
- update_icon()
-
- else
- to_chat(user, "You deactivate the holographic blade with a press of a button.")
- playsound(user, 'sound/weapons/neboff.ogg', 50, 1)
- w_class = WEIGHT_CLASS_SMALL
- attack_verb = list("poked", "jabbed", "hit")
- set_light(0)
- update_icon()
-
- add_fingerprint(user)
+/obj/item/toy/sword/cx/update_icon_state()
+ return
/obj/item/toy/sword/cx/update_overlays()
. = ..()
@@ -1079,8 +1078,13 @@
else
return ..()
-/obj/item/toy/cards/singlecard/attack_self(mob/user)
- if(usr.stat || !ishuman(usr) || !usr.canmove || usr.restrained())
+/obj/item/toy/cards/singlecard/attack_self(mob/living/user)
+ . = ..()
+ if(.)
+ return
+ if(!ishuman(user))
+ return
+ if(!CHECK_MOBILITY(user, MOBILITY_USE))
return
Flip()
diff --git a/code/game/objects/items/twohanded.dm b/code/game/objects/items/twohanded.dm
index 23bd6ed359..11a06e149d 100644
--- a/code/game/objects/items/twohanded.dm
+++ b/code/game/objects/items/twohanded.dm
@@ -396,6 +396,7 @@
hitsound = 'sound/weapons/blade1.ogg'
START_PROCESSING(SSobj, src)
set_light(brightness_on)
+ AddElement(/datum/element/sword_point)
/obj/item/twohanded/dualsaber/unwield() //Specific unwield () to switch hitsounds.
sharpness = initial(sharpness)
@@ -405,6 +406,7 @@
hitsound = "swing_hit"
STOP_PROCESSING(SSobj, src)
set_light(0)
+ RemoveElement(/datum/element/sword_point)
/obj/item/twohanded/dualsaber/process()
if(wielded)
@@ -493,15 +495,6 @@
. = ..()
AddElement(/datum/element/update_icon_updates_onmob)
-/obj/item/twohanded/dualsaber/hypereutactic/alt_pre_attack(atom/A, mob/living/user, params) //checks if it can do right click memes
- altafterattack(A, user, TRUE, params)
- return TRUE
-
-/obj/item/twohanded/dualsaber/hypereutactic/altafterattack(atom/target, mob/living/user, proximity_flag, click_parameters) //does right click memes
- if(istype(user))
- user.visible_message("[user] points the tip of [src] at [target].", "You point the tip of [src] at [target].")
- return TRUE
-
/obj/item/twohanded/dualsaber/hypereutactic/update_icon_state()
return
@@ -605,6 +598,8 @@
/obj/item/twohanded/spear/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 100, 70) //decent in a pinch, but pretty bad.
+ AddComponent(/datum/component/jousting)
+ AddElement(/datum/element/sword_point)
/obj/item/twohanded/spear/attack_self(mob/user)
if(explosive)
@@ -630,10 +625,6 @@
return BRUTELOSS
return BRUTELOSS
-/obj/item/twohanded/spear/Initialize()
- . = ..()
- AddComponent(/datum/component/jousting)
-
/obj/item/twohanded/spear/examine(mob/user)
. = ..()
if(explosive)
@@ -818,6 +809,9 @@
armor = list("melee" = 0, "bullet" = 0, "laser" = 0, "energy" = 0, "bomb" = 0, "bio" = 0, "rad" = 0, "fire" = 100, "acid" = 30)
resistance_flags = FIRE_PROOF
+/obj/item/twohanded/pitchfork/Initialize(mapload)
+ AddElement(/datum/element/sword_point)
+
/obj/item/twohanded/pitchfork/demonic
name = "demonic pitchfork"
desc = "A red pitchfork, it looks like the work of the devil."
@@ -901,6 +895,7 @@
/obj/item/twohanded/vibro_weapon/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 20, 105)
+ AddElement(/datum/element/sword_point)
/obj/item/twohanded/vibro_weapon/hit_reaction(mob/living/carbon/human/owner, atom/movable/hitby, attack_text = "the attack", final_block_chance = 0, damage = 0, attack_type = MELEE_ATTACK)
if(wielded)
diff --git a/code/game/objects/items/weaponry.dm b/code/game/objects/items/weaponry.dm
index 7499d9de09..bc9c3255a6 100644
--- a/code/game/objects/items/weaponry.dm
+++ b/code/game/objects/items/weaponry.dm
@@ -74,6 +74,7 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
/obj/item/claymore/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 40, 105)
+ AddElement(/datum/element/sword_point)
/obj/item/claymore/suicide_act(mob/user)
user.visible_message("[user] is falling on [src]! It looks like [user.p_theyre()] trying to commit suicide!")
@@ -346,25 +347,6 @@ for further reading, please see: https://github.com/tgstation/tgstation/pull/301
user.visible_message("[user] is slitting [user.p_their()] own throat with [src]! It looks like [user.p_theyre()] trying to commit suicide!")
return (BRUTELOSS)
-/obj/item/switchblade/crafted
- icon_state = "switchblade_ms"
- desc = "A concealable spring-loaded knife."
- force = 2
- throwforce = 3
- extended_force = 15
- extended_throwforce = 18
- extended_icon_state = "switchblade_ext_ms"
- retracted_icon_state = "switchblade_ms"
-
-/obj/item/switchblade/crafted/attackby(obj/item/I, mob/user, params)
- . = ..()
- if(istype(I, /obj/item/stack/sheet/mineral/silver))
- icon_state = extended ? "switchblade_ext_msf" : "switchblade_msf"
- extended_icon_state = "switchblade_ext_msf"
- retracted_icon_state = "switchblade_msf"
- icon_state = "switchblade_msf"
- to_chat(user, "You use part of the silver to improve your Switchblade. Stylish!")
-
/obj/item/phone
name = "red phone"
desc = "Should anything ever go wrong..."
diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index 1d36b2b41b..e185defc0a 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -33,7 +33,7 @@
if(structureclimber && structureclimber != user)
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
- structureclimber.Knockdown(40)
+ structureclimber.DefaultCombatKnockdown(40)
structureclimber.visible_message("[structureclimber] has been knocked off [src].", "You're knocked off [src]!", "You see [structureclimber] get knocked off [src].")
/obj/structure/ui_act(action, params)
@@ -45,7 +45,8 @@
if(!climbable)
return
if(user == O && iscarbon(O))
- if(user.canmove)
+ var/mob/living/L = O
+ if(CHECK_MOBILITY(L, MOBILITY_MOVE))
climb_structure(user)
return
if(!istype(O, /obj/item) || user.get_active_held_item() != O)
diff --git a/code/game/objects/structures/beds_chairs/chair.dm b/code/game/objects/structures/beds_chairs/chair.dm
index 0d38f5eca6..e0c2d6e2c7 100644
--- a/code/game/objects/structures/beds_chairs/chair.dm
+++ b/code/game/objects/structures/beds_chairs/chair.dm
@@ -110,7 +110,7 @@
user.visible_message("[user] pulls [src] out from under [poordude].", "You pull [src] out from under [poordude].")
var/C = new item_chair(loc)
user.put_in_hands(C)
- poordude.Knockdown(20)//rip in peace
+ poordude.DefaultCombatKnockdown(20)//rip in peace
user.adjustStaminaLoss(5)
unbuckle_all_mobs(TRUE)
qdel(src)
@@ -153,7 +153,7 @@
///Material chair
/obj/structure/chair/greyscale
icon_state = "chair_greyscale"
- material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR
+ material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
item_chair = /obj/item/chair/greyscale
buildstacktype = null //Custom mats handle this
@@ -226,9 +226,15 @@
/obj/structure/chair/comfy/black
color = rgb(167,164,153)
+/obj/structure/chair/comfy/green
+ color = rgb(81,173,106)
+
/obj/structure/chair/comfy/lime
color = rgb(255,251,0)
+/obj/structure/chair/comfy/purple
+ color = rgb(255,50,230)
+
/obj/structure/chair/comfy/plywood
name = "plywood chair"
desc = "A relaxing plywood chair."
@@ -371,13 +377,13 @@
if(iscarbon(target))
var/mob/living/carbon/C = target
if(C.health < C.maxHealth*0.5)
- C.Knockdown(20)
+ C.DefaultCombatKnockdown(20)
smash(user)
/obj/item/chair/greyscale
icon_state = "chair_greyscale_toppled"
item_state = "chair_greyscale"
- material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR
+ material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
origin_type = /obj/structure/chair/greyscale
/obj/item/chair/stool
@@ -576,40 +582,3 @@
. = ..()
if(has_gravity())
playsound(src, 'sound/machines/clockcult/integration_cog_install.ogg', 50, TRUE)
-
-/obj/structure/chair/sofa
- name = "old ratty sofa"
- icon_state = "sofamiddle"
- icon = 'icons/obj/sofa.dmi'
- buildstackamount = 1
- var/mutable_appearance/armrest
-
-/obj/structure/chair/sofa/Initialize()
- armrest = mutable_appearance(icon, "[icon_state]_armrest", ABOVE_MOB_LAYER)
- return ..()
-
-/obj/structure/chair/sofa/post_buckle_mob(mob/living/M)
- . = ..()
- update_armrest()
-
-/obj/structure/chair/sofa/proc/update_armrest()
- if(has_buckled_mobs())
- add_overlay(armrest)
- else
- cut_overlay(armrest)
-
-/obj/structure/chair/sofa/post_unbuckle_mob()
- . = ..()
- update_armrest()
-
-/obj/structure/chair/sofa/left
- icon_state = "sofaend_left"
-
-/obj/structure/chair/sofa/right
- icon_state = "sofaend_right"
-
-/obj/structure/chair/sofa/corner
- icon_state = "sofacorner"
-
-/obj/structure/chair/sofa/corner/handle_layer() //only the armrest/back of this chair should cover the mob.
- return
diff --git a/code/game/objects/structures/beds_chairs/pew.dm b/code/game/objects/structures/beds_chairs/pew.dm
index 65440fb5d8..ec257a9898 100644
--- a/code/game/objects/structures/beds_chairs/pew.dm
+++ b/code/game/objects/structures/beds_chairs/pew.dm
@@ -10,7 +10,7 @@
item_chair = null
/obj/structure/chair/pew/left
- name = "left wooden pew end"
+ name = "wooden pew end"
icon_state = "pewend_left"
var/mutable_appearance/leftpewarmrest
@@ -41,7 +41,7 @@
update_leftpewarmrest()
/obj/structure/chair/pew/right
- name = "left wooden pew end"
+ name = "wooden pew end"
icon_state = "pewend_right"
var/mutable_appearance/rightpewarmrest
diff --git a/code/game/objects/structures/beds_chairs/sofa.dm b/code/game/objects/structures/beds_chairs/sofa.dm
new file mode 100644
index 0000000000..e138e4d314
--- /dev/null
+++ b/code/game/objects/structures/beds_chairs/sofa.dm
@@ -0,0 +1,52 @@
+/obj/structure/chair/sofa
+ name = "old ratty sofa"
+ icon_state = "sofamiddle"
+ icon = 'icons/obj/sofa.dmi'
+ buildstackamount = 1
+ var/mutable_appearance/armrest
+
+/obj/structure/chair/sofa/Initialize()
+ armrest = mutable_appearance(icon, "[icon_state]_armrest", ABOVE_MOB_LAYER)
+ return ..()
+
+/obj/structure/chair/sofa/post_buckle_mob(mob/living/M)
+ . = ..()
+ update_armrest()
+
+/obj/structure/chair/sofa/proc/update_armrest()
+ if(has_buckled_mobs())
+ add_overlay(armrest)
+ else
+ cut_overlay(armrest)
+
+/obj/structure/chair/sofa/post_unbuckle_mob()
+ . = ..()
+ update_armrest()
+
+/obj/structure/chair/sofa/left
+ icon_state = "sofaend_left"
+
+/obj/structure/chair/sofa/right
+ icon_state = "sofaend_right"
+
+/obj/structure/chair/sofa/corner
+ icon_state = "sofacorner"
+
+/obj/structure/chair/sofa/corner/handle_layer() //only the armrest/back of this chair should cover the mob.
+ return
+
+// Credit for the sprites goes to CEV Eris. The sprites were taken from Hyper Station and modified to fit with armrests which were also added.
+
+/obj/structure/chair/sofa/corp
+ name = "sofa"
+ desc = "Soft, cushy and cozy. These sofas reek of bland faceless corporatism, but they aren't old and ratty at least."
+ icon_state = "corp_sofamiddle"
+
+/obj/structure/chair/sofa/corp/left
+ icon_state = "corp_sofaend_left"
+
+/obj/structure/chair/sofa/corp/right
+ icon_state = "corp_sofaend_right"
+
+/obj/structure/chair/sofa/corp/corner
+ icon_state = "corp_sofacorner"
diff --git a/code/game/objects/structures/chess.dm b/code/game/objects/structures/chess.dm
new file mode 100644
index 0000000000..8254405fee
--- /dev/null
+++ b/code/game/objects/structures/chess.dm
@@ -0,0 +1,76 @@
+/obj/structure/chess
+ anchored = FALSE
+ density = FALSE
+ icon = 'icons/obj/chess.dmi'
+ icon_state = "singularity_s1"
+ name = "Singularity"
+ desc = "You've just been pranked by the Syndicate Chess Grandmaster! Report this to CentCom."
+ max_integrity = 100
+
+/obj/structure/chess/wrench_act(mob/user, obj/item/tool)
+ to_chat(user, "You take apart the chess piece.")
+ var/obj/item/stack/sheet/metal/M = new (drop_location(), 2)
+ M.add_fingerprint(user)
+ tool.play_tool_sound(src)
+ qdel(src)
+ return TRUE
+
+/obj/structure/chess/whitepawn
+ name = "\improper White Pawn"
+ desc = "A white pawn chess piece. Get accused of cheating when executing a sick En Passant."
+ icon_state = "white_pawn"
+
+/obj/structure/chess/whiterook
+ name = "\improper White Rook"
+ desc = "A white rook chess piece. Also known as a castle. Can move any number of tiles in a straight line. It has a special move called castling."
+ icon_state = "white_rook"
+
+/obj/structure/chess/whiteknight
+ name = "\improper White Knight"
+ desc = "A white knight chess piece. Hah. It can hop over other pieces, moving in L shapes."
+ icon_state = "white_knight"
+
+/obj/structure/chess/whitebishop
+ name = "\improper White Bishop"
+ desc = "A white bishop chess piece. It can move any number of tiles in a diagonal line."
+ icon_state = "white_bishop"
+
+/obj/structure/chess/whitequeen
+ name = "\improper White Queen"
+ desc = "A white queen chess piece. It can move any number of tiles in diagonal and straight lines."
+ icon_state = "white_queen"
+
+/obj/structure/chess/whiteking
+ name = "\improper White King"
+ desc = "A white king chess piece. It can move any tile in one direction."
+ icon_state = "white_king"
+
+/obj/structure/chess/blackpawn
+ name = "\improper Black Pawn"
+ desc = "A black pawn chess piece. Get accused of cheating when executing a sick En Passant."
+ icon_state = "black_pawn"
+
+/obj/structure/chess/blackrook
+ name = "\improper Black Rook"
+ desc = "A black rook chess piece. Also known as a castle. Can move any number of tiles in a straight line. It has a special move called castling."
+ icon_state = "black_rook"
+
+/obj/structure/chess/blackknight
+ name = "\improper Black Knight"
+ desc = "A black knight chess piece. It can hop over other pieces, moving in L shapes."
+ icon_state = "black_knight"
+
+/obj/structure/chess/blackbishop
+ name = "\improper Black Bishop"
+ desc = "A black bishop chess piece. It can move any number of tiles in a diagonal line."
+ icon_state = "black_bishop"
+
+/obj/structure/chess/blackqueen
+ name = "\improper Black Queen"
+ desc = "A black queen chess piece. It can move any number of tiles in diagonal and straight lines."
+ icon_state = "black_queen"
+
+/obj/structure/chess/blackking
+ name = "\improper Black King"
+ desc = "A black king chess piece. It can move one tile in any direction."
+ icon_state = "black_king"
\ No newline at end of file
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index f95f900a48..c932dd96e8 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -431,7 +431,7 @@
"You hear a loud metal bang.")
var/mob/living/L = O
if(!issilicon(L))
- L.Knockdown(40)
+ L.DefaultCombatKnockdown(40)
O.forceMove(T)
close()
else
@@ -474,8 +474,9 @@
set category = "Object"
set name = "Toggle Open"
- if(!usr.canmove || usr.stat || usr.restrained())
- return
+ var/mob/living/L = usr
+ if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
+ return FALSE
if(iscarbon(usr) || issilicon(usr) || isdrone(usr))
return attack_hand(usr)
@@ -510,7 +511,7 @@
user.visible_message("[src] begins to shake violently!", \
"You lean on the back of [src] and start pushing the door open... (this will take about [DisplayTimeText(breakout_time)].)", \
"You hear banging from [src].")
- if(do_after(user,(breakout_time), target = src))
+ if(do_after(user,(breakout_time), target = src, required_mobility_flags = MOBILITY_RESIST))
if(!user || user.stat != CONSCIOUS || user.loc != src || opened || (!locked && !welded) )
return
//we check after a while whether there is a point of resisting anymore and whether the user is capable of resisting
@@ -603,12 +604,12 @@
step_towards(user, T2)
T1 = get_turf(user)
if(T1 == T2)
- user.resting = TRUE //so people can jump into crates without slamming the lid on their head
+ user.set_resting(TRUE, TRUE)
if(!close(user))
to_chat(user, "You can't get [src] to close!")
- user.resting = FALSE
+ user.set_resting(FALSE, TRUE)
return
- user.resting = FALSE
+ user.set_resting(FALSE, TRUE)
togglelock(user)
T1.visible_message("[user] dives into [src]!")
diff --git a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
index 645d1e5d7a..ae2e1a070a 100644
--- a/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
+++ b/code/game/objects/structures/crates_lockers/closets/cardboardbox.dm
@@ -18,8 +18,8 @@
var/egged = 0
var/use_mob_movespeed = FALSE //Citadel adds snowflake box handling
-/obj/structure/closet/cardboard/relaymove(mob/user, direction)
- if(opened || move_delay || user.stat || user.IsStun() || user.IsKnockdown() || user.IsUnconscious() || !isturf(loc) || !has_gravity(loc))
+/obj/structure/closet/cardboard/relaymove(mob/living/user, direction)
+ if(opened || move_delay || !CHECK_MOBILITY(user, MOBILITY_MOVE) || !isturf(loc) || !has_gravity(loc))
return
move_delay = TRUE
var/oldloc = loc
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index b14303984e..4f6d6729fc 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -83,9 +83,12 @@
desc = "It's a burial receptacle for the dearly departed."
icon_state = "coffin"
resistance_flags = FLAMMABLE
+ can_weld_shut = FALSE
+ breakout_time = 200
max_integrity = 70
material_drop = /obj/item/stack/sheet/mineral/wood
material_drop_amount = 5
+ var/pryLidTimer = 250
/obj/structure/closet/crate/coffin/examine(mob/user)
. = ..()
diff --git a/code/game/objects/structures/kitchen_spike.dm b/code/game/objects/structures/kitchen_spike.dm
index ebac89579b..05a7e1c958 100644
--- a/code/game/objects/structures/kitchen_spike.dm
+++ b/code/game/objects/structures/kitchen_spike.dm
@@ -139,7 +139,7 @@
src.visible_message(text("[M] falls free of [src]!"))
unbuckle_mob(M,force=1)
M.emote("scream")
- M.AdjustKnockdown(20)
+ M.DefaultCombatKnockdown(20)
/obj/structure/kitchenspike/Destroy()
if(has_buckled_mobs())
diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm
index df6d033af4..bdc7825feb 100644
--- a/code/game/objects/structures/musician.dm
+++ b/code/game/objects/structures/musician.dm
@@ -1,7 +1,7 @@
#define MUSICIAN_HEARCHECK_MINDELAY 4
#define MUSIC_MAXLINES 600
-#define MUSIC_MAXLINECHARS 50
+#define MUSIC_MAXLINECHARS 150
/datum/song
var/name = "Untitled"
@@ -82,7 +82,7 @@
/datum/song/proc/shouldStopPlaying(mob/user)
if(instrumentObj)
- if(!user.canUseTopic(instrumentObj))
+ if(!user.canUseTopic(instrumentObj, TRUE, FALSE, FALSE, FALSE))
return TRUE
return !instrumentObj.anchored // add special cases to stop in subclasses
else
@@ -220,7 +220,7 @@
updateDialog(usr) // make sure updates when complete
/datum/song/Topic(href, href_list)
- if(!usr.canUseTopic(instrumentObj))
+ if(!usr.canUseTopic(instrumentObj, TRUE, FALSE, FALSE, FALSE))
usr << browse(null, "window=instrument")
usr.unset_machine()
return
diff --git a/code/game/objects/structures/petrified_statue.dm b/code/game/objects/structures/petrified_statue.dm
index 65ffb7e2e5..a8a5a577c2 100644
--- a/code/game/objects/structures/petrified_statue.dm
+++ b/code/game/objects/structures/petrified_statue.dm
@@ -49,7 +49,7 @@
if(S.mind)
if(petrified_mob)
S.mind.transfer_to(petrified_mob)
- petrified_mob.Knockdown(100)
+ petrified_mob.DefaultCombatKnockdown(100)
to_chat(petrified_mob, "You slowly come back to your senses. You are in control of yourself again!")
qdel(S)
diff --git a/code/game/objects/structures/table_frames.dm b/code/game/objects/structures/table_frames.dm
index e3cd053d94..7e2922279b 100644
--- a/code/game/objects/structures/table_frames.dm
+++ b/code/game/objects/structures/table_frames.dm
@@ -41,7 +41,7 @@
make_new_table(material.tableVariant)
else
if(material.get_amount() < 1)
- to_chat(user, "You need one metal sheet to do this!")
+ to_chat(user, "You need one sheet to do this!")
return
to_chat(user, "You start adding [material] to [src]...")
if(do_after(user, 20, target = src) && material.use(1))
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index 4eba21b8f9..550c0216c6 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -109,8 +109,7 @@
/obj/structure/table/proc/tableplace(mob/living/user, mob/living/pushed_mob)
pushed_mob.forceMove(src.loc)
- pushed_mob.resting = TRUE
- pushed_mob.update_canmove()
+ pushed_mob.set_resting(TRUE, FALSE)
pushed_mob.visible_message("[user] places [pushed_mob] onto [src].", \
"[user] places [pushed_mob] onto [src].")
log_combat(user, pushed_mob, "placed")
@@ -128,7 +127,7 @@
pushed_mob.pass_flags &= ~PASSTABLE
if(pushed_mob.loc != loc) //Something prevented the tabling
return
- pushed_mob.Knockdown(40)
+ pushed_mob.DefaultCombatKnockdown(40)
pushed_mob.visible_message("[user] slams [pushed_mob] onto [src]!", \
"[user] slams you onto [src]!")
log_combat(user, pushed_mob, "tabled", null, "onto [src]")
@@ -138,11 +137,11 @@
SEND_SIGNAL(H, COMSIG_ADD_MOOD_EVENT, "table", /datum/mood_event/table)
/obj/structure/table/shove_act(mob/living/target, mob/living/user)
- if(!target.resting)
- target.Knockdown(SHOVE_KNOCKDOWN_TABLE)
+ if(CHECK_MOBILITY(target, MOBILITY_STAND))
+ target.DefaultCombatKnockdown(SHOVE_KNOCKDOWN_TABLE)
user.visible_message("[user.name] shoves [target.name] onto \the [src]!",
"You shove [target.name] onto \the [src]!", null, COMBAT_MESSAGE_RANGE)
- target.forceMove(src.loc)
+ target.forceMove(loc)
log_combat(user, target, "shoved", "onto [src] (table)")
return TRUE
@@ -212,7 +211,7 @@
/obj/structure/table/greyscale
icon = 'icons/obj/smooth_structures/table_greyscale.dmi'
icon_state = "table"
- material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR
+ material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
buildstack = null //No buildstack, so generate from mat datums
/*
@@ -270,7 +269,7 @@
debris -= AM
if(istype(AM, /obj/item/shard))
AM.throw_impact(L)
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
qdel(src)
/obj/structure/table/glass/deconstruct(disassembled = TRUE, wrench_disassembly = 0)
@@ -568,23 +567,20 @@
break
/obj/structure/table/optable/tablepush(mob/living/user, mob/living/pushed_mob)
- pushed_mob.forceMove(src.loc)
- pushed_mob.resting = 1
- pushed_mob.update_canmove()
+ pushed_mob.forceMove(loc)
+ pushed_mob.set_resting(TRUE, TRUE)
visible_message("[user] has laid [pushed_mob] on [src].")
check_patient()
/obj/structure/table/optable/proc/check_patient()
- var/mob/M = locate(/mob/living/carbon/human, loc)
- if(M)
- if(M.resting)
- patient = M
- return 1
+ var/mob/living/carbon/human/H = locate() in loc
+ if(H)
+ if(!CHECK_MOBILITY(H, MOBILITY_STAND))
+ patient = H
+ return TRUE
else
patient = null
- return 0
-
-
+ return FALSE
/*
* Racks
@@ -644,7 +640,7 @@
. = ..()
if(.)
return
- if(user.IsKnockdown() || user.resting || user.lying || user.get_num_legs() < 2)
+ if(CHECK_MULTIPLE_BITFIELDS(user.mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) || user.get_num_legs() < 2)
return
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src, ATTACK_EFFECT_KICK)
diff --git a/code/game/objects/structures/transit_tubes/station.dm b/code/game/objects/structures/transit_tubes/station.dm
index c386726f34..17ca178cd9 100644
--- a/code/game/objects/structures/transit_tubes/station.dm
+++ b/code/game/objects/structures/transit_tubes/station.dm
@@ -43,10 +43,10 @@
//pod insertion
-/obj/structure/transit_tube/station/MouseDrop_T(obj/structure/c_transit_tube_pod/R, mob/user)
- if(!user.canmove || user.stat || user.restrained())
+/obj/structure/transit_tube/station/MouseDrop_T(obj/structure/c_transit_tube_pod/R, mob/living/user)
+ if(!istype(user) || !CHECK_MOBILITY(user, MOBILITY_USE))
return
- if (!istype(R) || get_dist(user, src) > 1 || get_dist(src,R) > 1)
+ if(!istype(R) || get_dist(user, src) > 1 || get_dist(src,R) > 1)
return
for(var/obj/structure/transit_tube_pod/pod in loc)
return //no fun allowed
@@ -74,7 +74,7 @@
pod.visible_message("[user] starts putting [GM] into the [pod]!")
if(do_after(user, 15, target = src))
if(open_status == STATION_TUBE_OPEN && GM && user.grab_state >= GRAB_AGGRESSIVE && user.pulling == GM && !GM.buckled && !GM.has_buckled_mobs())
- GM.Knockdown(100)
+ GM.DefaultCombatKnockdown(100)
src.Bumped(GM)
break
else
diff --git a/code/game/objects/structures/traps.dm b/code/game/objects/structures/traps.dm
index 3f559382f0..fa9c052aa3 100644
--- a/code/game/objects/structures/traps.dm
+++ b/code/game/objects/structures/traps.dm
@@ -83,7 +83,7 @@
/obj/structure/trap/stun/trap_effect(mob/living/L)
L.electrocute_act(30, src, safety=1) // electrocute act does a message.
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
/obj/structure/trap/fire
name = "flame trap"
@@ -92,7 +92,7 @@
/obj/structure/trap/fire/trap_effect(mob/living/L)
to_chat(L, "Spontaneous combustion!")
- L.Knockdown(20)
+ L.DefaultCombatKnockdown(20)
/obj/structure/trap/fire/flare()
..()
@@ -106,7 +106,7 @@
/obj/structure/trap/chill/trap_effect(mob/living/L)
to_chat(L, "You're frozen solid!")
- L.Knockdown(20)
+ L.DefaultCombatKnockdown(20)
L.adjust_bodytemperature(-300)
L.apply_status_effect(/datum/status_effect/freon)
@@ -119,7 +119,7 @@
/obj/structure/trap/damage/trap_effect(mob/living/L)
to_chat(L, "The ground quakes beneath your feet!")
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
L.adjustBruteLoss(35)
/obj/structure/trap/damage/flare()
@@ -147,7 +147,7 @@
/obj/structure/trap/cult/trap_effect(mob/living/L)
to_chat(L, "With a crack, the hostile constructs come out of hiding, stunning you!")
L.electrocute_act(10, src, safety = TRUE) // electrocute act does a message.
- L.Knockdown(20)
+ L.DefaultCombatKnockdown(20)
new /mob/living/simple_animal/hostile/construct/proteon/hostile(loc)
new /mob/living/simple_animal/hostile/construct/proteon/hostile(loc)
- QDEL_IN(src, 30)
\ No newline at end of file
+ QDEL_IN(src, 30)
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index 359436dc2e..bdef4ab46d 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -529,7 +529,7 @@
if(B.cell.charge > 0 && B.status == 1)
flick("baton_active", src)
var/stunforce = B.stamforce
- user.Knockdown(stunforce * 2)
+ user.DefaultCombatKnockdown(stunforce * 2)
user.stuttering = stunforce/20
B.deductcharge(B.hitcost)
user.visible_message("[user] shocks [user.p_them()]self while attempting to wash the active [B.name]!", \
@@ -616,9 +616,10 @@
icon = 'icons/obj/watercloset.dmi'
icon_state = "open"
color = "#ACD1E9" //Default color, didn't bother hardcoding other colors, mappers can and should easily change it.
- alpha = 200 //Mappers can also just set this to 255 if they want curtains that can't be seen through
+ alpha = 200 //Mappers can also just set this to 255 if they want curtains that can't be seen through <- No longer necessary unless you don't want to see through it no matter what.
layer = SIGN_LAYER
anchored = TRUE
+ max_integrity = 25 //This makes cloth shower curtains as durable as a directional glass window. 300 integrity buildable shower curtains as a cover mechanic is a meta I don't want to see.
opacity = 0
density = FALSE
var/open = TRUE
@@ -633,12 +634,14 @@
layer = WALL_OBJ_LAYER
density = TRUE
open = FALSE
+ opacity = TRUE
else
icon_state = "open"
layer = SIGN_LAYER
density = FALSE
open = TRUE
+ opacity = FALSE
/obj/structure/curtain/attackby(obj/item/W, mob/user)
if (istype(W, /obj/item/toy/crayon))
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 7f039598cf..e824567b50 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -343,7 +343,8 @@
set name = "Flip Windoor Assembly"
set category = "Object"
set src in oview(1)
- if(usr.stat || !usr.canmove || usr.restrained())
+ var/mob/living/L = usr
+ if(!CHECK_MOBILITY(L, MOBILITY_PULL))
return
if(facing == "l")
@@ -354,4 +355,3 @@
to_chat(usr, "The windoor will now slide to the left.")
update_icon()
- return
diff --git a/code/game/sound.dm b/code/game/sound.dm
index 11e026109a..c285026d5b 100644
--- a/code/game/sound.dm
+++ b/code/game/sound.dm
@@ -1,7 +1,6 @@
/proc/playsound(atom/source, soundin, vol as num, vary, extrarange as num, falloff, frequency = null, channel = 0, pressure_affected = TRUE, ignore_walls = TRUE, soundenvwet = -10000, soundenvdry = 0)
if(isarea(source))
- throw EXCEPTION("playsound(): source is an area")
- return
+ CRASH("playsound(): source is an area")
var/turf/turf_source = get_turf(source)
diff --git a/code/game/turfs/open.dm b/code/game/turfs/open.dm
index c4c7ab2d7b..066249505d 100644
--- a/code/game/turfs/open.dm
+++ b/code/game/turfs/open.dm
@@ -272,7 +272,7 @@
var/olddir = C.dir
if(!(lube & SLIDE_ICE))
- C.Knockdown(knockdown_amount)
+ C.DefaultCombatKnockdown(knockdown_amount)
C.stop_pulling()
else
C.Stun(20)
diff --git a/code/modules/admin/admin_ranks.dm b/code/modules/admin/admin_ranks.dm
index b5127929a7..ef4abeb0ad 100644
--- a/code/modules/admin/admin_ranks.dm
+++ b/code/modules/admin/admin_ranks.dm
@@ -23,8 +23,7 @@ GLOBAL_PROTECT(protected_ranks)
name = init_name
if(!name)
qdel(src)
- throw EXCEPTION("Admin rank created without name.")
- return
+ CRASH("Admin rank created without name.")
if(init_rights)
rights = init_rights
include_rights = rights
diff --git a/code/modules/admin/holder2.dm b/code/modules/admin/holder2.dm
index 37fe2a41fc..1d0b6b2a79 100644
--- a/code/modules/admin/holder2.dm
+++ b/code/modules/admin/holder2.dm
@@ -39,12 +39,10 @@ GLOBAL_PROTECT(href_token)
return
if(!ckey)
QDEL_IN(src, 0)
- throw EXCEPTION("Admin datum created without a ckey")
- return
+ CRASH("Admin datum created without a ckey")
if(!istype(R))
QDEL_IN(src, 0)
- throw EXCEPTION("Admin datum created without a rank")
- return
+ CRASH("Admin datum created without a rank")
target = ckey
name = "[ckey]'s admin datum ([R])"
rank = R
diff --git a/code/modules/admin/verbs/bluespacearty.dm b/code/modules/admin/verbs/bluespacearty.dm
index 97248b572b..2910d6dd85 100644
--- a/code/modules/admin/verbs/bluespacearty.dm
+++ b/code/modules/admin/verbs/bluespacearty.dm
@@ -21,6 +21,6 @@
target.gib(1, 1)
else
target.adjustBruteLoss(min(99,(target.health - 1)))
- target.Knockdown(400)
+ target.DefaultCombatKnockdown(400)
target.stuttering = 20
diff --git a/code/modules/admin/verbs/borgpanel.dm b/code/modules/admin/verbs/borgpanel.dm
index c0445d588d..8cfd53b300 100644
--- a/code/modules/admin/verbs/borgpanel.dm
+++ b/code/modules/admin/verbs/borgpanel.dm
@@ -47,7 +47,7 @@
"emagged" = borg.emagged,
"active_module" = "[borg.module.type]",
"lawupdate" = borg.lawupdate,
- "lockdown" = borg.lockcharge,
+ "lockdown" = borg.locked_down,
"scrambledcodes" = borg.scrambledcodes
)
.["upgrades"] = list()
@@ -122,8 +122,8 @@
message_admins("[key_name_admin(user)] disabled lawsync on [ADMIN_LOOKUPFLW(borg)].")
log_admin("[key_name(user)] disabled lawsync on [key_name(borg)].")
if ("toggle_lockdown")
- borg.SetLockdown(!borg.lockcharge)
- if (borg.lockcharge)
+ borg.SetLockdown(!borg.locked_down)
+ if (borg.locked_down)
message_admins("[key_name_admin(user)] locked down [ADMIN_LOOKUPFLW(borg)].")
log_admin("[key_name(user)] locked down [key_name(borg)].")
else
diff --git a/code/modules/antagonists/abductor/equipment/abduction_gear.dm b/code/modules/antagonists/abductor/equipment/abduction_gear.dm
index 332329a221..c2a3f953f5 100644
--- a/code/modules/antagonists/abductor/equipment/abduction_gear.dm
+++ b/code/modules/antagonists/abductor/equipment/abduction_gear.dm
@@ -116,14 +116,13 @@
var/mob/living/carbon/human/M = loc
M.adjustStaminaLoss(-75)
M.SetUnconscious(0)
- M.SetStun(0)
- M.SetKnockdown(0)
+ M.SetAllImmobility(0)
combat_cooldown = 0
START_PROCESSING(SSobj, src)
/obj/item/clothing/suit/armor/abductor/vest/process()
combat_cooldown++
- if(combat_cooldown==initial(combat_cooldown))
+ if(combat_cooldown == initial(combat_cooldown))
STOP_PROCESSING(SSobj, src)
/obj/item/clothing/suit/armor/abductor/Destroy()
@@ -512,7 +511,7 @@
L.lastattackerckey = user.ckey
L.adjustStaminaLoss(35) //because previously it took 5-6 hits to actually "incapacitate" someone for the purposes of the sleep inducement
- L.Knockdown(140)
+ L.DefaultCombatKnockdown(140)
L.apply_effect(EFFECT_STUTTER, 7)
SEND_SIGNAL(L, COMSIG_LIVING_MINOR_SHOCK)
diff --git a/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm b/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm
index 182fcea0c2..261677a74b 100644
--- a/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm
+++ b/code/modules/antagonists/blob/blob/blobs/blob_mobs.dm
@@ -218,11 +218,16 @@
/mob/living/simple_animal/hostile/blob/blobbernaut/Initialize()
. = ..()
- if(!independent) //no pulling people deep into the blob
- verbs -= /mob/living/verb/pulled
- else
+ if(independent)
pass_flags &= ~PASSBLOB
+/mob/living/simple_animal/hostile/blob/blobbernaut/start_pulling(atom/movable/AM, state, force = pull_force, supress_message = FALSE)
+ if(!independent && ismob(AM))
+ if(!supress_message)
+ to_chat(src, "You are unable to grasp people in this form.")
+ return FALSE
+ return ..()
+
/mob/living/simple_animal/hostile/blob/blobbernaut/Life()
if(..())
var/list/blobs_in_area = range(2, src)
diff --git a/code/modules/antagonists/blob/blob/overmind.dm b/code/modules/antagonists/blob/blob/overmind.dm
index fe1c700014..18e13118fe 100644
--- a/code/modules/antagonists/blob/blob/overmind.dm
+++ b/code/modules/antagonists/blob/blob/overmind.dm
@@ -157,6 +157,9 @@ GLOBAL_LIST_EMPTY(blob_nodes)
BM.overmind = null
BM.update_icons()
GLOB.overminds -= src
+ blob_mobs = null
+ resource_blobs = null
+ blobs_legit = null
SSshuttle.clearHostileEnvironment(src)
diff --git a/code/modules/antagonists/blob/blob/theblob.dm b/code/modules/antagonists/blob/blob/theblob.dm
index 953b876b35..fc78f859f2 100644
--- a/code/modules/antagonists/blob/blob/theblob.dm
+++ b/code/modules/antagonists/blob/blob/theblob.dm
@@ -303,8 +303,7 @@
/obj/structure/blob/proc/change_to(type, controller)
if(!ispath(type))
- throw EXCEPTION("change_to(): invalid type for blob")
- return
+ CRASH("change_to(): invalid type for blob")
var/obj/structure/blob/B = new type(src.loc, controller)
B.creation_action()
B.update_icon()
diff --git a/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm b/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm
index 626ad43b10..507e1f2739 100644
--- a/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm
+++ b/code/modules/antagonists/bloodsucker/bloodsucker_powers.dm
@@ -96,7 +96,7 @@
// Incap?
if(must_be_capacitated)
var/mob/living/L = owner
- if (L.incapacitated(TRUE, TRUE) || L.resting && !can_be_immobilized)
+ if (L.incapacitated(TRUE, TRUE) || !CHECK_MOBILITY(L, MOBILITY_STAND) && !can_be_immobilized)
if(display_error)
to_chat(owner, "Not while you're incapacitated!")
return FALSE
diff --git a/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm b/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm
index b7c90523b6..b69b851990 100644
--- a/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm
+++ b/code/modules/antagonists/bloodsucker/items/bloodsucker_stake.dm
@@ -1,9 +1,5 @@
-
-
// organ_internal.dm -- /obj/item/organ
-
-
// Do I have a stake in my heart?
/mob/living/AmStaked()
var/obj/item/bodypart/BP = get_bodypart("chest")
@@ -13,16 +9,14 @@
if (istype(I,/obj/item/stake/))
return TRUE
return FALSE
+
/mob/proc/AmStaked()
return FALSE
-
/mob/living/proc/StakeCanKillMe()
return IsSleeping() || stat >= UNCONSCIOUS || blood_volume <= 0 || HAS_TRAIT(src, TRAIT_DEATHCOMA) // NOTE: You can't go to sleep in a coffin with a stake in you.
-
-///obj/item/weapon/melee/stake
-/obj/item/stake/
+/obj/item/stake
name = "wooden stake"
desc = "A simple wooden stake carved to a sharp point."
icon = 'icons/obj/items_and_weapons.dmi'
@@ -112,8 +106,7 @@
// Can this target be staked? If someone stands up before this is complete, it fails. Best used on someone stationary.
/mob/living/carbon/proc/can_be_staked()
- //return resting || IsKnockdown() || IsUnconscious() || (stat && (stat != SOFT_CRIT || pulledby)) || (has_trait(TRAIT_FAKEDEATH)) || resting || IsStun() || IsFrozen() || (pulledby && pulledby.grab_state >= GRAB_NECK)
- return (resting || lying || IsUnconscious() || pulledby && pulledby.grab_state >= GRAB_NECK)
+ return !CHECK_MOBILITY(src, MOBILITY_STAND)
// ABOVE: Taken from update_mobility() in living.dm
/obj/item/stake/hardened
diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm
index a25244c48d..debeee3775 100644
--- a/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm
+++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_coffin.dm
@@ -42,25 +42,18 @@
/obj/structure/closet/crate
var/mob/living/resident // This lets bloodsuckers claim any "closet" as a Coffin, so long as they could get into it and close it. This locks it in place, too.
-/obj/structure/closet/crate/coffin
- var/pryLidTimer = 250
- can_weld_shut = FALSE
- breakout_time = 200
-
-
/obj/structure/closet/crate/coffin/blackcoffin
name = "black coffin"
desc = "For those departed who are not so dear."
icon_state = "coffin"
icon = 'icons/obj/vamp_obj.dmi'
- can_weld_shut = FALSE
- resistance_flags = 0 // Start off with no bonuses.
open_sound = 'sound/bloodsucker/coffin_open.ogg'
close_sound = 'sound/bloodsucker/coffin_close.ogg'
breakout_time = 600
pryLidTimer = 400
resistance_flags = NONE
- integrity_failure = 70
+ max_integrity = 100
+ integrity_failure = 0.5
armor = list("melee" = 50, "bullet" = 20, "laser" = 30, "energy" = 0, "bomb" = 50, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 60)
/obj/structure/closet/crate/coffin/meatcoffin
@@ -68,8 +61,6 @@
desc = "When you're ready to meat your maker, the steaks can never be too high."
icon_state = "meatcoffin"
icon = 'icons/obj/vamp_obj.dmi'
- can_weld_shut = FALSE
- resistance_flags = 0 // Start off with no bonuses.
open_sound = 'sound/effects/footstep/slime1.ogg'
close_sound = 'sound/effects/footstep/slime1.ogg'
breakout_time = 200
@@ -77,24 +68,23 @@
resistance_flags = NONE
material_drop = /obj/item/reagent_containers/food/snacks/meat/slab
material_drop_amount = 3
- integrity_failure = 40
+ integrity_failure = 0.57
armor = list("melee" = 70, "bullet" = 10, "laser" = 10, "energy" = 0, "bomb" = 70, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 100)
-
+
/obj/structure/closet/crate/coffin/metalcoffin
name = "metal coffin"
desc = "A big metal sardine can inside of another big metal sardine can, in space."
icon_state = "metalcoffin"
icon = 'icons/obj/vamp_obj.dmi'
- can_weld_shut = FALSE
resistance_flags = FIRE_PROOF | LAVA_PROOF
open_sound = 'sound/effects/pressureplate.ogg'
close_sound = 'sound/effects/pressureplate.ogg'
breakout_time = 300
pryLidTimer = 200
- resistance_flags = NONE
material_drop = /obj/item/stack/sheet/metal
material_drop_amount = 5
- integrity_failure = 60
+ max_integrity = 200
+ integrity_failure = 0.25
armor = list("melee" = 40, "bullet" = 15, "laser" = 50, "energy" = 0, "bomb" = 10, "bio" = 0, "rad" = 0, "fire" = 70, "acid" = 60)
//////////////////////////////////////////////
diff --git a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm
index 9e46203483..db286dd6fe 100644
--- a/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm
+++ b/code/modules/antagonists/bloodsucker/objects/bloodsucker_crypt.dm
@@ -205,7 +205,7 @@
buckled_mob.pixel_y = buckled_mob.get_standard_pixel_y_offset(180)
src.visible_message(text("[buckled_mob][buckled_mob.stat==DEAD?"'s corpse":""] slides off of the rack."))
density = FALSE
- buckled_mob.AdjustKnockdown(30)
+ buckled_mob.DefaultCombatKnockdown(30)
update_icon()
useLock = FALSE // Failsafe
diff --git a/code/modules/antagonists/bloodsucker/powers/brawn.dm b/code/modules/antagonists/bloodsucker/powers/brawn.dm
index 712a15dff9..cf0393ff3a 100644
--- a/code/modules/antagonists/bloodsucker/powers/brawn.dm
+++ b/code/modules/antagonists/bloodsucker/powers/brawn.dm
@@ -72,8 +72,7 @@
if(rand(5 + powerlevel) >= 5)
target.visible_message("[user] lands a vicious punch, sending [target] away!", \
"[user] has landed a horrifying punch on you, sending you flying!!", null, COMBAT_MESSAGE_RANGE)
- target.Knockdown(min(5, rand(10, 10 * powerlevel)) )
-
+ target.DefaultCombatKnockdown(min(5, rand(10, 10 * powerlevel)) )
// Attack!
playsound(get_turf(target), 'sound/weapons/punch4.ogg', 60, 1, -1)
user.do_attack_animation(target, ATTACK_EFFECT_SMASH)
@@ -145,7 +144,7 @@
// Knock Down (if Living)
if (isliving(M))
var/mob/living/L = M
- L.Knockdown(pull_power * 10 + 20)
+ L.DefaultCombatKnockdown(pull_power * 10 + 20)
// Knock Back (before Knockdown, which probably cancels pull)
var/send_dir = get_dir(owner, M)
var/turf/T = get_ranged_target_turf(M, send_dir, pull_power)
diff --git a/code/modules/antagonists/bloodsucker/powers/feed.dm b/code/modules/antagonists/bloodsucker/powers/feed.dm
index f9ff31d94a..bbce221d91 100644
--- a/code/modules/antagonists/bloodsucker/powers/feed.dm
+++ b/code/modules/antagonists/bloodsucker/powers/feed.dm
@@ -306,7 +306,7 @@
// Bloodsuckers not affected by "the Kiss" of another vampire
if(!target.mind || !target.mind.has_antag_datum(ANTAG_DATUM_BLOODSUCKER))
target.Unconscious(50,0)
- target.Knockdown(40 + 5 * level_current,1)
+ target.DefaultCombatKnockdown(40 + 5 * level_current,1)
// NOTE: THis is based on level of power!
if(ishuman(target))
target.adjustStaminaLoss(5, forced = TRUE)// Base Stamina Damage
@@ -321,4 +321,4 @@
// My mouth is no longer full
REMOVE_TRAIT(owner, TRAIT_MUTE, "bloodsucker_feed")
// Let me move immediately
- user.update_canmove()
+ user.update_mobility()
diff --git a/code/modules/antagonists/bloodsucker/powers/go_home.dm b/code/modules/antagonists/bloodsucker/powers/go_home.dm
index 3fa8a07299..4788d7639e 100644
--- a/code/modules/antagonists/bloodsucker/powers/go_home.dm
+++ b/code/modules/antagonists/bloodsucker/powers/go_home.dm
@@ -100,8 +100,8 @@
var/mob/living/simple_animal/SA = pick(/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse,/mob/living/simple_animal/mouse, /mob/living/simple_animal/hostile/retaliate/bat) //prob(300) /mob/living/simple_animal/mouse,
new SA (owner.loc)
// TELEPORT: Move to Coffin & Close it!
+ user.set_resting(TRUE, TRUE, FALSE)
do_teleport(owner, bloodsuckerdatum.coffin, no_effects = TRUE, forced = TRUE, channel = TELEPORT_CHANNEL_QUANTUM)
- user.resting = TRUE
user.Stun(30,1)
// CLOSE LID: If fail, force me in.
if(!bloodsuckerdatum.coffin.close(owner))
diff --git a/code/modules/antagonists/bloodsucker/powers/haste.dm b/code/modules/antagonists/bloodsucker/powers/haste.dm
index 47c93b794e..143950b32f 100644
--- a/code/modules/antagonists/bloodsucker/powers/haste.dm
+++ b/code/modules/antagonists/bloodsucker/powers/haste.dm
@@ -76,16 +76,17 @@
sleep(speed)
UnregisterSignal(owner, COMSIG_MOVABLE_MOVED)
hit = null
- user.update_canmove()
+ user.update_mobility()
/datum/action/bloodsucker/targeted/haste/DeactivatePower(mob/living/user = owner, mob/living/target)
..() // activate = FALSE
- user.update_canmove()
+ user.update_mobility()
/datum/action/bloodsucker/targeted/haste/proc/on_move()
for(var/mob/living/L in dview(1, get_turf(owner)))
if(!hit[L] && (L != owner))
hit[L] = TRUE
playsound(L, "sound/weapons/punch[rand(1,4)].ogg", 15, 1, -1)
- L.Knockdown(10 + level_current * 5, override_hardstun = 0.1)
+ L.DefaultCombatKnockdown(10 + level_current * 5)
+ L.Paralyze(0.1)
L.spin(10, 1)
diff --git a/code/modules/antagonists/bloodsucker/powers/lunge.dm b/code/modules/antagonists/bloodsucker/powers/lunge.dm
index 12fc51d300..cc9363bbaf 100644
--- a/code/modules/antagonists/bloodsucker/powers/lunge.dm
+++ b/code/modules/antagonists/bloodsucker/powers/lunge.dm
@@ -52,6 +52,7 @@
// set waitfor = FALSE <---- DONT DO THIS!We WANT this power to hold up ClickWithPower(), so that we can unlock the power when it's done.
var/mob/living/carbon/target = A
var/turf/T = get_turf(target)
+ var/mob/living/L = owner
// Clear Vars
owner.pulling = null
// Will we Knock them Down?
@@ -63,7 +64,7 @@
owner.playsound_local(owner, 'sound/bloodsucker/lunge_warn.ogg', 60, FALSE, pressure_affected = FALSE) // audio feedback to the user
if(do_mob(owner, owner, 7, TRUE, TRUE))
walk_towards(owner, T, 0.1, 10) // yes i know i shouldn't use this but i don't know how to work in anything better
- if(get_turf(owner) != T && !(isliving(target) && target.Adjacent(owner)) && owner.incapacitated() && owner.resting)
+ if(get_turf(owner) != T && !(isliving(target) && target.Adjacent(owner)) && owner.incapacitated() && !CHECK_MOBILITY(L, MOBILITY_STAND))
var/send_dir = get_dir(owner, T)
new /datum/forced_movement(owner, get_ranged_target_turf(owner, send_dir, 1), 1, FALSE)
owner.spin(10)
@@ -84,4 +85,4 @@
/datum/action/bloodsucker/targeted/lunge/DeactivatePower(mob/living/user = owner, mob/living/target)
..() // activate = FALSE
- user.update_canmove()
+ user.update_mobility()
diff --git a/code/modules/antagonists/bloodsucker/powers/mesmerize.dm b/code/modules/antagonists/bloodsucker/powers/mesmerize.dm
index 8699e43854..d5354c1af9 100644
--- a/code/modules/antagonists/bloodsucker/powers/mesmerize.dm
+++ b/code/modules/antagonists/bloodsucker/powers/mesmerize.dm
@@ -82,7 +82,7 @@
to_chat(owner, "You must be facing your victim.")
return FALSE
// Check: Target facing me?
- if(!target.resting && !is_A_facing_B(target,owner))
+ if (CHECK_MOBILITY(target, MOBILITY_STAND) && !is_A_facing_B(target,owner))
if(display_error)
to_chat(owner, "Your victim must be facing you to see into your eyes.")
return FALSE
diff --git a/code/modules/antagonists/changeling/cellular_emporium.dm b/code/modules/antagonists/changeling/cellular_emporium.dm
index 3cf0a3ee25..b2c1a52a4a 100644
--- a/code/modules/antagonists/changeling/cellular_emporium.dm
+++ b/code/modules/antagonists/changeling/cellular_emporium.dm
@@ -81,7 +81,7 @@
if(istype(our_target, /datum/cellular_emporium))
cellular_emporium = our_target
else
- throw EXCEPTION("cellular_emporium action created with non emporium")
+ CRASH("cellular_emporium action created with non emporium")
/datum/action/innate/cellular_emporium/Activate()
cellular_emporium.ui_interact(owner)
diff --git a/code/modules/antagonists/changeling/powers/fakedeath.dm b/code/modules/antagonists/changeling/powers/fakedeath.dm
index 8ed5b5e39c..da626bcf1c 100644
--- a/code/modules/antagonists/changeling/powers/fakedeath.dm
+++ b/code/modules/antagonists/changeling/powers/fakedeath.dm
@@ -18,7 +18,6 @@
user.tod = STATION_TIME_TIMESTAMP("hh:mm:ss", world.time)
user.fakedeath("changeling") //play dead
user.update_stat()
- user.update_canmove()
addtimer(CALLBACK(src, .proc/ready_to_regenerate, user), LING_FAKEDEATH_TIME, TIMER_UNIQUE)
return TRUE
diff --git a/code/modules/antagonists/changeling/powers/headcrab.dm b/code/modules/antagonists/changeling/powers/headcrab.dm
index 4ef0d2f240..867f160081 100644
--- a/code/modules/antagonists/changeling/powers/headcrab.dm
+++ b/code/modules/antagonists/changeling/powers/headcrab.dm
@@ -30,7 +30,7 @@
H.confused += 3
for(var/mob/living/silicon/S in range(2,user))
to_chat(S, "Your sensors are disabled by a shower of blood!")
- S.Knockdown(60)
+ S.DefaultCombatKnockdown(60)
var/turf = get_turf(user)
user.gib()
. = TRUE
diff --git a/code/modules/antagonists/changeling/powers/shriek.dm b/code/modules/antagonists/changeling/powers/shriek.dm
index 65e58ae65b..3de220dbcb 100644
--- a/code/modules/antagonists/changeling/powers/shriek.dm
+++ b/code/modules/antagonists/changeling/powers/shriek.dm
@@ -24,7 +24,7 @@
if(issilicon(M))
SEND_SOUND(M, sound('sound/weapons/flash.ogg'))
- M.Knockdown(rand(100,200))
+ M.DefaultCombatKnockdown(rand(100,200))
for(var/obj/machinery/light/L in range(4, user))
L.on = 1
diff --git a/code/modules/antagonists/changeling/powers/strained_muscles.dm b/code/modules/antagonists/changeling/powers/strained_muscles.dm
index 1f25e06324..a98700683e 100644
--- a/code/modules/antagonists/changeling/powers/strained_muscles.dm
+++ b/code/modules/antagonists/changeling/powers/strained_muscles.dm
@@ -26,7 +26,7 @@
changeling.chem_recharge_slowdown -= 0.5
if(stacks >= 20)
to_chat(user, "We collapse in exhaustion.")
- user.Knockdown(60)
+ user.DefaultCombatKnockdown(60)
user.emote("gasp")
INVOKE_ASYNC(src, .proc/muscle_loop, user)
@@ -40,7 +40,7 @@
if(user.stat != CONSCIOUS || user.staminaloss >= 90)
active = !active
to_chat(user, "Our muscles relax without the energy to strengthen them.")
- user.Knockdown(40)
+ user.DefaultCombatKnockdown(40)
user.remove_movespeed_modifier(MOVESPEED_ID_CHANGELING_MUSCLES)
changeling.chem_recharge_slowdown -= 0.5
break
diff --git a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm
index eb7f83735d..1b4d26ac86 100644
--- a/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm
+++ b/code/modules/antagonists/clockcult/clock_effects/clock_sigils.dm
@@ -80,7 +80,7 @@
if(iscultist(L)) //No longer stuns cultists, instead sets them on fire and burns them
to_chat(L, "\"Watch your step, wretch.\"")
L.adjustFireLoss(10)
- L.Knockdown(20, FALSE)
+ L.DefaultCombatKnockdown(20, FALSE)
L.adjust_fire_stacks(5) //Burn!
L.IgniteMob()
else
@@ -155,7 +155,7 @@
if(brutedamage || burndamage)
L.adjustBruteLoss(-(brutedamage * 0.25))
L.adjustFireLoss(-(burndamage * 0.25))
- L.Knockdown(50) //Completely defenseless for five seconds - mainly to give them time to read over the information they've just been presented with
+ L.DefaultCombatKnockdown(50) //Completely defenseless for five seconds - mainly to give them time to read over the information they've just been presented with
if(iscarbon(L))
var/mob/living/carbon/C = L
C.silent += 5
diff --git a/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm b/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm
index ee1a1233d2..c7c9c42ee9 100644
--- a/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm
+++ b/code/modules/antagonists/clockcult/clock_helpers/slab_abilities.dm
@@ -196,7 +196,7 @@
if(!iscultist(L))
L.visible_message("[L]'s eyes blaze with brilliant light!", \
"Your vision suddenly screams with white-hot light!")
- L.Knockdown(15, TRUE, FALSE, 15)
+ L.DefaultCombatKnockdown(15, TRUE, FALSE, 15)
L.apply_status_effect(STATUS_EFFECT_KINDLE)
L.flash_act(1, 1)
if(issilicon(target))
diff --git a/code/modules/antagonists/clockcult/clock_items/clock_weapons/ratvarian_spear.dm b/code/modules/antagonists/clockcult/clock_items/clock_weapons/ratvarian_spear.dm
index 05516cc6a2..4a10862e28 100644
--- a/code/modules/antagonists/clockcult/clock_items/clock_weapons/ratvarian_spear.dm
+++ b/code/modules/antagonists/clockcult/clock_items/clock_weapons/ratvarian_spear.dm
@@ -57,15 +57,15 @@
else if(!..())
if(!L.anti_magic_check())
if(issilicon(L))
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
else if(iscultist(L))
L.confused += CLAMP(10 - L.confused, 0, 5) // Spearthrow now confuses enemy cultists + just deals extra damage / sets on fire instead of hardstunning + damage
to_chat(L, "[src] crashes into you with burning force, sending you reeling!")
L.adjust_fire_stacks(2)
- L.Knockdown(1)
+ L.DefaultCombatKnockdown(1)
L.IgniteMob()
else
- L.Knockdown(40)
+ L.DefaultCombatKnockdown(40)
GLOB.clockwork_vitality += L.adjustFireLoss(bonus_burn * 3) //normally a total of 40 damage, 70 with ratvar
break_spear(T)
else
diff --git a/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm b/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm
index 644d9eedd5..6a53097922 100644
--- a/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm
+++ b/code/modules/antagonists/clockcult/clock_items/judicial_visor.dm
@@ -176,7 +176,7 @@
var/datum/status_effect/belligerent/B = C.apply_status_effect(STATUS_EFFECT_BELLIGERENT)
if(!QDELETED(B))
B.duration = world.time + 30
- C.Knockdown(5) //knocks down for half a second if affected
+ C.DefaultCombatKnockdown(5) //knocks down for half a second if affected
sleep(!GLOB.ratvar_approaches ? 16 : 10)
name = "judicial blast"
layer = ABOVE_ALL_MOB_LAYER
@@ -196,7 +196,7 @@
L.visible_message("Strange energy flows into [L]'s [I.name]!", \
"Your [I.name] shields you from [src]!")
continue
- L.Knockdown(15) //knocks down briefly when exploding
+ L.DefaultCombatKnockdown(15) //knocks down briefly when exploding
if(!iscultist(L))
L.visible_message("[L] is struck by a judicial explosion!", \
"[!issilicon(L) ? "An unseen force slams you into the ground!" : "ERROR: Motor servos disabled by external source!"]")
diff --git a/code/modules/antagonists/clockcult/clock_structures/taunting_trail.dm b/code/modules/antagonists/clockcult/clock_structures/taunting_trail.dm
index 1158b02a4c..98b3c32b0f 100644
--- a/code/modules/antagonists/clockcult/clock_structures/taunting_trail.dm
+++ b/code/modules/antagonists/clockcult/clock_structures/taunting_trail.dm
@@ -57,5 +57,5 @@
L.confused = min(L.confused + 15, 50)
L.dizziness = min(L.dizziness + 15, 50)
if(L.confused >= 25)
- L.Knockdown(FLOOR(L.confused * 0.8, 1))
+ L.DefaultCombatKnockdown(FLOOR(L.confused * 0.8, 1))
take_damage(max_integrity)
diff --git a/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm b/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm
index 2f0db73bfc..a4b19f2d40 100644
--- a/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm
+++ b/code/modules/antagonists/clockcult/clock_structures/traps/brass_skewer.dm
@@ -22,7 +22,7 @@
if(buckled_mobs && LAZYLEN(buckled_mobs))
var/mob/living/L = buckled_mobs[1]
if(iscarbon(L))
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
L.visible_message("[L] is maimed as the skewer shatters while still in [L.p_their()] body!")
L.adjustBruteLoss(15)
unbuckle_mob(L)
@@ -117,6 +117,6 @@
return
skewee.visible_message("[skewee] comes free of [src] with a squelching pop!", \
"You come free of [src]!")
- skewee.Knockdown(30)
+ skewee.DefaultCombatKnockdown(30)
playsound(skewee, 'sound/misc/desceration-03.ogg', 50, TRUE)
unbuckle_mob(skewee)
diff --git a/code/modules/antagonists/cult/blood_magic.dm b/code/modules/antagonists/cult/blood_magic.dm
index 636061783e..9a086b75a2 100644
--- a/code/modules/antagonists/cult/blood_magic.dm
+++ b/code/modules/antagonists/cult/blood_magic.dm
@@ -446,7 +446,7 @@
var/atom/throw_target = get_edge_target_turf(L, user.dir)
L.throw_at(throw_target, 7, 1, user)
else if(!iscultist(L))
- L.Knockdown(160)
+ L.DefaultCombatKnockdown(160)
L.adjustStaminaLoss(140) //Ensures hard stamcrit
L.flash_act(1,1)
if(issilicon(target))
diff --git a/code/modules/antagonists/cult/cult_items.dm b/code/modules/antagonists/cult/cult_items.dm
index f14aeede9a..3dc199b56d 100644
--- a/code/modules/antagonists/cult/cult_items.dm
+++ b/code/modules/antagonists/cult/cult_items.dm
@@ -46,10 +46,11 @@
/obj/item/melee/cultblade/Initialize()
. = ..()
AddComponent(/datum/component/butchering, 40, 100)
+ AddElement(/datum/element/sword_point)
/obj/item/melee/cultblade/attack(mob/living/target, mob/living/carbon/human/user)
if(!iscultist(user))
- user.Knockdown(100)
+ user.DefaultCombatKnockdown(100)
user.dropItemToGround(src, TRUE)
user.visible_message("A powerful force shoves [user] away from [target]!", \
"\"You shouldn't play with sharp things. You'll poke someone's eye out.\"")
@@ -148,7 +149,7 @@
user.emote("scream")
user.apply_damage(30, BRUTE, pick(BODY_ZONE_L_ARM, BODY_ZONE_R_ARM))
user.dropItemToGround(src, TRUE)
- user.Knockdown(50)
+ user.DefaultCombatKnockdown(50)
return
force = initial(force)
jaunt.Grant(user, src)
@@ -405,7 +406,7 @@
to_chat(user, "An overwhelming sense of nausea overpowers you!")
user.dropItemToGround(src, TRUE)
user.Dizzy(30)
- user.Knockdown(100)
+ user.DefaultCombatKnockdown(100)
else
to_chat(user, "\"Trying to use things you don't own is bad, you know.\"")
to_chat(user, "The armor squeezes at your body!")
@@ -457,7 +458,7 @@
to_chat(user, "An overwhelming sense of nausea overpowers you!")
user.dropItemToGround(src, TRUE)
user.Dizzy(30)
- user.Knockdown(100)
+ user.DefaultCombatKnockdown(100)
else
to_chat(user, "\"Trying to use things you don't own is bad, you know.\"")
to_chat(user, "The robes squeeze at your body!")
@@ -478,7 +479,7 @@
to_chat(user, "\"You want to be blind, do you?\"")
user.dropItemToGround(src, TRUE)
user.Dizzy(30)
- user.Knockdown(100)
+ user.DefaultCombatKnockdown(100)
user.blind_eyes(30)
/obj/item/reagent_containers/glass/beaker/unholywater
@@ -499,7 +500,7 @@
/obj/item/shuttle_curse/attack_self(mob/living/user)
if(!iscultist(user))
user.dropItemToGround(src, TRUE)
- user.Knockdown(100)
+ user.DefaultCombatKnockdown(100)
to_chat(user, "A powerful force shoves you away from [src]!")
return
if(curselimit > 1)
@@ -705,10 +706,10 @@
if(is_servant_of_ratvar(L))
to_chat(L, "\"Kneel for me, scum\"")
L.confused += CLAMP(10 - L.confused, 0, 5) //confuses and lightly knockdowns + damages hostile cultists instead of hardstunning like before
- L.Knockdown(15)
+ L.DefaultCombatKnockdown(15)
L.adjustBruteLoss(10)
else
- L.Knockdown(50)
+ L.DefaultCombatKnockdown(50)
break_spear(T)
else
..()
@@ -843,7 +844,7 @@
INVOKE_ASYNC(src, .proc/pewpew, user, params)
var/obj/structure/emergency_shield/invoker/N = new(user.loc)
if(do_after(user, 90, target = user))
- user.Knockdown(40)
+ user.DefaultCombatKnockdown(40)
to_chat(user, "You have exhausted the power of this spell!")
firing = FALSE
if(N)
@@ -908,7 +909,7 @@
else
var/mob/living/L = target
if(L.density)
- L.Knockdown(20)
+ L.DefaultCombatKnockdown(20)
L.adjustBruteLoss(45)
playsound(L, 'sound/hallucinations/wail.ogg', 50, 1)
L.emote("scream")
@@ -944,7 +945,7 @@
T.visible_message("The sheer force from [P] shatters the mirror shield!")
new /obj/effect/temp_visual/cult/sparks(T)
playsound(T, 'sound/effects/glassbr3.ogg', 100)
- owner.Knockdown(25)
+ owner.DefaultCombatKnockdown(25)
qdel(src)
return FALSE
if(P.is_reflectable)
@@ -1001,9 +1002,9 @@
else if(!..())
if(!L.anti_magic_check())
if(is_servant_of_ratvar(L))
- L.Knockdown(60)
+ L.DefaultCombatKnockdown(60)
else
- L.Knockdown(30)
+ L.DefaultCombatKnockdown(30)
if(D.thrower)
for(var/mob/living/Next in orange(2, T))
if(!Next.density || iscultist(Next))
diff --git a/code/modules/antagonists/cult/runes.dm b/code/modules/antagonists/cult/runes.dm
index 0111334748..3d27fa942b 100644
--- a/code/modules/antagonists/cult/runes.dm
+++ b/code/modules/antagonists/cult/runes.dm
@@ -219,7 +219,7 @@ structure_check() searches for nearby cultist structures required for the invoca
L.visible_message("[L]'s eyes glow a defiant yellow!", \
"\"Stop resisting. You will be mi-\"\n\
\"Give up and you will feel pain unlike anything you've ever felt!\"")
- L.Knockdown(80)
+ L.DefaultCombatKnockdown(80)
else if(is_convertable)
do_convert(L, invokers)
else
@@ -908,7 +908,7 @@ structure_check() searches for nearby cultist structures required for the invoca
if(affecting.key)
affecting.visible_message("[affecting] slowly relaxes, the glow around [affecting.p_them()] dimming.", \
"You are re-united with your physical form. [src] releases its hold over you.")
- affecting.Knockdown(40)
+ affecting.DefaultCombatKnockdown(40)
break
if(affecting.health <= 10)
to_chat(G, "Your body can no longer sustain the connection!")
@@ -970,7 +970,7 @@ structure_check() searches for nearby cultist structures required for the invoca
playsound(T, 'sound/magic/enter_blood.ogg', 100, 1)
visible_message("A colossal shockwave of energy bursts from the rune, disintegrating it in the process!")
for(var/mob/living/L in range(src, 3))
- L.Knockdown(30)
+ L.DefaultCombatKnockdown(30)
empulse(T, 0.42*(intensity), 1)
var/list/images = list()
var/zmatch = T.z
diff --git a/code/modules/antagonists/devil/devil.dm b/code/modules/antagonists/devil/devil.dm
index 951fe4e18a..84920eba00 100644
--- a/code/modules/antagonists/devil/devil.dm
+++ b/code/modules/antagonists/devil/devil.dm
@@ -477,7 +477,7 @@ GLOBAL_LIST_INIT(devil_suffix, list(" the Red", " the Soulless", " the Master",
if(SOULVALUE >= ARCH_THRESHOLD && ascendable)
A.convert_to_archdevil()
else
- throw EXCEPTION("Unable to find a blobstart landmark for hellish resurrection")
+ CRASH("Unable to find a blobstart landmark for hellish resurrection")
/datum/antagonist/devil/proc/update_hud()
diff --git a/code/modules/antagonists/devil/devil_helpers.dm b/code/modules/antagonists/devil/devil_helpers.dm
index 4d0a781570..d3445eac0f 100644
--- a/code/modules/antagonists/devil/devil_helpers.dm
+++ b/code/modules/antagonists/devil/devil_helpers.dm
@@ -32,7 +32,7 @@
if(BANE_HARVEST)
if(istype(weapon, /obj/item/reagent_containers/food/snacks/grown/))
visible_message("The spirits of the harvest aid in the exorcism.", "The harvest spirits are harming you.")
- Knockdown(40)
+ DefaultCombatKnockdown(40)
qdel(weapon)
return 2
return 1
\ No newline at end of file
diff --git a/code/modules/antagonists/ninja/ninja.dm b/code/modules/antagonists/ninja/ninja.dm
index 12bdbec77a..133bd5ab6a 100644
--- a/code/modules/antagonists/ninja/ninja.dm
+++ b/code/modules/antagonists/ninja/ninja.dm
@@ -70,16 +70,10 @@
O.explanation_text = "Protect \the [M.current.real_name], the [M.assigned_role], from harm."
objectives += O
if(4) //flavor
- if(helping_station)
- var/datum/objective/flavor/ninja_helping/O = new /datum/objective/flavor/ninja_helping
- O.owner = owner
- O.forge_objective()
- objectives += O
- else
- var/datum/objective/flavor/ninja_syndie/O = new /datum/objective/flavor/ninja_helping
- O.owner = owner
- O.forge_objective()
- objectives += O
+ var/datum/objective/flavor/O = helping_station ? new /datum/objective/flavor/ninja_helping : new /datum/objective/flavor/ninja_syndie
+ O.owner = owner
+ O.forge_objective()
+ objectives += O
else
break
var/datum/objective/O = new /datum/objective/survive()
diff --git a/code/modules/antagonists/swarmer/swarmer.dm b/code/modules/antagonists/swarmer/swarmer.dm
index 99d12972d8..92852c6c7f 100644
--- a/code/modules/antagonists/swarmer/swarmer.dm
+++ b/code/modules/antagonists/swarmer/swarmer.dm
@@ -191,7 +191,7 @@
return 0
/obj/item/IntegrateAmount() //returns the amount of resources gained when eating this item
- if(custom_materials[getmaterialref(/datum/material/iron)] || custom_materials[getmaterialref(/datum/material/glass)])
+ if(custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)] || custom_materials[SSmaterials.GetMaterialRef(/datum/material/glass)])
return 1
return ..()
@@ -586,7 +586,7 @@
playsound(loc,'sound/effects/snap.ogg',50, 1, -1)
L.electrocute_act(0, src, 1, 1, 1)
if(iscyborg(L))
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
qdel(src)
..()
diff --git a/code/modules/antagonists/wizard/equipment/artefact.dm b/code/modules/antagonists/wizard/equipment/artefact.dm
index 492da73e66..74cfc61d0f 100644
--- a/code/modules/antagonists/wizard/equipment/artefact.dm
+++ b/code/modules/antagonists/wizard/equipment/artefact.dm
@@ -261,7 +261,7 @@
GiveHint(target)
else if(is_pointed(I))
to_chat(target, "You feel a stabbing pain in [parse_zone(user.zone_selected)]!")
- target.Knockdown(40)
+ target.DefaultCombatKnockdown(40)
GiveHint(target)
else if(istype(I, /obj/item/bikehorn))
to_chat(target, "HONK")
@@ -377,7 +377,10 @@
/obj/item/warpwhistle/proc/end_effect(mob/living/carbon/user)
user.invisibility = initial(user.invisibility)
user.status_flags &= ~GODMODE
- user.canmove = TRUE
+ REMOVE_TRAIT(user, TRAIT_MOBILITY_NOMOVE, src)
+ REMOVE_TRAIT(user, TRAIT_MOBILITY_NOUSE, src)
+ REMOVE_TRAIT(user, TRAIT_MOBILITY_NOPICKUP, src)
+ user.update_mobility()
/obj/item/warpwhistle/attack_self(mob/living/carbon/user)
if(!istype(user) || on_cooldown)
@@ -390,7 +393,10 @@
on_cooldown = TRUE
last_user = user
playsound(T,'sound/magic/warpwhistle.ogg', 200, 1)
- user.canmove = FALSE
+ ADD_TRAIT(user, TRAIT_MOBILITY_NOMOVE, src)
+ ADD_TRAIT(user, TRAIT_MOBILITY_NOUSE, src)
+ ADD_TRAIT(user, TRAIT_MOBILITY_NOPICKUP, src)
+ user.update_mobility()
new /obj/effect/temp_visual/tornado(T)
sleep(20)
if(interrupted(user))
@@ -412,7 +418,6 @@
return
if(T.z != potential_T.z || abs(get_dist_euclidian(potential_T,T)) > 50 - breakout)
do_teleport(user, potential_T, channel = TELEPORT_CHANNEL_MAGIC)
- user.canmove = 0
T = potential_T
break
breakout += 1
diff --git a/code/modules/antagonists/wizard/equipment/soulstone.dm b/code/modules/antagonists/wizard/equipment/soulstone.dm
index 962c2b2da4..0f43dfaf3a 100644
--- a/code/modules/antagonists/wizard/equipment/soulstone.dm
+++ b/code/modules/antagonists/wizard/equipment/soulstone.dm
@@ -83,8 +83,8 @@
/obj/item/soulstone/proc/release_shades(mob/user)
for(var/mob/living/simple_animal/shade/A in src)
A.status_flags &= ~GODMODE
- A.canmove = TRUE
A.forceMove(get_turf(user))
+ A.mobility_flags = MOBILITY_FLAGS_DEFAULT
A.cancel_camera()
icon_state = "soulstone"
name = initial(name)
@@ -173,7 +173,7 @@
else
T.forceMove(src) //put shade in stone
T.status_flags |= GODMODE
- T.canmove = FALSE
+ T.mobility_flags = NONE
T.health = T.maxHealth
icon_state = "soulstone2"
name = "soulstone: Shade of [T.real_name]"
@@ -240,8 +240,8 @@
T.dust_animation()
QDEL_IN(T, 5)
var/mob/living/simple_animal/shade/S = new /mob/living/simple_animal/shade(src)
- S.status_flags |= GODMODE //So they won't die inside the stone somehow
- S.canmove = FALSE//Can't move out of the soul stone
+ S.status_flags |= GODMODE //So they won't die inside the stone somehow
+ S.mobility_flags = NONE //Can't move out of the soul stone
S.name = "Shade of [T.real_name]"
S.real_name = "Shade of [T.real_name]"
T.transfer_ckey(S)
diff --git a/code/modules/assembly/flash.dm b/code/modules/assembly/flash.dm
index b6afc3cc0b..13ea317b9b 100644
--- a/code/modules/assembly/flash.dm
+++ b/code/modules/assembly/flash.dm
@@ -150,7 +150,7 @@
var/mob/living/silicon/robot/R = M
log_combat(user, R, "flashed", src)
update_icon(1)
- R.Knockdown(rand(80,120))
+ R.DefaultCombatKnockdown(rand(80,120))
var/diff = 5 * CONFUSION_STACK_MAX_MULTIPLIER - M.confused
R.confused += min(5, diff)
R.flash_act(affect_silicon = 1)
@@ -197,14 +197,13 @@
else
to_chat(user, "This mind seems resistant to the flash!")
-
/obj/item/assembly/flash/cyborg
/obj/item/assembly/flash/cyborg/attack(mob/living/M, mob/user)
. = ..()
new /obj/effect/temp_visual/borgflash(get_turf(src))
- if(. && !CONFIG_GET(flag/disable_borg_flash_knockdown) && iscarbon(M) && !M.resting && !M.get_eye_protection())
- M.Knockdown(80)
+ if(. && !CONFIG_GET(flag/disable_borg_flash_knockdown) && iscarbon(M) && CHECK_MOBILITY(M, MOBILITY_STAND) && !M.get_eye_protection())
+ M.DefaultCombatKnockdown(80)
/obj/item/assembly/flash/cyborg/attack_self(mob/user)
..()
diff --git a/code/modules/assembly/mousetrap.dm b/code/modules/assembly/mousetrap.dm
index c701e13a26..90d4662c15 100644
--- a/code/modules/assembly/mousetrap.dm
+++ b/code/modules/assembly/mousetrap.dm
@@ -48,7 +48,7 @@
if("feet")
if(!H.shoes || !(H.shoes.body_parts_covered & FEET))
affecting = H.get_bodypart(pick(BODY_ZONE_L_LEG, BODY_ZONE_R_LEG))
- H.Knockdown(60)
+ H.DefaultCombatKnockdown(60)
if(BODY_ZONE_PRECISE_L_HAND, BODY_ZONE_PRECISE_R_HAND)
if(!H.gloves)
affecting = H.get_bodypart(type)
diff --git a/code/modules/atmospherics/machinery/atmosmachinery.dm b/code/modules/atmospherics/machinery/atmosmachinery.dm
index 0904808f51..864edfdbe6 100644
--- a/code/modules/atmospherics/machinery/atmosmachinery.dm
+++ b/code/modules/atmospherics/machinery/atmosmachinery.dm
@@ -314,10 +314,6 @@
user.forceMove(loc)
user.visible_message("You hear something squeezing through the ducts...", "You climb out the ventilation system.")
- user.canmove = FALSE
- addtimer(VARSET_CALLBACK(user, canmove, TRUE), 1)
-
-
/obj/machinery/atmospherics/AltClick(mob/living/L)
if(is_type_in_typecache(src, GLOB.ventcrawl_machinery))
return L.handle_ventcrawl(src)
diff --git a/code/modules/atmospherics/machinery/components/components_base.dm b/code/modules/atmospherics/machinery/components/components_base.dm
index 86e8863b2b..a79beca4ec 100644
--- a/code/modules/atmospherics/machinery/components/components_base.dm
+++ b/code/modules/atmospherics/machinery/components/components_base.dm
@@ -144,7 +144,7 @@
for(var/i in 1 to device_type)
var/datum/pipeline/parent = parents[i]
if(!parent)
- throw EXCEPTION("Component is missing a pipenet! Rebuilding...")
+ stack_trace("Component is missing a pipenet! Rebuilding...")
build_network()
parent.update = 1
diff --git a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
index 1e8cce32c0..e013a86fd2 100644
--- a/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
+++ b/code/modules/atmospherics/machinery/components/unary_devices/cryo.dm
@@ -244,7 +244,7 @@
M.forceMove(get_turf(src))
if(isliving(M))
var/mob/living/L = M
- L.update_canmove()
+ L.update_mobility()
occupant = null
update_icon()
@@ -277,10 +277,10 @@
else
. += "[src] seems empty."
-/obj/machinery/atmospherics/components/unary/cryo_cell/MouseDrop_T(mob/target, mob/user)
- if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !iscarbon(target) || !user.IsAdvancedToolUser())
+/obj/machinery/atmospherics/components/unary/cryo_cell/MouseDrop_T(mob/living/carbon/target, mob/user)
+ if(user.stat || user.lying || !Adjacent(user) || !user.Adjacent(target) || !istype(target) || !user.IsAdvancedToolUser())
return
- if (target.IsKnockdown() || target.IsStun() || target.IsSleeping() || target.IsUnconscious())
+ if(!CHECK_MOBILITY(target, MOBILITY_MOVE))
close_machine(target)
else
user.visible_message("[user] starts shoving [target] inside [src].", "You start shoving [target] inside [src].")
diff --git a/code/modules/cargo/exports/materials.dm b/code/modules/cargo/exports/materials.dm
index a9d3b25d90..675cbb2be0 100644
--- a/code/modules/cargo/exports/materials.dm
+++ b/code/modules/cargo/exports/materials.dm
@@ -15,10 +15,10 @@
if(!isitem(O))
return 0
var/obj/item/I = O
- if(!(getmaterialref(material_id) in I.custom_materials))
+ if(!(SSmaterials.GetMaterialRef(material_id) in I.custom_materials))
return 0
- var/amount = I.custom_materials[getmaterialref(material_id)]
+ var/amount = I.custom_materials[SSmaterials.GetMaterialRef(material_id)]
if(istype(I, /obj/item/stack/ore))
amount *= 0.8 // Station's ore redemption equipment is really goddamn good.
diff --git a/code/modules/client/preferences.dm b/code/modules/client/preferences.dm
index cdc3fbc5b9..d5f2ae35ed 100644
--- a/code/modules/client/preferences.dm
+++ b/code/modules/client/preferences.dm
@@ -123,7 +123,7 @@ GLOBAL_LIST_EMPTY(preferences_datums)
"has_cock" = FALSE,
"cock_shape" = "Human",
"cock_length" = 6,
- "cock_girth_ratio" = COCK_GIRTH_RATIO_DEF,
+ "cock_diameter_ratio" = COCK_DIAMETER_RATIO_DEF,
"cock_color" = "fff",
"has_sheath" = FALSE,
"sheath_color" = "fff",
diff --git a/code/modules/client/preferences_savefile.dm b/code/modules/client/preferences_savefile.dm
index 03c6051c5d..86148ee17c 100644
--- a/code/modules/client/preferences_savefile.dm
+++ b/code/modules/client/preferences_savefile.dm
@@ -415,7 +415,7 @@ SAVEFILE UPDATING/VERSIONING - 'Simplified', or rather, more coder-friendly ~Car
S["feature_cock_shape"] >> features["cock_shape"]
S["feature_cock_color"] >> features["cock_color"]
S["feature_cock_length"] >> features["cock_length"]
- S["feature_cock_girth"] >> features["cock_girth"]
+ S["feature_cock_diameter"] >> features["cock_diameter"]
S["feature_has_sheath"] >> features["sheath_color"]
//balls features
S["feature_has_balls"] >> features["has_balls"]
diff --git a/code/modules/client/verbs/suicide.dm b/code/modules/client/verbs/suicide.dm
index 255a5a2eec..cae9a54484 100644
--- a/code/modules/client/verbs/suicide.dm
+++ b/code/modules/client/verbs/suicide.dm
@@ -224,7 +224,7 @@
/mob/living/carbon/canSuicide()
if(!..())
return
- if(IsStun() || IsKnockdown()) //just while I finish up the new 'fun' suiciding verb. This is to prevent metagaming via suicide
+ if(!CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_MOVE|MOBILITY_USE)) //just while I finish up the new 'fun' suiciding verb. This is to prevent metagaming via suicide
to_chat(src, "You can't commit suicide while stunned! ((You can type Ghost instead however.))")
return
if(restrained())
diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm
index 50e458a224..e176943aa9 100644
--- a/code/modules/clothing/head/helmet.dm
+++ b/code/modules/clothing/head/helmet.dm
@@ -243,7 +243,7 @@
icon_state = "knight_greyscale"
item_state = "knight_greyscale"
armor = list("melee" = 35, "bullet" = 10, "laser" = 10, "energy" = 10, "bomb" = 10, "bio" = 10, "rad" = 10, "fire" = 40, "acid" = 40)
- material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR //Can change color and add prefix
+ material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS //Can change color and add prefix
/obj/item/clothing/head/helmet/skull
name = "skull helmet"
diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm
index a8387c5ccc..3d06fba285 100644
--- a/code/modules/clothing/spacesuits/chronosuit.dm
+++ b/code/modules/clothing/spacesuits/chronosuit.dm
@@ -221,7 +221,7 @@
if(user.wear_suit == src)
if(hard_landing)
user.electrocute_act(35, src, safety = 1)
- user.Knockdown(200)
+ user.DefaultCombatKnockdown(200)
if(!silent)
to_chat(user, "\nroot@ChronosuitMK4# chronowalk4 --stop\n")
if(camera)
diff --git a/code/modules/clothing/spacesuits/flightsuit.dm b/code/modules/clothing/spacesuits/flightsuit.dm
index 04aacfc3f5..2f9ded7848 100644
--- a/code/modules/clothing/spacesuits/flightsuit.dm
+++ b/code/modules/clothing/spacesuits/flightsuit.dm
@@ -481,7 +481,7 @@
adjust_momentum(0, 0, 10)
wearer.visible_message("[wearer]'s flight suit crashes into the ground!")
if(knockdown)
- wearer.Knockdown(80)
+ wearer.DefaultCombatKnockdown(80)
momentum_x = 0
momentum_y = 0
calculate_momentum_speed()
diff --git a/code/modules/clothing/spacesuits/hardsuit.dm b/code/modules/clothing/spacesuits/hardsuit.dm
index fab41c9876..d9e4f17649 100644
--- a/code/modules/clothing/spacesuits/hardsuit.dm
+++ b/code/modules/clothing/spacesuits/hardsuit.dm
@@ -455,6 +455,18 @@
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE|HIDEHAIR|HIDEFACIALHAIR
clothing_flags = STOPSPRESSUREDAMAGE | THICKMATERIAL | BLOCK_GAS_SMOKE_EFFECT | ALLOWINTERNALS | SCAN_REAGENTS
+/obj/item/clothing/head/helmet/space/hardsuit/medical/equipped(mob/living/carbon/human/user, slot)
+ ..()
+ if (slot == SLOT_HEAD)
+ var/datum/atom_hud/DHUD = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
+ DHUD.add_hud_to(user)
+
+/obj/item/clothing/head/helmet/space/hardsuit/medical/dropped(mob/living/carbon/human/user)
+ ..()
+ if (user.head == src)
+ var/datum/atom_hud/DHUD = GLOB.huds[DATA_HUD_MEDICAL_ADVANCED]
+ DHUD.remove_hud_from(user)
+
/obj/item/clothing/suit/space/hardsuit/medical
icon_state = "hardsuit-medical"
name = "medical hardsuit"
diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm
index 1f0214cade..3b84a227ef 100644
--- a/code/modules/clothing/suits/armor.dm
+++ b/code/modules/clothing/suits/armor.dm
@@ -267,7 +267,7 @@
icon_state = "knight_greyscale"
item_state = "knight_greyscale"
armor = list("melee" = 35, "bullet" = 10, "laser" = 10, "energy" = 10, "bomb" = 10, "bio" = 10, "rad" = 10, "fire" = 40, "acid" = 40)
- material_flags = MATERIAL_ADD_PREFIX //Can change color and add prefix
+ material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS //Can change color and add prefix
/obj/item/clothing/suit/armor/vest/durathread
name = "makeshift vest"
diff --git a/code/modules/clothing/suits/reactive_armour.dm b/code/modules/clothing/suits/reactive_armour.dm
index dff62dd2c3..87e7098ebd 100644
--- a/code/modules/clothing/suits/reactive_armour.dm
+++ b/code/modules/clothing/suits/reactive_armour.dm
@@ -252,7 +252,7 @@
return
owner.visible_message("The reactive teleport system flings [H] clear of [attack_text] and slams [H.p_them()] into a fabricated table!")
owner.visible_message("[H] GOES ON THE TABLE!!!")
- owner.Knockdown(40)
+ owner.DefaultCombatKnockdown(40)
var/list/turfs = new/list()
for(var/turf/T in orange(tele_range, H))
if(T.density)
diff --git a/code/modules/events/disease_outbreak.dm b/code/modules/events/disease_outbreak.dm
index 7df089d49c..68c5d8c5c8 100644
--- a/code/modules/events/disease_outbreak.dm
+++ b/code/modules/events/disease_outbreak.dm
@@ -63,7 +63,7 @@
else
D = new virus_type()
else
- D = new /datum/disease/advance/random(max_severity, max_severity)
+ D = new /datum/disease/advance/random(TRUE, max_severity, max_severity)
D.carrier = TRUE
H.ForceContractDisease(D, FALSE, TRUE)
diff --git a/code/modules/fields/peaceborg_dampener.dm b/code/modules/fields/peaceborg_dampener.dm
index 79bd866fca..13a2bc0135 100644
--- a/code/modules/fields/peaceborg_dampener.dm
+++ b/code/modules/fields/peaceborg_dampener.dm
@@ -42,7 +42,7 @@
if(R.has_buckled_mobs())
for(var/mob/living/L in R.buckled_mobs)
L.visible_message("[L] is knocked off of [R] by the charge in [R]'s chassis induced by [name]!") //I know it's bad.
- L.Knockdown(10)
+ L.DefaultCombatKnockdown(10)
R.unbuckle_mob(L)
do_sparks(5, 0, L)
..()
diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm
index b0c3121c67..ea475b28d6 100644
--- a/code/modules/flufftext/Hallucination.dm
+++ b/code/modules/flufftext/Hallucination.dm
@@ -220,8 +220,8 @@ GLOBAL_LIST_INIT(hallucination_list, list(
/obj/effect/hallucination/simple/xeno/throw_impact(atom/hit_atom, datum/thrownthing/throwingdatum)
update_icon("alienh_pounce")
- if(hit_atom == target && target.stat!=DEAD)
- target.Knockdown(100)
+ if(hit_atom == target && target.stat != DEAD)
+ target.DefaultCombatKnockdown(100)
target.visible_message("[target] flails around wildly.","[name] pounces on you!")
/datum/hallucination/xeno_attack
@@ -308,7 +308,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
shake_camera(target, 2, 1)
if(bubblegum.Adjacent(target) && !charged)
charged = TRUE
- target.Knockdown(80)
+ target.DefaultCombatKnockdown(80)
target.adjustStaminaLoss(40)
step_away(target, bubblegum)
shake_camera(target, 4, 3)
@@ -1106,7 +1106,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
if(istype(target, /obj/effect/dummy/phased_mob))
return
to_chat(target, "You fall into the chasm!")
- target.Knockdown(40)
+ target.DefaultCombatKnockdown(40)
addtimer(CALLBACK(GLOBAL_PROC, .proc/to_chat, target, "It's surprisingly shallow."), 15)
QDEL_IN(src, 30)
@@ -1245,7 +1245,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
/datum/hallucination/shock/proc/shock_drop()
target.jitteriness = max(target.jitteriness - 990, 10) //Still jittery, but vastly less
- target.Knockdown(60)
+ target.DefaultCombatKnockdown(60)
/datum/hallucination/husks
@@ -1318,7 +1318,7 @@ GLOBAL_LIST_INIT(hallucination_list, list(
"[G] grabs your wrist and violently wrenches it to the side!")
C.emote("scream")
C.dropItemToGround(C.get_active_held_item())
- C.Knockdown(60)
+ C.DefaultCombatKnockdown(60)
else
to_chat(C,"[G] violently grabs you!")
qdel(src)
diff --git a/code/modules/food_and_drinks/drinks/drinks/bottle.dm b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
index 07026e79de..b38250e39d 100644
--- a/code/modules/food_and_drinks/drinks/drinks/bottle.dm
+++ b/code/modules/food_and_drinks/drinks/drinks/bottle.dm
@@ -51,7 +51,7 @@
head_attack_message = " on the head"
//Knockdown the target for the duration that we calculated and divide it by 5.
if(armor_duration)
- target.Knockdown(min(armor_duration, 200)) // Never knockdown more than a flash!
+ target.DefaultCombatKnockdown(min(armor_duration, 200)) // Never knockdown more than a flash!
//Display an attack message.
if(target != user)
diff --git a/code/modules/food_and_drinks/food/snacks_meat.dm b/code/modules/food_and_drinks/food/snacks_meat.dm
index 9bf95f65db..83a03ed2d9 100644
--- a/code/modules/food_and_drinks/food/snacks_meat.dm
+++ b/code/modules/food_and_drinks/food/snacks_meat.dm
@@ -225,7 +225,7 @@
if(iscarbon(M))
M.visible_message("[src] bursts out of [M]!")
M.emote("scream")
- M.Knockdown(40)
+ M.DefaultCombatKnockdown(40)
M.adjustBruteLoss(60)
Expand()
return ..()
diff --git a/code/modules/food_and_drinks/food/snacks_pie.dm b/code/modules/food_and_drinks/food/snacks_pie.dm
index 1533f067ab..b3ad6b5126 100644
--- a/code/modules/food_and_drinks/food/snacks_pie.dm
+++ b/code/modules/food_and_drinks/food/snacks_pie.dm
@@ -49,7 +49,7 @@
else
creamoverlay.icon_state = "creampie_human"
if(stunning)
- H.Knockdown(20) //splat!
+ H.DefaultCombatKnockdown(20) //splat!
H.adjust_blurriness(1)
H.visible_message("[H] is creamed by [src]!", "You've been creamed by [src]!")
playsound(H, "desceration", 50, TRUE)
@@ -83,7 +83,7 @@
A.throw_at(T, 1, 1)
M.visible_message("[src] bursts out of [M]!")
M.emote("scream")
- M.Knockdown(40)
+ M.DefaultCombatKnockdown(40)
M.adjustBruteLoss(60)
return ..()
diff --git a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
index f3b8e466f3..1215dd7ecb 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/deep_fryer.dm
@@ -152,6 +152,6 @@ God bless America.
reagents.reaction(C, TOUCH)
C.apply_damage(min(30, reagents.total_volume), BURN, BODY_ZONE_HEAD)
reagents.remove_any((reagents.total_volume/2))
- C.Knockdown(60)
+ C.DefaultCombatKnockdown(60)
user.changeNext_move(CLICK_CD_MELEE)
return ..()
diff --git a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
index eddd1bdc3f..24dd99e5e0 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/microwave.dm
@@ -310,7 +310,7 @@
for(var/obj/item/O in ingredients)
O.microwave_act(src)
if(O.custom_materials?.len)
- metal += O.custom_materials[getmaterialref(/datum/material/iron)]
+ metal += O.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)]
if(metal)
spark()
diff --git a/code/modules/food_and_drinks/kitchen_machinery/processor.dm b/code/modules/food_and_drinks/kitchen_machinery/processor.dm
index b81c127523..3fa188fb94 100644
--- a/code/modules/food_and_drinks/kitchen_machinery/processor.dm
+++ b/code/modules/food_and_drinks/kitchen_machinery/processor.dm
@@ -132,7 +132,8 @@
set name = "Eject Contents"
set src in oview(1)
- if(usr.stat || !usr.canmove || usr.restrained())
+ var/mob/living/L = usr
+ if(!istype(L) || !CHECK_MOBILITY(L, MOBILITY_USE))
return
empty()
add_fingerprint(usr)
diff --git a/code/modules/holiday/halloween/jacqueen.dm b/code/modules/holiday/halloween/jacqueen.dm
index 2b116bbfd3..638d1427bc 100644
--- a/code/modules/holiday/halloween/jacqueen.dm
+++ b/code/modules/holiday/halloween/jacqueen.dm
@@ -46,6 +46,8 @@
var/progression = list() //Keep track of where people are in the story.
var/active = TRUE //Turn this to false to keep normal mob behavour
var/cached_z
+ /// I'm busy chatting, don't move.
+ var/busy_chatting = FALSE
/mob/living/simple_animal/jacq/Initialize()
..()
@@ -76,9 +78,9 @@
say("Hello there [gender_check(M)]!")
return ..()
if(!ckey)
- canmove = FALSE
+ busy_chatting = FALSE
chit_chat(M)
- canmove = TRUE
+ busy_chatting = TRUE
..()
/mob/living/simple_animal/jacq/attack_paw(mob/living/carbon/monkey/M)
@@ -86,9 +88,9 @@
say("Hello there [gender_check(M)]!")
return ..()
if(!ckey)
- canmove = FALSE
+ busy_chatting = FALSE
chit_chat(M)
- canmove = TRUE
+ busy_chatting = TRUE
..()
/mob/living/simple_animal/jacq/proc/poof()
@@ -99,7 +101,7 @@
s.set_up(R, 0, loc)
s.start()
visible_message("[src] disappears in a puff of smoke!")
- canmove = TRUE
+ busy_chatting = TRUE
health = 25
//Try to go to populated areas
@@ -377,6 +379,12 @@
sleep(20)
poof()
+/mob/living/simple_animal/jacq/update_mobility()
+ . = ..()
+ if(busy_chatting)
+ DISABLE_BITFIELD(., MOBILITY_MOVE)
+ mobility_flags = .
+
/obj/item/clothing/head/hardhat/pumpkinhead/jaqc
name = "Jacq o' latern"
desc = "A jacqueline o' lantern! You can't seem to get rid of it."
diff --git a/code/modules/holodeck/area_copy.dm b/code/modules/holodeck/area_copy.dm
index 8fa0825628..9fb97c08a7 100644
--- a/code/modules/holodeck/area_copy.dm
+++ b/code/modules/holodeck/area_copy.dm
@@ -4,6 +4,10 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
"power_supply", "contents", "reagents", "stat", "x", "y", "z", "group", "atmos_adjacent_turfs", "comp_lookup"
))
+GLOBAL_LIST_INIT(duplicate_forbidden_vars_by_type, typecacheof_assoc_list(list(
+ /obj/item/gun/energy = "ammo_type"
+ )))
+
/proc/DuplicateObject(atom/original, perfectcopy = TRUE, sameloc = FALSE, atom/newloc = null, nerf = FALSE, holoitem=FALSE)
RETURN_TYPE(original.type)
if(!original)
@@ -16,7 +20,7 @@ GLOBAL_LIST_INIT(duplicate_forbidden_vars,list(
O = new original.type(newloc)
if(perfectcopy && O && original)
- for(var/V in original.vars - GLOB.duplicate_forbidden_vars)
+ for(var/V in original.vars - GLOB.duplicate_forbidden_vars - GLOB.duplicate_forbidden_vars_by_type[O.type])
if(islist(original.vars[V]))
var/list/L = original.vars[V]
O.vars[V] = L.Copy()
diff --git a/code/modules/holodeck/items.dm b/code/modules/holodeck/items.dm
index 206a5c14a3..e6aed7a8ca 100644
--- a/code/modules/holodeck/items.dm
+++ b/code/modules/holodeck/items.dm
@@ -87,7 +87,7 @@
playsound(src, 'sound/items/dodgeball.ogg', 50, 1)
M.apply_damage(10, STAMINA)
if(prob(5))
- M.Knockdown(60)
+ M.DefaultCombatKnockdown(60)
visible_message("[M] is knocked right off [M.p_their()] feet!")
//
@@ -117,7 +117,7 @@
to_chat(user, "You need a better grip to do that!")
return
L.forceMove(loc)
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
visible_message("[user] dunks [L] into \the [src]!")
user.stop_pulling()
else
diff --git a/code/modules/hydroponics/biogenerator.dm b/code/modules/hydroponics/biogenerator.dm
index 6f3c8c9047..f7715e7320 100644
--- a/code/modules/hydroponics/biogenerator.dm
+++ b/code/modules/hydroponics/biogenerator.dm
@@ -196,7 +196,7 @@
dat += "x5"
if(ispath(D.build_path, /obj/item/stack))
dat += "x10"
- dat += "([D.materials[getmaterialref(/datum/material/biomass)]/efficiency])
"
+ dat += "([D.materials[SSmaterials.GetMaterialRef(/datum/material/biomass)]/efficiency])
"
dat += ""
else
dat += "No container inside, please insert container.
"
@@ -233,14 +233,14 @@
menustat = "void"
/obj/machinery/biogenerator/proc/check_cost(list/materials, multiplier = 1, remove_points = TRUE)
- if(materials.len != 1 || materials[1] != getmaterialref(/datum/material/biomass))
+ if(materials.len != 1 || materials[1] != SSmaterials.GetMaterialRef(/datum/material/biomass))
return FALSE
- if (materials[getmaterialref(/datum/material/biomass)]*multiplier/efficiency > points)
+ if (materials[SSmaterials.GetMaterialRef(/datum/material/biomass)]*multiplier/efficiency > points)
menustat = "nopoints"
return FALSE
else
if(remove_points)
- points -= materials[getmaterialref(/datum/material/biomass)]*multiplier/efficiency
+ points -= materials[SSmaterials.GetMaterialRef(/datum/material/biomass)]*multiplier/efficiency
update_icon()
updateUsrDialog()
return TRUE
diff --git a/code/modules/hydroponics/grown/nettle.dm b/code/modules/hydroponics/grown/nettle.dm
index c3bd82c624..0979ea483f 100644
--- a/code/modules/hydroponics/grown/nettle.dm
+++ b/code/modules/hydroponics/grown/nettle.dm
@@ -98,7 +98,7 @@
/obj/item/reagent_containers/food/snacks/grown/nettle/death/pickup(mob/living/carbon/user)
if(..())
if(prob(50))
- user.Knockdown(100)
+ user.DefaultCombatKnockdown(100)
to_chat(user, "You are stunned by the Deathnettle as you try picking it up!")
/obj/item/reagent_containers/food/snacks/grown/nettle/death/attack(mob/living/carbon/M, mob/user)
@@ -111,5 +111,5 @@
M.adjust_blurriness(force/7)
if(prob(20))
M.Unconscious(force / 0.3)
- M.Knockdown(force / 0.75)
+ M.DefaultCombatKnockdown(force / 0.75)
M.drop_all_held_items()
diff --git a/code/modules/integrated_electronics/core/printer.dm b/code/modules/integrated_electronics/core/printer.dm
index cdccc92cfd..5f6440bffb 100644
--- a/code/modules/integrated_electronics/core/printer.dm
+++ b/code/modules/integrated_electronics/core/printer.dm
@@ -190,10 +190,10 @@
var/cost = 400
if(ispath(build_type, /obj/item/electronic_assembly))
var/obj/item/electronic_assembly/E = SScircuit.cached_assemblies[build_type]
- cost = E.custom_materials[getmaterialref(/datum/material/iron)]
+ cost = E.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)]
else if(ispath(build_type, /obj/item/integrated_circuit))
var/obj/item/integrated_circuit/IC = SScircuit.cached_components[build_type]
- cost = IC.custom_materials[getmaterialref(/datum/material/iron)]
+ cost = IC.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)]
else if(!(build_type in SScircuit.circuit_fabricator_recipe_list["Tools"]))
return
diff --git a/code/modules/integrated_electronics/core/saved_circuits.dm b/code/modules/integrated_electronics/core/saved_circuits.dm
index cbf3bba616..61ada24b25 100644
--- a/code/modules/integrated_electronics/core/saved_circuits.dm
+++ b/code/modules/integrated_electronics/core/saved_circuits.dm
@@ -260,7 +260,7 @@
blocks["max_space"] = assembly.max_components
// Start keeping track of total metal cost
- blocks["metal_cost"] = assembly.custom_materials[getmaterialref(/datum/material/iron)]
+ blocks["metal_cost"] = assembly.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)]
// Block 2. Components.
@@ -291,7 +291,7 @@
// Update estimated assembly complexity, taken space and material cost
blocks["complexity"] += component.complexity
blocks["used_space"] += component.size
- blocks["metal_cost"] += component.custom_materials[getmaterialref(/datum/material/iron)]
+ blocks["metal_cost"] += component.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)]
// Check if the assembly requires printer upgrades
if(!(component.spawn_flags & IC_SPAWN_DEFAULT))
diff --git a/code/modules/integrated_electronics/subtypes/manipulation.dm b/code/modules/integrated_electronics/subtypes/manipulation.dm
index 9b275d85fe..3183a6d0e6 100644
--- a/code/modules/integrated_electronics/subtypes/manipulation.dm
+++ b/code/modules/integrated_electronics/subtypes/manipulation.dm
@@ -414,7 +414,7 @@
var/datum/component/material_container/materials = GetComponent(/datum/component/material_container)
set_pin_data(IC_OUTPUT, 2, materials.total_amount)
for(var/I in 1 to mtypes.len)
- var/datum/material/M = materials.materials[getmaterialref(I)]
+ var/datum/material/M = materials.materials[SSmaterials.GetMaterialRef(I)]
var/amount = materials[M]
if(M)
set_pin_data(IC_OUTPUT, I+2, amount)
@@ -452,7 +452,7 @@
continue
if(!mt) //Invalid input
if(U>0)
- if(materials.retrieve_sheets(U, getmaterialref(mtypes[I]), T))
+ if(materials.retrieve_sheets(U, SSmaterials.GetMaterialRef(mtypes[I]), T))
suc = TRUE
else
if(mt.transer_amt_to(materials, U, mtypes[I]))
diff --git a/code/modules/integrated_electronics/subtypes/weaponized.dm b/code/modules/integrated_electronics/subtypes/weaponized.dm
index 350f05914d..02340970af 100644
--- a/code/modules/integrated_electronics/subtypes/weaponized.dm
+++ b/code/modules/integrated_electronics/subtypes/weaponized.dm
@@ -336,7 +336,7 @@
if(!L || !isliving(L))
return 0
- L.Knockdown(stunforce)
+ L.DefaultCombatKnockdown(stunforce)
SEND_SIGNAL(L, COMSIG_LIVING_MINOR_SHOCK)
message_admins("stunned someone with an assembly. Last touches: Assembly: [assembly.fingerprintslast] Circuit: [fingerprintslast]")
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index 459212aad0..bfd0ae03cb 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -112,14 +112,14 @@
else
return ..()
-/obj/structure/bookcase/attack_hand(mob/user)
+/obj/structure/bookcase/attack_hand(mob/living/user)
. = ..()
- if(.)
+ if(. || !istype(user))
return
if(contents.len)
var/obj/item/book/choice = input("Which book would you like to remove from the shelf?") as null|obj in contents
if(choice)
- if(!usr.canmove || usr.stat || usr.restrained() || !in_range(loc, usr))
+ if(!CHECK_MOBILITY(user, MOBILITY_USE) || !in_range(loc, user))
return
if(ishuman(user))
if(!user.get_active_held_item())
diff --git a/code/modules/mining/equipment/survival_pod.dm b/code/modules/mining/equipment/survival_pod.dm
index 10b33cd473..68e70dc882 100644
--- a/code/modules/mining/equipment/survival_pod.dm
+++ b/code/modules/mining/equipment/survival_pod.dm
@@ -23,7 +23,7 @@
return
template = SSmapping.shelter_templates[template_id]
if(!template)
- throw EXCEPTION("Shelter template ([template_id]) not found!")
+ stack_trace("Shelter template ([template_id]) not found!")
qdel(src)
/obj/item/survivalcapsule/Destroy()
diff --git a/code/modules/mining/equipment/wormhole_jaunter.dm b/code/modules/mining/equipment/wormhole_jaunter.dm
index 5e2e8bdd5a..c31008fa62 100644
--- a/code/modules/mining/equipment/wormhole_jaunter.dm
+++ b/code/modules/mining/equipment/wormhole_jaunter.dm
@@ -93,7 +93,7 @@
playsound(M,'sound/weapons/resonator_blast.ogg',50,1)
if(iscarbon(M))
var/mob/living/carbon/L = M
- L.Knockdown(60)
+ L.DefaultCombatKnockdown(60)
if(ishuman(L))
shake_camera(L, 20, 1)
addtimer(CALLBACK(L, /mob/living/carbon.proc/vomit), 20)
diff --git a/code/modules/mining/fulton.dm b/code/modules/mining/fulton.dm
index fd366670f0..5044a73c10 100644
--- a/code/modules/mining/fulton.dm
+++ b/code/modules/mining/fulton.dm
@@ -74,7 +74,7 @@ GLOBAL_LIST_EMPTY(total_extraction_beacons)
var/mutable_appearance/balloon3
if(isliving(A))
var/mob/living/M = A
- M.Knockdown(320) // Keep them from moving during the duration of the extraction
+ M.DefaultCombatKnockdown(320) // Keep them from moving during the duration of the extraction
M.buckled = 0 // Unbuckle them to prevent anchoring problems
else
A.anchored = TRUE
diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm
index 9561684414..512fa8f3e4 100644
--- a/code/modules/mining/machine_processing.dm
+++ b/code/modules/mining/machine_processing.dm
@@ -86,7 +86,7 @@
proximity_monitor = new(src, 1)
AddComponent(/datum/component/material_container, list(/datum/material/iron, /datum/material/glass, /datum/material/silver, /datum/material/gold, /datum/material/diamond, /datum/material/plasma, /datum/material/uranium, /datum/material/bananium, /datum/material/titanium, /datum/material/bluespace), INFINITY, TRUE, /obj/item/stack)
stored_research = new /datum/techweb/specialized/autounlocking/smelter
- selected_material = getmaterialref(/datum/material/iron)
+ selected_material = SSmaterials.GetMaterialRef(/datum/material/iron)
/obj/machinery/mineral/processing_unit/Destroy()
CONSOLE = null
diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm
index c9f9a2cfbb..d04c0104e5 100644
--- a/code/modules/mining/mint.dm
+++ b/code/modules/mining/mint.dm
@@ -29,7 +29,7 @@
/datum/material/plastic,
/datum/material/runite
), MINERAL_MATERIAL_AMOUNT * 50, FALSE, /obj/item/stack)
- chosen = getmaterialref(chosen)
+ chosen = SSmaterials.GetMaterialRef(chosen)
/obj/machinery/mineral/mint/process()
var/turf/T = get_step(src, input_dir)
diff --git a/code/modules/mining/ores_coins.dm b/code/modules/mining/ores_coins.dm
index 67c26abaef..4f9bad2f0f 100644
--- a/code/modules/mining/ores_coins.dm
+++ b/code/modules/mining/ores_coins.dm
@@ -320,7 +320,7 @@ GLOBAL_LIST_INIT(sand_recipes, list(\
throwforce = 2
w_class = WEIGHT_CLASS_TINY
custom_materials = list(/datum/material/iron = 400)
- material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR
+ material_flags = MATERIAL_ADD_PREFIX | MATERIAL_COLOR | MATERIAL_AFFECT_STATISTICS
var/string_attached
var/list/sideslist = list("heads","tails")
var/cooldown = 0
diff --git a/code/modules/mob/dead/new_player/new_player.dm b/code/modules/mob/dead/new_player/new_player.dm
index 0418b281e6..7658bd963d 100644
--- a/code/modules/mob/dead/new_player/new_player.dm
+++ b/code/modules/mob/dead/new_player/new_player.dm
@@ -10,7 +10,6 @@
density = FALSE
stat = DEAD
- canmove = FALSE
var/mob/living/new_character //for instant transfer once the round is set up
diff --git a/code/modules/mob/dead/observer/observer.dm b/code/modules/mob/dead/observer/observer.dm
index d2cf3608e6..b891525e42 100644
--- a/code/modules/mob/dead/observer/observer.dm
+++ b/code/modules/mob/dead/observer/observer.dm
@@ -11,7 +11,7 @@ GLOBAL_VAR_INIT(observer_default_invisibility, INVISIBILITY_OBSERVER)
layer = GHOST_LAYER
stat = DEAD
density = FALSE
- canmove = 0
+ move_resist = INFINITY
see_invisible = SEE_INVISIBLE_OBSERVER
see_in_dark = 100
invisibility = INVISIBILITY_OBSERVER
diff --git a/code/modules/mob/living/brain/brain.dm b/code/modules/mob/living/brain/brain.dm
index 37dd7b6a31..e7b8250494 100644
--- a/code/modules/mob/living/brain/brain.dm
+++ b/code/modules/mob/living/brain/brain.dm
@@ -39,12 +39,8 @@
container = null
return ..()
-/mob/living/brain/update_canmove()
- if(in_contents_of(/obj/mecha))
- canmove = 1
- else
- canmove = 0
- return canmove
+/mob/living/brain/update_mobility()
+ return ((mobility_flags = (in_contents_of(/obj/mecha)? MOBILITY_FLAGS_DEFAULT : NONE)))
/mob/living/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
return
diff --git a/code/modules/mob/living/carbon/alien/alien_defense.dm b/code/modules/mob/living/carbon/alien/alien_defense.dm
index 8de60cba2f..fda136df0b 100644
--- a/code/modules/mob/living/carbon/alien/alien_defense.dm
+++ b/code/modules/mob/living/carbon/alien/alien_defense.dm
@@ -22,11 +22,11 @@ In all, this is a lot like the monkey code. /N
switch(M.a_intent)
if (INTENT_HELP)
if(!recoveringstam)
- resting = 0
- AdjustStun(-60)
- AdjustKnockdown(-60)
- AdjustUnconscious(-60)
- AdjustSleeping(-100)
+ set_resting(FALSE, TRUE, FALSE)
+ AdjustAllImmobility(-60, FALSE)
+ AdjustUnconscious(-60, FALSE)
+ AdjustSleeping(-100, FALSE)
+ update_mobility()
visible_message("[M.name] nuzzles [src] trying to wake [p_them()] up!")
if(INTENT_DISARM, INTENT_HARM)
if(health > 0)
diff --git a/code/modules/mob/living/carbon/alien/damage_procs.dm b/code/modules/mob/living/carbon/alien/damage_procs.dm
index f5d210b94b..66738b2208 100644
--- a/code/modules/mob/living/carbon/alien/damage_procs.dm
+++ b/code/modules/mob/living/carbon/alien/damage_procs.dm
@@ -5,11 +5,9 @@
/mob/living/carbon/alien/adjustToxLoss(amount, updating_health = TRUE, forced = FALSE) //alien immune to tox damage
return FALSE
-/* CIT CHANGE - Pffffffffffffhahahahahhaha-- No.
//aliens are immune to stamina damage.
-/mob/living/carbon/alien/adjustStaminaLoss(amount, updating_health = 1)
+/mob/living/carbon/alien/adjustStaminaLoss(amount, updating_health = TRUE, forced = FALSE)
return
-/mob/living/carbon/alien/setStaminaLoss(amount, updating_health = 1)
+/mob/living/carbon/alien/setStaminaLoss(amount, updating_health = TRUE, forced = FALSE)
return
-*/
diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
index b20383301d..e0647159a5 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
@@ -31,7 +31,7 @@
#define MAX_ALIEN_LEAP_DIST 7
/mob/living/carbon/alien/humanoid/hunter/proc/leap_at(atom/A)
- if(!canmove || leaping)
+ if(!CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND | MOBILITY_MOVE) || leaping)
return
if(pounce_cooldown > world.time)
@@ -65,21 +65,21 @@
var/mob/living/L = hit_atom
if(!L.check_shields(src, 0, "the [name]", attack_type = LEAP_ATTACK))
L.visible_message("[src] pounces on [L]!", "[src] pounces on you!")
- L.Knockdown(100)
+ L.DefaultCombatKnockdown(100)
sleep(2)//Runtime prevention (infinite bump() calls on hulks)
step_towards(src,L)
else
- Knockdown(40, 1, 1)
+ DefaultCombatKnockdown(40, 1, 1)
toggle_leap(0)
else if(hit_atom.density && !hit_atom.CanPass(src))
visible_message("[src] smashes into [hit_atom]!", "[src] smashes into [hit_atom]!")
- Knockdown(40, 1, 1)
+ Paralyze(40, TRUE, TRUE)
if(leaping)
leaping = 0
update_icons()
- update_canmove()
+ update_mobility()
/mob/living/carbon/alien/humanoid/float(on)
diff --git a/code/modules/mob/living/carbon/alien/humanoid/death.dm b/code/modules/mob/living/carbon/alien/humanoid/death.dm
index 5625e98b75..cbbe8a3e0a 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/death.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/death.dm
@@ -4,7 +4,7 @@
. = ..()
- update_canmove()
+ update_mobility()
update_icons()
status_flags |= CANPUSH
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index 347106f6c1..048b5062ec 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -69,11 +69,11 @@
playsound(src, 'sound/voice/hiss5.ogg', 40, 1, 1) //Alien roars when starting to break free
..(I, cuff_break = INSTANT_CUFFBREAK)
-/mob/living/carbon/alien/humanoid/resist_grab(moving_resist)
- if(pulledby.grab_state)
+/mob/living/carbon/alien/humanoid/do_resist_grab(moving_resist, forced, silent = FALSE)
+ if(pulledby.grab_state && !silent)
visible_message("[src] has broken free of [pulledby]'s grip!")
pulledby.stop_pulling()
- . = 0
+ return TRUE
/mob/living/carbon/alien/humanoid/get_standard_pixel_y_offset(lying = 0)
if(leaping)
diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
index a1ef522f1a..ca62df0b57 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
@@ -12,12 +12,12 @@
else
icon_state = "alien[caste]_dead"
- else if((stat == UNCONSCIOUS && !asleep) || stat == SOFT_CRIT || IsKnockdown())
+ else if((stat == UNCONSCIOUS && !asleep) || stat == SOFT_CRIT || IsParalyzed())
icon_state = "alien[caste]_unconscious"
else if(leap_on_click)
icon_state = "alien[caste]_pounce"
- else if(lying || resting || asleep)
+ else if(lying || !CHECK_MOBILITY(src, MOBILITY_STAND) || asleep)
icon_state = "alien[caste]_sleep"
else if(mob_size == MOB_SIZE_LARGE)
icon_state = "alien[caste]"
diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm
index 01a52b3b80..81b76c1720 100644
--- a/code/modules/mob/living/carbon/alien/larva/life.dm
+++ b/code/modules/mob/living/carbon/alien/larva/life.dm
@@ -22,13 +22,13 @@
if(stat == CONSCIOUS)
stat = UNCONSCIOUS
blind_eyes(1)
- update_canmove()
+ update_mobility()
else
if(stat == UNCONSCIOUS)
stat = CONSCIOUS
if(!recoveringstam)
- resting = 0
+ set_resting(FALSE, TRUE)
adjust_blindness(-1)
- update_canmove()
+ update_mobility()
update_damage_hud()
update_health_hud()
diff --git a/code/modules/mob/living/carbon/alien/larva/update_icons.dm b/code/modules/mob/living/carbon/alien/larva/update_icons.dm
index 9b762d1728..e6e7e657e8 100644
--- a/code/modules/mob/living/carbon/alien/larva/update_icons.dm
+++ b/code/modules/mob/living/carbon/alien/larva/update_icons.dm
@@ -14,9 +14,9 @@
icon_state = "larva[state]_dead"
else if(handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state?
icon_state = "larva[state]_cuff"
- else if(stat == UNCONSCIOUS || lying || resting)
+ else if(stat == UNCONSCIOUS || !CHECK_MOBILITY(src, MOBILITY_STAND))
icon_state = "larva[state]_sleep"
- else if(IsStun())
+ else if(IsStun() || IsParalyzed())
icon_state = "larva[state]_stun"
else
icon_state = "larva[state]"
diff --git a/code/modules/mob/living/carbon/alien/organs.dm b/code/modules/mob/living/carbon/alien/organs.dm
index febd0a024a..b57f9653a9 100644
--- a/code/modules/mob/living/carbon/alien/organs.dm
+++ b/code/modules/mob/living/carbon/alien/organs.dm
@@ -140,7 +140,7 @@
else if(ishuman(owner)) //Humans, being more fragile, are more overwhelmed by the mental backlash.
to_chat(owner, "You feel a splitting pain in your head, and are struck with a wave of nausea. You cannot hear the hivemind anymore!")
owner.emote("scream")
- owner.Knockdown(100)
+ owner.DefaultCombatKnockdown(100)
owner.jitteriness += 30
owner.confused += 30
diff --git a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
index 0621d1400e..5352329f99 100644
--- a/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
+++ b/code/modules/mob/living/carbon/alien/special/alien_embryo.dm
@@ -89,8 +89,8 @@
var/mob/living/carbon/alien/larva/new_xeno = new(xeno_loc)
ghost.transfer_ckey(new_xeno, FALSE)
SEND_SOUND(new_xeno, sound('sound/voice/hiss5.ogg',0,0,0,100)) //To get the player's attention
- new_xeno.canmove = 0 //so we don't move during the bursting animation
- new_xeno.notransform = 1
+ new_xeno.Paralyze(6)
+ new_xeno.notransform = TRUE
new_xeno.invisibility = INVISIBILITY_MAXIMUM
sleep(6)
@@ -99,8 +99,8 @@
return
if(new_xeno)
- new_xeno.canmove = 1
- new_xeno.notransform = 0
+ new_xeno.SetParalyzed(0)
+ new_xeno.notransform = FALSE
new_xeno.invisibility = 0
var/mob/living/carbon/old_owner = owner
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index 574a5aedd2..5f9e838330 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -103,7 +103,7 @@
hurt = FALSE
if(hit_atom.density && isturf(hit_atom))
if(hurt)
- Knockdown(20)
+ DefaultCombatKnockdown(20)
take_bodypart_damage(10)
if(iscarbon(hit_atom) && hit_atom != src)
var/mob/living/carbon/victim = hit_atom
@@ -112,8 +112,8 @@
if(hurt)
victim.take_bodypart_damage(10)
take_bodypart_damage(10)
- victim.Knockdown(20)
- Knockdown(20)
+ victim.DefaultCombatKnockdown(20)
+ DefaultCombatKnockdown(20)
visible_message("[src] crashes into [victim], knocking them both over!",\
"You violently crash into [victim]!")
playsound(src,'sound/weapons/punch1.ogg',50,1)
@@ -281,19 +281,23 @@
return FALSE
/mob/living/carbon/resist_buckle()
+ . = FALSE
if(restrained())
- changeNext_move(CLICK_CD_BREAKOUT)
- last_special = world.time + CLICK_CD_BREAKOUT
+ // too soon.
+ if(last_special > world.time)
+ return
var/buckle_cd = 600
if(handcuffed)
var/obj/item/restraints/O = src.get_item_by_slot(SLOT_HANDCUFFED)
buckle_cd = O.breakouttime
+ changeNext_move(min(CLICK_CD_BREAKOUT, buckle_cd))
+ last_special = world.time + min(CLICK_CD_BREAKOUT, buckle_cd)
visible_message("[src] attempts to unbuckle [p_them()]self!", \
"You attempt to unbuckle yourself... (This will take around [round(buckle_cd/600,1)] minute\s, and you need to stay still.)")
- if(do_after(src, buckle_cd, 0, target = src))
+ if(do_after(src, buckle_cd, 0, target = src, required_mobility_flags = MOBILITY_RESIST))
if(!buckled)
return
- buckled.user_unbuckle_mob(src,src)
+ buckled.user_unbuckle_mob(src, src)
else
if(src && buckled)
to_chat(src, "You fail to unbuckle yourself!")
@@ -301,21 +305,26 @@
buckled.user_unbuckle_mob(src,src)
/mob/living/carbon/resist_fire()
+ if(last_special > world.time)
+ return
fire_stacks -= 5
- Knockdown(60, TRUE, TRUE)
+ DefaultCombatKnockdown(60, TRUE, TRUE)
spin(32,2)
visible_message("[src] rolls on the floor, trying to put [p_them()]self out!", \
"You stop, drop, and roll!")
+ last_special = world.time + 30
sleep(30)
if(fire_stacks <= 0)
visible_message("[src] has successfully extinguished [p_them()]self!", \
"You extinguish yourself.")
ExtinguishMob()
- return
-/mob/living/carbon/resist_restraints()
+/mob/living/carbon/resist_restraints(ignore_delay = FALSE)
var/obj/item/I = null
var/type = 0
+ if(!ignore_delay && (last_special > world.time))
+ to_chat(src, "You don't have the energy to resist your restraints that fast!")
+ return
if(handcuffed)
I = handcuffed
type = 1
@@ -324,14 +333,13 @@
type = 2
if(I)
if(type == 1)
- changeNext_move(CLICK_CD_BREAKOUT)
+ changeNext_move(min(CLICK_CD_BREAKOUT, I.breakouttime))
last_special = world.time + CLICK_CD_BREAKOUT
if(type == 2)
- changeNext_move(CLICK_CD_RANGE)
+ changeNext_move(min(CLICK_CD_RANGE, I.breakouttime))
last_special = world.time + CLICK_CD_RANGE
cuff_resist(I)
-
/mob/living/carbon/proc/cuff_resist(obj/item/I, breakouttime = 600, cuff_break = 0)
if(I.item_flags & BEING_REMOVED)
to_chat(src, "You're already attempting to remove [I]!")
@@ -341,7 +349,7 @@
if(!cuff_break)
visible_message("[src] attempts to remove [I]!")
to_chat(src, "You attempt to remove [I]... (This will take around [DisplayTimeText(breakouttime)] and you need to stand still.)")
- if(do_after(src, breakouttime, 0, target = src))
+ if(do_after(src, breakouttime, 0, target = src, required_mobility_flags = MOBILITY_RESIST))
clear_cuffs(I, cuff_break)
else
to_chat(src, "You fail to remove [I]!")
@@ -488,7 +496,7 @@
visible_message("[src] dry heaves!", \
"You try to throw up, but there's nothing in your stomach!")
if(stun)
- Knockdown(200)
+ DefaultCombatKnockdown(200)
return 1
if(is_mouth_covered()) //make this add a blood/vomit overlay later it'll be hilarious
@@ -572,9 +580,9 @@
if(stam > DAMAGE_PRECISION)
var/total_health = (health - stam)
if(total_health <= crit_threshold && !stat)
- if(!IsKnockdown())
+ if(CHECK_MOBILITY(src, MOBILITY_STAND))
to_chat(src, "You're too exhausted to keep going...")
- Knockdown(100)
+ KnockToFloor(TRUE)
update_health_hud()
/mob/living/carbon/update_sight()
@@ -814,7 +822,7 @@
else
stat = CONSCIOUS
adjust_blindness(-1)
- update_canmove()
+ update_mobility()
update_damage_hud()
update_health_hud()
med_hud_set_status()
diff --git a/code/modules/mob/living/carbon/carbon_defense.dm b/code/modules/mob/living/carbon/carbon_defense.dm
index 637178ffe6..5bbc6d6a64 100644
--- a/code/modules/mob/living/carbon/carbon_defense.dm
+++ b/code/modules/mob/living/carbon/carbon_defense.dm
@@ -52,7 +52,12 @@
. = ..()
if(!HAS_TRAIT(src, TRAIT_AUTO_CATCH_ITEM) && !skip_throw_mode_check && !in_throw_mode)
return
- if(get_active_held_item() || restrained())
+ if(incapacitated())
+ return
+ if (get_active_held_item())
+ if (HAS_TRAIT_FROM(src, TRAIT_AUTO_CATCH_ITEM,RISING_BASS_TRAIT))
+ visible_message("[src] chops [I] out of the air!")
+ return TRUE
return
I.attack_hand(src)
if(get_active_held_item() == I) //if our attack_hand() picks up the item...
@@ -77,7 +82,7 @@
var/mob/living/carbon/tempcarb = user
if(!tempcarb.combatmode)
totitemdamage *= 0.5
- if(user.resting)
+ if(!CHECK_MOBILITY(user, MOBILITY_STAND))
totitemdamage *= 0.5
if(!combatmode)
totitemdamage *= 1.5
@@ -188,7 +193,7 @@
do_sparks(5, TRUE, src)
var/power = M.powerlevel + rand(0,3)
- Knockdown(power*20)
+ DefaultCombatKnockdown(power*20)
if(stuttering < power)
stuttering = power
if (prob(stunprob) && M.powerlevel >= 8)
@@ -262,7 +267,7 @@
spawn(20)
jitteriness = max(jitteriness - 990, 10) //Still jittery, but vastly less
if((!tesla_shock || (tesla_shock && siemens_coeff > 0.5)) && stun)
- Knockdown(60)
+ DefaultCombatKnockdown(60)
if(override)
return override
else
@@ -282,13 +287,13 @@
M.visible_message("[M] shakes [src] trying to get [p_them()] up!", \
"You shake [src] trying to get [p_them()] up!")
- else if(check_zone(M.zone_selected) == "mouth") // I ADDED BOOP-EH-DEH-NOSEH - Jon
+ else if(M.zone_selected == BODY_ZONE_PRECISE_MOUTH) // I ADDED BOOP-EH-DEH-NOSEH - Jon
M.visible_message( \
"[M] boops [src]'s nose.", \
"You boop [src] on the nose.", )
playsound(src, 'sound/items/Nose_boop.ogg', 50, 0)
- else if(check_zone(M.zone_selected) == "head")
+ else if(check_zone(M.zone_selected) == BODY_ZONE_HEAD)
var/datum/species/S
if(ishuman(src))
S = dna.species
@@ -322,7 +327,7 @@
else
return
- else if(check_zone(M.zone_selected) == "r_arm" || check_zone(M.zone_selected) == "l_arm")
+ else if(check_zone(M.zone_selected) == BODY_ZONE_R_ARM || check_zone(M.zone_selected) == BODY_ZONE_L_ARM)
M.visible_message( \
"[M] shakes [src]'s hand.", \
"You shake [src]'s hand.", )
@@ -341,16 +346,14 @@
else if (mood.sanity >= SANITY_DISTURBED)
SEND_SIGNAL(src, COMSIG_ADD_MOOD_EVENT, "friendly_hug", /datum/mood_event/betterhug, M)
- AdjustStun(-60)
- AdjustKnockdown(-60)
- AdjustUnconscious(-60)
- AdjustSleeping(-100)
+ AdjustAllImmobility(-60, FALSE)
+ AdjustUnconscious(-60, FALSE)
+ AdjustSleeping(-100, FALSE)
if(recoveringstam)
adjustStaminaLoss(-15)
- else if(resting)
- resting = 0
- update_canmove()
-
+ else
+ set_resting(FALSE, FALSE)
+ update_mobility()
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
@@ -414,7 +417,7 @@
var/effect_amount = intensity - ear_safety
if(effect_amount > 0)
if(stun_pwr)
- Knockdown(stun_pwr*effect_amount)
+ DefaultCombatKnockdown(stun_pwr*effect_amount)
if(istype(ears) && (deafen_pwr || damage_pwr))
var/ear_damage = damage_pwr * effect_amount
diff --git a/code/modules/mob/living/carbon/carbon_movement.dm b/code/modules/mob/living/carbon/carbon_movement.dm
index 4a99e9c89e..26ac12b97a 100644
--- a/code/modules/mob/living/carbon/carbon_movement.dm
+++ b/code/modules/mob/living/carbon/carbon_movement.dm
@@ -9,8 +9,6 @@
. += 6 - 3*get_num_arms() //crawling is harder with fewer arms
if(legcuffed)
. += legcuffed.slowdown
- if(stat == SOFT_CRIT)
- . += SOFTCRIT_ADD_SLOWDOWN
/mob/living/carbon/slip(knockdown_amount, obj/O, lube)
if(movement_type & FLYING && !(lube & FLYING_DOESNT_HELP))
@@ -43,3 +41,10 @@
nutrition -= HUNGER_FACTOR/10
if(m_intent == MOVE_INTENT_RUN)
nutrition -= HUNGER_FACTOR/10
+
+/mob/living/carbon/can_move_under_living(mob/living/other)
+ . = ..()
+ if(!.) //we failed earlier don't need to fail again
+ return
+ if(!other.lying && lying) //they're up, we're down.
+ return FALSE
diff --git a/code/modules/mob/living/carbon/examine.dm b/code/modules/mob/living/carbon/examine.dm
index 3f2a259df7..efd81c1744 100644
--- a/code/modules/mob/living/carbon/examine.dm
+++ b/code/modules/mob/living/carbon/examine.dm
@@ -91,7 +91,7 @@
. += "[t_He] [t_is] moving [t_his] body in an unnatural and blatantly unsimian manner."
if(combatmode)
- . += "[t_He] [t_is] visibly tense[resting ? "." : ", and [t_is] standing in combative stance."]"
+ . += "[t_He] [t_is] visibly tense[CHECK_MOBILITY(src, MOBILITY_STAND) ? "." : ", and [t_is] standing in combative stance."]"
var/trait_exam = common_trait_examine()
if (!isnull(trait_exam))
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 423277863f..bd7cbb48f9 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -491,7 +491,7 @@
to_chat(usr, "Unable to locate a data core entry for this person.")
/mob/living/carbon/human/proc/canUseHUD()
- return !(src.stat || IsKnockdown() || IsStun() || src.restrained())
+ return CHECK_MOBILITY(src, MOBILITY_UI)
/mob/living/carbon/human/can_inject(mob/user, error_msg, target_zone, penetrate_thick = FALSE, bypass_immunity = FALSE)
. = 1 // Default to returning true.
@@ -724,8 +724,8 @@
remove_atom_colour(TEMPORARY_COLOUR_PRIORITY, "#000000")
cut_overlay(MA)
-/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
- if(incapacitated() || lying )
+/mob/living/carbon/human/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE, check_resting = TRUE)
+ if(incapacitated() || (check_resting && !CHECK_MOBILITY(src, MOBILITY_STAND)))
to_chat(src, "You can't do that right now!")
return FALSE
if(!Adjacent(M) && (M.loc != src))
@@ -836,7 +836,7 @@
visible_message("[src] dry heaves!", \
"You try to throw up, but there's nothing in your stomach!")
if(stun)
- Knockdown(200)
+ DefaultCombatKnockdown(200)
return 1
..()
@@ -870,7 +870,7 @@
return (istype(target) && target.stat == CONSCIOUS)
/mob/living/carbon/human/proc/can_be_firemanned(mob/living/carbon/target)
- return (ishuman(target) && target.lying)
+ return (ishuman(target) && !CHECK_MOBILITY(target, MOBILITY_STAND))
/mob/living/carbon/human/proc/fireman_carry(mob/living/carbon/target)
if(can_be_firemanned(target))
@@ -879,7 +879,7 @@
if(do_after(src, 30, TRUE, target))
//Second check to make sure they're still valid to be carried
if(can_be_firemanned(target) && !incapacitated(FALSE, TRUE))
- target.resting = FALSE
+ target.set_resting(FALSE, TRUE)
buckle_mob(target, TRUE, TRUE, 90, 1, 0)
return
visible_message("[src] fails to fireman carry [target]!")
@@ -892,7 +892,7 @@
/mob/living/carbon/human/proc/piggyback(mob/living/carbon/target)
if(can_piggyback(target))
visible_message("[target] starts to climb onto [src]...")
- if(do_after(target, 15, target = src))
+ if(do_after(target, 15, target = src, required_mobility_flags = MOBILITY_STAND))
if(can_piggyback(target))
if(target.incapacitated(FALSE, TRUE) || incapacitated(FALSE, TRUE))
target.visible_message("[target] can't hang onto [src]!")
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index 57b8f59780..5bedce359b 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -49,9 +49,14 @@
if (mind.martial_art && mind.martial_art.dodge_chance)
if(!lying && dna && !dna.check_mutation(HULK))
if(prob(mind.martial_art.dodge_chance))
- var/dodgemessage = pick("dodges under the projectile!","dodges to the right of the projectile!","jumps over the projectile!")
- visible_message("[src] [dodgemessage]", "You dodge the projectile!")
- return BULLET_ACT_BLOCK
+ var/static/dodgemessages = list("dodges under",0,-4,"dodges to the right of",-4,0,"dodges to the left of",4,0,"jumps over",0,4)
+ var/pick = pick(1,4,7,10)
+ var/oldx = pixel_x
+ var/oldy = pixel_y
+ animate(src,pixel_x = pixel_x + dodgemessages[pick+1],pixel_y = pixel_y + dodgemessages[pick+2],time=3)
+ animate(src,pixel_x = oldx,pixel_y = oldy,time=2)
+ visible_message("[src] [dodgemessages[pick]] the projectile!", "You dodge the projectile!")
+ return BULLET_ACT_FORCE_PIERCE
if(mind.martial_art && !incapacitated(FALSE, TRUE) && mind.martial_art.can_use(src) && mind.martial_art.deflection_chance) //Some martial arts users can deflect projectiles!
if(prob(mind.martial_art.deflection_chance))
if(!lying && dna && !dna.check_mutation(HULK)) //But only if they're not lying down, and hulks can't do it
@@ -174,7 +179,7 @@
"[M] disarmed [src]!")
else if(!M.client || prob(5)) // only natural monkeys get to stun reliably, (they only do it occasionaly)
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
- Knockdown(100)
+ DefaultCombatKnockdown(100)
log_combat(M, src, "tackled")
visible_message("[M] has tackled down [src]!", \
"[M] has tackled down [src]!")
@@ -223,9 +228,9 @@
else
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
if(!lying) //CITADEL EDIT
- Knockdown(100, TRUE, FALSE, 30, 25)
+ DefaultCombatKnockdown(100, TRUE, FALSE, 30, 25)
else
- Knockdown(100)
+ DefaultCombatKnockdown(100)
log_combat(M, src, "tackled")
visible_message("[M] has tackled down [src]!", \
"[M] has tackled down [src]!")
@@ -292,10 +297,10 @@
switch(M.damtype)
if("brute")
if(M.force > 35) // durand and other heavy mechas
- Knockdown(50)
+ DefaultCombatKnockdown(50)
src.throw_at(throw_target, rand(1,5), 7)
- else if(M.force >= 20 && !IsKnockdown()) // lightweight mechas like gygax
- Knockdown(30)
+ else if(M.force >= 20 && CHECK_MOBILITY(src, MOBILITY_STAND)) // lightweight mechas like gygax
+ DefaultCombatKnockdown(30)
src.throw_at(throw_target, rand(1,3), 7)
update |= temp.receive_damage(dmg, 0)
playsound(src, 'sound/weapons/punch4.ogg', 50, 1)
diff --git a/code/modules/mob/living/carbon/human/human_mobility.dm b/code/modules/mob/living/carbon/human/human_mobility.dm
new file mode 100644
index 0000000000..61ceb42336
--- /dev/null
+++ b/code/modules/mob/living/carbon/human/human_mobility.dm
@@ -0,0 +1,48 @@
+/mob/living/carbon/human/resist_a_rest(automatic = FALSE, ignoretimer = FALSE)
+ if(!resting || stat || attemptingstandup)
+ return FALSE
+ if(ignoretimer)
+ set_resting(FALSE, FALSE)
+ return TRUE
+ if(!lying) //if they're in a chair or something they don't need to force themselves off the ground.
+ set_resting(FALSE, FALSE)
+ return TRUE
+ else if(!CHECK_MOBILITY(src, MOBILITY_RESIST))
+ if(!automatic)
+ to_chat(src, "You are unable to stand up right now.")
+ return FALSE
+ else
+ var/totaldelay = 3 //A little bit less than half of a second as a baseline for getting up from a rest
+ if(getStaminaLoss() >= STAMINA_SOFTCRIT)
+ to_chat(src, "You're too exhausted to get up!")
+ return FALSE
+ attemptingstandup = TRUE
+ var/health_deficiency = max((maxHealth - (health - getStaminaLoss()))*0.5, 0)
+ if(!has_gravity())
+ health_deficiency = health_deficiency*0.2
+ totaldelay += health_deficiency
+ var/standupwarning = "[src] and everyone around them should probably yell at the dev team"
+ switch(health_deficiency)
+ if(-INFINITY to 10)
+ standupwarning = "[src] stands right up!"
+ if(10 to 35)
+ standupwarning = "[src] tries to stand up."
+ if(35 to 60)
+ standupwarning = "[src] slowly pushes [p_them()]self upright."
+ if(60 to 80)
+ standupwarning = "[src] weakly attempts to stand up."
+ if(80 to INFINITY)
+ standupwarning = "[src] struggles to stand up."
+ var/usernotice = automatic ? "You are now getting up. (Auto)" : "You are now getting up."
+ visible_message("[standupwarning]", usernotice, vision_distance = 5)
+ if(do_after(src, totaldelay, target = src, required_mobility_flags = MOBILITY_RESIST))
+ set_resting(FALSE, TRUE)
+ attemptingstandup = FALSE
+ return TRUE
+ else
+ attemptingstandup = FALSE
+ if(resting) //we didn't shove ourselves up or something
+ visible_message("[src] falls right back down.", "You fall right back down.")
+ if(has_gravity())
+ playsound(src, "bodyfall", 20, 1)
+ return FALSE
diff --git a/code/modules/mob/living/carbon/human/species.dm b/code/modules/mob/living/carbon/human/species.dm
index ae3f50e5f9..c8e5f54ed3 100644
--- a/code/modules/mob/living/carbon/human/species.dm
+++ b/code/modules/mob/living/carbon/human/species.dm
@@ -1374,9 +1374,9 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
return TRUE
if(radiation > RAD_MOB_KNOCKDOWN && prob(RAD_MOB_KNOCKDOWN_PROB))
- if(!H.IsKnockdown())
+ if(CHECK_MOBILITY(H, MOBILITY_STAND))
H.emote("collapse")
- H.Knockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
+ H.DefaultCombatKnockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
to_chat(H, "You feel weak.")
if(radiation > RAD_MOB_VOMIT && prob(RAD_MOB_VOMIT_PROB))
@@ -1524,7 +1524,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
//CITADEL CHANGES - makes resting and disabled combat mode reduce punch damage, makes being out of combat mode result in you taking more damage
if(!target.combatmode && damage < user.dna.species.punchstunthreshold)
damage = user.dna.species.punchstunthreshold - 1
- if(user.resting)
+ if(!CHECK_MOBILITY(user, MOBILITY_STAND))
damage *= 0.5
if(!user.combatmode)
damage *= 0.25
@@ -1642,7 +1642,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
return*/
if(!target.combatmode) // CITADEL CHANGE
randn += -10 //CITADEL CHANGE - being out of combat mode makes it easier for you to get disarmed
- if(user.resting) //CITADEL CHANGE
+ if(!CHECK_MOBILITY(user, MOBILITY_STAND)) //CITADEL CHANGE
randn += 100 //CITADEL CHANGE - No kosher disarming if you're resting
if(!user.combatmode) //CITADEL CHANGE
randn += 25 //CITADEL CHANGE - Makes it harder to disarm outside of combat mode
@@ -1725,7 +1725,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/mob/living/carbon/tempcarb = user
if(!tempcarb.combatmode)
totitemdamage *= 0.5
- if(user.resting)
+ if(!CHECK_MOBILITY(user, MOBILITY_STAND))
totitemdamage *= 0.5
if(istype(H))
if(!H.combatmode)
@@ -1841,12 +1841,14 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
if(user.getStaminaLoss() >= STAMINA_SOFTCRIT)
to_chat(user, "You're too exhausted for that.")
return
- if(!user.resting)
+ if(user.IsKnockdown() || user.IsParalyzed() || user.IsStun())
+ to_chat(user, "You can't seem to force yourself up right now!")
+ return
+ if(CHECK_MOBILITY(user, MOBILITY_STAND))
to_chat(user, "You can only force yourself up if you're on the ground.")
return
user.visible_message("[user] forces [p_them()]self up to [p_their()] feet!", "You force yourself up to your feet!")
- user.resting = 0
- user.update_canmove()
+ user.set_resting(FALSE, TRUE)
user.adjustStaminaLossBuffered(user.stambuffer) //Rewards good stamina management by making it easier to instantly get up from resting
playsound(user, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
@@ -1859,7 +1861,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
return FALSE
if(attacker_style && attacker_style.disarm_act(user,target))
return TRUE
- if(user.resting)
+ if(!CHECK_MOBILITY(user, MOBILITY_STAND))
return FALSE
else
if(user == target)
@@ -1872,7 +1874,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
target.w_uniform.add_fingerprint(user)
SEND_SIGNAL(target, COMSIG_HUMAN_DISARM_HIT, user, user.zone_selected)
- if(!target.resting)
+ if(CHECK_MOBILITY(target, MOBILITY_STAND))
target.adjustStaminaLoss(5)
if(target.is_shove_knockdown_blocked())
@@ -1886,7 +1888,7 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
//Thank you based whoneedsspace
target_collateral_human = locate(/mob/living/carbon/human) in target_shove_turf.contents
- if(target_collateral_human && !target_collateral_human.resting)
+ if(target_collateral_human && CHECK_MOBILITY(target_collateral_human, MOBILITY_STAND))
shove_blocked = TRUE
else
target_collateral_human = null
@@ -1897,15 +1899,15 @@ GLOBAL_LIST_EMPTY(roundstart_race_names)
var/append_message = ""
if(shove_blocked && !target.buckled)
var/directional_blocked = !target.Adjacent(target_shove_turf)
- var/targetatrest = target.resting
+ var/targetatrest = !CHECK_MOBILITY(target, MOBILITY_STAND)
if((directional_blocked || !(target_collateral_human || target_shove_turf.shove_act(target, user))) && !targetatrest)
- target.Knockdown(SHOVE_KNOCKDOWN_SOLID)
+ target.DefaultCombatKnockdown(SHOVE_KNOCKDOWN_SOLID)
user.visible_message("[user.name] shoves [target.name], knocking them down!",
"You shove [target.name], knocking them down!", null, COMBAT_MESSAGE_RANGE)
log_combat(user, target, "shoved", "knocking them down")
else if(target_collateral_human && !targetatrest)
- target.Knockdown(SHOVE_KNOCKDOWN_HUMAN)
- target_collateral_human.Knockdown(SHOVE_KNOCKDOWN_COLLATERAL)
+ target.DefaultCombatKnockdown(SHOVE_KNOCKDOWN_HUMAN)
+ target_collateral_human.DefaultCombatKnockdown(SHOVE_KNOCKDOWN_COLLATERAL)
user.visible_message("[user.name] shoves [target.name] into [target_collateral_human.name]!",
"You shove [target.name] into [target_collateral_human.name]!", null, COMBAT_MESSAGE_RANGE)
append_message += ", into [target_collateral_human.name]"
diff --git a/code/modules/mob/living/carbon/human/species_types/angel.dm b/code/modules/mob/living/carbon/human/species_types/angel.dm
index 18c6a7bab4..924f5f9c6a 100644
--- a/code/modules/mob/living/carbon/human/species_types/angel.dm
+++ b/code/modules/mob/living/carbon/human/species_types/angel.dm
@@ -52,21 +52,20 @@
return 0
/datum/species/angel/proc/CanFly(mob/living/carbon/human/H)
- if(H.stat || H.IsStun() || H.IsKnockdown())
- return 0
+ if(!CHECK_MOBILITY(H, MOBILITY_MOVE))
+ return FALSE
if(H.wear_suit && ((H.wear_suit.flags_inv & HIDEJUMPSUIT) && (!H.wear_suit.species_exception || !is_type_in_list(src, H.wear_suit.species_exception)))) //Jumpsuits have tail holes, so it makes sense they have wing holes too
to_chat(H, "Your suit blocks your wings from extending!")
- return 0
+ return FALSE
var/turf/T = get_turf(H)
if(!T)
- return 0
+ return FALSE
var/datum/gas_mixture/environment = T.return_air()
if(environment && !(environment.return_pressure() > 30))
to_chat(H, "The atmosphere is too thin for you to fly!")
- return 0
- else
- return 1
+ return FALSE
+ return TRUE
/datum/action/innate/flight
name = "Toggle Flight"
@@ -81,12 +80,12 @@
if(H.movement_type & FLYING)
to_chat(H, "You settle gently back onto the ground...")
A.ToggleFlight(H,0)
- H.update_canmove()
+ H.update_mobility()
else
to_chat(H, "You beat your wings and begin to hover gently above the ground...")
- H.resting = 0
+ H.set_resting(FALSE, TRUE)
A.ToggleFlight(H,1)
- H.update_canmove()
+ H.update_mobility()
/datum/species/angel/proc/flyslip(mob/living/carbon/human/H)
var/obj/buckled_obj
diff --git a/code/modules/mob/living/carbon/human/species_types/flypeople.dm b/code/modules/mob/living/carbon/human/species_types/flypeople.dm
index 71f5aaa8e2..ee4ef83a44 100644
--- a/code/modules/mob/living/carbon/human/species_types/flypeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/flypeople.dm
@@ -24,7 +24,7 @@
H.vomit(0, FALSE, FALSE, 2, TRUE)
var/obj/effect/decal/cleanable/vomit/V = locate() in pos
if(V)
- H.reagents.trans_id_to(V, chem, chem.volume)
+ H.reagents.trans_id_to(V, chem.type, chem.volume)
playsound(pos, 'sound/effects/splat.ogg', 50, 1)
H.visible_message("[H] vomits on the floor!", \
"You throw up on the floor!")
diff --git a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
index eb1e194c0f..cf2950ff6f 100644
--- a/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/jellypeople.dm
@@ -83,6 +83,7 @@
button_icon_state = "slimeheal"
icon_icon = 'icons/mob/actions/actions_slime.dmi'
background_icon_state = "bg_alien"
+ required_mobility_flags = NONE
/datum/action/innate/regenerate_limbs/IsAvailable()
if(..())
diff --git a/code/modules/mob/living/carbon/human/species_types/podpeople.dm b/code/modules/mob/living/carbon/human/species_types/podpeople.dm
index b29890a97d..d2d4c6c658 100644
--- a/code/modules/mob/living/carbon/human/species_types/podpeople.dm
+++ b/code/modules/mob/living/carbon/human/species_types/podpeople.dm
@@ -58,7 +58,7 @@
if(/obj/item/projectile/energy/floramut)
if(prob(15))
H.rad_act(rand(30,80))
- H.Knockdown(100)
+ H.DefaultCombatKnockdown(100)
H.visible_message("[H] writhes in pain as [H.p_their()] vacuoles boil.", "You writhe in pain as your vacuoles boil!", "You hear the crunching of leaves.")
if(prob(80))
H.randmutb()
diff --git a/code/modules/mob/living/carbon/human/status_procs.dm b/code/modules/mob/living/carbon/human/status_procs.dm
index 49121c9409..37bafdab67 100644
--- a/code/modules/mob/living/carbon/human/status_procs.dm
+++ b/code/modules/mob/living/carbon/human/status_procs.dm
@@ -3,7 +3,7 @@
amount = dna.species.spec_stun(src,amount)
return ..()
-/mob/living/carbon/human/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg)
+/mob/living/carbon/human/DefaultCombatKnockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg)
amount = dna.species.spec_stun(src,amount)
return ..()
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index ccca90807b..639cfc40e2 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -280,7 +280,7 @@
if(miasma_partialpressure > MINIMUM_MOLES_DELTA_TO_MOVE)
if(prob(0.05 * miasma_partialpressure))
- var/datum/disease/advance/miasma_disease = new /datum/disease/advance/random(2,3)
+ var/datum/disease/advance/miasma_disease = new /datum/disease/advance/random(TRUE, 2,3)
miasma_disease.name = "Unknown"
ForceContractDisease(miasma_disease, TRUE, TRUE)
@@ -509,7 +509,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put
/mob/living/carbon/handle_status_effects()
..()
if(getStaminaLoss() && !combatmode)//CIT CHANGE - prevents stamina regen while combat mode is active
- adjustStaminaLoss(resting ? (recoveringstam ? -7.5 : -6) : -3)//CIT CHANGE - decreases adjuststaminaloss to stop stamina damage from being such a joke
+ adjustStaminaLoss(!CHECK_MOBILITY(src, MOBILITY_STAND) ? (recoveringstam ? -7.5 : -6) : -3)//CIT CHANGE - decreases adjuststaminaloss to stop stamina damage from being such a joke
if(!recoveringstam && incomingstammult != 1)
incomingstammult = max(0.01, incomingstammult)
@@ -521,7 +521,7 @@ GLOBAL_LIST_INIT(ballmer_windows_me_msg, list("Yo man, what if, we like, uh, put
bufferedstam = max(bufferedstam - drainrate, 0)
//END OF CIT CHANGES
- var/restingpwr = 1 + 4 * resting
+ var/restingpwr = 1 + 4 * !CHECK_MOBILITY(src, MOBILITY_STAND)
//Dizziness
if(dizziness)
diff --git a/code/modules/mob/living/carbon/monkey/combat.dm b/code/modules/mob/living/carbon/monkey/combat.dm
index 3277c57b75..a06d65ad4b 100644
--- a/code/modules/mob/living/carbon/monkey/combat.dm
+++ b/code/modules/mob/living/carbon/monkey/combat.dm
@@ -50,17 +50,11 @@
// taken from /mob/living/carbon/human/interactive/
/mob/living/carbon/monkey/proc/IsDeadOrIncap(checkDead = TRUE)
- if(!canmove)
- return 1
+ if(!CHECK_MOBILITY(src, MOBILITY_MOVE))
+ return TRUE
if(health <= 0 && checkDead)
- return 1
- if(IsUnconscious())
- return 1
- if(IsStun() || IsKnockdown())
- return 1
- if(stat)
- return 1
- return 0
+ return TRUE
+ return FALSE
/mob/living/carbon/monkey/proc/battle_screech()
if(next_battle_screech < world.time)
diff --git a/code/modules/mob/living/carbon/monkey/life.dm b/code/modules/mob/living/carbon/monkey/life.dm
index e83f67f796..31589f1cab 100644
--- a/code/modules/mob/living/carbon/monkey/life.dm
+++ b/code/modules/mob/living/carbon/monkey/life.dm
@@ -13,7 +13,7 @@
if(!client)
if(stat == CONSCIOUS)
- if(on_fire || buckled || restrained() || (resting && canmove)) //CIT CHANGE - makes it so monkeys attempt to resist if they're resting)
+ if(on_fire || buckled || restrained() || (!CHECK_MOBILITY(src, MOBILITY_STAND) && CHECK_MOBILITY(src, MOBILITY_MOVE))) //CIT CHANGE - makes it so monkeys attempt to resist if they're resting)
if(!resisting && prob(MONKEY_RESIST_PROB))
resisting = TRUE
walk_to(src,0)
@@ -21,7 +21,7 @@
else if(resisting)
resisting = FALSE
else if((mode == MONKEY_IDLE && !pickupTarget && !prob(MONKEY_SHENANIGAN_PROB)) || !handle_combat())
- if(prob(25) && canmove && isturf(loc) && !pulledby)
+ if(prob(25) && CHECK_MOBILITY(src, MOBILITY_MOVE) && isturf(loc) && !pulledby)
step(src, pick(GLOB.cardinals))
else if(prob(1))
emote(pick("scratch","jump","roll","tail"))
@@ -34,9 +34,9 @@
gorillize()
return
if(radiation > RAD_MOB_KNOCKDOWN && prob(RAD_MOB_KNOCKDOWN_PROB))
- if(!IsKnockdown())
+ if(!recoveringstam)
emote("collapse")
- Knockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
+ DefaultCombatKnockdown(RAD_MOB_KNOCKDOWN_AMOUNT)
to_chat(src, "You feel weak.")
if(radiation > RAD_MOB_MUTATE)
if(prob(1))
diff --git a/code/modules/mob/living/carbon/monkey/monkey.dm b/code/modules/mob/living/carbon/monkey/monkey.dm
index f3abe83958..e48fc722cd 100644
--- a/code/modules/mob/living/carbon/monkey/monkey.dm
+++ b/code/modules/mob/living/carbon/monkey/monkey.dm
@@ -43,7 +43,7 @@
/mob/living/carbon/monkey/ComponentInitialize()
. = ..()
- AddElement(/datum/element/mob_holder, "monkey", null, null, null, SLOT_HEAD)
+ AddElement(/datum/element/mob_holder, "monkey", null, null, null, ITEM_SLOT_HEAD)
/mob/living/carbon/monkey/Destroy()
diff --git a/code/modules/mob/living/carbon/monkey/monkey_defense.dm b/code/modules/mob/living/carbon/monkey/monkey_defense.dm
index 62550f4ccb..50793eb821 100644
--- a/code/modules/mob/living/carbon/monkey/monkey_defense.dm
+++ b/code/modules/mob/living/carbon/monkey/monkey_defense.dm
@@ -82,7 +82,7 @@
if(!IsUnconscious())
M.do_attack_animation(src, ATTACK_EFFECT_DISARM)
if (prob(25))
- Knockdown(40)
+ DefaultCombatKnockdown(40)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
log_combat(M, src, "pushed")
visible_message("[M] has pushed down [src]!", \
@@ -126,7 +126,7 @@
var/obj/item/I = null
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
if(prob(95))
- Knockdown(20)
+ DefaultCombatKnockdown(20)
visible_message("[M] has tackled down [name]!", \
"[M] has tackled down [name]!", null, COMBAT_MESSAGE_RANGE)
else
diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm
index abcb0589ae..d5e1fa6fc4 100644
--- a/code/modules/mob/living/damage_procs.dm
+++ b/code/modules/mob/living/damage_procs.dm
@@ -88,7 +88,7 @@
if(EFFECT_STUN)
Stun(effect * hit_percent)
if(EFFECT_KNOCKDOWN)
- Knockdown(effect * hit_percent, override_stamdmg = knockdown_stammax ? CLAMP(knockdown_stamoverride, 0, knockdown_stammax-getStaminaLoss()) : knockdown_stamoverride)
+ DefaultCombatKnockdown(effect * hit_percent, override_stamdmg = knockdown_stammax ? CLAMP(knockdown_stamoverride, 0, knockdown_stammax-getStaminaLoss()) : knockdown_stamoverride)
if(EFFECT_UNCONSCIOUS)
Unconscious(effect * hit_percent)
if(EFFECT_IRRADIATE)
diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm
index a33eebf12a..ad1a3bc9b9 100644
--- a/code/modules/mob/living/death.dm
+++ b/code/modules/mob/living/death.dm
@@ -78,7 +78,7 @@
update_action_buttons_icon()
update_damage_hud()
update_health_hud()
- update_canmove()
+ update_mobility()
med_hud_set_health()
med_hud_set_status()
if(!gibbed && !QDELETED(src))
diff --git a/code/modules/mob/living/emote.dm b/code/modules/mob/living/emote.dm
index 3221981e78..a1efae5838 100644
--- a/code/modules/mob/living/emote.dm
+++ b/code/modules/mob/living/emote.dm
@@ -273,7 +273,7 @@
if(H.get_num_arms() == 0)
if(H.get_num_legs() != 0)
message_param = "tries to point at %t with a leg, falling down in the process!"
- H.Knockdown(20)
+ H.DefaultCombatKnockdown(20)
else
message_param = "bumps [user.p_their()] head on the ground trying to motion towards %t."
H.adjustOrganLoss(ORGAN_SLOT_BRAIN, 5)
@@ -377,7 +377,7 @@
. = ..()
if(. && isliving(user))
var/mob/living/L = user
- L.Knockdown(200)
+ L.DefaultCombatKnockdown(200)
/datum/emote/living/sway
key = "sway"
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index df6257e38b..d9a22674ae 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -48,7 +48,7 @@
/mob/living/proc/ZImpactDamage(turf/T, levels)
visible_message("[src] crashes into [T] with a sickening noise!")
adjustBruteLoss((levels * 5) ** 1.5)
- Knockdown(levels * 50)
+ DefaultCombatKnockdown(levels * 50)
/mob/living/proc/OpenCraftingMenu()
@@ -88,7 +88,7 @@
var/they_can_move = TRUE
if(isliving(M))
var/mob/living/L = M
- they_can_move = L.canmove //L.mobility_flags & MOBILITY_MOVE
+ they_can_move = CHECK_MOBILITY(L, MOBILITY_MOVE)
//Also spread diseases
for(var/thing in diseases)
var/datum/disease/D = thing
@@ -115,7 +115,7 @@
return 1
//CIT CHANGES START HERE - makes it so resting stops you from moving through standing folks without a short delay
- if(resting && !L.resting)
+ if(!CHECK_MOBILITY(src, MOBILITY_STAND) && CHECK_MOBILITY(L, MOBILITY_STAND))
var/origtargetloc = L.loc
if(!pulledby)
if(attemptingcrawl)
@@ -125,7 +125,7 @@
return TRUE
attemptingcrawl = TRUE
visible_message("[src] is attempting to crawl under [L].", "You are now attempting to crawl under [L].")
- if(!do_after(src, CRAWLUNDER_DELAY, target = src) || !resting)
+ if(!do_after(src, CRAWLUNDER_DELAY, target = src) || CHECK_MOBILITY(src, MOBILITY_STAND))
attemptingcrawl = FALSE
return TRUE
var/src_passmob = (pass_flags & PASSMOB)
@@ -369,8 +369,8 @@
death()
-/mob/living/incapacitated(ignore_restraints, ignore_grab)
- if(stat || IsUnconscious() || IsStun() || IsKnockdown() || recoveringstam || (!ignore_restraints && restrained(ignore_grab))) // CIT CHANGE - adds recoveringstam check here
+/mob/living/incapacitated(ignore_restraints = FALSE, ignore_grab = FALSE, check_immobilized = FALSE)
+ if(stat || IsUnconscious() || IsStun() || IsParalyzed() || recoveringstam || (check_immobilized && IsImmobilized()) || (!ignore_restraints && restrained(ignore_grab)))
return TRUE
/mob/living/canUseStorage()
@@ -428,7 +428,6 @@
else
if(alert(src, "You sure you want to sleep for a while?", "Sleep", "Yes", "No") == "Yes")
SetSleeping(400) //Short nap
- update_canmove()
/mob/proc/get_contents()
@@ -493,7 +492,7 @@
stat = UNCONSCIOUS //the mob starts unconscious,
blind_eyes(1)
updatehealth() //then we check if the mob should wake up.
- update_canmove()
+ update_mobility()
update_sight()
clear_alert("not_enough_oxy")
reload_fullscreen()
@@ -512,8 +511,7 @@
setStaminaLoss(0, 0)
SetUnconscious(0, FALSE)
set_disgust(0)
- SetStun(0, FALSE)
- SetKnockdown(0, FALSE)
+ SetAllImmobility(0, FALSE)
SetSleeping(0, FALSE)
radiation = 0
nutrition = NUTRITION_LEVEL_FED + 50
@@ -528,7 +526,7 @@
ExtinguishMob()
fire_stacks = 0
confused = 0
- update_canmove()
+ update_mobility()
//Heal all organs
if(iscarbon(src))
var/mob/living/carbon/C = src
@@ -552,30 +550,6 @@
var/obj/item/item = i
SEND_SIGNAL(item, COMSIG_ITEM_WEARERCROSSED, AM)
-/mob/living/Move(atom/newloc, direct)
- if (buckled && buckled.loc != newloc) //not updating position
- if (!buckled.anchored)
- return buckled.Move(newloc, direct)
- else
- return 0
-
- var/old_direction = dir
- var/turf/T = loc
-
- if(pulling)
- update_pull_movespeed()
-
- . = ..()
-
- if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1)//separated from our puller and not in the middle of a diagonal move.
- pulledby.stop_pulling()
-
- if(active_storage && !(CanReach(active_storage.parent,view_only = TRUE)))
- active_storage.close(src)
-
- if(lying && !buckled && prob(getBruteLoss()*200/maxHealth))
- makeTrail(newloc, T, old_direction)
-
/mob/living/proc/makeTrail(turf/target_turf, turf/start, direction)
if(!has_gravity())
return
@@ -648,66 +622,97 @@
..(pressure_difference, direction, pressure_resistance_prob_delta)
/mob/living/can_resist()
- return !((next_move > world.time) || incapacitated(ignore_restraints = TRUE))
+ return !((next_move > world.time) || !CHECK_MOBILITY(src, MOBILITY_RESIST))
+/// Resist verb for attempting to get out of whatever is restraining your motion. Gives you resist clickdelay if do_resist() returns true.
/mob/living/verb/resist()
set name = "Resist"
set category = "IC"
if(!can_resist())
return
- changeNext_move(CLICK_CD_RESIST)
+ if(do_resist())
+ changeNext_move(CLICK_CD_RESIST)
+
+/// The actual proc for resisting. Return TRUE to give clickdelay.
+/mob/living/proc/do_resist()
SEND_SIGNAL(src, COMSIG_LIVING_RESIST, src)
//resisting grabs (as if it helps anyone...)
- if(!restrained(ignore_grab = 1) && pulledby)
- visible_message("[src] resists against [pulledby]'s grip!")
- log_combat(src, pulledby, "resisted grab")
- resist_grab()
- return
+ // only works if you're not cuffed.
+ if(!restrained(ignore_grab = TRUE) && pulledby)
+ var/old_gs = pulledby.grab_state
+ attempt_resist_grab(FALSE)
+ // Return as we should only resist one thing at a time. Give clickdelay if the grab wasn't passive.
+ return old_gs? TRUE : FALSE
- //unbuckling yourself
+ // unbuckling yourself. stops the chain if you try it.
if(buckled && last_special <= world.time)
- resist_buckle()
+ log_combat(src, buckled, "resisted buckle")
+ return resist_buckle()
- // CIT CHANGE - climbing out of a gut
- if(attempt_vr(src,"vore_process_resist",args)) return TRUE
+ // CIT CHANGE - climbing out of a gut.
+ if(attempt_vr(src,"vore_process_resist",args))
+ //Sure, give clickdelay for anti spam. shouldn't be combat voring anyways.
+ return TRUE
//Breaking out of a container (Locker, sleeper, cryo...)
- else if(isobj(loc))
+ if(isobj(loc))
var/obj/C = loc
C.container_resist(src)
+ // This shouldn't give clickdelays sometime (e.g. going out of a mech/unwelded and unlocked locker/disposals bin/etc) but there's so many overrides that I am not going to bother right now.
+ return TRUE
- else if(canmove)
+ if(CHECK_MOBILITY(src, MOBILITY_MOVE))
if(on_fire)
resist_fire() //stop, drop, and roll
- return
- if(resting) //cit change - allows resisting out of resting
- resist_a_rest() // ditto
- return
- if(resist_embedded()) //Citadel Change for embedded removal memes
- return
- if(last_special <= world.time)
- resist_restraints() //trying to remove cuffs.
- return
+ // Give clickdelay
+ return TRUE
+ if(resting) //cit change - allows resisting out of resting
+ resist_a_rest() // ditto
+ // DO NOT GIVE CLCIKDELAY - resist_a_rest() handles spam prevention. Somewhat.
+ return FALSE
+ if(last_special <= world.time)
+ resist_restraints() //trying to remove cuffs.
+ // DO NOT GIVE CLICKDELAY - last_special handles this.
+ return FALSE
+ if(CHECK_MOBILITY(src, MOBILITY_USE) && resist_embedded()) //Citadel Change for embedded removal memes - requires being able to use items.
+ // DO NOT GIVE DEFAULT CLICKDELAY - This is a combat action.
+ changeNext_move(CLICK_CD_MELEE)
+ return FALSE
+/// Proc to resist a grab. moving_resist is TRUE if this began by someone attempting to move. Return FALSE if still grabbed/failed to break out. Use this instead of resist_grab() directly.
+/mob/proc/attempt_resist_grab(moving_resist, forced, log = TRUE)
+ if(!pulledby) //not being grabbed
+ return TRUE
+ var/old_gs = pulledby.grab_state //how strong the grab is
+ var/old_pulled = pulledby
+ var/success = do_resist_grab(moving_resist, forced)
+ if(log)
+ log_combat(src, old_pulled, "[success? "successfully broke free of" : "failed to resist"] a grab of strength [old_gs][moving_resist? " (moving)":""][forced? " (forced)":""]")
+ return success
-/mob/proc/resist_grab(moving_resist)
- return 1 //returning 0 means we successfully broke free
+/*!
+ * Proc that actually does the grab resisting. Return TRUE if successful. Does not check that a grab exists! Use attempt_resist_grab() instead of this in general!
+ * Forced is if something other than the user mashing movement keys/pressing resist button did it, silent is if it makes messages (like "attempted to resist" and "broken free").
+ * Forced does NOT force success!
+ */
+/mob/proc/do_resist_grab(moving_resist, forced, silent = FALSE)
+ return FALSE
-/mob/living/resist_grab(moving_resist)
- . = 1
+/mob/living/do_resist_grab(moving_resist, forced, silent = FALSE)
+ . = ..()
if(pulledby.grab_state)
- if(!resting && prob(30/pulledby.grab_state))
+ if(CHECK_MOBILITY(src, MOBILITY_STAND) && prob(30/pulledby.grab_state))
visible_message("[src] has broken free of [pulledby]'s grip!")
- log_combat(pulledby, src, "broke grab")
pulledby.stop_pulling()
- return 0
- if(moving_resist && client) //we resisted by trying to move
+ return TRUE
+ else if(moving_resist && client) //we resisted by trying to move // this is a horrible system and whoever thought using client instead of mob is okay is not an okay person
client.move_delay = world.time + 20
+ visible_message("[src] resists against [pulledby]'s grip!")
else
pulledby.stop_pulling()
- return 0
+ return TRUE
/mob/living/proc/resist_buckle()
buckled.user_unbuckle_mob(src,src)
@@ -1048,7 +1053,7 @@
"[C] trips over [src] and falls!", \
"[C] topples over [src]!", \
"[C] leaps out of [src]'s way!")]")
- C.Knockdown(40)
+ C.DefaultCombatKnockdown(40)
/mob/living/ConveyorMove()
if((movement_type & FLYING) && !stat)
@@ -1058,61 +1063,6 @@
/mob/living/can_be_pulled()
return ..() && !(buckled && buckled.buckle_prevents_pull)
-//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
-//Robots, animals and brains have their own version so don't worry about them
-/mob/living/proc/update_canmove()
- var/ko = IsKnockdown() || IsUnconscious() || (stat && (stat != SOFT_CRIT || pulledby)) || (HAS_TRAIT(src, TRAIT_DEATHCOMA))
- var/move_and_fall = stat == SOFT_CRIT && !pulledby
- var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
- var/buckle_lying = !(buckled && !buckled.buckle_lying)
- var/has_legs = get_num_legs()
- var/has_arms = get_num_arms()
- var/ignore_legs = get_leg_ignore()
- var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground
- if(ko || move_and_fall || IsStun() || chokehold) // Cit change - makes resting not force you to drop everything
- drop_all_held_items()
- unset_machine()
- if(pulling)
- stop_pulling()
- else if(resting) //CIT CHANGE - makes resting make you stop pulling and interacting with machines
- unset_machine() //CIT CHANGE - Ditto!
- if(pulling) //CIT CHANGE - Ditto.
- stop_pulling() //CIT CHANGE - Ditto...
- else if(has_legs || ignore_legs)
- lying = 0
- if (pulledby && isliving(pulledby))
- var/mob/living/L = pulledby
- L.update_pull_movespeed()
- if(buckled)
- lying = 90*buckle_lying
- else if(!lying)
- if(resting)
- lying = pick(90, 270) // Cit change - makes resting not force you to drop your held items
- if(has_gravity()) // Cit change - Ditto
- playsound(src, "bodyfall", 50, 1) // Cit change - Ditto!
- else if(ko || move_and_fall || (!has_legs && !ignore_legs) || chokehold)
- fall(forced = 1)
- canmove = !(ko || recoveringstam || pinned || IsStun() || IsFrozen() || chokehold || buckled || (!has_legs && !ignore_legs && !has_arms)) //Cit change - makes it plausible to move while resting, adds pinning and stamina crit
- density = !lying
- if(resting)
- ENABLE_BITFIELD(movement_type, CRAWLING)
- else
- DISABLE_BITFIELD(movement_type, CRAWLING)
- if(lying)
- if(layer == initial(layer)) //to avoid special cases like hiding larvas.
- layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
- else
- if(layer == LYING_MOB_LAYER)
- layer = initial(layer)
- update_transform()
- if(!lying && lying_prev)
- if(client)
- client.move_delay = world.time + movement_delay()
- lying_prev = lying
- if(canmove && !intentionalresting && iscarbon(src) && client && client.prefs && client.prefs.autostand)//CIT CHANGE - adds autostanding as a preference
- addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto
- return canmove
-
/mob/living/proc/AddAbility(obj/effect/proc_holder/A)
abilities.Add(A)
A.on_gain(src)
@@ -1140,42 +1090,6 @@
return LINGHIVE_LINK
return LINGHIVE_NONE
-/mob/living/forceMove(atom/destination)
- stop_pulling()
- if(buckled)
- buckled.unbuckle_mob(src, force = TRUE)
- if(has_buckled_mobs())
- unbuckle_all_mobs(force = TRUE)
- . = ..()
- if(.)
- if(client)
- reset_perspective()
- update_canmove() //if the mob was asleep inside a container and then got forceMoved out we need to make them fall.
-
-/mob/living/proc/update_z(new_z) // 1+ to register, null to unregister
- if(isnull(new_z) && audiovisual_redirect)
- return
- if (registered_z != new_z)
- if (registered_z)
- SSmobs.clients_by_zlevel[registered_z] -= src
- if (client || audiovisual_redirect)
- if (new_z)
- SSmobs.clients_by_zlevel[new_z] += src
- for (var/I in length(SSidlenpcpool.idle_mobs_by_zlevel[new_z]) to 1 step -1) //Backwards loop because we're removing (guarantees optimal rather than worst-case performance), it's fine to use .len here but doesn't compile on 511
- var/mob/living/simple_animal/SA = SSidlenpcpool.idle_mobs_by_zlevel[new_z][I]
- if (SA)
- SA.toggle_ai(AI_ON) // Guarantees responsiveness for when appearing right next to mobs
- else
- SSidlenpcpool.idle_mobs_by_zlevel[new_z] -= SA
-
- registered_z = new_z
- else
- registered_z = null
-
-/mob/living/onTransitZ(old_z,new_z)
- ..()
- update_z(new_z)
-
/mob/living/MouseDrop(mob/over)
. = ..()
var/mob/living/user = usr
@@ -1222,14 +1136,6 @@
GLOB.dead_mob_list += src
. = ..()
switch(var_name)
- if("knockdown")
- SetKnockdown(var_value)
- if("stun")
- SetStun(var_value)
- if("unconscious")
- SetUnconscious(var_value)
- if("sleeping")
- SetSleeping(var_value)
if("eye_blind")
set_blindness(var_value)
if("eye_damage")
@@ -1261,21 +1167,20 @@
SetSleeping(clamp_unconscious_to)
if(AmountUnconscious() > clamp_unconscious_to)
SetUnconscious(clamp_unconscious_to)
- if(AmountStun() > clamp_immobility_to)
- SetStun(clamp_immobility_to)
- if(AmountKnockdown() > clamp_immobility_to)
- SetKnockdown(clamp_immobility_to)
+ HealAllImmobilityUpTo(clamp_immobility_to)
adjustStaminaLoss(min(0, -stamina_boost))
adjustStaminaLossBuffered(min(0, -stamina_buffer_boost))
if(scale_stamina_loss_recovery)
adjustStaminaLoss(min(-((getStaminaLoss() - stamina_loss_recovery_bypass) * scale_stamina_loss_recovery), 0))
if(put_on_feet)
- resting = FALSE
- lying = FALSE
+ set_resting(FALSE, TRUE, FALSE)
if(reset_misc)
stuttering = 0
updatehealth()
update_stamina()
- update_canmove()
+ update_mobility()
if(healing_chems)
reagents.add_reagent_list(healing_chems)
+
+/mob/living/canface()
+ return ..() && CHECK_MOBILITY(src, MOBILITY_MOVE)
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index 6a14cce4af..9c67498935 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -261,21 +261,21 @@
else
visible_message("[user] has grabbed [src] aggressively!", \
"[user] has grabbed you aggressively!")
- drop_all_held_items()
+ update_mobility()
stop_pulling()
log_combat(user, src, "grabbed", addition="aggressive grab[add_log]")
if(GRAB_NECK)
log_combat(user, src, "grabbed", addition="neck grab")
visible_message("[user] has grabbed [src] by the neck!",\
"[user] has grabbed you by the neck!")
- update_canmove() //we fall down
+ update_mobility() //we fall down
if(!buckled && !density)
Move(user.loc)
if(GRAB_KILL)
log_combat(user, src, "strangled", addition="kill grab")
visible_message("[user] is strangling [src]!", \
"[user] is strangling you!")
- update_canmove() //we fall down
+ update_mobility() //we fall down
if(!buckled && !density)
Move(user.loc)
return 1
diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm
index 7106d003ee..ed46568489 100644
--- a/code/modules/mob/living/living_defines.dm
+++ b/code/modules/mob/living/living_defines.dm
@@ -22,6 +22,8 @@
var/staminaloss = 0 //Stamina damage, or exhaustion. You recover it slowly naturally, and are knocked down if it gets too high. Holodeck and hallucinations deal this.
var/crit_threshold = HEALTH_THRESHOLD_CRIT // when the mob goes from "normal" to crit
+ var/mobility_flags = MOBILITY_FLAGS_DEFAULT
+
var/confused = 0 //Makes the mob move in random directions.
var/hallucination = 0 //Directly affects how long a mob will hallucinate for
@@ -112,4 +114,7 @@
var/drag_slowdown = TRUE //Whether the mob is slowed down when dragging another prone mob
- var/rotate_on_lying = FALSE
\ No newline at end of file
+ var/rotate_on_lying = FALSE
+
+ /// Next world.time when we can get the "you can't move while buckled to [thing]" message.
+ var/buckle_message_cooldown = 0
diff --git a/code/modules/mob/living/living_mobility.dm b/code/modules/mob/living/living_mobility.dm
new file mode 100644
index 0000000000..4b2afd0448
--- /dev/null
+++ b/code/modules/mob/living/living_mobility.dm
@@ -0,0 +1,155 @@
+/// IN THE FUTURE, WE WILL PROBABLY REFACTOR TO LESSEN THE NEED FOR UPDATE_MOBILITY, BUT FOR NOW.. WE CAN START DOING THIS.
+/// FOR BLOCKING MOVEMENT, USE TRAIT_MOBILITY_NOMOVE AS MUCH AS POSSIBLE. IT WILL MAKE REFACTORS IN THE FUTURE EASIER.
+/mob/living/ComponentInitialize()
+ . = ..()
+ RegisterSignal(src, SIGNAL_TRAIT(TRAIT_MOBILITY_NOMOVE), .proc/update_mobility)
+ RegisterSignal(src, SIGNAL_TRAIT(TRAIT_MOBILITY_NOPICKUP), .proc/update_mobility)
+ RegisterSignal(src, SIGNAL_TRAIT(TRAIT_MOBILITY_NOUSE), .proc/update_mobility)
+
+//Stuff like mobility flag updates, resting updates, etc.
+
+//Force-set resting variable, without needing to resist/etc.
+/mob/living/proc/set_resting(new_resting, silent = FALSE, updating = TRUE)
+ if(new_resting != resting)
+ resting = new_resting
+ if(!silent)
+ to_chat(src, "You are now [resting? "resting" : "getting up"].")
+ update_resting(updating)
+
+/mob/living/proc/update_resting(update_mobility = TRUE)
+ if(update_mobility)
+ update_mobility()
+
+//Force mob to rest, does NOT do stamina damage.
+//It's really not recommended to use this proc to give feedback, hence why silent is defaulting to true.
+/mob/living/proc/KnockToFloor(disarm_items = FALSE, silent = TRUE, updating = TRUE)
+ if(!silent && !resting)
+ to_chat(src, "You are knocked to the floor!")
+ set_resting(TRUE, TRUE, updating)
+ if(disarm_items)
+ drop_all_held_items()
+
+/mob/living/proc/lay_down()
+ set name = "Rest"
+ set category = "IC"
+ if(client?.prefs?.autostand)
+ intentionalresting = !intentionalresting
+ to_chat(src, "You are now attempting to [intentionalresting ? "[!resting ? "lay down and ": ""]stay down" : "[resting ? "get up and ": ""]stay up"].")
+ if(intentionalresting && !resting)
+ set_resting(TRUE, FALSE)
+ else
+ resist_a_rest()
+ else
+ if(!resting)
+ set_resting(TRUE, FALSE)
+ to_chat(src, "You are now laying down.")
+ else
+ resist_a_rest()
+
+/mob/living/proc/resist_a_rest(automatic = FALSE, ignoretimer = FALSE) //Lets mobs resist out of resting. Major QOL change with combat reworks.
+ set_resting(FALSE, TRUE)
+ return TRUE
+
+//Updates canmove, lying and icons. Could perhaps do with a rename but I can't think of anything to describe it.
+//Robots, animals and brains have their own version so don't worry about them
+/mob/living/proc/update_mobility()
+ var/stat_softcrit = stat == SOFT_CRIT
+ var/stat_conscious = (stat == CONSCIOUS) || stat_softcrit
+
+ var/conscious = !IsUnconscious() && stat_conscious && !HAS_TRAIT(src, TRAIT_DEATHCOMA)
+
+ var/has_arms = get_num_arms()
+ var/has_legs = get_num_legs()
+ var/ignore_legs = get_leg_ignore()
+ var/stun = IsStun()
+ var/paralyze = IsParalyzed()
+ var/knockdown = IsKnockdown()
+ var/daze = IsDazed()
+ var/immobilize = IsImmobilized()
+
+ var/chokehold = pulledby && pulledby.grab_state >= GRAB_NECK
+ var/restrained = restrained()
+ var/pinned = resting && pulledby && pulledby.grab_state >= GRAB_AGGRESSIVE // Cit change - adds pinning for aggressive-grabbing people on the ground
+ var/has_limbs = has_arms || ignore_legs || has_legs
+ var/canmove = !immobilize && !stun && conscious && !paralyze && (!stat_softcrit || !pulledby) && !chokehold && !IsFrozen() && has_limbs && !pinned && !recoveringstam
+ var/canresist = !stun && conscious && !stat_softcrit && !paralyze && has_limbs && !recoveringstam
+
+ if(canmove)
+ mobility_flags |= MOBILITY_MOVE
+ else
+ mobility_flags &= ~MOBILITY_MOVE
+
+ if(canresist)
+ mobility_flags |= MOBILITY_RESIST
+ else
+ mobility_flags &= ~MOBILITY_RESIST
+
+ var/canstand_involuntary = conscious && !stat_softcrit && !knockdown && !chokehold && !paralyze && (ignore_legs || has_legs) && !(buckled && buckled.buckle_lying) && !recoveringstam
+ var/canstand = canstand_involuntary && !resting
+
+ var/should_be_lying = !canstand
+ if(buckled)
+ if(buckled.buckle_lying != -1)
+ should_be_lying = buckled.buckle_lying
+
+ if(should_be_lying)
+ mobility_flags &= ~MOBILITY_STAND
+ if(!lying) //force them on the ground
+ lying = pick(90, 270)
+ if(has_gravity() && !buckled)
+ playsound(src, "bodyfall", 20, 1)
+ else
+ mobility_flags |= MOBILITY_STAND
+ lying = 0
+
+ if(should_be_lying || restrained || incapacitated())
+ mobility_flags &= ~(MOBILITY_UI|MOBILITY_PULL)
+ else
+ mobility_flags |= MOBILITY_UI|MOBILITY_PULL
+
+ var/canitem_general = !paralyze && !stun && conscious && !(stat_softcrit) && !chokehold && !restrained && has_arms && !recoveringstam
+ if(canitem_general)
+ mobility_flags |= (MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE | MOBILITY_HOLD)
+ else
+ mobility_flags &= ~(MOBILITY_USE | MOBILITY_PICKUP | MOBILITY_STORAGE | MOBILITY_HOLD)
+
+ if(HAS_TRAIT(src, TRAIT_MOBILITY_NOMOVE))
+ DISABLE_BITFIELD(mobility_flags, MOBILITY_MOVE)
+ if(HAS_TRAIT(src, TRAIT_MOBILITY_NOPICKUP))
+ DISABLE_BITFIELD(mobility_flags, MOBILITY_PICKUP)
+ if(HAS_TRAIT(src, TRAIT_MOBILITY_NOUSE))
+ DISABLE_BITFIELD(mobility_flags, MOBILITY_USE)
+
+ if(daze)
+ DISABLE_BITFIELD(mobility_flags, MOBILITY_USE)
+
+ //Handle update-effects.
+ if(!CHECK_MOBILITY(src, MOBILITY_HOLD))
+ drop_all_held_items()
+ if(!CHECK_MOBILITY(src, MOBILITY_PULL))
+ if(pulling)
+ stop_pulling()
+ if(!CHECK_MOBILITY(src, MOBILITY_UI))
+ unset_machine()
+
+ if(isliving(pulledby))
+ var/mob/living/L = pulledby
+ L.update_pull_movespeed()
+
+ //Handle lying down, voluntary or involuntary
+ density = !lying
+ if(lying)
+ set_resting(TRUE, TRUE, FALSE)
+ if(layer == initial(layer)) //to avoid special cases like hiding larvas.
+ layer = LYING_MOB_LAYER //so mob lying always appear behind standing mobs
+ else
+ if(layer == LYING_MOB_LAYER)
+ layer = initial(layer)
+ update_transform()
+ lying_prev = lying
+
+ //Handle citadel autoresist
+ if(CHECK_MOBILITY(src, MOBILITY_MOVE) && !intentionalresting && canstand_involuntary && iscarbon(src) && client?.prefs?.autostand)//CIT CHANGE - adds autostanding as a preference
+ addtimer(CALLBACK(src, .proc/resist_a_rest, TRUE), 0) //CIT CHANGE - ditto
+
+ return mobility_flags
diff --git a/code/modules/mob/living/living_movement.dm b/code/modules/mob/living/living_movement.dm
index e0ea6350d7..f278d22891 100644
--- a/code/modules/mob/living/living_movement.dm
+++ b/code/modules/mob/living/living_movement.dm
@@ -12,10 +12,14 @@
return (!density || lying)
if(buckled == mover)
return TRUE
- if(ismob(mover))
- if (mover in buckled_mobs)
+ if(!ismob(mover))
+ if(mover.throwing?.thrower == src)
return TRUE
- return (!mover.density || !density || lying || (mover.throwing && mover.throwing.thrower == src && !ismob(mover)))
+ if(ismob(mover))
+ if(mover in buckled_mobs)
+ return TRUE
+ var/mob/living/L = mover //typecast first, check isliving and only check this if living using short circuit
+ return (!density || (isliving(mover)? L.can_move_under_living(src) : !mover.density))
/mob/living/toggle_move_intent()
. = ..()
@@ -25,6 +29,10 @@
update_move_intent_slowdown()
return ..()
+/// whether or not we can slide under another living mob. defaults to if we're not dense. CanPass should check "overriding circumstances" like buckled mobs/having PASSMOB flag, etc.
+/mob/living/proc/can_move_under_living(mob/living/other)
+ return !density
+
/mob/living/proc/update_move_intent_slowdown()
var/mod = 0
if(m_intent == MOVE_INTENT_WALK)
@@ -50,4 +58,69 @@
remove_movespeed_modifier(MOVESPEED_ID_PRONE_DRAGGING)
/mob/living/canZMove(dir, turf/target)
- return can_zTravel(target, dir) && (movement_type & FLYING)
\ No newline at end of file
+ return can_zTravel(target, dir) && (movement_type & FLYING)
+
+/mob/living/Move(atom/newloc, direct)
+ if (buckled && buckled.loc != newloc) //not updating position
+ if (!buckled.anchored)
+ return buckled.Move(newloc, direct)
+ else
+ return 0
+
+ var/old_direction = dir
+ var/turf/T = loc
+
+ if(pulling)
+ update_pull_movespeed()
+
+ . = ..()
+
+ if(pulledby && moving_diagonally != FIRST_DIAG_STEP && get_dist(src, pulledby) > 1)//separated from our puller and not in the middle of a diagonal move.
+ pulledby.stop_pulling()
+
+ if(active_storage && !(CanReach(active_storage.parent,view_only = TRUE)))
+ active_storage.close(src)
+
+ if(lying && !buckled && prob(getBruteLoss()*200/maxHealth))
+ makeTrail(newloc, T, old_direction)
+
+/mob/living/forceMove(atom/destination)
+ stop_pulling()
+ if(buckled)
+ buckled.unbuckle_mob(src, force = TRUE)
+ if(has_buckled_mobs())
+ unbuckle_all_mobs(force = TRUE)
+ . = ..()
+ if(.)
+ if(client)
+ reset_perspective()
+ update_mobility() //if the mob was asleep inside a container and then got forceMoved out we need to make them fall.
+
+/mob/living/proc/update_z(new_z) // 1+ to register, null to unregister
+ if(isnull(new_z) && audiovisual_redirect)
+ return
+ if (registered_z != new_z)
+ if (registered_z)
+ SSmobs.clients_by_zlevel[registered_z] -= src
+ if (client || audiovisual_redirect)
+ if (new_z)
+ SSmobs.clients_by_zlevel[new_z] += src
+ for (var/I in length(SSidlenpcpool.idle_mobs_by_zlevel[new_z]) to 1 step -1) //Backwards loop because we're removing (guarantees optimal rather than worst-case performance), it's fine to use .len here but doesn't compile on 511
+ var/mob/living/simple_animal/SA = SSidlenpcpool.idle_mobs_by_zlevel[new_z][I]
+ if (SA)
+ SA.toggle_ai(AI_ON) // Guarantees responsiveness for when appearing right next to mobs
+ else
+ SSidlenpcpool.idle_mobs_by_zlevel[new_z] -= SA
+
+ registered_z = new_z
+ else
+ registered_z = null
+
+/mob/living/onTransitZ(old_z,new_z)
+ ..()
+ update_z(new_z)
+
+/mob/living/canface()
+ if(!CHECK_MOBILITY(src, MOBILITY_MOVE))
+ return FALSE
+ return ..()
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 3b15c47bcb..703e5cefac 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -18,7 +18,7 @@
icon_state = "ai"
move_resist = MOVE_FORCE_OVERPOWERING
density = TRUE
- canmove = FALSE
+ mobility_flags = ALL
status_flags = CANSTUN|CANPUSH
a_intent = INTENT_HARM //so we always get pushed instead of trying to swap
sight = SEE_TURFS | SEE_MOBS | SEE_OBJS
@@ -324,8 +324,10 @@
to_chat(src, "You are now [is_anchored ? "" : "un"]anchored.")
// the message in the [] will change depending whether or not the AI is anchored
-/mob/living/silicon/ai/update_canmove() //If the AI dies, mobs won't go through it anymore
- return 0
+// AIs are immobile
+/mob/living/silicon/ai/update_mobility()
+ mobility_flags = ALL
+ return ALL
/mob/living/silicon/ai/proc/ai_cancel_call()
set category = "Malfunction"
@@ -987,7 +989,7 @@
deployed_shell.undeploy()
diag_hud_set_deployed()
-/mob/living/silicon/ai/resist()
+/mob/living/silicon/ai/do_resist()
return
/mob/living/silicon/ai/spawned/Initialize(mapload, datum/ai_laws/L, mob/target_ai)
diff --git a/code/modules/mob/living/silicon/ai/death.dm b/code/modules/mob/living/silicon/ai/death.dm
index f978b7b697..afabafd929 100644
--- a/code/modules/mob/living/silicon/ai/death.dm
+++ b/code/modules/mob/living/silicon/ai/death.dm
@@ -15,7 +15,7 @@
cameraFollow = null
move_resist = MOVE_FORCE_NORMAL
- update_canmove()
+ update_mobility()
if(eyeobj)
eyeobj.setLoc(get_turf(src))
set_eyeobj_visible(FALSE)
diff --git a/code/modules/mob/living/silicon/pai/death.dm b/code/modules/mob/living/silicon/pai/death.dm
index 414ee2f3d7..c60d84438c 100644
--- a/code/modules/mob/living/silicon/pai/death.dm
+++ b/code/modules/mob/living/silicon/pai/death.dm
@@ -2,7 +2,7 @@
if(stat == DEAD)
return
stat = DEAD
- canmove = 0
+ update_mobility()
update_sight()
clear_fullscreens()
diff --git a/code/modules/mob/living/silicon/pai/pai.dm b/code/modules/mob/living/silicon/pai/pai.dm
index 074e637120..a65c1d24ac 100644
--- a/code/modules/mob/living/silicon/pai/pai.dm
+++ b/code/modules/mob/living/silicon/pai/pai.dm
@@ -80,7 +80,7 @@
var/radio_short_cooldown = 3 MINUTES
var/radio_short_timerid
- canmove = FALSE
+ mobility_flags = NONE
var/silent = FALSE
var/brightness_power = 5
@@ -101,7 +101,6 @@
START_PROCESSING(SSfastprocess, src)
GLOB.pai_list += src
make_laws()
- canmove = 0
if(!istype(P)) //when manually spawning a pai, we create a card to put it into.
var/newcardloc = P
P = new /obj/item/paicard(newcardloc)
diff --git a/code/modules/mob/living/silicon/pai/pai_defense.dm b/code/modules/mob/living/silicon/pai/pai_defense.dm
index 93cf10706a..0477492c0a 100644
--- a/code/modules/mob/living/silicon/pai/pai_defense.dm
+++ b/code/modules/mob/living/silicon/pai/pai_defense.dm
@@ -8,7 +8,7 @@
if(. & EMP_PROTECT_SELF)
return
take_holo_damage(50/severity)
- Knockdown(400/severity)
+ DefaultCombatKnockdown(400/severity)
silent = max(silent, (PAI_EMP_SILENCE_DURATION) / SSmobs.wait / severity)
if(holoform)
fold_in(force = TRUE)
@@ -23,10 +23,10 @@
qdel(src)
if(2)
fold_in(force = 1)
- Knockdown(400)
+ DefaultCombatKnockdown(400)
if(3)
fold_in(force = 1)
- Knockdown(200)
+ DefaultCombatKnockdown(200)
//ATTACK HAND IGNORING PARENT RETURN VALUE
/mob/living/silicon/pai/attack_hand(mob/living/carbon/human/user)
@@ -98,7 +98,7 @@
take_holo_damage(amount * 0.25)
/mob/living/silicon/pai/adjustOrganLoss(slot, amount, maximum = 500) //I kept this in, unlike tg
- Knockdown(amount * 0.2)
+ DefaultCombatKnockdown(amount * 0.2)
/mob/living/silicon/pai/getBruteLoss()
return emittermaxhealth - emitterhealth
diff --git a/code/modules/mob/living/silicon/pai/pai_shell.dm b/code/modules/mob/living/silicon/pai/pai_shell.dm
index 641ad6dde0..7de983229e 100644
--- a/code/modules/mob/living/silicon/pai/pai_shell.dm
+++ b/code/modules/mob/living/silicon/pai/pai_shell.dm
@@ -17,7 +17,6 @@
return FALSE
emitter_next_use = world.time + emittercd
- canmove = TRUE
density = TRUE
if(istype(card.loc, /obj/item/pda))
var/obj/item/pda/P = card.loc
@@ -37,6 +36,7 @@
C.push_data()
forceMove(get_turf(card))
card.forceMove(src)
+ update_mobility()
if(client)
client.perspective = EYE_PERSPECTIVE
client.eye = src
@@ -63,12 +63,11 @@
var/turf/T = drop_location()
card.forceMove(T)
forceMove(card)
- canmove = FALSE
density = FALSE
set_light(0)
holoform = FALSE
- if(resting)
- lay_down()
+ set_resting(FALSE, TRUE, FALSE)
+ update_mobility()
/mob/living/silicon/pai/proc/choose_chassis()
if(!isturf(loc) && loc != card)
@@ -99,7 +98,7 @@
current_mob_holder?.Detach(src)
current_mob_holder = null
if(possible_chassis[chassis])
- current_mob_holder = AddElement(/datum/element/mob_holder, chassis, 'icons/mob/pai_item_head.dmi', 'icons/mob/pai_item_rh.dmi', 'icons/mob/pai_item_lh.dmi', SLOT_HEAD)
+ current_mob_holder = AddElement(/datum/element/mob_holder, chassis, 'icons/mob/pai_item_head.dmi', 'icons/mob/pai_item_rh.dmi', 'icons/mob/pai_item_lh.dmi', ITEM_SLOT_HEAD)
to_chat(src, "You switch your holochassis projection composite to [chassis]")
/mob/living/silicon/pai/lay_down()
diff --git a/code/modules/mob/living/silicon/robot/death.dm b/code/modules/mob/living/silicon/robot/death.dm
index 23531e9f72..6a5338c1f5 100644
--- a/code/modules/mob/living/silicon/robot/death.dm
+++ b/code/modules/mob/living/silicon/robot/death.dm
@@ -21,7 +21,7 @@
locked = FALSE //unlock cover
- update_canmove()
+ update_mobility()
if(!QDELETED(builtInCamera) && builtInCamera.status)
builtInCamera.toggle_cam(src,0)
update_headlamp(1) //So borg lights are disabled when killed.
diff --git a/code/modules/mob/living/silicon/robot/life.dm b/code/modules/mob/living/silicon/robot/life.dm
index 26305eedb1..cf67517c52 100644
--- a/code/modules/mob/living/silicon/robot/life.dm
+++ b/code/modules/mob/living/silicon/robot/life.dm
@@ -91,12 +91,3 @@
add_overlay(fire_overlay)
else
cut_overlay(fire_overlay)
-
-/mob/living/silicon/robot/update_canmove()
- if(stat || buckled || lockcharge || resting) //CITADEL EDIT resting dogborg-os
- canmove = 0
- else
- canmove = 1
- update_transform()
- update_action_buttons_icon()
- return canmove
diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm
index 86e3ccad24..d4f520a611 100644
--- a/code/modules/mob/living/silicon/robot/robot.dm
+++ b/code/modules/mob/living/silicon/robot/robot.dm
@@ -64,7 +64,7 @@
var/lawupdate = 1 //Cyborgs will sync their laws with their AI by default
var/scrambledcodes = 0 // Used to determine if a borg shows up on the robotics console. Setting to one hides them.
- var/lockcharge //Boolean of whether the borg is locked down or not
+ var/locked_down //Boolean of whether the borg is locked down or not
var/toner = 0
var/tonermax = 40
@@ -493,7 +493,7 @@
update_icons()
else if(istype(W, /obj/item/wrench) && opened && !cell) //Deconstruction. The flashes break from the fall, to prevent this from being a ghetto reset module.
- if(!lockcharge)
+ if(!locked_down)
to_chat(user, "[src]'s bolts spark! Maybe you should lock them down first!")
spark_system.start()
return
@@ -655,65 +655,6 @@
/mob/living/silicon/robot/regenerate_icons()
return update_icons()
-/mob/living/silicon/robot/update_icons()
- cut_overlays()
- icon_state = module.cyborg_base_icon
- //Citadel changes start here - Allows modules to use different icon files, and allows modules to specify a pixel offset
- icon = (module.cyborg_icon_override ? module.cyborg_icon_override : initial(icon))
- if(laser)
- add_overlay("laser")//Is this even used??? - Yes borg/inventory.dm
- if(disabler)
- add_overlay("disabler")//ditto
-
- if(sleeper_g && module.sleeper_overlay)
- add_overlay("[module.sleeper_overlay]_g[sleeper_nv ? "_nv" : ""]")
- if(sleeper_r && module.sleeper_overlay)
- add_overlay("[module.sleeper_overlay]_r[sleeper_nv ? "_nv" : ""]")
- if(stat == DEAD && module.has_snowflake_deadsprite)
- icon_state = "[module.cyborg_base_icon]-wreck"
-
- if(module.cyborg_pixel_offset)
- pixel_x = module.cyborg_pixel_offset
- //End of citadel changes
-
- if(module.cyborg_base_icon == "robot")
- icon = 'icons/mob/robots.dmi'
- pixel_x = initial(pixel_x)
- if(stat != DEAD && !(IsUnconscious() || IsStun() || IsKnockdown() || low_power_mode)) //Not dead, not stunned.
- if(!eye_lights)
- eye_lights = new()
- if(lamp_intensity > 2)
- eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_l"
- else
- eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_e[is_servant_of_ratvar(src) ? "_r" : ""]"
- eye_lights.icon = icon
- add_overlay(eye_lights)
-
- if(opened)
- if(wiresexposed)
- add_overlay("ov-opencover +w")
- else if(cell)
- add_overlay("ov-opencover +c")
- else
- add_overlay("ov-opencover -c")
- if(hat)
- var/mutable_appearance/head_overlay = hat.build_worn_icon(state = hat.icon_state, default_layer = 20, default_icon_file = 'icons/mob/head.dmi')
- head_overlay.pixel_y += hat_offset
- add_overlay(head_overlay)
- update_fire()
-
- if(client && stat != DEAD && module.dogborg == TRUE)
- if(resting)
- if(sitting)
- icon_state = "[module.cyborg_base_icon]-sit"
- if(bellyup)
- icon_state = "[module.cyborg_base_icon]-bellyup"
- else if(!sitting && !bellyup)
- icon_state = "[module.cyborg_base_icon]-rest"
- cut_overlays()
- else
- icon_state = "[module.cyborg_base_icon]"
-
/mob/living/silicon/robot/proc/self_destruct()
if(emagged)
if(mmi)
@@ -728,8 +669,6 @@
connected_ai.connected_robots -= src
src.connected_ai = null
lawupdate = 0
- lockcharge = 0
- canmove = 1
scrambledcodes = 1
//Disconnect it's camera so it's not so easily tracked.
if(!QDELETED(builtInCamera))
@@ -738,6 +677,7 @@
// Instead of being listed as "deactivated". The downside is that I'm going
// to have to check if every camera is null or not before doing anything, to prevent runtime errors.
// I could change the network to null but I don't know what would happen, and it seems too hacky for me.
+ update_mobility()
/mob/living/silicon/robot/mode()
set name = "Activate Held Object"
@@ -759,8 +699,8 @@
throw_alert("locked", /obj/screen/alert/locked)
else
clear_alert("locked")
- lockcharge = state
- update_canmove()
+ locked_down = state
+ update_mobility()
/mob/living/silicon/robot/proc/SetEmagged(new_state)
emagged = new_state
@@ -949,7 +889,7 @@
to_chat(connected_ai, "
NOTICE - Remote telemetry lost with [name].
")
/mob/living/silicon/robot/canUseTopic(atom/movable/M, be_close=FALSE, no_dextery=FALSE, no_tk=FALSE)
- if(stat || lockcharge || low_power_mode)
+ if(stat || locked_down || low_power_mode)
to_chat(src, "You can't do that right now!")
return FALSE
if(be_close && !in_range(M, src))
@@ -1025,17 +965,17 @@
if(health <= -maxHealth) //die only once
death()
return
- if(IsUnconscious() || IsStun() || IsKnockdown() || getOxyLoss() > maxHealth*0.5)
+ if(IsUnconscious() || IsStun() || IsParalyzed() || getOxyLoss() > maxHealth*0.5)
if(stat == CONSCIOUS)
stat = UNCONSCIOUS
blind_eyes(1)
- update_canmove()
+ update_mobility()
update_headlamp()
else
if(stat == UNCONSCIOUS)
stat = CONSCIOUS
adjust_blindness(-1)
- update_canmove()
+ update_mobility()
update_headlamp()
diag_hud_set_status()
diag_hud_set_health()
@@ -1269,20 +1209,6 @@
for(var/i in connected_ai.aicamera.stored)
aicamera.stored[i] = TRUE
-/mob/living/silicon/robot/lay_down()
- ..()
- update_canmove()
-
-/mob/living/silicon/robot/update_canmove()
- ..()
- if(client && stat != DEAD && dogborg == FALSE)
- if(resting)
- cut_overlays()
- icon_state = "[module.cyborg_base_icon]-rest"
- else
- icon_state = "[module.cyborg_base_icon]"
- update_icons()
-
/mob/living/silicon/robot/proc/rest_style()
set name = "Switch Rest Style"
set category = "Robot Commands"
diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm
index e7b252a248..5750543a92 100644
--- a/code/modules/mob/living/silicon/robot/robot_defense.dm
+++ b/code/modules/mob/living/silicon/robot/robot_defense.dm
@@ -36,7 +36,7 @@
"[M] has disabled [src]'s active module!", null, COMBAT_MESSAGE_RANGE)
log_combat(M, src, "disarmed", "[I ? " removing \the [I]" : ""]")
else
- Stun(40)
+ Paralyze(40)
step(src,get_dir(M,src))
log_combat(M, src, "pushed")
visible_message("[M] has forced back [src]!", \
@@ -86,9 +86,9 @@
return
switch(severity)
if(1)
- Stun(160)
+ Paralyze(160)
if(2)
- Stun(60)
+ Paralyze(60)
/mob/living/silicon/robot/emag_act(mob/user)
diff --git a/code/modules/mob/living/silicon/robot/robot_mobility.dm b/code/modules/mob/living/silicon/robot/robot_mobility.dm
new file mode 100644
index 0000000000..c5863b523f
--- /dev/null
+++ b/code/modules/mob/living/silicon/robot/robot_mobility.dm
@@ -0,0 +1,15 @@
+/mob/living/silicon/robot/update_mobility()
+ var/newflags = NONE
+ if(!stat)
+ if(!resting)
+ newflags |= (MOBILITY_STAND | MOBILITY_RESIST)
+ if(!locked_down)
+ newflags |= MOBILITY_MOVE
+ newflags |= MOBILITY_PULL
+ if(!locked_down)
+ newflags |= MOBILITY_FLAGS_ANY_INTERACTION
+ mobility_flags = newflags
+ update_transform()
+ update_action_buttons_icon()
+ update_icons()
+ return mobility_flags
diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm
index f3e0816b1b..c45a472367 100644
--- a/code/modules/mob/living/silicon/robot/robot_modules.dm
+++ b/code/modules/mob/living/silicon/robot/robot_modules.dm
@@ -97,8 +97,8 @@
var/obj/item/stack/S = I
if(is_type_in_list(S, list(/obj/item/stack/sheet/metal, /obj/item/stack/rods, /obj/item/stack/tile/plasteel)))
- if(S.custom_materials?.len && S.custom_materials[getmaterialref(/datum/material/iron)])
- S.cost = S.custom_materials[getmaterialref(/datum/material/iron)] * 0.25
+ if(S.custom_materials?.len && S.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)])
+ S.cost = S.custom_materials[SSmaterials.GetMaterialRef(/datum/material/iron)] * 0.25
S.source = get_or_create_estorage(/datum/robot_energy_storage/metal)
else if(istype(S, /obj/item/stack/sheet/glass))
@@ -257,7 +257,7 @@
/obj/item/robot_module/proc/do_transform_delay()
var/mob/living/silicon/robot/R = loc
- var/prev_lockcharge = R.lockcharge
+ var/prev_locked_down = R.locked_down
sleep(1)
flick("[cyborg_base_icon]_transform", R)
R.notransform = TRUE
@@ -267,7 +267,7 @@
for(var/i in 1 to 4)
playsound(R, pick('sound/items/drill_use.ogg', 'sound/items/jaws_cut.ogg', 'sound/items/jaws_pry.ogg', 'sound/items/welder.ogg', 'sound/items/ratchet.ogg'), 80, 1, -1)
sleep(7)
- if(!prev_lockcharge)
+ if(!prev_locked_down)
R.SetLockdown(0)
R.setDir(SOUTH)
R.anchored = FALSE
diff --git a/code/modules/mob/living/silicon/robot/update_icons.dm b/code/modules/mob/living/silicon/robot/update_icons.dm
new file mode 100644
index 0000000000..8d40e35706
--- /dev/null
+++ b/code/modules/mob/living/silicon/robot/update_icons.dm
@@ -0,0 +1,59 @@
+/// this is bad code
+/mob/living/silicon/robot/update_icons()
+ cut_overlays()
+ icon_state = module.cyborg_base_icon
+ //Citadel changes start here - Allows modules to use different icon files, and allows modules to specify a pixel offset
+ icon = (module.cyborg_icon_override ? module.cyborg_icon_override : initial(icon))
+ if(laser)
+ add_overlay("laser")//Is this even used??? - Yes borg/inventory.dm
+ if(disabler)
+ add_overlay("disabler")//ditto
+
+ if(sleeper_g && module.sleeper_overlay)
+ add_overlay("[module.sleeper_overlay]_g[sleeper_nv ? "_nv" : ""]")
+ if(sleeper_r && module.sleeper_overlay)
+ add_overlay("[module.sleeper_overlay]_r[sleeper_nv ? "_nv" : ""]")
+ if(stat == DEAD && module.has_snowflake_deadsprite)
+ icon_state = "[module.cyborg_base_icon]-wreck"
+
+ if(module.cyborg_pixel_offset)
+ pixel_x = module.cyborg_pixel_offset
+ //End of citadel changes
+
+ if(module.cyborg_base_icon == "robot")
+ icon = 'icons/mob/robots.dmi'
+ pixel_x = initial(pixel_x)
+ if(stat != DEAD && !(IsUnconscious() ||IsStun() || IsKnockdown() || IsParalyzed() || low_power_mode)) //Not dead, not stunned.
+ if(!eye_lights)
+ eye_lights = new()
+ if(lamp_intensity > 2)
+ eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_l"
+ else
+ eye_lights.icon_state = "[module.special_light_key ? "[module.special_light_key]":"[module.cyborg_base_icon]"]_e[is_servant_of_ratvar(src) ? "_r" : ""]"
+ eye_lights.icon = icon
+ add_overlay(eye_lights)
+
+ if(opened)
+ if(wiresexposed)
+ add_overlay("ov-opencover +w")
+ else if(cell)
+ add_overlay("ov-opencover +c")
+ else
+ add_overlay("ov-opencover -c")
+ if(hat)
+ var/mutable_appearance/head_overlay = hat.build_worn_icon(state = hat.icon_state, default_layer = 20, default_icon_file = 'icons/mob/head.dmi')
+ head_overlay.pixel_y += hat_offset
+ add_overlay(head_overlay)
+ update_fire()
+
+ if(client && stat != DEAD && module.dogborg == TRUE)
+ if(resting)
+ if(sitting)
+ icon_state = "[module.cyborg_base_icon]-sit"
+ if(bellyup)
+ icon_state = "[module.cyborg_base_icon]-bellyup"
+ else if(!sitting && !bellyup)
+ icon_state = "[module.cyborg_base_icon]-rest"
+ cut_overlays()
+ else
+ icon_state = "[module.cyborg_base_icon]"
diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm
index 4cd8dd47e4..5d1d2610b9 100644
--- a/code/modules/mob/living/silicon/silicon_defense.dm
+++ b/code/modules/mob/living/silicon/silicon_defense.dm
@@ -32,7 +32,7 @@
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
if(prob(damage))
for(var/mob/living/N in buckled_mobs)
- N.Knockdown(20)
+ N.DefaultCombatKnockdown(20)
unbuckle_mob(N)
N.visible_message("[N] is knocked off of [src] by [M]!")
switch(M.melee_damage_type)
@@ -106,7 +106,7 @@
for(var/mob/living/M in buckled_mobs)
if(prob(severity*50))
unbuckle_mob(M)
- M.Knockdown(40)
+ M.DefaultCombatKnockdown(40)
M.visible_message("[M] is thrown off of [src]!")
flash_act(affect_silicon = 1)
@@ -123,7 +123,7 @@
for(var/mob/living/M in buckled_mobs)
M.visible_message("[M] is knocked off of [src]!")
unbuckle_mob(M)
- M.Knockdown(40)
+ M.DefaultCombatKnockdown(40)
if(P.stun || P.knockdown)
for(var/mob/living/M in buckled_mobs)
unbuckle_mob(M)
diff --git a/code/modules/mob/living/simple_animal/astral.dm b/code/modules/mob/living/simple_animal/astral.dm
index 6edf99981a..ebc89e2577 100644
--- a/code/modules/mob/living/simple_animal/astral.dm
+++ b/code/modules/mob/living/simple_animal/astral.dm
@@ -32,7 +32,6 @@
/mob/living/simple_animal/astral/death()
icon_state = "shade_dead"
Stun(1000)
- canmove = 0
friendly = "deads at"
pseudo_death = TRUE
incorporeal_move = 0
diff --git a/code/modules/mob/living/simple_animal/bot/bot.dm b/code/modules/mob/living/simple_animal/bot/bot.dm
index d5e6f687fb..75364b2845 100644
--- a/code/modules/mob/living/simple_animal/bot/bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/bot.dm
@@ -115,7 +115,7 @@
if(stat)
return FALSE
on = TRUE
- canmove = TRUE
+ update_mobility()
set_light(initial(light_range))
update_icon()
diag_hud_set_botstat()
@@ -123,7 +123,7 @@
/mob/living/simple_animal/bot/proc/turn_off()
on = FALSE
- canmove = FALSE
+ update_mobility()
set_light(0)
bot_reset() //Resets an AI's call, should it exist.
update_icon()
@@ -160,11 +160,11 @@
path_hud.add_to_hud(src)
path_hud.add_hud_to(src)
-/mob/living/simple_animal/bot/update_canmove()
+/mob/living/simple_animal/bot/update_mobility()
. = ..()
if(!on)
- . = 0
- canmove = .
+ . = NONE
+ mobility_flags = .
/mob/living/simple_animal/bot/Destroy()
if(path_hud)
diff --git a/code/modules/mob/living/simple_animal/bot/ed209bot.dm b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
index 6d304c6782..2ab0f1721c 100644
--- a/code/modules/mob/living/simple_animal/bot/ed209bot.dm
+++ b/code/modules/mob/living/simple_animal/bot/ed209bot.dm
@@ -525,7 +525,7 @@ Auto Patrol[]"},
return
if(iscarbon(A))
var/mob/living/carbon/C = A
- if(C.canmove || arrest_type) // CIT CHANGE - makes sentient ed209s check for canmove rather than !isstun.
+ if(CHECK_MOBILITY(C, MOBILITY_STAND|MOBILITY_MOVE|MOBILITY_USE) || arrest_type) // CIT CHANGE - makes sentient ed209s check for canmove rather than !isstun.
stun_attack(A)
else if(C.canBeHandcuffed() && !C.handcuffed)
cuff(A)
@@ -543,7 +543,7 @@ Auto Patrol[]"},
spawn(2)
icon_state = "[lasercolor]ed209[on]"
var/threat = 5
- C.Knockdown(100)
+ C.DefaultCombatKnockdown(100)
C.stuttering = 5
if(ishuman(C))
var/mob/living/carbon/human/H = C
diff --git a/code/modules/mob/living/simple_animal/bot/firebot.dm b/code/modules/mob/living/simple_animal/bot/firebot.dm
index 6ab4dc36db..a5ac2e8bca 100644
--- a/code/modules/mob/living/simple_animal/bot/firebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/firebot.dm
@@ -170,7 +170,7 @@
if(!..())
return
- if(IsStun())
+ if(IsStun() || IsParalyzed())
old_target_fire = target_fire
target_fire = null
mode = BOT_IDLE
@@ -287,7 +287,7 @@
if(!on)
icon_state = "firebot0"
return
- if(IsStun())
+ if(IsStun() || IsParalyzed())
icon_state = "firebots1"
else if(stationary_mode) //Bot has yellow light to indicate stationary mode.
icon_state = "firebots1"
diff --git a/code/modules/mob/living/simple_animal/bot/honkbot.dm b/code/modules/mob/living/simple_animal/bot/honkbot.dm
index e491cff74a..c3c16d5976 100644
--- a/code/modules/mob/living/simple_animal/bot/honkbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/honkbot.dm
@@ -196,7 +196,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
C.stuttering = 20
C.adjustEarDamage(0, 5) //far less damage than the H.O.N.K.
C.Jitter(50)
- C.Knockdown(60)
+ C.DefaultCombatKnockdown(60)
var/mob/living/carbon/human/H = C
if(client) //prevent spam from players..
spam_flag = TRUE
@@ -215,7 +215,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
"[src] has honked you!")
else
C.stuttering = 20
- C.Knockdown(80)
+ C.DefaultCombatKnockdown(80)
addtimer(CALLBACK(src, .proc/spam_flag_false), cooldowntime)
@@ -358,7 +358,7 @@ Maintenance panel panel is [open ? "opened" : "closed"]"},
"[C] trips over [src] and falls!", \
"[C] topples over [src]!", \
"[C] leaps out of [src]'s way!")]")
- C.Knockdown(10)
+ C.DefaultCombatKnockdown(10)
playsound(loc, 'sound/misc/sadtrombone.ogg', 50, 1, -1)
if(!client)
speak("Honk!")
diff --git a/code/modules/mob/living/simple_animal/bot/medbot.dm b/code/modules/mob/living/simple_animal/bot/medbot.dm
index bb29cd3526..d3fb65c585 100644
--- a/code/modules/mob/living/simple_animal/bot/medbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/medbot.dm
@@ -106,7 +106,7 @@
skin = new_skin
update_icon()
-/mob/living/simple_animal/bot/medbot/update_canmove()
+/mob/living/simple_animal/bot/medbot/update_mobility()
. = ..()
update_icon()
diff --git a/code/modules/mob/living/simple_animal/bot/mulebot.dm b/code/modules/mob/living/simple_animal/bot/mulebot.dm
index b5aa8b6967..ab7ce96336 100644
--- a/code/modules/mob/living/simple_animal/bot/mulebot.dm
+++ b/code/modules/mob/living/simple_animal/bot/mulebot.dm
@@ -662,7 +662,7 @@
if(!paicard)
log_combat(src, L, "knocked down")
visible_message("[src] knocks over [L]!")
- L.Knockdown(160)
+ L.DefaultCombatKnockdown(160)
return ..()
// called from mob/living/carbon/human/Crossed()
@@ -747,8 +747,8 @@
else
return null
-/mob/living/simple_animal/bot/mulebot/resist()
- ..()
+/mob/living/simple_animal/bot/mulebot/do_resist()
+ . = ..()
if(load)
unload()
diff --git a/code/modules/mob/living/simple_animal/bot/secbot.dm b/code/modules/mob/living/simple_animal/bot/secbot.dm
index 461fa9cf2a..3ff97f2cc0 100644
--- a/code/modules/mob/living/simple_animal/bot/secbot.dm
+++ b/code/modules/mob/living/simple_animal/bot/secbot.dm
@@ -213,7 +213,7 @@ Auto Patrol: []"},
return
if(iscarbon(A))
var/mob/living/carbon/C = A
- if(C.canmove || arrest_type) // CIT CHANGE - makes sentient secbots check for canmove rather than !isstun.
+ if(CHECK_MOBILITY(C, MOBILITY_MOVE|MOBILITY_USE|MOBILITY_STAND) || arrest_type) // CIT CHANGE - makes sentient secbots check for canmove rather than !isstun.
stun_attack(A)
else if(C.canBeHandcuffed() && !C.handcuffed)
cuff(A)
@@ -254,11 +254,11 @@ Auto Patrol: []"},
var/threat = 5
if(ishuman(C))
C.stuttering = 5
- C.Knockdown(100)
+ C.DefaultCombatKnockdown(100)
var/mob/living/carbon/human/H = C
threat = H.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
else
- C.Knockdown(100)
+ C.DefaultCombatKnockdown(100)
C.stuttering = 5
threat = C.assess_threat(judgement_criteria, weaponcheck=CALLBACK(src, .proc/check_for_weapons))
diff --git a/code/modules/mob/living/simple_animal/constructs.dm b/code/modules/mob/living/simple_animal/constructs.dm
index 4c6bfc4c3e..64b783b692 100644
--- a/code/modules/mob/living/simple_animal/constructs.dm
+++ b/code/modules/mob/living/simple_animal/constructs.dm
@@ -353,7 +353,7 @@
if(!LAZYLEN(parts))
if(undismembermerable_limbs) //they have limbs we can't remove, and no parts we can, attack!
return ..()
- C.Knockdown(60)
+ C.DefaultCombatKnockdown(60)
visible_message("[src] knocks [C] down!")
to_chat(src, "\"Bring [C.p_them()] to me.\"")
return FALSE
diff --git a/code/modules/mob/living/simple_animal/friendly/bumbles.dm b/code/modules/mob/living/simple_animal/friendly/bumbles.dm
index 17e1490c3f..013bb31b63 100644
--- a/code/modules/mob/living/simple_animal/friendly/bumbles.dm
+++ b/code/modules/mob/living/simple_animal/friendly/bumbles.dm
@@ -33,7 +33,7 @@
. = ..()
AddElement(/datum/element/wuv, "bzzs!")
-/mob/living/simple_animal/pet/bumbles/update_canmove()
+/mob/living/simple_animal/pet/bumbles/update_mobility()
. = ..()
if(client && stat != DEAD)
if (resting)
diff --git a/code/modules/mob/living/simple_animal/friendly/cat.dm b/code/modules/mob/living/simple_animal/friendly/cat.dm
index 0f95096497..1297fddb69 100644
--- a/code/modules/mob/living/simple_animal/friendly/cat.dm
+++ b/code/modules/mob/living/simple_animal/friendly/cat.dm
@@ -43,10 +43,10 @@
AddElement(/datum/element/wuv, "purrs!", EMOTE_AUDIBLE, /datum/mood_event/pet_animal, "hisses!", EMOTE_AUDIBLE)
AddElement(/datum/element/mob_holder, held_icon)
-/mob/living/simple_animal/pet/cat/update_canmove()
- ..()
+/mob/living/simple_animal/pet/cat/update_mobility()
+ . = ..()
if(client && stat != DEAD)
- if (resting)
+ if(!CHECK_MOBILITY(src, MOBILITY_STAND))
icon_state = "[icon_living]_rest"
collar_type = "[initial(collar_type)]_rest"
else
@@ -180,27 +180,24 @@
emote("me", EMOTE_VISIBLE, pick("stretches out for a belly rub.", "wags its tail.", "lies down."))
icon_state = "[icon_living]_rest"
collar_type = "[initial(collar_type)]_rest"
- resting = 1
- update_canmove()
+ set_resting(TRUE)
else if (prob(1))
emote("me", EMOTE_VISIBLE, pick("sits down.", "crouches on its hind legs.", "looks alert."))
icon_state = "[icon_living]_sit"
collar_type = "[initial(collar_type)]_sit"
- resting = 1
- update_canmove()
+ set_resting(TRUE)
else if (prob(1))
if (resting)
emote("me", EMOTE_VISIBLE, pick("gets up and meows.", "walks around.", "stops resting."))
icon_state = "[icon_living]"
collar_type = "[initial(collar_type)]"
- resting = 0
- update_canmove()
+ set_resting(FALSE)
else
emote("me", EMOTE_VISIBLE, pick("grooms its fur.", "twitches its whiskers.", "shakes out its coat."))
//MICE!
if((src.loc) && isturf(src.loc))
- if(!stat && !resting && !buckled)
+ if(!stat && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled)
for(var/mob/living/simple_animal/mouse/M in view(1,src))
if(!M.stat && Adjacent(M))
emote("me", EMOTE_VISIBLE, "splats \the [M]!")
@@ -217,7 +214,7 @@
make_babies()
- if(!stat && !resting && !buckled)
+ if(!stat && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled)
turns_since_scan++
if(turns_since_scan > 5)
walk_to(src,0)
@@ -309,7 +306,6 @@
if (pseudo_death == TRUE) //secret cat chem
icon_state = "custom_cat_dead"
Stun(1000)
- canmove = 0
friendly = "deads at"
return
else
diff --git a/code/modules/mob/living/simple_animal/friendly/crab.dm b/code/modules/mob/living/simple_animal/friendly/crab.dm
index d906757ed5..9e1ae48bdd 100644
--- a/code/modules/mob/living/simple_animal/friendly/crab.dm
+++ b/code/modules/mob/living/simple_animal/friendly/crab.dm
@@ -26,7 +26,7 @@
..()
//CRAB movement
if(!ckey && !stat)
- if(isturf(src.loc) && !resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc.
+ if(isturf(loc) && !resting && !buckled) //This is so it only moves if it's not inside a closet, gentics machine, etc.
turns_since_move++
if(turns_since_move >= turns_per_move)
var/east_vs_west = pick(4,8)
diff --git a/code/modules/mob/living/simple_animal/friendly/dog.dm b/code/modules/mob/living/simple_animal/friendly/dog.dm
index 37ef271226..46cdc755db 100644
--- a/code/modules/mob/living/simple_animal/friendly/dog.dm
+++ b/code/modules/mob/living/simple_animal/friendly/dog.dm
@@ -425,7 +425,7 @@
..()
//Feeding, chasing food, FOOOOODDDD
- if(!stat && !resting && !buckled)
+ if(!stat && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled)
turns_since_scan++
if(turns_since_scan > 5)
turns_since_scan = 0
@@ -625,7 +625,7 @@
make_babies()
- if(!stat && !resting && !buckled)
+ if(!stat && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled)
if(prob(1))
emote("me", EMOTE_VISIBLE, pick("dances around.","chases her tail."))
spawn(0)
@@ -635,8 +635,7 @@
/mob/living/simple_animal/pet/dog/pug/Life()
..()
-
- if(!stat && !resting && !buckled)
+ if(!stat && CHECK_MULTIPLE_BITFIELDS(mobility_flags, MOBILITY_STAND|MOBILITY_MOVE) && !buckled)
if(prob(1))
emote("me", EMOTE_VISIBLE, pick("chases its tail."))
spawn(0)
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
index 43149e6ba7..726eda6c45 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/_drone.dm
@@ -105,7 +105,7 @@
. = ..()
if(can_be_held)
//icon/item state is defined in mob_holder/drone_worn_icon()
- AddElement(/datum/element/mob_holder, null, 'icons/mob/head.dmi', 'icons/mob/inhands/clothing_righthand.dmi', 'icons/mob/inhands/clothing_lefthand.dmi', TRUE, /datum/element/mob_holder.proc/drone_worn_icon)
+ AddElement(/datum/element/mob_holder, null, 'icons/mob/head.dmi', 'icons/mob/inhands/clothing_righthand.dmi', 'icons/mob/inhands/clothing_lefthand.dmi', ITEM_SLOT_HEAD, /datum/element/mob_holder.proc/drone_worn_icon)
/mob/living/simple_animal/drone/med_hud_set_health()
var/image/holder = hud_list[DIAG_HUD]
diff --git a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
index 6e1bf54000..da39fb71cf 100644
--- a/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
+++ b/code/modules/mob/living/simple_animal/friendly/drone/extra_drone_types.dm
@@ -204,37 +204,6 @@
else
icon_state = "[visualAppearence]_dead"
-/mob/living/simple_animal/drone/cogscarab/Stun(amount, updating = 1, ignore_canstun = 0)
+/mob/living/simple_animal/drone/cogscarab/update_mobility()
. = ..()
- if(.)
- update_icons()
-
-/mob/living/simple_animal/drone/cogscarab/SetStun(amount, updating = 1, ignore_canstun = 0)
- . = ..()
- if(.)
- update_icons()
-
-/mob/living/simple_animal/drone/cogscarab/AdjustStun(amount, updating = 1, ignore_canstun = 0)
- . = ..()
- if(.)
- update_icons()
-
-/mob/living/simple_animal/drone/cogscarab/Knockdown(amount, updating = TRUE, ignore_canknockdown = FALSE, override_hardstun, override_stamdmg)
- . = ..()
- if(.)
- update_icons()
-
-/mob/living/simple_animal/drone/cogscarab/SetKnockdown(amount, updating = 1, ignore_canknockdown = 0)
- . = ..()
- if(.)
- update_icons()
-
-/mob/living/simple_animal/drone/cogscarab/AdjustKnockdown(amount, updating = 1, ignore_canknockdown = 0)
- . = ..()
- if(.)
- update_icons()
-
-/mob/living/simple_animal/drone/cogscarab/update_canmove()
- . = ..()
- if(.)
- update_icons()
+ update_icons()
diff --git a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
index fad519838a..e67e649ac6 100644
--- a/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
+++ b/code/modules/mob/living/simple_animal/friendly/farm_animals.dm
@@ -160,7 +160,7 @@
M.visible_message("[M] tips over [src].",
"You tip over [src].")
to_chat(src, "You are tipped over by [M]!")
- Knockdown(60,ignore_canknockdown = TRUE)
+ DefaultCombatKnockdown(60,ignore_canknockdown = TRUE)
icon_state = icon_dead
spawn(rand(20,50))
if(!stat && M)
diff --git a/code/modules/mob/living/simple_animal/friendly/lizard.dm b/code/modules/mob/living/simple_animal/friendly/lizard.dm
index f0d354ace1..dbcaed1ba2 100644
--- a/code/modules/mob/living/simple_animal/friendly/lizard.dm
+++ b/code/modules/mob/living/simple_animal/friendly/lizard.dm
@@ -26,7 +26,7 @@
/mob/living/simple_animal/hostile/lizard/ComponentInitialize()
. = ..()
- AddElement(/datum/element/mob_holder, "lizard", null, null, null, SLOT_HEAD) //you can hold lizards now.
+ AddElement(/datum/element/mob_holder, "lizard", null, null, null, ITEM_SLOT_HEAD) //you can hold lizards now.
/mob/living/simple_animal/hostile/lizard/CanAttack(atom/the_target)//Can we actually attack a possible target?
if(see_invisible < the_target.invisibility)//Target's invisible to us, forget it
diff --git a/code/modules/mob/living/simple_animal/hostile/faithless.dm b/code/modules/mob/living/simple_animal/hostile/faithless.dm
index 479b102b36..69956c5d0d 100644
--- a/code/modules/mob/living/simple_animal/hostile/faithless.dm
+++ b/code/modules/mob/living/simple_animal/hostile/faithless.dm
@@ -41,6 +41,6 @@
. = ..()
if(. && prob(12) && iscarbon(target))
var/mob/living/carbon/C = target
- C.Knockdown(60)
+ C.DefaultCombatKnockdown(60)
C.visible_message("\The [src] knocks down \the [C]!", \
"\The [src] knocks you down!")
diff --git a/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm b/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm
index 6d864576a1..9b5b428f44 100644
--- a/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm
+++ b/code/modules/mob/living/simple_animal/hostile/gorilla/gorilla.dm
@@ -71,7 +71,7 @@
var/atom/throw_target = get_edge_target_turf(L, dir)
L.throw_at(throw_target, rand(1,2), 7, src)
else
- L.Knockdown(20)
+ L.DefaultCombatKnockdown(20)
visible_message("[src] knocks [L] down!")
/mob/living/simple_animal/hostile/gorilla/CanAttack(atom/the_target)
diff --git a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm
index ea01e4b659..e558982fbb 100644
--- a/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm
+++ b/code/modules/mob/living/simple_animal/hostile/jungle/leaper.dm
@@ -93,7 +93,7 @@
var/mob/living/L = AM
if(!istype(L, /mob/living/simple_animal/hostile/jungle/leaper))
playsound(src,'sound/effects/snap.ogg',50, 1, -1)
- L.Knockdown(50)
+ L.DefaultCombatKnockdown(50)
if(iscarbon(L))
var/mob/living/carbon/C = L
C.reagents.add_reagent(/datum/reagent/toxin/leaper_venom, 5)
diff --git a/code/modules/mob/living/simple_animal/hostile/mimic.dm b/code/modules/mob/living/simple_animal/hostile/mimic.dm
index 16a55421b8..6ec8e0cfd2 100644
--- a/code/modules/mob/living/simple_animal/hostile/mimic.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mimic.dm
@@ -69,7 +69,7 @@
icon_state = initial(icon_state)
if(prob(15) && iscarbon(target))
var/mob/living/carbon/C = target
- C.Knockdown(40)
+ C.DefaultCombatKnockdown(40)
C.visible_message("\The [src] knocks down \the [C]!", \
"\The [src] knocks you down!")
@@ -179,7 +179,7 @@ GLOBAL_LIST_INIT(protected_objects, list(/obj/structure/table, /obj/structure/ca
. = ..()
if(knockdown_people && . && prob(15) && iscarbon(target))
var/mob/living/carbon/C = target
- C.Knockdown(40)
+ C.DefaultCombatKnockdown(40)
C.visible_message("\The [src] knocks down \the [C]!", \
"\The [src] knocks you down!")
diff --git a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm
index 199def430e..576410fe8c 100644
--- a/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm
+++ b/code/modules/mob/living/simple_animal/hostile/mining_mobs/elites/elite.dm
@@ -325,6 +325,7 @@ obj/structure/elite_tumor/proc/onEliteWon()
return
E.faction = list("neutral")
E.revive(full_heal = TRUE, admin_revive = TRUE)
+ E.grab_ghost()
user.visible_message("[user] stabs [E] with [src], reviving it.")
E.playsound_local(get_turf(E), 'sound/effects/magic.ogg', 40, 0)
to_chat(E, "You have been revived by [user]. While you can't speak to them, you owe [user] a great debt. Assist [user.p_them()] in achieving [user.p_their()] goals, regardless of risk.\the [src] knocks down \the [L]!")
diff --git a/code/modules/mob/living/simple_animal/hostile/tree.dm b/code/modules/mob/living/simple_animal/hostile/tree.dm
index e7b2da1844..a915ede835 100644
--- a/code/modules/mob/living/simple_animal/hostile/tree.dm
+++ b/code/modules/mob/living/simple_animal/hostile/tree.dm
@@ -56,7 +56,7 @@
if(iscarbon(target))
var/mob/living/carbon/C = target
if(prob(15))
- C.Knockdown(60)
+ C.DefaultCombatKnockdown(60)
C.visible_message("