-
Notifications
You must be signed in to change notification settings - Fork 2
/
Pokemon.java
9063 lines (8994 loc) · 180 KB
/
Pokemon.java
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
//////////////////
//Pokemon Class
//By Camtendo and Justinian
//
//
//
//
public class Pokemon
{
public boolean IS_TRADED=false;
public int HP_IV=(int)(Math.random()*31)+1;
public int ATK_IV=(int)(Math.random()*31)+1;
public int DEF_IV=(int)(Math.random()*31)+1;
public int SPCL_IV=(int)(Math.random()*31)+1;
public int SPEED_IV=(int)(Math.random()*31)+1;
public int HP_EV=0;
public int ATK_EV=0;
public int DEF_EV=0;
public int SPCL_EV=0;
public int SPEED_EV=0;
public enum Species
{
BULBASAUR,IVYSAUR,VENUSAUR,CHARMANDER,CHARMELEON,CHARIZARD,SQUIRTLE,
WARTORTLE,BLASTOISE,CATERPIE,METAPOD,BUTTERFREE,WEEDLE,KAKUNA,BEEDRILL,
PIDGEY,PIDGEOTTO,PIDGEOT,RATTATA,RATICATE,SPEAROW,FEAROW,EKANS,ARBOK,PIKACHU,
RAICHU,SANDSHREW,SANDSLASH,NIDORAN_F,NIDORINA,NIDOQUEEN,NIDORAN_M,
NIDORINO,NIDOKING,CLEFAIRY,CLEFABLE,VULPIX,NINETALES,JIGGLYPUFF,WIGGLYTUFF,ZUBAT,
GOLBAT,ODDISH,GLOOM,VILEPLUME,PARAS,PARASECT,VENONAT,VENOMOTH,DIGLETT,DUGTRIO,
MEOWTH,PERSIAN,PSYDUCK,GOLDUCK,MANKEY,PRIMEAPE,GROWLITHE,ARCANINE,POLIWAG,POLIWHIRL,
POLIWRATH,ABRA,KADABRA,ALAKAZAM,MACHOP,MACHOKE,MACHAMP,BELLSPROUT,WEEPINBELL,
VICTREEBEL,TENTACOOL,TENTACRUEL,GEODUDE,GRAVELER,GOLEM,PONYTA,RAPIDASH,SLOWPOKE,
SLOWBRO,MAGNEMITE,MAGNETON,FARFETCH_D,DODUO,DODRIO,SEEL,DEWGONG,GRIMER,MUK,
SHELLDER,CLOYSTER,GASTLY,HAUNTER,GENGAR,ONIX,DROWZEE,HYPNO,KRABBY,KINGLER,VOLTORB,
ELECTRODE,EXEGGCUTE,EXEGGUTOR,CUBONE,MAROWAK,HITMONLEE,HITMONCHAN,LICKITUNG,KOFFING,
WEEZING,RHYHORN,RHYDON,CHANSEY,TANGELA,KANGASKHAN,HORSEA,SEADRA,GOLDEEN,SEAKING,
STARYU,STARMIE,MR_MIME,SCYTHER,JYNX,ELECTABUZZ,MAGMAR,PINSIR,TAUROS,MAGIKARP,
GYARADOS,LAPRAS,DITTO,EEVEE,VAPOREON,JOLTEON,FLAREON,PORYGON,OMANYTE,OMASTAR,KABUTO,
KABUTOPS,AERODACTYL,SNORLAX,ARTICUNO,ZAPDOS,MOLTRES,DRATINI,DRAGONAIR,DRAGONITE,
MEWTWO,MEW,MISSINGNO
}
public enum Type
{
BUG,DRAGON,ELECTRIC,FIGHTING,FIRE,FLYING,GHOST,GRASS,GROUND,ICE,
NORMAL,POISON,PSYCHIC,ROCK,WATER,NONE,BIRD
}
public enum Status
{
OK,SLP,PSN,PAR,BRN,FRZ,FNT
}
public enum Substatus
{
OK,CONFU,FLINCH,SEED
}
public enum Move
{
ABSORB,ACID,ACID_ARMOR,AGILITY,AMNESIA,AURORA_BEAM,BARRAGE,BARRIER,
BIDE,BIND,BITE,BLIZZARD,BODY_SLAM,BONE_CLUB,BONEMERANG,BUBBLE,BUBBLEBEAM,
CLAMP,COMET_PUNCH,CONFUSE_RAY,CONFUSION,CONSTRICT,CONVERSION,COUNTER,
CRABHAMMER,CUT,DEFENSE_CURL,DIG,DISABLE,DIZZY_PUNCH,DOUBLE_KICK,
DOUBLE_TEAM,DOUBLE_EDGE,DOUBLESLAP,DRAGON_RAGE,DREAM_EATER,DRILL_PECK,
EARTHQUAKE,EGG_BOMB,EMBER,EXPLOSION,FIRE_BLAST,FIRE_PUNCH,FIRE_SPIN,
FISSURE,FLAMETHROWER,FLASH,FLY,FOCUS_ENERGY,FURY_ATTACK,FURY_SWIPES,GLARE,
GROWL,GROWTH,GUILLOTINE,GUST,HARDEN,HAZE,HEADBUTT,HI_JUMP_KICK,HORN_ATTACK,
HORN_DRILL,HYDRO_PUMP,HYPER_BEAM,HYPER_FANG,HYPNOSIS,ICE_BEAM,ICE_PUNCH,
JUMP_KICK,KARATE_CHOP,KINESIS,LEECH_LIFE,LEECH_SEED,LEER,LICK,LIGHT_SCREEN,
LOVELY_KISS,LOW_KICK,MEDITATE,MEGA_DRAIN,MEGA_KICK,MEGA_PUNCH,METRONOME,
MIMIC,MINIMIZE,MIRROR_MOVE,MIST,NIGHT_SHADE,PAY_DAY,PECK,PETAL_DANCE,
PIN_MISSILE,POISON_GAS,POISON_STING,POISONPOWDER,POUND,PSYBEAM,PSYCHIC,
PSYWAVE,QUICK_ATTACK,RAGE,RAZOR_LEAF,RAZOR_WIND,RECOVER,REFLECT,REST,ROAR,
ROCK_SLIDE,ROCK_THROW,ROLLING_KICK,SAND_ATTACK,SCRATCH,SCREECH,SEISMIC_TOSS,
SELFDESTRUCT,SHARPEN,SING,SKULL_BASH,SKY_ATTACK,SLAM,SLASH,SLEEP_POWDER,
SLUDGE,SMOG,SMOKESCREEN,SOFTBOILED,SOLARBEAM,SONIC_BOOM,SPIKE_CANNON,SPLASH,
SPORE,STOMP,STRENGTH,STRING_SHOT,STRUGGLE,STUN_SPORE,SUBMISSION,SUBSTITUTE,
SUPER_FANG,SUPERSONIC,SURF,SWIFT,SWORDS_DANCE,TACKLE,TAIL_WHIP,TAKE_DOWN,
TELEPORT,THRASH,THUNDER,THUNDER_WAVE,THUNDERBOLT,THUNDERPUNCH,THUNDERSHOCK,
TOXIC,TRANSFORM,TRI_ATTACK,TWINEEDLE,VICEGRIP,VINE_WHIP,WATER_GUN,WATERFALL,
WHIRLWIND,WING_ATTACK,WITHDRAW,WRAP,NONE;
int accuracy;
Primary_Effect mainEffect;
Side_Effect sideEffect;
Status status;
Substatus substatus;
int sideEffectAcc;
int basePower;
int pp,ppMax;
Type moveType;
}
final int[] TRUE_PP={0,0,0,0};
final int[] TRUE_PPMAX={0,0,0,0};
public enum Side_Effect
{
NONE, STAT, STATUS, SUBSTATUS, MULTI_HIT, MULTI_TURN, ABSORB, OHKO, HIGH_CRIT, CHARGE,
FAINT, RECOIL, SUBSTITUTE, DISABLE, RECOVERY ,COLLECT_DAMAGE, TRANSFORM,
CONVERSION, FIXED_DAMAGE, METRONOME, MIMIC, MIRROR_MOVE, QUICK_ATTACK, SWIFT, ROAR, HIDE, FURY
}
public enum Primary_Effect
{
DAMAGE, RAISE_STAT, LOWER_STAT, INFLICT_STATUS, SPECIAL, NONE
}
String nickname,originalTrainer;
int idNumber,pokedexNumber;
int level,exp;
int health,atk,def,speed,spcl,
healthMax,atkStage,defStage,speedStage,spclStage;
double eva=1;
int evaStage,accuracyStage;
int baseHP,baseATK,baseDEF,baseSPEED,baseSPCL;
Type type1,type2;
Species species;
Status status=Status.OK;
Substatus substatus=Substatus.OK;
Move move[]=new Move[4];
//Create a brand new Pokemon
public Pokemon(Species s)
{
level=5;
exp=100;
createPokemon(s,level);
createMoves();
}
//Create a brand new Pokemon with a specified level
public Pokemon(Species s, int lvl)
{
level=lvl;
exp=(lvl-1)*(lvl-1)*(lvl-1);
exp+=lvl;
createPokemon(s,level);
createMoves();
}
//Creates a Pokemon for Trainers with moveset and level
public Pokemon(Species s, Move m1, int lvl)
{
level=lvl;
exp=(lvl-1)*(lvl-1)*(lvl-1);
exp+=lvl;
createPokemon(s,level);
move[0]=m1;
createMoves();
}
//Creates a Pokemon for Trainers with moveset and level
public Pokemon(Species s, Move m1, Move m2, int lvl)
{
level=lvl;
exp=(lvl-1)*(lvl-1)*(lvl-1);
exp+=lvl;
createPokemon(s,level);
move[0]=m1;
move[1]=m2;
createMoves();
}
//Creates a Pokemon for Trainers with moveset and level
public Pokemon(Species s, Move m1, Move m2, Move m3, int lvl)
{
level=lvl;
exp=(lvl-1)*(lvl-1)*(lvl-1);
exp+=lvl;
createPokemon(s,level);
move[0]=m1;
move[1]=m2;
move[2]=m3;
createMoves();
}
//Creates a Pokemon for Trainers with moveset and level
public Pokemon(Species s, Move m1, Move m2, Move m3, Move m4, int lvl)
{
level=lvl;
exp=(lvl-1)*(lvl-1)*(lvl-1);
exp+=lvl;
createPokemon(s,level);
move[0]=m1;
move[1]=m2;
move[2]=m3;
move[3]=m4;
createMoves();
}
//Most verbose way to create a Pokemon
public Pokemon(Species s, Move m1, Move m2, Move m3, Move m4, int lvl, int hpiv, int atkiv, int defiv, int spcliv, int speediv,
String nick, Status stat, int idNo, String ot)
{
level = lvl;
HP_IV=hpiv;
ATK_IV=atkiv;
DEF_IV=defiv;
SPCL_IV=spcliv;
SPEED_IV=speediv;
createPokemon(s,lvl);
move[0]=m1;
move[1]=m2;
move[2]=m3;
move[3]=m4;
createMoves();
status=stat;
nickname=nick;
idNumber=idNo;
originalTrainer=ot;
}
public String toString()
{
return "Name: "+nickname+" Species: "+toString(species)+" Level:"+level+"\n"+
"Atk: "+atk+" Def: "+def+" Spcl: "+spcl+" Speed: "+speed+" Exp: "+exp+"\n"+
"HP:"+health+"/"+healthMax+"\n"+
move[0]+"\n"+move[1]+"\n"+move[2]+"\n"+move[3];
}
public String toBattleString()
{
return nickname+" Lvl: "+level+" HP:"+health+"/"+healthMax+" Status: "+status+"\n"+"\n"+
"0:"+move[0]+" PP: "+move[0].pp+"/"+move[0].ppMax+"\n"+
"1:"+move[1]+" PP: "+move[1].pp+"/"+move[1].ppMax+"\n"+
"2:"+move[2]+" PP: "+move[2].pp+"/"+move[2].ppMax+"\n"+
"3:"+move[3]+" PP: "+move[3].pp+"/"+move[3].ppMax;
}
//Checks and Sets if a Pokemon is traded given an ID
public void checkTraded(int idToBeChecked)
{
IS_TRADED=(idNumber==idToBeChecked);
}
//Sets this Pokemon's stats TO DA MAX!!!
public void setMaxStats()
{
HP_IV=31;
HP_EV=256*256;
ATK_IV=31;
ATK_EV=256*256;
DEF_IV=31;
DEF_EV=256*256;
SPCL_IV=31;
SPCL_EV=256*256;
SPEED_IV=31;
SPEED_EV=256*256;
healthMax=Mechanics.calcHPStat(baseHP,HP_IV, HP_EV,level);
health=healthMax;
atk=Mechanics.calcOtherStat(baseATK,ATK_IV,ATK_EV,level);
def=Mechanics.calcOtherStat(baseDEF,DEF_IV, DEF_EV,level);
spcl=Mechanics.calcOtherStat(baseSPCL,SPCL_IV,SPCL_EV,level);
speed=Mechanics.calcOtherStat(baseSPEED,SPEED_IV,SPEED_EV,level);
}
//Sets Pokemon EVs to the given stat and value
public void setEV(String str, int ev)
{
if(str.equals("HP"))
HP_EV=ev;
else if(str.equals("ATK"))
ATK_EV=ev;
else if(str.equals("DEF"))
DEF_EV=ev;
else if(str.equals("SPCL"))
SPCL_EV=ev;
else if(str.equals("SPEED"))
SPEED_EV=ev;
if(HP_EV>256*256)
HP_EV=256*256;
if(ATK_EV>256*256)
ATK_EV=256*256;
if(DEF_EV>256*256)
DEF_EV=256*256;
if(SPCL_EV>256*256)
SPCL_EV=256*256;
if(SPEED_EV>256*256)
SPEED_EV=256*256;
healthMax=Mechanics.calcHPStat(baseHP,HP_IV, HP_EV,level);
health=healthMax;
atk=Mechanics.calcOtherStat(baseATK,ATK_IV,ATK_EV,level);
def=Mechanics.calcOtherStat(baseDEF,DEF_IV, DEF_EV,level);
spcl=Mechanics.calcOtherStat(baseSPCL,SPCL_IV,SPCL_EV,level);
speed=Mechanics.calcOtherStat(baseSPEED,SPEED_IV,SPEED_EV,level);
}
//Sets Pokemon nickname given a String
public void setNickname(String nick)
{
nickname=nick;
if(nickname.length()>10)
setNickname(nickname.substring(0,10));
if(nickname.equals("")||nickname.equals(" ")||nickname.equals(" ")||nickname.equals(" ")
||nickname.equals(" ")||nickname.equals(" ")||nickname.equals(" ")||nickname.equals(" ")
||nickname.equals(" ")||nickname.equals(" ")||nickname.equals(" "))
nickname=toString(species);
}
public String toHPOnlyString()
{
return nickname+" HP:"+health+"/"+healthMax+" Status: "+status;
}
public String toString(Species s)
{
return ""+s;
}
public String toString(Move m)
{
String str=""+m;
str.replace('_',' ');
return str;
}
//Returns the species a Pokemon will evolve into
//Level up version
public Species evolve(Pokemon p)
{
switch(p.species)
{
case BULBASAUR:
if(level>=16)
return Species.IVYSAUR;
break;
case IVYSAUR:
if(level>=32)
return Species.VENUSAUR;
break;
case CHARMANDER:
if(level>=16)
return Species.CHARMELEON;
break;
case CHARMELEON:
if(level>=36)
return Species.CHARIZARD;
break;
case SQUIRTLE:
if(level>=16)
return Species.WARTORTLE;
break;
case WARTORTLE:
if(level>=36)
return Species.BLASTOISE;
break;
case CATERPIE:
if(level>=7)
return Species.METAPOD;
break;
case METAPOD:
if(level>=10)
return Species.BUTTERFREE;
break;
case WEEDLE:
if(level>=7)
return Species.KAKUNA;
break;
case KAKUNA:
if(level>=10)
return Species.BEEDRILL;
break;
case PIDGEY:
if(level>=18)
return Species.PIDGEOTTO;
break;
case PIDGEOTTO:
if(level>=36)
return Species.PIDGEOT;
break;
case RATTATA:
if(level>=20)
return Species.RATICATE;
break;
case SPEAROW:
if(level>=20)
return Species.FEAROW;
break;
case EKANS:
if(level>=22)
return Species.ARBOK;
break;
case SANDSHREW:
if(level>=22)
return Species.SANDSLASH;
break;
case NIDORAN_F:
if(level>=16)
return Species.NIDORINA;
break;
case NIDORAN_M:
if(level>=16)
return Species.NIDORINO;
break;
case ZUBAT:
if(level>=22)
return Species.GOLBAT;
break;
case ODDISH:
if(level>=21)
return Species.GLOOM;
break;
case PARAS:
if(level>=24)
return Species.PARASECT;
break;
case VENONAT:
if(level>=31)
return Species.VENOMOTH;
break;
case DIGLETT:
if(level>=26)
return Species.DUGTRIO;
break;
case MEOWTH:
if(level>=28)
return Species.PERSIAN;
break;
case PSYDUCK:
if(level>=33)
return Species.GOLDUCK;
break;
case MANKEY:
if(level>=28)
return Species.PRIMEAPE;
break;
case POLIWAG:
if(level>=25)
return Species.POLIWHIRL;
break;
case ABRA:
if(level>=16)
return Species.KADABRA;
break;
case MACHOP:
if(level>=28)
return Species.MACHOKE;
break;
case BELLSPROUT:
if(level>=21)
return Species.WEEPINBELL;
break;
case TENTACOOL:
if(level>=30)
return Species.TENTACRUEL;
break;
case GEODUDE:
if(level>=25)
return Species.GRAVELER;
break;
case PONYTA:
if(level>=40)
return Species.RAPIDASH;
break;
case SLOWPOKE:
if(level>=37)
return Species.SLOWBRO;
break;
case MAGNEMITE:
if(level>=30)
return Species.MAGNETON;
break;
case DODUO:
if(level>=31)
return Species.DODRIO;
break;
case SEEL:
if(level>=34)
return Species.DEWGONG;
break;
case GRIMER:
if(level>=38)
return Species.MUK;
break;
case GASTLY:
if(level>=25)
return Species.HAUNTER;
break;
case DROWZEE:
if(level>=26)
return Species.HYPNO;
break;
case KRABBY:
if(level>=28)
return Species.KINGLER;
break;
case VOLTORB:
if(level>=30)
return Species.ELECTRODE;
break;
case CUBONE:
if(level>=28)
return Species.MAROWAK;
break;
case KOFFING:
if(level>=35)
return Species.WEEZING;
break;
case RHYHORN:
if(level>=42)
return Species.RHYDON;
break;
case HORSEA:
if(level>=32)
return Species.SEADRA;
break;
case GOLDEEN:
if(level>=33)
return Species.SEAKING;
break;
case MAGIKARP:
if(level>=20)
return Species.GYARADOS;
break;
case OMANYTE:
if(level>=40)
return Species.OMASTAR;
break;
case KABUTO:
if(level>=40)
return Species.KABUTOPS;
break;
case DRATINI:
if(level>=30)
return Species.DRAGONAIR;
break;
case DRAGONAIR:
if(level>=55)
return Species.DRAGONITE;
break;
case MISSINGNO:
if(level>=80)
return Species.KANGASKHAN;
break;
}
return p.species;
}
//Evolutionary Stone version
public Species evolve(Pokemon p, Item.Type t)
{
boolean willWork = true;
switch(p.species)
{
case PIKACHU:
if(t==Item.Type.THUNDER_STONE)
return Species.RAICHU;
else
willWork = false;
break;
case NIDORINA:
if(t==Item.Type.MOON_STONE)
return Species.NIDOQUEEN;
else
willWork = false;
break;
case NIDORINO:
if(t==Item.Type.MOON_STONE)
return Species.NIDOKING;
else
willWork = false;
break;
case CLEFAIRY:
if(t==Item.Type.MOON_STONE)
return Species.CLEFABLE;
else
willWork = false;
break;
case VULPIX:
if(t==Item.Type.FIRE_STONE)
return Species.NINETALES;
else
willWork = false;
break;
case JIGGLYPUFF:
if(t==Item.Type.MOON_STONE)
return Species.WIGGLYTUFF;
else
willWork = false;
break;
case GLOOM:
if(t==Item.Type.LEAF_STONE)
return Species.VILEPLUME;
else
willWork = false;
break;
case GROWLITHE:
if(t==Item.Type.FIRE_STONE)
return Species.ARCANINE;
else
willWork = false;
break;
case POLIWHIRL:
if(t==Item.Type.WATER_STONE)
return Species.POLIWRATH;
else
willWork = false;
break;
case WEEPINBELL:
if(t==Item.Type.LEAF_STONE)
return Species.VICTREEBEL;
else
willWork = false;
break;
case SHELLDER:
if(t==Item.Type.WATER_STONE)
return Species.CLOYSTER;
else
willWork = false;
break;
case EXEGGCUTE:
if(t==Item.Type.LEAF_STONE)
return Species.EXEGGUTOR;
else
willWork = false;
break;
case STARYU:
if(t==Item.Type.WATER_STONE)
return Species.STARMIE;
else
willWork = false;
break;
case EEVEE:
if(t==Item.Type.WATER_STONE)
return Species.VAPOREON;
else if(t==Item.Type.THUNDER_STONE)
return Species.JOLTEON;
else if(t==Item.Type.FIRE_STONE)
return Species.FLAREON;
else
willWork = false;
break;
default:
willWork = false;
break;
}
if (!willWork)
{
Inventory.errorWindow.addMessage(t.toString().replace('_',' ') + " will have no effect!");
}
return p.species;
}
//Trade version
public Species evolve(Pokemon p, int idToCheck)
{
if(idToCheck!=p.idNumber)
{
switch(p.species)
{
case KADABRA:
return Species.ALAKAZAM;
case MACHOKE:
return Species.MACHAMP;
case GRAVELER:
return Species.GOLEM;
case HAUNTER:
return Species.GENGAR;
}
}
return p.species;
}
//Constructs a similar Pokemon that has evolved
public Pokemon evolution(Pokemon p, Species s)
{
Pokemon newP=null;
newP=new Pokemon(s, p.move[0], p.move[1], p.move[2], p.move[3],p.level);
newP.HP_EV=p.HP_EV;
newP.ATK_EV=p.ATK_EV;
newP.DEF_EV=p.DEF_EV;
newP.SPEED_EV=p.SPEED_EV;
newP.SPCL_EV=p.SPCL_EV;
newP.HP_IV=p.HP_IV;
newP.ATK_IV=p.ATK_IV;
newP.DEF_IV=p.DEF_IV;
newP.SPEED_IV=p.SPEED_IV;
newP.SPCL_IV=p.SPCL_IV;
newP.IS_TRADED=p.IS_TRADED;
newP.idNumber=p.idNumber;
if(!p.nickname.equals(p.species.toString()))
newP.nickname=p.nickname;
newP.originalTrainer=p.originalTrainer;
System.arraycopy(p.TRUE_PP, 0, newP.TRUE_PP, 0, 4);
return newP;
}
//Returns Sum of Base Stats
public int getBaseStatTotal()
{
return HP_IV+ATK_IV+DEF_IV+SPCL_IV+SPEED_IV;
}
//Returns a string of this Pokemon's types
public String getTypeString()
{
String str="";
switch(type1)
{
case BIRD:
str+="Bird";
break;
case BUG:
str+="Bug";
break;
case DRAGON:
str+="Drag";
break;
case ELECTRIC:
str+="Elec";
break;
case FIGHTING:
str+="Fght";
break;
case FIRE:
str+="Fire";
break;
case FLYING:
str+="Fly";
break;
case GHOST:
str+="Ghst";
break;
case GRASS:
str+="Grss";
break;
case GROUND:
str+="Grd";
break;
case ICE:
str+="Ice";
break;
case NORMAL:
str+="Nrm";
break;
case POISON:
str+="Psn";
break;
case PSYCHIC:
str+="Psy";
break;
case ROCK:
str+="Rock";
break;
case WATER:
str+="Wtr";
break;
default:
break;
}
if(type2!=Type.NONE)
{
str+="/";
switch(type2)
{
case BIRD:
str+="Bird";
break;
case BUG:
str+="Bug";
break;
case DRAGON:
str+="Drag";
break;
case ELECTRIC:
str+="Elec";
break;
case FIGHTING:
str+="Fght";
break;
case FIRE:
str+="Fire";
break;
case FLYING:
str+="Fly";
break;
case GHOST:
str+="Ghst";
break;
case GRASS:
str+="Grss";
break;
case GROUND:
str+="Grd";
break;
case ICE:
str+="Ice";
break;
case NORMAL:
str+="Nrm";
break;
case POISON:
str+="Psn";
break;
case PSYCHIC:
str+="Psy";
break;
case ROCK:
str+="Rock";
break;
case WATER:
str+="Wtr";
break;
default:
break;
}
}
return str;
}
//Takes in 0 - 162 and returns metronome when it's not between 0 and 162
public Move randomMove(int num)
{
switch(num)
{
case 0:
return Move.ABSORB;
case 1:
return Move.ACID;
case 2:
return Move.ACID_ARMOR;
case 3:
return Move.AGILITY;
case 4:
return Move.AMNESIA;
case 5:
return Move.AURORA_BEAM;
case 6:
return Move.BARRAGE;
case 7:
return Move.BARRIER;
case 8:
case 9:
case 10:
return Move.BITE;
case 11:
return Move.BLIZZARD;
case 12:
return Move.BODY_SLAM;
case 13:
return Move.BONE_CLUB;
case 14:
return Move.BONEMERANG;
case 15:
return Move.BUBBLE;
case 16:
return Move.BUBBLEBEAM;
case 17:
case 18:
return Move.COMET_PUNCH;
case 19:
return Move.CONFUSE_RAY;
case 20:
return Move.CONFUSION;
case 21:
return Move.CONSTRICT;
case 22:
return Move.CONVERSION;
case 23:
return Move.COUNTER;
case 24:
return Move.CRABHAMMER;
case 25:
return Move.CUT;
case 26:
return Move.DEFENSE_CURL;
case 27:
case 28:
return Move.DISABLE;
case 29:
return Move.DIZZY_PUNCH;
case 30:
return Move.DOUBLE_KICK;
case 31:
return Move.DOUBLE_TEAM;
case 32:
return Move.DOUBLE_EDGE;
case 33:
return Move.DOUBLESLAP;
case 34:
return Move.DRAGON_RAGE;
case 35:
return Move.DREAM_EATER;
case 36:
return Move.DRILL_PECK;
case 37:
return Move.EARTHQUAKE;
case 38:
return Move.EGG_BOMB;
case 39:
return Move.EMBER;
case 40:
return Move.EXPLOSION;
case 41:
return Move.FIRE_BLAST;
case 42:
return Move.FIRE_PUNCH;
case 43:
case 44:
return Move.FISSURE;
case 45:
return Move.FLAMETHROWER;
case 46:
return Move.FLASH;
case 47:
case 48:
return Move.FOCUS_ENERGY;
case 49:
return Move.FURY_ATTACK;
case 50:
return Move.FURY_SWIPES;
case 51:
return Move.GLARE;
case 52:
return Move.GROWL;
case 53:
return Move.GROWTH;
case 54:
return Move.GUILLOTINE;
case 55:
return Move.GUST;
case 56:
return Move.HARDEN;
case 57:
return Move.HAZE;
case 58:
return Move.HEADBUTT;
case 59:
return Move.HI_JUMP_KICK;
case 60:
return Move.HORN_ATTACK;
case 61:
return Move.HORN_DRILL;
case 62:
return Move.HYDRO_PUMP;
case 63:
case 64:
return Move.HYPER_FANG;
case 65:
return Move.HYPNOSIS;
case 66:
return Move.ICE_BEAM;
case 67:
return Move.ICE_PUNCH;
case 68:
return Move.JUMP_KICK;
case 69:
return Move.KARATE_CHOP;
case 70:
return Move.KINESIS;
case 71:
return Move.LEECH_LIFE;
case 72:
return Move.LEECH_SEED;
case 73:
return Move.LEER;
case 74:
return Move.LICK;
case 75:
return Move.LIGHT_SCREEN;
case 76:
return Move.LOVELY_KISS;
case 77:
return Move.LOW_KICK;
case 78:
return Move.MEDITATE;
case 79:
return Move.MEGA_DRAIN;
case 80:
return Move.MEGA_KICK;
case 81:
return Move.MEGA_PUNCH;
case 82: