Hola a todos, estoy desarrollando un truco usando Cfru, una de las mecánicas que quiero poner en el juego es navegar sin hm, ser activado por una bandera o un elemento, probé algunos tutoriales pero ninguno funciona en cfru, ¿alguien? ¿Sabes cómo agregar este sistema?
En src\overworld.c
modificarlo codigo para:
if (IsPlayerFacingSurfableFishableWater())
{
if (HasBadgeToUseSurf() || FlagGet(FLAG_USE_SURF_HACK))
{
/*#ifdef ONLY_CHECK_ITEM_FOR_HM_USAGE
item = ITEM_HM03_SURF;
#endif
*/
u8 partyId = PartyHasMonWithFieldMovePotential(MOVE_NONE, item, SHOULDNT_BE_SURFING);
if (partyId < PARTY_SIZE
&& (!gFollowerState.inProgress || gFollowerState.flags & FOLLOWER_FLAG_CAN_SURF))
{
#ifdef FLAG_USE_SURF_HACK
Var8004 = partyId;
return EventScript_CanSurf_Hack;
#endif
Var8004 = partyId;
return EventScript_UseSurf;
}
if (IsCurrentAreaSwamp())
return EventScript_WaterMurkyBrown;
else
return EventScript_WaterDyedBlue;
}
}
assembly\overworld_scripts\system_scripts.s
debajo del script de surf:
.global EventScript_CanSurf_Hack
EventScript_CanSurf_Hack:
compare PLAYERFACING 0x1
if equal _goto EventScript_Down
compare PLAYERFACING 0x2
if equal _goto EventScript_Up
compare PLAYERFACING 0x3
if equal _goto EventScript_Left
compare PLAYERFACING 0x4
if equal _goto EventScript_Right
goto EventScript_SurfEnd
.global EventScript_Down
EventScript_Down:
applymovement PLAYER m_DownSurf
goto EventScript_FinishiSurf
.global EventScript_Up
EventScript_Up:
applymovement PLAYER m_UpSurf
goto EventScript_FinishiSurf
.global EventScript_Left
EventScript_Left:
applymovement PLAYER m_LeftSurf
goto EventScript_FinishiSurf
.global EventScript_Right
EventScript_Right:
applymovement PLAYER m_RightSurf
goto EventScript_FinishiSurf
.global EventScript_FinishiSurf
EventScript_FinishiSurf:
special 0x161
waitmovement PLAYER
goto EventScript_SurfEnd
m_DownSurf: .byte 0x4E, end_m
m_UpSurf: .byte 0x4F, end_m
m_LeftSurf: .byte 0x50, end_m
m_RightSurf: .byte 0x51, end_m
En src\config.h
pones:
#define FLAG_USE_SURF_HACK 0x1120
En src\party_menu.c
Modificar:
[FIELD_MOVE_SURF] = 4, para [FIELD_MOVE_SURF] = 0,
En include\new\overworld_data.h
incluir en la última línea:
extern const u8 EventScript_CanSurf_Hack[];