From 611ac283959bdac2301c25bb7b054466ce7c004e Mon Sep 17 00:00:00 2001 From: xolatile Date: Mon, 13 May 2024 15:43:06 -0400 Subject: [PATCH] Reimplemented magics and added 3 new ones... --- source/magic.adb | 33 +++++++++++++++++++++------------ source/magic.ads | 3 ++- source/main.adb | 4 ++-- source/ui.ads | 1 - sprite/magic/air/arrow_storm.png | Bin 934 -> 1375 bytes sprite/magic/earth/stone_armour.png | Bin 931 -> 1215 bytes sprite/magic/water/ice_armour.png | Bin 978 -> 1434 bytes 7 files changed, 25 insertions(+), 16 deletions(-) diff --git a/source/magic.adb b/source/magic.adb index f07acb0..fb8d1cd 100644 --- a/source/magic.adb +++ b/source/magic.adb @@ -8,11 +8,10 @@ package body magic is ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ - view_width : constant natural := 90; - view_height : constant natural := 90; + view_width : constant natural := 64; + view_height : constant natural := 64; view_sprite : array (enumeration) of core.sprite; - icon_sprite : array (enumeration) of core.sprite; ------------------------------------------------------------------------------------------ @@ -25,26 +24,36 @@ package body magic is file : constant string := core.lowercase (enumeration'image (index)); begin view_sprite (index) := core.import_sprite ("./sprite/magic/" & folder & "/" & file & ".png", 1, 1); - icon_sprite (index) := core.import_sprite ("./sprite/magic/icon/" & file & ".png", 1, 1); end; end loop; end configure; ------------------------------------------------------------------------------------------ - procedure icon (index : in enumeration; x, y : in integer) is + procedure view (index : in enumeration; x, y : in integer) is + offset : constant integer := 8; begin - ui.draw_overicon (icon_sprite (index), trait (index).text, x, y); - end icon; + ui.draw_frame (trait (index).text, x, y, view_width + 2 * offset, view_height + 2 * offset); + core.draw (view_sprite (index), x + offset, y + offset); + end view; ------------------------------------------------------------------------------------------ - procedure view (index : in enumeration; x, y : in integer) is - offset : constant integer := 4; + procedure menu (x, y : in integer; center : in boolean) is + offset : constant integer := core.icon; + width : constant integer := count * view_width + (count + 1) * offset + offset / 2; + height : constant integer := view_height + 2 * offset + offset / 2; begin - core.draw (view_sprite (index), x + offset, y + offset); - ui.draw_icon_menu (trait (index).text, x, y, view_width + 2 * offset, view_height + 2 * offset); - end view; + ui.draw_tiny_menu (x => (if center then (core.window_width - width) / 2 else x), + y => (if center then (core.window_height - height) / 2 else y), + width => width, + height => height); + -- + for index in enumeration loop + view (index, (if center then (core.window_width - width) / 2 else x) + offset + enumeration'pos (index) * (offset + view_width), + (if center then (core.window_height - height) / 2 else y) + offset); + end loop; + end menu; ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ diff --git a/source/magic.ads b/source/magic.ads index e8838b5..de5a53c 100644 --- a/source/magic.ads +++ b/source/magic.ads @@ -56,9 +56,10 @@ package magic is procedure configure; - procedure icon (index : in enumeration; x, y : in integer); procedure view (index : in enumeration; x, y : in integer); + procedure menu (x, y : in integer; center : in boolean); + ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ end magic; diff --git a/source/main.adb b/source/main.adb index 3df6e09..ef38765 100644 --- a/source/main.adb +++ b/source/main.adb @@ -5,7 +5,7 @@ pragma ada_2012; --~with core, ui, effect, attribute, skill, resource, faction, might, magic, equipment, unit, construction, chad, deity, world, ai; -with core, ui, effect, attribute, skill, resource, faction, material, equipment, unit, construction, chad, world; +with core, ui, effect, attribute, skill, resource, faction, material, magic, equipment, unit, construction, chad, world; with ada.strings.unbounded; use ada.strings.unbounded; @@ -194,7 +194,7 @@ begin skill.configure; resource.configure; --~might.configure; - --~magic.configure; + magic.configure; material.configure; equipment.configure; unit.configure; diff --git a/source/ui.ads b/source/ui.ads index 2219173..d9799f5 100644 --- a/source/ui.ads +++ b/source/ui.ads @@ -75,7 +75,6 @@ package ui is procedure draw_menu (x, y, width, height : in integer); procedure draw_tiny_menu (x, y, width, height : in integer); - procedure draw_icon_menu (x, y, width, height : in integer); procedure draw_state_box (x, y : in integer); diff --git a/sprite/magic/air/arrow_storm.png b/sprite/magic/air/arrow_storm.png index 55c7b72e445fea99787b3780c0ab9024c6bd3fa6..bd68788aec0b74f23011f1198305b111ffa4a75f 100644 GIT binary patch del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A=HcA#w-e)eE{g`{g8-@Up}_mlSYV1ESQ}DpKbPge zJYfweH4NZV(5c9Qc5?Qt*6N%H(P8lC^?IvA341Jf7}gZ%Tzw_m!tMZkz%_+^1#ZH^ zrwonsV`@Un3V#CM{qBp21V0CSBthT%TzJnj(!*RbGAOo&Il#n*3J&~jo}rvLJP5j4 z`)((UhTQPETC4psKC2FaxbPHc=bW;YB0Zc_2|G}>!@Y)EK@GfAMASyY$71LkJTDaq zz-urQj9Pf-Tod@3NPy3Vv!tcMTWg!Z=S09Rg~`)O4u5>d6`_jQs*5v0X?RFj_` zOwtDQ_PWR;F)8n#1)dTG=IRecQ3BL>UuxphYE&@PRUUSXZ#njJo+qT{1=UF~<@Ik# zgyK11M94Q4fI8nFHU4w+fT`*KXAJ#R1g7$Uk!-j(JS5sv!^Wq&+oQ6xQTP=%aYfK$E7@xD~ln33>j7&Qzh#CpQFo>&c84c2--wf5j#Q*ST| zeCs?Cjeyv*bE%=Q6+B@{ugP8D{}fWhSgEldQ%~%DL6a_k@jMm2=jbrCtegXqE7L+4 zlUPck^T0Pe_^5s;ipc}5y-&HY{lD2fU?jZQM1Lsk2An96zBt*x^k&G6GW0BKf~GG= zd&6^Hjus=JWmk|~=y2fQ0#NtoN{Y}s>-&*?hyd!|nlmKD6g+l|%s~Lo2BTULM(-5+ z$N?in7zzI&z;ju2jR-x2fOfd>{#M|_V#xmiM4;@!_4e+uYgJ2js7_X;0YgZ_aD zj&ukyA-wxpz+t^L@UacyQwSf+2_+F?28Q3M-J`{Jd0&LXOt5rfWb}avDtHRs@9Lxz zBc(|24LbXgnd}px+@UFq2%&*zJ~Z`F=&Hx&qMo|s!O2{K-+XlT@9^~1uYdZ#y-y!y Rr`G@g002ovPDHLkV1n@ZyA%Kb diff --git a/sprite/magic/earth/stone_armour.png b/sprite/magic/earth/stone_armour.png index a71947938f5101aacc8e9917be24a3e783be7d40..192201590715ae94c9c7f3a653229b8881baad5a 100644 GIT binary patch delta 1175 zcmV;I1Zex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