From 611b2df57e6bca50013d5001f6c7b529a10b98ca Mon Sep 17 00:00:00 2001 From: xolatile Date: Thu, 13 Jun 2024 08:00:19 -0400 Subject: [PATCH] Making several changes inspired by Wizardry game... --- source/main.adb | 18 +++++------------- source/world.adb | 35 +++++++++-------------------------- source/world.ads | 14 +------------- 3 files changed, 15 insertions(+), 52 deletions(-) diff --git a/source/main.adb b/source/main.adb index d68487e..125e82b 100644 --- a/source/main.adb +++ b/source/main.adb @@ -38,15 +38,10 @@ procedure main is core.signal_v => ui.iterate_style'access, core.signal_kp_add => core.zoom_in'access, core.signal_kp_subtract => core.zoom_out'access, - core.signal_f1 => world.resource_cheat_1'access, - core.signal_f2 => world.resource_cheat_2'access, - core.signal_f3 => world.resource_cheat_3'access, - core.signal_f4 => world.resource_cheat_4'access, - core.signal_f5 => world.resource_cheat_5'access, - core.signal_f6 => world.resource_cheat_6'access, - core.signal_f7 => world.reveal_map'access, - core.signal_f8 => world.restore_points'access, - core.signal_f9 => world.increase_attributes'access, + core.signal_f1 => world.reveal_map'access, + core.signal_f2 => world.restore_points'access, + core.signal_f3 => world.increase_attributes'access, + core.signal_f4 => world.increase_resources'access, others => core.idle_skip'access ); @@ -431,15 +426,12 @@ begin end loop; end; -- - if world.battle_active then - world.draw_battle; - end if; - -- signal_list (core.signal_mode).all; -- core.camera.x := world.map.chads (1).x; core.camera.y := world.map.chads (1).y; -- + world.restore_points; ui.synchronize; end loop gameplay_loop; diff --git a/source/world.adb b/source/world.adb index e62d650..565f061 100644 --- a/source/world.adb +++ b/source/world.adb @@ -759,17 +759,6 @@ package body world is ------------------------------------------------------------------------------------------ - procedure draw_battle is - begin - core.echo (core.failure, "Battles are not implemented yet!"); - -- - map.chads (1).y := map.chads (1).y + 1; - -- - battle_active := false; - end draw_battle; - - ------------------------------------------------------------------------------------------ - procedure mapshot (file_path : in string) is begin if not map_is_revealed then @@ -856,15 +845,6 @@ package body world is ------------------------------------------------------------------------------------------ - procedure resource_cheat_1 is begin core.increment (map.chads (1).resources (resource.gold).value, 20); end resource_cheat_1; - procedure resource_cheat_2 is begin core.increment (map.chads (1).resources (resource.wood).value, 10); end resource_cheat_2; - procedure resource_cheat_3 is begin core.increment (map.chads (1).resources (resource.stone).value, 10); end resource_cheat_3; - procedure resource_cheat_4 is begin core.increment (map.chads (1).resources (resource.metal).value, 10); end resource_cheat_4; - procedure resource_cheat_5 is begin core.increment (map.chads (1).resources (resource.leather).value, 10); end resource_cheat_5; - procedure resource_cheat_6 is begin core.increment (map.chads (1).resources (resource.gem).value, 10); end resource_cheat_6; - - ------------------------------------------------------------------------------------------ - procedure reveal_map is begin for x in 0 .. map.width - 1 loop @@ -894,6 +874,15 @@ package body world is ------------------------------------------------------------------------------------------ + procedure increase_resources is + begin + for index in resource.enumeration loop + map.chads (1).resources (index) := map.chads (1).resources (index) + 10; + end loop; + end increase_resources; + + ------------------------------------------------------------------------------------------ + procedure player_up is begin if map.chads (1).movement.value = 0 then return; end if; @@ -1254,12 +1243,6 @@ package body world is x => offset.x + (map.chads (index).x - core.camera.x) * core.base * core.zoom, y => offset.y + (map.chads (index).y - core.camera.y) * core.base * core.zoom, factor => core.zoom); - -- - if map.chads (index).x = core.camera.x and map.chads (index).y = core.camera.y and index > 1 then - battle_active := true; - battle_left := map.chads (1); - battle_right := map.chads (index); - end if; end if; end loop; end draw_chads; diff --git a/source/world.ads b/source/world.ads index d1db735..9463948 100644 --- a/source/world.ads +++ b/source/world.ads @@ -40,11 +40,6 @@ package world is map : definition; - battle_active : boolean := false; - battle_map : definition; - battle_left : chad.information; - battle_right : chad.information; - review_unit_data : unit.enumeration; review_chad_data : chad.enumeration; @@ -84,21 +79,14 @@ package world is procedure draw; - procedure draw_battle; - procedure mapshot (file_path : in string); function map_is_revealed return boolean; - procedure resource_cheat_1; - procedure resource_cheat_2; - procedure resource_cheat_3; - procedure resource_cheat_4; - procedure resource_cheat_5; - procedure resource_cheat_6; procedure reveal_map; procedure restore_points; procedure increase_attributes; + procedure increase_resources; procedure player_up; procedure player_down;