ports floorbot variations

This commit is contained in:
shellspeed1
2019-11-17 01:59:46 -08:00
parent ccd38d3459
commit b302b6ddd2
3 changed files with 33 additions and 9 deletions
@@ -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,24 +220,42 @@
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))
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/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)
B.update_icon()
to_chat(user, "<span class='notice'>You add the tiles into the empty [src.name]. They protrude from the top.</span>")
qdel(src)
else
@@ -259,7 +278,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-c"
/mob/living/simple_animal/bot/floorbot/explode()