Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Maniacs Feature - Partially implement command GetGameInfo (3021) #3309

Merged
merged 3 commits into from
Jan 4, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
75 changes: 75 additions & 0 deletions src/game_actor.h
Original file line number Diff line number Diff line change
Expand Up @@ -243,46 +243,93 @@ class Game_Actor final : public Game_Battler {
*/
StringView GetName() const override;

/**
* Gets actor name from the database.
*
* @return name.
*/
StringView GetOriginalName() const;

/**
* Gets actor character sprite filename.
*
* @return character sprite filename.
*/
StringView GetSpriteName() const override;

/**
* Gets actor character sprite filename from the database.
*
* @return character sprite filename.
*/
StringView GetOriginalSpriteName() const;

/**
* Gets actor character sprite index.
*
* @return character sprite index.
*/
int GetSpriteIndex() const;

/**
* Gets actor character sprite index from the database.
*
* @return character sprite index.
*/
int GetOriginalSpriteIndex() const;

/**
* Gets the transparency level of the actor sprite
*/
int GetSpriteTransparency() const;

/**
* Gets the transparency level of the actor sprite from the database.
*/
int GetOriginalSpriteTransparency() const;

/**
* Gets actor face graphic filename.
*
* @return face graphic filename.
*/
StringView GetFaceName() const;

/**
* Gets actor face graphic filename from the database.
*
* @return face graphic filename.
*/
StringView GetOriginalFaceName() const;

/**
* Gets actor face graphic index.
*
* @return face graphic index.
*/
int GetFaceIndex() const;

/**
* Gets actor face graphic index from the database.
*
* @return face graphic index.
*/
int GetOriginalFaceIndex() const;

/**
* Gets actor title.
*
* @return title.
*/
StringView GetTitle() const;

/**
* Gets actor title from the database.
*
* @return title.
*/
StringView GetOriginalTitle() const;

/**
* Gets actor equipped weapon ID.
*
Expand Down Expand Up @@ -960,6 +1007,10 @@ inline StringView Game_Actor::GetName() const {
: StringView(dbActor->name);
}

inline StringView Game_Actor::GetOriginalName() const {
return dbActor->name;
}

inline void Game_Actor::SetTitle(const std::string &new_title) {
data.title = (new_title != dbActor->title)
? new_title
Expand All @@ -972,36 +1023,60 @@ inline StringView Game_Actor::GetTitle() const {
: StringView(dbActor->title);
}

inline StringView Game_Actor::GetOriginalTitle() const {
return dbActor->title;
}

inline StringView Game_Actor::GetSpriteName() const {
return (!data.sprite_name.empty())
? StringView(data.sprite_name)
: StringView(dbActor->character_name);
}

inline StringView Game_Actor::GetOriginalSpriteName() const {
return dbActor->character_name;
}

inline int Game_Actor::GetSpriteIndex() const {
return (!data.sprite_name.empty())
? data.sprite_id
: dbActor->character_index;
}

inline int Game_Actor::GetOriginalSpriteIndex() const {
return dbActor->character_index;
}

inline int Game_Actor::GetSpriteTransparency() const {
return (!data.sprite_name.empty())
? data.transparency
: (dbActor->transparent ? 3 : 0);
}

inline int Game_Actor::GetOriginalSpriteTransparency() const {
return dbActor->transparent ? 3 : 0;
}

inline StringView Game_Actor::GetFaceName() const {
return (!data.face_name.empty())
? StringView(data.face_name)
: StringView(dbActor->face_name);
}

inline StringView Game_Actor::GetOriginalFaceName() const {
return dbActor->face_name;
}

inline int Game_Actor::GetFaceIndex() const {
return (!data.face_name.empty())
? data.face_id
: dbActor->face_index;
}

inline int Game_Actor::GetOriginalFaceIndex() const {
return dbActor->face_index;
}

inline int Game_Actor::GetLevel() const {
return data.level;
}
Expand Down
Loading
Loading