public static void Register()
    {
        style = Settings.GetChoice("style");
        OnScreenInterface.Register(new OSIBossHPBar(), OnScreenInterface.LAYER_INTERFACE_SCREEN);

        if (style == "circular_bottomleft")
        {
            dss1 = new DepthStencilState {
                StencilEnable     = true,
                StencilFunction   = CompareFunction.Equal,
                StencilPass       = StencilOperation.Increment,
                ReferenceStencil  = 0,
                DepthBufferEnable = false,
            };
            bs1 = new BlendState();
            bs1.ColorWriteChannels = ColorWriteChannels.None;

            dss2 = new DepthStencilState {
                StencilEnable     = true,
                StencilFunction   = CompareFunction.NotEqual,
                StencilPass       = StencilOperation.Keep,
                ReferenceStencil  = 0,
                DepthBufferEnable = false,
            };

            rt = new RenderTarget2D(
                Config.mainInstance.graphics.GraphicsDevice,
                1920,
                96,
                false, Config.mainInstance.graphics.GraphicsDevice.DisplayMode.Format, DepthFormat.Depth24Stencil8
                );
            sb = new SpriteBatch(Config.mainInstance.graphics.GraphicsDevice);
        }
    }
Example #2
0
 public static void Register()
 {
     OnScreenInterface.Register(new OSIBossHPBar(), OnScreenInterface.LAYER_INTERFACE_SCREEN);
 }
Example #3
0
 public static void Register()
 {
     OnScreenInterface.Register(new OSIEffects(), OnScreenInterface.LAYER_TILE);
 }
Example #4
0
 public static void Register()
 {
     OnScreenInterface.Register(new OSICrafting(), OnScreenInterface.LAYER_INTERFACE_SCREEN);
 }
Example #5
0
        private void Awake()
        {
            Tilemap.CompressBounds();
            FindValidPositions();
            SetupItems();

            // UI Stuff
            if (onScreenInterfacePrefab != null)
            {
                onScreenInterfacePrefab = Instantiate(onScreenInterfacePrefab);
                onScreenInterface       = onScreenInterfacePrefab.GetComponent <OnScreenInterface>();
            }
            else
            {
                Debug.LogWarning("Please add UI references in scene");
            }

            // Zone Stuff
            foreach (Zone zone in Zones)
            {
                Vector3[] tileSpawnPositions = zone.TilePositions.Intersect(ValidSpawnPositions).ToArray();
                for (int i = 0; i < zone.ItemsInZone && tileSpawnPositions.Any(); i++)
                {
                    int roll = Random.Range(0, _rarityTotal);
                    if (roll < (int)Item.ItemRarity.Common)
                    {
                        SpawnItem(tileSpawnPositions, Item.ItemRarity.Common, zone);
                    }
                    else if (roll < (int)Item.ItemRarity.Common + (int)Item.ItemRarity.Uncommon)
                    {
                        SpawnItem(tileSpawnPositions, Item.ItemRarity.Uncommon, zone);
                    }
                    else if (roll < (int)Item.ItemRarity.Common + (int)Item.ItemRarity.Uncommon +
                             (int)Item.ItemRarity.Rare)
                    {
                        SpawnItem(tileSpawnPositions, Item.ItemRarity.Rare, zone);
                    }
                    else if (roll < (int)Item.ItemRarity.Common + (int)Item.ItemRarity.Uncommon +
                             (int)Item.ItemRarity.Uncommon + (int)Item.ItemRarity.UltraRare)
                    {
                        SpawnItem(tileSpawnPositions, Item.ItemRarity.UltraRare, zone);
                    }
                }
            }

            // Network Spawning Stuff
            if (SceneManager.GetActiveScene().name == "Networking_Scene")
            {
                SpawnNetworkedPlayer();

                if (NetworkManager.Instance.IsServer)
                {
                    for (int i = 0; i < _npcCount; i++)
                    {
                        SpawnNetworkedNPC();
                    }
                }
            }
            else
            {
                SpawnCharacter(playerPrefab, false);

                for (int i = 0; i < _otherPlayerCount; i++)
                {
                    SpawnCharacter(otherPlayerPrefab, true);
                }

                for (int i = 0; i < _npcCount; i++)
                {
                    SpawnCharacter(NonPlayerCharacterPrefab, false);
                }
            }
        }
 public static void Register()
 {
     OnScreenInterface.Register(new OSIHPBars(), OnScreenInterface.LAYER_INTERFACE_WORLD);
 }
 public static void Register()
 {
     OnScreenInterface.Register(new OSIAchievements(), OnScreenInterface.LAYER_INTERFACE_SCREEN);
 }