-
Notifications
You must be signed in to change notification settings - Fork 36
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: マナが無くなったら掘れなくするパッシブスキルを追加 #2370
base: 1_18
Are you sure you want to change the base?
feat: マナが無くなったら掘れなくするパッシブスキルを追加 #2370
Conversation
14a859f
to
571abd3
Compare
@rito528 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
develop
ブランチの変更を取り込んでしまっているようなので、 git rebase --rebase-merges 1_18
などを実行して develop
ブランチの変更をコミット履歴から消していただけると助かります🙇♂️🙇♂️
了解です。 |
bb09299
to
509644b
Compare
509644b
to
e7c7cd3
Compare
@rito528 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
一旦2つ変更をお願いします
src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/github/unchama/seichiassist/util/BreakUtil.scala
Outdated
Show resolved
Hide resolved
@rito528 |
...ssist/subsystems/breakskilltriggerconfig/application/actions/BreakSkillTriggerSettings.scala
Outdated
Show resolved
Hide resolved
...ssist/subsystems/breakskilltriggerconfig/application/actions/BreakSkillTriggerSettings.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/github/unchama/seichiassist/subsystems/mana/domain/ManaManipulation.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala
Outdated
Show resolved
Hide resolved
@rito528 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
テーブル構成が変わることで今と実装がかなり変わりそうなので、一度以下の内容の変更をお願いします!
src/main/scala/com/github/unchama/seichiassist/subsystems/mana/domain/ManaManipulation.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/github/unchama/seichiassist/listener/PlayerBlockBreakListener.scala
Outdated
Show resolved
Hide resolved
src/main/resources/db/migration/V1.19.0__Create_break_trigger_preference_table.sql
Outdated
Show resolved
Hide resolved
@rito528 |
...unchama/seichiassist/subsystems/breakskilltriggerconfig/domain/BreakSkillTriggerConfig.scala
Outdated
Show resolved
Hide resolved
...hama/seichiassist/subsystems/breakskilltriggerconfig/domain/BreakSkillTriggerConfigKey.scala
Outdated
Show resolved
Hide resolved
...bsystems/breakskilltriggerconfig/infrastructure/JdbcBreakSkillTriggerConfigPersistence.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/github/unchama/seichiassist/subsystems/mana/domain/ManaAmount.scala
Outdated
Show resolved
Hide resolved
src/main/scala/com/github/unchama/seichiassist/subsystems/mana/domain/ManaManipulation.scala
Outdated
Show resolved
Hide resolved
...ain/scala/com/github/unchama/seichiassist/subsystems/mana/domain/LevelCappedManaAmount.scala
Outdated
Show resolved
Hide resolved
@rito528 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Otherwise LGTM.
再レビュー申請前に sbt scalafixAll; scalafmtAll;
を実行してもらえると助かります!
): RepositoryDefinition[F, Player, Ref[F, BreakSuppressionPreference]] = | ||
RefDictBackedRepositoryDefinition | ||
.usingUuidRefDict[F, Player, BreakSuppressionPreference](persistence)( | ||
BreakSuppressionPreference(doBreakSuppression = false) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
ここは Repository に保存する場合の初期値を示していますが、doBreakSuppression
のデフォルト値が false
であるということがドメインとして定義されているので、そこに合わせると良いと思います!
BreakSuppressionPreference(doBreakSuppression = false) | |
BreakSuppressionPreference.initial |
val doBreakSuppression = DB.readOnly { implicit session => | ||
sql"SELECT do_break_suppression_due_to_mana FROM player_break_suppression_preference WHERE uuid = ${key.toString}" | ||
.map(rs => rs.boolean("do_break_suppression_due_to_mana")) | ||
.single() | ||
} | ||
|
||
doBreakSuppression.map(BreakSuppressionPreference) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
val doBreakSuppression = DB.readOnly { implicit session => | |
sql"SELECT do_break_suppression_due_to_mana FROM player_break_suppression_preference WHERE uuid = ${key.toString}" | |
.map(rs => rs.boolean("do_break_suppression_due_to_mana")) | |
.single() | |
} | |
doBreakSuppression.map(BreakSuppressionPreference) | |
DB.readOnly { implicit session => | |
sql"SELECT do_break_suppression_due_to_mana FROM player_break_suppression_preference WHERE uuid = ${key.toString}" | |
.map(_.boolean("do_break_suppression_due_to_mana")) | |
.single() | |
.map(BreakSuppressionPreference) | |
} |
@@ -21,7 +21,6 @@ case class LevelCappedManaAmount private (manaAmount: ManaAmount, level: SeichiL | |||
)(manaMultiplier: ManaMultiplier): Option[LevelCappedManaAmount] = { | |||
manaAmount.tryUse(amount)(manaMultiplier).map(LevelCappedManaAmount(_, level)) | |||
} | |||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
breakSuppressionPreferenceRepository(player).update(pref => | ||
pref.copy(doBreakSuppression = !pref.doBreakSuppression) | ||
) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
breakSuppressionPreferenceRepository(player).update(pref => | |
pref.copy(doBreakSuppression = !pref.doBreakSuppression) | |
) | |
breakSuppressionPreferenceRepository(player) | |
.update(_.toggleBreakSuppression()) |
originalBreakStopConfig <- breakSuppressionPreferenceAPI.isBreakSuppressionEnabled(player) | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
originalBreakStopConfig <- breakSuppressionPreferenceAPI.isBreakSuppressionEnabled(player) | |
isBreakSuppressionEnabled <- breakSuppressionPreferenceAPI.isBreakSuppressionEnabled(player) |
if (!originalBreakStopConfig) { | ||
SequentialEffect( | ||
MessageEffect(s"${GREEN}マナが切れたらブロック破壊を止めるスキルを有効化しました。"), | ||
FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 1f) | ||
) | ||
} else { | ||
SequentialEffect( | ||
MessageEffect(s"${RED}マナが切れたらブロック破壊を止めるスキルを無効化しました。"), | ||
FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 0.5f) | ||
) | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以下のように書いたほうが、より読みやすくなると思います
if (!originalBreakStopConfig) { | |
SequentialEffect( | |
MessageEffect(s"${GREEN}マナが切れたらブロック破壊を止めるスキルを有効化しました。"), | |
FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 1f) | |
) | |
} else { | |
SequentialEffect( | |
MessageEffect(s"${RED}マナが切れたらブロック破壊を止めるスキルを無効化しました。"), | |
FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 0.5f) | |
) | |
} | |
if (originalBreakStopConfig) { | |
SequentialEffect( | |
MessageEffect(s"${RED}マナが切れたらブロック破壊を止めるスキルを無効化しました。"), | |
FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 0.5f) | |
) | |
} else { | |
SequentialEffect( | |
MessageEffect(s"${GREEN}マナが切れたらブロック破壊を止めるスキルを有効化しました。"), | |
FocusedSoundEffect(Sound.BLOCK_STONE_BUTTON_CLICK_ON, 1f, 1f) | |
) | |
} |
* マナ切れブロック破壊設定が `true` になっている場合、プレイヤーに破壊抑制メッセージを送信する。 | ||
* @param player マナ切れブロック破壊停止設定を取得するプレイヤー | ||
*/ | ||
def isBreakBlockManaFullyConsumed(player: Player): IO[Boolean] = { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
見た限り PlayerBlockBreakListener
内の定義でしか使われていないようなので private
にして良いと思います!(私の見落としだったらそのままで大丈夫です!)
def isBreakBlockManaFullyConsumed(player: Player): IO[Boolean] = { | |
private def isBreakBlockManaFullyConsumed(player: Player): IO[Boolean] = { |
close #1964
このPRの変更点と理由:
主な変更点
補足情報: