// Start is called before the first frame update void Start() { lm = FindObjectOfType <LevelManager>(); state = 0; BlueBook.SetActive(false); YellowBook.SetActive(false); DeadBook.SetActive(false); Magic.SetActive(false); DarkBackground2.SetActive(false); m_Audio = GetComponent <AudioSource>(); }
public InternalSellInfo() { Add(typeof(RecallRune), RecallRune.GetSBSellValue()); Add(typeof(BlankScroll), BlankScroll.GetSBSellValue()); Add(typeof(Spellbook), Spellbook.GetSBSellValue()); Add(typeof(ScribesPen), ScribesPen.GetSBSellValue()); Add(typeof(BrownBook), BrownBook.GetSBSellValue()); Add(typeof(TanBook), TanBook.GetSBSellValue()); Add(typeof(BlueBook), BlueBook.GetSBSellValue()); Add(typeof(RedBook), RedBook.GetSBSellValue()); }
// Start is called before the first frame update void Start() { m_Audio = GetComponent <AudioSource>(); lm = FindObjectOfType <LevelManager>(); string[] LFArr = { "C1", "T1", "H", "U1", "L", "U2" }; string[] LArr = { "E1", "X", "C2", "E2", "P", "T2", "E3", "D" }; string[] LDArr = { "E1D", "XD", "C2D", "E2D", "PD", "T2D", "E3D", "DD" }; LettersFixed = new List <GameObject>(); Letters = new List <GameObject>(); LettersDark = new List <GameObject>(); state = 0; BlueBook.SetActive(false); YellowBook.SetActive(false); DeadBook.SetActive(false); TED.SetActive(false); DarkBackground.SetActive(false); //Carpet.SetActive(false); //Light.SetActive(false); //DarkBackground2.SetActive(false); for (int i = 2; i < 8; i++) { flag += (1 << i); } for (int i = 2; i < 11; i++) { failflag += (1 << i); } foreach (string name in LDArr) { GameObject obj = GameObject.Find(name); LettersDark.Add(obj); obj.SetActive(false); } foreach (string name in LFArr) { GameObject obj = GameObject.Find(name); LettersFixed.Add(obj); obj.SetActive(false); } foreach (string name in LArr) { GameObject obj = GameObject.Find(name); Letters.Add(obj); obj.SetActive(false); } }
public InternalBuyInfo() { Add(new GenericBuyInfo("Recall Rune", typeof(RecallRune), RecallRune.GetSBPurchaseValue(), 50, 0x1f14, 0)); Add(new GenericBuyInfo("Spellbook", typeof(Spellbook), Spellbook.GetSBPurchaseValue(), 25, 0xEFA, 0)); Add(new GenericBuyInfo("Blank Scroll", typeof(BlankScroll), BlankScroll.GetSBPurchaseValue(), 500, 0x0E34, 0)); Add(new GenericBuyInfo("Scribe's Pen", typeof(ScribesPen), ScribesPen.GetSBPurchaseValue(), 50, 0xFBF, 0)); Add(new GenericBuyInfo("Book", typeof(RedBook), RedBook.GetSBPurchaseValue(), 50, 0xFF1, 0)); Add(new GenericBuyInfo("Book", typeof(BrownBook), BrownBook.GetSBPurchaseValue(), 50, 0xFEF, 0)); Add(new GenericBuyInfo("Book", typeof(TanBook), TanBook.GetSBPurchaseValue(), 50, 0xFF0, 0)); Add(new GenericBuyInfo("Book", typeof(BlueBook), BlueBook.GetSBPurchaseValue(), 50, 0xFF2, 0)); //TEST: DETERMINE SCROLLS //Add( new GenericBuyInfo( typeof( BladeSpiritsScroll ), 350, 5, 0x1F4D, 0 ) ); Add(new GenericBuyInfo(typeof(IncognitoScroll), 450, 5, 0x1F4F, 0)); Add(new GenericBuyInfo(typeof(MagicReflectScroll), 500, 5, 0x1F50, 0)); Add(new GenericBuyInfo(typeof(MindBlastScroll), 350, 5, 0x1F51, 0)); Add(new GenericBuyInfo(typeof(ParalyzeScroll), 550, 5, 0x1F52, 0)); Add(new GenericBuyInfo(typeof(PoisonFieldScroll), 450, 5, 0x1F53, 0)); Add(new GenericBuyInfo(typeof(SummonCreatureScroll), 450, 5, 0x1F54, 0)); Add(new GenericBuyInfo(typeof(DispelScroll), 800, 4, 0x1F55, 0)); Add(new GenericBuyInfo(typeof(EnergyBoltScroll), 900, 4, 0x1F56, 0)); Add(new GenericBuyInfo(typeof(ExplosionScroll), 1050, 4, 0x1F57, 0)); Add(new GenericBuyInfo(typeof(InvisibilityScroll), 900, 4, 0x1F58, 0)); Add(new GenericBuyInfo(typeof(MarkScroll), 600, 4, 0x1F59, 0)); Add(new GenericBuyInfo(typeof(MassCurseScroll), 700, 4, 0x1F5A, 0)); Add(new GenericBuyInfo(typeof(ParalyzeFieldScroll), 700, 4, 0x1F5B, 0)); Add(new GenericBuyInfo(typeof(RevealScroll), 800, 4, 0x1F5C, 0)); //Add( new GenericBuyInfo( typeof( ChainLightningScroll ), 1500, 3, 0x1F5D, 0 ) ); //Add( new GenericBuyInfo( typeof( EnergyFieldScroll ),1500, 3, 0x1F5E, 0 ) ); //Add( new GenericBuyInfo( typeof( FlamestrikeScroll ), 1750, 3, 0x1F5F, 0 ) ); //Add( new GenericBuyInfo( typeof( GateTravelScroll ), 1950, 3, 0x1F60, 0 ) ); //Add( new GenericBuyInfo( typeof( ManaVampireScroll ), 1550, 3, 0x1F61, 0 ) ); //Add( new GenericBuyInfo( typeof( MassDispelScroll ), 1500, 3, 0x1F62, 0 ) ); //Add( new GenericBuyInfo( typeof( MeteorSwarmScroll ), 1050, 3, 0x1F63, 0 ) ); //Add( new GenericBuyInfo( typeof( PolymorphScroll ), 1000, 3, 0x1F64, 0 ) ); //Add( new GenericBuyInfo( typeof( EarthquakeScroll ), 5500, 2, 0x1F65, 0 ) ); //Add( new GenericBuyInfo( typeof( EnergyVortexScroll ), 2500, 2, 0x1F66, 0 ) ); //Add( new GenericBuyInfo( typeof( ResurrectionScroll ), 6575, 2, 0x1F67, 0 ) ); //Add( new GenericBuyInfo( typeof( SummonAirElementalScroll ), 2000, 2, 0x1F68, 0 ) ); //Add( new GenericBuyInfo( typeof( SummonDaemonScroll ), 2500, 2, 0x1F69, 0 ) ); //Add( new GenericBuyInfo( typeof( SummonEarthElementalScroll ), 2000, 2, 0x1F6A, 0 ) ); //Add( new GenericBuyInfo( typeof( SummonFireElementalScroll ), 2000, 2, 0x1F6B, 0 ) ); //Add( new GenericBuyInfo( typeof( SummonWaterElementalScroll ), 2000, 2, 0x1F6C, 0 ) ); //Add( new GenericBuyInfo( typeof( DispelFieldScroll ), 500, 5, 0x1F4E, 0 ) ); }
// Start is called before the first frame update void Start() { lm = FindObjectOfType <LevelManager>(); state = 0; BlueBook.SetActive(false); YellowBook.SetActive(false); DeadBook.SetActive(false); RedHeap.SetActive(false); BlueHeap.SetActive(false); Magic.SetActive(false); GroupBubble.SetActive(false); Phone.SetActive(false); DarkBackground2.SetActive(false); Bubble.transform.parent = GroupBubble.transform; CthuluCalling.transform.parent = GroupBubble.transform; m_Audio = GetComponent <AudioSource>(); }
public override void ObjectClicked(int id, GameObject obj) { if (id == 1) { obj.SetActive(false); state = 2; } else if (id == 2) { if (state < 5) { obj.GetComponent <CharacterController2D>().isClicked = false; if (state == 2 || state == 0) { Bubble.SetActive(false); state = 3; BlueBook.SetActive(true); Dropto(BlueBook, -3.2f); } else if (state == 3) { state = 4; YellowBook.SetActive(true); Dropto(YellowBook, -3.2f); } else if (state == 4) { state = 5; DeadBook.SetActive(true); Dropto(DeadBook, -3.2f); obj.GetComponent <CharacterController2D>().isClicked = true; } m_Audio.clip = AudioDrop; m_Audio.Play(); } } else if (id == 3) { if (state == 5) { m_Audio.clip = AudioOpen; m_Audio.Play(); StartCoroutine("WaitForOpenBook"); } } }
public void TestBookCover(string author, string title) { var m = new Mobile(0x1); m.DefaultMobileInit(); var book = new BlueBook { Author = author, Title = title }; var expected = new BookHeader(m, book).Compile(); var ns = PacketTestUtilities.CreateTestNetState(); ns.SendBookCover(m, book); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public void TestBookContent() { var m = new Mobile(0x1); m.DefaultMobileInit(); var book = new BlueBook { Author = "Some Author", Title = "Some Title" }; book.Pages[0].Lines = new[] { "Some books start with actual content", "This book does not have any actual content", "Instead it has several pages of useless text" }; book.Pages[1].Lines = new[] { "Another page exists but this page:", "Has lots of: 🅵🅰🅽🅲🆈 🆃🅴🆇🆃", "And just more: 🅵🅰🅽🅲🆈 🆃🅴🆇🆃", "So everyone can read: 🅵🅰🅽🅲🆈 🆃🅴🆇🆃" }; book.Pages[2].Lines = new[] { "The end" }; var expected = new BookPageDetails(book).Compile(); var ns = PacketTestUtilities.CreateTestNetState(); ns.SendBookContent(book); var result = ns.SendPipe.Reader.TryRead(); AssertThat.Equal(result.Buffer[0].AsSpan(0), expected); }
public override void OnCast() { if (CheckSequence()) { Item item = new Dagger(); string msg = "You conjure a dagger."; switch (Utility.RandomMinMax(1, 28)) { case 1: item = new Apple(); item.Amount = Utility.RandomMinMax(1, 5); msg = "You conjure some apples."; break; case 2: item = new Arrow(); item.Amount = Utility.RandomMinMax(1, 10); msg = "You conjure some arrows."; break; case 3: item = new Backpack(); msg = "You conjure a backpack."; break; case 4: item = new Bag(); msg = "You conjure a bag."; break; case 5: item = new Bandage(); item.Amount = Utility.RandomMinMax(1, 10); msg = "You conjure some bandages."; break; case 6: item = new Bedroll(); msg = "You conjure a bedroll."; break; case 7: item = new Beeswax(); msg = "You conjure some beeswax."; break; case 8: item = new BlueBook(); msg = "You conjure a book."; break; case 9: item = new Bolt(); item.Amount = Utility.RandomMinMax(1, 10); msg = "You conjure some crossbow bolts."; break; case 10: item = new Bottle(); msg = "You conjure a bottle."; break; case 11: item = new BreadLoaf(); item.Amount = Utility.RandomMinMax(1, 5); msg = "You conjure some bread."; break; case 12: item = new Candle(); msg = "You conjure a candle."; break; case 13: item = new Club(); msg = "You conjure a club."; break; case 14: item = new Dagger(); msg = "You conjure a dagger."; break; case 15: item = new DarkYarn(); item.Amount = Utility.RandomMinMax(1, 5); msg = "You conjure some yarn."; break; case 16: item = new FloppyHat(); msg = "You conjure a hat."; break; case 17: item = new Jar(); msg = "You conjure a jar."; break; case 18: item = new Kindling(); item.Amount = Utility.RandomMinMax(1, 5); msg = "You conjure some kindling."; break; case 19: item = new Lantern(); msg = "You conjure a lantern."; break; case 20: item = new Lockpick(); msg = "You conjure a lockpick."; break; case 21: item = new OilCloth(); msg = "You conjure an oil cloth."; break; case 22: item = new Pouch(); msg = "You conjure a pouch."; break; case 23: item = new Robe(); msg = "You conjure a robe."; break; case 24: item = new Shoes(); msg = "You conjure some shoes."; break; case 25: item = new SpoolOfThread(); item.Amount = Utility.RandomMinMax(1, 5); msg = "You conjure some thread."; break; case 26: item = new TenFootPole(); msg = "You conjure a ten foot pole."; break; case 27: item = new Torch(); msg = "You conjure a torch."; break; case 28: item = new Waterskin(); msg = "You conjure a waterskin."; break; } Caster.SendMessage(msg); Caster.AddToBackpack(item); Caster.FixedParticles(0, 10, 5, 2003, Server.Items.CharacterDatabase.GetMySpellHue(Caster, 0), 0, EffectLayer.RightHand); Caster.PlaySound(0x1E2); Server.Misc.Research.ConsumeScroll(Caster, true, spellIndex, true); } FinishSequence(); }
public override void ObjectClicked(int id, GameObject Obj) { if (id == 1) { if (state < 5) { Obj.GetComponent <CharacterController2D>().isClicked = false; if (state == 0) { state = 1; BlueBook.SetActive(true); Dropto(BlueBook, -3.2f); } else if (state == 1) { state = 2; YellowBook.SetActive(true); Dropto(YellowBook, -3.2f); } else if (state == 2) { state = 3; DeadBook.SetActive(true); Dropto(DeadBook, -3.2f); Obj.GetComponent <CharacterController2D>().isClicked = true; } m_Audio.clip = AudioDrop; m_Audio.Play(); } } else if (id == 2) { if (state == 3) { foreach (GameObject obj in Letters) { obj.SetActive(true); } foreach (GameObject obj in LettersFixed) { obj.SetActive(true); } m_Audio.clip = AudioOpen; m_Audio.Play(); state = 4; } } else if (id > 2 && id < 11) { if (state >= 4) { int idx = id - 3; if (eq0(state, id)) { state = set1(state, id); Letters[idx].SetActive(false); LettersDark[idx].SetActive(true); } /* * else * { * state = set0(state, id); * Letters[idx].SetActive(true); * LettersDark[idx].SetActive(false); * } */ //Debug.Log(state); if (state == flag) { TED.SetActive(true); //Carpet.SetActive(true); //Light.SetActive(true); //Background.SetActive(false); //DarkBackground2.SetActive(true); foreach (GameObject obj in Letters) { obj.SetActive(false); } foreach (GameObject obj in LettersDark) { obj.SetActive(false); } StartCoroutine("WaitForComeDown"); m_Audio.clip = AudioTED; m_Audio.Play(); } else if (state == failflag) { StartCoroutine("WaitForFail"); } } } }
public override void ObjectClicked(int id, GameObject obj) { if (id == 2) { if (state < 5) { obj.GetComponent <CharacterController2D>().isClicked = false; if (state == 0) { state = 1; BlueBook.SetActive(true); Dropto(BlueBook, -3.2f); } else if (state == 1) { state = 2; YellowBook.SetActive(true); Dropto(YellowBook, -3.2f); } else if (state == 2) { state = 3; DeadBook.SetActive(true); Dropto(DeadBook, -3.2f); } else if (state == 3) { state = 4; BlueHeap.SetActive(true); Dropto(BlueHeap, -3.0f); } else if (state == 4) { state = 5; RedHeap.SetActive(true); Dropto(RedHeap, -1.5f); ObjectReplace(Shelf, EmptyShelf); Phone.SetActive(true); obj.GetComponent <CharacterController2D>().isClicked = true; } m_Audio.clip = state < 4 ? AudioDrop : AudioHeap; m_Audio.Play(); } } else if (id == 3) { if (state < 6) { state = 9; Magic.SetActive(true); DeadBook.SetActive(false); DarkBackground2.SetActive(true); ObjectReplace(Father, PaganFather); SetMovement(Heretic, PaganFather, new Vector2(-20.0f, 0.0f), new Vector2(10.0f, 0.0f), 3.0f); m_Audio.clip = AudioHeretic; m_Audio.Play(); StartCoroutine("WaitForRunning"); } } else if (id == 4) { if (state == 5) { state = 10; ObjectReplace(Phone, Phone2); ObjectReplace(Father, FatherCalling); m_Audio.clip = AudioPhone; m_Audio.Play(); StartCoroutine("WaitForReceiving"); } } }