diff --git a/src/audio/music/computer-wing.ogg b/src/audio/music/computer-wing.ogg new file mode 100644 index 000000000..869aee438 Binary files /dev/null and b/src/audio/music/computer-wing.ogg differ diff --git a/src/audio/music/greendales-the-way-it-goes.ogg b/src/audio/music/greendales-the-way-it-goes.ogg new file mode 100644 index 000000000..a836b1ad6 Binary files /dev/null and b/src/audio/music/greendales-the-way-it-goes.ogg differ diff --git a/src/images/enemies/billy.png b/src/images/enemies/billy.png new file mode 100644 index 000000000..89d6a786e Binary files /dev/null and b/src/images/enemies/billy.png differ diff --git a/src/images/improvements/airplane.png b/src/images/improvements/airplane.png new file mode 100644 index 000000000..982e6bf1d Binary files /dev/null and b/src/images/improvements/airplane.png differ diff --git a/src/images/improvements/hologram-drugs.png b/src/images/improvements/hologram-drugs.png new file mode 100644 index 000000000..8d75983c7 Binary files /dev/null and b/src/images/improvements/hologram-drugs.png differ diff --git a/src/images/improvements/hologram-laser.png b/src/images/improvements/hologram-laser.png new file mode 100644 index 000000000..edc99b7df Binary files /dev/null and b/src/images/improvements/hologram-laser.png differ diff --git a/src/images/improvements/hologram.png b/src/images/improvements/hologram.png new file mode 100644 index 000000000..8136778ff Binary files /dev/null and b/src/images/improvements/hologram.png differ diff --git a/src/images/improvements/shirleySandwich.png b/src/images/improvements/shirleySandwich.png new file mode 100644 index 000000000..45793989d Binary files /dev/null and b/src/images/improvements/shirleySandwich.png differ diff --git a/src/images/npc/bursar.png b/src/images/npc/bursar.png new file mode 100644 index 000000000..b7846eb0b Binary files /dev/null and b/src/images/npc/bursar.png differ diff --git a/src/images/npc/bursar_menu.png b/src/images/npc/bursar_menu.png new file mode 100644 index 000000000..af67db65d Binary files /dev/null and b/src/images/npc/bursar_menu.png differ diff --git a/src/images/npc/hologram.png b/src/images/npc/hologram.png new file mode 100644 index 000000000..62fbfdf02 Binary files /dev/null and b/src/images/npc/hologram.png differ diff --git a/src/images/npc/hologram_menu.png b/src/images/npc/hologram_menu.png new file mode 100644 index 000000000..adaae5043 Binary files /dev/null and b/src/images/npc/hologram_menu.png differ diff --git a/src/images/npc/todd-sandwich.png b/src/images/npc/todd-sandwich.png new file mode 100644 index 000000000..83b9e8aa3 Binary files /dev/null and b/src/images/npc/todd-sandwich.png differ diff --git a/src/images/npc/todd-sandwich_menu.png b/src/images/npc/todd-sandwich_menu.png new file mode 100644 index 000000000..adaae5043 Binary files /dev/null and b/src/images/npc/todd-sandwich_menu.png differ diff --git a/src/images/shopping/improvements.png b/src/images/shopping/improvements.png new file mode 100644 index 000000000..8b57c0a4b Binary files /dev/null and b/src/images/shopping/improvements.png differ diff --git a/src/images/sprites/greendale/airplane2.png b/src/images/sprites/greendale/airplane2.png new file mode 100644 index 000000000..7108e3dcb Binary files /dev/null and b/src/images/sprites/greendale/airplane2.png differ diff --git a/src/images/sprites/greendale/bar.png b/src/images/sprites/greendale/bar.png new file mode 100644 index 000000000..dc4d889ed Binary files /dev/null and b/src/images/sprites/greendale/bar.png differ diff --git a/src/images/sprites/greendale/bass.png b/src/images/sprites/greendale/bass.png new file mode 100644 index 000000000..3dbd2781f Binary files /dev/null and b/src/images/sprites/greendale/bass.png differ diff --git a/src/images/sprites/greendale/piano.png b/src/images/sprites/greendale/piano.png new file mode 100644 index 000000000..85cfe4666 Binary files /dev/null and b/src/images/sprites/greendale/piano.png differ diff --git a/src/images/sprites/greendale/profCornwallis.png b/src/images/sprites/greendale/profCornwallis.png new file mode 100644 index 000000000..02741e852 Binary files /dev/null and b/src/images/sprites/greendale/profCornwallis.png differ diff --git a/src/images/sprites/greendale/singer.png b/src/images/sprites/greendale/singer.png new file mode 100644 index 000000000..9f7bdd2ac Binary files /dev/null and b/src/images/sprites/greendale/singer.png differ diff --git a/src/images/sprites/greendale/speakeasy-microphone.png b/src/images/sprites/greendale/speakeasy-microphone.png new file mode 100644 index 000000000..fcbdae5e9 Binary files /dev/null and b/src/images/sprites/greendale/speakeasy-microphone.png differ diff --git a/src/images/sprites/greendale/speakeasy-sign.png b/src/images/sprites/greendale/speakeasy-sign.png new file mode 100644 index 000000000..a801f93c5 Binary files /dev/null and b/src/images/sprites/greendale/speakeasy-sign.png differ diff --git a/src/images/sprites/greendale/speakeasy-table-1.png b/src/images/sprites/greendale/speakeasy-table-1.png new file mode 100644 index 000000000..532333d50 Binary files /dev/null and b/src/images/sprites/greendale/speakeasy-table-1.png differ diff --git a/src/images/sprites/greendale/speakeasy-table-2.png b/src/images/sprites/greendale/speakeasy-table-2.png new file mode 100644 index 000000000..86d13e87d Binary files /dev/null and b/src/images/sprites/greendale/speakeasy-table-2.png differ diff --git a/src/images/sprites/greendale/speakeasy-table-3.png b/src/images/sprites/greendale/speakeasy-table-3.png new file mode 100644 index 000000000..93f96931d Binary files /dev/null and b/src/images/sprites/greendale/speakeasy-table-3.png differ diff --git a/src/images/tilesets/greendale-bursar.png b/src/images/tilesets/greendale-bursar.png new file mode 100644 index 000000000..8533ef9e2 Binary files /dev/null and b/src/images/tilesets/greendale-bursar.png differ diff --git a/src/images/tilesets/greendale-exterior.png b/src/images/tilesets/greendale-exterior.png index f27c6c841..2dea42a46 100644 Binary files a/src/images/tilesets/greendale-exterior.png and b/src/images/tilesets/greendale-exterior.png differ diff --git a/src/images/tilesets/greendale-hallways.png b/src/images/tilesets/greendale-hallways.png index f98d8aa1f..584e6b896 100644 Binary files a/src/images/tilesets/greendale-hallways.png and b/src/images/tilesets/greendale-hallways.png differ diff --git a/src/images/tilesets/greendale-speakeasy.png b/src/images/tilesets/greendale-speakeasy.png new file mode 100644 index 000000000..02fdeaeee Binary files /dev/null and b/src/images/tilesets/greendale-speakeasy.png differ diff --git a/src/items/improvements/airplane.lua b/src/items/improvements/airplane.lua new file mode 100644 index 000000000..61d5c6136 --- /dev/null +++ b/src/items/improvements/airplane.lua @@ -0,0 +1,10 @@ +return{ + name = "airplane", + description = "New Airplane", + type = "improvement", + subtype = "improvement", + info = 'City College has started an aerial ad campaign. With a little money Greendale could start one as well!', + MAX_ITEMS = 1, + quantity = 1, + directory = 'improvements/' +} diff --git a/src/items/improvements/hologram.lua b/src/items/improvements/hologram.lua new file mode 100644 index 000000000..f4f27ff92 --- /dev/null +++ b/src/items/improvements/hologram.lua @@ -0,0 +1,10 @@ +return{ + name = "hologram", + description = "Pierce's Hologram", + type = "improvement", + subtype = "improvement", + info = "Before he passed Pierce donated money to install a hologram near the Library. Unfortunatly the Dean spent the money purchasing Honda products.", + MAX_ITEMS = 1, + quantity = 1, + directory = 'improvements/' +} diff --git a/src/items/improvements/init.lua b/src/items/improvements/init.lua new file mode 100644 index 000000000..e69de29bb diff --git a/src/items/improvements/shirleySandwich.lua b/src/items/improvements/shirleySandwich.lua new file mode 100644 index 000000000..a80f80d72 --- /dev/null +++ b/src/items/improvements/shirleySandwich.lua @@ -0,0 +1,10 @@ +return{ + name = "shirleySandwich", + description = "Shirley's Sandwich Shop", + type = "improvement", + subtype = "improvement", + info = "Shirley's Sandwiches still needs some funding before it can open.", + MAX_ITEMS = 1, + quantity = 1, + directory = 'improvements/' +} diff --git a/src/items/item.lua b/src/items/item.lua index 52bda17b4..1af2998a2 100644 --- a/src/items/item.lua +++ b/src/items/item.lua @@ -44,6 +44,7 @@ function Item.new(node, count) end if not love.filesystem.exists(imagePath) then + assert(love.filesystem.exists(imagePath), "There is no image at the path ("..imagePath.."). Items require an image.") return nil end diff --git a/src/maps/admin-hallway.tmx b/src/maps/admin-hallway.tmx index 41e7f0606..83c7a3c5d 100644 --- a/src/maps/admin-hallway.tmx +++ b/src/maps/admin-hallway.tmx @@ -30,7 +30,7 @@ - eJxjYBjaIJJpaONRMApGwSgYBQMDipkgeKDNoBR0Ae3vJOAGkJoOKManlhizYCCPaWjjUTCwAAD8ZCw+ + eJxjYBjaIJJpaONRMApGwSgYBfhBBxMEUxsUM0EwLc2g1HxiQBfQjk4C9nQxIcIRn1pizIKBPKahjUfBwAIAizwtxw== @@ -82,11 +82,6 @@ - - - - - @@ -105,5 +100,16 @@ + + + + + + + + + + + diff --git a/src/maps/castle-hawkthorne-throne.tmx b/src/maps/castle-hawkthorne-throne.tmx index 7d2a14fb6..b0a028053 100644 --- a/src/maps/castle-hawkthorne-throne.tmx +++ b/src/maps/castle-hawkthorne-throne.tmx @@ -9,10 +9,10 @@ - + - + diff --git a/src/maps/greendale-bursar.tmx b/src/maps/greendale-bursar.tmx new file mode 100644 index 000000000..83a247cb5 --- /dev/null +++ b/src/maps/greendale-bursar.tmx @@ -0,0 +1,64 @@ + + + + + + + + + + + + + + eJwTY2BgEKMBVhhiWHQUj2IsmInK5mlBMQ8SmxpYfohhWpQ5IAwAWrQeqg== + + + + + eJxjYBgFo2AU0AuYQDEymxp4FEAAACiLBEU= + + + + + eJztzksLglAQhmHBtBK6mEHaDVwZuLKFQjcUtFWkP8mf3gvNIgRRaSd+8HBmDnOGoyhDhtTngituf+5RK32KDM8Wb0fQoGOMCaYwMJOZl5xv5Chqdnk4ST3HAkuYWMHCGpuGP4WIfvoAZ6ltONhihz0OOMKt7Lnj8VVSlzF1Ivdd4nec72s+YKoIZQ== + + + + + eJxjYBgFo2BwAwsgtkQTA/IbgOINlJjrBMTOaGJAfoMTheaSCjyB2IueFg5jAABK1ASA + + + + + + + + eJxjYBgFo2AUDAVgCsRqDAwNqkCsAsTKQEwNc+2B2ABolj4Q6wGxLpXMHQgAAE2zBcE= + + + + + eJwLZGBgCKQBHgWjYBQQBg1AnA3FDWjipIA0GuGhBgD2nhIR + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/maps/greendale-computer-wing-2.tmx b/src/maps/greendale-computer-wing-2.tmx index a3c659080..f516d333e 100644 --- a/src/maps/greendale-computer-wing-2.tmx +++ b/src/maps/greendale-computer-wing-2.tmx @@ -4,7 +4,7 @@ - + @@ -37,7 +37,6 @@ - diff --git a/src/maps/greendale-computer-wing-3.tmx b/src/maps/greendale-computer-wing-3.tmx index ef15f36f3..c4094bf30 100644 --- a/src/maps/greendale-computer-wing-3.tmx +++ b/src/maps/greendale-computer-wing-3.tmx @@ -4,7 +4,7 @@ - + @@ -37,7 +37,6 @@ - diff --git a/src/maps/greendale-computer-wing.tmx b/src/maps/greendale-computer-wing.tmx index 1f6fbedfd..ab3c5531c 100644 --- a/src/maps/greendale-computer-wing.tmx +++ b/src/maps/greendale-computer-wing.tmx @@ -4,7 +4,7 @@ - + @@ -45,7 +45,7 @@ - + @@ -62,14 +62,12 @@ - - diff --git a/src/maps/greendale-exterior.tmx b/src/maps/greendale-exterior.tmx index 40fa15aca..e922db511 100644 --- a/src/maps/greendale-exterior.tmx +++ b/src/maps/greendale-exterior.tmx @@ -1,5 +1,5 @@ - + @@ -9,10 +9,10 @@ - - + + - + @@ -38,7 +38,7 @@ - eJztWj1vEzEYtgRIbabC2hYitTAChSkMNIgmCEqGSqyUUugEIx9lwksLA4hKsBQQtFJVCfaOQH5AF/5BBfwCPlce39nEcl/f+RLfJQ1+pEc++17br9/zc+/dJYwFBAQEBNQYW5uQxHGz2/4EtI8SY7zUbScCCoPQ7qhWH43bml1yJ1dcxt6eBi+BF2MyHLPp+FyumEGcBW11XxhgrDyQw7hFY6wP1lAEJui2ZtF+UBhk0X4UJb/Q5hg30HcevA7OgdfAWfBqTIZjhjaGcww2bD7u4w0P3Gy4r/l6Rb/iOQB+VAXD80B+6JZ+Z1olz2N8odlF8D54D7zrMA9sGGwZ+rDFeIyO8dTNhnuYKkI39Fty8L8TDdty8WDM1Lld7XoRKodRFGvCs7LQ65yyF8c1rU7hZmsMbmO7/vrIRSWp2SfgkqRr3yVJ9I203Gnu+B/y70DKfpE2O0nnxxLOiXe6qRz0N+V7wC5iBPEZcbAT2r2TYtPJ/lnwcJ1c9lNREPl3Qx4/09pV2wrLL/+KPX8Fpc489qwP/SqMWtrT7oPfwR/gT/AX+Bv8k9LHx33zCFjudBCJpFybxmGsZdhhDnGt0r77dKJfHzHtJf32Qv7d52tw+5xzDjY7LmMhD++IXHKcRTklqot2l/eQrPBx3zztwQ9fcNWvXhcV87tPP+XfbYJZoOdfHSuy3GB+9hH84hTFuV7V7xB4EDxktA9Lv/X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8n0pzZ/4AoH9u4azf+wyLPT9lfKn3W8l3npPg/2rUMPaMWO6h38/VQJKzROm67L121xiEdT5YgiC0BgAAAAC5D2jnHcg= - + - + @@ -71,109 +71,109 @@ - + - + - + - + - + - + - + - + - + - + - + - + - - + + - + - - + + - - + + - - - + + + @@ -186,48 +186,57 @@ + + - - - - - - + + + + + + - + - + - + - + + + + + + + + - + - + diff --git a/src/maps/greendale-lounge.tmx b/src/maps/greendale-lounge.tmx index a71a47e73..721543d3e 100644 --- a/src/maps/greendale-lounge.tmx +++ b/src/maps/greendale-lounge.tmx @@ -22,7 +22,7 @@ - eJztzLkKgDAQRdH5VK3dFdSYKFq4/bW3sUnndMJcOEUY8kQsy/p7m+JPKrImeN8VajRo0Sk2M+QoUEa3CR4BMxbFfo8BI1x023HgxIVbsf+1ByPRDRc= + eJxjYBgFo2AUDHXQSAMzi2lgJi1B6wDYCQCCNwF6 @@ -62,17 +62,17 @@ - + - + - + @@ -83,6 +83,41 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + @@ -92,7 +127,7 @@ - + @@ -108,6 +143,8 @@ + + @@ -130,36 +167,18 @@ - - - - - - - - - - + - - - - - - - - - - + @@ -168,7 +187,7 @@ - + @@ -210,7 +229,7 @@ - + @@ -224,5 +243,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/maps/greendale-quad.tmx b/src/maps/greendale-quad.tmx index d1aeccb4f..8ecac136e 100644 --- a/src/maps/greendale-quad.tmx +++ b/src/maps/greendale-quad.tmx @@ -1,5 +1,5 @@ - + @@ -8,10 +8,10 @@ - - + + - + @@ -42,44 +42,44 @@ - eJzt0tEJwjAUheELXUA7gORBHcA3HaBvdiZHcSCH8gRauEgS0NrW1v+DQ0PJw01yzAAAAAAAwBiqQoAUOoMhfF8emaxZbXbbKhtl7lmWJNeVtfflqJ4clD19ecu/9uWinpzpyke+1ZfG7H5S4lrfEKN/obQ3JrdnTK26cnV96eYJqbkbN+PrujtD9p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-95,26 +95,31 @@ - + - + - + - + + + + + + diff --git a/src/maps/greendale-secret-lab.tmx b/src/maps/greendale-secret-lab.tmx index 248a35f9f..c0a76ee9e 100644 --- a/src/maps/greendale-secret-lab.tmx +++ b/src/maps/greendale-secret-lab.tmx @@ -61,7 +61,7 @@ - + diff --git a/src/maps/greendale-speakeasy.tmx b/src/maps/greendale-speakeasy.tmx new file mode 100644 index 000000000..605581298 --- /dev/null +++ b/src/maps/greendale-speakeasy.tmx @@ -0,0 +1,182 @@ + + + + + + + + + + + + + + + eJztlDsOACEIBbHbmy7d4/7VxgSSWWJrpcVE/jwah5mNjTyXy8G8sJV+JNN2xJW+I8fainFuzzn8WMxgvRZ9pUfYE43qLV/2v82x1xe7or1qUAs191u7dmqqup1/2+QDIxUsUw== + + + + + eJxjYBgFgx0wAzELELMCMRseNlBdAznmcwMxDxDzAjEfHjb3qPk0MV8YiEWAWBSIxfCwhck0fxTQDgAAVsEGQw== + + + + + eJzF0UVLRkEUgOEPd7rTnQpigAkmmGCCCSaYoP6Ua3d3d/xMn4ULuZtBvHweeJjNmZeBSaXSMxnJtqJ09XPJI59Msv5IIyr4bhdSRDElZCfw9hxKKaOcCiqpCtxbYpkVVlljnQ02Y/1qaqiljnoaAv0tttlhlz32OeAw1m+kiWZaaKUt0D/imBNOOeOcCy5j/XY66KSLbnoC/SuuueGWO+554PHHnj+Mep199DPAIEOB/hPPvPDKG+988BnbHWaEUcYYZyLQ/81MMsU0M8wyl2B/ngUWE2z+13wB0wQm/Q== + + + + + eJztzDELgkAYh/HbHGtzKVxqs60222yrrS+QplBZkFZQWp+9Z7jhxe24E4f6ww9fPHiU+u+XNsK4w/4EU33HWDloeuIOMcMWa2wsukP9HYh/cywMOzskSLFHhly8++KOsDTsH3DECQXOuIj3wLDX3hUlKtxwx8OyKffECzUavPFx2O9zX+S2DgQ= + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff --git a/src/maps/sophieb.tmx b/src/maps/sophieb.tmx index 740cb82f5..886744ed8 100644 --- a/src/maps/sophieb.tmx +++ b/src/maps/sophieb.tmx @@ -1,12 +1,12 @@ - + - + - + @@ -118,24 +118,24 @@ - + - + - + - - + + @@ -143,17 +143,17 @@ - + - + - + @@ -161,7 +161,7 @@ - + @@ -176,30 +176,32 @@ - + - + + + - + - + @@ -214,5 +216,6 @@ + diff --git a/src/nodes/door.lua b/src/nodes/door.lua index dd73714d5..1e561b5c4 100644 --- a/src/nodes/door.lua +++ b/src/nodes/door.lua @@ -75,6 +75,9 @@ function Door.new(node, collider, level) door.movetime = node.properties.movetime and tonumber(node.properties.movetime) or 1 door.obstruct = node.properties.obstruct or false door.show_sfx = node.properties.show_sfx or 'reveal' + --used if a hidden door still needs a key after being shown (Like a rope in the lounge) + door.hiddenKey = node.properties.hiddenKey or false + --used if the closed door should obstruct the player's movement if door.obstruct and not door.open then -- used for collision detection @@ -119,6 +122,22 @@ function Door:switch(player) end if not self.key or (player.inventory:hasKey(self.key) and not self.inventory) or self.open then + if self.hiddenKey and self.key and not player.inventory:hasKey(self.key) then + if self.closedinfo then + message = {self.closedinfo} + elseif self.info then + message = {self.info} + else + message = {'You need a "'..self.key..'" key to open this door.'} + end + local callback = function(result) + self.prompt = nil + player.freeze = false + end + local options = {'Exit'} + self.prompt = Prompt.new(message, callback, options) + return + end if self.sound ~= false and not self.instant then sound.playSfx( ( type(self.sound) ~= 'boolean' ) and self.sound or 'unlocked' ) end @@ -162,6 +181,22 @@ end function Door:keypressed( button, player) if player.freeze or player.dead then return end + if self.hiddable and self.open and self.hiddenKey and self.key and not player.inventory:hasKey(self.key) then + if self.closedinfo then + message = {self.closedinfo} + elseif self.info then + message = {self.info} + else + message = {'You need a "'..self.key..'" key to open this door.'} + end + local callback = function(result) + self.prompt = nil + player.freeze = false + end + local options = {'Exit'} + self.prompt = Prompt.new(message, callback, options) + return + end if self.hideable and self.hidden and not self.inventory then if self.obstruct then if not player.inventory:hasKey(self.key) and self.info then diff --git a/src/nodes/movingplatform.lua b/src/nodes/movingplatform.lua index 7bf8b464c..2e5c5415d 100644 --- a/src/nodes/movingplatform.lua +++ b/src/nodes/movingplatform.lua @@ -41,6 +41,7 @@ local gs = require 'vendor/gamestate' local sound = require 'vendor/TEsound' local options = require 'options' local utils = require 'utils' +local app = require 'app' local MovingPlatform = {} MovingPlatform.__index = MovingPlatform @@ -78,7 +79,15 @@ function MovingPlatform.new(node, collider, level) mp.sfx = node.properties.sfx and node.properties.sfx or nil mp.allowed_offscreen = node.properties.offscreen == 'true' mp.chain = tonumber(node.properties.chain) or 1 - + --used to trigger the changing of s platform sprite + mp.db = app.gamesaves:active() + mp.spriteTrigger = node.properties.spriteTrigger or nil + if node.properties.spriteTrigger then + if mp.db:get(mp.spriteTrigger, false) then + mp.sprite = love.graphics.newImage( node.properties.sprite2 ) + --assert( mp.sprite2, 'If you have a \'spriteTrigger\' property you must also have a \'sprite2\' property' ) + end + end if node.properties.animation then local p = node.properties mp.anim_speed = p.anim_speed and tonumber(p.anim_speed) or 0.20 diff --git a/src/npcs/bursar.lua b/src/npcs/bursar.lua new file mode 100644 index 000000000..7e5c983b0 --- /dev/null +++ b/src/npcs/bursar.lua @@ -0,0 +1,69 @@ +-- includes +local Prompt = require 'prompt' +local Timer = require 'vendor/timer' +local sound = require 'vendor/TEsound' +local Gamestate = require 'vendor/gamestate' +local sound = require 'vendor/TEsound' +local controls = require('inputcontroller').get() +local NodeClass = require('nodes/npc') + +return { + width = 72, + height = 36, + animations = { + default = { + 'loop',{'1-5,1'},0.20, + }, + talking = { + 'once',{'1-7,1','2,1','3,2','4,1'},0.20, + }, + hide = { + 'once',{'8,1', '1-7,2', }, 0.20, + }, + hidden = { + 'loop',{'8,2','1-4,3'}, 0.15, + }, + }, + + donotfacewhentalking = true, + enter = function(npc, previous) + + end, + + talk_items = { + { ['text']='i am done with you' }, + { ['text']='How can I help?' }, + { ['text']='Any useful info for me?' }, + { ['text']='Hello!' }, + }, + talk_responses = { + ["inventory"]={ + "These are my wares.", + "Press {{yellow}}".. string.upper(controls:getKey('INTERACT')) .."{{white}} to view item information.", + }, + ["Hello!"]={ + "Hello, I'm Greendale's bursar.", + "I deal with the (small amount of) money around here.", + }, + ["Anything happening here?"]={ + "We used to have a cult leader that claimed to specialize in alchemy stay in the house next door.", + "What was odd was that he left with nothing and there was no alchemy equipment in the house at all.", + "We think that he was just lying in an attempt to obtain followers.", + }, + ["How can I help?"]={ + + "Check out the list of current Greendale improvement projects.", + "You can view them under my {{red}}INVENTORY{{white}}.", + "Unless you've conveniently com into a couple million I don't see how you could help though.", + }, + }, + inventory = function(npc, player) + local screenshot = love.graphics.newImage( love.graphics.newScreenshot() ) + Gamestate.stack("shopping", player, screenshot, npc.name) + end, + + update = function(dt, npc, player) + + end, + +} \ No newline at end of file diff --git a/src/npcs/hologram.lua b/src/npcs/hologram.lua new file mode 100644 index 000000000..5e82fe8a1 --- /dev/null +++ b/src/npcs/hologram.lua @@ -0,0 +1,60 @@ +-- inculdes +local Dialog = require 'dialog' +local app = require 'app' +local sound = require 'vendor/TEsound' + +return { + width = 48, + height = 61, + animations = { + default = { + 'once',{'1,1'},.25, + }, + pierce = { + 'loop',{'2-6,1'},.15, + }, + drugs = { + 'loop',{'7-8,1', '1-3,2'},.25, + }, + laser = { + 'loop',{'4-8,1'},.25, + }, + }, + begin = function(npc, player) + npc.menu.state = 'closing' + local script ={ + "Looks as if you've lost your way.", + "Continue on this path, and you might miss your last chance to see the Pierce Hawthorne Museum of Gender Sensitivity and Sexual Potency on the central quad.", + "The museum and this hologram were donated in compliance with a court order I'm not allowed to discuss.", + "What I am allowed to discuss is Greendale, and I'll say this... Don't turn your back on it.", + "Take it from a man with no legal right to be there. You're in a special place.", + "A crappy place, sure, but only because it gives crappy people a chance to sort themselves out.", + "Did I sound gay at the end? Do you want to do another take?", + } + if npc.db:get('hologram-pierce', false) or npc.db:get('hologram-drugs', false) or npc.db:get('hologram-laser', false) then + sound.playMusic("greendales-the-way-it-goes") + Dialog.new(script, function() + player.freeze = false + npc.menu:close(player) + sound.stopMusic() + sound.playSfx("greendale") + end) + else + Dialog.new("This almost looks like the platform to some kind of hologram...", function() + player.freeze = false + npc.menu:close(player) + end) + end + end, + + update = function(dt, npc, player) + if npc.db:get('hologram-pierce', false) then + npc.state = 'pierce' + elseif npc.db:get('hologram-drugs', false) then + npc.state = 'drugs' + elseif npc.db:get('hologram-laser', false) then + npc.state = 'laser' + end + + end, +} diff --git a/src/npcs/jerry.lua b/src/npcs/jerry.lua index c421da128..9dc1e0de7 100644 --- a/src/npcs/jerry.lua +++ b/src/npcs/jerry.lua @@ -45,7 +45,7 @@ return { Quest:activate(npc, player, quests.poolreturn) npc.menu:close(player) npc.db:set('borchertpool', true) - end) + end else Dialog.new(quests.poolreturn.completeQuestFail, function() player.freeze = false diff --git a/src/npcs/raquel.lua b/src/npcs/raquel.lua index 2c18f81ca..5362c7a98 100644 --- a/src/npcs/raquel.lua +++ b/src/npcs/raquel.lua @@ -19,6 +19,7 @@ return { } }, stare = false, + donotfacewhentalking = true, talk_items = { { ['text']='i am done with you' }, diff --git a/src/npcs/todd-sandwich.lua b/src/npcs/todd-sandwich.lua new file mode 100644 index 000000000..16ee03603 --- /dev/null +++ b/src/npcs/todd-sandwich.lua @@ -0,0 +1,35 @@ +-- inculdes +local prompt = require 'prompt' +local Dialog = require 'dialog' +local app = require 'app' + +return { + width = 24, + height = 34, + animations = { + default = { + 'loop',{'1-4,1','1-4,2'},.25, + }, + }, + begin = function(npc, player) + npc.menu.state = 'closing' + if npc.db:get('sandwich-curtain', false) then + Dialog.new("Enjoy the special. *wink*", function() + player.freeze = false + npc.menu:close(player) + end) + else + npc.prompt = prompt.new("Welcome to {{yellow}}Shirley's Sandwiches{{white}}. Would you like to try {{olive}}The Special?{{white}}", function(result) + if result == 'Yes' then + Dialog.new("{{olive}}The Specials{{white}} are kept in the back.", function() + Dialog.currentDialog = nil + npc.menu:close(player) + npc.db:set('sandwich-curtain', true) + end) + else + npc.menu:close(player) + end + end) + end + end, +} diff --git a/src/shopping.lua b/src/shopping.lua index be1869fc4..4d142c056 100644 --- a/src/shopping.lua +++ b/src/shopping.lua @@ -8,6 +8,8 @@ local HUD = require 'hud' local utils = require 'utils' local Item = require 'items/item' local tooltip = require 'tooltip' +local app = require 'app' + --instantiate this gamestate @@ -55,6 +57,7 @@ function state:init() self.shift["keys"] = 8 self.shift["armor"] = 6 self.shift["misc"] = 9 + self.shift["improvements"] = 0 self.categoriespic = {} for i = 1, #self.categories do @@ -77,6 +80,8 @@ function state:init() self.window = "categoriesWindow" self.player = nil + self.improvements = false + self.db = app.gamesaves:active() end @@ -89,12 +94,26 @@ function state:enter(previous, player, screenshot, supplierName) self.player = player self.screenshot = screenshot self.hud = HUD.new(previous) + if supplierName == 'bursar' then + self.improvements = true + self.categories[1] = "improvements" + self.categories[2] = nil + self.categories[3] = nil + self.categories[4] = nil + self.categories[5] = nil + self.categories[6] = nil + self.categoriespic[1] = love.graphics.newImage('images/shopping/improvements.png') + end self.tooltip = tooltip:new() self.message = nil - self.categorySelection = utils.indexof(self.categories,"weapons") + if self.improvements then + self.categorySelection = utils.indexof(self.categories,"improvements") + else + self.categorySelection = utils.indexof(self.categories,"weapons") + end self.itemsSelection = 1 self.purchaseSelection = 1 @@ -163,7 +182,8 @@ end function state:categoriesWindowKeypressed( button ) local c = #self.categories - + if self.improvements then + end if button == "RIGHT" and self.categorySelection < c then self.categorySelection = nonzeroMod(self.categorySelection + 1, c ) if self.categoriesWindowLeft + ROW < self.categorySelection then @@ -237,7 +257,11 @@ function state:purchaseWindowKeypressed( button ) local amount = itemInfo[2] local cost = itemInfo[3] local item = itemInfo.item - local iamount = self.player.inventory:count(item) + local iamount = 0 + if not self.improvements then + local iamount = self.player.inventory:count(item) + end + local p = #self.purchaseOptions @@ -320,7 +344,12 @@ function state:buySelectedItem() elseif amount <= 0 then self.message = "This item is out of stock." self.window = "messageWindow" - + elseif self.improvements then + local action = tostring(itemInfo[4]) + self.db:set(action, true) + self.player.money = self.player.money - cost*self.buyAmount + itemInfo[2] = itemInfo[2] - self.buyAmount + return else for i = 1,self.buyAmount do @@ -353,7 +382,11 @@ function state:buySelectedItem() end function state:sellSelectedItem() - + if self.improvements then + self.message = "You can't sell something you don't own." + self.window = "messageWindow" + return + end local itemInfo = self.items[self.itemSelection] local name = itemInfo[1] local cost = itemInfo[3] @@ -463,7 +496,11 @@ function state:draw() local visI = i - self.itemsWindowLeft - love.graphics.print(cost .. " coins", xcorner + 15 + 32*visI, ycorner + 45, 0, 0.5, 0.5 ) + if self.improvements then + love.graphics.print(cost , xcorner + 20 + 32*visI, ycorner + 45, 0, 0.5, 0.5 ) + else + love.graphics.print(cost .. " coins", xcorner + 15 + 32*visI, ycorner + 45, 0, 0.5, 0.5 ) + end if itemInfo.draw then itemInfo.draw(xcorner + 20 + 32*visI, ycorner + 23, self.player) @@ -478,13 +515,15 @@ function state:draw() end elseif self.window == "purchaseWindow" then - local itemInfo = self.items[self.itemSelection] local name = itemInfo[1] local amount = itemInfo[2] local cost = itemInfo[3] local item = itemInfo.item - local iamount = self.player.inventory:count(item) + local iamount = 0 + if not self.improvements then + local iamount = self.player.inventory:count(item) + end love.graphics.draw( self.backgroundp, xcorner, ycorner , 0 ) love.graphics.printf(item.description, xcorner + 8 , ycorner + 8 , 103, "center") diff --git a/src/suppliers/bursar.lua b/src/suppliers/bursar.lua new file mode 100644 index 000000000..008c93ced --- /dev/null +++ b/src/suppliers/bursar.lua @@ -0,0 +1,11 @@ +--table of item,amount,cost + +return { + improvements = { + {"airplane",1,100000,'greendale-airplane'}, + {"hologram",1,50000,'hologram-pierce'}, + {"shirleySandwich",1,50000,'sandwich-shop'}, + --{"mascot",1,10000}, + --{"building",1,500000}, + }, +}