Added Material package...
This commit is contained in:
parent
99763d4d64
commit
b4e01ceba2
@ -5,7 +5,7 @@
|
||||
pragma ada_2012;
|
||||
|
||||
--~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;
|
||||
with core, ui, effect, attribute, skill, resource, faction, material, equipment, unit, construction, chad, world;
|
||||
|
||||
use core;
|
||||
|
||||
@ -151,6 +151,7 @@ begin
|
||||
resource.configure;
|
||||
--~might.configure;
|
||||
--~magic.configure;
|
||||
material.configure;
|
||||
equipment.configure;
|
||||
unit.configure;
|
||||
construction.configure;
|
||||
|
33
source/material.adb
Normal file
33
source/material.adb
Normal file
@ -0,0 +1,33 @@
|
||||
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
|
||||
--
|
||||
-- GNU General Public Licence (version 3 or later)
|
||||
|
||||
with core, ui;
|
||||
|
||||
package body material is
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
sprite : array (enumeration) of core.sprite;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure configure is
|
||||
begin
|
||||
core.echo (core.comment, "Configuring material components...");
|
||||
--
|
||||
for index in enumeration loop
|
||||
sprite (index) := core.import_sprite ("./sprite/material/" & core.lowercase (enumeration'image (index)) & ".png", 1, 1);
|
||||
end loop;
|
||||
end configure;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure draw (index : in enumeration; x, y : in integer) is
|
||||
begin
|
||||
core.draw (sprite (index), x, y);
|
||||
end draw;
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
end material;
|
42
source/material.ads
Normal file
42
source/material.ads
Normal file
@ -0,0 +1,42 @@
|
||||
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
|
||||
--
|
||||
-- GNU General Public Licence (version 3 or later)
|
||||
|
||||
with core;
|
||||
|
||||
package material is
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
type enumeration is (
|
||||
sulphur, mercury, mint, cinnamon
|
||||
);
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
type information is record
|
||||
name : core.short_string;
|
||||
cost : natural;
|
||||
end record;
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
count : constant natural := enumeration'pos (enumeration'last) + 1;
|
||||
|
||||
trait : constant array (enumeration) of information := (
|
||||
("-- ", 0),
|
||||
("Sulphur ", 7),
|
||||
("Mercury ", 13),
|
||||
("Mint ", 3),
|
||||
("Cinnamon ", 5)
|
||||
);
|
||||
|
||||
------------------------------------------------------------------------------------------
|
||||
|
||||
procedure configure;
|
||||
|
||||
procedure draw (index : in enumeration; x, y : in integer);
|
||||
|
||||
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
||||
|
||||
end material;
|
@ -23,11 +23,11 @@ package unit is
|
||||
end record;
|
||||
|
||||
type value is record
|
||||
name : core.short_string := "-- ";
|
||||
kind : enumeration := imp_base;
|
||||
state : core.animation := core.idle;
|
||||
attributes : attribute.points := (others => 0);
|
||||
equipments : equipment.equip_array := (others => equipment.empty);
|
||||
name : core.short_string := "-- ";
|
||||
kind : enumeration := imp_base;
|
||||
state : core.animation := core.idle;
|
||||
attributes : attribute.points := (others => 0);
|
||||
equipments : equipment.equip_array := (others => equipment.empty);
|
||||
end record;
|
||||
|
||||
type value_limit is range 0 .. 90;
|
||||
|
BIN
sprite/material/cinnamon.png
Normal file
BIN
sprite/material/cinnamon.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 147 B |
BIN
sprite/material/mercury.png
Normal file
BIN
sprite/material/mercury.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 162 B |
BIN
sprite/material/mint.png
Normal file
BIN
sprite/material/mint.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 180 B |
BIN
sprite/material/sulphur.png
Normal file
BIN
sprite/material/sulphur.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 176 B |
Loading…
Reference in New Issue
Block a user