[MIRROR] Fix warp whistle permanently immobilising its user. (#1120)

* Merge pull request #54126 from Timberpoes/warp-whistle-fix

Fix warp whistle permanently immobilising its user.

* Fix warp whistle permanently immobilising its user.

Co-authored-by: nemvar <47324920+nemvar@users.noreply.github.com>
This commit is contained in:
SkyratBot
2020-10-02 19:09:26 +02:00
committed by GitHub
co-authored by nemvar
parent 96dba805c3
commit 89c64edddb
2 changed files with 5 additions and 3 deletions
+2
View File
@@ -339,3 +339,5 @@ Remember to update _globalvars/traits.dm if you're adding/removing/renaming trai
#define LACKING_LOCOMOTION_APPENDAGES_TRAIT "lacking-locomotion-appengades" //trait associated to not having locomotion appendages nor the ability to fly or float
#define LACKING_MANIPULATION_APPENDAGES_TRAIT "lacking-manipulation-appengades" //trait associated to not having fine manipulation appendages such as hands
#define HANDCUFFED_TRAIT "handcuffed"
/// Trait granted by [/obj/item/warpwhistle]
#define WARPWHISTLE_TRAIT "warpwhistle"
@@ -402,7 +402,6 @@
heal_oxy = 25
//Warp Whistle: Provides uncontrolled long distance teleportation.
/obj/item/warpwhistle
name = "warp whistle"
desc = "One toot on this whistle will send you to a far away land!"
@@ -420,6 +419,7 @@
/obj/item/warpwhistle/proc/end_effect(mob/living/carbon/user)
user.invisibility = initial(user.invisibility)
user.status_flags &= ~GODMODE
REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, WARPWHISTLE_TRAIT)
user.update_mobility()
/obj/item/warpwhistle/attack_self(mob/living/carbon/user)
@@ -429,10 +429,11 @@
last_user = user
var/turf/T = get_turf(user)
playsound(T,'sound/magic/warpwhistle.ogg', 200, TRUE)
user.mobility_flags &= ~MOBILITY_MOVE
ADD_TRAIT(user, TRAIT_IMMOBILIZED, WARPWHISTLE_TRAIT)
new /obj/effect/temp_visual/tornado(T)
sleep(20)
if(interrupted(user))
REMOVE_TRAIT(user, TRAIT_IMMOBILIZED, WARPWHISTLE_TRAIT)
return
user.invisibility = INVISIBILITY_MAXIMUM
user.status_flags |= GODMODE
@@ -445,7 +446,6 @@
var/turf/potential_T = find_safe_turf()
if(T.z != potential_T.z || abs(get_dist_euclidian(potential_T,T)) > 50 - breakout)
do_teleport(user, potential_T, channel = TELEPORT_CHANNEL_MAGIC)
user.mobility_flags &= ~MOBILITY_MOVE
T = potential_T
break
breakout += 1