Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manipulator #10434

Closed
wants to merge 42 commits into from
Closed
Show file tree
Hide file tree
Changes from 26 commits
Commits
Show all changes
42 commits
Select commit Hold shift + click to select a range
c127927
manipulator
LudwigVonChesterfield Nov 27, 2022
1fe5651
span issues
LudwigVonChesterfield Nov 27, 2022
8ea345d
issignaler
LudwigVonChesterfield Nov 27, 2022
795c86f
global consts
LudwigVonChesterfield Nov 27, 2022
8a81e49
Merge branch 'master' of https://github.com/TauCetiStation/TauCetiCla…
LudwigVonChesterfield Jun 2, 2023
e8ecec3
no sprite updates for manipulator mob.
LudwigVonChesterfield Jun 2, 2023
793160b
better code
LudwigVonChesterfield Jun 2, 2023
cfe7348
no life
LudwigVonChesterfield Jun 2, 2023
0d47f0a
fixes rotation runtime
LudwigVonChesterfield Jun 3, 2023
aff0add
added crafting to autolathe
LudwigVonChesterfield Jun 3, 2023
0b56af4
fix manipulator opening browsers.
LudwigVonChesterfield Jun 3, 2023
07d49bf
choose manipulator target zone via wires
LudwigVonChesterfield Jun 4, 2023
5612855
fix click delay issues.
LudwigVonChesterfield Jun 4, 2023
d3ce6ed
drop everything from click mob's inventory after click.
LudwigVonChesterfield Jun 4, 2023
31e92fb
fixes human list issue.
LudwigVonChesterfield Jun 4, 2023
a1db80f
removing manipulator mob from mob lists
LudwigVonChesterfield Jun 4, 2023
ca0909d
drop items only after complete activation
LudwigVonChesterfield Jun 4, 2023
d0092d5
fixes not being able to pulse change target zone
LudwigVonChesterfield Jun 4, 2023
35410a0
gives manipulator max skills
LudwigVonChesterfield Jun 4, 2023
41f810b
adds manipulator self attack capability, forced attack hand click.
LudwigVonChesterfield Jun 5, 2023
0d122f7
little emag feature
LudwigVonChesterfield Jun 5, 2023
a030c3d
cutting activation wire will make manipulator not activate automatica…
LudwigVonChesterfield Jun 6, 2023
7109242
prohibitting unwrenching while working
LudwigVonChesterfield Jun 6, 2023
dd65365
manipulator elements(hand and item) are not clickable, thus causing l…
LudwigVonChesterfield Jun 6, 2023
f58b9a1
naming support, personalization.
LudwigVonChesterfield Jun 6, 2023
cd44726
googly perfection
LudwigVonChesterfield Jun 6, 2023
8d62594
fixes wire issue
LudwigVonChesterfield Jun 7, 2023
f343eb3
Revert "fixes human list issue." Since mob is deleted from lists anyway.
LudwigVonChesterfield Jun 7, 2023
470c0bf
removes processing from SSmobs, removes simulated check in Life
LudwigVonChesterfield Jun 7, 2023
148d54f
Revert "removes processing from SSmobs, removes simulated check in Life"
LudwigVonChesterfield Jun 7, 2023
34dc9fa
adding missing after_activate
LudwigVonChesterfield Jun 7, 2023
5677fa5
the activator won't send after activation signal if nothing actually …
LudwigVonChesterfield Jun 8, 2023
af6ac51
you can't pulse cut wires, so auto activation is seperate now
LudwigVonChesterfield Jun 8, 2023
d127a1b
Merge branch 'master' into maniwhat_now
LudwigVonChesterfield Jun 16, 2023
3518c60
Merge branch 'master' of https://github.com/TauCetiStation/TauCetiCla…
LudwigVonChesterfield Aug 13, 2023
d7e979f
Merge branch 'maniwhat_now' of https://github.com/TauCetiStation/TauC…
LudwigVonChesterfield Aug 13, 2023
8a13f8e
ghosts can't mirror
LudwigVonChesterfield Aug 13, 2023
6ab4da7
Merge branch 'master' of https://github.com/TauCetiStation/TauCetiCla…
LudwigVonChesterfield Dec 6, 2023
6f05597
balance patches
LudwigVonChesterfield Dec 6, 2023
6e0b182
just one more thing
LudwigVonChesterfield Dec 6, 2023
2ba250b
fixes unwrenching
LudwigVonChesterfield Dec 6, 2023
35e087d
Merge branch 'master' of https://github.com/TauCetiStation/TauCetiCla…
LudwigVonChesterfield Mar 23, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions code/__DEFINES/mob.dm
Original file line number Diff line number Diff line change
Expand Up @@ -93,6 +93,7 @@
#define SKELETON_VOX "Skeleton Vox"
#define SHADOWLING "Shadowling"
#define GOLEM "Adamantine Golem"
#define BLUESPACE "Bluespace Being"
#define HOMUNCULUS "Homunculus"
#define ZOMBIE "Zombie"
#define ZOMBIE_TAJARAN "Zombie Tajaran"
Expand Down
2 changes: 1 addition & 1 deletion code/_onclick/ai.dm
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
Note that AI have no need for the adjacency proc, and so this proc is a lot cleaner.
*/
/mob/living/silicon/ai/DblClickOn(atom/A, params)
if(client.click_intercept) // handled in normal click.
if(client && client.click_intercept) // handled in normal click.
return

if(control_disabled || stat != CONSCIOUS) return
Expand Down
7 changes: 4 additions & 3 deletions code/_onclick/click.dm
Original file line number Diff line number Diff line change
Expand Up @@ -60,13 +60,13 @@
if(notransform)
return

if(client.click_intercept)
if(client && client.click_intercept)
client.click_intercept.InterceptClickOn(src, params, A)
return

var/list/modifiers = params2list(params)

if(client.cob && client.cob.in_building_mode)
if(client && client.cob && client.cob.in_building_mode)
cob_click(client, modifiers)
return

Expand Down Expand Up @@ -312,7 +312,8 @@
user.listed_turf = null
else
user.listed_turf = T
user.client.statpanel = T.name
if(user.client)
user.client.statpanel = T.name

/mob/living/AltClick(mob/living/user)
/*
Expand Down
4 changes: 2 additions & 2 deletions code/_onclick/cyborg.dm
Original file line number Diff line number Diff line change
Expand Up @@ -11,13 +11,13 @@
return
next_click = world.time + 1

if(client.click_intercept) // comes after object.Click to allow buildmode gui objects to be clicked
if(client && client.click_intercept) // comes after object.Click to allow buildmode gui objects to be clicked
client.click_intercept.InterceptClickOn(src, params, A)
return

var/list/modifiers = params2list(params)

if(client.cob.in_building_mode)
if(client && client.cob.in_building_mode)
cob_click(client, modifiers)
return

Expand Down
7 changes: 7 additions & 0 deletions code/datums/browser.dm
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,10 @@
var/mob/M = nuser
nuser = M.client

if(!nuser)
qdel(src)
return
Comment on lines +20 to +22
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

подавление возможных валидных ошибок

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

не могу придумать как проверять что клиент принадлежит манипулятору.

сначала думал строку-затычку но потом понял что все проверки вида if(user.client) будут проходить при том что не должны.

какие-то есть возможные решения кроме поиска всех случаев когда создаётся браузер?...

и даже если я везде буду проверять на клиента ДО создания браузера, единственная "валидная" ошибка которую мы сейчас подавляем это "кто-то создал браузер без юзера"


user = nuser
LAZYSET(user.browsers, nwindow_id, src)
window_id = nwindow_id
Expand Down Expand Up @@ -92,6 +96,9 @@
</html>"}

/datum/browser/proc/open()
if(!user)
return

var/window_size
if(width && height)
window_size = "size=[width]x[height];"
Expand Down
2 changes: 2 additions & 0 deletions code/datums/mood_events/needs_events.dm
Original file line number Diff line number Diff line change
Expand Up @@ -79,6 +79,8 @@
/datum/mood_event/blueshield/add_effects()
var/list/to_protect = list()
for(var/mob/living/carbon/human/player as anything in human_list)
if(!player.simulated)
continue
if(player.mind && (player.mind.assigned_role in protected_by_blueshield_list))
to_protect += player.mind

Expand Down
7 changes: 7 additions & 0 deletions code/datums/wires/_wires.dm
Original file line number Diff line number Diff line change
Expand Up @@ -346,6 +346,13 @@ var/global/list/wire_daltonism_colors = list()
else
CRASH("[color] is not a key in wires.")

/datum/wires/proc/get_color_by_index(index)
for(var/col in wires)
var/other_index = wires[col]
if(index == other_index)
return col

CRASH("[index] is not an index in wires")

////////////////////////////
// Is Index/Colour Cut procs
Expand Down
50 changes: 50 additions & 0 deletions code/datums/wires/manipulator.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
var/global/const/MANIPULATOR_WIRE_ACTIVATE = 1
var/global/const/MANIPULATOR_WIRE_AFTER_ACTIVATE = 2
var/global/const/MANIPULATOR_WIRE_CHANGE_TARGET_ZONE = 4
var/global/const/MANIPULATOR_WIRE_ATTACK_SELF_ON_INTERACTION = 8

/datum/wires/manipulator
holder_type = /obj/machinery/manipulator
wire_count = 5
window_y = 560

/datum/wires/manipulator/can_use()
var/obj/machinery/manipulator/M = holder
return M.panel_open

/datum/wires/manipulator/get_status()
var/obj/machinery/manipulator/M = holder
. += ..()
. += "Target selection screen displays: [parse_zone(M.target_zone)]"
. += "The 'Activate Instead' light is [M.attack_self_interaction ? "on" : "off"]."

/datum/wires/manipulator/update_cut(index, mended)
var/obj/machinery/manipulator/M = holder

switch(index)
if(MANIPULATOR_WIRE_ATTACK_SELF_ON_INTERACTION)
M.auto_activation = mended
return

if(MANIPULATOR_WIRE_ATTACK_SELF_ON_INTERACTION)
M.attack_self_interaction = !mended
return

update_pulsed(index)

/datum/wires/manipulator/update_pulsed(index)
var/obj/machinery/manipulator/M = holder

switch(index)
if(MANIPULATOR_WIRE_ACTIVATE)
if(!M.can_activate())
return

M.forced = TRUE
M.activate()

if(MANIPULATOR_WIRE_CHANGE_TARGET_ZONE)
M.cycle_target_zone()

if(MANIPULATOR_WIRE_ATTACK_SELF_ON_INTERACTION)
M.next_attack_self_interaction = TRUE
2 changes: 2 additions & 0 deletions code/defines/procs/records.dm
Original file line number Diff line number Diff line change
Expand Up @@ -127,6 +127,8 @@
S.fields["criminal"] = criminal_status
add_record(author, S, "Уголовный статус статус был изменен на <b>[criminal_status]</b><BR><b>Причина:</b> [reason]")
for(var/mob/living/carbon/human/H in global.human_list)
if(!H.simulated)
continue
if(H.real_name == target_name)
H.sec_hud_set_security_status()

2 changes: 2 additions & 0 deletions code/game/atoms.dm
Original file line number Diff line number Diff line change
Expand Up @@ -330,6 +330,8 @@

//called to set the atom's dir and used to add behaviour to dir-changes
/atom/proc/set_dir(new_dir)
SHOULD_CALL_PARENT(TRUE)

. = new_dir != dir
dir = new_dir
if(.)
Expand Down
4 changes: 4 additions & 0 deletions code/game/atoms_movable.dm
Original file line number Diff line number Diff line change
Expand Up @@ -457,6 +457,8 @@

/client/var/list/image/outlined_item = list()
/atom/movable/proc/apply_outline(color)
if(!usr || !usr.client)
return
Comment on lines +462 to +463
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

подавление возможных валидных ошибок x2, и так далее.

if(anchored || !usr.client.prefs.outline_enabled)
return
if(!color)
Expand All @@ -477,6 +479,8 @@


/atom/movable/proc/remove_outline()
if(!usr || !usr.client)
return
usr.client.images -= usr.client.outlined_item[src]
usr.client.outlined_item -= src

Expand Down
2 changes: 2 additions & 0 deletions code/game/gamemodes/factions.dm
Original file line number Diff line number Diff line change
Expand Up @@ -410,6 +410,8 @@
continue
if(H.stat == DEAD)
continue
if(!H.simulated)
continue
if(!H.mind || !H.client)
continue
total_human++
Expand Down
10 changes: 10 additions & 0 deletions code/game/gamemodes/factions/revolution.dm
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
/proc/get_living_heads()
var/list/heads = list()
for(var/mob/living/carbon/human/player as anything in human_list)
if(!player.simulated)
continue
if(player.stat != DEAD && player.mind && (player.mind.assigned_role in heads_positions))
heads += player.mind
return heads
Expand All @@ -27,6 +29,8 @@
/datum/faction/revolution/proc/get_all_heads()
var/list/heads = list()
for(var/mob/living/carbon/human/player as anything in human_list)
if(!player.simulated)
continue
if(player.mind && (player.mind.assigned_role in heads_positions))
heads += player.mind
return heads
Expand Down Expand Up @@ -116,6 +120,8 @@
log_debug("There are zero active heads of revolution, trying to add some..")
var/added_heads = FALSE
for(var/mob/living/carbon/human/H as anything in human_list)
if(!H.simulated)
continue
if(H.stat != DEAD && H.mind && H.client?.inactivity <= 20 MINUTES && isrev(H))
var/datum/role/R = H.mind.GetRole(REV)
R.Drop(H.mind)
Expand Down Expand Up @@ -190,6 +196,8 @@
if(foecount == SSStatistics.score.arrested)
SSStatistics.score.allarrested = 1
for(var/mob/living/carbon/human/player as anything in human_list)
if(!player.simulated)
continue
if(player.mind)
var/role = player.mind.assigned_role
if(role in global.command_positions)
Expand Down Expand Up @@ -220,6 +228,8 @@
revcount++

for(var/mob/living/carbon/human/player as anything in human_list)
if(!player.simulated)
continue
if(!player.mind)
continue
var/role = player.mind.assigned_role
Expand Down
2 changes: 2 additions & 0 deletions code/game/gamemodes/misc_gamemode_procs.dm
Original file line number Diff line number Diff line change
Expand Up @@ -206,6 +206,8 @@
/proc/get_nt_opposed()
var/list/dudes = list()
for(var/mob/living/carbon/human/man as anything in human_list)
if(!man.simulated)
continue
if(man.client)
if(man.client.prefs.nanotrasen_relation == "Opposed")
dudes += man
Expand Down
2 changes: 2 additions & 0 deletions code/game/gamemodes/modes_gameplays/nuclear/pinpointer.dm
Original file line number Diff line number Diff line change
Expand Up @@ -171,6 +171,8 @@
/proc/get_humans_by_dna(dna)
var/list/result = list()
for(var/mob/living/carbon/human/player in human_list)
if(!player.simulated)
continue
if (!player.dna)
continue
if (!player.dna.unique_enzymes)
Expand Down
2 changes: 2 additions & 0 deletions code/game/gamemodes/objectives/absorb.dm
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@
n_p ++
else if (SSticker.current_state == GAME_STATE_PLAYING)
for(var/mob/living/carbon/human/P as anything in human_list)
if(!P.simulated)
continue
if(P.client && !ischangeling(P) && P.mind!=owner)
n_p ++
target_amount = min(target_amount, n_p)
Expand Down
2 changes: 2 additions & 0 deletions code/game/gamemodes/objectives/turn_into_zombie.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
for(var/mob/living/carbon/human/H as anything in human_list)
if(!H || !H.mind || !is_station_level(H.z))
continue
if(!H.simulated)
continue
if(!H.mind.GetRoleByType(faction.initroletype) || !H.mind.GetRoleByType(faction.roletype))
return OBJECTIVE_LOSS
return OBJECTIVE_WIN
4 changes: 4 additions & 0 deletions code/game/gamemodes/scoreboard.dm
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,8 @@
SSStatistics.score.crew_dead += 1

for (var/mob/living/carbon/human/I as anything in human_list)
if(!I.simulated)
continue
if (I.stat == DEAD && is_station_level(I.z))
SSStatistics.score.crew_dead += 1
if (I.job == "Clown")
Expand All @@ -21,6 +23,8 @@
var/cashscore = 0
var/dmgscore = 0
for(var/mob/living/carbon/human/E as anything in human_list)
if(!E.simulated)
continue
if(E.stat == DEAD)
continue
cashscore = 0
Expand Down
1 change: 1 addition & 0 deletions code/game/machinery/autolathe.dm
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ var/global/list/datum/autolathe_recipe/autolathe_recipes = list(
R(/obj/item/clothing/accessory/stethoscope, CATEGORY_MEDICAL),
R(/obj/item/stack/cable_coil/random, CATEGORY_ENGINEERING),
R(/obj/item/weapon/module/power_control, CATEGORY_ENGINEERING),
R(/obj/item/weapon/circuitboard/manipulator, CATEGORY_ENGINEERING),
R(/obj/item/weapon/airlock_electronics, CATEGORY_ENGINEERING),
R(/obj/item/weapon/airalarm_electronics, CATEGORY_ENGINEERING),
R(/obj/item/weapon/firealarm_electronics, CATEGORY_ENGINEERING),
Expand Down
10 changes: 6 additions & 4 deletions code/game/machinery/computer/medical.dm
Original file line number Diff line number Diff line change
Expand Up @@ -275,7 +275,7 @@ ADD_TO_GLOBAL_LIST(/obj/machinery/computer/med_data, med_record_consoles_list)
for(var/i in global.department_accounts)
if(t1 == global.department_accounts[i].account_number)
tgui_alert(usr, "This is department account, you can't use it.")
return
return
if(MA.owner_name != src.active1.fields["name"])
tgui_alert(usr, "[src.active1.fields["name"]] is not owner of this money account.")
return
Expand All @@ -284,8 +284,10 @@ ADD_TO_GLOBAL_LIST(/obj/machinery/computer/med_data, med_record_consoles_list)
if(R)
tgui_alert(usr, "This money account is already used by [R.fields["id"]] record.")
return

for(var/mob/living/carbon/human/H as anything in global.human_list)
if(!H.simulated)
continue
if(md5(H.dna.uni_identity) != src.active1.fields["fingerprint"])
continue
var/old_value = src.active1.fields["insurance_account_number"]
Expand All @@ -295,10 +297,10 @@ ADD_TO_GLOBAL_LIST(/obj/machinery/computer/med_data, med_record_consoles_list)
announcer.autosay("[usr] has changed the insurance account number in [src.active1.fields["id"]] record from '[old_value]' to '[t1]'.", "Insurancer", "Medical", freq = radiochannels["Medical"])
announcer.autosay("[usr] has changed the insurance account number in [src.active1.fields["id"]] record from '[old_value]' to '[t1]'.", "Insurancer", "Security", freq = radiochannels["Security"])
qdel(announcer)

if(src.active1.fields["insurance_account_number"] != t1)
tgui_alert(usr, "Can't match the 'fingerprint' data, please check this and try again.")

if("sex")
if (istype(src.active1, /datum/data/record))
if (src.active1.fields["sex"] == "Male")
Expand Down
6 changes: 6 additions & 0 deletions code/game/machinery/doors/brigdoors.dm
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,8 @@
add_record(null, security_data, "Отбыл наказание за преступления по статьям: [prisoner_crimes]. Уголовный статус статус был изменен на <b>Released</b>", id)
security_data.fields["criminal"] = "Released"
for(var/mob/living/carbon/human/H in global.human_list)
if(!H.simulated)
continue
if(H.real_name == prisoner_name)
H.sec_hud_set_security_status()
timer_end() // open doors, reset timer, clear status screen
Expand Down Expand Up @@ -316,6 +318,8 @@
add_record(usr, security_data, "Уголовный статус статус был изменен на <b>Incarcerated</b>.<br><b>Статья:</b> [prisoner_crimes].<br><b>Подробности:</b> [prisoner_details].<br><b>Время наказания:</b> [prison_minute] min.")
security_data.fields["criminal"] = "Incarcerated"
for(var/mob/living/carbon/human/H in global.human_list)
if(!H.simulated)
continue
if(H.real_name == prisoner_name)
H.sec_hud_set_security_status()
data = "База данных обновлена."
Expand All @@ -328,6 +332,8 @@
add_record(usr, security_data, "Освобожден досрочно из камеры [id]. Уголовный статус статус был изменен на <b>Paroled</b>")
security_data.fields["criminal"] = "Paroled"
for(var/mob/living/carbon/human/H in global.human_list)
if(!H.simulated)
continue
if(H.real_name == prisoner_name)
H.sec_hud_set_security_status()
timer_end()
Expand Down
Loading