Explorar el Código

A lot of major refactoring, adding world data soon...

master
Ognjen Milan Robovic hace 3 semanas
padre
commit
39335fe890
Se han modificado 6 ficheros con 42 adiciones y 8 borrados
  1. +13
    -0
      source/attribute.adb
  2. +2
    -0
      source/attribute.ads
  3. +8
    -1
      source/chad.adb
  4. +4
    -3
      source/chad.ads
  5. +13
    -4
      source/main.adb
  6. +2
    -0
      source/ui.adb

+ 13
- 0
source/attribute.adb Ver fichero

@@ -35,6 +35,19 @@ package body attribute is
end loop;
end configure;

------------------------------------------------------------------------------------------

procedure draw_points (data : in points; x, y : in integer; list : in boolean) is
offset : constant core.vector := ((if list then 0 else core.icon),
(if list then core.icon else 0));
begin
for index in enumeration loop
ui.draw_icon (sprite (index), trait (index).text, x + offset.x * enumeration'pos (index), y + offset.y * enumeration'pos (index));
--
ui.write (data (index)'image, x + offset.x * enumeration'pos (index) + 3, y + offset.y * enumeration'pos (index) + core.icon + 3, size => 18);
end loop;
end draw_points;

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

end attribute;

+ 2
- 0
source/attribute.ads Ver fichero

@@ -39,6 +39,8 @@ package attribute is

procedure configure;

procedure draw_points (data : in points; x, y : in integer; list : in boolean);

------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------

end attribute;

+ 8
- 1
source/chad.adb Ver fichero

@@ -2,7 +2,7 @@
--
-- GNU General Public Licence (version 3 or later)

with core, ui, faction;
with core, ui, attribute, skill, resource, faction;

package body chad is

@@ -37,6 +37,13 @@ package body chad is

------------------------------------------------------------------------------------------

procedure draw_data (player : in data; x, y : in integer) is
begin
attribute.draw_points (player.attributes, x, y, false);
end draw_data;

------------------------------------------------------------------------------------------

procedure draw_pepe is
begin
core.draw (pepe_the_frog, (core.window_width - core.base) / 2, (core.window_height - core.base) / 2);


+ 4
- 3
source/chad.ads Ver fichero

@@ -36,8 +36,8 @@ package chad is
trait : constant array (enumeration) of information := (
("Ada Augusta King ", faction.fairy, attribute.defense, skill.diplomacy, resource.metal),
("Richard Martin Stallman ", faction.dwarf, attribute.offense, skill.leadership, resource.wood),
("Ognjen Milan Robovic ", faction.gnoll, attribute.stamina, skill.archery, resource.leather),
("Wouter van Oortmerssen ", faction.kobold, attribute.speed, skill.medicine, resource.stone),
("Ognjen Milan Robovic ", faction.kobold, attribute.stamina, skill.archery, resource.leather),
("Wouter van Oortmerssen ", faction.gnoll, attribute.speed, skill.medicine, resource.stone),
("John Warner Backus ", faction.goblin, attribute.wisdom, skill.sorcery, resource.gem),
("Marina Ann Hantzis ", faction.imp, attribute.reach, skill.necromancy, resource.gold)
);
@@ -46,7 +46,8 @@ package chad is

procedure configure;

procedure draw (index : in enumeration; x, y : in integer);
procedure draw (index : in enumeration; x, y : in integer);
procedure draw_data (player : in data; x, y : in integer);

procedure draw_pepe;
procedure draw_alice;


+ 13
- 4
source/main.adb Ver fichero

@@ -20,7 +20,12 @@ procedure main is
preview_height : integer := 0;
text_box_height : integer := 0;

player : chad.information := chad.trait (chad.ognjen);
player : chad.data := (
index => chad.ognjen,
attributes => (1, 2, 3, 4, 5, 6),
skills => (1, 2, 3, 4, 5, 6, others => 12),
resources => (1, 2, 3, 4, 5, 6)
);

------------------------------------------------------------------------------------------

@@ -47,10 +52,11 @@ procedure main is
);

game_title : sprite;
game_preview : array (world.biome) of sprite; -- sand, grass, rough, snow, swamp
game_preview : array (world.biome) of sprite;

switch : natural := 0;
choose : world.biome := world.ash;
choose : world.biome := world.grass;

------------------------------------------------------------------------------------------

procedure check_move_camera_up is
@@ -144,7 +150,8 @@ procedure main is
--
if view_list (status_preview_panel) then
ui.draw_tiny_menu (preview_width, 0, side_panel, preview_height);
ui.draw_state_box (preview_width + 32, 32);
chad.draw_data (player, preview_width + 32, 32);
--~ui.draw_state_box (preview_width + 32, 32);
end if;
--
if view_list (text_box_panel) then
@@ -245,6 +252,8 @@ begin
main_menu;
end loop main_menu_loop;

ui.active := ui.style'val (faction.enumeration'pos (chad.trait (player.index).kind) + 1);

gameplay_loop: loop
synchronize;
--


+ 2
- 0
source/ui.adb Ver fichero

@@ -220,6 +220,8 @@ package body ui is
begin
prioritize := false;
--
write_text_box ("--");
--
for index in 0 .. structure_count - 1 loop
if signal_mode = structure_array (index).toggle then
structure_array (index).show := not structure_array (index).show;


Cargando…
Cancelar
Guardar