-
Notifications
You must be signed in to change notification settings - Fork 48
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
Feature/synthesize simulator #3064
Feature/synthesize simulator #3064
Conversation
# Conflicts: # Lib9c/Action/Synthesize.cs
…ynthesize-simulator # Conflicts: # Lib9c/Action/Synthesize.cs
// TODO: subType별로 필요한 아이템 개수가 다를 수 있음 | ||
var requiredCount = synthesizeRow.RequiredCount; | ||
var synthesizeCount = materialCount / requiredCount; | ||
var remainder = materialCount % requiredCount; |
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.
나머지가 0이 아닌 경우에도 실패하면 무조건 딱 맞는 숫자를 넣어줘야하는것처럼 보이는데, 이 계산은 클라이언트단에서 해주는건가요? synthesizeCount만 세고 넘치는 경우엔 시행을 안하면 되는거 아닌가 싶기도..
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.
클라이언트에서 커버하고 있습니다. 넘치는 케이스는 어찌할지 생각 해보겠습니다
Lib9c/Helper/SynthesizeSimulator.cs
Outdated
var synthesizeCount = materialCount / requiredCount; | ||
var remainder = materialCount % requiredCount; | ||
|
||
if (synthesizeCount <= 0 || remainder > 0) |
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.
remainder가 -인 경우에 넘어갈 수 있을것같습니다.
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.
remainder가 0이 아닌 경우에 예외에 걸리도록 체크해놨습니다
Lib9c/Helper/SynthesizeSimulator.cs
Outdated
throw new InvalidOperationException("Failed to select a synthesized item."); | ||
} | ||
|
||
private static ItemBase GetRandomEquipment(Grade grade, ItemSubType itemSubType, Sheets sheets, IRandom random) |
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.
장비의 경우엔 스킬이나 스탯등의 옵션을 붙여야 할텐데, 합성한 필요한 레시피를 풀에서 뽑아오고 CombinationEquipment나 Summon 액션에서 생성하는 방식을 재활용하는게 어떨까 싶네요.
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.
이 부분 고려 못했는데 말씀주신대로 처리 방법을 찾아봐야 할 것 같습니다.
…ubtype # Conflicts: # Lib9c/Helper/SynthesizeSimulator.cs # Lib9c/TableCSV/Item/SynthesizeSheet.csv # Lib9c/TableData/Item/SynthesizeSheet.cs
@@ -21,6 +21,10 @@ public struct SynthesizeResult | |||
{ | |||
public ItemBase ItemBase; | |||
public bool IsSuccess; | |||
public int RecipeId; | |||
public int SubRecipeId; |
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.
조합과 스펙이 같다면 SubRecipeId는 nullable일것같습니다.
synthesize simulator를 추가합니다
테스트 구현을 추가하기 전 코드정리 성격에 가까운 pr입니다
아래 pr의 코드의 로직과 거의 동일하며, Synthesize에 있던 구현을 SynthesizeSimulator로 옮겼습니다.
아래 pr이 close되어 다시 생성하였습니다
#3011