Skip to content

Commit 809f976

Browse files
Merge branch 'master220' into reagents_perevod
2 parents c1a071d + 0aadff6 commit 809f976

File tree

29 files changed

+1152
-881
lines changed

29 files changed

+1152
-881
lines changed

_maps/map_files/Delta/delta.dmm

Lines changed: 308 additions & 299 deletions
Large diffs are not rendered by default.

_maps/map_files/event/Station/delta_old.dmm

Lines changed: 92 additions & 112 deletions
Large diffs are not rendered by default.

code/__DEFINES/alerts.dm

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -26,6 +26,7 @@
2626
#define ALERT_EMBEDDED "embedded"
2727
#define ALERT_NUTRITION "nutrition"
2828
#define ALERT_DIRECTION_LOCK "direction_lock"
29+
#define ALERT_UNPOSSESS_OBJECT "unpossess_object"
2930

3031
/** Silicon related */
3132
#define ALERT_LOCKED "locked"

code/__DEFINES/dcs/signals.dm

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -684,6 +684,11 @@
684684
/// From base of /client/Move(): (direction, old_dir)
685685
#define COMSIG_MOB_CLIENT_MOVED "mob_client_moved"
686686

687+
/// From base of /client/Move(), invoked when a non-living mob is attempting to move: (list/move_args)
688+
#define COMSIG_MOB_CLIENT_PRE_NON_LIVING_MOVE "mob_client_pre_non_living_move"
689+
/// Cancels the move attempt
690+
#define COMSIG_MOB_CLIENT_BLOCK_PRE_NON_LIVING_MOVE COMPONENT_MOVABLE_BLOCK_PRE_MOVE
691+
687692
/// From base of /client/Move(): (list/move_args)
688693
#define COMSIG_MOB_CLIENT_PRE_LIVING_MOVE "mob_client_pre_living_move"
689694
/// Should we stop the current living movement attempt
@@ -1285,3 +1290,6 @@
12851290

12861291
/// Source: /proc/random_hair_style (mob/living/carbon/human/human, valid_hairstyles, robohead)
12871292
#define COMSIG_RANDOM_HAIR_STYLE "random_hair_style"
1293+
1294+
/// Source: /datum/component/object_possession/proc/on_move (mob/mob, new_loc, direct)
1295+
#define COMSIG_POSSESSED_MOVEMENT "possessed_movement"

code/__DEFINES/is_helpers.dm

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,8 @@ GLOBAL_LIST_INIT(glass_sheet_types, typecacheof(list(
143143

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

146+
#define issingularity(atom) (istype(atom, /obj/singularity))
147+
146148
//Structures
147149
#define isstructure(A) (istype(A, /obj/structure))
148150

code/_onclick/hud/alert.dm

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,14 +872,18 @@ so as to remain in compliance with the most up-to-date laws."
872872

873873
/atom/movable/screen/alert/Click(location, control, params)
874874
if(!usr || !usr.client)
875-
return
875+
return FALSE
876+
876877
var/paramslist = params2list(params)
877878
if(paramslist["shift"]) // screen objects don't do the normal Click() stuff so we'll cheat
878879
to_chat(usr, "<span class='boldnotice'>[name]</span> - <span class='info'>[desc]</span>")
879-
return
880+
return FALSE
881+
880882
if(master)
881883
return usr.client.Click(master, location, control, params)
882884

885+
return TRUE
886+
883887
/atom/movable/screen/alert/Destroy()
884888
severity = 0
885889
master = null
@@ -899,3 +903,16 @@ so as to remain in compliance with the most up-to-date laws."
899903
if(!istype(usr))
900904
return
901905
living_owner.do_succumb(TRUE)
906+
907+
/atom/movable/screen/alert/unpossess_object
908+
name = "Unpossess"
909+
desc = "Этот объект под вашим контролем. Нажмите сюда для прекращения контроля."
910+
icon_state = "buckled"
911+
912+
/atom/movable/screen/alert/unpossess_object/Click(location, control, params)
913+
. = ..()
914+
915+
if(!.)
916+
return
917+
918+
qdel(usr.GetComponent(/datum/component/object_possession))
Lines changed: 130 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,130 @@
1+
/// Component that allows a user to control any object as if it were a mob. Does give the user incorporeal movement.
2+
/datum/component/object_possession
3+
dupe_mode = COMPONENT_DUPE_UNIQUE_PASSARGS
4+
/// Stores a reference to the obj that we are currently possessing.
5+
var/obj/possessed
6+
/// Ref to the screen object that is currently being displayed.
7+
var/datum/weakref/screen_alert_ref
8+
/**
9+
* back up of the real name during user possession
10+
*
11+
* When a user possesses an object it's real name is set to the user name and this
12+
* stores whatever the real name was previously. When possession ends, the real name
13+
* is reset to this value
14+
*/
15+
var/stashed_name
16+
17+
/datum/component/object_possession/Initialize(obj/target)
18+
. = ..()
19+
if(!isobj(target) || !ismob(parent))
20+
return COMPONENT_INCOMPATIBLE
21+
22+
if(!bind_to_new_object(target))
23+
return COMPONENT_INCOMPATIBLE
24+
25+
var/mob/user = parent
26+
screen_alert_ref = WEAKREF(user.throw_alert(ALERT_UNPOSSESS_OBJECT, /atom/movable/screen/alert/unpossess_object))
27+
28+
/datum/component/object_possession/RegisterWithParent()
29+
RegisterSignals(parent, list(COMSIG_MOB_CLIENT_PRE_LIVING_MOVE, COMSIG_MOB_CLIENT_PRE_NON_LIVING_MOVE), PROC_REF(on_move))
30+
RegisterSignal(parent, COMSIG_MOB_GHOSTIZE, PROC_REF(end_possession))
31+
32+
/datum/component/object_possession/UnregisterFromParent()
33+
UnregisterSignal(parent, list(
34+
COMSIG_MOB_CLIENT_PRE_LIVING_MOVE,
35+
COMSIG_MOB_CLIENT_PRE_NON_LIVING_MOVE,
36+
COMSIG_MOB_GHOSTIZE,
37+
))
38+
39+
/datum/component/object_possession/Destroy()
40+
cleanup_object_binding()
41+
42+
var/mob/user = parent
43+
var/atom/movable/screen/alert/alert_to_clear = screen_alert_ref?.resolve()
44+
45+
if(!QDELETED(alert_to_clear))
46+
user.clear_alert(ALERT_UNPOSSESS_OBJECT)
47+
48+
return ..()
49+
50+
/datum/component/object_possession/InheritComponent(datum/component/object_possession/old_component, i_am_original, obj/target)
51+
cleanup_object_binding()
52+
53+
if(!bind_to_new_object(target))
54+
qdel(src)
55+
56+
stashed_name = old_component?.stashed_name
57+
58+
/// Binds the mob to the object and sets up the naming and everything.
59+
/// Returns FALSE if we don't bind, TRUE if we succeed.
60+
/datum/component/object_possession/proc/bind_to_new_object(obj/target)
61+
if(issingularity(target) && CONFIG_GET(flag/forbid_singulo_possession))
62+
to_chat(parent, "[target] сопротивляется вашему контролю.", confidential = TRUE)
63+
return FALSE
64+
65+
var/mob/user = parent
66+
67+
stashed_name = user.real_name
68+
possessed = target
69+
70+
user.forceMove(target)
71+
user.real_name = target.name
72+
user.name = target.name
73+
user.reset_perspective(target)
74+
75+
RegisterSignal(target, COMSIG_QDELETING, PROC_REF(end_possession))
76+
SEND_SIGNAL(target, COMSIG_OBJ_POSSESSED, parent)
77+
78+
return TRUE
79+
80+
/// Cleans up everything pertinent to the current possessed object.
81+
/datum/component/object_possession/proc/cleanup_object_binding()
82+
if(QDELETED(possessed))
83+
return
84+
85+
var/mob/poltergeist = parent
86+
87+
UnregisterSignal(possessed, COMSIG_QDELETING)
88+
89+
if(!isnull(stashed_name))
90+
poltergeist.real_name = stashed_name
91+
poltergeist.name = stashed_name
92+
93+
if(ishuman(poltergeist))
94+
var/mob/living/carbon/human/human_user = poltergeist
95+
human_user.name = human_user.get_visible_name()
96+
97+
poltergeist.forceMove(get_turf(possessed))
98+
poltergeist.reset_perspective()
99+
100+
possessed = null
101+
102+
/**
103+
* force move the parent object instead of the source mob.
104+
*
105+
* Has no sanity other than checking the possed obj's density. this means it effectively has incorporeal movement, making it only good for badminnery.
106+
*
107+
* We always want to return `COMPONENT_MOVABLE_BLOCK_PRE_MOVE` here regardless
108+
*/
109+
/datum/component/object_possession/proc/on_move(datum/source, new_loc, direct)
110+
SIGNAL_HANDLER
111+
112+
. = COMPONENT_MOVABLE_BLOCK_PRE_MOVE // both signals that invoke this are explicitly tied to listen for this define as the return value
113+
114+
if(!possessed.density)
115+
possessed.forceMove(get_step(possessed, direct))
116+
117+
else
118+
step(possessed, direct)
119+
120+
possessed.setDir(direct)
121+
SEND_SIGNAL(possessed, COMSIG_POSSESSED_MOVEMENT, source, new_loc, direct)
122+
123+
return
124+
125+
/// Just the overall "get me outta here" proc.
126+
/datum/component/object_possession/proc/end_possession(datum/source)
127+
SIGNAL_HANDLER
128+
129+
SEND_SIGNAL(possessed, COMSIG_OBJ_RELEASED, parent)
130+
qdel(src)

code/datums/datacore.dm

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -154,7 +154,7 @@ GLOBAL_VAR_INIT(record_id_num, 1001)
154154
G.fields["rank"] = assignment
155155
G.fields["age"] = H.age
156156
G.fields["fingerprint"] = md5(H.dna.uni_identity)
157-
G.fields["p_stat"] = "Стабильное"
157+
G.fields["p_stat"] = "Активный"
158158
G.fields["m_stat"] = "Стабильное"
159159
G.fields["sex"] = capitalize(H.gender)
160160
G.fields["species"] = H.dna.species.name

code/game/objects/items/weapons/alien_specific.dm

Lines changed: 13 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -31,44 +31,41 @@
3131
icon_state = "borg-spray-smoke"
3232

3333
/obj/item/reagent_containers/spray/alien/smoke/afterattack(atom/A, mob/user, proximity, params)
34-
if(istype(A, /obj/structure/reagent_dispensers) && get_dist(src,A) <= 1)
35-
if(!A.reagents.total_volume && A.reagents)
36-
to_chat(user, "<span class='notice'>\The [A] is empty.</span>")
37-
return
38-
39-
if(reagents.total_volume >= reagents.maximum_volume)
40-
to_chat(user, "<span class='notice'>\The [src] is full.</span>")
41-
return
42-
reagents.remove_reagent(reagents.get_master_reagent_id(),25)
4334
var/datum/effect_system/smoke_spread/bad/smoke = new
4435
smoke.set_up(5, 0, user.loc)
4536
smoke.start()
4637
playsound(user.loc, 'sound/effects/bamf.ogg', 50, 2)
38+
user.changeNext_move(delay)
39+
40+
var/mob/living/silicon/robot/Robot = user
41+
Robot.cell.use(250) // take energy from borg
4742

4843
/obj/item/reagent_containers/spray/alien/acid
4944
name = "acid synthesizer"
5045
desc = "squirts burny liquids."
5146
icon = 'icons/mob/alien.dmi'
5247
icon_state = "borg-spray-acid"
48+
list_reagents = list("facid" = 125, "sacid" = 125)
5349

5450
/obj/item/reagent_containers/spray/alien/stun
5551
name = "paralytic toxin synthesizer"
5652
desc = "squirts viagra."
5753
icon = 'icons/mob/alien.dmi'
5854
icon_state = "borg-spray-stun"
59-
volume = 80
6055

6156
/obj/item/reagent_containers/spray/alien/stun/afterattack(atom/A, mob/user, proximity, params)
62-
reagents.remove_reagent(reagents.get_master_reagent_id(),25)
63-
var/location = get_turf(user)
6457
var/datum/reagents/reagents_list = new (250)
65-
reagents_list.add_reagent("cryogenic_liquid", 245)
58+
reagents_list.add_reagent("blob_cryogenic_poison", 250) // new blow reagent because old was deleted
59+
6660
var/datum/effect_system/smoke_spread/chem/smoke = new
67-
smoke.set_up(reagents_list, location)
61+
smoke.set_up(reagents_list, user.loc)
6862
smoke.start(3)
69-
playsound(location, 'sound/effects/smoke.ogg', 50, 1, -3)
63+
playsound(user.loc, 'sound/effects/smoke.ogg', 50, 1, -3)
64+
user.changeNext_move(delay)
65+
66+
var/mob/living/silicon/robot/Robot = user
67+
Robot.cell.use(250) // take energy from borg
7068

71-
//SKREEEEEEEEEEEE tool
7269

7370
/obj/item/flash/cyborg/alien
7471
name = "eye flash"

code/game/objects/objs.dm

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -335,15 +335,3 @@
335335
C.Weaken(3 SECONDS)
336336

337337
#undef CARBON_DAMAGE_FROM_OBJECTS_MODIFIER
338-
339-
340-
/// Relay movement for when user controls object via [/proc/possess()]
341-
/obj/proc/possessed_relay_move(mob/user, direction)
342-
var/turf/new_turf = get_step(src, direction)
343-
if(!new_turf)
344-
return null
345-
if(density)
346-
. = Move(new_turf, direction)
347-
else
348-
. = forceMove(new_turf)
349-

code/modules/admin/admin_verbs.dm

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1000,15 +1000,16 @@ GLOBAL_LIST_INIT(view_runtimes_verbs, list(
10001000
if(!check_rights(R_EVENT))
10011001
return
10021002

1003-
if(mob.control_object)
1004-
if(!msg)
1005-
return
1006-
for(var/mob/V in hearers(mob.control_object))
1007-
V.show_message("<b>[mob.control_object.name]</b> says: \"" + msg + "\"", 2)
1008-
log_admin("[key_name(usr)] used oSay on [mob.control_object]: [msg]")
1009-
message_admins("[key_name_admin(usr)] used oSay on [mob.control_object]: [msg]")
1003+
var/datum/component/object_possession/possession_comp = mob.GetComponent(/datum/component/object_possession)
1004+
1005+
if(!possession_comp || !possession_comp.possessed || !msg)
1006+
return
1007+
1008+
for(var/mob/hearer in hearers(possession_comp.possessed))
1009+
hearer.show_message("<b>[possession_comp.possessed.name]</b> says: \"" + msg + "\"", 2)
10101010

1011-
SSblackbox.record_feedback("tally", "admin_verb", 1, "oSay") //If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
1011+
log_and_message_admins("[key_name_admin(usr)] used oSay on [possession_comp.possessed]: [msg]")
1012+
SSblackbox.record_feedback("tally", "admin_verb", 1, "oSay") // If you are copy-pasting this, ensure the 4th parameter is unique to the new proc!
10121013

10131014
/client/proc/force_hijack()
10141015
set category = "Admin.Toggles"

0 commit comments

Comments
 (0)