X-Git-Url: http://git.megabrutal.com/?p=wgj58.git;a=blobdiff_plain;f=wgj58.js;h=ad6bbf82b9f1a34333cfada27581fb0d3c6ad444;hp=49ebc06791d9c18e20abf986c5f81ec8308efa1c;hb=cf792c3120fd82f3d5c39b1638b2b6b4bb8ae241;hpb=3273037b9e3a6188af7d24df0109abd21f885ed9 diff --git a/wgj58.js b/wgj58.js index 49ebc06..ad6bbf8 100644 --- a/wgj58.js +++ b/wgj58.js @@ -159,6 +159,7 @@ class Player extends Phaser.Sprite { takeMe(npc) { this.loadTexture(npc.key); npc.kill(); + this.disguise = npc; } } @@ -222,7 +223,8 @@ class NPC_Clara extends GameNPC { { actor: logic.player, text: "Well, maybe if we dare to joke about it, it won't happen to us..." }, { actor: this, text: "Wish it worked like that... Is it some superstition like the belief that having an umbrella with you prevents rain?" }, { actor: logic.player, text: "Nah, that actually works; it's not a superstition, but Murphy's Law!" }, - { actor: this, text: "If you say so..." } ] )); + { actor: this, text: "If you say so..." }, + { actor: this, text: "Anyway, I logged you in and opened the door for you." } ] )); logic.openDoor("cutedoor"); break; case 1: @@ -272,6 +274,11 @@ class NPC_Clara extends GameNPC { logic.gameinterface.dropNotice(this.shortname + ": Have a great day, John!"); } + actionTake() { + logic.openDoor("cutedoor"); + return super.actionTake(); + } + endTalk() { return (this.talkcount < 6); } @@ -279,8 +286,214 @@ class NPC_Clara extends GameNPC { class NPC_Carlos extends GameNPC { actionTalk() { + if (logic.clara.alive) { + switch (this.talkcount) { + case 0: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Good morning, Carlos! What's up?" }, + { actor: this, text: "Hey, John! Not too much, I'm just trying to sell some shit to this new client." }, + { actor: logic.player, text: "And so? Is it hard to convince them?" }, + { actor: this, text: "Of course, they don't want to buy. It's shit." }, + { actor: this, text: "I mean, who would want to buy shit?" }, + { actor: logic.player, text: "Yeah. Relatable... But why are you trying to sell shit? I mean, why not one of our cutting edge technologies?" }, + { actor: this, text: "They couldn't afford it." }, + { actor: logic.player, text: "Then why are you trying to sell them... anything at all? They'd better off with a cheaper company." }, + { actor: this, text: "Company policies. Plus the management instructed me to sell to them, no matter what." }, + { actor: logic.player, text: "That sucks... Well... good luck!" }, + { actor: this, text: "Thanks..." } ] )); + logic.closeDoor("cutedoor"); + logic.openDoor("carlosdoor"); + break; + case 1: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "*Sigh.* I'll probably not work here for long, if I can't sell this shit to the customer." }, + { actor: this, text: "These layoffs are terrifying. They let go of anyone for even the slightest mistake." }, + { actor: logic.player, text: "But it's not a mistake when our client doesn't buy something they don't need." }, + { actor: this, text: "Tell this to my boss..." } ] )); + break; + case 2: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "You know, generally, I think it sucks being a child. One thing I miss though, if you're a child, you're allowed to be silly." }, + { actor: this, text: "..." }, + { actor: this, text: "For example, when my Dad told me that semen is the seed of animals, I theoretized, if I'd bury some pig semen in the garden, a pig would grow out of it..." }, + { actor: this, text: "I was totally fascinated by the thought, because I really wanted to have a pet pig, but Dad wouldn't let me have one." }, + { actor: this, text: "So I thought I could grow my own pig in the garden from pig seeds!" }, + { actor: logic.player, text: "Interesting. Where are you going with this?" }, + { actor: this, text: "I don't know... sometimes I feel like I'd rather sell pig semen to our clients, heh!" }, + { actor: this, text: "Uhm..." }, + { actor: this, text: "Totally don't tell this to Saiki!" } ] )); + this.pigsemen = true; + break; + case 3: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Weren't you heading to the IT department to the right?" }, + { actor: this, text: "You know... the green department which looks way better than blue!" }, + { actor: this, text: "..." }, + { actor: this, text: "Damn, why do I have to work in blue? I just feel... so blue about it." } ] )); + break; + case 4: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Weren't you heading to the conveniently green department to the right? I guess Saiki is waiting for you." }, + { actor: this, text: "You're so lucky that you can work with her every day!" } ] )); + break; + default: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Guess you'll stay here then. It's cool, you're great company anyway." } ] )); + } + } + else { + switch (this.talkcount) { + case 0: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Good morning, Carlos!" }, + { actor: this, text: "Whoa, Clara! You have changed so much! I barely recognize you. What's up?" }, + { actor: logic.player, text: "I need to talk to Saiki at the IT department, but... my card doesn't allow me to enter there." }, + { actor: this, text: "Well... I can certainly help you with that..." }, + { actor: this, text: "..." } ] )); + break; + case 1: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Carlos. You promised to help me." }, + { actor: this, text: "Uhm... It's just... Please give me 5 mins to finish this e-mail." }, + { actor: logic.player, text: "I don't have much time, Carlos." }, + { actor: this, text: "See, it's just 5 mins, please be patient. I have a chocolate bar in the fridge. I give it to you. Feel free to have it meanwhile." }, + { actor: logic.player, text: "..." } ] )); + break; + case 2: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Time is up, Carlos!" }, + { actor: this, text: "Please give me just another min." }, + { actor: logic.player, text: "Fine. Please just give me your card and I'll help myself!" }, + { actor: this, text: "But... you know that company policies forbid that, Clara! Please just be a little more patient!" }, + { actor: logic.player, text: "You will give me your card now or you will regret!" }, + { actor: this, text: "...?" }, + { actor: this, text: "You're not gonna treat me like this. Forget it!" }, + { actor: logic.player, text: "You'll not work here tomorrow." } ] )); + break; + default: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "..." } ] )); + } + } + super.actionTalk(); + } + + actionLeave() { + if (logic.clara.alive) { + logic.gameinterface.dropNotice(this.shortname + ": Bye, John! Pass on my greetings to Saiki!"); + } + } + + actionTake() { + logic.closeDoor("cutedoor"); + logic.openDoor("carlosdoor"); + return super.actionTake(); + } + + endTalk() { + return (logic.clara.alive) || (this.talkcount < 3); + } +} + +class NPC_Saiki extends GameNPC { + actionTalk() { + if (logic.carlos.alive) { + switch (this.talkcount) { + case 0: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Hi Saiki!" }, + { actor: this, text: "Hi John! Glad you arrived, here's some work for you!" }, + { actor: logic.player, text: "Awesome! What is it?" }, + { actor: this, text: "Haha, joking! Actually, our queue is suspiciously empty for today." }, + { actor: logic.player, text: "Yeah... That's really suspicious!" }, + { actor: logic.player, text: "Maybe I can get home today in time?" }, + { actor: this, text: "You mean, you wouldn't spend the mandatory free extra working hours?" }, + { actor: this, text: "You steal from the company! The company needs your unpaid hours of work! Otherwise, how would we finance the trash can I ordered for the department?" }, + { actor: this, text: "*Whispers with wink.* I hope you get my sarcasm." }, + { actor: logic.player, text: "Haha! I always get it, Saiki!" } ] )); + logic.closeDoor("carlosdoor"); + logic.openDoor("saikidoor"); + break; + case 1: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Now that I think about it, there's still one thing. You could look into why the access control system is acting so funny today." }, + { actor: this, text: "Clara has to enter people manually." }, + { actor: logic.player, text: "Yeah, I'll definitely check that." } ] )); + break; + case 2: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "So... what's up with the trash can?" }, + { actor: this, text: "I'm always up for such deep conversation" }, + { actor: this, text: "about trash cans." }, + { actor: this, text: "While we only have one trash can, other departments seem to be abundant of them. And ours is always filled. So I requested an additional trash can." }, + { actor: this, text: "Now the ticket is in PENDING status. The latest work note is from two months ago, telling there is no budget at the moment." }, + { actor: logic.player, text: "Hmm... Maybe it's too much to ask. Can we take one from another department?" }, + { actor: this, text: "No, everyone holds on to their trash cans." }, + { actor: logic.player, text: "You certainly did your research." }, + { actor: this, text: "Of course. It's an important subject." } ] )); + break; + case 3: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "My parents named me after a Japanese rock singer." }, + { actor: logic.player, text: "Cool! Which band?" }, + { actor: this, text: "I don't remember the band name. But the particular singer has a blue rose in her hair most of the time." } ] )); + break; + default: + if ((logic.carlos.pigsemen) && (this.talkcount == 4)) { + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "Did you know that Carlos thought he can grow a pig by burying pig semen in the ground? What do you think about this?" }, + { actor: this, text: "Hmm..." }, + { actor: this, text: "I guess it didn't work." }, + { actor: this, text: "So do you want to know what I think about this?" }, + { actor: this, text: "..." }, + { actor: this, text: "IT'S BRILLIANT!!!" }, + { actor: this, text: "You know, it really sparkled my artistic vision! Now I must draw a pig with its legs rooted into the ground!" }, + { actor: logic.player, text: "That's gross. Poor pig." }, + { actor: this, text: "Indeed. But this is the point. He's stuck in one place, cannot move. Like you in life. So you feel sympathy for him." }, + { actor: logic.player, text: "You have a point." }, + { actor: this, text: "I think I'll catch Carlos and talk to him. I always liked that guy but I didn't know he's such imaginative." } ] )); + //this.offscreenTeleportation(new Phaser.Point(logic.carlos.x + 128, logic.carlos.y), this.tpdone); + } + else { + if (Phaser.Math.random() < 0.5) { + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "I've found an orchestrated rendition of „Potential for Anything”. You'll have to check it out, it's breathtaking!" } ] )); + } + else { + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "I don't like that our department is green. The blue one, where Carlos works, looks much better." } ] )); + } + } + } + } + else { + switch (this.talkcount) { + case 0: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "I love you, Saiki!" }, + { actor: this, text: "Hi Carlos..." }, + { actor: logic.player, text: "I'm infatuated by the mere thought of you." }, + { actor: this, text: "Well... it sounds pretty much creepy." }, + { actor: logic.player, text: "Will you go out on a date with me?" }, + { actor: this, text: "..." }, + { actor: this, text: "Sorry to hurt your feelings, but... even though I like you... Your sudden, unprecedented confession makes me scared." }, + { actor: this, text: "Especially with that facial expression." }, + { actor: this, text: "I mean... you're not even joking." }, + { actor: this, text: "So sorry... I won't date you." } ] )); + break; + case 1: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "I thought I could impress you." }, + { actor: this, text: "I'm sorry." } ] )); + break; + case 2: + logic.gameinterface.talk(new Dialogue( [ { actor: logic.player, text: "You will give me your card." }, + { actor: this, text: "Geez, what for? Go back to your department and work!" }, + { actor: logic.player, text: "I need it." }, + { actor: this, text: "..." } ] )); + break; + default: + logic.gameinterface.talk(new Dialogue( [ { actor: this, text: "Don't you have anything better to do, Carlos?" } ] )); + } + } super.actionTalk(); - logic.endTalk(); + } + + actionLeave() { + if (logic.carlos.alive) { + logic.gameinterface.dropNotice(this.shortname + ": It was nice talking to you!"); + } + } + + actionTake() { + logic.closeDoor("carlosdoor"); + logic.openDoor("saikidoor"); + return super.actionTake(); + } + + endTalk() { + return (logic.carlos.alive); } } @@ -332,9 +545,14 @@ class GameInterface extends Phaser.Group { this.back_talk.lineTo(this.back_talk.width - 10, 35); this.add(this.back_talk); style = { align: 'left', fill: 'yellow', font: 'Ubuntu Mono', fontSize: 22, fontWeight: 'bold' }; - this.text_talktitle = new Phaser.Text(game, this.back_talk.x, this.back_talk.y, null, style); - this.text_talktitle.anchor.setTo(-0.2, -0.2); + this.text_talktitle = new Phaser.Text(game, this.back_talk.x + 15, this.back_talk.y + 6, null, style); + //this.text_talktitle.anchor.setTo(-0.2, -0.2); this.add(this.text_talktitle); + this.strikethrough_talktitle = new Phaser.Graphics(game, this.back_talk.x, this.back_talk.y); + this.strikethrough_talktitle.lineStyle(3, Phaser.Color.RED, 1); + this.strikethrough_talktitle.moveTo(12, 20); + this.strikethrough_talktitle.lineTo(67, 20); + this.add(this.strikethrough_talktitle); style = { align: 'left', fill: 'white', font: 'Ubuntu Mono', fontSize: 18, fontWeight: 'bold' }; this.text_talk = new Phaser.Text(game, this.back_talk.x + 35, this.back_talk.y + 40, null, style); this.text_talk.wordWrap = true; @@ -397,6 +615,7 @@ class GameInterface extends Phaser.Group { this.dialogue = null; this.back_talk.visible = false; this.text_talktitle.visible = false; + this.strikethrough_talktitle.visible = false; this.text_talk.visible = false; } @@ -405,7 +624,14 @@ class GameInterface extends Phaser.Group { console.log(this.dialogue.actual()); var actualdialogue = this.dialogue.actual(); if (actualdialogue) { - this.text_talktitle.text = actualdialogue.actor.shortname; + if (actualdialogue.actor.disguise) { + this.text_talktitle.text = actualdialogue.actor.shortname + " " + actualdialogue.actor.disguise.shortname; + this.strikethrough_talktitle.visible = true; + } + else { + this.text_talktitle.text = actualdialogue.actor.shortname; + this.strikethrough_talktitle.visible = false; + } this.text_talk.text = actualdialogue.text; this.dialogue.advance(); } @@ -480,6 +706,10 @@ class GameLogic { newChar = new NPC_Carlos(object.x, object.y, 'carlos', "Carlos", "Carlos Elbacalper", 150); this.carlos = newChar; break; + case 'saiki': + newChar = new NPC_Saiki(object.x, object.y, 'saiki', "Saiki", "Saiki Ytpme", 150); + this.saiki = newChar; + break; default: console.error("Unknown character:", object); }