|
|
@@ -8,36 +8,34 @@ package ai is |
|
|
|
none, walk, talk, find |
|
|
|
); |
|
|
|
|
|
|
|
type mind_limit is ( |
|
|
|
thirst, hunger, fatigue, solitude, |
|
|
|
); |
|
|
|
|
|
|
|
subtype string_16 is string (1 .. 16); |
|
|
|
|
|
|
|
envy : constant natural := 2#00000001#; |
|
|
|
gluttony : constant natural := 2#00000010#; |
|
|
|
greed : constant natural := 2#00000100#; |
|
|
|
lust : constant natural := 2#00001000#; |
|
|
|
pride : constant natural := 2#00010000#; |
|
|
|
sloth : constant natural := 2#00100000#; |
|
|
|
wrath : constant natural := 2#01000000#; |
|
|
|
|
|
|
|
thirst : constant natural := 2#00000001#; |
|
|
|
hunger : constant natural := 2#00000010#; |
|
|
|
fatigue : constant natural := 2#00000100#; |
|
|
|
solitude : constant natural := 2#00001000#; |
|
|
|
health : constant natural := 2#00010000#; |
|
|
|
mana : constant natural := 2#00100000#; |
|
|
|
boredom : constant natural := 2#01000000#; |
|
|
|
|
|
|
|
agent_digit : constant natural := 4; |
|
|
|
agent_state : constant natural := 4; |
|
|
|
agent_digit : constant natural := 8; |
|
|
|
agent_state : constant natural := 2; |
|
|
|
agent_count : constant natural := 4; |
|
|
|
|
|
|
|
type name_limit is mod 400; |
|
|
|
type clan_limit is mod 120; |
|
|
|
type data_limit is mod agent_state ** agent_digit - 1; |
|
|
|
|
|
|
|
envy : constant data_limit := 2#00000001#; |
|
|
|
gluttony : constant data_limit := 2#00000010#; |
|
|
|
greed : constant data_limit := 2#00000100#; |
|
|
|
lust : constant data_limit := 2#00001000#; |
|
|
|
pride : constant data_limit := 2#00010000#; |
|
|
|
sloth : constant data_limit := 2#00100000#; |
|
|
|
wrath : constant data_limit := 2#01000000#; |
|
|
|
|
|
|
|
thirst : constant data_limit := 2#00000001#; |
|
|
|
hunger : constant data_limit := 2#00000010#; |
|
|
|
fatigue : constant data_limit := 2#00000100#; |
|
|
|
solitude : constant data_limit := 2#00001000#; |
|
|
|
health : constant data_limit := 2#00010000#; |
|
|
|
mana : constant data_limit := 2#00100000#; |
|
|
|
boredom : constant data_limit := 2#01000000#; |
|
|
|
|
|
|
|
type byte is new natural range 0 .. 2 ** 8 - 1; |
|
|
|
|
|
|
|
type action_data is |
|
|
|
record |
|
|
|
base : data_limit; |
|
|
@@ -49,9 +47,8 @@ package ai is |
|
|
|
record |
|
|
|
name : name_limit; |
|
|
|
clan : clan_limit; |
|
|
|
data : data_limit; |
|
|
|
soul : soul_limit; |
|
|
|
mind : mind_limit; |
|
|
|
soul : data_limit; |
|
|
|
mind : data_limit; |
|
|
|
work : action; |
|
|
|
x : natural; |
|
|
|
y : natural; |
|
|
@@ -59,16 +56,21 @@ package ai is |
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------ |
|
|
|
|
|
|
|
function agent_is_thirsty (index : in natural) return boolean; |
|
|
|
function agent_is_hungry (index : in natural) return boolean; |
|
|
|
|
|
|
|
procedure action_none; |
|
|
|
procedure action_walk; |
|
|
|
procedure action_talk; |
|
|
|
procedure action_find; |
|
|
|
|
|
|
|
agent : array (1 .. agent_count) of agent_data := (others => (0, 0, 3, 3, walk, 0, 0)); |
|
|
|
|
|
|
|
action_array : constant array (action) of action_data := ( |
|
|
|
(4#3000#, action_none'access, "standing "), |
|
|
|
(4#3000#, action_walk'access, "walking "), |
|
|
|
(4#3000#, action_talk'access, "talking "), |
|
|
|
(4#3000#, action_find'access, "finding ") |
|
|
|
(2#00000000#, action_none'access, "standing "), |
|
|
|
(2#00000000#, action_walk'access, "walking "), |
|
|
|
(2#00000000#, action_talk'access, "talking "), |
|
|
|
(2#00000000#, action_find'access, "finding ") |
|
|
|
); |
|
|
|
|
|
|
|
male_name_array : constant array (name_limit) of string_16 := ( |
|
|
|