aboutsummaryrefslogtreecommitdiff
path: root/antivirus.lua
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2016-10-15 23:54:52 -0700
committer1029chris <1029chris@gmail.com>2016-10-15 23:54:52 -0700
commit41c81f2cff92d33808ab43d2ec6aab6e1703b89c (patch)
tree7e8f4d2df2ca3e9348ea5a2470bc836e84001470 /antivirus.lua
parent328a61d9e04a858107e418a0311fd6975c3ab199 (diff)
Lots of work here
moved antivirus fight function to antivirus.lua made it to antivirus fight function will work on both fights added new hands for virus 2 changed dialogue lots more
Diffstat (limited to 'antivirus.lua')
-rw-r--r--antivirus.lua96
1 files changed, 94 insertions, 2 deletions
diff --git a/antivirus.lua b/antivirus.lua
index 6dfc4a1..d5111e3 100644
--- a/antivirus.lua
+++ b/antivirus.lua
@@ -16,7 +16,7 @@ end
function updateAntivirus()
if (sys.mouse.p.p == true and win[4].hover == true and antivirus.scanning == false
and sys.mouse.p.x >= win[4].x+49 and sys.mouse.p.x <= win[4].x+49+100
- and sys.mouse.p.y >= win[4].y+110 and sys.mouse.p.y <= win[4].y+110+19 and v1.yes == false) then
+ and sys.mouse.p.y >= win[4].y+110 and sys.mouse.p.y <= win[4].y+110+19 and scene == 1) then
antivirus.scanning = true
antivirus.prog = 0
end
@@ -28,10 +28,102 @@ function updateAntivirus()
if antivirus.prog >= 174 then
antivirus.prog = 174
antivirus.scanning = false
- if v1.yes == true then
+ if v1.yes == true or v2.start == true then
antivirus.status = "VIRUS FOUND!"
else
antivirus.status = "0 Viruses Found"
end
end
end
+function drawAntivirusFight()
+ 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)
+ elseif antivirus.status == "VIRUS FOUND!" and v1.c.chat.msgs >= 12 or v2.c.chat.msgs >= 21 then
+ if av.transform == false then
+ win[4].w = 342
+ win[4].x = win[4].x - 138/2
+ av.transform = true
+ end
+ if av.gun == 98 then
+ love.graphics.draw(antivirus.gun, win[4].x+138/2+99+av.shakex, win[4].y+5-av.gun+av.shakey, 0, win[4].s, win[4].s, 12)
+ elseif av.gun ~= 98 and av.wings == 138/2 then
+ love.graphics.draw(antivirus.gun, win[4].x+138/2+99+math.random(-1,1), win[4].y+5-av.gun+math.random(-1,1), 0, win[4].s, win[4].s, 12)
+ end
+ love.graphics.draw(antivirus.body, win[4].x+138/2+99+av.shakex, win[4].y+5+av.shakey, 0, win[4].s, win[4].s, 80)
+ if av.fireb == true then
+ drawUpBox(win[4].x+138/2+71-3+av.shakex, win[4].y+93-3+av.shakey, 56+6, 19+6, 2)
+ else
+ drawDownBox(win[4].x+138/2+71-3+av.shakex, win[4].y+93-3+av.shakey, 56+6, 19+6, 2)
+ end
+ love.graphics.setColor(colors.font.dark)
+ love.graphics.print("FIRE", win[4].x+138/2+76+av.shakex, win[4].y+99+av.shakey)
+ love.graphics.setColor(255,255,255)
+ drawDownBox(win[4].x+138/2+79-1+av.shakex, win[4].y+40-1+av.shakey, 42, 42, 2)
+ love.graphics.stencil(chargeStencil, "replace", 1)
+ love.graphics.setStencilTest("greater", 0)
+ love.graphics.draw(antivirus.charge, win[4].x+138/2+79+av.shakex, win[4].y+40+av.shakey)
+ love.graphics.setStencilTest()
+ if av.wings >= 138/2 then
+ av.wings = 138/2
+ love.graphics.draw(antivirus.left, win[4].x+138/2-av.wings+av.shakex, win[4].y+av.shakey, 0, win[4].s)
+ love.graphics.draw(antivirus.right, win[4].x+138/2+97+av.wings+av.shakex, win[4].y+av.shakey, 0, win[4].s)
+ elseif av.wings < 138/2 then
+ antivirus.open:play()
+ av.wings = av.wings + 0.5*sys.s
+ love.graphics.draw(antivirus.left, win[4].x+138/2-av.wings+math.random(-1,1)+av.shakex, win[4].y+math.random(-1,1)+av.shakey, 0, win[4].s)
+ love.graphics.draw(antivirus.right, win[4].x+138/2+97+av.wings+math.random(-1,1)+av.shakex, win[4].y+math.random(-1,1)+av.shakey, 0, win[4].s)
+ end
+ 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
+ elseif av.shake < 0 then
+ av.shake = 0
+ av.shakex = 0
+ av.shakey = 0
+ end
+ if av.gun == 10 then
+ antivirus.opengun:play()
+ end
+ if av.wings == 138/2 and av.gun < 98 then
+ av.gun = av.gun + 1*sys.s
+ end
+ if av.gun > 98 then
+ av.gun = 98
+ end
+ if av.charge ~= 40 then
+ av.fireb = false
+ end
+ if av.fireb == true and av.charge == 40 and love.keyboard.isDown("space") then
+ av.fire = true
+ av.fireb = false
+ av.charge = 0
+ if scene == 2 then
+ if v1.c.chat.msgs == 15 or v1.c.chat.msgs == 17 or v1.c.chat.msgs == 19 or v1.c.chat.msgs == 21 then
+ v1.c.chat.msgs = v1.c.chat.msgs + 1
+ v1.c.chat.char = 0
+ end
+ end
+ end
+ if scene == 2 then
+ if (v1.c.chat.msgs == 15 or v1.c.chat.msgs == 17 or v1.c.chat.msgs == 19 or v1.c.chat.msgs == 21 or v1.c.chat.msgs == 36 or v1.c.chat.msgs == 40) and av.charge == 40 then
+ av.fireb = true
+ end
+ end
+ if av.charge < 40 then
+ av.charge = av.charge + (math.random(4,12,25,40,5,2,10)*delta)/di
+ elseif av.charge > 40 then
+ av.charge = 40
+ end
+ if av.fire == true then
+ addBullet(win[4].x+138/2+99,win[4].y+5-av.gun,math.rad(-90),25,"av")
+ if antivirus.laser:isPlaying() == true then
+ antivirus.laser:rewind()
+ else
+ antivirus.laser:play()
+ end
+ av.fire = false
+ end
+ end
+end