Made spawning with a loyalty implant compliant to configuration...

Created a proc for being implanted with loyalty implant which
checks for the configuration for whether or not it will work. If it is
enabled, it continues on-- if it is disabled, it returns from the proc.

Also made secure closets not automatically spawn them unless the config
is set to allow it.

Admin 'loyalty implanting' via the panel is now compliant to the
configuration file. If preferred, I am willing to make an override variable
to the proc that will allow admins to do it anyway.

Supply pack for it commented out due to inability to make it conform.
Easy enough to re-add back for anyone downstream if they wish it. Same
applies to the design.


Signed-off-by: Decius <deciusreln97@gmail.com>
This commit is contained in:
Decius
2014-07-14 17:21:11 -04:00
parent 0dabf4fc0a
commit 203c36114d
14 changed files with 85 additions and 80 deletions

View File

@@ -83,9 +83,9 @@ proc/assign_sec_to_department(var/mob/living/carbon/human/H)
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
implant_loyalty(H)
return 1
/obj/item/device/radio/headset/headset_sec/department/New()

View File

@@ -23,9 +23,9 @@
H.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/taser(H), slot_s_store)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
H.implant_loyalty(src) // Will not do so if config is set to disallow.
return 1
@@ -52,9 +52,9 @@
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
H.implant_loyalty(src) // // Will not do so if config is set to disallow.
return 1
@@ -89,9 +89,7 @@
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/evidence(H), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/device/detective_scanner(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
H.implant_loyalty(src) // Will not do so if config is set to disallow.
return 1
@@ -118,9 +116,9 @@
H.equip_to_slot_or_del(new /obj/item/device/flash(H), slot_l_store)
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
H.implant_loyalty(src) // Will not do so if config is set to disallow.
return 1
/datum/job/hop

View File

@@ -70,7 +70,7 @@
new /obj/item/weapon/storage/backpack/satchel_sec(src)
new /obj/item/weapon/cartridge/hos(src)
new /obj/item/device/radio/headset/heads/hos(src)
new /obj/item/weapon/storage/lockbox/loyalty(src)
if (config.use_loyalty_implants) new /obj/item/weapon/storage/lockbox/loyalty(src)
new /obj/item/weapon/storage/flashbang_kit(src)
new /obj/item/weapon/storage/belt/security(src)
new /obj/item/device/flash(src)

View File

@@ -231,9 +231,7 @@ var/global/admin_emergency_team = 0 // Used for admin-spawned response teams
// equip_to_slot_or_del(new /obj/item/weapon/storage/firstaid/regular(src), slot_in_backpack) // Regular medkit
// Loyalty implants
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(src)
L.imp_in = src
L.implanted = 1
implant_loyalty(src)
// ID cards
var/obj/item/weapon/card/id/E = new(src)

View File

@@ -510,37 +510,37 @@ datum/mind
I.Del()
break
H << "\blue <Font size =3><B>Your loyalty implant has been deactivated.</B></FONT>"
if("add")
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
var/datum/organ/external/affected = H.organs_by_name["head"]
affected.implants += L
L.part = affected
H << "\red <Font size =3><B>You somehow have become the recepient of a loyalty transplant, and it just activated!</B></FONT>"
if(src in ticker.mode.revolutionaries)
special_role = null
ticker.mode.revolutionaries -= src
src << "\red <Font size = 3><B>The nanobots in the loyalty implant remove all thoughts about being a revolutionary. Get back to work!</B></Font>"
if(src in ticker.mode.head_revolutionaries)
special_role = null
ticker.mode.head_revolutionaries -=src
src << "\red <Font size = 3><B>The nanobots in the loyalty implant remove all thoughts about being a revolutionary. Get back to work!</B></Font>"
if(src in ticker.mode.cult)
ticker.mode.cult -= src
ticker.mode.update_cult_icons_removed(src)
special_role = null
var/datum/game_mode/cult/cult = ticker.mode
if (istype(cult))
cult.memorize_cult_objectives(src)
current << "\red <FONT size = 3><B>The nanobots in the loyalty implant remove all thoughts about being in a cult. Have a productive day!</B></FONT>"
memory = ""
if(src in ticker.mode.traitors)
ticker.mode.traitors -= src
special_role = null
current << "\red <FONT size = 3><B>The nanobots in the loyalty implant remove all thoughts about being a traitor to Nanotrasen. Have a nice day!</B></FONT>"
log_admin("[key_name_admin(usr)] has de-traitor'ed [current].")
if("add")
H.implant_loyalty(src)
if(config.use_loyalty_implants) // The following won't occur if there are not loyalty implants.
H << "\red <Font size =3><B>You somehow have become the recepient of a loyalty transplant, and it just activated!</B></FONT>"
if(src in ticker.mode.revolutionaries)
special_role = null
ticker.mode.revolutionaries -= src
src << "\red <Font size = 3><B>The nanobots in the loyalty implant remove all thoughts about being a revolutionary. Get back to work!</B></Font>"
if(src in ticker.mode.head_revolutionaries)
special_role = null
ticker.mode.head_revolutionaries -=src
src << "\red <Font size = 3><B>The nanobots in the loyalty implant remove all thoughts about being a revolutionary. Get back to work!</B></Font>"
if(src in ticker.mode.cult)
ticker.mode.cult -= src
ticker.mode.update_cult_icons_removed(src)
special_role = null
var/datum/game_mode/cult/cult = ticker.mode
if (istype(cult))
cult.memorize_cult_objectives(src)
current << "\red <FONT size = 3><B>The nanobots in the loyalty implant remove all thoughts about being in a cult. Have a productive day!</B></FONT>"
memory = ""
if(src in ticker.mode.traitors)
ticker.mode.traitors -= src
special_role = null
current << "\red <FONT size = 3><B>The nanobots in the loyalty implant remove all thoughts about being a traitor to Nanotrasen. Have a nice day!</B></FONT>"
log_admin("[key_name_admin(usr)] has de-traitor'ed [current].")
else
usr << "Loyalty implants are currently disabled for your server in the configuration files."
else if (href_list["revolution"])
current.hud_updateflag |= (1 << SPECIALROLE_HUD)

View File

@@ -681,14 +681,6 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
access = access_armory
group = "Security"
/datum/supply_packs/loyalty
name = "Loyalty implant crate"
contains = list (/obj/item/weapon/storage/lockbox/loyalty)
cost = 60
containertype = /obj/structure/closet/crate/secure
containername = "Loyalty implant crate"
access = access_armory
group = "Security"
/datum/supply_packs/ballistic
name = "Ballistic gear crate"
@@ -725,6 +717,17 @@ var/list/all_supply_groups = list("Operations","Security","Hospitality","Enginee
access = access_armory
group = "Security"
/*
/datum/supply_packs/loyalty
name = "Loyalty implant crate"
contains = list (/obj/item/weapon/storage/lockbox/loyalty)
cost = 60
containertype = /obj/structure/closet/crate/secure
containername = "Loyalty implant crate"
access = access_armory
group = "Security"
*/
/datum/supply_packs/expenergy
name = "Experimental energy gear crate"
contains = list(/obj/item/clothing/suit/armor/laserproof,

View File

@@ -71,7 +71,7 @@
world << sound('sound/AI/commandreport.ogg')
// add an extra law to the AI to make sure it cooperates with the heads
var/extra_law = "Crew authorized to know of pathogen [virus_name]'s existence are: Heads of command, any crew member with loyalty implant. Do not allow unauthorized personnel to gain knowledge of [virus_name]. Aid authorized personnel in quarantining and neutrlizing the outbreak. This law overrides all other laws."
var/extra_law = "Crew authorized to know of pathogen [virus_name]'s existence are: Heads of command. Do not allow unauthorized personnel to gain knowledge of [virus_name]. Aid authorized personnel in quarantining and neutrlizing the outbreak. This law overrides all other laws."
for(var/mob/living/silicon/ai/M in world)
M.add_ion_law(extra_law)
M << "\red " + extra_law

View File

@@ -32,13 +32,10 @@
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H), slot_r_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/ids(H.back), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
world << "<b>[H.real_name] is the captain!</b>"
var/datum/organ/external/affected = H.organs_by_name["head"]
affected.implants += L
L.part = affected
H.implant_loyalty(src)
return 1
get_access()

View File

@@ -357,10 +357,8 @@
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H), slot_r_hand)
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
var/datum/organ/external/affected = H.organs_by_name["head"]
affected.implants += L
L.part = affected
H.implant_loyalty(H)
return 1

View File

@@ -39,12 +39,7 @@
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(H)
L.imp_in = H
L.implanted = 1
var/datum/organ/external/affected = H.organs_by_name["head"]
affected.implants += L
L.part = affected
H.implant_loyalty(H)
return 1
@@ -165,4 +160,4 @@
else
H.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(H.back), slot_in_backpack)
H.equip_to_slot_or_del(new /obj/item/weapon/handcuffs(H), slot_in_backpack)
return 1
return 1

View File

@@ -1,5 +1,11 @@
#define MALFUNCTION_TEMPORARY 1
#define MALFUNCTION_PERMANENT 2
/mob/living/carbon/human/
/obj/item/weapon/implant
name = "implant"
icon = 'icons/obj/device.dmi'

View File

@@ -158,9 +158,7 @@ var/global/sent_strike_team = 0
equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse_rifle(src), slot_r_hand)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(src)//Here you go Deuryn
L.imp_in = src
L.implanted = 1
implant_loyalty(src)

View File

@@ -317,6 +317,16 @@
if(armor >= 2) return
/mob/living/carbon/human/proc/implant_loyalty(mob/living/carbon/human/M)
if(!config.use_loyalty_implants) return
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(M)
L.imp_in = M
L.implanted = 1
var/datum/organ/external/affected = M.organs_by_name["head"]
affected.implants += L
L.part = affected
/mob/living/carbon/human/proc/is_loyalty_implanted(mob/living/carbon/human/M)
for(var/L in M.contents)
if(istype(L, /obj/item/weapon/implant/loyalty))

View File

@@ -1358,6 +1358,7 @@ datum/design/nanopaste
materials = list("$metal" = 7000, "$glass" = 7000)
build_path = "/obj/item/stack/nanopaste"
/* // Removal of loyalty implants. Can't think of a way to add this to the config option.
datum/design/implant_loyal
name = "loyalty implant"
desc = "Makes you loyal or such."
@@ -1366,6 +1367,7 @@ datum/design/implant_loyal
build_type = PROTOLATHE
materials = list("$metal" = 7000, "$glass" = 7000)
build_path = "/obj/item/weapon/implant/loyalty"
*/
datum/design/implant_chem
name = "chemical implant"