with core, ui, ai; use ai; package body ai is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ 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; ------------------------------------------------------------------------------------------ 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; ------------------------------------------------------------------------------------------ procedure serialize (i : in natural) is begin --~if actor_is_bored (i) and actor_is_healthy (i) and not actor_is_hungry (i) then null; --~end if; end serialize; ------------------------------------------------------------------------------------------ procedure configure is begin core.echo (core.failure, "No AI yet folk!"); end configure; ------------------------------------------------------------------------------------------ procedure synchronize is begin null; end synchronize; ------------------------------------------------------------------------------------------ procedure review is --~width : integer := 600; --~height : integer := 300; --~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); --~for index in 1 .. actor_count --~loop --~core.write ("Bot" & integer'image (index), x + offset + 0, y * index + offset, ui.glyphs (ui.active)); --~core.write ("T =" & boolean'image (actor_is_thirsty (index)), x + offset + 120, y * index + offset, ui.glyphs (ui.active)); --~core.write ("H =" & boolean'image (actor_is_hungry (index)), x + offset + 240, y * index + offset, ui.glyphs (ui.active)); --~end loop; null; end review; ------------------------------------------------------------------------------------------ procedure view_actor_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); -- active := index; -- ui.write (male_name_array (actor (index).name), x + offset, y + offset); -- ui.write ("Envious = " & boolean'image (actor_is_envious), x + offset, y + offset + 32); ui.write ("Glutton = " & boolean'image (actor_is_glutton), x + offset, y + offset + 64); ui.write ("Greedy = " & boolean'image (actor_is_greedy), x + offset, y + offset + 96); ui.write ("Slutty = " & boolean'image (actor_is_slutty), x + offset, y + offset + 128); ui.write ("Proud = " & boolean'image (actor_is_proud), x + offset, y + offset + 160); ui.write ("Lazy = " & boolean'image (actor_is_lazy), x + offset, y + offset + 192); ui.write ("Angry = " & boolean'image (actor_is_angry), x + offset, y + offset + 224); ui.write ("Thirsty = " & boolean'image (actor_is_thirsty), x + offset, y + offset + 256); ui.write ("Hungry = " & boolean'image (actor_is_hungry), x + offset, y + offset + 288); ui.write ("Tired = " & boolean'image (actor_is_tired), x + offset, y + offset + 320); ui.write ("Lonely = " & boolean'image (actor_is_lonely), x + offset, y + offset + 352); ui.write ("Healthy = " & boolean'image (actor_is_healthy), x + offset, y + offset + 384); ui.write ("Happy = " & boolean'image (actor_is_happy), x + offset, y + offset + 416); ui.write ("Bored = " & boolean'image (actor_is_bored), x + offset, y + offset + 448); end view_actor_state; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end ai;