Merge pull request #748 from quotefox/revert-714-borgupgrade-fix

Revert "Borg expander + VTEC fix"
This commit is contained in:
Dahlular
2020-12-06 13:44:41 -07:00
committed by GitHub
6 changed files with 21 additions and 68 deletions
-2
View File
@@ -37,7 +37,5 @@
#define MOVESPEED_ID_PRONE_DRAGGING "PRONE_DRAG"
#define MOVESPEED_ID_HUMAN_CARRYING "HUMAN_CARRY"
#define MOVESPEED_ID_SILICON_VTEC "SILICON_VTEC"
#define MOVESPEED_ID_SHRUNK "SHRINK_SPEED_MODIFIER"
#define MOVESPEED_ID_GROW "GROWTH_SPEED_MODIFIER"
@@ -74,24 +74,19 @@
/obj/item/borg/upgrade/vtec/action(mob/living/silicon/robot/R, user = usr)
. = ..()
if(.)
if(R.speed["enabled"])
if(R.speed < 0)
to_chat(R, "<span class='notice'>A VTEC unit is already installed!</span>")
to_chat(user, "<span class='notice'>There's no room for another VTEC unit!</span>")
return FALSE
//R.speed = -2 // Gotta go fast.
//Citadel change - makes vtecs give an ability rather than reducing the borg's speed instantly
//Hyper change - Also adds an emag option and makes the upgrade take up charge
var/obj/effect/proc_holder/silicon/cyborg/vtecControl/vtec = new
R.speed["enabled"] = TRUE
R.speed["ref"] = vtec
R.speed["timer"] = addtimer(CALLBACK(vtec, /obj/effect/proc_holder/silicon/cyborg/vtecControl/proc/useCharge, R), 50, TIMER_UNIQUE|TIMER_STOPPABLE|TIMER_LOOP)
R.AddAbility (R.speed["ref"])
//Citadel change - makes vtecs give an ability rather than reducing the borg's speed instantly
R.AddAbility(new/obj/effect/proc_holder/silicon/cyborg/vtecControl)
/obj/item/borg/upgrade/vtec/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.removeVTecStats()
R.speed = initial(R.speed)
/obj/item/borg/upgrade/disablercooler
name = "cyborg rapid disabler cooling module"
@@ -586,12 +581,14 @@
R.SetLockdown(0)
R.anchored = FALSE
R.notransform = FALSE
R.resize = 2
R.hasExpanded = TRUE
R.update_transform()
/obj/item/borg/upgrade/expand/deactivate(mob/living/silicon/robot/R, user = usr)
. = ..()
if (.)
R.resize = 0.5
R.hasExpanded = FALSE
R.update_transform()
+7 -20
View File
@@ -53,7 +53,7 @@
var/alarms = list("Motion"=list(), "Fire"=list(), "Atmosphere"=list(), "Power"=list(), "Camera"=list(), "Burglar"=list())
var/speed = list("enabled"=FALSE, "timer"=null, "ref"=null) // VTEC variables
var/speed = 0 // VTEC speed boost.
var/magpulse = FALSE // Magboot-like effect.
var/ionpulse = FALSE // Jetpack-like effect.
var/ionpulse_on = FALSE // Jetpack-like effect.
@@ -1041,6 +1041,11 @@
shown_robot_modules = FALSE
if(hud_used)
hud_used.update_robot_modules_display()
if (hasExpanded)
resize = 0.5
hasExpanded = FALSE
update_transform()
module.transform_to(/obj/item/robot_module)
// Remove upgrades.
@@ -1050,7 +1055,7 @@
upgrades.Cut()
removeVTecStats()
speed = 0
ionpulse = FALSE
revert_shell()
@@ -1082,13 +1087,6 @@
magpulse = module.magpulsing
updatename()
/mob/living/silicon/robot/update_transform()
. = ..()
var/matrix/ntransform = matrix(transform)
if (hasExpanded)
ntransform.Scale(2) //This seems a bit big
ntransform.Translate(0, 16)
transform = ntransform
/mob/living/silicon/robot/proc/place_on_head(obj/item/new_hat)
if(hat)
@@ -1244,14 +1242,3 @@
connected_ai.aicamera.stored[i] = TRUE
for(var/i in connected_ai.aicamera.stored)
aicamera.stored[i] = TRUE
/mob/living/silicon/robot/proc/removeVTecStats()
if (speed["enabled"])
speed["enabled"] = false
deltimer(speed["timer"])
RemoveAbility (speed["ref"])
speed["ref"] = null
remove_movespeed_modifier(MOVESPEED_ID_SILICON_VTEC)
update_transform()
return TRUE
return FALSE
@@ -235,7 +235,6 @@
R.notify_ai(NEW_MODULE)
if(R.hud_used)
R.hud_used.update_robot_modules_display()
R.update_transform()
SSblackbox.record_feedback("tally", "cyborg_modules", 1, R.module)
/* //Broken
+1 -2
View File
@@ -389,7 +389,7 @@
/mob/living/silicon/proc/GetPhoto(mob/user)
if (aicamera)
return aicamera.selectpicture(user)
/*
/mob/living/silicon/update_transform()
var/matrix/ntransform = matrix(transform) //aka transform.Copy()
var/changed = 0
@@ -401,7 +401,6 @@
if(changed)
animate(src, transform = ntransform, time = 2,easing = EASE_IN|EASE_OUT)
return ..()
*/
/mob/living/silicon/is_literate()
return 1
@@ -6,51 +6,24 @@
action_icon_state = "Chevron_State_0"
var/currentState = 0
var/iteration = FALSE
var/maxReduction = 2
/obj/effect/proc_holder/silicon/cyborg/vtecControl/Click(mob/living/silicon/robot/user = usr)
/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)
if (!user.cell) //If we run out of power, make the module not work.
to_chat(user, "<span class='warning'>You cannot cycle through your VTEC upgrade while you don't have power!</span>")
currentState = 0
if (user.cell) if (user.cell.charge <= 200)
to_chat(user, "<span class='warning'>You cannot cycle through your VTEC upgrade while you don't have power!</span>")
currentState = 0
user.cell.charge = 0
switch(currentState)
if (0)
user.add_movespeed_modifier(MOVESPEED_ID_SILICON_VTEC, override=TRUE, multiplicative_slowdown = (user.emagged*1.5))
self.speed = maxReduction
if (1)
user.add_movespeed_modifier(MOVESPEED_ID_SILICON_VTEC, override=TRUE, multiplicative_slowdown = -0.15*((user.emagged/2)+1))
self.speed -= maxReduction*0.5
if (2)
user.add_movespeed_modifier(MOVESPEED_ID_SILICON_VTEC, override=TRUE, multiplicative_slowdown = -0.325*((user.emagged/2)+1))
self.speed -= maxReduction*1.25
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) return
if (user.emagged && currentState && prob(20) && user.cell && user.cell.charge > 200)
currentState = 2 //Sets to 0 after Click() is called
Click(user)
if (!iteration)
to_chat(user, "<span class='warning'>Your VTEC upgrade malfunctions!</span>")
iteration = !iteration //So we don't spam the player with warnings
if (user.cell)
if (user.cell.charge <= 200)
user.add_movespeed_modifier(MOVESPEED_ID_SILICON_VTEC, override=TRUE, multiplicative_slowdown = (user.emagged*1.5))
user.cell.charge = 0
action.button_icon_state = "Chevron_State_0"
action.UpdateButtonIcon()
return
user.cell.charge -= round(15*(rand((currentState*2)+user.emagged, (currentState*2)+(1.1*(user.emagged+1)))))//rand(5.0, 6.2)
return
action.button_icon_state = "Chevron_State_0"
action.UpdateButtonIcon()