Ejemplo n.º 1
0
    public override void CreateChildren()
    {
        Debug.Log("Setting Up the Magic Chamber!");

        // First the focus
        Focus newFocus = Instantiate(focusPrefab).GetComponent <Focus>();

        newFocus.transform.SetParent(gameObject.transform, false);
        newFocus.name = "Focus";
        newFocus.SetParent(this);
        children.Add(newFocus);
        SetFocus(newFocus);

        // Then the condensers
        Collectors newCollectors = Instantiate(collectorsPrefab).GetComponent <Collectors>();

        newCollectors.transform.SetParent(gameObject.transform, false);
        newCollectors.name = "Collectors";
        newCollectors.SetParent(this);
        children.Add(newCollectors);
        newCollectors.CreateChildren();

        // Then the crystals
        Crystals newCrystals = Instantiate(crystalsPrefab).GetComponent <Crystals>();

        newCrystals.transform.SetParent(gameObject.transform, false);
        newCrystals.name = "Crystals";
        newCrystals.SetParent(this);
        children.Add(newCrystals);
        newCrystals.CreateChildren();

        // Then the altars
    }
Ejemplo n.º 2
0
        public override void OnDeath(Container c)
        {
            base.OnDeath(c);
            Item crystal = new Crystals(Utility.RandomMinMax(5, 15));

            crystal.Hue  = this.Hue;
            crystal.Name = "trilithium crystals";
            c.DropItem(crystal);
        }
Ejemplo n.º 3
0
    public void putOnPanel(Crystals crystal)
    {
        switch (crystal.type)
        {
        case Crystals.Type.GREEN:
            GreenEmpty.sprite2D = GreenCrystalSprite;
            return;

        case Crystals.Type.BLUE:
            BlueEmpty.sprite2D = BlueCrystalSprite;
            return;

        case Crystals.Type.RED:
            RedEmpty.sprite2D = RedCrystalSprite;
            return;
        }
    }
Ejemplo n.º 4
0
 public void setCrystal(Crystals crystals)
 {
     if (!crystals.getCrystal(CrystalColor.Blue))
     {
         crystalBlue.sprite2D = crysalNot;
     }
     if (!crystals.getCrystal(CrystalColor.Green))
     {
         crystalGreen.sprite2D = crysalNot;
     }
     if (!crystals.getCrystal(CrystalColor.Red))
     {
         crystalRed.sprite2D = crysalNot;
     }
     if (crystals.getCrystal(CrystalColor.Blue) && crystals.getCrystal(CrystalColor.Green) && crystals.getCrystal(CrystalColor.Red))
     {
         PlayerPrefs.SetInt("isCrystalsCollectedL" + level, 1);
         PlayerPrefs.Save();
     }
 }
Ejemplo n.º 5
0
        public override void Update(LiveSplitState state)
        {
            base.Update(state);

            if (IsRunning() && settings.AutoSplitter)
            {
                if (state.CurrentPhase == TimerPhase.NotRunning)
                {
                    if (randomized)
                    {
                        while (state.Run.Count > 8)
                        {
                            state.Run.RemoveAt(8);
                        }

                        for (int i = 0; i < 7; ++i)
                        {
                            if (state.Run.Count <= i)
                            {
                                state.Run.AddSegment("Crystal " + (i + 1), icon: icons["Crystal"][0]);
                            }

                            else
                            {
                                state.Run[i].Name = "Crystal " + (i + 1);
                                state.Run[i].Icon = icons["Crystal"][0];
                            }
                        }

                        if (state.Run.Count <= 7)
                        {
                            state.Run.AddSegment("Triforce");
                        }

                        else
                        {
                            state.Run[7].Name = "Triforce";
                        }
                    }

                    if (state.Run.Count < 2)
                    {
                        state.Run[0].Name = "Start";
                        state.Run.AddSegment("Triforce");
                    }

                    timer.Start();
                }

                Crystals newCrystal = (Crystals)((byte)Get <Crystals>("Crystals") - (byte)Previous <Crystals>("Crystals"));

                if (newCrystal != Crystals.NONE)
                {
                    switch (newCrystal)
                    {
                    case Crystals.CRYSTAL1:
                        state.CurrentSplit.Icon = icons["Crystal"][1];
                        break;

                    case Crystals.CRYSTAL2:
                        state.CurrentSplit.Icon = icons["Crystal"][2];
                        break;

                    case Crystals.CRYSTAL3:
                        state.CurrentSplit.Icon = icons["Crystal"][3];
                        break;

                    case Crystals.CRYSTAL4:
                        state.CurrentSplit.Icon = icons["Crystal"][4];
                        break;

                    case Crystals.CRYSTAL5:
                        state.CurrentSplit.Icon = icons["Crystal"][5];
                        break;

                    case Crystals.CRYSTAL6:
                        state.CurrentSplit.Icon = icons["Crystal"][6];
                        break;

                    case Crystals.CRYSTAL7:
                        state.CurrentSplit.Icon = icons["Crystal"][7];
                        break;

                    default:
                        break;
                    }

                    switch (Get <Dungeon>("Current Dungeon"))
                    {
                    case Dungeon.DARKPALACE:
                        state.CurrentSplit.Name = "Palace of Darkness";
                        break;

                    case Dungeon.DESERTPALACE:
                        state.CurrentSplit.Name = "Desert Palace";
                        break;

                    case Dungeon.EASTERNPALACE:
                        state.CurrentSplit.Name = "Eastern Palace";
                        break;

                    case Dungeon.ICEPALACE:
                        state.CurrentSplit.Name = "Ice Palace";
                        break;

                    case Dungeon.MISERYMIRE:
                        state.CurrentSplit.Name = "Misery Mire";
                        break;

                    case Dungeon.SKULLWOODS:
                        state.CurrentSplit.Name = "Skull Woods";
                        break;

                    case Dungeon.SWAMPPALACE:
                        state.CurrentSplit.Name = "Swamp Palace";
                        break;

                    case Dungeon.THIEVESTOWN:
                        state.CurrentSplit.Name = "Thieves' Town";
                        break;

                    case Dungeon.TOWEROFHERA:
                        state.CurrentSplit.Name = "Tower of Hera";
                        break;

                    case Dungeon.TURTLEROCK:
                        state.CurrentSplit.Name = "Turtle Rock";
                        break;

                    default:
                        state.CurrentSplit.Name = Get <Dungeon>("Current Dungeon").ToString();
                        break;
                    }

                    if (state.CurrentSplitIndex == state.Run.Count)
                    {
                        state.Run.AddSegment("Crystal " + state.CurrentSplitIndex + 2, icon: icons["Crystal"][0]);
                    }

                    timer.Split();
                }

                if (Get <ushort>("RoomID") == 0x0189)
                {
                    timer.Split();
                }
            }
        }
Ejemplo n.º 6
0
 void Awake()
 {
     instance = this;
     this.UpdateText();
 }
Ejemplo n.º 7
0
            protected override void OnTick()
            {
                int  z      = m_Map.GetAverageZ(m_X, m_Y);
                bool canFit = m_Map.CanFit(m_X, m_Y, z, 6, false, false);

                for (int i = -3; !canFit && i <= 3; ++i)
                {
                    canFit = m_Map.CanFit(m_X, m_Y, z + i, 6, false, false);

                    if (canFit)
                    {
                        z += i;
                    }
                }

                if (!canFit)
                {
                    return;
                }

                Item g = new Gold(100, 200); g.Delete();

                int r1 = (int)(Utility.RandomMinMax(80, 160) * (MyServerSettings.GetGoldCutRate() * .01));
                int r2 = (int)(Utility.RandomMinMax(200, 400) * (MyServerSettings.GetGoldCutRate() * .01));
                int r3 = (int)(Utility.RandomMinMax(400, 800) * (MyServerSettings.GetGoldCutRate() * .01));
                int r4 = (int)(Utility.RandomMinMax(800, 1200) * (MyServerSettings.GetGoldCutRate() * .01));
                int r5 = (int)(Utility.RandomMinMax(1200, 1600) * (MyServerSettings.GetGoldCutRate() * .01));

                switch (Utility.Random(21))
                {
                case 0: g = new Crystals(r1); break;

                case 1: g = new DDGemstones(r2); break;

                case 2: g = new DDJewels(r2); break;

                case 3: g = new DDGoldNuggets(r3); break;

                case 4: g = new Gold(r3); break;

                case 5: g = new Gold(r3); break;

                case 6: g = new Gold(r3); break;

                case 7: g = new DDSilver(r4); break;

                case 8: g = new DDSilver(r4); break;

                case 9: g = new DDSilver(r4); break;

                case 10: g = new DDSilver(r4); break;

                case 11: g = new DDSilver(r4); break;

                case 12: g = new DDSilver(r4); break;

                case 13: g = new DDCopper(r5); break;

                case 14: g = new DDCopper(r5); break;

                case 15: g = new DDCopper(r5); break;

                case 16: g = new DDCopper(r5); break;

                case 17: g = new DDCopper(r5); break;

                case 18: g = new DDCopper(r5); break;

                case 19: g = new DDCopper(r5); break;

                case 20: g = new DDCopper(r5); break;
                }

                g.MoveToWorld(new Point3D(m_X, m_Y, z), m_Map);

                if (0.5 >= Utility.RandomDouble())
                {
                    switch (Utility.Random(3))
                    {
                    case 0:                             // Fire column
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x3709, 10, 30, 5052);
                        Effects.PlaySound(g, g.Map, 0x208);

                        break;
                    }

                    case 1:                             // Explosion
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36BD, 20, 10, 5044);
                        Effects.PlaySound(g, g.Map, 0x307);

                        break;
                    }

                    case 2:                             // Ball of fire
                    {
                        Effects.SendLocationParticles(EffectItem.Create(g.Location, g.Map, EffectItem.DefaultDuration), 0x36FE, 10, 10, 5052);

                        break;
                    }
                    }
                }
            }