juliorain

Dust Heal and Drain Boost by Juliorain

Dec 29th, 2018
447
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.59 KB | None | 0 0
  1. #############################################
  2. # Dust Heal by Juliorain #
  3. #############################################
  4. #in PBEffects, under the sectiona about affecting the user add at the end whatever unused number denoted with a #
  5.  
  6. DustHeal = #
  7.  
  8.  
  9. #copy this under @effects[PBEffects::Ingrain] = false in PokeBattle_BattlerEffects
  10.  
  11. @effects[PBEffects::DustHeal] = false
  12.  
  13.  
  14. #copy this in MoveEffects
  15. ################################################################################
  16. # DustHeal Ingrains the user. Ingrained Pokémon gain 1/16 of max HP at the end of each
  17. # round, 1/8 of max HP in SANDSTORM and cannot flee or switch out.
  18. ################################################################################
  19. class PokeBattle_Move_CF9 < PokeBattle_Move
  20. def pbEffect(attacker,opponent,hitnum=0,alltargets=nil,showanimation=true)
  21. if attacker.effects[PBEffects::HealBlock]>0
  22. @battle.pbDisplay(_INTL("{1} can't use {2} because of Heal Block!",attacker.pbThis,name))
  23. return -1
  24. end
  25. if attacker.effects[PBEffects::DustHeal]
  26. @battle.pbDisplay(_INTL("But it failed!"))
  27. return -1
  28. end
  29. pbShowAnimation(@id,attacker,nil,hitnum,alltargets,showanimation)
  30. attacker.effects[PBEffects::Ingrain]=true
  31. @battle.pbDisplay(_INTL("{1} planted its roots!",attacker.pbThis))
  32. return 0
  33. end
  34. end
  35.  
  36.  
  37.  
  38. #copy this under ingrain at the start of PBPokemon_Battle:
  39. if thispkmn.effects[PBEffects::DustHeal]
  40. pbDisplayPaused(_INTL("{1} can't be switched out!",thispkmn.pbThis)) if showMessages
  41. return false
  42. end
  43.  
  44.  
  45. #copy this under ingrain at the end of PBPokemon_Battle:
  46. # DustHeal
  47. for i in priority
  48. next if i.isFainted?
  49. if i.effects[PBEffects::DustHeal]
  50. PBDebug.log("[#{i.pbThis}'s Ingrain triggered]")
  51. hpgain=(i.totalhp/16).floor
  52. hpgain=(hpgain*1.3).floor if i.hasWorkingItem(:BIGROOT)
  53. hpgain=(hpgain*1.3).floor if i.hasWorkingAbility(:DRAINBOOST)
  54. hpgain=i.pbRecoverHP(hpgain,true)
  55. pbDisplay(_INTL("{1} absorbed nutrients from the dust in the air!",i.pbThis)) if hpgain>0
  56. end
  57. if i.effects[PBEffects::DustHeal] && pbWeather==PBWeather::SANDSTORM
  58. PBDebug.log("[#{i.pbThis}'s Dust Heal triggered)
  59. hpgain=(i.totalhp/8).floor
  60. hpgain=(hpgain*1.3).floor if i.hasWorkingItem(:BIGROOT)
  61. hpgain=(hpgain*1.3).floor if i.hasWorkingAbility(:DRAINBOOST)
  62. hpgain=i/pbRecoverHP(hpgain,true)
  63. pbDisplay(_INTL("{1} absorbed nutrients from the dust in the air!",i.pbThis)) if hpgain>0
  64. end
  65. end
  66.  
  67.  
  68. #for your moves.txt doc:
  69. ___,DUSTHEAL,DustHeal,CF9,0,GROUND,Status,0,20,0,10,0,dim,"The user digs itself in the ground to absorb nutirents in the air to restor HP at the end of every turn. Because it is rooted, it can't switch out."
  70.  
  71. ##################################################
  72. # Drain Boost Ability #
  73. ##################################################
  74.  
  75. #inaddition to keeping the above, add this to your abilities.txt using whatever unused ID number you want, denoted with a "___"
  76.  
  77. ___,DRAINBOOST,Drain Boost,"Boosts the power of Draining and Leech moves barring Strength Sap."
  78.  
  79. #in PokeBattle_Move right below Iron Fist, copy:
  80. if attacker.hasWorkingAbility(:DRAINBOOST)
  81. if [569,210,207,201,200,99,13,595].include?(@id)
  82. damagemult=(damagemult*1.3).floor
  83. end
  84. end
  85.  
  86. #in PokeBattle_Battle literally replace the EoT Leech Seed effect with
  87.  
  88. # Leech Seed
  89. for i in priority
  90. next if i.isFainted?
  91. if i.effects[PBEffects::LeechSeed]>=0
  92. recipient=@battlers[i.effects[PBEffects::LeechSeed]]
  93. if recipient && !recipient.isFainted? # if recipient exists
  94. PBDebug.log("[#{i.pbThis}'s Leech Seed triggered]")
  95. pbCommonAnimation("LeechSeed",recipient,i)
  96. hploss=i.pbReduceHP((i.totalhp/8).floor,true)
  97. if i.hasWorkingAbility(:LIQUIDOOZE)
  98. recipient.pbReduceHP(hploss,true)
  99. pbDisplay(_INTL("{1} sucked up the liquid ooze!",recipient.pbThis))
  100. elsif recipient.effects[PBEffects::HealBlock]==0
  101. hploss=(hploss*1.3).floor if recipient.hasWorkingItem(:BIGROOT)
  102. hploss=(hploss*1.3).floor if recipient.hasWorkingAbility(:DRAINBOOST)
  103. recipient.pbRecoverHP(hploss,true)
  104. pbDisplay(_INTL("{1}'s health was sapped by Leech Seed!",i.pbThis))
  105. end
  106. if i.isFainted?
  107. return if !i.pbFaint
  108. end
  109. if recipient.isFainted?
  110. return if !recipient.pbFaint
  111. end
  112. end
  113. end
  114. end
Advertisement
Add Comment
Please, Sign In to add comment