dmolony-DiskBrowser/src/com/bytezone/diskbrowser/wizardry/Character.java

45 lines
1.6 KiB
Java
Raw Normal View History

2020-02-11 07:29:55 +00:00
package com.bytezone.diskbrowser.wizardry;
import com.bytezone.diskbrowser.applefile.AbstractFile;
2022-06-10 05:56:48 +00:00
import com.bytezone.diskbrowser.utilities.Utility;
2020-02-11 07:29:55 +00:00
// -----------------------------------------------------------------------------------//
public abstract class Character extends AbstractFile
2020-02-11 07:29:55 +00:00
// -----------------------------------------------------------------------------------//
{
static String[] races = { "No race", "Human", "Elf", "Dwarf", "Gnome", "Hobbit" };
static String[] alignments = { "Unalign", "Good", "Neutral", "Evil" };
static String[] types =
{ "Fighter", "Mage", "Priest", "Thief", "Bishop", "Samurai", "Lord", "Ninja" };
static String[] statuses =
{ "OK", "Afraid", "Asleep", "Paralyze", "Stoned", "Dead", "Ashes", "Lost" };
2022-06-10 05:56:48 +00:00
static char[] awardsText = ">!$#&*<?BCPKODG@".toCharArray ();
2020-02-11 07:29:55 +00:00
int scenario;
2020-02-11 07:29:55 +00:00
2022-04-06 08:05:37 +00:00
// ---------------------------------------------------------------------------------//
Character (String name, byte[] buffer)
2022-04-06 08:05:37 +00:00
// ---------------------------------------------------------------------------------//
2020-02-11 07:29:55 +00:00
{
super (name, buffer);
2020-02-11 07:29:55 +00:00
}
2022-06-10 05:56:48 +00:00
// ---------------------------------------------------------------------------------//
public String getAwardString ()
// ---------------------------------------------------------------------------------//
{
StringBuilder text = new StringBuilder ();
int awards = Utility.getShort (buffer, 206);
for (int i = 0; i < 16; i++)
{
if ((awards & 0x01) != 0)
text.append (awardsText[i]);
awards >>>= 1;
}
return text.toString ();
}
}