Advertisement
varkarrus

Test Fighter

Dec 26th, 2018
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.64 KB | None | 0 0
  1. <?xml version="1.0" encoding="utf-8"?>
  2. <DB xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsd="http://www.w3.org/2001/XMLSchema">
  3. <fighter name="Test Fighter">
  4.  
  5. <stats maxhp="30" atk="10" def ="10" pow="10" res="10" eva = "10" acc="10" />
  6.  
  7. <!--Basic attack ability. Deals damage equivalent to attack stat, with 20% damage variance (0.9* to 1.1*)-->
  8. <ability name="Attack">
  9. <validTarget>enemy</validTarget>
  10. <tags>#physical #basic</tags>
  11. <power>1</power>
  12. <!--0.2 is default variance value-->
  13. <variance>0.2</variance>
  14. </ability>
  15.  
  16. <!--Heals for 30% of Power stat each turn-->
  17. <passive name="Regeneration">
  18. <onTurnStart>healing = a:heal(a.stats["pow"]/3*Random:variance(0.3),a)
  19. if healing &gt; 0 then
  20. outputMessage(a:getName().." healed for "..healing.." damage!")
  21. end
  22. </onTurnStart>
  23. </passive>
  24.  
  25. <!--Gain attack / defense buff at low health-->
  26. <passive name="Enrage">
  27. <!--"aspects" stores buffs / passives / resources / abilities that the ability might use.-->
  28. <aspects>
  29. <!--buff lasts 3 turns. Multiplies attack, defense, and evasion by these values-->
  30. <buff name="Enraged">
  31. <mult atk="1.5" def="1.5" eva ="0.75"/>
  32. <duration>3</duration>
  33. </buff>
  34. </aspects>
  35.  
  36. <!--Create a variable called "canUse", set it to true by default.-->
  37. <onStart>self.canUse = true</onStart>
  38.  
  39. <!--"onTakeDamage" occurs when the fighter takes damage, before health is lowered. The damage, attacker, and damage tags are passed in and can be used and even changed.-->
  40. <onTakeDamage>
  41. <!--When taking damage, check if the damage is enough to put the fighter below half health AND "canUse" is true.-->
  42. if self.canUse and a.hp - damage &lt;= a.stats["maxhp"]/2 then
  43.  
  44. <!--Applies the buff "Enraged" from the aspects section above, outputs a message, and sets "canUse" to false-->
  45. self.canUse=false
  46. self.applyBuff(a.id, "Enraged")
  47. outputMessage(a:getName().." is now enraged!")
  48. end
  49. </onTakeDamage>
  50.  
  51. <!--At the start of the character's turn, if they are above half health and not currently Enraged, reenables this passive.-->
  52. <onTurnStart>
  53. if a.hp &gt;= a.stats["maxhp"]/2 and next(a:getBuffs("Enrage",a)) == nil then
  54. self.used = false
  55. end
  56. </onTurnStart>
  57. </passive>
  58.  
  59.  
  60. </fighter>
  61.  
  62. <!--Creates a new fighter called 'Mantid' with identical stats and abilities to 'Test Fighter'-->
  63. <fighter name="Mantid" base="Test Fighter" />
  64.  
  65. <!--Creates a Mantid with better stats-->
  66. <fighter name="Elite Mantid" base = "Test Fighter">
  67. <stats maxhp="50" atk="14" def="12" pow="15" res="10" acc="15" eva="15" />
  68. </fighter>
  69.  
  70. </DB>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement