Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- class Room18 {
- PImage room18;
- PImage arrow;
- PImage openBook;
- PImage tornPage;
- PImage ritualBg1;
- PImage ritualBg2;
- PImage lamp;
- PImage dagger;
- PImage lightbringer;
- PImage elixir;
- PImage glove;
- PImage amulet;
- PImage kruisje;
- PImage flashing1;
- PImage flashing2;
- PImage lore7_1_1, lore7_1_2, lore7_1_3, lore7_2_1, lore7_2_2, lore7_2_3;
- PImage nextpage, previouspage;
- boolean firstTime;
- boolean openLoreBook;
- boolean ritual;
- boolean flashingImg1;
- boolean flashingImg2;
- boolean flash1;
- boolean flash2;
- boolean cured1;
- boolean playSound;
- boolean hint;
- String loadText;
- int timer1;
- int timer2;
- int time1;
- int time2;
- int stopFlash1;
- int stopFlash2;
- int x = 0;
- int y = 1;
- Room18() {
- room18 = loadImage("Room 18 - The_Ritual.jpg");
- openBook = loadImage("lore_open_book.png");
- tornPage = loadImage("torn_page.png");
- ritualBg1 = loadImage("ritual_background_1.png");
- ritualBg2 = loadImage("ritual_background_2.png");
- lamp = loadImage("genie_lamp.png");
- dagger = loadImage("dagger.png");
- lightbringer = loadImage("lightbringer.png");
- elixir = loadImage("vial_02.png");
- glove = loadImage("glove.png");
- amulet = loadImage("amulet.png");
- kruisje = loadImage("kruisje.png");
- flashing1 = loadImage("ritual.png");
- flashing2 = loadImage("flashing_eyes.png");
- arrow = loadImage("ARROWDOWN.png");
- lore7_1_1 = loadImage("Lore7_1_1.png");
- lore7_1_2 = loadImage("Lore7_1_2.png");
- lore7_1_3 = loadImage("Lore7_1_3.png");
- lore7_2_1 = loadImage("Lore7_2_1.png");
- lore7_2_2 = loadImage("Lore7_2_2.png");
- lore7_2_3 = loadImage("Lore7_2_3.png");
- nextpage = loadImage("nextpage_right.png");
- previouspage = loadImage("nextpage_left.png");
- }
- void Roomload() {
- isRepeating = true;
- playSound = true;
- background(room18);
- if (mouseX > 111 && mouseX <166 && mouseY > 664 && mouseY < 800) {
- image (arrow, 90, 670, 420/5, 600/5);
- }
- if (openLoreBook) {
- image(openBook, 140, 34);
- image(lore7_1_1, 202, 50, 420, 670);
- image(lore7_1_2, 685, 50, 420, 670);
- image(tornPage, 1030, 690, 60, 60);
- image(nextpage, 912, 725);
- }
- if (openLoreBook && y == 2) {
- image(openBook, 140, 34);
- image(tornPage, 1030, 690, 60, 60);
- image(previouspage, 202, 725);
- image(nextpage, 912, 725);
- image(lore7_1_3, 202, 50, 420, 492);
- image(lore7_2_1, 685, 50, 420, 670);
- }
- if (openLoreBook && y == 3) {
- image(openBook, 140, 34);
- image(tornPage, 1030, 690, 60, 60);
- image(lore7_2_2, 202, 50, 420, 436);
- image(lore7_2_3, 685, 50, 420, 298);
- image(previouspage, 202, 725);
- }
- if (ritual) {
- image(ritualBg1, 452, 163);
- image(kruisje, 765, 570, 50, 50);
- }
- if (mouseX > 607 && mouseX <688 && mouseY > 546 && mouseY <600 && ritual) {
- image(ritualBg2, 452, 163);
- image(kruisje, 765, 570, 50, 50);
- }
- if (room2.vial && ritual) {
- image(elixir, 537, 344);
- }
- if (room9.glove && ritual) {
- image(glove, 619, 346);
- }
- if (room4.lightbringer && ritual) {
- image(lightbringer, 706, 345);
- }
- if (!room5.puzzleSolved && ritual) {
- image(dagger, 530, 440);
- }
- if (room6.lamp && ritual) {
- image(lamp, 614, 453);
- }
- if (room3.amulet && ritual) {
- image(amulet, 720, 441);
- }
- if (flashingImg1) {
- if (flash1) {
- image (flashing1, 0, 0);
- }
- if (!flash1) {
- background(0);
- }
- if (millis()/100 > time1) {
- flash1 = !flash1;
- time1= time1 + 1;
- if (stopFlash1 + 6 == time1) {
- flashingImg1 = false;
- flashingImg2 = true;
- time2 = millis()/100;
- stopFlash2 = time1;
- }
- }
- }
- if (flashingImg2) {
- delay(20);
- if (flash2) {
- image (flashing2, 490, 334);
- }
- if (!flash2) {
- background(0);
- }
- if (millis()/100 > time2) {
- flash2 = !flash2;
- time2= time2 + 1;
- if (stopFlash2 + 12 == time2) {
- flashingImg2 = false;
- loadText = "ritual";
- timer2 = millis();
- cured.play();
- }
- }
- }
- if (hint && difficulty.hints && x == 1) {
- imageMode(CENTER);
- image(hintScroll, 640, 100);
- imageMode(CORNER);
- loadText = "hint1";
- showtext();
- loadText = "hint2";
- showtext();
- image(kruisje, 966, 80, 40, 40);
- }
- if (difficulty.room_cleared && cured1) {
- loadText="cleared";
- timer2 = millis();
- hint = false;
- }
- if (millis() - timer2 < 3500) {
- showtext();
- }
- if (millis () - timer1 < 6000) {
- fill(255);
- textAlign(CENTER);
- textFont(font1);
- text("The Ritual", 640, 50);
- textAlign(BASELINE);
- fill(138, 7, 7);
- }
- if (difficulty.hints){
- image(hintIcon, 1201, 49);
- }
- timer();
- if (mouseX > 862 && mouseX < 941 && mouseY > 418 && mouseY < 494 && !ritual && !cured1 && !openLoreBook) {
- cursor(cursor4, 5, 5);
- } else if (!(mouseX > 862 && mouseX < 941 && mouseY > 418 && mouseY < 494)) {
- cursor(cursor1, 5, 5);
- }
- }
- void keyCheck() {
- if (!openLoreBook) {
- if (mouseX > 975 && mouseX < 1004 && mouseY > 87 && mouseY < 123)
- {
- hint = false;
- }
- if (mouseX > 1208 && mouseX < 1253 && mouseY > 55 && mouseY < 101)
- {
- hint = true;
- x++;
- if (x==2) {
- x=1;
- }
- }
- if (!cured1) {
- if (mouseX > 776 && mouseX < 815 && mouseY > 576 && mouseY < 622 && ritual) {
- ritual = false;
- }
- if ((mouseX > 614 && mouseX < 677 && mouseY > 548 && mouseY < 594 && ritual) && (!room2.vial || !room9.glove || !room4.lightbringer || room5.puzzleSolved || !room6.lamp || !room3.amulet)) {
- loadText = "incomplete";
- timer2 = millis(); // bij toevoegen puzzel voorwaarde aanpassen.
- }
- if (mouseX > 614 && mouseX < 677 && mouseY > 548 && mouseY < 594 && ritual && room2.vial && room9.glove && room4.lightbringer && !room5.puzzleSolved && room6.lamp && room3.amulet) {
- ritual = false;
- inventory.elixirV = false;
- inventory.amuletV = false;
- inventory.daggerV = false;
- inventory.gloveV = false;
- inventory.genieLampV = false;
- cured1 = true;
- flashingImg1 = true;
- time1 = millis()/100;
- stopFlash1 = time1;
- }
- if (mouseX > 862 && mouseX < 941 && mouseY > 418 && mouseY < 494) {
- ritual = true;
- }
- }
- if (mouseX > 706 && mouseX < 756 && mouseY > 425 && mouseY < 501 && !lorebook.lore07 && !ritual) {
- openLoreBook = true;
- lorebook.lore07 = true;
- timerPause = true;
- }
- if (mouseX > 111 && mouseX < 166 && mouseY > 664 && mouseY < 800) {
- song1room16.play();
- song1room16.rewind();
- kamer = 16;
- room16.timer1 = millis();
- timer2 = 0;
- whisper.pause();
- }
- }
- if (mouseX > 820 && mouseX < 1008 && mouseY > 725 && mouseY < 760 && openLoreBook)
- {
- y++;
- if (y >= 1 && y <= 4) {
- pageflip.play();
- pageflip.rewind();
- }
- if (y==4) {
- y=3;
- }
- }
- if (mouseX > 202 && mouseX < 300 && mouseY > 725 && mouseY < 760 && openLoreBook)
- {
- y--;
- if (y >= 1 && y <= 4) {
- pageflip.play();
- pageflip.rewind();
- }
- if (y==0) {
- y=1;
- }
- }
- if (mouseX > 862 && mouseX < 941 && mouseY > 418 && mouseY < 494 && cured1) {
- loadText = "alreadyCured";
- timer2 = millis();
- }
- if (mouseX > 1000 && mouseX < 1086 && mouseY > 678 && mouseY < 783 && openLoreBook ) {
- openLoreBook = false;
- firstTime = true;
- timerPause = false;
- loadText = "tornPage";
- timer2 = millis();
- song5.play();
- song5.rewind();
- }
- }
- void showtext() {
- fill(255);
- textAlign(CENTER);
- textFont(font2);
- switch (loadText) {
- case "tornPage" :
- text("You tear these pages from the book and add them to the Book of Eye.", 640, 785);
- break;
- case "incomplete" :
- text("You do not possess all required items to perform the Ritual.", 640, 785);
- break;
- case "ritual" :
- text("You cleanse yourself from the curse.", 640, 785);
- break;
- case "alreadyCured" :
- text("You have already been cured...", 640, 785);
- break;
- case "hint1" :
- fill(0);
- text("1. Use the burning tray to perform the ritual", 600, 75);
- break;
- case "hint2" :
- fill(0);
- text("and cure yourself.", 600, 115);
- break;
- case "cleared":
- fill(255);
- text("The Ritual - Cleared", 640, 80 );
- break;
- }
- textAlign(BASELINE);
- fill(138, 7, 7);
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment