Skip to content

Commit

Permalink
implement Room Service
Browse files Browse the repository at this point in the history
  • Loading branch information
itsdarsh committed Dec 10, 2019
1 parent dc01b28 commit 72a9594
Show file tree
Hide file tree
Showing 4 changed files with 34 additions and 3 deletions.
1 change: 1 addition & 0 deletions constants/item_data_constants.asm
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,7 @@ ITEMMENU_CLOSE EQU 6
const HELD_METRONOME
const HELD_PROTECTIVE_PADS
const HELD_ROCKY_HELMET
const HELD_ROOM_SERVICE
const HELD_SAFETY_GOGGLES
const HELD_SHED_SHELL
const HELD_SHELL_BELL
Expand Down
2 changes: 1 addition & 1 deletion data/items/attributes.asm
Original file line number Diff line number Diff line change
Expand Up @@ -383,7 +383,7 @@ ItemAttributes:
; EJECT PACK
item_attribute 4000, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
; ROOM SERVICE
item_attribute 4000, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
item_attribute 4000, HELD_ROOM_SERVICE, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
; BLUNDRPOLICY
item_attribute 4000, 0, 0, ITEM, ITEMMENU_NOUSE, ITEMMENU_NOUSE
; THROAT SPRAY
Expand Down
11 changes: 11 additions & 0 deletions data/text/battle.asm
Original file line number Diff line number Diff line change
Expand Up @@ -183,6 +183,17 @@ BrokeReflectText:
cont "Reflect!"
prompt

BattleText_ItemLowered:
text "The @"
text_from_ram wStringBuffer1
text ""
line "lowered"
cont "<USER>'s"
cont "@"
text_from_ram wStringBuffer2
text "!"
prompt

BattleText_ItemRaised:
text "The @"
text_from_ram wStringBuffer1
Expand Down
23 changes: 21 additions & 2 deletions engine/battle/effect_commands.asm
Original file line number Diff line number Diff line change
Expand Up @@ -2825,7 +2825,7 @@ BattleCommand_supereffectivetext: ; 351ad
.print_msg
ld b, a
inc b
farcall GetStatName
call GetStatName
ld hl, BattleText_ItemSharplyRaised
jp StdBattleTextBox

Expand Down Expand Up @@ -8060,7 +8060,26 @@ BattleCommand_trickroom:
ld [hl], 5
call AnimateCurrentMove
ld hl, TrickRoomText
jp StdBattleTextBox
call StdBattleTextBox

call GetUserItemAfterUnnerve
ld a, b
cp HELD_ROOM_SERVICE
ret nz

ld b, SPEED
call LowerStat
ld a, [wFailedMessage]
and a
ret nz

call GetCurItemName
inc b
call GetStatName
farcall ItemRecoveryAnim
ld hl, BattleText_ItemLowered
call StdBattleTextBox
jp ConsumeUserItem

.failed
call AnimateFailedMove
Expand Down

0 comments on commit 72a9594

Please sign in to comment.