Prototype game engine for Heroes of Might & Magic, featuring a gameplay plot-twist...
Ви не можете вибрати більше 25 тем Теми мають розпочинатися з літери або цифри, можуть містити дефіси (-) і не повинні перевищувати 35 символів.

59 рядки
2.4KB

  1. -- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
  2. --
  3. -- GNU General Public Licence (version 3 or later)
  4. with core, ui, effect, attribute, faction;
  5. package body unit is
  6. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  7. view_width : constant integer := 48;
  8. view_height : constant integer := 64;
  9. base : array (faction.fairy .. faction.imp) of core.sprite;
  10. --~icon : array (enumeration) of core.sprite;
  11. --~view : array (enumeration) of core.sprite;
  12. ------------------------------------------------------------------------------------------
  13. procedure configure is
  14. begin
  15. core.echo (core.comment, "Configuring unit components...");
  16. --
  17. for index in faction.fairy .. faction.imp loop
  18. base (index) := core.import_sprite (core.folder & "/game/unit/" & core.lowercase (faction.enumeration'image (index)) & "/base.png", 4, 6);
  19. end loop;
  20. end configure;
  21. ------------------------------------------------------------------------------------------
  22. procedure draw (index : in enumeration; state : in core.animation; x, y : in integer) is
  23. begin
  24. core.draw (base (description (index).kind), x, y, state => state);
  25. --
  26. for slot in equipment.slot loop
  27. core.draw (equipment.sprite (description (index).equipments (slot)), x, y, state => state);
  28. end loop;
  29. end draw;
  30. ------------------------------------------------------------------------------------------
  31. --~procedure draw_icon (index : in enumeration; x, y : in integer) is
  32. --~begin
  33. --~ui.draw_overicon (icon (index), description (index).text, x, y);
  34. --~end draw_icon;
  35. ------------------------------------------------------------------------------------------
  36. --~procedure draw_view (index : in enumeration; x, y : in integer) is
  37. --~offset : constant integer := 4;
  38. --~begin
  39. --~core.draw (view (index), x + offset, y + offset);
  40. --~ui.draw_icon_menu (x, y, view_width + 2 * offset, view_height + 2 * offset);
  41. --~end draw_view;
  42. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  43. end unit;