Skip to content

Commit

Permalink
Merge pull request #3309 from ToolMan2k/GetGameInfo
Browse files Browse the repository at this point in the history
Maniacs Feature - Partially implement command GetGameInfo (3021)
  • Loading branch information
Ghabry authored Jan 4, 2025
2 parents 8038b7b + 8ed2054 commit 4ab1f87
Show file tree
Hide file tree
Showing 7 changed files with 259 additions and 18 deletions.
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

0 comments on commit 4ab1f87

Please sign in to comment.