Exemple #1
0
        // TODO: Add Target and AOE everything around it? Use OnBeforeUses on every target in UseInternal? Or only on selected Target?
        protected override void UpdateTarget()
        {
            foreach (PlayerControl player in AllPlayers)
            {
                if (player == LocalPlayer)
                {
                    continue;
                }
                if (owner.Owner.GetRole().Faction == Faction.Mafia &&
                    player.GetRole().Faction == Faction.Mafia)
                {
                    continue;
                }
                if (!PlayerTools.IsPlayerInUseRange(owner.Owner, player))
                {
                    player.myRend.material.SetFloat(ShaderOutline, 0F);
                    continue;
                }

                player.myRend.material.SetFloat(ShaderOutline, 1F);
                player.myRend.material.SetColor(ShaderOutlineColor, Color.green);
            }

            Button.SetTarget(LocalPlayer == owner.Owner ? PlayerTools.FindClosestTarget(owner.Owner) : null);
        }
Exemple #2
0
        // Methods Ability
        protected override void UseInternal(PlayerControl target, out bool sendRpc, out bool setCooldown)
        {
            blockedPlayers.Clear();

            foreach (PlayerControl player in AllPlayers)
            {
                if (player == LocalPlayer)
                {
                    continue;
                }
                if (owner.Owner.GetRole().Faction == Faction.Mafia &&
                    player.GetRole().Faction == Faction.Mafia)
                {
                    continue;
                }
                if (!PlayerTools.IsPlayerInUseRange(owner.Owner, player))
                {
                    continue;
                }

                blockedPlayers.Add(player);
            }

            RPCBlockPlayers(target, blockedPlayers);

            sendRpc     = false;
            setCooldown = true;
        }