Renaming: (fix #412)

- MapTriggers / maptrigger → SceneScripts / scene_script
- XYTriggers / xy_trigger → CoordEvents / coord_event
- Signposts / signpost → BGEvents / bg_event
- PersonEvents / person_event → ObjectEvents / object_event
This commit is contained in:
Remy Oukaour
2017-12-24 13:46:34 -05:00
parent 20d6c1d876
commit c05b7f41dd
427 changed files with 5206 additions and 5206 deletions

View File

@@ -286,7 +286,7 @@ PlayerEvents: ; 9681f
call RunMemScript
jr c, .ok
call DoMapTrigger
call RunSceneScript
jr c, .ok
call CheckTimeEvents
@@ -335,7 +335,7 @@ CheckTrainerBattle3: ; 96867
; 96874
CheckTileEvent: ; 96874
; Check for warps, tile triggers or wild battles.
; Check for warps, coord events, or wild battles.
call CheckWarpConnxnScriptFlag
jr z, .connections_disabled
@@ -350,7 +350,7 @@ CheckTileEvent: ; 96874
call CheckCoordEventScriptFlag
jr z, .coord_events_disabled
call CheckCurrentMapXYTriggers
call CheckCurrentMapCoordEvents
jr c, .coord_event
.coord_events_disabled
@@ -437,19 +437,19 @@ Dummy_CheckScriptFlags3Bit5: ; 968e4
ret
; 968ec
DoMapTrigger: ; 968ec
ld a, [wCurrMapTriggerCount]
RunSceneScript: ; 968ec
ld a, [wCurrMapSceneScriptCount]
and a
jr z, .nope
ld c, a
call CheckTriggers
call CheckScenes
cp c
jr nc, .nope
ld e, a
ld d, 0
ld hl, wCurrMapTriggerHeaderPointer
ld hl, wCurrMapSceneScriptHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
@@ -559,9 +559,9 @@ CheckAPressOW: ; 96999
ret z
call TryObjectEvent
ret c
call TryReadSign
call TryBGEvent
ret c
call CheckFacingTileEvent
call TryTileCollisionEvent
ret c
xor a
ret
@@ -617,14 +617,14 @@ TryObjectEvent: ; 969b5
ret
.pointers
dbw PERSONTYPE_SCRIPT, .script
dbw PERSONTYPE_ITEMBALL, .itemball
dbw PERSONTYPE_TRAINER, .trainer
dbw OBJECTTYPE_SCRIPT, .script
dbw OBJECTTYPE_ITEMBALL, .itemball
dbw OBJECTTYPE_TRAINER, .trainer
; the remaining four are dummy events
dbw PERSONTYPE_3, .three
dbw PERSONTYPE_4, .four
dbw PERSONTYPE_5, .five
dbw PERSONTYPE_6, .six
dbw OBJECTTYPE_3, .three
dbw OBJECTTYPE_4, .four
dbw OBJECTTYPE_5, .five
dbw OBJECTTYPE_6, .six
db -1
; 96a04
@@ -681,19 +681,19 @@ TryObjectEvent: ; 969b5
ret
; 96a38
TryReadSign: ; 96a38
call CheckFacingSign
jr c, .IsSign
TryBGEvent: ; 96a38
call CheckFacingBGEvent
jr c, .is_bg_event
xor a
ret
.IsSign:
.is_bg_event:
ld a, [EngineBuffer3]
ld hl, .signs
ld hl, .bg_events
rst JumpTable
ret
.signs
.bg_events
dw .read
dw .up
dw .down
@@ -736,7 +736,7 @@ TryReadSign: ; 96a38
ret
.itemifset
call CheckSignFlag
call CheckBGEventFlag
jp nz, .dontread
call PlayTalkObject
call GetMapScriptHeaderBank
@@ -750,7 +750,7 @@ TryReadSign: ; 96a38
ret
.copy
call CheckSignFlag
call CheckBGEventFlag
jr nz, .dontread
call GetMapScriptHeaderBank
ld de, EngineBuffer1
@@ -759,12 +759,12 @@ TryReadSign: ; 96a38
jr .dontread
.ifset
call CheckSignFlag
call CheckBGEventFlag
jr z, .dontread
jr .thenread
.ifnotset
call CheckSignFlag
call CheckBGEventFlag
jr nz, .dontread
.thenread
@@ -785,7 +785,7 @@ TryReadSign: ; 96a38
ret
; 96ad8
CheckSignFlag: ; 96ad8
CheckBGEventFlag: ; 96ad8
ld hl, EngineBuffer4
ld a, [hli]
ld h, [hl]

View File

@@ -50,11 +50,11 @@ LoadScriptBDE:: ; 97c4f
ret
; 97c5f
CheckFacingTileEvent:: ; 97c5f
TryTileCollisionEvent:: ; 97c5f
call GetFacingTileCoord
ld [EngineBuffer1], a
ld c, a
farcall CheckFacingTileForStd
farcall CheckFacingTileForStdScript
jr c, .done
call CheckCutTreeTile

View File

@@ -283,30 +283,30 @@ CheckForHiddenItems: ; b8172
ld a, [YCoord]
add SCREEN_HEIGHT / 4
ld [Buffer3], a
; Get the pointer for the first signpost header in the map...
ld hl, wCurrentMapSignpostHeaderPointer
; Get the pointer for the first BG event header in the map...
ld hl, wCurrMapBGEventHeaderPointer
ld a, [hli]
ld h, [hl]
ld l, a
; ... before even checking to see if there are any signposts on this map.
ld a, [wCurrentMapSignpostCount]
; ... before even checking to see if there are any BG events on this map.
ld a, [wCurrMapBGEventCount]
and a
jr z, .nosignpostitems
; For i = 1:wCurrentMapSignpostCount...
jr z, .nobgeventitems
; For i = 1:wCurrMapBGEventCount...
.loop
; Store the counter in Buffer2, and store the signpost header pointer in the stack.
; Store the counter in Buffer2, and store the BG event header pointer in the stack.
ld [Buffer2], a
push hl
; Get the Y coordinate of the signpost.
; Get the Y coordinate of the BG event.
call .GetFarByte
ld e, a
; Is the Y coordinate of the signpost on the screen? If not, go to the next signpost.
; Is the Y coordinate of the BG event on the screen? If not, go to the next BG event.
ld a, [Buffer3]
sub e
jr c, .next
cp SCREEN_HEIGHT / 2
jr nc, .next
; Is the X coordinate of the signpost on the screen? If not, go to the next signpost.
; Is the X coordinate of the BG event on the screen? If not, go to the next BG event.
call .GetFarByte
ld d, a
ld a, [Buffer4]
@@ -314,9 +314,9 @@ CheckForHiddenItems: ; b8172
jr c, .next
cp SCREEN_WIDTH / 2
jr nc, .next
; Is this signpost a hidden item? If not, go to the next signpost.
; Is this BG event a hidden item? If not, go to the next BG event.
call .GetFarByte
cp SIGNPOST_ITEM
cp BGEVENT_ITEM
jr nz, .next
; Has this item already been found? If not, set off the Itemfinder.
ld a, [Buffer1]
@@ -332,16 +332,16 @@ CheckForHiddenItems: ; b8172
jr z, .itemnearby
.next
; Restore the signpost header pointer and increment it by the length of a signpost header.
; Restore the BG event header pointer and increment it by the length of a BG event header.
pop hl
ld bc, 5
add hl, bc
; Restore the signpost counter and decrement it. If it hits zero, there are no hidden items in range.
; Restore the BG event counter and decrement it. If it hits zero, there are no hidden items in range.
ld a, [Buffer2]
dec a
jr nz, .loop
.nosignpostitems
.nobgeventitems
xor a
ret

View File

@@ -1,5 +1,5 @@
PersonActionPairPointers: ; 445f
; entries correspond to PERSON_ACTION_* constants
ObjectActionPairPointers: ; 445f
; entries correspond to OBJECT_ACTION_* constants
dw SetFacingStanding, SetFacingStanding
dw SetFacingStandAction, SetFacingCurrent
dw SetFacingStepAction, SetFacingCurrent

View File

@@ -154,7 +154,7 @@ Function437b: ; 437b
jr nz, SetFacingStanding
bit 5, [hl]
jr nz, asm_4448
ld de, PersonActionPairPointers ; use first column
ld de, ObjectActionPairPointers ; use first column
jr _HandleObjectAction
; 4440
@@ -164,7 +164,7 @@ Function4440: ; 4440
bit INVISIBLE, [hl]
jr nz, SetFacingStanding
asm_4448
ld de, PersonActionPairPointers + 2 ; use second column
ld de, ObjectActionPairPointers + 2 ; use second column
jr _HandleObjectAction
; 444d
@@ -631,7 +631,7 @@ MapObjectMovementPattern: ; 47dd
call EndSpriteMovement
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STAND
ld [hl], OBJECT_ACTION_STAND
ld hl, OBJECT_STEP_TYPE
add hl, bc
ld [hl], STEP_TYPE_05
@@ -650,20 +650,20 @@ MapObjectMovementPattern: ; 47dd
jp HandleMovementData
.Movement0a:
jp _GetMovementPerson
jp _GetMovementObject
.Movement0b:
jp _GetMovementPerson
jp _GetMovementObject
.Movement0c:
jp _GetMovementPerson
jp _GetMovementObject
.Movement0d:
ld hl, Function5000
jp HandleMovementData
.Movement0e:
jp _GetMovementPerson
jp _GetMovementObject
.Follow:
ld hl, GetFollowerNextMovementByte
@@ -781,7 +781,7 @@ MapObjectMovementPattern: ; 47dd
ld [hl], STANDING
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STAND
ld [hl], OBJECT_ACTION_STAND
ret
.MovementBigStanding:
@@ -791,7 +791,7 @@ MapObjectMovementPattern: ; 47dd
ld [hl], STANDING
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_BIG_SNORLAX
ld [hl], OBJECT_ACTION_BIG_SNORLAX
ld hl, OBJECT_STEP_TYPE
add hl, bc
ld [hl], STEP_TYPE_04
@@ -804,7 +804,7 @@ MapObjectMovementPattern: ; 47dd
ld [hl], STANDING
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_BOUNCE
ld [hl], OBJECT_ACTION_BOUNCE
ld hl, OBJECT_STEP_TYPE
add hl, bc
ld [hl], STEP_TYPE_04
@@ -828,7 +828,7 @@ MapObjectMovementPattern: ; 47dd
.MovementSpinRepeat:
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STAND
ld [hl], OBJECT_ACTION_STAND
ld hl, OBJECT_RANGE
add hl, bc
ld a, [hl]
@@ -879,7 +879,7 @@ MapObjectMovementPattern: ; 47dd
call ._MovementShadow_Grass_Emote_BoulderDust
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_SHADOW
ld [hl], OBJECT_ACTION_SHADOW
ld hl, OBJECT_STEP_DURATION
add hl, de
ld a, [hl]
@@ -916,7 +916,7 @@ MapObjectMovementPattern: ; 47dd
call ._MovementShadow_Grass_Emote_BoulderDust
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_EMOTE
ld [hl], OBJECT_ACTION_EMOTE
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 0
@@ -936,7 +936,7 @@ MapObjectMovementPattern: ; 47dd
call ._MovementShadow_Grass_Emote_BoulderDust
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_BOULDER_DUST
ld [hl], OBJECT_ACTION_BOULDER_DUST
ld hl, OBJECT_STEP_DURATION
add hl, de
ld a, [hl]
@@ -980,7 +980,7 @@ MapObjectMovementPattern: ; 47dd
call ._MovementShadow_Grass_Emote_BoulderDust
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_GRASS_SHAKE
ld [hl], OBJECT_ACTION_GRASS_SHAKE
ld hl, OBJECT_STEP_DURATION
add hl, de
ld a, [hl]
@@ -1013,7 +1013,7 @@ MapObjectMovementPattern: ; 47dd
call EndSpriteMovement
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_00
ld [hl], OBJECT_ACTION_00
ld hl, OBJECT_RANGE
add hl, bc
ld a, [hl]
@@ -1053,7 +1053,7 @@ MapObjectMovementPattern: ; 47dd
call UpdateTallGrassFlags
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STEP
ld [hl], OBJECT_ACTION_STEP
ld hl, wCenteredObject
ld a, [hMapObjectIndexBuffer]
cp [hl]
@@ -1092,7 +1092,7 @@ SetRandomStepDuration: ; 4b2d
ld [hl], STANDING
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STAND
ld [hl], OBJECT_ACTION_STAND
ld hl, OBJECT_STEP_TYPE
add hl, bc
ld [hl], STEP_TYPE_03
@@ -1245,7 +1245,7 @@ TeleportFrom: ; 4c18
.DoSpin:
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_SPIN
ld [hl], OBJECT_ACTION_SPIN
ld hl, OBJECT_STEP_DURATION
add hl, bc
dec [hl]
@@ -1270,7 +1270,7 @@ TeleportFrom: ; 4c18
.DoSpinRise:
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_SPIN
ld [hl], OBJECT_ACTION_SPIN
ld hl, OBJECT_31
add hl, bc
inc [hl]
@@ -1310,7 +1310,7 @@ TeleportTo: ; 4c89
.InitWait:
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_00
ld [hl], OBJECT_ACTION_00
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
@@ -1341,7 +1341,7 @@ TeleportTo: ; 4c89
.DoDescent:
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_SPIN
ld [hl], OBJECT_ACTION_SPIN
ld hl, OBJECT_31
add hl, bc
inc [hl]
@@ -1369,7 +1369,7 @@ TeleportTo: ; 4c89
.DoFinalSpin:
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_SPIN
ld [hl], OBJECT_ACTION_SPIN
ld hl, OBJECT_STEP_DURATION
add hl, bc
dec [hl]
@@ -1399,7 +1399,7 @@ Skyfall: ; 4d14
.Init:
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_00
ld [hl], OBJECT_ACTION_00
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
@@ -1411,7 +1411,7 @@ Skyfall: ; 4d14
ret nz
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STEP
ld [hl], OBJECT_ACTION_STEP
ld hl, OBJECT_STEP_FRAME
add hl, bc
ld [hl], 0
@@ -1496,9 +1496,9 @@ RockSmashStep: ; 4daf
add hl, bc
ld a, [hl]
and %00000001
ld a, PERSON_ACTION_STAND
ld a, OBJECT_ACTION_STAND
jr z, .yes
ld a, PERSON_ACTION_00
ld a, OBJECT_ACTION_00
.yes
ld hl, OBJECT_ACTION
add hl, bc
@@ -1511,9 +1511,9 @@ ReturnDigStep: ; 4dc8
add hl, bc
ld a, [hl]
and %00000001
ld a, PERSON_ACTION_SPIN
ld a, OBJECT_ACTION_SPIN
jr z, .yes
ld a, PERSON_ACTION_SPIN_FLICKER
ld a, OBJECT_ACTION_SPIN_FLICKER
.yes
ld hl, OBJECT_ACTION
add hl, bc
@@ -1819,7 +1819,7 @@ SkyfallTop: ; 4f83
.Init:
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_SKYFALL
ld [hl], OBJECT_ACTION_SKYFALL
ld hl, OBJECT_STEP_DURATION
add hl, bc
ld [hl], 16
@@ -1935,13 +1935,13 @@ Function5026: ; 5026
ret
; 5037
_GetMovementPerson: ; 5037
ld hl, GetMovementPerson
_GetMovementObject: ; 5037
ld hl, GetMovementObject
jp HandleMovementData
; 503d
GetMovementPerson: ; 503d
ld a, [wMovementPerson]
GetMovementObject: ; 503d
ld a, [wMovementObject]
ret
; 5041
@@ -2540,7 +2540,7 @@ RefreshPlayerSprite: ; 579d
ret
.ok
ld a, PERSON_ACTION_00
ld a, OBJECT_ACTION_00
ld [PlayerAction], a
ret
; 57ca

View File

@@ -60,8 +60,8 @@ MovementPointers: ; 5075
dw Movement_set_sliding ; 39
dw Movement_remove_fixed_facing ; 3a
dw Movement_fix_facing ; 3b
dw Movement_show_person ; 3c
dw Movement_hide_person ; 3d
dw Movement_show_object ; 3c
dw Movement_hide_object ; 3d
dw Movement_step_sleep_1 ; 3e
dw Movement_step_sleep_2 ; 3f
dw Movement_step_sleep_3 ; 40
@@ -73,7 +73,7 @@ MovementPointers: ; 5075
dw Movement_step_sleep ; 46
dw Movement_step_end ; 47
dw Movement_48 ; 48
dw Movement_remove_person ; 49
dw Movement_remove_object ; 49
dw Movement_step_loop ; 4a
dw Movement_4b ; 4b
dw Movement_teleport_from ; 4c
@@ -130,7 +130,7 @@ Movement_step_dig: ; 5145
ld [hl], a
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_SPIN
ld [hl], OBJECT_ACTION_SPIN
call JumpMovementPointer
ld hl, OBJECT_STEP_DURATION
add hl, bc
@@ -167,7 +167,7 @@ Movement_return_dig: ; 516a
Movement_fish_got_bite: ; 5189
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_FISHING
ld [hl], OBJECT_ACTION_FISHING
ld hl, OBJECT_STEP_TYPE
add hl, bc
ld [hl], STEP_TYPE_GOT_BITE
@@ -181,7 +181,7 @@ Movement_rock_smash: ; 5196
ld [hl], a
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STAND
ld [hl], OBJECT_ACTION_STAND
ld hl, OBJECT_STEP_TYPE
add hl, bc
ld [hl], STEP_TYPE_ROCK_SMASH
@@ -191,7 +191,7 @@ Movement_rock_smash: ; 5196
Movement_fish_cast_rod: ; 51ab
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_FISHING
ld [hl], OBJECT_ACTION_FISHING
ld hl, OBJECT_STEP_TYPE
add hl, bc
ld [hl], STEP_TYPE_SLEEP
@@ -248,7 +248,7 @@ Movement_48: ; 51db
ret
; 51fd
Movement_remove_person: ; 51fd
Movement_remove_object: ; 51fd
call DeleteMapObject
ld hl, wObjectFollow_Leader
ld a, [hMapObjectIndexBuffer]
@@ -265,7 +265,7 @@ Movement_remove_person: ; 51fd
Movement_4b: ; 5210
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STAND
ld [hl], OBJECT_ACTION_STAND
ld hl, OBJECT_STEP_TYPE
add hl, bc
@@ -326,7 +326,7 @@ Movement_step_sleep_common: ; 5247
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STAND
ld [hl], OBJECT_ACTION_STAND
ld hl, OBJECT_DIRECTION_WALKING
add hl, bc
@@ -346,7 +346,7 @@ Movement_step_bump: ; 525f
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_BUMP
ld [hl], OBJECT_ACTION_BUMP
ld hl, OBJECT_DIRECTION_WALKING
add hl, bc
@@ -366,7 +366,7 @@ Movement_tree_shake: ; 5279
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_WEIRD_TREE
ld [hl], OBJECT_ACTION_WEIRD_TREE
ld hl, OBJECT_DIRECTION_WALKING
add hl, bc
@@ -402,14 +402,14 @@ Movement_fix_facing: ; 52ae
jp ContinueReadingMovement
; 52b7
Movement_show_person: ; 52b7
Movement_show_object: ; 52b7
ld hl, OBJECT_FLAGS1
add hl, bc
res INVISIBLE, [hl]
jp ContinueReadingMovement
; 52c0
Movement_hide_person: ; 52c0
Movement_hide_object: ; 52c0
ld hl, OBJECT_FLAGS1
add hl, bc
set INVISIBLE, [hl]
@@ -458,7 +458,7 @@ TurnHead: ; 52ee
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STAND
ld [hl], OBJECT_ACTION_STAND
ld hl, OBJECT_DIRECTION_WALKING
add hl, bc
@@ -733,7 +733,7 @@ TurnStep: ; 5400
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STEP
ld [hl], OBJECT_ACTION_STEP
ld hl, OBJECT_STEP_TYPE
add hl, bc
@@ -746,7 +746,7 @@ NormalStep: ; 5412
call UpdateTallGrassFlags
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STEP
ld [hl], OBJECT_ACTION_STEP
ld hl, OBJECT_NEXT_TILE
add hl, bc
@@ -784,7 +784,7 @@ TurningStep: ; 5446
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_SPIN
ld [hl], OBJECT_ACTION_SPIN
ld hl, wCenteredObject
ld a, [hMapObjectIndexBuffer]
@@ -810,7 +810,7 @@ SlideStep: ; 5468
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STAND
ld [hl], OBJECT_ACTION_STAND
ld hl, wCenteredObject
ld a, [hMapObjectIndexBuffer]
@@ -842,7 +842,7 @@ JumpStep: ; 548a
ld hl, OBJECT_ACTION
add hl, bc
ld [hl], PERSON_ACTION_STEP
ld [hl], OBJECT_ACTION_STEP
call SpawnShadow

View File

@@ -35,7 +35,7 @@ Function6ec1: ; 6ec1
push hl
push bc
call WillPersonBumpIntoSomeoneElse
call WillObjectBumpIntoSomeoneElse
pop bc
pop hl
ret c
@@ -44,12 +44,12 @@ Function6ec1: ; 6ec1
bit 5, [hl]
jr nz, .bit_5
push hl
call HasPersonReachedMovementLimit
call HasObjectReachedMovementLimit
pop hl
ret c
push hl
call IsPersonMovingOffEdgeOfScreen
call IsObjectMovingOffEdgeOfScreen
pop hl
ret c
@@ -269,7 +269,7 @@ CheckFacingObject:: ; 6fd9
; 7009
WillPersonBumpIntoSomeoneElse: ; 7009
WillObjectBumpIntoSomeoneElse: ; 7009
ld hl, OBJECT_NEXT_MAP_X
add hl, bc
ld d, [hl]
@@ -391,7 +391,7 @@ IsNPCAtCoord: ; 7041
ret
; 70a4
HasPersonReachedMovementLimit: ; 70a4
HasObjectReachedMovementLimit: ; 70a4
ld hl, OBJECT_RADIUS
add hl, bc
ld a, [hl]
@@ -451,7 +451,7 @@ HasPersonReachedMovementLimit: ; 70a4
ret
; 70ed
IsPersonMovingOffEdgeOfScreen: ; 70ed
IsObjectMovingOffEdgeOfScreen: ; 70ed
ld hl, OBJECT_NEXT_MAP_X
add hl, bc
ld a, [XCoord]

View File

@@ -29,14 +29,14 @@ SpawnPlayer: ; 8029
call GetMapObject
ld hl, MAPOBJECT_COLOR
add hl, bc
ln e, PAL_NPC_RED, PERSONTYPE_SCRIPT
ln e, PAL_NPC_RED, OBJECTTYPE_SCRIPT
ld a, [wPlayerSpriteSetupFlags]
bit 2, a
jr nz, .ok
ld a, [PlayerGender]
bit 0, a
jr z, .ok
ln e, PAL_NPC_BLUE, PERSONTYPE_SCRIPT
ln e, PAL_NPC_BLUE, OBJECTTYPE_SCRIPT
.ok
ld [hl], e
@@ -55,7 +55,7 @@ PlayerObjectTemplate: ; 8071
; A dummy map object used to initialize the player object.
; Shorter than the actual amount copied by two bytes.
; Said bytes seem to be unused.
person_event SPRITE_CHRIS, -4, -4, SPRITEMOVEDATA_PLAYER, 15, 15, -1, -1, 0, PERSONTYPE_SCRIPT, 0, 0, -1
object_event SPRITE_CHRIS, -4, -4, SPRITEMOVEDATA_PLAYER, 15, 15, -1, -1, 0, OBJECTTYPE_SCRIPT, 0, 0, -1
CopyDECoordsToMapObject:: ; 807e
push de
@@ -82,7 +82,7 @@ PlayerSpawn_ConvertCoords: ; 808f
call CopyDECoordsToMapObject
ret
WritePersonXY:: ; 80a1
WriteObjectXY:: ; 80a1
ld a, b
call CheckObjectVisibility
ret c
@@ -616,7 +616,7 @@ FollowNotExact:: ; 839e
call CheckObjectVisibility
ret c
; Person 2 is now in bc, person 1 is now in de
; object 2 is now in bc, object 1 is now in de
ld hl, OBJECT_NEXT_MAP_X
add hl, bc
ld a, [hl]

View File

@@ -82,10 +82,10 @@ ScriptCommandTable:
dw Script_callasm ; 0e
dw Script_special ; 0f
dw Script_ptcallasm ; 10
dw Script_checkmaptriggers ; 11
dw Script_domaptrigger ; 12
dw Script_checktriggers ; 13
dw Script_dotrigger ; 14
dw Script_checkmapscene ; 11
dw Script_setmapscene ; 12
dw Script_checkscene ; 13
dw Script_setscene ; 14
dw Script_writebyte ; 15
dw Script_addvar ; 16
dw Script_random ; 17
@@ -175,14 +175,14 @@ ENDC
dw Script_applymovement ; 69
dw Script_applymovement2 ; 6a
dw Script_faceplayer ; 6b
dw Script_faceperson ; 6c
dw Script_faceobject ; 6c
dw Script_variablesprite ; 6d
dw Script_disappear ; 6e
dw Script_appear ; 6f
dw Script_follow ; 70
dw Script_stopfollow ; 71
dw Script_moveperson ; 72
dw Script_writepersonxy ; 73
dw Script_moveobject ; 72
dw Script_writeobjectxy ; 73
dw Script_loademote ; 74
dw Script_showemote ; 75
dw Script_spriteface ; 76
@@ -979,7 +979,7 @@ Script_cry:
call PlayCry
ret
GetScriptPerson:
GetScriptObject:
and a ; PLAYER?
ret z
cp LAST_TALKED
@@ -990,21 +990,21 @@ GetScriptPerson:
Script_setlasttalked:
; script command 0x68
; parameters:
; person (SingleByteParam)
; object id (SingleByteParam)
call GetScriptByte
call GetScriptPerson
call GetScriptObject
ld [hLastTalked], a
ret
Script_applymovement:
; script command 0x69
; parameters:
; person (SingleByteParam)
; object id (SingleByteParam)
; data (MovementPointerLabelParam)
call GetScriptByte
call GetScriptPerson
call GetScriptObject
ld c, a
ApplyMovement:
@@ -1061,24 +1061,24 @@ Script_faceplayer:
ld e, a
ld a, [hLastTalked]
ld d, a
call ApplyPersonFacing
call ApplyObjectFacing
ret
Script_faceperson:
Script_faceobject:
; script command 0x6c
; parameters:
; person1 (SingleByteParam)
; person2 (SingleByteParam)
; object1 (SingleByteParam)
; object2 (SingleByteParam)
call GetScriptByte
call GetScriptPerson
call GetScriptObject
cp LAST_TALKED
jr c, .ok
ld a, [hLastTalked]
.ok
ld e, a
call GetScriptByte
call GetScriptPerson
call GetScriptObject
cp LAST_TALKED
jr nz, .ok2
ld a, [hLastTalked]
@@ -1093,17 +1093,17 @@ Script_faceperson:
add a
ld e, a
ld d, c
call ApplyPersonFacing
call ApplyObjectFacing
ret
Script_spriteface:
; script command 0x76
; parameters:
; person (SingleByteParam)
; object id (SingleByteParam)
; facing (SingleByteParam)
call GetScriptByte
call GetScriptPerson
call GetScriptObject
cp LAST_TALKED
jr nz, .ok
ld a, [hLastTalked]
@@ -1113,10 +1113,10 @@ Script_spriteface:
add a
add a
ld e, a
call ApplyPersonFacing
call ApplyObjectFacing
ret
ApplyPersonFacing:
ApplyObjectFacing:
ld a, d
push de
call CheckObjectVisibility
@@ -1179,10 +1179,10 @@ Script_variablesprite:
Script_appear:
; script command 0x6f
; parameters:
; person (SingleByteParam)
; object id (SingleByteParam)
call GetScriptByte
call GetScriptPerson
call GetScriptObject
call _CopyObjectStruct
ld a, [hMapObjectIndexBuffer]
ld b, 0 ; clear
@@ -1192,10 +1192,10 @@ Script_appear:
Script_disappear:
; script command 0x6e
; parameters:
; person (SingleByteParam)
; object id (SingleByteParam)
call GetScriptByte
call GetScriptPerson
call GetScriptObject
cp LAST_TALKED
jr nz, .ok
ld a, [hLastTalked]
@@ -1230,14 +1230,14 @@ ApplyEventActionAppearDisappear:
Script_follow:
; script command 0x70
; parameters:
; person2 (SingleByteParam)
; person1 (SingleByteParam)
; object2 (SingleByteParam)
; object1 (SingleByteParam)
call GetScriptByte
call GetScriptPerson
call GetScriptObject
ld b, a
call GetScriptByte
call GetScriptPerson
call GetScriptObject
ld c, a
farcall StartFollow
ret
@@ -1248,15 +1248,15 @@ Script_stopfollow:
farcall StopFollow
ret
Script_moveperson:
Script_moveobject:
; script command 0x72
; parameters:
; person (SingleByteParam)
; object id (SingleByteParam)
; x (SingleByteParam)
; y (SingleByteParam)
call GetScriptByte
call GetScriptPerson
call GetScriptObject
ld b, a
call GetScriptByte
add 4
@@ -1267,32 +1267,32 @@ Script_moveperson:
farcall CopyDECoordsToMapObject
ret
Script_writepersonxy:
Script_writeobjectxy:
; script command 0x73
; parameters:
; person (SingleByteParam)
; object id (SingleByteParam)
call GetScriptByte
call GetScriptPerson
call GetScriptObject
cp LAST_TALKED
jr nz, .ok
ld a, [hLastTalked]
.ok
ld b, a
farcall WritePersonXY
farcall WriteObjectXY
ret
Script_follownotexact:
; script command 0x77
; parameters:
; person2 (SingleByteParam)
; person1 (SingleByteParam)
; object2 (SingleByteParam)
; object1 (SingleByteParam)
call GetScriptByte
call GetScriptPerson
call GetScriptObject
ld b, a
call GetScriptByte
call GetScriptPerson
call GetScriptObject
ld c, a
farcall FollowNotExact
ret
@@ -1315,13 +1315,13 @@ Script_showemote:
; script command 0x75
; parameters:
; bubble (SingleByteParam)
; person (SingleByteParam)
; object id (SingleByteParam)
; time (DecimalParam)
call GetScriptByte
ld [ScriptVar], a
call GetScriptByte
call GetScriptPerson
call GetScriptObject
cp LAST_TALKED
jr z, .ok
ld [hLastTalked], a
@@ -1751,20 +1751,20 @@ Script_priorityjump:
set 3, [hl]
ret
Script_checktriggers:
Script_checkscene:
; script command 0x13
call CheckTriggers
jr z, .no_triggers
call CheckScenes
jr z, .no_scene
ld [ScriptVar], a
ret
.no_triggers
.no_scene
ld a, $ff
ld [ScriptVar], a
ret
Script_checkmaptriggers:
Script_checkmapscene:
; script command 0x11
; parameters:
; map_group (SingleByteParam)
@@ -1774,49 +1774,49 @@ Script_checkmaptriggers:
ld b, a
call GetScriptByte
ld c, a
call GetMapTrigger
call GetMapSceneID
ld a, d
or e
jr z, .no_triggers
jr z, .no_scene
ld a, [de]
ld [ScriptVar], a
ret
.no_triggers
.no_scene
ld a, $ff
ld [ScriptVar], a
ret
Script_dotrigger:
Script_setscene:
; script command 0x14
; parameters:
; trigger_id (SingleByteParam)
; scene_id (SingleByteParam)
ld a, [MapGroup]
ld b, a
ld a, [MapNumber]
ld c, a
jr DoTrigger
jr DoScene
Script_domaptrigger:
Script_setmapscene:
; script command 0x12
; parameters:
; map_group (MapGroupParam)
; map_id (MapIdParam)
; trigger_id (SingleByteParam)
; scene_id (SingleByteParam)
call GetScriptByte
ld b, a
call GetScriptByte
ld c, a
DoTrigger:
call GetMapTrigger
DoScene:
call GetMapSceneID
ld a, d
or e
jr z, .no_trigger
jr z, .no_scene
call GetScriptByte
ld [de], a
.no_trigger
.no_scene
ret
Script_copybytetovar:

View File

@@ -297,7 +297,7 @@ RadioTowerRocketsScript:
clearevent EVENT_USED_THE_CARD_KEY_IN_THE_RADIO_TOWER
setevent EVENT_MAHOGANY_TOWN_POKEFAN_M_BLOCKS_EAST
specialphonecall SPECIALCALL_WEIRDBROADCAST
domaptrigger MAHOGANY_TOWN, $1
setmapscene MAHOGANY_TOWN, $1
end
BugContestResultsWarpScript:
@@ -354,8 +354,8 @@ BugContestResults_DidNotLeaveMons
waitbutton
BugContestResults_CleanUp
closetext
dotrigger $0
domaptrigger ROUTE_35_NATIONAL_PARK_GATE, $0
setscene $0
setmapscene ROUTE_35_NATIONAL_PARK_GATE, $0
setevent EVENT_BUG_CATCHING_CONTESTANT_1A
setevent EVENT_BUG_CATCHING_CONTESTANT_2A
setevent EVENT_BUG_CATCHING_CONTESTANT_3A

View File

@@ -12,8 +12,8 @@ SeenByTrainerScript:: ; 0xbe675
showemote EMOTE_SHOCK, LAST_TALKED, 30
callasm TrainerWalkToPlayer
applymovement2 MovementBuffer
writepersonxy LAST_TALKED
faceperson PLAYER, LAST_TALKED
writeobjectxy LAST_TALKED
faceobject PLAYER, LAST_TALKED
jump StartBattleWithMapTrainerScript
StartBattleWithMapTrainerScript: ; 0xbe68a

View File

@@ -3,7 +3,7 @@ HandleNewMap: ; 1045b0
call Clearwc7e8
call ResetMapBufferEventFlags
call ResetFlashIfOutOfCave
call GetCurrentMapTrigger
call GetCurrentMapSceneID
call ResetBikeFlags
ld a, MAPCALLBACK_NEWMAP
call RunMapCallback