Merge pull request #85 from shellspeed1/holopad-fixes

Fixes ai's not being able to talk through holopads, adds floor bot variations, and makes it so floor bots can be built with any toolbox.
This commit is contained in:
quotefox
2019-11-19 03:43:41 +00:00
committed by GitHub
4 changed files with 37 additions and 11 deletions
+1 -1
View File
@@ -49,7 +49,7 @@
else
padloc = "(UNKNOWN)"
src.log_talk(message, LOG_SAY, tag="HOLOPAD in [padloc]")
send_speech(message, 7, T, "robot", language = language)
send_speech(message, 7, T, "robot", message_language = language)
to_chat(src, "<i><span class='game say'>Holopad transmitted, <span class='name'>[real_name]</span> <span class='message robot'>\"[message]\"</span></span></i>")
else
to_chat(src, "No holopad connected.")
@@ -208,6 +208,7 @@
throwforce = 10
created_name = "Floorbot"
var/toolbox = /obj/item/storage/toolbox/mechanical
var/toolbox_color = "" //Blank for blue, r for red, y for yellow, etc.
/obj/item/bot_assembly/floorbot/Initialize()
. = ..()
@@ -219,25 +220,45 @@
if(ASSEMBLY_FIRST_STEP)
desc = initial(desc)
name = initial(name)
icon_state = initial(icon_state)
icon_state = "[toolbox_color]toolbox_tiles"
if(ASSEMBLY_SECOND_STEP)
desc = "It's a toolbox with tiles sticking out the top and a sensor attached."
name = "incomplete floorbot assembly"
icon_state = "toolbox_tiles_sensor"
icon_state = "[toolbox_color]toolbox_tiles_sensor"
/obj/item/storage/toolbox/attackby(obj/item/stack/tile/plasteel/T, mob/user, params)
var/list/allowed_toolbox = list(/obj/item/storage/toolbox/emergency, //which toolboxes can be made into floorbots
/obj/item/storage/toolbox/electrical,
/obj/item/storage/toolbox/mechanical,
/obj/item/storage/toolbox/artistic,
/obj/item/storage/toolbox/syndicate)
/obj/item/storage/toolbox/mechanical/attackby(obj/item/stack/tile/plasteel/T, mob/user, params)
if(!istype(T, /obj/item/stack/tile/plasteel))
..()
return
if(!is_type_in_list(src, allowed_toolbox) && (type != /obj/item/storage/toolbox))
return
if(contents.len >= 1)
to_chat(user, "<span class='warning'>They won't fit in, as there is already stuff inside!</span>")
return
if(T.use(10))
var/obj/item/bot_assembly/floorbot/B = new
B.toolbox = type
switch(B.toolbox)
if(/obj/item/storage/toolbox)
B.toolbox_color = "r"
if(/obj/item/storage/toolbox/emergency)
B.toolbox_color = "r"
if(/obj/item/storage/toolbox/electrical)
B.toolbox_color = "y"
if(/obj/item/storage/toolbox/artistic)
B.toolbox_color = "g"
if(/obj/item/storage/toolbox/syndicate)
B.toolbox_color = "s"
user.put_in_hands(B)
to_chat(user, "<span class='notice'>You add the tiles into the empty [src.name]. They protrude from the top.</span>")
B.update_icon()
to_chat(user, "<span class='notice'>You add the tiles into the empty [name]. They protrude from the top.</span>")
qdel(src)
else
to_chat(user, "<span class='warning'>You need 10 floor tiles to start building a floorbot!</span>")
@@ -259,7 +280,7 @@
if(istype(W, /obj/item/bodypart/l_arm/robot) || istype(W, /obj/item/bodypart/r_arm/robot))
if(!can_finish_build(W, user))
return
var/mob/living/simple_animal/bot/floorbot/A = new(drop_location())
var/mob/living/simple_animal/bot/floorbot/A = new(drop_location(), toolbox_color)
A.name = created_name
A.robot_arm = W.type
A.toolbox = toolbox
@@ -32,6 +32,7 @@
var/turf/target
var/oldloc = null
var/toolbox = /obj/item/storage/toolbox/mechanical
var/toolbox_color = ""
#define HULL_BREACH 1
#define LINE_SPACE_MODE 2
@@ -41,12 +42,16 @@
#define REPLACE_TILE 6
#define TILE_EMAG 7
/mob/living/simple_animal/bot/floorbot/Initialize()
/mob/living/simple_animal/bot/floorbot/Initialize(mapload, new_toolbox_color)
. = ..()
toolbox_color = new_toolbox_color
update_icon()
var/datum/job/engineer/J = new/datum/job/engineer
access_card.access += J.get_access()
prev_access = access_card.access
if(toolbox_color == "s")
health = 100
maxHealth = 100
/mob/living/simple_animal/bot/floorbot/turn_on()
. = ..()
@@ -312,7 +317,7 @@
return
if(isspaceturf(target_turf)) //If we are fixing an area not part of pure space, it is
anchored = TRUE
icon_state = "floorbot-c"
icon_state = "[toolbox_color]floorbot-c"
visible_message("<span class='notice'>[targetdirection ? "[src] begins installing a bridge plating." : "[src] begins to repair the hole."] </span>")
mode = BOT_REPAIRING
sleep(50)
@@ -327,7 +332,7 @@
if(F.type != initial(tiletype.turf_type) && (F.broken || F.burnt || isplatingturf(F)) || F.type == (initial(tiletype.turf_type) && (F.broken || F.burnt)))
anchored = TRUE
icon_state = "floorbot-c"
icon_state = "[toolbox_color]floorbot-c"
mode = BOT_REPAIRING
visible_message("<span class='notice'>[src] begins repairing the floor.</span>")
sleep(50)
@@ -338,7 +343,7 @@
if(replacetiles && F.type != initial(tiletype.turf_type) && specialtiles && !isplatingturf(F))
anchored = TRUE
icon_state = "floorbot-c"
icon_state = "[toolbox_color]floorbot-c"
mode = BOT_REPAIRING
visible_message("<span class='notice'>[src] begins replacing the floor tiles.</span>")
sleep(50)
@@ -355,7 +360,7 @@
target = null
/mob/living/simple_animal/bot/floorbot/update_icon()
icon_state = "floorbot[on]"
icon_state = "[toolbox_color]floorbot[on]"
/mob/living/simple_animal/bot/floorbot/explode()