diff --git a/code/modules/mob/living/silicon/robot/robot.dm b/code/modules/mob/living/silicon/robot/robot.dm index 8e4ee8c555c..ec268fb25fc 100644 --- a/code/modules/mob/living/silicon/robot/robot.dm +++ b/code/modules/mob/living/silicon/robot/robot.dm @@ -400,7 +400,9 @@ GLOBAL_LIST_INIT(robot_verbs_default, list( CRASH("[key_name_log(src)] tried to choose non-existent '[modtype]' module!") /// module effects - module.on_apply(src) + if(!module.on_apply(src)) + module = initial(module) + return /// languages module.add_languages(src) /// subsystems @@ -1308,6 +1310,9 @@ GLOBAL_LIST_INIT(robot_verbs_default, list( if(blocks_emissive) add_overlay(get_emissive_block()) + if(module) + module.set_appearance(src) + /mob/living/silicon/robot/proc/borg_icons() // Exists so that robot/destroyer can override it return diff --git a/code/modules/mob/living/silicon/robot/robot_modules.dm b/code/modules/mob/living/silicon/robot/robot_modules.dm index 71078da6dbb..70095882bd6 100644 --- a/code/modules/mob/living/silicon/robot/robot_modules.dm +++ b/code/modules/mob/living/silicon/robot/robot_modules.dm @@ -51,7 +51,10 @@ modules += new /obj/item/flash/cyborg(src) /obj/item/robot_module/proc/on_apply(mob/living/silicon/robot/robot) - return + return TRUE + +/obj/item/robot_module/proc/set_appearance(mob/living/silicon/robot/robot) + return TRUE /obj/item/robot_module/proc/fix_modules() for(var/obj/item/I in modules) @@ -255,6 +258,8 @@ robot.status_flags &= ~CANPUSH robot.see_reagents = TRUE + return TRUE + /obj/item/robot_module/medical/New() ..() modules += new /obj/item/healthanalyzer/advanced(src) @@ -333,10 +338,12 @@ /obj/item/robot_module/engineering/on_apply(mob/living/silicon/robot/robot) if(robot.camera && ("Robots" in robot.camera.network)) - LAZYADD(robot.camera.network, ("Engineering")) + LAZYADD(robot.camera.network, "Engineering") ADD_TRAIT(robot, TRAIT_NEGATES_GRAVITY, ROBOT_TRAIT) + return TRUE + /obj/item/robot_module/engineering/New() ..() modules += new /obj/item/rcd/borg(src) @@ -402,10 +409,12 @@ if(count_secborgs >= max_secborgs) to_chat(robot, span_warning("There are too many Security cyborgs active. Please choose another module.")) - return + return FALSE robot.status_flags &= ~CANPUSH + return TRUE + /obj/item/robot_module/security/New() ..() modules += new /obj/item/restraints/handcuffs/cable/zipties(src) @@ -472,6 +481,8 @@ /obj/item/robot_module/butler/on_apply(mob/living/silicon/robot/robot) robot.see_reagents = TRUE + return TRUE + /obj/item/robot_module/butler/New() ..() @@ -579,7 +590,9 @@ /obj/item/robot_module/miner/on_apply(mob/living/silicon/robot/robot) if(robot.camera && ("Robots" in robot.camera.network)) - LAZYADD(robot.camera.network, ("Mining Outpost")) + LAZYADD(robot.camera.network, "Mining Outpost") + + return TRUE /obj/item/robot_module/miner/New() ..() @@ -645,6 +658,8 @@ robot.mind?.transfer_to(death) qdel(robot) + return TRUE + /obj/item/robot_module/deathsquad/New() ..() modules += new /obj/item/melee/energy/sword/cyborg(src) @@ -667,6 +682,8 @@ robot.spawn_syndicate_borgs(robot, "Bloodhound", get_turf(robot)) qdel(robot) + return TRUE + /obj/item/robot_module/syndicate/New() ..() modules += new /obj/item/melee/energy/sword/cyborg(src) @@ -693,6 +710,8 @@ robot.spawn_syndicate_borgs(robot, "Medical", get_turf(robot)) qdel(robot) + return TRUE + /obj/item/robot_module/syndicate_medical/New() ..() modules += new /obj/item/healthanalyzer/advanced(src) @@ -739,6 +758,8 @@ robot.spawn_syndicate_borgs(robot, "Saboteur", get_turf(robot)) qdel(src) + return TRUE + /obj/item/robot_module/syndicate_saboteur/New() ..() modules += new /obj/item/rcd/borg/syndicate(src) @@ -783,9 +804,11 @@ /obj/item/robot_module/destroyer/on_apply(mob/living/silicon/robot/robot) var/mob/living/silicon/robot/destroyer/destroy = new(get_turf(robot)) - robot.mind.transfer_to(destroy) + robot.mind?.transfer_to(destroy) qdel(robot) + return TRUE + /obj/item/robot_module/destroyer/New() ..() @@ -813,6 +836,8 @@ /obj/item/robot_module/combat/on_apply(mob/living/silicon/robot/robot) robot.status_flags &= ~CANPUSH + return TRUE + /obj/item/robot_module/combat/New() ..() modules += new /obj/item/gun/energy/immolator/multi/cyborg(src) // primary weapon, strong at close range (ie: against blob/terror/xeno), but consumes a lot of energy per shot. @@ -844,6 +869,8 @@ /obj/item/robot_module/hunter/on_apply(mob/living/silicon/robot/robot) robot.modtype = "Xeno-Hu" + return TRUE + /obj/item/robot_module/hunter/add_default_robot_items() return @@ -876,6 +903,8 @@ robot.mind?.transfer_to(drone) qdel(robot) + return TRUE + /obj/item/robot_module/drone/New() ..() modules += new /obj/item/weldingtool/largetank/cyborg(src) @@ -928,6 +957,8 @@ robot.mind?.transfer_to(cogscarab) qdel(robot) + return TRUE + /obj/item/robot_module/cogscarab/Initialize() . = ..() modules += new /obj/item/weldingtool/experimental/brass(src) @@ -962,14 +993,17 @@ borg_skins = list("cyborg" = "cyborg") /obj/item/robot_module/clockwork/on_apply(mob/living/silicon/robot/robot) - robot.icon = 'icons/mob/clockwork_mobs.dmi' - robot.icon_state = "cyborg" - robot.status_flags &= ~CANPUSH QDEL_NULL(robot.mmi) robot.mmi = new /obj/item/mmi/robotic_brain/clockwork(src) + return TRUE + +/obj/item/robot_module/clockwork/set_appearance(mob/living/silicon/robot/robot) + robot.icon = 'icons/mob/clockwork_mobs.dmi' + robot.icon_state = "cyborg" + /obj/item/robot_module/clockwork/Initialize() . = ..() modules += new /obj/item/clockwork/clockslab(src) @@ -1010,6 +1044,8 @@ robot.mind?.transfer_to(ninja) qdel(robot) + return TRUE + /obj/item/robot_module/ninja/New() ..() // Ниндзя штучки