mirror of
https://github.com/CHOMPStation2/CHOMPStation2.git
synced 2025-12-11 10:43:20 +00:00
Some improvement to the teleport scroll and spell code. It unbuckles the user now.
Thanks to Nodrak~ git-svn-id: http://tgstation13.googlecode.com/svn/trunk@5565 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
@@ -46,11 +46,20 @@
|
|||||||
usr <<"The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry."
|
usr <<"The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry."
|
||||||
return
|
return
|
||||||
|
|
||||||
var/attempt = 0
|
if(target && target.buckled)
|
||||||
|
target.buckled.unbuckle()
|
||||||
|
|
||||||
|
var/list/tempL = L
|
||||||
|
var/attempt = null
|
||||||
var/success = 0
|
var/success = 0
|
||||||
while(!success)
|
while(tempL.len)
|
||||||
success = target.Move(pick(L))
|
attempt = pick(tempL)
|
||||||
if(attempt > 20) break //Failsafe
|
success = target.Move(attempt)
|
||||||
|
if(!success)
|
||||||
|
tempL.Remove(attempt)
|
||||||
|
else
|
||||||
|
break
|
||||||
|
|
||||||
if(!success)
|
if(!success)
|
||||||
target.loc = pick(L)
|
target.loc = pick(L)
|
||||||
|
|
||||||
|
|||||||
@@ -69,12 +69,22 @@
|
|||||||
user <<"The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry."
|
user <<"The spell matrix was unable to locate a suitable teleport destination for an unknown reason. Sorry."
|
||||||
return
|
return
|
||||||
|
|
||||||
var/attempt = 0
|
if(user && user.buckled)
|
||||||
|
user.buckled.unbuckle()
|
||||||
|
|
||||||
|
var/list/tempL = L
|
||||||
|
var/attempt = null
|
||||||
var/success = 0
|
var/success = 0
|
||||||
while(!success)
|
while(tempL.len)
|
||||||
success = user.Move(pick(L))
|
attempt = pick(tempL)
|
||||||
if(attempt > 20) break //Failsafe
|
success = user.Move(attempt)
|
||||||
|
if(!success)
|
||||||
|
tempL.Remove(attempt)
|
||||||
|
else
|
||||||
|
break
|
||||||
|
|
||||||
if(!success)
|
if(!success)
|
||||||
user.loc = pick(L)
|
user.loc = pick(L)
|
||||||
|
|
||||||
smoke.start()
|
smoke.start()
|
||||||
src.uses -= 1
|
src.uses -= 1
|
||||||
Reference in New Issue
Block a user