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...
您最多选择25个主题 主题必须以字母或数字开头,可以包含连字符 (-),并且长度不得超过35个字符

83 行
5.5KB

  1. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  2. -- Copyright (c) 2023 - Ognjen 'xolatile' Milan Robovic
  3. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  4. -- 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
  5. -- 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
  6. -- implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General Public License for more details.
  7. ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
  8. with core, map;
  9. package weapon is
  10. ------------------------------------------------------------------------------------------
  11. type list is (
  12. iron_sword, iron_greatsword, iron_axe, iron_battleaxe, iron_spear, iron_shield, iron_mace, iron_hammer,
  13. bronze_sword, bronze_greatsword, bronze_axe, bronze_battleaxe, bronze_spear, bronze_shield, bronze_mace, bronze_hammer,
  14. brass_sword, brass_greatsword, brass_axe, brass_battleaxe, brass_spear, brass_shield, brass_mace, brass_hammer
  15. );
  16. type mark is mod 72;
  17. ------------------------------------------------------------------------------------------
  18. type constant_type is new core.constant_type with
  19. record
  20. dual_wield : boolean := false;
  21. value : natural := 0;
  22. weight : natural := 0;
  23. attack_range : natural := 0;
  24. defense_range : natural := 0;
  25. distance_range : natural := 0;
  26. end record;
  27. type variable_type is new core.variable_type with
  28. record
  29. enchantment : natural := 0;
  30. condition : natural := 0;
  31. end record;
  32. type constant_list is array (list) of constant_type;
  33. type variable_list is array (mark) of variable_type;
  34. ------------------------------------------------------------------------------------------
  35. constant_data : constant constant_list := (
  36. (core.weapon, "Iron Sword ", 'l', core.colour.red, core.effect.normal, true, 11, 31, 7, 2, 1),
  37. (core.weapon, "Iron Greatsword ", 'L', core.colour.red, core.effect.bold, false, 23, 67, 11, 3, 2),
  38. (core.weapon, "Iron Axe ", 'r', core.colour.red, core.effect.normal, true, 13, 43, 7, 2, 1),
  39. (core.weapon, "Iron Battleaxe ", 'T', core.colour.red, core.effect.bold, false, 19, 73, 13, 2, 2),
  40. (core.weapon, "Iron Spear ", 'I', core.colour.red, core.effect.bold, false, 17, 53, 10, 4, 2),
  41. (core.weapon, "Iron Shield ", 'o', core.colour.red, core.effect.normal, true, 13, 37, 3, 9, 1),
  42. (core.weapon, "Iron Mace ", 'i', core.colour.red, core.effect.normal, true, 11, 41, 8, 2, 1),
  43. (core.weapon, "Iron Hammer ", 't', core.colour.red, core.effect.normal, true, 13, 47, 7, 3, 1),
  44. (core.weapon, "Bronze Sword ", 'l', core.colour.red, core.effect.normal, true, 11, 31, 7, 2, 1),
  45. (core.weapon, "Bronze Greatsword ", 'L', core.colour.red, core.effect.bold, false, 23, 67, 11, 3, 2),
  46. (core.weapon, "Bronze Axe ", 'r', core.colour.red, core.effect.normal, true, 13, 43, 7, 2, 1),
  47. (core.weapon, "Bronze Battleaxe ", 'T', core.colour.red, core.effect.bold, false, 19, 73, 13, 2, 2),
  48. (core.weapon, "Bronze Spear ", 'I', core.colour.red, core.effect.bold, false, 17, 53, 10, 4, 2),
  49. (core.weapon, "Bronze Shield ", 'o', core.colour.red, core.effect.normal, true, 13, 37, 3, 9, 1),
  50. (core.weapon, "Bronze Mace ", 'i', core.colour.red, core.effect.normal, true, 11, 41, 8, 2, 1),
  51. (core.weapon, "Bronze Hammer ", 't', core.colour.red, core.effect.normal, true, 13, 47, 7, 3, 1),
  52. (core.weapon, "Brass Sword ", 'l', core.colour.red, core.effect.normal, true, 11, 31, 7, 2, 1),
  53. (core.weapon, "Brass Greatsword ", 'L', core.colour.red, core.effect.bold, false, 23, 67, 11, 3, 2),
  54. (core.weapon, "Brass Axe ", 'r', core.colour.red, core.effect.normal, true, 13, 43, 7, 2, 1),
  55. (core.weapon, "Brass Battleaxe ", 'T', core.colour.red, core.effect.bold, false, 19, 73, 13, 2, 2),
  56. (core.weapon, "Brass Spear ", 'I', core.colour.red, core.effect.bold, false, 17, 53, 10, 4, 2),
  57. (core.weapon, "Brass Shield ", 'o', core.colour.red, core.effect.normal, true, 13, 37, 3, 9, 1),
  58. (core.weapon, "Brass Mace ", 'i', core.colour.red, core.effect.normal, true, 11, 41, 8, 2, 1),
  59. (core.weapon, "Brass Hammer ", 't', core.colour.red, core.effect.normal, true, 13, 47, 7, 3, 1)
  60. );
  61. variable_data : variable_list;
  62. ------------------------------------------------------------------------------------------
  63. procedure generate;
  64. procedure render;
  65. ------------------------------------------------------------------------------------------
  66. end weapon;