Esempio n. 1
0
 private void Evt_BroochChestSpawnServer(SpawnCard.SpawnResult spawnres)
 {
     if (!safeMode && spawnres.success)
     {
         spawnres.spawnedInstance.GetComponent <CaptainsBroochDroppod>().ServerLaunch();
     }
 }
        internal void onCardSpawned(SpawnCard.SpawnResult result)
        {
            if (result.success)
            {
                CharacterMaster component  = result.spawnedInstance.GetComponent <CharacterMaster>();
                GameObject      bodyObject = component.GetBodyObject();
                if (director.combatSquad)
                {
                    director.combatSquad.AddMember(component);
                }

                if (director.spawnEffectPrefab && NetworkServer.active)
                {
                    Vector3       origin     = result.position;
                    CharacterBody component3 = bodyObject.GetComponent <CharacterBody>();
                    if (component3)
                    {
                        origin = component3.corePosition;
                    }
                    EffectManager.SpawnEffect(director.spawnEffectPrefab, new EffectData
                    {
                        origin = origin
                    }, true);
                }
                CombatDirector.OnSpawnedServer onSpawnedServer = director.onSpawnedServer;
                if (onSpawnedServer == null)
                {
                    return;
                }
                onSpawnedServer.Invoke(result.spawnedInstance);
            }
        }
Esempio n. 3
0
        // no longer uses a hook and just activates whenever something spawns.
        public static void itemAdder(SpawnCard.SpawnResult spawnResult)
        {
            CharacterMaster enemy           = spawnResult.spawnedInstance ? spawnResult.spawnedInstance.GetComponent <CharacterMaster>() : null;
            int             stageClearCount = Run.instance.stageClearCount + 1;

            if (EnemiesWithItems.StageReq.Value == 6 && SceneManager.GetActiveScene().name == "moon" && Run.instance.loopClearCount == 0)
            {
                return;
            }
            if (stageClearCount >= EnemiesWithItems.StageReq.Value && enemy != null && enemy.teamIndex == TeamIndex.Monster)
            {
                // Fix living player count for using it with multitudes.
                CharacterMaster player = PlayerCharacterMasterController.instances[rand.Next(0, Run.instance.livingPlayerCount)].master;
                EnemiesWithItems.checkConfig(enemy.inventory, player);
            }
        }