PkmnLib_rs/src/script_implementations/wasm/mod.rs

74 lines
1.9 KiB
Rust
Raw Normal View History

2022-07-18 08:16:47 +00:00
/// The export registry module deals with registering all functions we require in WebAssembly.
mod export_registry;
pub(crate) mod extern_ref;
/// The script module deals with the actual running of WASM functions.
pub mod script;
/// The script resolver deals with the loading of scripts.
pub mod script_resolver;
2022-08-20 10:22:12 +00:00
mod temp_wasm_allocator;
mod script_function_cache;
2022-07-18 08:16:47 +00:00
/// The WebAssemblyScriptCapabilities define which functions are implemented on a script. This allows
/// us to not call a function if we do not need to.
#[derive(Debug, Copy, Clone, Ord, PartialOrd, Eq, PartialEq, Hash)]
#[allow(missing_docs)]
#[allow(clippy::missing_docs_in_private_items)]
2022-07-18 08:16:47 +00:00
pub enum WebAssemblyScriptCapabilities {
None = 0,
Initialize = 1,
OnStack,
OnRemove,
OnBeforeTurn,
ChangeAttack,
ModifyNumberOfHits,
PreventAttack,
FailAttack,
StopBeforeAttack,
OnBeforeAttack,
FailIncomingAttack,
IsInvulnerable,
OnAttackMiss,
ChangeAttackType,
ChangeEffectiveness,
BlockCritical,
OnIncomingHit,
OnFaintingOpponent,
PreventStatBoostChange,
ModifyStatBoostChange,
PreventSecondaryEffects,
OnSecondaryEffect,
OnAfterHits,
PreventSelfSwitch,
ModifyEffectChance,
ModifyIncomingEffectChance,
OverrideBasePower,
ChangeDamageStatsUser,
BypassDefensiveStat,
BypassOffensiveStat,
ModifyStatModifier,
ModifyDamageModifier,
OverrideDamage,
OverrideIncomingDamage,
ChangeSpeed,
ChangePriority,
OnFail,
OnOpponentFail,
PreventRunAway,
PreventOpponentRunAway,
PreventOpponentSwitch,
OnEndTurn,
OnDamage,
OnFaint,
OnAfterHeldItemConsume,
PreventIncomingCritical,
ModifyCriticalStage,
OverrideCriticalModifier,
OverrideSTABModifier,
ModifyExperienceGain,
DoesShareExperience,
BlockWeather,
OnSwitchIn,
ModifyOffensiveStatValue,
ModifyDefensiveStatValue,
}