Skip to content

Commit

Permalink
新增粉球“好兆头”支持
Browse files Browse the repository at this point in the history
  • Loading branch information
Tnze committed Apr 14, 2024
1 parent 814f921 commit a2f3e91
Show file tree
Hide file tree
Showing 10 changed files with 93 additions and 74 deletions.
125 changes: 66 additions & 59 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
{
"name": "ffxiv-best-craft",
"private": true,
"version": "0.13.7",
"version": "0.14.0",
"scripts": {
"dev": "VITE_BESTCRAFT_TARGET=tauri vite",
"build": "VITE_BESTCRAFT_TARGET=tauri vite build",
Expand Down
25 changes: 14 additions & 11 deletions src-libs/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -90,17 +90,20 @@ pub fn simulate_one_step(
});
}
if !matches!(action, Actions::FinalAppraisal | Actions::HeartAndSoul) {
status.condition = if force_success {
Condition::Normal
} else {
ConditionIterator::new(
status.recipe.conditions_flag as i32,
status.attributes.level as i32,
)
.collect::<Vec<_>>()
.choose_weighted(&mut rng, |c| c.1)
.unwrap()
.0
status.condition = match status.condition {
Condition::Good if force_success => Condition::Normal,
Condition::Poor if force_success => Condition::Excellent,
Condition::GoodOmen => Condition::Good,
_ => {
ConditionIterator::new(
status.recipe.conditions_flag as i32,
status.attributes.level as i32,
)
.collect::<Vec<_>>()
.choose_weighted(&mut rng, |c| c.1)
.unwrap()
.0
}
};
}
Ok(SimulateOneStepResult { status, is_success })
Expand Down

0 comments on commit a2f3e91

Please sign in to comment.