2024-04-25 00:27:13 -04:00
|
|
|
-- Copyright (c) 2024 - Ognjen 'xolatile' Milan Robovic
|
|
|
|
--
|
|
|
|
-- GNU General Public Licence (version 3 or later)
|
|
|
|
|
2024-03-22 00:37:54 -04:00
|
|
|
with core, ui, ai;
|
|
|
|
|
|
|
|
package body ai is
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
2024-03-25 14:28:49 -04:00
|
|
|
function actor_is_envious return boolean is begin return (actor (active).soul and envy) = envy; end actor_is_envious;
|
|
|
|
function actor_is_glutton return boolean is begin return (actor (active).soul and gluttony) = gluttony; end actor_is_glutton;
|
|
|
|
function actor_is_greedy return boolean is begin return (actor (active).soul and greed) = greed; end actor_is_greedy;
|
|
|
|
function actor_is_slutty return boolean is begin return (actor (active).soul and lust) = lust; end actor_is_slutty;
|
|
|
|
function actor_is_proud return boolean is begin return (actor (active).soul and pride) = pride; end actor_is_proud;
|
|
|
|
function actor_is_lazy return boolean is begin return (actor (active).soul and sloth) = sloth; end actor_is_lazy;
|
|
|
|
function actor_is_angry return boolean is begin return (actor (active).soul and wrath) = wrath; end actor_is_angry;
|
|
|
|
function actor_is_thirsty return boolean is begin return (actor (active).mind and thirst) = thirst; end actor_is_thirsty;
|
|
|
|
function actor_is_hungry return boolean is begin return (actor (active).mind and hunger) = hunger; end actor_is_hungry;
|
|
|
|
function actor_is_tired return boolean is begin return (actor (active).mind and fatigue) = fatigue; end actor_is_tired;
|
|
|
|
function actor_is_lonely return boolean is begin return (actor (active).mind and solitude) = solitude; end actor_is_lonely;
|
|
|
|
function actor_is_healthy return boolean is begin return (actor (active).mind and health) = health; end actor_is_healthy;
|
|
|
|
function actor_is_happy return boolean is begin return (actor (active).mind and joy) = joy; end actor_is_happy;
|
|
|
|
function actor_is_bored return boolean is begin return (actor (active).mind and boredom) = boredom; end actor_is_bored;
|
2024-03-24 09:14:54 -04:00
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
procedure action_none is begin null; end action_none;
|
|
|
|
procedure action_walk is begin null; end action_walk;
|
|
|
|
procedure action_talk is begin null; end action_talk;
|
|
|
|
procedure action_find is begin null; end action_find;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
2024-03-24 08:07:42 -04:00
|
|
|
|
2024-03-24 11:24:00 -04:00
|
|
|
procedure serialize (i : in natural) is
|
|
|
|
begin
|
2024-03-25 14:28:49 -04:00
|
|
|
--~if actor_is_bored (i) and actor_is_healthy (i) and not actor_is_hungry (i) then
|
2024-03-24 11:24:00 -04:00
|
|
|
null;
|
2024-03-25 14:28:49 -04:00
|
|
|
--~end if;
|
2024-03-24 11:24:00 -04:00
|
|
|
end serialize;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
2024-03-22 00:37:54 -04:00
|
|
|
procedure configure is
|
|
|
|
begin
|
2024-03-22 11:08:37 -04:00
|
|
|
core.echo (core.failure, "No AI yet folk!");
|
2024-03-22 00:37:54 -04:00
|
|
|
end configure;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
2024-03-24 07:46:56 -04:00
|
|
|
procedure synchronize is
|
|
|
|
begin
|
2024-03-25 14:28:49 -04:00
|
|
|
null;
|
2024-03-24 07:46:56 -04:00
|
|
|
end synchronize;
|
|
|
|
|
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
2024-03-24 09:14:54 -04:00
|
|
|
procedure review is
|
2024-03-25 14:28:49 -04:00
|
|
|
--~width : integer := 600;
|
|
|
|
--~height : integer := 300;
|
|
|
|
--~offset : integer := 32;
|
|
|
|
--~x : integer := (core.window_width - width) / 2;
|
|
|
|
--~y : integer := (core.window_height - height) / 2;
|
2024-03-24 09:14:54 -04:00
|
|
|
begin
|
2024-03-25 14:28:49 -04:00
|
|
|
--~ui.draw_tiny_menu (x, y, width, height, true);
|
|
|
|
--~for index in 1 .. actor_count
|
|
|
|
--~loop
|
2024-04-23 16:33:07 -04:00
|
|
|
--~core.write ("Bot" & index'image, x + offset + 0, y * index + offset, ui.glyphs (ui.active));
|
|
|
|
--~core.write ("T =" & actor_is_thirsty (index)'image, x + offset + 120, y * index + offset, ui.glyphs (ui.active));
|
|
|
|
--~core.write ("H =" & actor_is_hungry (index)'image, x + offset + 240, y * index + offset, ui.glyphs (ui.active));
|
2024-03-25 14:28:49 -04:00
|
|
|
--~end loop;
|
|
|
|
null;
|
2024-03-24 09:14:54 -04:00
|
|
|
end review;
|
2024-03-22 11:08:37 -04:00
|
|
|
|
2024-03-25 14:28:49 -04:00
|
|
|
------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
procedure view_actor_state (index : in integer) is
|
2024-03-24 11:49:29 -04:00
|
|
|
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);
|
|
|
|
--
|
2024-03-25 14:28:49 -04:00
|
|
|
active := index;
|
|
|
|
--
|
2024-04-23 16:19:29 -04:00
|
|
|
ui.write (male_name_array (actor (index).name), x + offset, y + offset);
|
2024-03-24 11:49:29 -04:00
|
|
|
--
|
2024-04-23 16:33:07 -04:00
|
|
|
ui.write ("Envious = " & actor_is_envious'image, x + offset, y + offset + 32);
|
|
|
|
ui.write ("Glutton = " & actor_is_glutton'image, x + offset, y + offset + 64);
|
|
|
|
ui.write ("Greedy = " & actor_is_greedy'image, x + offset, y + offset + 96);
|
|
|
|
ui.write ("Slutty = " & actor_is_slutty'image, x + offset, y + offset + 128);
|
|
|
|
ui.write ("Proud = " & actor_is_proud'image, x + offset, y + offset + 160);
|
|
|
|
ui.write ("Lazy = " & actor_is_lazy'image, x + offset, y + offset + 192);
|
|
|
|
ui.write ("Angry = " & actor_is_angry'image, x + offset, y + offset + 224);
|
|
|
|
ui.write ("Thirsty = " & actor_is_thirsty'image, x + offset, y + offset + 256);
|
|
|
|
ui.write ("Hungry = " & actor_is_hungry'image, x + offset, y + offset + 288);
|
|
|
|
ui.write ("Tired = " & actor_is_tired'image, x + offset, y + offset + 320);
|
|
|
|
ui.write ("Lonely = " & actor_is_lonely'image, x + offset, y + offset + 352);
|
|
|
|
ui.write ("Healthy = " & actor_is_healthy'image, x + offset, y + offset + 384);
|
|
|
|
ui.write ("Happy = " & actor_is_happy'image, x + offset, y + offset + 416);
|
|
|
|
ui.write ("Bored = " & actor_is_bored'image, x + offset, y + offset + 448);
|
2024-03-25 14:28:49 -04:00
|
|
|
end view_actor_state;
|
2024-03-24 11:49:29 -04:00
|
|
|
|
2024-03-22 00:37:54 -04:00
|
|
|
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
|
|
|
|
|
|
|
|
end ai;
|