From 6e8c3883e430b567f7aa8f9230e366e03610bd5a Mon Sep 17 00:00:00 2001 From: IIMarckus Date: Wed, 8 Jun 2016 05:44:58 -0600 Subject: Part 1 of syncing with pokered. --- scripts/lance.asm | 36 ++++++++++++++++++------------------ 1 file changed, 18 insertions(+), 18 deletions(-) (limited to 'scripts/lance.asm') diff --git a/scripts/lance.asm b/scripts/lance.asm index 564e7ef1..b2cf9207 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -1,4 +1,4 @@ -LanceScript: ; 5a2ae (16:62ae) +LanceScript: call LanceScript_5a2c4 call EnableAutoTextBoxDrawing ld hl, LanceTrainerHeaders @@ -8,7 +8,7 @@ LanceScript: ; 5a2ae (16:62ae) ld [W_LANCECURSCRIPT], a ret -LanceScript_5a2c4: ; 5a2c4 (16:62c4) +LanceScript_5a2c4: ld hl, wd126 bit 5, [hl] res 5, [hl] @@ -34,22 +34,22 @@ LanceScript_5a2c4: ; 5a2c4 (16:62c4) .asm_5a2f0 predef_jump ReplaceTileBlock -LanceScript_5a2f5: ; 5a2f5 (16:62f5) +LanceScript_5a2f5: xor a ld [W_LANCECURSCRIPT], a ret -LanceScriptPointers: ; 5a2fa (16:62fa) +LanceScriptPointers: dw LanceScript0 dw DisplayEnemyTrainerTextAndStartBattle dw LanceScript2 dw LanceScript3 dw LanceScript4 -LanceScript4: ; 5a304 (16:6304) +LanceScript4: ret -LanceScript0: ; 5a305 (16:6305) +LanceScript0: CheckEvent EVENT_BEAT_LANCE ret nz ld hl, CoordsData_5a33e @@ -74,7 +74,7 @@ LanceScript0: ; 5a305 (16:6305) call PlaySound jp LanceScript_5a2c4 -CoordsData_5a33e: ; 5a33e (16:633e) +CoordsData_5a33e: db $01,$05 db $02,$06 db $0B,$05 @@ -82,7 +82,7 @@ CoordsData_5a33e: ; 5a33e (16:633e) db $10,$18 db $FF -LanceScript2: ; 5a349 (16:6349) +LanceScript2: call EndTrainerBattle ld a, [wIsInBattle] cp $ff @@ -91,7 +91,7 @@ LanceScript2: ; 5a349 (16:6349) ld [hSpriteIndexOrTextID], a jp DisplayTextID -LanceScript_5a35b: ; 5a35b (16:635b) +LanceScript_5a35b: ld a, $ff ld [wJoyIgnore], a ld hl, wSimulatedJoypadStatesEnd @@ -105,14 +105,14 @@ LanceScript_5a35b: ; 5a35b (16:635b) ld [W_CURMAPSCRIPT], a ret -RLEList_5a379: ; 5a379 (16:6379) +RLEList_5a379: db D_UP, $0D db D_LEFT, $0C db D_DOWN, $07 db D_LEFT, $06 db $FF -LanceScript3: ; 5a382 (16:6382) +LanceScript3: ld a, [wSimulatedJoypadStatesIndex] and a ret nz @@ -123,11 +123,11 @@ LanceScript3: ; 5a382 (16:6382) ld [W_CURMAPSCRIPT], a ret -LanceTextPointers: ; 5a395 (16:6395) +LanceTextPointers: dw LanceText1 -LanceTrainerHeaders: ; 5a397 (16:6397) -LanceTrainerHeader0: ; 5a397 (16:6397) +LanceTrainerHeaders: +LanceTrainerHeader0: dbEventFlagBit EVENT_BEAT_LANCES_ROOM_TRAINER_0 db ($0 << 4) ; trainer's view range dwEventFlagAddress EVENT_BEAT_LANCES_ROOM_TRAINER_0 @@ -138,21 +138,21 @@ LanceTrainerHeader0: ; 5a397 (16:6397) db $ff -LanceText1: ; 5a3a4 (16:63a4) +LanceText1: TX_ASM ld hl, LanceTrainerHeader0 call TalkToTrainer jp TextScriptEnd -LanceBeforeBattleText: ; 5a3ae (16:63ae) +LanceBeforeBattleText: TX_FAR _LanceBeforeBattleText db "@" -LanceEndBattleText: ; 5a3b3 (16:63b3) +LanceEndBattleText: TX_FAR _LanceEndBattleText db "@" -LanceAfterBattleText: ; 5a3b8 (16:63b8) +LanceAfterBattleText: TX_FAR _LanceAfterBattleText TX_ASM SetEvent EVENT_BEAT_LANCE -- cgit v1.2.3 From 269f2c3ba72776e975f5b00d9a1361cadbda42a7 Mon Sep 17 00:00:00 2001 From: dannye Date: Sat, 11 Jun 2016 15:45:24 -0500 Subject: Sync with pokered from August 29, 2015 to April 6, 2016 --- scripts/lance.asm | 63 +++++++++++++++++++++++++++++-------------------------- 1 file changed, 33 insertions(+), 30 deletions(-) (limited to 'scripts/lance.asm') diff --git a/scripts/lance.asm b/scripts/lance.asm index 564e7ef1..948787cc 100755 --- a/scripts/lance.asm +++ b/scripts/lance.asm @@ -1,42 +1,44 @@ LanceScript: ; 5a2ae (16:62ae) - call LanceScript_5a2c4 + call LanceShowOrHideEntranceBlocks call EnableAutoTextBoxDrawing ld hl, LanceTrainerHeaders ld de, LanceScriptPointers - ld a, [W_LANCECURSCRIPT] + ld a, [wLanceCurScript] call ExecuteCurMapScriptInTable - ld [W_LANCECURSCRIPT], a + ld [wLanceCurScript], a ret -LanceScript_5a2c4: ; 5a2c4 (16:62c4) - ld hl, wd126 +LanceShowOrHideEntranceBlocks: ; 5a2c4 (16:62c4) + ld hl, wCurrentMapScriptFlags bit 5, [hl] res 5, [hl] ret z CheckEvent EVENT_LANCES_ROOM_LOCK_DOOR - jr nz, .asm_5a2da + jr nz, .closeEntrance + ; open entrance ld a, $31 ld b, $32 - jp .asm_5a2de + jp .LanceSetEntranceBlocks -.asm_5a2da +.closeEntrance ld a, $72 ld b, $73 -.asm_5a2de +.LanceSetEntranceBlocks +; Replaces the tile blocks so the player can't leave. push bc ld [wNewTileBlockID], a lb bc, 6, 2 - call .asm_5a2f0 + call .LanceSetEntranceBlock pop bc ld a, b ld [wNewTileBlockID], a lb bc, 6, 3 -.asm_5a2f0 +.LanceSetEntranceBlock predef_jump ReplaceTileBlock -LanceScript_5a2f5: ; 5a2f5 (16:62f5) +ResetLanceScript: ; 5a2f5 (16:62f5) xor a - ld [W_LANCECURSCRIPT], a + ld [wLanceCurScript], a ret LanceScriptPointers: ; 5a2fa (16:62fa) @@ -52,29 +54,29 @@ LanceScript4: ; 5a304 (16:6304) LanceScript0: ; 5a305 (16:6305) CheckEvent EVENT_BEAT_LANCE ret nz - ld hl, CoordsData_5a33e + ld hl, LanceTriggerMovementCoords call ArePlayerCoordsInArray jp nc, CheckFightingMapTrainers xor a ld [hJoyHeld], a ld a, [wCoordIndex] - cp $3 - jr nc, .asm_5a325 + cp $3 ; Is player standing next to Lance's sprite? + jr nc, .notStandingNextToLance ld a, $1 ld [hSpriteIndexOrTextID], a jp DisplayTextID -.asm_5a325 - cp $5 - jr z, LanceScript_5a35b +.notStandingNextToLance + cp $5 ; Is player standing on the entrance staircase? + jr z, WalkToLance CheckAndSetEvent EVENT_LANCES_ROOM_LOCK_DOOR ret nz - ld hl, wd126 + ld hl, wCurrentMapScriptFlags set 5, [hl] ld a, SFX_GO_INSIDE call PlaySound - jp LanceScript_5a2c4 + jp LanceShowOrHideEntranceBlocks -CoordsData_5a33e: ; 5a33e (16:633e) +LanceTriggerMovementCoords: ; 5a33e (16:633e) db $01,$05 db $02,$06 db $0B,$05 @@ -86,26 +88,27 @@ LanceScript2: ; 5a349 (16:6349) call EndTrainerBattle ld a, [wIsInBattle] cp $ff - jp z, LanceScript_5a2f5 + jp z, ResetLanceScript ld a, $1 ld [hSpriteIndexOrTextID], a jp DisplayTextID -LanceScript_5a35b: ; 5a35b (16:635b) +WalkToLance: ; 5a35b (16:635b) +; Moves the player down the hallway to Lance's room. ld a, $ff ld [wJoyIgnore], a ld hl, wSimulatedJoypadStatesEnd - ld de, RLEList_5a379 + ld de, WalkToLance_RLEList call DecodeRLEList dec a ld [wSimulatedJoypadStatesIndex], a call StartSimulatingJoypadStates ld a, $3 - ld [W_LANCECURSCRIPT], a - ld [W_CURMAPSCRIPT], a + ld [wLanceCurScript], a + ld [wCurMapScript], a ret -RLEList_5a379: ; 5a379 (16:6379) +WalkToLance_RLEList: ; 5a379 (16:6379) db D_UP, $0D db D_LEFT, $0C db D_DOWN, $07 @@ -119,8 +122,8 @@ LanceScript3: ; 5a382 (16:6382) call Delay3 xor a ld [wJoyIgnore], a - ld [W_LANCECURSCRIPT], a - ld [W_CURMAPSCRIPT], a + ld [wLanceCurScript], a + ld [wCurMapScript], a ret LanceTextPointers: ; 5a395 (16:6395) -- cgit v1.2.3