Skip to content

Commit

Permalink
Tweak output for ToV enemy group and encounter group.
Browse files Browse the repository at this point in the history
  • Loading branch information
AdmiralCurtiss committed Dec 15, 2023
1 parent 9d8d4ce commit 63f8bbb
Show file tree
Hide file tree
Showing 2 changed files with 35 additions and 27 deletions.
53 changes: 32 additions & 21 deletions HyoutaToolsLib/Tales/Vesperia/T8BTEMEG/EncounterGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -12,44 +12,55 @@ public class EncounterGroup {
public string RefString;
public uint[] EnemyGroupIDs;

public EncounterGroup( System.IO.Stream stream, uint refStringStart, EndianUtils.Endianness endian, BitUtils.Bitness bits ) {
uint entryLength = stream.ReadUInt32().FromEndian( endian );
ID = stream.ReadUInt32().FromEndian( endian );
StringDicID = stream.ReadUInt32().FromEndian( endian );
InGameID = stream.ReadUInt32().FromEndian( endian );
ulong refLoc = stream.ReadUInt( bits, endian );
public EncounterGroup(System.IO.Stream stream, uint refStringStart, EndianUtils.Endianness endian, BitUtils.Bitness bits) {
uint entryLength = stream.ReadUInt32().FromEndian(endian);
ID = stream.ReadUInt32().FromEndian(endian);
StringDicID = stream.ReadUInt32().FromEndian(endian);
InGameID = stream.ReadUInt32().FromEndian(endian);
ulong refLoc = stream.ReadUInt(bits, endian);

EnemyGroupIDs = new uint[10];
for ( int i = 0; i < 10; ++i ) {
EnemyGroupIDs[i] = stream.ReadUInt32().FromEndian( endian );
for (int i = 0; i < 10; ++i) {
EnemyGroupIDs[i] = stream.ReadUInt32().FromEndian(endian);
}

RefString = stream.ReadAsciiNulltermFromLocationAndReset( (long)( refStringStart + refLoc ) );
RefString = stream.ReadAsciiNulltermFromLocationAndReset((long)(refStringStart + refLoc));
}

public override string ToString() {
return RefString;
}

public string GetDataAsHtml( T8BTEMGP.T8BTEMGP enemyGroups, T8BTEMST.T8BTEMST enemies, Dictionary<uint, TSS.TSSEntry> inGameIdDict, GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage ) {
public string GetDataAsHtml(T8BTEMGP.T8BTEMGP enemyGroups, T8BTEMST.T8BTEMST enemies, Dictionary<uint, TSS.TSSEntry> inGameIdDict, GameVersion version, string versionPostfix, GameLocale locale, WebsiteLanguage websiteLanguage) {
StringBuilder sb = new StringBuilder();

sb.Append( "<tr><td>" );
sb.Append( RefString );
sb.Append( "<br>" );
sb.Append( inGameIdDict[StringDicID].StringEngOrJpnHtml( version, inGameIdDict, websiteLanguage ) );
for ( int i = 0; i < EnemyGroupIDs.Length; ++i ) {
if ( EnemyGroupIDs[i] == 0xFFFFFFFFu ) { continue; }
sb.Append("<tr id=\"engroup" + InGameID + "\">");

sb.Append("<td>");
sb.Append(RefString).Append("<br>");
sb.Append("ID: ").Append(ID).Append("<br>");
sb.Append("InGameId: ").Append(InGameID).Append("<br>");
sb.Append(inGameIdDict[StringDicID].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage)).Append("<br>");
sb.Append("</td>");

for (int i = 0; i < EnemyGroupIDs.Length; ++i) {
if (EnemyGroupIDs[i] == 0xFFFFFFFFu) { continue; }

sb.Append("<td>");
var group = enemyGroups.EnemyGroupIdDict[EnemyGroupIDs[i]];
foreach ( int enemyId in group.EnemyIDs ) {
if ( enemyId < 0 ) { continue; }
sb.Append("[").Append(EnemyGroupIDs[i]).Append("] ").Append(group.RefString);
sb.Append("<br>");

foreach (int enemyId in group.EnemyIDs) {
if (enemyId < 0) { continue; }
sb.Append("<br>");
var enemy = enemies.EnemyIdDict[(uint)enemyId];
sb.Append( inGameIdDict[enemy.NameStringDicID].StringEngOrJpnHtml( version, inGameIdDict, websiteLanguage ) );
sb.Append( "<br>" );
sb.Append("[").Append(enemyId).Append("] ");
sb.Append(inGameIdDict[enemy.NameStringDicID].StringEngOrJpnHtml(version, inGameIdDict, websiteLanguage));
}
sb.Append("</td>");
}
sb.Append( "</td></tr>" );
sb.Append("</tr>");

return sb.ToString();
}
Expand Down
9 changes: 3 additions & 6 deletions HyoutaToolsLib/Tales/Vesperia/T8BTEMGP/EnemyGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -71,19 +71,16 @@ public string GetDataAsHtml( T8BTEMST.T8BTEMST enemies, Dictionary<uint, TSS.TSS
sb.Append( "<br>" );
sb.Append( inGameIdDict[StringDicID].StringEngOrJpnHtml( version, inGameIdDict, websiteLanguage ) );
sb.Append( "<br>" );
sb.Append( "ID: " );
sb.Append( ID );
sb.Append( "<br>" );
sb.Append( "InGameId: " );
sb.Append( InGameID );
sb.Append( "<br>" );
sb.Append( "ID: " ).Append(ID).Append("<br>");
sb.Append( "InGameId: " ).Append(InGameID).Append("<br>");
sb.Append( "Flag: " );
sb.Append( SomeFlag );
sb.Append( "</td>" );

for ( int i = 0; i < EnemyIDs.Length; ++i ) {
sb.Append( "<td>" );
if ( EnemyIDs[i] >= 0 ) {
sb.Append("[").Append(EnemyIDs[i]).Append("] ");
sb.Append( inGameIdDict[enemies.EnemyIdDict[(uint)EnemyIDs[i]].NameStringDicID].StringEngOrJpnHtml( version, inGameIdDict, websiteLanguage ) );
sb.Append( "<br>" );
sb.Append( "~1: " );
Expand Down

0 comments on commit 63f8bbb

Please sign in to comment.