From a5a476f457ce7b95b29e5036fab8a29f1b6a498a Mon Sep 17 00:00:00 2001 From: silicons <2003111+silicons@users.noreply.github.com> Date: Mon, 28 Jun 2021 13:10:40 -0700 Subject: [PATCH] cyborg shovies --- code/datums/status_effects/debuffs.dm | 17 +++++++++++++++++ code/datums/status_effects/status_effect.dm | 2 ++ code/game/objects/items/robot/robot_upgrades.dm | 10 +++++----- .../mob/living/silicon/robot/robot_defense.dm | 8 ++++++++ .../mob/living/silicon/robot/robot_defines.dm | 4 +++- .../mob/living/silicon/robot/robot_movement.dm | 2 +- .../mob/living/silicon/silicon_defense.dm | 5 +++++ .../projectiles/projectile/energy/stun.dm | 5 +++++ 8 files changed, 46 insertions(+), 7 deletions(-) diff --git a/code/datums/status_effects/debuffs.dm b/code/datums/status_effects/debuffs.dm index 7fc7da2ef7..18d5129fb4 100644 --- a/code/datums/status_effects/debuffs.dm +++ b/code/datums/status_effects/debuffs.dm @@ -199,6 +199,23 @@ movespeed_mod = /datum/movespeed_modifier/status_effect/tased/no_combat_mode stamdmg_per_ds = 1 +/datum/status_effect/vtec_disabled + id = "vtec_disable" + tick = FALSE + +/datum/status_effect/vtec_disabled/on_creation(mob/living/new_owner, set_duration) + if(isnum(set_duration)) + duration = set_duration + . = ..() + if(iscyborg(owner)) + var/mob/living/silicon/robot/R = owner + R.vtec_disabled = TRUE + +/datum/status_effect/vtec_disabled/on_remove() + if(iscyborg(owner)) + var/mob/living/silicon/robot/R = owner + R.vtecs_disabled = FALSE + return ..() //OTHER DEBUFFS /datum/status_effect/his_wrath //does minor damage over time unless holding His Grace diff --git a/code/datums/status_effects/status_effect.dm b/code/datums/status_effects/status_effect.dm index b38b755f28..6d0c62a8b2 100644 --- a/code/datums/status_effects/status_effect.dm +++ b/code/datums/status_effects/status_effect.dm @@ -5,6 +5,8 @@ /datum/status_effect var/id = "effect" //Used for screen alerts. var/duration = -1 //How long the status effect lasts in DECISECONDS. Enter -1 for an effect that never ends unless removed through some means. + /// do we tick()? + var/tick = TRUE var/tick_interval = 10 //How many deciseconds between ticks, approximately. Leave at 10 for every second. var/next_tick //The scheduled time for the next tick. var/mob/living/owner //The mob affected by the status effect. diff --git a/code/game/objects/items/robot/robot_upgrades.dm b/code/game/objects/items/robot/robot_upgrades.dm index ed92623a37..88648bcbb7 100644 --- a/code/game/objects/items/robot/robot_upgrades.dm +++ b/code/game/objects/items/robot/robot_upgrades.dm @@ -90,7 +90,7 @@ as performing this in action() will cause the upgrade to end up in the borg inst to_chat(user, "There's no room for another VTEC unit!") return FALSE - //R.speed = -2 // Gotta go fast. + //R.vtec = -2 // Gotta go fast. //Citadel change - makes vtecs give an ability rather than reducing the borg's speed instantly VC = new /obj/effect/proc_holder/silicon/cyborg/vtecControl R.AddAbility(VC) @@ -100,7 +100,7 @@ as performing this in action() will cause the upgrade to end up in the borg inst . = ..() if (.) R.RemoveAbility(VC) - R.speed = initial(R.speed) + R.vtec = initial(R.vtec) R.cansprint = 1 /obj/item/borg/upgrade/disablercooler @@ -690,11 +690,11 @@ as performing this in action() will cause the upgrade to end up in the borg inst if(istype(user)) switch(currentState) if (0) - user.speed = initial(user.speed) + user.vtec = initial(user.vtec) if (1) - user.speed = initial(user.speed) - maxReduction * 0.5 + user.vtec = initial(user.vtec) - maxReduction * 0.5 if (2) - user.speed = initial(user.speed) - maxReduction * 1 + user.vtec = initial(user.vtec) - maxReduction * 1 action.button_icon_state = "Chevron_State_[currentState]" action.UpdateButtonIcon() diff --git a/code/modules/mob/living/silicon/robot/robot_defense.dm b/code/modules/mob/living/silicon/robot/robot_defense.dm index 36f291bf36..c1dd0c9c81 100644 --- a/code/modules/mob/living/silicon/robot/robot_defense.dm +++ b/code/modules/mob/living/silicon/robot/robot_defense.dm @@ -82,6 +82,14 @@ GLOBAL_LIST_INIT(blacklisted_borg_hats, typecacheof(list( //Hats that don't real if(!opened) return ..() +/mob/living/silicon/robot/shove_act(mob/living/carbon/human/H) + visible_message(span_danger("[src]'s motors grind as they are shoved by [H]!")) + vtec_disable(10 SECONDS) + +/mob/living/silicon/robot/proc/vtec_disable(time) + apply_status_effect(/datum/status_effect/vtec_disabled, time) + update_movespeed() + /mob/living/silicon/robot/fire_act() if(!on_fire) //Silicons don't gain stacks from hotspots, but hotspots can ignite them IgniteMob() diff --git a/code/modules/mob/living/silicon/robot/robot_defines.dm b/code/modules/mob/living/silicon/robot/robot_defines.dm index fe22ec1236..bf3bdcf707 100644 --- a/code/modules/mob/living/silicon/robot/robot_defines.dm +++ b/code/modules/mob/living/silicon/robot/robot_defines.dm @@ -61,7 +61,9 @@ var/alarms = list("Motion"=list(), "Fire"=list(), "Atmosphere"=list(), "Power"=list(), "Camera"=list(), "Burglar"=list()) - var/speed = 0 // VTEC speed boost. + var/vtec = 0 // VTEC speed boost. + /// vtec shorted out + var/vtec_disabled = FALSE var/magpulse = FALSE // Magboot-like effect. var/ionpulse = FALSE // Jetpack-like effect. var/ionpulse_on = FALSE // Jetpack-like effect. diff --git a/code/modules/mob/living/silicon/robot/robot_movement.dm b/code/modules/mob/living/silicon/robot/robot_movement.dm index e3a640bca0..23500688ae 100644 --- a/code/modules/mob/living/silicon/robot/robot_movement.dm +++ b/code/modules/mob/living/silicon/robot/robot_movement.dm @@ -23,4 +23,4 @@ . = ..() if(!resting && !(combat_flags & COMBAT_FLAG_SPRINT_ACTIVE)) . += 1 - . += speed + . += vtec_disabled? 0 : vtec diff --git a/code/modules/mob/living/silicon/silicon_defense.dm b/code/modules/mob/living/silicon/silicon_defense.dm index 3377bf9601..39d1d38ba7 100644 --- a/code/modules/mob/living/silicon/silicon_defense.dm +++ b/code/modules/mob/living/silicon/silicon_defense.dm @@ -79,6 +79,8 @@ M.visible_message("[M] pets [src].", \ "You pet [src].", target = src, target_message = "[M] pets you.") + if(INTENT_DISARM) + shove_act(M) if(INTENT_GRAB) grabbedby(M) else @@ -88,6 +90,9 @@ "[M] punches you, but doesn't leave a dent.", null, COMBAT_MESSAGE_RANGE, null, M, "You punch [src], but don't leave a dent.") +/mob/living/silicon/proc/shove_act(mob/living/carbon/human/H) + visible_message(span_danger("[M] shoves [src], but doesn't manage to make much of an effect.")) + /mob/living/silicon/attack_drone(mob/living/simple_animal/drone/M) if(M.a_intent == INTENT_HARM) return diff --git a/code/modules/projectiles/projectile/energy/stun.dm b/code/modules/projectiles/projectile/energy/stun.dm index 6f272dab40..acec1ef94f 100644 --- a/code/modules/projectiles/projectile/energy/stun.dm +++ b/code/modules/projectiles/projectile/energy/stun.dm @@ -31,6 +31,11 @@ else if(tase_duration && (C.status_flags & CANKNOCKDOWN) && !HAS_TRAIT(C, TRAIT_STUNIMMUNE) && !HAS_TRAIT(C, TRAIT_TASED_RESISTANCE)) C.apply_status_effect(strong_tase? STATUS_EFFECT_TASED : STATUS_EFFECT_TASED_WEAK, tase_duration) addtimer(CALLBACK(C, /mob/living/carbon.proc/do_jitter_animation, jitter), 5) + else if(iscyborg(target)) + target.visible_message(span_danger("A shower of sparks emit from [target] on impact from [src]!")) + do_sparks(1, TRUE, target) + var/mob/living/silicon/robot/R = target + R.vtec_disable(10 SECONDS) /obj/item/projectile/energy/electrode/on_range() //to ensure the bolt sparks when it reaches the end of its range if it didn't hit a target yet do_sparks(1, TRUE, src)