src/field/script_commands_actor_commands.c
Script commands on actors: their callbacks, sprite priority and still pictures. More…
Included by script_commands.c.
Macros
| Name | Description | |
|---|---|---|
#define | COIN_ICON_ITEM 0 | Item 0's icon, a gold coin, which an actor shows for coins. |
Functions
| Name | Description | |
|---|---|---|
void | fdActorClearDestinationAndStand (Uint32 actorId) | Clears an actor's destination, starts its idle script and stands it still. |
void | fdActorFaceDirectionById (Sint32 actorId, Sint32 angle, Sint32 ticks) | The script command "actor face direction": the actor turns toward angle (TRIG_TURN a full turn; fdActorStepAngle), then the script waits the given number of ticks. |
void | fdActorFaceDirectionAndRefreshById (Sint32 actorId, Sint32 angle) | Turns an actor a step toward angle (ActorStepAngleScript) and waits for the script to end. |
void | fdActorSetSpritePriority (Uint32 actorId, Sint32 priority) | The script command "set actor sprite priority": fixes the priority of the actor's sprite and its shadow, which then no longer follow its depth: clears ACTOR_PRIORITY_AUTOMATIC. |
void | fdActorCopyGraphics (Uint32 targetId, Uint32 srcId) | Makes the target actor's sprite show the source actor's graphics (its VRAM block and tile). |
void | fdActorDisableById (Uint32 id) | Stops actor id moving and colliding and hides it. |
void | fdActorSetSpriteRotationById (Sint32 id, Sint32 rotation) | Turns actor id's sprite to rotation (1/65536 turns). |
void | fdActorFallOverById (Uint32 id, Uint32 angle) | Lays actor id down along angle, a quarter turn rounded: shows its first tick turned, shifted by the side it falls to, and blocks its metatile and the metatile beyond it. |
void | fdActorFallOverWithAnimationById (Sint32 id, Uint32 angle, Sint32 animation) | fdActorFallOverById with an animation of the actor's sprite sheet (-1 for none) and the fall moving the actor itself half a metatile the way it falls. |
void | fdActorShowItemIconById (Sint32 id, Sint32 item) | Shows an actor as an item's icon, its sprite's only picture: the item, or for coins (SCOOPED_COINS) COIN_ICON_ITEM's. |
void | fdScriptSetMessageId (Sint32 msg) | The script command "set message": the number of the script's next message, written to the field state's message. |
Sint32 | fdActorGetSpriteById (Sint32 key) | Returns the sprite (the first animation's id) of the actor whose id is key's under SPEAKER_ACTOR_MASK, or -1 if there is no such animated actor. |
Sint32 | fdActorFindBySprite (Sint32 spriteId) | Returns the first of the scene's placed actors (from ACTOR_FIRST_PLACED) showing spriteId, or -1. |
Description
Script commands on actors: their callbacks, sprite priority and still
pictures. Part of script_commands.c.
Macros in detail
COIN_ICON_ITEM
#define COIN_ICON_ITEM 0
Item 0's icon, a gold coin, which an actor shows for coins.
Referenced by fdActorShowItemIconById().
Definition at line 198 of file script_commands_actor_commands.c.
Functions in detail
fdActorClearDestinationAndStand
void fdActorClearDestinationAndStand(Uint32 actorId)
Clears an actor's destination, starts its idle script and stands it still.
References fdActorLookup() and fdActorSelectAnimationStub().
Definition at line 9 of file script_commands_actor_commands.c.
fdActorFaceDirectionById
void fdActorFaceDirectionById(Sint32 actorId, Sint32 angle, Sint32 ticks)
The script command "actor face direction": the actor turns toward angle
(TRIG_TURN a full turn; fdActorStepAngle), then the script waits the given
number of ticks.
References ActorStepAngleScript, fdActorLookup(), fdActorStartScriptStub(), fdScriptWait() and Sint32.
Referenced by fdActorFaceDirection(), fdActorJumpDownLedge(), fdClimbDown(), fdDjinnRunBattleStartHop(), fdDjinnRunJupiterJoinEffect(), fdDjinnRunMarsJoinEffect(), fdDjinnRunMercuryJoinEffect(), fdDjinnRunVenusJoinEffect(), fdPsynergyRetreat(), fdSummonTabletPlayRunes(), fdTeleportPlaySparks(), scAirsRockInsideReadRevealTablet(), scAirsRockInsideRiseOnLift(), scAirsRockInsideWalkToRevealTablet(), scAlhafraFatherLetsPartyToCave(), scAlhafraFindGoldCoins(), scAlhafraMadransArrive(), scAlhafraManorBriggsEscapes(), scAlhafraManorDefendTheMayor(), scAlhafraManorPointOutAirsRock(), scAlhafraManorTellOfTheEasternSea(), scAlhafraPirateSeesMadrasMayor(), scAlhafraSailorToldToWork(), scAncientLemuriaCycloneRevealsRime(), scAncientLemuriaHeadForTheDock(), scAncientLemuriaMeetTheLemurians(), scAnemosInnerSanctumDullahanOpenTheWay(), scAttekaInletHammetsMessengerArrives(), scAttekaInletKradenAsksToSetSail(), scAttekaInletShipwrightsStopTheParty(), scCavernsWalkIntoPassage(), scCavernsWalkSouthIntoPassage(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesObabaMournsSalamander(), scContigoReturnToNewHome(), scContigoTheReunion(), scDailaMeetAlex(), scDailaRoomsPracticeShout(), scDehkanPlateauCannonDropsPoundCube(), scDehkanPlateauCannonPoundsStake(), scEasternAlhafraBriggsStealsShip(), scEasternAlhafraMayorFindsShipGone(), scEasternAlhafraShipBriggsIsCaught(), scEasternAlhafraShipEoleoLifts(), scEasternAlhafraShipKnockDownTheBread(), scEasternAlhafraShipMayorArrives(), scGabombaCatacombsGabombaBestowsPower(), scGabombaStatueChamberDropIntoHole(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueChamberWhereIsTheOrb() and 35 more.
Definition at line 26 of file script_commands_actor_commands.c.
fdActorFaceDirectionAndRefreshById
void fdActorFaceDirectionAndRefreshById(Sint32 actorId, Sint32 angle)
Turns an actor a step toward angle (ActorStepAngleScript) and waits for the
script to end.
References ActorStepAngleScript, fdActorLookup(), fdActorStartScriptStub(), fdActorWaitForScriptEndById() and Sint32.
Referenced by fdActorFaceDirectionAndWait(), scAncientLemuriaMeetTheLemurians(), scAttekaInletCycloneUncoversGeode(), scAttekaInletHammaShowsTheWings(), scAttekaInletHammetsMessengerArrives(), scAttekaInletKradenAsksToSetSail(), scAttekaInletShipwrightsStopTheParty(), scChampaCliffCavesHandPieceToObaba(), scChampaCliffCavesObabaAsksForBriggs(), scChampaCliffCavesObabaAsksForSecondPiece(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scChampaCliffCavesObabaSeesAWeapon(), scContigoBabyThinks(), scContigoReturnToNewHome(), scContigoTheReunion(), scDehkanPlateauCannonCornered(), scDehkanPlateauCannonCracksPillars(), scGabombaStatueChamberAkafubuReachesChamber(), scGabombaStatueChamberGabombaNamesWitchDoctor(), scGabombaStatueChamberRideLiftDown(), scGabombaStatueChamberWhereIsTheOrb(), scIsletsTradeWithCow(), scKandoreanTempleClimbDownTheLadder(), scKandoreanTempleEnterTheCave(), scKandoreanTempleKradenSuspectsTheWall(), scKibomboCeremonyEnds(), scKibomboClimbDownLadder(), scKibomboDeadEndByTheStatue(), scKibomboPiersJoinsParty(), scKibomboPiersRefusesToLeave(), scMadraMeetKarst(), scYampiDesertClimbDownLadder() and scYampiDesertTrapKingScorpion().
Definition at line 40 of file script_commands_actor_commands.c.
fdActorSetSpritePriority
void fdActorSetSpritePriority(Uint32 actorId, Sint32 priority)
The script command "set actor sprite priority": fixes the priority of the
actor's sprite and its shadow, which then no longer follow its depth: clears
ACTOR_PRIORITY_AUTOMATIC.
References fdActorLookup() and Sint32.
Referenced by fdActorCenterOnColumn(), fdPsynergyCyclone(), scActorHide(), scAirsRockInsideBlowGust(), scAlhafraMadransArrive(), scAncientLemuriaCycloneRevealsRime(), scAncientLemuriaMeetTheLemurians(), scAnemosInnerSanctumFinishMovingBlock(), scAquaRockSinkInside(), scAttekaInletShareLeadersPriority(), scAttekaInletShareLeadersPriorityWithBoulder(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scContigoKeepPriorityWithLeader(), scContigoPlaceWingPart(), scDailaEnterDoor(), scDailaRoomsStartLeaderScript(), scDailaRoomsTakeSeaGodsTear(), scDehkanPlateauCannonCracksPillars(), scDehkanPlateauCannonFleesEast(), scDehkanPlateauCannonPoundsLeaderThrough(), scDehkanPlateauInitEntrance(), scDehkanPlateauInitPillars(), scDehkanPlateauInitTightropes(), scDehkanPlateauKeepPriorityWithLeader(), scDehkanPlateauLeaveRoom(), scDehkanPlateauPlaceTightropesPillar(), scDehkanPlateauStepOnCrack(), scDehkanPlateauStepOnPillarsCrumblingPillars(), scDehkanPlateauStepOnTightropesPillars(), scFieldActorSetSpritePriority(), scGabombaStatueChamberInitWitchDoctor(), scGabombaStatueChamberRideLiftBackUp(), scGabombaStatueChamberRideLiftDown(), scInit(), scIsletCavePlaceNorthSouthLog(), scIsletCavePlaceWestEastLog(), scIzumoEnterDoor(), scIzumoRoomsRecognizeTheHeroes(), scIzumoStopThePartyToThankThem(), scIzumoTellTheCloudBrandLegend(), scJupiterLighthouseBringInBeam(), scJupiterLighthouseMoveSocketBlock(), scJupiterLighthouseStartMovingBlock(), scKandoreanTempleClimbDownTheWell(), scKandoreanTempleEnterTheCave(), scKandoreanTempleMatchStudentsToLeader(), scKandoreanTempleMeetPoi(), scKandoreanTemplePrepareColumn() and 69 more.
Definition at line 55 of file script_commands_actor_commands.c.
fdActorCopyGraphics
void fdActorCopyGraphics(Uint32 targetId, Uint32 srcId)
Makes the target actor's sprite show the source actor's graphics (its VRAM
block and tile). Neither actor is checked for NULL.
References fdActorGetById().
Referenced by scCrumblingPillarPlaceWithStandIn(), scCrumblingPillarStepWithStandIn(), scMagmaRockInsideRestorePillars(), scMagmaRockInsideStepOnTrap(), scMagmaRockStepOnTrap() and scTrialRoadStepOnTrap().
Definition at line 73 of file script_commands_actor_commands.c.
fdActorDisableById
void fdActorDisableById(Uint32 id)
Stops actor id moving and colliding and hides it.
References fdActorGetById() and fdActorSetSpriteFlagsStub().
Referenced by scActorHide(), scCrumblingPillarPlace(), scCrumblingPillarPlaceWithStandIn(), scCrumblingPillarPrepare(), scDehkanPlateauInitEntrance(), scDehkanPlateauInitPillars(), scDehkanPlateauInitTightropes(), scGabombaStatueChamberInitIdol(), scGabombaStatueChamberInitWitchDoctor(), scGabombaStatueHideActor(), scInit(), scIsletsInitSoutheastAngara(), scKandoreanTemplePrepareColumn(), scKandoreanTemplePrepareLift(), scKandoreanTempleStartChestbeaterRoom(), scKandoreanTempleStartGate(), scKibomboInitStatueGrounds(), scKibomboInitVillageByDay(), scMadraCatacombsSetUpVillage(), scMagmaRockInsideRestoreCrumblingPillars(), scMagmaRockInsideRestorePillars(), scMagmaRockRestoreCrumblingPillars(), scPillarTakeOutOfPlay(), scPrepareMap(), scShrineOfTheSeaGodInitBrokenBridges(), scShrineOfTheSeaGodInitExterior(), scShrineOfTheSeaGodInitSideRoom(), scShrineOfTheSeaGodLightTorch(), scShrineOfTheSeaGodPlaceFootprints(), scShrineOfTheSeaGodSetUpBridge(), scShrineOfTheSeaGodSetUpFloatingLog(), scShrineOfTheSeaGodSetUpPuddle(), scYampiDesertBuryScorpion(), scYampiDesertSetStakeSunk() and scYampiDesertSetUpTrappedScorpion().
Definition at line 92 of file script_commands_actor_commands.c.
fdActorSetSpriteRotationById
void fdActorSetSpriteRotationById(Sint32 id, Sint32 rotation)
Turns actor id's sprite to rotation (1/65536 turns).
References fdActorGetById() and Sint32.
Referenced by scEasternAlhafraShipBriggsIsCaught(), scFieldActorSetSpriteRotationById(), scInit(), scMadraRoomsShinAngersPiers() and scVenusLighthouseEntranceWakeUp().
Definition at line 102 of file script_commands_actor_commands.c.
fdActorFallOverById
void fdActorFallOverById(Uint32 id, Uint32 angle)
Lays actor id down along angle, a quarter turn rounded: shows its first tick turned, shifted by the side it falls to, and blocks its metatile and the metatile beyond it.
References fdActorGetById(), fdActorSelectAnimationStub(), fdMapGridSetMetatileBehaviorAtStub() and syVectorAddPolarOffset().
Referenced by scInit(), scKibomboInitHouses(), scSuhallaGateSetUpCliffs() and scYallamRoomsTalkToSunshine().
Definition at line 114 of file script_commands_actor_commands.c.
fdActorFallOverWithAnimationById
void fdActorFallOverWithAnimationById(Sint32 id, Uint32 angle, Sint32 animation)
fdActorFallOverById with an animation of the actor's sprite sheet (-1 for
none) and the fall moving the actor itself half a metatile the way it falls.
References fdActorGetById(), fdActorSelectAnimationStub(), fdMapGridSetMetatileBehaviorAtStub(), Sint32 and syVectorAddPolarOffset().
Referenced by scInit() and scSuhallaGateSetUpRoad().
Definition at line 153 of file script_commands_actor_commands.c.
fdActorShowItemIconById
void fdActorShowItemIconById(Sint32 id, Sint32 item)
Shows an actor as an item's icon, its sprite's only picture: the item, or for
coins (SCOOPED_COINS) COIN_ICON_ITEM's.
References fdActorGetById(), fdSpriteAnimationClearStub(), mnIconDrawItemStub(), Sint32, syHeapSlotAllocate(), syHeapSlotRelease() and syVRAMCacheLoad().
Referenced by fdPlaceTreasureSpots(), fdScoopDigUpItem(), scChampaCliffCavesHandPieceToObaba(), scChampaCliffCavesObabaForgesTrident(), scFieldActorShowItemIconById() and scInit().
Definition at line 202 of file script_commands_actor_commands.c.
fdScriptSetMessageId
void fdScriptSetMessageId(Sint32 msg)
The script command "set message": the number of the script's next message, written to the field state's message.
References Sint32.
Referenced by dbIncreaseItemAndLevelShowCharacterName(), dbIncreaseItemAndLevelShowName(), dbShopTestTalkToSunshine(), dbShopTestTalkToSunshinesWife(), fdRunPsynergyScript(), fdScriptRunMessage(), fdUseItem(), scAirsRockInsideReadRevealTablet(), scAlhafraAskWhetherIndraMoved(), scAlhafraBackloggedWithCanoes(), scAlhafraFatherLetsPartyToCave(), scAlhafraFindGoldCoins(), scAlhafraGiveBreadToHungryBoy(), scAlhafraMadransArrive(), scAlhafraManorAskAboutAlhafra(), scAlhafraManorAskIfTheHeroes(), scAlhafraManorBriggsEscapes(), scAlhafraManorComplainAboutTheMayor(), scAlhafraManorDefendTheMayor(), scAlhafraManorPointOutAirsRock(), scAlhafraManorTellOfTheEasternSea(), scAlhafraMayorInAMeeting(), scAlhafraRoomsTalkToInnkeeper(), scAlhafraRoomsTalkToItemMerchant(), scAlhafraRoomsTalkToPriest(), scAlhafraSailorToldToWork(), scAlhafraTalkToHungryBoy(), scAncientLemuriaHeadForTheDock(), scAncientLemuriaMeetTheLemurians(), scAttekaInletAskKradenToSetSail(), scAttekaInletHammaShowsTheWings(), scAttekaInletHammetsMessengerArrives(), scAttekaInletKradenAsksToSetSail(), scAttekaInletShipwrightsStopTheParty(), scChampaCliffCavesAskIfBriggsLearned(), scChampaCliffCavesAskToComeIn(), scChampaCliffCavesFightAvimander(), scChampaCliffCavesObabaAsksForBriggs(), scChampaCliffCavesObabaAsksForSecondPiece(), scChampaCliffCavesObabaForgesTrident(), scChampaCliffCavesObabaMournsSalamander(), scChampaCliffCavesObabaOffersHelp(), scChampaCliffCavesObabaSeesAWeapon(), scChampaCliffCavesSailorSurrenders(), scChampaCliffCavesSailorTurnsAway(), scContigoAskAboutGeoglyph(), scContigoAskAboutSuperDice(), scContigoAskAboutWindLegend(), scContigoBabyThinks(), scContigoInitLuckyDice() and 236 more.
Definition at line 244 of file script_commands_actor_commands.c.
fdActorGetSpriteById
Sint32 fdActorGetSpriteById(Sint32 key)
Returns the sprite (the first animation's id) of the actor whose id is key's
under SPEAKER_ACTOR_MASK, or -1 if there is no such animated actor.
Referenced by fdActorClosePortrait(), fdMessageSetVoiceFromActor(), fdMessageShowAtActor(), fdMessageShowAtActorAndWait(), fdScriptShowTwoMessagesAndWait(), scChampaCloseTwoMessages() and scChampaShowTwoMessages().
Definition at line 251 of file script_commands_actor_commands.c.
fdActorFindBySprite
Sint32 fdActorFindBySprite(Sint32 spriteId)
Returns the first of the scene's placed actors (from ACTOR_FIRST_PLACED)
showing spriteId, or -1.
Definition at line 264 of file script_commands_actor_commands.c.