Skip to content

Commit

Permalink
Merge pull request #2447 from hawkthorne/master
Browse files Browse the repository at this point in the history
MajorVersion 1.0.0
  • Loading branch information
niamu committed Jun 13, 2015
2 parents e6d6f01 + c251799 commit cb6e762
Show file tree
Hide file tree
Showing 542 changed files with 21,135 additions and 3,465 deletions.
21 changes: 20 additions & 1 deletion scripts/version.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,9 +24,14 @@ def next_minor_version():
x, y, z = current_version_tuple()
return "{0}.{1}.0".format(x,int(y)+1)

def next_major_version():
x, y, z = current_version_tuple()
return "{0}.0.0".format(x+1)

def next_version():
if is_release():
if is_major():
return next_major_version()
elif is_release():
return next_minor_version()
else:
return next_bugfix_version()
Expand Down Expand Up @@ -59,6 +64,20 @@ def is_release():

return 'release' in pulls[0].get('title', '').lower()

def is_major():
pulls_url = "https://api.github.com/repos/hawkthorne/hawkthorne-journey/pulls"
resp = requests.get(pulls_url, params={'state': 'closed', 'base': 'release'})

if not resp.ok:
return False

pulls = resp.json()

if len(pulls) == 0:
return False

return 'majorversion' in pulls[0].get('title', '').lower()

if __name__ == "__main__":
parser = argparse.ArgumentParser()
parser.add_argument('action', choices=['next', 'current', 'previous'])
Expand Down
Binary file added src/audio/music/cornelius-attacks.ogg
Binary file not shown.
Binary file added src/audio/music/cornelius-fight.ogg
Binary file not shown.
Binary file added src/audio/music/cornelius-forfeiting.ogg
Binary file not shown.
Binary file added src/audio/music/cornelius-transforms.ogg
Binary file not shown.
Binary file added src/audio/music/mountains.ogg
Binary file not shown.
Binary file added src/audio/music/stonerspeak.ogg
Binary file not shown.
Binary file modified src/audio/music/valley.ogg
Binary file not shown.
Binary file modified src/audio/music/valley2.ogg
Binary file not shown.
Binary file added src/audio/sfx/acorn_bomb.ogg
Binary file not shown.
Binary file added src/audio/sfx/acorn_throw.ogg
Binary file not shown.
Binary file added src/audio/sfx/alien_gatling.ogg
Binary file not shown.
Binary file added src/audio/sfx/alien_hurt.ogg
Binary file not shown.
Binary file added src/audio/sfx/alien_laser.ogg
Binary file not shown.
Binary file added src/audio/sfx/benzalk_growl.ogg
Binary file not shown.
Binary file added src/audio/sfx/block_explode.ogg
Binary file not shown.
Binary file added src/audio/sfx/cornelius-ending.ogg
Binary file not shown.
Binary file added src/audio/sfx/epic_hit.ogg
Binary file not shown.
Binary file added src/audio/sfx/fireball.ogg
Binary file not shown.
Binary file added src/audio/sfx/firework.ogg
Binary file not shown.
File renamed without changes.
Binary file added src/audio/sfx/goat.ogg
Binary file not shown.
Binary file added src/audio/sfx/greendale.ogg
Binary file not shown.
Binary file added src/audio/sfx/hemp.ogg
Binary file not shown.
Binary file added src/audio/sfx/jump_boom.ogg
Binary file not shown.
Binary file added src/audio/sfx/qfo_land.ogg
Binary file not shown.
Binary file added src/audio/sfx/quake.ogg
Binary file not shown.
Binary file added src/audio/sfx/snake_hurt.ogg
Binary file not shown.
Binary file added src/audio/sfx/spider-growl.ogg
Binary file not shown.
Binary file added src/audio/sfx/squeek.ogg
Binary file not shown.
Binary file added src/audio/sfx/squirrel_death.ogg
Binary file not shown.
Binary file added src/audio/sfx/teleport.ogg
Binary file not shown.
Binary file added src/audio/sfx/throne_door.ogg
Binary file not shown.
Binary file added src/audio/sfx/throw.ogg
Binary file not shown.
Binary file added src/audio/sfx/throw2.ogg
Binary file not shown.
Binary file added src/audio/sfx/waterspout.ogg
Binary file not shown.
76 changes: 67 additions & 9 deletions src/brewing.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,62 @@ local Item = require 'items/item'
local camera = require 'camera'
local Prompt = require 'prompt'
local HUD = require 'hud'
local Timer = require 'vendor/timer'
local potion_recipes = require 'items/potion_recipes'
--instantiate this gamestate
local state = Gamestate.new()

local selectionSprite = love.graphics.newImage('images/inventory/selection.png')

local ITEMS_ROW_AMT = 4
local function nonzeroMod(a,b)
local m = a % b
if m ~= 0 then
return m
else
return b
end
end

bundle = {}

--called once when the gamestate is initialized
function state:init()
self.background = love.graphics.newImage('images/potions/potion_menu.png')
end

--called when the player enters this gamestate
--enter may take additional arguments from previous as necessary
--@param previous the actual gamestate that the player came from (not just its name)
function state:enter(previous, player, screenshot, supplierName)
function state:enter(previous, player, screenshot, cauldronName)
fonts.set( 'arial' )
sound.playMusic( "potionlab" )
self.previous = previous
self.screenshot = screenshot
self.cauldronName = cauldronName
self.player = player
self.offset = 0

self.background = love.graphics.newImage('images/potions/potion_menu.png')
self.backgroundPlain = love.graphics.newImage('images/potions/potion_plain.png')
self.text = "Recipes can be found throughout the game. It's a good idea to collect them. "..
"If you don't follow the recipes, you'll make a Dud Potion, which has unpredictable side effects when consumed."

self.hud = HUD.new(previous)

local playerMaterials = self.player.inventory.pages.materials

self.playerRecipes = {}
local count = 1
for _,currentRecipe in pairs(potion_recipes) do
if self.player.inventory:hasDetail(currentRecipe.name) then
self.playerRecipes[count] = {}
self.playerRecipes[count].name = currentRecipe.name
self.playerRecipes[count].description = currentRecipe.description
self.playerRecipes[count].info = currentRecipe.info
count = count + 1
end
end

self.total = count - 1
self.count = 1

-- This block creates a table of the players inventory with limits on items and also holds how many ingredients are added
self.values = {}
Expand Down Expand Up @@ -100,16 +127,19 @@ function state:keypressed( button )
sound.playSfx('click')
elseif button == "JUMP" then
self:check()
elseif button == "INTERACT" then
self.count = nonzeroMod(self.count + 1, self.total)
elseif button == "ATTACK" then
self.count = nonzeroMod(self.count - 1, self.total)
end

self.ingredients[self.values[self.overall].name] = self.current
end

function state:brew( potion )
local SpriteClass = require('nodes/sprite')
local ItemClass = require('items/item')

sound.playSfx('potion_brew')
sound.playSfx( self.cauldronName == 'cauldron' and 'potion_brew' or self.cauldronName)

for mat,amount in pairs(self.ingredients) do
self.player.inventory:removeManyItems(amount, {name=mat, type="material"})
Expand All @@ -122,7 +152,7 @@ function state:brew( potion )
self.player.freeze = true
self.player.invulnerable = true
self.player.character.state = "acquire"
local message = {'You brewed a '..item.description..'!'}
local message = 'You made a {{red}}'..item.description..'{{white}}!'
local callback = function(result)
self.prompt = nil
self.player.freeze = false
Expand Down Expand Up @@ -153,9 +183,9 @@ function state:check()
if notBlankBrew then
local brewed = false
Gamestate.switch(self.previous)
for _,currentRecipe in pairs(potion_recipes) do -- The logic behind my checking is to count the amount correct ingredients the player has
for _,currentRecipe in pairs(potion_recipes) do -- The logic behind my checking is to count the amount correct ingredients the player has
local correctAmount = 0 -- and compare that to the amount of ingredients in the recipe. If they are the same the
local recipeLenth = 0 -- player has added in all the correct ingerdients and a potion can be brewed.
local recipeLenth = 0 -- player has added in all the correct ingredients and a potion can be brewed.
local recipe = currentRecipe.recipe
for mat,amount in pairs(currentRecipe.recipe) do
recipeLenth = recipeLenth + 1
Expand Down Expand Up @@ -227,6 +257,34 @@ function state:draw()
love.graphics.printf(self.values[i+self.offset].description, firstcell_right + 25, firstcell_top + 3.5 + ((i-1) * 22), width, 'left')
end
end

-- draw introduction to potions & recipes
local x1 = menu_right - self.backgroundPlain:getWidth() - 25
love.graphics.draw (self.backgroundPlain, x1, menu_top)
love.graphics.printf(self.text, x1 + 16, menu_top + 10, 132, "center")

local x2 = menu_right + self.background:getWidth() + 25
love.graphics.draw (self.backgroundPlain, x2, menu_top)

-- lists recipes players have in their inventory
if self.total == 0 then
love.graphics.printf("You don't have any recipes yet.", x2 + 16, menu_top + 50, 132, "center")
else
--love.graphics.print(self.playerRecipes[self.count], x2 + 16, menu_top + 10)
--love.graphics.print(self.count, x2 + 16, menu_top + 50)
for _,currentRecipe in pairs(potion_recipes) do
local recipe = self.playerRecipes[self.count]
if currentRecipe.name == recipe.name then
tastyDetails = fonts.tasty.new("{{teal}}" .. recipe.description .. "{{white}} \n\n" .. recipe.info, x2 + 16, menu_top + 10, 132, love.graphics.getFont(), fonts.colors)
tastyDetails:draw()
--instructions to scroll through recipes
if self.total > 1 then
recipeInstructions = fonts.tasty.new("Press {{red}}" .. self.player.controls:getKey('INTERACT') .. "{{white}} or {{red}}" .. self.player.controls:getKey('ATTACK') .. "{{white}} to view other recipes.", x2 + 16, menu_top + 100, 132, love.graphics.getFont(), fonts.colors)
recipeInstructions:draw()
end
end
end
end
end

--called every update cycle
Expand Down
12 changes: 12 additions & 0 deletions src/character_map.json
Original file line number Diff line number Diff line change
Expand Up @@ -167,6 +167,18 @@
"shootarrowjump": {
"left": [ "loop", [ "9-12,11" ], 0.12 ],
"right": [ "loop", [ "9-12,12" ], 0.12 ]
},
"laserpistol": {
"left": [ "loop", [ "9,9" ], 0.12 ],
"right": [ "loop", [ "9,10" ], 0.12 ]
},
"laserpistolwalk": {
"left": [ "loop", [ "10-11,9" ], 0.12 ],
"right": [ "loop", [ "10-11,10" ], 0.12 ]
},
"laserpistoljump": {
"left": [ "loop", [ "12,9" ], 0.12 ],
"right": [ "loop", [ "12,10" ], 0.12 ]
},
"slide": {
"left": [ "once", [ "8,3" ], 1 ],
Expand Down
27 changes: 24 additions & 3 deletions src/cheat.lua
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ local app = require 'app'
local Cheat = {}

local cheatList ={}
local cheatEnabled = true

--if turnOn is true the cheat is enabled
-- if turnOn is false the cheat is disabled
Expand All @@ -24,9 +25,14 @@ local function setCheat(cheatName, turnOn)
'tacomeat','baggle','brekwich','chickenfinger','deepfrieddud',
'ironcrepe','keynana','alcohol','watermelon'}},
give_weapons = {weapons = {
'sword','battleaxe','boneclub','switch','longsword',
'mace','mallet','crimson_sword','torch','bow','icicle',
'sword','battleaxe','boneclub','bow','longsword',
'mace','mallet','crimson_sword','torch','laser_pistol','lasercell',
'throwingaxe','throwingknife','arrow'}},
give_armor = {armor = {
'ajaxshield', 'berserkerbarbute', 'femininefaulds',
'greenguard', 'hagshat', 'ivoryheadpiece', 'lightarmor',
'necromancercloak', 'platemail', 'pruneplackart',
'spiderburgonet', 'tinytarge', 'windwalkercloak'}},
give_scrolls = {misc = {'lightning', 'ghost_pepper'}},
give_materials = {materials = {
'blade','bone','boulder','crystal','ember','fire',
Expand All @@ -39,6 +45,9 @@ local function setCheat(cheatName, turnOn)
'yellow_potion'}},
give_fryables = {materials = {
'bubblgum','carkeys','fries','pancake','toast'}},
give_recipes = {details = {
'blue_potion','green_potion','orange_potion','pink_potion',
'purple_potion','red_potion','white_potion', 'yellow_potion'}},
}
local activations = {
give_money = function() player.money = player.money + 10000 end,
Expand Down Expand Up @@ -93,13 +102,25 @@ function Cheat:is(cheatName)
end

function Cheat:on(cheatName)
setCheat(cheatName,true)
if cheatEnabled then
setCheat(cheatName,true)
end
end

function Cheat:off(cheatName)
setCheat(cheatName,false)
end

function Cheat:fairfight()
cheatEnabled = false
local cheats = false
for cheat,_ in pairs(cheatList) do
if self:is(cheat) then cheats = true end
self:off(cheat)
end
return cheats
end

function Cheat:toggle(cheatName)
setCheat(cheatName,not cheatList[cheatName])
end
Expand Down
1 change: 1 addition & 0 deletions src/cheatscreen.lua
Original file line number Diff line number Diff line change
Expand Up @@ -150,6 +150,7 @@ function cheatscreen:keypressed( button )
['i want tbd'] = {'give_scrolls', 'Scrolls granted'},
['no no juice'] = {'give_potions', 'Potions granted'},
['dan harmon'] = {'give_master_key', 'Key granted'},
['recipes'] = {'give_recipes', 'Recipes granted'},
}
if codes.quits[self.cmd.current] then
cheatscreen:exit()
Expand Down
1 change: 1 addition & 0 deletions src/credits.lua
Original file line number Diff line number Diff line change
Expand Up @@ -259,6 +259,7 @@ state.credits = {
'mminson',
'mtwstudios',
'muugin',
'muplah',
'myers78',
'mystro256',
'm_a_d',
Expand Down
13 changes: 9 additions & 4 deletions src/dialog.lua
Original file line number Diff line number Diff line change
Expand Up @@ -8,23 +8,28 @@ Dialog.__index = Dialog

Dialog.currentDialog = nil

function Dialog.new(message, callback, drawable)
local d = Dialog.create(message)
function Dialog.new(message, callback, drawable, size)
local d = Dialog.create(message, size)
d:reposition()
d:open(callback)
d.drawable = drawable
Dialog.currentDialog = d
return d
end

function Dialog.create(message)
function Dialog.create(message, size)
local say = {}
setmetatable(say, Dialog)
say.board = Board.new(312, 60)
if size == 'small' then
say.board = Board.new(156, 80)
else
say.board = Board.new(312, 60)
end
say.line = 1
say.cursor = 0
say.y = camera.y + camera:getHeight() - 60
say.x = camera.x + camera:getWidth() / 2


if type(message) == 'string' then
say.messages = {message}
Expand Down
Loading

0 comments on commit cb6e762

Please sign in to comment.