Skip to content

Commit

Permalink
Merge branch 'BeeStation:master' into master
Browse files Browse the repository at this point in the history
  • Loading branch information
XeonMations authored Sep 9, 2024
2 parents ea5fc30 + 83ab879 commit f48e14c
Show file tree
Hide file tree
Showing 16 changed files with 158 additions and 86 deletions.
10 changes: 5 additions & 5 deletions code/__DEFINES/construction.dm
Original file line number Diff line number Diff line change
Expand Up @@ -118,12 +118,12 @@
#define RCD_FURNISHING 6
#define RCD_LADDER 7

#define RCD_UPGRADE_FRAMES 0
#define RCD_UPGRADE_SIMPLE_CIRCUITS 1
#define RCD_UPGRADE_SILO_LINK 2
#define RCD_UPGRADE_FURNISHING 3
#define RCD_UPGRADE_FRAMES (1<<0)
#define RCD_UPGRADE_SIMPLE_CIRCUITS (1<<1)
#define RCD_UPGRADE_SILO_LINK (1<<2)
#define RCD_UPGRADE_FURNISHING (1<<3)

#define RPD_UPGRADE_UNWRENCH 0
#define RPD_UPGRADE_UNWRENCH (1<<0)

#define RCD_WINDOW_FULLTILE "full tile"
#define RCD_WINDOW_DIRECTIONAL "directional"
Expand Down
19 changes: 19 additions & 0 deletions code/__HELPERS/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -775,6 +775,25 @@ GLOBAL_DATUM_INIT(dview_mob, /mob/dview, new)
return TRUE
return FALSE

/// Special handler for cyborg naming to check if cyborg name preferences match a name that has already been used. Returns TRUE if preferences are good to use and FALSE if not.
/mob/proc/check_cyborg_name(client/C, obj/item/mmi/mmi)
var/name = C?.prefs?.read_character_preference(/datum/preference/name/cyborg)

//Name is original, add it to the list to prevent it from being used again and return TRUE
if(!(name in GLOB.cyborg_name_list))
GLOB.cyborg_name_list += name
mmi.original_name = name
return TRUE

//Name is not original, but is this the original user of the name? If so we still return TRUE but do not need to add it to the list
else if(name == mmi.original_name)
return TRUE

//This name has already been taken and this is not the original user, return FALSE
else
to_chat(C.mob, "<span class='warning'>Cyborg name already used this round by another character, your name has been randomized</span>")
return FALSE

/proc/view_or_range(distance = world.view , center = usr , type)
switch(type)
if("view")
Expand Down
2 changes: 1 addition & 1 deletion code/_globalvars/lists/mobs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ GLOBAL_LIST_EMPTY(mob_config_movespeed_type_lookup)

GLOBAL_LIST_EMPTY(emote_list)

GLOBAL_LIST_EMPTY(posi_key_list)
GLOBAL_LIST_EMPTY(cyborg_name_list)

GLOBAL_LIST_INIT(construct_radial_images, list(
CONSTRUCT_JUGGERNAUT = image(icon = 'icons/mob/cult.dmi', icon_state = "juggernaut"),
Expand Down
60 changes: 33 additions & 27 deletions code/game/objects/items/robot/robot_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -841,7 +841,7 @@
/**********************************************************************
Borg apparatus
***********************************************************************/
//These are tools that can hold only specific items. For example, the mediborg gets one that can only hold beakers and bottles.
//These are tools that can hold only specific items. For example, the mediborg and service borg get one that can only hold reagent containers

/obj/item/borg/apparatus/
name = "unknown storage apparatus"
Expand Down Expand Up @@ -923,33 +923,28 @@
return
. = ..()

/////////////////
//beaker holder//
/////////////////
////////////////////
//container holder//
////////////////////

/obj/item/borg/apparatus/beaker
name = "beaker storage apparatus"
desc = "A special apparatus for carrying beakers without spilling the contents."
/obj/item/borg/apparatus/container
name = "container storage apparatus"
desc = "A special apparatus for carrying containers without spilling the contents. It can also synthesize new beakers!"
icon_state = "borg_beaker_apparatus"
storable = list(/obj/item/reagent_containers/glass/beaker,
/obj/item/reagent_containers/glass/bottle)

/obj/item/borg/apparatus/beaker/Initialize(mapload)
. = ..()
stored = new /obj/item/reagent_containers/glass/beaker/large(src)
RegisterSignal(stored, COMSIG_ATOM_UPDATE_ICON, TYPE_PROC_REF(/atom, update_icon))
update_icon()
storable = list(/obj/item/reagent_containers/glass)
var/defaultcontainer = /obj/item/reagent_containers/glass/beaker

/obj/item/borg/apparatus/beaker/Destroy()
/obj/item/borg/apparatus/container/Destroy()
if(stored)
var/obj/item/reagent_containers/C = stored
C.SplashReagents(get_turf(src))
QDEL_NULL(stored)
. = ..()

/obj/item/borg/apparatus/beaker/examine()
/obj/item/borg/apparatus/container/examine()
. = ..()
if(stored)
//apparatus/container/service means this will not always be true.
if(istype(stored, /obj/item/reagent_containers/glass))
var/obj/item/reagent_containers/C = stored
. += "The apparatus currently has [C] secured, which contains:"
if(length(C.reagents.reagent_list))
Expand All @@ -959,7 +954,7 @@
. += "Nothing."
. += "<span class='notice'<i>Alt-click</i> will drop the currently stored [stored].</span>"

/obj/item/borg/apparatus/beaker/update_overlays()
/obj/item/borg/apparatus/container/update_overlays()
. = ..()
var/mutable_appearance/arm = mutable_appearance(icon = icon, icon_state = "borg_beaker_apparatus_arm")
if(stored)
Expand All @@ -976,17 +971,24 @@
arm.pixel_y = arm.pixel_y - 5
. += arm

/obj/item/borg/apparatus/beaker/attack_self(mob/living/silicon/robot/user)
/obj/item/borg/apparatus/container/attack_self(mob/living/silicon/robot/user)
if(!stored)
var/newcontainer = new defaultcontainer(src)
stored = newcontainer
to_chat(user, "<span class='notice'>You synthesize a new [newcontainer]!</span>")
playsound(src, 'sound/machines/click.ogg', 10, 1)
update_icon()
return
if(stored && !user.client?.keys_held["Alt"] && user.a_intent != "help")
var/obj/item/reagent_containers/C = stored
C.SplashReagents(get_turf(user))
loc.visible_message("<span class='notice'>[user] spills the contents of the [C] all over the floor.</span>")
return
. = ..()

/obj/item/borg/apparatus/beaker/extra
name = "secondary beaker storage apparatus"
desc = "A supplementary beaker storage apparatus."
/obj/item/borg/apparatus/container/extra
name = "container storage apparatus"
desc = "A supplementary container storage apparatus."

////////////////////
//engi part holder//
Expand Down Expand Up @@ -1033,10 +1035,11 @@
//versatile service holder//
////////////////////

/obj/item/borg/apparatus/beaker/service
/obj/item/borg/apparatus/container/service
name = "versatile service grasper"
desc = "Specially designed for carrying glasses, food and seeds."
desc = "Specially designed for carrying glasses, food and seeds. It can also synthesize glasses for drinks!"
storable = list(/obj/item/reagent_containers/food,
/obj/item/reagent_containers/glass,
/obj/item/seeds,
/obj/item/storage/fancy/donut_box,
/obj/item/storage/fancy/egg_box,
Expand All @@ -1046,10 +1049,13 @@
/obj/item/reagent_containers/glass/bottle,
/obj/item/reagent_containers/glass/bucket
)
defaultcontainer = /obj/item/reagent_containers/food/drinks/drinkingglass

/obj/item/borg/apparatus/beaker/service/examine()

/obj/item/borg/apparatus/container/service/examine()
. = ..()
if(stored)
//Parent type handles this type. All other objects held are handled here.
if(!istype(stored, /obj/item/reagent_containers/glass))
. += "You are currently holding [stored]."
. += "<span class='notice'<i>Alt-click</i> will drop the currently stored [stored].</span>"

Expand Down
9 changes: 4 additions & 5 deletions code/game/objects/items/robot/robot_upgrades.dm
Original file line number Diff line number Diff line change
Expand Up @@ -742,8 +742,8 @@
R.module.remove_module(C, TRUE)

/obj/item/borg/upgrade/beaker_app
name = "beaker storage apparatus"
desc = "A supplementary beaker storage apparatus for medical cyborgs."
name = "container storage apparatus"
desc = "A supplementary container storage apparatus for medical cyborgs."
icon_state = "cyborg_upgrade3"
require_module = TRUE
module_type = list(/obj/item/robot_module/medical)
Expand All @@ -752,7 +752,7 @@
/obj/item/borg/upgrade/beaker_app/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
var/obj/item/borg/apparatus/beaker/extra/E = locate() in R.module.modules
var/obj/item/borg/apparatus/container/extra/E = locate() in R.module.modules
if(E)
to_chat(user, "<span class='warning'>This unit has no room for additional beaker storage.</span>")
return FALSE
Expand All @@ -764,11 +764,10 @@
/obj/item/borg/upgrade/beaker_app/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
var/obj/item/borg/apparatus/beaker/extra/E = locate() in R.module.modules
var/obj/item/borg/apparatus/container/extra/E = locate() in R.module.modules
if (E)
R.module.remove_module(E, TRUE)


/obj/item/borg/upgrade/speciality
name = "Speciality Module"
icon_state = "cyborg_upgrade3"
Expand Down
4 changes: 4 additions & 0 deletions code/modules/antagonists/wizard/equipment/spellbook.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
var/limit //used to prevent a spellbook_entry from being bought more than X times with one wizard spellbook
var/list/no_coexistence_typecache //Used so you can't have specific spells together
var/no_random = FALSE // This is awful one to be a part of randomness - i.e.) soul tap
var/disabled = FALSE // Is this item disabled due to having issues? Must provide an issue reference and description of issue.

/datum/spellbook_entry/New()
..()
Expand All @@ -21,6 +22,8 @@
return TRUE

/datum/spellbook_entry/proc/CanBuy(mob/living/carbon/human/user,obj/item/spellbook/book) // Specific circumstances
if (disabled)
return FALSE
if(book.uses<cost || limit == 0)
return FALSE
for(var/spell in user.mind.spell_list)
Expand Down Expand Up @@ -397,6 +400,7 @@
It would be wise to avoid buying these with anything capable of causing you to swap bodies with others."
item_path = /obj/item/holoparasite_creator/wizard
category = "Assistance"
disabled = TRUE // #11096: Currently in a broken state, cannot recall as they will immediately manifest and cannot move despite having range stats.

/datum/spellbook_entry/item/bloodbottle
name = "Bottle of Blood"
Expand Down
2 changes: 1 addition & 1 deletion code/modules/jobs/job_types/_job.dm
Original file line number Diff line number Diff line change
Expand Up @@ -504,5 +504,5 @@
mmi.brainmob.real_name = organic_name //the name of the brain inside the cyborg is the robotized human's name.
mmi.brainmob.name = organic_name
// If this checks fails, then the name will have been handled during initialization.
if(player_client.prefs.read_character_preference(/datum/preference/name/cyborg) != DEFAULT_CYBORG_NAME)
if(player_client.prefs.read_character_preference(/datum/preference/name/cyborg) != DEFAULT_CYBORG_NAME && check_cyborg_name(player_client, mmi))
apply_pref_name(/datum/preference/name/cyborg, player_client)
2 changes: 2 additions & 0 deletions code/modules/mob/living/brain/MMI.dm
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,8 @@
var/datum/ai_laws/laws = new()
var/force_replace_ai_name = FALSE
var/overrides_aicore_laws = FALSE // Whether the laws on the MMI, if any, override possible pre-existing laws loaded on the AI core.
///Used to reserve an "original" cyborg name. When this mmi first becomes a cyborg, their name will be stored here in case of deconstruction.
var/original_name

/obj/item/mmi/Initialize(mapload)
. = ..()
Expand Down
7 changes: 1 addition & 6 deletions code/modules/mob/living/brain/posibrain.dm
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,6 @@ GLOBAL_VAR(posibrain_notify_cooldown)
return FALSE
if(is_occupied() || QDELETED(brainmob) || QDELETED(src) || QDELETED(user))
return FALSE
if(user.ckey in GLOB.posi_key_list)
to_chat(user, "<span class='warning'>Positronic brain spawns limited to 1 per round.</span>")
return FALSE
if(!(GLOB.ghost_role_flags & GHOSTROLE_SILICONS))
to_chat(user, "<span class='warning'>Central Command has temporarily outlawed posibrain sentience in this sector...</span>")
return FALSE
Expand All @@ -108,9 +105,7 @@ GLOBAL_VAR(posibrain_notify_cooldown)
return FALSE
if(brainmob.suiciding) //clear suicide status if the old occupant suicided.
brainmob.set_suicide(FALSE)
var/ckey = user.ckey
if(transfer_personality(user))
GLOB.posi_key_list += ckey
transfer_personality(user)

var/datum/job/posibrain/pj = SSjob.GetJob(JOB_NAME_POSIBRAIN)
pj.remove_posi_slot(src)
Expand Down
8 changes: 6 additions & 2 deletions code/modules/mob/living/silicon/robot/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -297,8 +297,12 @@
if(custom_name)
changed_name = custom_name
if(changed_name == "" && C && C.prefs.read_character_preference(/datum/preference/name/cyborg) != DEFAULT_CYBORG_NAME)
if(apply_pref_name(/datum/preference/name/cyborg, C))
return //built in camera handled in proc
if(check_cyborg_name(C, mmi))
if(apply_pref_name(/datum/preference/name/cyborg, C))
return //built in camera handled in proc
else
//Failed the vibe check on name theft, time to randomize it
changed_name = get_standard_name()
if(!changed_name)
changed_name = get_standard_name()

Expand Down
5 changes: 2 additions & 3 deletions code/modules/mob/living/silicon/robot/robot_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -271,7 +271,7 @@
/obj/item/borg/charger,
/obj/item/weldingtool/cyborg/mini,
/obj/item/reagent_containers/borghypo,
/obj/item/borg/apparatus/beaker,
/obj/item/borg/apparatus/container,
/obj/item/reagent_containers/dropper,
/obj/item/reagent_containers/syringe,
/obj/item/surgical_drapes,
Expand Down Expand Up @@ -508,7 +508,6 @@
name = "Service"
basic_modules = list(
/obj/item/assembly/flash/cyborg,
/obj/item/reagent_containers/food/drinks/drinkingglass,
/obj/item/pen,
/obj/item/toy/crayon/spraycan/borg,
/obj/item/extinguisher/mini,
Expand All @@ -521,7 +520,7 @@
/obj/item/instrument/piano_synth,
/obj/item/reagent_containers/dropper,
/obj/item/lighter,
/obj/item/borg/apparatus/beaker/service,
/obj/item/borg/apparatus/container/service,
/obj/item/reagent_containers/borghypo/borgshaker)
emag_modules = list(/obj/item/reagent_containers/borghypo/borgshaker/hacked)
ratvar_modules = list(
Expand Down
33 changes: 22 additions & 11 deletions code/modules/reagents/reagent_containers/borghydro.dm
Original file line number Diff line number Diff line change
Expand Up @@ -185,32 +185,43 @@ Borg Shaker
accepts_reagent_upgrades = FALSE

reagent_ids = list(
//Non-alcoholic
/datum/reagent/water,
/datum/reagent/consumable/coffee,
/datum/reagent/consumable/tea,
/datum/reagent/consumable/space_cola,
/datum/reagent/consumable/dr_gibb,
/datum/reagent/consumable/spacemountainwind,
/datum/reagent/consumable/space_up,
//Fruit Juice
/datum/reagent/consumable/banana,
/datum/reagent/consumable/lemonjuice,
/datum/reagent/consumable/limejuice,
/datum/reagent/consumable/orangejuice,
/datum/reagent/consumable/tomatojuice,
//Alcoholic
/datum/reagent/consumable/ethanol/absinthe,
/datum/reagent/consumable/ethanol/ale,
/datum/reagent/consumable/ethanol/beer,
/datum/reagent/consumable/ethanol/cognac,
/datum/reagent/consumable/ethanol/gin,
/datum/reagent/consumable/ethanol/kahlua,
/datum/reagent/consumable/ethanol/rum,
/datum/reagent/consumable/ethanol/sake,
/datum/reagent/consumable/ethanol/tequila,
/datum/reagent/consumable/ethanol/triple_sec,
/datum/reagent/consumable/ethanol/vermouth,
/datum/reagent/consumable/ethanol/vodka,
/datum/reagent/consumable/ethanol/whiskey,
/datum/reagent/consumable/ethanol/wine,
/datum/reagent/consumable/banana,
/datum/reagent/consumable/coffee,
/datum/reagent/consumable/cream,
/datum/reagent/consumable/grenadine,
//Other stuff for mixing
/datum/reagent/consumable/ice,
/datum/reagent/consumable/lemonjuice,
/datum/reagent/consumable/limejuice,
/datum/reagent/consumable/milk,
/datum/reagent/consumable/orangejuice,
/datum/reagent/consumable/sodawater,
/datum/reagent/consumable/space_cola,
/datum/reagent/consumable/tomatojuice,
/datum/reagent/consumable/tonic)
/datum/reagent/consumable/tonic,
/datum/reagent/consumable/grenadine,
/datum/reagent/consumable/cream,
/datum/reagent/consumable/milk,
/datum/reagent/consumable/sugar)

/obj/item/reagent_containers/borghypo/borgshaker/attack(mob/M, mob/user)
return //Can't inject stuff with a shaker, can we? //not with that attitude
Expand Down
Loading

0 comments on commit f48e14c

Please sign in to comment.