Advertisement
Guest User

Untitled

a guest
Aug 28th, 2024
199
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Ruby 6.63 KB | None | 0 0
  1. #===============================================================================
  2. # Uses a different move depending on the environment. (Hidden Power)
  3. # This is the Touhoumon variant of the move
  4. # NOTE: This code does not support the Gen 5 and older definition of the move
  5. #       where it targets the user. It makes more sense for it to target another
  6. #       PokΓ©mon.
  7. #===============================================================================
  8. class Battle::Move::UseMoveDependingOnEnvironmentThmn < Battle::Move
  9.   def callsAnotherMove?; return true; end
  10.  
  11.   def pbOnStartUse(user, targets)
  12.     @npMove = :TRIATTACK18
  13.     case @battle.field.terrain
  14.     when :Electric
  15.       @npMove = :THUNDERBOLT18 if GameData::Move.exists?(:THUNDERBOLT18)
  16.     when :Grassy
  17.       @npMove = :ENERGYLIGHT18 if GameData::Move.exists?(:ENERGYLIGHT18)
  18.     when :Misty
  19.       @npMove = :LUNATIC18 if GameData::Move.exists?(:LUNATIC18)
  20.     when :Psychic
  21.       @npMove = :MANABURST18 if GameData::Move.exists?(:MANABURST18)
  22.     else
  23.       try_move = nil
  24.       case @battle.environment
  25.       when :Grass, :TallGrass, :Forest, :ForestGrass
  26.         try_move = :ENERGYLIGHT18
  27.       when :MovingWater, :StillWater, :Underwater
  28.         try_move = :HYDROPUMP18
  29.       when :Puddle
  30.         try_move = :MUDDYWATTER18
  31.       when :Cave
  32.         try_move = :ROCKSLIDE18
  33.       when :Rock, :Sand
  34.         try_move = :EARTHPOWER18
  35.       when :Snow
  36.         try_move = :BLIZZARD18
  37.       when :Ice
  38.         try_move = :ICEBEAM18
  39.       when :Volcano
  40.         try_move = :LAVAPLUME
  41.       when :Graveyard
  42.         try_move = :SHADOWBALL18
  43.       when :Sky
  44.         try_move = :AIRSLASH18
  45.       when :Space
  46.         try_move = :DRACOMETEOR18
  47.       when :UltraSpace
  48.         try_move = :MANABURST18
  49.       when :Fantasia
  50.         try_move = :MYRIADDREAMS
  51.       end
  52.       @npMove = try_move if GameData::Move.exists?(try_move)
  53.     end
  54.   end
  55.  
  56.   def pbEffectAgainstTarget(user, target)
  57.     @battle.pbDisplay(_INTL("{1} turned into {2}!", @name, GameData::Move.get(@npMove).name))
  58.     user.pbUseMoveSimple(@npMove, target.index)
  59.   end
  60. end
  61.  
  62. #===============================================================================
  63. # Inflict a random status condition on a foe (50%)
  64. # Drop a random stat by 1 (25%)
  65. # (Spiral Abyss)
  66. #===============================================================================
  67. class Battle::Move::SpiralAbyss < Battle::Move
  68.  
  69. end
  70.  
  71. #===============================================================================
  72. # Two turn move. On turn one, enter charge state. On second turn, attack with a
  73. # 50% chance to paralyze the foe.
  74. # If charge is broken, disable the attacker's move.
  75. # (Prohibatory Signboard)
  76. #===============================================================================
  77. class Battle::Move::ProhibatorySignboard < Battle::Move
  78.   def pbDisplayChargeMessage(user)
  79.     user.effects[PBEffects::ProhibSign] = true
  80.     @battle.pbCommonAnimation("ProhibSign", user)
  81.     @battle.pbDisplay(_INTL("{1} dropped a sign in front of them and begun charging up!", user.pbThis))
  82.   end
  83.  
  84.   def pbDisplayUseMessage(user)
  85.     super if !user.effects[PBEffects::ProhibSign] || !user.tookMoveDamageThisRound
  86.   end
  87.  
  88.   def pbMoveFailed?(user, targets)
  89.     if user.effects[PBEffects::ProhibSign] && user.tookMoveDamageThisRound
  90.       @battle.pbDisplay(_INTL("{1}'s sign was ignored and trampled over!", user.pbThis))
  91.       return true
  92.     end
  93.     return false
  94.   end
  95. end
  96.  
  97. #===============================================================================
  98. # Hits X times, where X is the number of fainted Pokemon or Puppets in
  99. # in the user's party (not including partner trainers). Fails if X is 0.
  100. # Base power of each hit depends on the base Attack stat for the species of that
  101. # hit's participant. (Walpurgis Night)
  102. #===============================================================================
  103. class Battle::Move::WalpurgisNight < Battle::Move
  104.   def multiHitMove?; return true; end
  105.  
  106.   def pbMoveFailed?(user, targets)
  107.     @beatUpList = []
  108.     @battle.eachInTeamFromBattlerIndex(user.index) do |pkmn, i|
  109.       next if pkmn.able?
  110.       @beatUpList.push(i)
  111.     end
  112.     if @beatUpList.length == 0
  113.       @battle.pbDisplay(_INTL("But it failed!"))
  114.       return true
  115.     end
  116.     return false
  117.   end
  118.  
  119.   def pbNumHits(user, targets)
  120.     return @beatUpList.length
  121.   end
  122.  
  123.   def pbBaseDamage(baseDmg, user, target)
  124.     i = @beatUpList.shift   # First element in array, and removes it from array
  125.     atk = @battle.pbParty(user.index)[i].baseStats[:ATTACK]
  126.     return 10 + (atk / 10)
  127.   end
  128. end
  129.  
  130. #===============================================================================
  131. # Apply attraction regardless of gender/alignment.
  132. # (Enchantiing Cone)
  133. #===============================================================================
  134. class Battle::Move::EnchantingCone < Battle::Move
  135.  
  136. end
  137.  
  138. #===============================================================================
  139. # Clears all stat changes on hit.
  140. # (Fae Trickery)
  141. #===============================================================================
  142. class Battle::Move::FaeTrickery < Battle::Move
  143.   # Clear Smog does this.
  144. end
  145.  
  146. #===============================================================================
  147. # If move is successful, it steals the stat changes of the foe for itself,
  148. # then sets up Substitute.
  149. # If the user is asleep, then the move will instead heal HP equal to half
  150. # the damage dealt and set up Aurora Veil.
  151. # (Ultimate Dream)
  152. #===============================================================================
  153. class Battle::Move::UltimateDream < Battle::Move
  154.   def ignoresSubstitute?(user); return true; end
  155.  
  156.   def pbCalcDamage(user, target, numTargets = 1)
  157.     if target.hasRaisedStatStages?
  158.       pbShowAnimation(@id, user, target, 1)   # Stat stage-draining animation
  159.       @battle.pbDisplay(_INTL("{1} stole the target's boosted stats!", user.pbThis))
  160.       showAnim = true
  161.       GameData::Stat.each_battle do |s|
  162.         next if target.stages[s.id] <= 0
  163.         if user.pbCanRaiseStatStage?(s.id, user, self)
  164.           showAnim = false if user.pbRaiseStatStage(s.id, target.stages[s.id], user, showAnim)
  165.         end
  166.         target.statsLoweredThisRound = true
  167.         target.statsDropped = true
  168.         target.stages[s.id] = 0
  169.       end
  170.     end
  171.     super
  172.   end
  173. end
  174.  
  175. #===============================================================================
  176. # If the move connects, boost user's stats by +2, then apply Protect and Endure.
  177. # (All the Myriad Dreams of Paradise)
  178. #===============================================================================
  179. class Battle::Move::MyriadDreams < Battle::Move
  180.  
  181. end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement