diff --git a/source/ai.adb b/source/ai.adb index 122cd40..3caf569 100644 --- a/source/ai.adb +++ b/source/ai.adb @@ -6,20 +6,20 @@ package body ai is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - function agent_is_envious (index : in natural) return boolean is begin return (agent (index).soul and envy) = envy; end agent_is_envious; - function agent_is_glutton (index : in natural) return boolean is begin return (agent (index).soul and gluttony) = gluttony; end agent_is_glutton; - function agent_is_greed (index : in natural) return boolean is begin return (agent (index).soul and greed) = greed; end agent_is_greed; - function agent_is_slutty (index : in natural) return boolean is begin return (agent (index).soul and lust) = lust; end agent_is_slutty; - function agent_is_proud (index : in natural) return boolean is begin return (agent (index).soul and pride) = pride; end agent_is_proud; - function agent_is_lazy (index : in natural) return boolean is begin return (agent (index).soul and sloth) = sloth; end agent_is_lazy; - function agent_is_angry (index : in natural) return boolean is begin return (agent (index).soul and wrath) = wrath; end agent_is_angry; - function agent_is_thirsty (index : in natural) return boolean is begin return (agent (index).mind and thirst) = thirst; end agent_is_thirsty; - function agent_is_hungry (index : in natural) return boolean is begin return (agent (index).mind and hunger) = hunger; end agent_is_hungry; - function agent_is_tired (index : in natural) return boolean is begin return (agent (index).mind and fatigue) = fatigue; end agent_is_tired; - function agent_is_lonely (index : in natural) return boolean is begin return (agent (index).mind and solitude) = solitude; end agent_is_lonely; - function agent_is_healthy (index : in natural) return boolean is begin return (agent (index).mind and health) = health; end agent_is_healthy; - function agent_is_happy (index : in natural) return boolean is begin return (agent (index).mind and joy) = joy; end agent_is_happy; - function agent_is_bored (index : in natural) return boolean is begin return (agent (index).mind and boredom) = boredom; end agent_is_bored; + function agent_is_envious (index : in natural) return boolean is begin return (agent (index).soul and envy) = envy; end agent_is_envious; + function agent_is_glutton (index : in natural) return boolean is begin return (agent (index).soul and gluttony) = gluttony; end agent_is_glutton; + function agent_is_greedy (index : in natural) return boolean is begin return (agent (index).soul and greed) = greed; end agent_is_greedy; + function agent_is_slutty (index : in natural) return boolean is begin return (agent (index).soul and lust) = lust; end agent_is_slutty; + function agent_is_proud (index : in natural) return boolean is begin return (agent (index).soul and pride) = pride; end agent_is_proud; + function agent_is_lazy (index : in natural) return boolean is begin return (agent (index).soul and sloth) = sloth; end agent_is_lazy; + function agent_is_angry (index : in natural) return boolean is begin return (agent (index).soul and wrath) = wrath; end agent_is_angry; + function agent_is_thirsty (index : in natural) return boolean is begin return (agent (index).mind and thirst) = thirst; end agent_is_thirsty; + function agent_is_hungry (index : in natural) return boolean is begin return (agent (index).mind and hunger) = hunger; end agent_is_hungry; + function agent_is_tired (index : in natural) return boolean is begin return (agent (index).mind and fatigue) = fatigue; end agent_is_tired; + function agent_is_lonely (index : in natural) return boolean is begin return (agent (index).mind and solitude) = solitude; end agent_is_lonely; + function agent_is_healthy (index : in natural) return boolean is begin return (agent (index).mind and health) = health; end agent_is_healthy; + function agent_is_happy (index : in natural) return boolean is begin return (agent (index).mind and joy) = joy; end agent_is_happy; + function agent_is_bored (index : in natural) return boolean is begin return (agent (index).mind and boredom) = boredom; end agent_is_bored; ------------------------------------------------------------------------------------------ @@ -32,7 +32,7 @@ package body ai is procedure serialize (i : in natural) is begin - if agent_is_bored (index) and agent_is_healthy (i) and not agent_is_hungry (i) then + if agent_is_bored (i) and agent_is_healthy (i) and not agent_is_hungry (i) then null; end if; end serialize; @@ -69,6 +69,33 @@ package body ai is end loop; end review; + procedure view_agent_state (index : in integer) is + width : integer := 320; + height : integer := 544; + offset : integer := 32; + x : integer := (core.window_width - width) / 2; + y : integer := (core.window_height - height) / 2; + begin + ui.draw_tiny_menu (x, y, width, height, true); + -- + core.write (male_name_array (agent (index).name), x + offset, y + offset, ui.glyphs (ui.active)); + -- + core.write ("Envious =" & boolean'image (agent_is_envious (index)), x + offset, y + offset + 32, ui.glyphs (ui.active)); + core.write ("Glutton =" & boolean'image (agent_is_glutton (index)), x + offset, y + offset + 64, ui.glyphs (ui.active)); + core.write ("Greedy =" & boolean'image (agent_is_greedy (index)), x + offset, y + offset + 96, ui.glyphs (ui.active)); + core.write ("Slutty =" & boolean'image (agent_is_slutty (index)), x + offset, y + offset + 128, ui.glyphs (ui.active)); + core.write ("Proud =" & boolean'image (agent_is_proud (index)), x + offset, y + offset + 160, ui.glyphs (ui.active)); + core.write ("Lazy =" & boolean'image (agent_is_lazy (index)), x + offset, y + offset + 192, ui.glyphs (ui.active)); + core.write ("Angry =" & boolean'image (agent_is_angry (index)), x + offset, y + offset + 224, ui.glyphs (ui.active)); + core.write ("Thirsty =" & boolean'image (agent_is_thirsty (index)), x + offset, y + offset + 256, ui.glyphs (ui.active)); + core.write ("Hungry =" & boolean'image (agent_is_hungry (index)), x + offset, y + offset + 288, ui.glyphs (ui.active)); + core.write ("Tired =" & boolean'image (agent_is_tired (index)), x + offset, y + offset + 320, ui.glyphs (ui.active)); + core.write ("Lonely =" & boolean'image (agent_is_lonely (index)), x + offset, y + offset + 352, ui.glyphs (ui.active)); + core.write ("Healthy =" & boolean'image (agent_is_healthy (index)), x + offset, y + offset + 384, ui.glyphs (ui.active)); + core.write ("Happy =" & boolean'image (agent_is_happy (index)), x + offset, y + offset + 416, ui.glyphs (ui.active)); + core.write ("Bored =" & boolean'image (agent_is_bored (index)), x + offset, y + offset + 448, ui.glyphs (ui.active)); + end view_agent_state; + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end ai; diff --git a/source/ai.ads b/source/ai.ads index 19c9e12..be8747e 100644 --- a/source/ai.ads +++ b/source/ai.ads @@ -64,8 +64,6 @@ package ai is -- -- Trickster ? - type byte is new natural range 0 .. 2 ** 8 - 1; - type action_data is record base : data_limit; @@ -88,7 +86,7 @@ package ai is function agent_is_envious (index : in natural) return boolean; -- wtf function agent_is_glutton (index : in natural) return boolean; -- wtf - function agent_is_greed (index : in natural) return boolean; -- wtf + function agent_is_greedy (index : in natural) return boolean; -- wtf function agent_is_slutty (index : in natural) return boolean; -- wtf function agent_is_proud (index : in natural) return boolean; -- wtf function agent_is_lazy (index : in natural) return boolean; -- wtf @@ -106,6 +104,8 @@ package ai is procedure action_talk; procedure action_find; + procedure view_agent_state (index : in integer); + agent : array (1 .. agent_count) of agent_data := ((0, 0, 1, 1, walk, 0, 0), others => (0, 0, 3, 3, walk, 0, 0)); action_array : constant array (action) of action_data := ( diff --git a/source/main.adb b/source/main.adb index e1dc842..5b8c3f5 100644 --- a/source/main.adb +++ b/source/main.adb @@ -160,6 +160,7 @@ begin signal_list (core.signal_code'val (core.signal_mode)).all; -- ai.review; + ai.view_agent_state (1); -- menu_render; --