Skip to content

Commit

Permalink
fix
Browse files Browse the repository at this point in the history
  • Loading branch information
Antoonij committed Nov 16, 2024
1 parent 901ae3d commit d557d52
Show file tree
Hide file tree
Showing 2 changed files with 50 additions and 9 deletions.
7 changes: 6 additions & 1 deletion code/modules/mob/living/silicon/robot/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down Expand Up @@ -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
Expand Down
52 changes: 44 additions & 8 deletions code/modules/mob/living/silicon/robot/robot_modules.dm
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
..()

Expand Down Expand Up @@ -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()
..()
Expand Down Expand Up @@ -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)
Expand All @@ -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)
Expand All @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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()
..()

Expand Down Expand Up @@ -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.
Expand Down Expand Up @@ -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

Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -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)
Expand Down Expand Up @@ -1010,6 +1044,8 @@
robot.mind?.transfer_to(ninja)
qdel(robot)

return TRUE

/obj/item/robot_module/ninja/New()
..()
// Ниндзя штучки
Expand Down

0 comments on commit d557d52

Please sign in to comment.