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)); }
private void doOnTick(float obj) { checkForUserInput(); if (FollowData.getIsFollowActive()) { checkIfFollowPartyStillOnMap(); } }
private void checkIfFollowPartyStillOnMap() { if (FollowData.getFollowParty() != null) { if (FollowData.getFollowParty().IsWaiting()) { FollowData.stopFollowing(); } } }
private void toggleFollowOnMouseClick() { if (FollowData.getIsFollowActive()) { FollowData.stopFollowing(); } else { if (MobileParty.MainParty.TargetParty != null) { FollowData.startFollowing(MobileParty.MainParty.TargetParty); } } }
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(); } } } }