public void GetAirdrop(Vector3 position) { var nodes = LevelNodes.nodes.OfType <AirdropNode>().Where(k => k.id != 0).ToList(); AirdropNode airdropNode = nodes[UnityEngine.Random.Range(0, nodes.Count())]; LevelManager.airdrop(position, airdropNode.id, Provider.modeConfigData.Events.Airdrop_Speed); }
public void MassDrop() { time = Configuration.Instance.MassAirdropTimeRangeEnabled ? Random.Range(Configuration.Instance.MassAirdropTimeMin, Configuration.Instance.MassAirdropTimeMax) : Configuration.Instance.MassAirdropInterval; UnturnedChat.Say(Translate("massdrop_coming"), UnturnedChat.GetColorFromName(Configuration.Instance.MassDropColor, Color.green)); for (byte i = 0; i < Configuration.Instance.MassAirdropCount; i++) { AirdropNode airdropNode = Nodes[Random.Range(0, Nodes.Count)]; LevelManager.airdrop(airdropNode.point, airdropNode.id, Provider.modeConfigData.Events.Airdrop_Speed); } }
public static void AirdropAll() { Random rand = new Random(); List <ushort> Airdropids = new List <ushort>(); foreach (Node n in LevelNodes.nodes) { if (n.type == ENodeType.AIRDROP) { AirdropNode node = (AirdropNode)n; Airdropids.Add(node.id); } } foreach (var p in Provider.clients) { int id = rand.Next(Airdropids.Count); LevelManager.airdrop(p.player.transform.position, Airdropids[id]); UnturnedChat.Say(p.playerID.steamID, Plugin.Instance.Translate("airdropall_message", UnturnedPlayer.FromCSteamID(p.playerID.steamID).DisplayName), Color.green); } }