From 3e60c52661654c15667bb0edb3049926741df875 Mon Sep 17 00:00:00 2001 From: RageCage64 Date: Thu, 27 Jan 2022 22:39:35 -0500 Subject: [PATCH] added new fauxkemon! --- src/assets.p8 | 162 +++++++++++++++++++++++++----------------------- src/game.lua | 23 ++++--- src/main.lua | 1 + src/move.lua | 105 +++++++++++++++++++++++++++++++ src/pokemon.lua | 98 +++++++++++++++++++++++++++-- 5 files changed, 296 insertions(+), 93 deletions(-) diff --git a/src/assets.p8 b/src/assets.p8 index d3697e1..d728d4d 100644 --- a/src/assets.p8 +++ b/src/assets.p8 @@ -10,22 +10,22 @@ __gfx__ 0000000000000000000000000000000000000000000000000000000000000b00000bb00000000000000000000000000000000000000000000000000000000000 000000000000000000000000000000000bbb000bbbbbbbbbbbbbbbbbb000bb000000bb0bbbbbbbbbbbbbbbbbb0000b0000000000000000000000000000000000 00000000000000000000000000000000000bb00bbbbbbbbbbbbbbbbbb00bb000b0000bbbbbbbbbbbbbbbbbbbb0bbb00000000000000000000000000000000000 -0000000000000000000000000000000000000bbbbbbbbbbbbbbbbbbbb00b0000bb0000bbbbbbbbbbbbbbbbbbbbb0000000000000000000000000000000000000 -000000000000000000000000000000000000000bbbbbbbbbbbbbbbbbb0b000000bbb000bbbbbbbbbbbbbbbbbbb00000000000000000000000000000000000000 -000000000000000000000000000000000000000bbbb007bbbb700bbbbbb000000000bbbbbbbbbbbbbbbbbbbbb000000000000000000000000000000000000000 -00000000000000000000000000000000000bbbbbbbb007bbbb700bbbbb0000000000000bbbbbbbbbbbbbbbbbbb00000000000000000000000000000000000000 -0000000000000000000000000000000000bb000bbbb000bbbb000bbbb00000000000000bbbbbbbbbbbbbbbbbbbbb000000000000000000000000000000000000 -0000000000000000000000000000000000000bbbbbb000bbbb000bbbbb00000000000bbbbbbbbbbbbbbbbbbbb00b000000000000000000000000000000000000 -0000000000000000000000000000000000000b0bbbbbbbbbbbbbbbbbbbbbb000000bbb0bbbbbbbbbbbbbbbbbb000bb0000000000000000000000000000000000 -000000000000000000000000000000000000bb0bbbbbbbbbbbbbbbbbb00000000bbb000bbbbbbbbbbbbbbbbbb0000b0000000000000000000000000000000000 -000000000000000000000000000000000000b00bbbbbbbbbbbbbbbbbbbbb0000bb00000bbbbbbbbbbbbbbbbbbbb0000000000000000000000000000000000000 -00000000000000000000000000000000000bb00bbbbbbbbbbbbbbbbbb00bbb000000000bbbbbbbbbbbbbbbbbb0bb000000000000000000000000000000000000 -00000000000000000000000000000000000b000000000bbbbbb00000000000000000000000000bbbbbb000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000bbbbbb00000000000000000000000000bbbbbb000000000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000bbbbbb00000000000000000000000000bbbbbb000000000000000000000000000000000000000000000 -0000000000000000000000000000000000000000b0000bbbbbb0000b0000000000000000b0000bbbbbb0000b0000000000000000000000000000000000000000 -00000000000000000000000000000000000000000bbbbbbbbbbbbbb000000000000000000bbbbbbbbbbbbbb00000000000000000000000000000000000000000 -000000000000000000000000000000000000000000000bbbbbb00000000000000000000000000bbbbbb000000000000000000000000000000000000000000000 +0000000000000000000000000000000000000bbbbbbbbbbbbbbbbbbbb00b0000bb0000bbbbbbbbbbbbbbbbbbbbb0000004400000000000000000000000000000 +000000000000000000000000000004440000000bbbbbbbbbbbbbbbbbb0b000000bbb000bbbbbbbbbbbbbbbbbbb00000044440000000000000000000000000000 +00000000dddddddddddddddddd0044040000000bbbb007bbbb700bbbbbb000000000bbbbbbbbbbbbbbbbbbbbb000000040044400dddddddddddddddddd000000 +00000000dd000ddddddddddddd444004000bbbbbbbb007bbbb700bbbbb0000000000000bbbbbbbbbbbbbbbbbbb00000040000440ddddddddddddd007dd000000 +00000000dd000ddddddddddddd40040400bb000bbbb000bbbb000bbbb00000000000000bbbbbbbbbbbbbbbbbbbbb000044040004ddddddddddddd000dd000000 +00000000dd700ddddddddddddd04000400000bbbbbb000bbbb000bbbbb00000000000bbbbbbbbbbbbbbbbbbbb00b000004040044ddddddddddddd000dd000000 +0aa0aaaaaddddddddddddddddd00044400000b0bbbbbbbbbbbbbbbbbbbbbb000000bbb0bbbbbbbbbbbbbbbbbb000bb0004004000dddddddddddddddddaaaa0aa +0aaaaaaaaddddddddddddddddd4044000000bb0bbbbbbbbbbbbbbbbbb00000000bbb000bbbbbbbbbbbbbbbbbb0000b0004440040dddddddddddddddddaaaaaaa +000000aaaddddddddddddddddd4440000000b00bbbbbbbbbbbbbbbbbbbbb0000bb00000bbbbbbbbbbbbbbbbbbbb0000000044444dddddddddddddddddaaa0000 +0aaaaaaaaddddddddddddddddd000000000bb00bbbbbbbbbbbbbbbbbb00bbb000000000bbbbbbbbbbbbbbbbbb0bb000000000000dddddddddddddddddaaaaaaa +0aaaaaaaaddddddddddddddddd000000000b000000000bbbbbb00000000000000000000000000bbbbbb000000000000000000000dddddddddddddddddaaaaaaa +00000000dddddddddddddddddd0000000000000000000bbbbbb00000000000000000000000000bbbbbb000000000000000000000dddddddddddddddddd000000 +000000000099990990009099900000000000000000000bbbbbb00000000000000000000000000bbbbbb000000000000000000000009999099000909990000000 +0000000000999909900990999000000000000000b0000bbbbbb0000b0000000000000000b0000bbbbbb0000b0000000000000000009999099009909990000000 +00000000099999099909909990000000000000000bbbbbbbbbbbbbb000000000000000000bbbbbbbbbbbbbb00000000000000000099999099909909990000000 +000000000090900090009090900000000000000000000bbbbbb00000000000000000000000000bbbbbb000000000000000000000009090009000909090000000 000000000000000000000000000000000000000000000bbbbbb000bbbb000000000000bbbb000bbbbbb000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000bbbbbb0bb00000000000000000000bb0bbbbbb000000000000000000000000000000000000000000000 000000000000000000000000000000000000000000000bbbbbbb000000000000000000000000bbbbbbb000000000000000000000000000000000000000000000 @@ -33,69 +33,69 @@ __gfx__ 00000000000000000000000000000000000000000000b000000b000000000000000000000000b000000b00000000000000000000000000000000000000000000 0000000000000000000000000000000000000000000b00000000b0000000000000000000000b00000000b0000000000000000000000000000000000000000000 000000000000000000000000000000000000000000b0000000000b00000000000000000000b0000000000b000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 -00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000000000000000000000000000000000000000000000000000000550500550000000000555555555500005500005000050000000005500000000 +00000000000000000000000000000000000000000000000000000000000000000505550005000000055555005005555555055555555005500000000555550555 +00000000000000000000000000000000000000000000000000000000000000000505005550000000505055555555055550005505550005000000000005050005 +00000000000000000000000000000000000000000000000000000000000000000505555505000000505555050000055055500505050005000000000005055055 +00000000000000000000000000000000000000000000000000000000000000000550000555000000555050050666666006666660550055000000000005055550 +00000000000000000000000000000000000000000000000000000000000000000066666000000000005550550666666006666660555050000000000006666600 +00000000000000000000000000000000000000000000000000000000000000000066666000000000000066660666666006666660666600000000000006666600 +00000000000000000000000000000000000000000000000000000000000000000066666000000000000066660666666006666660666600000000000006666600 +0e000000000000000000000000bbbbb00b000000000000000000000000eeeee00066666000000000000066660666666006666660666600000000000006666600 +0ee00000000000000000000000b000000bb00000000000000000000000e000000060006000000000000060060600006006000060600600000000000006000600 +00eee00000000000000000000b00000000bbb00000000000000000000e0000006666666666666666666666666666666666666666666666666666666666666666 +0000eeee1111111111111111100000000000bbbb1111111111111111100000006666666666666666666666666666666666666666666666666666666666666666 +00000000111111111111111110000000000000001111111111111111100000006666666600066666666660006666666666666666666666666666666666666666 +0222222210001111111110001aaaa0000aaaaaaa1111111111111111122220006666666607066666666660706666666666666666666666666666666666666666 +00000000100011111111100010000000000000001111111111111111100000006666666600066666666660006666666666666666666666666666666666666666 +00000000100711111111170010000000000000001111111111111111100000006666666666666666666666666666666666666666666666666666666666666666 +00000000111111111111111110000000000000001111111111111111100000006666666666666666666666666666666666666666666666666666666666666666 +00000333111111007701111118888800000008881111111111111111133333006666666666666666666666666666666666666666666666666666666666666666 +03333300111111007701111110000000088888001111111111111111100000006666666666666666666666666666666666666666666666666666666666666666 +03000000111111000001111110000000080000001111111111111111100000006666666666606666666606666666666666666666666666666666666666666666 +00000000111111000001111110000000000000001111111111111111100000006666666666660666666066666666666666666666666666666666666666666666 +0000000f11111100000111111ccc00000000000c11111111111111111fff00006666666666666000000666666666666666666666666666666666666666666666 +00000fff1111111111111111100cc00000000ccc1111111111111111100ff0006666666666666666666666666666666666666666666666666666666666666666 +0000ff0000000000000000000000ccc00000cc0000000000000000000000fff06666666666666666666666666666666666666666666666666666666666666666 +00fff00000000000000000000000000000ccc0000000000000000000000000006666666666666666666666666666666666666666666666666666666666666666 +00f0000000000000000000000000000000c000000000000000000000000000006666666666666666666666666666666666666666666666666666666666666666 +00000000000000000000000000000000000000000000000000000000000000000000000000066000000660000000000000000000000660000006600000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000066000000660000000000000000000000660000006600000000000 +00000000000000000000000000000000000000000000000000000000000000000000000000066000000660000000000000000000000660000006600000000000 +00000000000000000000000000000000000000000000000000000000000000000000660000066000000660000066000000006600000660000006600000660000 +00000000000000000000000000000000000000000000000000000000000000000000666666666000000666666666000000006666666660000006666666660000 +00000000000000000000000000000000000000000000000000000000000000000000666666666000000666666666000000006666666660000006666666660000 +00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 +00000000000000011111000000000000000000000000000111110000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001ccc10000000000000000000000000001ccc10000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001ccc10000000000000000000000000001ccc10000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001ccc10000000000000000000000000001ccc10000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001ccc10000000000000000000000000001ccc10000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001ccc10000000000000000000000000001ccc10000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001ccc10000000000000000000000000001ccc10000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001ccc10000000000000000000000000001ccc10000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001ccc10000000000000000000000000001ccc10000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001ccc10000000000000000000000000001ccc10000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000000001ccc10000000000000000011100111101ccc10000000000000000000000000000000000000000000000000000000000000000000000000000 +0000000000111101ccc1011110011100000001c1001cc101ccc10111100000000000000000000000000000000000000000000000000000000000000000000000 +00000000001cc101ccc101cc1001c100000001c1001cc101ccc101cc100000000000000000000000000000000000000000000000000000000000000000000000 +00000000001cc101ccc101cc1001c100000001c1001cc101ccc101cc100000000000000000000000000000000000000000000000000000000000000000000000 +00000000001cc111ccc101cc1001c100000001c1111cc111ccc101cc100000000000000000000000000000000000000000000000000000000000000000000000 +00000000001cc111ccc111cc1111c100000001c1111cc111ccc111cc100000000000000000000000000000000000000000000000000000000000000000000000 +00000000001cc111ccc111cc1111c100000001c1111cc111ccc111cc100001100000000000000000000000000000000000000000000000000000000000000000 +00011100001cccccccccccccccccc100000001cccccccccccccccccc10001cc10000000000000000000000000000000000000000000000000000000000000000 +0001c110001cccccccccccccccccc100000001cccccccccccccccccc10011cc10000000000000000000000000000000000000000000000000000000000000000 +0001cc11001cccccccccccccccccc100000001cccccccccccccccccc1011ccc10000000000000000000000000000000000000000000000000000000000000000 +0001cccc101cccccccccccccccccc100000001cccccccccccccccccc11ccccc10000000000000000000000000000000000000000000000000000000000000000 +0001ccccc11cccccccccccccccccc100000001cccccccccccccccccc1cccccc10000000000000000000000000000000000000000000000000000000000000000 +00011ccccc1cccccccccccccccccc100000001cccccccccccccccccc1ccccc110000000000000000000000000000000000000000000000000000000000000000 +00001ccccc1cccccccccccccccccc100000001cccccccccccccccccccccccc100000000000000000000000000000000000000000000000000000000000000000 +0000011ccccccccccccccccccccc1000000001ccccccccccccccccccccccc1000000000000000000000000000000000000000000000000000000000000000000 +0000001cccccccccccccccccccc10000000001ccccccccccccccccccccccc1000000000000000000000000000000000000000000000000000000000000000000 +00000001111cccccccccccccccc1000000000011ccccccccccccccccccc110000000000000000000000000000000000000000000000000000000000000000000 +00000000001ccccccccccccc11100000000000011cccccccccccccccc11000000000000000000000000000000000000000000000000000000000000000000000 +00000000001ccccccccccccc100000000000000111cccccccccccccc100000000000000000000000000000000000000000000000000000000000000000000000 +00000000001111111111111110000000000000000111111111111111100000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700 @@ -106,3 +106,7 @@ __gfx__ 00000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000700 __sfx__ 000300001c3501d3501c15020150261502e1502e3501d15027150381500000000000000001d3501c350193501735014350113500c350093500535000350123000f3000e3000b3000830004300003000000000000 +0004000007350093500a3500d3501035016450184501a4501b4501b4501c4501b4501a450184500e3500e3500e3500e350114501245012450104500e450073500635003350000000e4000c400064000440000000 +00040000175501a5501c5501d5502055023550255502555018250182501825018250182501825016550135500f5500c5500855005550035500255000000000000000000000000000000000000000000000000000 +000300002a6502a6502705023650166501205014650156501905029650290502b6502a650230501e65016050166501a6502b6502b0502b65029650240501b0500000000000000000000000000000000000000000 +000200003e3503e3503e3503d3503c3503b350393503835033350313502c35000000000000000000000000002c4502a4502945000000264500000021450000001b4500000014450114500e4500d4500000000000 diff --git a/src/game.lua b/src/game.lua index 5168a7d..6fb9122 100644 --- a/src/game.lua +++ b/src/game.lua @@ -34,6 +34,7 @@ function new_state(name, init, draw, update, next, timer) update = update, next = next, timer = timer, + timer_max = timer, next_state = false, } end @@ -140,6 +141,8 @@ function player_choose_move() init = function(g) set_txb(g, "") g.menu = move_menu(g.player) + states["player_turn"].timer = 80 + states["enemy_turn"].timer = 80 end update = function(g) @@ -163,9 +166,9 @@ function player_choose_move() draw = function(g) draw_p(g.enemy) - draw_health(g.enemy) + draw_status(g.enemy) draw_p(g.player) - draw_health(g.player) + draw_status(g.player) draw_m(g.menu) end @@ -183,9 +186,9 @@ function enemy_choose_move() draw = function(g) draw_p(g.enemy) - draw_health(g.enemy) + draw_status(g.enemy) draw_p(g.player) - draw_health(g.player) + draw_status(g.player) end return new_state("enemy_choose_move", init, draw, update, "player_turn") @@ -194,7 +197,7 @@ end function player_turn() init = function(g) set_txb(g, g.player.name .. " used " .. g.player_move.name) - g.enemy.health = g.enemy.health - g.player_move.damage + attack(g.enemy, g.player_move) end update = function(g) @@ -202,9 +205,9 @@ function player_turn() draw = function(g) draw_p(g.enemy) - draw_health(g.enemy) + draw_status(g.enemy) draw_p(g.player) - draw_health(g.player) + draw_status(g.player) draw_txb(g.main_txb) end @@ -214,7 +217,7 @@ end function enemy_turn() init = function(g) set_txb(g, g.enemy.name .. " used " .. g.enemy_move.name) - g.player.health = g.player.health - g.enemy_move.damage + attack(g.player, g.enemy_move) end update = function(g) @@ -222,9 +225,9 @@ function enemy_turn() draw = function(g) draw_p(g.enemy) - draw_health(g.enemy) + draw_status(g.enemy) draw_p(g.player) - draw_health(g.player) + draw_status(g.player) draw_txb(g.main_txb) end diff --git a/src/main.lua b/src/main.lua index 91af7dd..e92fd62 100644 --- a/src/main.lua +++ b/src/main.lua @@ -33,6 +33,7 @@ function _update() if t then if t <= 0 then next_state = true + states[gm.state].timer = states[gm.state].timer_max end states[gm.state].timer = t - 1 end diff --git a/src/move.lua b/src/move.lua index 3ef0d6c..f73b2ff 100644 --- a/src/move.lua +++ b/src/move.lua @@ -38,3 +38,108 @@ function leaf_blade() 10 ) end + +function psychic() + return new_move( + "psychic", + 10 + ) +end + +function psybeam() + return new_move( + "psybeam", + 10 + ) +end + +function slam() + return new_move( + "slam", + 10 + ) +end + +function tail_glow() + return new_move( + "tail glow", + 10 + ) +end + +function leech_life() + return new_move( + "leech life", + 10 + ) +end + +function bug_buzz() + return new_move( + "bug buzz", + 10 + ) +end + +function aurora_beam() + return new_move( + "aurora beam", + 10 + ) +end + +function smokescreen() + return new_move( + "smokescreen", + 10 + ) +end + +function double_edge() + return new_move( + "double edge", + 10 + ) +end + +function flash_cannon() + return new_move( + "flash cannon", + 10 + ) +end + +function blast_burn() + return new_move( + "blast burn", + 10 + ) +end + +function taunt() + return new_move( + "taunt", + 10 + ) +end + +function swagger() + return new_move( + "swagger", + 10 + ) +end + +function ice_shard() + return new_move( + "ice shard", + 10 + ) +end + +function ice_punch() + return new_move( + "ice punch", + 10 + ) +end diff --git a/src/pokemon.lua b/src/pokemon.lua index dfa0d26..df9d39d 100644 --- a/src/pokemon.lua +++ b/src/pokemon.lua @@ -81,7 +81,7 @@ function move_menu(p) for n in pairs(p.moves) do add(move_names, n) end - return new_menu(76, 84, move_names) + return new_menu(68, 84, move_names) end function choose_random_move(p) @@ -94,12 +94,22 @@ function choose_random_move(p) return p.moves[choice_move] end -function draw_health(p) +function draw_status(p) h = tostr(p.health) .. "/" .. tostr(p.max_health) if p.enemy then - print(h, 56, 16) + print(p.name, 16, 8) + print(h, 16, 16) else - print(h, 46, 66) + print(p.name, 50, 58) + print(h, 50, 66) + end +end + +function attack(p, move) + dmg = flr(rnd(move.damage)) + 1 + p.health = p.health - dmg + if p.health < 0 then + p.health = 0 end end @@ -108,12 +118,24 @@ end function pokemon_menu() return new_menu(30, 8, { "axoleafel", + "paraplat", + "rainborachnid", + "fumineral", + "antagonice", }) end function choose(name, enemy) if name == "axoleafel" then return axoleafel(enemy) + elseif name == "paraplat" then + return paraplat(enemy) + elseif name == "rainborachnid" then + return rainborachnid(enemy) + elseif name == "fumineral" then + return fumineral(enemy) + elseif name == "antagonice" then + return antagonice(enemy) end end @@ -133,3 +155,71 @@ function axoleafel(enemy) } ) end + +function paraplat(enemy) + return new_pokemon( + "paraplat", + enemy, + 0, + 12, + 1, + 50, + { + tackle(), + slam(), + psychic(), + psybeam(), + } + ) +end + +function rainborachnid(enemy) + return new_pokemon( + "rainborachnid", + enemy, + 64, + 68, + 2, + 50, + { + leech_life(), + tail_glow(), + bug_buzz(), + aurora_beam(), + } + ) +end + +function fumineral(enemy) + return new_pokemon( + "fumineral", + enemy, + 72, + 76, + 3, + 50, + { + smokescreen(), + flash_cannon(), + double_edge(), + blast_burn(), + } + ) +end + +function antagonice(enemy) + return new_pokemon( + "antagonice", + enemy, + 128, + 132, + 4, + 50, + { + taunt(), + ice_punch(), + ice_shard(), + swagger(), + } + ) +end