Example #1
0
        private void DoFlashEffect(Player player, float distance)
        {
            if (ResetConsumptionOnFlashed)
            {
                if (ConsumptionStacks[player] > 0)
                {
                    if (distance < 6 && ConsumptionStacks[player] > 1)
                    {
                        ConsumptionStacks[player]--;
                    }
                    else if (distance > 15)
                    {
                        ConsumptionStacks[player]++;
                    }

                    if ((ConsumptionStacks[player] / 2) >= 3)
                    {
                        ConsumptionStacks[player] -= 3;
                    }
                    else if ((ConsumptionStacks[player] / 2) >= 2)
                    {
                        ConsumptionStacks[player] -= 2;
                    }
                    else
                    {
                        ConsumptionStacks[player]--;
                    }
                }

                player.ShowHint($"You now have {ConsumptionStacks[player]} stacks of Consumption!", 10);
                int newIntensity = ConsumptionStacks[player] / (MaxConsumption / 2);
                player.ChangeEffectIntensity(EffectType.Scp207, (byte)newIntensity);
            }

            if (TeleportOnFlashed)
            {
                player.Position = Vector3.down * 1950f;

                Timing.CallDelayed(15f, () =>
                {
                    foreach (Player ply in Player.Get(Team.SCP))
                    {
                        if (player == ply)
                        {
                            continue;
                        }
                        player.Position = ply.Position + Vector3.up;
                        break;
                    }

                    Door hczArmoryDoor  = Exiled.API.Features.Map.GetDoorByName("HCZ_ARMORY");
                    Transform transform = hczArmoryDoor.Base.transform;
                    player.Position     = transform.position + transform.forward * 2f;
                });
            }
        }
Example #2
0
        public void IncreasePower(Player player)
        {
            if (ConsumptionStacks[player] >= MaxConsumption)
            {
                return;
            }

            Log.Debug($"{Name} power increase for {player.Nickname}");
            ConsumptionStacks[player]++;

            int newIntensity = ConsumptionStacks[player] / (MaxConsumption / 2);

            player.ChangeEffectIntensity(EffectType.Scp207, (byte)newIntensity);
            player.ShowHint($"You now have {ConsumptionStacks[player]} stacks of Consumption!");
        }