PkmnLib_rs/src/script_implementations/wasm/mod.rs

80 lines
2.2 KiB
Rust
Executable File

/// The export registry module deals with registering all functions we require in WebAssembly.
mod export_registry;
/// A hacky extern ref implementation to ensure the client does not do things it is not allowed to do.
pub(crate) mod extern_ref;
/// The script module deals with the actual running of WASM functions.
pub mod script;
/// A cache of all script functions for easy calls
mod script_function_cache;
/// The script resolver deals with the loading of scripts.
pub mod script_resolver;
/// A small simple allocator for use for rapid short lived WASM allocations.
mod temp_wasm_allocator;
/// 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)]
#[repr(u8)]
pub enum WebAssemblyScriptCapabilities {
None = 0,
Initialize = 1,
OnStack,
OnRemove,
OnBeforeTurn,
ChangeMove,
ChangeNumberOfHits,
PreventMove,
FailMove,
StopBeforeMove,
OnBeforeMove,
FailIncomingMove,
IsInvulnerable,
OnMoveMiss,
ChangeMoveType,
ChangeEffectiveness,
BlockCritical,
OnIncomingHit,
OnFaintingOpponent,
PreventStatBoostChange,
ChangeStatBoostChange,
PreventSecondaryEffects,
OnSecondaryEffect,
OnAfterHits,
PreventSelfSwitch,
ChangeEffectChance,
ChangeIncomingEffectChance,
ChangeBasePower,
ChangeDamageStatsUser,
BypassDefensiveStat,
BypassOffensiveStat,
ChangeStatModifier,
ChangeDamageModifier,
ChangeDamage,
ChangeIncomingDamage,
ChangeSpeed,
ChangePriority,
OnFail,
OnOpponentFail,
PreventSelfRunAway,
PreventOpponentRunAway,
PreventOpponentSwitch,
OnEndTurn,
OnDamage,
OnFaint,
OnAfterHeldItemConsume,
BlockIncomingCritical,
ChangeAccuracy,
ChangeCriticalStage,
ChangeCriticalModifier,
ChangeSTABModifier,
ChangeExperienceGain,
DoesShareExperience,
BlockWeather,
OnSwitchIn,
ChangeOffensiveStatValue,
ChangeDefensiveStatValue,
ChangeCaptureRate,
}