コード例 #1
0
 public override float CalculateFinalSpeed(MobileParty mobileParty, float baseSpeed, StatExplainer explanation)
 {
     if (FollowData.getIsFollowActive())
     {
         if (mobileParty != null && mobileParty.Leader != null)
         {
             float unChangedPartySpeed = base.CalculateFinalSpeed(mobileParty, baseSpeed, explanation);
             if (!mobileParty.IsLeaderless && mobileParty.Leader.IsPlayerCharacter)
             {
                 if (FollowData.getIsFollowActive())
                 {
                     float followPartySpeed = FollowData.getFollowParty().LastCachedSpeed;
                     float distanceToParty  = CalculateDistanceToParty(mobileParty, FollowData.getFollowParty());
                     if (distanceToParty <= FollowData.slowdownThreshold)
                     {
                         return(followPartySpeed * (distanceToParty / FollowData.slowdownThreshold));
                     }
                     else
                     {
                         return(base.CalculateFinalSpeed(mobileParty, baseSpeed, explanation));
                     }
                 }
                 return(unChangedPartySpeed);
             }
             return(unChangedPartySpeed);
         }
         return(base.CalculateFinalSpeed(mobileParty, baseSpeed, explanation));
     }
     return(base.CalculateFinalSpeed(mobileParty, baseSpeed, explanation));
 }
コード例 #2
0
 private void doOnTick(float obj)
 {
     checkForUserInput();
     if (FollowData.getIsFollowActive())
     {
         checkIfFollowPartyStillOnMap();
     }
 }
コード例 #3
0
 private void checkIfFollowPartyStillOnMap()
 {
     if (FollowData.getFollowParty() != null)
     {
         if (FollowData.getFollowParty().IsWaiting())
         {
             FollowData.stopFollowing();
         }
     }
 }
コード例 #4
0
 private void toggleFollowOnMouseClick()
 {
     if (FollowData.getIsFollowActive())
     {
         FollowData.stopFollowing();
     }
     else
     {
         if (MobileParty.MainParty.TargetParty != null)
         {
             FollowData.startFollowing(MobileParty.MainParty.TargetParty);
         }
     }
 }
コード例 #5
0
 private void checkForUserInput()
 {
     if (topScreen != null)
     {
         if (topScreen.DebugInput.IsKeyPressed(InputKey.F))
         {
             toggleFollowOnMouseClick();
         }
         else if (topScreen.DebugInput.IsKeyPressed(InputKey.LeftMouseButton))
         {
             if (FollowData.getIsFollowActive())
             {
                 FollowData.stopFollowing();
             }
         }
     }
 }