fixes code, and adds changelog (hope I did it right)

This commit is contained in:
MisterLayne
2018-02-27 18:36:00 -05:00
parent a578eeeb85
commit 21c9cd0a05
6 changed files with 276 additions and 23 deletions

View File

@@ -106,13 +106,13 @@
if (M.use(1))
var/obj/item/weapon/secbot_assembly/ed209_assembly/B = new /obj/item/weapon/secbot_assembly/ed209_assembly
B.loc = get_turf(src)
user << "<span class='notice'>You armed the robot frame.</span>"
to_chat(user, "<span class='notice'>You armed the robot frame.</span>")
if (user.get_inactive_hand()==src)
user.remove_from_mob(src)
user.put_in_inactive_hand(B)
qdel(src)
else
user << "<span class='warning'>You need one sheet of metal to arm the robot frame.</span>"
to_chat(user, "<span class='warning'>You need one sheet of metal to arm the robot frame.</span>")
if(istype(W, /obj/item/robot_parts/l_leg))
if(src.l_leg) return
user.drop_item()
@@ -149,9 +149,9 @@
src.chest = W
src.updateicon()
else if(!W:wires)
user << "<span class='warning'>You need to attach wires to it first!</span>"
to_chat(user, "<span class='warning'>You need to attach wires to it first!</span>")
else
user << "<span class='warning'>You need to attach a cell to it first!</span>"
to_chat(user, "<span class='warning'>You need to attach a cell to it first!</span>")
if(istype(W, /obj/item/robot_parts/head))
if(src.head) return
@@ -161,16 +161,16 @@
src.head = W
src.updateicon()
else
user << "<span class='warning'>You need to attach a flash to it first!</span>"
to_chat(user, "<span class='warning'>You need to attach a flash to it first!</span>")
if(istype(W, /obj/item/device/mmi))
var/obj/item/device/mmi/M = W
if(check_completion())
if(!istype(loc,/turf))
user << "<span class='warning'>You can't put \the [W] in, the frame has to be standing on the ground to be perfectly precise.</span>"
to_chat(user, "<span class='warning'>You can't put \the [W] in, the frame has to be standing on the ground to be perfectly precise.</span>")
return
if(!M.brainmob)
user << "<span class='warning'>Sticking an empty [W] into the frame would sort of defeat the purpose.</span>"
to_chat(user, "<span class='warning'>Sticking an empty [W] into the frame would sort of defeat the purpose.</span>")
return
if(!M.brainmob.key)
var/ghost_can_reenter = 0
@@ -181,15 +181,15 @@
to_chat(user, "<span class='notice'>\The [W] is completely unresponsive; though it may be able to auto-resuscitate.</span>") //Jamming a ghosted brain into a borg is likely detrimental, and may result in some problems.
return
if(!ghost_can_reenter)
user << "<span class='notice'>\The [W] is completely unresponsive; there's no point.</span>"
to_chat(user, "<span class='notice'>\The [W] is completely unresponsive; there's no point.</span>")
return
if(M.brainmob.stat == DEAD)
user << "<span class='warning'>Sticking a dead [W] into the frame would sort of defeat the purpose.</span>"
to_chat(user, "<span class='warning'>Sticking a dead [W] into the frame would sort of defeat the purpose.</span>")
return
if(jobban_isbanned(M.brainmob, "Cyborg"))
user << "<span class='warning'>This [W] does not seem to fit.</span>"
to_chat(user, "<span class='warning'>This [W] does not seem to fit.</span>")
return
var/mob/living/silicon/robot/O = new /mob/living/silicon/robot(get_turf(loc), unfinished = 1)
@@ -228,7 +228,7 @@
qdel(src)
else
user << "<span class='warning'>The MMI must go in after everything else!</span>"
to_chat(user, "<span class='warning'>The MMI must go in after everything else!</span>")
if (istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", src.name, src.created_name), MAX_NAME_LEN)
@@ -245,22 +245,22 @@
..()
if(istype(W, /obj/item/weapon/cell))
if(src.cell)
user << "<span class='warning'>You have already inserted a cell!</span>"
to_chat(user, "<span class='warning'>You have already inserted a cell!</span>")
return
else
user.drop_item()
W.loc = src
src.cell = W
user << "<span class='notice'>You insert the cell!</span>"
to_chat(user, "<span class='notice'>You insert the cell!</span>")
if(istype(W, /obj/item/stack/cable_coil))
if(src.wires)
user << "<span class='warning'>You have already inserted wire!</span>"
to_chat(user, "<span class='warning'>You have already inserted wire!</span>")
return
else
var/obj/item/stack/cable_coil/coil = W
coil.use(1)
src.wires = 1.0
user << "<span class='notice'>You insert the wire!</span>"
to_chat(user, "<span class='notice'>You insert the wire!</span>")
return
/obj/item/robot_parts/head/attackby(obj/item/W as obj, mob/user as mob)
@@ -269,14 +269,14 @@
if(istype(user,/mob/living/silicon/robot))
var/current_module = user.get_active_hand()
if(current_module == W)
user << "<span class='warning'>How do you propose to do that?</span>"
to_chat(user, "<span class='warning'>How do you propose to do that?</span>")
return
else
add_flashes(W,user)
else
add_flashes(W,user)
else if(istype(W, /obj/item/weapon/stock_parts/manipulator))
user << "<span class='notice'>You install some manipulators and modify the head, creating a functional spider-bot!</span>"
to_chat(user, "<span class='notice'>You install some manipulators and modify the head, creating a functional spider-bot!</span>")
new /mob/living/simple_animal/spiderbot(get_turf(loc))
user.drop_item()
qdel(W)
@@ -286,24 +286,24 @@
/obj/item/robot_parts/head/proc/add_flashes(obj/item/W as obj, mob/user as mob) //Made into a seperate proc to avoid copypasta
if(src.flash1 && src.flash2)
user << "<span class='notice'>You have already inserted the eyes!</span>"
to_chat(user, "<span class='notice'>You have already inserted the eyes!</span>")
return
else if(src.flash1)
user.drop_item()
W.loc = src
src.flash2 = W
user << "<span class='notice'>You insert the flash into the eye socket!</span>"
to_chat(user, "<span class='notice'>You insert the flash into the eye socket!</span>")
else
user.drop_item()
W.loc = src
src.flash1 = W
user << "<span class='notice'>You insert the flash into the eye socket!</span>"
to_chat(user, "<span class='notice'>You insert the flash into the eye socket!</span>")
/obj/item/robot_parts/emag_act(var/remaining_charges, var/mob/user)
if(sabotaged)
user << "<span class='warning'>[src] is already sabotaged!</span>"
to_chat(user, "<span class='warning'>[src] is already sabotaged!</span>")
else
user << "<span class='warning'>You short out the safeties.</span>"
to_chat(user, "<span class='warning'>You short out the safeties.</span>")
sabotaged = 1
return 1

View File

@@ -0,0 +1,235 @@
/mob/living/bot/cleanbot/edCLN
name = "ED-CLN Cleaning Robot"
desc = "A large cleaning robot. It looks rather efficient."
icon_state = "edCLN0"
req_one_access = list(access_robotics, access_janitor)
botcard_access = list(access_janitor, access_maint_tunnels)
locked = 0 // Start unlocked so roboticist can set them to patrol.
wait_if_pulled = 0 // One big boi.
min_target_dist = 0
patrol_speed = 3
target_speed = 6
cleaning = 0
blood = 0
var/red_switch = 0
var/blue_switch = 0
var/green_switch = 0
/mob/living/bot/cleanbot/edCLN/update_icons()
if(on && busy)
icon_state = "edCLN"
else
icon_state = "edCLN[on]"
/mob/living/bot/cleanbot/edCLN/handleIdle()
if(prob(10))
custom_emote(2, "makes a less than thrilled beeping sound.")
playsound(src.loc, 'sound/machines/synth_yes.ogg', 50, 0)
if(red_switch && !blue_switch && !green_switch && prob(10) || src.emagged)
if(istype(loc, /turf/simulated))
var/turf/simulated/T = loc
T.add_blood()
if(!red_switch && blue_switch && !green_switch && prob(50) || src.emagged)
if(istype(loc, /turf/simulated))
var/turf/simulated/T = loc
visible_message("<span class='notice'>\The [src] squirts a puddle of water on the floor!</span>")
T.wet_floor()
if(!red_switch && !blue_switch && green_switch && prob(10) || src.emagged)
if(istype(loc, /turf/simulated))
var/turf/simulated/T = loc
visible_message("<span class='warning'>\The [src] stomps on \the [T], breaking it!</span>")
qdel(T)
if(red_switch && blue_switch && green_switch && prob(1))
src.explode()
/mob/living/bot/cleanbot/edCLN/explode()
on = 0
visible_message("<span class='danger'>[src] blows apart!</span>")
var/turf/Tsec = get_turf(src)
new /obj/item/weapon/secbot_assembly/ed209_assembly(Tsec)
if(prob(50))
new /obj/item/robot_parts/l_leg(Tsec)
if(prob(50))
new /obj/item/robot_parts/r_leg(Tsec)
if(prob(50))
if(prob(50))
new /obj/item/weapon/reagent_containers/glass/bucket(Tsec)
else
new /obj/item/device/assembly/prox_sensor(Tsec)
var/datum/effect/effect/system/spark_spread/s = new /datum/effect/effect/system/spark_spread
s.set_up(3, 1, src)
s.start()
qdel(src)
return
/mob/living/bot/cleanbot/edCLN/attack_hand(var/mob/user)
var/dat
usr.set_machine(src)
add_fingerprint(usr)
dat += "<TT><B>Automatic Station Cleaner v2.0</B></TT><BR><BR>"
dat += "Status: <A href='?src=\ref[src];operation=start'>[on ? "On" : "Off"]</A><BR>"
dat += "Behaviour controls are [locked ? "locked" : "unlocked"]<BR>"
dat += "Maintenance panel is [open ? "opened" : "closed"]"
if(!locked || issilicon(user))
dat += "<BR>Cleans Blood: <A href='?src=\ref[src];operation=blood'>[blood ? "Yes" : "No"]</A><BR>"
dat += "<BR>Patrol station: <A href='?src=\ref[src];operation=patrol'>[will_patrol ? "Yes" : "No"]</A><BR>"
if(open && !locked)
dat += "<BR>Red Switch: <A href='?src=\ref[src];operation=red_switch'>[red_switch ? "On" : "Off"]</A><BR>"
dat += "<BR>Green Switch: <A href='?src=\ref[src];operation=green_switch'>[green_switch ? "On" : "Off"]</A><BR>"
dat += "<BR>Blue Switch: <A href='?src=\ref[src];operation=blue_switch'>[blue_switch ? "On" : "Off"]</A>"
user << browse("<HEAD><TITLE>Cleaner v2.0 controls</TITLE></HEAD>[dat]", "window=autocleaner")
onclose(user, "autocleaner")
return
/mob/living/bot/cleanbot/edCLN/Topic(href, href_list)
usr.set_machine(src)
add_fingerprint(usr)
switch(href_list["operation"])
if("start")
if(on)
turn_off()
else
turn_on()
if("blood")
blood = !blood
get_targets()
if("patrol")
will_patrol = !will_patrol
patrol_path = null
if("red_switch")
red_switch = !red_switch
to_chat(usr, "<span class='notice'>You flip the red switch [red_switch ? "on" : "off"].</span>")
if("green_switch")
green_switch = !blue_switch
to_chat(usr, "<span class='notice'>You flip the green switch [green_switch ? "on" : "off"].</span>")
if("blue_switch")
blue_switch = !blue_switch
to_chat(usr, "<span class='notice'>You flip the blue switch [blue_switch ? "on" : "off"].</span>")
attack_hand(usr)
/mob/living/bot/cleanbot/edCLN/emag_act(var/remaining_uses, var/mob/user)
. = ..()
if(!emagged)
if(user)
to_chat(user, "<span class='notice'>The [src] buzzes and beeps.</span>")
playsound(src.loc, 'sound/machines/buzzbeep.ogg', 50, 0)
emagged = 1
return 1
// Assembly
/obj/item/weapon/secbot_assembly/edCLN_assembly
name = "ED-CLN assembly"
desc = "Some sort of bizarre assembly."
icon = 'icons/obj/aibots.dmi'
icon_state = "ed209_frame"
item_state = "buildpipe"
created_name = "ED-CLN Security Robot"
/obj/item/weapon/secbot_assembly/edCLN_assembly/attackby(var/obj/item/weapon/W as obj, var/mob/user as mob)
..()
if(istype(W, /obj/item/weapon/pen))
var/t = sanitizeSafe(input(user, "Enter new robot name", name, created_name), MAX_NAME_LEN)
if(!t)
return
if(!in_range(src, usr) && src.loc != usr)
return
created_name = t
return
switch(build_step)
if(0, 1)
if(istype(W, /obj/item/robot_parts/l_leg) || istype(W, /obj/item/robot_parts/r_leg) || (istype(W, /obj/item/organ/external/leg) && ((W.name == "robotic right leg") || (W.name == "robotic left leg"))))
user.drop_item()
qdel(W)
build_step++
to_chat(user, "<span class='notice'>You add \the [W] to \the [src].</span>")
name = "legs/frame assembly"
if(build_step == 1)
icon_state = "ed209_leg"
else
icon_state = "ed209_legs"
if(2)
if(istype(W, /obj/item/weapon/reagent_containers/glass/bucket))
user.drop_item()
qdel(W)
build_step++
to_chat(user, "<span class='notice'>You add \the [W] to \the [src].</span>")
name = "bucket/legs/frame assembly"
item_state = "edCLN_bucket"
icon_state = "edCLN_bucket"
if(3)
if(istype(W, /obj/item/weapon/weldingtool))
var/obj/item/weapon/weldingtool/WT = W
if(WT.remove_fuel(0, user))
build_step++
name = "bucketed frame assembly"
to_chat(user, "<span class='notice'>You welded the bucket to \the [src].</span>")
if(4)
if(isprox(W))
user.drop_item()
qdel(W)
build_step++
to_chat(user, "<span class='notice'>You add \the [W] to \the [src].</span>")
name = "proximity bucket ED assembly"
item_state = "edCLN_prox"
icon_state = "edCLN_prox"
if(5)
if(istype(W, /obj/item/stack/cable_coil))
var/obj/item/stack/cable_coil/C = W
if (C.get_amount() < 1)
to_chat(user, "<span class='warning'>You need one coil of wire to wire \the [src].</span>")
return
to_chat(user, "<span class='notice'>You start to wire \the [src].</span>")
if(do_after(user, 40))
if(C.use(1))
build_step++
to_chat(user, "<span class='notice'>You wire the ED-CLN assembly.</span>")
name = "wired ED-CLN assembly"
return
if(6)
if(istype(W, /obj/item/weapon/mop))
name = "mop ED-CLN assembly"
build_step++
to_chat(user, "<span class='notice'>You add \the [W] to \the [src].</span>")
item_state = "edCLN_mop"
icon_state = "edCLN_mop"
user.drop_item()
qdel(W)
if(7)
if(istype(W, /obj/item/weapon/screwdriver))
playsound(src, W.usesound, 100, 1)
var/turf/T = get_turf(user)
to_chat(user, "<span class='notice'>Attatching the mop to the frame...</span>")
if(do_after(user, 40) && get_turf(user) == T)
build_step++
name = "mopped ED-CLN assembly"
to_chat(user, "<span class='notice'>Mop attached.</span>")
if(8)
if(istype(W, /obj/item/weapon/cell))
build_step++
to_chat(user, "<span class='notice'>You complete the ED-CLN.</span>")
var/turf/T = get_turf(src)
new /mob/living/bot/cleanbot/edCLN(T,created_name)
user.drop_item()
qdel(W)
user.drop_from_inventory(src)
qdel(src)

View File

@@ -266,6 +266,18 @@
user.drop_from_inventory(src)
qdel(src)
return
else if(istype(D, /obj/item/stack/material) && D.get_material_name() == DEFAULT_WALL_MATERIAL)
var/obj/item/stack/material/M = D
if (M.use(1))
var/obj/item/weapon/secbot_assembly/edCLN_assembly/B = new /obj/item/weapon/secbot_assembly/edCLN_assembly
B.loc = get_turf(src)
to_chat(user, "<span class='notice'>You armed the robot frame.</span>")
if (user.get_inactive_hand()==src)
user.remove_from_mob(src)
user.put_in_inactive_hand(B)
qdel(src)
else
to_chat(user, "<span class='warning'>You need one sheet of metal to arm the robot frame.</span>")
else if(istype(D, /obj/item/weapon/mop))
if(reagents.total_volume < 1)
to_chat(user, "<span class='warning'>\The [src] is empty!</span>")
@@ -273,7 +285,6 @@
reagents.trans_to_obj(D, 5)
to_chat(user, "<span class='notice'>You wet \the [D] in \the [src].</span>")
playsound(loc, 'sound/effects/slosh.ogg', 25, 1)
return
else
return ..()

View File

@@ -0,0 +1,6 @@
author: MisterLayne
delete-after: True
changes:
- rscadd "Added a version of the ED-209 called the ED-CLN. It is a more efficient Cleanbot."

Binary file not shown.

Before

Width:  |  Height:  |  Size: 50 KiB

After

Width:  |  Height:  |  Size: 55 KiB

View File

@@ -1713,6 +1713,7 @@
#include "code\modules\mob\living\bot\bot.dm"
#include "code\modules\mob\living\bot\cleanbot.dm"
#include "code\modules\mob\living\bot\ed209bot.dm"
#include "code\modules\mob\living\bot\edCLNbot.dm"
#include "code\modules\mob\living\bot\farmbot.dm"
#include "code\modules\mob\living\bot\floorbot.dm"
#include "code\modules\mob\living\bot\medbot.dm"