mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-12 00:27:31 +01:00
00ccf0c6b5
# Conflicts: # .github/CODEOWNERS # .github/workflows/compile_changelogs.yml # .github/workflows/stale.yml # SQL/database_changelog.md # _maps/map_files/CatwalkStation/CatwalkStation_2023.dmm # code/__DEFINES/atom_hud.dm # code/__DEFINES/inventory.dm # code/__DEFINES/mobs.dm # code/__DEFINES/species_clothing_paths.dm # code/__DEFINES/subsystems.dm # code/__DEFINES/surgery.dm # code/__HELPERS/global_lists.dm # code/_globalvars/lists/maintenance_loot.dm # code/_globalvars/traits/_traits.dm # code/controllers/subsystem/minor_mapping.dm # code/controllers/subsystem/processing/quirks.dm # code/controllers/subsystem/shuttle.dm # code/datums/components/palette.dm # code/datums/components/surgery_initiator.dm # code/datums/diseases/advance/advance.dm # code/datums/hud.dm # code/datums/mood.dm # code/datums/mutations/chameleon.dm # code/datums/quirks/negative_quirks/nyctophobia.dm # code/datums/status_effects/debuffs/debuffs.dm # code/datums/status_effects/debuffs/drunk.dm # code/datums/status_effects/debuffs/slime/slime_leech.dm # code/datums/weather/weather.dm # code/game/data_huds.dm # code/game/objects/items.dm # code/game/objects/items/devices/scanners/health_analyzer.dm # code/game/objects/items/frog_statue.dm # code/game/objects/items/rcd/RLD.dm # code/game/objects/items/robot/items/hypo.dm # code/game/objects/items/stacks/medical.dm # code/game/objects/items/stacks/wrap.dm # code/game/objects/items/storage/garment.dm # code/game/objects/items/tools/medical/defib.dm # code/game/objects/items/weaponry.dm # code/game/objects/items/weaponry/melee/misc.dm # code/game/objects/structures/crates_lockers/closets/secure/security.dm # code/game/objects/structures/curtains.dm # code/game/objects/structures/dresser.dm # code/game/objects/structures/girders.dm # code/game/objects/structures/maintenance.dm # code/game/objects/structures/mirror.dm # code/modules/admin/greyscale_modify_menu.dm # code/modules/admin/verbs/light_debug.dm # code/modules/antagonists/ashwalker/ashwalker.dm # code/modules/antagonists/heretic/knowledge/starting_lore.dm # code/modules/antagonists/ninja/ninjaDrainAct.dm # code/modules/art/paintings.dm # code/modules/client/preferences.dm # code/modules/client/verbs/ooc.dm # code/modules/clothing/head/wig.dm # code/modules/events/disease_outbreak.dm # code/modules/holodeck/holo_effect.dm # code/modules/jobs/job_types/head_of_security.dm # code/modules/jobs/job_types/security_officer.dm # code/modules/library/skill_learning/generic_skillchips/point.dm # code/modules/mining/lavaland/ash_flora.dm # code/modules/mining/lavaland/mining_loot/megafauna/ash_drake.dm # code/modules/mob/dead/new_player/new_player.dm # code/modules/mob/living/basic/guardian/guardian.dm # code/modules/mob/living/basic/space_fauna/space_dragon/space_dragon.dm # code/modules/mob/living/carbon/carbon.dm # code/modules/mob/living/carbon/human/human.dm # code/modules/mob/living/carbon/human/human_defines.dm # code/modules/mob/living/carbon/life.dm # code/modules/mob/living/living.dm # code/modules/mob/living/living_defines.dm # code/modules/mob/mob.dm # code/modules/mob_spawn/ghost_roles/mining_roles.dm # code/modules/mod/mod_control.dm # code/modules/mod/modules/modules_general.dm # code/modules/modular_computers/computers/item/computer_ui.dm # code/modules/paperwork/paper.dm # code/modules/paperwork/paperbin.dm # code/modules/power/lighting/light.dm # code/modules/projectiles/guns/energy/kinetic_accelerator.dm # code/modules/projectiles/projectile.dm # code/modules/reagents/chemistry/reagents/drinks/alcohol_reagents.dm # code/modules/reagents/chemistry/reagents/food_reagents.dm # code/modules/reagents/chemistry/reagents/other_reagents.dm # code/modules/reagents/chemistry/reagents/pyrotechnic_reagents.dm # code/modules/research/xenobiology/crossbreeding/_clothing.dm # code/modules/research/xenobiology/crossbreeding/prismatic.dm # code/modules/surgery/advanced/brainwashing.dm # code/modules/surgery/advanced/lobotomy.dm # code/modules/surgery/amputation.dm # code/modules/surgery/blood_filter.dm # code/modules/surgery/bodyparts/_bodyparts.dm # code/modules/surgery/brain_surgery.dm # code/modules/surgery/cavity_implant.dm # code/modules/surgery/coronary_bypass.dm # code/modules/surgery/gastrectomy.dm # code/modules/surgery/healing.dm # code/modules/surgery/limb_augmentation.dm # code/modules/surgery/organ_manipulation.dm # code/modules/surgery/revival.dm # code/modules/surgery/sleeper_protocol.dm # code/modules/surgery/surgery_helpers.dm # code/modules/surgery/surgery_step.dm # code/modules/unit_tests/_unit_tests.dm # code/modules/unit_tests/designs.dm # code/modules/unit_tests/icon_state_worn.dm # code/modules/unit_tests/screenshots/screenshot_antag_icons_cultist.png # code/modules/unit_tests/screenshots/screenshot_antag_icons_headrevolutionary.png # code/modules/unit_tests/screenshots/screenshot_antag_icons_provocateur.png # code/modules/unit_tests/screenshots/screenshot_husk_body.png # code/modules/unit_tests/screenshots/screenshot_husk_body_missing_limbs.png # icons/map_icons/clothing/head/_head.dmi # icons/map_icons/clothing/shoes.dmi # icons/map_icons/items/_item.dmi # icons/mob/huds/hud.dmi # icons/mob/inhands/64x64_lefthand.dmi # icons/mob/inhands/64x64_righthand.dmi # icons/obj/machines/computer.dmi # tgui/packages/tgui/interfaces/OperatingComputer.jsx # tgui/packages/tgui/interfaces/PreferencesMenu/CharacterPreferences/MainPage.tsx # tgui/packages/tgui/interfaces/PreferencesMenu/types.ts # tgui/packages/tgui/interfaces/SurgeryInitiator.tsx # tools/icon_cutter/check.py
165 lines
6.0 KiB
Plaintext
165 lines
6.0 KiB
Plaintext
/obj/item/implantpad//SKYRAT EDIT - ICON OVERRIDDEN BY AESTHETICS - SEE MODULE
|
|
name = "implant pad"
|
|
desc = "Used to modify implants."
|
|
icon = 'icons/obj/devices/tool.dmi'
|
|
icon_state = "implantpad-0"
|
|
base_icon_state = "implantpad"
|
|
inhand_icon_state = "electronic"
|
|
lefthand_file = 'icons/mob/inhands/items/devices_lefthand.dmi'
|
|
righthand_file = 'icons/mob/inhands/items/devices_righthand.dmi'
|
|
throw_speed = 3
|
|
throw_range = 5
|
|
w_class = WEIGHT_CLASS_SMALL
|
|
interaction_flags_click = FORBID_TELEKINESIS_REACH|ALLOW_RESTING
|
|
|
|
///The implant case currently inserted into the pad.
|
|
var/obj/item/implantcase/inserted_case
|
|
|
|
/// The deathrattle group currently saved to the implantpad.
|
|
var/datum/deathrattle_group/saved_deathrattle_group
|
|
|
|
/obj/item/implantpad/update_icon_state()
|
|
icon_state = "[base_icon_state]-[!isnull(inserted_case)]"
|
|
return ..()
|
|
|
|
/obj/item/implantpad/examine(mob/user)
|
|
. = ..()
|
|
if(!inserted_case)
|
|
. += span_info("It is currently empty.")
|
|
return
|
|
|
|
if(Adjacent(user))
|
|
. += span_info("It contains \a [inserted_case].")
|
|
else
|
|
. += span_warning("There seems to be something inside it, but you can't quite tell what from here...")
|
|
. += span_info("Alt-click to remove [inserted_case].")
|
|
|
|
/obj/item/implantpad/Exited(atom/movable/gone, direction)
|
|
. = ..()
|
|
if(gone == inserted_case)
|
|
inserted_case = null
|
|
update_appearance(UPDATE_ICON)
|
|
|
|
/obj/item/implantpad/attackby(obj/item/implantcase/attacking_item, mob/user, list/modifiers, list/attack_modifiers)
|
|
if(inserted_case || !istype(attacking_item))
|
|
return ..()
|
|
if(!user.transferItemToLoc(attacking_item, src))
|
|
return
|
|
user.balloon_alert(user, "case inserted")
|
|
inserted_case = attacking_item
|
|
update_static_data_for_all_viewers()
|
|
update_appearance(UPDATE_ICON)
|
|
|
|
/obj/item/implantpad/click_alt(mob/user)
|
|
remove_implant(user)
|
|
return CLICK_ACTION_SUCCESS
|
|
|
|
/obj/item/implantpad/ui_interact(mob/user, datum/tgui/ui)
|
|
ui = SStgui.try_update_ui(user, src, ui)
|
|
if (!ui)
|
|
ui = new(user, src, "ImplantPad", name)
|
|
ui.open()
|
|
|
|
/obj/item/implantpad/ui_data(mob/user)
|
|
var/list/data = list()
|
|
data["saved_deathrattle_group"] = saved_deathrattle_group ? saved_deathrattle_group.name : null
|
|
data["current_deathrattle_group"] = null
|
|
data["has_case"] = !!inserted_case
|
|
if(!inserted_case)
|
|
return data
|
|
data["has_implant"] = !!inserted_case.imp
|
|
if(inserted_case.imp)
|
|
data["case_information"] = inserted_case.imp.get_data()
|
|
data["case_lore"] = inserted_case.imp.get_lore()
|
|
if(istype(inserted_case.imp, /obj/item/implant/deathrattle))
|
|
var/obj/item/implant/deathrattle/inserted_deathrattle = inserted_case.imp
|
|
if(inserted_deathrattle.current_group)
|
|
data["current_deathrattle_group"] = inserted_deathrattle.current_group
|
|
return data
|
|
|
|
/obj/item/implantpad/ui_act(action, list/params, datum/tgui/ui, datum/ui_state/state)
|
|
. = ..()
|
|
var/mob/user = usr
|
|
if(action == "eject_implant")
|
|
remove_implant(user)
|
|
return
|
|
if(action == "save_deathrattle_group")
|
|
save_deathrattle_group(user)
|
|
if(action == "set_deathrattle_group")
|
|
set_deathrattle_group(user)
|
|
if(action == "init_deathrattle_group")
|
|
init_deathrattle_group(user)
|
|
|
|
///Removes the implant from the pad and puts it in the user's hands if possible.
|
|
/obj/item/implantpad/proc/remove_implant(mob/user)
|
|
if(!inserted_case)
|
|
user.balloon_alert(user, "no case inside!")
|
|
return FALSE
|
|
add_fingerprint(user)
|
|
inserted_case.add_fingerprint(user)
|
|
user.put_in_hands(inserted_case)
|
|
user.balloon_alert(user, "case removed")
|
|
update_appearance(UPDATE_ICON)
|
|
update_static_data_for_all_viewers()
|
|
return TRUE
|
|
|
|
/// Saves the currently inserted implant's deathrattle group.
|
|
/obj/item/implantpad/proc/save_deathrattle_group(mob/user)
|
|
if(!inserted_case)
|
|
user.balloon_alert(user, "no case inside!")
|
|
return FALSE
|
|
if(!istype(inserted_case.imp, /obj/item/implant/deathrattle))
|
|
user.balloon_alert(user, "incompatible implant!")
|
|
return FALSE
|
|
var/obj/item/implant/deathrattle/inserted_implant = inserted_case.imp
|
|
var/datum/deathrattle_group/current_group = inserted_implant.current_group
|
|
if(!current_group)
|
|
user.balloon_alert(user, "no active group!")
|
|
return FALSE
|
|
saved_deathrattle_group = current_group
|
|
user.balloon_alert(user, "saved group [current_group.name]")
|
|
update_static_data_for_all_viewers()
|
|
return TRUE
|
|
|
|
/// Sets the currently inserted implant's deathrattle group to saved.
|
|
/obj/item/implantpad/proc/set_deathrattle_group(mob/user)
|
|
if(!inserted_case)
|
|
user.balloon_alert(user, "no case inside!")
|
|
return FALSE
|
|
if(!saved_deathrattle_group)
|
|
user.balloon_alert(user, "no saved deathrattle group!")
|
|
return FALSE
|
|
if(!istype(inserted_case.imp, /obj/item/implant/deathrattle))
|
|
user.balloon_alert(user, "incompatible implant!")
|
|
return FALSE
|
|
var/obj/item/implant/deathrattle/inserted_implant = inserted_case.imp
|
|
if(!istype(saved_deathrattle_group, inserted_implant.deathrattle_group_type))
|
|
user.balloon_alert(user, "incompatible deathrattle group!")
|
|
return FALSE
|
|
saved_deathrattle_group.register(inserted_implant)
|
|
user.balloon_alert(user, "registered to group [saved_deathrattle_group.name]")
|
|
inserted_case.name = "[initial(inserted_case.name)] - [saved_deathrattle_group.name]"
|
|
update_static_data_for_all_viewers()
|
|
return TRUE
|
|
|
|
/// Initializes and saves a new deathrattle group, then registers the current implant to it.
|
|
/obj/item/implantpad/proc/init_deathrattle_group(mob/user)
|
|
if(!inserted_case)
|
|
user.balloon_alert(user, "no case inside!")
|
|
return FALSE
|
|
if(!istype(inserted_case.imp, /obj/item/implant/deathrattle))
|
|
user.balloon_alert(user, "incompatible implant!")
|
|
return FALSE
|
|
var/obj/item/implant/deathrattle/inserted_implant = inserted_case.imp
|
|
if(inserted_implant.current_group)
|
|
user.balloon_alert(user, "group already set!")
|
|
return FALSE
|
|
// init and save new group
|
|
saved_deathrattle_group = new inserted_implant.deathrattle_group_type
|
|
// register current implant
|
|
saved_deathrattle_group.register(inserted_implant)
|
|
user.balloon_alert(user, "registered to new group [saved_deathrattle_group.name]")
|
|
inserted_case.name += " - [saved_deathrattle_group.name]"
|
|
update_static_data_for_all_viewers()
|
|
return TRUE
|