コード例 #1
0
        //KillAction
        public static void ProcessAction(Client client, Player player, KillAction action)
        {
            var target = Player.FindOnline(action.Name);

            if (target != null)
            {
                target.Die(); //Kill em'
                PacketSender.SendGlobalMsg(Strings.Player.killed.ToString(target.Name, player.Name));
            }
            else
            {
                PacketSender.SendChatMsg(player, Strings.Player.offline);
            }
        }
コード例 #2
0
            public CandidateForKilling(int id, string name, string windowTitle, IntPtr windowHandle,
                                       uint lastUserInputTime, KillAction killAction, int inactivePeriodLimit, int lifePeriodLimit)
            {
                Id                   = id;
                Name                 = name;
                WindowTitle          = windowTitle;
                WindowHandle         = windowHandle;
                LastUserInputTime    = lastUserInputTime;
                _killAction          = killAction;
                _inactivePeriodLimit = inactivePeriodLimit;
                _lifePeriodLimit     = lifePeriodLimit;

                InactivePeriod = 0;
                LifePeriod     = 0;
            }
コード例 #3
0
        public void Kill <T>(Action <T> notification) where T : class
        {
            var killAction = new KillAction <T>((T)_subject, notification);
            var prev       = Interlocked.CompareExchange(ref _killNotification, killAction, null);

            if (prev != null)
            {
                Log.Warning(
                    "Kill scheduled on dead actor (" +
                    $"actor_system={_system.Name}," +
                    $"actor_name={_name}");

                return;
            }

            ScheduleDrain();
        }
コード例 #4
0
        //KillAction
        public static void ProcessAction(Client client, Player player, KillAction action)
        {
            var target = Player.FindOnline(action.Name);

            if (target != null)
            {
                lock (target.EntityLock)
                {
                    target.Die(); //Kill em'
                }

                PacketSender.SendGlobalMsg(Strings.Player.killed.ToString(target.Name, player.Name));
            }
            else
            {
                PacketSender.SendChatMsg(player, Strings.Player.offline, Enums.ChatMessageType.Admin);
            }
        }
コード例 #5
0
    private void Game_Manager_OnPlayerKilled(KillAction kill)
    {
        Debug.Log("Kill logic triggered!Killer: " + kill.Killer + " victim: " + kill.Victim);
        Player_Info VictimP_Info = players[kill.Victim].GetComponent<Player_Info>();

        if (VictimP_Info.isInvincible) return;

        Debug.Log("Player info: " + VictimP_Info);
        Player_Info killerP_Info = players[kill.Killer].GetComponent<Player_Info>();
        if (VictimP_Info.Type == Player_Type.Regular)
        {
            if (RespawnPositions.Length != 0)
            {
                ResestVictimPosition(VictimP_Info.gameObject);
            }
        }

        else if (VictimP_Info.Type == Player_Type.TopDown)
        {
            Debug.Log("Victim is top down!!!");
            GameObject killer = killerP_Info.gameObject;
            Debug.Log("Killer object is: " + killer);
            if (killer != null)
            {
                Vector3 victimPos = VictimP_Info.transform.position;
                killerP_Info.ChangeType(Player_Type.TopDown);
                VictimP_Info.ChangeType(Player_Type.Regular);
                ResestVictimPosition(VictimP_Info.gameObject);
                killer.GetComponent<PositionReseter>().ResetPosition(victimPos);
                killerP_Info.StartEX();
                //Start a coroutine - living bomb
            }
        }
        if (VictimP_Info.gameObject.tag != killerP_Info.gameObject.tag)
            killerP_Info.ScoreKills++;
        else
            killerP_Info.ScoreKills--;
    }