mirror of
https://github.com/Bubberstation/Bubberstation.git
synced 2026-07-13 17:14:47 +01:00
[MIRROR] Replacing magic numbers with defines in robot code (#2801)
* Replacing magic numbers with defines in robot code (#56241) While scouring robot code for some (hopefully upcoming) fixes, I found a bunch of gross numbers. These numbers are now letters. * Replacing magic numbers with defines in robot code Co-authored-by: dragomagol <66640614+dragomagol@users.noreply.github.com>
This commit is contained in:
@@ -56,11 +56,11 @@
|
||||
hud_used.toggle_show_robot_modules()
|
||||
storage_was_closed = TRUE
|
||||
switch(module_num)
|
||||
if(1)
|
||||
if(BORG_CHOOSE_MODULE_ONE)
|
||||
item_module.screen_loc = inv1.screen_loc
|
||||
if(2)
|
||||
if(BORG_CHOOSE_MODULE_TWO)
|
||||
item_module.screen_loc = inv2.screen_loc
|
||||
if(3)
|
||||
if(BORG_CHOOSE_MODULE_THREE)
|
||||
item_module.screen_loc = inv3.screen_loc
|
||||
|
||||
held_items[module_num] = item_module
|
||||
@@ -111,13 +111,13 @@
|
||||
module_active = null
|
||||
|
||||
switch(module_num)
|
||||
if(1)
|
||||
if(BORG_CHOOSE_MODULE_ONE)
|
||||
if(!(disabled_modules & BORG_MODULE_ALL_DISABLED))
|
||||
inv1.icon_state = initial(inv1.icon_state)
|
||||
if(2)
|
||||
if(BORG_CHOOSE_MODULE_TWO)
|
||||
if(!(disabled_modules & BORG_MODULE_TWO_DISABLED))
|
||||
inv2.icon_state = initial(inv2.icon_state)
|
||||
if(3)
|
||||
if(BORG_CHOOSE_MODULE_THREE)
|
||||
if(!(disabled_modules & BORG_MODULE_THREE_DISABLED))
|
||||
inv3.icon_state = initial(inv3.icon_state)
|
||||
|
||||
@@ -147,7 +147,7 @@
|
||||
return FALSE
|
||||
|
||||
switch(module_num)
|
||||
if(1)
|
||||
if(BORG_CHOOSE_MODULE_ONE)
|
||||
if(disabled_modules & BORG_MODULE_ALL_DISABLED)
|
||||
return FALSE
|
||||
|
||||
@@ -163,7 +163,7 @@
|
||||
|
||||
to_chat(src, "<span class='userdanger'>CRITICAL ERROR: ALL modules OFFLINE.</span>")
|
||||
|
||||
if(2)
|
||||
if(BORG_CHOOSE_MODULE_TWO)
|
||||
if(disabled_modules & BORG_MODULE_TWO_DISABLED)
|
||||
return FALSE
|
||||
|
||||
@@ -174,7 +174,7 @@
|
||||
audible_message("<span class='warning'>[src] sounds an alarm! \"SYSTEM ERROR: Module [module_num] OFFLINE.\"</span>")
|
||||
to_chat(src, "<span class='userdanger'>SYSTEM ERROR: Module [module_num] OFFLINE.</span>")
|
||||
|
||||
if(3)
|
||||
if(BORG_CHOOSE_MODULE_THREE)
|
||||
if(disabled_modules & BORG_MODULE_THREE_DISABLED)
|
||||
return FALSE
|
||||
|
||||
@@ -205,7 +205,7 @@
|
||||
return FALSE
|
||||
|
||||
switch(module_num)
|
||||
if(1)
|
||||
if(BORG_CHOOSE_MODULE_ONE)
|
||||
if(!(disabled_modules & BORG_MODULE_ALL_DISABLED))
|
||||
return FALSE
|
||||
|
||||
@@ -214,13 +214,13 @@
|
||||
if(builtInCamera)
|
||||
builtInCamera.status = TRUE
|
||||
to_chat(src, "<span class='notice'>You hear your built in security camera focus adjust as it comes back online!</span>")
|
||||
if(2)
|
||||
if(BORG_CHOOSE_MODULE_TWO)
|
||||
if(!(disabled_modules & BORG_MODULE_TWO_DISABLED))
|
||||
return FALSE
|
||||
|
||||
inv2.icon_state = initial(inv2.icon_state)
|
||||
disabled_modules &= ~BORG_MODULE_TWO_DISABLED
|
||||
if(3)
|
||||
if(BORG_CHOOSE_MODULE_THREE)
|
||||
if(!(disabled_modules & BORG_MODULE_THREE_DISABLED))
|
||||
return FALSE
|
||||
|
||||
@@ -331,13 +331,13 @@
|
||||
return FALSE
|
||||
|
||||
switch(module_num)
|
||||
if(1)
|
||||
if(BORG_CHOOSE_MODULE_ONE)
|
||||
if(module_active != held_items[module_num])
|
||||
inv1.icon_state = "[initial(inv1.icon_state)] +a"
|
||||
if(2)
|
||||
if(BORG_CHOOSE_MODULE_TWO)
|
||||
if(module_active != held_items[module_num])
|
||||
inv2.icon_state = "[initial(inv2.icon_state)] +a"
|
||||
if(3)
|
||||
if(BORG_CHOOSE_MODULE_THREE)
|
||||
if(module_active != held_items[module_num])
|
||||
inv3.icon_state = "[initial(inv3.icon_state)] +a"
|
||||
module_active = held_items[module_num]
|
||||
@@ -350,13 +350,13 @@
|
||||
*/
|
||||
/mob/living/silicon/robot/proc/deselect_module(module_num)
|
||||
switch(module_num)
|
||||
if(1)
|
||||
if(BORG_CHOOSE_MODULE_ONE)
|
||||
if(module_active == held_items[module_num])
|
||||
inv1.icon_state = initial(inv1.icon_state)
|
||||
if(2)
|
||||
if(BORG_CHOOSE_MODULE_TWO)
|
||||
if(module_active == held_items[module_num])
|
||||
inv2.icon_state = initial(inv2.icon_state)
|
||||
if(3)
|
||||
if(BORG_CHOOSE_MODULE_THREE)
|
||||
if(module_active == held_items[module_num])
|
||||
inv3.icon_state = initial(inv3.icon_state)
|
||||
module_active = null
|
||||
@@ -405,4 +405,3 @@
|
||||
|
||||
/mob/living/silicon/robot/can_hold_items(obj/item/I)
|
||||
return (I && (I in module.modules)) //Only if it's part of our module.
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@
|
||||
icon = 'icons/obj/objects.dmi'
|
||||
icon_state = "modkit"
|
||||
w_class = WEIGHT_CLASS_SMALL
|
||||
require_module = 1
|
||||
require_module = TRUE
|
||||
module_type = list(/obj/item/robot_module/miner)
|
||||
module_flags = BORG_MODULE_MINER
|
||||
var/denied_type = null
|
||||
|
||||
Reference in New Issue
Block a user