diff --git a/source/item.adb b/source/equipment.adb similarity index 83% rename from source/item.adb rename to source/equipment.adb index 72e5827..fa89f62 100644 --- a/source/item.adb +++ b/source/equipment.adb @@ -4,19 +4,19 @@ with core; -package body item is +package body equipment is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ procedure configure is begin - core.echo (core.comment, "Configuring item components..."); + core.echo (core.comment, "Configuring equipment components..."); -- for index in enumeration loop declare folder : constant string := core.lowercase (slot'image (trait (index).kind)); file : constant string := core.lowercase (enumeration'image (index)); begin - sprite (index) := core.import_sprite ("./sprite/item/" & folder & "/" & file & ".png", 4, 6); + sprite (index) := core.import_sprite ("./sprite/equipment/" & folder & "/" & file & ".png", 4, 6); end; end loop; end configure; @@ -30,4 +30,4 @@ package body item is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -end item; +end equipment; diff --git a/source/item.ads b/source/equipment.ads similarity index 99% rename from source/item.ads rename to source/equipment.ads index 63c2e5c..5a2b693 100644 --- a/source/item.ads +++ b/source/equipment.ads @@ -4,7 +4,7 @@ with core, effect, attribute, faction; -package item is +package equipment is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ @@ -47,7 +47,7 @@ package item is end record; type value is record - data : enumeration := item.none; + data : enumeration := equipment.none; show : boolean := true; end record; @@ -55,7 +55,7 @@ package item is ------------------------------------------------------------------------------------------ - empty : constant value := (item.none, false); + empty : constant value := (equipment.none, false); count : constant natural := enumeration'pos (enumeration'last) + 1; @@ -180,4 +180,4 @@ package item is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ -end item; +end equipment; diff --git a/source/main.adb b/source/main.adb index 9ba343f..7a73d87 100644 --- a/source/main.adb +++ b/source/main.adb @@ -4,8 +4,8 @@ pragma ada_2012; ---~with core, ui, effect, attribute, skill, resource, faction, might, magic, item, unit, construction, chad, deity, world, ai; -with core, ui, effect, attribute, skill, resource, faction, item, unit, construction, chad, world; +--~with core, ui, effect, attribute, skill, resource, faction, might, magic, equipment, unit, construction, chad, deity, world, ai; +with core, ui, effect, attribute, skill, resource, faction, equipment, unit, construction, chad, world; use core; @@ -154,7 +154,7 @@ begin resource.configure; --~might.configure; --~magic.configure; - item.configure; + equipment.configure; unit.configure; construction.configure; chad.configure; diff --git a/source/unit.adb b/source/unit.adb index cd2fbcf..2c35514 100644 --- a/source/unit.adb +++ b/source/unit.adb @@ -62,9 +62,9 @@ package body unit is begin draw (values (limit).kind, values (limit).state, x, y); -- - for item_index in item.slot loop - if values (limit).items (item_index).show then - item.draw (values (limit).items (item_index).data, values (limit).state, x, y); + for equipment_index in equipment.slot loop + if values (limit).equipments (equipment_index).show then + equipment.draw (values (limit).equipments (equipment_index).data, values (limit).state, x, y); end if; end loop; end draw_full; diff --git a/source/unit.ads b/source/unit.ads index 3ff64f7..5626784 100644 --- a/source/unit.ads +++ b/source/unit.ads @@ -2,7 +2,7 @@ -- -- GNU General Public Licence (version 3 or later) -with core, effect, attribute, faction, item; +with core, effect, attribute, faction, equipment; package unit is @@ -27,7 +27,7 @@ package unit is kind : enumeration := imp_base; state : core.animation := core.idle; attributes : attribute.points := (others => 0); - items : item.equip_array := (others => item.empty); + equipments : equipment.equip_array := (others => equipment.empty); end record; type value_limit is range 0 .. 100; @@ -50,16 +50,16 @@ package unit is values : value_array := ( ("Dwarf Berserker ", dwarf_base, core.idle, (3, 2, 1, 3, 2, 2), - (item.main_hand => (item.mithril_axe, true), - others => item.empty)), + (equipment.main_hand => (equipment.mithril_axe, true), + others => equipment.empty)), -- ("Dwarf Berserker ", dwarf_base, core.idle, (3, 2, 1, 3, 2, 2), - (item.main_hand => (item.mithril_battleaxe, true), - others => item.empty)), + (equipment.main_hand => (equipment.mithril_battleaxe, true), + others => equipment.empty)), -- ("Dwarf Berserker ", dwarf_base, core.idle, (3, 2, 1, 3, 2, 2), - (item.main_hand => (item.mithril_mace, true), - others => item.empty)), + (equipment.main_hand => (equipment.mithril_mace, true), + others => equipment.empty)), -- others => default_value ); diff --git a/source/world.adb b/source/world.adb index c45fa31..dbe3ad3 100644 --- a/source/world.adb +++ b/source/world.adb @@ -2,7 +2,7 @@ -- -- GNU General Public Licence (version 3 or later) -with core, ui, resource, item, unit, construction; +with core, ui, resource, equipment, unit, construction; package body world is @@ -65,7 +65,7 @@ package body world is map.views := new view_array (0 .. map.width - 1, 0 .. map.height - 1); map.landmarks := new entity_array (1 .. landmark_limit); map.constructions := new entity_array (1 .. 30); - map.items := new entity_array (1 .. 60); + map.equipments := new entity_array (1 .. 60); map.units := new entity_array (1 .. 90); -- for x in 0 .. width - 1 loop @@ -111,9 +111,9 @@ package body world is end loop; -- for index in 1 .. 60 loop - map.items (index).index := core.random (0, item.count - 1); - map.items (index).x := core.random (0, map.width - 1); - map.items (index).y := core.random (0, map.height - 1); + map.equipments (index).index := core.random (0, equipment.count - 1); + map.equipments (index).x := core.random (0, map.width - 1); + map.equipments (index).y := core.random (0, map.height - 1); end loop; -- for index in 1 .. 90 loop @@ -211,11 +211,11 @@ package body world is end loop; -- for index in 1 .. 60 loop - if map.views (map.items (index).x, map.items (index).y) then - item.draw (item.enumeration'val (map.items (index).index), + if map.views (map.equipments (index).x, map.equipments (index).y) then + equipment.draw (equipment.enumeration'val (map.equipments (index).index), core.idle, - offset.x + (map.items (index).x - core.camera.x) * core.base * core.zoom, - offset.y + (map.items (index).y - core.camera.y) * core.base * core.zoom); + offset.x + (map.equipments (index).x - core.camera.x) * core.base * core.zoom, + offset.y + (map.equipments (index).y - core.camera.y) * core.base * core.zoom); end if; end loop; -- @@ -281,13 +281,13 @@ package body world is end loop; -- for index in 1 .. 60 loop - core.render_image (data => item.sprite (item.enumeration'val (map.items (index).index)), + core.render_image (data => equipment.sprite (equipment.enumeration'val (map.equipments (index).index)), x => map.landmarks (index).x * core.base, y => map.landmarks (index).y * core.base, u => 0, v => 0, - width => item.sprite (item.enumeration'val (map.items (index).index)).width, - height => item.sprite (item.enumeration'val (map.items (index).index)).height); + width => equipment.sprite (equipment.enumeration'val (map.equipments (index).index)).width, + height => equipment.sprite (equipment.enumeration'val (map.equipments (index).index)).height); end loop; -- core.export_image (file_path); diff --git a/source/world.ads b/source/world.ads index 8e0b4c1..5f9bd65 100644 --- a/source/world.ads +++ b/source/world.ads @@ -2,7 +2,7 @@ -- -- GNU General Public Licence (version 3 or later) -with core, item, unit, construction; +with core, equipment, unit, construction; package world is @@ -44,7 +44,7 @@ package world is views : access view_array; landmarks : access entity_array; constructions : access entity_array; - items : access entity_array; + equipments : access entity_array; units : access entity_array; end record;