Exemplo n.º 1
0
 void OnCollisionEnter(Collision coll)
 {
     if (isTriggered && !isFalled)
     {
         if (coll.gameObject.layer == 8)
         {
             stop();
         }
         //coll.transform.GetComponent<PlayerControll> ().myPhaseController.CmdStopStalactite (BlanksManager.findInListByIndex (index));
         else if (coll.transform.tag == "P")
         {
             AlivePlayer player = coll.transform.GetComponent <AlivePlayer> ();
             if (player.myPhaseController.hasAuthority)
             {
                 if (player.currentHelmet != null)
                 {
                     if (!player.currentHelmet.isProtect)
                     {
                         player.myPhaseController.CmdGetDamage(1);
                     }
                 }
                 else
                 {
                     player.myPhaseController.CmdGetDamage(1);
                 }
                 player.myPhaseController.CmdDestrStalactite(BlanksManager.findInListByIndex(index));
             }
         }
     }
 }
Exemplo n.º 2
0
    protected override IEnumerator cancelEffect(AlivePlayer alive, GhostPlayer ghost)
    {
        yield return(new WaitForSeconds(alive.currentSkill.duration));

        alive.hasEffect = false;
        yield break;
    }
Exemplo n.º 3
0
    public virtual void applyEffect(AlivePlayer alive, GhostPlayer ghost)
    {
        alive.hasEffect = true;
        IEnumerator corotine = cancelEffect(alive, ghost);

        StartCoroutine(corotine);
    }
Exemplo n.º 4
0
    public void PlayerConnected(int Id)
    {
        Log($"New player {Id} connected");

        if (Id == ServerId)
        {
            RpcId(ServerId, nameof(RegisterNickname), Nickname);
        }

        if (Multiplayer.IsNetworkServer())
        {
            foreach (int AlivePlayer in Alive)
            {
                if (AlivePlayer == Id)
                {
                    continue;
                }

                var    Plr      = (ThirdPersonPlayer)RuntimeRoot.GetNode(AlivePlayer.ToString());
                string Nickname = Nicknames[AlivePlayer];
                RpcId(Id, nameof(NetSpawn), AlivePlayer, Nickname, Plr.GlobalTransform.origin, Plr.Rotation);
                Plr.RpcId(Id, nameof(ThirdPersonPlayer.NetSetSpectateWeapon), Plr.Holder.CurrentWeapon.Kind);
            }
        }
    }
Exemplo n.º 5
0
    protected override IEnumerator cancelEffect(AlivePlayer alive, GhostPlayer ghost)
    {
        yield return(new WaitForSeconds(alive.currentSkill.duration));

        alive.hasEffect             = false;
        alive.blackholeObject.color = new Color(0, 0, 0, 0.431f);
        yield break;
    }
Exemplo n.º 6
0
 void OnCollisionEnter(Collision coll)
 {
     if (coll.transform.tag == "P")
     {
         AlivePlayer player = coll.transform.GetComponent <AlivePlayer> ();
         if (player.myPhaseController.hasAuthority)
         {
             player.myPhaseController.CmdPickUpEquipment(equipment.id, index);
         }
     }
 }
Exemplo n.º 7
0
    public override void applyEffect(AlivePlayer alive, GhostPlayer ghost)
    {
        base.applyEffect(alive, ghost);

        Vector3 lastPos = ghost.transform.position;

        ghost.isSkillAvaible = true;
        alive.hasEffect      = false;

        alive.myPhaseController.CmdSaySwitch(alive.transform.position, true, ghost.id);
        alive.myPhaseController.CmdSaySwitch(lastPos, false, alive.id);
    }
Exemplo n.º 8
0
    void Start()
    {
        MyNetManager.instance.addPlayer(this);
        MyNetManager.instance.getSpawnPoint(this.transform);
        GetMyId();

        alive = aliveObject.GetComponent <AlivePlayer> (); ghost = ghostObject.GetComponent <GhostPlayer> ();

        alive.id = id;
        ghost.id = id;
        alive.transform.position = transform.position; ghost.transform.position = Vector3.zero;
        alive.myPhaseController  = this; ghost.myPhaseController = this;
        if (hasAuthority)
        {
            MyNetManager.instance.attachCamera(alive);
            StartCoroutine("waitBeforeSendBlanks");
            //FindObjectOfType<CameraPivot> ().player = aliveObject.transform;
            UIController.instance.alivePlyer  = alive;
            UIController.instance.ghostPlayer = ghost;
        }

        ghostObject.SetActive(false);
    }
Exemplo n.º 9
0
 public override void applyEffect(AlivePlayer alive, GhostPlayer ghost)
 {
     base.applyEffect(alive, ghost);
     alive.myPhaseController.CmdGetDamage(1);
 }
Exemplo n.º 10
0
 public override void applyEffect(AlivePlayer alive, GhostPlayer ghost)
 {
     base.applyEffect(alive, ghost);
     alive.blackholeObject.color = new Color(0, 0, 0, 1);
 }
Exemplo n.º 11
0
 public override void applyEffect(AlivePlayer alive, GhostPlayer ghost)
 {
     base.applyEffect(alive, ghost);
     alive.InverseKof = -1;
 }
Exemplo n.º 12
0
 public virtual void pickUp(AlivePlayer player)
 {
 }
Exemplo n.º 13
0
    public void _on_CommandInput_text_entered(string Text)
    {
        CommandInput.Text = "";
        var Tokenizer = new CommandTokenizer(Text);

        if (Tokenizer.Next() is Token CommandName)
        {
            Game.Print(">>>", Text.Trim());

            switch (CommandName.Inner)
            {
            case "list_all": {
                foreach (string Identifier in Game.Nicknames.Values)
                {
                    Game.Print(Identifier);
                }
                break;
            }

            case "list_to_spawn": {
                foreach (int Id in ToSpawn)
                {
                    Game.Print(Game.Nicknames[Id]);
                }
                break;
            }

            case "add_to_spawn": {
                if (Tokenizer.Next() is Token IdString)
                {
                    if (int.TryParse(IdString.Inner, out int Id))
                    {
                        if (Game.Alive.Contains(Id))
                        {
                            Game.Print($"Player with ID {Id} is already alive");
                        }
                        else if (Game.Nicknames.ContainsKey(Id))
                        {
                            ToSpawn.Add(Id);
                        }
                        else
                        {
                            Game.Print($"Not a known player ID: {Id}");
                        }
                    }
                    else
                    {
                        Game.Print($"Cannot parse '{IdString.Inner}' as int");
                    }
                }
                break;
            }

            case "remove_to_spawn": {
                if (Tokenizer.Next() is Token IdString)
                {
                    if (int.TryParse(IdString.Inner, out int Id))
                    {
                        if (!ToSpawn.Remove(Id))
                        {
                            Game.Print($"Player with ID {Id} was not in spawn list");
                        }
                    }
                    else
                    {
                        Game.Print($"Cannot parse '{IdString.Inner}' as int");
                    }
                }
                break;
            }

            case "add_all_to_spawn": {
                foreach (int Id in Game.Nicknames.Keys)
                {
                    if (!Game.Alive.Contains(Id))
                    {
                        ToSpawn.Add(Id);
                        Game.Print($"Added player with ID {Id} to spawn list");
                    }
                }
                break;
            }

            case "clear_to_spawn": {
                ToSpawn.Clear();
                break;
            }

            case "do_spawn": {
                foreach (int Id in ToSpawn)
                {
                    Game.ChooseSpawnPointAndDoSpawn(Id);
                }
                ToSpawn.Clear();
                break;
            }

            case "deathmatch": {
                Game.DeathmatchMode = !Game.DeathmatchMode;
                Game.Print($"Deathmatch mode is {(Game.DeathmatchMode ? "on" : "off")}");
                break;
            }

            case "clear_killfeed": {
                Game.Self.Rpc(nameof(Game.NetClearKillfeed));
                break;
            }

            case "killall": {
                foreach (int AlivePlayer in Game.Alive)
                {
                    Game.RuntimeRoot.GetNode(AlivePlayer.ToString()).RpcId(AlivePlayer, nameof(FirstPersonPlayer.NetDamage), 10000000);
                    Game.Print($"Killed {Game.Nicknames[AlivePlayer]}");
                }
                break;
            }
            }

            Game.Print();
        }
    }
Exemplo n.º 14
0
 protected virtual IEnumerator cancelEffect(AlivePlayer alive, GhostPlayer ghost)
 {
     yield  break;
 }