Skip to content

Commit

Permalink
Merge branch 'dev-sierra' into adherent-armor
Browse files Browse the repository at this point in the history
  • Loading branch information
Baneuus authored Jan 7, 2025
2 parents 4f0b26e + f1376ad commit 2677de9
Show file tree
Hide file tree
Showing 24 changed files with 587 additions and 668 deletions.
17 changes: 6 additions & 11 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -527,21 +527,16 @@ GLOBAL_LIST_INIT(click_catchers, create_click_catcher())
. = 1

/client/MouseDown(object, location, control, params)
var/delay = mob.CanMobAutoclick(object, location, params)
if(delay)
selected_target[1] = object
selected_target[2] = params
while(selected_target[1])
Click(selected_target[1], location, control, selected_target[2])
sleep(delay)
var/datum/click_handler/click_handler = usr.GetClickHandler()
click_handler.OnMouseDown(object, location, params)

/client/MouseUp(object, location, control, params)
selected_target[1] = null
var/datum/click_handler/click_handler = usr.GetClickHandler()
click_handler.OnMouseUp(object, location, params)

/client/MouseDrag(src_object,atom/over_object,src_location,over_location,src_control,over_control,params)
if(selected_target[1] && over_object.IsAutoclickable())
selected_target[1] = over_object
selected_target[2] = params
var/datum/click_handler/click_handler = usr.GetClickHandler()
click_handler.OnMouseDrag(over_object, params)

/mob/proc/CanMobAutoclick(object, location, params)
return
Expand Down
65 changes: 65 additions & 0 deletions code/_onclick/click_handling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -103,12 +103,77 @@ var/global/const/CLICK_HANDLER_REMOVE_IF_NOT_TOP = FLAG(1)
/datum/click_handler/proc/OnDblClick(atom/A, params)
return

/**
* Called on MouseDown by `/client/MouseDown()` when this is the mob's currently active click handler.
*
* **Parameters**:
* - `object` - The atom mouse is underneath.
* - `location` - the turf, stat panel, grid cell, etc. containing the object where it was clicked
* - `params` (list of strings) - List of click parameters. See BYOND's `CLick()` documentation.
*
* Has no return value.
*/
/datum/click_handler/proc/OnMouseDown(object, location, params)
return

/**
* Called on MouseUp by `/client/MouseUp()` when this is the mob's currently active click handler.
*
* **Parameters**:
* - `object` - The atom underneath mouse.
* - `location` - the turf, stat panel, grid cell, etc. containing the object where it was clicked
* - `params` (list of strings) - List of click parameters. See BYOND's `CLick()` documentation.
*
* Has no return value.
*/
/datum/click_handler/proc/OnMouseUp(object, location, params)
return

/**
* Called on MouseUp by `/client/MouseDrag()` when this is the mob's currently active click handler.
*
* **Parameters**:
* - `over_object` - The new atom underneath mouse.
* - `params` (list of strings) - List of click parameters. See BYOND's `CLick()` documentation.
*
* Has no return value.
*/
/datum/click_handler/proc/OnMouseDrag(atom/over_object, params)
return

/datum/click_handler/proc/CanAutoClick(object, location, params)
return

/datum/click_handler/default
/// Holds click params [2] and a reference [1] to the atom under the cursor on MouseDown/Drag
var/list/selected_target = list(null, null)

/datum/click_handler/default/OnClick(atom/A, params)
user.ClickOn(A, params)

/datum/click_handler/default/OnDblClick(atom/A, params)
user.DblClickOn(A, params)

/datum/click_handler/default/OnMouseDown(object, location, params)
var/delay = CanAutoClick(object, location, params)
if(delay)
selected_target[1] = object
selected_target[2] = params
while(selected_target[1])
OnClick(selected_target[1], selected_target[2])
sleep(delay)

/datum/click_handler/default/OnMouseUp(object, location, params)
selected_target[1] = null

/datum/click_handler/default/OnMouseDrag(atom/over_object, params)
if(selected_target[1] && over_object && over_object.IsAutoclickable()) //Over object could be null, for example if dragging over darkness
selected_target[1] = over_object
selected_target[2] = params

/datum/click_handler/default/CanAutoClick(object, location, params)
return user.CanMobAutoclick(object, location, params)

/**
* Returns the mob's currently active click handler.
*
Expand Down
4 changes: 2 additions & 2 deletions code/game/antagonist/station/changeling.dm
Original file line number Diff line number Diff line change
Expand Up @@ -74,13 +74,13 @@ GLOBAL_DATUM_INIT(changelings, /datum/antagonist/changeling, new)
var/mob/living/carbon/human/H = player.current
if(H.isSynthetic() || H.isFBP())
return 0
if(H.species.species_flags & SPECIES_FLAG_NO_SCAN)
if(H.species.species_flags & (SPECIES_FLAG_NO_SCAN|SPECIES_FLAG_NEED_DIRECT_ABSORB))
return 0
return 1
else if(isnewplayer(player.current))
if(player.current.client && player.current.client.prefs)
var/datum/species/S = all_species[player.current.client.prefs.species]
if(S && (S.species_flags & SPECIES_FLAG_NO_SCAN))
if(S?.species_flags & SPECIES_FLAG_NO_SCAN|SPECIES_FLAG_NEED_DIRECT_ABSORB)
return 0
if(player.current.client.prefs.organ_data[BP_CHEST] == "cyborg") // Full synthetic.
return 0
Expand Down
3 changes: 0 additions & 3 deletions code/modules/client/client_defines.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,9 +30,6 @@
/// A message to show to online staff when joining, if any
var/staffwarn

/// Holds click params [2] and a reference [1] to the atom under the cursor on MouseDown/Drag
var/list/selected_target = list(null, null)

/// Whether or not the client is currently playing the "ship hum" ambience sound
var/playing_vent_ambience = FALSE

Expand Down
1 change: 1 addition & 0 deletions code/modules/clothing/masks/miscellaneous.dm
Original file line number Diff line number Diff line change
Expand Up @@ -249,6 +249,7 @@
item_state = "bandana"
item_flags = ITEM_FLAG_FLEXIBLEMATERIAL | ITEM_FLAG_WASHER_ALLOWED
w_class = ITEM_SIZE_SMALL
use_alt_layer = TRUE

/obj/item/clothing/mask/bandana/equipped(mob/user, slot)
switch(slot)
Expand Down
3 changes: 2 additions & 1 deletion code/modules/mechs/equipment/utility.dm
Original file line number Diff line number Diff line change
Expand Up @@ -712,11 +712,12 @@
use_external_power = TRUE
has_safety = FALSE
max_shots = 10
projectile_type = /obj/item/projectile/beam/plasmacutter/mech


/obj/item/mech_equipment/mounted_system/taser/plasma
name = "mounted plasma cutter"
desc = "An industrial plasma cutter mounted onto the chassis of the mech. "
desc = "An industrial plasma cutter mounted onto the chassis of the mech. The additional size means increased coherency at longer range. "
icon_state = "mech_plasma"
holding_type = /obj/item/gun/energy/plasmacutter/mounted/mech
restricted_hardpoints = list(HARDPOINT_LEFT_HAND, HARDPOINT_RIGHT_HAND, HARDPOINT_LEFT_SHOULDER, HARDPOINT_RIGHT_SHOULDER)
Expand Down
24 changes: 23 additions & 1 deletion code/modules/mechs/mech_interaction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,26 @@
if(selected_system)
return selected_system.MouseDragInteraction(src_object, over_object, src_location, over_location, src_control, over_control, params, user)

/datum/click_handler/default/mech/CanAutoClick(object, location, params)
var/mob/living/exosuit/E = user.loc
if(!user || E.incapacitated() || user.incapacitated())
return 0

if(!(user in E.pilots) && user != E)
return 0
//Ask mech if given its current active item it wants to handle autoclick
return E.CanMobAutoclick(object, location, params)

/mob/living/exosuit/CanMobAutoclick(atom/object, location, params)
if(!object.IsAutoclickable())
return

if (!istype(selected_system, /obj/item/mech_equipment))
return
var/obj/item/mech_equipment/mech_equipment = selected_system
var/obj/item/effective = mech_equipment.get_effective_obj()
return effective.CanItemAutoclick(object, location, params)

/datum/click_handler/default/mech/OnClick(atom/A, params)
var/mob/living/exosuit/E = user.loc
if(!istype(E))
Expand Down Expand Up @@ -209,10 +229,12 @@
admin_attack_log(user, A, "Attacked using \a [temp_system] (MECH)", "Was attacked with \a [temp_system] (MECH)", "used \a [temp_system] (MECH) to attack")
//Mech equipment subtypes can add further click delays
var/extra_delay = 0
var/automatic = temp_system?.CanItemAutoclick() //Items that can autoclick do not add arm delay (else it defeats point).
if(!isnull(selected_system))
ME = selected_system
extra_delay = ME.equipment_delay
setClickCooldown(arms ? arms.action_delay + extra_delay : 15 + extra_delay)
var/arm_delay = arms ? arms.action_delay : 15
setClickCooldown(automatic ? extra_delay : arm_delay + extra_delay)
if(system_moved)
temp_system.forceMove(selected_system)
return
Expand Down
2 changes: 1 addition & 1 deletion code/modules/mob/living/carbon/human/examine.dm
Original file line number Diff line number Diff line change
Expand Up @@ -163,7 +163,7 @@
msg += "The message \"[robohead.display_text]\" is displayed on its screen.\n"

//splints
for(var/organ in list(BP_L_LEG, BP_R_LEG, BP_L_ARM, BP_R_ARM))
for(var/organ in list(BP_L_LEG, BP_R_LEG, BP_L_FOOT, BP_R_FOOT, BP_L_ARM, BP_R_ARM, BP_L_HAND, BP_R_HAND))
var/obj/item/organ/external/o = get_organ(organ)
if(o && o.splinted && o.splinted.loc == o)
msg += "[SPAN_WARNING("[P.He] [P.has] \a [o.splinted] on [P.his] [o.name]!")]\n"
Expand Down
30 changes: 17 additions & 13 deletions code/modules/mob/living/carbon/human/update_icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,17 +143,19 @@ Please contact me on #coderbus IRC. ~Carn x
#define HO_SUIT_STORE_LAYER 16
#define HO_BACK_LAYER 17
#define HO_HAIR_LAYER 18 //TODO: make part of head layer?
#define HO_GOGGLES_LAYER 19
#define HO_EARS_LAYER 20
#define HO_FACEMASK_LAYER 21
#define HO_HEAD_LAYER 22
#define HO_COLLAR_LAYER 23
#define HO_HANDCUFF_LAYER 24
#define HO_L_HAND_LAYER 25
#define HO_R_HAND_LAYER 26
#define HO_FIRE_LAYER 27 //If you're on fire
#define HO_EFFECTS_LAYER 28
#define TOTAL_LAYERS 29
#define HO_EARS_LAYER 19
#define HO_ALT_HEAD_LAYER 20
#define HO_GOGGLES_LAYER 21
#define HO_FACEMASK_LAYER 22
#define HO_HEAD_LAYER 23
#define HO_COLLAR_LAYER 24
#define HO_HANDCUFF_LAYER 25
#define HO_L_HAND_LAYER 26
#define HO_R_HAND_LAYER 27
#define HO_FIRE_LAYER 28 //If you're on fire
#define HO_EFFECTS_LAYER 29
#define TOTAL_LAYERS 30

//////////////////////////////////

/mob/living/carbon/human
Expand Down Expand Up @@ -576,9 +578,11 @@ var/global/list/damage_icon_parts = list()

/mob/living/carbon/human/update_inv_head(update_icons=1)
if(head)
overlays_standing[HO_HEAD_LAYER] = head.get_mob_overlay(src,slot_head_str)
overlays_standing[head.use_alt_layer ? HO_ALT_HEAD_LAYER : HO_HEAD_LAYER] = head.get_mob_overlay(src,slot_head_str)
overlays_standing[head.use_alt_layer ? HO_HEAD_LAYER : HO_ALT_HEAD_LAYER] = null
else
overlays_standing[HO_HEAD_LAYER] = null
overlays_standing[HO_HEAD_LAYER] = null
overlays_standing[HO_ALT_HEAD_LAYER] = null
if(update_icons)
queue_icon_update()

Expand Down
8 changes: 8 additions & 0 deletions code/modules/projectiles/projectile/beams.dm
Original file line number Diff line number Diff line change
Expand Up @@ -324,6 +324,14 @@
tracer_type = /obj/projectile/trilaser/tracer
impact_type = /obj/projectile/trilaser/impact

//Exosuits have heavier cutters with less falloff
/obj/item/projectile/beam/plasmacutter/mech
damage_falloff_list = list(
list(5, 0.80),
list(7, 0.60),
list(9, 0.40),
)

/obj/item/projectile/beam/plasmacutter/on_impact(atom/A)
if(istype(A, /turf/simulated/mineral))
var/turf/simulated/mineral/M = A
Expand Down
7 changes: 5 additions & 2 deletions code/modules/species/species_age_comparison.dm
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,11 @@
if (!age_diff_descriptor)
age_diff_descriptor = age_diff_descriptors[length(age_diff_descriptors)]

if (observer == observed)
return "You are of [age_descriptor] age for \a [name]."

var/datum/pronouns/pronouns = observed.choose_from_pronouns()
if (age_diff_descriptor)
return "[pronouns.He] [pronouns.is] of [age_descriptor] age for a [name], [age_diff_descriptor] you."
return "[pronouns.He] [pronouns.is] of [age_descriptor] age for \a [name], [age_diff_descriptor] you."
else if (age_descriptor)
return "[pronouns.He] [pronouns.is] of [age_descriptor] age for a [name]."
return "[pronouns.He] [pronouns.is] of [age_descriptor] age for \a [name]."
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-sierra-pr-2987.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: Spookerton
changes:
- {bugfix: GAS can't roll changeling.}
delete-after: true
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-sierra-pr-3010.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: SierraKomodo
changes:
- {tweak: Goggles now render over bandanas when worn and pushed up.}
delete-after: true
5 changes: 5 additions & 0 deletions html/changelogs/AutoChangeLog-sierra-pr-3032.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
author: CrimsonShrike
changes:
- {tweak: The exosuit plasma cutters have a little under half the fallofff of regular
plasma cutters.}
delete-after: true
5 changes: 5 additions & 0 deletions html/changelogs/AutoChangeLog-sierra-pr-3074.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
author: SierraKomodo
changes:
- {tweak: examining yourself now shows "You are of X age for a SPECIES" instead
of third person descriptions.}
delete-after: true
4 changes: 4 additions & 0 deletions html/changelogs/AutoChangeLog-sierra-pr-3076.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
author: SierraKomodo
changes:
- {bugfix: Splints on hands and feet now appear in examine text when examining mobs.}
delete-after: true
5 changes: 5 additions & 0 deletions html/changelogs/AutoChangeLog-sierra-pr-3082.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
author: Spookerton
changes:
- {maptweak: Expedition prep has a console and space map.}
- {maptweak: Split hangar substation out into a full substation.}
delete-after: true
5 changes: 5 additions & 0 deletions html/changelogs/AutoChangeLog-sierra-pr-3083.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
author: LordNest
changes:
- {imageadd: Добавил в биомоды лисьи уши в целях повышения числа рыжих девушек на
Сьерре.}
delete-after: true
8 changes: 6 additions & 2 deletions maps/torch/structures/closets/exploration.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,9 @@
/obj/item/clothing/accessory/buddy_tag,
/obj/item/storage/firstaid/light,
/obj/item/storage/backpack/dufflebag,
/obj/item/device/flashlight/flare
/obj/item/device/flashlight/flare,
/obj/item/crowbar/prybar,
/obj/item/extinguisher/mini
)

/obj/structure/closet/secure_closet/explorer
Expand All @@ -77,7 +79,9 @@
/obj/item/material/knife/folding/swiss/explorer,
/obj/item/device/camera,
/obj/item/storage/backpack/dufflebag,
/obj/item/device/flashlight/flare
/obj/item/device/flashlight/flare,
/obj/item/crowbar/prybar,
/obj/item/extinguisher/mini
)

/obj/structure/closet/secure_closet/pilot
Expand Down
Loading

0 comments on commit 2677de9

Please sign in to comment.