aboutsummaryrefslogtreecommitdiff
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
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
-rw-r--r--antivirus.lua96
-rw-r--r--assets.lua2
-rw-r--r--assets/virus2_hands_idle_right.pngbin0 -> 22947 bytes
-rw-r--r--assets/virus2_hands_left.pngbin0 -> 4510 bytes
-rw-r--r--dialogue.lua4
-rw-r--r--main.lua4
-rw-r--r--virus1.lua94
-rw-r--r--virus2.lua28
-rw-r--r--window.lua6
9 files changed, 124 insertions, 110 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
diff --git a/assets.lua b/assets.lua
index 4d74be1..5ddd794 100644
--- a/assets.lua
+++ b/assets.lua
@@ -241,12 +241,14 @@ function loadAssets(id)
v2.c.idle.pic = love.graphics.newImage("assets/virus2_idle.png")
v2.c.pupil = love.graphics.newImage("assets/virus2_pupil.png")
v2.c.idle.hands = love.graphics.newImage("assets/virus2_hands_idle.png")
+ v2.c.idle.handright = love.graphics.newImage("assets/virus2_hands_idle_right.png")
v2.c.idle.gunidle = love.graphics.newImage("assets/virus2_hands_gunidle.png")
v2.c.idle.fist = love.graphics.newImage("assets/virus2_hands_fist.png")
v2.c.idle.f = 1
v2.c.gunfront = love.graphics.newImage("assets/virus2_hands_gunfront.png")
v2.c.gunpoint = love.graphics.newImage("assets/virus2_hands_gunpoint.png")
v2.c.gunup = love.graphics.newImage("assets/virus2_hands_gunup.png")
+ v2.c.gunleft = love.graphics.newImage("assets/virus2_hands_left.png")
v2.c.cockgun = love.audio.newSource("assets/virus2_shotgun_cock.ogg")
v2.c.fire = love.audio.newSource("assets/virus2_shotgun_fire.ogg")
v2.c.handsOp = 0
diff --git a/assets/virus2_hands_idle_right.png b/assets/virus2_hands_idle_right.png
new file mode 100644
index 0000000..25a4224
--- /dev/null
+++ b/assets/virus2_hands_idle_right.png
Binary files differ
diff --git a/assets/virus2_hands_left.png b/assets/virus2_hands_left.png
new file mode 100644
index 0000000..5b08dbd
--- /dev/null
+++ b/assets/virus2_hands_left.png
Binary files differ
diff --git a/dialogue.lua b/dialogue.lua
index 38dbafe..678aaca 100644
--- a/dialogue.lua
+++ b/dialogue.lua
@@ -146,8 +146,8 @@ function loadDia()
v2.msgs[15] = "He was oddly specific when explaining the fight, so I'll assume you know how this works!"
v2.msgs[16] = "So, lets get to work... shall we?"
v2.msgs[18] = "Umm... I'm not going to baby you. Open your antivirus!"
- v2.msgs[20] = "There it is! However, it won't work like this! Let me help."
- v2.msgs[22] = "Ah, there we go! Yes, this fight will be a little different"
+ v2.msgs[20] = "Ah, There it is! Fun!"
+ v2.msgs[22] = "This'll be fun, you better not disappoint me!"
v2.msgs[23] = "Now, let's begin."
v2.msgs[25] = "No! You won't beat me! I will beat you! Behold my ultimate power!!!"
v2.msgs[26] = "Well, I'm done. If you survived that, then theres nothing else I can do..."
diff --git a/main.lua b/main.lua
index 2f541b5..565e613 100644
--- a/main.lua
+++ b/main.lua
@@ -81,7 +81,11 @@ function love.mousepressed(x, y, button)
end
function love.keyreleased(key)
if key == "f11" then
+ if scene == 2 then
v1.c.chat.msgs = v1.c.chat.msgs + 1
+ elseif scene == 3 then
+ v2.c.chat.msgs = v2.c.chat.msgs + 1
+ end
end
if key == "f10" then
v1.c.health = v1.c.health - 5
diff --git a/virus1.lua b/virus1.lua
index 14fc8e0..b61db9e 100644
--- a/virus1.lua
+++ b/virus1.lua
@@ -537,6 +537,7 @@ function drawVirusFight1()
win[4].update = true
scene = 1
time = 0
+ av.transform = false
elseif v1.c.chat.msgs == 53 then
virus1Lose = virus1Lose + 1
scene = 666
@@ -671,96 +672,3 @@ function drawVirus1StartThing()
love.graphics.draw(v1.scorchMask, win[2].x-300, win[2].y-100)
end
end
-function drawAntivirusFight()
- orderWindows()
- if antivirus.status ~= "VIRUS FOUND!" or v1.c.chat.msgs < 12 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 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 (sys.mouse.p.x >= win[4].x+138/2+71-3 and sys.mouse.p.x <= (win[4].x+138/2+71-3)+56+6 and av.fireb == true and av.charge == 40
- and sys.mouse.p.y >= win[4].y+93-3 and sys.mouse.p.y <= (win[4].y+93-3)+19+6 and sys.mouse.drag == false and sys.mouse.p.p == true) 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
diff --git a/virus2.lua b/virus2.lua
index 9722ab2..a649fe0 100644
--- a/virus2.lua
+++ b/virus2.lua
@@ -1,7 +1,8 @@
function drawVirusFight2()
drawDesktop()
drawVirus2()
- drawAntivirusV2()
+ --drawAntivirusV2()
+ drawAntivirusFight()
drawPopups()
if v2.popshoty < sys.h+1000 then
if v2.popshots == false then
@@ -53,6 +54,8 @@ function drawVirusFight2()
elseif v2.c.chat.msgs == 5 then
v2.c.xd = sys.w/2
v2.c.yd = sys.h/2
+ win[4].x = sys.w/2
+ win[4].y = sys.h-sys.h/4
elseif v2.c.chat.msgs == 10 then
v2.c.xd = sys.w/2
v2.c.yd = sys.h/2
@@ -61,10 +64,11 @@ function drawVirusFight2()
v2.c.cockgun:play()
v2.c.cockgunplay = true
end
- elseif v2.c.chat.msgs == 21 then
- v2.c.xd = win[4].x-150
- v2.c.yd = win[4].y+75
+ elseif v2.c.chat.msgs == 19 then
+ v2.c.xd = sys.w/4
+ v2.c.yd = sys.h/4
v2.c.handp = "gunpoint"
+ antivirus.scanning = true
end
end
function drawPopup(id)
@@ -267,7 +271,8 @@ function drawVirus2()
end
end
love.graphics.setColor(256,256,256,v2.c.gunpointOp)
- love.graphics.draw(v2.c.gunpoint, v2.c.x, v2.c.y, v2.gun.r, v2.c.s, v2.c.s, 125, 125)
+ love.graphics.draw(v2.c.idle.handright, v2.c.x, v2.c.y, v2.c.r, v2.c.s, v2.c.s, 125, 125)
+ love.graphics.draw(v2.c.gunleft, v2.c.x-82, v2.c.y+35, v2.gun.r+math.rad(-100), 1.2, 1.2, 45, 10)
end
v2.mTime = v2.mTime + delta
if v2.mTime > 6 and v2.c.chat.msgs == 17 and win[4].ex == true then
@@ -276,8 +281,7 @@ function drawVirus2()
nextChatv2(19)
elseif v2.mTime > 1 and v2.c.chat.msgs == 19 and win[4].ex == false then
nextChatv2(20)
- elseif v2.c.chat.msgs == 21 and v2.c.x > win[4].x-150-20 and v2.c.x < win[4].x-150+20
- and v2.c.y > win[4].y+75-20 and v2.c.y < win[4].y+75+20 then
+ elseif v2.c.chat.msgs == 21 and av.transform == true then
nextChatv2(22)
end
if v2.c.chat.time >= 2 and v2.msgs[v2.c.chat.msgs] ~= nil then
@@ -337,12 +341,16 @@ function handOpa(hand,opa)
end
function drawAntivirusV2()
orderWindows()
- if v2.c.chat.msgs == 22 then
- love.graphics.draw(antivirus.leftd, win[4].x+av.shakex, win[4].y+av.shakey)
+ if av.transform == true then
+ 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)
+ love.graphics.draw(antivirus.left, win[4].x+av.shakex, win[4].y+av.shakey)
love.graphics.draw(antivirus.right, win[4].x+95+av.shakex, win[4].y+av.shakey)
- elseif v2.c.chat.msgs < 22 then
+ elseif v2.c.chat.msgs < 21 or av.transform == false then
love.graphics.draw(win[4].cvs, win[4].x+av.shakex, win[4].y+av.shakey, 0, win[4].s)
end
+ if antivirus.status == "VIRUS FOUND!" then
+ av.transform = true
+ end
end
function nextChatv2(messag)
v2.c.chat.next = true
diff --git a/window.lua b/window.lua
index 1ed3edb..065326e 100644
--- a/window.lua
+++ b/window.lua
@@ -94,7 +94,7 @@ function drawWindow(id)
win[id].py = win[id].y
end
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
+ if id == 4 and (v1.yes == true or v2.start == true) then
windowMouseMove(id,0,sys.w-win[id].w,sys.h/2,sys.h-win[id].h-panel.thick-1)
else
windowMouseMove(id,0,sys.w-win[id].w,0,sys.h-win[id].h-panel.thick-1)
@@ -125,7 +125,7 @@ function drawWindow(id)
layer.sendToFront = 2
end
if (sys.mouse.p.p == true and sys.mouse.p.x >= win[id].x+win[id].w-22 and sys.mouse.p.x <= (win[id].x+win[id].w-22)+16 and win[id].ex == false
- and sys.mouse.drag == false and sys.mouse.p.y >= win[id].y+5 and sys.mouse.p.y <= (win[id].y+5)+16 and win[id].hover == true) and v1.yes == false then
+ and sys.mouse.drag == false and sys.mouse.p.y >= win[id].y+5 and sys.mouse.p.y <= (win[id].y+5)+16 and win[id].hover == true) and v1.yes == false and v2.start == false then
win[id].ex = true
end
if win[id].ex == true and win[id].s ~= 0 then
@@ -140,7 +140,7 @@ function drawWindow(id)
end
if (win[id].min == false and sys.mouse.p.p == true and sys.mouse.p.x >= win[id].x+win[id].w-40
and sys.mouse.p.x <= (win[id].x+win[id].w-40)+16 and sys.mouse.drag == false and sys.mouse.p.y >= win[id].y+5
- and sys.mouse.p.y <= (win[id].y+5)+16 and win[id].hover == true) and v1.yes == false then
+ and sys.mouse.p.y <= (win[id].y+5)+16 and win[id].hover == true) and v1.yes == false and v2.start == false then
win[id].min = true
end
if win[id].min == true and win[id].miny < minim then