Skip to content

Commit

Permalink
Refining/debugging bots.
Browse files Browse the repository at this point in the history
  • Loading branch information
MistakeNot4892 committed Jul 20, 2023
1 parent a341265 commit ae61971
Show file tree
Hide file tree
Showing 11 changed files with 31 additions and 19 deletions.
1 change: 1 addition & 0 deletions code/game/jobs/job/silicon.dm
Original file line number Diff line number Diff line change
Expand Up @@ -57,6 +57,7 @@
assignable = FALSE
mob_type = JOB_SILICON_ROBOT
outfit_type = /decl/hierarchy/outfit/job/silicon/cyborg
substitute_announce_title = "Stationbound Synthetic"
job_description = "A Cyborg is a mobile station synthetic, piloted by a cybernetically preserved brain. It is considered a person, but is still required \
to follow its Laws."
alt_titles = list(
Expand Down
8 changes: 4 additions & 4 deletions code/game/objects/items/robot/robot_frame.dm
Original file line number Diff line number Diff line change
Expand Up @@ -22,10 +22,10 @@
update_icon()

/obj/item/robot_parts/frame/update_icon()
overlays.Cut()
cut_overlays()
for(var/part in required_parts)
if(parts[part])
overlays += "[part]+o"
add_overlay("[part]+o")

/obj/item/robot_parts/frame/proc/check_completion()
for(var/part in required_parts)
Expand Down Expand Up @@ -170,8 +170,8 @@
)

/obj/item/robot_parts/frame/platform
name = "flying robot frame"
icon = 'icons/obj/robot_parts_flying.dmi'
name = "large robot frame"
icon = 'icons/obj/robot_parts_platform.dmi'
product = /mob/living/silicon/robot/platform
required_parts = list(
BP_L_ARM = /obj/item/robot_parts/l_arm,
Expand Down
2 changes: 1 addition & 1 deletion code/game/objects/items/robot/robot_parts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -84,7 +84,7 @@
/obj/item/robot_parts/chest
name = "torso"
desc = "A heavily reinforced case containing cyborg logic boards, with space for a standard power cell."
icon_state = "chest"
icon_state = "torso"
part = list(BP_GROIN,BP_TORSO)
bp_tag = BP_TORSO
var/wires = 0.0
Expand Down
3 changes: 3 additions & 0 deletions code/modules/mob/living/silicon/robot/robot.dm
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,9 @@

var/is_crisis_mode = crisis_override || (security_level == SEC_LEVEL_RED)
var/list/robot_modules = SSrobots.get_available_modules(module_category, is_crisis_mode, override)
if(!length(robot_modules))
to_chat(src, SPAN_WARNING("For some reason, no modules are available to you. Please report this on the issue tracker!"))
return

if(!override)
if(is_crisis_mode)
Expand Down
17 changes: 9 additions & 8 deletions code/modules/mob/living/silicon/robot/robot_modules/_module.dm
Original file line number Diff line number Diff line change
Expand Up @@ -129,15 +129,16 @@
/obj/item/robot_module/proc/build_synths()
SHOULD_CALL_PARENT(TRUE)
for(var/thing in synths)
if(ispath(thing, /datum/matter_synth))
if(!isnull(synths[thing]))
synths += new thing(synths[thing])
else
synths += new thing
else if(istype(thing, /datum/matter_synth))
synths |= thing
else
if(istype(thing, /datum/matter_synth))
continue
if(!ispath(thing, /datum/matter_synth))
log_debug("Invalid var type in [type] synth creation - [thing]")
continue
if(isnull(synths[thing]))
synths += new thing
else
synths += new thing(synths[thing])
synths -= thing

/obj/item/robot_module/proc/finalize_synths()
SHOULD_CALL_PARENT(TRUE)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -273,7 +273,7 @@
var/obj/item/matter_decompiler/MD = locate() in modules
MD.metal = metal
MD.glass = glass
var/obj/item/stack/material/cyborg/steel/M =locate() in modules
var/obj/item/stack/material/cyborg/steel/M = locate() in modules
M.synths = list(metal)
var/obj/item/stack/material/cyborg/glass/G = locate() in modules
G.synths = list(glass)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@

/obj/item/robot_module/robot/platform/explorer
name = "recon platform module"
display_name = "Recon"
unavailable_by_default = FALSE
armor_color = "#528052"
eye_color = "#7b7b46"
Expand Down Expand Up @@ -94,6 +95,7 @@

/obj/item/robot_module/robot/platform/cargo
name = "logistics platform module"
display_name = "Logistics"
unavailable_by_default = FALSE
armor_color = "#d5b222"
eye_color = "#686846"
Expand Down
15 changes: 10 additions & 5 deletions code/modules/mob/new_player/new_player.dm
Original file line number Diff line number Diff line change
Expand Up @@ -419,6 +419,13 @@

var/datum/job/J = SSjob.get_job(rank)

// Get the appropriate announcement title.
var/announce_rank = rank
if(J?.substitute_announce_title)
announce_rank = J.substitute_announce_title
else if(character.mind.role_alt_title)
announce_rank = character.mind.role_alt_title

// AIs don't need a spawnpoint, they must spawn at an empty core
if(J.mob_type & JOB_SILICON_AI)

Expand All @@ -431,7 +438,7 @@
// AIize the character, but don't move them yet
character = character.AIize(move = FALSE) // Dupe of code in /datum/controller/subsystem/ticker/proc/create_characters() for non-latespawn, unify?

AnnounceCyborg(character, rank, "has been transferred to the empty core in \the [character.loc.loc]")
AnnounceCyborg(character, announce_rank, "has been transferred to the empty core in \the [character.loc.loc]")
ticker.mode.latespawn(character)

qdel(C) //Deletes empty core (really?)
Expand All @@ -453,10 +460,10 @@
var/do_announce = join_props["announce"] && join_message && announce_channel
if(J.mob_type & JOB_SILICON)
if(do_announce)
AnnounceCyborg(character, rank, join_message, announce_channel, character.z)
AnnounceCyborg(character, announce_rank, join_message, announce_channel, character.z)
else
if(do_announce)
AnnounceArrival(character, J?.substitute_announce_title || rank, join_message, announce_channel, character.z)
AnnounceArrival(character, announce_rank, join_message, announce_channel, character.z)
data_core.manifest_inject(character)
ticker.minds += character.mind//Cyborgs and AIs handle this in the transform proc. //TODO!!!!! ~Carn

Expand All @@ -465,8 +472,6 @@
/mob/new_player/proc/AnnounceCyborg(var/mob/living/character, var/rank, var/join_message, var/channel, var/zlevel)
if (ticker.current_state == GAME_STATE_PLAYING)
var/list/zlevels = zlevel ? using_map.get_map_levels(zlevel, TRUE, om_range = DEFAULT_OVERMAP_RANGE) : null
if(character.mind.role_alt_title)
rank = character.mind.role_alt_title
// can't use their name here, since cyborg namepicking is done post-spawn, so we'll just say "A new Cyborg has arrived"/"A new Android has arrived"/etc.
global_announcer.autosay("A new[rank ? " [rank]" : " visitor" ] [join_message ? join_message : "has arrived on the station"].", "Arrivals Announcement Computer", channel, zlevels)

Expand Down
Binary file modified icons/obj/robot_parts.dmi
Binary file not shown.
Binary file modified icons/obj/robot_parts_flying.dmi
Binary file not shown.
Binary file added icons/obj/robot_parts_platform.dmi
Binary file not shown.

0 comments on commit ae61971

Please sign in to comment.