Ports tgstation/tgstation#39302 with adjustments, see desc of commit (#7424)

Instead of the box being 100% invisible at all times, the box will steadily become more and more visible as you move. The faster you move, the more visible the box becomes. The box will slowly become invisible again every process() cycle.
This also makes the box inherit the movement delay of it's user, meaning you're able to sprint while moving inside boxes, or walk to slow yourself down.
This commit is contained in:
deathride58
2018-09-07 08:40:53 -04:00
committed by kevinz000
parent 5368b36397
commit b604390f33
11 changed files with 72 additions and 1 deletions
+21
View File
@@ -487,6 +487,27 @@
else
to_chat(owner, "<span class='cultitalic'>Your hands are full!</span>")
/datum/action/item_action/agent_box
name = "Deploy Box"
desc = "Find inner peace, here, in the box."
check_flags = AB_CHECK_RESTRAINED | AB_CHECK_STUN | AB_CHECK_CONSCIOUS
background_icon_state = "bg_agent"
icon_icon = 'icons/mob/actions/actions_items.dmi'
button_icon_state = "deploy_box"
var/cooldown = 0
var/obj/structure/closet/cardboard/agent/box
/datum/action/item_action/agent_box/Trigger()
if(!box)
if(cooldown < world.time - 30)
box = new(get_turf(owner))
owner.forceMove(box)
cooldown = world.time
owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)
else
owner.forceMove(get_turf(box))
owner.playsound_local(box, 'sound/misc/box_deploy.ogg', 50, TRUE)
QDEL_NULL(box)
//Preset for spells
/datum/action/spell_action
@@ -0,0 +1,38 @@
/obj/item/implant/stealth
name = "S3 implant"
desc = "Allows you to be hidden in plain sight."
actions_types = list(/datum/action/item_action/agent_box)
//Box Object
/obj/structure/closet/cardboard/agent
name = "inconspicious box"
desc = "It's so normal that you didn't notice it before."
icon_state = "agentbox"
use_mob_movespeed = TRUE
/obj/structure/closet/cardboard/agent/proc/go_invisible()
animate(src, , alpha = 0, time = 5)
START_PROCESSING(SSobj, src)
/obj/structure/closet/cardboard/agent/Initialize()
. = ..()
go_invisible()
/obj/structure/closet/cardboard/agent/open()
. = ..()
qdel(src)
/obj/structure/closet/cardboard/agent/process()
animate(src, , alpha = alpha - 50, time = 3)
/obj/structure/closet/cardboard/agent/Move()
. = ..()
if(.)
alpha = min(alpha + 5, 255)
/obj/structure/closet/cardboard/agent/Bump(atom/movable/A)
. = ..()
if(isliving(A))
alpha = 255
@@ -71,3 +71,7 @@
/obj/item/implanter/emp
name = "implanter (EMP)"
imp_type = /obj/item/implant/emp
/obj/item/implanter/stealth
name = "implanter (stealth)"
imp_type = /obj/item/implant/stealth
@@ -14,6 +14,7 @@
delivery_icon = "deliverybox"
anchorable = FALSE
var/move_speed_multiplier = 1
var/use_mob_movespeed = FALSE
var/move_delay = FALSE
var/egged = 0
@@ -22,7 +23,7 @@
return
move_delay = TRUE
if(step(src, direction))
addtimer(CALLBACK(src, .proc/ResetMoveDelay), CONFIG_GET(number/walk_delay) * move_speed_multiplier)
addtimer(CALLBACK(src, .proc/ResetMoveDelay), (use_mob_movespeed ? user.movement_delay() : CONFIG_GET(number/walk_delay)) * move_speed_multiplier)
else
ResetMoveDelay()
+6
View File
@@ -1293,6 +1293,12 @@ GLOBAL_LIST_INIT(uplink_items, subtypesof(/datum/uplink_item))
cost = 40
cant_discount = TRUE
/datum/uplink_item/cyber_implants/stealthimplant
name = "Stealth Implant"
desc = "This one-of-a-kind implant will make you almost invisible if you play your cards right."
item = /obj/item/implanter/stealth
cost = 8
// Role-specific items
/datum/uplink_item/role_restricted
category = "Role-Restricted"