/// <summary> /// Leader Out Of Game Coroutine /// </summary> /// <param name="children">The children.</param> /// <returns>Task<System.Boolean>.</returns> internal static async Task <bool> LeaderOutOfGameTask() { LeaderService.LeaderOutOfGameUpdate(); SimpleFollow.Pulse(); // Some safety checks if (ZetaDia.IsInGame) { return(true); } if (ZetaDia.IsLoadingWorld) { return(true); } if (!ZetaDia.Service.Hero.IsValid) { return(true); } if (!ZetaDia.Service.Platform.IsConnected) { return(true); } if (!ZetaDia.Service.IsValid || !ZetaDia.Service.Hero.IsValid) { return(true); } // In Party but no followers connected - just wait! if (Settings.Instance.WaitForFollowers && Social.IsInParty && Social.IsPartyleader && Social.NumPartyMembers - 1 != SimpleFollow.Followers.Count) { Logr.Log("Waiting for followers to connect to SimpleFollow server..."); return(false); } if (!Social.IsPartyleader) { Logr.Log("Waiting to become party leader..."); return(false); } if (!SimpleFollow.Followers.Any()) { return(true); } var followersInGame = SimpleFollow.Followers.Where(f => DateTime.UtcNow.Subtract(f.Value.LastTimeInGame).TotalSeconds < 10).ToList(); if (Social.IsInParty && followersInGame.Any() && !GameUI.PlayGameButton.IsEnabled) { Logr.Log("Waiting for {0} followers to leave game...", followersInGame.Count()); await Coroutine.Sleep(500); return(false); } return(true); }
void Start() { MasterAttractor = GameObject.Find("MasterAttractor").transform; blockScript = GetComponent <Block> (); simpleFollowScript = GetComponent <SimpleFollow> (); InvokeRepeating("CheckMasterAttractorDistance", 0, 1); }
// Release the captured block. public void VacateBlock() { Block CapturedBlock_BlockScript = CapturedBlock.GetComponent <Block> (); Rigidbody CapturedBlock_Rigidbody = CapturedBlock.GetComponent <Rigidbody> (); SimpleFollow CapturedBlock_SimpleFollow = CapturedBlock.GetComponent <SimpleFollow> (); CapturedBlock_BlockScript.stack = null; CapturedBlock_BlockScript.isStacked = false; CapturedBlock_Rigidbody.isKinematic = false; CapturedBlock_BlockScript.OverwriteVelocity = false; CapturedBlock_SimpleFollow.enabled = false; CapturedBlock = null; isOccupied = false; canOccupy = true; }
private void Awake() { Instance = this; simpleFollow = GetComponent <SimpleFollow>(); YEvent.EventCenter.AddListener(YEvent.EventType.OnClickTran, (NetInputDetecter detector) => { this.currentNetDeceter = detector; simpleFollow.player = currentNetDeceter.transform; }); NetData.Instance.InitData(); }
/// <summary> /// Leaders the in game task. /// </summary> /// <param name="children">The children.</param> /// <returns>Task<System.Boolean>.</returns> internal static async Task <bool> LeaderInGameTask() { if (ValidCombatCheck() && AnyFollowersInCombat()) { SimpleFollow.Pulse(); Logr.Log("A friend is in combat - to the rescue!"); ZetaDia.Me.TeleportToPlayerByIndex(SimpleFollow.Followers.FirstOrDefault(f => f.Value.IsInCombat).Value.CPlayerIndex); await Coroutine.Sleep(200); await Coroutine.Yield(); } // In Party but no followers connected - just wait! while (Settings.Instance.WaitForFollowers && ValidCheck() && Social.NumPartyMembers - 1 != SimpleFollow.Followers.Count) { SimpleFollow.Pulse(); Logr.Log("Waiting for party members to connect to SimpleFollow server..."); await Coroutine.Yield(); } while (Settings.Instance.WaitForFollowers && ValidCheck() && !AllFollowersInGame()) { SimpleFollow.Pulse(); Logr.Log("Waiting for party members to join same game..."); await Coroutine.Yield(); } while (Settings.Instance.WaitForFollowers && ValidCheck() && AnyFollowersNotInTown()) { SimpleFollow.Pulse(); Logr.Log("Waiting for party members to come to town..."); await Coroutine.Yield(); } /* Wait for followers to open greater rift * while (ValidCheck() && ShouldFollowerOpenRift()) * { * SimpleFollow.Pulse(); * Logr.Log("Waiting for follower to open rift..."); * await Coroutine.Yield(); * }*/ return(false); }
// Set to current captured block in trigger. public void CaptureBlock() { Block CapturedBlockScript = CapturedBlock.GetComponent <Block> (); SimpleFollow CapturedBlockSimpleFollow = CapturedBlock.GetComponent <SimpleFollow> (); Rigidbody CapturedBlockRigidbody = CapturedBlock.GetComponent <Rigidbody> (); ParentToTransform CapturedBlockParentToTransform = CapturedBlock.GetComponent <ParentToTransform> (); BlockFormation CapturedBlockParentBlockFormation = CapturedBlock.GetComponentInParent <BlockFormation> (); Rigidbody CapturedBlockParentRigidbody = CapturedBlock.GetComponentInParent <Rigidbody> (); if (CapturedBlockScript.isBossPart == false) { CapturedBlockRigidbody.isKinematic = false; CapturedBlockScript.OverwriteVelocity = true; CapturedBlockScript.isStacked = true; CapturedBlockScript.stack = this; CapturedBlockRigidbody.velocity = Vector3.zero; CapturedBlockSimpleFollow.enabled = true; CapturedBlockSimpleFollow.FollowPosX = transform; CapturedBlockSimpleFollow.FollowPosY = transform; CapturedBlockSimpleFollow.FollowPosZ = transform; isOccupied = true; if (stackSound.isPlaying == false) { stackSound.Play(); } if (CapturedBlockParentBlockFormation != null && CapturedBlockParentRigidbody != null) { CapturedBlockParentRigidbody.velocity = Vector3.zero; //CapturedBlockParentBlockFormation.enabled = false; CapturedBlockParentToTransform.ParentNow(); } } }
public override void Start() { ai = GetComponent <SimpleFollow>(); base.Start(); }