mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 18:53:06 +00:00
[MIRROR] allows robots to "holster" guns (#10061)
Co-authored-by: Kashargul <144968721+Kashargul@users.noreply.github.com>
This commit is contained in:
committed by
GitHub
parent
68b493ab4d
commit
06a8bcaecb
@@ -154,6 +154,15 @@
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
// Checks if the activated module is of the given type
|
||||
/mob/living/silicon/robot/proc/activated_module_type_list(var/list/type_to_compare, var/explicit = FALSE)
|
||||
if(!islist(type_to_compare))
|
||||
return FALSE
|
||||
for(var/type in type_to_compare)
|
||||
if(istype(module_active, type))
|
||||
return TRUE
|
||||
return FALSE
|
||||
|
||||
/mob/living/silicon/robot/proc/is_type_in_modules(var/type, var/list/modules, var/explicit = FALSE)
|
||||
for(var/atom/module in modules)
|
||||
if(explicit && isatom(module))
|
||||
@@ -210,6 +219,7 @@
|
||||
inv2.icon_state = "inv2"
|
||||
inv3.icon_state = "inv3"
|
||||
module_active = module_state_1
|
||||
update_icon()
|
||||
return
|
||||
if(2)
|
||||
if(module_active != module_state_2)
|
||||
@@ -217,6 +227,7 @@
|
||||
inv2.icon_state = "inv2 +a"
|
||||
inv3.icon_state = "inv3"
|
||||
module_active = module_state_2
|
||||
update_icon()
|
||||
return
|
||||
if(3)
|
||||
if(module_active != module_state_3)
|
||||
@@ -224,6 +235,7 @@
|
||||
inv2.icon_state = "inv2"
|
||||
inv3.icon_state = "inv3 +a"
|
||||
module_active = module_state_3
|
||||
update_icon()
|
||||
return
|
||||
return
|
||||
|
||||
@@ -236,16 +248,19 @@
|
||||
if(module_active == module_state_1)
|
||||
inv1.icon_state = "inv1"
|
||||
module_active = null
|
||||
update_icon()
|
||||
return
|
||||
if(2)
|
||||
if(module_active == module_state_2)
|
||||
inv2.icon_state = "inv2"
|
||||
module_active = null
|
||||
update_icon()
|
||||
return
|
||||
if(3)
|
||||
if(module_active == module_state_3)
|
||||
inv3.icon_state = "inv3"
|
||||
module_active = null
|
||||
update_icon()
|
||||
return
|
||||
return
|
||||
|
||||
|
||||
@@ -55,6 +55,7 @@
|
||||
if(shield && shield.active)
|
||||
ourborg.add_overlay("[sprite_icon_state]-shield")
|
||||
|
||||
if(ourborg.activated_module_type_list(list(/obj/item/melee/robotic, /obj/item/gun/energy/robotic)))
|
||||
for(var/thing_to_check in ourborg.get_active_modules()) //We look at our active modules. Let's peep!
|
||||
|
||||
//Melee Check
|
||||
@@ -85,9 +86,6 @@
|
||||
if(sprite_flag_check(ROBOT_HAS_DISABLER_SPRITE) && gun.gun_flag_check(COUNTS_AS_ROBOT_DISABLER))
|
||||
ourborg.add_overlay("[sprite_icon_state]-disabler")
|
||||
continue
|
||||
else //We are NEITHER a melee or a gun (Or whatever else you add in here in the future)
|
||||
continue //Go on to the next.
|
||||
return
|
||||
|
||||
/datum/robot_sprite/proc/get_belly_overlay(var/mob/living/silicon/robot/ourborg, var/size = 1, var/b_class)
|
||||
//Size
|
||||
|
||||
Reference in New Issue
Block a user