star fish

This commit is contained in:
jill 2021-01-25 21:05:06 +03:00
parent 00f4f5a30b
commit 0cf9e962b6
Signed by: oat
GPG key ID: DD83A9617A252385
10 changed files with 110 additions and 41 deletions

View file

@ -129,6 +129,7 @@ return function(feesh, dt, food, headerbuttons, money)
if n.size == 1 then type = 1 end
if n.size == 3 then type = 3 end
if n.size == 4 then type = 4 end
if n.star then type = 3 end
table.insert(money, constr.money(n.render.x, n.render.y, type))
end
end
@ -174,39 +175,48 @@ return function(feesh, dt, food, headerbuttons, money)
table.remove(food, n.shortestfood)
local cooldowns = {FISH_FOOD_1_COOLDOWN, FISH_FOOD_2_COOLDOWN, FISH_FOOD_3_COOLDOWN}
n.eattimer = cooldowns[f.type]
n.eattimer = cooldowns[f.type] or FISH_FOOD_3_COOLDOWN
n.render.eattimer = 0
n.shortestfood = -1
if n.lifetime > FISH_AGE_MEDIUM and n.size == 0 then
n.size = 1
playSound('grow')
if f.type == 4 then -- star potion
if n.size == 2 or n.size == 3 then
n.star = true
else
n.eattimer = -9e9
playSound('explode')
end
else
if n.lifetime > FISH_AGE_MEDIUM and n.size == 0 then
n.size = 1
playSound('grow')
if not headerbuttons[1].open and not headerbuttons[1].closed then
headerbuttons[1].open = true
headerbuttons[1].openanim = 0
if not headerbuttons[1].open and not headerbuttons[1].closed then
headerbuttons[1].open = true
headerbuttons[1].openanim = 0
end
end
end
if n.lifetime > FISH_AGE_BIG and n.size == 1 then
n.size = 2
playSound('grow')
if n.lifetime > FISH_AGE_BIG and n.size == 1 then
n.size = 2
playSound('grow')
if not headerbuttons[2].open and not headerbuttons[2].closed then
headerbuttons[2].open = true
headerbuttons[2].openanim = 0
if not headerbuttons[2].open and not headerbuttons[2].closed then
headerbuttons[2].open = true
headerbuttons[2].openanim = 0
end
if not headerbuttons[3].open and not headerbuttons[3].closed then
headerbuttons[3].open = true
headerbuttons[3].openanim = 0
end
if not headerbuttons[4].open and not headerbuttons[4].closed then
headerbuttons[4].open = true
headerbuttons[4].openanim = 0
end
end
if not headerbuttons[3].open and not headerbuttons[3].closed then
headerbuttons[3].open = true
headerbuttons[3].openanim = 0
if n.lifetime > FISH_AGE_KING and n.size == 2 then
n.size = 3
playSound('grow')
end
if not headerbuttons[4].open and not headerbuttons[4].closed then
headerbuttons[4].open = true
headerbuttons[4].openanim = 0
end
end
if n.lifetime > FISH_AGE_KING and n.size == 2 then
n.size = 3
playSound('grow')
end
end
end