mirror of
https://github.com/infinitefusion/infinitefusion-e18.git
synced 2025-12-06 06:01:46 +00:00
dna reverser, hotel crashes fix, unfusing & exp tracking, wondertrade
This commit is contained in:
39
Data/Scripts/050_AddOns/Autosave.rb
Normal file
39
Data/Scripts/050_AddOns/Autosave.rb
Normal file
@@ -0,0 +1,39 @@
|
||||
|
||||
AUTOSAVE_ENABLED_SWITCH = 48
|
||||
AUTOSAVE_HEALING_VAR = 24
|
||||
AUTOSAVE_CATCH_SWITCH = 782
|
||||
AUTOSAVE_WIN_SWITCH = 783
|
||||
AUTOSAVE_STEPS_SWITCH = 784
|
||||
AUTOSAVE_STEPS_VAR = 236
|
||||
|
||||
def pbSetPokemonCenter
|
||||
$PokemonGlobal.pokecenterMapId = $game_map.map_id
|
||||
$PokemonGlobal.pokecenterX = $game_player.x
|
||||
$PokemonGlobal.pokecenterY = $game_player.y
|
||||
$PokemonGlobal.pokecenterDirection = $game_player.direction
|
||||
if $game_variables[AUTOSAVE_HEALING_VAR]==0
|
||||
pbSEPlay("save",100,100)
|
||||
Kernel.tryAutosave()
|
||||
end
|
||||
end
|
||||
|
||||
def Kernel.Autosave
|
||||
pbSave(false)
|
||||
end
|
||||
|
||||
|
||||
def Kernel.tryAutosave()
|
||||
Kernel.Autosave if $game_switches[AUTOSAVE_ENABLED_SWITCH]
|
||||
end
|
||||
|
||||
if AUTOSAVE_STEPS_SWITCH
|
||||
Events.onMapUpdate+=proc {|sender,e|
|
||||
stepsNum = pbGet(AUTOSAVE_STEPS_VAR)
|
||||
if stepsNum > 0 && !$PokemonGlobal.sliding
|
||||
return if $PokemonGlobal.stepcount < 100
|
||||
if $PokemonGlobal.stepcount % stepsNum == 0
|
||||
Kernel.tryAutosave()
|
||||
end
|
||||
end
|
||||
}
|
||||
end
|
||||
@@ -174,7 +174,15 @@ end
|
||||
#param2 = true pour body, false pour head
|
||||
#return int du pokemon de base
|
||||
def getBasePokemonID(pokemon, body = true)
|
||||
cname = getConstantName(PBSpecies, pokemon) rescue nil
|
||||
if pokemon.is_a?(Symbol)
|
||||
dex_number = GameData::Species.get(pokemon).id_number
|
||||
pokemon = dex_number
|
||||
end
|
||||
|
||||
# cname = getConstantName(PBSpecies, pokemon) rescue nil
|
||||
cname = GameData::Species.get(pokemon).id.to_s
|
||||
|
||||
|
||||
return pokemon if pokemon <= NB_POKEMON
|
||||
return pokemon if cname == nil
|
||||
|
||||
|
||||
@@ -110,4 +110,146 @@ end
|
||||
|
||||
def getHeadID(species, bodyId)
|
||||
return (species - (bodyId * NB_POKEMON)).round
|
||||
end
|
||||
|
||||
def getAllNonLegendaryPokemon()
|
||||
list= []
|
||||
for i in 1..143
|
||||
list.push(i)
|
||||
end
|
||||
for i in 147..149
|
||||
list.push(i)
|
||||
end
|
||||
for i in 152..242
|
||||
list.push(i)
|
||||
end
|
||||
list.push(246)
|
||||
list.push(247)
|
||||
list.push(248)
|
||||
for i in 252..314
|
||||
list.push(i)
|
||||
end
|
||||
for i in 316..339
|
||||
list.push(i)
|
||||
end
|
||||
for i in 352..377
|
||||
list.push(i)
|
||||
end
|
||||
for i in 382..420
|
||||
list.push(i)
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
def getPokemonEggGroups(species)
|
||||
groups = []
|
||||
|
||||
compat10=$pkmn_dex[species][13][0]
|
||||
compat11=$pkmn_dex[species][13][1]
|
||||
|
||||
groups << compat10
|
||||
groups << compat11
|
||||
return groups
|
||||
end
|
||||
|
||||
def generateEggGroupTeam(eggGroup)
|
||||
teamComplete = false
|
||||
generatedTeam = []
|
||||
while !teamComplete
|
||||
species = rand(PBSpecies.maxValue)
|
||||
if getPokemonEggGroups(species).include?(eggGroup)
|
||||
generatedTeam << species
|
||||
end
|
||||
teamComplete = generatedTeam.length == 3
|
||||
end
|
||||
return generatedTeam
|
||||
end
|
||||
|
||||
def pbGetSelfSwitch(eventId,switch)
|
||||
return $game_self_switches[[@map_id,eventId,switch]]
|
||||
end
|
||||
|
||||
def obtainBadgeMessage(badgeName)
|
||||
Kernel.pbMessage(_INTL("\\me[Badge get]{1} obtained the {2}!",$Trainer.name,badgeName))
|
||||
end
|
||||
|
||||
|
||||
def generateSameEggGroupFusionsTeam(eggGroup)
|
||||
teamComplete = false
|
||||
generatedTeam = []
|
||||
while !teamComplete
|
||||
foundFusionPartner = false
|
||||
species1 = rand(NB_POKEMON)
|
||||
if getPokemonEggGroups(species1).include?(eggGroup)
|
||||
foundFusionPartner = false
|
||||
while !foundFusionPartner
|
||||
species2 = rand(NB_POKEMON)
|
||||
if getPokemonEggGroups(species2).include?(eggGroup)
|
||||
generatedTeam << getFusionSpecies(species1,species2)
|
||||
foundFusionPartner = true
|
||||
end
|
||||
end
|
||||
end
|
||||
teamComplete = generatedTeam.length == 3
|
||||
end
|
||||
return generatedTeam
|
||||
end
|
||||
|
||||
def getAllNonLegendaryPokemon()
|
||||
list= []
|
||||
for i in 1..143
|
||||
list.push(i)
|
||||
end
|
||||
for i in 147..149
|
||||
list.push(i)
|
||||
end
|
||||
for i in 152..242
|
||||
list.push(i)
|
||||
end
|
||||
list.push(246)
|
||||
list.push(247)
|
||||
list.push(248)
|
||||
for i in 252..314
|
||||
list.push(i)
|
||||
end
|
||||
for i in 316..339
|
||||
list.push(i)
|
||||
end
|
||||
for i in 352..377
|
||||
list.push(i)
|
||||
end
|
||||
for i in 382..420
|
||||
list.push(i)
|
||||
end
|
||||
return list
|
||||
end
|
||||
|
||||
def generateSimpleTrainerParty(teamSpecies,level)
|
||||
team = []
|
||||
for species in teamSpecies
|
||||
poke = Pokemon.new(species, level)
|
||||
team << poke
|
||||
end
|
||||
return team
|
||||
end
|
||||
|
||||
|
||||
def isSinnohPokemon(species)
|
||||
list =
|
||||
[254,255,256,257,258,259,260,261,262,263,264,265,
|
||||
266,267,268,269,270,271,272,273,274,275,288,294,
|
||||
295,296,297,298,299,305,306,307,308,315,316,317,
|
||||
318,319,320,321,322,323,324,326,332,343,344,345,
|
||||
346,347,352,353,354,358,383,384,388,389,400,402,403]
|
||||
return list.include?(species)
|
||||
end
|
||||
|
||||
|
||||
def isHoennPokemon(species)
|
||||
list=[252,253,276,277,278,279,280,281,282,283,284,
|
||||
285,286,287,289,290,291,292,293,300,301,302,303,
|
||||
304,309,310,311,312,313,314,333,334,335,336,340,
|
||||
341,342,355,356,357,378,379,380,381,382,385,386,387,390,
|
||||
391,392,393,394,395,396,401,404,405]
|
||||
return list.include?(species)
|
||||
end
|
||||
@@ -1,650 +0,0 @@
|
||||
# Le eul but de cette clae et de pouvoir continuer à utilier le format PBTrainer::TRAINER quand on call la méthode de combat de dreeur
|
||||
# pour ne pa à avoir à modifier tou le événement
|
||||
#
|
||||
module PBItems
|
||||
REPEL = 1
|
||||
SUPERREPEL = 2
|
||||
MAXREPEL = 3
|
||||
BLACKFLUTE = 4
|
||||
WHITEFLUTE = 5
|
||||
HONEY = 6
|
||||
ESCAPEROPE = 7
|
||||
REDSHARD = 8
|
||||
YELLOWSHARD = 9
|
||||
BLUESHARD = 10
|
||||
GREENSHARD = 11
|
||||
FIRESTONE = 12
|
||||
THUNDERSTONE = 13
|
||||
WATERSTONE = 14
|
||||
LEAFSTONE = 15
|
||||
MOONSTONE = 16
|
||||
SUNSTONE = 17
|
||||
DUSKSTONE = 18
|
||||
DAWNSTONE = 19
|
||||
SHINYSTONE = 20
|
||||
REDAPRICORN = 21
|
||||
YELLOWAPRICORN = 22
|
||||
BLUEAPRICORN = 23
|
||||
GREENAPRICORN = 24
|
||||
PINKAPRICORN = 25
|
||||
WHITEAPRICORN = 26
|
||||
BLACKAPRICORN = 27
|
||||
HELIXFOSSIL = 28
|
||||
DOMEFOSSIL = 29
|
||||
OLDAMBER = 30
|
||||
ROOTFOSSIL = 31
|
||||
CLAWFOSSIL = 32
|
||||
SKULLFOSSIL = 33
|
||||
ARMORFOSSIL = 34
|
||||
COVERFOSSIL = 35
|
||||
PLUMEFOSSIL = 36
|
||||
PRETTYWING = 37
|
||||
TINYMUSHROOM = 38
|
||||
BIGMUSHROOM = 39
|
||||
BALMMUSHROOM = 40
|
||||
PEARL = 41
|
||||
BIGPEARL = 42
|
||||
PEARLSTRING = 43
|
||||
STARDUST = 44
|
||||
STARPIECE = 45
|
||||
COMETSHARD = 46
|
||||
NUGGET = 47
|
||||
BIGNUGGET = 48
|
||||
HEARTSCALE = 49
|
||||
SLOWPOKETAIL = 50
|
||||
RAREBONE = 51
|
||||
RELICCOPPER = 52
|
||||
RELICSILVER = 53
|
||||
RELICGOLD = 54
|
||||
RELICVASE = 55
|
||||
RELICBAND = 56
|
||||
RELICSTATUE = 57
|
||||
RELICCROWN = 58
|
||||
GROWTHMULCH = 59
|
||||
DAMPMULCH = 60
|
||||
STABLEMULCH = 61
|
||||
GOOEYMULCH = 62
|
||||
SHOALSALT = 63
|
||||
SHOALSHELL = 64
|
||||
ODDKEYSTONE = 65
|
||||
AIRBALLOON = 66
|
||||
BRIGHTPOWDER = 67
|
||||
EVIOLITE = 68
|
||||
FLOATSTONE = 69
|
||||
DESTINYKNOT = 70
|
||||
ROCKYHELMET = 71
|
||||
EJECTBUTTON = 72
|
||||
REDCARD = 73
|
||||
SHEDSHELL = 74
|
||||
SMOKEBALL = 75
|
||||
LUCKYEGG = 76
|
||||
EXPSHARE = 77
|
||||
AMULETCOIN = 78
|
||||
SOOTHEBELL = 79
|
||||
CLEANSETAG = 80
|
||||
CHOICEBAND = 81
|
||||
CHOICESPECS = 82
|
||||
CHOICESCARF = 83
|
||||
HEATROCK = 84
|
||||
DAMPROCK = 85
|
||||
SMOOTHROCK = 86
|
||||
ICYROCK = 87
|
||||
LIGHTCLAY = 88
|
||||
GRIPCLAW = 89
|
||||
BINDINGBAND = 90
|
||||
BIGROOT = 91
|
||||
BLACKSLUDGE = 92
|
||||
LEFTOVERS = 93
|
||||
SHELLBELL = 94
|
||||
MENTALHERB = 95
|
||||
WHITEHERB = 96
|
||||
POWERHERB = 97
|
||||
ABSORBBULB = 98
|
||||
CELLBATTERY = 99
|
||||
LIFEORB = 100
|
||||
EXPERTBELT = 101
|
||||
METRONOME = 102
|
||||
MUSCLEBAND = 103
|
||||
WISEGLASSES = 104
|
||||
RAZORCLAW = 105
|
||||
SCOPELENS = 106
|
||||
WIDELENS = 107
|
||||
ZOOMLENS = 108
|
||||
KINGSROCK = 109
|
||||
RAZORFANG = 110
|
||||
LAGGINGTAIL = 111
|
||||
QUICKCLAW = 112
|
||||
FOCUSBAND = 113
|
||||
FOCUSSASH = 114
|
||||
FLAMEORB = 115
|
||||
TOXICORB = 116
|
||||
STICKYBARB = 117
|
||||
IRONBALL = 118
|
||||
RINGTARGET = 119
|
||||
MACHOBRACE = 120
|
||||
POWERWEIGHT = 121
|
||||
POWERBRACER = 122
|
||||
POWERBELT = 123
|
||||
POWERLENS = 124
|
||||
POWERBAND = 125
|
||||
POWERANKLET = 126
|
||||
LAXINCENSE = 127
|
||||
FULLINCENSE = 128
|
||||
LUCKINCENSE = 129
|
||||
PUREINCENSE = 130
|
||||
SEAINCENSE = 131
|
||||
WAVEINCENSE = 132
|
||||
ROSEINCENSE = 133
|
||||
ODDINCENSE = 134
|
||||
ROCKINCENSE = 135
|
||||
CHARCOAL = 136
|
||||
MYSTICWATER = 137
|
||||
MAGNET = 138
|
||||
MIRACLESEED = 139
|
||||
NEVERMELTICE = 140
|
||||
BLACKBELT = 141
|
||||
POISONBARB = 142
|
||||
SOFTSAND = 143
|
||||
SHARPBEAK = 144
|
||||
TWISTEDSPOON = 145
|
||||
SILVERPOWDER = 146
|
||||
HARDSTONE = 147
|
||||
SPELLTAG = 148
|
||||
DRAGONFANG = 149
|
||||
BLACKGLASSES = 150
|
||||
METALCOAT = 151
|
||||
SILKSCARF = 152
|
||||
FLAMEPLATE = 153
|
||||
SPLASHPLATE = 154
|
||||
ZAPPLATE = 155
|
||||
MEADOWPLATE = 156
|
||||
ICICLEPLATE = 157
|
||||
FISTPLATE = 158
|
||||
TOXICPLATE = 159
|
||||
EARTHPLATE = 160
|
||||
SKYPLATE = 161
|
||||
MINDPLATE = 162
|
||||
INSECTPLATE = 163
|
||||
STONEPLATE = 164
|
||||
SPOOKYPLATE = 165
|
||||
DRACOPLATE = 166
|
||||
DREADPLATE = 167
|
||||
IRONPLATE = 168
|
||||
FIREGEM = 169
|
||||
WATERGEM = 170
|
||||
ELECTRICGEM = 171
|
||||
GRASSGEM = 172
|
||||
ICEGEM = 173
|
||||
FIGHTINGGEM = 174
|
||||
POISONGEM = 175
|
||||
GROUNDGEM = 176
|
||||
FLYINGGEM = 177
|
||||
PSYCHICGEM = 178
|
||||
BUGGEM = 179
|
||||
ROCKGEM = 180
|
||||
GHOSTGEM = 181
|
||||
DRAGONGEM = 182
|
||||
DARKGEM = 183
|
||||
STEELGEM = 184
|
||||
NORMALGEM = 185
|
||||
LIGHTBALL = 186
|
||||
LUCKYPUNCH = 187
|
||||
METALPOWDER = 188
|
||||
QUICKPOWDER = 189
|
||||
THICKCLUB = 190
|
||||
STICK = 191
|
||||
SOULDEW = 192
|
||||
DEEPSEATOOTH = 193
|
||||
DEEPSEASCALE = 194
|
||||
ADAMANTORB = 195
|
||||
LUSTROUSORB = 196
|
||||
GRISEOUSORB = 197
|
||||
DOUSEDRIVE = 198
|
||||
SHOCKDRIVE = 199
|
||||
BURNDRIVE = 200
|
||||
CHILLDRIVE = 201
|
||||
EVERSTONE = 202
|
||||
DRAGONSCALE = 203
|
||||
UPGRADE = 204
|
||||
DUBIOUSDISC = 205
|
||||
PROTECTOR = 206
|
||||
ELECTIRIZER = 207
|
||||
MAGMARIZER = 208
|
||||
REAPERCLOTH = 209
|
||||
PRISMSCALE = 210
|
||||
OVALSTONE = 211
|
||||
REDSCARF = 212
|
||||
BLUESCARF = 213
|
||||
PINKSCARF = 214
|
||||
GREENSCARF = 215
|
||||
YELLOWSCARF = 216
|
||||
POTION = 217
|
||||
SUPERPOTION = 218
|
||||
HYPERPOTION = 219
|
||||
MAXPOTION = 220
|
||||
FULLRESTORE = 221
|
||||
SACREDASH = 222
|
||||
AWAKENING = 223
|
||||
ANTIDOTE = 224
|
||||
BURNHEAL = 225
|
||||
PARLYZHEAL = 226
|
||||
ICEHEAL = 227
|
||||
FULLHEAL = 228
|
||||
LAVACOOKIE = 229
|
||||
OLDGATEAU = 230
|
||||
CASTELIACONE = 231
|
||||
REVIVE = 232
|
||||
MAXREVIVE = 233
|
||||
BERRYJUICE = 234
|
||||
RAGECANDYBAR = 235
|
||||
SWEETHEART = 236
|
||||
FRESHWATER = 237
|
||||
SODAPOP = 238
|
||||
LEMONADE = 239
|
||||
MOOMOOMILK = 240
|
||||
ENERGYPOWDER = 241
|
||||
ENERGYROOT = 242
|
||||
HEALPOWDER = 243
|
||||
REVIVALHERB = 244
|
||||
ETHER = 245
|
||||
MAXETHER = 246
|
||||
ELIXIR = 247
|
||||
MAXELIXIR = 248
|
||||
PPUP = 249
|
||||
PPMAX = 250
|
||||
HPUP = 251
|
||||
PROTEIN = 252
|
||||
IRON = 253
|
||||
CALCIUM = 254
|
||||
ZINC = 255
|
||||
CARBOS = 256
|
||||
HEALTHWING = 257
|
||||
MUSCLEWING = 258
|
||||
RESISTWING = 259
|
||||
GENIUSWING = 260
|
||||
CLEVERWING = 261
|
||||
SWIFTWING = 262
|
||||
RARECANDY = 263
|
||||
MASTERBALL = 264
|
||||
ULTRABALL = 265
|
||||
GREATBALL = 266
|
||||
POKEBALL = 267
|
||||
SAFARIBALL = 268
|
||||
SPORTBALL = 269
|
||||
NETBALL = 270
|
||||
DIVEBALL = 271
|
||||
NESTBALL = 272
|
||||
REPEATBALL = 273
|
||||
TIMERBALL = 274
|
||||
LUXURYBALL = 275
|
||||
PREMIERBALL = 276
|
||||
DUSKBALL = 277
|
||||
HEALBALL = 278
|
||||
QUICKBALL = 279
|
||||
CHERISHBALL = 280
|
||||
FASTBALL = 281
|
||||
LEVELBALL = 282
|
||||
LUREBALL = 283
|
||||
HEAVYBALL = 284
|
||||
LOVEBALL = 285
|
||||
FRIENDBALL = 286
|
||||
MOONBALL = 287
|
||||
TM01 = 288
|
||||
TM02 = 289
|
||||
TM03 = 290
|
||||
TM04 = 291
|
||||
TM05 = 292
|
||||
TM06 = 293
|
||||
TM07 = 294
|
||||
TM08 = 295
|
||||
TM09 = 296
|
||||
TM10 = 297
|
||||
TM11 = 298
|
||||
TM12 = 299
|
||||
TM13 = 300
|
||||
TM14 = 301
|
||||
TM15 = 302
|
||||
TM16 = 303
|
||||
TM17 = 304
|
||||
TM18 = 305
|
||||
TM19 = 306
|
||||
TM20 = 307
|
||||
TM21 = 308
|
||||
TM22 = 309
|
||||
TM23 = 310
|
||||
TM24 = 311
|
||||
TM25 = 312
|
||||
TM26 = 313
|
||||
TM27 = 314
|
||||
TM27 = 315
|
||||
TM29 = 316
|
||||
TM30 = 317
|
||||
TM31 = 318
|
||||
TM32 = 319
|
||||
TM33 = 320
|
||||
TM34 = 321
|
||||
TM35 = 322
|
||||
TM36 = 323
|
||||
TM37 = 324
|
||||
TM38 = 325
|
||||
TM39 = 326
|
||||
TM40 = 327
|
||||
TM41 = 328
|
||||
TM42 = 329
|
||||
TM43 = 330
|
||||
TM44 = 331
|
||||
TM45 = 332
|
||||
TM46 = 333
|
||||
TM47 = 334
|
||||
TM48 = 335
|
||||
TM49 = 336
|
||||
TM50 = 337
|
||||
TM51 = 338
|
||||
TM52 = 339
|
||||
TM53 = 340
|
||||
TM54 = 341
|
||||
TM55 = 342
|
||||
TM56 = 343
|
||||
TM57 = 344
|
||||
TM58 = 345
|
||||
TM59 = 346
|
||||
TM60 = 347
|
||||
TM61 = 348
|
||||
TM62 = 349
|
||||
TM63 = 350
|
||||
TM64 = 351
|
||||
TM65 = 352
|
||||
TM66 = 353
|
||||
TM67 = 354
|
||||
TM68 = 355
|
||||
TM69 = 356
|
||||
TM70 = 357
|
||||
TM71 = 358
|
||||
TM72 = 359
|
||||
TM73 = 360
|
||||
TM74 = 361
|
||||
TM75 = 362
|
||||
TM76 = 363
|
||||
TM77 = 364
|
||||
TM78 = 365
|
||||
TM79 = 366
|
||||
TM80 = 367
|
||||
TM81 = 368
|
||||
TM82 = 369
|
||||
TM83 = 370
|
||||
TM84 = 371
|
||||
TM85 = 372
|
||||
TM86 = 373
|
||||
TM87 = 374
|
||||
TM88 = 375
|
||||
TM89 = 376
|
||||
TM90 = 377
|
||||
TM91 = 378
|
||||
TM92 = 379
|
||||
TM93 = 380
|
||||
TM94 = 381
|
||||
TM95 = 382
|
||||
HM01 = 383
|
||||
HM02 = 384
|
||||
HM03 = 385
|
||||
HM04 = 386
|
||||
HM05 = 387
|
||||
HM06 = 388
|
||||
CHERIBERRY = 389
|
||||
CHESTOBERRY = 390
|
||||
PECHABERRY = 391
|
||||
RAWSTBERRY = 392
|
||||
ASPEARBERRY = 393
|
||||
LEPPABERRY = 394
|
||||
ORANBERRY = 395
|
||||
PERSIMBERRY = 396
|
||||
LUMBERRY = 397
|
||||
SITRUSBERRY = 398
|
||||
FIGYBERRY = 399
|
||||
WIKIBERRY = 400
|
||||
MAGOBERRY = 401
|
||||
AGUAVBERRY = 402
|
||||
IAPAPABERRY = 403
|
||||
RAZZBERRY = 404
|
||||
BLUKBERRY = 405
|
||||
NANABBERRY = 406
|
||||
WEPEARBERRY = 407
|
||||
PINAPBERRY = 408
|
||||
POMEGBERRY = 409
|
||||
KELPSYBERRY = 410
|
||||
QUALOTBERRY = 411
|
||||
HONDEWBERRY = 412
|
||||
GREPABERRY = 413
|
||||
TAMATOBERRY = 414
|
||||
CORNNBERRY = 415
|
||||
MAGOSTBERRY = 416
|
||||
RABUTABERRY = 417
|
||||
NOMELBERRY = 418
|
||||
SPELONBERRY = 419
|
||||
PAMTREBERRY = 420
|
||||
WATMELBERRY = 421
|
||||
DURINBERRY = 422
|
||||
BELUEBERRY = 423
|
||||
OCCABERRY = 424
|
||||
PASSHOBERRY = 425
|
||||
WACANBERRY = 426
|
||||
RINDOBERRY = 427
|
||||
YACHEBERRY = 428
|
||||
CHOPLEBERRY = 429
|
||||
KEBIABERRY = 430
|
||||
SHUCABERRY = 431
|
||||
COBABERRY = 432
|
||||
PAYAPABERRY = 433
|
||||
TANGABERRY = 434
|
||||
CHARTIBERRY = 435
|
||||
KASIBBERRY = 436
|
||||
HABANBERRY = 437
|
||||
COLBURBERRY = 438
|
||||
BABIRIBERRY = 439
|
||||
CHILANBERRY = 440
|
||||
LIECHIBERRY = 441
|
||||
GANLONBERRY = 442
|
||||
SALACBERRY = 443
|
||||
PETAYABERRY = 444
|
||||
APICOTBERRY = 445
|
||||
LANSATBERRY = 446
|
||||
STARFBERRY = 447
|
||||
ENIGMABERRY = 448
|
||||
MICLEBERRY = 449
|
||||
CUSTAPBERRY = 450
|
||||
JABOCABERRY = 451
|
||||
ROWAPBERRY = 452
|
||||
GRASSMAIL = 453
|
||||
FLAMEMAIL = 454
|
||||
BUBBLEMAIL = 455
|
||||
BLOOMMAIL = 456
|
||||
TUNNELMAIL = 457
|
||||
STEELMAIL = 458
|
||||
HEARTMAIL = 459
|
||||
SNOWMAIL = 460
|
||||
SPACEMAIL = 461
|
||||
AIRMAIL = 462
|
||||
MOSAICMAIL = 463
|
||||
BRICKMAIL = 464
|
||||
XATTACK = 465
|
||||
XATTACK2 = 466
|
||||
XATTACK3 = 467
|
||||
XATTACK6 = 468
|
||||
XDEFENSE = 469
|
||||
XDEFENSE2 = 470
|
||||
XDEFENSE3 = 471
|
||||
XDEFENSE6 = 472
|
||||
XSPATK = 473
|
||||
XSPATK2 = 474
|
||||
XSPATK3 = 475
|
||||
XSPATK6 = 476
|
||||
XSPDEF = 477
|
||||
XSPDEF2 = 478
|
||||
XSPDEF3 = 479
|
||||
XSPDEF6 = 480
|
||||
XSPEED = 481
|
||||
XSPEED2 = 482
|
||||
XSPEED3 = 483
|
||||
XSPEED6 = 484
|
||||
XACCURACY = 485
|
||||
XACCURACY2 = 486
|
||||
XACCURACY3 = 487
|
||||
XACCURACY6 = 488
|
||||
DIREHIT = 489
|
||||
DIREHIT2 = 490
|
||||
DIREHIT3 = 491
|
||||
GUARDSPEC = 492
|
||||
RESETURGE = 493
|
||||
ABILITYURGE = 494
|
||||
ITEMURGE = 495
|
||||
ITEMDROP = 496
|
||||
BLUEFLUTE = 497
|
||||
YELLOWFLUTE = 498
|
||||
REDFLUTE = 499
|
||||
POKEDOLL = 500
|
||||
FLUFFYTAIL = 501
|
||||
POKETOY = 502
|
||||
BICYCLE = 503
|
||||
OLDROD = 504
|
||||
GOODROD = 505
|
||||
SUPERROD = 506
|
||||
ITEMFINDER = 507
|
||||
DOWSINGMACHINE = 508
|
||||
POKERADAR = 509
|
||||
TOWNMAP = 510
|
||||
POKEFLUTE = 511
|
||||
COINCASE = 512
|
||||
SOOTSACK = 513
|
||||
SILPHSCOPE = 514
|
||||
DEVONSCOPE = 515
|
||||
SQUIRTBOTTLE = 516
|
||||
SPRAYDUCK = 517
|
||||
WAILMERPAIL = 518
|
||||
GRACIDEA = 519
|
||||
AURORATICKET = 520
|
||||
OLDSEAMAP = 521
|
||||
DNASPLICERS = 522
|
||||
REVEALGLASS = 523
|
||||
OVALCHARM = 524
|
||||
SHINYCHARM = 525
|
||||
FUSIONREPEL = 526
|
||||
SSTICKET = 527
|
||||
COFFEE = 528
|
||||
SKINNYLATTE = 529
|
||||
HM07 = 530
|
||||
HM08 = 531
|
||||
KRABBYLEGS = 532
|
||||
LOVELETTER = 533
|
||||
MASTERBALLPROTO = 534
|
||||
TM96 = 535
|
||||
MACHETE = 536
|
||||
PICKAXE = 537
|
||||
LANTERN = 538
|
||||
SURFBOARD = 539
|
||||
TELEPORTER = 540
|
||||
SCUBAGEAR = 541
|
||||
LEVER = 542
|
||||
DEBUGGER = 543
|
||||
WOODENPLANKS = 544
|
||||
BRICKS = 545
|
||||
ROCKETID = 546
|
||||
BEER = 547
|
||||
SHOOTER = 548
|
||||
SUPERSPLICERS = 549
|
||||
SAFARISOUVENIR = 550
|
||||
POKEDEX = 551
|
||||
CARDKEY = 552
|
||||
PIZZA = 553
|
||||
CAPTAINSKEY = 554
|
||||
GENDERBALL = 555
|
||||
TRADEBALL = 556
|
||||
ABILITYBALL = 557
|
||||
VIRUSBALL = 558
|
||||
SHINYBALL = 559
|
||||
PERFECTBALL = 560
|
||||
OLDBOOT = 561
|
||||
INFINITESPLICERS = 562
|
||||
EXPALL = 563
|
||||
OAKSPARCEL = 564
|
||||
POWERPLANTKEY = 565
|
||||
DAMAGEUP = 566
|
||||
ACCURACYUP = 567
|
||||
MISTSTONE = 568
|
||||
DEVOLUTIONSPRAY = 569
|
||||
TRANSGENDERSTONE = 570
|
||||
WHITEFLAG = 571
|
||||
FAIRYGEM = 572
|
||||
DREAMBALL = 573
|
||||
TOXICBALL = 574
|
||||
SPARKBALL = 575
|
||||
SCORCHBALL = 576
|
||||
FROSTBALL = 577
|
||||
PUREBALL = 578
|
||||
STATUSBALL = 579
|
||||
CANDYBALL = 580
|
||||
DNAREVERSER = 581
|
||||
ROCKETMEAL = 582
|
||||
FANCYMEAL = 583
|
||||
INCUBATOR = 584
|
||||
FIRECRACKER = 585
|
||||
MANSIONKEY = 586
|
||||
POISONMUSHROOM = 587
|
||||
EXPALLOFF = 588
|
||||
GASMASK = 589
|
||||
MANKEYPAW = 590
|
||||
ICEPICK = 591
|
||||
RACEBIKE = 592
|
||||
DIAMOND = 593
|
||||
DIAMONDNECKLACE = 594
|
||||
GOLDRING = 595
|
||||
SEADRAFIN = 596
|
||||
SACREDPOTION = 597
|
||||
ABILITYCAPSULE = 598
|
||||
MAGICBOOTS = 599
|
||||
ANCIENTSTONE = 600
|
||||
ICESTONE = 601
|
||||
GSBALL = 602
|
||||
MAGNETPASS = 603
|
||||
SECRETCAPSULE = 604
|
||||
ODDKEYSTONE_FULL = 605
|
||||
DYNAMITE = 607
|
||||
BERSERKGENE = 606
|
||||
AZUREFLUTE = 608
|
||||
MAGNETSTONE = 609
|
||||
PIXIEPLATE = 610
|
||||
OLDPENDANT = 611
|
||||
BELLSPROUTSTATUE = 612
|
||||
TM97 = 613
|
||||
TM98 = 614
|
||||
TM99 = 615
|
||||
TM100 = 616
|
||||
TM101 = 617
|
||||
TM102 = 618
|
||||
TM103 = 619
|
||||
TM104 = 620
|
||||
TM105 = 621
|
||||
TM108 = 622
|
||||
ROCKETBALL = 623
|
||||
FUSIONBALL = 624
|
||||
TM106 = 625
|
||||
TM107 = 626
|
||||
RUBY = 627
|
||||
SAPPHIRE = 628
|
||||
EMERALD = 629
|
||||
NETWORKCHIP = 630
|
||||
BANANA = 631
|
||||
GOLDENBANANA = 632
|
||||
DEMHARDMODE = 633
|
||||
LIGHTSTONE = 634
|
||||
DARKSTONE = 635
|
||||
BRONZEEMBLEM = 636
|
||||
SILVEREMBLEM = 637
|
||||
GOLDEMBLEM = 638
|
||||
HM09 = 639
|
||||
HM10 = 640
|
||||
CLIMBINGGEAR = 641
|
||||
INCUBATOR_NORMAL = 642
|
||||
JETPACK = 643
|
||||
INFINITEREVERSERS = 644
|
||||
INFINITESPLICERS = 645
|
||||
end
|
||||
@@ -1,120 +0,0 @@
|
||||
# Le seul but de cette classe est de pouvoir continuer à utiliser le format PBTrainers::TRAINER quand on call la méthode de combat de dresseur
|
||||
# pour ne pas à avoir à modifier tous les événements
|
||||
|
||||
module PBTrainers
|
||||
POKEMONTRAINER_Red = 0
|
||||
POKEMONTRAINER_Leaf = 1
|
||||
POKEMONTRAINER_Gold = 2
|
||||
POKEMONTRAINER_May = 3
|
||||
RIVAL1 = 4
|
||||
RIVAL2 = 5
|
||||
AROMALADY = 6
|
||||
BEAUTY = 7
|
||||
BIKER = 8
|
||||
BIRDKEEPER = 9
|
||||
BUGCATCHER = 10
|
||||
BURGLAR = 11
|
||||
CHANNELER = 12
|
||||
CUEBALL = 13
|
||||
ENGINEER = 14
|
||||
FISHERMAN = 15
|
||||
GAMBLER = 16
|
||||
GENTLEMAN = 17
|
||||
HIKER = 18
|
||||
JUGGLER = 19
|
||||
LADY = 20
|
||||
PAINTER = 21
|
||||
POKEMANIAC = 22
|
||||
POKEMONBREEDER = 23
|
||||
PROFESSOR = 24
|
||||
ROCKER = 25
|
||||
RUINMANIAC = 26
|
||||
SAILOR = 27
|
||||
SCIENTIST = 28
|
||||
SUPERNERD = 29
|
||||
TAMER = 30
|
||||
BLACKBELT = 31
|
||||
CRUSHGIRL = 32
|
||||
CAMPER = 33
|
||||
PICNICKER = 34
|
||||
COOLTRAINER_M = 35
|
||||
COOLTRAINER_F = 36
|
||||
YOUNGSTER = 37
|
||||
LASS = 38
|
||||
POKEMONRANGER_M =
|
||||
POKEMONRANGER_F = 40
|
||||
PSYCHIC_M = 41
|
||||
PSYCHIC_F = 42
|
||||
SWIMMER_M = 43
|
||||
SWIMMER_F = 44
|
||||
SWIMMER2_M = 45
|
||||
SWIMMER2_F = 46
|
||||
TUBER_M = 47
|
||||
TUBER_F = 48
|
||||
TUBER2_M = 49
|
||||
TUBER2_F = 50
|
||||
COOLCOUPLE = 51
|
||||
CRUSHKIN = 52
|
||||
SISANDBRO = 53
|
||||
TWINS = 54
|
||||
YOUNGCOUPLE = 55
|
||||
TEAMROCKET_M = 56
|
||||
TEAMROCKET_F = 57
|
||||
ROCKETBOSS = 58
|
||||
LEADER_Brock = 59
|
||||
LEADER_Misty = 60
|
||||
LEADER_Surge = 61
|
||||
LEADER_Erika = 62
|
||||
LEADER_Koga = 63
|
||||
LEADER_Sabrina = 64
|
||||
LEADER_Blaine = 65
|
||||
LEADER_Giovanni = 66
|
||||
ELITEFOUR_Lorelei = 67
|
||||
ELITEFOUR_Bruno = 68
|
||||
ELITEFOUR_Agatha = 69
|
||||
ELITEFOUR_Lance = 70
|
||||
CHAMPION = 71
|
||||
SOCIALITE = 72
|
||||
BUGCATCHER_F = 73
|
||||
MR_FUJI = 74
|
||||
ROUGHNECK = 75
|
||||
TEACHER = 76
|
||||
PRESCHOOLER_M = 77
|
||||
PRESCHOOLER_F = 78
|
||||
HIPSTER = 79
|
||||
HAUNTEDGIRL_YOUNG = 80
|
||||
HAUNTEDGIRL = 81
|
||||
CLOWN = 82
|
||||
NURSE = 83
|
||||
WORKER = 84
|
||||
POKEMONTRAINER_RedB = 85
|
||||
POKEMONTRAINER_RedG = 86
|
||||
POKEMONTRAINER_RedY = 87
|
||||
POKEMONTRAINER_LeafB = 88
|
||||
POKEMONTRAINER_LeafG = 89
|
||||
POKEMONTRAINER_LeafY = 90
|
||||
COOLTRAINER_M = 91
|
||||
COOLTRAINER_F = 92
|
||||
ROBOT = 93
|
||||
FARMER = 94
|
||||
PYROMANIAC = 95
|
||||
ROCKETEXEC_F = 96
|
||||
ROCKETEXEC_M = 97
|
||||
LEADER_Whitney = 98
|
||||
LEADER_Kurt = 99
|
||||
LEADER_Falkner = 100
|
||||
LEADER_Clair = 101
|
||||
MYSTICALMAN = 102
|
||||
LEADER_Morty = 103
|
||||
TEAMPLASMA_M = 104
|
||||
TEAMPLASMA_F = 105
|
||||
SCIENTIST_Colress = 106
|
||||
LEADER_Pryce = 107
|
||||
KIMONOGIRL = 108
|
||||
SAGE = 109
|
||||
PLAYER = 110
|
||||
LEADER_Chuck = 111
|
||||
LEADER_Jasmine = 112
|
||||
POLICE = 113
|
||||
SKIER_F = 114
|
||||
end
|
||||
@@ -1,7 +0,0 @@
|
||||
#pour pas avoir a changer les evenements qui callent PBTypes.getName dans les gyms
|
||||
class PBTypes
|
||||
def PBTypes.getName(index)
|
||||
return GameData::Type.get(index).real_name
|
||||
end
|
||||
|
||||
end
|
||||
@@ -435,15 +435,22 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS, proc { |item, pokemon, scene|
|
||||
next false
|
||||
})
|
||||
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
|
||||
if pokemon.species <= CONST_NB_POKE
|
||||
if !pokemon.isFusion?
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
end
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name))
|
||||
body = getBasePokemonID(pokemon.species, true)
|
||||
head = getBasePokemonID(pokemon.species, false)
|
||||
newspecies = (head) * CONST_NB_POKE + body
|
||||
newspecies = (head) * Settings::NB_POKEMON + body
|
||||
|
||||
body_exp = pokemon.exp_when_fused_body
|
||||
head_exp = pokemon.exp_when_fused_head
|
||||
|
||||
pokemon.exp_when_fused_body = head_exp
|
||||
pokemon.exp_when_fused_head = body_exp
|
||||
|
||||
#play animation
|
||||
pbFadeOutInWithMusic(99999) {
|
||||
@@ -451,7 +458,6 @@ ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
|
||||
fus.pbStartScreen(pokemon, newspecies, true)
|
||||
fus.pbEvolution(false, true)
|
||||
fus.pbEndScreen
|
||||
#fus.pbStartScreen(pokemon,newspecies,1)
|
||||
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 })
|
||||
scene.pbRefresh
|
||||
}
|
||||
@@ -461,119 +467,170 @@ ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
|
||||
next false
|
||||
})
|
||||
|
||||
def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
if (pokemon.species <= NB_POKEMON)
|
||||
if pokemon.fused != nil
|
||||
if $Trainer.party.length >= 6
|
||||
scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
|
||||
return false
|
||||
else
|
||||
$Trainer.party[$Trainer.party.length] = pokemon.fused
|
||||
pokemon.fused = nil
|
||||
pokemon.form = 0
|
||||
scene.pbHardRefresh
|
||||
scene.pbDisplay(_INTL("{1} changed Forme!", pokemon.name))
|
||||
return true
|
||||
end
|
||||
ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
|
||||
if !pokemon.isFusion?
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
end
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name))
|
||||
body = getBasePokemonID(pokemon.species, true)
|
||||
head = getBasePokemonID(pokemon.species, false)
|
||||
newspecies = (head) * Settings::NB_POKEMON + body
|
||||
|
||||
body_exp = pokemon.exp_when_fused_body
|
||||
head_exp = pokemon.exp_when_fused_head
|
||||
|
||||
pokemon.exp_when_fused_body = head_exp
|
||||
pokemon.exp_when_fused_head = body_exp
|
||||
|
||||
#play animation
|
||||
pbFadeOutInWithMusic(99999) {
|
||||
fus = PokemonEvolutionScene.new
|
||||
fus.pbStartScreen(pokemon, newspecies, true)
|
||||
fus.pbEvolution(false, true)
|
||||
fus.pbEndScreen
|
||||
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 })
|
||||
scene.pbRefresh
|
||||
}
|
||||
next true
|
||||
end
|
||||
|
||||
next false
|
||||
})
|
||||
|
||||
|
||||
#
|
||||
# def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
# if (pokemon.species <= NB_POKEMON)
|
||||
# if pokemon.fused != nil
|
||||
# if $Trainer.party.length >= 6
|
||||
# scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
|
||||
# return false
|
||||
# else
|
||||
# $Trainer.party[$Trainer.party.length] = pokemon.fused
|
||||
# pokemon.fused = nil
|
||||
# pokemon.form = 0
|
||||
# scene.pbHardRefresh
|
||||
# scene.pbDisplay(_INTL("{1} changed Forme!", pokemon.name))
|
||||
# return true
|
||||
# end
|
||||
# else
|
||||
# chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
||||
# if chosen >= 0
|
||||
# poke2 = $Trainer.party[chosen]
|
||||
# if (poke2.species <= NB_POKEMON) && poke2 != pokemon
|
||||
# #check if fainted
|
||||
# if pokemon.hp == 0 || poke2.hp == 0
|
||||
# scene.pbDisplay(_INTL("A fainted Pokémon cannot be fused!"))
|
||||
# return false
|
||||
# end
|
||||
# if pbFuse(pokemon, poke2, supersplicers)
|
||||
# pbRemovePokemonAt(chosen)
|
||||
# end
|
||||
# elsif pokemon == poke2
|
||||
# scene.pbDisplay(_INTL("{1} can't be fused with itself!", pokemon.name))
|
||||
# return false
|
||||
# else
|
||||
# scene.pbDisplay(_INTL("{1} can't be fused with {2}.", poke2.name, pokemon.name))
|
||||
# return false
|
||||
#
|
||||
# end
|
||||
#
|
||||
# else
|
||||
# return false
|
||||
# end
|
||||
# end
|
||||
# else
|
||||
# return true if pbUnfuse(pokemon, scene, supersplicers)
|
||||
#
|
||||
# #unfuse
|
||||
# end
|
||||
# end
|
||||
#
|
||||
# def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
||||
# #pcPosition nil : unfusing from party
|
||||
# #pcPosition [x,x] : unfusing from pc
|
||||
# #
|
||||
#
|
||||
# if (pokemon.obtain_method == 2 || pokemon.ot != $Trainer.name) # && !canunfuse
|
||||
# scene.pbDisplay(_INTL("You can't unfuse a Pokémon obtained in a trade!"))
|
||||
# return false
|
||||
# else
|
||||
# if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be unfused?", pokemon.name))
|
||||
# if pokemon.species > (NB_POKEMON * NB_POKEMON) + NB_POKEMON #triple fusion
|
||||
# scene.pbDisplay(_INTL("{1} cannot be unfused.", pokemon.name))
|
||||
# return false
|
||||
# elsif $Trainer.party.length >= 6 && !pcPosition
|
||||
# scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
|
||||
# return false
|
||||
# else
|
||||
# scene.pbDisplay(_INTL("Unfusing ... "))
|
||||
# scene.pbDisplay(_INTL(" ... "))
|
||||
# scene.pbDisplay(_INTL(" ... "))
|
||||
#
|
||||
# bodyPoke = getBasePokemonID(pokemon.species, true)
|
||||
# headPoke = getBasePokemonID(pokemon.species, false)
|
||||
#
|
||||
#
|
||||
# if pokemon.exp_when_fused_head == nil || pokemon.exp_when_fused_body == nil
|
||||
# new_level = calculateUnfuseLevelOldMethod(pokemon, supersplicers)
|
||||
# body_level = new_level
|
||||
# head_level = new_level
|
||||
# poke1 = Pokemon.new(bodyPoke, body_level)
|
||||
# poke2 = Pokemon.new(headPoke, head_level)
|
||||
# else
|
||||
# exp_body = pokemon.exp_when_fused_body + pokemon.exp_gained_since_fused
|
||||
# exp_head = pokemon.exp_when_fused_head + pokemon.exp_gained_since_fused
|
||||
#
|
||||
# poke1 = Pokemon.new(bodyPoke, pokemon.level)
|
||||
# poke2 = Pokemon.new(headPoke, pokemon.level)
|
||||
# poke1.exp = exp_body
|
||||
# poke2.exp = exp_head
|
||||
# end
|
||||
#
|
||||
# #poke1 = PokeBattle_Pokemon.new(bodyPoke, lev, $Trainer)
|
||||
# #poke2 = PokeBattle_Pokemon.new(headPoke, lev, $Trainer)
|
||||
#
|
||||
# if pcPosition == nil
|
||||
# box = pcPosition[0]
|
||||
# index = pcPosition[1]
|
||||
# $PokemonStorage.pbStoreToBox(poke2, box, index)
|
||||
# else
|
||||
# Kernel.pbAddPokemonSilent(poke2, poke2.level)
|
||||
# end
|
||||
# #On ajoute l'autre dans le pokedex aussi
|
||||
# $Trainer.seen[poke1.species] = true
|
||||
# $Trainer.owned[poke1.species] = true
|
||||
# $Trainer.seen[poke2.species] = true
|
||||
# $Trainer.owned[poke2.species] = true
|
||||
#
|
||||
# pokemon.species = poke1.species
|
||||
# pokemon.level = poke1.level
|
||||
# pokemon.name = poke1.name
|
||||
# pokemon.moves = poke1.moves
|
||||
# pokemon.obtain_method = 0
|
||||
# poke1.obtain_method = 0
|
||||
#
|
||||
# #scene.pbDisplay(_INTL(p1.to_s + " " + p2.to_s))
|
||||
# scene.pbHardRefresh
|
||||
# scene.pbDisplay(_INTL("Your Pokémon were successfully unfused! "))
|
||||
# return true
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
# end
|
||||
|
||||
def calculateUnfuseLevelOldMethod(pokemon, supersplicers)
|
||||
if pokemon.level > 1
|
||||
if supersplicers
|
||||
lev = pokemon.level * 0.9
|
||||
else
|
||||
chosen = scene.pbChoosePokemon(_INTL("Fuse with which Pokémon?"))
|
||||
if chosen >= 0
|
||||
poke2 = $Trainer.party[chosen]
|
||||
if (poke2.species <= NB_POKEMON) && poke2 != pokemon
|
||||
#check if fainted
|
||||
if pokemon.hp == 0 || poke2.hp == 0
|
||||
scene.pbDisplay(_INTL("A fainted Pokémon cannot be fused!"))
|
||||
return false
|
||||
end
|
||||
if pbFuse(pokemon, poke2, supersplicers)
|
||||
pbRemovePokemonAt(chosen)
|
||||
end
|
||||
elsif pokemon == poke2
|
||||
scene.pbDisplay(_INTL("{1} can't be fused with itself!", pokemon.name))
|
||||
return false
|
||||
else
|
||||
scene.pbDisplay(_INTL("{1} can't be fused with {2}.", poke2.name, pokemon.name))
|
||||
return false
|
||||
|
||||
end
|
||||
|
||||
else
|
||||
return false
|
||||
end
|
||||
lev = pokemon.obtain_method == 2 ? pokemon.level * 0.65 : pokemon.level * 0.75
|
||||
end
|
||||
else
|
||||
return true if pbUnfuse(pokemon, scene, supersplicers)
|
||||
|
||||
#unfuse
|
||||
end
|
||||
end
|
||||
|
||||
def pbUnfuse(pokemon, scene, supersplicers, pcPosition = nil)
|
||||
#pcPosition nil : unfusing from party
|
||||
#pcPosition [x,x] : unfusing from pc
|
||||
#
|
||||
|
||||
if (pokemon.obtainMode == 2 || pokemon.ot != $Trainer.name) # && !canunfuse
|
||||
scene.pbDisplay(_INTL("You can't unfuse a Pokémon obtained in a trade!"))
|
||||
return false
|
||||
else
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be unfused?", pokemon.name))
|
||||
if pokemon.species > (NB_POKEMON * NB_POKEMON) + NB_POKEMON #triple fusion
|
||||
scene.pbDisplay(_INTL("{1} cannot be unfused.", pokemon.name))
|
||||
return false
|
||||
elsif $Trainer.party.length >= 6 && !pcPosition
|
||||
scene.pbDisplay(_INTL("Your party is full! You can't unfuse {1}.", pokemon.name))
|
||||
return false
|
||||
else
|
||||
scene.pbDisplay(_INTL("Unfusing ... "))
|
||||
scene.pbDisplay(_INTL(" ... "))
|
||||
scene.pbDisplay(_INTL(" ... "))
|
||||
|
||||
bodyPoke = getBasePokemonID(pokemon.species, true)
|
||||
headPoke = getBasePokemonID(pokemon.species, false)
|
||||
# pf = pokemon.species
|
||||
# p1 = (pf/NB_POKEMON).round
|
||||
# p2 = pf - (NB_POKEMON*p1)
|
||||
|
||||
if pokemon.level > 1
|
||||
if supersplicers
|
||||
lev = pokemon.level * 0.9
|
||||
else
|
||||
lev = pokemon.obtainMode == 2 ? pokemon.level * 0.65 : pokemon.level * 0.75
|
||||
end
|
||||
else
|
||||
lev = 1
|
||||
end
|
||||
poke1 = PokeBattle_Pokemon.new(bodyPoke, lev, $Trainer)
|
||||
poke2 = PokeBattle_Pokemon.new(headPoke, lev, $Trainer)
|
||||
|
||||
if pcPosition == nil
|
||||
box = pcPosition[0]
|
||||
index = pcPosition[1]
|
||||
$PokemonStorage.pbStoreToBox(poke2, box, index)
|
||||
else
|
||||
Kernel.pbAddPokemonSilent(poke2, poke2.level)
|
||||
end
|
||||
#On ajoute l'autre dans le pokedex aussi
|
||||
$Trainer.seen[poke1.species] = true
|
||||
$Trainer.owned[poke1.species] = true
|
||||
$Trainer.seen[poke2.species] = true
|
||||
$Trainer.owned[poke2.species] = true
|
||||
|
||||
pokemon.species = poke1.species
|
||||
pokemon.level = poke1.level
|
||||
pokemon.name = poke1.name
|
||||
pokemon.moves = poke1.moves
|
||||
pokemon.obtainMode = 0
|
||||
poke1.obtainMode = 0
|
||||
|
||||
#scene.pbDisplay(_INTL(p1.to_s + " " + p2.to_s))
|
||||
scene.pbHardRefresh
|
||||
scene.pbDisplay(_INTL("Your Pokémon were successfully unfused! "))
|
||||
return true
|
||||
end
|
||||
end
|
||||
lev = 1
|
||||
end
|
||||
return lev.floor
|
||||
end
|
||||
|
||||
def pbFuse(pokemon, poke2, supersplicers = false)
|
||||
@@ -1159,56 +1216,8 @@ ItemHandlers::UseOnPokemon.add(:DNASPLICERS, proc { |item, pokemon, scene|
|
||||
next false
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:DNAREVERSER, proc { |item, pokemon, scene|
|
||||
if pokemon.species <= CONST_NB_POKE
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
end
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name))
|
||||
body = getBasePokemonID(pokemon.species, true)
|
||||
head = getBasePokemonID(pokemon.species, false)
|
||||
newspecies = (head) * CONST_NB_POKE + body
|
||||
|
||||
#play animation
|
||||
pbFadeOutInWithMusic(99999) {
|
||||
fus = PokemonEvolutionScene.new
|
||||
fus.pbStartScreen(pokemon, newspecies, true)
|
||||
fus.pbEvolution(false, true)
|
||||
fus.pbEndScreen
|
||||
#fus.pbStartScreen(pokemon,newspecies,1)
|
||||
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 })
|
||||
scene.pbRefresh
|
||||
}
|
||||
next true
|
||||
end
|
||||
|
||||
next false
|
||||
})
|
||||
|
||||
ItemHandlers::UseOnPokemon.add(:INFINITEREVERSERS, proc { |item, pokemon, scene|
|
||||
if pokemon.species <= CONST_NB_POKE
|
||||
scene.pbDisplay(_INTL("It won't have any effect."))
|
||||
next false
|
||||
end
|
||||
if Kernel.pbConfirmMessageSerious(_INTL("Should {1} be reversed?", pokemon.name))
|
||||
body = getBasePokemonID(pokemon.species, true)
|
||||
head = getBasePokemonID(pokemon.species, false)
|
||||
newspecies = (head) * CONST_NB_POKE + body
|
||||
|
||||
#play animation
|
||||
pbFadeOutInWithMusic(99999) {
|
||||
fus = PokemonEvolutionScene.new
|
||||
fus.pbStartScreen(pokemon, newspecies, true)
|
||||
fus.pbEvolution(false, true)
|
||||
fus.pbEndScreen
|
||||
scene.pbRefreshAnnotations(proc { |p| pbCheckEvolution(p, item) > 0 })
|
||||
scene.pbRefresh
|
||||
}
|
||||
next true
|
||||
end
|
||||
|
||||
next false
|
||||
})
|
||||
|
||||
def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
playingBGM = $game_system.getPlayingBGM
|
||||
@@ -1297,7 +1306,7 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
bodyPoke = getBasePokemonID(pokemon.species_data.id_number, true)
|
||||
headPoke = getBasePokemonID(pokemon.species_data.id_number, false)
|
||||
|
||||
if (pokemon.obtainMode == 2 || pokemon.ot != $Trainer.name) # && !canunfuse
|
||||
if (pokemon.obtain_method == 2 || pokemon.ot != $Trainer.name) # && !canunfuse
|
||||
scene.pbDisplay(_INTL("You can't unfuse a Pokémon obtained in a trade!"))
|
||||
return false
|
||||
else
|
||||
@@ -1322,21 +1331,23 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
scene.pbDisplay(_INTL(" ... "))
|
||||
scene.pbDisplay(_INTL(" ... "))
|
||||
|
||||
# pf = pokemon.species
|
||||
# p1 = (pf/NB_POKEMON).round
|
||||
# p2 = pf - (NB_POKEMON*p1)
|
||||
|
||||
if pokemon.level > 1
|
||||
if supersplicers
|
||||
lev = pokemon.level * 0.9
|
||||
else
|
||||
lev = pokemon.obtainMode == 2 ? pokemon.level * 0.65 : pokemon.level * 0.80
|
||||
end
|
||||
if pokemon.exp_when_fused_head == nil || pokemon.exp_when_fused_body == nil
|
||||
new_level = calculateUnfuseLevelOldMethod(pokemon, supersplicers)
|
||||
body_level = new_level
|
||||
head_level = new_level
|
||||
poke1 = Pokemon.new(bodyPoke, body_level)
|
||||
poke2 = Pokemon.new(headPoke, head_level)
|
||||
else
|
||||
lev = 1
|
||||
exp_body = pokemon.exp_when_fused_body + pokemon.exp_gained_since_fused
|
||||
exp_head = pokemon.exp_when_fused_head + pokemon.exp_gained_since_fused
|
||||
|
||||
poke1 = Pokemon.new(bodyPoke, pokemon.level)
|
||||
poke2 = Pokemon.new(headPoke, pokemon.level)
|
||||
poke1.exp = exp_body
|
||||
poke2.exp = exp_head
|
||||
end
|
||||
poke1 = PokeBattle_Pokemon.new(bodyPoke, lev, $Trainer)
|
||||
poke2 = PokeBattle_Pokemon.new(headPoke, lev, $Trainer)
|
||||
|
||||
|
||||
if $Trainer.party.length >= 6
|
||||
if (keepInParty == 0)
|
||||
@@ -1354,15 +1365,15 @@ def pbDNASplicing(pokemon, scene, supersplicers = false, superSplicer = false)
|
||||
end
|
||||
|
||||
#On ajoute l'autre dans le pokedex aussi
|
||||
$Trainer.seen[poke1.species] = true
|
||||
$Trainer.owned[poke1.species] = true
|
||||
$Trainer.pokedex.set_seen(poke1.species)
|
||||
$Trainer.pokedex.set_owned(poke1.species)
|
||||
|
||||
pokemon.species = poke1.species
|
||||
pokemon.level = poke1.level
|
||||
pokemon.name = poke1.name
|
||||
pokemon.moves = poke1.moves
|
||||
pokemon.obtainMode = 0
|
||||
poke1.obtainMode = 0
|
||||
pokemon.obtain_method = 0
|
||||
poke1.obtain_method = 0
|
||||
|
||||
#scene.pbDisplay(_INTL(p1.to_s + " " + p2.to_s))
|
||||
scene.pbHardRefresh
|
||||
|
||||
@@ -525,7 +525,7 @@ class PokemonFusionScene
|
||||
@pokemon2 = pokemon2
|
||||
|
||||
@newspecies = newspecies
|
||||
addBackgroundOrColoredPlane(@sprites, "background", "evolutionbg",
|
||||
addBackgroundOrColoredPlane(@sprites, "background", "DNAbg",
|
||||
Color.new(248, 248, 248), @viewport)
|
||||
|
||||
poke1_number = GameData::Species.get(@pokemon1.species).id_number
|
||||
@@ -682,6 +682,11 @@ class PokemonFusionScene
|
||||
Kernel.pbMessageDisplay(@sprites["msgwindow"],
|
||||
_INTL("\\se[]Congratulations! Your Pokémon were fused into {2}!\\wt[80]", @pokemon1.name, newspeciesname))
|
||||
|
||||
#exp
|
||||
@pokemon1.exp_when_fused_head = @pokemon2.exp #peut-être l'inverse
|
||||
@pokemon1.exp_when_fused_body = @pokemon1.exp #peut-être l'inverse
|
||||
@pokemon1.exp_gained_since_fused=0
|
||||
|
||||
averageFusionIvs()
|
||||
#add to pokedex
|
||||
if !$Trainer.pokedex.owned?(newSpecies)
|
||||
|
||||
@@ -198,7 +198,9 @@ def pbCompletedQuest?(id)
|
||||
end
|
||||
|
||||
def pbQuestlog
|
||||
Questlog.new
|
||||
pbMessage(_INTL("The quest log has been temporarily removed from the game and is planned to be added back in a future update"))
|
||||
return
|
||||
#Questlog.new
|
||||
end
|
||||
|
||||
def pbAddQuest(id)
|
||||
|
||||
1129
Data/Scripts/050_AddOns/Wondertrade.rb
Normal file
1129
Data/Scripts/050_AddOns/Wondertrade.rb
Normal file
File diff suppressed because it is too large
Load Diff
Reference in New Issue
Block a user