pub struct GroundModeContext(_);
Expand description

Misc. and general ground mode functions, guarded by this struct.

Implementations§

source§

impl GroundModeContext

source

pub unsafe fn script_special_process_call( &mut self, param_1: *mut undefined4, id: SpecialProcessId, arg1: i32, arg2: i32 ) -> i32

Processes calls to the ScriptOpcodeId::OPCODE_PROCESS_SPECIAL script opcode.

Returns result value of the special process if it has one, otherwise 0.

Some built-in special processes include:

Arguments
Safety

The caller must make sure the undefined params are valid for this function.

source

pub unsafe fn get_special_recruitment_species( &self, index: i32 ) -> MonsterSpeciesId

Returns an entry from RECRUITMENT_TABLE_SPECIES.

Safety

This indexes without doing bounds checking.

source

pub fn prepare_menu_accept_team_member(&mut self, idx: i32)

Implements SPECIAL_PROC_PREPARE_MENU_ACCEPT_TEAM_MEMBER.

idx is an index into the RECRUITMENT_TABLE_SPECIES.

source

pub unsafe fn init_random_npc_jobs( &mut self, job_type: i32, param_2: undefined2 )

Implements SPECIAL_PROC_INIT_RANDOM_NPC_JOBS.

Arguments
  • job_type - job type? 0 is a random NPC job, 1 is a bottle mission
  • param_2 - ???
Safety

The caller must make sure the undefined params are valid for this function.

source

pub fn get_random_npc_job_type(&self) -> i32

Implements SPECIAL_PROC_GET_RANDOM_NPC_JOB_TYPE.

source

pub fn get_random_npc_job_subtype(&self) -> i32

Implements SPECIAL_PROC_GET_RANDOM_NPC_JOB_SUBTYPE.

source

pub fn is_random_npc_job_still_available(&self) -> bool

Implements SPECIAL_PROC_GET_RANDOM_NPC_JOB_STILL_AVAILABLE.

source

pub fn accept_random_npc_job(&mut self) -> bool

Implements SPECIAL_PROC_ACCEPT_RANDOM_NPC_JOB.

source

pub fn return_dungeon(&mut self)

Implements SPECIAL_PROC_RETURN_DUNGEON.

source

pub fn next_day(&mut self)

Implements SPECIAL_PROC_NEXT_DAY.

source

pub fn jump_to_title_screen(&mut self, arg: i32) -> bool

Fades the screen out and throws the player to the title screen.

Implements SPECIAL_PROC_JUMP_TO_TITLE_SCREEN and SPECIAL_PROC_0x1A.

arg is argument value for SPECIAL_PROC_JUMP_TO_TITLE_SCREEN and -1 for SPECIAL_PROC_0x1A. It is probably the screen fade out time…?

source

pub fn return_to_title_screen(&mut self, fade_duration: u32) -> bool

Fades the screen out and throws the player to the title screen.

Implements SPECIAL_PROC_RETURN_TO_TITLE_SCREEN.

source

pub fn script_special_process_x16(&mut self, param_1: bool)

Implements SPECIAL_PROC_0x16.

source

pub fn status_update(&mut self)

Implements SPECIAL_PROC_STATUS_UPDATE.

source

pub fn get_alloc_arena_ground( &self, arena: *mut mem_arena, flags: u32 ) -> *mut mem_arena

Returns the memory allocation arena for ground mode.

You can use this with crate::allocation::EoSCustomAllocator.

Parameters
  • size - initial memory arena pointer, or null.
  • flags - MemAlloc flags.
source

pub fn get_free_arena_ground( &self, arena: *mut mem_arena, flags: u32 ) -> *mut mem_arena

Returns the memory freeing arena for ground mode.

You can use this with crate::allocation::EoSCustomAllocator.

Parameters
  • size - initial memory arena pointer, or null.
  • flags - MemAlloc flags.
source

pub unsafe fn load_background_attributes( &mut self, output: *mut c_char, bg_id: i32 )

No description available.

Note: unverified, ported from Irdkwia’s notes

Safety

Passes the pointers to the game’s function, unchecked.

source

pub unsafe fn load_map_type_10( &mut self, buf: *mut c_void, map_id: i32, dungeon_info_str: *mut undefined, additional_info: undefined4 )

No description available.

Note: unverified, ported from Irdkwia’s notes

Safety

Passes the pointers to the game’s function, unchecked. Contains undefined parameters.

source

pub unsafe fn load_map_type_11( &mut self, buf: *mut c_void, map_id: i32, dungeon_info_str: *mut undefined, additional_info: undefined4 )

No description available.

Note: unverified, ported from Irdkwia’s notes

Safety

Passes the pointers to the game’s function, unchecked. Contains undefined parameters.

source

pub unsafe fn get_special_layout_background( &mut self, bg_id: i32, dungeon_info_str: *mut undefined, additional_info: undefined4, copy_fixed_room_layout: bool )

No description available.

Note: unverified, ported from Irdkwia’s notes

Safety

Passes the pointers to the game’s function, unchecked. Contains undefined parameters.

Trait Implementations§

source§

impl CreatableWithLease<11> for GroundModeContext

source§

fn lease(&self) -> &OverlayLoadLease<11>

Returns a reference to the overlay lease.
source§

fn new(lease: OverlayLoadLease<N>) -> Self

Create a new instance by providing a lease. Read more
source§

fn new_checked() -> Self

Create a new instance by checking if the overlay is loaded and acquiring a lease on it. This will panic if the overlay is not loaded. Read more
source§

unsafe fn new_unchecked() -> Self

Create a new lease. Read more

Auto Trait Implementations§

§

impl RefUnwindSafe for GroundModeContext

§

impl Send for GroundModeContext

§

impl Sync for GroundModeContext

§

impl Unpin for GroundModeContext

§

impl UnwindSafe for GroundModeContext

Blanket Implementations§

§

impl<T> Any for Twhere T: 'static + ?Sized,

§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Az for T

source§

fn az<Dst>(self) -> Dstwhere T: Cast<Dst>,

Casts the value.
§

impl<T> Borrow<T> for Twhere T: ?Sized,

§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
§

impl<T> BorrowMut<T> for Twhere T: ?Sized,

§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<Src, Dst> CastFrom<Src> for Dstwhere Src: Cast<Dst>,

source§

fn cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> CheckedAs for T

source§

fn checked_as<Dst>(self) -> Option<Dst>where T: CheckedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> CheckedCastFrom<Src> for Dstwhere Src: CheckedCast<Dst>,

source§

fn checked_cast_from(src: Src) -> Option<Dst>

Casts the value.
§

impl<T> From<T> for T

§

fn from(t: T) -> T

Returns the argument unchanged.

§

impl<T, U> Into<U> for Twhere U: From<T>,

§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of [From]<T> for U chooses to do.

source§

impl<Src, Dst> LosslessTryInto<Dst> for Srcwhere Dst: LosslessTryFrom<Src>,

source§

fn lossless_try_into(self) -> Option<Dst>

Performs the conversion.
source§

impl<Src, Dst> LossyInto<Dst> for Srcwhere Dst: LossyFrom<Src>,

source§

fn lossy_into(self) -> Dst

Performs the conversion.
source§

impl<T> OverflowingAs for T

source§

fn overflowing_as<Dst>(self) -> (Dst, bool)where T: OverflowingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> OverflowingCastFrom<Src> for Dstwhere Src: OverflowingCast<Dst>,

source§

fn overflowing_cast_from(src: Src) -> (Dst, bool)

Casts the value.
source§

impl<T> Same<T> for T

§

type Output = T

Should always be Self
source§

impl<T> SaturatingAs for T

source§

fn saturating_as<Dst>(self) -> Dstwhere T: SaturatingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> SaturatingCastFrom<Src> for Dstwhere Src: SaturatingCast<Dst>,

source§

fn saturating_cast_from(src: Src) -> Dst

Casts the value.
§

impl<T, U> TryFrom<U> for Twhere U: Into<T>,

§

type Error = Infallible

The type returned in the event of a conversion error.
§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
§

impl<T, U> TryInto<U> for Twhere U: TryFrom<T>,

§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
source§

impl<T> UnwrappedAs for T

source§

fn unwrapped_as<Dst>(self) -> Dstwhere T: UnwrappedCast<Dst>,

Casts the value.
source§

impl<Src, Dst> UnwrappedCastFrom<Src> for Dstwhere Src: UnwrappedCast<Dst>,

source§

fn unwrapped_cast_from(src: Src) -> Dst

Casts the value.
source§

impl<T> WrappingAs for T

source§

fn wrapping_as<Dst>(self) -> Dstwhere T: WrappingCast<Dst>,

Casts the value.
source§

impl<Src, Dst> WrappingCastFrom<Src> for Dstwhere Src: WrappingCast<Dst>,

source§

fn wrapping_cast_from(src: Src) -> Dst

Casts the value.