Added freelook AI Eye acceleration. Your AI Eye will get faster the longer you move it, allowing you to move around the station quickly. Stopping long enough will return the camera to normal speed.

With this I added a toggle to the acceleration. Using it will stop the AI Eye from gaining speed.

git-svn-id: http://tgstation13.googlecode.com/svn/trunk@4570 316c924e-a436-60f5-8080-3fe189b3f50e
This commit is contained in:
giacomand@gmail.com
2012-08-27 20:30:03 +00:00
parent c7ec10523b
commit b0f750339c

View File

@@ -45,7 +45,12 @@
// The AI's "eye". Described on the top of the page. // The AI's "eye". Described on the top of the page.
/mob/living/silicon/ai/var/mob/aiEye/eyeobj = new() /mob/living/silicon/ai
var/mob/aiEye/eyeobj = new()
var/sprint = 10
var/cooldown = 0
var/acceleration = 1
// Intiliaze the eye by assigning it's "ai" variable to us. Then set it's loc to us. // Intiliaze the eye by assigning it's "ai" variable to us. Then set it's loc to us.
/mob/living/silicon/ai/New() /mob/living/silicon/ai/New()
@@ -65,9 +70,24 @@
/client/AIMove(n, direct, var/mob/living/silicon/ai/user) /client/AIMove(n, direct, var/mob/living/silicon/ai/user)
user.eyeobj.setLoc(get_turf(get_step(user.eyeobj, direct))) var/initial = initial(user.sprint)
var/max_sprint = 50
if(user.cooldown && user.cooldown < world.timeofday) // 3 seconds
user.sprint = initial
for(var/i = 0; i < max(user.sprint, initial); i += 20)
user.eyeobj.setLoc(get_turf(get_step(user.eyeobj, direct)))
user.cooldown = world.timeofday + 5
if(user.acceleration)
user.sprint = min(user.sprint + 0.5, max_sprint)
else
user.sprint = initial
user.cameraFollow = null user.cameraFollow = null
src.eye = user.eyeobj src.eye = user.eyeobj
//user.machine = null //Uncomment this if it causes problems. //user.machine = null //Uncomment this if it causes problems.
user.lightNearbyCamera() user.lightNearbyCamera()
@@ -86,3 +106,9 @@
for(var/datum/camerachunk/c in eyeobj.visibleCameraChunks) for(var/datum/camerachunk/c in eyeobj.visibleCameraChunks)
c.remove(eyeobj) c.remove(eyeobj)
/mob/living/silicon/ai/verb/toggle_acceleration()
set category = "AI Commands"
set name = "Toggle Camera Acceleration"
acceleration = !acceleration
usr << "Camera acceleration has been toggled [acceleration ? "on" : "off"]."