コード例 #1
0
        public static void PM(string[] args)
        {
            var player = PhotonPlayer.Find(Convert.ToInt32(args[1]));
            var msg    = "";

            for (var i = 2; i < args.Length; i++)
            {
                msg += args[i] + (i == args.Length - 1 ? "" : " ");
            }

            var    myName = RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties["name"]).hexColor();
            string sendName;

            switch (RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties["RCteam"]))
            {
            case 1:
                sendName = "<color=cyan>" + myName + "</color>";
                break;

            case 2:
                sendName = "<color=magenta>" + myName + "</color>";
                break;

            default:
                sendName = myName;
                break;
            }

            FengGameManagerMKII.FGM.photonView.RPC("ChatPM", player, sendName, msg);
            AddLineChat(ChatFormatting("To ", Settings.ChatMajorColorSetting, Settings.ChatMajorFormatSettings[0], Settings.ChatMajorFormatSettings[1], Settings.ChatSizeSetting.ToString()) + ChatFormatting($" [{player.ID}] {player.Name.hexColor()}", Settings.ChatMinorColorSetting, Settings.ChatMinorFormatSettings[0], Settings.ChatMinorFormatSettings[1], Settings.ChatSizeSetting.ToString()) + ChatFormatting($": {msg}", Settings.ChatMajorColorSetting, Settings.ChatMajorFormatSettings[0], Settings.ChatMajorFormatSettings[1], Settings.ChatSizeSetting.ToString()));
        }
コード例 #2
0
    public void Explode(float radius)
    {
        this.disabled = true;
        base.GetComponent <Rigidbody>().velocity = Vector3.zero;
        Vector3 position = base.transform.position;

        this.myExplosion = PhotonNetwork.Instantiate("RCAsset/BombExplodeMain", position, Quaternion.Euler(0f, 0f, 0f), 0);
        foreach (Hero hero in FengGameManagerMKII.instance.getPlayers())
        {
            GameObject gameObject = hero.gameObject;
            if (((Vector3.Distance(gameObject.transform.position, position) < radius) && !gameObject.GetPhotonView().isMine) && !hero.bombImmune)
            {
                PhotonPlayer owner = gameObject.GetPhotonView().owner;
                if (((RCSettings.teamMode > 0) && (PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam] != null)) && (owner.CustomProperties[PhotonPlayerProperty.RCteam] != null))
                {
                    int num  = RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.RCteam]);
                    int num2 = RCextensions.returnIntFromObject(owner.CustomProperties[PhotonPlayerProperty.RCteam]);
                    if ((num == 0) || (num != num2))
                    {
                        gameObject.GetComponent <Hero>().markDie();
                        gameObject.GetComponent <Hero>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]) + " " });
                        FengGameManagerMKII.instance.playerKillInfoUpdate(PhotonNetwork.player, 0);
                    }
                }
                else
                {
                    gameObject.GetComponent <Hero>().markDie();
                    gameObject.GetComponent <Hero>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, RCextensions.returnStringFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.name]) + " " });
                    FengGameManagerMKII.instance.playerKillInfoUpdate(PhotonNetwork.player, 0);
                }
            }
        }
        base.StartCoroutine(this.WaitAndFade(1.5f));
    }
コード例 #3
0
ファイル: CaptureGamemode.cs プロジェクト: wellisrite/AoTTG-2
    public override void OnLevelWasLoaded(LevelInfo info, bool isMasterClient = false)
    {
        if (!FengGameManagerMKII.instance.needChooseSide && (int)FengGameManagerMKII.settings[0xf5] == 0)
        {
            if (RCextensions.returnIntFromObject(PhotonNetwork.player.CustomProperties[PhotonPlayerProperty.isTitan]) == 2)
            {
                FengGameManagerMKII.instance.checkpoint = GameObject.Find(TitanStart);
            }
            else
            {
                FengGameManagerMKII.instance.checkpoint = GameObject.Find(HumanStart);
            }
        }

        if (isMasterClient && FengGameManagerMKII.Level.SceneName == "OutSide")
        {
            GameObject[] objArray3 = GameObject.FindGameObjectsWithTag("titanRespawn");
            if (objArray3.Length <= 0)
            {
                return;
            }
            for (int i = 0; i < objArray3.Length; i++)
            {
                spawnTitanRaw(objArray3[i].transform.position, objArray3[i].transform.rotation).GetComponent <TITAN>().setAbnormalType2(TitanType.TYPE_CRAWLER, true);
            }
        }
    }
コード例 #4
0
    public static string ToEngFormat <T>(this IEnumerable <T> collection, string word = "and")
    {
        Func <T, string> func = null;
        List <string>    list = new List <string>();

        if (typeof(T).IsValueType)
        {
            foreach (T current in collection)
            {
                string item3;
                if (!string.IsNullOrEmpty(item3 = current.ToString()))
                {
                    list.Add(item3);
                }
            }
            if (func == null)
            {
                func = ((T item) => item.ToString());
            }
            list = new List <string>(Enumerable.Select <T, string>(collection, func));
        }
        else
        {
            foreach (T current2 in collection)
            {
                string item2;
                if (current2 != null && !string.IsNullOrEmpty(item2 = current2.ToString()))
                {
                    list.Add(item2);
                }
            }
        }
        return(RCextensions.HandleEngFormat(word, list));
    }
コード例 #5
0
    public static string ToEngFormat <T, T2>(this System.Collections.Generic.IEnumerable <T> collection, string word, System.Func <T, T2> select, System.Func <T2, bool> where, System.Func <T2, string> select2)
    {
        System.Collections.Generic.List <string> list = new System.Collections.Generic.List <string>();
        if (typeof(T).IsValueType)
        {
            using (System.Collections.Generic.IEnumerator <T> enumerator = collection.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    T      current = enumerator.Current;
                    T2     arg     = select(current);
                    string item;
                    if (where (arg) && !string.IsNullOrEmpty(item = select2(arg)))
                    {
                        list.Add(item);
                    }
                }
                goto IL_CE;
            }
        }
        foreach (T current2 in collection)
        {
            T2     arg;
            string item;
            if (current2 != null && (arg = select(current2)) != null && where (arg) && !string.IsNullOrEmpty(item = select2(arg)))
            {
                list.Add(item);
            }
        }
IL_CE:
        return(RCextensions.HandleEngFormat(word, list));
    }
コード例 #6
0
    public bool Instantiated(PhotonPlayer owner, GameResource type)
    {
        int num;

        if (TryGetPlayer(owner.ID, out num))
        {
            if (players[num].IsThingExcessive(type))
            {
                var player = owner;
                if (player != null && PhotonNetwork.isMasterClient)
                {
                    FengGameManagerMKII.FGM.kickPlayerRC(player, true, "spamming instantiate (" + type + ").");
                }

                RCextensions.RemoveAt(ref players, num);
                return(false);
            }
        }
        else
        {
            RCextensions.Add(ref players, new Player(owner.ID));
            players[players.Length - 1].IsThingExcessive(type);
        }

        return(true);
    }
コード例 #7
0
    public static string ToEngFormat <T>(this IEnumerable <T> collection, string word, Func <T, string> select)
    {
        List <string> list = new List <string>();

        if (typeof(T).IsValueType)
        {
            using (IEnumerator <T> enumerator = collection.GetEnumerator())
            {
                while (enumerator.MoveNext())
                {
                    T      arg = enumerator.Current;
                    string item;
                    if (!string.IsNullOrEmpty(item = select(arg)))
                    {
                        list.Add(item);
                    }
                }
                goto IL_A2;
            }
        }
        foreach (T t in collection)
        {
            string item2;
            if (t != null && !string.IsNullOrEmpty(item2 = select(t)))
            {
                list.Add(item2);
            }
        }
IL_A2:
        return(RCextensions.HandleEngFormat(word, list));
    }
コード例 #8
0
    public bool Instantiated(PhotonPlayer owner, GameResource type)
    {
        int num;

        if (this.TryGetPlayer(owner.ID, out num))
        {
            if (this.players[num].IsThingExcessive(type))
            {
                PhotonPlayer player = owner;
                if ((player != null) && PhotonNetwork.isMasterClient)
                {
                    FengGameManagerMKII.instance.kickPlayerRC(player, true, "spamming instantiate (" + type.ToString() + ").");
                }
                if ((player != null))
                {
                    if ((player != null) && !FengGameManagerMKII.instance.InternalIgnore.Contains(player))
                    {
                        FengGameManagerMKII.instance.InternalIgnorePlayer(player, "Spawned repeat items of type: " + type.ToString());
                    }
                }

                RCextensions.RemoveAt <Player>(ref this.players, num);
                return(false);
            }
        }
        else
        {
            RCextensions.Add <Player>(ref this.players, new Player(owner.ID));
            this.players[this.players.Length - 1].IsThingExcessive(type);
        }
        return(true);
    }
コード例 #9
0
ファイル: Bomb.cs プロジェクト: Jagerente/GucciGangMod
    public void Explode(float radius)
    {
        disabled           = true;
        rigidbody.velocity = Vector3.zero;
        var position = transform.position;

        myExplosion = PhotonNetwork.Instantiate("RCAsset/BombExplodeMain", position, Quaternion.Euler(0f, 0f, 0f), 0);
        foreach (HERO hero in FengGameManagerMKII.FGM.getPlayers())
        {
            var gameObject = hero.gameObject;
            if (Vector3.Distance(gameObject.transform.position, position) < radius && !gameObject.GetPhotonView().isMine&& !hero.bombImmune)
            {
                var owner = gameObject.GetPhotonView().owner;
                if (RCSettings.teamMode > 0 && PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null && owner.customProperties[PhotonPlayerProperty.RCteam] != null)
                {
                    var num  = RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]);
                    var num2 = RCextensions.returnIntFromObject(owner.customProperties[PhotonPlayerProperty.RCteam]);
                    if (num == 0 || num != num2)
                    {
                        gameObject.GetComponent <HERO>().markDie();
                        gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " ");
                        FengGameManagerMKII.FGM.playerKillInfoUpdate(PhotonNetwork.player, 0);
                    }
                }
                else
                {
                    gameObject.GetComponent <HERO>().markDie();
                    gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " ");
                    FengGameManagerMKII.FGM.playerKillInfoUpdate(PhotonNetwork.player, 0);
                }
            }
        }

        StartCoroutine(WaitAndFade(1.5f));
    }
コード例 #10
0
ファイル: COLOSSAL_TITAN.cs プロジェクト: Mi-Sad/guardian
    public IEnumerator loadskinE(string url)
    {
        while (!hasspawn)
        {
            yield return(null);
        }
        bool flag   = true;
        bool unload = false;

        if ((int)FengGameManagerMKII.Settings[63] == 1)
        {
            flag = false;
        }
        try
        {
            Renderer[] componentsInChildren = GetComponentsInChildren <Renderer>();
            foreach (Renderer renderer31 in componentsInChildren)
            {
                if (renderer31.name.Contains("hair"))
                {
                    if (!FengGameManagerMKII.LinkHash[2].ContainsKey(url))
                    {
                        WWW link = Guardian.Utilities.GameHelper.CreateWWW(url);
                        if (link != null)
                        {
                            yield return(link);

                            Texture2D tex = RCextensions.LoadImage(link, flag, 1000000);
                            link.Dispose();
                            if (!FengGameManagerMKII.LinkHash[2].ContainsKey(url))
                            {
                                unload = true;
                                renderer31.material.mainTexture = tex;
                                FengGameManagerMKII.LinkHash[2].Add(url, renderer31.material);
                                renderer31.material = (Material)FengGameManagerMKII.LinkHash[2][url];
                            }
                            else
                            {
                                renderer31.material = (Material)FengGameManagerMKII.LinkHash[2][url];
                            }
                        }
                    }
                    else
                    {
                        renderer31.material = (Material)FengGameManagerMKII.LinkHash[2][url];
                    }
                }
            }
        }
        finally
        {
        }
        if (unload)
        {
            FengGameManagerMKII.Instance.UnloadAssets();
        }
    }
コード例 #11
0
ファイル: WaveGamemode.cs プロジェクト: saulo1550/AoTTG-2
        public override void OnTitanKilled(string titanName)
        {
            if (!IsAllTitansDead())
            {
                return;
            }
            Wave++;
            var level = FengGameManagerMKII.Level.Name;

            if (!(RespawnMode != RespawnMode.NEWROUND && (!level.StartsWith("Custom")) || (IN_GAME_MAIN_CAMERA.gametype != GAMETYPE.MULTIPLAYER)))
            {
                foreach (var player in PhotonNetwork.playerList)
                {
                    if (RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.isTitan]) != 2)
                    {
                        FengGameManagerMKII.instance.photonView.RPC("respawnHeroInNewRound", player);
                    }
                }
            }
            if (IN_GAME_MAIN_CAMERA.gametype == GAMETYPE.MULTIPLAYER)
            {
                //this.sendChatContentInfo("<color=#A8FF24>Wave : " + this.wave + "</color>");
            }
            if (Wave > highestWave)
            {
                highestWave = Wave;
            }
            if (PhotonNetwork.isMasterClient)
            {
                FengGameManagerMKII.instance.RequireStatus();
            }
            if (!((MaxWave != 0 || Wave <= MaxWave) && (MaxWave <= 0 || Wave <= MaxWave)))
            {
                FengGameManagerMKII.instance.gameWin2();
            }
            else
            {
                int abnormal = 90;
                if (Difficulty == 1)
                {
                    abnormal = 70;
                }
                if (!IsEnabled(TitanType.TYPE_PUNK))
                {
                    FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, Wave + 2, false);
                }
                else if (Wave % _punkWave == 0)
                {
                    FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, Wave / _punkWave, true);
                }
                else
                {
                    FengGameManagerMKII.instance.spawnTitanCustom("titanRespawn", abnormal, Wave + 2, false);
                }
            }
        }
コード例 #12
0
 public void TryRemovePlayer(int playerId)
 {
     for (var i = 0; i < players.Length; i++)
     {
         if (players[i].id == playerId)
         {
             RCextensions.RemoveAt(ref players, i);
             break;
         }
     }
 }
コード例 #13
0
    public void destroyMe()
    {
        if (!disabled)
        {
            disabled = true;
            var obj2 = PhotonNetwork.Instantiate("FX/boom4", transform.position, transform.rotation, 0);
            foreach (var collider in obj2.GetComponentsInChildren <EnemyCheckCollider>())
            {
                collider.dmg = 0;
            }

            if (RCSettings.deadlyCannons == 1)
            {
                foreach (HERO hero in FengGameManagerMKII.FGM.getPlayers())
                {
                    if (hero != null && Vector3.Distance(hero.transform.position, transform.position) <= 20f && !hero.photonView.isMine)
                    {
                        var gameObject = hero.gameObject;
                        var owner      = gameObject.GetPhotonView().owner;
                        if (RCSettings.teamMode > 0 && PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null && owner.customProperties[PhotonPlayerProperty.RCteam] != null)
                        {
                            var num2 = RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]);
                            var num3 = RCextensions.returnIntFromObject(owner.customProperties[PhotonPlayerProperty.RCteam]);
                            if (num2 == 0 || num2 != num3)
                            {
                                gameObject.GetComponent <HERO>().markDie();
                                gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " ");
                                FengGameManagerMKII.FGM.playerKillInfoUpdate(PhotonNetwork.player, 0);
                            }
                        }
                        else
                        {
                            gameObject.GetComponent <HERO>().markDie();
                            gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " ");
                            FengGameManagerMKII.FGM.playerKillInfoUpdate(PhotonNetwork.player, 0);
                        }
                    }
                }
            }

            if (myTitanTriggers != null)
            {
                for (var i = 0; i < myTitanTriggers.Count; i++)
                {
                    if (myTitanTriggers[i] != null)
                    {
                        myTitanTriggers[i].isCollide = false;
                    }
                }
            }

            PhotonNetwork.Destroy(this.gameObject);
        }
    }
コード例 #14
0
ファイル: InstantiateTracker.cs プロジェクト: Mi-Sad/guardian
        public bool IsThingExcessive(GameResource gr)
        {
            int thingToCheck = GetThingToCheck(gr);

            if (thingToCheck > -1)
            {
                return(thingsToCheck[thingToCheck].KickWorthy());
            }
            RCextensions.Add(ref thingsToCheck, GameResourceToThing(gr));
            return(false);
        }
コード例 #15
0
ファイル: BombExplode.cs プロジェクト: DeadMemphis/CLRMod
 public void Start()
 {
     if (base.photonView != null)
     {
         float        num2;
         float        num3;
         float        num4;
         float        num5;
         PhotonPlayer owner = base.photonView.owner;
         if (GameSettings.teamMode > 0)
         {
             int num = RCextensions.returnIntFromObject(owner.customProperties[PhotonPlayerProperty.RCteam]);
             if (num == 1)
             {
                 base.GetComponent <ParticleSystem>().startColor = Color.cyan;
             }
             else if (num == 2)
             {
                 base.GetComponent <ParticleSystem>().startColor = Color.magenta;
             }
             else
             {
                 num2 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombR]);
                 num3 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombG]);
                 num4 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombB]);
                 num5 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombA]);
                 num5 = Mathf.Max(0.5f, num5);
                 //if (FengGameManagerMKII.RandomizeBombColor)
                 //{
                 //    System.Random rnd = new System.Random();
                 //base.GetComponent<ParticleSystem>().startColor = new Color(RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd));
                 //}
                 base.GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
             }
         }
         else
         {
             num2 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombR]);
             num3 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombG]);
             num4 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombB]);
             num5 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombA]);
             num5 = Mathf.Max(0.5f, num5);
             //if (FengGameManagerMKII.RandomizeBombColor)
             //{
             //    System.Random rnd = new System.Random();
             //    base.GetComponent<ParticleSystem>().startColor = new Color(RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd), RCextensions.NextFloat(rnd));
             //}
             base.GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
         }
         float num6 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombRadius]) * 2f;
         num6 = Mathf.Clamp(num6, 40f, 120f);
         base.GetComponent <ParticleSystem>().startSize = num6;
     }
 }
コード例 #16
0
        public bool IsThingExcessive(InstantiateTracker.GameResource gr)
        {
            int thingToCheck = this.GetThingToCheck(gr);

            if (thingToCheck > -1)
            {
                return(this.thingsToCheck[thingToCheck].KickWorthy());
            }
            RCextensions.Add <InstantiateTracker.ThingToCheck>(ref this.thingsToCheck, this.GameResourceToThing(gr));
            return(false);
        }
コード例 #17
0
    public IEnumerator CoLoadSkin(string url)
    {
        while (!hasspawn)
        {
            yield return(null);
        }

        bool flag   = true;
        bool unload = false;

        if ((int)FengGameManagerMKII.Settings[63] == 1)
        {
            flag = false;
        }

        try
        {
            foreach (Renderer renderer31 in GetComponentsInChildren <Renderer>())
            {
                if (renderer31.name.Contains("hair"))
                {
                    if (!FengGameManagerMKII.LinkHash[2].ContainsKey(url))
                    {
                        WWW link = Guardian.AntiAbuse.Validators.SkinChecker.CreateWWW(url);
                        if (link != null)
                        {
                            yield return(link);

                            // Old limit: 1MB
                            Texture2D tex = RCextensions.LoadImage(link, flag, 2000000);
                            link.Dispose();
                            if (!FengGameManagerMKII.LinkHash[2].ContainsKey(url))
                            {
                                unload = true;
                                renderer31.material.mainTexture = tex;
                                FengGameManagerMKII.LinkHash[2].Add(url, renderer31.material);
                            }
                            renderer31.material = (Material)FengGameManagerMKII.LinkHash[2][url];
                        }
                    }
                    else
                    {
                        renderer31.material = (Material)FengGameManagerMKII.LinkHash[2][url];
                    }
                }
            }
        }
        finally { }

        if (unload)
        {
            FengGameManagerMKII.Instance.UnloadAssets();
        }
    }
コード例 #18
0
 public void TryRemovePlayer(int playerId)
 {
     for (int i = 0; i < this.players.Length; i++)
     {
         if (this.players[i].id == playerId)
         {
             RCextensions.RemoveAt <Player>(ref this.players, i);
             break;
         }
     }
 }
コード例 #19
0
        public bool IsResourceExcessive(GameResource gr)
        {
            int thingToCheck = GetResourceData(gr);

            if (thingToCheck > -1)
            {
                return(Resources[thingToCheck].KickWorthy());
            }
            RCextensions.Add(ref Resources, GameResourceToResourceData(gr));
            return(false);
        }
コード例 #20
0
ファイル: SpawnController.cs プロジェクト: nonconforme/AoTMod
    private void handleWaveEnd()
    {
        if (this.currentWave + 1 <= this.maximumWave)
        {
            this.currentWave++;

            if (this.customWaves.ContainsKey(this.currentWave))
            {
                this.spawnCustomWaveTitans();
            }
            else
            {
                int titanAmount = 0;

                this.mathParser.LocalVariables["Wave"]        = this.currentWave;
                this.mathParser.LocalVariables["PlayerCount"] = PhotonNetwork.playerList.Length;

                try {
                    titanAmount = (int)this.mathParser.Parse(this.titanAmountFunction);
                } catch (System.Exception e) {
                    ModMain.instance.log(e);
                    this.mode = SpawnControllerMode.FIXED_SPAWN;
                    ModMain.instance.sendToPlayer("Your function for the amount of titans to spawn had an error.");
                    ModMain.instance.sendToPlayer("Please make sure it is correct. Meanwhile, the mode has been set to FixedSpawns");

                    this.handleFixedSpawnEnd();
                }

                if (titanAmount > this.maxAllowedTitans)
                {
                    this.titansToSpawn = titanAmount - this.maxAllowedTitans;
                }

                this.spawnTitans(Mathf.Min(this.maxAllowedTitans, titanAmount));
            }

            //Send the message
            this.sendNewWaveMessage();
            //Respawn everybody except the PTs
            foreach (PhotonPlayer player in PhotonNetwork.playerList)
            {
                if (RCextensions.returnIntFromObject(player.customProperties[PhotonPlayerProperty.isTitan]) != 2)
                {
                    ModMain.instance.getGameManager().photonView.RPC("respawnHeroInNewRound", player, null);
                }
            }
        }
        else     //We won
        {
            ModMain.instance.getGameManager().photonView.RPC("Chat", PhotonTargets.All, new object[] { "<color=#FFFF00><b>All waves completed!</b></color>", string.Empty });
            ModMain.instance.getGameManager().gameWin2();
        }
    }
コード例 #21
0
 public void destroyMe()
 {
     if (!this.disabled)
     {
         this.disabled = true;
         GameObject obj2 = PhotonNetwork.Instantiate("FX/boom4", base.transform.position, base.transform.rotation, 0);
         foreach (EnemyCheckCollider collider in obj2.GetComponentsInChildren <EnemyCheckCollider>())
         {
             collider.dmg = 0;
         }
         if (RCSettings.deadlyCannons == 1)
         {
             foreach (HERO hero in FengGameManagerMKII.instance.getPlayers())
             {
                 if (((hero != null) && (Vector3.Distance(hero.transform.position, base.transform.position) <= 20f)) && !hero.photonView.isMine)
                 {
                     GameObject   gameObject = hero.gameObject;
                     PhotonPlayer owner      = gameObject.GetPhotonView().owner;
                     if (((RCSettings.teamMode > 0) && (PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam] != null)) && (owner.customProperties[PhotonPlayerProperty.RCteam] != null))
                     {
                         int num2 = RCextensions.returnIntFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.RCteam]);
                         int num3 = RCextensions.returnIntFromObject(owner.customProperties[PhotonPlayerProperty.RCteam]);
                         if ((num2 == 0) || (num2 != num3))
                         {
                             gameObject.GetComponent <HERO>().markDie();
                             gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " " });
                             FengGameManagerMKII.instance.playerKillInfoUpdate(PhotonNetwork.player, 0);
                         }
                     }
                     else
                     {
                         gameObject.GetComponent <HERO>().markDie();
                         gameObject.GetComponent <HERO>().photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, RCextensions.returnStringFromObject(PhotonNetwork.player.customProperties[PhotonPlayerProperty.name]) + " " });
                         FengGameManagerMKII.instance.playerKillInfoUpdate(PhotonNetwork.player, 0);
                     }
                 }
             }
         }
         if (this.myTitanTriggers != null)
         {
             for (int i = 0; i < this.myTitanTriggers.Count; i++)
             {
                 if (this.myTitanTriggers[i] != null)
                 {
                     this.myTitanTriggers[i].isCollide = false;
                 }
             }
         }
         PhotonNetwork.Destroy(base.gameObject);
     }
 }
コード例 #22
0
 public bool PropertiesChanged(PhotonPlayer owner)
 {
     if (TryGetPlayer(owner.Id, out int result))
     {
         if (Players[result].IsResourceExcessive(GameResource.Name))
         {
             return(false);
         }
     }
     else
     {
         RCextensions.Add(ref Players, new Player(owner.Id));
         Players[Players.Length - 1].IsResourceExcessive(GameResource.Name);
     }
     return(true);
 }
コード例 #23
0
    public IEnumerator loadskinE(string url)
    {
        while (!this.hasspawn)
        {
            yield return(null);
        }
        bool mipmap            = true;
        bool iteratorVariable1 = false;

        if (((int)FengGameManagerMKII.settings[0x3f]) == 1)
        {
            mipmap = false;
        }
        foreach (Renderer iteratorVariable2 in this.GetComponentsInChildren <Renderer>())
        {
            if (iteratorVariable2.name.Contains("hair"))
            {
                if (!FengGameManagerMKII.linkHash[2].ContainsKey(url))
                {
                    WWW link = new WWW(url);
                    yield return(link);

                    Texture2D iteratorVariable4 = RCextensions.loadimage(link, mipmap, 0xf4240);
                    link.Dispose();
                    if (!FengGameManagerMKII.linkHash[2].ContainsKey(url))
                    {
                        iteratorVariable1 = true;
                        iteratorVariable2.material.mainTexture = iteratorVariable4;
                        FengGameManagerMKII.linkHash[2].Add(url, iteratorVariable2.material);
                        iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                    }
                    else
                    {
                        iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                    }
                }
                else
                {
                    iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                }
            }
        }
        if (iteratorVariable1)
        {
            FengGameManagerMKII.instance.unloadAssets();
        }
    }
コード例 #24
0
        public override void OnUpdate(float interval)
        {
            int num21 = 0;

            for (var num22 = 0; num22 < PhotonNetwork.playerList.Length; num22++)
            {
                PhotonPlayer targetPlayer = PhotonNetwork.playerList[num22];
                if ((!FengGameManagerMKII.ignoreList.Contains(targetPlayer.ID) && (targetPlayer.CustomProperties[PhotonPlayerProperty.dead] != null)) && (targetPlayer.CustomProperties[PhotonPlayerProperty.isTitan] != null))
                {
                    if (RCextensions.returnIntFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.isTitan]) == 1)
                    {
                        if (RCextensions.returnBoolFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.dead]) && (RCextensions.returnIntFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.deaths]) > 0))
                        {
                            if (!FengGameManagerMKII.imatitan.ContainsKey(targetPlayer.ID))
                            {
                                FengGameManagerMKII.imatitan.Add(targetPlayer.ID, 2);
                            }
                            ExitGames.Client.Photon.Hashtable propertiesToSet = new ExitGames.Client.Photon.Hashtable();
                            propertiesToSet.Add(PhotonPlayerProperty.isTitan, 2);
                            targetPlayer.SetCustomProperties(propertiesToSet);
                            FengGameManagerMKII.instance.photonView.RPC("spawnTitanRPC", targetPlayer, new object[0]);
                        }
                        else if (FengGameManagerMKII.imatitan.ContainsKey(targetPlayer.ID))
                        {
                            for (int k = 0; k < FengGameManagerMKII.instance.getPlayers().Count; k++)
                            {
                                Hero hero = (Hero)FengGameManagerMKII.instance.getPlayers()[k];
                                if (hero.photonView.owner == targetPlayer)
                                {
                                    hero.markDie();
                                    hero.photonView.RPC("netDie2", PhotonTargets.All, new object[] { -1, "noswitchingfagt" });
                                }
                            }
                        }
                    }
                    else if (!((RCextensions.returnIntFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.isTitan]) != 2) || RCextensions.returnBoolFromObject(targetPlayer.CustomProperties[PhotonPlayerProperty.dead])))
                    {
                        num21++;
                    }
                }
            }
            if (num21 <= 0)
            {
                FengGameManagerMKII.instance.gameWin2();
            }
        }
コード例 #25
0
    public IEnumerator loadskinE(string url)
    {
        while (!hasspawn)
        {
            yield return(null);
        }

        var mipmap            = Settings.MipMappingSetting;
        var iteratorVariable1 = false;

        foreach (var iteratorVariable2 in GetComponentsInChildren <Renderer>())
        {
            if (iteratorVariable2.name.Contains("hair"))
            {
                if (!FengGameManagerMKII.linkHash[2].ContainsKey(url))
                {
                    var link = new WWW(url);
                    yield return(link);

                    var iteratorVariable4 = RCextensions.loadimage(link, mipmap, 1000000);
                    link.Dispose();
                    if (!FengGameManagerMKII.linkHash[2].ContainsKey(url))
                    {
                        iteratorVariable1 = true;
                        iteratorVariable2.material.mainTexture = iteratorVariable4;
                        FengGameManagerMKII.linkHash[2].Add(url, iteratorVariable2.material);
                        iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                    }
                    else
                    {
                        iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                    }
                }
                else
                {
                    iteratorVariable2.material = (Material)FengGameManagerMKII.linkHash[2][url];
                }
            }
        }

        if (iteratorVariable1)
        {
            FengGameManagerMKII.FGM.unloadAssets();
        }
    }
コード例 #26
0
    public void Start()
    {
        if (photonView != null)
        {
            float num2;
            float num3;
            float num4;
            float num5;
            var   owner = photonView.owner;
            if (RCSettings.teamMode > 0)
            {
                var num = RCextensions.returnIntFromObject(owner.customProperties[PhotonPlayerProperty.RCteam]);
                if (num == 1)
                {
                    GetComponent <ParticleSystem>().startColor = Color.cyan;
                }
                else if (num == 2)
                {
                    GetComponent <ParticleSystem>().startColor = Color.magenta;
                }
                else
                {
                    num2 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombR]);
                    num3 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombG]);
                    num4 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombB]);
                    num5 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombA]);
                    num5 = Mathf.Max(0.5f, num5);
                    GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
                }
            }
            else
            {
                num2 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombR]);
                num3 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombG]);
                num4 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombB]);
                num5 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombA]);
                num5 = Mathf.Max(0.5f, num5);
                GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
            }

            var num6 = RCextensions.returnFloatFromObject(owner.customProperties[PhotonPlayerProperty.RCBombRadius]) * 2f;
            num6 = Mathf.Clamp(num6, 40f, 120f);
            GetComponent <ParticleSystem>().startSize = num6;
        }
    }
コード例 #27
0
    public bool PropertiesChanged(PhotonPlayer owner)
    {
        int num;

        if (this.TryGetPlayer(owner.ID, out num))
        {
            if (this.players[num].IsThingExcessive(GameResource.name))
            {
                return(false);
            }
        }
        else
        {
            RCextensions.Add <Player>(ref this.players, new Player(owner.ID));
            this.players[this.players.Length - 1].IsThingExcessive(GameResource.name);
        }
        return(true);
    }
コード例 #28
0
ファイル: BTN_choose_human.cs プロジェクト: rnetiks/FoxMod
    public bool isPlayerAllDead2()
    {
        int num  = 0;
        int num2 = 0;

        foreach (PhotonPlayer player in PhotonNetwork.playerList)
        {
            if (RCextensions.returnIntFromObject(player.customProperties[PhotonPlayerProperty.isTitan]) == 1)
            {
                num++;
                if (RCextensions.returnBoolFromObject(player.customProperties[PhotonPlayerProperty.dead]))
                {
                    num2++;
                }
            }
        }
        return(num == num2);
    }
コード例 #29
0
ファイル: PvPAhssGamemode.cs プロジェクト: saulo1550/AoTTG-2
        private static bool IsTeamAllDead(int team)
        {
            var num  = 0;
            var num2 = 0;

            foreach (var player in PhotonNetwork.playerList)
            {
                if (((player.CustomProperties[PhotonPlayerProperty.isTitan] != null) && (player.CustomProperties[PhotonPlayerProperty.team] != null)) && ((RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.isTitan]) == 1) && (RCextensions.returnIntFromObject(player.CustomProperties[PhotonPlayerProperty.team]) == team)))
                {
                    num++;
                    if (RCextensions.returnBoolFromObject(player.CustomProperties[PhotonPlayerProperty.dead]))
                    {
                        num2++;
                    }
                }
            }
            return(num == num2);
        }
コード例 #30
0
 public void Start()
 {
     if (base.photonView != null)
     {
         float        num2;
         float        num3;
         float        num4;
         float        num5;
         PhotonPlayer owner = base.photonView.owner;
         if (FengGameManagerMKII.Gamemode.TeamMode != TeamMode.Disabled)
         {
             int num = RCextensions.returnIntFromObject(owner.CustomProperties[PhotonPlayerProperty.RCteam]);
             if (num == 1)
             {
                 base.GetComponent <ParticleSystem>().startColor = Color.cyan;
             }
             else if (num == 2)
             {
                 base.GetComponent <ParticleSystem>().startColor = Color.magenta;
             }
             else
             {
                 num2 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombR]);
                 num3 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombG]);
                 num4 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombB]);
                 num5 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombA]);
                 num5 = Mathf.Max(0.5f, num5);
                 base.GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
             }
         }
         else
         {
             num2 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombR]);
             num3 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombG]);
             num4 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombB]);
             num5 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombA]);
             num5 = Mathf.Max(0.5f, num5);
             base.GetComponent <ParticleSystem>().startColor = new Color(num2, num3, num4, num5);
         }
         float num6 = RCextensions.returnFloatFromObject(owner.CustomProperties[PhotonPlayerProperty.RCBombRadius]) * 2f;
         num6 = Mathf.Clamp(num6, 40f, 120f);
         base.GetComponent <ParticleSystem>().startSize = num6;
     }
 }