Skip to content

Commit

Permalink
admin: немного ПОДезации админских кнопок
Browse files Browse the repository at this point in the history
  • Loading branch information
dageavtobusnick committed Jan 31, 2025
1 parent 0aadff6 commit 9ebcee9
Show file tree
Hide file tree
Showing 5 changed files with 115 additions and 54 deletions.
23 changes: 23 additions & 0 deletions code/datums/outfits/outfit_prisoner.dm
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
/datum/outfit/prisoner
uniform = /obj/item/clothing/under/color/orange
shoes = /obj/item/clothing/shoes/orange

/datum/outfit/prisoner/plasmamen
uniform =/obj/item/clothing/under/plasmaman
head = /obj/item/clothing/head/helmet/space/plasmaman
belt = /obj/item/tank/internals/plasmaman/belt/full
mask = /obj/item/clothing/mask/breath

/datum/outfit/prisoner/plasmamen/post_equip(mob/living/carbon/human/H, visualsOnly)
. = ..()
var/obj/item/tank/internals/tank = H.belt
tank.toggle_internals(H)

/datum/outfit/prisoner/vox
mask = /obj/item/clothing/mask/breath/vox
belt = /obj/item/tank/internals/emergency_oxygen/double/vox

/datum/outfit/prisoner/vox/post_equip(mob/living/carbon/human/H, visualsOnly)
. = ..()
var/obj/item/tank/internals/tank = H.belt
tank.toggle_internals(H)
89 changes: 37 additions & 52 deletions code/modules/admin/topic.dm
Original file line number Diff line number Diff line change
Expand Up @@ -1390,45 +1390,26 @@
else if(href_list["sendtoprison"])
if(!check_rights(R_ADMIN)) return

if(alert(usr, "Send to admin prison for the round?", "Message", "Yes", "No") != "Yes")
if(tgui_alert(usr, "Отправить в админскую тюрьму на остаток раунда?", "Подтверждение", list("Да", "Нет")) != "Да")
return

var/mob/M = locateUID(href_list["sendtoprison"])
if(!istype(M, /mob))
to_chat(usr, "<span class='warning'>This can only be used on instances of type /mob</span>", confidential=TRUE)
to_chat(usr, span_warning("Это можно использовать только на объектах типа /mob"), confidential=TRUE)
return
if(istype(M, /mob/living/silicon/ai))
to_chat(usr, "<span class='warning'>This cannot be used on instances of type /mob/living/silicon/ai</span>", confidential=TRUE)
to_chat(usr, span_warning("Это нельзя использовать на объектах типа /mob/living/silicon/ai"), confidential=TRUE)
return

var/turf/prison_cell = pick(GLOB.prisonwarp)
if(!prison_cell) return

var/obj/structure/closet/secure_closet/brig/locker = new /obj/structure/closet/secure_closet/brig(prison_cell)
locker.opened = 0
locker.locked = 1

//strip their stuff and stick it in the crate
for(var/obj/item/I in M)
M.drop_transfer_item_to_loc(I, locker)
M.update_icons()
var/obj/structure/closet/supplypod/centcompod/prison_warp/pod = new()
pod.reverse_dropoff_coords = list(prison_cell.x, prison_cell.y, prison_cell.z)
pod.target = M
new /obj/effect/pod_landingzone(M, pod)

//so they black out before warping
if(isliving(M))
var/mob/living/L = M
L.Paralyse(10 SECONDS)
sleep(5)
if(!M)
return

M.forceMove(prison_cell)
if(ishuman(M))
var/mob/living/carbon/human/prisoner = M
prisoner.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(prisoner), ITEM_SLOT_CLOTH_INNER)
prisoner.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(prisoner), ITEM_SLOT_FEET)

to_chat(M, "<span class='warning'>You have been sent to the prison station!</span>")
log_and_message_admins("<span class='notice'>sent [key_name_admin(M)] to the prison station.</span>")
log_and_message_admins("sent [key_name_admin(M)] to the prison station.")

else if(href_list["sendbacktolobby"])
if(!check_rights(R_ADMIN))
Expand Down Expand Up @@ -2924,18 +2905,19 @@

var/atom/target //Where the object will be spawned
var/where = href_list["object_where"]
if(!( where in list("onfloor","inhand","inmarked") ))
if(!( where in list("onfloor","frompod","inhand","inmarked")))
where = "onfloor"


switch(where)

if("inhand")
if(!iscarbon(usr) && !isrobot(usr))
to_chat(usr, "<span class='warning'>Can only spawn in hand when you're a carbon mob or cyborg.</span>", confidential=TRUE)
where = "onfloor"
target = usr

if("onfloor")
if("onfloor", "frompod")
switch(href_list["offset_type"])
if("absolute")
target = locate(0 + X,0 + Y,0 + Z)
Expand All @@ -2951,7 +2933,11 @@
else
target = marked_datum

var/obj/structure/closet/supplypod/centcompod/pod

if(target)
if(where == "frompod")
pod = new()
for(var/path in paths)
for(var/i = 0; i < number; i++)
if(path in typesof(/turf))
Expand All @@ -2960,7 +2946,13 @@
if(N && obj_name)
N.name = obj_name
else
var/atom/O = new path(target)
var/atom/O

if(where == "frompod")
O = new path(pod)
else
O = new path(target)

if(O)
O.flags |= ADMIN_SPAWNED
O.dir = obj_dir
Expand All @@ -2981,6 +2973,8 @@
R.module.rebuild()
R.activate_module(I)
R.module.fix_modules()
if(pod)
new /obj/effect/pod_landingzone(target, pod)

if(number == 1)
log_admin("[key_name(usr)] created a [english_list(paths)]")
Expand Down Expand Up @@ -3181,37 +3175,28 @@
if(!you_realy_want_do_this())
return
SSblackbox.record_feedback("tally", "admin_secrets_fun_used", 1, "Prison Warp")
log_and_message_admins("<span class='notice'>teleported all players to the prison station.</span>")
log_and_message_admins("teleported all players to the prison station.")
for(var/thing in GLOB.human_list)
var/mob/living/carbon/human/H = thing
var/turf/loc = find_loc(H)
var/security = 0
if(!is_station_level(loc.z) || GLOB.prisonwarped.Find(H))

//don't warp them if they aren't ready or are already there
var/security = FALSE
if(!is_station_level(loc.z) || GLOB.prisonwarped.Find(H)) //don't warp them if they aren't ready or are already there
continue
H.Paralyse(10 SECONDS)
if(H.wear_id)
var/obj/item/card/id/id = H.get_id_card()
if(istype(id))
for(var/A in id.access)
if(A == ACCESS_SECURITY)
security++
if(!security)
//strip their stuff before they teleport into a cell :downs:
for(var/obj/item/W in H)
if(istype(W, /obj/item/organ/external))
continue
//don't strip organs
H.drop_item_ground(W)
//teleport person to cell
H.forceMove(pick(GLOB.prisonwarp))
H.equip_to_slot_or_del(new /obj/item/clothing/under/color/orange(H), ITEM_SLOT_CLOTH_INNER)
H.equip_to_slot_or_del(new /obj/item/clothing/shoes/orange(H), ITEM_SLOT_FEET)
else
//teleport security person
H.forceMove(pick(GLOB.prisonsecuritywarp))
GLOB.prisonwarped += H
security = TRUE
var/turf/prison_cell = pick((security? GLOB.prisonsecuritywarp : GLOB.prisonwarp))
if(!prison_cell) continue

var/obj/structure/closet/supplypod/centcompod/prison_warp/pod = new()
pod.reverse_dropoff_coords = list(prison_cell.x, prison_cell.y, prison_cell.z)
pod.target = H
pod.security =security
new /obj/effect/pod_landingzone(H, pod)

if("traitor_all")
if(!SSticker)
alert("The game hasn't started yet!")
Expand Down
55 changes: 53 additions & 2 deletions code/modules/cargo/supplypod.dm
Original file line number Diff line number Diff line change
Expand Up @@ -120,6 +120,57 @@
MECHA_OPTION = TRUE,
)

/obj/structure/closet/supplypod/centcompod/prison_warp
delays = list(POD_TRANSIT = 1 SECONDS, POD_FALLING = 1 SECONDS, POD_OPENING = 0, POD_LEAVING = 0.2)
reverse_delays = list(POD_TRANSIT = 10 SECONDS, POD_FALLING = 1.5 SECONDS, POD_OPENING = 0.6 SECONDS, POD_LEAVING = 0)
custom_rev_delay = TRUE
effectStealth = TRUE
effectStun = TRUE
reversing = TRUE
reverse_option_list = list(
MOB_OPTION = TRUE,
UNANCHORED_OPTION = FALSE,
ANCHORED_OPTION = FALSE,
MECHA_OPTION = TRUE,
)
var/mob/target
var/security = FALSE

/obj/structure/closet/supplypod/centcompod/prison_warp/close(atom/movable/holder)
target.forceMove(get_turf(src))
. = ..()

/obj/structure/closet/supplypod/centcompod/prison_warp/insertion_allowed(atom/to_insert)
return to_insert == target

/obj/structure/closet/supplypod/centcompod/prison_warp/handleReturnAfterDeparting(atom/movable/holder)
. = ..()
if(security)
to_chat(target, span_warning("Вас перевели на тюремную станцию!"))
return ..()
GLOB.prisonwarped += target
var/turf/return_turf = locate(reverse_dropoff_coords[1], reverse_dropoff_coords[2], reverse_dropoff_coords[3])
var/obj/structure/closet/secure_closet/brig/locker = new /obj/structure/closet/secure_closet/brig(return_turf)
locker.opened = 0
locker.locked = 1

for(var/obj/item/item in target)
target.drop_transfer_item_to_loc(item, locker)
target.update_icons()

if(ishuman(target))
var/mob/living/carbon/human/prisoner = target
if(isplasmaman(prisoner))
prisoner.equipOutfit(/datum/outfit/prisoner/plasmamen)
else if(isvox(prisoner) || isvoxarmalis(prisoner))
prisoner.equipOutfit(/datum/outfit/prisoner/vox)
else
prisoner.equipOutfit(/datum/outfit/prisoner)


to_chat(target, span_warning("Вы были этапированы на тюремную станцию!"))


/obj/structure/closet/supplypod/back_to_station
name = "blood-red supply pod"
desc = "Устрашающая капсула снабжения, покрытая кроваво-красными отметинами."
Expand Down Expand Up @@ -693,8 +744,8 @@
mob_in_pod.reset_perspective(src)
if(pod.effectStun) //If effectStun is true, stun any mobs caught on this pod_landingzone until the pod gets a chance to hit them
for (var/mob/living/target_living in get_turf(src))
target_living.AdjustWeakened(pod.delays[POD_TRANSIT] + 20, TRUE)//you ain't goin nowhere, kid.
target_living.AdjustStunned(pod.delays[POD_TRANSIT] + 20, TRUE)
target_living.AdjustWeakened(pod.delays[POD_TRANSIT] + 3 SECONDS, TRUE)//you ain't goin nowhere, kid.
target_living.AdjustStunned(pod.delays[POD_TRANSIT] + 3 SECONDS, TRUE)
if (pod.delays[POD_TRANSIT] + pod.delays[POD_FALLING] < pod.fallingSoundLength)
pod.fallingSoundLength = 3 //The default falling sound is a little long, so if the landing time is shorter than the default falling sound, use a special, shorter default falling sound
pod.fallingSound = 'sound/weapons/mortar_whistle.ogg'
Expand Down
1 change: 1 addition & 0 deletions html/create_object.html
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,7 @@
<tr><td width='20%'>Where:</td><td>
<select name='object_where' style="width:65%">
<option value='onfloor'>On floor below own mob</option>
<option value='frompod'>On floor below own mob, dropped via supply pod</option>
<option value='inhand'>In own mob's hand</option>
<option value='inmarked'>In marked object</option>
</select></td></tr>
Expand Down
1 change: 1 addition & 0 deletions paradise.dme
Original file line number Diff line number Diff line change
Expand Up @@ -645,6 +645,7 @@
#include "code\datums\outfits\outfit.dm"
#include "code\datums\outfits\outfit_admin.dm"
#include "code\datums\outfits\outfit_debug.dm"
#include "code\datums\outfits\outfit_prisoner.dm"
#include "code\datums\outfits\outfit_security_clown.dm"
#include "code\datums\outfits\plasmamen.dm"
#include "code\datums\outfits\vv_outfit.dm"
Expand Down

0 comments on commit 9ebcee9

Please sign in to comment.