diff --git a/source/chad.adb b/source/chad.adb index 8dff503..4295b3f 100644 --- a/source/chad.adb +++ b/source/chad.adb @@ -53,9 +53,9 @@ package body chad is -- ui.draw_sprite (view (player.index), description (player.index).name, x + offset, y + offset, 0); -- - ui.draw_tiny_fill_bar (x + view_width + 2 * offset, y + 1 * core.icon + offset, 360 - view_width - offset, float (player.health.value) / float (player.health.limit), (127, 0, 0, 255)); - ui.draw_tiny_fill_bar (x + view_width + 2 * offset, y + 2 * core.icon + offset, 360 - view_width - offset, float (player.mana.value) / float (player.mana.limit), (0, 0, 127, 255)); - ui.draw_tiny_fill_bar (x + view_width + 2 * offset, y + 3 * core.icon + offset, 360 - view_width - offset, float (player.stamina.value) / float (player.stamina.limit), (0, 127, 0, 255)); + ui.draw_tiny_fill_bar (x + view_width + 2 * offset, y + 1 * core.icon + offset, 360 - view_width - offset, float (player.health.value) / float (player.health.limit), (127, 0, 0, 255)); + ui.draw_tiny_fill_bar (x + view_width + 2 * offset, y + 2 * core.icon + offset, 360 - view_width - offset, float (player.mana.value) / float (player.mana.limit), (0, 0, 127, 255)); + ui.draw_tiny_fill_bar (x + view_width + 2 * offset, y + 3 * core.icon + offset, 360 - view_width - offset, float (player.movement.value) / float (player.movement.limit), (0, 127, 0, 255)); -- ui.write (text => "Health " & player.health.value'image & " /" & player.health.limit'image, x => x + view_width + core.icon + 3 * offset, @@ -69,7 +69,7 @@ package body chad is tint => (127, 127, 255, 255), size => 15, code => true); - ui.write (text => "Stamina" & player.stamina.value'image & " /" & player.stamina.limit'image, + ui.write (text => "Stamina" & player.movement.value'image & " /" & player.movement.limit'image, x => x + view_width + core.icon + 3 * offset, y => y + 2 * core.icon + 2 * offset, tint => (127, 255, 127, 255), @@ -138,7 +138,7 @@ package body chad is -- core.save_point (here, data.health); core.save_point (here, data.mana); - core.save_point (here, data.stamina); + core.save_point (here, data.movement); -- attribute.save_points (here, data.attributes); skill.save_points (here, data.skills); @@ -170,7 +170,7 @@ package body chad is -- core.load_point (here, data.health); core.load_point (here, data.mana); - core.load_point (here, data.stamina); + core.load_point (here, data.movement); -- attribute.load_points (here, data.attributes); skill.load_points (here, data.skills); diff --git a/source/chad.ads b/source/chad.ads index 089d327..ae62396 100644 --- a/source/chad.ads +++ b/source/chad.ads @@ -33,7 +33,7 @@ package chad is y : integer; health : core.point; mana : core.point; - stamina : core.point; + movement : core.point; attributes : attribute.points; skills : skill.points; resources : resource.points; diff --git a/source/main.adb b/source/main.adb index ff7e93c..f2de561 100644 --- a/source/main.adb +++ b/source/main.adb @@ -47,6 +47,7 @@ procedure main is core.signal_f5 => world.resource_cheat_5'access, core.signal_f6 => world.resource_cheat_6'access, core.signal_f7 => world.reveal_map'access, + core.signal_f8 => world.restore_points'access, core.signal_f => core.toggle_fullscreen'access, others => core.idle_skip'access ); @@ -125,7 +126,7 @@ procedure main is y => 0, health => (30, 40), mana => (20, 30), - stamina => (10, 20), + movement => (10, 20), attributes => attribute.default, skills => skill.default, resources => ((101, 240), (103, 240), (107, 240), (109, 240), (113, 240), (127, 240)), diff --git a/source/world.adb b/source/world.adb index 5811827..241ef11 100644 --- a/source/world.adb +++ b/source/world.adb @@ -779,12 +779,25 @@ package body world is ------------------------------------------------------------------------------------------ + procedure restore_points is + begin + map.chads (1).health.value := map.chads (1).health.limit; + map.chads (1).mana.value := map.chads (1).mana.limit; + map.chads (1).movement.value := map.chads (1).movement.limit; + end restore_points; + + ------------------------------------------------------------------------------------------ + procedure player_up is begin core.decrement (map.chads (1).y); core.clip (map.chads (1).y, 0, map.height - 1); + map.chads (1).movement := map.chads (1).movement - 1; if map.clips (map.chads (1).x, map.chads (1).y) then core.increment (map.chads (1).y); + if map.chads (1).movement.value > 0 then + map.chads (1).movement := map.chads (1).movement + 1; + end if; end if; end player_up; @@ -794,8 +807,12 @@ package body world is begin core.increment (map.chads (1).y); core.clip (map.chads (1).y, 0, map.height - 1); + map.chads (1).movement := map.chads (1).movement - 1; if map.clips (map.chads (1).x, map.chads (1).y) then core.decrement (map.chads (1).y); + if map.chads (1).movement.value > 0 then + map.chads (1).movement := map.chads (1).movement + 1; + end if; end if; end player_down; @@ -805,8 +822,12 @@ package body world is begin core.decrement (map.chads (1).x); core.clip (map.chads (1).x, 0, map.width - 1); + map.chads (1).movement := map.chads (1).movement - 1; if map.clips (map.chads (1).x, map.chads (1).y) then core.increment (map.chads (1).x); + if map.chads (1).movement.value > 0 then + map.chads (1).movement := map.chads (1).movement + 1; + end if; end if; end player_left; @@ -816,8 +837,12 @@ package body world is begin core.increment (map.chads (1).x); core.clip (map.chads (1).x, 0, map.width - 1); + map.chads (1).movement := map.chads (1).movement - 1; if map.clips (map.chads (1).x, map.chads (1).y) then core.decrement (map.chads (1).x); + if map.chads (1).movement.value > 0 then + map.chads (1).movement := map.chads (1).movement + 1; + end if; end if; end player_right; diff --git a/source/world.ads b/source/world.ads index 9d75c10..04eb797 100644 --- a/source/world.ads +++ b/source/world.ads @@ -170,6 +170,7 @@ package world is procedure resource_cheat_5; procedure resource_cheat_6; procedure reveal_map; + procedure restore_points; procedure player_up; procedure player_down; diff --git a/ui/arrow_e.png b/ui/arrow_e.png new file mode 100644 index 0000000..5487480 Binary files /dev/null and b/ui/arrow_e.png differ diff --git a/ui/arrow_n.png b/ui/arrow_n.png new file mode 100644 index 0000000..422a93b Binary files /dev/null and b/ui/arrow_n.png differ diff --git a/ui/arrow_s.png b/ui/arrow_s.png new file mode 100644 index 0000000..ef83e20 Binary files /dev/null and b/ui/arrow_s.png differ diff --git a/ui/arrow_w.png b/ui/arrow_w.png new file mode 100644 index 0000000..cfe8797 Binary files /dev/null and b/ui/arrow_w.png differ diff --git a/ui/place.png b/ui/place.png new file mode 100644 index 0000000..13b200a Binary files /dev/null and b/ui/place.png differ