Exemple #1
0
        public static void flash(int agentid)
        {
            Agent         playerAgent = Utils.getPlayer(agentid);
            List <string> list        = new List <string>();

            for (int i = 0; i < GameController.gameController.agentList.Count; i++)
            {
                Agent agent = GameController.gameController.agentList[i];
                if (Vector2.Distance(agent.tr.position, playerAgent.tr.position) < agent.LOSRange / playerAgent.hardToSeeFromDistance && agent != playerAgent)
                {
                    Relationship relationship = agent.relationships.GetRelationship(playerAgent);
                    if (relationship != null && agent.movement.HasLOSAgent360(playerAgent) && agent.movement.HasLOSAgent360(playerAgent))
                    {
                        relStatus    relTypeCode   = relationship.relTypeCode;
                        Relationship relationship2 = playerAgent.relationships.GetRelationship(agent);
                        relStatus    relTypeCode2  = relationship2.relTypeCode;
                        //if (relTypeCode == relStatus.Annoyed || agent.relationships.GetRel(playerAgent) == "Hateful")
                        {
                            list.Add(Utils.getId(agent).ToString());
                        }
                    }
                }
            }
            if (list != null && list.Count > 0)
            {
                NetworkPackage package = new NetworkPackage(2);
                package.write(Utils.getId(GameController.gameController.playerAgent).ToString());
                package.write_string_list(list);
                RedNetwork.SendPackage(package);
            }



            //agent.relationships.SetRel(interactingAgent, "Neutral");
        }
Exemple #2
0
        public static void JoinedGame()
        {
            string         chatPlayerColor = GameController.gameController.playerAgent.objectMult.GetChatPlayerColor(GameController.gameController.playerAgent.playerColor);
            NetworkPackage package         = new NetworkPackage(1);

            package.write(GameController.gameController.playerAgent.objectMult.netId.Value.ToString());
            package.write(GameController.gameController.playerAgent.objectMult.playerUniqueID.ToString());
            package.write(chatPlayerColor);
            if (GameController.gameController.playerAgent.objectMult.gc.serverPlayer)
            {
                package.write("isServer");
            }
            else
            {
                package.write("isClient");
            }
            package.write(RedModMain.pluginVersion.ToString());
            RedNetwork.SendPackage(package);
        }