PkmnLib_rs/src/script_implementations/wasm/mod.rs

80 lines
2.2 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;
/// A hacky extern ref implementation to ensure the client does not do things it is not allowed to do.
2022-07-18 08:16:47 +00:00
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;
2022-07-18 08:16:47 +00:00
/// 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.
2022-08-20 10:22:12 +00:00
mod temp_wasm_allocator;
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-08-27 16:04:56 +00:00
#[repr(u8)]
2022-07-18 08:16:47 +00:00
pub enum WebAssemblyScriptCapabilities {
None = 0,
Initialize = 1,
OnStack,
OnRemove,
OnBeforeTurn,
2022-08-27 16:04:56 +00:00
ChangeMove,
ChangeNumberOfHits,
PreventMove,
FailMove,
StopBeforeMove,
OnBeforeMove,
FailIncomingMove,
2022-07-18 08:16:47 +00:00
IsInvulnerable,
2022-08-27 16:04:56 +00:00
OnMoveMiss,
ChangeMoveType,
2022-07-18 08:16:47 +00:00
ChangeEffectiveness,
BlockCritical,
OnIncomingHit,
OnFaintingOpponent,
PreventStatBoostChange,
2022-08-27 16:04:56 +00:00
ChangeStatBoostChange,
2022-07-18 08:16:47 +00:00
PreventSecondaryEffects,
OnSecondaryEffect,
OnAfterHits,
PreventSelfSwitch,
2022-08-27 16:04:56 +00:00
ChangeEffectChance,
ChangeIncomingEffectChance,
ChangeBasePower,
2022-07-18 08:16:47 +00:00
ChangeDamageStatsUser,
BypassDefensiveStat,
BypassOffensiveStat,
2022-08-27 16:04:56 +00:00
ChangeStatModifier,
ChangeDamageModifier,
ChangeDamage,
ChangeIncomingDamage,
2022-07-18 08:16:47 +00:00
ChangeSpeed,
ChangePriority,
OnFail,
OnOpponentFail,
2022-08-27 16:04:56 +00:00
PreventSelfRunAway,
2022-07-18 08:16:47 +00:00
PreventOpponentRunAway,
PreventOpponentSwitch,
OnEndTurn,
OnDamage,
OnFaint,
OnAfterHeldItemConsume,
2022-08-27 16:04:56 +00:00
BlockIncomingCritical,
ChangeAccuracy,
ChangeCriticalStage,
ChangeCriticalModifier,
ChangeSTABModifier,
ChangeExperienceGain,
2022-07-18 08:16:47 +00:00
DoesShareExperience,
BlockWeather,
OnSwitchIn,
2022-08-27 16:04:56 +00:00
ChangeOffensiveStatValue,
ChangeDefensiveStatValue,
ChangeCaptureRate,
2022-07-18 08:16:47 +00:00
}