Ejemplo n.º 1
0
        // Token: 0x06000005 RID: 5 RVA: 0x000021B0 File Offset: 0x000003B0
        public static GameObject SetupTrainerServerSide()
        {
            string     text       = UID.Generate().ToString();
            int        num        = PhotonNetwork.AllocateSceneViewID();
            GameObject gameObject = CustomCharacters.CreateCharacter(JuggernautTrainer.TrainerLocation, text, "SL_Character", false, null);
            Character  component  = gameObject.GetComponent <Character>();

            At.SetValue <CharacterManager.CharacterInstantiationTypes>(CharacterManager.CharacterInstantiationTypes.Item, typeof(Character), component, "m_instantiationType");
            foreach (int itemID in JuggernautTrainer.TrainerEquipment)
            {
                component.Inventory.Equipment.EquipInstantiate(ResourcesPrefabManager.Instance.GetItemPrefab(itemID) as Equipment);
            }
            component.ChangeFaction(Character.Factions.NONE, true);
            gameObject.SetActive(true);
            bool offlineMode = PhotonNetwork.offlineMode;

            if (offlineMode)
            {
                JuggernautTrainer.SetupTrainerClientSide(gameObject, num);
            }
            else
            {
                RPCManager.Instance.photonView.RPC("GetJuggernautTrainerFromServer", 0, new object[]
                {
                    text.ToString(),
                    num,
                    0
                });
            }
            return(gameObject);
        }
 public static void Postfix()
 {
     if (PhotonNetwork.isNonMasterClientInRoom)
     {
         CustomCharacters.RequestSpawnedCharacters();
     }
 }
        private static IEnumerator DelayedSpawnRoutine()
        {
            while (!NetworkLevelLoader.Instance.AllPlayerReadyToContinue && NetworkLevelLoader.Instance.IsGameplayPaused)
            {
                yield return(null);
            }

            CustomCharacters.InvokeSpawnCharacters();
        }
        public IActionResult CustomMask()
        {
            CustomCharacters customObj = new CustomCharacters();

            customObj.P    = "P,A,a,p";
            customObj.M    = "M,m";
            ViewBag.cusObj = customObj;
            return(View());
        }
Ejemplo n.º 5
0
        public override void ActivateLocally(Character _affectedCharacter, object[] _infos)
        {
            // SL.Log("summoning necromancer summon...");

            bool armyOfDeathLearned = _affectedCharacter.Inventory.SkillKnowledge.IsItemLearned(8890108);

            int maxSummons = armyOfDeathLearned
                                ? NecromancerMod.settings.Summon_MaxSummons_WithArmyOfDeath
                                : NecromancerMod.settings.Summon_MaxSummons_NoArmyOfDeath;

            int amtToSummon = armyOfDeathLearned
                                ? NecromancerMod.settings.Summon_Summoned_Per_Cast_withArmyOfDeath
                                : 1;

            if (SummonManager.SummonedCharacters.ContainsKey(_affectedCharacter.UID))
            {
                int summoned  = SummonManager.SummonedCharacters[_affectedCharacter.UID].Count;
                int toDestroy = summoned - maxSummons + amtToSummon - 1;

                while (toDestroy >= 0)
                {
                    if (SummonManager.FindWeakestSummon(_affectedCharacter.UID) is Character summon)
                    {
                        CustomCharacters.DestroyCharacterRPC(summon);
                        SummonManager.OnSummonDeath(summon);
                    }

                    toDestroy--;
                }
            }

            // custom health cost for casting
            _affectedCharacter.Stats.UseBurntHealth = NecromancerMod.settings.Summon_BurnsHealth;
            float healthcost = NecromancerMod.settings.Summon_HealthCost * _affectedCharacter.Stats.MaxHealth;

            _affectedCharacter.Stats.ReceiveDamage(healthcost);
            _affectedCharacter.Stats.UseBurntHealth = true;

            // only host should do this
            if (!PhotonNetwork.isNonMasterClientInRoom)
            {
                bool insidePlagueAura = PlagueAuraProximityCondition.IsInsidePlagueAura(_affectedCharacter.transform.position);

                var template = insidePlagueAura ? SummonManager.Ghost : SummonManager.Skeleton;
                this.SLCharacter_UID = template.UID;

                CustomCharacters.Templates.TryGetValue(this.SLCharacter_UID, out charTemplate);

                this.ExtraRpcData = _affectedCharacter.UID.ToString();

                for (int i = 0; i < amtToSummon; i++)
                {
                    base.ActivateLocally(_affectedCharacter, _infos);
                }
            }
        }
Ejemplo n.º 6
0
        // Only host calls this directly. This is the Main function for creating a summon. In our case, a skeleton minion.
        // See the "SummonSkeleton" class for an example of how this works.
        public GameObject SummonSpawn(Character caster, string summonUID, bool insidePlagueAura)
        {
            Vector3 spawnPos = caster.transform.position + (Vector3.forward * 0.5f);

            var template = insidePlagueAura ? Ghost : Skeleton;

            var character = CustomCharacters.SpawnCharacter(template, spawnPos, summonUID, caster.UID.ToString())
                            .GetComponent <Character>();

            // unsheathe
            character.SheatheInput();

            return(character.gameObject);
        }
Ejemplo n.º 7
0
        // Only host calls this directly. This is the Main function for creating a summon. In our case, a skeleton minion.
        // See the "SummonSkeleton" class for an example of how this works.
        public GameObject SummonSpawn(Character caster, string summonUID, bool insidePlagueAura)
        {
            Vector3 spawnPos = caster.transform.position + (Vector3.forward * 0.5f);

            var template = insidePlagueAura ? Ghost : Skeleton;

            var character = CustomCharacters.CreateCharacter(template, spawnPos, summonUID, caster.UID.ToString());

            // unsheathe
            character.SheatheInput();

            //// send RPC for everyone to add this character to their dictionary
            //RPCManager.Instance.SendSummonSpawn(caster.UID.ToString(), summonUID);

            return(character.gameObject);
        }
Ejemplo n.º 8
0
        public static void DestroySummon(Character summon)
        {
            if (PhotonNetwork.isNonMasterClientInRoom)
            {
                return;
            }

            foreach (var spawnList in Instance.SummonedCharacters)
            {
                if (spawnList.Value.Contains(summon.UID))
                {
                    spawnList.Value.Remove(summon.UID);
                    break;
                }
            }

            CustomCharacters.DestroyCharacterRPC(summon);
        }
 public static void Prefix()
 {
     CustomCharacters.CleanupCharacters();
 }
Ejemplo n.º 10
0
 public static void DestroySummon(Character summon)
 {
     CustomCharacters.DestroyCharacterRPC(summon);
 }