compress damn you
This commit is contained in:
parent
25240b53e4
commit
bd7fe037a7
1128
ateli8.html
1128
ateli8.html
File diff suppressed because one or more lines are too long
14
ateli8.p8
14
ateli8.p8
@ -324,13 +324,13 @@ __gff__
|
||||
0000000000000000000080808080000000000000000000808080808000000080000000000000000000814040818040400000000000000080808080808181808000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
__map__
|
||||
0202020202020311110010101000130000000000121200000000000000001010100000000000000011110000000000000000131300000000000000000012120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0202020202020300110000101000131313000000001200000000000000001000000000000000000011110000000000000000131300000000000000001212000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0202020202020300111100001000131300000000001212000000000000001000000000000000000000000000000000000000001300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0202020202020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0202020202020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0202020202020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0404040404040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0202020202030011110010101000130000000000121200000000000000001010100000000000000011110000000000000000131300000000000000000012120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0202020202030000110000101000131313000000001200000000000000001000000000000000000011110000000000000000131300000000000000001212000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0202020202030000111100001000131300000000001212000000000000001000000000000000000000000000000000000000001300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0202020202030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0202020202030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0404040404000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
|
||||
|
@ -74,7 +74,6 @@ function screen_conversation(convo, after, base)
|
||||
messages=convo
|
||||
message_idx=1
|
||||
conversation_active = true
|
||||
toast("conversation!")
|
||||
end,
|
||||
update=conversation_update(after),
|
||||
draw=conversation_draw
|
||||
|
45
library.lua
45
library.lua
@ -32,28 +32,28 @@ library.item_blueprints = {
|
||||
sprite=37, sprite_recolor={[12]=0},
|
||||
},
|
||||
well_water = {
|
||||
title="well water", tags={"water"},
|
||||
title="well water",
|
||||
quality_base=30, quality_range=20,
|
||||
trait_pool={"blue", "shiny"}, trait_chance=20,
|
||||
description="water from\na well",
|
||||
sprite=37,
|
||||
},
|
||||
herb = {
|
||||
title="herb", tags={},
|
||||
title="herb",
|
||||
quality_base = 40, quality_range=30,
|
||||
trait_pool={"green"}, trait_chance=30,
|
||||
description="healing herb",
|
||||
sprite=34,
|
||||
},
|
||||
crystal = {
|
||||
title="crystal", tags={},
|
||||
title="crystal",
|
||||
quality_base=40, quality_range=60,
|
||||
trait_pool={"shiny", "large", "blue"}, trait_chance=50,
|
||||
description="cliff \ncrystals",
|
||||
sprite=38,
|
||||
},
|
||||
sand = {
|
||||
title="sand", tags={},
|
||||
title="sand",
|
||||
quality_base=30, quality_range=40,
|
||||
trait_pool={"fine"}, trait_chance=40,
|
||||
description="beach sand",
|
||||
@ -61,49 +61,49 @@ library.item_blueprints = {
|
||||
},
|
||||
|
||||
distilled_water={
|
||||
title="pure water",tags={"water", "pure"},
|
||||
title="pure water",
|
||||
quality_base=50, quality_range=20, --this should only be crafted, so this will be mostly irrelevant
|
||||
trait_pool={}, trait_chance=0, -- again no use
|
||||
description="filtered \npure water",
|
||||
sprite=33,
|
||||
},
|
||||
reagent = {
|
||||
title="reagent", tags={"red"},
|
||||
title="reagent",
|
||||
quality_base = 50, quality_range=10,
|
||||
trait_pool={"shiny"}, trait_chance=20,
|
||||
description="red reagent",
|
||||
sprite=33, sprite_recolor={[12]=8},
|
||||
},
|
||||
bomb = {
|
||||
title="bomb", tags={"explosive"},
|
||||
title="bomb",
|
||||
quality_base=60, quality_range=30,
|
||||
trait_pool={}, trait_chance=0,
|
||||
description="explodes for \nfun & profit",
|
||||
sprite=35,
|
||||
},
|
||||
gunpowder={
|
||||
title="gunpowder", tags={"explosive"},
|
||||
title="gunpowder",
|
||||
quality_base=30, quality_range=10,
|
||||
trait_pool={"fine"}, trait_chance=30,
|
||||
description="be careful!",
|
||||
sprite=32, sprite_recolor={[6]=5},
|
||||
},
|
||||
potion = {
|
||||
title="potion", tags={},
|
||||
title="potion",
|
||||
quality_base = 50, quality_range=10,
|
||||
trait_pool={"red", "shiny", "curing"}, trait_chance=10,
|
||||
description="a healing\npotion",
|
||||
sprite=33, sprite_recolor={[12]=11}
|
||||
},
|
||||
polishing_powder = {
|
||||
title="polish", tags={},
|
||||
title="polish",
|
||||
quality_base=70, quality_range=30,
|
||||
trait_pool={"shiny", "fine"}, trait_chance=30,
|
||||
description="polishing \npowder",
|
||||
sprite=32,
|
||||
},
|
||||
starshine_gem={
|
||||
title="starshine", tags={},
|
||||
title="starshine",
|
||||
quality_base=100, quality_range=50,
|
||||
trait_pool={"shiny","large"}, trait_chance=40,
|
||||
description="starshine \ngem!~",
|
||||
@ -139,33 +139,16 @@ library.recipes={
|
||||
},
|
||||
polishing_powder={
|
||||
title="polish",
|
||||
ingredients={"crystals","sand","charcoal"},
|
||||
ingredients={"crystal","sand","charcoal"},
|
||||
result="polishing_powder"
|
||||
},
|
||||
starshine_gem={
|
||||
title="starshine",
|
||||
ingredients={"crystals", "polish", "reagent"},
|
||||
ingredients={"crystal", "polish", "reagent"},
|
||||
result="starshine_gem"
|
||||
}
|
||||
}
|
||||
|
||||
if testing then
|
||||
inventory = {}
|
||||
|
||||
for i=1,4 do
|
||||
local c = make_item(library.item_blueprints.charcoal)
|
||||
c.traits = {"fine", "red"}
|
||||
add(inventory, c)
|
||||
end
|
||||
|
||||
for i=1,4 do
|
||||
local w = make_item(library.item_blueprints.well_water)
|
||||
w.traits = {"shiny", "blue"}
|
||||
add(inventory, w)
|
||||
end
|
||||
|
||||
else
|
||||
inventory = {}
|
||||
end
|
||||
inventory = {}
|
||||
|
||||
grimoire = {library.recipes.distilled_water, library.recipes.potion}
|
@ -1,6 +1,6 @@
|
||||
grid_size = 8
|
||||
grid_width = 6
|
||||
grid_height = 6
|
||||
grid_width = 5
|
||||
grid_height = 5
|
||||
grid_x = 14
|
||||
grid_y = 34
|
||||
|
||||
@ -408,9 +408,7 @@ function quality()
|
||||
end
|
||||
|
||||
screen_crafting_raw = {before=crafting_before, draw=crafting_draw, update=crafting_update}
|
||||
screen_crafting = screen_crafting_raw
|
||||
if not testing then
|
||||
screen_crafting = screen_conversation({
|
||||
screen_crafting = screen_conversation({
|
||||
{phoebe_portrait, [[when i craft, i pick ingredients one by one with left and right]]},
|
||||
{phoebe_portrait, [[and press 🅾️ to lock them in before picking what traits to use]]},
|
||||
{phoebe_portrait, [[trying to fit them into the grid, which increases the quality. ]]},
|
||||
@ -423,4 +421,3 @@ if not testing then
|
||||
change_screen(screen_crafting)
|
||||
end,
|
||||
screen_crafting_raw)
|
||||
end
|
@ -108,13 +108,10 @@ end
|
||||
|
||||
|
||||
screen_inventory_raw = {before=inventory_before, draw=inventory_draw, update=inventory_update}
|
||||
screen_inventory = screen_inventory_raw
|
||||
if not testing then
|
||||
screen_inventory = screen_conversation({
|
||||
{phoebe_portrait, [[oh right, this is the drawer where i keep my stuff!]]},},
|
||||
function()
|
||||
screen_inventory = screen_inventory_raw
|
||||
change_screen(screen_inventory)
|
||||
end,
|
||||
screen_inventory_raw)
|
||||
end
|
||||
screen_inventory = screen_conversation({
|
||||
{phoebe_portrait, [[oh right, this is the drawer where i keep my stuff!]]},},
|
||||
function()
|
||||
screen_inventory = screen_inventory_raw
|
||||
change_screen(screen_inventory)
|
||||
end,
|
||||
screen_inventory_raw)
|
@ -24,8 +24,8 @@ in return.
|
||||
]],}
|
||||
}
|
||||
letter_idx = 2
|
||||
letters_offset_x = -10
|
||||
letters_offset_y = 8
|
||||
letters_offset_x = -10-80
|
||||
letters_offset_y = 8+8
|
||||
|
||||
function letters_move_to(x1, y1, x2, y2)
|
||||
return {
|
||||
@ -47,17 +47,17 @@ function letters_move_to(x1, y1, x2, y2)
|
||||
s.active=false
|
||||
end
|
||||
end,
|
||||
draw=function(s)
|
||||
end,
|
||||
|
||||
draw=function(s) end,
|
||||
}
|
||||
end
|
||||
|
||||
function letters_move_out(x1, y1, x2, y2)
|
||||
new = letters_move_to(x1, y1, x2, y2)
|
||||
new.draw = function(s)
|
||||
--[[new.draw = function(s)
|
||||
draw_paper(letters_offset_x, letters_offset_y, 128, 128)
|
||||
draw_letter_on_paper(letters[letter_idx], letters_offset_x+14, letters_offset_y+4)
|
||||
end
|
||||
end]]
|
||||
return new
|
||||
end
|
||||
|
||||
|
@ -1,10 +1,9 @@
|
||||
timer = 0
|
||||
pages = grimoire
|
||||
page_idx = 1
|
||||
prev_page_idx = 1
|
||||
animations={}
|
||||
|
||||
current_recipe = pages[page_idx]
|
||||
current_recipe = grimoire[page_idx]
|
||||
|
||||
recipe_list_offset_x=30
|
||||
recipe_list_offset_y=8
|
||||
@ -63,8 +62,8 @@ function flip_away(page)
|
||||
local x = 30 + page_flip
|
||||
local y = 8 + 0.1*page_flip
|
||||
draw_paper(x,y, 140, 140)
|
||||
draw_recipe_on_paper(pages[s.prev_page_idx], x,y)
|
||||
decorate_recipe_unfinished(pages[s.prev_page_idx], x, y)
|
||||
draw_recipe_on_paper(grimoire[s.prev_page_idx], x,y)
|
||||
decorate_recipe_unfinished(grimoire[s.prev_page_idx], x, y)
|
||||
end,
|
||||
}
|
||||
end
|
||||
@ -87,16 +86,16 @@ function flip_in(page, new_page)
|
||||
draw=function(s)
|
||||
|
||||
draw_paper(30, 8, 140, 140)
|
||||
draw_recipe_on_paper(pages[s.prev_page_idx], 30, 8)
|
||||
decorate_recipe_unfinished(pages[s.prev_page_idx], 30, 8)
|
||||
draw_recipe_on_paper(grimoire[s.prev_page_idx], 30, 8)
|
||||
decorate_recipe_unfinished(grimoire[s.prev_page_idx], 30, 8)
|
||||
|
||||
local page_flip = 600*(0.2-s.timer)
|
||||
local x = 30 + page_flip
|
||||
local y = 8 + 0.1*page_flip
|
||||
|
||||
draw_paper(x,y, 140, 140)
|
||||
draw_recipe_on_paper(pages[s.new_page_idx], x,y)
|
||||
decorate_recipe_unfinished(pages[s.new_page_idx], x, y)
|
||||
draw_recipe_on_paper(grimoire[s.new_page_idx], x,y)
|
||||
decorate_recipe_unfinished(grimoire[s.new_page_idx], x, y)
|
||||
end
|
||||
}
|
||||
end
|
||||
@ -107,21 +106,21 @@ function pages_update()
|
||||
page_idx = page_idx - 1
|
||||
end
|
||||
|
||||
if btnp(1) and page_idx ~= #pages then
|
||||
if btnp(1) and page_idx ~= #grimoire then
|
||||
animate(flip_in(page_idx, page_idx+1))
|
||||
page_idx = page_idx + 1
|
||||
end
|
||||
|
||||
if btnp(4) then
|
||||
change_screen(screen_crafting)
|
||||
current_recipe = pages[page_idx]
|
||||
current_recipe = grimoire[page_idx]
|
||||
end
|
||||
if btnp(5) then
|
||||
animate(recipe_list_move_out(30, 8, 30+80, 8+8))
|
||||
change_screen(screen_workbench)
|
||||
end
|
||||
|
||||
current_recipe = pages[page_idx]
|
||||
current_recipe = grimoire[page_idx]
|
||||
end
|
||||
|
||||
function pages_draw()
|
||||
@ -134,17 +133,14 @@ function pages_draw()
|
||||
decorate_recipe_unfinished(current_recipe, recipe_list_offset_x, recipe_list_offset_y)
|
||||
end
|
||||
|
||||
recipe_tutorial = {
|
||||
{phoebe_portrait, [[this is all my recipes. they each list what they need for ingredients.]]},
|
||||
{phoebe_portrait, [[go through them with left and right, or]]},
|
||||
{phoebe_portrait, [[press ❎ to back out to the workbench. 🅾️ will start crafting!!]]},
|
||||
}
|
||||
screen_recipe_list = {draw=pages_draw, update=pages_update}
|
||||
if not testing then
|
||||
screen_recipe_list = screen_conversation(recipe_tutorial,
|
||||
function()
|
||||
screen_recipe_list = {draw=pages_draw, update=pages_update}
|
||||
change_screen(screen_recipe_list)
|
||||
end,
|
||||
screen_recipe_list = screen_conversation({
|
||||
{phoebe_portrait, [[this is all my recipes. they each list what they need for ingredients.]]},
|
||||
{phoebe_portrait, [[go through them with left and right, or]]},
|
||||
{phoebe_portrait, [[press ❎ to back out to the workbench. 🅾️ will start crafting!!]]},
|
||||
},
|
||||
function()
|
||||
screen_recipe_list = {draw=pages_draw, update=pages_update}
|
||||
change_screen(screen_recipe_list)
|
||||
end,
|
||||
screen_recipe_list)
|
||||
end
|
@ -7,7 +7,7 @@ function title_update()
|
||||
{phoebe_portrait, "hadn't taught me about fireworks. my mother is an adventurer instead"},
|
||||
{phoebe_portrait, "of learning alchemy, so now there's no one to carry on the tradition."},
|
||||
{phoebe_portrait, "the town's pretty broken up about it but i'm doing my best to carry on."},
|
||||
{phoebe_portrait, "but i just know the basics of picking herbs and purifying water."},
|
||||
{phoebe_portrait, "but i only know the basics of picking herbs and purifying water."},
|
||||
},
|
||||
function() change_screen(screen_workbench) end,
|
||||
{update=walkaround_update, draw=walkaround_draw}))
|
||||
|
@ -1,21 +1,22 @@
|
||||
player_sprite_number = 48
|
||||
player_x, player_y = 24,16
|
||||
step_timer, stride_length = 0, 4
|
||||
step_timer = 0
|
||||
|
||||
locations = {}
|
||||
|
||||
function crystals(story_state)
|
||||
add(inventory, make_item(library.item_blueprints.crystal))
|
||||
change_screen(screen_conversation({{phoebe_portrait, "my family makes things out of these crystals! i'll take one."}}))
|
||||
change_screen(screen_conversation({{phoebe_portrait, "you can use these crystals for a lot."}}))
|
||||
toast("received crystal!")
|
||||
end
|
||||
locations["5,0"]=crystals
|
||||
locations["6,0"]=crystals
|
||||
|
||||
|
||||
function barrel(story_state)
|
||||
sfx(1)
|
||||
change_screen(screen_conversation({{phoebe_portrait, "it's a barrel!"}}))
|
||||
end
|
||||
|
||||
locations["2,1"]=barrel
|
||||
locations["10,10"]=barrel
|
||||
|
||||
@ -64,9 +65,6 @@ locations["6,15"] = beach
|
||||
locations["7,15"] = beach
|
||||
|
||||
function interact(x, y)
|
||||
if testing then
|
||||
toast(x .. "," .. y)
|
||||
end
|
||||
result = locations[flr(x) .. "," .. flr(y)]
|
||||
if result ~= nil then result(story) end
|
||||
end
|
||||
@ -91,9 +89,7 @@ function walkaround_update()
|
||||
if dy == 1 then up, down = false, true end
|
||||
if dx ~= 0 or dy ~= 0 then moved = true end
|
||||
|
||||
if testing then dx, dy = 2*dx, 2*dy end
|
||||
if flags_from_xy(player_x + dx, player_y + dy) & 0x80 == 0 then player_x, player_y = player_x + dx, player_y + dy end
|
||||
if testing then dx, dy = dx/2, dy/2 end
|
||||
|
||||
if moved then
|
||||
test_x, test_y = player_x + 8*dx, player_y + 8*dy
|
||||
@ -126,7 +122,7 @@ function update_player_sprite()
|
||||
|
||||
if moved then
|
||||
step_timer += 1
|
||||
if step_timer > stride_length then
|
||||
if step_timer > 4 then
|
||||
step_timer = 0
|
||||
if player_sprite_number % 2 == 0 then player_sprite_number += 1
|
||||
elseif player_sprite_number % 2 ~= 0 then player_sprite_number -= 1 end
|
||||
@ -135,41 +131,56 @@ function update_player_sprite()
|
||||
end
|
||||
|
||||
screen_walkaround = {update=walkaround_update, draw=walkaround_draw}
|
||||
if not testing then
|
||||
screen_walkaround = screen_conversation({
|
||||
{phoebe_portrait, [[oh, and this is the town! all sorts of things to do here.]]},
|
||||
{phoebe_portrait, [[like i could go get water from the well to the east,]]},
|
||||
{phoebe_portrait, [[or go pick up some charcoal from the red house to the southwest!]]},
|
||||
{phoebe_portrait, [[just face a building and press ❎!]]}
|
||||
},
|
||||
function()
|
||||
screen_walkaround = {draw=walkaround_draw, update=walkaround_update}
|
||||
change_screen(screen_walkaround)
|
||||
end,
|
||||
screen_walkaround)
|
||||
end
|
||||
screen_walkaround = screen_conversation({
|
||||
{phoebe_portrait, [[oh, and this is the town! all sorts of things to do here.]]},
|
||||
{phoebe_portrait, [[like i could go get water from the well to the east,]]},
|
||||
{phoebe_portrait, [[or go pick up some charcoal from the red house to the southwest!]]},
|
||||
{phoebe_portrait, [[just face a building and press ❎!]]}
|
||||
},
|
||||
function()
|
||||
screen_walkaround = {draw=walkaround_draw, update=walkaround_update}
|
||||
change_screen(screen_walkaround)
|
||||
end,
|
||||
screen_walkaround)
|
||||
|
||||
fireworks = {}
|
||||
stars = {}
|
||||
drag = 0.1
|
||||
fireworks_frequency = 8
|
||||
function work(f)
|
||||
local vel = sqrt(f.vx*f.vx+f.vy*f.vy)
|
||||
f.x += f.vx
|
||||
f.y += f.vy
|
||||
f.vx = f.vx*(1-drag*velocity)
|
||||
f.vy = f.vy*(1-drag*velocity)
|
||||
return vel
|
||||
end
|
||||
|
||||
function fireworks_update()
|
||||
walkaround_update()
|
||||
|
||||
new_fireworks = {}
|
||||
new_stars = {}
|
||||
|
||||
if rnd(100) < fireworks_frequency then add(new_fireworks, new_firework()) end
|
||||
if rnd(100) < fireworks_frequency then add(new_fireworks, {
|
||||
x=rnd(128),
|
||||
y=rnd(112)+16,
|
||||
vx=rnd(0.4)-0.2,
|
||||
vy=-5+rnd(1),
|
||||
c=rnd({10, 8, 7})
|
||||
}) end
|
||||
|
||||
for f in all(fireworks) do
|
||||
velocity = sqrt(f.vx*f.vx + f.vy*f.vy)
|
||||
f.x = f.x + f.vx
|
||||
f.y = f.y + f.vy
|
||||
f.vx = f.vx*(1-drag*velocity)
|
||||
f.vy = f.vy*(1-drag*velocity)
|
||||
if velocity < 0.2 then
|
||||
if work(f) < 0.2 then
|
||||
for i=1,10 do
|
||||
add(new_stars,new_star(f))
|
||||
local theta = rnd(2)
|
||||
add(new_stars,{
|
||||
x=f.x,
|
||||
y=f.y,
|
||||
vx = sin(theta)*2,
|
||||
vy = cos(theta)*2,
|
||||
c=f.c
|
||||
})
|
||||
end
|
||||
else
|
||||
add(new_fireworks, f)
|
||||
@ -177,12 +188,7 @@ function fireworks_update()
|
||||
end
|
||||
|
||||
for s in all(stars) do
|
||||
velocity = sqrt(s.vx*s.vx + s.vy*s.vy)
|
||||
s.x = s.x + s.vx
|
||||
s.y = s.y + s.vy
|
||||
s.vx = s.vx*(1-drag*velocity)
|
||||
s.vy = s.vy*(1-drag*velocity)
|
||||
if velocity > 0.2 then
|
||||
if work(f) > 0.2 then
|
||||
add(new_stars, s)
|
||||
end
|
||||
end
|
||||
@ -191,28 +197,6 @@ function fireworks_update()
|
||||
stars = new_stars
|
||||
end
|
||||
|
||||
function new_firework()
|
||||
return {
|
||||
alive=true,
|
||||
x=rnd(128),
|
||||
y=rnd(112)+16,
|
||||
vx=rnd(0.4)-0.2,
|
||||
vy=-5+rnd(1),
|
||||
c=rnd({10, 8, 7})
|
||||
}
|
||||
end
|
||||
function new_star(t)
|
||||
z = rnd(2)
|
||||
return {
|
||||
alive=true,
|
||||
x=t.x,
|
||||
y=t.y,
|
||||
vx = sin(z)*2,
|
||||
vy = cos(z)*2,
|
||||
c=t.c
|
||||
}
|
||||
end
|
||||
|
||||
function fireworks_draw()
|
||||
walkaround_draw()
|
||||
|
||||
|
@ -26,7 +26,7 @@ function bench_draw()
|
||||
|
||||
draw_background()
|
||||
|
||||
current_recipe = pages[page_idx]
|
||||
current_recipe = grimoire[page_idx]
|
||||
|
||||
outwards_x = 80
|
||||
outwards_y = outwards_x/10
|
||||
@ -34,22 +34,20 @@ function bench_draw()
|
||||
draw_recipe_on_paper(current_recipe, 30+outwards_x, 8+outwards_y)
|
||||
decorate_recipe_unfinished(current_recipe, 30+outwards_x, 8+outwards_y)
|
||||
|
||||
draw_paper(-10-outwards_x, 8+outwards_y, 128, 128)
|
||||
draw_letter_on_paper(letters[letter_idx], 4-outwards_x, 12+outwards_y)
|
||||
draw_paper(letters_offset_x, letters_offset_y, 128, 128)
|
||||
draw_letter_on_paper(letters[letter_idx], letters_offset_x+14, letters_offset_y+4)
|
||||
|
||||
draw_drawer()
|
||||
end
|
||||
|
||||
screen_workbench = {draw=bench_draw, update=bench_update}
|
||||
if not testing then
|
||||
screen_workbench = screen_conversation({
|
||||
{phoebe_portrait, [[this is my workbench.]]},
|
||||
{phoebe_portrait, [[if you press left or right you can see my letters or recipes.]]},
|
||||
{phoebe_portrait, [[then press ❎ to get back to the workbench.]]},
|
||||
},
|
||||
function()
|
||||
screen_workbench = {draw=bench_draw, update=bench_update}
|
||||
change_screen(screen_workbench)
|
||||
end,
|
||||
screen_workbench)
|
||||
end
|
||||
screen_workbench = screen_conversation({
|
||||
{phoebe_portrait, [[this is my workbench.]]},
|
||||
{phoebe_portrait, [[if you press left or right you can see my letters or recipes.]]},
|
||||
{phoebe_portrait, [[then press ❎ to get back to the workbench.]]},
|
||||
},
|
||||
function()
|
||||
screen_workbench = {draw=bench_draw, update=bench_update}
|
||||
change_screen(screen_workbench)
|
||||
end,
|
||||
screen_workbench)
|
@ -22,7 +22,7 @@ function script_charcoal_seller(s) -- the brick house!
|
||||
elseif s.main == 7 then
|
||||
if s.branch_hans == 1 then
|
||||
change_screen(screen_conversation({
|
||||
{seller_portrait, "look, if you get me the fireworks, i can set up a show. three boxes should do it."}
|
||||
{seller_portrait, "if you get me the fireworks, i can set up a show. three boxes should do it."}
|
||||
}))
|
||||
s.branch_hans = 2
|
||||
elseif s.branch_hans == 2 then
|
||||
|
@ -15,10 +15,10 @@ function script_lenore(story_state)
|
||||
{lenore_portrait, [[my usual pharmacist is on vacation.]]},
|
||||
{lenore_portrait, [[think you could take this recipe and make a potion for a patient?]]},
|
||||
{lenore_portrait, [[she lives in the house with a red roof just to the east of here.]]},
|
||||
{lenore_portrait, [[there should be healing herbs southeast of here.]]},
|
||||
{lenore_portrait, [[oh, and by the way -- here's that reagent i promised you.]]},
|
||||
{lenore_portrait, [[healing herbs grow southeast of here.]]},
|
||||
{lenore_portrait, [[and here's that reagent i promised you.]]},
|
||||
{phoebe_portrait, [[do you have a recipe for reagent? i'd love to learn to make it!]]},
|
||||
{lenore_portrait, [[yeah, sure. you start by doing this...]], function()
|
||||
{lenore_portrait, [[yeah, sure. you start like this...]], function()
|
||||
del(inventory, water)
|
||||
add(inventory, make_item(library.item_blueprints.reagent))
|
||||
add(grimoire, library.recipes.reagent)
|
||||
@ -41,15 +41,15 @@ function script_lenore(story_state)
|
||||
elseif story_state.main == 7 then
|
||||
if story_state.branch_lenore == 1 then
|
||||
change_screen(screen_conversation({
|
||||
{lenore_portrait, [[whoa, you can't just set off fireworks willy-nilly. get me 3 clean bandages and a distilled water.]]},
|
||||
{lenore_portrait, [[you can't do something as dangerous as fireworks without being prepared for the worst.]]},
|
||||
{lenore_portrait, [[whoa, you can't just set off fireworks willy-nilly.]]},
|
||||
{lenore_portrait, "get me 3 distilled water for cleaning bandages and 3 buckets of well water for fire."},
|
||||
{phoebe_portrait, [[you got it!!]]},
|
||||
}))
|
||||
story_state.branch_lenore = 2
|
||||
elseif story_state.branch_lenore == 2 then
|
||||
local bandages = player_has("bandages", 3)
|
||||
local water = player_has("distilled water")
|
||||
if bandages == nil or water == nil then
|
||||
local clean_water = player_has("distilled water", 3)
|
||||
local well_water = player_has("well water", 3)
|
||||
if clean_water == nil or well_water == nil then
|
||||
change_screen(screen_conversation({
|
||||
{lenore_portrait, [[i need 3 clean bandages and a distilled water.]]}
|
||||
}))
|
||||
@ -57,9 +57,9 @@ function script_lenore(story_state)
|
||||
change_screen(screen_conversation({
|
||||
{lenore_portrait, [[thanks. this looks good. i'll meet you at the library for viewing when you're ready.]]}
|
||||
}))
|
||||
for x in all(bandages) do del(inventory, x) end
|
||||
del(inventory, water)
|
||||
|
||||
for x in all(clean_water) do del(inventory, x) end
|
||||
for x in all(well_water) do del(inventory, x) end
|
||||
|
||||
story_state.branch_lenore = 3
|
||||
if story_state.branch_hans == 3 and story_state.branch_lenore == 3 and story_state.branch_brigitte == 2 then
|
||||
story_state.main = 8
|
||||
|
@ -30,7 +30,7 @@ function script_library(s)
|
||||
elseif s.main == 6 then
|
||||
if not s.got_crystal_book then
|
||||
change_screen(screen_conversation({
|
||||
{phoebe_portrait, [[stef! i need books about crystals! how to make them!]]},
|
||||
{phoebe_portrait, [[stef! i need books about gems! how to make them!]]},
|
||||
{librarian_portrait, [[gems, huh? let me check...]]},
|
||||
{librarian_portrait, [[here, does this help?]]},
|
||||
{phoebe_portrait, [[yes, this is perfect! let's see...]]},
|
||||
@ -41,8 +41,7 @@ function script_library(s)
|
||||
add(grimoire, library.recipes.starshine_crystal)
|
||||
add(grimoire, library.recipes.polishing_powder)
|
||||
end},
|
||||
{phoebe_portrait, [[i can get crystal from the cliffs, sand from the beach, it's got a recipe for]]},
|
||||
{phoebe_portrait, [[polishing powder...]]},
|
||||
{phoebe_portrait, "i can get crystal from the cliffs and sand from the beach!"},
|
||||
}))
|
||||
s.got_crystal_book = true
|
||||
else
|
||||
@ -65,7 +64,6 @@ function script_library(s)
|
||||
{neighbor_portrait, [[thanks, phoebe!]]},
|
||||
{seller_portrait, [[thanks, phoebe.]]},
|
||||
{phoebe_portrait, [[thank you all for helping out so much. i couldn't have done it without you.]]},
|
||||
{phoebe_portrait, [[and thank you, player, for playing my game!~]]}
|
||||
}, nil, {update=fireworks_update, draw=fireworks_draw}))
|
||||
screen_walkaround = {update=fireworks_update, draw=fireworks_draw}
|
||||
screen_workbench = screen_conversation({
|
||||
|
@ -9,8 +9,8 @@ function script_neighbor(s)
|
||||
else
|
||||
change_screen(screen_conversation({
|
||||
{phoebe_portrait, [[hello! i was asked to bring you a potion!]]},
|
||||
{neighbor_portrait, [[oh my goodness! that's so kind. i injured my back trying to get a rock out]]},
|
||||
{neighbor_portrait, [[of my farm. this potion will fix me right up.]]},
|
||||
{neighbor_portrait, [[that's so kind! i injured my back trying to get a rock out]]},
|
||||
{neighbor_portrait, [[of my field. this potion will fix me right up.]]},
|
||||
{neighbor_portrait, [[... hey, you're an alchemist, right?]]},
|
||||
{phoebe_portrait, [[of course!]]},
|
||||
{neighbor_portrait, [[i've heard that alchemists can make explosives. a bomb could get rid of]]},
|
||||
@ -44,7 +44,7 @@ function script_neighbor(s)
|
||||
{phoebe_portrait, [[i didn't! she was incredibly rude and basically told me to fuck off!]]},
|
||||
{neighbor_portrait, [[huh, i wonder what bee's in her bonnet.]]},
|
||||
{phoebe_portrait, [[she kept talking about how there's no great alchemy left in pilton.]]},
|
||||
{neighbor_portrait, [[maybe what she needs is someone to impress her.]]}
|
||||
{neighbor_portrait, [[maybe she needs someone to impress her.]]}
|
||||
}))
|
||||
del(inventory, bomb)
|
||||
s.main = 5
|
||||
@ -56,14 +56,14 @@ function script_neighbor(s)
|
||||
}))
|
||||
elseif s.main == 6 then
|
||||
change_screen(screen_conversation({
|
||||
{neighbor_portrait, [[that bomb worked a treat on my boulder problem!]]},
|
||||
{neighbor_portrait, [[that bomb worked a treat on my boulder!]]},
|
||||
{phoebe_portrait, [[hooray!]]}
|
||||
}))
|
||||
elseif s.main == 7 then
|
||||
if s.branch_brigitte == 1 then
|
||||
change_screen(screen_conversation({
|
||||
{neighbor_portrait, [[the fireworks festival? on my farm? you betcha!]]},
|
||||
{neighbor_portrait, [[since harvest is over it's totally free!]]},
|
||||
{neighbor_portrait, [[since harvest is over it's totally free.]]},
|
||||
{phoebe_portrait, [[yippee!]]},
|
||||
}))
|
||||
s.branch_brigitte = 2
|
||||
@ -71,15 +71,10 @@ function script_neighbor(s)
|
||||
s.branch_main = 8
|
||||
end
|
||||
elseif s.branch_brigitte == 2 then
|
||||
change_screen(screen_conversation({
|
||||
{neighbor_portrait, [[meet up at the library for viewing, right?]]}
|
||||
}))
|
||||
|
||||
change_screen(screen_conversation({{neighbor_portrait, [[meet up at the library for viewing, right?]]}}))
|
||||
end
|
||||
elseif s.main == 8 then
|
||||
change_screen(screen_conversation({
|
||||
{neighbor_portrait, [[meetchya at the library for watching the fireworks!]]}
|
||||
}))
|
||||
change_screen(screen_conversation({{neighbor_portrait, [[meetchya at the library for watching the fireworks!]]}}))
|
||||
elseif s.main == 9 then
|
||||
change_screen(screen_conversation({{door_portrait, "[no one is here.]"}}))
|
||||
end
|
||||
|
@ -29,7 +29,6 @@ function script_witch(s)
|
||||
{witch_portrait, "pah. no one of your generation knows the ways."},
|
||||
{phoebe_portrait, "well maybe if someone would teach us-"},
|
||||
{witch_portrait, "maybe if you showed any promise i could teach you."},
|
||||
{witch_portrait, "your generation has forgotten the ways of old."},
|
||||
{phoebe_portrait, "grrrr, you old hag!"},
|
||||
{witch_portrait, "hm."},
|
||||
{witch_portrait, "..."},
|
||||
@ -37,15 +36,28 @@ function script_witch(s)
|
||||
{witch_portrait, "if you can do this, i might consider you to have potential."},
|
||||
}))
|
||||
s.main = 6
|
||||
add(letters, {
|
||||
[[hey phoebe!
|
||||
|
||||
thanks for that bomb!
|
||||
it worked a treat. my
|
||||
field is clean and clear.
|
||||
give a shout if there's
|
||||
anything you need any
|
||||
time!
|
||||
|
||||
- brigitte
|
||||
]]
|
||||
})
|
||||
elseif s.main == 6 then
|
||||
local crystal = player_has("starshine")
|
||||
local crystal = player_has("starshine", 1, {"red", "shiny"})
|
||||
if crystal == nil then
|
||||
change_screen(screen_conversation({
|
||||
{door_portrait, "[there is no answer to your knocking.]"}
|
||||
}))
|
||||
else
|
||||
change_screen(screen_conversation({
|
||||
{witch_portrait, "hm. this is... passable. it's passable enough that I will help you."},
|
||||
{witch_portrait, "hm. this is... passable. i will help you."},
|
||||
{witch_portrait, "my bones are too tired to keep up this fight."},
|
||||
{witch_portrait, "i can teach you to make fireworks."},
|
||||
{phoebe_portrait, "fireworks! the festival?!"},
|
||||
@ -61,8 +73,7 @@ function script_witch(s)
|
||||
{phoebe_portrait, "keep it down, i'm thinking."},
|
||||
{phoebe_portrait, "a fireworks festival! that would be so incredible!"},
|
||||
{phoebe_portrait, "but she's right. i'll have to call in favors."},
|
||||
{phoebe_portrait, "okay. i can make this happen."},
|
||||
{phoebe_portrait, "hans the charcoal seller used to set up the show."},
|
||||
{phoebe_portrait, "hans the charcoal seller used to run the show itself."},
|
||||
{phoebe_portrait, "i have to talk to lenore about safety."},
|
||||
{phoebe_portrait, "and i should ask brigitte if we can use her farm!"},
|
||||
}))
|
||||
|
22
utils.lua
22
utils.lua
@ -36,13 +36,20 @@ function filter_list(arr, func)
|
||||
return new
|
||||
end
|
||||
|
||||
function player_has(requirement, count)
|
||||
function player_has(requirement, count, traits)
|
||||
if count == nil then count = 1 end
|
||||
output = {}
|
||||
for x in all(inventory) do
|
||||
if x.title == requirement or contains(x.tags, requirement) then
|
||||
for t in all(traits) do
|
||||
if not contains(x.traits, t) then
|
||||
goto continue
|
||||
end
|
||||
end
|
||||
if count == 1 then return x end
|
||||
add(output, x)
|
||||
|
||||
::continue::
|
||||
end
|
||||
end
|
||||
if #output >= count then
|
||||
@ -62,7 +69,8 @@ function make_item(blueprint)
|
||||
--item.title = blueprint.title
|
||||
--item.description = blueprint.description
|
||||
item.quality = flr(blueprint.quality_base + rnd(blueprint.quality_range))
|
||||
item.tags = deepcopy(blueprint.tags)
|
||||
if blueprint.tags then item.tags = deepcopy(blueprint.tags)
|
||||
else item.tags = {} end
|
||||
item.traits = {}
|
||||
if rnd(100) < blueprint.trait_chance then
|
||||
add(item.traits, rnd(blueprint.trait_pool))
|
||||
@ -126,16 +134,6 @@ function wrap(str, line_length)
|
||||
output = output .. "\n"
|
||||
current_line_length = 0
|
||||
end
|
||||
|
||||
while #w > line_length do
|
||||
output = output .. sub(w, 1, line_length) .. "-\n"
|
||||
w = sub(w, line_length)
|
||||
current_line_length = 0
|
||||
end
|
||||
|
||||
while w[1] == " " do
|
||||
w = sub(w, 2)
|
||||
end
|
||||
end
|
||||
|
||||
output = output .. w .. " "
|
||||
|
Loading…
Reference in New Issue
Block a user