From 06153021393c736a3e1a15f388d5d8dca6844748 Mon Sep 17 00:00:00 2001 From: 1029chris <1029chris@gmail.com> Date: Sat, 12 Nov 2016 01:35:58 -0800 Subject: Fixed some bugs, Z can now be used to see next message --- dialogue.lua | 6 +++--- internet.lua | 31 ------------------------------- main.lua | 43 +++++++++++++++++++++++++++++++++++++++++++ system.lua | 13 ++++++++++--- virus1.lua | 21 +++++++++++---------- virus2.lua | 17 +++++++++++++---- 6 files changed, 80 insertions(+), 51 deletions(-) diff --git a/dialogue.lua b/dialogue.lua index be0f0c9..6a9bab0 100644 --- a/dialogue.lua +++ b/dialogue.lua @@ -23,7 +23,7 @@ function loadDia() msgstime = {30,35,40,45,50,55,60,65,160,190,230,270,300,330,360,390,430,460,490,520,600} msgssent = 0 if virus1Lose == 0 then - v1.msgs[1] = "Well well well, who do we have here? Oh, and before I forget... Click on the bubble to see my next message." + v1.msgs[1] = "Well well, who do we have here? Before I forget... Click on the bubble or press Z to see my next message." v1.msgs[2] = "Cliche introductions out of the way, I'm here to take over your computer!" v1.msgs[3] = "Who the hell uses freedownloads.com anyways? Like, how freakin' stupid are you?" v1.msgs[4] = "This shouldn't be too difficult then. From this point forward, this computer is MINE! Ha! HAHA!" @@ -166,8 +166,8 @@ function loadDia() end v2.msgs[3] = "How are you doing this? This doesn't make any sense!" v2.msgs[4] = "I destoryed your computer! I... what is going on?" - v2.msgs[5] = "It's not time travel, I still have the money I made off of you!" - v2.msgs[6] = "This is the most bizarre thing I've ever encountered, it defies all logic..." + v2.msgs[5] = "This is the most bizarre thing I've ever encountered, it defies all logic..." + v2.msgs[6] = "Is it time travel...? Actually no, I still have the money I made off of you..." v2.msgs[7] = "Can... can you control it? Is this your doing, or someone elses?" v2.msgs[8] = "Someone like you couldn't have this power, impossible." v2.msgs[9] = "Then... whose doing it? Is this reality being controlled? Or are you just gifted?" diff --git a/internet.lua b/internet.lua index 4ae251f..34c9bfe 100644 --- a/internet.lua +++ b/internet.lua @@ -50,37 +50,6 @@ function updateInternet() internet.blinkTimer = 0 end internet.urlold = internet.url - function love.keypressed(key) - if key == "backspace" and layer[1] == 2 and v1.yes == false then - internet.url = string.sub(internet.url, 1, string.len(internet.url)-1) - if internet.url ~= internet.urlold then - win[2].update = true - internet.blink = true - internet.blinkTimer = 0 - end - end - if key == "return" or key == "kpenter" then - if layer[1] == 2 then - internet.urlc = internet.url - win[2].update = true - internet.load = 0 - elseif layer[1] == 1 and chat.msg ~= "" then - sendMessage(2, chat.msg) - if chat.status == 1 then - chatReply(string.lower(chat.msg)) - end - chat.msg = "" - end - end - if key == "backspace" and layer[1] == 1 and v1.yes == false then - chat.msg = string.sub(chat.msg, 1, string.len(chat.msg)-1) - if chat.msg ~= chat.msgold then - win[1].update = true - chat.blink = true - chat.blinkTimer = 0.5 - end - end - end function love.textinput(t) if layer[1] == 2 and v1.yes == false then internet.url = internet.url .. t diff --git a/main.lua b/main.lua index 4df98c2..542b23c 100644 --- a/main.lua +++ b/main.lua @@ -106,6 +106,49 @@ function love.keyreleased(key) pause.esc = false end end +function love.keypressed(key) + if key == "backspace" and layer[1] == 2 and v1.yes == false then + internet.url = string.sub(internet.url, 1, string.len(internet.url)-1) + if internet.url ~= internet.urlold then + win[2].update = true + internet.blink = true + internet.blinkTimer = 0 + end + end + if key == "return" or key == "kpenter" then + if layer[1] == 2 then + internet.urlc = internet.url + win[2].update = true + internet.load = 0 + elseif layer[1] == 1 and chat.msg ~= "" then + sendMessage(2, chat.msg) + if chat.status == 1 then + chatReply(string.lower(chat.msg)) + end + chat.msg = "" + end + end + if key == "backspace" and layer[1] == 1 and v1.yes == false then + chat.msg = string.sub(chat.msg, 1, string.len(chat.msg)-1) + if chat.msg ~= chat.msgold then + win[1].update = true + chat.blink = true + chat.blinkTimer = 0.5 + end + end + if key == "z" then + if v1.msgs[v1.c.chat.msgs] ~= nil then + if string.len(v1.msgs[v1.c.chat.msgs]) == string.len(v1.c.chat.msg) and v1.yes == true then + v1.c.chat.next = false + end + end + if v2.msgs[v2.c.chat.msgs] ~= nil then + if string.len(v2.msgs[v2.c.chat.msgs]) == string.len(v2.c.chat.msg) and v2.start == true then + v2.c.chat.next = false + end + end + end +end function love.mousereleased(x, y, button) if scene ~= 0 then sys.mouse.p.p = false diff --git a/system.lua b/system.lua index dd0423d..2d3f7ee 100644 --- a/system.lua +++ b/system.lua @@ -13,9 +13,16 @@ function updateSystem(dt) end if v1.complete == true and v2.start == false and v2.complete == false then v2.startTime = v2.startTime + dt - if v2.startTime >= 20 then - v2.start = true - addPopup(false, sys.w/2-300, sys.h/2-200, 600, 400, 1, false, true) + if virus2Lose == 0 then + if v2.startTime >= 20 then + v2.start = true + addPopup(false, sys.w/2-300, sys.h/2-200, 600, 400, 1, false, true) + end + elseif virus2Lose ~= 0 then + if v2.startTime >= 3 then + v2.start = true + addPopup(false, sys.w/2-300, sys.h/2-200, 600, 400, 1, false, true) + end end if v2.startTime >= v2.startPopups and v2.start == false then v2.startPopups = v2.startPopups + math.random(2,10) diff --git a/virus1.lua b/virus1.lua index 58a17ca..f43f544 100644 --- a/virus1.lua +++ b/virus1.lua @@ -225,18 +225,19 @@ function drawVirusFight1() end if v1.c.shine.s < -50 and v1.msgs[v1.c.chat.msgs] ~= nil then drawBubble(v1.c.x+40, v1.c.y-135, 300, 115, v1.c.chat.msg) - if mouseClick(v1.c.x+40,v1.c.y-135,300,110) == true and - v1.c.chat.next == false and v1.c.chat.msgs ~= 15 and + if v1.c.chat.next == false and v1.c.chat.msgs ~= 15 and v1.c.chat.msgs ~= 17 and v1.c.chat.msgs ~= 19 and v1.c.chat.msgs ~= 21 then - v1.c.chat.next = true - if v1.c.chat.msgs == 23 then - v1.c.chat.msgs = 26 - virus1Pissed = true - else - v1.c.chat.msgs = v1.c.chat.msgs + 1 + if mouseClick(v1.c.x+40,v1.c.y-135,300,110) == true or love.keyboard.isDown("z") then + v1.c.chat.next = true + if v1.c.chat.msgs == 23 then + v1.c.chat.msgs = 26 + virus1Pissed = true + else + v1.c.chat.msgs = v1.c.chat.msgs + 1 + end + v1.c.chat.char = 0 + v1.c.chat.msg = "" end - v1.c.chat.char = 0 - v1.c.chat.msg = "" end if v1.msgs[v1.c.chat.msgs] ~= nil then if string.len(v1.msgs[v1.c.chat.msgs]) ~= string.len(v1.c.chat.msg) then diff --git a/virus2.lua b/virus2.lua index aebcb7e..f18d93f 100644 --- a/virus2.lua +++ b/virus2.lua @@ -6,7 +6,7 @@ function drawVirusFight2() drawAntivirusFight() drawPopups() --love.graphics.print(#v2.sg) - if v2.fightStart == true and v2.c.chat.msgs == 24 or v2.c.chat.msgs == 30 then + if v2.fightStart == true and (v2.c.chat.msgs == 24 or v2.c.chat.msgs == 30) then v2.fightTimer = v2.fightTimer + delta if v2.c.chat.msgs == 24 then v2.c.money = v2.c.money + delta*(#v2.pop.p+1) @@ -98,7 +98,7 @@ function drawVirusFight2() end end if v2.c.chat.msgs == 30 then - local na = math.random(1,4) + local na = math.random(1,5) if na == 1 then v2.currentAttack = "rShotgun" elseif na == 2 then @@ -107,6 +107,8 @@ function drawVirusFight2() v2.currentAttack = "shotgunBundle" elseif na == 4 then v2.currentAttack = "shotgun" + elseif na == 5 then + v2.currentAttack = "shotgunFinalRow" end v2.nextAttack = math.random(10,15) end @@ -211,7 +213,10 @@ function drawVirusFight2() v2.pop.p[i].exit = true end v2.currentAttack = "shotgunFinalRow" + v2.attackNextTimer = 0 v2.nextAttack = 15 + v2.c.xd = sys.w/2 + v2.c.yd = sys.h/3 end if v2.c.money >= 500 then nextChatv2(40) @@ -264,6 +269,8 @@ function drawVirusFight2() elseif v2.fightStart == true and v2.c.chat.msgs == 26 then music.battle2:stop() music.battle2part2:play() + v2.currentAttack = "shotgunFinalRow" + v2.attackNextTimer = 0 elseif v2.fightStart == true and v2.c.chat.msgs == 31 then music.battle2part2:stop() elseif v2.fightStart == true and v2.c.chat.msgs == 34 then @@ -569,8 +576,10 @@ function drawVirus2() end if v2.c.chat.time >= 2 and v2.msgs[v2.c.chat.msgs] ~= nil then drawBubble(v2.c.x+50, v2.c.y-160, 300, 115, v2.c.chat.msg) - if mouseClick(v2.c.x+50,v2.c.y-160,300,110) == true and v2.c.chat.next == false and v2.c.chat.msgs ~= 18 then - nextChatv2() + if v2.c.chat.next == false and v2.c.chat.msgs ~= 18 then + if mouseClick(v2.c.x+50,v2.c.y-160,300,110) == true or love.keyboard.isDown("z") == true then + nextChatv2() + end end if v2.msgs[v2.c.chat.msgs] ~= nil then if string.len(v2.msgs[v2.c.chat.msgs]) ~= string.len(v2.c.chat.msg) then -- cgit