From 5322cb402d7edb894d2beb7b710c58e1145ae520 Mon Sep 17 00:00:00 2001 From: sigonasr2 Date: Sun, 20 Aug 2017 23:19:31 -0500 Subject: [PATCH] Continued implementing the Megamon and move database. Added the Megamon party menu along with testing Megamon HP values and displays. --- Megamon-core/.classpath | 2 +- Megamon-core/assets/Megamon/1.png | Bin 0 -> 3675 bytes Megamon-core/assets/Megamon/1_back.png | Bin 0 -> 3675 bytes Megamon-core/assets/Megamon/1_icon.png | Bin 0 -> 498 bytes Megamon-core/assets/interface/healthbar.png | Bin 0 -> 254 bytes .../assets/interface/megamon_party.png | Bin 0 -> 2091 bytes .../interface/megamon_party_selection.png | Bin 0 -> 572 bytes Megamon-core/src/sig/megamon/Database.java | 197 ++++++++++++++ Megamon-core/src/sig/megamon/Megamon.java | 72 +++-- .../src/sig/megamon/MegamonCreature.java | 90 ++++++- Megamon-core/src/sig/megamon/MegamonPet.java | 251 +++++++++++++++++- Megamon-core/src/sig/megamon/Player.java | 10 +- .../sig/megamon/creature/CreatureMove.java | 11 +- .../megamon/creature/CreatureMoveLinker.java | 11 + .../src/sig/megamon/creature/Evolution.java | 19 ++ .../src/sig/megamon/menu/MegadexMenu.java | 5 + .../sig/megamon/menu/MegamonPartyScreen.java | 99 +++++++ .../src/sig/megamon/menu/MenuItem.java | 21 ++ .../src/sig/megamon/menu/StartMenuBox.java | 37 ++- 19 files changed, 786 insertions(+), 39 deletions(-) create mode 100644 Megamon-core/assets/Megamon/1.png create mode 100644 Megamon-core/assets/Megamon/1_back.png create mode 100644 Megamon-core/assets/Megamon/1_icon.png create mode 100644 Megamon-core/assets/interface/healthbar.png create mode 100644 Megamon-core/assets/interface/megamon_party.png create mode 100644 Megamon-core/assets/interface/megamon_party_selection.png create mode 100644 Megamon-core/src/sig/megamon/creature/CreatureMoveLinker.java create mode 100644 Megamon-core/src/sig/megamon/creature/Evolution.java create mode 100644 Megamon-core/src/sig/megamon/menu/MegadexMenu.java create mode 100644 Megamon-core/src/sig/megamon/menu/MegamonPartyScreen.java create mode 100644 Megamon-core/src/sig/megamon/menu/MenuItem.java diff --git a/Megamon-core/.classpath b/Megamon-core/.classpath index c3e1a89..922c864 100644 --- a/Megamon-core/.classpath +++ b/Megamon-core/.classpath @@ -2,7 +2,7 @@ - + diff --git a/Megamon-core/assets/Megamon/1.png b/Megamon-core/assets/Megamon/1.png new file mode 100644 index 0000000000000000000000000000000000000000..0ddca4e014f03ac2bf388eb7c5a205bd56591936 GIT binary patch literal 3675 zcmV-h4y5skP)RA}DqT5C{LSDyc!d;9(F2AX~VDj>*9j3a{a z0r&1dY&jTteD{F3UeyV+Wo}U{P@_0N=O-*OcoayW9o5}pi z?H?J8L?V+x?Sgt-|TaR#WFc_>>YjJULe}Dg#D_8RJ@={V# zUJwAM(|O{=iQ~tQ_w@8U^CE?Xh4uCIGMUU~vvqWI96EI9#Q_KggWcWTw{PEmFrwAS zv$IU$NTP4Zp;k)r7MUWE*w+Kj$)}4lQ&S8&`-scw@-1GFrqe3yqh5_xS6s5xpx5>G z_PX8fM{MIo$AQ%=3SQgsvfbhS(}@e&8OGOtUN!3U{^s{5U7jGzvajt}U0Ss0%=wP5 z+I#o!S-U7J<><#>gu_vvKUh(|^5DUP(P(tx!i6sm0L!vUrQ-ftEW37P!T$R7HPtVT z+8v+?Yev?#ZMD7#jY_g7JRvb7?5kV4I74PMC|8yhZQZvvVjw3({3d@+=JUdf1YJWJ!*sd2ezYM}J{n9|+Xo!;%gcu0V#=vX=#G(n8*C!QWQ)TInnpLmVtu=^e>#Cb+fL!3e&QbIr&^1}dN7*?azmzLz$ZdkE>Q<=t~ zLNJIVfkY1`3(zF_M8~x+fBW12bdEU`GV#B@`B%#et*2W$FW+>({x?|`vqd47cnEoB z24)MuXiVF>Wpi#;S}f_m-7{POnwhQvVFXA(6%4@hbks4@+1VlRJOIbYxA_YV14E9h z*9SIlbD7Onv3OQI%(f=BTFjfP*A*2kJA0w~cfbFnzvnJga>%6+;z))7Di$;8>89M= zT(w$lOf{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9FYs z>=Ns<;)2iL5uqF)Jl=Ue)JBE@QBkpy@?n7=XUH*$nT(AZlWuty4OXI~5Ep>Zcf7v>*yJZ{8wsAG zEuYYCJHsF=Q&C>ADkmo!z|y5OlhbEb^}si2#^A;ooGG_s}=k9 zK`RCYwgV;>(7;fJ^w)tD;B&n`wWOpdJ$(V5o}RHHi^s!*gSY5`UKn*Am2d)E$0VS{z5Wa!!lO=(B)msZkG3qUj)a=9ElpY(cz$B$obY`o?3 znSmvM>0yZd7?6gL2rB)T%;&D`%r4%)d;ef>pR?ge2YVqHG$$|S;=lEXlKbuyl#sl8 z_8$AUKDXN@2)e4O6_iqyN}rl)o?|a``Etv#V{iNYp;%0E{d&Q@dsaXLm9qS~ z<0X`|yj(K8H@9g0vektv%Y){RFzdd#7TvD_4|2W`AzhUA12Ls?bouh3 z%*-)Dgo=u)g9rakt=7*;k4*4-U0q$>zxvgG84Rmfb{Wf75z++2r+oe+zYoEz+P8Oe ze{Z|M^OG&KXxRVnzdn?axdh~&fyCq95`Y^l`;RPJDiW1$-1x@n)90N|M+a{I004p@;rS@g z1-u8Sr;?f2;~NIJ3yf1Nf0!>#a!KSMNuUGx9Uys}yA%UbKmzc<9Uz!Yik`^flL0Uc zTT!w8jW^8Ub%O#-{o=u@&Df>o)Se8 zNK#69K8IlnYHD^ZSdjbuIr5CWkl!B|8*?NQQ6NqTeUi$F0ExknW;UB1d;~!$^?1A! z6XP5g1`%OJ!N+d%O_gdH!kQ#tg$Go%ITMLQeZYg~%+rBXhy!Y!@Lv t>5soL|Jmg{fO!D(0OkSA1Ne#4{{hdJ2)In4NBaN(002ovPDHLkV1i-w!j%93 literal 0 HcmV?d00001 diff --git a/Megamon-core/assets/Megamon/1_back.png b/Megamon-core/assets/Megamon/1_back.png new file mode 100644 index 0000000000000000000000000000000000000000..7f3dc3a4a724c06f029274247772d6b7d2a0c011 GIT binary patch literal 3675 zcmV-h4y5skP)RA}DqT5C{LSDyc!d;9(F2AX~VDj>*9j3a{a z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lEXlKbuyl#sl8 z_8$AUKDXN@2)e4O6_iqyN}rl)o?|a``Etv#V{iNYp;%0E{d&Q@dsaXLm9qS~ z<0X`|yj(K8H@9g0vektv%Y){RFzdd#7TvD_4|2W`AzhUA12Ls?bouh3 z%*-)Dgo=u)g9rakt=7*;k4*4-U0q$>zxvgG84Rmfb{Wf75z++2r+oe+zYoEz+P8Oe ze{Z|M^OG&KXxRVnzdn?axdh~&fyCq95`Y^l`;RPJDiW1$-1x@n)90N|M+a{I004p@;rS@g z1-u8Sr;?f2;~NIJ3yf1Nf0!>#a!KSMNuUGx9Uys}yA%UbKmzc<9Uz!Yik`^flL0Uc zTT!w8jW^8Ub%O#-{o=u@&Df>o)Se8 zNK#69K8IlnYHD^ZSdjbuIr5CWkl!B|8*?NQQ6NqTeUi$F0ExknW;UB1d;~!$^?1A! z6XP5g1`%OJ!N+d%O_gdH!kQ#tg$Go%ITMLQeZYg~%+rBXhy!Y!@Lv t>5soL|Jmg{fO!D(0OkSA1Ne#4{{hdJ2)In4NBaN(002ovPDHLkV1fjI!=C^E literal 0 HcmV?d00001 diff --git a/Megamon-core/assets/Megamon/1_icon.png b/Megamon-core/assets/Megamon/1_icon.png new file mode 100644 index 0000000000000000000000000000000000000000..d5761af1544113841b2c26a3eda726731c3a3ae4 GIT binary patch literal 498 zcmVe*X6H42)oY0sgF0k z_rCY|-uEa%2!??PL*frYrBcx}?OTc%A)C$SaybCOU{F^wAcVtV-JahFq9_6wciAV# zxaCFP(men4{GuqzR|BIP*6OHI@x3YYypeh}U#WhfLWPR=IINfbDtsFaQ z=WKM{;dJ&lQ2joHLfe_64Jad}w@l%-3=6x{aL6L7sd1WS^n$9@JKzR!VoD}aD&zbT z=?kj%2xx*J7>JgnB0y*e^xiHA>4g~p-aVcf146sq1ZMfwLtqOay)aP#ypmKJcvd?X z!2!WTn@Oag5O`l}wR>Y9^7(6)jR9SNoTm0wSqAa|0bcz66$2ll(M`A81_S_1O(x7N o%kwdYu>febK8(-$AMgDWpKs$n{`A4V9smFU07*qoM6N<$f=wIAy8r+H literal 0 HcmV?d00001 diff --git a/Megamon-core/assets/interface/healthbar.png b/Megamon-core/assets/interface/healthbar.png new file mode 100644 index 0000000000000000000000000000000000000000..3905e5e75f06eed073de1946987b6ec3e68f480b GIT binary patch literal 254 zcmeAS@N?(olHy`uVBq!ia0vp^d_bJU!3HD~>K=UnQfx`y?k)`fL2$v|<&%LToCO|{ z#S9GG!XV7ZFl&wkP>{XE)7O>#A%}>#7;}>S4l$sRY-UJAiF1B#Zfaf$kjuc}T$Gwv zlA5AWo>`Ki;O^-gkfN8$4ir!Fba4!cIQ;hFM&1Sk0hWWNMy?LI0drUKb}?`+a$i!` z;Bc#3Z+E>flV3xvuFEHbk7qXOmcKtP+0b`vNyHl8zE6LHXN%W=Su9g@La`l__-J>W YHSp5WgL_0CDS({e>FVdQ&MBb@0G5eUD*ylh literal 0 HcmV?d00001 diff --git a/Megamon-core/assets/interface/megamon_party.png b/Megamon-core/assets/interface/megamon_party.png new file mode 100644 index 0000000000000000000000000000000000000000..bf633f3e6e7c4f06610a5a8b6f4835c19291203c GIT binary patch literal 2091 zcmeAS@N?(olHy`uVBq!ia0y~yU}|7sV0^&A1{5*9c;^X_VoUONcLCBs@Y8vBJ&@uo z@Q5sCVBi)8VMc~ob0mO*>?NMQuIvvvL>Xi`51ft)1`5e$hD4M&=jZ08=9K`s3=Gai zsfi`2DGKG8B^e6tp1uJoda3L{t^J-Zjv*Dd-rhRM+n^xe>S(xy>F@Q;BAdk)uADCw9EUUxVFJYt8M;W%MWFa1UDt5SMWD1XnDX9((@KXp7#^&h=VaQ*&&?3g z&8+~hoD6y=%?x8;i0D8P!;-df#VYBMO;Hj#u!JwZR?>IT-n%gjK;Y@>=d#Wzp$Pz* CR>{r) literal 0 HcmV?d00001 diff --git a/Megamon-core/assets/interface/megamon_party_selection.png b/Megamon-core/assets/interface/megamon_party_selection.png new file mode 100644 index 0000000000000000000000000000000000000000..3f369c371780b770a220cecac90c72d7a0dca36f GIT binary patch literal 572 zcmeAS@N?(olHy`uVBq!ia0vp^O+dVWgAGU?NZ)b*NU`Fyn^6VOPzTe^P}G%qid<4b#eNJent=O2F}IZT^^ zYiH-)X$^{h@15kqt#7r5wP0JJcwY9ugTaq|Z!EiNf9*=a=GA-6Uw%64x$^5e%YOdb z`41Ww_#B`1`Ma762M42~0!vGSfB=(|164RwGz#G`1dCYrHs*S-71v0$n)PwN^Ntz* z9O;+;rgId#OsT3djut<4yZrmbyrY{B0K?Mk9V9GGSb;%o|A}ekaRvTP7d2TRkHOQ` K&t;ucLK6VorlE=e literal 0 HcmV?d00001 diff --git a/Megamon-core/src/sig/megamon/Database.java b/Megamon-core/src/sig/megamon/Database.java index c451294..626af0d 100644 --- a/Megamon-core/src/sig/megamon/Database.java +++ b/Megamon-core/src/sig/megamon/Database.java @@ -1,7 +1,15 @@ package sig.megamon; import java.awt.geom.Point2D; +import java.util.Arrays; +import java.util.LinkedList; +import sig.megamon.creature.Category; +import sig.megamon.creature.CreatureMove; +import sig.megamon.creature.CreatureMoveLinker; +import sig.megamon.creature.CreatureType; +import sig.megamon.creature.Evolution; +import sig.megamon.creature.ExperienceRate; import sig.megamon.ref.RoomRef; import sig.megamon.ref.SignRef; @@ -27,4 +35,193 @@ public class Database { } ); } + + public static void SetupMoveDatabase() { + String moveName = "M.Buster";Megamon.moveDatabase.put(moveName, new CreatureMove( + moveName,"Damages the target. Exclusive to Mega Man.", + CreatureType.NORMAL, Category.SPECIAL, + 35,35,95)); + Megamon.moveDatabase.put(moveName="P.Buster", new CreatureMove( + moveName,"Damages the target. Exclusive to Proto Man.", + CreatureType.NORMAL, Category.SPECIAL, + 35,35,95)); + Megamon.moveDatabase.put(moveName="B.Buster", new CreatureMove( + moveName,"Damages the target. Exclusive to Bass.", + CreatureType.NORMAL, Category.SPECIAL, + 35,35,95)); + Megamon.moveDatabase.put(moveName="Bubble Lead", new CreatureMove( + moveName,"Damages the target with bubbles. Exclusive to Mega Man.", + CreatureType.WATER, Category.SPECIAL, + 25,40,100)); + Megamon.moveDatabase.put(moveName="Magma Bazooka", new CreatureMove( + moveName,"Has a 10% chance to burn the target. Exclusive to Proto Man.", + CreatureType.FIRE, Category.SPECIAL, + 15,95,100)); + Megamon.moveDatabase.put(moveName="Slide", new CreatureMove( + moveName,"Increases the user's evasion by one stage.", + CreatureType.NORMAL, Category.STATUS, + 15,0,100)); + Megamon.moveDatabase.put(moveName="Water Balloon", new CreatureMove( + moveName,"Damages the target with a large water baloon. Exclusive to Mega Man.", + CreatureType.WATER, Category.SPECIAL, + 5,120,80)); + Megamon.moveDatabase.put(moveName="Quick Jab", new CreatureMove( + moveName,"Damages the target, and is an increased priority move. Will go first regardless of the user's or targets speed.", + CreatureType.STRENGTH, Category.PHYSICAL, + 30,60,100)); + Megamon.moveDatabase.put(moveName="Haymaker", new CreatureMove( + moveName,"Damages the target, and has a 10% chance to paralyze the target.", + CreatureType.STRENGTH, Category.PHYSICAL, + 15,90,100)); + Megamon.moveDatabase.put(moveName="Proto Shield", new CreatureMove( + moveName,"If the target uses a damaging move you block 75% of the damage. If the move is non damaging the user's defense falls 1 stage.", + CreatureType.SHIELD, Category.STATUS, + 25,0,100)); + Megamon.moveDatabase.put(moveName="Shield Charge", new CreatureMove( + moveName,"Damages the target, and has a 10% chance to paralyze the target.", + CreatureType.SHIELD, Category.PHYSICAL, + 15,90,100)); + Megamon.moveDatabase.put(moveName="Jamming", new CreatureMove( + moveName,"Lowers the target's attack by 1 stage", + CreatureType.NORMAL, Category.STATUS, + 40,0,100)); + Megamon.moveDatabase.put(moveName="Degrade", new CreatureMove( + moveName,"Lowers the target's defense by 1 stage", + CreatureType.NORMAL, Category.STATUS, + 40,0,100)); + Megamon.moveDatabase.put(moveName="Shadow Punch", new CreatureMove( + moveName,"Inflicts damage and is unaffected by ACC & EVA stat mods. Will not hit targets using Fly or Dig.", + CreatureType.DARK, Category.PHYSICAL, + 20,60,100)); + Megamon.moveDatabase.put(moveName="Evil Energy", new CreatureMove( + moveName,"Increases the Attack by 2 Stages. Cannot Stack.", + CreatureType.DARK, Category.STATUS, + 10,0,100)); + Megamon.moveDatabase.put(moveName="Octagon Shot", new CreatureMove( + moveName,"Attacks 3-5 times in one turn; if one of these attacks breaks a target's Substitute, the target will take damage for the rest", + CreatureType.DARK, Category.PHYSICAL, + 20,25,100)); + Megamon.moveDatabase.put(moveName="Aerial Barrage", new CreatureMove( + moveName,"A powerful aerial strike.", + CreatureType.FLYING, Category.PHYSICAL, + 15,95,100)); + Megamon.moveDatabase.put(moveName="Beat Plane", new CreatureMove( + moveName,"Beats the target, and has a 10% chance to confuse the target.", + CreatureType.FLYING, Category.PHYSICAL, + 15,75,95)); + Megamon.moveDatabase.put(moveName="Double Jump", new CreatureMove( + moveName,"Increases the user's evasion by 1 stage.", + CreatureType.NORMAL, Category.STATUS, + 15,0,100)); + Megamon.moveDatabase.put(moveName="Double Jump", new CreatureMove( + moveName,"First turn, the user jumps into the air, becoming uncontrollable, and evades most attacks. Swift may still hit. The second turn, the user slams into the ground dealing heavy damage.", + CreatureType.NORMAL, Category.PHYSICAL, + 15,70,95)); + Megamon.moveDatabase.put(moveName="Spread Shot", new CreatureMove( + moveName,"Damages the target. Exclusive to Mets.", + CreatureType.NORMAL, Category.PHYSICAL, + 30,35,95)); + Megamon.moveDatabase.put(moveName="Taunt", new CreatureMove( + moveName,"Raises the target's attack by 2 stages and confuses it.", + CreatureType.NORMAL, Category.STATUS, + 15,0,90)); + Megamon.moveDatabase.put(moveName="Spark Shock", new CreatureMove( + moveName,"Damages the target, and has a 50% chance to paralyze the target. Exclusive to Spark Man.", + CreatureType.ELECTRIC, Category.SPECIAL, + 10,50,85)); + Megamon.moveDatabase.put(moveName="Charge", new CreatureMove( + moveName,"Raises the user's Special Attack by 1 stage.", + CreatureType.ELECTRIC, Category.STATUS, + 15,0,100)); + Megamon.moveDatabase.put(moveName="Rain Flush", new CreatureMove( + moveName,"Damages the target. Has a 25% chance to poison the target. Exclusive to Toad Man.", + CreatureType.WATER, Category.SPECIAL, + 15,75,90)); + Megamon.moveDatabase.put(moveName="Fade to Black", new CreatureMove( + moveName,"Raises the user's evasion by 1 stage.", + CreatureType.DARK, Category.STATUS, + 20,0,0)); + Megamon.moveDatabase.put(moveName="Dive Bomb", new CreatureMove( + moveName,"Flies up and dives straight for the target.", + CreatureType.FLYING, Category.PHYSICAL, + 15,60,100)); + Megamon.moveDatabase.put(moveName="Shield & Burst", new CreatureMove( + moveName,"On turn 1 a shield is put up and will absorb 25% of the attack damage. On Turn 2 the shield bursts into shrapnel-like pieces.", + CreatureType.SHIELD, Category.SPECIAL, + 15,60,100)); + Megamon.moveDatabase.put(moveName="Pharaoh Shot", new CreatureMove( + moveName,"Damages the target. Has a 10% chance to burn the target. Exclusive to Pharoah Man.", + CreatureType.FIRE, Category.SPECIAL, + 15,95,100)); + Megamon.moveDatabase.put(moveName="Pharaoh Shot", new CreatureMove( + moveName,"Damages the target. Has a 10% chance to burn the target. Exclusive to Pharoah Man.", + CreatureType.FIRE, Category.SPECIAL, + 15,95,100)); + Megamon.moveDatabase.put(moveName="Yamato Spear", new CreatureMove( + moveName,"Damages the target.", + CreatureType.NORMAL, Category.PHYSICAL, + 15,80,100)); + Megamon.moveDatabase.put(moveName="Burn", new CreatureMove( + moveName,"Inflicts a burn damage to the target. It has no effect on Fire-types.", + CreatureType.FIRE, Category.SPECIAL, + 15,0,75)); + Megamon.moveDatabase.put(moveName="Fire Storm", new CreatureMove( + moveName,"Damages the target. Has a 10% chance to Burn the target. Also increases Special & Attack by 1 stage to the user.", + CreatureType.FIRE, Category.SPECIAL, + 15,60,100)); + Megamon.moveDatabase.put(moveName="Bug Bite", new CreatureMove( + moveName,"Damages the target. Has a 20% chance to poison the target.", + CreatureType.BUG, Category.PHYSICAL, + 15,65,85)); + Megamon.moveDatabase.put(moveName="Air Shooter", new CreatureMove( + moveName,"Damages the target with air waves. Exclusive to Air Man.", + CreatureType.FLYING, Category.SPECIAL, + 15,95,100)); + Megamon.moveDatabase.put(moveName="Plant Barrier", new CreatureMove( + moveName,"It blocks any attack made by the enemy. Will always go first.", + CreatureType.SHIELD, Category.STATUS, + 5,0,100)); + Megamon.moveDatabase.put(moveName="Noise Crush", new CreatureMove( + moveName,"Damages the Target. If used on an enemy that has barrier, light screen, or reflect active the damage doubles.", + CreatureType.DARK, Category.PHYSICAL, + 15,85,100)); + Megamon.moveDatabase.put(moveName="Crystal Eye", new CreatureMove( + moveName,"Damages the target. Excluse to Crystal Man.", + CreatureType.NORMAL, Category.SPECIAL, + 15,90,100)); + Megamon.moveDatabase.put(moveName="Proto Song", new CreatureMove( + moveName,"Puts the target to sleep. Exclusive to Proto Man.", + CreatureType.NORMAL, Category.SPECIAL, + 15,0,75)); + Megamon.moveDatabase.put(moveName="Last Round", new CreatureMove( + moveName,"Lowers the user's speed by 1 stage, but increases the user's attack and defense by 1 stage.", + CreatureType.STRENGTH, Category.STATUS, + 5,0,100)); + Megamon.moveDatabase.put(moveName="Fire Armor", new CreatureMove( + moveName,"Damages the target and increases the users defense by 1 stage.", + CreatureType.FIRE, Category.SPECIAL, + 20,50,100)); + Megamon.moveDatabase.put(moveName="Ultimate Defense", new CreatureMove( + moveName,"If successful, the user's defense increases by 2 stages, If not successful the user suffers from a random status condition.", + CreatureType.FIRE, Category.SPECIAL, + 5,0,50)); + } + + public static void SetupMegamonDatabase() { + Megamon.megamonDatabase = new LinkedList(Arrays.asList( + new MegamonCreature("1_icon.png","1.png","1_back.png", + "Basic M", "Basic Megaman", 1, 1, + CreatureType.WATER, 44, 48, 65, 50, 43, + 3, 64, ExperienceRate.MEDIUM_SLOW, + new CreatureMoveLinker[]{ + new CreatureMoveLinker(Megamon.moveDatabase.get("M.Buster"),1), + new CreatureMoveLinker(Megamon.moveDatabase.get("Degrade"),1), + new CreatureMoveLinker(Megamon.moveDatabase.get("Bubble Lead"),8), + new CreatureMoveLinker(Megamon.moveDatabase.get("Slide"),15), + new CreatureMoveLinker(Megamon.moveDatabase.get("Bubble Beam"),22), + new CreatureMoveLinker(Megamon.moveDatabase.get("Water Shield"),28), + new CreatureMoveLinker(Megamon.moveDatabase.get("Water Balloon"),38), + }) + )); + } } diff --git a/Megamon-core/src/sig/megamon/Megamon.java b/Megamon-core/src/sig/megamon/Megamon.java index 4e95efd..48e293e 100644 --- a/Megamon-core/src/sig/megamon/Megamon.java +++ b/Megamon-core/src/sig/megamon/Megamon.java @@ -32,9 +32,11 @@ import com.badlogic.gdx.maps.tiled.TmxMapLoader; import com.badlogic.gdx.maps.tiled.renderers.OrthogonalTiledMapRenderer; import sig.megamon.creature.CreatureMove; +import sig.megamon.creature.CreatureMoveLinker; import sig.megamon.creature.CreatureType; import sig.megamon.creature.ExperienceRate; import sig.megamon.menu.DialogBox; +import sig.megamon.menu.MegamonPartyScreen; import sig.megamon.menu.StartMenuBox; import sig.megamon.ref.Ref; import sig.megamon.ref.RoomRef; @@ -49,6 +51,8 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{ public static BitmapFont font; public static DialogBox messagebox; public static StartMenuBox startmenubox; + public static MegamonPartyScreen partyscreen; + public static Texture healthbar; //AssetManager assets; //TiledMap map; static OrthographicCamera camera; @@ -67,6 +71,8 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{ final public static int MOVEUPKEY = Keys.UP; final public static int MOVEDOWNKEY = Keys.DOWN; final public static int MENUKEY = Keys.ENTER; + public static List megamonDatabase = new ArrayList(); + public static HashMap moveDatabase = new HashMap(); //public static List objects = new ArrayList(); public static Room currentLevel; public static HashMap doorDatabase = new HashMap(); @@ -77,6 +83,7 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{ batch = new SpriteBatch(); font = new BitmapFont(Gdx.files.internal("fonts/AgencyFB.fnt")); mainP = new Player(new Point2D.Double(1,1),"megamon_icon64.png"); + healthbar = new Texture("interface/healthbar.png"); //assets = new AssetManager(); /*assets.setLoader(TiledMap.class, new TmxMapLoader(new InternalFileHandleResolver())); @@ -91,14 +98,39 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{ objects.add(new Object("megamonlogowip.png",new Point2D.Double(3, 7)));*/ Database.SetupDoorDatabase(); Database.SetupInfoDatabase(); + Database.SetupMoveDatabase(); + Database.SetupMegamonDatabase(); currentLevel = new Room(mainP.position,"Test Map"); - /*MegamonPet testPet = new MegamonPet("Test", + MegamonPet testPet = new MegamonPet("Test Name", new MegamonCreature("test_mini_sprite.png","test_sprite.png","test_sprite.png", "Test Creature", "This is for testing purposes only.", 14, 60, CreatureType.NORMAL, - 40,60,30,30,50,55,30,ExperienceRate.MEDIUM_FAST,new CreatureMove[]{}), + 40,60,30,30,50,55,30,ExperienceRate.MEDIUM_FAST,new CreatureMoveLinker[]{}), 100); - System.out.println(testPet);*/ + MegamonPet testPet2 = new MegamonPet("Test Name", + new MegamonCreature("test_mini_sprite.png","test_sprite.png","test_sprite.png", + "Test Creature", "This is for testing purposes only.", 14, 60, CreatureType.NORMAL, + 40,60,30,30,50,55,30,ExperienceRate.MEDIUM_FAST,new CreatureMoveLinker[]{}), + 100); + MegamonPet testPet3 = new MegamonPet("Test Name", + new MegamonCreature("test_mini_sprite.png","test_sprite.png","test_sprite.png", + "Test Creature", "This is for testing purposes only.", 14, 60, CreatureType.NORMAL, + 40,60,30,30,50,55,30,ExperienceRate.MEDIUM_FAST,new CreatureMoveLinker[]{}), + 100); + MegamonPet testPet4 = new MegamonPet("Test Name", + new MegamonCreature("test_mini_sprite.png","test_sprite.png","test_sprite.png", + "Test Creature", "This is for testing purposes only.", 14, 60, CreatureType.NORMAL, + 40,60,30,30,50,55,30,ExperienceRate.MEDIUM_FAST,new CreatureMoveLinker[]{}), + 100); + testPet.setHP((int)(Math.random()*testPet.getMaxHP())); + testPet2.setHP((int)(Math.random()*testPet2.getMaxHP())); + testPet3.setHP((int)(Math.random()*testPet3.getMaxHP())); + testPet4.setHP((int)(1)); + mainP.getMegamonParty().add(testPet); + mainP.getMegamonParty().add(testPet2); + mainP.getMegamonParty().add(testPet3); + mainP.getMegamonParty().add(testPet4); + /*System.out.println(testPet);*/ //messagebox = new DialogBox("This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message.This is a test message."); //startmenubox = new StartMenuBox(0); } @@ -112,6 +144,9 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{ Gdx.graphics.set //Potential resizing code. }*/ + if (partyscreen!=null) { + partyscreen.run(); + } else if (messagebox!=null) { messagebox.run(); } @@ -142,20 +177,27 @@ public class Megamon extends ApplicationAdapter implements ApplicationListener{ currentLevel.renderer.render(); batch.begin(); //batch.draw(img, 0, 0); - for (Object o : currentLevel.getObjects()) { - batch.draw(o.sprite, - (float)GraphicUtils.getRelativePixelPositionFromPlayer(camera, o.position).x, - (float)GraphicUtils.getRelativePixelPositionFromPlayer(camera, o.position).y); - o.draw(); + + if (partyscreen!=null) { + partyscreen.draw(batch); } - mainP.draw(batch); - if (messagebox!=null) { - messagebox.draw(batch); + else + { + for (Object o : currentLevel.getObjects()) { + batch.draw(o.sprite, + (float)GraphicUtils.getRelativePixelPositionFromPlayer(camera, o.position).x, + (float)GraphicUtils.getRelativePixelPositionFromPlayer(camera, o.position).y); + o.draw(); + } + mainP.draw(batch); + if (messagebox!=null) { + messagebox.draw(batch); + } + if (startmenubox!=null) { + startmenubox.draw(batch); + } } - if (startmenubox!=null) { - startmenubox.draw(batch); - } - GlyphLayout size = font.draw(batch, "Test Text", 0, 32); + //GlyphLayout size = font.draw(batch, "Test Text", 0, 32); //font.draw(batch, "Test Text", Megamon.WINDOW_WIDTH-size.width, 128-size.height); batch.end(); framesPassed++; diff --git a/Megamon-core/src/sig/megamon/MegamonCreature.java b/Megamon-core/src/sig/megamon/MegamonCreature.java index 4c5784e..436de62 100644 --- a/Megamon-core/src/sig/megamon/MegamonCreature.java +++ b/Megamon-core/src/sig/megamon/MegamonCreature.java @@ -8,7 +8,9 @@ import java.util.List; import sig.megamon.creature.CreatureLore; import sig.megamon.creature.CreatureMove; +import sig.megamon.creature.CreatureMoveLinker; import sig.megamon.creature.CreatureType; +import sig.megamon.creature.Evolution; import sig.megamon.creature.ExperienceRate; import sig.megamon.creature.SpriteCollection; @@ -26,23 +28,34 @@ public class MegamonCreature { final int catch_rate; final int base_exp; final ExperienceRate exp_rate; - final List moveset; + final List moveset; + final List evolution_rules; boolean seenByPlayer=false; public MegamonCreature(String mini_icon, String sprite, String back_sprite, String name, String bio, int size, float weight, CreatureType type1, - int base_hp, int base_atk, int base_def, int base_spd, int base_spc, + int base_hp, int base_atk, int base_def, int base_spc, int base_spd, int catch_rate, int base_exp, ExperienceRate exp_rate, - CreatureMove...moveset) { - this(mini_icon,sprite,back_sprite,name,bio,size, weight,type1,CreatureType.NONE,base_hp,base_atk,base_def,base_spd,base_spc,catch_rate,base_exp,exp_rate,moveset); + CreatureMoveLinker...moveset) { + this(mini_icon,sprite,back_sprite,name,bio,size, weight,type1,CreatureType.NONE,base_hp,base_atk,base_def,base_spc,base_spd,catch_rate,base_exp,exp_rate,new ArrayList(),moveset); + } + + public MegamonCreature(String mini_icon, String sprite, String back_sprite, + String name, String bio, int size, float weight, CreatureType type1, + int base_hp, int base_atk, int base_def, int base_spc, int base_spd, + int catch_rate, int base_exp, ExperienceRate exp_rate, + List evolution_rules, + CreatureMoveLinker...moveset) { + this(mini_icon,sprite,back_sprite,name,bio,size, weight,type1,CreatureType.NONE,base_hp,base_atk,base_def,base_spc,base_spd,catch_rate,base_exp,exp_rate,evolution_rules,moveset); } public MegamonCreature(String mini_icon, String sprite, String back_sprite, String name, String bio, int size, float weight, CreatureType type1, CreatureType type2, - int base_hp, int base_atk, int base_def, int base_spd, int base_spc, + int base_hp, int base_atk, int base_def, int base_spc, int base_spd, int catch_rate, int base_exp, ExperienceRate exp_rate, - CreatureMove...moveset) { + List evolution_rules, + CreatureMoveLinker...moveset) { this.sprites = new SpriteCollection(mini_icon,sprite,back_sprite); this.name = name; this.bio = new CreatureLore(bio,size,weight); @@ -57,12 +70,77 @@ public class MegamonCreature { this.base_exp=base_exp; this.exp_rate = exp_rate; this.moveset = new LinkedList(Arrays.asList(moveset)); + this.evolution_rules=evolution_rules; } public void setSeen(boolean seenByPlayer) { this.seenByPlayer=seenByPlayer; } + public SpriteCollection getSprites() { + return sprites; + } + + public String getName() { + return name; + } + + public CreatureLore getBio() { + return bio; + } + + public CreatureType getType1() { + return type1; + } + + public CreatureType getType2() { + return type2; + } + + public int getHP() { + return hp; + } + + public int getATK() { + return atk; + } + + public int getDEF() { + return def; + } + + public int getSPD() { + return spd; + } + + public int getSPC() { + return spc; + } + + public int getCatchRate() { + return catch_rate; + } + + public int getBaseEXP() { + return base_exp; + } + + public ExperienceRate getEXPRate() { + return exp_rate; + } + + public List getMoveset() { + return moveset; + } + + public boolean isSeenByPlayer() { + return seenByPlayer; + } + + public List getEvolutionRules() { + return evolution_rules; + } + public String toString() { StringBuilder sb = new StringBuilder(this.getClass().getSimpleName()+"("); boolean first=true; diff --git a/Megamon-core/src/sig/megamon/MegamonPet.java b/Megamon-core/src/sig/megamon/MegamonPet.java index 722cbec..49d3ba4 100644 --- a/Megamon-core/src/sig/megamon/MegamonPet.java +++ b/Megamon-core/src/sig/megamon/MegamonPet.java @@ -4,6 +4,7 @@ import java.lang.reflect.Field; import java.util.ArrayList; import java.util.List; +import sig.megamon.creature.CreatureMove; import sig.megamon.creature.NonVolatileStatus; import sig.megamon.creature.VolatileStatus; @@ -37,6 +38,7 @@ public class MegamonPet { String original_trainer_name; Integer level; Integer hp_iv; + List moveset = new ArrayList(); public MegamonPet(String nickname, MegamonCreature creature_type, Integer level) { this(nickname,creature_type,level,Megamon.mainP.trainer_id,Megamon.mainP.name); @@ -44,13 +46,19 @@ public class MegamonPet { public MegamonPet(String nickname, MegamonCreature creature_type, Integer level, Integer original_trainer, String original_trainer_name) { - this(nickname,creature_type,level,original_trainer,original_trainer_name, + this(nickname,creature_type,level,original_trainer,original_trainer_name, new ArrayList(), new Integer[]{}, new Integer[]{}); } public MegamonPet(String nickname, MegamonCreature creature_type, Integer level, - Integer original_trainer, String original_trainer_name, Integer[] stats_collection, - Integer...IV_EV_Collection) { + Integer original_trainer, String original_trainer_name, List moveset) { + this(nickname,creature_type,level,original_trainer,original_trainer_name, moveset, + new Integer[]{}, new Integer[]{}); + } + + public MegamonPet(String nickname, MegamonCreature creature_type, Integer level, + Integer original_trainer, String original_trainer_name, List moveset, + Integer[] stats_collection, Integer...IV_EV_Collection) { this.creature = creature_type; if (nickname.length()>0) { this.nickname = nickname; @@ -61,8 +69,13 @@ public class MegamonPet { this.original_trainer = original_trainer; this.original_trainer_name = original_trainer_name; InitializeStats(stats_collection,IV_EV_Collection); + LearnDefaultMoves(); } + private void LearnDefaultMoves() { + // TODO Auto-generated method stub + } + private void InitializeStats(Integer[] stats_collection, Integer[] IV_EV_Collection) { /*if (stats_collection.length<6) { //System.out.println("WARNING! Malformed stats array! Will fill in with defaults."); @@ -119,6 +132,238 @@ public class MegamonPet { return (int)(((((base+iv)*2)+(Math.sqrt(ev)/4))*lv)/100)+5; } + public MegamonCreature getCreature() { + return creature; + } + + public NonVolatileStatus getStatus() { + return status; + } + + public VolatileStatus getBattleStatus() { + return battlestatus; + } + + public Integer getATKModifier() { + return atk_modifier; + } + + public Integer getDEFModifier() { + return def_modifier; + } + + public Integer getSPDModifier() { + return spd_modifier; + } + + public Integer getSPCModifier() { + return spc_modifier; + } + + public Integer getEVAModifier() { + return eva_modifier; + } + + public Integer getACCModifier() { + return acc_modifier; + } + + public Integer getATKIV() { + return atk_iv; + } + + public Integer getDEFIV() { + return def_iv; + } + + public Integer getSPDIV() { + return spd_iv; + } + + public Integer getSPCIV() { + return spc_iv; + } + + public Integer getATKEV() { + return atk_ev; + } + + public Integer getDEFEV() { + return def_ev; + } + + public Integer getSPDEV() { + return spd_ev; + } + + public Integer getSPCEV() { + return spc_ev; + } + + public Integer getHPEV() { + return hp_ev; + } + + public Integer getHP() { + return hp; + } + + public Integer getMaxHP() { + return maxhp; + } + + public Integer getATK() { + return atk; + } + + public Integer getDEF() { + return def; + } + + public Integer getSPD() { + return spd; + } + + public Integer getSPC() { + return spc; + } + + public String getNickname() { + return nickname; + } + + public Integer getOriginalTrainerID() { + return original_trainer; + } + + public String getOriginalTrainerName() { + return original_trainer_name; + } + + public Integer getLevel() { + return level; + } + + public Integer getHPIV() { + return hp_iv; + } + + public void setCreature(MegamonCreature creature) { + this.creature = creature; + } + + public void setStatus(NonVolatileStatus status) { + this.status = status; + } + + public void setBattleStatus(VolatileStatus battlestatus) { + this.battlestatus = battlestatus; + } + + public void setATKModifier(Integer atk_modifier) { + this.atk_modifier = atk_modifier; + } + + public void setDEFModifier(Integer def_modifier) { + this.def_modifier = def_modifier; + } + + public void setSPDModifier(Integer spd_modifier) { + this.spd_modifier = spd_modifier; + } + + public void setSPCModifier(Integer spc_modifier) { + this.spc_modifier = spc_modifier; + } + + public void setEVAModifier(Integer eva_modifier) { + this.eva_modifier = eva_modifier; + } + + public void setACCModifier(Integer acc_modifier) { + this.acc_modifier = acc_modifier; + } + + public void setATKIV(Integer atk_iv) { + this.atk_iv = atk_iv; + } + + public void setDEFIV(Integer def_iv) { + this.def_iv = def_iv; + } + + public void setSPDIV(Integer spd_iv) { + this.spd_iv = spd_iv; + } + + public void setSPCIV(Integer spc_iv) { + this.spc_iv = spc_iv; + } + + public void setATKEV(Integer atk_ev) { + this.atk_ev = atk_ev; + } + + public void setDEFEV(Integer def_ev) { + this.def_ev = def_ev; + } + + public void setSPDEV(Integer spd_ev) { + this.spd_ev = spd_ev; + } + + public void setSPCEV(Integer spc_ev) { + this.spc_ev = spc_ev; + } + + public void setHPEV(Integer hp_ev) { + this.hp_ev = hp_ev; + } + + public void setHP(Integer hp) { + this.hp = hp; + } + + public void setMaxHP(Integer maxhp) { + this.maxhp = maxhp; + } + + public void setATK(Integer atk) { + this.atk = atk; + } + + public void setDEF(Integer def) { + this.def = def; + } + + public void setSPD(Integer spd) { + this.spd = spd; + } + + public void setSPC(Integer spc) { + this.spc = spc; + } + + public void setNickname(String nickname) { + this.nickname = nickname; + } + + public void setOriginalTrainerID(Integer original_trainer) { + this.original_trainer = original_trainer; + } + + public void setOriginalTrainerName(String original_trainer_name) { + this.original_trainer_name = original_trainer_name; + } + + public void setLevel(Integer level) { + this.level = level; + } + + public void setHPIV(Integer hp_iv) { + this.hp_iv = hp_iv; + } + public String toString() { StringBuilder sb = new StringBuilder(this.getClass().getSimpleName()+"("); boolean first=true; diff --git a/Megamon-core/src/sig/megamon/Player.java b/Megamon-core/src/sig/megamon/Player.java index 1536b6c..30d6020 100644 --- a/Megamon-core/src/sig/megamon/Player.java +++ b/Megamon-core/src/sig/megamon/Player.java @@ -22,7 +22,7 @@ public class Player { Point2D.Double direction = new Point2D.Double(0,0); Point2D.Double lastdirection = new Point2D.Double(0,1); Texture sprite; - List megamon_party = new ArrayList(); + private List megamon_party = new ArrayList(); int trainer_id; String name; @@ -89,4 +89,12 @@ public class Player { public void draw(SpriteBatch batch) { batch.draw(sprite, (int)GraphicUtils.getPlayerPixelPosition(Megamon.camera).getX(), (int)GraphicUtils.getPlayerPixelPosition(Megamon.camera).getY(), (int)GraphicUtils.getTileSize(Megamon.camera).getX(), (int)GraphicUtils.getTileSize(Megamon.camera).getY()); } + + public void addMegamonToParty(MegamonPet megamon) { + megamon_party.add(megamon); + } + + public List getMegamonParty() { + return megamon_party; + } } diff --git a/Megamon-core/src/sig/megamon/creature/CreatureMove.java b/Megamon-core/src/sig/megamon/creature/CreatureMove.java index cfc8156..0f8c7d2 100644 --- a/Megamon-core/src/sig/megamon/creature/CreatureMove.java +++ b/Megamon-core/src/sig/megamon/creature/CreatureMove.java @@ -3,18 +3,23 @@ package sig.megamon.creature; import java.lang.reflect.Field; public class CreatureMove { - int lvLearned=0; String name=""; String desc=""; CreatureType type; Category cat; + int pp; + int accuracy; + int power; - public CreatureMove(String name, String description, int levelLearned, CreatureType type, Category category) { + public CreatureMove(String name, String description, CreatureType type, Category category, + int initialPP, int power, int accuracy) { this.name=name; this.desc=description; - this.lvLearned=levelLearned; this.type=type; this.cat=category; + this.pp=initialPP; + this.power = power; + this.accuracy = accuracy; } public String toString() { diff --git a/Megamon-core/src/sig/megamon/creature/CreatureMoveLinker.java b/Megamon-core/src/sig/megamon/creature/CreatureMoveLinker.java new file mode 100644 index 0000000..48ba65c --- /dev/null +++ b/Megamon-core/src/sig/megamon/creature/CreatureMoveLinker.java @@ -0,0 +1,11 @@ +package sig.megamon.creature; + +public class CreatureMoveLinker { + CreatureMove move; + int lvLearned=0; + + public CreatureMoveLinker(CreatureMove move, int lvLearnedAt) { + this.move=move; + this.lvLearned=lvLearnedAt; + } +} diff --git a/Megamon-core/src/sig/megamon/creature/Evolution.java b/Megamon-core/src/sig/megamon/creature/Evolution.java new file mode 100644 index 0000000..74bffc6 --- /dev/null +++ b/Megamon-core/src/sig/megamon/creature/Evolution.java @@ -0,0 +1,19 @@ +package sig.megamon.creature; + +import sig.megamon.MegamonCreature; + +public class Evolution { + MegamonCreature creature; + int level; + boolean trade; + + public Evolution(MegamonCreature creatureEvolvesInto, int levelOfEvolution) { + this(creatureEvolvesInto,levelOfEvolution,false); + } + + public Evolution(MegamonCreature creatureEvolvesInto, int levelOfEvolution, boolean tradeRequired) { + this.creature = creatureEvolvesInto; + this.level = levelOfEvolution; + this.trade = tradeRequired; + } +} diff --git a/Megamon-core/src/sig/megamon/menu/MegadexMenu.java b/Megamon-core/src/sig/megamon/menu/MegadexMenu.java new file mode 100644 index 0000000..09e8ad8 --- /dev/null +++ b/Megamon-core/src/sig/megamon/menu/MegadexMenu.java @@ -0,0 +1,5 @@ +package sig.megamon.menu; + +public class MegadexMenu { + +} diff --git a/Megamon-core/src/sig/megamon/menu/MegamonPartyScreen.java b/Megamon-core/src/sig/megamon/menu/MegamonPartyScreen.java new file mode 100644 index 0000000..db6bde0 --- /dev/null +++ b/Megamon-core/src/sig/megamon/menu/MegamonPartyScreen.java @@ -0,0 +1,99 @@ +package sig.megamon.menu; + +import com.badlogic.gdx.Gdx; +import com.badlogic.gdx.graphics.Color; +import com.badlogic.gdx.graphics.GL20; +import com.badlogic.gdx.graphics.Texture; +import com.badlogic.gdx.graphics.g2d.SpriteBatch; +import com.badlogic.gdx.utils.Align; + +import sig.megamon.Megamon; +import sig.megamon.MegamonPet; + +public class MegamonPartyScreen { + static Color backgroundColor = new Color(63/255f,72/255f,204/255f,1); + static Texture party_window = new Texture("interface/megamon_party.png"); + static Texture party_window_selection = new Texture("interface/megamon_party_selection.png"); + int selection = 0; + final static int MEGAMON_SLOT_SPACING = 140; + final static int WINDOW_MARGIN = 140; + int alpha=0; + final int ALPHA_SPD=4; + boolean alpha_dir=true; + + public MegamonPartyScreen() { + + } + + public void run() { + alpha+=(alpha_dir)?ALPHA_SPD:-ALPHA_SPD; + if (Math.abs(alpha)>=255) { + alpha_dir=!alpha_dir; + } + if (Gdx.input.isKeyJustPressed(Megamon.MOVELEFTKEY)) { + if (selection<3) { + selection = Math.floorMod(selection-1, 3); + } else { + selection = Math.floorMod(selection-4, 3)+3; + } + } + if (Gdx.input.isKeyJustPressed(Megamon.MOVERIGHTKEY)) { + if (selection<3) { + selection = Math.floorMod(selection+1, 3); + } else { + selection = Math.floorMod(selection-2, 3)+3; + } + } + if (Gdx.input.isKeyJustPressed(Megamon.MOVEUPKEY)) { + selection = Math.floorMod(selection-3, 6); + } + if (Gdx.input.isKeyJustPressed(Megamon.MOVEDOWNKEY)) { + selection = Math.floorMod(selection+3, 6); + } + if (Gdx.input.isKeyJustPressed(Megamon.CANCELKEY) || + Gdx.input.isKeyJustPressed(Megamon.MENUKEY)) { + Megamon.partyscreen=null; + return; + } + } + + public void draw(SpriteBatch batch) { + Gdx.gl.glClearColor(backgroundColor.r,backgroundColor.g,backgroundColor.b,backgroundColor.a); + Gdx.gl.glClear(GL20.GL_COLOR_BUFFER_BIT); + int i=0; + batch.draw(party_window, 0, 0); + + batch.setColor(new Color(1,1,1,Math.abs(alpha)/255f)); + batch.draw(party_window_selection, + WINDOW_MARGIN + ((selection%3)*MEGAMON_SLOT_SPACING)-36, + (int)(Megamon.WINDOW_HEIGHT/(selection>2?1.9:1.1))-party_window_selection.getHeight()-32); + batch.setColor(new Color(1,1,1,1)); + for (MegamonPet mp : Megamon.mainP.getMegamonParty()) { + batch.draw( + mp.getCreature().getSprites().getMiniIcon(), + WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING)+4,(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1)-64)); + Megamon.font.draw(batch, "Lv", + WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING),(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1))- + mp.getCreature().getSprites().getMiniIcon().getHeight()*2-40); + DialogBox.messageboxfont.draw(batch, Integer.toString(mp.getLevel()), + WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING),(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1))- + mp.getCreature().getSprites().getMiniIcon().getHeight()*2-72,24,Align.center,false); + DialogBox.messageboxfont.draw(batch, mp.getHP()+"/"+mp.getMaxHP(), + WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING),(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1))- + mp.getCreature().getSprites().getMiniIcon().getHeight()*2-96,24,Align.center,false); + if ((float)mp.getHP()/mp.getMaxHP()<0.3) { + batch.setColor(Color.RED); + } + batch.draw(Megamon.healthbar, + WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING)+ + mp.getCreature().getSprites().getMiniIcon().getWidth()+32, + (int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1)-48-Megamon.healthbar.getHeight()), + 0,0,Megamon.healthbar.getWidth(),Math.max(3,(int)(((float)mp.getHP()/mp.getMaxHP())*Megamon.healthbar.getHeight()))); + batch.setColor(Color.WHITE); + Megamon.font.draw(batch, mp.getNickname(), + WINDOW_MARGIN+((i%3)*MEGAMON_SLOT_SPACING)-24,(int)(Megamon.WINDOW_HEIGHT/(i>2?1.9:1.1)- + mp.getCreature().getSprites().getMiniIcon().getHeight()*2-120),0,mp.getNickname().length(),100,Align.center,true,"..."); + i++; + } + } +} diff --git a/Megamon-core/src/sig/megamon/menu/MenuItem.java b/Megamon-core/src/sig/megamon/menu/MenuItem.java new file mode 100644 index 0000000..c8b17db --- /dev/null +++ b/Megamon-core/src/sig/megamon/menu/MenuItem.java @@ -0,0 +1,21 @@ +package sig.megamon.menu; + +public enum MenuItem { + MEGADEX("Megadex"), + MEGAMON("Megamon"), + BAG("Bag"), + TRAINER(""), + SAVE("Save"), + OPTIONS("Options"), + EXIT("Exit"); + + String displayName; + + MenuItem(String displayName) { + this.displayName = displayName; + } + + public String getDisplayText() { + return this.displayName; + } +} diff --git a/Megamon-core/src/sig/megamon/menu/StartMenuBox.java b/Megamon-core/src/sig/megamon/menu/StartMenuBox.java index e59fe26..c95fcce 100644 --- a/Megamon-core/src/sig/megamon/menu/StartMenuBox.java +++ b/Megamon-core/src/sig/megamon/menu/StartMenuBox.java @@ -12,14 +12,7 @@ public class StartMenuBox { static Texture startmenu_background_top = new Texture("startmenu_box.png"); static Texture startmenu_highlight = new Texture("startmenu_highlight.png"); int selection=0; - String[] menuitems = new String[] - {"Megadex", - "Megamon", - "Bag", - "", - "Save", - "Options", - "Exit"}; + MenuItem[] menuitems = MenuItem.values(); int menuitem_spacing = 28; public StartMenuBox(int cursorStartingPosition) { @@ -35,6 +28,30 @@ public class StartMenuBox { } if (Gdx.input.isKeyJustPressed(Megamon.MENUKEY)) { Megamon.startmenubox=null; + return; + } + if (Gdx.input.isKeyJustPressed(Megamon.ACTIONKEY)) { + switch (menuitems[selection]) { + case MEGADEX: + break; + case MEGAMON: + Megamon.partyscreen = new MegamonPartyScreen(); + break; + case BAG: + break; + case TRAINER: + break; + case OPTIONS: + break; + case SAVE: + break; + case EXIT: + Megamon.startmenubox = null; + break; + } + } + if (Gdx.input.isKeyJustPressed(Megamon.CANCELKEY)) { + Megamon.startmenubox=null; } } @@ -48,11 +65,11 @@ public class StartMenuBox { spacingpixels); batch.draw(startmenu_background_bottom, windowx,menubot-startmenu_background_bottom.getHeight()); int i=0; - for (String s : menuitems) { + for (MenuItem s : menuitems) { if (i==selection) { batch.draw(startmenu_highlight, windowx-4, windowy-((i+1)*menuitem_spacing)+8); } - DialogBox.messageboxfont.draw(batch, s, windowx+28, windowy-(i++*menuitem_spacing)); + DialogBox.messageboxfont.draw(batch, s.getDisplayText(), windowx+28, windowy-(i++*menuitem_spacing)); } Megamon.font.draw(batch, ">", windowx+8, windowy-(selection*menuitem_spacing)+8); }