mirror of
https://github.com/dmolony/DiskBrowser.git
synced 2025-01-14 07:30:01 +00:00
more spell code
This commit is contained in:
parent
b19e89d7cf
commit
250c1a9bd9
@ -7,6 +7,9 @@ import com.bytezone.diskbrowser.utilities.Utility;
|
|||||||
public abstract class Character extends AbstractFile
|
public abstract class Character extends AbstractFile
|
||||||
// -----------------------------------------------------------------------------------//
|
// -----------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
|
static int MAGE_SPELLS = 0;
|
||||||
|
static int PRIEST_SPELLS = 1;
|
||||||
|
|
||||||
static String[] races = { "No race", "Human", "Elf", "Dwarf", "Gnome", "Hobbit" };
|
static String[] races = { "No race", "Human", "Elf", "Dwarf", "Gnome", "Hobbit" };
|
||||||
static String[] alignments = { "Unalign", "Good", "Neutral", "Evil" };
|
static String[] alignments = { "Unalign", "Good", "Neutral", "Evil" };
|
||||||
static String[] types =
|
static String[] types =
|
||||||
@ -78,6 +81,12 @@ public abstract class Character extends AbstractFile
|
|||||||
protected void checkKnownSpells (byte[] buffer, int ptr)
|
protected void checkKnownSpells (byte[] buffer, int ptr)
|
||||||
// ---------------------------------------------------------------------------------//
|
// ---------------------------------------------------------------------------------//
|
||||||
{
|
{
|
||||||
|
for (int i = 0; i < 7; i++)
|
||||||
|
{
|
||||||
|
spellAllowance[MAGE_SPELLS][i] = Utility.getShort (buffer, ptr + 8 + i * 2);
|
||||||
|
spellAllowance[PRIEST_SPELLS][i] = Utility.getShort (buffer, ptr + 22 + i * 2);
|
||||||
|
}
|
||||||
|
|
||||||
int bit = 1; // skip first bit
|
int bit = 1; // skip first bit
|
||||||
int val = buffer[ptr];
|
int val = buffer[ptr];
|
||||||
mysteryBit = (val & 0x01) == 1;
|
mysteryBit = (val & 0x01) == 1;
|
||||||
|
@ -24,8 +24,8 @@ class CharacterV1 extends Character
|
|||||||
public int ageInWeeks;
|
public int ageInWeeks;
|
||||||
public int assetValue;
|
public int assetValue;
|
||||||
|
|
||||||
int[] mageSpells = new int[7];
|
// int[] mageSpells = new int[7];
|
||||||
int[] priestSpells = new int[7];
|
// int[] priestSpells = new int[7];
|
||||||
|
|
||||||
private final List<Spell> spellBook = new ArrayList<> ();
|
private final List<Spell> spellBook = new ArrayList<> ();
|
||||||
private final List<Possession> possessions = new ArrayList<> ();
|
private final List<Possession> possessions = new ArrayList<> ();
|
||||||
@ -80,12 +80,6 @@ class CharacterV1 extends Character
|
|||||||
|
|
||||||
checkKnownSpells (buffer, 138);
|
checkKnownSpells (buffer, 138);
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++)
|
|
||||||
mageSpells[i] = buffer[146 + i * 2];
|
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++)
|
|
||||||
priestSpells[i] = buffer[160 + i * 2];
|
|
||||||
|
|
||||||
armourClass = buffer[176];
|
armourClass = buffer[176];
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -141,12 +135,12 @@ class CharacterV1 extends Character
|
|||||||
text.append ("\nLuck ............... " + attributes[5]);
|
text.append ("\nLuck ............... " + attributes[5]);
|
||||||
|
|
||||||
text.append ("\n\nMage spell points ..");
|
text.append ("\n\nMage spell points ..");
|
||||||
for (int i = 0; i < mageSpells.length; i++)
|
for (int i = 0; i < spellAllowance[MAGE_SPELLS].length; i++)
|
||||||
text.append (" " + mageSpells[i]);
|
text.append (" " + spellAllowance[MAGE_SPELLS][i]);
|
||||||
|
|
||||||
text.append ("\nPriest spell points ");
|
text.append ("\nPriest spell points ");
|
||||||
for (int i = 0; i < priestSpells.length; i++)
|
for (int i = 0; i < spellAllowance[PRIEST_SPELLS].length; i++)
|
||||||
text.append (" " + priestSpells[i]);
|
text.append (" " + spellAllowance[PRIEST_SPELLS][i]);
|
||||||
|
|
||||||
text.append ("\n\nSpells :");
|
text.append ("\n\nSpells :");
|
||||||
for (Spell s : spellBook)
|
for (Spell s : spellBook)
|
||||||
|
@ -99,12 +99,6 @@ public class CharacterV4 extends Character
|
|||||||
|
|
||||||
checkKnownSpells (buffer, 139);
|
checkKnownSpells (buffer, 139);
|
||||||
|
|
||||||
for (int i = 0; i < 7; i++)
|
|
||||||
{
|
|
||||||
spellAllowance[MAGE_SPELLS][i] = Utility.getShort (buffer, 147 + i * 2);
|
|
||||||
spellAllowance[PRIEST_SPELLS][i] = Utility.getShort (buffer, 161 + i * 2);
|
|
||||||
}
|
|
||||||
|
|
||||||
hpCalCmd = Utility.getSignedShort (buffer, 175);
|
hpCalCmd = Utility.getSignedShort (buffer, 175);
|
||||||
// armourClass = Utility.getSignedShort (buffer, 177); // see offset 39
|
// armourClass = Utility.getSignedShort (buffer, 177); // see offset 39
|
||||||
healPts = Utility.getShort (buffer, 179);
|
healPts = Utility.getShort (buffer, 179);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user