From 8856dfcf0186e02ba3153bb8b0a1a9d91b98942e Mon Sep 17 00:00:00 2001 From: Remie Richards Date: Sat, 1 Aug 2015 21:57:38 -0700 Subject: [PATCH 1/2] Adds a proc to allow any /atom/movable to smoothly orbit an /atom --- code/__HELPERS/unsorted.dm | 38 +++++++++++++++++++++++++++++++++++++- 1 file changed, 37 insertions(+), 1 deletion(-) diff --git a/code/__HELPERS/unsorted.dm b/code/__HELPERS/unsorted.dm index 15a1bdcfb0f..7611e5c980f 100644 --- a/code/__HELPERS/unsorted.dm +++ b/code/__HELPERS/unsorted.dm @@ -1708,4 +1708,40 @@ var/mob/dview/dview_mob = new see_in_dark = 1e6 -/mob/dview/New() //For whatever reason, if this isn't called, then BYOND will throw a type mismatch runtime when attempting to add this to the mobs list. -Fox \ No newline at end of file +/mob/dview/New() //For whatever reason, if this isn't called, then BYOND will throw a type mismatch runtime when attempting to add this to the mobs list. -Fox + + +//ORBITS +/atom/movable/var/atom/orbiting = null +//This is just so you can stop an orbit. +//orbit() can run without it (swap orbiting for A) +//but then you can never stop it and that's just silly. + +/atom/movable/proc/orbit(atom/A, radius = 10, clockwise = 1, angle_increment = 15) + if(!istype(A)) + return + orbiting = A + var/angle = 0 + var/matrix/initial_transform = matrix(transform) + spawn + while(orbiting) + loc = orbiting.loc + + angle += angle_increment + + var/matrix/shift = matrix(initial_transform) + shift.Translate(radius,0) + if(clockwise) + shift.Turn(angle) + else + shift.Turn(-angle) + animate(src,transform = shift,2) + + sleep(0.6) //the effect breaks above 0.6 delay + animate(src,transform = initial_transform,2) + + +/atom/movable/proc/stop_orbit() + if(orbiting) + loc = get_turf(orbiting) + orbiting = null \ No newline at end of file From f213cf5501f1fe620f387289bce1a187165a098f Mon Sep 17 00:00:00 2001 From: Markolie Date: Mon, 3 Aug 2015 06:37:12 +0200 Subject: [PATCH 2/2] Fix cable coil sprite --- code/game/objects/items/weapons/handcuffs.dm | 18 +++++++++--------- code/modules/power/cable.dm | 8 ++++---- 2 files changed, 13 insertions(+), 13 deletions(-) diff --git a/code/game/objects/items/weapons/handcuffs.dm b/code/game/objects/items/weapons/handcuffs.dm index 4f4d23b739d..49149671f56 100644 --- a/code/game/objects/items/weapons/handcuffs.dm +++ b/code/game/objects/items/weapons/handcuffs.dm @@ -91,34 +91,34 @@ var/last_chew = 0 /obj/item/weapon/restraints/handcuffs/cable name = "cable restraints" desc = "Looks like some cables tied together. Could be used to tie something up." - icon_state = "cuff_red" + icon_state = "cuff_white" item_state = "coil_red" breakouttime = 300 //Deciseconds = 30s cuffsound = 'sound/weapons/cablecuff.ogg' /obj/item/weapon/restraints/handcuffs/cable/red - icon_state = "cuff_red" + color = COLOR_RED /obj/item/weapon/restraints/handcuffs/cable/yellow - icon_state = "cuff_yellow" + color = COLOR_YELLOW /obj/item/weapon/restraints/handcuffs/cable/blue - icon_state = "cuff_blue" + color = COLOR_BLUE /obj/item/weapon/restraints/handcuffs/cable/green - icon_state = "cuff_green" + color = COLOR_GREEN /obj/item/weapon/restraints/handcuffs/cable/pink - icon_state = "cuff_pink" + color = COLOR_PINK /obj/item/weapon/restraints/handcuffs/cable/orange - icon_state = "cuff_orange" + color = COLOR_ORANGE /obj/item/weapon/restraints/handcuffs/cable/cyan - icon_state = "cuff_cyan" + color = COLOR_CYAN /obj/item/weapon/restraints/handcuffs/cable/white - icon_state = "cuff_white" + color = COLOR_WHITE /obj/item/weapon/restraints/handcuffs/pinkcuffs name = "fluffy pink handcuffs" diff --git a/code/modules/power/cable.dm b/code/modules/power/cable.dm index 574a3445ce0..38a1c5e927e 100644 --- a/code/modules/power/cable.dm +++ b/code/modules/power/cable.dm @@ -560,14 +560,14 @@ obj/structure/cable/proc/cableColor(var/colorC) if(ishuman(M) && !M.restrained() && !M.stat && !M.paralysis && ! M.stunned) if(!istype(usr.loc,/turf)) return if(src.amount <= 14) - usr << "\red You need at least 15 lengths to make restraints!" + usr << "You need at least 15 lengths to make restraints!" return var/obj/item/weapon/restraints/handcuffs/cable/B = new /obj/item/weapon/restraints/handcuffs/cable(usr.loc) - B.icon_state = "cuff_[color]" - usr << "\blue You wind some cable together to make some restraints." + B.color = color + usr << "You wind some cable together to make some restraints." src.use(15) else - usr << "\blue You cannot do that." + usr << "You cannot do that." ..() // Items usable on a cable coil :