Skip to content

Commit

Permalink
Merge remote-tracking branch 'upstream/master' into hijack-objectives
Browse files Browse the repository at this point in the history
  • Loading branch information
morrowwolf committed Oct 4, 2023
2 parents 8b7381f + c1cd602 commit 81b35ec
Show file tree
Hide file tree
Showing 390 changed files with 5,946 additions and 5,455 deletions.
30 changes: 22 additions & 8 deletions code/__DEFINES/keybinding.dm
Original file line number Diff line number Diff line change
Expand Up @@ -43,12 +43,6 @@
#define COMSIG_KG_CLIENT_RADIO_DOWN "keybinding_client_radio_down"

//Human
#define COMSIG_KB_HUMAN_QUICKEQUIP_DOWN "keybinding_human_quickequip_down"
#define COMSIG_KB_HUMAN_SECONDARY_DOWN "keybinding_human_secondary_down"
#define COMSIG_KB_HUMAN_TERTIARY_DOWN "keybinding_human_tertiary_down"
#define COMSIG_KB_HUMAN_QUATERNARY_DOWN "keybinding_human_quaternary_down"
#define COMSIG_KB_HUMAN_QUICK_EQUIP_DOWN "keybinding_human_quick_equip_down"

#define COMSIG_KB_HUMAN_ISSUE_ORDER "keybinding_human_issue_order"
#define COMSIG_KB_HUMAN_ISSUE_ORDER_MOVE "keybinding_human_issue_order_move"
#define COMSIG_KB_HUMAN_ISSUE_ORDER_HOLD "keybinding_human_issue_order_hold"
Expand All @@ -57,12 +51,31 @@
#define COMSIG_KB_HUMAN_SPECIALIST_ACTIVATION_ONE "keybinding_human_specialist_activation_one"
#define COMSIG_KB_HUMAN_SPECIALIST_ACTIVATION_TWO "keybinding_human_specialist_activation_two"

#define COMSIG_KB_HUMAN_PICK_UP "keybinding_human_pick_up"

#define COMSIG_KB_HUMAN_ROTATE_CHAIR "keybinding_human_rotate_chair"

#define COMSIG_KB_HUMAN_SHOW_HELD_ITEM "keybinding_human_show_held_item"

#define COMSIG_KB_HUMAN_CYCLE_HELMET_HUD "keybinding_human_cycle_helmet_hud"

// Human Inventory Navigation
#define COMSIG_KB_HUMAN_INTERACT_OTHER_HAND "keybinding_human_interact_other_hand"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_BACK "keybinding_human_interact_slot_back"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_BELT "keybinding_human_interact_slot_belt"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_UNIFORM "keybinding_human_interact_slot_uniform"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_SUIT "keybinding_human_interact_slot_suit"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_HELMET "keybinding_human_interact_slot_helmet"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_LEFT_POUCH "keybinding_human_interact_slot_left_pouch"
#define COMSIG_KB_HUMAN_INTERACT_SLOT_RIGHT_POUCH "keybinding_human_interact_slot_right_pouch"
#define COMSIG_KB_HUMAN_INTERACT_SUIT_S_STORE "keybinding_human_interact_slot_suit_storage"

#define COMSIG_KB_HUMAN_INTERACT_QUICKEQUIP_DOWN "keybinding_human_interact_quickequip_down"
#define COMSIG_KB_HUMAN_INTERACT_SECONDARY_DOWN "keybinding_human_interact_secondary_down"
#define COMSIG_KB_HUMAN_INTERACT_TERTIARY_DOWN "keybinding_human_interact_tertiary_down"
#define COMSIG_KB_HUMAN_INTERACT_QUATERNARY_DOWN "keybinding_human_interact_quaternary_down"
#define COMSIG_KB_HUMAN_INTERACT_QUICK_EQUIP_DOWN "keybinding_human_interact_quick_equip_down"

#define COMSIG_KB_HUMAN_INTERACT_PICK_UP "keybinding_human_interact_pick_up"

// Human Combat
#define COMSIG_KB_HUMAN_WEAPON_FIELDSTRIP "keybinding_human_weapon_fieldstrip"
#define COMSIG_KB_HUMAN_WEAPON_BURSTFIRE "keybinding_human_weapon_burstfire"
Expand Down Expand Up @@ -199,6 +212,7 @@
#define CATEGORY_CARBON "CARBON"
#define CATEGORY_HUMAN "HUMAN"
#define CATEGORY_HUMAN_COMBAT "HUMAN COMBAT"
#define CATEGORY_HUMAN_INVENTORY "HUMAN INVENTORY"
#define CATEGORY_ROBOT "ROBOT"
#define CATEGORY_YAUTJA "YAUTJA"
#define CATEGORY_MISC "MISC"
Expand Down
4 changes: 4 additions & 0 deletions code/__DEFINES/xeno.dm
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,10 @@
/// The time it takes for a pylon to give one larva while activated
#define XENO_PYLON_ACTIVATION_COOLDOWN (5 MINUTES)

/// The time until you can re-corrupt a comms relay after the last pylon was destroyed
#define XENO_PYLON_DESTRUCTION_DELAY (5 MINUTES)


/// The time against away_timer when an AFK xeno larva can be replaced
#define XENO_LEAVE_TIMER_LARVA 80 //80 seconds
/// The time against away_timer when an AFK xeno (not larva) can be replaced
Expand Down
4 changes: 2 additions & 2 deletions code/__HELPERS/game.dm
Original file line number Diff line number Diff line change
Expand Up @@ -311,11 +311,11 @@
var/mob/dead/observer/cur_obs = candidates[i]

// Generate the messages
var/cached_message = SPAN_XENONOTICE("You are currently [i-dequeued]\th in the larva queue.")
var/cached_message = "You are currently [i-dequeued]\th in the larva queue."
cur_obs.larva_queue_cached_message = cached_message
if(!cache_only)
var/chat_message = dequeued ? replacetext(cached_message, "currently", "now") : cached_message
to_chat(candidates[i], chat_message)
to_chat(candidates[i], SPAN_XENONOTICE(chat_message))

/proc/convert_k2c(temp)
return ((temp - T0C))
Expand Down
52 changes: 38 additions & 14 deletions code/__HELPERS/icons.dm
Original file line number Diff line number Diff line change
Expand Up @@ -329,7 +329,8 @@ world
/// appearance system (overlays/underlays, etc.) is not available.
///
/// Only the first argument is required.
/proc/getFlatIcon(image/appearance, defdir, deficon, defstate, defblend, start = TRUE, no_anim = FALSE)
/// appearance_flags indicates whether appearance_flags should be respected (at the cost of about 10-20% perf)
/proc/getFlatIcon(image/appearance, defdir, deficon, defstate, defblend, start = TRUE, no_anim = FALSE, appearance_flags = FALSE)
// Loop through the underlays, then overlays, sorting them into the layers list
#define PROCESS_OVERLAYS_OR_UNDERLAYS(flat, process, base_layer) \
for (var/i in 1 to process.len) { \
Expand Down Expand Up @@ -435,11 +436,21 @@ world
if(layer_image.alpha == 0)
continue

// variables only relevant when accounting for appearance_flags:
var/apply_color = TRUE
var/apply_alpha = TRUE

if(layer_image == copy) // 'layer_image' is an /image based on the object being flattened.
curblend = BLEND_OVERLAY
add = icon(layer_image.icon, layer_image.icon_state, base_icon_dir)
else // 'I' is an appearance object.
add = getFlatIcon(image(layer_image), curdir, curicon, curstate, curblend, FALSE, no_anim)
var/image/layer_as_image = image(layer_image)
if(appearance_flags)
if(layer_as_image.appearance_flags & RESET_COLOR)
apply_color = FALSE
if(layer_as_image.appearance_flags & RESET_ALPHA)
apply_alpha = FALSE
add = getFlatIcon(layer_as_image, curdir, curicon, curstate, curblend, FALSE, no_anim, appearance_flags)
if(!add)
continue

Expand All @@ -451,9 +462,9 @@ world

if (
addX1 != flatX1 \
&& addX2 != flatX2 \
&& addY1 != flatY1 \
&& addY2 != flatY2 \
|| addX2 != flatX2 \
|| addY1 != flatY1 \
|| addY2 != flatY2 \
)
// Resize the flattened icon so the new icon fits
flat.Crop(
Expand All @@ -464,21 +475,34 @@ world
)

flatX1 = addX1
flatX2 = addY1
flatY1 = addX2
flatX2 = addX2
flatY1 = addY1
flatY2 = addY2

if(appearance_flags)
// apply parent's color/alpha to the added layers if the layer didn't opt
if(apply_color && appearance.color)
if(islist(appearance.color))
add.MapColors(arglist(appearance.color))
else
add.Blend(appearance.color, ICON_MULTIPLY)

if(apply_alpha && appearance.alpha < 255)
add.Blend(rgb(255, 255, 255, appearance.alpha), ICON_MULTIPLY)

// Blend the overlay into the flattened icon
flat.Blend(add, blendMode2iconMode(curblend), layer_image.pixel_x + 2 - flatX1, layer_image.pixel_y + 2 - flatY1)

if(appearance.color)
if(islist(appearance.color))
flat.MapColors(arglist(appearance.color))
else
flat.Blend(appearance.color, ICON_MULTIPLY)
if(!appearance_flags)
// If we didn't apply parent colors individually per layer respecting appearance_flags, then do it just the one time now
if(appearance.color)
if(islist(appearance.color))
flat.MapColors(arglist(appearance.color))
else
flat.Blend(appearance.color, ICON_MULTIPLY)

if(appearance.alpha < 255)
flat.Blend(rgb(255, 255, 255, appearance.alpha), ICON_MULTIPLY)
if(appearance.alpha < 255)
flat.Blend(rgb(255, 255, 255, appearance.alpha), ICON_MULTIPLY)

if(no_anim)
//Clean up repeated frames
Expand Down
5 changes: 5 additions & 0 deletions code/_onclick/adjacent.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,6 +94,11 @@ Quick adjacency (to turf):
/obj/item/Adjacent(atom/neighbor, recurse = 1)
if(neighbor == loc || (loc && neighbor == loc.loc))
return TRUE

// Internal storages have special relationships with the object they are connected to and we still want two depth adjacency for storages
if(istype(loc?.loc, /obj/item/storage/internal) && recurse > 0)
return loc.loc.Adjacent(neighbor, recurse)

if(issurface(loc))
return loc.Adjacent(neighbor, recurse) //Surfaces don't count as storage depth.
else if(istype(loc, /obj/item))
Expand Down
10 changes: 6 additions & 4 deletions code/controllers/subsystem/statpanel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,10 @@ SUBSYSTEM_DEF(statpanels)
set name = "Open Statbrowser Options"
set hidden = TRUE

if (!current_fontsize)
current_fontsize = 12

var/datum/statbrowser_options/SM = statbrowser_options
if(!SM)
SM = statbrowser_options = new(src, current_fontsize)
SM.tgui_interact()
var/datum/statbrowser_options/options_panel = statbrowser_options
if(!options_panel)
options_panel = statbrowser_options = new(src, current_fontsize)
options_panel.tgui_interact()
137 changes: 26 additions & 111 deletions code/datums/keybinding/human.dm
Original file line number Diff line number Diff line change
@@ -1,95 +1,10 @@
#define QUICK_EQUIP_PRIMARY 1
#define QUICK_EQUIP_SECONDARY 2
#define QUICK_EQUIP_TERTIARY 3
#define QUICK_EQUIP_QUATERNARY 4

/datum/keybinding/human
category = CATEGORY_HUMAN
weight = WEIGHT_MOB

/datum/keybinding/human/can_use(client/user)
return ishuman(user.mob)

/datum/keybinding/human/quick_equip
hotkey_keys = list("E")
classic_keys = list("E")
name = "quick_equip"
full_name = "Unholster"
description = "Take out an available weapon"
keybind_signal = COMSIG_KB_HUMAN_QUICKEQUIP_DOWN

/datum/keybinding/human/quick_equip/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.holster_verb(QUICK_EQUIP_PRIMARY)
return TRUE

/datum/keybinding/human/quick_equip_secondary
hotkey_keys = list("Shift+E")
classic_keys = list("Shift+E")
name = "quick_equip_secondary"
full_name = "Unholster secondary"
description = "Take out your secondary weapon"
keybind_signal = COMSIG_KB_HUMAN_SECONDARY_DOWN

/datum/keybinding/human/quick_equip_secondary/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.holster_verb(QUICK_EQUIP_SECONDARY)
return TRUE

/datum/keybinding/human/quick_equip_tertiary
hotkey_keys = list("Ctrl+E", "Alt+E")
classic_keys = list("Ctrl+E", "Alt+E")
name = "quick_equip_tertiary"
full_name = "Unholster tertiary"
description = "Take out your tertiary item."
keybind_signal = COMSIG_KB_HUMAN_TERTIARY_DOWN

/datum/keybinding/human/quick_equip_tertiary/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.holster_verb(QUICK_EQUIP_TERTIARY)
return TRUE

/datum/keybinding/human/quick_equip_quaternary
hotkey_keys = list("Unbound")
classic_keys = list("Unbound")
name = "quick_equip_quaternary"
full_name = "Unholster quaternary"
description = "Take out your quaternary item."
keybind_signal = COMSIG_KB_HUMAN_QUATERNARY_DOWN

/datum/keybinding/human/quick_equip_quaternary/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.holster_verb(QUICK_EQUIP_QUATERNARY)
return TRUE

/datum/keybinding/human/quick_equip_inventory
hotkey_keys = list("Unbound")
classic_keys = list("Unbound")
name = "quick_equip_inventory"
full_name = "Quick equip inventory"
description = "Quickly puts an item in the best slot available"
keybind_signal = COMSIG_KB_HUMAN_QUICK_EQUIP_DOWN

/datum/keybinding/human/quick_equip_inventory/down(client/user)
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.quick_equip()
return TRUE

/datum/keybinding/human/issue_order
hotkey_keys = list("Unbound")
classic_keys = list("Unbound")
Expand All @@ -103,8 +18,8 @@
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.issue_order(order)
var/mob/living/carbon/human/human_mob = user.mob
human_mob.issue_order(order)
return TRUE

/datum/keybinding/human/issue_order/move
Expand Down Expand Up @@ -139,8 +54,8 @@
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.spec_activation_one()
var/mob/living/carbon/human/human_mob = user.mob
human_mob.spec_activation_one()
return TRUE

/datum/keybinding/human/specialist_two
Expand All @@ -154,24 +69,8 @@
. = ..()
if(.)
return
var/mob/living/carbon/human/H = user.mob
H.spec_activation_two()
return TRUE

/datum/keybinding/human/pick_up
hotkey_keys = list("F")
classic_keys = list("Unbound")
name = "pick_up"
full_name = "Pick Up Dropped Items"
keybind_signal = COMSIG_KB_HUMAN_PICK_UP

/datum/keybinding/human/pick_up/down(client/user)
. = ..()
if(.)
return

var/mob/living/carbon/human/human_user = user.mob
human_user.pickup_recent()
var/mob/living/carbon/human/human_mob = user.mob
human_mob.spec_activation_two()
return TRUE

/datum/keybinding/human/rotate_chair
Expand Down Expand Up @@ -209,7 +108,23 @@
shown_item.showoff(human_user)
return TRUE

#undef QUICK_EQUIP_PRIMARY
#undef QUICK_EQUIP_SECONDARY
#undef QUICK_EQUIP_TERTIARY
#undef QUICK_EQUIP_QUATERNARY
/datum/keybinding/human/cycle_helmet_hud
hotkey_keys = list("Unbound")
classic_keys = list("Unbound")
name = "cycle_helmet_hud"
full_name = "Cycle Helmet HUD"
keybind_signal = COMSIG_KB_HUMAN_CYCLE_HELMET_HUD

/datum/keybinding/human/cycle_helmet_hud/down(client/user)
. = ..()
if(.)
return

var/mob/living/carbon/human/human_user = user.mob
var/obj/item/clothing/head/helmet/marine/marine_helmet = human_user?.head
var/cycled_hud = marine_helmet?.cycle_huds(human_user)

var/datum/action/item_action/cycle_helmet_huds/cycle_action = locate() in marine_helmet.actions
cycle_action.set_action_overlay(cycled_hud)

return TRUE
1 change: 0 additions & 1 deletion code/datums/keybinding/human_combat.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,5 @@
/datum/keybinding/human/combat
category = CATEGORY_HUMAN_COMBAT
weight = WEIGHT_MOB

/datum/keybinding/human/combat/can_use(client/user)
. = ..()
Expand Down
Loading

0 comments on commit 81b35ec

Please sign in to comment.