From be63bc76fa5e276f8f48ad8fb65648c531c68a14 Mon Sep 17 00:00:00 2001 From: wormtql <584130248@qq.com> Date: Mon, 18 Mar 2024 23:55:24 +0800 Subject: [PATCH] feat: Add some allow statements to make the compiler happy --- mona_core/src/lib.rs | 4 ++++ mona_dsl/source/test.mona | 5 +++-- mona_dsl/src/bin/test_damage.rs | 5 +++-- mona_wasm/Cargo.toml | 1 + mona_wasm/src/bin/test_dsl.rs | 9 ++++----- 5 files changed, 15 insertions(+), 9 deletions(-) diff --git a/mona_core/src/lib.rs b/mona_core/src/lib.rs index b5620fd2..191f6f9c 100644 --- a/mona_core/src/lib.rs +++ b/mona_core/src/lib.rs @@ -1,6 +1,10 @@ #![allow(unused_imports)] #![allow(unused_variables)] +#![allow(unreachable_patterns)] #![allow(clippy::approx_constant)] +#![allow(unused_mut)] +#![allow(unused_assignments)] +#![allow(dead_code)] #![feature(decl_macro)] #[macro_use] extern crate pest_derive; diff --git a/mona_dsl/source/test.mona b/mona_dsl/source/test.mona index 3ded197d..7215f5fc 100644 --- a/mona_dsl/source/test.mona +++ b/mona_dsl/source/test.mona @@ -1,3 +1,4 @@ -dmg x = KamisatoAyaka.Normal1({ fumo: "Electro" }) +dmg x=Yelan.E1 //E伤害 -print("123") \ No newline at end of file +result=x.normal.e //E最大期望伤害 +print(result) \ No newline at end of file diff --git a/mona_dsl/src/bin/test_damage.rs b/mona_dsl/src/bin/test_damage.rs index 3fe065da..51a3e0d0 100644 --- a/mona_dsl/src/bin/test_damage.rs +++ b/mona_dsl/src/bin/test_damage.rs @@ -55,12 +55,13 @@ fn main() { // println!("{}", code); let character: Character = Character::new( - CharacterName::KamisatoAyaka, + CharacterName::Yelan, 90, false, 0, 8, 8, 8, - &CharacterConfig::NoConfig + &CharacterConfig::NoConfig, + // &CharacterConfig::Neuvillette {current_hp: 100}, ); let weapon = Weapon::new( WeaponName::MistsplitterReforged, diff --git a/mona_wasm/Cargo.toml b/mona_wasm/Cargo.toml index a12cbc74..a1d4ad09 100644 --- a/mona_wasm/Cargo.toml +++ b/mona_wasm/Cargo.toml @@ -15,6 +15,7 @@ lto = true opt-level = 3 strip = true #codegen-units = 1 +#debug = true [dependencies] mona = { path = "../mona_core" } diff --git a/mona_wasm/src/bin/test_dsl.rs b/mona_wasm/src/bin/test_dsl.rs index 6951372a..ea7dcceb 100644 --- a/mona_wasm/src/bin/test_dsl.rs +++ b/mona_wasm/src/bin/test_dsl.rs @@ -25,7 +25,7 @@ fn generate_artifacts() -> Vec { fn main() { let character = Character::new( - CharacterName::KamisatoAyaka, + CharacterName::Yelan, 90, false, 0, @@ -43,10 +43,9 @@ fn main() { ); let target_function: Box = Box::new(TargetFunctionDSL::new(r#" -prop x = KamisatoAyaka.recharge -dmg d = KamisatoAyaka.Q1({ after_dash: true }) -dmg a = KamisatoAyaka.Normal1({ after_dash: true }) -result = 10 * a.n.e + d.n.e * min(x, 1.6) +dmg E=Yelan.E1 //E伤害 + +result=E.normal.e //E最大期望伤害 "#.trim())); let enemy = Enemy::default();