Skip to content

Commit

Permalink
Merge branch 'maps-closet-standardisation' of https://github.com/Flit…
Browse files Browse the repository at this point in the history
…chTime/ParadiseForked into maps-closet-standardisation
  • Loading branch information
FlitchTime committed Jan 31, 2025
2 parents 32bd28e + 0aadff6 commit 2cf7176
Show file tree
Hide file tree
Showing 46 changed files with 7,023 additions and 6,746 deletions.
7,159 changes: 3,584 additions & 3,575 deletions _maps/map_files/Delta/delta.dmm

Large diffs are not rendered by default.

5,278 changes: 2,629 additions & 2,649 deletions _maps/map_files/event/Station/delta_old.dmm

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions code/__DEFINES/alerts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
#define ALERT_EMBEDDED "embedded"
#define ALERT_NUTRITION "nutrition"
#define ALERT_DIRECTION_LOCK "direction_lock"
#define ALERT_UNPOSSESS_OBJECT "unpossess_object"

/** Silicon related */
#define ALERT_LOCKED "locked"
Expand Down
8 changes: 8 additions & 0 deletions code/__DEFINES/dcs/signals.dm
Original file line number Diff line number Diff line change
Expand Up @@ -684,6 +684,11 @@
/// From base of /client/Move(): (direction, old_dir)
#define COMSIG_MOB_CLIENT_MOVED "mob_client_moved"

/// From base of /client/Move(), invoked when a non-living mob is attempting to move: (list/move_args)
#define COMSIG_MOB_CLIENT_PRE_NON_LIVING_MOVE "mob_client_pre_non_living_move"
/// Cancels the move attempt
#define COMSIG_MOB_CLIENT_BLOCK_PRE_NON_LIVING_MOVE COMPONENT_MOVABLE_BLOCK_PRE_MOVE

/// From base of /client/Move(): (list/move_args)
#define COMSIG_MOB_CLIENT_PRE_LIVING_MOVE "mob_client_pre_living_move"
/// Should we stop the current living movement attempt
Expand Down Expand Up @@ -1285,3 +1290,6 @@

/// Source: /proc/random_hair_style (mob/living/carbon/human/human, valid_hairstyles, robohead)
#define COMSIG_RANDOM_HAIR_STYLE "random_hair_style"

/// Source: /datum/component/object_possession/proc/on_move (mob/mob, new_loc, direct)
#define COMSIG_POSSESSED_MOVEMENT "possessed_movement"
2 changes: 2 additions & 0 deletions code/__DEFINES/is_helpers.dm
Original file line number Diff line number Diff line change
Expand Up @@ -143,6 +143,8 @@ GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list(

#define ischasm(A) (istype(A, /turf/simulated/floor/chasm))

#define issingularity(atom) (istype(atom, /obj/singularity))

//Structures
#define isstructure(A) (istype(A, /obj/structure))

Expand Down
21 changes: 19 additions & 2 deletions code/_onclick/hud/alert.dm
Original file line number Diff line number Diff line change
Expand Up @@ -872,14 +872,18 @@ so as to remain in compliance with the most up-to-date laws."

/atom/movable/screen/alert/Click(location, control, params)
if(!usr || !usr.client)
return
return FALSE

var/paramslist = params2list(params)
if(paramslist["shift"]) // screen objects don't do the normal Click() stuff so we'll cheat
to_chat(usr, "<span class='boldnotice'>[name]</span> - <span class='info'>[desc]</span>")
return
return FALSE

if(master)
return usr.client.Click(master, location, control, params)

return TRUE

/atom/movable/screen/alert/Destroy()
severity = 0
master = null
Expand All @@ -899,3 +903,16 @@ so as to remain in compliance with the most up-to-date laws."
if(!istype(usr))
return
living_owner.do_succumb(TRUE)

/atom/movable/screen/alert/unpossess_object
name = "Unpossess"
desc = "Этот объект под вашим контролем. Нажмите сюда для прекращения контроля."
icon_state = "buckled"

/atom/movable/screen/alert/unpossess_object/Click(location, control, params)
. = ..()

if(!.)
return

qdel(usr.GetComponent(/datum/component/object_possession))
130 changes: 130 additions & 0 deletions code/datums/components/object_possession.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,130 @@
/// Component that allows a user to control any object as if it were a mob. Does give the user incorporeal movement.
/datum/component/object_possession
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
/// Stores a reference to the obj that we are currently possessing.
var/obj/possessed
/// Ref to the screen object that is currently being displayed.
var/datum/weakref/screen_alert_ref
/**
* back up of the real name during user possession
*
* When a user possesses an object it's real name is set to the user name and this
* stores whatever the real name was previously. When possession ends, the real name
* is reset to this value
*/
var/stashed_name

/datum/component/object_possession/Initialize(obj/target)
. = ..()
if(!isobj(target) || !ismob(parent))
return COMPONENT_INCOMPATIBLE

if(!bind_to_new_object(target))
return COMPONENT_INCOMPATIBLE

var/mob/user = parent
screen_alert_ref = WEAKREF(user.throw_alert(ALERT_UNPOSSESS_OBJECT, /atom/movable/screen/alert/unpossess_object))

/datum/component/object_possession/RegisterWithParent()
RegisterSignals(parent, list(COMSIG_MOB_CLIENT_PRE_LIVING_MOVE, COMSIG_MOB_CLIENT_PRE_NON_LIVING_MOVE), PROC_REF(on_move))
RegisterSignal(parent, COMSIG_MOB_GHOSTIZE, PROC_REF(end_possession))

/datum/component/object_possession/UnregisterFromParent()
UnregisterSignal(parent, list(
COMSIG_MOB_CLIENT_PRE_LIVING_MOVE,
COMSIG_MOB_CLIENT_PRE_NON_LIVING_MOVE,
COMSIG_MOB_GHOSTIZE,
))

/datum/component/object_possession/Destroy()
cleanup_object_binding()

var/mob/user = parent
var/atom/movable/screen/alert/alert_to_clear = screen_alert_ref?.resolve()

if(!QDELETED(alert_to_clear))
user.clear_alert(ALERT_UNPOSSESS_OBJECT)

return ..()

/datum/component/object_possession/InheritComponent(datum/component/object_possession/old_component, i_am_original, obj/target)
cleanup_object_binding()

if(!bind_to_new_object(target))
qdel(src)

stashed_name = old_component?.stashed_name

/// Binds the mob to the object and sets up the naming and everything.
/// Returns FALSE if we don't bind, TRUE if we succeed.
/datum/component/object_possession/proc/bind_to_new_object(obj/target)
if(issingularity(target) && CONFIG_GET(flag/forbid_singulo_possession))
to_chat(parent, "[target] сопротивляется вашему контролю.", confidential = TRUE)
return FALSE

var/mob/user = parent

stashed_name = user.real_name
possessed = target

user.forceMove(target)
user.real_name = target.name
user.name = target.name
user.reset_perspective(target)

RegisterSignal(target, COMSIG_QDELETING, PROC_REF(end_possession))
SEND_SIGNAL(target, COMSIG_OBJ_POSSESSED, parent)

return TRUE

/// Cleans up everything pertinent to the current possessed object.
/datum/component/object_possession/proc/cleanup_object_binding()
if(QDELETED(possessed))
return

var/mob/poltergeist = parent

UnregisterSignal(possessed, COMSIG_QDELETING)

if(!isnull(stashed_name))
poltergeist.real_name = stashed_name
poltergeist.name = stashed_name

if(ishuman(poltergeist))
var/mob/living/carbon/human/human_user = poltergeist
human_user.name = human_user.get_visible_name()

poltergeist.forceMove(get_turf(possessed))
poltergeist.reset_perspective()

possessed = null

/**
* force move the parent object instead of the source mob.
*
* Has no sanity other than checking the possed obj's density. this means it effectively has incorporeal movement, making it only good for badminnery.
*
* We always want to return `COMPONENT_MOVABLE_BLOCK_PRE_MOVE` here regardless
*/
/datum/component/object_possession/proc/on_move(datum/source, new_loc, direct)
SIGNAL_HANDLER

. = COMPONENT_MOVABLE_BLOCK_PRE_MOVE // both signals that invoke this are explicitly tied to listen for this define as the return value

if(!possessed.density)
possessed.forceMove(get_step(possessed, direct))

else
step(possessed, direct)

possessed.setDir(direct)
SEND_SIGNAL(possessed, COMSIG_POSSESSED_MOVEMENT, source, new_loc, direct)

return

/// Just the overall "get me outta here" proc.
/datum/component/object_possession/proc/end_possession(datum/source)
SIGNAL_HANDLER

SEND_SIGNAL(possessed, COMSIG_OBJ_RELEASED, parent)
qdel(src)
2 changes: 1 addition & 1 deletion code/datums/datacore.dm
Original file line number Diff line number Diff line change
Expand Up @@ -154,7 +154,7 @@ GLOBAL_VAR_INIT(record_id_num, 1001)
G.fields["rank"] = assignment
G.fields["age"] = H.age
G.fields["fingerprint"] = md5(H.dna.uni_identity)
G.fields["p_stat"] = "Стабильное"
G.fields["p_stat"] = "Активный"
G.fields["m_stat"] = "Стабильное"
G.fields["sex"] = capitalize(H.gender)
G.fields["species"] = H.dna.species.name
Expand Down
56 changes: 28 additions & 28 deletions code/game/machinery/vending.dm
Original file line number Diff line number Diff line change
Expand Up @@ -221,11 +221,11 @@
/obj/machinery/vending/examine(mob/user)
. = ..()
if(tilted)
. += span_warning("Он лежит на боку и не будет функционировать до тех пор, пока его не поправят.")
. += span_warning("Он лежит на боку и не будет функционировать до тех пор, пока его не поднимут.")
if(Adjacent(user))
. += span_notice("Нажмите <b>Alt-Click</b> чтобы поднять автомат.")
. += span_notice("Используйте <b>Alt+ЛКМ</b>, чтобы поднять автомат.")
if(aggressive)
. += span_warning("Его индикаторы, кажется, зловеще мигают...")
. += span_warning("Его индикаторы зловеще мигают...")

/obj/machinery/vending/AltClick(mob/user)
if(!tilted || !Adjacent(user) || HAS_TRAIT(user, TRAIT_HANDS_BLOCKED))
Expand Down Expand Up @@ -745,7 +745,7 @@
var/estimated_height = 100 + min(length(product_records) * 34, 500)
if(length(prices) > 0)
estimated_height += 100 // to account for the "current user" interface
ui = new(user, src, "Vending", name)
ui = new(user, src, "Vending", capitalize(declent_ru(NOMINATIVE)))
ui.open()

/obj/machinery/vending/ui_data(mob/user)
Expand All @@ -766,7 +766,7 @@
var/obj/item/stack/spacecash/S = H.get_active_hand()
if(istype(S))
data["userMoney"] = S.amount
data["guestNotice"] = "Принимаем наличные. У вас есть: [S.amount] кредитов."
data["guestNotice"] = "Принимаем наличные. У вас есть: [S.amount] кредит[pluralize_ru(S.amount, "", "а", "ов")]."
else if(istype(H))
var/obj/item/card/id/C = H.get_id_card()
if(istype(A))
Expand All @@ -781,11 +781,11 @@
data["stock"][R.name] = R.amount
data["extended_inventory"] = extended_inventory
data["vend_ready"] = vend_ready
data["coin_name"] = coin ? coin.name : FALSE
data["coin_name"] = coin ? coin.declent_ru(NOMINATIVE) : FALSE
data["panel_open"] = panel_open ? TRUE : FALSE
data["speaker"] = shut_up ? FALSE : TRUE
data["item_slot"] = item_slot // boolean
data["inserted_item_name"] = inserted_item ? inserted_item.name : FALSE
data["inserted_item_name"] = inserted_item ? inserted_item.declent_ru(NOMINATIVE) : FALSE
return data


Expand All @@ -795,13 +795,13 @@
data["product_records"] = list()
var/i = 1
for (var/datum/data/vending_product/R in product_records)
var/obj/item = R.product_path
var/obj/item/newitem = new R.product_path(src)
var/list/data_pr = list(
path = replacetext(replacetext("[R.product_path]", "/obj/item/", ""), "/", "-"),
name = R.name,
price = (item in prices) ? prices[item] : 0,
icon = item.icon,
icon_state = item.icon_state,
name = capitalize(newitem.declent_ru(NOMINATIVE)),
price = (newitem in prices) ? prices[newitem] : 0,
icon = newitem.icon,
icon_state = newitem.icon_state,
max_amount = R.max_amount,
req_coin = FALSE,
is_hidden = FALSE,
Expand All @@ -811,13 +811,13 @@
i++
data["coin_records"] = list()
for (var/datum/data/vending_product/R in coin_records)
var/obj/item = R.product_path
var/obj/item/newitem = new R.product_path(src)
var/list/data_cr = list(
path = replacetext(replacetext("[R.product_path]", "/obj/item/", ""), "/", "-"),
name = R.name,
price = (item in prices) ? prices[item] : 0,
icon = item.icon,
icon_state = item.icon_state,
name = capitalize(newitem.declent_ru(NOMINATIVE)),
price = (newitem in prices) ? prices[newitem] : 0,
icon = newitem.icon,
icon_state = newitem.icon_state,
max_amount = R.max_amount,
req_coin = TRUE,
is_hidden = FALSE,
Expand All @@ -828,13 +828,13 @@
i++
data["hidden_records"] = list()
for (var/datum/data/vending_product/R in hidden_records)
var/obj/item = R.product_path
var/obj/item/newitem = new R.product_path(src)
var/list/data_hr = list(
path = replacetext(replacetext("[R.product_path]", "/obj/item/", ""), "/", "-"),
name = R.name,
price = (item in prices) ? prices[item] : 0,
icon = item.icon,
icon_state = item.icon_state,
name = capitalize(newitem.declent_ru(NOMINATIVE)),
price = (newitem in prices) ? prices[newitem] : 0,
icon = newitem.icon,
icon_state = newitem.icon_state,
max_amount = R.max_amount,
req_coin = FALSE,
is_hidden = TRUE,
Expand Down Expand Up @@ -868,7 +868,7 @@
if(issilicon(usr))
balloon_alert(usr, "у вас нет рук!")
return
to_chat(usr, span_notice("Вы достали [coin] из [declent_ru(GENITIVE)]."))
to_chat(usr, span_notice("Вы достали [coin.declent_ru(ACCUSATIVE)] из [declent_ru(GENITIVE)]."))
coin.forceMove_turf()
usr.put_in_hands(coin, ignore_anim = FALSE)
coin = null
Expand Down Expand Up @@ -907,7 +907,7 @@
message_admins("Vending machine exploit attempted by [ADMIN_LOOKUPFLW(usr)]!")
return
if (R.amount <= 0)
to_chat(usr, "Sold out of [R.name].")
to_chat(usr, "Товар \"[R.name]\" закончился!")
flick_vendor_overlay(FLICK_VEND)
return

Expand Down Expand Up @@ -953,7 +953,7 @@
vend(currently_vending, usr)
. = TRUE
else
to_chat(usr, span_warning("Сбой платежа: не удается обработать платеж."))
to_chat(usr, span_warning("Сбой платежа: не удаётся обработать платеж."))
vend_ready = TRUE
if(.)
add_fingerprint(usr)
Expand Down Expand Up @@ -982,9 +982,9 @@
return
if(coin.string_attached)
if(prob(50))
to_chat(user, span_notice("Вы успешно вытаскиваете монету до того, как [declent_ru(NOMINATIVE)] успевает ее проглотить."))
to_chat(user, span_warning("Вы успешно вытаскиваете монету до того, как [declent_ru(NOMINATIVE)] успевает ее проглотить!"))
else
to_chat(user, span_notice("Вы не смогли вытащить монету достаточно быстро, [declent_ru(NOMINATIVE)] съел ее вместе с ниткой и всем остальным."))
to_chat(user, span_warning("Вы не смогли вытащить монету достаточно быстро, [declent_ru(NOMINATIVE)] съел её вместе с ниткой и всем остальным!"))
QDEL_NULL(coin)
else
QDEL_NULL(coin)
Expand Down Expand Up @@ -1115,7 +1115,7 @@
if(!throw_item)
return
throw_item.throw_at(target, 16, 3)
visible_message(span_danger("[capitalize(declent_ru(NOMINATIVE))] метнул [throw_item.name] в [target.name]!"))
visible_message(span_danger("[capitalize(declent_ru(NOMINATIVE))] метнул [throw_item.declent_ru(ACCUSATIVE)] в [target]!"))


/obj/machinery/vending/shove_impact(mob/living/target, mob/living/attacker)
Expand Down
Loading

0 comments on commit 2cf7176

Please sign in to comment.