compress damn you

This commit is contained in:
Shoofle 2024-01-26 12:16:31 -05:00
parent 25240b53e4
commit bd7fe037a7
19 changed files with 159 additions and 1488 deletions

BIN
.DS_Store vendored Normal file

Binary file not shown.

File diff suppressed because one or more lines are too long

157
ateli8.js

File diff suppressed because one or more lines are too long

View File

@ -324,13 +324,13 @@ __gff__
0000000000000000000080808080000000000000000000808080808000000080000000000000000000814040818040400000000000000080808080808181808000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000080808080000000000000000000808080808000000080000000000000000000814040818040400000000000000080808080808181808000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
__map__ __map__
0202020202020311110010101000130000000000121200000000000000001010100000000000000011110000000000000000131300000000000000000012120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0202020202030011110010101000130000000000121200000000000000001010100000000000000011110000000000000000131300000000000000000012120000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0202020202020300110000101000131313000000001200000000000000001000000000000000000011110000000000000000131300000000000000001212000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0202020202030000110000101000131313000000001200000000000000001000000000000000000011110000000000000000131300000000000000001212000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0202020202020300111100001000131300000000001212000000000000001000000000000000000000000000000000000000001300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0202020202030000111100001000131300000000001212000000000000001000000000000000000000000000000000000000001300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0202020202020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0202020202030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0202020202020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0202020202030000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0202020202020300000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0404040404000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0404040404040000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000

View File

@ -74,7 +74,6 @@ function screen_conversation(convo, after, base)
messages=convo messages=convo
message_idx=1 message_idx=1
conversation_active = true conversation_active = true
toast("conversation!")
end, end,
update=conversation_update(after), update=conversation_update(after),
draw=conversation_draw draw=conversation_draw

View File

@ -32,28 +32,28 @@ library.item_blueprints = {
sprite=37, sprite_recolor={[12]=0}, sprite=37, sprite_recolor={[12]=0},
}, },
well_water = { well_water = {
title="well water", tags={"water"}, title="well water",
quality_base=30, quality_range=20, quality_base=30, quality_range=20,
trait_pool={"blue", "shiny"}, trait_chance=20, trait_pool={"blue", "shiny"}, trait_chance=20,
description="water from\na well", description="water from\na well",
sprite=37, sprite=37,
}, },
herb = { herb = {
title="herb", tags={}, title="herb",
quality_base = 40, quality_range=30, quality_base = 40, quality_range=30,
trait_pool={"green"}, trait_chance=30, trait_pool={"green"}, trait_chance=30,
description="healing herb", description="healing herb",
sprite=34, sprite=34,
}, },
crystal = { crystal = {
title="crystal", tags={}, title="crystal",
quality_base=40, quality_range=60, quality_base=40, quality_range=60,
trait_pool={"shiny", "large", "blue"}, trait_chance=50, trait_pool={"shiny", "large", "blue"}, trait_chance=50,
description="cliff \ncrystals", description="cliff \ncrystals",
sprite=38, sprite=38,
}, },
sand = { sand = {
title="sand", tags={}, title="sand",
quality_base=30, quality_range=40, quality_base=30, quality_range=40,
trait_pool={"fine"}, trait_chance=40, trait_pool={"fine"}, trait_chance=40,
description="beach sand", description="beach sand",
@ -61,49 +61,49 @@ library.item_blueprints = {
}, },
distilled_water={ 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 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 trait_pool={}, trait_chance=0, -- again no use
description="filtered \npure water", description="filtered \npure water",
sprite=33, sprite=33,
}, },
reagent = { reagent = {
title="reagent", tags={"red"}, title="reagent",
quality_base = 50, quality_range=10, quality_base = 50, quality_range=10,
trait_pool={"shiny"}, trait_chance=20, trait_pool={"shiny"}, trait_chance=20,
description="red reagent", description="red reagent",
sprite=33, sprite_recolor={[12]=8}, sprite=33, sprite_recolor={[12]=8},
}, },
bomb = { bomb = {
title="bomb", tags={"explosive"}, title="bomb",
quality_base=60, quality_range=30, quality_base=60, quality_range=30,
trait_pool={}, trait_chance=0, trait_pool={}, trait_chance=0,
description="explodes for \nfun & profit", description="explodes for \nfun & profit",
sprite=35, sprite=35,
}, },
gunpowder={ gunpowder={
title="gunpowder", tags={"explosive"}, title="gunpowder",
quality_base=30, quality_range=10, quality_base=30, quality_range=10,
trait_pool={"fine"}, trait_chance=30, trait_pool={"fine"}, trait_chance=30,
description="be careful!", description="be careful!",
sprite=32, sprite_recolor={[6]=5}, sprite=32, sprite_recolor={[6]=5},
}, },
potion = { potion = {
title="potion", tags={}, title="potion",
quality_base = 50, quality_range=10, quality_base = 50, quality_range=10,
trait_pool={"red", "shiny", "curing"}, trait_chance=10, trait_pool={"red", "shiny", "curing"}, trait_chance=10,
description="a healing\npotion", description="a healing\npotion",
sprite=33, sprite_recolor={[12]=11} sprite=33, sprite_recolor={[12]=11}
}, },
polishing_powder = { polishing_powder = {
title="polish", tags={}, title="polish",
quality_base=70, quality_range=30, quality_base=70, quality_range=30,
trait_pool={"shiny", "fine"}, trait_chance=30, trait_pool={"shiny", "fine"}, trait_chance=30,
description="polishing \npowder", description="polishing \npowder",
sprite=32, sprite=32,
}, },
starshine_gem={ starshine_gem={
title="starshine", tags={}, title="starshine",
quality_base=100, quality_range=50, quality_base=100, quality_range=50,
trait_pool={"shiny","large"}, trait_chance=40, trait_pool={"shiny","large"}, trait_chance=40,
description="starshine \ngem!~", description="starshine \ngem!~",
@ -139,33 +139,16 @@ library.recipes={
}, },
polishing_powder={ polishing_powder={
title="polish", title="polish",
ingredients={"crystals","sand","charcoal"}, ingredients={"crystal","sand","charcoal"},
result="polishing_powder" result="polishing_powder"
}, },
starshine_gem={ starshine_gem={
title="starshine", title="starshine",
ingredients={"crystals", "polish", "reagent"}, ingredients={"crystal", "polish", "reagent"},
result="starshine_gem" result="starshine_gem"
} }
} }
if testing then
inventory = {} 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
grimoire = {library.recipes.distilled_water, library.recipes.potion} grimoire = {library.recipes.distilled_water, library.recipes.potion}

View File

@ -1,6 +1,6 @@
grid_size = 8 grid_size = 8
grid_width = 6 grid_width = 5
grid_height = 6 grid_height = 5
grid_x = 14 grid_x = 14
grid_y = 34 grid_y = 34
@ -408,8 +408,6 @@ function quality()
end end
screen_crafting_raw = {before=crafting_before, draw=crafting_draw, update=crafting_update} 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, [[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, [[and press 🅾️ to lock them in before picking what traits to use]]},
@ -423,4 +421,3 @@ if not testing then
change_screen(screen_crafting) change_screen(screen_crafting)
end, end,
screen_crafting_raw) screen_crafting_raw)
end

View File

@ -108,8 +108,6 @@ end
screen_inventory_raw = {before=inventory_before, draw=inventory_draw, update=inventory_update} 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({ screen_inventory = screen_conversation({
{phoebe_portrait, [[oh right, this is the drawer where i keep my stuff!]]},}, {phoebe_portrait, [[oh right, this is the drawer where i keep my stuff!]]},},
function() function()
@ -117,4 +115,3 @@ if not testing then
change_screen(screen_inventory) change_screen(screen_inventory)
end, end,
screen_inventory_raw) screen_inventory_raw)
end

View File

@ -24,8 +24,8 @@ in return.
]],} ]],}
} }
letter_idx = 2 letter_idx = 2
letters_offset_x = -10 letters_offset_x = -10-80
letters_offset_y = 8 letters_offset_y = 8+8
function letters_move_to(x1, y1, x2, y2) function letters_move_to(x1, y1, x2, y2)
return { return {
@ -47,17 +47,17 @@ function letters_move_to(x1, y1, x2, y2)
s.active=false s.active=false
end end
end, end,
draw=function(s)
end, draw=function(s) end,
} }
end end
function letters_move_out(x1, y1, x2, y2) function letters_move_out(x1, y1, x2, y2)
new = letters_move_to(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_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_letter_on_paper(letters[letter_idx], letters_offset_x+14, letters_offset_y+4)
end end]]
return new return new
end end

View File

@ -1,10 +1,9 @@
timer = 0 timer = 0
pages = grimoire
page_idx = 1 page_idx = 1
prev_page_idx = 1 prev_page_idx = 1
animations={} animations={}
current_recipe = pages[page_idx] current_recipe = grimoire[page_idx]
recipe_list_offset_x=30 recipe_list_offset_x=30
recipe_list_offset_y=8 recipe_list_offset_y=8
@ -63,8 +62,8 @@ function flip_away(page)
local x = 30 + page_flip local x = 30 + page_flip
local y = 8 + 0.1*page_flip local y = 8 + 0.1*page_flip
draw_paper(x,y, 140, 140) draw_paper(x,y, 140, 140)
draw_recipe_on_paper(pages[s.prev_page_idx], x,y) draw_recipe_on_paper(grimoire[s.prev_page_idx], x,y)
decorate_recipe_unfinished(pages[s.prev_page_idx], x, y) decorate_recipe_unfinished(grimoire[s.prev_page_idx], x, y)
end, end,
} }
end end
@ -87,16 +86,16 @@ function flip_in(page, new_page)
draw=function(s) draw=function(s)
draw_paper(30, 8, 140, 140) draw_paper(30, 8, 140, 140)
draw_recipe_on_paper(pages[s.prev_page_idx], 30, 8) draw_recipe_on_paper(grimoire[s.prev_page_idx], 30, 8)
decorate_recipe_unfinished(pages[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 page_flip = 600*(0.2-s.timer)
local x = 30 + page_flip local x = 30 + page_flip
local y = 8 + 0.1*page_flip local y = 8 + 0.1*page_flip
draw_paper(x,y, 140, 140) draw_paper(x,y, 140, 140)
draw_recipe_on_paper(pages[s.new_page_idx], x,y) draw_recipe_on_paper(grimoire[s.new_page_idx], x,y)
decorate_recipe_unfinished(pages[s.new_page_idx], x, y) decorate_recipe_unfinished(grimoire[s.new_page_idx], x, y)
end end
} }
end end
@ -107,21 +106,21 @@ function pages_update()
page_idx = page_idx - 1 page_idx = page_idx - 1
end 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)) animate(flip_in(page_idx, page_idx+1))
page_idx = page_idx + 1 page_idx = page_idx + 1
end end
if btnp(4) then if btnp(4) then
change_screen(screen_crafting) change_screen(screen_crafting)
current_recipe = pages[page_idx] current_recipe = grimoire[page_idx]
end end
if btnp(5) then if btnp(5) then
animate(recipe_list_move_out(30, 8, 30+80, 8+8)) animate(recipe_list_move_out(30, 8, 30+80, 8+8))
change_screen(screen_workbench) change_screen(screen_workbench)
end end
current_recipe = pages[page_idx] current_recipe = grimoire[page_idx]
end end
function pages_draw() function pages_draw()
@ -134,17 +133,14 @@ function pages_draw()
decorate_recipe_unfinished(current_recipe, recipe_list_offset_x, recipe_list_offset_y) decorate_recipe_unfinished(current_recipe, recipe_list_offset_x, recipe_list_offset_y)
end end
recipe_tutorial = { screen_recipe_list = {draw=pages_draw, update=pages_update}
screen_recipe_list = screen_conversation({
{phoebe_portrait, [[this is all my recipes. they each list what they need for ingredients.]]}, {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, [[go through them with left and right, or]]},
{phoebe_portrait, [[press ❎ to back out to the workbench. 🅾️ will start crafting!!]]}, {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() function()
screen_recipe_list = {draw=pages_draw, update=pages_update} screen_recipe_list = {draw=pages_draw, update=pages_update}
change_screen(screen_recipe_list) change_screen(screen_recipe_list)
end, end,
screen_recipe_list) screen_recipe_list)
end

View File

@ -7,7 +7,7 @@ function title_update()
{phoebe_portrait, "hadn't taught me about fireworks. my mother is an adventurer instead"}, {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, "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, "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, function() change_screen(screen_workbench) end,
{update=walkaround_update, draw=walkaround_draw})) {update=walkaround_update, draw=walkaround_draw}))

View File

@ -1,21 +1,22 @@
player_sprite_number = 48 player_sprite_number = 48
player_x, player_y = 24,16 player_x, player_y = 24,16
step_timer, stride_length = 0, 4 step_timer = 0
locations = {} locations = {}
function crystals(story_state) function crystals(story_state)
add(inventory, make_item(library.item_blueprints.crystal)) 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 end
locations["5,0"]=crystals locations["5,0"]=crystals
locations["6,0"]=crystals locations["6,0"]=crystals
function barrel(story_state) function barrel(story_state)
sfx(1) sfx(1)
change_screen(screen_conversation({{phoebe_portrait, "it's a barrel!"}})) change_screen(screen_conversation({{phoebe_portrait, "it's a barrel!"}}))
end end
locations["2,1"]=barrel locations["2,1"]=barrel
locations["10,10"]=barrel locations["10,10"]=barrel
@ -64,9 +65,6 @@ locations["6,15"] = beach
locations["7,15"] = beach locations["7,15"] = beach
function interact(x, y) function interact(x, y)
if testing then
toast(x .. "," .. y)
end
result = locations[flr(x) .. "," .. flr(y)] result = locations[flr(x) .. "," .. flr(y)]
if result ~= nil then result(story) end if result ~= nil then result(story) end
end end
@ -91,9 +89,7 @@ function walkaround_update()
if dy == 1 then up, down = false, true end if dy == 1 then up, down = false, true end
if dx ~= 0 or dy ~= 0 then moved = 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 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 if moved then
test_x, test_y = player_x + 8*dx, player_y + 8*dy test_x, test_y = player_x + 8*dx, player_y + 8*dy
@ -126,7 +122,7 @@ function update_player_sprite()
if moved then if moved then
step_timer += 1 step_timer += 1
if step_timer > stride_length then if step_timer > 4 then
step_timer = 0 step_timer = 0
if player_sprite_number % 2 == 0 then player_sprite_number += 1 if player_sprite_number % 2 == 0 then player_sprite_number += 1
elseif player_sprite_number % 2 ~= 0 then player_sprite_number -= 1 end elseif player_sprite_number % 2 ~= 0 then player_sprite_number -= 1 end
@ -135,7 +131,6 @@ function update_player_sprite()
end end
screen_walkaround = {update=walkaround_update, draw=walkaround_draw} screen_walkaround = {update=walkaround_update, draw=walkaround_draw}
if not testing then
screen_walkaround = screen_conversation({ screen_walkaround = screen_conversation({
{phoebe_portrait, [[oh, and this is the town! all sorts of things to do here.]]}, {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, [[like i could go get water from the well to the east,]]},
@ -147,29 +142,45 @@ if not testing then
change_screen(screen_walkaround) change_screen(screen_walkaround)
end, end,
screen_walkaround) screen_walkaround)
end
fireworks = {} fireworks = {}
stars = {} stars = {}
drag = 0.1 drag = 0.1
fireworks_frequency = 8 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() function fireworks_update()
walkaround_update() walkaround_update()
new_fireworks = {} new_fireworks = {}
new_stars = {} 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 for f in all(fireworks) do
velocity = sqrt(f.vx*f.vx + f.vy*f.vy) if work(f) < 0.2 then
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
for i=1,10 do 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 end
else else
add(new_fireworks, f) add(new_fireworks, f)
@ -177,12 +188,7 @@ function fireworks_update()
end end
for s in all(stars) do for s in all(stars) do
velocity = sqrt(s.vx*s.vx + s.vy*s.vy) if work(f) > 0.2 then
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
add(new_stars, s) add(new_stars, s)
end end
end end
@ -191,28 +197,6 @@ function fireworks_update()
stars = new_stars stars = new_stars
end 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() function fireworks_draw()
walkaround_draw() walkaround_draw()

View File

@ -26,7 +26,7 @@ function bench_draw()
draw_background() draw_background()
current_recipe = pages[page_idx] current_recipe = grimoire[page_idx]
outwards_x = 80 outwards_x = 80
outwards_y = outwards_x/10 outwards_y = outwards_x/10
@ -34,14 +34,13 @@ function bench_draw()
draw_recipe_on_paper(current_recipe, 30+outwards_x, 8+outwards_y) draw_recipe_on_paper(current_recipe, 30+outwards_x, 8+outwards_y)
decorate_recipe_unfinished(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_paper(letters_offset_x, letters_offset_y, 128, 128)
draw_letter_on_paper(letters[letter_idx], 4-outwards_x, 12+outwards_y) draw_letter_on_paper(letters[letter_idx], letters_offset_x+14, letters_offset_y+4)
draw_drawer() draw_drawer()
end end
screen_workbench = {draw=bench_draw, update=bench_update} screen_workbench = {draw=bench_draw, update=bench_update}
if not testing then
screen_workbench = screen_conversation({ screen_workbench = screen_conversation({
{phoebe_portrait, [[this is my workbench.]]}, {phoebe_portrait, [[this is my workbench.]]},
{phoebe_portrait, [[if you press left or right you can see my letters or recipes.]]}, {phoebe_portrait, [[if you press left or right you can see my letters or recipes.]]},
@ -52,4 +51,3 @@ if not testing then
change_screen(screen_workbench) change_screen(screen_workbench)
end, end,
screen_workbench) screen_workbench)
end

View File

@ -22,7 +22,7 @@ function script_charcoal_seller(s) -- the brick house!
elseif s.main == 7 then elseif s.main == 7 then
if s.branch_hans == 1 then if s.branch_hans == 1 then
change_screen(screen_conversation({ 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 s.branch_hans = 2
elseif s.branch_hans == 2 then elseif s.branch_hans == 2 then

View File

@ -15,10 +15,10 @@ function script_lenore(story_state)
{lenore_portrait, [[my usual pharmacist is on vacation.]]}, {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, [[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, [[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, [[healing herbs grow southeast of here.]]},
{lenore_portrait, [[oh, and by the way -- here's that reagent i promised you.]]}, {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!]]}, {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) del(inventory, water)
add(inventory, make_item(library.item_blueprints.reagent)) add(inventory, make_item(library.item_blueprints.reagent))
add(grimoire, library.recipes.reagent) add(grimoire, library.recipes.reagent)
@ -41,15 +41,15 @@ function script_lenore(story_state)
elseif story_state.main == 7 then elseif story_state.main == 7 then
if story_state.branch_lenore == 1 then if story_state.branch_lenore == 1 then
change_screen(screen_conversation({ 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, [[whoa, you can't just set off fireworks willy-nilly.]]},
{lenore_portrait, [[you can't do something as dangerous as fireworks without being prepared for the worst.]]}, {lenore_portrait, "get me 3 distilled water for cleaning bandages and 3 buckets of well water for fire."},
{phoebe_portrait, [[you got it!!]]}, {phoebe_portrait, [[you got it!!]]},
})) }))
story_state.branch_lenore = 2 story_state.branch_lenore = 2
elseif story_state.branch_lenore == 2 then elseif story_state.branch_lenore == 2 then
local bandages = player_has("bandages", 3) local clean_water = player_has("distilled water", 3)
local water = player_has("distilled water") local well_water = player_has("well water", 3)
if bandages == nil or water == nil then if clean_water == nil or well_water == nil then
change_screen(screen_conversation({ change_screen(screen_conversation({
{lenore_portrait, [[i need 3 clean bandages and a distilled water.]]} {lenore_portrait, [[i need 3 clean bandages and a distilled water.]]}
})) }))
@ -57,8 +57,8 @@ function script_lenore(story_state)
change_screen(screen_conversation({ change_screen(screen_conversation({
{lenore_portrait, [[thanks. this looks good. i'll meet you at the library for viewing when you're ready.]]} {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 for x in all(clean_water) do del(inventory, x) end
del(inventory, water) for x in all(well_water) do del(inventory, x) end
story_state.branch_lenore = 3 story_state.branch_lenore = 3
if story_state.branch_hans == 3 and story_state.branch_lenore == 3 and story_state.branch_brigitte == 2 then if story_state.branch_hans == 3 and story_state.branch_lenore == 3 and story_state.branch_brigitte == 2 then

View File

@ -30,7 +30,7 @@ function script_library(s)
elseif s.main == 6 then elseif s.main == 6 then
if not s.got_crystal_book then if not s.got_crystal_book then
change_screen(screen_conversation({ 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, [[gems, huh? let me check...]]},
{librarian_portrait, [[here, does this help?]]}, {librarian_portrait, [[here, does this help?]]},
{phoebe_portrait, [[yes, this is perfect! let's see...]]}, {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.starshine_crystal)
add(grimoire, library.recipes.polishing_powder) add(grimoire, library.recipes.polishing_powder)
end}, end},
{phoebe_portrait, [[i can get crystal from the cliffs, sand from the beach, it's got a recipe for]]}, {phoebe_portrait, "i can get crystal from the cliffs and sand from the beach!"},
{phoebe_portrait, [[polishing powder...]]},
})) }))
s.got_crystal_book = true s.got_crystal_book = true
else else
@ -65,7 +64,6 @@ function script_library(s)
{neighbor_portrait, [[thanks, phoebe!]]}, {neighbor_portrait, [[thanks, phoebe!]]},
{seller_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, [[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})) }, nil, {update=fireworks_update, draw=fireworks_draw}))
screen_walkaround = {update=fireworks_update, draw=fireworks_draw} screen_walkaround = {update=fireworks_update, draw=fireworks_draw}
screen_workbench = screen_conversation({ screen_workbench = screen_conversation({

View File

@ -9,8 +9,8 @@ function script_neighbor(s)
else else
change_screen(screen_conversation({ change_screen(screen_conversation({
{phoebe_portrait, [[hello! i was asked to bring you a potion!]]}, {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, [[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, [[of my field. this potion will fix me right up.]]},
{neighbor_portrait, [[... hey, you're an alchemist, right?]]}, {neighbor_portrait, [[... hey, you're an alchemist, right?]]},
{phoebe_portrait, [[of course!]]}, {phoebe_portrait, [[of course!]]},
{neighbor_portrait, [[i've heard that alchemists can make explosives. a bomb could get rid of]]}, {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!]]}, {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.]]}, {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.]]}, {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) del(inventory, bomb)
s.main = 5 s.main = 5
@ -56,14 +56,14 @@ function script_neighbor(s)
})) }))
elseif s.main == 6 then elseif s.main == 6 then
change_screen(screen_conversation({ 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!]]} {phoebe_portrait, [[hooray!]]}
})) }))
elseif s.main == 7 then elseif s.main == 7 then
if s.branch_brigitte == 1 then if s.branch_brigitte == 1 then
change_screen(screen_conversation({ change_screen(screen_conversation({
{neighbor_portrait, [[the fireworks festival? on my farm? you betcha!]]}, {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!]]}, {phoebe_portrait, [[yippee!]]},
})) }))
s.branch_brigitte = 2 s.branch_brigitte = 2
@ -71,15 +71,10 @@ function script_neighbor(s)
s.branch_main = 8 s.branch_main = 8
end end
elseif s.branch_brigitte == 2 then elseif s.branch_brigitte == 2 then
change_screen(screen_conversation({ change_screen(screen_conversation({{neighbor_portrait, [[meet up at the library for viewing, right?]]}}))
{neighbor_portrait, [[meet up at the library for viewing, right?]]}
}))
end end
elseif s.main == 8 then elseif s.main == 8 then
change_screen(screen_conversation({ change_screen(screen_conversation({{neighbor_portrait, [[meetchya at the library for watching the fireworks!]]}}))
{neighbor_portrait, [[meetchya at the library for watching the fireworks!]]}
}))
elseif s.main == 9 then elseif s.main == 9 then
change_screen(screen_conversation({{door_portrait, "[no one is here.]"}})) change_screen(screen_conversation({{door_portrait, "[no one is here.]"}}))
end end

View File

@ -29,7 +29,6 @@ function script_witch(s)
{witch_portrait, "pah. no one of your generation knows the ways."}, {witch_portrait, "pah. no one of your generation knows the ways."},
{phoebe_portrait, "well maybe if someone would teach us-"}, {phoebe_portrait, "well maybe if someone would teach us-"},
{witch_portrait, "maybe if you showed any promise i could teach you."}, {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!"}, {phoebe_portrait, "grrrr, you old hag!"},
{witch_portrait, "hm."}, {witch_portrait, "hm."},
{witch_portrait, "..."}, {witch_portrait, "..."},
@ -37,15 +36,28 @@ function script_witch(s)
{witch_portrait, "if you can do this, i might consider you to have potential."}, {witch_portrait, "if you can do this, i might consider you to have potential."},
})) }))
s.main = 6 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 elseif s.main == 6 then
local crystal = player_has("starshine") local crystal = player_has("starshine", 1, {"red", "shiny"})
if crystal == nil then if crystal == nil then
change_screen(screen_conversation({ change_screen(screen_conversation({
{door_portrait, "[there is no answer to your knocking.]"} {door_portrait, "[there is no answer to your knocking.]"}
})) }))
else else
change_screen(screen_conversation({ 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, "my bones are too tired to keep up this fight."},
{witch_portrait, "i can teach you to make fireworks."}, {witch_portrait, "i can teach you to make fireworks."},
{phoebe_portrait, "fireworks! the festival?!"}, {phoebe_portrait, "fireworks! the festival?!"},
@ -61,8 +73,7 @@ function script_witch(s)
{phoebe_portrait, "keep it down, i'm thinking."}, {phoebe_portrait, "keep it down, i'm thinking."},
{phoebe_portrait, "a fireworks festival! that would be so incredible!"}, {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, "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 run the show itself."},
{phoebe_portrait, "hans the charcoal seller used to set up the show."},
{phoebe_portrait, "i have to talk to lenore about safety."}, {phoebe_portrait, "i have to talk to lenore about safety."},
{phoebe_portrait, "and i should ask brigitte if we can use her farm!"}, {phoebe_portrait, "and i should ask brigitte if we can use her farm!"},
})) }))

View File

@ -36,13 +36,20 @@ function filter_list(arr, func)
return new return new
end end
function player_has(requirement, count) function player_has(requirement, count, traits)
if count == nil then count = 1 end if count == nil then count = 1 end
output = {} output = {}
for x in all(inventory) do for x in all(inventory) do
if x.title == requirement or contains(x.tags, requirement) then 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 if count == 1 then return x end
add(output, x) add(output, x)
::continue::
end end
end end
if #output >= count then if #output >= count then
@ -62,7 +69,8 @@ function make_item(blueprint)
--item.title = blueprint.title --item.title = blueprint.title
--item.description = blueprint.description --item.description = blueprint.description
item.quality = flr(blueprint.quality_base + rnd(blueprint.quality_range)) 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 = {} item.traits = {}
if rnd(100) < blueprint.trait_chance then if rnd(100) < blueprint.trait_chance then
add(item.traits, rnd(blueprint.trait_pool)) add(item.traits, rnd(blueprint.trait_pool))
@ -126,16 +134,6 @@ function wrap(str, line_length)
output = output .. "\n" output = output .. "\n"
current_line_length = 0 current_line_length = 0
end 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 end
output = output .. w .. " " output = output .. w .. " "