Skip to content

Commit

Permalink
Merge pull request #4694 from MistakeNot4892/devupdate
Browse files Browse the repository at this point in the history
Updating dev from staging
  • Loading branch information
MistakeNot4892 authored Jan 4, 2025
2 parents bf7524d + 5bea942 commit 2493db2
Show file tree
Hide file tree
Showing 85 changed files with 281 additions and 311 deletions.
22 changes: 1 addition & 21 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -116,11 +116,6 @@
var/sdepth = A.storage_depth(src)
if((!isturf(A) && A == loc) || (sdepth != -1 && sdepth <= 1))
if(holding)

// AI driven mobs have a melee telegraph that needs to be handled here.
if(check_intent(I_FLAG_HARM) && istype(A) && (!do_attack_windup_checking(A) || holding != get_active_held_item()))
return TRUE

var/resolved = holding.resolve_attackby(A, src, params)
if(!resolved && A && holding)
holding.afterattack(A, src, 1, params) // 1 indicates adjacency
Expand All @@ -143,10 +138,6 @@
if(A.Adjacent(src)) // see adjacent.dm
if(holding)

// AI driven mobs have a melee telegraph that needs to be handled here.
if(check_intent(I_FLAG_HARM) && istype(A) && (!do_attack_windup_checking(A) || holding != get_active_held_item()))
return TRUE

// Return 1 in attackby() to prevent afterattack() effects (when safely moving items for example)
var/resolved = holding.resolve_attackby(A, src, params)
if(!resolved && A && holding)
Expand Down Expand Up @@ -217,18 +208,7 @@
if(istype(G) && G.Touch(A,1))
return TRUE

// Pick up items.
if(check_dexterity(DEXTERITY_HOLD_ITEM, silent = TRUE))
return A.attack_hand(src)

// TODO: some way to check if we SHOULD be doing an attack windup here;
// corgis attacking a tree, for example, will do the windup animation despite
// having no interaction or message shown at the end of it.
// AI driven mobs have a melee telegraph that needs to be handled here.
if(check_intent(I_FLAG_HARM) && istype(A) && !do_attack_windup_checking(A))
return TRUE

return FALSE
return A.attack_hand(src)

/*
Ranged unarmed attack:
Expand Down
6 changes: 6 additions & 0 deletions code/_onclick/other_mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -8,9 +8,15 @@
/atom/proc/can_interact_with_storage(user, strict = FALSE)
return isliving(user)

/atom/proc/get_required_interaction_dexterity()
return DEXTERITY_NONE

/atom/proc/attack_hand(mob/user)
SHOULD_CALL_PARENT(TRUE)

if(!user.check_dexterity(get_required_interaction_dexterity(), silent = TRUE))
return FALSE

if(can_interact_with_storage(user, strict = TRUE) && storage && user.check_dexterity((DEXTERITY_HOLD_ITEM|DEXTERITY_EQUIP_ITEM), TRUE))
add_fingerprint(user)
storage.open(user)
Expand Down
60 changes: 36 additions & 24 deletions code/datums/ai/aggressive.dm
Original file line number Diff line number Diff line change
Expand Up @@ -90,10 +90,14 @@
return TRUE

/datum/mob_controller/aggressive/proc/attack_target()

set waitfor = FALSE

var/atom/target = get_target()
if(!istype(target))
lose_target()
return

if(isliving(target) && body.buckled_mob == target && (!body.faction || body.buckled_mob.faction != body.faction))
body.visible_message(SPAN_DANGER("\The [body] attempts to unseat \the [body.buckled_mob]!"))
body.set_dir(pick(global.cardinal))
Expand All @@ -105,11 +109,21 @@
var/mob/living/victim = target
SET_STATUS_MAX(victim, STAT_WEAK, 3)
return target
if(body.Adjacent(target))
body.set_intent(I_FLAG_HARM)
body.ClickOn(target)

if(!body.Adjacent(target))
return target

// AI-driven mobs have a melee telegraph that needs to be handled here.
if(!body.do_attack_windup_checking(target))
return target

if(QDELETED(body) || body.incapacitated() || QDELETED(target))
return target

body.set_intent(I_FLAG_HARM)
body.ClickOn(target)
return target

/datum/mob_controller/aggressive/destroy_surroundings()

if(!body.can_act())
Expand Down Expand Up @@ -172,27 +186,25 @@
if(!(. = ..()))
return

if(!only_attack_enemies)
if(source)
set_target(source)
move_to_target(move_only = TRUE)
return

var/list/allies
var/list/around = view(body, 7)
for(var/atom/movable/A in around)
if(A == body || !isliving(A))
continue
var/mob/living/M = A
if(attack_same_faction || M.faction != body.faction)
add_enemy(M)
else if(istype(M.ai))
LAZYADD(allies, M.ai)

var/list/enemies = get_enemies()
if(LAZYLEN(enemies) && LAZYLEN(allies))
for(var/datum/mob_controller/ally as anything in allies)
ally.add_enemies(enemies)
if(only_attack_enemies)
var/list/allies
var/list/around = view(body, 7)
for(var/atom/movable/A in around)
if(A == body || !isliving(A))
continue
var/mob/living/M = A
if(attack_same_faction || M.faction != body.faction)
add_enemy(M)
else if(istype(M.ai))
LAZYADD(allies, M.ai)
var/list/enemies = get_enemies()
if(LAZYLEN(enemies) && LAZYLEN(allies))
for(var/datum/mob_controller/ally as anything in allies)
ally.add_enemies(enemies)

if(source)
set_target(source)
move_to_target(move_only = TRUE)

/datum/mob_controller/aggressive/move_to_target(var/move_only = FALSE)
if(!body.can_act())
Expand Down
3 changes: 2 additions & 1 deletion code/game/objects/items/__item.dm
Original file line number Diff line number Diff line change
Expand Up @@ -99,7 +99,8 @@
var/paint_verb

/// What dexterity is required to attack with this item?
var/needs_attack_dexterity = DEXTERITY_WIELD_ITEM
var/needs_attack_dexterity = DEXTERITY_WIELD_ITEM
var/needs_interaction_dexterity = DEXTERITY_HOLD_ITEM

/// Vars relating to wielding the item with two or more hands.
var/can_be_twohanded = FALSE
Expand Down
26 changes: 16 additions & 10 deletions code/game/objects/items/_item_melting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -16,16 +16,22 @@
try_burn_wearer(holder, holder.get_equipped_slot_for_item(src))

// Temp gate until generalized temperature-based melting works properly.
if(istype(loc, /obj/item/chems/crucible))
// Check if this is meltable at all.
var/list/meltable_materials
for(var/mat in matter)
var/decl/material/melt_material = GET_DECL(mat)
if(!isnull(melt_material.melting_point) && temperature >= melt_material.melting_point)
LAZYDISTINCTADD(meltable_materials, melt_material)
if(length(meltable_materials))
. = null // Don't return PROCESS_KILL here.
handle_melting(meltable_materials)
var/static/list/_melting_containers = list(
/obj/item/chems/crucible,
/obj/item/organ/internal/stomach
)
if(!is_type_in_list(loc, _melting_containers))
return

// Check if this is meltable at all.
var/list/meltable_materials
for(var/mat in matter)
var/decl/material/melt_material = GET_DECL(mat)
if(!isnull(melt_material.melting_point) && temperature >= melt_material.melting_point)
LAZYDISTINCTADD(meltable_materials, melt_material)
if(length(meltable_materials))
. = null // Don't return PROCESS_KILL here.
handle_melting(meltable_materials)

/obj/item/place_melted_product(list/meltable_materials)

Expand Down
12 changes: 12 additions & 0 deletions code/game/objects/items/devices/radio/headsets_shared.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,6 +221,18 @@
encryption_keys = list(/obj/item/encryptionkey/raider)
analog_secured = list((access_raider) = TRUE)

/obj/item/encryptionkey/hacked
can_decrypt = list(access_hacked)
origin_tech = @'{"esoteric":3}'

/obj/item/encryptionkey/hacked/Initialize(ml, material_key)
. = ..()
can_decrypt |= get_all_station_access()

/obj/item/radio/headset/hacked
origin_tech = @'{"esoteric":3}'
encryption_keys = list(/obj/item/encryptionkey/hacked)

// Bowman alts
/obj/item/radio/headset/headset_mining/bowman
name = "mining bowman radio headset"
Expand Down
5 changes: 0 additions & 5 deletions code/game/objects/random/subtypes/maintenance.dm
Original file line number Diff line number Diff line change
Expand Up @@ -209,14 +209,10 @@ something, make sure it's not in one of the other lists.*/
var/static/list/spawnable_choices = list(
/obj/random/maintenance/clean = 320,
/obj/item/clothing/head/soft/sec = 4,
/obj/item/clothing/head/soft/sec/corp = 4,
/obj/item/backpack/security = 3,
/obj/item/backpack/satchel/sec = 3,
/obj/item/clothing/shoes/jackboots = 3,
/obj/item/clothing/suit/armor/vest = 3,
/obj/item/clothing/head/beret/corp/sec = 3,
/obj/item/clothing/head/beret/corp/sec/corporate/hos = 3,
/obj/item/clothing/head/beret/corp/sec/navy/officer = 3,
/obj/item/flashlight/maglight = 2,
/obj/item/flash = 2,
/obj/item/clothing/mask/balaclava = 2,
Expand All @@ -226,7 +222,6 @@ something, make sure it's not in one of the other lists.*/
/obj/item/belt/security = 2,
/obj/item/clothing/glasses/hud/security = 2,
/obj/item/clothing/head/helmet = 2,
/obj/item/clothing/suit/armor/vest/security = 2,
/obj/item/clothing/webbing/drop_pouches/black = 2,
/obj/item/clothing/head/earmuffs = 2,
/obj/item/handcuffs = 2,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -64,12 +64,14 @@
/obj/structure/closet/secure_closet/pilot
name = "pilot locker"
req_access = list(access_xenobiology)
/// The jumpsuit type spawned for this locker. Exists to be overridden by the corporate modpack, which adds pilot jumpsuits.
var/jumpsuit_type = /obj/item/clothing/jumpsuit/white

/obj/structure/closet/secure_closet/pilot/WillContain()
return list(
/obj/item/backpack/parachute,
/obj/item/knife/utility,
/obj/item/clothing/jumpsuit/pilot,
jumpsuit_type,
/obj/item/clothing/suit/jacket/bomber,
/obj/item/clothing/mask/gas/half,
/obj/item/clothing/shoes/color/black,
Expand Down
2 changes: 1 addition & 1 deletion code/modules/admin/secrets/fun_secrets/waddle.dm
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@
events_repository.register(/decl/observ/moved, holder, src, PROC_REF(waddle))
events_repository.register(/decl/observ/destroyed, holder, src, PROC_REF(qdel_self))

/datum/extension/event_registration/Destroy()
/datum/extension/waddle/Destroy()
events_repository.unregister(/decl/observ/destroyed, holder, src)
events_repository.unregister(/decl/observ/moved, holder, src)
return ..()
Expand Down
6 changes: 3 additions & 3 deletions code/modules/augment/passive/boost/shooting.dm
Original file line number Diff line number Diff line change
Expand Up @@ -6,16 +6,16 @@
material = /decl/material/solid/metal/steel
origin_tech = @'{"materials":4,"magnets":3,"biotech":3}'

/obj/item/organ/internal/augment/boost/reflex/reset_matter()
/obj/item/organ/internal/augment/boost/shooting/reset_matter()
matter = list(
/decl/material/solid/fiberglass = MATTER_AMOUNT_REINFORCEMENT,
/decl/material/solid/metal/silver = MATTER_AMOUNT_TRACE
)

/obj/item/organ/internal/augment/boost/reflex/buff()
/obj/item/organ/internal/augment/boost/shooting/buff()
if((. = ..()))
to_chat(owner, SPAN_NOTICE("Notice: AIM-4 finished reboot."))

/obj/item/organ/internal/augment/boost/reflex/debuff()
/obj/item/organ/internal/augment/boost/shooting/debuff()
if((. = ..()))
to_chat(owner, SPAN_WARNING("Catastrophic damage detected: AIM-4 shutting down."))
2 changes: 1 addition & 1 deletion code/modules/bodytype/bodytype_prosthetic_models.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
icon_base = 'icons/mob/human_races/cyberlimbs/morgan/morgan_main.dmi'
modifier_string = "wooden"
hardiness = 0.75
manual_dexterity = DEXTERITY_SIMPLE_MACHINES
manual_dexterity = DEXTERITY_SIMPLE_MACHINES | DEXTERITY_HOLD_ITEM | DEXTERITY_EQUIP_ITEM | DEXTERITY_KEYBOARDS | DEXTERITY_GRAPPLE
movement_slowdown = 1
is_robotic = FALSE
modular_limb_tier = MODULAR_BODYPART_ANYWHERE
Expand Down
2 changes: 1 addition & 1 deletion code/modules/butchery/butchery_products_meat_fish.dm
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@
. = ..()
SetName("grilled [name]")

/obj/item/food/butchery/meat/fish/get_meat_icons()
/obj/item/food/butchery/meat/fish/grilled/get_meat_icons()
var/static/list/meat_icons = list(
'icons/obj/food/butchery/fish_grilled.dmi'
)
Expand Down
7 changes: 0 additions & 7 deletions code/modules/clothing/suits/jackets/hoodies.dm
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,6 @@
desc = "A warm, black sweatshirt."
color = COLOR_DARK_GRAY

/obj/item/clothing/suit/jacket/hoodie/get_assumed_clothing_state_modifiers()
var/static/list/expected_state_modifiers = list(
GET_DECL(/decl/clothing_state_modifier/buttons),
GET_DECL(/decl/clothing_state_modifier/hood)
)
return expected_state_modifiers

/obj/item/clothing/head/hoodiehood
name = "hoodie hood"
desc = "A hood attached to a warm sweatshirt."
Expand Down
6 changes: 3 additions & 3 deletions code/modules/detectivework/tools/storage.dm
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,15 @@
desc = "Sterilized equipment within. Do not contaminate."
icon = 'icons/obj/forensics.dmi'
icon_state = "dnakit"

/obj/item/box/swabs/WillContain()
return list(/obj/item/forensics/sample/swab = DEFAULT_BOX_STORAGE)

/obj/item/box/evidence
name = "evidence bag box"
desc = "A box claiming to contain evidence bags."

/obj/item/box/swabs/WillContain()
/obj/item/box/evidence/WillContain()
return list(/obj/item/evidencebag = 7)

/obj/item/box/fingerprints
Expand All @@ -20,5 +20,5 @@
icon = 'icons/obj/forensics.dmi'
icon_state = "dnakit"

/obj/item/box/swabs/WillContain()
/obj/item/box/fingerprints/WillContain()
return list(/obj/item/forensics/sample/print = DEFAULT_BOX_STORAGE)
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
'sound/ambience/ominous3.ogg'
)

/datum/exoplanet_theme/robotic_guardians/modify_template_whitelist(whitelist_flags)
/datum/exoplanet_theme/ruined_city/modify_template_whitelist(whitelist_flags)
return whitelist_flags | TEMPLATE_TAG_ALIEN

/datum/exoplanet_theme/ruined_city/get_map_generators(/datum/planetoid_data/E)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -181,7 +181,7 @@
/decl/material/solid/potassium = 1
)

/decl/material/solid/potassium/affect_blood(var/mob/living/M, var/removed, var/datum/reagents/holder)
/decl/material/solid/potash/affect_blood(var/mob/living/M, var/removed, var/datum/reagents/holder)
. = ..()
var/volume = REAGENT_VOLUME(holder, type)
if(volume > 3)
Expand Down
8 changes: 4 additions & 4 deletions code/modules/mob/living/bot/bot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -283,12 +283,12 @@
/mob/living/bot/proc/lookForTargets()
return

/mob/living/bot/proc/confirmTarget(var/atom/A)
if(A.invisibility >= INVISIBILITY_LEVEL_ONE)
/mob/living/bot/proc/confirmTarget(atom/target)
if(target.invisibility >= INVISIBILITY_LEVEL_ONE)
return 0
if(A in ignore_list)
if(target in ignore_list)
return 0
if(!A.loc)
if(!target.loc)
return 0
return 1

Expand Down
Loading

0 comments on commit 2493db2

Please sign in to comment.