Guest User

Mutually Exclusive Pokémon

a guest
Jan 24th, 2018
879
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Diff 4.53 KB | None | 0 0
  1. commit f85ab62da7dc764a52e00407539a88e503e6087b
  2. Author: Martin Griffin
  3. Date:   Wed Jan 24 07:51:22 2018 +0000
  4.  
  5.     Add mutually exclusive Pokémon
  6.    
  7.     Set `Exclusive=True` in PBS/pokemon.txt to limit all of those Pokémon to
  8.     one per party. For example setting it for Mew and Mewtwo means the
  9.     player can have either Mew, Mewtwo or neither in the party but not both.
  10.  
  11.     Note that @exclusive is only set on new Pokémon, so if you already have
  12.     a Pokémon that should be exclusive in your save file *it will not be*.
  13.  
  14. diff --git a/Data/Scripts.rxdata b/Data/Scripts.rxdata
  15. index a6e06d6..9966313 100644
  16. --- a/Data/Scripts.rxdata
  17. +++ b/Data/Scripts.rxdata
  18. @@ -72804,6 +72804,7 @@ # PokeBattle_Pokemon.rb
  19.    attr_accessor(:shinyflag)   # Forces the shininess (true/false)
  20.    attr_accessor(:ribbons)     # Array of ribbons
  21.    attr_accessor :cool,:beauty,:cute,:smart,:tough,:sheen   # Contest stats
  22. +  attr_accessor(:exclusive)   # Mutually exclusive, i.e. one-per-party
  23.  
  24.    EVLIMIT     = 510   # Max total EVs
  25.    EVSTATLIMIT = 252   # Max EVs that a single stat can have
  26. @@ -73722,6 +73723,8 @@ # PokeBattle_Pokemon.rb
  27.      dexdata = pbOpenDexData
  28.      pbDexDataOffset(dexdata,self.fSpecies,19)
  29.      @happiness     = dexdata.fgetb
  30. +    pbDexDataOffset(dexdata,self.fSpecies,59)
  31. +    @exclusive     = dexdata.fgetb != 0
  32.      dexdata.close
  33.      if withMoves
  34.        self.resetMoves
  35. @@ -86922,6 +86925,13 @@ # PScreen_PokemonStorage.rb
  36.        pbDisplay(_INTL("Your party's full!"))
  37.        return false
  38.      end
  39. +    exclusive = pbPartyExclusive
  40. +    pkmn = heldpoke || @storage[box,index]
  41. +    if pkmn.exclusive && exclusive
  42. +      pbDisplay(_INTL("{1} cannot be in the party with {2}.", pkmn.name, exclusive.name))
  43. +      return false
  44. +    end
  45. +
  46.      @scene.pbWithdraw(selected,heldpoke,@storage.party.length)
  47.      if heldpoke
  48.        @storage.pbMoveCaughtToParty(heldpoke)
  49. @@ -86996,6 +87006,11 @@ # PScreen_PokemonStorage.rb
  50.        pbDisplay("Please remove the mail.")
  51.        return
  52.      end
  53. +    exclusive = pbPartyExclusive
  54. +    if box==-1 && @heldpkmn.exclusive && exclusive
  55. +      pbDisplay(_INTL("{1} cannot be in the party with {2}.", @heldpkmn.name, exclusive.name))
  56. +      return
  57. +    end
  58.      if box>=0
  59.        @heldpkmn.heal
  60.        @heldpkmn.formTime = nil if @heldpkmn.respond_to?("formTime") && @heldpkmn.formTime
  61. @@ -87023,6 +87038,11 @@ # PScreen_PokemonStorage.rb
  62.        pbDisplay("Please remove the mail.")
  63.        return false
  64.      end
  65. +    exclusive = pbPartyExclusive
  66. +    if box==-1 && @heldpkmn.exclusive && exclusive && exclusive != @storage[box,index]
  67. +      pbDisplay(_INTL("{1} cannot be in the party with {2}.", heldpkmn.name, exclusive.name))
  68. +      return
  69. +    end
  70.      @scene.pbSwap(selected,@heldpkmn)
  71.      if box>=0
  72.        @heldpkmn.heal
  73. @@ -101850,6 +101870,15 @@ # PSystem_PokemonUtilities.rb
  74.    return !$Trainer || ($Trainer.party.length==6 && $PokemonStorage.full?)
  75.  end
  76.  
  77. +def pbPartyExclusive
  78. +  if $Trainer
  79. +    for pkmn in $Trainer.party
  80. +      return pkmn if pkmn.exclusive
  81. +    end
  82. +  end
  83. +  return nil
  84. +end
  85. +
  86.  def pbNickname(pokemon)
  87.    speciesname = PBSpecies.getName(pokemon.species)
  88.    if Kernel.pbConfirmMessage(_INTL("Would you like to give a nickname to {1}?",speciesname))
  89. @@ -101866,7 +101895,7 @@ # PSystem_PokemonUtilities.rb
  90.      return
  91.    end
  92.    pokemon.pbRecordFirstMoves
  93. -  if $Trainer.party.length<6
  94. +  if $Trainer.party.length<6 && (pbPartyExclusive==nil || !pokemon.exclusive)
  95.      $Trainer.party[$Trainer.party.length] = pokemon
  96.    else
  97.      oldcurbox = $PokemonStorage.currentBox
  98. @@ -118349,7 +118378,7 @@ # Compiler.rb
  99.  # Compile Pokémon
  100.  #===============================================================================
  101.  def pbCompilePokemonData
  102. -  # Free bytes: 0, 1, 59-75
  103. +  # Free bytes: 0, 1, 60-75
  104.    # (Some bytes are used only by forms)
  105.    sections = []
  106.    requiredtypes = {
  107. @@ -118394,7 +118423,8 @@ # Compiler.rb
  108.      "WildItemCommon"   => [48,"E",PBItems],
  109.      "WildItemUncommon" => [50,"E",PBItems],
  110.      "WildItemRare"     => [52,"E",PBItems],
  111. -    "Incense"          => [54,"E",PBItems]
  112. +    "Incense"          => [54,"E",PBItems],
  113. +    "Exclusive"        => [59,"b"],
  114.    }
  115.    currentmap = -1
  116.    dexdatas     = []
  117. @@ -118479,6 +118509,9 @@ # Compiler.rb
  118.                when "S"
  119.                  value = secvalue
  120.                  secvalue = ""
  121. +              when "b"
  122. +                value = csvBoolean!(secvalue,key) ? 1 : 0
  123. +                bytes = 1
  124.                end
  125.                case key
  126.                when "Name"
Advertisement
Add Comment
Please, Sign In to add comment