From 8d2d7e5ebff6d61365d1d250e851d8919d346b88 Mon Sep 17 00:00:00 2001 From: 1029chris <1029chris@gmail.com> Date: Sun, 13 Nov 2016 17:13:14 -0800 Subject: Fixed some stuff up Antivirus has a dying sound Antivirus discharges when dead Dialogue changes --- antivirus.lua | 21 +++++++++++++++++++-- assets.lua | 4 +++- assets/antivirus_shutdown.ogg | Bin 0 -> 57142 bytes dialogue.lua | 8 ++++---- var.lua | 1 + window.lua | 4 ++-- 6 files changed, 29 insertions(+), 9 deletions(-) create mode 100644 assets/antivirus_shutdown.ogg diff --git a/antivirus.lua b/antivirus.lua index 158080e..b619ade 100644 --- a/antivirus.lua +++ b/antivirus.lua @@ -36,6 +36,7 @@ function updateAntivirus() end end function drawAntivirusFight() + love.graphics.setColor(255,255,255) orderWindows() if antivirus.status ~= "VIRUS FOUND!" or (v1.c.chat.msgs < 12 and scene == 2) or (v2.c.chat.msgs < 21 and scene == 3) then love.graphics.draw(win[4].cvs, win[4].x+av.shakex, win[4].y+av.shakey, 0, win[4].s) @@ -77,7 +78,11 @@ function drawAntivirusFight() if av.shake > 0 then av.shakex = math.random(av.shake,-av.shake) av.shakey = math.random(av.shake,-av.shake) - av.shake = av.shake - 0.1*sys.s + if av.dead == false then + av.shake = av.shake - 0.1*sys.s + else + av.shake = av.shake - 0.3*sys.s + end elseif av.shake < 0 then av.shake = 0 av.shakex = 0 @@ -119,10 +124,22 @@ function drawAntivirusFight() av.fireb = false end end - if av.charge < 40 then + if av.charge < 40 and av.health > 0 then av.charge = av.charge + (math.random(4,12,25,40,5,2,10)*delta)/di elseif av.charge > 40 then av.charge = 40 + elseif av.health <= 0 and av.charge > 0 then + av.charge = av.charge - (math.random(4,12,25,40,5,2,10)*delta)*5 + elseif av.health <= 0 and av.charge < 0 then + av.charge = 0 + end + if av.health <= 0 and av.dead == false then + av.dead = true + antivirus.shutdown:play() + av.shake = 50 + end + if av.dead == true then + av.health = 0 end if av.fire == true then addBullet(win[4].x+138/2+99,win[4].y+5-av.gun,math.rad(-90),25,"av") diff --git a/assets.lua b/assets.lua index d2b722e..5b99c9a 100644 --- a/assets.lua +++ b/assets.lua @@ -91,6 +91,7 @@ function loadAssets(id) music.battle2:setLooping(true) music.tension2:setLooping(true) music.battleUndertale:setLooping(true) + music.battle2part2:setLooping(true) end if id == 7 then window = { @@ -152,7 +153,8 @@ function loadAssets(id) laser = love.audio.newSource("assets/antivirus_laser.ogg"), bullet = love.graphics.newImage("assets/bullet_blue.png"), hit = love.audio.newSource("assets/antivirus_hit.ogg"), - charge = love.graphics.newImage("assets/antivirus_charge.png") + charge = love.graphics.newImage("assets/antivirus_charge.png"), + shutdown = love.audio.newSource("assets/antivirus_shutdown.ogg") } end if id == 12 then diff --git a/assets/antivirus_shutdown.ogg b/assets/antivirus_shutdown.ogg new file mode 100644 index 0000000..1352dbd Binary files /dev/null and b/assets/antivirus_shutdown.ogg differ diff --git a/dialogue.lua b/dialogue.lua index 6a9bab0..2e6d549 100644 --- a/dialogue.lua +++ b/dialogue.lua @@ -227,7 +227,7 @@ function loadDia() v2.msgs[3] = "But I have to keep doing this! If I give up, then another virus will take my place." v2.msgs[4] = "Then they'll be stuck in this cycle! I won't let you do that!" v2.msgs[5] = "I wouldn't wish this on my worst enemy." - v2.msgs[16] = "Open your Antivirus, let's do this." + v2.msgs[16] = "Come on, let's go..." v2.msgs[18] = "God, will I have to tell you to open it every time? OPEN IT!!" v2.msgs[20] = "Right, there it is." v2.msgs[22] = "Remember, The more popups are open, the faster I make money!" @@ -245,7 +245,7 @@ function loadDia() v2.msgs[3] = "This is my life now." v2.msgs[4] = "I will live this forever." v2.msgs[5] = "I wouldn't wish this on my worst enemy." - v2.msgs[16] = "Open your Antivirus, let's do this." + v2.msgs[16] = "Alright, lets go..." v2.msgs[18] = "God, will I have to tell you to open it every time? OPEN IT!!" v2.msgs[20] = "Right, there it is." v2.msgs[22] = "Remember, The more popups are open, the faster I make money." @@ -259,10 +259,10 @@ function loadDia() v2.msgs[53] = "Bye. See you soon..." end v2.msgs[25] = "No! You can't beat me! This is ridiculous!" - v2.msgs[26] = "Screw the popups, no amount of money is worth dying for! I'll just attack you directly!" + v2.msgs[26] = "Screw the popups, no amount of money is worth being deleted! I'll just attack you directly!" v2.msgs[27] = "Sucks for you! You have to care about your own health now!" v2.msgs[28] = "I'm not the one whose going to die today, that's for sure!" - v2.msgs[29] = "I refuse to die like that green tentacled idiot! Time for you to face my full power!" + v2.msgs[29] = "I refuse to kick the bucket like that green tentacled idiot! Time for you to face my full power!" v2.msgs[31] = "WOAH WOAH WOAH! WAIT! WAIT!!!" v2.msgs[32] = "We don't have to end it like this! Could we... work something out?" v2.msgs[33] = "I could give you money! Tons of money! Please, just let me live..." diff --git a/var.lua b/var.lua index d7aa04d..6b04adc 100644 --- a/var.lua +++ b/var.lua @@ -96,6 +96,7 @@ function loadVar() av.shakex = 0 av.shakey = 0 av.health = 40 + av.dead = false chat.status = 0 chat.profilename = "Best Friend" chat.msg = "" diff --git a/window.lua b/window.lua index 21cf1e0..ec1e958 100644 --- a/window.lua +++ b/window.lua @@ -96,9 +96,9 @@ function drawWindow(id) if sys.mouse.drag == true and win[id].min == false and win[id].ex == false and layer[1] == id then if id == 4 and v1.yes == true then windowMouseMove(id,0,sys.w-win[id].w,sys.h/2,sys.h-win[id].h-panel.thick-1) - elseif id == 4 and v2.start == true then + elseif id == 4 and v2.start == true and av.dead == false then windowMouseMove(id,0,sys.w-win[id].w,sys.h/2.4,sys.h-win[id].h-panel.thick-1) - else + elseif scene == 1 and v1.yes == false and v2.start == false and av.dead == false then windowMouseMove(id,0,sys.w-win[id].w,0,sys.h-win[id].h-panel.thick-1) end end -- cgit