Crystal Agitators (#8609)

This commit is contained in:
Geeves
2020-09-01 14:04:12 +02:00
committed by GitHub
parent 737c201738
commit a24f4ddb79
36 changed files with 2062 additions and 742 deletions

View File

@@ -69,7 +69,7 @@
to_chat(user, SPAN_NOTICE("You paint the target at [target]."))
var/obj/item/device/radio/intercom/announcer = new /obj/item/device/radio/intercom(null)
announcer.config(list("Common" = FALSE, "Entertainment" = FALSE, "Response Team" = FALSE, "Science" = FALSE, "Command" = FALSE, "Medical" = FALSE, "Engineering" = FALSE, "Security" = FALSE, "Supply" = FALSE, "Service" = FALSE, "Mercenary" = FALSE, "Raider" = FALSE, "Ninja" = FALSE, "AI Private" = FALSE))
announcer.config(list("Common" = FALSE, "Entertainment" = FALSE, "Response Team" = FALSE, "Science" = FALSE, "Command" = FALSE, "Medical" = FALSE, "Engineering" = FALSE, "Security" = FALSE, "Penal" = FALSE, "Supply" = FALSE, "Service" = FALSE, "Mercenary" = FALSE, "Raider" = FALSE, "Ninja" = FALSE, "AI Private" = FALSE))
if(announcer)
if(!emagged)
announcer.autosay(drop_message, announcer_name, announcer_channel)

View File

@@ -8,6 +8,7 @@
#define CHANNEL_SUPPLY "Supply"
#define CHANNEL_SERVICE "Service"
#define CHANNEL_AI_PRIVATE "AI Private"
#define CHANNEL_PENAL "Penal"
#define CHANNEL_RESPONSE_TEAM "Response Team"

View File

@@ -57,6 +57,16 @@
icon_state = "sec_cypherkey"
channels = list(CHANNEL_SECURITY = TRUE)
/obj/item/device/encryptionkey/headset_warden
name = "warden radio encryption key"
icon_state = "sec_cypherkey"
channels = list(CHANNEL_SECURITY = TRUE, CHANNEL_PENAL = TRUE)
/obj/item/device/encryptionkey/headset_penal
name = "penal radio encryption key"
icon_state = "cargo_cypherkey"
channels = list(CHANNEL_PENAL = TRUE)
/obj/item/device/encryptionkey/headset_eng
name = "engineering radio encryption key"
icon_state = "eng_cypherkey"
@@ -90,13 +100,13 @@
/obj/item/device/encryptionkey/heads/captain
name = "captain's encryption key"
icon_state = "cap_cypherkey"
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_ENGINEERING = FALSE, CHANNEL_SCIENCE = FALSE, CHANNEL_MEDICAL = FALSE, CHANNEL_SUPPLY = FALSE, CHANNEL_SERVICE = FALSE)
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_PENAL = TRUE, CHANNEL_ENGINEERING = FALSE, CHANNEL_SCIENCE = FALSE, CHANNEL_MEDICAL = FALSE, CHANNEL_SUPPLY = FALSE, CHANNEL_SERVICE = FALSE)
/obj/item/device/encryptionkey/heads/ai_integrated
name = "ai integrated encryption key"
desc = "Integrated encryption key"
icon_state = "cap_cypherkey"
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_ENGINEERING = TRUE, CHANNEL_SCIENCE = TRUE, CHANNEL_MEDICAL = TRUE, CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE, CHANNEL_AI_PRIVATE = TRUE)
channels = list(CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = TRUE, CHANNEL_PENAL = TRUE, CHANNEL_ENGINEERING = TRUE, CHANNEL_SCIENCE = TRUE, CHANNEL_MEDICAL = TRUE, CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE, CHANNEL_AI_PRIVATE = TRUE)
/obj/item/device/encryptionkey/heads/rd
name = "research director's encryption key"
@@ -106,7 +116,7 @@
/obj/item/device/encryptionkey/heads/hos
name = "head of security's encryption key"
icon_state = "hos_cypherkey"
channels = list(CHANNEL_SECURITY = TRUE, CHANNEL_COMMAND = TRUE)
channels = list(CHANNEL_SECURITY = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_PENAL = TRUE)
/obj/item/device/encryptionkey/heads/ce
name = "chief engineer's encryption key"
@@ -121,7 +131,7 @@
/obj/item/device/encryptionkey/heads/hop
name = "head of personnel's encryption key"
icon_state = "hop_cypherkey"
channels = list(CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = FALSE)
channels = list(CHANNEL_SUPPLY = TRUE, CHANNEL_SERVICE = TRUE, CHANNEL_COMMAND = TRUE, CHANNEL_SECURITY = FALSE, CHANNEL_PENAL = FALSE)
/obj/item/device/encryptionkey/headset_cargo
name = "supply radio encryption key"

View File

@@ -315,6 +315,23 @@
icon_state = "sec_headset_alt"
item_state = "headset_alt"
/obj/item/device/radio/headset/headset_warden
name = "warden radio headset"
desc = "This is used by your all-powerful overseer."
icon_state = "sec_headset"
ks2type = /obj/item/device/encryptionkey/headset_warden
/obj/item/device/radio/headset/headset_warden/alt
name = "warden bowman headset"
icon_state = "sec_headset_alt"
item_state = "headset_alt"
/obj/item/device/radio/headset/headset_penal
name = "penal radio headset"
desc = "A headset used by people who have chosen or been chosen to work the fields."
icon_state = "mine_headset"
ks2type = /obj/item/device/encryptionkey/headset_penal
/obj/item/device/radio/headset/heads/hos
name = "head of security's headset"
desc = "The headset of the man who protects your worthless lifes."

View File

@@ -10,6 +10,7 @@ var/global/list/default_internal_channels = list(
num2text(MED_I_FREQ)=list(access_medical_equip),
num2text(SEC_FREQ) = list(access_security),
num2text(SEC_I_FREQ)=list(access_security),
num2text(PEN_FREQ) = list(access_armory),
num2text(SCI_FREQ) = list(access_tox,access_robotics,access_xenobiology),
num2text(SUP_FREQ) = list(access_cargo),
num2text(SRV_FREQ) = list(access_janitor, access_hydroponics)

View File

@@ -219,8 +219,8 @@
new /obj/item/clothing/gloves/black_leather(src)
//Tools
new /obj/item/cartridge/security(src)
new /obj/item/device/radio/headset/headset_sec(src)
new /obj/item/device/radio/headset/headset_sec/alt(src)
new /obj/item/device/radio/headset/headset_warden(src)
new /obj/item/device/radio/headset/headset_warden/alt(src)
new /obj/item/clothing/glasses/sunglasses/sechud/aviator(src)
new /obj/item/clothing/glasses/sunglasses/sechud(src)
new /obj/item/taperoll/police(src)

View File

@@ -0,0 +1,176 @@
/obj/structure/reagent_crystal
name = "chemical crystal cluster"
desc = "A cluster of hardened chemical crystals."
icon = 'icons/obj/crystals.dmi'
icon_state = "scattered"
anchored = TRUE
density = FALSE
layer = ABOVE_CABLE_LAYER
var/datum/reagent/reagent_id
var/state = 0
var/health = 100
var/mine_rate = 1 // how fast you can mine it
var/obj/machinery/power/crystal_agitator/creator // used to re-add dense turfs to agitation list when destroyed
/obj/structure/reagent_crystal/Initialize(mapload, var/reagent_i = null, var/our_creator = null)
. = ..()
if(!reagent_i)
var/list/chems = list(/datum/reagent/acetone, /datum/reagent/aluminum, /datum/reagent/ammonia, /datum/reagent/carbon, /datum/reagent/copper, /datum/reagent/iron, /datum/reagent/lithium, /datum/reagent/mercury, /datum/reagent/potassium, /datum/reagent/radium, /datum/reagent/sodium)
reagent_i = pick(chems)
reagent_id = reagent_i
name = replacetext(name, "chemical", lowertext(initial(reagent_id.name)))
desc = replacetext(desc, "chemical", lowertext(initial(reagent_id.name)))
var/mutable_appearance/crystal_overlay = mutable_appearance(icon, "[initial(icon_state)]-overlay")
crystal_overlay.color = initial(reagent_id.color)
add_overlay(crystal_overlay)
if(our_creator)
creator = our_creator
/obj/structure/reagent_crystal/examine(mob/user)
. = ..()
var/state
var/current_damage = health / initial(health)
switch(current_damage)
if(0 to 0.2)
state = SPAN_DANGER("The crystal is barely holding together!")
if(0.2 to 0.4)
state = SPAN_WARNING("The crystal has various cracks visible!")
if(0.4 to 0.8)
state = SPAN_WARNING("The crystal has scratches and deeper grooves on its surface.")
if(0.8 to 1)
state = SPAN_NOTICE("The crystal looks structurally sound.")
to_chat(user, state)
/obj/structure/reagent_crystal/proc/take_damage(var/damage)
health -= damage
if(health <= 0)
visible_message(SPAN_WARNING("\The [src] collapses into smaller crystals!"))
harvest()
/obj/structure/reagent_crystal/attack_hand(mob/user)
if(HULK in user.mutations)
user.visible_message(SPAN_WARNING("\The [user] smashes \the [src] apart!"), SPAN_WARNING("You smash \the [src] apart!"))
harvest()
return
return ..()
/obj/structure/reagent_crystal/attackby(obj/item/W, mob/user)
if(istype(W, /obj/item/gun/energy/plasmacutter))
mine_crystal(user, 30 / W.toolspeed, W.usesound)
else if(istype(W, /obj/item/melee/energy))
var/obj/item/melee/energy/WT = W
if(WT.active)
mine_crystal(user, 30 / W.toolspeed, W.usesound)
else
to_chat(user, SPAN_NOTICE("You need to activate \the [W] to do that!"))
return
else if(istype(W, /obj/item/melee/energy/blade))
mine_crystal(user, 30 / W.toolspeed, W.usesound)
else if(istype(W, /obj/item/pickaxe))
var/obj/item/pickaxe/P = W
mine_crystal(user, P.digspeed, W.usesound)
else if(W.force > 5)
user.do_attack_animation(src)
playsound(get_turf(src), 'sound/weapons/smash.ogg', 50)
visible_message(SPAN_WARNING("\The [user] smashes \the [W] into \the [src]."))
take_damage(W.force * 4)
/obj/structure/reagent_crystal/proc/mine_crystal(var/mob/user, var/time_to_dig, var/use_sound)
if(!user)
return
if(!time_to_dig)
time_to_dig = 50
if(do_after(user, time_to_dig * mine_rate, act_target = src))
if(!src)
return
harvest()
if(use_sound)
playsound(get_turf(src), use_sound, 30, TRUE)
/obj/structure/reagent_crystal/proc/harvest()
new /obj/item/reagent_crystal(get_turf(src), reagent_id, 5)
qdel(src)
/obj/structure/reagent_crystal/ex_act(severity)
switch(severity)
if(1.0)
qdel(src)
return
if(2.0)
if(prob(30))
harvest()
return
else
health -= rand(60,180)
if(3.0)
if(prob(5))
harvest()
return
else
health -= rand(40,80)
else
if(health <= 0)
harvest()
return
/obj/structure/reagent_crystal/attack_generic(var/mob/user, var/damage, var/attack_message = "smashes apart", var/wallbreaker)
if(!damage || !wallbreaker)
return FALSE
user.do_attack_animation(src)
visible_message(SPAN_WARNING("\The [user] [attack_message] \the [src]!"))
harvest()
return TRUE
/obj/structure/reagent_crystal/proc/become_dense()
var/health_mod = health / initial(health)
var/obj/structure/reagent_crystal/dense/P = new /obj/structure/reagent_crystal/dense(get_turf(src), reagent_id, creator)
P.health *= health_mod
if(creator)
creator.agitation_turfs -= get_turf(src)
qdel(src)
/obj/structure/reagent_crystal/dense
name = "dense chemical crystal cluster"
desc = "A dense cluster of hardened chemical crystals."
icon_state = "dense"
health = 200
mine_rate = 2
/obj/structure/reagent_crystal/dense/harvest()
var/turf/our_turf = get_turf(src)
for(var/i = 0 to 2)
new /obj/item/reagent_crystal(our_turf, reagent_id, 5)
if(creator)
creator.agitation_turfs += our_turf
qdel(src)
/obj/item/reagent_crystal
name = "crystal"
desc = "A clear, pointy crystal. It looks rough, unprocessed."
icon = 'icons/obj/crystals.dmi'
icon_state = "crystal"
/obj/item/reagent_crystal/Initialize(mapload, reagent_i, amount)
. = ..()
create_reagents(5)
reagents.add_reagent(reagent_i, amount)
var/datum/reagent/R = new reagent_i
name = "[lowertext(R.name)] crystal"
desc = "A [lowertext(R.name)] crystal. It looks rough, unprocessed."
desc_info = "This crystal can be grinded to obtain the chemical material locked within."
color = reagents.get_color()
/obj/item/storage/bag/crystal
name = "crystal satchel"
desc = "This big boy can store a vast amount of crystals."
icon = 'icons/obj/mining.dmi'
icon_state = "satchel"
slot_flags = SLOT_BELT | SLOT_POCKET
max_storage_space = 100
can_hold = list(/obj/item/reagent_crystal)

View File

@@ -1,7 +1,7 @@
/obj/structure/bed/chair/remote/mech
name = "mech control centre"
desc = "A comfortable chair with full audio-visual transposition centres. This one gives you access to exosuits attached to the remote network."
remote_network = "remotemechs"
remote_network = REMOTE_GENERIC_MECH
/obj/structure/bed/chair/remote/mech/user_buckle_mob(mob/user)
..()
@@ -15,7 +15,7 @@
/obj/structure/bed/chair/remote/mech/prison
name = "brig mech control centre"
desc = "A comfortable chair with full audio-visual transposition centres. This one gives you access to exosuits attached to the brig network."
remote_network = "prisonmechs"
remote_network = REMOTE_PRISON_MECH
/obj/structure/bed/chair/remote/mech/prison/portable
portable_type = /obj/item/deployable_kit/remote_mech/brig

View File

@@ -1,7 +1,7 @@
/obj/structure/bed/chair/remote/robot
name = "robot control centre"
desc = "A comfortable chair with full audio-visual transposition centres. This one gives you access to robots attached to the remote network."
remote_network = "remoterobots"
remote_network = REMOTE_GENERIC_ROBOT
/obj/structure/bed/chair/remote/robot/user_buckle_mob(mob/user)
..()
@@ -12,4 +12,14 @@
/obj/structure/bed/chair/remote/robot/bunker
name = "bunker robot control centre"
desc = "A comfortable chair with full audio-visual transposition centres. This one gives you access to robots attached to the bunker network."
remote_network = "bunkerrobots"
remote_network = REMOTE_BUNKER_ROBOT
/obj/structure/bed/chair/remote/robot/prison
name = "penal robot control centre"
desc = "A comfortable chair with full audio-visual transposition centres. This one gives you access to robots attached to the penal network."
remote_network = REMOTE_PRISON_ROBOT
/obj/structure/bed/chair/remote/robot/warden
name = "warden robot control centre"
desc = "A comfortable chair with full audio-visual transposition centres. This one gives you access to robots attached to the warden's network."
remote_network = REMOTE_WARDEN_ROBOT