borg expander + vtec upgrades fix

This commit is contained in:
DragonTrance
2020-12-29 11:15:19 -07:00
parent 205879e74e
commit 529824b320
5 changed files with 57 additions and 20 deletions
@@ -6,24 +6,37 @@
action_icon_state = "Chevron_State_0"
var/currentState = 0
var/maxReduction = 2
var/iteration = FALSE
/obj/effect/proc_holder/silicon/cyborg/vtecControl/Click(mob/living/silicon/robot/user)
var/mob/living/silicon/robot/self = usr
/obj/effect/proc_holder/silicon/cyborg/vtecControl/Click(mob/living/silicon/robot/user = usr)
currentState = (currentState + 1) % 3
if(usr)
switch(currentState)
if (0)
self.speed = maxReduction
user.remove_movespeed_modifier(MOVESPEED_ID_SILICON_VTEC)
if (1)
self.speed -= maxReduction*0.5
user.add_movespeed_modifier(MOVESPEED_ID_SILICON_VTEC, override=TRUE, multiplicative_slowdown = -0.15)
if (2)
self.speed -= maxReduction*1.25
user.add_movespeed_modifier(MOVESPEED_ID_SILICON_VTEC, override=TRUE, multiplicative_slowdown = -0.325)
action.button_icon_state = "Chevron_State_[currentState]"
action.UpdateButtonIcon()
return
/obj/effect/proc_holder/silicon/cyborg/vtecControl/proc/useCharge(mob/living/silicon/robot/user)
if (!user || !user.cell || !iscyborg(user)) //sanity check
return
var/removed_charge = 15*currentState
if (user.cell.charge > removed_charge)
user.cell.charge -= removed_charge
return
user.cell.charge = 0
user.remove_movespeed_modifier(MOVESPEED_ID_SILICON_VTEC)
action.button_icon_state = "Chevron_State_0"
action.UpdateButtonIcon()