mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-07-18 18:44:48 +01:00
Adds Floorbot color variants, minor refactors
This commit is contained in:
@@ -117,8 +117,8 @@
|
||||
/datum/crafting_recipe/floorbot
|
||||
name = "Floorbot"
|
||||
result = /mob/living/simple_animal/bot/floorbot
|
||||
reqs = list(/obj/item/storage/toolbox/mechanical = 1,
|
||||
/obj/item/stack/tile/plasteel = 1,
|
||||
reqs = list(/obj/item/storage/toolbox = 1,
|
||||
/obj/item/stack/tile/plasteel = 10,
|
||||
/obj/item/assembly/prox_sensor = 1,
|
||||
/obj/item/robot_parts/r_arm = 1)
|
||||
time = 40
|
||||
|
||||
@@ -210,20 +210,15 @@ var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
throw_range = 5
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
var/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/toolbox_tiles_sensor
|
||||
/obj/item/toolbox_tiles/sensor
|
||||
desc = "It's a toolbox with tiles sticking out the top and a sensor attached"
|
||||
name = "tiles, toolbox and sensor arrangement"
|
||||
icon = 'icons/obj/aibots.dmi'
|
||||
icon_state = "toolbox_tiles_sensor"
|
||||
force = 3
|
||||
throwforce = 10
|
||||
throw_speed = 2
|
||||
throw_range = 5
|
||||
w_class = WEIGHT_CLASS_NORMAL
|
||||
var/created_name = "Floorbot"
|
||||
|
||||
/obj/item/storage/toolbox/mechanical/attackby(obj/item/stack/tile/plasteel/T, mob/user, params)
|
||||
/obj/item/storage/toolbox/attackby(obj/item/stack/tile/plasteel/T, mob/user, params)
|
||||
if(!istype(T, /obj/item/stack/tile/plasteel))
|
||||
..()
|
||||
return
|
||||
@@ -234,6 +229,17 @@ var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
if(user.s_active)
|
||||
user.s_active.close(user)
|
||||
var/obj/item/toolbox_tiles/B = new /obj/item/toolbox_tiles
|
||||
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/green)
|
||||
B.toolbox_color = "g"
|
||||
if(/obj/item/storage/toolbox/syndicate)
|
||||
B.toolbox_color = "s"
|
||||
B.icon_state = "[B.toolbox_color]toolbox_tiles"
|
||||
user.put_in_hands(B)
|
||||
to_chat(user, "<span class='notice'>You add the tiles into the empty toolbox. They protrude from the top.</span>")
|
||||
user.unEquip(src, 1)
|
||||
@@ -246,8 +252,10 @@ var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
..()
|
||||
if(isprox(W))
|
||||
qdel(W)
|
||||
var/obj/item/toolbox_tiles_sensor/B = new /obj/item/toolbox_tiles_sensor()
|
||||
var/obj/item/toolbox_tiles/sensor/B = new /obj/item/toolbox_tiles/sensor()
|
||||
B.created_name = created_name
|
||||
B.toolbox_color = src.toolbox_color
|
||||
B.icon_state = "[B.toolbox_color]toolbox_tiles_sensor"
|
||||
user.put_in_hands(B)
|
||||
to_chat(user, "<span class='notice'>You add the sensor to the toolbox and tiles.</span>")
|
||||
user.unEquip(src, 1)
|
||||
@@ -263,12 +271,11 @@ var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
created_name = t
|
||||
log_game("[key_name(user)] has renamed a robot to [t]")
|
||||
|
||||
/obj/item/toolbox_tiles_sensor/attackby(obj/item/W, mob/user, params)
|
||||
/obj/item/toolbox_tiles/sensor/attackby(obj/item/W, mob/user, params)
|
||||
..()
|
||||
if(istype(W, /obj/item/robot_parts/l_arm) || istype(W, /obj/item/robot_parts/r_arm))
|
||||
qdel(W)
|
||||
var/turf/T = get_turf(user.loc)
|
||||
var/mob/living/simple_animal/bot/floorbot/A = new /mob/living/simple_animal/bot/floorbot(T)
|
||||
var/mob/living/simple_animal/bot/floorbot/A = new(drop_location(), toolbox_color)
|
||||
A.name = created_name
|
||||
A.robot_arm = W.type
|
||||
to_chat(user, "<span class='notice'>You add the robot arm to the odd looking toolbox assembly. Boop beep!</span>")
|
||||
@@ -287,10 +294,9 @@ var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
//Medbot Assembly
|
||||
/obj/item/storage/firstaid/attackby(obj/item/I, mob/user, params)
|
||||
if(!istype(I, /obj/item/robot_parts/l_arm) && !istype(I, /obj/item/robot_parts/r_arm))
|
||||
return ..()
|
||||
return ..()
|
||||
else
|
||||
robot_arm = I.type
|
||||
|
||||
|
||||
//Making a medibot!
|
||||
if(contents.len)
|
||||
@@ -298,7 +304,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
return
|
||||
|
||||
var/obj/item/firstaid_arm_assembly/A = new /obj/item/firstaid_arm_assembly(loc, med_bot_skin)
|
||||
|
||||
|
||||
A.req_one_access = req_one_access
|
||||
A.syndicate_aligned = syndicate_aligned
|
||||
A.treatment_oxy = treatment_oxy
|
||||
@@ -492,7 +498,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
|
||||
//General Griefsky
|
||||
|
||||
else if((istype(I, /obj/item/wrench)) && (build_step == 3))
|
||||
else if((istype(I, /obj/item/wrench)) && (build_step == 3))
|
||||
var/obj/item/griefsky_assembly/A = new /obj/item/griefsky_assembly
|
||||
user.put_in_hands(A)
|
||||
to_chat(user, "<span class='notice'>You adjust the arm slots for extra weapons!.</span>")
|
||||
@@ -516,12 +522,12 @@ var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
build_step++
|
||||
to_chat(user, "<span class='notice'>You add an energy sword to [src]!.</span>")
|
||||
qdel(I)
|
||||
|
||||
|
||||
else if((istype(I, /obj/item/melee/energy/sword)) && (build_step == 3))
|
||||
if(!user.unEquip(I))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You complete General Griefsky!.</span>")
|
||||
var/mob/living/simple_animal/bot/secbot/griefsky/S = new /mob/living/simple_animal/bot/secbot/griefsky
|
||||
var/mob/living/simple_animal/bot/secbot/griefsky/S = new /mob/living/simple_animal/bot/secbot/griefsky
|
||||
S.forceMove(get_turf(src))
|
||||
qdel(I)
|
||||
qdel(src)
|
||||
@@ -537,7 +543,7 @@ var/robot_arm = /obj/item/robot_parts/l_arm
|
||||
if(!user.unEquip(I))
|
||||
return
|
||||
to_chat(user, "<span class='notice'>You complete Genewul Giftskee!.</span>")
|
||||
var/mob/living/simple_animal/bot/secbot/griefsky/toy/S = new /mob/living/simple_animal/bot/secbot/griefsky/toy
|
||||
var/mob/living/simple_animal/bot/secbot/griefsky/toy/S = new /mob/living/simple_animal/bot/secbot/griefsky/toy
|
||||
S.forceMove(get_turf(src))
|
||||
qdel(I)
|
||||
qdel(src)
|
||||
|
||||
@@ -5,7 +5,7 @@
|
||||
icon = 'icons/obj/aibots.dmi'
|
||||
icon_state = "floorbot0"
|
||||
density = 0
|
||||
anchored = 0
|
||||
anchored = FALSE
|
||||
health = 25
|
||||
maxHealth = 25
|
||||
|
||||
@@ -32,6 +32,7 @@
|
||||
var/max_targets = 50
|
||||
var/turf/target
|
||||
var/oldloc = null
|
||||
var/toolbox_color = ""
|
||||
|
||||
#define HULL_BREACH 1
|
||||
#define BRIDGE_MODE 2
|
||||
@@ -40,12 +41,16 @@
|
||||
#define REPLACE_TILE 5
|
||||
#define TILE_EMAG 6
|
||||
|
||||
/mob/living/simple_animal/bot/floorbot/New()
|
||||
/mob/living/simple_animal/bot/floorbot/New(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 = 50
|
||||
maxHealth = 50
|
||||
|
||||
/mob/living/simple_animal/bot/floorbot/bot_reset()
|
||||
..()
|
||||
@@ -53,7 +58,7 @@
|
||||
oldloc = null
|
||||
ignore_list = list()
|
||||
nagged = 0
|
||||
anchored = 0
|
||||
anchored = FALSE
|
||||
update_icon()
|
||||
|
||||
/mob/living/simple_animal/bot/floorbot/set_custom_texts()
|
||||
@@ -235,7 +240,7 @@
|
||||
repair(target)
|
||||
else if(emagged == 2 && istype(target,/turf/simulated/floor))
|
||||
var/turf/simulated/floor/F = target
|
||||
anchored = 1
|
||||
anchored = TRUE
|
||||
mode = BOT_REPAIRING
|
||||
if(prob(90))
|
||||
F.break_tile_to_plating()
|
||||
@@ -244,7 +249,7 @@
|
||||
audible_message("<span class='danger'>[src] makes an excited booping sound.</span>")
|
||||
spawn(50)
|
||||
amount ++
|
||||
anchored = 0
|
||||
anchored = FALSE
|
||||
mode = BOT_IDLE
|
||||
target = null
|
||||
path = list()
|
||||
@@ -272,11 +277,11 @@
|
||||
if(HULL_BREACH) //The most common job, patching breaches in the station's hull.
|
||||
if(is_hull_breach(scan_target)) //Ensure that the targeted space turf is actually part of the station, and not random space.
|
||||
result = scan_target
|
||||
anchored = 1 //Prevent the floorbot being blown off-course while trying to reach a hull breach.
|
||||
anchored = TRUE //Prevent the floorbot being blown off-course while trying to reach a hull breach.
|
||||
if(BRIDGE_MODE) //Only space turfs in our chosen direction are considered.
|
||||
if(get_dir(src, scan_target) == targetdirection)
|
||||
result = scan_target
|
||||
anchored = 1
|
||||
anchored = TRUE
|
||||
if(REPLACE_TILE)
|
||||
F = scan_target
|
||||
if(istype(F, /turf/simulated/floor/plating)) //The floor must not already have a tile.
|
||||
@@ -306,9 +311,10 @@
|
||||
mode = BOT_IDLE
|
||||
target = null
|
||||
return
|
||||
anchored = 1
|
||||
anchored = TRUE
|
||||
icon_state = "floorbot-c"
|
||||
if(istype(target_turf, /turf/space/)) //If we are fixing an area not part of pure space, it is
|
||||
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
|
||||
spawn(50)
|
||||
@@ -320,11 +326,12 @@
|
||||
mode = BOT_IDLE
|
||||
amount -= 1
|
||||
update_icon()
|
||||
anchored = 0
|
||||
anchored = FALSE
|
||||
target = null
|
||||
else
|
||||
var/turf/simulated/floor/F = target_turf
|
||||
mode = BOT_REPAIRING
|
||||
icon_state = "[toolbox_color]floorbot-c"
|
||||
visible_message("<span class='notice'>[src] begins repairing the floor.</span>")
|
||||
spawn(50)
|
||||
if(mode == BOT_REPAIRING)
|
||||
@@ -334,7 +341,7 @@
|
||||
mode = BOT_IDLE
|
||||
amount -= 1
|
||||
update_icon()
|
||||
anchored = 0
|
||||
anchored = FALSE
|
||||
target = null
|
||||
|
||||
/mob/living/simple_animal/bot/floorbot/proc/eattile(obj/item/stack/tile/plasteel/T)
|
||||
@@ -380,9 +387,9 @@
|
||||
|
||||
/mob/living/simple_animal/bot/floorbot/update_icon()
|
||||
if(amount > 0)
|
||||
icon_state = "floorbot[on]"
|
||||
icon_state = "[toolbox_color]floorbot[on]"
|
||||
else
|
||||
icon_state = "floorbot[on]e"
|
||||
icon_state = "[toolbox_color]floorbot[on]e"
|
||||
|
||||
/mob/living/simple_animal/bot/floorbot/explode()
|
||||
on = 0
|
||||
|
||||
Reference in New Issue
Block a user