mirror of
https://github.com/PolarisSS13/Polaris.git
synced 2025-12-29 11:31:51 +00:00
Fixed issues with cyborgs deactivating flashlights, cleaned up some module code in the process.
This commit is contained in:
@@ -9,44 +9,48 @@
|
||||
/mob/living/silicon/robot/proc/uneq_active()
|
||||
if(isnull(module_active))
|
||||
return
|
||||
|
||||
//In checking borglights, I simplified this a bit.
|
||||
var/obj/item/module = module_active
|
||||
|
||||
module.dropped(src)
|
||||
|
||||
if(istype(module,/obj/item/borg/sight))
|
||||
var/obj/item/borg/sight/sight_module = module
|
||||
sight_mode &= ~sight_module.sight_mode
|
||||
|
||||
if (client)
|
||||
client.screen -= module
|
||||
|
||||
contents -= module
|
||||
|
||||
if(module_state_1 == module_active)
|
||||
if(istype(module_state_1,/obj/item/borg/sight))
|
||||
sight_mode &= ~module_state_1:sight_mode
|
||||
if (client)
|
||||
client.screen -= module_state_1
|
||||
contents -= module_state_1
|
||||
module_active = null
|
||||
module_state_1 = null
|
||||
inv1.icon_state = "inv1"
|
||||
else if(module_state_2 == module_active)
|
||||
if(istype(module_state_2,/obj/item/borg/sight))
|
||||
sight_mode &= ~module_state_2:sight_mode
|
||||
if (client)
|
||||
client.screen -= module_state_2
|
||||
contents -= module_state_2
|
||||
module_active = null
|
||||
module_state_2 = null
|
||||
inv2.icon_state = "inv2"
|
||||
else if(module_state_3 == module_active)
|
||||
if(istype(module_state_3,/obj/item/borg/sight))
|
||||
sight_mode &= ~module_state_3:sight_mode
|
||||
if (client)
|
||||
client.screen -= module_state_3
|
||||
contents -= module_state_3
|
||||
module_active = null
|
||||
module_state_3 = null
|
||||
inv3.icon_state = "inv3"
|
||||
|
||||
module_active = null
|
||||
|
||||
//src << "[module.name] deactivated."
|
||||
|
||||
updateicon()
|
||||
|
||||
/mob/living/silicon/robot/proc/uneq_all()
|
||||
module_active = null
|
||||
|
||||
var/obj/item/module
|
||||
if(module_state_1)
|
||||
if(istype(module_state_1,/obj/item/borg/sight))
|
||||
sight_mode &= ~module_state_1:sight_mode
|
||||
if (client)
|
||||
client.screen -= module_state_1
|
||||
contents -= module_state_1
|
||||
module = module_state_1
|
||||
module.dropped(src)
|
||||
module_state_1 = null
|
||||
inv1.icon_state = "inv1"
|
||||
if(module_state_2)
|
||||
@@ -55,6 +59,8 @@
|
||||
if (client)
|
||||
client.screen -= module_state_2
|
||||
contents -= module_state_2
|
||||
module = module_state_2
|
||||
module.dropped(src)
|
||||
module_state_2 = null
|
||||
inv2.icon_state = "inv2"
|
||||
if(module_state_3)
|
||||
@@ -63,8 +69,11 @@
|
||||
if (client)
|
||||
client.screen -= module_state_3
|
||||
contents -= module_state_3
|
||||
module = module_state_3
|
||||
module.dropped(src)
|
||||
module_state_3 = null
|
||||
inv3.icon_state = "inv3"
|
||||
|
||||
updateicon()
|
||||
|
||||
/mob/living/silicon/robot/proc/activated(obj/item/O)
|
||||
|
||||
@@ -126,7 +126,7 @@
|
||||
var/datum/robot_component/cell_component = components["power cell"]
|
||||
cell_component.wrapped = cell
|
||||
cell_component.installed = 1
|
||||
|
||||
|
||||
hud_list[HEALTH_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
hud_list[STATUS_HUD] = image('icons/mob/hud.dmi', src, "hudhealth100")
|
||||
hud_list[ID_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
@@ -135,9 +135,9 @@
|
||||
hud_list[IMPCHEM_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
hud_list[IMPTRACK_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
hud_list[SPECIALROLE_HUD] = image('icons/mob/hud.dmi', src, "hudblank")
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
playsound(loc, 'sound/voice/liveagain.ogg', 75, 1)
|
||||
|
||||
@@ -1093,44 +1093,48 @@
|
||||
if(activated(O))
|
||||
src << "Already activated"
|
||||
return
|
||||
|
||||
if(!module_state_1)
|
||||
module_state_1 = O
|
||||
O.layer = 20
|
||||
contents += O
|
||||
if(istype(module_state_1,/obj/item/borg/sight))
|
||||
sight_mode |= module_state_1:sight_mode
|
||||
else if(!module_state_2)
|
||||
module_state_2 = O
|
||||
O.layer = 20
|
||||
contents += O
|
||||
if(istype(module_state_2,/obj/item/borg/sight))
|
||||
sight_mode |= module_state_2:sight_mode
|
||||
else if(!module_state_3)
|
||||
module_state_3 = O
|
||||
O.layer = 20
|
||||
contents += O
|
||||
if(istype(module_state_3,/obj/item/borg/sight))
|
||||
sight_mode |= module_state_3:sight_mode
|
||||
else
|
||||
src << "You need to disable a module first!"
|
||||
return
|
||||
|
||||
O.pickup(src)
|
||||
O.layer = 20
|
||||
contents += O
|
||||
if(istype(O,/obj/item/borg/sight))
|
||||
var/obj/item/borg/sight/sight = O
|
||||
sight_mode |= sight.sight_mode
|
||||
|
||||
installed_modules()
|
||||
|
||||
if (href_list["deact"])
|
||||
var/obj/item/O = locate(href_list["deact"])
|
||||
|
||||
if(activated(O))
|
||||
if(module_state_1 == O)
|
||||
module_state_1 = null
|
||||
contents -= O
|
||||
else if(module_state_2 == O)
|
||||
module_state_2 = null
|
||||
contents -= O
|
||||
else if(module_state_3 == O)
|
||||
module_state_3 = null
|
||||
contents -= O
|
||||
else
|
||||
src << "Module isn't activated."
|
||||
return
|
||||
else
|
||||
src << "Module isn't activated"
|
||||
return
|
||||
|
||||
O.dropped(src)
|
||||
contents -= O
|
||||
|
||||
src << "[O.name] deactivated."
|
||||
|
||||
installed_modules()
|
||||
|
||||
if (href_list["lawc"]) // Toggling whether or not a law gets stated by the State Laws verb --NeoFite
|
||||
|
||||
Reference in New Issue
Block a user