mirror of
https://github.com/ParadiseSS13/Paradise.git
synced 2026-08-26 13:37:58 +01:00
Janiborg no longer starts with floor buffer and now can be toggled (#20133)
* Cyborg upgrade floor buffer and toggle mode * Update code/game/objects/items/robot/robot_upgrades.dm Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> * Apply suggestions from code review Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com> Co-authored-by: S34N <12197162+S34NW@users.noreply.github.com> Co-authored-by: Ryan <80364400+Sirryan2002@users.noreply.github.com>
This commit is contained in:
@@ -363,3 +363,38 @@
|
||||
msg_cooldown = world.time
|
||||
else
|
||||
deactivate()
|
||||
|
||||
/obj/item/borg/upgrade/floorbuffer
|
||||
name = "janitor cyborg floor buffer upgrade"
|
||||
desc = "A floor buffer upgrade kit that can be attached to janitor cyborgs."
|
||||
icon = 'icons/obj/vehicles.dmi'
|
||||
icon_state = "upgrade"
|
||||
require_module = TRUE
|
||||
module_type = /obj/item/robot_module/janitor
|
||||
/// How much speed the cyborg loses while the buffer is active
|
||||
var/buffer_speed = 1
|
||||
var/mob/living/silicon/robot/cyborg
|
||||
|
||||
/obj/item/borg/upgrade/floorbuffer/do_install(mob/living/silicon/robot/R)
|
||||
for(var/obj/item/borg/upgrade/floorbuffer/U in R)
|
||||
to_chat(R, "<span class='notice'>A floor buffer unit is already installed!</span>")
|
||||
to_chat(usr, "<span class='notice'>There's no room for another floor buffer unit!</span>")
|
||||
return
|
||||
cyborg = R
|
||||
var/datum/action/A = new /datum/action/item_action/floor_buffer(src)
|
||||
A.Grant(R)
|
||||
return TRUE
|
||||
|
||||
/obj/item/borg/upgrade/floorbuffer/ui_action_click()
|
||||
if(!cyborg.floorbuffer)
|
||||
cyborg.floorbuffer = TRUE
|
||||
cyborg.speed += buffer_speed
|
||||
else
|
||||
cyborg.floorbuffer = FALSE
|
||||
cyborg.speed -= buffer_speed
|
||||
to_chat(cyborg, "<span class='notice'>The floor buffer is now [cyborg.floorbuffer ? "active" : "deactivated"].</span>")
|
||||
|
||||
/obj/item/borg/upgrade/floorbuffer/Destroy()
|
||||
cyborg.floorbuffer = FALSE
|
||||
cyborg = null
|
||||
return ..()
|
||||
|
||||
Reference in New Issue
Block a user