diff --git a/icon/engine/chest.png b/icon/engine/chest.png new file mode 100644 index 0000000..264abf5 Binary files /dev/null and b/icon/engine/chest.png differ diff --git a/icon/engine/feet.png b/icon/engine/feet.png new file mode 100644 index 0000000..348317b Binary files /dev/null and b/icon/engine/feet.png differ diff --git a/icon/engine/full_body.png b/icon/engine/full_body.png new file mode 100644 index 0000000..045de8f Binary files /dev/null and b/icon/engine/full_body.png differ diff --git a/icon/engine/hands.png b/icon/engine/hands.png new file mode 100644 index 0000000..1fb1029 Binary files /dev/null and b/icon/engine/hands.png differ diff --git a/icon/engine/head.png b/icon/engine/head.png new file mode 100644 index 0000000..ed68db3 Binary files /dev/null and b/icon/engine/head.png differ diff --git a/icon/engine/main_hand.png b/icon/engine/main_hand.png new file mode 100644 index 0000000..175125a Binary files /dev/null and b/icon/engine/main_hand.png differ diff --git a/icon/engine/neck.png b/icon/engine/neck.png new file mode 100644 index 0000000..252ffb2 Binary files /dev/null and b/icon/engine/neck.png differ diff --git a/icon/engine/off_hand.png b/icon/engine/off_hand.png new file mode 100644 index 0000000..b8c31d3 Binary files /dev/null and b/icon/engine/off_hand.png differ diff --git a/source/equipment.ads b/source/equipment.ads index 626a66d..cf2f90a 100644 --- a/source/equipment.ads +++ b/source/equipment.ads @@ -8,7 +8,7 @@ package equipment is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - type slot is ( + type kind is ( full_body, head, chest, hands, feet, neck, main_hand, off_hand ); @@ -46,13 +46,13 @@ package equipment is type definition is record name : access string := new string'("--"); - kind : slot := full_body; + slot : kind := full_body; attributes : attribute.bonus := (others => 0); favor : faction.enumeration := faction.neutral; evoke : effect.information := effect.none; end record; - type equip_array is array (slot) of enumeration; + type equip_array is array (kind) of enumeration; ------------------------------------------------------------------------------------------ @@ -214,6 +214,7 @@ package equipment is sprite : array (enumeration) of core.sprite; icon : array (enumeration) of core.sprite; + slot : array (kind) of core.sprite; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/main.adb b/source/main.adb index 9757098..892359f 100644 --- a/source/main.adb +++ b/source/main.adb @@ -281,13 +281,20 @@ begin core.echo (core.comment, "Configuring" & equipment.count'image & " equipment components..."); -- for index in equipment.enumeration loop - declare folder : constant string := core.lowercase (equipment.slot'image (equipment.description (index).kind)); + declare folder : constant string := core.lowercase (equipment.kind'image (equipment.description (index).slot)); file : constant string := core.lowercase (equipment.enumeration'image (index)); begin equipment.sprite (index) := core.import_sprite (core.folder & "/game/equipment/" & folder & "/" & file & ".png", 4, 6); equipment.icon (index) := core.import_sprite (core.folder & "/icon/equipment/" & folder & "/" & file & ".png", 1, 1); end; end loop; + -- + for index in equipment.kind loop + declare file : constant string := core.lowercase (equipment.kind'image (index)); + begin + equipment.slot (index) := core.import_sprite (core.folder & "/icon/engine/" & file & ".png", 1, 1); + end; + end loop; core.echo (core.comment, "Configuring" & unit.count'image & " unit components..."); -- diff --git a/source/world.adb b/source/world.adb index 2dcbbd4..73c7285 100644 --- a/source/world.adb +++ b/source/world.adb @@ -320,8 +320,8 @@ package body world is for index in resource.enumeration loop core.save_point (file, map.chads (1).resources (index)); end loop; for index in material.enumeration loop core.save_point (file, map.chads (1).materials (index)); end loop; -- - for index in equipment.slot loop - core.io.write (file, equipment.enumeration'pos (map.chads (1).equipments (index))); + for kind in equipment.kind loop + core.io.write (file, equipment.enumeration'pos (map.chads (1).equipments (kind))); end loop; -- core.io.write (file, map.chads (1).item_count); @@ -389,8 +389,8 @@ package body world is for index in resource.enumeration loop core.load_point (file, map.chads (1).resources (index)); end loop; for index in material.enumeration loop core.load_point (file, map.chads (1).materials (index)); end loop; -- - for index in equipment.slot loop - core.io.read (file, this); map.chads (1).equipments (index) := equipment.enumeration'val (this); + for kind in equipment.kind loop + core.io.read (file, this); map.chads (1).equipments (kind) := equipment.enumeration'val (this); end loop; -- core.io.read (file, map.chads (1).item_count); @@ -1030,10 +1030,10 @@ package body world is y => offset.y + (map.units (index).y - core.camera.y) * core.base * core.zoom, state => core.animation'val (map.units (index).state)); -- - for slot in equipment.slot loop - if equipment.enumeration'pos (unit.description (unit.enumeration'val (map.units (index).index)).equipments (slot)) + for kind in equipment.kind loop + if equipment.enumeration'pos (unit.description (unit.enumeration'val (map.units (index).index)).equipments (kind)) /= equipment.enumeration'pos (equipment.none) then - core.draw (data => equipment.sprite (unit.description (unit.enumeration'val (map.units (index).index)).equipments (slot)), + core.draw (data => equipment.sprite (unit.description (unit.enumeration'val (map.units (index).index)).equipments (kind)), x => offset.x + (map.units (index).x - core.camera.x) * core.base * core.zoom, y => offset.y + (map.units (index).y - core.camera.y) * core.base * core.zoom, state => core.animation'val (map.units (index).state)); @@ -1051,8 +1051,8 @@ package body world is y => offset.y + (map.chads (index).y - core.camera.y) * core.base * core.zoom, state => map.chads (index).state); -- - for slot in equipment.slot loop - core.draw (data => equipment.sprite (map.chads (index).equipments (slot)), + for kind in equipment.kind loop + core.draw (data => equipment.sprite (map.chads (index).equipments (kind)), x => offset.x + (map.chads (index).x - core.camera.x) * core.base * core.zoom, y => offset.y + (map.chads (index).y - core.camera.y) * core.base * core.zoom, state => map.chads (index).state);