aboutsummaryrefslogtreecommitdiff
path: root/antivirus.lua
diff options
context:
space:
mode:
Diffstat (limited to 'antivirus.lua')
-rw-r--r--antivirus.lua21
1 files changed, 19 insertions, 2 deletions
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")