Commiting...

This commit is contained in:
Ognjen Milan Robovic 2023-10-15 12:56:21 -04:00
parent 678c901ef7
commit 1f732843d9
13 changed files with 265 additions and 170 deletions

View File

@ -10,12 +10,19 @@
-- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... -- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
with ada.text_io;
with core; with core;
package body action is package body action is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
procedure scan is
begin
ada.text_io.get_immediate (signal);
end scan;
procedure bind (symbol : character := core.cancel; procedure bind (symbol : character := core.cancel;
mimimi : procedure_pointer := game_idle'access) is mimimi : procedure_pointer := game_idle'access) is
begin begin

View File

@ -10,6 +10,8 @@
-- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... -- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
with ada.text_io;
with core; with core;
package action is package action is
@ -31,6 +33,8 @@ package action is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
procedure scan;
procedure bind (symbol : character := core.cancel; procedure bind (symbol : character := core.cancel;
mimimi : procedure_pointer := game_idle'access); mimimi : procedure_pointer := game_idle'access);

View File

@ -17,7 +17,7 @@ package ammunition is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
type ammunition_list is ( type ammunition_list is (
ARROWS, BOLTS, SLINGSHOTS, JARIDS arrows, bolts, slingshots, jarids
); );
type ammunition_mark is mod 72; type ammunition_mark is mod 72;

View File

@ -17,17 +17,17 @@ package animal is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
type animal_list is ( type animal_list is (
ANIMAL_PIG, ANIMAL_COW, ANIMAL_CHICKEN, ANIMAL_SHEEP, ANIMAL_BOAR, ANIMAL_GOAT, ANIMAL_AUROCH, ANIMAL_DUCK, animal_pig, animal_cow, animal_chicken, animal_sheep, animal_boar, animal_goat, animal_auroch, animal_duck,
ANIMAL_DOG, ANIMAL_CAT, ANIMAL_RABBIT, ANIMAL_HAMSTER, ANIMAL_HORSE, ANIMAL_DONKEY, ANIMAL_CAMEL, ANIMAL_ELEPHANT, animal_dog, animal_cat, animal_rabbit, animal_hamster, animal_horse, animal_donkey, animal_camel, animal_elephant,
ANIMAL_OWL, ANIMAL_HAWK, ANIMAL_PIGEON, ANIMAL_VULTURE, ANIMAL_CROW, ANIMAL_PHEASANT, ANIMAL_SPARROW, ANIMAL_ALBATROSS, animal_owl, animal_hawk, animal_pigeon, animal_vulture, animal_crow, animal_pheasant, animal_sparrow, animal_albatross,
ANIMAL_SARDINE, ANIMAL_HERRING, ANIMAL_CATFISH, ANIMAL_CARP, ANIMAL_WHALE, ANIMAL_SHARK, ANIMAL_SQUID, ANIMAL_SAWFISH, animal_sardine, animal_herring, animal_catfish, animal_carp, animal_whale, animal_shark, animal_squid, animal_sawfish,
ANIMAL_WORM, ANIMAL_BEE, ANIMAL_CENTIPEDE, ANIMAL_SPIDER, ANIMAL_FROG, ANIMAL_RAT, ANIMAL_BAT, ANIMAL_MOLE, animal_worm, animal_bee, animal_centipede, animal_spider, animal_frog, animal_rat, animal_bat, animal_mole,
ANIMAL_WOLF, ANIMAL_FOX, ANIMAL_BEAR, ANIMAL_MAMMOTH, ANIMAL_ELK, ANIMAL_MOOSE, ANIMAL_DEER, ANIMAL_PEEBLES, animal_wolf, animal_fox, animal_bear, animal_mammoth, animal_elk, animal_moose, animal_deer, animal_peebles,
ANIMAL_LION, ANIMAL_HYENA, ANIMAL_BISON, ANIMAL_ZEBRA, ANIMAL_GIRAFFE, ANIMAL_CROCODILE, ANIMAL_MONKEY, ANIMAL_GNU, animal_lion, animal_hyena, animal_bison, animal_zebra, animal_giraffe, animal_crocodile, animal_monkey, animal_gnu,
ANIMAL_CARIBOU, ANIMAL_SEAL, ANIMAL_MORSE, ANIMAL_PENGUIN, ANIMAL_TURTLE, ANIMAL_CAYMAN, ANIMAL_OTTER, ANIMAL_SNAKE, animal_caribou, animal_seal, animal_morse, animal_penguin, animal_turtle, animal_cayman, animal_otter, animal_snake,
ANIMAL_LIZARD, ANIMAL_DAEODON, ANIMAL_SLIME, ANIMAL_AXOLOTL, ANIMAL_HEDGEHOG, ANIMAL_CATERPILLAR, ANIMAL_CRAB, ANIMAL_SCORPION, animal_lizard, animal_daeodon, animal_slime, animal_axolotl, animal_hedgehog, animal_caterpillar, animal_crab, animal_scorpion,
ANIMAL_GIANT_LIZARD, ANIMAL_GIANT_CENTIPEDE, ANIMAL_GIANT_SPIDER, ANIMAL_GIANT_SLOTH, animal_giant_lizard, animal_giant_centipede, animal_giant_spider, animal_giant_sloth,
ANIMAL_GIANT_OWL, ANIMAL_GIANT_SCORPION, ANIMAL_GIANT_AXOLOTL, ANIMAL_GIANT_WORM animal_giant_owl, animal_giant_scorpion, animal_giant_axolotl, animal_giant_worm
); );
type animal_mark is mod 72; type animal_mark is mod 72;

View File

@ -17,7 +17,7 @@ package armour is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
type armour_list is ( type armour_list is (
IRON_HELMET, IRON_CHESTPLATE, IRON_GAUNTLETS, IRON_GREAVES, IRON_CUISSE, IRON_FAULD, IRON_GARDBRACE, IRON_REREBRACE iron_helmet, iron_chestplate, iron_gauntlets, iron_greaves, iron_cuisse, iron_fauld, iron_gardbrace, iron_rerebrace
); );
type armour_mark is mod 72; type armour_mark is mod 72;

151
game.ads Normal file
View File

@ -0,0 +1,151 @@
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Xabina is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either
-- version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came
-- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to
-- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
with core;
package game is
------------------------------------------------------------------------------------------
type trait_list is (
trait_strength, trait_perception, trait_edurance, trait_charisma, trait_intelligence, trait_agility, trait_luck, trait_autism
);
type skill_list is (
-- combat skills.
skill_blades, skill_axes, skill_maces, skill_polearms, skill_shields, skill_bows, skill_crossbows, skill_hands,
skill_onehanded, skill_twohanded, skill_precision, skill_thrust, skill_athletics, skill_equitation, skill_tactics, skill_skirmish,
-- magic skills.
skill_fire_magic, skill_water_magic, skill_earth_magic, skill_wind_magic, skill_nature_magic, skill_venom_magic, skill_shadow_magic, skill_bone_magic,
skill_rune_magic, skill_puppet_magic, skill_summon_magic, skill_insect_magic, skill_ritual_magic, skill_rot_magic, skill_tabboo_magic, skill_abyss_magic,
-- trait skills.
skill_wisdom, skill_patience, skill_religion, skill_speech, skill_reflection, skill_refraction, skill_authority, skill_deception,
skill_life_force, skill_mana_force, skill_regeneration, skill_restoration, skill_spellcraft, skill_protection, skill_synthesis, skill_evocation,
-- knowledge skills.
skill_medicine, skill_mercantile, skill_education, skill_navigation, skill_conjuration, skill_alteration, skill_enchanement, skill_teleportation,
skill_astronomy, skill_occultism, skill_mysticism, skill_survival, skill_evasion, skill_stealth, skill_detection, skill_identification,
-- work skills.
skill_blacksmith, skill_whitesmith, skill_light_craft, skill_heavy_craft, skill_light_works, skill_heavy_works, skill_leather, skill_construction,
skill_weapons, skill_armours, skill_engineer, skill_alchemy, skill_ritual, skill_experience, skill_necromancy, skill_reincarnation
);
type title_list is (
title_hero, title_demon_lord, title_dragon_slayer,title_goblin_slayer
);
------------------------------------------------------------------------------------------
trait_info : constant array (trait_list) of core.description := (
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
);
-- Trying out descriptions, this adds nothing to gameplay really, might even remove this shit, for now it's bad and unaligned...
skill_info : constant array (skill_list) of core.description := (
"Blades: Master the art of wielding sharp-edged weapons like swords and daggers to deliver swift and precise strikes. ",
"Axes: Become adept at swinging heavy battle axes and hatchets, crushing your enemies with sheer brute force. ",
"Maces: Hone your skill with blunt weapons like maces and hammers, shattering bones and armor with powerful blows. ",
"Polearms: Command long-reaching weapons like spears and halberds, keeping your foes at bay with deadly thrusts and sweeps. ",
"Shields: Learn to effectively block and parry incoming attacks using different types of shields, ensuring your defense remains intact. ",
"Bows: Master the art of archery, using bows to launch arrows with deadly accuracy from a distance. ",
"Crossbows: Handle crossbows, powerful ranged weapons that can deliver devastating bolts to penetrate even the toughest armor. ",
"Hands: Refine your unarmed combat skills, unleashing a flurry of punches, kicks, and grapples to overpower your opponents. ",
"One-handed: Develop proficiency in wielding one-handed weapons, granting you versatility in combat with a free hand for defense or utility. ",
"Two-handed: Embrace the raw power of massive two-handed weapons like greatswords and battle axes, obliterating foes with mighty strikes. ",
"Precision: Cultivate your precision, increasing your chances of landing critical hits and striking vital points for maximum damage. ",
"Thrust: Focus on the art of thrusting attacks, gaining the ability to pierce armor and penetrate deep into your adversaries' defenses. ",
"Athletics: Strengthen your physical prowess, enhancing your speed, stamina, and agility for swift maneuvers and resilience in combat. ",
"Equitation: Master the art of horse riding, enabling you to swiftly navigate the battlefield and engage enemies from mounted advantage. ",
"Tactics: Develop strategic thinking and decision-making skills, enabling you to plan your actions and exploit your enemies' weaknesses. ",
"Skirmish: Become adept in hit-and-run tactics, excelling in quick engagements where mobility, agility, and surprise are key to victory. ",
"Fire Magic: Harness the power of flames, incinerating foes and wreaking havoc with infernal spells, but beware not to harm yourself. ",
"Water Magic: Manipulate the currents of water and create it from the void, casting torrents and freezing enemies with chilling precision. ",
"Earth Magic: Command the strength of the earth, crushing adversaries with seismic shocks and sturdy defenses. ",
"Wind Magic: Control the swift breeze, unleashing gusts and tearing through enemies with razor-sharp projectiles or increase your speed. ",
"Nature Magic: Channel the essence of the natural world, nurturing allies and summoning creatures of the wilderness. ",
"Venom Magic: Inflict deadly toxins and poisons, weakening enemies and watching them succumb to vile venom, or weaken them and run away. ",
"Shadow Magic: Embrace the darkness, concealing yourself in the shadows and draining life energy with sinister shadow spells. ",
"Bone Magic: Manipulate the skeletal remnants of the deceased, raising undead minions and casting bone-shattering spells or healing ones. ",
"Rune Magic: Inscribe and activate ancient runes, unleashing elemental forces and unraveling unseen and destructive ancient magical barriers. ",
"Puppet Magic: Seize control of minds, bending the will of your enemies and forcing them to do your bidding or create a puppet to do it. ",
"Summon Magic: Conjure ethereal allies and mythical creatures, bolstering your forces and overwhelming your foes. ",
"Insect Magic: Command swarms of insects, inflicting agonizing stings and unleashing plague-like devastation, making allies of former foes. ",
"Ritual Magic: Perform intricate and powerful sacrificial rituals to exchange life force for items, magic, scrolls, gold or power. ",
"Rot Magic: Embrace decay and putrefaction, corroding the flesh of your enemies and spreading pestilence and plague. ",
"Taboo Magic: Seek forbidden arts, delving into dark rituals and wielding forbidden spells with dire consequences, but be very careful. ",
"Abyss Magic: Harness the eldritch forces from the depths of the abyss, unraveling reality and engulfing enemies in chaos. ",
"Wisdom: Acquire profound knowledge and insight to navigate challenges wisely. ",
"Patience: Endure and persevere through trials with calmness and resilience. ",
"Religion: Channel divine power through faith and devotion to overcome obstacles. ",
"Speech: Persuasively communicate thoughts and ideas, influencing others effectively. ",
"Reflection: Engage in self-analysis, learning from experiences for personal growth. ",
"Refraction: Bend and manipulate the flow of energy to alter its course. ",
"Authority: Command respect, possess leadership skills, and wield influence. ",
"Deception: Master the art of trickery and illusion to deceive opponents cunningly. ",
"Life Force: Harness the essence of vitality to sustain and strengthen oneself. ",
"Mana Force: Manipulate and control magical energy for various purposes. ",
"Regeneration: Restore health and vitality gradually and naturally over time. ",
"Restoration: Mend and heal wounds, restoring physical and spiritual well-being. ",
"Spellcraft: Master the intricate art of casting spells with precision and expertise. ",
"Protection: Shield oneself and allies, providing defense against harm and danger. ",
"Synthesis: Combine elements harmoniously, creating powerful and synergistic effects. ",
"Evocation: Summon and command mystical forces, unleashing their power and potential. ",
"Medicine: Heal wounds and cure ailments, preserving health and vitality. ",
"Mercantile: Master the art of trade and negotiation, obtaining valuable resources and goods. ",
"Education: Expand knowledge and gain expertise in various subjects, unlocking new possibilities. ",
"Navigation: Navigate through treacherous terrains, uncovering hidden paths and shortcuts. ",
"Conjuration: Summon and command ethereal beings and objects to aid in battle and exploration. ",
"Alteration: Manipulate and reshape the physical world, bending it to your will. ",
"Enchantment: Infuse objects with magical properties, enhancing their abilities and powers. ",
"Teleportation: Instantly transport yourself across distances, bypassing obstacles and traps. ",
"Astronomy: Study celestial bodies and their movements, unlocking celestial insights and abilities. ",
"Occultism: Harness forbidden knowledge and practices, tapping into dark and mysterious forces. ",
"Mysticism: Connect with spiritual realms, accessing mystical powers and ancient wisdom. ",
"Survival: Thrive in harsh environments, utilizing nature's resources and adapting to challenges. ",
"Evasion: Evade and dodge attacks with exceptional reflexes and agility. ",
"Stealth: Move silently and remain undetected, infiltrating enemy territories with stealth and precision. ",
"Detection: Uncover hidden secrets and traps, perceive hidden objects and enemies. ",
"Identification: Identify and analyze unknown items and artifacts, revealing their true nature and potential. ",
"Blacksmith: Master the art of forging and shaping metals, crafting powerful weapons and armor. ",
"Whitesmith: Refine and enhance crafted items, imbuing them with special properties and bonuses. ",
"Light Craft: Create delicate and intricate objects, such as jewelry and trinkets, with finesse and precision. ",
"Heavy Craft: Construct robust and durable structures, fortifying defenses and creating formidable tools. ",
"Light Works: Skillfully manipulate light and optics, creating illusions and harnessing blinding brilliance. ",
"Heavy Works: Command elemental forces and harness their raw power, shaping them for destruction or creation. ",
"Leather: Tame and work with animal hides, fashioning resilient armor and accessories. ",
"Construction: Design and erect structures, fortresses, and defenses in an efficient and strategic manner. ",
"Weapons: Wield a wide array of lethal weapons, mastering various combat styles and techniques. ",
"Armours: Forge resilient armor and protective gear, shielding against incoming threats and attacks. ",
"Engineer: Innovate and create mechanical wonders, building intricate contraptions and mechanisms. ",
"Alchemy: Transmute and brew potent elixirs and potions, unlocking the power of transformative substances. ",
"Ritual: Perform ancient rituals, invoking otherworldly energies to manipulate reality itself. ",
"Experience: Draw upon accumulated knowledge and insights, gaining wisdom and enhancing abilities. ",
"Necromancy: Command the forces of death and undeath, bending the deceased to your will. ",
"Reincarnation: Manipulate the cycle of life and death, granting second chances and renewed existence. "
);
title_info : constant array (title_list) of core.description := (
" ",
" ",
" ",
" "
);
------------------------------------------------------------------------------------------
end game;

View File

@ -17,13 +17,13 @@ package item is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
type item_list is ( type item_list is (
WOOD, BARK, FLAX, PLANK, STICK, BRACES, NAILS, LINEN, wood, bark, flax, plank, stick, braces, nails, linen,
CHAMOMILE, MINT, WAX, SALT, SUGAR, PEPPER, CINNAMON, YEAST, chamomile, mint, wax, salt, sugar, pepper, cinnamon, yeast,
SKULL, BONE, INTESTINES, FUR, LEATHER, FAT, HORN, TUSK, skull, bone, intestines, fur, leather, fat, horn, tusk,
COPPER_ORE, IRON_ORE, SILVER_ORE, GOLD_ORE, COAL_ORE, TIN_ORE, ZINC_ORE, LEAD_ORE, copper_ore, iron_ore, silver_ore, gold_ore, coal_ore, tin_ore, zinc_ore, lead_ore,
COPPER, IRON, SILVER, GOLD, COAL, TIN, ZINC, LEAD, copper, iron, silver, gold, coal, tin, zinc, lead,
BRONZE, BRASS, STEEL, MERCURY, OIL, INK, VENOM, SILK, bronze, brass, steel, mercury, oil, ink, venom, silk,
PAPERS, PAPERWEIGHT papers, paperweight
); );
type item_mark is mod 72; type item_mark is mod 72;

View File

@ -17,7 +17,7 @@ package magic is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
type magic_list is ( type magic_list is (
IGNITE, ILLUMINATE, BLADECHARM, BATTLECRY ignite, illuminate, bladecharm, battlecry
); );
type magic_mark is mod 72; type magic_mark is mod 72;

145
main.adb
View File

@ -10,150 +10,10 @@
-- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now... -- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
with ada.text_io; with core, game, action, map, item, magic, ammunition, weapon, armour, plant, animal, monster, player;
with core, action, map, item, magic, ammunition, weapon, armour, plant, animal, monster, player;
function main return integer is function main return integer is
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Player
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
type trait_list is (
TRAIT_STRENGTH, TRAIT_PERCEPTION, TRAIT_EDURANCE, TRAIT_CHARISMA, TRAIT_INTELLIGENCE, TRAIT_AGILITY, TRAIT_LUCK, TRAIT_AUTISM
);
type skill_list is (
-- Combat skills.
SKILL_BLADES, SKILL_AXES, SKILL_MACES, SKILL_POLEARMS, SKILL_SHIELDS, SKILL_BOWS, SKILL_CROSSBOWS, SKILL_HANDS,
SKILL_ONEHANDED, SKILL_TWOHANDED, SKILL_PRECISION, SKILL_THRUST, SKILL_ATHLETICS, SKILL_EQUITATION, SKILL_TACTICS, SKILL_SKIRMISH,
-- Magic skills.
SKILL_FIRE_MAGIC, SKILL_WATER_MAGIC, SKILL_EARTH_MAGIC, SKILL_WIND_MAGIC, SKILL_NATURE_MAGIC, SKILL_VENOM_MAGIC, SKILL_SHADOW_MAGIC, SKILL_BONE_MAGIC,
SKILL_RUNE_MAGIC, SKILL_PUPPET_MAGIC, SKILL_SUMMON_MAGIC, SKILL_INSECT_MAGIC, SKILL_RITUAL_MAGIC, SKILL_ROT_MAGIC, SKILL_TABBOO_MAGIC, SKILL_ABYSS_MAGIC,
-- Trait skills.
SKILL_WISDOM, SKILL_PATIENCE, SKILL_RELIGION, SKILL_SPEECH, SKILL_REFLECTION, SKILL_REFRACTION, SKILL_AUTHORITY, SKILL_DECEPTION,
SKILL_LIFE_FORCE, SKILL_MANA_FORCE, SKILL_REGENERATION, SKILL_RESTORATION, SKILL_SPELLCRAFT, SKILL_PROTECTION, SKILL_SYNTHESIS, SKILL_EVOCATION,
-- Knowledge skills.
SKILL_MEDICINE, SKILL_MERCANTILE, SKILL_EDUCATION, SKILL_NAVIGATION, SKILL_CONJURATION, SKILL_ALTERATION, SKILL_ENCHANEMENT, SKILL_TELEPORTATION,
SKILL_ASTRONOMY, SKILL_OCCULTISM, SKILL_MYSTICISM, SKILL_SURVIVAL, SKILL_EVASION, SKILL_STEALTH, SKILL_DETECTION, SKILL_IDENTIFICATION,
-- Work skills.
SKILL_BLACKSMITH, SKILL_WHITESMITH, SKILL_LIGHT_CRAFT, SKILL_HEAVY_CRAFT, SKILL_LIGHT_WORKS, SKILL_HEAVY_WORKS, SKILL_LEATHER, SKILL_CONSTRUCTION,
SKILL_WEAPONS, SKILL_ARMOURS, SKILL_ENGINEER, SKILL_ALCHEMY, SKILL_RITUAL, SKILL_EXPERIENCE, SKILL_NECROMANCY, SKILL_REINCARNATION
);
type title_list is (
TITLE_HERO, TITLE_DEMON_LORD, TITLE_DRAGON_SLAYER,TITLE_GOBLIN_SLAYER
);
------------------------------------------------------------------------------------------
--~trait_info : constant array (trait_list) of description;
--~skill_info : constant array (skill_list) of description;
--~title_info : constant array (title_list) of description;
trait_info : constant array (trait_list) of core.description := (
" ",
" ",
" ",
" ",
" ",
" ",
" ",
" "
);
-- Trying out descriptions, this adds nothing to gameplay really, might even remove this shit, for now it's bad and unaligned...
skill_info : constant array (skill_list) of core.description := (
"Blades: Master the art of wielding sharp-edged weapons like swords and daggers to deliver swift and precise strikes. ",
"Axes: Become adept at swinging heavy battle axes and hatchets, crushing your enemies with sheer brute force. ",
"Maces: Hone your skill with blunt weapons like maces and hammers, shattering bones and armor with powerful blows. ",
"Polearms: Command long-reaching weapons like spears and halberds, keeping your foes at bay with deadly thrusts and sweeps. ",
"Shields: Learn to effectively block and parry incoming attacks using different types of shields, ensuring your defense remains intact. ",
"Bows: Master the art of archery, using bows to launch arrows with deadly accuracy from a distance. ",
"Crossbows: Handle crossbows, powerful ranged weapons that can deliver devastating bolts to penetrate even the toughest armor. ",
"Hands: Refine your unarmed combat skills, unleashing a flurry of punches, kicks, and grapples to overpower your opponents. ",
"One-handed: Develop proficiency in wielding one-handed weapons, granting you versatility in combat with a free hand for defense or utility. ",
"Two-handed: Embrace the raw power of massive two-handed weapons like greatswords and battle axes, obliterating foes with mighty strikes. ",
"Precision: Cultivate your precision, increasing your chances of landing critical hits and striking vital points for maximum damage. ",
"Thrust: Focus on the art of thrusting attacks, gaining the ability to pierce armor and penetrate deep into your adversaries' defenses. ",
"Athletics: Strengthen your physical prowess, enhancing your speed, stamina, and agility for swift maneuvers and resilience in combat. ",
"Equitation: Master the art of horse riding, enabling you to swiftly navigate the battlefield and engage enemies from mounted advantage. ",
"Tactics: Develop strategic thinking and decision-making skills, enabling you to plan your actions and exploit your enemies' weaknesses. ",
"Skirmish: Become adept in hit-and-run tactics, excelling in quick engagements where mobility, agility, and surprise are key to victory. ",
"Fire Magic: Harness the power of flames, incinerating foes and wreaking havoc with infernal spells, but beware not to harm yourself. ",
"Water Magic: Manipulate the currents of water and create it from the void, casting torrents and freezing enemies with chilling precision. ",
"Earth Magic: Command the strength of the earth, crushing adversaries with seismic shocks and sturdy defenses. ",
"Wind Magic: Control the swift breeze, unleashing gusts and tearing through enemies with razor-sharp projectiles or increase your speed. ",
"Nature Magic: Channel the essence of the natural world, nurturing allies and summoning creatures of the wilderness. ",
"Venom Magic: Inflict deadly toxins and poisons, weakening enemies and watching them succumb to vile venom, or weaken them and run away. ",
"Shadow Magic: Embrace the darkness, concealing yourself in the shadows and draining life energy with sinister shadow spells. ",
"Bone Magic: Manipulate the skeletal remnants of the deceased, raising undead minions and casting bone-shattering spells or healing ones. ",
"Rune Magic: Inscribe and activate ancient runes, unleashing elemental forces and unraveling unseen and destructive ancient magical barriers. ",
"Puppet Magic: Seize control of minds, bending the will of your enemies and forcing them to do your bidding or create a puppet to do it. ",
"Summon Magic: Conjure ethereal allies and mythical creatures, bolstering your forces and overwhelming your foes. ",
"Insect Magic: Command swarms of insects, inflicting agonizing stings and unleashing plague-like devastation, making allies of former foes. ",
"Ritual Magic: Perform intricate and powerful sacrificial rituals to exchange life force for items, magic, scrolls, gold or power. ",
"Rot Magic: Embrace decay and putrefaction, corroding the flesh of your enemies and spreading pestilence and plague. ",
"Taboo Magic: Seek forbidden arts, delving into dark rituals and wielding forbidden spells with dire consequences, but be very careful. ",
"Abyss Magic: Harness the eldritch forces from the depths of the abyss, unraveling reality and engulfing enemies in chaos. ",
"Wisdom: Acquire profound knowledge and insight to navigate challenges wisely. ",
"Patience: Endure and persevere through trials with calmness and resilience. ",
"Religion: Channel divine power through faith and devotion to overcome obstacles. ",
"Speech: Persuasively communicate thoughts and ideas, influencing others effectively. ",
"Reflection: Engage in self-analysis, learning from experiences for personal growth. ",
"Refraction: Bend and manipulate the flow of energy to alter its course. ",
"Authority: Command respect, possess leadership skills, and wield influence. ",
"Deception: Master the art of trickery and illusion to deceive opponents cunningly. ",
"Life Force: Harness the essence of vitality to sustain and strengthen oneself. ",
"Mana Force: Manipulate and control magical energy for various purposes. ",
"Regeneration: Restore health and vitality gradually and naturally over time. ",
"Restoration: Mend and heal wounds, restoring physical and spiritual well-being. ",
"Spellcraft: Master the intricate art of casting spells with precision and expertise. ",
"Protection: Shield oneself and allies, providing defense against harm and danger. ",
"Synthesis: Combine elements harmoniously, creating powerful and synergistic effects. ",
"Evocation: Summon and command mystical forces, unleashing their power and potential. ",
"Medicine: Heal wounds and cure ailments, preserving health and vitality. ",
"Mercantile: Master the art of trade and negotiation, obtaining valuable resources and goods. ",
"Education: Expand knowledge and gain expertise in various subjects, unlocking new possibilities. ",
"Navigation: Navigate through treacherous terrains, uncovering hidden paths and shortcuts. ",
"Conjuration: Summon and command ethereal beings and objects to aid in battle and exploration. ",
"Alteration: Manipulate and reshape the physical world, bending it to your will. ",
"Enchantment: Infuse objects with magical properties, enhancing their abilities and powers. ",
"Teleportation: Instantly transport yourself across distances, bypassing obstacles and traps. ",
"Astronomy: Study celestial bodies and their movements, unlocking celestial insights and abilities. ",
"Occultism: Harness forbidden knowledge and practices, tapping into dark and mysterious forces. ",
"Mysticism: Connect with spiritual realms, accessing mystical powers and ancient wisdom. ",
"Survival: Thrive in harsh environments, utilizing nature's resources and adapting to challenges. ",
"Evasion: Evade and dodge attacks with exceptional reflexes and agility. ",
"Stealth: Move silently and remain undetected, infiltrating enemy territories with stealth and precision. ",
"Detection: Uncover hidden secrets and traps, perceive hidden objects and enemies. ",
"Identification: Identify and analyze unknown items and artifacts, revealing their true nature and potential. ",
"Blacksmith: Master the art of forging and shaping metals, crafting powerful weapons and armor. ",
"Whitesmith: Refine and enhance crafted items, imbuing them with special properties and bonuses. ",
"Light Craft: Create delicate and intricate objects, such as jewelry and trinkets, with finesse and precision. ",
"Heavy Craft: Construct robust and durable structures, fortifying defenses and creating formidable tools. ",
"Light Works: Skillfully manipulate light and optics, creating illusions and harnessing blinding brilliance. ",
"Heavy Works: Command elemental forces and harness their raw power, shaping them for destruction or creation. ",
"Leather: Tame and work with animal hides, fashioning resilient armor and accessories. ",
"Construction: Design and erect structures, fortresses, and defenses in an efficient and strategic manner. ",
"Weapons: Wield a wide array of lethal weapons, mastering various combat styles and techniques. ",
"Armours: Forge resilient armor and protective gear, shielding against incoming threats and attacks. ",
"Engineer: Innovate and create mechanical wonders, building intricate contraptions and mechanisms. ",
"Alchemy: Transmute and brew potent elixirs and potions, unlocking the power of transformative substances. ",
"Ritual: Perform ancient rituals, invoking otherworldly energies to manipulate reality itself. ",
"Experience: Draw upon accumulated knowledge and insights, gaining wisdom and enhancing abilities. ",
"Necromancy: Command the forces of death and undeath, bending the deceased to your will. ",
"Reincarnation: Manipulate the cycle of life and death, granting second chances and renewed existence. "
);
title_info : constant array (title_list) of core.description := (
" ",
" ",
" ",
" "
);
begin begin
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
@ -173,11 +33,10 @@ begin
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
loop loop
action.signal := core.cancel;
map.render; map.render;
player.render; player.render;
core.render_buffer; core.render_buffer;
ada.text_io.get_immediate (action.signal); action.scan;
action.list (character'pos (action.signal)).all; action.list (character'pos (action.signal)).all;
exit when action.active = false; exit when action.active = false;
end loop; end loop;

74
map.ads Normal file
View File

@ -0,0 +1,74 @@
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Xabina is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation; either
-- version 3 of the License, or (at your option) any later version. This program is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the
-- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
-- Experimental minimal terminal rogue-like game in Ada programming language. I used to write a lot of Ada programs some time ago, then went in full C and assembly mode, and came
-- back to Ada, but realized that I keep my folders messy... Since it's bothersome to find my old Ada projects and share them here, I decided that the most easy thing to do is to
-- write a new program in Ada, a tiny game. Work in progress, it's messy and ugly for now...
------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
with core;
package map is
------------------------------------------------------------------------------------------
type list is (
map_stone_wall, map_wooden_wall, map_stone_floor, map_wooden_floor, map_water_shallow, map_water_deep, map_swamp_shallow, map_swamp_deep
);
type mark is mod 72;
type width is mod 120;
type height is mod 40;
------------------------------------------------------------------------------------------
type constant_type is new core.entity_constant_type with
record
collide : boolean := false;
condition_limit : natural := 0;
end record;
type variable_type is new core.entity_variable_type with
record
entity : core.entity_list := core.entity_null;
identifier : natural := 0;
end record;
type matrical_type is
record
map : list := map_stone_floor;
condition : natural := 0;
end record;
type constant_list is array (list) of constant_type;
type variable_list is array (mark) of variable_type;
type matrical_list is array (height, width) of matrical_type;
------------------------------------------------------------------------------------------
constant_data : constant constant_list := (
(core.entity_map, "Stone Wall ", '#', core.colour.grey, core.effect.bold, true, 59),
(core.entity_map, "Wooden Wall ", '#', core.colour.yellow, core.effect.normal, false, 23),
(core.entity_map, "Stone Floor ", '.', core.colour.grey, core.effect.bold, true, 47),
(core.entity_map, "Wooden Floor ", '.', core.colour.yellow, core.effect.normal, false, 11),
(core.entity_map, "Water (shallow) ", '~', core.colour.blue, core.effect.normal, false, 0),
(core.entity_map, "Water (deep) ", '~', core.colour.blue, core.effect.bold, true, 0),
(core.entity_map, "Swamp (shallow) ", '~', core.colour.green, core.effect.normal, false, 0),
(core.entity_map, "Swamp (deep) ", '~', core.colour.green, core.effect.bold, true, 0)
);
variable_data : variable_list;
matrical_data : matrical_list;
------------------------------------------------------------------------------------------
procedure generate;
procedure render;
------------------------------------------------------------------------------------------
end map;

View File

@ -17,7 +17,7 @@ package monster is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
type goblin_list is ( type goblin_list is (
GOBLIN_SLAVE, GOBLIN_WORKER, GOBLIN_WARRIOR, GOBLIN_BOAR_RIDER, GOBLIN_SHAMAN, GOBLIN_CHIEF, GOBLIN_KING, GOBLIN_OGRE goblin_slave, goblin_worker, goblin_warrior, goblin_boar_rider, goblin_shaman, goblin_chief, goblin_king, goblin_ogre
); );
type monster_mark is mod 72; type monster_mark is mod 72;

View File

@ -17,8 +17,8 @@ package plant is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
type plant_list is ( type plant_list is (
OAK_TREE, PINE_TREE, BIRCH_TREE, ACACIA_TREE, APPLE_TREE, PEACH_TREE, ORANGE_TREE, PEAR_TREE, oak_tree, pine_tree, birch_tree, acacia_tree, apple_tree, peach_tree, orange_tree, pear_tree,
BUSH, THORNY_BUSH, TALL_GRASS, REED bush, thorny_bush, tall_grass, reed
); );
type plant_mark is mod 72; type plant_mark is mod 72;

View File

@ -17,9 +17,9 @@ package weapon is
------------------------------------------------------------------------------------------ ------------------------------------------------------------------------------------------
type weapon_list is ( type weapon_list is (
IRON_SWORD, IRON_GREATSWORD, IRON_AXE, IRON_BATTLEAXE, IRON_SPEAR, IRON_SHIELD, IRON_MACE, IRON_HAMMER, iron_sword, iron_greatsword, iron_axe, iron_battleaxe, iron_spear, iron_shield, iron_mace, iron_hammer,
BRONZE_SWORD, BRONZE_GREATSWORD, BRONZE_AXE, BRONZE_BATTLEAXE, BRONZE_SPEAR, BRONZE_SHIELD, BRONZE_MACE, BRONZE_HAMMER, bronze_sword, bronze_greatsword, bronze_axe, bronze_battleaxe, bronze_spear, bronze_shield, bronze_mace, bronze_hammer,
BRASS_SWORD, BRASS_GREATSWORD, BRASS_AXE, BRASS_BATTLEAXE, BRASS_SPEAR, BRASS_SHIELD, BRASS_MACE, BRASS_HAMMER brass_sword, brass_greatsword, brass_axe, brass_battleaxe, brass_spear, brass_shield, brass_mace, brass_hammer
); );
type weapon_mark is mod 72; type weapon_mark is mod 72;