McPaul
On my way to become a controversial and hated memb
- 289
- Posts
- 7
- Years
- He/ Him
- Switzerland
- Seen Apr 20, 2025
Hello!
I'm hacking pokecrystal and replacing all the HMs by items with some tweaks. Currently I need my STRENGTH item POWERSUIT to trigger .already_using and .AlreadyUsingStrengthText when used from the BAG and already active.
Here is the current code:
I tried various versions with checking this flag:
ld hl, wBikeFlags
bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
But at best it does nothing and I can use the item infinitely and at worst I get the only for Game Boy Color Screen glitch.
Maybe can someone help me please? Thanks a lot in advance!
I'm hacking pokecrystal and replacing all the HMs by items with some tweaks. Currently I need my STRENGTH item POWERSUIT to trigger .already_using and .AlreadyUsingStrengthText when used from the BAG and already active.
Here is the current code:
Spoiler:
.TryStrength:
; Strength
ld de, ENGINE_PLAINBADGE
call CheckEngineFlag
jr c, .Failed
jr .UseStrength
.Failed:
ld a, $80
ret
.UseStrength:
ld hl, Script_StrengthFromMenu
call QueueScript
ld a, $81
ret
SetStrengthFlag:
ld hl, wBikeFlags
set BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
ret
Script_StrengthFromMenu:
callasm CheckUsingPowerSuit
iftrue .already_using
reloadmappart
special UpdateTimePals
.already_using
xor a
jr .AlreadyUsingStrengthText
.AlreadyUsingStrengthText:
text_far _AlreadyUsingStrengthText
text_end
CheckUsingPowerSuit:
ld hl, wBikeFlags
bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
ld a, 2
jr .done
.done
ret
Script_UsedStrength:
callasm SetStrengthFlag
writetext .UseStrengthText
pause 20
playsound SFX_WARP_TO
pause 3
writetext .MoveBoulderText
closetext
end
.UseStrengthText:
text_far _UseStrengthText
text_end
.MoveBoulderText:
text_far _MoveBoulderText
text_end
AskStrengthScript:
callasm TryStrengthOW
iffalse .AskStrength
ifequal $1, .DontMeetRequirements
sjump .AlreadyUsedStrength
.DontMeetRequirements:
jumptext BouldersMayMoveText
.AlreadyUsedStrength:
jumptext BouldersMoveText
.AskStrength:
opentext
writetext AskStrengthText
yesorno
iftrue Script_UsedStrength
closetext
end
AskStrengthText:
text_far _AskStrengthText
text_end
BouldersMoveText:
text_far _BouldersMoveText
text_end
BouldersMayMoveText:
text_far _BouldersMayMoveText
text_end
TryStrengthOW:
ld a, POWERSUIT
ld [wCurItem], a
ld hl, wNumItems
call CheckItem
jr nc, .nope
ld de, ENGINE_PLAINBADGE
call CheckEngineFlag
jr c, .nope
ld hl, wBikeFlags
bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
jr z, .already_using
ld a, 2
jr .done
.nope
ld a, 1
jr .done
.already_using
xor a
jr .done
.done
ld [wScriptVar], a
ret
; Strength
ld de, ENGINE_PLAINBADGE
call CheckEngineFlag
jr c, .Failed
jr .UseStrength
.Failed:
ld a, $80
ret
.UseStrength:
ld hl, Script_StrengthFromMenu
call QueueScript
ld a, $81
ret
SetStrengthFlag:
ld hl, wBikeFlags
set BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
ret
Script_StrengthFromMenu:
callasm CheckUsingPowerSuit
iftrue .already_using
reloadmappart
special UpdateTimePals
.already_using
xor a
jr .AlreadyUsingStrengthText
.AlreadyUsingStrengthText:
text_far _AlreadyUsingStrengthText
text_end
CheckUsingPowerSuit:
ld hl, wBikeFlags
bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
ld a, 2
jr .done
.done
ret
Script_UsedStrength:
callasm SetStrengthFlag
writetext .UseStrengthText
pause 20
playsound SFX_WARP_TO
pause 3
writetext .MoveBoulderText
closetext
end
.UseStrengthText:
text_far _UseStrengthText
text_end
.MoveBoulderText:
text_far _MoveBoulderText
text_end
AskStrengthScript:
callasm TryStrengthOW
iffalse .AskStrength
ifequal $1, .DontMeetRequirements
sjump .AlreadyUsedStrength
.DontMeetRequirements:
jumptext BouldersMayMoveText
.AlreadyUsedStrength:
jumptext BouldersMoveText
.AskStrength:
opentext
writetext AskStrengthText
yesorno
iftrue Script_UsedStrength
closetext
end
AskStrengthText:
text_far _AskStrengthText
text_end
BouldersMoveText:
text_far _BouldersMoveText
text_end
BouldersMayMoveText:
text_far _BouldersMayMoveText
text_end
TryStrengthOW:
ld a, POWERSUIT
ld [wCurItem], a
ld hl, wNumItems
call CheckItem
jr nc, .nope
ld de, ENGINE_PLAINBADGE
call CheckEngineFlag
jr c, .nope
ld hl, wBikeFlags
bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
jr z, .already_using
ld a, 2
jr .done
.nope
ld a, 1
jr .done
.already_using
xor a
jr .done
.done
ld [wScriptVar], a
ret
I tried various versions with checking this flag:
ld hl, wBikeFlags
bit BIKEFLAGS_STRENGTH_ACTIVE_F, [hl]
But at best it does nothing and I can use the item infinitely and at worst I get the only for Game Boy Color Screen glitch.
Maybe can someone help me please? Thanks a lot in advance!