Modifies the vTec cyborg upgrade to be toggleable between off/half-boost/full-boost

Adds a set of chevron icons to icons/mob/actions.dmi to show this - provided by Toriate
This commit is contained in:
Poly
2018-06-16 11:40:46 -07:00
parent 496a1d1165
commit 212d971c03
2 changed files with 34 additions and 1 deletions
@@ -79,7 +79,40 @@
to_chat(user, "<span class='notice'>There's no room for another VTEC unit!</span>")
return FALSE
R.speed = -2 // Gotta go fast.
R.AddAbility(new/obj/effect/proc_holder/silicon/cyborg/vtecControl)
/obj/effect/proc_holder/silicon/cyborg/vtecControl
name = "vTec Control"
desc = "Allows finer-grained control of the vTec speed boost."
action_icon = 'icons/mob/actions.dmi'
action_icon_state = "Chevron_State_0"
var/currentState = 0
var/maxReduction = 2
/obj/effect/proc_holder/silicon/cyborg/vtecControl/Click(mob/living/silicon/robot/user)
var/mob/living/silicon/robot/self = usr
currentState = (currentState + 1) % 3
if(usr)
switch(currentState)
if (0)
self.speed += maxReduction
if (1)
self.speed -= maxReduction*0.5
if (2)
self.speed -= maxReduction*0.5
action.button_icon_state = "Chevron_State_[currentState]"
action.UpdateButtonIcon()
return
/obj/item/borg/upgrade/vtec/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()