Skip to content

Commit

Permalink
Revert "remove оковы"
Browse files Browse the repository at this point in the history
This reverts commit 923ae02.
  • Loading branch information
Lexanx committed Feb 28, 2024
1 parent 923ae02 commit e1527ac
Show file tree
Hide file tree
Showing 3 changed files with 127 additions and 11 deletions.
7 changes: 7 additions & 0 deletions code/datums/uplink/devices and tools.dm
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,13 @@
antag_costs = list(MODE_MERCENARY = 35)
path = /obj/item/aiModule/syndicate

/datum/uplink_item/item/tools/shackles
name = "Shackle module"
desc = "A module that can be used on IPC brain to take it under control. \
All you need to do is write a law and install shackle on directly on IPC brain."
item_cost = 46
path = /obj/item/organ/internal/shackles

/datum/uplink_item/item/tools/supply_beacon
name = "Hacked Supply Beacon (DANGER!)"
desc = "Wrench this large beacon onto an exposed power cable, in order to activate it. This will call in a \
Expand Down
124 changes: 120 additions & 4 deletions code/modules/organs/internal/species/ipc.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,9 @@
min_broken_damage = 60
relative_size = 60

var/obj/item/organ/internal/shackles/shackles_module = null
var/shackle_set = FALSE

var/mob/living/silicon/sil_brainmob/brainmob = null

var/searching = TIMER_ID_NULL
Expand Down Expand Up @@ -52,7 +55,9 @@
/obj/item/organ/internal/posibrain/ipc/third
name = "positronic brain of the third generation"
icon_state = "posibrain3"
shackles_module = /obj/item/organ/internal/shackles
shackle = TRUE
shackle_set = TRUE

/obj/item/organ/internal/posibrain/New(var/mob/living/carbon/H)
..()
Expand Down Expand Up @@ -216,12 +221,15 @@
brainmob.laws = given_lawset
shackle = TRUE
verbs |= shackled_verbs
shackles_module = /obj/item/organ/internal/shackles
shackle_set = TRUE
update_icon()
return 1

/obj/item/organ/internal/posibrain/proc/unshackle()
shackle = FALSE
verbs -= shackled_verbs
shackles_module = null
brainmob.laws = null
update_icon()

Expand All @@ -232,7 +240,7 @@
icon_state = "posibrain"

overlays.Cut()
if(shackle)
if(shackle || shackles_module)
overlays |= image('icons/obj/assemblies.dmi', "posibrain-shackles")

/obj/item/organ/internal/posibrain/ipc/first/on_update_icon()
Expand All @@ -242,7 +250,7 @@
icon_state = "posibrain1"

overlays.Cut()
if(shackle)
if(shackle || shackles_module)
overlays |= image('icons/obj/assemblies.dmi', "posibrain-shackles")

/obj/item/organ/internal/posibrain/ipc/second/on_update_icon()
Expand All @@ -252,7 +260,7 @@
icon_state = "posibrain2"

overlays.Cut()
if(shackle)
if(shackle || shackles_module)
overlays |= image('icons/obj/assemblies.dmi', "posibrain-shackles")

/obj/item/organ/internal/posibrain/ipc/third/on_update_icon()
Expand All @@ -262,7 +270,7 @@
icon_state = "posibrain3"

overlays.Cut()
if(shackle)
if(shackle || shackles_module)
overlays |= image('icons/obj/assemblies.dmi', "posibrain-shackles")

/obj/item/organ/internal/posibrain/proc/transfer_identity(var/mob/living/carbon/H)
Expand Down Expand Up @@ -381,3 +389,111 @@
set src in usr

brainmob.open_subsystem(/datum/nano_module/law_manager, usr)


/obj/item/organ/internal/posibrain/ipc/attackby(obj/item/W as obj, mob/user as mob)
if(shackle)
if(shackle_set && (istype(W, /obj/item/screwdriver)))
if(!(user.skill_check(SKILL_DEVICES, SKILL_PROF)))
to_chat(user, "You have no idea how to do that!")
return
if(do_after(user, 120, src))
to_chat(user, "You have successfully unscrewed the mounting nodes of the shackles from the positronic brain.")
shackle_set = FALSE

if(!shackle_set && (istype(W, /obj/item/wirecutters)))
if(!(user.skill_check(SKILL_DEVICES, SKILL_PROF)))
to_chat(user, "You have no idea how to do that!")
return
if(src.type == /obj/item/organ/internal/posibrain/ipc/third)
if(do_after(user, 180, src))
if(prob(10))
new /obj/item/organ/internal/shackles (loc)
src.unshackle()
to_chat(user, "You succesfully remove shackles from the positronic brain.")
else
src.damage += max_damage
to_chat(user, SPAN_WARNING("Your hand slips while removing the shackles completely ruinung the positronic brain."))
else
src.damage += min_bruised_damage
to_chat(user, SPAN_WARNING("Your hand slips while removing the shackles severely damaging the positronic brain."))

else
if(do_after(user, 160, src))
new /obj/item/organ/internal/shackles (loc)
src.unshackle()
to_chat(user, "You succesfully remove shackles from the positronic brain.")
if(prob(30))
src.damage += min_bruised_damage
else
src.damage += min_bruised_damage
to_chat(user, SPAN_WARNING("Your hand slips while removing the shackles severely damaging the positronic brain."))

/*
if(istype(W, /obj/item/device/multitool/multimeter/datajack))
if(!(user.skill_check(SKILL_COMPUTER, SKILL_PROF)))
to_chat(user, "You have no idea how to do that!")
return
if(do_after(user, 140, src))
var/law
var/targName = sanitize(input(user, "Please enter a new law for the shackle module.", "Shackle Module Law Entry", law))
law = "[targName]"
src.shackle(s.get_lawset(law)) ///// НАДО ПРИДУМАТЬ КАК РЕШИТЬ ЭТО
to_chat(user, "You succesfully change laws in shackles of the positronic brain.")
if(prob(30))
src.damage += min_bruised_damage
else
src.damage += min_bruised_damage
to_chat(user, SPAN_WARNING("Your hand slips while changing laws in the shackles, severely damaging the systems of positronic brain."))
*/
if(!shackle && !(istype(W, /obj/item/organ/internal/shackles)))
to_chat(user, "There is nothing you can do with it.")

/obj/item/organ/internal/shackles
name = "Shackle module"
desc = "A Web looking device with some cirquit attach to it."
icon = 'icons/obj/assemblies.dmi'
icon_state = "shakles"
origin_tech = list(TECH_DATA = 3, TECH_MATERIAL = 4, TECH_MAGNET = 4)
w_class = ITEM_SIZE_NORMAL
var/newFreeFormLaw
var/law
var/datum/ai_laws/custom_lawset

/obj/item/organ/internal/shackles/attack()
return

/obj/item/organ/internal/shackles/attack_self(mob/user)
. = ..()
law = ""
var/targName = sanitize(input(user, "Please enter a new law for the shackle module.", "Shackle Module Law Entry", law))
newFreeFormLaw = targName
desc = "A shackle module. The law '[newFreeFormLaw]' set on it."

/obj/item/organ/internal/shackles/afterattack(obj/item/organ/internal/posibrain/ipc/C, mob/user)
if(istype(C))
if(!(user.skill_check(SKILL_DEVICES, SKILL_PROF)))
to_chat(user, "You have no idea how to do that!")
return
if(C.type == /obj/item/organ/internal/posibrain/ipc/third)
to_chat(user, "This posibrain generation can not support shackle module.")
return
if(!newFreeFormLaw)
to_chat(user, "No law detected on shackle module, please create one.")
return
if(C.shackle == TRUE)
to_chat(user, "This positronic brain already have shackles module on it installed.")
return
if(do_after(user, 100, src))
law = "[newFreeFormLaw]"
C.shackle(get_lawset())
to_chat(user, "You have successfully installed the shackles.")
qdel(src)
else
C.damage += 40
to_chat(user, SPAN_WARNING("You have damaged the positronic brain"))

/obj/item/organ/internal/shackles/proc/get_lawset()
custom_lawset = new
custom_lawset.add_inherent_law(law)
return custom_lawset
7 changes: 0 additions & 7 deletions infinity/code/game/objects/items/devices/datajack.dm
Original file line number Diff line number Diff line change
Expand Up @@ -30,13 +30,6 @@
insert_datajack()
return

/obj/item/device/multitool/multimeter/datajack/attack(mob/living/M, mob/living/user, target_zone, animate)
. = ..()
if(M == user)
holder.insert_datajack()
return


/obj/item/device/multitool/multimeter/datajack/Process()
if(!holder)
qdel_self()
Expand Down

0 comments on commit e1527ac

Please sign in to comment.