aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
author1029chris <1029chris@gmail.com>2016-08-23 19:06:17 -0700
committer1029chris <1029chris@gmail.com>2016-08-23 19:06:17 -0700
commit9befdf97aaeeb3377586261b60a2da85f2bd5b58 (patch)
tree26d3af1901f0bff58be866b66733a5aaef3de010
parent1e55cc4060d151807f9acbac89ab8b158bb1c120 (diff)
Antivirus appears
- WIP of virus2 shooting antivirus - OTher stuff
-rw-r--r--assets.lua1
-rw-r--r--assets/antivirus_turret_leftwing_destroy.pngbin0 -> 29364 bytes
-rw-r--r--dialogue.lua1
-rw-r--r--panel.lua24
-rw-r--r--var.lua4
-rw-r--r--virus2.lua66
-rw-r--r--window.lua5
7 files changed, 88 insertions, 13 deletions
diff --git a/assets.lua b/assets.lua
index 199e3e5..6afa9c0 100644
--- a/assets.lua
+++ b/assets.lua
@@ -141,6 +141,7 @@ function loadAssets(id)
gun = love.graphics.newImage("assets/antivirus_turret_gun.png"),
body = love.graphics.newImage("assets/antivirus_turret_body.png"),
left = love.graphics.newImage("assets/antivirus_turret_leftwing.png"),
+ leftd = love.graphics.newImage("assets/antivirus_turret_leftwing_destroy.png"),
right = love.graphics.newImage("assets/antivirus_turret_rightwing.png"),
open = love.audio.newSource("assets/antivirus_open.ogg"),
opengun = love.audio.newSource("assets/antivirus_open_gun.ogg"),
diff --git a/assets/antivirus_turret_leftwing_destroy.png b/assets/antivirus_turret_leftwing_destroy.png
new file mode 100644
index 0000000..73fe97c
--- /dev/null
+++ b/assets/antivirus_turret_leftwing_destroy.png
Binary files differ
diff --git a/dialogue.lua b/dialogue.lua
index 4011480..a132e1a 100644
--- a/dialogue.lua
+++ b/dialogue.lua
@@ -146,6 +146,7 @@ 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."
end
function chatReply(m)
if string.find(m, "virus") ~= nil and msg.c > 6 then
diff --git a/panel.lua b/panel.lua
index 9e66e8a..1d0f6ad 100644
--- a/panel.lua
+++ b/panel.lua
@@ -138,14 +138,24 @@ function drawMenuItems(id)
love.graphics.rectangle("fill", 35, 5+(id*55-55), 208, 50)
love.graphics.setColor(colors.win.light)
love.graphics.print(win[id].title, 85, 5+22+(id*55-55))
- if sys.mouse.p.p == true and v1.yes == false and v2.start == false then
- if win[id].ex == true then
- win[id].ex = false
- win[id].s = 0.2
+ if sys.mouse.p.p == true and v1.yes == false then
+ if v2.start == false then
+ if win[id].ex == true then
+ win[id].ex = false
+ win[id].s = 0.2
+ end
+ win[id].oldlayer = win[id].layer
+ layer.sentToFront = id
+ start.o = false
+ elseif v2.start == true and id == 4 and v2.c.chat.msgs > 16 then
+ if win[4].ex == true then
+ win[4].ex = false
+ win[4].s = 0.2
+ end
+ win[4].oldlayer = win[4].layer
+ layer.sentToFront = 4
+ start.o = false
end
- win[id].oldlayer = win[id].layer
- layer.sentToFront = id
- start.o = false
end
else
love.graphics.rectangle("fill", 35, 5+(id*55-55), 208, 50)
diff --git a/var.lua b/var.lua
index 7dfc374..912402e 100644
--- a/var.lua
+++ b/var.lua
@@ -222,6 +222,10 @@ function loadVar()
v2.c.chat.time = 0
v2.c.handp = "gunfront"
v2.explodeFrame = 1
+ v2.mTime = 0
+ v2.gun = {}
+ v2.gun.rt = 0
+ v2.gun.r = 0
expl.deb[1].x = 0
expl.deb[1].y = 0
expl.deb[1].ym = 5
diff --git a/virus2.lua b/virus2.lua
index 5b0595e..9722ab2 100644
--- a/virus2.lua
+++ b/virus2.lua
@@ -1,6 +1,7 @@
function drawVirusFight2()
drawDesktop()
drawVirus2()
+ drawAntivirusV2()
drawPopups()
if v2.popshoty < sys.h+1000 then
if v2.popshots == false then
@@ -60,6 +61,10 @@ 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
+ v2.c.handp = "gunpoint"
end
end
function drawPopup(id)
@@ -225,6 +230,7 @@ function drawVirus2()
handOpa("gunup",v2.c.gunupOp)
handOpa("gunfront",v2.c.gunfrontOp)
handOpa("gunidle",v2.c.gunidleOp)
+ handOpa("gunpoint",v2.c.gunpointOp)
if v2.c.handsOp ~= 0 then
love.graphics.setColor(256,256,256,v2.c.handsOp)
love.graphics.draw(v2.c.idle.hands, v2.c.x, v2.c.y, v2.c.r, v2.c.s, v2.c.s, 125, 125)
@@ -245,13 +251,39 @@ function drawVirus2()
love.graphics.setColor(256,256,256,v2.c.gunupOp)
love.graphics.draw(v2.c.gunup, v2.c.x, v2.c.y, v2.c.r, v2.c.s, v2.c.s, 125, 125)
end
+ if v2.c.gunpointOp ~= 0 then
+ v2.gun.rt = math.atan2((win[4].y+win[4].h/2 - v2.c.y), (win[4].x+win[4].w/2 - v2.c.x))
+ if v2.gun.r > v2.gun.rt then
+ if v2.gun.r - math.rad((2*sys.s)*di) < v2.gun.rt then
+ v2.gun.r = v2.gun.rt
+ else
+ v2.gun.r = v2.gun.r - math.rad((2*sys.s)*di)
+ end
+ elseif v2.gun.r < v2.gun.rt then
+ if v2.gun.r + math.rad((2*sys.s)*di) > v2.gun.rt then
+ v2.gun.r = v2.gun.rt
+ else
+ v2.gun.r = v2.gun.r + math.rad((2*sys.s)*di)
+ 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)
+ end
+ v2.mTime = v2.mTime + delta
+ if v2.mTime > 6 and v2.c.chat.msgs == 17 and win[4].ex == true then
+ nextChatv2(18)
+ elseif win[4].ex == false and v2.c.chat.msgs >= 17 and v2.c.chat.msgs <= 18 then
+ 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
+ nextChatv2(22)
+ 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 then
- v2.c.chat.next = true
- v2.c.chat.msgs = v2.c.chat.msgs + 1
- v2.c.chat.char = 0
- 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()
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
@@ -281,6 +313,8 @@ function handOpa(hand,opa)
v2.c.gunidleOp = v2.c.gunidleOp + 16
elseif hand == "gunup" then
v2.c.gunupOp = v2.c.gunupOp + 16
+ elseif hand == "gunpoint" then
+ v2.c.gunpointOp = v2.c.gunpointOp + 16
end
end
else
@@ -295,7 +329,29 @@ function handOpa(hand,opa)
v2.c.gunidleOp = v2.c.gunidleOp - 16
elseif hand == "gunup" then
v2.c.gunupOp = v2.c.gunupOp - 16
+ elseif hand == "gunpoint" then
+ v2.c.gunpointOp = v2.c.gunpointOp - 16
end
end
end
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)
+ love.graphics.draw(antivirus.right, win[4].x+95+av.shakex, win[4].y+av.shakey)
+ elseif v2.c.chat.msgs < 22 then
+ love.graphics.draw(win[4].cvs, win[4].x+av.shakex, win[4].y+av.shakey, 0, win[4].s)
+ end
+end
+function nextChatv2(messag)
+ v2.c.chat.next = true
+ if messag == nil then
+ v2.c.chat.msgs = v2.c.chat.msgs + 1
+ else
+ v2.c.chat.msgs = messag
+ end
+ v2.c.chat.char = 0
+ v2.c.chat.msg = ""
+ v2.mTime = 0
+end
diff --git a/window.lua b/window.lua
index 8492e53..1ed3edb 100644
--- a/window.lua
+++ b/window.lua
@@ -116,7 +116,10 @@ function drawWindow(id)
win[id].ex = true
end
if v2.start == true then
- win[id].ex = true
+ if id == 4 and v2.c.chat.msgs > 16 then
+ else
+ win[id].ex = true
+ end
end
if v1.yes == true and id == 2 and v1.timer >= 4 then
layer.sendToFront = 2