Ejemplo n.º 1
0
        public override void Release(StarverPlayer player, Vector vel)
        {
            var power = CreativePowerManager.Instance.GetPower <CreativePowers.GodmodePower>();

            power.SetEnabledState(player.Index, true);

            var sound = new NetMessage.NetSoundInfo(player.Center, (ushort)rand.Next(47, 56));

            NetMessage.PlayNetSound(sound, player.Index);

            AsyncRelease(player);
        }
Ejemplo n.º 2
0
        private async void AsyncRelease(StarverPlayer player)
        {
            await Task.Run(() =>
            {
                try
                {
                    Thread.Sleep(5000);
                    var power = CreativePowerManager.Instance.GetPower <CreativePowers.GodmodePower>();
                    power.SetEnabledState(player.Index, false);

                    player.SetBuff(BuffID.RapidHealing, 10 * 60);
                    player.SetBuff(BuffID.NebulaUpLife3, 10 * 60);

                    var sound = new NetMessage.NetSoundInfo(player.Center, 19);
                    NetMessage.PlayNetSound(sound);
                }
                catch (Exception e)
                {
                    TSPlayer.Server.SendErrorMessage(e.ToString());
                }
            });
        }