Skip to content

Commit

Permalink
Action system rework to enable custom actions
Browse files Browse the repository at this point in the history
  • Loading branch information
KonaeAkira committed Nov 19, 2024
1 parent 0347765 commit 11d1320
Show file tree
Hide file tree
Showing 28 changed files with 1,874 additions and 1,071 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/rust.yml
Original file line number Diff line number Diff line change
Expand Up @@ -16,4 +16,4 @@ jobs:
steps:
- uses: actions/checkout@v3
- name: Run tests
run: cargo test --verbose --release --package simulator --package solvers --package game-data
run: cargo test --verbose --package simulator --package solvers --package game-data
6 changes: 5 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ members = ["simulator", "solvers", "game_data", "raphael-cli"]

[package]
name = "raphael-xiv"
version = "0.14.3"
version = "0.15.0"
edition = "2021"
default-run = "raphael-xiv"

Expand Down Expand Up @@ -37,3 +37,7 @@ path = "src/webworker.rs"

[profile.release]
lto = "fat"

[profile.test]
opt-level = 3
overflow-checks = true
2 changes: 1 addition & 1 deletion game_data/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -77,7 +77,7 @@ pub fn get_game_settings(
base_quality = base_quality * rlvl.quality_mod as f32 / 100.0;
}

let mut allowed_actions = ActionMask::from_level(crafter_stats.level as _);
let mut allowed_actions = ActionMask::all();
if !crafter_stats.manipulation {
allowed_actions = allowed_actions.remove(Action::Manipulation);
}
Expand Down
24 changes: 12 additions & 12 deletions game_data/src/locales.rs
Original file line number Diff line number Diff line change
Expand Up @@ -94,7 +94,7 @@ const fn action_name_en(action: Action) -> &'static str {
Action::Observe => "Observe",
Action::WasteNot => "Waste Not",
Action::Veneration => "Veneration",
Action::StandardTouch | Action::ComboStandardTouch => "Standard Touch",
Action::StandardTouch => "Standard Touch",
Action::GreatStrides => "Great Strides",
Action::Innovation => "Innovation",
Action::WasteNot2 => "Waste Not II",
Expand All @@ -104,7 +104,7 @@ const fn action_name_en(action: Action) -> &'static str {
Action::CarefulSynthesis => "Careful Synthesis",
Action::Manipulation => "Manipulation",
Action::PrudentTouch => "Prudent Touch",
Action::AdvancedTouch | Action::ComboAdvancedTouch => "Advanced Touch",
Action::AdvancedTouch => "Advanced Touch",
Action::Reflect => "Reflect",
Action::PreparatoryTouch => "Preparatory Touch",
Action::Groundwork => "Groundwork",
Expand All @@ -113,7 +113,7 @@ const fn action_name_en(action: Action) -> &'static str {
Action::HeartAndSoul => "Heart and Soul",
Action::PrudentSynthesis => "Prudent Synthesis",
Action::TrainedFinesse => "Trained Finesse",
Action::ComboRefinedTouch => "Refined Touch",
Action::RefinedTouch => "Refined Touch",
Action::ImmaculateMend => "Immaculate Mend",
Action::TrainedPerfection => "Trained Perfection",
Action::TrainedEye => "Trained Eye",
Expand All @@ -129,7 +129,7 @@ const fn action_name_de(action: Action) -> &'static str {
Action::Observe => "Beobachten",
Action::WasteNot => "Nachhaltigkeit",
Action::Veneration => "Ehrfurcht",
Action::StandardTouch | Action::ComboStandardTouch => "Solide Veredelung",
Action::StandardTouch => "Solide Veredelung",
Action::GreatStrides => "Große Schritte",
Action::Innovation => "Innovation",
Action::WasteNot2 => "Nachhaltigkeit II",
Expand All @@ -139,7 +139,7 @@ const fn action_name_de(action: Action) -> &'static str {
Action::CarefulSynthesis => "Sorgfältige Bearbeitung",
Action::Manipulation => "Manipulation",
Action::PrudentTouch => "Nachhaltige Veredelung",
Action::AdvancedTouch | Action::ComboAdvancedTouch => "Höhere Veredelung",
Action::AdvancedTouch => "Höhere Veredelung",
Action::Reflect => "Einkehr",
Action::PreparatoryTouch => "Basisveredelung",
Action::Groundwork => "Vorarbeit",
Expand All @@ -148,7 +148,7 @@ const fn action_name_de(action: Action) -> &'static str {
Action::HeartAndSoul => "Mit Leib und Seele",
Action::PrudentSynthesis => "Rationelle Bearbeitung",
Action::TrainedFinesse => "Götter Werk",
Action::ComboRefinedTouch => "Raffinierte Veredelung",
Action::RefinedTouch => "Raffinierte Veredelung",
Action::ImmaculateMend => "Winkelzug",
Action::TrainedPerfection => "Meisters Beitrag",
Action::TrainedEye => "Flinke Hand",
Expand All @@ -164,7 +164,7 @@ const fn action_name_fr(action: Action) -> &'static str {
Action::Observe => "Observation",
Action::WasteNot => "Parcimonie",
Action::Veneration => "Vénération",
Action::StandardTouch | Action::ComboStandardTouch => "Ouvrage standard",
Action::StandardTouch => "Ouvrage standard",
Action::GreatStrides => "Grands progrès",
Action::Innovation => "Innovation",
Action::WasteNot2 => "Parcimonie pérenne",
Expand All @@ -174,7 +174,7 @@ const fn action_name_fr(action: Action) -> &'static str {
Action::CarefulSynthesis => "Travail prudent",
Action::Manipulation => "Manipulation",
Action::PrudentTouch => "Ouvrage parcimonieux",
Action::AdvancedTouch | Action::ComboAdvancedTouch => "Ouvrage avancé",
Action::AdvancedTouch => "Ouvrage avancé",
Action::Reflect => "Véritable valeur",
Action::PreparatoryTouch => "Ouvrage préparatoire",
Action::Groundwork => "Travail préparatoire",
Expand All @@ -183,7 +183,7 @@ const fn action_name_fr(action: Action) -> &'static str {
Action::HeartAndSoul => "Attention totale",
Action::PrudentSynthesis => "Travail économe",
Action::TrainedFinesse => "Main divine",
Action::ComboRefinedTouch => "Ouvrage raffiné",
Action::RefinedTouch => "Ouvrage raffiné",
Action::ImmaculateMend => "Réparation totale",
Action::TrainedPerfection => "Main suprême",
Action::TrainedEye => "Main preste",
Expand All @@ -199,7 +199,7 @@ const fn action_name_jp(action: Action) -> &'static str {
Action::Observe => "経過観察",
Action::WasteNot => "倹約",
Action::Veneration => "ヴェネレーション",
Action::StandardTouch | Action::ComboStandardTouch => "中級加工",
Action::StandardTouch => "中級加工",
Action::GreatStrides => "グレートストライド",
Action::Innovation => "イノベーション",
Action::WasteNot2 => "長期倹約",
Expand All @@ -209,7 +209,7 @@ const fn action_name_jp(action: Action) -> &'static str {
Action::CarefulSynthesis => "模範作業",
Action::Manipulation => "マニピュレーション",
Action::PrudentTouch => "倹約加工",
Action::AdvancedTouch | Action::ComboAdvancedTouch => "上級加工",
Action::AdvancedTouch => "上級加工",
Action::Reflect => "真価",
Action::PreparatoryTouch => "下地加工",
Action::Groundwork => "下地作業",
Expand All @@ -218,7 +218,7 @@ const fn action_name_jp(action: Action) -> &'static str {
Action::HeartAndSoul => "一心不乱",
Action::PrudentSynthesis => "倹約作業",
Action::TrainedFinesse => "匠の神業",
Action::ComboRefinedTouch => "洗練加工",
Action::RefinedTouch => "洗練加工",
Action::ImmaculateMend => "パーフェクトメンド",
Action::TrainedPerfection => "匠の絶技",
Action::TrainedEye => "匠の早業",
Expand Down
10 changes: 5 additions & 5 deletions game_data/tests/test_get_game_settings.rs
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,7 @@ fn test_roast_chicken() {
base_progress: 264,
base_quality: 274,
job_level: 100,
allowed_actions: ActionMask::from_level(100)
allowed_actions: ActionMask::all()
.remove(Action::TrainedEye)
.remove(Action::HeartAndSoul)
.remove(Action::QuickInnovation),
Expand Down Expand Up @@ -98,7 +98,7 @@ fn test_turali_pineapple_ponzecake() {
base_progress: 280,
base_quality: 355,
job_level: 94,
allowed_actions: ActionMask::from_level(94)
allowed_actions: ActionMask::all()
.remove(Action::TrainedEye)
.remove(Action::QuickInnovation),
adversarial: false,
Expand Down Expand Up @@ -140,7 +140,7 @@ fn test_smaller_water_otter_hardware() {
base_quality: 260,
job_level: 100,
// Trained Eye is not available for expert recipes
allowed_actions: ActionMask::from_level(100)
allowed_actions: ActionMask::all()
.remove(Action::TrainedEye)
.remove(Action::HeartAndSoul)
.remove(Action::QuickInnovation),
Expand Down Expand Up @@ -183,7 +183,7 @@ fn test_grade_8_tincture() {
base_quality: 387,
job_level: 100,
// Trained Eye is available
allowed_actions: ActionMask::from_level(100).remove(Action::QuickInnovation),
allowed_actions: ActionMask::all().remove(Action::QuickInnovation),
adversarial: false,
}
);
Expand Down Expand Up @@ -218,7 +218,7 @@ fn test_claro_walnut_spinning_wheel() {
base_progress: 241,
base_quality: 304,
job_level: 99,
allowed_actions: ActionMask::from_level(99)
allowed_actions: ActionMask::all()
.remove(Action::TrainedEye)
.remove(Action::HeartAndSoul),
adversarial: false,
Expand Down
Loading

0 comments on commit 11d1320

Please sign in to comment.