You have purchased the latest in listening equipment. The telecommunication setup we created is the best in listening to common and private radio fequencies. Here is a step by step guide to start listening in on those saucy radio channels:
Equip yourself with a multi-tool
Use the multitool on each machine, that is the broadcaster, receiver and the relay.
Turn all the machines on, it has already been configured for you to listen on.
Simple as that. Now to listen to the private channels, you'll have to configure the intercoms, located on the front desk. Here is a list of frequencies for you to listen on.
"
- //gamemode
- if(admin || config.allow_vote_mode)
- . += "GameMode"
- else
- . += "GameMode (Disallowed)"
- if(admin)
- . += "\t([config.allow_vote_mode?"Allowed":"Disallowed"])"
+ text += "The vote has ended." // What will be shown if it is a gamemode vote that isn't extended
- . += "
"
+
+
+/datum/controller/vote/Topic(href,href_list[],hsrc)
+ if(!usr || !usr.client)
+ return //not necessary but meh...just in-case somebody does something stupid
+ var/admin = check_rights(R_ADMIN,0)
+ if(href_list["close"])
+ voting -= usr.client
+ return
+ switch(href_list["vote"])
+ if("open")
+ // vote proc will automatically get called after this switch ends
+ if("cancel")
+ if(admin && mode)
+ var/votedesc = capitalize(mode)
+ if(mode == "custom")
+ votedesc += " ([question])"
+ admin_log_and_message_admins("cancelled the running [votedesc] vote.")
+ reset()
+ if("toggle_restart")
+ if(admin)
+ config.allow_vote_restart = !config.allow_vote_restart
+ if("toggle_gamemode")
+ if(admin)
+ config.allow_vote_mode = !config.allow_vote_mode
+ if("restart")
+ if(config.allow_vote_restart || admin)
+ initiate_vote("restart",usr.key)
+ if("gamemode")
+ if(config.allow_vote_mode || admin)
+ initiate_vote("gamemode",usr.key)
+ if("crew_transfer")
+ if(config.allow_vote_restart || admin)
+ initiate_vote("crew_transfer",usr.key)
+ if("custom")
+ if(admin)
+ initiate_vote("custom",usr.key)
+ else
+ submit_vote(usr.ckey, round(text2num(href_list["vote"])))
+ update_panel(usr.client)
+ return
+ usr.vote()
/mob/verb/vote()
@@ -355,4 +410,4 @@ datum/controller/vote
set name = "Vote"
if(vote)
- src << browse(vote.interface(client),"window=vote;can_close=0")
+ vote.browse_to(client)
diff --git a/code/datums/action.dm b/code/datums/action.dm
new file mode 100644
index 00000000000..2f7e6296f80
--- /dev/null
+++ b/code/datums/action.dm
@@ -0,0 +1,410 @@
+#define AB_CHECK_RESTRAINED 1
+#define AB_CHECK_STUNNED 2
+#define AB_CHECK_LYING 4
+#define AB_CHECK_CONSCIOUS 8
+
+
+/datum/action
+ var/name = "Generic Action"
+ var/desc = null
+ var/obj/target = null
+ var/check_flags = 0
+ var/processing = 0
+ var/obj/screen/movable/action_button/button = null
+ var/button_icon = 'icons/mob/actions.dmi'
+ var/background_icon_state = "bg_default"
+
+ var/icon_icon = 'icons/mob/actions.dmi'
+ var/button_icon_state = "default"
+ var/mob/owner
+
+/datum/action/New(var/Target)
+ target = Target
+ button = new
+ button.linked_action = src
+ button.name = name
+
+/datum/action/Destroy()
+ if(owner)
+ Remove(owner)
+ if(target)
+ target = null
+ qdel(button)
+ button = null
+ return ..()
+
+/datum/action/proc/Grant(mob/M)
+ if(owner)
+ if(owner == M)
+ return
+ Remove(owner)
+ owner = M
+ M.actions += src
+ if(M.client)
+ M.client.screen += button
+ M.update_action_buttons()
+
+/datum/action/proc/Remove(mob/M)
+ if(M.client)
+ M.client.screen -= button
+ button.moved = FALSE //so the button appears in its normal position when given to another owner.
+ M.actions -= src
+ M.update_action_buttons()
+ owner = null
+
+/datum/action/proc/Trigger()
+ if(!IsAvailable())
+ return 0
+ return 1
+
+/datum/action/proc/Process()
+ return
+
+/datum/action/proc/IsAvailable()// returns 1 if all checks pass
+ if(!owner)
+ return 0
+ if(check_flags & AB_CHECK_RESTRAINED)
+ if(owner.restrained())
+ return 0
+ if(check_flags & AB_CHECK_STUNNED)
+ if(owner.stunned || owner.weakened)
+ return 0
+ if(check_flags & AB_CHECK_LYING)
+ if(owner.lying)
+ return 0
+ if(check_flags & AB_CHECK_CONSCIOUS)
+ if(owner.stat)
+ return 0
+ return 1
+
+/datum/action/proc/UpdateButtonIcon()
+ if(button)
+ button.icon = button_icon
+ button.icon_state = background_icon_state
+
+ ApplyIcon(button)
+
+ if(!IsAvailable())
+ button.color = rgb(128,0,0,128)
+ else
+ button.color = rgb(255,255,255,255)
+ return 1
+
+/datum/action/proc/ApplyIcon(obj/screen/movable/action_button/current_button)
+ current_button.overlays.Cut()
+ if(icon_icon && button_icon_state)
+ var/image/img
+ img = image(icon_icon, current_button, button_icon_state)
+ img.pixel_x = 0
+ img.pixel_y = 0
+ current_button.overlays += img
+
+//Presets for item actions
+/datum/action/item_action
+ check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_CONSCIOUS
+
+/datum/action/item_action/New(Target)
+ ..()
+ var/obj/item/I = target
+ I.actions += src
+
+/datum/action/item_action/Destroy()
+ var/obj/item/I = target
+ I.actions -= src
+ return ..()
+
+/datum/action/item_action/Trigger()
+ if(!..())
+ return 0
+ if(target)
+ var/obj/item/I = target
+ I.ui_action_click(owner, type)
+ return 1
+
+/datum/action/item_action/ApplyIcon(obj/screen/movable/action_button/current_button)
+ current_button.overlays.Cut()
+ if(target)
+ var/obj/item/I = target
+ var/old_layer = I.layer
+ var/old_plane = I.plane
+ I.layer = 21
+ I.plane = HUD_PLANE
+ current_button.overlays += I
+ I.layer = old_layer
+ I.plane = old_plane
+
+/datum/action/item_action/toggle_light
+ name = "Toggle Light"
+
+/datum/action/item_action/toggle_hood
+ name = "Toggle Hood"
+
+/datum/action/item_action/toggle_firemode
+ name = "Toggle Firemode"
+
+/datum/action/item_action/startchainsaw
+ name = "Pull The Starting Cord"
+
+/datum/action/item_action/toggle_gunlight
+ name = "Toggle Gunlight"
+
+/datum/action/item_action/toggle_mode
+ name = "Toggle Mode"
+
+/datum/action/item_action/toggle_barrier_spread
+ name = "Toggle Barrier Spread"
+
+/datum/action/item_action/equip_unequip_TED_Gun
+ name = "Equip/Unequip TED Gun"
+
+/datum/action/item_action/toggle_paddles
+ name = "Toggle Paddles"
+
+/datum/action/item_action/set_internals
+ name = "Set Internals"
+
+/datum/action/item_action/set_internals/UpdateButtonIcon()
+ if(..()) //button available
+ if(iscarbon(owner))
+ var/mob/living/carbon/C = owner
+ if(target == C.internal)
+ button.icon_state = "bg_default_on"
+
+/datum/action/item_action/toggle_mister
+ name = "Toggle Mister"
+
+/datum/action/item_action/toggle_helmet_light
+ name = "Toggle Helmet Light"
+
+/datum/action/item_action/toggle_helmet_mode
+ name = "Toggle Helmet Mode"
+
+/datum/action/item_action/toggle_hardsuit_mode
+ name = "Toggle Hardsuit Mode"
+
+/datum/action/item_action/toggle
+
+/datum/action/item_action/toggle/New(Target)
+ ..()
+ name = "Toggle [target.name]"
+ button.name = name
+
+/datum/action/item_action/openclose
+
+/datum/action/item_action/openclose/New(Target)
+ ..()
+ name = "Open/Close [target.name]"
+ button.name = name
+
+/datum/action/item_action/button
+
+/datum/action/item_action/button/New(Target)
+ ..()
+ name = "Button/Unbutton [target.name]"
+ button.name = name
+
+/datum/action/item_action/zipper
+
+/datum/action/item_action/zipper/New(Target)
+ ..()
+ name = "Zip/Unzip [target.name]"
+ button.name = name
+
+/datum/action/item_action/halt
+ name = "HALT!"
+
+/datum/action/item_action/hoot
+ name = "Hoot"
+
+/datum/action/item_action/caw
+ name = "Caw"
+
+/datum/action/item_action/toggle_voice_box
+ name = "Toggle Voice Box"
+
+/datum/action/item_action/change
+ name = "Change"
+
+/datum/action/item_action/noir
+ name = "Noir"
+
+/datum/action/item_action/YEEEAAAAAHHHHHHHHHHHHH
+ name = "YEAH!"
+
+/datum/action/item_action/adjust
+
+/datum/action/item_action/adjust/New(Target)
+ ..()
+ name = "Adjust [target.name]"
+ button.name = name
+
+/datum/action/item_action/switch_hud
+ name = "Switch HUD"
+
+/datum/action/item_action/toggle_wings
+ name = "Toggle Wings"
+
+/datum/action/item_action/toggle_helmet
+ name = "Toggle Helmet"
+
+/datum/action/item_action/toggle_jetpack
+ name = "Toggle Jetpack"
+
+/datum/action/item_action/jetpack_stabilization
+ name = "Toggle Jetpack Stabilization"
+
+/datum/action/item_action/jetpack_stabilization/IsAvailable()
+ var/obj/item/weapon/tank/jetpack/J = target
+ if(!istype(J) || !J.on)
+ return 0
+ return ..()
+
+/datum/action/item_action/hands_free
+ check_flags = AB_CHECK_CONSCIOUS
+
+/datum/action/item_action/hands_free/activate
+ name = "Activate"
+
+/datum/action/item_action/toggle_research_scanner
+ name = "Toggle Research Scanner"
+ button_icon_state = "scan_mode"
+
+/datum/action/item_action/toggle_research_scanner/Trigger()
+ if(IsAvailable())
+ owner.research_scanner = !owner.research_scanner
+ to_chat(owner, "Research analyzer is now [owner.research_scanner ? "active" : "deactivated"].")
+ return 1
+
+/datum/action/item_action/toggle_research_scanner/Remove(mob/living/L)
+ if(owner)
+ owner.research_scanner = 0
+ ..()
+
+/datum/action/item_action/toggle_research_scanner/ApplyIcon(obj/screen/movable/action_button/current_button)
+ current_button.overlays.Cut()
+ if(button_icon && button_icon_state)
+ var/image/img = image(button_icon, current_button, "scan_mode")
+ current_button.overlays += img
+
+/datum/action/item_action/remove_badge
+ name = "Remove Holobadge"
+
+///prset for organ actions
+/datum/action/item_action/organ_action
+ check_flags = AB_CHECK_CONSCIOUS
+
+/datum/action/item_action/organ_action/IsAvailable()
+ var/obj/item/organ/internal/I = target
+ if(!I.owner)
+ return 0
+ return ..()
+
+/datum/action/item_action/organ_action/toggle
+
+/datum/action/item_action/organ_action/toggle/New(Target)
+ ..()
+ name = "Toggle [target.name]"
+ button.name = name
+
+// for clothing accessories like holsters
+/datum/action/item_action/accessory
+ check_flags = AB_CHECK_RESTRAINED|AB_CHECK_STUNNED|AB_CHECK_LYING|AB_CHECK_CONSCIOUS
+
+/datum/action/item_action/accessory/IsAvailable()
+ . = ..()
+ if(!.)
+ return 0
+ if(target.loc == owner)
+ return 1
+ if(istype(target.loc, /obj/item/clothing/under) && target.loc.loc == owner)
+ return 1
+ return 0
+
+/datum/action/item_action/accessory/holster
+ name = "Holster"
+
+/datum/action/item_action/accessory/storage
+ name = "View Storage"
+
+
+//Preset for spells
+/datum/action/spell_action
+ check_flags = 0
+ background_icon_state = "bg_spell"
+
+/datum/action/spell_action/New(Target)
+ ..()
+ var/obj/effect/proc_holder/spell/S = target
+ S.action = src
+ name = S.name
+ button_icon = S.action_icon
+ button_icon_state = S.action_icon_state
+ background_icon_state = S.action_background_icon_state
+ button.name = name
+
+/datum/action/spell_action/Destroy()
+ var/obj/effect/proc_holder/spell/S = target
+ S.action = null
+ return ..()
+
+/datum/action/spell_action/Trigger()
+ if(!..())
+ return 0
+ if(target)
+ var/obj/effect/proc_holder/spell = target
+ spell.Click()
+ return 1
+
+/datum/action/spell_action/IsAvailable()
+ if(!target)
+ return 0
+ var/obj/effect/proc_holder/spell/spell = target
+
+ if(owner)
+ return spell.can_cast(owner)
+ return 0
+
+/*
+/datum/action/spell_action/alien
+
+/datum/action/spell_action/alien/IsAvailable()
+ if(!target)
+ return 0
+ var/obj/effect/proc_holder/alien/ab = target
+
+ if(owner)
+ return ab.cost_check(ab.check_turf, owner, 1)
+ return 0
+*/
+
+//Preset for general and toggled actions
+/datum/action/innate
+ check_flags = 0
+ var/active = 0
+
+/datum/action/innate/Trigger()
+ if(!..())
+ return 0
+ if(!active)
+ Activate()
+ else
+ Deactivate()
+ return 1
+
+/datum/action/innate/proc/Activate()
+ return
+
+/datum/action/innate/proc/Deactivate()
+ return
+
+//Preset for action that call specific procs (consider innate)
+/datum/action/generic
+ check_flags = 0
+ var/procname
+
+/datum/action/generic/Trigger()
+ if(!..())
+ return 0
+ if(target && procname)
+ call(target,procname)(usr)
+ return 1
diff --git a/code/datums/ai_laws.dm b/code/datums/ai_laws.dm
index 4af13e256fd..0f796798d26 100644
--- a/code/datums/ai_laws.dm
+++ b/code/datums/ai_laws.dm
@@ -83,17 +83,17 @@ var/global/const/base_law_type = /datum/ai_laws/nanotrasen
if(full_sync || supplied_laws.len)
S.laws.clear_supplied_laws()
- for (var/datum/ai_law/law in ion_laws)
+ for(var/datum/ai_law/law in ion_laws)
S.laws.add_ion_law(law.law)
- for (var/datum/ai_law/law in inherent_laws)
+ for(var/datum/ai_law/law in inherent_laws)
S.laws.add_inherent_law(law.law)
- for (var/datum/ai_law/law in supplied_laws)
+ for(var/datum/ai_law/law in supplied_laws)
if(law)
S.laws.add_supplied_law(law.index, law.law)
/mob/living/silicon/proc/sync_zeroth(var/datum/ai_law/zeroth_law, var/datum/ai_law/zeroth_law_borg)
- if (!is_special_character(src) || mind.original != src)
+ if(!is_special_character(src) || mind.original != src)
if(zeroth_law_borg)
laws.set_zeroth_law(zeroth_law_borg.law)
else if(zeroth_law)
@@ -159,7 +159,7 @@ var/global/const/base_law_type = /datum/ai_laws/nanotrasen
if(supplied_laws.len >= number && supplied_laws[number])
delete_law(supplied_laws[number])
- while (src.supplied_laws.len < number)
+ while(src.supplied_laws.len < number)
src.supplied_laws += ""
if(state_supplied.len < supplied_laws.len)
state_supplied += 1
diff --git a/code/datums/browser.dm b/code/datums/browser.dm
index e8f17f17ad0..85f8e52e89d 100644
--- a/code/datums/browser.dm
+++ b/code/datums/browser.dm
@@ -20,13 +20,13 @@
user = nuser
window_id = nwindow_id
- if (ntitle)
+ if(ntitle)
title = format_text(ntitle)
- if (nwidth)
+ if(nwidth)
width = nwidth
- if (nheight)
+ if(nheight)
height = nheight
- if (nref)
+ if(nref)
ref = nref
add_stylesheet("common", 'html/browser/common.css') // this CSS sheet is common to all UIs
@@ -60,18 +60,18 @@
/datum/browser/proc/get_header()
var/key
var/filename
- for (key in stylesheets)
+ for(key in stylesheets)
filename = "[ckey(key)].css"
user << browse_rsc(stylesheets[key], filename)
head_content += ""
- for (key in scripts)
+ for(key in scripts)
filename = "[ckey(key)].js"
user << browse_rsc(scripts[key], filename)
head_content += ""
var/title_attributes = "class='uiTitle'"
- if (title_image)
+ if(title_image)
title_attributes = "class='uiTitle icon' style='background-image: url([title_image]);'"
return {"
@@ -103,10 +103,10 @@
/datum/browser/proc/open(var/use_onclose = 1)
var/window_size = ""
- if (width && height)
+ if(width && height)
window_size = "size=[width]x[height];"
user << browse(get_content(), "window=[window_id];[window_size][window_options]")
- if (use_onclose)
+ if(use_onclose)
onclose(user, window_id, ref)
/datum/browser/proc/close()
@@ -118,7 +118,7 @@
/mob/proc/browse_rsc_icon(icon, icon_state, dir = -1)
/*
var/icon/I
- if (dir >= 0)
+ if(dir >= 0)
I = new /icon(icon, icon_state, dir)
else
I = new /icon(icon, icon_state)
diff --git a/code/datums/cache/apc.dm b/code/datums/cache/apc.dm
index f50b0a8e121..4271886ac4b 100644
--- a/code/datums/cache/apc.dm
+++ b/code/datums/cache/apc.dm
@@ -11,7 +11,7 @@ var/global/datum/repository/apc/apc_repository = new()
if(world.time < cache_entry.timestamp)
return cache_entry.data
- if (powermonitor && !isnull(powermonitor.powernet))
+ if(powermonitor && !isnull(powermonitor.powernet))
var/list/L = list()
for(var/obj/machinery/power/terminal/term in powermonitor.powernet.nodes)
if(istype(term.master, /obj/machinery/power/apc))
diff --git a/code/datums/cache/crew.dm b/code/datums/cache/crew.dm
index 0afb70a4404..2912b8c6753 100644
--- a/code/datums/cache/crew.dm
+++ b/code/datums/cache/crew.dm
@@ -62,6 +62,6 @@ var/global/datum/repository/crew/crew_repository = new()
for(var/mob/living/carbon/human/H in mob_list)
if(istype(H.w_uniform, /obj/item/clothing/under))
var/obj/item/clothing/under/C = H.w_uniform
- if (C.has_sensor)
+ if(C.has_sensor)
tracked |= C
return tracked
diff --git a/code/datums/cargoprofile.dm b/code/datums/cargoprofile.dm
index 40a065e5bad..91a4420b31c 100644
--- a/code/datums/cargoprofile.dm
+++ b/code/datums/cargoprofile.dm
@@ -156,7 +156,7 @@
blacklist = null
whitelist = list(/obj/item/weapon/tank,/obj/item/weapon/reagent_containers,
/obj/item/stack/medical,/obj/item/weapon/storage/pill_bottle,/obj/item/weapon/gun/syringe,
- /obj/item/weapon/c4,/obj/item/weapon/grenade,/obj/item/ammo_box,
+ /obj/item/weapon/grenade/plastic/c4,/obj/item/weapon/grenade,/obj/item/ammo_box,
/obj/item/weapon/gun/grenadelauncher,/obj/item/weapon/flamethrower, /obj/item/weapon/lighter,
/obj/item/weapon/match,/obj/item/weapon/weldingtool)
@@ -258,7 +258,7 @@
whitelist = list(/obj/item/weapon/banhammer,/obj/item/weapon/sord,/obj/item/weapon/claymore,/obj/item/weapon/holo/esword,
/obj/item/weapon/flamethrower,/obj/item/weapon/grenade,/obj/item/weapon/gun,/obj/item/weapon/hatchet,/obj/item/weapon/katana,
/obj/item/weapon/kitchen/knife,/obj/item/weapon/melee,/obj/item/weapon/nullrod,/obj/item/weapon/pickaxe,/obj/item/weapon/twohanded,
- /obj/item/weapon/c4,/obj/item/weapon/scalpel,/obj/item/weapon/shield,/obj/item/weapon/grown/nettle/death)
+ /obj/item/weapon/grenade/plastic/c4,/obj/item/weapon/scalpel,/obj/item/weapon/shield,/obj/item/weapon/grown/nettle/death)
/datum/cargoprofile/tools
name = "Devices & Tools"
diff --git a/code/datums/datacore.dm b/code/datums/datacore.dm
index d07b6e3eb73..f9c3ce39b08 100644
--- a/code/datums/datacore.dm
+++ b/code/datums/datacore.dm
@@ -17,7 +17,7 @@
var/real_title = assignment
for(var/datum/data/record/t in data_core.general)
- if (t)
+ if(t)
if(t.fields["name"] == name)
foundrecord = t
break
@@ -66,6 +66,8 @@
G.fields["sex"] = capitalize(H.gender)
G.fields["species"] = H.get_species()
G.fields["photo"] = get_id_photo(H)
+ G.fields["photo-south"] = "'data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = SOUTH))]'"
+ G.fields["photo-west"] = "'data:image/png;base64,[icon2base64(icon(G.fields["photo"], dir = WEST))]'"
if(H.gen_record && !jobban_isbanned(H, "Records"))
G.fields["notes"] = H.gen_record
else
@@ -129,7 +131,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
var/obj/item/organ/external/head/head_organ = H.get_organ("head")
var/g = "m"
- if (H.gender == FEMALE)
+ if(H.gender == FEMALE)
g = "f"
var/icon/icobase = H.species.icobase
@@ -151,7 +153,7 @@ proc/get_id_photo(var/mob/living/carbon/human/H)
// Skin tone
if(H.species.bodyflags & HAS_SKIN_TONE)
- if (H.s_tone >= 0)
+ if(H.s_tone >= 0)
preview_icon.Blend(rgb(H.s_tone, H.s_tone, H.s_tone), ICON_ADD)
else
preview_icon.Blend(rgb(-H.s_tone, -H.s_tone, -H.s_tone), ICON_SUBTRACT)
diff --git a/code/datums/datumvars.dm b/code/datums/datumvars.dm
index eeb26f5f6f2..586cf8af512 100644
--- a/code/datums/datumvars.dm
+++ b/code/datums/datumvars.dm
@@ -20,17 +20,16 @@
title = "[A.name] (\ref[A]) = [A.type]"
#ifdef VARSICON
- if (A.icon)
+ if(A.icon)
body += debug_variable("icon", new/icon(A.icon, A.icon_state, A.dir), 0)
#endif
- var/icon/sprite
+ var/sprite
if(istype(D,/atom))
var/atom/AT = D
if(AT.icon && AT.icon_state)
- sprite = new /icon(AT.icon, AT.icon_state)
- usr << browse_rsc(sprite, "view_vars_sprite.png")
+ sprite = 1
title = "[D] (\ref[D]) = [D.type]"
@@ -43,11 +42,11 @@
if(event.keyCode == 13){ //Enter / return
var vars_ol = document.getElementById('vars');
var lis = vars_ol.getElementsByTagName("li");
- for ( var i = 0; i < lis.length; ++i )
+ for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
- if ( li.style.backgroundColor == "#ffee88" )
+ if( li.style.backgroundColor == "#ffee88" )
{
alist = lis\[i\].getElementsByTagName("a")
if(alist.length > 0){
@@ -62,11 +61,11 @@
if(event.keyCode == 38){ //Up arrow
var vars_ol = document.getElementById('vars');
var lis = vars_ol.getElementsByTagName("li");
- for ( var i = 0; i < lis.length; ++i )
+ for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
- if ( li.style.backgroundColor == "#ffee88" )
+ if( li.style.backgroundColor == "#ffee88" )
{
if( (i-1) >= 0){
var li_new = lis\[i-1\];
@@ -83,11 +82,11 @@
if(event.keyCode == 40){ //Down arrow
var vars_ol = document.getElementById('vars');
var lis = vars_ol.getElementsByTagName("li");
- for ( var i = 0; i < lis.length; ++i )
+ for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
- if ( li.style.backgroundColor == "#ffee88" )
+ if( li.style.backgroundColor == "#ffee88" )
{
if( (i+1) < lis.length){
var li_new = lis\[i+1\];
@@ -113,11 +112,11 @@
var vars_ol = document.getElementById('vars');
var lis = vars_ol.getElementsByTagName("li");
- for ( var i = 0; i < lis.length; ++i )
+ for( var i = 0; i < lis.length; ++i )
{
try{
var li = lis\[i\];
- if ( li.innerText.toLowerCase().indexOf(filter) == -1 )
+ if( li.innerText.toLowerCase().indexOf(filter) == -1 )
{
vars_ol.removeChild(li);
i--;
@@ -126,10 +125,10 @@
}
}
var lis_new = vars_ol.getElementsByTagName("li");
- for ( var j = 0; j < lis_new.length; ++j )
+ for( var j = 0; j < lis_new.length; ++j )
{
var li1 = lis\[j\];
- if (j == 0){
+ if(j == 0){
li1.style.backgroundColor = "#ffee88";
}else{
li1.style.backgroundColor = "white";
@@ -162,7 +161,7 @@
body += "
"
if(sprite)
- body += "
"
+ body += "
[bicon(D)]
"
else
body += "
"
@@ -234,6 +233,7 @@
body += ""
body += ""
+ body += ""
if(ismob(D))
body += ""
@@ -293,18 +293,18 @@
body += ""
var/list/names = list()
- for (var/V in D.vars)
+ for(var/V in D.vars)
names += V
names = sortList(names)
- for (var/V in names)
+ for(var/V in names)
body += debug_variable(V, D.vars[V], 0, D)
body += ""
var/html = ""
- if (title)
+ if(title)
html += "[title]"
html += {"
-
-
-
[name]
[show_sensors ? "
Sensor Data:
" + sensor_data : ""]
"}
diff --git a/code/game/machinery/atmoalter/area_atmos_computer.dm b/code/game/machinery/atmoalter/area_atmos_computer.dm
index 0b1be444c7c..89cf4cd3610 100644
--- a/code/game/machinery/atmoalter/area_atmos_computer.dm
+++ b/code/game/machinery/atmoalter/area_atmos_computer.dm
@@ -85,7 +85,9 @@
[zone]
"}
- user << browse("[dat]", "window=miningshuttle;size=400x400")
+ var/datum/browser/popup = new(user, "area_atmos", name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
status = ""
Topic(href, href_list)
diff --git a/code/game/machinery/atmoalter/canister.dm b/code/game/machinery/atmoalter/canister.dm
index 14b3ca3fc59..7eb01d06988 100644
--- a/code/game/machinery/atmoalter/canister.dm
+++ b/code/game/machinery/atmoalter/canister.dm
@@ -178,7 +178,7 @@ update_flag
(note: colors and decals has to be applied every icon update)
*/
- if (src.destroyed)
+ if(src.destroyed)
src.overlays = 0
src.icon_state = text("[]-1", src.canister_color["prim"])//yes, I KNOW the colours don't reflect when the can's borked, whatever.
@@ -217,27 +217,27 @@ update_flag
//template modification exploit prevention, used in Topic()
/obj/machinery/portable_atmospherics/canister/proc/is_a_color(var/inputVar, var/checkColor = "all")
- if (checkColor == "prim" || checkColor == "all")
+ if(checkColor == "prim" || checkColor == "all")
for(var/list/L in canister_icon_container.possiblemaincolor)
- if (L["icon"] == inputVar)
+ if(L["icon"] == inputVar)
return 1
- if (checkColor == "sec" || checkColor == "all")
+ if(checkColor == "sec" || checkColor == "all")
for(var/list/L in canister_icon_container.possibleseccolor)
- if (L["icon"] == inputVar)
+ if(L["icon"] == inputVar)
return 1
- if (checkColor == "ter" || checkColor == "all")
+ if(checkColor == "ter" || checkColor == "all")
for(var/list/L in canister_icon_container.possibletertcolor)
- if (L["icon"] == inputVar)
+ if(L["icon"] == inputVar)
return 1
- if (checkColor == "quart" || checkColor == "all")
+ if(checkColor == "quart" || checkColor == "all")
for(var/list/L in canister_icon_container.possiblequartcolor)
- if (L["icon"] == inputVar)
+ if(L["icon"] == inputVar)
return 1
return 0
/obj/machinery/portable_atmospherics/canister/proc/is_a_decal(var/inputVar)
for(var/list/L in canister_icon_container.possibledecals)
- if (L["icon"] == inputVar)
+ if(L["icon"] == inputVar)
return 1
return 0
@@ -250,7 +250,7 @@ update_flag
if(destroyed)
return 1
- if (src.health <= 10)
+ if(src.health <= 10)
var/atom/location = src.loc
location.assume_air(air_contents)
air_update_turf()
@@ -260,7 +260,7 @@ update_flag
src.density = 0
update_icon()
- if (src.holding)
+ if(src.holding)
src.holding.loc = src.loc
src.holding = null
@@ -269,7 +269,7 @@ update_flag
return 1
/obj/machinery/portable_atmospherics/canister/process()
- if (destroyed)
+ if(destroyed)
return
..()
@@ -383,7 +383,7 @@ update_flag
return src.ui_interact(user)
/obj/machinery/portable_atmospherics/canister/ui_interact(mob/user, ui_key = "main", var/datum/nanoui/ui = null, var/force_open = 1)
- if (src.destroyed)
+ if(src.destroyed)
return
init_data_vars() //set up var/colorcontainer and var/possibledecals
@@ -404,12 +404,12 @@ update_flag
data["valveOpen"] = valve_open ? 1 : 0
data["hasHoldingTank"] = holding ? 1 : 0
- if (holding)
+ if(holding)
data["holdingTank"] = list("name" = holding.name, "tankPressure" = round(holding.air_contents.return_pressure()))
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "canister.tmpl", "Canister", 480, 400, state = physical_state)
@@ -428,18 +428,18 @@ update_flag
if(..())
return 1
- if (href_list["choice"] == "menu")
+ if(href_list["choice"] == "menu")
menu = text2num(href_list["mode_target"])
if(href_list["toggle"])
var/logmsg
- if (valve_open)
- if (holding)
+ if(valve_open)
+ if(holding)
logmsg = "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the [holding] "
else
logmsg = "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the air "
else
- if (holding)
+ if(holding)
logmsg = "Valve was opened by [usr] ([usr.ckey]), starting the transfer into the [holding] "
else
logmsg = "Valve was opened by [usr] ([usr.ckey]), starting the transfer into the air "
@@ -454,53 +454,53 @@ update_flag
release_log += logmsg
valve_open = !valve_open
- if (href_list["remove_tank"])
+ if(href_list["remove_tank"])
if(holding)
- if (valve_open)
+ if(valve_open)
valve_open = 0
release_log += "Valve was closed by [usr] ([usr.ckey]), stopping the transfer into the [holding] "
holding.loc = loc
holding = null
- if (href_list["pressure_adj"])
+ if(href_list["pressure_adj"])
var/diff = text2num(href_list["pressure_adj"])
if(diff > 0)
release_pressure = min(10*ONE_ATMOSPHERE, release_pressure+diff)
else
release_pressure = max(ONE_ATMOSPHERE/10, release_pressure+diff)
- if (href_list["rename"])
- if (can_label)
+ if(href_list["rename"])
+ if(can_label)
var/T = sanitize(copytext(input("Choose canister label", "Name", name) as text|null,1,MAX_NAME_LEN))
- if (can_label) //Exploit prevention
- if (T)
+ if(can_label) //Exploit prevention
+ if(T)
name = T
else
name = "canister"
else
to_chat(usr, "\red As you attempted to rename it the pressure rose!")
- if (href_list["choice"] == "Primary color")
- if (is_a_color(href_list["icon"],"prim"))
+ if(href_list["choice"] == "Primary color")
+ if(is_a_color(href_list["icon"],"prim"))
canister_color["prim"] = href_list["icon"]
- if (href_list["choice"] == "Secondary color")
- if (href_list["icon"] == "none")
+ if(href_list["choice"] == "Secondary color")
+ if(href_list["icon"] == "none")
canister_color["sec"] = "none"
- else if (is_a_color(href_list["icon"],"sec"))
+ else if(is_a_color(href_list["icon"],"sec"))
canister_color["sec"] = href_list["icon"]
- if (href_list["choice"] == "Tertiary color")
- if (href_list["icon"] == "none")
+ if(href_list["choice"] == "Tertiary color")
+ if(href_list["icon"] == "none")
canister_color["ter"] = "none"
- else if (is_a_color(href_list["icon"],"ter"))
+ else if(is_a_color(href_list["icon"],"ter"))
canister_color["ter"] = href_list["icon"]
- if (href_list["choice"] == "Quaternary color")
- if (href_list["icon"] == "none")
+ if(href_list["choice"] == "Quaternary color")
+ if(href_list["icon"] == "none")
canister_color["quart"] = "none"
- else if (is_a_color(href_list["icon"],"quart"))
+ else if(is_a_color(href_list["icon"],"quart"))
canister_color["quart"] = href_list["icon"]
- if (href_list["choice"] == "decals")
- if (is_a_decal(href_list["icon"]))
+ if(href_list["choice"] == "decals")
+ if(is_a_decal(href_list["icon"]))
decals[href_list["icon"]] = (decals[href_list["icon"]] == 0)
src.add_fingerprint(usr)
@@ -577,8 +577,8 @@ update_flag
trace_gas.moles = 9*4000
spawn(100)
var/turf/simulated/location = src.loc
- if (istype(src.loc))
- while (!location.air)
+ if(istype(src.loc))
+ while(!location.air)
sleep(1000)
location.assume_air(air_contents)
air_contents = new
diff --git a/code/game/machinery/atmoalter/meter.dm b/code/game/machinery/atmoalter/meter.dm
index b2b7b1efc06..560ad7642b7 100644
--- a/code/game/machinery/atmoalter/meter.dm
+++ b/code/game/machinery/atmoalter/meter.dm
@@ -28,7 +28,8 @@
return ..()
/obj/machinery/meter/initialize()
- if (!target)
+ ..()
+ if(!target)
target = locate(/obj/machinery/atmospherics/pipe) in loc
/obj/machinery/meter/process()
@@ -78,7 +79,7 @@
/obj/machinery/meter/proc/status()
var/t = ""
- if (target)
+ if(target)
var/datum/gas_mixture/environment = target.return_air()
if(environment)
t += "The pressure gauge reads [round(environment.return_pressure(), 0.01)] kPa; [round(environment.temperature,0.01)]°K ([round(environment.temperature-T0C,0.01)]°C)"
@@ -120,11 +121,11 @@
update_multitool_menu(user)
return 1
- if (!istype(W, /obj/item/weapon/wrench))
+ if(!istype(W, /obj/item/weapon/wrench))
return ..()
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, "\blue You begin to unfasten \the [src]...")
- if (do_after(user, 40, target = src))
+ if(do_after(user, 40, target = src))
user.visible_message( \
"[user] unfastens \the [src].", \
"\blue You have unfastened \the [src].", \
@@ -141,8 +142,9 @@
/obj/machinery/meter/turf/initialize()
- if (!target)
+ if(!target)
target = loc
+ ..()
/obj/machinery/meter/turf/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob, params)
return
@@ -153,4 +155,4 @@
"
@@ -501,7 +497,7 @@ What a mess.*/
if("rank")
var/list/L = list( "Head of Personnel", "Captain", "AI" )
//This was so silly before the change. Now it actually works without beating your head against the keyboard. /N
- if ((istype(active1, /datum/data/record) && L.Find(rank)))
+ if((istype(active1, /datum/data/record) && L.Find(rank)))
temp = "
Rank:
"
temp += "
"
for(var/rank in joblist)
@@ -510,9 +506,9 @@ What a mess.*/
else
alert(usr, "You do not have the required rank to do this!")
if("species")
- if (istype(active1, /datum/data/record))
+ if(istype(active1, /datum/data/record))
var/t1 = copytext(trim(sanitize(input("Please enter race:", "General records", active1.fields["species"], null) as message)),1,MAX_MESSAGE_LEN)
- if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
+ if((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!in_range(src, usr) && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["species"] = t1
@@ -520,14 +516,14 @@ What a mess.*/
else//To properly clear as per clear screen.
temp=null
switch(href_list["choice"])
- if ("Change Rank")
- if (active1)
+ if("Change Rank")
+ if(active1)
active1.fields["rank"] = href_list["rank"]
if(href_list["rank"] in joblist)
active1.fields["real_rank"] = href_list["real_rank"]
- if ("Change Criminal Status")
- if (active2)
+ if("Change Criminal Status")
+ if(active2)
switch(href_list["criminal2"])
if("none")
active2.fields["criminal"] = "None"
@@ -543,18 +539,18 @@ What a mess.*/
for(var/mob/living/carbon/human/H in mob_list)
H.sec_hud_set_security_status()
- if ("Delete Record (Security) Execute")
- if (active2)
+ if("Delete Record (Security) Execute")
+ if(active2)
qdel(active2)
- if ("Delete Record (ALL) Execute")
- if (active1)
+ if("Delete Record (ALL) Execute")
+ if(active1)
for(var/datum/data/record/R in data_core.medical)
- if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
+ if((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
qdel(R)
else
qdel(active1)
- if (active2)
+ if(active2)
qdel(active2)
else
temp = "This function does not appear to be working at the moment. Our apologies."
diff --git a/code/game/machinery/computer/skills.dm b/code/game/machinery/computer/skills.dm
index ddcfeed9a74..2f039841cc3 100644
--- a/code/game/machinery/computer/skills.dm
+++ b/code/game/machinery/computer/skills.dm
@@ -40,16 +40,16 @@
/obj/machinery/computer/skills/attack_hand(mob/user as mob)
if(..())
return
- if (src.z > 6)
+ if(src.z > 6)
to_chat(user, "Unable to establish a connection: You're too far away from the station!")
return
var/dat
- if (temp)
+ if(temp)
dat = text("[]
Clear Screen", temp, src)
else
dat = text("Confirm Identity: []", src, (scan ? text("[]", scan.name) : "----------"))
- if (authenticated)
+ if(authenticated)
switch(screen)
if(1.0)
dat += {"
@@ -86,11 +86,7 @@
dat += " Delete All Records
\n", src)
- user << browse(t1, "window=airlock_electronics")
+ var/datum/browser/popup = new(user, "airlock_electronics", name, 400, 400)
+ popup.set_content(t1)
+ popup.open(0)
onclose(user, "airlock")
Topic(href, href_list)
..()
- if (usr.stat || usr.restrained() || (!ishuman(usr) && !istype(usr,/mob/living/silicon)))
+ if(usr.stat || usr.restrained() || (!ishuman(usr) && !istype(usr,/mob/living/silicon)))
return
- if (href_list["close"])
+ if(href_list["close"])
usr << browse(null, "window=airlock")
return
- if (href_list["login"])
+ if(href_list["login"])
if(istype(usr,/mob/living/silicon))
src.locked = 0
src.last_configurator = usr.name
else
var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/device/pda))
+ if(istype(I, /obj/item/device/pda))
var/obj/item/device/pda/pda = I
I = pda.id
- if (I && src.check_access(I))
+ if(I && src.check_access(I))
src.locked = 0
src.last_configurator = I:registered_name
- if (locked)
+ if(locked)
return
- if (href_list["logout"])
+ if(href_list["logout"])
locked = 1
- if (href_list["one_access"])
+ if(href_list["one_access"])
one_access = !one_access
- if (href_list["access"])
+ if(href_list["access"])
toggle_access(href_list["access"])
attack_self(usr)
proc
toggle_access(var/acc)
- if (acc == "all")
+ if(acc == "all")
conf_access = null
else
var/req = text2num(acc)
- if (conf_access == null)
+ if(conf_access == null)
conf_access = list()
- if (!(req in conf_access))
+ if(!(req in conf_access))
conf_access += req
else
conf_access -= req
- if (!conf_access.len)
+ if(!conf_access.len)
conf_access = null
diff --git a/code/game/machinery/doors/brigdoors.dm b/code/game/machinery/doors/brigdoors.dm
index 3e611b8dea4..b0be899942d 100644
--- a/code/game/machinery/doors/brigdoors.dm
+++ b/code/game/machinery/doors/brigdoors.dm
@@ -31,19 +31,19 @@
maptext_height = 26
maptext_width = 32
-/obj/machinery/door_timer/New()
+/obj/machinery/door_timer/initialize()
..()
Radio = new /obj/item/device/radio(src)
Radio.listening = 0
Radio.config(list("Security" = 0))
- pixel_x = ((src.dir & 3)? (0) : (src.dir == 4 ? 32 : -32))
- pixel_y = ((src.dir & 3)? (src.dir ==1 ? 24 : -32) : (0))
+ pixel_x = ((dir & 3)? (0) : (dir == 4 ? 32 : -32))
+ pixel_y = ((dir & 3)? (dir ==1 ? 24 : -32) : (0))
spawn(20)
for(var/obj/machinery/door/window/brigdoor/M in airlocks)
- if (M.id == id)
+ if(M.id == id)
targets += M
for(var/obj/machinery/flasher/F in machines)
@@ -53,7 +53,7 @@
for(var/obj/structure/closet/secure_closet/brig/C in world)
if(C.id == id)
targets += C
-
+
for(var/obj/machinery/treadmill_monitor/T in machines)
if(T.id == id)
targets += T
@@ -61,15 +61,14 @@
if(targets.len==0)
stat |= BROKEN
update_icon()
- return
- return
//Main door timer loop, if it's timing and time is >0 reduce time by 1.
// if it's less than 0, open door, reset timer
// update the door_timer window and the icon
/obj/machinery/door_timer/process()
- if(stat & (NOPOWER|BROKEN)) return
+ if(stat & (NOPOWER|BROKEN))
+ return
if(timing)
if(timeleft() <= 0)
Radio.autosay("Timer has expired. Releasing prisoner.", name, "Security", list(z))
@@ -77,8 +76,8 @@
timing = 0
. = PROCESS_KILL
- src.updateUsrDialog()
- src.update_icon()
+ updateUsrDialog()
+ update_icon()
else
timer_end()
return PROCESS_KILL
@@ -87,7 +86,6 @@
/obj/machinery/door_timer/power_change()
..()
update_icon()
- return
// open/closedoor checks if door_timer has power, if so it checks if the
@@ -95,7 +93,8 @@
// Closes and locks doors, power check
/obj/machinery/door_timer/proc/timer_start()
- if(stat & (NOPOWER|BROKEN)) return 0
+ if(stat & (NOPOWER|BROKEN))
+ return 0
// Set releasetime
releasetime = world.timeofday + timetoset
@@ -103,16 +102,19 @@
addAtProcessing()
for(var/obj/machinery/door/window/brigdoor/door in targets)
- if(door.density) continue
+ if(door.density)
+ continue
spawn(0)
door.close()
for(var/obj/structure/closet/secure_closet/brig/C in targets)
- if(C.broken) continue
- if(C.opened && !C.close()) continue
+ if(C.broken)
+ continue
+ if(C.opened && !C.close())
+ continue
C.locked = 1
C.icon_state = C.icon_locked
-
+
for(var/obj/machinery/treadmill_monitor/T in targets)
T.total_joules = 0
T.on = 1
@@ -122,19 +124,23 @@
// Opens and unlocks doors, power check
/obj/machinery/door_timer/proc/timer_end()
- if(stat & (NOPOWER|BROKEN)) return 0
+ if(stat & (NOPOWER|BROKEN))
+ return 0
// Reset releasetime
releasetime = 0
for(var/obj/machinery/door/window/brigdoor/door in targets)
- if(!door.density) continue
+ if(!door.density)
+ continue
spawn(0)
door.open()
for(var/obj/structure/closet/secure_closet/brig/C in targets)
- if(C.broken) continue
- if(C.opened) continue
+ if(C.broken)
+ continue
+ if(C.opened)
+ continue
C.locked = 0
C.icon_state = C.icon_closed
@@ -156,7 +162,7 @@
return time / 10
// Set timetoset
-/obj/machinery/door_timer/proc/timeset(var/seconds)
+/obj/machinery/door_timer/proc/timeset(seconds)
timetoset = seconds * 10
if(timetoset <= 0)
@@ -165,15 +171,15 @@
return
//Allows AIs to use door_timer, see human attack_hand function below
-/obj/machinery/door_timer/attack_ai(var/mob/user as mob)
- return src.attack_hand(user)
+/obj/machinery/door_timer/attack_ai(mob/user)
+ return attack_hand(user)
//Allows humans to use door_timer
//Opens dialog window when someone clicks on door timer
// Allows altering timer and the timing boolean.
// Flasher activation limited to 150 seconds
-/obj/machinery/door_timer/attack_hand(var/mob/user as mob)
+/obj/machinery/door_timer/attack_hand(mob/user)
if(..())
return
@@ -188,13 +194,11 @@
user.set_machine(src)
// dat
- var/dat = ""
-
- dat += "Timer System:"
- dat += " Door [src.id] controls "
+ var/dat = "Timer System:"
+ dat += " Door [id] controls "
// Start/Stop timer
- if (src.timing)
+ if(timing)
dat += "Stop Timer and open door "
else
dat += "Activate Timer and close door "
@@ -204,7 +208,7 @@
dat += " "
// Set Timer display (uses timetoset)
- if(src.timing)
+ if(timing)
dat += "Set Timer: [(setminute ? text("[setminute]:") : null)][setsecond] Set "
else
dat += "Set Timer: [(setminute ? text("[setminute]:") : null)][setsecond] "
@@ -220,11 +224,10 @@
dat += " Activate Flash"
dat += "
Close"
- dat += ""
- user << browse(dat, "window=computer;size=400x500")
- onclose(user, "computer")
- return
+ var/datum/browser/popup = new(user, "door_timer", name, 400, 500)
+ popup.set_content(dat)
+ popup.open()
//Function for using door_timer dialog input, checks if user has permission
@@ -237,18 +240,18 @@
/obj/machinery/door_timer/Topic(href, href_list)
if(..())
return
- if(!src.allowed(usr))
+ if(!allowed(usr))
return
usr.set_machine(src)
if(href_list["timing"])
- src.timing = text2num(href_list["timing"])
+ timing = text2num(href_list["timing"])
- if(src.timing)
- src.timer_start()
+ if(timing)
+ timer_start()
else
- src.timer_end()
+ timer_end()
else
if(href_list["tp"]) //adjust timer, close door if not already closed
@@ -264,19 +267,11 @@
F.flash()
if(href_list["change"])
- src.timer_start()
+ timer_start()
- src.add_fingerprint(usr)
- src.updateUsrDialog()
- src.update_icon()
-
- /* if(src.timing)
- src.timer_start()
-
- else
- src.timer_end() */
-
- return
+ add_fingerprint(usr)
+ updateUsrDialog()
+ update_icon()
//icon update function
@@ -290,7 +285,7 @@
if(stat & (BROKEN))
set_picture("ai_bsod")
return
- if(src.timing)
+ if(timing)
var/disp1 = id
var/timeleft = timeleft()
var/disp2 = "[add_zero(num2text((timeleft / 60) % 60),2)]~[add_zero(num2text(timeleft % 60), 2)]"
@@ -299,11 +294,10 @@
update_display(disp1, disp2)
else
if(maptext) maptext = ""
- return
// Adds an icon in case the screen is broken/off, stolen from status_display.dm
-/obj/machinery/door_timer/proc/set_picture(var/state)
+/obj/machinery/door_timer/proc/set_picture(state)
picture_state = state
overlays.Cut()
overlays += image('icons/obj/status_display.dmi', icon_state=picture_state)
@@ -311,7 +305,7 @@
//Checks to see if there's 1 line or 2, adds text-icons-numbers/letters over display
// Stolen from status_display
-/obj/machinery/door_timer/proc/update_display(var/line1, var/line2)
+/obj/machinery/door_timer/proc/update_display(line1, line2)
var/new_text = {"
[line1] [line2]
"}
if(maptext != new_text)
maptext = new_text
@@ -319,7 +313,7 @@
//Actual string input to icon display for loop, with 5 pixel x offsets for each letter.
//Stolen from status_display
-/obj/machinery/door_timer/proc/texticon(var/tn, var/px = 0, var/py = 0)
+/obj/machinery/door_timer/proc/texticon(tn, px = 0, py = 0)
var/image/I = image('icons/obj/status_display.dmi', "blank")
var/len = lentext(tn)
diff --git a/code/game/machinery/doors/door.dm b/code/game/machinery/doors/door.dm
index fd5f1b19219..6c9537667fb 100644
--- a/code/game/machinery/doors/door.dm
+++ b/code/game/machinery/doors/door.dm
@@ -45,11 +45,13 @@
bound_width = world.icon_size
bound_height = width * world.icon_size
- air_update_turf(1)
update_freelook_sight()
airlocks += src
return
+/obj/machinery/door/initialize()
+ air_update_turf(1)
+ ..()
/obj/machinery/door/Destroy()
density = 0
diff --git a/code/game/machinery/doors/poddoor.dm b/code/game/machinery/doors/poddoor.dm
index 1b3f13955d0..de3c4514bb5 100644
--- a/code/game/machinery/doors/poddoor.dm
+++ b/code/game/machinery/doors/poddoor.dm
@@ -44,9 +44,9 @@
/obj/machinery/door/poddoor/attackby(obj/item/weapon/C as obj, mob/user as mob, params)
src.add_fingerprint(user)
- if (!( istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/twohanded/fireaxe) && C:wielded == 1) ))
+ if(!( istype(C, /obj/item/weapon/crowbar) || (istype(C, /obj/item/weapon/twohanded/fireaxe) && C:wielded == 1) ))
return
- if ((src.density && (stat & NOPOWER) && !( src.operating )))
+ if((src.density && (stat & NOPOWER) && !( src.operating )))
spawn( 0 )
src.operating = 1
flick("pdoorc0", src)
@@ -59,9 +59,9 @@
return
/obj/machinery/door/poddoor/open()
- if (src.operating == 1) //doors can still open when emag-disabled
+ if(src.operating == 1) //doors can still open when emag-disabled
return
- if (!ticker)
+ if(!ticker)
return 0
if(!src.operating) //in case of emag
src.operating = 1
@@ -82,7 +82,7 @@
return 1
/obj/machinery/door/poddoor/close()
- if (src.operating)
+ if(src.operating)
return
src.operating = 1
flick("pdoorc1", src)
diff --git a/code/game/machinery/doors/spacepod.dm b/code/game/machinery/doors/spacepod.dm
index 244642021ad..021509a13ed 100644
--- a/code/game/machinery/doors/spacepod.dm
+++ b/code/game/machinery/doors/spacepod.dm
@@ -7,7 +7,7 @@
density = 0
anchored = 1
-/obj/structure/spacepoddoor/New()
+/obj/structure/spacepoddoor/initialize()
..()
air_update_turf(1)
@@ -21,4 +21,4 @@
/obj/structure/spacepoddoor/CanPass(atom/movable/A, turf/T)
if(istype(A, /obj/spacepod))
return ..()
- else return 0
\ No newline at end of file
+ else return 0
diff --git a/code/game/machinery/doors/windowdoor.dm b/code/game/machinery/doors/windowdoor.dm
index 39ed81b3360..cbad06fab9c 100644
--- a/code/game/machinery/doors/windowdoor.dm
+++ b/code/game/machinery/doors/windowdoor.dm
@@ -13,7 +13,7 @@
/obj/machinery/door/window/New()
..()
- if (src.req_access && src.req_access.len)
+ if(src.req_access && src.req_access.len)
src.icon_state = "[src.icon_state]"
src.base_state = src.icon_state
@@ -42,7 +42,7 @@
/obj/machinery/door/window/Bumped(atom/movable/AM as mob|obj)
if(operating || !density)
return
- if (!ismob(AM))
+ if(!ismob(AM))
if(istype(AM, /obj/mecha))
var/obj/mecha/mecha = AM
if(mecha.occupant && src.allowed(mecha.occupant))
@@ -50,7 +50,7 @@
else
flick(text("[]deny", src.base_state), src)
return
- if (!ticker)
+ if(!ticker)
return
var/mob/M = AM
if(!M.restrained() && !M.small)
@@ -97,9 +97,9 @@
return 1
/obj/machinery/door/window/open(var/forced=0)
- if (src.operating == 1) //doors can still open when emag-disabled
+ if(src.operating == 1) //doors can still open when emag-disabled
return 0
- if (!ticker)
+ if(!ticker)
return 0
if(!forced)
if(stat & NOPOWER)
@@ -124,7 +124,7 @@
return 1
/obj/machinery/door/window/close(var/forced=0)
- if (src.operating)
+ if(src.operating)
return 0
if(!forced)
if(stat & NOPOWER)
@@ -149,7 +149,7 @@
/obj/machinery/door/window/proc/take_damage(var/damage)
src.health = max(0, src.health - damage)
- if (src.health <= 0)
+ if(src.health <= 0)
var/debris = list(
new /obj/item/weapon/shard(src.loc),
new /obj/item/weapon/shard(src.loc),
@@ -248,13 +248,13 @@
/obj/machinery/door/window/attackby(obj/item/weapon/I as obj, mob/living/user as mob, params)
//If it's in the process of opening/closing, ignore the click
- if (src.operating)
+ if(src.operating)
return
add_fingerprint(user)
//Ninja swords? You may pass.
- if (src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)))
+ if(src.density && (istype(I, /obj/item/weapon/card/emag)||istype(I, /obj/item/weapon/melee/energy/blade)))
emag_act(user,I)
return 1
@@ -307,7 +307,7 @@
src.check_access()
if(src.req_access.len)
ae.conf_access = src.req_access
- else if (src.req_one_access.len)
+ else if(src.req_one_access.len)
ae.conf_access = src.req_one_access
ae.one_access = 1
else
@@ -341,17 +341,17 @@
take_damage(aforce)
return
- if (!src.requiresID())
+ if(!src.requiresID())
//don't care who they are or what they have, act as if they're NOTHING
user = null
- if (src.allowed(user))
- if (src.density)
+ if(src.allowed(user))
+ if(src.density)
open()
else
close()
- else if (src.density)
+ else if(src.density)
flick(text("[]deny", src.base_state), src)
return
diff --git a/code/game/machinery/dye_generator.dm b/code/game/machinery/dye_generator.dm
index c73996abd29..151478ddee6 100644
--- a/code/game/machinery/dye_generator.dm
+++ b/code/game/machinery/dye_generator.dm
@@ -9,6 +9,7 @@
var/dye_color = "#FFFFFF"
/obj/machinery/dye_generator/initialize()
+ ..()
power_change()
/obj/machinery/dye_generator/power_change()
@@ -32,7 +33,7 @@
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
return
if(3.0)
@@ -73,7 +74,7 @@
throw_speed = 4
throw_range = 7
force = 0
- w_class = 1.0
+ w_class = 1
var/dye_color = "#FFFFFF"
/obj/item/hair_dye_bottle/New()
@@ -127,4 +128,4 @@
var/b_skin = hex2num(copytext(dye_color, 6, 8))
if(H.change_skin_color(r_skin, g_skin, b_skin))
H.update_dna()
- user.visible_message("[user] finishes dying [M]'s [what_to_dye]!", "You finish dying [M]'s [what_to_dye]!")
\ No newline at end of file
+ user.visible_message("[user] finishes dying [M]'s [what_to_dye]!", "You finish dying [M]'s [what_to_dye]!")
diff --git a/code/game/machinery/embedded_controller/airlock_controllers.dm b/code/game/machinery/embedded_controller/airlock_controllers.dm
index bf6fe4f0fe7..2b336859127 100644
--- a/code/game/machinery/embedded_controller/airlock_controllers.dm
+++ b/code/game/machinery/embedded_controller/airlock_controllers.dm
@@ -34,7 +34,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "advanced_airlock_console.tmpl", name, 470, 290)
ui.set_initial_data(data)
@@ -90,7 +90,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "simple_airlock_console.tmpl", name, 470, 290)
ui.set_initial_data(data)
@@ -154,7 +154,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "door_access_console.tmpl", name, 330, 220)
ui.set_initial_data(data)
diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller.dm b/code/game/machinery/embedded_controller/airlock_docking_controller.dm
index 0ffb9c3d7dc..e94a975b91f 100644
--- a/code/game/machinery/embedded_controller/airlock_docking_controller.dm
+++ b/code/game/machinery/embedded_controller/airlock_docking_controller.dm
@@ -26,7 +26,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "docking_airlock_console.tmpl", name, 470, 290)
ui.set_initial_data(data)
ui.open()
@@ -71,8 +71,8 @@
airlock_program.master_prog = src
/datum/computer/file/embedded_program/docking/airlock/receive_user_command(command)
- if (command == "toggle_override")
- if (override_enabled)
+ if(command == "toggle_override")
+ if(override_enabled)
disable_override()
else
enable_override()
@@ -120,7 +120,7 @@
var/datum/computer/file/embedded_program/docking/airlock/master_prog
/datum/computer/file/embedded_program/airlock/docking/receive_user_command(command)
- if (master_prog.undocked() || master_prog.override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
+ if(master_prog.undocked() || master_prog.override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
..(command)
/datum/computer/file/embedded_program/airlock/docking/proc/enable_mech_regulators()
@@ -134,7 +134,7 @@
toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "open")
/datum/computer/file/embedded_program/airlock/docking/cycleDoors(var/target)
- if (master_prog.undocked() || master_prog.override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
+ if(master_prog.undocked() || master_prog.override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
..(target)
/*** DEBUG VERBS ***
diff --git a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm
index f7ca5b1339a..8eeb93b8a8e 100644
--- a/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm
+++ b/code/game/machinery/embedded_controller/airlock_docking_controller_multi.dm
@@ -17,8 +17,8 @@
var/list/names = splittext(child_names_txt, ";")
var/list/tags = splittext(child_tags_txt, ";")
- if (names.len == tags.len)
- for (var/i = 1; i <= tags.len; i++)
+ if(names.len == tags.len)
+ for(var/i = 1; i <= tags.len; i++)
child_names[tags[i]] = names[i]
@@ -27,7 +27,7 @@
var/list/airlocks[child_names.len]
var/i = 1
- for (var/child_tag in child_names)
+ for(var/child_tag in child_names)
airlocks[i++] = list("name"=child_names[child_tag], "override_enabled"=(docking_program.children_override[child_tag] == "enabled"))
data = list(
@@ -37,7 +37,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "multi_docking_console.tmpl", name, 470, 290)
ui.set_initial_data(data)
ui.open()
@@ -75,7 +75,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "docking_airlock_console.tmpl", name, 470, 290)
ui.set_initial_data(data)
ui.open()
diff --git a/code/game/machinery/embedded_controller/airlock_program.dm b/code/game/machinery/embedded_controller/airlock_program.dm
index 8cb3abb9980..670cce47785 100644
--- a/code/game/machinery/embedded_controller/airlock_program.dm
+++ b/code/game/machinery/embedded_controller/airlock_program.dm
@@ -36,7 +36,7 @@
memory["purge"] = 0
memory["secure"] = 0
- if (istype(M, /obj/machinery/embedded_controller/radio/airlock)) //if our controller is an airlock controller than we can auto-init our tags
+ if(istype(M, /obj/machinery/embedded_controller/radio/airlock)) //if our controller is an airlock controller than we can auto-init our tags
var/obj/machinery/embedded_controller/radio/airlock/controller = M
tag_exterior_door = controller.tag_exterior_door? controller.tag_exterior_door : "[id_tag]_outer"
tag_interior_door = controller.tag_interior_door? controller.tag_interior_door : "[id_tag]_inner"
@@ -177,13 +177,13 @@
if(memory["pump_status"] != "off") //send a signal to stop pumping
signalPump(tag_airpump, 0)
- if ((state == STATE_PRESSURIZE || state == STATE_DEPRESSURIZE) && !check_doors_secured())
+ if((state == STATE_PRESSURIZE || state == STATE_DEPRESSURIZE) && !check_doors_secured())
//the airlock will not allow itself to continue to cycle when any of the doors are forced open.
stop_cycling()
switch(state)
if(STATE_PREPARE)
- if (check_doors_secured())
+ if(check_doors_secured())
var/chamber_pressure = memory["chamber_sensor_pressure"]
var/target_pressure = memory["target_pressure"]
diff --git a/code/game/machinery/embedded_controller/docking_program.dm b/code/game/machinery/embedded_controller/docking_program.dm
index aa938c663bc..725ec6a337b 100644
--- a/code/game/machinery/embedded_controller/docking_program.dm
+++ b/code/game/machinery/embedded_controller/docking_program.dm
@@ -77,109 +77,109 @@
var/command = signal.data["command"]
var/recipient = signal.data["recipient"] //the intended recipient of the docking signal
- if (recipient != id_tag)
+ if(recipient != id_tag)
return //this signal is not for us
- switch (command)
- if ("confirm_dock")
- if (control_mode == MODE_CLIENT && dock_state == STATE_UNDOCKED && receive_tag == tag_target)
+ switch(command)
+ if("confirm_dock")
+ if(control_mode == MODE_CLIENT && dock_state == STATE_UNDOCKED && receive_tag == tag_target)
dock_state = STATE_DOCKING
broadcast_docking_status()
- if (!override_enabled)
+ if(!override_enabled)
prepare_for_docking()
- else if (control_mode == MODE_CLIENT && dock_state == STATE_DOCKING && receive_tag == tag_target)
+ else if(control_mode == MODE_CLIENT && dock_state == STATE_DOCKING && receive_tag == tag_target)
dock_state = STATE_DOCKED
broadcast_docking_status()
- if (!override_enabled)
+ if(!override_enabled)
finish_docking() //client done docking!
response_sent = 0
- else if (control_mode == MODE_SERVER && dock_state == STATE_DOCKING && receive_tag == tag_target) //client just sent us the confirmation back, we're done with the docking process
+ else if(control_mode == MODE_SERVER && dock_state == STATE_DOCKING && receive_tag == tag_target) //client just sent us the confirmation back, we're done with the docking process
received_confirm = 1
- if ("request_dock")
- if (control_mode == MODE_NONE && dock_state == STATE_UNDOCKED)
+ if("request_dock")
+ if(control_mode == MODE_NONE && dock_state == STATE_UNDOCKED)
control_mode = MODE_SERVER
dock_state = STATE_DOCKING
broadcast_docking_status()
tag_target = receive_tag
- if (!override_enabled)
+ if(!override_enabled)
prepare_for_docking()
send_docking_command(tag_target, "confirm_dock") //acknowledge the request
- if ("confirm_undock")
- if (control_mode == MODE_CLIENT && dock_state == STATE_UNDOCKING && receive_tag == tag_target)
- if (!override_enabled)
+ if("confirm_undock")
+ if(control_mode == MODE_CLIENT && dock_state == STATE_UNDOCKING && receive_tag == tag_target)
+ if(!override_enabled)
finish_undocking()
reset() //client is done undocking!
- else if (control_mode == MODE_SERVER && dock_state == STATE_UNDOCKING && receive_tag == tag_target)
+ else if(control_mode == MODE_SERVER && dock_state == STATE_UNDOCKING && receive_tag == tag_target)
received_confirm = 1
- if ("request_undock")
- if (control_mode == MODE_SERVER && dock_state == STATE_DOCKED && receive_tag == tag_target)
+ if("request_undock")
+ if(control_mode == MODE_SERVER && dock_state == STATE_DOCKED && receive_tag == tag_target)
dock_state = STATE_UNDOCKING
broadcast_docking_status()
- if (!override_enabled)
+ if(!override_enabled)
prepare_for_undocking()
- if ("dock_error")
- if (receive_tag == tag_target)
+ if("dock_error")
+ if(receive_tag == tag_target)
reset()
/datum/computer/file/embedded_program/docking/process()
switch(dock_state)
- if (STATE_DOCKING) //waiting for our docking port to be ready for docking
- if (ready_for_docking())
- if (control_mode == MODE_CLIENT)
- if (!response_sent)
+ if(STATE_DOCKING) //waiting for our docking port to be ready for docking
+ if(ready_for_docking())
+ if(control_mode == MODE_CLIENT)
+ if(!response_sent)
send_docking_command(tag_target, "confirm_dock") //tell the server we're ready
response_sent = 1
- else if (control_mode == MODE_SERVER && received_confirm)
+ else if(control_mode == MODE_SERVER && received_confirm)
send_docking_command(tag_target, "confirm_dock") //tell the client we are done docking.
dock_state = STATE_DOCKED
broadcast_docking_status()
- if (!override_enabled)
+ if(!override_enabled)
finish_docking() //server done docking!
response_sent = 0
received_confirm = 0
- if (STATE_UNDOCKING)
- if (ready_for_undocking())
- if (control_mode == MODE_CLIENT)
- if (!response_sent)
+ if(STATE_UNDOCKING)
+ if(ready_for_undocking())
+ if(control_mode == MODE_CLIENT)
+ if(!response_sent)
send_docking_command(tag_target, "confirm_undock") //tell the server we are OK to undock.
response_sent = 1
- else if (control_mode == MODE_SERVER && received_confirm)
+ else if(control_mode == MODE_SERVER && received_confirm)
send_docking_command(tag_target, "confirm_undock") //tell the client we are done undocking.
- if (!override_enabled)
+ if(!override_enabled)
finish_undocking()
reset() //server is done undocking!
- if (response_sent || resend_counter > 0)
+ if(response_sent || resend_counter > 0)
resend_counter++
- if (resend_counter >= MESSAGE_RESEND_TIME || (dock_state != STATE_DOCKING && dock_state != STATE_UNDOCKING))
+ if(resend_counter >= MESSAGE_RESEND_TIME || (dock_state != STATE_DOCKING && dock_state != STATE_UNDOCKING))
response_sent = 0
resend_counter = 0
//handle invalid states
- if (control_mode == MODE_NONE && dock_state != STATE_UNDOCKED)
- if (tag_target)
+ if(control_mode == MODE_NONE && dock_state != STATE_UNDOCKED)
+ if(tag_target)
send_docking_command(tag_target, "dock_error")
reset()
- if (control_mode == MODE_SERVER && dock_state == STATE_UNDOCKED)
+ if(control_mode == MODE_SERVER && dock_state == STATE_UNDOCKED)
control_mode = MODE_NONE
/datum/computer/file/embedded_program/docking/proc/initiate_docking(var/target)
- if (dock_state != STATE_UNDOCKED || control_mode == MODE_SERVER) //must be undocked and not serving another request to begin a new docking handshake
+ if(dock_state != STATE_UNDOCKED || control_mode == MODE_SERVER) //must be undocked and not serving another request to begin a new docking handshake
return
tag_target = target
@@ -188,13 +188,13 @@
send_docking_command(tag_target, "request_dock")
/datum/computer/file/embedded_program/docking/proc/initiate_undocking()
- if (dock_state != STATE_DOCKED || control_mode != MODE_CLIENT) //must be docked and must be client to start undocking
+ if(dock_state != STATE_DOCKED || control_mode != MODE_CLIENT) //must be docked and must be client to start undocking
return
dock_state = STATE_UNDOCKING
broadcast_docking_status()
- if (!override_enabled)
+ if(!override_enabled)
prepare_for_undocking()
send_docking_command(tag_target, "request_undock")
@@ -240,7 +240,7 @@
/datum/computer/file/embedded_program/docking/proc/force_undock()
// to_chat(world, "[id_tag]: forcing undock")
- if (tag_target)
+ if(tag_target)
send_docking_command(tag_target, "dock_error")
reset()
@@ -269,11 +269,11 @@
//this is mostly for NanoUI
/datum/computer/file/embedded_program/docking/proc/get_docking_status()
- switch (dock_state)
- if (STATE_UNDOCKED) return "undocked"
- if (STATE_DOCKING) return "docking"
- if (STATE_UNDOCKING) return "undocking"
- if (STATE_DOCKED) return "docked"
+ switch(dock_state)
+ if(STATE_UNDOCKED) return "undocked"
+ if(STATE_DOCKING) return "docking"
+ if(STATE_UNDOCKING) return "undocking"
+ if(STATE_DOCKED) return "docked"
#undef STATE_UNDOCKED
diff --git a/code/game/machinery/embedded_controller/docking_program_multi.dm b/code/game/machinery/embedded_controller/docking_program_multi.dm
index dc582b915f9..0a3d9228435 100644
--- a/code/game/machinery/embedded_controller/docking_program_multi.dm
+++ b/code/game/machinery/embedded_controller/docking_program_multi.dm
@@ -14,19 +14,19 @@
/datum/computer/file/embedded_program/docking/multi/New(var/obj/machinery/embedded_controller/M)
..(M)
- if (istype(M,/obj/machinery/embedded_controller/radio/docking_port_multi)) //if our parent controller is the right type, then we can auto-init stuff at construction
+ if(istype(M,/obj/machinery/embedded_controller/radio/docking_port_multi)) //if our parent controller is the right type, then we can auto-init stuff at construction
var/obj/machinery/embedded_controller/radio/docking_port_multi/controller = M
//parse child_tags_txt and create child tags
children_tags = splittext(controller.child_tags_txt, ";")
children_ready = list()
children_override = list()
- for (var/child_tag in children_tags)
+ for(var/child_tag in children_tags)
children_ready[child_tag] = 0
children_override[child_tag] = "disabled"
/datum/computer/file/embedded_program/docking/multi/proc/clear_children_ready_status()
- for (var/child_tag in children_tags)
+ for(var/child_tag in children_tags)
children_ready[child_tag] = 0
/datum/computer/file/embedded_program/docking/multi/receive_signal(datum/signal/signal, receive_method, receive_param)
@@ -34,21 +34,21 @@
var/command = signal.data["command"]
var/recipient = signal.data["recipient"] //the intended recipient of the docking signal
- if (receive_tag in children_tags)
+ if(receive_tag in children_tags)
//track children status
- if (signal.data["override_status"])
+ if(signal.data["override_status"])
children_override[receive_tag] = signal.data["override_status"]
- if (recipient == id_tag)
- switch (command)
- if ("ready_for_docking")
+ if(recipient == id_tag)
+ switch(command)
+ if("ready_for_docking")
children_ready[receive_tag] = 1
- if ("ready_for_undocking")
+ if("ready_for_undocking")
children_ready[receive_tag] = 1
- if ("status_override_enabled")
+ if("status_override_enabled")
children_override[receive_tag] = 1
- if ("status_override_disabled")
+ if("status_override_disabled")
children_override[receive_tag] = 0
..(signal, receive_method, receive_param)
@@ -58,19 +58,19 @@
clear_children_ready_status()
//tell children to prepare for docking
- for (var/child_tag in children_tags)
+ for(var/child_tag in children_tags)
send_docking_command(child_tag, "prepare_for_docking")
/datum/computer/file/embedded_program/docking/multi/ready_for_docking()
//check children ready status
- for (var/child_tag in children_tags)
- if (!children_ready[child_tag])
+ for(var/child_tag in children_tags)
+ if(!children_ready[child_tag])
return 0
return 1
/datum/computer/file/embedded_program/docking/multi/finish_docking()
//tell children to finish docking
- for (var/child_tag in children_tags)
+ for(var/child_tag in children_tags)
send_docking_command(child_tag, "finish_docking")
//clear ready flags
@@ -81,19 +81,19 @@
clear_children_ready_status()
//tell children to prepare for undocking
- for (var/child_tag in children_tags)
+ for(var/child_tag in children_tags)
send_docking_command(child_tag, "prepare_for_undocking")
/datum/computer/file/embedded_program/docking/multi/ready_for_undocking()
//check children ready status
- for (var/child_tag in children_tags)
- if (!children_ready[child_tag])
+ for(var/child_tag in children_tags)
+ if(!children_ready[child_tag])
return 0
return 1
/datum/computer/file/embedded_program/docking/multi/finish_undocking()
//tell children to finish undocking
- for (var/child_tag in children_tags)
+ for(var/child_tag in children_tags)
send_docking_command(child_tag, "finish_undocking")
//clear ready flags
@@ -118,13 +118,13 @@
/datum/computer/file/embedded_program/airlock/multi_docking/New(var/obj/machinery/embedded_controller/M)
..(M)
- if (istype(M, /obj/machinery/embedded_controller/radio/airlock/docking_port_multi)) //if our parent controller is the right type, then we can auto-init stuff at construction
+ if(istype(M, /obj/machinery/embedded_controller/radio/airlock/docking_port_multi)) //if our parent controller is the right type, then we can auto-init stuff at construction
var/obj/machinery/embedded_controller/radio/airlock/docking_port_multi/controller = M
src.master_tag = controller.master_tag
/datum/computer/file/embedded_program/airlock/multi_docking/receive_user_command(command)
- if (command == "toggle_override")
- if (override_enabled)
+ if(command == "toggle_override")
+ if(override_enabled)
override_enabled = 0
broadcast_override_status()
else
@@ -132,7 +132,7 @@
broadcast_override_status()
return
- if (!docking_enabled|| override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
+ if(!docking_enabled|| override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
..(command)
/datum/computer/file/embedded_program/airlock/multi_docking/receive_signal(datum/signal/signal, receive_method, receive_param)
@@ -142,54 +142,54 @@
var/command = signal.data["command"]
var/recipient = signal.data["recipient"] //the intended recipient of the docking signal
- if (receive_tag != master_tag)
+ if(receive_tag != master_tag)
return //only respond to master
//track master's status
- if (signal.data["dock_status"])
+ if(signal.data["dock_status"])
master_status = signal.data["dock_status"]
- if (recipient != id_tag)
+ if(recipient != id_tag)
return //this signal is not for us
- switch (command)
- if ("prepare_for_docking")
+ switch(command)
+ if("prepare_for_docking")
docking_enabled = 1
docking_mode = 0
response_sent = 0
- if (!override_enabled)
+ if(!override_enabled)
begin_cycle_in()
- if ("prepare_for_undocking")
+ if("prepare_for_undocking")
docking_mode = 1
response_sent = 0
- if (!override_enabled)
+ if(!override_enabled)
stop_cycling()
close_doors()
disable_mech_regulation()
- if ("finish_docking")
- if (!override_enabled)
+ if("finish_docking")
+ if(!override_enabled)
enable_mech_regulation()
open_doors()
- if ("finish_undocking")
+ if("finish_undocking")
docking_enabled = 0
/datum/computer/file/embedded_program/airlock/multi_docking/process()
..()
- if (docking_enabled && !response_sent)
+ if(docking_enabled && !response_sent)
- switch (docking_mode)
- if (0) //docking
- if (ready_for_docking())
+ switch(docking_mode)
+ if(0) //docking
+ if(ready_for_docking())
send_signal_to_master("ready_for_docking")
response_sent = 1
- if (1) //undocking
- if (ready_for_undocking())
+ if(1) //undocking
+ if(ready_for_undocking())
send_signal_to_master("ready_for_undocking")
response_sent = 1
@@ -206,7 +206,7 @@
toggleDoor(memory["exterior_status"], tag_exterior_door, memory["secure"], "open")
/datum/computer/file/embedded_program/airlock/multi_docking/cycleDoors(var/target)
- if (!docking_enabled|| override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
+ if(!docking_enabled|| override_enabled) //only allow the port to be used as an airlock if nothing is docked here or the override is enabled
..(target)
/datum/computer/file/embedded_program/airlock/multi_docking/proc/send_signal_to_master(var/command)
diff --git a/code/game/machinery/embedded_controller/embedded_controller_base.dm b/code/game/machinery/embedded_controller/embedded_controller_base.dm
index 06a5266d17e..a4a656fa5d6 100644
--- a/code/game/machinery/embedded_controller/embedded_controller_base.dm
+++ b/code/game/machinery/embedded_controller/embedded_controller_base.dm
@@ -27,8 +27,8 @@
src.updateDialog()
/obj/machinery/embedded_controller/attack_ghost(mob/user as mob)
- src.ui_interact(user)
-
+ src.ui_interact(user)
+
/obj/machinery/embedded_controller/attack_ai(mob/user as mob)
src.ui_interact(user)
@@ -55,6 +55,7 @@
unacidable = 1
/obj/machinery/embedded_controller/radio/initialize()
+ ..()
set_frequency(frequency)
/obj/machinery/embedded_controller/radio/update_icon()
@@ -77,4 +78,4 @@
/obj/machinery/embedded_controller/radio/proc/set_frequency(new_frequency)
radio_controller.remove_object(src, frequency)
frequency = new_frequency
- radio_connection = radio_controller.add_object(src, frequency, radio_filter)
\ No newline at end of file
+ radio_connection = radio_controller.add_object(src, frequency, radio_filter)
diff --git a/code/game/machinery/embedded_controller/embedded_program_base.dm b/code/game/machinery/embedded_controller/embedded_program_base.dm
index 06507d9d5f9..1fe527df13b 100644
--- a/code/game/machinery/embedded_controller/embedded_program_base.dm
+++ b/code/game/machinery/embedded_controller/embedded_program_base.dm
@@ -7,7 +7,7 @@
/datum/computer/file/embedded_program/New(var/obj/machinery/embedded_controller/M)
master = M
- if (istype(M, /obj/machinery/embedded_controller/radio))
+ if(istype(M, /obj/machinery/embedded_controller/radio))
var/obj/machinery/embedded_controller/radio/R = M
id_tag = R.id_tag
diff --git a/code/game/machinery/embedded_controller/simple_docking_controller.dm b/code/game/machinery/embedded_controller/simple_docking_controller.dm
index 1883d363987..996a56b92ac 100644
--- a/code/game/machinery/embedded_controller/simple_docking_controller.dm
+++ b/code/game/machinery/embedded_controller/simple_docking_controller.dm
@@ -21,7 +21,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "simple_docking_console.tmpl", name, 470, 290)
ui.set_initial_data(data)
ui.open()
@@ -55,7 +55,7 @@
..(M)
memory["door_status"] = list(state = "closed", lock = "locked") //assume closed and locked in case the doors dont report in
- if (istype(M, /obj/machinery/embedded_controller/radio/simple_docking_controller))
+ if(istype(M, /obj/machinery/embedded_controller/radio/simple_docking_controller))
var/obj/machinery/embedded_controller/radio/simple_docking_controller/controller = M
tag_door = controller.tag_door? controller.tag_door : "[id_tag]_hatch"
@@ -78,13 +78,13 @@
/datum/computer/file/embedded_program/docking/simple/receive_user_command(command)
switch(command)
if("force_door")
- if (override_enabled)
+ if(override_enabled)
if(memory["door_status"]["state"] == "open")
close_door()
else
open_door()
if("toggle_override")
- if (override_enabled)
+ if(override_enabled)
disable_override()
else
enable_override()
diff --git a/code/game/machinery/firealarm.dm b/code/game/machinery/firealarm.dm
index cbf1df85c3d..45b515734f7 100644
--- a/code/game/machinery/firealarm.dm
+++ b/code/game/machinery/firealarm.dm
@@ -176,14 +176,14 @@ FIRE ALARM
var/area/A = src.loc
var/d1
var/d2
- if (ishuman(user) || issilicon(user) || isobserver(user))
+ if(ishuman(user) || issilicon(user) || isobserver(user))
A = A.loc
- if (A.fire)
+ if(A.fire)
d1 = text("Reset - Lockdown", src)
else
d1 = text("Alarm - Lockdown", src)
- if (src.timing)
+ if(src.timing)
d2 = text("Stop Time Lock", src)
else
d2 = text("Initiate Time Lock", src)
@@ -194,11 +194,11 @@ FIRE ALARM
onclose(user, "firealarm")
else
A = A.loc
- if (A.fire)
+ if(A.fire)
d1 = text("[]", src, stars("Reset - Lockdown"))
else
d1 = text("[]", src, stars("Alarm - Lockdown"))
- if (src.timing)
+ if(src.timing)
d2 = text("[]", src, stars("Stop Time Lock"))
else
d2 = text("[]", src, stars("Initiate Time Lock"))
@@ -260,7 +260,7 @@ FIRE ALARM
time = min(max(round(src.time), 0), 120)
/obj/machinery/firealarm/proc/reset()
- if (!( src.working ))
+ if(!( src.working ))
return
var/area/A = get_area(src)
A.fire_reset()
@@ -269,7 +269,7 @@ FIRE ALARM
return
/obj/machinery/firealarm/proc/alarm(var/duration = 0)
- if (!( src.working))
+ if(!( src.working))
return
var/area/A = get_area(src)
for(var/obj/machinery/firealarm/FA in A)
@@ -310,7 +310,7 @@ Just a object used in constructing fire alarms
icon = 'icons/obj/doors/door_assembly.dmi'
icon_state = "door_electronics"
desc = "A circuit. It has a label on it, it says \"Can handle heat levels up to 40 degrees celsius!\""
- w_class = 2.0
+ w_class = 2
materials = list(MAT_METAL=50, MAT_GLASS=50)
/obj/machinery/partyalarm
@@ -332,7 +332,7 @@ Just a object used in constructing fire alarms
/obj/machinery/partyalarm/New()
var/area/A = get_area_master(src)
- if (!( istype(A, /area) ))
+ if(!( istype(A, /area) ))
return
master_area=A
@@ -345,13 +345,13 @@ Just a object used in constructing fire alarms
ASSERT(isarea(A))
var/d1
var/d2
- if (istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
+ if(istype(user, /mob/living/carbon/human) || istype(user, /mob/living/silicon/ai))
- if (A.party)
+ if(A.party)
d1 = text("No Party :(", src)
else
d1 = text("PARTY!!!", src)
- if (timing)
+ if(timing)
d2 = text("Stop Time Lock", src)
else
d2 = text("Initiate Time Lock", src)
@@ -361,11 +361,11 @@ Just a object used in constructing fire alarms
user << browse(dat, "window=partyalarm")
onclose(user, "partyalarm")
else
- if (A.fire)
+ if(A.fire)
d1 = text("[]", src, stars("No Party :("))
else
d1 = text("[]", src, stars("PARTY!!!"))
- if (timing)
+ if(timing)
d2 = text("[]", src, stars("Stop Time Lock"))
else
d2 = text("[]", src, stars("Initiate Time Lock"))
@@ -377,7 +377,7 @@ Just a object used in constructing fire alarms
return
/obj/machinery/partyalarm/proc/reset()
- if (!( working ))
+ if(!( working ))
return
var/area/A = get_area(src)
ASSERT(isarea(A))
@@ -385,7 +385,7 @@ Just a object used in constructing fire alarms
return
/obj/machinery/partyalarm/proc/alarm()
- if (!( working ))
+ if(!( working ))
return
var/area/A = get_area(src)
ASSERT(isarea(A))
@@ -394,20 +394,20 @@ Just a object used in constructing fire alarms
/obj/machinery/partyalarm/Topic(href, href_list)
..()
- if (usr.stat || stat & (BROKEN|NOPOWER))
+ if(usr.stat || stat & (BROKEN|NOPOWER))
return
- if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
+ if((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon/ai)))
usr.machine = src
- if (href_list["reset"])
+ if(href_list["reset"])
reset()
else
- if (href_list["alarm"])
+ if(href_list["alarm"])
alarm()
else
- if (href_list["time"])
+ if(href_list["time"])
timing = text2num(href_list["time"])
else
- if (href_list["tp"])
+ if(href_list["tp"])
var/tp = text2num(href_list["tp"])
time += tp
time = min(max(round(time), 0), 120)
diff --git a/code/game/machinery/flasher.dm b/code/game/machinery/flasher.dm
index 01f95d81ab6..655ffd11634 100644
--- a/code/game/machinery/flasher.dm
+++ b/code/game/machinery/flasher.dm
@@ -28,7 +28,7 @@
src.sd_set_light(2)
*/
/obj/machinery/flasher/power_change()
- if ( powered() )
+ if( powered() )
stat &= ~NOPOWER
icon_state = "[base_state]1"
// src.sd_set_light(2)
@@ -39,26 +39,26 @@
//Don't want to render prison breaks impossible
/obj/machinery/flasher/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/wirecutters))
+ if(istype(W, /obj/item/weapon/wirecutters))
add_fingerprint(user)
src.disable = !src.disable
- if (src.disable)
+ if(src.disable)
user.visible_message("\red [user] has disconnected the [src]'s flashbulb!", "\red You disconnect the [src]'s flashbulb!")
- if (!src.disable)
+ if(!src.disable)
user.visible_message("\red [user] has connected the [src]'s flashbulb!", "\red You connect the [src]'s flashbulb!")
//Let the AI trigger them directly.
/obj/machinery/flasher/attack_ai()
- if (src.anchored)
+ if(src.anchored)
return src.flash()
else
return
/obj/machinery/flasher/proc/flash()
- if (!(powered()))
+ if(!(powered()))
return
- if ((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
+ if((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
return
playsound(src.loc, 'sound/weapons/flash.ogg', 100, 1)
@@ -67,7 +67,7 @@
use_power(1000)
for(var/mob/living/L in viewers(src, null))
- if (get_dist(src, L) > src.range)
+ if(get_dist(src, L) > src.range)
continue
if(L.flash_eyes(affect_silicon = 1))
@@ -85,24 +85,24 @@
..(severity)
/obj/machinery/flasher/portable/HasProximity(atom/movable/AM as mob|obj)
- if ((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
+ if((src.disable) || (src.last_flash && world.time < src.last_flash + 150))
return
if(istype(AM, /mob/living/carbon))
var/mob/living/carbon/M = AM
- if ((M.m_intent != "walk") && (src.anchored))
+ if((M.m_intent != "walk") && (src.anchored))
src.flash()
/obj/machinery/flasher/portable/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/wrench))
+ if(istype(W, /obj/item/weapon/wrench))
add_fingerprint(user)
src.anchored = !src.anchored
- if (!src.anchored)
+ if(!src.anchored)
user.show_message(text("\red [src] can now be moved."))
src.overlays.Cut()
- else if (src.anchored)
+ else if(src.anchored)
user.show_message(text("\red [src] is now secured."))
src.overlays += "[base_state]-s"
diff --git a/code/game/machinery/floodlight.dm b/code/game/machinery/floodlight.dm
index 7c5e152529f..53977708650 100644
--- a/code/game/machinery/floodlight.dm
+++ b/code/game/machinery/floodlight.dm
@@ -69,7 +69,7 @@
/obj/machinery/floodlight/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/wrench))
- if (!anchored && !isinspace())
+ if(!anchored && !isinspace())
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
@@ -83,8 +83,8 @@
" You have loosened \the [src]'s casters.", \
"You hear ratchet.")
anchored = 0
- if (istype(W, /obj/item/weapon/screwdriver))
- if (!open)
+ if(istype(W, /obj/item/weapon/screwdriver))
+ if(!open)
if(unlocked)
unlocked = 0
to_chat(user, "You screw the battery panel in place.")
@@ -92,7 +92,7 @@
unlocked = 1
to_chat(user, "You unscrew the battery panel.")
- if (istype(W, /obj/item/weapon/crowbar))
+ if(istype(W, /obj/item/weapon/crowbar))
if(unlocked)
if(open)
open = 0
@@ -103,7 +103,7 @@
open = 1
to_chat(user, "You remove the battery panel.")
- if (istype(W, /obj/item/weapon/stock_parts/cell))
+ if(istype(W, /obj/item/weapon/stock_parts/cell))
if(open)
if(cell)
to_chat(user, "There is a power cell already installed.")
diff --git a/code/game/machinery/guestpass.dm b/code/game/machinery/guestpass.dm
index bf1d69e7437..512ed47263a 100644
--- a/code/game/machinery/guestpass.dm
+++ b/code/game/machinery/guestpass.dm
@@ -11,19 +11,19 @@
var/reason = "NOT SPECIFIED"
/obj/item/weapon/card/id/guest/GetAccess()
- if (world.time > expiration_time)
+ if(world.time > expiration_time)
return access
else
return temp_access
/obj/item/weapon/card/id/guest/examine(mob/user)
..(user)
- if (world.time < expiration_time)
+ if(world.time < expiration_time)
to_chat(user, "This pass expires at [worldtime2text(expiration_time)].")
else
to_chat(user, "It expired at [worldtime2text(expiration_time)].")
to_chat(user, "It grants access to following areas:")
- for (var/A in temp_access)
+ for(var/A in temp_access)
to_chat(user, "[get_access_desc(A)].")
to_chat(user, "Issuing reason: [reason].")
@@ -72,9 +72,9 @@
user.set_machine(src)
var/dat
- if (mode == 1) //Logs
+ if(mode == 1) //Logs
dat += "
Activity log
"
- for (var/entry in internal_log)
+ for(var/entry in internal_log)
dat += "[entry] "
dat += "Print "
dat += "Back "
@@ -86,15 +86,17 @@
dat += "Reason: [reason] "
dat += "Duration (minutes): [duration] m "
dat += "Access to areas: "
- if (giver && giver.access)
- for (var/A in get_changeable_accesses())
+ if(giver && giver.access)
+ for(var/A in get_changeable_accesses())
var/area = get_access_desc(A)
- if (A in accesses)
+ if(A in accesses)
area = "[area]"
dat += "[area] "
dat += " Issue pass "
- user << browse(dat, "window=guestpass;size=400x520")
+ var/datum/browser/popup = new(user, "guestpass", name, 400, 520)
+ popup.set_content(dat)
+ popup.open(0)
onclose(user, "guestpass")
@@ -102,37 +104,37 @@
if(..())
return 1
usr.set_machine(src)
- if (href_list["mode"])
+ if(href_list["mode"])
mode = text2num(href_list["mode"])
- if (href_list["choice"])
+ if(href_list["choice"])
switch(href_list["choice"])
- if ("giv_name")
+ if("giv_name")
var/nam = strip_html_simple(input("Person pass is issued to", "Name", giv_name) as text|null)
- if (nam)
+ if(nam)
giv_name = nam
- if ("reason")
+ if("reason")
var/reas = strip_html_simple(input("Reason why pass is issued", "Reason", reason) as text|null)
if(reas)
reason = reas
- if ("duration")
+ if("duration")
var/dur = input("Duration (in minutes) during which pass is valid (up to 30 minutes).", "Duration") as num|null
- if (dur)
- if (dur > 0 && dur <= 30)
+ if(dur)
+ if(dur > 0 && dur <= 30)
duration = dur
else
to_chat(usr, "Invalid duration.")
- if ("access")
+ if("access")
var/A = text2num(href_list["access"])
- if (A in accesses)
+ if(A in accesses)
accesses.Remove(A)
else
if(giver && giver.access && (A in get_changeable_accesses()))
accesses.Add(A)
- if (href_list["action"])
+ if(href_list["action"])
switch(href_list["action"])
- if ("id")
- if (giver)
+ if("id")
+ if(giver)
if(ishuman(usr))
giver.loc = usr.loc
if(!usr.get_active_hand())
@@ -144,15 +146,15 @@
accesses.Cut()
else
var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
usr.drop_item()
I.loc = src
giver = I
updateUsrDialog()
- if ("print")
+ if("print")
var/dat = "
Activity log of guest pass terminal #[uid]
"
- for (var/entry in internal_log)
+ for(var/entry in internal_log)
dat += "[entry] "
// to_chat(usr, "Printing the log, standby...")
//sleep(50)
@@ -161,13 +163,13 @@
P.name = "activity log"
P.info = dat
- if ("issue")
- if (giver)
+ if("issue")
+ if(giver)
var/number = add_zero("[rand(0,9999)]", 4)
var/entry = "\[[worldtime2text()]\] Pass #[number] issued by [giver.registered_name] ([giver.assignment]) to [giv_name]. Reason: [reason]. Grants access to following areas: "
- for (var/i=1 to accesses.len)
+ for(var/i=1 to accesses.len)
var/A = accesses[i]
- if (A)
+ if(A)
var/area = get_access_desc(A)
entry += "[i > 1 ? ", [area]" : "[area]"]"
entry += ". Expires at [worldtime2text(world.time + duration*10*60)]."
diff --git a/code/game/machinery/hologram.dm b/code/game/machinery/hologram.dm
index ba0006f16de..abe99777410 100644
--- a/code/game/machinery/hologram.dm
+++ b/code/game/machinery/hologram.dm
@@ -81,7 +81,7 @@ var/const/HOLOPAD_MODE = 0
to_chat(user, "A request for AI presence was already sent recently.")
/obj/machinery/hologram/holopad/attack_ai(mob/living/silicon/ai/user)
- if (!istype(user))
+ if(!istype(user))
return
/*There are pretty much only three ways to interact here.
I don't need to check for client since they're clicking on an object.
@@ -165,7 +165,7 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
if((HOLOPAD_MODE == 0 && (get_dist(master.eyeobj, src) <= holo_range)))
return 1
- else if (HOLOPAD_MODE == 1)
+ else if(HOLOPAD_MODE == 1)
var/area/holo_area = get_area(src)
var/area/eye_area = get_area(master.eyeobj)
@@ -219,10 +219,10 @@ For the other part of the code, check silicon say.dm. Particularly robot talk.*/
if(1.0)
qdel(src)
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
if(3.0)
- if (prob(5))
+ if(prob(5))
qdel(src)
return
diff --git a/code/game/machinery/holosign.dm b/code/game/machinery/holosign.dm
index 687a07ced0f..d44ee2e3930 100644
--- a/code/game/machinery/holosign.dm
+++ b/code/game/machinery/holosign.dm
@@ -10,19 +10,19 @@
var/on_icon = "sign_on"
proc/toggle()
- if (stat & (BROKEN|NOPOWER))
+ if(stat & (BROKEN|NOPOWER))
return
lit = !lit
update_icon()
update_icon()
- if (!lit)
+ if(!lit)
icon_state = "sign_off"
else
icon_state = on_icon
power_change()
- if (stat & NOPOWER)
+ if(stat & NOPOWER)
lit = 0
update_icon()
@@ -67,7 +67,7 @@
icon_state = "light0"
for(var/obj/machinery/holosign/M in world)
- if (M.id == src.id)
+ if(M.id == src.id)
spawn( 0 )
M.toggle()
return
diff --git a/code/game/machinery/igniter.dm b/code/game/machinery/igniter.dm
index d6e41d29fa2..7cb51574a60 100755
--- a/code/game/machinery/igniter.dm
+++ b/code/game/machinery/igniter.dm
@@ -25,9 +25,9 @@
return
/obj/machinery/igniter/process() //ugh why is this even in process()?
- if (src.on && !(stat & NOPOWER) )
+ if(src.on && !(stat & NOPOWER) )
var/turf/location = src.loc
- if (isturf(location))
+ if(isturf(location))
location.hotspot_expose(1000,500,1)
return 1
@@ -58,7 +58,7 @@
..()
/obj/machinery/sparker/power_change()
- if ( powered() && disable == 0 )
+ if( powered() && disable == 0 )
stat &= ~NOPOWER
icon_state = "[base_state]"
// src.sd_set_light(2)
@@ -70,13 +70,13 @@
/obj/machinery/sparker/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/device/detective_scanner))
return
- if (istype(W, /obj/item/weapon/screwdriver))
+ if(istype(W, /obj/item/weapon/screwdriver))
add_fingerprint(user)
src.disable = !src.disable
- if (src.disable)
+ if(src.disable)
user.visible_message("\red [user] has disabled the [src]!", "\red You disable the connection to the [src].")
icon_state = "[base_state]-d"
- if (!src.disable)
+ if(!src.disable)
user.visible_message("\red [user] has reconnected the [src]!", "\red You fix the connection to the [src].")
if(src.powered())
icon_state = "[base_state]"
@@ -84,16 +84,16 @@
icon_state = "[base_state]-p"
/obj/machinery/sparker/attack_ai()
- if (src.anchored)
+ if(src.anchored)
return src.spark()
else
return
/obj/machinery/sparker/proc/spark()
- if (!(powered()))
+ if(!(powered()))
return
- if ((src.disable) || (src.last_spark && world.time < src.last_spark + 50))
+ if((src.disable) || (src.last_spark && world.time < src.last_spark + 50))
return
@@ -104,7 +104,7 @@
src.last_spark = world.time
use_power(1000)
var/turf/location = src.loc
- if (isturf(location))
+ if(isturf(location))
location.hotspot_expose(1000,500,1)
return 1
diff --git a/code/game/machinery/iv_drip.dm b/code/game/machinery/iv_drip.dm
index 5caff96d4ea..fb55eee1200 100644
--- a/code/game/machinery/iv_drip.dm
+++ b/code/game/machinery/iv_drip.dm
@@ -1,101 +1,127 @@
/obj/machinery/iv_drip
name = "\improper IV drip"
icon = 'icons/obj/iv_drip.dmi'
+ icon_state = "iv_drip"
anchored = 0
density = 1
+ var/mob/living/carbon/human/attached = null
+ var/mode = 1 // 1 is injecting, 0 is taking blood.
+ var/obj/item/weapon/reagent_containers/beaker = null
+/obj/machinery/iv_drip/New()
+ ..()
+ update_icon()
-/obj/machinery/iv_drip/var/mob/living/carbon/human/attached = null
-/obj/machinery/iv_drip/var/mode = 1 // 1 is injecting, 0 is taking blood.
-/obj/machinery/iv_drip/var/obj/item/weapon/reagent_containers/beaker = null
+/obj/machinery/iv_drip/Destroy()
+ attached = null
+ if(beaker)
+ qdel(beaker)
+ beaker = null
+ return ..()
/obj/machinery/iv_drip/update_icon()
- if(src.attached)
- icon_state = "hooked"
+ if(attached)
+ if(mode)
+ icon_state = "injecting"
+ else
+ icon_state = "donating"
else
- icon_state = ""
+ if(mode)
+ icon_state = "injectidle"
+ else
+ icon_state = "donateidle"
- overlays = null
+ overlays.Cut()
if(beaker)
- var/datum/reagents/reagents = beaker.reagents
- if(reagents.total_volume)
+ if(attached)
+ overlays += "beakeractive"
+ else
+ overlays += "beakeridle"
+ if(beaker.reagents.total_volume)
var/image/filling = image('icons/obj/iv_drip.dmi', src, "reagent")
- var/percent = round((reagents.total_volume / beaker.volume) * 100)
+ var/percent = round((beaker.reagents.total_volume / beaker.volume) * 100)
switch(percent)
- if(0 to 9) filling.icon_state = "reagent0"
- if(10 to 24) filling.icon_state = "reagent10"
- if(25 to 49) filling.icon_state = "reagent25"
- if(50 to 74) filling.icon_state = "reagent50"
- if(75 to 79) filling.icon_state = "reagent75"
- if(80 to 90) filling.icon_state = "reagent80"
- if(91 to INFINITY) filling.icon_state = "reagent100"
+ if(0 to 9)
+ filling.icon_state = "reagent0"
+ if(10 to 24)
+ filling.icon_state = "reagent10"
+ if(25 to 49)
+ filling.icon_state = "reagent25"
+ if(50 to 74)
+ filling.icon_state = "reagent50"
+ if(75 to 79)
+ filling.icon_state = "reagent75"
+ if(80 to 90)
+ filling.icon_state = "reagent80"
+ if(91 to INFINITY)
+ filling.icon_state = "reagent100"
- filling.icon += mix_color_from_reagents(reagents.reagent_list)
+ filling.icon += mix_color_from_reagents(beaker.reagents.reagent_list)
overlays += filling
-/obj/machinery/iv_drip/MouseDrop(over_object, src_location, over_location)
- ..()
-
- if(!ishuman(usr) && !isrobot(usr))
- return
-
- var/turf/T = get_turf(src)
- if(!usr in range(1, T))
+/obj/machinery/iv_drip/MouseDrop(mob/living/target)
+ if(!ishuman(usr))
return
if(attached)
- visible_message("[src.attached] is detached from \the [src]")
- src.attached = null
- src.update_icon()
+ visible_message("[attached] is detached from [src].")
+ attached = null
+ update_icon()
return
- if(in_range(src, usr) && ishuman(over_object) && get_dist(over_object, src) <= 1)
- visible_message("[usr] attaches \the [src] to \the [over_object].")
- src.attached = over_object
- src.update_icon()
+ if(!target.dna)
+ to_chat(usr, "The drip beeps: Warning, incompatible creature!")
+ return
-
-/obj/machinery/iv_drip/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/reagent_containers))
- if(!isnull(src.beaker))
- to_chat(user, "There is already a reagent container loaded!")
- return
-
- if(user.drop_item())
- W.forceMove(src)
- src.beaker = W
- to_chat(user, "You attach \the [W] to \the [src].")
- src.update_icon()
- return
+ if(Adjacent(target) && usr.Adjacent(target))
+ if(beaker)
+ usr.visible_message("[usr] attaches [src] to [target].", "You attach [src] to [target].")
+ attached = target
+ addAtProcessing()
+ update_icon()
else
- to_chat(user, "\The [W] is stuck to you!")
+ to_chat(usr, "There's nothing attached to the IV drip!")
+
+/obj/machinery/iv_drip/attackby(obj/item/weapon/W, mob/user, params)
+ if(istype(W, /obj/item/weapon/reagent_containers))
+ if(beaker)
+ to_chat(user, "There is already a reagent container loaded!")
+ return
+ if(!user.drop_item())
+ return
+
+ W.forceMove(src)
+ beaker = W
+ to_chat(user, "You attach [W] to [src].")
+ update_icon()
else
return ..()
/obj/machinery/iv_drip/process()
- //set background = 1
+ if(!attached)
+ return PROCESS_KILL
- if(src.attached)
+ if(get_dist(src, attached) > 1 && isturf(attached.loc))
+ to_chat(attached, "The IV drip needle is ripped out of you!")
+ attached.apply_damage(3, BRUTE, pick("r_arm", "l_arm"))
+ attached = null
+ update_icon()
+ return PROCESS_KILL
- if(!(get_dist(src, src.attached) <= 1 && isturf(src.attached.loc)))
- visible_message("The needle is ripped out of [src.attached], doesn't that hurt?")
- src.attached:apply_damage(3, BRUTE, pick("r_arm", "l_arm"))
- src.attached = null
- src.update_icon()
- return
-
- if(src.attached && src.beaker)
+ if(beaker)
// Give blood
if(mode)
- if(src.beaker.volume > 0)
- var/transfer_amount = REAGENTS_METABOLISM
- if(istype(src.beaker, /obj/item/weapon/reagent_containers/blood))
+ if(beaker.volume > 0)
+ var/transfer_amount = 5
+ if(istype(beaker, /obj/item/weapon/reagent_containers/blood))
// speed up transfer on blood packs
- transfer_amount = 4
- src.beaker.reagents.trans_to(src.attached, transfer_amount)
+ transfer_amount = 10
+ var/fraction = min(transfer_amount/beaker.volume, 1) //the fraction that is transfered of the total volume
+ beaker.reagents.reaction(attached, INGEST, fraction) //make reagents reacts, but don't spam messages
+ beaker.reagents.trans_to(attached, transfer_amount)
update_icon()
// Take blood
@@ -104,69 +130,111 @@
amount = min(amount, 4)
// If the beaker is full, ping
if(amount == 0)
- if(prob(5)) visible_message("\The [src] pings.")
+ if(prob(5))
+ visible_message("[src] pings.")
return
var/mob/living/carbon/human/T = attached
- if(!istype(T)) return
+ if(!ishuman(T))
+ return
+
if(!T.dna)
return
+
if(NOCLONE in T.mutations)
return
- if(T.species && T.species.flags & NO_BLOOD)
+ if(T.species.flags & NO_BLOOD)
return
- // If the human is losing too much blood, beep.
- if(T.vessel.get_reagent_amount("blood") < BLOOD_VOLUME_SAFE) if(prob(5))
- visible_message("\The [src] beeps loudly.")
-
- var/datum/reagent/B = T.take_blood(beaker,amount)
-
- if (B)
- beaker.reagents.reagent_list |= B
- beaker.reagents.update_total()
- beaker.on_reagent_change()
- beaker.reagents.handle_reactions()
+ if(T.species.exotic_blood)
+ T.vessel.trans_to(beaker, amount)
update_icon()
+ else
+ var/datum/reagent/B = T.take_blood(beaker, amount)
-/obj/machinery/iv_drip/attack_hand(mob/user as mob)
- if(src.beaker)
- src.beaker.loc = get_turf(src)
- src.beaker = null
+ if(B)
+ beaker.reagents.reagent_list |= B
+ beaker.reagents.update_total()
+ beaker.on_reagent_change()
+ beaker.reagents.handle_reactions()
+ update_icon()
+
+ // If attached is losing too much blood, beep.
+ var/blood_type = attached.get_blood_name()
+ if(T.vessel.get_reagent_amount(blood_type) < BLOOD_VOLUME_SAFE && prob(5))
+ visible_message("[src] beeps loudly.")
+ playsound(loc, 'sound/machines/twobeep.ogg', 50, 1)
+
+/obj/machinery/iv_drip/attack_hand(mob/user)
+ if(!ishuman(user))
+ return
+ if(attached)
+ visible_message("[attached] is detached from [src]")
+ attached = null
update_icon()
+ return
+ else if(beaker)
+ eject_beaker(user)
else
- return ..()
+ toggle_mode()
+/obj/machinery/iv_drip/AltClick(mob/user)
+ ..()
+ if(user.incapacitated())
+ to_chat(user, "You can't do that right now!")
+ return
+ if(!Adjacent(user))
+ return
+ toggle_mode()
-/obj/machinery/iv_drip/verb/toggle_mode()
- set name = "Toggle Mode"
+/obj/machinery/iv_drip/verb/eject_beaker(mob/user)
set category = "Object"
+ set name = "Remove IV Container"
set src in view(1)
- if(!istype(usr, /mob/living))
- to_chat(usr, "\red You can't do that.")
+ if(!iscarbon(usr))
+ to_chat(usr, "You can't do that!")
return
- if(usr.stat)
+ if(usr.incapacitated())
+ return
+
+ if(beaker)
+ beaker.forceMove(get_turf(src))
+ beaker = null
+ update_icon()
+
+/obj/machinery/iv_drip/verb/toggle_mode()
+ set category = "Object"
+ set name = "Toggle Mode"
+ set src in view(1)
+
+ if(!iscarbon(usr))
+ to_chat(usr, "You can't do that!")
+ return
+
+ if(usr.incapacitated())
return
mode = !mode
to_chat(usr, "The IV drip is now [mode ? "injecting" : "taking blood"].")
+ update_icon()
/obj/machinery/iv_drip/examine(mob/user)
..(user)
- if (!(user in view(2)) && usr != src.loc) return
+ if(!(user in view(2)) && user != loc)
+ return
- to_chat(usr, "The IV drip is [mode ? "injecting" : "taking blood"].")
+ to_chat(user, "The IV drip is [mode ? "injecting" : "taking blood"].")
if(beaker)
if(beaker.reagents && beaker.reagents.reagent_list.len)
- to_chat(user, "\blue Attached is \a [beaker] with [beaker.reagents.total_volume] units of liquid.")
+ to_chat(user, "Attached is \a [beaker] with [beaker.reagents.total_volume] units of liquid.")
else
- to_chat(user, "\blue Attached is an empty [beaker].")
+ to_chat(user, "Attached is an empty [beaker].")
else
- to_chat(user, "\blue No chemicals are attached.")
+ to_chat(user, "No chemicals are attached.")
- to_chat(user, "\blue [attached ? attached : "No one"] is attached.")
+ to_chat(user, "[attached ? attached : "No one"] is attached.")
diff --git a/code/game/machinery/lightswitch.dm b/code/game/machinery/lightswitch.dm
index 3bc2bec5ec4..08e88b9c8c9 100644
--- a/code/game/machinery/lightswitch.dm
+++ b/code/game/machinery/lightswitch.dm
@@ -39,7 +39,7 @@
src.area = locate(text2path("/area/[otherarea]"))
if(!name)
- name = "light switch ([area.name])"
+ name = "light switch([area.name])"
src.on = src.area.lightswitch
updateicon()
diff --git a/code/game/machinery/machinery.dm b/code/game/machinery/machinery.dm
index f19e37f051a..c0ecd475f5e 100644
--- a/code/game/machinery/machinery.dm
+++ b/code/game/machinery/machinery.dm
@@ -47,7 +47,7 @@ Class Variables:
Currently unused.
Class Procs:
- New() 'game/machinery/machine.dm'
+ initialize() 'game/machinery/machine.dm'
Destroy() 'game/machinery/machine.dm'
@@ -117,24 +117,25 @@ Class Procs:
var/use_log = list()
var/list/settagwhitelist = list()//WHITELIST OF VARIABLES THAT THE set_tag HREF CAN MODIFY, DON'T PUT SHIT YOU DON'T NEED ON HERE, AND IF YOU'RE GONNA USE set_tag (format_tag() proc), ADD TO THIS LIST.
-/obj/machinery/New()
+/obj/machinery/initialize()
addAtProcessing()
- return ..()
+ . = ..()
+ power_change()
/obj/machinery/proc/addAtProcessing()
- if (use_power)
+ if(use_power)
myArea = get_area_master(src)
machines += src
/obj/machinery/proc/removeAtProcessing()
- if (myArea)
+ if(myArea)
myArea = null
machines -= src
/obj/machinery/Destroy()
- if (src in machines)
+ if(src in machines)
removeAtProcessing()
return ..()
@@ -158,11 +159,11 @@ Class Procs:
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
return
if(3.0)
- if (prob(25))
+ if(prob(25))
qdel(src)
return
else
@@ -232,7 +233,7 @@ Class Procs:
if("unlink" in href_list)
var/idx = text2num(href_list["unlink"])
- if (!idx)
+ if(!idx)
return 1
var/obj/O = getLink(idx)
@@ -255,7 +256,7 @@ Class Procs:
if(!canLink(O,href_list))
to_chat(usr, "\red You can't link with that device.")
return 1
- if (isLinkedWith(O))
+ if(isLinkedWith(O))
to_chat(usr, "\red A red light flashes on \the [P]. The two devices are already linked.")
return 1
@@ -324,14 +325,13 @@ Class Procs:
////////////////////////////////////////////////////////////////////////////////////////////
-/obj/machinery/attack_ai(var/mob/user as mob)
- if(isrobot(user))
- // For some reason attack_robot doesn't work
- // This is to stop robots from using cameras to remotely control machines.
- if(user.client && user.client.eye == user)
- return src.attack_hand(user)
+/obj/machinery/attack_ai(mob/user)
+ if(isrobot(user))// For some reason attack_robot doesn't work
+ var/mob/living/silicon/robot/R = user
+ if(R.client && R.client.eye == R && !R.low_power_mode)// This is to stop robots from using cameras to remotely control machines; and from using machines when the borg has no power.
+ return attack_hand(user)
else
- return src.attack_hand(user)
+ return attack_hand(user)
/obj/machinery/attack_hand(mob/user as mob)
if(user.lying || user.stat)
@@ -341,7 +341,7 @@ Class Procs:
to_chat(user, "You don't have the dexterity to do this!")
return 1
- if (ishuman(user))
+ if(ishuman(user))
var/mob/living/carbon/human/H = user
if(H.getBrainLoss() >= 60)
visible_message("[H] stares cluelessly at [src] and drools.")
@@ -361,9 +361,9 @@ Class Procs:
return ..()
-/obj/machinery/CheckParts()
+/obj/machinery/CheckParts(list/parts_list)
+ ..()
RefreshParts()
- return
/obj/machinery/proc/RefreshParts() //Placeholder proc for machines that are built using frames.
return
@@ -423,7 +423,7 @@ Class Procs:
O.show_message("[bicon(src)] [msg]", 2)
/obj/machinery/proc/ping(text=null)
- if (!text)
+ if(!text)
text = "\The [src] pings."
state(text, "blue")
@@ -547,7 +547,7 @@ Class Procs:
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
- if (electrocute_mob(user, get_area(src), src, 0.7))
+ if(electrocute_mob(user, get_area(src), src, 0.7))
if(user.stunned)
return 1
return 0
diff --git a/code/game/machinery/mass_driver.dm b/code/game/machinery/mass_driver.dm
index 0bd5fff9fba..7953f738a40 100644
--- a/code/game/machinery/mass_driver.dm
+++ b/code/game/machinery/mass_driver.dm
@@ -211,7 +211,7 @@
set name = "Rotate Frame"
set src in view(1)
- if ( usr.stat || usr.restrained() || (usr.status_flags & FAKEDEATH))
+ if( usr.stat || usr.restrained() || (usr.status_flags & FAKEDEATH))
return
src.dir = turn(src.dir, -90)
diff --git a/code/game/machinery/navbeacon.dm b/code/game/machinery/navbeacon.dm
index 79579e1bb66..5b6cfb5e73d 100644
--- a/code/game/machinery/navbeacon.dm
+++ b/code/game/machinery/navbeacon.dm
@@ -86,9 +86,9 @@
updateicon()
- else if (istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda))
+ else if(istype(I, /obj/item/weapon/card/id)||istype(I, /obj/item/device/pda))
if(open)
- if (src.allowed(user))
+ if(src.allowed(user))
src.locked = !src.locked
to_chat(user, "Controls are now [src.locked ? "locked" : "unlocked"].")
else
diff --git a/code/game/machinery/newscaster.dm b/code/game/machinery/newscaster.dm
index d991e7c5235..3a6ef2dbd81 100644
--- a/code/game/machinery/newscaster.dm
+++ b/code/game/machinery/newscaster.dm
@@ -12,6 +12,7 @@
var/is_admin_message = 0
var/icon/img = null
var/icon/backup_img
+ var/view_count = 0
/datum/feed_channel
var/channel_name=""
@@ -22,6 +23,7 @@
var/backup_author=""
var/censored=0
var/is_admin_channel=0
+ var/total_view_count = 0
//var/page = null //For newspapers
/datum/feed_message/proc/clear()
@@ -31,6 +33,7 @@
src.backup_author = ""
src.img = null
src.backup_img = null
+ view_count = 0
/datum/feed_channel/proc/clear()
src.channel_name = ""
@@ -40,6 +43,7 @@
src.backup_author = ""
src.censored = 0
src.is_admin_channel = 0
+ total_view_count = 0
/datum/feed_channel/proc/announce_news()
return "Breaking news from [channel_name]!"
@@ -98,6 +102,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
var/c_locked=0; //Will our new channel be locked to public submissions?
var/hitstaken = 0 //Death at 3 hits from an item with force>=15
var/datum/feed_channel/viewing_channel = null
+ var/silence = 0
light_range = 0
anchored = 1
@@ -199,8 +204,12 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+= {" Create Feed Channel View Feed Channels Submit new Feed story
- Print newspaper
- Re-scan User
+ Print newspaper"}
+ if(!silence)
+ dat+= " Silence unit"
+ else
+ dat+= " Unsilence unit"
+ dat+= {" Re-scan User
Exit"}
if(src.securityCaster)
var/wanted_already = 0
@@ -219,7 +228,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else
for(var/datum/feed_channel/CHANNEL in news_network.network_channels)
if(CHANNEL.is_admin_channel)
- dat+="[CHANNEL.channel_name] "
+ dat+="[CHANNEL.channel_name] "
else
dat+="[CHANNEL.channel_name] [(CHANNEL.censored) ? ("***") : ()] "
/*for(var/datum/feed_channel/CHANNEL in src.channel_list)
@@ -254,11 +263,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(6)
dat+="ERROR: Could not submit Feed story to Network. "
if(src.channel_name=="")
- dat+="•Invalid receiving channel name. "
+ dat+="Invalid receiving channel name. "
if(src.scanned_user=="Unknown")
- dat+="•Channel author unverified. "
+ dat+="Channel author unverified. "
if(src.msg == "" || src.msg == "\[REDACTED\]")
- dat+="•Invalid message body. "
+ dat+="Invalid message body. "
dat+=" Return "
if(7)
@@ -272,18 +281,18 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else
existing_authors += FC.author
if(src.scanned_user in existing_authors)
- dat+="•There already exists a Feed channel under your name. "
+ dat+="There already exists a Feed channel under your name. "
if(src.channel_name=="" || src.channel_name == "\[REDACTED\]")
- dat+="•Invalid channel name. "
+ dat+="Invalid channel name. "
var/check = 0
for(var/datum/feed_channel/FC in news_network.network_channels)
if(FC.channel_name == src.channel_name)
check = 1
break
if(check)
- dat+="•Channel name already in use. "
+ dat+="Channel name already in use. "
if(src.scanned_user=="Unknown")
- dat+="•Channel author unverified. "
+ dat+="Channel author unverified. "
dat+=" Return "
if(8)
var/total_num=length(news_network.network_channels)
@@ -299,7 +308,9 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="
Print Paper"
dat+=" Cancel"
if(9)
- dat+="[src.viewing_channel.channel_name]: \[created by: [src.viewing_channel.author]\]"
+ dat+="[src.viewing_channel.channel_name]: \[created by: [src.viewing_channel.author]\] "
+ dat+="Feed view count: [viewing_channel.total_view_count]"
+ viewing_channel.total_view_count++
if(src.viewing_channel.censored)
dat+="ATTENTION: This channel has been deemed as threatening to the welfare of the station, and marked with a Nanotrasen D-Notice. "
dat+="No further feed story additions are allowed while the D-Notice is in effect.
"
@@ -315,6 +326,8 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
usr << browse_rsc(MESSAGE.img, "tmp_photo[i].png")
dat+="
"
dat+="\[[MESSAGE.message_type] by [MESSAGE.author]\] "
+ dat+="Message view count: [MESSAGE.view_count] "
+ MESSAGE.view_count++
dat+=" Refresh"
dat+=" Back"
if(10)
@@ -394,11 +407,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(16)
dat+="ERROR: Wanted Issue rejected by Network. "
if(src.channel_name=="" || src.channel_name == "\[REDACTED\]")
- dat+="•Invalid name for person wanted. "
+ dat+="Invalid name for person wanted. "
if(src.scanned_user=="Unknown")
- dat+="•Issue author unverified. "
+ dat+="Issue author unverified. "
if(src.msg == "" || src.msg == "\[REDACTED\]")
- dat+="•Invalid description. "
+ dat+="Invalid description. "
dat+=" Return "
if(17)
dat+="Wanted Issue successfully deleted from Circulation "
@@ -427,7 +440,9 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
dat+="I'm sorry to break your immersion. This shit's bugged. Report this bug to Agouri, polyxenitopalidou@gmail.com"
- human_or_robot_user << browse(dat, "window=newscaster_main;size=400x600")
+ var/datum/browser/popup = new(user, "newscaster_main", name, 400, 600)
+ popup.set_content(dat)
+ popup.open(0)
onclose(human_or_robot_user, "newscaster_main")
/*if(src.isbroken) //debugging shit
@@ -441,11 +456,11 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
/obj/machinery/newscaster/Topic(href, href_list)
if(..())
return 1
-
+
usr.set_machine(src)
if(href_list["set_channel_name"])
src.channel_name = sanitizeSQL(strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", "")))
- while (findtext(src.channel_name," ") == 1)
+ while(findtext(src.channel_name," ") == 1)
src.channel_name = copytext(src.channel_name,2,lentext(src.channel_name)+1)
src.updateUsrDialog()
//src.update_icon()
@@ -497,7 +512,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else if(href_list["set_new_message"])
src.msg = strip_html(input(usr, "Write your feed story", "Network Channel Handler", ""))
- while (findtext(src.msg," ") == 1)
+ while(findtext(src.msg," ") == 1)
src.msg = copytext(src.msg,2,lentext(src.msg)+1)
src.updateUsrDialog()
@@ -546,6 +561,14 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
src.screen = 20
src.updateUsrDialog()
+ else if(href_list["silence_unit"])
+ silence=1
+ updateUsrDialog()
+
+ else if(href_list["unsilence_unit"])
+ silence=0
+ updateUsrDialog()
+
else if(href_list["menu_censor_story"])
src.screen=10
src.updateUsrDialog()
@@ -567,13 +590,13 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else if(href_list["set_wanted_name"])
src.channel_name = strip_html(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
- while (findtext(src.channel_name," ") == 1)
+ while(findtext(src.channel_name," ") == 1)
src.channel_name = copytext(src.channel_name,2,lentext(src.channel_name)+1)
src.updateUsrDialog()
else if(href_list["set_wanted_desc"])
src.msg = strip_html(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
- while (findtext(src.msg," ") == 1)
+ while(findtext(src.msg," ") == 1)
src.msg = copytext(src.msg,2,lentext(src.msg)+1)
src.updateUsrDialog()
@@ -685,7 +708,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
else if(href_list["setScreen"]) //Brings us to the main menu and resets all fields~
src.screen = text2num(href_list["setScreen"])
- if (src.screen == 0)
+ if(src.screen == 0)
src.scanned_user = "Unknown";
msg = "";
src.c_locked=0;
@@ -718,7 +741,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
qdel(src)
return
- if (isbroken)
+ if(isbroken)
playsound(src.loc, 'sound/effects/hit_on_shattered_glass.ogg', 100, 1)
visible_message("[user.name] further abuses the shattered [src.name].", null, 5 )
else
@@ -759,7 +782,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
if(!camera)
return
var/datum/picture/selection = camera.selectpicture()
- if (!selection)
+ if(!selection)
return
var/obj/item/weapon/photo/P = new/obj/item/weapon/photo()
@@ -794,7 +817,7 @@ var/list/obj/machinery/newscaster/allCasters = list() //Global list that will co
switch(screen)
if(0) //Cover
dat+="
Faxes are your main method of communicating with the NAS Trurl, better known as Central Command.
+
Faxes allow personnel on the station to maintain open lines of communication with the NAS Trurl, allowing for vital information to flow both ways.
+
Being written communications, proper grammar, syntax and typography is required, in addition to a signature and, if applicable, a stamp. Failure to sign faxes will lead to an automatic rejection.
+
We at NanoTrasen provide Fax Machines to every Head of Staff, in addition to the Magistrate, NanoTrasen Representative, and Internal Affairs Agents.
+
This means that we trust the recipients of these fax machines to only use them in the proper circumstances (see When to Fax?).
While it is up to the discretion of each individual person to decide when to fax Central Command, there are some simple guidelines on when to do this.
+
Firstly, any situation that can reasonably be solved on-site, should be handled on-site. Knowledge of Standard Operating Procedure is mandatory for everyone with access to a fax machine.
+
Resolving issues on-site not only leads to more expedient problem-solving, it also frees up company resources and provides valuable work experience for all parties involved.
+
This means that you should work with the Heads of Staff concerning personnel and workplace issues, and attempt to resolve situations with them. If, for whatever reason, the relevent Head of Staff is not available or receptive, consider speaking with the Captain and/or NanoTrasen Representative.
+
If, for whatever reason, these issues cannot be solved on-site, either due to incompetence or just plain refusal to cooperate, faxing Central Command becomes a viable option.
+
Secondly, station status reports should be sent occasionally, but never at the start of the shift. Remember, we assign personnel to the station. We do not need a repeat of what we just signed off on.
+
Thirdly, staff/departmental evaluations are always welcome, especially in cases of noticeable (in)competence. Just as a brilliant coworker can be rewarded, an incompetent one can be punished.
+
Fourthly, do not issue faxes asking for sentences. You have an entire Security department and an associated Detective, not to mention on-site Space Law manuals.
+
Lastly, please pay attention to context. If the station is facing a massive emergency, such as a Class 7-10 Blob Organism, most, if not all, non-relevant faxes will be duly ignored.
Sending a fax is simple. Simply insert your ID into the fax machine, then log in.
+
Once logged in, insert a piece of paper and select the destination from the provided list. Remember, you can rename your fax from within the fax machine's menu.
+
You can send faxes to any other fax machine on the station, which can be a very useful tool when you need to issue broad communications to all of the Heads of Staff.
+
To send a fax to Central Command, simply select the correct destination, and send the fax. Keep in mind, the communication arrays need to recharge after sending a fax to Central Command, so make sure you sent everything you need.
+
Lastly, paper bundles can also be faxed as a single item, so feel free to bundle up all relevant documentation and send it in at once.
+
+
+
+
+
+ "}
+
/obj/item/weapon/book/manual/sop_science
name = "Science Standard Operating Procedures"
desc = "A set of guidelines aiming at the safe conduct of all scientific activities."
diff --git a/code/game/objects/items/weapons/melee/energy.dm b/code/game/objects/items/weapons/melee/energy.dm
index 45b2f1f7452..5e262ce4afa 100644
--- a/code/game/objects/items/weapons/melee/energy.dm
+++ b/code/game/objects/items/weapons/melee/energy.dm
@@ -19,7 +19,7 @@
to_chat(user, "You accidentally cut yourself with [src], like a doofus!")
user.take_organ_damage(5,5)
active = !active
- if (active)
+ if(active)
force = force_on
throwforce = throwforce_on
hitsound = 'sound/weapons/blade1.ogg'
@@ -62,7 +62,7 @@
w_class = 3
w_class_on = 5
hitsound = "swing_hit"
- flags = CONDUCT | NOSHIELD
+ flags = CONDUCT
armour_penetration = 100
origin_tech = "combat=3"
attack_verb = list("attacked", "chopped", "cleaved", "torn", "cut")
@@ -83,9 +83,9 @@
throw_speed = 3
throw_range = 5
hitsound = "swing_hit"
- flags = NOSHIELD
armour_penetration = 35
origin_tech = "magnets=3;syndicate=4"
+ block_chance = 50
sharp = 1
edge = 1
var/hacked = 0
@@ -95,9 +95,9 @@
if(item_color == null)
item_color = pick("red", "blue", "green", "purple")
-/obj/item/weapon/melee/energy/sword/IsShield()
+/obj/item/weapon/melee/energy/sword/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance)
if(active)
- return 1
+ return ..()
return 0
/obj/item/weapon/melee/energy/sword/cyborg
@@ -133,7 +133,7 @@
..()
item_color = null
-/obj/item/weapon/melee/energy/sword/cyborg/saw/IsShield()
+/obj/item/weapon/melee/energy/sword/cyborg/saw/hit_reaction()
return 0
/obj/item/weapon/melee/energy/sword/saber
@@ -206,7 +206,6 @@
throw_speed = 3
throw_range = 1
w_class = 4//So you can't hide it in your pocket or some such.
- flags = NOSHIELD
armour_penetration = 50
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
var/datum/effect/system/spark_spread/spark_system
@@ -218,6 +217,7 @@
spark_system.attach(src)
/obj/item/weapon/melee/energy/blade/dropped()
+ ..()
qdel(src)
/obj/item/weapon/melee/energy/blade/attack_self(mob/user)
diff --git a/code/game/objects/items/weapons/misc.dm b/code/game/objects/items/weapons/misc.dm
index ebe8ecb421d..2ff41257ea1 100644
--- a/code/game/objects/items/weapons/misc.dm
+++ b/code/game/objects/items/weapons/misc.dm
@@ -30,7 +30,7 @@
flags = CONDUCT
force = 5.0
throwforce = 7.0
- w_class = 2.0
+ w_class = 2
materials = list(MAT_METAL=50)
attack_verb = list("bludgeoned", "whacked", "disciplined", "thrashed")
@@ -40,7 +40,7 @@
icon = 'icons/obj/items.dmi'
icon_state = "c_tube"
throwforce = 1
- w_class = 1.0
+ w_class = 1
throw_speed = 4
throw_range = 5
@@ -62,7 +62,7 @@
var/data = ""
var/base_url = "http://svn.slurm.us/public/spacestation13/misc/game_kit"
item_state = "sheet-metal"
- w_class = 5.0
+ w_class = 5
*/
/obj/item/weapon/gift
@@ -73,7 +73,7 @@
var/size = 3.0
var/obj/item/gift = null
item_state = "gift"
- w_class = 4.0
+ w_class = 4
/obj/item/weapon/kidanglobe
name = "Kidan homeworld globe"
diff --git a/code/game/objects/items/weapons/mop.dm b/code/game/objects/items/weapons/mop.dm
index 69d04cd4c29..8b5baf79a35 100644
--- a/code/game/objects/items/weapons/mop.dm
+++ b/code/game/objects/items/weapons/mop.dm
@@ -9,7 +9,7 @@
throwforce = 5.0
throw_speed = 3
throw_range = 7
- w_class = 3.0
+ w_class = 3
attack_verb = list("mopped", "bashed", "bludgeoned", "whacked")
var/mopping = 0
var/mopcount = 0
diff --git a/code/game/objects/items/weapons/paint.dm b/code/game/objects/items/weapons/paint.dm
index 866efe8763c..a7741267d09 100644
--- a/code/game/objects/items/weapons/paint.dm
+++ b/code/game/objects/items/weapons/paint.dm
@@ -1,7 +1,5 @@
//NEVER USE THIS IT SUX -PETETHEGOAT
-var/global/list/cached_icons = list()
-
/obj/item/weapon/reagent_containers/glass/paint
desc = "It's a paint bucket."
name = "paint bucket"
@@ -9,221 +7,58 @@ var/global/list/cached_icons = list()
icon_state = "paint_neutral"
item_state = "paintcan"
materials = list(MAT_METAL=200)
- w_class = 3.0
- amount_per_transfer_from_this = 10
- possible_transfer_amounts = list(10,20,30,50,70)
+ w_class = 3
+ amount_per_transfer_from_this = 5
+ possible_transfer_amounts = list(5,10,20,30,50,70)
volume = 70
flags = OPENCONTAINER
- var/paint_type = ""
- afterattack(turf/simulated/target, mob/user, proximity)
- if(!proximity) return
- if(istype(target) && reagents.total_volume > 5)
- for(var/mob/O in viewers(user))
- O.show_message("\red \The [target] has been splashed with something by [user]!", 1)
- spawn(5)
- reagents.reaction(target, TOUCH)
- reagents.remove_any(5)
- else
- return ..()
-
- New()
- if(paint_type == "remover")
- name = "paint remover bucket"
- else if(paint_type && lentext(paint_type) > 0)
- name = paint_type + " " + name
- ..()
- reagents.add_reagent("paint_[paint_type]", volume)
-
- red
- icon_state = "paint_red"
- paint_type = "red"
-
- green
- icon_state = "paint_green"
- paint_type = "green"
-
- blue
- icon_state = "paint_blue"
- paint_type = "blue"
-
- yellow
- icon_state = "paint_yellow"
- paint_type = "yellow"
-
- violet
- icon_state = "paint_violet"
- paint_type = "violet"
-
- black
- icon_state = "paint_black"
- paint_type = "black"
-
- white
- icon_state = "paint_white"
- paint_type = "white"
-
- remover
- paint_type = "remover"
-/*
-/obj/item/weapon/paint
- name = "Paint Can"
- desc = "Used to recolor floors and walls. Can not be removed by the janitor."
- icon = 'icons/obj/items.dmi'
- icon_state = "paint_neutral"
- color = "FFFFFF"
- item_state = "paintcan"
- w_class = 3.0
-
-/obj/item/weapon/paint/red
- name = "Red paint"
- color = "FF0000"
- icon_state = "paint_red"
-
-/obj/item/weapon/paint/green
- name = "Green paint"
- color = "00FF00"
- icon_state = "paint_green"
-
-/obj/item/weapon/paint/blue
- name = "Blue paint"
- color = "0000FF"
- icon_state = "paint_blue"
-
-/obj/item/weapon/paint/yellow
- name = "Yellow paint"
- color = "FFFF00"
- icon_state = "paint_yellow"
-
-/obj/item/weapon/paint/violet
- name = "Violet paint"
- color = "FF00FF"
- icon_state = "paint_violet"
-
-/obj/item/weapon/paint/black
- name = "Black paint"
- color = "333333"
- icon_state = "paint_black"
-
-/obj/item/weapon/paint/white
- name = "White paint"
- color = "FFFFFF"
- icon_state = "paint_white"
-
-
-/obj/item/weapon/paint/anycolor
- name = "Any color"
- icon_state = "paint_neutral"
-
- attack_self(mob/user as mob)
- var/t1 = input(user, "Please select a color:", "Locking Computer", null) in list( "red", "blue", "green", "yellow", "black", "white")
- if ((user.get_active_hand() != src || user.stat || user.restrained()))
- return
- switch(t1)
- if("red")
- color = "FF0000"
- if("blue")
- color = "0000FF"
- if("green")
- color = "00FF00"
- if("yellow")
- color = "FFFF00"
- if("violet")
- color = "FF00FF"
- if("white")
- color = "FFFFFF"
- if("black")
- color = "333333"
- icon_state = "paint_[t1]"
- add_fingerprint(user)
+/obj/item/weapon/reagent_containers/glass/paint/afterattack(turf/simulated/target, mob/user, proximity)
+ if(!proximity)
return
-
-
-/obj/item/weapon/paint/afterattack(turf/target, mob/user as mob, proximity)
- if(!proximity) return
- if(!istype(target) || istype(target, /turf/space))
- return
- var/ind = "[initial(target.icon)][color]"
- if(!cached_icons[ind])
- var/icon/overlay = new/icon(initial(target.icon))
- overlay.Blend("#[color]",ICON_MULTIPLY)
- overlay.SetIntensity(1.4)
- target.icon = overlay
- cached_icons[ind] = target.icon
+ if(istype(target) && reagents.total_volume >= 5)
+ user.visible_message("[target] has been splashed with something by [user]!")
+ spawn(5)
+ reagents.reaction(target, TOUCH)
+ reagents.remove_any(5)
else
- target.icon = cached_icons[ind]
- return
+ return ..()
-/obj/item/weapon/paint/paint_remover
- name = "Paint remover"
- icon_state = "paint_neutral"
+/obj/item/weapon/reagent_containers/glass/paint/red
+ name = "red paint bucket"
+ icon_state = "paint_red"
+ list_reagents = list("paint_red" = 70)
- afterattack(turf/target, mob/user as mob)
- if(istype(target) && target.icon != initial(target.icon))
- target.icon = initial(target.icon)
- return
-*/
+/obj/item/weapon/reagent_containers/glass/paint/green
+ name = "green paint bucket"
+ icon_state = "paint_green"
+ list_reagents = list("paint_green" = 70)
-datum/reagent/paint
- name = "Paint"
- id = "paint_"
- description = "Floor paint is used to color floor tiles."
- reagent_state = 2
- color = "#808080"
+/obj/item/weapon/reagent_containers/glass/paint/blue
+ name = "blue paint bucket"
+ icon_state = "paint_blue"
+ list_reagents = list("paint_blue" = 70)
- reaction_turf(var/turf/T, var/volume)
- if(!istype(T) || istype(T, /turf/space))
- return
- T.color = color
+/obj/item/weapon/reagent_containers/glass/paint/yellow
+ name = "yellow paint bucket"
+ icon_state = "paint_yellow"
+ list_reagents = list("paint_yellow" = 70)
- reaction_obj(var/obj/O, var/volume)
- ..()
- if(istype(O,/obj/item/weapon/light))
- O.color = color
+/obj/item/weapon/reagent_containers/glass/paint/violet
+ name = "violet paint bucket"
+ icon_state = "paint_violet"
+ list_reagents = list("paint_violet" = 70)
- red
- name = "Red Paint"
- id = "paint_red"
- color = "#FF0000"
+/obj/item/weapon/reagent_containers/glass/paint/black
+ name = "black paint bucket"
+ icon_state = "paint_black"
+ list_reagents = list("paint_black" = 70)
- green
- name = "Green Paint"
- color = "#00FF00"
- id = "paint_green"
+/obj/item/weapon/reagent_containers/glass/paint/white
+ name = "white paint bucket"
+ icon_state = "paint_white"
+ list_reagents = list("paint_white" = 70)
- blue
- name = "Blue Paint"
- color = "#0000FF"
- id = "paint_blue"
-
- yellow
- name = "Yellow Paint"
- color = "#FFFF00"
- id = "paint_yellow"
-
- violet
- name = "Violet Paint"
- color = "#FF00FF"
- id = "paint_violet"
-
- black
- name = "Black Paint"
- color = "#333333"
- id = "paint_black"
-
- white
- name = "White Paint"
- color = "#FFFFFF"
- id = "paint_white"
-
-datum/reagent/paint_remover
- name = "Paint Remover"
- id = "paint_remover"
- description = "Paint remover is used to remove floor paint from floor tiles."
- reagent_state = 2
- color = "#808080"
-
- reaction_turf(var/turf/T, var/volume)
- if(istype(T) && T.icon != initial(T.icon))
- T.icon = initial(T.icon)
- return
+/obj/item/weapon/reagent_containers/glass/paint/remover
+ name = "paint remover bucket"
+ list_reagents = list("paint_remover" = 70)
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/pneumaticCannon.dm b/code/game/objects/items/weapons/pneumaticCannon.dm
index 1130ab3808b..d7c33164543 100644
--- a/code/game/objects/items/weapons/pneumaticCannon.dm
+++ b/code/game/objects/items/weapons/pneumaticCannon.dm
@@ -132,7 +132,7 @@
maxWeightClass = 7
gasPerThrow = 5
-/datum/table_recipe/improvised_pneumatic_cannon //Pretty easy to obtain but
+/datum/crafting_recipe/improvised_pneumatic_cannon //Pretty easy to obtain but
name = "Pneumatic Cannon"
result = /obj/item/weapon/pneumatic_cannon/ghetto
tools = list(/obj/item/weapon/weldingtool,
@@ -141,6 +141,7 @@
/obj/item/stack/packageWrap = 8,
/obj/item/pipe = 2)
time = 300
+ category = CAT_WEAPON
/obj/item/weapon/pneumatic_cannon/proc/updateTank(obj/item/weapon/tank/thetank, removing = 0, mob/living/carbon/human/user)
if(removing)
diff --git a/code/game/objects/items/weapons/power_cells.dm b/code/game/objects/items/weapons/power_cells.dm
index a34a8328457..92bb7ac4c07 100644
--- a/code/game/objects/items/weapons/power_cells.dm
+++ b/code/game/objects/items/weapons/power_cells.dm
@@ -139,17 +139,17 @@
/obj/item/weapon/stock_parts/cell/pulse //200 pulse shots
name = "pulse rifle power cell"
- maxcharge = 40000
+ maxcharge = 400000
rating = 3
chargerate = 1500
/obj/item/weapon/stock_parts/cell/pulse/carbine
name = "pulse carbine power cell"
- maxcharge = 4000
+ maxcharge = 40000
/obj/item/weapon/stock_parts/cell/pulse/pistol
name = "pulse pistol power cell"
- maxcharge = 1600
+ maxcharge = 16000
/obj/item/weapon/stock_parts/cell/ninja
name = "spider-clan power cell"
diff --git a/code/game/objects/items/weapons/powerfist.dm b/code/game/objects/items/weapons/powerfist.dm
new file mode 100644
index 00000000000..8feab4632d7
--- /dev/null
+++ b/code/game/objects/items/weapons/powerfist.dm
@@ -0,0 +1,100 @@
+/obj/item/weapon/melee/powerfist
+ name = "power-fist"
+ desc = "A metal gauntlet with a piston-powered ram ontop for that extra 'ompfh' in your punch."
+ icon_state = "powerfist"
+ item_state = "powerfist"
+ flags = CONDUCT
+ attack_verb = list("whacked", "fisted", "power-punched")
+ force = 12
+ throwforce = 10
+ throw_range = 7
+ w_class = 3
+ origin_tech = "combat=5;powerstorage=3;syndicate=3"
+ var/click_delay = 1.5
+ var/fisto_setting = 1
+ var/gasperfist = 3
+ var/obj/item/weapon/tank/tank = null //Tank used for the gauntlet's piston-ram.
+
+
+/obj/item/weapon/melee/powerfist/Destroy()
+ if(tank)
+ qdel(tank)
+ tank = null
+ return ..()
+
+/obj/item/weapon/melee/powerfist/examine(mob/user)
+ ..()
+ if(!in_range(user, src))
+ to_chat(user, "You'll need to get closer to see any more.")
+ return
+ if(tank)
+ to_chat(user, "\icon [tank] It has \the [tank] mounted onto it.")
+
+/obj/item/weapon/melee/powerfist/attackby(obj/item/weapon/W, mob/user, params)
+ if(istype(W, /obj/item/weapon/tank))
+ if(!tank)
+ var/obj/item/weapon/tank/IT = W
+ if(IT.volume <= 3)
+ to_chat(user, "\The [IT] is too small for \the [src].")
+ return
+ updateTank(W, 0, user)
+ else if(istype(W, /obj/item/weapon/wrench))
+ switch(fisto_setting)
+ if(1)
+ fisto_setting = 2
+ if(2)
+ fisto_setting = 3
+ if(3)
+ fisto_setting = 1
+ playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
+ to_chat(user, "You tweak \the [src]'s piston valve to [fisto_setting].")
+ else if(istype(W, /obj/item/weapon/screwdriver))
+ if(tank)
+ updateTank(tank, 1, user)
+
+
+/obj/item/weapon/melee/powerfist/proc/updateTank(obj/item/weapon/tank/thetank, removing = 0, mob/living/carbon/human/user)
+ if(removing)
+ if(!tank)
+ to_chat(user, "\The [src] currently has no tank attached to it.")
+ return
+ to_chat(user, "You detach \the [thetank] from \the [src].")
+ tank.forceMove(get_turf(user))
+ user.put_in_hands(tank)
+ tank = null
+ if(!removing)
+ if(tank)
+ to_chat(user, "\The [src] already has a tank.")
+ return
+ if(!user.unEquip(thetank))
+ return
+ to_chat(user, "You hook \the [thetank] up to \the [src].")
+ tank = thetank
+ thetank.forceMove(src)
+
+
+/obj/item/weapon/melee/powerfist/attack(mob/living/target, mob/living/user)
+ if(!tank)
+ to_chat(user, "\The [src] can't operate without a source of gas!")
+ return
+ if(tank && !tank.air_contents.remove(gasperfist * fisto_setting))
+ to_chat(user, "\The [src]'s piston-ram lets out a weak hiss, it needs more gas!")
+ playsound(loc, 'sound/effects/refill.ogg', 50, 1)
+ return
+
+ user.do_attack_animation(target)
+
+ target.apply_damage(force * fisto_setting, BRUTE)
+ target.visible_message("[user]'s powerfist lets out a loud hiss as they punch [target.name]!", \
+ "You cry out in pain as [user]'s punch flings you backwards!")
+ new/obj/effect/kinetic_blast(target.loc)
+ playsound(loc, 'sound/weapons/resonator_blast.ogg', 50, 1)
+ playsound(loc, 'sound/weapons/genhit2.ogg', 50, 1)
+
+ var/atom/throw_target = get_edge_target_turf(target, get_dir(src, get_step_away(target, src)))
+ spawn(0)
+ target.throw_at(throw_target, 5 * fisto_setting, 0.2)
+
+ add_logs(target, user, "power fisted", src)
+
+ user.changeNext_move(CLICK_CD_MELEE * click_delay)
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/scissors.dm b/code/game/objects/items/weapons/scissors.dm
index 9f0c824dead..d213b6bcbb6 100644
--- a/code/game/objects/items/weapons/scissors.dm
+++ b/code/game/objects/items/weapons/scissors.dm
@@ -118,7 +118,7 @@
H.losebreath += 10 //30 Oxy damage over time
H.apply_damage(18, BRUTE, "head", sharp =1, edge =1, used_weapon = "scissors")
var/turf/location = get_turf(H)
- if (istype(location, /turf/simulated))
+ if(istype(location, /turf/simulated))
location.add_blood(H)
H.bloody_hands(H)
H.bloody_body(H)
diff --git a/code/game/objects/items/weapons/scrolls.dm b/code/game/objects/items/weapons/scrolls.dm
index 589f91b8302..90c98c6fdac 100644
--- a/code/game/objects/items/weapons/scrolls.dm
+++ b/code/game/objects/items/weapons/scrolls.dm
@@ -4,7 +4,7 @@
icon = 'icons/obj/wizard.dmi'
icon_state = "scroll"
var/uses = 4.0
- w_class = 2.0
+ w_class = 2
item_state = "paper"
throw_speed = 4
throw_range = 20
@@ -29,15 +29,15 @@
/obj/item/weapon/teleportation_scroll/Topic(href, href_list)
..()
- if (usr.stat || usr.restrained() || src.loc != usr)
+ if(usr.stat || usr.restrained() || src.loc != usr)
return
var/mob/living/carbon/human/H = usr
- if (!( istype(H, /mob/living/carbon/human)))
+ if(!( istype(H, /mob/living/carbon/human)))
return 1
- if ((usr == src.loc || (in_range(src, usr) && istype(src.loc, /turf))))
+ if((usr == src.loc || (in_range(src, usr) && istype(src.loc, /turf))))
usr.set_machine(src)
- if (href_list["spell_teleport"])
- if (src.uses >= 1)
+ if(href_list["spell_teleport"])
+ if(src.uses >= 1)
teleportscroll(H)
attack_self(H)
return
@@ -49,7 +49,7 @@
A = input(user, "Area to jump to", "BOOYEA", A) in teleportlocs
var/area/thearea = teleportlocs[A]
- if (user.stat || user.restrained())
+ if(user.stat || user.restrained())
return
if(!((user == loc || (in_range(src, user) && istype(src.loc, /turf)))))
return
diff --git a/code/game/objects/items/weapons/shards.dm b/code/game/objects/items/weapons/shards.dm
index 4add062aabc..bcc09a86f16 100644
--- a/code/game/objects/items/weapons/shards.dm
+++ b/code/game/objects/items/weapons/shards.dm
@@ -7,7 +7,7 @@
sharp = 1
edge = 1
desc = "Could probably be used as ... a throwing weapon?"
- w_class = 1.0
+ w_class = 1
force = 5.0
throwforce = 10.0
item_state = "shard-glass"
@@ -53,7 +53,7 @@
/obj/item/weapon/shard/Crossed(AM as mob|obj)
if(isliving(AM))
var/mob/living/M = AM
- if (M.incorporeal_move || M.flying)//you are incorporal or flying..no shard stepping!
+ if(M.incorporeal_move || M.flying)//you are incorporal or flying..no shard stepping!
return
to_chat(M, "\red You step on \the [src]!")
playsound(src.loc, 'sound/effects/glass_step.ogg', 50, 1) // not sure how to handle metal shards with sounds
diff --git a/code/game/objects/items/weapons/shields.dm b/code/game/objects/items/weapons/shields.dm
index a161755c285..809bf0d298d 100644
--- a/code/game/objects/items/weapons/shields.dm
+++ b/code/game/objects/items/weapons/shields.dm
@@ -1,5 +1,6 @@
/obj/item/weapon/shield
name = "shield"
+ block_chance = 50
/obj/item/weapon/shield/riot
name = "riot shield"
@@ -17,8 +18,10 @@
attack_verb = list("shoved", "bashed")
var/cooldown = 0 //shield bash cooldown. based on world.time
-/obj/item/weapon/shield/riot/IsShield()
- return 1
+/obj/item/weapon/shield/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance, damage, attack_type)
+ if(attack_type == THROWN_PROJECTILE_ATTACK)
+ final_block_chance += 30
+ return ..()
/obj/item/weapon/shield/riot/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/melee/baton))
@@ -41,12 +44,7 @@
icon_state = "buckler"
item_state = "buckler"
materials = list()
-
-/obj/item/weapon/shield/riot/buckler/IsShield()
- if(prob(60))
- return 1
- else
- return 0
+ block_chance = 30
/obj/item/weapon/shield/energy
name = "energy combat shield"
@@ -62,8 +60,8 @@
attack_verb = list("shoved", "bashed")
var/active = 0
-/obj/item/weapon/shield/energy/IsShield()
- return (active)
+/obj/item/weapon/shield/energy/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance)
+ return 0
/obj/item/weapon/shield/energy/IsReflect()
return (active)
@@ -109,8 +107,10 @@
w_class = 3
var/active = 0
-/obj/item/weapon/shield/riot/tele/IsShield()
- return (active)
+/obj/item/weapon/shield/riot/tele/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance)
+ if(active)
+ return ..()
+ return 0
/obj/item/weapon/shield/riot/tele/attack_self(mob/living/user)
active = !active
diff --git a/code/game/objects/items/weapons/signs.dm b/code/game/objects/items/weapons/signs.dm
index 7ad4f40b668..00ac859528d 100644
--- a/code/game/objects/items/weapons/signs.dm
+++ b/code/game/objects/items/weapons/signs.dm
@@ -4,7 +4,7 @@
name = "blank picket sign"
desc = "It's blank"
force = 5
- w_class = 4.0
+ w_class = 4
attack_verb = list("bashed","smacked")
var/delayed = 0 //used to do delays
@@ -35,9 +35,10 @@
sleep(8)
delayed = 0
-/datum/table_recipe/picket_sign
+/datum/crafting_recipe/picket_sign
name = "Picket Sign"
result = /obj/item/weapon/picket_sign
reqs = list(/obj/item/stack/rods = 1,
/obj/item/stack/sheet/cardboard = 2)
- time = 80
\ No newline at end of file
+ time = 80
+ category = CAT_MISC
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/soap.dm b/code/game/objects/items/weapons/soap.dm
index 961547d362f..f21c0581888 100644
--- a/code/game/objects/items/weapons/soap.dm
+++ b/code/game/objects/items/weapons/soap.dm
@@ -4,7 +4,7 @@
gender = PLURAL
icon = 'icons/obj/items.dmi'
icon_state = "soap"
- w_class = 1.0
+ w_class = 1
throwforce = 0
throw_speed = 4
throw_range = 20
@@ -35,7 +35,7 @@
to_chat(user, "You 'clean' \the [target.name].")
if(istype(target, /turf/simulated))
new /obj/effect/decal/cleanable/blood/gibs/cleangibs(target)
- else if (istype(target,/mob/living/carbon))
+ else if(istype(target,/mob/living/carbon))
for(var/obj/item/carried_item in target.contents)
if(!istype(carried_item, /obj/item/weapon/implant))//If it's not an implant.
carried_item.add_blood(target)//Oh yes, there will be blood...
diff --git a/code/game/objects/items/weapons/staff.dm b/code/game/objects/items/weapons/staff.dm
index 049339a1b01..ffaadb59d59 100644
--- a/code/game/objects/items/weapons/staff.dm
+++ b/code/game/objects/items/weapons/staff.dm
@@ -7,8 +7,7 @@
throwforce = 5.0
throw_speed = 1
throw_range = 5
- w_class = 2.0
- flags = NOSHIELD
+ w_class = 2
armour_penetration = 100
attack_verb = list("bludgeoned", "whacked", "disciplined")
@@ -73,5 +72,4 @@
throwforce = 5.0
throw_speed = 1
throw_range = 5
- w_class = 2.0
- flags = NOSHIELD
\ No newline at end of file
+ w_class = 2
diff --git a/code/game/objects/items/weapons/stock_parts.dm b/code/game/objects/items/weapons/stock_parts.dm
index 6e0500ffd38..e6e58196108 100644
--- a/code/game/objects/items/weapons/stock_parts.dm
+++ b/code/game/objects/items/weapons/stock_parts.dm
@@ -59,7 +59,7 @@
desc = "What?"
gender = PLURAL
icon = 'icons/obj/stock_parts.dmi'
- w_class = 2.0
+ w_class = 2
var/rating = 1
New()
src.pixel_x = rand(-5.0, 5)
diff --git a/code/game/objects/items/weapons/storage/artistic_toolbox.dm b/code/game/objects/items/weapons/storage/artistic_toolbox.dm
index 56a3279dde0..81ba661115a 100644
--- a/code/game/objects/items/weapons/storage/artistic_toolbox.dm
+++ b/code/game/objects/items/weapons/storage/artistic_toolbox.dm
@@ -73,7 +73,7 @@
..()
/obj/item/weapon/storage/toolbox/green/memetic/proc/consume(mob/M)
- if (!M)
+ if(!M)
return
hunger = 0
hunger_message_level = 0
diff --git a/code/game/objects/items/weapons/storage/backpack.dm b/code/game/objects/items/weapons/storage/backpack.dm
index 6c59e98385f..fa8de4f51bf 100644
--- a/code/game/objects/items/weapons/storage/backpack.dm
+++ b/code/game/objects/items/weapons/storage/backpack.dm
@@ -10,7 +10,7 @@
item_state = "backpack"
lefthand_file = 'icons/mob/inhands/clothing_lefthand.dmi'
righthand_file = 'icons/mob/inhands/clothing_righthand.dmi'
- w_class = 4.0
+ w_class = 4
slot_flags = SLOT_BACK //ERROOOOO
max_w_class = 3
max_combined_w_class = 21
@@ -63,13 +63,13 @@
. = ..()
proc/failcheck(mob/user as mob)
- if (prob(src.reliability)) return 1 //No failure
- if (prob(src.reliability))
+ if(prob(src.reliability)) return 1 //No failure
+ if(prob(src.reliability))
to_chat(user, "\red The Bluespace portal resists your attempt to add another item.")//light failure
else
to_chat(user, "\red The Bluespace generator malfunctions!")
- for (var/obj/O in src.contents) //it broke, delete what was in it
+ for(var/obj/O in src.contents) //it broke, delete what was in it
qdel(O)
crit_fail = 1
icon_state = "brokenpack"
@@ -85,7 +85,7 @@
desc = "Space Santa uses this to deliver toys to all the nice children in space on Christmas! Wow, it's pretty big!"
icon_state = "giftbag0"
item_state = "giftbag"
- w_class = 4.0
+ w_class = 4
max_w_class = 3
max_combined_w_class = 400 // can store a ton of shit!
@@ -322,6 +322,25 @@
new /obj/item/clothing/mask/muzzle(src)
new /obj/item/device/mmi/syndie(src)
+/obj/item/weapon/storage/backpack/duffel/syndie/surgery_fake //for maint spawns
+ name = "surgery dufflebag"
+ desc = "A suspicious looking dufflebag for holding surgery tools."
+ icon_state = "duffel-syndimed"
+ item_state = "duffle-syndimed"
+
+/obj/item/weapon/storage/backpack/duffel/syndie/surgery_fake/New()
+ ..()
+ new /obj/item/weapon/scalpel(src)
+ new /obj/item/weapon/hemostat(src)
+ new /obj/item/weapon/retractor(src)
+ new /obj/item/weapon/cautery(src)
+ new /obj/item/weapon/bonegel(src)
+ new /obj/item/weapon/bonesetter(src)
+ new /obj/item/weapon/FixOVein(src)
+ if(prob(50))
+ new /obj/item/weapon/circular_saw(src)
+ new /obj/item/weapon/surgicaldrill(src)
+
/obj/item/weapon/storage/backpack/duffel/captain
name = "captain's duffelbag"
desc = "A duffelbag designed to hold large quantities of condoms."
diff --git a/code/game/objects/items/weapons/storage/bags.dm b/code/game/objects/items/weapons/storage/bags.dm
index 41bc851dff1..af4d9aa6008 100644
--- a/code/game/objects/items/weapons/storage/bags.dm
+++ b/code/game/objects/items/weapons/storage/bags.dm
@@ -198,7 +198,7 @@
new /obj/item/seeds/grassseed(O.loc, O)
for(var/mob/M in range(1))
- if (M.s_active == src)
+ if(M.s_active == src)
src.close(M)
@@ -263,7 +263,7 @@
if(!inserted || !S.amount)
usr.unEquip(S)
usr.update_icons() //update our overlays
- if (usr.client && usr.s_active != src)
+ if(usr.client && usr.s_active != src)
usr.client.screen -= S
S.dropped(usr)
if(!S.amount)
@@ -296,7 +296,7 @@
var/row_num = 0
var/col_count = min(7,storage_slots) -1
- if (adjusted_contents > 7)
+ if(adjusted_contents > 7)
row_num = round((adjusted_contents-1) / 7) // 7 is the maximum allowed width.
src.standard_orient_objs(row_num, col_count, numbered_contents)
return
@@ -375,7 +375,7 @@
max_combined_w_class = 21
max_w_class = 3
w_class = 4 //Bigger than a book because physics
- can_hold = list("/obj/item/weapon/book", "/obj/item/weapon/spellbook") //No bibles, consistent with bookcase
+ can_hold = list("/obj/item/weapon/book", "/obj/item/weapon/storage/bible", "/obj/item/weapon/tome", "/obj/item/weapon/spellbook")
/*
* Trays - Agouri
@@ -389,7 +389,7 @@
throwforce = 10.0
throw_speed = 3
throw_range = 5
- w_class = 4.0
+ w_class = 4
flags = CONDUCT
materials = list(MAT_METAL=3000)
@@ -432,17 +432,17 @@
/obj/item/weapon/storage/bag/tray/cyborg
/obj/item/weapon/storage/bag/tray/cyborg/afterattack(atom/target, mob/user as mob)
- if ( isturf(target) || istype(target,/obj/structure/table) )
+ if( isturf(target) || istype(target,/obj/structure/table) )
var foundtable = istype(target,/obj/structure/table/)
- if ( !foundtable ) //it must be a turf!
+ if( !foundtable ) //it must be a turf!
for(var/obj/structure/table/T in target)
foundtable = 1
break
var turf/dropspot
- if ( !foundtable ) // don't unload things onto walls or other silly places.
+ if( !foundtable ) // don't unload things onto walls or other silly places.
dropspot = user.loc
- else if ( isturf(target) ) // they clicked on a turf with a table in it
+ else if( isturf(target) ) // they clicked on a turf with a table in it
dropspot = target
else // they clicked on a table
dropspot = target.loc
@@ -462,8 +462,8 @@
if(I)
step(I, pick(NORTH,SOUTH,EAST,WEST))
sleep(rand(2,4))
- if ( droppedSomething )
- if ( foundtable )
+ if( droppedSomething )
+ if( foundtable )
user.visible_message("\blue [user] unloads their service tray.")
else
user.visible_message("\blue [user] drops all the items on their tray.")
diff --git a/code/game/objects/items/weapons/storage/belt.dm b/code/game/objects/items/weapons/storage/belt.dm
index d4863da97b9..a0e3d4dd69e 100644
--- a/code/game/objects/items/weapons/storage/belt.dm
+++ b/code/game/objects/items/weapons/storage/belt.dm
@@ -26,7 +26,7 @@
if(!istype(over_object, /obj/screen))
return ..()
playsound(src.loc, "rustle", 50, 1, -5)
- if (!M.restrained() && !M.stat && can_use())
+ if(!M.restrained() && !M.stat && can_use())
switch(over_object.name)
if("r_hand")
M.unEquip(src)
@@ -68,10 +68,12 @@
new /obj/item/weapon/crowbar(src)
new /obj/item/weapon/wirecutters(src)
new /obj/item/stack/cable_coil(src,30,pick("red","yellow","orange"))
+ update_icon()
/obj/item/weapon/storage/belt/utility/full/multitool/New()
..()
new /obj/item/device/multitool(src)
+ update_icon()
/obj/item/weapon/storage/belt/utility/atmostech/New()
..()
@@ -82,6 +84,7 @@
new /obj/item/weapon/wirecutters(src)
new /obj/item/device/t_scanner(src)
new /obj/item/weapon/extinguisher/mini(src)
+ update_icon()
@@ -124,6 +127,7 @@
new /obj/item/weapon/reagent_containers/food/pill/salicylic(src)
new /obj/item/weapon/reagent_containers/food/pill/salicylic(src)
new /obj/item/weapon/reagent_containers/food/pill/salicylic(src)
+ update_icon()
/obj/item/weapon/storage/belt/botany
@@ -177,12 +181,13 @@
"/obj/item/weapon/melee/classic_baton",
"/obj/item/device/flashlight/seclite",
"/obj/item/taperoll/police",
- "/obj/item/weapon/melee/classic_baton/telescopic"
- )
+ "/obj/item/weapon/melee/classic_baton/telescopic",
+ "/obj/item/weapon/restraints/legcuffs/bola")
/obj/item/weapon/storage/belt/security/sec/New()
..()
new /obj/item/device/flashlight/seclite(src)
+ update_icon()
/obj/item/weapon/storage/belt/security/response_team/New()
..()
@@ -191,6 +196,7 @@
new /obj/item/device/flash(src)
new /obj/item/weapon/melee/classic_baton/telescopic(src)
new /obj/item/weapon/grenade/flashbang(src)
+ update_icon()
/obj/item/weapon/storage/belt/soulstone
name = "soul stone belt"
@@ -211,6 +217,7 @@
new /obj/item/device/soulstone(src)
new /obj/item/device/soulstone(src)
new /obj/item/device/soulstone(src)
+ update_icon()
/obj/item/weapon/storage/belt/champion
@@ -262,6 +269,7 @@
new /obj/item/weapon/soap(src)
new /obj/item/weapon/grenade/chem_grenade/cleaner(src)
new /obj/item/weapon/grenade/chem_grenade/cleaner(src)
+ update_icon()
/obj/item/weapon/storage/belt/lazarus
name = "trainer's belt"
@@ -366,6 +374,8 @@
for(var/obj/item/weapon/gun/magic/wand/W in contents) //All wands in this pack come in the best possible condition
W.max_charges = initial(W.max_charges)
W.charges = W.max_charges
+ update_icon()
+
/obj/item/weapon/storage/belt/fannypack
name = "fannypack"
@@ -443,13 +453,13 @@
can_hold = list()
proc/failcheck(mob/user as mob)
- if (prob(src.reliability)) return 1 //No failure
- if (prob(src.reliability))
+ if(prob(src.reliability)) return 1 //No failure
+ if(prob(src.reliability))
to_chat(user, "\red The Bluespace portal resists your attempt to add another item.")//light failure
else
to_chat(user, "\red The Bluespace generator malfunctions!")
- for (var/obj/O in src.contents) //it broke, delete what was in it
+ for(var/obj/O in src.contents) //it broke, delete what was in it
qdel(O)
crit_fail = 1
return 0
@@ -466,7 +476,7 @@
allow_quick_empty = 1
can_hold = list(
"/obj/item/weapon/grenade/smokebomb",
- "/obj/item/weapon/legcuffs/bolas"
+ "/obj/item/weapon/restraints/legcuffs/bola"
)
flags = NODROP
@@ -482,8 +492,8 @@
new /obj/item/weapon/grenade/smokebomb(src)
new /obj/item/weapon/grenade/smokebomb(src)
new /obj/item/weapon/grenade/smokebomb(src)
- new /obj/item/weapon/legcuffs/bolas(src)
- new /obj/item/weapon/legcuffs/bolas(src)
+ new /obj/item/weapon/restraints/legcuffs/bola(src)
+ new /obj/item/weapon/restraints/legcuffs/bola(src)
processing_objects.Add(src)
cooldown = world.time
@@ -494,7 +504,7 @@
for(S in src)
smokecount++
bolacount = 0
- var/obj/item/weapon/legcuffs/bolas/B
+ var/obj/item/weapon/restraints/legcuffs/bola/B
for(B in src)
bolacount++
if(smokecount < 4)
@@ -503,7 +513,7 @@
smokecount++
if(bolacount < 2)
while(bolacount < 2)
- new /obj/item/weapon/legcuffs/bolas(src)
+ new /obj/item/weapon/restraints/legcuffs/bola(src)
bolacount++
cooldown = world.time
update_icon()
@@ -519,9 +529,9 @@
// As a last resort, the belt can be used as a plastic explosive with a fixed timer (15 seconds). Naturally, you'll lose all your gear...
// Of course, it could be worse. It could spawn a singularity!
/obj/item/weapon/storage/belt/bluespace/owlman/afterattack(atom/target as obj|turf, mob/user as mob, flag)
- if (!flag)
+ if(!flag)
return
- if (istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage) || istype(target, /obj/structure/table) || istype(target, /obj/structure/closet))
+ if(istype(target, /turf/unsimulated) || istype(target, /turf/simulated/shuttle) || istype(target, /obj/item/weapon/storage) || istype(target, /obj/structure/table) || istype(target, /obj/structure/closet))
return
to_chat(user, "Planting explosives...")
user.visible_message("[user.name] is fiddling with their toolbelt.")
@@ -536,8 +546,8 @@
target = target
loc = null
var/location
- if (isturf(target)) location = target
- if (ismob(target))
+ if(isturf(target)) location = target
+ if(ismob(target))
target:attack_log += "\[[time_stamp()]\] Had the [name] planted on them by [user.real_name] ([user.ckey])"
user.visible_message("\red [user.name] finished planting an explosive on [target.name]!")
target.overlays += image('icons/obj/assemblies.dmi', "plastic-explosive2")
@@ -547,12 +557,12 @@
if(ismob(target) || isobj(target))
location = target.loc // These things can move
explosion(location, -1, -1, 2, 3)
- if (istype(target, /turf/simulated/wall)) target:dismantle_wall(1)
+ if(istype(target, /turf/simulated/wall)) target:dismantle_wall(1)
else target.ex_act(1)
- if (isobj(target))
- if (target)
+ if(isobj(target))
+ if(target)
qdel(target)
- if (src)
+ if(src)
qdel(src)
*/
diff --git a/code/game/objects/items/weapons/storage/bible.dm b/code/game/objects/items/weapons/storage/bible.dm
index 3fa521a7451..57332ae24d6 100644
--- a/code/game/objects/items/weapons/storage/bible.dm
+++ b/code/game/objects/items/weapons/storage/bible.dm
@@ -4,7 +4,7 @@
icon_state ="bible"
throw_speed = 1
throw_range = 5
- w_class = 3.0
+ w_class = 3
var/mob/affecting = null
var/deity_name = "Christ"
@@ -52,7 +52,7 @@
else
M.LAssailant = user
- if (!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
+ if(!(istype(user, /mob/living/carbon/human) || ticker) && ticker.mode.name != "monkey")
to_chat(user, "\red You don't have the dexterity to do this!")
return
if(!chaplain)
@@ -60,7 +60,7 @@
user.take_organ_damage(0,10)
return
- if ((CLUMSY in user.mutations) && prob(50))
+ if((CLUMSY in user.mutations) && prob(50))
to_chat(user, "\red The [src] slips out of your hand and hits your head.")
user.take_organ_damage(10)
user.Paralyse(20)
@@ -69,12 +69,12 @@
// if(..() == BLOCKED)
// return
- if (M.stat !=2)
+ if(M.stat !=2)
/*if((M.mind in ticker.mode.cult) && (prob(20)))
to_chat(M, "\red The power of [src.deity_name] clears your mind of heresy!")
to_chat(user, "\red You see how [M]'s eyes become clear, the cult no longer holds control over him!")
ticker.mode.remove_cultist(M.mind)*/
- if ((istype(M, /mob/living/carbon/human) && prob(60)))
+ if((istype(M, /mob/living/carbon/human) && prob(60)))
bless(M)
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [] heals [] with the power of [src.deity_name]!", user, M), 1)
@@ -96,7 +96,7 @@
/obj/item/weapon/storage/bible/afterattack(atom/A, mob/user as mob, proximity)
if(!proximity)
return
- if (istype(A, /turf/simulated/floor))
+ if(istype(A, /turf/simulated/floor))
to_chat(user, "You hit the floor with the bible.")
if(user.mind && (user.mind.assigned_role == "Chaplain"))
call(/obj/effect/rune/proc/revealrunes)(src)
diff --git a/code/game/objects/items/weapons/storage/boxes.dm b/code/game/objects/items/weapons/storage/boxes.dm
index ce1e6aad9bb..76cbc9ab102 100644
--- a/code/game/objects/items/weapons/storage/boxes.dm
+++ b/code/game/objects/items/weapons/storage/boxes.dm
@@ -39,22 +39,29 @@
New()
..()
contents = list()
- sleep(1)
new /obj/item/clothing/mask/breath( src )
new /obj/item/weapon/tank/emergency_oxygen( src )
new /obj/item/weapon/reagent_containers/hypospray/autoinjector( src )
return
-/obj/item/weapon/storage/box/engineer/
+/obj/item/weapon/storage/box/engineer
New()
..()
contents = list()
- sleep(1)
new /obj/item/clothing/mask/breath( src )
new /obj/item/weapon/tank/emergency_oxygen/engi( src )
new /obj/item/weapon/reagent_containers/hypospray/autoinjector( src )
return
+/obj/item/weapon/storage/box/survival_mining
+ New()
+ ..()
+ contents = list()
+ new /obj/item/clothing/mask/breath(src)
+ new /obj/item/weapon/tank/emergency_oxygen/engi(src)
+ new /obj/item/weapon/crowbar/red(src)
+ new /obj/item/weapon/reagent_containers/hypospray/autoinjector(src)
+
/obj/item/weapon/storage/box/gloves
name = "box of latex gloves"
desc = "Contains white gloves."
@@ -261,6 +268,19 @@
new /obj/item/weapon/implantcase/death_alarm(src)
new /obj/item/weapon/implanter(src)
+/obj/item/weapon/storage/box/tapes
+ name = "Tape Box"
+ desc = "A box of spare recording tapes"
+ icon_state = "box"
+
+ New()
+ ..()
+ new /obj/item/device/tape(src)
+ new /obj/item/device/tape(src)
+ new /obj/item/device/tape(src)
+ new /obj/item/device/tape(src)
+ new /obj/item/device/tape(src)
+ new /obj/item/device/tape(src)
/obj/item/weapon/storage/box/rxglasses
name = "prescription glasses"
@@ -603,7 +623,7 @@
icon_state = "syringe"
New()
..()
- for (var/i; i < storage_slots; i++)
+ for(var/i; i < storage_slots; i++)
new /obj/item/weapon/reagent_containers/hypospray/autoinjector(src)
/obj/item/weapon/storage/box/autoinjector/utility
@@ -685,3 +705,73 @@
new /obj/item/weapon/lipstick/green(src)
new /obj/item/weapon/lipstick/blue(src)
new /obj/item/weapon/lipstick/white(src)
+
+#define NODESIGN "None"
+#define NANOTRASEN "NanotrasenStandard"
+#define SYNDI "SyndiSnacks"
+#define HEART "Heart"
+#define SMILE "SmileyFace"
+
+/obj/item/weapon/storage/box/papersack
+ name = "paper sack"
+ desc = "A sack neatly crafted out of paper."
+ icon_state = "paperbag_None"
+ item_state = "paperbag_None"
+ foldable = null
+ var/design = NODESIGN
+
+/obj/item/weapon/storage/box/papersack/update_icon()
+ if(!contents.len)
+ icon_state = "[item_state]"
+ else icon_state = "[item_state]_closed"
+
+/obj/item/weapon/storage/box/papersack/attackby(obj/item/weapon/W, mob/user, params)
+ if(istype(W, /obj/item/weapon/pen))
+ //if a pen is used on the sack, dialogue to change its design appears
+ if(contents.len)
+ to_chat(user, "You can't modify [src] with items still inside!")
+ return
+ var/list/designs = list(NODESIGN, NANOTRASEN, SYNDI, HEART, SMILE)
+ var/switchDesign = input("Select a Design:", "Paper Sack Design", designs[1]) as null|anything in designs
+ if(!switchDesign)
+ return
+ if(get_dist(usr, src) > 1 && !usr.incapacitated())
+ to_chat(usr, "You have moved too far away!")
+ return
+ if(design == switchDesign)
+ return
+ to_chat(usr, "You make some modifications to [src] using your pen.")
+ design = switchDesign
+ icon_state = "paperbag_[design]"
+ item_state = "paperbag_[design]"
+ switch(design)
+ if(NODESIGN)
+ desc = "A sack neatly crafted out of paper."
+ if(NANOTRASEN)
+ desc = "A standard Nanotrasen paper lunch sack for loyal employees on the go."
+ if(SYNDI)
+ desc = "The design on this paper sack is a remnant of the notorious 'SyndieSnacks' program."
+ if(HEART)
+ desc = "A paper sack with a heart etched onto the side."
+ if(SMILE)
+ desc = "A paper sack with a crude smile etched onto the side."
+ return
+ else if(is_sharp(W))
+ if(!contents.len)
+ if(item_state == "paperbag_None")
+ to_chat(user, "You cut eyeholes into [src].")
+ new /obj/item/clothing/head/papersack(user.loc)
+ qdel(src)
+ return
+ else if(item_state == "paperbag_SmileyFace")
+ to_chat(user, "You cut eyeholes into [src] and modify the design.")
+ new /obj/item/clothing/head/papersack/smiley(user.loc)
+ qdel(src)
+ return
+ return ..()
+
+#undef NODESIGN
+#undef NANOTRASEN
+#undef SYNDI
+#undef HEART
+#undef SMILE
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/storage/briefcase.dm b/code/game/objects/items/weapons/storage/briefcase.dm
index 390f7632ca3..543865aa592 100644
--- a/code/game/objects/items/weapons/storage/briefcase.dm
+++ b/code/game/objects/items/weapons/storage/briefcase.dm
@@ -8,7 +8,7 @@
force = 8.0
throw_speed = 2
throw_range = 4
- w_class = 4.0
+ w_class = 4
max_w_class = 3
max_combined_w_class = 21
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
diff --git a/code/game/objects/items/weapons/storage/fancy.dm b/code/game/objects/items/weapons/storage/fancy.dm
index 31ead836204..367874b0d7d 100644
--- a/code/game/objects/items/weapons/storage/fancy.dm
+++ b/code/game/objects/items/weapons/storage/fancy.dm
@@ -115,7 +115,7 @@
desc = "A box of crayons for all your rune drawing needs."
icon = 'icons/obj/crayons.dmi'
icon_state = "crayonbox"
- w_class = 2.0
+ w_class = 2
storage_slots = 6
icon_type = "crayon"
can_hold = list(
@@ -192,7 +192,6 @@
/obj/item/weapon/storage/fancy/cigarettes/update_icon()
icon_state = "[initial(icon_state)][contents.len]"
- desc = "There are [contents.len] cig\s left!"
return
/obj/item/weapon/storage/fancy/cigarettes/proc/lace_cigarette(var/obj/item/clothing/mask/cigarette/C as obj)
@@ -355,7 +354,7 @@
var/total_contents = src.contents.len - itemremoved
src.icon_state = "vialbox[total_contents]"
src.overlays.Cut()
- if (!broken)
+ if(!broken)
overlays += image(icon, src, "led[locked]")
if(locked)
overlays += image(icon, src, "cover")
@@ -386,4 +385,4 @@
new /obj/item/weapon/egg_scoop(src)
new /obj/item/weapon/fish_net(src)
new /obj/item/weapon/tank_brush(src)
- new /obj/item/weapon/fishfood(src)
\ No newline at end of file
+ new /obj/item/weapon/fishfood(src)
diff --git a/code/game/objects/items/weapons/storage/firstaid.dm b/code/game/objects/items/weapons/storage/firstaid.dm
index a11d00dbccd..0c03e65beab 100644
--- a/code/game/objects/items/weapons/storage/firstaid.dm
+++ b/code/game/objects/items/weapons/storage/firstaid.dm
@@ -31,7 +31,7 @@
New()
..()
- if (empty) return
+ if(empty) return
icon_state = pick("ointment","firefirstaid")
@@ -53,7 +53,7 @@
New()
..()
- if (empty) return
+ if(empty) return
new /obj/item/weapon/reagent_containers/food/pill/patch/styptic( src )
new /obj/item/weapon/reagent_containers/food/pill/patch/styptic( src )
new /obj/item/weapon/reagent_containers/food/pill/salicylic( src )
@@ -71,7 +71,7 @@
New()
..()
- if (empty) return
+ if(empty) return
icon_state = pick("antitoxin","antitoxfirstaid","antitoxfirstaid2","antitoxfirstaid3")
@@ -95,7 +95,7 @@
New()
..()
- if (empty) return
+ if(empty) return
new /obj/item/weapon/reagent_containers/food/pill/salbutamol( src )
new /obj/item/weapon/reagent_containers/food/pill/salbutamol( src )
new /obj/item/weapon/reagent_containers/food/pill/salbutamol( src )
@@ -114,7 +114,7 @@
New()
..()
- if (empty) return
+ if(empty) return
icon_state = pick("brute","brute2")
@@ -138,13 +138,13 @@
/obj/item/weapon/storage/firstaid/adv/New()
..()
- if (empty) return
+ if(empty) return
new /obj/item/weapon/reagent_containers/hypospray/autoinjector( src )
- new /obj/item/stack/medical/advanced/bruise_pack(src)
- new /obj/item/stack/medical/advanced/bruise_pack(src)
- new /obj/item/stack/medical/advanced/bruise_pack(src)
- new /obj/item/stack/medical/advanced/ointment(src)
- new /obj/item/stack/medical/advanced/ointment(src)
+ new /obj/item/stack/medical/bruise_pack/advanced(src)
+ new /obj/item/stack/medical/bruise_pack/advanced(src)
+ new /obj/item/stack/medical/bruise_pack/advanced(src)
+ new /obj/item/stack/medical/ointment/advanced(src)
+ new /obj/item/stack/medical/ointment/advanced(src)
new /obj/item/stack/medical/splint(src)
return
@@ -164,7 +164,7 @@
/obj/item/weapon/storage/firstaid/tactical/New()
..()
- if (empty) return
+ if(empty) return
new /obj/item/clothing/accessory/stethoscope( src )
new /obj/item/weapon/defibrillator/compact/combat/loaded(src)
new /obj/item/weapon/reagent_containers/hypospray/combat(src)
@@ -209,7 +209,7 @@
icon_state = "pill_canister"
icon = 'icons/obj/chemical.dmi'
item_state = "contsolid"
- w_class = 2.0
+ w_class = 2
can_hold = list("/obj/item/weapon/reagent_containers/food/pill","/obj/item/weapon/dice","/obj/item/weapon/paper")
allow_quick_gather = 1
use_to_pickup = 1
@@ -223,11 +223,11 @@
base_name = name
/obj/item/weapon/storage/pill_bottle/MouseDrop(obj/over_object as obj) //Quick pillbottle fix. -Agouri
- if (ishuman(usr)) //Can monkeys even place items in the pocket slots? Leaving this in just in case~
+ if(ishuman(usr)) //Can monkeys even place items in the pocket slots? Leaving this in just in case~
var/mob/M = usr
- if (!( istype(over_object, /obj/screen) ))
+ if(!( istype(over_object, /obj/screen) ))
return ..()
- if ((!( M.restrained() ) && !( M.stat ) /*&& M.pocket == src*/))
+ if((!( M.restrained() ) && !( M.stat ) /*&& M.pocket == src*/))
switch(over_object.name)
if("r_hand")
M.unEquip(src)
@@ -238,7 +238,7 @@
src.add_fingerprint(usr)
return
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
- if (usr.s_active)
+ if(usr.s_active)
usr.s_active.close(usr)
src.show_to(usr)
return
diff --git a/code/game/objects/items/weapons/storage/internal.dm b/code/game/objects/items/weapons/storage/internal.dm
index 33ddaf498f2..f3dab6ce8ea 100644
--- a/code/game/objects/items/weapons/storage/internal.dm
+++ b/code/game/objects/items/weapons/storage/internal.dm
@@ -30,24 +30,24 @@
//returns 1 if the master item's parent's MouseDrop() should be called, 0 otherwise. It's strange, but no other way of
//doing it without the ability to call another proc's parent, really.
/obj/item/weapon/storage/internal/proc/handle_mousedrop(mob/user as mob, obj/over_object as obj)
- if (ishuman(user)) //so monkeys can take off their backpacks -- Urist
+ if(ishuman(user)) //so monkeys can take off their backpacks -- Urist
- if (istype(user.loc,/obj/mecha)) // stops inventory actions in a mech
+ if(istype(user.loc,/obj/mecha)) // stops inventory actions in a mech
return 0
if(over_object == user && Adjacent(user)) // this must come before the screen objects only block
src.open(user)
return 0
- if (!( istype(over_object, /obj/screen) ))
+ if(!( istype(over_object, /obj/screen) ))
return 1
//makes sure master_item is equipped before putting it in hand, so that we can't drag it into our hand from miles away.
//there's got to be a better way of doing this...
- if (!(master_item.loc == user) || (master_item.loc && master_item.loc.loc == user))
+ if(!(master_item.loc == user) || (master_item.loc && master_item.loc.loc == user))
return 0
- if (!( user.restrained() ) && !( user.stat ))
+ if(!( user.restrained() ) && !( user.stat ))
switch(over_object.name)
if("r_hand")
user.unEquip(master_item)
@@ -76,12 +76,12 @@
return 0
src.add_fingerprint(user)
- if (master_item.loc == user)
+ if(master_item.loc == user)
src.open(user)
return 0
for(var/mob/M in range(1, master_item.loc))
- if (M.s_active == src)
+ if(M.s_active == src)
src.close(M)
return 1
diff --git a/code/game/objects/items/weapons/storage/lockbox.dm b/code/game/objects/items/weapons/storage/lockbox.dm
index cb6d91b7dee..7cc71918905 100644
--- a/code/game/objects/items/weapons/storage/lockbox.dm
+++ b/code/game/objects/items/weapons/storage/lockbox.dm
@@ -18,7 +18,7 @@
attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/card/id))
+ if(istype(W, /obj/item/weapon/card/id))
if(src.broken)
to_chat(user, "It appears to be broken.")
return
diff --git a/code/game/objects/items/weapons/storage/secure.dm b/code/game/objects/items/weapons/storage/secure.dm
index dba3fb620e3..dad7b46a161 100644
--- a/code/game/objects/items/weapons/storage/secure.dm
+++ b/code/game/objects/items/weapons/storage/secure.dm
@@ -23,7 +23,7 @@
var/l_hacking = 0
var/emagged = 0
var/open = 0
- w_class = 3.0
+ w_class = 3
max_w_class = 2
max_combined_w_class = 14
@@ -33,19 +33,19 @@
attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(locked)
- if ((istype(W, /obj/item/weapon/melee/energy/blade)) && (!src.emagged))
+ if((istype(W, /obj/item/weapon/melee/energy/blade)) && (!src.emagged))
emag_act(user, W)
- if (istype(W, /obj/item/weapon/screwdriver))
- if (do_after(user, 20, target = src))
+ if(istype(W, /obj/item/weapon/screwdriver))
+ if(do_after(user, 20, target = src))
src.open =! src.open
user.show_message(text("\blue You [] the service panel.", (src.open ? "open" : "close")))
return
- if ((istype(W, /obj/item/device/multitool)) && (src.open == 1)&& (!src.l_hacking))
+ if((istype(W, /obj/item/device/multitool)) && (src.open == 1)&& (!src.l_hacking))
user.show_message(text("\red Now attempting to reset internal memory, please hold."), 1)
src.l_hacking = 1
- if (do_after(usr, 100, target = src))
- if (prob(40))
+ if(do_after(usr, 100, target = src))
+ if(prob(40))
src.l_setshort = 1
src.l_set = 0
user.show_message(text("\red Internal memory reset. Please give it a few seconds to reinitialize."), 1)
@@ -85,7 +85,7 @@
MouseDrop(over_object, src_location, over_location)
- if (locked)
+ if(locked)
src.add_fingerprint(usr)
return
..()
@@ -95,28 +95,28 @@
user.set_machine(src)
var/dat = text("[] \n\nLock Status: []",src, (src.locked ? "LOCKED" : "UNLOCKED"))
var/message = "Code"
- if ((src.l_set == 0) && (!src.emagged) && (!src.l_setshort))
+ if((src.l_set == 0) && (!src.emagged) && (!src.l_setshort))
dat += text("
\n5-DIGIT PASSCODE NOT SET. ENTER NEW PASSCODE.")
- if (src.emagged)
+ if(src.emagged)
dat += text("
\nLOCKING SYSTEM ERROR - 1701")
- if (src.l_setshort)
+ if(src.l_setshort)
dat += text("
\nALERT: MEMORY SYSTEM ERROR - 6040 201")
message = text("[]", src.code)
- if (!src.locked)
+ if(!src.locked)
message = "*****"
dat += text("
\n>[] \n1-2-3 \n4-5-6 \n7-8-9 \nR-0-E \n", message, src, src, src, src, src, src, src, src, src, src, src, src)
user << browse(dat, "window=caselock;size=300x280")
Topic(href, href_list)
..()
- if ((usr.stat || usr.restrained()) || (get_dist(src, usr) > 1))
+ if((usr.stat || usr.restrained()) || (get_dist(src, usr) > 1))
return
- if (href_list["type"])
- if (href_list["type"] == "E")
- if ((src.l_set == 0) && (length(src.code) == 5) && (!src.l_setshort) && (src.code != "ERROR"))
+ if(href_list["type"])
+ if(href_list["type"] == "E")
+ if((src.l_set == 0) && (length(src.code) == 5) && (!src.l_setshort) && (src.code != "ERROR"))
src.l_code = src.code
src.l_set = 1
- else if ((src.code == src.l_code) && (src.emagged == 0) && (src.l_set == 1))
+ else if((src.code == src.l_code) && (src.emagged == 0) && (src.l_set == 1))
src.locked = 0
src.overlays = null
overlays += image('icons/obj/storage.dmi', icon_opened)
@@ -124,18 +124,18 @@
else
src.code = "ERROR"
else
- if ((href_list["type"] == "R") && (src.emagged == 0) && (!src.l_setshort))
+ if((href_list["type"] == "R") && (src.emagged == 0) && (!src.l_setshort))
src.locked = 1
src.overlays = null
src.code = null
src.close(usr)
else
src.code += text("[]", href_list["type"])
- if (length(src.code) > 5)
+ if(length(src.code) > 5)
src.code = "ERROR"
src.add_fingerprint(usr)
for(var/mob/M in viewers(1, src.loc))
- if ((M.client && M.machine == src))
+ if((M.client && M.machine == src))
src.attack_self(M)
return
return
@@ -165,7 +165,7 @@
force = 8.0
throw_speed = 2
throw_range = 4
- w_class = 4.0
+ w_class = 4
max_w_class = 3
max_combined_w_class = 21
attack_verb = list("bashed", "battered", "bludgeoned", "thrashed", "whacked")
@@ -176,17 +176,17 @@
new /obj/item/weapon/pen(src)
attack_hand(mob/user as mob)
- if ((src.loc == user) && (src.locked == 1))
+ if((src.loc == user) && (src.locked == 1))
to_chat(usr, "\red [src] is locked and cannot be opened!")
- else if ((src.loc == user) && (!src.locked))
+ else if((src.loc == user) && (!src.locked))
playsound(src.loc, "rustle", 50, 1, -5)
- if (user.s_active)
+ if(user.s_active)
user.s_active.close(user) //Close and re-open
src.show_to(user)
else
..()
for(var/mob/M in range(1))
- if (M.s_active == src)
+ if(M.s_active == src)
src.close(M)
src.orient2hud(user)
src.add_fingerprint(user)
@@ -213,7 +213,7 @@
icon_locking = "safeb"
icon_sparking = "safespark"
force = 8.0
- w_class = 5.0
+ w_class = 5
max_w_class = 8
anchored = 1.0
density = 0
diff --git a/code/game/objects/items/weapons/storage/storage.dm b/code/game/objects/items/weapons/storage/storage.dm
index 9bbc26017be..e2324fcb434 100644
--- a/code/game/objects/items/weapons/storage/storage.dm
+++ b/code/game/objects/items/weapons/storage/storage.dm
@@ -8,7 +8,7 @@
/obj/item/weapon/storage
name = "storage"
icon = 'icons/obj/storage.dmi'
- w_class = 3.0
+ w_class = 3
var/silent = 0 // No message on putting items in
var/list/can_hold = new/list() //List of objects which this item can store (if set, it can't store anything else)
var/list/cant_hold = new/list() //List of objects which this item can't store (in effect only if can_hold isn't set)
@@ -26,10 +26,10 @@
var/use_sound = "rustle" //sound played when used. null for no sound.
/obj/item/weapon/storage/MouseDrop(obj/over_object as obj)
- if (ishuman(usr)) //so monkeys can take off their backpacks -- Urist
+ if(ishuman(usr)) //so monkeys can take off their backpacks -- Urist
var/mob/M = usr
- if (istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
+ if(istype(usr.loc,/obj/mecha)) // stops inventory actions in a mech
return
if(over_object == M && Adjacent(M)) // this must come before the screen objects only block
@@ -39,12 +39,12 @@
show_to(M)
return
- if ((istype(over_object, /obj/structure/table) || istype(over_object, /turf/simulated/floor)) \
+ if((istype(over_object, /obj/structure/table) || istype(over_object, /turf/simulated/floor)) \
&& contents.len && loc == usr && !usr.stat && !usr.restrained() && usr.canmove && over_object.Adjacent(usr) \
&& !istype(src, /obj/item/weapon/storage/lockbox))
var/turf/T = get_turf(over_object)
- if (istype(over_object, /turf/simulated/floor))
- if (get_turf(usr) != T)
+ if(istype(over_object, /turf/simulated/floor))
+ if(get_turf(usr) != T)
return // Can only empty containers onto the floor under you
if("Yes" != alert(usr,"Empty \the [src] onto \the [T]?","Confirm","Yes","No"))
return
@@ -59,12 +59,12 @@
update_icon() // For content-sensitive icons
return
- if (!( istype(over_object, /obj/screen) ))
+ if(!( istype(over_object, /obj/screen) ))
return ..()
- if (!(src.loc == usr) || (src.loc && src.loc.loc == usr))
+ if(!(src.loc == usr) || (src.loc && src.loc.loc == usr))
return
playsound(src.loc, "rustle", 50, 1, -5)
- if (!( M.restrained() ) && !( M.stat ))
+ if(!( M.restrained() ) && !( M.stat ))
switch(over_object.name)
if("r_hand")
if(!M.unEquip(src))
@@ -77,7 +77,7 @@
src.add_fingerprint(usr)
return
if(over_object == usr && in_range(src, usr) || usr.contents.Find(src))
- if (usr.s_active)
+ if(usr.s_active)
usr.s_active.close(usr)
src.show_to(usr)
return
@@ -94,7 +94,7 @@
L += S.return_inv()
for(var/obj/item/weapon/gift/G in src)
L += G.gift
- if (istype(G.gift, /obj/item/weapon/storage))
+ if(istype(G.gift, /obj/item/weapon/storage))
L += G.gift:return_inv()
for(var/obj/item/weapon/folder/F in src)
L += F.contents
@@ -128,11 +128,11 @@
return
/obj/item/weapon/storage/proc/open(mob/user as mob)
- if (src.use_sound)
+ if(src.use_sound)
playsound(src.loc, src.use_sound, 50, 1, -5)
orient2hud(user)
- if (user.s_active)
+ if(user.s_active)
user.s_active.close(user)
show_to(user)
@@ -153,7 +153,7 @@
O.layer = 20
O.plane = HUD_PLANE
cx++
- if (cx > mx)
+ if(cx > mx)
cx = tx
cy--
src.closer.screen_loc = "[mx+1],[my]"
@@ -173,7 +173,7 @@
ND.sample_object.layer = 20
ND.sample_object.plane = HUD_PLANE
cx++
- if (cx > (4+cols))
+ if(cx > (4+cols))
cx = 4
cy--
else
@@ -184,7 +184,7 @@
O.layer = 20
O.plane = HUD_PLANE
cx++
- if (cx > (4+cols))
+ if(cx > (4+cols))
cx = 4
cy--
src.closer.screen_loc = "[4+cols+1]:16,2:16"
@@ -224,7 +224,7 @@
//var/mob/living/carbon/human/H = user
var/row_num = 0
var/col_count = min(7,storage_slots) -1
- if (adjusted_contents > 7)
+ if(adjusted_contents > 7)
row_num = round((adjusted_contents-1) / 7) // 7 is the maximum allowed width.
src.standard_orient_objs(row_num, col_count, numbered_contents)
return
@@ -249,7 +249,7 @@
break
if(!ok)
if(!stop_messages)
- if (istype(W, /obj/item/weapon/hand_labeler))
+ if(istype(W, /obj/item/weapon/hand_labeler))
return 0
to_chat(usr, "[src] cannot hold [W].")
return 0
@@ -260,7 +260,7 @@
to_chat(usr, "[src] cannot hold [W].")
return 0
- if (W.w_class > max_w_class)
+ if(W.w_class > max_w_class)
if(!stop_messages)
to_chat(usr, "[W] is too big for this [src].")
return 0
@@ -301,18 +301,18 @@
W.loc = src
W.on_enter_storage(src)
if(usr)
- if (usr.client && usr.s_active != src)
+ if(usr.client && usr.s_active != src)
usr.client.screen -= W
W.dropped(usr)
add_fingerprint(usr)
if(!prevent_warning && !istype(W, /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow))
for(var/mob/M in viewers(usr, null))
- if (M == usr)
+ if(M == usr)
to_chat(usr, "You put the [W] into [src].")
- else if (M in range(1)) //If someone is standing close enough, they can tell what it is...
+ else if(M in range(1)) //If someone is standing close enough, they can tell what it is...
M.show_message("[usr] puts [W] into [src].")
- else if (W && W.w_class >= 3.0) //Otherwise they can only see large or normal items from a distance...
+ else if(W && W.w_class >= 3.0) //Otherwise they can only see large or normal items from a distance...
M.show_message("[usr] puts [W] into [src].")
src.orient2hud(usr)
@@ -331,8 +331,8 @@
F.update_icon(1)
for(var/mob/M in range(1, src.loc))
- if (M.s_active == src)
- if (M.client)
+ if(M.s_active == src)
+ if(M.client)
M.client.screen -= W
if(new_location)
@@ -373,9 +373,6 @@
handle_item_insertion(W)
return 1
-/obj/item/weapon/storage/dropped(mob/user as mob)
- return
-
/obj/item/weapon/storage/attack_hand(mob/user as mob)
playsound(src.loc, "rustle", 50, 1, -5)
@@ -392,14 +389,14 @@
return
src.orient2hud(user)
- if (src.loc == user)
- if (user.s_active)
+ if(src.loc == user)
+ if(user.s_active)
user.s_active.close(user)
src.show_to(user)
else
..()
for(var/mob/M in range(1))
- if (M.s_active == src)
+ if(M.s_active == src)
src.close(M)
src.add_fingerprint(user)
return
@@ -409,7 +406,7 @@
set category = "Object"
collection_mode = !collection_mode
- switch (collection_mode)
+ switch(collection_mode)
if(1)
to_chat(usr, "[src] now picks up all items in a tile at once.")
if(0)
@@ -488,19 +485,19 @@
return
//Otherwise we'll try to fold it.
- if ( contents.len )
+ if( contents.len )
return
- if ( !ispath(src.foldable) )
+ if( !ispath(src.foldable) )
return
var/found = 0
// Close any open UI windows first
for(var/mob/M in range(1))
- if (M.s_active == src)
+ if(M.s_active == src)
src.close(M)
- if ( M == user )
+ if( M == user )
found = 1
- if ( !found ) // User is too far away
+ if( !found ) // User is too far away
return
// Now make the cardboard
to_chat(user, "You fold [src] flat.")
@@ -514,14 +511,14 @@
var/depth = 0
var/atom/cur_atom = src
- while (cur_atom && !(cur_atom in container.contents))
- if (isarea(cur_atom))
+ while(cur_atom && !(cur_atom in container.contents))
+ if(isarea(cur_atom))
return -1
- if (istype(cur_atom.loc, /obj/item/weapon/storage))
+ if(istype(cur_atom.loc, /obj/item/weapon/storage))
depth++
cur_atom = cur_atom.loc
- if (!cur_atom)
+ if(!cur_atom)
return -1 //inside something with a null loc.
return depth
@@ -532,14 +529,14 @@
var/depth = 0
var/atom/cur_atom = src
- while (cur_atom && !isturf(cur_atom))
- if (isarea(cur_atom))
+ while(cur_atom && !isturf(cur_atom))
+ if(isarea(cur_atom))
return -1
- if (istype(cur_atom.loc, /obj/item/weapon/storage))
+ if(istype(cur_atom.loc, /obj/item/weapon/storage))
depth++
cur_atom = cur_atom.loc
- if (!cur_atom)
+ if(!cur_atom)
return -1 //inside something with a null loc.
return depth
diff --git a/code/game/objects/items/weapons/storage/toolbox.dm b/code/game/objects/items/weapons/storage/toolbox.dm
index 22e46163fa3..fd44bacbf53 100644
--- a/code/game/objects/items/weapons/storage/toolbox.dm
+++ b/code/game/objects/items/weapons/storage/toolbox.dm
@@ -9,7 +9,7 @@
throwforce = 10.0
throw_speed = 2
throw_range = 7
- w_class = 4.0
+ w_class = 4
materials = list(MAT_METAL = 500)
origin_tech = "combat=1"
attack_verb = list("robusted")
@@ -17,7 +17,7 @@
New()
..()
- if (src.type == /obj/item/weapon/storage/toolbox)
+ if(src.type == /obj/item/weapon/storage/toolbox)
to_chat(world, "BAD: [src] ([src.type]) spawned at [src.x] [src.y] [src.z]")
qdel(src)
diff --git a/code/game/objects/items/weapons/storage/uplink_kits.dm b/code/game/objects/items/weapons/storage/uplink_kits.dm
index e5ebf843c6e..71d488672aa 100644
--- a/code/game/objects/items/weapons/storage/uplink_kits.dm
+++ b/code/game/objects/items/weapons/storage/uplink_kits.dm
@@ -1,7 +1,7 @@
/obj/item/weapon/storage/box/syndicate/
New()
..()
- switch (pickweight(list("bloodyspai" = 1, "stealth" = 1, "bond" = 1, "screwed" = 1, "guns" = 1, "murder" = 1, "implant" = 1, "hacker" = 1, "lordsingulo" = 1, "darklord" = 1)))
+ switch(pickweight(list("bloodyspai" = 1, "stealth" = 1, "bond" = 1, "screwed" = 1, "guns" = 1, "murder" = 1, "implant" = 1, "hacker" = 1, "lordsingulo" = 1, "darklord" = 1)))
if("bloodyspai")
new /obj/item/clothing/under/chameleon(src)
new /obj/item/clothing/mask/gas/voice(src)
@@ -37,7 +37,7 @@
new /obj/item/weapon/gun/projectile/revolver(src)
new /obj/item/ammo_box/a357(src)
new /obj/item/weapon/card/emag(src)
- new /obj/item/weapon/c4(src)
+ new /obj/item/weapon/grenade/plastic/c4(src)
new /obj/item/clothing/gloves/color/latex/nitrile(src)
new /obj/item/clothing/mask/gas/clown_hat(src)
new /obj/item/clothing/under/suit_jacket/really_black(src)
@@ -118,7 +118,16 @@
..()
new /obj/item/clothing/suit/space/rig/syndi/elite(src)
new /obj/item/clothing/head/helmet/space/rig/syndi/elite(src)
- return
+
+/obj/item/weapon/storage/box/syndie_kit/shielded_hardsuit
+ name = "Boxed Shielded Syndicate Hardsuit and Helmet"
+ can_hold = list("/obj/item/clothing/suit/space/rig/shielded/syndi", "/obj/item/clothing/head/helmet/space/rig/shielded/syndi")
+ max_w_class = 4
+
+/obj/item/weapon/storage/box/syndie_kit/shielded_hardsuit/New()
+ ..()
+ new /obj/item/clothing/suit/space/rig/shielded/syndi(src)
+ new /obj/item/clothing/head/helmet/space/rig/shielded/syndi(src)
/obj/item/weapon/storage/box/syndie_kit/conversion
name = "box (CK)"
diff --git a/code/game/objects/items/weapons/stunbaton.dm b/code/game/objects/items/weapons/stunbaton.dm
index 0f2fd65475e..c0935f5d316 100644
--- a/code/game/objects/items/weapons/stunbaton.dm
+++ b/code/game/objects/items/weapons/stunbaton.dm
@@ -23,7 +23,8 @@
update_icon()
return
-/obj/item/weapon/melee/baton/CheckParts()
+/obj/item/weapon/melee/baton/CheckParts(list/parts_list)
+ ..()
bcell = locate(/obj/item/weapon/stock_parts/cell) in contents
update_icon()
@@ -46,11 +47,11 @@
/obj/item/weapon/melee/baton/update_icon()
if(status)
- icon_state = "[initial(icon_state)]_active"
+ icon_state = "[initial(name)]_active"
else if(!bcell)
- icon_state = "[initial(icon_state)]_nocell"
+ icon_state = "[initial(name)]_nocell"
else
- icon_state = "[initial(icon_state)]"
+ icon_state = "[initial(name)]"
/obj/item/weapon/melee/baton/examine(mob/user)
..(user)
@@ -134,7 +135,7 @@
/obj/item/weapon/melee/baton/proc/baton_stun(mob/living/L, mob/user)
if(ishuman(L))
var/mob/living/carbon/human/H = L
- if(H.check_shields(0, "[user]'s [name]")) //No message; check_shields() handles that
+ if(H.check_shields(0, "[user]'s [name]", src, MELEE_ATTACK)) //No message; check_shields() handles that
playsound(L, 'sound/weapons/Genhit.ogg', 50, 1)
return
user.lastattacked = L
@@ -187,13 +188,6 @@
/obj/item/weapon/melee/baton/loaded/robot
hitcost = 1000
-
-/obj/item/weapon/melee/baton/loaded/ntcane
- name = "fancy cane"
- desc = "A cane with special engraving on it. It has a strange button on the handle..."
- icon_state = "cane_nt"
- item_state = "cane_nt"
-
//Makeshift stun baton. Replacement for stun gloves.
/obj/item/weapon/melee/baton/cattleprod
name = "stunprod"
@@ -204,12 +198,4 @@
throwforce = 5
stunforce = 5
hitcost = 3750
- slot_flags = null
-
-/obj/item/weapon/melee/baton/cattleprod/update_icon()
- if(status)
- icon_state = "stunprod_active"
- else if(!bcell)
- icon_state = "stunprod_nocell"
- else
- icon_state = "stunprod"
\ No newline at end of file
+ slot_flags = null
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/swords_axes_etc.dm b/code/game/objects/items/weapons/swords_axes_etc.dm
index 6af34367d75..55f7c4d5eb8 100644
--- a/code/game/objects/items/weapons/swords_axes_etc.dm
+++ b/code/game/objects/items/weapons/swords_axes_etc.dm
@@ -46,14 +46,14 @@
return
if(!isliving(target))
return
- if (user.a_intent == I_HARM)
+ if(user.a_intent == I_HARM)
if(!..()) return
if(!isrobot(target)) return
else
if(cooldown <= 0)
if(ishuman(target))
var/mob/living/carbon/human/H = target
- if(H.check_shields(0, "[user]'s [name]"))
+ if(H.check_shields(0, "[user]'s [name]", src, MELEE_ATTACK))
return 0
playsound(get_turf(src), 'sound/effects/woodhit.ogg', 75, 1, -1)
target.Weaken(3)
@@ -72,6 +72,13 @@
else
return ..()
+/obj/item/weapon/melee/classic_baton/ntcane
+ name = "fancy cane"
+ desc = "A cane with special engraving on it. It seems well suited for fending off assailants..."
+ icon_state = "cane_nt"
+ item_state = "cane_nt"
+ needs_permit = 0
+
//Telescopic baton
/obj/item/weapon/melee/classic_baton/telescopic
name = "telescopic baton"
diff --git a/code/game/objects/items/weapons/syndie_uplink.dm b/code/game/objects/items/weapons/syndie_uplink.dm
index 173c9ff2960..3dd9a230ad1 100644
--- a/code/game/objects/items/weapons/syndie_uplink.dm
+++ b/code/game/objects/items/weapons/syndie_uplink.dm
@@ -10,7 +10,7 @@
var/mob/currentUser = null
var/obj/item/device/radio/origradio = null
flags = CONDUCT | ONBELT
- w_class = 2.0
+ w_class = 2
item_state = "radio"
throw_speed = 4
throw_range = 20
@@ -31,7 +31,7 @@
slot_flags = SLOT_BELT
item_state = "radio"
throwforce = 5
- w_class = 2.0
+ w_class = 2
throw_speed = 4
throw_range = 20
materials = list(MAT_METAL=100)
diff --git a/code/game/objects/items/weapons/table_rack_parts.dm b/code/game/objects/items/weapons/table_rack_parts.dm
index 4f5db94d4af..62c2f7aabfd 100644
--- a/code/game/objects/items/weapons/table_rack_parts.dm
+++ b/code/game/objects/items/weapons/table_rack_parts.dm
@@ -96,7 +96,7 @@
*/
/obj/item/weapon/rack_parts/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
..()
- if (istype(W, /obj/item/weapon/wrench))
+ if(istype(W, /obj/item/weapon/wrench))
new /obj/item/stack/sheet/metal(user.loc)
qdel(src)
diff --git a/code/game/objects/items/weapons/tanks/jetpack.dm b/code/game/objects/items/weapons/tanks/jetpack.dm
index 68fe80fdbfb..af2c59c4759 100644
--- a/code/game/objects/items/weapons/tanks/jetpack.dm
+++ b/code/game/objects/items/weapons/tanks/jetpack.dm
@@ -4,76 +4,90 @@
name = "Jetpack (Empty)"
desc = "A tank of compressed gas for use as propulsion in zero-gravity areas. Use with caution."
icon_state = "jetpack"
- w_class = 4.0
+ w_class = 4
item_state = "jetpack"
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
var/datum/effect/system/ion_trail_follow/ion_trail
- var/on = 0.0
- var/stabilization_on = 0
+ actions_types = list(/datum/action/item_action/set_internals, /datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization)
+ var/on = 0
+ var/stabilizers = 0
var/volume_rate = 500 //Needed for borg jetpack transfer
- action_button_name = "Toggle Jetpack"
/obj/item/weapon/tank/jetpack/New()
..()
- src.ion_trail = new /datum/effect/system/ion_trail_follow()
- src.ion_trail.set_up(src)
- return
+ ion_trail = new /datum/effect/system/ion_trail_follow()
+ ion_trail.set_up(src)
/obj/item/weapon/tank/jetpack/Destroy()
qdel(ion_trail)
ion_trail = null
return ..()
+/obj/item/weapon/tank/jetpack/ui_action_click(mob/user, actiontype)
+ if(actiontype == /datum/action/item_action/toggle_jetpack)
+ cycle(user)
+ else if(actiontype == /datum/action/item_action/jetpack_stabilization)
+ toggle_stabilization(user)
+ else
+ toggle_internals(user)
+
+/obj/item/weapon/tank/jetpack/proc/toggle_stabilization(mob/user)
+ if(on)
+ stabilizers = !stabilizers
+ to_chat(user, "You turn [src]'s stabilization [stabilizers ? "on" : "off"].")
+
+
/obj/item/weapon/tank/jetpack/examine(mob/user)
if(!..(user, 0))
return
if(air_contents.oxygen < 10)
- to_chat(user, text("\red The meter on the [src.name] indicates you are almost out of air!"))
+ to_chat(user, "The meter on [src] indicates you are almost out of air!")
playsound(user, 'sound/effects/alert.ogg', 50, 1)
-/obj/item/weapon/tank/jetpack/verb/toggle_rockets()
- set name = "Toggle Jetpack Stabilization"
- set category = "Object"
- src.stabilization_on = !( src.stabilization_on )
- to_chat(usr, "You toggle the stabilization [stabilization_on? "on":"off"].")
- return
+/obj/item/weapon/tank/jetpack/proc/cycle(mob/user)
+ if(user.incapacitated())
+ return
-
-/obj/item/weapon/tank/jetpack/verb/toggle()
- set name = "Toggle Jetpack"
- set category = "Object"
- on = !on
- if(on)
- icon_state = "[icon_state]-on"
-// item_state = "[item_state]-on"
- ion_trail.start()
+ if(!on)
+ turn_on()
+ to_chat(user, "You turn the jetpack on.")
else
- icon_state = initial(icon_state)
-// item_state = initial(item_state)
- ion_trail.stop()
- return
+ turn_off()
+ to_chat(user, "You turn the jetpack off.")
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
+
+
+/obj/item/weapon/tank/jetpack/proc/turn_on()
+ on = TRUE
+ icon_state = "[initial(icon_state)]-on"
+ ion_trail.start()
+
+/obj/item/weapon/tank/jetpack/proc/turn_off()
+ on = FALSE
+ stabilizers = FALSE
+ icon_state = initial(icon_state)
+ ion_trail.stop()
/obj/item/weapon/tank/jetpack/proc/allow_thrust(num, mob/living/user as mob)
- if(!(src.on))
+ if(!on)
return 0
- if((num < 0.005 || src.air_contents.total_moles() < num))
- src.ion_trail.stop()
+ if((num < 0.005 || air_contents.total_moles() < num))
+ turn_off()
return 0
- var/datum/gas_mixture/G = src.air_contents.remove(num)
-
- var/allgases = G.carbon_dioxide + G.nitrogen + G.oxygen + G.toxins //fuck trace gases -Pete
- if(allgases >= 0.005)
- . = 1
-
- qdel(G)
-
-/obj/item/weapon/tank/jetpack/ui_action_click()
- toggle()
+ var/datum/gas_mixture/removed = air_contents.remove(num)
+ if(removed.total_moles() < 0.005)
+ turn_off()
+ return 0
+ var/turf/T = get_turf(user)
+ T.assume_air(removed)
+ return 1
/obj/item/weapon/tank/jetpack/void
name = "Void Jetpack (Oxygen)"
@@ -124,8 +138,8 @@
/obj/item/weapon/tank/jetpack/carbondioxide/New()
..()
- src.ion_trail = new /datum/effect/system/ion_trail_follow()
- src.ion_trail.set_up(src)
+ ion_trail = new /datum/effect/system/ion_trail_follow()
+ ion_trail.set_up(src)
air_contents.carbon_dioxide = (6*ONE_ATMOSPHERE)*volume/(R_IDEAL_GAS_EQUATION*T20C)
/obj/item/weapon/tank/jetpack/carbondioxide/examine(mob/user)
@@ -133,35 +147,32 @@
return
if(air_contents.carbon_dioxide < 10)
- to_chat(user, text("\red The meter on the [src.name] indicates you are almost out of air!"))
+ to_chat(user, "The meter on [src] indicates you are almost out of air!")
playsound(user, 'sound/effects/alert.ogg', 50, 1)
/obj/item/weapon/tank/jetpack/rig
name = "jetpack"
var/obj/item/weapon/rig/holder
+ actions_types = list(/datum/action/item_action/toggle_jetpack, /datum/action/item_action/jetpack_stabilization)
/obj/item/weapon/tank/jetpack/rig/examine()
to_chat(usr, "It's a jetpack. If you can see this, report it on the bug tracker.")
return 0
/obj/item/weapon/tank/jetpack/rig/allow_thrust(num, mob/living/user as mob)
-
- if(!(src.on))
+ if(!on)
return 0
if(!istype(holder) || !holder.air_supply)
return 0
- var/obj/item/weapon/tank/pressure_vessel = holder.air_supply
-
- if((num < 0.005 || pressure_vessel.air_contents.total_moles() < num))
- src.ion_trail.stop()
+ var/datum/gas_mixture/removed = holder.air_supply.air_contents.remove(num)
+ if(removed.total_moles() < 0.005)
+ turn_off()
return 0
- var/datum/gas_mixture/G = pressure_vessel.air_contents.remove(num)
+ var/turf/T = get_turf(user)
+ T.assume_air(removed)
- var/allgases = G.carbon_dioxide + G.nitrogen + G.oxygen + G.toxins
- if(allgases >= 0.005)
- . = 1
- qdel(G)
+ return 1
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/tanks/tank_types.dm b/code/game/objects/items/weapons/tanks/tank_types.dm
index 8f49bd68a38..485b800c105 100644
--- a/code/game/objects/items/weapons/tanks/tank_types.dm
+++ b/code/game/objects/items/weapons/tanks/tank_types.dm
@@ -100,9 +100,9 @@
/obj/item/weapon/tank/plasma/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
..()
- if (istype(W, /obj/item/weapon/flamethrower))
+ if(istype(W, /obj/item/weapon/flamethrower))
var/obj/item/weapon/flamethrower/F = W
- if ((!F.status)||(F.ptank)) return
+ if((!F.status)||(F.ptank)) return
src.master = F
F.ptank = src
user.unEquip(src)
@@ -135,7 +135,7 @@
icon_state = "emergency"
flags = CONDUCT
slot_flags = SLOT_BELT
- w_class = 2.0
+ w_class = 2
force = 4.0
distribute_pressure = ONE_ATMOSPHERE*O2STANDARD
volume = 3 //Tiny. Real life equivalents only have 21 breaths of oxygen in them. They're EMERGENCY tanks anyway -errorage (dangercon 2011)
diff --git a/code/game/objects/items/weapons/tanks/tanks.dm b/code/game/objects/items/weapons/tanks/tanks.dm
index 3dc3cdef9a5..9415e49d3cd 100644
--- a/code/game/objects/items/weapons/tanks/tanks.dm
+++ b/code/game/objects/items/weapons/tanks/tanks.dm
@@ -16,6 +16,7 @@
throw_speed = 1
throw_range = 4
+ actions_types = list(/datum/action/item_action/set_internals)
var/datum/gas_mixture/air_contents = null
var/distribute_pressure = ONE_ATMOSPHERE
var/integrity = 3
@@ -24,9 +25,9 @@
/obj/item/weapon/tank/New()
..()
- src.air_contents = new /datum/gas_mixture()
- src.air_contents.volume = volume //liters
- src.air_contents.temperature = T20C
+ air_contents = new /datum/gas_mixture()
+ air_contents.volume = volume //liters
+ air_contents.temperature = T20C
processing_objects.Add(src)
return
@@ -39,27 +40,63 @@
return ..()
+
+/obj/item/weapon/tank/ui_action_click(mob/user)
+ toggle_internals(user)
+
+/obj/item/weapon/tank/proc/toggle_internals(mob/user)
+ var/mob/living/carbon/C = user
+ if(!istype(C))
+ return 0
+
+ if(C.internal == src)
+ to_chat(C, "You close \the [src] valve.")
+ C.internal = null
+ C.update_internals_hud_icon(0)
+ else
+ var/can_open_valve = 0
+ if(C.wear_mask && C.wear_mask.flags & AIRTIGHT)
+ can_open_valve = 1
+ else if(ishuman(C))
+ var/mob/living/carbon/human/H = C
+ if(H.head && H.head.flags & AIRTIGHT)
+ can_open_valve = 1
+
+ if(can_open_valve)
+ if(C.internal)
+ to_chat(C, "You switch your internals to [src].")
+ else
+ to_chat(C, "You open \the [src] valve.")
+ C.internal = src
+ C.update_internals_hud_icon(1)
+ else
+ to_chat(C, "You are not wearing a suitable mask or helmet.")
+ return 0
+
+ C.update_action_buttons_icon()
+
+
/obj/item/weapon/tank/examine(mob/user)
var/obj/icon = src
- if (istype(src.loc, /obj/item/assembly))
- icon = src.loc
- if (!in_range(src, user))
- if (icon == src)
+ if(istype(loc, /obj/item/assembly))
+ icon = loc
+ if(!in_range(src, user))
+ if(icon == src)
to_chat(user, "\blue It's \a [bicon(icon)][src]! If you want any more information you'll need to get closer.")
return
- var/celsius_temperature = src.air_contents.temperature-T0C
+ var/celsius_temperature = air_contents.temperature-T0C
var/descriptive
- if (celsius_temperature < 20)
+ if(celsius_temperature < 20)
descriptive = "cold"
- else if (celsius_temperature < 40)
+ else if(celsius_temperature < 40)
descriptive = "room temperature"
- else if (celsius_temperature < 80)
+ else if(celsius_temperature < 80)
descriptive = "lukewarm"
- else if (celsius_temperature < 100)
+ else if(celsius_temperature < 100)
descriptive = "warm"
- else if (celsius_temperature < 300)
+ else if(celsius_temperature < 300)
descriptive = "hot"
else
descriptive = "furiously hot"
@@ -70,11 +107,11 @@
/obj/item/weapon/tank/blob_act()
if(prob(50))
- var/turf/location = src.loc
- if (!( istype(location, /turf) ))
+ var/turf/location = loc
+ if(!( istype(location, /turf) ))
qdel(src)
- if(src.air_contents)
+ if(air_contents)
location.assume_air(air_contents)
qdel(src)
@@ -82,18 +119,18 @@
/obj/item/weapon/tank/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
..()
- src.add_fingerprint(user)
- if (istype(src.loc, /obj/item/assembly))
- icon = src.loc
+ add_fingerprint(user)
+ if(istype(loc, /obj/item/assembly))
+ icon = loc
- if ((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
+ if((istype(W, /obj/item/device/analyzer)) && get_dist(user, src) <= 1)
atmosanalyzer_scan(air_contents, user)
if(istype(W, /obj/item/device/assembly_holder))
bomb_assemble(W,user)
/obj/item/weapon/tank/attack_self(mob/user as mob)
- if (!(src.air_contents))
+ if(!(air_contents))
return
ui_interact(user)
@@ -130,7 +167,7 @@
// update the ui if it exists, returns null if no ui is passed/found
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
// the ui does not exist, so we'll create a new() one
// for a list of parameters and their descriptions see the code docs in \code\modules\nano\nanoui.dm
ui = new(user, src, ui_key, "tanks.tmpl", "Tank", 500, 300)
@@ -142,49 +179,23 @@
ui.set_auto_update(1)
/obj/item/weapon/tank/Topic(href, href_list)
- ..()
- if (usr.stat|| usr.restrained())
- return 0
- if (src.loc != usr)
- return 0
+ if(..())
+ return 1
- if (href_list["dist_p"])
- if (href_list["dist_p"] == "reset")
- src.distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
- else if (href_list["dist_p"] == "max")
- src.distribute_pressure = TANK_MAX_RELEASE_PRESSURE
+ if(href_list["dist_p"])
+ if(href_list["dist_p"] == "reset")
+ distribute_pressure = TANK_DEFAULT_RELEASE_PRESSURE
+ else if(href_list["dist_p"] == "max")
+ distribute_pressure = TANK_MAX_RELEASE_PRESSURE
else
var/cp = text2num(href_list["dist_p"])
- src.distribute_pressure += cp
- src.distribute_pressure = min(max(round(src.distribute_pressure), 0), TANK_MAX_RELEASE_PRESSURE)
- if (href_list["stat"])
- if(istype(loc,/mob/living/carbon))
- var/mob/living/carbon/location = loc
- if(location.internal == src)
- location.internal = null
- location.internals.icon_state = "internal0"
- to_chat(usr, "\blue You close the tank release valve.")
- if (location.internals)
- location.internals.icon_state = "internal0"
- else
+ distribute_pressure += cp
+ distribute_pressure = min(max(round(distribute_pressure), 0), TANK_MAX_RELEASE_PRESSURE)
- var/can_open_valve
- if(location.wear_mask && (location.wear_mask.flags & AIRTIGHT))
- can_open_valve = 1
- else if(istype(location,/mob/living/carbon/human))
- var/mob/living/carbon/human/H = location
- if(H.head && (H.head.flags & AIRTIGHT))
- can_open_valve = 1
+ if(href_list["stat"])
+ toggle_internals(usr)
- if(can_open_valve)
- location.internal = src
- to_chat(usr, "\blue You open \the [src] valve.")
- if (location.internals)
- location.internals.icon_state = "internal1"
- else
- to_chat(usr, "\blue You need something to connect to \the [src].")
-
- src.add_fingerprint(usr)
+ add_fingerprint(usr)
return 1
@@ -226,9 +237,9 @@
var/pressure = air_contents.return_pressure()
if(pressure > TANK_FRAGMENT_PRESSURE)
- if(!istype(src.loc,/obj/item/device/transfer_valve))
- message_admins("Explosive tank rupture! last key to touch the tank was [src.fingerprintslast] (JMP)")
- log_game("Explosive tank rupture! last key to touch the tank was [src.fingerprintslast] at [x], [y], [z]")
+ if(!istype(loc,/obj/item/device/transfer_valve))
+ message_admins("Explosive tank rupture! last key to touch the tank was [fingerprintslast] (JMP)")
+ log_game("Explosive tank rupture! last key to touch the tank was [fingerprintslast] at [x], [y], [z]")
// to_chat(world, "\blue[x],[y] tank is exploding: [pressure] kPa")
//Give the gas a chance to build up more pressure through reacting
air_contents.react()
@@ -241,8 +252,8 @@
// to_chat(world, "\blue Exploding Pressure: [pressure] kPa, intensity: [range]")
explosion(epicenter, round(range*0.25), round(range*0.5), round(range), round(range*1.5))
- if(istype(src.loc,/obj/item/device/transfer_valve))
- qdel(src.loc)
+ if(istype(loc,/obj/item/device/transfer_valve))
+ qdel(loc)
else
qdel(src)
@@ -253,7 +264,7 @@
if(!T)
return
T.assume_air(air_contents)
- playsound(src.loc, 'sound/effects/spray.ogg', 10, 1, -3)
+ playsound(loc, 'sound/effects/spray.ogg', 10, 1, -3)
qdel(src)
else
integrity--
diff --git a/code/game/objects/items/weapons/tanks/watertank.dm b/code/game/objects/items/weapons/tanks/watertank.dm
index 1d9cce844ff..e6e88563d4b 100644
--- a/code/game/objects/items/weapons/tanks/watertank.dm
+++ b/code/game/objects/items/weapons/tanks/watertank.dm
@@ -5,10 +5,10 @@
icon = 'icons/obj/watertank.dmi'
icon_state = "waterbackpack"
item_state = "waterbackpack"
- w_class = 4.0
+ w_class = 4
slot_flags = SLOT_BACK
slowdown = 1
- action_button_name = "Toggle Mister"
+ actions_types = list(/datum/action/item_action/toggle_mister)
var/obj/item/weapon/noz
var/on = 0
@@ -22,10 +22,14 @@
/obj/item/weapon/watertank/ui_action_click()
toggle_mister()
+/obj/item/weapon/watertank/item_action_slot_check(slot, mob/user)
+ if(slot == slot_back)
+ return 1
+
/obj/item/weapon/watertank/verb/toggle_mister()
set name = "Toggle Mister"
set category = "Object"
- if (usr.get_item_by_slot(slot_back) != src)
+ if(usr.get_item_by_slot(slot_back) != src)
to_chat(usr, "The watertank needs to be on your back to use.")
return
if(usr.incapacitated())
@@ -52,7 +56,8 @@
return new /obj/item/weapon/reagent_containers/spray/mister(src)
/obj/item/weapon/watertank/equipped(mob/user, slot)
- if (slot != slot_back)
+ ..()
+ if(slot != slot_back)
remove_noz()
/obj/item/weapon/watertank/proc/remove_noz()
@@ -62,7 +67,7 @@
return
/obj/item/weapon/watertank/Destroy()
- if (on)
+ if(on)
remove_noz()
qdel(noz)
noz = null
@@ -75,8 +80,8 @@
..()
/obj/item/weapon/watertank/MouseDrop(obj/over_object)
- if(ishuman(src.loc))
- var/mob/living/carbon/human/H = src.loc
+ if(ishuman(loc))
+ var/mob/living/carbon/human/H = loc
switch(over_object.name)
if("r_hand")
if(H.r_hand)
@@ -108,7 +113,7 @@
icon = 'icons/obj/watertank.dmi'
icon_state = "mister"
item_state = "mister"
- w_class = 4.0
+ w_class = 4
amount_per_transfer_from_this = 50
possible_transfer_amounts = list(25,50,100)
volume = 500
@@ -125,6 +130,7 @@
return
/obj/item/weapon/reagent_containers/spray/mister/dropped(mob/user as mob)
+ ..()
to_chat(user, "The mister snaps back onto the watertank.")
tank.on = 0
loc = tank
@@ -133,7 +139,7 @@
return
/proc/check_tank_exists(parent_tank, var/mob/living/carbon/human/M, var/obj/O)
- if (!parent_tank || !istype(parent_tank, /obj/item/weapon/watertank)) //To avoid weird issues from admin spawns
+ if(!parent_tank || !istype(parent_tank, /obj/item/weapon/watertank)) //To avoid weird issues from admin spawns
M.unEquip(O)
qdel(0)
return 0
@@ -198,6 +204,7 @@
return new /obj/item/weapon/extinguisher/mini/nozzle(src)
/obj/item/weapon/watertank/atmos/dropped(mob/user as mob)
+ ..()
icon_state = "waterbackpackatmos"
if(istype(noz, /obj/item/weapon/extinguisher/mini/nozzle))
var/obj/item/weapon/extinguisher/mini/nozzle/N = noz
@@ -255,6 +262,7 @@
return
/obj/item/weapon/extinguisher/mini/nozzle/dropped(mob/user as mob)
+ ..()
to_chat(user, "The nozzle snaps back onto the tank!")
tank.on = 0
loc = tank
diff --git a/code/game/objects/items/weapons/teleportation.dm b/code/game/objects/items/weapons/teleportation.dm
index 99567b5952a..4728e8c730e 100644
--- a/code/game/objects/items/weapons/teleportation.dm
+++ b/code/game/objects/items/weapons/teleportation.dm
@@ -17,7 +17,7 @@
var/broadcasting = null
var/listening = 1.0
flags = CONDUCT
- w_class = 2.0
+ w_class = 2
item_state = "electronic"
throw_speed = 4
throw_range = 20
@@ -27,7 +27,7 @@
/obj/item/weapon/locator/attack_self(mob/user as mob)
add_fingerprint(usr)
var/dat
- if (temp)
+ if(temp)
dat = "[src.temp]
Clear"
else
dat = {"
@@ -52,25 +52,25 @@ Frequency:
to_chat(usr, "\The [src] is malfunctioning.")
return 1
- if (href_list["refresh"])
+ if(href_list["refresh"])
temp = "Persistent Signal Locator"
var/turf/sr = get_turf(src)
- if (sr)
+ if(sr)
temp += "Located Beacons: "
for(var/obj/item/device/radio/beacon/W in beacons)
- if (W.frequency == frequency && !W.syndicate)
- if (W && W.z == z)
+ if(W.frequency == frequency && !W.syndicate)
+ if(W && W.z == z)
var/turf/TB = get_turf(W)
temp += "[W.code]: [TB.x], [TB.y], [TB.z] "
temp += "Located Implants: "
- for (var/obj/item/weapon/implant/tracking/T in tracked_implants)
- if (!T.implanted || !T.imp_in)
+ for(var/obj/item/weapon/implant/tracking/T in tracked_implants)
+ if(!T.implanted || !T.imp_in)
continue
- if (T && T.z == z)
+ if(T && T.z == z)
temp += "[T.id]: [T.imp_in.x], [T.imp_in.y], [T.imp_in.z] "
temp += "You are at \[[sr.x],[sr.y],[sr.z]\]."
@@ -78,11 +78,11 @@ Frequency:
else
temp += "Processing error: Unable to locate orbital position. "
else
- if (href_list["freq"])
+ if(href_list["freq"])
frequency += text2num(href_list["freq"])
frequency = sanitize_frequency(frequency)
else
- if (href_list["temp"])
+ if(href_list["temp"])
temp = null
attack_self(usr)
@@ -98,7 +98,7 @@ Frequency:
icon_state = "hand_tele"
item_state = "electronic"
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 5
materials = list(MAT_METAL=10000)
@@ -123,12 +123,12 @@ Frequency:
if(T.x>world.maxx-8 || T.x<8) continue //putting them at the edge is dumb
if(T.y>world.maxy-8 || T.y<8) continue
A = get_area(T)
- if (A.tele_proof == 1) continue // Telescience-proofed areas require a beacon.
+ if(A.tele_proof == 1) continue // Telescience-proofed areas require a beacon.
turfs += T
if(turfs.len)
L["None (Dangerous)"] = pick(turfs)
var/t1 = input(user, "Please select a teleporter to lock in on.", "Hand Teleporter") as null|anything in L
- if (!t1 || (user.get_active_hand() != src || user.stat || user.restrained()))
+ if(!t1 || (user.get_active_hand() != src || user.stat || user.restrained()))
return
if(active_portals >= 3)
user.show_message("\The [src] is recharging!")
diff --git a/code/game/objects/items/weapons/teleprod.dm b/code/game/objects/items/weapons/teleprod.dm
new file mode 100644
index 00000000000..0bc1b23f6d6
--- /dev/null
+++ b/code/game/objects/items/weapons/teleprod.dm
@@ -0,0 +1,18 @@
+/obj/item/weapon/melee/baton/cattleprod/teleprod
+ name = "teleprod"
+ desc = "A prod with a bluespace crystal on the end. The crystal doesn't look too fun to touch."
+ icon_state = "teleprod_nocell"
+ item_state = "teleprod"
+ origin_tech = "combat=2;bluespace=4;materials=3"
+
+/obj/item/weapon/melee/baton/cattleprod/teleprod/attack(mob/living/carbon/M, mob/living/carbon/user)//handles making things teleport when hit
+ ..()
+ if(status)
+ if((CLUMSY in user.mutations) && prob(50))
+ user.visible_message("[user] accidentally hits themself with [src]!", \
+ "You accidentally hit yourself with [src]!")
+ user.Weaken(stunforce*3)
+ deductcharge(hitcost)
+ do_teleport(user, get_turf(user), 50)//honk honk
+ else if(iscarbon(M) && !M.anchored)
+ do_teleport(M, get_turf(M), 15)
\ No newline at end of file
diff --git a/code/game/objects/items/weapons/tools.dm b/code/game/objects/items/weapons/tools.dm
index 25ede163f8a..1452273573a 100644
--- a/code/game/objects/items/weapons/tools.dm
+++ b/code/game/objects/items/weapons/tools.dm
@@ -24,7 +24,7 @@
slot_flags = SLOT_BELT
force = 5.0
throwforce = 7.0
- w_class = 2.0
+ w_class = 2
materials = list(MAT_METAL=150)
origin_tech = "materials=1;engineering=1"
attack_verb = list("bashed", "battered", "bludgeoned", "whacked")
@@ -41,7 +41,7 @@
flags = CONDUCT
slot_flags = SLOT_BELT
force = 5.0
- w_class = 1.0
+ w_class = 1
throwforce = 5.0
throw_speed = 3
throw_range = 5
@@ -56,29 +56,29 @@
/obj/item/weapon/screwdriver/New()
switch(pick("red","blue","purple","brown","green","cyan","yellow"))
- if ("red")
+ if("red")
icon_state = "screwdriver2"
item_state = "screwdriver"
- if ("blue")
+ if("blue")
icon_state = "screwdriver"
item_state = "screwdriver_blue"
- if ("purple")
+ if("purple")
icon_state = "screwdriver3"
item_state = "screwdriver_purple"
- if ("brown")
+ if("brown")
icon_state = "screwdriver4"
item_state = "screwdriver_brown"
- if ("green")
+ if("green")
icon_state = "screwdriver5"
item_state = "screwdriver_green"
- if ("cyan")
+ if("cyan")
icon_state = "screwdriver6"
item_state = "screwdriver_cyan"
- if ("yellow")
+ if("yellow")
icon_state = "screwdriver7"
item_state = "screwdriver_yellow"
- if (prob(75))
+ if(prob(75))
src.pixel_y = rand(0, 16)
return
@@ -104,7 +104,7 @@
force = 6.0
throw_speed = 3
throw_range = 7
- w_class = 2.0
+ w_class = 2
materials = list(MAT_METAL=80)
origin_tech = "materials=1;engineering=1"
attack_verb = list("pinched", "nipped")
@@ -235,7 +235,7 @@
if(ishuman(M))
var/mob/living/carbon/human/H = M
var/obj/item/organ/external/S = H.organs_by_name[user.zone_sel.selecting]
- if (!S)
+ if(!S)
return
if(!(S.status & ORGAN_ROBOT) || user.a_intent != I_HELP || S.open == 2)
@@ -243,7 +243,7 @@
if(S.brute_dam)
if(S.brute_dam < ROBOLIMB_SELF_REPAIR_CAP)
- if (remove_fuel(0,null))
+ if(remove_fuel(0,null))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
S.heal_damage(15,0,0,1)
user.visible_message("\The [user] patches some dents on \the [M]'s [S.name] with \the [src].")
@@ -365,7 +365,7 @@
/obj/item/weapon/weldingtool/proc/flamethrower_rods(obj/item/I, mob/user)
if(!status)
var/obj/item/stack/rods/R = I
- if (R.use(1))
+ if(R.use(1))
var/obj/item/weapon/flamethrower/F = new /obj/item/weapon/flamethrower(user.loc)
if(!remove_item_from_storage(F))
user.unEquip(src)
@@ -409,7 +409,7 @@
icon_state = "upindwelder"
item_state = "upindwelder"
max_fuel = 80
- w_class = 3.0
+ w_class = 3
materials = list(MAT_METAL=70, MAT_GLASS=120)
origin_tech = "engineering=3"
@@ -419,7 +419,7 @@
icon_state = "exwelder"
item_state = "exwelder"
max_fuel = 40
- w_class = 3.0
+ w_class = 3
materials = list(MAT_METAL=70, MAT_GLASS=120)
origin_tech = "engineering=4;plasmatech=3"
var/last_gen = 0
@@ -453,7 +453,7 @@
force = 5.0
throwforce = 7.0
item_state = "crowbar"
- w_class = 2.0
+ w_class = 2
materials = list(MAT_METAL=50)
origin_tech = "engineering=1"
attack_verb = list("attacked", "bashed", "battered", "bludgeoned", "whacked")
@@ -479,7 +479,7 @@
icon = 'icons/obj/weapons.dmi'
icon_state = "kit"
flags = CONDUCT
- w_class = 2.0
+ w_class = 2
origin_tech = "combat=2"
var/open = 0
diff --git a/code/game/objects/items/weapons/twohanded.dm b/code/game/objects/items/weapons/twohanded.dm
index 1f808939f17..88138657270 100644
--- a/code/game/objects/items/weapons/twohanded.dm
+++ b/code/game/objects/items/weapons/twohanded.dm
@@ -74,7 +74,7 @@
to_chat(user, "You dedicate your module to [name].")
else
to_chat(user, "You grab the [name] with both hands.")
- if (wieldsound)
+ if(wieldsound)
playsound(loc, wieldsound, 50, 1)
var/obj/item/weapon/twohanded/offhand/O = new(user) ////Let's reserve his other hand~
O.name = "[name] - offhand"
@@ -90,12 +90,13 @@
return ..()
/obj/item/weapon/twohanded/dropped(mob/user)
+ ..()
//handles unwielding a twohanded weapon when dropped as well as clearing up the offhand
if(user)
var/obj/item/weapon/twohanded/O = user.get_inactive_hand()
if(istype(O))
O.unwield(user)
- return unwield(user)
+ return unwield(user)
/obj/item/weapon/twohanded/update_icon()
return
@@ -109,7 +110,7 @@
///////////OFFHAND///////////////
/obj/item/weapon/twohanded/offhand
- w_class = 5.0
+ w_class = 5
icon_state = "offhand"
name = "offhand"
flags = ABSTRACT
@@ -120,18 +121,10 @@
/obj/item/weapon/twohanded/offhand/wield()
qdel(src)
-/obj/item/weapon/twohanded/offhand/IsShield()//if the actual twohanded weapon is a shield, we count as a shield too!
- var/mob/user = loc
- if(!istype(user)) return 0
- var/obj/item/I = user.get_active_hand()
- if(I == src) I = user.get_inactive_hand()
- if(!I) return 0
- return I.IsShield()
-
///////////Two hand required objects///////////////
//This is for objects that require two hands to even pick up
/obj/item/weapon/twohanded/required/
- w_class = 5.0
+ w_class = 5
/obj/item/weapon/twohanded/required/attack_self()
return
@@ -165,7 +158,7 @@
throwforce = 15
sharp = 1
edge = 1
- w_class = 4.0
+ w_class = 4
slot_flags = SLOT_BACK
force_unwielded = 5
force_wielded = 24
@@ -200,15 +193,15 @@
throwforce = 5.0
throw_speed = 1
throw_range = 5
- w_class = 2.0
+ w_class = 2
force_unwielded = 3
force_wielded = 34
wieldsound = 'sound/weapons/saberon.ogg'
unwieldsound = 'sound/weapons/saberoff.ogg'
- flags = NOSHIELD
armour_penetration = 35
origin_tech = "magnets=3;syndicate=4"
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
+ block_chance = 75
sharp = 1
edge = 1
no_embed = 1 // Like with the single-handed esword, this shouldn't be embedding in people.
@@ -238,11 +231,10 @@
user.dir = i
sleep(1)
-/obj/item/weapon/twohanded/dualsaber/IsShield()
+/obj/item/weapon/twohanded/dualsaber/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance)
if(wielded)
- return 1
- else
- return 0
+ return ..()
+ return 0
/obj/item/weapon/twohanded/dualsaber/green/New()
blade_color = "green"
@@ -288,24 +280,93 @@
name = "spear"
desc = "A haphazardly-constructed yet still deadly weapon of ancient design."
force = 10
- w_class = 4.0
+ w_class = 4
slot_flags = SLOT_BACK
force_unwielded = 10
- force_wielded = 18 // Was 13, Buffed - RR
+ force_wielded = 18
throwforce = 20
- throw_speed = 3
+ throw_speed = 4
armour_penetration = 10
- no_spin_thrown = 1 // Thrown spears that spin look dumb. -Fox
- flags = NOSHIELD
+ materials = list(MAT_METAL=1150, MAT_GLASS=2075)
+ hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb = list("attacked", "poked", "jabbed", "torn", "gored")
+ sharp = 1
+ edge = 1
+ no_spin_thrown = 1
+ var/obj/item/weapon/grenade/explosive = null
+ var/war_cry = "AAAAARGH!!!"
/obj/item/weapon/twohanded/spear/update_icon()
- icon_state = "spearglass[wielded]"
- return
+ if(explosive)
+ icon_state = "spearbomb[wielded]"
+ else
+ icon_state = "spearglass[wielded]"
-/obj/item/weapon/twohanded/spear/attack(mob/living/carbon/M as mob, mob/living/carbon/user as mob)
- playsound(loc, 'sound/weapons/bladeslice.ogg', 50, 1, -1)
- return ..()
+/obj/item/weapon/twohanded/spear/afterattack(atom/movable/AM, mob/user, proximity)
+ if(!proximity)
+ return
+ if(isturf(AM)) //So you can actually melee with it
+ return
+ if(explosive && wielded)
+ user.say("[war_cry]")
+ explosive.forceMove(AM)
+ explosive.prime()
+ qdel(src)
+
+/obj/item/weapon/twohanded/spear/throw_impact(atom/target)
+ . = ..()
+ if(explosive)
+ explosive.prime()
+ qdel(src)
+
+/obj/item/weapon/twohanded/spear/AltClick(mob/user)
+ ..()
+ if(!explosive)
+ return
+ if(ismob(loc))
+ var/mob/M = loc
+ var/input = stripped_input(M, "What do you want your war cry to be? You will shout it when you hit someone in melee.", ,"", 50)
+ if(input)
+ war_cry = input
+
+/obj/item/weapon/twohanded/spear/CheckParts(list/parts_list)
+ ..()
+ if(explosive)
+ explosive.forceMove(get_turf(loc))
+ explosive = null
+ update_icon()
+ var/obj/item/weapon/grenade/G = locate() in contents
+ if(G)
+ explosive = G
+ name = "explosive lance"
+ desc = "A makeshift spear with [G] attached to it. Alt+click on the spear to set your war cry!"
+ update_icon()
+
+//GREY TIDE
+/obj/item/weapon/twohanded/spear/grey_tide
+ icon_state = "spearglass0"
+ name = "\improper Grey Tide"
+ desc = "Recovered from the aftermath of a revolt aboard Defense Outpost Theta Aegis, in which a seemingly endless tide of Assistants caused heavy casualities among Nanotrasen military forces."
+ force_unwielded = 15
+ force_wielded = 25
+ throwforce = 20
+ throw_speed = 4
+ attack_verb = list("gored")
+
+/obj/item/weapon/twohanded/spear/grey_tide/afterattack(atom/movable/AM, mob/living/user, proximity)
+ ..()
+ if(!proximity)
+ return
+ user.faction |= "greytide(\ref[user])"
+ if(isliving(AM))
+ var/mob/living/L = AM
+ if(istype (L, /mob/living/simple_animal/hostile/illusion))
+ return
+ if(!L.stat && prob(50))
+ var/mob/living/simple_animal/hostile/illusion/M = new(user.loc)
+ M.faction = user.faction.Copy()
+ M.Copy_Parent(user, 100, user.health/2.5, 12, 30)
+ M.GiveTarget(L)
//Putting heads on spears
/obj/item/organ/external/head/attackby(var/obj/item/weapon/W, var/mob/living/user, params)
@@ -357,6 +418,53 @@
name = "Kidan spear"
desc = "A spear brought over from the Kidan homeworld."
+// DIY CHAINSAW
+/obj/item/weapon/twohanded/required/chainsaw
+ name = "chainsaw"
+ desc = "A versatile power tool. Useful for limbing trees and delimbing humans."
+ icon_state = "gchainsaw_off"
+ flags = CONDUCT
+ force = 13
+ w_class = 5
+ throwforce = 13
+ throw_speed = 2
+ throw_range = 4
+ materials = list(MAT_METAL=13000)
+ origin_tech = "materials=3;engineering=4;combat=2"
+ attack_verb = list("sawed", "cut", "hacked", "carved", "cleaved", "butchered", "felled", "timbered")
+ hitsound = "swing_hit"
+ sharp = 1
+ edge = 1
+ actions_types = list(/datum/action/item_action/startchainsaw)
+ var/on = 0
+
+/obj/item/weapon/twohanded/required/chainsaw/attack_self(mob/user)
+ on = !on
+ to_chat(user, "As you pull the starting cord dangling from [src], [on ? "it begins to whirr." : "the chain stops moving."]")
+ if(on)
+ playsound(loc, 'sound/weapons/chainsawstart.ogg', 50, 1)
+ force = on ? 21 : 13
+ throwforce = on ? 21 : 13
+ icon_state = "gchainsaw_[on ? "on" : "off"]"
+
+ if(hitsound == "swing_hit")
+ hitsound = 'sound/weapons/chainsaw.ogg'
+ else
+ hitsound = "swing_hit"
+
+ if(src == user.get_active_hand()) //update inhands
+ user.update_inv_l_hand()
+ user.update_inv_r_hand()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
+
+/obj/item/weapon/twohanded/required/chainsaw/doomslayer
+ name = "OOOH BABY"
+ desc = "VRRRRRRR!!!"
+ armour_penetration = 100
+
+
///CHAINSAW///
/obj/item/weapon/twohanded/chainsaw
icon_state = "chainsaw0"
@@ -366,12 +474,11 @@
throwforce = 15
throw_speed = 1
throw_range = 5
- w_class = 4.0 // can't fit in backpacks
+ w_class = 4 // can't fit in backpacks
force_unwielded = 15 //still pretty robust
force_wielded = 40 //you'll gouge their eye out! Or a limb...maybe even their entire body!
wieldsound = 'sound/weapons/chainsawstart.ogg'
hitsound = null
- flags = NOSHIELD
armour_penetration = 35
origin_tech = "materials=6;syndicate=4"
attack_verb = list("sawed", "cut", "hacked", "carved", "cleaved", "butchered", "felled", "timbered")
@@ -581,7 +688,7 @@
Z.ex_act(2)
charged = 3
playsound(user, 'sound/weapons/marauder.ogg', 50, 1)
- else if (istype(A, /obj/structure) || istype(A, /obj/mecha/))
+ else if(istype(A, /obj/structure) || istype(A, /obj/mecha/))
var/obj/Z = A
Z.ex_act(2)
charged = 3
diff --git a/code/game/objects/items/weapons/vending_items.dm b/code/game/objects/items/weapons/vending_items.dm
index 9f22daf08f8..a6a53b03606 100644
--- a/code/game/objects/items/weapons/vending_items.dm
+++ b/code/game/objects/items/weapons/vending_items.dm
@@ -10,7 +10,7 @@
throwforce = 10.0
throw_speed = 1
throw_range = 7
- w_class = 4.0
+ w_class = 4
var/charges = 0 //how many restocking "charges" the refill has
diff --git a/code/game/objects/items/weapons/weaponry.dm b/code/game/objects/items/weapons/weaponry.dm
index 8ff2f931159..b9c946c6210 100644
--- a/code/game/objects/items/weapons/weaponry.dm
+++ b/code/game/objects/items/weapons/weaponry.dm
@@ -5,7 +5,7 @@
icon_state = "toyhammer"
slot_flags = SLOT_BELT
throwforce = 0
- w_class = 1.0
+ w_class = 1
throw_speed = 7
throw_range = 15
attack_verb = list("banned")
@@ -50,13 +50,11 @@
edge = 1
w_class = 3
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
+ block_chance = 50
- IsShield()
- return 1
-
- suicide_act(mob/user)
- to_chat(viewers(user), "[user] is falling on the [src.name]! It looks like \he's trying to commit suicide.")
- return(BRUTELOSS)
+/obj/item/weapon/claymore/suicide_act(mob/user)
+ user.visible_message("[user] is falling on the [src.name]! It looks like \he's trying to commit suicide.")
+ return(BRUTELOSS)
/obj/item/weapon/claymore/ceremonial
name = "ceremonial claymore"
@@ -77,6 +75,7 @@
w_class = 3
hitsound = 'sound/weapons/bladeslice.ogg'
attack_verb = list("attacked", "slashed", "stabbed", "sliced", "torn", "ripped", "diced", "cut")
+ block_chance = 50
/obj/item/weapon/katana/cursed
slot_flags = null
@@ -85,9 +84,6 @@
user.visible_message("[user] is slitting \his stomach open with the [src.name]! It looks like \he's trying to commit seppuku.")
return(BRUTELOSS)
-/obj/item/weapon/katana/IsShield()
- return 1
-
/obj/item/weapon/harpoon
name = "harpoon"
sharp = 1
diff --git a/code/game/objects/items/weapons/wires.dm b/code/game/objects/items/weapons/wires.dm
index abae807c80a..2e9fcdbff1a 100644
--- a/code/game/objects/items/weapons/wires.dm
+++ b/code/game/objects/items/weapons/wires.dm
@@ -17,7 +17,7 @@
/obj/item/weapon/wire/proc/update()
- if (src.amount > 1)
+ if(src.amount > 1)
src.icon_state = "spool_wire"
src.desc = text("This is just spool of regular insulated wire. It consists of about [] unit\s of wire.", src.amount)
else
@@ -26,7 +26,7 @@
return
/obj/item/weapon/wire/attack_self(mob/user as mob)
- if (src.laying)
+ if(src.laying)
src.laying = 0
to_chat(user, "\blue You're done laying wire!")
else
diff --git a/code/game/objects/objs.dm b/code/game/objects/objs.dm
index a8579613604..4e318d26fed 100644
--- a/code/game/objects/objs.dm
+++ b/code/game/objects/objs.dm
@@ -19,10 +19,6 @@
var/being_shocked = 0
- // What reagents should be logged when transferred TO this object?
- // Reagent ID => friendly name
- var/list/reagents_to_log=list()
-
var/on_blueprints = FALSE //Are we visible on the station blueprints at roundstart?
var/force_blueprints = FALSE //forces the obj to be on the blueprints, regardless of when it was created.
@@ -103,18 +99,18 @@
var/is_in_use = 0
var/list/nearby = viewers(1, src)
for(var/mob/M in nearby)
- if ((M.client && M.machine == src))
+ if((M.client && M.machine == src))
is_in_use = 1
src.attack_hand(M)
- if (istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
- if (!(usr in nearby))
- if (usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
+ if(istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot))
+ if(!(usr in nearby))
+ if(usr.client && usr.machine==src) // && M.machine == src is omitted because if we triggered this by using the dialog, it doesn't matter if our machine changed in between triggering it and this - the dialog is probably still supposed to refresh.
is_in_use = 1
src.attack_ai(usr)
// check for TK users
- if (istype(usr, /mob/living/carbon/human))
+ if(istype(usr, /mob/living/carbon/human))
if(istype(usr.l_hand, /obj/item/tk_grab) || istype(usr.r_hand, /obj/item/tk_grab/))
if(!(usr in nearby))
if(usr.client && usr.machine==src)
@@ -128,7 +124,7 @@
var/list/nearby = viewers(1, src)
var/is_in_use = 0
for(var/mob/M in nearby)
- if ((M.client && M.machine == src))
+ if((M.client && M.machine == src))
is_in_use = 1
src.interact(M)
var/ai_in_use = AutoUpdateAI(src)
diff --git a/code/game/objects/random/random.dm b/code/game/objects/random/random.dm
index 7b54984399a..23f5707c766 100644
--- a/code/game/objects/random/random.dm
+++ b/code/game/objects/random/random.dm
@@ -9,7 +9,7 @@
// creates a new object and deletes itself
/obj/random/New()
..()
- if (!prob(spawn_nothing_percentage))
+ if(!prob(spawn_nothing_percentage))
spawn_item()
qdel(src)
diff --git a/code/game/objects/structures.dm b/code/game/objects/structures.dm
index 2bcabd8ac15..70b3e3c1d67 100644
--- a/code/game/objects/structures.dm
+++ b/code/game/objects/structures.dm
@@ -66,7 +66,7 @@
/obj/structure/proc/do_climb(var/mob/living/user)
- if (!can_touch(user) || !climbable)
+ if(!can_touch(user) || !climbable)
return
for(var/obj/O in range(0, src))
@@ -89,7 +89,7 @@
climber = null
return
- if (!can_touch(user) || !climbable)
+ if(!can_touch(user) || !climbable)
climber = null
return
@@ -99,7 +99,7 @@
return
usr.loc = get_turf(src)
- if (get_turf(user) == get_turf(src))
+ if(get_turf(user) == get_turf(src))
usr.visible_message("[user] climbs onto \the [src]!")
climber = null
@@ -150,16 +150,16 @@
return
/obj/structure/proc/can_touch(var/mob/user)
- if (!user)
+ if(!user)
return 0
if(!Adjacent(user))
return 0
- if (user.restrained() || user.buckled)
+ if(user.restrained() || user.buckled)
to_chat(user, "You need your hands and legs free for this.")
return 0
- if (user.stat || user.paralysis || user.sleeping || user.lying || user.weakened)
+ if(user.stat || user.paralysis || user.sleeping || user.lying || user.weakened)
return 0
- if (issilicon(user))
+ if(issilicon(user))
to_chat(user, "You need hands for this.")
return 0
return 1
diff --git a/code/game/objects/structures/barsign.dm b/code/game/objects/structures/barsign.dm
index 86aa341d39c..93f4bb7be9b 100644
--- a/code/game/objects/structures/barsign.dm
+++ b/code/game/objects/structures/barsign.dm
@@ -49,10 +49,10 @@
/obj/structure/sign/barsign/attack_hand(mob/user as mob)
- if (!src.allowed(user))
+ if(!src.allowed(user))
to_chat(user, "Access denied.")
return
- if (broken)
+ if(broken)
to_chat(user, "The controls seem unresponsive.")
return
pick_sign()
diff --git a/code/game/objects/structures/bedsheet_bin.dm b/code/game/objects/structures/bedsheet_bin.dm
index f7e178716c5..31958409954 100644
--- a/code/game/objects/structures/bedsheet_bin.dm
+++ b/code/game/objects/structures/bedsheet_bin.dm
@@ -14,7 +14,7 @@ LINEN BINS
throwforce = 1
throw_speed = 1
throw_range = 2
- w_class = 1.0
+ w_class = 1
item_color = "white"
slot_flags = SLOT_BACK
diff --git a/code/game/objects/structures/coathanger.dm b/code/game/objects/structures/coathanger.dm
index a91b5aa3564..3c68792fece 100644
--- a/code/game/objects/structures/coathanger.dm
+++ b/code/game/objects/structures/coathanger.dm
@@ -15,10 +15,10 @@
/obj/structure/coatrack/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
var/can_hang = 0
- for (var/T in allowed)
+ for(var/T in allowed)
if(istype(W,T))
can_hang = 1
- if (can_hang && !coat)
+ if(can_hang && !coat)
user.visible_message("[user] hangs [W] on \the [src].", "You hang [W] on the \the [src]")
coat = W
user.drop_item(src)
@@ -30,11 +30,11 @@
/obj/structure/coatrack/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
var/can_hang = 0
- for (var/T in allowed)
+ for(var/T in allowed)
if(istype(mover,T))
can_hang = 1
- if (can_hang && !coat)
+ if(can_hang && !coat)
src.visible_message("[mover] lands on \the [src].")
coat = mover
coat.loc = src
@@ -45,9 +45,9 @@
/obj/structure/coatrack/update_icon()
overlays.Cut()
- if (istype(coat, /obj/item/clothing/suit/storage/labcoat))
+ if(istype(coat, /obj/item/clothing/suit/storage/labcoat))
overlays += image(icon, icon_state = "coat_lab")
- if (istype(coat, /obj/item/clothing/suit/storage/labcoat/cmo))
+ if(istype(coat, /obj/item/clothing/suit/storage/labcoat/cmo))
overlays += image(icon, icon_state = "coat_cmo")
- if (istype(coat, /obj/item/clothing/suit/storage/det_suit))
+ if(istype(coat, /obj/item/clothing/suit/storage/det_suit))
overlays += image(icon, icon_state = "coat_det")
\ No newline at end of file
diff --git a/code/game/objects/structures/crates_lockers/closets.dm b/code/game/objects/structures/crates_lockers/closets.dm
index 44048f5113c..de0ef28d255 100644
--- a/code/game/objects/structures/crates_lockers/closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets.dm
@@ -66,8 +66,8 @@
loc.Exited(M)
M.loc = destination
loc.Entered(M, ignoreRest = 1)
- for (var/atom/movable/AM in loc)
- if (istype(AM, /obj/item))
+ for(var/atom/movable/AM in loc)
+ if(istype(AM, /obj/item))
continue
AM.Crossed(M)
@@ -149,7 +149,7 @@
qdel(src)
if(2)
if(prob(50))
- for (var/atom/movable/A as mob|obj in src)
+ for(var/atom/movable/A as mob|obj in src)
A.forceMove(loc)
A.ex_act(severity++)
new /obj/item/stack/sheet/metal(loc)
@@ -335,7 +335,7 @@
to_chat(user, "It won't budge!")
if(!lastbang)
lastbang = 1
- for (var/mob/M in hearers(src, null))
+ for(var/mob/M in hearers(src, null))
to_chat(M, text("BANG, bang!", max(0, 5 - get_dist(src, M))))
spawn(30)
lastbang = 0
@@ -384,10 +384,11 @@
/obj/structure/closet/container_resist(var/mob/living/L)
var/breakout_time = 2 //2 minutes by default
if(opened)
- if (L.loc == src)
+ if(L.loc == src)
L.forceMove(get_turf(src)) // Let's just be safe here
return //Door's open... wait, why are you in it's contents then?
if(!welded)
+ open() //for cardboard boxes
return //closed but not welded...
// else Meh, lets just keep it at 2 minutes for now
// breakout_time++ //Harder to get out of welded lockers than locked lockers
diff --git a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
index 13c4c999ef5..715d16f9ebd 100644
--- a/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
+++ b/code/game/objects/structures/crates_lockers/closets/fireaxe.dm
@@ -21,7 +21,7 @@
if(fireaxe)
hasaxe = 1
- if (isrobot(user) || src.locked)
+ if(isrobot(user) || src.locked)
if(istype(O, /obj/item/device/multitool))
to_chat(user, "\red Resetting circuitry...")
playsound(user, 'sound/machines/lockreset.ogg', 50, 1)
@@ -53,7 +53,7 @@
src.localopened = 1
update_icon()
return
- if (istype(O, /obj/item/weapon/twohanded/fireaxe) && src.localopened)
+ if(istype(O, /obj/item/weapon/twohanded/fireaxe) && src.localopened)
if(!fireaxe)
if(O:wielded)
to_chat(user, "\red Unwield the axe first.")
@@ -155,7 +155,7 @@
set name = "Open/Close"
set category = "Object"
- if (isrobot(usr) || src.locked || src.smashed)
+ if(isrobot(usr) || src.locked || src.smashed)
if(src.locked)
to_chat(usr, "\red The cabinet won't budge!")
else if(src.smashed)
@@ -169,10 +169,10 @@
set name = "Remove Fire Axe"
set category = "Object"
- if (isrobot(usr))
+ if(isrobot(usr))
return
- if (localopened)
+ if(localopened)
if(fireaxe)
usr.put_in_hands(fireaxe)
fireaxe = null
diff --git a/code/game/objects/structures/crates_lockers/closets/job_closets.dm b/code/game/objects/structures/crates_lockers/closets/job_closets.dm
index 2b6660d077f..20a110f18d0 100644
--- a/code/game/objects/structures/crates_lockers/closets/job_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/job_closets.dm
@@ -101,6 +101,8 @@
/obj/structure/closet/lawcloset/New()
..()
+ new /obj/item/weapon/storage/box/tapes(src)
+ new /obj/item/weapon/book/manual/faxes(src)
new /obj/item/clothing/under/lawyer/female(src)
new /obj/item/clothing/under/lawyer/black(src)
new /obj/item/clothing/under/lawyer/red(src)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/cargo.dm b/code/game/objects/structures/crates_lockers/closets/secure/cargo.dm
index c4fa509b947..74b811eae24 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/cargo.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/cargo.dm
@@ -35,8 +35,6 @@
new /obj/item/clothing/shoes/brown(src)
new /obj/item/device/radio/headset/headset_cargo(src)
new /obj/item/clothing/gloves/fingerless(src)
-// new /obj/item/weapon/cartridge/quartermaster(src)
- new /obj/item/weapon/mining_voucher(src)
new /obj/item/clothing/suit/fire/firefighter(src)
new /obj/item/weapon/tank/emergency_oxygen(src)
new /obj/item/clothing/mask/gas(src)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/chaplain.dm b/code/game/objects/structures/crates_lockers/closets/secure/chaplain.dm
index ba971914f24..7c58f4a2b1a 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/chaplain.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/chaplain.dm
@@ -13,10 +13,8 @@
..()
new /obj/item/clothing/under/rank/chaplain(src)
new /obj/item/clothing/shoes/black(src)
- new /obj/item/clothing/suit/nun(src)
- new /obj/item/clothing/head/nun_hood(src)
- new /obj/item/clothing/suit/chaplain_hoodie(src)
- new /obj/item/clothing/head/chaplain_hood(src)
+ new /obj/item/clothing/suit/hooded/nun(src)
+ new /obj/item/clothing/suit/hooded/chaplain_hoodie(src)
new /obj/item/clothing/suit/holidaypriest(src)
new /obj/item/clothing/under/wedding/bride_white(src)
new /obj/item/weapon/storage/backpack/cultpack (src)
@@ -28,4 +26,4 @@
new /obj/item/clothing/gloves/ring/silver(src)
new /obj/item/clothing/gloves/ring/silver(src)
new /obj/item/clothing/gloves/ring/gold(src)
- new /obj/item/clothing/gloves/ring/gold(src)
\ No newline at end of file
+ new /obj/item/clothing/gloves/ring/gold(src)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
index c26ace63f08..7c880918e41 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/engineering.dm
@@ -15,6 +15,7 @@
else
new /obj/item/weapon/storage/backpack/satchel_eng(src)
new /obj/item/weapon/storage/backpack/duffel/engineering(src)
+ new /obj/item/clothing/head/beret/ce(src)
new /obj/item/areaeditor/blueprints(src)
new /obj/item/weapon/storage/box/permits(src)
new /obj/item/clothing/under/rank/chief_engineer(src)
@@ -141,4 +142,4 @@
new /obj/item/weapon/tank/emergency_oxygen/engi(src)
new /obj/item/weapon/watertank/atmos(src)
new /obj/item/clothing/suit/fire/atmos(src)
- new /obj/item/clothing/head/hardhat/atmos(src)
\ No newline at end of file
+ new /obj/item/clothing/head/hardhat/atmos(src)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm b/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm
index 896ab5e1dd1..a008e3843e9 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/freezer.dm
@@ -70,8 +70,8 @@
New()
..()
for(var/i in 1 to 5)
- new /obj/item/weapon/reagent_containers/food/drinks/milk(src)
- new /obj/item/weapon/reagent_containers/food/drinks/soymilk(src)
+ new /obj/item/weapon/reagent_containers/food/condiment/milk(src)
+ new /obj/item/weapon/reagent_containers/food/condiment/soymilk(src)
for(var/i in 1 to 2)
new /obj/item/weapon/storage/fancy/egg_box(src)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm b/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm
index 4a8c3a4195a..149793399ed 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/guncabinet.dm
@@ -26,19 +26,19 @@
else
var/lazors = 0
var/shottas = 0
- for (var/obj/item/weapon/gun/G in contents)
- if (istype(G, /obj/item/weapon/gun/energy))
+ for(var/obj/item/weapon/gun/G in contents)
+ if(istype(G, /obj/item/weapon/gun/energy))
lazors++
- if (istype(G, /obj/item/weapon/gun/projectile/))
+ if(istype(G, /obj/item/weapon/gun/projectile/))
shottas++
- if (lazors || shottas)
- for (var/i = 0 to 2)
+ if(lazors || shottas)
+ for(var/i = 0 to 2)
var/image/gun = image(icon(src.icon))
- if (lazors > 0 && (shottas <= 0 || prob(50)))
+ if(lazors > 0 && (shottas <= 0 || prob(50)))
lazors--
gun.icon_state = "laser"
- else if (shottas > 0)
+ else if(shottas > 0)
shottas--
gun.icon_state = "projectile"
@@ -49,7 +49,7 @@
if(broken)
overlays += icon(src.icon,"broken")
- else if (locked)
+ else if(locked)
overlays += icon(src.icon,"locked")
else
overlays += icon(src.icon,"open")
\ No newline at end of file
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm
index 17f208e28e9..c0603396325 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/medical.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/medical.dm
@@ -156,13 +156,13 @@
new /obj/item/clothing/head/bio_hood/cmo(src)
new /obj/item/clothing/shoes/white(src)
switch(pick("blue", "green", "purple"))
- if ("blue")
+ if("blue")
new /obj/item/clothing/under/rank/medical/blue(src)
new /obj/item/clothing/head/surgery/blue(src)
- if ("green")
+ if("green")
new /obj/item/clothing/under/rank/medical/green(src)
new /obj/item/clothing/head/surgery/green(src)
- if ("purple")
+ if("purple")
new /obj/item/clothing/under/rank/medical/purple(src)
new /obj/item/clothing/head/surgery/purple(src)
new /obj/item/clothing/suit/storage/labcoat/cmo(src)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
index 0433ba0479f..51e3e8d06c3 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/personal.dm
@@ -53,11 +53,11 @@
new /obj/item/device/radio/headset( src )
/obj/structure/closet/secure_closet/personal/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (src.opened)
- if (istype(W, /obj/item/weapon/grab))
+ if(src.opened)
+ if(istype(W, /obj/item/weapon/grab))
src.MouseDrop_T(W:affecting, user) //act like they were dragged onto the closet
user.drop_item()
- if (W) W.forceMove(loc)
+ if(W) W.forceMove(loc)
else if(istype(W, /obj/item/weapon/card/id))
if(src.broken)
to_chat(user, "\red It appears to be broken.")
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm b/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm
index 488a422af86..cfecee359d6 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/scientist.dm
@@ -46,7 +46,7 @@
new /obj/item/device/radio/headset/heads/rd(src)
new /obj/item/weapon/tank/air(src)
new /obj/item/clothing/mask/gas(src)
- new /obj/item/clothing/suit/armor/reactive(src)
+ new /obj/item/clothing/suit/armor/reactive/teleport(src)
new /obj/item/device/flash(src)
new /obj/item/device/laser_pointer(src)
new /obj/item/weapon/door_remote/research_director(src)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
index fe1e33d0999..db589c027e6 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/secure_closets.dm
@@ -133,7 +133,7 @@
/obj/structure/closet/secure_closet/container_resist(var/mob/living/L)
var/breakout_time = 2 //2 minutes by default
if(opened)
- if (L.loc == src)
+ if(L.loc == src)
L.forceMove(get_turf(src)) // Let's just be safe here
return //Door's open... wait, why are you in it's contents then?
if(!locked && !welded)
diff --git a/code/game/objects/structures/crates_lockers/closets/secure/security.dm b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
index 3fdf47dc0c5..66c470882c8 100644
--- a/code/game/objects/structures/crates_lockers/closets/secure/security.dm
+++ b/code/game/objects/structures/crates_lockers/closets/secure/security.dm
@@ -14,6 +14,7 @@
new /obj/item/weapon/storage/backpack/captain(src)
else
new /obj/item/weapon/storage/backpack/satchel_cap(src)
+ new /obj/item/weapon/book/manual/faxes(src)
new /obj/item/weapon/storage/backpack/duffel/captain(src)
new /obj/item/clothing/suit/captunic(src)
new /obj/item/clothing/suit/captunic/capjacket(src)
@@ -42,6 +43,7 @@
New()
..()
+ new /obj/item/weapon/book/manual/faxes(src)
new /obj/item/clothing/glasses/sunglasses(src)
new /obj/item/clothing/head/hopcap(src)
new /obj/item/weapon/cartridge/hop(src)
@@ -51,7 +53,6 @@
new /obj/item/clothing/suit/armor/vest(src)
new /obj/item/weapon/gun/energy/gun(src)
new /obj/item/device/flash(src)
- new /obj/item/weapon/mining_voucher(src)
new /obj/item/clothing/accessory/petcollar(src)
new /obj/item/weapon/door_remote/civillian(src)
@@ -98,6 +99,7 @@
new /obj/item/weapon/storage/backpack/security(src)
else
new /obj/item/weapon/storage/backpack/satchel_sec(src)
+ new /obj/item/weapon/book/manual/faxes(src)
new /obj/item/weapon/cartridge/hos(src)
new /obj/item/device/radio/headset/heads/hos/alt(src)
new /obj/item/clothing/under/rank/head_of_security(src)
@@ -261,6 +263,7 @@
New()
..()
+ new /obj/item/weapon/book/manual/faxes(src)
new /obj/item/weapon/storage/briefcase(src)
new /obj/item/device/paicard(src)
new /obj/item/device/flash(src)
@@ -272,6 +275,8 @@
new /obj/item/clothing/under/lawyer/female(src)
new /obj/item/clothing/head/ntrep(src)
new /obj/item/clothing/shoes/sandal/fancy(src)
+ new /obj/item/weapon/storage/box/tapes(src)
+ new /obj/item/device/taperecorder(src)
/obj/structure/closet/secure_closet/security/cargo
@@ -349,7 +354,7 @@
/obj/structure/closet/secure_closet/injection
name = "lethal injections locker"
- req_access = list(access_captain)
+ req_access = list(access_security)
New()
diff --git a/code/game/objects/structures/crates_lockers/closets/statue.dm b/code/game/objects/structures/crates_lockers/closets/statue.dm
index 8a701bedd72..3f49d3e3bde 100644
--- a/code/game/objects/structures/crates_lockers/closets/statue.dm
+++ b/code/game/objects/structures/crates_lockers/closets/statue.dm
@@ -22,7 +22,7 @@
L.client.perspective = EYE_PERSPECTIVE
L.client.eye = src
L.loc = src
- L.sdisabilities += MUTE
+ L.disabilities += MUTE
health = L.health + 100 //stoning damaged mobs will result in easier to shatter statues
intialTox = L.getToxLoss()
intialFire = L.getFireLoss()
@@ -54,7 +54,7 @@
M.adjustFireLoss(intialFire - M.getFireLoss())
M.adjustBruteLoss(intialBrute - M.getBruteLoss())
M.setOxyLoss(intialOxy)
- if (timer <= 0)
+ if(timer <= 0)
dump_contents()
processing_objects.Remove(src)
qdel(src)
@@ -77,7 +77,7 @@
for(var/mob/living/M in src)
M.loc = src.loc
- M.sdisabilities -= MUTE
+ M.disabilities -= MUTE
M.take_overall_damage((M.health - health - 100),0) //any new damage the statue incurred is transfered to the mob
if(M.client)
M.client.eye = M.client.mob
@@ -145,7 +145,7 @@
return
/obj/structure/closet/statue/proc/shatter(mob/user as mob)
- if (user)
+ if(user)
user.dust()
dump_contents()
visible_message("\red [src] shatters!. ")
diff --git a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm
index c99790c4011..3fda5f8c603 100644
--- a/code/game/objects/structures/crates_lockers/closets/utility_closets.dm
+++ b/code/game/objects/structures/crates_lockers/closets/utility_closets.dm
@@ -22,36 +22,36 @@
/obj/structure/closet/emcloset/New()
..()
- switch (pickweight(list("small" = 55, "aid" = 25, "tank" = 10, "both" = 10, "nothing" = 0, "delete" = 0)))
- if ("small")
+ switch(pickweight(list("small" = 55, "aid" = 25, "tank" = 10, "both" = 10, "nothing" = 0, "delete" = 0)))
+ if("small")
new /obj/item/weapon/tank/emergency_oxygen(src)
new /obj/item/weapon/tank/emergency_oxygen(src)
new /obj/item/clothing/mask/breath(src)
new /obj/item/clothing/mask/breath(src)
- if ("aid")
+ if("aid")
new /obj/item/weapon/tank/emergency_oxygen(src)
new /obj/item/weapon/storage/toolbox/emergency(src)
new /obj/item/clothing/mask/breath(src)
new /obj/item/weapon/storage/firstaid/o2(src)
- if ("tank")
+ if("tank")
new /obj/item/weapon/tank/emergency_oxygen/engi(src)
new /obj/item/clothing/mask/breath(src)
new /obj/item/weapon/tank/emergency_oxygen/engi(src)
new /obj/item/clothing/mask/breath(src)
- if ("both")
+ if("both")
new /obj/item/weapon/storage/toolbox/emergency(src)
new /obj/item/weapon/tank/emergency_oxygen/engi(src)
new /obj/item/clothing/mask/breath(src)
new /obj/item/weapon/storage/firstaid/o2(src)
- if ("nothing")
+ if("nothing")
// doot
// teehee - Ah, tg coders...
- if ("delete")
+ if("delete")
qdel(src)
//If you want to re-add fire, just add "fire" = 15 to the pick list.
- /*if ("fire")
+ /*if("fire")
new /obj/structure/closet/firecloset(src.loc)
qdel(src)*/
diff --git a/code/game/objects/structures/crates_lockers/crates.dm b/code/game/objects/structures/crates_lockers/crates.dm
index c4129596892..c4178baec15 100644
--- a/code/game/objects/structures/crates_lockers/crates.dm
+++ b/code/game/objects/structures/crates_lockers/crates.dm
@@ -185,7 +185,7 @@
qdel(src)
return
if(3.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
return
else
@@ -497,7 +497,7 @@
/obj/structure/closet/crate/large/close()
. = ..()
- if (.)//we can hold up to one large item
+ if(.)//we can hold up to one large item
var/found = 0
for(var/obj/structure/S in src.loc)
if(S == src)
@@ -524,7 +524,7 @@
/obj/structure/closet/crate/secure/large/close()
. = ..()
- if (.)//we can hold up to one large item
+ if(.)//we can hold up to one large item
var/found = 0
for(var/obj/structure/S in src.loc)
if(S == src)
diff --git a/code/game/objects/structures/crates_lockers/walllocker.dm b/code/game/objects/structures/crates_lockers/walllocker.dm
index d07ee623d38..25a41a8dde7 100644
--- a/code/game/objects/structures/crates_lockers/walllocker.dm
+++ b/code/game/objects/structures/crates_lockers/walllocker.dm
@@ -27,7 +27,7 @@
icon_opened = "emergopen"
/obj/structure/closet/walllocker/emerglocker/attack_hand(mob/user as mob)
- if (istype(user, /mob/living/silicon/ai)) //Added by Strumpetplaya - AI shouldn't be able to
+ if(istype(user, /mob/living/silicon/ai)) //Added by Strumpetplaya - AI shouldn't be able to
return //activate emergency lockers. This fixes that. (Does this make sense, the AI can't call attack_hand, can it? --Mloc)
if(!amount)
to_chat(usr, "It's empty.")
diff --git a/code/game/objects/structures/displaycase.dm b/code/game/objects/structures/displaycase.dm
index 74709df5810..6b732653a64 100644
--- a/code/game/objects/structures/displaycase.dm
+++ b/code/game/objects/structures/displaycase.dm
@@ -140,17 +140,17 @@ var/global/list/captain_display_cases = list()
/obj/structure/displaycase/ex_act(severity)
switch(severity)
- if (1)
+ if(1)
new /obj/item/weapon/shard(loc)
- if (occupant)
+ if(occupant)
dump()
qdel(src)
- if (2)
- if (prob(50))
+ if(2)
+ if(prob(50))
src.health -= 15
src.healthcheck()
- if (3)
- if (prob(50))
+ if(3)
+ if(prob(50))
src.health -= 5
src.healthcheck()
@@ -162,15 +162,15 @@ var/global/list/captain_display_cases = list()
return
/obj/structure/displaycase/blob_act()
- if (prob(75))
+ if(prob(75))
new /obj/item/weapon/shard(loc)
if(occupant) dump()
qdel(src)
/obj/structure/displaycase/proc/healthcheck()
- if (src.health <= 0)
+ if(src.health <= 0)
health = 0
- if (!( src.destroyed ))
+ if(!( src.destroyed ))
src.density = 0
src.destroyed = 1
new /obj/item/weapon/shard(loc)
@@ -273,7 +273,7 @@ var/global/list/captain_display_cases = list()
update_icon()
/obj/structure/displaycase/attack_hand(mob/user as mob)
- if (destroyed || (!locked && user.a_intent == I_HARM))
+ if(destroyed || (!locked && user.a_intent == I_HARM))
if(occupant)
dump()
to_chat(user, "You smash your fist into the delicate electronics at the bottom of the case, and deactivate the hover field.")
diff --git a/code/game/objects/structures/door_assembly.dm b/code/game/objects/structures/door_assembly.dm
index dc697aa7df9..d5a370e9225 100644
--- a/code/game/objects/structures/door_assembly.dm
+++ b/code/game/objects/structures/door_assembly.dm
@@ -151,7 +151,7 @@ obj/structure/door_assembly/multi_tile/Move()
if(istype(W, /obj/item/weapon/weldingtool) && ( (istext(glass)) || (glass == 1) || (!anchored) ))
var/obj/item/weapon/weldingtool/WT = W
- if (WT.remove_fuel(0, user))
+ if(WT.remove_fuel(0, user))
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
if(istext(glass))
user.visible_message("[user] welds the [glass] plating off the airlock assembly.", "You start to weld the [glass] plating off the airlock assembly.")
@@ -235,7 +235,7 @@ obj/structure/door_assembly/multi_tile/Move()
src.state = 1
src.name = "Wired Airlock Assembly"
var/obj/item/weapon/airlock_electronics/ae
- if (!electronics)
+ if(!electronics)
ae = new/obj/item/weapon/airlock_electronics( src.loc )
else
ae = electronics
@@ -244,8 +244,8 @@ obj/structure/door_assembly/multi_tile/Move()
else if(istype(W, /obj/item/stack/sheet) && !glass)
var/obj/item/stack/sheet/S = W
- if (S)
- if (S.amount>=1)
+ if(S)
+ if(S.amount>=1)
if(istype(S, /obj/item/stack/sheet/rglass))
playsound(src.loc, 'sound/items/Crowbar.ogg', 100, 1)
user.visible_message("[user] adds [S.name] to the airlock assembly.", "You start to install [S.name] into the airlock assembly.")
@@ -273,7 +273,7 @@ obj/structure/door_assembly/multi_tile/Move()
var/path
if(istext(glass))
path = text2path("/obj/machinery/door/airlock/[glass]")
- else if (glass == 1)
+ else if(glass == 1)
path = text2path("/obj/machinery/door/airlock[glass_type]")
else
path = text2path("/obj/machinery/door/airlock[airlock_type]")
@@ -298,9 +298,9 @@ obj/structure/door_assembly/multi_tile/Move()
/obj/structure/door_assembly/proc/update_state()
icon_state = "door_as_[glass == 1 ? "g" : ""][istext(glass) ? glass : base_icon_state][state]"
name = ""
- switch (state)
+ switch(state)
if(0)
- if (anchored)
+ if(anchored)
name = "Secured "
if(1)
name = "Wired "
diff --git a/code/game/objects/structures/engicart.dm b/code/game/objects/structures/engicart.dm
index 76dbc81ca43..cce6c1c1bdb 100644
--- a/code/game/objects/structures/engicart.dm
+++ b/code/game/objects/structures/engicart.dm
@@ -80,7 +80,7 @@
else
to_chat(user, fail_msg)
else if(istype(I, /obj/item/weapon/wrench))
- if (!anchored && !isinspace())
+ if(!anchored && !isinspace())
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
diff --git a/code/game/objects/structures/extinguisher.dm b/code/game/objects/structures/extinguisher.dm
index d0521d33f0e..e5a89aa1fad 100644
--- a/code/game/objects/structures/extinguisher.dm
+++ b/code/game/objects/structures/extinguisher.dm
@@ -28,10 +28,10 @@
/obj/structure/extinguisher_cabinet/attack_hand(mob/user)
if(isrobot(user) || isalien(user))
return
- if (ishuman(user))
+ if(ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
- if (user.hand)
+ if(user.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
to_chat(user, "You try to move your [temp.name], but cannot!")
diff --git a/code/game/objects/structures/false_walls.dm b/code/game/objects/structures/false_walls.dm
index 30dec267502..2d1afd939d7 100644
--- a/code/game/objects/structures/false_walls.dm
+++ b/code/game/objects/structures/false_walls.dm
@@ -86,7 +86,7 @@
to_chat(user, "[src] is blocked!")
return
if(istype(W, /obj/item/weapon/screwdriver))
- if (!istype(T, /turf/simulated/floor))
+ if(!istype(T, /turf/simulated/floor))
to_chat(user, "[src] bolts must be tightened on the floor!")
return
user.visible_message("[user] tightens some bolts on the wall.", "You tighten the bolts on the wall.")
diff --git a/code/game/objects/structures/flora.dm b/code/game/objects/structures/flora.dm
index b5aff72fd6c..e4f8acd2c5b 100644
--- a/code/game/objects/structures/flora.dm
+++ b/code/game/objects/structures/flora.dm
@@ -288,10 +288,10 @@
/*
/obj/structure/bush/Bumped(M as mob)
- if (istype(M, /mob/living/simple_animal))
+ if(istype(M, /mob/living/simple_animal))
var/mob/living/simple_animal/A = M
A.loc = get_turf(src)
- else if (istype(M, /mob/living/carbon/monkey))
+ else if(istype(M, /mob/living/carbon/monkey))
var/mob/living/carbon/monkey/A = M
A.loc = get_turf(src)
*/
diff --git a/code/game/objects/structures/foodcart.dm b/code/game/objects/structures/foodcart.dm
index e2df39180d9..071200c8ca0 100644
--- a/code/game/objects/structures/foodcart.dm
+++ b/code/game/objects/structures/foodcart.dm
@@ -55,7 +55,7 @@
if(!success)
to_chat(user, fail_msg)
else if(istype(I, /obj/item/weapon/wrench))
- if (!anchored && !isinspace())
+ if(!anchored && !isinspace())
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
diff --git a/code/game/objects/structures/girders.dm b/code/game/objects/structures/girders.dm
index 83e6094f33e..d84e879dbe0 100644
--- a/code/game/objects/structures/girders.dm
+++ b/code/game/objects/structures/girders.dm
@@ -106,7 +106,7 @@
else
if(S.amount < 2) return ..()
to_chat(user, "\blue Now adding plating...")
- if (do_after(user,40, target = src))
+ if(do_after(user,40, target = src))
if(!src || !S || S.amount < 2) return
S.use(2)
to_chat(user, "\blue You added the plating!")
@@ -125,7 +125,7 @@
new /obj/structure/falsewall/reinforced (src.loc)
qdel(src)
else
- if (src.icon_state == "reinforced") //I cant believe someone would actually write this line of code...
+ if(src.icon_state == "reinforced") //I cant believe someone would actually write this line of code...
if(S.amount < 1) return ..()
to_chat(user, "\blue Now finalising reinforced wall.")
if(do_after(user, 50, target = src))
@@ -141,7 +141,7 @@
else
if(S.amount < 1) return ..()
to_chat(user, "\blue Now reinforcing girders")
- if (do_after(user,60, target = src))
+ if(do_after(user,60, target = src))
if(!src || !S || S.amount < 1) return
S.use(1)
to_chat(user, "\blue Girders reinforced!")
@@ -161,7 +161,7 @@
else
if(S.amount < 2) return ..()
to_chat(user, "\blue Now adding plating...")
- if (do_after(user,40, target = src))
+ if(do_after(user,40, target = src))
if(!src || !S || S.amount < 2) return
S.use(2)
to_chat(user, "\blue You added the plating!")
@@ -176,7 +176,7 @@
else if(istype(W, /obj/item/pipe))
var/obj/item/pipe/P = W
- if (P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
+ if(P.pipe_type in list(0, 1, 5)) //simple pipes, simple bends, and simple manifolds.
user.drop_item()
P.loc = src.loc
to_chat(user, "\blue You fit the pipe into the [src]!")
@@ -206,13 +206,13 @@
qdel(src)
return
if(2.0)
- if (prob(75))
+ if(prob(75))
var/remains = pick(/obj/item/stack/rods,/obj/item/stack/sheet/metal)
new remains(loc)
qdel(src)
return
if(3.0)
- if (prob(40))
+ if(prob(40))
var/remains = pick(/obj/item/stack/rods,/obj/item/stack/sheet/metal)
new remains(loc)
qdel(src)
@@ -277,12 +277,12 @@
qdel(src)
return
if(2.0)
- if (prob(30))
+ if(prob(30))
new /obj/effect/decal/remains/human(loc)
qdel(src)
return
if(3.0)
- if (prob(5))
+ if(prob(5))
new /obj/effect/decal/remains/human(loc)
qdel(src)
return
diff --git a/code/game/objects/structures/grille.dm b/code/game/objects/structures/grille.dm
index 9c1a9e6867a..4cb2b20f99e 100644
--- a/code/game/objects/structures/grille.dm
+++ b/code/game/objects/structures/grille.dm
@@ -81,7 +81,7 @@
user.changeNext_move(CLICK_CD_MELEE)
user.do_attack_animation(src)
var/mob/living/carbon/slime/S = user
- if (!S.is_adult)
+ if(!S.is_adult)
return
playsound(loc, 'sound/effects/grillehit.ogg', 80, 1)
@@ -142,7 +142,10 @@
if(iswirecutter(W))
if(!shock(user, 100))
playsound(loc, 'sound/items/Wirecutter.ogg', 100, 1)
- new /obj/item/stack/rods(loc, 2)
+ if(!destroyed)
+ new /obj/item/stack/rods(loc, 2)
+ else
+ new /obj/item/stack/rods(loc)
qdel(src)
else if((isscrewdriver(W)) && (istype(loc, /turf/simulated) || anchored))
if(!shock(user, 90))
diff --git a/code/game/objects/structures/inflatable.dm b/code/game/objects/structures/inflatable.dm
index 299f776c4f7..d6d2c84ecd4 100644
--- a/code/game/objects/structures/inflatable.dm
+++ b/code/game/objects/structures/inflatable.dm
@@ -3,7 +3,7 @@
desc = "A folded membrane which rapidly expands into a large cubical shape on activation."
icon = 'icons/obj/inflatable.dmi'
icon_state = "folded_wall"
- w_class = 3.0
+ w_class = 3
/obj/item/inflatable/attack_self(mob/user)
playsound(loc, 'sound/items/zip.ogg', 75, 1)
@@ -25,7 +25,7 @@
var/health = 50.0
-/obj/structure/inflatable/New(location)
+/obj/structure/inflatable/initialize(location)
..()
air_update_turf(1)
@@ -89,14 +89,14 @@
/obj/structure/inflatable/attack_slime(mob/user as mob)
var/mob/living/carbon/slime/S = user
- if (!S.is_adult)
+ if(!S.is_adult)
return
attack_generic(user, rand(10, 15))
/obj/structure/inflatable/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(!istype(W))
return
- if (can_puncture(W))
+ if(can_puncture(W))
visible_message("\red [user] pierces [src] with [W]!")
deflate(1)
if(W.damtype == BRUTE || W.damtype == BURN)
diff --git a/code/game/objects/structures/janicart.dm b/code/game/objects/structures/janicart.dm
index e51ea6eb3ac..e51a7e3aac2 100644
--- a/code/game/objects/structures/janicart.dm
+++ b/code/game/objects/structures/janicart.dm
@@ -90,7 +90,7 @@
reagents.reaction(src.loc)
src.reagents.clear_reagents()
else if(istype(I, /obj/item/weapon/wrench))
- if (!anchored && !isinspace())
+ if(!anchored && !isinspace())
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
diff --git a/code/game/objects/structures/lamarr_cage.dm b/code/game/objects/structures/lamarr_cage.dm
index 0f8cde25dbe..d661fb60b9e 100644
--- a/code/game/objects/structures/lamarr_cage.dm
+++ b/code/game/objects/structures/lamarr_cage.dm
@@ -12,16 +12,16 @@
/obj/structure/lamarr/ex_act(severity)
switch(severity)
- if (1)
+ if(1)
new /obj/item/weapon/shard(loc)
Break()
qdel(src)
- if (2)
- if (prob(50))
+ if(2)
+ if(prob(50))
src.health -= 15
src.healthcheck()
- if (3)
- if (prob(50))
+ if(3)
+ if(prob(50))
src.health -= 5
src.healthcheck()
@@ -34,14 +34,14 @@
/obj/structure/lamarr/blob_act()
- if (prob(75))
+ if(prob(75))
new /obj/item/weapon/shard(loc)
Break()
qdel(src)
/obj/structure/lamarr/proc/healthcheck()
- if (src.health <= 0)
- if (!( src.destroyed ))
+ if(src.health <= 0)
+ if(!( src.destroyed ))
src.density = 0
src.destroyed = 1
new /obj/item/weapon/shard(loc)
@@ -66,12 +66,12 @@
return
/obj/structure/lamarr/attack_hand(mob/user as mob)
- if (src.destroyed)
+ if(src.destroyed)
return
else
to_chat(usr, text("\blue You kick the lab cage."))
for(var/mob/O in oviewers())
- if ((O.client && !( O.blinded )))
+ if((O.client && !( O.blinded )))
to_chat(O, text("\red [] kicks the lab cage.", usr))
src.health -= 2
healthcheck()
diff --git a/code/game/objects/structures/lattice.dm b/code/game/objects/structures/lattice.dm
index d7704265861..bfb607585b0 100644
--- a/code/game/objects/structures/lattice.dm
+++ b/code/game/objects/structures/lattice.dm
@@ -18,14 +18,14 @@
icon = 'icons/obj/smoothlattice.dmi'
icon_state = "latticeblank"
updateOverlays()
- for (var/dir in cardinal)
+ for(var/dir in cardinal)
var/obj/structure/lattice/L
if(locate(/obj/structure/lattice, get_step(src, dir)))
L = locate(/obj/structure/lattice, get_step(src, dir))
L.updateOverlays()
/obj/structure/lattice/Destroy()
- for (var/dir in cardinal)
+ for(var/dir in cardinal)
var/obj/structure/lattice/L
if(locate(/obj/structure/lattice, get_step(src, dir)))
L = locate(/obj/structure/lattice, get_step(src, dir))
@@ -51,11 +51,11 @@
/obj/structure/lattice/attackby(obj/item/C as obj, mob/user as mob, params)
- if (istype(C, /obj/item/stack/tile/plasteel) || istype(C, /obj/item/stack/rods))
+ if(istype(C, /obj/item/stack/tile/plasteel) || istype(C, /obj/item/stack/rods))
var/turf/T = get_turf(src)
T.attackby(C, user) //BubbleWrap - hand this off to the underlying turf instead
return
- if (istype(C, /obj/item/weapon/weldingtool))
+ if(istype(C, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = C
if(WT.remove_fuel(0, user))
to_chat(user, "\blue Slicing lattice joints ...")
@@ -72,7 +72,7 @@
var/dir_sum = 0
- for (var/direction in cardinal)
+ for(var/direction in cardinal)
if(locate(/obj/structure/lattice, get_step(src, direction)))
dir_sum += direction
else
diff --git a/code/game/objects/structures/mineral_doors.dm b/code/game/objects/structures/mineral_doors.dm
index 01c9442ea33..9ce9e59e423 100644
--- a/code/game/objects/structures/mineral_doors.dm
+++ b/code/game/objects/structures/mineral_doors.dm
@@ -16,152 +16,155 @@
var/hardness = 1
var/oreAmount = 7
- New(location)
- ..()
- icon_state = mineralType
- name = "[mineralType] door"
- air_update_turf(1)
+/obj/structure/mineral_door/New(location)
+ ..()
+ icon_state = mineralType
+ name = "[mineralType] door"
- Destroy()
- density = 0
- air_update_turf(1)
- return ..()
+/obj/structure/mineral_door/initialize()
+ ..()
+ air_update_turf(1)
- Move()
- var/turf/T = loc
- ..()
- move_update_air(T)
+/obj/structure/mineral_door/Destroy()
+ density = 0
+ air_update_turf(1)
+ return ..()
- Bumped(atom/user)
- ..()
- if(!state)
- return TryToSwitchState(user)
- return
+/obj/structure/mineral_door/Move()
+ var/turf/T = loc
+ ..()
+ move_update_air(T)
- attack_ai(mob/user as mob) //those aren't machinery, they're just big fucking slabs of a mineral
- if(isAI(user)) //so the AI can't open it
- return
- else if(isrobot(user)) //but cyborgs can
- if(get_dist(user,src) <= 1) //not remotely though
- return TryToSwitchState(user)
-
- attack_hand(mob/user as mob)
+/obj/structure/mineral_door/Bumped(atom/user)
+ ..()
+ if(!state)
return TryToSwitchState(user)
+ return
- CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
- if(air_group) return 0
- if(istype(mover, /obj/effect/beam))
- return !opacity
- return !density
+/obj/structure/mineral_door/attack_ai(mob/user as mob) //those aren't machinery, they're just big fucking slabs of a mineral
+ if(isAI(user)) //so the AI can't open it
+ return
+ else if(isrobot(user)) //but cyborgs can
+ if(get_dist(user,src) <= 1) //not remotely though
+ return TryToSwitchState(user)
- CanAtmosPass()
- return !density
+/obj/structure/mineral_door/attack_hand(mob/user as mob)
+ return TryToSwitchState(user)
- proc/TryToSwitchState(atom/user)
- if(isSwitchingStates) return
- if(ismob(user))
- var/mob/M = user
- if(world.time - user.last_bumped <= 60) return //NOTE do we really need that?
- if(M.client)
- if(iscarbon(M))
- var/mob/living/carbon/C = M
- if(!C.handcuffed)
- SwitchState()
- else
+/obj/structure/mineral_door/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
+ if(air_group) return 0
+ if(istype(mover, /obj/effect/beam))
+ return !opacity
+ return !density
+
+/obj/structure/mineral_door/CanAtmosPass()
+ return !density
+
+/obj/structure/mineral_door/proc/TryToSwitchState(atom/user)
+ if(isSwitchingStates) return
+ if(ismob(user))
+ var/mob/M = user
+ if(world.time - user.last_bumped <= 60) return //NOTE do we really need that?
+ if(M.client)
+ if(iscarbon(M))
+ var/mob/living/carbon/C = M
+ if(!C.handcuffed)
SwitchState()
- else if(istype(user, /obj/mecha))
- SwitchState()
+ else
+ SwitchState()
+ else if(istype(user, /obj/mecha))
+ SwitchState()
- proc/SwitchState()
- if(state)
- Close()
- else
- Open()
-
- proc/Open()
- isSwitchingStates = 1
- playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 100, 1)
- flick("[mineralType]opening",src)
- sleep(10)
- density = 0
- opacity = 0
- state = 1
- update_icon()
- isSwitchingStates = 0
- air_update_turf(1)
-
- proc/Close()
- isSwitchingStates = 1
- playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 100, 1)
- flick("[mineralType]closing",src)
- sleep(10)
- density = 1
- opacity = 1
- state = 0
- update_icon()
- isSwitchingStates = 0
- air_update_turf(1)
+/obj/structure/mineral_door/proc/SwitchState()
+ if(state)
+ Close()
+ else
+ Open()
+/obj/structure/mineral_door/proc/Open()
+ isSwitchingStates = 1
+ playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 100, 1)
+ flick("[mineralType]opening",src)
+ sleep(10)
+ density = 0
+ opacity = 0
+ state = 1
update_icon()
- if(state)
- icon_state = "[mineralType]open"
- else
- icon_state = mineralType
+ isSwitchingStates = 0
+ air_update_turf(1)
- attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if(istype(W,/obj/item/weapon/pickaxe))
- var/obj/item/weapon/pickaxe/digTool = W
- to_chat(user, "You start digging the [name].")
- if(do_after(user,digTool.digspeed*hardness, target = src) && src)
- to_chat(user, "You finished digging.")
- Dismantle()
- else if(istype(W,/obj/item/weapon)) //not sure, can't not just weapons get passed to this proc?
- hardness -= W.force/100
- to_chat(user, "You hit the [name] with your [W.name]!")
- CheckHardness()
- else
- attack_hand(user)
- return
+/obj/structure/mineral_door/proc/Close()
+ isSwitchingStates = 1
+ playsound(loc, 'sound/effects/stonedoor_openclose.ogg', 100, 1)
+ flick("[mineralType]closing",src)
+ sleep(10)
+ density = 1
+ opacity = 1
+ state = 0
+ update_icon()
+ isSwitchingStates = 0
+ air_update_turf(1)
- proc/CheckHardness()
- if(hardness <= 0)
+/obj/structure/mineral_door/update_icon()
+ if(state)
+ icon_state = "[mineralType]open"
+ else
+ icon_state = mineralType
+
+/obj/structure/mineral_door/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
+ if(istype(W,/obj/item/weapon/pickaxe))
+ var/obj/item/weapon/pickaxe/digTool = W
+ to_chat(user, "You start digging the [name].")
+ if(do_after(user,digTool.digspeed*hardness, target = src) && src)
+ to_chat(user, "You finished digging.")
+ Dismantle()
+ else if(istype(W,/obj/item/weapon)) //not sure, can't not just weapons get passed to this proc?
+ hardness -= W.force/100
+ to_chat(user, "You hit the [name] with your [W.name]!")
+ CheckHardness()
+ else
+ attack_hand(user)
+ return
+
+/obj/structure/mineral_door/proc/CheckHardness()
+ if(hardness <= 0)
+ Dismantle(1)
+
+/obj/structure/mineral_door/proc/Dismantle(devastated = 0)
+ if(!devastated)
+ if(mineralType == "metal")
+ var/ore = /obj/item/stack/sheet/metal
+ for(var/i = 1, i <= oreAmount, i++)
+ new ore(get_turf(src))
+ else
+ var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
+ for(var/i = 1, i <= oreAmount, i++)
+ new ore(get_turf(src))
+ else
+ if(mineralType == "metal")
+ var/ore = /obj/item/stack/sheet/metal
+ for(var/i = 3, i <= oreAmount, i++)
+ new ore(get_turf(src))
+ else
+ var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
+ for(var/i = 3, i <= oreAmount, i++)
+ new ore(get_turf(src))
+ qdel(src)
+
+/obj/structure/mineral_door/ex_act(severity = 1)
+ switch(severity)
+ if(1)
Dismantle(1)
-
- proc/Dismantle(devastated = 0)
- if(!devastated)
- if (mineralType == "metal")
- var/ore = /obj/item/stack/sheet/metal
- for(var/i = 1, i <= oreAmount, i++)
- new ore(get_turf(src))
- else
- var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
- for(var/i = 1, i <= oreAmount, i++)
- new ore(get_turf(src))
- else
- if (mineralType == "metal")
- var/ore = /obj/item/stack/sheet/metal
- for(var/i = 3, i <= oreAmount, i++)
- new ore(get_turf(src))
- else
- var/ore = text2path("/obj/item/stack/sheet/mineral/[mineralType]")
- for(var/i = 3, i <= oreAmount, i++)
- new ore(get_turf(src))
- qdel(src)
-
- ex_act(severity = 1)
- switch(severity)
- if(1)
+ if(2)
+ if(prob(20))
Dismantle(1)
- if(2)
- if(prob(20))
- Dismantle(1)
- else
- hardness--
- CheckHardness()
- if(3)
- hardness -= 0.1
+ else
+ hardness--
CheckHardness()
- return
+ if(3)
+ hardness -= 0.1
+ CheckHardness()
+ return
/obj/structure/mineral_door/iron
mineralType = "metal"
@@ -285,4 +288,4 @@
CheckHardness()
playsound(loc, 'sound/effects/attackblob.ogg', 100, 1)
- ..()
\ No newline at end of file
+ ..()
diff --git a/code/game/objects/structures/mirror.dm b/code/game/objects/structures/mirror.dm
index d0e8d4c9c85..83220bb6a33 100644
--- a/code/game/objects/structures/mirror.dm
+++ b/code/game/objects/structures/mirror.dm
@@ -76,7 +76,7 @@
/obj/structure/mirror/attack_slime(mob/living/user as mob)
var/mob/living/carbon/slime/S = user
- if (!S.is_adult)
+ if(!S.is_adult)
return
user.do_attack_animation(src)
if(shattered)
diff --git a/code/game/objects/structures/misc.dm b/code/game/objects/structures/misc.dm
index 1b8737e1ddd..81511f16aa1 100644
--- a/code/game/objects/structures/misc.dm
+++ b/code/game/objects/structures/misc.dm
@@ -34,7 +34,7 @@
attack_hand(mob/user as mob)
- if (user.mind.special_role=="Ninja")
+ if(user.mind.special_role=="Ninja")
switch(alert("Phase Jaunt relay primed, target locked as [station_name()], initiate VOID-shift translocation? (Warning! Internals required!)",,"Yes","No"))
if("Yes")
diff --git a/code/game/objects/structures/mop_bucket.dm b/code/game/objects/structures/mop_bucket.dm
index fbe267e0779..68589112080 100644
--- a/code/game/objects/structures/mop_bucket.dm
+++ b/code/game/objects/structures/mop_bucket.dm
@@ -26,12 +26,12 @@
to_chat(usr, "[bicon(src)] [src] contains [reagents.total_volume] units of water left!")
/obj/structure/mopbucket/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/mop))
- if (src.reagents.total_volume >= 2)
+ if(istype(W, /obj/item/weapon/mop))
+ if(src.reagents.total_volume >= 2)
src.reagents.trans_to(W, 2)
to_chat(user, "\blue You wet the mop")
playsound(src.loc, 'sound/effects/slosh.ogg', 25, 1)
- if (src.reagents.total_volume < 1)
+ if(src.reagents.total_volume < 1)
to_chat(user, "\blue Out of water!")
return
@@ -41,10 +41,10 @@
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
return
if(3.0)
- if (prob(5))
+ if(prob(5))
qdel(src)
return
diff --git a/code/game/objects/structures/morgue.dm b/code/game/objects/structures/morgue.dm
index f9809b422ca..71a0c8379a9 100644
--- a/code/game/objects/structures/morgue.dm
+++ b/code/game/objects/structures/morgue.dm
@@ -55,14 +55,14 @@
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(loc)
ex_act(severity)
qdel(src)
return
if(3.0)
- if (prob(5))
+ if(prob(5))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(loc)
ex_act(severity)
@@ -75,9 +75,9 @@
/obj/structure/morgue/attack_hand(mob/user as mob)
- if (connected)
+ if(connected)
for(var/atom/movable/A as mob|obj in connected.loc)
- if (!( A.anchored ))
+ if(!( A.anchored ))
A.forceMove(src)
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
qdel(connected)
@@ -88,7 +88,7 @@
step(connected, dir)
connected.layer = OBJ_LAYER
var/turf/T = get_step(src, dir)
- if (T.contents.Find(connected))
+ if(T.contents.Find(connected))
connected.connected = src
icon_state = "morgue0"
for(var/atom/movable/A as mob|obj in src)
@@ -103,14 +103,14 @@
return
/obj/structure/morgue/attackby(P as obj, mob/user as mob, params)
- if (istype(P, /obj/item/weapon/pen))
+ if(istype(P, /obj/item/weapon/pen))
var/t = input(user, "What would you like the label to be?", text("[]", name), null) as text
- if (user.get_active_hand() != P)
+ if(user.get_active_hand() != P)
return
- if ((!in_range(src, usr) && loc != user))
+ if((!in_range(src, usr) && loc != user))
return
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
- if (t)
+ if(t)
name = text("Morgue- '[]'", t)
overlays += image(icon, "morgue_label")
else
@@ -120,13 +120,13 @@
return
/obj/structure/morgue/relaymove(mob/user as mob)
- if (user.stat)
+ if(user.stat)
return
connected = new /obj/structure/m_tray( loc )
step(connected, dir)
connected.layer = OBJ_LAYER
var/turf/T = get_step(src, dir)
- if (T.contents.Find(connected))
+ if(T.contents.Find(connected))
connected.connected = src
icon_state = "morgue0"
for(var/atom/movable/A as mob|obj in src)
@@ -147,7 +147,7 @@
var/mob/living/carbon/CM = L
if(!istype(CM))
return
- if (CM.stat || CM.restrained())
+ if(CM.stat || CM.restrained())
return
to_chat(CM, "You attempt to slide yourself out of \the [src]...")
@@ -170,9 +170,9 @@
/obj/structure/m_tray/attack_hand(mob/user as mob)
- if (connected)
+ if(connected)
for(var/atom/movable/A as mob|obj in loc)
- if (!( A.anchored ))
+ if(!( A.anchored ))
A.forceMove(connected)
connected.connected = null
connected.update()
@@ -182,16 +182,16 @@
return
/obj/structure/m_tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
- if ((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src) || user.contents.Find(O)))
+ if((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src) || user.contents.Find(O)))
return
- if (!ismob(O) && !istype(O, /obj/structure/closet/body_bag))
+ if(!ismob(O) && !istype(O, /obj/structure/closet/body_bag))
return
- if (!ismob(user) || user.stat || user.lying || user.stunned)
+ if(!ismob(user) || user.stat || user.lying || user.stunned)
return
O.forceMove(loc)
- if (user != O)
+ if(user != O)
for(var/mob/B in viewers(user, 3))
- if ((B.client && !( B.blinded )))
+ if((B.client && !( B.blinded )))
to_chat(B, text("\red [] stuffs [] into []!", user, O, src))
return
@@ -235,10 +235,10 @@
var/locked = 0
/obj/structure/crematorium/proc/update()
- if (connected)
+ if(connected)
icon_state = "crema0"
else
- if (contents.len)
+ if(contents.len)
icon_state = "crema2"
else
icon_state = "crema1"
@@ -253,14 +253,14 @@
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(loc)
ex_act(severity)
qdel(src)
return
if(3.0)
- if (prob(5))
+ if(prob(5))
for(var/atom/movable/A as mob|obj in src)
A.forceMove(loc)
ex_act(severity)
@@ -273,23 +273,23 @@
/obj/structure/crematorium/attack_hand(mob/user as mob)
- if (cremating)
+ if(cremating)
to_chat(usr, "\red It's locked.")
return
- if ((connected) && (locked == 0))
+ if((connected) && (locked == 0))
for(var/atom/movable/A as mob|obj in connected.loc)
- if (!( A.anchored ))
+ if(!( A.anchored ))
A.forceMove(src)
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
qdel(connected)
connected = null
- else if (locked == 0)
+ else if(locked == 0)
playsound(loc, 'sound/items/Deconstruct.ogg', 50, 1)
connected = new /obj/structure/c_tray( loc )
step(connected, SOUTH)
connected.layer = OBJ_LAYER
var/turf/T = get_step(src, SOUTH)
- if (T.contents.Find(connected))
+ if(T.contents.Find(connected))
connected.connected = src
icon_state = "crema0"
for(var/atom/movable/A as mob|obj in src)
@@ -302,14 +302,14 @@
update()
/obj/structure/crematorium/attackby(P as obj, mob/user as mob, params)
- if (istype(P, /obj/item/weapon/pen))
+ if(istype(P, /obj/item/weapon/pen))
var/t = input(user, "What would you like the label to be?", text("[]", name), null) as text
- if (user.get_active_hand() != P)
+ if(user.get_active_hand() != P)
return
- if ((!in_range(src, usr) > 1 && loc != user))
+ if((!in_range(src, usr) > 1 && loc != user))
return
t = sanitize(copytext(t,1,MAX_MESSAGE_LEN))
- if (t)
+ if(t)
name = text("Crematorium- '[]'", t)
else
name = "Crematorium"
@@ -317,13 +317,13 @@
return
/obj/structure/crematorium/relaymove(mob/user as mob)
- if (user.stat || locked)
+ if(user.stat || locked)
return
connected = new /obj/structure/c_tray( loc )
step(connected, SOUTH)
connected.layer = OBJ_LAYER
var/turf/T = get_step(src, SOUTH)
- if (T.contents.Find(connected))
+ if(T.contents.Find(connected))
connected.connected = src
icon_state = "crema0"
for(var/atom/movable/A as mob|obj in src)
@@ -339,12 +339,12 @@
return //don't let you cremate something twice or w/e
if(contents.len <= 0)
- for (var/mob/M in viewers(src))
+ for(var/mob/M in viewers(src))
M.show_message("You hear a hollow crackle.", 1)
return
else
- for (var/mob/M in viewers(src))
+ for(var/mob/M in viewers(src))
M.show_message("You hear a roar as the crematorium activates.", 1)
cremating = 1
@@ -354,7 +354,7 @@
for(var/mob/living/M in search_contents_for(/mob/living))
if(!M || !isnull(M.gcDestroyed))
continue
- if (M.stat!=2)
+ if(M.stat!=2)
M.emote("scream")
if(istype(user))
M.attack_log += "\[[time_stamp()]\] Has been cremated by [user.name] ([user.ckey])"
@@ -385,7 +385,7 @@
var/mob/living/carbon/CM = L
if(!istype(CM))
return
- if (CM.stat || CM.restrained())
+ if(CM.stat || CM.restrained())
return
to_chat(CM, "You attempt to slide yourself out of \the [src]...")
@@ -406,9 +406,9 @@
throwpass = 1
/obj/structure/c_tray/attack_hand(mob/user as mob)
- if (connected)
+ if(connected)
for(var/atom/movable/A as mob|obj in loc)
- if (!( A.anchored ))
+ if(!( A.anchored ))
A.forceMove(connected)
//Foreach goto(26)
connected.connected = null
@@ -419,16 +419,16 @@
return
/obj/structure/c_tray/MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
- if ((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src) || user.contents.Find(O)))
+ if((!( istype(O, /atom/movable) ) || O.anchored || get_dist(user, src) > 1 || get_dist(user, O) > 1 || user.contents.Find(src) || user.contents.Find(O)))
return
- if (!ismob(O) && !istype(O, /obj/structure/closet/body_bag))
+ if(!ismob(O) && !istype(O, /obj/structure/closet/body_bag))
return
- if (!ismob(user) || user.stat || user.lying || user.stunned)
+ if(!ismob(user) || user.stat || user.lying || user.stunned)
return
O.forceMove(loc)
- if (user != O)
+ if(user != O)
for(var/mob/B in viewers(user, 3))
- if ((B.client && !( B.blinded )))
+ if((B.client && !( B.blinded )))
to_chat(B, text("\red [] stuffs [] into []!", user, O, src))
//Foreach goto(99)
return
@@ -441,58 +441,32 @@
/obj/machinery/crema_switch/attack_hand(mob/user as mob)
if(allowed(usr))
- for (var/obj/structure/crematorium/C in world)
- if (C.id == id)
- if (!C.cremating)
+ for(var/obj/structure/crematorium/C in world)
+ if(C.id == id)
+ if(!C.cremating)
C.cremate(user)
else
to_chat(usr, "\red Access denied.")
return
-/hook/Login/proc/update_morgue(var/client/client, var/mob/L)
- //Update morgues on login/logout
- if (L.stat == DEAD)
- var/obj/structure/morgue/Morgue = null
- var/mob/living/carbon/human/C = null
- if (istype(L,/mob/dead/observer)) //We're a ghost, let's find our corpse
- var/mob/dead/observer/G = L
- if(!G.mind) //This'll probably break morgue sprites, but the line under the next If statement causes runtimes with Assume Direct Control.
- return
- if (G.can_reenter_corpse && G.mind.current)
- C = G.mind.current
- else if (istype(L,/mob/living/carbon/human))
- C = L
+/mob/proc/update_morgue()
+ if(stat == DEAD)
+ var/obj/structure/morgue/morgue
+ var/mob/living/C = src
+ var/mob/dead/observer/G = src
+ if(istype(G) && G.can_reenter_corpse && G.mind) //We're a ghost, let's find our corpse
+ C = G.mind.current
+ if(istype(C)) //We found our corpse, is it inside a morgue?
+ morgue = get(C.loc, /obj/structure/morgue)
+ if(morgue)
+ morgue.update()
- if (C) //We found our corpse, is it inside a morgue?
- if (istype(C.loc,/obj/structure/morgue))
- Morgue = C.loc
- else if (istype(C.loc,/obj/structure/closet/body_bag))
- var/obj/structure/closet/body_bag/B = C.loc
- if (istype(B.loc,/obj/structure/morgue))
- Morgue = B.loc
- if (Morgue)
- Morgue.update()
+/hook/mob_login/proc/update_morgue(var/client/client, var/mob/mob)
+ //Update morgues on login
+ mob.update_morgue()
+ return 1
-/hook/Logout/proc/update_morgue(var/client/client, var/mob/L)
- //Update morgues on login/logout
- if (L.stat == DEAD)
- var/obj/structure/morgue/Morgue = null
- var/mob/living/carbon/human/C = null
- if (istype(L,/mob/dead/observer)) //We're a ghost, let's find our corpse
- var/mob/dead/observer/G = L
- if(!G.mind) //This'll probably break morgue sprites, but the line under the next If statement causes runtimes with Assume Direct Control.
- return 1
- if (G.can_reenter_corpse && G.mind.current)
- C = G.mind.current
- else if (istype(L,/mob/living/carbon/human))
- C = L
-
- if (C) //We found our corpse, is it inside a morgue?
- if (istype(C.loc,/obj/structure/morgue))
- Morgue = C.loc
- else if (istype(C.loc,/obj/structure/closet/body_bag))
- var/obj/structure/closet/body_bag/B = C.loc
- if (istype(B.loc,/obj/structure/morgue))
- Morgue = B.loc
- if (Morgue)
- Morgue.update()
\ No newline at end of file
+/hook/mob_logout/proc/update_morgue(var/client/client, var/mob/mob)
+ //Update morgues on logout
+ mob.update_morgue()
+ return 1
diff --git a/code/game/objects/structures/musician.dm b/code/game/objects/structures/musician.dm
index e790e785b40..563f9c5faa9 100644
--- a/code/game/objects/structures/musician.dm
+++ b/code/game/objects/structures/musician.dm
@@ -129,7 +129,7 @@
return
ui = nanomanager.try_update_ui(user, instrumentObj, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, instrumentObj, ui_key, "song.tmpl", instrumentObj.name, 700, 500)
ui.set_initial_data(data)
ui.open()
@@ -298,11 +298,11 @@
song.Topic(href, href_list)
/obj/structure/piano/attackby(obj/item/O as obj, mob/user as mob, params)
- if (istype(O, /obj/item/weapon/wrench))
- if (!anchored && !isinspace())
+ if(istype(O, /obj/item/weapon/wrench))
+ if(!anchored && !isinspace())
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, " You begin to tighten \the [src] to the floor...")
- if (do_after(user, 20, target = src))
+ if(do_after(user, 20, target = src))
user.visible_message( \
"[user] tightens \the [src]'s casters.", \
" You have tightened \the [src]'s casters. Now it can be played again.", \
@@ -311,7 +311,7 @@
else if(anchored)
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
to_chat(user, " You begin to loosen \the [src]'s casters...")
- if (do_after(user, 40, target = src))
+ if(do_after(user, 40, target = src))
user.visible_message( \
"[user] loosens \the [src]'s casters.", \
" You have loosened \the [src]. Now it can be pulled somewhere else.", \
diff --git a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm
index 3f5decad98e..d58888d6e24 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/alien_nests.dm
@@ -47,7 +47,7 @@
/obj/structure/stool/bed/nest/user_buckle_mob(mob/living/M, mob/living/user)
- if ( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || usr.stat || M.buckled || istype(user, /mob/living/silicon/pai) )
+ if( !ismob(M) || (get_dist(src, user) > 1) || (M.loc != src.loc) || user.restrained() || usr.stat || M.buckled || istype(user, /mob/living/silicon/pai) )
return
if(M.get_int_organ(/obj/item/organ/internal/xenos/plasmavessel))
diff --git a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
index 621f3a9d78e..a12f804d308 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/chairs.dm
@@ -66,6 +66,14 @@
handle_rotation()
return
+/obj/structure/stool/bed/chair/AltClick(mob/user)
+ if(user.incapacitated())
+ to_chat(user, "You can't do that right now!")
+ return
+ if(!Adjacent(user))
+ return
+ rotate()
+
// Chair types
/obj/structure/stool/bed/chair/wood
// TODO: Special ash subtype that looks like charred chair legs
@@ -140,6 +148,15 @@
anchored = 0
movable = 1
+/obj/structure/stool/bed/chair/comfy/attackby(obj/item/weapon/W, mob/user, params)
+ if(iswrench(W))
+ playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
+ new /obj/item/stack/sheet/metal(get_turf(src))
+ new /obj/item/stack/sheet/metal(get_turf(src))
+ qdel(src)
+ else
+ ..()
+
/obj/structure/stool/bed/chair/office/Bump(atom/A)
..()
if(!buckled_mob) return
diff --git a/code/game/objects/structures/stool_bed_chair_nest/stools.dm b/code/game/objects/structures/stool_bed_chair_nest/stools.dm
index 6ff52f09deb..da69c025bb8 100644
--- a/code/game/objects/structures/stool_bed_chair_nest/stools.dm
+++ b/code/game/objects/structures/stool_bed_chair_nest/stools.dm
@@ -11,12 +11,12 @@
qdel(src)
return
if(2.0)
- if (prob(70))
+ if(prob(70))
new /obj/item/stack/sheet/metal(src.loc)
qdel(src)
return
if(3.0)
- if (prob(50))
+ if(prob(50))
new /obj/item/stack/sheet/metal(src.loc)
qdel(src)
return
@@ -37,9 +37,9 @@
/obj/structure/stool/MouseDrop(atom/over_object, src_location, over_location, src_control, over_control, params, skip_fucking_stool_shit = 0)
if(skip_fucking_stool_shit)
return ..(over_object)
- if (istype(over_object, /mob/living/carbon/human))
+ if(istype(over_object, /mob/living/carbon/human))
var/mob/living/carbon/human/H = over_object
- if (H==usr && !H.restrained() && !H.stat && in_range(src, over_object))
+ if(H==usr && !H.restrained() && !H.stat && in_range(src, over_object))
var/obj/item/weapon/stool/S = new/obj/item/weapon/stool()
S.origin = src
src.loc = S
@@ -53,7 +53,7 @@
icon_state = "stool"
force = 10
throwforce = 10
- w_class = 5.0
+ w_class = 5
var/obj/structure/stool/origin = null
/obj/item/weapon/stool/attack_self(mob/user as mob)
@@ -64,7 +64,7 @@
qdel(src)
/obj/item/weapon/stool/attack(mob/M as mob, mob/user as mob)
- if (prob(5) && istype(M,/mob/living))
+ if(prob(5) && istype(M,/mob/living))
user.visible_message("[user] breaks [src] over [M]'s back!.")
user.unEquip(src)
var/obj/item/stack/sheet/metal/m = new/obj/item/stack/sheet/metal
diff --git a/code/game/objects/structures/tables_racks.dm b/code/game/objects/structures/tables_racks.dm
index bdf94263c8e..285b1da8aa5 100644
--- a/code/game/objects/structures/tables_racks.dm
+++ b/code/game/objects/structures/tables_racks.dm
@@ -54,14 +54,14 @@
var/subtype = null
for(var/direction in list(turn(dir,90), turn(dir,-90)) )
var/obj/structure/table/T = locate(/obj/structure/table,get_step(src,direction))
- if (T && T.flipped)
+ if(T && T.flipped)
type++
if(type == 1)
subtype = direction == turn(dir,90) ? "-" : "+"
var/base = "table"
- if (istype(src, /obj/structure/table/woodentable))
+ if(istype(src, /obj/structure/table/woodentable))
base = "wood"
- if (istype(src, /obj/structure/table/reinforced))
+ if(istype(src, /obj/structure/table/reinforced))
base = "rtable"
icon_state = "[base]flip[type][type == 1 ? subtype : ""]"
@@ -75,11 +75,11 @@
qdel(src)
return
if(2.0)
- if (prob(50))
+ if(prob(50))
qdel(src)
return
if(3.0)
- if (prob(25))
+ if(prob(25))
destroy()
else
return
@@ -134,8 +134,8 @@
return 1
if(locate(/obj/structure/table) in get_turf(mover))
return 1
- if (flipped)
- if (get_dir(loc, target) == dir)
+ if(flipped)
+ if(get_dir(loc, target) == dir)
return !density
else
return 1
@@ -150,13 +150,13 @@
//checks if projectile 'P' from turf 'from' can hit whatever is behind the table. Returns 1 if it can, 0 if bullet stops.
/obj/structure/table/proc/check_cover(obj/item/projectile/P, turf/from)
var/turf/cover = flipped ? get_turf(src) : get_step(loc, get_dir(from, loc))
- if (get_dist(P.starting, loc) <= 1) //Tables won't help you if people are THIS close
+ if(get_dist(P.starting, loc) <= 1) //Tables won't help you if people are THIS close
return 1
- if (get_turf(P.original) == cover)
+ if(get_turf(P.original) == cover)
var/chance = 20
- if (ismob(P.original))
+ if(ismob(P.original))
var/mob/M = P.original
- if (M.lying)
+ if(M.lying)
chance += 20 //Lying down lets you catch less bullets
if(flipped)
if(get_dir(loc, from) == dir) //Flipped tables catch mroe bullets
@@ -165,7 +165,7 @@
return 1 //But only from one side
if(prob(chance))
health -= P.damage/2
- if (health > 0)
+ if(health > 0)
visible_message("[P] hits \the [src]!")
return 0
else
@@ -177,8 +177,8 @@
/obj/structure/table/CheckExit(atom/movable/O as mob|obj, target as turf)
if(istype(O) && O.checkpass(PASSTABLE))
return 1
- if (flipped)
- if (get_dir(loc, target) == dir)
+ if(flipped)
+ if(get_dir(loc, target) == dir)
return !density
else
return 1
@@ -186,13 +186,13 @@
/obj/structure/table/MouseDrop_T(obj/O as obj, mob/user as mob)
..()
- if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O))
+ if((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O))
return
if(isrobot(user))
return
if(!user.drop_item())
return
- if (O.loc != src.loc)
+ if(O.loc != src.loc)
step(O, get_dir(O, src))
return
@@ -217,11 +217,11 @@
qdel(I)
/obj/structure/table/attackby(obj/item/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/grab))
+ if(istype(W, /obj/item/weapon/grab))
tablepush(W, user)
return
- if (istype(W, /obj/item/weapon/wrench))
+ if(istype(W, /obj/item/weapon/wrench))
user.visible_message("[user] is disassembling \a [src].", "You start disassembling \the [src].")
playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
if(do_after(user, 50, target = src))
@@ -263,11 +263,11 @@
if(T && !T.flipped)
return 0
T = locate() in get_step(src.loc,direction)
- if (!T || T.flipped)
+ if(!T || T.flipped)
return 1
- if (istype(T,/obj/structure/table/reinforced/))
+ if(istype(T,/obj/structure/table/reinforced/))
var/obj/structure/table/reinforced/R = T
- if (R.status == 2)
+ if(R.status == 2)
return 0
return T.straight_table_check(direction)
@@ -277,7 +277,7 @@
set category = null
set src in oview(1)
- if (!can_touch(usr) || ismouse(usr))
+ if(!can_touch(usr) || ismouse(usr))
return
if(!flip(get_cardinal_dir(usr,src)))
@@ -297,13 +297,13 @@
set category = "Object"
set src in oview(1)
- if (!unflip())
+ if(!unflip())
to_chat(usr, "It won't budge.")
return
/obj/structure/table/proc/flip(var/direction)
- if (flipped)
+ if(flipped)
return 0
if( !straight_table_check(turn(direction,90)) || !straight_table_check(turn(direction,-90)) )
@@ -313,8 +313,8 @@
verbs +=/obj/structure/table/proc/do_put
var/list/targets = list(get_step(src,dir),get_step(src,turn(dir, 45)),get_step(src,turn(dir, -45)))
- for (var/atom/movable/A in get_turf(src))
- if (!A.anchored)
+ for(var/atom/movable/A in get_turf(src))
+ if(!A.anchored)
spawn(0)
A.throw_at(pick(targets),1,1)
@@ -333,14 +333,14 @@
return 1
/obj/structure/table/proc/unflip()
- if (!flipped)
+ if(!flipped)
return 0
var/can_flip = 1
- for (var/mob/A in oview(src,0))//src.loc)
- if (istype(A))
+ for(var/mob/A in oview(src,0))//src.loc)
+ if(istype(A))
can_flip = 0
- if (!can_flip)
+ if(!can_flip)
return 0
verbs -=/obj/structure/table/proc/do_put
@@ -471,33 +471,33 @@
canSmoothWith = list(/obj/structure/table/reinforced, /obj/structure/table)
/obj/structure/table/reinforced/flip(var/direction)
- if (status == 2)
+ if(status == 2)
return 0
else
return ..()
/obj/structure/table/reinforced/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/weldingtool))
+ if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user))
if(src.status == 2)
to_chat(user, "\blue Now weakening the reinforced table")
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
- if (do_after(user, 50, target = src))
+ if(do_after(user, 50, target = src))
if(!src || !WT.isOn()) return
to_chat(user, "\blue Table weakened")
src.status = 1
else
to_chat(user, "\blue Now strengthening the reinforced table")
playsound(src.loc, 'sound/items/Welder.ogg', 50, 1)
- if (do_after(user, 50, target = src))
+ if(do_after(user, 50, target = src))
if(!src || !WT.isOn()) return
to_chat(user, "\blue Table strengthened")
src.status = 2
return
return
- if (istype(W, /obj/item/weapon/wrench))
+ if(istype(W, /obj/item/weapon/wrench))
if(src.status == 2)
return
@@ -560,18 +560,18 @@
. = . || mover.checkpass(PASSTABLE)
/obj/structure/rack/MouseDrop_T(obj/O as obj, mob/user as mob)
- if ((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O))
+ if((!( istype(O, /obj/item/weapon) ) || user.get_active_hand() != O))
return
if(isrobot(user))
return
if(!user.drop_item())
return
- if (O.loc != src.loc)
+ if(O.loc != src.loc)
step(O, get_dir(O, src))
return
/obj/structure/rack/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/wrench))
+ if(istype(W, /obj/item/weapon/wrench))
new /obj/item/weapon/rack_parts( src.loc )
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
qdel(src)
diff --git a/code/game/objects/structures/watercloset.dm b/code/game/objects/structures/watercloset.dm
index efef25723a5..5d8c98be329 100644
--- a/code/game/objects/structures/watercloset.dm
+++ b/code/game/objects/structures/watercloset.dm
@@ -174,11 +174,11 @@
on = !on
update_icon()
if(on)
- if (M.loc == loc)
+ if(M.loc == loc)
wash(M)
check_heat(M)
M.water_act(100, convertHeat(), src)
- for (var/atom/movable/G in src.loc)
+ for(var/atom/movable/G in src.loc)
G.clean_blood()
G.water_act(100, convertHeat(), src)
@@ -283,9 +283,9 @@
washears = !(H.head.flags_inv & HIDEEARS)
if(H.wear_mask)
- if (washears)
+ if(washears)
washears = !(H.wear_mask.flags_inv & HIDEEARS)
- if (washglasses)
+ if(washglasses)
washglasses = !(H.wear_mask.flags_inv & HIDEEYES)
if(H.head)
@@ -382,10 +382,10 @@
if(!Adjacent(user))
return
- if (ishuman(user))
+ if(ishuman(user))
var/mob/living/carbon/human/H = user
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
- if (user.hand)
+ if(user.hand)
temp = H.organs_by_name["l_hand"]
if(temp && !temp.is_usable())
to_chat(user, "You try to move your [temp.name], but cannot!")
@@ -434,7 +434,7 @@
var/wateract = 0
wateract = (O.wash(user, src))
busy = 0
- if (wateract)
+ if(wateract)
O.water_act(20,310.15,src)
/obj/structure/sink/kitchen
diff --git a/code/game/objects/structures/windoor_assembly.dm b/code/game/objects/structures/windoor_assembly.dm
index 529dbb447a8..4e41daef289 100644
--- a/code/game/objects/structures/windoor_assembly.dm
+++ b/code/game/objects/structures/windoor_assembly.dm
@@ -76,7 +76,7 @@ obj/structure/windoor_assembly/Destroy()
if("01")
if(istype(W, /obj/item/weapon/weldingtool) && !anchored )
var/obj/item/weapon/weldingtool/WT = W
- if (WT.remove_fuel(0,user))
+ if(WT.remove_fuel(0,user))
user.visible_message("[user] dissassembles the windoor assembly.", "You start to dissassemble the windoor assembly.")
playsound(src.loc, 'sound/items/Welder2.ogg', 50, 1)
@@ -307,7 +307,7 @@ obj/structure/windoor_assembly/Destroy()
set src in oview(1)
if(usr.stat || !usr.canmove || usr.restrained())
return
- if (src.anchored)
+ if(src.anchored)
to_chat(usr, "It is fastened to the floor; therefore, you can't rotate it!")
return 0
//if(src.state != "01")
@@ -322,6 +322,14 @@ obj/structure/windoor_assembly/Destroy()
update_icon()
return
+/obj/structure/windoor_assembly/AltClick(mob/user)
+ if(user.incapacitated())
+ to_chat(user, "You can't do that right now!")
+ return
+ if(!Adjacent(user))
+ return
+ revrotate()
+
//Flips the windoor assembly, determines whather the door opens to the left or the right
/obj/structure/windoor_assembly/verb/flip()
set name = "Flip Windoor Assembly"
diff --git a/code/game/objects/structures/window.dm b/code/game/objects/structures/window.dm
index e078fa2295e..7ae2ddcd27d 100644
--- a/code/game/objects/structures/window.dm
+++ b/code/game/objects/structures/window.dm
@@ -127,7 +127,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
user.visible_message("[user] smashes through [src]!")
destroy()
- else if (user.a_intent == I_HARM)
+ else if(user.a_intent == I_HARM)
user.changeNext_move(CLICK_CD_MELEE)
playsound(get_turf(src), 'sound/effects/glassknock.ogg', 80, 1)
user.visible_message("\red [user.name] bangs against the [src.name]!", \
@@ -168,27 +168,27 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
/obj/structure/window/attack_slime(mob/living/user as mob)
var/mob/living/carbon/slime/S = user
- if (!S.is_adult)
+ if(!S.is_adult)
return
attack_generic(user, rand(10, 15))
/obj/structure/window/attackby(obj/item/weapon/W as obj, mob/living/user as mob, params)
if(!istype(W)) return//I really wish I did not need this
- if (istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
+ if(istype(W, /obj/item/weapon/grab) && get_dist(src,user)<2)
var/obj/item/weapon/grab/G = W
if(istype(G.affecting,/mob/living))
var/mob/living/M = G.affecting
var/state = G.state
qdel(W) //gotta delete it here because if window breaks, it won't get deleted
- switch (state)
+ switch(state)
if(1)
M.visible_message("[user] slams [M] against \the [src]!")
M.apply_damage(7)
hit(10)
if(2)
M.visible_message("[user] bashes [M] against \the [src]!")
- if (prob(50))
+ if(prob(50))
M.Weaken(1)
M.apply_damage(10)
hit(25)
@@ -229,16 +229,16 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
playsound(src.loc, 'sound/items/Ratchet.ogg', 50, 1)
for(var/i=0;i=G.max_amount)
continue
G.attackby(NG, user, params)
- if (reinf)
+ if(reinf)
var/obj/item/stack/rods/NR = new (src.loc)
- for (var/obj/item/stack/rods/R in src.loc)
+ for(var/obj/item/stack/rods/R in src.loc)
if(R==NR)
continue
if(R.amount>=R.max_amount)
@@ -318,6 +318,14 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
return
+/obj/structure/window/AltClick(mob/user)
+ if(user.incapacitated())
+ to_chat(user, "You can't do that right now!")
+ return
+ if(!Adjacent(user))
+ return
+ revrotate()
+
/*
/obj/structure/window/proc/updateSilicate()
if(silicateIcon && silicate)
@@ -338,10 +346,13 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
ini_dir = dir
if(!color && !istype(src,/obj/structure/window/plasmabasic) && !istype(src,/obj/structure/window/plasmareinforced))
color = color_windows(src)
- air_update_turf(1)
update_nearby_icons()
return
+/obj/structure/window/initialize()
+ air_update_turf(1)
+ return ..()
+
/obj/structure/window/Destroy()
density = 0
air_update_turf(1)
@@ -402,10 +413,13 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
/obj/structure/window/plasmabasic/New(Loc,re=0)
..()
ini_dir = dir
- air_update_turf(1)
update_nearby_icons()
return
+/obj/structure/window/plasmabasic/initialize()
+ ..()
+ air_update_turf(1)
+
/obj/structure/window/plasmabasic/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
if(exposed_temperature > T0C + 32000)
hit(round(exposed_volume / 1000), 0)
@@ -433,10 +447,13 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
/obj/structure/window/plasmareinforced/New(Loc,re=0)
..()
ini_dir = dir
- air_update_turf(1)
update_nearby_icons()
return
+/obj/structure/window/plasmareinforced/initialize()
+ ..()
+ air_update_turf(1)
+
/obj/structure/window/plasmareinforced/temperature_expose(datum/gas_mixture/air, exposed_temperature, exposed_volume)
return
@@ -505,7 +522,7 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
update_icon()
for(var/obj/structure/window/reinforced/polarized/W in range(src,range))
- if (W.id == src.id || !W.id)
+ if(W.id == src.id || !W.id)
spawn(0)
W.toggle()
return
@@ -516,4 +533,4 @@ var/global/wcCommon = pick(list("#379963", "#0d8395", "#58b5c3", "#49e46e", "#8f
toggle_tint()
/obj/machinery/button/windowtint/update_icon()
- icon_state = "light[active]"
\ No newline at end of file
+ icon_state = "light[active]"
diff --git a/code/game/response_team.dm b/code/game/response_team.dm
index d9b8cfcc375..5f8543ca934 100644
--- a/code/game/response_team.dm
+++ b/code/game/response_team.dm
@@ -9,6 +9,7 @@ var/list/response_team_members = list()
var/responseteam_age = 21 // Minimum account age to play as an ERT member
var/datum/response_team/active_team = null
var/send_emergency_team
+var/ert_request_answered = 0
/client/proc/response_team()
set name = "Dispatch CentComm Response Team"
@@ -47,6 +48,7 @@ var/send_emergency_team
if(!ert_type)
return
+ ert_request_answered = 1
message_admins("[key_name_admin(usr)] is dispatching an Emergency Response Team", 1)
log_admin("[key_name(usr)] used Dispatch Emergency Response Team..")
trigger_armed_response_team(ert_type)
@@ -59,100 +61,87 @@ var/send_emergency_team
else
return pick_ert_type()
if("Code Red")
- if(alert("Confirm: Deploy code 'RED' medium ERT?", "Emergency Response Team", "Confirm", "Cancel") == "Confirm")
+ if(alert("Confirm: Deploy code 'RED' medium ERT?", "Emergency Response Team", "Confirm", "Cancel") == "Confirm")
return new /datum/response_team/red
else
return pick_ert_type()
if("Code Gamma")
- if(alert("Confirm: Deploy code 'GAMMA' elite ERT?", "Emergency Response Team", "Confirm", "Cancel") == "Confirm")
+ if(alert("Confirm: Deploy code 'GAMMA' elite ERT?", "Emergency Response Team", "Confirm", "Cancel") == "Confirm")
return new /datum/response_team/gamma
else
return pick_ert_type()
return 0
-/mob/dead/observer/verb/JoinResponseTeam()
- set category = "Ghost"
- set name = "Join Emergency Response Team"
- set desc = "Join the Emergency Response Team. Only possible if it has been called by the crew."
-
- if(!istype(usr,/mob/dead/observer) && !istype(usr,/mob/new_player))
- to_chat(usr, "You need to be an observer or new player to use this.")
- return
+/mob/dead/observer/proc/JoinResponseTeam()
if(!send_emergency_team)
- to_chat(usr, "No emergency response team is currently being sent.")
- return
+ to_chat(src, "No emergency response team is currently being sent.")
+ return 0
- if(jobban_isbanned(usr, ROLE_ERT))
- to_chat(usr, "You are jobbanned from the emergency reponse team!")
- return
+ if(jobban_isbanned(src, ROLE_ERT))
+ to_chat(src, "You are jobbanned from the emergency reponse team!")
+ return 0
- var/player_age_check = check_client_age(usr.client, responseteam_age)
+ var/player_age_check = check_client_age(src.client, responseteam_age)
if(player_age_check && config.use_age_restriction_for_antags)
- to_chat(usr, "This role is not yet available to you. You need to wait another [player_age_check] days.")
- return
+ to_chat(src, "This role is not yet available to you. You need to wait another [player_age_check] days.")
+ return 0
if(src.has_enabled_antagHUD == 1 && config.antag_hud_restricted)
- to_chat(usr, "\blue Upon using the antagHUD you forfeited the ability to join the round.")
- return
+ to_chat(src, "\blue Upon using the antagHUD you forfeited the ability to join the round.")
+ return 0
if(response_team_members.len > 6)
- to_chat(usr, "The emergency response team is already full!")
- return
+ to_chat(src, "The emergency response team is already full!")
+ return 0
- for (var/obj/effect/landmark/L in landmarks_list)
- if (L.name == "Response Team")
+ for(var/obj/effect/landmark/L in landmarks_list)
+ if(L.name == "Response Team")
L.name = null
-
- if(alert(usr, "Would you like to join the Emergency Response Team?", "Emergency Response Team", "Yes", "No") == "No")
- L.name = "Response Team"
- return
-
if(!src.client)
return
- var/client/C = src.client
- var/mob/living/carbon/human/new_commando = C.create_response_team(L.loc)
- qdel(L)
- new_commando.mind.key = usr.key
- new_commando.key = usr.key
- new_commando.update_icons()
-
- return
+ spawn(-1)
+ var/client/C = src.client
+ var/mob/living/carbon/human/new_commando = C.create_response_team(L.loc)
+ qdel(L)
+ new_commando.mind.key = src.key
+ new_commando.key = src.key
+ new_commando.update_icons()
+ return 1
/proc/trigger_armed_response_team(var/datum/response_team/response_team_type)
active_team = response_team_type
- active_team.announce_team()
send_emergency_team = 1
- sleep(600 * 5)
- send_emergency_team = 0 // Can no longer join the ERT.
-
-/*
- var/area/security/nuke_storage/nukeloc = locate() //To find the nuke in the vault
- var/obj/machinery/nuclearbomb/nuke = locate() in nukeloc
- if(!nuke)
- nuke = locate() in world
- var/obj/item/weapon/paper/P = new
- P.info = "Your orders, Commander, are to use all means necessary to return the station to a survivable condition. To this end, you have been provided with the best tools we can give for Security, Medical, Engineering and Janitorial duties. The nuclear authorization code is: [ nuke ? nuke.r_code : "UNKNOWN"]. Be warned, if you detonate this without good reason, we will hold you to account for damages. Memorise this code, and then destroy this message."
- P.name = "ERT Orders and Emergency Nuclear Code"
- var/obj/item/weapon/stamp/centcom/stamp = new
- P.stamp(stamp)
- qdel(stamp)
- for (var/obj/effect/landmark/A in world)
- if (A.name == "nukecode")
- P.loc = A.loc
- qdel(A)
- continue
-*/
+ var/list/ert_candidates = pollCandidates("Join the Emergency Response Team?",, responseteam_age, 600)
+ if(!ert_candidates.len)
+ active_team.cannot_send_team()
+ send_emergency_team = 0
+ return
+ var/teamsize = 0
+ for(var/mob/dead/observer/M in ert_candidates)
+ teamsize += M.JoinResponseTeam()
+ send_emergency_team = 0
+ if (!teamsize)
+ active_team.cannot_send_team()
+ return
+ active_team.announce_team()
/client/proc/create_response_team(obj/spawn_location)
var/mob/living/carbon/human/M = new(null)
var/obj/item/organ/external/head/head_organ = M.get_organ("head")
response_team_members |= M
- var/new_gender = alert(usr, "Please select your gender.", "Character Generation", "Male", "Female")
- if (new_gender)
+ var/new_gender = alert(src, "Please select your gender.", "ERT Character Generation", "Male", "Female")
+
+ var/class = 0
+ while(!class)
+ class = input(src, "Which loadout would you like to choose?") in active_team.get_slot_list()
+ if(!active_team.check_slot_available(class)) // Because the prompt does not update automatically when a slot gets filled.
+ class = 0
+
+ if(new_gender)
if(new_gender == "Male")
M.change_gender(MALE)
else
@@ -201,12 +190,6 @@ var/send_emergency_team
ticker.minds += M.mind //Adds them to regular mind list.
M.loc = spawn_location
- var/class = 0
- while (!class)
- class = input("Which loadout would you like to choose?") in active_team.get_slot_list()
- if(!active_team.check_slot_available(class)) // Because the prompt does not update automatically when a slot gets filled.
- class = 0
-
active_team.equip_officer(class, M)
return M
@@ -348,16 +331,18 @@ var/send_emergency_team
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
M.equip_to_slot_or_del(pda, slot_wear_pda)
+/datum/response_team/proc/cannot_send_team()
+ command_announcement.Announce("[station_name()], we are unfortunately unable to send you an Emergency Response Team at this time.", "ERT Unavailable")
/datum/response_team/proc/announce_team()
- command_announcement.Announce("Attention, [station_name()]. We are attempting to assemble a team of highly trained assistants to aid(?) you. Standby.", "Central Command")
+ command_announcement.Announce("Attention, [station_name()]. We are sending a team of highly trained assistants to aid(?) you. Standby.", "ERT En-Route")
// -- AMBER TEAM --
/datum/response_team/amber
/datum/response_team/amber/announce_team()
- command_announcement.Announce("Attention, [station_name()]. We are attempting to assemble a code AMBER light Emergency Response Team. Standby.", "Central Command")
+ command_announcement.Announce("Attention, [station_name()]. We are sending a code AMBER light Emergency Response Team. Standby.", "ERT En-Route")
/datum/response_team/amber/equip_officer(var/officer_type, var/mob/living/carbon/human/M)
..()
@@ -429,7 +414,7 @@ var/send_emergency_team
/datum/response_team/red
/datum/response_team/red/announce_team()
- command_announcement.Announce("Attention, [station_name()]. We are attempting to assemble a code RED Emergency Response Team. Standby.", "Central Command")
+ command_announcement.Announce("Attention, [station_name()]. We are sending a code RED Emergency Response Team. Standby.", "ERT En-Route")
/datum/response_team/red/equip_officer(var/officer_type, var/mob/living/carbon/human/M)
..()
@@ -437,7 +422,7 @@ var/send_emergency_team
switch(officer_type)
if("Engineer")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/engineer(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/engi(M), slot_s_store)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/meson(M), slot_glasses)
@@ -457,7 +442,7 @@ var/send_emergency_team
if("Security")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/security(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun/advtaser(M), slot_s_store)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/security/sunglasses(M), slot_glasses)
@@ -475,7 +460,7 @@ var/send_emergency_team
if("Medic")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/latex/nitrile(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/medical(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/health/health_advanced(M), slot_glasses)
@@ -494,7 +479,7 @@ var/send_emergency_team
if("Commander")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/commander(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/security/sunglasses(M), slot_glasses)
@@ -505,6 +490,7 @@ var/send_emergency_team
M.equip_to_slot_or_del(new /obj/item/weapon/restraints/handcuffs(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/lockbox/loyalty(M), slot_in_backpack)
+
M.equip_to_slot_or_del(new /obj/item/weapon/pinpointer(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_r_store)
@@ -513,7 +499,7 @@ var/send_emergency_team
/datum/response_team/gamma
/datum/response_team/gamma/announce_team()
- command_announcement.Announce("Attention, [station_name()]. We are attempting to assemble a code GAMMA elite Emergency Response Team. Standby.", "Central Command")
+ command_announcement.Announce("Attention, [station_name()]. We are sending a code GAMMA elite Emergency Response Team. Standby.", "ERT En-Route")
/datum/response_team/gamma/equip_officer(var/officer_type, var/mob/living/carbon/human/M)
..()
@@ -521,7 +507,7 @@ var/send_emergency_team
switch(officer_type)
if("Engineer")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/advance(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/ert/engineer(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/double/full(M), slot_s_store)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/meson/night(M), slot_glasses)
diff --git a/code/game/skincmd.dm b/code/game/skincmd.dm
index fd9131538e4..7d27a1ce6df 100644
--- a/code/game/skincmd.dm
+++ b/code/game/skincmd.dm
@@ -8,6 +8,6 @@
set hidden = 1
var/ref = copytext(data, 1, findtext(data, ";"))
- if (src.skincmds[ref] != null)
+ if(src.skincmds[ref] != null)
var/obj/a = src.skincmds[ref]
a.SkinCmd(src, copytext(data, findtext(data, ";") + 1))
\ No newline at end of file
diff --git a/code/game/sound.dm b/code/game/sound.dm
index 1890a0966e7..7bf3af10e9c 100644
--- a/code/game/sound.dm
+++ b/code/game/sound.dm
@@ -25,7 +25,7 @@ var/list/ricochet = list('sound/weapons/effects/ric1.ogg', 'sound/weapons/effect
var/turf/turf_source = get_turf(source)
// Looping through the player list has the added bonus of working for mobs inside containers
- for (var/P in player_list)
+ for(var/P in player_list)
var/mob/M = P
if(!M || !M.client)
continue
@@ -48,7 +48,7 @@ var/const/FALLOFF_SOUNDS = 0.5
S.channel = 0 //Any channel
S.volume = vol
S.environment = -1
- if (vary)
+ if(vary)
if(frequency)
S.frequency = frequency
else
@@ -69,20 +69,20 @@ var/const/FALLOFF_SOUNDS = 0.5
var/datum/gas_mixture/hearer_env = T.return_air()
var/datum/gas_mixture/source_env = turf_source.return_air()
- if (hearer_env && source_env)
+ if(hearer_env && source_env)
var/pressure = min(hearer_env.return_pressure(), source_env.return_pressure())
- if (pressure < ONE_ATMOSPHERE)
+ if(pressure < ONE_ATMOSPHERE)
pressure_factor = max((pressure - SOUND_MINIMUM_PRESSURE)/(ONE_ATMOSPHERE - SOUND_MINIMUM_PRESSURE), 0)
else //in space
pressure_factor = 0
- if (distance <= 1)
+ if(distance <= 1)
pressure_factor = max(pressure_factor, 0.15) //hearing through contact
S.volume *= pressure_factor
- if (S.volume <= 0)
+ if(S.volume <= 0)
return //no volume means no sound
var/dx = turf_source.x - T.x // Hearing from the right/left
@@ -108,29 +108,29 @@ var/const/FALLOFF_SOUNDS = 0.5
/proc/get_sfx(soundin)
if(istext(soundin))
switch(soundin)
- if ("shatter")
+ if("shatter")
soundin = pick(shatter_sound)
- if ("explosion")
+ if("explosion")
soundin = pick(explosion_sound)
- if ("sparks")
+ if("sparks")
soundin = pick(spark_sound)
- if ("rustle")
+ if("rustle")
soundin = pick(rustle_sound)
- if ("bodyfall")
+ if("bodyfall")
soundin = pick(bodyfall_sound)
- if ("punch")
+ if("punch")
soundin = pick(punch_sound)
- if ("clownstep")
+ if("clownstep")
soundin = pick(clown_sound)
- if ("jackboot")
+ if("jackboot")
soundin = pick(jackboot_sound)
- if ("swing_hit")
+ if("swing_hit")
soundin = pick(swing_hit_sound)
- if ("hiss")
+ if("hiss")
soundin = pick(hiss_sound)
- if ("pageturn")
+ if("pageturn")
soundin = pick(page_sound)
- if ("gunshot")
+ if("gunshot")
soundin = pick(gun_sound)
if("computer_ambience")
soundin = pick(computer_ambience)
diff --git a/code/game/turfs/simulated.dm b/code/game/turfs/simulated.dm
index eaa7f8298b5..3bce2fcfe3d 100644
--- a/code/game/turfs/simulated.dm
+++ b/code/game/turfs/simulated.dm
@@ -89,7 +89,7 @@
bloodcolor = M.feet_blood_color
M.track_blood--
- if (bloodDNA)
+ if(bloodDNA)
src.AddTracks(/obj/effect/decal/cleanable/blood/tracks/footprints,bloodDNA,M.dir,0,bloodcolor) // Coming
var/turf/simulated/from = get_step(M,reverse_direction(M.dir))
if(istype(from) && from)
@@ -97,9 +97,9 @@
bloodDNA = null
- switch (src.wet)
+ switch(src.wet)
if(TURF_WET_WATER)
- if (!(M.slip("wet floor", 4, 2, 0, 1)))
+ if(!(M.slip("wet floor", 4, 2, 0, 1)))
M.inertia_dir = 0
return
@@ -108,13 +108,13 @@
if(TURF_WET_ICE) // Ice
- if (!(prob(30) && M.slip("icy floor", 4, 2, 1, 1)))
+ if(!(prob(30) && M.slip("icy floor", 4, 2, 1, 1)))
M.inertia_dir = 0
//returns 1 if made bloody, returns 0 otherwise
/turf/simulated/add_blood(mob/living/carbon/human/M)
- if (!..())
+ if(!..())
return 0
var/obj/effect/decal/cleanable/blood/B = locate() in contents //check for existing blood splatter
diff --git a/code/game/turfs/simulated/floor.dm b/code/game/turfs/simulated/floor.dm
index f150be57ba6..3c73c0789e7 100644
--- a/code/game/turfs/simulated/floor.dm
+++ b/code/game/turfs/simulated/floor.dm
@@ -48,8 +48,8 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
//turf/simulated/floor/CanPass(atom/movable/mover, turf/target, height=0, air_group=0)
-// if ((istype(mover, /obj/machinery/vehicle) && !(src.burnt)))
-// if (!( locate(/obj/machinery/mass_driver, src) ))
+// if((istype(mover, /obj/machinery/vehicle) && !(src.burnt)))
+// if(!( locate(/obj/machinery/mass_driver, src) ))
// return 0
// return ..()
@@ -75,7 +75,7 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
src.hotspot_expose(1000,CELL_VOLUME)
if(prob(33)) new /obj/item/stack/sheet/metal(src)
if(3.0)
- if (prob(50))
+ if(prob(50))
src.break_tile()
src.hotspot_expose(1000,CELL_VOLUME)
return
@@ -129,16 +129,17 @@ var/list/icons_to_ignore_at_floor_init = list("damaged1","damaged2","damaged3","
/turf/simulated/floor/proc/make_plating()
return ChangeTurf(/turf/simulated/floor/plating)
-/turf/simulated/floor/ChangeTurf(turf/simulated/floor/T)
+/turf/simulated/floor/ChangeTurf(turf/simulated/floor/T, defer_change = FALSE, keep_icon = TRUE)
if(!istype(src,/turf/simulated/floor)) return ..() //fucking turfs switch the fucking src of the fucking running procs
if(!ispath(T,/turf/simulated/floor)) return ..()
var/old_icon = icon_regular_floor
var/old_plating = icon_plating
var/old_dir = dir
var/turf/simulated/floor/W = ..()
- W.icon_regular_floor = old_icon
- W.icon_plating = old_plating
- W.dir = old_dir
+ if(keep_icon)
+ W.icon_regular_floor = old_icon
+ W.icon_plating = old_plating
+ W.dir = old_dir
W.update_icon()
return W
diff --git a/code/game/turfs/simulated/floor/plating.dm b/code/game/turfs/simulated/floor/plating.dm
index 764ca6055d4..dcc05e5acfe 100644
--- a/code/game/turfs/simulated/floor/plating.dm
+++ b/code/game/turfs/simulated/floor/plating.dm
@@ -30,13 +30,13 @@
to_chat(user, "Repair the plating first!")
return 1
var/obj/item/stack/rods/R = C
- if (R.get_amount() < 2)
+ if(R.get_amount() < 2)
to_chat(user, "You need two rods to make a reinforced floor!")
return 1
else
to_chat(user, "You begin reinforcing the floor...")
if(do_after(user, 30, target = src))
- if (R.get_amount() >= 2 && !istype(src, /turf/simulated/floor/engine))
+ if(R.get_amount() >= 2 && !istype(src, /turf/simulated/floor/engine))
ChangeTurf(/turf/simulated/floor/engine)
playsound(src, 'sound/items/Deconstruct.ogg', 80, 1)
R.use(2)
diff --git a/code/game/turfs/simulated/shuttle.dm b/code/game/turfs/simulated/shuttle.dm
index a169d588dd2..ac520ca8c0f 100644
--- a/code/game/turfs/simulated/shuttle.dm
+++ b/code/game/turfs/simulated/shuttle.dm
@@ -62,4 +62,4 @@
/turf/simulated/shuttle/floor4/vox //Vox skipjack floors
name = "skipjack floor"
oxygen = 0
- nitrogen = MOLES_N2STANDARD + MOLES_O2STANDARD
\ No newline at end of file
+ nitrogen = MOLES_N2STANDARD + MOLES_O2STANDARD
diff --git a/code/game/turfs/simulated/walls.dm b/code/game/turfs/simulated/walls.dm
index 7f4ac1704d9..4d7c8ccd5da 100644
--- a/code/game/turfs/simulated/walls.dm
+++ b/code/game/turfs/simulated/walls.dm
@@ -140,7 +140,7 @@
if(!devastated)
playsound(src, 'sound/items/Welder.ogg', 100, 1)
new /obj/structure/girder(src)
- if (mineral == "metal")
+ if(mineral == "metal")
new /obj/item/stack/sheet/metal( src )
new /obj/item/stack/sheet/metal( src )
else
@@ -148,7 +148,7 @@
new M( src )
new M( src )
else
- if (mineral == "metal")
+ if(mineral == "metal")
new /obj/item/stack/sheet/metal( src )
new /obj/item/stack/sheet/metal( src )
new /obj/item/stack/sheet/metal( src )
@@ -258,8 +258,8 @@
/turf/simulated/wall/attack_hand(mob/user as mob)
user.changeNext_move(CLICK_CD_MELEE)
- if (HULK in user.mutations)
- if (prob(hardness) || rotting)
+ if(HULK in user.mutations)
+ if(prob(hardness) || rotting)
playsound(src, 'sound/effects/meteorimpact.ogg', 100, 1)
to_chat(user, text("You smash through the wall."))
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!" ))
@@ -287,7 +287,7 @@
/turf/simulated/wall/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
user.changeNext_move(CLICK_CD_MELEE)
- if (!user.IsAdvancedToolUser())
+ if(!user.IsAdvancedToolUser())
to_chat(user, "You don't have the dexterity to do this!")
return
@@ -376,7 +376,7 @@
visible_message("[user] slices apart \the [src]!","You hear metal being sliced apart.")
//DRILLING
- else if (istype(W, /obj/item/weapon/pickaxe/drill/diamonddrill))
+ else if(istype(W, /obj/item/weapon/pickaxe/drill/diamonddrill))
to_chat(user, "You begin to drill though the wall.")
@@ -385,7 +385,7 @@
dismantle_wall()
visible_message("[user] drills through \the [src]!","You hear the grinding of metal.")
- else if (istype(W, /obj/item/weapon/pickaxe/drill/jackhammer))
+ else if(istype(W, /obj/item/weapon/pickaxe/drill/jackhammer))
to_chat(user, "You begin to disintegrates the wall.")
diff --git a/code/game/turfs/simulated/walls_mineral.dm b/code/game/turfs/simulated/walls_mineral.dm
index 8a36ea5af6b..d4f0767d755 100644
--- a/code/game/turfs/simulated/walls_mineral.dm
+++ b/code/game/turfs/simulated/walls_mineral.dm
@@ -134,7 +134,7 @@
/*
/turf/simulated/wall/mineral/proc/shock()
- if (electrocute_mob(user, C, src))
+ if(electrocute_mob(user, C, src))
var/datum/effect/system/spark_spread/s = new /datum/effect/system/spark_spread
s.set_up(5, 1, src)
s.start()
diff --git a/code/game/turfs/simulated/walls_reinforced.dm b/code/game/turfs/simulated/walls_reinforced.dm
index 1d792647042..27154fd00fb 100644
--- a/code/game/turfs/simulated/walls_reinforced.dm
+++ b/code/game/turfs/simulated/walls_reinforced.dm
@@ -15,7 +15,7 @@
/turf/simulated/wall/r_wall/attackby(obj/item/W as obj, mob/user as mob, params)
user.changeNext_move(CLICK_CD_MELEE)
- if (!user.IsAdvancedToolUser())
+ if(!user.IsAdvancedToolUser())
to_chat(user, "You don't have the dexterity to do this!")
return
@@ -90,7 +90,7 @@
return
if(1)
- if (istype(W, /obj/item/weapon/screwdriver))
+ if(istype(W, /obj/item/weapon/screwdriver))
to_chat(user, "You begin removing the support lines.")
playsound(src, 'sound/items/Screwdriver.ogg', 100, 1)
diff --git a/code/game/turfs/space/space.dm b/code/game/turfs/space/space.dm
index 47e9c8f2140..3abf518c7f8 100644
--- a/code/game/turfs/space/space.dm
+++ b/code/game/turfs/space/space.dm
@@ -123,9 +123,9 @@
A.z = target_z
A.x = world.maxx - 2
spawn (0)
- if ((A && A.loc))
+ if((A && A.loc))
A.loc.Entered(A)
- else if (src.x >= world.maxx)
+ else if(src.x >= world.maxx)
if(istype(A, /obj/effect/meteor))
qdel(A)
return
@@ -148,9 +148,9 @@
A.z = target_z
A.x = 3
spawn (0)
- if ((A && A.loc))
+ if((A && A.loc))
A.loc.Entered(A)
- else if (src.y <= 1)
+ else if(src.y <= 1)
if(istype(A, /obj/effect/meteor))
qdel(A)
return
@@ -172,10 +172,10 @@
A.z = target_z
A.y = world.maxy - 2
spawn (0)
- if ((A && A.loc))
+ if((A && A.loc))
A.loc.Entered(A)
- else if (src.y >= world.maxy)
+ else if(src.y >= world.maxy)
if(istype(A, /obj/effect/meteor)||istype(A, /obj/effect/space_dust))
qdel(A)
return
@@ -197,7 +197,7 @@
A.z = target_z
A.y = 3
spawn (0)
- if ((A && A.loc))
+ if((A && A.loc))
A.loc.Entered(A)
return
diff --git a/code/game/turfs/turf.dm b/code/game/turfs/turf.dm
index 8541a638040..d76791e7f97 100644
--- a/code/game/turfs/turf.dm
+++ b/code/game/turfs/turf.dm
@@ -86,7 +86,7 @@
return 0
/turf/Enter(atom/movable/mover as mob|obj, atom/forget as mob|obj|turf|area)
- if (!mover)
+ if(!mover)
return 1
@@ -109,7 +109,7 @@
large_dense += border_obstacle
//Then, check the turf itself
- if (!src.CanPass(mover, src))
+ if(!src.CanPass(mover, src))
mover.Bump(src, 1)
return 0
@@ -156,9 +156,11 @@
qdel(L)
//Creates a new turf
-/turf/proc/ChangeTurf(var/path)
- if(!path) return
- if(path == type) return src
+/turf/proc/ChangeTurf(path, defer_change = FALSE, keep_icon = TRUE)
+ if(!path)
+ return
+ if(!use_preloader && path == type) // Don't no-op if the map loader requires it to be reconstructed
+ return src
var/old_opacity = opacity
var/old_dynamic_lighting = dynamic_lighting
var/list/old_affecting_lights = affecting_lights
@@ -167,12 +169,10 @@
if(air_master)
air_master.remove_from_active(src)
-
var/turf/W = new path(src)
+ if(!defer_change)
+ W.AfterChange()
- if(istype(W, /turf/simulated))
- W:Assimilate_Air()
- W.RemoveLattice()
W.blueprint_data = old_blueprint_data
for(var/turf/space/S in range(W,1))
@@ -189,13 +189,22 @@
else
lighting_clear_overlays()
- W.levelupdate()
- W.CalculateAdjacentTurfs()
+ return W
- if(!can_have_cabling())
+// I'm including `ignore_air` because BYOND lacks positional-only arguments
+/turf/proc/AfterChange(ignore_air, keep_cabling = FALSE) //called after a turf has been replaced in ChangeTurf()
+ levelupdate()
+ CalculateAdjacentTurfs()
+
+ if(!keep_cabling && !can_have_cabling())
for(var/obj/structure/cable/C in contents)
qdel(C)
- return W
+
+/turf/simulated/AfterChange(ignore_air, keep_cabling = FALSE)
+ ..()
+ RemoveLattice()
+ if(!ignore_air)
+ Assimilate_Air()
//////Assimilate Air//////
/turf/simulated/proc/Assimilate_Air()
@@ -404,4 +413,4 @@
/turf/proc/add_blueprints_preround(atom/movable/AM)
if(!ticker || ticker.current_state != GAME_STATE_PLAYING)
- add_blueprints(AM)
\ No newline at end of file
+ add_blueprints(AM)
diff --git a/code/game/verbs/ooc.dm b/code/game/verbs/ooc.dm
index 302f6a1f742..e5f02a0a45a 100644
--- a/code/game/verbs/ooc.dm
+++ b/code/game/verbs/ooc.dm
@@ -75,7 +75,7 @@ var/global/admin_ooc_colour = "#b82e00"
/proc/toggle_ooc()
config.ooc_allowed = ( !config.ooc_allowed )
- if (config.ooc_allowed)
+ if(config.ooc_allowed)
to_chat(world, "The OOC channel has been globally enabled!")
else
to_chat(world, "The OOC channel has been globally disabled!")
diff --git a/code/game/verbs/suicide.dm b/code/game/verbs/suicide.dm
index 857fcadb48a..afc8db25b65 100644
--- a/code/game/verbs/suicide.dm
+++ b/code/game/verbs/suicide.dm
@@ -52,11 +52,11 @@
/mob/living/carbon/human/verb/suicide()
set hidden = 1
- if (stat == DEAD)
+ if(stat == DEAD)
to_chat(src, "You're already dead!")
return
- if (!ticker)
+ if(!ticker)
to_chat(src, "You can't commit suicide before the game starts!")
return
@@ -65,7 +65,7 @@
to_chat(src, "You try to bring yourself to commit suicide, but - something prevents you!")
return
- if (suiciding)
+ if(suiciding)
to_chat(src, "You're already committing suicide! Be patient!")
return
@@ -88,15 +88,15 @@
/mob/living/carbon/brain/verb/suicide()
set hidden = 1
- if (stat == 2)
+ if(stat == 2)
to_chat(src, "You're already dead!")
return
- if (!ticker)
+ if(!ticker)
to_chat(src, "You can't commit suicide before the game starts!")
return
- if (suiciding)
+ if(suiciding)
to_chat(src, "You're already committing suicide! Be patient!")
return
@@ -113,11 +113,11 @@
/mob/living/silicon/ai/verb/suicide()
set hidden = 1
- if (stat == 2)
+ if(stat == 2)
to_chat(src, "You're already dead!")
return
- if (suiciding)
+ if(suiciding)
to_chat(src, "You're already committing suicide! Be patient!")
return
@@ -133,11 +133,11 @@
/mob/living/silicon/robot/verb/suicide()
set hidden = 1
- if (stat == 2)
+ if(stat == 2)
to_chat(src, "You're already dead!")
return
- if (suiciding)
+ if(suiciding)
to_chat(src, "You're already committing suicide! Be patient!")
return
@@ -161,7 +161,7 @@
var/obj/item/device/paicard/card = loc
card.removePersonality()
var/turf/T = get_turf_or_move(card.loc)
- for (var/mob/M in viewers(T))
+ for(var/mob/M in viewers(T))
M.show_message("\blue [src] flashes a message across its screen, \"Wiping core files. Please acquire a new personality to continue using pAI device functions.\"", 3, "\blue [src] bleeps electronically.", 2)
death(0, 1)
else
@@ -170,11 +170,11 @@
/mob/living/carbon/alien/humanoid/verb/suicide()
set hidden = 1
- if (stat == 2)
+ if(stat == 2)
to_chat(src, "You're already dead!")
return
- if (suiciding)
+ if(suiciding)
to_chat(src, "You're already committing suicide! Be patient!")
return
@@ -190,11 +190,11 @@
/mob/living/carbon/slime/verb/suicide()
set hidden = 1
- if (stat == 2)
+ if(stat == 2)
to_chat(src, "You're already dead!")
return
- if (suiciding)
+ if(suiciding)
to_chat(src, "You're already committing suicide! Be patient!")
return
diff --git a/code/game/verbs/who.dm b/code/game/verbs/who.dm
index 3be9262d1ad..4e822710cd0 100644
--- a/code/game/verbs/who.dm
+++ b/code/game/verbs/who.dm
@@ -27,7 +27,7 @@
entry += " - Observing"
else
entry += " - DEAD"
- else if (istype(C.mob, /mob/new_player))
+ else if(istype(C.mob, /mob/new_player))
entry += " - New Player"
else
entry += " - DEAD"
@@ -122,7 +122,7 @@
if(!C.holder.fakekey)
msg += "\t[C] is a [C.holder.rank]\n"
num_admins_online++
- else if (check_rights(R_MOD|R_MENTOR, 0, C.mob) && !check_rights(R_ADMIN, 0, C.mob))
+ else if(check_rights(R_MOD|R_MENTOR, 0, C.mob) && !check_rights(R_ADMIN, 0, C.mob))
modmsg += "\t[C] is a [C.holder.rank]\n"
num_mods_online++
diff --git a/code/modules/admin/DB ban/functions.dm b/code/modules/admin/DB ban/functions.dm
index 1c5365a6b96..3027864ace6 100644
--- a/code/modules/admin/DB ban/functions.dm
+++ b/code/modules/admin/DB ban/functions.dm
@@ -17,6 +17,7 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
var/kickbannedckey //Defines whether this proc should kick the banned person, if they are connected (if banned_mob is defined).
//some ban types kick players after this proc passes (tempban, permaban), but some are specific to db_ban, so
//they should kick within this proc.
+ var/isjobban // For job bans, which need to be inserted into the job ban lists
switch(bantype)
if(BANTYPE_PERMA)
bantype_str = "PERMABAN"
@@ -31,9 +32,11 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
bantype_str = "JOB_PERMABAN"
duration = -1
bantype_pass = 1
+ isjobban = 1
if(BANTYPE_JOB_TEMP)
bantype_str = "JOB_TEMPBAN"
bantype_pass = 1
+ isjobban = 1
if(BANTYPE_APPEARANCE)
bantype_str = "APPEARANCE_BAN"
duration = -1
@@ -134,11 +137,15 @@ datum/admins/proc/DB_ban_record(var/bantype, var/mob/banned_mob, var/duration =
if(banned_mob && banned_mob.client && banned_mob.client.ckey == banckey)
del(banned_mob.client)
+ if(isjobban)
+ jobban_client_fullban(ckey, job)
+
datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
if(!check_rights(R_BAN)) return
var/bantype_str
+ var/isjobban // For job bans, which need to be removed from the job ban lists
if(bantype)
var/bantype_pass = 0
switch(bantype)
@@ -151,9 +158,11 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
if(BANTYPE_JOB_PERMA)
bantype_str = "JOB_PERMABAN"
bantype_pass = 1
+ isjobban = 1
if(BANTYPE_JOB_TEMP)
bantype_str = "JOB_TEMPBAN"
bantype_pass = 1
+ isjobban = 1
if(BANTYPE_APPEARANCE)
bantype_str = "APPEARANCE_BAN"
bantype_pass = 1
@@ -206,6 +215,8 @@ datum/admins/proc/DB_ban_unban(var/ckey, var/bantype, var/job = "")
return
DB_ban_unban_by_id(ban_id)
+ if(isjobban)
+ jobban_unban_client(ckey, job)
datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
@@ -215,18 +226,20 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
to_chat(usr, "Cancelled")
return
- var/DBQuery/query = dbcon.NewQuery("SELECT ckey, duration, reason FROM [format_table_name("ban")] WHERE id = [banid]")
+ var/DBQuery/query = dbcon.NewQuery("SELECT ckey, duration, reason, job FROM [format_table_name("ban")] WHERE id = [banid]")
query.Execute()
var/eckey = usr.ckey //Editing admin ckey
var/pckey //(banned) Player ckey
var/duration //Old duration
var/reason //Old reason
+ var/job //Old job
if(query.NextRow())
pckey = query.item[1]
duration = query.item[2]
reason = query.item[3]
+ job = query.item[4]
else
to_chat(usr, "Invalid ban id. Contact the database admin")
return
@@ -259,6 +272,8 @@ datum/admins/proc/DB_ban_edit(var/banid = null, var/param = null)
if("unban")
if(alert("Unban [pckey]?", "Unban?", "Yes", "No") == "Yes")
DB_ban_unban_by_id(banid)
+ if(job && length(job))
+ jobban_unban_client(pckey, job)
return
else
to_chat(usr, "Cancelled")
@@ -396,7 +411,6 @@ datum/admins/proc/DB_ban_unban_by_id(var/id)
output += "
"
output += " Match(min. 3 characters to search by key or ip, and 7 to search by cid) "
output += ""
- output += "Please note that all jobban bans or unbans are in-effect the following round. "
output += "This search shows only last 100 bans."
if(adminckey || playerckey || playerip || playercid || dbbantype)
diff --git a/code/modules/admin/IsBanned.dm b/code/modules/admin/IsBanned.dm
index c8ae67d4cab..3d7b11390eb 100644
--- a/code/modules/admin/IsBanned.dm
+++ b/code/modules/admin/IsBanned.dm
@@ -1,10 +1,10 @@
//Blocks an attempt to connect before even creating our client datum thing.
world/IsBanned(key,address,computer_id)
- if (!key || !address || !computer_id)
+ if(!key || !address || !computer_id)
log_access("Failed Login (invalid data): [key] [address]-[computer_id]")
return list("reason"="invalid login data", "desc"="Error: Could not check ban status, please try again. Error message: Your computer provided invalid or blank information to the server on connection (BYOND Username, IP, and Computer ID). Provided information for reference: Username: '[key]' IP: '[address]' Computer ID: '[computer_id]'. If you continue to get this error, please restart byond or contact byond support.")
- if (text2num(computer_id) == 2147483647) //this cid causes stickybans to go haywire
+ if(text2num(computer_id) == 2147483647) //this cid causes stickybans to go haywire
log_access("Failed Login (invalid cid): [key] [address]-[computer_id]")
return list("reason"="invalid login data", "desc"="Error: Could not check ban status, Please try again. Error message: Your computer provided an invalid Computer ID.")
var/admin = 0
@@ -34,7 +34,7 @@ world/IsBanned(key,address,computer_id)
//Ban Checking
. = CheckBan(ckey(key), computer_id, address)
if(.)
- if (admin)
+ if(admin)
log_admin("The admin [key] has been allowed to bypass a matching ban on [.["key"]]")
message_admins("The admin [key] has been allowed to bypass a matching ban on [.["key"]]")
addclientmessage(ckey,"You have been allowed to bypass a matching ban on [.["key"]].")
@@ -71,13 +71,13 @@ world/IsBanned(key,address,computer_id)
var/duration = query.item[7]
var/bantime = query.item[8]
var/bantype = query.item[9]
- if (bantype == "ADMIN_PERMABAN" || bantype == "ADMIN_TEMPBAN")
+ if(bantype == "ADMIN_PERMABAN" || bantype == "ADMIN_TEMPBAN")
//admin bans MUST match on ckey to prevent cid-spoofing attacks
// as well as dynamic ip abuse
- if (pckey != ckey)
+ if(pckey != ckey)
continue
- if (admin)
- if (bantype == "ADMIN_PERMABAN" || bantype == "ADMIN_TEMPBAN")
+ if(admin)
+ if(bantype == "ADMIN_PERMABAN" || bantype == "ADMIN_TEMPBAN")
log_admin("The admin [key] is admin banned, and has been disallowed access")
message_admins("The admin [key] is admin banned, and has been disallowed access")
else
@@ -102,11 +102,11 @@ world/IsBanned(key,address,computer_id)
return .
. = ..() //default pager ban stuff
- if (.)
+ if(.)
//byond will not trigger isbanned() for "global" host bans,
//ie, ones where the "apply to this game only" checkbox is not checked (defaults to not checked)
//So it's safe to let admins walk thru host/sticky bans here
- if (admin)
+ if(admin)
log_admin("The admin [key] has been allowed to bypass a matching host/sticky ban")
message_admins("The admin [key] has been allowed to bypass a matching host/sticky ban")
addclientmessage(ckey,"You have been allowed to bypass a matching host/sticky ban.")
diff --git a/code/modules/admin/NewBan.dm b/code/modules/admin/NewBan.dm
index aba317a1996..172e826a0bb 100644
--- a/code/modules/admin/NewBan.dm
+++ b/code/modules/admin/NewBan.dm
@@ -15,8 +15,8 @@ var/savefile/Banlist
Banlist.cd = "/base"
if( "[ckey][id]" in Banlist.dir )
Banlist.cd = "[ckey][id]"
- if (Banlist["temp"])
- if (!GetExp(Banlist["minutes"]))
+ if(Banlist["temp"])
+ if(!GetExp(Banlist["minutes"]))
ClearTempbans()
return 0
else
@@ -27,7 +27,7 @@ var/savefile/Banlist
.["reason"] = "ckey/id"
return .
else
- for (var/A in Banlist.dir)
+ for(var/A in Banlist.dir)
Banlist.cd = "/base/[A]"
var/matches
if( ckey == Banlist["key"] )
@@ -43,7 +43,7 @@ var/savefile/Banlist
if(matches)
if(Banlist["temp"])
- if (!GetExp(Banlist["minutes"]))
+ if(!GetExp(Banlist["minutes"]))
ClearTempbans()
return 0
else
@@ -66,13 +66,13 @@ var/savefile/Banlist
Banlist = new("data/banlist.bdb")
log_admin("Loading Banlist")
- if (!length(Banlist.dir)) log_admin("Banlist is empty.")
+ if(!length(Banlist.dir)) log_admin("Banlist is empty.")
- if (!Banlist.dir.Find("base"))
+ if(!Banlist.dir.Find("base"))
log_admin("Banlist missing base dir.")
Banlist.dir.Add("base")
Banlist.cd = "/base"
- else if (Banlist.dir.Find("base"))
+ else if(Banlist.dir.Find("base"))
Banlist.cd = "/base"
ClearTempbans()
@@ -82,16 +82,16 @@ var/savefile/Banlist
UpdateTime()
Banlist.cd = "/base"
- for (var/A in Banlist.dir)
+ for(var/A in Banlist.dir)
Banlist.cd = "/base/[A]"
- if (!Banlist["key"] || !Banlist["id"])
+ if(!Banlist["key"] || !Banlist["id"])
RemoveBan(A)
log_admin("Invalid Ban.")
message_admins("Invalid Ban.")
continue
- if (!Banlist["temp"]) continue
- if (CMinutes >= Banlist["minutes"]) RemoveBan(A)
+ if(!Banlist["temp"]) continue
+ if(CMinutes >= Banlist["minutes"]) RemoveBan(A)
return 1
@@ -100,12 +100,12 @@ var/savefile/Banlist
var/bantimestamp
- if (temp)
+ if(temp)
UpdateTime()
bantimestamp = CMinutes + minutes
Banlist.cd = "/base"
- if ( Banlist.dir.Find("[ckey][computerid]") )
+ if( Banlist.dir.Find("[ckey][computerid]") )
to_chat(usr, "Ban already exists.")
return 0
else
@@ -117,7 +117,7 @@ var/savefile/Banlist
Banlist["reason"] << reason
Banlist["bannedby"] << bannedby
Banlist["temp"] << temp
- if (temp)
+ if(temp)
Banlist["minutes"] << bantimestamp
if(!temp)
add_note(ckey, "Permanently banned - [reason]", null, bannedby, 0)
@@ -134,7 +134,7 @@ var/savefile/Banlist
Banlist["id"] >> id
Banlist.cd = "/base"
- if (!Banlist.dir.Remove(foldername)) return 0
+ if(!Banlist.dir.Remove(foldername)) return 0
if(!usr)
log_admin("Ban Expired: [key]")
@@ -145,9 +145,9 @@ var/savefile/Banlist
message_admins("[key_name_admin(usr)] unbanned: [key]")
feedback_inc("ban_unban",1)
usr.client.holder.DB_ban_unban( ckey(key), BANTYPE_ANY_FULLBAN)
- for (var/A in Banlist.dir)
+ for(var/A in Banlist.dir)
Banlist.cd = "/base/[A]"
- if (key == Banlist["key"] /*|| id == Banlist["id"]*/)
+ if(key == Banlist["key"] /*|| id == Banlist["id"]*/)
Banlist.cd = "/base"
Banlist.dir.Remove(A)
continue
@@ -157,13 +157,13 @@ var/savefile/Banlist
/proc/GetExp(minutes as num)
UpdateTime()
var/exp = minutes - CMinutes
- if (exp <= 0)
+ if(exp <= 0)
return 0
else
var/timeleftstring
- if (exp >= 1440) //1440 = 1 day in minutes
+ if(exp >= 1440) //1440 = 1 day in minutes
timeleftstring = "[round(exp / 1440, 0.1)] Days"
- else if (exp >= 60) //60 = 1 hour in minutes
+ else if(exp >= 60) //60 = 1 hour in minutes
timeleftstring = "[round(exp / 60, 0.1)] Hours"
else
timeleftstring = "[exp] Minutes"
@@ -174,7 +174,7 @@ var/savefile/Banlist
var/dat
//var/dat = "Unban Player: \blue(U) = Unban , (E) = Edit Ban\green (Total
"
body += "Transformation:"
@@ -191,7 +192,7 @@ var/global/nologevent = 0
Shade
"}
- if (M.client)
+ if(M.client)
body += {"
Other actions:
@@ -243,7 +244,7 @@ var/global/nologevent = 0
if(!check_rights(R_EVENT))
return
- if (!istype(src,/datum/admins))
+ if(!istype(src,/datum/admins))
src = usr.client.holder
var/dat
@@ -576,7 +577,7 @@ var/global/nologevent = 0
return
config.looc_allowed = !(config.looc_allowed)
- if (config.looc_allowed)
+ if(config.looc_allowed)
to_chat(world, "The LOOC channel has been globally enabled!")
else
to_chat(world, "The LOOC channel has been globally disabled!")
@@ -592,7 +593,7 @@ var/global/nologevent = 0
return
config.dsay_allowed = !(config.dsay_allowed)
- if (config.dsay_allowed)
+ if(config.dsay_allowed)
to_chat(world, "Deadchat has been globally enabled!")
else
to_chat(world, "Deadchat has been globally disabled!")
@@ -643,7 +644,7 @@ var/global/nologevent = 0
return
enter_allowed = !( enter_allowed )
- if (!( enter_allowed ))
+ if(!( enter_allowed ))
to_chat(world, "New players may no longer enter the game.")
else
to_chat(world, "New players may now enter the game.")
@@ -661,7 +662,7 @@ var/global/nologevent = 0
return
config.allow_ai = !( config.allow_ai )
- if (!( config.allow_ai ))
+ if(!( config.allow_ai ))
to_chat(world, "The AI job is no longer chooseable.")
else
to_chat(world, "The AI job is chooseable now.")
@@ -679,7 +680,7 @@ var/global/nologevent = 0
return
abandon_allowed = !( abandon_allowed )
- if (abandon_allowed)
+ if(abandon_allowed)
to_chat(world, "You may now respawn.")
else
to_chat(world, "You may no longer respawn :(")
@@ -709,13 +710,13 @@ var/global/nologevent = 0
if(!check_rights(R_SERVER))
return
- if (!ticker || ticker.current_state != GAME_STATE_PREGAME)
+ if(!ticker || ticker.current_state != GAME_STATE_PREGAME)
ticker.delay_end = !ticker.delay_end
log_admin("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].")
message_admins("[key_name(usr)] [ticker.delay_end ? "delayed the round end" : "has made the round end normally"].", 1)
return //alert("Round end delayed", null, null, null, null, null)
going = !( going )
- if (!( going ))
+ if(!( going ))
to_chat(world, "The game start has been delayed.")
log_admin("[key_name(usr)] delayed the game.")
else
@@ -728,34 +729,34 @@ var/global/nologevent = 0
/proc/is_special_character(mob/M as mob) // returns 1 for specail characters and 2 for heroes of gamemode
if(!ticker || !ticker.mode)
return 0
- if (!istype(M))
+ if(!istype(M))
return 0
if((M.mind in ticker.mode.head_revolutionaries) || (M.mind in ticker.mode.revolutionaries))
- if (ticker.mode.config_tag == "revolution")
+ if(ticker.mode.config_tag == "revolution")
return 2
return 1
if(M.mind in ticker.mode.cult)
- if (ticker.mode.config_tag == "cult")
+ if(ticker.mode.config_tag == "cult")
return 2
return 1
if(M.mind in ticker.mode.malf_ai)
- if (ticker.mode.config_tag == "malfunction")
+ if(ticker.mode.config_tag == "malfunction")
return 2
return 1
if(M.mind in ticker.mode.syndicates)
- if (ticker.mode.config_tag == "nuclear")
+ if(ticker.mode.config_tag == "nuclear")
return 2
return 1
if(M.mind in ticker.mode.wizards)
- if (ticker.mode.config_tag == "wizard")
+ if(ticker.mode.config_tag == "wizard")
return 2
return 1
if(M.mind in ticker.mode.changelings)
- if (ticker.mode.config_tag == "changeling")
+ if(ticker.mode.config_tag == "changeling")
return 2
return 1
if(M.mind in ticker.mode.abductors)
- if (ticker.mode.config_tag == "abduction")
+ if(ticker.mode.config_tag == "abduction")
return 2
return 1
if(isrobot(M))
@@ -829,7 +830,7 @@ var/global/nologevent = 0
return
guests_allowed = !( guests_allowed )
- if (!( guests_allowed ))
+ if(!( guests_allowed ))
to_chat(world, "Guests may no longer enter the game.")
else
to_chat(world, "Guests may now enter the game.")
@@ -846,7 +847,7 @@ var/global/nologevent = 0
else if(isrobot(S))
var/mob/living/silicon/robot/R = S
to_chat(usr, "CYBORG [key_name(S, usr)]'s [R.connected_ai?"(Slaved to: [R.connected_ai])":"(Independent)"] laws:")
- else if (ispAI(S))
+ else if(ispAI(S))
var/mob/living/silicon/pai/P = S
to_chat(usr, "pAI [key_name(S, usr)]'s laws:")
to_chat(usr, "[P.pai_law0]")
@@ -856,7 +857,7 @@ var/global/nologevent = 0
else
to_chat(usr, "SILICON [key_name(S, usr)]'s laws:")
- if (S.laws == null)
+ if(S.laws == null)
to_chat(usr, "[key_name(S, usr)]'s laws are null. Contact a coder.")
else
S.laws.show_laws(usr)
@@ -888,7 +889,7 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space
/proc/move_gamma_ship()
var/area/fromArea
var/area/toArea
- if (gamma_ship_location == 1)
+ if(gamma_ship_location == 1)
fromArea = locate(/area/shuttle/gamma/space)
toArea = locate(/area/shuttle/gamma/station)
else
@@ -905,7 +906,7 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space
for(var/obj/machinery/alarm/A in toArea)
A.first_run()
- if (gamma_ship_location)
+ if(gamma_ship_location)
gamma_ship_location = 0
else
gamma_ship_location = 1
@@ -955,18 +956,18 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space
return //extra sanity check to make sure only observers are shoved into things
//same as assume-direct-control perm requirements.
- if (!check_rights(R_VAREDIT,0)) //no varedit, check if they have r_admin and r_debug
+ if(!check_rights(R_VAREDIT,0)) //no varedit, check if they have r_admin and r_debug
if(!check_rights(R_ADMIN|R_DEBUG,0)) //if they don't have r_admin and r_debug, return
return 0 //otherwise, if they have no varedit, but do have r_admin and r_debug, execute the rest of the code
- if (!frommob.ckey)
+ if(!frommob.ckey)
return 0
if(istype(tothing, /obj/item))
var/mob/living/toitem = tothing
var/ask = alert("Are you sure you want to allow [frommob.name]([frommob.key]) to possess [toitem.name]?", "Place ghost in control of item?", "Yes", "No")
- if (ask != "Yes")
+ if(ask != "Yes")
return 1
if(!frommob || !toitem) //make sure the mobs don't go away while we waited for a response
@@ -986,12 +987,12 @@ var/gamma_ship_location = 1 // 0 = station , 1 = space
var/mob/living/tomob = tothing
var/question = ""
- if (tomob.ckey)
+ if(tomob.ckey)
question = "This mob already has a user ([tomob.key]) in control of it! "
question += "Are you sure you want to place [frommob.name]([frommob.key]) in control of [tomob.name]?"
var/ask = alert(question, "Place ghost in control of mob?", "Yes", "No")
- if (ask != "Yes")
+ if(ask != "Yes")
return 1
if(!frommob || !tomob) //make sure the mobs don't go away while we waited for a response
diff --git a/code/modules/admin/admin_verbs.dm b/code/modules/admin/admin_verbs.dm
index fa0059618bd..90ad26039db 100644
--- a/code/modules/admin/admin_verbs.dm
+++ b/code/modules/admin/admin_verbs.dm
@@ -56,6 +56,7 @@ var/list/admin_verbs_admin = list(
/datum/admins/proc/show_player_notes,
/client/proc/free_slot, /*frees slot for chosen job*/
/client/proc/toggleattacklogs,
+ /client/proc/toggleadminlogs,
/client/proc/toggledebuglogs,
/client/proc/update_mob_sprite,
/client/proc/toggledrones,
@@ -615,7 +616,7 @@ var/list/admin_verbs_snpc = list(
var/message = input("What do you want the message to be?", "Make Sound") as text|null
if(!message)
return
- for (var/mob/V in hearers(O))
+ for(var/mob/V in hearers(O))
V.show_message(message, 2)
log_admin("[key_name(usr)] made [O] at [O.x], [O.y], [O.z] make a sound")
message_admins("\blue [key_name_admin(usr)] made [O] at [O.x], [O.y], [O.z] make a sound")
@@ -643,7 +644,7 @@ var/list/admin_verbs_snpc = list(
if(mob.control_object)
if(!msg)
return
- for (var/mob/V in hearers(mob.control_object))
+ for(var/mob/V in hearers(mob.control_object))
V.show_message("[mob.control_object.name] says: \"" + msg + "\"", 2)
log_admin("[key_name(usr)] used oSay on [mob.control_object]: [msg]")
message_admins("[key_name_admin(usr)] used oSay on [mob.control_object]: [msg]")
@@ -857,14 +858,14 @@ var/list/admin_verbs_snpc = list(
return
var/list/jobs = list()
- for (var/datum/job/J in job_master.occupations)
- if (J.current_positions >= J.total_positions && J.total_positions != -1)
+ for(var/datum/job/J in job_master.occupations)
+ if(J.current_positions >= J.total_positions && J.total_positions != -1)
jobs += J.title
- if (!jobs.len)
+ if(!jobs.len)
to_chat(usr, "There are no fully staffed jobs.")
return
var/job = input("Please select job slot to free", "Free Job Slot") as null|anything in jobs
- if (job)
+ if(job)
job_master.FreeRole(job)
log_admin("[key_name(usr)] has freed a job slot for [job].")
message_admins("[key_name_admin(usr)] has freed a job slot for [job].")
@@ -878,11 +879,25 @@ var/list/admin_verbs_snpc = list(
prefs.toggles ^= CHAT_ATTACKLOGS
prefs.save_preferences(src)
- if (prefs.toggles & CHAT_ATTACKLOGS)
+ if(prefs.toggles & CHAT_ATTACKLOGS)
to_chat(usr, "You now will get attack log messages")
else
to_chat(usr, "You now won't get attack log messages")
+/client/proc/toggleadminlogs()
+ set name = "Toggle Admin Log Messages"
+ set category = "Preferences"
+
+ if(!check_rights(R_ADMIN))
+ return
+
+ prefs.toggles ^= CHAT_NO_ADMINLOGS
+ prefs.save_preferences(src)
+ if(prefs.toggles & CHAT_NO_ADMINLOGS)
+ to_chat(usr, "You now won't get admin log messages.")
+ else
+ to_chat(usr, "You now will get admin log messages.")
+
/client/proc/toggledrones()
set name = "Toggle Maintenance Drones"
set category = "Server"
@@ -903,7 +918,7 @@ var/list/admin_verbs_snpc = list(
prefs.toggles ^= CHAT_DEBUGLOGS
prefs.save_preferences(src)
- if (prefs.toggles & CHAT_DEBUGLOGS)
+ if(prefs.toggles & CHAT_DEBUGLOGS)
to_chat(usr, "You now will get debug log messages")
else
to_chat(usr, "You now won't get debug log messages")
@@ -933,7 +948,7 @@ var/list/admin_verbs_snpc = list(
var/confirm = alert("Are you sure you want to send the global message?", "Confirm Man Up Global", "Yes", "No")
if(confirm == "Yes")
- for (var/mob/T as mob in mob_list)
+ for(var/mob/T as mob in mob_list)
to_chat(T, "
"}
- if (2)
+ if(2)
if(check_rights((R_SERVER|R_EVENT),0))
dat += {"
@@ -104,6 +107,7 @@
Dodgeball (TDM)! Round-enders The floor is lava! (DANGEROUS: extremely lame)
+ The floor is fake-lava! (non-harmful) Turn all humans into monkeys Make all items look like guns Warp all Players to Prison
diff --git a/code/modules/admin/sql_notes.dm b/code/modules/admin/sql_notes.dm
index df02b6f0c9c..338993af58c 100644
--- a/code/modules/admin/sql_notes.dm
+++ b/code/modules/admin/sql_notes.dm
@@ -33,7 +33,7 @@
return
var/admin_sql_ckey = sanitizeSQL(adminckey)
if(!server)
- if (config && config.server_name)
+ if(config && config.server_name)
server = config.server_name
server = sanitizeSQL(server)
var/DBQuery/query_noteadd = dbcon.NewQuery("INSERT INTO [format_table_name("notes")] (ckey, timestamp, notetext, adminckey, server) VALUES ('[target_sql_ckey]', '[timestamp]', '[notetext]', '[admin_sql_ckey]', '[server]')")
diff --git a/code/modules/admin/stickyban.dm b/code/modules/admin/stickyban.dm
index a772edc2608..bddebcff602 100644
--- a/code/modules/admin/stickyban.dm
+++ b/code/modules/admin/stickyban.dm
@@ -2,32 +2,32 @@
if(!check_rights(R_BAN))
return
- switch (action)
- if ("show")
+ switch(action)
+ if("show")
stickyban_show()
return
- if ("add")
+ if("add")
var/list/ban = list()
var/ckey
ban["admin"] = usr.key
ban["type"] = list("sticky")
ban["reason"] = "(InGameBan)([usr.key])" //this will be displayed in dd only
- if (data["ckey"])
+ if(data["ckey"])
ckey = ckey(data["ckey"])
else
ckey = input(usr,"Ckey","Ckey","") as text|null
- if (!ckey)
+ if(!ckey)
return
ckey = ckey(ckey)
- if (get_stickyban_from_ckey(ckey))
+ if(get_stickyban_from_ckey(ckey))
to_chat(usr, "Error: Can not add a stickyban: User already has a current sticky ban")
- if (data["reason"])
+ if(data["reason"])
ban["message"] = data["reason"]
else
var/reason = input(usr,"Reason","Reason","Ban Evasion") as text|null
- if (!reason)
+ if(!reason)
return
ban["message"] = "[reason]"
@@ -36,18 +36,18 @@
log_admin("[key_name(usr)] has stickybanned [ckey].\nReason: [ban["message"]]")
message_admins("[key_name_admin(usr)] has stickybanned [ckey].\nReason: [ban["message"]]")
- if ("remove")
- if (!data["ckey"])
+ if("remove")
+ if(!data["ckey"])
return
var/ckey = data["ckey"]
var/ban = get_stickyban_from_ckey(ckey)
- if (!ban)
+ if(!ban)
to_chat(usr, "Error: No sticky ban for [ckey] found!")
return
- if (alert("Are you sure you want to remove the sticky ban on [ckey]?","Are you sure","Yes","No") == "No")
+ if(alert("Are you sure you want to remove the sticky ban on [ckey]?","Are you sure","Yes","No") == "No")
return
- if (!get_stickyban_from_ckey(ckey))
+ if(!get_stickyban_from_ckey(ckey))
to_chat(usr, "Error: The ban disappeared.")
return
world.SetConfig("ban", ckey, null)
@@ -55,46 +55,46 @@
log_admin("[key_name(usr)] removed [ckey]'s stickyban")
message_admins("[key_name_admin(usr)] removed [ckey]'s stickyban")
- if ("remove_alt")
- if (!data["ckey"])
+ if("remove_alt")
+ if(!data["ckey"])
return
var/ckey = data["ckey"]
- if (!data["alt"])
+ if(!data["alt"])
return
var/alt = ckey(data["alt"])
var/ban = get_stickyban_from_ckey(ckey)
- if (!ban)
+ if(!ban)
to_chat(usr, "Error: No sticky ban for [ckey] found!")
return
var/found = 0
//we have to do it this way because byond keeps the case in its sticky ban matches WHY!!!
- for (var/key in ban["keys"])
- if (ckey(key) == alt)
+ for(var/key in ban["keys"])
+ if(ckey(key) == alt)
found = 1
break
- if (!found)
+ if(!found)
to_chat(usr, "Error: [alt] is not linked to [ckey]'s sticky ban!")
return
- if (alert("Are you sure you want to disassociate [alt] from [ckey]'s sticky ban? \nNote: Nothing stops byond from re-linking them","Are you sure","Yes","No") == "No")
+ if(alert("Are you sure you want to disassociate [alt] from [ckey]'s sticky ban? \nNote: Nothing stops byond from re-linking them","Are you sure","Yes","No") == "No")
return
//we have to do this again incase something changes
ban = get_stickyban_from_ckey(ckey)
- if (!ban)
+ if(!ban)
to_chat(usr, "Error: The ban disappeared.")
return
found = 0
- for (var/key in ban["keys"])
- if (ckey(key) == alt)
+ for(var/key in ban["keys"])
+ if(ckey(key) == alt)
ban["keys"] -= key
found = 1
break
- if (!found)
+ if(!found)
to_chat(usr, "Error: [alt] link to [ckey]'s sticky ban disappeared.")
return
@@ -103,21 +103,21 @@
log_admin("[key_name(usr)] has disassociated [alt] from [ckey]'s sticky ban")
message_admins("[key_name_admin(usr)] has disassociated [alt] from [ckey]'s sticky ban")
- if ("edit")
- if (!data["ckey"])
+ if("edit")
+ if(!data["ckey"])
return
var/ckey = data["ckey"]
var/ban = get_stickyban_from_ckey(ckey)
- if (!ban)
+ if(!ban)
to_chat(usr, "Error: No sticky ban for [ckey] found!")
return
var/oldreason = ban["message"]
var/reason = input(usr,"Reason","Reason","[ban["message"]]") as text|null
- if (!reason || reason == oldreason)
+ if(!reason || reason == oldreason)
return
//we have to do this again incase something changed while we waited for input
ban = get_stickyban_from_ckey(ckey)
- if (!ban)
+ if(!ban)
to_chat(usr, "Error: The ban disappeared.")
return
ban["message"] = "[reason]"
@@ -133,13 +133,13 @@
/datum/admins/proc/stickyban_gethtml(ckey, ban)
. = "\[-\][ckey] "
. += "[ban["message"]] \[Edit\] "
- if (ban["admin"])
+ if(ban["admin"])
. += "[ban["admin"]] "
else
. += "LEGACY "
. += "Caught keys \n"
- for (var/key in ban["keys"])
- if (ckey(key) == ckey)
+ for(var/key in ban["keys"])
+ if(ckey(key) == ckey)
continue
. += "
"
. += "\n"
@@ -168,17 +168,17 @@
usr << browse(html,"window=stickybans;size=700x400")
/proc/get_stickyban_from_ckey(var/ckey)
- if (!ckey)
+ if(!ckey)
return null
ckey = ckey(ckey)
. = null
- for (var/key in world.GetConfig("ban"))
- if (ckey(key) == ckey)
+ for(var/key in world.GetConfig("ban"))
+ if(ckey(key) == ckey)
. = stickyban2list(world.GetConfig("ban",key))
break
/proc/stickyban2list(var/ban)
- if (!ban)
+ if(!ban)
return null
. = params2list(ban)
.["keys"] = splittext(.["keys"], ",")
@@ -187,16 +187,16 @@
.["computer_id"] = splittext(.["computer_id"], ",")
/proc/list2stickyban(var/list/ban)
- if (!ban || !islist(ban))
+ if(!ban || !islist(ban))
return null
. = ban.Copy()
- if (.["keys"])
+ if(.["keys"])
.["keys"] = jointext(.["keys"], ",")
- if (.["type"])
+ if(.["type"])
.["type"] = jointext(.["type"], ",")
- if (.["IP"])
+ if(.["IP"])
.["IP"] = jointext(.["IP"], ",")
- if (.["computer_id"])
+ if(.["computer_id"])
.["computer_id"] = jointext(.["computer_id"], ",")
. = list2params(.)
diff --git a/code/modules/admin/topic.dm b/code/modules/admin/topic.dm
index 59278124aa0..a7fc809aa88 100644
--- a/code/modules/admin/topic.dm
+++ b/code/modules/admin/topic.dm
@@ -877,7 +877,7 @@
else if(href_list["boot2"])
var/mob/M = locate(href_list["boot2"])
- if (ismob(M))
+ if(ismob(M))
if(!check_if_greater_rights_than(M.client))
return
to_chat(M, "\red You have been kicked from the server")
@@ -1094,7 +1094,7 @@
else if(href_list["c_mode2"])
if(!check_rights(R_ADMIN|R_SERVER)) return
- if (ticker && ticker.mode)
+ if(ticker && ticker.mode)
return alert(usr, "The game has already started.", null, null, null, null)
master_mode = href_list["c_mode2"]
log_admin("[key_name(usr)] set the mode as [master_mode].")
@@ -1592,10 +1592,10 @@
if(isliving(M))
var/mob/living/L = M
var/status
- switch (M.stat)
- if (0) status = "Alive"
- if (1) status = "Unconscious"
- if (2) status = "Dead"
+ switch(M.stat)
+ if(0) status = "Alive"
+ if(1) status = "Unconscious"
+ if(2) status = "Dead"
health_description = "Status = [status]"
health_description += " Oxy: [L.getOxyLoss()] - Tox: [L.getToxLoss()] - Fire: [L.getFireLoss()] - Brute: [L.getBruteLoss()] - Clone: [L.getCloneLoss()] - Brain: [L.getBrainLoss()]"
else
@@ -1707,7 +1707,7 @@
if(!istype(H))
to_chat(usr, "This can only be used on instances of type /mob/living/carbon/human")
return
- var/etypes = list("borging","corgifying","firedeath","braindeath","honktumor","demotion")
+ var/etypes = list("Borgification","Corgification","Death By Fire","Total Brain Death","Honk Tumor","Cluwne","Demotion Notice")
var/eviltype = input(src.owner, "Which type of evil fax do you wish to send [H]?","Its good to be baaaad...", "") as null|anything in etypes
if(!(eviltype in etypes))
return
@@ -1718,7 +1718,7 @@
var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"])
P.name = "Central Command - [customname]"
- P.info = "A reminder: per the terms of your contract, stupid faxes will get you demoted, or worse."
+ P.info = "You really should've known better."
P.myeffect = eviltype
P.mytarget = H
if(alert("Do you want the Evil Fax to activate automatically if [H] tries to ignore it?",,"Yes", "No") == "Yes")
@@ -1758,19 +1758,23 @@
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper(null)
var/obj/machinery/photocopier/faxmachine/fax = locate(href_list["originfax"])
P.name = "Central Command - paper"
- var/stypes = list("handle it yourself","illegible","not signed","sorry, not right now","stop wasting our time")
+ var/stypes = list("Handle it yourselves!","Illegible fax","Fax not signed","Not Right Now","You are wasting our time", "Keep up the good work", "ERT Instructions")
var/stype = input(src.owner, "Which type of standard reply do you wish to send to [H]?","Choose your paperwork", "") as null|anything in stypes
var/tmsg = "
NanoTrasen Science Station Cyberiad
NAS Trurl Communications Department Report
"
- if(stype == "handle it yourself")
- tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Please proceed in accordance with Standard Operating Procedure and/or Space Law. You are fully trained to handle this situation without Central Command intervention."
- else if(stype == "illegible")
- tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Your fax was too poorly written for our system to interpret."
- else if(stype == "not signed")
- tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Your fax was not properly signed and/or stamped."
- else if(stype == "sorry, not right now")
- tmsg += "Greetings, esteemed crewmember. Unfortunately, we are unable to spare the resources to assist you at this time."
- else if(stype == "stop wasting our time")
- tmsg += "Stop wasting our time."
+ if(stype == "Handle it yourselves!")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Please proceed in accordance with Standard Operating Procedure and/or Space Law. You are fully trained to handle this situation without Central Command intervention.
This is an automatic message."
+ else if(stype == "Illegible fax")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Your fax's grammar, syntax and/or typography are of a sub-par level and do not allow us to understand the contents of the message.
Please consult your nearest dictionary and/or thesaurus and try again.
This is an automatic message."
+ else if(stype == "Fax not signed")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Your fax has not been correctly signed and, as such, we cannot verify your identity.
Please sign your faxes before sending them so that we may verify your identity.
This is an automatic message."
+ else if(stype == "Not Right Now")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Due to pressing concerns of a matter above your current paygrade, we are unable to provide assistance in whatever matter your fax referenced.
This can be either due to a power outage, bureaucratic audit, pest infestation, Ascendance Event, corgi outbreak, or any other situation that would affect the proper functioning of the NAS Trurl.
Please try again later.
This is an automatic message."
+ else if(stype == "You are wasting our time")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
In the interest of preventing further mismanagement of company resources, please avoid wasting our time with such petty drivel.
Do kindly remember that we expect our workforce to maintain at least a semi-decent level of profesionalism. Do not test our patience.
This is an automatic message."
+ else if(stype == "Keep up the good work")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been received successfully by NAS Trurl Fax Registration.
We at the NAS Trurl appreciate the good work that you have done here, and sincerely recommend that you continue such a display of dedication to the company.
This is absolutely not an automated message."
+ else if(stype == "ERT Instructions")
+ tmsg += "Greetings, esteemed crewmember. Your fax has been DECLINED automatically by NAS Trurl Fax Registration.
Please utilize the Card Swipers if you wish to call for an ERT.
This is an automated message."
else
return
tmsg += ""
@@ -1854,7 +1858,7 @@
var/input = input(src.owner, "Please enter a reason for denying [key_name(H)]'s ERT request.","Outgoing message from CentComm", "")
if(!input) return
-
+ ert_request_answered = 1
to_chat(src.owner, "You sent [input] to [H] via a secure channel.")
log_admin("[src.owner] denied [key_name(H)]'s ERT request with the message [input].")
to_chat(H, "You hear something crackle in your headset for a moment before a voice speaks. \"Your ERT request has been denied for the following reasons: [input]. Message ends.\"")
@@ -1867,19 +1871,19 @@
return
var/obj/item/fax = locate(href_list["AdminFaxView"])
- if (istype(fax, /obj/item/weapon/paper))
+ if(istype(fax, /obj/item/weapon/paper))
var/obj/item/weapon/paper/P = fax
P.show_content(usr,1)
- else if (istype(fax, /obj/item/weapon/photo))
+ else if(istype(fax, /obj/item/weapon/photo))
var/obj/item/weapon/photo/H = fax
H.show(usr)
- else if (istype(fax, /obj/item/weapon/paper_bundle))
+ else if(istype(fax, /obj/item/weapon/paper_bundle))
//having multiple people turning pages on a paper_bundle can cause issues
//open a browse window listing the contents instead
var/data = ""
var/obj/item/weapon/paper_bundle/B = fax
- for (var/page = 1, page <= B.amount + 1, page++)
+ for(var/page = 1, page <= B.amount + 1, page++)
var/obj/pageobj = B.contents[page]
data += "Page [page] - [pageobj.name] "
@@ -1887,19 +1891,19 @@
else
to_chat(usr, "\red The faxed item is not viewable. This is probably a bug, and should be reported on the tracker: [fax.type]")
- else if (href_list["AdminFaxViewPage"])
+ else if(href_list["AdminFaxViewPage"])
if(!check_rights(R_ADMIN))
return
var/page = text2num(href_list["AdminFaxViewPage"])
var/obj/item/weapon/paper_bundle/bundle = locate(href_list["paper_bundle"])
- if (!bundle) return
+ if(!bundle) return
- if (istype(bundle.contents[page], /obj/item/weapon/paper))
+ if(istype(bundle.contents[page], /obj/item/weapon/paper))
var/obj/item/weapon/paper/P = bundle.contents[page]
P.show_content(usr, 1)
- else if (istype(bundle.contents[page], /obj/item/weapon/photo))
+ else if(istype(bundle.contents[page], /obj/item/weapon/photo))
var/obj/item/weapon/photo/H = bundle.contents[page]
H.show(usr)
return
@@ -2124,9 +2128,9 @@
var/atom/loc = usr.loc
var/dirty_paths
- if (istext(href_list["object_list"]))
+ if(istext(href_list["object_list"]))
dirty_paths = list(href_list["object_list"])
- else if (istype(href_list["object_list"], /list))
+ else if(istype(href_list["object_list"], /list))
dirty_paths = href_list["object_list"]
var/paths = list()
@@ -2160,22 +2164,22 @@
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","inhand","inmarked") ))
where = "onfloor"
switch(where)
if("inhand")
- if (!iscarbon(usr) && !isrobot(usr))
+ if(!iscarbon(usr) && !isrobot(usr))
to_chat(usr, "Can only spawn in hand when you're a carbon mob or cyborg.")
where = "onfloor"
target = usr
if("onfloor")
switch(href_list["offset_type"])
- if ("absolute")
+ if("absolute")
target = locate(0 + X,0 + Y,0 + Z)
- if ("relative")
+ if("relative")
target = locate(loc.x + X,loc.y + Y,loc.z + Z)
if("inmarked")
if(!marked_datum)
@@ -2188,8 +2192,8 @@
target = marked_datum
if(target)
- for (var/path in paths)
- for (var/i = 0; i < number; i++)
+ for(var/path in paths)
+ for(var/i = 0; i < number; i++)
if(path in typesof(/turf))
var/turf/O = target
var/turf/N = O.ChangeTurf(path)
@@ -2217,7 +2221,7 @@
R.activate_module(I)
R.module.fix_modules()
- if (number == 1)
+ if(number == 1)
log_admin("[key_name(usr)] created a [english_list(paths)]")
for(var/path in paths)
if(ispath(path, /mob))
@@ -2287,7 +2291,7 @@
/* for(var/obj/machinery/vehicle/pod/O in world)
for(var/mob/M in src)
M.loc = src.loc
- if (M.client)
+ if(M.client)
M.client.perspective = MOB_PERSPECTIVE
M.client.eye = M
qdel(O)
@@ -2385,9 +2389,9 @@
continue
//don't strip organs
H.unEquip(W)
- if (H.client)
+ if(H.client)
H.client.screen -= W
- if (W)
+ if(W)
W.loc = H.loc
W.dropped(H)
W.layer = initial(W.layer)
@@ -2439,9 +2443,9 @@
feedback_add_details("admin_secrets_fun_used","BC")
var/newBombCap = input(usr,"What would you like the new bomb cap to be. (entered as the light damage range (the 3rd number in common (1,2,3) notation)) Must be between 4 and 128)", "New Bomb Cap", MAX_EX_LIGHT_RANGE) as num|null
- if (newBombCap < 4)
+ if(newBombCap < 4)
return
- if (newBombCap > 128)
+ if(newBombCap > 128)
newBombCap = 128
MAX_EX_DEVESTATION_RANGE = round(newBombCap/4)
@@ -2544,60 +2548,37 @@
L.fix()
message_admins("[key_name_admin(usr)] fixed all lights", 1)
if("floorlava")
- if(floorIsLava)
- to_chat(usr, "The floor is lava already.")
+ feedback_inc("admin_secrets_fun_used", 1)
+ feedback_add_details("admin_secrets_fun_used", "LF")
+ var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
+ if(sure == "No")
return
- feedback_inc("admin_secrets_fun_used",1)
- feedback_add_details("admin_secrets_fun_used","LF")
-
- //Options
- var/length = input(usr, "How long will the lava last? (in seconds)", "Length", 180) as num
- length = min(abs(length), 1200)
-
- var/damage = input(usr, "How deadly will the lava be?", "Damage", 2) as num
- damage = min(abs(damage), 100)
-
- var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "YES!", "Nah")
- if(sure == "Nah")
+ weather_master.run_weather("the floor is lava")
+ message_admins("[key_name_admin(usr)] made the floor lava")
+ if("fakelava")
+ feedback_inc("admin_secrets_fun_used", 1)
+ feedback_add_details("admin_secrets_fun_used", "LZ")
+ var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
+ if(sure == "No")
return
- floorIsLava = 1
-
- message_admins("[key_name_admin(usr)] made the floor LAVA! It'll last [length] seconds and it will deal [damage] damage to everyone.", 1)
-
- for(var/turf/simulated/floor/F in world)
- if((F.z in config.station_levels))
- F.name = "lava"
- F.desc = "The floor is LAVA!"
- F.overlays += "lava"
- F.lava = 1
-
- spawn(0)
- for(var/i = i, i < length, i++) // 180 = 3 minutes
- if(damage)
- for(var/mob/living/carbon/L in living_mob_list)
- if(istype(L.loc, /turf/simulated/floor)) // Are they on LAVA?!
- var/turf/simulated/floor/F = L.loc
- if(F.lava)
- var/safe = 0
- for(var/obj/structure/O in F.contents)
- if(O.level > F.level && !istype(O, /obj/structure/window)) // Something to stand on and it isn't under the floor!
- safe = 1
- break
- if(!safe)
- L.adjustFireLoss(damage)
-
-
- sleep(10)
-
- for(var/turf/simulated/floor/F in world) // Reset everything.
- if((F.z in config.station_levels))
- F.name = initial(F.name)
- F.desc = initial(F.desc)
- F.overlays.Cut()
- F.lava = 0
- F.update_icon()
- floorIsLava = 0
- return
+ weather_master.run_weather("fake lava")
+ message_admins("[key_name_admin(usr)] made aesthetic lava on the floor")
+ if("weatherashstorm")
+ feedback_inc("admin_secrets_fun_used", 1)
+ feedback_add_details("admin_secrets_fun_used", "WA")
+ var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
+ if(sure == "No")
+ return
+ weather_master.run_weather("ash storm")
+ message_admins("[key_name_admin(usr)] spawned an ash storm on the mining asteroid")
+ if("weatherdarkness")
+ feedback_inc("admin_secrets_fun_used", 1)
+ feedback_add_details("admin_secrets_fun_used", "WD")
+ var/sure = alert(usr, "Are you sure you want to do this?", "Confirmation", "Yes", "No")
+ if(sure == "No")
+ return
+ weather_master.run_weather("advanced darkness")
+ message_admins("[key_name_admin(usr)] made the station go through advanced darkness")
if("retardify")
feedback_inc("admin_secrets_fun_used",1)
feedback_add_details("admin_secrets_fun_used","RET")
@@ -2728,7 +2709,7 @@
if(usr)
log_admin("[key_name(usr)] used secret [href_list["secretsfun"]]")
- if (ok)
+ if(ok)
to_chat(world, text("A secret has been activated by []!", usr.key))
else if(href_list["secretsadmin"])
@@ -2768,7 +2749,7 @@
if("showgm")
if(!ticker)
alert("The game hasn't started yet!")
- else if (ticker.mode)
+ else if(ticker.mode)
alert("The game mode is [ticker.mode.name]")
else alert("For some reason there's a ticker, but not a game mode")
if("manifest")
@@ -2803,9 +2784,9 @@
dat += "
"
usr << browse(dat, "window=fingerprints;size=440x410")
else
- if (usr)
+ if(usr)
log_admin("[key_name(usr)] used secret [href_list["secretsadmin"]]")
- if (ok)
+ if(ok)
to_chat(world, text("A secret has been activated by []!", usr.key))
else if(href_list["secretscoder"])
@@ -2821,12 +2802,12 @@
usr << browse(dat, "window=admin_log")
if("maint_access_brig")
for(var/obj/machinery/door/airlock/maintenance/M in world)
- if (access_maint_tunnels in M.req_access)
+ if(access_maint_tunnels in M.req_access)
M.req_access = list(access_brig)
message_admins("[key_name_admin(usr)] made all maint doors brig access-only.")
if("maint_access_engiebrig")
for(var/obj/machinery/door/airlock/maintenance/M in world)
- if (access_maint_tunnels in M.req_access)
+ if(access_maint_tunnels in M.req_access)
M.req_access = list()
M.req_one_access = list(access_brig,access_engine)
message_admins("[key_name_admin(usr)] made all maint doors engineering and brig access-only.")
@@ -2843,7 +2824,7 @@
else if(href_list["ac_set_channel_name"])
src.admincaster_feed_channel.channel_name = strip_html_simple(input(usr, "Provide a Feed Channel Name", "Network Channel Handler", ""))
- while (findtext(src.admincaster_feed_channel.channel_name," ") == 1)
+ while(findtext(src.admincaster_feed_channel.channel_name," ") == 1)
src.admincaster_feed_channel.channel_name = copytext(src.admincaster_feed_channel.channel_name,2,lentext(src.admincaster_feed_channel.channel_name)+1)
src.access_news_network()
@@ -2882,7 +2863,7 @@
else if(href_list["ac_set_new_message"])
src.admincaster_feed_message.body = adminscrub(input(usr, "Write your Feed story", "Network Channel Handler", ""))
- while (findtext(src.admincaster_feed_message.body," ") == 1)
+ while(findtext(src.admincaster_feed_message.body," ") == 1)
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1)
src.access_news_network()
@@ -2936,13 +2917,13 @@
else if(href_list["ac_set_wanted_name"])
src.admincaster_feed_message.author = adminscrub(input(usr, "Provide the name of the Wanted person", "Network Security Handler", ""))
- while (findtext(src.admincaster_feed_message.author," ") == 1)
+ while(findtext(src.admincaster_feed_message.author," ") == 1)
src.admincaster_feed_message.author = copytext(admincaster_feed_message.author,2,lentext(admincaster_feed_message.author)+1)
src.access_news_network()
else if(href_list["ac_set_wanted_desc"])
src.admincaster_feed_message.body = adminscrub(input(usr, "Provide the a description of the Wanted person and any other details you deem important", "Network Security Handler", ""))
- while (findtext(src.admincaster_feed_message.body," ") == 1)
+ while(findtext(src.admincaster_feed_message.body," ") == 1)
src.admincaster_feed_message.body = copytext(src.admincaster_feed_message.body,2,lentext(src.admincaster_feed_message.body)+1)
src.access_news_network()
@@ -3025,7 +3006,7 @@
else if(href_list["ac_setScreen"]) //Brings us to the main menu and resets all fields~
src.admincaster_screen = text2num(href_list["ac_setScreen"])
- if (src.admincaster_screen == 0)
+ if(src.admincaster_screen == 0)
if(src.admincaster_feed_channel)
src.admincaster_feed_channel = new /datum/feed_channel
if(src.admincaster_feed_message)
diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2.dm b/code/modules/admin/verbs/SDQL2/SDQL_2.dm
index b46e5401528..27048b441dd 100644
--- a/code/modules/admin/verbs/SDQL2/SDQL_2.dm
+++ b/code/modules/admin/verbs/SDQL2/SDQL_2.dm
@@ -412,7 +412,7 @@
else if(expression[start + 1] == "\[" && islist(v))
var/list/L = v
var/index = SDQL_expression(source, expression[start + 2])
- if (isnum(index) && (!IsInteger(index) || L.len < index))
+ if(isnum(index) && (!IsInteger(index) || L.len < index))
to_chat(world, "Invalid list index: [index]")
return null
return L[index]
@@ -424,7 +424,7 @@
for(var/arg in arguments)
new_args[++new_args.len] = SDQL_expression(source, arg)
- if (object == world) // Global proc.
+ if(object == world) // Global proc.
procname = "/proc/[procname]"
return call(procname)(arglist(new_args))
diff --git a/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm b/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm
index 5aa2aa0dc93..0d0573e3760 100644
--- a/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm
+++ b/code/modules/admin/verbs/SDQL2/SDQL_2_parser.dm
@@ -358,7 +358,7 @@
else if(token(i + 1) == "\[") // list index
var/list/expression = list()
i = expression(i + 2, expression)
- if (token(i) != "]")
+ if(token(i) != "]")
parse_error("Missing ] at the end of list access.")
L += "\["
diff --git a/code/modules/admin/verbs/adminjump.dm b/code/modules/admin/verbs/adminjump.dm
index 5cbb8dd26d5..2512171e80d 100644
--- a/code/modules/admin/verbs/adminjump.dm
+++ b/code/modules/admin/verbs/adminjump.dm
@@ -24,7 +24,8 @@
admin_forcemove(usr, T)
log_admin("[key_name(usr)] jumped to [A]")
- message_admins("[key_name_admin(usr)] jumped to [A]")
+ if(!isobserver(usr))
+ message_admins("[key_name_admin(usr)] jumped to [A]")
feedback_add_details("admin_verb","JA") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
/client/proc/jumptoturf(var/turf/T in world)
@@ -35,7 +36,8 @@
return
log_admin("[key_name(usr)] jumped to [T.x], [T.y], [T.z] in [T.loc]")
- message_admins("[key_name_admin(usr)] jumped to [T.x], [T.y], [T.z] in [T.loc]", 1)
+ if(!isobserver(usr))
+ message_admins("[key_name_admin(usr)] jumped to [T.x], [T.y], [T.z] in [T.loc]", 1)
admin_forcemove(usr, T)
feedback_add_details("admin_verb","JT") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
return
@@ -48,7 +50,8 @@
return
log_admin("[key_name(usr)] jumped to [key_name(M)]")
- message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
+ if(!isobserver(usr))
+ message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
if(src.mob)
var/mob/A = src.mob
var/turf/T = get_turf(M)
@@ -69,7 +72,8 @@
if(T)
admin_forcemove(usr, T)
feedback_add_details("admin_verb","JC") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
- message_admins("[key_name_admin(usr)] jumped to coordinates [tx], [ty], [tz]")
+ if(!isobserver(usr))
+ message_admins("[key_name_admin(usr)] jumped to coordinates [tx], [ty], [tz]")
/client/proc/jumptokey()
set category = "Admin"
@@ -87,7 +91,8 @@
return
var/mob/M = selection:mob
log_admin("[key_name(usr)] jumped to [key_name(M)]")
- message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
+ if(!isobserver(usr))
+ message_admins("[key_name_admin(usr)] jumped to [key_name_admin(M)]", 1)
admin_forcemove(usr, M.loc)
diff --git a/code/modules/admin/verbs/adminpm.dm b/code/modules/admin/verbs/adminpm.dm
index e533a4716b6..319830d0235 100644
--- a/code/modules/admin/verbs/adminpm.dm
+++ b/code/modules/admin/verbs/adminpm.dm
@@ -99,7 +99,7 @@
adminhelp(msg) //admin we are replying to has vanished, adminhelp instead
return
- if (src.handle_spam_prevention(msg,MUTE_ADMINHELP))
+ if(src.handle_spam_prevention(msg,MUTE_ADMINHELP))
return
//clean the message if it's not sent by a high-rank admin
diff --git a/code/modules/admin/verbs/adminsay.dm b/code/modules/admin/verbs/adminsay.dm
index 3f116b0a0d5..784f924966f 100644
--- a/code/modules/admin/verbs/adminsay.dm
+++ b/code/modules/admin/verbs/adminsay.dm
@@ -27,7 +27,7 @@
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
log_admin("MOD: [key_name(src)] : [msg]")
- if (!msg)
+ if(!msg)
return
var/spanclass = "mod_channel"
diff --git a/code/modules/admin/verbs/atmosdebug.dm b/code/modules/admin/verbs/atmosdebug.dm
index e1225275e17..85591ee3159 100644
--- a/code/modules/admin/verbs/atmosdebug.dm
+++ b/code/modules/admin/verbs/atmosdebug.dm
@@ -6,37 +6,41 @@
to_chat(src, "Only administrators may use this command.")
return
feedback_add_details("admin_verb","CP") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
-
+
if(alert("WARNING: This command should not be run on a live server. Do you want to continue?", "Check Piping", "No", "Yes") == "No")
return
to_chat(usr, "Checking for disconnected pipes...")
//all plumbing - yes, some things might get stated twice, doesn't matter.
- for (var/obj/machinery/atmospherics/plumbing in world)
- if (plumbing.nodealert)
+ for(var/obj/machinery/atmospherics/plumbing in world)
+ if(plumbing.nodealert)
to_chat(usr, "Unconnected [plumbing.name] located at [plumbing.x],[plumbing.y],[plumbing.z] ([get_area(plumbing.loc)])")
//Manifolds
- for (var/obj/machinery/atmospherics/pipe/manifold/pipe in world)
- if (!pipe.node1 || !pipe.node2 || !pipe.node3)
+ for(var/obj/machinery/atmospherics/pipe/manifold/pipe in world)
+ if(!pipe.node1 || !pipe.node2 || !pipe.node3)
to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")
//Pipes
- for (var/obj/machinery/atmospherics/pipe/simple/pipe in world)
- if (!pipe.node1 || !pipe.node2)
+ for(var/obj/machinery/atmospherics/pipe/simple/pipe in world)
+ if(!pipe.node1 || !pipe.node2)
to_chat(usr, "Unconnected [pipe.name] located at [pipe.x],[pipe.y],[pipe.z] ([get_area(pipe.loc)])")
to_chat(usr, "Checking for overlapping pipes...")
- next_turf:
- for(var/turf/T in world)
- for(var/dir in cardinal)
- var/check = 0
- for(var/obj/machinery/atmospherics/pipe in T)
- if(dir & pipe.initialize_directions)
- check++
- if(check > 1)
+ for(var/turf/T in world)
+ for(var/dir in cardinal)
+ var/list/check = list(0, 0, 0)
+ var/done = 0
+ for(var/obj/machinery/atmospherics/pipe in T)
+ if(dir & pipe.initialize_directions)
+ for(var/ct in pipe.connect_types)
+ check[ct]++
+ if(check[ct] > 1)
to_chat(usr, "Overlapping pipe ([pipe.name]) located at [T.x],[T.y],[T.z] ([get_area(T)])")
- continue next_turf
+ done = 1
+ break
+ if(done)
+ break
to_chat(usr, "Done")
/client/proc/powerdebug()
@@ -47,13 +51,13 @@
return
feedback_add_details("admin_verb","CPOW") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
- for (var/datum/powernet/PN in powernets)
- if (!PN.nodes || !PN.nodes.len)
+ for(var/datum/powernet/PN in powernets)
+ if(!PN.nodes || !PN.nodes.len)
if(PN.cables && (PN.cables.len > 1))
var/obj/structure/cable/C = PN.cables[1]
to_chat(usr, "Powernet with no nodes! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")
- if (!PN.cables || (PN.cables.len < 10))
+ if(!PN.cables || (PN.cables.len < 10))
if(PN.cables && (PN.cables.len > 1))
var/obj/structure/cable/C = PN.cables[1]
to_chat(usr, "Powernet with fewer than 10 cables! (number [PN.number]) - example cable at [C.x], [C.y], [C.z] in area [get_area(C.loc)]")
diff --git a/code/modules/admin/verbs/cinematic.dm b/code/modules/admin/verbs/cinematic.dm
index 570d73e19a8..3449350e11f 100644
--- a/code/modules/admin/verbs/cinematic.dm
+++ b/code/modules/admin/verbs/cinematic.dm
@@ -1,17 +1,17 @@
-/client/proc/cinematic(var/cinematic as anything in list("explosion",null))
- set name = "Play cinematic"
+/client/proc/cinematic(cinematic as anything in list("explosion", null))
+ set name = "cinematic"
set category = "Debug"
- set desc = "Shows a cinematic, will work like a normal nuke" // Intended for testing but I thought it might be nice for events on the rare occasion Feel free to comment it out if it's not wanted.
- if(alert("Are you sure you want to run [cinematic]?","Confirmation","Yes","No")=="No") return
- if(!ticker) return
+ set desc = "Shows a cinematic." // Intended for testing but I thought it might be nice for events on the rare occasion Feel free to comment it out if it's not wanted.
+ set hidden = 1
+ if(!ticker)
+ return
switch(cinematic)
if("explosion")
- var/parameter = input(src,"station_missed = ?","Enter Parameter",0) as num
+ var/parameter = input(src, "station_missed = ?", "Enter Parameter", 0) as num
var/override
switch(parameter)
if(1)
- override = input(src,"mode = ?","Enter Parameter",null) as anything in list("nuclear emergency","no override")
+ override = input(src, "mode = ?","Enter Parameter", null) as anything in list("nuclear emergency", "fake", "no override")
if(0)
- override = input(src,"mode = ?","Enter Parameter",null) as anything in list("blob","nuclear emergency","AI malfunction","no override")
- ticker.station_explosion_cinematic(parameter,override)
- return
\ No newline at end of file
+ override = input(src, "mode = ?","Enter Parameter", null) as anything in list("blob", "nuclear emergency", "AI malfunction", "no override")
+ ticker.station_explosion_cinematic(parameter, override)
\ No newline at end of file
diff --git a/code/modules/admin/verbs/deadsay.dm b/code/modules/admin/verbs/deadsay.dm
index 74596c333cc..690cac87536 100644
--- a/code/modules/admin/verbs/deadsay.dm
+++ b/code/modules/admin/verbs/deadsay.dm
@@ -17,24 +17,24 @@
to_chat(src, "You have deadchat muted.")
return
- if (handle_spam_prevention(msg,MUTE_DEADCHAT))
+ if(handle_spam_prevention(msg,MUTE_DEADCHAT))
return
var/stafftype = null
- if (check_rights(R_MENTOR, 0))
+ if(check_rights(R_MENTOR, 0))
stafftype = "MENTOR"
- if (check_rights(R_MOD, 0))
+ if(check_rights(R_MOD, 0))
stafftype = "MOD"
- if (check_rights(R_ADMIN, 0))
+ if(check_rights(R_ADMIN, 0))
stafftype = "ADMIN"
msg = sanitize(copytext(msg, 1, MAX_MESSAGE_LEN))
log_admin("[key_name(src)] : [msg]")
- if (!msg)
+ if(!msg)
return
var/prefix = "[stafftype] ([src.key])"
diff --git a/code/modules/admin/verbs/debug.dm b/code/modules/admin/verbs/debug.dm
index f8358411b9f..01f6736e5ca 100644
--- a/code/modules/admin/verbs/debug.dm
+++ b/code/modules/admin/verbs/debug.dm
@@ -194,7 +194,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
return
var/turf/T = mob.loc
- if (!( istype(T, /turf) ))
+ if(!( istype(T, /turf) ))
return
var/datum/gas_mixture/env = T.return_air()
@@ -399,12 +399,12 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
if(!check_rights(R_EVENT))
return
- if (!ticker)
+ if(!ticker)
alert("Wait until the game starts")
return
- if (istype(M, /mob/living/carbon/human))
+ if(istype(M, /mob/living/carbon/human))
var/mob/living/carbon/human/H = M
- if (H.wear_id)
+ if(H.wear_id)
var/obj/item/weapon/card/id/id = H.wear_id
if(istype(H.wear_id, /obj/item/device/pda))
var/obj/item/device/pda/pda = H.wear_id
@@ -593,66 +593,85 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
"tournament janitor",
"pirate",
"space pirate",
+ "soviet tourist",
+ "soviet soldier",
"soviet admiral",
"tunnel clown",
+ "mime assassin",
+ "survivor",
+ "greytide",
+ "greytide leader",
+ "greytide xeno",
"masked killer",
"singuloth knight",
"dark lord",
"assassin",
+ "spy",
+ "vox",
"death commando",
- "syndicate commando",
+ "syndicate agent",
+ "syndicate operative",
+ "syndicate bomber",
+ "syndicate strike team",
+ "syndicate officer",
"chrono legionnaire",
- "special ops officer",
- "special ops formal",
"blue wizard",
"red wizard",
"marisa wizard",
"emergency response team member",
"emergency response team leader",
- "nanotrasen officer",
- "nanotrasen captain",
+ "nt vip guest",
+ "nt navy officer", // now in jobs list
+ "nt navy captain",
+ "nt special ops officer", // now in jobs list
+ "nt special ops formal",
)
- var/dostrip = input("Do you want to strip [M] before equipping them? (0=no, 1=yes)", "STRIPTEASE") as null|anything in list(0,1)
- if(isnull(dostrip))
- return
+ var/dostrip = 0
+ switch(alert("Strip [M] before dressing?", "Strip?", "Yes", "No", "Cancel"))
+ if("Yes")
+ dostrip = 1
+ if("Cancel")
+ return
var/dresscode = input("Select dress for [M]", "Robust quick dress shop") as null|anything in dresspacks
- if (isnull(dresscode))
+ if(isnull(dresscode))
return
-
var/datum/job/jobdatum
- if (dresscode == "as job...")
+ if(dresscode == "as job...")
var/jobname = input("Select job", "Robust quick dress shop") as null|anything in get_all_jobs()
jobdatum = job_master.GetJob(jobname)
- feedback_add_details("admin_verb","SEQ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
+ feedback_add_details("admin_verb", "SEQ") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
if(dostrip)
- for (var/obj/item/I in M)
- if (istype(I, /obj/item/weapon/implant))
+ for(var/obj/item/I in M)
+ if(istype(I, /obj/item/weapon/implant))
continue
if(istype(I, /obj/item/organ))
continue
qdel(I)
switch(dresscode)
- if ("strip")
+ if("strip")
//do nothing
- if ("as job...")
+ if("as job...")
if(jobdatum)
dresscode = "[jobdatum.title]"
jobdatum.equip(M)
+ equip_special_id(M,jobdatum.access,jobdatum.title, jobdatum.idtype)
- if ("standard space gear")
+ if("standard space gear")
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
-
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
var /obj/item/weapon/tank/jetpack/J = new /obj/item/weapon/tank/jetpack/oxygen(M)
M.equip_to_slot_or_del(J, slot_back)
- J.toggle()
+ J.turn_on()
M.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(M), slot_wear_mask)
J.Topic(null, list("stat" = 1))
- if ("Engineer RIG","CE RIG","Mining RIG","Syndi RIG","Wizard RIG","Medical RIG","Atmos RIG")
+ equip_special_id(M,get_all_accesses(), "Space Explorer", /obj/item/weapon/card/id)
+
+ if("Engineer RIG", "CE RIG", "Mining RIG", "Syndi RIG", "Wizard RIG", "Medical RIG", "Atmos RIG")
if(dresscode=="Engineer RIG")
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig(M), slot_head)
@@ -676,61 +695,53 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/atmos(M), slot_head)
var /obj/item/weapon/tank/jetpack/J = new /obj/item/weapon/tank/jetpack/oxygen(M)
M.equip_to_slot_or_del(J, slot_back)
- J.toggle()
+ J.turn_on()
M.equip_to_slot_or_del(new /obj/item/clothing/mask/breath(M), slot_wear_mask)
+ equip_special_id(M,get_all_accesses(), "RIG Tester", /obj/item/weapon/card/id)
J.Topic(null, list("stat" = 1))
- if ("tournament standard red","tournament standard green") //we think stunning weapon is too overpowered to use it on tournaments. --rastaf0
- if (dresscode=="tournament standard red")
+ if("tournament standard red", "tournament standard green") //we think stunning weapon is too overpowered to use it on tournaments. --rastaf0
+ if(dresscode=="tournament standard red")
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/red(M), slot_w_uniform)
else
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/green(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
-
M.equip_to_slot_or_del(new /obj/item/clothing/suit/armor/vest(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/thunderdome(M), slot_head)
-
M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse/destroyer(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/knife(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/grenade/smokebomb(M), slot_r_store)
-
- if ("tournament gangster") //gangster are supposed to fight each other. --rastaf0
+ if("tournament gangster") //gangster are supposed to fight each other. --rastaf0
M.equip_to_slot_or_del(new /obj/item/clothing/under/det(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
-
M.equip_to_slot_or_del(new /obj/item/clothing/suit/storage/det_suit(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/head/det_hat(M), slot_head)
-
-
M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/proto(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_l_store)
- if ("tournament chef") //Steven Seagal FTW
+ if("tournament chef") //Steven Seagal FTW
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/chef(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/chef(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/head/chefhat(M), slot_head)
-
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/rollingpin(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/knife(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/knife(M), slot_r_store)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/knife(M), slot_s_store)
- if ("tournament janitor")
+ if("tournament janitor")
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/janitor(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
var/obj/item/weapon/storage/backpack/backpack = new(M)
for(var/obj/item/I in backpack)
del(I)
M.equip_to_slot_or_del(backpack, slot_back)
-
M.equip_to_slot_or_del(new /obj/item/weapon/mop(M), slot_r_hand)
var/obj/item/weapon/reagent_containers/glass/bucket/bucket = new(M)
bucket.reagents.add_reagent("water", 70)
M.equip_to_slot_or_del(bucket, slot_l_hand)
-
M.equip_to_slot_or_del(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), slot_r_store)
M.equip_to_slot_or_del(new /obj/item/weapon/grenade/chem_grenade/cleaner(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack)
@@ -741,51 +752,141 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/stack/tile/plasteel(M), slot_in_backpack)
- if ("pirate")
+ if("pirate")
M.equip_to_slot_or_del(new /obj/item/clothing/under/pirate(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/head/bandana(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/eyepatch(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/pirate(M), slot_r_hand)
+ equip_special_id(M,list(access_maint_tunnels), "Pirate", /obj/item/weapon/card/id)
- if ("space pirate")
+ if("space pirate") // not spaceworthy, just has fancier coat.
M.equip_to_slot_or_del(new /obj/item/clothing/under/pirate(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/pirate(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/pirate(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/eyepatch(M), slot_glasses)
-
M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/pirate(M), slot_r_hand)
+ equip_special_id(M,list(access_maint_tunnels), "Space Pirate", /obj/item/weapon/card/id)
- if ("soviet soldier")
- M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/head/ushanka(M), slot_head)
-
- if("tunnel clown")//Tunnel clowns rule!
+ if("tunnel clown")
M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/clown(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/clown_shoes(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/clown_hat(M), slot_wear_mask)
M.equip_to_slot_or_del(new /obj/item/clothing/head/chaplain_hood(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/chaplain_hoodie(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/snacks/grown/banana(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/weapon/bikehorn(M), slot_r_store)
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card (Tunnel Clown!)"
- W.access = get_all_accesses()
- W.assignment = "Tunnel Clown!"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
-
+ equip_special_id(M,list(access_clown, access_theatre, access_maint_tunnels), "Tunnel Clown", /obj/item/weapon/card/id)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M)
M.equip_to_slot_or_del(fire_axe, slot_r_hand)
+
+ if("mime assassin")
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/mime(M), slot_back)
+ if(M.gender == FEMALE)
+ M.equip_or_collect(new /obj/item/clothing/under/sexymime(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/mask/gas/sexymime(M), slot_wear_mask)
+ else
+ M.equip_or_collect(new /obj/item/clothing/under/mime(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/mask/gas/mime(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/beret(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle(M), slot_glasses)
+ M.equip_to_slot_or_del(new /obj/item/clothing/suit/suspenders(M), slot_wear_suit)
+ M.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/food/drinks/bottle/bottleofnothing(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/syndie_kit/caneshotgun, slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/toy/crayon/mime, slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/pistol(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/suppressor(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/incendiary/dragonsbreath(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_casing/shotgun/incendiary/dragonsbreath(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/pen/sleepy(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket(M), slot_in_backpack)
+ var/obj/item/device/pda/mime/pda = new(M)
+ pda.owner = M.real_name
+ pda.ownjob = "Mime"
+ pda.name = "PDA-[M.real_name] ([pda.ownjob])"
+ M.equip_to_slot_or_del(pda, slot_wear_pda)
+ equip_special_id(M,list(access_mime, access_theatre, access_maint_tunnels), "Mime", /obj/item/weapon/card/id/syndicate)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+
+ if("survivor")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/overalls(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/latex(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ equip_special_id(M,list(access_maint_tunnels), "Survivor", /obj/item/weapon/card/id)
+ for(var/obj/item/carried_item in M.contents)
+ if(!istype(carried_item, /obj/item/weapon/implant))
+ carried_item.add_blood(M)
+
+ if("greytide")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand)
+ M.equip_to_slot_or_del(new /obj/item/flag/grey(M), slot_r_hand)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Greytide", /obj/item/weapon/card/id)
+
+ if("greytide leader")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/color/grey(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/brown(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/toolbox/mechanical(M), slot_l_hand)
+ M.equip_to_slot_or_del(new /obj/item/flag/grey(M), slot_r_hand)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/welding(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Greytide Leader", /obj/item/weapon/card/id)
+
+ if("greytide xeno")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/color/black(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/clothing/suit/xenos(M), slot_wear_suit)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/xenos(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal(M), slot_glasses)
+ M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/double/full(M), slot_l_store)
+ M.equip_to_slot_or_del(new /obj/item/toy/toy_xeno(M), slot_r_store)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/welding(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Legit Xenomorph", /obj/item/weapon/card/id)
+
if("masked killer")
M.equip_to_slot_or_del(new /obj/item/clothing/under/overalls(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/white(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/latex(M), slot_gloves)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/surgical(M), slot_wear_mask)
@@ -795,46 +896,42 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/clothing/suit/apron(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/kitchen/knife(M), slot_l_store)
M.equip_to_slot_or_del(new /obj/item/weapon/scalpel(M), slot_r_store)
-
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Masked Killer", /obj/item/weapon/card/id/syndicate, "syndie")
var/obj/item/weapon/twohanded/fireaxe/fire_axe = new(M)
M.equip_to_slot_or_del(fire_axe, slot_r_hand)
-
for(var/obj/item/carried_item in M.contents)
- if(!istype(carried_item, /obj/item/weapon/implant))//If it's not an implant.
+ if(!istype(carried_item, /obj/item/weapon/implant))
carried_item.add_blood(M)//Oh yes, there will be blood...
if("dark lord")
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/black(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/dualsaber/red(M), slot_l_hand)
-
var/obj/item/clothing/head/chaplain_hood/hood = new(M)
hood.name = "dark lord hood"
M.equip_to_slot_or_del(hood, slot_head)
-
var/obj/item/clothing/suit/chaplain_hoodie/robe = new(M)
robe.name = "dark lord robes"
M.equip_to_slot_or_del(robe, slot_wear_suit)
-
- var/obj/item/weapon/card/id/syndicate/W = new(M)
- W.name = "[M.real_name]'s ID Card (Dark Lord)"
- W.icon_state = "syndie"
- W.access = get_all_accesses()
- W.assignment = "Dark Lord"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
+ equip_special_id(M,get_all_accesses(), "Dark Lord", /obj/item/weapon/card/id/syndicate, "syndie")
if("assassin")
M.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/wcoat(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/saber(M), slot_l_store)
-
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
var/obj/item/weapon/storage/secure/briefcase/sec_briefcase = new(M)
for(var/obj/item/briefcase_item in sec_briefcase)
qdel(briefcase_item)
@@ -843,163 +940,282 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
sec_briefcase.contents += new /obj/item/weapon/gun/energy/kinetic_accelerator/crossbow
sec_briefcase.contents += new /obj/item/weapon/gun/projectile/revolver/mateba
sec_briefcase.contents += new /obj/item/ammo_box/a357
- sec_briefcase.contents += new /obj/item/weapon/c4
+ sec_briefcase.contents += new /obj/item/weapon/grenade/plastic/c4
+ // briefcase must be unlocked by setting the code.
M.equip_to_slot_or_del(sec_briefcase, slot_l_hand)
-
+ var/obj/item/weapon/implant/dust/DUST = new /obj/item/weapon/implant/dust(M)
+ DUST.implant(M)
var/obj/item/device/pda/heads/pda = new(M)
pda.owner = M.real_name
pda.ownjob = "Reaper"
pda.name = "PDA-[M.real_name] ([pda.ownjob])"
+ M.equip_to_slot_or_del(pda, slot_wear_pda)
+ equip_special_id(M,get_all_accesses(), "Reaper", /obj/item/weapon/card/id/syndicate, "syndie")
+ if("spy")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/suit_jacket/really_black(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/automatic/pistol(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/suppressor(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/card/emag(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/hud/security/chameleon(M), slot_glasses)
+ var/obj/item/clothing/gloves/combat/G = new /obj/item/clothing/gloves/combat(src)
+ G.name = "black gloves"
+ M.equip_to_slot_or_del(G, slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/weapon/melee/energy/sword/saber(M), slot_l_store)
+ M.equip_to_slot_or_del(new /obj/item/weapon/pen/sleepy(M), slot_r_store)
+ var/obj/item/weapon/implant/dust/DUST = new /obj/item/weapon/implant/dust(M)
+ DUST.implant(M)
+ M.equip_to_slot_or_del(new /obj/item/weapon/implanter/storage(M), slot_in_backpack)
+ var/obj/item/device/pda/heads/pda = new(M)
+ pda.owner = M.real_name
+ pda.ownjob = "Spy"
+ pda.name = "PDA-[M.real_name] ([pda.ownjob])"
M.equip_to_slot_or_del(pda, slot_belt)
+ equip_special_id(M,list(access_maint_tunnels), "Spy", /obj/item/weapon/card/id/syndicate, "syndie")
- var/obj/item/weapon/card/id/syndicate/W = new(M)
- W.name = "[M.real_name]'s ID Card (Reaper)"
- W.icon_state = "syndie"
- W.access = get_all_accesses()
- W.assignment = "Reaper"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
- if("death commando")//Was looking to add this for a while.
+ if("vox")
+ if(istype(M, /mob/living/carbon/human/voxarmalis)) // have to do this, they cannot wear normal vox gear!
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/vox_grey(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/syndicate(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/vox/carapace(M), slot_wear_suit)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/vox/carapace(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/vox/vox_robes (M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/vox(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/weapon/card/id/syndicate/vox(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate, slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/yellow/vox, slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/weapon/melee/classic_baton/telescopic, slot_l_store)
+ M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/vox, slot_r_store)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/monocle, slot_glasses)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight, slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/restraints/handcuffs/cable/zipties, slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flash, slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/noisecannon, slot_in_backpack)
+ equip_special_id(M,get_all_accesses(), "Vox Armalis", /obj/item/weapon/card/id/syndicate/vox, "syndie")
+ else
+ M.equip_vox_raider()
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_l_hand)
+ M.regenerate_icons()
+
+ if("death commando")
M.equip_death_commando()
- if("syndicate commando")
+ if("syndicate agent")
+ M.equip_or_collect(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_or_collect(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/card/emag(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
+ equip_special_id(M,get_syndicate_access("Syndicate Operative"), "Syndicate Agent", /obj/item/weapon/card/id/syndicate, "syndie")
+ var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(M)
+ U.hidden_uplink.uplink_owner="[M.key]"
+ U.hidden_uplink.uses = 20
+ M.equip_to_slot_or_del(U, slot_r_store)
+
+ if("syndicate bomber")
+ M.equip_or_collect(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_or_collect(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/card/emag(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/beacon/syndicate/bomb(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/beacon/syndicate/bomb(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/syndicatedetonator(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/storage/belt/utility/full/multitool(M), slot_belt)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
+ equip_special_id(M,get_syndicate_access("Syndicate Operative"), "Syndicate Bomber", /obj/item/weapon/card/id/syndicate, "syndie")
+
+ if("syndicate operative")
+ M.equip_or_collect(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_or_collect(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/pill/initropidril(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/gun/projectile/automatic/pistol(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/ammo_box/magazine/m10mm(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/crowbar/red(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/clothing/glasses/night(M), slot_glasses)
+ M.equip_or_collect(new /obj/item/weapon/storage/belt/military(M), slot_belt)
+ M.equip_or_collect(new /obj/item/weapon/grenade/plastic/c4(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/pinpointer/advpinpointer(M), slot_l_store)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/clothing/mask/gas/syndicate(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/rig/syndi(M), slot_wear_suit)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/rig/syndi(M), slot_head)
+ var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate/alt(M)
+ R.set_frequency(SYND_FREQ)
+ M.equip_to_slot_or_del(R, slot_l_ear)
+ var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(M)
+ U.hidden_uplink.uplink_owner="[M.key]"
+ U.hidden_uplink.uses = 20
+ M.equip_to_slot_or_del(U, slot_r_store)
+ M.equip_or_collect(new /obj/item/weapon/tank/jetpack/oxygen/harness(M), slot_in_backpack)
+ equip_special_id(M,get_syndicate_access("Syndicate Operative"), "Syndicate Operative", /obj/item/weapon/card/id/syndicate, "syndie")
+ var/obj/item/weapon/implant/explosive/E = new/obj/item/weapon/implant/explosive(M)
+ E.implant(M)
+
+ if("syndicate strike team")
M.equip_syndicate_commando()
- if("nanotrasen officer")
+ if("syndicate officer")
+ M.equip_or_collect(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_or_collect(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/pill/initropidril(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/clothing/glasses/thermal(M), slot_glasses)
+ M.equip_or_collect(new /obj/item/weapon/storage/belt/military(M), slot_belt)
+ M.equip_or_collect(new /obj/item/weapon/pinpointer/advpinpointer(M), slot_l_store)
+ M.equip_or_collect(new /obj/item/weapon/reagent_containers/food/snacks/syndidonkpocket(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/clothing/mask/gas/syndicate(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/syndicate/black/red/strike(M), slot_wear_suit)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/syndicate/black/red/strike(M), slot_head)
+ var/obj/item/device/radio/R = new /obj/item/device/radio/headset/syndicate/alt(M)
+ R.set_frequency(SYND_FREQ)
+ M.equip_to_slot_or_del(R, slot_l_ear)
+ var/obj/item/device/radio/uplink/U = new /obj/item/device/radio/uplink(M)
+ U.hidden_uplink.uplink_owner="[M.key]"
+ U.hidden_uplink.uses = 50
+ M.equip_to_slot_or_del(U, slot_r_store)
+ M.equip_or_collect(new /obj/item/weapon/tank/jetpack/oxygen/harness(M), slot_in_backpack)
+ equip_special_id(M,get_all_accesses() + get_syndicate_access("Syndicate Commando"), "Syndicate Officer", /obj/item/weapon/card/id/syndicate, "commander")
+ var/obj/item/weapon/implant/dust/DUST = new /obj/item/weapon/implant/dust(M)
+ DUST.implant(M)
+ if("nt vip guest")
+ M.equip_or_collect(new /obj/item/clothing/under/suit_jacket/really_black(M), slot_w_uniform)
+ M.equip_or_collect(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_or_collect(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
+ M.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/clothing/head/that(M), slot_head)
+ M.equip_or_collect(new /obj/item/device/radio/headset/ert(M), slot_l_ear)
+ M.equip_or_collect(new /obj/item/device/pda/(M), slot_wear_pda)
+ equip_special_id(M,get_centcom_access("VIP Guest"), "VIP Guest", /obj/item/weapon/card/id/centcom)
+
+ if("nt navy officer")
M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/officer(M), slot_w_uniform)
M.equip_or_collect(new /obj/item/clothing/shoes/centcom(M), slot_shoes)
M.equip_or_collect(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
- M.equip_or_collect(new /obj/item/device/radio/headset/ert(M), slot_l_ear)
+ M.equip_or_collect(new /obj/item/device/radio/headset/centcom(M), slot_l_ear)
M.equip_or_collect(new /obj/item/clothing/head/beret/centcom/officer(M), slot_head)
M.equip_or_collect(new /obj/item/device/pda/centcom(M), slot_wear_pda)
M.equip_or_collect(new /obj/item/clothing/glasses/hud/security/sunglasses(M), slot_glasses)
M.equip_or_collect(new /obj/item/weapon/gun/energy/pulse/pistol(M), slot_belt)
M.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
-
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/implanter/dust(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/implanter/death_alarm(M), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(M)
L.imp_in = M
L.implanted = 1
M.sec_hud_set_implants()
+ equip_special_id(M,get_centcom_access("Nanotrasen Navy Officer"), "Nanotrasen Navy Officer", /obj/item/weapon/card/id/centcom)
- var/obj/item/weapon/card/id/centcom/W = new(M)
- W.name = "[M.real_name]'s ID Card (Nanotrasen Navy Officer)"
- W.assignment = "Nanotrasen Navy Officer"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_or_collect(W, slot_wear_id)
-
- if("nanotrasen captain")
+ if("nt navy captain")
M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform)
M.equip_or_collect(new /obj/item/clothing/shoes/centcom(M), slot_shoes)
M.equip_or_collect(new /obj/item/clothing/gloves/color/white(M), slot_gloves)
- M.equip_or_collect(new /obj/item/device/radio/headset/ert(M), slot_l_ear)
+ M.equip_or_collect(new /obj/item/device/radio/headset/centcom(M), slot_l_ear)
M.equip_or_collect(new /obj/item/clothing/head/beret/centcom/captain(M), slot_head)
M.equip_or_collect(new /obj/item/device/pda/centcom(M), slot_wear_pda)
M.equip_or_collect(new /obj/item/clothing/glasses/hud/security/sunglasses(M), slot_glasses)
M.equip_or_collect(new /obj/item/weapon/gun/energy/pulse/pistol(M), slot_belt)
M.equip_or_collect(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/implanter/dust(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/implanter/death_alarm(M), slot_in_backpack)
var/obj/item/weapon/implant/loyalty/L = new/obj/item/weapon/implant/loyalty(M)
L.imp_in = M
L.implanted = 1
M.sec_hud_set_implants()
+ equip_special_id(M,get_centcom_access("Nanotrasen Navy Captain"), "Nanotrasen Navy Captain", /obj/item/weapon/card/id/centcom)
- var/obj/item/weapon/card/id/centcom/W = new(M)
- W.name = "[M.real_name]'s ID Card (Nanotrasen Navy Captain)"
- W.access = get_all_accesses()
- W.assignment = "Nanotrasen Navy Captain"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_or_collect(W, slot_wear_id)
+ if("emergency response team member", "emergency response team leader")
+ var/datum/response_team/equip_team = null
+ switch(alert("Level", "Emergency Response Team", "Amber", "Red", "Gamma"))
+ if("Amber")
+ equip_team = new /datum/response_team/amber
+ if("Red")
+ equip_team = new /datum/response_team/red
+ if("Gamma")
+ equip_team = new /datum/response_team/gamma
+ if(!equip_team)
+ return
+ if(dresscode == "emergency response team leader")
+ equip_team.equip_officer("Commander", M)
+ else
+ switch(alert("Loadout Type", "Emergency Response Team", "Security", "Engineer", "Medic"))
+ if("Commander")
+ equip_team.equip_officer("Commander", M)
+ if("Security")
+ equip_team.equip_officer("Security", M)
+ if("Engineer")
+ equip_team.equip_officer("Engineer", M)
+ if("Medic")
+ equip_team.equip_officer("Medic", M)
+ else
+ to_chat(src, "Invalid ERT Loadout selected")
- if("emergency response team member")
- M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(M), slot_l_ear)
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun(M), slot_belt)
- M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/ert(M), slot_back)
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card (Emergency Response Team - Member)"
- W.icon_state = "ERT_empty"
- W.assignment = "Emergency Response Team Member"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
-
- var/obj/item/device/pda/centcom/pda = new(M)
- pda.owner = M.real_name
- pda.ownjob = "Emergency Response Team"
- pda.name = "PDA-[M.real_name] ([pda.ownjob])"
-
- if("emergency response team leader")
- M.equip_to_slot_or_del(new /obj/item/clothing/under/rank/centcom_officer(M), slot_w_uniform)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(M), slot_l_ear)
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/gun(M), slot_belt)
- M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/ert/commander(M), slot_back)
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card (Emergency Response Team - Leader)"
- W.icon_state = "ERT_leader"
- W.assignment = "Emergency Response Team Leader"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
-
- var/obj/item/device/pda/centcom/pda = new(M)
- pda.owner = M.real_name
- pda.ownjob = "Emergency Response Team Leader"
- pda.name = "PDA-[M.real_name] ([pda.ownjob])"
-
- if("special ops officer")
+ if("nt special ops officer")
M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate/combat(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/centcom(src), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head) // job has /obj/item/clothing/head/beret/centcom/officer/navy
+ M.equip_to_slot_or_del(new /obj/item/device/pda/centcom(M), slot_wear_pda)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/cyber(M), slot_glasses) // job has /obj/item/clothing/glasses/hud/security/sunglasses
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse/pistol/m1911(M), slot_belt)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/security(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/space/deathsquad/officer(M), slot_wear_suit)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(src), slot_l_ear)
- M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/cyber(M), slot_glasses)
- M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), slot_wear_mask)
- M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head)
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse/pistol/m1911(M), slot_belt)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_r_store)
- M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/dualsaber/red(M), slot_l_store)
-
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
- M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/sechailer/swat(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/double/full(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/implanter/dust(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/implanter/death_alarm(M), slot_in_backpack)
+ equip_special_id(M,get_centcom_access("Special Operations Officer"), "Special Operations Officer", /obj/item/weapon/card/id/centcom)
+ // The following items are unique to this outfit - the special ops officer job does not spawn with them.
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/gas/sechailer/swat(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/dualsaber/red(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/pinpointer/advpinpointer(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/weapon/reagent_containers/hypospray/combat/nanites(M), slot_in_backpack)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/flashbangs(src), slot_in_backpack)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/zipties(src), slot_in_backpack)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/syndie/advance(src), slot_in_backpack)
-
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card"
- W.icon_state = "commander"
- W.assignment = "Special Operations Officer"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
-
- if("special ops formal")
- M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset/ert/alt(src), slot_l_ear)
- M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
- M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head)
- M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/cyber(M), slot_glasses)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/flashbangs(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/zipties(M), slot_in_backpack)
M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), slot_wear_mask)
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse/pistol/m1911(M), slot_belt)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_r_store)
- M.equip_or_collect(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_l_store)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/magboots/advance(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/implanter/loyalty(M), slot_in_backpack)
+
+ if("nt special ops formal")
+ M.equip_or_collect(new /obj/item/clothing/under/rank/centcom/captain(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/centcom(src), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/deathsquad/beret(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/cyber(M), slot_glasses) // special
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/energy/pulse/pistol/m1911(M), slot_belt)
+ M.equip_to_slot_or_del(new /obj/item/clothing/mask/cigarette/cigar/cohiba(M), slot_wear_mask)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_or_collect(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/matches(M), slot_r_store)
+ M.equip_or_collect(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_in_backpack)
var/obj/item/device/pda/centcom/pda = new(M)
pda.owner = M.real_name
@@ -1009,17 +1225,9 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
pda.desc = "A portable microcomputer by Thinktronic Systems, LTD. This is model is a special edition designed for military field work."
M.equip_or_collect(pda, slot_wear_pda)
-
- M.equip_or_collect(new /obj/item/clothing/glasses/sunglasses(M), slot_l_store)
- M.equip_or_collect(new /obj/item/weapon/melee/classic_baton/telescopic(M), slot_r_store)
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card (Special Operations Officer)"
- W.icon_state = "commander"
- W.assignment = "Special Operations Officer"
- W.access = get_centcom_access(W.assignment)
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
+ M.equip_or_collect(new /obj/item/weapon/implanter/dust(M), slot_in_backpack)
+ M.equip_or_collect(new /obj/item/weapon/implanter/death_alarm(M), slot_in_backpack)
+ equip_special_id(M,get_centcom_access("Special Operations Officer"), "Special Operations Officer", /obj/item/weapon/card/id/centcom)
if("singuloth knight")
M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate/combat(M), slot_w_uniform)
@@ -1033,16 +1241,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/claymore/ceremonial(M), slot_belt)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/oxygen(M), slot_s_store)
M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/knighthammer(M), slot_back)
-
-
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card (Singuloth Knight)"
- W.icon_state = "syndie"
- W.access = get_all_accesses()
- W.access += get_all_centcom_access()
- W.assignment = "Singuloth Knight"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
+ equip_special_id(M,get_all_accesses(), "Singuloth Knight", /obj/item/weapon/card/id)
if("blue wizard")
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(M), slot_w_uniform)
@@ -1054,7 +1253,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/spellbook(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/staff(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ equip_special_id(M,get_all_accesses(), "Wizard", /obj/item/weapon/card/id)
if("red wizard")
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(M), slot_w_uniform)
@@ -1066,7 +1266,8 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/spellbook(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/staff(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ equip_special_id(M,get_all_accesses(), "Wizard", /obj/item/weapon/card/id)
if("marisa wizard")
M.equip_to_slot_or_del(new /obj/item/clothing/under/color/lightpurple(M), slot_w_uniform)
@@ -1078,26 +1279,54 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/spellbook(M), slot_r_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/twohanded/staff(M), slot_l_hand)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack(M), slot_back)
- M.equip_to_slot_or_del(new /obj/item/weapon/storage/box(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ equip_special_id(M,get_all_accesses(), "Wizard", /obj/item/weapon/card/id)
+
+ if("soviet tourist")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/ushanka(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/black(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/color/black(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/survival(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Soviet Tourist", /obj/item/weapon/card/id)
+
+ if("soviet soldier")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform)
+ M.equip_to_slot_or_del(new /obj/item/clothing/head/ushanka(M), slot_head)
+ M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
+ M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/clothing/glasses/sunglasses(M), slot_glasses)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/card/emag(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/device/flashlight(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/grenade/plastic/c4(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/grenade/plastic/c4(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/revolver/mateba(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ equip_special_id(M,list(access_maint_tunnels), "Soviet Soldier", /obj/item/weapon/card/id)
if("soviet admiral")
+ M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/clothing/head/hgpiratecap(M), slot_head)
M.equip_to_slot_or_del(new /obj/item/clothing/shoes/combat(M), slot_shoes)
M.equip_to_slot_or_del(new /obj/item/clothing/gloves/combat(M), slot_gloves)
- M.equip_to_slot_or_del(new /obj/item/device/radio/headset/heads/captain(M), slot_l_ear)
+ M.equip_to_slot_or_del(new /obj/item/device/radio/headset/syndicate(M), slot_l_ear)
M.equip_to_slot_or_del(new /obj/item/clothing/glasses/thermal/eyepatch(M), slot_glasses)
M.equip_to_slot_or_del(new /obj/item/clothing/suit/hgpirate(M), slot_wear_suit)
M.equip_to_slot_or_del(new /obj/item/weapon/storage/backpack/satchel(M), slot_back)
- M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/revolver/mateba(M), slot_belt)
- M.equip_to_slot_or_del(new /obj/item/clothing/under/soviet(M), slot_w_uniform)
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card"
- W.icon_state = "commander"
- W.access = get_all_accesses()
- W.access += get_all_centcom_access()
- W.assignment = "Admiral"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
+ M.equip_to_slot_or_del(new /obj/item/weapon/storage/box/engineer(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/weapon/gun/projectile/revolver/mateba(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ M.equip_to_slot_or_del(new /obj/item/ammo_box/a357(M), slot_in_backpack)
+ equip_special_id(M,get_all_accesses() + get_all_centcom_access(), "Soviet Admiral", /obj/item/weapon/card/id, "commander")
+ //W.icon_state = "commander"
if("chrono legionnaire")
M.equip_to_slot_or_del(new /obj/item/clothing/head/helmet/space/chronos(M), slot_head)
@@ -1109,12 +1338,7 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
M.equip_to_slot_or_del(new /obj/item/weapon/chrono_eraser(M), slot_back)
M.equip_to_slot_or_del(new /obj/item/clothing/under/syndicate(M), slot_w_uniform)
M.equip_to_slot_or_del(new /obj/item/weapon/tank/emergency_oxygen/double/full(src), slot_s_store)
- var/obj/item/weapon/card/id/W = new(M)
- W.name = "[M.real_name]'s ID Card"
- W.icon_state = "syndie"
- W.assignment = "Chrono Legionnaire"
- W.registered_name = M.real_name
- M.equip_to_slot_or_del(W, slot_wear_id)
+ equip_special_id(M,get_all_accesses() + get_all_centcom_access(), "Chrono Legionnaire", /obj/item/weapon/card/id/syndicate, "syndie")
M.regenerate_icons()
@@ -1122,6 +1346,19 @@ But you can call procs that are of type /mob/living/carbon/human/proc/ for that
message_admins("\blue [key_name_admin(usr)] changed the equipment of [key_name_admin(M)] to [dresscode].", 1)
return
+/client/proc/equip_special_id(var/mob/living/carbon/human/H, var/list/theaccess = null, var/jobtext, var/obj/item/weapon/card/id/id_type = /obj/item/weapon/card/id, var/special_icon = null)
+ if(!check_rights(R_EVENT))
+ return
+
+ var/obj/item/weapon/card/id/W = new id_type(H)
+ if(special_icon)
+ W.icon_state = special_icon
+ W.name = "[H.real_name]'s ID Card ([jobtext])"
+ W.access = theaccess
+ W.assignment = "[jobtext]"
+ W.registered_name = H.real_name
+ H.equip_to_slot_or_del(W, slot_wear_id)
+
/client/proc/startSinglo()
set category = "Debug"
set name = "Start Singularity"
diff --git a/code/modules/admin/verbs/diagnostics.dm b/code/modules/admin/verbs/diagnostics.dm
index 70505b8abdf..9b9a7c6caae 100644
--- a/code/modules/admin/verbs/diagnostics.dm
+++ b/code/modules/admin/verbs/diagnostics.dm
@@ -83,20 +83,20 @@
"_default" = "NO_FILTER"
)
var/output = "Radio Report"
- for (var/fq in radio_controller.frequencies)
+ for(var/fq in radio_controller.frequencies)
output += "Freq: [fq] "
var/list/datum/radio_frequency/fqs = radio_controller.frequencies[fq]
- if (!fqs)
+ if(!fqs)
output += " ERROR "
continue
- for (var/filter in fqs.devices)
+ for(var/filter in fqs.devices)
var/list/f = fqs.devices[filter]
- if (!f)
+ if(!f)
output += " [filters[filter]]: ERROR "
continue
output += " [filters[filter]]: [f.len] "
- for (var/device in f)
- if (isobj(device))
+ for(var/device in f)
+ if(isobj(device))
output += " [device] ([device:x],[device:y],[device:z] in area [get_area(device:loc)]) "
else
output += " [device] "
diff --git a/code/modules/admin/verbs/freeze.dm b/code/modules/admin/verbs/freeze.dm
index f6d31d6bede..3537dd3d6df 100644
--- a/code/modules/admin/verbs/freeze.dm
+++ b/code/modules/admin/verbs/freeze.dm
@@ -93,7 +93,7 @@ var/global/list/frozen_mob_list = list()
return
else
if(usr)
- if (usr.client)
+ if(usr.client)
if(usr.client.holder)
var/adminomaly = new/obj/effect/overlay/adminoverlay
if(M.can_move == 1)
diff --git a/code/modules/admin/verbs/honksquad.dm b/code/modules/admin/verbs/honksquad.dm
index dd37a828302..1b49cb4c294 100644
--- a/code/modules/admin/verbs/honksquad.dm
+++ b/code/modules/admin/verbs/honksquad.dm
@@ -50,7 +50,7 @@ var/global/sent_honksquad = 0
//Spawns HONKsquad and equips them.
for(var/obj/effect/landmark/L in landmarks_list)
if(honksquad_number<=0) break
- if (L.name == "HONKsquad")
+ if(L.name == "HONKsquad")
honk_leader_selected = honksquad_number == 1?1:0
var/mob/living/carbon/human/new_honksquad = create_honksquad(L, honk_leader_selected)
@@ -59,7 +59,7 @@ var/global/sent_honksquad = 0
new_honksquad.key = pick(commandos)
commandos -= new_honksquad.key
new_honksquad.internal = new_honksquad.s_store
- new_honksquad.internals.icon_state = "internal1"
+ new_honksquad.update_internals_hud_icon(1)
//So they don't forget their code or mission.
new_honksquad.mind.store_memory("Mission: \red [input].")
diff --git a/code/modules/admin/verbs/map_template_loadverb.dm b/code/modules/admin/verbs/map_template_loadverb.dm
index fc010de8a43..f447810d860 100644
--- a/code/modules/admin/verbs/map_template_loadverb.dm
+++ b/code/modules/admin/verbs/map_template_loadverb.dm
@@ -1,10 +1,9 @@
/client/proc/map_template_load()
set category = "Debug"
- set name = "Map Template - Place"
+ set name = "Map template - Place"
if(!holder)
return
-
var/datum/map_template/template
var/map = input(usr, "Choose a Map Template to place at your CURRENT LOCATION","Place Map Template") as null|anything in map_templates
@@ -16,22 +15,27 @@
if(!T)
return
+ if(!template.fits_in_map_bounds(T, centered = TRUE))
+ to_chat(usr, "Map is too large to fit in bounds. Map's dimensions: ([template.width], [template.height])")
+ return
+
var/list/preview = list()
for(var/S in template.get_affected_turfs(T,centered = TRUE))
preview += image('icons/turf/overlays.dmi',S,"greenOverlay")
usr.client.images += preview
if(alert(usr,"Confirm location.","Template Confirm","Yes","No") == "Yes")
- template.load(T, centered = TRUE)
- message_admins("[key_name_admin(usr)] has placed a map template ([template.name]) at (JMP)")
+ var/timer = start_watch()
+ message_admins("[key_name_admin(usr)] has started to place the map template ([template.name]) at (JMP)")
+ if(template.load(T, centered = TRUE))
+ message_admins("[key_name_admin(usr)] has placed a map template ([template.name]) at (JMP). Took [stop_watch(timer)]s.")
+ else
+ to_chat(usr, "Failed to place map")
usr.client.images -= preview
/client/proc/map_template_upload()
set category = "Debug"
set name = "Map Template - Upload"
- if(!holder)
- return
-
var/map = input(usr, "Choose a Map Template to upload to template storage","Upload Map Template") as null|file
if(!map)
return
@@ -39,7 +43,12 @@
to_chat(usr, "Bad map file: [map]")
return
+ var/timer = start_watch()
+ message_admins("[key_name_admin(usr)] has begun uploading a map template ([map])")
var/datum/map_template/M = new(map=map, rename="[map]")
- M.preload_size(map)
- map_templates[M.name] = M
- message_admins("[key_name_admin(usr)] has uploaded a map template ([map])")
+ if(M.preload_size(map))
+ to_chat(usr, "Map template '[map]' ready to place ([M.width]x[M.height])")
+ map_templates[M.name] = M
+ message_admins("[key_name_admin(usr)] has uploaded a map template ([map]). Took [stop_watch(timer)]s.")
+ else
+ to_chat(usr, "Map template '[map]' failed to load properly")
diff --git a/code/modules/admin/verbs/mapping.dm b/code/modules/admin/verbs/mapping.dm
index c59cd417c91..6578898a0bd 100644
--- a/code/modules/admin/verbs/mapping.dm
+++ b/code/modules/admin/verbs/mapping.dm
@@ -86,7 +86,7 @@ var/intercom_range_display_status = 0
if(!(locate(/obj/structure/grille,T)))
var/window_check = 0
for(var/obj/structure/window/W in T)
- if (W.dir == turn(C1.dir,180) || W.is_fulltile() )
+ if(W.dir == turn(C1.dir,180) || W.is_fulltile() )
window_check = 1
break
if(!window_check)
@@ -115,7 +115,7 @@ var/intercom_range_display_status = 0
for(var/obj/item/device/radio/intercom/I in world)
for(var/turf/T in orange(7,I))
var/obj/effect/debugging/marker/F = new/obj/effect/debugging/marker(T)
- if (!(F in view(7,I.loc)))
+ if(!(F in view(7,I.loc)))
qdel(F)
feedback_add_details("admin_verb","mIRD") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
diff --git a/code/modules/admin/verbs/massmodvar.dm b/code/modules/admin/verbs/massmodvar.dm
index c861531714c..c416f224cf9 100644
--- a/code/modules/admin/verbs/massmodvar.dm
+++ b/code/modules/admin/verbs/massmodvar.dm
@@ -34,7 +34,7 @@
return
var/list/names = list()
- for (var/V in O.vars)
+ for(var/V in O.vars)
names += V
names = sortList(names)
@@ -123,7 +123,7 @@
var/original_name
- if (!istype(O, /atom))
+ if(!istype(O, /atom))
original_name = "\ref[O] ([O])"
else
original_name = O:name
@@ -135,33 +135,33 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
if("edit referenced object")
@@ -175,32 +175,32 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
if("num")
@@ -216,7 +216,7 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
if(variable=="light_range")
M.set_light(new_value)
else
@@ -224,7 +224,7 @@
else if(istype(O, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
if(variable=="light_range")
A.set_light(new_value)
else
@@ -232,7 +232,7 @@
else if(istype(O, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
if(variable=="light_range")
A.set_light(new_value)
else
@@ -241,7 +241,7 @@
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
if(variable=="light_range")
M.set_light(new_value)
else
@@ -249,7 +249,7 @@
else if(istype(O, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
if(variable=="light_range")
A.set_light(new_value)
else
@@ -257,7 +257,7 @@
else if(istype(O, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
if(variable=="light_range")
A.set_light(new_value)
else
@@ -271,32 +271,32 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
if("file")
@@ -307,32 +307,32 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
else if(istype(O.type, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else if(istype(O.type, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
M.vars[variable] = O.vars[variable]
else if(istype(O.type, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
else if(istype(O.type, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
if("icon")
@@ -342,33 +342,33 @@
if(method)
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if ( istype(M , O.type) )
+ if( istype(M , O.type) )
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if ( istype(A , O.type) )
+ if( istype(A , O.type) )
A.vars[variable] = O.vars[variable]
else
if(istype(O, /mob))
for(var/mob/M in mob_list)
- if (M.type == O.type)
+ if(M.type == O.type)
M.vars[variable] = O.vars[variable]
else if(istype(O, /obj))
for(var/obj/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
else if(istype(O, /turf))
for(var/turf/A in world)
- if (A.type == O.type)
+ if(A.type == O.type)
A.vars[variable] = O.vars[variable]
log_admin("[key_name(src)] mass modified [original_name]'s [variable] to [O.vars[variable]]")
diff --git a/code/modules/admin/verbs/modifyvariables.dm b/code/modules/admin/verbs/modifyvariables.dm
index a6aa95a359d..0be55889bc2 100644
--- a/code/modules/admin/verbs/modifyvariables.dm
+++ b/code/modules/admin/verbs/modifyvariables.dm
@@ -17,7 +17,7 @@ var/list/forbidden_varedit_object_types = list(
set category = "Debug"
set name = "Edit Ticker Variables"
- if (ticker == null)
+ if(ticker == null)
to_chat(src, "Game hasn't started yet.")
else
src.modify_variables(ticker)
@@ -308,7 +308,7 @@ var/list/forbidden_varedit_object_types = list(
else
var/list/names = list()
- for (var/V in O.vars)
+ for(var/V in O.vars)
names += V
names = sortList(names)
@@ -347,7 +347,7 @@ var/list/forbidden_varedit_object_types = list(
var/original_name
- if (!istype(O, /atom))
+ if(!istype(O, /atom))
original_name = "\ref[O] ([O])"
else
original_name = O:name
diff --git a/code/modules/admin/verbs/one_click_antag.dm b/code/modules/admin/verbs/one_click_antag.dm
index 5fb8335732d..5506b3b9076 100644
--- a/code/modules/admin/verbs/one_click_antag.dm
+++ b/code/modules/admin/verbs/one_click_antag.dm
@@ -62,7 +62,7 @@ client/proc/one_click_antag()
if(player_old_enough_antag(applicant.client,ROLE_TRAITOR))
if(!applicant.stat)
if(applicant.mind)
- if (!applicant.mind.special_role)
+ if(!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "traitor") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.mind.assigned_role in temp.restricted_jobs))
if(!(applicant.client.prefs.species in temp.protected_species))
@@ -96,7 +96,7 @@ client/proc/one_click_antag()
if(player_old_enough_antag(applicant.client,ROLE_CHANGELING))
if(!applicant.stat)
if(applicant.mind)
- if (!applicant.mind.special_role)
+ if(!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "changeling") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.mind.assigned_role in temp.restricted_jobs))
if(!(applicant.client.prefs.species in temp.protected_species))
@@ -277,13 +277,13 @@ client/proc/one_click_antag()
if(closet_spawn)
new /obj/structure/closet/syndicate/nuclear(closet_spawn.loc)
- for (var/obj/effect/landmark/A in /area/syndicate_station/start)//Because that's the only place it can BE -Sieve
- if (A.name == "Syndicate-Gear-Closet")
+ for(var/obj/effect/landmark/A in /area/syndicate_station/start)//Because that's the only place it can BE -Sieve
+ if(A.name == "Syndicate-Gear-Closet")
new /obj/structure/closet/syndicate/personal(A.loc)
qdel(A)
continue
- if (A.name == "Syndicate-Bomb")
+ if(A.name == "Syndicate-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(A.loc)
qdel(A)
continue
@@ -303,7 +303,7 @@ client/proc/one_click_antag()
var/I = image('icons/mob/mob.dmi', loc = synd_mind_1.current, icon_state = "synd")
synd_mind.current.client.images += I
- for (var/obj/machinery/nuclearbomb/bomb in world)
+ for(var/obj/machinery/nuclearbomb/bomb in world)
bomb.r_code = nuke_code // All the nukes are set to this code.
return 1
@@ -356,10 +356,10 @@ client/proc/one_click_antag()
if(candidates.len)
var/numagents = 6
//Spawns commandos and equips them.
- for (var/obj/effect/landmark/L in /area/syndicate_mothership/elite_squad)
+ for(var/obj/effect/landmark/L in /area/syndicate_mothership/elite_squad)
if(numagents<=0)
break
- if (L.name == "Syndicate-Commando")
+ if(L.name == "Syndicate-Commando")
syndicate_leader_selected = numagents == 1?1:0
var/mob/living/carbon/human/new_syndicate_commando = create_syndicate_death_commando(L, syndicate_leader_selected)
@@ -375,7 +375,7 @@ client/proc/one_click_antag()
new_syndicate_commando.key = theghost.key
new_syndicate_commando.internal = new_syndicate_commando.s_store
- new_syndicate_commando.internals.icon_state = "internal1"
+ new_syndicate_commando.update_internals_hud_icon(1)
//So they don't forget their code or mission.
@@ -386,8 +386,8 @@ client/proc/one_click_antag()
if(numagents >= 6)
return 0
- for (var/obj/effect/landmark/L in /area/shuttle/syndicate_elite)
- if (L.name == "Syndicate-Commando-Bomb")
+ for(var/obj/effect/landmark/L in /area/shuttle/syndicate_elite)
+ if(L.name == "Syndicate-Commando-Bomb")
new /obj/effect/spawner/newbomb/timer/syndicate(L.loc)
return 1
@@ -469,7 +469,7 @@ client/proc/one_click_antag()
var/max_raiders = 1
var/raiders = max_raiders
//Spawns vox raiders and equips them.
- for (var/obj/effect/landmark/L in world)
+ for(var/obj/effect/landmark/L in world)
if(L.name == "voxstart")
if(raiders<=0)
break
@@ -551,7 +551,7 @@ client/proc/one_click_antag()
if(player_old_enough_antag(applicant.client,ROLE_VAMPIRE))
if(!applicant.stat)
if(applicant.mind)
- if (!applicant.mind.special_role)
+ if(!applicant.mind.special_role)
if(!jobban_isbanned(applicant, "vampire") && !jobban_isbanned(applicant, "Syndicate"))
if(!(applicant.job in temp.restricted_jobs))
if(!(applicant.client.prefs.species in temp.protected_species))
@@ -600,7 +600,7 @@ client/proc/one_click_antag()
var/teamOneMembers = 5
var/teamTwoMembers = 5
var/datum/preferences/A = new()
- for (var/obj/effect/landmark/L in world)
+ for(var/obj/effect/landmark/L in world)
if(L.name == "tdome1")
if(teamOneMembers<=0)
break
diff --git a/code/modules/admin/verbs/onlyone.dm b/code/modules/admin/verbs/onlyone.dm
index ded5891edd9..6723299c5a8 100644
--- a/code/modules/admin/verbs/onlyone.dm
+++ b/code/modules/admin/verbs/onlyone.dm
@@ -27,8 +27,8 @@
to_chat(H, "Objective #[obj_count]: [OBJ.explanation_text]")
obj_count++
- for (var/obj/item/I in H)
- if (istype(I, /obj/item/weapon/implant))
+ for(var/obj/item/I in H)
+ if(istype(I, /obj/item/weapon/implant))
continue
if(istype(I, /obj/item/organ))
continue
diff --git a/code/modules/admin/verbs/onlyoneteam.dm b/code/modules/admin/verbs/onlyoneteam.dm
index 5072b43383e..a88270077d6 100644
--- a/code/modules/admin/verbs/onlyoneteam.dm
+++ b/code/modules/admin/verbs/onlyoneteam.dm
@@ -15,8 +15,8 @@
var/datum/preferences/A = new() // Randomize appearance
A.copy_to(H)
- for (var/obj/item/I in H)
- if (istype(I, /obj/item/weapon/implant))
+ for(var/obj/item/I in H)
+ if(istype(I, /obj/item/weapon/implant))
continue
if(istype (I, /obj/item/organ))
continue
diff --git a/code/modules/admin/verbs/pray.dm b/code/modules/admin/verbs/pray.dm
index caed1de43af..c35b4d7596e 100644
--- a/code/modules/admin/verbs/pray.dm
+++ b/code/modules/admin/verbs/pray.dm
@@ -50,9 +50,11 @@
if(X.prefs.sound & SOUND_ADMINHELP)
X << 'sound/effects/adminhelp.ogg'
-/proc/ERT_Announce(var/text , var/mob/Sender)
+/proc/ERT_Announce(var/text , var/mob/Sender, var/repeat_warning)
var/msg = sanitize(copytext(text, 1, MAX_MESSAGE_LEN))
- msg = "\blue ERT REQUEST: [key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, "holder")]) (CA) (BSA) (REPLY): [msg]"
+ msg = "ERT REQUEST: [key_name(Sender, 1)] (PP) (VV) (SM) ([admin_jump_link(Sender, "holder")]) (CA) (BSA) (RESPOND): [msg]"
+ if(repeat_warning)
+ msg += " WARNING: ERT request has gone 5 minutes with no reply!"
for(var/client/X in admins)
if(check_rights(R_EVENT,0,X.mob))
to_chat(X, msg)
diff --git a/code/modules/admin/verbs/randomverbs.dm b/code/modules/admin/verbs/randomverbs.dm
index ac0453d34df..e0a2f35e05d 100644
--- a/code/modules/admin/verbs/randomverbs.dm
+++ b/code/modules/admin/verbs/randomverbs.dm
@@ -23,7 +23,7 @@
if(!check_rights(R_ADMIN))
return
- if (ismob(M))
+ if(ismob(M))
if(istype(M, /mob/living/silicon/ai))
alert("The AI can't be sent to prison you jerk!", null, null, null, null, null)
return
@@ -56,10 +56,10 @@
var/msg = input("Message:", text("Subtle PM to [M.key]")) as text
- if (!msg)
+ if(!msg)
return
if(usr)
- if (usr.client)
+ if(usr.client)
if(usr.client.holder)
to_chat(M, "\bold You hear a voice in your head... \italic [msg]")
@@ -108,7 +108,7 @@
var/msg = input("Message:", text("Enter the text you wish to appear to everyone:")) as text
- if (!msg)
+ if(!msg)
return
to_chat(world, "[msg]")
log_admin("GlobalNarrate: [key_name(usr)] : [msg]")
@@ -407,7 +407,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if("Death Commando")//Leaves them at late-join spawn.
new_character.equip_death_commando()
new_character.internal = new_character.s_store
- new_character.internals.icon_state = "internal1"
+ new_character.update_internals_hud_icon(1)
else//They may also be a cyborg or AI.
switch(new_character.mind.assigned_role)
if("Cyborg")//More rigging to make em' work and check if they're traitor.
@@ -561,7 +561,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if("No")
to_chat(world, "\red [from] available at all communications consoles.")
- for (var/obj/machinery/computer/communications/C in machines)
+ for(var/obj/machinery/computer/communications/C in machines)
if(! (C.stat & (BROKEN|NOPOWER) ) )
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( C.loc )
P.name = "[from]"
@@ -581,7 +581,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if("No")
to_chat(world, "\red New Nanotrasen Update available at all communication consoles.")
- for (var/obj/machinery/computer/communications/C in machines)
+ for(var/obj/machinery/computer/communications/C in machines)
if(! (C.stat & (BROKEN|NOPOWER) ) )
var/obj/item/weapon/paper/P = new /obj/item/weapon/paper( C.loc )
P.name = "'[command_name()] Update.'"
@@ -603,7 +603,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_ADMIN))
return
- if (alert(src, "Are you sure you want to delete:\n[O]\nat ([O.x], [O.y], [O.z])?", "Confirmation", "Yes", "No") == "Yes")
+ if(alert(src, "Are you sure you want to delete:\n[O]\nat ([O.x], [O.y], [O.z])?", "Confirmation", "Yes", "No") == "Yes")
log_admin("[key_name(usr)] deleted [O] at ([O.x],[O.y],[O.z])")
message_admins("[key_name_admin(usr)] deleted [O] at ([O.x],[O.y],[O.z])", 1)
feedback_add_details("admin_verb","DEL") //If you are copy-pasting this, ensure the 2nd parameter is unique to the new proc!
@@ -643,9 +643,9 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/flames = input("Range of flames. -1 to none", text("Input")) as num|null
if(flames == null) return
- if ((devastation != -1) || (heavy != -1) || (light != -1) || (flash != -1) || (flames != -1))
- if ((devastation > 20) || (heavy > 20) || (light > 20) || (flames > 20))
- if (alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", "Yes", "No") == "No")
+ if((devastation != -1) || (heavy != -1) || (light != -1) || (flash != -1) || (flames != -1))
+ if((devastation > 20) || (heavy > 20) || (light > 20) || (flames > 20))
+ if(alert(src, "Are you sure you want to do this? It will laaag.", "Confirmation", "Yes", "No") == "No")
return
explosion(O, devastation, heavy, light, flash, null, null,flames)
@@ -668,7 +668,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/light = input("Range of light pulse.", text("Input")) as num|null
if(light == null) return
- if (heavy || light)
+ if(heavy || light)
empulse(O, heavy, light)
log_admin("[key_name(usr)] created an EM pulse ([heavy], [light]) at ([O.x],[O.y],[O.z])")
@@ -710,7 +710,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
var/confirm = alert(src, "You sure?", "Confirm", "Yes", "No")
if(confirm == "Yes")
- if (istype(mob, /mob/dead/observer)) // so they don't spam gibs everywhere
+ if(istype(mob, /mob/dead/observer)) // so they don't spam gibs everywhere
return
else
mob.gib()
@@ -791,7 +791,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
set category = "Admin"
set name = "Toggle Deny Shuttle"
- if (!ticker)
+ if(!ticker)
return
if(!check_rights(R_ADMIN))
@@ -824,7 +824,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
if(!check_rights(R_SERVER|R_EVENT))
return
- if (ticker && ticker.mode)
+ if(ticker && ticker.mode)
to_chat(usr, "Nope you can't do this, the game's already started. This only works before rounds!")
return
@@ -873,8 +873,7 @@ Traitors and the like can also be revived with the previous role mostly intact.
set name = "Reset Telecomms Scripts"
set desc = "Blanks all telecomms scripts from all telecomms servers"
- if(!holder || !holder.rights || !holder.rights & R_ADMIN)
- to_chat(usr, "Admin only.")
+ if(!check_rights(R_ADMIN, 1, src))
return
var/confirm = alert(src, "You sure you want to blank all NTSL scripts?", "Confirm", "Yes", "No")
diff --git a/code/modules/admin/verbs/striketeam.dm b/code/modules/admin/verbs/striketeam.dm
index 142bb8203cd..e76545f4748 100644
--- a/code/modules/admin/verbs/striketeam.dm
+++ b/code/modules/admin/verbs/striketeam.dm
@@ -55,7 +55,7 @@ var/global/sent_strike_team = 0
//Spawns commandos and equips them.
for(var/obj/effect/landmark/L in landmarks_list)
if(commando_number<=0) break
- if (L.name == "Commando")
+ if(L.name == "Commando")
leader_selected = commando_number == 1?1:0
var/mob/living/carbon/human/new_commando = create_death_commando(L, leader_selected)
@@ -64,7 +64,7 @@ var/global/sent_strike_team = 0
new_commando.key = pick(commandos)
commandos -= new_commando.key
new_commando.internal = new_commando.s_store
- new_commando.internals.icon_state = "internal1"
+ new_commando.update_internals_hud_icon(1)
//So they don't forget their code or mission.
if(nuke_code)
@@ -76,8 +76,8 @@ var/global/sent_strike_team = 0
commando_number--
//Spawns the rest of the commando gear.
- for (var/obj/effect/landmark/L in landmarks_list)
- if (L.name == "Commando_Manual")
+ for(var/obj/effect/landmark/L in landmarks_list)
+ if(L.name == "Commando_Manual")
//new /obj/item/weapon/gun/energy/pulse_rifle(L.loc)
var/obj/item/weapon/paper/P = new(L.loc)
P.info = "
Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow: #1 Work as a team. #2 Accomplish your objective at all costs. #3 Leave no witnesses. You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets. If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.
In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.
Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device. First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible. To make the device functional: #1 Place bomb in designated detonation zone #2 Extend and anchor bomb (attack with hand). #3 Insert Nuclear Auth. Disk into slot. #4 Type numeric code into keypad ([nuke_code]). Note: If you make a mistake press R to reset the device. #5 Press the E button to log onto the device. You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option. Note: Toggle off the SAFETY. Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate. Note: THE BOMB IS STILL SET AND WILL DETONATE Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.
The nuclear authorization code is: [nuke_code ? nuke_code : "None provided"]
Good morning soldier!. This compact guide will familiarize you with standard operating procedure. There are three basic rules to follow: #1 Work as a team. #2 Accomplish your objective at all costs. #3 Leave no witnesses. You are fully equipped and stocked for your mission--before departing on the Spec. Ops. Shuttle due South, make sure that all operatives are ready. Actual mission objective will be relayed to you by Central Command through your headsets. If deemed appropriate, Central Command will also allow members of your team to equip assault power-armor for the mission. You will find the armor storage due West of your position. Once you are ready to leave, utilize the Special Operations shuttle console and toggle the hull doors via the other console.
In the event that the team does not accomplish their assigned objective in a timely manner, or finds no other way to do so, attached below are instructions on how to operate a Nanotrasen Nuclear Device. Your operations LEADER is provided with a nuclear authentication disk and a pin-pointer for this reason. You may easily recognize them by their rank: Lieutenant, Captain, or Major. The nuclear device itself will be present somewhere on your destination.
Hello and thank you for choosing Nanotrasen for your nuclear information needs. Today's crash course will deal with the operation of a Fission Class Nanotrasen made Nuclear Device. First and foremost, DO NOT TOUCH ANYTHING UNTIL THE BOMB IS IN PLACE. Pressing any button on the compacted bomb will cause it to extend and bolt itself into place. If this is done to unbolt it one must completely log in which at this time may not be possible. To make the device functional: #1 Place bomb in designated detonation zone #2 Extend and anchor bomb (attack with hand). #3 Insert Nuclear Auth. Disk into slot. #4 Type numeric code into keypad ([nuke_code]). Note: If you make a mistake press R to reset the device. #5 Press the E button to log onto the device. You now have activated the device. To deactivate the buttons at anytime, for example when you have already prepped the bomb for detonation, remove the authentication disk OR press the R on the keypad. Now the bomb CAN ONLY be detonated using the timer. A manual detonation is not an option. Note: Toggle off the SAFETY. Use the - - and + + to set a detonation time between 5 seconds and 10 minutes. Then press the timer toggle button to start the countdown. Now remove the authentication disk so that the buttons deactivate. Note: THE BOMB IS STILL SET AND WILL DETONATE Now before you remove the disk if you need to move the bomb you can: Toggle off the anchor, move it, and re-anchor.
The nuclear authorization code is: [nuke_code ? nuke_code : "None provided"]
Close"}
- user << browse(dat, "window=timer")
+ var/datum/browser/popup = new(user, "timer", name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
onclose(user, "timer")
return
diff --git a/code/modules/atmos_automation/console.dm b/code/modules/atmos_automation/console.dm
index c567a45e108..201a6f63e4d 100644
--- a/code/modules/atmos_automation/console.dm
+++ b/code/modules/atmos_automation/console.dm
@@ -61,7 +61,7 @@
if(!(A.returntype in valid_returntypes))
continue
choices[A.name]=A
- if (choices.len==0)
+ if(choices.len==0)
testing("Unable to find automations with returntype in [english_list(valid_returntypes)]!")
return 0
var/label=input(user, "Select new automation:", "Automations", "Cancel") as null|anything in choices
diff --git a/code/modules/awaymissions/bluespaceartillery.dm b/code/modules/awaymissions/bluespaceartillery.dm
index 670d8143390..00263352325 100644
--- a/code/modules/awaymissions/bluespaceartillery.dm
+++ b/code/modules/awaymissions/bluespaceartillery.dm
@@ -32,7 +32,7 @@
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "bluespace_artillery.tmpl", "Bluespace Control", 400, 260)
ui.set_initial_data(data)
ui.open()
diff --git a/code/modules/awaymissions/corpse.dm b/code/modules/awaymissions/corpse.dm
index 5e79391cd40..b2864d1c7cc 100644
--- a/code/modules/awaymissions/corpse.dm
+++ b/code/modules/awaymissions/corpse.dm
@@ -7,6 +7,7 @@
/obj/effect/landmark/corpse
name = "Unknown"
var/mobname = "Unknown" //Unused now but it'd fuck up maps to remove it now
+ var/mob_species = null //Set to make a mob of another race, currently used only in ruins
var/corpseuniform = null //Set this to an object path to have the slot filled with said object on the corpse.
var/corpsesuit = null
var/corpseshoes = null
@@ -37,6 +38,8 @@
M.real_name = src.name
M.death(1) //Kills the new mob
M.timeofdeath = timeofdeath
+ if(src.mob_species)
+ M.set_species(src.mob_species)
if(src.corpseuniform)
M.equip_to_slot_or_del(new src.corpseuniform(M), slot_w_uniform)
if(src.corpsesuit)
@@ -285,3 +288,10 @@
corpseid = 1
corpseidjob = "Commander"
corpseidaccess = "Captain"
+
+/obj/effect/landmark/corpse/abductor //Connected to ruins, for some reason?
+ name = "abductor"
+ mobname = "???"
+ mob_species = "abductor"
+ corpseuniform = /obj/item/clothing/under/color/grey
+ corpseshoes = /obj/item/clothing/shoes/combat
diff --git a/code/modules/awaymissions/exile.dm b/code/modules/awaymissions/exile.dm
index 4e6a69d591b..8e2592b010b 100644
--- a/code/modules/awaymissions/exile.dm
+++ b/code/modules/awaymissions/exile.dm
@@ -32,7 +32,7 @@
/obj/structure/closet/secure_closet/exile
name = "exile implants"
- req_access = list(access_hos)
+ req_access = list(access_armory)
/obj/structure/closet/secure_closet/exile/New()
..()
diff --git a/code/modules/awaymissions/gateway.dm b/code/modules/awaymissions/gateway.dm
index 8da37d2ae3e..5045b5369a1 100644
--- a/code/modules/awaymissions/gateway.dm
+++ b/code/modules/awaymissions/gateway.dm
@@ -236,10 +236,10 @@ obj/machinery/gateway/centerstation/process()
if(!ready) return
if(!active) return
if(istype(M, /mob/living/carbon))
- if (exilecheck(M)) return
+ if(exilecheck(M)) return
if(istype(M, /obj))
for(var/mob/living/carbon/F in M)
- if (exilecheck(F)) return
+ if(exilecheck(F)) return
M.forceMove(get_step(stationgate.loc, SOUTH))
M.dir = SOUTH
diff --git a/code/modules/awaymissions/map_rng.dm b/code/modules/awaymissions/map_rng.dm
index 469dffaca54..147d41171c4 100644
--- a/code/modules/awaymissions/map_rng.dm
+++ b/code/modules/awaymissions/map_rng.dm
@@ -9,30 +9,43 @@
var/template_name = null
var/datum/map_template/template = null
var/centered = 1
+ var/loaded = 0
-/obj/effect/landmark/map_loader/New(loc, tname)
+/obj/effect/landmark/map_loader/New(turf/loc, tname)
..()
+
if(tname)
template_name = tname
if(template_name)
template = map_templates[template_name]
+
+/obj/effect/landmark/map_loader/initialize()
+ ..()
if(template)
load(template)
+/obj/effect/landmark/map_loader/set_tag()
+ return
+
/obj/effect/landmark/map_loader/proc/load(datum/map_template/t)
- spawn(1)
- if(!t)
- return
- t.load(get_turf(src), centered = centered)
- t.loaded++
- qdel(src)
+ if(!t)
+ return
+ if(loaded) // I wanna be super sure this loads only once
+ return
+ loaded = 1
+ var/turf/pos = get_turf(src)
+ // Hop to nullspace so we don't get re-initialized by the map we're loading
+ loc = null
+ t.load(pos, centered = centered)
+ t.loaded++
+ qdel(src)
/obj/effect/landmark/map_loader/random
var/template_list = ""
-/obj/effect/landmark/map_loader/random/New()
+/obj/effect/landmark/map_loader/random/initialize()
..()
if(template_list)
template_name = safepick(splittext(template_list, ";"))
template = map_templates[template_name]
- load(template)
\ No newline at end of file
+ load(template)
diff --git a/code/modules/awaymissions/maploader/reader.dm b/code/modules/awaymissions/maploader/reader.dm
index e58714de9f3..fcfd8d2e600 100644
--- a/code/modules/awaymissions/maploader/reader.dm
+++ b/code/modules/awaymissions/maploader/reader.dm
@@ -2,10 +2,22 @@
//SS13 Optimized Map loader
//////////////////////////////////////////////////////////////
+//As of 3.6.2016
//global datum that will preload variables on atoms instanciation
var/global/use_preloader = FALSE
var/global/dmm_suite/preloader/_preloader = new
+/dmm_suite
+ // These regexes are global - meaning that starting the maploader again mid-load will
+ // reset progress - which means we need to track our index per-map, or we'll
+ // eternally recurse
+ // /"([a-zA-Z]+)" = \(((?:.|\n)*?)\)\n(?!\t)|\((\d+),(\d+),(\d+)\) = \{"([a-zA-Z\n]*)"\}/g
+ var/static/regex/dmmRegex = new/regex({""(\[a-zA-Z]+)" = \\(((?:.|\n)*?)\\)\n(?!\t)|\\((\\d+),(\\d+),(\\d+)\\) = \\{"(\[a-zA-Z\n]*)"\\}"}, "g")
+ // /^[\s\n]+"?|"?[\s\n]+$|^"|"$/g
+ var/static/regex/trimQuotesRegex = new/regex({"^\[\\s\n]+"?|"?\[\\s\n]+$|^"|"$"}, "g")
+ // /^[\s\n]+|[\s\n]+$/
+ var/static/regex/trimRegex = new/regex("^\[\\s\n]+|\[\\s\n]+$", "g")
+ var/static/list/modelCache = list()
/**
* Construct the model map and control the loading process
@@ -16,87 +28,156 @@ var/global/dmm_suite/preloader/_preloader = new
* e.g aa = /turf/unsimulated/wall{icon_state = "rock"}
* 2) Read the map line by line, parsing the result (using parse_grid)
*
+ * If `measureOnly` is set, then no atoms will be created, and all this will do
+ * is return the bounds after parsing the file
+ *
+ * If you need to freeze init while you're working, you can use the spacial allocator's
+ * "add_dirt" and "remove_dirt" which will put initializations on hold until you say
+ * the word. This is important for loading large maps such as the cyberiad, where
+ * atmos will attempt to start before it's ready, causing runtimes galore if init is
+ * allowed to romp unchecked.
*/
-/dmm_suite/load_map(dmm_file as file, x_offset = 0 as num, y_offset = 0 as num, z_offset as num, do_sleep = 1 as num)
- if(!z_offset)//what z_level we are creating the map on
+/dmm_suite/load_map(dmm_file as file, x_offset as num, y_offset as num, z_offset as num, cropMap as num, measureOnly as num)
+ var/tfile = dmm_file//the map file we're creating
+ var/fname = "Lambda"
+ if(isfile(tfile))
+ fname = "[tfile]"
+ tfile = file2text(tfile)
+
+ if(!x_offset)
+ x_offset = 1
+ if(!y_offset)
+ y_offset = 1
+ if(!z_offset)
z_offset = world.maxz + 1
- var/quote = ascii2text(34)
- var/tfile = file2text(dmm_file)//the map file we're creating
- var/tfile_len = length(tfile)
- var/lpos = 1 // the models definition index
-
- ///////////////////////////////////////////////////////////////////////////////////////
- //first let's map model keys (e.g "aa") to their contents (e.g /turf/space{variables})
- ///////////////////////////////////////////////////////////////////////////////////////
+ var/list/bounds = list(1.#INF, 1.#INF, 1.#INF, -1.#INF, -1.#INF, -1.#INF)
var/list/grid_models = list()
- var/key_len = length(copytext(tfile,2,findtext(tfile,quote,2,0)))//the length of the model key (e.g "aa" or "aba")
+ var/key_len = 0
- //proceed line by line
- for(lpos=1; lpos world.maxz)
+ if(cropMap)
+ continue
+ else
+ zlevels.increase_max_zlevel_to(zcrd) //create a new z_level if needed
- var/y_depth = z_depth / (x_depth+1)//x_depth + 1 because we're counting the '\n' characters in z_depth
- if(world.maxy 1)
+ gridLines.Cut(1, leadingBlanks) // Remove all leading blank lines.
- //fill the current square using the model map
- xcrd=0
+ if(!gridLines.len) // Skip it if only blank lines exist.
+ continue
- for(var/mpos in 1 to x_depth step key_len)
- xcrd++
- var/model_key = copytext(grid_line,mpos,mpos+key_len)
- parse_grid(grid_models[model_key], xcrd + x_offset, ycrd + y_offset, zcrd + z_offset, do_sleep)
+ if(gridLines.len && gridLines[gridLines.len] == "")
+ gridLines.Cut(gridLines.len) // Remove only one blank line at the end.
- //reached end of current map
- if(gpos+x_depth+1>z_depth)
- break
+ bounds[MAP_MINY] = min(bounds[MAP_MINY], ycrd)
+ ycrd += gridLines.len - 1 // Start at the top and work down
- ycrd--
- if(do_sleep)
- sleep(-1)
+ if(!cropMap && ycrd > world.maxy)
+ if(!measureOnly)
+ world.maxy = ycrd // Expand Y here. X is expanded in the loop below
+ bounds[MAP_MAXY] = max(bounds[MAP_MAXY], ycrd)
+ else
+ bounds[MAP_MAXY] = max(bounds[MAP_MAXY], min(ycrd, world.maxy))
- //reached End Of File
- if(findtext(tfile,quote+"}",zpos,0)+2==tfile_len)
- break
- if(do_sleep)
- sleep(-1)
+ var/maxx = xcrdStart
+ if(measureOnly)
+ for(var/line in gridLines)
+ maxx = max(maxx, xcrdStart + length(line) / key_len - 1)
+ else
+ for(var/line in gridLines)
+ if(ycrd <= world.maxy && ycrd >= 1)
+ xcrd = xcrdStart
+ for(var/tpos = 1 to length(line) - key_len + 1 step key_len)
+ if(xcrd > world.maxx)
+ if(cropMap)
+ break
+ else
+ world.maxx = xcrd
+
+ if(xcrd >= 1)
+ var/model_key = copytext(line, tpos, tpos + key_len)
+ if(!grid_models[model_key])
+ throw EXCEPTION("Undefined model key in DMM: [model_key]. Map file: [fname].")
+ parse_grid(grid_models[model_key], xcrd, ycrd, zcrd, LM)
+ // After this call, it is NOT safe to reference `dmmRegex` without another call to
+ // "Find" - we might've hit a map loader here and changed its state
+ CHECK_TICK
+
+ maxx = max(maxx, xcrd)
+ ++xcrd
+ --ycrd
+
+ bounds[MAP_MAXX] = max(bounds[MAP_MAXX], cropMap ? min(maxx, world.maxx) : maxx)
+
+ CHECK_TICK
+ catch(var/exception/e)
+ _preloader.reset()
+ throw e
+
+ _preloader.reset()
+ log_debug("Loaded map in [stop_watch(watch)]s.")
+ qdel(LM)
+ if(bounds[MAP_MINX] == 1.#INF) // Shouldn't need to check every item
+ log_debug("Min x: bounds[MAP_MINX]")
+ log_debug("Min y: bounds[MAP_MINY]")
+ log_debug("Min z: bounds[MAP_MINZ]")
+ log_debug("Max x: bounds[MAP_MAXX]")
+ log_debug("Max y: bounds[MAP_MAXY]")
+ log_debug("Max z: bounds[MAP_MAXZ]")
+ return null
+ else
+ if(!measureOnly)
+ for(var/t in block(locate(bounds[MAP_MINX], bounds[MAP_MINY], bounds[MAP_MINZ]), locate(bounds[MAP_MAXX], bounds[MAP_MAXY], bounds[MAP_MAXZ])))
+ var/turf/T = t
+ //we do this after we load everything in. if we don't; we'll have weird atmos bugs regarding atmos adjacent turfs
+ T.AfterChange(1,keep_cabling = TRUE)
+ return bounds
/**
* Fill a given tile with its area/turf/objects/mobs
@@ -115,48 +196,60 @@ var/global/dmm_suite/preloader/_preloader = new
* 4) Instanciates the atom with its variables
*
*/
-/dmm_suite/proc/parse_grid(model as text, xcrd as num, ycrd as num, zcrd as num, do_sleep = 1)
+/dmm_suite/proc/parse_grid(model as text,xcrd as num,ycrd as num,zcrd as num, dmm_suite/loaded_map/LM)
/*Method parse_grid()
- Accepts a text string containing a comma separated list of type paths of the
same construction as those contained in a .dmm file, and instantiates them.
*/
- var/list/members = list()//will contain all members (paths) in model (in our example : /turf/unsimulated/wall and /area/mine/explored)
- var/list/members_attributes = list()//will contain lists filled with corresponding variables, if any (in our example : list(icon_state = "rock") and list())
+ var/list/members //will contain all members (paths) in model (in our example : /turf/unsimulated/wall and /area/mine/explored)
+ var/list/members_attributes //will contain lists filled with corresponding variables, if any (in our example : list(icon_state = "rock") and list())
+ var/list/cached = modelCache[model]
+ var/index
+ if(cached)
+ members = cached[1]
+ members_attributes = cached[2]
+ else
+ /////////////////////////////////////////////////////////
+ //Constructing members and corresponding variables lists
+ ////////////////////////////////////////////////////////
- /////////////////////////////////////////////////////////
- //Constructing members and corresponding variables lists
- ////////////////////////////////////////////////////////
+ members = list()
+ members_attributes = list()
+ index = 1
- var/index=1
- var/old_position = 1
- var/dpos
+ var/old_position = 1
+ var/dpos
- do
- //finding next member (e.g /turf/unsimulated/wall{icon_state = "rock"} or /area/mine/explored)
- dpos= find_next_delimiter_position(model,old_position,",","{","}")//find next delimiter (comma here) that's not within {...}
+ do
+ //finding next member (e.g /turf/unsimulated/wall{icon_state = "rock"} or /area/mine/explored)
+ dpos = find_next_delimiter_position(model, old_position, ",", "{", "}") //find next delimiter (comma here) that's not within {...}
- var/full_def = copytext(model,old_position,dpos)//full definition, e.g : /obj/foo/bar{variables=derp}
- var/atom_def = text2path(copytext(full_def,1,findtext(full_def,"{")))//path definition, e.g /obj/foo/bar
- members.Add(atom_def)
- old_position = dpos + 1
+ var/full_def = trim_text(copytext(model, old_position, dpos)) //full definition, e.g : /obj/foo/bar{variables=derp}
+ var/variables_start = findtext(full_def, "{")
+ var/atom_def = text2path(trim_text(copytext(full_def, 1, variables_start))) //path definition, e.g /obj/foo/bar
+ old_position = dpos + 1
- //transform the variables in text format into a list (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7))
- var/list/fields = list()
+ if(!atom_def) // Skip the item if the path does not exist. Fix your crap, mappers!
+ continue
+ members.Add(atom_def)
- var/variables_start = findtext(full_def,"{")
- if(variables_start)//if there's any variable
- full_def = copytext(full_def,variables_start+1,length(full_def))//removing the last '}'
- fields = readlist(full_def, ";")
+ //transform the variables in text format into a list (e.g {var1="derp"; var2; var3=7} => list(var1="derp", var2, var3=7))
+ var/list/fields = list()
- //then fill the members_attributes list with the corresponding variables
- members_attributes.len++
- members_attributes[index++] = fields
+ if(variables_start)//if there's any variable
+ full_def = copytext(full_def,variables_start+1,length(full_def))//removing the last '}'
+ fields = readlist(full_def, ";")
- if(do_sleep)
- sleep(-1)
- while(dpos != 0)
+ //then fill the members_attributes list with the corresponding variables
+ members_attributes.len++
+ members_attributes[index++] = fields
+
+ CHECK_TICK
+ while(dpos != 0)
+
+ modelCache[model] = list(members, members_attributes)
////////////////
@@ -165,24 +258,25 @@ var/global/dmm_suite/preloader/_preloader = new
//The next part of the code assumes there's ALWAYS an /area AND a /turf on a given tile
- //in case of multiples turfs on one tile,
- //will contains the images of all underlying turfs, to simulate the DMM multiple tiles piling
- var/list/turfs_underlays = list()
-
//first instance the /area and remove it from the members list
index = members.len
+
+ var/turf/crds = locate(xcrd,ycrd,zcrd)
if(members[index] != /area/template_noop)
+ // We assume `members[index]` is an area path, as above, yes? I will operate
+ // on that assumption.
+ if(!ispath(members[index], /area))
+ throw EXCEPTION("Oh no, I thought this was an area!")
+
var/atom/instance
_preloader.setup(members_attributes[index])//preloader for assigning set variables on atom creation
+ instance = LM.area_path_to_real_area(members[index])
- instance = locate(members[index])
- var/turf/crds = locate(xcrd,ycrd,zcrd)
if(crds)
instance.contents.Add(crds)
if(use_preloader && instance)
_preloader.load(instance)
- members.Remove(members[index])
//then instance the /turf and, if multiple tiles are presents, simulates the DMM underlays piling effect
@@ -198,18 +292,20 @@ var/global/dmm_suite/preloader/_preloader = new
if(T)
//if others /turf are presents, simulates the underlays piling effect
index = first_turf_index + 1
- while(index <= members.len)
- turfs_underlays.Insert(1,image(T.icon,null,T.icon_state,T.layer,T.dir))//add the current turf image to the underlays list
- var/turf/UT = instance_atom(members[index],members_attributes[index],xcrd,ycrd,zcrd)//instance new turf
- add_underlying_turf(UT,T,turfs_underlays)//simulates the DMM piling effect
- T = UT
+ while(index <= members.len - 1) // Last item is an /area
+ var/underlay
+ if(istype(T, /turf)) // I blame this on the stupid clown who coded the BYOND map editor
+ underlay = T.appearance
+ T = instance_atom(members[index],members_attributes[index],xcrd,ycrd,zcrd)//instance new turf
+ if(ispath(members[index],/turf))
+ T.underlays += underlay
+
index++
//finally instance all remainings objects/mobs
- for(index in 1 to first_turf_index - 1)
+ for(index in 1 to first_turf_index-1)
instance_atom(members[index],members_attributes[index],xcrd,ycrd,zcrd)
- if(do_sleep)
- sleep(-1)
+ CHECK_TICK
////////////////
//Helpers procs
@@ -222,7 +318,13 @@ var/global/dmm_suite/preloader/_preloader = new
var/turf/T = locate(x,y,z)
if(T)
- instance = new path (T)//first preloader pass
+ if(ispath(path, /turf))
+ T.ChangeTurf(path, 1, 0)
+ instance = T
+ else if(ispath(path, /area))
+
+ else
+ instance = new path (T)//first preloader pass
if(use_preloader && instance)//second preloader pass, for those atoms that don't ..() in New()
_preloader.load(instance)
@@ -232,16 +334,11 @@ var/global/dmm_suite/preloader/_preloader = new
//text trimming (both directions) helper proc
//optionally removes quotes before and after the text (for variable name)
/dmm_suite/proc/trim_text(what as text,trim_quotes=0)
- while(length(what) && (findtext(what," ",1,2)))
- what=copytext(what,2,0)
- while(length(what) && (findtext(what," ",length(what),0)))
- what=copytext(what,1,length(what))
if(trim_quotes)
- while(length(what) && (findtext(what,quote,1,2)))
- what=copytext(what,2,0)
- while(length(what) && (findtext(what,quote,length(what),0)))
- what=copytext(what,1,length(what))
- return what
+ return trimQuotesRegex.Replace(what, "")
+ else
+ return trimRegex.Replace(what, "")
+
//find the position of the next delimiter,skipping whatever is comprised between opening_escape and closing_escape
//returns 0 if reached the last delimiter
@@ -313,14 +410,6 @@ var/global/dmm_suite/preloader/_preloader = new
return to_return
-//simulates the DM multiple turfs on one tile underlaying
-/dmm_suite/proc/add_underlying_turf(turf/placed,turf/underturf, list/turfs_underlays)
- if(underturf.density)
- placed.density = 1
- if(underturf.opacity)
- placed.opacity = 1
- placed.underlays += turfs_underlays
-
//atom creation method that preloads variables at creation
/atom/New()
if(use_preloader && (src.type == _preloader.target_path))//in case the instanciated atom is creating other atoms in New()
@@ -336,6 +425,7 @@ var/global/dmm_suite/preloader/_preloader = new
//Preloader datum
//////////////////
+// This ain't re-entrant, but we had this before the maploader update
/dmm_suite/preloader
parent_type = /datum
var/list/attributes
@@ -349,11 +439,41 @@ var/global/dmm_suite/preloader/_preloader = new
/dmm_suite/preloader/proc/load(atom/what)
for(var/attribute in attributes)
- what.vars[attribute] = attributes[attribute]
+ var/value = attributes[attribute]
+ if(islist(value))
+ value = deepCopyList(value)
+ what.vars[attribute] = value
use_preloader = FALSE
+// If the map loader fails, make this safe
+/dmm_suite/preloader/proc/reset()
+ use_preloader = FALSE
+ attributes = list()
+ target_path = null
+
+// A datum for use within the context of loading a single map,
+// so that one can have separate "unpowered" areas for ruins or whatever,
+// yet have a single area type for use of mapping, instead of creating
+// a new area type for each new ruin
+/dmm_suite/loaded_map
+ parent_type = /datum
+ var/list/area_list = list()
+ var/index = 1 // To store the state of the regex
+
+/dmm_suite/loaded_map/proc/area_path_to_real_area(area/A)
+ if(!ispath(A, /area))
+ throw EXCEPTION("Wrong argument to `area_path_to_real_area`")
+
+ if(!(A in area_list))
+ if(initial(A.there_can_be_many))
+ area_list[A] = new A
+ else
+ area_list[A] = locate(A)
+
+ return area_list[A]
+
/area/template_noop
name = "Area Passthrough"
/turf/template_noop
- name = "Turf Passthrough"
\ No newline at end of file
+ name = "Turf Passthrough"
diff --git a/code/modules/awaymissions/maploader/swapmaps.dm b/code/modules/awaymissions/maploader/swapmaps.dm
index 8dc9f9f6c99..7115cfcbf13 100644
--- a/code/modules/awaymissions/maploader/swapmaps.dm
+++ b/code/modules/awaymissions/maploader/swapmaps.dm
@@ -326,7 +326,7 @@ swapmap
x2+=x1-1
y2+=y1-1
z2+=z1-1
- world.maxz=max(z2,world.maxz) // stretch z if necessary
+ zlevels.increase_max_zlevel_to(z2) // stretch z if necessary
if(!ischunk)
swapmaps_loaded[src]=null
swapmaps_byname[id]=src
@@ -373,7 +373,7 @@ swapmap
mz=max(mz,M.z2)
world.maxx=mx
world.maxy=my
- world.maxz=mz
+ zlevels.cut_levels_downto(mz)
// save and delete
proc/Unload()
diff --git a/code/modules/awaymissions/mission_code/spacehotel.dm b/code/modules/awaymissions/mission_code/spacehotel.dm
index c4820db97ec..b7670737193 100644
--- a/code/modules/awaymissions/mission_code/spacehotel.dm
+++ b/code/modules/awaymissions/mission_code/spacehotel.dm
@@ -54,9 +54,8 @@
name = "space hotel pamphlet"
info = "
Welcome to Deep Space Hotel 419!
Thank you for choosing our hotel. Simply hand your credit or debit card to the concierge and get your room key! To check out, hand your credit card back.
Conditions:
The hotel is not responsible for any losses due to time or space anomalies.
The hotel is not responsible for events that occur outside of the hotel station, including, but not limited to, events that occur inside of dimensional pockets.
The hotel is not responsible for overcharging your account.
The hotel is not responsible for missing persons.
The hotel is not responsible for mind-altering effects due to drugs, magic, demons, or space worms.
"
-/obj/effect/landmark/map_loader/hotel_room/New()
+/obj/effect/landmark/map_loader/hotel_room/initialize()
..()
-
// load and randomly assign rooms
var/global/list/south_room_templates = list()
var/global/list/north_room_templates = list()
@@ -65,26 +64,27 @@
if(!loaded)
loaded = 1
for(var/map in flist(path))
- var/datum/map_template/T = new(path = "[path][map]", rename = "[map]")
- if(copytext(map, 1, 3) == "n_")
- north_room_templates += T
- else if(copytext(map, 1, 3) == "s_")
- south_room_templates += T
- else
- // omnidirectional rooms are randomly assigned
- if(prob(50))
+ if(cmptext(copytext(map, length(map) - 3), ".dmm"))
+ var/datum/map_template/T = new(path = "[path][map]", rename = "[map]")
+ if(copytext(map, 1, 3) == "n_")
north_room_templates += T
- else
+ else if(copytext(map, 1, 3) == "s_")
south_room_templates += T
+ else
+ // omnidirectional rooms are randomly assigned
+ if(prob(50))
+ north_room_templates += T
+ else
+ south_room_templates += T
var/datum/map_template/M = safepick(dir == NORTH ? north_room_templates : south_room_templates)
if(M)
template = M
- load(M)
if(dir == NORTH)
north_room_templates -= M
else
south_room_templates -= M
+ load(M)
// The door to a hotel room, but also metadata for the room itself
/obj/machinery/door/unpowered/hotel_door
@@ -305,4 +305,4 @@
S.retal_target = target
S.retal = 1
-#undef CHECKOUT_TIME
\ No newline at end of file
+#undef CHECKOUT_TIME
diff --git a/code/modules/awaymissions/mission_code/stationCollision.dm b/code/modules/awaymissions/mission_code/stationCollision.dm
index 682e2137d2a..7a6480943a7 100644
--- a/code/modules/awaymissions/mission_code/stationCollision.dm
+++ b/code/modules/awaymissions/mission_code/stationCollision.dm
@@ -175,7 +175,7 @@ var/sc_safecode5 = "[rand(0,9)]"
/obj/singularity/narsie/sc_Narsie/consume(var/atom/A)
if(is_type_in_list(A, uneatable))
return 0
- if (istype(A,/mob/living))
+ if(istype(A,/mob/living))
var/mob/living/L = A
L.gib()
else if(istype(A,/obj/))
diff --git a/code/modules/awaymissions/mission_code/wildwest.dm b/code/modules/awaymissions/mission_code/wildwest.dm
index 8227671f0ac..3db7ff86668 100644
--- a/code/modules/awaymissions/mission_code/wildwest.dm
+++ b/code/modules/awaymissions/mission_code/wildwest.dm
@@ -65,7 +65,7 @@
else if(is_special_character(user))
to_chat(user, "Even to a heart as dark as yours, you know nothing good will come of this. Something instinctual makes you pull away.")
- else if (!insistinga)
+ else if(!insistinga)
to_chat(user, "Your first touch makes the Wish Granter stir, listening to you. Are you really sure you want to do this?")
insistinga++
diff --git a/code/modules/awaymissions/zlevel.dm b/code/modules/awaymissions/zlevel.dm
index 321e4033f0e..7fff68cf031 100644
--- a/code/modules/awaymissions/zlevel.dm
+++ b/code/modules/awaymissions/zlevel.dm
@@ -1,14 +1,27 @@
+var/global/list/potentialRandomZlevels = generateMapList(filename = "config/away_mission_config.txt")
+
+// Call this before you remove the last dirt on a z level - that way, all objects
+// will have proper atmos and other important enviro things
/proc/late_setup_level(turfs, smoothTurfs)
+ var/total_timer = start_watch()
+ var/subtimer = start_watch()
if(!smoothTurfs)
smoothTurfs = turfs
+ log_debug("Setting up atmos")
if(air_master)
air_master.setup_allturfs(turfs)
+ log_debug("\tTook [stop_watch(subtimer)]s")
+
+ subtimer = start_watch()
+ log_debug("Initializing lighting")
for(var/turf/T in turfs)
if(T.dynamic_lighting)
T.lighting_build_overlays()
- for(var/obj/structure/cable/PC in T)
- makepowernet_for(PC)
+ log_debug("\tTook [stop_watch(subtimer)]s")
+
+ subtimer = start_watch()
+ log_debug("Smoothing tiles")
for(var/turf/T in smoothTurfs)
if(T.smooth)
smooth_icon(T)
@@ -16,59 +29,47 @@
var/atom/A = R
if(A.smooth)
smooth_icon(A)
+ if(istype(T, /turf/simulated/mineral)) // For the listening post, among other maps
+ var/turf/simulated/mineral/MT = T
+ MT.add_edges()
+ log_debug("\tTook [stop_watch(subtimer)]s")
+ log_debug("Late setup finished - took [stop_watch(total_timer)]s")
+
+/proc/empty_rect(low_x,low_y, hi_x,hi_y, z)
+ var/timer = start_watch()
+ log_debug("Emptying region: ([low_x], [low_y]) to ([hi_x], [hi_y]) on z '[z]'")
+ empty_region(block(locate(low_x, low_y, z), locate(hi_x, hi_y, z)))
+ log_debug("Took [stop_watch(timer)]s")
+
+/proc/empty_region(list/turfs)
+ for(var/thing in turfs)
+ var/turf/T = thing
+ for(var/otherthing in T)
+ qdel(otherthing)
+ T.ChangeTurf(/turf/space)
/proc/createRandomZlevel()
if(awaydestinations.len) //crude, but it saves another var!
return
- var/list/potentialRandomZlevels = list()
- log_startup_progress("Searching for away missions...")
- var/list/Lines
- if(fexists("config/away_mission_config.txt"))
- Lines = file2list("config/away_mission_config.txt")
- else
- Lines = file2list("config/example/away_mission_config.txt")
-
- if(!Lines.len) return
- for (var/t in Lines)
- if (!t)
- continue
-
- t = trim(t)
- if (length(t) == 0)
- continue
- else if (copytext(t, 1, 2) == "#")
- continue
-
- var/pos = findtext(t, " ")
- var/name = null
- // var/value = null
-
- if (pos)
- name = lowertext(copytext(t, 1, pos))
- // value = copytext(t, pos + 1)
- else
- name = lowertext(t)
-
- if (!name)
- continue
-
- potentialRandomZlevels.Add(t)
-
-
- if(potentialRandomZlevels.len)
+ if(potentialRandomZlevels && potentialRandomZlevels.len)
var/watch = start_watch()
log_startup_progress("Loading away mission...")
var/map = pick(potentialRandomZlevels)
var/file = file(map)
if(isfile(file))
- maploader.load_map(file, do_sleep = 0)
- late_setup_level(block(locate(1, 1, world.maxz), locate(world.maxx, world.maxy, world.maxz)))
+ var/zlev = zlevels.add_new_zlevel()
+ zlevels.add_dirt(zlev)
+ maploader.load_map(file, z_offset = zlev)
+ late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev)))
+ zlevels.remove_dirt(zlev)
log_to_dd(" Away mission loaded: [map]")
+ //map_transition_config.Add(AWAY_MISSION_LIST)
+
for(var/obj/effect/landmark/L in landmarks_list)
- if (L.name != "awaystart")
+ if(L.name != "awaystart")
continue
awaydestinations.Add(L)
@@ -76,4 +77,140 @@
else
log_startup_progress(" No away missions found.")
- return
\ No newline at end of file
+ return
+
+/proc/createALLZlevels()
+ if(awaydestinations.len) //crude, but it saves another var!
+ return
+
+ if(potentialRandomZlevels && potentialRandomZlevels.len)
+ var/watch = start_watch()
+ log_startup_progress("Loading away missions...")
+
+ for(var/map in potentialRandomZlevels)
+ var/file = file(map)
+ if(isfile(file))
+ log_startup_progress("Loading away mission: [map]")
+ var/zlev = zlevels.add_new_zlevel()
+ zlevels.add_dirt(zlev)
+ maploader.load_map(file, z_offset = zlev)
+ late_setup_level(block(locate(1, 1, zlev), locate(world.maxx, world.maxy, zlev)))
+ zlevels.remove_dirt(zlev)
+ log_to_dd(" Away mission loaded: [map]")
+
+ //map_transition_config.Add(AWAY_MISSION_LIST)
+
+ for(var/obj/effect/landmark/L in landmarks_list)
+ if(L.name != "awaystart")
+ continue
+ awaydestinations.Add(L)
+
+ log_startup_progress(" Away mission loaded in [stop_watch(watch)]s.")
+ watch = start_watch()
+
+ else
+ log_startup_progress(" No away missions found.")
+ return
+
+/proc/generateMapList(filename)
+ var/list/potentialMaps = list()
+ var/list/Lines = file2list(filename)
+
+ if(!Lines.len)
+ return
+ for(var/t in Lines)
+ if(!t)
+ continue
+
+ t = trim(t)
+ if(length(t) == 0)
+ continue
+ else if(copytext(t, 1, 2) == "#")
+ continue
+
+ var/pos = findtext(t, " ")
+ var/name = null
+
+ if(pos)
+ name = lowertext(copytext(t, 1, pos))
+
+ else
+ name = lowertext(t)
+
+ if(!name)
+ continue
+
+ potentialMaps.Add(t)
+
+ return potentialMaps
+
+
+/proc/seedRuins(z_level = 1, budget = 0, whitelist = /area/space, list/potentialRuins = space_ruins_templates)
+ var/overall_sanity = 100
+ var/ruins = potentialRuins.Copy()
+ var/initialbudget = budget
+ var/watch = start_watch()
+
+ log_startup_progress("Loading ruins...")
+
+ while(budget > 0 && overall_sanity > 0)
+ // Pick a ruin
+ var/datum/map_template/ruin/ruin = ruins[pick(ruins)]
+ // Can we afford it
+ if(ruin.cost > budget)
+ overall_sanity--
+ continue
+ // If so, try to place it
+ var/sanity = 100
+ // And if we can't fit it anywhere, give up, try again
+
+ while(sanity > 0)
+ sanity--
+ var/turf/T = locate(rand(25, world.maxx - 25), rand(25, world.maxy - 25), z_level)
+ var/valid = 1
+
+ for(var/turf/check in ruin.get_affected_turfs(T,1))
+ var/area/new_area = get_area(check)
+ if(!(istype(new_area, whitelist)))
+ valid = 0
+ break
+
+ if(!valid)
+ continue
+
+ log_to_dd(" Ruin \"[ruin.name]\" loaded in [stop_watch(watch)]s at ([T.x], [T.y], [T.z]).")
+
+ var/obj/effect/ruin_loader/R = new /obj/effect/ruin_loader(T)
+ R.Load(ruins,ruin)
+ budget -= ruin.cost
+ if(!ruin.allow_duplicates)
+ ruins -= ruin.name
+ break
+
+ to_chat(world, " Loaded ruins. Or not.") //So the players don't know if we loaded ruins, but we do have a message
+
+ if(initialbudget == budget) //Kill me
+ log_to_dd(" No ruins loaded.")
+
+
+/obj/effect/ruin_loader
+ name = "random ruin"
+ desc = "If you got lucky enough to see this..."
+ icon = 'icons/obj/weapons.dmi'
+ icon_state = "syndballoon"
+ invisibility = 0
+
+/obj/effect/ruin_loader/proc/Load(list/potentialRuins = space_ruins_templates, datum/map_template/template = null)
+ var/list/possible_ruins = list()
+ for(var/A in potentialRuins)
+ var/datum/map_template/T = potentialRuins[A]
+ if(!T.loaded)
+ possible_ruins += T
+ if(!template && possible_ruins.len)
+ template = safepick(possible_ruins)
+ if(!template)
+ return 0
+ template.load(get_turf(src),centered = 1)
+ template.loaded++
+ qdel(src)
+ return 1
diff --git a/code/modules/awaymissions/zvis.dm b/code/modules/awaymissions/zvis.dm
index 069d733c7e4..06d60f3389f 100644
--- a/code/modules/awaymissions/zvis.dm
+++ b/code/modules/awaymissions/zvis.dm
@@ -21,6 +21,9 @@
/obj/effect/levelref/New()
..()
levels += src
+
+/obj/effect/levelref/initialize()
+ ..()
for(var/obj/effect/levelref/O in levels)
if(id == O.id && O != src)
other = O
@@ -104,7 +107,7 @@
/turf/unsimulated/floor/upperlevel/New()
..()
var/obj/effect/levelref/R = locate() in get_area(src)
- if(R)
+ if(R && R.other)
init(R)
/turf/unsimulated/floor/upperlevel/Destroy()
@@ -159,6 +162,8 @@
..()
portals += src
+/obj/effect/view_portal/initialize()
+ ..()
if(id)
for(var/obj/effect/view_portal/O in portals)
if(id == O.id && O != src && can_link(O))
@@ -361,4 +366,4 @@
screen_loc = "CENTER[ox >= 0 ? "+" : ""][ox],CENTER[oy >= 0 ? "+" : ""][oy]"
/obj/effect/view_portal_dummy/attack_ghost(mob/user)
- owner.attack_ghost(user)
\ No newline at end of file
+ owner.attack_ghost(user)
diff --git a/code/modules/client/asset_cache.dm b/code/modules/client/asset_cache.dm
index ac4a426fe08..f51f83cafb2 100644
--- a/code/modules/client/asset_cache.dm
+++ b/code/modules/client/asset_cache.dm
@@ -46,10 +46,10 @@ You can set verify to TRUE if you want send() to sleep until the client has the
client << browse_rsc(asset_cache[asset_name], asset_name)
if(!verify || !winexists(client, "asset_cache_browser")) // Can't access the asset cache browser, rip.
- if (client)
+ if(client)
client.cache += asset_name
return 1
- if (!client)
+ if(!client)
return 0
client.sending |= asset_name
@@ -91,17 +91,17 @@ You can set verify to TRUE if you want send() to sleep until the client has the
var/list/unreceived = asset_list - (client.cache + client.sending)
if(!unreceived || !unreceived.len)
return 0
- if (unreceived.len >= ASSET_CACHE_TELL_CLIENT_AMOUNT)
+ if(unreceived.len >= ASSET_CACHE_TELL_CLIENT_AMOUNT)
to_chat(client, "Sending Resources...")
for(var/asset in unreceived)
- if (asset in asset_cache)
+ if(asset in asset_cache)
client << browse_rsc(asset_cache[asset], asset)
if(!verify || !winexists(client, "asset_cache_browser")) // Can't access the asset cache browser, rip.
- if (client)
+ if(client)
client.cache += unreceived
return 1
- if (!client)
+ if(!client)
return 0
client.sending |= unreceived
var/job = ++client.last_asset_job
@@ -129,9 +129,9 @@ You can set verify to TRUE if you want send() to sleep until the client has the
//The proc calls procs that sleep for long times.
proc/getFilesSlow(var/client/client, var/list/files, var/register_asset = TRUE)
for(var/file in files)
- if (!client)
+ if(!client)
break
- if (register_asset)
+ if(register_asset)
register_asset(file,files[file])
send_asset(client,file)
sleep(-1) //queuing calls like this too quickly can cause issues in some client versions
@@ -159,7 +159,7 @@ proc/getFilesSlow(var/client/client, var/list/files, var/register_asset = TRUE)
//get a assetdatum or make a new one
/proc/get_asset_datum(var/type)
- if (!(type in asset_datums))
+ if(!(type in asset_datums))
return new type()
return asset_datums[type]
@@ -240,14 +240,14 @@ proc/getFilesSlow(var/client/client, var/list/files, var/register_asset = TRUE)
/datum/asset/nanoui/register()
// Crawl the directories to find files.
- for (var/path in common_dirs)
+ for(var/path in common_dirs)
var/list/filenames = flist(path)
for(var/filename in filenames)
if(copytext(filename, length(filename)) != "/") // Ignore directories.
if(fexists(path + filename))
common[filename] = fcopy_rsc(path + filename)
register_asset(filename, common[filename])
- for (var/path in uncommon_dirs)
+ for(var/path in uncommon_dirs)
var/list/filenames = flist(path)
for(var/filename in filenames)
if(copytext(filename, length(filename)) != "/") // Ignore directories.
@@ -260,3 +260,18 @@ proc/getFilesSlow(var/client/client, var/list/files, var/register_asset = TRUE)
send_asset_list(client, uncommon)
send_asset_list(client, common)
+
+/datum/asset/chem_master
+ var/assets = list()
+ var/verify = FALSE
+
+/datum/asset/chem_master/register()
+ for(var/i = 1 to 20)
+ assets["pill[i].png"] = icon('icons/obj/chemical.dmi', "pill[i]")
+ for(var/i = 1 to 20)
+ assets["bottle[i].png"] = icon('icons/obj/chemical.dmi', "bottle[i]")
+ for(var/asset_name in assets)
+ register_asset(asset_name, assets[asset_name])
+
+/datum/asset/chem_master/send(client)
+ send_asset_list(client,assets,verify)
\ No newline at end of file
diff --git a/code/modules/client/client procs.dm b/code/modules/client/client procs.dm
index 679b99ae2e0..0d56f0d1122 100644
--- a/code/modules/client/client procs.dm
+++ b/code/modules/client/client procs.dm
@@ -210,7 +210,7 @@
switch(href_list["action"])
- if ("openLink")
+ if("openLink")
src << link(href_list["link"])
..() //redirect to hsrc.Topic()
@@ -321,8 +321,8 @@
log_client_to_db()
- if (ckey in clientmessages)
- for (var/message in clientmessages[ckey])
+ if(ckey in clientmessages)
+ for(var/message in clientmessages[ckey])
to_chat(src, message)
clientmessages.Remove(ckey)
@@ -362,7 +362,7 @@
/client/proc/log_client_to_db()
- if ( IsGuestKey(src.key) )
+ if( IsGuestKey(src.key) )
return
establish_db_connection()
diff --git a/code/modules/client/message.dm b/code/modules/client/message.dm
index 6406a7d051a..a5c78008b4f 100644
--- a/code/modules/client/message.dm
+++ b/code/modules/client/message.dm
@@ -2,8 +2,8 @@ var/list/clientmessages = list()
proc/addclientmessage(var/ckey, var/message)
ckey = ckey(ckey)
- if (!ckey || !message)
+ if(!ckey || !message)
return
- if (!(ckey in clientmessages))
+ if(!(ckey in clientmessages))
clientmessages[ckey] = list()
clientmessages[ckey] += message
diff --git a/code/modules/client/preference/loadout/loadout_accessories.dm b/code/modules/client/preference/loadout/loadout_accessories.dm
index e392f8a4087..b86d5c44ed1 100644
--- a/code/modules/client/preference/loadout/loadout_accessories.dm
+++ b/code/modules/client/preference/loadout/loadout_accessories.dm
@@ -61,4 +61,35 @@
/datum/gear/accessory/scarf/stripedblue
display_name = "scarf, striped blue"
- path = /obj/item/clothing/accessory/stripedbluescarf
\ No newline at end of file
+ path = /obj/item/clothing/accessory/stripedbluescarf
+
+/datum/gear/accessory/holobadge
+ display_name = "holobadge, pin"
+ path = /obj/item/clothing/accessory/holobadge
+ allowed_roles = list("Head of Security", "Warden", "Security Officer", "Security Pod Pilot")
+
+/datum/gear/accessory/holobadge_n
+ display_name = "holobadge, cord"
+ path = /obj/item/clothing/accessory/holobadge/cord
+ allowed_roles = list("Head of Security", "Warden", "Security Officer", "Security Pod Pilot")
+
+/datum/gear/accessory/tieblue
+ display_name = "tie, blue"
+ path = /obj/item/clothing/accessory/blue
+
+/datum/gear/accessory/tiered
+ display_name = "tie, red"
+ path = /obj/item/clothing/accessory/red
+
+/datum/gear/accessory/tieblack
+ display_name = "tie, black"
+ path = /obj/item/clothing/accessory/black
+
+/datum/gear/accessory/tiehorrible
+ display_name = "tie, vomit green"
+ path = /obj/item/clothing/accessory/horrible
+
+/datum/gear/accessory/stethoscope
+ display_name = "stethoscope"
+ path = /obj/item/clothing/accessory/stethoscope
+ allowed_roles = list("Chief Medical Officer", "Medical Doctor", "Paramedic", "Brig Physician")
diff --git a/code/modules/client/preference/loadout/loadout_cosmetics.dm b/code/modules/client/preference/loadout/loadout_cosmetics.dm
index 6fc2c7f321b..0b47a299ce6 100644
--- a/code/modules/client/preference/loadout/loadout_cosmetics.dm
+++ b/code/modules/client/preference/loadout/loadout_cosmetics.dm
@@ -13,4 +13,8 @@
/datum/gear/lipstick/red
display_name = "lipstick, red"
- path = /obj/item/weapon/lipstick
\ No newline at end of file
+ path = /obj/item/weapon/lipstick
+
+/datum/gear/monocle
+ display_name = "monocle"
+ path = /obj/item/clothing/glasses/monocle
\ No newline at end of file
diff --git a/code/modules/client/preference/loadout/loadout_general.dm b/code/modules/client/preference/loadout/loadout_general.dm
index 9266dc6ebf0..6447c2bed2a 100644
--- a/code/modules/client/preference/loadout/loadout_general.dm
+++ b/code/modules/client/preference/loadout/loadout_general.dm
@@ -1,3 +1,72 @@
/datum/gear/dice
- display_name = "d20"
- path = /obj/item/weapon/dice/d20
\ No newline at end of file
+ display_name = "a d20"
+ path = /obj/item/weapon/dice/d20
+
+/datum/gear/uplift
+ display_name = "a pack of Uplifts"
+ path = /obj/item/weapon/storage/fancy/cigarettes/cigpack_uplift
+
+/datum/gear/robust
+ display_name = "a pack of Robusts"
+ path = /obj/item/weapon/storage/fancy/cigarettes/cigpack_robust
+
+/datum/gear/carp
+ display_name = "a pack of Carps"
+ path = /obj/item/weapon/storage/fancy/cigarettes/cigpack_carp
+
+/datum/gear/midori
+ display_name = "a pack of Midoris"
+ path = /obj/item/weapon/storage/fancy/cigarettes/cigpack_midori
+
+/datum/gear/lighter
+ display_name = "a cheap lighter"
+ path = /obj/item/weapon/lighter
+
+/datum/gear/rock
+ display_name = "a pet rock"
+ path = /obj/item/toy/pet_rock
+
+/datum/gear/sechud
+ display_name = "a classic security HUD"
+ path = /obj/item/clothing/glasses/hud/security
+ allowed_roles = list("Head of Security", "Warden", "Security Officer", "Security Pod Pilot", "Internal Affairs Agent")
+
+/datum/gear/matches
+ display_name = "a box of matches"
+ path = /obj/item/weapon/storage/box/matches
+
+/datum/gear/cards
+ display_name = "a deck of cards"
+ path = /obj/item/toy/cards/deck
+
+/datum/gear/blackbandana
+ display_name = "bandana, black"
+ path = /obj/item/clothing/mask/bandana/black
+
+/datum/gear/purplebandana
+ display_name = "bandana, purple"
+ path = /obj/item/clothing/mask/bandana/purple
+
+/datum/gear/orangebandana
+ display_name = "bandana, orange"
+ path = /obj/item/clothing/mask/bandana/orange
+
+/datum/gear/greenbandana
+ display_name = "bandana, green"
+ path = /obj/item/clothing/mask/bandana/green
+
+/datum/gear/bluebandana
+ display_name = "bandana, blue"
+ path = /obj/item/clothing/mask/bandana/blue
+
+/datum/gear/redbandana
+ display_name = "bandana, red"
+ path = /obj/item/clothing/mask/bandana/red
+
+/datum/gear/goldbandana
+ display_name = "bandana, gold"
+ path = /obj/item/clothing/mask/bandana/gold
+
+/datum/gear/skullbandana
+ display_name = "bandana, skull"
+ path = /obj/item/clothing/mask/bandana/skull
diff --git a/code/modules/client/preference/loadout/loadout_hat.dm b/code/modules/client/preference/loadout/loadout_hat.dm
new file mode 100644
index 00000000000..5580d76f1e5
--- /dev/null
+++ b/code/modules/client/preference/loadout/loadout_hat.dm
@@ -0,0 +1,114 @@
+/datum/gear/hat
+ subtype_path = /datum/gear/hat
+ slot = slot_head
+ sort_category = "Headwear"
+
+/datum/gear/hat/hhat_yellow
+ display_name = "hardhat, yellow"
+ path = /obj/item/clothing/head/hardhat
+ allowed_roles = list("Chief Engineer", "Station Engineer", "Mechanic", "Life Support Specialist")
+
+/datum/gear/hat/hhat_orange
+ display_name = "hardhat, orange"
+ path = /obj/item/clothing/head/hardhat/orange
+ allowed_roles = list("Chief Engineer", "Station Engineer", "Mechanic", "Life Support Specialist")
+
+/datum/gear/hat/hhat_blue
+ display_name = "hardhat, blue"
+ path = /obj/item/clothing/head/hardhat/dblue
+ allowed_roles = list("Chief Engineer", "Station Engineer", "Mechanic", "Life Support Specialist")
+
+/datum/gear/hat/that
+ display_name = "top hat"
+ path = /obj/item/clothing/head/that
+
+/datum/gear/hat/flatcap
+ display_name = "flat cap"
+ path = /obj/item/clothing/head/flatcap
+
+/datum/gear/hat/fez
+ display_name = "fez"
+ path = /obj/item/clothing/head/fez
+
+/datum/gear/hat/bfedora
+ display_name = "fedora, black"
+ path = /obj/item/clothing/head/fedora
+
+/datum/gear/hat/wfedora
+ display_name = "fedora, white"
+ path = /obj/item/clothing/head/fedora/whitefedora
+
+/datum/gear/hat/brfedora
+ display_name = "fedora, brown"
+ path = /obj/item/clothing/head/fedora/brownfedora
+
+/datum/gear/hat/beretsec
+ display_name = "security beret"
+ path = /obj/item/clothing/head/beret/sec
+ allowed_roles = list("Head of Security", "Warden", "Security Officer", "Security Pod Pilot")
+
+/datum/gear/hat/capcsec
+ display_name = "security corporate cap"
+ path = /obj/item/clothing/head/soft/sec/corp
+ allowed_roles = list("Head of Security", "Warden", "Security Officer", "Security Pod Pilot")
+
+/datum/gear/hat/capsec
+ display_name = "security cap"
+ path = /obj/item/clothing/head/soft/sec
+ allowed_roles = list("Head of Security", "Warden", "Security Officer", "Security Pod Pilot")
+
+/datum/gear/hat/capred
+ display_name = "cap, red"
+ path = /obj/item/clothing/head/soft/red
+
+/datum/gear/hat/capblue
+ display_name = "cap, blue"
+ path = /obj/item/clothing/head/soft/blue
+
+/datum/gear/hat/capgreen
+ display_name = "cap, green"
+ path = /obj/item/clothing/head/soft/green
+
+/datum/gear/hat/capblack
+ display_name = "cap, black"
+ path = /obj/item/clothing/head/soft/black
+
+/datum/gear/hat/cappurple
+ display_name = "cap, purple"
+ path = /obj/item/clothing/head/soft/purple
+
+/datum/gear/hat/capwhite
+ display_name = "cap, white"
+ path = /obj/item/clothing/head/soft/mime
+
+/datum/gear/hat/caporange
+ display_name = "cap, orange"
+ path = /obj/item/clothing/head/soft/orange
+
+/datum/gear/hat/capgrey
+ display_name = "cap, grey"
+ path = /obj/item/clothing/head/soft/grey
+
+/datum/gear/hat/capyellow
+ display_name = "cap, yellow"
+ path = /obj/item/clothing/head/soft/yellow
+
+/datum/gear/hat/cowboyhat
+ display_name = "cowboy hat"
+ path = /obj/item/clothing/head/cowboyhat
+
+/datum/gear/hat/pr_beret
+ display_name = "beret, purple"
+ path = /obj/item/clothing/head/beret/purple_normal
+
+/datum/gear/hat/bl_beret
+ display_name = "beret, black"
+ path = /obj/item/clothing/head/beret/black
+
+/datum/gear/hat/blu_beret
+ display_name = "beret, blue"
+ path = /obj/item/clothing/head/beret/blue
+
+/datum/gear/hat/red_beret
+ display_name = "beret, red"
+ path = /obj/item/clothing/head/beret
diff --git a/code/modules/client/preference/loadout/loadout_shoes.dm b/code/modules/client/preference/loadout/loadout_shoes.dm
new file mode 100644
index 00000000000..ec32e30d661
--- /dev/null
+++ b/code/modules/client/preference/loadout/loadout_shoes.dm
@@ -0,0 +1,18 @@
+/datum/gear/shoes
+ subtype_path = /datum/gear/shoes
+ slot = slot_shoes
+ sort_category = "Shoes"
+
+/datum/gear/shoes/sandals
+ display_name = "sandals, wooden"
+ path = /obj/item/clothing/shoes/sandal
+
+/datum/gear/shoes/fancysandals
+ display_name = "sandals, fancy"
+ cost = 5
+ path = /obj/item/clothing/shoes/sandal/fancy
+
+/datum/gear/shoes/dressshoes
+ display_name = "dress shoes"
+ cost = 5
+ path = /obj/item/clothing/shoes/centcom
diff --git a/code/modules/client/preference/loadout/loadout_suit.dm b/code/modules/client/preference/loadout/loadout_suit.dm
new file mode 100644
index 00000000000..2ac4b3bb7e9
--- /dev/null
+++ b/code/modules/client/preference/loadout/loadout_suit.dm
@@ -0,0 +1,160 @@
+/datum/gear/suit
+ subtype_path = /datum/gear/suit
+ slot = slot_wear_suit
+ cost = 2
+ sort_category = "External Wear"
+
+//WINTER COATS
+/datum/gear/suit/coat
+ subtype_path = /datum/gear/suit/coat
+
+/datum/gear/suit/coat/grey
+ display_name = "winter coat"
+ path = /obj/item/clothing/suit/hooded/wintercoat
+
+/datum/gear/suit/coat/job
+ subtype_path = /datum/gear/suit/coat/job
+ subtype_cost_overlap = FALSE
+
+/datum/gear/suit/coat/job/sec
+ display_name = "winter coat, security"
+ path = /obj/item/clothing/suit/hooded/wintercoat/security
+ allowed_roles = list("Head of Security", "Warden", "Detective", "Security Officer", "Security Pod Pilot")
+
+/datum/gear/suit/coat/job/captain
+ display_name = "winter coat, captain"
+ path = /obj/item/clothing/suit/hooded/wintercoat/captain
+ allowed_roles = list("Captain")
+
+/datum/gear/suit/coat/job/med
+ display_name = "winter coat, medical"
+ path = /obj/item/clothing/suit/hooded/wintercoat/medical
+ allowed_roles = list("Chief Medical Officer", "Medical Doctor", "Chemist", "Psychiatrist", "Paramedic", "Virologist", "Brig Physician")
+
+/datum/gear/suit/coat/job/sci
+ display_name = "winter coat, science"
+ path = /obj/item/clothing/suit/hooded/wintercoat/science
+ allowed_roles = list("Scientist", "Research Director")
+
+/datum/gear/suit/coat/job/engi
+ display_name = "winter coat, engineering"
+ path = /obj/item/clothing/suit/hooded/wintercoat/engineering
+ allowed_roles = list("Chief Engineer", "Station Engineer", "Mechanic")
+
+/datum/gear/suit/coat/job/atmos
+ display_name = "winter coat, atmospherics"
+ path = /obj/item/clothing/suit/hooded/wintercoat/engineering/atmos
+ allowed_roles = list("Chief Engineer", "Life Support Specialist")
+
+/datum/gear/suit/coat/job/hydro
+ display_name = "winter coat, hydroponics"
+ path = /obj/item/clothing/suit/hooded/wintercoat/hydro
+ allowed_roles = list("Botanist")
+
+/datum/gear/suit/coat/job/cargo
+ display_name = "winter coat, cargo"
+ path = /obj/item/clothing/suit/hooded/wintercoat/cargo
+ allowed_roles = list("Quartermaster", "Cargo Technician")
+
+/datum/gear/suit/coat/job/miner
+ display_name = "winter coat, miner"
+ path = /obj/item/clothing/suit/hooded/wintercoat/miner
+ allowed_roles = list("Shaft Miner")
+
+//LABCOATS
+/datum/gear/suit/labcoat_emt
+ display_name = "labcoat, paramedic"
+ path = /obj/item/clothing/suit/storage/labcoat/emt
+ allowed_roles = list("Chief Medical Officer", "Paramedic")
+
+//JACKETS
+/datum/gear/suit/leather_jacket
+ display_name = "leather jacket"
+ path = /obj/item/clothing/suit/jacket/leather
+
+/datum/gear/suit/br_tcoat
+ display_name = "trenchcoat, brown"
+ path = /obj/item/clothing/suit/browntrenchcoat
+
+/datum/gear/suit/bl_tcoat
+ display_name = "trenchcoat, black"
+ path = /obj/item/clothing/suit/blacktrenchcoat
+
+/datum/gear/suit/bomber_jacket
+ display_name = "bomber jacket"
+ path = /obj/item/clothing/suit/jacket
+
+/datum/gear/suit/ol_miljacket
+ display_name = "military jacket, olive"
+ path = /obj/item/clothing/suit/jacket/miljacket
+
+/datum/gear/suit/nv_miljacket
+ display_name = "military jacket, navy"
+ path = /obj/item/clothing/suit/jacket/miljacket/navy
+
+/datum/gear/suit/ds_miljacket
+ display_name = "military jacket, desert"
+ path = /obj/item/clothing/suit/jacket/miljacket/desert
+
+/datum/gear/suit/wh_miljacket
+ display_name = "military jacket, white"
+ path = /obj/item/clothing/suit/jacket/miljacket/white
+
+/datum/gear/suit/secjacket
+ display_name = "security jacket"
+ path = /obj/item/clothing/suit/armor/secjacket
+ allowed_roles = list("Head of Security", "Warden", "Detective", "Security Officer", "Security Pod Pilot")
+
+/datum/gear/suit/poncho
+ display_name = "poncho, classic"
+ path = /obj/item/clothing/suit/poncho
+
+/datum/gear/suit/grponcho
+ display_name = "poncho, green"
+ path = /obj/item/clothing/suit/poncho/green
+
+/datum/gear/suit/rdponcho
+ display_name = "poncho, red"
+ path = /obj/item/clothing/suit/poncho/red
+
+/datum/gear/suit/tphoodie
+ display_name = "hoodie, Tharsis Polytech"
+ path = /obj/item/clothing/suit/hooded/hoodie/tp
+
+/datum/gear/suit/nthoodie
+ display_name = "hoodie, Nanotrasen"
+ path = /obj/item/clothing/suit/hooded/hoodie/nt
+
+/datum/gear/suit/lamhoodie
+ display_name = "hoodie, Lunar Academy of Medicine"
+ path = /obj/item/clothing/suit/hooded/hoodie/lam
+
+/datum/gear/suit/cuthoodie
+ display_name = "hoodie, Canaan University of Technology"
+ path = /obj/item/clothing/suit/hooded/hoodie/cut
+
+/datum/gear/suit/mithoodie
+ display_name = "hoodie, Martian Institute of Technology"
+ path = /obj/item/clothing/suit/hooded/hoodie/mit
+
+/datum/gear/suit/bluehoodie
+ display_name = "hoodie, blue"
+ path = /obj/item/clothing/suit/hooded/hoodie/blue
+
+/datum/gear/suit/blackhoodie
+ display_name = "hoodie, black"
+ path = /obj/item/clothing/suit/hooded/hoodie
+
+//SUITS!
+
+/datum/gear/suit/blacksuit
+ display_name = "suit jacket, black"
+ path = /obj/item/clothing/suit/storage/lawyer/blackjacket
+
+/datum/gear/suit/bluesuit
+ display_name = "suit jacket, blue"
+ path = /obj/item/clothing/suit/storage/lawyer/bluejacket
+
+/datum/gear/suit/purplesuit
+ display_name = "suit jacket, purple"
+ path = /obj/item/clothing/suit/storage/lawyer/purpjacket
diff --git a/code/modules/client/preference/loadout/loadout_uniform.dm b/code/modules/client/preference/loadout/loadout_uniform.dm
index 826cc7d5838..aaec97829c8 100644
--- a/code/modules/client/preference/loadout/loadout_uniform.dm
+++ b/code/modules/client/preference/loadout/loadout_uniform.dm
@@ -2,6 +2,7 @@
/datum/gear/uniform
subtype_path = /datum/gear/uniform
slot = slot_w_uniform
+ cost = 2
sort_category = "Uniforms and Casual Dress"
/datum/gear/uniform/skirt
@@ -24,7 +25,6 @@
path = /obj/item/clothing/under/blackskirt
/datum/gear/uniform/skirt/job
- cost = 3
subtype_path = /datum/gear/uniform/skirt/job
subtype_cost_overlap = FALSE
@@ -66,7 +66,7 @@
/datum/gear/uniform/skirt/job/med
display_name = "skirt, medical"
path = /obj/item/clothing/under/rank/medical/skirt
- allowed_roles = list("Chief Medical Officer","Medical Doctor","Chemist","Psychiatrist","Paramedic")
+ allowed_roles = list("Chief Medical Officer","Medical Doctor","Chemist","Psychiatrist","Paramedic","Brig Physician")
/datum/gear/uniform/skirt/job/sci
display_name = "skirt, scientist"
@@ -96,4 +96,101 @@
/datum/gear/uniform/skirt/job/head_of_security
display_name = "skirt, hos"
path = /obj/item/clothing/under/rank/head_of_security/skirt
- allowed_roles = list("Head of Security")
\ No newline at end of file
+ allowed_roles = list("Head of Security")
+
+/datum/gear/uniform/sec
+ subtype_path = /datum/gear/uniform/sec
+
+/datum/gear/uniform/sec/formal
+ display_name = "security uniform, formal"
+ path = /obj/item/clothing/under/rank/security/formal
+ allowed_roles = list("Head of Security", "Warden", "Detective", "Security Officer", "Security Pod Pilot")
+
+/datum/gear/uniform/sec/secorporate
+ display_name = "security uniform, corporate"
+ path = /obj/item/clothing/under/rank/security/corp
+ allowed_roles = list("Head of Security", "Warden", "Security Officer", "Security Pod Pilot")
+
+/datum/gear/uniform/sec/dispatch
+ display_name = "security uniform, dispatch"
+ path = /obj/item/clothing/under/rank/dispatch
+ allowed_roles = list("Head of Security", "Warden", "Security Officer", "Security Pod Pilot")
+
+/datum/gear/uniform/sec/casual
+ display_name = "security uniform, casual"
+ path = /obj/item/clothing/under/rank/security2
+ allowed_roles = list("Head of Security", "Warden", "Security Officer", "Detective", "Security Pod Pilot")
+
+/datum/gear/uniform/shorts
+ subtype_path = /datum/gear/uniform/shorts
+
+/datum/gear/uniform/shorts/red
+ display_name = "shorts, red"
+ path = /obj/item/clothing/under/shorts/red
+
+/datum/gear/uniform/shorts/green
+ display_name = "shorts, green"
+ path = /obj/item/clothing/under/shorts/green
+
+/datum/gear/uniform/shorts/blue
+ display_name = "shorts, blue"
+ path = /obj/item/clothing/under/shorts/blue
+
+/datum/gear/uniform/shorts/black
+ display_name = "shorts, black"
+ path = /obj/item/clothing/under/shorts/black
+
+/datum/gear/uniform/shorts/grey
+ display_name = "shorts, grey"
+ path = /obj/item/clothing/under/shorts/grey
+
+/datum/gear/uniform/pants
+ subtype_path = /datum/gear/uniform/pants
+
+/datum/gear/uniform/pants/jeans
+ display_name = "jeans, classic"
+ path = /obj/item/clothing/under/pants/classicjeans
+
+/datum/gear/uniform/pants/mjeans
+ display_name = "jeans, mustang"
+ path = /obj/item/clothing/under/pants/mustangjeans
+
+/datum/gear/uniform/pants/bljeans
+ display_name = "jeans, black"
+ path = /obj/item/clothing/under/pants/blackjeans
+
+/datum/gear/uniform/pants/yfjeans
+ display_name = "jeans, Young Folks"
+ path = /obj/item/clothing/under/pants/youngfolksjeans
+
+/datum/gear/uniform/pants/whitepants
+ display_name = "pants, white"
+ path = /obj/item/clothing/under/pants/white
+
+/datum/gear/uniform/pants/redpants
+ display_name = "pants, red"
+ path = /obj/item/clothing/under/pants/red
+
+/datum/gear/uniform/pants/blackpants
+ display_name = "pants, black"
+ path = /obj/item/clothing/under/pants/black
+
+/datum/gear/uniform/pants/tanpants
+ display_name = "pants, tan"
+ path = /obj/item/clothing/under/pants/tan
+
+/datum/gear/uniform/pants/bluepants
+ display_name = "pants, blue"
+ path = /obj/item/clothing/under/pants/blue
+
+/datum/gear/uniform/pants/trackpants
+ display_name = "trackpants"
+ path = /obj/item/clothing/under/pants/track
+
+/datum/gear/uniform/pants/khakipants
+ display_name = "pants, khaki"
+ path = /obj/item/clothing/under/pants/khaki
+
+/datum/gear/uniform/pants/caopants
+ display_name = "pants, camo"
+ path = /obj/item/clothing/under/pants/camo
diff --git a/code/modules/client/preference/preferences.dm b/code/modules/client/preference/preferences.dm
index da01c469e43..0e1142a3781 100644
--- a/code/modules/client/preference/preferences.dm
+++ b/code/modules/client/preference/preferences.dm
@@ -532,7 +532,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
//The job before the current job. I only use this to get the previous jobs color when I'm filling in blank rows.
var/datum/job/lastJob
- if (!job_master) return
+ if(!job_master) return
for(var/datum/job/job in job_master.occupations)
if(job.admin_only)
@@ -656,10 +656,10 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
return
/datum/preferences/proc/SetJobPreferenceLevel(var/datum/job/job, var/level)
- if (!job)
+ if(!job)
return 0
- if (level == 1) // to high
+ if(level == 1) // to high
// remove any other job(s) set to high
job_support_med |= job_support_high
job_engsec_med |= job_engsec_high
@@ -670,59 +670,59 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
job_medsci_high = 0
job_karma_high = 0
- if (job.department_flag == SUPPORT)
+ if(job.department_flag == SUPPORT)
job_support_low &= ~job.flag
job_support_med &= ~job.flag
job_support_high &= ~job.flag
switch(level)
- if (1)
+ if(1)
job_support_high |= job.flag
- if (2)
+ if(2)
job_support_med |= job.flag
- if (3)
+ if(3)
job_support_low |= job.flag
return 1
- else if (job.department_flag == ENGSEC)
+ else if(job.department_flag == ENGSEC)
job_engsec_low &= ~job.flag
job_engsec_med &= ~job.flag
job_engsec_high &= ~job.flag
switch(level)
- if (1)
+ if(1)
job_engsec_high |= job.flag
- if (2)
+ if(2)
job_engsec_med |= job.flag
- if (3)
+ if(3)
job_engsec_low |= job.flag
return 1
- else if (job.department_flag == MEDSCI)
+ else if(job.department_flag == MEDSCI)
job_medsci_low &= ~job.flag
job_medsci_med &= ~job.flag
job_medsci_high &= ~job.flag
switch(level)
- if (1)
+ if(1)
job_medsci_high |= job.flag
- if (2)
+ if(2)
job_medsci_med |= job.flag
- if (3)
+ if(3)
job_medsci_low |= job.flag
return 1
- else if (job.department_flag == KARMA)
+ else if(job.department_flag == KARMA)
job_karma_low &= ~job.flag
job_karma_med &= ~job.flag
job_karma_high &= ~job.flag
switch(level)
- if (1)
+ if(1)
job_karma_high |= job.flag
- if (2)
+ if(2)
job_karma_med |= job.flag
- if (3)
+ if(3)
job_karma_low |= job.flag
return 1
@@ -737,7 +737,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
ShowChoices(user)
return
- if (!isnum(desiredLvl))
+ if(!isnum(desiredLvl))
to_chat(user, "\red UpdateJobPreference - desired level was not a number. Please notify coders!")
ShowChoices(user)
return
@@ -997,9 +997,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
else
return 0
SetChoices(user)
- if ("alt_title")
+ if("alt_title")
var/datum/job/job = locate(href_list["job"])
- if (job)
+ if(job)
var/choices = list(job.title) + job.alt_titles
var/choice = input("Pick a title for [job.title].", "Character Generation", GetPlayerAltTitle(job)) as anything in choices | null
if(choice)
@@ -1155,7 +1155,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
switch(href_list["preference"])
if("name")
var/raw_name = input(user, "Choose your character's name:", "Character Preference") as text|null
- if (!isnull(raw_name)) // Check to ensure that the user entered text (rather than cancel.)
+ if(!isnull(raw_name)) // Check to ensure that the user entered text (rather than cancel.)
var/new_name = reject_bad_name(raw_name)
if(new_name)
real_name = new_name
@@ -1838,7 +1838,7 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
close_load_dialog(user)
if("tab")
- if (href_list["tab"])
+ if(href_list["tab"])
current_tab = text2num(href_list["tab"])
ShowChoices(user)
@@ -1865,10 +1865,9 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
character.name = character.real_name
character.flavor_text = flavor_text
- if(character.ckey && !jobban_isbanned(character, "Records"))
- character.med_record = med_record
- character.sec_record = sec_record
- character.gen_record = gen_record
+ character.med_record = med_record
+ character.sec_record = sec_record
+ character.gen_record = gen_record
character.change_gender(gender)
character.age = age
@@ -1942,15 +1941,15 @@ var/global/list/special_role_times = list( //minimum age (in days) for accounts
if(disabilities & DISABILITY_FLAG_DEAF)
character.dna.SetSEState(DEAFBLOCK,1,1)
- character.sdisabilities|=DEAF
+ character.disabilities|=DEAF
if(disabilities & DISABILITY_FLAG_BLIND)
character.dna.SetSEState(BLINDBLOCK,1,1)
- character.sdisabilities|=BLIND
+ character.disabilities|=BLIND
if(disabilities & DISABILITY_FLAG_MUTE)
character.dna.SetSEState(MUTEBLOCK,1,1)
- character.sdisabilities |= MUTE
+ character.disabilities |= MUTE
S.handle_dna(character)
diff --git a/code/modules/client/preference/preferences_mysql.dm b/code/modules/client/preference/preferences_mysql.dm
index d30f9ea1f25..be47a7c1183 100644
--- a/code/modules/client/preference/preferences_mysql.dm
+++ b/code/modules/client/preference/preferences_mysql.dm
@@ -68,7 +68,7 @@
/datum/preferences/proc/save_preferences(client/C)
// Might as well scrub out any malformed be_special list entries while we're here
- for (var/role in be_special)
+ for(var/role in be_special)
if(!(role in special_roles))
log_to_dd("[C.key] had a malformed role entry: '[role]'. Removing!")
be_special -= role
diff --git a/code/modules/clothing/clothing.dm b/code/modules/clothing/clothing.dm
index 77de69f6767..afc11b0acf8 100644
--- a/code/modules/clothing/clothing.dm
+++ b/code/modules/clothing/clothing.dm
@@ -31,7 +31,7 @@
/obj/item/clothing/mob_can_equip(M as mob, slot)
//if we can equip the item anyway, don't bother with species_restricted (aslo cuts down on spam)
- if (!..())
+ if(!..())
return 0
if(species_restricted && istype(M,/mob/living/carbon/human))
@@ -66,12 +66,12 @@
species_restricted = list(target_species)
//Set icon
- if (sprite_sheets && (target_species in sprite_sheets))
+ if(sprite_sheets && (target_species in sprite_sheets))
icon_override = sprite_sheets[target_species]
else
icon_override = initial(icon_override)
- if (sprite_sheets_obj && (target_species in sprite_sheets_obj))
+ if(sprite_sheets_obj && (target_species in sprite_sheets_obj))
icon = sprite_sheets_obj[target_species]
else
icon = initial(icon)
@@ -79,14 +79,14 @@
//Ears: currently only used for headsets and earmuffs
/obj/item/clothing/ears
name = "ears"
- w_class = 1.0
+ w_class = 1
throwforce = 2
slot_flags = SLOT_EARS
/obj/item/clothing/ears/attack_hand(mob/user as mob)
- if (!user) return
+ if(!user) return
- if (src.loc != user || !istype(user,/mob/living/carbon/human))
+ if(src.loc != user || !istype(user,/mob/living/carbon/human))
..()
return
@@ -95,7 +95,7 @@
..()
return
- if(flags & NODROP)
+ if(!usr.canUnEquip(src))
return
var/obj/item/clothing/ears/O
@@ -110,7 +110,7 @@
user.unEquip(src)
- if (O)
+ if(O)
user.put_in_hands(O)
O.add_fingerprint(user)
@@ -119,7 +119,7 @@
/obj/item/clothing/ears/offear
name = "Other ear"
- w_class = 5.0
+ w_class = 5
icon = 'icons/mob/screen_gen.dmi'
icon_state = "block"
slot_flags = SLOT_EARS | SLOT_TWOEARS
@@ -144,7 +144,7 @@
/obj/item/clothing/glasses
name = "glasses"
icon = 'icons/obj/clothing/glasses.dmi'
- w_class = 2.0
+ w_class = 2
flags = GLASSESCOVERSEYES
slot_flags = SLOT_EYES
materials = list(MAT_GLASS = 250)
@@ -171,7 +171,7 @@ BLIND // can't see anything
/obj/item/clothing/gloves
name = "gloves"
gender = PLURAL //Carn: for grammarically correct text-parsing
- w_class = 2.0
+ w_class = 2
icon = 'icons/obj/clothing/gloves.dmi'
siemens_coefficient = 0.50
body_parts_covered = HANDS
@@ -179,41 +179,21 @@ BLIND // can't see anything
attack_verb = list("challenged")
var/transfer_prints = FALSE
var/pickpocket = 0 //Master pickpocket?
- var/clipped = 0
strip_delay = 20
put_on_delay = 40
- species_restricted = list("exclude","Unathi","Tajaran","Wryn")
species_fit = list("Vox")
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/gloves.dmi',
"Drask" = 'icons/mob/species/drask/gloves.dmi'
)
-/obj/item/clothing/gloves/attackby(obj/item/weapon/W, mob/user, params)
- if(istype(W, /obj/item/weapon/wirecutters))
- if(!clipped)
- playsound(src.loc, 'sound/items/Wirecutter.ogg', 100, 1)
- user.visible_message("[user] snips the fingertips off [src].","You snip the fingertips off [src].")
- clipped = 1
- name = "mangled [name]"
- desc = "[desc] They have had the fingertips cut off of them."
- if("exclude" in species_restricted)
- species_restricted -= "Unathi"
- species_restricted -= "Tajaran"
- update_icon()
- else
- to_chat(user, "[src] have already been clipped!")
- return
- else
- ..()
-
/obj/item/clothing/gloves/proc/Touch()
return
/obj/item/clothing/under/proc/set_sensors(mob/user as mob)
var/mob/M = user
- if (istype(M, /mob/dead/)) return
- if (user.stat || user.restrained()) return
+ if(istype(M, /mob/dead/)) return
+ if(user.stat || user.restrained()) return
if(has_sensor >= 2)
to_chat(user, "The controls are locked.")
return 0
@@ -228,7 +208,7 @@ BLIND // can't see anything
return
sensor_mode = modes.Find(switchMode) - 1
- if (src.loc == user)
+ if(src.loc == user)
switch(sensor_mode)
if(0)
to_chat(user, "You disable your suit's remote sensing equipment.")
@@ -243,7 +223,7 @@ BLIND // can't see anything
if(H.w_uniform == src)
H.update_suit_sensors()
- else if (istype(src.loc, /mob))
+ else if(istype(src.loc, /mob))
switch(sensor_mode)
if(0)
for(var/mob/V in viewers(user, 1))
@@ -289,7 +269,6 @@ BLIND // can't see anything
body_parts_covered = HEAD
slot_flags = SLOT_MASK
var/mask_adjusted = 0
- var/ignore_maskadjust = 1
var/adjusted_flags = null
strip_delay = 40
put_on_delay = 40
@@ -297,60 +276,61 @@ BLIND // can't see anything
//Proc that moves gas/breath masks out of the way
/obj/item/clothing/mask/proc/adjustmask(var/mob/user)
var/mob/living/carbon/human/H = usr //Used to check if the mask is on the head, to check if the hands are full, and to turn off internals if they were on when the mask was pushed out of the way.
- if(!ignore_maskadjust)
- if(user.incapacitated()) //This check allows you to adjust your masks while you're buckled into chairs or beds.
- return
- if(mask_adjusted)
- icon_state = copytext(icon_state, 1, findtext(icon_state, "_up")) /*Trims the '_up' off the end of the icon state, thus reverting to the most recent previous state.
- Had to use this instead of initial() because initial reverted to the wrong state.*/
- gas_transfer_coefficient = initial(gas_transfer_coefficient)
- permeability_coefficient = initial(permeability_coefficient)
- to_chat(user, "You push \the [src] back into place.")
- mask_adjusted = 0
- slot_flags = initial(slot_flags)
- if(flags_inv != initial(flags_inv))
- if(initial(flags_inv) & HIDEFACE) //If the mask is one that hides the face and can be adjusted yet lost that trait when it was adjusted, make it hide the face again.
- flags_inv |= HIDEFACE
- if(flags != initial(flags))
- if(initial(flags) & MASKCOVERSMOUTH) //If the mask covers the mouth when it's down and can be adjusted yet lost that trait when it was adjusted, make it cover the mouth again.
- flags |= MASKCOVERSMOUTH
- if(initial(flags) & AIRTIGHT) //If the mask is airtight and thus, one that you'd be able to run internals from yet can't because it was adjusted, make it airtight again.
- flags |= AIRTIGHT
- if(H.head == src && flags_inv == HIDEFACE) //Means that only things like bandanas and balaclavas will be affected since they obscure the identity of the wearer.
- if(H.l_hand && H.r_hand) //If both hands are occupied, drop the object on the ground.
- user.unEquip(src)
- else //Otherwise, put it in an available hand, the active one preferentially.
- src.loc = user
- H.head = null
- user.put_in_hands(src)
- else
- icon_state += "_up"
- to_chat(user, "You push \the [src] out of the way.")
- gas_transfer_coefficient = null
- permeability_coefficient = null
- mask_adjusted = 1
- if(adjusted_flags)
- slot_flags = adjusted_flags
- if(ishuman(user) && H.internal && user.wear_mask == src && H.internals) /*If the user was wearing the mask providing internals on their face at the time it was adjusted, turn off internals.
- Otherwise, they adjusted it while it was in their hands or some such so we won't be needing to turn off internals.*/
- H.internals.icon_state = "internal0"
- H.internal = null
- if(flags_inv & HIDEFACE) //Means that only things like bandanas and balaclavas will be affected since they obscure the identity of the wearer.
- flags_inv &= ~HIDEFACE /*Done after the above to avoid having to do a check for initial(src.flags_inv == HIDEFACE).
- This reveals the user's face since the bandana will now be going on their head.*/
- if(flags & MASKCOVERSMOUTH) //Mask won't cover the mouth any more since it's been pushed out of the way. Allows for CPRing with adjusted masks.
- flags &= ~MASKCOVERSMOUTH
- if(flags & AIRTIGHT) //If the mask was airtight, it won't be anymore since you just pushed it off your face.
- flags &= ~AIRTIGHT
- if(user.wear_mask == src && initial(flags_inv) == HIDEFACE) //Means that you won't have to take off and put back on simple things like breath masks which, realistically, can just be pulled down off your face.
- if(H.l_hand && H.r_hand) //If both hands are occupied, drop the object on the ground.
- user.unEquip(src)
- else //Otherwise, put it in an available hand, the active one preferentially.
- src.loc = user
- user.wear_mask = null
- user.put_in_hands(src)
- usr.update_inv_wear_mask()
- usr.update_inv_head()
+ if(user.incapacitated()) //This check allows you to adjust your masks while you're buckled into chairs or beds.
+ return
+ if(mask_adjusted)
+ icon_state = initial(icon_state)
+ gas_transfer_coefficient = initial(gas_transfer_coefficient)
+ permeability_coefficient = initial(permeability_coefficient)
+ to_chat(user, "You push \the [src] back into place.")
+ mask_adjusted = 0
+ slot_flags = initial(slot_flags)
+ if(flags_inv != initial(flags_inv))
+ if(initial(flags_inv) & HIDEFACE) //If the mask is one that hides the face and can be adjusted yet lost that trait when it was adjusted, make it hide the face again.
+ flags_inv |= HIDEFACE
+ if(flags != initial(flags))
+ if(initial(flags) & MASKCOVERSMOUTH) //If the mask covers the mouth when it's down and can be adjusted yet lost that trait when it was adjusted, make it cover the mouth again.
+ flags |= MASKCOVERSMOUTH
+ if(initial(flags) & AIRTIGHT) //If the mask is airtight and thus, one that you'd be able to run internals from yet can't because it was adjusted, make it airtight again.
+ flags |= AIRTIGHT
+ if(H.head == src && flags_inv == HIDEFACE) //Means that only things like bandanas and balaclavas will be affected since they obscure the identity of the wearer.
+ if(H.l_hand && H.r_hand) //If both hands are occupied, drop the object on the ground.
+ user.unEquip(src)
+ else //Otherwise, put it in an available hand, the active one preferentially.
+ src.loc = user
+ H.head = null
+ user.put_in_hands(src)
+ else
+ icon_state += "_up"
+ to_chat(user, "You push \the [src] out of the way.")
+ gas_transfer_coefficient = null
+ permeability_coefficient = null
+ mask_adjusted = 1
+ if(adjusted_flags)
+ slot_flags = adjusted_flags
+ if(ishuman(user) && H.internal && user.wear_mask == src) /*If the user was wearing the mask providing internals on their face at the time it was adjusted, turn off internals.
+ Otherwise, they adjusted it while it was in their hands or some such so we won't be needing to turn off internals.*/
+ H.update_internals_hud_icon(0)
+ H.internal = null
+ if(flags_inv & HIDEFACE) //Means that only things like bandanas and balaclavas will be affected since they obscure the identity of the wearer.
+ flags_inv &= ~HIDEFACE /*Done after the above to avoid having to do a check for initial(src.flags_inv == HIDEFACE).
+ This reveals the user's face since the bandana will now be going on their head.*/
+ if(flags & MASKCOVERSMOUTH) //Mask won't cover the mouth any more since it's been pushed out of the way. Allows for CPRing with adjusted masks.
+ flags &= ~MASKCOVERSMOUTH
+ if(flags & AIRTIGHT) //If the mask was airtight, it won't be anymore since you just pushed it off your face.
+ flags &= ~AIRTIGHT
+ if(user.wear_mask == src && initial(flags_inv) == HIDEFACE) //Means that you won't have to take off and put back on simple things like breath masks which, realistically, can just be pulled down off your face.
+ if(H.l_hand && H.r_hand) //If both hands are occupied, drop the object on the ground.
+ user.unEquip(src)
+ else //Otherwise, put it in an available hand, the active one preferentially.
+ src.loc = user
+ user.wear_mask = null
+ user.put_in_hands(src)
+ usr.update_inv_wear_mask()
+ usr.update_inv_head()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
//Shoes
/obj/item/clothing/shoes
@@ -370,7 +350,6 @@ BLIND // can't see anything
permeability_coefficient = 0.50
slowdown = SHOES_SLOWDOWN
- species_restricted = list("exclude","Unathi","Tajaran","Wryn")
species_fit = list("Vox")
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/shoes.dmi'
@@ -403,9 +382,6 @@ BLIND // can't see anything
item_state = "[item_state]_opentoe"
name = "mangled [name]"
desc = "[desc] They have had their toes opened up."
- if("exclude" in species_restricted)
- species_restricted -= "Unathi"
- species_restricted -= "Tajaran"
update_icon()
else
to_chat(user, "[src] have already had their toes cut open!")
@@ -463,6 +439,9 @@ BLIND // can't see anything
flavour = "[copytext(adjust_flavour, 3, lentext(adjust_flavour) + 1)] up" //Trims off the 'un' at the beginning of the word. unzip -> zip, unbutton->button.
to_chat(user, "You [flavour] \the [src].")
suit_adjusted = 0 //Suit is no longer adjusted.
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
else
var/flavour = "open"
icon_state += "_open"
@@ -471,6 +450,9 @@ BLIND // can't see anything
flavour = "[adjust_flavour]"
to_chat(user, "You [flavour] \the [src].")
suit_adjusted = 1 //Suit's adjusted.
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
else
if(user.canUnEquip(src)) //Checks to see if the item can be unequipped. If so, lets shred. Otherwise, struggle and fail.
if(contents) //If the suit's got any storage capability...
@@ -493,6 +475,7 @@ BLIND // can't see anything
to_chat(user, "You attempt to button up the velcro on \the [src], before promptly realising how retarded you are.")
/obj/item/clothing/suit/equipped(var/mob/living/carbon/human/user, var/slot) //Handle tail-hiding on a by-species basis.
+ ..()
if(ishuman(user) && hide_tail_by_species && slot == slot_wear_suit)
if(user.species.name in hide_tail_by_species)
if(!(flags_inv & HIDETAIL)) //Hide the tail if the user's species is in the hide_tail_by_species list and the tail isn't already hidden.
@@ -501,20 +484,11 @@ BLIND // can't see anything
if(!(initial(flags_inv) & HIDETAIL) && (flags_inv & HIDETAIL)) //Otherwise, remove the HIDETAIL flag if it wasn't already in the flags_inv to start with.
flags_inv &= ~HIDETAIL
-/obj/item/clothing/suit/verb/openjacket(var/mob/user) //The verb you can use to adjust jackets.
- set name = "Open/Close Jacket"
- set category = "Object"
- set src in usr
- if(!isliving(usr))
- return
- if(usr.stat)
- return
- adjustsuit(user)
-
-/obj/item/clothing/suit/ui_action_click() //This is what happens when you click the HUD action button to adjust your suit.
+/obj/item/clothing/suit/ui_action_click(mob/user) //This is what happens when you click the HUD action button to adjust your suit.
if(!ignore_suitadjust)
- adjustsuit(usr)
- else ..() //This is required in order to ensure that the UI buttons for items that have alternate functions tied to UI buttons still work.
+ adjustsuit(user)
+ else
+ ..() //This is required in order to ensure that the UI buttons for items that have alternate functions tied to UI buttons still work.
//Spacesuit
//Note: Everything in modules/clothing/spacesuits should have the entire suit grouped together.
@@ -591,7 +565,7 @@ BLIND // can't see anything
return 0
if(accessories.len && (A.slot in list("utility","armband")))
for(var/obj/item/clothing/accessory/AC in accessories)
- if (AC.slot == A.slot)
+ if(AC.slot == A.slot)
return 0
/obj/item/clothing/under/attackby(obj/item/I, mob/user, params)
@@ -624,18 +598,20 @@ BLIND // can't see anything
A.attack_hand(user)
return
- if (ishuman(usr) && src.loc == user) //make it harder to accidentally undress yourself
+ if(ishuman(usr) && src.loc == user) //make it harder to accidentally undress yourself
return
..()
/obj/item/clothing/under/MouseDrop(obj/over_object as obj)
- if (ishuman(usr))
+ if(ishuman(usr))
//makes sure that the clothing is equipped so that we can't drag it into our hand from miles away.
- if (!(src.loc == usr))
+ if(!(src.loc == usr))
return
-
- if (!( usr.restrained() ) && !( usr.stat ) && ( over_object ))
+ if(!( usr.restrained() ) && !( usr.stat ) && ( over_object ))
+ if(!usr.canUnEquip(src))
+ to_chat(usr, "[src] appears stuck on you!")
+ return
switch(over_object.name)
if("r_hand")
usr.unEquip(src)
diff --git a/code/modules/clothing/glasses/glasses.dm b/code/modules/clothing/glasses/glasses.dm
index bad4a3dabc5..6a51086c7b3 100644
--- a/code/modules/clothing/glasses/glasses.dm
+++ b/code/modules/clothing/glasses/glasses.dm
@@ -1,7 +1,7 @@
/obj/item/clothing/glasses
name = "glasses"
icon = 'icons/obj/clothing/glasses.dmi'
- //w_class = 2.0
+ //w_class = 2
//flags = GLASSESCOVERSEYES
//slot_flags = SLOT_EYES
//var/vision_flags = 0
@@ -18,7 +18,7 @@
name = "prescription [name]"
/obj/item/clothing/glasses/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if (user.stat || user.restrained() || !ishuman(user))
+ if(user.stat || user.restrained() || !ishuman(user))
return ..()
var/mob/living/carbon/human/H = user
if(prescription_upgradable)
@@ -101,15 +101,11 @@
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/eyes.dmi'
)
+ actions_types = list(/datum/action/item_action/toggle_research_scanner)
-/obj/item/clothing/glasses/science/equipped(mob/user, slot)
+/obj/item/clothing/glasses/science/item_action_slot_check(slot)
if(slot == slot_glasses)
- user.scanner.Grant(user)
- ..(user, slot)
-
-/obj/item/clothing/glasses/science/dropped(mob/user)
- user.scanner.devices -= 1
- ..(user)
+ return 1
/obj/item/clothing/glasses/science/night
name = "Night Vision Science Goggle"
@@ -158,6 +154,7 @@
desc = "Such a dapper eyepiece!"
icon_state = "monocle"
item_state = "headset" // lol
+ prescription_upgradable = 1
species_fit = list("Vox")
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/eyes.dmi',
@@ -220,6 +217,7 @@
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/eyes.dmi'
)
+ prescription_upgradable = 1
/obj/item/clothing/glasses/sunglasses
desc = "Strangely ancient technology used to help provide rudimentary eye cover. Enhanced shielding blocks many flashes."
@@ -240,13 +238,16 @@
/obj/item/clothing/glasses/sunglasses/noir
name = "noir sunglasses"
desc = "Somehow these seem even more out-of-date than normal sunglasses."
- action_button_name = "Noir Mode"
+ actions_types = list(/datum/action/item_action/noir)
var/noir_mode = 0
color_view = MATRIX_GREYSCALE
/obj/item/clothing/glasses/sunglasses/noir/attack_self()
- if(is_equipped())
- toggle_noir()
+ toggle_noir()
+
+/obj/item/clothing/glasses/sunglasses/noir/item_action_slot_check(slot)
+ if(slot == slot_glasses)
+ return 1
/obj/item/clothing/glasses/sunglasses/noir/proc/toggle_noir()
if(!noir_mode)
@@ -275,16 +276,12 @@
name = "agreeable glasses"
desc = "H.C Limited edition."
var/punused = null
- action_button_name = "YEAH!"
+ actions_types = list(/datum/action/item_action/YEEEAAAAAHHHHHHHHHHHHH)
/obj/item/clothing/glasses/sunglasses/yeah/attack_self()
pun()
-
-/obj/item/clothing/glasses/sunglasses/yeah/verb/pun()
- set category = "Object"
- set name = "YEAH!"
- set src in usr
+/obj/item/clothing/glasses/sunglasses/yeah/proc/pun()
if(!punused)//one per round
punused = 1
playsound(src.loc, 'sound/misc/yeah.ogg', 100, 0)
@@ -328,7 +325,7 @@
desc = "Protects the eyes from welders, approved by the mad scientist association."
icon_state = "welding-g"
item_state = "welding-g"
- action_button_name = "Flip welding goggles"
+ actions_types = list(/datum/action/item_action/toggle)
flash_protect = 2
tint = 2
species_fit = list("Vox")
@@ -340,31 +337,28 @@
/obj/item/clothing/glasses/welding/attack_self()
toggle()
+/obj/item/clothing/glasses/welding/proc/toggle()
+ if(up)
+ up = !up
+ flags |= GLASSESCOVERSEYES
+ flags_inv |= HIDEEYES
+ icon_state = initial(icon_state)
+ to_chat(usr, "You flip the [src] down to protect your eyes.")
+ flash_protect = 2
+ tint = initial(tint) //better than istype
+ else
+ up = !up
+ flags &= ~GLASSESCOVERSEYES
+ flags_inv &= ~HIDEEYES
+ icon_state = "[initial(icon_state)]up"
+ to_chat(usr, "You push the [src] up out of your face.")
+ flash_protect = 0
+ tint = 0
+ usr.update_inv_glasses()
-/obj/item/clothing/glasses/welding/verb/toggle()
- set category = "Object"
- set name = "Adjust welding goggles"
- set src in usr
-
- if(usr.canmove && !usr.stat && !usr.restrained())
- if(src.up)
- src.up = !src.up
- src.flags |= GLASSESCOVERSEYES
- flags_inv |= HIDEEYES
- icon_state = initial(icon_state)
- to_chat(usr, "You flip the [src] down to protect your eyes.")
- flash_protect = 2
- tint = initial(tint) //better than istype
- else
- src.up = !src.up
- src.flags &= ~HEADCOVERSEYES
- flags_inv &= ~HIDEEYES
- icon_state = "[initial(icon_state)]up"
- to_chat(usr, "You push the [src] up out of your face.")
- flash_protect = 0
- tint = 0
-
- usr.update_inv_glasses()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
/obj/item/clothing/glasses/welding/superior
name = "superior welding goggles"
@@ -373,7 +367,6 @@
item_state = "rwelding-g"
flash_protect = 2
tint = 0
- action_button_name = "Flip welding goggles"
/obj/item/clothing/glasses/sunglasses/blindfold
name = "blindfold"
@@ -424,6 +417,7 @@
desc = "Used for seeing walls, floors, and stuff through anything."
icon_state = "meson"
origin_tech = "magnets=3;syndicate=4"
+ prescription_upgradable = 1
/obj/item/clothing/glasses/thermal/monocle
name = "Thermoncle"
@@ -499,4 +493,4 @@
desc = "Just who the hell do you think I am?!"
name = "gar glasses"
icon_state = "gar"
- item_state = "gar"
\ No newline at end of file
+ item_state = "gar"
diff --git a/code/modules/clothing/glasses/hud.dm b/code/modules/clothing/glasses/hud.dm
index 8756290ad20..e290ba5308d 100644
--- a/code/modules/clothing/glasses/hud.dm
+++ b/code/modules/clothing/glasses/hud.dm
@@ -14,6 +14,7 @@
H.add_hud_to(user)
/obj/item/clothing/glasses/hud/dropped(mob/living/carbon/human/user)
+ ..()
if(HUDType && istype(user) && user.glasses == src)
var/datum/atom_hud/H = huds[HUDType]
H.remove_hud_from(user)
@@ -73,7 +74,6 @@
desc = "A heads-up display that scans the humans in view and provides accurate data about their ID status and security records."
icon_state = "securityhud"
var/global/list/jobs[0]
- flash_protect = 1
HUDType = DATA_HUD_SECURITY_ADVANCED
species_fit = list("Vox")
sprite_sheets = list(
@@ -82,13 +82,14 @@
)
/obj/item/clothing/glasses/hud/security/chameleon
- name = "Chamleon Security HUD"
+ name = "Chameleon Security HUD"
desc = "A stolen security HUD integrated with Syndicate chameleon technology. Toggle to disguise the HUD. Provides flash protection."
+ flash_protect = 1
/obj/item/clothing/glasses/hud/security/chameleon/attack_self(mob/user)
chameleon(user)
-/obj/item/clothing/glasses/hud/security/jensenshades
+/obj/item/clothing/glasses/hud/security/sunglasses/jensenshades
name = "augmented shades"
desc = "Polarized bioneural eyewear, designed to augment your vision."
icon_state = "jensenshades"
@@ -109,8 +110,28 @@
desc = "Sunglasses with a HUD."
icon_state = "sunhud"
darkness_view = 1
+ flash_protect = 1
tint = 1
prescription_upgradable = 1
/obj/item/clothing/glasses/hud/security/sunglasses/prescription
- prescription = 1
\ No newline at end of file
+ prescription = 1
+
+/obj/item/clothing/glasses/hud/hydroponic
+ name = "Hydroponic HUD"
+ desc = "A heads-up display capable of analyzing the health and status of plants growing in hydro trays and soil."
+ icon_state = "hydroponichud"
+ HUDType = DATA_HUD_HYDROPONIC
+ species_fit = list("Vox")
+ sprite_sheets = list(
+ "Vox" = 'icons/mob/species/vox/eyes.dmi'
+ )
+
+/obj/item/clothing/glasses/hud/hydroponic/night
+ name = "Night Vision Hydroponic HUD"
+ desc = "A hydroponic HUD fitted with a light amplifier."
+ icon_state = "hydroponichudnight"
+ item_state = "glasses"
+ darkness_view = 8
+ see_darkness = 0
+ prescription_upgradable = 0
\ No newline at end of file
diff --git a/code/modules/clothing/gloves/boxing.dm b/code/modules/clothing/gloves/boxing.dm
index fd54295c477..77a4076347d 100644
--- a/code/modules/clothing/gloves/boxing.dm
+++ b/code/modules/clothing/gloves/boxing.dm
@@ -4,7 +4,6 @@
icon_state = "boxing"
item_state = "boxing"
put_on_delay = 60
- species_restricted = null
/obj/item/clothing/gloves/boxing/green
icon_state = "boxinggreen"
diff --git a/code/modules/clothing/gloves/color.dm b/code/modules/clothing/gloves/color.dm
index a50e56382a1..76bfbdfd394 100644
--- a/code/modules/clothing/gloves/color.dm
+++ b/code/modules/clothing/gloves/color.dm
@@ -59,16 +59,28 @@
min_cold_protection_temperature = GLOVES_MIN_TEMP_PROTECT
heat_protection = HANDS
max_heat_protection_temperature = GLOVES_MAX_TEMP_PROTECT
+ var/can_be_cut = 1
- hos
- item_color = "hosred" //Exists for washing machines. Is not different from black gloves in any way.
+/obj/item/clothing/gloves/color/black/hos
+ item_color = "hosred" //Exists for washing machines. Is not different from black gloves in any way.
- ce
- item_color = "chief" //Exists for washing machines. Is not different from black gloves in any way.
+/obj/item/clothing/gloves/color/black/ce
+ item_color = "chief" //Exists for washing machines. Is not different from black gloves in any way.
- thief
- pickpocket = 1
+/obj/item/clothing/gloves/color/black/thief
+ pickpocket = 1
+
+/obj/item/clothing/gloves/color/black/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
+ if(istype(W, /obj/item/weapon/wirecutters))
+ if(can_be_cut && icon_state == initial(icon_state))//only if not dyed
+ to_chat(user, "You snip the fingertips off of [src].")
+ playsound(user.loc,'sound/items/Wirecutter.ogg', rand(10,50), 1)
+ var/obj/item/clothing/gloves/fingerless/F = new/obj/item/clothing/gloves/fingerless(user.loc)
+ if(pickpocket)
+ F.pickpocket = 1
+ qdel(src)
+ ..()
/obj/item/clothing/gloves/color/orange
name = "orange gloves"
diff --git a/code/modules/clothing/gloves/miscellaneous.dm b/code/modules/clothing/gloves/miscellaneous.dm
index 060dd1ca47c..feae32b9085 100644
--- a/code/modules/clothing/gloves/miscellaneous.dm
+++ b/code/modules/clothing/gloves/miscellaneous.dm
@@ -7,10 +7,8 @@
transfer_prints = TRUE
cold_protection = HANDS
min_cold_protection_temperature = GLOVES_MIN_TEMP_PROTECT
- species_restricted = null
strip_delay = 40
put_on_delay = 20
- clipped = 1
/obj/item/clothing/gloves/cyborg
desc = "beep boop borp"
@@ -47,4 +45,11 @@
name = "batgloves"
icon_state = "bmgloves"
item_state = "bmgloves"
- item_color="bmgloves"
\ No newline at end of file
+ item_color="bmgloves"
+
+/obj/item/clothing/gloves/cursedclown
+ name = "cursed white gloves"
+ desc = "These things smell terrible, and they're all lumpy. Gross."
+ icon_state = "latex"
+ item_state = "lgloves"
+ flags = NODROP
diff --git a/code/modules/clothing/gloves/rings.dm b/code/modules/clothing/gloves/rings.dm
index 4a0af4392fa..590efa7cd91 100644
--- a/code/modules/clothing/gloves/rings.dm
+++ b/code/modules/clothing/gloves/rings.dm
@@ -8,22 +8,22 @@
icon = 'icons/obj/clothing/rings.dmi'
var/material = "iron"
var/stud = 0
- species_restricted = null
-
- New()
- ..()
- update_icon()
+/obj/item/clothing/gloves/ring/New()
+ ..()
update_icon()
- if(stud)
- icon_state = "d_[initial(icon_state)]"
- else
- icon_state = initial(icon_state)
- examine(mob/user)
- ..(user)
- to_chat(user, "This one is made of [material].")
- if(stud)
- to_chat(user, "It is adorned with a single gem.")
+
+/obj/item/clothing/gloves/ring/update_icon()
+ if(stud)
+ icon_state = "d_[initial(icon_state)]"
+ else
+ icon_state = initial(icon_state)
+
+/obj/item/clothing/gloves/ring/examine(mob/user)
+ ..(user)
+ to_chat(user, "This one is made of [material].")
+ if(stud)
+ to_chat(user, "It is adorned with a single gem.")
/obj/item/clothing/gloves/ring/attackby(obj/item/I as obj, mob/user as mob, params)
if(istype(I, /obj/item/stack/sheet/mineral/diamond))
@@ -69,10 +69,11 @@
icon_state = "redring"
/obj/item/clothing/gloves/ring/plastic/random
- New()
- var/c = pick("white","blue","red")
- name = "[c] plastic ring"
- icon_state = "[c]ring"
+
+/obj/item/clothing/gloves/ring/plastic/random/New()
+ var/c = pick("white","blue","red")
+ name = "[c] plastic ring"
+ icon_state = "[c]ring"
// weird
/obj/item/clothing/gloves/ring/glass
diff --git a/code/modules/clothing/head/hardhat.dm b/code/modules/clothing/head/hardhat.dm
index 48e2ccb7f95..5cc5af80abb 100644
--- a/code/modules/clothing/head/hardhat.dm
+++ b/code/modules/clothing/head/hardhat.dm
@@ -9,19 +9,21 @@
item_color = "yellow" //Determines used sprites: hardhat[on]_[color] and hardhat[on]_[color]2 (lying down sprite)
armor = list(melee = 15, bullet = 5, laser = 20, energy = 10, bomb = 20, bio = 10, rad = 20)
flags_inv = 0
- action_button_name = "Toggle Helmet Light"
+ actions_types = list(/datum/action/item_action/toggle_helmet_light)
- attack_self(mob/user)
- if(!isturf(user.loc))
- to_chat(user, "You cannot turn the light on while in this [user.loc]")//To prevent some lighting anomalities.
+/obj/item/clothing/head/hardhat/attack_self(mob/user)
+ on = !on
+ icon_state = "hardhat[on]_[item_color]"
+ item_state = "hardhat[on]_[item_color]"
- return
- on = !on
- icon_state = "hardhat[on]_[item_color]"
- item_state = "hardhat[on]_[item_color]"
+ if(on)
+ set_light(brightness_on)
+ else
+ set_light(0)
- if(on) set_light(brightness_on)
- else set_light(0)
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
/obj/item/clothing/head/hardhat/orange
diff --git a/code/modules/clothing/head/helmet.dm b/code/modules/clothing/head/helmet.dm
index 17058cc23b5..b7b0cc71b81 100644
--- a/code/modules/clothing/head/helmet.dm
+++ b/code/modules/clothing/head/helmet.dm
@@ -100,7 +100,7 @@
icon_state = "justice"
toggle_message = "You turn off the lights on"
alt_toggle_message = "You turn on the lights on"
- action_button_name = "Toggle JUSTICE"
+ actions_types = list(/datum/action/item_action/toggle_helmet_light)
can_toggle = 1
toggle_cooldown = 20
active_sound = 'sound/items/WEEOO1.ogg'
diff --git a/code/modules/clothing/head/jobs.dm b/code/modules/clothing/head/jobs.dm
index 9492b7839ac..7100d459a51 100644
--- a/code/modules/clothing/head/jobs.dm
+++ b/code/modules/clothing/head/jobs.dm
@@ -116,6 +116,11 @@
desc = "A beret for those who have shown immaculate proficienty in piping. Or plumbing."
icon_state = "beret_atmospherics"
+/obj/item/clothing/head/beret/ce
+ name = "chief engineer beret"
+ desc = "A white beret with the engineering insignia emblazoned on it. Its owner knows what they're doing. Probably."
+ icon_state = "beret_ce"
+
//Medical
/obj/item/clothing/head/surgery
name = "surgical cap"
@@ -137,4 +142,4 @@
/obj/item/clothing/head/surgery/black
desc = "A cap coroners wear during autopsies. Keeps their hair from falling into the cadavers. It is as dark than the coroner's humor."
- icon_state = "surgcap_black"
\ No newline at end of file
+ icon_state = "surgcap_black"
diff --git a/code/modules/clothing/head/misc.dm b/code/modules/clothing/head/misc.dm
index d0473fedb98..6e53e8a9b04 100644
--- a/code/modules/clothing/head/misc.dm
+++ b/code/modules/clothing/head/misc.dm
@@ -25,6 +25,15 @@
icon_state = "pwig"
item_state = "pwig"
+/obj/item/clothing/head/beret/blue
+ icon_state = "beret_blue"
+
+/obj/item/clothing/head/beret/black
+ icon_state = "beret_black"
+
+/obj/item/clothing/head/beret/purple_normal
+ icon_state = "beret_purple_normal"
+
/obj/item/clothing/head/that
name = "top-hat"
desc = "It's an amish looking hat."
@@ -161,6 +170,12 @@
item_state = "boater_hat"
desc = "Goes well with celery."
+/obj/item/clothing/head/cowboyhat
+ name = "cowboy hat"
+ icon_state = "cowboyhat"
+ item_state = "fedora"
+ desc = "There's a new sheriff in town. Pass the whiskey."
+
/obj/item/clothing/head/fedora
name = "\improper fedora"
icon_state = "fedora"
@@ -325,7 +340,7 @@
throwforce = 3.0
throw_speed = 2
throw_range = 5
- w_class = 2.0
+ w_class = 2
attack_verb = list("warned", "cautioned", "smashed")
/obj/item/clothing/head/griffin
@@ -335,19 +350,12 @@
item_state = "griffinhat"
flags = BLOCKHAIR|NODROP
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
- action_button_name = "Caw"
+ actions_types = list(/datum/action/item_action/caw)
/obj/item/clothing/head/griffin/attack_self()
caw()
-/obj/item/clothing/head/griffin/verb/caw()
-
- set category = "Object"
- set name = "Caw"
- set src in usr
- if(!istype(usr, /mob/living)) return
- if(usr.stat) return
-
+/obj/item/clothing/head/griffin/proc/caw()
if(cooldown < world.time - 20) // A cooldown, to stop people being jerks
playsound(src.loc, "sound/misc/caw.ogg", 50, 1)
cooldown = world.time
@@ -363,4 +371,18 @@
name = "bloated human head"
desc = "A horribly bloated and mismatched human head."
icon_state = "lingspacehelmet"
- item_state = "lingspacehelmet"
\ No newline at end of file
+ item_state = "lingspacehelmet"
+
+/obj/item/clothing/head/papersack
+ name = "paper sack hat"
+ desc = "A paper sack with crude holes cut out for eyes. Useful for hiding one's identity or ugliness."
+ icon_state = "papersack"
+ flags = BLOCKHAIR
+ flags_inv = HIDEFACE|HIDEEARS
+
+/obj/item/clothing/head/papersack/smiley
+ name = "paper sack hat"
+ desc = "A paper sack with crude holes cut out for eyes and a sketchy smile drawn on the front. Not creepy at all."
+ icon_state = "papersack_smile"
+ flags = BLOCKHAIR
+ flags_inv = HIDEFACE|HIDEEARS
diff --git a/code/modules/clothing/head/misc_special.dm b/code/modules/clothing/head/misc_special.dm
index f2df0420fbe..703f36cf1fd 100644
--- a/code/modules/clothing/head/misc_special.dm
+++ b/code/modules/clothing/head/misc_special.dm
@@ -22,7 +22,7 @@
tint = 2
armor = list(melee = 10, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
flags_inv = (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
- action_button_name = "flip welding helmet"
+ actions_types = list(/datum/action/item_action/toggle)
species_fit = list("Vox", "Unathi", "Tajaran", "Vulpkanin")
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/head.dmi',
@@ -50,26 +50,28 @@
toggle()
/obj/item/clothing/head/welding/proc/toggle()
- set src in usr
+ if(up)
+ up = !up
+ flags |= (HEADCOVERSEYES | HEADCOVERSMOUTH)
+ flags_inv |= (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
+ icon_state = initial(icon_state)
+ to_chat(usr, "You flip the [src] down to protect your eyes.")
+ flash_protect = 2
+ tint = 2
+ else
+ up = !up
+ flags &= ~(HEADCOVERSEYES | HEADCOVERSMOUTH)
+ flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
+ icon_state = "[initial(icon_state)]up"
+ to_chat(usr, "You push the [src] up out of your face.")
+ flash_protect = 0
+ tint = 0
+ usr.update_inv_head() //so our mob-overlays update
+
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
- if(usr.canmove && !usr.stat && !usr.restrained())
- if(src.up)
- src.up = !src.up
- src.flags |= (HEADCOVERSEYES | HEADCOVERSMOUTH)
- flags_inv |= (HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
- icon_state = initial(icon_state)
- to_chat(usr, "You flip the [src] down to protect your eyes.")
- flash_protect = 2
- tint = 2
- else
- src.up = !src.up
- src.flags &= ~(HEADCOVERSEYES | HEADCOVERSMOUTH)
- flags_inv &= ~(HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE)
- icon_state = "[initial(icon_state)]up"
- to_chat(usr, "You push the [src] up out of your face.")
- flash_protect = 0
- tint = 0
- usr.update_inv_head() //so our mob-overlays update
/*
@@ -96,13 +98,13 @@
if(M.l_hand == src || M.r_hand == src || M.head == src)
location = M.loc
- if (istype(location, /turf))
+ if(istype(location, /turf))
location.hotspot_expose(700, 1)
/obj/item/clothing/head/cakehat/attack_self(mob/user as mob)
if(status > 1) return
src.onfire = !( src.onfire )
- if (src.onfire)
+ if(src.onfire)
src.force = 3
src.damtype = "fire"
src.icon_state = "cake1"
@@ -148,7 +150,6 @@
flags = HEADCOVERSEYES | HEADCOVERSMOUTH | BLOCKHAIR
flags_inv = HIDEMASK|HIDEEARS|HIDEEYES|HIDEFACE
- action_button_name = "Toggle Pumpkin Light"
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
brightness_on = 2 //luminosity when on
@@ -160,7 +161,6 @@
item_state = "hardhat0_reindeer"
item_color = "reindeer"
flags_inv = 0
- action_button_name = "Toggle Nose Light"
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
brightness_on = 1 //luminosity when on
diff --git a/code/modules/clothing/masks/boxing.dm b/code/modules/clothing/masks/boxing.dm
index 66e97d714d8..25cdc259f92 100644
--- a/code/modules/clothing/masks/boxing.dm
+++ b/code/modules/clothing/masks/boxing.dm
@@ -6,8 +6,7 @@
flags = BLOCKHAIR
flags_inv = HIDEFACE
w_class = 2
- action_button_name = "Adjust Balaclava"
- ignore_maskadjust = 0
+ actions_types = list(/datum/action/item_action/adjust)
adjusted_flags = SLOT_HEAD
species_fit = list("Vox", "Unathi", "Tajaran", "Vulpkanin")
sprite_sheets = list(
diff --git a/code/modules/clothing/masks/breath.dm b/code/modules/clothing/masks/breath.dm
index 40811397187..5b3ab335cbe 100644
--- a/code/modules/clothing/masks/breath.dm
+++ b/code/modules/clothing/masks/breath.dm
@@ -7,8 +7,7 @@
w_class = 2
gas_transfer_coefficient = 0.10
permeability_coefficient = 0.50
- action_button_name = "Adjust Breath Mask"
- ignore_maskadjust = 0
+ actions_types = list(/datum/action/item_action/adjust)
species_fit = list("Vox", "Vox Armalis", "Unathi", "Tajaran", "Vulpkanin")
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/mask.dmi',
@@ -38,5 +37,4 @@
item_state = "voxmask"
permeability_coefficient = 0.01
species_restricted = list("Vox")
- action_button_name = null
- ignore_maskadjust = 1
+ actions_types = list()
diff --git a/code/modules/clothing/masks/gasmask.dm b/code/modules/clothing/masks/gasmask.dm
index ef3a0f2b83e..72b4b6febb7 100644
--- a/code/modules/clothing/masks/gasmask.dm
+++ b/code/modules/clothing/masks/gasmask.dm
@@ -4,7 +4,7 @@
icon_state = "gas_alt"
flags = MASKCOVERSMOUTH | MASKCOVERSEYES | BLOCK_GAS_SMOKE_EFFECT | AIRTIGHT
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE
- w_class = 3.0
+ w_class = 3
item_state = "gas_alt"
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.01
@@ -29,35 +29,33 @@
tint = 2
armor = list(melee = 10, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
origin_tech = "materials=2;engineering=2"
- action_button_name = "Toggle Welding Helmet"
+ actions_types = list(/datum/action/item_action/toggle)
/obj/item/clothing/mask/gas/welding/attack_self()
toggle()
+/obj/item/clothing/mask/gas/welding/proc/toggle()
+ if(up)
+ up = !src.up
+ flags |= (MASKCOVERSEYES)
+ flags_inv |= (HIDEEYES)
+ icon_state = initial(icon_state)
+ to_chat(usr, "You flip the [src] down to protect your eyes.")
+ flash_protect = 2
+ tint = 2
+ else
+ up = !up
+ flags &= ~(MASKCOVERSEYES)
+ flags_inv &= ~(HIDEEYES)
+ icon_state = "[initial(icon_state)]up"
+ to_chat(usr, "You push the [src] up out of your face.")
+ flash_protect = 0
+ tint = 0
+ usr.update_inv_wear_mask() //so our mob-overlays update
-/obj/item/clothing/mask/gas/welding/verb/toggle()
- set category = "Object"
- set name = "Adjust welding mask"
- set src in usr
-
- if(usr.canmove && !usr.stat && !usr.restrained())
- if(src.up)
- src.up = !src.up
- src.flags |= (MASKCOVERSEYES)
- flags_inv |= (HIDEEYES)
- icon_state = initial(icon_state)
- to_chat(usr, "You flip the [src] down to protect your eyes.")
- flash_protect = 2
- tint = 2
- else
- src.up = !src.up
- src.flags &= ~(MASKCOVERSEYES)
- flags_inv &= ~(HIDEEYES)
- icon_state = "[initial(icon_state)]up"
- to_chat(usr, "You push the [src] up out of your face.")
- flash_protect = 0
- tint = 0
- usr.update_inv_wear_mask() //so our mob-overlays update
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
//Bane gas mask
/obj/item/clothing/mask/banemask
@@ -66,7 +64,7 @@
icon_state = "bane_mask"
flags = MASKCOVERSMOUTH | MASKCOVERSEYES | BLOCK_GAS_SMOKE_EFFECT | AIRTIGHT
flags_inv = HIDEEARS|HIDEEYES|HIDEFACE
- w_class = 3.0
+ w_class = 3
item_state = "bane_mask"
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.01
@@ -166,19 +164,12 @@
desc = "Twoooo!"
icon_state = "owl"
flags = MASKCOVERSMOUTH | MASKCOVERSEYES | BLOCK_GAS_SMOKE_EFFECT | AIRTIGHT | NODROP
- action_button_name = "Hoot"
+ actions_types = list(/datum/action/item_action/hoot)
/obj/item/clothing/mask/gas/owl_mask/attack_self()
hoot()
-/obj/item/clothing/mask/gas/owl_mask/verb/hoot()
-
- set category = "Object"
- set name = "Hoot"
- set src in usr
- if(!istype(usr, /mob/living)) return
- if(usr.stat) return
-
+/obj/item/clothing/mask/gas/owl_mask/proc/hoot()
if(cooldown < world.time - 35) // A cooldown, to stop people being jerks
playsound(src.loc, "sound/misc/hoot.ogg", 50, 1)
cooldown = world.time
@@ -190,26 +181,24 @@
/obj/item/clothing/mask/gas/sechailer
name = "security gas mask"
desc = "A standard issue Security gas mask with integrated 'Compli-o-nator 3000' device, plays over a dozen pre-recorded compliance phrases designed to get scumbags to stand still whilst you taze them. Do not tamper with the device."
- action_button_name = "HALT!"
icon_state = "sechailer"
var/aggressiveness = 2
var/safety = 1
- ignore_maskadjust = 0
- action_button_name = "HALT!"
+ actions_types = list(/datum/action/item_action/halt, /datum/action/item_action/adjust)
/obj/item/clothing/mask/gas/sechailer/hos
name = "\improper HOS SWAT mask"
desc = "A close-fitting tactical mask with an especially aggressive Compli-o-nator 3000. It has a tan stripe."
icon_state = "hosmask"
aggressiveness = 3
- ignore_maskadjust = 1
+ actions_types = list(/datum/action/item_action/halt)
/obj/item/clothing/mask/gas/sechailer/warden
name = "\improper Warden SWAT mask"
desc = "A close-fitting tactical mask with an especially aggressive Compli-o-nator 3000. It has a blue stripe."
icon_state = "wardenmask"
aggressiveness = 3
- ignore_maskadjust = 1
+ actions_types = list(/datum/action/item_action/halt)
/obj/item/clothing/mask/gas/sechailer/swat
@@ -217,7 +206,7 @@
desc = "A close-fitting tactical mask with an especially aggressive Compli-o-nator 3000."
icon_state = "officermask"
aggressiveness = 3
- ignore_maskadjust = 1
+ actions_types = list(/datum/action/item_action/halt)
/obj/item/clothing/mask/gas/sechailer/blue
name = "\improper blue SWAT mask"
@@ -225,7 +214,7 @@
icon_state = "blue_sechailer"
item_state = "blue_sechailer"
aggressiveness = 3
- ignore_maskadjust = 1
+ actions_types = list(/datum/action/item_action/halt)
/obj/item/clothing/mask/gas/sechailer/cyborg
name = "security hailer"
@@ -233,16 +222,13 @@
icon = 'icons/obj/device.dmi'
icon_state = "taperecorder_idle"
aggressiveness = 1 //Borgs are nicecurity!
- ignore_maskadjust = 1
+ actions_types = list(/datum/action/item_action/halt)
-/obj/item/clothing/mask/gas/sechailer/cyborg/New()
- ..()
- verbs -= /obj/item/clothing/mask/gas/sechailer/verb/adjust
-
-/obj/item/clothing/mask/gas/sechailer/verb/adjust()
- set category = "Object"
- set name = "Adjust Mask"
- adjustmask(usr)
+/obj/item/clothing/mask/gas/sechailer/ui_action_click(mob/user, actiontype)
+ if(actiontype == /datum/action/item_action/halt)
+ halt()
+ else
+ adjustmask(user)
/obj/item/clothing/mask/gas/sechailer/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
if(istype(W, /obj/item/weapon/screwdriver))
@@ -275,13 +261,7 @@
else
return
-/obj/item/clothing/mask/gas/sechailer/verb/halt()
- set category = "Object"
- set name = "HALT"
- set src in usr
- if(!istype(usr, /mob/living)) return
- if(usr.stat) return
-
+/obj/item/clothing/mask/gas/sechailer/proc/halt()
var/phrase = 0 //selects which phrase to use
var/phrase_text = null
var/phrase_sound = null
diff --git a/code/modules/clothing/masks/miscellaneous.dm b/code/modules/clothing/masks/miscellaneous.dm
index 3e99b277db3..dd66740f966 100644
--- a/code/modules/clothing/masks/miscellaneous.dm
+++ b/code/modules/clothing/masks/miscellaneous.dm
@@ -64,8 +64,7 @@
gas_transfer_coefficient = 0.90
permeability_coefficient = 0.01
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 25, rad = 0)
- action_button_name = "Adjust Sterile Mask"
- ignore_maskadjust = 0
+ actions_types = list(/datum/action/item_action/adjust)
species_fit = list("Vox", "Unathi", "Tajaran", "Vulpkanin")
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/mask.dmi',
@@ -209,7 +208,6 @@
flags_inv = HIDEFACE
w_class = 1
slot_flags = SLOT_MASK
- ignore_maskadjust = 0
adjusted_flags = SLOT_HEAD
icon_state = "bandbotany"
species_fit = list("Vox", "Unathi", "Tajaran", "Vulpkanin")
@@ -219,42 +217,42 @@
"Tajaran" = 'icons/mob/species/tajaran/mask.dmi',
"Vulpkanin" = 'icons/mob/species/vulpkanin/mask.dmi'
)
- action_button_name = "Adjust Bandana"
+ actions_types = list(/datum/action/item_action/adjust)
/obj/item/clothing/mask/bandana/attack_self(var/mob/user)
adjustmask(user)
-obj/item/clothing/mask/bandana/red
+/obj/item/clothing/mask/bandana/red
name = "red bandana"
icon_state = "bandred"
item_color = "red"
desc = "It's a red bandana."
-obj/item/clothing/mask/bandana/blue
+/obj/item/clothing/mask/bandana/blue
name = "blue bandana"
icon_state = "bandblue"
item_color = "blue"
desc = "It's a blue bandana."
-obj/item/clothing/mask/bandana/gold
+/obj/item/clothing/mask/bandana/gold
name = "gold bandana"
icon_state = "bandgold"
item_color = "yellow"
desc = "It's a gold bandana."
-obj/item/clothing/mask/bandana/green
+/obj/item/clothing/mask/bandana/green
name = "green bandana"
icon_state = "bandgreen"
item_color = "green"
desc = "It's a green bandana."
-obj/item/clothing/mask/bandana/orange
+/obj/item/clothing/mask/bandana/orange
name = "orange bandana"
icon_state = "bandorange"
item_color = "orange"
desc = "It's an orange bandana."
-obj/item/clothing/mask/bandana/purple
+/obj/item/clothing/mask/bandana/purple
name = "purple bandana"
icon_state = "bandpurple"
item_color = "purple"
@@ -275,3 +273,28 @@ obj/item/clothing/mask/bandana/purple
icon_state = "bandblack"
item_color = "black"
desc = "It's a black bandana."
+
+/obj/item/clothing/mask/cursedclown
+ name = "cursed clown mask"
+ desc = "This is a very, very odd looking mask."
+ icon = 'icons/goonstation/objects/clothing/mask.dmi'
+ icon_state = "cursedclown"
+ item_state = "cclown_hat"
+ icon_override = 'icons/goonstation/mob/clothing/mask.dmi'
+ lefthand_file = 'icons/goonstation/mob/inhands/clothing_lefthand.dmi'
+ righthand_file = 'icons/goonstation/mob/inhands/clothing_righthand.dmi'
+ flags = NODROP
+
+/obj/item/clothing/mask/cursedclown/equipped(mob/user, slot)
+ ..()
+ var/mob/living/carbon/human/H = user
+ if(istype(H) && slot == slot_wear_mask)
+ to_chat(H, "[src] grips your face!")
+ if(H.mind && H.mind.assigned_role != "Cluwne")
+ H.makeCluwne()
+
+/obj/item/clothing/mask/cursedclown/suicide_act(mob/user)
+ user.visible_message("[user] gazes into the eyes of [src]. [src] gazes back!")
+ spawn(10)
+ user.gib()
+ return BRUTELOSS
diff --git a/code/modules/clothing/shoes/colour.dm b/code/modules/clothing/shoes/colour.dm
index 1b7ea8fc4c9..22437ec451e 100644
--- a/code/modules/clothing/shoes/colour.dm
+++ b/code/modules/clothing/shoes/colour.dm
@@ -88,7 +88,7 @@
item_color = "orange"
/obj/item/clothing/shoes/orange/attack_self(mob/user as mob)
- if (src.chained)
+ if(src.chained)
src.chained = null
src.slowdown = SHOES_SLOWDOWN
new /obj/item/weapon/restraints/handcuffs( user.loc )
@@ -97,8 +97,8 @@
/obj/item/clothing/shoes/orange/attackby(obj/H, loc, params)
..()
- if (istype(H, /obj/item/weapon/restraints/handcuffs) && !chained && !(H.flags & NODROP))
- if (src.icon_state != "orange") return
+ if(istype(H, /obj/item/weapon/restraints/handcuffs) && !chained && !(H.flags & NODROP))
+ if(src.icon_state != "orange") return
qdel(H)
src.chained = 1
src.slowdown = 15
diff --git a/code/modules/clothing/shoes/magboots.dm b/code/modules/clothing/shoes/magboots.dm
index 48b9ffa7589..2c6bdeddf87 100644
--- a/code/modules/clothing/shoes/magboots.dm
+++ b/code/modules/clothing/shoes/magboots.dm
@@ -5,23 +5,25 @@
var/magboot_state = "magboots"
var/magpulse = 0
var/slowdown_active = 2
- action_button_name = "Toggle Magboots"
+ actions_types = list(/datum/action/item_action/toggle)
strip_delay = 70
put_on_delay = 70
- species_restricted = null
/obj/item/clothing/shoes/magboots/attack_self(mob/user)
- if(src.magpulse)
- src.flags &= ~NOSLIP
- src.slowdown = SHOES_SLOWDOWN
+ if(magpulse)
+ flags &= ~NOSLIP
+ slowdown = SHOES_SLOWDOWN
else
- src.flags |= NOSLIP
- src.slowdown = slowdown_active
+ flags |= NOSLIP
+ slowdown = slowdown_active
magpulse = !magpulse
icon_state = "[magboot_state][magpulse]"
to_chat(user, "You [magpulse ? "enable" : "disable"] the mag-pulse traction system.")
user.update_inv_shoes() //so our mob-overlays update
user.update_gravity(user.mob_has_gravity())
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
/obj/item/clothing/shoes/magboots/negates_gravity()
return flags & NOSLIP
diff --git a/code/modules/clothing/shoes/miscellaneous.dm b/code/modules/clothing/shoes/miscellaneous.dm
index af361951f3d..2330f439547 100644
--- a/code/modules/clothing/shoes/miscellaneous.dm
+++ b/code/modules/clothing/shoes/miscellaneous.dm
@@ -7,7 +7,6 @@
flags = NOSLIP
origin_tech = "syndicate=3"
var/list/clothing_choices = list()
- species_restricted = null
silence_steps = 1
/obj/item/clothing/shoes/mime
@@ -22,7 +21,6 @@
icon_state = "jackboots"
item_state = "jackboots"
armor = list(melee = 25, bullet = 25, laser = 25, energy = 25, bomb = 50, bio = 10, rad = 0)
- species_restricted = null //Syndicate tech means even Tajarans can kick ass with these
strip_delay = 70
/obj/item/clothing/shoes/combat/swat //overpowered boots for death squads
@@ -38,7 +36,6 @@
icon_state = "wizard"
strip_delay = 50
put_on_delay = 50
- species_restricted = null
/obj/item/clothing/shoes/sandal/marisa
desc = "A pair of magic, black shoes."
@@ -54,7 +51,6 @@
slowdown = SHOES_SLOWDOWN+1
strip_delay = 50
put_on_delay = 50
- species_restricted = null
/obj/item/clothing/shoes/galoshes/dry
name = "absorbent galoshes"
@@ -74,7 +70,6 @@
slowdown = SHOES_SLOWDOWN+1
item_color = "clown"
var/footstep = 1 //used for squeeks whilst walking
- species_restricted = null
silence_steps = 1
shoe_sound = "clownstep"
@@ -97,7 +92,6 @@
can_cut_open = 0
icon_state = "jacksandal"
item_color = "jacksandal"
- species_restricted = null
/obj/item/clothing/shoes/workboots
name = "work boots"
@@ -116,7 +110,6 @@
min_cold_protection_temperature = SHOES_MIN_TEMP_PROTECT
heat_protection = FEET
max_heat_protection_temperature = SHOES_MAX_TEMP_PROTECT
- species_restricted = null
/obj/item/clothing/shoes/cyborg
name = "cyborg boots"
@@ -128,7 +121,6 @@
desc = "Fluffy!"
icon_state = "slippers"
item_state = "slippers"
- species_restricted = null
/obj/item/clothing/shoes/slippers_worn
name = "worn bunny slippers"
@@ -149,7 +141,6 @@
item_state = "roman"
strip_delay = 100
put_on_delay = 100
- species_restricted = null
/obj/item/clothing/shoes/centcom
name = "dress shoes"
@@ -184,26 +175,34 @@
desc = "Looks sneaky."
icon_state = "sheet-cloth"
-/datum/table_recipe/shoe_rags
+/datum/crafting_recipe/shoe_rags
name = "Shoe Rags"
-
result = /obj/item/shoe_silencer
reqs = list(/obj/item/stack/tape_roll = 10)
tools = list(/obj/item/weapon/wirecutters)
-
time = 40
+ category = CAT_MISC
/obj/item/clothing/shoes/sandal/white
name = "White Sandals"
desc = "Medical sandals that nerds wear."
icon_state = "medsandal"
item_color = "medsandal"
- species_restricted = null
/obj/item/clothing/shoes/sandal/fancy
name = "Fancy Sandals"
desc = "FANCY!!."
icon_state = "fancysandal"
item_color = "fancysandal"
- species_restricted = null
+/obj/item/clothing/shoes/cursedclown
+ name = "cursed clown shoes"
+ desc = "Moldering clown flip flops. They're neon green for some reason."
+ icon = 'icons/goonstation/objects/clothing/feet.dmi'
+ icon_state = "cursedclown"
+ item_state = "cclown_shoes"
+ icon_override = 'icons/goonstation/mob/clothing/feet.dmi'
+ lefthand_file = 'icons/goonstation/mob/inhands/clothing_lefthand.dmi'
+ righthand_file = 'icons/goonstation/mob/inhands/clothing_righthand.dmi'
+ flags = NODROP
+ shoe_sound = "clownstep"
diff --git a/code/modules/clothing/spacesuits/alien.dm b/code/modules/clothing/spacesuits/alien.dm
index 988e9d09725..f8a18749644 100644
--- a/code/modules/clothing/spacesuits/alien.dm
+++ b/code/modules/clothing/spacesuits/alien.dm
@@ -182,10 +182,8 @@
"Vox Armalis" = 'icons/mob/species/armalis/feet.dmi'
)
- action_button_name = "Toggle the magclaws"
-
/obj/item/clothing/shoes/magboots/vox/attack_self(mob/user)
- if(src.magpulse)
+ if(magpulse)
flags &= ~NOSLIP
magpulse = 0
flags |= NODROP
@@ -195,7 +193,7 @@
if(!ishuman(user))
return
var/mob/living/carbon/human/H = user
- if (H.shoes != src)
+ if(H.shoes != src)
to_chat(user, "You will have to put on the [src] before you can do that.")
return
@@ -217,7 +215,7 @@
/obj/item/clothing/shoes/magboots/vox/examine(mob/user)
..(user)
- if (magpulse)
+ if(magpulse)
to_chat(user, "It would be hard to take these off without relaxing your grip first.")//theoretically this message should only be seen by the wearer when the claws are equipped.
diff --git a/code/modules/clothing/spacesuits/breaches.dm b/code/modules/clothing/spacesuits/breaches.dm
index a7f8baf7a7a..9d2b2a06198 100644
--- a/code/modules/clothing/spacesuits/breaches.dm
+++ b/code/modules/clothing/spacesuits/breaches.dm
@@ -106,7 +106,7 @@ var/global/list/breach_burn_descriptors = list(
if(existing.damtype != damtype)
continue
- if (existing.class < 5)
+ if(existing.class < 5)
var/needs = 5 - existing.class
if(amount < needs)
existing.class += amount
@@ -120,7 +120,7 @@ var/global/list/breach_burn_descriptors = list(
else if(existing.damtype == BURN)
T.visible_message("\The [existing.descriptor] on [src] widens!")
- if (amount)
+ if(amount)
//Spawn a new breach.
var/datum/breach/B = new()
breaches += B
@@ -200,7 +200,7 @@ var/global/list/breach_burn_descriptors = list(
to_chat(user, "\red How do you intend to patch a hardsuit while someone is wearing it?")
return
- if (!damage || ! brute_damage)
+ if(!damage || ! brute_damage)
to_chat(user, "There is no structural damage on \the [src] to repair.")
return
diff --git a/code/modules/clothing/spacesuits/chronosuit.dm b/code/modules/clothing/spacesuits/chronosuit.dm
index 96ae6519d5d..6348f32aa11 100644
--- a/code/modules/clothing/spacesuits/chronosuit.dm
+++ b/code/modules/clothing/spacesuits/chronosuit.dm
@@ -22,7 +22,7 @@
desc = "An advanced spacesuit equipped with teleportation and anti-compression technology"
icon_state = "chronosuit"
item_state = "chronosuit"
- action_button_name = "Toggle Chronosuit"
+ actions_types = list(/datum/action/item_action/toggle)
armor = list(melee = 60, bullet = 60, laser = 60, energy = 60, bomb = 30, bio = 90, rad = 90)
var/obj/item/clothing/head/helmet/space/chronos/helmet = null
var/obj/effect/chronos_cam/camera = null
diff --git a/code/modules/clothing/spacesuits/plasmamen.dm b/code/modules/clothing/spacesuits/plasmamen.dm
index b5498726203..de2cfc0eda5 100644
--- a/code/modules/clothing/spacesuits/plasmamen.dm
+++ b/code/modules/clothing/spacesuits/plasmamen.dm
@@ -46,13 +46,9 @@
var/base_state = "plasmaman_helmet"
var/brightness_on = 4 //luminosity when on
var/on = 0
- action_button_name = "Toggle Helmet Light"
+ actions_types = list(/datum/action/item_action/toggle_helmet_light)
/obj/item/clothing/head/helmet/space/eva/plasmaman/attack_self(mob/user)
- if(!isturf(user.loc))
- to_chat(user, "You cannot turn the light on while in this [user.loc].")//To prevent some lighting anomalities.
-
- return
toggle_light(user)
/obj/item/clothing/head/helmet/space/eva/plasmaman/proc/toggle_light(mob/user)
@@ -68,6 +64,10 @@
var/mob/living/carbon/human/H = user
H.update_inv_head()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
+
// ENGINEERING
/obj/item/clothing/suit/space/eva/plasmaman/assistant
name = "plasmaman assistant suit"
diff --git a/code/modules/clothing/spacesuits/rig.dm b/code/modules/clothing/spacesuits/rig.dm
index d4a0fec12bc..355b511c391 100644
--- a/code/modules/clothing/spacesuits/rig.dm
+++ b/code/modules/clothing/spacesuits/rig.dm
@@ -10,7 +10,7 @@
var/brightness_on = 4 //luminosity when on
var/on = 0
item_color = "engineering" //Determines used sprites: rig[on]-[color] and rig[on]-[color]2 (lying down sprite)
- action_button_name = "Toggle Helmet Light"
+ actions_types = list(/datum/action/item_action/toggle_helmet_light)
//Species-specific stuff.
species_restricted = list("exclude","Diona","Wryn")
@@ -31,10 +31,6 @@
)
/obj/item/clothing/head/helmet/space/rig/attack_self(mob/user)
- if(!isturf(user.loc))
- to_chat(user, "You cannot turn the light on while in this [user.loc].")//To prevent some lighting anomalities.
-
- return
toggle_light(user)
/obj/item/clothing/head/helmet/space/rig/proc/toggle_light(mob/user)
@@ -50,6 +46,14 @@
var/mob/living/carbon/human/H = user
H.update_inv_head()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
+
+/obj/item/clothing/head/helmet/space/rig/item_action_slot_check(slot)
+ if(slot == slot_head)
+ return 1
+
/obj/item/clothing/suit/space/rig
name = "hardsuit"
desc = "A special space suit for environments that might pose hazards beyond just the vacuum of space. Provides more protection than a standard space suit."
@@ -292,23 +296,18 @@
/obj/item/clothing/head/helmet/space/rig/syndi
name = "blood-red hardsuit helmet"
desc = "A dual-mode advanced helmet designed for work in special operations. It is in travel mode. Property of Gorlex Marauders."
- icon_state = "hardsuit1-syndi"
+ icon_state = "rig1-syndi"
item_state = "syndie_helm"
item_color = "syndi"
armor = list(melee = 40, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 50)
on = 1
flags = HEADCOVERSEYES | BLOCKHAIR | HEADCOVERSMOUTH | STOPSPRESSUREDMAGE | THICKMATERIAL
- action_button_name = "Toggle Helmet Mode"
+ actions_types = list(/datum/action/item_action/toggle_helmet_mode)
/obj/item/clothing/head/helmet/space/rig/syndi/update_icon()
- icon_state = "hardsuit[on]-[item_color]"
+ icon_state = "rig[on]-[item_color]"
/obj/item/clothing/head/helmet/space/rig/syndi/attack_self(mob/user)
- if(!isturf(user.loc))
- to_chat(user, "You cannot toggle your helmet while in this [user.loc].")//To prevent some lighting anomalities.
-
- return
-
on = !on
if(on)
to_chat(user, "You switch your helmet to travel mode. It will allow you to stand in zero pressure environments, at the cost of speed and armor.")
@@ -331,20 +330,24 @@
playsound(src.loc, 'sound/mecha/mechmove03.ogg', 50, 1)
user.update_inv_head()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
+
/obj/item/clothing/suit/space/rig/syndi
name = "blood-red hardsuit"
desc = "A dual-mode advanced hardsuit designed for work in special operations. It is in travel mode. Property of Gorlex Marauders."
- icon_state = "hardsuit1-syndi"
+ icon_state = "rig1-syndi"
item_state = "syndie_hardsuit"
item_color = "syndi"
w_class = 3
var/on = 1
- action_button_name = "Toggle Hardsuit Mode"
+ actions_types = list(/datum/action/item_action/toggle_hardsuit_mode)
armor = list(melee = 40, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 50)
allowed = list(/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/melee/energy/sword/saber,/obj/item/weapon/restraints/handcuffs,/obj/item/weapon/tank)
/obj/item/clothing/suit/space/rig/syndi/update_icon()
- icon_state = "hardsuit[on]-[item_color]"
+ icon_state = "rig[on]-[item_color]"
/obj/item/clothing/suit/space/rig/syndi/attack_self(mob/user)
on = !on
@@ -370,11 +373,15 @@
user.update_inv_wear_suit()
user.update_inv_w_uniform()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
+
//Elite Syndie suit
/obj/item/clothing/head/helmet/space/rig/syndi/elite
name = "elite syndicate hardsuit helmet"
desc = "An elite version of the syndicate helmet, with improved armour and fire shielding. It is in travel mode. Property of Gorlex Marauders."
- icon_state = "hardsuit0-syndielite"
+ icon_state = "rig0-syndielite"
item_color = "syndielite"
armor = list(melee = 60, bullet = 60, laser = 50, energy = 25, bomb = 55, bio = 100, rad = 70)
heat_protection = HEAD
@@ -393,7 +400,7 @@
/obj/item/clothing/suit/space/rig/syndi/elite
name = "elite syndicate hardsuit"
desc = "An elite version of the syndicate hardsuit, with improved armour and fire shielding. It is in travel mode."
- icon_state = "hardsuit0-syndielite"
+ icon_state = "rig0-syndielite"
item_color = "syndielite"
armor = list(melee = 60, bullet = 60, laser = 50, energy = 25, bomb = 55, bio = 100, rad = 70)
heat_protection = UPPER_TORSO|LOWER_TORSO|LEGS|FEET|ARMS|HANDS
@@ -511,3 +518,99 @@
item_state = "singuloth_hardsuit"
flags = STOPSPRESSUREDMAGE
armor = list(melee = 40, bullet = 5, laser = 20, energy = 5, bomb = 25, bio = 100, rad = 100)
+
+
+/obj/item/clothing/head/helmet/space/rig/security/hos
+ name = "head of security's hardsuit helmet"
+ desc = "a special bulky helmet designed for work in a hazardous, low pressure environment. Has an additional layer of armor."
+ icon_state = "rig0-hos"
+ item_color = "hos"
+ armor = list(melee = 45, bullet = 25, laser = 30,energy = 10, bomb = 25, bio = 100, rad = 50)
+ sprite_sheets = null
+
+
+/obj/item/clothing/suit/space/rig/security/hos
+ icon_state = "rig-hos"
+ name = "head of security's hardsuit"
+ desc = "A special bulky suit that protects against hazardous, low pressure environments. Has an additional layer of armor."
+ armor = list(melee = 45, bullet = 25, laser = 30, energy = 10, bomb = 25, bio = 100, rad = 50)
+ sprite_sheets = null
+
+
+/////////////SHIELDED//////////////////////////////////
+
+/obj/item/clothing/suit/space/rig/shielded
+ name = "shielded hardsuit"
+ desc = "A hardsuit with built in energy shielding. Will rapidly recharge when not under fire."
+ icon_state = "rig-hos"
+ allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank, /obj/item/weapon/gun,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/restraints/handcuffs)
+ armor = list(melee = 30, bullet = 15, laser = 30, energy = 10, bomb = 10, bio = 100, rad = 50)
+ var/current_charges = 3
+ var/max_charges = 3 //How many charges total the shielding has
+ var/recharge_delay = 200 //How long after we've been shot before we can start recharging. 20 seconds here
+ var/recharge_cooldown = 0 //Time since we've last been shot
+ var/recharge_rate = 1 //How quickly the shield recharges once it starts charging
+ var/shield_state = "shield-old"
+ var/shield_on = "shield-old"
+ sprite_sheets = null
+
+/obj/item/clothing/suit/space/rig/shielded/hit_reaction(mob/living/carbon/human/owner, attack_text)
+ if(current_charges > 0)
+ var/datum/effect/system/spark_spread/s = new
+ s.set_up(2, 1, src)
+ s.start()
+ owner.visible_message("[owner]'s shields deflect [attack_text] in a shower of sparks!")
+ current_charges--
+ recharge_cooldown = world.time + recharge_delay
+ processing_objects |= src
+ if(current_charges <= 0)
+ owner.visible_message("[owner]'s shield overloads!")
+ shield_state = "broken"
+ owner.update_inv_wear_suit()
+ return 1
+ return 0
+
+
+/obj/item/clothing/suit/space/rig/shielded/Destroy()
+ processing_objects.Remove(src)
+ return ..()
+
+/obj/item/clothing/suit/space/rig/shielded/process()
+ if(world.time > recharge_cooldown && current_charges < max_charges)
+ current_charges = Clamp((current_charges + recharge_rate), 0, max_charges)
+ playsound(loc, 'sound/magic/Charge.ogg', 50, 1)
+ if(current_charges == max_charges)
+ playsound(loc, 'sound/machines/ding.ogg', 50, 1)
+ processing_objects.Remove(src)
+ shield_state = "[shield_on]"
+ if(istype(loc, /mob/living/carbon/human))
+ var/mob/living/carbon/human/C = loc
+ C.update_inv_wear_suit()
+
+//////Syndicate Version
+
+/obj/item/clothing/suit/space/rig/shielded/syndi
+ name = "blood-red hardsuit"
+ desc = "An advanced hardsuit with built in energy shielding."
+ icon_state = "rig1-syndi"
+ item_state = "syndie_hardsuit"
+ item_color = "syndi"
+ armor = list(melee = 40, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 50)
+ allowed = list(/obj/item/weapon/gun,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/melee/energy/sword/saber,/obj/item/weapon/restraints/handcuffs,/obj/item/weapon/tank)
+ slowdown = 0
+ sprite_sheets = list(
+ "Unathi" = 'icons/mob/species/unathi/suit.dmi',
+ "Tajaran" = 'icons/mob/species/tajaran/suit.dmi',
+ "Skrell" = 'icons/mob/species/skrell/suit.dmi',
+ "Vox" = 'icons/mob/species/vox/suit.dmi',
+ "Vulpkanin" = 'icons/mob/species/vulpkanin/suit.dmi',
+ "Drask" = 'icons/mob/species/drask/suit.dmi'
+ )
+
+/obj/item/clothing/head/helmet/space/rig/shielded/syndi
+ name = "blood-red hardsuit helmet"
+ desc = "An advanced hardsuit helmet with built in energy shielding."
+ icon_state = "rig1-syndi"
+ item_state = "syndie_helm"
+ item_color = "syndi"
+ armor = list(melee = 40, bullet = 50, laser = 30, energy = 15, bomb = 35, bio = 100, rad = 50)
\ No newline at end of file
diff --git a/code/modules/clothing/spacesuits/rig/modules/utility.dm b/code/modules/clothing/spacesuits/rig/modules/utility.dm
index 087b34dd756..46471966aa7 100644
--- a/code/modules/clothing/spacesuits/rig/modules/utility.dm
+++ b/code/modules/clothing/spacesuits/rig/modules/utility.dm
@@ -337,7 +337,7 @@
/obj/item/rig_module/maneuvering_jets/engage()
if(!..())
return 0
- jets.toggle_rockets()
+ jets.toggle_stabilization(usr)
return 1
/obj/item/rig_module/maneuvering_jets/activate()
@@ -354,15 +354,13 @@
suit_overlay = null
holder.update_icon()
- if(!jets.on)
- jets.toggle()
+ jets.turn_on()
return 1
/obj/item/rig_module/maneuvering_jets/deactivate()
if(!..())
return 0
- if(jets.on)
- jets.toggle()
+ jets.turn_off()
return 1
/obj/item/rig_module/maneuvering_jets/New()
diff --git a/code/modules/clothing/spacesuits/rig/rig.dm b/code/modules/clothing/spacesuits/rig/rig.dm
index 9e0fb8c55b0..fccf464607b 100644
--- a/code/modules/clothing/spacesuits/rig/rig.dm
+++ b/code/modules/clothing/spacesuits/rig/rig.dm
@@ -431,7 +431,7 @@
if(!offline)
if(istype(wearer))
if(flags & NODROP)
- if (offline_slowdown < 3)
+ if(offline_slowdown < 3)
to_chat(wearer, "Your suit beeps stridently, and suddenly goes dead.")
else
to_chat(wearer, "Your suit beeps stridently, and suddenly you're wearing a leaden mass of metal and plastic composites instead of a powered suit.")
@@ -576,7 +576,7 @@
data["modules"] = module_list
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, ((src.loc != user) ? ai_interface_path : interface_path), interface_title, 480, 550, state = nano_state)
ui.set_initial_data(data)
ui.open()
@@ -819,7 +819,7 @@
take_hit((100/severity_class), "electrical pulse", 1)
/obj/item/weapon/rig/proc/shock(mob/user)
- if (electrocute_mob(user, cell, src)) //electrocute_mob() handles removing charge from the cell, no need to do that here.
+ if(electrocute_mob(user, cell, src)) //electrocute_mob() handles removing charge from the cell, no need to do that here.
spark_system.start()
if(user.stunned)
return 1
diff --git a/code/modules/clothing/suits/armor.dm b/code/modules/clothing/suits/armor.dm
index ea811f68be6..8b5ea0d9af5 100644
--- a/code/modules/clothing/suits/armor.dm
+++ b/code/modules/clothing/suits/armor.dm
@@ -1,4 +1,3 @@
-
/obj/item/clothing/suit/armor
allowed = list(/obj/item/weapon/gun/energy,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/weapon/gun/projectile,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/restraints/handcuffs,/obj/item/device/flashlight/seclite,/obj/item/weapon/melee/classic_baton/telescopic,/obj/item/weapon/kitchen/knife/combat)
body_parts_covered = UPPER_TORSO|LOWER_TORSO
@@ -51,7 +50,8 @@
W.forceMove(src)
attached_badge = W
- action_button_name = "Remove Holobadge"
+ var/datum/action/A = new /datum/action/item_action/remove_badge(src)
+ A.Grant(user)
icon_state = "armorsec"
user.update_inv_wear_suit()
desc = "An armored vest that protects against some damage. This one has [attached_badge] attached to it."
@@ -64,8 +64,10 @@
add_fingerprint(user)
user.put_in_hands(attached_badge)
- action_button_name = null
- action.Remove(user)
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.Remove(user)
+
icon_state = "armor"
user.update_inv_wear_suit()
desc = "An armored vest that protects against some damage. This one has a clip for a holobadge."
@@ -91,6 +93,20 @@
species_fit = null
sprite_sheets = null
+/obj/item/clothing/suit/armor/secjacket
+ name = "security jacket"
+ desc = "A sturdy black jacket with reinforced fabric. Bears insignia of NT corporate security."
+ icon_state = "secjacket_open"
+ item_state = "hos"
+ body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
+ armor = list(melee = 15, bullet = 10, laser = 15, energy = 5, bomb = 15, bio = 0, rad = 0)
+ cold_protection = UPPER_TORSO|LOWER_TORSO|ARMS
+ heat_protection = UPPER_TORSO|LOWER_TORSO|ARMS
+ ignore_suitadjust = 0
+ suit_adjusted = 1
+ actions_types = list(/datum/action/item_action/openclose)
+ adjust_flavour = "unzip"
+
/obj/item/clothing/suit/armor/hos
name = "armored coat"
desc = "A trench coat enhanced with a special alloy for some protection and style."
@@ -111,7 +127,7 @@
flags_inv = 0
ignore_suitadjust = 0
suit_adjusted = 1
- action_button_name = "Open/Close Trenchcoat"
+ actions_types = list(/datum/action/item_action/openclose)
adjust_flavour = "unbutton"
/obj/item/clothing/suit/armor/hos/jensen
@@ -222,44 +238,126 @@
//Reactive armor
-//When the wearer gets hit, this armor will teleport the user a short distance away (to safety or to more danger, no one knows. That's the fun of it!)
/obj/item/clothing/suit/armor/reactive
- name = "Reactive Teleport Armor"
- desc = "Someone seperated our Research Director from his own head!"
- var/active = 0.0
+ name = "reactive armor"
+ desc = "Doesn't seem to do much for some reason."
+ var/active = 0
icon_state = "reactiveoff"
item_state = "reactiveoff"
blood_overlay_type = "armor"
- action_button_name = "Toggle Reactive Armor"
armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
+ actions_types = list(/datum/action/item_action/toggle)
+ unacidable = 1
+ hit_reaction_chance = 50
-/obj/item/clothing/suit/armor/reactive/IsShield()
- if(active)
- return 1
- return 0
-
-/obj/item/clothing/suit/armor/reactive/attack_self(mob/user as mob)
+/obj/item/clothing/suit/armor/reactive/attack_self(mob/user)
active = !(active)
if(active)
- to_chat(user, "The reactive armor is now active.")
+ to_chat(user, "[src] is now active.")
icon_state = "reactive"
item_state = "reactive"
else
- to_chat(user, "The reactive armor is now inactive.")
+ to_chat(user, "[src] is now inactive.")
icon_state = "reactiveoff"
item_state = "reactiveoff"
add_fingerprint(user)
user.update_inv_wear_suit()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
/obj/item/clothing/suit/armor/reactive/emp_act(severity)
active = 0
icon_state = "reactiveoff"
item_state = "reactiveoff"
-
- var/mob/living/carbon/human/user = usr
- user.update_inv_wear_suit()
+ if(istype(loc, /mob/living/carbon/human))
+ var/mob/living/carbon/human/C = loc
+ C.update_inv_wear_suit()
..()
+//When the wearer gets hit, this armor will teleport the user a short distance away (to safety or to more danger, no one knows. That's the fun of it!)
+/obj/item/clothing/suit/armor/reactive/teleport
+ name = "reactive teleport armor"
+ desc = "Someone seperated our Research Director from his own head!"
+ var/tele_range = 6
+
+/obj/item/clothing/suit/armor/reactive/teleport/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance)
+ if(!active)
+ return 0
+ if(prob(hit_reaction_chance))
+ var/mob/living/carbon/human/H = owner
+ owner.visible_message("The reactive teleport system flings [H] clear of [attack_text], shutting itself off in the process!")
+ var/list/turfs = new/list()
+ for(var/turf/T in orange(tele_range, H))
+ if(istype(T, /turf/space))
+ continue
+ if(T.density)
+ continue
+ if(T.x>world.maxx-tele_range || T.xworld.maxy-tele_range || T.yThe [src] blocks the [attack_text], sending out jets of flame!")
+ for(var/mob/living/carbon/C in range(6, owner))
+ if(C != owner)
+ C.fire_stacks += 8
+ C.IgniteMob()
+ owner.fire_stacks = -20
+ return 1
+ return 0
+
+
+/obj/item/clothing/suit/armor/reactive/stealth
+ name = "reactive stealth armor"
+
+/obj/item/clothing/suit/armor/reactive/stealth/hit_reaction(mob/living/carbon/human/owner, attack_text)
+ if(!active)
+ return 0
+ if(prob(hit_reaction_chance))
+ var/mob/living/simple_animal/hostile/illusion/escape/E = new(owner.loc)
+ E.Copy_Parent(owner, 50)
+ E.GiveTarget(owner) //so it starts running right away
+ E.Goto(owner, E.move_to_delay, E.minimum_distance)
+ owner.alpha = 0
+ owner.visible_message("[owner] is hit by [attack_text] in the chest!") //We pretend to be hit, since blocking it would stop the message otherwise
+ spawn(40)
+ owner.alpha = initial(owner.alpha)
+ return 1
+
+/obj/item/clothing/suit/armor/reactive/tesla
+ name = "reactive tesla armor"
+
+/obj/item/clothing/suit/armor/reactive/tesla/hit_reaction(mob/living/carbon/human/owner, attack_text)
+ if(!active)
+ return 0
+ if(prob(hit_reaction_chance))
+ owner.visible_message("The [src] blocks the [attack_text], sending out arcs of lightning!")
+ for(var/mob/living/M in view(6, owner))
+ if(M == owner)
+ continue
+ owner.Beam(M,icon_state="lightning[rand(1, 12)]",icon='icons/effects/effects.dmi',time=5)
+ M.adjustFireLoss(25)
+ playsound(M, 'sound/machines/defib_zap.ogg', 50, 1, -1)
+ return 1
//All of the armor below is mostly unused
diff --git a/code/modules/clothing/suits/hood.dm b/code/modules/clothing/suits/hood.dm
new file mode 100644
index 00000000000..0683394ce9f
--- /dev/null
+++ b/code/modules/clothing/suits/hood.dm
@@ -0,0 +1,67 @@
+//Hoods for winter coats and chaplain hoodie etc
+
+/obj/item/clothing/suit/hooded
+ actions_types = list(/datum/action/item_action/toggle)
+ var/obj/item/clothing/head/hood
+ var/hoodtype = /obj/item/clothing/head/winterhood //so the chaplain hoodie or other hoodies can override this
+
+/obj/item/clothing/suit/hooded/New()
+ MakeHood()
+ ..()
+
+/obj/item/clothing/suit/hooded/Destroy()
+ qdel(hood)
+ return ..()
+
+/obj/item/clothing/suit/hooded/proc/MakeHood()
+ if(!hood)
+ var/obj/item/clothing/head/W = new hoodtype(src)
+ hood = W
+
+/obj/item/clothing/suit/hooded/ui_action_click()
+ ToggleHood()
+
+/obj/item/clothing/suit/hooded/item_action_slot_check(slot, mob/user)
+ if(slot == slot_wear_suit)
+ return 1
+
+/obj/item/clothing/suit/hooded/equipped(mob/user, slot)
+ if(slot != slot_wear_suit)
+ RemoveHood()
+ ..()
+
+/obj/item/clothing/suit/hooded/proc/RemoveHood()
+ icon_state = "[initial(icon_state)]"
+ suit_adjusted = 0
+ if(ishuman(hood.loc))
+ var/mob/living/carbon/H = hood.loc
+ H.unEquip(hood, 1)
+ H.update_inv_wear_suit()
+ hood.loc = src
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
+
+/obj/item/clothing/suit/hooded/dropped()
+ ..()
+ RemoveHood()
+
+/obj/item/clothing/suit/hooded/proc/ToggleHood()
+ if(!suit_adjusted)
+ if(ishuman(loc))
+ var/mob/living/carbon/human/H = loc
+ if(H.wear_suit != src)
+ to_chat(H,"You must be wearing [src] to put up the hood!")
+ return
+ if(H.head)
+ to_chat(H,"You're already wearing something on your head!")
+ return
+ else if(H.equip_to_slot_if_possible(hood,slot_head,0,0,1))
+ suit_adjusted = 1
+ icon_state = "[initial(icon_state)]_hood"
+ H.update_inv_wear_suit()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
+ else
+ RemoveHood()
diff --git a/code/modules/clothing/suits/jobs.dm b/code/modules/clothing/suits/jobs.dm
index 1288d02cbf4..a8fd6ea4c49 100644
--- a/code/modules/clothing/suits/jobs.dm
+++ b/code/modules/clothing/suits/jobs.dm
@@ -73,12 +73,13 @@
)
//Chaplain
-/obj/item/clothing/suit/chaplain_hoodie
+/obj/item/clothing/suit/hooded/chaplain_hoodie
name = "chaplain hoodie"
desc = "This suit says to you 'hush'!"
icon_state = "chaplain_hoodie"
item_state = "chaplain_hoodie"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS
+ hoodtype = /obj/item/clothing/head/chaplain_hood
allowed = list(/obj/item/weapon/storage/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/emergency_oxygen)
species_fit = list("Vox")
sprite_sheets = list(
@@ -86,13 +87,14 @@
)
//Chaplain
-/obj/item/clothing/suit/nun
+/obj/item/clothing/suit/hooded/nun
name = "nun robe"
desc = "Maximum piety in this star system."
icon_state = "nun"
item_state = "nun"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|LEGS|ARMS|HANDS
flags_inv = HIDESHOES|HIDEJUMPSUIT
+ hoodtype = /obj/item/clothing/head/nun_hood
allowed = list(/obj/item/weapon/storage/bible, /obj/item/weapon/nullrod, /obj/item/weapon/reagent_containers/food/drinks/bottle/holywater, /obj/item/weapon/storage/fancy/candle_box, /obj/item/candle, /obj/item/weapon/tank/emergency_oxygen)
species_fit = list("Vox")
sprite_sheets = list(
@@ -208,7 +210,7 @@
body_parts_covered = UPPER_TORSO|ARMS
ignore_suitadjust = 0
suit_adjusted = 1
- action_button_name = "Button/Unbutton Jacket"
+ actions_types = list(/datum/action/item_action/button)
adjust_flavour = "unbutton"
/obj/item/clothing/suit/storage/lawyer/bluejacket
@@ -220,7 +222,7 @@
body_parts_covered = UPPER_TORSO|ARMS
ignore_suitadjust = 0
suit_adjusted = 1
- action_button_name = "Button/Unbutton Jacket"
+ actions_types = list(/datum/action/item_action/button)
adjust_flavour = "unbutton"
/obj/item/clothing/suit/storage/lawyer/purpjacket
@@ -241,7 +243,7 @@
body_parts_covered = UPPER_TORSO|ARMS
ignore_suitadjust = 0
suit_adjusted = 1
- action_button_name = "Button/Unbutton Jacket"
+ actions_types = list(/datum/action/item_action/button)
adjust_flavour = "unbutton"
species_fit = list("Vox")
sprite_sheets = list(
@@ -256,7 +258,7 @@
blood_overlay_type = "coat"
body_parts_covered = UPPER_TORSO|ARMS
ignore_suitadjust = 0
- action_button_name = "Button/Unbutton Jacket"
+ actions_types = list(/datum/action/item_action/button)
adjust_flavour = "unbutton"
species_fit = list("Vox")
sprite_sheets = list(
@@ -274,7 +276,7 @@
/obj/item/device/healthanalyzer, /obj/item/device/flashlight, /obj/item/device/radio, /obj/item/weapon/tank/emergency_oxygen,/obj/item/device/rad_laser)
ignore_suitadjust = 0
suit_adjusted = 1
- action_button_name = "Button/Unbutton Jacket"
+ actions_types = list(/datum/action/item_action/button)
adjust_flavour = "unbutton"
species_fit = list("Vox")
sprite_sheets = list(
diff --git a/code/modules/clothing/suits/labcoat.dm b/code/modules/clothing/suits/labcoat.dm
index 6926105541d..8097162ba28 100644
--- a/code/modules/clothing/suits/labcoat.dm
+++ b/code/modules/clothing/suits/labcoat.dm
@@ -13,7 +13,7 @@
sprite_sheets = list(
"Vox" = 'icons/mob/species/vox/suit.dmi'
)
- action_button_name = "Button/Unbutton Labcoat"
+ actions_types = list(/datum/action/item_action/button)
adjust_flavour = "unbutton"
/obj/item/clothing/suit/storage/labcoat/cmo
@@ -56,3 +56,9 @@
desc = "A suit that protects against minor chemical spills. Has a black stripe on the shoulder."
icon_state = "labcoat_mort_open"
item_state = "labcoat_mort_open"
+
+/obj/item/clothing/suit/storage/labcoat/emt
+ name = "EMT labcoat"
+ desc = "A comfortable suit for paramedics. Has dark colours."
+ icon_state = "labcoat_emt_open"
+ item_state = "labcoat_emt_open"
diff --git a/code/modules/clothing/suits/miscellaneous.dm b/code/modules/clothing/suits/miscellaneous.dm
index a88fdd6f970..676800f8f48 100644
--- a/code/modules/clothing/suits/miscellaneous.dm
+++ b/code/modules/clothing/suits/miscellaneous.dm
@@ -2,6 +2,7 @@
* Contains:
* Lasertag
* Costume
+ * Winter Coats
* Misc
*/
@@ -282,11 +283,192 @@
item_state = "lingspacesuit"
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
+/*
+ * Winter Coats
+ */
+
+/obj/item/clothing/suit/hooded/wintercoat
+ name = "winter coat"
+ desc = "A heavy jacket made from 'synthetic' animal furs."
+ icon_state = "wintercoat"
+ item_state = "labcoat"
+ body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
+ cold_protection = UPPER_TORSO|LOWER_TORSO|ARMS
+ min_cold_protection_temperature = FIRE_SUIT_MIN_TEMP_PROTECT
+ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 10, rad = 0)
+ allowed = list(/obj/item/device/flashlight, /obj/item/weapon/tank/emergency_oxygen, /obj/item/toy, /obj/item/weapon/storage/fancy/cigarettes, /obj/item/weapon/lighter)
+ species_fit = list("Vox")
+ sprite_sheets = list("Vox" = 'icons/mob/species/vox/suit.dmi')
+
+/obj/item/clothing/head/winterhood
+ name = "winter hood"
+ desc = "A hood attached to a heavy winter jacket."
+ icon_state = "winterhood"
+ body_parts_covered = HEAD
+ cold_protection = HEAD
+ min_cold_protection_temperature = FIRE_SUIT_MIN_TEMP_PROTECT
+ flags = NODROP|BLOCKHAIR
+ flags_inv = HIDEEARS
+ species_fit = list("Vox")
+ sprite_sheets = list("Vox" = 'icons/mob/species/vox/head.dmi')
+
+/obj/item/clothing/suit/hooded/wintercoat/captain
+ name = "captain's winter coat"
+ icon_state = "wintercoat_captain"
+ armor = list(melee = 25, bullet = 30, laser = 30, energy = 10, bomb = 25, bio = 0, rad = 0)
+ allowed = list(/obj/item/weapon/gun/energy, /obj/item/weapon/reagent_containers/spray/pepper, /obj/item/weapon/gun/projectile, /obj/item/ammo_box,/obj/item/ammo_casing, /obj/item/weapon/melee/baton, /obj/item/weapon/restraints/handcuffs, /obj/item/device/flashlight/seclite, /obj/item/weapon/melee/classic_baton/telescopic)
+ hoodtype = /obj/item/clothing/head/winterhood/captain
+
+/obj/item/clothing/head/winterhood/captain
+ icon_state = "winterhood_captain"
+
+/obj/item/clothing/suit/hooded/wintercoat/security
+ name = "security winter coat"
+ icon_state = "wintercoat_sec"
+ armor = list(melee = 10, bullet = 10, laser = 10, energy = 5, bomb = 15, bio = 0, rad = 0)
+ allowed = list(/obj/item/weapon/gun/energy, /obj/item/weapon/reagent_containers/spray/pepper, /obj/item/weapon/gun/projectile, /obj/item/ammo_box, /obj/item/ammo_casing, /obj/item/weapon/melee/baton, /obj/item/weapon/restraints/handcuffs, /obj/item/device/flashlight/seclite, /obj/item/weapon/melee/classic_baton/telescopic)
+ hoodtype = /obj/item/clothing/head/winterhood/security
+
+/obj/item/clothing/head/winterhood/security
+ icon_state = "winterhood_sec"
+
+/obj/item/clothing/suit/hooded/wintercoat/medical
+ name = "medical winter coat"
+ icon_state = "wintercoat_med"
+ allowed = list(/obj/item/device/analyzer, /obj/item/weapon/dnainjector, /obj/item/weapon/reagent_containers/dropper, /obj/item/weapon/reagent_containers/syringe, /obj/item/weapon/reagent_containers/hypospray, /obj/item/device/healthanalyzer,/obj/item/device/flashlight/pen, /obj/item/weapon/reagent_containers/glass/bottle, /obj/item/weapon/reagent_containers/glass/beaker, /obj/item/weapon/storage/pill_bottle, /obj/item/weapon/paper, /obj/item/weapon/melee/classic_baton/telescopic)
+ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 50, rad = 0)
+ hoodtype = /obj/item/clothing/head/winterhood/medical
+
+/obj/item/clothing/head/winterhood/medical
+ icon_state = "winterhood_med"
+
+/obj/item/clothing/suit/hooded/wintercoat/science
+ name = "science winter coat"
+ icon_state = "wintercoat_sci"
+ allowed = list(/obj/item/device/analyzer, /obj/item/stack/medical, /obj/item/weapon/dnainjector, /obj/item/weapon/reagent_containers/dropper, /obj/item/weapon/reagent_containers/syringe, /obj/item/weapon/reagent_containers/hypospray, /obj/item/device/healthanalyzer,/obj/item/device/flashlight/pen, /obj/item/weapon/reagent_containers/glass/bottle, /obj/item/weapon/reagent_containers/glass/beaker, /obj/item/weapon/storage/pill_bottle, /obj/item/weapon/paper, /obj/item/weapon/melee/classic_baton/telescopic)
+ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 10, bio = 0, rad = 0)
+ hoodtype = /obj/item/clothing/head/winterhood/science
+
+/obj/item/clothing/head/winterhood/science
+ icon_state = "winterhood_sci"
+
+/obj/item/clothing/suit/hooded/wintercoat/engineering
+ name = "engineering winter coat"
+ icon_state = "wintercoat_engi"
+ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 20)
+ allowed = list(/obj/item/device/flashlight, /obj/item/weapon/tank/emergency_oxygen, /obj/item/device/t_scanner, /obj/item/weapon/rcd)
+ hoodtype = /obj/item/clothing/head/winterhood/engineering
+
+/obj/item/clothing/head/winterhood/engineering
+ icon_state = "winterhood_engi"
+
+/obj/item/clothing/suit/hooded/wintercoat/engineering/atmos
+ name = "atmospherics winter coat"
+ icon_state = "wintercoat_atmos"
+ hoodtype = /obj/item/clothing/head/winterhood/engineering/atmos
+
+/obj/item/clothing/head/winterhood/engineering/atmos
+ icon_state = "winterhood_atmos"
+
+/obj/item/clothing/suit/hooded/wintercoat/hydro
+ name = "hydroponics winter coat"
+ icon_state = "wintercoat_hydro"
+ allowed = list(/obj/item/weapon/reagent_containers/spray, /obj/item/device/analyzer/plant_analyzer, /obj/item/seeds, /obj/item/weapon/reagent_containers/glass/bottle, /obj/item/weapon/hatchet, /obj/item/weapon/storage/bag/plants)
+ hoodtype = /obj/item/clothing/head/winterhood/hydro
+
+/obj/item/clothing/head/winterhood/hydro
+ icon_state = "winterhood_hydro"
+
+/obj/item/clothing/suit/hooded/wintercoat/cargo
+ name = "cargo winter coat"
+ icon_state = "wintercoat_cargo"
+ hoodtype = /obj/item/clothing/head/winterhood/cargo
+
+/obj/item/clothing/head/winterhood/cargo
+ icon_state = "winterhood_cargo"
+
+/obj/item/clothing/suit/hooded/wintercoat/miner
+ name = "mining winter coat"
+ icon_state = "wintercoat_miner"
+ allowed = list(/obj/item/weapon/pickaxe, /obj/item/device/flashlight, /obj/item/weapon/tank/emergency_oxygen, /obj/item/toy, /obj/item/weapon/storage/fancy/cigarettes, /obj/item/weapon/lighter)
+ armor = list(melee = 10, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
+ hoodtype = /obj/item/clothing/head/winterhood/miner
+
+/obj/item/clothing/head/winterhood/miner
+ icon_state = "winterhood_miner"
+
/*
* Misc
*/
+//hoodies
+/obj/item/clothing/suit/hooded/hoodie
+ name = "black hoodie"
+ desc = "It's a hoodie. It has a hood. Most hoodies do."
+ icon_state = "black_hoodie"
+ item_state = "labcoat"
+ body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
+ hoodtype = /obj/item/clothing/head/hood
+ species_fit = list("Vox")
+ sprite_sheets = list(
+ "Vox" = 'icons/mob/species/vox/suit.dmi'
+ )
+
+/obj/item/clothing/head/hood
+ name = "black hood"
+ desc = "A hood attached to a hoodie."
+ icon_state = "blackhood"
+ body_parts_covered = HEAD
+ cold_protection = HEAD
+ flags = NODROP|BLOCKHAIR
+ flags_inv = HIDEEARS
+ species_fit = list("Vox")
+ sprite_sheets = list(
+ "Vox" = 'icons/mob/species/vox/head.dmi'
+ )
+
+/obj/item/clothing/head/hood/blue
+ icon_state = "bluehood"
+
+/obj/item/clothing/head/hood/white
+ icon_state = "whitehood"
+
+/obj/item/clothing/suit/hooded/hoodie/blue
+ name = "blue hoodie"
+ icon_state = "blue_hoodie"
+ hoodtype = /obj/item/clothing/head/hood/blue
+
+/obj/item/clothing/suit/hooded/hoodie/mit
+ name = "Martian Institute of Technology hoodie"
+ desc = "A hoodie proudly worn by students and graduates alike, has the letters 'MIT' on the back."
+ icon_state = "mit_hoodie"
+ hoodtype = /obj/item/clothing/head/hood
+
+/obj/item/clothing/suit/hooded/hoodie/cut
+ name = "Canaan University of Technology hoodie"
+ desc = "A bright hoodie with the Canaan University of Technology logo on the front."
+ icon_state = "cut_hoodie"
+ hoodtype = /obj/item/clothing/head/hood/white
+
+/obj/item/clothing/suit/hooded/hoodie/lam
+ name = "Lunar Academy of Medicine hoodie"
+ desc = "A bright hoodie with the Lunar Academy of Medicine logo on the back."
+ icon_state = "lam_hoodie"
+ hoodtype = /obj/item/clothing/head/hood/white
+
+/obj/item/clothing/suit/hooded/hoodie/nt
+ name = "Nanotrasen hoodie"
+ desc = "A blue hoodie with the Nanotrasen logo on the back."
+ icon_state = "nt_hoodie"
+ hoodtype = /obj/item/clothing/head/hood/blue
+
+/obj/item/clothing/suit/hooded/hoodie/tp
+ name = "Tharsis Polytech hoodie"
+ desc = "A dark hoodie with the Tharsis Polytech logo on the back."
+ icon_state = "tp_hoodie"
+ hoodtype = /obj/item/clothing/head/hood
+
/obj/item/clothing/suit/straight_jacket
name = "straight jacket"
desc = "A suit that completely restrains the wearer."
@@ -307,6 +489,8 @@
"Vox" = 'icons/mob/species/vox/suit.dmi'
)
+
+
//pyjamas
//originally intended to be pinstripes >.>
@@ -364,6 +548,34 @@
"Vox" = 'icons/mob/species/vox/suit.dmi'
)
+//trackjackets
+
+/obj/item/clothing/suit/tracksuit
+ name = "black tracksuit"
+ desc = "Lightweight and stylish. What else could a man ask of his tracksuit?"
+ icon_state = "trackjacket_open"
+ item_state = "bltrenchcoat"
+ body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
+ ignore_suitadjust = 0
+ suit_adjusted = 1
+ actions_types = list(/datum/action/item_action/openclose)
+ adjust_flavour = "unzip"
+ species_fit = list("Vox")
+ sprite_sheets = list(
+ "Vox" = 'icons/mob/species/vox/suit.dmi'
+ )
+
+/obj/item/clothing/suit/tracksuit/green
+ name = "green tracksuit"
+ icon_state = "trackjacketgreen_open"
+
+/obj/item/clothing/suit/tracksuit/red
+ name = "red tracksuit"
+ icon_state = "trackjacketred_open"
+
+/obj/item/clothing/suit/tracksuit/white
+ name = "white tracksuit"
+ icon_state = "trackjacketwhite_open"
//actual suits
@@ -411,7 +623,7 @@
icon_state = "militaryjacket"
item_state = "militaryjacket"
ignore_suitadjust = 1
- action_button_name = null
+ actions_types = list()
adjust_flavour = null
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/emergency_oxygen,/obj/item/toy,/obj/item/weapon/storage/fancy/cigarettes,/obj/item/weapon/lighter,/obj/item/weapon/gun/projectile/automatic/pistol,/obj/item/weapon/gun/projectile/revolver,/obj/item/weapon/gun/projectile/revolver/detective)
@@ -505,7 +717,7 @@
allowed = list(/obj/item/device/flashlight,/obj/item/weapon/tank/emergency_oxygen,/obj/item/toy,/obj/item/weapon/storage/fancy/cigarettes,/obj/item/weapon/lighter)
body_parts_covered = UPPER_TORSO|LOWER_TORSO|ARMS
cold_protection = UPPER_TORSO|LOWER_TORSO|ARMS
- action_button_name = "Zip/Unzip Jacket"
+ actions_types = list(/datum/action/item_action/zipper)
adjust_flavour = "unzip"
species_fit = list("Vox")
sprite_sheets = list(
@@ -534,7 +746,7 @@
desc = "Pompadour not included."
icon_state = "leatherjacket"
ignore_suitadjust = 1
- action_button_name = null
+ actions_types = list()
adjust_flavour = null
/obj/item/clothing/suit/officercoat
@@ -543,7 +755,7 @@
icon_state = "officersuit"
item_state = "officersuit"
ignore_suitadjust = 0
- action_button_name = "Button/Unbutton Jacket"
+ actions_types = list(/datum/action/item_action/button)
adjust_flavour = "unbutton"
species_fit = list("Vox")
sprite_sheets = list(
@@ -556,7 +768,7 @@
icon_state = "soldiersuit"
item_state = "soldiersuit"
ignore_suitadjust = 0
- action_button_name = "Button/Unbutton Jacket"
+ actions_types = list(/datum/action/item_action/button)
adjust_flavour = "unbutton"
species_fit = list("Vox")
sprite_sheets = list(
@@ -571,7 +783,7 @@
body_parts_covered = ARMS
armor = list(melee = 5, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
allowed = list(/obj/item/weapon/gun/energy,/obj/item/weapon/reagent_containers/spray/pepper,/obj/item/weapon/gun/projectile,/obj/item/ammo_box,/obj/item/ammo_casing,/obj/item/weapon/melee/baton,/obj/item/weapon/restraints/handcuffs,/obj/item/device/flashlight/seclite)
- action_button_name = "Toggle Owl Wings"
+ actions_types = list(/datum/action/item_action/toggle_wings)
flags = NODROP
/obj/item/clothing/suit/toggle/owlwings/griffinwings
@@ -588,6 +800,9 @@
icon_state = initial(icon_state)
item_state = initial(item_state)
usr.update_inv_wear_suit()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
/obj/item/clothing/suit/lordadmiral
name = "Lord Admiral's Coat"
@@ -611,7 +826,7 @@
desc = "An incredibly advanced and complex suit; it has so many buttons and dials as to be incomprehensible."
icon_state = "bomb"
item_state = "bomb"
- action_button_name = "Toggle Advanced Protective Suit"
+ actions_types = list(/datum/action/item_action/toggle)
gas_transfer_coefficient = 0.01
permeability_coefficient = 0.01
flags = STOPSPRESSUREDMAGE | THICKMATERIAL | NODROP
@@ -657,4 +872,4 @@
if(user.reagents.get_reagent_amount("syndicate_nanites") < 15)
user.reagents.add_reagent("syndicate_nanites", 15)
else
- processing_objects.Remove(src)
\ No newline at end of file
+ processing_objects.Remove(src)
diff --git a/code/modules/clothing/suits/storage.dm b/code/modules/clothing/suits/storage.dm
index 87520f38856..360c9b2915f 100644
--- a/code/modules/clothing/suits/storage.dm
+++ b/code/modules/clothing/suits/storage.dm
@@ -14,11 +14,11 @@
return ..()
/obj/item/clothing/suit/storage/attack_hand(mob/user as mob)
- if (pockets.handle_attack_hand(user))
+ if(pockets.handle_attack_hand(user))
..(user)
/obj/item/clothing/suit/storage/MouseDrop(obj/over_object as obj)
- if (pockets.handle_mousedrop(usr, over_object))
+ if(pockets.handle_mousedrop(usr, over_object))
..(over_object)
/obj/item/clothing/suit/storage/attackby(obj/item/W as obj, mob/user as mob, params)
@@ -47,6 +47,6 @@
L += S.return_inv()
for(var/obj/item/weapon/gift/G in src)
L += G.gift
- if (istype(G.gift, /obj/item/weapon/storage))
+ if(istype(G.gift, /obj/item/weapon/storage))
L += G.gift:return_inv()
return L
diff --git a/code/modules/clothing/under/accessories/accessory.dm b/code/modules/clothing/under/accessories/accessory.dm
index 9cf067d6ab2..e417c899f7f 100644
--- a/code/modules/clothing/under/accessories/accessory.dm
+++ b/code/modules/clothing/under/accessories/accessory.dm
@@ -6,11 +6,10 @@
item_state = "" //no inhands
item_color = "bluetie"
slot_flags = SLOT_TIE
- w_class = 2.0
+ w_class = 2
var/slot = "decor"
var/obj/item/clothing/under/has_suit = null //the suit the tie may be attached to
var/image/inv_overlay = null //overlay used when attached to clothing.
- action_button_custom_type = /datum/action/item_action/accessory
/obj/item/clothing/accessory/New()
..()
@@ -23,6 +22,13 @@
has_suit = S
loc = has_suit
has_suit.overlays += inv_overlay
+ has_suit.actions += actions
+
+ for(var/X in actions)
+ var/datum/action/A = X
+ if(has_suit.is_equipped())
+ var/mob/M = has_suit.loc
+ A.Grant(M)
if(user)
to_chat(user, "You attach [src] to [has_suit].")
@@ -32,6 +38,14 @@
if(!has_suit)
return
has_suit.overlays -= inv_overlay
+ has_suit.actions -= actions
+
+ for(var/X in actions)
+ var/datum/action/A = X
+ if(ismob(has_suit.loc))
+ var/mob/M = has_suit.loc
+ A.Remove(M)
+
has_suit = null
usr.put_in_hands(src)
src.add_fingerprint(user)
@@ -103,35 +117,45 @@
/obj/item/clothing/accessory/stethoscope/attack(mob/living/carbon/human/M, mob/living/user)
if(ishuman(M) && isliving(user))
- if(user.a_intent == I_HELP)
- var/body_part = parse_zone(user.zone_sel.selecting)
- if(body_part)
- var/their = "their"
- switch(M.gender)
- if(MALE) their = "his"
- if(FEMALE) their = "her"
-
- var/sound = "pulse"
- var/sound_strength
-
- if(M.stat == DEAD || (M.status_flags&FAKEDEATH))
- sound_strength = "cannot hear"
- sound = "anything"
- else
- sound_strength = "hear a weak"
- switch(body_part)
- if("chest")
- if(M.oxyloss < 50)
- sound_strength = "hear a healthy"
- sound = "pulse and respiration"
- if("eyes","mouth")
- sound_strength = "cannot hear"
- sound = "anything"
- else
- sound_strength = "hear a weak"
-
- user.visible_message("[user] places [src] against [M]'s [body_part] and listens attentively.", "You place [src] against [their] [body_part]. You [sound_strength] [sound].")
- return
+ if(user == M)
+ user.visible_message("[user] places \the [src] against \his chest and listens attentively.", "You place \the [src] against your chest...")
+ else
+ user.visible_message("[user] places \the [src] against [M]'s chest and listens attentively.", "You place \the [src] against [M]'s chest...")
+ var/obj/item/organ/internal/H = M.get_int_organ(/obj/item/organ/internal/heart)
+ var/obj/item/organ/internal/L = M.get_int_organ(/obj/item/organ/internal/lungs)
+ if((H && M.pulse) || (L && !(NO_BREATH in M.mutations) && !(M.species.flags & NO_BREATH)))
+ var/color = "notice"
+ if(H)
+ var/heart_sound
+ switch(H.damage)
+ if(0 to 1)
+ heart_sound = "healthy"
+ if(1 to 25)
+ heart_sound = "offbeat"
+ if(25 to 50)
+ heart_sound = "uneven"
+ color = "warning"
+ if(50 to INFINITY)
+ heart_sound = "weak, unhealthy"
+ color = "warning"
+ to_chat(user, "You hear \an [heart_sound] pulse.")
+ if(L)
+ var/lung_sound
+ switch(L.damage)
+ if(0 to 1)
+ lung_sound = "healthy respiration"
+ if(1 to 25)
+ lung_sound = "labored respiration"
+ if(25 to 50)
+ lung_sound = "pained respiration"
+ color = "warning"
+ if(50 to INFINITY)
+ lung_sound = "gurgling"
+ color = "warning"
+ to_chat(user, "You hear [lung_sound].")
+ else
+ to_chat(user, "You don't hear anything.")
+ return
return ..(M,user)
@@ -236,7 +260,7 @@
..()
/obj/item/clothing/accessory/holobadge/emag_act(user as mob)
- if (emagged)
+ if(emagged)
to_chat(user, "\red [src] is already cracked.")
return
else
@@ -424,15 +448,15 @@
return
var/list/A = U.accessories
var/total = A.len
- if (total == 1)
+ if(total == 1)
return "\a [A[1]]"
- else if (total == 2)
+ else if(total == 2)
return "\a [A[1]] and \a [A[2]]"
else
var/output = ""
var/index = 1
var/comma_text = ", "
- while (index < total)
+ while(index < total)
output += "\a [A[index]][comma_text]"
index++
diff --git a/code/modules/clothing/under/accessories/holster.dm b/code/modules/clothing/under/accessories/holster.dm
index cc0e47a9563..a30522768ed 100644
--- a/code/modules/clothing/under/accessories/holster.dm
+++ b/code/modules/clothing/under/accessories/holster.dm
@@ -6,8 +6,8 @@
slot = "utility"
var/holster_allow = /obj/item/weapon/gun
var/obj/item/weapon/gun/holstered = null
- action_button_name = "Holster"
- w_class = 3.0 // so it doesn't fit in pockets
+ actions_types = list(/datum/action/item_action/accessory/holster)
+ w_class = 3 // so it doesn't fit in pockets
//subtypes can override this to specify what can be holstered
/obj/item/clothing/accessory/holster/proc/can_holster(obj/item/weapon/gun/W)
@@ -67,8 +67,8 @@
holstered = null
/obj/item/clothing/accessory/holster/attack_hand(mob/user as mob)
- if (has_suit) //if we are part of a suit
- if (holstered)
+ if(has_suit) //if we are part of a suit
+ if(holstered)
unholster(user)
return
@@ -78,13 +78,13 @@
holster(W, user)
/obj/item/clothing/accessory/holster/emp_act(severity)
- if (holstered)
+ if(holstered)
holstered.emp_act(severity)
..()
/obj/item/clothing/accessory/holster/examine(mob/user)
..(user)
- if (holstered)
+ if(holstered)
to_chat(user, "A [holstered] is holstered here.")
else
to_chat(user, "It is empty.")
@@ -106,14 +106,14 @@
if(usr.stat) return
var/obj/item/clothing/accessory/holster/H = null
- if (istype(src, /obj/item/clothing/accessory/holster))
+ if(istype(src, /obj/item/clothing/accessory/holster))
H = src
- else if (istype(src, /obj/item/clothing/under))
+ else if(istype(src, /obj/item/clothing/under))
var/obj/item/clothing/under/S = src
- if (S.accessories.len)
+ if(S.accessories.len)
H = locate() in S.accessories
- if (!H)
+ if(!H)
to_chat(usr, "Something is very wrong.")
if(!H.holstered)
diff --git a/code/modules/clothing/under/accessories/storage.dm b/code/modules/clothing/under/accessories/storage.dm
index 705c498b88f..aea6cf139f3 100644
--- a/code/modules/clothing/under/accessories/storage.dm
+++ b/code/modules/clothing/under/accessories/storage.dm
@@ -6,8 +6,8 @@
slot = "utility"
var/slots = 3
var/obj/item/weapon/storage/internal/hold
- action_button_name = "View Storage"
- w_class = 3.0 // so it doesn't fit in pockets
+ actions_types = list(/datum/action/item_action/accessory/storage)
+ w_class = 3 // so it doesn't fit in pockets
/obj/item/clothing/accessory/storage/New()
..()
@@ -15,18 +15,18 @@
hold.storage_slots = slots
/obj/item/clothing/accessory/storage/attack_hand(mob/user as mob)
- if (has_suit) //if we are part of a suit
+ if(has_suit) //if we are part of a suit
hold.open(user)
return
- if (hold.handle_attack_hand(user)) //otherwise interact as a regular storage item
+ if(hold.handle_attack_hand(user)) //otherwise interact as a regular storage item
..(user)
/obj/item/clothing/accessory/storage/MouseDrop(obj/over_object as obj)
- if (has_suit)
+ if(has_suit)
return
- if (hold.handle_mousedrop(usr, over_object))
+ if(hold.handle_mousedrop(usr, over_object))
..(over_object)
/obj/item/clothing/accessory/storage/attackby(obj/item/W as obj, mob/user as mob, params)
@@ -54,12 +54,12 @@
L += S.return_inv()
for(var/obj/item/weapon/gift/G in src)
L += G.gift
- if (istype(G.gift, /obj/item/weapon/storage))
+ if(istype(G.gift, /obj/item/weapon/storage))
L += G.gift:return_inv()
return L
/obj/item/clothing/accessory/storage/attack_self(mob/user as mob)
- if (has_suit) //if we are part of a suit
+ if(has_suit) //if we are part of a suit
hold.open(user)
else
to_chat(user, "You empty [src].")
diff --git a/code/modules/clothing/under/chameleon.dm b/code/modules/clothing/under/chameleon.dm
index cf74d17de05..8f5a540f3c3 100644
--- a/code/modules/clothing/under/chameleon.dm
+++ b/code/modules/clothing/under/chameleon.dm
@@ -39,11 +39,13 @@
desc = "Groovy!"
icon_state = "psyche"
item_color = "psyche"
+ usr.update_inv_w_uniform()
spawn(200)
- name = "Black Jumpsuit"
- icon_state = "bl_suit"
- item_color = "black"
- desc = null
+ name = initial(name)
+ icon_state = initial(icon_state)
+ item_color = initial(item_color)
+ desc = initial(desc)
+ usr.update_inv_w_uniform()
..()
diff --git a/code/modules/clothing/under/color.dm b/code/modules/clothing/under/color.dm
index 2b8a1643aba..886d48932aa 100644
--- a/code/modules/clothing/under/color.dm
+++ b/code/modules/clothing/under/color.dm
@@ -55,6 +55,14 @@
flags = NODROP
flags_size = ONESIZEFITSALL
+/obj/item/clothing/under/color/grey/glorf
+ name = "ancient jumpsuit"
+ desc = "A terribly ragged and frayed grey jumpsuit. It looks like it hasn't been washed in over a decade."
+
+/obj/item/clothing/under/color/grey/glorf/hit_reaction(mob/living/carbon/human/owner)
+ owner.forcesay(hit_appends)
+ return 0
+
/obj/item/clothing/under/color/orange
name = "orange jumpsuit"
desc = "Don't wear this near paranoid security officers"
diff --git a/code/modules/clothing/under/jobs/civilian.dm b/code/modules/clothing/under/jobs/civilian.dm
index 5a7017b353a..68307875b1b 100644
--- a/code/modules/clothing/under/jobs/civilian.dm
+++ b/code/modules/clothing/under/jobs/civilian.dm
@@ -70,6 +70,9 @@
item_color = "clown"
flags_size = ONESIZEFITSALL
+/obj/item/clothing/under/rank/clown/hit_reaction()
+ playsound(loc, 'sound/items/bikehorn.ogg', 50, 1, -1)
+ return 0
/obj/item/clothing/under/rank/head_of_personnel
desc = "It's a jumpsuit worn by someone who works in the position of \"Head of Personnel\"."
diff --git a/code/modules/clothing/under/miscellaneous.dm b/code/modules/clothing/under/miscellaneous.dm
index 769e388f546..d912a2e289d 100644
--- a/code/modules/clothing/under/miscellaneous.dm
+++ b/code/modules/clothing/under/miscellaneous.dm
@@ -709,3 +709,15 @@
to_chat(user,"You can't fit inside while wearing that \the [user.get_item_by_slot(slot_id)].")
return 0
return 1
+
+/obj/item/clothing/under/cursedclown
+ name = "cursed clown suit"
+ desc = "It wasn't already?"
+ icon = 'icons/goonstation/objects/clothing/uniform.dmi'
+ icon_state = "cursedclown"
+ item_state = "cclown_uniform"
+ item_color = "cursedclown"
+ icon_override = 'icons/goonstation/mob/clothing/uniform.dmi'
+ lefthand_file = 'icons/goonstation/mob/inhands/clothing_lefthand.dmi'
+ righthand_file = 'icons/goonstation/mob/inhands/clothing_righthand.dmi'
+ flags = NODROP
diff --git a/code/modules/clothing/under/syndicate.dm b/code/modules/clothing/under/syndicate.dm
index 011f6784362..198a3e46de9 100644
--- a/code/modules/clothing/under/syndicate.dm
+++ b/code/modules/clothing/under/syndicate.dm
@@ -1,6 +1,6 @@
/obj/item/clothing/under/syndicate
name = "tactical turtleneck"
- desc = "It's some non-descript, slightly suspicious looking, support clothing."
+ desc = "A non-descript and slightly suspicious looking turtleneck with digital camouflage cargo pants."
icon_state = "syndicate"
item_state = "bl_suit"
item_color = "syndicate"
@@ -11,8 +11,9 @@
name = "combat turtleneck"
/obj/item/clothing/under/syndicate/tacticool
- name = "\improper Tacticool turtleneck"
+ name = "tacticool turtleneck"
desc = "Just looking at it makes you want to buy an SKS, go into the woods, and -operate-."
icon_state = "tactifool"
item_state = "bl_suit"
- item_color = "tactifool"
\ No newline at end of file
+ item_color = "tactifool"
+ armor = list(melee = 0, bullet = 0, laser = 0, energy = 0, bomb = 0, bio = 0, rad = 0)
\ No newline at end of file
diff --git a/code/modules/computer3/buildandrepair.dm b/code/modules/computer3/buildandrepair.dm
index 4ea984d15d1..2165205e354 100644
--- a/code/modules/computer3/buildandrepair.dm
+++ b/code/modules/computer3/buildandrepair.dm
@@ -2,7 +2,7 @@
/obj/item/part/computer/circuitboard
density = 0
anchored = 0
- w_class = 2.0
+ w_class = 2
name = "Circuit board"
icon = 'icons/obj/module.dmi'
icon_state = "id_mod"
diff --git a/code/modules/computer3/component.dm b/code/modules/computer3/component.dm
index 6dac7aebb31..0070c057fcd 100644
--- a/code/modules/computer3/component.dm
+++ b/code/modules/computer3/component.dm
@@ -14,7 +14,7 @@
gender = PLURAL
icon = 'icons/obj/stock_parts.dmi'
icon_state = "hdd1"
- w_class = 2.0
+ w_class = 2
var/emagged = 0
crit_fail = 0
@@ -116,9 +116,9 @@
if(3)
if(equip_to_reader(card, L))
to_chat(usr, "You insert the card into reader slot")
- else if (equip_to_writer(card, L) && dualslot)
+ else if(equip_to_writer(card, L) && dualslot)
to_chat(usr, "You insert the card into writer slot")
- else if (dualslot)
+ else if(dualslot)
to_chat(usr, "There is already something in both slots.")
else
to_chat(usr, "There is already something in the reader slot.")
@@ -146,18 +146,18 @@
var/mob/living/L = usr
switch(slot)
if(1)
- if (remove_reader(L))
+ if(remove_reader(L))
to_chat(L, "You remove the card from reader slot")
else
to_chat(L, "There is no card in the reader slot")
if(2)
- if (remove_writer(L))
+ if(remove_writer(L))
to_chat(L, "You remove the card from writer slot")
else
to_chat(L, "There is no card in the writer slot")
if(3)
- if (remove_reader(L))
- if (remove_writer(L))
+ if(remove_reader(L))
+ if(remove_writer(L))
to_chat(L, "You remove cards from both slots")
else
to_chat(L, "You remove the card from reader slot")
@@ -167,10 +167,10 @@
else
to_chat(L, "There are no cards in both slots")
if(4)
- if (!remove_reader(L))
- if (remove_writer(L))
+ if(!remove_reader(L))
+ if(remove_writer(L))
to_chat(L, "You remove the card from writer slot")
- else if (!dualslot)
+ else if(!dualslot)
to_chat(L, "There is no card in the reader slot")
else
to_chat(L, "There are no cards in both slots")
diff --git a/code/modules/computer3/computer.dm b/code/modules/computer3/computer.dm
index 75252b33107..eca1207c692 100644
--- a/code/modules/computer3/computer.dm
+++ b/code/modules/computer3/computer.dm
@@ -212,15 +212,15 @@
qdel(src)
return
if(2.0)
- if (prob(25))
+ if(prob(25))
qdel(src)
return
- if (prob(50))
+ if(prob(50))
for(var/x in verbs)
verbs -= x
set_broken()
if(3.0)
- if (prob(25))
+ if(prob(25))
for(var/x in verbs)
verbs -= x
set_broken()
@@ -229,7 +229,7 @@
blob_act()
- if (prob(75))
+ if(prob(75))
set_broken()
density = 0
@@ -443,7 +443,7 @@
//Returns percentage of battery charge remaining. Returns -1 if no battery is installed.
proc/check_battery_status()
- if (battery)
+ if(battery)
var/obj/item/weapon/stock_parts/cell/B = battery
return round(B.charge / (B.maxcharge / 100))
else
diff --git a/code/modules/computer3/computers/aifixer.dm b/code/modules/computer3/computers/aifixer.dm
index a52e40a0d54..7e1f3959e9f 100644
--- a/code/modules/computer3/computers/aifixer.dm
+++ b/code/modules/computer3/computers/aifixer.dm
@@ -19,7 +19,7 @@
if(!computer.cradle.occupant)
overlay.icon_state = "ai-fixer-empty"
else
- if (computer.cradle.occupant.health >= 0 && computer.cradle.occupant.stat != 2)
+ if(computer.cradle.occupant.health >= 0 && computer.cradle.occupant.stat != 2)
overlay.icon_state = "ai-fixer-full"
else
overlay.icon_state = "ai-fixer-404"
@@ -39,34 +39,34 @@
proc/aifixer_menu()
var/dat = ""
- if (computer.cradle.occupant)
+ if(computer.cradle.occupant)
var/laws
dat += "
Stored AI: [computer.cradle.occupant.name]
"
dat += "System integrity: [(computer.cradle.occupant.health+100)/2]% "
- if (computer.cradle.occupant.laws.zeroth)
+ if(computer.cradle.occupant.laws.zeroth)
laws += "0: [computer.cradle.occupant.laws.zeroth] "
var/number = 1
- for (var/index = 1, index <= computer.cradle.occupant.laws.inherent.len, index++)
+ for(var/index = 1, index <= computer.cradle.occupant.laws.inherent.len, index++)
var/law = computer.cradle.occupant.laws.inherent[index]
- if (length(law) > 0)
+ if(length(law) > 0)
laws += "[number]: [law] "
number++
- for (var/index = 1, index <= computer.cradle.occupant.laws.supplied.len, index++)
+ for(var/index = 1, index <= computer.cradle.occupant.laws.supplied.len, index++)
var/law = computer.cradle.occupant.laws.supplied[index]
- if (length(law) > 0)
+ if(length(law) > 0)
laws += "[number]: [law] "
number++
dat += "Laws: [laws] "
- if (computer.cradle.occupant.stat == 2)
+ if(computer.cradle.occupant.stat == 2)
dat += "AI non-functional"
else
dat += "AI functional"
- if (!computer.cradle.busy)
+ if(!computer.cradle.busy)
dat += "
[topic_link(src,"fix","Begin Reconstruction")]"
else
dat += "
"
@@ -104,11 +104,11 @@
dat += "Unique Identifier: [active_record.fields["UI"]] "
dat += "Structural Enzymes: [active_record.fields["SE"]] "
- if (has_disk)
+ if(has_disk)
dat += "
"
dat += "
Inserted Disk
"
dat += "Contents: "
- if (computer.floppy.inserted.files.len == 0)
+ if(computer.floppy.inserted.files.len == 0)
dat += "Empty"
else
for(var/datum/file/data/genome/G in computer.floppy.inserted.files)
@@ -170,9 +170,9 @@
if(loading || !interactable())
return
- if (href_list["menu"])
+ if(href_list["menu"])
menu = text2num(href_list["menu"])
- else if (("scan" in href_list) && !isnull(scanner))
+ else if(("scan" in href_list) && !isnull(scanner))
scantemp = ""
loading = 1
@@ -186,16 +186,16 @@
//No locking an open scanner.
- else if (("lock" in href_list) && !isnull(scanner))
- if ((!scanner.locked) && (scanner.occupant))
+ else if(("lock" in href_list) && !isnull(scanner))
+ if((!scanner.locked) && (scanner.occupant))
scanner.locked = 1
else
scanner.locked = 0
- else if ("view_rec" in href_list)
+ else if("view_rec" in href_list)
active_record = locate(href_list["view_rec"])
if(istype(active_record,/datum/data/record))
- if ( !active_record.fields["ckey"] || active_record.fields["ckey"] == "" )
+ if( !active_record.fields["ckey"] || active_record.fields["ckey"] == "" )
del(active_record)
temp = "Record Corrupt"
else
@@ -204,16 +204,16 @@
active_record = null
temp = "Record missing."
- else if ("del_rec" in href_list)
- if ((!active_record) || (menu < 3))
+ else if("del_rec" in href_list)
+ if((!active_record) || (menu < 3))
return
- if (menu == 3) //If we are viewing a record, confirm deletion
+ if(menu == 3) //If we are viewing a record, confirm deletion
temp = "Delete record?"
menu = 4
- else if (menu == 4)
+ else if(menu == 4)
var/obj/item/weapon/card/id/C = usr.get_active_hand()
- if (istype(C)||istype(C, /obj/item/device/pda))
+ if(istype(C)||istype(C, /obj/item/device/pda))
if(check_access(C))
temp = "[active_record.fields["name"]] => Record deleted."
records.Remove(active_record)
@@ -222,7 +222,7 @@
else
temp = "Access Denied."
- else if ("eject_disk" in href_list)
+ else if("eject_disk" in href_list)
if(computer.floppy)
computer.floppy.eject_disk()
@@ -243,7 +243,7 @@
if(/datum/file/data/genome/cloning)
active_record = G:record
else if("savefile" in href_list)
- if (!active_record || !computer || !computer.floppy)
+ if(!active_record || !computer || !computer.floppy)
temp = "Save error."
computer.updateUsrDialog()
return
@@ -272,10 +272,10 @@
if(!rval)
temp = "Disk write error."
- else if ("refresh" in href_list)
+ else if("refresh" in href_list)
computer.updateUsrDialog()
- else if ("clone" in href_list)
+ else if("clone" in href_list)
//Look for that player! They better be dead!
if(active_record)
//Can't clone without someone to clone. Or a pod. Or if the pod is busy. Or full of gibs.
@@ -303,22 +303,22 @@
return
proc/scan_mob(mob/living/carbon/human/subject as mob)
- if ((isnull(subject)) || (!(ishuman(subject))) || (!subject.dna))
+ if((isnull(subject)) || (!(ishuman(subject))) || (!subject.dna))
scantemp = "Unable to locate valid genetic data."
return
- if (!getbrain(subject))
+ if(!getbrain(subject))
scantemp = "No signs of intelligence detected."
return
- if (subject.suiciding == 1)
+ if(subject.suiciding == 1)
scantemp = "Subject's brain is not responding to scanning stimuli."
return
- if ((!subject.ckey) || (!subject.client))
+ if((!subject.ckey) || (!subject.client))
scantemp = "Mental interface failure."
return
- if (NOCLONE in subject.mutations)
+ if(NOCLONE in subject.mutations)
scantemp = "Mental interface failure."
return
- if (!isnull(find_record(subject.ckey)))
+ if(!isnull(find_record(subject.ckey)))
scantemp = "Subject already in database."
return
@@ -341,7 +341,7 @@
//Add an implant if needed
var/obj/item/weapon/implant/health/imp = locate(/obj/item/weapon/implant/health, subject)
- if (isnull(imp))
+ if(isnull(imp))
imp = new /obj/item/weapon/implant/health(subject)
imp.implanted = subject
R.fields["imp"] = "\ref[imp]"
@@ -349,7 +349,7 @@
else
R.fields["imp"] = "\ref[imp]"
- if (!isnull(subject.mind)) //Save that mind so traitors can continue traitoring after cloning.
+ if(!isnull(subject.mind)) //Save that mind so traitors can continue traitoring after cloning.
R.fields["mind"] = "\ref[subject.mind]"
records += R
@@ -358,6 +358,6 @@
//Find a specific record by key.
proc/find_record(var/find_key)
for(var/datum/data/record/R in records)
- if (R.fields["ckey"] == find_key)
+ if(R.fields["ckey"] == find_key)
return R
return null
diff --git a/code/modules/computer3/computers/communications.dm b/code/modules/computer3/computers/communications.dm
index 23e3bba3e4b..2f02bdcfdb3 100644
--- a/code/modules/computer3/computers/communications.dm
+++ b/code/modules/computer3/computers/communications.dm
@@ -59,7 +59,7 @@
Topic(var/href, var/list/href_list)
if(!interactable() || !computer.radio || ..(href,href_list) )
return
- if (!(computer.z in config.station_levels))
+ if(!(computer.z in config.station_levels))
to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return
@@ -85,7 +85,7 @@
var/obj/item/I = M.get_active_hand()
I = I.GetID()
- if (istype(I,/obj/item/weapon/card/id))
+ if(istype(I,/obj/item/weapon/card/id))
if(access_captain in I.GetAccess())
var/old_level = security_level
if(!tmp_alertlevel) tmp_alertlevel = SEC_LEVEL_GREEN
@@ -146,7 +146,7 @@
state = STATE_MESSAGELIST
if("viewmessage" in href_list)
state = STATE_VIEWMESSAGE
- if (!currmsg)
+ if(!currmsg)
if(href_list["message-num"])
currmsg = text2num(href_list["message-num"])
else
@@ -247,7 +247,7 @@
aistate = STATE_MESSAGELIST
if("ai-viewmessage" in href_list)
aistate = STATE_VIEWMESSAGE
- if (!aicurrmsg)
+ if(!aicurrmsg)
if(href_list["message-num"])
aicurrmsg = text2num(href_list["message-num"])
else
@@ -281,16 +281,16 @@
proc/main_menu()
var/dat = ""
- if (computer.radio.subspace)
+ if(computer.radio.subspace)
if(shuttle_master.emergency.mode == SHUTTLE_CALL)
var/timeleft = shuttle_master.emergency.timeLeft()
dat += "Emergency shuttle\n \nETA: [timeleft / 60 % 60]:[add_zero(num2text(timeleft % 60), 2)]"
refresh = 1
else
refresh = 0
- if (authenticated)
+ if(authenticated)
dat += " \[ Log Out \]"
- if (authenticated==2)
+ if(authenticated==2)
dat += " \[ Make An Announcement \]"
if(computer.emagged == 0)
dat += " \[ Send an emergency message to Centcomm \]"
@@ -300,7 +300,7 @@
dat += " \[ Change alert level \]"
/*if(emergency_shuttle.location())
- if (emergency_shuttle.online())
+ if(emergency_shuttle.online())
dat += " \[ Cancel Shuttle Call \]"
else
dat += " \[ Call Emergency Shuttle \]"*/
@@ -335,16 +335,16 @@
for(var/i = 1; i<=messagetitle.len; i++)
dat += " [messagetitle[i]]"
if(STATE_VIEWMESSAGE)
- if (currmsg)
+ if(currmsg)
dat += "[messagetitle[currmsg]]
[messagetext[currmsg]]"
- if (authenticated)
+ if(authenticated)
dat += "
\[ Delete \]"
else
state = STATE_MESSAGELIST
interact()
return
if(STATE_DELMESSAGE)
- if (currmsg)
+ if(currmsg)
dat += "Are you sure you want to delete this message? \[ OK | Cancel \]"
else
state = STATE_MESSAGELIST
diff --git a/code/modules/computer3/computers/law.dm b/code/modules/computer3/computers/law.dm
index 71d30df68d6..d75a016f680 100644
--- a/code/modules/computer3/computers/law.dm
+++ b/code/modules/computer3/computers/law.dm
@@ -24,7 +24,7 @@
attackby(obj/item/weapon/aiModule/module as obj, mob/user as mob, params)
- if (user.z > 6)
+ if(user.z > 6)
to_chat(user, "Unable to establish a connection: You're too far away from the station!")
return
if(istype(module, /obj/item/weapon/aiModule))
@@ -43,7 +43,7 @@
src.current = select_active_ai(user)
- if (!src.current)
+ if(!src.current)
to_chat(usr, "No active AIs detected.")
else
to_chat(usr, "[src.current.name] selected for law changes.")
@@ -75,7 +75,7 @@
src.current = freeborg()
- if (!src.current)
+ if(!src.current)
to_chat(usr, "No free cyborgs detected.")
else
to_chat(usr, "[src.current.name] selected for law changes.")
diff --git a/code/modules/computer3/computers/medical.dm b/code/modules/computer3/computers/medical.dm
index 5d283af5b53..27002c264c2 100644
--- a/code/modules/computer3/computers/medical.dm
+++ b/code/modules/computer3/computers/medical.dm
@@ -49,21 +49,21 @@
scan = computer.cardslot.reader
if(!interactable())
return
- if (computer.z > 6)
+ if(computer.z > 6)
to_chat(usr, "Unable to establish a connection: You're too far away from the station!")
return
var/dat
- if (temp)
+ if(temp)
dat = text("[src.temp]
", record2.fields["b_type"], record2.fields["b_dna"], record2.fields["mi_dis"], record2.fields["mi_dis_d"], record2.fields["ma_dis"], record2.fields["ma_dis_d"], record2.fields["alg"], record2.fields["alg_d"], record2.fields["cdi"], record2.fields["cdi_d"], decode(record2.fields["notes"]))
var/counter = 1
while(record2.fields[text("com_[]", counter)])
diff --git a/code/modules/computer3/computers/message.dm b/code/modules/computer3/computers/message.dm
index cb9d27dd0b9..cf40e7f3a0c 100644
--- a/code/modules/computer3/computers/message.dm
+++ b/code/modules/computer3/computers/message.dm
@@ -242,7 +242,7 @@
if(!interactable() || ..(href,href_list))
return
- if ("auth" in href_list)
+ if("auth" in href_list)
if(auth)
auth = 0
screen = 0
@@ -255,10 +255,10 @@
message = incorrectkey
//Turn the server on/off.
- if ("active" in href_list)
+ if("active" in href_list)
if(auth) linkedServer.active = !linkedServer.active
//Find a server
- if ("find" in href_list)
+ if("find" in href_list)
if(message_servers && message_servers.len > 1)
src.linkedServer = input(usr,"Please select a server.", "Select a server.", null) as null|anything in message_servers
message = "NOTICE: Server selected."
@@ -269,7 +269,7 @@
message = noserver
//View the logs - KEY REQUIRED
- if ("view" in href_list)
+ if("view" in href_list)
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
@@ -277,7 +277,7 @@
src.screen = 1
//Clears the logs - KEY REQUIRED
- if ("clear" in href_list)
+ if("clear" in href_list)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
@@ -285,7 +285,7 @@
src.linkedServer.pda_msgs = list()
message = "NOTICE: Logs cleared."
//Clears the request console logs - KEY REQUIRED
- if ("clearr" in href_list)
+ if("clearr" in href_list)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
@@ -293,7 +293,7 @@
src.linkedServer.rc_msgs = list()
message = "NOTICE: Logs cleared."
//Change the password - KEY REQUIRED
- if ("pass" in href_list)
+ if("pass" in href_list)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
@@ -313,7 +313,7 @@
message = incorrectkey
//Hack the Console to get the password
- if ("hack" in href_list)
+ if("hack" in href_list)
if((istype(usr, /mob/living/silicon/ai) || istype(usr, /mob/living/silicon/robot)) && (usr.mind.special_role && usr.mind.original == usr))
src.hacking = 1
src.screen = 2
@@ -323,7 +323,7 @@
if(src && src.linkedServer && usr)
BruteForce(usr)
//Delete the log.
- if ("delete" in href_list)
+ if("delete" in href_list)
//Are they on the view logs screen?
if(screen == 1)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
@@ -332,7 +332,7 @@
src.linkedServer.pda_msgs -= locate(href_list["delete"])
message = "NOTICE: Log Deleted!"
//Delete the request console log.
- if ("deleter" in href_list)
+ if("deleter" in href_list)
//Are they on the view logs screen?
if(screen == 4)
if(!linkedServer || (src.linkedServer.stat & (NOPOWER|BROKEN)))
@@ -341,14 +341,14 @@
src.linkedServer.rc_msgs -= locate(href_list["deleter"])
message = "NOTICE: Log Deleted!"
//Create a custom message
- if ("msg" in href_list)
+ if("msg" in href_list)
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
else
if(auth)
src.screen = 3
//Fake messaging selection - KEY REQUIRED
- if ("select" in href_list)
+ if("select" in href_list)
if(src.linkedServer == null || (src.linkedServer.stat & (NOPOWER|BROKEN)))
message = noserver
screen = 0
@@ -400,17 +400,17 @@
return src.attack_hand(usr)
var/obj/item/device/pda/PDARec = null
- for (var/obj/item/device/pda/P in PDAs)
- if (!P.owner || P.toff || P.hidden) continue
+ for(var/obj/item/device/pda/P in PDAs)
+ if(!P.owner || P.toff || P.hidden) continue
if(P.owner == customsender)
PDARec = P
//Sender isn't faking as someone who exists
if(isnull(PDARec))
src.linkedServer.send_pda_message("[customrecepient.owner]", "[customsender]","[custommessage]")
customrecepient.tnote += "← From [customsender] ([customjob]): [custommessage] "
- if (!customrecepient.silent)
+ if(!customrecepient.silent)
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
- for (var/mob/O in hearers(3, customrecepient.loc))
+ for(var/mob/O in hearers(3, customrecepient.loc))
O.show_message(text("[bicon(customrecepient)] *[customrecepient.ttone]*"))
if( customrecepient.loc && ishuman(customrecepient.loc) )
var/mob/living/carbon/human/H = customrecepient.loc
@@ -423,9 +423,9 @@
else
src.linkedServer.send_pda_message("[customrecepient.owner]", "[PDARec.owner]","[custommessage]")
customrecepient.tnote += "← From [PDARec.owner] ([customjob]): [custommessage] "
- if (!customrecepient.silent)
+ if(!customrecepient.silent)
playsound(customrecepient.loc, 'sound/machines/twobeep.ogg', 50, 1)
- for (var/mob/O in hearers(3, customrecepient.loc))
+ for(var/mob/O in hearers(3, customrecepient.loc))
O.show_message(text("[bicon(customrecepient)] *[customrecepient.ttone]*"))
if( customrecepient.loc && ishuman(customrecepient.loc) )
var/mob/living/carbon/human/H = customrecepient.loc
@@ -447,6 +447,6 @@
// to_chat(usr, href_list["select"])
- if ("back" in href_list)
+ if("back" in href_list)
src.screen = 0
interact()
\ No newline at end of file
diff --git a/code/modules/computer3/computers/prisonshuttle.dm b/code/modules/computer3/computers/prisonshuttle.dm
index 119dbc350a4..e7dd5c650ac 100644
--- a/code/modules/computer3/computers/prisonshuttle.dm
+++ b/code/modules/computer3/computers/prisonshuttle.dm
@@ -40,12 +40,12 @@ var/prison_shuttle_timeleft = 0
if(do_after(user, 20, target = src))
var/obj/structure/computerframe/A = new /obj/structure/computerframe( src.loc )
var/obj/item/part/board/circuit/prison_shuttle/M = new /obj/item/part/board/circuit/prison_shuttle( A )
- for (var/obj/C in src)
+ for(var/obj/C in src)
C.loc = src.loc
A.circuit = M
A.anchored = 1
- if (src.stat & BROKEN)
+ if(src.stat & BROKEN)
to_chat(user, "\blue The broken glass falls out.")
new /obj/item/trash/shard( src.loc )
A.state = 3
@@ -75,7 +75,7 @@ var/prison_shuttle_timeleft = 0
user.set_machine(src)
post_signal("prison")
var/dat
- if (src.temp)
+ if(src.temp)
dat = src.temp
else
dat += {"Location: [prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison ? "Moving to station ([prison_shuttle_timeleft] Secs.)":prison_shuttle_at_station ? "Station":"Dock"]
@@ -95,11 +95,11 @@ var/prison_shuttle_timeleft = 0
if(..())
return
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
+ if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
- if (href_list["sendtodock"])
- if (!prison_can_move())
+ if(href_list["sendtodock"])
+ if(!prison_can_move())
to_chat(usr, "\red The prison shuttle is unable to leave.")
return
if(!prison_shuttle_at_station|| prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
@@ -112,8 +112,8 @@ var/prison_shuttle_timeleft = 0
spawn(0)
prison_process()
- else if (href_list["sendtostation"])
- if (!prison_can_move())
+ else if(href_list["sendtostation"])
+ if(!prison_can_move())
to_chat(usr, "\red The prison shuttle is unable to leave.")
return
if(prison_shuttle_at_station || prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
@@ -126,7 +126,7 @@ var/prison_shuttle_timeleft = 0
spawn(0)
prison_process()
- else if (href_list["mainmenu"])
+ else if(href_list["mainmenu"])
src.temp = null
src.add_fingerprint(usr)
@@ -141,13 +141,13 @@ var/prison_shuttle_timeleft = 0
/*
proc/prison_break()
switch(prison_break)
- if (0)
+ if(0)
if(!prison_shuttle_at_station || prison_shuttle_moving_to_prison) return
prison_shuttle_moving_to_prison = 1
prison_shuttle_at_station = prison_shuttle_at_station
- if (!prison_shuttle_moving_to_prison || !prison_shuttle_moving_to_station)
+ if(!prison_shuttle_moving_to_prison || !prison_shuttle_moving_to_station)
prison_shuttle_time = world.timeofday + PRISON_MOVETIME
spawn(0)
prison_process()
@@ -183,9 +183,9 @@ var/prison_shuttle_timeleft = 0
if(0)
prison_shuttle_at_station = 1
- if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
+ if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
- if (!prison_can_move())
+ if(!prison_can_move())
to_chat(usr, "\red The prison shuttle is unable to leave.")
return
@@ -212,9 +212,9 @@ var/prison_shuttle_timeleft = 0
if(1)
prison_shuttle_at_station = 0
- if (prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
+ if(prison_shuttle_moving_to_station || prison_shuttle_moving_to_prison) return
- if (!prison_can_move())
+ if(!prison_can_move())
to_chat(usr, "\red The prison shuttle is unable to leave.")
return
diff --git a/code/modules/computer3/computers/robot.dm b/code/modules/computer3/computers/robot.dm
index 002750b49c1..9e9e4b29fac 100644
--- a/code/modules/computer3/computers/robot.dm
+++ b/code/modules/computer3/computers/robot.dm
@@ -34,7 +34,7 @@
if(!interactable() || computer.z > 6)
return
var/dat
- if (src.temp)
+ if(src.temp)
dat = "[src.temp]
Clear Screen"
else
if(screen == 0)
@@ -44,10 +44,10 @@
if(screen == 1)
for(var/mob/living/silicon/robot/R in mob_list)
if(istype(usr, /mob/living/silicon/ai))
- if (R.connected_ai != usr)
+ if(R.connected_ai != usr)
continue
if(istype(usr, /mob/living/silicon/robot))
- if (R != usr)
+ if(R != usr)
continue
if(R.scrambledcodes)
continue
@@ -55,11 +55,11 @@
dat += "[R.name] |"
if(R.stat)
dat += " Not Responding |"
- else if (!R.canmove)
+ else if(!R.canmove)
dat += " Locked Down |"
else
dat += " Operating Normally |"
- if (!R.canmove)
+ if(!R.canmove)
else if(R.cell)
dat += " Battery Installed ([R.cell.charge]/[R.cell.maxcharge]) |"
else
@@ -72,7 +72,7 @@
dat += " Slaved to [R.connected_ai.name] |"
else
dat += " Independent from AI |"
- if (istype(usr, /mob/living/silicon))
+ if(istype(usr, /mob/living/silicon))
if(issilicon(usr) && is_special_character(usr) && !R.emagged)
dat += "(Hack) "
dat += "([R.canmove ? "Lockdown" : "Release"]) "
@@ -105,19 +105,19 @@
if(!interactable() || ..(href,href_list))
return
- if ("killall" in href_list)
+ if("killall" in href_list)
src.temp = {"Destroy Robots?
\[Swipe ID to initiate destruction sequence\] Cancel"}
- if ("do_killall" in href_list)
+ if("do_killall" in href_list)
var/obj/item/weapon/card/id/I = usr.get_active_hand()
- if (istype(I, /obj/item/device/pda))
+ if(istype(I, /obj/item/device/pda))
var/obj/item/device/pda/pda = I
I = pda.id
- if (istype(I))
+ if(istype(I))
if(src.check_access(I))
- if (!status)
+ if(!status)
message_admins("\blue [key_name_admin(usr)] has initiated the global cyborg killswitch!")
log_game("\blue [key_name(usr)] has initiated the global cyborg killswitch!")
src.status = 1
@@ -127,23 +127,23 @@
else
to_chat(usr, "\red Access Denied.")
- if ("stop" in href_list)
+ if("stop" in href_list)
src.temp = {"
Stop Robot Destruction Sequence?
Yes No"}
- if ("stop2" in href_list)
+ if("stop2" in href_list)
src.stop = 1
src.temp = null
src.status = 0
- if ("reset" in href_list)
+ if("reset" in href_list)
src.timeleft = 60
- if ("temp" in href_list)
+ if("temp" in href_list)
src.temp = null
- if ("screen" in href_list)
+ if("screen" in href_list)
switch(href_list["screen"])
if("0")
screen = 0
@@ -151,7 +151,7 @@
screen = 1
if("2")
screen = 2
- if ("killbot" in href_list)
+ if("killbot" in href_list)
if(computer.allowed(usr))
var/mob/living/silicon/robot/R = locate(href_list["killbot"])
if(R)
@@ -169,7 +169,7 @@
else
to_chat(usr, "\red Access Denied.")
- if ("stopbot" in href_list)
+ if("stopbot" in href_list)
if(computer.allowed(usr))
var/mob/living/silicon/robot/R = locate(href_list["stopbot"])
if(R && istype(R)) // Extra sancheck because of input var references
@@ -179,7 +179,7 @@
message_admins("\blue [key_name_admin(usr)] [R.canmove ? "locked down" : "released"] [R.name]!")
log_game("[key_name(usr)] [R.canmove ? "locked down" : "released"] [R.name]!")
R.canmove = !R.canmove
- if (R.lockcharge)
+ if(R.lockcharge)
// R.cell.charge = R.lockcharge
R.lockcharge = !R.lockcharge
to_chat(R, "Your lockdown has been lifted!")
@@ -191,7 +191,7 @@
else
to_chat(usr, "\red Access Denied.")
- if ("magbot" in href_list)
+ if("magbot" in href_list)
if(computer.allowed(usr))
var/mob/living/silicon/robot/R = locate(href_list["magbot"])
if(R)
diff --git a/code/modules/computer3/computers/scanconsole.dm b/code/modules/computer3/computers/scanconsole.dm
index fa88ae24b36..1ccc06bde90 100644
--- a/code/modules/computer3/computers/scanconsole.dm
+++ b/code/modules/computer3/computers/scanconsole.dm
@@ -279,7 +279,7 @@
var/rejuvenators = round(occupant.reagents.get_reagent_amount("inaprovaline") / REJUVENATORS_MAX * 100)
status_html += "
Rejuvenators:
[occupant.reagents.get_reagent_amount("inaprovaline")] units
"
- if (dna_summary)
+ if(dna_summary)
status_html += "
Unique Enzymes :
[uppertext(occupant.dna.unique_enzymes)]
"
status_html += "
Unique Identifier:
[occupant.dna.uni_identity]
"
status_html += "
Structural Enzymes:
[occupant.dna.struc_enzymes]
"
@@ -384,7 +384,7 @@
proc/emitter_menu()
to_chat(var/dat = topic_link(src,"mode=0",", Main Menu") + " ")
dat += "
Radiation Emitter Settings
"
- if (viable)
+ if(viable)
dat += topic_link(src,"pulse","Pulse Radiation")
else
dat += fake_link("Pulse Radiation")
@@ -454,7 +454,7 @@
updateappearance(scanner.occupant,scanner.occupant.dna.uni_identity)
scanner.occupant.apply_effect(radstrength+radduration, IRRADIATE)
if("ui-f")
- if (prob(20+radstrength))
+ if(prob(20+radstrength))
randmutb(scanner.occupant)
domutcheck(scanner.occupant,scanner)
else
@@ -466,8 +466,8 @@
var/se = scanner.occupant.dna.struc_enzymes
var/targetblock = se_block
- if (!(se_block in list(2,8,10,12)) && prob (20)) // shifts the target slightly
- if (se_block <= 5)
+ if(!(se_block in list(2,8,10,12)) && prob (20)) // shifts the target slightly
+ if(se_block <= 5)
targetblock++
else
targetblock--
@@ -484,7 +484,7 @@
domutcheck(scanner.occupant,scanner)
scanner.occupant.apply_effect(radstrength+radduration, IRRADIATE)
if("se-f")
- if (prob(80-radduration))
+ if(prob(80-radduration))
randmutb(scanner.occupant)
domutcheck(scanner.occupant,scanner)
else
@@ -493,7 +493,7 @@
scanner.occupant.apply_effect((radstrength*2)+radduration, IRRADIATE)
if(null)
- if (prob(95))
+ if(prob(95))
if(prob(75))
randmutb(scanner.occupant)
else
@@ -517,7 +517,7 @@
if(istype(H))
var/inap = H.reagents.get_reagent_amount("inaprovaline") // oh my *god* this section was ugly before I shortened it
- if (inap < (REJUVENATORS_MAX - REJUVENATORS_INJECT))
+ if(inap < (REJUVENATORS_MAX - REJUVENATORS_INJECT))
H.reagents.add_reagent("inaprovaline", REJUVENATORS_INJECT)
else
H.reagents.add_reagent("inaprovaline", max(REJUVENATORS_MAX - inap,0))
@@ -534,32 +534,32 @@
var/viable_occupant = (occupant && occupant.dna && !(NOCLONE in occupant.mutations))
var/mob/living/carbon/human/human_occupant = scanner.occupant
- if (href_list["screen"]) // Passing a screen is only a request, we set current_screen here but it can be overridden below if necessary
+ if(href_list["screen"]) // Passing a screen is only a request, we set current_screen here but it can be overridden below if necessary
current_screen = href_list["screen"]
- if (!viable_occupant) // If there is no viable occupant only allow certain screens
+ if(!viable_occupant) // If there is no viable occupant only allow certain screens
var/allowed_no_occupant_screens = list("mainmenu", "radsetmenu", "buffermenu") //These are the screens which will be allowed if there's no occupant
- if (!(current_screen in allowed_no_occupant_screens))
+ if(!(current_screen in allowed_no_occupant_screens))
href_list = new /list(0) // clear list of options
current_screen = "mainmenu"
- if (!current_screen) // If no screen is set default to mainmenu
+ if(!current_screen) // If no screen is set default to mainmenu
current_screen = "mainmenu"
- if (!scanner) //Is the scanner not connected?
+ if(!scanner) //Is the scanner not connected?
scanner_status_html = "ERROR: No DNA Scanner connected."
current_screen = null // blank does not exist in the switch below, so no screen will be outputted
updateUsrDialog()
return
usr.set_machine(src)
- if (href_list["locked"])
- if (scanner.occupant)
+ if(href_list["locked"])
+ if(scanner.occupant)
scanner.locked = !( scanner.locked )
////////////////////////////////////////////////////////
- if (href_list["genpulse"])
+ if(href_list["genpulse"])
if(!viable_occupant)//Makes sure someone is in there (And valid) before trying anything
temp_html = text("No viable occupant detected.")//More than anything, this just acts as a sanity check in case the option DOES appear for whatever reason
//usr << browse(temp_html, "window=scannernew;size=550x650")
@@ -574,10 +574,10 @@
var/lock_state = scanner.locked
scanner.locked = 1//lock it
sleep(10*radduration)
- if (!scanner.occupant)
+ if(!scanner.occupant)
temp_html = null
return null
- if (prob(95))
+ if(prob(95))
if(prob(75))
randmutb(scanner.occupant)
else
@@ -591,59 +591,59 @@
scanner.locked = lock_state
temp_html = null
dopage(src,"screen=radsetmenu")
- if (href_list["radleplus"])
+ if(href_list["radleplus"])
if(!viable_occupant)
temp_html = text("No viable occupant detected.")
popup.set_content(temp_html)
popup.open()
- if (radduration < 20)
+ if(radduration < 20)
radduration++
radduration++
dopage(src,"screen=radsetmenu")
- if (href_list["radleminus"])
+ if(href_list["radleminus"])
if(!viable_occupant)
temp_html = text("No viable occupant detected.")
popup.set_content(temp_html)
popup.open()
- if (radduration > 2)
+ if(radduration > 2)
radduration--
radduration--
dopage(src,"screen=radsetmenu")
- if (href_list["radinplus"])
- if (radstrength < 10)
+ if(href_list["radinplus"])
+ if(radstrength < 10)
radstrength++
dopage(src,"screen=radsetmenu")
- if (href_list["radinminus"])
- if (radstrength > 1)
+ if(href_list["radinminus"])
+ if(radstrength > 1)
radstrength--
dopage(src,"screen=radsetmenu")
////////////////////////////////////////////////////////
- if (href_list["unimenuplus"])
- if (ui_block < 13)
+ if(href_list["unimenuplus"])
+ if(ui_block < 13)
ui_block++
else
ui_block = 1
dopage(src,"screen=unimenu")
- if (href_list["unimenuminus"])
- if (ui_block > 1)
+ if(href_list["unimenuminus"])
+ if(ui_block > 1)
ui_block--
else
ui_block = 13
dopage(src,"screen=unimenu")
- if (href_list["unimenusubplus"])
- if (subblock < 3)
+ if(href_list["unimenusubplus"])
+ if(subblock < 3)
subblock++
else
subblock = 1
dopage(src,"screen=unimenu")
- if (href_list["unimenusubminus"])
- if (subblock > 1)
+ if(href_list["unimenusubminus"])
+ if(subblock > 1)
subblock--
else
subblock = 3
dopage(src,"screen=unimenu")
- if (href_list["unimenutargetplus"])
- if (unitarget < 15)
+ if(href_list["unimenutargetplus"])
+ if(unitarget < 15)
unitarget++
unitargethex = unitarget
switch(unitarget)
@@ -663,8 +663,8 @@
unitarget = 0
unitargethex = 0
dopage(src,"screen=unimenu")
- if (href_list["unimenutargetminus"])
- if (unitarget > 0)
+ if(href_list["unimenutargetminus"])
+ if(unitarget > 0)
unitarget--
unitargethex = unitarget
switch(unitarget)
@@ -682,15 +682,15 @@
unitarget = 15
unitargethex = "F"
dopage(src,"screen=unimenu")
- if (href_list["uimenuset"] && href_list["uimenusubset"]) // This chunk of code updates selected block / sub-block based on click
+ if(href_list["uimenuset"] && href_list["uimenusubset"]) // This chunk of code updates selected block / sub-block based on click
var/menuset = text2num(href_list["uimenuset"])
var/menusubset = text2num(href_list["uimenusubset"])
- if ((menuset <= 13) && (menuset >= 1))
+ if((menuset <= 13) && (menuset >= 1))
ui_block = menuset
- if ((menusubset <= 3) && (menusubset >= 1))
+ if((menusubset <= 3) && (menusubset >= 1))
subblock = menusubset
dopage(src, "unimenu")
- if (href_list["unipulse"])
+ if(href_list["unipulse"])
if(scanner.occupant)
var/block
var/newblock
@@ -703,22 +703,22 @@
var/lock_state = scanner.locked
scanner.locked = 1//lock it
sleep(10*radduration)
- if (!scanner.occupant)
+ if(!scanner.occupant)
temp_html = null
return null
///
- if (prob((80 + (radduration / 2))))
+ if(prob((80 + (radduration / 2))))
block = miniscrambletarget(num2text(unitarget), radstrength, radduration)
newblock = null
- if (subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),2,1) + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),3,1)
- if (subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),3,1)
- if (subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),1,1) + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),2,1) + block
+ if(subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),2,1) + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),3,1)
+ if(subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),3,1)
+ if(subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),1,1) + getblock(getblock(scanner.occupant.dna.uni_identity,ui_block,3),2,1) + block
tstructure2 = setblock(scanner.occupant.dna.uni_identity, ui_block, newblock,3)
scanner.occupant.dna.uni_identity = tstructure2
updateappearance(scanner.occupant,scanner.occupant.dna.uni_identity)
scanner.occupant.apply_effect(radstrength+radduration, IRRADIATE)
else
- if (prob(20+radstrength))
+ if(prob(20+radstrength))
randmutb(scanner.occupant)
domutcheck(scanner.occupant,scanner)
else
@@ -729,61 +729,61 @@
dopage(src,"screen=unimenu")
////////////////////////////////////////////////////////
- if (href_list["rejuv"])
+ if(href_list["rejuv"])
if(!viable_occupant)
temp_html = text("No viable occupant detected.")
popup.set_content(temp_html)
popup.open()
else
if(human_occupant)
- if (human_occupant.reagents.get_reagent_amount("inaprovaline") < REJUVENATORS_MAX)
- if (human_occupant.reagents.get_reagent_amount("inaprovaline") < (REJUVENATORS_MAX - REJUVENATORS_INJECT))
+ if(human_occupant.reagents.get_reagent_amount("inaprovaline") < REJUVENATORS_MAX)
+ if(human_occupant.reagents.get_reagent_amount("inaprovaline") < (REJUVENATORS_MAX - REJUVENATORS_INJECT))
human_occupant.reagents.add_reagent("inaprovaline", REJUVENATORS_INJECT)
else
human_occupant.reagents.add_reagent("inaprovaline", round(REJUVENATORS_MAX - human_occupant.reagents.get_reagent_amount("inaprovaline")))
// to_chat(usr, text("Occupant now has [] units of rejuvenation in his/her bloodstream.", human_occupant.reagents.get_reagent_amount("inaprovaline")))
////////////////////////////////////////////////////////
- if (href_list["strucmenuplus"])
- if (se_block < 14)
+ if(href_list["strucmenuplus"])
+ if(se_block < 14)
se_block++
else
se_block = 1
dopage(src,"screen=strucmenu")
- if (href_list["strucmenuminus"])
- if (se_block > 1)
+ if(href_list["strucmenuminus"])
+ if(se_block > 1)
se_block--
else
se_block = 14
dopage(src,"screen=strucmenu")
- if (href_list["strucmenusubplus"])
- if (subblock < 3)
+ if(href_list["strucmenusubplus"])
+ if(subblock < 3)
subblock++
else
subblock = 1
dopage(src,"screen=strucmenu")
- if (href_list["strucmenusubminus"])
- if (subblock > 1)
+ if(href_list["strucmenusubminus"])
+ if(subblock > 1)
subblock--
else
subblock = 3
dopage(src,"screen=strucmenu")
- if (href_list["semenuset"] && href_list["semenusubset"]) // This chunk of code updates selected block / sub-block based on click (se stands for strutural enzymes)
+ if(href_list["semenuset"] && href_list["semenusubset"]) // This chunk of code updates selected block / sub-block based on click (se stands for strutural enzymes)
var/menuset = text2num(href_list["semenuset"])
var/menusubset = text2num(href_list["semenusubset"])
- if ((menuset <= 14) && (menuset >= 1))
+ if((menuset <= 14) && (menuset >= 1))
se_block = menuset
- if ((menusubset <= 3) && (menusubset >= 1))
+ if((menusubset <= 3) && (menusubset >= 1))
subblock = menusubset
dopage(src, "strucmenu")
- if (href_list["strucpulse"])
+ if(href_list["strucpulse"])
var/block
var/newblock
var/tstructure2
var/oldblock
var/lock_state = scanner.locked
scanner.locked = 1//lock it
- if (viable_occupant)
+ if(viable_occupant)
block = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),subblock,1)
temp_html = text("Working ... Please wait ([] Seconds)", radduration)
@@ -795,18 +795,18 @@
return null
///
if(viable_occupant)
- if (prob((80 + (radduration / 2))))
- if ((se_block != 2 || se_block != 12 || se_block != 8 || se_block || 10) && prob (20))
+ if(prob((80 + (radduration / 2))))
+ if((se_block != 2 || se_block != 12 || se_block != 8 || se_block || 10) && prob (20))
oldblock = se_block
block = miniscramble(block, radstrength, radduration)
newblock = null
- if (se_block > 1 && se_block < 5)
+ if(se_block > 1 && se_block < 5)
se_block++
- else if (se_block > 5 && se_block < 14)
+ else if(se_block > 5 && se_block < 14)
se_block--
- if (subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
- if (subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
- if (subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + block
+ if(subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
+ if(subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
+ if(subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + block
tstructure2 = setblock(scanner.occupant.dna.struc_enzymes, se_block, newblock,3)
scanner.occupant.dna.struc_enzymes = tstructure2
domutcheck(scanner.occupant,scanner)
@@ -816,15 +816,15 @@
//
block = miniscramble(block, radstrength, radduration)
newblock = null
- if (subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
- if (subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
- if (subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + block
+ if(subblock == 1) newblock = block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
+ if(subblock == 2) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + block + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),3,1)
+ if(subblock == 3) newblock = getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),1,1) + getblock(getblock(scanner.occupant.dna.struc_enzymes,se_block,3),2,1) + block
tstructure2 = setblock(scanner.occupant.dna.struc_enzymes, se_block, newblock,3)
scanner.occupant.dna.struc_enzymes = tstructure2
domutcheck(scanner.occupant,scanner)
scanner.occupant.apply_effect(radstrength+radduration, IRRADIATE)
else
- if (prob(80-radduration))
+ if(prob(80-radduration))
randmutb(scanner.occupant)
domutcheck(scanner.occupant,scanner)
else
@@ -836,21 +836,21 @@
dopage(src,"screen=strucmenu")
////////////////////////////////////////////////////////
- if (href_list["b1addui"])
+ if(href_list["b1addui"])
if(scanner.occupant && scanner.occupant.dna)
buffer1iue = 0
buffer1 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer1owner = scanner.occupant.name
else
buffer1owner = scanner.occupant.real_name
buffer1label = "Unique Identifier"
buffer1type = "ui"
dopage(src,"screen=buffermenu")
- if (href_list["b1adduiue"])
+ if(href_list["b1adduiue"])
if(scanner.occupant && scanner.occupant.dna)
buffer1 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer1owner = scanner.occupant.name
else
buffer1owner = scanner.occupant.real_name
@@ -858,10 +858,10 @@
buffer1type = "ui"
buffer1iue = 1
dopage(src,"screen=buffermenu")
- if (href_list["b2adduiue"])
+ if(href_list["b2adduiue"])
if(scanner.occupant && scanner.occupant.dna)
buffer2 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer2owner = scanner.occupant.name
else
buffer2owner = scanner.occupant.real_name
@@ -869,10 +869,10 @@
buffer2type = "ui"
buffer2iue = 1
dopage(src,"screen=buffermenu")
- if (href_list["b3adduiue"])
+ if(href_list["b3adduiue"])
if(scanner.occupant && scanner.occupant.dna)
buffer3 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer3owner = scanner.occupant.name
else
buffer3owner = scanner.occupant.real_name
@@ -880,141 +880,141 @@
buffer3type = "ui"
buffer3iue = 1
dopage(src,"screen=buffermenu")
- if (href_list["b2addui"])
+ if(href_list["b2addui"])
if(scanner.occupant && scanner.occupant.dna)
buffer2iue = 0
buffer2 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer2owner = scanner.occupant.name
else
buffer2owner = scanner.occupant.real_name
buffer2label = "Unique Identifier"
buffer2type = "ui"
dopage(src,"screen=buffermenu")
- if (href_list["b3addui"])
+ if(href_list["b3addui"])
if(scanner.occupant && scanner.occupant.dna)
buffer3iue = 0
buffer3 = scanner.occupant.dna.uni_identity
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer3owner = scanner.occupant.name
else
buffer3owner = scanner.occupant.real_name
buffer3label = "Unique Identifier"
buffer3type = "ui"
dopage(src,"screen=buffermenu")
- if (href_list["b1addse"])
+ if(href_list["b1addse"])
if(scanner.occupant && scanner.occupant.dna)
buffer1iue = 0
buffer1 = scanner.occupant.dna.struc_enzymes
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer1owner = scanner.occupant.name
else
buffer1owner = scanner.occupant.real_name
buffer1label = "Structural Enzymes"
buffer1type = "se"
dopage(src,"screen=buffermenu")
- if (href_list["b2addse"])
+ if(href_list["b2addse"])
if(scanner.occupant && scanner.occupant.dna)
buffer2iue = 0
buffer2 = scanner.occupant.dna.struc_enzymes
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer2owner = scanner.occupant.name
else
buffer2owner = scanner.occupant.real_name
buffer2label = "Structural Enzymes"
buffer2type = "se"
dopage(src,"screen=buffermenu")
- if (href_list["b3addse"])
+ if(href_list["b3addse"])
if(scanner.occupant && scanner.occupant.dna)
buffer3iue = 0
buffer3 = scanner.occupant.dna.struc_enzymes
- if (!istype(scanner.occupant,/mob/living/carbon/human))
+ if(!istype(scanner.occupant,/mob/living/carbon/human))
buffer3owner = scanner.occupant.name
else
buffer3owner = scanner.occupant.real_name
buffer3label = "Structural Enzymes"
buffer3type = "se"
dopage(src,"screen=buffermenu")
- if (href_list["b1clear"])
+ if(href_list["b1clear"])
buffer1 = null
buffer1owner = null
buffer1label = null
buffer1iue = null
dopage(src,"screen=buffermenu")
- if (href_list["b2clear"])
+ if(href_list["b2clear"])
buffer2 = null
buffer2owner = null
buffer2label = null
buffer2iue = null
dopage(src,"screen=buffermenu")
- if (href_list["b3clear"])
+ if(href_list["b3clear"])
buffer3 = null
buffer3owner = null
buffer3label = null
buffer3iue = null
dopage(src,"screen=buffermenu")
- if (href_list["b1label"])
+ if(href_list["b1label"])
buffer1label = sanitize(input("New Label:","Edit Label","Infos here"))
dopage(src,"screen=buffermenu")
- if (href_list["b2label"])
+ if(href_list["b2label"])
buffer2label = sanitize(input("New Label:","Edit Label","Infos here"))
dopage(src,"screen=buffermenu")
- if (href_list["b3label"])
+ if(href_list["b3label"])
buffer3label = sanitize(input("New Label:","Edit Label","Infos here"))
dopage(src,"screen=buffermenu")
- if (href_list["b1transfer"])
- if (!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
+ if(href_list["b1transfer"])
+ if(!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
return
- if (buffer1type == "ui")
- if (buffer1iue)
+ if(buffer1type == "ui")
+ if(buffer1iue)
scanner.occupant.real_name = buffer1owner
scanner.occupant.name = buffer1owner
scanner.occupant.dna.uni_identity = buffer1
updateappearance(scanner.occupant,scanner.occupant.dna.uni_identity)
- else if (buffer1type == "se")
+ else if(buffer1type == "se")
scanner.occupant.dna.struc_enzymes = buffer1
domutcheck(scanner.occupant,scanner)
temp_html = "Transfered."
scanner.occupant.apply_effect(rand(20,50), IRRADIATE)
- if (href_list["b2transfer"])
- if (!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
+ if(href_list["b2transfer"])
+ if(!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
return
- if (buffer2type == "ui")
- if (buffer2iue)
+ if(buffer2type == "ui")
+ if(buffer2iue)
scanner.occupant.real_name = buffer2owner
scanner.occupant.name = buffer2owner
scanner.occupant.dna.uni_identity = buffer2
updateappearance(scanner.occupant,scanner.occupant.dna.uni_identity)
- else if (buffer2type == "se")
+ else if(buffer2type == "se")
scanner.occupant.dna.struc_enzymes = buffer2
domutcheck(scanner.occupant,scanner)
temp_html = "Transfered."
scanner.occupant.apply_effect(rand(20,50), IRRADIATE)
- if (href_list["b3transfer"])
- if (!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
+ if(href_list["b3transfer"])
+ if(!scanner.occupant || (NOCLONE in scanner.occupant.mutations) || !scanner.occupant.dna)
return
- if (buffer3type == "ui")
- if (buffer3iue)
+ if(buffer3type == "ui")
+ if(buffer3iue)
scanner.occupant.real_name = buffer3owner
scanner.occupant.name = buffer3owner
scanner.occupant.dna.uni_identity = buffer3
updateappearance(scanner.occupant,scanner.occupant.dna.uni_identity)
- else if (buffer3type == "se")
+ else if(buffer3type == "se")
scanner.occupant.dna.struc_enzymes = buffer3
domutcheck(scanner.occupant,scanner)
temp_html = "Transfered."
scanner.occupant.apply_effect(rand(20,50), IRRADIATE)
- if (href_list["b1injector"])
- if (injectorready)
+ if(href_list["b1injector"])
+ if(injectorready)
var/obj/item/tool/medical/dnainjector/I = new /obj/item/tool/medical/dnainjector
I.dna = buffer1
I.dnatype = buffer1type
I.loc = loc
I.name += " ([buffer1label])"
- if (buffer1iue) I.ue = buffer1owner //lazy haw haw
+ if(buffer1iue) I.ue = buffer1owner //lazy haw haw
temp_html = "Injector created."
injectorready = 0
@@ -1023,14 +1023,14 @@
else
temp_html = "Replicator not ready yet."
- if (href_list["b2injector"])
- if (injectorready)
+ if(href_list["b2injector"])
+ if(injectorready)
var/obj/item/tool/medical/dnainjector/I = new /obj/item/tool/medical/dnainjector
I.dna = buffer2
I.dnatype = buffer2type
I.loc = loc
I.name += " ([buffer2label])"
- if (buffer2iue) I.ue = buffer2owner //lazy haw haw
+ if(buffer2iue) I.ue = buffer2owner //lazy haw haw
temp_html = "Injector created."
injectorready = 0
@@ -1039,14 +1039,14 @@
else
temp_html = "Replicator not ready yet."
- if (href_list["b3injector"])
- if (injectorready)
+ if(href_list["b3injector"])
+ if(injectorready)
var/obj/item/tool/medical/dnainjector/I = new /obj/item/tool/medical/dnainjector
I.dna = buffer3
I.dnatype = buffer3type
I.loc = loc
I.name += " ([buffer3label])"
- if (buffer3iue) I.ue = buffer3owner //lazy haw haw
+ if(buffer3iue) I.ue = buffer3owner //lazy haw haw
temp_html = "Injector created."
injectorready = 0
@@ -1056,11 +1056,11 @@
temp_html = "Replicator not ready yet."
////////////////////////////////////////////////////////
- if (href_list["load_disk"])
+ if(href_list["load_disk"])
var/buffernum = text2num(href_list["load_disk"])
- if ((buffernum > 3) || (buffernum < 1))
+ if((buffernum > 3) || (buffernum < 1))
return
- if ((isnull(diskette)) || (!diskette.data) || (diskette.data == ""))
+ if((isnull(diskette)) || (!diskette.data) || (diskette.data == ""))
return
switch(buffernum)
if(1)
@@ -1080,11 +1080,11 @@
buffer3owner = diskette.owner
temp_html = "Data loaded."
- if (href_list["save_disk"])
+ if(href_list["save_disk"])
var/buffernum = text2num(href_list["save_disk"])
- if ((buffernum > 3) || (buffernum < 1))
+ if((buffernum > 3) || (buffernum < 1))
return
- if ((isnull(diskette)) || (diskette.read_only))
+ if((isnull(diskette)) || (diskette.read_only))
return
switch(buffernum)
if(1)
@@ -1106,8 +1106,8 @@
diskette.owner = buffer3owner
diskette.name = "data disk - '[buffer3owner]'"
temp_html = "Data saved."
- if (href_list["eject_disk"])
- if (!diskette)
+ if(href_list["eject_disk"])
+ if(!diskette)
return
diskette.loc = get_turf(src)
diskette = null
@@ -1115,9 +1115,9 @@
temp_html = temp_header_html
switch(current_screen)
- if ("mainmenu")
+ if("mainmenu")
temp_html += "
Main Menu
"
- if (viable_occupant) //is there REALLY someone in there who can be modified?
+ if(viable_occupant) //is there REALLY someone in there who can be modified?
temp_html += text("Modify Unique Identifier ", src)
temp_html += text("Modify Structural Enzymes
"
@@ -538,7 +534,7 @@ What a mess.*/
if("rank")
var/list/L = list( "Head of Personnel", "Captain", "AI" )
//This was so silly before the change. Now it actually works without beating your head against the keyboard. /N
- if ((istype(active1, /datum/data/record) && L.Find(rank)))
+ if((istype(active1, /datum/data/record) && L.Find(rank)))
temp = "
Rank:
"
temp += "
"
for(var/rank in joblist)
@@ -547,9 +543,9 @@ What a mess.*/
else
alert(usr, "You do not have the required rank to do this!")
if("species")
- if (istype(active1, /datum/data/record))
+ if(istype(active1, /datum/data/record))
var/t1 = sanitize(copytext(input("Please enter race:", "General records", active1.fields["species"], null) as message,1,MAX_MESSAGE_LEN))
- if ((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
+ if((!( t1 ) || !( authenticated ) || usr.stat || usr.restrained() || (!interactable() && (!istype(usr, /mob/living/silicon))) || active1 != a1))
return
active1.fields["species"] = t1
@@ -557,14 +553,14 @@ What a mess.*/
else//To properly clear as per clear screen.
temp=null
switch(href_list["choice"])
- if ("Change Rank")
- if (active1)
+ if("Change Rank")
+ if(active1)
active1.fields["rank"] = href_list["rank"]
if(href_list["rank"] in joblist)
active1.fields["real_rank"] = href_list["real_rank"]
- if ("Change Criminal Status")
- if (active2)
+ if("Change Criminal Status")
+ if(active2)
switch(href_list["criminal2"])
if("none")
@@ -580,18 +576,18 @@ What a mess.*/
for(var/mob/living/carbon/human/H in mob_list)
H.sec_hud_set_security_status()
- if ("Delete Record (Security) Execute")
- if (active2)
+ if("Delete Record (Security) Execute")
+ if(active2)
qdel(active2)
- if ("Delete Record (ALL) Execute")
- if (active1)
+ if("Delete Record (ALL) Execute")
+ if(active1)
for(var/datum/data/record/R in data_core.medical)
- if ((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
+ if((R.fields["name"] == active1.fields["name"] || R.fields["id"] == active1.fields["id"]))
qdel(R)
else
qdel(active1)
- if (active2)
+ if(active2)
qdel(active2)
else
temp = "This function does not appear to be working at the moment. Our apologies."
diff --git a/code/modules/computer3/computers/shuttle.dm b/code/modules/computer3/computers/shuttle.dm
index 236de564868..70bdb133137 100644
--- a/code/modules/computer3/computers/shuttle.dm
+++ b/code/modules/computer3/computers/shuttle.dm
@@ -13,12 +13,12 @@
attackby(var/obj/item/card/W as obj, var/mob/user as mob, params)
if(stat & (BROKEN|NOPOWER)) return
- if ((!( istype(W, /obj/item/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return
- if (istype(W, /obj/item/card/id)||istype(W, /obj/item/device/pda))
- if (istype(W, /obj/item/device/pda))
+ if((!( istype(W, /obj/item/card) ) || !( ticker ) || emergency_shuttle.location != 1 || !( user ))) return
+ if(istype(W, /obj/item/card/id)||istype(W, /obj/item/device/pda))
+ if(istype(W, /obj/item/device/pda))
var/obj/item/device/pda/pda = W
W = pda.id
- if (!W:access) //no access
+ if(!W:access) //no access
to_chat(user, "The access level of [W:registered_name]\'s card is not high enough. ")
return
@@ -38,7 +38,7 @@
if("Authorize")
src.authorized -= W:registered_name
src.authorized += W:registered_name
- if (src.auth_need - src.authorized.len > 0)
+ if(src.auth_need - src.authorized.len > 0)
message_admins("[key_name_admin(user)] has authorized early shuttle launch")
log_game("[user.ckey] has authorized early shuttle launch")
to_chat(world, text("\blue Alert: [] authorizations needed until shuttle is launched early", src.auth_need - src.authorized.len))
@@ -63,7 +63,7 @@
return
emag_act(user as mob)
- if (!emagged)
+ if(!emagged)
var/choice = alert(user, "Would you like to launch the shuttle?","Shuttle control", "Launch", "Cancel")
if(!emagged && emergency_shuttle.location == 1)
diff --git a/code/modules/computer3/computers/specops_shuttle.dm b/code/modules/computer3/computers/specops_shuttle.dm
index 8281a30479f..fa64036857d 100644
--- a/code/modules/computer3/computers/specops_shuttle.dm
+++ b/code/modules/computer3/computers/specops_shuttle.dm
@@ -55,9 +55,9 @@ var/specops_shuttle_timeleft = 0
specops_shuttle_moving_to_centcom = 0
specops_shuttle_at_station = 1
- if (specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
+ if(specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
- if (!specops_can_move())
+ if(!specops_can_move())
to_chat(usr, "\red The Special Operations shuttle is unable to leave.")
return
@@ -179,7 +179,7 @@ var/specops_shuttle_timeleft = 0
to_chat(user, "\red Access Denied.")
return
- if (sent_strike_team == 0)
+ if(sent_strike_team == 0)
to_chat(usr, "\red The strike team has not yet deployed.")
return
@@ -188,7 +188,7 @@ var/specops_shuttle_timeleft = 0
user.set_machine(src)
var/dat
- if (temp)
+ if(temp)
dat = temp
else
dat += {"
@@ -208,19 +208,19 @@ var/specops_shuttle_timeleft = 0
if(..())
return
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
+ if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
- if (href_list["sendtodock"])
+ if(href_list["sendtodock"])
if(!specops_shuttle_at_station|| specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
to_chat(usr, "\blue Central Command will not allow the Special Operations shuttle to return.")
return
- else if (href_list["sendtostation"])
+ else if(href_list["sendtostation"])
if(specops_shuttle_at_station || specops_shuttle_moving_to_station || specops_shuttle_moving_to_centcom) return
- if (!specops_can_move())
+ if(!specops_can_move())
to_chat(usr, "\red The Special Operations shuttle is unable to leave.")
return
@@ -238,7 +238,7 @@ var/specops_shuttle_timeleft = 0
spawn(0)
specops_process()
- else if (href_list["mainmenu"])
+ else if(href_list["mainmenu"])
temp = null
add_fingerprint(usr)
diff --git a/code/modules/computer3/computers/station_alert.dm b/code/modules/computer3/computers/station_alert.dm
index 850bfc83c5b..f026f36a8bb 100644
--- a/code/modules/computer3/computers/station_alert.dm
+++ b/code/modules/computer3/computers/station_alert.dm
@@ -16,18 +16,18 @@
return
var/dat = "Current Station Alerts\n"
dat += "Close
"
- for (var/cat in src.alarms)
+ for(var/cat in src.alarms)
dat += text("[] \n", cat)
var/list/L = src.alarms[cat]
- if (L.len)
- for (var/alarm in L)
+ if(L.len)
+ for(var/alarm in L)
var/list/alm = L[alarm]
var/area/A = alm[1]
var/list/sources = alm[3]
dat += ""
dat += "• "
dat += "[A.name]"
- if (sources.len > 1)
+ if(sources.len > 1)
dat += text(" - [] sources", sources.len)
dat += " \n"
else
@@ -49,20 +49,20 @@
proc/triggerAlarm(var/class, area/A, var/O, var/alarmsource)
var/list/L = src.alarms[class]
- for (var/I in L)
- if (I == A.name)
+ for(var/I in L)
+ if(I == A.name)
var/list/alarm = L[I]
var/list/sources = alarm[3]
- if (!(alarmsource in sources))
+ if(!(alarmsource in sources))
sources += alarmsource
return 1
var/obj/machinery/camera/C = null
var/list/CL = null
- if (O && istype(O, /list))
+ if(O && istype(O, /list))
CL = O
- if (CL.len == 1)
+ if(CL.len == 1)
C = CL[1]
- else if (O && istype(O, /obj/machinery/camera))
+ else if(O && istype(O, /obj/machinery/camera))
C = O
L[A.name] = list(A, (C) ? C : O, list(alarmsource))
return 1
@@ -71,13 +71,13 @@
proc/cancelAlarm(var/class, area/A as area, obj/origin)
var/list/L = src.alarms[class]
var/cleared = 0
- for (var/I in L)
- if (I == A.name)
+ for(var/I in L)
+ if(I == A.name)
var/list/alarm = L[I]
var/list/srcs = alarm[3]
- if (origin in srcs)
+ if(origin in srcs)
srcs -= origin
- if (srcs.len == 0)
+ if(srcs.len == 0)
cleared = 1
L -= I
return !cleared
@@ -86,7 +86,7 @@
process()
var/active_alarms = 0
- for (var/cat in src.alarms)
+ for(var/cat in src.alarms)
var/list/L = src.alarms[cat]
if(L.len) active_alarms = 1
if(active_alarms)
diff --git a/code/modules/computer3/computers/syndicate_specops_shuttle.dm b/code/modules/computer3/computers/syndicate_specops_shuttle.dm
index f490cd3c822..c9a61b2dfad 100644
--- a/code/modules/computer3/computers/syndicate_specops_shuttle.dm
+++ b/code/modules/computer3/computers/syndicate_specops_shuttle.dm
@@ -55,9 +55,9 @@ var/syndicate_elite_shuttle_timeleft = 0
syndicate_elite_shuttle_moving_to_mothership = 0
syndicate_elite_shuttle_at_station = 1
- if (syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
+ if(syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
- if (!syndicate_elite_can_move())
+ if(!syndicate_elite_can_move())
to_chat(usr, "\red The Syndicate Elite shuttle is unable to leave.")
return
@@ -192,7 +192,7 @@ var/syndicate_elite_shuttle_timeleft = 0
to_chat(user, "\red Access Denied.")
return
-// if (sent_syndicate_strike_team == 0)
+// if(sent_syndicate_strike_team == 0)
// to_chat(usr, "\red The strike team has not yet deployed.")
// return
@@ -201,7 +201,7 @@ var/syndicate_elite_shuttle_timeleft = 0
user.set_machine(src)
var/dat
- if (temp)
+ if(temp)
dat = temp
else
dat = {"Location: [syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership ? "Departing for [station_name] in ([syndicate_elite_shuttle_timeleft] seconds.)":syndicate_elite_shuttle_at_station ? "Station":"Dock"]
@@ -220,19 +220,19 @@ var/syndicate_elite_shuttle_timeleft = 0
if(..())
return
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
+ if((usr.contents.Find(src) || (in_range(src, usr) && istype(loc, /turf))) || (istype(usr, /mob/living/silicon)))
usr.set_machine(src)
- if (href_list["sendtodock"])
+ if(href_list["sendtodock"])
if(!syndicate_elite_shuttle_at_station|| syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
to_chat(usr, "\blue The Syndicate will not allow the Elite Squad shuttle to return.")
return
- else if (href_list["sendtostation"])
+ else if(href_list["sendtostation"])
if(syndicate_elite_shuttle_at_station || syndicate_elite_shuttle_moving_to_station || syndicate_elite_shuttle_moving_to_mothership) return
- if (!specops_can_move())
+ if(!specops_can_move())
to_chat(usr, "\red The Syndicate Elite shuttle is unable to leave.")
return
@@ -251,7 +251,7 @@ var/syndicate_elite_shuttle_timeleft = 0
syndicate_elite_process()
- else if (href_list["mainmenu"])
+ else if(href_list["mainmenu"])
temp = null
add_fingerprint(usr)
diff --git a/code/modules/computer3/laptop.dm b/code/modules/computer3/laptop.dm
index dd4f73914b6..e32375a457c 100644
--- a/code/modules/computer3/laptop.dm
+++ b/code/modules/computer3/laptop.dm
@@ -101,14 +101,15 @@
var/obj/item/weapon/card/id/card
if(C.reader)
card = C.reader
+ C.remove_reader(usr)
else if(C.writer)
card = C.writer
+ C.remove_writer(usr)
else
to_chat(usr, "There is nothing to remove from the laptop card port.")
return
to_chat(usr, "You remove [card] from the laptop.")
- C.remove(card)
/obj/machinery/computer3/laptop
diff --git a/code/modules/computer3/lapvend.dm b/code/modules/computer3/lapvend.dm
index 3834efd635a..ee436ee3cc0 100644
--- a/code/modules/computer3/lapvend.dm
+++ b/code/modules/computer3/lapvend.dm
@@ -29,7 +29,7 @@
/obj/machinery/lapvend/blob_act()
- if (prob(50))
+ if(prob(50))
spawn(0)
qdel(src)
return
@@ -82,7 +82,7 @@
dat += "Total: [total()] "
if(cardreader == 1)
dat += "Card Reader: (single) (50) "
- else if (cardreader == 2)
+ else if(cardreader == 2)
dat += "Card Reader: (double) (125) "
else
dat += "Card Reader: None "
@@ -106,9 +106,9 @@
dat += "Network card: Powernet (25) "
else
dat += "Network card: None "
- if (power == 0)
+ if(power == 0)
dat += "Power source: Regular "
- else if (power == 1)
+ else if(power == 1)
dat += "Power source: Extended (175) "
else
dat += "Power source: Unreal (250) "
@@ -133,41 +133,41 @@
/obj/machinery/lapvend/Topic(href, href_list)
- if ((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
+ if((usr.contents.Find(src) || (in_range(src, usr) && istype(src.loc, /turf))))
usr.set_machine(src)
switch(href_list["choice"])
if("single_add")
cardreader = 1
- if ("dual_add")
+ if("dual_add")
cardreader = 2
- if ("floppy_add")
+ if("floppy_add")
floppy = 1
- if ("radio_add")
+ if("radio_add")
radionet = 1
- if ("camnet_add")
+ if("camnet_add")
camera = 1
- if ("area_add")
+ if("area_add")
network = 1
- if ("prox_add")
+ if("prox_add")
network = 2
- if ("cable_add")
+ if("cable_add")
network = 3
- if ("high_add")
+ if("high_add")
power = 1
- if ("super_add")
+ if("super_add")
power = 2
- if ("single_rem" || "dual_rem")
+ if("single_rem" || "dual_rem")
cardreader = 0
- if ("floppy_rem")
+ if("floppy_rem")
floppy = 0
- if ("radio_rem")
+ if("radio_rem")
radionet = 0
- if ("camnet_rem")
+ if("camnet_rem")
camera = 0
- if ("area_rem" || "prox_rem" || "cable_rem")
+ if("area_rem" || "prox_rem" || "cable_rem")
network = 0
- if ("high_rem" || "super_rem")
+ if("high_rem" || "super_rem")
power = 0
if("vend")
@@ -194,23 +194,23 @@
newlap.spawn_parts += (/obj/item/part/computer/networking/radio)
if(camera == 1)
newlap.spawn_parts += (/obj/item/part/computer/networking/cameras)
- if (network == 1)
+ if(network == 1)
newlap.spawn_parts += (/obj/item/part/computer/networking/area)
- if (network == 2)
+ if(network == 2)
newlap.spawn_parts += (/obj/item/part/computer/networking/prox)
- if (network == 3)
+ if(network == 3)
newlap.spawn_parts += (/obj/item/part/computer/networking/cable)
- if (power == 1)
+ if(power == 1)
qdel(newlap.battery)
newlap.battery = new /obj/item/weapon/stock_parts/cell/high(newlap)
- if (power == 2)
+ if(power == 2)
qdel(newlap.battery)
newlap.battery = new /obj/item/weapon/stock_parts/cell/super(newlap)
newlap.spawn_parts()
/obj/machinery/lapvend/proc/scan_card(var/obj/item/weapon/card/I)
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
if(vendor_account)
@@ -312,7 +312,7 @@
newlap.spawn_files += (/datum/file/program/communications)
if((access_medical in C.access) || (access_forensics_lockers in C.access)) //Gives detective the medical records program, but not the crew monitoring one.
newlap.spawn_files += (/datum/file/program/med_data)
- if (access_medical in C.access)
+ if(access_medical in C.access)
newlap.spawn_files += (/datum/file/program/crew)
if(access_engine in C.access)
newlap.spawn_files += (/datum/file/program/powermon)
@@ -359,7 +359,7 @@
/obj/machinery/lapvend/proc/reimburse(var/obj/item/weapon/card/I)
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
if(vendor_account)
diff --git a/code/modules/crafting/craft.dm b/code/modules/crafting/craft.dm
new file mode 100644
index 00000000000..d2b0da70ebe
--- /dev/null
+++ b/code/modules/crafting/craft.dm
@@ -0,0 +1,339 @@
+/datum/personal_crafting
+ var/busy
+ var/viewing_category = 1 //typical powergamer starting on the Weapons tab
+ var/list/categories = list(CAT_WEAPON,CAT_AMMO,CAT_ROBOT,CAT_FOOD,CAT_MISC,CAT_PRIMAL)
+
+
+
+
+
+/* This is what procs do:
+ get_environment - gets a list of things accessable for crafting by user
+ get_surroundings - takes a list of things and makes a list of key-types to values-amounts of said type in the list
+ check_contents - takes a recipe and a key-type list and checks if said recipe can be done with available stuff
+ check_tools - takes recipe, a key-type list, and a user and checks if there are enough tools to do the stuff, checks bugs one level deep
+ construct_item - takes a recipe and a user, call all the checking procs, calls do_after, checks all the things again, calls del_reqs, creates result, calls CheckParts of said result with argument being list returned by deel_reqs
+ del_reqs - takes recipe and a user, loops over the recipes reqs var and tries to find everything in the list make by get_environment and delete it/add to parts list, then returns the said list
+*/
+
+
+
+
+/datum/personal_crafting/proc/check_contents(datum/crafting_recipe/R, list/contents)
+ main_loop:
+ for(var/A in R.reqs)
+ var/needed_amount = R.reqs[A]
+ for(var/B in contents)
+ if(ispath(B, A))
+ if(contents[B] >= R.reqs[A])
+ continue main_loop
+ else
+ needed_amount -= contents[B]
+ if(needed_amount <= 0)
+ continue main_loop
+ else
+ continue
+ return 0
+ for(var/A in R.chem_catalists)
+ if(contents[A] < R.chem_catalists[A])
+ return 0
+ return 1
+
+/datum/personal_crafting/proc/get_environment(mob/user)
+ . = list()
+ . += user.r_hand
+ . += user.l_hand
+ if(!isturf(user.loc))
+ return
+ var/list/L = block(get_step(user, SOUTHWEST), get_step(user, NORTHEAST))
+ for(var/A in L)
+ var/turf/T = A
+ if(T.Adjacent(user))
+ . += T.contents
+
+
+/datum/personal_crafting/proc/get_surroundings(mob/user)
+ . = list()
+ for(var/obj/item/I in get_environment(user))
+ if(istype(I, /obj/item/stack))
+ var/obj/item/stack/S = I
+ .[I.type] += S.amount
+ else
+ if(istype(I, /obj/item/weapon/reagent_containers))
+ var/obj/item/weapon/reagent_containers/RC = I
+ if(RC.flags & OPENCONTAINER)
+ for(var/datum/reagent/A in RC.reagents.reagent_list)
+ .[A.type] += A.volume
+ .[I.type] += 1
+
+/datum/personal_crafting/proc/check_tools(mob/user, datum/crafting_recipe/R, list/contents)
+ if(!R.tools.len)
+ return 1
+ var/list/possible_tools = list()
+ for(var/obj/item/I in user.contents)
+ if(istype(I, /obj/item/weapon/storage))
+ for(var/obj/item/SI in I.contents)
+ possible_tools += SI.type
+ possible_tools += I.type
+ possible_tools += contents
+
+ main_loop:
+ for(var/A in R.tools)
+ for(var/I in possible_tools)
+ if(ispath(I,A))
+ continue main_loop
+ return 0
+ return 1
+
+/datum/personal_crafting/proc/construct_item(mob/user, datum/crafting_recipe/R)
+ for(var/A in R.parts)
+ var/list/contents = get_surroundings(user)
+ var/send_feedback = 1
+ if(check_contents(R, contents))
+ if(check_tools(user, R, contents))
+ if(do_after(user, R.time, target = user))
+ contents = get_surroundings(user)
+ if(!check_contents(R, contents))
+ return ", missing component."
+ if(!check_tools(user, R, contents))
+ return ", missing tool."
+ var/list/parts = del_reqs(R, user)
+ var/atom/movable/I = new R.result (get_turf(user.loc))
+ I.CheckParts(parts, R)
+ if(send_feedback)
+ feedback_add_details("object_crafted","[I.type]")
+ return 0
+ return "."
+ return ", missing tool."
+ return ", missing component."
+
+
+/*Del reqs works like this:
+ Loop over reqs var of the recipe
+ Set var amt to the value current cycle req is pointing to, its amount of type we need to delete
+ Get var/surroundings list of things accessable to crafting by get_environment()
+ Check the type of the current cycle req
+ If its reagent then do a while loop, inside it try to locate() reagent containers, inside such containers try to locate needed reagent, if there isnt remove thing from surroundings
+ If there is enough reagent in the search result then delete the needed amount, create the same type of reagent with the same data var and put it into deletion list
+ If there isnt enough take all of that reagent from the container, put into deletion list, substract the amt var by the volume of reagent, remove the container from surroundings list and keep searching
+ While doing above stuff check deletion list if it already has such reagnet, if yes merge instead of adding second one
+ If its stack check if it has enough amount
+ If yes create new stack with the needed amount and put in into deletion list, substract taken amount from the stack
+ If no put all of the stack in the deletion list, substract its amount from amt and keep searching
+ While doing above stuff check deletion list if it already has such stack type, if yes try to merge them instead of adding new one
+ If its anything else just locate() in in the list in a while loop, each find --s the amt var and puts the found stuff in deletion loop
+ Then do a loop over parts var of the recipe
+ Do similar stuff to what we have done above, but now in deletion list, until the parts conditions are satisfied keep taking from the deletion list and putting it into parts list for return
+ After its done loop over deletion list and delete all the shit that wasnt taken by parts loop
+ del_reqs return the list of parts resulting object will recieve as argument of CheckParts proc, on the atom level it will add them all to the contents, on all other levels it calls ..() and does whatever is needed afterwards but from contents list already
+*/
+
+/datum/personal_crafting/proc/del_reqs(datum/crafting_recipe/R, mob/user)
+ var/list/surroundings
+ var/list/Deletion = list()
+ . = list()
+ var/data
+ var/amt
+ main_loop:
+ for(var/A in R.reqs)
+ amt = R.reqs[A]
+ surroundings = get_environment(user)
+ surroundings -= Deletion
+ if(ispath(A, /datum/reagent))
+ var/datum/reagent/RG = new A
+ var/datum/reagent/RGNT
+ while(amt > 0)
+ var/obj/item/weapon/reagent_containers/RC = locate() in surroundings
+ RG = RC.reagents.get_reagent(A)
+ if(RG)
+ if(!locate(RG.type) in Deletion)
+ Deletion += new RG.type()
+ if(RG.volume > amt)
+ RG.volume -= amt
+ data = RG.data
+ RC.reagents.conditional_update(RC)
+ RG = locate(RG.type) in Deletion
+ RG.volume = amt
+ RG.data += data
+ continue main_loop
+ else
+ surroundings -= RC
+ amt -= RG.volume
+ RC.reagents.reagent_list -= RG
+ RC.reagents.conditional_update(RC)
+ RGNT = locate(RG.type) in Deletion
+ RGNT.volume += RG.volume
+ RGNT.data += RG.data
+ qdel(RG)
+ else
+ surroundings -= RC
+ else if(ispath(A, /obj/item/stack))
+ var/obj/item/stack/S
+ var/obj/item/stack/SD
+ while(amt > 0)
+ S = locate(A) in surroundings
+ if(S.amount >= amt)
+ if(!locate(S.type) in Deletion)
+ SD = new S.type()
+ Deletion += SD
+ S.use(amt)
+ SD = locate(S.type) in Deletion
+ SD.amount += amt
+ continue main_loop
+ else
+ amt -= S.amount
+ if(!locate(S.type) in Deletion)
+ Deletion += S
+ else
+ data = S.amount
+ S = locate(S.type) in Deletion
+ S.amount += data
+ surroundings -= S
+ else
+ var/atom/movable/I
+ while(amt > 0)
+ I = locate(A) in surroundings
+ Deletion += I
+ surroundings -= I
+ amt--
+ var/list/partlist = list(R.parts.len)
+ for(var/M in R.parts)
+ partlist[M] = R.parts[M]
+ for(var/A in R.parts)
+ if(istype(A, /datum/reagent))
+ var/datum/reagent/RG = locate(A) in Deletion
+ if(RG.volume > partlist[A])
+ RG.volume = partlist[A]
+ . += RG
+ Deletion -= RG
+ continue
+ else if(istype(A, /obj/item/stack))
+ var/obj/item/stack/ST = locate(A) in Deletion
+ if(ST.amount > partlist[A])
+ ST.amount = partlist[A]
+ . += ST
+ Deletion -= ST
+ continue
+ else
+ while(partlist[A] > 0)
+ var/atom/movable/AM = locate(A) in Deletion
+ . += AM
+ Deletion -= AM
+ partlist[A] -= 1
+ while(Deletion.len)
+ var/DL = Deletion[Deletion.len]
+ Deletion.Cut(Deletion.len)
+ qdel(DL)
+
+/datum/personal_crafting/proc/craft(mob/user)
+ if(user.incapacitated() || user.lying || istype(user.loc, /obj/mecha))
+ return
+ var/list/surroundings = get_surroundings(user)
+ var/dat = "
Crafting menu
"
+ if(busy)
+ dat += "
Crafting in progress...
"
+ else
+ dat += "<--"
+ dat += " [categories[prev_cat()]] |"
+ dat += " [categories[viewing_category]] "
+ dat += "| [categories[next_cat()]] "
+ dat += "-->
"
+
+ dat += "
"
+
+ //Filter the recipes we can craft to the top
+ var/list/can_craft = list()
+ var/list/cant_craft = list()
+ for(var/datum/crafting_recipe/R in crafting_recipes)
+ if(R.category != categories[viewing_category])
+ continue
+ if(check_contents(R, surroundings))
+ can_craft += R
+ else
+ cant_craft += R
+
+ for(var/datum/crafting_recipe/R in can_craft)
+ dat += build_recipe_text(R, surroundings)
+ for(var/datum/crafting_recipe/R in cant_craft)
+ dat += build_recipe_text(R, surroundings)
+
+
+ dat += "
"
+
+ var/datum/browser/popup = new(user, "crafting", "Crafting", 500, 500)
+ popup.set_content(dat)
+ popup.open()
+ return
+
+/datum/personal_crafting/Topic(href, href_list)
+ if(usr.stat || usr.lying)
+ return
+ if(href_list["make"])
+ var/datum/crafting_recipe/TR = locate(href_list["make"])
+ busy = 1
+ craft(usr)
+ var/fail_msg = construct_item(usr, TR)
+ if(!fail_msg)
+ usr << "[TR.name] constructed."
+ else
+ usr << "Construction failed[fail_msg]"
+ busy = 0
+ craft(usr)
+ if(href_list["forwardCat"])
+ viewing_category = next_cat()
+ usr << "Category is now [categories[viewing_category]]."
+ craft(usr)
+ if(href_list["backwardCat"])
+ viewing_category = prev_cat()
+ usr << "Category is now [categories[viewing_category]]."
+ craft(usr)
+
+//Next works nicely with modular arithmetic
+/datum/personal_crafting/proc/next_cat()
+ . = viewing_category % categories.len + 1
+
+//Previous can go fuck itself
+/datum/personal_crafting/proc/prev_cat()
+ if(viewing_category == categories.len)
+ . = viewing_category-1
+ else
+ . = viewing_category % categories.len - 1
+ if(. <= 0)
+ . = categories.len
+
+/datum/personal_crafting/proc/build_recipe_text(datum/crafting_recipe/R, list/contents)
+ . = ""
+ var/name_text = ""
+ var/req_text = ""
+ var/tool_text = ""
+ var/catalist_text = ""
+ if(check_contents(R, contents))
+ name_text ="[R.name]"
+
+ else
+ name_text = "[R.name]"
+
+ if(name_text)
+ for(var/A in R.reqs)
+ if(ispath(A, /obj))
+ var/obj/O = A
+ req_text += " [R.reqs[A]] [initial(O.name)]"
+ else if(ispath(A, /datum/reagent))
+ var/datum/reagent/RE = A
+ req_text += " [R.reqs[A]] [initial(RE.name)]"
+
+ if(R.chem_catalists.len)
+ catalist_text += ", Catalysts:"
+ for(var/C in R.chem_catalists)
+ if(ispath(C, /datum/reagent))
+ var/datum/reagent/RE = C
+ catalist_text += " [R.chem_catalists[C]] [initial(RE.name)]"
+
+ if(R.tools.len)
+ tool_text += ", Tools:"
+ for(var/O in R.tools)
+ if(ispath(O, /obj))
+ var/obj/T = O
+ tool_text += " [R.tools[O]] [initial(T.name)]"
+
+ . = "[name_text][req_text][tool_text][catalist_text] "
diff --git a/code/modules/crafting/guncrafting.dm b/code/modules/crafting/guncrafting.dm
index 8a9d5803529..a7309803c1b 100644
--- a/code/modules/crafting/guncrafting.dm
+++ b/code/modules/crafting/guncrafting.dm
@@ -71,7 +71,7 @@
..()
if(istype(I, /obj/item/stack/packageWrap))
var/obj/item/stack/packageWrap/C = I
- if (C.use(5))
+ if(C.use(5))
var/obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised/W = new /obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised
user.unEquip(src)
user.put_in_hands(W)
diff --git a/code/modules/crafting/recipes.dm b/code/modules/crafting/recipes.dm
index d8586b6c0d8..6f946146aa4 100644
--- a/code/modules/crafting/recipes.dm
+++ b/code/modules/crafting/recipes.dm
@@ -1,4 +1,4 @@
-/datum/table_recipe
+/datum/crafting_recipe
var/name = "" //in-game display name
var/reqs[] = list() //type paths of items consumed associated with how many are needed
var/result //type path of item resulting from this craft
@@ -7,14 +7,15 @@
var/parts[] = list() //type paths of items that will be placed in the result
var/chem_catalists[] = list() //like tools but for reagents
var/fruit[] = list() //grown products required by the recipe
+ var/category = CAT_MISC // Recipe category
-/datum/table_recipe/proc/AdjustChems(var/obj/resultobj as obj)
+/datum/crafting_recipe/proc/AdjustChems(var/obj/resultobj as obj)
//This proc is to replace the make_food proc of recipes from microwaves and such that are being converted to table crafting recipes.
//Use it to handle the removal of reagents after the food has been created (like removing toxins from a salad made with ambrosia)
//If a recipe does not require it's chems adjusted, don't bother declaring this for the recipe, as it will call this placeholder
return
-/datum/table_recipe/IED
+/datum/crafting_recipe/IED
name = "IED"
result = /obj/item/weapon/grenade/iedcasing/filled
reqs = list(/datum/reagent/fuel = 50,
@@ -22,19 +23,47 @@
/obj/item/device/assembly/igniter = 1,
/obj/item/weapon/reagent_containers/food/drinks/cans = 1)
parts = list(/obj/item/weapon/reagent_containers/food/drinks/cans = 1)
- time = 80
+ time = 15
+ category = CAT_WEAPON
-/datum/table_recipe/stunprod
+/datum/crafting_recipe/lance
+ name = "explosive lance (grenade)"
+ result = /obj/item/weapon/twohanded/spear
+ reqs = list(/obj/item/weapon/twohanded/spear = 1,
+ /obj/item/weapon/grenade = 1)
+ parts = list(/obj/item/weapon/grenade = 1)
+ time = 15
+ category = CAT_WEAPON
+
+/datum/crafting_recipe/molotov
+ name = "Molotov"
+ result = /obj/item/weapon/reagent_containers/food/drinks/bottle/molotov
+ reqs = list(/obj/item/weapon/reagent_containers/glass/rag = 1,
+ /obj/item/weapon/reagent_containers/food/drinks/bottle = 1)
+ parts = list(/obj/item/weapon/reagent_containers/food/drinks/bottle = 1)
+ time = 40
+ category = CAT_WEAPON
+
+/datum/crafting_recipe/stunprod
name = "Stunprod"
result = /obj/item/weapon/melee/baton/cattleprod
reqs = list(/obj/item/weapon/restraints/handcuffs/cable = 1,
/obj/item/stack/rods = 1,
/obj/item/weapon/wirecutters = 1,
/obj/item/weapon/stock_parts/cell = 1)
- time = 80
+ time = 40
parts = list(/obj/item/weapon/stock_parts/cell = 1)
+ category = CAT_WEAPON
-/datum/table_recipe/ed209
+/datum/crafting_recipe/bola
+ name = "Bola"
+ result = /obj/item/weapon/restraints/legcuffs/bola
+ reqs = list(/obj/item/weapon/restraints/handcuffs/cable = 1,
+ /obj/item/stack/sheet/metal = 6)
+ time = 20//15 faster than crafting them by hand!
+ category= CAT_WEAPON
+
+/datum/crafting_recipe/ed209
name = "ED209"
result = /mob/living/simple_animal/bot/ed209
reqs = list(/obj/item/robot_parts/robot_suit = 1,
@@ -49,9 +78,10 @@
/obj/item/device/assembly/prox_sensor = 1,
/obj/item/robot_parts/r_arm = 1)
tools = list(/obj/item/weapon/weldingtool, /obj/item/weapon/screwdriver)
- time = 120
+ time = 60
+ category = CAT_ROBOT
-/datum/table_recipe/secbot
+/datum/crafting_recipe/secbot
name = "Secbot"
result = /mob/living/simple_animal/bot/secbot
reqs = list(/obj/item/device/assembly/signaler = 1,
@@ -60,44 +90,51 @@
/obj/item/device/assembly/prox_sensor = 1,
/obj/item/robot_parts/r_arm = 1)
tools = list(/obj/item/weapon/weldingtool)
- time = 120
+ time = 60
+ category = CAT_ROBOT
-/datum/table_recipe/cleanbot
+/datum/crafting_recipe/cleanbot
name = "Cleanbot"
result = /mob/living/simple_animal/bot/cleanbot
reqs = list(/obj/item/weapon/reagent_containers/glass/bucket = 1,
/obj/item/device/assembly/prox_sensor = 1,
/obj/item/robot_parts/r_arm = 1)
- time = 80
+ time = 40
+ category = CAT_ROBOT
-/datum/table_recipe/floorbot
+/datum/crafting_recipe/floorbot
name = "Floorbot"
result = /mob/living/simple_animal/bot/floorbot
reqs = list(/obj/item/weapon/storage/toolbox/mechanical = 1,
/obj/item/stack/tile/plasteel = 1,
/obj/item/device/assembly/prox_sensor = 1,
/obj/item/robot_parts/r_arm = 1)
- time = 80
+ time = 40
+ category = CAT_ROBOT
-/datum/table_recipe/medbot
+/datum/crafting_recipe/medbot
name = "Medbot"
result = /mob/living/simple_animal/bot/medbot
reqs = list(/obj/item/device/healthanalyzer = 1,
/obj/item/weapon/storage/firstaid = 1,
/obj/item/device/assembly/prox_sensor = 1,
/obj/item/robot_parts/r_arm = 1)
- time = 80
+ time = 40
+ category = CAT_ROBOT
-/datum/table_recipe/flamethrower
+/datum/crafting_recipe/flamethrower
name = "Flamethrower"
result = /obj/item/weapon/flamethrower
reqs = list(/obj/item/weapon/weldingtool = 1,
/obj/item/device/assembly/igniter = 1,
- /obj/item/stack/rods = 2)
+ /obj/item/stack/rods = 1)
+ parts = list(/obj/item/device/assembly/igniter = 1,
+ /obj/item/weapon/weldingtool = 1)
tools = list(/obj/item/weapon/screwdriver)
- time = 20
+ time = 10
+ category = CAT_WEAPON
-/datum/table_recipe/meteorshot
+/datum/crafting_recipe/meteorshot
name = "Meteorshot Shell"
result = /obj/item/ammo_casing/shotgun/meteorshot
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
@@ -105,8 +142,9 @@
/obj/item/weapon/stock_parts/manipulator = 2)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/pulseslug
+/datum/crafting_recipe/pulseslug
name = "Pulse Slug Shell"
result = /obj/item/ammo_casing/shotgun/pulseslug
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
@@ -114,16 +152,18 @@
/obj/item/weapon/stock_parts/micro_laser/ultra = 1)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/dragonsbreath
+/datum/crafting_recipe/dragonsbreath
name = "Dragonsbreath Shell"
result = /obj/item/ammo_casing/shotgun/incendiary/dragonsbreath
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
/datum/reagent/phosphorus = 5,)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/frag12
+/datum/crafting_recipe/frag12
name = "FRAG-12 Shell"
result = /obj/item/ammo_casing/shotgun/frag12
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
@@ -132,8 +172,9 @@
/datum/reagent/facid = 5,)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/ionslug
+/datum/crafting_recipe/ionslug
name = "Ion Scatter Shell"
result = /obj/item/ammo_casing/shotgun/ion
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
@@ -141,8 +182,9 @@
/obj/item/weapon/stock_parts/subspace/crystal = 1)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/improvisedslug
+/datum/crafting_recipe/improvisedslug
name = "Improvised Shotgun Shell"
result = /obj/item/ammo_casing/shotgun/improvised
reqs = list(/obj/item/weapon/grenade/chem_grenade = 1,
@@ -151,16 +193,19 @@
/datum/reagent/fuel = 10)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/improvisedslugoverload
+/datum/crafting_recipe/improvisedslugoverload
name = "Overload Improvised Shell"
result = /obj/item/ammo_casing/shotgun/improvised/overload
reqs = list(/obj/item/ammo_casing/shotgun/improvised = 1,
- /datum/reagent/blackpowder = 5)
+ /datum/reagent/blackpowder = 10,
+ /datum/reagent/plasma_dust = 20)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/laserslug
+/datum/crafting_recipe/laserslug
name = "Laser Slug Shell"
result = /obj/item/ammo_casing/shotgun/laserslug
reqs = list(/obj/item/ammo_casing/shotgun/techshell = 1,
@@ -168,8 +213,9 @@
/obj/item/weapon/stock_parts/micro_laser/high = 1)
tools = list(/obj/item/weapon/screwdriver)
time = 5
+ category = CAT_AMMO
-/datum/table_recipe/ishotgun
+/datum/crafting_recipe/ishotgun
name = "Improvised Shotgun"
result = /obj/item/weapon/gun/projectile/revolver/doublebarrel/improvised
reqs = list(/obj/item/weaponcrafting/receiver = 1,
@@ -177,9 +223,29 @@
/obj/item/weaponcrafting/stock = 1,
/obj/item/stack/packageWrap = 5,)
tools = list(/obj/item/weapon/screwdriver)
- time = 200
+ time = 100
+ category = CAT_WEAPON
-/datum/table_recipe/spooky_camera
+/datum/crafting_recipe/chainsaw
+ name = "Chainsaw"
+ result = /obj/item/weapon/twohanded/required/chainsaw
+ reqs = list(/obj/item/weapon/circular_saw = 1,
+ /obj/item/stack/cable_coil = 1,
+ /obj/item/stack/sheet/plasteel = 1)
+ tools = list(/obj/item/weapon/weldingtool)
+ time = 50
+ category = CAT_WEAPON
+
+/datum/crafting_recipe/spear
+ name = "Spear"
+ result = /obj/item/weapon/twohanded/spear
+ reqs = list(/obj/item/weapon/restraints/handcuffs/cable = 1,
+ /obj/item/weapon/shard = 1,
+ /obj/item/stack/rods = 1)
+ time = 40
+ category = CAT_WEAPON
+
+/datum/crafting_recipe/spooky_camera
name = "Camera Obscura"
result = /obj/item/device/camera/spooky
time = 15
@@ -187,42 +253,60 @@
/datum/reagent/holywater = 10)
parts = list(/obj/item/device/camera = 1)
-/datum/table_recipe/notreallysoap
+/datum/crafting_recipe/papersack
+ name = "Paper Sack"
+ result = /obj/item/weapon/storage/box/papersack
+ time = 10
+ reqs = list(/obj/item/weapon/paper = 5)
+ category = CAT_MISC
+
+/datum/crafting_recipe/notreallysoap
name = "Homemade Soap"
result = /obj/item/weapon/soap/ducttape
- time = 100
+ time = 50
reqs = list(/obj/item/stack/tape_roll = 1,
/datum/reagent/liquidgibs = 10)
-/datum/table_recipe/garrote
+/datum/crafting_recipe/garrote
name = "Makeshift Garrote"
result = /obj/item/weapon/twohanded/garrote/improvised
time = 15
reqs = list(/obj/item/stack/sheet/wood = 1,
/obj/item/stack/cable_coil = 5)
tools = list(/obj/item/weapon/kitchen/knife) // Gotta carve the wood into handles
+ category = CAT_WEAPON
-/datum/table_recipe/makeshift_bolt
+/datum/crafting_recipe/makeshift_bolt
name = "Makeshift Bolt"
result = /obj/item/weapon/arrow/rod
- time = 15
+ time = 5
reqs = list(/obj/item/stack/rods = 1)
tools = list(/obj/item/weapon/weldingtool)
+ category = CAT_AMMO
-/datum/table_recipe/crossbow
+/datum/crafting_recipe/crossbow
name = "Powered Crossbow"
result = /obj/item/weapon/gun/throw/crossbow
- time = 300
+ time = 150
reqs = list(/obj/item/stack/rods = 3,
/obj/item/stack/cable_coil = 10,
/obj/item/stack/sheet/mineral/plastic = 3,
/obj/item/stack/sheet/wood = 5)
tools = list(/obj/item/weapon/weldingtool,
/obj/item/weapon/screwdriver)
+ category = CAT_WEAPON
-/datum/table_recipe/glove_balloon
+/datum/crafting_recipe/glove_balloon
name = "Latex Glove Balloon"
result = /obj/item/latexballon
time = 15
reqs = list(/obj/item/clothing/gloves/color/latex = 1,
- /obj/item/stack/cable_coil = 5)
\ No newline at end of file
+ /obj/item/stack/cable_coil = 5)
+
+/datum/crafting_recipe/gold_horn
+ name = "Golden bike horn"
+ result = /obj/item/weapon/bikehorn/golden
+ time = 20
+ reqs = list(/obj/item/stack/sheet/mineral/bananium = 5,
+ /obj/item/weapon/bikehorn)
+ category = CAT_MISC
\ No newline at end of file
diff --git a/code/modules/crafting/table.dm b/code/modules/crafting/table.dm
deleted file mode 100644
index 19ea37c3866..00000000000
--- a/code/modules/crafting/table.dm
+++ /dev/null
@@ -1,225 +0,0 @@
-#define TABLECRAFT_MAX_ITEMS 30
-
-/obj/structure/table
- var/list/table_contents = list()
-
-/obj/structure/table/MouseDrop(atom/over)
- if(over != usr)
- return
- interact(usr)
-
-/obj/structure/table/proc/check_contents(datum/table_recipe/R)
- check_table()
- main_loop:
- if(R.fruit)
- for(var/A in R.fruit)
- for(var/B in table_contents)
- if(B == A)
- if(table_contents[B] >= R.fruit[A])
- continue main_loop
- return 0
- for(var/A in R.reqs)
- for(var/B in table_contents)
- if(ispath(B, A))
- if(table_contents[B] >= R.reqs[A])
- continue main_loop
- return 0
- for(var/A in R.chem_catalists)
- if(table_contents[A] < R.chem_catalists[A])
- return 0
- return 1
-
-/obj/structure/table/proc/check_table()
- table_contents = list()
- for(var/obj/item/I in loc)
- if(istype(I, /obj/item/stack))
- var/obj/item/stack/S = I
- table_contents[I.type] += S.amount
- else if(istype(I, /obj/item/weapon/reagent_containers/food/snacks/grown))
- var/obj/item/weapon/reagent_containers/food/snacks/grown/G = I
- if(G.seed && G.seed.kitchen_tag)
- table_contents[G.seed.kitchen_tag] += 1
- else
- if(istype(I, /obj/item/weapon/reagent_containers))
- var/obj/item/weapon/reagent_containers/RC = I
- if(RC.flags & OPENCONTAINER)
- for(var/datum/reagent/A in RC.reagents.reagent_list)
- table_contents[A.type] += A.volume
- table_contents[I.type] += 1
-
-/obj/structure/table/proc/check_tools(mob/user, datum/table_recipe/R)
- if(!R.tools.len)
- return 1
- var/list/possible_tools = list()
- for(var/obj/item/I in user.contents)
- if(istype(I, /obj/item/weapon/storage))
- for(var/obj/item/SI in I.contents)
- possible_tools += SI.type
- else
- possible_tools += I.type
- possible_tools += table_contents
- var/i = R.tools.len
- var/I
- for(var/A in R.tools)
- I = possible_tools.Find(A)
- if(I)
- possible_tools.Cut(I, I+1)
- i--
- else
- break
- return !i
-
-/obj/structure/table/proc/construct_item(mob/user, datum/table_recipe/R)
- check_table()
- if(check_contents(R) && check_tools(user, R))
- if(do_after(user, R.time, target = src))
- if(!check_contents(R) || !check_tools(user, R))
- return 0
- var/atom/movable/I = new R.result (loc)
- var/list/parts = del_reqs(R, I)
- for(var/A in parts)
- if(istype(A, /obj/item))
- var/atom/movable/B = A
- B.loc = I
- else
- if(!I.reagents)
- I.reagents = new /datum/reagents()
- I.reagents.reagent_list.Add(A)
- I.CheckParts()
- R.AdjustChems(I)
- return 1
- return 0
-
-/obj/structure/table/proc/del_reqs(datum/table_recipe/R, atom/movable/resultobject)
- var/list/Deletion = list()
- var/amt
- var/reagenttransfer = 0
- if(istype(resultobject,/obj/item/weapon/reagent_containers))
- reagenttransfer = 1
- if(R.fruit)
- for(var/A in R.fruit)
- amt = R.fruit[A]
- fruit_loop: //ha
- for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in loc)
- if(G.seed && G.seed.kitchen_tag && (G.seed.kitchen_tag == A))
- amt--
- G.loc = null //remove it from the table loc so that we don't locate the same fruit every time
- if(reagenttransfer)
- G.reagents.trans_to(resultobject, G.reagents.total_volume)
- qdel(G)
- if(amt <= 0)
- break fruit_loop
- for(var/A in R.reqs)
- amt = R.reqs[A]
- if(ispath(A, /obj/item/stack))
- var/obj/item/stack/S
- stack_loop:
- for(var/B in table_contents)
- if(ispath(B, A))
- while(amt > 0)
- S = locate(B) in loc
- if(S.amount >= amt)
- S.use(amt)
- break stack_loop
- else
- amt -= S.amount
- qdel(S)
- else if(ispath(A, /obj/item))
- var/obj/item/I
- item_loop:
- for(var/B in table_contents)
- if(ispath(B, A))
- while(amt > 0)
- I = locate(B) in loc
- Deletion.Add(I)
- I.loc = null //remove it from the table loc so that we don't locate the same item every time (will be relocated inside the crafted item in construct_item())
- amt--
- if(reagenttransfer && istype(I,/obj/item/weapon/reagent_containers))
- var/obj/item/weapon/reagent_containers/RC = I
- RC.reagents.trans_to(resultobject, RC.reagents.total_volume)
- break item_loop
- else
- var/datum/reagent/RG = new A
- reagent_loop:
- for(var/B in table_contents)
- if(ispath(B, /obj/item/weapon/reagent_containers))
- var/obj/item/RC = locate(B) in loc
- if(RC.reagents.has_reagent(RG.id, amt))
- if(reagenttransfer)
- RC.reagents.trans_id_to(resultobject,RG.id, amt)
- else
- RC.reagents.remove_reagent(RG.id, amt)
- RG.volume = amt
- Deletion.Add(RG)
- break reagent_loop
- else if(RC.reagents.has_reagent(RG.id))
- Deletion.Add(RG)
- RG.volume += RC.reagents.get_reagent_amount(RG.id)
- amt -= RC.reagents.get_reagent_amount(RG.id)
- if(reagenttransfer)
- RC.reagents.trans_id_to(resultobject,RG.id, RG.volume)
- else
- RC.reagents.del_reagent(RG.id)
-
- var/list/partlist = list(R.parts.len)
- for(var/M in R.parts)
- partlist[M] = R.parts[M]
- deletion_loop:
- for(var/B in Deletion)
- for(var/A in R.parts)
- if(istype(B, A))
- if(partlist[A] > 0) //do we still need a part like that?
- partlist[A] -= 1
- continue deletion_loop
- Deletion.Remove(B)
- qdel(B)
-
- return Deletion
-
-/obj/structure/table/interact(mob/user)
- if(user.stat || user.lying || !Adjacent(user))
- return
- check_table()
- if(!table_contents.len)
- return
- user.face_atom(src)
- var/dat = "
Crafting menu
"
- dat += "
"
- if(busy)
- dat += "Crafting in progress...
"
- else
- for(var/datum/table_recipe/R in table_recipes)
- if(check_contents(R))
- dat += "[R.name] "
- dat += ""
-
- var/datum/browser/popup = new(user, "table", "Table", 300, 300)
- popup.set_content(dat)
- popup.open()
- return
-
-/obj/structure/table/Topic(href, href_list)
- if(usr.stat || !Adjacent(usr) || usr.lying)
- return
- if(href_list["make"])
- if(!check_table_space())
- to_chat(usr, "The table is too crowded.")
- return
- var/datum/table_recipe/TR = locate(href_list["make"])
- busy = 1
- interact(usr)
- if(construct_item(usr, TR))
- to_chat(usr, "[TR.name] constructed.")
- else
- to_chat(usr, "Construction failed.")
- busy = 0
- interact(usr)
-
-/obj/structure/table/proc/check_table_space()
- var/Item_amount = 0
- for(var/obj/item/I in loc)
- Item_amount++
- if(Item_amount <= TABLECRAFT_MAX_ITEMS) //is the table crowded?
- return 1
-
- #undef TABLECRAFT_MAX_ITEMS
\ No newline at end of file
diff --git a/code/modules/customitems/item_defines.dm b/code/modules/customitems/item_defines.dm
index fd4864b7900..c7b9b3abdb6 100644
--- a/code/modules/customitems/item_defines.dm
+++ b/code/modules/customitems/item_defines.dm
@@ -10,6 +10,9 @@
////////// Usable Items //////////
//////////////////////////////////
+/obj/item/device/fluff
+ var/used = 0
+
/obj/item/device/fluff/tattoo_gun // Generic tattoo gun, make subtypes for different folks
name = "dispoable tattoo pen"
desc = "A cheap plastic tattoo application pen."
@@ -17,8 +20,7 @@
icon_state = "tatgun"
force = 0
throwforce = 0
- w_class = 1.0
- var/used = 0
+ w_class = 1
var/tattoo_name = "tiger stripe tattoo" // Tat name for visible messages
var/tattoo_icon = "Tiger Body" // body_accessory.dmi, new icons defined in sprite_accessories.dm
var/tattoo_r = 1 // RGB values for the body markings
@@ -84,6 +86,28 @@
..()
update_icon()
+/obj/item/device/fluff/tattoo_gun/elliot_cybernetic_tat
+ desc = "A cheap plastic tattoo application pen. This one seems heavily used."
+ tattoo_name = "circuitry tattoo"
+ tattoo_icon = "Elliot Circuit Tattoo"
+ tattoo_r = 48
+ tattoo_g = 138
+ tattoo_b = 176
+
+/obj/item/device/fluff/tattoo_gun/elliot_cybernetic_tat/attack_self(mob/user as mob)
+ if(!used)
+ var/ink_color = input("Please select an ink color.", "Tattoo Ink Color", rgb(tattoo_r, tattoo_g, tattoo_b)) as color|null
+ if(ink_color && !(user.incapacitated() || used) )
+ tattoo_r = hex2num(copytext(ink_color, 2, 4))
+ tattoo_g = hex2num(copytext(ink_color, 4, 6))
+ tattoo_b = hex2num(copytext(ink_color, 6, 8))
+
+ to_chat(user, "You change the color setting on the [src].")
+
+ update_icon()
+
+ else
+ to_chat(user, "The [src] is out of ink!")
/obj/item/weapon/claymore/fluff // MrBarrelrolll: Maximus Greenwood
name = "Greenwood's Blade"
@@ -92,7 +116,7 @@
sharp = 0
edge = 0
-/obj/item/weapon/claymore/fluff/IsShield()
+/obj/item/weapon/claymore/fluff/hit_reaction()
return 0
/obj/item/weapon/crowbar/fluff/zelda_creedy_1 // Zomgponies: Griffin Rowley
@@ -171,6 +195,82 @@
icon_state = "jello_guitar"
item_state = "jello_guitar"
+/obj/item/fluff/wingler_comb
+ name = "blue comb"
+ desc = "A blue comb, it looks like it was made to groom a Tajaran's fur."
+ icon = 'icons/obj/custom_items.dmi'
+ icon_state = "wingler_comb"
+ attack_verb = list("combed")
+ hitsound = 'sound/weapons/tap.ogg'
+ force = 0
+ throwforce = 0
+ w_class = 2
+ var/used = 0
+
+/obj/item/fluff/wingler_comb/attack_self(mob/user)
+ if(used)
+ return
+
+ var/mob/living/carbon/human/target = user
+ if(!istype(target) || target.get_species() != "Tajaran") // Only catbeasts, kthnx.
+ return
+
+ if(target.change_body_accessory("Jay Wingler Tail"))
+ to_chat(target, "You comb your tail with the [src].")
+ used = 1
+
+#define USED_MOD_HELM 1
+#define USED_MOD_SUIT 2
+
+/obj/item/device/fluff/shadey_plasman_modkit
+ name = "plasmaman suit modkit"
+ desc = "A kit containing nanites that are able to modify the look of a plasmaman suit and helmet without exposing the wearer to hostile environments."
+ icon_state = "modkit"
+ w_class = 2
+ force = 0
+ throwforce = 0
+
+/obj/item/device/fluff/shadey_plasman_modkit/afterattack(atom/target, mob/user, proximity)
+ if(!proximity || !ishuman(user) || user.lying)
+ return
+ var/mob/living/carbon/human/H = user
+
+ if(istype(target, /obj/item/clothing/head/helmet/space/eva/plasmaman))
+ if(used & USED_MOD_HELM)
+ to_chat(H, "The kit's helmet modifier has already been used.")
+ return
+ to_chat(H, "You modify the appearance of [target].")
+ used |= USED_MOD_HELM
+
+ var/obj/item/clothing/head/helmet/space/eva/plasmaman/P = target
+ P.name = "plasma containment helmet"
+ P.desc = "A purpose-built containment helmet designed to keep plasma in, and everything else out."
+ P.icon_state = "plasmaman_halo_helmet[P.on]"
+ P.base_state = "plasmaman_halo_helmet"
+
+ if(P == H.head)
+ H.update_inv_head()
+ return
+ if(istype(target, /obj/item/clothing/suit/space/eva/plasmaman))
+ if(used & USED_MOD_SUIT)
+ to_chat(user, "The kit's suit modifier has already been used.")
+ return
+ to_chat(H, "You modify the appearance of [target].")
+ used |= USED_MOD_SUIT
+
+ var/obj/item/clothing/suit/space/eva/plasmaman/P = target
+ P.name = "plasma containment suit"
+ P.desc = "A feminine containment suit designed to keep plasma in, and everything else out. It's even got an overskirt."
+ P.icon_state = "plasmaman_halo"
+
+ if(P == H.wear_suit)
+ H.update_inv_wear_suit()
+ return
+ to_chat(user, "You can't modify [target]!")
+
+#undef USED_MOD_HELM
+#undef USED_MOD_SUIT
+
//////////////////////////////////
//////////// Clothing ////////////
//////////////////////////////////
@@ -222,7 +322,7 @@
icon_state = "kidosvest"
item_state = "kidosvest"
ignore_suitadjust = 1
- action_button_name = null
+ actions_types = list()
adjust_flavour = null
species_fit = null
sprite_sheets = null
@@ -337,7 +437,7 @@
icon_state = "fox_jacket"
item_state = "fox_jacket"
ignore_suitadjust = 1
- action_button_name = null
+ actions_types = list()
adjust_flavour = null
species_fit = null
sprite_sheets = null
@@ -389,28 +489,27 @@
icon_state = "chronx_hood"
item_state = "chronx_hood"
flags = HEADCOVERSEYES | BLOCKHAIR
- action_button_name = "Transform Hood"
+ actions_types = list(/datum/action/item_action/toggle)
var/adjusted = 0
/obj/item/clothing/head/fluff/chronx/ui_action_click()
adjust()
-/obj/item/clothing/head/fluff/chronx/verb/adjust()
- set name = "Transform Hood"
- set category = "Object"
- set src in usr
- if(isliving(usr) && !usr.incapacitated())
- if(adjusted)
- icon_state = initial(icon_state)
- item_state = initial(item_state)
- to_chat(usr, "You untransform \the [src].")
- adjusted = 0
- else
- icon_state += "_open"
- item_state += "_open"
- to_chat(usr, "You transform \the [src].")
- adjusted = 1
- usr.update_inv_head()
+/obj/item/clothing/head/fluff/chronx/proc/adjust()
+ if(adjusted)
+ icon_state = initial(icon_state)
+ item_state = initial(item_state)
+ to_chat(usr, "You untransform \the [src].")
+ adjusted = 0
+ else
+ icon_state += "_open"
+ item_state += "_open"
+ to_chat(usr, "You transform \the [src].")
+ adjusted = 1
+ usr.update_inv_head()
+ for(var/X in actions)
+ var/datum/action/A = X
+ A.UpdateButtonIcon()
/obj/item/clothing/suit/chaplain_hoodie/fluff/chronx //chronx100: Hughe O'Splash
name = "Cthulhu's Robes"
@@ -419,22 +518,10 @@
icon_state = "chronx_robe"
item_state = "chronx_robe"
flags_size = ONESIZEFITSALL
- action_button_name = "Transform Robes"
+ actions_types = list(/datum/action/item_action/toggle)
adjust_flavour = "untransform"
ignore_suitadjust = 0
-/obj/item/clothing/suit/chaplain_hoodie/fluff/chronx/New()
- ..()
- verbs -= /obj/item/clothing/suit/verb/openjacket
-
-/obj/item/clothing/suit/chaplain_hoodie/fluff/chronx/verb/adjust()
- set name = "Transform Robes"
- set category = "Object"
- set src in usr
- if(!istype(usr, /mob/living))
- return
- adjustsuit(usr)
-
/obj/item/clothing/shoes/black/fluff/chronx //chronx100: Hughe O'Splash
name = "Cthulhu's Boots"
desc = "Boots worn by the worshipers of Cthulhu. You see a name inscribed in blood on the inside: Hughe O'Splash"
@@ -467,26 +554,3 @@
suit_adjusted = 1
species_fit = null
sprite_sheets = null
-
-/obj/item/device/fluff/tattoo_gun/elliot_cybernetic_tat
- desc = "A cheap plastic tattoo application pen. This one seems heavily used."
- tattoo_name = "circuitry tattoo"
- tattoo_icon = "Elliot Circuit Tattoo"
- tattoo_r = 48
- tattoo_g = 138
- tattoo_b = 176
-
-/obj/item/device/fluff/tattoo_gun/elliot_cybernetic_tat/attack_self(mob/user as mob)
- if(!used)
- var/ink_color = input("Please select an ink color.", "Tattoo Ink Color", rgb(tattoo_r, tattoo_g, tattoo_b)) as color|null
- if(ink_color && !(user.incapacitated() || used) )
- tattoo_r = hex2num(copytext(ink_color, 2, 4))
- tattoo_g = hex2num(copytext(ink_color, 4, 6))
- tattoo_b = hex2num(copytext(ink_color, 6, 8))
-
- to_chat(user, "You change the color setting on the [src].")
-
- update_icon()
-
- else
- to_chat(user, "The [src] is out of ink!")
\ No newline at end of file
diff --git a/code/modules/customitems/item_spawning.dm b/code/modules/customitems/item_spawning.dm
index d0b350b9b1e..345bf6e164e 100644
--- a/code/modules/customitems/item_spawning.dm
+++ b/code/modules/customitems/item_spawning.dm
@@ -48,7 +48,7 @@
to_chat(M, "Your [Item.name] has been added to your [M.back.name].")
if(ok == 0)
for(var/obj/item/weapon/storage/S in M.contents) // Try to place it in any item that can store stuff, on the mob.
- if (S.contents.len < S.storage_slots)
+ if(S.contents.len < S.storage_slots)
Item.loc = S
ok = 1
to_chat(M, "Your [Item.name] has been added to your [S.name].")
@@ -58,7 +58,7 @@
if(newname)
Item.name = newname
- if (ok == 0) // Finally, since everything else failed, place it on the ground
+ if(ok == 0) // Finally, since everything else failed, place it on the ground
Item.loc = get_turf(M.loc)
HackProperties(Item,propadjust)
diff --git a/code/modules/detective_work/evidence.dm b/code/modules/detective_work/evidence.dm
index 4654e0ab665..6f62a7eecac 100644
--- a/code/modules/detective_work/evidence.dm
+++ b/code/modules/detective_work/evidence.dm
@@ -21,6 +21,10 @@
if(!istype(I) || I.anchored == 1)
return
+ if(istype(I, /obj/item/weapon/storage/box))
+ to_chat(user, "This box is too big to fit in the evidence bag.")
+ return
+
if(istype(I, /obj/item/weapon/evidencebag))
to_chat(user, "You find putting an evidence bag in another evidence bag to be slightly absurd.")
return 1 //now this is podracing
diff --git a/code/modules/detective_work/scanner.dm b/code/modules/detective_work/scanner.dm
index 3a5e19169c0..58c1c31a3b8 100644
--- a/code/modules/detective_work/scanner.dm
+++ b/code/modules/detective_work/scanner.dm
@@ -7,7 +7,7 @@
desc = "Used to remotely scan objects and biomass for DNA and fingerprints. Can print a report of the findings."
icon = 'icons/goonstation/objects/objects.dmi'
icon_state = "detscanner"
- w_class = 3.0
+ w_class = 3
item_state = "electronic"
flags = CONDUCT | NOBLUDGEON
slot_flags = SLOT_BELT
@@ -18,7 +18,7 @@
/obj/item/device/detective_scanner/attack_self(var/mob/user)
var/search = input(user, "Enter name, fingerprint or blood DNA.", "Find record", "")
- if (!search || user.stat || user.incapacitated())
+ if(!search || user.stat || user.incapacitated())
return
search = lowertext(search)
@@ -29,21 +29,21 @@
// I really, really wish I didn't have to split this into two seperate loops. But the datacore is awful.
- for (var/record in data_core.general)
+ for(var/record in data_core.general)
var/datum/data/record/S = record
if(S && (search == lowertext(S.fields["fingerprint"]) || search == lowertext(S.fields["name"])))
name = S.fields["name"]
fingerprint = S.fields["fingerprint"]
continue
- for (var/record in data_core.medical)
+ for(var/record in data_core.medical)
var/datum/data/record/M = record
- if (M && ( search == lowertext(M.fields["b_dna"]) || name == M.fields["name"]) )
+ if(M && ( search == lowertext(M.fields["b_dna"]) || name == M.fields["name"]) )
dna = M.fields["b_dna"]
if(fingerprint == "FINGERPRINT NOT FOUND") // We have searched by DNA, and do not have the relevant information from the fingerprint records.
name = M.fields["name"]
- for (var/gen_record in data_core.general)
+ for(var/gen_record in data_core.general)
var/datum/data/record/S = gen_record
if(S && (name == S.fields["name"]))
fingerprint = S.fields["fingerprint"]
@@ -132,7 +132,7 @@
if(ishuman(A))
var/mob/living/carbon/human/H = A
- if (istype(H.dna, /datum/dna) && !H.gloves)
+ if(istype(H.dna, /datum/dna) && !H.gloves)
fingerprints += md5(H.dna.uni_identity)
else if(!ismob(A))
@@ -170,7 +170,7 @@
found_something = 1
// Blood
- if (blood && blood.len)
+ if(blood && blood.len)
sleep(30)
add_log("Blood:")
found_something = 1
diff --git a/code/modules/economy/ATM.dm b/code/modules/economy/ATM.dm
index a8134a82f66..5ea69f25c55 100644
--- a/code/modules/economy/ATM.dm
+++ b/code/modules/economy/ATM.dm
@@ -209,7 +209,9 @@ log transactions
dat += "Unable to connect to accounts database, please retry and if the issue persists contact Nanotrasen IT support."
reconnect_database()
- user << browse(dat,"window=atm;size=550x650")
+ var/datum/browser/popup = new(user, "atm", name, 550, 650)
+ popup.set_content(dat)
+ popup.open(0)
else
user << browse(null,"window=atm")
@@ -364,7 +366,7 @@ log transactions
else
var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
usr.drop_item()
I.loc = src
held_card = I
diff --git a/code/modules/economy/Accounts.dm b/code/modules/economy/Accounts.dm
index 844c5ca8bbf..9fac3da39d0 100644
--- a/code/modules/economy/Accounts.dm
+++ b/code/modules/economy/Accounts.dm
@@ -318,7 +318,7 @@ var/global/list/all_money_accounts = list()
else
var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
usr.drop_item()
C.loc = src
diff --git a/code/modules/economy/Accounts_DB.dm b/code/modules/economy/Accounts_DB.dm
index b5cb77880f6..1293d92b2b3 100644
--- a/code/modules/economy/Accounts_DB.dm
+++ b/code/modules/economy/Accounts_DB.dm
@@ -18,7 +18,7 @@
/obj/machinery/computer/account_database/proc/get_access_level(var/mob/user)
if(user.can_admin_interact())
return 2
- if (!held_card)
+ if(!held_card)
return 0
if(access_cent_commander in held_card.access)
return 2
@@ -91,14 +91,14 @@
data["transactions"] = null
data["accounts"] = null
- if (detailed_account_view)
+ if(detailed_account_view)
data["account_number"] = detailed_account_view.account_number
data["owner_name"] = detailed_account_view.owner_name
data["money"] = detailed_account_view.money
data["suspended"] = detailed_account_view.suspended
var/list/trx[0]
- for (var/datum/transaction/T in detailed_account_view.transaction_log)
+ for(var/datum/transaction/T in detailed_account_view.transaction_log)
trx.Add(list(list(\
"date" = T.date, \
"time" = T.time, \
@@ -107,7 +107,7 @@
"amount" = T.amount, \
"source_terminal" = T.source_terminal)))
- if (trx.len > 0)
+ if(trx.len > 0)
data["transactions"] = trx
var/list/accounts[0]
@@ -119,11 +119,11 @@
"suspended"=D.suspended ? "SUSPENDED" : "",\
"account_index"=i)))
- if (accounts.len > 0)
+ if(accounts.len > 0)
data["accounts"] = accounts
ui = nanomanager.try_update_ui(user, src, ui_key, ui, data, force_open)
- if (!ui)
+ if(!ui)
ui = new(user, src, ui_key, "accounts_terminal.tmpl", src.name, 400, 640)
ui.set_initial_data(data)
ui.open()
@@ -142,7 +142,7 @@
else
var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
usr.drop_item()
C.forceMove(src)
@@ -220,7 +220,7 @@
var/text
playsound(loc, "sound/goonstation/machines/printer_thermal.ogg", 50, 1)
var/obj/item/weapon/paper/P = new(loc)
- if (detailed_account_view)
+ if(detailed_account_view)
P.name = "account #[detailed_account_view.account_number] details"
var/title = "Account #[detailed_account_view.account_number] Details"
text = {"
@@ -242,7 +242,7 @@
"}
- for (var/datum/transaction/T in detailed_account_view.transaction_log)
+ for(var/datum/transaction/T in detailed_account_view.transaction_log)
text += {"
[T.date] [T.time]
diff --git a/code/modules/economy/EFTPOS.dm b/code/modules/economy/EFTPOS.dm
index fbb7bb4af7a..275456e0d4f 100644
--- a/code/modules/economy/EFTPOS.dm
+++ b/code/modules/economy/EFTPOS.dm
@@ -175,26 +175,26 @@
reconnect_database()
if(linked_db && linked_account)
var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/weapon/card))
+ if(istype(I, /obj/item/weapon/card))
scan_card(I)
else
to_chat(usr, "[bicon(src)]Unable to link accounts.")
if("reset")
//reset the access code - requires HoP/captain access
var/obj/item/I = usr.get_active_hand()
- if (istype(I, /obj/item/weapon/card))
+ if(istype(I, /obj/item/weapon/card))
var/obj/item/weapon/card/id/C = I
if(access_cent_commander in C.access || access_hop in C.access || access_captain in C.access)
access_code = 0
to_chat(usr, "[bicon(src)]Access code reset to 0.")
- else if (istype(I, /obj/item/weapon/card/emag))
+ else if(istype(I, /obj/item/weapon/card/emag))
access_code = 0
to_chat(usr, "[bicon(src)]Access code reset to 0.")
src.attack_self(usr)
/obj/item/device/eftpos/proc/scan_card(var/obj/item/weapon/card/I)
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
visible_message("[usr] swipes a card through [src].")
if(transaction_locked && !transaction_paid)
diff --git a/code/modules/economy/utils.dm b/code/modules/economy/utils.dm
index 5ef9a033b6d..4fc67aa6c78 100644
--- a/code/modules/economy/utils.dm
+++ b/code/modules/economy/utils.dm
@@ -16,7 +16,7 @@
/obj/proc/get_card_account(var/obj/item/weapon/card/I, var/mob/user=null, var/terminal_name="", var/transaction_purpose="", var/require_pin=0)
if(terminal_name=="")
terminal_name=src.name
- if (istype(I, /obj/item/weapon/card/id))
+ if(istype(I, /obj/item/weapon/card/id))
var/obj/item/weapon/card/id/C = I
var/attempt_pin=0
var/datum/money_account/D = get_money_account(C.associated_account_number)
diff --git a/code/modules/error_handler/error_handler.dm b/code/modules/error_handler/error_handler.dm
index 1ab10bc8e4f..430ac0fccb1 100644
--- a/code/modules/error_handler/error_handler.dm
+++ b/code/modules/error_handler/error_handler.dm
@@ -102,3 +102,17 @@ var/total_runtimes_skipped = 0
error_cache.logError(e, desclines, e_src = e_src)
#endif
+
+/proc/log_runtime(exception/e, datum/e_src, extra_info)
+ if(!istype(e))
+ world.Error(e, e_src)
+ return
+
+ if(extra_info)
+ // Adding extra info adds two newlines, because parsing runtimes is funky
+ if(islist(extra_info))
+ e.desc = " [jointext(extra_info, "\n ")]\n\n" + e.desc
+ else
+ e.desc = " [extra_info]\n\n" + e.desc
+
+ world.Error(e, e_src)
diff --git a/code/modules/events/anomaly_bluespace.dm b/code/modules/events/anomaly_bluespace.dm
index 82a4da4cc15..13d7478aab3 100644
--- a/code/modules/events/anomaly_bluespace.dm
+++ b/code/modules/events/anomaly_bluespace.dm
@@ -42,7 +42,7 @@
var/y_distance = TO.y - FROM.y
var/x_distance = TO.x - FROM.x
- for (var/atom/movable/A in range(12, FROM )) // iterate thru list of mobs in the area
+ for(var/atom/movable/A in range(12, FROM )) // iterate thru list of mobs in the area
if(istype(A, /obj/item/device/radio/beacon)) continue // don't teleport beacons because that's just insanely stupid
if(A.anchored) continue
diff --git a/code/modules/events/carp_migration.dm b/code/modules/events/carp_migration.dm
index a4f620fccdf..13b5c884131 100644
--- a/code/modules/events/carp_migration.dm
+++ b/code/modules/events/carp_migration.dm
@@ -34,9 +34,9 @@
num_groups = min(num_groups, spawn_locations.len)
var/i = 1
- while (i <= num_groups)
+ while(i <= num_groups)
var/group_size = rand(group_size_min, group_size_max)
- for (var/j = 1, j <= group_size, j++)
+ for(var/j = 1, j <= group_size, j++)
var/carptype = /mob/living/simple_animal/hostile/carp
if(prob(5))
carptype = /mob/living/simple_animal/hostile/carp/megacarp
diff --git a/code/modules/events/dust.dm b/code/modules/events/dust.dm
index b7f1fb660c8..20f7f9955eb 100644
--- a/code/modules/events/dust.dm
+++ b/code/modules/events/dust.dm
@@ -73,7 +73,7 @@
for(var/mob/M in range(10, src))
if(!M.stat && !istype(M, /mob/living/silicon/ai))
shake_camera(M, 3, 1)
- if (A)
+ if(A)
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
if(ismob(A))
diff --git a/code/modules/events/event_container.dm b/code/modules/events/event_container.dm
index 5955d60cbec..deaa1b85aa8 100644
--- a/code/modules/events/event_container.dm
+++ b/code/modules/events/event_container.dm
@@ -149,7 +149,7 @@ var/list/event_last_fired = list()
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Prison Break", /datum/event/prison_break, 0, list(ASSIGNMENT_SECURITY = 100)),
//new /datum/event_meta(EVENT_LEVEL_MODERATE, "Virology Breach", /datum/event/prison_break/virology, 0, list(ASSIGNMENT_MEDICAL = 100)),
//new /datum/event_meta(EVENT_LEVEL_MODERATE, "Xenobiology Breach", /datum/event/prison_break/xenobiology, 0, list(ASSIGNMENT_SCIENCE = 100)),
- //new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 200, list(ASSIGNMENT_ENGINEER = 60)),
+ new /datum/event_meta(EVENT_LEVEL_MODERATE, "Grid Check", /datum/event/grid_check, 200, list(ASSIGNMENT_ENGINEER = 60)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Electrical Storm", /datum/event/electrical_storm, 250, list(ASSIGNMENT_ENGINEER = 20, ASSIGNMENT_JANITOR = 150)),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Radiation Storm", /datum/event/radiation_storm, 0, list(ASSIGNMENT_MEDICAL = 50), 1),
new /datum/event_meta(EVENT_LEVEL_MODERATE, "Spider Infestation", /datum/event/spider_infestation, 100, list(ASSIGNMENT_SECURITY = 30), 1),
diff --git a/code/modules/events/event_manager.dm b/code/modules/events/event_manager.dm
index 85ffa86f25f..00b7f76fc3e 100644
--- a/code/modules/events/event_manager.dm
+++ b/code/modules/events/event_manager.dm
@@ -337,18 +337,18 @@
var/list/event_areas = list()
- for (var/areapath in the_station_areas)
+ for(var/areapath in the_station_areas)
event_areas += typesof(areapath)
- for (var/areapath in safe_areas)
+ for(var/areapath in safe_areas)
event_areas -= typesof(areapath)
- for (var/areapath in danger_areas)
+ for(var/areapath in danger_areas)
event_areas += typesof(areapath)
- while (event_areas.len > 0)
+ while(event_areas.len > 0)
var/list/event_turfs = null
candidate = locate(pick_n_take(event_areas))
event_turfs = get_area_turfs(candidate)
- if (event_turfs.len > 0)
+ if(event_turfs.len > 0)
break
return candidate
diff --git a/code/modules/events/holidays/Holidays.dm b/code/modules/events/holidays/Holidays.dm
index e06c7764a39..8b219e77d8a 100644
--- a/code/modules/events/holidays/Holidays.dm
+++ b/code/modules/events/holidays/Holidays.dm
@@ -2,7 +2,7 @@
var/global/Holiday = null
//Just thinking ahead! Here's the foundations to a more robust Holiday event system.
-//It's easy as hell to add stuff. Just set Holiday to something using the switch (or something else)
+//It's easy as hell to add stuff. Just set Holiday to something using the switch(or something else)
//then use if(Holiday == "MyHoliday") to make stuff happen on that specific day only
//Please, Don't spam stuff up with easter eggs, I'd rather somebody just delete this than people cause
//the game to lag even more in the name of one-day content.
diff --git a/code/modules/events/immovable_rod.dm b/code/modules/events/immovable_rod.dm
index eb2007944dd..3012b0f9535 100644
--- a/code/modules/events/immovable_rod.dm
+++ b/code/modules/events/immovable_rod.dm
@@ -54,11 +54,11 @@ In my current plan for it, 'solid' will be defined as anything with density == 1
x = clong.x
y = clong.y
- if (istype(clong, /turf) || istype(clong, /obj))
+ if(istype(clong, /turf) || istype(clong, /obj))
if(clong.density)
clong.ex_act(2)
- else if (istype(clong, /mob))
+ else if(istype(clong, /mob))
if(istype(clong, /mob/living/carbon/human))
var/mob/living/carbon/human/H = clong
H.visible_message("[H.name] is penetrated by an immovable rod!" , "The rod penetrates you!" , "You hear a CLANG!")
diff --git a/code/modules/events/ion_storm.dm b/code/modules/events/ion_storm.dm
index bba7949a600..20a53a4413f 100644
--- a/code/modules/events/ion_storm.dm
+++ b/code/modules/events/ion_storm.dm
@@ -492,7 +492,7 @@
/proc/generate_static_ion_law()
/var/list/players = list()
- for (var/mob/living/carbon/human/player in player_list)
+ for(var/mob/living/carbon/human/player in player_list)
if( !player.mind || player.mind.assigned_role == "MODE" || player.client.inactivity > MinutesToTicks(10))
continue
players += player.real_name
diff --git a/code/modules/events/meaty_ores.dm b/code/modules/events/meaty_ores.dm
index d13a1b9ad34..df56749734e 100644
--- a/code/modules/events/meaty_ores.dm
+++ b/code/modules/events/meaty_ores.dm
@@ -26,7 +26,7 @@
for(var/mob/M in range(10, src))
if(!M.stat && !istype(M, /mob/living/silicon/ai))
shake_camera(M, 3, 1)
- if (A)
+ if(A)
playsound(src.loc, 'sound/effects/meteorimpact.ogg', 40, 1)
walk(src,0)
invisibility = 101
diff --git a/code/modules/events/money_spam.dm b/code/modules/events/money_spam.dm
index 94f27958b9b..061a1c9efa7 100644
--- a/code/modules/events/money_spam.dm
+++ b/code/modules/events/money_spam.dm
@@ -9,7 +9,7 @@
/datum/event/pda_spam/proc/pick_message_server()
if(message_servers)
- for (var/obj/machinery/message_server/MS in message_servers)
+ for(var/obj/machinery/message_server/MS in message_servers)
if(MS.active)
useMS = MS
break
@@ -31,7 +31,7 @@
for(var/obj/item/device/pda/check_pda in PDAs)
var/datum/data/pda/app/messenger/check_m = check_pda.find_program(/datum/data/pda/app/messenger)
- if (!check_m || !check_m.can_receive())
+ if(!check_m || !check_m.can_receive())
continue
viables.Add(check_pda)
@@ -92,12 +92,12 @@
"You have won tickets to the newest romantic comedy 16 RULES OF LOVE!",\
"You have won tickets to the newest thriller THE CULT OF THE SLEEPING ONE!")
- if (useMS.send_pda_message("[P.owner]", sender, message)) //Message been filtered by spam filter.
+ if(useMS.send_pda_message("[P.owner]", sender, message)) //Message been filtered by spam filter.
return
last_spam_time = world.time
- if (prob(50)) //Give the AI an increased chance to intercept the message
+ if(prob(50)) //Give the AI an increased chance to intercept the message
for(var/mob/living/silicon/ai/ai in mob_list)
// Allows other AIs to intercept the message but the AI won't intercept their own message.
if(ai.aiPDA != P && ai.aiPDA != src)
diff --git a/code/modules/events/radiation_storm.dm b/code/modules/events/radiation_storm.dm
index f798e9984d4..5afddd49d23 100644
--- a/code/modules/events/radiation_storm.dm
+++ b/code/modules/events/radiation_storm.dm
@@ -49,7 +49,7 @@
H.apply_effect((rand(15,35)),IRRADIATE,0)
if(prob(5))
H.apply_effect((rand(40,70)),IRRADIATE,0)
- if (prob(75))
+ if(prob(75))
randmutb(H) // Applies bad mutation
domutcheck(H,null,1)
else
diff --git a/code/modules/fish/fish_eggs.dm b/code/modules/fish/fish_eggs.dm
index e4283718a53..493f3dcf1db 100644
--- a/code/modules/fish/fish_eggs.dm
+++ b/code/modules/fish/fish_eggs.dm
@@ -4,7 +4,7 @@
desc = "Eggs laid by a fish. This cluster seems... empty?"
icon = 'icons/obj/fish_items.dmi'
icon_state = "eggs"
- w_class = 2.0
+ w_class = 2
var/fish_type = null //Holds the name of the fish that the egg is for
/obj/item/fish_eggs/New()
diff --git a/code/modules/fish/fish_items.dm b/code/modules/fish/fish_items.dm
index 00659104480..0266f06df90 100644
--- a/code/modules/fish/fish_items.dm
+++ b/code/modules/fish/fish_items.dm
@@ -23,7 +23,7 @@ var/global/list/fish_items_list = list("goldfish" = /obj/item/weapon/fish/goldfi
icon_state = "egg_scoop"
slot_flags = SLOT_BELT
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 7
@@ -34,7 +34,7 @@ var/global/list/fish_items_list = list("goldfish" = /obj/item/weapon/fish/goldfi
icon_state = "net"
slot_flags = SLOT_BELT
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 7
@@ -48,7 +48,7 @@ var/global/list/fish_items_list = list("goldfish" = /obj/item/weapon/fish/goldfi
icon = 'icons/obj/fish_items.dmi'
icon_state = "fish_food"
throwforce = 1
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 7
@@ -59,7 +59,7 @@ var/global/list/fish_items_list = list("goldfish" = /obj/item/weapon/fish/goldfi
icon_state = "brush"
slot_flags = SLOT_BELT
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 7
attack_verb = list("scrubbed", "brushed", "scraped")
@@ -103,7 +103,7 @@ var/global/list/fish_items_list = list("goldfish" = /obj/item/weapon/fish/goldfi
icon = 'icons/obj/fish_items.dmi'
icon_state = "fish"
throwforce = 1
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 7
force = 1
diff --git a/code/modules/fish/fishtank.dm b/code/modules/fish/fishtank.dm
index 6da71b3adb2..005fce56df0 100644
--- a/code/modules/fish/fishtank.dm
+++ b/code/modules/fish/fishtank.dm
@@ -415,7 +415,7 @@
examine_message += "\The [src] is about three-quarters filled. "
else if(water_level < water_capacity)
examine_message += "\The [src] is nearly full! "
- else if (water_level == water_capacity)
+ else if(water_level == water_capacity)
examine_message += "\The [src] is full! "
examine_message += " Cleanliness level: "
@@ -558,7 +558,7 @@
/obj/machinery/fishtank/attack_slime(mob/living/user as mob)
var/mob/living/carbon/slime/S = user
- if (!S.is_adult)
+ if(!S.is_adult)
return
attack_generic(user, rand(10, 15))
@@ -567,7 +567,7 @@
user.say(pick(";RAAAAAAAARGH!", ";HNNNNNNNNNGGGGGGH!", ";GWAAAAAAAARRRHHH!", "NNNNNNNNGGGGGGGGHH!", ";AAAAAAARRRGH!"))
user.visible_message("[user] smashes through [src]!")
destroy()
- else if (usr.a_intent == I_HARM)
+ else if(usr.a_intent == I_HARM)
user.changeNext_move(CLICK_CD_MELEE)
playsound(get_turf(src), 'sound/effects/glassknock.ogg', 80, 1)
usr.visible_message("[usr.name] bangs against the [src.name]!", \
diff --git a/code/modules/flufftext/Hallucination.dm b/code/modules/flufftext/Hallucination.dm
index c284660fe04..81038eaf463 100644
--- a/code/modules/flufftext/Hallucination.dm
+++ b/code/modules/flufftext/Hallucination.dm
@@ -376,7 +376,7 @@ Gunshots/explosions/opening doors/less rare audio (done)
if(!(locate(clone.l_hand) in non_fakeattack_weapons))
clone_weapon = clone.l_hand.name
F.weap = clone.l_hand
- else if (clone.r_hand)
+ else if(clone.r_hand)
if(!(locate(clone.r_hand) in non_fakeattack_weapons))
clone_weapon = clone.r_hand.name
F.weap = clone.r_hand
@@ -516,7 +516,7 @@ var/list/non_fakeattack_weapons = list(/obj/item/weapon/gun/projectile, /obj/ite
/obj/item/clothing/mask/gas/voice, /obj/item/clothing/glasses/thermal,\
/obj/item/device/chameleon, /obj/item/weapon/card/emag,\
/obj/item/weapon/storage/toolbox/syndicate, /obj/item/weapon/aiModule,\
- /obj/item/device/radio/headset/syndicate, /obj/item/weapon/c4,\
+ /obj/item/device/radio/headset/syndicate, /obj/item/weapon/grenade/plastic/c4,\
/obj/item/device/powersink, /obj/item/weapon/storage/box/syndie_kit,\
/obj/item/toy/syndicateballoon, /obj/item/weapon/gun/energy/laser/captain,\
/obj/item/weapon/hand_tele, /obj/item/weapon/rcd, /obj/item/weapon/tank/jetpack,\
diff --git a/code/modules/flufftext/TextFilters.dm b/code/modules/flufftext/TextFilters.dm
index 5a40ea1934a..acce72c7f7a 100644
--- a/code/modules/flufftext/TextFilters.dm
+++ b/code/modules/flufftext/TextFilters.dm
@@ -33,7 +33,7 @@ proc/NewStutter(phrase,stunned)
if(stunned) i = split_phrase.len
for(,i > 0,i--) //Pick a few words to stutter on.
- if (!unstuttered_words.len)
+ if(!unstuttered_words.len)
break
var/word = pick(unstuttered_words)
unstuttered_words -= word //Remove from unstuttered words so we don't stutter it again.
diff --git a/code/modules/food_and_drinks/drinks/bottler/bottler.dm b/code/modules/food_and_drinks/drinks/bottler/bottler.dm
new file mode 100644
index 00000000000..7e764595fd5
--- /dev/null
+++ b/code/modules/food_and_drinks/drinks/bottler/bottler.dm
@@ -0,0 +1,414 @@
+
+//adjust these to change the maximum capacity of the bottler for each container type
+#define MAX_GLASS 10
+#define MAX_PLAST 20
+#define MAX_METAL 25
+
+//adjust these to change the number of containers the bottler will make per sheet
+#define RATIO_GLASS 1
+#define RATIO_PLAST 2
+#define RATIO_METAL 5
+
+/obj/machinery/bottler
+ name = "bottler unit"
+ desc = "A machine that combines ingredients and bottles the resulting beverages."
+ icon = 'icons/obj/kitchen.dmi'
+ icon_state = "bottler_off"
+ density = 1
+ anchored = 1
+ var/list/slots[3]
+ var/list/datum/bottler_recipe/available_recipes
+ var/list/acceptable_items
+ var/list/containers = list("glass bottle" = 10, "plastic bottle" = 20, "metal can" = 25)
+ var/bottling = 0
+
+/obj/machinery/bottler/New()
+ if(!available_recipes)
+ available_recipes = list()
+ acceptable_items = list()
+ //These are going to be acceptable even if they aren't in a recipe
+ acceptable_items |= /obj/item/weapon/reagent_containers/food/snacks
+ acceptable_items |= /obj/item/weapon/reagent_containers/food/drinks/cans
+ //the rest is based on what is used in recipes so we don't have people destroying the nuke disc
+ for(var/type in subtypesof(/datum/bottler_recipe))
+ var/datum/bottler_recipe/recipe = new type
+ if(recipe.result) // Ignore recipe subtypes that lack a result
+ available_recipes += recipe
+ for(var/i = 1, i <= recipe.ingredients.len, i++)
+ acceptable_items |= recipe.ingredients[i]
+ else
+ qdel(recipe)
+
+/obj/machinery/bottler/attackby(obj/item/O, mob/user, params)
+ if(iswrench(O)) //This being before the canUnequip check allows borgs to (un)wrench bottlers in case they need move them to fix stuff
+ playsound(src, 'sound/items/Ratchet.ogg', 50, 1)
+ if(anchored)
+ anchored = 0
+ to_chat(user, "[src] can now be moved.")
+ else
+ anchored = 1
+ to_chat(user, "[src] is now secured.")
+ return 1
+ if(!user.canUnEquip(O, 0))
+ to_chat(user, "[O] is stuck to your hand, you can't seem to put it down!")
+ return 0
+ if(is_type_in_list(O,acceptable_items))
+ if(istype(O, /obj/item/weapon/reagent_containers/food/snacks))
+ var/obj/item/weapon/reagent_containers/food/snacks/S = O
+ user.unEquip(S)
+ if(S.reagents && !S.reagents.total_volume) //This prevents us from using empty foods, should one occur due to some sort of error
+ to_chat(user, "[S] is gone, oh no!")
+ qdel(S) //Delete the food object because it is useless even as food due to the lack of reagents
+ else
+ insert_item(S, user)
+ return 1
+ else if(istype(O, /obj/item/weapon/reagent_containers/food/drinks/cans))
+ var/obj/item/weapon/reagent_containers/food/drinks/cans/C = O
+ if(C.reagents)
+ if(C.canopened && C.reagents.total_volume) //This prevents us from using opened cans that still have something in them
+ to_chat(user, "Only unopened cans and bottles can be processed to ensure product integrity.")
+ return 0
+ user.unEquip(C)
+ if(!C.reagents.total_volume) //Empty cans get recycled, even if they have somehow remained unopened due to some sort of error
+ recycle_container(C)
+ else //Full cans that are unopened get inserted for processing as ingredients
+ insert_item(C, user)
+ return 1
+ else
+ user.unEquip(O)
+ insert_item(O, user)
+ return 1
+ else if(istype(O, /obj/item/trash/can)) //Crushed cans (and bottles) are returnable still
+ var/obj/item/trash/can/C = O
+ user.unEquip(C)
+ recycle_container(C)
+ return 1
+ else if(istype(O, /obj/item/stack/sheet)) //Sheets of materials can replenish the machine's supply of drink containers (when people inevitably don't return them)
+ var/obj/item/stack/sheet/S = O
+ user.unEquip(S)
+ process_sheets(S)
+ return 1
+ else //If it doesn't qualify in the above checks, we don't want it. Inform the person so they (ideally) stop trying to put the nuke disc in.
+ to_chat(user, "You aren't sure this is able to be processed by the machine.")
+ return 0
+ //..()
+
+/obj/machinery/bottler/proc/insert_item(obj/item/O, mob/user)
+ if(!O || !user)
+ return
+ if(slots[1] && slots[2] && slots[3])
+ to_chat(user, "[src] is full, please remove or process the contents first.")
+ return
+ var/slot_inserted = 0
+ for(var/i = 1, i <= slots.len, i++)
+ if(!slots[i])
+ slots[i] = O
+ slot_inserted = i
+ break
+ if(!slot_inserted)
+ to_chat(user, "Something went wrong and the machine spits out [O].")
+ O.forceMove(loc)
+ else
+ to_chat(user, "You load [O] into the [slot_inserted]\th ingredient tray.")
+ O.forceMove(src)
+ updateUsrDialog()
+
+/obj/machinery/bottler/proc/eject_items(var/slot)
+ var/obj/item/O = null
+ if(!slot)
+ for(var/i = 1, i <= slots.len, i++)
+ if(slots[i])
+ O = slots[i]
+ O.forceMove(loc)
+ slots[i] = null
+ visible_message("[src] beeps as it ejects the contents of all the ingredient trays.")
+ else
+ if(slots[slot]) //ensures the tray actually has something to eject so we don't runtime on trying to reference null
+ O = slots[slot]
+ O.forceMove(loc)
+ slots[slot] = null
+ visible_message("[src] beeps as it ejects [O.name] from the [slot]\th ingredient tray.")
+ updateUsrDialog()
+
+/obj/machinery/bottler/proc/recycle_container(obj/item/O)
+ if(!O)
+ return
+ var/con_type
+ var/max_define
+ if(istype(O, /obj/item/trash/can))
+ var/obj/item/trash/can/C = O
+ if(C.is_glass)
+ con_type = "glass bottle"
+ max_define = MAX_GLASS
+ else if(C.is_plastic)
+ con_type = "plastic bottle"
+ max_define = MAX_PLAST
+ else
+ con_type = "metal can"
+ max_define = MAX_METAL
+ else if(istype(O, /obj/item/weapon/reagent_containers/food/drinks/cans))
+ var/obj/item/weapon/reagent_containers/food/drinks/cans/C = O
+ if(C.is_glass)
+ con_type = "glass bottle"
+ max_define = MAX_GLASS
+ else if(C.is_plastic)
+ con_type = "plastic bottle"
+ max_define = MAX_PLAST
+ else
+ con_type = "metal can"
+ max_define = MAX_METAL
+ if(con_type)
+ if(containers[con_type] < max_define)
+ containers[con_type]++
+ visible_message("[src] whirs briefly as it prepares the container for reuse.")
+ qdel(O)
+ updateUsrDialog()
+ else
+ visible_message("[src] cannot store any more cans at this time. Please fill some before recycling more.")
+ O.forceMove(loc)
+
+/obj/machinery/bottler/proc/process_sheets(obj/item/stack/sheet/S)
+ if(!S)
+ return
+ S.forceMove(loc)
+ var/con_type
+ var/max_define
+ var/mat_ratio
+ //Glass sheets for glass bottles (1 bottle per sheet)
+ if(istype(S, /obj/item/stack/sheet/glass))
+ con_type = "glass bottle"
+ max_define = MAX_GLASS
+ mat_ratio = RATIO_GLASS
+ else if(istype(S, /obj/item/stack/sheet/mineral/plastic))
+ con_type = "plastic bottle"
+ max_define = MAX_PLAST
+ mat_ratio = RATIO_PLAST
+ else if(istype(S, /obj/item/stack/sheet/metal))
+ con_type = "metal can"
+ max_define = MAX_METAL
+ mat_ratio = RATIO_METAL
+ else
+ visible_message("[src] rejects the unusable materials.")
+ return
+ var/missing
+ var/sheets_needed
+ var/sheets_to_use
+ if(con_type)
+ missing = max_define - containers[con_type]
+ sheets_needed = round(missing / mat_ratio, 1)
+ if(missing % mat_ratio)
+ sheets_needed += 1
+ sheets_to_use = min(sheets_needed, S.amount)
+ if(missing)
+ visible_message("[src] shudders as it converts [sheets_to_use] [S.singular_name]\s into new [con_type]s.")
+ containers[con_type] += sheets_to_use * mat_ratio
+ containers[con_type] = min(containers[con_type], max_define)
+ S.use(sheets_to_use)
+ else
+ visible_message("[src] rejects the [S] because it already is fully stocked with [con_type]s.")
+
+/obj/machinery/bottler/proc/select_recipe()
+ for(var/datum/bottler_recipe/recipe in available_recipes)
+ var/number_matches = 0
+ for(var/i = 1, i <= slots.len, i++)
+ var/obj/item/O = slots[i]
+ if(istype(O, recipe.ingredients[i]))
+ if(istype(O, /obj/item/weapon/reagent_containers/food/snacks/grown))
+ var/obj/item/weapon/reagent_containers/food/snacks/grown/G = O
+ if(G.seed && G.seed.kitchen_tag == recipe.tags[i])
+ number_matches++
+ else
+ number_matches++
+ if(number_matches == 3)
+ return recipe
+ return null
+
+/obj/machinery/bottler/proc/dispense_empty_container(container)
+ var/con_type
+ var/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/drink_container
+ switch(container)
+ if(1) //glass bottle
+ con_type = "glass bottle"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/glass_bottle
+ if(2) //plastic bottle
+ con_type = "plastic bottle"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/plastic_bottle
+ if(3) //metal can
+ con_type = "metal can"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/metal_can
+ if(containers[con_type])
+ //empties aren't sealed, so let's open it quietly
+ drink_container = new drink_container()
+ drink_container.canopened = 1
+ drink_container.flags |= OPENCONTAINER
+ drink_container.forceMove(loc)
+ containers[con_type]--
+
+/obj/machinery/bottler/proc/process_ingredients(container)
+ //stop if we have ZERO ingredients (what would you process?)
+ if(!slots[1] && !slots[2] && !slots[3])
+ visible_message("There are no ingredients to process! Please insert some first.")
+ return
+ //prep a container
+ var/obj/item/weapon/reagent_containers/food/drinks/cans/bottler/drink_container
+ var/con_type
+ switch(container)
+ if(1) //glass bottle
+ con_type = "glass bottle"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/glass_bottle
+ if(2) //plastic bottle
+ con_type = "plastic bottle"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/plastic_bottle
+ if(3) //metal can
+ con_type = "metal can"
+ drink_container = /obj/item/weapon/reagent_containers/food/drinks/cans/bottler/metal_can
+
+ if(!con_type)
+ visible_message("Error 404: Drink Container Not Found.")
+ return
+ if(!containers[con_type])
+ visible_message("Error 503: Out of [con_type]s.")
+ return
+ else
+ drink_container = new drink_container()
+ containers[con_type]--
+ //select and process a recipe based on inserted ingredients
+ visible_message("[src] hums as it processes the ingredients...")
+ bottling = 1
+ var/datum/bottler_recipe/recipe_to_use = select_recipe()
+ if(!recipe_to_use)
+ //bad recipe, ruins the drink
+ var/contents = pick("thick goop", "pungent sludge", "unspeakable slurry", "gross-looking concoction", "eldritch abomination of liquids")
+ visible_message("The [con_type] fills with \an [contents]...")
+ drink_container.reagents.add_reagent(pick("????", "toxic_slurry", "meatslurry", "glowing_slury", "fishwater"), pick(30, 50))
+ drink_container.name = "Liquid Mistakes"
+ drink_container.desc = "WARNING: CONTENTS MAY BE AWFUL, DRINK AT OWN RISK."
+ else
+ //good recipe, make it
+ visible_message("The [con_type] fills with a delicious-looking beverage!")
+ drink_container.reagents.add_reagent(recipe_to_use.result, 50)
+ drink_container.name = "[recipe_to_use.name]"
+ drink_container.desc = "[recipe_to_use.description]"
+ flick("bottler_on", src)
+ spawn(45)
+ for(var/i = 1, i <= slots.len, i++)
+ qdel(slots[i])
+ slots[i] = null
+ bottling = 0
+ drink_container.forceMove(loc)
+ updateUsrDialog()
+
+/obj/machinery/bottler/attack_ai(mob/user)
+ attack_hand(user)
+
+/obj/machinery/bottler/attack_ghost(mob/user)
+ attack_hand(user)
+
+/obj/machinery/bottler/attack_hand(mob/user)
+ if(stat & BROKEN)
+ return
+ interact(user)
+
+/obj/machinery/bottler/interact(mob/user)
+ user.set_machine(src)
+ //html ahoy
+ var/dat = ""
+ if(bottling)
+ dat = "
"
- if (piles.len == 0)
+ if(piles.len == 0)
dat += "No seeds"
else
dat += "
Name
"
dat += "
Variety
"
- if ("stats" in scanner)
+ if("stats" in scanner)
dat += "
E
Y
M
Pr
Pt
Harvest
"
- if ("temperature" in scanner)
+ if("temperature" in scanner)
dat += "
Temp
"
- if ("light" in scanner)
+ if("light" in scanner)
dat += "
Light
"
- if ("soil" in scanner)
+ if("soil" in scanner)
dat += "
Nutri
Water
"
dat += "
Notes
Amount
"
- for (var/datum/seed_pile/S in piles)
+ for(var/datum/seed_pile/S in piles)
var/datum/seed/seed = S.seed_type
if(!seed)
continue
dat += "
"
dat += "
[seed.seed_name]
"
dat += "
#[seed.uid]
"
- if ("stats" in scanner)
+ if("stats" in scanner)
dat += "
[seed.get_trait(TRAIT_ENDURANCE)]
[seed.get_trait(TRAIT_YIELD)]
[seed.get_trait(TRAIT_MATURATION)]
[seed.get_trait(TRAIT_PRODUCTION)]
[seed.get_trait(TRAIT_POTENCY)]
"
if(seed.get_trait(TRAIT_HARVEST_REPEAT))
dat += "
Multiple
"
else
dat += "
Single
"
- if ("temperature" in scanner)
+ if("temperature" in scanner)
dat += "
[seed.get_trait(TRAIT_IDEAL_HEAT)] K
"
- if ("light" in scanner)
+ if("light" in scanner)
dat += "
[seed.get_trait(TRAIT_IDEAL_LIGHT)] L
"
- if ("soil" in scanner)
+ if("soil" in scanner)
if(seed.get_trait(TRAIT_REQUIRES_NUTRIENTS))
if(seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) < 0.05)
dat += "
Low
"
@@ -128,17 +128,17 @@
dat += "VINE "
if(2)
dat += "VINE "
- if ("pressure" in scanner)
+ if("pressure" in scanner)
if(seed.get_trait(TRAIT_LOWKPA_TOLERANCE) < 20)
dat += "LP "
if(seed.get_trait(TRAIT_HIGHKPA_TOLERANCE) > 220)
dat += "HP "
- if ("temperature" in scanner)
+ if("temperature" in scanner)
if(seed.get_trait(TRAIT_HEAT_TOLERANCE) > 30)
dat += "TEMRES "
else if(seed.get_trait(TRAIT_HEAT_TOLERANCE) < 10)
dat += "TEMSEN "
- if ("light" in scanner)
+ if("light" in scanner)
if(seed.get_trait(TRAIT_LIGHT_TOLERANCE) > 10)
dat += "LIGRES "
else if(seed.get_trait(TRAIT_LIGHT_TOLERANCE) < 3)
@@ -157,7 +157,7 @@
dat += "WEEDRES "
if(seed.get_trait(TRAIT_PARASITE))
dat += "PAR "
- if ("temperature" in scanner)
+ if("temperature" in scanner)
if(seed.get_trait(TRAIT_ALTER_TEMP) > 0)
dat += "TEMP+ "
if(seed.get_trait(TRAIT_ALTER_TEMP) < 0)
@@ -174,27 +174,27 @@
onclose(user, "seedstorage")
/obj/machinery/seed_storage/Topic(var/href, var/list/href_list)
- if (..())
+ if(..())
return
var/task = href_list["task"]
var/ID = text2num(href_list["id"])
- for (var/datum/seed_pile/N in piles)
- if (N.ID == ID)
- if (task == "vend")
+ for(var/datum/seed_pile/N in piles)
+ if(N.ID == ID)
+ if(task == "vend")
var/obj/O = pick(N.seeds)
- if (O)
+ if(O)
--N.amount
N.seeds -= O
- if (N.amount <= 0 || N.seeds.len <= 0)
+ if(N.amount <= 0 || N.seeds.len <= 0)
piles -= N
qdel(N)
O.loc = src.loc
else
piles -= N
qdel(N)
- else if (task == "purge")
- for (var/obj/O in N.seeds)
+ else if(task == "purge")
+ for(var/obj/O in N.seeds)
qdel(O)
piles -= N
qdel(N)
@@ -202,17 +202,17 @@
updateUsrDialog()
/obj/machinery/seed_storage/attackby(var/obj/item/O as obj, var/mob/user as mob)
- if (istype(O, /obj/item/seeds))
+ if(istype(O, /obj/item/seeds))
add(O)
user.visible_message("[user] puts \the [O.name] into \the [src].", "You put \the [O] into \the [src].")
return
- else if (istype(O, /obj/item/weapon/storage/bag/plants))
+ else if(istype(O, /obj/item/weapon/storage/bag/plants))
var/obj/item/weapon/storage/P = O
var/loaded = 0
for(var/obj/item/seeds/G in P.contents)
++loaded
add(G)
- if (loaded)
+ if(loaded)
user.visible_message("[user] puts the seeds from \the [O.name] into \the [src].", "You put the seeds from \the [O.name] into \the [src].")
else
to_chat(user, "There are no seeds in \the [O.name].")
@@ -223,7 +223,7 @@
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
/obj/machinery/seed_storage/proc/add(var/obj/item/seeds/O as obj)
- if (istype(O.loc, /mob))
+ if(istype(O.loc, /mob))
var/mob/user = O.loc
user.drop_item(O)
else if(istype(O.loc,/obj/item/weapon/storage))
@@ -233,8 +233,8 @@
O.loc = src
var/newID = 0
- for (var/datum/seed_pile/N in piles)
- if (N.matches(O))
+ for(var/datum/seed_pile/N in piles)
+ if(N.matches(O))
++N.amount
N.seeds += (O)
return
diff --git a/code/modules/hydroponics/spreading/spreading.dm b/code/modules/hydroponics/spreading/spreading.dm
index c26d5b98bad..21dc0dad4af 100644
--- a/code/modules/hydroponics/spreading/spreading.dm
+++ b/code/modules/hydroponics/spreading/spreading.dm
@@ -259,11 +259,11 @@
die_off()
return
if(2.0)
- if (prob(50))
+ if(prob(50))
die_off()
return
if(3.0)
- if (prob(5))
+ if(prob(5))
die_off()
return
else
diff --git a/code/modules/hydroponics/trays/tray.dm b/code/modules/hydroponics/trays/tray.dm
index 74a8d7824dc..e9c63ed8794 100644
--- a/code/modules/hydroponics/trays/tray.dm
+++ b/code/modules/hydroponics/trays/tray.dm
@@ -7,6 +7,8 @@
flags = OPENCONTAINER
volume = 100
+ hud_possible = list (PLANT_NUTRIENT_HUD, PLANT_WATER_HUD, PLANT_STATUS_HUD, PLANT_HEALTH_HUD, PLANT_TOXIN_HUD, PLANT_PEST_HUD, PLANT_WEED_HUD)
+
var/mechanical = 1 // Set to 0 to stop it from drawing the alert lights.
var/base_name = "tray"
@@ -73,10 +75,12 @@
if(weedlevel > 0)
nymph.reagents.add_reagent("nutriment", weedlevel)
weedlevel = 0
+ plant_hud_set_weed()
nymph.visible_message("[nymph] begins rooting through [src], ripping out weeds and eating them noisily.","You begin rooting through [src], ripping out weeds and eating them noisily.")
else if(nymph.nutrition > 100 && nutrilevel < 10)
nymph.nutrition -= ((10-nutrilevel)*5)
nutrilevel = 10
+ plant_hud_set_nutrient()
nymph.visible_message("[nymph] secretes a trickle of green liquid, refilling [src].","You secrete a trickle of green liquid, refilling [src].")
else
nymph.visible_message("[nymph] rolls around in [src] for a bit.","You roll around in [src] for a bit.")
@@ -85,6 +89,17 @@
/obj/machinery/portable_atmospherics/hydroponics/New()
..()
+ var/datum/atom_hud/data/hydroponic/hydro_hud = huds[DATA_HUD_HYDROPONIC]
+ prepare_huds()
+ hydro_hud.add_to_hud(src)
+ plant_hud_set_nutrient()
+ plant_hud_set_water()
+ plant_hud_set_status()
+ plant_hud_set_health()
+ plant_hud_set_toxin()
+ plant_hud_set_pest()
+ plant_hud_set_weed()
+
component_parts = list()
component_parts += new /obj/item/weapon/circuitboard/hydroponics(null)
component_parts += new /obj/item/weapon/stock_parts/matter_bin(null)
@@ -101,6 +116,7 @@
if(closed_system)
flags &= ~OPENCONTAINER
+
/obj/machinery/portable_atmospherics/hydroponics/upgraded/New()
..()
component_parts = list()
@@ -112,12 +128,14 @@
/obj/machinery/portable_atmospherics/hydroponics/RefreshParts()
var/tmp_capacity = 0
- for (var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
+ for(var/obj/item/weapon/stock_parts/matter_bin/M in component_parts)
tmp_capacity += M.rating
maxwater = tmp_capacity * 50 // Up to 300
maxnutri = tmp_capacity * 5 // Up to 30
//waterlevel = maxwater
//nutrilevel = 3
+ plant_hud_set_nutrient()
+ plant_hud_set_water()
/obj/machinery/portable_atmospherics/hydroponics/bullet_act(var/obj/item/projectile/Proj)
@@ -150,12 +168,18 @@
die()
check_level_sanity()
update_icon()
+ plant_hud_set_status()
+ plant_hud_set_health()
/obj/machinery/portable_atmospherics/hydroponics/proc/die()
dead = 1
harvest = 0
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
pestlevel = 0
+ plant_hud_set_status()
+ plant_hud_set_health()
+ plant_hud_set_weed()
+ plant_hud_set_pest()
//Harvests the product of a plant.
/obj/machinery/portable_atmospherics/hydroponics/proc/harvest(var/mob/user)
@@ -233,6 +257,9 @@
pestlevel = 0
sampled = 0
update_icon()
+ plant_hud_set_weed()
+ plant_hud_set_status()
+ plant_hud_set_health()
visible_message("[src] has been overtaken by [seed.display_name].")
return
@@ -391,6 +418,14 @@
toxins = max(0,min(toxins,10))
yield_mod = min(100, yield_mod)
+ plant_hud_set_nutrient()
+ plant_hud_set_water()
+ plant_hud_set_status()
+ plant_hud_set_health()
+ plant_hud_set_toxin()
+ plant_hud_set_pest()
+ plant_hud_set_weed()
+
/obj/machinery/portable_atmospherics/hydroponics/proc/mutate_species()
var/previous_plant = seed.display_name
@@ -409,6 +444,9 @@
harvest = 0
weedlevel = 0
+ plant_hud_set_health()
+ plant_hud_set_weed()
+
update_icon()
visible_message("\red The \blue [previous_plant] \red has suddenly mutated into \blue [seed.display_name]!")
@@ -427,7 +465,7 @@
//--FalseIncarnate
//Check if held item is an open container
- if (O.is_open_container())
+ if(O.is_open_container())
//Check if container is of the "glass" subtype (includes buckets, beakers, vials)
if(istype(O, /obj/item/weapon/reagent_containers/glass))
var/obj/item/weapon/reagent_containers/glass/C = O
@@ -471,7 +509,7 @@
update_icon()
//Check if container is any spray container
- else if (istype(O, /obj/item/weapon/reagent_containers/spray))
+ else if(istype(O, /obj/item/weapon/reagent_containers/spray))
var/obj/item/weapon/reagent_containers/spray/S = O
//Check if there is a plant in the tray
if(seed)
@@ -537,7 +575,7 @@
var/obj/item/weapon/reagent_containers/syringe/S = O
- if (S.mode == 1)
+ if(S.mode == 1)
if(seed)
return ..()
else
@@ -551,7 +589,7 @@
to_chat(user, "There's nothing to draw something from.")
return 1
- else if (istype(O, /obj/item/seeds))
+ else if(istype(O, /obj/item/seeds))
if(!seed)
@@ -579,21 +617,22 @@
else
to_chat(user, "\The [src] already has seeds in it!")
- else if (istype(O, /obj/item/weapon/minihoe)) // The minihoe
+ else if(istype(O, /obj/item/weapon/minihoe)) // The minihoe
if(weedlevel > 0)
user.visible_message("[user] starts uprooting the weeds.", "You remove the weeds from the [src].")
weedlevel = 0
update_icon()
+ plant_hud_set_weed()
else
to_chat(user, "This plot is completely devoid of weeds. It doesn't need uprooting.")
- else if (istype(O, /obj/item/weapon/storage/bag/plants))
+ else if(istype(O, /obj/item/weapon/storage/bag/plants))
attack_hand(user)
var/obj/item/weapon/storage/bag/plants/S = O
- for (var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z))
+ for(var/obj/item/weapon/reagent_containers/food/snacks/grown/G in locate(user.x,user.y,user.z))
if(!S.can_be_inserted(G))
return
S.handle_item_insertion(G, 1)
@@ -608,8 +647,8 @@
anchored = !anchored
to_chat(user, "You [anchored ? "wrench" : "unwrench"] \the [src].")
- else if ((istype(O, /obj/item/weapon/tank) && !( src.destroyed )))
- if (src.holding)
+ else if((istype(O, /obj/item/weapon/tank) && !( src.destroyed )))
+ if(src.holding)
to_chat(user, "\blue There is alreadu a tank loaded into the [src].")
return
var/obj/item/weapon/tank/T = O
diff --git a/code/modules/hydroponics/trays/tray_apiary.dm b/code/modules/hydroponics/trays/tray_apiary.dm
index 25a2698d274..9ecf2bcb2fc 100644
--- a/code/modules/hydroponics/trays/tray_apiary.dm
+++ b/code/modules/hydroponics/trays/tray_apiary.dm
@@ -36,7 +36,7 @@
if(!yieldmod)
yieldmod += 1
// to_chat(world, "Yield increased by 1, from 0, to a total of [myseed.yield]")
- else if (prob(1/(yieldmod * yieldmod) *100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
+ else if(prob(1/(yieldmod * yieldmod) *100))//This formula gives you diminishing returns based on yield. 100% with 1 yield, decreasing to 25%, 11%, 6, 4, 2...
yieldmod += 1
// to_chat(world, "Yield increased by 1, to a total of [myseed.yield]")
else
diff --git a/code/modules/hydroponics/trays/tray_process.dm b/code/modules/hydroponics/trays/tray_process.dm
index 855d053008c..03568731dc5 100644
--- a/code/modules/hydroponics/trays/tray_process.dm
+++ b/code/modules/hydroponics/trays/tray_process.dm
@@ -21,10 +21,11 @@
// Bonus chance if the tray is unoccupied.
if(waterlevel > 10 && nutrilevel > 2 && prob(isnull(seed) ? 6 : 3))
weedlevel += 1 * HYDRO_SPEED_MULTIPLIER
+ plant_hud_set_weed()
// There's a chance for a weed explosion to happen if the weeds take over.
// Plants that are themselves weeds (weed_tolerance > 10) are unaffected.
- if (weedlevel >= 10 && prob(10))
+ if(weedlevel >= 10 && prob(10))
if(!seed || weedlevel >= seed.get_trait(TRAIT_WEED_TOLERANCE))
weed_invasion()
@@ -48,8 +49,10 @@
// Maintain tray nutrient and water levels.
if(seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) > 0 && nutrilevel > 0 && prob(25))
nutrilevel -= max(0,seed.get_trait(TRAIT_NUTRIENT_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER)
+ plant_hud_set_nutrient()
if(seed.get_trait(TRAIT_WATER_CONSUMPTION) > 0 && waterlevel > 0 && prob(25))
waterlevel -= max(0,seed.get_trait(TRAIT_WATER_CONSUMPTION) * HYDRO_SPEED_MULTIPLIER)
+ plant_hud_set_water()
// Make sure the plant is not starving or thirsty. Adequate
// water and nutrients will cause a plant to become healthier.
@@ -81,7 +84,7 @@
T.air_update_turf()
// If we're attached to a pipenet, then we should let the pipenet know we might have modified some gasses
- if (closed_system && connected_port)
+ if(closed_system && connected_port)
connected_port.parent.update = 1
// Toxin levels beyond the plant's tolerance cause damage, but
@@ -91,6 +94,7 @@
if(toxins > seed.get_trait(TRAIT_TOXINS_TOLERANCE))
health -= toxin_uptake
toxins -= toxin_uptake
+ plant_hud_set_toxin()
// Check for pests and weeds.
// Some carnivorous plants happily eat pests.
@@ -98,16 +102,18 @@
if(seed.get_trait(TRAIT_CARNIVOROUS))
health += HYDRO_SPEED_MULTIPLIER
pestlevel -= HYDRO_SPEED_MULTIPLIER
- else if (pestlevel >= seed.get_trait(TRAIT_PEST_TOLERANCE))
+ else if(pestlevel >= seed.get_trait(TRAIT_PEST_TOLERANCE))
health -= HYDRO_SPEED_MULTIPLIER
+ plant_hud_set_pest()
// Some plants thrive and live off of weeds.
if(weedlevel > 0)
if(seed.get_trait(TRAIT_PARASITE))
health += HYDRO_SPEED_MULTIPLIER
weedlevel -= HYDRO_SPEED_MULTIPLIER
- else if (weedlevel >= seed.get_trait(TRAIT_WEED_TOLERANCE))
+ else if(weedlevel >= seed.get_trait(TRAIT_WEED_TOLERANCE))
health -= HYDRO_SPEED_MULTIPLIER
+ plant_hud_set_weed()
// Handle life and death.
// If the plant gets too old, begin killing it each cycle
diff --git a/code/modules/hydroponics/trays/tray_reagents.dm b/code/modules/hydroponics/trays/tray_reagents.dm
index 8f7e4f5e836..e4f68e6d106 100644
--- a/code/modules/hydroponics/trays/tray_reagents.dm
+++ b/code/modules/hydroponics/trays/tray_reagents.dm
@@ -11,7 +11,7 @@
var/reagent_total = reagents.get_reagent_amount(R.id)
- //These are here because they have checks that would clutter up the switch statement cases, and thus get handled after the switch (readability)
+ //These are here because they have checks that would clutter up the switch statement cases, and thus get handled after the switch(readability)
var/water_value = 0
var/health_value = 0
var/production_stat_value = 0
diff --git a/code/modules/hydroponics/trays/tray_tools.dm b/code/modules/hydroponics/trays/tray_tools.dm
index 9cb59b4f296..b1ee10cc075 100644
--- a/code/modules/hydroponics/trays/tray_tools.dm
+++ b/code/modules/hydroponics/trays/tray_tools.dm
@@ -313,7 +313,7 @@
throw_range = 3
w_class = 4
var/extend = 1
- flags = NOSHIELD | CONDUCT
+ flags = CONDUCT
armour_penetration = 20
slot_flags = SLOT_BACK
origin_tech = "materials=2;combat=2"
@@ -337,9 +337,8 @@
edge = 0
throw_speed = 2
throw_range = 3
- w_class = 2.0
+ w_class = 2
extend = 0
- flags = NOSHIELD
armour_penetration = 20
slot_flags = SLOT_BELT
origin_tech = "materials=3;combat=3"
@@ -375,7 +374,7 @@
H.update_inv_l_hand()
H.update_inv_r_hand()
add_fingerprint(user)
- if (!blood_DNA) return
+ if(!blood_DNA) return
if(blood_overlay && (blood_DNA.len >= 1)) //updates blood overlay, if any
overlays.Cut()//this might delete other item overlays as well but eeeeeeeh
@@ -398,7 +397,7 @@
anchored = 0.0
var/matter = 0
var/mode = 1
- w_class = 3.0
+ w_class = 3
/obj/item/weapon/bananapeel
name = "banana peel"
@@ -406,7 +405,7 @@
icon = 'icons/obj/items.dmi'
icon_state = "banana_peel"
item_state = "banana_peel"
- w_class = 1.0
+ w_class = 1
throwforce = 0
throw_speed = 4
throw_range = 20
@@ -417,7 +416,7 @@
icon = 'icons/obj/harvest.dmi'
icon_state = "corncob"
item_state = "corncob"
- w_class = 1.0
+ w_class = 1
throwforce = 0
throw_speed = 4
throw_range = 20
diff --git a/code/modules/karma/karma.dm b/code/modules/karma/karma.dm
index 9c40f005a21..fa765fd244b 100644
--- a/code/modules/karma/karma.dm
+++ b/code/modules/karma/karma.dm
@@ -182,7 +182,7 @@ You've gained [totalkarma] total karma in your time here. "}
dat += ""
switch(karma_tab)
- if (0) // Job Unlocks
+ if(0) // Job Unlocks
dat += {"
Unlock Barber -- 5KP Unlock Brig Physician -- 5KP
@@ -193,7 +193,7 @@ You've gained [totalkarma] total karma in your time here. "}
Unlock Magistrate -- 45KP
"}
- if (1) // Species Unlocks
+ if(1) // Species Unlocks
dat += {"
Unlock Machine People -- 15KP Unlock Kidan -- 30KP
@@ -204,7 +204,7 @@ You've gained [totalkarma] total karma in your time here. "}
Unlock Plasmaman -- 100KP
"}
- if (2) // Karma Refunds
+ if(2) // Karma Refunds
var/list/refundable = list()
var/list/purchased = checkpurchased()
if("Tajaran Ambassador" in purchased)
diff --git a/code/modules/library/computers/base.dm b/code/modules/library/computers/base.dm
index b24c7e7dbbf..360cda83d74 100644
--- a/code/modules/library/computers/base.dm
+++ b/code/modules/library/computers/base.dm
@@ -19,8 +19,8 @@
if(stat & (BROKEN | NOPOWER))
return 1
- if (!Adjacent(user))
- if (!issilicon(user) && !isobserver(user))
+ if(!Adjacent(user))
+ if(!issilicon(user) && !isobserver(user))
user.unset_machine()
user << browse(null, "window=library")
return 1
diff --git a/code/modules/library/computers/checkout.dm b/code/modules/library/computers/checkout.dm
index 2746aed857e..139b464cf76 100644
--- a/code/modules/library/computers/checkout.dm
+++ b/code/modules/library/computers/checkout.dm
@@ -126,7 +126,7 @@
var/author = CB.author
var/controls = "\[Order\]"
controls += {" \[Flag[CB.flagged ? "ged" : ""]\]"}
- if(check_rights(R_ADMIN, user = user))
+ if(check_rights(R_ADMIN, 0, user = user))
controls += " \[Delete\]"
author += " ([ckey(CB.ckey)]))"
dat += {"
@@ -255,7 +255,6 @@
screenstate = 4
if(href_list["del"])
if(!check_rights(R_ADMIN))
- to_chat(usr, "You aren't an admin, piss off.")
return
var/datum/cachedbook/target = getBookByID(href_list["del"]) // Sanitized in getBookByID
var/ans = alert(usr, "Are you sure you wish to delete \"[target.title]\", by [target.author]? This cannot be undone.", "Library System", "Yes", "No")
@@ -272,7 +271,6 @@
if(href_list["delbyckey"])
if(!check_rights(R_ADMIN))
- to_chat(usr, "You aren't an admin, piss off.")
return
var/tckey = ckey(href_list["delbyckey"])
var/ans = alert(usr,"Are you sure you wish to delete all books by [tckey]? This cannot be undone.", "Library System", "Yes", "No")
@@ -435,7 +433,7 @@
return
if(bibledelay)
- for (var/mob/V in hearers(src))
+ for(var/mob/V in hearers(src))
V.show_message("[src]'s monitor flashes, \"Printer unavailable. Please allow a short time before attempting to print.\"")
else
bibledelay = 1
@@ -456,7 +454,7 @@
return
var/obj/item/weapon/book/B = new newbook.path(loc)
- if (!newbook.programmatic)
+ if(!newbook.programmatic)
B.name = "Book: [newbook.title]"
B.title = newbook.title
B.author = newbook.author
diff --git a/code/modules/library/lib_items.dm b/code/modules/library/lib_items.dm
index f7729af3578..aa7d9ea4607 100644
--- a/code/modules/library/lib_items.dm
+++ b/code/modules/library/lib_items.dm
@@ -20,25 +20,32 @@
opacity = 1
var/health = 50
var/tmp/busy = 0
- var/list/valid_types = list(/obj/item/weapon/book, \
- /obj/item/weapon/tome, \
- /obj/item/weapon/spellbook, \
- /obj/item/weapon/storage/bible)
+ var/list/allowed_books = list(/obj/item/weapon/book, /obj/item/weapon/spellbook, /obj/item/weapon/storage/bible, /obj/item/weapon/tome) //Things allowed in the bookcase
/obj/structure/bookcase/initialize()
+ ..()
for(var/obj/item/I in loc)
- if(is_type_in_list(I, valid_types))
+ if(is_type_in_list(I, allowed_books))
I.forceMove(src)
update_icon()
/obj/structure/bookcase/attackby(obj/O as obj, mob/user as mob, params)
if(busy) //So that you can't mess with it while deconstructing
return 1
- if(is_type_in_list(O, valid_types))
- user.drop_item()
+ if(is_type_in_list(O, allowed_books))
+ if(!user.drop_item())
+ return
O.forceMove(src)
update_icon()
return 1
+ else if(istype(O, /obj/item/weapon/storage/bag/books))
+ var/obj/item/weapon/storage/bag/books/B = O
+ for(var/obj/item/T in B.contents)
+ if(istype(T, /obj/item/weapon/book) || istype(T, /obj/item/weapon/spellbook) || istype(T, /obj/item/weapon/tome) || istype(T, /obj/item/weapon/storage/bible))
+ B.remove_from_storage(T, src)
+ to_chat(user, "You empty [O] into [src].")
+ update_icon()
+ return 1
else if(istype(O, /obj/item/weapon/wrench))
user.visible_message("[user] starts disassembling \the [src].", \
"You start disassembling \the [src].")
@@ -50,8 +57,6 @@
user.visible_message("[user] disassembles \the [src].", \
"You disassemble \the [src].")
busy = 0
- for(var/i = 1 to 5)
- new /obj/item/stack/sheet/wood(get_turf(src))
density = 0
qdel(src)
else
@@ -69,11 +74,8 @@
if("brute")
health -= O.force * 0.75
else
- if (health <= 0)
+ if(health <= 0)
visible_message("The bookcase is smashed apart!")
- new /obj/item/stack/sheet/wood(get_turf(src))
- new /obj/item/stack/sheet/wood(get_turf(src))
- new /obj/item/stack/sheet/wood(get_turf(src))
qdel(src)
return ..()
@@ -109,10 +111,10 @@
return
/obj/structure/bookcase/Destroy()
- for(var/i = 1 to 3)
+ for(var/i in 1 to 5)
new /obj/item/stack/sheet/wood(get_turf(src))
for(var/obj/item/I in contents)
- if(is_type_in_list(I, valid_types))
+ if(is_type_in_list(I, allowed_books))
I.forceMove(get_turf(src))
return ..()
@@ -288,7 +290,7 @@
icon_state ="scanner"
throw_speed = 1
throw_range = 5
- w_class = 1.0
+ w_class = 1
var/obj/machinery/computer/library/checkout/computer // Associated computer - Modes 1 to 3 use this
var/obj/item/weapon/book/book // Currently scanned book
var/mode = 0 // 0 - Scan only, 1 - Scan and Set Buffer, 2 - Scan and Attempt to Check In, 3 - Scan and Attempt to Add to Inventory
diff --git a/code/modules/lighting/lighting_overlay.dm b/code/modules/lighting/lighting_overlay.dm
index f2dede3b8ba..525de63a0af 100644
--- a/code/modules/lighting/lighting_overlay.dm
+++ b/code/modules/lighting/lighting_overlay.dm
@@ -9,6 +9,7 @@
invisibility = INVISIBILITY_LIGHTING
color = "#000000"
icon_state = "light1"
+ auto_init = 0 // doesn't need special init
var/lum_r
var/lum_g
@@ -104,4 +105,4 @@
if(istype(T))
T.lighting_overlay = null
- return ..()
\ No newline at end of file
+ return ..()
diff --git a/code/modules/martial_arts/martial.dm b/code/modules/martial_arts/martial.dm
index d128e22c0f6..0ca98c921d8 100644
--- a/code/modules/martial_arts/martial.dm
+++ b/code/modules/martial_arts/martial.dm
@@ -181,7 +181,7 @@
attack_verb = list("smashed", "slammed", "whacked", "thwacked")
icon = 'icons/obj/weapons.dmi'
icon_state = "bostaff0"
-
+ block_chance = 50
/obj/item/weapon/twohanded/bostaff/update_icon()
icon_state = "bostaff[wielded]"
@@ -239,8 +239,7 @@
return ..()
return ..()
-/obj/item/weapon/twohanded/bostaff/IsShield()
+/obj/item/weapon/twohanded/bostaff/hit_reaction(mob/living/carbon/human/owner, attack_text, final_block_chance)
if(wielded)
- return 1
- else
- return 0
\ No newline at end of file
+ return ..()
+ return 0
\ No newline at end of file
diff --git a/code/modules/media/broadcast/receivers/radio.dm b/code/modules/media/broadcast/receivers/radio.dm
index 7b9c4ad7b15..a0d94dcbf31 100644
--- a/code/modules/media/broadcast/receivers/radio.dm
+++ b/code/modules/media/broadcast/receivers/radio.dm
@@ -8,6 +8,7 @@
var/on=0
/obj/machinery/media/receiver/boombox/initialize()
+ ..()
if(on)
update_on()
update_icon()
@@ -80,4 +81,4 @@
if(on)
icon_state="wallradio-p"
else
- icon_state="wallradio"
\ No newline at end of file
+ icon_state="wallradio"
diff --git a/code/modules/media/broadcast/transmitters/broadcast.dm b/code/modules/media/broadcast/transmitters/broadcast.dm
index d8607851752..898771b496d 100644
--- a/code/modules/media/broadcast/transmitters/broadcast.dm
+++ b/code/modules/media/broadcast/transmitters/broadcast.dm
@@ -19,6 +19,7 @@
var/const/MAX_TEMP=70 // Celsius
/obj/machinery/media/transmitter/broadcast/initialize()
+ ..()
testing("[type]/initialize() called!")
if(autolink && autolink.len)
for(var/obj/machinery/media/source in orange(20, src))
diff --git a/code/modules/media/jukebox.dm b/code/modules/media/jukebox.dm
index 623241ca491..ae33c38dcc4 100644
--- a/code/modules/media/jukebox.dm
+++ b/code/modules/media/jukebox.dm
@@ -183,12 +183,12 @@ var/global/loopModeNames=list(
to_chat(usr, "\red You touch the bluescreened menu. Nothing happens. You feel dumber.")
return
- if (href_list["power"])
+ if(href_list["power"])
playing=!playing
update_music()
update_icon()
- if (href_list["playlist"])
+ if(href_list["playlist"])
if(!check_reload())
to_chat(usr, "\red You must wait 60 seconds between playlist reloads.")
return
@@ -199,12 +199,12 @@ var/global/loopModeNames=list(
update_music()
update_icon()
- if (href_list["song"])
+ if(href_list["song"])
current_song=Clamp(text2num(href_list["song"]),1,playlist.len)
update_music()
update_icon()
- if (href_list["mode"])
+ if(href_list["mode"])
loop_mode = (loop_mode % JUKEMODE_COUNT) + 1
return attack_hand(usr)
diff --git a/code/modules/media/mediamanager.dm b/code/modules/media/mediamanager.dm
index d78afc6f9f2..125b224c8ea 100644
--- a/code/modules/media/mediamanager.dm
+++ b/code/modules/media/mediamanager.dm
@@ -51,26 +51,21 @@ if(vlc.attachEvent) {
"}
// Hook into the events we desire.
-/hook_handler/soundmanager
- // Set up player on login
- proc/OnLogin(var/list/args)
- //testing("Received OnLogin.")
- var/client/C = args["client"]
- C.media = new /datum/media_manager(args["mob"])
- C.media.open()
- spawn(20)
- C.media.update_music()
+/hook/mob_login/proc/init_media_manager(client/client, mob/mob)
+ client.media = new /datum/media_manager(mob)
+ client.media.open()
+ spawn(20)
+ client.media.update_music()
+ return 1
// Update when moving between areas.
- proc/OnMobAreaChange(var/list/args)
- var/mob/M = args["mob"]
- //if(istype(M, /mob/living/carbon/human)||istype(M, /mob/dead/observer))
- // testing("Received OnMobAreaChange for [M.type] [M] (M.client=[M.client==null?"null":"/client"]).")
- if(M.client)
- M.update_music()
+/hook/mob_area_change/proc/update_media(mob/mob, area/newarea, area/oldarea)
+ if(mob.client)
+ mob.update_music()
+ return 1
/mob/proc/update_music()
- if (client && client.media)
+ if(client && client.media)
client.media.update_music()
//else
// testing("[src] - client: [client?"Y":"N"]; client.media: [client && client.media ? "Y":"N"]")
@@ -124,7 +119,7 @@ to_chat(#define MP_DEBUG(x) owner, x)
var/targetURL = ""
var/targetStartTime = 0
- if (!owner)
+ if(!owner)
//testing("owner is null")
return
@@ -141,7 +136,7 @@ to_chat(#define MP_DEBUG(x) owner, x)
//else
// testing("M is not playing or null.")
- if (url != targetURL || abs(targetStartTime - start_time) > 1)
+ if(url != targetURL || abs(targetStartTime - start_time) > 1)
url = targetURL
start_time = targetStartTime
send_update()
diff --git a/code/modules/mining/abandonedcrates.dm b/code/modules/mining/abandonedcrates.dm
index 3e9580ef14b..cd229550880 100644
--- a/code/modules/mining/abandonedcrates.dm
+++ b/code/modules/mining/abandonedcrates.dm
@@ -156,12 +156,12 @@
to_chat(user, "The crate is locked with a Deca-code lock.")
var/input = input(usr, "Enter [codelen] digits.", "Deca-Code Lock", "") as text
if(in_range(src, user))
- if (input == code)
+ if(input == code)
to_chat(user, "The crate unlocks!")
locked = 0
overlays.Cut()
overlays += "securecrateg"
- else if (input == null || length(input) != codelen)
+ else if(input == null || length(input) != codelen)
to_chat(user, "You leave the crate alone.")
else
to_chat(user, "A red light flashes.")
diff --git a/code/modules/mining/alloys.dm b/code/modules/mining/alloys.dm
deleted file mode 100644
index ce29725d87a..00000000000
--- a/code/modules/mining/alloys.dm
+++ /dev/null
@@ -1,27 +0,0 @@
-//Alloys that contain subsets of each other's ingredients must be ordered in the desired sequence
-//eg. steel comes after plasteel because plasteel's ingredients contain the ingredients for steel and
-//it would be impossible to produce.
-
-/datum/alloy
- var/list/requires
- var/product_mod = 1
- var/product
- var/metaltag
-
-/datum/alloy/plasteel
- metaltag = "plasteel"
- requires = list(
- "platinum" = 1,
- "coal" = 2,
- "hematite" = 2
- )
- product_mod = 0.3
- product = /obj/item/stack/sheet/plasteel
-
-/datum/alloy/steel
- metaltag = "steel"
- requires = list(
- "coal" = 1,
- "hematite" = 1
- )
- product = /obj/item/stack/sheet/metal
\ No newline at end of file
diff --git a/code/modules/mining/coins.dm b/code/modules/mining/coins.dm
index a8ac5e1a88c..83f9c871f44 100644
--- a/code/modules/mining/coins.dm
+++ b/code/modules/mining/coins.dm
@@ -7,7 +7,7 @@
flags = CONDUCT
force = 1
throwforce = 2
- w_class = 1.0
+ w_class = 1
var/string_attached
var/list/sideslist = list("heads","tails")
var/cmineral = null
@@ -105,7 +105,7 @@
to_chat(user, "There already is a string attached to this coin.")
return
- if (CC.use(1))
+ if(CC.use(1))
overlays += image('icons/obj/items.dmi',"coin_string_overlay")
string_attached = 1
to_chat(user, "You attach a string to the coin.")
diff --git a/code/modules/mining/equipment_locker.dm b/code/modules/mining/equipment_locker.dm
index 148ea595f04..d3a65e3c0bf 100644
--- a/code/modules/mining/equipment_locker.dm
+++ b/code/modules/mining/equipment_locker.dm
@@ -19,7 +19,7 @@
var/ore_pickup_rate = 15
var/sheet_per_ore = 1
var/point_upgrade = 1
- var/list/ore_values = list(("sand" = 1), ("iron" = 1), ("plasma" = 15), ("silver" = 16), ("gold" = 18), ("uranium" = 30), ("diamond" = 50), ("bananium" = 60), ("tranquillite" = 60))
+ var/list/ore_values = list(("sand" = 1), ("iron" = 1), ("plasma" = 15), ("silver" = 16), ("gold" = 18), ("uranium" = 30), ("diamond" = 50), ("bluespace crystal" = 50), ("bananium" = 60), ("tranquillite" = 60))
var/list/supply_consoles = list("Science", "Robotics", "Research Director's Desk", "Mechanic", "Engineering" = list("metal", "glass", "plasma"), "Chief Engineer's Desk" = list("metal", "glass", "plasma"), "Atmospherics" = list("metal", "glass", "plasma"), "Bar" = list("uranium", "plasma"), "Virology" = list("plasma", "uranium", "gold"))
/obj/machinery/mineral/ore_redemption/New()
@@ -84,9 +84,9 @@
var/i = 0
if(T)
for(var/obj/item/weapon/ore/O in T)
- if (i >= ore_pickup_rate)
+ if(i >= ore_pickup_rate)
break
- else if (!O || !O.refined_type)
+ else if(!O || !O.refined_type)
continue
else
process_sheet(O)
@@ -95,16 +95,16 @@
var/obj/structure/ore_box/B = locate() in T
if(B)
for(var/obj/item/weapon/ore/O in B.contents)
- if (i >= ore_pickup_rate)
+ if(i >= ore_pickup_rate)
break
- else if (!O || !O.refined_type)
+ else if(!O || !O.refined_type)
continue
else
process_sheet(O)
i++
/obj/machinery/mineral/ore_redemption/attackby(var/obj/item/weapon/W, var/mob/user, params)
- if (!powered())
+ if(!powered())
return
if(istype(W,/obj/item/weapon/card/id))
var/obj/item/weapon/card/id/I = usr.get_active_hand()
@@ -425,7 +425,7 @@
if(href_list["purchase"])
if(istype(inserted_id))
var/datum/data/mining_equipment/prize = locate(href_list["purchase"])
- if (!prize || !(prize in prize_list))
+ if(!prize || !(prize in prize_list))
return
if(prize.cost > inserted_id.mining_points)
else
@@ -521,7 +521,7 @@
icon_state = "Jaunter"
item_state = "electronic"
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 5
origin_tech = "bluespace=2"
@@ -677,7 +677,7 @@
/obj/item/weapon/mining_drone_cube
name = "mining drone cube"
desc = "Compressed mining drone, ready for deployment. Just press the button to activate!"
- w_class = 2.0
+ w_class = 2
icon = 'icons/obj/aibots.dmi'
icon_state = "minedronecube"
item_state = "electronic"
@@ -902,7 +902,7 @@
icon_state = "lazarus_hypo"
item_state = "hypo"
throwforce = 0
- w_class = 2.0
+ w_class = 2
throw_speed = 3
throw_range = 5
var/loaded = 1
@@ -958,14 +958,15 @@
/**********************Mining Scanner**********************/
/obj/item/device/mining_scanner
- desc = "A scanner that checks surrounding rock for useful minerals, it can also be used to stop gibtonite detonations. Requires you to wear mesons to work properly."
- name = "mining scanner"
+ desc = "A scanner that checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear material scanners for optimal results."
+ name = "manual mining scanner"
icon_state = "mining1"
item_state = "analyzer"
- w_class = 2.0
+ w_class = 2
flags = CONDUCT
slot_flags = SLOT_BELT
var/cooldown = 0
+ origin_tech = "engineering=1;magnets=1"
/obj/item/device/mining_scanner/attack_self(mob/user)
if(!user.client)
@@ -989,29 +990,51 @@
qdel(src)
/obj/item/device/t_scanner/adv_mining_scanner
- desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Requires you to wear mesons to function properly."
- name = "advanced mining scanner"
+ desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear meson scanners for optimal results. This one has an extended range."
+ name = "advanced automatic mining scanner"
icon_state = "mining0"
item_state = "analyzer"
- w_class = 2.0
+ w_class = 2
flags = CONDUCT
slot_flags = SLOT_BELT
- var/cooldown = 0
+ var/cooldown = 35
+ var/on_cooldown = 0
+ var/range = 7
+ var/meson = TRUE
+ origin_tech = "engineering=3;magnets=3"
/obj/item/device/t_scanner/adv_mining_scanner/cyborg
flags = CONDUCT | NODROP
+/obj/item/device/t_scanner/adv_mining_scanner/material
+ meson = FALSE
+ desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear material scanners for optimal results. This one has an extended range."
+
+/obj/item/device/t_scanner/adv_mining_scanner/lesser
+ name = "automatic mining scanner"
+ desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear meson scanners for optimal results."
+ range = 4
+ cooldown = 50
+
+/obj/item/device/t_scanner/adv_mining_scanner/lesser/material
+ desc = "A scanner that automatically checks surrounding rock for useful minerals; it can also be used to stop gibtonite detonations. Wear material scanners for optimal results."
+ meson = FALSE
+
/obj/item/device/t_scanner/adv_mining_scanner/scan()
- if(!cooldown)
- cooldown = 1
- spawn(35)
- cooldown = 0
+ if(!on_cooldown)
+ on_cooldown = 1
+ spawn(cooldown)
+ on_cooldown = 0
var/turf/t = get_turf(src)
var/list/mobs = recursive_mob_check(t, client_check = 1, sight_check = 0, include_radio = 0)
if(!mobs.len)
return
- mineral_scan_pulse(mobs, t)
+ if(meson)
+ mineral_scan_pulse(mobs, t, range)
+ else
+ mineral_scan_pulse_material(mobs, t, range)
+//For use with mesons
/proc/mineral_scan_pulse(list/mobs, turf/T, range = world.view)
var/list/minerals = list()
for(var/turf/simulated/mineral/M in range(range, T))
@@ -1029,6 +1052,26 @@
if(C)
C.images -= I
+//For use with material scanners
+/proc/mineral_scan_pulse_material(list/mobs, turf/T, range = world.view)
+ var/list/minerals = list()
+ for(var/turf/simulated/mineral/M in range(range, T))
+ if(M.scan_state)
+ minerals += M
+ if(minerals.len)
+ for(var/turf/simulated/mineral/M in minerals)
+ var/obj/effect/overlay/temp/mining_overlay/C = new/obj/effect/overlay/temp/mining_overlay(M)
+ C.icon_state = M.scan_state
+
+/obj/effect/overlay/temp/mining_overlay
+ layer = 18
+ icon = 'icons/turf/mining.dmi'
+ anchored = 1
+ mouse_opacity = 0
+ duration = 30
+ pixel_x = -4
+ pixel_y = -4
+
/**********************Xeno Warning Sign**********************/
/obj/structure/sign/xeno_warning_mining
name = "DANGEROUS ALIEN LIFE"
diff --git a/code/modules/mining/laborcamp/laborstacker.dm b/code/modules/mining/laborcamp/laborstacker.dm
index 47c9c45dbc3..ce6dcc15eb1 100644
--- a/code/modules/mining/laborcamp/laborstacker.dm
+++ b/code/modules/mining/laborcamp/laborstacker.dm
@@ -28,7 +28,7 @@
t = d.id_tag
if(t == src.door_tag)
src.release_door = d
- if (machine && (release_door || !use_release_door))
+ if(machine && (release_door || !use_release_door))
machine.CONSOLE = src
else
qdel(src)
diff --git a/code/modules/mining/machine_processing.dm b/code/modules/mining/machine_processing.dm
index b83a2001bb0..23bf8ab532f 100644
--- a/code/modules/mining/machine_processing.dm
+++ b/code/modules/mining/machine_processing.dm
@@ -13,7 +13,7 @@
..()
spawn(7)
src.machine = locate(/obj/machinery/mineral/processing_unit, get_step(src, machinedir))
- if (machine)
+ if(machine)
machine.CONSOLE = src
else
qdel(src)
@@ -24,7 +24,7 @@
//iron
if(machine.ore_iron || machine.ore_glass || machine.ore_plasma || machine.ore_uranium || machine.ore_gold || machine.ore_silver || machine.ore_diamond || machine.ore_clown || machine.ore_mime || machine.ore_adamantine)
if(machine.ore_iron)
- if (machine.selected_iron==1)
+ if(machine.selected_iron==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -34,7 +34,7 @@
//sand - glass
if(machine.ore_glass)
- if (machine.selected_glass==1)
+ if(machine.selected_glass==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -44,7 +44,7 @@
//plasma
if(machine.ore_plasma)
- if (machine.selected_plasma==1)
+ if(machine.selected_plasma==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -54,7 +54,7 @@
//uranium
if(machine.ore_uranium)
- if (machine.selected_uranium==1)
+ if(machine.selected_uranium==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -64,7 +64,7 @@
//gold
if(machine.ore_gold)
- if (machine.selected_gold==1)
+ if(machine.selected_gold==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -74,7 +74,7 @@
//silver
if(machine.ore_silver)
- if (machine.selected_silver==1)
+ if(machine.selected_silver==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -84,7 +84,7 @@
//diamond
if(machine.ore_diamond)
- if (machine.selected_diamond==1)
+ if(machine.selected_diamond==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -94,7 +94,7 @@
//bananium
if(machine.ore_clown)
- if (machine.selected_clown==1)
+ if(machine.selected_clown==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -104,7 +104,7 @@
//tranquillite
if(machine.ore_mime)
- if (machine.selected_mime==1)
+ if(machine.selected_mime==1)
dat += text("Smelting ")
else
dat += text("Not smelting ")
@@ -115,7 +115,7 @@
//On or off
dat += text("Machine is currently ")
- if (machine.on==1)
+ if(machine.on==1)
dat += text("On ")
else
dat += text("Off ")
@@ -131,52 +131,52 @@
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["sel_iron"])
- if (href_list["sel_iron"] == "yes")
+ if(href_list["sel_iron"] == "yes")
machine.selected_iron = 1
else
machine.selected_iron = 0
if(href_list["sel_glass"])
- if (href_list["sel_glass"] == "yes")
+ if(href_list["sel_glass"] == "yes")
machine.selected_glass = 1
else
machine.selected_glass = 0
if(href_list["sel_plasma"])
- if (href_list["sel_plasma"] == "yes")
+ if(href_list["sel_plasma"] == "yes")
machine.selected_plasma = 1
else
machine.selected_plasma = 0
if(href_list["sel_uranium"])
- if (href_list["sel_uranium"] == "yes")
+ if(href_list["sel_uranium"] == "yes")
machine.selected_uranium = 1
else
machine.selected_uranium = 0
if(href_list["sel_gold"])
- if (href_list["sel_gold"] == "yes")
+ if(href_list["sel_gold"] == "yes")
machine.selected_gold = 1
else
machine.selected_gold = 0
if(href_list["sel_silver"])
- if (href_list["sel_silver"] == "yes")
+ if(href_list["sel_silver"] == "yes")
machine.selected_silver = 1
else
machine.selected_silver = 0
if(href_list["sel_diamond"])
- if (href_list["sel_diamond"] == "yes")
+ if(href_list["sel_diamond"] == "yes")
machine.selected_diamond = 1
else
machine.selected_diamond = 0
if(href_list["sel_clown"])
- if (href_list["sel_clown"] == "yes")
+ if(href_list["sel_clown"] == "yes")
machine.selected_clown = 1
else
machine.selected_clown = 0
if(href_list["sel_mime"])
- if (href_list["sel_mime"] == "yes")
+ if(href_list["sel_mime"] == "yes")
machine.selected_mime = 1
else
machine.selected_mime = 0
if(href_list["set_on"])
- if (href_list["set_on"] == "on")
+ if(href_list["set_on"] == "on")
machine.on = 1
else
machine.on = 0
@@ -216,82 +216,82 @@
/obj/machinery/mineral/processing_unit/process()
var/i
- for (i = 0; i < 10; i++)
- if (on)
- if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_glass > 0)
+ for(i = 0; i < 10; i++)
+ if(on)
+ if(selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_glass > 0)
ore_glass--;
generate_mineral(/obj/item/stack/sheet/glass)
else
on = 0
continue
- if (selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
- if (ore_glass > 0 && ore_iron > 0)
+ if(selected_glass == 1 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
+ if(ore_glass > 0 && ore_iron > 0)
ore_glass--;
ore_iron--;
generate_mineral(/obj/item/stack/sheet/rglass)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 1 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_gold > 0)
+ if(selected_glass == 0 && selected_gold == 1 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_gold > 0)
ore_gold--;
generate_mineral(/obj/item/stack/sheet/mineral/gold)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_silver > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_silver > 0)
ore_silver--;
generate_mineral(/obj/item/stack/sheet/mineral/silver)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_diamond > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_diamond > 0)
ore_diamond--;
generate_mineral(/obj/item/stack/sheet/mineral/diamond)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_plasma > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_plasma > 0)
ore_plasma--;
generate_mineral(/obj/item/stack/sheet/mineral/plasma)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_uranium > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_uranium > 0)
ore_uranium--;
generate_mineral(/obj/item/stack/sheet/mineral/uranium)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
- if (ore_iron > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
+ if(ore_iron > 0)
ore_iron--;
generate_mineral(/obj/item/stack/sheet/metal)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
- if (ore_iron > 0 && ore_plasma > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 1 && selected_clown == 0 && selected_mime == 0)
+ if(ore_iron > 0 && ore_plasma > 0)
ore_iron--;
ore_plasma--;
generate_mineral(/obj/item/stack/sheet/plasteel)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 1 && selected_mime == 0)
- if (ore_clown > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 1 && selected_mime == 0)
+ if(ore_clown > 0)
ore_clown--;
generate_mineral(/obj/item/stack/sheet/mineral/bananium)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 1)
- if (ore_mime > 0)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 0 && selected_plasma == 0 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 1)
+ if(ore_mime > 0)
ore_mime--;
generate_mineral(/obj/item/stack/sheet/mineral/tranquillite)
else
@@ -299,16 +299,16 @@
continue
//THESE TWO ARE CODED FOR URIST TO USE WHEN HE GETS AROUND TO IT.
//They were coded on 18 Feb 2012. If you're reading this in 2015, then firstly congratulations on the world not ending on 21 Dec 2012 and secondly, Urist is apparently VERY lazy. ~Errorage
- /*if (selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_uranium >= 2 && ore_diamond >= 1)
+ /*if(selected_glass == 0 && selected_gold == 0 && selected_silver == 0 && selected_diamond == 1 && selected_plasma == 0 && selected_uranium == 1 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_uranium >= 2 && ore_diamond >= 1)
ore_uranium -= 2
ore_diamond -= 1
generate_mineral(/obj/item/stack/sheet/mineral/adamantine)
else
on = 0
continue
- if (selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
- if (ore_silver >= 1 && ore_plasma >= 3)
+ if(selected_glass == 0 && selected_gold == 0 && selected_silver == 1 && selected_diamond == 0 && selected_plasma == 1 && selected_uranium == 0 && selected_iron == 0 && selected_clown == 0 && selected_mime == 0)
+ if(ore_silver >= 1 && ore_plasma >= 3)
ore_silver -= 1
ore_plasma -= 3
generate_mineral(/obj/item/stack/sheet/mineral/mythril)
@@ -321,53 +321,53 @@
var/b = 1 //this part checks if all required ores are available
- if (!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
+ if(!(selected_gold || selected_silver ||selected_diamond || selected_uranium | selected_plasma || selected_iron || selected_iron))
b = 0
- if (selected_gold == 1)
- if (ore_gold <= 0)
+ if(selected_gold == 1)
+ if(ore_gold <= 0)
b = 0
- if (selected_silver == 1)
- if (ore_silver <= 0)
+ if(selected_silver == 1)
+ if(ore_silver <= 0)
b = 0
- if (selected_diamond == 1)
- if (ore_diamond <= 0)
+ if(selected_diamond == 1)
+ if(ore_diamond <= 0)
b = 0
- if (selected_uranium == 1)
- if (ore_uranium <= 0)
+ if(selected_uranium == 1)
+ if(ore_uranium <= 0)
b = 0
- if (selected_plasma == 1)
- if (ore_plasma <= 0)
+ if(selected_plasma == 1)
+ if(ore_plasma <= 0)
b = 0
- if (selected_iron == 1)
- if (ore_iron <= 0)
+ if(selected_iron == 1)
+ if(ore_iron <= 0)
b = 0
- if (selected_glass == 1)
- if (ore_glass <= 0)
+ if(selected_glass == 1)
+ if(ore_glass <= 0)
b = 0
- if (selected_clown == 1)
- if (ore_clown <= 0)
+ if(selected_clown == 1)
+ if(ore_clown <= 0)
b = 0
- if (selected_mime == 1)
- if (ore_mime <= 0)
+ if(selected_mime == 1)
+ if(ore_mime <= 0)
b = 0
- if (b) //if they are, deduct one from each, produce slag and shut the machine off
- if (selected_gold == 1)
+ if(b) //if they are, deduct one from each, produce slag and shut the machine off
+ if(selected_gold == 1)
ore_gold--
- if (selected_silver == 1)
+ if(selected_silver == 1)
ore_silver--
- if (selected_diamond == 1)
+ if(selected_diamond == 1)
ore_diamond--
- if (selected_uranium == 1)
+ if(selected_uranium == 1)
ore_uranium--
- if (selected_plasma == 1)
+ if(selected_plasma == 1)
ore_plasma--
- if (selected_iron == 1)
+ if(selected_iron == 1)
ore_iron--
- if (selected_clown == 1)
+ if(selected_clown == 1)
ore_clown--
- if (selected_mime == 1)
+ if(selected_mime == 1)
ore_mime--
generate_mineral(/obj/item/weapon/ore/slag)
on = 0
@@ -384,39 +384,39 @@
n++
if(n>10)
break
- if (istype(O,/obj/item/weapon/ore/iron))
+ if(istype(O,/obj/item/weapon/ore/iron))
ore_iron++;
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/glass))
+ if(istype(O,/obj/item/weapon/ore/glass))
ore_glass++;
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/diamond))
+ if(istype(O,/obj/item/weapon/ore/diamond))
ore_diamond++;
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/plasma))
+ if(istype(O,/obj/item/weapon/ore/plasma))
ore_plasma++
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/gold))
+ if(istype(O,/obj/item/weapon/ore/gold))
ore_gold++
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/silver))
+ if(istype(O,/obj/item/weapon/ore/silver))
ore_silver++
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/uranium))
+ if(istype(O,/obj/item/weapon/ore/uranium))
ore_uranium++
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/bananium))
+ if(istype(O,/obj/item/weapon/ore/bananium))
ore_clown++
O.loc = null
continue
- if (istype(O,/obj/item/weapon/ore/tranquillite))
+ if(istype(O,/obj/item/weapon/ore/tranquillite))
ore_mime++
O.loc = null
continue
diff --git a/code/modules/mining/machine_stacking.dm b/code/modules/mining/machine_stacking.dm
index 5f315648c10..44d7b037869 100644
--- a/code/modules/mining/machine_stacking.dm
+++ b/code/modules/mining/machine_stacking.dm
@@ -13,7 +13,7 @@
..()
spawn(7)
src.machine = locate(/obj/machinery/mineral/stacking_machine, get_step(src, machinedir))
- if (machine)
+ if(machine)
machine.CONSOLE = src
else
qdel(src)
diff --git a/code/modules/mining/machine_unloading.dm b/code/modules/mining/machine_unloading.dm
index 5ae7f376cb0..5214c8caec8 100644
--- a/code/modules/mining/machine_unloading.dm
+++ b/code/modules/mining/machine_unloading.dm
@@ -15,14 +15,14 @@
if(T)
var/limit
for(var/obj/structure/ore_box/B in T)
- for (var/obj/item/weapon/ore/O in B)
+ for(var/obj/item/weapon/ore/O in B)
B.contents -= O
unload_mineral(O)
limit++
- if (limit>=10)
+ if(limit>=10)
return
for(var/obj/item/I in T)
unload_mineral(I)
limit++
- if (limit>=10)
+ if(limit>=10)
return
\ No newline at end of file
diff --git a/code/modules/mining/manufacturing.dm b/code/modules/mining/manufacturing.dm
deleted file mode 100644
index 429b0ee42bc..00000000000
--- a/code/modules/mining/manufacturing.dm
+++ /dev/null
@@ -1,1135 +0,0 @@
-// the entire manufacturing.dm
-
-/datum/manufacture
- var/name = null
- var/item = null
- var/cost1 = null
- var/cost2 = null
- var/cost3 = null
- var/cname1 = null
- var/cname2 = null
- var/cname3 = null
- var/amount1 = 0
- var/amount2 = 0
- var/amount3 = 0
- var/create = 1
- var/time = 5
-
-/obj/machinery/manufacturer
- name = "Manufacturing Unit"
- desc = "A standard fabricator unit capable of producing certain items from mined ore."
- icon = 'icons/obj/surgery.dmi'
- icon_state = "fab-idle"
- density = 1
- anchored = 1
- //mats = 25
- var/working = 0
- var/panelopen = 0
- var/powconsumption = 0
- var/hacked = 0
- var/acceptdisk = 0
- var/dl_list = null
- var/list/available = list()
- var/list/diskload = list()
- var/list/download = list()
- var/list/hidden = list()
-
- New()
- ..()
-
- process()
- ..()
- if (src.working) use_power(src.powconsumption)
-
- ex_act(severity)
- switch(severity)
- if(1.0) qdel(src)
- if(2.0)
- if (prob(60)) stat |= BROKEN
- if(3.0)
- if (prob(30)) stat |= BROKEN
- return
-
- blob_act()
- if (prob(25)) del src
- return
-
- power_change()
- if(stat & BROKEN) icon_state = "fab-broken"
- else
- if( powered() )
- if (src.working) src.icon_state = "fab-active"
- else src.icon_state = "fab-idle"
- stat &= ~NOPOWER
- else
- spawn(rand(0, 15))
- src.icon_state = "fab-off"
- stat |= NOPOWER
-
- attack_hand(var/mob/user as mob)
- if(stat & BROKEN) return
- if(stat & NOPOWER) return
-
- user.machine = src
- var/dat = "[src.name] "
-
- if(src.working)
- dat += "This unit is currently busy."
- user << browse(dat, "window=manufact;size=400x500")
- onclose(user, "manufact")
- return
-
- var/AMTmaux = 0
- var/AMTmoli = 0
- var/AMTphar = 0
- var/AMTclar = 0
- var/AMTbohr = 0
- var/AMTereb = 0
- var/AMTcere = 0
- var/AMTplas = 0
- var/AMTuqil = 0
- var/AMTtele = 0
- var/AMTfabr = 0
-
- for(var/obj/item/weapon/ore/O in src.contents)
- if (istype(O,/obj/item/weapon/ore/iron)) AMTmaux++
- if (istype(O,/obj/item/weapon/ore/glass)) AMTmoli++
- if (istype(O,/obj/item/weapon/ore/silver)) AMTphar++
- if (istype(O,/obj/item/weapon/ore/diamond)) AMTclar++
- if (istype(O,/obj/item/weapon/ore/gold)) AMTbohr++
- if (istype(O,/obj/item/weapon/ore/coal)) AMTereb++
- if (istype(O,/obj/item/weapon/ore/uranium)) AMTcere++
- if (istype(O,/obj/item/weapon/ore/plasma)) AMTplas++
- if (istype(O,/obj/item/weapon/ore/osmium)) AMTuqil++
- if (istype(O,/obj/item/weapon/ore/hydrogen)) AMTtele++
- if (istype(O,/obj/item/weapon/ore/fabric)) AMTfabr++
-
- dat += "Available Minerals "
- if (AMTmaux) dat += "Iron: [AMTmaux] "
- if (AMTmoli) dat += "Glass: [AMTmoli] "
- if (AMTphar) dat += "Silver: [AMTphar] "
- if (AMTclar) dat += "Diamond: [AMTclar] "
- if (AMTbohr) dat += "Gold: [AMTbohr] "
- if (AMTereb) dat += "Coal: [AMTereb] "
- if (AMTcere) dat += "Uranium: [AMTcere] "
- if (AMTplas) dat += "Plasma: [AMTplas] "
- if (AMTuqil) dat += "Platinum: [AMTuqil] "
- if (AMTtele) dat += "Hydrogen: [AMTtele] "
- if (AMTfabr) dat += "Fabric: [AMTfabr] "
- if (!AMTmaux && !AMTmoli && !AMTphar && !AMTclar && !AMTbohr && !AMTereb && !AMTcere && !AMTplas && !AMTuqil && !AMTtele && !AMTfabr)
- dat += "No minerals currently loaded. "
-
- dat += {"
- Available Schematics"}
-
- for(var/datum/manufacture/A in src.available)
- dat += {"
- [A.name]
- Cost: [A.amount1] [A.cname1]"}
- if (A.cost2) dat += ", [A.amount2] [A.cname2]"
- if (A.cost3) dat += ", [A.amount3] [A.cname3]"
- dat += " Time: [A.time] Seconds "
-
- for(var/datum/manufacture/A in src.download)
- dat += {"
- [A.name] (Downloaded)
- Cost: [A.amount1] [A.cname1]"}
- if (A.cost2) dat += ", [A.amount2] [A.cname2]"
- if (A.cost3) dat += ", [A.amount3] [A.cname3]"
- dat += " Time: [A.time] Seconds "
-
- for(var/datum/manufacture/A in src.diskload)
- dat += {"
- [A.name] (Disk)
- Cost: [A.amount1] [A.cname1]"}
- if (A.cost2) dat += ", [A.amount2] [A.cname2]"
- if (A.cost3) dat += ", [A.amount3] [A.cname3]"
- dat += " Time: [A.time] Seconds "
-
- if (src.hacked)
- for(var/datum/manufacture/A in src.hidden)
- dat += {"
- [A.name] (Secret)
- Cost: [A.amount1] [A.cname1]"}
- if (A.cost2) dat += ", [A.amount2] [A.cname2]"
- if (A.cost3) dat += ", [A.amount3] [A.cname3]"
- dat += " Time: [A.time] Seconds "
-
- dat += ""
-
- if (src.dl_list)
- dat += {"Download Available Schematics
- Clear Downloaded Schematics "}
-
- if (src.acceptdisk)
- dat += {"Clear Disk Schematics "}
-
- user << browse(dat, "window=manufact;size=400x500")
- onclose(user, "manufact")
-
- Topic(href, href_list)
- if(stat & BROKEN) return
- if(stat & NOPOWER) return
- if(usr.stat || usr.restrained())
- return
-
- if ((usr.contents.Find(src) || ((get_dist(src, usr) <= 1) && istype(src.loc, /turf))))
- usr.machine = src
-
- if (href_list["download"])
- to_chat(if(!src.dl_list) usr, "\red This unit is not capable of downloading any additional schematics.")
- else
- var/amtdl = 0
- //var/dontload = 0
- if (src.dl_list == "robotics")
- /*for(var/i = robotics_research.starting_tier, i <= robotics_research.max_tiers, i++)
- for(var/datum/roboresearch/X in robotics_research.researched_items[i])
- for (var/datum/manufacture/S in X.schematics)
- for (var/datum/manufacture/A in src.download)
- if (istype(S,A)) dontload = 1
- if (!dontload)
- src.download += new S.type(src)
- amtdl++
- else dontload = 0*/
- to_chat(if (amtdl) usr, "\blue [amtdl] new schematics downloaded from Robotics Research Database.")
- to_chat(else usr, "\red No new schematics currently available in Robotics Research Database.")
-
- if (href_list["delete"])
- var/operation = text2num(href_list["delete"])
- if(operation == 1) // Clear Disk Schematics
- var/amtgone = 0
- for(var/datum/manufacture/D in src.diskload)
- src.diskload-= D
- amtgone++
- to_chat(if (amtgone) usr, "\blue Cleared [amtgone] schematics from database.")
- to_chat(else usr, "\red No disk-loaded schematics detected in database.")
- if(operation == 2) // Clear Download Schematics
- var/amtgone = 0
- for(var/datum/manufacture/D in src.download)
- src.download-= D
- amtgone++
- to_chat(if (amtgone) usr, "\blue Cleared [amtgone] schematics from database.")
- to_chat(else usr, "\red No downloaded schematics detected in database.")
-
- if (href_list["eject"])
- var/operation = text2num(href_list["eject"])
- var/ejectamt = 0
- var/ejecting = null
- switch(operation)
- if(1) ejecting = /obj/item/weapon/ore/iron
- if(2) ejecting = /obj/item/weapon/ore/glass
- if(3) ejecting = /obj/item/weapon/ore/silver
- if(4) ejecting = /obj/item/weapon/ore/diamond
- if(5) ejecting = /obj/item/weapon/ore/gold
- if(6) ejecting = /obj/item/weapon/ore/coal
- if(7) ejecting = /obj/item/weapon/ore/uranium
- if(8) ejecting = /obj/item/weapon/ore/plasma
- if(9) ejecting = /obj/item/weapon/ore/osmium
- if(10) ejecting = /obj/item/weapon/ore/hydrogen
- if(11) ejecting = /obj/item/weapon/ore/fabric
- else
- to_chat(usr, "\red Error. Unknown ore type.")
- return
- sleep(3)
- ejectamt = input(usr,"How many units do you want to eject?","Eject Materials") as num
- for(var/obj/item/weapon/ore/O in src.contents)
- if (ejectamt <= 0) break
- if (istype(O, ejecting))
- O.loc = usr.loc
- ejectamt--
-
- if (href_list["disp"])
- var/datum/manufacture/I = locate(href_list["disp"])
- // Material Check
- var/A1 = 0
- var/A2 = 0
- var/A3 = 0
- for(var/obj/item/weapon/ore/O in src.contents)
- if (istype(O,I.cost1)) A1++
- if (istype(O,I.cost2)) A2++
- if (istype(O,I.cost3)) A3++
- if (A1 < I.amount1 || A2 < I.amount2 || A3 < I.amount3)
- to_chat(usr, "\red Insufficient materials to manufacture that item.")
- return
- // Consume Mats
- var/C1 = I.amount1
- var/C2 = I.amount2
- var/C3 = I.amount3
- for(var/obj/item/weapon/ore/O in src.contents)
- if (istype(O,I.cost1) && C1)
- del O
- C1--
- if (istype(O,I.cost2) && C2)
- del O
- C2--
- if (istype(O,I.cost3) && C3)
- del O
- C3--
- // Manufacture Item
- src.icon_state = "fab-active"
- src.working = 1
- var/worktime = I.time * 10
- var/powconsume = round(1500*worktime/3)
- /*for(var/i = robotics_research.starting_tier, i <= robotics_research.max_tiers, i++)
- for(var/datum/roboresearch/a in robotics_research.researched_items[i])
- if (a.manubonus)
- worktime -= a.timebonus
- if (a.multiplier != 0) worktime /= a.multiplier
- powconsume -= a.powbonus*/
- if (worktime < 1) worktime = 1
- src.powconsumption = powconsume
- src.updateUsrDialog()
- sleep(worktime)
- var/make = I.create
- while (make > 0)
- new I.item(src.loc)
- make--
- src.working = 0
- src.icon_state = "fab-idle"
- src.updateUsrDialog()
-
-
- attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- var/load = 0
- if(istype(W, /obj/item/weapon/ore/))
- for(var/mob/O in viewers(user, null)) O.show_message(text("\blue [] loads [] into the [].", user, W, src), 1)
- load = 1
- else if(istype(W, /obj/item/stack/sheet))
- var/obj/item/stack/sheet/STACK = W
- for(var/mob/O in viewers(user, null)) O.show_message(text("\blue [] loads [] into the [].", user, W, src), 1)
- if(istype(STACK, /obj/item/stack/sheet/metal))
- for (var/amt = STACK.amount, amt > 0, amt--) new /obj/item/weapon/ore/iron(src)
- if(istype(STACK, /obj/item/stack/sheet/plasteel))
- for (var/amt = STACK.amount, amt > 0, amt--)
- new /obj/item/weapon/ore/iron(src)
- new /obj/item/weapon/ore/plasma(src)
- if(istype(STACK, /obj/item/stack/sheet/glass))
- for (var/amt = STACK.amount, amt > 0, amt--) new /obj/item/weapon/ore/glass(src)
- if(istype(STACK, /obj/item/stack/sheet/rglass))
- for (var/amt = STACK.amount, amt > 0, amt--)
- new /obj/item/weapon/ore/iron(src)
- new /obj/item/weapon/ore/glass(src)
- load = 2
- //else if (istype(W, /obj/item/weapon/plant/wheat/metal))
- // new /obj/item/weapon/ore/iron(src)
- // load = 2
- /*else if(istype(W, /obj/item/stack/cable_coil/))
- for(var/mob/O in viewers(user, null)) O.show_message(text("\blue [] loads [] into the [].", user, W, src), 1)
- for (var/amt = W:amount, amt > 0, amt--)
- new /obj/item/weapon/ore/silver(src)
- amt--
- load = 2*/
- else if(istype(W, /obj/item/weapon/shard))
- new /obj/item/weapon/ore/glass(src)
- load = 2
- else if(istype(W, /obj/item/stack/rods))
- var/obj/item/stack/RODS = W
- for (var/amt = RODS.amount, amt > 0, amt--) new /obj/item/weapon/ore/iron(src)
- load = 2
- else if(istype(W, /obj/item/clothing/))
- if(istype(W, /obj/item/clothing/under/))
- new /obj/item/weapon/ore/fabric(src)
- load = 2
- if(istype(W, /obj/item/clothing/suit/))
- if(!istype(W,/obj/item/clothing/suit/armor))
- new /obj/item/weapon/ore/fabric(src)
- new /obj/item/weapon/ore/fabric(src)
- if(istype(W,/obj/item/clothing/suit/space/)) new /obj/item/weapon/ore/fabric(src)
- load = 2
- else if(istype(W, /obj/item/weapon/disk/data/schematic))
- to_chat(if (!src.acceptdisk) user, "\red This unit is unable to accept disks.")
- else
- var/amtload = 0
- var/dontload = 0
- for (var/datum/manufacture/WS in W:schematics)
- for (var/datum/manufacture/A in src.available)
- if (istype(WS,A)) dontload = 1
- for (var/datum/manufacture/B in src.download)
- if (istype(WS,B)) dontload = 1
- for (var/datum/manufacture/C in src.diskload)
- if (istype(WS,C)) dontload = 1
- for (var/datum/manufacture/D in src.hidden)
- if (istype(WS,D) && src.hacked) dontload = 1
- if (!dontload)
- src.diskload += new WS.type(src)
- amtload++
- else dontload = 0
- to_chat(if (amtload) user, "\blue [amtload] new schematics downloaded from disk.")
- to_chat(else user, "\red No new schematics available on disk.")
- else if (istype(W, /obj/item/weapon/storage/bag/ore))
- for(var/mob/V in viewers(user, null)) V.show_message(text("\blue [] uses the []'s automatic ore loader on []!", user, src, W), 1)
- var/amtload = 0
- for (var/obj/item/weapon/ore/M in W.contents)
- M.loc = src
- amtload++
- to_chat(if (amtload) user, "\blue [amtload] pieces of ore loaded from [W]!")
- to_chat(else user, "\red No ore loaded!")
- else if(istype(W, /obj/item/weapon/card/emag))
- src.hacked = 1
- to_chat(user, "\blue You remove the [src]'s product locks!")
- else ..()
-
- if (load == 1)
- user.unEquip(W)
- W.loc = src
- if ((user.client && user.s_active != src))
- user.client.screen -= W
- W.dropped()
- else if (load == 2)
- user.unEquip(W)
- W.dropped()
- if ((user.client && user.s_active != src))
- user.client.screen -= W
- del W
-
- src.updateUsrDialog()
-
- MouseDrop_T(atom/movable/O as mob|obj, mob/user as mob)
- if (istype(O, /obj/structure/closet/crate/))
- for(var/mob/V in viewers(user, null)) V.show_message(text("\blue [] uses the []'s automatic ore loader on []!", user, src, O), 1)
- var/amtload = 0
- for (var/obj/item/weapon/ore/M in O.contents)
- M.loc = src
- amtload++
- to_chat(if (amtload) user, "\blue [amtload] pieces of ore loaded from [O]!")
- to_chat(else user, "\red No ore loaded!")
- else if (istype(O, /obj/item/weapon/ore/))
- for(var/mob/V in viewers(user, null)) V.show_message(text("\blue [] begins quickly stuffing ore into []!", user, src), 1)
- var/staystill = user.loc
- for(var/obj/item/weapon/ore/M in view(1,user))
- M.loc = src
- sleep(3)
- if (user.loc != staystill) break
- to_chat(user, "\blue You finish stuffing ore into [src]!")
- /*else if (istype(O, /obj/item/weapon/plant/wheat/metal))
- for(var/mob/V in viewers(user, null)) V.show_message(text("\blue [] begins quickly stuffing [O] into []!", user, src), 1)
- var/staystill = user.loc
- for(var/obj/item/weapon/plant/wheat/metal/M in view(1,user))
- new /obj/item/weapon/ore/iron(src)
- del M
- sleep(3)
- if (user.loc != staystill) break
- to_chat(user, "\blue You finish stuffing [O] into [src]!"*/)
- else ..()
- src.updateUsrDialog()
-
-/obj/item/weapon/disk/data/schematic
- name = "Manufacturer Schematic Disk"
- desc = "Contains schematics for use in a Manufacturing Unit."
- var/list/schematics = list()
-
-// Fabricator Defines
-
-/obj/machinery/manufacturer/general
- name = "General Manufacturer"
- desc = "A manufacturing unit calibrated to produce tools and general purpose items."
-
- New()
- ..()
- src.available += new /datum/manufacture/screwdriver(src)
- src.available += new /datum/manufacture/wirecutters(src)
- src.available += new /datum/manufacture/wrench(src)
- src.available += new /datum/manufacture/crowbar(src)
- src.available += new /datum/manufacture/extinguisher(src)
- src.available += new /datum/manufacture/welder(src)
- src.available += new /datum/manufacture/weldingmask(src)
- src.available += new /datum/manufacture/multitool(src)
- src.available += new /datum/manufacture/metal5(src)
- src.available += new /datum/manufacture/metalR(src)
- src.available += new /datum/manufacture/glass5(src)
- src.available += new /datum/manufacture/glassR(src)
- src.available += new /datum/manufacture/atmos_can(src)
- //src.available += new /datum/manufacture/cable(src)
- src.available += new /datum/manufacture/light_bulb(src)
- src.available += new /datum/manufacture/light_tube(src)
- src.available += new /datum/manufacture/breathmask(src)
- src.available += new /datum/manufacture/RCDammo(src)
- //src.available += new /datum/manufacture/cola_bottle(src)
- //src.hidden += new /datum/manufacture/vuvuzela(src)
- //src.hidden += new /datum/manufacture/harmonica(src)
- //src.hidden += new /datum/manufacture/bikehorn(src)
- //src.hidden += new /datum/manufacture/stunrounds
-
-/obj/machinery/manufacturer/robotics
- name = "Robotics Fabricator"
- desc = "A manufacturing unit calibrated to produce robot-related equipment."
- acceptdisk = 1
- dl_list = "robotics"
-
- New()
- ..()
- src.available += new /datum/manufacture/robo_frame(src)
- src.available += new /datum/manufacture/robo_head(src)
- src.available += new /datum/manufacture/robo_chest(src)
- src.available += new /datum/manufacture/robo_arm_r(src)
- src.available += new /datum/manufacture/robo_arm_l(src)
- src.available += new /datum/manufacture/robo_leg_r(src)
- src.available += new /datum/manufacture/robo_leg_l(src)
- src.available += new /datum/manufacture/robo_stmodule(src)
- //src.available += new /datum/manufacture/cable(src)
- src.available += new /datum/manufacture/powercell(src)
- src.available += new /datum/manufacture/crowbar(src)
- src.available += new /datum/manufacture/scalpel(src)
- src.available += new /datum/manufacture/circular_saw(src)
- src.available += new /datum/manufacture/implanter
- src.hidden += new /datum/manufacture/flash(src)
-
-// Schematic Defines
-// General/Miscellaneous
-
-/datum/manufacture/crowbar
- name = "Crowbar"
- item = /obj/item/weapon/crowbar
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/screwdriver
- name = "Screwdriver"
- item = /obj/item/weapon/screwdriver
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/wirecutters
- name = "Wirecutters"
- item = /obj/item/weapon/wirecutters
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/wrench
- name = "Wrench"
- item = /obj/item/weapon/wrench
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-/*
-/datum/manufacture/vuvuzela
- name = "Vuvuzela"
- item = /obj/item/weapon/vuvuzela
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/harmonica
- name = "Harmonica"
- item = /obj/item/weapon/harmonica
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/cola_bottle
- name = "Glass Bottle"
- item = /obj/item/weapon/reagent_containers/food/drinks/cola_bottle
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 1
- time = 4
- create = 1
-
-/datum/manufacture/bikehorn
- name = "Bicycle Horn"
- item = /obj/item/weapon/bikehorn
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/stunrounds
- name = ".38 Stunner Rounds"
- item = /obj/item/weapon/ammo/bullets/a38/stun
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 7
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 3
- time = 25
- create = 1
-*/
-/datum/manufacture/extinguisher
- name = "Fire Extinguisher"
- item = /obj/item/weapon/extinguisher
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 1
- time = 8
- create = 1
-
-/datum/manufacture/welder
- name = "Welding Tool"
- item = /obj/item/weapon/weldingtool
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 1
- time = 8
- create = 1
-
-/datum/manufacture/multitool
- name = "Multi Tool"
- item = /obj/item/device/multitool
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 1
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 1
- time = 8
- create = 1
-
-/datum/manufacture/weldingmask
- name = "Welding Mask"
- item = /obj/item/clothing/head/welding
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 2
- time = 10
- create = 1
-
-/datum/manufacture/light_bulb
- name = "Light Bulb"
- item = /obj/item/weapon/light/bulb
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 1
- time = 4
- create = 1
-
-/datum/manufacture/light_tube
- name = "Light Tube"
- item = /obj/item/weapon/light/tube
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 1
- time = 4
- create = 1
-
-/datum/manufacture/metal5
- name = "Sheet Metal (x5)"
- item = /obj/item/stack/sheet/metal
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- time = 8
- create = 5
-
-/datum/manufacture/metalR
- name = "Reinforced Metal"
- item = /obj/item/stack/sheet/plasteel
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- cost2 = /obj/item/weapon/ore/plasma
- cname2 = "Plasma"
- amount2 = 1
- time = 6
- create = 1
-
-/datum/manufacture/glass5
- name = "Glass Panel (x5)"
- item = /obj/item/stack/sheet/glass
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 5
- time = 8
- create = 5
-
-/datum/manufacture/glassR
- name = "Reinforced Glass Panel"
- item = /obj/item/stack/sheet/rglass
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 1
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 1
- time = 12
- create = 1
-
-/datum/manufacture/atmos_can
- name = "Portable Gas Canister"
- item = /obj/machinery/portable_atmospherics/canister
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- time = 10
- create = 1
-
-/*
-/datum/manufacture/cable
- name = "Electrical Cable Piece"
- item = /obj/item/stack/cable_coil/cut
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 1
- time = 3
- create = 1
-*/
-/datum/manufacture/RCD
- name = "Rapid Construction Device"
- item = /obj/item/weapon/rcd
- cost1 = /obj/item/weapon/ore/gold
- cname1 = "Gold"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/osmium
- cname2 = "Platinum"
- amount2 = 1
- cost3 = /obj/item/weapon/ore/silver
- cname3 = "Silver"
- amount3 = 10
- time = 90
- create = 1
-
-/datum/manufacture/RCDammo
- name = "Compressed Matter Cartridge"
- item = /obj/item/weapon/rcd_ammo
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 1
- time = 15
- create = 1
-
-
-/******************** Robotics **************************/
-
-/datum/manufacture/robo_frame
- name = "Cyborg Frame"
- item = /obj/item/robot_parts/robot_suit
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 18
- time = 45
- create = 1
-
-/datum/manufacture/robo_chest
- name = "Cyborg Chest"
- item = /obj/item/robot_parts/chest
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 12
- time = 30
- create = 1
-
-/datum/manufacture/robo_head
- name = "Cyborg Head"
- item = /obj/item/robot_parts/head
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 12
- time = 30
- create = 1
-
-/datum/manufacture/robo_arm_r
- name = "Cyborg Arm (Right)"
- item = /obj/item/robot_parts/r_arm
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 6
- time = 15
- create = 1
-
-/datum/manufacture/robo_arm_l
- name = "Cyborg Arm (Left)"
- item = /obj/item/robot_parts/l_arm
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 6
- time = 15
- create = 1
-
-/datum/manufacture/robo_leg_r
- name = "Cyborg Leg (Right)"
- item = /obj/item/robot_parts/r_leg
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 6
- time = 15
- create = 1
-
-/datum/manufacture/robo_leg_l
- name = "Cyborg Leg (Left)"
- item = /obj/item/robot_parts/l_leg
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 6
- time = 15
- create = 1
-
-/datum/manufacture/robo_stmodule
- name = "Standard Cyborg Module"
- item = /obj/item/weapon/robot_module/standard
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 3
- time = 40
- create = 1
-
-/datum/manufacture/scalpel
- name = "Scalpel"
- item = /obj/item/weapon/scalpel
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/circular_saw
- name = "Circular Saw"
- item = /obj/item/weapon/circular_saw
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/powercell
- name = "Power Cell"
- item = /obj/item/weapon/stock_parts/cell
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 4
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 4
- cost3 = /obj/item/weapon/ore/silver
- cname3 = "Silver"
- amount3 = 4
- time = 30
- create = 1
-
-/datum/manufacture/flash
- name = "Flash"
- item = /obj/item/device/flash
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 2
- time = 15
- create = 1
-
-
-
-// Robotics Research
-
-/datum/manufacture/implanter
- name = "Implanter"
- item = /obj/item/weapon/implanter
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 1
- time = 3
- create = 1
-
-/datum/manufacture/secbot
- name = "Security Drone"
- item = /obj/machinery/bot/secbot
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/glass
- cname3 = "Glass"
- amount3 = 5
- time = 60
- create = 1
-
-/datum/manufacture/floorbot
- name = "Construction Drone"
- item = /obj/machinery/bot/floorbot
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/glass
- cname3 = "Glass"
- amount3 = 5
- time = 60
- create = 1
-
-/datum/manufacture/medbot
- name = "Medical Drone"
- item = /obj/machinery/bot/medbot
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/glass
- cname3 = "Glass"
- amount3 = 5
- time = 60
- create = 1
-/*
-/datum/manufacture/firebot
- name = "Firefighting Drone"
- item = /obj/machinery/bot/firebot
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/glass
- cname3 = "Glass"
- amount3 = 5
- time = 60
- create = 1
-*/
-/datum/manufacture/cleanbot
- name = "Sanitation Drone"
- item = /obj/machinery/bot/cleanbot
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/glass
- cname3 = "Glass"
- amount3 = 5
- time = 60
- create = 1
-/*
-/datum/manufacture/robup_jetpack
- name = "Propulsion Upgrade"
- item = /obj/item/weapon/roboupgrade/jetpack
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 5
- time = 60
- create = 1
-
-/datum/manufacture/robup_speed
- name = "Speed Upgrade"
- item = /obj/item/weapon/roboupgrade/speed
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 5
- time = 60
- create = 1
-
-/datum/manufacture/robup_recharge
- name = "Recharge Pack"
- item = /obj/item/weapon/roboupgrade/rechargepack
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 5
- time = 60
- create = 1
-
-/datum/manufacture/robup_repairpack
- name = "Repair Pack"
- item = /obj/item/weapon/roboupgrade/repairpack
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 5
- time = 60
- create = 1
-
-/datum/manufacture/robup_physshield
- name = "Force Shield Upgrade"
- item = /obj/item/weapon/roboupgrade/physshield
- cost1 = /obj/item/weapon/ore/diamond
- cname1 = "Claretine"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 10
- time = 90
- create = 1
-
-/datum/manufacture/robup_fireshield
- name = "Heat Shield Upgrade"
- item = /obj/item/weapon/roboupgrade/fireshield
- cost1 = /obj/item/weapon/ore/diamond
- cname1 = "Claretine"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 10
- time = 90
- create = 1
-
-/datum/manufacture/robup_aware
- name = "Operational Upgrade"
- item = /obj/item/weapon/roboupgrade/aware
- cost1 = /obj/item/weapon/ore/diamond
- cname1 = "Claretine"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 5
- cost3 = /obj/item/weapon/ore/silver
- cname3 = "Silver"
- amount3 = 5
- time = 90
- create = 1
-
-/datum/manufacture/robup_efficiency
- name = "Efficiency Upgrade"
- item = /obj/item/weapon/roboupgrade/efficiency
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/diamond
- cname2 = "Claretine"
- amount2 = 10
- time = 120
- create = 1
-
-/datum/manufacture/robup_repair
- name = "Self-Repair Upgrade"
- item = /obj/item/weapon/roboupgrade/repair
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/gold
- cname2 = "Gold"
- amount2 = 10
- time = 120
- create = 1
-
-/datum/manufacture/robup_teleport
- name = "Teleport Upgrade"
- item = /obj/item/weapon/roboupgrade/teleport
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/hydrogen
- cname2 = "Telecrystal"
- amount2 = 2
- time = 120
- create = 1
-
-/datum/manufacture/robup_expand
- name = "Expansion Upgrade"
- item = /obj/item/weapon/roboupgrade/expand
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/uranium
- cname2 = "Cerenkite"
- amount2 = 1
- time = 120
- create = 1
-
-/datum/manufacture/robup_chargexpand
- name = "Charge Expander Upgrade"
- item = /obj/item/weapon/roboupgrade/chargeexpand
- cost1 = /obj/item/weapon/ore/diamond
- cname1 = "Claretine"
- amount1 = 5
- time = 70
- create = 1
-
-/datum/manufacture/robup_meson
- name = "Optical Meson Upgrade"
- item = /obj/item/weapon/roboupgrade/opticmeson
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 4
- time = 90
- create = 1
-
-/datum/manufacture/robup_thermal
- name = "Optical Thermal Upgrade"
- item = /obj/item/weapon/roboupgrade/opticthermal
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 4
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 8
- time = 90
- create = 1
-
-/datum/manufacture/deafhs
- name = "Auditory Headset"
- item = /obj/item/device/radio/headset/deaf
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 3
- time = 40
- create = 1
-
-/datum/manufacture/visor
- name = "VISOR Prosthesis"
- item = /obj/item/clothing/glasses/visor
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 3
- time = 40
- create = 1
-
-/datum/manufacture/implant_robotalk
- name = "Machine Translator Implant"
- item = /obj/item/weapon/implantcase/robotalk
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 3
- time = 40
- create = 1
-
-/datum/manufacture/implant_bloodmonitor
- name = "Blood Monitor Implant"
- item = /obj/item/weapon/implantcase/bloodmonitor
- cost1 = /obj/item/weapon/ore/silver
- cname1 = "Silver"
- amount1 = 3
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 3
- time = 40
- create = 1
-*/
\ No newline at end of file
diff --git a/code/modules/mining/materials.dm b/code/modules/mining/materials.dm
deleted file mode 100644
index 5c743bb4521..00000000000
--- a/code/modules/mining/materials.dm
+++ /dev/null
@@ -1,147 +0,0 @@
-/**
-* Materials system
-*
-* Replaces all of the horrible variables that tracked each individual thing.
-*/
-
-/**
-* MATERIALS DATUM
-*
-* Tracks and manages material storage for an object.
-*/
-/datum/materials
- var/list/datum/material/storage[0]
-
-/datum/materials/New()
- for(var/matdata in subtypesof(/datum/material))
- var/datum/material/mat = new matdata
- storage[mat.id]=mat
-
-/datum/materials/proc/addAmount(var/mat_id,var/amount)
- if(!(mat_id in storage))
- warning("addAmount(): Unknown material [mat_id]!")
- return
- // I HATE BYOND
- // storage[mat_id].stored++
- var/datum/material/mat=storage[mat_id]
- mat.stored += amount
- storage[mat_id]=mat
-
-/datum/materials/proc/removeAmount(var/mat_id,var/amount)
- if(!(mat_id in storage))
- warning("removeAmount(): Unknown material [mat_id]!")
- return
- addAmount(mat_id,-amount)
-
-/datum/materials/proc/getAmount(var/mat_id)
- if(!(mat_id in storage))
- warning("getAmount(): Unknown material [mat_id]!")
- return 0
-
- var/datum/material/mat=getMaterial(mat_id)
- return mat.stored
-
-/datum/materials/proc/getMaterial(var/mat_id)
- if(!(mat_id in storage))
- warning("getMaterial(): Unknown material [mat_id]!")
- return 0
-
- return storage[mat_id]
-
-
-/datum/material
- var/name=""
- var/processed_name=""
- var/id=""
- var/stored=0
- var/cc_per_sheet=CC_PER_SHEET_MISC
- var/oretype=null
- var/sheettype=null
- var/cointype=null
- var/value=0
-
-/datum/material/New()
- if(processed_name=="")
- processed_name=name
-
-/datum/material/iron
- name="Iron"
- id="iron"
- value=1
- cc_per_sheet=CC_PER_SHEET_METAL
- oretype=/obj/item/weapon/ore/iron
- sheettype=/obj/item/stack/sheet/metal
- cointype=/obj/item/weapon/coin/iron
-
-/datum/material/glass
- name="Sand"
- processed_name="Glass"
- id="glass"
- value=1
- cc_per_sheet=CC_PER_SHEET_GLASS
- oretype=/obj/item/weapon/ore/glass
- sheettype=/obj/item/stack/sheet/glass
-
-/datum/material/diamond
- name="Diamond"
- id="diamond"
- value=40
- oretype=/obj/item/weapon/ore/diamond
- sheettype=/obj/item/stack/sheet/mineral/diamond
- cointype=/obj/item/weapon/coin/diamond
-
-/datum/material/plasma
- name="Plasma"
- id="plasma"
- value=40
- oretype=/obj/item/weapon/ore/plasma
- sheettype=/obj/item/stack/sheet/mineral/plasma
- cointype=/obj/item/weapon/coin/plasma
-
-/datum/material/gold
- name="Gold"
- id="gold"
- value=20
- oretype=/obj/item/weapon/ore/gold
- sheettype=/obj/item/stack/sheet/mineral/gold
- cointype=/obj/item/weapon/coin/gold
-
-/datum/material/silver
- name="Silver"
- id="silver"
- value=20
- oretype=/obj/item/weapon/ore/silver
- sheettype=/obj/item/stack/sheet/mineral/silver
- cointype=/obj/item/weapon/coin/silver
-
-/datum/material/uranium
- name="Uranium"
- id="uranium"
- value=20
- oretype=/obj/item/weapon/ore/uranium
- sheettype=/obj/item/stack/sheet/mineral/uranium
- cointype=/obj/item/weapon/coin/uranium
-
-/datum/material/clown
- name="Bananium"
- id="clown"
- value=100
- oretype=/obj/item/weapon/ore/clown
- sheettype=/obj/item/stack/sheet/mineral/clown
- cointype=/obj/item/weapon/coin/clown
-
-/datum/material/plastic
- name="Plastic"
- id="plastic"
- value=1
- oretype=null
- sheettype=/obj/item/stack/sheet/mineral/plastic
- cointype=null
-
-/datum/material/fabric
- name="Fabric"
- id="fabric"
- value=20
- oretype=/obj/item/weapon/ore/fabric
- sheettype=null
- cointype=null
\ No newline at end of file
diff --git a/code/modules/mining/mine_items.dm b/code/modules/mining/mine_items.dm
index f1f317789b4..e774ef23924 100644
--- a/code/modules/mining/mine_items.dm
+++ b/code/modules/mining/mine_items.dm
@@ -9,6 +9,27 @@
/**********************Miner Lockers**************************/
+/obj/structure/closet/wardrobe/miner
+ name = "mining wardrobe"
+ icon_state = "mixed"
+ icon_closed = "mixed"
+
+/obj/structure/closet/wardrobe/miner/New()
+ ..()
+ contents = list()
+ new /obj/item/weapon/storage/backpack/duffel(src)
+ new /obj/item/weapon/storage/backpack/industrial(src)
+ new /obj/item/weapon/storage/backpack/satchel_eng(src)
+ new /obj/item/clothing/under/rank/miner(src)
+ new /obj/item/clothing/under/rank/miner(src)
+ new /obj/item/clothing/under/rank/miner(src)
+ new /obj/item/clothing/shoes/workboots(src)
+ new /obj/item/clothing/shoes/workboots(src)
+ new /obj/item/clothing/shoes/workboots(src)
+ new /obj/item/clothing/gloves/fingerless(src)
+ new /obj/item/clothing/gloves/fingerless(src)
+ new /obj/item/clothing/gloves/fingerless(src)
+
/obj/structure/closet/secure_closet/miner
name = "miner's equipment"
icon_state = "miningsec1"
@@ -21,20 +42,11 @@
/obj/structure/closet/secure_closet/miner/New()
..()
- sleep(2)
- if(prob(50))
- new /obj/item/weapon/storage/backpack/industrial(src)
- else
- new /obj/item/weapon/storage/backpack/satchel_eng(src)
- new /obj/item/device/radio/headset/headset_cargo(src)
- new /obj/item/clothing/under/rank/miner(src)
- new /obj/item/clothing/gloves/fingerless(src)
- new /obj/item/clothing/shoes/black(src)
- new /obj/item/device/mining_scanner(src)
- new /obj/item/weapon/storage/bag/ore(src)
- new /obj/item/device/flashlight/lantern(src)
new /obj/item/weapon/shovel(src)
new /obj/item/weapon/pickaxe(src)
+ new /obj/item/device/radio/headset/headset_cargo/mining(src)
+ new /obj/item/device/t_scanner/adv_mining_scanner/lesser(src)
+ new /obj/item/weapon/storage/bag/ore(src)
new /obj/item/clothing/glasses/meson(src)
/**********************Shuttle Computer**************************/
@@ -65,7 +77,7 @@
force = 15.0
throwforce = 10.0
item_state = "pickaxe"
- w_class = 4.0
+ w_class = 4
materials = list(MAT_METAL=2000) //one sheet, but where can you make them?
var/digspeed = 40 //moving the delay to an item var so R&D can make improved picks. --NEO
origin_tech = "materials=1;engineering=1"
@@ -122,7 +134,7 @@
icon_state = "smdrill"
origin_tech = "materials=6;powerstorage=4;engineering=5;syndicate=3"
desc = "Microscopic supermatter crystals cover the head of this tiny drill."
- w_class = 2.0
+ w_class = 2
/obj/item/weapon/pickaxe/drill/cyborg/diamond //This is the BORG version!
name = "diamond-tipped cyborg mining drill" //To inherit the NODROP flag, and easier to change borg specific drill mechanics.
@@ -166,7 +178,7 @@
force = 8.0
throwforce = 4.0
item_state = "shovel"
- w_class = 3.0
+ w_class = 3
materials = list(MAT_METAL=50)
origin_tech = "materials=1;engineering=1"
attack_verb = list("bashed", "bludgeoned", "thrashed", "whacked")
@@ -178,7 +190,7 @@
item_state = "spade"
force = 5.0
throwforce = 7.0
- w_class = 2.0
+ w_class = 2
/**********************Mining car (Crate like thing, not the rail car)**************************/
@@ -199,7 +211,7 @@
desc = "It allows you to store and deploy lazarus-injected creatures easier."
icon = 'icons/obj/mobcap.dmi'
icon_state = "mobcap0"
- w_class = 1.0
+ w_class = 1
throw_range = 20
var/mob/living/simple_animal/captured = null
var/colorindex = 0
@@ -249,4 +261,50 @@
if(colorindex >= 6)
colorindex = 0
icon_state = "mobcap[colorindex]"
- update_icon()
\ No newline at end of file
+ update_icon()
+
+//Fans
+/obj/structure/fans
+ icon = 'icons/obj/lavaland/survival_pod.dmi'
+ icon_state = "fans"
+ name = "environmental regulation system"
+ desc = "A large machine releasing a constant gust of air."
+ anchored = 1
+ density = 1
+ var/arbitraryatmosblockingvar = 1
+ var/buildstacktype = /obj/item/stack/sheet/metal
+ var/buildstackamount = 5
+
+/obj/structure/fans/proc/deconstruct()
+ if(buildstacktype)
+ new buildstacktype(loc, buildstackamount)
+ qdel(src)
+
+/obj/structure/fans/attackby(obj/item/weapon/W, mob/user, params)
+ if(istype(W, /obj/item/weapon/wrench))
+ playsound(loc, 'sound/items/Ratchet.ogg', 50, 1)
+ user.visible_message("[user] disassembles the fan.", \
+ "You start to disassemble the fan...", "You hear clanking and banging noises.")
+ if(do_after(user, 20, target = src))
+ deconstruct()
+ return ..()
+
+/obj/structure/fans/tiny
+ name = "tiny fan"
+ desc = "A tiny fan, releasing a thin gust of air."
+ layer = TURF_LAYER+0.1
+ density = 0
+ icon_state = "fan_tiny"
+ buildstackamount = 2
+
+/obj/structure/fans/New(loc)
+ ..()
+ air_update_turf(1)
+
+/obj/structure/fans/Destroy()
+ arbitraryatmosblockingvar = 0
+ air_update_turf(1)
+ return ..()
+
+/obj/structure/fans/CanAtmosPass(turf/T)
+ return !arbitraryatmosblockingvar
\ No newline at end of file
diff --git a/code/modules/mining/mine_turfs.dm b/code/modules/mining/mine_turfs.dm
index 41b994b31b6..a76dfa9a699 100644
--- a/code/modules/mining/mine_turfs.dm
+++ b/code/modules/mining/mine_turfs.dm
@@ -45,10 +45,10 @@ var/global/list/rockTurfEdgeCache = list(
..()
switch(severity)
if(3.0)
- if (prob(75))
+ if(prob(75))
src.gets_drilled(null, 1)
if(2.0)
- if (prob(90))
+ if(prob(90))
src.gets_drilled(null, 1)
if(1.0)
src.gets_drilled(null, 1)
@@ -58,7 +58,7 @@ var/global/list/rockTurfEdgeCache = list(
..()
mineral_turfs += src
- if (mineralType && mineralAmt && spread && spreadChance)
+ if(mineralType && mineralAmt && spread && spreadChance)
for(var/dir in cardinal)
if(prob(spreadChance))
var/turf/T = get_step(src, dir)
@@ -88,19 +88,19 @@ var/global/list/rockTurfEdgeCache = list(
var/turf/T
if((istype(get_step(src, NORTH), /turf/simulated/floor)) || (istype(get_step(src, NORTH), /turf/space)))
T = get_step(src, NORTH)
- if (T)
+ if(T)
T.overlays += rockTurfEdgeCache[SOUTH_EDGING]
if((istype(get_step(src, SOUTH), /turf/simulated/floor)) || (istype(get_step(src, SOUTH), /turf/space)))
T = get_step(src, SOUTH)
- if (T)
+ if(T)
T.overlays += rockTurfEdgeCache[NORTH_EDGING]
if((istype(get_step(src, EAST), /turf/simulated/floor)) || (istype(get_step(src, EAST), /turf/space)))
T = get_step(src, EAST)
- if (T)
+ if(T)
T.overlays += rockTurfEdgeCache[WEST_EDGING]
if((istype(get_step(src, WEST), /turf/simulated/floor)) || (istype(get_step(src, WEST), /turf/space)))
T = get_step(src, WEST)
- if (T)
+ if(T)
T.overlays += rockTurfEdgeCache[EAST_EDGING]
/turf/simulated/mineral/random
@@ -116,10 +116,10 @@ var/global/list/rockTurfEdgeCache = list(
/turf/simulated/mineral/random/New()
..()
- if (prob(mineralChance))
+ if(prob(mineralChance))
var/mName = pickweight(mineralSpawnChanceList) //temp mineral name
- if (mName)
+ if(mName)
var/turf/simulated/mineral/M
switch(mName)
if("Uranium")
@@ -367,13 +367,13 @@ var/global/list/rockTurfEdgeCache = list(
/turf/simulated/mineral/attackby(var/obj/item/weapon/pickaxe/P as obj, mob/user as mob, params)
- if (!user.IsAdvancedToolUser())
+ if(!user.IsAdvancedToolUser())
to_chat(usr, "You don't have the dexterity to do this!")
return
- if (istype(P, /obj/item/weapon/pickaxe))
+ if(istype(P, /obj/item/weapon/pickaxe))
var/turf/T = user.loc
- if (!( istype(T, /turf) ))
+ if(!( istype(T, /turf) ))
return
if(last_act+P.digspeed > world.time)//prevents message spam
@@ -393,9 +393,9 @@ var/global/list/rockTurfEdgeCache = list(
return
/turf/simulated/mineral/proc/gets_drilled()
- if (mineralType && (src.mineralAmt > 0) && (src.mineralAmt < 11))
+ if(mineralType && (src.mineralAmt > 0) && (src.mineralAmt < 11))
var/i
- for (i=0;iThis area has already been dug!")
return
to_chat(user, "You start digging...")
sleep(20)
- if ((user.loc == T && user.get_active_hand() == W))
+ if((user.loc == T && user.get_active_hand() == W))
to_chat(user, "You dig a hole.")
gets_dug()
return
- if ((istype(W, /obj/item/weapon/pickaxe)))
+ if((istype(W, /obj/item/weapon/pickaxe)))
var/obj/item/weapon/pickaxe/P = W
var/turf/T = user.loc
- if (!( istype(T, /turf) ))
+ if(!( istype(T, /turf) ))
return
- if (dug)
+ if(dug)
to_chat(user, "This area has already been dug!")
return
to_chat(user, "You start digging...")
sleep(P.digspeed)
- if ((user.loc == T && user.get_active_hand() == W))
+ if((user.loc == T && user.get_active_hand() == W))
to_chat(user, "You dig a hole.")
gets_dug()
return
@@ -557,7 +557,7 @@ var/global/list/rockTurfEdgeCache = list(
return
/turf/proc/fullUpdateMineralOverlays()
- for (var/turf/t in range(1,src))
+ for(var/turf/t in range(1,src))
t.updateMineralOverlays()
/turf/simulated/floor/plating/airless/asteroid/cave
diff --git a/code/modules/mining/minerals.dm b/code/modules/mining/minerals.dm
deleted file mode 100644
index 0cd46917858..00000000000
--- a/code/modules/mining/minerals.dm
+++ /dev/null
@@ -1,107 +0,0 @@
-var/list/name_to_mineral
-
-proc/SetupMinerals()
- name_to_mineral = list()
- for(var/type in subtypesof(/mineral))
- var/mineral/new_mineral = new type
- if(!new_mineral.name)
- continue
- name_to_mineral[new_mineral.name] = new_mineral
- return 1
-
-mineral
- ///What am I called?
- var/name
- var/display_name
- ///How much ore?
- var/result_amount
- ///Does this type of deposit spread?
- var/spread = 1
- ///Chance of spreading in any direction
- var/spread_chance
-
- ///Path to the resultant ore.
- var/ore
-
- New()
- . = ..()
- if(!display_name)
- display_name = name
-
- proc/UpdateTurf(var/turf/simulated/mineral/T)
- T.UpdateMineral()
-
-mineral/uranium
- name = "Uranium"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/uranium
-
-mineral/iron
- name = "Iron"
- result_amount = 5
- spread_chance = 25
- ore = /obj/item/weapon/ore/iron
-
-mineral/diamond
- name = "Diamond"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/diamond
-
-mineral/gold
- name = "Gold"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/gold
-
-mineral/silver
- name = "Silver"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/silver
-
-mineral/platinum
- name = "Platinum"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/osmium
-
-mineral/plasma
- name = "Plasma"
- result_amount = 5
- spread_chance = 25
- ore = /obj/item/weapon/ore/plasma
-
-mineral/clown
- display_name = "Bananium"
- name = "Clown"
- result_amount = 3
- spread = 0
- ore = /obj/item/weapon/ore/clown
-
-mineral/coal
- name = "Coal"
- result_amount = 5
- spread_chance = 25
- ore = /obj/item/weapon/ore/coal
-
-mineral/hydrogen
- name = "Hydrogen"
- result_amount = 5
- spread_chance = 10
- ore = /obj/item/weapon/ore/coal
-
-
-mineral/cave
- display_name = "Cave"
- name = "Cave"
- result_amount = 1
- spread_chance = 10
- ore = null
- UpdateTurf(var/turf/T)
- if(!istype(T,/turf/simulated/floor/plating/airless/asteroid/cave))
- T.ChangeTurf(/turf/simulated/floor/plating/airless/asteroid/cave)
- else
- ..()
-
diff --git a/code/modules/mining/mining_recipes.dm b/code/modules/mining/mining_recipes.dm
deleted file mode 100644
index ebe28c4e083..00000000000
--- a/code/modules/mining/mining_recipes.dm
+++ /dev/null
@@ -1,252 +0,0 @@
-/obj/machinery/manufacturer/mining
- name = "Mining Fabricator"
- desc = "A manufacturing unit calibrated to produce mining related equipment."
- acceptdisk = 1
-
- New()
- ..()
- src.available += new /datum/manufacture/pick(src)
- src.available += new /datum/manufacture/shovel(src)
- src.available += new /datum/manufacture/oresatchel(src)
- src.available += new /datum/manufacture/breathmask(src)
- src.available += new /datum/manufacture/spacesuit(src)
- src.available += new /datum/manufacture/spacehelm(src)
- src.available += new /datum/manufacture/eyes_meson(src)
- src.hidden += new /datum/manufacture/RCD(src)
- src.hidden += new /datum/manufacture/RCDammo(src)
-
-
-// Mining Gear
-/datum/manufacture/pick
- name = "Pickaxe"
- item = /obj/item/weapon/pickaxe
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- time = 5
- create = 1
-
-/datum/manufacture/shovel
- name = "Shovel"
- item = /obj/item/weapon/shovel
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 3
- time = 2
- create = 1
-
-/datum/manufacture/spick
- name = "Silver Pickaxe"
- item = /obj/item/weapon/pickaxe/silver
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 5
- time = 10
- create = 1
-
-/datum/manufacture/gpick
- name = "Gold Pickaxe"
- item = /obj/item/weapon/pickaxe/gold
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/gold
- cname2 = "Gold"
- amount2 = 5
- time = 15
- create = 1
-
-/datum/manufacture/dpick
- name = "Diamond Pickaxe"
- item = /obj/item/weapon/pickaxe/diamond
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/diamond
- cname2 = "Uranium"
- amount2 = 5
- time = 30
- create = 1
-
-/datum/manufacture/jackhammer
- name = "Sonic Jackhammer"
- item = /obj/item/weapon/pickaxe/jackhammer
- cost1 = /obj/item/weapon/ore/gold
- cname1 = "Gold"
- amount1 = 8
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 12
- time = 30
- create = 1
-
-/datum/manufacture/drill
- name = "Hand Drill"
- item = /obj/item/weapon/pickaxe/drill
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 15
- time = 20
- create = 1
-
-/datum/manufacture/diamonddrill
- name = "Diamond Drill"
- item = /obj/item/weapon/pickaxe/diamonddrill
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 15
- cost2 = /obj/item/weapon/ore/diamond
- cname2 = "Diamond"
- amount2 = 15
- cost3 = /obj/item/weapon/ore/silver
- cname3 = "Silver"
- amount3 = 15
- time = 40
- create = 1
-
-/datum/manufacture/cutter
- name = "Plasma Cutter"
- item = /obj/item/weapon/pickaxe/plasmacutter
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/gold
- cname2 = "Gold"
- amount2 = 10
- cost3 = /obj/item/weapon/ore/plasma
- cname3 = "Plasma"
- amount3 = 15
- time = 30
- create = 1
-
-/datum/manufacture/eyes_meson
- name = "Optical Meson Scanner"
- item = /obj/item/clothing/glasses/meson
- cost1 = /obj/item/weapon/ore/glass
- cname1 = "Glass"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 3
- time = 10
- create = 1
-
-/datum/manufacture/miningsuit
- name = "Mining Hardsuit"
- item = /obj/item/clothing/suit/space/rig/mining
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 30
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 30
- time = 30
- create = 1
-
-/datum/manufacture/mininghelm
- name = "Mining Hardsuit Helmet"
- item = /obj/item/clothing/head/helmet/space/rig/mining
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 30
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 30
- time = 20
- create = 1
-
-/datum/manufacture/breathmask
- name = "Breath Mask"
- item = /obj/item/clothing/mask/breath
- cost1 = /obj/item/weapon/ore/fabric
- cname1 = "Fabric"
- amount1 = 1
- time = 5
- create = 1
-
-/datum/manufacture/spacesuit
- name = "Space Suit"
- item = /obj/item/clothing/suit/space
- cost1 = /obj/item/weapon/ore/fabric
- cname1 = "Fabric"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/iron
- cname2 = "Iron"
- amount2 = 5
- time = 15
- create = 1
-
-/datum/manufacture/spacehelm
- name = "Space Helmet"
- item = /obj/item/clothing/head/helmet/space
- cost1 = /obj/item/weapon/ore/fabric
- cname1 = "Fabric"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 5
- time = 10
- create = 1
-
-/datum/manufacture/oresatchel
- name = "Ore Satchel"
- item = /obj/item/weapon/storage/bag/ore
- cost1 = /obj/item/weapon/ore/fabric
- cname1 = "Fabric"
- amount1 = 5
- time = 5
- create = 1
-
-/datum/manufacture/jetpack
- name = "Jetpack"
- item = /obj/item/weapon/tank/jetpack
- cost1 = /obj/item/weapon/ore/gold
- cname1 = "Gold"
- amount1 = 15
- cost2 = /obj/item/weapon/ore/silver
- cname2 = "Silver"
- amount2 = 20
- time = 30
- create = 1
-
-//Diskettes!
-/obj/item/weapon/disk/data/schematic/mining1
- name = "Mining Schematics Level 1"
- desc = "Contains the schematics for a new range of Pickaxes."
-
- New()
- src.schematics += new /datum/manufacture/spick(src)
- src.schematics += new /datum/manufacture/gpick(src)
- src.schematics += new /datum/manufacture/dpick(src)
-
-/obj/item/weapon/disk/data/schematic/mining2
- name = "Mining Schematics Level 2"
- desc = "Contains the schematics for a new line of drills. And a Plasma Cutter. Has the previous level as well."
-
- New()
- src.schematics += new /datum/manufacture/spick(src)
- src.schematics += new /datum/manufacture/gpick(src)
- src.schematics += new /datum/manufacture/dpick(src)
- src.schematics += new /datum/manufacture/drill(src)
- src.schematics += new /datum/manufacture/jackhammer(src)
- src.schematics += new /datum/manufacture/diamonddrill(src)
- src.schematics += new /datum/manufacture/cutter(src)
-
-/obj/item/weapon/disk/data/schematic/mining3
- name = "Mining Schematics Level 3"
- desc = "Contains the schematics for a new type of Spacesuit, and schematics for a Jetpack. Has the previous levels as well."
-
- New()
- src.schematics += new /datum/manufacture/spick(src)
- src.schematics += new /datum/manufacture/gpick(src)
- src.schematics += new /datum/manufacture/dpick(src)
- src.schematics += new /datum/manufacture/drill(src)
- src.schematics += new /datum/manufacture/jackhammer(src)
- src.schematics += new /datum/manufacture/diamonddrill(src)
- src.schematics += new /datum/manufacture/cutter(src)
- src.schematics += new /datum/manufacture/miningsuit(src)
- src.schematics += new /datum/manufacture/mininghelm(src)
- src.schematics += new /datum/manufacture/jetpack(src)
\ No newline at end of file
diff --git a/code/modules/mining/mint.dm b/code/modules/mining/mint.dm
index be34465c207..02b69a160d7 100644
--- a/code/modules/mining/mint.dm
+++ b/code/modules/mining/mint.dm
@@ -26,28 +26,28 @@
var/turf/T = get_step(src,input_dir)
if(T)
for(var/obj/item/stack/sheet/O in T)
- if (istype(O, /obj/item/stack/sheet/mineral/gold))
+ if(istype(O, /obj/item/stack/sheet/mineral/gold))
amt_gold += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/silver))
+ if(istype(O, /obj/item/stack/sheet/mineral/silver))
amt_silver += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/diamond))
+ if(istype(O, /obj/item/stack/sheet/mineral/diamond))
amt_diamond += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/plasma))
+ if(istype(O, /obj/item/stack/sheet/mineral/plasma))
amt_plasma += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/uranium))
+ if(istype(O, /obj/item/stack/sheet/mineral/uranium))
amt_uranium += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/metal))
+ if(istype(O, /obj/item/stack/sheet/metal))
amt_iron += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/bananium))
+ if(istype(O, /obj/item/stack/sheet/mineral/bananium))
amt_clown += 100 * O.amount
O.loc = null
- if (istype(O, /obj/item/stack/sheet/mineral/tranquillite))
+ if(istype(O, /obj/item/stack/sheet/mineral/tranquillite))
amt_mime += 100 * O.amount
O.loc = null
return
@@ -58,49 +58,49 @@
var/dat = "Coin Press "
dat += text(" Gold inserted: [amt_gold] ")
- if (chosen == "gold")
+ if(chosen == "gold")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Silver inserted: [amt_silver] ")
- if (chosen == "silver")
+ if(chosen == "silver")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Iron inserted: [amt_iron] ")
- if (chosen == "metal")
+ if(chosen == "metal")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Diamond inserted: [amt_diamond] ")
- if (chosen == "diamond")
+ if(chosen == "diamond")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Plasma inserted: [amt_plasma] ")
- if (chosen == "plasma")
+ if(chosen == "plasma")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Uranium inserted: [amt_uranium] ")
- if (chosen == "uranium")
+ if(chosen == "uranium")
dat += text("chosen")
else
dat += text("Choose")
if(amt_clown > 0)
dat += text(" Bananium inserted: [amt_clown] ")
- if (chosen == "clown")
+ if(chosen == "clown")
dat += text("chosen")
else
dat += text("Choose")
if(amt_mime > 0)
dat += text(" Tranquillite inserted: [amt_mime] ")
- if (chosen == "mime")
+ if(chosen == "mime")
dat += text("chosen")
else
dat += text("Choose")
dat += text(" Adamantine inserted: [amt_adamantine] ")//I don't even know these color codes, so fuck it.
- if (chosen == "adamantine")
+ if(chosen == "adamantine")
dat += text("chosen")
else
dat += text("Choose")
diff --git a/code/modules/mining/money_bag.dm b/code/modules/mining/money_bag.dm
index a7a7b4b10df..8972b675e1a 100644
--- a/code/modules/mining/money_bag.dm
+++ b/code/modules/mining/money_bag.dm
@@ -7,7 +7,7 @@
flags = CONDUCT
force = 10.0
throwforce = 0
- w_class = 4.0
+ w_class = 4
/obj/item/weapon/moneybag/attack_hand(user as mob)
var/amt_gold = 0
@@ -20,58 +20,58 @@
var/amt_mime = 0
var/amt_adamantine = 0
- for (var/obj/item/weapon/coin/C in contents)
- if (istype(C,/obj/item/weapon/coin/diamond))
+ for(var/obj/item/weapon/coin/C in contents)
+ if(istype(C,/obj/item/weapon/coin/diamond))
amt_diamond++
- if (istype(C,/obj/item/weapon/coin/plasma))
+ if(istype(C,/obj/item/weapon/coin/plasma))
amt_plasma++
- if (istype(C,/obj/item/weapon/coin/iron))
+ if(istype(C,/obj/item/weapon/coin/iron))
amt_iron++
- if (istype(C,/obj/item/weapon/coin/silver))
+ if(istype(C,/obj/item/weapon/coin/silver))
amt_silver++
- if (istype(C,/obj/item/weapon/coin/gold))
+ if(istype(C,/obj/item/weapon/coin/gold))
amt_gold++
- if (istype(C,/obj/item/weapon/coin/uranium))
+ if(istype(C,/obj/item/weapon/coin/uranium))
amt_uranium++
- if (istype(C,/obj/item/weapon/coin/clown))
+ if(istype(C,/obj/item/weapon/coin/clown))
amt_clown++
- if (istype(C,/obj/item/weapon/coin/mime))
+ if(istype(C,/obj/item/weapon/coin/mime))
amt_mime++
- if (istype(C,/obj/item/weapon/coin/adamantine))
+ if(istype(C,/obj/item/weapon/coin/adamantine))
amt_adamantine++
var/dat = text("The contents of the moneybag reveal... ")
- if (amt_gold)
+ if(amt_gold)
dat += text("Gold coins: [amt_gold] Remove one ")
- if (amt_silver)
+ if(amt_silver)
dat += text("Silver coins: [amt_silver] Remove one ")
- if (amt_iron)
+ if(amt_iron)
dat += text("Metal coins: [amt_iron] Remove one ")
- if (amt_diamond)
+ if(amt_diamond)
dat += text("Diamond coins: [amt_diamond] Remove one ")
- if (amt_plasma)
+ if(amt_plasma)
dat += text("Plasma coins: [amt_plasma] Remove one ")
- if (amt_uranium)
+ if(amt_uranium)
dat += text("Uranium coins: [amt_uranium] Remove one ")
- if (amt_clown)
+ if(amt_clown)
dat += text("Bananium coins: [amt_clown] Remove one ")
- if (amt_mime)
+ if(amt_mime)
dat += text("Tranquillite coins: [amt_mime] Remove one ")
- if (amt_adamantine)
+ if(amt_adamantine)
dat += text("Adamantine coins: [amt_adamantine] Remove one ")
user << browse("[dat]", "window=moneybag")
/obj/item/weapon/moneybag/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
..()
- if (istype(W, /obj/item/weapon/coin))
+ if(istype(W, /obj/item/weapon/coin))
var/obj/item/weapon/coin/C = W
if(!user.drop_item())
return
to_chat(user, "You add the [C.name] into the bag.")
contents += C
- if (istype(W, /obj/item/weapon/moneybag))
+ if(istype(W, /obj/item/weapon/moneybag))
var/obj/item/weapon/moneybag/C = W
- for (var/obj/O in C.contents)
+ for(var/obj/O in C.contents)
contents += O;
to_chat(user, "You empty the [C.name] into the bag.")
return
diff --git a/code/modules/mining/ore_datum.dm b/code/modules/mining/ore_datum.dm
deleted file mode 100644
index 9927b6e5b85..00000000000
--- a/code/modules/mining/ore_datum.dm
+++ /dev/null
@@ -1,55 +0,0 @@
-/datum/ore
- var/oretag
- var/alloy
- var/smelts_to
- var/compresses_to
-
-/datum/ore/uranium
- smelts_to = /obj/item/stack/sheet/mineral/uranium
- oretag = "uranium"
-
-/datum/ore/iron
- smelts_to = /obj/item/stack/sheet/mineral/iron
- alloy = 1
- oretag = "hematite"
-
-/datum/ore/coal
- smelts_to = /obj/item/stack/sheet/mineral/plastic
- alloy = 1
- oretag = "coal"
-
-/datum/ore/glass
- smelts_to = /obj/item/stack/sheet/glass
- compresses_to = /obj/item/stack/sheet/mineral/sandstone
- oretag = "sand"
-
-/datum/ore/plasma
- smelts_to = /obj/item/stack/sheet/mineral/plasma
- oretag = "plasma"
-
-/datum/ore/silver
- smelts_to = /obj/item/stack/sheet/mineral/silver
- oretag = "silver"
-
-/datum/ore/gold
- smelts_to = /obj/item/stack/sheet/mineral/gold
- oretag = "gold"
-
-/datum/ore/diamond
- compresses_to = /obj/item/stack/sheet/mineral/diamond
- oretag = "diamond"
-
-/datum/ore/osmium
- smelts_to = /obj/item/stack/sheet/mineral/platinum
- compresses_to = /obj/item/stack/sheet/mineral/osmium
- alloy = 1
- oretag = "platinum"
-
-/datum/ore/hydrogen
- smelts_to = /obj/item/stack/sheet/mineral/tritium
- compresses_to = /obj/item/stack/sheet/mineral/mhydrogen
- oretag = "hydrogen"
-
-/datum/ore/clown
- smelts_to = /obj/item/stack/sheet/mineral/clown
- oretag = "clown"
\ No newline at end of file
diff --git a/code/modules/mining/satchel_ore_boxdm.dm b/code/modules/mining/satchel_ore_boxdm.dm
index 7d6750c4be4..bf4a615c2e9 100644
--- a/code/modules/mining/satchel_ore_boxdm.dm
+++ b/code/modules/mining/satchel_ore_boxdm.dm
@@ -10,11 +10,11 @@
pressure_resistance = 5*ONE_ATMOSPHERE
/obj/structure/ore_box/attackby(obj/item/weapon/W as obj, mob/user as mob, params)
- if (istype(W, /obj/item/weapon/ore))
+ if(istype(W, /obj/item/weapon/ore))
if(!user.drop_item())
return
W.loc = src
- if (istype(W, /obj/item/weapon/storage))
+ if(istype(W, /obj/item/weapon/storage))
var/obj/item/weapon/storage/S = W
S.hide_from(usr)
for(var/obj/item/weapon/ore/O in S.contents)
@@ -34,52 +34,54 @@
var/amt_mime = 0
var/amt_bluespace = 0
- for (var/obj/item/weapon/ore/C in contents)
- if (istype(C,/obj/item/weapon/ore/diamond))
+ for(var/obj/item/weapon/ore/C in contents)
+ if(istype(C,/obj/item/weapon/ore/diamond))
amt_diamond++
- if (istype(C,/obj/item/weapon/ore/glass))
+ if(istype(C,/obj/item/weapon/ore/glass))
amt_glass++
- if (istype(C,/obj/item/weapon/ore/plasma))
+ if(istype(C,/obj/item/weapon/ore/plasma))
amt_plasma++
- if (istype(C,/obj/item/weapon/ore/iron))
+ if(istype(C,/obj/item/weapon/ore/iron))
amt_iron++
- if (istype(C,/obj/item/weapon/ore/silver))
+ if(istype(C,/obj/item/weapon/ore/silver))
amt_silver++
- if (istype(C,/obj/item/weapon/ore/gold))
+ if(istype(C,/obj/item/weapon/ore/gold))
amt_gold++
- if (istype(C,/obj/item/weapon/ore/uranium))
+ if(istype(C,/obj/item/weapon/ore/uranium))
amt_uranium++
- if (istype(C,/obj/item/weapon/ore/bananium))
+ if(istype(C,/obj/item/weapon/ore/bananium))
amt_clown++
- if (istype(C,/obj/item/weapon/ore/tranquillite))
+ if(istype(C,/obj/item/weapon/ore/tranquillite))
amt_mime++
- if (istype(C,/obj/item/weapon/ore/bluespace_crystal))
+ if(istype(C,/obj/item/weapon/ore/bluespace_crystal))
amt_bluespace++
var/dat = text("The contents of the ore box reveal... ")
- if (amt_gold)
+ if(amt_gold)
dat += text("Gold ore: [amt_gold] ")
- if (amt_silver)
+ if(amt_silver)
dat += text("Silver ore: [amt_silver] ")
- if (amt_iron)
+ if(amt_iron)
dat += text("Metal ore: [amt_iron] ")
- if (amt_glass)
+ if(amt_glass)
dat += text("Sand: [amt_glass] ")
- if (amt_diamond)
+ if(amt_diamond)
dat += text("Diamond ore: [amt_diamond] ")
- if (amt_plasma)
+ if(amt_plasma)
dat += text("Plasma ore: [amt_plasma] ")
- if (amt_uranium)
+ if(amt_uranium)
dat += text("Uranium ore: [amt_uranium] ")
- if (amt_clown)
+ if(amt_clown)
dat += text("Bananium ore: [amt_clown] ")
- if (amt_mime)
+ if(amt_mime)
dat += text("Tranquillite ore: [amt_mime] ")
- if (amt_bluespace)
+ if(amt_bluespace)
dat += text("Bluespace crystals: [amt_bluespace] ")
dat += text("
Empty box")
- user << browse("[dat]", "window=orebox")
+ var/datum/browser/popup = new(user, "orebox", name, 400, 400)
+ popup.set_content(dat)
+ popup.open(0)
return
/obj/structure/ore_box/Topic(href, href_list)
@@ -88,7 +90,7 @@
usr.set_machine(src)
src.add_fingerprint(usr)
if(href_list["removeall"])
- for (var/obj/item/weapon/ore/O in contents)
+ for(var/obj/item/weapon/ore/O in contents)
contents -= O
O.loc = src.loc
to_chat(usr, "You empty the box.")
@@ -122,7 +124,7 @@ obj/structure/ore_box/ex_act(severity, target)
to_chat(usr, "The ore box is empty.")
return
- for (var/obj/item/weapon/ore/O in contents)
+ for(var/obj/item/weapon/ore/O in contents)
contents -= O
O.loc = src.loc
to_chat(usr, "You empty the ore box.")
diff --git a/code/modules/mining/security_recipes.dm b/code/modules/mining/security_recipes.dm
deleted file mode 100644
index 9cbdeadc154..00000000000
--- a/code/modules/mining/security_recipes.dm
+++ /dev/null
@@ -1,128 +0,0 @@
-/obj/machinery/manufacturer/security
- name = "Security Fabricator"
- desc = "A manufacturing unit calibrated to produce security and military related equipment."
- acceptdisk = 1
-
- New()
- ..()
- src.available += new /datum/manufacture/beret(src)
- src.available += new /datum/manufacture/helmet1(src)
- src.available += new /datum/manufacture/sunglasses(src)
- src.available += new /datum/manufacture/sechud(src)
- src.available += new /datum/manufacture/secpants(src)
- src.available += new /datum/manufacture/secbelt(src)
- src.available += new /datum/manufacture/armor1(src)
- src.available += new /datum/manufacture/taser(src)
- src.available += new /datum/manufacture/baton(src)
-
-// Security Gear Tier-0. AKA Clothing and basic as shit gear.
-/datum/manufacture/beret
- name = "Beret"
- item = /obj/item/clothing/head/beret/sec
- cost1 = /obj/item/weapon/ore/fabric
- cname1 = "Fabric"
- amount1 = 2
- time = 3
- create = 1
-
-/datum/manufacture/helmet1
- name = "Helmet"
- item = /obj/item/clothing/head/helmet
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/fabric
- cname2 = "Fabric"
- amount2 = 10
- time = 10
- create = 1
-
-/datum/manufacture/sunglasses
- name = "Sunglasses"
- item = /obj/item/clothing/glasses/sunglasses
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 5
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 10
- time = 8
- create = 1
-
-/datum/manufacture/sechud
- name = "Security HUD"
- item = /obj/item/clothing/glasses/hud/security
- cost1 = /obj/item/weapon/ore/osmium
- cname1 = "Platinum"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 15
- time = 12
- create = 1
-
-/datum/manufacture/secpants
- name = "Security Uniform"
- item = /obj/item/clothing/under/rank/security
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/fabric
- cname2 = "Fabric"
- amount2 = 1
- time = 10
- create = 1
-
-/datum/manufacture/secbelt
- name = "Security Belt"
- item = /obj/item/weapon/storage/belt/security
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 2
- cost2 = /obj/item/weapon/ore/fabric
- cname2 = "Fabric"
- amount2 = 5
- time = 15
- create = 1
-
-/datum/manufacture/armor1
- name = "Armored Vest"
- item = /obj/item/clothing/suit/armor/vest
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 15
- cost2 = /obj/item/weapon/ore/fabric
- cname2 = "Fabric"
- amount2 = 15
- time = 20
- create = 1
-
-/datum/manufacture/taser
- name = "Advanced Taser"
- item = /obj/item/weapon/gun/energy/gun/advtaser
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 15
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 10
- cost3 = /obj/item/weapon/ore/osmium
- cname3 = "Platinum"
- amount3 = 20
- time = 25
- create = 1
-
-/datum/manufacture/baton
- name = "Stun Baton"
- item = /obj/item/weapon/melee/baton
- cost1 = /obj/item/weapon/ore/iron
- cname1 = "Iron"
- amount1 = 10
- cost2 = /obj/item/weapon/ore/glass
- cname2 = "Glass"
- amount2 = 10
- cost3 = /obj/item/weapon/ore/osmium
- cname3 = "Platinum"
- amount3 = 15
- time = 20
- create = 1
\ No newline at end of file
diff --git a/code/modules/mining/surprise.dm b/code/modules/mining/surprise.dm
deleted file mode 100644
index 48ecbdd5356..00000000000
--- a/code/modules/mining/surprise.dm
+++ /dev/null
@@ -1,342 +0,0 @@
-#define CONTIGUOUS_WALLS 1
-#define CONTIGUOUS_FLOORS 2
-
-#define TURF_FLOOR 0
-#define TURF_WALL 1
-var/global/list/mining_surprises = subtypesof(/mining_surprise)
-
-/surprise_turf_info
- var/list/types[0]
- var/list/adjacents
- var/turf_type=TURF_FLOOR
-
- New()
- adjacents=list(
- "[NORTH]"=list(),
- "[SOUTH]"=list(),
- "[EAST]"=list(),
- "[WEST]"=list()
- )
-
- proc/GetAdjacentTypes(var/dir)
- return adjacents["[dir]"]
-
-/surprise_room
- var/list/turfs[0]
-
- // Used for layout system.
- var/list/turf_info[0]
-
- var/size_x=0
- var/size_y=0
-
- proc/UpdateTurfs()
- for(var/turf/T in turfs)
- UpdateTurf(T)
-
- proc/GetTurfs(var/ttype)
- var/list/selected[0]
- for(var/turf/T in turfs)
- var/surprise_turf_info/Ti = GetTurfInfo(T)
- if(Ti.turf_type==ttype)
- selected |= T
- return selected
-
- proc/GetTurfInfo(var/turf/T)
- var/surprise_turf_info/sti
- if(!(T in turf_info))
- sti = new
- turf_info[T]=sti
- else
- sti = turf_info[T]
- return sti
-
- proc/UpdateTurf(var/turf/T, var/no_adjacent=0)
- // List types in this turf.
- var/surprise_turf_info/sti = GetTurfInfo(T)
-
- sti.types=0
- for(var/atom/A in T.contents)
- sti.types |= A.type
-
- if(no_adjacent) return
- UpdateAdjacentsOfTurf(T)
-
- proc/AddTypeToTurf(var/turf/T, var/newtype)
- var/surprise_turf_info/sti = GetTurfInfo(T)
- sti.types |= newtype
-
- //UpdateAdjacentsOfTurf(T)
-
- proc/UpdateAdjacentsOfTurf(var/turf/T)
- var/surprise_turf_info/Ti = turf_info[T]
- for(var/dir in cardinal)
- var/turf/AT = get_step(T,dir)
- if(!(AT in turfs))
- return
- if(!(AT in turf_info))
- UpdateTurf(AT, no_adjacent=1)
- var/surprise_turf_info/ATi = turf_info[AT]
- // By-Ref so shit gets updated.
- ATi.adjacents["[reverse_direction(dir)]"]=Ti.types
-
-
-// For room layouts.
-/layout_rule
- var/mining_surprise/root
- var/surprise_room/room
-
- // What to place if true
- var/placetype=null
-
- var/min_to_place=5 // Force placement at ALL candidates.
- var/max_to_place=10 // 0 = max amount of ALL candidates.
-
- var/placed_times=0
-
- var/list/decorations=list() // types, empty for no decorations
-
- var/flags = 0
-
- New(var/mining_surprise/_root,var/surprise_room/_room)
- root=_root
- room=_room
-
- // Called in Evaluate
- proc/Plop(var/turf/T)
- new placetype(T)
- placed_times++
- room.AddTypeToTurf(T,placetype)
- if(decorations.len)
- var/decoration = pickweight(decorations)
- new decoration(T)
- room.AddTypeToTurf(T,decoration)
-
- // Return 1 if we Plop()'d something.
- // Return 0 if we didn't or something went wrong.
- proc/Evaluate()
- var/list/candidates=GetCandidates()
- if(candidates.len==0)
- return 0
- if(max_to_place<=0)
- max_to_place=candidates.len
- var/n=candidates.len
- if(min_to_place>0)
- n = min(candidates.len,rand(min_to_place,max_to_place))
- if(n==0)
- return 0
- for(var/i=0;i0)
- var/turf/weed_turf = pick(w_cand)
- w_cand -= weed_turf
- if(weed_turf.density)
- continue
- if(locate(/obj/structure/alien) in weed_turf)
- continue
- if(weed_turf && !egged)
- new /obj/structure/alien/weeds/node(weed_turf)
- weeds += weed_turf
- break
-
- for(var/e=0;e 1)
- return
+ return 0
- if (pressure < ONE_ATMOSPHERE*0.4) //sound distortion pressure, to help clue people in that the air is thin, even if it isn't a vacuum yet
+ if(pressure < ONE_ATMOSPHERE * 0.4) //sound distortion pressure, to help clue people in that the air is thin, even if it isn't a vacuum yet
italics = 1
- sound_vol *= 0.5 //muffle the sound a bit, so it's like we're actually talking through contact
+ sound_vol *= 0.5
- if(sleeping || stat == 1)
+ if(sleeping || stat == UNCONSCIOUS)
hear_sleep(message)
- return
+ return 0
//non-verbal languages are garbled if you can't see the speaker. Yes, this includes if they are inside a closet.
- if (language && (language.flags & NONVERBAL))
- if (!speaker || (src.sdisabilities & BLIND || src.blinded) || !(speaker in view(src)))
+ if(language && (language.flags & NONVERBAL))
+ if(disabilities & BLIND || blinded) //blind people can't see dumbass
message = stars(message)
- if(!(language && (language.flags & INNATE))) // skip understanding checks for INNATE languages
- if(!say_understands(speaker,language))
- if(istype(speaker,/mob/living/simple_animal))
- var/mob/living/simple_animal/S = speaker
- if(S.speak.len)
- message = pick(S.speak)
- else
- stars(message)
+ if(!speaker || !(speaker in view(src)))
+ message = stars(message)
+
+ if(!say_understands(speaker, language))
+ if(isanimal(speaker))
+ var/mob/living/simple_animal/S = speaker
+ if(S.speak.len)
+ message = pick(S.speak)
else
- if(language)
- message = language.scramble(message)
- else
- message = stars(message)
+ message = stars(message)
+ else
+ if(language)
+ message = language.scramble(message)
+ else
+ message = stars(message)
var/speaker_name = speaker.name
- if(istype(speaker, /mob/living/carbon/human))
+ if(ishuman(speaker))
var/mob/living/carbon/human/H = speaker
speaker_name = H.GetVoice()
@@ -53,7 +56,7 @@
message = "[message]"
var/track = null
- if(istype(src, /mob/dead/observer))
+ if(isobserver(src))
if(italics && client.prefs.toggles & CHAT_GHOSTRADIO)
return
if(speaker_name != speaker.real_name && speaker.real_name)
@@ -62,7 +65,7 @@
if(client.prefs.toggles & CHAT_GHOSTEARS && speaker in view(src))
message = "[message]"
- if(sdisabilities & DEAF || ear_deaf)
+ if(disabilities & DEAF || ear_deaf)
if(!language || !(language.flags & INNATE)) // INNATE is the flag for audible-emote-language, so we don't want to show an "x talks but you cannot hear them" message if it's set
if(speaker == src)
to_chat(src, "You cannot hear yourself speak!")
@@ -73,17 +76,16 @@
to_chat(src, "[speaker_name][alt_name] [track][language.format_message(message, verb)]")
else
to_chat(src, "[speaker_name][alt_name] [track][verb], \"[message]\"")
- if (speech_sound && (get_dist(speaker, src) <= world.view && src.z == speaker.z))
+ if(speech_sound && (get_dist(speaker, src) <= world.view && src.z == speaker.z))
var/turf/source = speaker? get_turf(speaker) : get_turf(src)
src.playsound_local(source, speech_sound, sound_vol, 1)
-/mob/proc/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0, var/vname ="", var/atom/follow_target)
-
+/mob/proc/hear_radio(var/message, var/verb = "says", var/datum/language/language = null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0, var/vname = "", var/atom/follow_target)
if(!client)
return
- if(sleeping || stat==1) //If unconscious or sleeping
+ if(sleeping || stat == UNCONSCIOUS) //If unconscious or sleeping
hear_sleep(message)
return
@@ -92,26 +94,28 @@
follow_target = speaker
//non-verbal languages are garbled if you can't see the speaker. Yes, this includes if they are inside a closet.
- if (language && (language.flags & NONVERBAL))
- if (!speaker || (src.sdisabilities & BLIND || src.blinded) || !(speaker in view(src)))
+ if(language && (language.flags & NONVERBAL))
+ if(disabilities & BLIND || blinded) //blind people can't see dumbass
message = stars(message)
- if(!(language && (language.flags & INNATE))) // skip understanding checks for INNATE languages
- if(!say_understands(speaker,language))
- if(isanimal(speaker))
- var/mob/living/simple_animal/S = speaker
- if(S.speak && S.speak.len)
- message = pick(S.speak)
- else
- return
+ if(!speaker || !(speaker in view(src)))
+ message = stars(message)
+
+ if(!say_understands(speaker, language))
+ if(isanimal(speaker))
+ var/mob/living/simple_animal/S = speaker
+ if(S.speak && S.speak.len)
+ message = pick(S.speak)
else
- if(language)
- message = language.scramble(message)
- else
- message = stars(message)
+ return
+ else
+ if(language)
+ message = language.scramble(message)
+ else
+ message = stars(message)
- if(hard_to_hear)
- message = stars(message)
+ if(hard_to_hear)
+ message = stars(message)
var/speaker_name = "unknown"
if(speaker)
@@ -128,7 +132,7 @@
var/jobname // the mob's "job"
var/mob/living/carbon/human/impersonating //The crewmember being impersonated, if any.
- if (ishuman(speaker))
+ if(ishuman(speaker))
var/mob/living/carbon/human/H = speaker
var/obj/item/weapon/card/id/id = H.wear_id
@@ -143,15 +147,15 @@
else
jobname = H.get_assignment()
- else if (iscarbon(speaker)) // Nonhuman carbon mob
+ else if(iscarbon(speaker)) // Nonhuman carbon mob
jobname = "No ID"
- else if (isAI(speaker))
+ else if(isAI(speaker))
jobname = "AI"
- else if (isrobot(speaker))
+ else if(isrobot(speaker))
jobname = "Cyborg"
- else if (ispAI(speaker))
+ else if(ispAI(speaker))
jobname = "Personal AI"
- else if (isAutoAnnouncer(speaker))
+ else if(isAutoAnnouncer(speaker))
var/mob/living/automatedannouncer/AA = speaker
jobname = AA.role
else
@@ -178,7 +182,7 @@
formatted = language.format_message_radio(message, verb)
else
formatted = "[verb], \"[message]\""
- if(sdisabilities & DEAF || ear_deaf)
+ if(disabilities & DEAF || ear_deaf)
if(prob(20))
to_chat(src, "You feel your headset vibrate but can hear nothing from it!")
else if(track)
diff --git a/code/modules/mob/inventory.dm b/code/modules/mob/inventory.dm
index bbc313e0421..9ebbb29ac02 100644
--- a/code/modules/mob/inventory.dm
+++ b/code/modules/mob/inventory.dm
@@ -110,7 +110,7 @@
if(!I) //If there's nothing to drop, the drop is automatically succesfull. If(unEquip) should generally be used to check for NODROP.
return 1
- if((I.flags & NODROP) && !force)
+ if(!canUnEquip(I, force))
return 0
if(I == r_hand)
@@ -165,7 +165,7 @@
return list(wear_mask, back, l_hand, r_hand)
/mob/proc/get_id_card()
- for(var/obj/item/I in src.get_all_slots())
+ for(var/obj/item/I in get_all_slots())
. = I.GetID()
if(.)
break
diff --git a/code/modules/mob/language.dm b/code/modules/mob/language.dm
index bc8182f4049..abe6742fecc 100644
--- a/code/modules/mob/language.dm
+++ b/code/modules/mob/language.dm
@@ -276,6 +276,24 @@
flags = RESTRICTED | WHITELISTED
syllables = list("blob","plop","pop","bop","boop")
+/datum/language/grey
+ name = "Psionic Communication"
+ desc = "The grey's psionic communication, less potent version of their distant cousin's telepathy. Talk to other greys within a limited radius."
+ speech_verb = "expresses"
+ ask_verb = "inquires"
+ exclaim_verb = "imparts"
+ colour = "abductor"
+ key = "^"
+ flags = RESTRICTED | HIVEMIND
+
+/datum/language/grey/broadcast(var/mob/living/speaker,var/message,var/speaker_mask)
+ ..(speaker,message,speaker.real_name)
+
+/datum/language/grey/check_special_condition(var/mob/living/carbon/human/other, var/mob/living/carbon/human/speaker)
+ if(other in range(7, speaker))
+ return 1
+ return 0
+
/datum/language/drask
name = "Orluum"
desc = "The droning, vibrous language of the Drask. It sounds somewhat like whalesong."
@@ -500,24 +518,24 @@
if(!speaker.binarycheck())
return
- if (!message)
+ if(!message)
return
var/message_start = "[name], [speaker.name]"
var/message_body = "[speaker.say_quote(message)], \"[message]\""
- for (var/mob/M in dead_mob_list)
+ for(var/mob/M in dead_mob_list)
if(!istype(M,/mob/new_player) && !istype(M,/mob/living/carbon/brain))
var/message_start_dead = "[name], [speaker.name] ([ghost_follow_link(speaker, ghost=M)])"
M.show_message("[message_start_dead] [message_body]", 2)
- for (var/mob/living/S in living_mob_list)
+ for(var/mob/living/S in living_mob_list)
if(drone_only && !istype(S,/mob/living/silicon/robot/drone))
continue
else if(istype(S , /mob/living/silicon/ai))
message_start = "[name], [speaker.name]"
- else if (!S.binarycheck())
+ else if(!S.binarycheck())
continue
S.show_message("[message_start] [message_body]", 2)
@@ -525,17 +543,11 @@
var/list/listening = hearers(1, src)
listening -= src
- for (var/mob/living/M in listening)
+ for(var/mob/living/M in listening)
if(istype(M, /mob/living/silicon) || M.binarycheck())
continue
M.show_message("synthesised voicebeeps, \"beep beep beep\"",2)
- //robot binary xmitter component power usage
- if (isrobot(speaker))
- var/mob/living/silicon/robot/R = speaker
- var/datum/robot_component/C = R.components["comms"]
- R.use_power(C.energy_consumption)
-
/datum/language/binary/drone
name = "Drone Talk"
desc = "A heavily encoded damage control coordination stream."
diff --git a/code/modules/mob/living/carbon/alien/alien.dm b/code/modules/mob/living/carbon/alien/alien.dm
index 74e9fbfce93..124a1120df6 100644
--- a/code/modules/mob/living/carbon/alien/alien.dm
+++ b/code/modules/mob/living/carbon/alien/alien.dm
@@ -118,11 +118,11 @@
/mob/living/carbon/alien/handle_mutations_and_radiation()
// Aliens love radiation nom nom nom
- if (radiation)
- if (radiation > 100)
+ if(radiation)
+ if(radiation > 100)
radiation = 100
- if (radiation < 0)
+ if(radiation < 0)
radiation = 0
switch(radiation)
@@ -228,8 +228,8 @@ Proc: AddInfectionImages()
Des: Gives the client of the alien an image on each infected mob.
----------------------------------------*/
/mob/living/carbon/alien/proc/AddInfectionImages()
- if (client)
- for (var/mob/living/C in mob_list)
+ if(client)
+ for(var/mob/living/C in mob_list)
if(C.status_flags & XENO_HOST)
var/obj/item/organ/internal/body_egg/alien_embryo/A = C.get_int_organ(/obj/item/organ/internal/body_egg/alien_embryo)
if(A)
@@ -243,7 +243,7 @@ Proc: RemoveInfectionImages()
Des: Removes all infected images from the alien.
----------------------------------------*/
/mob/living/carbon/alien/proc/RemoveInfectionImages()
- if (client)
+ if(client)
for(var/image/I in client.images)
if(dd_hasprefix_case(I.icon_state, "infected"))
qdel(I)
diff --git a/code/modules/mob/living/carbon/alien/alien_defenses.dm b/code/modules/mob/living/carbon/alien/alien_defenses.dm
index 397a14fc259..3f2e2d28b78 100644
--- a/code/modules/mob/living/carbon/alien/alien_defenses.dm
+++ b/code/modules/mob/living/carbon/alien/alien_defenses.dm
@@ -6,17 +6,17 @@ As such, they can either help or harm other aliens. Help works like the human he
In all, this is a lot like the monkey code. /N
*/
/mob/living/carbon/alien/attack_alien(mob/living/carbon/alien/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
sleeping = max(0,sleeping-5)
resting = 0
AdjustParalysis(-3)
@@ -24,12 +24,12 @@ In all, this is a lot like the monkey code. /N
AdjustWeakened(-3)
visible_message("[M.name] nuzzles [src] trying to wake it up!")
- if (I_GRAB)
+ if(I_GRAB)
src.grabbedby(M)
return 1
else
- if (health > 0)
+ if(health > 0)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
var/damage = 1
visible_message("[M.name] bites [src]!", \
@@ -57,7 +57,7 @@ In all, this is a lot like the monkey code. /N
help_shake_act(M)
if(I_GRAB)
src.grabbedby(M)
- if (I_HARM, I_DISARM)
+ if(I_HARM, I_DISARM)
return 1
return 0
diff --git a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm
index 9311ab0592f..28439ab0ff2 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/alien_powers.dm
@@ -57,10 +57,10 @@ Doesn't work on other aliens/AI.*/
if(isalien(M))
var/amount = input("Amount:", "Transfer Plasma to [M]") as num
- if (amount)
+ if(amount)
amount = abs(round(amount))
if(powerc(amount))
- if (get_dist(src,M) <= 1)
+ if(get_dist(src,M) <= 1)
M.adjustPlasma(amount)
adjustPlasma(-amount)
to_chat(M, "[src] has transfered [amount] plasma to you.")
diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
index a5e72059ab8..f0af54a45ab 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/caste/hunter.dm
@@ -18,8 +18,8 @@
/mob/living/carbon/alien/humanoid/hunter/handle_regular_hud_updates()
..() //-Yvarov
- if (healths)
- if (stat != 2)
+ if(healths)
+ if(stat != 2)
switch(health)
if(125 to INFINITY)
healths.icon_state = "health0"
@@ -85,7 +85,7 @@
leaping = 0
update_icons()
-/mob/living/carbon/alien/humanoid/hunter/throw_impact(A)
+/mob/living/carbon/alien/humanoid/hunter/throw_impact(atom/A)
if(!leaping)
return ..()
@@ -93,20 +93,26 @@
if(A)
if(istype(A, /mob/living))
var/mob/living/L = A
- L.visible_message("[src] pounces on [L]!", "[src] pounces on you!")
- if(ishuman(L))
- var/mob/living/carbon/human/H = L
- H.apply_effect(5, WEAKEN, H.run_armor_check(null, "melee"))
- else
- L.Weaken(5)
- sleep(2)//Runtime prevention (infinite bump() calls on hulks)
- step_towards(src,L)
+ var/blocked = 0
+ if(ishuman(A))
+ var/mob/living/carbon/human/H = A
+ if(H.check_shields(90, "the [name]", src, attack_type = THROWN_PROJECTILE_ATTACK))
+ blocked = 1
+ if(!blocked)
+ L.visible_message("[src] pounces on [L]!", "[src] pounces on you!")
+ if(ishuman(L))
+ var/mob/living/carbon/human/H = L
+ H.apply_effect(5, WEAKEN, H.run_armor_check(null, "melee"))
+ else
+ L.Weaken(5)
+ sleep(2)//Runtime prevention (infinite bump() calls on hulks)
+ step_towards(src,L)
toggle_leap(0)
pounce_cooldown = !pounce_cooldown
spawn(pounce_cooldown_time) //3s by default
pounce_cooldown = !pounce_cooldown
- else
+ else if(A.density && !A.CanPass(src))
visible_message("[src] smashes into [A]!", "[src] smashes into [A]!")
weakened = 2
diff --git a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
index 831d01dbc87..d93fb0a835c 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/caste/sentinel.dm
@@ -49,8 +49,8 @@
/mob/living/carbon/alien/humanoid/sentinel/handle_regular_hud_updates()
..() //-Yvarov
- if (healths)
- if (stat != 2)
+ if(healths)
+ if(stat != 2)
switch(health)
if(150 to INFINITY)
healths.icon_state = "health0"
diff --git a/code/modules/mob/living/carbon/alien/humanoid/emote.dm b/code/modules/mob/living/carbon/alien/humanoid/emote.dm
index 3b7d0b5d1b9..05eb2c8e226 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/emote.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/emote.dm
@@ -1,6 +1,6 @@
/mob/living/carbon/alien/humanoid/emote(var/act,var/m_type=1,var/message = null)
var/param = null
- if (findtext(act, "-", 1, null))
+ if(findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
@@ -18,23 +18,23 @@
if(num)
message = "\The [src] signs [num]."
m_type = 1
- if ("burp")
- if (!muzzled)
+ if("burp")
+ if(!muzzled)
message = "\The [src] burps."
m_type = 2
- if ("deathgasp")
+ if("deathgasp")
message = "\The [src] lets out a waning guttural screech, green blood bubbling from its maw..."
m_type = 2
if("scratch")
- if (!src.restrained())
+ if(!src.restrained())
message = "\The [src] scratches."
m_type = 1
if("whimper")
- if (!muzzled)
+ if(!muzzled)
message = "\The [src] whimpers."
m_type = 2
if("roar")
- if (!muzzled)
+ if(!muzzled)
message = "\The [src] roars."
m_type = 2
if("hiss")
@@ -54,7 +54,7 @@
message = "\The [src] drools."
m_type = 1
if("scretch")
- if (!muzzled)
+ if(!muzzled)
message = "\The [src] scretches."
m_type = 2
if("choke")
@@ -79,18 +79,18 @@
message = "\The [src] twitches violently."
m_type = 1
if("dance")
- if (!src.restrained())
+ if(!src.restrained())
message = "\The [src] dances around happily."
m_type = 1
if("roll")
- if (!src.restrained())
+ if(!src.restrained())
message = "\The [src] rolls."
m_type = 1
if("shake")
message = "\The [src] shakes its head."
m_type = 1
if("gnarl")
- if (!muzzled)
+ if(!muzzled)
message = "\The [src] gnarls and shows its teeth.."
m_type = 2
if("jump")
@@ -100,7 +100,7 @@
Paralyse(2)
message = "\The [src] collapses!"
m_type = 2
- if ("flip")
+ if("flip")
m_type = 1
message = "\The [src] does a flip!"
src.SpinAnimation(5,1)
@@ -108,8 +108,8 @@
to_chat(src, "burp, flip, deathgasp, choke, collapse, dance, drool, gasp, shiver, gnarl, jump, moan, nod, roar, roll, scratch,\nscretch, shake, sign-#, sit, sulk, sway, tail, twitch, whimper")
if(!stat)
- if (act == "roar")
+ if(act == "roar")
playsound(src.loc, 'sound/voice/hiss5.ogg', 40, 1, 1)
- if (act == "deathgasp")
+ if(act == "deathgasp")
playsound(src.loc, 'sound/voice/hiss6.ogg', 80, 1, 1)
..(act, m_type, message)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/humanoid/empress.dm b/code/modules/mob/living/carbon/alien/humanoid/empress.dm
index ffc8e04429e..d2553c9a28f 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/empress.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/empress.dm
@@ -56,8 +56,8 @@
..() //-Yvarov
- if (src.healths)
- if (src.stat != 2)
+ if(src.healths)
+ if(src.stat != 2)
switch(health)
if(250 to INFINITY)
src.healths.icon_state = "health0"
diff --git a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
index 90fe6537759..9f47fc9910c 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/humanoid.dm
@@ -29,22 +29,22 @@
//This is fine, works the same as a human
/mob/living/carbon/alien/humanoid/Bump(atom/movable/AM as mob|obj, yes)
spawn( 0 )
- if ((!( yes ) || now_pushing))
+ if((!( yes ) || now_pushing))
return
now_pushing = 0
..()
- if (!istype(AM, /atom/movable))
+ if(!istype(AM, /atom/movable))
return
- if (ismob(AM))
+ if(ismob(AM))
var/mob/tmob = AM
tmob.LAssailant = src
- if (!now_pushing)
+ if(!now_pushing)
now_pushing = 1
- if (!AM.anchored)
+ if(!AM.anchored)
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window/full))
+ if(istype(AM, /obj/structure/window/full))
for(var/obj/structure/window/win in get_step(AM,t))
now_pushing = 0
return
@@ -55,13 +55,13 @@
/mob/living/carbon/alien/humanoid/movement_delay()
var/tally = 0
- if (istype(src, /mob/living/carbon/alien/humanoid/queen))
+ if(istype(src, /mob/living/carbon/alien/humanoid/queen))
tally += 4
- if (istype(src, /mob/living/carbon/alien/humanoid/drone))
+ if(istype(src, /mob/living/carbon/alien/humanoid/drone))
tally += 0
- if (istype(src, /mob/living/carbon/alien/humanoid/sentinel))
+ if(istype(src, /mob/living/carbon/alien/humanoid/sentinel))
tally += 0
- if (istype(src, /mob/living/carbon/alien/humanoid/hunter))
+ if(istype(src, /mob/living/carbon/alien/humanoid/hunter))
tally = -2 // hunters go supersuperfast
return (tally + move_delay_add + config.alien_delay)
@@ -85,26 +85,24 @@
var/b_loss = null
var/f_loss = null
- switch (severity)
- if (1.0)
+ switch(severity)
+ if(1.0)
gib()
return
- if (2.0)
- if (!shielded)
+ if(2.0)
+ if(!shielded)
b_loss += 60
f_loss += 60
- ear_damage += 30
- ear_deaf += 120
+ adjustEarDamage(30, 120)
if(3.0)
b_loss += 30
- if (prob(50) && !shielded)
+ if(prob(50) && !shielded)
Paralyse(1)
- ear_damage += 15
- ear_deaf += 60
+ adjustEarDamage(15,60)
adjustBruteLoss(b_loss)
adjustFireLoss(f_loss)
@@ -112,13 +110,13 @@
updatehealth()
/mob/living/carbon/alien/humanoid/attack_slime(mob/living/carbon/slime/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
if(M.Victim) return // can't attack while eating!
- if (stat > -100)
+ if(stat > -100)
M.do_attack_animation(src)
visible_message("The [M.name] glomps [src]!", \
@@ -153,7 +151,7 @@
"The [M.name] has shocked [src]!")
Weaken(power)
- if (stuttering < power)
+ if(stuttering < power)
stuttering = power
Stun(power)
@@ -161,7 +159,7 @@
s.set_up(5, 1, src)
s.start()
- if (prob(stunprob) && M.powerlevel >= 8)
+ if(prob(stunprob) && M.powerlevel >= 8)
adjustFireLoss(M.powerlevel * rand(6,10))
@@ -183,11 +181,11 @@
updatehealth()
/mob/living/carbon/alien/humanoid/attack_hand(mob/living/carbon/human/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -196,17 +194,17 @@
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
help_shake_act(M)
- if (I_GRAB)
+ if(I_GRAB)
grabbedby(M)
- if (I_HARM)
+ if(I_HARM)
M.do_attack_animation(src)
var/damage = rand(1, 9)
- if (prob(90))
- if (HULK in M.mutations)//HULK SMASH
+ if(prob(90))
+ if(HULK in M.mutations)//HULK SMASH
damage = 15
spawn(0)
Paralyse(1)
@@ -216,7 +214,7 @@
playsound(loc, "punch", 25, 1, -1)
visible_message("[M] has punched [src]!", \
"[M] has punched [src]!")
- if ((stat != DEAD) && (damage > 9||prob(5)))//Regular humans have a very small chance of weakening an alien.
+ if((stat != DEAD) && (damage > 9||prob(5)))//Regular humans have a very small chance of weakening an alien.
Paralyse(2)
visible_message("[M] has weakened [src]!", \
"[M] has weakened [src]!", \
@@ -227,15 +225,15 @@
playsound(loc, 'sound/weapons/punchmiss.ogg', 25, 1, -1)
visible_message("[M] has attempted to punch [src]!")
- if (I_DISARM)
- if (!lying)
- if (prob(5))//Very small chance to push an alien down.
+ if(I_DISARM)
+ if(!lying)
+ if(prob(5))//Very small chance to push an alien down.
Paralyse(2)
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("[M] has pushed down [src]!", \
"[M] has pushed down [src]!")
else
- if (prob(50))
+ if(prob(50))
drop_item()
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("[M] has disarmed [src]!", \
@@ -251,11 +249,11 @@ In all, this is a lot like the monkey code. /N
*/
/mob/living/carbon/alien/humanoid/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -263,7 +261,7 @@ In all, this is a lot like the monkey code. /N
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
sleeping = max(0,sleeping-5)
resting = 0
AdjustParalysis(-3)
@@ -272,7 +270,7 @@ In all, this is a lot like the monkey code. /N
visible_message("[M.name] nuzzles [src] trying to wake it up!")
else
- if (health > 0)
+ if(health > 0)
M.do_attack_animation(src)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
var/damage = rand(1, 3)
@@ -294,7 +292,7 @@ In all, this is a lot like the monkey code. /N
else
- if (health > 0)
+ if(health > 0)
L.do_attack_animation(src)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
var/damage = rand(1, 3)
@@ -310,7 +308,7 @@ In all, this is a lot like the monkey code. /N
/mob/living/carbon/alien/humanoid/restrained()
- if (handcuffed)
+ if(handcuffed)
return 1
return 0
diff --git a/code/modules/mob/living/carbon/alien/humanoid/life.dm b/code/modules/mob/living/carbon/alien/humanoid/life.dm
index b41d5a9705d..4cccb6e57ed 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/life.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/life.dm
@@ -15,24 +15,24 @@
/mob/living/carbon/alien/humanoid/handle_disabilities()
- if (disabilities & EPILEPSY)
- if ((prob(1) && paralysis < 10))
+ if(disabilities & EPILEPSY)
+ if((prob(1) && paralysis < 10))
to_chat(src, "You have a seizure!")
Paralyse(10)
- if (disabilities & COUGHING)
- if ((prob(5) && paralysis <= 1))
+ if(disabilities & COUGHING)
+ if((prob(5) && paralysis <= 1))
drop_item()
spawn( 0 )
emote("cough")
return
- if (disabilities & TOURETTES)
- if ((prob(10) && paralysis <= 1))
+ if(disabilities & TOURETTES)
+ if((prob(10) && paralysis <= 1))
Stun(10)
spawn( 0 )
emote("twitch")
return
- if (disabilities & NERVOUS)
- if (prob(10))
+ if(disabilities & NERVOUS)
+ if(prob(10))
stuttering = max(10, stuttering)
/mob/living/carbon/alien/humanoid/proc/adjust_body_temperature(current, loc_temp, boost)
@@ -59,7 +59,7 @@
blinded = 1
silent = 0
else //ALIVE. LIGHTS ARE ON
- if(health < config.health_threshold_dead || brain_op_stage == 4.0)
+ if(health < config.health_threshold_dead || !get_int_organ(/obj/item/organ/internal/brain))
death()
blinded = 1
stat = DEAD
@@ -95,7 +95,7 @@
move_delay_add = max(0, move_delay_add - rand(1, 2))
//Eyes
- if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own
+ if(disabilities & BLIND) //disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
@@ -104,12 +104,12 @@
eye_blurry = max(eye_blurry-1, 0)
//Ears
- if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own
- ear_deaf = max(ear_deaf, 1)
+ if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
+ setEarDamage(-1, max(ear_deaf, 1))
else if(ear_deaf) //deafness, heals slowly over time
- ear_deaf = max(ear_deaf-1, 0)
+ adjustEarDamage(0,-1)
else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs
- ear_damage = max(ear_damage-0.05, 0)
+ adjustEarDamage(-0.05, 0)
//Other
if(stunned)
diff --git a/code/modules/mob/living/carbon/alien/humanoid/queen.dm b/code/modules/mob/living/carbon/alien/humanoid/queen.dm
index 2b5060468a1..daba3852764 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/queen.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/queen.dm
@@ -34,8 +34,8 @@
/mob/living/carbon/alien/humanoid/queen/handle_regular_hud_updates()
..() //-Yvarov
- if (healths)
- if (stat != DEAD)
+ if(healths)
+ if(stat != DEAD)
switch(health)
if(250 to INFINITY)
healths.icon_state = "health0"
@@ -88,37 +88,4 @@
icon_state = "queen_s"
for(var/image/I in overlays_standing)
- overlays += I
-
-
-/*
-/mob/living/carbon/alien/humanoid/queen/verb/evolve() // -- TLE
- set name = "Evolve (1000)"
- set desc = "The ultimate transformation. Become an alien Empress. Only one empress can exist at a time."
- set category = "Alien"
-
- if(powerc(1000))
- // Queen check
- var/no_queen = 1
- for(var/mob/living/carbon/alien/humanoid/empress/E in living_mob_list)
- if(!E.key && E.brain_op_stage != 4)
- continue
- no_queen = 0
-
- if(no_queen)
- adjustToxLoss(-1000)
- to_chat(src, "You begin to evolve!")
- for(var/mob/O in viewers(src, null))
- O.show_message(text("[src] begins to twist and contort!"), 1)
- var/mob/living/carbon/alien/humanoid/empress/new_xeno = new(loc)
- if(mind)
- mind.transfer_to(new_xeno)
- else
- new_xeno.key = key
- new_xeno.mind.name = new_xeno.name
- qdel(src)
- else
- to_chat(src, "We already have an alive empress.")
- return
-
-*/
\ No newline at end of file
+ overlays += I
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
index fb489552f78..898d23de066 100644
--- a/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
+++ b/code/modules/mob/living/carbon/alien/humanoid/update_icons.dm
@@ -56,7 +56,7 @@
/mob/living/carbon/alien/humanoid/regenerate_icons()
..()
- if (notransform) return
+ if(notransform) return
update_inv_head(0,0)
update_inv_wear_suit(0,0)
@@ -103,7 +103,7 @@
t_suit = "armor"
standing.overlays += image("icon" = 'icons/effects/blood.dmi', "icon_state" = "[t_suit]blood")
- if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
+ if(istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
unEquip(handcuffed)
drop_r_hand()
drop_l_hand()
@@ -115,7 +115,7 @@
/mob/living/carbon/alien/humanoid/update_inv_head(var/update_icons=1)
- if (head)
+ if(head)
var/t_state = head.item_state
if(!t_state) t_state = head.icon_state
var/image/standing = image("icon" = 'icons/mob/mob.dmi', "icon_state" = "[t_state]")
diff --git a/code/modules/mob/living/carbon/alien/larva/emote.dm b/code/modules/mob/living/carbon/alien/larva/emote.dm
index 0a7bc7708d6..01d834b07cf 100644
--- a/code/modules/mob/living/carbon/alien/larva/emote.dm
+++ b/code/modules/mob/living/carbon/alien/larva/emote.dm
@@ -1,6 +1,6 @@
/mob/living/carbon/alien/larva/emote(var/act,var/m_type=1,var/message = null)
var/param = null
- if (findtext(act, "-", 1, null))
+ if(findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
@@ -10,41 +10,41 @@
var/muzzled = is_muzzled()
act = lowertext(act)
switch(act)
- if ("me")
+ if("me")
if(silent)
return
- if (src.client)
- if (client.prefs.muted & MUTE_IC)
+ if(src.client)
+ if(client.prefs.muted & MUTE_IC)
to_chat(src, "\red You cannot send IC messages (muted).")
return
- if (src.client.handle_spam_prevention(message,MUTE_IC))
+ if(src.client.handle_spam_prevention(message,MUTE_IC))
return
- if (stat)
+ if(stat)
return
if(!(message))
return
return custom_emote(m_type, message)
- if ("custom")
+ if("custom")
return custom_emote(m_type, message)
if("sign")
- if (!src.restrained())
+ if(!src.restrained())
message = text("The alien signs[].", (text2num(param) ? text(" the number []", text2num(param)) : null))
m_type = 1
- if ("burp")
- if (!muzzled)
+ if("burp")
+ if(!muzzled)
message = "[src] burps."
m_type = 2
if("scratch")
- if (!src.restrained())
+ if(!src.restrained())
message = "The [src.name] scratches."
m_type = 1
if("whimper")
- if (!muzzled)
+ if(!muzzled)
message = "The [src.name] whimpers."
m_type = 2
// if("roar")
-// if (!muzzled)
+// if(!muzzled)
// message = "The [src.name] roars." Commenting out since larva shouldn't roar /N
// m_type = 2
if("tail")
@@ -60,7 +60,7 @@
message = "The [src.name] drools."
m_type = 1
if("scretch")
- if (!muzzled)
+ if(!muzzled)
message = "The [src.name] scretches."
m_type = 2
if("choke")
@@ -85,18 +85,18 @@
message = "The [src.name] twitches violently."
m_type = 1
if("dance")
- if (!src.restrained())
+ if(!src.restrained())
message = "The [src.name] dances around happily."
m_type = 1
if("roll")
- if (!src.restrained())
+ if(!src.restrained())
message = "The [src.name] rolls."
m_type = 1
if("shake")
message = "The [src.name] shakes its head."
m_type = 1
if("gnarl")
- if (!muzzled)
+ if(!muzzled)
message = "The [src.name] gnarls and shows its teeth.."
m_type = 2
if("jump")
@@ -113,9 +113,9 @@
to_chat(src, "burp, choke, collapse, dance, drool, gasp, shiver, gnarl, jump, moan, nod, roll, scratch,\nscretch, shake, sign-#, sulk, sway, tail, twitch, whimper")
else
to_chat(src, text("Invalid Emote: []", act))
- if ((message && src.stat == 0))
+ if((message && src.stat == 0))
log_emote("[name]/[key] : [message]")
- if (m_type & 1)
+ if(m_type & 1)
for(var/mob/O in viewers(src, null))
O.show_message(message, m_type)
//Foreach goto(703)
diff --git a/code/modules/mob/living/carbon/alien/larva/larva.dm b/code/modules/mob/living/carbon/alien/larva/larva.dm
index a513ab76a90..19f3368ce96 100644
--- a/code/modules/mob/living/carbon/alien/larva/larva.dm
+++ b/code/modules/mob/living/carbon/alien/larva/larva.dm
@@ -31,7 +31,7 @@
/mob/living/carbon/alien/larva/Bump(atom/movable/AM as mob|obj, yes)
spawn( 0 )
- if ((!( yes ) || now_pushing))
+ if((!( yes ) || now_pushing))
return
now_pushing = 1
if(ismob(AM))
@@ -48,11 +48,11 @@
now_pushing = 0
..()
- if (!( istype(AM, /atom/movable) ))
+ if(!( istype(AM, /atom/movable) ))
return
- if (!( now_pushing ))
+ if(!( now_pushing ))
now_pushing = 1
- if (!( AM.anchored ))
+ if(!( AM.anchored ))
var/t = get_dir(src, AM)
step(AM, t)
now_pushing = null
@@ -76,26 +76,24 @@
var/b_loss = null
var/f_loss = null
- switch (severity)
- if (1.0)
+ switch(severity)
+ if(1.0)
gib()
return
- if (2.0)
+ if(2.0)
b_loss += 60
f_loss += 60
- ear_damage += 30
- ear_deaf += 120
+ adjustEarDamage(30,120)
if(3.0)
b_loss += 30
- if (prob(50))
+ if(prob(50))
Paralyse(1)
- ear_damage += 15
- ear_deaf += 60
+ adjustEarDamage(15,60)
adjustBruteLoss(b_loss)
adjustFireLoss(f_loss)
@@ -123,14 +121,14 @@
/mob/living/carbon/alien/larva/attack_slime(mob/living/carbon/slime/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
if(M.Victim)
return // can't attack while eating!
- if (stat != DEAD)
+ if(stat != DEAD)
M.do_attack_animation(src)
visible_message("The [M.name] glomps [src]!", \
"The [M.name] glomps [src]!")
@@ -148,11 +146,11 @@
return
/mob/living/carbon/alien/larva/attack_hand(mob/living/carbon/human/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -160,17 +158,17 @@
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
help_shake_act(M)
- if (I_GRAB)
+ if(I_GRAB)
grabbedby(M)
else
M.do_attack_animation(src)
var/damage = rand(1, 9)
- if (prob(90))
- if (HULK in M.mutations)
+ if(prob(90))
+ if(HULK in M.mutations)
damage += 5
spawn(0)
Paralyse(1)
@@ -180,7 +178,7 @@
playsound(loc, "punch", 25, 1, -1)
visible_message("[M] has kicked [src]!", \
"[M] has kicked [src]!")
- if ((stat != DEAD) && (damage > 4.9))
+ if((stat != DEAD) && (damage > 4.9))
Paralyse(rand(5,10))
visible_message("[M] has weakened [src]!", \
"[M] has weakened [src]!", \
@@ -194,11 +192,11 @@
return
/mob/living/carbon/alien/larva/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -206,7 +204,7 @@
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
sleeping = max(0,sleeping-5)
resting = 0
AdjustParalysis(-3)
@@ -215,7 +213,7 @@
visible_message("[M.name] nuzzles [src] trying to wake it up!")
else
- if (health > 0)
+ if(health > 0)
M.do_attack_animation(src)
playsound(loc, 'sound/weapons/bite.ogg', 50, 1, -1)
var/damage = 1
diff --git a/code/modules/mob/living/carbon/alien/larva/life.dm b/code/modules/mob/living/carbon/alien/larva/life.dm
index 4e7b974d855..76ceef6ad2e 100644
--- a/code/modules/mob/living/carbon/alien/larva/life.dm
+++ b/code/modules/mob/living/carbon/alien/larva/life.dm
@@ -19,7 +19,7 @@
blinded = 1
silent = 0
else //ALIVE. LIGHTS ARE ON
- if(health < -25 || brain_op_stage == 4.0)
+ if(health < -25 || !get_int_organ(/obj/item/organ/internal/brain))
death()
blinded = 1
silent = 0
@@ -54,7 +54,7 @@
move_delay_add = max(0, move_delay_add - rand(1, 2))
//Eyes
- if(sdisabilities & BLIND) //disabled-blind, doesn't get better on its own
+ if(disabilities & BLIND) //disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
@@ -63,12 +63,12 @@
eye_blurry = max(eye_blurry-1, 0)
//Ears
- if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own
- ear_deaf = max(ear_deaf, 1)
+ if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
+ setEarDamage(-1, max(ear_deaf, 1))
else if(ear_deaf) //deafness, heals slowly over time
- ear_deaf = max(ear_deaf-1, 0)
+ adjustEarDamage(0,-1)
else if(ear_damage < 25) //ear damage heals slowly under this threshold.
- ear_damage = max(ear_damage-0.05, 0)
+ adjustEarDamage(-0.05,0)
//Other
if(stunned)
diff --git a/code/modules/mob/living/carbon/alien/larva/powers.dm b/code/modules/mob/living/carbon/alien/larva/powers.dm
index 44351eb792a..678e4211b0d 100644
--- a/code/modules/mob/living/carbon/alien/larva/powers.dm
+++ b/code/modules/mob/living/carbon/alien/larva/powers.dm
@@ -7,17 +7,17 @@
if(stat != CONSCIOUS)
return
- if (layer != TURF_LAYER+0.2)
+ if(layer != TURF_LAYER+0.2)
layer = TURF_LAYER+0.2
to_chat(src, text("You are now hiding."))
for(var/mob/O in oviewers(src, null))
- if ((O.client && !( O.blinded )))
+ if((O.client && !( O.blinded )))
to_chat(O, text("[] scurries to the ground!", src))
else
layer = MOB_LAYER
to_chat(src, text("\green You have stopped hiding."))
for(var/mob/O in oviewers(src, null))
- if ((O.client && !( O.blinded )))
+ if((O.client && !( O.blinded )))
to_chat(O, text("[] slowly peaks up from the ground...", src))
/mob/living/carbon/alien/larva/verb/evolve()
diff --git a/code/modules/mob/living/carbon/alien/larva/update_icons.dm b/code/modules/mob/living/carbon/alien/larva/update_icons.dm
index 104811c4fc1..697d6413c02 100644
--- a/code/modules/mob/living/carbon/alien/larva/update_icons.dm
+++ b/code/modules/mob/living/carbon/alien/larva/update_icons.dm
@@ -12,11 +12,11 @@
if(stat == DEAD)
icon_state = "larva[state]_dead"
- else if (handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state?
+ else if(handcuffed || legcuffed) //This should be an overlay. Who made this an icon_state?
icon_state = "larva[state]_cuff"
else if(stat == UNCONSCIOUS || lying || resting)
icon_state = "larva[state]_sleep"
- else if (stunned)
+ else if(stunned)
icon_state = "larva[state]_stun"
else
icon_state = "larva[state]"
diff --git a/code/modules/mob/living/carbon/alien/special/facehugger.dm b/code/modules/mob/living/carbon/alien/special/facehugger.dm
index f0935c520ce..6ea16fc24a1 100644
--- a/code/modules/mob/living/carbon/alien/special/facehugger.dm
+++ b/code/modules/mob/living/carbon/alien/special/facehugger.dm
@@ -52,7 +52,7 @@ var/const/MAX_ACTIVE_TIME = 400
to_chat(user, "[src] is not moving.")
if(CONSCIOUS)
to_chat(user, "[src] seems to be active!")
- if (sterile)
+ if(sterile)
to_chat(user, "It looks like the proboscis has been removed.")
/obj/item/clothing/mask/facehugger/attackby(obj/item/O,mob/m, params)
@@ -148,7 +148,7 @@ var/const/MAX_ACTIVE_TIME = 400
target.equip_to_slot(src, slot_wear_mask,,0)
if(!sterile)
M.Paralyse(MAX_IMPREGNATION_TIME/6) //something like 25 ticks = 20 seconds with the default settings
- else if (iscorgi(M))
+ else if(iscorgi(M))
var/mob/living/simple_animal/pet/corgi/C = M
loc = C
C.facehugger = src
diff --git a/code/modules/mob/living/carbon/brain/brain.dm b/code/modules/mob/living/carbon/brain/brain.dm
index 8e6da1eca78..aac43c16ac3 100644
--- a/code/modules/mob/living/carbon/brain/brain.dm
+++ b/code/modules/mob/living/carbon/brain/brain.dm
@@ -23,39 +23,44 @@
return ..()
say_understands(var/other)//Goddamn is this hackish, but this say code is so odd
- if (istype(other, /mob/living/silicon/ai))
+ if(istype(other, /mob/living/silicon/ai))
if(!(container && istype(container, /obj/item/device/mmi)))
return 0
else
return 1
- if (istype(other, /mob/living/silicon/decoy))
+ if(istype(other, /mob/living/silicon/decoy))
if(!(container && istype(container, /obj/item/device/mmi)))
return 0
else
return 1
- if (istype(other, /mob/living/silicon/pai))
+ if(istype(other, /mob/living/silicon/pai))
if(!(container && istype(container, /obj/item/device/mmi)))
return 0
else
return 1
- if (istype(other, /mob/living/silicon/robot))
+ if(istype(other, /mob/living/silicon/robot))
if(!(container && istype(container, /obj/item/device/mmi)))
return 0
else
return 1
- if (istype(other, /mob/living/carbon/human))
+ if(istype(other, /mob/living/carbon/human))
return 1
- if (istype(other, /mob/living/carbon/slime))
+ if(istype(other, /mob/living/carbon/slime))
return 1
return ..()
-/mob/living/carbon/brain/update_canmove()
+/mob/living/carbon/brain/update_canmove(delay_action_updates = 0)
if(in_contents_of(/obj/mecha))
canmove = 1
use_me = 1 //If it can move, let it emote
- else if(istype(loc, /obj/item/device/mmi)) canmove = 1 //mmi won't move anyways so whatever
- else canmove = 0
+ else if(istype(loc, /obj/item/device/mmi))
+ canmove = 1 //mmi won't move anyways so whatever
+ else
+ canmove = 0
+
+ if(!delay_action_updates)
+ update_action_buttons_icon()
return canmove
/mob/living/carbon/brain/ex_act() //you cant blow up brainmobs because it makes transfer_to() freak out when borgs blow up.
@@ -94,4 +99,10 @@ I'm using this for Stat to give it a more nifty interface to work with
stat("Exosuit Integrity", "[!M.health ? "0" : "[(M.health / initial(M.health)) * 100]"]%")
/mob/living/carbon/brain/can_safely_leave_loc()
- return 0 //You're not supposed to be ethereal jaunting, brains
\ No newline at end of file
+ return 0 //You're not supposed to be ethereal jaunting, brains
+
+/mob/living/carbon/brain/adjustEarDamage()
+ return
+
+/mob/living/carbon/brain/setEarDamage() // no ears to damage or heal
+ return
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/brain/brain_item.dm b/code/modules/mob/living/carbon/brain/brain_item.dm
index 92c04ca0066..dd2e81ed35b 100644
--- a/code/modules/mob/living/carbon/brain/brain_item.dm
+++ b/code/modules/mob/living/carbon/brain/brain_item.dm
@@ -4,7 +4,7 @@
max_damage = 200
icon_state = "brain2"
force = 1.0
- w_class = 2.0
+ w_class = 2
throwforce = 1.0
throw_speed = 3
throw_range = 5
@@ -21,8 +21,7 @@
/obj/item/organ/internal/brain/surgeryize()
if(!owner)
return
- owner.ear_damage = 0 //Yeah, didn't you...hear? The ears are totally inside the brain.
- owner.ear_deaf = 0
+ owner.setEarDamage(0,0) //Yeah, didn't you...hear? The ears are totally inside the brain.
/obj/item/organ/internal/brain/xeno
name = "xenomorph brain"
diff --git a/code/modules/mob/living/carbon/brain/emote.dm b/code/modules/mob/living/carbon/brain/emote.dm
index e6ead851c5b..23a609131f2 100644
--- a/code/modules/mob/living/carbon/brain/emote.dm
+++ b/code/modules/mob/living/carbon/brain/emote.dm
@@ -2,7 +2,7 @@
if(!(container && istype(container, /obj/item/device/mmi)))//No MMI, no emotes
return
- if (findtext(act, "-", 1, null))
+ if(findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
act = copytext(act, 1, t1)
@@ -14,37 +14,37 @@
act = lowertext(act)
switch(act)
- if ("alarm")
+ if("alarm")
to_chat(src, "You sound an alarm.")
message = "\The [src] sounds an alarm."
m_type = 2
- if ("alert")
+ if("alert")
to_chat(src, "You let out a distressed noise.")
message = "\The [src] lets out a distressed noise."
m_type = 2
- if ("notice")
+ if("notice")
to_chat(src, "You play a loud tone.")
message = "\The [src] plays a loud tone."
m_type = 2
- if ("flash")
+ if("flash")
message = "The lights on \the [src] flash quickly."
m_type = 1
- if ("blink")
+ if("blink")
message = "\The [src] blinks."
m_type = 1
- if ("whistle")
+ if("whistle")
to_chat(src, "You whistle.")
message = "\The [src] whistles."
m_type = 2
- if ("beep")
+ if("beep")
to_chat(src, "You beep.")
message = "\The [src] beeps."
m_type = 2
- if ("boop")
+ if("boop")
to_chat(src, "You boop.")
message = "\The [src] boops."
m_type = 2
- if ("help")
+ if("help")
to_chat(src, "alarm, alert, notice, flash,blink, whistle, beep, boop")
if(message && !stat)
diff --git a/code/modules/mob/living/carbon/brain/life.dm b/code/modules/mob/living/carbon/brain/life.dm
index 63eb38e607f..40273bf66ad 100644
--- a/code/modules/mob/living/carbon/brain/life.dm
+++ b/code/modules/mob/living/carbon/brain/life.dm
@@ -65,13 +65,13 @@
/mob/living/carbon/brain/handle_vision()
..()
- if (stat == 2 || (XRAY in src.mutations))
+ if(stat == 2 || (XRAY in src.mutations))
sight |= SEE_TURFS
sight |= SEE_MOBS
sight |= SEE_OBJS
see_in_dark = 8
see_invisible = SEE_INVISIBLE_LEVEL_TWO
- else if (stat != 2)
+ else if(stat != 2)
sight &= ~SEE_TURFS
sight &= ~SEE_MOBS
sight &= ~SEE_OBJS
diff --git a/code/modules/mob/living/carbon/brain/posibrain.dm b/code/modules/mob/living/carbon/brain/posibrain.dm
index fa2863e23b7..aad88276473 100644
--- a/code/modules/mob/living/carbon/brain/posibrain.dm
+++ b/code/modules/mob/living/carbon/brain/posibrain.dm
@@ -64,7 +64,7 @@
if(!C || brainmob.key || 0 == searching) return //handle logouts that happen whilst the alert is waiting for a response, and responses issued after a brain has been located.
if(response == "Yes")
transfer_personality(C.mob)
- else if (response == "Never for this round")
+ else if(response == "Never for this round")
C.prefs.be_special -= ROLE_POSIBRAIN
// This should not ever happen, but let's be safe
@@ -99,7 +99,7 @@
src.brainmob.mind.assigned_role = "Positronic Brain"
var/turf/T = get_turf_or_move(src.loc)
- for (var/mob/M in viewers(T))
+ for(var/mob/M in viewers(T))
M.show_message("\blue The positronic brain chimes quietly.")
icon_state = "posibrain-occupied"
@@ -110,7 +110,7 @@
icon_state = "posibrain"
var/turf/T = get_turf_or_move(src.loc)
- for (var/mob/M in viewers(T))
+ for(var/mob/M in viewers(T))
M.show_message("\blue The positronic brain buzzes quietly, and the golden lights fade away. Perhaps you could try again?")
/obj/item/device/mmi/posibrain/Topic(href,href_list)
@@ -183,7 +183,6 @@
src.brainmob.container = src
src.brainmob.stat = 0
src.brainmob.silent = 0
- src.brainmob.brain_op_stage = 4.0
dead_mob_list -= src.brainmob
..()
@@ -193,7 +192,7 @@
volunteer(O)
else
var/turf/T = get_turf_or_move(src.loc)
- for (var/mob/M in viewers(T))
+ for(var/mob/M in viewers(T))
M.show_message("\blue The positronic brain pings softly.")
/obj/item/device/mmi/posibrain/ipc
diff --git a/code/modules/mob/living/carbon/brain/say.dm b/code/modules/mob/living/carbon/brain/say.dm
index 03d6906b876..a343d245424 100644
--- a/code/modules/mob/living/carbon/brain/say.dm
+++ b/code/modules/mob/living/carbon/brain/say.dm
@@ -1,6 +1,6 @@
//TODO: Convert this over for languages.
/mob/living/carbon/brain/say(var/message, var/datum/language/speaking = null)
- if (silent)
+ if(silent)
return
if(!(container && istype(container, /obj/item/device/mmi)))
@@ -24,9 +24,9 @@
if("headset")
var/radio_worked = 0 // If any of the radios our brainmob could use functioned, this is set true so that we don't use any others
// I'm doing it this way so that if the mecha radio fails for some reason, a radio MMI still has the built-in fallback
- if (container && istype(container,/obj/item/device/mmi))
+ if(container && istype(container,/obj/item/device/mmi))
var/obj/item/device/mmi/c = container
- if (!radio_worked && c.mecha)
+ if(!radio_worked && c.mecha)
var/obj/mecha/metalgear = c.mecha
if(metalgear.radio)
radio_worked = metalgear.radio.talk_into(src, message, message_mode, verb, speaking)
@@ -36,7 +36,7 @@
if(R.radio)
radio_worked = R.radio.talk_into(src, message, message_mode, verb, speaking)
return radio_worked
- if ("whisper")
+ if("whisper")
whisper_say(message, speaking, alt_name)
return 1
else return 0
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/carbon.dm b/code/modules/mob/living/carbon/carbon.dm
index f9afba579fb..3c18cddb18f 100644
--- a/code/modules/mob/living/carbon/carbon.dm
+++ b/code/modules/mob/living/carbon/carbon.dm
@@ -25,7 +25,7 @@
return ..()
/mob/living/carbon/blob_act()
- if (stat == DEAD)
+ if(stat == DEAD)
return
else
show_message("The blob attacks!")
@@ -65,7 +65,7 @@
if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
var/obj/item/organ/external/organ = H.get_organ("chest")
- if (istype(organ))
+ if(istype(organ))
if(organ.take_damage(d, 0))
H.UpdateDamageIcon()
@@ -119,7 +119,7 @@
if(stun)
adjustToxLoss(-3)
T = get_step(T, dir)
- if (is_blocked_turf(T))
+ if(is_blocked_turf(T))
break
return 1
@@ -168,7 +168,7 @@
if(!tesla_shock || (tesla_shock && siemens_coeff > 0.5))
Stun(3)
Weaken(3)
- if (shock_damage > 200)
+ if(shock_damage > 200)
src.visible_message(
"[src] was arc flashed by the [source]!", \
"The [source] arc flashes and electrocutes you!", \
@@ -213,7 +213,7 @@
swap_hand()
/mob/living/carbon/proc/help_shake_act(mob/living/carbon/M)
- if (src.health >= config.health_threshold_crit)
+ if(src.health >= config.health_threshold_crit)
if(src == M && istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
src.visible_message( \
@@ -261,11 +261,11 @@
"You shake [src], but they are unresponsive. Probably suffering from SSD.")
if(lying) // /vg/: For hugs. This is how update_icon figgers it out, anyway. - N3X15
var/t_him = "it"
- if (src.gender == MALE)
+ if(src.gender == MALE)
t_him = "him"
- else if (src.gender == FEMALE)
+ else if(src.gender == FEMALE)
t_him = "her"
- if (istype(src,/mob/living/carbon/human) && src:w_uniform)
+ if(istype(src,/mob/living/carbon/human) && src:w_uniform)
var/mob/living/carbon/human/H = src
H.w_uniform.add_fingerprint(M)
src.sleeping = max(0,src.sleeping-5)
@@ -498,7 +498,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
//Throwing stuff
/mob/living/carbon/proc/toggle_throw_mode()
- if (in_throw_mode)
+ if(in_throw_mode)
throw_mode_off()
else
throw_mode_on()
@@ -565,10 +565,11 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
return 1
/mob/living/carbon/restrained()
- if (handcuffed)
+ if(handcuffed)
return 1
return
+
/mob/living/carbon/unEquip(obj/item/I) //THIS PROC DID NOT CALL ..()
. = ..() //Sets the default return value to what the parent returns.
if(!. || !I) //We don't want to set anything to null if the parent returned 0.
@@ -644,8 +645,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
if(do_mob(usr, src, POCKET_STRIP_DELAY))
if(internal)
internal = null
- if(internals)
- internals.icon_state = "internal0"
+ update_internals_hud_icon(0)
else
var/no_mask2
if(!(wear_mask && wear_mask.flags & AIRTIGHT))
@@ -655,8 +655,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
to_chat(usr, "[src] is not wearing a suitable mask or helmet!")
return
internal = ITEM
- if(internals)
- internals.icon_state = "internal1"
+ update_internals_hud_icon(1)
visible_message("[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].", \
"[usr] [internal ? "opens" : "closes"] the valve on [src]'s [ITEM].")
@@ -858,7 +857,7 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
throw_alert("handcuffed", /obj/screen/alert/restrained/handcuffed, new_master = src.handcuffed)
else
clear_alert("handcuffed")
- update_action_buttons() //some of our action buttons might be unusable when we're handcuffed.
+ update_action_buttons_icon() //some of our action buttons might be unusable when we're handcuffed.
update_inv_handcuffed()
update_hud_handcuffed()
@@ -890,51 +889,51 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
wear_mask)
/mob/living/carbon/proc/uncuff()
- if (handcuffed)
+ if(handcuffed)
var/obj/item/weapon/W = handcuffed
handcuffed = null
- if (buckled && buckled.buckle_requires_restraints)
+ if(buckled && buckled.buckle_requires_restraints)
buckled.unbuckle_mob()
update_handcuffed()
- if (client)
+ if(client)
client.screen -= W
- if (W)
+ if(W)
W.loc = loc
W.dropped(src)
- if (W)
+ if(W)
W.layer = initial(W.layer)
W.plane = initial(W.plane)
- if (legcuffed)
+ if(legcuffed)
var/obj/item/weapon/W = legcuffed
legcuffed = null
update_inv_legcuffed()
- if (client)
+ if(client)
client.screen -= W
- if (W)
+ if(W)
W.loc = loc
W.dropped(src)
- if (W)
+ if(W)
W.layer = initial(W.layer)
W.plane = initial(W.plane)
/mob/living/carbon/proc/slip(var/description, var/stun, var/weaken, var/tilesSlipped, var/walkSafely, var/slipAny)
- if (flying || buckled || (walkSafely && m_intent == "walk"))
+ if(flying || buckled || (walkSafely && m_intent == "walk"))
return
- if ((lying) && (!(tilesSlipped)))
+ if((lying) && (!(tilesSlipped)))
return
- if (!(slipAny))
- if (istype(src, /mob/living/carbon/human))
+ if(!(slipAny))
+ if(istype(src, /mob/living/carbon/human))
var/mob/living/carbon/human/H = src
- if ((isobj(H.shoes) && H.shoes.flags & NOSLIP) || H.species.bodyflags & FEET_NOSLIP)
+ if((isobj(H.shoes) && H.shoes.flags & NOSLIP) || H.species.bodyflags & FEET_NOSLIP)
return
- if (tilesSlipped)
+ if(tilesSlipped)
for(var/t = 0, t<=tilesSlipped, t++)
spawn (t) step(src, src.dir)
stop_pulling()
to_chat(src, "You slipped on the [description]!")
playsound(src.loc, 'sound/misc/slip.ogg', 50, 1, -3)
- if (stun)
+ if(stun)
Stun(stun)
Weaken(weaken)
return 1
@@ -966,15 +965,15 @@ var/list/ventcrawl_machinery = list(/obj/machinery/atmospherics/unary/vent_pump,
if(istype(toEat, /obj/item/weapon/reagent_containers/food/pill))
to_chat(src, "You [toEat.apply_method] [toEat].")
else
- if (fullness <= 50)
+ if(fullness <= 50)
to_chat(src, "You hungrily chew out a piece of [toEat] and gobble it!")
- else if (fullness > 50 && fullness <= 150)
+ else if(fullness > 50 && fullness <= 150)
to_chat(src, "You hungrily begin to eat [toEat].")
- else if (fullness > 150 && fullness <= 350)
+ else if(fullness > 150 && fullness <= 350)
to_chat(src, "You take a bite of [toEat].")
- else if (fullness > 350 && fullness <= 550)
+ else if(fullness > 350 && fullness <= 550)
to_chat(src, "You unwillingly chew a bit of [toEat].")
- else if (fullness > (550 * (1 + overeatduration / 2000))) // The more you eat - the more you can eat
+ else if(fullness > (550 * (1 + overeatduration / 2000))) // The more you eat - the more you can eat
to_chat(src, "You cannot force any more of [toEat] to go down your throat.")
return 0
return 1
@@ -1031,3 +1030,16 @@ so that different stomachs can handle things in different ways VB*/
var/obj/item/LH = get_inactive_hand()
if(LH)
. |= LH.GetAccess()
+
+/mob/living/carbon/proc/can_breathe_gas()
+ if(!wear_mask)
+ return TRUE
+
+ if(!(wear_mask.flags & BLOCK_GAS_SMOKE_EFFECT) && internal == null)
+ return TRUE
+
+ return FALSE
+
+/mob/living/carbon/proc/update_internals_hud_icon(internal_state = 0)
+ if(hud_used && hud_used.internals)
+ hud_used.internals.icon_state = "internal[internal_state]"
diff --git a/code/modules/mob/living/carbon/carbon_defines.dm b/code/modules/mob/living/carbon/carbon_defines.dm
index 07a6a0d28cd..e900fc10517 100644
--- a/code/modules/mob/living/carbon/carbon_defines.dm
+++ b/code/modules/mob/living/carbon/carbon_defines.dm
@@ -1,15 +1,12 @@
-/mob/living/carbon/
+/mob/living/carbon
gender = MALE
hud_possible = list(HEALTH_HUD,STATUS_HUD,SPECIALROLE_HUD)
var/list/stomach_contents = list()
var/list/internal_organs = list()
- var/brain_op_stage = 0.0
var/antibodies = 0
- var/last_eating = 0 //Not sure what this does... I found it hidden in food.dm
var/life_tick = 0 // The amount of life ticks that have processed on this mob.
- var/analgesic = 0 // when this is set, the mob isn't affected by shock or pain
- // life should decrease this by 1 every tick
+
// total amount of wounds on mob, used to spread out healing and the like over all wounds
var/number_wounds = 0
var/obj/item/handcuffed = null //Whether or not the mob is handcuffed
diff --git a/code/modules/mob/living/carbon/death.dm b/code/modules/mob/living/carbon/death.dm
index fca8c59fec3..b0ccdc8381d 100644
--- a/code/modules/mob/living/carbon/death.dm
+++ b/code/modules/mob/living/carbon/death.dm
@@ -2,4 +2,8 @@
losebreath = 0
med_hud_set_health()
med_hud_set_status()
+
+ if(reagents)
+ reagents.death_metabolize(src)
+
..(gibbed)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/appearance.dm b/code/modules/mob/living/carbon/human/appearance.dm
index f3cd00463e2..ca241306f00 100644
--- a/code/modules/mob/living/carbon/human/appearance.dm
+++ b/code/modules/mob/living/carbon/human/appearance.dm
@@ -374,7 +374,7 @@
var/list/valid_body_accessories = new()
for(var/B in body_accessory_by_name)
var/datum/body_accessory/A = body_accessory_by_name[B]
- if(check_rights(R_ADMIN, 1, src))
+ if(check_rights(R_ADMIN, 0, src))
valid_body_accessories = body_accessory_by_name.Copy()
else
if(!istype(A))
diff --git a/code/modules/mob/living/carbon/human/body_accessories.dm b/code/modules/mob/living/carbon/human/body_accessories.dm
index 677e4b42784..f4b95eec4d4 100644
--- a/code/modules/mob/living/carbon/human/body_accessories.dm
+++ b/code/modules/mob/living/carbon/human/body_accessories.dm
@@ -102,6 +102,13 @@ var/global/list/body_accessory_by_species = list("None" = null)
return 0
+/datum/body_accessory/tail/wingler_tail // Jay wingler fluff tail
+ name = "Jay Wingler Tail"
+
+ icon_state = "winglertail"
+ animated_icon_state = "winglertail_a"
+
+
//Vulpkanin
/datum/body_accessory/tail/vulpkanin_2
name = "Vulpkanin Alt 1 (Bushy)"
@@ -130,3 +137,11 @@ var/global/list/body_accessory_by_species = list("None" = null)
icon_state = "vulptail5"
animated_icon_state = "vulptail5_a"
allowed_species = list("Vulpkanin")
+
+/datum/body_accessory/tail/vulpkanin_6
+ name = "Vulpkanin Alt 5 (Straight Bushy)"
+
+ icon_state = "vulptail6"
+ animated_icon_state = "vulptail6_a"
+ allowed_species = list("Vulpkanin")
+
diff --git a/code/modules/mob/living/carbon/human/emote.dm b/code/modules/mob/living/carbon/human/emote.dm
index 0cb277e8642..ef5768fcb0e 100644
--- a/code/modules/mob/living/carbon/human/emote.dm
+++ b/code/modules/mob/living/carbon/human/emote.dm
@@ -1,21 +1,21 @@
/mob/living/carbon/human/emote(var/act,var/m_type=1,var/message = null,var/force)
- if (stat == DEAD)
+ if(stat == DEAD)
return // No screaming bodies
var/param = null
- if (findtext(act, "-", 1, null))
+ if(findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
var/muzzled = is_muzzled()
- if(sdisabilities & MUTE || silent)
+ if(disabilities & MUTE || silent)
muzzled = 1
//var/m_type = 1
- for (var/obj/item/weapon/implant/I in src)
- if (I.implanted)
+ for(var/obj/item/weapon/implant/I in src)
+ if(I.implanted)
I.trigger(act, src)
var/miming = 0
@@ -29,12 +29,12 @@
switch(act)
//Cooldown-inducing emotes
if("ping", "pings", "buzz", "buzzes", "beep", "beeps", "yes", "no", "buzz2")
- if (species.name == "Machine") //Only Machines can beep, ping, and buzz, yes, no, and make a silly sad trombone noise.
+ if(species.name == "Machine") //Only Machines can beep, ping, and buzz, yes, no, and make a silly sad trombone noise.
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
else //Everyone else fails, skip the emote attempt
return
if("drone","drones","hum","hums","rumble","rumbles")
- if (species.name == "Drask") //Only Drask can make whale noises
+ if(species.name == "Drask") //Only Drask can make whale noises
on_CD = handle_emote_CD() //proc located in code\modules\mob\emote.dm
else
return
@@ -72,14 +72,14 @@
if("ping", "pings")
var/M = null
if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
if(!M)
param = null
- if (param)
+ if(param)
message = "[src] pings at [param]."
else
message = "[src] pings."
@@ -94,14 +94,14 @@
if("buzz", "buzzes")
var/M = null
if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
if(!M)
param = null
- if (param)
+ if(param)
message = "[src] buzzes at [param]."
else
message = "[src] buzzes."
@@ -111,14 +111,14 @@
if("beep", "beeps")
var/M = null
if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
if(!M)
param = null
- if (param)
+ if(param)
message = "[src] beeps at [param]."
else
message = "[src] beeps."
@@ -128,14 +128,14 @@
if("drone", "drones", "hum", "hums", "rumble", "rumbles")
var/M = null
if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
if(!M)
param = null
- if (param)
+ if(param)
message = "[src] drones at [param]."
else
message = "[src] rumbles."
@@ -145,14 +145,14 @@
if("squish", "squishes")
var/M = null
if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
if(!M)
param = null
- if (param)
+ if(param)
message = "[src] squishes at [param]."
else
message = "[src] squishes."
@@ -162,14 +162,14 @@
if("yes")
var/M = null
if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
if(!M)
param = null
- if (param)
+ if(param)
message = "[src] emits an affirmative blip at [param]."
else
message = "[src] emits an affirmative blip."
@@ -179,14 +179,14 @@
if("no")
var/M = null
if(param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
if(!M)
param = null
- if (param)
+ if(param)
message = "[src] emits a negative blip at [param]."
else
message = "[src] emits a negative blip."
@@ -217,99 +217,99 @@
return
m_type = 1
- if ("airguitar")
- if (!src.restrained())
+ if("airguitar")
+ if(!src.restrained())
message = "[src] is strumming the air and headbanging like a safari chimp."
m_type = 1
- if ("blink", "blinks")
+ if("blink", "blinks")
message = "[src] blinks."
m_type = 1
- if ("blink_r", "blinks_r")
+ if("blink_r", "blinks_r")
message = "[src] blinks rapidly."
m_type = 1
- if ("bow", "bows")
- if (!src.buckled)
+ if("bow", "bows")
+ if(!src.buckled)
var/M = null
- if (param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
- if (!M)
+ if(!M)
param = null
- if (param)
+ if(param)
message = "[src] bows to [param]."
else
message = "[src] bows."
m_type = 1
- if ("salute", "salutes")
- if (!src.buckled)
+ if("salute", "salutes")
+ if(!src.buckled)
var/M = null
- if (param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
- if (!M)
+ if(!M)
param = null
- if (param)
+ if(param)
message = "[src] salutes to [param]."
else
message = "[src] salutes."
m_type = 1
- if ("choke", "chokes")
+ if("choke", "chokes")
if(miming)
message = "[src] clutches \his throat desperately!"
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] chokes!"
m_type = 2
else
message = "[src] makes a strong noise."
m_type = 2
- if ("burp", "burps")
+ if("burp", "burps")
if(miming)
message = "[src] opens their mouth rather obnoxiously."
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] burps."
m_type = 2
else
message = "[src] makes a peculiar noise."
m_type = 2
- if ("clap", "claps")
- if (!src.restrained())
+ if("clap", "claps")
+ if(!src.restrained())
message = "[src] claps."
m_type = 2
if(miming)
m_type = 1
- if ("flap", "flaps")
- if (!src.restrained())
+ if("flap", "flaps")
+ if(!src.restrained())
message = "[src] flaps \his wings."
m_type = 2
if(miming)
m_type = 1
- if ("flip", "flips")
+ if("flip", "flips")
m_type = 1
- if (!src.restrained())
+ if(!src.restrained())
var/M = null
- if (param)
- for (var/mob/A in view(1, null))
- if (param == A.name)
+ if(param)
+ for(var/mob/A in view(1, null))
+ if(param == A.name)
M = A
break
- if (M == src)
+ if(M == src)
M = null
if(M)
@@ -339,227 +339,227 @@
message = "[src] does a flip!"
SpinAnimation(5,1)
- if ("aflap", "aflaps")
- if (!src.restrained())
+ if("aflap", "aflaps")
+ if(!src.restrained())
message = "[src] flaps \his wings ANGRILY!"
m_type = 2
if(miming)
m_type = 1
- if ("drool", "drools")
+ if("drool", "drools")
message = "[src] drools."
m_type = 1
- if ("eyebrow")
+ if("eyebrow")
message = "[src] raises an eyebrow."
m_type = 1
- if ("chuckle", "chuckles")
+ if("chuckle", "chuckles")
if(miming)
message = "[src] appears to chuckle."
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] chuckles."
m_type = 2
else
message = "[src] makes a noise."
m_type = 2
- if ("twitch", "twitches")
+ if("twitch", "twitches")
message = "[src] twitches violently."
m_type = 1
- if ("twitch_s", "twitches_s")
+ if("twitch_s", "twitches_s")
message = "[src] twitches."
m_type = 1
- if ("faint", "faints")
+ if("faint", "faints")
message = "[src] faints."
if(src.sleeping)
return //Can't faint while asleep
src.sleeping += 1
m_type = 1
- if ("cough", "coughs")
+ if("cough", "coughs")
if(miming)
message = "[src] appears to cough!"
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] coughs!"
m_type = 2
else
message = "[src] makes a strong noise."
m_type = 2
- if ("frown", "frowns")
+ if("frown", "frowns")
message = "[src] frowns."
m_type = 1
- if ("nod", "nods")
+ if("nod", "nods")
message = "[src] nods."
m_type = 1
- if ("blush", "blushes")
+ if("blush", "blushes")
message = "[src] blushes."
m_type = 1
- if ("wave", "waves")
+ if("wave", "waves")
message = "[src] waves."
m_type = 1
- if ("quiver", "quivers")
+ if("quiver", "quivers")
message = "[src] quivers."
m_type = 1
- if ("gasp", "gasps")
+ if("gasp", "gasps")
if(miming)
message = "[src] appears to be gasping!"
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] gasps!"
m_type = 2
else
message = "[src] makes a weak noise."
m_type = 2
- if ("deathgasp", "deathgasps")
+ if("deathgasp", "deathgasps")
message = "[src] [species.death_message]"
m_type = 1
- if ("giggle", "giggles")
+ if("giggle", "giggles")
if(miming)
message = "[src] giggles silently!"
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] giggles."
m_type = 2
else
message = "[src] makes a noise."
m_type = 2
- if ("glare", "glares")
+ if("glare", "glares")
var/M = null
- if (param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
- if (!M)
+ if(!M)
param = null
- if (param)
+ if(param)
message = "[src] glares at [param]."
else
message = "[src] glares."
m_type = 1
- if ("stare", "stares")
+ if("stare", "stares")
var/M = null
- if (param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
- if (!M)
+ if(!M)
param = null
- if (param)
+ if(param)
message = "[src] stares at [param]."
else
message = "[src] stares."
m_type = 1
- if ("look", "looks")
+ if("look", "looks")
var/M = null
- if (param)
- for (var/mob/A in view(null, null))
- if (param == A.name)
+ if(param)
+ for(var/mob/A in view(null, null))
+ if(param == A.name)
M = A
break
- if (!M)
+ if(!M)
param = null
- if (param)
+ if(param)
message = "[src] looks at [param]."
else
message = "[src] looks."
m_type = 1
- if ("grin", "grins")
+ if("grin", "grins")
message = "[src] grins."
m_type = 1
- if ("cry", "cries")
+ if("cry", "cries")
if(miming)
message = "[src] cries."
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] cries."
m_type = 2
else
message = "[src] makes a weak noise. \He frowns."
m_type = 2
- if ("sigh", "sighs")
+ if("sigh", "sighs")
if(miming)
message = "[src] sighs."
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] sighs."
m_type = 2
else
message = "[src] makes a weak noise."
m_type = 2
- if ("laugh", "laughs")
+ if("laugh", "laughs")
if(miming)
message = "[src] acts out a laugh."
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] laughs."
m_type = 2
else
message = "[src] makes a noise."
m_type = 2
- if ("mumble", "mumbles")
+ if("mumble", "mumbles")
message = "[src] mumbles!"
m_type = 2
if(miming)
m_type = 1
- if ("grumble", "grumbles")
+ if("grumble", "grumbles")
if(miming)
message = "[src] grumbles!"
m_type = 1
- if (!muzzled)
+ if(!muzzled)
message = "[src] grumbles!"
m_type = 2
else
message = "[src] makes a noise."
m_type = 2
- if ("groan", "groans")
+ if("groan", "groans")
if(miming)
message = "[src] appears to groan!"
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] groans!"
m_type = 2
else
message = "[src] makes a loud noise."
m_type = 2
- if ("moan", "moans")
+ if("moan", "moans")
if(miming)
message = "[src] appears to moan!"
m_type = 1
@@ -567,11 +567,11 @@
message = "[src] moans!"
m_type = 2
- if ("johnny")
+ if("johnny")
var/M
- if (param)
+ if(param)
M = param
- if (!M)
+ if(!M)
param = null
else
if(miming)
@@ -581,23 +581,23 @@
message = "[src] says, \"[M], please. They had a family.\" [src.name] takes a drag from a cigarette and blows their name out in smoke."
m_type = 2
- if ("point", "points")
- if (!src.restrained())
+ if("point", "points")
+ if(!src.restrained())
var/atom/M = null
- if (param)
- for (var/atom/A as mob|obj|turf in view())
- if (param == A.name)
+ if(param)
+ for(var/atom/A as mob|obj|turf in view())
+ if(param == A.name)
M = A
break
- if (!M)
+ if(!M)
message = "[src] points."
else
pointed(M)
m_type = 1
- if ("raise", "raises")
- if (!src.restrained())
+ if("raise", "raises")
+ if(!src.restrained())
message = "[src] raises a hand."
m_type = 1
@@ -605,92 +605,92 @@
message = "[src] shakes \his head."
m_type = 1
- if ("shrug", "shrugs")
+ if("shrug", "shrugs")
message = "[src] shrugs."
m_type = 1
- if ("signal", "signals")
- if (!src.restrained())
+ if("signal", "signals")
+ if(!src.restrained())
var/t1 = round(text2num(param))
- if (isnum(t1))
- if (t1 <= 5 && (!src.r_hand || !src.l_hand))
+ if(isnum(t1))
+ if(t1 <= 5 && (!src.r_hand || !src.l_hand))
message = "[src] raises [t1] finger\s."
- else if (t1 <= 10 && (!src.r_hand && !src.l_hand))
+ else if(t1 <= 10 && (!src.r_hand && !src.l_hand))
message = "[src] raises [t1] finger\s."
m_type = 1
- if ("smile", "smiles")
+ if("smile", "smiles")
message = "[src] smiles."
m_type = 1
- if ("shiver", "shivers")
+ if("shiver", "shivers")
message = "[src] shivers."
m_type = 2
if(miming)
m_type = 1
- if ("pale", "pales")
+ if("pale", "pales")
message = "[src] goes pale for a second."
m_type = 1
- if ("tremble", "trembles")
+ if("tremble", "trembles")
message = "[src] trembles."
m_type = 1
- if ("sneeze", "sneezes")
- if (miming)
+ if("sneeze", "sneezes")
+ if(miming)
message = "[src] sneezes."
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] sneezes."
m_type = 2
else
message = "[src] makes a strange noise."
m_type = 2
- if ("sniff", "sniffs")
+ if("sniff", "sniffs")
message = "[src] sniffs."
m_type = 2
if(miming)
m_type = 1
- if ("snore", "snores")
- if (miming)
+ if("snore", "snores")
+ if(miming)
message = "[src] sleeps soundly."
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] snores."
m_type = 2
else
message = "[src] makes a noise."
m_type = 2
- if ("whimper", "whimpers")
- if (miming)
+ if("whimper", "whimpers")
+ if(miming)
message = "[src] appears hurt."
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] whimpers."
m_type = 2
else
message = "[src] makes a weak noise."
m_type = 2
- if ("wink", "winks")
+ if("wink", "winks")
message = "[src] winks."
m_type = 1
- if ("yawn", "yawns")
- if (!muzzled)
+ if("yawn", "yawns")
+ if(!muzzled)
message = "[src] yawns."
m_type = 2
if(miming)
m_type = 1
- if ("collapse", "collapses")
+ if("collapse", "collapses")
Paralyse(2)
message = "[src] collapses!"
m_type = 2
@@ -699,63 +699,63 @@
if("hug", "hugs")
m_type = 1
- if (!src.restrained())
+ if(!src.restrained())
var/M = null
- if (param)
- for (var/mob/A in view(1, null))
- if (param == A.name)
+ if(param)
+ for(var/mob/A in view(1, null))
+ if(param == A.name)
M = A
break
- if (M == src)
+ if(M == src)
M = null
- if (M)
+ if(M)
message = "[src] hugs [M]."
else
message = "[src] hugs \himself."
- if ("handshake")
+ if("handshake")
m_type = 1
- if (!src.restrained() && !src.r_hand)
+ if(!src.restrained() && !src.r_hand)
var/mob/M = null
- if (param)
- for (var/mob/A in view(1, null))
- if (param == A.name)
+ if(param)
+ for(var/mob/A in view(1, null))
+ if(param == A.name)
M = A
break
- if (M == src)
+ if(M == src)
M = null
- if (M)
- if (M.canmove && !M.r_hand && !M.restrained())
+ if(M)
+ if(M.canmove && !M.r_hand && !M.restrained())
message = "[src] shakes hands with [M]."
else
message = "[src] holds out \his hand to [M]."
if("dap", "daps")
m_type = 1
- if (!src.restrained())
+ if(!src.restrained())
var/M = null
- if (param)
- for (var/mob/A in view(1, null))
- if (param == A.name)
+ if(param)
+ for(var/mob/A in view(1, null))
+ if(param == A.name)
M = A
break
- if (M)
+ if(M)
message = "[src] gives daps to [M]."
else
message = "[src] sadly can't find anybody to give daps to, and daps \himself. Shameful."
if("slap", "slaps")
m_type = 1
- if (!src.restrained())
+ if(!src.restrained())
var/M = null
- if (param)
- for (var/mob/A in view(1, null))
- if (param == A.name)
+ if(param)
+ for(var/mob/A in view(1, null))
+ if(param == A.name)
M = A
break
- if (M)
+ if(M)
message = "\red [src] slaps [M] across the face. Ouch!"
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
else
@@ -763,12 +763,12 @@
playsound(src.loc, 'sound/effects/snap.ogg', 50, 1)
src.adjustFireLoss(4)
- if ("scream", "screams")
- if (miming)
+ if("scream", "screams")
+ if(miming)
message = "[src] acts out a scream!"
m_type = 1
else
- if (!muzzled)
+ if(!muzzled)
message = "[src] [species.scream_verb]!"
m_type = 2
if(gender == FEMALE)
@@ -781,7 +781,7 @@
m_type = 2
- if ("snap", "snaps")
+ if("snap", "snaps")
if(prob(95))
m_type = 2
var/mob/living/carbon/human/H = src
@@ -794,7 +794,7 @@
if(R && (!(R.status & ORGAN_DESTROYED)) && (!(R.status & ORGAN_SPLINTED)) && (!(R.status & ORGAN_BROKEN)))
right_hand_good = 1
- if (!left_hand_good && !right_hand_good)
+ if(!left_hand_good && !right_hand_good)
to_chat(usr, "You need at least one hand in good working order to snap your fingers.")
return
@@ -829,15 +829,15 @@
// Process toxic farts first.
if(TOXIC_FARTS in mutations)
for(var/mob/M in range(location,aoe_range))
- if (M.internal != null && M.wear_mask && (M.wear_mask.flags & AIRTIGHT))
+ if(M.internal != null && M.wear_mask && (M.wear_mask.flags & AIRTIGHT))
continue
// Now, we don't have this:
//new /obj/effects/fart_cloud(T,L)
- if (M == src)
+ if(M == src)
continue
M.reagents.add_reagent("jenkem", 1)
- if ("help")
+ if("help")
var/emotelist = "aflap(s), airguitar, blink(s), blink(s)_r, blush(es), bow(s)-(none)/mob, burp(s), choke(s), chuckle(s), clap(s), collapse(s), cough(s),cry, cries, custom, dap(s)(none)/mob," \
+ " deathgasp(s), drool(s), eyebrow,fart(s), faint(s), flap(s), flip(s), frown(s), gasp(s), giggle(s), glare(s)-(none)/mob, grin(s), groan(s), grumble(s), handshake-mob, hug(s)-(none)/mob," \
+ " glare(s)-(none)/mob, grin(s), johnny, laugh(s), look(s)-(none)/mob, moan(s), mumble(s), nod(s), pale(s), point(s)-atom, quiver(s), raise(s), salute(s)-(none)/mob, scream(s), shake(s)," \
diff --git a/code/modules/mob/living/carbon/human/examine.dm b/code/modules/mob/living/carbon/human/examine.dm
index d8307e5056c..0a9e033bd54 100644
--- a/code/modules/mob/living/carbon/human/examine.dm
+++ b/code/modules/mob/living/carbon/human/examine.dm
@@ -58,14 +58,14 @@
var/displayed_species = get_species()
for(var/obj/item/clothing/C in src) //Disguise checks
- if (C == src.head || C == src.wear_suit || C == src.wear_mask || C == src.w_uniform || C == src.belt || C == src.back)
+ if(C == src.head || C == src.wear_suit || C == src.wear_mask || C == src.w_uniform || C == src.belt || C == src.back)
if(C.species_disguise)
displayed_species = C.species_disguise
- if (skipjumpsuit && skipface || (displayed_species in nospecies)) //either obscured or on the nospecies list
+ if(skipjumpsuit && skipface || (displayed_species in nospecies)) //either obscured or on the nospecies list
msg += "!\n" //omit the species when examining
- else if (displayed_species == "Slime People") //snowflakey because Slime People are defined as a plural
+ else if(displayed_species == "Slime People") //snowflakey because Slime People are defined as a plural
msg += ", a slime person!\n"
- else if (displayed_species == "Unathi") //DAMN YOU, VOWELS
+ else if(displayed_species == "Unathi") //DAMN YOU, VOWELS
msg += ", a unathi!\n"
else
msg += ", \a [lowertext(displayed_species)]!\n"
@@ -157,7 +157,7 @@
msg += "[t_He] [t_is] wearing [bicon(shoes)] [shoes.gender==PLURAL?"some":"a"] [shoes.blood_color != "#030303" ? "blood-stained":"oil-stained"] [shoes.name] on [t_his] feet!\n"
else
msg += "[t_He] [t_is] wearing [bicon(shoes)] \a [shoes] on [t_his] feet.\n"
- else if (blood_DNA)
+ else if(blood_DNA)
msg += "[t_He] [t_has] [feet_blood_color != "#030303" ? "blood-stained":"oil-stained"] feet!\n"
@@ -221,7 +221,7 @@
var/distance = get_dist(user,src)
if(istype(user, /mob/dead/observer) || user.stat == 2) // ghosts can see anything
distance = 1
- if (src.stat)
+ if(src.stat)
msg += "[t_He] [t_is]n't responding to anything around [t_him] and seems to be asleep.\n"
if((stat == 2 || src.health <= config.health_threshold_crit) && distance <= 3)
msg += "[t_He] does not appear to be breathing.\n"
@@ -275,7 +275,7 @@
else if(!key)
msg += "[t_He] [t_is] fast asleep. It doesn't look like they are waking up anytime soon.\n"
else if(!client)
- msg += "[t_He] [t_has] suddenly fallen asleep.\n"
+ msg += "[t_He] [t_has] suddenly fallen asleep, suffering from Space Sleep Disorder.\n"
if(!get_int_organ(/obj/item/organ/internal/brain))
msg += "It appears that [t_his] brain is missing...\n"
@@ -462,9 +462,9 @@
perpname = name
if(perpname)
- for (var/datum/data/record/E in data_core.general)
+ for(var/datum/data/record/E in data_core.general)
if(E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.security)
+ for(var/datum/data/record/R in data_core.security)
if(R.fields["id"] == E.fields["id"])
criminal = R.fields["criminal"]
@@ -484,10 +484,10 @@
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.general)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.general)
+ if(R.fields["id"] == E.fields["id"])
medical = R.fields["p_stat"]
msg += "Physical status:\[[medical]\]\n"
@@ -497,7 +497,7 @@
if(print_flavor_text()) msg += "[print_flavor_text()]\n"
msg += "*---------*"
- if (pose)
+ if(pose)
if( findtext(pose,".",lentext(pose)) == 0 && findtext(pose,"!",lentext(pose)) == 0 && findtext(pose,"?",lentext(pose)) == 0 )
pose = addtext(pose,".") //Makes sure all emotes end with a period.
msg += "\n[t_He] is [pose]"
diff --git a/code/modules/mob/living/carbon/human/human.dm b/code/modules/mob/living/carbon/human/human.dm
index 1bc79c16242..f9c448df5e3 100644
--- a/code/modules/mob/living/carbon/human/human.dm
+++ b/code/modules/mob/living/carbon/human/human.dm
@@ -39,6 +39,8 @@
martial_art = default_martial_art
+ handcrafting = new()
+
var/mob/M = src
faction |= "\ref[M]" //what
@@ -53,6 +55,9 @@
UpdateAppearance()
+/mob/living/carbon/human/OpenCraftingMenu()
+ handcrafting.craft(src)
+
/mob/living/carbon/human/prepare_data_huds()
//Update med hud images...
..()
@@ -203,15 +208,14 @@
now_pushing = 0
return
- if(tmob.r_hand && istype(tmob.r_hand, /obj/item/weapon/shield/riot))
- if(prob(99))
- now_pushing = 0
- return
- if(tmob.l_hand && istype(tmob.l_hand, /obj/item/weapon/shield/riot))
- if(prob(99))
- now_pushing = 0
- return
+ //anti-riot equipment is also anti-push
+ if(tmob.r_hand && (prob(tmob.r_hand.block_chance * 2)) && !istype(tmob.r_hand, /obj/item/clothing))
+ now_pushing = 0
+ return
+ if(tmob.l_hand && (prob(tmob.l_hand.block_chance * 2)) && !istype(tmob.l_hand, /obj/item/clothing))
+ now_pushing = 0
+ return
if(!(tmob.status_flags & CANPUSH))
now_pushing = 0
@@ -351,8 +355,7 @@
else valid_limbs -= processing_dismember
if(!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs))
- ear_damage += 30
- ear_deaf += 120
+ adjustEarDamage(30, 120)
if(prob(70) && !shielded)
Paralyse(10)
@@ -376,8 +379,7 @@
else valid_limbs -= processing_dismember
if(!istype(l_ear, /obj/item/clothing/ears/earmuffs) && !istype(r_ear, /obj/item/clothing/ears/earmuffs))
- ear_damage += 15
- ear_deaf += 60
+ adjustEarDamage(15,60)
if(prob(50) && !shielded)
Paralyse(10)
@@ -414,16 +416,16 @@
M.attack_log += text("\[[time_stamp()]\] attacked [src.name] ([src.ckey])")
src.attack_log += text("\[[time_stamp()]\] was attacked by [M.name] ([M.ckey])")
var/damage = rand(M.melee_damage_lower, M.melee_damage_upper)
- if(check_shields(damage, "the [M.name]"))
+ if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK, M.armour_penetration))
return 0
var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
var/obj/item/organ/external/affecting = get_organ(ran_zone(dam_zone))
- var/armor = run_armor_check(affecting, "melee")
+ var/armor = run_armor_check(affecting, "melee", armour_penetration = M.armour_penetration)
var/obj/item/organ/external/affected = src.get_organ(dam_zone)
if(affected)
affected.add_autopsy_data(M.name, damage) // Add the mob's name to the autopsy data
- apply_damage(damage,M.melee_damage_type, affecting, armor, M.name)
+ apply_damage(damage, M.melee_damage_type, affecting, armor)
updatehealth()
/mob/living/carbon/human/attack_larva(mob/living/carbon/alien/larva/L as mob)
@@ -461,7 +463,7 @@
else
damage = rand(5, 25)
- if(check_shields(damage, "the [M.name]"))
+ if(check_shields(damage, "the [M.name]", null, MELEE_ATTACK))
return 0
var/dam_zone = pick("head", "chest", "groin", "l_arm", "l_hand", "r_arm", "r_hand", "l_leg", "l_foot", "r_leg", "r_foot")
@@ -489,11 +491,11 @@
M.powerlevel = 0
for(var/mob/O in viewers(src, null))
- if ((O.client && !( O.blinded )))
+ if((O.client && !( O.blinded )))
O.show_message(text("\red The [M.name] has shocked []!", src), 1)
Weaken(power)
- if (stuttering < power)
+ if(stuttering < power)
stuttering = power
Stun(power)
@@ -501,7 +503,7 @@
s.set_up(5, 1, src)
s.start()
- if (prob(stunprob) && M.powerlevel >= 8)
+ if(prob(stunprob) && M.powerlevel >= 8)
adjustFireLoss(M.powerlevel * rand(6,10))
@@ -511,9 +513,9 @@
/mob/living/carbon/human/restrained()
- if (handcuffed)
+ if(handcuffed)
return 1
- if (istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
+ if(istype(wear_suit, /obj/item/clothing/suit/straight_jacket))
return 1
return 0
@@ -634,8 +636,8 @@
// Get rank from ID, ID inside PDA, PDA, ID in wallet, etc.
/mob/living/carbon/human/proc/get_authentification_rank(var/if_no_id = "No id", var/if_no_job = "No job")
var/obj/item/device/pda/pda = wear_id
- if (istype(pda))
- if (pda.id)
+ if(istype(pda))
+ if(pda.id)
return pda.id.rank
else
return pda.ownrank
@@ -651,16 +653,16 @@
/mob/living/carbon/human/proc/get_assignment(var/if_no_id = "No id", var/if_no_job = "No job")
var/obj/item/device/pda/pda = wear_id
var/obj/item/weapon/card/id/id = wear_id
- if (istype(pda))
- if (pda.id && istype(pda.id, /obj/item/weapon/card/id))
+ if(istype(pda))
+ if(pda.id && istype(pda.id, /obj/item/weapon/card/id))
. = pda.id.assignment
else
. = pda.ownjob
- else if (istype(id))
+ else if(istype(id))
. = id.assignment
else
return if_no_id
- if (!.)
+ if(!.)
. = if_no_job
return
@@ -669,12 +671,12 @@
/mob/living/carbon/human/proc/get_authentification_name(var/if_no_id = "Unknown")
var/obj/item/device/pda/pda = wear_id
var/obj/item/weapon/card/id/id = wear_id
- if (istype(pda))
- if (pda.id)
+ if(istype(pda))
+ if(pda.id)
. = pda.id.registered_name
else
. = pda.owner
- else if (istype(id))
+ else if(istype(id))
. = id.registered_name
else
return if_no_id
@@ -715,9 +717,9 @@
/mob/living/carbon/human/proc/get_idcard()
var/obj/item/weapon/card/id/id = wear_id
var/obj/item/device/pda/pda = wear_id
- if (istype(pda) && pda.id)
+ if(istype(pda) && pda.id)
id = pda.id
- if (istype(id))
+ if(istype(id))
return id
//Removed the horrible safety parameter. It was only being used by ninja code anyways.
@@ -828,7 +830,7 @@
U.accessories -= A
update_inv_w_uniform()
- if (href_list["criminal"])
+ if(href_list["criminal"])
if(hasHUD(usr,"security"))
var/modified = 0
@@ -843,10 +845,10 @@
perpname = name
if(perpname)
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.security)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.security)
+ if(R.fields["id"] == E.fields["id"])
var/setcriminal = input(usr, "Specify a new criminal status for this person.", "Security HUD", R.fields["criminal"]) in list("None", "*Arrest*", "Incarcerated", "Parolled", "Released", "Cancel")
@@ -866,7 +868,7 @@
if(!modified)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["secrecord"])
+ if(href_list["secrecord"])
if(hasHUD(usr,"security"))
var/perpname = "wot"
var/read = 0
@@ -879,10 +881,10 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.security)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.security)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
to_chat(usr, "Name: [R.fields["name"]] Criminal Status: [R.fields["criminal"]]")
to_chat(usr, "Minor Crimes: [R.fields["mi_crim"]]")
@@ -896,7 +898,7 @@
if(!read)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["secrecordComment"])
+ if(href_list["secrecordComment"])
if(hasHUD(usr,"security"))
var/perpname = "wot"
var/read = 0
@@ -909,24 +911,24 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.security)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.security)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
read = 1
var/counter = 1
while(R.fields[text("com_[]", counter)])
to_chat(usr, text("[]", R.fields[text("com_[]", counter)]))
counter++
- if (counter == 1)
+ if(counter == 1)
to_chat(usr, "No comment found")
to_chat(usr, "\[Add comment\]")
if(!read)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["secrecordadd"])
+ if(href_list["secrecordadd"])
if(hasHUD(usr,"security"))
var/perpname = "wot"
if(wear_id)
@@ -937,13 +939,13 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.security)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.security)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"security"))
var/t1 = sanitize(copytext(input("Add Comment:", "Sec. records", null, null) as message,1,MAX_MESSAGE_LEN))
- if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"security")) )
+ if( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"security")) )
return
var/counter = 1
while(R.fields[text("com_[]", counter)])
@@ -958,7 +960,7 @@
var/mob/living/silicon/ai/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.name] (artificial intelligence) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year] [t1]")
- if (href_list["medical"])
+ if(href_list["medical"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/modified = 0
@@ -972,10 +974,10 @@
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.general)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.general)
+ if(R.fields["id"] == E.fields["id"])
var/setmedical = input(usr, "Specify a new medical status for this person.", "Medical HUD", R.fields["p_stat"]) in list("*SSD*", "*Deceased*", "Physically Unfit", "Active", "Disabled", "Cancel")
if(hasHUD(usr,"medical"))
@@ -996,7 +998,7 @@
if(!modified)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["medrecord"])
+ if(href_list["medrecord"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/read = 0
@@ -1009,10 +1011,10 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.medical)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.medical)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
to_chat(usr, "Name: [R.fields["name"]] Blood Type: [R.fields["b_type"]]")
to_chat(usr, "DNA: [R.fields["b_dna"]]")
@@ -1027,7 +1029,7 @@
if(!read)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["medrecordComment"])
+ if(href_list["medrecordComment"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
var/read = 0
@@ -1040,24 +1042,24 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.medical)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.medical)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
read = 1
var/counter = 1
while(R.fields[text("com_[]", counter)])
to_chat(usr, text("[]", R.fields[text("com_[]", counter)]))
counter++
- if (counter == 1)
+ if(counter == 1)
to_chat(usr, "No comment found")
to_chat(usr, "\[Add comment\]")
if(!read)
to_chat(usr, "\red Unable to locate a data core entry for this person.")
- if (href_list["medrecordadd"])
+ if(href_list["medrecordadd"])
if(hasHUD(usr,"medical"))
var/perpname = "wot"
if(wear_id)
@@ -1068,13 +1070,13 @@
perpname = tempPda.owner
else
perpname = src.name
- for (var/datum/data/record/E in data_core.general)
- if (E.fields["name"] == perpname)
- for (var/datum/data/record/R in data_core.medical)
- if (R.fields["id"] == E.fields["id"])
+ for(var/datum/data/record/E in data_core.general)
+ if(E.fields["name"] == perpname)
+ for(var/datum/data/record/R in data_core.medical)
+ if(R.fields["id"] == E.fields["id"])
if(hasHUD(usr,"medical"))
var/t1 = sanitize(copytext(input("Add Comment:", "Med. records", null, null) as message,1,MAX_MESSAGE_LEN))
- if ( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"medical")) )
+ if( !(t1) || usr.stat || usr.restrained() || !(hasHUD(usr,"medical")) )
return
var/counter = 1
while(R.fields[text("com_[]", counter)])
@@ -1086,11 +1088,11 @@
var/mob/living/silicon/robot/U = usr
R.fields[text("com_[counter]")] = text("Made by [U.name] ([U.modtype] [U.braintype]) on [time2text(world.realtime, "DDD MMM DD hh:mm:ss")], [game_year] [t1]")
- if (href_list["lookitem"])
+ if(href_list["lookitem"])
var/obj/item/I = locate(href_list["lookitem"])
src.examinate(I)
- if (href_list["lookmob"])
+ if(href_list["lookmob"])
var/mob/M = locate(href_list["lookmob"])
src.examinate(M)
. = ..()
@@ -1195,7 +1197,7 @@
if(!affecting)
. = 0
fail_msg = "They are missing that limb."
- else if (affecting.status & ORGAN_ROBOT)
+ else if(affecting.status & ORGAN_ROBOT)
. = 0
fail_msg = "That limb is robotic."
else
@@ -1324,7 +1326,7 @@
mutations.Remove(HUSK)
if(!client || !key) //Don't boot out anyone already in the mob.
- for (var/obj/item/organ/internal/brain/H in world)
+ for(var/obj/item/organ/internal/brain/H in world)
if(H.brainmob)
if(H.brainmob.real_name == src.real_name)
if(H.brainmob.mind)
@@ -1359,30 +1361,30 @@
var/germs = 0
var/tdamage = 0
var/ticks = 0
- while (germs < 2501 && ticks < 100000 && round(damage/10)*20)
+ while(germs < 2501 && ticks < 100000 && round(damage/10)*20)
diary << "VIRUS TESTING: [ticks] : germs [germs] tdamage [tdamage] prob [round(damage/10)*20]"
ticks++
- if (prob(round(damage/10)*20))
+ if(prob(round(damage/10)*20))
germs++
- if (germs == 100)
+ if(germs == 100)
to_chat(world, "Reached stage 1 in [ticks] ticks")
- if (germs > 100)
- if (prob(10))
+ if(germs > 100)
+ if(prob(10))
damage++
germs++
- if (germs == 1000)
+ if(germs == 1000)
to_chat(world, "Reached stage 2 in [ticks] ticks")
- if (germs > 1000)
+ if(germs > 1000)
damage++
germs++
- if (germs == 2500)
+ if(germs == 2500)
to_chat(world, "Reached stage 3 in [ticks] ticks")
to_chat(world, "Mob took [tdamage] tox damage")
*/
//returns 1 if made bloody, returns 0 otherwise
/mob/living/carbon/human/add_blood(mob/living/carbon/human/M as mob)
- if (!..())
+ if(!..())
return 0
//if this blood isn't already in the list, add it
if(blood_DNA[M.dna.unique_enzymes])
@@ -1620,32 +1622,32 @@
set name = "Write in blood"
set desc = "Use blood on your hands to write a short message on the floor or a wall, murder mystery style."
- if (usr != src)
+ if(usr != src)
return 0 //something is terribly wrong
- if (!bloody_hands)
+ if(!bloody_hands)
verbs -= /mob/living/carbon/human/proc/bloody_doodle
- if (src.gloves)
+ if(src.gloves)
to_chat(src, "Your [src.gloves] are getting in the way.")
return
var/turf/simulated/T = src.loc
- if (!istype(T)) //to prevent doodling out of mechs and lockers
+ if(!istype(T)) //to prevent doodling out of mechs and lockers
to_chat(src, "You cannot reach the floor.")
return
var/direction = input(src,"Which way?","Tile selection") as anything in list("Here","North","South","East","West")
- if (direction != "Here")
+ if(direction != "Here")
T = get_step(T,text2dir(direction))
- if (!istype(T))
+ if(!istype(T))
to_chat(src, "You cannot doodle there.")
return
var/num_doodles = 0
- for (var/obj/effect/decal/cleanable/blood/writing/W in T)
+ for(var/obj/effect/decal/cleanable/blood/writing/W in T)
num_doodles++
- if (num_doodles > 4)
+ if(num_doodles > 4)
to_chat(src, "There is no space to write on!")
return
@@ -1653,11 +1655,11 @@
var/message = stripped_input(src,"Write a message. It cannot be longer than [max_length] characters.","Blood writing", "")
- if (message)
+ if(message)
var/used_blood_amount = round(length(message) / 30, 1)
bloody_hands = max(0, bloody_hands - used_blood_amount) //use up some blood
- if (length(message) > max_length)
+ if(length(message) > max_length)
message += "-"
to_chat(src, "You ran out of blood to write with!")
diff --git a/code/modules/mob/living/carbon/human/human_attackhand.dm b/code/modules/mob/living/carbon/human/human_attackhand.dm
index 33cb567ba4a..d39aa319e51 100644
--- a/code/modules/mob/living/carbon/human/human_attackhand.dm
+++ b/code/modules/mob/living/carbon/human/human_attackhand.dm
@@ -1,5 +1,5 @@
/mob/living/carbon/human/attack_hand(mob/living/carbon/human/M as mob)
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -10,7 +10,7 @@
var/mob/living/carbon/human/H = M
if(istype(H))
var/obj/item/organ/external/temp = H.organs_by_name["r_hand"]
- if (H.hand)
+ if(H.hand)
temp = H.organs_by_name["l_hand"]
if(!temp || !temp.is_usable())
to_chat(H, "\red You can't use your hand.")
@@ -18,10 +18,9 @@
..()
- if((M != src) && check_shields(0, M.name))
+ if((M != src) && M.a_intent != "help" && check_shields(0, M.name, attack_type = UNARMED_ATTACK))
add_logs(src, M, "attempted to touch")
- M.do_attack_animation(src)
- visible_message("\red [M] attempted to touch [src]!")
+ visible_message("[M] attempted to touch [src]!")
return 0
if(istype(M.gloves , /obj/item/clothing/gloves/boxing/hologlove))
@@ -109,36 +108,34 @@
return 1
if(I_HARM)
+ //Vampire code
+ if(M.mind && M.mind.vampire && (M.mind in ticker.mode.vampires) && !M.mind.vampire.draining && M.zone_sel && M.zone_sel.selecting == "head" && src != M)
+ if((head && (head.flags & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags & MASKCOVERSMOUTH)))
+ to_chat(M, "Remove their mask!")
+ return
+ if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH)))
+ to_chat(M, "Remove your mask!")
+ return
+ if(mind && mind.vampire && (mind in ticker.mode.vampires))
+ to_chat(M, "Your fangs fail to pierce [src.name]'s cold flesh")
+ return
+ if(SKELETON in mutations)
+ to_chat(M, "There is no blood in a skeleton!")
+ return
+ if(issmall(src) && !ckey) //Monkeyized humans are okay, humanized monkeys are okey, monkeys are not.
+ to_chat(M, "Blood from a monkey is useless!")
+ return
+ //we're good to suck the blood, blaah
+ M.mind.vampire.handle_bloodsucking(src)
+ add_logs(src, M, "vampirebit")
+ msg_admin_attack("[key_name_admin(M)] vampirebit [key_name_admin(src)]")
+ return
+ //end vampire codes
if(attacker_style && attacker_style.harm_act(H, src))
return 1
else
var/datum/unarmed_attack/attack = M.species.unarmed
- //Vampire code
- if(M.zone_sel && M.zone_sel.selecting == "head" && src != M)
- if(M.mind && M.mind.vampire && (M.mind in ticker.mode.vampires) && !M.mind.vampire.draining)
- if((head && (head.flags & HEADCOVERSMOUTH)) || (wear_mask && (wear_mask.flags & MASKCOVERSMOUTH)))
- to_chat(M, "Remove their mask!")
- return 0
- if((M.head && (M.head.flags & HEADCOVERSMOUTH)) || (M.wear_mask && (M.wear_mask.flags & MASKCOVERSMOUTH)))
- to_chat(M, "Remove your mask!")
- return 0
- if(mind && mind.vampire && (mind in ticker.mode.vampires))
- to_chat(M, "Your fangs fail to pierce [src.name]'s cold flesh")
- return 0
- if(SKELETON in mutations)
- to_chat(M, "There is no blood in a skeleton!")
- return 0
- if(issmall(src) && !ckey) //Monkeyized humans are okay, humanized monkeys are okey, monkeys are not.
- to_chat(M, "Blood from a monkey is useless!")
- return 0
- //we're good to suck the blood, blaah
- M.mind.vampire.handle_bloodsucking(src)
- add_logs(src, M, "vampirebit")
- msg_admin_attack("[key_name_admin(M)] vampirebit [key_name_admin(src)]")
- return
- //end vampire codes
-
M.do_attack_animation(src)
add_logs(src, M, "[pick(attack.attack_verb)]ed")
@@ -185,7 +182,7 @@
w_uniform.add_fingerprint(M)
var/obj/item/organ/external/affecting = get_organ(ran_zone(M.zone_sel.selecting))
var/randn = rand(1, 100)
- if (randn <= 25)
+ if(randn <= 25)
apply_effect(2, WEAKEN, run_armor_check(affecting, "melee"))
playsound(loc, 'sound/weapons/thudswoosh.ogg', 50, 1, -1)
visible_message("\red [M] has pushed [src]!")
diff --git a/code/modules/mob/living/carbon/human/human_damage.dm b/code/modules/mob/living/carbon/human/human_damage.dm
index 88e655beb0e..0e2e95bc778 100644
--- a/code/modules/mob/living/carbon/human/human_damage.dm
+++ b/code/modules/mob/living/carbon/human/human_damage.dm
@@ -26,6 +26,7 @@
update_revive()
med_hud_set_health()
med_hud_set_status()
+ handle_hud_icons()
/mob/living/carbon/human/adjustBrainLoss(var/amount)
if(status_flags & GODMODE)
@@ -103,7 +104,7 @@
if(species && species.brute_mod)
amount = amount*species.brute_mod
- if (organ_name in organs_by_name)
+ if(organ_name in organs_by_name)
var/obj/item/organ/external/O = get_organ(organ_name)
if(amount > 0)
@@ -117,7 +118,7 @@
if(species && species.burn_mod)
amount = amount*species.burn_mod
- if (organ_name in organs_by_name)
+ if(organ_name in organs_by_name)
var/obj/item/organ/external/O = get_organ(organ_name)
if(amount > 0)
@@ -316,8 +317,9 @@ This function restores the subjects blood to max.
*/
/mob/living/carbon/human/proc/restore_blood()
if(!(species.flags & NO_BLOOD))
- var/blood_volume = vessel.get_reagent_amount("blood")
- vessel.add_reagent("blood", 560.0 - blood_volume)
+ var/blood_type = get_blood_name()
+ var/blood_volume = vessel.get_reagent_amount(blood_type)
+ vessel.add_reagent(blood_type, BLOOD_VOLUME_NORMAL - blood_volume)
/*
This function restores all organs.
@@ -383,7 +385,7 @@ This function restores all organs.
var/list/attack_bubble_recipients = list()
var/mob/living/user
for(var/mob/O in viewers(user, src))
- if (O.client && !(O.blinded))
+ if(O.client && !(O.blinded))
attack_bubble_recipients.Add(O.client)
spawn(0)
var/image/dmgIcon = image('icons/effects/hit_blips.dmi', src, "dmg[rand(1,2)]",MOB_LAYER+1)
diff --git a/code/modules/mob/living/carbon/human/human_defense.dm b/code/modules/mob/living/carbon/human/human_defense.dm
index 3a935e5e449..55fd52ada9e 100644
--- a/code/modules/mob/living/carbon/human/human_defense.dm
+++ b/code/modules/mob/living/carbon/human/human_defense.dm
@@ -32,7 +32,7 @@ emp_act
return -1 // complete projectile permutation
//Shields
- if(check_shields(P.damage, "the [P.name]", P))
+ if(check_shields(P.damage, "the [P.name]", P, PROJECTILE_ATTACK, P.armour_penetration))
P.on_hit(src, 100, def_zone)
return 2
@@ -41,7 +41,7 @@ emp_act
return
//Shrapnel
- if (P.damage_type == BRUTE)
+ if(P.damage_type == BRUTE)
var/armor = getarmor_organ(organ, "bullet")
if((P.embed && prob(20 + max(P.damage - armor, -10))))
var/obj/item/weapon/shard/shrapnel/SP = new()
@@ -91,7 +91,7 @@ emp_act
//this proc returns the Siemens coefficient of electrical resistivity for a particular external organ.
/mob/living/carbon/human/proc/get_siemens_coefficient_organ(var/obj/item/organ/external/def_zone)
- if (!def_zone)
+ if(!def_zone)
return 1.0
var/siemens_coefficient = 1.0
@@ -132,40 +132,24 @@ emp_act
//End Here
-/mob/living/carbon/human/proc/check_shields(var/damage = 0, var/attack_text = "the attack", var/obj/item/O)
- if(O)
- if(O.flags & NOSHIELD) //weapon ignores shields altogether
- return 0
- if(l_hand && istype(l_hand, /obj/item/weapon))//Current base is the prob(50-d/3)
- var/obj/item/weapon/I = l_hand
- if(I.IsShield() && (prob(50 - round(damage / 3))))
- visible_message("[src] blocks [attack_text] with [l_hand]!", \
- "[src] blocks [attack_text] with [l_hand]!")
+/mob/living/carbon/human/proc/check_shields(damage = 0, attack_text = "the attack", atom/movable/AM, attack_type = MELEE_ATTACK, armour_penetration = 0)
+ var/block_chance_modifier = round(damage / -3)
+
+ if(l_hand && !istype(l_hand, /obj/item/clothing))
+ var/final_block_chance = l_hand.block_chance - (Clamp((armour_penetration-l_hand.armour_penetration)/2,0,100)) + block_chance_modifier //So armour piercing blades can still be parried by other blades, for example
+ if(l_hand.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
return 1
- if(r_hand && istype(r_hand, /obj/item/weapon))
- var/obj/item/weapon/I = r_hand
- if(I.IsShield() && (prob(50 - round(damage / 3))))
- visible_message("[src] blocks [attack_text] with [r_hand]!", \
- "[src] blocks [attack_text] with [r_hand]!")
+ if(r_hand && !istype(r_hand, /obj/item/clothing))
+ var/final_block_chance = r_hand.block_chance - (Clamp((armour_penetration-r_hand.armour_penetration)/2,0,100)) + block_chance_modifier //Need to reset the var so it doesn't carry over modifications between attempts
+ if(r_hand.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
return 1
- if(wear_suit && istype(wear_suit, /obj/item/))
- var/obj/item/I = wear_suit
- if(I.IsShield() && (prob(50)))
- visible_message("The reactive teleport system flings [src] clear of [attack_text]!", \
- "The reactive teleport system flings [src] clear of [attack_text]!")
- var/list/turfs = new/list()
- for(var/turf/T in orange(6, src))
- if(istype(T,/turf/space)) continue
- if(T.density) continue
- if(T.x>world.maxx-6 || T.x<6) continue
- if(T.y>world.maxy-6 || T.y<6) continue
- turfs += T
- if(!turfs.len) turfs += pick(/turf in orange(6, src))
- var/turf/picked = pick(turfs)
- if(!isturf(picked)) return
- if(buckled)
- buckled.unbuckle_mob()
- src.loc = picked
+ if(wear_suit)
+ var/final_block_chance = wear_suit.block_chance - (Clamp((armour_penetration-wear_suit.armour_penetration)/2,0,100)) + block_chance_modifier
+ if(wear_suit.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
+ return 1
+ if(w_uniform)
+ var/final_block_chance = w_uniform.block_chance - (Clamp((armour_penetration-w_uniform.armour_penetration)/2,0,100)) + block_chance_modifier
+ if(w_uniform.hit_reaction(src, attack_text, final_block_chance, damage, attack_type))
return 1
return 0
@@ -221,7 +205,7 @@ emp_act
if(user != src)
user.do_attack_animation(src)
- if(check_shields(I.force, "the [I.name]", I))
+ if(check_shields(I.force, "the [I.name]", I, MELEE_ATTACK, I.armour_penetration))
return 0
if(istype(I,/obj/item/weapon/card/emag))
@@ -236,7 +220,7 @@ emp_act
var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].", armour_penetration = I.armour_penetration)
var/weapon_sharp = is_sharp(I)
var/weapon_edge = has_edge(I)
- if ((weapon_sharp || weapon_edge) && prob(getarmor(user.zone_sel.selecting, "melee")))
+ if((weapon_sharp || weapon_edge) && prob(getarmor(user.zone_sel.selecting, "melee")))
weapon_sharp = 0
weapon_edge = 0
@@ -299,9 +283,9 @@ emp_act
forcesay(hit_appends) //forcesay checks stat already
/* //Melee weapon embedded object code. Commented out, as most people on the forums seem to find this annoying and think it does not contribute to general gameplay. - Dave
- if (I.damtype == BRUTE && !I.is_robot_module())
+ if(I.damtype == BRUTE && !I.is_robot_module())
var/damage = I.force
- if (armor)
+ if(armor)
damage /= armor+1
//blunt objects should really not be embedding in things unless a huge amount of force is involved
@@ -315,63 +299,56 @@ emp_act
//this proc handles being hit by a thrown atom
/mob/living/carbon/human/hitby(atom/movable/AM as mob|obj,var/speed = 5)
- if(istype(AM,/obj/))
- var/obj/O = AM
+ if(istype(AM, /obj/item))
+ var/obj/item/I = AM
if(in_throw_mode && !get_active_hand() && speed <= 5) //empty active hand and we're in throw mode
if(canmove && !restrained())
- if(isturf(O.loc))
- put_in_active_hand(O)
- visible_message("[src] catches [O]!")
+ if(isturf(I.loc))
+ put_in_active_hand(I)
+ visible_message("[src] catches [I]!")
throw_mode_off()
return
var/zone = ran_zone("chest", 65)
var/dtype = BRUTE
- if(istype(O,/obj/item/weapon))
- var/obj/item/weapon/W = O
+ if(istype(I, /obj/item/weapon))
+ var/obj/item/weapon/W = I
dtype = W.damtype
- var/throw_damage = O.throwforce*(speed/5)
+ var/throw_damage = I.throwforce*(speed/5)
- /*
- if(!zone)
- visible_message("\blue \The [O] misses [src] narrowly!")
- return
- */
- O.throwing = 0 //it hit, so stop moving
+ I.throwing = 0 //it hit, so stop moving
- if ((O.thrower != src) && check_shields(throw_damage, "[O]"))
+ if((I.thrower != src) && check_shields(throw_damage, "\the [I.name]", I, THROWN_PROJECTILE_ATTACK))
return
var/obj/item/organ/external/affecting = get_organ(zone)
if(!affecting)
- var/missverb = (O.gender == PLURAL) ? "whizz" : "whizzes"
- visible_message("\The [O] [missverb] past [src]'s missing [parse_zone(zone)]!",
- "\The [O] [missverb] past your missing [parse_zone(zone)]!")
+ var/missverb = (I.gender == PLURAL) ? "whizz" : "whizzes"
+ visible_message("\The [I] [missverb] past [src]'s missing [parse_zone(zone)]!",
+ "\The [I] [missverb] past your missing [parse_zone(zone)]!")
return
var/hit_area = affecting.name
- src.visible_message("\red [src] has been hit in the [hit_area] by [O].")
- var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].") //I guess "melee" is the best fit here
+ src.visible_message("\red [src] has been hit in the [hit_area] by [I].")
+ var/armor = run_armor_check(affecting, "melee", "Your armor has protected your [hit_area].", "Your armor has softened hit to your [hit_area].", I.armour_penetration) //I guess "melee" is the best fit here
+ apply_damage(throw_damage, dtype, zone, armor, is_sharp(I), has_edge(I), I)
- apply_damage(throw_damage, dtype, zone, armor, is_sharp(O), has_edge(O), O)
-
- if(ismob(O.thrower))
- var/mob/M = O.thrower
+ if(ismob(I.thrower))
+ var/mob/M = I.thrower
if(M)
- src.attack_log += text("\[[time_stamp()]\] Has been hit with a [O], thrown by [key_name(M)]")
- M.attack_log += text("\[[time_stamp()]\] Hit [key_name(src)] with a thrown [O]")
+ src.attack_log += text("\[[time_stamp()]\] Has been hit with a [I], thrown by [key_name(M)]")
+ M.attack_log += text("\[[time_stamp()]\] Hit [key_name(src)] with a thrown [I]")
if(!istype(src,/mob/living/simple_animal/mouse))
- msg_admin_attack("[key_name_admin(src)] was hit by a [O], thrown by [key_name_admin(M)]")
+ msg_admin_attack("[key_name_admin(src)] was hit by a [I], thrown by [key_name_admin(M)]")
//thrown weapon embedded object code.
- if(dtype == BRUTE && istype(O,/obj/item))
- var/obj/item/I = O
- if (!I.is_robot_module())
+ if(dtype == BRUTE && istype(I))
+ if(!I.is_robot_module())
var/sharp = is_sharp(I)
var/damage = throw_damage
- if (armor)
+ if(armor)
damage /= armor+1
//blunt objects should really not be embedding in things unless a huge amount of force is involved
@@ -384,10 +361,10 @@ emp_act
affecting.embed(I)
// Begin BS12 momentum-transfer code.
- if(O.throw_source && speed >= 15)
- var/obj/item/weapon/W = O
+ if(I.throw_source && speed >= 15)
+ var/obj/item/weapon/W = I
var/momentum = speed/2
- var/dir = get_dir(O.throw_source, src)
+ var/dir = get_dir(I.throw_source, src)
visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!")
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
@@ -399,14 +376,14 @@ emp_act
if(T)
src.loc = T
- visible_message("[src] is pinned to the wall by [O]!","You are pinned to the wall by [O]!")
+ visible_message("[src] is pinned to the wall by [I]!","You are pinned to the wall by [I]!")
src.anchored = 1
- src.pinned += O
+ src.pinned += I
/mob/living/carbon/human/proc/bloody_hands(var/mob/living/source, var/amount = 2)
- if (gloves)
+ if(gloves)
gloves.add_blood(source)
gloves:transfer_blood = amount
gloves:bloody_hands_mob = source
diff --git a/code/modules/mob/living/carbon/human/human_defines.dm b/code/modules/mob/living/carbon/human/human_defines.dm
index 6f106f5e125..a74409a9b44 100644
--- a/code/modules/mob/living/carbon/human/human_defines.dm
+++ b/code/modules/mob/living/carbon/human/human_defines.dm
@@ -53,6 +53,8 @@ var/global/default_martial_art = new/datum/martial_art
var/speech_problem_flag = 0
+ var/datum/personal_crafting/handcrafting
+
var/datum/martial_art/martial_art = null
var/special_voice = "" // For changing our voice. Used by a symptom.
@@ -70,7 +72,7 @@ var/global/default_martial_art = new/datum/martial_art
var/mob/remoteview_target = null
var/meatleft = 3 //For chef item
var/decaylevel = 0 // For rotting bodies
- var/max_blood = 560 // For stuff in the vessel
+ var/max_blood = BLOOD_VOLUME_NORMAL // For stuff in the vessel
var/slime_color = "blue" //For slime people this defines their color, it's blue by default to pay tribute to the old icons
var/check_mutations=0 // Check mutations on next life tick
@@ -80,4 +82,4 @@ var/global/default_martial_art = new/datum/martial_art
var/fire_dmi = 'icons/mob/OnFire.dmi'
var/fire_sprite = "Standing"
- var/datum/body_accessory/body_accessory = null
\ No newline at end of file
+ var/datum/body_accessory/body_accessory = null
diff --git a/code/modules/mob/living/carbon/human/human_movement.dm b/code/modules/mob/living/carbon/human/human_movement.dm
index 5d79e3f6237..cf66c1d2c15 100644
--- a/code/modules/mob/living/carbon/human/human_movement.dm
+++ b/code/modules/mob/living/carbon/human/human_movement.dm
@@ -24,7 +24,7 @@
tally += (health_deficiency / 25)
var/hungry = (500 - nutrition)/5 // So overeat would be 100 and default level would be 80
- if (hungry >= 70)
+ if(hungry >= 70)
tally += hungry/50
if(wear_suit)
@@ -46,7 +46,7 @@
if(FAT in src.mutations)
tally += 1.5
- if (bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
+ if(bodytemperature < BODYTEMP_COLD_DAMAGE_LIMIT)
tally += (BODYTEMP_COLD_DAMAGE_LIMIT - bodytemperature) / COLD_SLOWDOWN_FACTOR
tally += 2*stance_damage //damaged/missing feet or legs is slow
@@ -79,7 +79,7 @@
break
if(thrust)
- if((movement_dir || thrust.stabilization_on) && thrust.allow_thrust(0.01, src))
+ if((movement_dir || thrust.stabilizers) && thrust.allow_thrust(0.01, src))
return 1
return 0
diff --git a/code/modules/mob/living/carbon/human/human_organs.dm b/code/modules/mob/living/carbon/human/human_organs.dm
index 56838b8d14e..aa0724c5c80 100644
--- a/code/modules/mob/living/carbon/human/human_organs.dm
+++ b/code/modules/mob/living/carbon/human/human_organs.dm
@@ -42,45 +42,45 @@
E.process()
number_wounds += E.number_wounds
- if (!lying && world.time - l_move_time < 15)
+ if(!lying && world.time - l_move_time < 15)
//Moving around with fractured ribs won't do you any good
- if (E.is_broken() && E.internal_organs && E.internal_organs.len && prob(15))
+ if(E.is_broken() && E.internal_organs && E.internal_organs.len && prob(15))
var/obj/item/organ/internal/I = pick(E.internal_organs)
custom_pain("You feel broken bones moving in your [E.name]!", 1)
I.take_damage(rand(3,5))
//Moving makes open wounds get infected much faster
- if (E.wounds.len)
+ if(E.wounds.len)
for(var/datum/wound/W in E.wounds)
- if (W.infection_check())
+ if(W.infection_check())
W.germ_level += 1
/mob/living/carbon/human/proc/handle_stance()
// Don't need to process any of this if they aren't standing anyways
// unless their stance is damaged, and we want to check if they should stay down
- if (!stance_damage && (lying || resting) && (life_tick % 4) == 0)
+ if(!stance_damage && (lying || resting) && (life_tick % 4) == 0)
return
stance_damage = 0
// Buckled to a bed/chair. Stance damage is forced to 0 since they're sitting on something solid
- if (istype(buckled, /obj/structure/stool/bed))
+ if(istype(buckled, /obj/structure/stool/bed))
return
for(var/limb_tag in list("l_leg","r_leg","l_foot","r_foot"))
var/obj/item/organ/external/E = organs_by_name[limb_tag]
if(!E || (E.status & (ORGAN_DESTROYED|ORGAN_DEAD)) || E.is_malfunctioning())
stance_damage += 2 // let it fail even if just foot&leg. Also malfunctioning happens sporadically so it should impact more when it procs
- else if (E.is_broken() || !E.is_usable())
+ else if(E.is_broken() || !E.is_usable())
stance_damage += 1
// Canes and crutches help you stand (if the latter is ever added)
// One cane mitigates a broken leg+foot, or a missing foot.
// Two canes are needed for a lost leg. If you are missing both legs, canes aren't gonna help you.
- if (l_hand && istype(l_hand, /obj/item/weapon/cane))
+ if(l_hand && istype(l_hand, /obj/item/weapon/cane))
stance_damage -= 2
- if (r_hand && istype(r_hand, /obj/item/weapon/cane))
+ if(r_hand && istype(r_hand, /obj/item/weapon/cane))
stance_damage -= 2
if(stance_damage < 0)
@@ -100,7 +100,7 @@
if(!l_hand && !r_hand)
return
- for (var/obj/item/organ/external/E in organs)
+ for(var/obj/item/organ/external/E in organs)
if(!E || !E.can_grasp || (E.status & ORGAN_SPLINTED))
continue
@@ -163,7 +163,7 @@ I use this to standardize shadowling dethrall code
-- Crazylemon
*/
/mob/living/carbon/human/proc/named_organ_parent(var/organ_name)
- if (!get_int_organ(organ_name))
+ if(!get_int_organ(organ_name))
return null
var/obj/item/organ/internal/O = get_int_organ(organ_name)
return O.parent_organ
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/interactive/functions.dm b/code/modules/mob/living/carbon/human/interactive/functions.dm
index c1b22e721f2..199530c4805 100644
--- a/code/modules/mob/living/carbon/human/interactive/functions.dm
+++ b/code/modules/mob/living/carbon/human/interactive/functions.dm
@@ -442,7 +442,7 @@
var/static/list/customableTypes = list(/obj/item/weapon/reagent_containers/food/snacks/customizable,/obj/item/weapon/reagent_containers/food/snacks/breadslice,/obj/item/weapon/reagent_containers/food/snacks/bun,/obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough,/obj/item/weapon/reagent_containers/food/snacks/boiledspagetti,/obj/item/trash/plate,/obj/item/trash/bowl)
- var/static/list/rawtypes = list(/obj/item/weapon/reagent_containers/food/snacks/grown, /obj/item/weapon/reagent_containers/food/snacks/rawcutlet, /obj/item/weapon/reagent_containers/food/snacks/rawmeatball, /obj/item/weapon/reagent_containers/food/snacks/rawsticks, /obj/item/weapon/reagent_containers/food/snacks/salmonmeat, /obj/item/weapon/reagent_containers/food/snacks/carpmeat, /obj/item/weapon/reagent_containers/food/snacks/catfishmeat, /obj/item/weapon/reagent_containers/food/snacks/spagetti, /obj/item/weapon/reagent_containers/food/snacks/dough_ball, /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough, /obj/item/weapon/reagent_containers/food/snacks/doughslice, /obj/item/weapon/reagent_containers/food/snacks/meat, /obj/item/weapon/reagent_containers/food/snacks/boiledrice, /obj/item/weapon/reagent_containers/food/snacks/cheesewedge)
+ var/static/list/rawtypes = list(/obj/item/weapon/reagent_containers/food/snacks/grown, /obj/item/weapon/reagent_containers/food/snacks/rawcutlet, /obj/item/weapon/reagent_containers/food/snacks/rawmeatball, /obj/item/weapon/reagent_containers/food/snacks/rawsticks, /obj/item/weapon/reagent_containers/food/snacks/salmonmeat, /obj/item/weapon/reagent_containers/food/snacks/carpmeat, /obj/item/weapon/reagent_containers/food/snacks/catfishmeat, /obj/item/weapon/reagent_containers/food/snacks/spagetti, /obj/item/weapon/reagent_containers/food/snacks/dough_ball, /obj/item/weapon/reagent_containers/food/snacks/sliceable/flatdough, /obj/item/weapon/reagent_containers/food/snacks/doughslice, /obj/item/weapon/reagent_containers/food/snacks/meat, /obj/item/weapon/reagent_containers/food/snacks/boiledrice, /obj/item/weapon/reagent_containers/food/snacks/cheesewedge, /obj/item/weapon/reagent_containers/food/snacks/raw_bacon)
try
var/list/allContents = getAllContents()
@@ -460,7 +460,7 @@
var/global/list/available_recipes
if(!available_recipes)
available_recipes = list()
- for (var/type in subtypesof(/datum/recipe))
+ for(var/type in subtypesof(/datum/recipe))
var/datum/recipe/recipe = new type
if(recipe.result) // Ignore recipe subtypes that lack a result
available_recipes += recipe
@@ -518,6 +518,7 @@
var/obj/item/weapon/reagent_containers/food/snacks/sliceable/cheesewheel/CW = locate() in rangeCheck
var/obj/item/weapon/reagent_containers/food/snacks/grown/potato/PO = locate() in rangeCheck
var/obj/item/weapon/reagent_containers/food/snacks/meat/ME = locate() in rangeCheck
+ var/obj/item/weapon/reagent_containers/food/snacks/raw_bacon/RB = locate() in rangeCheck
if(D)
TARGET = D
@@ -561,6 +562,13 @@
sleep(get_dist(src, ME))
ME.attackby(KK, src)
foundCookable = 1
+ else if(RB)
+ TARGET = RB
+ if(prob(50))
+ tryWalk(get_turf(RB))
+ sleep(get_dist(src, RB))
+ RB.attackby(KK, src)
+ foundCookable = 1
// refresh
allContents = getAllContents()
@@ -640,7 +648,7 @@
newSnack.name = "Synthetic [newSnack.name]"
custom_emote(2, "[pick("gibbers","drools","slobbers","claps wildly","spits")] as they vomit [newSnack] from their mouth!")
catch(var/exception/e)
- log_to_dd("Cooking error: [e] in [e.file]:[e.line]")
+ log_runtime(e, src, "Caught in SNPC cooking module")
doing &= ~SNPC_SPECIAL
// END COOKING MODULE
diff --git a/code/modules/mob/living/carbon/human/interactive/interactive.dm b/code/modules/mob/living/carbon/human/interactive/interactive.dm
index 9e4b77f055f..d3f8a66e7a0 100644
--- a/code/modules/mob/living/carbon/human/interactive/interactive.dm
+++ b/code/modules/mob/living/carbon/human/interactive/interactive.dm
@@ -320,7 +320,7 @@
if("Captain", "Head of Personnel")
favoured_types = list(/obj/item/clothing, /obj/item/weapon/stamp/captain,/obj/item/weapon/disk/nuclear)
if("Nanotrasen Representative")
- favoured_types = list(/obj/item/clothing, /obj/item/weapon/stamp/centcom, /obj/item/weapon/paper, /obj/item/weapon/melee/baton/loaded/ntcane)
+ favoured_types = list(/obj/item/clothing, /obj/item/weapon/stamp/centcom, /obj/item/weapon/paper, /obj/item/weapon/melee/classic_baton/ntcane)
functions += "paperwork"
if("Magistrate", "Internal Affairs Agent")
favoured_types = list(/obj/item/clothing, /obj/item/weapon/stamp/law, /obj/item/weapon/paper)
@@ -954,4 +954,4 @@
if(RPID)
RPID.registered_name = MYID.registered_name
RPID.name = MYID.name
- return 1
\ No newline at end of file
+ return 1
diff --git a/code/modules/mob/living/carbon/human/inventory.dm b/code/modules/mob/living/carbon/human/inventory.dm
index 8b7ed3a62df..0264e874d17 100644
--- a/code/modules/mob/living/carbon/human/inventory.dm
+++ b/code/modules/mob/living/carbon/human/inventory.dm
@@ -39,10 +39,10 @@
/mob/living/carbon/human/proc/equip_in_one_of_slots(obj/item/W, list/slots, del_on_fail = 1)
- for (var/slot in slots)
- if (equip_to_slot_if_possible(W, slots[slot], del_on_fail = 0))
+ for(var/slot in slots)
+ if(equip_to_slot_if_possible(W, slots[slot], del_on_fail = 0))
return slot
- if (del_on_fail)
+ if(del_on_fail)
qdel(W)
return null
@@ -107,15 +107,19 @@
if(slot_tie)
return 1
+// The actual dropping happens at the mob level - checks to prevent drops should
+// come here
+/mob/living/carbon/human/canUnEquip(obj/item/I, force)
+ . = ..()
+ var/obj/item/organ/O = I
+ if(istype(O) && O.owner == src)
+ . = 0 // keep a good grip on your heart
+
/mob/living/carbon/human/unEquip(obj/item/I)
. = ..() //See mob.dm for an explanation on this and some rage about people copypasting instead of calling ..() like they should.
if(!. || !I)
return
- var/obj/item/organ/internal/O = I //Organs shouldn't be removed unless you call droplimb.
- if(istype(O) && O.owner == src)
- return
-
if(I == wear_suit)
if(s_store)
unEquip(s_store, 1) //It makes no sense for your suit storage to stay on you if you drop your suit.
@@ -150,7 +154,7 @@
else if(I == r_ear)
r_ear = null
update_inv_ears()
- else if (I == l_ear)
+ else if(I == l_ear)
l_ear = null
update_inv_ears()
else if(I == shoes)
@@ -166,9 +170,8 @@
update_fhair()
update_head_accessory()
if(internal)
- if(internals)
- internals.icon_state = "internal0"
internal = null
+ update_internals_hud_icon(0)
sec_hud_set_ID()
update_inv_wear_mask()
else if(I == wear_id)
diff --git a/code/modules/mob/living/carbon/human/life.dm b/code/modules/mob/living/carbon/human/life.dm
index a41f787a49c..b2b71d60545 100644
--- a/code/modules/mob/living/carbon/human/life.dm
+++ b/code/modules/mob/living/carbon/human/life.dm
@@ -78,8 +78,8 @@
/mob/living/carbon/human/handle_disabilities()
- if (disabilities & EPILEPSY)
- if ((prob(1) && paralysis < 1))
+ if(disabilities & EPILEPSY)
+ if((prob(1) && paralysis < 1))
visible_message("[src] starts having a seizure!","You have a seizure!")
Paralyse(10)
Jitter(1000)
@@ -89,13 +89,13 @@
if(prob(1) && hallucination < 1)
hallucination += 20
- if (disabilities & COUGHING)
- if ((prob(5) && paralysis <= 1))
+ if(disabilities & COUGHING)
+ if((prob(5) && paralysis <= 1))
drop_item()
emote("cough")
- if (disabilities & TOURETTES)
+ if(disabilities & TOURETTES)
speech_problem_flag = 1
- if ((prob(10) && paralysis <= 1))
+ if((prob(10) && paralysis <= 1))
Stun(10)
switch(rand(1, 3))
if(1)
@@ -108,12 +108,12 @@
animate(src, pixel_x = pixel_x + x_offset, pixel_y = pixel_y + y_offset, time = 1)
animate(pixel_x = initial(pixel_x) , pixel_y = initial(pixel_y), time = 1)
- if (disabilities & NERVOUS)
+ if(disabilities & NERVOUS)
speech_problem_flag = 1
- if (prob(10))
+ if(prob(10))
stuttering = max(10, stuttering)
- if (getBrainLoss() >= 60 && stat != 2)
+ if(getBrainLoss() >= 60 && stat != 2)
speech_problem_flag = 1
if(prob(3))
var/list/s1 = list("IM A PONY NEEEEEEIIIIIIIIIGH",
@@ -174,13 +174,28 @@
if(!gene.block)
continue
if(gene.is_active(src))
- /* if (prob(10) && prob(gene.instability))
- adjustCloneLoss(1) */
speech_problem_flag = 1
gene.OnMobLife(src)
+ if(gene_stability < 85)
+ var/instability = DEFAULT_GENE_STABILITY - gene_stability
+ if(prob(instability / 10))
+ adjustFireLoss(min(6, instability / 12))
+ to_chat(src, "You feel like your skin is burning and bubbling off!")
+ if(gene_stability < 70)
+ if(prob(instability / 12))
+ adjustCloneLoss(min(5, instability / 15))
+ to_chat(src, "You feel as if your body is warping.")
+ if(prob(instability / 10))
+ adjustToxLoss(min(6, instability / 12))
+ to_chat(src, "You feel weak and nauseous.")
+ if(gene_stability < 40 && prob(1))
+ to_chat(src, "You feel incredibly sick... Something isn't right!")
+ spawn(300)
+ if(gene_stability < 40)
+ gib()
if(!(species.flags & RADIMMUNE))
- if (radiation)
+ if(radiation)
if(get_int_organ(/obj/item/organ/internal/nucleation/resonant_crystal))
var/rads = radiation/25
@@ -191,14 +206,14 @@
to_chat(src, "You feel relaxed.")
return
- if (radiation > 100)
+ if(radiation > 100)
radiation = 100
Weaken(10)
if(!lying)
to_chat(src, "You feel weak.")
emote("collapse")
- if (radiation < 0)
+ if(radiation < 0)
radiation = 0
else
@@ -313,7 +328,6 @@
/mob/living/carbon/human/get_breath_from_internal(volume_needed) //making this call the parent would be far too complicated
-
if(internal)
var/null_internals = 0 //internals are invalid, therefore turn them off
var/skip_contents_check = 0 //rigsuit snowflake, oxygen tanks aren't stored inside the mob, so the 'contents.Find' check has to be skipped.
@@ -338,12 +352,10 @@
if(internal) //check for hud updates every time this is called
- if(internals)
- internals.icon_state = "internal1"
+ update_internals_hud_icon(1)
return internal.remove_air_volume(volume_needed) //returns the valid air
else
- if(internals)
- internals.icon_state = "internal0"
+ update_internals_hud_icon(0)
return null
@@ -475,6 +487,16 @@
return
if(RESIST_HEAT in mutations)
return
+ var/thermal_protection = get_thermal_protection()
+
+ if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT)
+ return
+ if(thermal_protection >= FIRE_SUIT_MAX_TEMP_PROTECT)
+ bodytemperature += 11
+ else
+ bodytemperature += BODYTEMP_HEATING_MAX
+
+/mob/living/carbon/human/proc/get_thermal_protection()
var/thermal_protection = 0 //Simple check to estimate how protected we are against multiple temperatures
if(wear_suit)
if(wear_suit.max_heat_protection_temperature >= FIRE_SUIT_MAX_TEMP_PROTECT)
@@ -483,34 +505,9 @@
if(head.max_heat_protection_temperature >= FIRE_HELM_MAX_TEMP_PROTECT)
thermal_protection += (head.max_heat_protection_temperature*THERMAL_PROTECTION_HEAD)
thermal_protection = round(thermal_protection)
- if(thermal_protection >= FIRE_IMMUNITY_SUIT_MAX_TEMP_PROTECT)
- return
- if(thermal_protection >= FIRE_SUIT_MAX_TEMP_PROTECT)
- bodytemperature += 11
- return
- else
- bodytemperature += BODYTEMP_HEATING_MAX
- return
-//END FIRE CODE
+ return thermal_protection
- /*
-/mob/living/carbon/human/proc/adjust_body_temperature(current, loc_temp, boost)
- var/temperature = current
- var/difference = abs(current-loc_temp) //get difference
- var/increments// = difference/10 //find how many increments apart they are
- if(difference > 50)
- increments = difference/5
- else
- increments = difference/10
- var/change = increments*boost // Get the amount to change by (x per increment)
- var/temp_change
- if(current < loc_temp)
- temperature = min(loc_temp, temperature+change)
- else if(current > loc_temp)
- temperature = max(loc_temp, temperature-change)
- temp_change = (temperature - current)
- return temp_change
- */
+//END FIRE CODE
/mob/living/carbon/human/proc/stabilize_temperature_from_calories()
if(bodytemperature <= species.cold_level_1) //260.15 is 310.15 - 50, the temperature where you start to feel effects.
@@ -693,10 +690,10 @@
update_inv_wear_suit()
// nutrition decrease
- if (nutrition > 0 && stat != 2)
+ if(nutrition > 0 && stat != 2)
nutrition = max (0, nutrition - HUNGER_FACTOR)
- if (nutrition > 450)
+ if(nutrition > 450)
if(overeatduration < 800) //capped so people don't take forever to unfat
overeatduration++
@@ -707,10 +704,10 @@
else
overeatduration -= 2
- if (drowsyness)
+ if(drowsyness)
drowsyness--
eye_blurry = max(2, eye_blurry)
- if (prob(5))
+ if(prob(5))
sleeping += 1
Paralyse(5)
@@ -756,7 +753,7 @@
alcohol_strength *= 5
if(alcohol_strength >= slur_start) //slurring
- if (!slurring) slurring = 1
+ if(!slurring) slurring = 1
slurring = drunk
if(alcohol_strength >= brawl_start) //the drunken martial art
if(!istype(martial_art, /datum/martial_art/drunk_brawling))
@@ -766,7 +763,7 @@
if(istype(martial_art, /datum/martial_art/drunk_brawling))
martial_art.remove(src)
if(alcohol_strength >= confused_start && prob(33)) //confused walking
- if (!confused) confused = 1
+ if(!confused) confused = 1
confused = max(confused+(3/sober_str),0)
if(alcohol_strength >= blur_start) //blurry eyes
eye_blurry = max(eye_blurry, 10/sober_str)
@@ -778,7 +775,7 @@
if(alcohol_strength >= pass_out)
Paralyse(5 / sober_str)
drowsyness = max(drowsyness, 30/sober_str)
- if (L)
+ if(L)
L.take_damage(0.1, 1)
adjustToxLoss(0.1)
else //stuff only for synthetics
@@ -819,9 +816,6 @@
handle_organs()
handle_blood()
- //the analgesic effect wears off slowly
- analgesic = max(0, analgesic - 1)
-
if(paralysis)
blinded = 1
stat = UNCONSCIOUS
@@ -867,7 +861,7 @@
else
//blindness
- if(sdisabilities & BLIND) // Disabled-blind, doesn't get better on its own
+ if(disabilities & BLIND) // Disabled-blind, doesn't get better on its own
blinded = 1
else if(eye_blind) // Blindness, heals slowly over time
@@ -887,18 +881,18 @@
//Ears
- if(sdisabilities & DEAF) //disabled-deaf, doesn't get better on its own
- ear_deaf = max(ear_deaf, 1)
+ if(disabilities & DEAF) //disabled-deaf, doesn't get better on its own
+ setEarDamage(-1, max(ear_deaf, 1))
else if(ear_deaf) //deafness, heals slowly over time
- ear_deaf = max(ear_deaf - 1, 0)
+ adjustEarDamage(0,-1)
else if(istype(l_ear, /obj/item/clothing/ears/earmuffs) || istype(r_ear, /obj/item/clothing/ears/earmuffs)) //resting your ears with earmuffs heals ear damage faster
- ear_damage = max(ear_damage - 0.15, 0)
- ear_deaf = max(ear_deaf, 1)
+ adjustEarDamage(-0.15,0)
+ setEarDamage(-1, max(ear_deaf, 1))
else if(ear_damage < 25) //ear damage heals slowly under this threshold. otherwise you'll need earmuffs
- ear_damage = max(ear_damage - 0.05, 0)
+ adjustEarDamage(-0.05,0)
if(flying)
animate(src, pixel_y = pixel_y + 5 , time = 10, loop = 1, easing = SINE_EASING)
@@ -951,7 +945,7 @@
/mob/living/carbon/human/handle_random_events()
// Puke if toxloss is too high
if(!stat)
- if (getToxLoss() >= 45 && nutrition > 20)
+ if(getToxLoss() >= 45 && nutrition > 20)
lastpuke ++
if(lastpuke >= 25) // about 25 second delay I guess
Stun(5)
@@ -961,7 +955,7 @@
playsound(loc, 'sound/effects/splat.ogg', 50, 1)
var/turf/location = loc
- if (istype(location, /turf/simulated))
+ if(istype(location, /turf/simulated))
location.add_vomit_floor(src, 1)
nutrition -= 20
@@ -990,8 +984,10 @@
/mob/living/carbon/human/handle_shock()
..()
- if(status_flags & GODMODE) return 0 //godmode
- if(analgesic || (species && species.flags & NO_PAIN)) return // analgesic avoids all traumatic shock temporarily
+ if(status_flags & GODMODE)
+ return 0 //godmode
+ if(species && species.flags & NO_PAIN)
+ return
if(health <= config.health_threshold_softcrit)// health 0 makes you immediately collapse
shock_stage = max(shock_stage, 61)
@@ -1016,17 +1012,17 @@
if(shock_stage >=60)
if(shock_stage == 60) custom_emote(1,"falls limp.")
- if (prob(2))
+ if(prob(2))
to_chat(src, ""+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!"))
Weaken(20)
if(shock_stage >= 80)
- if (prob(5))
+ if(prob(5))
to_chat(src, ""+pick("The pain is excrutiating!", "Please, just end the pain!", "Your whole body is going numb!"))
Weaken(20)
if(shock_stage >= 120)
- if (prob(2))
+ if(prob(2))
to_chat(src, ""+pick("You black out!", "You feel like you could die any moment now.", "You're about to lose consciousness."))
Paralyse(5)
@@ -1040,9 +1036,11 @@
/mob/living/carbon/human/proc/handle_pulse()
- if(mob_master.current_cycle % 5) return pulse //update pulse every 5 life ticks (~1 tick/sec, depending on server load)
+ if(mob_master.current_cycle % 5)
+ return pulse //update pulse every 5 life ticks (~1 tick/sec, depending on server load)
- if(species && species.flags & NO_BLOOD) return PULSE_NONE //No blood, no pulse.
+ if(species && species.flags & NO_BLOOD)
+ return PULSE_NONE //No blood, no pulse.
if(stat == DEAD)
return PULSE_NONE //that's it, you're dead, nothing can influence your pulse
@@ -1052,32 +1050,29 @@
var/temp = PULSE_NORM
- if(round(vessel.get_reagent_amount("blood")) <= BLOOD_VOLUME_BAD) //how much blood do we have
+ var/blood_type = get_blood_name()
+ if(round(vessel.get_reagent_amount(blood_type)) <= BLOOD_VOLUME_BAD) //how much blood do we have
temp = PULSE_THREADY //not enough :(
if(status_flags & FAKEDEATH)
temp = PULSE_NONE //pretend that we're dead. unlike actual death, can be inflienced by meds
for(var/datum/reagent/R in reagents.reagent_list)
- if(R.id in bradycardics)
+ if(R.heart_rate_decrease)
if(temp <= PULSE_THREADY && temp >= PULSE_NORM)
temp--
- break //one reagent is enough
- //comment out the breaks to make med effects stack
- for(var/datum/reagent/R in reagents.reagent_list) //handles different chems' influence on pulse
- if(R.id in tachycardics)
+ break
+
+ for(var/datum/reagent/R in reagents.reagent_list)//handles different chems' influence on pulse
+ if(R.heart_rate_increase)
if(temp <= PULSE_FAST && temp >= PULSE_NONE)
temp++
break
+
for(var/datum/reagent/R in reagents.reagent_list) //To avoid using fakedeath
- if(R.id in heartstopper)
+ if(R.heart_rate_stop)
temp = PULSE_NONE
break
- for(var/datum/reagent/R in reagents.reagent_list) //Conditional heart-stoppage
- if(R.id in cheartstopper)
- if(R.volume >= R.overdose_threshold)
- temp = PULSE_NONE
- break
return temp
diff --git a/code/modules/mob/living/carbon/human/say.dm b/code/modules/mob/living/carbon/human/say.dm
index 840b500de01..72e6ff63314 100644
--- a/code/modules/mob/living/carbon/human/say.dm
+++ b/code/modules/mob/living/carbon/human/say.dm
@@ -38,8 +38,7 @@
say(temp)
winset(client, "input", "text=[null]")
-/mob/living/carbon/human/say_understands(var/mob/other,var/datum/language/speaking = null)
-
+/mob/living/carbon/human/say_understands(var/mob/other, var/datum/language/speaking = null)
if(has_brain_worms()) //Brain worms translate everything. Even mice and alien speak.
return 1
@@ -47,25 +46,19 @@
return 1
//These only pertain to common. Languages are handled by mob/say_understands()
- if (!speaking)
- if (istype(other, /mob/living/simple_animal/diona))
+ if(!speaking)
+ if(istype(other, /mob/living/simple_animal/diona))
if(other.languages.len >= 2) //They've sucked down some blood and can speak common now.
return 1
- if (istype(other, /mob/living/silicon))
+ if(issilicon(other))
return 1
- if (istype(other, /mob/living/simple_animal/bot))
+ if(isbot(other))
return 1
- if (istype(other, /mob/living/carbon/brain))
+ if(isbrain(other))
return 1
- if (istype(other, /mob/living/carbon/slime))
+ if(isslime(other))
return 1
- //This is already covered by mob/say_understands()
- //if (istype(other, /mob/living/simple_animal))
- // if((other.universal_speak && !speaking) || src.universal_speak || src.universal_understand)
- // return 1
- // return 0
-
return ..()
/mob/living/carbon/human/proc/HasVoiceChanger()
@@ -113,7 +106,7 @@
var/list/returns[3]
var/speech_problem_flag = 0
- if(silent || (sdisabilities & MUTE))
+ if(silent || (disabilities & MUTE))
message = ""
speech_problem_flag = 1
@@ -148,7 +141,7 @@
if(prob(braindam))
message = uppertext(message)
verb = "yells loudly"
-
+
if(locate(/obj/item/organ/internal/cyberimp/brain/clown_voice) in internal_organs)
message = "[message]"
@@ -166,57 +159,70 @@
used_radios += I
if("headset")
- if(l_ear && istype(l_ear,/obj/item/device/radio))
- var/obj/item/device/radio/R = l_ear
- R.talk_into(src,message,null,verb,speaking)
- used_radios += l_ear
- else if(r_ear && istype(r_ear,/obj/item/device/radio))
- var/obj/item/device/radio/R = r_ear
- R.talk_into(src,message,null,verb,speaking)
- used_radios += r_ear
+ var/obj/item/device/radio/R = null
+ if(isradio(l_ear))
+ R = l_ear
+ used_radios += R
+ if(R.talk_into(src, message, null, verb, speaking))
+ return
+
+ if(isradio(r_ear))
+ R = r_ear
+ used_radios += R
+ if(R.talk_into(src, message, null, verb, speaking))
+ return
if("right ear")
var/obj/item/device/radio/R
- var/has_radio = 0
- if(r_ear && istype(r_ear,/obj/item/device/radio))
+ if(isradio(r_ear))
R = r_ear
- has_radio = 1
- if(r_hand && istype(r_hand, /obj/item/device/radio))
+ else if(isradio(r_hand))
R = r_hand
- has_radio = 1
- if(has_radio)
- R.talk_into(src,message,null,verb,speaking)
+ if(R)
used_radios += R
-
+ R.talk_into(src, message, null, verb, speaking)
if("left ear")
var/obj/item/device/radio/R
- var/has_radio = 0
- if(l_ear && istype(l_ear,/obj/item/device/radio))
+ if(isradio(l_ear))
R = l_ear
- has_radio = 1
- if(l_hand && istype(l_hand,/obj/item/device/radio))
+ else if(isradio(l_hand))
R = l_hand
- has_radio = 1
- if(has_radio)
- R.talk_into(src,message,null,verb,speaking)
+ if(R)
used_radios += R
+ R.talk_into(src, message, null, verb, speaking)
if("whisper")
whisper_say(message, speaking, alt_name)
return 1
else
if(message_mode)
- if(l_ear && istype(l_ear,/obj/item/device/radio))
- l_ear.talk_into(src,message, message_mode, verb, speaking)
+ if(isradio(l_ear))
used_radios += l_ear
- else if(r_ear && istype(r_ear,/obj/item/device/radio))
- r_ear.talk_into(src,message, message_mode, verb, speaking)
+ if(l_ear.talk_into(src, message, message_mode, verb, speaking))
+ return
+
+ if(isradio(r_ear))
used_radios += r_ear
+ if(r_ear.talk_into(src, message, message_mode, verb, speaking))
+ return
/mob/living/carbon/human/handle_speech_sound()
var/list/returns[2]
if(species.speech_sounds && prob(species.speech_chance))
returns[1] = sound(pick(species.speech_sounds))
returns[2] = 50
- return returns
\ No newline at end of file
+ return returns
+
+/mob/living/carbon/human/binarycheck()
+ . = FALSE
+ var/obj/item/device/radio/headset/R
+ if(istype(l_ear, /obj/item/device/radio/headset))
+ R = l_ear
+ if(R.translate_binary)
+ . = TRUE
+
+ if(istype(r_ear, /obj/item/device/radio/headset))
+ R = r_ear
+ if(R.translate_binary)
+ . = TRUE
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/species/plasmaman.dm b/code/modules/mob/living/carbon/human/species/plasmaman.dm
index 003e1969d33..bae949dd9af 100644
--- a/code/modules/mob/living/carbon/human/species/plasmaman.dm
+++ b/code/modules/mob/living/carbon/human/species/plasmaman.dm
@@ -125,8 +125,7 @@
H.equip_or_collect(new/obj/item/weapon/tank/plasma/plasmaman(H), tank_slot) // Bigger plasma tank from Raggy.
to_chat(H, "You are now running on plasma internals from the [H.s_store] in your [tank_slot_name]. You must breathe plasma in order to survive, and are extremely flammable.")
H.internal = H.get_item_by_slot(tank_slot)
- if (H.internals)
- H.internals.icon_state = "internal1"
+ H.update_internals_hud_icon(1)
// Plasmamen are so fucking different that they need their own proc.
/datum/species/plasmaman/handle_breath(var/datum/gas_mixture/breath, var/mob/living/carbon/human/H)
diff --git a/code/modules/mob/living/carbon/human/species/shadow.dm b/code/modules/mob/living/carbon/human/species/shadow.dm
index 55701b52d1c..fa7dadfebcb 100644
--- a/code/modules/mob/living/carbon/human/species/shadow.dm
+++ b/code/modules/mob/living/carbon/human/species/shadow.dm
@@ -33,5 +33,5 @@
if(light_amount > 2) //if there's enough light, start dying
H.take_overall_damage(1,1)
- else if (light_amount < 2) //heal in the dark
+ else if(light_amount < 2) //heal in the dark
H.heal_overall_damage(1,1)
\ No newline at end of file
diff --git a/code/modules/mob/living/carbon/human/species/species.dm b/code/modules/mob/living/carbon/human/species/species.dm
index ad0d5b18c61..617d63c798b 100644
--- a/code/modules/mob/living/carbon/human/species/species.dm
+++ b/code/modules/mob/living/carbon/human/species/species.dm
@@ -42,7 +42,6 @@
var/heat_level_3_breathe = 1000 // Heat damage level 3 above this point; used for breathed air temperature
var/body_temperature = 310.15 //non-IS_SYNTHETIC species will try to stabilize at this temperature. (also affects temperature processing)
- var/passive_temp_gain = 0 //IS_SYNTHETIC species will gain this much temperature every second
var/reagent_tag //Used for metabolizing reagents.
var/siemens_coeff = 1 //base electrocution coefficient
@@ -393,7 +392,7 @@
return
/datum/species/proc/remove_abilities(var/mob/living/carbon/human/H)
- for (var/proc/ability in species_abilities)
+ for(var/proc/ability in species_abilities)
H.verbs -= ability
return
@@ -616,25 +615,22 @@
/datum/species/proc/handle_hud_icons(mob/living/carbon/human/H)
if(H.healths)
- if(H.analgesic)
- H.healths.icon_state = "health_health_numb"
+ if(H.stat == DEAD)
+ H.healths.icon_state = "health7"
else
- if(H.stat == DEAD)
- H.healths.icon_state = "health7"
- else
- switch(H.hal_screwyhud)
- if(1) H.healths.icon_state = "health6"
- if(2) H.healths.icon_state = "health7"
- if(5) H.healths.icon_state = "health0"
- else
- switch(100 - ((flags & NO_PAIN) ? 0 : H.traumatic_shock) - H.staminaloss)
- if(100 to INFINITY) H.healths.icon_state = "health0"
- if(80 to 100) H.healths.icon_state = "health1"
- if(60 to 80) H.healths.icon_state = "health2"
- if(40 to 60) H.healths.icon_state = "health3"
- if(20 to 40) H.healths.icon_state = "health4"
- if(0 to 20) H.healths.icon_state = "health5"
- else H.healths.icon_state = "health6"
+ switch(H.hal_screwyhud)
+ if(1) H.healths.icon_state = "health6"
+ if(2) H.healths.icon_state = "health7"
+ if(5) H.healths.icon_state = "health0"
+ else
+ switch(100 - ((flags & NO_PAIN) ? 0 : H.traumatic_shock) - H.staminaloss)
+ if(100 to INFINITY) H.healths.icon_state = "health0"
+ if(80 to 100) H.healths.icon_state = "health1"
+ if(60 to 80) H.healths.icon_state = "health2"
+ if(40 to 60) H.healths.icon_state = "health3"
+ if(20 to 40) H.healths.icon_state = "health4"
+ if(0 to 20) H.healths.icon_state = "health5"
+ else H.healths.icon_state = "health6"
if(H.healthdoll)
H.healthdoll.overlays.Cut()
diff --git a/code/modules/mob/living/carbon/human/species/station.dm b/code/modules/mob/living/carbon/human/species/station.dm
index 7f5daa824d5..6268652f828 100644
--- a/code/modules/mob/living/carbon/human/species/station.dm
+++ b/code/modules/mob/living/carbon/human/species/station.dm
@@ -81,11 +81,6 @@
/datum/species/unathi/handle_death(var/mob/living/carbon/human/H)
H.stop_tail_wagging(1)
-/datum/species/unathi/equip(var/mob/living/carbon/human/H)
- if(H.mind.assigned_role != "Clown")
- H.unEquip(H.shoes)
- H.equip_or_collect(new /obj/item/clothing/shoes/sandal(H), slot_shoes)
-
/datum/species/tajaran
name = "Tajaran"
name_plural = "Tajaran"
@@ -148,11 +143,6 @@
/datum/species/tajaran/handle_death(var/mob/living/carbon/human/H)
H.stop_tail_wagging(1)
-/datum/species/tajaran/equip(var/mob/living/carbon/human/H)
- if(H.mind.assigned_role != "Clown")
- H.unEquip(H.shoes)
- H.equip_or_collect(new /obj/item/clothing/shoes/sandal(H), slot_shoes)
-
/datum/species/vulpkanin
name = "Vulpkanin"
name_plural = "Vulpkanin"
@@ -364,8 +354,7 @@
H.equip_or_collect(new /obj/item/weapon/tank/emergency_oxygen/vox(H), slot_l_hand)
to_chat(H, "You are now running on nitrogen internals from the [H.l_hand] in your hand. Your species finds oxygen toxic, so you must breathe nitrogen only.")
H.internal = H.l_hand
- if (H.internals)
- H.internals.icon_state = "internal1"
+ H.update_internals_hud_icon(1)
/datum/species/vox/handle_post_spawn(var/mob/living/carbon/human/H)
updatespeciescolor(H)
@@ -692,7 +681,7 @@
icobase = 'icons/mob/human_races/r_grey.dmi'
deform = 'icons/mob/human_races/r_def_grey.dmi'
default_language = "Galactic Common"
- //language = "Grey" // Perhaps if they ever get a hivemind
+ language = "Psionic Communication"
unarmed_type = /datum/unarmed_attack/punch
darksight = 5 // BOOSTED from 2
eyes = "grey_eyes_s"
@@ -703,7 +692,7 @@
"lungs" = /obj/item/organ/internal/lungs,
"liver" = /obj/item/organ/internal/liver/grey,
"kidneys" = /obj/item/organ/internal/kidneys,
- "brain" = /obj/item/organ/internal/brain,
+ "brain" = /obj/item/organ/internal/brain/grey,
"appendix" = /obj/item/organ/internal/appendix,
"eyes" = /obj/item/organ/internal/eyes,
)
@@ -728,8 +717,6 @@
C.dna.SetSEState(REMOTETALKBLOCK,0,1)
C.mutations -= REMOTE_TALK
genemutcheck(C,REMOTETALKBLOCK,null,MUTCHK_FORCED)
- C.mutations.Add(GREY)
- C.update_mutations()
..()
/datum/species/diona
@@ -805,8 +792,7 @@
"is pulling themselves apart!")
/datum/species/diona/can_understand(var/mob/other)
- var/mob/living/simple_animal/diona/D = other
- if(istype(D))
+ if(istype(other, /mob/living/simple_animal/diona))
return 1
return 0
@@ -864,17 +850,6 @@
burn_mod = 2.5 // So they take 50% extra damage from brute/burn overall.
death_message = "gives one shrill beep before falling limp, their monitor flashing blue before completely shutting off..."
- cold_level_1 = 50
- cold_level_2 = -1
- cold_level_3 = -1
-
- heat_level_1 = 500 //gives them about 25 seconds in space before taking damage
- heat_level_2 = 540
- heat_level_3 = 600
- heat_level_3_breathe = 600
-
- passive_temp_gain = 10 //this should cause IPCs to stabilize at ~80 C in a 20 C environment.
-
flags = IS_WHITELISTED | NO_BREATHE | NO_SCAN | NO_BLOOD | NO_PAIN | NO_DNA | NO_POISON | RADIMMUNE | ALL_RPARTS
clothing_flags = HAS_UNDERWEAR | HAS_UNDERSHIRT | HAS_SOCKS
bodyflags = HAS_SKIN_COLOR | HAS_MARKINGS | HAS_HEAD_ACCESSORY
diff --git a/code/modules/mob/living/carbon/human/update_icons.dm b/code/modules/mob/living/carbon/human/update_icons.dm
index b1c53a86e7c..50270ed3f78 100644
--- a/code/modules/mob/living/carbon/human/update_icons.dm
+++ b/code/modules/mob/living/carbon/human/update_icons.dm
@@ -637,10 +637,10 @@ var/global/list/damage_icon_parts = list()
for( var/obj/item/thing in list(r_store, l_store, wear_id, wear_pda, belt) ) //
if(thing) //
unEquip(thing) //
- if (client) //
+ if(client) //
client.screen -= thing //
//
- if (thing) //
+ if(thing) //
thing.loc = loc //
thing.dropped(src) //
thing.layer = initial(thing.layer)
@@ -1269,13 +1269,17 @@ var/global/list/damage_icon_parts = list()
if(wear_suit)
if(wear_suit.icon_override)
var/icon_path = "[wear_suit.icon_override]"
- icon_path = "[copytext(icon_path, 1, findtext(icon_path, "/suit.dmi"))]/collar.dmi" //If this file doesn't exist, the end result is that COLLAR_LAYER will be unchanged (empty) so there won't be an issue.
- var/icon/icon_file = new(icon_path)
+ icon_path = "[copytext(icon_path, 1, findtext(icon_path, "/suit.dmi"))]/collar.dmi" //If this file doesn't exist, the end result is that COLLAR_LAYER will be unchanged (empty).
+ var/icon/icon_file
+ if(fexists(icon_path)) //Just ensuring the nonexistance of a file with the above path won't cause a runtime.
+ icon_file = new(icon_path)
standing = image("icon" = icon_file, "icon_state" = "[wear_suit.icon_state]")
else if(wear_suit.sprite_sheets && wear_suit.sprite_sheets[species.name])
var/icon_path = "[wear_suit.sprite_sheets[species.name]]"
- icon_path = "[copytext(icon_path, 1, findtext(icon_path, "/suit.dmi"))]/collar.dmi" //If this file doesn't exist, the end result is that COLLAR_LAYER will be unchanged (empty) so there won't be an issue.
- var/icon/icon_file = new(icon_path)
+ icon_path = "[copytext(icon_path, 1, findtext(icon_path, "/suit.dmi"))]/collar.dmi" //If this file doesn't exist, the end result is that COLLAR_LAYER will be unchanged (empty).
+ var/icon/icon_file
+ if(fexists(icon_path)) //Just ensuring the nonexistance of a file with the above path won't cause a runtime.
+ icon_file = new(icon_path)
standing = image("icon" = icon_file, "icon_state" = "[wear_suit.icon_state]")
else
if(wear_suit.icon_state in C.IconStates())
@@ -1290,7 +1294,7 @@ var/global/list/damage_icon_parts = list()
/mob/living/carbon/human/proc/generate_head_icon()
//gender no longer matters for the mouth, although there should probably be seperate base head icons.
// var/g = "m"
-// if (gender == FEMALE) g = "f"
+// if(gender == FEMALE) g = "f"
var/obj/item/organ/external/head/H = get_organ("head")
//base icons
var/icon/face_lying = new /icon('icons/mob/human_face.dmi',"bald_l")
diff --git a/code/modules/mob/living/carbon/life.dm b/code/modules/mob/living/carbon/life.dm
index c26508b1374..985047a8284 100644
--- a/code/modules/mob/living/carbon/life.dm
+++ b/code/modules/mob/living/carbon/life.dm
@@ -181,19 +181,17 @@
/mob/living/carbon/proc/get_breath_from_internal(volume_needed)
if(internal)
- if(!contents.Find(internal))
+ if(internal.loc != src)
internal = null
if(!wear_mask || !(wear_mask.flags & AIRTIGHT)) //not wearing mask or non-breath mask
if(!head || !(head.flags & AIRTIGHT)) //not wearing helmet or non-breath helmet
internal = null //turn off internals
if(internal)
- if(internals)
- internals.icon_state = "internal1"
+ update_internals_hud_icon(1)
return internal.remove_air_volume(volume_needed)
else
- if(internals)
- internals.icon_state = "internal0"
+ update_internals_hud_icon(0)
return
@@ -437,18 +435,12 @@
see_invisible = see_override
-/mob/living/carbon/handle_actions()
- ..()
- for(var/obj/item/I in internal_organs)
- give_action_button(I, 1)
-
-
/mob/living/carbon/handle_hud_icons()
return
/mob/living/carbon/handle_hud_icons_health()
if(healths)
- if (stat != DEAD)
+ if(stat != DEAD)
switch(health)
if(100 to INFINITY)
healths.icon_state = "health0"
diff --git a/code/modules/mob/living/carbon/shock.dm b/code/modules/mob/living/carbon/shock.dm
index 43195db4f11..0a86f2756cf 100644
--- a/code/modules/mob/living/carbon/shock.dm
+++ b/code/modules/mob/living/carbon/shock.dm
@@ -16,14 +16,12 @@
src.traumatic_shock -= R.shock_reduction // now you too can varedit cyanide to reduce shock by 1000 - Iamgoofball
if(src.slurring)
src.traumatic_shock -= 10
- if(src.analgesic)
- src.traumatic_shock = 0
// broken or ripped off organs will add quite a bit of pain
if(istype(src,/mob/living/carbon/human))
var/mob/living/carbon/human/M = src
for(var/obj/item/organ/external/organ in M.organs)
- if (!organ)
+ if(!organ)
continue
else if(organ.status & ORGAN_BROKEN || organ.open)
src.traumatic_shock += 15
diff --git a/code/modules/mob/living/carbon/slime/emote.dm b/code/modules/mob/living/carbon/slime/emote.dm
index 8c290dc6094..c77d5e24a65 100644
--- a/code/modules/mob/living/carbon/slime/emote.dm
+++ b/code/modules/mob/living/carbon/slime/emote.dm
@@ -1,5 +1,5 @@
/mob/living/carbon/slime/emote(var/act, var/m_type=1, var/message = null)
- if (findtext(act, "-", 1, null))
+ if(findtext(act, "-", 1, null))
var/t1 = findtext(act, "-", 1, null)
//param = copytext(act, t1 + 1, length(act) + 1)
act = copytext(act, 1, t1)
@@ -9,16 +9,16 @@
act = lowertext(act)
switch(act) //Alphabetical please
- if ("me")
+ if("me")
if(silent)
return
- if (src.client)
- if (client.prefs.muted & MUTE_IC)
+ if(src.client)
+ if(client.prefs.muted & MUTE_IC)
to_chat(src, "\red You cannot send IC messages (muted).")
return
- if (src.client.handle_spam_prevention(message,MUTE_IC))
+ if(src.client.handle_spam_prevention(message,MUTE_IC))
return
- if (stat)
+ if(stat)
return
if(!(message))
return
@@ -27,7 +27,7 @@
message = "The [src.name] bounces in place."
m_type = 1
- if ("custom")
+ if("custom")
return custom_emote(m_type, message)
if("jiggle")
@@ -58,13 +58,13 @@
message = "The [src.name] vibrates!"
m_type = 1
- if ("help") //This is an exception
+ if("help") //This is an exception
to_chat(src, "Help for slime emotes. You can use these emotes with say \"*emote\":\n\nbounce, custom, jiggle, light, moan, shiver, sway, twitch, vibrate")
else
to_chat(src, "\blue Unusable emote '[act]'. Say *help for a list.")
- if ((message && src.stat == 0))
- if (m_type & 1)
+ if((message && src.stat == 0))
+ if(m_type & 1)
for(var/mob/O in viewers(src, null))
O.show_message(message, m_type)
//Foreach goto(703)
diff --git a/code/modules/mob/living/carbon/slime/examine.dm b/code/modules/mob/living/carbon/slime/examine.dm
index 7deaa397cc4..4dd67695e2a 100644
--- a/code/modules/mob/living/carbon/slime/examine.dm
+++ b/code/modules/mob/living/carbon/slime/examine.dm
@@ -2,12 +2,12 @@
to_chat(user, "*---------*")
..(user)
var/msg = ""
- if (src.stat == DEAD)
+ if(src.stat == DEAD)
msg += "It is limp and unresponsive.\n"
else
- if (src.getBruteLoss())
+ if(src.getBruteLoss())
msg += ""
- if (src.getBruteLoss() < 40)
+ if(src.getBruteLoss() < 40)
msg += "It has some punctures in its flesh!"
else
msg += "It has severe punctures and tears in its flesh!"
diff --git a/code/modules/mob/living/carbon/slime/life.dm b/code/modules/mob/living/carbon/slime/life.dm
index 6dce9aba656..b51e0084ee3 100644
--- a/code/modules/mob/living/carbon/slime/life.dm
+++ b/code/modules/mob/living/carbon/slime/life.dm
@@ -9,7 +9,7 @@
if(..())
handle_nutrition()
handle_targets()
- if (!ckey)
+ if(!ckey)
handle_speech_and_mood()
/mob/living/carbon/slime/proc/AIprocess() // the master AI process
@@ -17,9 +17,9 @@
if(AIproc || stat == DEAD || client) return
var/hungry = 0
- if (nutrition < get_starve_nutrition())
+ if(nutrition < get_starve_nutrition())
hungry = 2
- else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
+ else if(nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
hungry = 1
AIproc = 1
@@ -183,19 +183,19 @@
adjustCloneLoss(-1)
adjustBruteLoss(-1)
- if (src.stat == DEAD)
+ if(src.stat == DEAD)
src.lying = 1
src.blinded = 1
else
- if (src.paralysis || src.stunned || src.weakened || (status_flags && FAKEDEATH)) //Stunned etc.
- if (src.stunned > 0)
+ if(src.paralysis || src.stunned || src.weakened || (status_flags && FAKEDEATH)) //Stunned etc.
+ if(src.stunned > 0)
AdjustStunned(-1)
src.stat = 0
- if (src.weakened > 0)
+ if(src.weakened > 0)
AdjustWeakened(-1)
src.lying = 0
src.stat = 0
- if (src.paralysis > 0)
+ if(src.paralysis > 0)
AdjustParalysis(-1)
src.blinded = 0
src.lying = 0
@@ -205,34 +205,34 @@
src.lying = 0
src.stat = 0
- if (src.stuttering) src.stuttering = 0
+ if(src.stuttering) src.stuttering = 0
- if (src.eye_blind)
+ if(src.eye_blind)
src.eye_blind = 0
src.blinded = 1
- if (src.ear_deaf > 0) src.ear_deaf = 0
- if (src.ear_damage < 25)
+ if(src.ear_deaf > 0) src.ear_deaf = 0
+ if(src.ear_damage < 25)
src.ear_damage = 0
src.density = !( src.lying )
- if (src.sdisabilities & BLIND)
+ if(src.disabilities & BLIND)
src.blinded = 1
- if (src.sdisabilities & DEAF)
+ if(src.disabilities & DEAF)
src.ear_deaf = 1
- if (src.eye_blurry > 0)
+ if(src.eye_blurry > 0)
src.eye_blurry = 0
- if (src.druggy > 0)
+ if(src.druggy > 0)
src.druggy = 0
return 1
/mob/living/carbon/slime/proc/handle_nutrition()
- if (prob(15))
+ if(prob(15))
nutrition -= 1 + is_adult
if(nutrition <= 0)
@@ -240,9 +240,10 @@
if(prob(75))
adjustToxLoss(rand(0,5))
- else if (nutrition >= get_grow_nutrition() && amount_grown < 10)
+ else if(nutrition >= get_grow_nutrition() && amount_grown < 10)
nutrition -= 20
amount_grown++
+ update_action_buttons_icon()
if(amount_grown >= 10 && !Victim && !Target && !ckey)
if(is_adult)
@@ -278,7 +279,7 @@
if(Target)
--target_patience
- if (target_patience <= 0 || SStun || Discipline || attacked) // Tired of chasing or something draws out attention
+ if(target_patience <= 0 || SStun || Discipline || attacked) // Tired of chasing or something draws out attention
target_patience = 0
Target = null
@@ -286,9 +287,9 @@
var/hungry = 0 // determines if the slime is hungry
- if (nutrition < get_starve_nutrition())
+ if(nutrition < get_starve_nutrition())
hungry = 2
- else if (nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
+ else if(nutrition < get_grow_nutrition() && prob(25) || nutrition < get_hunger_nutrition())
hungry = 1
if(hungry == 2 && !client) // if a slime is starving, it starts losing its friends
@@ -340,26 +341,26 @@
Target = C
break
- if (Target)
+ if(Target)
target_patience = rand(5,7)
- if (is_adult)
+ if(is_adult)
target_patience += 3
if(!Target) // If we have no target, we are wandering or following orders
- if (Leader)
- if (holding_still)
+ if(Leader)
+ if(holding_still)
holding_still = max(holding_still - 1, 0)
else if(canmove && isturf(loc))
step_to(src, Leader)
else if(hungry)
- if (holding_still)
+ if(holding_still)
holding_still = max(holding_still - hungry, 0)
else if(canmove && isturf(loc) && prob(50))
step(src, pick(cardinal))
else
- if (holding_still)
+ if(holding_still)
holding_still = max(holding_still - 1, 0)
else if(canmove && isturf(loc) && prob(33))
step(src, pick(cardinal))
@@ -370,85 +371,85 @@
/mob/living/carbon/slime/proc/handle_speech_and_mood()
//Mood starts here
var/newmood = ""
- if (rabid || attacked) newmood = "angry"
- else if (Target) newmood = "mischevous"
+ if(rabid || attacked) newmood = "angry"
+ else if(Target) newmood = "mischevous"
- if (!newmood)
- if (Discipline && prob(25))
+ if(!newmood)
+ if(Discipline && prob(25))
newmood = "pout"
- else if (prob(1))
+ else if(prob(1))
newmood = pick("sad", ":3", "pout")
- if ((mood == "sad" || mood == ":3" || mood == "pout") && !newmood)
- if (prob(75)) newmood = mood
+ if((mood == "sad" || mood == ":3" || mood == "pout") && !newmood)
+ if(prob(75)) newmood = mood
- if (newmood != mood) // This is so we don't redraw them every time
+ if(newmood != mood) // This is so we don't redraw them every time
mood = newmood
regenerate_icons()
//Speech understanding starts here
var/to_say
- if (speech_buffer.len > 0)
+ if(speech_buffer.len > 0)
var/who = speech_buffer[1] // Who said it?
var/phrase = speech_buffer[2] // What did they say?
- if ((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us
- if (findtext(phrase, "hello") || findtext(phrase, "hi"))
+ if((findtext(phrase, num2text(number)) || findtext(phrase, "slimes"))) // Talking to us
+ if(findtext(phrase, "hello") || findtext(phrase, "hi"))
to_say = pick("Hello...", "Hi...")
- else if (findtext(phrase, "follow"))
- if (Leader)
- if (Leader == who) // Already following him
+ else if(findtext(phrase, "follow"))
+ if(Leader)
+ if(Leader == who) // Already following him
to_say = pick("Yes...", "Lead...", "Following...")
- else if (Friends[who] > Friends[Leader]) // VIVA
+ else if(Friends[who] > Friends[Leader]) // VIVA
Leader = who
to_say = "Yes... I follow [who]..."
else
to_say = "No... I follow [Leader]..."
else
- if (Friends[who] > 2)
+ if(Friends[who] > 2)
Leader = who
to_say = "I follow..."
else // Not friendly enough
to_say = pick("No...", "I won't follow...")
- else if (findtext(phrase, "stop"))
- if (Victim) // We are asked to stop feeding
- if (Friends[who] > 4)
+ else if(findtext(phrase, "stop"))
+ if(Victim) // We are asked to stop feeding
+ if(Friends[who] > 4)
Victim = null
Target = null
- if (Friends[who] < 7)
+ if(Friends[who] < 7)
--Friends[who]
to_say = "Grrr..." // I'm angry but I do it
else
to_say = "Fine..."
- else if (Target) // We are asked to stop chasing
- if (Friends[who] > 3)
+ else if(Target) // We are asked to stop chasing
+ if(Friends[who] > 3)
Target = null
- if (Friends[who] < 6)
+ if(Friends[who] < 6)
--Friends[who]
to_say = "Grrr..." // I'm angry but I do it
else
to_say = "Fine..."
- else if (Leader) // We are asked to stop following
- if (Leader == who)
+ else if(Leader) // We are asked to stop following
+ if(Leader == who)
to_say = "Yes... I'll stay..."
Leader = null
else
- if (Friends[who] > Friends[Leader])
+ if(Friends[who] > Friends[Leader])
Leader = null
to_say = "Yes... I'll stop..."
else
to_say = "No... I'll keep following..."
- else if (findtext(phrase, "stay"))
- if (Leader)
- if (Leader == who)
+ else if(findtext(phrase, "stay"))
+ if(Leader)
+ if(Leader == who)
holding_still = Friends[who] * 10
to_say = "Yes... Staying..."
- else if (Friends[who] > Friends[Leader])
+ else if(Friends[who] > Friends[Leader])
holding_still = (Friends[who] - Friends[Leader]) * 10
to_say = "Yes... Staying..."
else
to_say = "No... I'll keep following..."
else
- if (Friends[who] > 2)
+ if(Friends[who] > 2)
holding_still = Friends[who] * 10
to_say = "Yes... Staying..."
else
@@ -456,7 +457,7 @@
speech_buffer = list()
//Speech starts here
- if (to_say)
+ if(to_say)
say (to_say)
else if(prob(1))
emote(pick("bounce","sway","light","vibrate","jiggle"))
@@ -465,83 +466,83 @@
var/slimes_near = -1 // Don't count myself
var/dead_slimes = 0
var/friends_near = list()
- for (var/mob/living/carbon/M in view(7,src))
- if (isslime(M))
+ for(var/mob/living/carbon/M in view(7,src))
+ if(isslime(M))
++slimes_near
- if (M.stat == DEAD)
+ if(M.stat == DEAD)
++dead_slimes
- if (M in Friends)
+ if(M in Friends)
t += 20
friends_near += M
- if (nutrition < get_hunger_nutrition()) t += 10
- if (nutrition < get_starve_nutrition()) t += 10
- if (prob(2) && prob(t))
+ if(nutrition < get_hunger_nutrition()) t += 10
+ if(nutrition < get_starve_nutrition()) t += 10
+ if(prob(2) && prob(t))
var/phrases = list()
- if (Target) phrases += "[Target]... looks tasty..."
- if (nutrition < get_starve_nutrition())
+ if(Target) phrases += "[Target]... looks tasty..."
+ if(nutrition < get_starve_nutrition())
phrases += "So... hungry..."
phrases += "Very... hungry..."
phrases += "Need... food..."
phrases += "Must... eat..."
- else if (nutrition < get_hunger_nutrition())
+ else if(nutrition < get_hunger_nutrition())
phrases += "Hungry..."
phrases += "Where is the food?"
phrases += "I want to eat..."
phrases += "Rawr..."
phrases += "Blop..."
phrases += "Blorble..."
- if (rabid || attacked)
+ if(rabid || attacked)
phrases += "Hrr..."
phrases += "Nhuu..."
phrases += "Unn..."
- if (mood == ":3")
+ if(mood == ":3")
phrases += "Purr..."
- if (attacked)
+ if(attacked)
phrases += "Grrr..."
- if (getToxLoss() > 30)
+ if(getToxLoss() > 30)
phrases += "Cold..."
- if (getToxLoss() > 60)
+ if(getToxLoss() > 60)
phrases += "So... cold..."
phrases += "Very... cold..."
- if (getToxLoss() > 90)
+ if(getToxLoss() > 90)
phrases += "..."
phrases += "C... c..."
- if (Victim)
+ if(Victim)
phrases += "Nom..."
phrases += "Tasty..."
- if (powerlevel > 3) phrases += "Bzzz..."
- if (powerlevel > 5) phrases += "Zap..."
- if (powerlevel > 8) phrases += "Zap... Bzz..."
- if (mood == "sad") phrases += "Bored..."
- if (slimes_near) phrases += "Brother..."
- if (slimes_near > 1) phrases += "Brothers..."
- if (dead_slimes) phrases += "What happened?"
- if (!slimes_near)
+ if(powerlevel > 3) phrases += "Bzzz..."
+ if(powerlevel > 5) phrases += "Zap..."
+ if(powerlevel > 8) phrases += "Zap... Bzz..."
+ if(mood == "sad") phrases += "Bored..."
+ if(slimes_near) phrases += "Brother..."
+ if(slimes_near > 1) phrases += "Brothers..."
+ if(dead_slimes) phrases += "What happened?"
+ if(!slimes_near)
phrases += "Lonely..."
- for (var/M in friends_near)
+ for(var/M in friends_near)
phrases += "[M]... friend..."
- if (nutrition < get_hunger_nutrition())
+ if(nutrition < get_hunger_nutrition())
phrases += "[M]... feed me..."
say (pick(phrases))
/mob/living/carbon/slime/proc/get_max_nutrition() // Can't go above it
- if (is_adult) return 1200
+ if(is_adult) return 1200
else return 1000
/mob/living/carbon/slime/proc/get_grow_nutrition() // Above it we grow, below it we can eat
- if (is_adult) return 1000
+ if(is_adult) return 1000
else return 800
/mob/living/carbon/slime/proc/get_hunger_nutrition() // Below it we will always eat
- if (is_adult) return 600
+ if(is_adult) return 600
else return 500
/mob/living/carbon/slime/proc/get_starve_nutrition() // Below it we will eat before everything else
- if (is_adult) return 300
+ if(is_adult) return 300
else return 200
/mob/living/carbon/slime/proc/will_hunt(var/hunger = -1) // Check for being stopped from feeding and chasing
- if (hunger == 2 || rabid || attacked) return 1
- if (Leader) return 0
- if (holding_still) return 0
+ if(hunger == 2 || rabid || attacked) return 1
+ if(Leader) return 0
+ if(holding_still) return 0
return 1
diff --git a/code/modules/mob/living/carbon/slime/say.dm b/code/modules/mob/living/carbon/slime/say.dm
index 50311ace49e..6d47231792b 100644
--- a/code/modules/mob/living/carbon/slime/say.dm
+++ b/code/modules/mob/living/carbon/slime/say.dm
@@ -2,27 +2,27 @@
var/verb = "telepathically chirps"
var/ending = copytext(text, length(text))
- if (ending == "?")
+ if(ending == "?")
verb = "telepathically asks"
- else if (ending == "!")
+ else if(ending == "!")
verb = "telepathically cries"
return verb
/mob/living/carbon/slime/say_understands(var/other)
- if (istype(other, /mob/living/carbon/slime))
+ if(istype(other, /mob/living/carbon/slime))
return 1
return ..()
/mob/living/carbon/slime/hear_say(var/message, var/verb = "says", var/datum/language/language = null, var/alt_name = "", var/italics = 0, var/mob/speaker = null, var/sound/speech_sound, var/sound_vol)
- if (speaker in Friends)
+ if(speaker in Friends)
speech_buffer = list()
speech_buffer.Add(speaker)
speech_buffer.Add(lowertext(html_decode(message)))
..()
/mob/living/carbon/slime/hear_radio(var/message, var/verb="says", var/datum/language/language=null, var/part_a, var/part_b, var/mob/speaker = null, var/hard_to_hear = 0, var/vname ="", var/atom/follow_target)
- if (speaker in Friends)
+ if(speaker in Friends)
speech_buffer = list()
speech_buffer.Add(speaker)
speech_buffer.Add(lowertext(html_decode(message)))
diff --git a/code/modules/mob/living/carbon/slime/slime.dm b/code/modules/mob/living/carbon/slime/slime.dm
index 9ed50676e75..634e9865e45 100644
--- a/code/modules/mob/living/carbon/slime/slime.dm
+++ b/code/modules/mob/living/carbon/slime/slime.dm
@@ -75,12 +75,12 @@
/mob/living/carbon/slime/regenerate_icons()
icon_state = "[colour] [is_adult ? "adult" : "baby"] slime"
overlays.len = 0
- if (mood)
+ if(mood)
overlays += image('icons/mob/slimes.dmi', icon_state = "aslime-[mood]")
..()
/mob/living/carbon/slime/movement_delay()
- if (bodytemperature >= 330.23) // 135 F
+ if(bodytemperature >= 330.23) // 135 F
return -1 // slimes become supercharged at high temperatures
var/tally = 0
@@ -88,7 +88,7 @@
var/health_deficiency = (100 - health)
if(health_deficiency >= 45) tally += (health_deficiency / 25)
- if (bodytemperature < 183.222)
+ if(bodytemperature < 183.222)
tally += (283.222 - bodytemperature) / 10 * 1.75
if(reagents)
@@ -104,7 +104,7 @@
return tally + config.slime_delay
/mob/living/carbon/slime/Bump(atom/movable/AM as mob|obj, yes)
- if ((!(yes) || now_pushing))
+ if((!(yes) || now_pushing))
return
now_pushing = 1
@@ -121,7 +121,7 @@
if(prob(probab))
if(istype(AM, /obj/structure/window) || istype(AM, /obj/structure/grille))
if(nutrition <= get_hunger_nutrition() && !Atkcool)
- if (is_adult || prob(5))
+ if(is_adult || prob(5))
AM.attack_slime(src)
spawn()
Atkcool = 1
@@ -143,13 +143,13 @@
now_pushing = 0
..()
- if (!istype(AM, /atom/movable))
+ if(!istype(AM, /atom/movable))
return
- if (!( now_pushing ))
+ if(!( now_pushing ))
now_pushing = 1
- if (!( AM.anchored ))
+ if(!( AM.anchored ))
var/t = get_dir(src, AM)
- if (istype(AM, /obj/structure/window))
+ if(istype(AM, /obj/structure/window))
if(AM:ini_dir == NORTHWEST || AM:ini_dir == NORTHEAST || AM:ini_dir == SOUTHWEST || AM:ini_dir == SOUTHEAST)
for(var/obj/structure/window/win in get_step(AM,t))
now_pushing = 0
@@ -169,7 +169,7 @@
else
stat(null, "Health: [round((health / 150) * 100)]%")
- if (client.statpanel == "Status")
+ if(client.statpanel == "Status")
stat(null, "Nutrition: [nutrition]/[get_max_nutrition()]")
if(amount_grown >= 10)
if(is_adult)
@@ -197,12 +197,12 @@
var/b_loss = null
var/f_loss = null
- switch (severity)
- if (1.0)
+ switch(severity)
+ if(1.0)
qdel(src)
return
- if (2.0)
+ if(2.0)
b_loss += 60
f_loss += 60
@@ -231,13 +231,13 @@
return
/mob/living/carbon/slime/attack_slime(mob/living/carbon/slime/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (Victim) return // can't attack while eating!
+ if(Victim) return // can't attack while eating!
- if (health > -100)
+ if(health > -100)
M.do_attack_animation(src)
visible_message(" The [M.name] has glomped [src]!", \
@@ -292,11 +292,11 @@
adjustBruteLoss(damage)
/mob/living/carbon/slime/attack_hand(mob/living/carbon/human/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
@@ -377,10 +377,10 @@
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
help_shake_act(M)
- if (I_GRAB)
+ if(I_GRAB)
grabbedby(M)
else
@@ -388,8 +388,8 @@
var/damage = rand(1, 9)
attacked += 10
- if (prob(90))
- if (HULK in M.mutations)
+ if(prob(90))
+ if(HULK in M.mutations)
damage += 15
if(Victim || Target)
Victim = null
@@ -418,25 +418,25 @@
/mob/living/carbon/slime/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
visible_message("[M] caresses [src] with its scythe like arm.")
- if (I_HARM)
+ if(I_HARM)
M.do_attack_animation(src)
- if (prob(95))
+ if(prob(95))
attacked += 10
playsound(loc, 'sound/weapons/slice.ogg', 25, 1, -1)
var/damage = rand(15, 30)
- if (damage >= 25)
+ if(damage >= 25)
damage = rand(20, 40)
visible_message("[M] has attacked [name]!", \
"[M] has attacked [name]!")
@@ -450,10 +450,10 @@
visible_message("[M] has attempted to lunge at [name]!", \
"[M] has attempted to lunge at [name]!")
- if (I_GRAB)
+ if(I_GRAB)
grabbedby(M)
- if (I_DISARM)
+ if(I_DISARM)
M.do_attack_animation(src)
playsound(loc, 'sound/weapons/pierce.ogg', 25, 1, -1)
var/damage = 5
@@ -499,7 +499,7 @@
if(S.next_step(user, src))
return 1
if(istype(W,/obj/item/stack/sheet/mineral/plasma)) //Lets you feed slimes plasma.
- if (user in Friends)
+ if(user in Friends)
++Friends[user]
else
Friends[user] = 1
@@ -580,8 +580,8 @@ mob/living/carbon/slime/var/temperature_resistance = T0C+75
/mob/living/carbon/slime/proc/apply_water()
adjustToxLoss(rand(15,20))
- if (!client)
- if (Target) // Like cats
+ if(!client)
+ if(Target) // Like cats
Target = null
++Discipline
return
diff --git a/code/modules/mob/living/carbon/superheroes.dm b/code/modules/mob/living/carbon/superheroes.dm
index ab12c584259..23233fd5e09 100644
--- a/code/modules/mob/living/carbon/superheroes.dm
+++ b/code/modules/mob/living/carbon/superheroes.dm
@@ -33,8 +33,9 @@
if(default_spells.len)
for(var/spell in default_spells)
var/obj/effect/proc_holder/spell/S = spell
- if(!S) return
- H.AddSpell(new S)
+ if(!S)
+ return
+ H.mind.AddSpell(new S(null))
/datum/superheroes/proc/assign_id(var/mob/living/carbon/human/H)
var/obj/item/weapon/card/id/syndicate/W = new(H)
diff --git a/code/modules/mob/living/damage_procs.dm b/code/modules/mob/living/damage_procs.dm
index 866c01c9702..921080c989a 100644
--- a/code/modules/mob/living/damage_procs.dm
+++ b/code/modules/mob/living/damage_procs.dm
@@ -8,7 +8,7 @@
Returns
standard 0 if fail
*/
-/mob/living/proc/apply_damage(var/damage = 0,var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/used_weapon = null, var/sharp = 0, var/edge = 0)
+/mob/living/proc/apply_damage(var/damage = 0, var/damagetype = BRUTE, var/def_zone = null, var/blocked = 0, var/sharp = 0, var/edge = 0, var/used_weapon = null)
blocked = (100-blocked)/100
if(!damage || (blocked <= 0)) return 0
switch(damagetype)
diff --git a/code/modules/mob/living/death.dm b/code/modules/mob/living/death.dm
index 14585f6ae21..e17d9af6250 100644
--- a/code/modules/mob/living/death.dm
+++ b/code/modules/mob/living/death.dm
@@ -2,4 +2,5 @@
blinded = max(blinded, 1)
clear_fullscreens()
+ update_action_buttons_icon()
..(gibbed)
\ No newline at end of file
diff --git a/code/modules/mob/living/life.dm b/code/modules/mob/living/life.dm
index 82f865621da..a151a062bce 100644
--- a/code/modules/mob/living/life.dm
+++ b/code/modules/mob/living/life.dm
@@ -49,9 +49,7 @@
handle_disabilities() // eye, ear, brain damages
handle_status_effects() //all special effects, stunned, weakened, jitteryness, hallucination, sleeping, etc
- handle_actions()
-
- update_canmove()
+ update_canmove(1) // set to 1 to not update icon action buttons; rip this argument out if Life is ever refactored to be non-stupid. -Fox
if(client)
//regular_hud_updates() //THIS DOESN'T FUCKING UPDATE SHIT
@@ -95,7 +93,7 @@
if(paralysis)
stat = UNCONSCIOUS
- else if (status_flags & FAKEDEATH)
+ else if(status_flags & FAKEDEATH)
stat = UNCONSCIOUS
else
@@ -176,7 +174,7 @@
/mob/living/proc/handle_disabilities()
//Eyes
- if(sdisabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own
+ if(disabilities & BLIND || stat) //blindness from disability or unconsciousness doesn't get better on its own
eye_blind = max(eye_blind, 1)
else if(eye_blind) //blindness, heals slowly over time
eye_blind = max(eye_blind-1,0)
@@ -197,7 +195,6 @@
handle_vision()
handle_hud_icons()
- update_action_buttons()
return 1
@@ -247,84 +244,6 @@
/mob/living/proc/handle_hud_icons_health()
return
-/mob/living/proc/handle_actions()
- //Pretty bad, i'd use picked/dropped instead but the parent calls in these are nonexistent
- for(var/datum/action/A in actions)
- if(A.CheckRemoval(src))
- A.Remove(src)
- for(var/obj/item/I in src)
- give_action_button(I, 1)
- return
-
-/mob/living/proc/give_action_button(var/obj/item/I, recursive = 0)
- if(I.action_button_name)
- if(!I.action)
- if(I.action_button_custom_type)
- I.action = new I.action_button_custom_type
- else
- I.action = new /datum/action/item_action
- I.action.name = I.action_button_name
- I.action.target = I
- I.action.Grant(src)
-
- if(recursive)
- for(var/obj/item/T in I)
- give_action_button(T, recursive - 1)
-
-/mob/living/update_action_buttons()
- if(!hud_used) return
- if(!client) return
-
- if(!hud_used.hud_shown)
- return
-
- client.screen -= hud_used.hide_actions_toggle
- for(var/datum/action/A in actions)
- if(A.button)
- client.screen -= A.button
-
- if(hud_used.action_buttons_hidden)
- if(!hud_used.hide_actions_toggle)
- hud_used.hide_actions_toggle = new(hud_used)
- hud_used.hide_actions_toggle.UpdateIcon()
-
- if(!hud_used.hide_actions_toggle.moved)
- hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(1)
- //hud_used.SetButtonCoords(hud_used.hide_actions_toggle,1)
-
- client.screen += hud_used.hide_actions_toggle
- return
-
- var/button_number = 0
- for(var/datum/action/A in actions)
- button_number++
- if(A.button == null)
- var/obj/screen/movable/action_button/N = new(hud_used)
- N.owner = A
- A.button = N
-
- var/obj/screen/movable/action_button/B = A.button
-
- B.UpdateIcon()
-
- B.name = A.UpdateName()
-
- client.screen += B
-
- if(!B.moved)
- B.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number)
- //hud_used.SetButtonCoords(B,button_number)
-
- if(button_number > 0)
- if(!hud_used.hide_actions_toggle)
- hud_used.hide_actions_toggle = new(hud_used)
- hud_used.hide_actions_toggle.InitialiseIcon(src)
- if(!hud_used.hide_actions_toggle.moved)
- hud_used.hide_actions_toggle.screen_loc = hud_used.ButtonNumberToScreenCoords(button_number+1)
- //hud_used.SetButtonCoords(hud_used.hide_actions_toggle,button_number+1)
- client.screen += hud_used.hide_actions_toggle
-
-
/mob/living/proc/process_nations()
if(client)
var/client/C = client
diff --git a/code/modules/mob/living/living.dm b/code/modules/mob/living/living.dm
index bd360456009..69a32f2c285 100644
--- a/code/modules/mob/living/living.dm
+++ b/code/modules/mob/living/living.dm
@@ -3,6 +3,9 @@
..()
return QDEL_HINT_HARDDEL_NOW
+/mob/living/proc/OpenCraftingMenu()
+ return
+
/mob/living/Stat()
. = ..()
if(. && get_rig_stats)
@@ -55,7 +58,7 @@
/mob/living/verb/succumb()
set hidden = 1
- if (InCritical())
+ if(InCritical())
attack_log += "[src] has ["succumbed to death"] with [round(health, 0.1)] points of health!"
adjustOxyLoss(health - config.health_threshold_dead)
updatehealth()
@@ -271,7 +274,7 @@
/mob/living/proc/get_organ_target()
var/mob/shooter = src
var/t = shooter:zone_sel.selecting
- if ((t in list( "eyes", "mouth" )))
+ if((t in list( "eyes", "mouth" )))
t = "head"
var/obj/item/organ/external/def_zone = ran_zone(t)
return def_zone
@@ -323,12 +326,12 @@
if(iscarbon(src))
var/mob/living/carbon/C = src
- if (C.handcuffed && !initial(C.handcuffed))
+ if(C.handcuffed && !initial(C.handcuffed))
C.unEquip(C.handcuffed)
C.handcuffed = initial(C.handcuffed)
C.update_handcuffed()
- if (C.legcuffed && !initial(C.legcuffed))
+ if(C.legcuffed && !initial(C.legcuffed))
C.unEquip(C.legcuffed)
C.legcuffed = initial(C.legcuffed)
C.update_inv_legcuffed()
@@ -343,7 +346,7 @@
dead_mob_list -= src
living_mob_list |= src
mob_list |= src
- ear_deaf = 0
+ setEarDamage(-1,0)
timeofdeath = 0
/mob/living/proc/rejuvenate()
@@ -370,13 +373,11 @@
hallucination = 0
nutrition = 400
bodytemperature = 310
- sdisabilities = 0
disabilities = 0
blinded = 0
eye_blind = 0
eye_blurry = 0
- ear_deaf = 0
- ear_damage = 0
+ setEarDamage(0,0)
heal_overall_damage(1000, 1000)
ExtinguishMob()
fire_stacks = 0
@@ -440,26 +441,26 @@
return
/mob/living/Move(atom/newloc, direct)
- if (buckled && buckled.loc != newloc) //not updating position
- if (!buckled.anchored)
+ if(buckled && buckled.loc != newloc) //not updating position
+ if(!buckled.anchored)
return buckled.Move(newloc, direct)
else
return 0
- if (restrained())
+ if(restrained())
stop_pulling()
var/t7 = 1
- if (restrained())
+ if(restrained())
for(var/mob/living/M in range(src, 1))
- if ((M.pulling == src && M.stat == 0 && !( M.restrained() )))
+ if((M.pulling == src && M.stat == 0 && !( M.restrained() )))
t7 = null
if(t7 && pulling && (get_dist(src, pulling) <= 1 || pulling.loc == loc))
var/turf/T = loc
. = ..()
- if (pulling && pulling.loc)
+ if(pulling && pulling.loc)
if(!( isturf(pulling.loc) ))
stop_pulling()
return
@@ -473,46 +474,46 @@
stop_pulling()
return
- if (!restrained())
+ if(!restrained())
var/diag = get_dir(src, pulling)
- if ((diag - 1) & diag)
+ if((diag - 1) & diag)
else
diag = null
- if ((get_dist(src, pulling) > 1 || diag))
- if (isliving(pulling))
+ if((get_dist(src, pulling) > 1 || diag))
+ if(isliving(pulling))
var/mob/living/M = pulling
var/ok = 1
- if (locate(/obj/item/weapon/grab, M.grabbed_by))
- if (prob(75))
+ if(locate(/obj/item/weapon/grab, M.grabbed_by))
+ if(prob(75))
var/obj/item/weapon/grab/G = pick(M.grabbed_by)
- if (istype(G, /obj/item/weapon/grab))
+ if(istype(G, /obj/item/weapon/grab))
for(var/mob/O in viewers(M, null))
O.show_message(text("\red [] has been pulled from []'s grip by []", G.affecting, G.assailant, src), 1)
//G = null
qdel(G)
else
ok = 0
- if (locate(/obj/item/weapon/grab, M.grabbed_by.len))
+ if(locate(/obj/item/weapon/grab, M.grabbed_by.len))
ok = 0
- if (ok)
+ if(ok)
var/atom/movable/t = M.pulling
M.stop_pulling()
- if (M.lying && (prob(M.getBruteLoss() / 6)))
+ if(M.lying && (prob(M.getBruteLoss() / 6)))
var/turf/location = M.loc
- if (istype(location, /turf/simulated))
+ if(istype(location, /turf/simulated))
location.add_blood(M)
pulling.Move(T, get_dir(pulling, T))
if(M)
M.start_pulling(t)
else
- if (pulling)
+ if(pulling)
pulling.Move(T, get_dir(pulling, T))
else
stop_pulling()
. = ..()
- if (s_active && !( s_active in contents ) && get_turf(s_active) != get_turf(src)) //check !( s_active in contents ) first so we hopefully don't have to call get_turf() so much.
+ if(s_active && !( s_active in contents ) && get_turf(s_active) != get_turf(src)) //check !( s_active in contents ) first so we hopefully don't have to call get_turf() so much.
s_active.close(src)
if(.) // did we actually move?
@@ -643,7 +644,7 @@
//called when the mob receives a bright flash
/mob/living/proc/flash_eyes(intensity = 1, override_blindness_check = 0, affect_silicon = 0, visual = 0, type = /obj/screen/fullscreen/flash)
- if(check_eye_prot() < intensity && (override_blindness_check || !(sdisabilities & BLIND)))
+ if(check_eye_prot() < intensity && (override_blindness_check || !(disabilities & BLIND)))
overlay_fullscreen("flash", type)
addtimer(src, "clear_fullscreen", 25, FALSE, "flash", 25)
return 1
@@ -834,6 +835,15 @@
/mob/living/proc/get_permeability_protection()
return 0
+/mob/living/proc/attempt_harvest(obj/item/I, mob/user)
+ if(stat == DEAD && !isnull(butcher_results)) //can we butcher it?
+ if(istype(I, /obj/item/weapon/kitchen/knife))
+ to_chat(user, "You begin to butcher [src]...")
+ playsound(loc, 'sound/weapons/slice.ogg', 50, 1, -1)
+ if(do_mob(user, src, 80))
+ harvest(user)
+ return 1
+
/mob/living/proc/harvest(mob/living/user)
if(qdeleted(src))
return
@@ -854,7 +864,7 @@
return tally
/mob/living/proc/can_use_guns(var/obj/item/weapon/gun/G)
- if (G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser())
+ if(G.trigger_guard != TRIGGER_GUARD_ALLOW_ALL && !IsAdvancedToolUser())
to_chat(src, "You don't have the dexterity to do this!")
return 0
return 1
diff --git a/code/modules/mob/living/living_defense.dm b/code/modules/mob/living/living_defense.dm
index cc50408148e..2049d5fd21d 100644
--- a/code/modules/mob/living/living_defense.dm
+++ b/code/modules/mob/living/living_defense.dm
@@ -43,7 +43,7 @@
var/armor = run_armor_check(def_zone, P.flag, armour_penetration = P.armour_penetration)
var/proj_sharp = is_sharp(P)
var/proj_edge = has_edge(P)
- if ((proj_sharp || proj_edge) && prob(getarmor(def_zone, P.flag)))
+ if((proj_sharp || proj_edge) && prob(getarmor(def_zone, P.flag)))
proj_sharp = 0
proj_edge = 0
@@ -62,49 +62,40 @@
//this proc handles being hit by a thrown atom
/mob/living/hitby(atom/movable/AM as mob|obj,var/speed = 5)//Standardization and logging -Sieve
- if(istype(AM,/obj/))
- var/obj/O = AM
+ if(istype(AM, /obj/item))
+ var/obj/item/I = AM
var/zone = ran_zone("chest", 65)//Hits a random part of the body, geared towards the chest
var/dtype = BRUTE
- if(istype(O,/obj/item/weapon))
- var/obj/item/weapon/W = O
+ if(istype(I, /obj/item/weapon))
+ var/obj/item/weapon/W = I
dtype = W.damtype
- if (W.hitsound && W.throwforce > 0)
+ if(W.hitsound && W.throwforce > 0)
playsound(loc, W.hitsound, 30, 1, -1)
//run to-hit check here
- var/throw_damage = O.throwforce*(speed/5)
+ var/throw_damage = I.throwforce*(speed/5)
- //var/miss_chance = 15
- //if (O.throw_source)
- //var/distance = get_dist(O.throw_source, loc)
- //miss_chance = min(15*(distance-2), 0)
- /*
- if (prob(miss_chance))
- visible_message("\blue \The [O] misses [src] narrowly!")
- return
- */
- src.visible_message("\red [src] has been hit by [O].")
- var/armor = run_armor_check(zone, "melee")
+ src.visible_message("\red [src] has been hit by [I].")
+ var/armor = run_armor_check(zone, "melee", "Your armor has protected your [parse_zone(zone)].", "Your armor has softened hit to your [parse_zone(zone)].", I.armour_penetration)
- apply_damage(throw_damage, dtype, zone, armor, is_sharp(O), has_edge(O), O)
+ apply_damage(throw_damage, dtype, zone, armor, is_sharp(I), has_edge(I), I)
- O.throwing = 0 //it hit, so stop moving
+ I.throwing = 0 //it hit, so stop moving
- if(ismob(O.thrower))
- var/mob/M = O.thrower
+ if(ismob(I.thrower))
+ var/mob/M = I.thrower
if(M)
- src.attack_log += text("\[[time_stamp()]\] Has been hit with a [O], thrown by [key_name(M)]")
- M.attack_log += text("\[[time_stamp()]\] Hit [key_name(src)] with a thrown [O]")
+ attack_log += text("\[[time_stamp()]\] Has been hit with a [I], thrown by [key_name(M)]")
+ M.attack_log += text("\[[time_stamp()]\] Hit [key_name(src)] with a thrown [I]")
if(!istype(src,/mob/living/simple_animal/mouse))
- msg_admin_attack("[key_name_admin(src)] was hit by a [O], thrown by [key_name_admin(M)]")
+ msg_admin_attack("[key_name_admin(src)] was hit by a [I], thrown by [key_name_admin(M)]")
// Begin BS12 momentum-transfer code.
- if(O.throw_source && speed >= 15)
- var/obj/item/weapon/W = O
+ if(I.throw_source && speed >= 15)
+ var/obj/item/weapon/W = I
var/momentum = speed/2
- var/dir = get_dir(O.throw_source, src)
+ var/dir = get_dir(I.throw_source, src)
visible_message("\red [src] staggers under the impact!","\red You stagger under the impact!")
src.throw_at(get_edge_target_turf(src,dir),1,momentum)
@@ -113,16 +104,16 @@
if(W.sharp) //Projectile is suitable for pinning.
//Handles embedding for non-humans and simple_animals.
- O.loc = src
- src.embedded += O
+ I.loc = src
+ embedded += I
var/turf/T = near_wall(dir,2)
if(T)
src.loc = T
- visible_message("[src] is pinned to the wall by [O]!","You are pinned to the wall by [O]!")
+ visible_message("[src] is pinned to the wall by [I]!","You are pinned to the wall by [I]!")
src.anchored = 1
- src.pinned += O
+ src.pinned += I
/mob/living/mech_melee_attack(obj/mecha/M)
if(M.occupant.a_intent == I_HARM)
diff --git a/code/modules/mob/living/living_defines.dm b/code/modules/mob/living/living_defines.dm
index ce73ae369c0..19dc6f99cd1 100644
--- a/code/modules/mob/living/living_defines.dm
+++ b/code/modules/mob/living/living_defines.dm
@@ -7,10 +7,10 @@
//Damage related vars, NOTE: THESE SHOULD ONLY BE MODIFIED BY PROCS
- var/bruteloss = 0.0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
- var/oxyloss = 0.0 //Oxygen depravation damage (no air in lungs)
- var/toxloss = 0.0 //Toxic damage caused by being poisoned or radiated
- var/fireloss = 0.0 //Burn damage caused by being way too hot, too cold or burnt.
+ var/bruteloss = 0 //Brutal damage caused by brute force (punching, being clubbed by a toolbox ect... this also accounts for pressure damage)
+ var/oxyloss = 0 //Oxygen depravation damage (no air in lungs)
+ var/toxloss = 0 //Toxic damage caused by being poisoned or radiated
+ var/fireloss = 0 //Burn damage caused by being way too hot, too cold or burnt.
var/cloneloss = 0 //Damage caused by being cloned or ejected from the cloner early. slimes also deal cloneloss damage to victims
var/brainloss = 0 //'Retardation' damage caused by someone hitting you in the head with a bible or being infected with brainrot.
var/staminaloss = 0 //Stamina damage, or exhaustion. You recover it slowly naturally, and are stunned if it gets too high. Holodeck and hallucinations deal this.
@@ -23,11 +23,6 @@
//Allows mobs to move through dense areas without restriction. For instance, in space or out of holder objects.
var/incorporeal_move = 0 //0 is off, 1 is normal, 2 is for ninjas.
- var/t_plasma = null
- var/t_oxygen = null
- var/t_sl_gas = null
- var/t_n2 = null
-
var/now_pushing = null
var/atom/movable/cameraFollow = null
@@ -36,9 +31,8 @@
var/fire_stacks = 0 //Tracks how many stacks of fire we have on, max is usually 20
var/update_slimes = 1
- var/specialsauce = 0 //Has this person consumed enough special sauce? IF so they're a ticking time bomb of death.
var/implanting = 0 //Used for the mind-slave implant
- var/silent = null //Can't talk. Value goes down every life proc.
+ var/silent = 0 //Can't talk. Value goes down every life proc. //NOTE TO FUTURE CODERS: DO NOT INITIALIZE NUMERICAL VARS AS NULL OR I WILL MURDER YOU.
var/floating = 0
var/nightvision = 0
@@ -49,9 +43,12 @@
var/list/icon/pipes_shown = list()
var/last_played_vent
- var/list/datum/action/actions = list()
var/step_count = 0
var/list/butcher_results = null
- var/list/surgeries = list() //a list of surgery datums. generally empty, they're added when the player wants them.
\ No newline at end of file
+ var/list/weather_immunities = list()
+
+ var/list/surgeries = list() //a list of surgery datums. generally empty, they're added when the player wants them.
+
+ var/gene_stability = DEFAULT_GENE_STABILITY
diff --git a/code/modules/mob/living/logout.dm b/code/modules/mob/living/logout.dm
index b79d822d80b..71e26e60858 100644
--- a/code/modules/mob/living/logout.dm
+++ b/code/modules/mob/living/logout.dm
@@ -1,6 +1,6 @@
/mob/living/Logout()
..()
- if (mind)
+ if(mind)
if(!key) //key and mind have become seperated. I believe this is for when a staff member aghosts.
mind.active = 0 //This is to stop say, a mind.transfer_to call on a corpse causing a ghost to re-enter its body.
//This causes instant sleep and tags a player as SSD. See life.dm for furthering SSD.
diff --git a/code/modules/mob/living/say.dm b/code/modules/mob/living/say.dm
index 86214e52136..dbcefec7365 100644
--- a/code/modules/mob/living/say.dm
+++ b/code/modules/mob/living/say.dm
@@ -29,7 +29,7 @@ var/list/department_radio_keys = list(
":U" = "Supply", "#U" = "Supply", ".U" = "Supply",
":Z" = "Service", "#Z" = "Service", ".Z" = "Service",
":P" = "AI Private", "#P" = "AI Private", ".P" = "AI Private",
- ":-" = "Special Ops", "#-" = "Special Ops", ".-" = "Special Ops"
+ ":-" = "Special Ops", "#-" = "Special Ops", ".-" = "Special Ops"
)
@@ -48,22 +48,7 @@ proc/get_radio_key_from_channel(var/channel)
return key
/mob/living/proc/binarycheck()
-
- if (istype(src, /mob/living/silicon/pai))
- return
-
- if (!ishuman(src))
- return
-
- var/mob/living/carbon/human/H = src
- if (H.l_ear || H.r_ear)
- var/obj/item/device/radio/headset/dongle
- if(istype(H.l_ear,/obj/item/device/radio/headset))
- dongle = H.l_ear
- else
- dongle = H.r_ear
- if(!istype(dongle)) return
- if(dongle.translate_binary) return 1
+ return FALSE
/mob/living/proc/get_default_language()
return default_language
@@ -94,10 +79,7 @@ proc/get_radio_key_from_channel(var/channel)
verb = "stammers"
speech_problem_flag = 1
- if(GREY in mutations)
- message = "[message]"
-
- else if(COMIC in mutations)
+ if(COMIC in mutations)
message = "[message]"
if(!IsVocal())
@@ -126,27 +108,27 @@ proc/get_radio_key_from_channel(var/channel)
/mob/living/say(var/message, var/datum/language/speaking = null, var/verb = "says", var/alt_name="")
if(client)
if(client.prefs.muted & MUTE_IC)
- to_chat(src, "\red You cannot speak in IC (Muted).")
+ to_chat(src, "You cannot speak in IC (Muted).")
return
message = trim_strip_html_properly(message)
if(stat)
- if(stat == 2)
+ if(stat == DEAD)
return say_dead(message)
return
var/message_mode = parse_message_mode(message, "headset")
- if(copytext(message,1,2) == "*")
- return emote(copytext(message,2))
+ if(copytext(message, 1, 2) == "*")
+ return emote(copytext(message, 2))
//parse the radio code and consume it
- if (message_mode)
- if (message_mode == "headset")
- message = copytext(message,2) //it would be really nice if the parse procs could do this for us.
+ if(message_mode)
+ if(message_mode == "headset")
+ message = copytext(message, 2) //it would be really nice if the parse procs could do this for us.
else
- message = copytext(message,3)
+ message = copytext(message, 3)
message = trim_left(message)
@@ -187,7 +169,7 @@ proc/get_radio_key_from_channel(var/channel)
if(!message || message == "")
return 0
- var/list/obj/item/used_radios = new
+ var/list/used_radios = list()
if(handle_message_mode(message_mode, message, verb, speaking, used_radios, alt_name))
return 1
@@ -207,21 +189,24 @@ proc/get_radio_key_from_channel(var/channel)
var/msg
if(!speaking || !(speaking.flags & NO_TALK_MSG))
msg = "\The [src] talks into \the [used_radios[1]]"
- for(var/mob/living/M in hearers(5, src))
- if((M != src) && msg)
+
+ if(msg)
+ for(var/mob/living/M in hearers(5, src) - src)
M.show_message(msg)
- if (speech_sound)
- sound_vol *= 0.5
+
+ if(speech_sound)
+ sound_vol *= 0.5
+
var/turf/T = get_turf(src)
//handle nonverbal and sign languages here
- if (speaking)
- if (speaking.flags & NONVERBAL)
- if (prob(30))
- src.custom_emote(1, "[pick(speaking.signlang_verb)].")
+ if(speaking)
+ if(speaking.flags & NONVERBAL)
+ if(prob(30))
+ custom_emote(1, "[pick(speaking.signlang_verb)].")
- if (speaking.flags & SIGNLANG)
+ if(speaking.flags & SIGNLANG)
return say_signlang(message, pick(speaking.signlang_verb), speaking)
var/list/listening = list()
@@ -230,11 +215,11 @@ proc/get_radio_key_from_channel(var/channel)
if(T)
//make sure the air can transmit speech - speaker's side
var/datum/gas_mixture/environment = T.return_air()
- var/pressure = (environment)? environment.return_pressure() : 0
+ var/pressure = environment ? environment.return_pressure() : 0
if(pressure < SOUND_MINIMUM_PRESSURE)
message_range = 1
- if (pressure < ONE_ATMOSPHERE*0.4) //sound distortion pressure, to help clue people in that the air is thin, even if it isn't a vacuum yet
+ if(pressure < ONE_ATMOSPHERE * 0.4) //sound distortion pressure, to help clue people in that the air is thin, even if it isn't a vacuum yet
italics = 1
sound_vol *= 0.5 //muffle the sound a bit, so it's like we're actually talking through contact
@@ -242,26 +227,26 @@ proc/get_radio_key_from_channel(var/channel)
var/list/hearturfs = list()
for(var/I in hear)
- if(istype(I, /mob/))
+ if(ismob(I))
var/mob/M = I
listening += M
- hearturfs += M.locs[1]
+ hearturfs += get_turf(M)
for(var/obj/O in M.contents)
listening_obj |= O
- else if(istype(I, /obj/))
+ if(isobj(I))
var/obj/O = I
- hearturfs += O.locs[1]
+ hearturfs += get_turf(O)
listening_obj |= O
for(var/mob/M in player_list)
- if (!M.client)
+ if(!M.client)
continue //skip monkeys and leavers
- if (istype(M, /mob/new_player))
+ if(isnewplayer(M))
continue
- if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTEARS) && src.client) // src.client is so that ghosts don't have to listen to mice
+ if(M.stat == DEAD && M.client && (M.client.prefs.toggles & CHAT_GHOSTEARS) && client) // client is so that ghosts don't have to listen to mice
listening |= M
continue
- if(M.loc && M.locs[1] in hearturfs)
+ if(get_turf(M) in hearturfs)
listening |= M
var/list/speech_bubble_recipients = list()
@@ -287,7 +272,7 @@ proc/get_radio_key_from_channel(var/channel)
return 1
/mob/living/proc/say_signlang(var/message, var/verb="gestures", var/datum/language/language)
- for (var/mob/O in viewers(src, null))
+ for(var/mob/O in viewers(src, null))
O.hear_signlang(message, verb, language, src)
return 1
@@ -357,7 +342,7 @@ proc/get_radio_key_from_channel(var/channel)
return
if(stat)
- if(stat == 2)
+ if(stat == DEAD)
return say_dead(message)
return
@@ -383,7 +368,7 @@ proc/get_radio_key_from_channel(var/channel)
verb = "[speaking.speech_verb] [adverb]"
not_heard = "[speaking.speech_verb] something [adverb]"
else
- not_heard = "[verb] something" //TODO get rid of the null language and just prevent speech if language is null
+ not_heard = "[verb] something"
message = trim(message)
@@ -394,11 +379,12 @@ proc/get_radio_key_from_channel(var/channel)
speech_problem_flag = handle_s[3]
if(verb == "yells loudly")
verb = "slurs emphatically"
+
else if(speech_problem_flag)
var/adverb = pick("quietly", "softly")
verb = "[verb] [adverb]"
- if(!message || message=="")
+ if(!message)
return
var/atom/whisper_loc = get_whisper_loc()
@@ -415,7 +401,7 @@ proc/get_radio_key_from_channel(var/channel)
//Pass whispers on to anything inside the immediate listeners.
for(var/mob/L in listening)
for(var/mob/C in L.contents)
- if(istype(C,/mob/living))
+ if(isliving(C))
listening += C
//pass on the message to objects that can hear us.
@@ -455,11 +441,11 @@ proc/get_radio_key_from_channel(var/channel)
flick_overlay(I, speech_bubble_recipients, 30)
if(watching.len)
- var/rendered = "[src.name] [not_heard]."
- for (var/mob/M in watching)
+ var/rendered = "[name] [not_heard]."
+ for(var/mob/M in watching)
M.show_message(rendered, 2)
- log_whisper("[src.name]/[src.key] : [message]")
+ log_whisper("[name]/[key] : [message]")
return 1
/mob/living/speech_bubble(var/bubble_state = "",var/bubble_loc = src, var/list/bubble_recipients = list())
diff --git a/code/modules/mob/living/silicon/ai/ai.dm b/code/modules/mob/living/silicon/ai/ai.dm
index 812d2e8df58..842b03c4bbd 100644
--- a/code/modules/mob/living/silicon/ai/ai.dm
+++ b/code/modules/mob/living/silicon/ai/ai.dm
@@ -26,10 +26,10 @@ var/list/ai_verbs_default = list(
//Not sure why this is necessary...
/proc/AutoUpdateAI(obj/subject)
var/is_in_use = 0
- if (subject!=null)
+ if(subject!=null)
for(var/A in ai_list)
var/mob/living/silicon/ai/M = A
- if ((M.client && M.machine == subject))
+ if((M.client && M.machine == subject))
is_in_use = 1
subject.attack_ai(M)
return is_in_use
@@ -54,6 +54,7 @@ var/list/ai_verbs_default = list(
var/obj/item/device/pda/silicon/ai/aiPDA = null
var/obj/item/device/multitool/aiMulti = null
var/custom_sprite = 0 //For our custom sprites
+ var/custom_hologram = 0 //For our custom holograms
var/obj/item/device/radio/headset/heads/ai_integrated/aiRadio = null
@@ -121,8 +122,8 @@ var/list/ai_verbs_default = list(
var/pickedName = null
while(!pickedName)
pickedName = pick(ai_names)
- for (var/mob/living/silicon/ai/A in mob_list)
- if (A.real_name == pickedName && possibleNames.len > 1) //fixing the theoretically possible infinite loop
+ for(var/mob/living/silicon/ai/A in mob_list)
+ if(A.real_name == pickedName && possibleNames.len > 1) //fixing the theoretically possible infinite loop
possibleNames -= pickedName
pickedName = null
@@ -138,7 +139,7 @@ var/list/ai_verbs_default = list(
proc_holder_list = new()
if(L)
- if (istype(L, /datum/ai_laws))
+ if(istype(L, /datum/ai_laws))
laws = L
else
make_laws()
@@ -154,7 +155,7 @@ var/list/ai_verbs_default = list(
aiCamera = new/obj/item/device/camera/siliconcam/ai_camera(src)
- if (istype(loc, /turf))
+ if(istype(loc, /turf))
add_ai_verbs(src)
//Languages
@@ -176,12 +177,12 @@ var/list/ai_verbs_default = list(
add_language("Clownish", 0)
if(!safety)//Only used by AIize() to successfully spawn an AI.
- if (!B)//If there is no player/brain inside.
+ if(!B)//If there is no player/brain inside.
new/obj/structure/AIcore/deactivated(loc)//New empty terminal.
qdel(src)//Delete AI.
return
else
- if (B.brainmob.mind)
+ if(B.brainmob.mind)
B.brainmob.mind.transfer_to(src)
on_mob_init()
@@ -219,7 +220,7 @@ var/list/ai_verbs_default = list(
to_chat(src, radio_text)
- if (!(ticker && ticker.mode && (mind in ticker.mode.malf_ai)))
+ if(!(ticker && ticker.mode && (mind in ticker.mode.malf_ai)))
show_laws()
to_chat(src, "These laws may be changed by other players, or by you being the traitor.")
@@ -298,18 +299,19 @@ var/list/ai_verbs_default = list(
Entry[i] = trim(Entry[i])
if(Entry.len < 2)
- continue;
+ continue
- if(Entry[1] == src.ckey && Entry[2] == src.real_name)
+ if(Entry.len < 3 && Entry[1] == ckey && Entry[2] == real_name)
custom_sprite = 1 //They're in the list? Custom sprite time
icon = 'icons/mob/custom-synthetic.dmi'
+
//if(icon_state == initial(icon_state))
var/icontype = ""
- if (custom_sprite == 1) icontype = ("Custom")//automagically selects custom sprite if one is available
+ if(custom_sprite == 1) icontype = ("Custom")//automagically selects custom sprite if one is available
else icontype = input("Select an icon!", "AI", null, null) in list("Monochrome", "Blue", "Clown", "Inverted", "Text", "Smiley", "Angry", "Dorf", "Matrix", "Bliss", "Firewall", "Green", "Red", "Static", "Triumvirate", "Triumvirate Static", "Red October", "Sparkles", "ANIMA", "President", "NT")
switch(icontype)
- if("Custom") icon_state = "[src.ckey]-ai"
+ if("Custom") icon_state = "[ckey]-ai"
if("Clown") icon_state = "ai-clown2"
if("Monochrome") icon_state = "ai-mono"
if("Inverted") icon_state = "ai-u"
@@ -340,9 +342,9 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/show_malf_ai()
if(ticker.mode.name == "AI malfunction")
var/datum/game_mode/malfunction/malf = ticker.mode
- for (var/datum/mind/malfai in malf.malf_ai)
- if (mind == malfai) // are we the evil one?
- if (malf.apcs >= 3)
+ for(var/datum/mind/malfai in malf.malf_ai)
+ if(mind == malfai) // are we the evil one?
+ if(malf.apcs >= 3)
stat(null, "Time until station control secured: [max(malf.AI_win_timeleft/(malf.apcs/3), 0)] seconds")
// this verb lets the ai see the stations manifest
@@ -436,13 +438,13 @@ var/list/ai_verbs_default = list(
ai_announcement()
/mob/living/silicon/ai/check_eye(var/mob/user as mob)
- if (!current)
+ if(!current)
return null
user.reset_view(current)
return 1
/mob/living/silicon/ai/blob_act()
- if (stat != 2)
+ if(stat != 2)
adjustBruteLoss(60)
updatehealth()
return 1
@@ -452,7 +454,7 @@ var/list/ai_verbs_default = list(
return 0
/mob/living/silicon/ai/emp_act(severity)
- if (prob(30))
+ if(prob(30))
switch(pick(1,2))
if(1)
view_core()
@@ -467,11 +469,11 @@ var/list/ai_verbs_default = list(
if(1.0)
gib()
if(2.0)
- if (stat != 2)
+ if(stat != 2)
adjustBruteLoss(60)
adjustFireLoss(60)
if(3.0)
- if (stat != 2)
+ if(stat != 2)
adjustBruteLoss(30)
return
@@ -481,21 +483,21 @@ var/list/ai_verbs_default = list(
if(usr != src)
return
..()
- if (href_list["mach_close"])
- if (href_list["mach_close"] == "aialerts")
+ if(href_list["mach_close"])
+ if(href_list["mach_close"] == "aialerts")
viewalerts = 0
var/t1 = text("window=[]", href_list["mach_close"])
unset_machine()
src << browse(null, t1)
- if (href_list["switchcamera"])
+ if(href_list["switchcamera"])
switchCamera(locate(href_list["switchcamera"])) in cameranet.cameras
- if (href_list["showalerts"])
+ if(href_list["showalerts"])
subsystem_alarm_monitor()
if(href_list["show_paper"])
if(last_paper_seen)
src << browse(last_paper_seen, "window=show_paper")
//Carn: holopad requests
- if (href_list["jumptoholopad"])
+ if(href_list["jumptoholopad"])
var/obj/machinery/hologram/holopad/H = locate(href_list["jumptoholopad"])
if(stat == CONSCIOUS)
if(H)
@@ -507,7 +509,7 @@ var/list/ai_verbs_default = list(
play_vox_word(href_list["say_word"], null, src)
return
- if (href_list["track"])
+ if(href_list["track"])
var/mob/living/target = locate(href_list["track"]) in mob_list
if(target && target.can_track())
ai_actual_track(target)
@@ -515,7 +517,7 @@ var/list/ai_verbs_default = list(
to_chat(src, "Target is not on or near any active cameras on the station.")
return
- if (href_list["trackbot"])
+ if(href_list["trackbot"])
var/mob/living/simple_animal/bot/target = locate(href_list["trackbot"]) in simple_animal_list
if(target)
ai_actual_track(target)
@@ -523,7 +525,7 @@ var/list/ai_verbs_default = list(
to_chat(src, "Target is not on or near any active cameras on the station.")
return
- if (href_list["callbot"]) //Command a bot to move to a selected location.
+ if(href_list["callbot"]) //Command a bot to move to a selected location.
Bot = locate(href_list["callbot"]) in simple_animal_list
if(!Bot || Bot.remote_disabled || src.control_disabled)
return //True if there is no bot found, the bot is manually emagged, or the AI is carded with wireless off.
@@ -531,17 +533,17 @@ var/list/ai_verbs_default = list(
to_chat(src, "Set your waypoint by clicking on a valid location free of obstructions.")
return
- if (href_list["interface"]) //Remotely connect to a bot!
+ if(href_list["interface"]) //Remotely connect to a bot!
Bot = locate(href_list["interface"]) in simple_animal_list
if(!Bot || Bot.remote_disabled || src.control_disabled)
return
Bot.attack_ai(src)
- if (href_list["botrefresh"]) //Refreshes the bot control panel.
+ if(href_list["botrefresh"]) //Refreshes the bot control panel.
botcall()
return
- if (href_list["ai_take_control"]) //Mech domination
+ if(href_list["ai_take_control"]) //Mech domination
var/obj/mecha/M = locate(href_list["ai_take_control"])
if(controlled_mech)
to_chat(src, "You are already loaded into an onboard computer!")
@@ -549,17 +551,17 @@ var/list/ai_verbs_default = list(
if(M)
M.transfer_ai(AI_MECH_HACK,src, usr) //Called om the mech itself.
- else if (href_list["faketrack"])
+ else if(href_list["faketrack"])
var/mob/target = locate(href_list["track"]) in mob_list
var/mob/living/silicon/ai/A = locate(href_list["track2"]) in mob_list
if(A && target)
A.cameraFollow = target
to_chat(A, "Now tracking [target.name] on camera.")
- if (usr.machine == null)
+ if(usr.machine == null)
usr.machine = usr
- while (src.cameraFollow == target)
+ while(src.cameraFollow == target)
to_chat(usr, "Target is not on or near any active cameras on the station. We'll check again in 5 seconds (unless you use the cancel-camera verb).")
sleep(40)
continue
@@ -575,23 +577,23 @@ var/list/ai_verbs_default = list(
/mob/living/silicon/ai/attack_alien(mob/living/carbon/alien/humanoid/M as mob)
- if (!ticker)
+ if(!ticker)
to_chat(M, "You cannot attack people before the game has started.")
return
- if (istype(loc, /turf) && istype(loc.loc, /area/start))
+ if(istype(loc, /turf) && istype(loc.loc, /area/start))
to_chat(M, "No attacking people at spawn, you jackass.")
return
switch(M.a_intent)
- if (I_HELP)
+ if(I_HELP)
visible_message("[M] caresses [src]'s plating with its scythe like arm.")
else //harm
M.do_attack_animation(src)
var/damage = rand(10, 20)
- if (prob(90))
+ if(prob(90))
playsound(loc, 'sound/weapons/slash.ogg', 25, 1, -1)
visible_message("[M] has slashed at [src]!",\
"[M] has slashed at [src]!")
@@ -644,7 +646,7 @@ var/list/ai_verbs_default = list(
d += "Query network status "
d += "
Name
Status
Location
Control
"
- for (var/mob/living/simple_animal/bot/Bot in simple_animal_list)
+ for(var/mob/living/simple_animal/bot/Bot in simple_animal_list)
if((Bot.z in ai_allowed_Zlevel) && !Bot.remote_disabled) //Only non-emagged bots on the allowed Z-level are detected!
bot_area = get_area(Bot)
d += "