File tree Expand file tree Collapse file tree
src/main/java/FortuneMonBackEnd/fortuneMon/service Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -47,7 +47,8 @@ public UserPokemonDTO openMonsterBall(Long ballId){
4747 double rand = Math .random ();
4848 double cumulative = 0.0 ;
4949 PokemonBallRate pokemonRate = null ;
50- List <PokemonBallRate > rates = pokemonBallRateRepository .findAllByBallId (ballId );
50+ UserBall openBall = userMonsterBallRepository .findById (ballId ).orElse (null );
51+ List <PokemonBallRate > rates = pokemonBallRateRepository .findAllByBallId (openBall .getMonsterBall ().getId ());
5152
5253 for (PokemonBallRate rate : rates ){
5354 cumulative += rate .getProbability ();
@@ -60,6 +61,7 @@ public UserPokemonDTO openMonsterBall(Long ballId){
6061 return null ;
6162 }
6263 Pokemon pokemon = pokemonRepository .findById (pokemonRate .getPokemonId ()).orElse (null );
64+ openBall .setOpen (true ); // 볼 사용 표시
6365
6466 Long userId = SecurityUtil .getCurrentUserId ();
6567 User user = userRepository .findById (userId ).orElse (null );
You can’t perform that action at this time.
0 commit comments