示例#1
0
        /// <summary>
        /// Load the gpd's Campaign Skulls
        /// </summary>
        public void LoadCampaignSkulls()
        {
            _gpdCampaignSkulls = new List<Skull>();

            // Load Gold Skulls
            _gpdStream.SeekTo(0x356E);

            BitArray goldSkullsBitmask = new BitArray(BitConverter.GetBytes(_gpdStream.ReadInt16()));
            for (int skullBitmaskIndex = 0; skullBitmaskIndex < 9; skullBitmaskIndex++)
            {
                Skull skull = new Skull();
                skull.Enabled = goldSkullsBitmask[skullBitmaskIndex];
                skull.SkullType = SkullType.Gold;
                skull.Name = (SkullName)skullBitmaskIndex;

                #region Skill Description
                switch (skullBitmaskIndex)
                {
                    case 0:
                        skull.Description = "Death carries a heavy price...";
                        break;
                    case 1:
                        skull.Description = "Bash your way to better health.";
                        break;
                    case 2:
                        skull.Description = "Your foes always make every saving throw.";
                        break;
                    case 3:
                        skull.Description = "Pull pin. Count to three. Throw.";
                        break;
                    case 4:
                        skull.Description = "You'll miss those eyes in the back of your head.";
                        break;
                    case 5:
                        skull.Description = "Trust us. Bring a magazine.";
                        break;
                    case 6:
                        skull.Description = "Field promotions for everyone!";
                        break;
                    case 7:
                        skull.Description = "What was once resistance is now immunity.";
                        break;
                    case 8:
                        skull.Description = "Coverage under the covenant Health Plan.";
                        break;
                }
                #endregion

                _gpdCampaignSkulls.Add(skull);
            }

            _gpdStream.SeekTo(0x3573);
            goldSkullsBitmask = new BitArray(BitConverter.GetBytes((int)(_gpdStream.ReadByte() >> 1)));
            if (goldSkullsBitmask.Length != 0)
            {
                for (int skullBitmaskIndex = 0; skullBitmaskIndex < 4; skullBitmaskIndex++)
                {
                    Skull skull = new Skull();
                    skull.Enabled = goldSkullsBitmask[skullBitmaskIndex];
                    skull.SkullType = SkullType.Silver;
                    skull.Name = (SkullName)(skullBitmaskIndex + 9);

                    #region Skill Description
                    switch (skullBitmaskIndex)
                    {
                        case 0:
                            skull.Description = "Shoot from the hip.";
                            break;
                        case 1:
                            skull.Description = "More bang for your buck.";
                            break;
                        case 2:
                            skull.Description = "Light a match...";
                            break;
                        case 3:
                            skull.Description = "But a dog beat me over the fence.";
                            break;
                    }
                    #endregion

                    _gpdCampaignSkulls.Add(skull);
                }
            }
        }
示例#2
0
        /// <summary>
        /// Load the gpd's Campaign Skulls
        /// </summary>
        public void LoadCampaignSkulls()
        {
            _gpdCampaignSkulls = new List <Skull>();

            // Load Gold Skulls
            _gpdStream.SeekTo(0x356E);

            BitArray goldSkullsBitmask = new BitArray(BitConverter.GetBytes(_gpdStream.ReadInt16()));

            for (int skullBitmaskIndex = 0; skullBitmaskIndex < 9; skullBitmaskIndex++)
            {
                Skull skull = new Skull();
                skull.Enabled   = goldSkullsBitmask[skullBitmaskIndex];
                skull.SkullType = SkullType.Gold;
                skull.Name      = (SkullName)skullBitmaskIndex;

                #region Skill Description
                switch (skullBitmaskIndex)
                {
                case 0:
                    skull.Description = "Death carries a heavy price...";
                    break;

                case 1:
                    skull.Description = "Bash your way to better health.";
                    break;

                case 2:
                    skull.Description = "Your foes always make every saving throw.";
                    break;

                case 3:
                    skull.Description = "Pull pin. Count to three. Throw.";
                    break;

                case 4:
                    skull.Description = "You'll miss those eyes in the back of your head.";
                    break;

                case 5:
                    skull.Description = "Trust us. Bring a magazine.";
                    break;

                case 6:
                    skull.Description = "Field promotions for everyone!";
                    break;

                case 7:
                    skull.Description = "What was once resistance is now immunity.";
                    break;

                case 8:
                    skull.Description = "Coverage under the covenant Health Plan.";
                    break;
                }
                #endregion

                _gpdCampaignSkulls.Add(skull);
            }

            _gpdStream.SeekTo(0x3573);
            goldSkullsBitmask = new BitArray(BitConverter.GetBytes((int)(_gpdStream.ReadByte() >> 1)));
            if (goldSkullsBitmask.Length != 0)
            {
                for (int skullBitmaskIndex = 0; skullBitmaskIndex < 4; skullBitmaskIndex++)
                {
                    Skull skull = new Skull();
                    skull.Enabled   = goldSkullsBitmask[skullBitmaskIndex];
                    skull.SkullType = SkullType.Silver;
                    skull.Name      = (SkullName)(skullBitmaskIndex + 9);

                    #region Skill Description
                    switch (skullBitmaskIndex)
                    {
                    case 0:
                        skull.Description = "Shoot from the hip.";
                        break;

                    case 1:
                        skull.Description = "More bang for your buck.";
                        break;

                    case 2:
                        skull.Description = "Light a match...";
                        break;

                    case 3:
                        skull.Description = "But a dog beat me over the fence.";
                        break;
                    }
                    #endregion

                    _gpdCampaignSkulls.Add(skull);
                }
            }
        }
示例#3
0
    void LateUpdate()
    {
        int secondsLeft = timer.GetSecondsLeft();
        int seconds     = secondsLeft % 60;
        int minutes     = secondsLeft / 60;

        int sl = seconds % DigitMeshes.Length;
        int sh = (seconds / DigitMeshes.Length) % DigitMeshes.Length;
        int ml = minutes % DigitMeshes.Length;
        int mh = (minutes / DigitMeshes.Length) % DigitMeshes.Length;


        var mhs = MinutesHigh.shape;

        mhs.mesh = DigitMeshes[mh];
        if (secondsLeft < 60 * 10)
        {
            if (MinutesHigh.isPlaying)
            {
                MinutesHigh.Stop();
            }
        }
        else
        {
            if (!MinutesHigh.isPlaying)
            {
                MinutesHigh.Play();
            }
        }
        var mls = MinutesLow.shape;

        mls.mesh = DigitMeshes[ml];
        if (secondsLeft < 60)
        {
            if (MinutesLow.isPlaying)
            {
                MinutesLow.Stop();
            }
            if (Colon.isPlaying)
            {
                Colon.Stop();
            }
        }
        else
        {
            if (!MinutesLow.isPlaying)
            {
                MinutesLow.Play();
            }
            if (!Colon.isPlaying)
            {
                Colon.Play();
            }
        }
        var shs = SecondsHigh.shape;

        shs.mesh = DigitMeshes[sh];
        if (secondsLeft < 10)
        {
            if (SecondsHigh.isPlaying)
            {
                SecondsHigh.Stop();
            }
        }
        else
        {
            if (!SecondsHigh.isPlaying)
            {
                SecondsHigh.Play();
            }
        }
        var sls = SecondsLow.shape;

        sls.mesh = DigitMeshes[sl];

        System.Action <Color> SetColor = delegate(Color c) {
            var mhm = MinutesHigh.main; mhm.startColor = c;
            var mlm = MinutesLow.main; mlm.startColor = c;
            var shm = SecondsHigh.main; shm.startColor = c;
            var slm = SecondsLow.main; slm.startColor = c;
            var cm  = Colon.main; cm.startColor = c;
            var sm  = Skull.main; sm.startColor = c;
        };

        if (timer.CurrentMode != Timer.Mode.Finished)
        {
            if (Skull.isPlaying)
            {
                Skull.Stop();
            }
        }
        else
        {
            if (!Skull.isPlaying)
            {
                Skull.Play();
            }
        }

        if (timer.CurrentMode == Timer.Mode.Talk)
        {
            var mhm = MinutesHigh.main;
            SetColor(new Color(1.0f, 1.0f, 1.0f, 1.0f));
        }
        else if (timer.CurrentMode == Timer.Mode.Bonus)
        {
            SetColor(new Color(1.0f, 0.5f, 0.5f, 1.0f));
        }
        else if (timer.CurrentMode == Timer.Mode.Questions)
        {
            SetColor(new Color(0.1f, 0.1f, 1.0f, 1.0f));
        }
        else if (timer.CurrentMode == Timer.Mode.Finished)
        {
            MinutesHigh.Stop();
            MinutesLow.Stop();
            Colon.Stop();
            SecondsHigh.Stop();
            SecondsLow.Stop();
            SetColor(new Color(1.0f, 1.0f, 1.0f, 1.0f));
        }
    }
 public void Start()
 {
     coins = FindObjectOfType <CollectCoins>();
     skull = FindObjectOfType <Skull>();
 }
    private void OnTriggerEnter2D(Collider2D other)
    {
        if (other.tag == "Player")
        {
            //check for each item available and add.
            //itemtype references the item array found under the inventoryScript
            //gameobject.
            //check if full so we can add the items
            if (InventoryScript.MyInstance.MyEmptySlotCount > 0)
            {
                if (itemType == "Leaflet")
                {
                    Leaflet leaflet = (Leaflet)Instantiate(InventoryScript.MyInstance.items[1]);
                    InventoryScript.MyInstance.AddItem(leaflet);
                }
                else if (itemType == "Egg")
                {
                    Egg egg = (Egg)Instantiate(InventoryScript.MyInstance.items[2]);
                    InventoryScript.MyInstance.AddItem(egg);
                }
                else if (itemType == "Sword")
                {
                    Sword sword = (Sword)Instantiate(InventoryScript.MyInstance.items[3]);
                    InventoryScript.MyInstance.AddItem(sword);
                }
                else if (itemType == "Trident")
                {
                    Trident trident = (Trident)Instantiate(InventoryScript.MyInstance.items[4]);
                    InventoryScript.MyInstance.AddItem(trident);
                }
                else if (itemType == "Airpump")
                {
                    AirPump ap = (AirPump)Instantiate(InventoryScript.MyInstance.items[5]);
                    InventoryScript.MyInstance.AddItem(ap);
                }
                else if (itemType == "Bar")
                {
                    PlatinumBar bar = (PlatinumBar)Instantiate(InventoryScript.MyInstance.items[6]);
                    InventoryScript.MyInstance.AddItem(bar);
                }
                else if (itemType == "Knife")
                {
                    Knife knife = (Knife)Instantiate(InventoryScript.MyInstance.items[7]);
                    InventoryScript.MyInstance.AddItem(knife);
                }
                else if (itemType == "Rope")
                {
                    Rope rope = (Rope)Instantiate(InventoryScript.MyInstance.items[8]);
                    InventoryScript.MyInstance.AddItem(rope);
                }
                else if (itemType == "Skull")
                {
                    Skull skull = (Skull)Instantiate(InventoryScript.MyInstance.items[9]);
                    InventoryScript.MyInstance.AddItem(skull);
                }
                else if (itemType == "Sack")
                {
                    Sack sack = (Sack)Instantiate(InventoryScript.MyInstance.items[10]);
                    InventoryScript.MyInstance.AddItem(sack);
                }
                else if (itemType == "Lantern")
                {
                    Lantern lantern = (Lantern)Instantiate(InventoryScript.MyInstance.items[11]);
                    InventoryScript.MyInstance.AddItem(lantern);
                }
                else if (itemType == "Bottle")
                {
                    Bottle bottle = (Bottle)Instantiate(InventoryScript.MyInstance.items[12]);
                    InventoryScript.MyInstance.AddItem(bottle);
                }
                else if (itemType == "Candle")
                {
                    Candle candle = (Candle)Instantiate(InventoryScript.MyInstance.items[13]);
                    InventoryScript.MyInstance.AddItem(candle);
                }
                else if (itemType == "BlackBook")
                {
                    BlkBook book = (BlkBook)Instantiate(InventoryScript.MyInstance.items[14]);
                    InventoryScript.MyInstance.AddItem(book);
                }
                else if (itemType == "PlasticPile")
                {
                    PlasticPile plastic = (PlasticPile)Instantiate(InventoryScript.MyInstance.items[15]);
                    InventoryScript.MyInstance.AddItem(plastic);
                }
                else if (itemType == "Buoy")
                {
                    Buoy buoy = (Buoy)Instantiate(InventoryScript.MyInstance.items[16]);
                    InventoryScript.MyInstance.AddItem(buoy);
                }
                else if (itemType == "Shovel")
                {
                    Shovel shovel = (Shovel)Instantiate(InventoryScript.MyInstance.items[17]);
                    InventoryScript.MyInstance.AddItem(shovel);
                }
                else if (itemType == "Scarab")
                {
                    Scarab scarab = (Scarab)Instantiate(InventoryScript.MyInstance.items[18]);
                    InventoryScript.MyInstance.AddItem(scarab);
                }
                else if (itemType == "PotOfGold")
                {
                    PotOfGold gold = (PotOfGold)Instantiate(InventoryScript.MyInstance.items[19]);
                    InventoryScript.MyInstance.AddItem(gold);
                }
                else if (itemType == "Bracelet")
                {
                    Bracelet bracelet = (Bracelet)Instantiate(InventoryScript.MyInstance.items[20]);
                    InventoryScript.MyInstance.AddItem(bracelet);
                }
                else if (itemType == "Coal")
                {
                    Coal coal = (Coal)Instantiate(InventoryScript.MyInstance.items[21]);
                    InventoryScript.MyInstance.AddItem(coal);
                }
                else if (itemType == "Figurine")
                {
                    Figurine fig = (Figurine)Instantiate(InventoryScript.MyInstance.items[22]);
                    InventoryScript.MyInstance.AddItem(fig);
                }
                else if (itemType == "Diamond")
                {
                    Diamond diamond = (Diamond)Instantiate(InventoryScript.MyInstance.items[23]);
                    InventoryScript.MyInstance.AddItem(diamond);
                }
                else if (itemType == "Torch")
                {
                    Torch torch = (Torch)Instantiate(InventoryScript.MyInstance.items[24]);
                    InventoryScript.MyInstance.AddItem(torch);
                }
                else if (itemType == "Coins")
                {
                    Coins coins = (Coins)Instantiate(InventoryScript.MyInstance.items[25]);
                    InventoryScript.MyInstance.AddItem(coins);
                }
                else if (itemType == "Key")
                {
                    Key key = (Key)Instantiate(InventoryScript.MyInstance.items[26]);
                    InventoryScript.MyInstance.AddItem(key);
                }
                else if (itemType == "Matches")
                {
                    Matches matches = (Matches)Instantiate(InventoryScript.MyInstance.items[27]);
                    InventoryScript.MyInstance.AddItem(matches);
                }
                else if (itemType == "Wrench")
                {
                    Wrench wrench = (Wrench)Instantiate(InventoryScript.MyInstance.items[28]);
                    InventoryScript.MyInstance.AddItem(wrench);
                }
                else if (itemType == "Screwdriver")
                {
                    Screwdriver sd = (Screwdriver)Instantiate(InventoryScript.MyInstance.items[29]);
                    InventoryScript.MyInstance.AddItem(sd);
                }
                else if (itemType == "Jewels")
                {
                    Jewels jewels = (Jewels)Instantiate(InventoryScript.MyInstance.items[30]);
                    InventoryScript.MyInstance.AddItem(jewels);
                }
                else if (itemType == "Coffin")
                {
                    Coffin coffin = (Coffin)Instantiate(InventoryScript.MyInstance.items[31]);
                    InventoryScript.MyInstance.AddItem(coffin);
                }
                else if (itemType == "Chalice")
                {
                    Chalice chalice = (Chalice)Instantiate(InventoryScript.MyInstance.items[32]);
                    InventoryScript.MyInstance.AddItem(chalice);
                }
                //the following items should not be displayed in the world
                //but going to add just in case we revamp how these items
                //are obtained.
                else if(itemType == "Garlic")
                {
                    Garlic garlic = (Garlic)Instantiate(InventoryScript.MyInstance.items[33]);
                    InventoryScript.MyInstance.AddItem(garlic);
                }
                else if(itemType == "Sceptre")
                {
                    Sceptre sep = (Sceptre)Instantiate(InventoryScript.MyInstance.items[34]);
                    InventoryScript.MyInstance.AddItem(sep);
                }






                
                Destroy(gameObject);
            }
            //probably want to utilize CLI popup here
            else
            {
                Debug.Log("Bag full");
            }
        }
        
    }