ScummVM API documentation
Asylum::Actor Class Reference
Inheritance diagram for Asylum::Actor:
Common::Serializable

Public Member Functions

 Actor (AsylumEngine *engine, ActorIndex index)
 
void setActionIndex2 (int32 index)
 
void setObjectIndex (int32 index)
 
void setDirection (ActorDirection dir)
 
void setFrameCount (int32 count)
 
void setFrameIndex (int32 number)
 
void setLastScreenUpdate (int32 tick)
 
void setNumberFlag01 (int32 number)
 
void setPriority (int32 priority)
 
void setResourceId (ResourceId id)
 
void setSoundResourceId (ResourceId id)
 
void setStatus (ActorStatus status)
 
void setTransparency (int32 val)
 
void setTickCount (int32 tickCount)
 
void setField934 (int32 val)
 
void setField938 (int32 val)
 
void setField944 (int32 val)
 
int32 getActionIndex3 ()
 
Common::RectgetBoundingRect ()
 
ActorDirection getDirection ()
 
uint32 getFrameCount ()
 
uint32 getFrameIndex ()
 
char * getName ()
 
ActorIndex getNextActorIndex ()
 
int32 getNumberValue01 ()
 
Common::PointgetPoint ()
 
Common::PointgetPoint1 ()
 
Common::PointgetPoint2 ()
 
int32 getPriority ()
 
ResourceId getResourceId ()
 
ResourceId getResourcesId (uint32 index)
 
int32 getScriptIndex ()
 
bool shouldInvertPriority ()
 
ResourceId getSoundResourceId ()
 
ActorStatus getStatus ()
 
int32 getTickCount ()
 
int32 getField934 ()
 
int32 getField944 ()
 
int32 getField948 ()
 
int32 getField94C ()
 
ActorDatagetData ()
 
void load (Common::SeekableReadStream *stream)
 
bool isVisible ()
 
bool isOnScreen ()
 
void show ()
 
void hide ()
 
void draw ()
 
void drawNumber ()
 
void update ()
 
void enable ()
 
void changeStatus (ActorStatus status)
 
void updateReflectionData ()
 
void changeDirection (ActorDirection direction)
 
void faceTarget (uint32 target, DirectionFrom from)
 
void setPosition (int16 newX, int16 newY, ActorDirection newDirection, uint32 frame)
 
bool canChangeStatus (int index) const
 
void adjustCoordinates (Common::Point *point)
 
void stopSound ()
 
Common::String toString (bool shortString=true)
 
void clearReflectionData ()
 
bool canReach (const Common::Point &point)
 
void forceTo (int16 actorX, int16 actorY, bool doSpeech)
 
void setupReflectionData (ActorIndex nextActor, int32 actionAreaId, ActorDirection nextDirection, const Common::Point &nextPosition, bool invertPriority, const Common::Point &nextPositionOffset)
 
bool aNicePlaceToTalk (Common::Point *point, int32 *param)
 
bool canMove (Common::Point *point, ActorDirection direction, uint32 count, bool hasDelta)
 
void move (ActorDirection dir, uint32 distance)
 
bool testActorCollision (Common::Point *point, ActorDirection direction)
 
void drawInventory ()
 
void stopWalking ()
 
bool checkBoredStatus () const
 
void saveLoadWithSerializer (Common::Serializer &s)
 

Static Public Member Functions

static void crowsReturn (AsylumEngine *engine)
 
static void morphInto (AsylumEngine *engine, int nextPlayer)
 
static ActorDirection getAngle (const Common::Point &vec1, const Common::Point &vec2)
 
static uint32 euclidianDistance (const Common::Point &point1, const Common::Point &point2)
 

Public Attributes

int32 flags
 
int32 actionType
 
Inventory inventory
 

Member Function Documentation

◆ load()

void Asylum::Actor::load ( Common::SeekableReadStream stream)

Loads the actor

Parameters
streamIf non-null, the Common::SeekableReadStream to load from

◆ isVisible()

bool Asylum::Actor::isVisible ( )
inline

Query if this actor is visible.

Returns
true if visible, false if not.

◆ isOnScreen()

bool Asylum::Actor::isOnScreen ( )

Query if this actor is on screen.

Returns
true if on screen, false if not.

◆ show()

void Asylum::Actor::show ( )
inline

Shows this actor.

◆ hide()

void Asylum::Actor::hide ( )
inline

Hides this actor.

◆ draw()

void Asylum::Actor::draw ( )

Draws the actor

◆ drawNumber()

void Asylum::Actor::drawNumber ( )

Draw number text (called on scene drawing)

◆ update()

void Asylum::Actor::update ( )

Updates the actor.

◆ enable()

void Asylum::Actor::enable ( )
inline

Enables the actor

◆ changeStatus()

void Asylum::Actor::changeStatus ( ActorStatus  status)

Changes the actor status.

Parameters
statusThe status.

◆ updateReflectionData()

void Asylum::Actor::updateReflectionData ( )

Updates the actor's mirror image.

◆ changeDirection()

void Asylum::Actor::changeDirection ( ActorDirection  direction)

Updates resource Id using the actor direction.

Parameters
directionThe direction.

◆ faceTarget()

void Asylum::Actor::faceTarget ( uint32  target,
DirectionFrom  from 
)

Face a target from a certain direction

Parameters
targetIdentifier for the target.
fromdirection to face from.

◆ setPosition()

void Asylum::Actor::setPosition ( int16  newX,
int16  newY,
ActorDirection  newDirection,
uint32  frame 
)

Initialize the x1/y1 values of the actor, update the active animation frame and, if the current direction isn't 8, update the actor's direction.

Parameters
newXThe new x coordinate.
newYThe new y coordinate.
newDirectionThe new direction.
frameThe frame.

◆ canChangeStatus()

bool Asylum::Actor::canChangeStatus ( int  index) const

Query if a graphic resource is present.

Parameters
indexZero-based index of the graphic resource.
Returns
true if the graphic resource is present.

◆ adjustCoordinates()

void Asylum::Actor::adjustCoordinates ( Common::Point point)

Adjust coordinates.

Parameters
pointThe point.

◆ stopSound()

void Asylum::Actor::stopSound ( )

Stop the actor related sounds

◆ toString()

Common::String Asylum::Actor::toString ( bool  shortString = true)

Convert this object into a string representation.

Parameters
shortStringtoggle whether to output a summary or detailed view of the actor object
Returns
A string representation of this object.

◆ clearReflectionData()

void Asylum::Actor::clearReflectionData ( )

Clears reflection-related data fields

◆ checkBoredStatus()

bool Asylum::Actor::checkBoredStatus ( ) const

Query if the object resource is present in the resource table between indices 10 & 20

Returns
true if resource present between 15 & 20, false if not.

◆ morphInto()

static void Asylum::Actor::morphInto ( AsylumEngine engine,
int  nextPlayer 
)
static

Updates the player appearance in chapter 9.

Parameters
[in,out]engineIf non-null, the engine.
nextPlayerThe next player index

◆ getAngle()

static ActorDirection Asylum::Actor::getAngle ( const Common::Point vec1,
const Common::Point vec2 
)
static

Gets a direction using the angle between the two vectors.

Parameters
vec1The first vector.
vec2The second vector.
Returns
The direction

◆ euclidianDistance()

static uint32 Asylum::Actor::euclidianDistance ( const Common::Point point1,
const Common::Point point2 
)
static

Gets the euclidean distance between two points.

Parameters
point1The first point.
point2The second point.
Returns
the distance.

The documentation for this class was generated from the following file: