pub enum ScriptCommand {
Show 48 variants
ShowText {
text: String,
},
ShowChoice {
options: Vec<String>,
},
GiveItem {
item_id: String,
quantity: u8,
},
GiveMonster {
species: String,
level: u8,
},
TakeItem {
item_id: String,
quantity: u8,
},
SetFlag {
flag: String,
},
ResetFlag {
flag: String,
},
CheckFlag {
flag: String,
},
ShowObject {
object_index: u8,
},
HideObject {
object_index: u8,
},
ShowObjectByName {
toggle_id: String,
},
HideObjectByName {
toggle_id: String,
},
MoveNpc {
npc_id: String,
path: Vec<(u8, u8)>,
},
StartNpcMove {
npc_id: String,
path: Vec<(u8, u8)>,
},
AwaitNpcMove {
npc_id: String,
},
MovePlayer {
path: Vec<(u8, u8)>,
},
MovePlayerRelative {
steps: Vec<(i16, i16)>,
},
MoveNpcTo {
npc_id: String,
x: u8,
y: u8,
},
StartNpcMoveTo {
npc_id: String,
x: u8,
y: u8,
},
MovePlayerTo {
x: u8,
y: u8,
},
FaceNpc {
npc_id: String,
direction: String,
},
FacePlayer {
direction: String,
},
PlayMusic {
music_id: String,
},
PlaySound {
sound_id: String,
},
StopMusic,
FadeOutMusic,
StartBattle {
trainer_id: String,
},
StartWildBattle {
species: String,
level: u8,
},
SetWeather {
weather: Option<String>,
},
Delay {
frames: u16,
},
WarpTo {
map: String,
x: u8,
y: u8,
},
Heal,
FadeScreen {
fade_type: String,
},
SetJoyIgnore {
mask: u8,
},
ClearJoyIgnore,
FollowNpc {
npc_id: String,
target_x: u8,
target_y: u8,
},
OpenShop {
items: Vec<String>,
},
ShowEmotionBubble {
npc_id: String,
emotion: String,
},
SetNpcPosition {
npc_id: String,
x: u8,
y: u8,
},
SetNpcFrame {
npc_id: String,
frame: u8,
},
ShowScene {
scene_name: String,
layout_json: Option<String>,
},
HideScene {
scene_name: String,
},
UpdateUI {
scene_name: String,
data_json: String,
},
GiveMoney {
amount: u32,
},
TakeMoney {
amount: u32,
},
PlayCry {
species: String,
},
GiveBadge {
badge: u8,
},
Custom {
name: String,
args: Vec<Value>,
},
}Variants§
ShowText
ShowChoice
GiveItem
GiveMonster
TakeItem
SetFlag
ResetFlag
CheckFlag
ShowObject
HideObject
ShowObjectByName
HideObjectByName
MoveNpc
StartNpcMove
AwaitNpcMove
MovePlayer
MovePlayerRelative
Relative player steps: each entry is a (dx, dy) delta applied cumulatively from the player’s current position. Direction strings (“up”/“down”/“left”/“right”) are converted to unit deltas at parse time.
MoveNpcTo
StartNpcMoveTo
MovePlayerTo
FaceNpc
FacePlayer
PlayMusic
PlaySound
StopMusic
FadeOutMusic
StartBattle
StartWildBattle
Start a wild/static battle against a single generated opponent of the given species and level (catchable, like a random encounter). Resolves to the battle outcome string (“win” | “lose” | “caught” | “fled” | …).
SetWeather
Arm the battle-local weather for the NEXT battle (Some(id) names a
kind: Weather rules.ron record; None clears a previously armed
one). Runner-local: registered by the jrpg runner’s scene engine next
to startBattle, consumed before the battle starts, cleared when the
battle ends. Never saved.
Delay
WarpTo
Heal
FadeScreen
SetJoyIgnore
ClearJoyIgnore
FollowNpc
OpenShop
ShowEmotionBubble
SetNpcPosition
SetNpcFrame
ShowScene
HideScene
UpdateUI
GiveMoney
TakeMoney
PlayCry
GiveBadge
Custom
A game-defined command outside the generic JRPG protocol.
The game registers the JS verb through its ScriptApiRegistrar
(returning this variant with the verb’s name and arguments) and
dispatches on name/args in its own app layer.
Trait Implementations§
Source§impl Clone for ScriptCommand
impl Clone for ScriptCommand
Source§fn clone(&self) -> ScriptCommand
fn clone(&self) -> ScriptCommand
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for ScriptCommand
impl Debug for ScriptCommand
Source§impl<'de> Deserialize<'de> for ScriptCommand
impl<'de> Deserialize<'de> for ScriptCommand
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Source§impl PartialEq for ScriptCommand
impl PartialEq for ScriptCommand
Source§impl Serialize for ScriptCommand
impl Serialize for ScriptCommand
impl StructuralPartialEq for ScriptCommand
Auto Trait Implementations§
impl Freeze for ScriptCommand
impl RefUnwindSafe for ScriptCommand
impl Send for ScriptCommand
impl Sync for ScriptCommand
impl Unpin for ScriptCommand
impl UnsafeUnpin for ScriptCommand
impl UnwindSafe for ScriptCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> DeserializeOwned for Twhere
T: for<'de> Deserialize<'de>,
impl<T> ErasedDestructor for Twhere
T: 'static,
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreimpl<T> MaybeSendSync for T
Source§impl<T> Pipe for Twhere
T: ?Sized,
impl<T> Pipe for Twhere
T: ?Sized,
Source§fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> Rwhere
Self: Sized,
Source§fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> Rwhere
R: 'a,
self and passes that borrow into the pipe function. Read moreSource§fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
Source§fn pipe_borrow_mut<'a, B, R>(
&'a mut self,
func: impl FnOnce(&'a mut B) -> R,
) -> R
fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
Source§fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
self, then passes self.as_ref() into the pipe function.Source§fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
self, then passes self.as_mut() into the pipe
function.Source§fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
self, then passes self.deref() into the pipe function.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
Source§impl<T> Tap for T
impl<T> Tap for T
Source§fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
Borrow<B> of a value. Read moreSource§fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
BorrowMut<B> of a value. Read moreSource§fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
AsRef<R> view of a value. Read moreSource§fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
AsMut<R> view of a value. Read moreSource§fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
Deref::Target of a value. Read moreSource§fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self
.tap() only in debug builds, and is erased in release builds.Source§fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self
.tap_mut() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
.tap_borrow() only in debug builds, and is erased in release
builds.Source§fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
.tap_borrow_mut() only in debug builds, and is erased in release
builds.Source§fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
.tap_ref() only in debug builds, and is erased in release
builds.Source§fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
.tap_ref_mut() only in debug builds, and is erased in release
builds.Source§fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
.tap_deref() only in debug builds, and is erased in release
builds.