technique.go 5.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216
  1. package world
  2. /* Techniques, arts, exploits and and crafts are special or specific abilities
  3. * that fall under a generic skill. Crafts are not stored in a separate
  4. * static list. Rather the crafting requirements are stored in the item list
  5. * which is loaded from disk. Beings then have a list of the ID's of items they
  6. * have learned to craft.
  7. */
  8. type Technique struct {
  9. Entity
  10. Kind string
  11. Effect string
  12. Level int
  13. Cost int
  14. Skill string
  15. skill * Skill
  16. onUse func (me * Technique, caster * Being, targets ...*Being) (bool)
  17. }
  18. type BeingTechnique struct {
  19. being * Being
  20. technique * Technique
  21. Being string
  22. Technique string
  23. }
  24. /* An exploit is a special technique that can only be used a few times
  25. * per day.
  26. *
  27. * Maximum amount of uses (integer math!)
  28. * EXPLOIT_RANK = 1 + (EXPLOIT_LEVEL / 10)
  29. * Uses.Max = 1 + (SKILL_LEVEL / (10 * EXPLOIT_RANK))
  30. *
  31. */
  32. type Exploit Technique
  33. type BeingExploit struct {
  34. being * Being
  35. exploit * Exploit
  36. Being string
  37. Exploit string
  38. // How many times the exploit may be used.
  39. Uses Vital
  40. }
  41. func CraftCookOmlet(caster * Being, targets ...*Being) bool {
  42. return true
  43. }
  44. /* Generic rage technique performer. */
  45. func DoRageTechnique(me * Technique, caster * Being, targets ...*Being) bool {
  46. return true
  47. }
  48. /*
  49. *
  50. * Requires techniques to be useful:
  51. * Rage, Sleight, Robotech, Stealth, Medical,
  52. */
  53. var TechniqueList = []Technique {
  54. /* Rage techiques, need more later */
  55. {
  56. Skill : "skill_rage",
  57. Entity : Entity { ID: "tech_bite", Name: "Bite",
  58. Short : "A beast's bite attack.", },
  59. Effect : "crush",
  60. Level : 1,
  61. Cost : 1,
  62. onUse : func (me * Technique, caster * Being, targets ...*Being) bool {
  63. return true
  64. },
  65. },
  66. {
  67. Skill : "skill_rage",
  68. Entity : Entity { ID: "tech_claw", Name: "Claw",
  69. Short : "A beast's claw attack.", },
  70. Effect : "cut",
  71. Level : 1,
  72. Cost : 1,
  73. },
  74. {
  75. Skill : "skill_rage",
  76. Entity : Entity { ID: "tech_sting", Name: "Sting",
  77. Short : "A beast's sting attack.", },
  78. Effect : "pierce",
  79. Level : 1,
  80. Cost : 1,
  81. onUse : DoRageTechnique,
  82. },
  83. {
  84. Skill : "skill_horn",
  85. Entity : Entity { ID: "tech_sting", Name: "Horn",
  86. Short : "A beast's horn attack.", },
  87. Effect : "pierce",
  88. Level : 1,
  89. Cost : 1,
  90. },
  91. /* Sleight techniques, need more later */
  92. {
  93. Skill : "skill_sleight",
  94. Entity : Entity { ID: "tech_distract", Name: "Distract",
  95. Short : "Distract an opponent, makes you likely to steal for one turn.", },
  96. Effect : "distract",
  97. Level : 1,
  98. Cost : 20,
  99. },
  100. {
  101. Skill : "skill_sleight",
  102. Entity : Entity { ID: "tech_steal", Name: "Steal",
  103. Short : "Attempt to steal an item from an opponent.", },
  104. Effect : "steal",
  105. Level : 1,
  106. Cost : 10,
  107. },
  108. /* Robotic techniques need more later. */
  109. {
  110. Skill : "skill_robotic",
  111. Entity : Entity { ID: "tech_spark", Name: "Spark",
  112. Short : "Minor shock damage to one opponent", },
  113. Effect : "shock",
  114. Level : 1,
  115. Cost : 10,
  116. },
  117. {
  118. Skill : "skill_robotic",
  119. Entity : Entity { ID: "tech_drill", Name: "Drill",
  120. Short : "Minor piercing damage to one opponent", },
  121. Effect : "pierce",
  122. Level : 1,
  123. Cost : 10,
  124. },
  125. {
  126. Skill : "skill_robotic",
  127. Entity : Entity { ID: "tech_saw", Name: "Saw",
  128. Short : "Minor cutting damage to one opponent", },
  129. Effect : "cut",
  130. Level : 1,
  131. Cost : 10,
  132. },
  133. {
  134. Skill : "skill_robotic",
  135. Entity : Entity { ID: "tech_stomp", Name: "Stomp",
  136. Short : "Minor crushing damage to one opponent", },
  137. Effect : "crush",
  138. Level : 1,
  139. Cost : 10,
  140. },
  141. /* Stealth skills */
  142. {
  143. Skill : "skill_stealth",
  144. Entity : Entity { ID: "tech_tiptoe", Name: "Tiptoe",
  145. Short : "Walk more silently for a short time", },
  146. Effect : "stealth",
  147. Level : 1,
  148. Cost : 20,
  149. },
  150. {
  151. Skill : "skill_stealth",
  152. Entity : Entity { ID: "tech_hide", Name: "Hide",
  153. Short : "Attempt to hide, giving you a chance to ambush your opponent.", },
  154. Effect : "hide",
  155. Level : 1,
  156. Cost : 40,
  157. },
  158. /* Medical skills */
  159. {
  160. Skill : "skill_medical",
  161. Entity : Entity { ID: "tech_diagnose", Name: "Diagnose",
  162. Short : "Get detailed infomation on the status of one being.", },
  163. Effect : "diagnose",
  164. Level : 1,
  165. Cost : 20,
  166. },
  167. {
  168. Skill : "skill_medical",
  169. Entity : Entity { ID: "tech_first_aid", Name: "First Aid",
  170. Short : "Slightly heals HP, restores one LP of one being.", },
  171. Effect : "heal",
  172. Level : 1,
  173. Cost : 20,
  174. },
  175. }