diff --git a/code/__DEFINES/keybinding.dm b/code/__DEFINES/keybinding.dm index b044e3426bc1..88f194bb33df 100644 --- a/code/__DEFINES/keybinding.dm +++ b/code/__DEFINES/keybinding.dm @@ -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" @@ -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" @@ -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" diff --git a/code/__DEFINES/xeno.dm b/code/__DEFINES/xeno.dm index b178f0692dd6..a0a4c927d3d9 100644 --- a/code/__DEFINES/xeno.dm +++ b/code/__DEFINES/xeno.dm @@ -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 diff --git a/code/_onclick/adjacent.dm b/code/_onclick/adjacent.dm index dd7a528bb8a6..6504db0d9f0c 100644 --- a/code/_onclick/adjacent.dm +++ b/code/_onclick/adjacent.dm @@ -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)) diff --git a/code/datums/keybinding/human.dm b/code/datums/keybinding/human.dm index 6580c38083ea..6d7037eac398 100644 --- a/code/datums/keybinding/human.dm +++ b/code/datums/keybinding/human.dm @@ -1,8 +1,3 @@ -#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 @@ -10,86 +5,6 @@ /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") @@ -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 @@ -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 @@ -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 @@ -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 diff --git a/code/datums/keybinding/human_combat.dm b/code/datums/keybinding/human_combat.dm index 003fba3b00bd..2f37efc61438 100644 --- a/code/datums/keybinding/human_combat.dm +++ b/code/datums/keybinding/human_combat.dm @@ -1,6 +1,5 @@ /datum/keybinding/human/combat category = CATEGORY_HUMAN_COMBAT - weight = WEIGHT_MOB /datum/keybinding/human/combat/can_use(client/user) . = ..() diff --git a/code/datums/keybinding/human_inventory.dm b/code/datums/keybinding/human_inventory.dm new file mode 100644 index 000000000000..163cbccdd5c0 --- /dev/null +++ b/code/datums/keybinding/human_inventory.dm @@ -0,0 +1,244 @@ +/datum/keybinding/human/inventory + category = CATEGORY_HUMAN_INVENTORY + +#define QUICK_EQUIP_PRIMARY 1 +#define QUICK_EQUIP_SECONDARY 2 +#define QUICK_EQUIP_TERTIARY 3 +#define QUICK_EQUIP_QUATERNARY 4 + +/datum/keybinding/human/inventory/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_INTERACT_QUICKEQUIP_DOWN + +/datum/keybinding/human/inventory/quick_equip/down(client/user) + . = ..() + if(.) + return + var/mob/living/carbon/human/human_mob = user.mob + human_mob.holster_verb(QUICK_EQUIP_PRIMARY) + return TRUE + +/datum/keybinding/human/inventory/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_INTERACT_SECONDARY_DOWN + +/datum/keybinding/human/inventory/quick_equip_secondary/down(client/user) + . = ..() + if(.) + return + var/mob/living/carbon/human/human_mob = user.mob + human_mob.holster_verb(QUICK_EQUIP_SECONDARY) + return TRUE + +/datum/keybinding/human/inventory/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_INTERACT_TERTIARY_DOWN + +/datum/keybinding/human/inventory/quick_equip_tertiary/down(client/user) + . = ..() + if(.) + return + var/mob/living/carbon/human/human_mob = user.mob + human_mob.holster_verb(QUICK_EQUIP_TERTIARY) + return TRUE + +/datum/keybinding/human/inventory/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_INTERACT_QUATERNARY_DOWN + +/datum/keybinding/human/inventory/quick_equip_quaternary/down(client/user) + . = ..() + if(.) + return + var/mob/living/carbon/human/human_mob = user.mob + human_mob.holster_verb(QUICK_EQUIP_QUATERNARY) + return TRUE + +#undef QUICK_EQUIP_PRIMARY +#undef QUICK_EQUIP_SECONDARY +#undef QUICK_EQUIP_TERTIARY +#undef QUICK_EQUIP_QUATERNARY + +/datum/keybinding/human/inventory/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_INTERACT_QUICK_EQUIP_DOWN + +/datum/keybinding/human/inventory/quick_equip_inventory/down(client/user) + . = ..() + if(.) + return + var/mob/living/carbon/human/human_mob = user.mob + human_mob.quick_equip() + return TRUE + +/datum/keybinding/human/inventory/pick_up + hotkey_keys = list("F") + classic_keys = list("Unbound") + name = "pick_up" + full_name = "Pick Up Dropped Items" + keybind_signal = COMSIG_KB_HUMAN_INTERACT_PICK_UP + +/datum/keybinding/human/inventory/pick_up/down(client/user) + . = ..() + if(.) + return + + var/mob/living/carbon/human/human_user = user.mob + human_user.pickup_recent() + return TRUE + +/datum/keybinding/human/inventory/interact_other_hand + hotkey_keys = list("Unbound") + classic_keys = list("Unbound") + name = "interact_other_hand" + full_name = "Interact With Other Hand" + keybind_signal = COMSIG_KB_HUMAN_INTERACT_OTHER_HAND + +/datum/keybinding/human/inventory/interact_other_hand/down(client/user) + . = ..() + if(.) + return + + var/mob/living/carbon/human/human_user = user.mob + + var/active_hand = human_user.get_active_hand() + var/inactive_hand = human_user.get_inactive_hand() + + if(!inactive_hand) + return + human_user.click_adjacent(inactive_hand, active_hand) + return TRUE + +#define INTERACT_KEYBIND_COOLDOWN_TIME (0.2 SECONDS) +#define COOLDOWN_SLOT_INTERACT_KEYBIND "slot_interact_keybind_cooldown" + +/datum/keybinding/human/inventory/interact_slot + hotkey_keys = list("Unbound") + classic_keys = list("Unbound") + var/storage_slot + +/datum/keybinding/human/inventory/interact_slot/proc/check_slot(mob/living/carbon/human/user) + return + +/datum/keybinding/human/inventory/interact_slot/down(client/user) + . = ..() + if(.) + return + if(!storage_slot) + return + if(TIMER_COOLDOWN_CHECK(src, COOLDOWN_SLOT_INTERACT_KEYBIND)) + return + + TIMER_COOLDOWN_START(src, COOLDOWN_SLOT_INTERACT_KEYBIND, INTERACT_KEYBIND_COOLDOWN_TIME) + var/mob/living/carbon/human/human_user = user.mob + var/obj/item/current_item = check_slot(human_user) + var/obj/item/in_hand_item = human_user.get_active_hand() + + if(in_hand_item) + if(!current_item) + if(!human_user.equip_to_slot_if_possible(in_hand_item, storage_slot, FALSE, FALSE)) + return + return TRUE + + current_item.attackby(in_hand_item, human_user) + return TRUE + + if(!current_item) + return + current_item.attack_hand(human_user) + return TRUE + +/datum/keybinding/human/inventory/interact_slot/back + name = "interact_storage_back" + full_name = "Interact With Back Slot" + keybind_signal = COMSIG_KB_HUMAN_INTERACT_SLOT_BACK + storage_slot = WEAR_BACK + +/datum/keybinding/human/inventory/interact_slot/back/check_slot(mob/living/carbon/human/user) + return user.back + +/datum/keybinding/human/inventory/interact_slot/belt + name = "interact_storage_belt" + full_name = "Interact With Belt Slot" + keybind_signal = COMSIG_KB_HUMAN_INTERACT_SLOT_BELT + storage_slot = WEAR_WAIST + +/datum/keybinding/human/inventory/interact_slot/belt/check_slot(mob/living/carbon/human/user) + return user.belt + +/datum/keybinding/human/inventory/interact_slot/pouch_left + name = "interact_storage_pouch_left" + full_name = "Interact With Left Pouch Slot" + keybind_signal = COMSIG_KB_HUMAN_INTERACT_SLOT_LEFT_POUCH + storage_slot = WEAR_L_STORE + +/datum/keybinding/human/inventory/interact_slot/pouch_left/check_slot(mob/living/carbon/human/user) + return user.l_store + +/datum/keybinding/human/inventory/interact_slot/pouch_right + name = "interact_storage_pouch_right" + full_name = "Interact With Right Pouch Slot" + keybind_signal = COMSIG_KB_HUMAN_INTERACT_SLOT_RIGHT_POUCH + storage_slot = WEAR_R_STORE + +/datum/keybinding/human/inventory/interact_slot/pouch_right/check_slot(mob/living/carbon/human/user) + return user.r_store + +/datum/keybinding/human/inventory/interact_slot/uniform + name = "interact_storage_uniform" + full_name = "Interact With Uniform Slot" + keybind_signal = COMSIG_KB_HUMAN_INTERACT_SLOT_UNIFORM + storage_slot = WEAR_BODY + +/datum/keybinding/human/inventory/interact_slot/uniform/check_slot(mob/living/carbon/human/user) + return user.w_uniform + +/datum/keybinding/human/inventory/interact_slot/suit + name = "interact_storage_suit" + full_name = "Interact With Suit Slot" + keybind_signal = COMSIG_KB_HUMAN_INTERACT_SLOT_SUIT + storage_slot = WEAR_JACKET + +/datum/keybinding/human/inventory/interact_slot/suit/check_slot(mob/living/carbon/human/user) + return user.wear_suit + +/datum/keybinding/human/inventory/interact_slot/helmet + name = "interact_storage_helmet" + full_name = "Interact With Head Slot" + keybind_signal = COMSIG_KB_HUMAN_INTERACT_SLOT_HELMET + storage_slot = WEAR_HEAD + +/datum/keybinding/human/inventory/interact_slot/helmet/check_slot(mob/living/carbon/human/user) + return user.head + +/datum/keybinding/human/inventory/interact_slot/suit_storage + name = "interact_storage_suit_store" + full_name = "Interact With Suit Storage Slot" + keybind_signal = COMSIG_KB_HUMAN_INTERACT_SUIT_S_STORE + storage_slot = WEAR_J_STORE + +/datum/keybinding/human/inventory/interact_slot/suit_storage/check_slot(mob/living/carbon/human/user) + return user.s_store + +#undef INTERACT_KEYBIND_COOLDOWN_TIME +#undef COOLDOWN_SLOT_INTERACT_KEYBIND diff --git a/code/datums/supply_packs/gear.dm b/code/datums/supply_packs/gear.dm index b67f8f134c25..54a2ae221c9d 100644 --- a/code/datums/supply_packs/gear.dm +++ b/code/datums/supply_packs/gear.dm @@ -63,15 +63,3 @@ containertype = /obj/structure/closet/crate/ammo containername = "fulton recovery device crate" group = "Gear" - -/datum/supply_packs/nvg - name = "M2 Night Vision Goggles Crate (x3)" - contains = list( - /obj/item/prop/helmetgarb/helmet_nvg, - /obj/item/prop/helmetgarb/helmet_nvg, - /obj/item/prop/helmetgarb/helmet_nvg, - ) - cost = 60 - containertype = /obj/structure/closet/crate/supply - containername = "M2 Night Vission Goggles Crate" - group = "Gear" diff --git a/code/game/gamemodes/game_mode.dm b/code/game/gamemodes/game_mode.dm index f6f75c6ba4e0..5382d80f37a2 100644 --- a/code/game/gamemodes/game_mode.dm +++ b/code/game/gamemodes/game_mode.dm @@ -105,6 +105,7 @@ var/global/cas_tracking_id_increment = 0 //this var used to assign unique tracki np.new_player_panel_proc() round_time_lobby = world.time log_game("Round started at [time2text(world.realtime)]") + log_game("Operation time at round start is [worldtime2text()]") if(SSticker.mode) log_game("Game mode set to [SSticker.mode]") log_game("Server IP: [world.internet_address]:[world.port]") diff --git a/code/game/machinery/recharger.dm b/code/game/machinery/recharger.dm index 7855f446c805..c75360e07568 100644 --- a/code/game/machinery/recharger.dm +++ b/code/game/machinery/recharger.dm @@ -11,7 +11,7 @@ black_market_value = 35 var/obj/item/charging = null var/percent_charge_complete = 0 - var/list/allowed_devices = list(/obj/item/weapon/baton, /obj/item/cell, /obj/item/weapon/gun/energy, /obj/item/device/defibrillator, /obj/item/tool/portadialysis, /obj/item/clothing/suit/auto_cpr, /obj/item/smartgun_battery) + var/list/allowed_devices = list(/obj/item/weapon/baton, /obj/item/cell, /obj/item/weapon/gun/energy, /obj/item/device/defibrillator, /obj/item/tool/portadialysis, /obj/item/clothing/suit/auto_cpr, /obj/item/smartgun_battery, /obj/item/device/helmet_visor/night_vision) var/charge_amount = 1000 @@ -181,6 +181,21 @@ update_icon() return + if(istype(charging, /obj/item/device/helmet_visor/night_vision)) + var/obj/item/device/helmet_visor/night_vision/charging_night_vision_visor = charging + if(charging_night_vision_visor.power_cell) + if(!charging_night_vision_visor.power_cell.fully_charged()) + charging_night_vision_visor.power_cell.give(charge_amount) + percent_charge_complete = charging_night_vision_visor.power_cell.percent() + update_use_power(USE_POWER_ACTIVE) + update_icon() + return + + percent_charge_complete = 100 + update_use_power(USE_POWER_IDLE) + update_icon() + return + /* Disable defib recharging if(istype(charging, /obj/item/device/defibrillator)) var/obj/item/device/defibrillator/D = charging diff --git a/code/game/machinery/telecomms/presets.dm b/code/game/machinery/telecomms/presets.dm index b327bd6fdf26..5f26e9d5ed25 100644 --- a/code/game/machinery/telecomms/presets.dm +++ b/code/game/machinery/telecomms/presets.dm @@ -218,12 +218,20 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) /// Held image for the current overlay on the tower from xeno corruption var/image/corruption_image + /// Holds the delay for when a cluster can recorrupt the comms tower after a pylon has been destroyed + COOLDOWN_DECLARE(corruption_delay) + /obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/Initialize() . = ..() RegisterSignal(src, COMSIG_ATOM_TURF_CHANGE, PROC_REF(register_with_turf)) register_with_turf() +/obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/get_examine_text(mob/user) + . = ..() + if(isxeno(user) && !COOLDOWN_FINISHED(src, corruption_delay)) + . += SPAN_XENO("Corruption cooldown: [(COOLDOWN_TIMELEFT(src, corruption_delay) / (1 SECONDS))] seconds.") + /obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/attack_hand(mob/user) if(user.action_busy) return @@ -323,6 +331,10 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) addtimer(CALLBACK(src, PROC_REF(handle_xeno_acquisition), weeded_turf), (XENO_COMM_ACQUISITION_TIME - ROUND_TIME)) return + if(!COOLDOWN_FINISHED(src, corruption_delay)) + addtimer(CALLBACK(src, PROC_REF(handle_xeno_acquisition), weeded_turf), (COOLDOWN_TIMELEFT(src, corruption_delay))) + return + var/obj/effect/alien/weeds/node/pylon/cluster/parent_node = weeded_turf.weeds.parent var/obj/effect/alien/resin/special/cluster/cluster_parent = parent_node.resin_parent @@ -362,6 +374,8 @@ GLOBAL_LIST_EMPTY(all_static_telecomms_towers) overlays -= corruption_image + COOLDOWN_START(src, corruption_delay, XENO_PYLON_DESTRUCTION_DELAY) + /// Handles moving the overlay from growing to idle /obj/structure/machinery/telecomms/relay/preset/tower/mapcomms/proc/switch_to_idle_corruption() if(!corrupted) diff --git a/code/game/machinery/vending/vendor_types/intelligence_officer.dm b/code/game/machinery/vending/vendor_types/intelligence_officer.dm index 46394bea8c2c..ad10037ccfe1 100644 --- a/code/game/machinery/vending/vendor_types/intelligence_officer.dm +++ b/code/game/machinery/vending/vendor_types/intelligence_officer.dm @@ -7,7 +7,7 @@ GLOBAL_LIST_INIT(cm_vending_gear_intelligence_officer, list( list("SUPPLIES", 0, null, null, null), list("Power Control Module", 5, /obj/item/circuitboard/apc, null, VENDOR_ITEM_REGULAR), list("Binoculars", 5, /obj/item/device/binoculars, null, VENDOR_ITEM_REGULAR), - list("M2 Night Vision Goggles", 25, /obj/item/prop/helmetgarb/helmet_nvg, null, VENDOR_ITEM_RECOMMENDED), + list("Night Vision Optic", 25, /obj/item/device/helmet_visor/night_vision, null, VENDOR_ITEM_RECOMMENDED), list("Data Detector", 5, /obj/item/device/motiondetector/intel, null, VENDOR_ITEM_REGULAR), list("Intel Radio Encryption Key", 5, /obj/item/device/encryptionkey/intel, null, VENDOR_ITEM_REGULAR), list("Fire Extinguisher (Portable)", 5, /obj/item/tool/extinguisher/mini, null, VENDOR_ITEM_REGULAR), diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_leader.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_leader.dm index ea3423260ec0..9845ff9cb610 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_leader.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_leader.dm @@ -23,7 +23,7 @@ GLOBAL_LIST_INIT(cm_vending_gear_leader, list( list("Machete Pouch (Full)", 4, /obj/item/storage/pouch/machete/full, null, VENDOR_ITEM_REGULAR), list("USCM Radio Telephone Pack", 5, /obj/item/storage/backpack/marine/satchel/rto, null, VENDOR_ITEM_REGULAR), list("M276 Pattern Combat Toolbelt Rig", 15, /obj/item/storage/belt/gun/utility, null, VENDOR_ITEM_REGULAR), - list("M2 Night Vision Goggles", 20, /obj/item/prop/helmetgarb/helmet_nvg, null, VENDOR_ITEM_RECOMMENDED), + list("Night Vision Optic", 20, /obj/item/device/helmet_visor/night_vision, null, VENDOR_ITEM_RECOMMENDED), list("UTILITIES", 0, null, null, null), list("Whistle", 3, /obj/item/device/whistle, null, VENDOR_ITEM_REGULAR), diff --git a/code/game/machinery/vending/vendor_types/squad_prep/squad_tl.dm b/code/game/machinery/vending/vendor_types/squad_prep/squad_tl.dm index c03d79eddfd0..875f84264c0a 100644 --- a/code/game/machinery/vending/vendor_types/squad_prep/squad_tl.dm +++ b/code/game/machinery/vending/vendor_types/squad_prep/squad_tl.dm @@ -40,7 +40,7 @@ GLOBAL_LIST_INIT(cm_vending_gear_tl, list( list("M276 Pattern Combat Toolbelt Rig", 15, /obj/item/storage/belt/gun/utility, null, VENDOR_ITEM_REGULAR), list("Autoinjector Pouch (Full)", 15, /obj/item/storage/pouch/autoinjector/full, null, VENDOR_ITEM_REGULAR), list("Insulated Gloves", 3, /obj/item/clothing/gloves/yellow, null, VENDOR_ITEM_REGULAR), - list("M2 Night Vision Goggles", 30, /obj/item/prop/helmetgarb/helmet_nvg, null, VENDOR_ITEM_RECOMMENDED), + list("Night Vision Optic", 30, /obj/item/device/helmet_visor/night_vision, null, VENDOR_ITEM_RECOMMENDED), list("UTILITIES", 0, null, null, null), list("Binoculars", 5, /obj/item/device/binoculars, null, VENDOR_ITEM_REGULAR), diff --git a/code/game/objects/effects/landmarks/survivor_spawner.dm b/code/game/objects/effects/landmarks/survivor_spawner.dm index 25cc1a80d0b4..fe4254982d57 100644 --- a/code/game/objects/effects/landmarks/survivor_spawner.dm +++ b/code/game/objects/effects/landmarks/survivor_spawner.dm @@ -145,7 +145,7 @@ intro_text = list("

You are a member of a UPP recon force!

",\ "You ARE aware of the xenomorph threat.",\ "Your primary objective is to survive. You believe a second dropship crashed somewhere to the south east, which was carrying additional weapons") - story_text = "Your orders were simple, Recon the site, ascertain if there is a biological weapons program in the area, and if so to secure the colony and retrieve a sample. However your team failed to account for an active anti-air battery near the area. Both your craft and your sister ship crashed. Barely having a chance to catch your breath, you found yourself being assailed by vile xenomorphs! You and your team have barely held your ground, at the cost of four of your own, but more are coming and ammo is low. You believe an American rescue force is en route, but is the enemy of my enemy truly your friend?" + story_text = "Your orders were simple, Recon the site, ascertain if there is a biological weapons program in the area, and if so to secure the colony and retrieve a sample. However your team failed to account for an active anti-air battery near the area. Both your craft and your sister ship crashed. Barely having a chance to catch your breath, you found yourself being assailed by vile xenomorphs! You and your team have barely held your ground, at the cost of four of your own, but more are coming and ammo is low. You believe an American rescue force is en route." spawn_priority = SPAWN_PRIORITY_LOW /obj/effect/landmark/survivor_spawner/upp_sapper @@ -154,7 +154,7 @@ intro_text = list("

You are a member of a UPP recon force!

",\ "You ARE aware of the xenomorph threat.",\ "Your primary objective is to survive. You believe a second dropship crashed somewhere to the south east, which was carrying additional weapons") - story_text = "Your orders were simple, Recon the site, ascertain if there is a biological weapons program in the area, and if so to secure the colony and retrieve a sample. However your team failed to account for an active anti-air battery near the area. Both your craft and your sister ship crashed. Barely having a chance to catch your breath, you found yourself being assailed by vile xenomorphs! You and your team have barely held your ground, at the cost of four of your own, but more are coming and ammo is low. You believe an American rescue force is en route, but is the enemy of my enemy truly your friend?" + story_text = "Your orders were simple, Recon the site, ascertain if there is a biological weapons program in the area, and if so to secure the colony and retrieve a sample. However your team failed to account for an active anti-air battery near the area. Both your craft and your sister ship crashed. Barely having a chance to catch your breath, you found yourself being assailed by vile xenomorphs! You and your team have barely held your ground, at the cost of four of your own, but more are coming and ammo is low. You believe an American rescue force is en route." spawn_priority = SPAWN_PRIORITY_MEDIUM /obj/effect/landmark/survivor_spawner/upp_medic @@ -163,7 +163,7 @@ intro_text = list("

You are a member of a UPP recon force!

",\ "You ARE aware of the xenomorph threat.",\ "Your primary objective is to survive. You believe a second dropship crashed somewhere to the south east, which was carrying additional weapons") - story_text = "Your orders were simple, Recon the site, ascertain if there is a biological weapons program in the area, and if so to secure the colony and retrieve a sample. However your team failed to account for an active anti-air battery near the area. Both your craft and your sister ship crashed. Barely having a chance to catch your breath, you found yourself being assailed by vile xenomorphs! You and your team have barely held your ground, at the cost of four of your own, but more are coming and ammo is low. You believe an American rescue force is en route, but is the enemy of my enemy truly your friend?" + story_text = "Your orders were simple, Recon the site, ascertain if there is a biological weapons program in the area, and if so to secure the colony and retrieve a sample. However your team failed to account for an active anti-air battery near the area. Both your craft and your sister ship crashed. Barely having a chance to catch your breath, you found yourself being assailed by vile xenomorphs! You and your team have barely held your ground, at the cost of four of your own, but more are coming and ammo is low. You believe an American rescue force is en route." spawn_priority = SPAWN_PRIORITY_MEDIUM /obj/effect/landmark/survivor_spawner/upp_specialist @@ -172,7 +172,7 @@ intro_text = list("

You are a member of a UPP recon force!

",\ "You ARE aware of the xenomorph threat.",\ "Your primary objective is to survive. You believe a second dropship crashed somewhere to the south east, which was carrying additional weapons") - story_text = "Your orders were simple, Recon the site, ascertain if there is a biological weapons program in the area, and if so to secure the colony and retrieve a sample. However your team failed to account for an active anti-air battery near the area. Both your craft and your sister ship crashed. Barely having a chance to catch your breath, you found yourself being assailed by vile xenomorphs! You and your team have barely held your ground, at the cost of four of your own, but more are coming and ammo is low. You believe an American rescue force is en route, but is the enemy of my enemy truly your friend?" + story_text = "Your orders were simple, Recon the site, ascertain if there is a biological weapons program in the area, and if so to secure the colony and retrieve a sample. However your team failed to account for an active anti-air battery near the area. Both your craft and your sister ship crashed. Barely having a chance to catch your breath, you found yourself being assailed by vile xenomorphs! You and your team have barely held your ground, at the cost of four of your own, but more are coming and ammo is low. You believe an American rescue force is en route." spawn_priority = SPAWN_PRIORITY_HIGH /obj/effect/landmark/survivor_spawner/squad_leader @@ -181,5 +181,5 @@ intro_text = list("

You are a member of a UPP recon force!

",\ "You ARE aware of the xenomorph threat.",\ "Your primary objective is to survive. You believe a second dropship crashed somewhere to the south east, which was carrying additional weapons") - story_text = "Your orders were simple, Recon the site, ascertain if there is a biological weapons program in the area, and if so to secure the colony and retrieve a sample. However your team failed to account for an active anti-air battery near the area. Both your craft and your sister ship crashed. Barely having a chance to catch your breath, you found yourself being assailed by vile xenomorphs! You and your team have barely held your ground, at the cost of four of your own, but more are coming and ammo is low. You believe an American rescue force is en route, but is the enemy of my enemy truly your friend?" + story_text = "Your orders were simple, Recon the site, ascertain if there is a biological weapons program in the area, and if so to secure the colony and retrieve a sample. However your team failed to account for an active anti-air battery near the area. Both your craft and your sister ship crashed. Barely having a chance to catch your breath, you found yourself being assailed by vile xenomorphs! You and your team have barely held your ground, at the cost of four of your own, but more are coming and ammo is low. You believe an American rescue force is en route." spawn_priority = SPAWN_PRIORITY_VERY_HIGH diff --git a/code/game/objects/items/devices/helmet_visors.dm b/code/game/objects/items/devices/helmet_visors.dm index dd913daf7620..596409c88c8b 100644 --- a/code/game/objects/items/devices/helmet_visors.dm +++ b/code/game/objects/items/devices/helmet_visors.dm @@ -14,31 +14,65 @@ ///The sound when toggling off the visor var/toggle_off_sound = 'sound/handling/hud_off.ogg' - ///The icon name for our helmet's action + ///The icon name for our helmet's action, in 'icons/obj/items/clothing/helmet_visors.dmi' var/action_icon_string = "hud_sight_down" - ///The overlay name for when our visor is active + ///The overlay name for when our visor is active, in 'icons/mob/humans/onmob/helmet_garb.dmi' var/helmet_overlay = "hud_sight_right" +/obj/item/device/helmet_visor/Destroy(force) + if(!istype(loc, /obj/item/clothing/head/helmet/marine)) + return ..() + + if(!istype(loc?.loc, /mob/living/carbon/human)) + return ..() + + var/obj/item/clothing/head/helmet/marine/attached_helmet = loc + var/mob/living/carbon/human/user = loc.loc + deactivate_visor(attached_helmet, user) + . = ..() + /// Called to see if the user can even use this visor /obj/item/device/helmet_visor/proc/can_toggle(mob/living/carbon/human/user) return TRUE /// Called to see if this visor is a special non-HUD visor -/obj/item/device/helmet_visor/proc/visor_function(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user, silent = FALSE) +/obj/item/device/helmet_visor/proc/toggle_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user, silent = FALSE) if(attached_helmet == user.head && attached_helmet.active_visor == src) - var/datum/mob_hud/current_mob_hud = huds[hud_type] - current_mob_hud.add_hud_to(user, attached_helmet) + + if(!can_toggle(user)) + return FALSE + + activate_visor(attached_helmet, user) + if(!silent) to_chat(user, SPAN_NOTICE("You activate [src] on [attached_helmet].")) + playsound_client(user.client, toggle_on_sound, null, 75) + return TRUE - var/datum/mob_hud/current_mob_hud = huds[hud_type] - current_mob_hud.remove_hud_from(user, attached_helmet) + deactivate_visor(attached_helmet, user) + if(!silent) to_chat(user, SPAN_NOTICE("You deactivate [src] on [attached_helmet].")) + playsound_client(user.client, toggle_off_sound, null, 75) + return TRUE +/// Called by toggle_visor() to activate the visor's effects +/obj/item/device/helmet_visor/proc/activate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) + var/datum/mob_hud/current_mob_hud = huds[hud_type] + current_mob_hud.add_hud_to(user, attached_helmet) + +/// Called by toggle_visor() to deactivate the visor's effects +/obj/item/device/helmet_visor/proc/deactivate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) + var/datum/mob_hud/current_mob_hud = huds[hud_type] + current_mob_hud.remove_hud_from(user, attached_helmet) + +/// Called by /obj/item/clothing/head/helmet/marine/get_examine_text(mob/user) to get extra examine text for this visor +/obj/item/device/helmet_visor/proc/get_helmet_examine_text() + return SPAN_NOTICE("\A [name] is flipped down.") + /obj/item/device/helmet_visor/medical name = "basic medical optic" icon_state = "med_sight" @@ -50,13 +84,75 @@ name = "advanced medical optic" helmet_overlay = "med_sight_left" +/obj/item/device/helmet_visor/medical/advanced/activate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) + . = ..() + + var/datum/action/item_action/view_publications/helmet_visor/publication_action = new(attached_helmet) + publication_action.give_to(user) + +/obj/item/device/helmet_visor/medical/advanced/deactivate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) + . = ..() + + var/datum/action/item_action/view_publications/helmet_visor/publication_action = locate() in attached_helmet.actions + qdel(publication_action) + /obj/item/device/helmet_visor/medical/advanced/can_toggle(mob/living/carbon/human/user) + . = ..() + if(!.) + return + if(!skillcheck(user, SKILL_MEDICAL, SKILL_MEDICAL_MEDIC)) to_chat(user, SPAN_NOTICE("You are not skilled enough to use [src].")) return FALSE return TRUE +/obj/item/device/helmet_visor/medical/advanced/ui_state(mob/user) + return GLOB.not_incapacitated_and_adjacent_strict_state + +/obj/item/device/helmet_visor/medical/advanced/ui_data(mob/user) + var/list/data = list( + "published_documents" = chemical_data.research_publications, + "terminal_view" = FALSE + ) + return data + +/obj/item/device/helmet_visor/medical/advanced/tgui_interact(mob/user, datum/tgui/ui) + ui = SStgui.try_update_ui(user, src, ui) + if (!ui) + ui = new(user, src, "PublishedDocsHud", name) + ui.open() + +/obj/item/device/helmet_visor/medical/advanced/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state) + . = ..() + if(.) + return + + if(!ishuman(ui.user)) + return + + var/mob/living/carbon/human/user = ui.user + + if(user.stat || user.is_mob_restrained() || !in_range(src, user)) + return + + switch(action) + if ("read_document") + var/print_type = params["print_type"] + var/print_title = params["print_title"] + var/obj/item/paper/research_report/report = chemical_data.get_report(print_type, print_title) + if(report) + report.read_paper(user) + return + +/datum/action/item_action/view_publications/helmet_visor/action_activate() + var/obj/item/device/helmet_visor/medical/advanced/medical_visor = locate() in holder_item + + if(!medical_visor) + return + + medical_visor.tgui_interact(owner) + /obj/item/device/helmet_visor/security name = "security optic" icon_state = "sec_sight" @@ -71,28 +167,159 @@ action_icon_string = "blank_hud_sight_down" helmet_overlay = "weld_visor" -/obj/item/device/helmet_visor/welding_visor/visor_function(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user, silent = FALSE) - if(attached_helmet == user.head && attached_helmet.active_visor == src) - attached_helmet.vision_impair = VISION_IMPAIR_MAX - attached_helmet.flags_inventory |= COVEREYES|COVERMOUTH - attached_helmet.flags_inv_hide |= HIDEEYES|HIDEFACE - attached_helmet.eye_protection = EYE_PROTECTION_WELDING - user.update_tint() - if(!silent) - to_chat(user, SPAN_NOTICE("You activate [src] on [attached_helmet].")) - return TRUE +/obj/item/device/helmet_visor/welding_visor/activate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) + attached_helmet.vision_impair = VISION_IMPAIR_MAX + attached_helmet.flags_inventory |= COVEREYES|COVERMOUTH + attached_helmet.flags_inv_hide |= HIDEEYES|HIDEFACE + attached_helmet.eye_protection = EYE_PROTECTION_WELDING + user.update_tint() +/obj/item/device/helmet_visor/welding_visor/deactivate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) attached_helmet.vision_impair = VISION_IMPAIR_NONE attached_helmet.flags_inventory &= ~(COVEREYES|COVERMOUTH) attached_helmet.flags_inv_hide &= ~(HIDEEYES|HIDEFACE) attached_helmet.eye_protection = EYE_PROTECTION_NONE - if(!silent) - to_chat(user, SPAN_NOTICE("You deactivate [src] on [attached_helmet].")) user.update_tint() - return TRUE /obj/item/device/helmet_visor/welding_visor/mercenary helmet_overlay = "" /obj/item/device/helmet_visor/welding_visor/tanker helmet_overlay = "tanker_weld_visor" + +#define NVG_VISOR_USAGE(delta_time) (power_cell.use(power_use * (delta_time ? delta_time : 1))) + +/obj/item/device/helmet_visor/night_vision + name = "night vision optic" + desc = "An insertable visor HUD into a standard USCM helmet. This type gives a form of night vision and is standard issue in units with regular funding." + icon_state = "nvg_sight" + hud_type = null + action_icon_string = "nvg_sight_down" + helmet_overlay = "nvg_sight_right" + toggle_on_sound = 'sound/handling/toggle_nv1.ogg' + toggle_off_sound = 'sound/handling/toggle_nv2.ogg' + + /// The internal battery for the visor + var/obj/item/cell/high/power_cell + + /// About 5 minutes active use charge (hypothetically) + var/power_use = 33 + + /// The alpha of darkness we set to for the mob while the visor is on, not completely fullbright but see-able + var/lighting_alpha = 100 + + /// A slight glowing green light while the NVG is activated, is initialized as in the attached_helmet's contents + var/atom/movable/nvg_light/on_light + + /// Whether or not the sight uses on_light and produces light + var/visor_glows = TRUE + +/obj/item/device/helmet_visor/night_vision/Initialize(mapload, ...) + . = ..() + power_cell = new(src) + +/obj/item/device/helmet_visor/night_vision/Destroy() + power_cell = null + . = ..() + +/obj/item/device/helmet_visor/night_vision/get_examine_text(mob/user) + . = ..() + + . += SPAN_NOTICE("It is currently at [round((power_cell.charge / power_cell.maxcharge) * 100)]% charge.") + +/obj/item/device/helmet_visor/night_vision/activate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) + RegisterSignal(user, COMSIG_HUMAN_POST_UPDATE_SIGHT, PROC_REF(on_update_sight)) + + user.add_client_color_matrix("nvg_visor", 99, color_matrix_multiply(color_matrix_saturation(0), color_matrix_from_string("#7aff7a"))) + user.overlay_fullscreen("nvg_visor", /atom/movable/screen/fullscreen/flash/noise/nvg) + user.overlay_fullscreen("nvg_visor_blur", /atom/movable/screen/fullscreen/brute/nvg, 3) + user.update_sight() + if(visor_glows) + on_light = new(attached_helmet) + on_light.set_light_on(TRUE) + START_PROCESSING(SSobj, src) + +/obj/item/device/helmet_visor/night_vision/deactivate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) + user.remove_client_color_matrix("nvg_visor", 1 SECONDS) + user.clear_fullscreen("nvg_visor", 0.5 SECONDS) + user.clear_fullscreen("nvg_visor_blur", 0.5 SECONDS) + + if(visor_glows) + qdel(on_light) + UnregisterSignal(user, COMSIG_HUMAN_POST_UPDATE_SIGHT) + + user.update_sight() + STOP_PROCESSING(SSobj, src) + +/obj/item/device/helmet_visor/night_vision/process(delta_time) + if(!NVG_VISOR_USAGE(delta_time)) + + if(!istype(loc, /obj/item/clothing/head/helmet/marine)) + return PROCESS_KILL + + if(!istype(loc?.loc, /mob/living/carbon/human)) + return PROCESS_KILL + + var/obj/item/clothing/head/helmet/marine/attached_helmet = loc + var/mob/living/carbon/human/user = loc.loc + to_chat(user, SPAN_NOTICE("[src] deactivates as the battery goes out.")) + deactivate_visor(attached_helmet, user) + return PROCESS_KILL + +/obj/item/device/helmet_visor/night_vision/can_toggle(mob/living/carbon/human/user) + . = ..() + if(!.) + return + + if(!NVG_VISOR_USAGE(FALSE)) + to_chat(user, SPAN_NOTICE("Your [src] is out of power! You'll need to recharge it.")) + return FALSE + + return TRUE + +/obj/item/device/helmet_visor/night_vision/get_helmet_examine_text() + . = ..() + + . += SPAN_NOTICE(" It is currently at [round((power_cell.charge / power_cell.maxcharge) * 100)]% charge.") + +/obj/item/device/helmet_visor/night_vision/proc/on_update_sight(mob/user) + SIGNAL_HANDLER + + if(lighting_alpha < 255) + user.see_in_dark = 12 + user.lighting_alpha = lighting_alpha + user.sync_lighting_plane_alpha() + +#undef NVG_VISOR_USAGE + +/atom/movable/nvg_light + light_power = 0.5 + light_range = 1 + light_color = COLOUR_GREEN + light_system = MOVABLE_LIGHT + light_flags = LIGHT_ATTACHED + +/obj/item/device/helmet_visor/night_vision/marine_raider + name = "advanced night vision optic" + desc = "An insertable visor HUD into a standard USCM helmet. This type gives a form of night vision and is standard issue in special forces units." + hud_type = list(MOB_HUD_FACTION_USCM, MOB_HUD_MEDICAL_ADVANCED) + helmet_overlay = "nvg_sight_right_raider" + power_use = 0 + visor_glows = FALSE + +/obj/item/device/helmet_visor/night_vision/marine_raider/activate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) + . = ..() + + for(var/type in hud_type) + var/datum/mob_hud/current_mob_hud = huds[type] + current_mob_hud.add_hud_to(user, attached_helmet) + +/obj/item/device/helmet_visor/night_vision/marine_raider/deactivate_visor(obj/item/clothing/head/helmet/marine/attached_helmet, mob/living/carbon/human/user) + . = ..() + + for(var/type in hud_type) + var/datum/mob_hud/current_mob_hud = huds[type] + current_mob_hud.remove_hud_from(user, attached_helmet) + +/obj/item/device/helmet_visor/night_vision/marine_raider/process(delta_time) + return PROCESS_KILL diff --git a/code/game/objects/items/storage/fancy.dm b/code/game/objects/items/storage/fancy.dm index ea43d6b074b9..9afa0dfd1851 100644 --- a/code/game/objects/items/storage/fancy.dm +++ b/code/game/objects/items/storage/fancy.dm @@ -71,7 +71,7 @@ storage_slots = 5 throwforce = 2 flags_equip_slot = SLOT_WAIST - + can_hold = list(/obj/item/tool/candle) /obj/item/storage/fancy/candle_box/fill_preset_inventory() for(var/i=1; i <= storage_slots; i++) diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm index c64c2a14764d..585a651582ed 100644 --- a/code/modules/clothing/head/helmet.dm +++ b/code/modules/clothing/head/helmet.dm @@ -416,9 +416,11 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( camera = new /obj/structure/machinery/camera(src) camera.network = list(CAMERA_NET_OVERWATCH) + for(var/obj/visor as anything in built_in_visors) + visor.forceMove(src) + if(length(inserted_visors) || length(built_in_visors)) var/datum/action/item_action/cycle_helmet_huds/new_action = new(src) - LAZYADD(actions, new_action) if(ishuman(loc)) var/mob/living/carbon/human/holding_human = loc if(holding_human.head == src) @@ -439,6 +441,12 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( helmet_overlays = null QDEL_NULL(camera) QDEL_NULL(pockets) + if(active_visor && istype(loc, /mob/living/carbon/human)) + var/mob/living/carbon/human/potential_user = loc + if(potential_user.head == src) + var/obj/item/device/helmet_visor/temp_visor_holder = active_visor + active_visor = null + toggle_visor(potential_user, temp_visor_holder, TRUE) return ..() /obj/item/clothing/head/helmet/marine/attack_hand(mob/user) @@ -494,21 +502,22 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( return if(HAS_TRAIT(attacking_item, TRAIT_TOOL_SCREWDRIVER) && length(inserted_visors)) + if(active_visor) + var/obj/item/device/helmet_visor/temp_visor_holder = active_visor + active_visor = null + toggle_visor(user, temp_visor_holder, TRUE) + for(var/obj/item/device/helmet_visor/visor as anything in inserted_visors) visor.forceMove(get_turf(src)) inserted_visors = list() to_chat(user, SPAN_NOTICE("You remove the inserted visors.")) - var/obj/item/device/helmet_visor/temp_visor_holder = active_visor - active_visor = null - turn_off_visor(user, temp_visor_holder, TRUE) var/datum/action/item_action/cycle_helmet_huds/cycle_action = locate() in actions cycle_action.set_default_overlay() if(!length(built_in_visors)) cycle_action.remove_from(user) - recalculate_visors(user) return ..() @@ -589,6 +598,11 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( /obj/item/clothing/head/helmet/marine/has_garb_overlay() return flags_marine_helmet & HELMET_GARB_OVERLAY +/obj/item/clothing/head/helmet/marine/get_examine_text(mob/user) + . = ..() + if(active_visor) + . += active_visor.get_helmet_examine_text() + /obj/item/clothing/head/helmet/marine/proc/add_hugger_damage() //This is called in XenoFacehuggers.dm to first add the overlay and set the var. if(flags_marine_helmet & HELMET_DAMAGE_OVERLAY && !(flags_marine_helmet & HELMET_IS_DAMAGED)) helmet_overlays["damage"] = image('icons/obj/items/clothing/cm_hats.dmi',icon_state = "hugger_damage") @@ -615,29 +629,17 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( if(!human_user || human_user.head != src) return - turn_on_visor(human_user) + toggle_visor(user, silent = TRUE) -/// Turns on the current active visor -/obj/item/clothing/head/helmet/marine/proc/turn_on_visor(mob/user) - if(!active_visor) - return +/// Toggles the specified visor, if nothing specified then the active visor, if the visor is the active visor and the helmet is on the user's head it will turn on, if it is not the active visor it will turn off +/obj/item/clothing/head/helmet/marine/proc/toggle_visor(mob/user, obj/item/device/helmet_visor/current_visor, silent = FALSE) + current_visor = current_visor || active_visor - if(active_visor.can_toggle(user)) - active_visor.visor_function(src, user) - - playsound_client(user.client, active_visor.toggle_on_sound, null, 75) - update_icon() - -/// Turns off the specified visor -/obj/item/clothing/head/helmet/marine/proc/turn_off_visor(mob/user, obj/item/device/helmet_visor/current_visor, sound = FALSE) if(!current_visor) return - if(current_visor.can_toggle(user)) - current_visor.visor_function(src, user) + current_visor.toggle_visor(src, user, silent) - if(sound) - playsound_client(user.client, current_visor.toggle_off_sound, null, 75) update_icon() /// Attempts to turn off all visors @@ -645,8 +647,7 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( var/list/total_visors = built_in_visors + inserted_visors for(var/obj/item/device/helmet_visor/cycled_helmet_visor in total_visors) - if(cycled_helmet_visor.can_toggle(user)) - cycled_helmet_visor.visor_function(src, user, TRUE) + cycled_helmet_visor.deactivate_visor(src, user) update_icon() @@ -662,20 +663,19 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( for(var/hud_type in total_visors) if(hud_type == active_visor) if(length(total_visors) > iterator) - turn_off_visor(user, active_visor, FALSE) active_visor = total_visors[(iterator + 1)] - recalculate_visors(user) + toggle_visor(user, total_visors[iterator], TRUE) + toggle_visor(user) return active_visor else - turn_off_visor(user, active_visor, TRUE) active_visor = null - recalculate_visors(user) + toggle_visor(user, total_visors[iterator], FALSE) return FALSE iterator++ if(total_visors[1]) active_visor = total_visors[1] - recalculate_visors(user) + toggle_visor(user) return active_visor active_visor = null @@ -944,8 +944,8 @@ GLOBAL_LIST_INIT(allowed_helmet_items, list( armor_bio = CLOTHING_ARMOR_MEDIUMHIGH specialty = "M10 pattern SOF" flags_atom = NO_SNOW_TYPE - built_in_visors = list(new /obj/item/device/helmet_visor, new /obj/item/device/helmet_visor/medical, new /obj/item/device/helmet_visor/security) - + built_in_visors = list(new /obj/item/device/helmet_visor/night_vision/marine_raider, new /obj/item/device/helmet_visor/security) + start_down_visor_type = /obj/item/device/helmet_visor/night_vision/marine_raider //=============================//PMCS\\==================================\\ //=======================================================================\\ diff --git a/code/modules/cm_aliens/structures/special/pylon_core.dm b/code/modules/cm_aliens/structures/special/pylon_core.dm index 4eff0240939d..96ded23c8ac7 100644 --- a/code/modules/cm_aliens/structures/special/pylon_core.dm +++ b/code/modules/cm_aliens/structures/special/pylon_core.dm @@ -196,10 +196,12 @@ if(!xeno.counts_for_slots) hive_xenos -= xeno - if(length(hive_xenos) > (length(GLOB.alive_human_list) * ENDGAME_LARVA_CAP_MULTIPLIER)) + var/real_total_xeno_count = length(hive_xenos) + linked_hive.stored_larva + + if(real_total_xeno_count > (length(GLOB.alive_human_list) * ENDGAME_LARVA_CAP_MULTIPLIER)) return - linked_hive.partial_larva += length(hive_xenos) * LARVA_ADDITION_MULTIPLIER + linked_hive.partial_larva += real_total_xeno_count * LARVA_ADDITION_MULTIPLIER linked_hive.convert_partial_larva_to_full_larva() linked_hive.hive_ui.update_burrowed_larva() diff --git a/code/modules/gear_presets/survivors/trijent/crashlanding_upp_bar_insert_trijent.dm b/code/modules/gear_presets/survivors/trijent/crashlanding_upp_bar_insert_trijent.dm index e8dc8482b769..147e40a24314 100644 --- a/code/modules/gear_presets/survivors/trijent/crashlanding_upp_bar_insert_trijent.dm +++ b/code/modules/gear_presets/survivors/trijent/crashlanding_upp_bar_insert_trijent.dm @@ -9,18 +9,13 @@ languages = list(LANGUAGE_RUSSIAN, LANGUAGE_GERMAN, LANGUAGE_CHINESE) faction = FACTION_UPP faction_group = list(FACTION_UPP, FACTION_SURVIVOR) - role_comm_title = "UPP 173RD RECON" + role_comm_title = "173/RECON" idtype = /obj/item/card/id/dogtag flags = EQUIPMENT_PRESET_EXTRA - uses_special_name = TRUE access = list( ACCESS_CIVILIAN_PUBLIC, ) -/datum/equipment_preset/survivor/upp/load_name(mob/living/carbon/human/new_human, randomise) - var/random_name = capitalize(pick(new_human.gender == MALE ? first_names_male_upp : first_names_female_upp)) + " " + capitalize(pick(last_names_upp)) - new_human.change_real_name(new_human, random_name) - /datum/equipment_preset/survivor/upp/load_gear(mob/living/carbon/human/new_human) var/obj/item/clothing/under/marine/veteran/UPP/uniform = new() var/random_number = rand(1,2) @@ -152,7 +147,7 @@ assignment = JOB_UPP_LEADER rank = JOB_UPP_LEADER languages = list(LANGUAGE_RUSSIAN, LANGUAGE_ENGLISH, LANGUAGE_GERMAN, LANGUAGE_CHINESE) - role_comm_title = "UPP 173Rd RECON SL" + role_comm_title = "173/RECON SL" skills = /datum/skills/military/survivor/upp_sl /datum/equipment_preset/survivor/upp/squad_leader/load_gear(mob/living/carbon/human/new_human) diff --git a/code/modules/gear_presets/uscm.dm b/code/modules/gear_presets/uscm.dm index 1c84e7cad4ba..ec0195e928c5 100644 --- a/code/modules/gear_presets/uscm.dm +++ b/code/modules/gear_presets/uscm.dm @@ -803,7 +803,6 @@ new_human.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/pmc/marsoc, WEAR_FACE) //head new_human.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/marine/sof, WEAR_HEAD) - new_human.equip_to_slot_or_del(new /obj/item/prop/helmetgarb/helmet_nvg/marsoc, WEAR_IN_HELMET) new_human.equip_to_slot_or_del(new /obj/item/ammo_magazine/handful/shotgun/buckshot, WEAR_IN_HELMET) //uniform var/obj/item/clothing/under/marine/veteran/marsoc/M = new() diff --git a/code/modules/projectiles/gun_attachables.dm b/code/modules/projectiles/gun_attachables.dm index 2438947ef254..20781639a579 100644 --- a/code/modules/projectiles/gun_attachables.dm +++ b/code/modules/projectiles/gun_attachables.dm @@ -3058,9 +3058,6 @@ Defined in conflicts.dm of the #defines folder. /obj/item/attachable/attached_gun/extinguisher/fire_attachment(atom/target, obj/item/weapon/gun/gun, mob/living/user) if(!internal_extinguisher) return - if(!(gun.flags_item & WIELDED)) - to_chat(user, SPAN_WARNING("You must wield [gun] to fire [src]!")) - return if(..()) return internal_extinguisher.afterattack(target, user) diff --git a/colonialmarines.dme b/colonialmarines.dme index 3f40c156d075..63140be5e458 100644 --- a/colonialmarines.dme +++ b/colonialmarines.dme @@ -529,6 +529,7 @@ s// DM Environment file for colonialmarines.dme. #include "code\datums\keybinding\emote.dm" #include "code\datums\keybinding\human.dm" #include "code\datums\keybinding\human_combat.dm" +#include "code\datums\keybinding\human_inventory.dm" #include "code\datums\keybinding\living.dm" #include "code\datums\keybinding\mob.dm" #include "code\datums\keybinding\movement.dm" diff --git a/html/changelogs/AutoChangeLog-pr-4549.yml b/html/changelogs/AutoChangeLog-pr-4549.yml new file mode 100644 index 000000000000..340240729140 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-4549.yml @@ -0,0 +1,12 @@ +author: "Morrow" +delete-after: True +changes: + - rscadd: "Added NVG optics" + - rscadd: "Added a hotkey to cycle optics" + - rscadd: "Added special marine raider optic" + - rscadd: "Added examine text for optics" + - rscadd: "Added research publication to advanced medical optic" + - rscdel: "Removed functional tube NVGs from gameplay" + - refactor: "Moved some optics code around to make it less redundant" + - bugfix: "Fixed a bug with duplicate optic actions" + - bugfix: "Fixed a reported bug where HUDs would stay on forever with destruction of a helmet" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-4571.yml b/html/changelogs/AutoChangeLog-pr-4571.yml new file mode 100644 index 000000000000..bd51c77a8f37 --- /dev/null +++ b/html/changelogs/AutoChangeLog-pr-4571.yml @@ -0,0 +1,5 @@ +author: "Morrow" +delete-after: True +changes: + - balance: "Comms relays now have a five minute cooldown to be re-pylon'd after a pylon was destroyed" + - bugfix: "Pylons now account for stored larva" \ No newline at end of file diff --git a/html/changelogs/AutoChangeLog-pr-4573.yml b/html/changelogs/AutoChangeLog-pr-4573.yml deleted file mode 100644 index bcc8300e8578..000000000000 --- a/html/changelogs/AutoChangeLog-pr-4573.yml +++ /dev/null @@ -1,4 +0,0 @@ -author: "blackdragonTOW" -delete-after: True -changes: - - sounddel: "removed 300+ ancient and unused Piano and Violin notes." \ No newline at end of file diff --git a/html/changelogs/archive/2023-10.yml b/html/changelogs/archive/2023-10.yml index e67005c1e744..3d9b9b3270e0 100644 --- a/html/changelogs/archive/2023-10.yml +++ b/html/changelogs/archive/2023-10.yml @@ -42,3 +42,15 @@ - rscadd: Adds the surgical drop pouch item. It comes in green, blue and black. Only available from the synthetic vendor currently. - imageadd: Adds sprites for the surgical drop pouches. +2023-10-04: + BeagleGaming1: + - rscadd: Added keybinds to allow inventory manipulation + Morrow: + - admin: Operation time logging + - balance: Underbarrel extinguisher no longer requires wield + - bugfix: Re-added previous UPP changes that were lost in soft conflict + - spellcheck: Removed some ambiguous text about loyalties for UPP survivors + - bugfix: Fixed storage depth for internal storages + - bugfix: Candle boxes can now only hold candles + blackdragonTOW: + - sounddel: removed 300+ ancient and unused Piano and Violin notes. diff --git a/icons/mob/humans/onmob/helmet_garb.dmi b/icons/mob/humans/onmob/helmet_garb.dmi index 325aed72b155..645223618d74 100644 Binary files a/icons/mob/humans/onmob/helmet_garb.dmi and b/icons/mob/humans/onmob/helmet_garb.dmi differ diff --git a/icons/obj/items/clothing/helmet_visors.dmi b/icons/obj/items/clothing/helmet_visors.dmi index 6ba0cfe5623e..f47bc9aa26d2 100644 Binary files a/icons/obj/items/clothing/helmet_visors.dmi and b/icons/obj/items/clothing/helmet_visors.dmi differ diff --git a/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm b/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm index dac318453cdf..d000153afd71 100644 --- a/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm +++ b/maps/map_files/LV522_Chances_Claim/LV522_Chances_Claim.dmm @@ -11958,12 +11958,6 @@ icon_state = "brown" }, /area/lv522/atmos/north_command_centre) -"fpS" = ( -/obj/item/prop/helmetgarb/helmet_nvg/marsoc, -/turf/open/floor/corsat{ - icon_state = "plate" - }, -/area/lv522/oob) "fpW" = ( /obj/structure/pipes/standard/simple/hidden/green{ dir = 4 @@ -99528,7 +99522,7 @@ tiQ joK cPU daL -fpS +xcU dLz xcU edk