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

132 строки
5.7KB

  1. -- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
  2. --
  3. -- GNU General Public Licence (version 3 or later)
  4. with core, equipment, unit, construction, chad, effect;
  5. package world is
  6. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  7. type biome is (
  8. ash, sand, grass, rough, snow, swamp
  9. );
  10. type landmark_index is (
  11. dead_tree, mossy_rock, palm_tree, pine_tree, pine_forest, reeds,
  12. rock, snowed_pine_tree, snowed_rock, spiky_rock, wooden_sign, wooden_arrow_sign,
  13. rune_stone, snowed_rune_stone, mossy_rune_stone, snowed_pine_forest, hyacinths, orchids,
  14. asters, daffodils, royal_grave, grave, humble_grave, wooden_wide_sign
  15. );
  16. type location_index is (
  17. well_of_agility, well_of_knowledge, well_of_strength
  18. );
  19. ------------------------------------------------------------------------------------------
  20. type landmark_stats is record
  21. name : core.short_string;
  22. spawn : biome;
  23. clip : boolean;
  24. frames : integer;
  25. end record;
  26. type location_stats is record
  27. name : core.short_string;
  28. clip : boolean;
  29. frames : integer;
  30. states : integer;
  31. evoke : effect.value;
  32. end record;
  33. type entity_trait is record
  34. index : natural;
  35. state : natural;
  36. x, y : integer;
  37. end record;
  38. type integer_matrix is array (natural range <>, natural range <>) of integer;
  39. type boolean_matrix is array (natural range <>, natural range <>) of boolean;
  40. type entity_array is array (natural range <>) of entity_trait;
  41. type information is record
  42. kind : biome;
  43. width : natural;
  44. height : natural;
  45. chad_count : natural;
  46. chad_limit : natural;
  47. earth : access integer_matrix;
  48. clips : access boolean_matrix;
  49. views : access boolean_matrix;
  50. landmarks : access entity_array;
  51. locations : access entity_array;
  52. constructions : access entity_array;
  53. equipments : access entity_array;
  54. units : access entity_array;
  55. chads : access chad.value_array;
  56. end record;
  57. ------------------------------------------------------------------------------------------
  58. biome_count : constant natural := biome'pos (biome'last) + 1;
  59. landmarks : array (landmark_index) of core.sprite;
  60. locations : array (location_index) of core.sprite;
  61. landmark_count : constant natural := landmark_index'pos (landmark_index'last) + 1;
  62. location_count : constant natural := location_index'pos (location_index'last) + 1;
  63. landmark_trait : constant array (landmark_index) of landmark_stats := (
  64. dead_tree => ("Dead Tree ", ash, true, 1),
  65. mossy_rock => ("Mossy Rock ", swamp, true, 1),
  66. palm_tree => ("Palm Tree ", sand, true, 4),
  67. pine_tree => ("Pine Tree ", grass, true, 4),
  68. pine_forest => ("Pine Forest ", grass, true, 4),
  69. reeds => ("Reeds ", swamp, false, 4),
  70. rock => ("Rock ", sand, true, 1),
  71. snowed_pine_tree => ("Snowed Pine Tree ", snow, true, 4),
  72. snowed_rock => ("Snowed Rock ", snow, true, 1),
  73. spiky_rock => ("Spiky Rock ", ash, true, 1),
  74. wooden_sign => ("Wooden Sign ", grass, false, 1),
  75. wooden_arrow_sign => ("Wooden Arrow Sign ", grass, false, 1),
  76. rune_stone => ("Rune Stone ", grass, true, 4),
  77. snowed_rune_stone => ("Snowed Rune Stone ", snow, true, 1),
  78. mossy_rune_stone => ("Mossy Rune Stone ", swamp, true, 4),
  79. snowed_pine_forest => ("Snowed Pine Forest ", snow, true, 4),
  80. hyacinths => ("Hyacinths ", grass, false, 1),
  81. orchids => ("Orchids ", grass, false, 1),
  82. asters => ("Asters ", grass, false, 1),
  83. daffodils => ("Daffodils ", grass, false, 1),
  84. royal_grave => ("Royal Grave ", ash, true, 1),
  85. grave => ("Grave ", ash, true, 1),
  86. humble_grave => ("Humble Grave ", ash, true, 1),
  87. wooden_wide_sign => ("Wooden Wide Sign ", grass, false, 1)
  88. );
  89. location_trait : constant array (location_index) of location_stats := (
  90. well_of_agility => ("Well of Agility ", true, 4, 3, (effect.player_add, effect.attribute_speed, 2, false, 0)),
  91. well_of_knowledge => ("Well of Knowledge ", true, 4, 3, (effect.player_add, effect.attribute_wisdom, 2, false, 0)),
  92. well_of_strength => ("Well of Strength ", true, 4, 3, (effect.player_add, effect.attribute_offense, 2, false, 0))
  93. );
  94. map : information;
  95. ------------------------------------------------------------------------------------------
  96. procedure configure;
  97. procedure make (index : in biome; width, height, chad_limit : in natural);
  98. procedure draw;
  99. procedure mapshot (file_path : in string);
  100. procedure reveal_map;
  101. procedure add_chad (data : in chad.value);
  102. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  103. end world;