-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathcrawli-moveinfo.rb
More file actions
1813 lines (1747 loc) · 85.7 KB
/
crawli-moveinfo.rb
File metadata and controls
1813 lines (1747 loc) · 85.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
# A modified version of MoveHelpDisplayBBUI, for blindstep
# Based on https://eeveeexpo.com/threads/7796/
module CrawliMoveHelpDisplay
FLAG_NAMES = {
pulsemove: "Aura or Pulse Move",
bitemove: "Biting Move",
bulletmove: "Ball or Bomb Move",
bypassprotect: "Bypasses Protect",
contact: "Contact Move",
dancemove: "Dance Move",
defrost: "Thaws User",
healingmove: "Healing Move",
highcrit: "High Critical Hit Chance",
nocopy: "Cannot Be Copied",
punchmove: "Punching Move",
sharpmove: "Slicing Move",
stabmove: "Stabbing Move",
soundmove: "Sound Move",
tramplemove: "Tramples Minimize",
windmove: "Wind Move",
intercept: "Interceptor's Z Move",
zmove: "Z Move"
}
FLAGS_TO_CHECK = [
[:pulsemove, [:AURASPHERE,:DRAGONPULSE,:DARKPULSE,:WATERPULSE,:ORIGINPULSE,:TERRAINPULSE]],
[:bitemove, PBStuff::BITEMOVE],
[:bulletmove, PBStuff::BULLETMOVE],
[:bypassprotect, PBStuff::PROTECTIGNORINGMOVE],
:contact,
[:dancemove, PBStuff::DANCEMOVE],
[:defrost, PBStuff::UNFREEZEMOVE],
[:healingmove, [], PBStuff::HEALFUNCTIONS],
:highcrit,
[:nocopy, PBStuff::NOCOPYMOVE],
:punchmove, :sharpmove,
[:stabmove, PBStuff::STABBINGMOVE],
:soundmove,
[:tramplemove, [:BODYSLAM, :FLYINGPRESS, :MALICIOUSMOONSAULT], [0x10, 0x137, 0x9B]],
:windmove, :intercept, :zmove]
USES_SMART_DAMAGE_CATEGORY = [0x309, 0x20D, 0x80A, 0x80B] # Shell Side Arm, Super UMD Move, Unleashed Power, Blinding Speed
# Copied from pbZStatus in PokeBattle_Battler
Z_STATUS_TYPES = pbHashForwardizer({
[PBStats::ATTACK,1] => [:BULKUP,:HONECLAWS,:HOWL,:LASERFOCUS,:LEER,:MEDITATE,:ODORSLEUTH,:POWERTRICK,:ROTOTILLER,:SCREECH,:SHARPEN,
:TAILWHIP, :TAUNT,:TOPSYTURVY,:WILLOWISP,:WORKUP,:COACHING,:POWERSHIFT,:DESERTSMARK],
[PBStats::ATTACK,2] => [:MIRRORMOVE,:OCTOLOCK],
[PBStats::ATTACK,3] => [:SPLASH],
[PBStats::DEFENSE,1] => [:AQUARING,:BABYDOLLEYES,:BANEFULBUNKER,:BLOCK,:CHARM,:DEFENDORDER,:FAIRYLOCK,:FEATHERDANCE,
:FLOWERSHIELD,:GRASSYTERRAIN,:GROWL,:HARDEN,:MATBLOCK,:NOBLEROAR,:PAINSPLIT,:PLAYNICE,:POISONGAS,
:POISONPOWDER,:QUICKGUARD,:REFLECT,:ROAR,:SPIDERWEB,:SPIKES,:SPIKYSHIELD,:STEALTHROCK,:STRENGTHSAP,
:TEARFULLOOK,:TICKLE,:TORMENT,:TOXIC,:TOXICSPIKES,:VENOMDRENCH,:WIDEGUARD,:WITHDRAW,:ARENITEWALL],
[PBStats::SPATK,1] => [:CONFUSERAY,:ELECTRIFY,:EMBARGO,:FAKETEARS,:GEARUP,:GRAVITY,:GROWTH,:INSTRUCT,:IONDELUGE,
:METALSOUND,:MINDREADER,:MIRACLEEYE,:NIGHTMARE,:PSYCHICTERRAIN,:REFLECTTYPE,:SIMPLEBEAM,:SOAK,:SWEETKISS,
:TEETERDANCE,:TELEKINESIS,:MAGICPOWDER],
[PBStats::SPATK,2] => [:HEALBLOCK,:PSYCHOSHIFT,:TARSHOT],
[PBStats::SPATK,3] => [],
[PBStats::SPDEF,1] => [:CHARGE,:CONFIDE,:COSMICPOWER,:CRAFTYSHIELD,:EERIEIMPULSE,:ENTRAINMENT,:FLATTER,:GLARE,:INGRAIN,
:LIGHTSCREEN,:MAGICROOM,:MAGNETICFLUX,:MEANLOOK,:MISTYTERRAIN,:MUDSPORT,:SPOTLIGHT,:STUNSPORE,:THUNDERWAVE,
:WATERSPORT,:WHIRLWIND,:WISH,:WONDERROOM,:CORROSIVEGAS,:SHELTER],
[PBStats::SPDEF,2] => [:AROMATICMIST,:CAPTIVATE,:IMPRISON,:MAGICCOAT,:POWDER],
[PBStats::SPEED,1] => [:AFTERYOU,:AURORAVEIL,:ELECTRICTERRAIN,:ENCORE,:GASTROACID,:GRASSWHISTLE,:GUARDSPLIT,:GUARDSWAP,
:HAIL,:HYPNOSIS,:LOCKON,:LOVELYKISS,:POWERSPLIT,:POWERSWAP,:QUASH,:RAINDANCE,:ROLEPLAY,:SAFEGUARD,
:SANDSTORM,:SCARYFACE,:SING,:SKILLSWAP,:SLEEPPOWDER,:SPEEDSWAP,:STICKYWEB,:STRINGSHOT,:SUNNYDAY,
:SUPERSONIC,:TOXICTHREAD,:WORRYSEED,:YAWN],
[PBStats::SPEED,2] => [:ALLYSWITCH,:BESTOW,:MEFIRST,:RECYCLE,:SNATCH,:SWITCHEROO,:TRICK],
[PBStats::ACCURACY,1] => [:COPYCAT,:DEFENSECURL,:DEFOG,:FOCUSENERGY,:MIMIC,:SWEETSCENT,:TRICKROOM],
[PBStats::EVASION,1] => [:CAMOUFLAGE,:DETECT,:FLASH,:KINESIS,:LUCKYCHANT,:MAGNETRISE,:SANDATTACK,:SMOKESCREEN],
[:allstat1] => [:CONVERSION,:FORESTSCURSE,:GEOMANCY,:PURIFY,:SKETCH,:TRICKORTREAT,:CELEBRATE,:TEATIME,:STUFFCHEEKS, :HAPPYHOUR],
[:crit1] => [:ACUPRESSURE,:FORESIGHT,:HEARTSWAP,:SLEEPTALK,:TAILWIND],
[:reset] => [:ACIDARMOR,:AGILITY,:AMNESIA,:ATTRACT,:AUTOTOMIZE,:BARRIER,:BATONPASS,:CALMMIND,:COIL,:COTTONGUARD,
:COTTONSPORE,:DARKVOID,:DISABLE,:DOUBLETEAM,:DRAGONDANCE,:ENDURE,:FLORALHEALING,:FOLLOWME,:HEALORDER,
:HEALPULSE,:HELPINGHAND,:IRONDEFENSE,:KINGSSHIELD,:LEECHSEED,:MILKDRINK,:MINIMIZE,:MOONLIGHT,:MORNINGSUN,
:NASTYPLOT,:PERISHSONG,:PROTECT,:QUIVERDANCE,:RAGEPOWDER,:RECOVER,:REST,:ROCKPOLISH,:ROOST,:SHELLSMASH,
:SHIFTGEAR,:SHOREUP,:SHELLSMASH,:SHIFTGEAR,:SHOREUP,:SLACKOFF,:SOFTBOILED,:SPORE,:SUBSTITUTE,:SWAGGER,
:SWALLOW,:SWORDSDANCE,:SYNTHESIS,:TAILGLOW,:CLANGOROUSSOUL,:NORETREAT,:OBSTRUCT,:COURTCHANGE,:JUNGLEHEALING,
:VICTORYDANCE,:AQUABATICS],
[:heal] => [:AROMATHERAPY,:BELLYDRUM,:CONVERSION2,:HAZE,:HEALBELL,:MIST,:PSYCHUP,:REFRESH,:SPITE,:STOCKPILE,
:TELEPORT,:TRANSFORM,:DECORATE,:LIFEDEW,:LUNARBLESSING],
[:heal2] => [:MEMENTO,:PARTINGSHOT],
[:centre] => [:DESTINYBOND,:GRUDGE],
})
Z_STATUS_TYPES.default = []
MOVES_WHICH_CALL_MOVES = [:MEFIRST, :METRONOME, :NATUREPOWER, :ASSIST, :SLEEPTALK, :MIRRORMOVE, :COPYCAT]
# Copied from pbGetStatName PokeBattle_Battler
def self.pbGetStatName(stat)
return ["HP","Attack", "Defense", "Sp. Attack", "Sp. Defense", "Speed", "Accuracy", "Evasion"][stat]
end
def self.getZText(attacker, move)
z_effect = Z_STATUS_TYPES[move]
if move == :CURSE
if attacker.hasType?(:GHOST) || attacker.ability == :PROTEAN || attacker.ability == :LIBERO
z_effect = [:heal]
else
z_effect = [PBStats::ATTACK,1]
end
end
if z_effect.length == 2
stat, num = *z_effect
num = 0 if num < 0
statname = pbGetStatName(stat)
case num
when 0 then desc = "Z-Power effect: Doesn't raise #{statname}." # Shouldn't be possible but let's handle this case
when 1 then desc = "Z-Power effect: Raises #{statname} by one stage."
when 2 then desc = "Z-Power effect: Raises #{statname} by two stages."
when 3 then desc = "Z-Power effect: Raises #{statname} by three stages."
when 4 then desc = "Z-Power effect: Raises #{statname} by four stages."
when 5 then desc = "Z-Power effect: Raises #{statname} by five stages."
else desc = "Z-Power effect: Maximizes #{statname}."
end
else
case z_effect[0]
when :allstat1
if (attacker.battle.FE == :CITY && [:CONVERSION,:HAPPYHOUR,:CELEBRATE].include?(move)) || (attacker.battle.FE == :BACKALLEY && move == :CONVERSION)
desc = "Z-Power effect: Raises all stats by two stages."
else
desc = "Z-Power effect: Raises all stats by one stage."
end
when :crit1 then desc = "Z-Power effect: Raises the user's Critical Hit rate."
when :reset then desc = "Z-Power effect: Resets the user's lowered stats."
when :heal then desc = "Z-Power effect: Fully restores the user's HP."
when :heal2 then desc = "Z-Power effect: Fully restores the HP of the Pokémon that switches in."
when :centre then desc = "Z-Power effect: The user becomes the center of attention."
else desc = "Z-Power effect: "
end
end
if MOVES_WHICH_CALL_MOVES.include?(move)
if desc.end_with?(".")
desc = desc.chomp(".") + ", then calls a Z-Move."
else
desc += "Calls a Z-Move."
end
end
if desc.end_with?(": ")
desc += "None."
end
return desc
end
def pbPokemonString(pkmn)
if pkmn.is_a?(PokeBattle_Battler) && !pkmn.pokemon
return ""
end
info = []
info.push pkmn.name
info.push "Level #{pkmn.level}"
if pkmn.hp <= 0
info.push " Status: Fainted"
else
case pkmn.status
when :SLEEP
info.push " Status: Asleep"
when :FROZEN
info.push " Status: Frozen"
when :BURN
info.push " Status: Burned"
when :PARALYSIS
info.push " Status: Paralyzed"
when :POISON
info.push " Status: Poisoned"
end
end
info.push(pkmn.hp == pkmn.totalhp ? "Full Health" : "HP: #{pkmn.hp} out of #{pkmn.totalhp}") if pkmn.hp > 0
if pkmn.type2.nil?
info.push "Type: #{getTypeName(pkmn.type1)}"
else
info.push "Type: #{getTypeName(pkmn.type1)} / #{getTypeName(pkmn.type2)}"
end
info.push "Ability: #{getAbilityName(pkmn.ability)}"
info.push "Item: #{pkmn.item ? getItemName(pkmn.item) : "None"}"
info.push "Gender: #{["Male", "Female"][pkmn.gender]}" if pkmn.gender < 2
return info.join(", ")
end
def self.moveTTS(battler, move)
naturepower = false
if move.move == :NATUREPOWER
naturepower = true
tts(move.getMoveUseName)
move = PokeBattle_Move.pbFromPBMove(battler.battle, PBMove.new(battler.battle.field.naturePower), battler)
if cw.zButton == 2 && !battler.zmoves.nil? && !battler.zmoves[cw.index].nil?
if move.basedamage > 0
move = PokeBattle_Move.pbFromPBMove(battler.battle, PBMove.new(PBStuff::CRYSTALTOZMOVE[PBStuff::TYPETOZCRYSTAL[move.type]]), battler, move)
else
move = PokeBattle_Move.pbFromPBMove(battler.battle, PBMove.new(move.move), battler, move)
end
end
end
basePower = trueBasePower = move.basedamage
basePower = [battler.happiness,250].min if battler.crested == :LUVDISC && basePower != 0
if basePower != 0 && battler.crested == :CINCCINO && !move.pbIsMultiHit
basePower *= 0.3
end
knownFoe = nil
if battler.battle.doublebattle
knownFoe = battler.pbOpposing2 if battler.pbOpposing1.isFainted?
knownFoe = battler.pbOpposing1 if battler.pbOpposing2.isFainted?
else
knownFoe = battler.pbOpposing1
knownFoe = battler.pbOpposing2 if knownFoe.isFainted? && !battler.pbOpposing2.isFainted?
end
if !knownFoe # Make fake target
knownFoe = PokeBattle_Battler.new(battler.battle,1,true)
fakemon = PokeBattle_Pokemon.new(:RHYDON,battler.level,$Trainer,false)
knownFoe.pbInitPokemon(fakemon, 1)
knownFoe.type1 = :QMARKS
knownFoe.type2 = nil
end
if knownFoe.effects[:Illusion] && @battle.pbIsOpposing?(knownFoe.index)
fakeFoe = PokeBattle_Battler.new(battler.battle,knownFoe.index,true)
fakeFoe.pbInitPokemon(knownFoe.effects[:Illusion], knownFoe.index)
knownFoe = fakeFoe
end
crawli_betterBattleUI_withForm(battler) do
battler.turncount += 1
basePower, power = move.crawli_movehelpdisplay_calcPower(battler, knownFoe)
if move.function == 0x91 && battler.effects[:FuryCutter] < 4 # Fury Cutter
basePower *= 2
power *= 2
end
category = move.betterCategory
if CrawliMoveHelpDisplay::USES_SMART_DAMAGE_CATEGORY.include?(move.function) # Moves which basically choose category but don't pretend to
if knownFoe.nil?
category = PokeBattle_Move.pbFromPBMove(battler.battle, PBMove.new(:PHOTONGEYSER), battler).betterCategory
else
tempMove = PokeBattle_Move.pbFromPBMove(battler.battle, PBMove.new(:UNLEASHEDPOWER), battler)
tempMove.smartDamageCategory(battler, knownFoe)
category = tempMove.betterCategory
end
end
type = move.pbType(battler)
secondtype = move.getSecondaryType(battler)
cattype = _INTL("Status")
case category
when :physical then cattype = _INTL("Physical")
when :special then cattype = _INTL("Special")
end
#---------------------------------------------------------------------------
# Final move attribute calculations.
acc = move.crawli_movehelpdisplay_calcAccuracy(battler, knownFoe)
pri = move.priorityCheck(battler)
battler.turncount -= 1
baseChance = move.effect
chance = move.crawli_movehelpdisplay_effectMod(battler)
textPos = []
displayPower = (power == 0 && basePower == 0) ? "-" : (power == 1) ? "Variable" : power.ceil.to_s
displayAccuracy = (acc <= 0) ? "Infinite" : acc.ceil.to_s
displayPriority = (pri == 0) ? "-" : (pri > 0) ? "+" + pri.to_s : pri.to_s
displayChance = (baseChance == 0 || chance == 100) ? "-" : chance.ceil.to_s
tts(move.getMoveUseName)
if secondtype.nil?
tts(_INTL("{1}-Type {2} Move", type, cattype))
else
tts(_INTL("{1}/{2}-Type {3} Move", type, secondtype.join("/"), cattype))
end
flags = move.crawli_movehelpdisplay_getEffectFlags
unless flags.empty?
tts("Move Flags:")
for flag in flags
tts(CrawliMoveHelpDisplay::FLAG_NAMES[flag])
end
end
tts(_INTL("Base Power: {1}, Effective Power: {2}", trueBasePower, displayPower)) if move.category != :status
tts(_INTL("Accuracy: {1}%", displayAccuracy)) if move.category != :status || (acc > 0 && acc != 100)
tts(_INTL("Priority: {1}", displayPriority)) if pri != 0
if baseChance != 0 && chance == 0
tts(_INTL("Effect Chance: Suppressed"))
elsif chance != 100 && chance != 0
tts(_INTL("Effect Chance: {1}%", displayChance))
end
tts(move.desc.gsub(/—/, '-').strip)
if move.zmove && move.category == :status && !$cache.moves[move.move].checkFlag?(:zmove)
if !naturepower
tts(_INTL(CrawliMoveHelpDisplay.getZText(battler, move.move)))
elsif CrawliMoveHelpDisplay::MOVES_WHICH_CALL_MOVES.include?(move.move)
tts(_INTL("Z-Power effect: Calls a Z-Move."))
end
end
end
end
end
def crawli_betterBattleUI_withForm(attacker)
if !attacker.isMega? && attacker.hasMega?
side=(attacker.battle.pbIsOpposing?(attacker.index)) ? 1 : 0
owner=attacker.battle.pbGetOwnerIndex(attacker.index)
if attacker.battle.megaEvolution[side][owner] == attacker.index
attacker.pokemon.makeMega
prevAbility = attacker.ability
prevType1 = attacker.type1
prevType2 = attacker.type2
attacker.ability = attacker.pokemon.ability
attacker.type1 = attacker.pokemon.type1
attacker.type2 = attacker.pokemon.type2
ret = yield
attacker.pokemon.makeUnmega
attacker.ability = prevAbility
attacker.type1 = prevType1
attacker.type2 = prevType2
return ret
end
elsif !attacker.isUltra? && attacker.hasUltra?
side=(attacker.battle.pbIsOpposing?(attacker.index)) ? 1 : 0
owner=attacker.battle.pbGetOwnerIndex(attacker.index)
if attacker.battle.ultraBurst[side][owner] == attacker.index
attacker.pokemon.makeMega
prevAbility = attacker.ability
prevType1 = attacker.type1
prevType2 = attacker.type2
attacker.ability = attacker.pokemon.ability
attacker.type1 = attacker.pokemon.type1
attacker.type2 = attacker.pokemon.type2
ret = yield
attacker.pokemon.makeUnmega
attacker.ability = prevAbility
attacker.type1 = prevType1
attacker.type2 = prevType2
return ret
end
end
return yield
end
class PokeBattle_Move
def crawli_movehelpdisplay_typeMod(type,attacker,opponent)
secondtype = getSecondaryType(attacker)
if opponent.ability == :SAPSIPPER && !(opponent.moldbroken) && (type == :GRASS || (!secondtype.nil? && secondtype.include?(:GRASS)))
### MODDED/ No actual effects
# if opponent.pbCanIncreaseStatStage?(PBStats::ATTACK)
# opponent.pbIncreaseStatBasic(PBStats::ATTACK,1)
# @battle.pbCommonAnimation("StatUp",opponent,nil)
# @battle.pbDisplay(_INTL("{1}'s {2} raised its Attack!",
# opponent.pbThis,getAbilityName(opponent.ability)))
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
# opponent.pbThis,getAbilityName(opponent.ability),self.name))
# end
### /MODDED
return 0
end
if ((opponent.ability == :STORMDRAIN && (type == :WATER || (!secondtype.nil? && secondtype.include?(:WATER)))) ||
(opponent.ability == :LIGHTNINGROD && (type == :ELECTRIC || (!secondtype.nil? && secondtype.include?(:ELECTRIC))))) && !(opponent.moldbroken)
### MODDED/ No actual effects
# if opponent.pbCanIncreaseStatStage?(PBStats::SPATK)
# if (Rejuv && @battle.FE == :SHORTCIRCUIT) && opponent.ability == :LIGHTNINGROD
# damageroll = @battle.field.getRoll(maximize_roll: (@battle.state.effects[:ELECTERRAIN] > 0))
# statboosts = [1,2,0,1,3]
# arrStatTexts=[_INTL("{1}'s {2} raised its Special Attack!",opponent.pbThis,getAbilityName(opponent.ability)), _INTL("{1}'s {2} sharply raised its Special Attack!",opponent.pbThis,getAbilityName(opponent.ability)),
# _INTL("{1}'s {2} drastically raised its Special Attack!",opponent.pbThis,getAbilityName(opponent.ability))]
# statboost = statboosts[PBStuff::SHORTCIRCUITROLLS.find_index(damageroll)]
# if statboost != 0
# opponent.pbIncreaseStatBasic(PBStats::SPATK,statboost)
# @battle.pbCommonAnimation("StatUp",opponent,nil)
# @battle.pbDisplay(arrStatTexts[statboost-1])
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
# opponent.pbThis,getAbilityName(opponent.ability),self.name))
# end
# else
# opponent.pbIncreaseStatBasic(PBStats::SPATK,1)
# @battle.pbCommonAnimation("StatUp",opponent,nil)
# @battle.pbDisplay(_INTL("{1}'s {2} raised its Special Attack!",
# opponent.pbThis,getAbilityName(opponent.ability)))
# end
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
# opponent.pbThis,getAbilityName(opponent.ability),self.name))
# end
# if @function==0xCB #Dive
# @battle.scene.pbUnVanishSprite(attacker)
# end
### /MODDED
return 0
end
if ((opponent.ability == :MOTORDRIVE && !opponent.moldbroken) ||
(Rejuv && @battle.FE == :GLITCH && opponent.species == :GENESECT && opponent.hasWorkingItem(:SHOCKDRIVE))) &&
(type == :ELECTRIC || (!secondtype.nil? && secondtype.include?(:ELECTRIC)))
### MODDED/ No actual effects
# negator = getAbilityName(opponent.ability)
# negator = getItemName(opponent.item) if (Rejuv && @battle.FE == :GLITCH && opponent.species == :GENESECT && opponent.hasWorkingItem(:SHOCKDRIVE))
# if opponent.pbCanIncreaseStatStage?(PBStats::SPEED)
# if (!Rejuv && @battle.FE == :SHORTCIRCUIT) || (Rejuv && @battle.FE == :FACTORY)
# opponent.pbIncreaseStatBasic(PBStats::SPEED,2)
# @battle.pbCommonAnimation("StatUp",opponent,nil)
# @battle.pbDisplay(_INTL("{1}'s {2} sharply raised its Speed!",
# opponent.pbThis,negator))
# elsif (Rejuv && @battle.FE == :SHORTCIRCUIT)
# damageroll = @battle.field.getRoll(maximize_roll: (@battle.state.effects[:ELECTERRAIN] > 0))
# statboosts = [1,2,0,1,3]
# arrStatTexts=[_INTL("{1}'s {2} raised its Speed!",opponent.pbThis,negator), _INTL("{1}'s {2} sharply raised its Speed!",opponent.pbThis,negator),
# _INTL("{1}'s {2} drastically raised its Speed!",opponent.pbThis,negator)]
# statboost = statboosts[PBStuff::SHORTCIRCUITROLLS.find_index(damageroll)]
# if statboost != 0
# opponent.pbIncreaseStatBasic(PBStats::SPEED,statboost)
# @battle.pbCommonAnimation("StatUp",opponent,nil)
# @battle.pbDisplay(arrStatTexts[statboost-1])
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
# opponent.pbThis,negator,self.name))
# end
# else
# opponent.pbIncreaseStatBasic(PBStats::SPEED,1)
# @battle.pbCommonAnimation("StatUp",opponent,nil)
# @battle.pbDisplay(_INTL("{1}'s {2} raised its Speed!",
# opponent.pbThis,negator))
# end
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
# opponent.pbThis,negator,self.name))
# end
### /MODDED
return 0
end
if ((opponent.ability == :DRYSKIN && !(opponent.moldbroken)) && (type == :WATER || (!secondtype.nil? && secondtype.include?(:WATER)))) ||
(opponent.ability == :VOLTABSORB && !(opponent.moldbroken) && (type == :ELECTRIC || (!secondtype.nil? && secondtype.include?(:ELECTRIC)))) ||
(opponent.ability == :WATERABSORB && !(opponent.moldbroken) && (type == :WATER || (!secondtype.nil? && secondtype.include?(:WATER)))) ||
((Rejuv && @battle.FE == :GLITCH && opponent.species == :GENESECT && opponent.hasWorkingItem(:DOUSEDRIVE)) && (type == :WATER || (!secondtype.nil? && secondtype.include?(:WATER)))) ||
((Rejuv && @battle.FE == :GLITCH && opponent.species == :GENESECT && opponent.hasWorkingItem(:CHILLDRIVE)) && (type == :ICE || (!secondtype.nil? && secondtype.include?(:ICE)))) ||
((Rejuv && @battle.FE == :DESERT) && (opponent.hasType?(:GRASS) || opponent.hasType?(:WATER)) && @battle.pbWeather == :SUNNYDAY && (type == :WATER || (!secondtype.nil? && secondtype.include?(:WATER))))
if opponent.effects[:HealBlock]==0
### MODDED/ No actual effects
# negator = getAbilityName(opponent.ability)
# if ![:WATERABSORB,:VOLTABSORB,:DRYSKIN].include?(opponent.ability)
# negator = getItemName(opponent.item) if (Rejuv && @battle.FE == :GLITCH && opponent.species == :GENESECT && (opponent.item == :DOUSEDRIVE || opponent.item == :CHILLDRIVE))
# negator = "unquenchable thirst" if (Rejuv && @battle.FE == :DESERT) && (opponent.hasType?(:GRASS) || opponent.hasType?(:WATER)) && @battle.pbWeather == :SUNNYDAY
# end
# if (Rejuv && @battle.FE == :SHORTCIRCUIT) && opponent.ability == :VOLTABSORB
# damageroll = @battle.field.getRoll(maximize_roll: (@battle.state.effects[:ELECTERRAIN] > 0))
# if opponent.pbRecoverHP(((opponent.totalhp/4.0)*damageroll).floor,true)>0
# @battle.pbDisplay(_INTL("{1}'s {2} restored its HP!",
# opponent.pbThis,negator))
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} useless!",
# opponent.pbThis,negator,@name))
# end
# elsif opponent.pbRecoverHP((opponent.totalhp/4.0).floor,true)>0
# @battle.pbDisplay(_INTL("{1}'s {2} restored its HP!",
# opponent.pbThis,negator))
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} useless!",
# opponent.pbThis,negator,@name))
# end
# if @function==0xCB #Dive
# @battle.scene.pbUnVanishSprite(attacker)
# end
### /MODDED
return 0
end
end
# Immunity Crests
case opponent.crested
when :SKUNTANK
if (type == :GROUND || (!secondtype.nil? && secondtype.include?(:GROUND)))
### MODDED/ No actual effects
# if opponent.pbCanIncreaseStatStage?(PBStats::ATTACK)
# opponent.pbIncreaseStatBasic(PBStats::ATTACK,1)
# @battle.pbCommonAnimation("StatUp",opponent,nil)
# @battle.pbDisplay(_INTL("{1}'s {2} raised its Attack!",
# opponent.pbThis,getItemName(opponent.item)))
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
# opponent.pbThis,getItemName(opponent.item),self.name))
# end
### /MODDED
return 0
end
when :DRUDDIGON
if (type == :FIRE || (!secondtype.nil? && secondtype.include?(:FIRE)))
if opponent.effects[:HealBlock]==0
### MODDED/ No actual effects
# if opponent.pbRecoverHP((opponent.totalhp/4.0).floor,true)>0
# @battle.pbDisplay(_INTL("{1}'s {2} restored its HP!",
# opponent.pbThis,getItemName(opponent.item)))
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} useless!",
# opponent.pbThis,getItemName(opponent.item),@name))
# end
### /MODDED
return 0
end
end
when :WHISCASH
if (type == :GRASS || (!secondtype.nil? && secondtype.include?(:GRASS)))
### MODDED/ No actual effects
# if opponent.pbCanIncreaseStatStage?(PBStats::ATTACK)
# opponent.pbIncreaseStatBasic(PBStats::ATTACK,1)
# @battle.pbCommonAnimation("StatUp",opponent,nil)
# @battle.pbDisplay(_INTL("{1}'s {2} raised its Attack!",
# opponent.pbThis,getItemName(opponent.item)))
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
# opponent.pbThis,getItemName(opponent.item),self.name))
# end
### /MODDED
return 0
end
end
if (opponent.ability == :BULLETPROOF) && !(opponent.moldbroken)
if (PBStuff::BULLETMOVE).include?(@move)
### MODDED/ No actual effects
# @battle.pbDisplay(_INTL("{1}'s {2} blocked the attack!",
# opponent.pbThis,getAbilityName(opponent.ability),self.name))
### /MODDED
return 0
end
end
if @battle.FE == :ROCKY && (opponent.effects[:Substitute]>0 || opponent.stages[PBStats::DEFENSE] > 0)
if (PBStuff::BULLETMOVE).include?(@move)
### MODDED/ No actual effects
# @battle.pbDisplay(_INTL("{1} hid behind a rock to dodge the attack!",
# opponent.pbThis,getAbilityName(opponent.ability),self.name))
### /MODDED
return 0
end
end
if ((opponent.ability == :FLASHFIRE && !opponent.moldbroken) ||
(Rejuv && @battle.FE == :GLITCH && opponent.species == :GENESECT && opponent.hasWorkingItem(:BURNDRIVE))) &&
(type == :FIRE || (!secondtype.nil? && secondtype.include?(:FIRE))) && @battle.FE != :FROZENDIMENSION
### MODDED/ No actual effects
# negator = getAbilityName(opponent.ability)
# negator = getItemName(opponent.item) if (Rejuv && @battle.FE == :GLITCH && opponent.species == :GENESECT && opponent.hasWorkingItem(:BURNDRIVE))
# if !opponent.effects[:FlashFire]
# opponent.effects[:FlashFire]=true
# @battle.pbDisplay(_INTL("{1}'s {2} activated!",
# opponent.pbThis,negator))
# else
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
# opponent.pbThis,negator,self.name))
# end
### /MODDED
return 0
end
if opponent.ability == :MAGMAARMOR && (type == :FIRE || (!secondtype.nil? && secondtype.include?(:FIRE))) &&
(@battle.FE == :DRAGONSDEN || @battle.FE == :VOLCANICTOP || @battle.FE == :INFERNAL) && !(opponent.moldbroken)
### MODDED/ No actual effects
# @battle.pbDisplay(_INTL("{1}'s {2} made {3} ineffective!",
# opponent.pbThis,getAbilityName(opponent.ability),self.name))
### /MODDED
return 0
end
#Telepathy
if ((opponent.ability == :TELEPATHY && !opponent.moldbroken) || @battle.FE == :HOLY) && @basedamage>0
if opponent.index == attacker.pbPartner.index
### MODDED/ No actual effects
# @battle.pbDisplay(_INTL("{1} avoids attacks by its ally Pokémon!",opponent.pbThis))
### /MODDED
return 0
end
end
# UPDATE Implementing Flying Press + Freeze Dry
typemod=pbTypeModifier(type,attacker,opponent)
typemod2= nil
typemod3= nil
if type == :FIRE && opponent.effects[:TarShot]
typemod*=2
end
# Resistance-changing Crests
if opponent.crested
case opponent.species
when :LUXRAY
typemod /= 2 if (type == :GHOST || type == :DARK)
typemod = 0 if type == :PSYCHIC
when :SAMUROTT
typemod /= 2 if (type == :BUG || type == :DARK || type == :ROCK)
when :LEAFEON
typemod /= 4 if (type == :FIRE || type == :FLYING)
when :GLACEON
typemod /= 4 if (type == :ROCK || type == :FIGHTING)
when :SIMISEAR
typemod /= 2 if [:STEEL, :FIRE,:ICE].include?(type)
typemod /= 2 if type == :WATER && @battle.FE != :UNDERWATER
when :SIMIPOUR
typemod /= 2 if [:GROUND,:WATER,:GRASS,:ELECTRIC].include?(type)
when :SIMISAGE
typemod /= 2 if [:BUG,:STEEL,:FIRE,:GRASS,:FAIRY].include?(type)
typemod /= 2 if type == :ICE && @battle.FE != :GLITCH
when :TORTERRA
if !($game_switches[:Inversemode] ^ (@battle.FE == :INVERSE))
typemod = 16 / typemod if typemod != 0
end
end
end
typemod *= 4 if @move == :FREEZEDRY && opponent.hasType?(:WATER)
if @move == :CUT && opponent.hasType?(:GRASS) && ((!Rejuv && @battle.FE == :FOREST) || @battle.ProgressiveFieldCheck(PBFields::FLOWERGARDEN,2,5))
typemod *= 2
end
if @move == :FLYINGPRESS
if @battle.FE == :SKY
if ((PBTypes.oneTypeEff(:FLYING, opponent.type1) > 2) || (PBTypes.oneTypeEff(:FLYING, opponent.type1) < 2 && $game_switches[:Inversemode]))
typemod*=2
end
if ((PBTypes.oneTypeEff(:FLYING, opponent.type2) > 2) || (PBTypes.oneTypeEff(:FLYING, opponent.type2) < 2 && $game_switches[:Inversemode]))
typemod*=2
end
else
typemod2=pbTypeModifier(:FLYING,attacker,opponent)
typemod3= ((typemod*typemod2)/4)
typemod=typemod3
end
end
# Field Effect second type changes
typemod=fieldTypeChange(attacker,opponent,typemod,false)
typemod=overlayTypeChange(attacker,opponent,typemod,false)
# Cutting typemod in half
if @battle.pbWeather==:STRONGWINDS && (opponent.hasType?(:FLYING) && !opponent.effects[:Roost]) &&
((PBTypes.oneTypeEff(type, :FLYING) > 2) || (PBTypes.oneTypeEff(type, :FLYING) < 2 && ($game_switches[:Inversemode] || (@battle.FE == :INVERSE))))
typemod /= 2
end
if @battle.FE == :SNOWYMOUNTAIN && opponent.ability == :ICESCALES && opponent.hasType?(:ICE) && !(opponent.moldbroken) &&
((PBTypes.oneTypeEff(type, :ICE) > 2) || (PBTypes.oneTypeEff(type, :ICE) < 2 && ($game_switches[:Inversemode] || (@battle.FE == :INVERSE))))
typemod /= 2
end
if @battle.FE == :DRAGONSDEN && opponent.ability == :MULTISCALE && opponent.hasType?(:DRAGON) && !(opponent.moldbroken) &&
((PBTypes.oneTypeEff(type, :DRAGON) > 2) || (PBTypes.oneTypeEff(type, :DRAGON) < 2 && ($game_switches[:Inversemode] || (@battle.FE == :INVERSE))))
typemod /= 2
end
if @battle.ProgressiveFieldCheck(PBFields::FLOWERGARDEN,4,5) && opponent.hasType?(:GRASS) &&
((PBTypes.oneTypeEff(type, :GRASS) > 2) || (PBTypes.oneTypeEff(type, :GRASS) < 2 && ($game_switches[:Inversemode] || (@battle.FE == :INVERSE))))
typemod /= 2
end
if @battle.FE == :BEWITCHED && opponent.hasType?(:FAIRY) && (opponent.ability == :PASTELVEIL || opponent.pbPartner.ability == :PASTELVEIL) && !(opponent.moldbroken) &&
((PBTypes.oneTypeEff(type, :FAIRY) > 2) || (PBTypes.oneTypeEff(type, :FAIRY) < 2 && ($game_switches[:Inversemode] || (@battle.FE == :INVERSE))))
typemod /= 2
end
if typemod==0
if @function==0x111
return 1
else
### MODDED/ No actual effects
# @battle.pbDisplay(_INTL("It doesn't affect {1}...",opponent.pbThis(true)))
# if PBStuff::TWOTURNMOVE.include?(@move)
# @battle.scene.pbUnVanishSprite(attacker)
# end
### /MODDED
end
end
return typemod
end
def crawli_movehelpdisplay_calcPower(attacker,opponent,options=0, hitnum: 0) # Based on PokeBattle_Move pbCalcPower
### MODDED/ no damagestate
# opponent.damagestate.critical=false
# opponent.damagestate.typemod=0
# opponent.damagestate.calcdamage=0
# opponent.damagestate.hplost=0
### /MODDED
### MODDED/ return immediately for Beat Up, as it crashes otherwise
return 1, 1 if @move == :BEATUP
### /MODDED
basedmg=@basedamage # From PBS file
basedmg = [attacker.happiness,250].min if attacker.crested == :LUVDISC && basedmg != 0
basedmg=pbBaseDamage(basedmg,attacker,opponent) # Some function codes alter base power
### MODDED/ add basedamage to return
return 0, 0 if basedmg==0
### /MODDED
basedmg = basedmg*0.3 if attacker.crested == :CINCCINO && !pbIsMultiHit
### MODDED/ crits only calculate if crit chance is 100%
critchance = pbCritRate?(attacker,opponent) # 3 is 100%
### /MODDED
stagemul=[2,2,2,2,2,2,2,3,4,5,6,7,8]
stagediv=[8,7,6,5,4,3,2,2,2,2,2,2,2]
type=pbType(attacker)
##### Calcuate base power of move #####
basemult=1.0
#classic prep stuff
attitemworks = attacker.itemWorks?(true)
oppitemworks = opponent.itemWorks?(true)
case attacker.ability
when :TECHNICIAN
if basedmg<=60
basemult*=1.5
elsif (@battle.FE == :FACTORY || @battle.ProgressiveFieldCheck(PBFields::CONCERT)) && basedmg<=80
basemult*=1.5
end
when :STRONGJAW then basemult*=1.5 if (PBStuff::BITEMOVE).include?(@move)
when :SHARPNESS then basemult*=1.5 if sharpMove?
when :TRUESHOT then basemult*=1.3 if (PBStuff::BULLETMOVE).include?(@move)
when :TOUGHCLAWS then basemult*=1.3 if contactMove?
when :IRONFIST
if @battle.FE == :CROWD
basemult*=1.2 if punchMove?
else
basemult*=1.2 if punchMove?
end
when :RECKLESS then basemult*=1.2 if [0xFA,0xFD,0xFE,0x10B,0x506,0x130].include?(@function)
when :FLAREBOOST then basemult*=1.5 if (attacker.status== :BURN || @battle.FE == :BURNING || @battle.FE == :VOLCANIC || @battle.FE == :INFERNAL) && pbIsSpecial?(type) && @battle.FE != :FROZENDIMENSION
when :TOXICBOOST
if (attacker.status== :POISON || @battle.FE == :CORROSIVE || @battle.FE == :CORROSIVEMIST || @battle.FE == :WASTELAND || @battle.FE == :MURKWATERSURFACE) && pbIsPhysical?(type)
if @battle.FE == :CORRUPTED
basemult*=2.0
else
basemult*=1.5
end
end
when :PUNKROCK
if isSoundBased?
case @battle.FE
when :BIGTOP then basemult*=1.5
when :CAVE then basemult*=1.5
else
basemult*=1.3
end
end
when :RIVALRY then basemult*= attacker.gender==opponent.gender ? 1.25 : 0.75 if attacker.gender!=2
when :MEGALAUNCHER then basemult*=1.5 if [:AURASPHERE,:DRAGONPULSE,:DARKPULSE,:WATERPULSE,:ORIGINPULSE,:TERRAINPULSE].include?(@move)
when :SANDFORCE then basemult*=1.3 if (@battle.pbWeather== :SANDSTORM || @battle.FE == :DESERT || @battle.FE == :ASHENBEACH) && (type == :ROCK || type == :GROUND || type == :STEEL)
when :ANALYTIC then basemult*=1.3 if (@battle.battlers.find_all {|battler| battler && battler.hp > 0 && !battler.hasMovedThisRound? }).length == 0
when :SHEERFORCE then basemult*=1.3 if effect > 0
when :AERILATE
if @type == :NORMAL && type == :FLYING
case @battle.FE
when :MOUNTAIN,:SNOWYMOUNTAIN,:SKY then basemult*=1.5
else
basemult*=1.2
end
end
when :GALVANIZE
if @type == :NORMAL && type == :ELECTRIC
case @battle.FE
when :ELECTERRAIN,:FACTORY then basemult*=1.5
when :SHORTCIRCUIT then basemult*=2
else
if @battle.state.effects[:ELECTERRAIN] > 0
basemult*=1.5
else
basemult*=1.2
end
end
end
when :REFRIGERATE
if @type == :NORMAL && type == :ICE
case @battle.FE
when :ICY,:SNOWYMOUNTAIN,:FROZENDIMENSION then basemult*=1.5
else
basemult*=1.2
end
end
when :PIXILATE
if @type == :NORMAL && (type == :FAIRY || (type == :NORMAL && @battle.FE == :GLITCH))
case @battle.FE
when :MISTY then basemult*=1.5
else
if @battle.state.effects[:MISTY] > 0
basemult*=1.5
else
basemult*=1.2
end
end
end
when :DUSKILATE then basemult*=1.2 if @type == :NORMAL && (type == :DARK || (type == :NORMAL && @battle.FE == :GLITCH))
when :NORMALIZE then basemult*=1.2 if !@zmove
when :TRANSISTOR then basemult*=1.5 if type == :ELECTRIC
when :DRAGONSMAW then basemult*=1.5 if type == :DRAGON
when :TERAVOLT then basemult*=1.5 if (Rejuv && @battle.FE == :ELECTERRAIN && type == :ELECTRIC)
when :INEXORABLE then basemult*=1.3 if type == :DRAGON && (!opponent.hasMovedThisRound? || @battle.switchedOut[opponent.index])
end
case opponent.ability
when :HEATPROOF then basemult*=0.5 if !(opponent.moldbroken) && type == :FIRE
when :DRYSKIN then basemult*=1.25 if !(opponent.moldbroken) && type == :FIRE
when :TRANSISTOR then basemult*=0.5 if (@battle.FE == :ELECTERRAIN && type == :GROUND) && !(opponent.moldbroken)
end
if attitemworks
if $cache.items[attacker.item].checkFlag?(:typeboost) == type
basemult*=1.2
if $cache.items[attacker.item].checkFlag?(:gem)
basemult*=1.0833 #gems are 1.3; 1.2 * 1.0833 = 1.3
### MODDED/ don't actually take gem
# attacker.takegem=true
# @battle.pbDisplay(_INTL("The {1} strengthened {2}'s power!",getItemName(attacker.item),self.name))
### /MODDED
end
else
case attacker.item
when :MUSCLEBAND then basemult*=1.1 if pbIsPhysical?(type)
when :WISEGLASSES then basemult*=1.1 if pbIsSpecial?(type)
when :LUSTROUSORB then basemult*=1.2 if (attacker.pokemon.species == :PALKIA) && (type == :DRAGON || type == :WATER)
when :ADAMANTORB then basemult*=1.2 if (attacker.pokemon.species == :DIALGA) && (type == :DRAGON || type == :STEEL)
when :GRISEOUSORB then basemult*=1.2 if (attacker.pokemon.species == :GIRATINA) && (type == :DRAGON || type == :GHOST)
when :SOULDEW then basemult*=1.2 if (attacker.pokemon.species == :LATIAS || attacker.pokemon.species == :LATIOS) && (type == :DRAGON || type == :PSYCHIC)
end
end
end
basemult=pbBaseDamageMultiplier(basemult,attacker,opponent)
# standard crest damage multipliers
case attacker.crested
when :FERALIGATR then basemult*=1.5 if (PBStuff::BITEMOVE).include?(@move)
when :CLAYDOL then basemult*=1.5 if isBeamMove?
when :DRUDDIGON then basemult*=1.3 if (type == :DRAGON || type == :FIRE)
when :BOLTUND then basemult*=1.5 if (PBStuff::BITEMOVE).include?(@move) && (!(opponent.hasMovedThisRound?) || @battle.switchedOut[opponent.index])
when :FEAROW then basemult*=1.5 if (PBStuff::STABBINGMOVE).include?(@move)
when :DUSKNOIR then basemult*=1.5 if (basedmg<=60 || ((@battle.FE == :FACTORY || @battle.ProgressiveFieldCheck(PBFields::CONCERT))&& basedmg<=80))
when :CRABOMINABLE then basemult*=1.5 if attacker.lastHPLost>0
when :AMPHAROS then basemult*= (attacker.hasType?(type) || attacker.ability == :PROTEAN || attacker.ability == :LIBERO) ? 1.2 : 1.5 if attacker.moves[0] == self
when :LUXRAY then basemult *= 1.2 if @type == :NORMAL && type == :ELECTRIC
when :SAWSBUCK
case attacker.form
when 0 then basemult*=1.2 if @type == :NORMAL && type == :WATER
when 1 then basemult*=1.2 if @type == :NORMAL && type == :FIRE
when 2 then basemult*=1.2 if @type == :NORMAL && type == :GROUND
when 3 then basemult*=1.2 if @type == :NORMAL && type == :ICE
end
end
#type mods
case type
when :FIRE then basemult*=0.33 if @battle.state.effects[:WaterSport]>0
when :ELECTRIC
basemult*=0.33 if @battle.state.effects[:MudSport]>0
basemult*=2.0 if attacker.effects[:Charge]>0
when :DARK
basemult*= (@battle.pbCheckGlobalAbility(:AURABREAK) ? 0.66 : 1.33) if @battle.pbCheckGlobalAbility(:DARKAURA)
basemult*= (@battle.pbCheckGlobalAbility(:AURABREAK) ? 0.6 : 1.4) if @battle.pbCheckGlobalAbility(:DARKAURA) && @battle.FE==:DARKNESS1
basemult*= (@battle.pbCheckGlobalAbility(:AURABREAK) ? 0.5 : 1.5) if @battle.pbCheckGlobalAbility(:DARKAURA) && @battle.FE==:DARKNESS2
basemult*= (@battle.pbCheckGlobalAbility(:AURABREAK) ? 0.33 : 1.66) if @battle.pbCheckGlobalAbility(:DARKAURA) && @battle.FE==:DARKNESS3
when :FAIRY
basemult*= (@battle.pbCheckGlobalAbility(:AURABREAK) ? 0.66 : 1.33) if @battle.pbCheckGlobalAbility(:FAIRYAURA)
basemult*= (@battle.pbCheckGlobalAbility(:AURABREAK) ? 0.7 : 1.30) if @battle.pbCheckGlobalAbility(:FAIRYAURA)&& @battle.FE==:DARKNESS1
basemult*= (@battle.pbCheckGlobalAbility(:AURABREAK) ? 0.8 : 1.2) if @battle.pbCheckGlobalAbility(:FAIRYAURA)&& @battle.FE==:DARKNESS2
basemult*= (@battle.pbCheckGlobalAbility(:AURABREAK) ? 0.9 : 1.1) if @battle.pbCheckGlobalAbility(:FAIRYAURA)&& @battle.FE==:DARKNESS3
end
### MODDED/ helping hand not applied for base power boost
# basemult*=1.5 if attacker.effects[:HelpingHand]
### /MODDED
basemult*=1.5 if @move == :KNOCKOFF && !opponent.item.nil? && !@battle.pbIsUnlosableItem(opponent,opponent.item)
basemult*=2.0 if opponent.effects[:Minimize] && @move == :MALICIOUSMOONSAULT # Minimize for z-move
#Specific Field Effects
### MODDED/ prepare for field effect boosts
oldbasemult = basemult
### /MODDED
if @battle.field.isFieldEffect?
fieldmult = moveFieldBoost
if fieldmult != 1
basemult*=fieldmult
### MODDED/ no messages
# fieldmessage =moveFieldMessage
# if fieldmessage && !@fieldmessageshown
# if [:LIGHTTHATBURNSTHESKY,:ICEHAMMER,:HAMMERARM,:CRABHAMMER].include?(@move) #some moves have a {1} in them and we gotta deal.
# @battle.pbDisplay(_INTL(fieldmessage,attacker.pbThis))
# elsif [:SMACKDOWN,:THOUSANDARROWS,:ROCKSLIDE,:VITALTHROW,:CIRCLETHROW,:STORMTHROW,:DOOMDUMMY,:BLACKHOLEECLIPSE,:TECTONICRAGE,:CONTINENTALCRUSH,:WHIRLWIND,:CUT].include?(@move)
# @battle.pbDisplay(_INTL(fieldmessage,opponent.pbThis))
# else
# @battle.pbDisplay(_INTL(fieldmessage))
# end
# @fieldmessageshown = true
# end
### /MODDED
end
end
case @battle.FE
when :CHESS
if (CHESSMOVES).include?(@move)
basemult*=0.5 if [:ADAPTABILITY,:ANTICIPATION,:SYNCHRONIZE,:TELEPATHY].include?(opponent.ability)
basemult*=2.0 if [:OBLIVIOUS,:KLUTZ,:UNAWARE,:SIMPLE].include?(opponent.ability) || opponent.effects[:Confusion]>0 || (Rejuv && opponent.ability == :DEFEATIST)
### MODDED/ no messages
# @battle.pbDisplay("The chess piece slammed forward!") if !@fieldmessageshown
# @fieldmessageshown = true
### /MODDED
end
# Queen piece boost
if attacker.pokemon.piece==:QUEEN || attacker.ability == :QUEENLYMAJESTY
basemult*=1.5
### MODDED/ no messages
# if attacker.pokemon.piece==:QUEEN
# @battle.pbDisplay("The Queen is dominating the board!") && !@fieldmessageshown
# @fieldmessageshown = true
# end
### /MODDED
end
#Knight piece boost
if attacker.pokemon.piece==:KNIGHT && opponent.pokemon.piece==:QUEEN
basemult=(basemult*3.0).round
### MODDED/ no messages
# @battle.pbDisplay("An unblockable attack on the Queen!") if !@fieldmessageshown
# @fieldmessageshown = true
### /MODDED
end
when :BIGTOP
### MODDED/ Cannot be certain about modifier
# if ((type == :FIGHTING && pbIsPhysical?(type)) || (STRIKERMOVES).include?(@move)) # Continental Crush
# striker = 1+@battle.pbRandom(14)
# @battle.pbDisplay("WHAMMO!") if !@fieldmessageshown
# @fieldmessageshown = true
# if attacker.ability == :HUGEPOWER || attacker.ability == :GUTS || attacker.ability == :PUREPOWER || attacker.ability == :SHEERFORCE
# if striker >=9
# striker = 15
# else
# striker = 14
# end
# end
# strikermod = attacker.stages[PBStats::ATTACK]
# striker = striker + strikermod
# if striker >= 15
# @battle.pbDisplay("...OVER 9000!!!")
# provimult=3.0
# elsif striker >=13
# @battle.pbDisplay("...POWERFUL!")
# provimult=2.0
# elsif striker >=9
# @battle.pbDisplay("...NICE!")
# provimult=1.5
# elsif striker >=3
# @battle.pbDisplay("...OK!")
# provimult=1
# else
# @battle.pbDisplay("...WEAK!")
# provimult=0.5
# end
# provimult = ((provimult-1.0)/2.0)+1.0 if $game_variables[:DifficultyModes]==1 && !$game_switches[:FieldFrenzy]
# provimult = ((provimult-1.0)*2.0)+1.0 if $game_variables[:DifficultyModes]!=1 && $game_switches[:FieldFrenzy] && provimult > 1
# provimult = provimult/2.0 if $game_variables[:DifficultyModes]!=1 && $game_switches[:FieldFrenzy] && provimult < 1
# basemult*=provimult
# end
### /MODDED
if isSoundBased?
provimult=1.5
provimult=1.25 if $game_variables[:DifficultyModes]==1
provimult = ((provimult-1.0)*2.0)+1.0 if $game_switches[:FieldFrenzy]
basemult*=provimult
### MODDED/ no messages
# @battle.pbDisplay("Loud and clear!") if !@fieldmessageshown
# @fieldmessageshown = true
### /MODDED
end
### MODDED/ doesn't affect damage, not relevant
# when :ICY
# if (@priority >= 1 && @basedamage > 0 && contactMove? && attacker.ability != :LONGREACH) || (@move == :FEINT || @move == :ROLLOUT || @move == :DEFENSECURL || @move == :STEAMROLLER || @move == :LUNGE)
# if !attacker.isAirborne?
# if attacker.pbCanIncreaseStatStage?(PBStats::SPEED)
# attacker.pbIncreaseStatBasic(PBStats::SPEED,1)
# @battle.pbCommonAnimation("StatUp",attacker,nil)
# @battle.pbDisplay(_INTL("{1} gained momentum on the ice!",attacker.pbThis)) if !@fieldmessageshown
# @fieldmessageshown = true
# end
# end
# end
### /MODDED
### MODDED/ Cannot be certain about modifier
# when :SHORTCIRCUIT
# if type == :ELECTRIC
# damageroll = @battle.field.getRoll(maximize_roll:(@battle.state.effects[:ELECTERRAIN] > 0))
# messageroll = ["Bzzt.", "Bzzapp!" , "Bzt...", "Bzap!", "BZZZAPP!"][PBStuff::SHORTCIRCUITROLLS.index(damageroll)]
# @battle.pbDisplay(messageroll) if !@fieldmessageshown
# damageroll = ((damageroll-1.0)/2.0)+1.0 if $game_variables[:DifficultyModes]==1 && !$game_switches[:FieldFrenzy]
# damageroll = ((damageroll-1.0)*2.0)+1.0 if $game_variables[:DifficultyModes]!=1 && $game_switches[:FieldFrenzy] && damageroll > 1
# damageroll = damageroll/2.0 if $game_variables[:DifficultyModes]!=1 && $game_switches[:FieldFrenzy] && damageroll < 1
# basemult*=damageroll
# @fieldmessageshown = true
# end
### /MODDED
when :CAVE
if isSoundBased?
provimult=1.5
provimult=1.25 if $game_variables[:DifficultyModes]==1
provimult = ((provimult-1.0)*2.0)+1.0 if $game_switches[:FieldFrenzy]
basemult*=provimult
### MODDED/ no messages
# @battle.pbDisplay(_INTL("ECHO-Echo-echo!",opponent.pbThis)) if !@fieldmessageshown
# @fieldmessageshown = true
### /MODDED