2022-07-18 08:16:47 +00:00
|
|
|
/// The export registry module deals with registering all functions we require in WebAssembly.
|
|
|
|
mod export_registry;
|
2022-08-26 16:23:35 +00:00
|
|
|
/// 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;
|
2022-08-26 16:23:35 +00:00
|
|
|
/// 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;
|
2022-08-26 16:23:35 +00:00
|
|
|
/// 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)]
|
2022-07-18 11:18:11 +00:00
|
|
|
#[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,
|
|
|
|
}
|