Skip to content
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

[SwordWorld/SwordWorld2.0/SwordWorld2.5] Result対応 #424

Merged
merged 4 commits into from
Apr 21, 2021

Conversation

h-mikisato
Copy link
Contributor

#423 の SwordWorld/SwordWorld2.0/SwordWorld2.5 対応です。
威力表のクリファン対応および、2.0の超越判定の成功失敗/クリファン対応となります
通常の2d6は既に対応済みでした。

@codecov
Copy link

codecov bot commented Apr 20, 2021

Codecov Report

Merging #424 (2e68960) into master (2df3312) will increase coverage by 0.00%.
The diff coverage is 100.00%.

❗ Current head 2e68960 differs from pull request most recent head 92b14f0. Consider uploading reports for the commit 92b14f0 to get more accurate results
Impacted file tree graph

@@           Coverage Diff           @@
##           master     #424   +/-   ##
=======================================
  Coverage   95.14%   95.15%           
=======================================
  Files         286      286           
  Lines       18471    18485   +14     
=======================================
+ Hits        17575    17589   +14     
  Misses        896      896           
Impacted Files Coverage Δ
lib/bcdice/game_system/SwordWorld.rb 97.35% <100.00%> (+0.09%) ⬆️
...cdice/game_system/sword_world/transcendent_test.rb 100.00% <100.00%> (ø)

Continue to review full report at Codecov.

Legend - Click here to learn more
Δ = absolute <relative> (impact), ø = not affected, ? = missing data
Powered by Codecov. Last update 2df3312...92b14f0. Read the comment docs.

Copy link
Member

@ysakasin ysakasin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

ありがとうございます。何点かコメントしましたので修正お願いします。

Comment on lines 8 to 13
NO_TARGET = 0
SUCCESS = 1
FAILURE = 2
SUPER_SUCCESS = 3
CRITICAL = 4
FUMBLE = 5
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

enum的な利用をする場合、IntegerではなくSymbolを定数の値としてください。

@@ -301,6 +309,7 @@ def rollDice(_command)
# @param rateResults [Array<String>]
# @param dice_total [Integer]
# @param round [Integer]
# @return [Array<String, Boolean>] output, critical, fumble
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# @return [Array<String, Boolean>] output, critical, fumble
# @return [Array(String, Boolean, Boolean)] output, critical, fumble

YARDではArrayをTupleのように使う場合このように書きます。

def result_str(total_sum, n_value_groups, fumble, critical)
return "自動的失敗" if fumble
return "自動的成功" if critical
# @return [Integer]
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
# @return [Integer]
# @return [Symbol]

Copy link
Member

@ysakasin ysakasin left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

👍

@ysakasin
Copy link
Member

そこまでせずとも NO_TARGET = :no_target みたいな書き方でよかったのですが真意を伝えるのって難しいですね。

@ysakasin ysakasin merged commit 738b1b3 into bcdice:master Apr 21, 2021
@h-mikisato h-mikisato deleted the feature/sword_world_result branch November 27, 2022 16:24
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants