From 0e08f0b47faaededb347f7153359cea23226578f Mon Sep 17 00:00:00 2001 From: Taimon Date: Sun, 27 Dec 2009 01:10:16 +0800 Subject: [PATCH 01/37] Merged devSin's new version. --- infinity/gui/BrowserMenuBar.java | 8 +- infinity/resource/AbstractAbility.java | 8 +- infinity/resource/EffectFactory.java | 50 ++++++----- infinity/resource/ResourceFactory.java | 1 - infinity/resource/are/Animation.java | 8 +- infinity/resource/are/AreResource.java | 9 +- infinity/resource/are/Container.java | 3 +- infinity/resource/are/Door.java | 14 +-- infinity/resource/are/ITEPoint.java | 22 +++-- infinity/resource/are/RestSpawn.java | 2 +- infinity/resource/are/Song.java | 12 +++ infinity/resource/are/SpawnPoint.java | 2 +- infinity/resource/bcs/Decompiler.java | 1 + infinity/resource/chu/ChuResource.java | 6 +- infinity/resource/chu/Window.java | 6 +- infinity/resource/cre/CreResource.java | 40 ++++----- infinity/resource/dlg/DlgResource.java | 4 +- infinity/resource/gam/GamResource.java | 39 ++++++-- infinity/resource/gam/PartyNPC.java | 21 ++--- infinity/resource/gam/ViewerNPC.java | 2 +- infinity/resource/itm/Ability.java | 67 +++++++++----- infinity/resource/itm/ItmResource.java | 120 +++++++++++-------------- infinity/resource/itm/Viewer.java | 4 +- infinity/resource/key/Keyfile.java | 1 - infinity/resource/spl/Ability.java | 2 +- infinity/resource/spl/SplResource.java | 6 +- infinity/resource/sto/ItemSale11.java | 2 +- infinity/resource/sto/StoResource.java | 7 +- infinity/resource/wmp/AreaEntry.java | 8 +- infinity/resource/wmp/AreaLink.java | 2 +- infinity/resource/wmp/MapEntry.java | 14 +-- infinity/resource/wmp/ViewerArea.java | 4 +- infinity/resource/wmp/WmpResource.java | 8 +- 33 files changed, 276 insertions(+), 227 deletions(-) diff --git a/infinity/gui/BrowserMenuBar.java b/infinity/gui/BrowserMenuBar.java index 1f89829..abf1907 100644 --- a/infinity/gui/BrowserMenuBar.java +++ b/infinity/gui/BrowserMenuBar.java @@ -285,7 +285,7 @@ private JMenu makeOptionsMenu(Preferences prefs, NearInfinity browser) bg.add(selectBcsIndent[i]); } - JMenu showresrefmenu = new JMenu("Show ResourceRefs as"); + JMenu showresrefmenu = new JMenu("Show ResourceRefs As"); menu.add(showresrefmenu); int selectedresref = prefs.getInt(OPTION_SHOWRESREF, RESREF_REF_NAME); showResRef[RESREF_ONLY] = new JRadioButtonMenuItem("Filename", selectedresref == RESREF_ONLY); @@ -574,7 +574,7 @@ private FileMenu() fileExport = makeMenuItem("Export...", KeyEvent.VK_E, Icons.getIcon("Export16.gif"), -1, this); fileExport.setEnabled(false); add(fileExport); - fileAddCopy = makeMenuItem("Add Copy of...", KeyEvent.VK_A, Icons.getIcon("Add16.gif"), -1, this); + fileAddCopy = makeMenuItem("Add Copy Of...", KeyEvent.VK_A, Icons.getIcon("Add16.gif"), -1, this); fileAddCopy.setEnabled(false); add(fileAddCopy); fileRename = makeMenuItem("Rename...", KeyEvent.VK_R, Icons.getIcon("Edit16.gif"), -1, this); @@ -831,7 +831,7 @@ private ToolsMenu() addSeparator(); - JMenu checkMenu = new JMenu("Check Triggers & Actions for"); + JMenu checkMenu = new JMenu("Check Triggers & Actions For"); checkMenu.setIcon(Icons.getIcon("Refresh16.gif")); toolCheckAllDialog = new JMenuItem("All Dialogues"); toolCheckAllDialog.addActionListener(this); @@ -856,7 +856,7 @@ private ToolsMenu() toolCheckResRef.setToolTipText("Reports resource references pointing to nonexistent files"); add(toolCheckResRef); - JMenu findMenu = new JMenu("Find Unknown IDS References in"); + JMenu findMenu = new JMenu("Find Unknown IDS References In"); findMenu.setIcon(Icons.getIcon("Find16.gif")); toolCheckIDSBCSRef = new JMenuItem("BCS & BS Files"); toolCheckIDSBCSRef.addActionListener(this); diff --git a/infinity/resource/AbstractAbility.java b/infinity/resource/AbstractAbility.java index 91ed6fd..800968a 100644 --- a/infinity/resource/AbstractAbility.java +++ b/infinity/resource/AbstractAbility.java @@ -12,7 +12,7 @@ public abstract class AbstractAbility extends AbstractStruct { protected static final String[] s_type = {"", "Melee", "Ranged", "Magical", "Launcher"}; - protected static final String[] s_targettype = {"", "Living actor", "", "Dead actor", + protected static final String[] s_targettype = {"", "Living actor", "Inventory", "Dead actor", "Any point within range", "Caster", "", "Caster (keep spell, no animation)"}; protected static final String[] s_dmgtype = {"None", "Piercing", "Crushing", "Slashing", "Missile", @@ -43,7 +43,7 @@ protected void setAddRemovableOffset(AddRemovable datatype) { if (datatype instanceof Effect && getEffectsCount() >= 1) { SectionOffset effectOffset = (SectionOffset)getSuperStruct().getAttribute("Effects offset"); - int effectIndex = ((DecNumber)getAttribute("Effects index")).getValue() + getEffectsCount() - 1; + int effectIndex = ((DecNumber)getAttribute("First effect index")).getValue() + getEffectsCount() - 1; datatype.setOffset(effectOffset.getValue() + effectIndex * 48); } } @@ -55,7 +55,7 @@ public int getEffectsCount() public void incEffectsIndex(int value) { - ((DecNumber)getAttribute("Effects index")).incValue(value); + ((DecNumber)getAttribute("First effect index")).incValue(value); } public int readEffects(byte buffer[], int off) throws Exception @@ -71,7 +71,7 @@ public int readEffects(byte buffer[], int off) throws Exception public void setEffectsIndex(int value) { - ((DecNumber)getAttribute("Effects index")).setValue(value); + ((DecNumber)getAttribute("First effect index")).setValue(value); } public void writeEffects(OutputStream os) throws IOException diff --git a/infinity/resource/EffectFactory.java b/infinity/resource/EffectFactory.java index 6225945..b414a34 100644 --- a/infinity/resource/EffectFactory.java +++ b/infinity/resource/EffectFactory.java @@ -88,27 +88,25 @@ public final class EffectFactory "Stories-bones-tell", "Magic missiles 1", "Magic missiles 2", "Magic missiles 3", "Magic missiles 4", "Magic missiles 5", "Magic missiles 6", "Magic missiles 7", "Magic missiles 8", - "Magic missiles 9", "Magic missiles 10", "Skull mob", - "One skull at the target", "Swarm curse", "Bees fly to target, no damage", - "Adder's kiss", "Ice knife", "Pacify", "Strength", "Ball lightning", - "Ball lightning 2", "Blood bridge", "Force missiles", "Improved strength", - "Shroud of shadows", "Cloudkill", "Howl of pandemonium", "Bladestorm", - "Elysium's fires", "Abyssal fury", "Horror", "Knock", "Hold undead", - "Missile of patience", "Elysium's tears", + "Magic missiles 9", "Magic missiles 10", "Skull mob", "Skull mob 2", + "Swarm curse", "Swarm curse 2", "Adder's kiss", "Ice knife", "Pacify", + "Strength", "Ball lightning", "Ball lightning 2", "Blood bridge", + "Force missiles", "Improved strength", "Shroud of shadows", "Cloudkill", + "Howl of pandemonium", "Bladestorm", "Elysium's fires", "Abyssal fury", + "Horror", "Knock", "Hold undead", "Missile of patience", "Elysium's tears", "Tasha's unbearable derisive laughter", "Axe of torment", "Blacksphere", "Cone of cold", "Desert hell", "Fire and ice", "Chain lightning storm", "Acid storm", "Stygian ice storm", "Meteor storm bombardment", "Deathbolt", "Ignus' fury", "Power word, blind", "Mechanus' cannon", "Celestial host", - "Rune of torment", "Blessing, scripture of steel", "Curse, seeking flames", - "", "Halo of lesser revelation", "Spiritual hammer", "Call lightning", "", - "Vampiric touch", "Confusion", "Power word, kill", - "Globe of invulnerability", "Nordom's crossbow bolts", "Raise dead", - "Innate fear ability", "Conflagration", "Traps projectile", + "Rune of torment", "Blessing", "Curse", "", "Halo of lesser revelation", + "Spiritual hammer", "Call lightning", "", "Vampiric touch", "Confusion", + "Power word, kill", "Globe of invulnerability", "Nordom's crossbow bolt", + "Raise dead", "Aura of fear", "Conflagration", "Special trap", "Ignus' fireball", "Tongues of flame 1", "Tongues of flame 2", "Tongues of flame 3", "Tongues of flame 4", "Tongues of flame 5", "Ignus' terror", "Infernal orb", "Fiery rain", "Elemental strike", "Reign of anger 1", "Reign of anger 2", "Reign of anger 3", - "Reign of anger 4", "Reign of anger 5", "Power of one", "Kiss", + "Reign of anger 4", "Reign of anger 5", "Power of one", "Succubus kiss", "Embalming"}; private static final String s_visuals[] = {"None", "Hit abjuration", "Hit alteration", "Hit invocation", "Hit necromancy", "Hit conjuration", @@ -218,7 +216,7 @@ private EffectFactory() "Slay", "Reverse alignment", "Change alignment", "Dispel effects", "Stealth bonus", "Casting failure", "Unknown (3D)", "Bonus priest spells", "Infravision", "Remove infravision", "Blur", - "Translucent", "Summon creature", "Unsummon creature", + "Translucency", "Summon creature", "Unsummon creature", "Nondetection", "Remove nondetection", "Change gender", "Change AI type", "Attack damage bonus", "Blindness", "Cure blindness", "Feeblemindedness", "Cure feeblemindedness", @@ -300,7 +298,7 @@ private EffectFactory() "Slay", "Reverse alignment", "Change alignment", "Dispel effects", "Stealth bonus", "Casting failure", "Unknown (3D)", "Bonus priest spells", "Infravision", "Remove infravision", "Blur", - "Translucent", "Summon creature", "Unsummon creature", + "Translucency", "Summon creature", "Unsummon creature", "Nondetection", "Remove nondetection", "Change gender", "Change AI type", "Attack damage bonus", "Blindness", "Cure blindness", "Feeblemindedness", "Cure feeblemindedness", @@ -388,7 +386,7 @@ private EffectFactory() "Slay", "Reverse alignment", "Change alignment", "Dispel effects", "Stealth bonus", "Casting failure", "Unknown (3D)", "Bonus priest spells", "Infravision", "Remove infravision", "Blur", - "Translucent", "Summon creature", "Unsummon creature", + "Translucency", "Summon creature", "Unsummon creature", "Nondetection", "Remove nondetection", "Change gender", "Change AI type", "Attack damage bonus", "Blindness", "Cure blindness", "Feeblemindedness", "Cure feeblemindedness", @@ -511,7 +509,7 @@ private EffectFactory() "Slay", "Reverse alignment", "Change alignment", "Dispel effects", "Move silently bonus", "Casting failure", "Unknown (3D)", "Bonus priest spells", "Infravision", "Remove infravision", "Blur", - "Translucent", "Summon creature", "Unsummon creature", + "Translucency", "Summon creature", "Unsummon creature", "Nondetection", "Remove nondetection", "Change gender", "Change AI type", "Attack damage bonus", "Blindness", "Cure blindness", "Feeblemindedness", "Cure feeblemindedness", @@ -589,7 +587,7 @@ private EffectFactory() "Melee weapon damage bonus", "Missile weapon damage bonus", "Remove feet circle", "Fist THAC0 bonus", "Fist damage bonus", "Change title", "Disable visual effects", "Immunity to backstab", - "Set persistent AI", "Unknown (126)", "Disable permanent death", + "Set persistent AI", "Set existence delay", "Disable permanent death", "Immunity to specific animation", "Immunity to turn undead", "Pocket plane", "Chaos shield effect", "Modify collision behavior", "Critical threat range bonus", "Can use any item", @@ -667,7 +665,7 @@ private EffectFactory() "Base attack bonus", "Slay", "Reverse alignment", "Change alignment", "Dispel effects", "Move silently bonus", "Casting failure", "Alchemy", "Bonus priest spells", "Infravision", "Remove infravision", "Blur", - "Translucent", "Summon creature", "Unsummon creature", "Nondetection", + "Translucency", "Summon creature", "Unsummon creature", "Nondetection", "Remove nondetection", "Change gender", "Change AI type", "Attack damage bonus", "Blindness", "Cure blindness", "Feeblemindedness", "Cure feeblemindedness", "Disease", @@ -1067,7 +1065,7 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i "Level 4", "Level 5", "Level 6", "Level 7"})); break; - case 0x42: // Translucent (CGameEffectTranslucent) + case 0x42: // Translucency (CGameEffectTranslucent) s.add(new DecNumber(buffer, offset, 4, "Fade amount")); s.add(new Unknown(buffer, offset + 4, 4)); break; @@ -1505,9 +1503,9 @@ else if (gameid == ResourceFactory.ID_TORMENT) { case 0xC9: // Play BAM with effects s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Effect", - new String[]{"Cloak of warding", "Shield", "Black barbed shield", + new String[]{"Cloak of warding", "Shield", "Black-barbed shield", "Pain mirror", "Guardian mantle", "", - "Enoll eva's duplication", "Armor", "Antimagic shield", + "Enoll eva's duplication", "Armor", "Antimagic shell", "", "", "Flame walk", "Protection from evil", "Conflagration", "Infernal shield", "Submerge the will", "Balance in all things"})); @@ -1735,7 +1733,6 @@ else if (gameid == ResourceFactory.ID_BG2 || case 0x123: // Disable visual effects (CGameEffectPreventSpellProtectionEffects) case 0x124: // Immunity to backstab (CGameEffectImmunityToBackstab) case 0x125: // Set persistent AI (CGameEffectPreventAISlowDown) - case 0x126: // Unknown (126) (CGameEffectExistanceDelayOverride) case 0x127: // Disable permanent death (CGameEffectNoPermanentDeath) case 0x129: // Immunity to turn undead (CGameEffectImmunityToTurnUndead) case 0x12C: // Modify collision behavior (CGameEffectNPCBump) @@ -1783,7 +1780,7 @@ else if (gameid == ResourceFactory.ID_BG2 || if (ResourceFactory.getInstance().resourceExists("PROJECTL.IDS")) s.add(new IdsBitmap(buffer, offset + 4, 4, "Projectile", "PROJECTL.IDS")); else - s.add(new HexNumber(buffer, offset + 4, 4, "Projectile")); + s.add(new Bitmap(buffer, offset + 4, 4, "Projectile", s_projectile)); break; case 0xC6: // Reflect specified effect (CGameEffectBounceEffect) @@ -2069,6 +2066,11 @@ else if (gameid == ResourceFactory.ID_BG2 || new String[]{"Records screen", "Class name"})); break; + case 0x126: // Set existence delay (CGameEffectExistanceDelayOverride) + s.add(new Unknown(buffer, offset, 4)); + s.add(new DecNumber(buffer, offset + 4, 4, "Interval override")); + break; + case 0x128: // Immunity to specific animation (CGameEffectImmunityToVisualEffect) restype = "VVC"; break; diff --git a/infinity/resource/ResourceFactory.java b/infinity/resource/ResourceFactory.java index 9194c7c..40e435f 100644 --- a/infinity/resource/ResourceFactory.java +++ b/infinity/resource/ResourceFactory.java @@ -208,7 +208,6 @@ else if (entry.getExtension().equalsIgnoreCase("IDS") || entry.getExtension().equalsIgnoreCase("RES") || entry.getExtension().equalsIgnoreCase("INI") || entry.getExtension().equalsIgnoreCase("TXT") || - entry.getExtension().equalsIgnoreCase("BAK") || (entry.getExtension().equalsIgnoreCase("SRC") && getGameID() == ID_ICEWIND2)) res = new PlainTextResource(entry); else if (entry.getExtension().equalsIgnoreCase("MVE")) diff --git a/infinity/resource/are/Animation.java b/infinity/resource/are/Animation.java index d8cbca3..472ba60 100644 --- a/infinity/resource/are/Animation.java +++ b/infinity/resource/are/Animation.java @@ -37,17 +37,15 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new Flag(buffer, offset + 52, 4, "Appearance", s_flag)); list.add(new DecNumber(buffer, offset + 56, 2, "Location: Z")); list.add(new DecNumber(buffer, offset + 58, 2, "Translucency")); - list.add(new DecNumber(buffer, offset + 60, 2, "Start frame number")); + list.add(new Unknown(buffer, offset + 60, 2)); list.add(new DecNumber(buffer, offset + 62, 1, "Loop probability")); list.add(new DecNumber(buffer, offset + 63, 1, "Start delay (frames)")); if (ResourceFactory.getGameID() == ResourceFactory.ID_BG2 || ResourceFactory.getGameID() == ResourceFactory.ID_BG2TOB || ResourceFactory.getGameID() == ResourceFactory.ID_TUTU) list.add(new ResourceRef(buffer, offset + 64, "Palette", "BMP")); - else { - list.add(new Unknown(buffer, offset + 64, 4)); - list.add(new Unknown(buffer, offset + 68, 4)); - } + else + list.add(new Unknown(buffer, offset + 64, 8)); list.add(new Unknown(buffer, offset + 72, 4)); return offset + 76; } diff --git a/infinity/resource/are/AreResource.java b/infinity/resource/are/AreResource.java index 5f53e4e..c3bbd04 100644 --- a/infinity/resource/are/AreResource.java +++ b/infinity/resource/are/AreResource.java @@ -20,7 +20,7 @@ public final class AreResource extends AbstractStruct implements Resource, HasAd private static final String s_flag[] = {"No flags set", "Outdoor", "Day/Night", "Weather", "City", "Forest", "Dungeon", "Extended night", "Can rest"}; - private static final String s_flag_torment[] = {"No flags set", "Hive", "", "Clerk's ward", "Lower ward", + private static final String s_flag_torment[] = {"Indoors", "Hive", "", "Clerk's ward", "Lower ward", "Ravel's maze", "Baator", "Rubikon", "Negative material plane", "Curst", "Carceri", "Allow day/night"}; @@ -39,7 +39,8 @@ public static void addScriptNames(Set scriptNames, byte buffer[]) // Actors if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND || ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOW || - ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOWTOT) + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOWTOT || + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) addScriptNames(scriptNames, buffer, Byteconvert.convertInt(buffer, offset + 84), (int)Byteconvert.convertShort(buffer, offset + 88), 272); @@ -267,11 +268,11 @@ protected int read(byte buffer[], int offset) throws Exception SectionCount count_actors = new SectionCount(buffer, offset + 88, 2, "# actors", Actor.class); list.add(count_actors); - SectionCount count_itepoints = new SectionCount(buffer, offset + 90, 2, "# trigger points", + SectionCount count_itepoints = new SectionCount(buffer, offset + 90, 2, "# triggers", ITEPoint.class); list.add(count_itepoints); SectionOffset offset_itepoints = new SectionOffset(buffer, offset + 92, - "Trigger points offset", + "Triggers offset", ITEPoint.class); list.add(offset_itepoints); SectionOffset offset_spoints = new SectionOffset(buffer, offset + 96, "Spawn points offset", diff --git a/infinity/resource/are/Container.java b/infinity/resource/are/Container.java index 6782d2c..d219bc1 100644 --- a/infinity/resource/are/Container.java +++ b/infinity/resource/are/Container.java @@ -152,8 +152,7 @@ protected int read(byte buffer[], int offset) throws Exception // list.add(new ResourceRef(buffer, offset + 88, "Creature?", "CRE")); list.add(new Unknown(buffer, offset + 88, 32)); list.add(new ResourceRef(buffer, offset + 120, "Key", "ITM")); - list.add(new Unknown(buffer, offset + 128, 2)); - list.add(new Unknown(buffer, offset + 130, 2)); + list.add(new Unknown(buffer, offset + 128, 4)); list.add(new StringRef(buffer, offset + 132, "Lockpick string")); list.add(new Unknown(buffer, offset + 136, 56)); return offset + 192; diff --git a/infinity/resource/are/Door.java b/infinity/resource/are/Door.java index 3d17fb4..a6b0246 100644 --- a/infinity/resource/are/Door.java +++ b/infinity/resource/are/Door.java @@ -64,7 +64,7 @@ public void readVertices(byte buffer[], int offset) throws Exception public int updateVertices(int offset, int number) { - // MÂ anta at antallet er riktig + // Må anta at antallet er riktig ((DecNumber)getAttribute("First vertex index (open)")).setValue(number); int count = ((DecNumber)getAttribute("# vertices (open)")).getValue(); ((DecNumber)getAttribute("First vertex index (closed)")).setValue(number + count); @@ -135,8 +135,8 @@ protected int read(byte buffer[], int offset) throws Exception OpenVertexImpeded.class)); list.add(new SectionCount(buffer, offset + 78, 2, "# vertices (impeded, closed)", ClosedVertexImpeded.class)); list.add(new DecNumber(buffer, offset + 80, 4, "First vertex index (impeded, closed)")); - list.add(new Unknown(buffer, offset + 84, 2)); - list.add(new Unknown(buffer, offset + 86, 2)); + list.add(new Unknown(buffer, offset + 84, 4)); +// list.add(new Unknown(buffer, offset + 86, 2)); list.add(new ResourceRef(buffer, offset + 88, "Opening sound", "WAV")); list.add(new ResourceRef(buffer, offset + 96, "Closing sound", "WAV")); list.add(new DecNumber(buffer, offset + 104, 4, "Cursor frame number")); @@ -155,11 +155,11 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 148, 2, "Close location: X")); list.add(new DecNumber(buffer, offset + 150, 2, "Close location: Y")); list.add(new StringRef(buffer, offset + 152, "Unlock message")); - list.add(new TextString(buffer, offset + 156, 32, "Travel trigger name")); + list.add(new TextString(buffer, offset + 156, 24, "Travel trigger name")); // list.add(new Unknown(buffer, offset + 172, 8)); - list.add(new StringRef(buffer, offset + 188, "Door name")); - list.add(new ResourceRef(buffer, offset + 192, "Dialogue", "DLG")); -// list.add(new Unknown(buffer, offset + 192, 8)); + list.add(new StringRef(buffer, offset + 180, "Speaker name")); + list.add(new ResourceRef(buffer, offset + 184, "Dialogue", "DLG")); + list.add(new Unknown(buffer, offset + 192, 8)); return offset + 200; } } diff --git a/infinity/resource/are/ITEPoint.java b/infinity/resource/are/ITEPoint.java index be994e6..7330a2b 100644 --- a/infinity/resource/are/ITEPoint.java +++ b/infinity/resource/are/ITEPoint.java @@ -11,19 +11,19 @@ public final class ITEPoint extends AbstractStruct implements AddRemovable, HasVertices, HasAddRemovable { private static final String[] s_type = {"Proximity trigger", "Info trigger", "Travel trigger"}; - private static final String[] s_flag = {"No flags set", "Trap undetectable", "Trap resets", "Party required", "Trap detectable", + private static final String[] s_flag = {"No flags set", "Locked", "Trap resets", "Party required", "Trap detectable", "", "", "Trap set off by NPC", "", "Trigger deactivated", "Cannot be passed by NPC", "Use activation point", "Connected to door"}; private static final String[] s_yesno = {"No", "Yes"}; public ITEPoint() throws Exception { - super(null, "Trigger point", new byte[196], 0); + super(null, "Trigger", new byte[196], 0); } public ITEPoint(AbstractStruct superStruct, byte buffer[], int offset) throws Exception { - super(superStruct, "Trigger point", buffer, offset); + super(superStruct, "Trigger", buffer, offset); } // --------------------- Begin Interface HasAddRemovable --------------------- @@ -103,13 +103,17 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new ResourceRef(buffer, offset + 124, "Script", "BCS")); list.add(new DecNumber(buffer, offset + 132, 2, "Activation point: X")); list.add(new DecNumber(buffer, offset + 134, 2, "Activation point: Y")); - list.add(new Unknown(buffer, offset + 136, 4)); - list.add(new Unknown(buffer, offset + 140, 4)); - list.add(new Unknown(buffer, offset + 144, 44)); - if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) - list.add(new ResourceRef(buffer, offset + 188, "Activation dialogue", "DLG")); +// list.add(new DecNumber(buffer, offset + 136, 2, "Override box: Right")); +// list.add(new DecNumber(buffer, offset + 138, 2, "Override box: Bottom")); + if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) { + list.add(new Unknown(buffer, offset + 136, 44)); + list.add(new DecNumber(buffer, offset + 180, 2, "Speaker point: X")); + list.add(new DecNumber(buffer, offset + 182, 2, "Speaker point: Y")); + list.add(new StringRef(buffer, offset + 184, "Speaker name")); + list.add(new ResourceRef(buffer, offset + 188, "Dialogue", "DLG")); + } else - list.add(new Unknown(buffer, offset + 188, 8)); + list.add(new Unknown(buffer, offset + 136, 60)); // list.add(new ResourceRef(buffer, offset + 188, "Proximity trigger dialog", "DLG")); return offset + 196; } diff --git a/infinity/resource/are/RestSpawn.java b/infinity/resource/are/RestSpawn.java index bcc2a1d..ee5d910 100644 --- a/infinity/resource/are/RestSpawn.java +++ b/infinity/resource/are/RestSpawn.java @@ -21,7 +21,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new StringRef(buffer, offset + 32 + i * 4, "Creature " + (i + 1) + " string")); for (int i = 0; i < 10; i++) list.add(new SpawnResourceRef(buffer, offset + 72 + i * 8, "Creature " + (i + 1))); - list.add(new DecNumber(buffer, offset + 152, 2, "# creatures in list")); + list.add(new DecNumber(buffer, offset + 152, 2, "# creatures")); list.add(new DecNumber(buffer, offset + 154, 2, "Encounter difficulty")); list.add(new DecNumber(buffer, offset + 156, 4, "Creature duration")); list.add(new DecNumber(buffer, offset + 160, 2, "Creature wander distance")); diff --git a/infinity/resource/are/Song.java b/infinity/resource/are/Song.java index 2795153..02b7c56 100644 --- a/infinity/resource/are/Song.java +++ b/infinity/resource/are/Song.java @@ -10,6 +10,9 @@ final class Song extends AbstractStruct // implements AddRemovable { + private static final String[] s_reverb = {"None", "Small room", "Medium room", + "Large room", "Outside", "Dungeon"}; + Song(AbstractStruct superStruct, byte buffer[], int offset) throws Exception { super(superStruct, "Songs", buffer, offset); @@ -31,6 +34,13 @@ else if (ResourceFactory.getInstance().resourceExists("MUSICLIS.IDS")) { list.add(new IdsBitmap(buffer, offset + 12, 4, "Battle song", "MUSICLIS.IDS")); list.add(new IdsBitmap(buffer, offset + 16, 4, "Defeat song", "MUSICLIS.IDS")); } + else if (ResourceFactory.getInstance().resourceExists("SONGS.IDS")) { + list.add(new IdsBitmap(buffer, offset, 4, "Day song", "SONGS.IDS")); + list.add(new IdsBitmap(buffer, offset + 4, 4, "Night song", "SONGS.IDS")); + list.add(new Unknown(buffer, offset + 8, 4)); + list.add(new IdsBitmap(buffer, offset + 12, 4, "Battle song", "SONGS.IDS")); + list.add(new Unknown(buffer, offset + 16, 4)); + } else { list.add(new DecNumber(buffer, offset, 4, "Day song")); list.add(new DecNumber(buffer, offset + 4, 4, "Night song")); @@ -65,6 +75,8 @@ else if (ResourceFactory.getInstance().resourceExists("MUSICLIS.IDS")) { } if (ResourceFactory.getInstance().resourceExists("REVERB.IDS")) list.add(new IdsBitmap(buffer, offset + 80, 4, "Reverb", "REVERB.IDS")); + else if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) + list.add(new Bitmap(buffer, offset + 80, 4, "Reverb", s_reverb)); else list.add(new Unknown(buffer, offset + 80, 4)); list.add(new Unknown(buffer, offset + 84, 60)); diff --git a/infinity/resource/are/SpawnPoint.java b/infinity/resource/are/SpawnPoint.java index 079f770..fb37928 100644 --- a/infinity/resource/are/SpawnPoint.java +++ b/infinity/resource/are/SpawnPoint.java @@ -32,7 +32,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 116, 2, "# creatures")); list.add(new DecNumber(buffer, offset + 118, 2, "Encounter difficulty")); list.add(new DecNumber(buffer, offset + 120, 2, "Spawn delay")); - list.add(new HexNumber(buffer, offset + 122, 2, "Spawn method?")); + list.add(new Flag(buffer, offset + 122, 2, "Spawn method", new String[]{"No flags set", "Spawn until paused", "Disable after spawn", "Spawn paused"})); list.add(new DecNumber(buffer, offset + 124, 4, "Creature duration")); list.add(new DecNumber(buffer, offset + 128, 2, "Creature wander distance")); list.add(new DecNumber(buffer, offset + 130, 2, "Creature movement distance")); diff --git a/infinity/resource/bcs/Decompiler.java b/infinity/resource/bcs/Decompiler.java index 2d410e3..6ebad68 100644 --- a/infinity/resource/bcs/Decompiler.java +++ b/infinity/resource/bcs/Decompiler.java @@ -261,6 +261,7 @@ private static void decompileInteger(StringBuilder code, long nr, String p) if (entry != null) code.append(entry.getString()); else if (nr != 0 && (map.toString().equalsIgnoreCase("AREATYPE.IDS") || + map.toString().equalsIgnoreCase("BITS.IDS") || map.toString().equalsIgnoreCase("SPLCAST.IDS") || map.toString().equalsIgnoreCase("STATE.IDS"))) { if (nr < 0) diff --git a/infinity/resource/chu/ChuResource.java b/infinity/resource/chu/ChuResource.java index 1b5551a..a57035c 100644 --- a/infinity/resource/chu/ChuResource.java +++ b/infinity/resource/chu/ChuResource.java @@ -42,13 +42,13 @@ protected int read(byte buffer[], int offset) throws Exception { list.add(new TextString(buffer, offset, 4, "Signature")); list.add(new TextString(buffer, offset + 4, 4, "Version")); - SectionCount numwindows = new SectionCount(buffer, offset + 8, 4, "# windows", + SectionCount numwindows = new SectionCount(buffer, offset + 8, 4, "# panels", Window.class); list.add(numwindows); - SectionOffset controlsoffset = new SectionOffset(buffer, offset + 12, "Controls table offset", + SectionOffset controlsoffset = new SectionOffset(buffer, offset + 12, "Controls offset", Control.class); list.add(controlsoffset); - SectionOffset windowsoffset = new SectionOffset(buffer, offset + 16, "Window entries offset", + SectionOffset windowsoffset = new SectionOffset(buffer, offset + 16, "Panels offset", Window.class); list.add(windowsoffset); diff --git a/infinity/resource/chu/Window.java b/infinity/resource/chu/Window.java index d25e705..a252c06 100644 --- a/infinity/resource/chu/Window.java +++ b/infinity/resource/chu/Window.java @@ -18,12 +18,12 @@ final class Window extends AbstractStruct // implements AddRemovable Window() throws Exception { - super(null, "Window", new byte[28], 0); + super(null, "Panel", new byte[28], 0); } Window(AbstractStruct superStruct, byte buffer[], int offset, int nr, int size) throws Exception { - super(superStruct, "Window " + nr, buffer, offset + (size - 28)); + super(superStruct, "Panel " + nr, buffer, offset + (size - 28)); if (size == 36) { list.add(0, new TextString(buffer, offset, 8, "Name")); setStartOffset(getOffset() - 8); @@ -82,7 +82,7 @@ public void writeControlsTable(OutputStream os) throws IOException protected int read(byte buffer[], int offset) throws Exception { - list.add(new DecNumber(buffer, offset, 4, "Window ID")); + list.add(new DecNumber(buffer, offset, 4, "Panel ID")); list.add(new DecNumber(buffer, offset + 4, 2, "Position: X")); list.add(new DecNumber(buffer, offset + 6, 2, "Position: Y")); list.add(new DecNumber(buffer, offset + 8, 2, "Width")); diff --git a/infinity/resource/cre/CreResource.java b/infinity/resource/cre/CreResource.java index 39682b1..7423881 100644 --- a/infinity/resource/cre/CreResource.java +++ b/infinity/resource/cre/CreResource.java @@ -20,7 +20,6 @@ public final class CreResource extends AbstractStruct implements Resource, HasAd private static final LongIntegerHashMap m_magetype = new LongIntegerHashMap(); private static final LongIntegerHashMap m_slotmask = new LongIntegerHashMap(); private static final LongIntegerHashMap m_colorPlacement = new LongIntegerHashMap(); - private static final LongIntegerHashMap m_zoom = new LongIntegerHashMap(); private static final String s_flag[] = {"No flags set", "", "No corpse", "Permanent corpse", "Original class: Fighter", "Original class: Mage", "Original class: Cleric", @@ -101,9 +100,6 @@ public final class CreResource extends AbstractStruct implements Resource, HasAd m_colorPlacement.put((long)0xE2, "Hair (pulsate)"); m_colorPlacement.put((long)0xE3, "Hair (hologram/pulsate)"); m_colorPlacement.put((long)0x00, "Not used"); - - m_zoom.put(0L, "No"); - m_zoom.put(65535L, "Yes"); } public static void addScriptName(Map> scriptNames, @@ -373,9 +369,7 @@ protected int read(byte buffer[], int offset) throws Exception HexNumber structOffset = new HexNumber(buffer, offset + 40, 4, "CRE structure offset"); list.add(structOffset); list.add(new HexNumber(buffer, offset + 44, 4, "CRE structure length")); - if (version.toString().equalsIgnoreCase("V2.2")) - list.add(new Unknown(buffer, offset + 48, structOffset.getValue() - 48)); - else { + if (version.toString().equalsIgnoreCase("V1.0")) { list.add(new IdsBitmap(buffer, offset + 48, 2, "Quick weapon slot 1", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 50, 2, "Quick weapon slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 52, 2, "Quick weapon slot 3", "SLOTS.IDS")); @@ -394,6 +388,8 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new HashBitmap(buffer, offset + 96, 2, "Show quick item 2?", m_slotmask)); list.add(new HashBitmap(buffer, offset + 98, 2, "Show quick item 3?", m_slotmask)); } + else + list.add(new Unknown(buffer, offset + 48, structOffset.getValue() - 48)); offset = structOffset.getValue(); list.add(new TextString(buffer, offset, 4, "Signature 2")); version = new TextString(buffer, offset + 4, 4, "Version 2"); @@ -421,8 +417,8 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new IdsFlag(buffer, offset + 24, 4, "Status", "STATE.IDS")); list.add(new DecNumber(buffer, offset + 28, 2, "Current HP")); list.add(new DecNumber(buffer, offset + 30, 2, "Maximum HP")); - list.add(new IdsBitmap(buffer, offset + 32, 4, "Animation", "ANIMATE.IDS")); -// list.add(new Unknown(buffer, offset + 34, 2)); + list.add(new IdsBitmap(buffer, offset + 32, 2, "Animation", "ANIMATE.IDS")); + list.add(new Unknown(buffer, offset + 34, 2)); list.add(new ColorValue(buffer, offset + 36, 1, "Metal color")); list.add(new ColorValue(buffer, offset + 37, 1, "Minor color")); list.add(new ColorValue(buffer, offset + 38, 1, "Major color")); @@ -557,7 +553,6 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 612, 1, "Morale")); list.add(new DecNumber(buffer, offset + 613, 1, "Morale break")); list.add(new DecNumber(buffer, offset + 614, 2, "Morale recovery")); -// list.add(new Unknown(buffer, offset + 615, 1)); list.add(new IdsBitmap(buffer, offset + 616, 4, "Kit", "KIT.IDS")); list.add(new ResourceRef(buffer, offset + 620, "Override script", "BCS")); list.add(new ResourceRef(buffer, offset + 628, "Special script 2", "BCS")); @@ -864,8 +859,8 @@ private int readOther(String version, byte buffer[], int offset) throws Exceptio list.add(new IdsFlag(buffer, offset + 24, 4, "Status", "STATE.IDS")); list.add(new DecNumber(buffer, offset + 28, 2, "Current HP")); list.add(new DecNumber(buffer, offset + 30, 2, "Maximum HP")); - list.add(new IdsBitmap(buffer, offset + 32, 4, "Animation", "ANIMATE.IDS")); -// list.add(new Unknown(buffer, offset + 34, 2)); + list.add(new IdsBitmap(buffer, offset + 32, 2, "Animation", "ANIMATE.IDS")); + list.add(new Unknown(buffer, offset + 34, 2)); // if (version.equalsIgnoreCase("V1.2") || version.equalsIgnoreCase("V1.1")) // list.add(new Unknown(buffer, offset + 36, 7)); // else { @@ -913,14 +908,13 @@ private int readOther(String version, byte buffer[], int offset) throws Exceptio list.add(new DecNumber(buffer, offset + 89, 1, "Resist crushing")); list.add(new DecNumber(buffer, offset + 90, 1, "Resist piercing")); list.add(new DecNumber(buffer, offset + 91, 1, "Resist missile")); -// if (version.equalsIgnoreCase("V1.2") || version.equalsIgnoreCase("V1.1")) { -// list.add(new DecNumber(buffer, offset + 92, 1, "Unused proficiencies")); + if (version.equalsIgnoreCase("V1.2") || version.equalsIgnoreCase("V1.1")) { + list.add(new DecNumber(buffer, offset + 92, 1, "Unspent proficiencies")); // list.add(new Unknown(buffer, offset + 93, 1)); -// } -// else { + } + else list.add(new UnsignDecNumber(buffer, offset + 92, 1, "Detect illusions")); - list.add(new UnsignDecNumber(buffer, offset + 93, 1, "Set traps")); -// } + list.add(new UnsignDecNumber(buffer, offset + 93, 1, "Set traps")); list.add(new DecNumber(buffer, offset + 94, 1, "Lore")); list.add(new UnsignDecNumber(buffer, offset + 95, 1, "Open locks")); list.add(new UnsignDecNumber(buffer, offset + 96, 1, "Move silently")); @@ -1041,7 +1035,7 @@ else if (ResourceFactory.getInstance().resourceExists("DIETY.IDS")) // m_zoom.put(0x0000L, "No"); // m_zoom.put(0xffffL, "Yes"); list.add(new Unknown(buffer, offset + 616, 24)); - list.add(new HashBitmap(buffer, offset + 640, 4, "Is disguised?", m_zoom)); + list.add(new Unknown(buffer, offset + 640, 4)); list.add(new Unknown(buffer, offset + 644, 8)); list.add(new Unknown(buffer, offset + 652, 4, "Overlays offset")); list.add(new Unknown(buffer, offset + 656, 4, "Overlays size")); @@ -1072,7 +1066,7 @@ else if (ResourceFactory.getInstance().resourceExists("DIETY.IDS")) "Increment team kills", "Invulnerable", "Good increment on death", "Law increment on death", "Lady increment on death", "Murder increment on death", - "Face dialogue target", "Call for help"})); + "Don't face speaker", "Call for help"})); // list.add(new Unknown(buffer, offset + 730, 2)); list.add(new IdsBitmap(buffer, offset + 732, 2, "Color 1", "CLOWNCLR.IDS")); list.add(new IdsBitmap(buffer, offset + 734, 2, "Color 2", "CLOWNCLR.IDS")); @@ -1211,13 +1205,13 @@ else if (version.equalsIgnoreCase("V9.0")) { offset = getExtraOffset() + offsetItemslots.getValue(); if (version.equalsIgnoreCase("V1.2")) { - list.add(new DecNumber(buffer, offset, 2, "Right earring/lens")); - list.add(new DecNumber(buffer, offset + 2, 2, "Armor")); + list.add(new DecNumber(buffer, offset, 2, "Right earring")); + list.add(new DecNumber(buffer, offset + 2, 2, "Chest")); list.add(new DecNumber(buffer, offset + 4, 2, "Left tattoo")); list.add(new DecNumber(buffer, offset + 6, 2, "Hand")); list.add(new DecNumber(buffer, offset + 8, 2, "Left ring")); list.add(new DecNumber(buffer, offset + 10, 2, "Right ring")); - list.add(new DecNumber(buffer, offset + 12, 2, "Left earring/eyeball")); + list.add(new DecNumber(buffer, offset + 12, 2, "Left earring")); list.add(new DecNumber(buffer, offset + 14, 2, "Right tattoo (lower)")); list.add(new DecNumber(buffer, offset + 16, 2, "Wrist")); list.add(new DecNumber(buffer, offset + 18, 2, "Weapon 1")); diff --git a/infinity/resource/dlg/DlgResource.java b/infinity/resource/dlg/DlgResource.java index 42824ed..eb33cdb 100644 --- a/infinity/resource/dlg/DlgResource.java +++ b/infinity/resource/dlg/DlgResource.java @@ -15,7 +15,7 @@ public final class DlgResource extends AbstractStruct implements Resource, HasAddRemovable, HasDetailViewer { private static final String sNonInt[] = {"Pausing dialogue", "Turn hostile", - "Escape area", "No override"}; + "Escape area", "Ignore attack"}; private SectionCount countState, countTrans, countStaTri, countTranTri, countAction; private SectionOffset offsetState, offsetTrans, offsetStaTri, offsetTranTri, offsetAction; private Viewer detailViewer; @@ -118,7 +118,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(countAction); if (offsetState.getValue() > 0x30) - list.add(new Flag(buffer, offset + 48, 4, "Dialogue type", sNonInt)); + list.add(new Flag(buffer, offset + 48, 4, "Threat response", sNonInt)); offset = offsetState.getValue(); for (int i = 0; i < countState.getValue(); i++) { diff --git a/infinity/resource/gam/GamResource.java b/infinity/resource/gam/GamResource.java index 922168b..0958bad 100644 --- a/infinity/resource/gam/GamResource.java +++ b/infinity/resource/gam/GamResource.java @@ -16,6 +16,9 @@ public final class GamResource extends AbstractStruct implements Resource, HasAd { private static final String s_formation[] = {"Button 1", "Button 2", "Button 3", "Button 4", "Button 5"}; private static final String s_weather[] = {"No weather", "Raining", "Snowing"}; + private static final String s_torment[] = {"Follow", "T", "Gather", "4 and 2", "3 by 2", + "Protect", "2 by 3", "Rank", "V", "Wedge", "S", + "Line", "None"}; public GamResource(ResourceEntry entry) throws Exception { @@ -83,7 +86,10 @@ protected int read(byte buffer[], int offset) throws Exception TextString version = new TextString(buffer, offset + 4, 4, "Version"); list.add(version); list.add(new DecNumber(buffer, offset + 8, 4, "Game time (game seconds)")); - list.add(new Bitmap(buffer, offset + 12, 2, "Selected formation", s_formation)); + if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) + list.add(new Bitmap(buffer, offset + 12, 2, "Selected formation", s_torment)); + else + list.add(new Bitmap(buffer, offset + 12, 2, "Selected formation", s_formation)); list.add(new DecNumber(buffer, offset + 14, 2, "Formation button 1")); list.add(new DecNumber(buffer, offset + 16, 2, "Formation button 2")); list.add(new DecNumber(buffer, offset + 18, 2, "Formation button 3")); @@ -104,10 +110,10 @@ protected int read(byte buffer[], int offset) throws Exception SectionCount count_unknown = new SectionCount(buffer, offset + 44, 4, "Unknown section count", UnknownSection2.class); list.add(count_unknown); - SectionOffset offset_nonpartynpc = new SectionOffset(buffer, offset + 48, "Non-party NPCs offset", + SectionOffset offset_nonpartynpc = new SectionOffset(buffer, offset + 48, "Non-party characters offset", NonPartyNPC.class); list.add(offset_nonpartynpc); - SectionCount count_nonpartynpc = new SectionCount(buffer, offset + 52, 4, "# non-party NPCs", + SectionCount count_nonpartynpc = new SectionCount(buffer, offset + 52, 4, "# non-party characters", NonPartyNPC.class); list.add(count_nonpartynpc); SectionOffset offset_global = new SectionOffset(buffer, offset + 56, "Global variables offset", @@ -125,7 +131,8 @@ protected int read(byte buffer[], int offset) throws Exception JournalEntry.class); list.add(offset_journal); - SectionOffset offKillvariable = null, offFamiliar = null, offIWD2 = null, offIWD = null, offLocation = null; + SectionOffset offKillvariable = null, offFamiliar = null, offIWD2 = null, offIWD = null; + SectionOffset offLocation = null, offRubikon = null, offBestiary = null; SectionCount numKillVariable = null, numIWD = null, numLocation = null; int gameid = ResourceFactory.getGameID(); @@ -152,15 +159,17 @@ else if (gameid == ResourceFactory.ID_ICEWIND || gameid == ResourceFactory.ID_IC list.add(new Unknown(buffer, offset + 108, 72)); } else if (gameid == ResourceFactory.ID_TORMENT) { // V1.1 - list.add(new HexNumber(buffer, offset + 84, 4, "Maze offset")); + offRubikon = new SectionOffset(buffer, offset + 84, "Modron maze offset", Unknown.class); + list.add(offRubikon); list.add(new DecNumber(buffer, offset + 88, 4, "Reputation")); list.add(new ResourceRef(buffer, offset + 92, "Current area", "ARE")); offKillvariable = new SectionOffset(buffer, offset + 100, "Kill variables offset", KillVariable.class); list.add(offKillvariable); numKillVariable = new SectionCount(buffer, offset + 104, 4, "# kill variables", KillVariable.class); list.add(numKillVariable); - list.add(new HexNumber(buffer, offset + 108, 4, "Bestiary offset")); - list.add(new ResourceRef(buffer, offset + 112, "Area", "ARE")); + offBestiary = new SectionOffset(buffer, offset + 108, "Bestiary offset", Unknown.class); + list.add(offBestiary); + list.add(new ResourceRef(buffer, offset + 112, "Current area?", "ARE")); list.add(new Unknown(buffer, offset + 120, 64)); } else if (gameid == ResourceFactory.ID_BG2 || gameid == ResourceFactory.ID_BG2TOB || @@ -219,6 +228,14 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { // V2.2 (V1.1 & V2.0 in BIFF) list.add(new UnknownSection2(this, buffer, offset + i * 20)); } + if (offRubikon != null) { // Torment + offset = offRubikon.getValue(); + if (offset > 0) { + list.add(new Unknown(buffer, offset, 1720, "Modron maze state")); + offset += 1720; + } + } + offset = offset_global.getValue(); for (int i = 0; i < count_global.getValue(); i++) { Variable var = new Variable(this, buffer, offset); @@ -242,6 +259,14 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { // V2.2 (V1.1 & V2.0 in BIFF) list.add(ent); } + if (offBestiary != null) { // Torment + offset = offBestiary.getValue(); + if (offset > 0) { + list.add(new Unknown(buffer, offset, 260, "Bestiary")); + offset += 260; + } + } + if (offFamiliar != null) { // BG2 offset = offFamiliar.getValue(); Familiar familiar = new Familiar(this, buffer, offset); diff --git a/infinity/resource/gam/PartyNPC.java b/infinity/resource/gam/PartyNPC.java index 199a7a2..ff37341 100644 --- a/infinity/resource/gam/PartyNPC.java +++ b/infinity/resource/gam/PartyNPC.java @@ -182,11 +182,12 @@ else if (gameid == ResourceFactory.ID_BG2 || gameid == ResourceFactory.ID_BG2TOB } else if (gameid == ResourceFactory.ID_TORMENT) { list.add(new DecNumber(buffer, offset + 40, 2, "Modal state")); - list.add(new Unknown(buffer, offset + 42, 98)); - list.add(new IdsBitmap(buffer, offset + 140, 2, "Quick weapon slot 1", "SLOTS.IDS")); - list.add(new IdsBitmap(buffer, offset + 142, 2, "Quick weapon slot 2", "SLOTS.IDS")); - list.add(new IdsBitmap(buffer, offset + 144, 2, "Quick weapon slot 3", "SLOTS.IDS")); - list.add(new IdsBitmap(buffer, offset + 146, 2, "Quick weapon slot 4", "SLOTS.IDS")); + list.add(new DecNumber(buffer, offset + 42, 2, "Happiness")); + list.add(new Unknown(buffer, offset + 44, 96)); + list.add(new DecNumber(buffer, offset + 140, 2, "Quick weapon slot 1")); + list.add(new DecNumber(buffer, offset + 142, 2, "Quick weapon slot 2")); + list.add(new DecNumber(buffer, offset + 144, 2, "Quick weapon slot 3")); + list.add(new DecNumber(buffer, offset + 146, 2, "Quick weapon slot 4")); list.add(new HashBitmap(buffer, offset + 148, 2, "Show quick weapon 1?", m_partyslot)); list.add(new HashBitmap(buffer, offset + 150, 2, "Show quick weapon 2?", m_partyslot)); list.add(new HashBitmap(buffer, offset + 152, 2, "Show quick weapon 3?", m_partyslot)); @@ -194,11 +195,11 @@ else if (gameid == ResourceFactory.ID_TORMENT) { list.add(new ResourceRef(buffer, offset + 156, "Quick spell 1", "SPL")); list.add(new ResourceRef(buffer, offset + 164, "Quick spell 2", "SPL")); list.add(new ResourceRef(buffer, offset + 172, "Quick spell 3", "SPL")); - list.add(new IdsBitmap(buffer, offset + 180, 2, "Quick item slot 1", "SLOTS.IDS")); - list.add(new IdsBitmap(buffer, offset + 182, 2, "Quick item slot 2", "SLOTS.IDS")); - list.add(new IdsBitmap(buffer, offset + 184, 2, "Quick item slot 3", "SLOTS.IDS")); - list.add(new IdsBitmap(buffer, offset + 186, 2, "Quick item slot 4", "SLOTS.IDS")); - list.add(new IdsBitmap(buffer, offset + 188, 2, "Quick item slot 5", "SLOTS.IDS")); + list.add(new DecNumber(buffer, offset + 180, 2, "Quick item slot 1")); + list.add(new DecNumber(buffer, offset + 182, 2, "Quick item slot 2")); + list.add(new DecNumber(buffer, offset + 184, 2, "Quick item slot 3")); + list.add(new DecNumber(buffer, offset + 186, 2, "Quick item slot 4")); + list.add(new DecNumber(buffer, offset + 188, 2, "Quick item slot 5")); list.add(new HashBitmap(buffer, offset + 190, 2, "Show quick item 1?", m_partyslot)); list.add(new HashBitmap(buffer, offset + 192, 2, "Show quick item 2?", m_partyslot)); list.add(new HashBitmap(buffer, offset + 194, 2, "Show quick item 3?", m_partyslot)); diff --git a/infinity/resource/gam/ViewerNPC.java b/infinity/resource/gam/ViewerNPC.java index fd0fb13..b9245d5 100644 --- a/infinity/resource/gam/ViewerNPC.java +++ b/infinity/resource/gam/ViewerNPC.java @@ -55,7 +55,7 @@ private JPanel makeStatsPanel(PartyNPC npc) gbl.setConstraints(tf1, gbc); panel.add(tf1); } - ViewerUtil.addLabelFieldPair(panel, npc.getAttribute("Happiness"), gbl, gbc, true); +// ViewerUtil.addLabelFieldPair(panel, npc.getAttribute("Happyness"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, npc.getAttribute("Selection state"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, npc.getAttribute("Party position"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, npc.getAttribute("Most powerful foe vanquished"), gbl, gbc, true); diff --git a/infinity/resource/itm/Ability.java b/infinity/resource/itm/Ability.java index e94aa15..388da93 100644 --- a/infinity/resource/itm/Ability.java +++ b/infinity/resource/itm/Ability.java @@ -17,7 +17,8 @@ final class Ability extends AbstractAbility implements AddRemovable, HasAddRemov private static final String[] s_launcher = {"None", "Bow", "Crossbow", "Sling"}; private static final String[] s_abilityuse = {"", "Weapon slots", "", "Item slots", "Gem"}; private static final String[] s_recharge = {"No flags set", "Add strength bonus", "Breakable", "", "", - "", "", "", "", "", "", "Hostile", "Recharge after resting"}; + "", "", "", "", "", "", "Hostile", "Recharge after resting", + "", "", "", "", "Bypass armor", "Keen edge"}; Ability() throws Exception { @@ -50,35 +51,55 @@ public JComponent getDetailViewer() protected int read(byte buffer[], int offset) throws Exception { - list.add(new Bitmap(buffer, offset, 1, "Type", s_type)); - list.add(new Bitmap(buffer, offset + 1, 1, "Identify to use?", s_yesno)); - list.add(new Bitmap(buffer, offset + 2, 1, "Ability location", s_abilityuse)); - list.add(new Unknown(buffer, offset + 3, 1)); - list.add(new ResourceRef(buffer, offset + 4, "Icon", "BAM")); - list.add(new Bitmap(buffer, offset + 12, 1, "Target", s_targettype)); - list.add(new UnsignDecNumber(buffer, offset + 13, 1, "# targets")); - list.add(new DecNumber(buffer, offset + 14, 2, "Range (feet)")); - list.add(new Bitmap(buffer, offset + 16, 2, "Launcher required", s_launcher)); - list.add(new DecNumber(buffer, offset + 18, 2, "Speed")); - list.add(new DecNumber(buffer, offset + 20, 2, "Bonus to hit")); - list.add(new DecNumber(buffer, offset + 22, 2, "Dice size")); - list.add(new DecNumber(buffer, offset + 24, 2, "# dice thrown")); + if (ResourceFactory.getGameID() == ResourceFactory.ID_BG2 || + ResourceFactory.getGameID() == ResourceFactory.ID_BG2TOB || + ResourceFactory.getGameID() == ResourceFactory.ID_TUTU) { + list.add(new Bitmap(buffer, offset, 1, "Type", s_type)); + list.add(new Bitmap(buffer, offset + 1, 1, "Identify to use?", s_yesno)); + list.add(new Bitmap(buffer, offset + 2, 1, "Ability location", s_abilityuse)); + list.add(new DecNumber(buffer, offset + 3, 1, "Alternate dice size")); + list.add(new ResourceRef(buffer, offset + 4, "Icon", "BAM")); + list.add(new Bitmap(buffer, offset + 12, 1, "Target", s_targettype)); + list.add(new UnsignDecNumber(buffer, offset + 13, 1, "# targets")); + list.add(new DecNumber(buffer, offset + 14, 2, "Range (feet)")); + list.add(new Bitmap(buffer, offset + 16, 1, "Launcher required", s_launcher)); + list.add(new DecNumber(buffer, offset + 17, 1, "Alternate # dice thrown")); + list.add(new DecNumber(buffer, offset + 18, 1, "Speed")); + list.add(new DecNumber(buffer, offset + 19, 1, "Alternate damage bonus")); + list.add(new DecNumber(buffer, offset + 20, 2, "Bonus to hit")); + list.add(new DecNumber(buffer, offset + 22, 1, "Dice size")); + list.add(new Bitmap(buffer, offset + 23, 1, "Primary type (school)", SplResource.s_school)); + list.add(new DecNumber(buffer, offset + 24, 1, "# dice thrown")); + list.add(new Bitmap(buffer, offset + 25, 1, "Secondary type", SplResource.s_category)); + } + else { + list.add(new Bitmap(buffer, offset, 1, "Type", s_type)); + list.add(new Bitmap(buffer, offset + 1, 1, "Identify to use?", s_yesno)); + list.add(new Bitmap(buffer, offset + 2, 2, "Ability location", s_abilityuse)); + list.add(new ResourceRef(buffer, offset + 4, "Icon", "BAM")); + list.add(new Bitmap(buffer, offset + 12, 2, "Target", s_targettype)); + list.add(new DecNumber(buffer, offset + 14, 2, "Range (feet)")); + list.add(new Bitmap(buffer, offset + 16, 2, "Launcher required", s_launcher)); + list.add(new DecNumber(buffer, offset + 18, 2, "Speed")); + list.add(new DecNumber(buffer, offset + 20, 2, "Bonus to hit")); + list.add(new DecNumber(buffer, offset + 22, 2, "Dice size")); + list.add(new DecNumber(buffer, offset + 24, 2, "# dice thrown")); + } list.add(new DecNumber(buffer, offset + 26, 2, "Damage bonus")); list.add(new Bitmap(buffer, offset + 28, 2, "Damage type", s_dmgtype)); list.add(new SectionCount(buffer, offset + 30, 2, "# effects", Effect.class)); - list.add(new DecNumber(buffer, offset + 32, 2, "Effects index")); + list.add(new DecNumber(buffer, offset + 32, 2, "First effect index")); list.add(new DecNumber(buffer, offset + 34, 2, "# charges")); list.add(new Bitmap(buffer, offset + 36, 2, "When drained", s_drain)); // list.add(new Unknown(buffer, offset + 37, 1)); -// list.add(new Bitmap(buffer, offset + 38, 1, "Allow strength bonus?", s_yesno)); + list.add(new Flag(buffer, offset + 38, 4, "Flags", s_recharge)); // list.add(new Bitmap(buffer, offset + 39, 1, "Item recharges?", s_recharge)); - list.add(new Flag(buffer, offset + 38, 2, "Flags", s_recharge)); - if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) - list.add( - new Bitmap(buffer, offset + 40, 2, "Attack type", - new String[]{"Normal", "Bypass armor", "Keen"})); - else - list.add(new Unknown(buffer, offset + 40, 2)); +// if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) +// list.add( +// new Bitmap(buffer, offset + 40, 2, "Attack type", +// new String[]{"Normal", "Bypass armour", "Keen"})); +// else +// list.add(new Unknown(buffer, offset + 40, 2)); if (ResourceFactory.getInstance().resourceExists("PROJECTL.IDS")) list.add(new ProRef(buffer, offset + 42, "Projectile")); else diff --git a/infinity/resource/itm/ItmResource.java b/infinity/resource/itm/ItmResource.java index 7e53d8a..9b06ddd 100644 --- a/infinity/resource/itm/ItmResource.java +++ b/infinity/resource/itm/ItmResource.java @@ -38,20 +38,16 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd "Bullets", "Bows", "Daggers", "Clubs", "Slings", "Short swords", "Long swords", "Hammers", "Morning stars", "Flails", "Darts", "Axes", "Quarterstaves", "Crossbows", "Hand-to-hand weapons", - "Spears", "Halberds", "Bolts", "Cloaks and robes", + "Greatswords", "Halberds", "Bolts", "Cloaks and robes", "Copper commons", "Gems", "Wands", "Eyeballs", "Bracelets", - "Earrings", "Tattoos", "Lenses", "Teeth", - "Candles", "", "", "", "", - "Large shields", "", "Medium shields", "", - "", "", "Small shields", "", - "Telescopes", "Bottles", "Greatswords"}; + "Earrings", "Tattoos", "Lenses", "Teeth"}; private static final String[] s_flags = {"None", "Unsellable", "Two-handed", "Droppable", "Displayable", "Cursed", "Not copyable", "Magical", "Bow", "Silver", "Gold", "Stolen", "Conversable"}; private static final String[] s_flags11 = {"None", "Unsellable", "Two-handed", "Droppable", "Displayable", - "Cursed", "Not copyable", "Magical", "", "Silver weapon", "Cold iron", "Steel", "Conversable", - "Pulsate"}; + "Cursed", "Not copyable", "Magical", "", "Silver", "Cold iron", "Steel", "Conversable", + "Pulsating"}; private static final String[] s_usability = {"None", "Chaotic", "Evil", "Good", "... Neutral", "Lawful", "Neutral ...", "Bard", "Cleric", "Cleric-Mage", @@ -64,10 +60,10 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd {"None", "Chaotic", "Evil", "Good", "... Neutral", "Lawful", "Neutral ...", "Sensate", "Priest", "Godsman", "Anarchist", "Xaositect", - "Fighter", "No faction", "Fighter-Mage", "Dustman", + "Fighter", "Non-aligned", "Fighter-Mage", "Dustman", "Mercykiller", "Idep", "Figher-Thief", "Mage", "Mage-Thief", "Dak'kon", "Fall-From-Grace", "Thief", - "Vhailor", "Ingus", "Morte", "Nordom", + "Vhailor", "Ignus", "Morte", "Nordom", "Human", "Annah", "", "Nameless One", "" }; private static final String[] s_usability20 = @@ -242,20 +238,11 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new Bitmap(buffer, 28, 2, "Category", s_categories11)); list.add(new Flag(buffer, 30, 4, "Unusable by", s_usability11)); list.add(new TextBitmap(buffer, 34, 2, "Equipped appearance", - new String[]{"AX", "DD", "CL", "WH", " ", "S1", "CB"}, - new String[]{"Axe", "Dagger", "Club", "Hammer", "None", "Karach", - "Crossbow"})); - list.add(new Bitmap(buffer, 36, 1, "Disable paper doll?", new String[]{"No", "Yes"})); - list.add(new Unknown(buffer, 37, 15)); - list.add(new DecNumber(buffer, 52, 4, "Price")); - list.add(new DecNumber(buffer, 56, 2, "Maximum in stack")); - list.add(new ResourceRef(buffer, 58, "Icon", "BAM")); - list.add(new DecNumber(buffer, 66, 2, "Lore to identify")); - list.add(new ResourceRef(buffer, 68, "Ground icon", "BAM")); - list.add(new DecNumber(buffer, 76, 4, "Weight")); - list.add(new StringRef(buffer, 80, "General description")); - list.add(new StringRef(buffer, 84, "Identified description")); - list.add(new ResourceRef(buffer, 88, "Pick up sound", "WAV")); + new String[]{" ", "AX", "CB", "CL", "DD", "S1", "WH"}, + new String[]{"None", "Axe", "Crossbow", "Club", "Dagger", + "Sword", "Hammer"})); +// list.add(new Bitmap(buffer, 36, 1, "Disable paper doll?", new String[]{"No", "Yes"})); +// list.add(new Unknown(buffer, 37, 15)); } else { list.add(new ResourceRef(buffer, 16, "Used up item", "ITM")); @@ -266,47 +253,48 @@ protected int read(byte buffer[], int offset) throws Exception else list.add(new Flag(buffer, 30, 4, "Unusable by", s_usability)); list.add(new TextBitmap(buffer, 34, 2, "Equipped appearance", s_tag, s_anim)); - list.add(new DecNumber(buffer, 36, 2, "Minimum level")); -// list.add(new Unknown(buffer, 37, 1)); - list.add(new DecNumber(buffer, 38, 2, "Minimum strength")); -// list.add(new Unknown(buffer, 39, 1)); - if (ResourceFactory.getInstance().resourceExists("KIT.IDS")) { - // NB! Not in order - list.add(new DecNumber(buffer, 40, 1, "Minimum strength bonus")); - list.add(new Flag(buffer, 41, 1, "Unusable by (1/4)", s_kituse1)); - list.add(new DecNumber(buffer, 42, 1, "Minimum intelligence")); - list.add(new Flag(buffer, 43, 1, "Unusable by (2/4)", s_kituse2)); - list.add(new DecNumber(buffer, 44, 1, "Minimum dexterity")); - list.add(new Flag(buffer, 45, 1, "Unusable by (3/4)", s_kituse3)); - list.add(new DecNumber(buffer, 46, 1, "Minimum wisdom")); - list.add(new Flag(buffer, 47, 1, "Unusable by (4/4)", s_kituse4)); - list.add(new DecNumber(buffer, 48, 1, "Minimum constitution")); - list.add(new IdsBitmap(buffer, 49, 1, "Weapon proficiency", "STATS.IDS")); - } - else { - list.add(new DecNumber(buffer, 40, 2, "Minimum strength bonus")); - list.add(new DecNumber(buffer, 42, 2, "Minimum intelligence")); - list.add(new DecNumber(buffer, 44, 2, "Minimum dexterity")); - list.add(new DecNumber(buffer, 46, 2, "Minimum wisdom")); - list.add(new DecNumber(buffer, 48, 2, "Minimum constitution")); -// list.add(new Unknown(buffer, 41, 1)); -// list.add(new Unknown(buffer, 43, 1)); -// list.add(new Unknown(buffer, 45, 1)); -// list.add(new Unknown(buffer, 47, 1)); -// list.add(new Unknown(buffer, 49, 1)); - } - list.add(new DecNumber(buffer, 50, 2, "Minimum charisma")); -// list.add(new Unknown(buffer, 51, 1)); - list.add(new DecNumber(buffer, 52, 4, "Price")); - list.add(new DecNumber(buffer, 56, 2, "Maximum in stack")); - list.add(new ResourceRef(buffer, 58, "Icon", "BAM")); - list.add(new DecNumber(buffer, 66, 2, "Lore to identify")); - list.add(new ResourceRef(buffer, 68, "Ground icon", "BAM")); - list.add(new DecNumber(buffer, 76, 4, "Weight")); - list.add(new StringRef(buffer, 80, "General description")); - list.add(new StringRef(buffer, 84, "Identified description")); - list.add(new ResourceRef(buffer, 88, "Description image", "BAM")); } + list.add(new DecNumber(buffer, 36, 2, "Minimum level")); + list.add(new DecNumber(buffer, 38, 2, "Minimum strength")); +// list.add(new Unknown(buffer, 39, 1)); + if (ResourceFactory.getInstance().resourceExists("KIT.IDS")) { + list.add(new DecNumber(buffer, 40, 1, "Minimum strength bonus")); + list.add(new Flag(buffer, 41, 1, "Unusable by (1/4)", s_kituse1)); + list.add(new DecNumber(buffer, 42, 1, "Minimum intelligence")); + list.add(new Flag(buffer, 43, 1, "Unusable by (2/4)", s_kituse2)); + list.add(new DecNumber(buffer, 44, 1, "Minimum dexterity")); + list.add(new Flag(buffer, 45, 1, "Unusable by (3/4)", s_kituse3)); + list.add(new DecNumber(buffer, 46, 1, "Minimum wisdom")); + list.add(new Flag(buffer, 47, 1, "Unusable by (4/4)", s_kituse4)); + list.add(new DecNumber(buffer, 48, 1, "Minimum constitution")); + list.add(new IdsBitmap(buffer, 49, 1, "Weapon proficiency", "STATS.IDS")); + } + else { + list.add(new DecNumber(buffer, 40, 2, "Minimum strength bonus")); + list.add(new DecNumber(buffer, 42, 2, "Minimum intelligence")); + list.add(new DecNumber(buffer, 44, 2, "Minimum dexterity")); + list.add(new DecNumber(buffer, 46, 2, "Minimum wisdom")); + list.add(new DecNumber(buffer, 48, 2, "Minimum constitution")); +// list.add(new Unknown(buffer, 41, 1)); +// list.add(new Unknown(buffer, 43, 1)); +// list.add(new Unknown(buffer, 45, 1)); +// list.add(new Unknown(buffer, 47, 1)); +// list.add(new Unknown(buffer, 49, 1)); + } + list.add(new DecNumber(buffer, 50, 2, "Minimum charisma")); +// list.add(new Unknown(buffer, 51, 1)); + list.add(new DecNumber(buffer, 52, 4, "Price")); + list.add(new DecNumber(buffer, 56, 2, "Maximum in stack")); + list.add(new ResourceRef(buffer, 58, "Icon", "BAM")); + list.add(new DecNumber(buffer, 66, 2, "Lore to identify")); + list.add(new ResourceRef(buffer, 68, "Ground icon", "BAM")); + list.add(new DecNumber(buffer, 76, 4, "Weight")); + list.add(new StringRef(buffer, 80, "General description")); + list.add(new StringRef(buffer, 84, "Identified description")); + if (version.toString().equalsIgnoreCase("V1.1")) + list.add(new ResourceRef(buffer, 88, "Pick up sound", "WAV")); + else + list.add(new ResourceRef(buffer, 88, "Description image", "BAM")); list.add(new DecNumber(buffer, 96, 4, "Enchantment")); SectionOffset abil_offset = new SectionOffset(buffer, 100, "Abilities offset", Ability.class); @@ -317,14 +305,14 @@ protected int read(byte buffer[], int offset) throws Exception SectionOffset global_offset = new SectionOffset(buffer, 106, "Effects offset", Effect.class); list.add(global_offset); - list.add(new DecNumber(buffer, 110, 2, "Global effects index")); + list.add(new DecNumber(buffer, 110, 2, "First effect index")); SectionCount global_count = new SectionCount(buffer, 112, 2, "# global effects", Effect.class); list.add(global_count); if (version.toString().equalsIgnoreCase("V1.1")) { list.add(new ResourceRef(buffer, 114, "Dialogue", "DLG")); - list.add(new StringRef(buffer, 122, "Talking item name")); + list.add(new StringRef(buffer, 122, "Speaker name")); list.add(new IdsBitmap(buffer, 126, 2, "Weapon color", "CLOWNCLR.IDS")); list.add(new Unknown(buffer, 128, 26)); } diff --git a/infinity/resource/itm/Viewer.java b/infinity/resource/itm/Viewer.java index 8f28e52..cad7769 100644 --- a/infinity/resource/itm/Viewer.java +++ b/infinity/resource/itm/Viewer.java @@ -66,7 +66,7 @@ private JPanel makeFieldPanel(ItmResource itm) ViewerUtil.addLabelFieldPair(fieldPanel, itm.getAttribute("General name"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, itm.getAttribute("Identified name"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, itm.getAttribute("Category"), gbl, gbc, true); - if (!itm.getAttribute("Version").toString().equalsIgnoreCase("V1.1")) { +// if (!itm.getAttribute("Version").toString().equalsIgnoreCase("V1.1")) { StructEntry s1 = itm.getAttribute("Minimum strength"); StructEntry s2 = itm.getAttribute("Minimum strength bonus"); gbc.weightx = 0.0; @@ -87,7 +87,7 @@ private JPanel makeFieldPanel(ItmResource itm) ViewerUtil.addLabelFieldPair(fieldPanel, itm.getAttribute("Minimum intelligence"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, itm.getAttribute("Minimum wisdom"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, itm.getAttribute("Minimum charisma"), gbl, gbc, true); - } +// } ViewerUtil.addLabelFieldPair(fieldPanel, itm.getAttribute("Price"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, itm.getAttribute("Lore to identify"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, itm.getAttribute("Enchantment"), gbl, gbc, true); diff --git a/infinity/resource/key/Keyfile.java b/infinity/resource/key/Keyfile.java index b261380..d75268a 100644 --- a/infinity/resource/key/Keyfile.java +++ b/infinity/resource/key/Keyfile.java @@ -302,7 +302,6 @@ else if (currentGame == ResourceFactory.ID_KOTOR || currentGame == ResourceFacto resourceicons.put("TXT", ICON_TEXT); resourceicons.put("RES", ICON_TEXT); resourceicons.put("BAF", ICON_SCRIPT); - resourceicons.put("BAK", ICON_TEXT); } } diff --git a/infinity/resource/spl/Ability.java b/infinity/resource/spl/Ability.java index 2dfaffa..5a4519b 100644 --- a/infinity/resource/spl/Ability.java +++ b/infinity/resource/spl/Ability.java @@ -63,7 +63,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 26, 2, "Damage bonus")); list.add(new Bitmap(buffer, offset + 28, 2, "Damage type", s_dmgtype)); list.add(new SectionCount(buffer, offset + 30, 2, "# effects", Effect.class)); - list.add(new DecNumber(buffer, offset + 32, 2, "Effects index")); + list.add(new DecNumber(buffer, offset + 32, 2, "First effect index")); list.add(new DecNumber(buffer, offset + 34, 2, "# charges")); list.add(new Unknown(buffer, offset + 36, 2)); if (ResourceFactory.getInstance().resourceExists("PROJECTL.IDS")) diff --git a/infinity/resource/spl/SplResource.java b/infinity/resource/spl/SplResource.java index 95fcc87..3ec725e 100644 --- a/infinity/resource/spl/SplResource.java +++ b/infinity/resource/spl/SplResource.java @@ -205,8 +205,8 @@ protected int read(byte buffer[], int offset) throws Exception // list.add(new Unknown(buffer, offset + 76, 4)); list.add(new StringRef(buffer, offset + 80, "Spell description")); list.add(new StringRef(buffer, offset + 84, "Identified description")); - list.add(new Unknown(buffer, offset + 88, 8)); - list.add(new Unknown(buffer, offset + 96, 4)); +// list.add(new ResourceRef(buffer, offset + 88, 8, "Animation?", "BAM")); + list.add(new Unknown(buffer, offset + 88, 12)); SectionOffset abil_offset = new SectionOffset(buffer, offset + 100, "Abilities offset", Ability.class); list.add(abil_offset); @@ -216,7 +216,7 @@ protected int read(byte buffer[], int offset) throws Exception SectionOffset global_offset = new SectionOffset(buffer, offset + 106, "Effects offset", Effect.class); list.add(global_offset); - list.add(new DecNumber(buffer, offset + 110, 2, "Global effects index")); + list.add(new DecNumber(buffer, offset + 110, 2, "First effect index")); SectionCount global_count = new SectionCount(buffer, offset + 112, 2, "# global effects", Effect.class); list.add(global_count); diff --git a/infinity/resource/sto/ItemSale11.java b/infinity/resource/sto/ItemSale11.java index 35aeca9..5e81477 100644 --- a/infinity/resource/sto/ItemSale11.java +++ b/infinity/resource/sto/ItemSale11.java @@ -33,7 +33,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new Flag(buffer, offset + 16, 4, "Flags", s_itemflag)); list.add(new DecNumber(buffer, offset + 20, 4, "# in stock")); list.add(new Bitmap(buffer, offset + 24, 4, "Infinite supply?", s_noyes)); - list.add(new StringRef(buffer, offset + 28, "Item trigger")); + list.add(new StringRef(buffer, offset + 28, "Sale trigger")); list.add(new Unknown(buffer, offset + 32, 44)); list.add(new Unknown(buffer, offset + 76, 12)); return offset + 88; diff --git a/infinity/resource/sto/StoResource.java b/infinity/resource/sto/StoResource.java index 726efef..b0e68b1 100644 --- a/infinity/resource/sto/StoResource.java +++ b/infinity/resource/sto/StoResource.java @@ -18,6 +18,8 @@ public final class StoResource extends AbstractStruct implements Resource, HasAd private static final String[] s_flag = {"Can only rest", "Can buy", "Can sell", "Can identify", "Can steal", "Can buy cures", "Can donate", "Can buy drinks", "", "", "Tavern quality 1", "Tavern quality 2", "Tavern quality 3"}; + private static final String[] s_flag11 = {"Can only rest", "Can buy", "Can sell", "Can identify", + "Can steal", "Can donate", "Can buy cures", "Can buy drinks"}; private static final String[] s_flag_bg2 = {"Can only rest", "Can buy", "Can sell", "Can identify", "Can steal", "Can buy cures", "Can donate", "Can buy drinks", "", "", "Tavern quality 1", "Tavern quality 2", @@ -79,7 +81,10 @@ else if (version.toString().equalsIgnoreCase("V9.0")) { else { list.add(new Bitmap(buffer, offset + 8, 4, "Type", s_type)); list.add(new StringRef(buffer, offset + 12, "Name")); - list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag)); + if (version.toString().equalsIgnoreCase("V1.1")) + list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag11)); + else + list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag)); } list.add(new DecNumber(buffer, offset + 20, 4, "Sell markup")); list.add(new DecNumber(buffer, offset + 24, 4, "Buy markup")); diff --git a/infinity/resource/wmp/AreaEntry.java b/infinity/resource/wmp/AreaEntry.java index 9cf82ec..2071386 100644 --- a/infinity/resource/wmp/AreaEntry.java +++ b/infinity/resource/wmp/AreaEntry.java @@ -16,12 +16,12 @@ final class AreaEntry extends AbstractStruct implements AddRemovable, HasDetailV AreaEntry() throws Exception { - super(null, "Area entry", new byte[240], 0); + super(null, "Area", new byte[240], 0); } AreaEntry(AbstractStruct superStruct, byte buffer[], int offset, int nr) throws Exception { - super(superStruct, "Area entry " + nr, buffer, offset); + super(superStruct, "Area " + nr, buffer, offset); } public AddRemovable[] getAddRemovables() throws Exception @@ -42,8 +42,8 @@ public JComponent getDetailViewer() protected int read(byte buffer[], int offset) throws Exception { list.add(new ResourceRef(buffer, offset, "Area content", "ARE")); - list.add(new TextString(buffer, offset + 8, 8, "Short name")); - list.add(new TextString(buffer, offset + 16, 32, "Long name")); + list.add(new TextString(buffer, offset + 8, 8, "Area name")); + list.add(new TextString(buffer, offset + 16, 32, "Script name")); list.add(new Flag(buffer, offset + 48, 4, "Flags", s_flag)); list.add(new DecNumber(buffer, offset + 52, 4, "BAM animation number")); list.add(new DecNumber(buffer, offset + 56, 4, "Coordinate: X")); diff --git a/infinity/resource/wmp/AreaLink.java b/infinity/resource/wmp/AreaLink.java index bb5b8d7..dcf394d 100644 --- a/infinity/resource/wmp/AreaLink.java +++ b/infinity/resource/wmp/AreaLink.java @@ -22,7 +22,7 @@ abstract class AreaLink extends AbstractStruct implements AddRemovable protected int read(byte buffer[], int offset) throws Exception { - list.add(new DecNumber(buffer, offset, 4, "Target area entry")); + list.add(new DecNumber(buffer, offset, 4, "Target area")); list.add(new TextString(buffer, offset + 4, 32, "Target entrance")); list.add(new DecNumber(buffer, offset + 36, 4, "Distance scale")); list.add(new Flag(buffer, offset + 40, 4, "Default entrance", diff --git a/infinity/resource/wmp/MapEntry.java b/infinity/resource/wmp/MapEntry.java index 1a495c2..53ecff1 100644 --- a/infinity/resource/wmp/MapEntry.java +++ b/infinity/resource/wmp/MapEntry.java @@ -13,7 +13,7 @@ final class MapEntry extends AbstractStruct implements HasAddRemovable, HasDetai { MapEntry(AbstractStruct superStruct, byte buffer[], int offset, int nr) throws Exception { - super(superStruct, "Map entry " + nr, buffer, offset); + super(superStruct, "Map " + nr, buffer, offset); } // --------------------- Begin Interface HasAddRemovable --------------------- @@ -44,15 +44,15 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new StringRef(buffer, offset + 20, "Name")); list.add(new Unknown(buffer, offset + 24, 4)); list.add(new Unknown(buffer, offset + 28, 4)); - SectionCount area_count = new SectionCount(buffer, offset + 32, 4, "# area entries", + SectionCount area_count = new SectionCount(buffer, offset + 32, 4, "# areas", AreaEntry.class); list.add(area_count); - SectionOffset area_offset = new SectionOffset(buffer, offset + 36, "Area entries offset", + SectionOffset area_offset = new SectionOffset(buffer, offset + 36, "Areas offset", AreaEntry.class); list.add(area_offset); - HexNumber link_offset = new HexNumber(buffer, offset + 40, 4, "Area link entries offset"); + HexNumber link_offset = new HexNumber(buffer, offset + 40, 4, "Area links offset"); list.add(link_offset); - DecNumber link_count = new DecNumber(buffer, offset + 44, 4, "# area link entries"); + DecNumber link_count = new DecNumber(buffer, offset + 44, 4, "# area links"); list.add(link_count); list.add(new ResourceRef(buffer, offset + 48, "Map icons", "BAM")); list.add(new Unknown(buffer, offset + 56, 128)); @@ -69,7 +69,7 @@ protected int read(byte buffer[], int offset) throws Exception protected void datatypeAddedInChild(AbstractStruct child, AddRemovable datatype) { if (datatype instanceof AreaLink) { - DecNumber linkCount = (DecNumber)getAttribute("# area link entries"); + DecNumber linkCount = (DecNumber)getAttribute("# area links"); linkCount.setValue(linkCount.getValue() + 1); } } @@ -77,7 +77,7 @@ protected void datatypeAddedInChild(AbstractStruct child, AddRemovable datatype) protected void datatypeRemovedInChild(AbstractStruct child, AddRemovable datatype) { if (datatype instanceof AreaLink) { - DecNumber linkCount = (DecNumber)getAttribute("# area link entries"); + DecNumber linkCount = (DecNumber)getAttribute("# area links"); linkCount.setValue(linkCount.getValue() - 1); } } diff --git a/infinity/resource/wmp/ViewerArea.java b/infinity/resource/wmp/ViewerArea.java index 27551ac..5acf50d 100644 --- a/infinity/resource/wmp/ViewerArea.java +++ b/infinity/resource/wmp/ViewerArea.java @@ -147,8 +147,8 @@ public Component getListCellRendererComponent(JList list, Object value, int inde super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); AbstractStruct areaLink = (AbstractStruct)value; StructEntry entry = areaLink.getAttribute("Target entrance"); - DecNumber targetIndex = (DecNumber)areaLink.getAttribute("Target area entry"); - AreaEntry targetEntry = (AreaEntry)areaLink.getSuperStruct().getAttribute("Area entry " + targetIndex); + DecNumber targetIndex = (DecNumber)areaLink.getAttribute("Target area"); + AreaEntry targetEntry = (AreaEntry)areaLink.getSuperStruct().getAttribute("Area " + targetIndex); StringBuffer name = new StringBuffer(); if (targetEntry != null) diff --git a/infinity/resource/wmp/WmpResource.java b/infinity/resource/wmp/WmpResource.java index 059dd78..da55767 100644 --- a/infinity/resource/wmp/WmpResource.java +++ b/infinity/resource/wmp/WmpResource.java @@ -24,9 +24,9 @@ public WmpResource(ResourceEntry entry) throws Exception public JComponent getDetailViewer() { JTabbedPane tabbedPane = new JTabbedPane(); - int count = ((DecNumber)getAttribute("# map entries")).getValue(); + int count = ((DecNumber)getAttribute("# maps")).getValue(); for (int i = 0; i < count; i++) { - MapEntry entry = (MapEntry)getAttribute("Map entry " + i); + MapEntry entry = (MapEntry)getAttribute("Map " + i); tabbedPane.addTab(entry.getName(), entry.getDetailViewer()); } return tabbedPane; @@ -48,9 +48,9 @@ protected int read(byte buffer[], int offset) throws Exception { list.add(new TextString(buffer, offset, 4, "Signature")); list.add(new TextString(buffer, offset + 4, 4, "Version")); - SectionCount entry_count = new SectionCount(buffer, offset + 8, 4, "# map entries", MapEntry.class); + SectionCount entry_count = new SectionCount(buffer, offset + 8, 4, "# maps", MapEntry.class); list.add(entry_count); - SectionOffset entry_offset = new SectionOffset(buffer, offset + 12, "Map entries offset", MapEntry.class); + SectionOffset entry_offset = new SectionOffset(buffer, offset + 12, "Maps offset", MapEntry.class); list.add(entry_offset); offset = entry_offset.getValue(); for (int i = 0; i < entry_count.getValue(); i++) { From e12c3ede8e7af0a15769dd6c5075c0f2c4547c63 Mon Sep 17 00:00:00 2001 From: Taimon Date: Fri, 8 Jan 2010 22:08:23 +0800 Subject: [PATCH 02/37] Again a devSin merge --- infinity/NearInfinity.java | 2 +- infinity/datatype/IDSTargetEffect.java | 2 +- infinity/datatype/Song2daBitmap.java | 4 +- infinity/gui/BrowserMenuBar.java | 6 ++- infinity/resource/AbstractAbility.java | 2 +- infinity/resource/Effect2.java | 3 +- infinity/resource/EffectFactory.java | 30 +++++------ infinity/resource/ResourceFactory.java | 7 ++- infinity/resource/are/AreResource.java | 5 +- infinity/resource/are/Door.java | 10 +++- infinity/resource/are/Song.java | 15 ++++-- infinity/resource/bcs/Compiler.java | 9 ++-- infinity/resource/bcs/Decompiler.java | 16 +++--- infinity/resource/cre/CreResource.java | 57 +++++++++++---------- infinity/resource/cre/Viewer.java | 2 + infinity/resource/dlg/DlgResource.java | 2 +- infinity/resource/graphics/BamResource.java | 1 - infinity/resource/itm/Ability.java | 2 +- infinity/resource/itm/ItmResource.java | 6 +-- infinity/resource/sto/StoResource.java | 9 ++-- 20 files changed, 109 insertions(+), 81 deletions(-) diff --git a/infinity/NearInfinity.java b/infinity/NearInfinity.java index b8d070a..3d09ed8 100644 --- a/infinity/NearInfinity.java +++ b/infinity/NearInfinity.java @@ -85,7 +85,7 @@ private static boolean reloadFactory(boolean refreshonly) } catch (Exception e) { JOptionPane.showMessageDialog(null, "No Infinity Engine game found", "Error", JOptionPane.ERROR_MESSAGE); - e.printStackTrace(); + e.printStackTrace(); } else { File newkeyfile = findKeyfile(); diff --git a/infinity/datatype/IDSTargetEffect.java b/infinity/datatype/IDSTargetEffect.java index 0b44cab..bad8057 100644 --- a/infinity/datatype/IDSTargetEffect.java +++ b/infinity/datatype/IDSTargetEffect.java @@ -23,7 +23,7 @@ public final class IDSTargetEffect extends Datatype implements Editable, ListSel { private final String sIDS[] = new String[] {"", "", "EA.IDS", "GENERAL.IDS", "RACE.IDS", "CLASS.IDS", - "SPECIFIC.IDS", "GENDER.IDS", "ALIGNMEN.IDS"}; + "SPECIFIC.IDS", "GENDER.IDS", "ALIGN.IDS"}; private LongIntegerHashMap idsMap; private TextListPanel fileList, valueList; private long idsValue, idsFile; diff --git a/infinity/datatype/Song2daBitmap.java b/infinity/datatype/Song2daBitmap.java index 1b8fe18..d07af04 100644 --- a/infinity/datatype/Song2daBitmap.java +++ b/infinity/datatype/Song2daBitmap.java @@ -44,8 +44,8 @@ private static void parseSonglist() e.printStackTrace(); } - songNumber.put(0xFFFFFFFE, new SonglistEntry((long)-2, "Continue_area_music")); - songNumber.put(0xFFFFFFFF, new SonglistEntry((long)-1, "Continue_outside_music")); + songNumber.put(0xFFFFFFFE, new SonglistEntry((long)-2, "Continue area music")); + songNumber.put(0xFFFFFFFF, new SonglistEntry((long)-1, "Continue outside music")); } private static void parseSonglistLine(String s) diff --git a/infinity/gui/BrowserMenuBar.java b/infinity/gui/BrowserMenuBar.java index abf1907..def1181 100644 --- a/infinity/gui/BrowserMenuBar.java +++ b/infinity/gui/BrowserMenuBar.java @@ -500,8 +500,10 @@ private void gameLoaded(int oldGame, String oldFile) lastGameID.add(0, new Integer(oldGame)); lastGamePath.add(0, oldFile); } - while (lastGameID.size() > 5) + while (lastGameID.size() > 5) { + lastGamePath.remove(lastGameID.size() - 1); lastGameID.remove(lastGameID.size() - 1); + } if (newIndex != 1 || oldGame != -1) { for (int i = 0; i < lastGameID.size(); i++) { gameLastGame[i].setText( @@ -1148,4 +1150,4 @@ else if (event.getSource() == helpBsdLicense) { } } } -} +} \ No newline at end of file diff --git a/infinity/resource/AbstractAbility.java b/infinity/resource/AbstractAbility.java index 800968a..03dda25 100644 --- a/infinity/resource/AbstractAbility.java +++ b/infinity/resource/AbstractAbility.java @@ -17,7 +17,7 @@ public abstract class AbstractAbility extends AbstractStruct "Caster (keep spell, no animation)"}; protected static final String[] s_dmgtype = {"None", "Piercing", "Crushing", "Slashing", "Missile", "Fist", "Piercing or crushing", "Piercing or slashing", - "Crushing or slashing"}; + "Crushing or slashing", "Missile (blunt)"}; protected AbstractAbility(AbstractStruct superStruct, String name, byte buffer[], int offset) throws Exception diff --git a/infinity/resource/Effect2.java b/infinity/resource/Effect2.java index 8eb9ea8..7272693 100644 --- a/infinity/resource/Effect2.java +++ b/infinity/resource/Effect2.java @@ -13,7 +13,8 @@ public final class Effect2 extends AbstractStruct implements AddRemovable { private static final String s_itmflag[] = {"No flags set", "Add strength bonus", "Breakable", "", "", "", "", "", "", "", "", "Hostile", - "Recharge after resting"}; + "Recharge after resting", "", "", "", "", + "Bypass armor", "Keen edge"}; private static final String s_splflag[] = {"No flags set", "", "", "", "", "", "", "", "", "", "", "Hostile", "No LOS required", "", "Outdoors only", "Non-magical ability", "Trigger/Contingency"}; diff --git a/infinity/resource/EffectFactory.java b/infinity/resource/EffectFactory.java index b414a34..4cbfd5e 100644 --- a/infinity/resource/EffectFactory.java +++ b/infinity/resource/EffectFactory.java @@ -134,7 +134,7 @@ public final class EffectFactory "Cause critical wounds", "Cause disease", "Hit poison", "Slay living", "Harm", "Destruction", "Exaltation", "Cloudburst", "Mold touch", "Lower resistance", "Cat's grace", "Soul eater", "Smashing wave", - "Suffocate", "Abi-dalzim's horrid wilting", "Mordenkainen's force missile", + "Suffocate", "Abi-dalzim's horrid wilting", "Mordenkainen's force missiles", "Vitriolic sphere", "Wailing virgin death", "Undead ward", "Wailing virgin hit", "Wylfden's death 1", "Wylfden's death 2", "Dragon's death 1", "Dragon's death 2", "Monster summoning circle", @@ -157,7 +157,7 @@ public final class EffectFactory m_colorloc.put(1L, "Minor color"); m_colorloc.put(2L, "Major color"); m_colorloc.put(3L, "Skin color"); - m_colorloc.put(4L, "Strap/Trimming"); + m_colorloc.put(4L, "Strap/Leather"); m_colorloc.put(5L, "Armor/Trimming"); m_colorloc.put(6L, "Hair"); m_colorloc.put(16L, "Weapon head/blade/staff major"); @@ -198,7 +198,7 @@ private EffectFactory() case ResourceFactory.ID_DEMO: s_effname = new String[]{"AC bonus", "Modify attacks per round", "Cure sleep", "Berserk", "Cure berserk", "Charm creature", - "Charisma bonus", "Set item color", "Set color glow solid", + "Charisma bonus", "Set color", "Set color glow solid", "Set color glow pulse", "Constitution bonus", "Cure poison", "Damage", "Kill target", "Defrost", "Dexterity bonus", "Haste", "Current HP bonus", "Maximum HP bonus", "Intelligence bonus", @@ -280,7 +280,7 @@ private EffectFactory() case ResourceFactory.ID_TORMENT: s_effname = new String[]{"AC bonus", "Modify attacks per round", "Cure sleep", "Berserk", "Cure berserk", "Charm creature", - "Charisma bonus", "Set item color", "Set color glow solid", + "Charisma bonus", "Set color", "Set color glow solid", "Set color glow pulse", "Constitution bonus", "Cure poison", "Damage", "Kill target", "Defrost", "Dexterity bonus", "Haste", "Current HP bonus", "Maximum HP bonus", "Intelligence bonus", @@ -368,7 +368,7 @@ private EffectFactory() case ResourceFactory.ID_ICEWINDHOWTOT: s_effname = new String[]{"AC bonus", "Modify attacks per round", "Cure sleep", "Berserk", "Cure berserk", "Charm creature", - "Charisma bonus", "Set item color", "Set color glow solid", + "Charisma bonus", "Set color", "Set color glow solid", "Set color glow pulse", "Constitution bonus", "Cure poison", "Damage", "Kill target", "Defrost", "Dexterity bonus", "Haste", "Current HP bonus", "Maximum HP bonus", "Intelligence bonus", @@ -491,7 +491,7 @@ private EffectFactory() case ResourceFactory.ID_UNKNOWNGAME: // Default list s_effname = new String[]{"AC bonus", "Modify attacks per round", "Cure sleep", "Berserk", "Cure berserk", "Charm creature", - "Charisma bonus", "Set item color", "Set color glow solid", + "Charisma bonus", "Set color", "Set color glow solid", "Set color glow pulse", "Constitution bonus", "Cure poison", "Damage", "Kill target", "Defrost", "Dexterity bonus", "Haste", "Current HP bonus", "Maximum HP bonus", "Intelligence bonus", @@ -648,7 +648,7 @@ private EffectFactory() case ResourceFactory.ID_ICEWIND2: s_effname = new String[]{"AC bonus", "Modify attacks per round", "Cure sleep", "Berserk", "Cure berserk", "Charm creature", - "Charisma bonus", "Set item color", "Set color glow solid", + "Charisma bonus", "Set color", "Set color glow solid", "Set color glow pulse", "Constitution bonus", "Cure poison", "Damage", "Kill target", "Defrost", "Dexterity bonus", "Haste", "Current HP bonus", "Maximum HP bonus", "Intelligence bonus", @@ -907,7 +907,7 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); break; - case 0x7: // Set item color (CGameEffectColorChange) + case 0x7: // Set color (CGameEffectColorChange) s.add(new ColorValue(buffer, offset, 4, "Color")); s.add(new HashBitmap(buffer, offset + 4, 4, "Location", m_colorloc)); break; @@ -939,7 +939,7 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i case 0xD: // Kill target (CGameEffectDeath) s.add(new Bitmap(buffer, offset, 4, "Display text?", s_yesno)); s.add(new Flag(buffer, offset + 4, 4, "Death type", - new String[]{"Acid", "Burning", "Crushed", "Normal", "Chunked", + new String[]{"Acid", "Burning", "Crushed", "Normal", "Exploding", "Stoned", "Freezing", "Exploding stoned", "Exploding freezing", "Electrified", "Disintegration"})); break; @@ -989,7 +989,7 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i "Purple", "Red", "White", "Ice", "Stone", "Magenta", "Orange"})); s.add(new Bitmap(buffer, offset + 4, 4, "Particle effect", - new String[]{"", "Explosion", "", "Shower"})); + new String[]{"", "Explosion", "Swirl", "Shower"})); break; case 0x2A: // Bonus wizard spells (CGameEffectSpellMemorizationMage) @@ -1041,7 +1041,7 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i if (gameid == ResourceFactory.ID_ICEWIND2) s.add(new IdsBitmap(buffer, offset + 4, 4, "Alignment", "ALIGNMNT.IDS")); else - s.add(new IdsBitmap(buffer, offset + 4, 4, "Alignment", "ALIGNMEN.IDS")); + s.add(new IdsBitmap(buffer, offset + 4, 4, "Alignment", "ALIGN.IDS")); break; case 0x3A: // Dispel effects (CGameEffectDispelEffects) @@ -1102,7 +1102,7 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i s.add(new DecNumber(buffer, offset, 4, "Value")); s.add(new Bitmap(buffer, offset + 4, 4, "From IDS file", new String[]{"EA.IDS", "GENERAL.IDS", "RACE.IDS", "CLASS.IDS", - "SPECIFIC.IDS", "GENDER.IDS", "ALIGNMEN.IDS"})); + "SPECIFIC.IDS", "GENDER.IDS", "ALIGN.IDS"})); break; case 0x4E: // Disease (CGameEffectDisease) @@ -1632,7 +1632,7 @@ else if (gameid == ResourceFactory.ID_ICEWIND || "Antimagic shell", "Otiluke's resilient sphere", "Protection from normal missiles", "Cloak of fear", "Entropy shield", "Fire aura", "Frost aura", - "Insect plague", "Storm shield", "Shield of lathander", + "Insect plague", "Storm shell", "Shield of lathander", "Greater shield of lathander", "Seven eyes"})); break; @@ -2067,8 +2067,8 @@ else if (gameid == ResourceFactory.ID_BG2 || break; case 0x126: // Set existence delay (CGameEffectExistanceDelayOverride) - s.add(new Unknown(buffer, offset, 4)); - s.add(new DecNumber(buffer, offset + 4, 4, "Interval override")); + s.add(new DecNumber(buffer, offset, 4, "Interval override")); + s.add(new Unknown(buffer, offset + 4, 4)); break; case 0x128: // Immunity to specific animation (CGameEffectImmunityToVisualEffect) diff --git a/infinity/resource/ResourceFactory.java b/infinity/resource/ResourceFactory.java index 40e435f..f7970ed 100644 --- a/infinity/resource/ResourceFactory.java +++ b/infinity/resource/ResourceFactory.java @@ -61,7 +61,7 @@ public final class ResourceFactory { String bgdirs[] = {"Characters", "MPSave", "Music", "Portraits", "Save", "Screenshots", "Scripts", "ScrnShot", "Sounds", "Temp", "TempSave"}; - String iwddirs[] = {"Music", "Characters", "Scripts", "Sounds", "Temp", "MPSave"}; +// String iwddirs[] = {"Music", "Characters", "Scripts", "Sounds", "Temp", "MPSave"}; games = new GameConfig[15]; games[ID_UNKNOWNGAME] = new GameConfig("Unknown game", "baldur.ini", bgdirs); @@ -322,8 +322,11 @@ else if (new File(rootDir, "baldur.exe").exists() && new File(rootDir, "chitin.i // Expansion pack detection if (currentGame == ID_ICEWIND && resourceExists("HOWDRAG.MVE")) - currentGame = ID_ICEWINDHOW; // Detect Trials of the Luremaster + if (resourceExists("AR9715.ARE")) + currentGame = ID_ICEWINDHOWTOT; + else + currentGame = ID_ICEWINDHOW; if (currentGame == ID_BG2 && resourceExists("SARADUSH.MVE")) currentGame = ID_BG2TOB; if (currentGame == ID_BG1 && resourceExists("DURLAG.MVE")) diff --git a/infinity/resource/are/AreResource.java b/infinity/resource/are/AreResource.java index c3bbd04..3479382 100644 --- a/infinity/resource/are/AreResource.java +++ b/infinity/resource/are/AreResource.java @@ -29,6 +29,7 @@ public final class AreResource extends AbstractStruct implements Resource, HasAd private static final String s_atype_torment[] = {"Can rest", "Cannot save", "Cannot rest", "Cannot save", "Too dangerous to rest", "Cannot save", "Can rest with permission"}; + private static final String s_atype_iwd2[] = {"Normal", "Can't save game", "Cannot rest", "Lock battle music"}; public static void addScriptNames(Set scriptNames, byte buffer[]) { @@ -237,7 +238,9 @@ protected int read(byte buffer[], int offset) throws Exception list.add(version); list.add(new ResourceRef(buffer, offset + 8, "WED resource", "WED")); list.add(new DecNumber(buffer, offset + 16, 4, "Last saved")); - if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) + if (version.toString().equalsIgnoreCase("V9.1")) + list.add(new Flag(buffer, offset + 20, 4, "Area type", s_atype_iwd2)); + else if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) list.add(new Bitmap(buffer, offset + 20, 4, "Area type", s_atype_torment)); else list.add(new Flag(buffer, offset + 20, 4, "Area type", s_atype)); diff --git a/infinity/resource/are/Door.java b/infinity/resource/are/Door.java index a6b0246..fe2b842 100644 --- a/infinity/resource/are/Door.java +++ b/infinity/resource/are/Door.java @@ -15,6 +15,11 @@ public final class Door extends AbstractStruct implements AddRemovable, HasVerti "Detectable trap", "Door forced", "", "", "Door secret", "Secret door detected", "Can be looked through", "Uses key", "Sliding door"}; + private static final String[] s_flag_iwd2 = {"No flags set", "Door open", "Door locked", "Trap resets", + "Detectable trap", "Door forced", "Cannot close", "Door located", + "Door secret", "Secret door detected", "Alternate lock string", + "Can be looked through", "Warn on activate", "Displayed warning", + "Door hidden", "Uses key"}; public Door() throws Exception { @@ -116,7 +121,10 @@ protected int read(byte buffer[], int offset) throws Exception { list.add(new TextString(buffer, offset, 32, "Name")); list.add(new TextString(buffer, offset + 32, 8, "Door ID")); - list.add(new Flag(buffer, offset + 40, 4, "Flags", s_flag)); + if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) + list.add(new Flag(buffer, offset + 40, 4, "Flags", s_flag_iwd2)); + else + list.add(new Flag(buffer, offset + 40, 4, "Flags", s_flag)); list.add(new DecNumber(buffer, offset + 44, 4, "First vertex index (open)")); list.add(new SectionCount(buffer, offset + 48, 2, "# vertices (open)", OpenVertex.class)); list.add(new SectionCount(buffer, offset + 50, 2, "# vertices (closed)", ClosedVertex.class)); diff --git a/infinity/resource/are/Song.java b/infinity/resource/are/Song.java index 02b7c56..26eba92 100644 --- a/infinity/resource/are/Song.java +++ b/infinity/resource/are/Song.java @@ -20,28 +20,35 @@ final class Song extends AbstractStruct // implements AddRemovable protected int read(byte buffer[], int offset) throws Exception { - if (ResourceFactory.getInstance().resourceExists("SONGLIST.2DA")) { + if (ResourceFactory.getInstance().resourceExists("SONGLIST.2DA")) { // BG2 list.add(new Song2daBitmap(buffer, offset, 4, "Day song")); list.add(new Song2daBitmap(buffer, offset + 4, 4, "Night song")); list.add(new Song2daBitmap(buffer, offset + 8, 4, "Victory song")); list.add(new Song2daBitmap(buffer, offset + 12, 4, "Battle song")); list.add(new Song2daBitmap(buffer, offset + 16, 4, "Defeat song")); } - else if (ResourceFactory.getInstance().resourceExists("MUSICLIS.IDS")) { + else if (ResourceFactory.getInstance().resourceExists("MUSICLIS.IDS")) { // IWD list.add(new IdsBitmap(buffer, offset, 4, "Day song", "MUSICLIS.IDS")); list.add(new IdsBitmap(buffer, offset + 4, 4, "Night song", "MUSICLIS.IDS")); list.add(new IdsBitmap(buffer, offset + 8, 4, "Victory song", "MUSICLIS.IDS")); list.add(new IdsBitmap(buffer, offset + 12, 4, "Battle song", "MUSICLIS.IDS")); list.add(new IdsBitmap(buffer, offset + 16, 4, "Defeat song", "MUSICLIS.IDS")); } - else if (ResourceFactory.getInstance().resourceExists("SONGS.IDS")) { + else if (ResourceFactory.getInstance().resourceExists("MUSIC.IDS")) { // IWD2 + list.add(new IdsBitmap(buffer, offset, 4, "Day song", "MUSIC.IDS")); + list.add(new IdsBitmap(buffer, offset + 4, 4, "Night song", "MUSIC.IDS")); + list.add(new IdsBitmap(buffer, offset + 8, 4, "Victory song", "MUSIC.IDS")); + list.add(new IdsBitmap(buffer, offset + 12, 4, "Battle song", "MUSIC.IDS")); + list.add(new IdsBitmap(buffer, offset + 16, 4, "Defeat song", "MUSIC.IDS")); + } + else if (ResourceFactory.getInstance().resourceExists("SONGS.IDS")) { // PST list.add(new IdsBitmap(buffer, offset, 4, "Day song", "SONGS.IDS")); list.add(new IdsBitmap(buffer, offset + 4, 4, "Night song", "SONGS.IDS")); list.add(new Unknown(buffer, offset + 8, 4)); list.add(new IdsBitmap(buffer, offset + 12, 4, "Battle song", "SONGS.IDS")); list.add(new Unknown(buffer, offset + 16, 4)); } - else { + else { // BG list.add(new DecNumber(buffer, offset, 4, "Day song")); list.add(new DecNumber(buffer, offset + 4, 4, "Night song")); list.add(new DecNumber(buffer, offset + 8, 4, "Victory song")); diff --git a/infinity/resource/bcs/Compiler.java b/infinity/resource/bcs/Compiler.java index 5761652..04c0440 100644 --- a/infinity/resource/bcs/Compiler.java +++ b/infinity/resource/bcs/Compiler.java @@ -78,7 +78,7 @@ private Compiler() IdsMapCache.get("CLASS.IDS"), IdsMapCache.get("SPECIFIC.IDS"), IdsMapCache.get("GENDER.IDS"), - IdsMapCache.get("ALIGNMEN.IDS") + IdsMapCache.get("ALIGN.IDS") }; else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) itype = new IdsMap[]{ @@ -90,8 +90,8 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) IdsMapCache.get("GENDER.IDS"), IdsMapCache.get("ALIGNMNT.IDS"), IdsMapCache.get("CLASS.IDS"), - IdsMapCache.get("AVCLASS.IDS"), - IdsMapCache.get("CLASSMSK.IDS") +// IdsMapCache.get("AVCLASS.IDS"), +// IdsMapCache.get("CLASSMSK.IDS") }; else itype = new IdsMap[]{ @@ -101,9 +101,8 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) IdsMapCache.get("CLASS.IDS"), IdsMapCache.get("SPECIFIC.IDS"), IdsMapCache.get("GENDER.IDS"), - IdsMapCache.get("ALIGNMEN.IDS") + IdsMapCache.get("ALIGN.IDS") }; - emptyObject = compileObject(null, ""); setupScriptNames(); diff --git a/infinity/resource/bcs/Decompiler.java b/infinity/resource/bcs/Decompiler.java index 6ebad68..7bed176 100644 --- a/infinity/resource/bcs/Decompiler.java +++ b/infinity/resource/bcs/Decompiler.java @@ -318,9 +318,9 @@ private static String decompileOB(StringTokenizer st) coord = name; break; } - name = st.nextToken(); // IWD couldn't handle spaces in objstring - while (name.charAt(0) == '"' && !name.endsWith("OB")) - name = name + ' ' + st.nextToken(); + name = st.nextToken(); // ToDo: IWD can't handle spaces in objstring + // this opens a fat can of stupid with Icewind2 (below); IWD2 still has + // problems decompiling from "dirty" BCS source (in source view) } if (name.endsWith("OB")) name = name.substring(0, name.length() - 2); @@ -353,7 +353,7 @@ private static String decompileOB(StringTokenizer st) ids[index] = lookup(IdsMapCache.get("CLASS.IDS"), numbers[index++]); ids[index] = lookup(IdsMapCache.get("SPECIFIC.IDS"), numbers[index++]); ids[index] = lookup(IdsMapCache.get("GENDER.IDS"), numbers[index++]); - ids[index] = lookup(IdsMapCache.get("ALIGNMEN.IDS"), numbers[index++]); + ids[index] = lookup(IdsMapCache.get("ALIGN.IDS"), numbers[index++]); } IdsMap objectMap = IdsMapCache.get("OBJECT.IDS"); @@ -364,10 +364,10 @@ private static String decompileOB(StringTokenizer st) lookup(objectMap, numbers[index++]), lookup(objectMap, numbers[index++])}; - if (numbersIndex == 15) { - ids[index - 5] = lookup(IdsMapCache.get("AVCLASS.IDS"), numbers[index++]); - ids[index - 5] = lookup(IdsMapCache.get("CLASSMSK.IDS"), numbers[index++]); - } +// if (numbersIndex == 15) { +// ids[index - 5] = lookup(IdsMapCache.get("AVCLASS.IDS"), numbers[index++]); +// ids[index - 5] = lookup(IdsMapCache.get("CLASSMSK.IDS"), numbers[index++]); +// } StringBuilder code = new StringBuilder(); StringBuilder endcode = new StringBuilder(); diff --git a/infinity/resource/cre/CreResource.java b/infinity/resource/cre/CreResource.java index 7423881..5c6d5f1 100644 --- a/infinity/resource/cre/CreResource.java +++ b/infinity/resource/cre/CreResource.java @@ -410,7 +410,7 @@ private int readIWD2(byte buffer[], int offset) throws Exception { list.add(new StringRef(buffer, offset, "Name")); list.add(new StringRef(buffer, offset + 4, "Tooltip")); - list.add(new Flag(buffer, offset + 8, 4, "Flags", new String[]{"No flags set"})); + list.add(new Flag(buffer, offset + 8, 4, "Flags", s_flag)); // ToDo: figure these out whenever list.add(new DecNumber(buffer, offset + 12, 4, "XP value")); list.add(new DecNumber(buffer, offset + 16, 4, "XP")); list.add(new DecNumber(buffer, offset + 20, 4, "Gold")); @@ -595,12 +595,12 @@ private int readIWD2(byte buffer[], int offset) throws Exception // Bard spells for (int i = 0; i < 9; i++) { SectionOffset s_off = new SectionOffset(buffer, offset + 946 + 4 * i, - "Bard" + (i + 1) + " spells offset", null); - DecNumber s_count = new DecNumber(buffer, offset + 1198 + 4 * i, 4, "Bard" + (i + 1) + " spells count"); + "Bard spells " + (i + 1) + " offset", null); + DecNumber s_count = new DecNumber(buffer, offset + 1198 + 4 * i, 4, "Bard spells " + (i + 1) + " count"); list.add(s_off); list.add(s_count); AbstractStruct s = new Iwd2Struct(this, buffer, getExtraOffset() + s_off.getValue(), - s_count, "Bard" + (i + 1) + " spells", Iwd2Struct.TYPE_SPELL); + s_count, "Bard spells " + (i + 1), Iwd2Struct.TYPE_SPELL); list.add(s); // s_off.setStaticStruct(s); } @@ -608,13 +608,13 @@ private int readIWD2(byte buffer[], int offset) throws Exception // Cleric spells for (int i = 0; i < 9; i++) { SectionOffset s_off = new SectionOffset(buffer, offset + 982 + 4 * i, - "Cleric" + (i + 1) + " spells offset", null); + "Cleric spells " + (i + 1) + " offset", null); DecNumber s_count = new DecNumber(buffer, offset + 1234 + 4 * i, 4, - "Cleric" + (i + 1) + " spells count"); + "Cleric spells " + (i + 1) + " count"); list.add(s_off); list.add(s_count); AbstractStruct s = new Iwd2Struct(this, buffer, getExtraOffset() + s_off.getValue(), - s_count, "Cleric" + (i + 1) + " spells", Iwd2Struct.TYPE_SPELL); + s_count, "Cleric spells " + (i + 1), Iwd2Struct.TYPE_SPELL); list.add(s); // s_off.setStaticStruct(s); } @@ -622,13 +622,13 @@ private int readIWD2(byte buffer[], int offset) throws Exception // Druid spells for (int i = 0; i < 9; i++) { SectionOffset s_off = new SectionOffset(buffer, offset + 1018 + 4 * i, - "Druid" + (i + 1) + " spells offset", null); + "Druid spells " + (i + 1) + " offset", null); DecNumber s_count = new DecNumber(buffer, offset + 1270 + 4 * i, 4, - "Druid" + (i + 1) + " spells count"); + "Druid spells " + (i + 1) + " count"); list.add(s_off); list.add(s_count); AbstractStruct s = new Iwd2Struct(this, buffer, getExtraOffset() + s_off.getValue(), - s_count, "Druid" + (i + 1) + " spells", Iwd2Struct.TYPE_SPELL); + s_count, "Druid spells " + (i + 1), Iwd2Struct.TYPE_SPELL); list.add(s); // s_off.setStaticStruct(s); } @@ -636,13 +636,13 @@ private int readIWD2(byte buffer[], int offset) throws Exception // Paladin spells for (int i = 0; i < 9; i++) { SectionOffset s_off = new SectionOffset(buffer, offset + 1054 + 4 * i, - "Paladin" + (i + 1) + " spells offset", null); + "Paladin spells " + (i + 1) + " offset", null); DecNumber s_count = new DecNumber(buffer, offset + 1306 + 4 * i, 4, - "Paladin" + (i + 1) + " spells count"); + "Paladin spells " + (i + 1) + " count"); list.add(s_off); list.add(s_count); AbstractStruct s = new Iwd2Struct(this, buffer, getExtraOffset() + s_off.getValue(), - s_count, "Paladin" + (i + 1) + " spells", Iwd2Struct.TYPE_SPELL); + s_count, "Paladin spells " + (i + 1), Iwd2Struct.TYPE_SPELL); list.add(s); // s_off.setStaticStruct(s); } @@ -650,13 +650,13 @@ private int readIWD2(byte buffer[], int offset) throws Exception // Ranger spells for (int i = 0; i < 9; i++) { SectionOffset s_off = new SectionOffset(buffer, offset + 1090 + 4 * i, - "Ranger" + (i + 1) + " spells offset", null); + "Ranger spells " + (i + 1) + " offset", null); DecNumber s_count = new DecNumber(buffer, offset + 1342 + 4 * i, 4, - "Ranger" + (i + 1) + " spells count"); + "Ranger spells " + (i + 1) + " count"); list.add(s_off); list.add(s_count); AbstractStruct s = new Iwd2Struct(this, buffer, getExtraOffset() + s_off.getValue(), - s_count, "Ranger" + (i + 1) + " spells", Iwd2Struct.TYPE_SPELL); + s_count, "Ranger spells " + (i + 1), Iwd2Struct.TYPE_SPELL); list.add(s); // s_off.setStaticStruct(s); } @@ -664,13 +664,13 @@ private int readIWD2(byte buffer[], int offset) throws Exception // Sorcerer spells for (int i = 0; i < 9; i++) { SectionOffset s_off = new SectionOffset(buffer, offset + 1126 + 4 * i, - "Sorcerer" + (i + 1) + " spells offset", null); + "Sorcerer spells " + (i + 1) + " offset", null); DecNumber s_count = new DecNumber(buffer, offset + 1378 + 4 * i, 4, - "Sorcerer" + (i + 1) + " spells count"); + "Sorcerer spells " + (i + 1) + " count"); list.add(s_off); list.add(s_count); AbstractStruct s = new Iwd2Struct(this, buffer, getExtraOffset() + s_off.getValue(), - s_count, "Sorcerer" + (i + 1) + " spells", Iwd2Struct.TYPE_SPELL); + s_count, "Sorcerer spells " + (i + 1), Iwd2Struct.TYPE_SPELL); list.add(s); // s_off.setStaticStruct(s); } @@ -678,13 +678,13 @@ private int readIWD2(byte buffer[], int offset) throws Exception // Wizard spells for (int i = 0; i < 9; i++) { SectionOffset s_off = new SectionOffset(buffer, offset + 1162 + 4 * i, - "Wizard" + (i + 1) + " spells offset", null); + "Wizard spells " + (i + 1) + " offset", null); DecNumber s_count = new DecNumber(buffer, offset + 1414 + 4 * i, 4, - "Wizard" + (i + 1) + " spells count"); + "Wizard spells " + (i + 1) + " count"); list.add(s_off); list.add(s_count); AbstractStruct s = new Iwd2Struct(this, buffer, getExtraOffset() + s_off.getValue(), - s_count, "Wizard" + (i + 1) + " spells", Iwd2Struct.TYPE_SPELL); + s_count, "Wizard spells " + (i + 1), Iwd2Struct.TYPE_SPELL); list.add(s); // s_off.setStaticStruct(s); } @@ -692,13 +692,13 @@ private int readIWD2(byte buffer[], int offset) throws Exception // Domain spells for (int i = 0; i < 9; i++) { SectionOffset s_off = new SectionOffset(buffer, offset + 1450 + 4 * i, - "Domain" + (i + 1) + " spells offset", null); + "Domain spells " + (i + 1) + " offset", null); DecNumber s_count = new DecNumber(buffer, offset + 1486 + 4 * i, 4, - "Domain" + (i + 1) + " spells count"); + "Domain spells " + (i + 1) + " count"); list.add(s_off); list.add(s_count); AbstractStruct s = new Iwd2Struct(this, buffer, getExtraOffset() + s_off.getValue(), - s_count, "Domain" + (i + 1) + " spells", Iwd2Struct.TYPE_SPELL); + s_count, "Domain spells " + (i + 1), Iwd2Struct.TYPE_SPELL); list.add(s); // s_off.setStaticStruct(s); } @@ -729,7 +729,7 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(shape_off); list.add(shape_num); AbstractStruct shape_str = new Iwd2Struct(this, buffer, getExtraOffset() + shape_off.getValue(), - shape_num, "Shape", Iwd2Struct.TYPE_SHAPE); + shape_num, "Shapes", Iwd2Struct.TYPE_SHAPE); list.add(shape_str); // shape_off.setStaticStruct(shape_str); @@ -912,8 +912,9 @@ private int readOther(String version, byte buffer[], int offset) throws Exceptio list.add(new DecNumber(buffer, offset + 92, 1, "Unspent proficiencies")); // list.add(new Unknown(buffer, offset + 93, 1)); } - else + else { list.add(new UnsignDecNumber(buffer, offset + 92, 1, "Detect illusions")); + } list.add(new UnsignDecNumber(buffer, offset + 93, 1, "Set traps")); list.add(new DecNumber(buffer, offset + 94, 1, "Lore")); list.add(new UnsignDecNumber(buffer, offset + 95, 1, "Open locks")); @@ -1067,6 +1068,8 @@ else if (ResourceFactory.getInstance().resourceExists("DIETY.IDS")) "Good increment on death", "Law increment on death", "Lady increment on death", "Murder increment on death", "Don't face speaker", "Call for help"})); +// list.add(new Flag(buffer, offset + 729, 1, "Attribute flags 2", +// new String[]{"No flags set", "", "Invulnerable"})); // list.add(new Unknown(buffer, offset + 730, 2)); list.add(new IdsBitmap(buffer, offset + 732, 2, "Color 1", "CLOWNCLR.IDS")); list.add(new IdsBitmap(buffer, offset + 734, 2, "Color 2", "CLOWNCLR.IDS")); diff --git a/infinity/resource/cre/Viewer.java b/infinity/resource/cre/Viewer.java index c1ea293..5a78dc3 100644 --- a/infinity/resource/cre/Viewer.java +++ b/infinity/resource/cre/Viewer.java @@ -66,6 +66,7 @@ private static JPanel makeMiscPanelIWD2(CreResource cre) ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Gender"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Alignment"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Kit"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Challenge rating"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Fortitude save"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Reflex save"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Will save"), gbl, gbc, true); @@ -314,6 +315,7 @@ private JPanel makeStatsPanelIWD2(CreResource cre) ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Name"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("XP"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("XP value"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Total level"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("AC"), gbl, gbc, true); StructEntry s1 = cre.getAttribute("Current HP"); diff --git a/infinity/resource/dlg/DlgResource.java b/infinity/resource/dlg/DlgResource.java index eb33cdb..1de129e 100644 --- a/infinity/resource/dlg/DlgResource.java +++ b/infinity/resource/dlg/DlgResource.java @@ -53,7 +53,7 @@ public JComponent getDetailViewer() public void write(OutputStream os) throws IOException { offsetState.setValue(0x30); - if (list.size() >= 13 && getStructEntryAt(12).getName().equalsIgnoreCase("Dialogue type")) + if (list.size() >= 13 && getStructEntryAt(12).getName().equalsIgnoreCase("Threat response")) offsetState.setValue(0x34); offsetTrans.setValue(offsetState.getValue() + 0x10 * countState.getValue()); offsetStaTri.setValue(offsetTrans.getValue() + 0x20 * countTrans.getValue()); diff --git a/infinity/resource/graphics/BamResource.java b/infinity/resource/graphics/BamResource.java index 56c8630..30aea69 100644 --- a/infinity/resource/graphics/BamResource.java +++ b/infinity/resource/graphics/BamResource.java @@ -282,7 +282,6 @@ private void showFrame() bprevframe.setEnabled(selectedFrame > 0); bnextanim.setEnabled(selectedAnim + 1 < anims.length); bprevanim.setEnabled(selectedAnim > 0); - } // -------------------------- INNER CLASSES -------------------------- diff --git a/infinity/resource/itm/Ability.java b/infinity/resource/itm/Ability.java index 388da93..529deab 100644 --- a/infinity/resource/itm/Ability.java +++ b/infinity/resource/itm/Ability.java @@ -92,8 +92,8 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 34, 2, "# charges")); list.add(new Bitmap(buffer, offset + 36, 2, "When drained", s_drain)); // list.add(new Unknown(buffer, offset + 37, 1)); +// list.add(new Bitmap(buffer, offset + 38, 1, "Allow strength bonus?", s_yesno)); list.add(new Flag(buffer, offset + 38, 4, "Flags", s_recharge)); -// list.add(new Bitmap(buffer, offset + 39, 1, "Item recharges?", s_recharge)); // if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) // list.add( // new Bitmap(buffer, offset + 40, 2, "Attack type", diff --git a/infinity/resource/itm/ItmResource.java b/infinity/resource/itm/ItmResource.java index 9b06ddd..2fcae59 100644 --- a/infinity/resource/itm/ItmResource.java +++ b/infinity/resource/itm/ItmResource.java @@ -26,11 +26,11 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd "Familiars", "Tattoos", "Lenses", "Bucklers", "Candles", "", "Clubs", "", "", "Large shields", "", "Medium shields", "Notes", - "", "", "Small shields", "", - "Telescopes", "Bottles", "Greatswords", "Containers", + "Rods", "Skulls", "Small shields", "", + "Telescopes", "Bottles", "Greatswords", "Bags", "Furs and pelts", "Leather armor", "Studded leather", "Chain mail", "Splint mail", "Plate mail", "Full plate", "Hide armor", "Robes", - "", "Bastard swords", "Scarves", "Food", "Hats", "Gauntlets"}; + "Scale mail", "Bastard swords", "Scarves", "Rations", "Hats", "Gloves"}; public static final String s_categories11[] = {"Miscellaneous", "Amulets and necklaces", "Armor", "Belts and girdles", "Boots", "Arrows", "Bracers and gauntlets", "Headgear", diff --git a/infinity/resource/sto/StoResource.java b/infinity/resource/sto/StoResource.java index b0e68b1..2a33def 100644 --- a/infinity/resource/sto/StoResource.java +++ b/infinity/resource/sto/StoResource.java @@ -18,8 +18,9 @@ public final class StoResource extends AbstractStruct implements Resource, HasAd private static final String[] s_flag = {"Can only rest", "Can buy", "Can sell", "Can identify", "Can steal", "Can buy cures", "Can donate", "Can buy drinks", "", "", "Tavern quality 1", "Tavern quality 2", "Tavern quality 3"}; - private static final String[] s_flag11 = {"Can only rest", "Can buy", "Can sell", "Can identify", - "Can steal", "Can donate", "Can buy cures", "Can buy drinks"}; + private static final String[] s_flag9 = {"Can only rest", "Can buy", "Can sell", "Can identify", + "Can steal", "Can donate", "Can buy cures", "Can buy drinks", + "", "", "Tavern quality 1", "Tavern quality 2", "Tavern quality 3"}; private static final String[] s_flag_bg2 = {"Can only rest", "Can buy", "Can sell", "Can identify", "Can steal", "Can buy cures", "Can donate", "Can buy drinks", "", "", "Tavern quality 1", "Tavern quality 2", @@ -76,13 +77,13 @@ protected int read(byte buffer[], int offset) throws Exception else if (version.toString().equalsIgnoreCase("V9.0")) { list.add(new Bitmap(buffer, offset + 8, 4, "Type", s_type9)); list.add(new StringRef(buffer, offset + 12, "Name")); - list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag)); + list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag9)); } else { list.add(new Bitmap(buffer, offset + 8, 4, "Type", s_type)); list.add(new StringRef(buffer, offset + 12, "Name")); if (version.toString().equalsIgnoreCase("V1.1")) - list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag11)); + list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag9)); else list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag)); } From 9d3681fa9d1a2fdc1743ac6a07a324dd880e56ea Mon Sep 17 00:00:00 2001 From: Taimon Date: Tue, 12 Jan 2010 23:06:11 +0800 Subject: [PATCH 03/37] devSin merge --- infinity/check/CreInvChecker.java | 3 +- infinity/check/ScriptChecker.java | 2 +- infinity/datatype/EffectType.java | 7 +- infinity/resource/AbstractAbility.java | 291 ++++++++++++++++++++++- infinity/resource/Effect2.java | 4 +- infinity/resource/EffectFactory.java | 160 +++++-------- infinity/resource/are/Actor.java | 24 +- infinity/resource/are/ITEPoint.java | 22 +- infinity/resource/are/SpawnPoint.java | 4 +- infinity/resource/are/Viewer.java | 2 +- infinity/resource/are/ViewerActor.java | 21 +- infinity/resource/bcs/Compiler.java | 24 +- infinity/resource/bcs/Decompiler.java | 8 +- infinity/resource/cre/CreResource.java | 49 ++-- infinity/resource/cre/Viewer.java | 2 +- infinity/resource/itm/Ability.java | 9 +- infinity/resource/itm/ItmResource.java | 16 +- infinity/resource/other/VvcResource.java | 6 +- infinity/resource/spl/Ability.java | 9 +- infinity/resource/spl/SplResource.java | 22 +- infinity/resource/sto/StoResource.java | 34 ++- infinity/util/MassExporter.java | 5 +- 22 files changed, 513 insertions(+), 211 deletions(-) diff --git a/infinity/check/CreInvChecker.java b/infinity/check/CreInvChecker.java index 87a256d..5f48316 100644 --- a/infinity/check/CreInvChecker.java +++ b/infinity/check/CreInvChecker.java @@ -170,7 +170,8 @@ private void checkCreature(CreResource cre) items.add(entry); else if (entry.getOffset() >= slots_offset.getValue() + cre.getOffset() && entry instanceof DecNumber - && !entry.getName().equals("Weapon slot selected")) + && !entry.getName().equals("Weapon slot selected") + && !entry.getName().equals("Weapon ability selected")) slots.add(entry); } for (int i = 0; i < slots.size(); i++) { diff --git a/infinity/check/ScriptChecker.java b/infinity/check/ScriptChecker.java index c4518a9..595dc95 100644 --- a/infinity/check/ScriptChecker.java +++ b/infinity/check/ScriptChecker.java @@ -103,7 +103,7 @@ public void run() errorTable = new SortableTable(new String[]{"Script", "Error message", "Line"}, new Class[]{Object.class, Object.class, Integer.class}, new int[]{120, 440, 50}); - warningTable = new SortableTable(new String[]{"Script", "Warning message", "Line"}, + warningTable = new SortableTable(new String[]{"Script", "Warning", "Line"}, new Class[]{Object.class, Object.class, Integer.class}, new int[]{120, 440, 50}); for (int i = 0; i < scriptFiles.size(); i++) { diff --git a/infinity/datatype/EffectType.java b/infinity/datatype/EffectType.java index ba12276..69df07c 100644 --- a/infinity/datatype/EffectType.java +++ b/infinity/datatype/EffectType.java @@ -13,14 +13,15 @@ public final class EffectType extends Bitmap { public static final String s_dispel[] = {"No dispel/bypass resistance", "Dispel/Not bypass resistance", - "Not dispel/not bypass resistance", "Dispel/Bypass resistance"}; + "Not dispel/bypass resistance", "Dispel/Bypass resistance"}; private static final String s_target[] = {"None", "Self", "Preset target", "Party", "Everyone", "Everyone except party", "Caster group", "Target group", "Everyone except self", "Original caster"}; private static final String s_duration[] = {"Instant/Limited", "Instant/Permanent until death", "Instant/While equipped", "Delay/Limited", "Delay/Permanent", - "Delay/While equipped", "", "", "", "Instant/Permanent", - "Trigger"}; + "Delay/While equipped", "Limited after duration", + "Permanent after duration", "Equipped after duration", + "Instant/Permanent", "Trigger"}; private int attr_length; public EffectType(byte buffer[], int offset, int length) diff --git a/infinity/resource/AbstractAbility.java b/infinity/resource/AbstractAbility.java index 03dda25..095400e 100644 --- a/infinity/resource/AbstractAbility.java +++ b/infinity/resource/AbstractAbility.java @@ -17,8 +17,297 @@ public abstract class AbstractAbility extends AbstractStruct "Caster (keep spell, no animation)"}; protected static final String[] s_dmgtype = {"None", "Piercing", "Crushing", "Slashing", "Missile", "Fist", "Piercing or crushing", "Piercing or slashing", - "Crushing or slashing", "Missile (blunt)"}; + "Crushing or slashing", "Blunt missile"}; + // ToDo: these are pretty nasty in here? + protected static final String[] s_proj_iwd = {"", "None", "Arrow", + "Arrow exploding", "Arrow flaming", "Arrow heavy", "Arrow non-magical", + "Axe", "Axe exploding", "Axe flaming", "Axe heavy", "Axe non-magical", + "Bolt", "Bolt exploding", "Bolt flaming", "Bolt heavy", "Bolt non-magical", + "Bullet", "Bullet exploding", "Bullet flaming", "Bullet heavy", + "Bullet non-magical", "Burning hands", "Call lightning", "Chromatic orb", + "Cone of cold", "Cone of fire", "Dagger", "Dagger exploding", + "Dagger flaming", "Dagger heavy", "Dagger non-magical", "Dart", + "Dart exploding", "Dart flaming", "Dart heavy", "Dart non-magical", + "BG magic missile", "Fireball", "Ice fragments", "Lightning bolt", + "Skipping stone", "Sleep", "Skeleton animation", "Smoke ball", + "Smoke large", "Smoke small", "Sparkle blue", "Sparkle gold", + "Sparkle purple", "Sparkle ice", "Sparkle stone", "Sparkle black", + "Sparkle chromatic", "Sparkle red", "Sparkle green", "Spear", + "Spear exploding", "Spear flaming", "Spear heavy", "Spear non-magical", + "Star sprite", "Stoned", "Web travel", "Web ground", "Gaze", "Holy might", + "Flame strike", "Magic missiles 1", "Magic missiles 2", "Magic missiles 3", + "Magic missiles 4", "Magic missiles 5", "Magic missiles 6", + "Magic missiles 7", "Magic missiles 8", "Magic missiles 9", + "Magic missiles 10", "Magic missiles 11", "Invisible traveling", + "Fire bolt", "Call lightning chain 1", "Call lightning chain 2", + "Call lightning chain 3", "Call lightning chain 4", + "Call lightning chain 5", "Call lightning chain 6", + "Call lightning chain 7", "Call lightning chain 8", + "Call lightning chain 9", "Call lightning chain 10", + "Call lightning chain 11", "Fire storm", "Call lightning storm", + "Instant area effect", "Stinking cloud", "Skulltrap", "Color spray", + "Ice storm", "Fire wall", "Glyph", "Grease", "Flame arrow green", + "Flame arrow blue", "Fireball green", "Fireball blue", "Potion", + "Potion exploding", "Acid blob", "Agannazar's scorcher", "Travel door", + "Glow necromancy", "Glow alteration", "Glow enchantment", "Glow abjuration", + "Glow illusion", "Glow conjure", "Glow invocation", "Glow divination", + "Hit necromancy air", "Hit necromancy earth", "Hit necromancy water", + "Hit alteration air", "Hit alteration earth", "Hit alteration water", + "Hit enchantment air", "Hit enchantment earth", "Hit enchantment water", + "Hit abjuration air", "Hit abjuration earth", "Hit abjuration water", + "Hit illusion air", "Hit illusion earth", "Hit illusion water", + "Hit conjure air", "Hit conjure earth", "Hit conjure water", + "Hit invocation air", "Hit invocation earth", "Hit invocation water", + "Hit divination air", "Hit divination earth", "Hit divination water", + "Hit mushroom fire", "Hit mushroom grey", "Hit mushroom green", + "Hit shaft fire", "Hit shaft light", "Hit swirl white", "Sparkle area blue", + "Sparkle area gold", "Sparkle area purple", "Sparkle area ice", + "Sparkle area stone", "Sparkle area black", "Sparkle area chromatic", + "Sparkle area red", "Sparkle area green", "Instant area (party only)", + "Instant area (not party)", "Sparkle area blue (party only)", + "Sparkle area gold (party only)", "Sparkle area purple (party only)", + "Sparkle area ice (party only)", "Sparkle area stone (party only)", + "Sparkle area black (party only)", "Sparkle area chromatic (party only)", + "Sparkle area red (party only)", "Sparkle area green (party only)", + "Sparkle area blue (not party)", "Sparkle area gold (not party)", + "Sparkle area purple (not party)", "Sparkle area ice (not party)", + "Sparkle area stone (not party)", "Sparkle area black (not party)", + "Sparkle area chromatic (not party)", "Sparkle area red (not party)", + "Sparkle area green (not party)", "Sparkle area magenta (not party)", + "Sparkle area orange (not party)", "Sparkle area magenta (party only)", + "Sparkle area orange (party only)", "Sparkle area magenta", + "Sparkle area orange", "Sparkle magenta", "Sparkle orange", + "Non-sprite area", "Cloudkill", "Flame arrow ice", "Cow", "Hold person", + "Scorcher ice", "Acid blob mustard", "Acid blob grey", "Acid blob ochre", + "Red holy might", "Hit necromancy area", "Hit alteration area", + "Hit enchantment area", "Hit abjuration area", "Hit illusion area", + "Hit conjure area", "Hit invocation area", "Hit divination area", + "Fireball white", "Instant area effect small", "Lightning bolt ground", + "Lightning no bounce", "Hit finger of death", "Malavon's rage", + "Chain lightning", "Acid storm", "Death fog", "Spike stones", + "Incendiary cloud", "Produce fire", "Insect plague", + "Snilloc's snowball swarm", "Magic missile", "Hit abjuration", + "Hit alteration", "Hit invocation", "Hit necromancy", "Hit conjuration", + "Hit enchantment", "Hit illusion", "Hit divination", "Travel abjuration", + "Travel alteration", "Travel invocation", "Travel necromancy", + "Travel conjuration", "Travel enchantment", "Travel illusion", + "Travel divination", "Entangle", "Bless", "Curse", "Remove fear", + "Detect evil", "Detect invisibility", "Horror", "Resist fear", "Chant", + "Find traps", "Silence 15' radius", "Dispel magic", "Haste", "Slow", + "Hold animal", "Remove paralysis", "Icelance", "Strength of one", "Prayer", + "Confusion (wizard)", "Emotion", "Malison", "Defensive harmony", + "Protection from evil 10' radius", "Cloak of fear", "Recitation", + "Otiluke's resilient sphere", "Static charge", "Hold monster", "Chaos", + "Shroud of flame", "Righteous wrath of the faithful", "Death spell", + "Disintegrate", "Otiluke's freezing sphere", "Fire seed", + "Sol's searing orb", "Prismatic spray", "Mass invisibility", "Sunray", + "Confusion (priest)", "Symbol of pain", "Symbol of hopelessness", + "Power word, kill", "Malavon's corrosive fog", "Salamander aura", + "Umber hulk gaze", "Bombardier beetle cloud", "Zombie lord aura", + "Iron golem cloud", "Myconid spores", "Incendiary cloud explosion", + "Incendiary cloud idling", "Heavenly inferno", "Area hit monster summoning", + "Area hit animal summoning", "Area hit conjure earth elemental", + "Area hit conjure fire elemental", "Area hit conjure water elemental", + "Portal animation open", "Horror trap", "Winter wolf breath", + "Portal animation close", "Alicorn lance", "Soul eater", "Spike growth", + "Cloudburst", "Smashing wave", "Thorn spray", "Wall of moonlight", + "Whirlwind", "Earthquake", "Mist of eldath", "Circle of bones", + "Cloud of pestilence", "Undead ward", "Blade barrier", "Spiritual wrath", + "Lance of disruption", "Mordenkainen's force missiles", "Shout", + "Vitriolic sphere", "Suffocate", "Abi-dalzim's horrid wilting", + "Great shout", "Mournful wail", "Death knell", "War cry", "Undying lament", + "Mordenkainen's force missiles 1", "Mordenkainen's force missiles 2", + "Mordenkainen's force missiles 3", "Mordenkainen's force missiles 4", + "Mordenkainen's force missiles 5", "Mordenkainen's force missiles 6", + "Mordenkainen's force missiles 7", "Mordenkainen's force missiles 8", + "Mordenkainen's force missiles 9", "Mordenkainen's force missiles 10", + "Mordenkainen's force missiles 11", "Sunfire", "Power word, blind", + "Holy smite", "Unholy blight", "Greater command", "Holy word", + "Unholy word", "Great roar", "Will-o-wisp spray", + "Retribution (single projectile)", "Retribution", "Sekolah's fire", + "Blue glow", "Dragon gem cutscene", "Dragon breath", + "Crypt thing teleport", "Mustard jelly vapor", "Summon cornugons", + "Container glow", "Container glow bad", "Crypt thing teleport (fighter)", + "Crypt thing teleport (thief)", "Hold undead", "Invisibility 10' radius", + "Mass cure", "Delayed blast fireball", "Area hit gate", + "Wail of the banshee", "Symbol, fear", "Symbol, stun", "Symbol, death", + "Meteor swarm", "Improved haste", "Frost fingers", "Gedlee's electric loop", + "Wall of fire", "Aura of vitality", "Banishment", "Mass dominate", + "Mind flayer psionic blast", "Boulder", "Turn undead", "Mind fog", + "Half-dragon acid breath", "Half-dragon fire breath", + "Half-dragon lightning breath", "Guardian acid breath", "Ultrablast", + "Boulder big (trap)", "Fire trap", "Acid trap", "Chimera fire breath"}; + protected static final String[] s_proj_pst = {"", "None", "Arrow", + "Arrow exploding", "Arrow flaming", "Arrow heavy", "Arrow shocking", "Axe", + "Axe exploding", "Axe flaming", "Axe heavy", "Axe shocking", "Bolt", + "Bolt exploding", "Bolt flaming", "Bolt heavy", "Bolt shocking", "Bullet", + "Bullet exploding", "Bullet flaming", "Bullet heavy", "Bullet shocking", + "Burning hands", "Call lightning old", "Chromatic orb", + "BG cone of cold", "Cone of fire", "Dagger", "Dagger exploding", + "Dagger flaming", "Dagger heavy", "Dagger shocking", "Dart", + "Dart exploding", "Dart flaming", "Dart heavy", "Dart shocking", + "Magic missile", "Fireball", "Ice fragments", "Lightning bolt", + "Skipping stone", "Sleep", "Skeleton animation", "Smoke ball", + "Smoke large", "Smoke small", "Sparkle blue", "Sparkle gold", + "Sparkle purple", "Sparkle ice", "Sparkle stone", "Sparkle black", + "Sparkle chromatic", "Sparkle red", "Sparkle green", "Spear", + "Spear exploding", "Spear flaming", "Spear heavy", "Spear shocking", + "Star sprite", "Stoned", "Web travel", "Web ground", "Gaze", "Holy might", + "Flame strike", "BG magic missiles 1", "BG magic missiles 2", + "BG magic missiles 3", "BG magic missiles 4", "BG magic missiles 5", + "BG magic missiles 6", "BG magic missiles 7", "BG magic missiles 8", + "BG magic missiles 9", "BG magic missiles 10", "BG magic missiles 11", + "Invisible traveling", "Fire bolt", "Call lightning chain 1", + "Call lightning chain 2", "Call lightning chain 3", + "Call lightning chain 4", "Call lightning chain 5", + "Call lightning chain 6", "Call lightning chain 7", + "Call lightning chain 8", "Call lightning chain 9", + "Call lightning chain 10", "Call lightning chain 11", "Fire storm", + "Call lighting storm", "Instant area effect", "Stinking cloud", "Skulltrap", + "Color spray", "Ice storm", "Fire wall", "Glyph", "Grease", + "Flame arrow green", "Flame arrow blue", "Fireball green", "Fireball blue", + "Potion", "Potion exploding", "Acid blob", "Agannazar's scorcher", + "Travel door", "Glow necromancy", "Glow alteration", "Glow enchantment", + "Glow abjuration", "Glow illusion", "Glow conjuration", "Glow invocation", + "Glow divination", "Hit necromancy air", "Hit necromancy earth", + "Hit necromancy water", "Hit alteration air", "Hit alteration earth", + "Hit alteration water", "Hit enchantment air", "Hit enchantment earth", + "Hit enchantment water", "Hit abjuration air", "Hit abjuration earth", + "Hit abjuration water", "Hit illusion air", "Hit illusion earth", + "Hit illusion water", "Hit conjuration air", "Hit conjuration earth", + "Hit conjuration water", "Hit invocation air", "Hit invocation earth", + "Hit invocation water", "Hit divination air", "Hit divination earth", + "Hit divination water", "Hit mushroom fire", "Hit mushroom gray", + "Hit mushroom green", "Hit shaft fire", "Hit shaft light", + "Hit shaft white", "Sparkle area blue", "Sparkle area gold", + "Sparkle area purple", "Sparkle area ice", "Sparkle area stone", + "Sparkle area black", "Sparkle area chromatic", "Sparkle area red", + "Sparkle area green", "Instant area (party only)", + "Instant area (not party)", "Sparkle area blue (party only)", + "Sparkle area gold (party only)", "Sparkle area purple (party only)", + "Sparkle area ice (party only)", "Sparkle area stone (party only)", + "Sparkle area black (party only)", "Sparkle area chromatic (party only)", + "Sparkle area red (party only)", "Sparkle area green (party only)", + "Sparkle area blue (not party)", "Sparkle area gold (not party)", + "Sparkle area purple (not party)", "Sparkle area ice (not party)", + "Sparkle area stone (not party)", "Sparkle area black (not party)", + "Sparkle area chromatic (not party)", "Sparkle area red (not party)", + "Sparkle area green (not party)", "Sparkle area magenta (not party)", + "Sparkle area orange (not party)", "Sparkle area magenta (party only)", + "Sparkle area orange (party only)", "Sparkle area magenta", + "Sparkle area orange", "Sparkle magenta", "Sparkle orange", + "Non-sprite area", "BG cloudkill", "Flame arrow ice", "Cow", + "Hold person", "Scorcher ice", "Acid blob mustard", "Acid blob gray", + "Acid blob ochre", "Red holy might", "Hit necromancy area", + "Hit alteration area", "Hit enchantment area", "Hit abjuration area", + "Hit illusion area", "Hit conjuration area", "Hit invocation area", + "Hit divination area", "Litany of curses", "Stories-Bones-Tell", + "Magic missiles 1", "Magic missiles 2", "Magic missiles 3", + "Magic missiles 4", "Magic missiles 5", "Magic missiles 6", + "Magic missiles 7", "Magic missiles 8", "Magic missiles 9", + "Magic missiles 10", "Skull mob", "Skull mob 2", "Swarm curse", + "Swarm curse 2", "Adder's kiss", "Ice knife", "Pacify", "Strength", + "Ball lightning", "Ball lightning 2", "Blood bridge", "Force missiles", + "Improved strength", "Shroud of shadows", "Cloudkill", + "Howl of pandemonium", "Bladestorm", "Elysium's fires", "Abyssal fury", + "Horror", "Knock", "Hold undead", "Missile of patience", "Elysium's tears", + "Tasha's unbearable derisive laughter", "Axe of torment", "Blacksphere", + "Cone of cold", "Desert hell", "Fire and ice", "Chain lightning storm", + "Acid storm", "Stygian ice storm", "Meteor storm bombardment", "Deathbolt", + "Ignus' fury", "Power word, blind", "Mechanus' cannon", "Celestial host", + "Rune of torment", "Blessing", "Curse", "", "Halo of lesser revelation", + "Spiritual hammer", "Call lightning", "", "Vampiric touch", "Confusion", + "Power word, kill", "Globe of invulnerability", "Nordom's crossbow bolt", + "Raise dead", "Aura of fear", "Conflagration", "Special trap", + "Ignus' fireball", "Tongues of flame 1", "Tongues of flame 2", + "Tongues of flame 3", "Tongues of flame 4", "Tongues of flame 5", + "Ignus' terror", "Infernal orb", "Fiery rain", "Elemental strike", + "Reign of anger 1", "Reign of anger 2", "Reign of anger 3", + "Reign of anger 4", "Reign of anger 5", "Power of one", "Succubus kiss", + "Embalming"}; + protected static final String[] s_projectile = {"", "None", "Arrow", + "Arrow exploding", "Arrow flaming", "Arrow heavy", "Arrow shocking", "Axe", + "Axe exploding", "Axe flaming", "Axe heavy", "Axe shocking", "Bolt", + "Bolt exploding", "Bolt flaming", "Bolt heavy", "Bolt shocking", "Bullet", + "Bullet exploding", "Bullet flaming", "Bullet heavy", "Bullet shocking", + "Burning hands", "Call lightning", "Chromatic orb", "Cone of cold", + "Cone of fire", "Dagger", "Dagger exploding", "Dagger flaming", + "Dagger heavy", "Dagger shocking", "Dart", "Dart exploding", "Dart flaming", + "Dart heavy", "Dart shocking", "Magic missile", "Fireball", "Ice fragments", + "Lightning bolt", "Skipping stone", "Sleep", "Skeleton animation", + "Smoke ball", "Smoke large", "Smoke small", "Sparkle blue", "Sparkle gold", + "Sparkle purple", "Sparkle ice", "Sparkle stone", "Sparkle black", + "Sparkle chromatic", "Sparkle red", "Sparkle green", "Spear", + "Spear exploding", "Spear flaming", "Spear heavy", "Spear shocking", + "Star sprite", "Stoned", "Web travel", "Web ground", "Gaze", "Holy might", + "Flame strike", "Magic missiles 1", "Magic missiles 2", "Magic missiles 3", + "Magic missiles 4", "Magic missiles 5", "Magic missiles 6", + "Magic missiles 7", "Magic missiles 8", "Magic missiles 9", + "Magic missiles 10", "Magic missiles 11", "Invisible traveling", + "Fire bolt", "Call lightning chain 1", "Call lightning chain 2", + "Call lightning chain 3", "Call lightning chain 4", + "Call lightning chain 5", "Call lightning chain 6", + "Call lightning chain 7", "Call lightning chain 8", + "Call lightning chain 9", "Call lightning chain 10", + "Call lightning chain 11", "Fire storm", "Call lightning storm", + "Instant area effect", "Cloud", "Skulltrap", "Color spray", "Ice storm", + "Fire wall", "Glyph", "Grease", "Flame arrow green", "Flame arrow blue", + "Fireball green", "Fireball blue", "Potion", "Potion exploding", + "Acid blob", "Agannazar's scorcher", "Travel door", "Glow necromancy", + "Glow alteration", "Glow enchantment", "Glow abjuration", "Glow illusion", + "Glow conjure", "Glow invocation", "Glow divination", "Hit necromancy air", + "Hit necromancy earth", "Hit necromancy water", "Hit alteration air", + "Hit alteration earth", "Hit alteration water", "Hit enchantment air", + "Hit enchantment earth", "Hit enchantment water", "Hit abjuration air", + "Hit abjuration earth", "Hit abjuration water", "Hit illusion air", + "Hit illusion earth", "Hit illusion water", "Hit conjure air", + "Hit conjure earth", "Hit conjure water", "Hit invocation air", + "Hit invocation earth", "Hit invocation water", "Hit divination air", + "Hit divination earth", "Hit divination water", "Hit mushroom fire", + "Hit mushroom grey", "Hit mushroom green", "Hit shaft fire", + "Hit shaft light", "Hit swirl white", "Sparkle area blue", + "Sparkle area gold", "Sparkle area purple", "Sparkle area ice", + "Sparkle area stone", "Sparkle area black", "Sparkle area chromatic", + "Sparkle area red", "Sparkle area green", "Instant area (party only)", + "Instant area (not party)", "Sparkle area blue (party only)", + "Sparkle area gold (party only)", "Sparkle area purple (party only)", + "Sparkle area ice (party only)", "Sparkle area stone (party only)", + "Sparkle area black (party only)", "Sparkle area chromatic (party only)", + "Sparkle area red (party only)", "Sparkle area green (party only)", + "Sparkle area blue (not party)", "Sparkle area gold (not party)", + "Sparkle area purple (not party)", "Sparkle area ice (not party)", + "Sparkle area stone (not party)", "Sparkle area black (not party)", + "Sparkle area chromatic (not party)", "Sparkle area red (not party)", + "Sparkle area green (not party)", "Sparkle area magenta (not party)", + "Sparkle area orange (not party)", "Sparkle area magenta (party only)", + "Sparkle area orange (party only)", "Sparkle area magenta", + "Sparkle area orange", "Sparkle magenta", "Sparkle orange", + "Non-sprite area", "Cloudkill", "Flame arrow ice", "Cow", "Hold", + "Scorcher ice", "Acid blob mustard", "Acid blob grey", "Acid blob ochre", + "Red holy might", "Hit necromancy area", "Hit alteration area", + "Hit enchantment area", "Hit abjuration area", "Hit illusion area", + "Hit conjure area", "Hit invocation area", "Hit divination area", + "Fireball white", "Instant area effect small", "Lightning bolt ground", + "Lightning no bounce", "Hit finger of death", "Beholder blast", + "Hold necromancy", "Fireball ignore center", "Area ignore center", + "Chain lightning", "Trap snare", "Small instant area", + "Small area ignore center", "Glyph trap (not party)", + "Small area (not party)", "Disintegrate", "Lightning bolt no bounce", + "Spell attack", "Medium instant area", "Cloud (not party)", "Golem cloud", + "Icewind glyph", "Fire seed", "Icewind insect", "Icewind chain insect", + "Meteor swarm", "Chain insect", "Icewind glyph hit", "Insect hit", + "Energy spear", "Fireball 3d", "Screaming skull", "Small comet", "Wilting", + "Weird field (not party)", "Anti-fireball", "Skulltrap (not party)", + "New lightning bolt (no bounce)", "Pillar of light", "Entangle area effect", + "Delayed blast fireball", "Trap dart", "Red dragon breath", + "Black dragon breath", "Silver dragon breath", "New color spray", + "New cone of cold", "Holy blight", "Unholy blight", "Prismatic spray", + "Instant area large (not party)", "Holy light pillar", "Red dragon hit", + "Red dragon middle", "Fireball (just projectile)", "New hold necromancy", + "Web (one person)", "Holy word (not party)", "Unholy word (not party)", + "Power word, sleep", "MDK bullet", "Storm of vengeance", "Comet"}; + protected AbstractAbility(AbstractStruct superStruct, String name, byte buffer[], int offset) throws Exception { diff --git a/infinity/resource/Effect2.java b/infinity/resource/Effect2.java index 7272693..43822cf 100644 --- a/infinity/resource/Effect2.java +++ b/infinity/resource/Effect2.java @@ -45,8 +45,8 @@ public static void readCommon(List list, byte[] buffer, int offset) list.add(new DecNumber(buffer, offset + 40, 4, "Parameter 3")); list.add(new DecNumber(buffer, offset + 44, 4, "Parameter 4")); list.add(new Unknown(buffer, offset + 48, 8)); - list.add(new TextString(buffer, offset + 56, 8, "Parameter 5")); - list.add(new Unknown(buffer, offset + 64, 8)); + list.add(new TextString(buffer, offset + 56, 8, "Resource 2")); + list.add(new TextString(buffer, offset + 64, 8, "Resource 3")); list.add(new DecNumber(buffer, offset + 72, 4, "Caster location: X")); list.add(new DecNumber(buffer, offset + 76, 4, "Caster location: Y")); list.add(new DecNumber(buffer, offset + 80, 4, "Target location: X")); diff --git a/infinity/resource/EffectFactory.java b/infinity/resource/EffectFactory.java index 4cbfd5e..9a363f6 100644 --- a/infinity/resource/EffectFactory.java +++ b/infinity/resource/EffectFactory.java @@ -22,92 +22,6 @@ public final class EffectFactory private static final String s_yesno[] = {"Yes", "No"}; private static final String s_noyes[] = {"No", "Yes"}; - private static final String s_projectile[] = {"None", "Arrow", - "Arrow exploding", "Arrow flaming", "Arrow heavy", "Arrow shocking", "Axe", - "Axe exploding", "Axe flaming", "Axe heavy", "Axe shocking", "Bolt", - "Bolt exploding", "Bolt flaming", "Bolt heavy", "Bolt shocking", "Bullet", - "Bullet exploding", "Bullet flaming", "Bullet heavy", "Bullet shocking", - "Burning hands", "Call lightning BG", "Chromatic orb", "Cone of cold BG", - "Cone of fire", "Dagger", "Dagger exploding", "Dagger flaming", - "Dagger heavy", "Dagger shocking", "Dart", "Dart exploding", "Dart flaming", - "Dart heavy", "Dart shocking", "Magic missile BG", "Fireball", - "Ice fragments", "Chain lightning", "Skipping stone", "Sleep", - "Skeleton animation", "Smoke ball", "Smoke large", "Smoke small", - "Sparkle blue", "Sparkle gold", "Sparkle purple", "Sparkle ice", - "Sparkle stone", "Sparkle black", "Sparkle chromatic", "Sparkle red", - "Sparkle green", "Spear", "Spear exploding", "Spear flaming", "Spear heavy", - "Spear shocking", "Star sprite", "Stoned", "Web travel", "Web ground", - "Gaze", "Holy might", "Flame strike", "Magic missiles BG 1", - "Magic missiles BG 2", "Magic missiles BG 3", "Magic missiles BG 4", - "Magic missiles BG 5", "Magic missiles BG 6", "Magic missiles BG 7", - "Magic missiles BG 8", "Magic missiles BG 9", "Magic missiles BG 10", - "Magic missiles BG 11", "Invisible traveling", "Fire bolt", - "Call lightning chain 1", "Call lightning chain 2", - "Call lightning chain 3", "Call lightning chain 4", - "Call lightning chain 5", "Call lightning chain 6", - "Call lightning chain 7", "Call lightning chain 8", - "Call lightning chain 9", "Call lightning chain 10", - "Call lightning chain 11", "Fire storm", "Call lighting storm", - "Instant area effect", "Cloud", "Skull trap", "Color spray", "Ice storm", - "Fire wall", "Glyph", "Grease", "Flame arrow green", "Flame arrow blue", - "Fireball green", "Fireball blue", "Potion", "Potion exploding", - "Acid blob", "Agannazar's scorcher", "Travel door", "Glow necromancy", - "Glow alteration", "Glow enchantment", "Glow abjuration", "Glow illusion", - "Glow conjuration", "Glow invocation", "Glow divination", - "Hit necromancy air", "Hit necromancy earth", "Hit necromancy water", - "Hit alteration air", "Hit alteration earth", "Hit alteration water", - "Hit enchantment air", "Hit enchantment earth", "Hit enchantment water", - "Hit abjuration air", "Hit abjuration earth", "Hit abjuration water", - "Hit illusion air", "Hit illusion earth", "Hit illusion water", - "Hit conjuration air", "Hit conjuration earth", "Hit conjuration water", - "Hit invocation air", "Hit invocation earth", "Hit invocation water", - "Hit divination air", "Hit divination earth", "Hit divination water", - "Hit mushroom fire", "Hit mushroom gray", "Hit mushroom green", - "Hit shaft fire", "Hit shaft light", "Hit shaft white", "Sparkle area blue", - "Sparkle area gold", "Sparkle area purple", "Sparkle area ice", - "Sparkle area stone", "Sparkle area black", "Sparkle area chromatic", - "Sparkle area red", "Sparkle area green", "Instant area (party only)", - "Instant area (not party)", "Sparkle area blue (party only)", - "Sparkle area gold (party only)", "Sparkle area purple (party only)", - "Sparkle area ice (party only)", "Sparkle area stone (party only)", - "Sparkle area black (party only)", "Sparkle area chromatic (party only)", - "Sparkle area red (party only)", "Sparkle area green (party only)", - "Sparkle area blue (not party)", "Sparkle area gold (not party)", - "Sparkle area purple (not party)", "Sparkle area ice (not party)", - "Sparkle area stone (not party)", "Sparkle area black (not party)", - "Sparkle area chromatic (not party)", "Sparkle area red (not party)", - "Sparkle area green (not party)", "Sparkle area magenta (not party)", - "Sparkle area orange (not party)", "Sparkle area magenta (party only)", - "Sparkle area orange (party only)", "Sparkle area magenta", - "Sparkle area orange", "Sparkle magenta", "Sparkle orange", - "Non-sprite area", "Cloudkill BG", "Flame arrow ice", "Cow", "Hold", - "Scorcher ice", "Acid blob mustard", "Acid blob gray", "Acid blob ochre", - "Red holy might", "Hit necromancy area", "Hit alteration area", - "Hit enchantment area", "Hit abjuration area", "Hit illusion area", - "Hit conjuration area", "Hit invocation area", "Litany of curses", - "Stories-bones-tell", "Magic missiles 1", "Magic missiles 2", - "Magic missiles 3", "Magic missiles 4", "Magic missiles 5", - "Magic missiles 6", "Magic missiles 7", "Magic missiles 8", - "Magic missiles 9", "Magic missiles 10", "Skull mob", "Skull mob 2", - "Swarm curse", "Swarm curse 2", "Adder's kiss", "Ice knife", "Pacify", - "Strength", "Ball lightning", "Ball lightning 2", "Blood bridge", - "Force missiles", "Improved strength", "Shroud of shadows", "Cloudkill", - "Howl of pandemonium", "Bladestorm", "Elysium's fires", "Abyssal fury", - "Horror", "Knock", "Hold undead", "Missile of patience", "Elysium's tears", - "Tasha's unbearable derisive laughter", "Axe of torment", "Blacksphere", - "Cone of cold", "Desert hell", "Fire and ice", "Chain lightning storm", - "Acid storm", "Stygian ice storm", "Meteor storm bombardment", "Deathbolt", - "Ignus' fury", "Power word, blind", "Mechanus' cannon", "Celestial host", - "Rune of torment", "Blessing", "Curse", "", "Halo of lesser revelation", - "Spiritual hammer", "Call lightning", "", "Vampiric touch", "Confusion", - "Power word, kill", "Globe of invulnerability", "Nordom's crossbow bolt", - "Raise dead", "Aura of fear", "Conflagration", "Special trap", - "Ignus' fireball", "Tongues of flame 1", "Tongues of flame 2", - "Tongues of flame 3", "Tongues of flame 4", "Tongues of flame 5", - "Ignus' terror", "Infernal orb", "Fiery rain", "Elemental strike", - "Reign of anger 1", "Reign of anger 2", "Reign of anger 3", - "Reign of anger 4", "Reign of anger 5", "Power of one", "Succubus kiss", - "Embalming"}; private static final String s_visuals[] = {"None", "Hit abjuration", "Hit alteration", "Hit invocation", "Hit necromancy", "Hit conjuration", "Hit enchantment", "Hit illusion", "Hit divination", "Armor", @@ -195,7 +109,6 @@ private EffectFactory() switch (ResourceFactory.getGameID()) { case ResourceFactory.ID_BG1: case ResourceFactory.ID_BG1TOTSC: - case ResourceFactory.ID_DEMO: s_effname = new String[]{"AC bonus", "Modify attacks per round", "Cure sleep", "Berserk", "Cure berserk", "Charm creature", "Charisma bonus", "Set color", "Set color glow solid", @@ -1126,7 +1039,7 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i if (ResourceFactory.getInstance().resourceExists("PROJECTL.IDS")) s.add(new IdsBitmap(buffer, offset + 4, 4, "Projectile", "PROJECTL.IDS")); else - s.add(new Bitmap(buffer, offset + 4, 4, "Projectile", s_projectile)); + s.add(new DecNumber(buffer, offset + 4, 4, "Projectile")); break; case 0x62: // Regeneration (CGameEffectRegeneration) @@ -1404,7 +1317,7 @@ else if (ResourceFactory.getInstance().resourceExists("SEQ.IDS")) break; case 0xBF: // Casting level bonus (CGameEffectCastingLevelBonus) - s.add(new Unknown(buffer, offset, 4)); + s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", new String[]{"Wizard", "Priest"})); break; @@ -1573,8 +1486,33 @@ else if (gameid == ResourceFactory.ID_ICEWIND || case 0xCE: // Protection from spell case 0x122: // Display spell immunity string + final String s_cretype[] = {"Default", "Undead", "Not undead", + "Fire-dwelling", "Not fire-dwelling", "Humanoid", "Not humanoid", + "Animal", "Not animal", "Elemental", "Not elemental", "Fungus", + "Not fungus", "Huge creature", "Not huge creature", "Elf", + "Not elf", "Umber hulk", "Not umber hulk", "Half-elf", + "Not half-elf", "Humanoid or animal", "Not humanoid or animal", + "Blind", "Not blind", "Cold-dwelling", "Not cold-dwelling", "Golem", + "Not golem", "Minotaur", "Not minotaur", "Undead or fungus", + "Not undead or fungus", "Good", "Not good", "Neutral", + "Not neutral", "Evil", "Not evil", "Paladin", "Not paladin", + "Same moral alignment as source", + "Not same moral alignment as source", "Source", "Not source", + "Water-dwelling", "Not water-dwelling", "Breathing", + "Not breathing", "Allies", "Not allies", "Enemies", "Not enemies", + "Fire or cold dwelling", "Not fire or cold dwelling", "Unnatural", + "Not unnatural", "Male", "Not male", "Lawful", "Not lawful", + "Chaotic", "Not chaotic", "Evasion check", "Orc", "Not orc", "Deaf", + "Not deaf", "Summoned creature", "Not summoned creature", + "Mind flayer", "Not mind flayer", "Silenced", "Not silenced", + "Intelligence less than", "Intelligence greater than", + "Intelligence less than or equal to", + "Intelligence greater than or equal to", "Skald", "Not skald", + "Near enemies", "Not near enemies", "Drow", "Not drow", + "Gray dwarf", "Not gray dwarf", "Daytime", "Not daytime", "Outdoor", + "Not outdoor", "Keg", "Not keg", "Outsider", "Not outsider"}; s.add(new Unknown(buffer, offset, 4)); - s.add(new HexNumber(buffer, offset + 4, 4, "Creature type")); + s.add(new Bitmap(buffer, offset + 4, 4, "Creature type", s_cretype)); restype = "SPL"; break; @@ -1780,7 +1718,7 @@ else if (gameid == ResourceFactory.ID_BG2 || if (ResourceFactory.getInstance().resourceExists("PROJECTL.IDS")) s.add(new IdsBitmap(buffer, offset + 4, 4, "Projectile", "PROJECTL.IDS")); else - s.add(new Bitmap(buffer, offset + 4, 4, "Projectile", s_projectile)); + s.add(new DecNumber(buffer, offset + 4, 4, "Projectile")); break; case 0xC6: // Reflect specified effect (CGameEffectBounceEffect) @@ -2158,27 +2096,27 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { case 0xCE: // Protection from spell case 0x122: // Display spell immunity string final String s_cretype[] = {"Default", "Undead", "Not undead", - "Fire dwelling", "Not fire dwelling", "Humanoid", "Not humanoid", + "Fire-dwelling", "Not fire-dwelling", "Humanoid", "Not humanoid", "Animal", "Not animal", "Elemental", "Not elemental", "Fungus", "Not fungus", "Huge creature", "Not huge creature", "Elf", "Not elf", "Umber hulk", "Not umber hulk", "Half-elf", "Not half-elf", "Humanoid or animal", "Not humanoid or animal", - "Blind", "Not blind", "Cold dwelling", "Not cold dwelling", "Golem", + "Blind", "Not blind", "Cold-dwelling", "Not cold-dwelling", "Golem", "Not golem", "Minotaur", "Not minotaur", "Undead or fungus", "Not undead or fungus", "Good", "Not good", "Neutral", "Not neutral", "Evil", "Not evil", "Paladin", "Not paladin", "Same moral alignment as source", "Not same moral alignment as source", "Source", "Not source", - "Water dwelling", "Not water dwelling", "Breathing", + "Water-dwelling", "Not water-dwelling", "Breathing", "Not breathing", "Allies", "Not allies", "Enemies", "Not enemies", "Fire or cold dwelling", "Not fire or cold dwelling", "Unnatural", "Not unnatural", "Male", "Not male", "Lawful", "Not lawful", "Chaotic", "Not chaotic", "Evasion check", "Orc", "Not orc", "Deaf", "Not deaf", "Summoned creature", "Not summoned creature", "Mind flayer", "Not mind flayer", "Silenced", "Not silenced", - "Intelligence less than amount", "Intelligence greater than amount", - "Intelligence less than or equal amount", - "Intelligence greater than or equal amount", "Skald", "Not skald", + "Intelligence less than", "Intelligence greater than", + "Intelligence less than or equal to", + "Intelligence greater than or equal to", "Skald", "Not skald", "Near enemies", "Not near enemies", "Drow", "Not drow", "Gray dwarf", "Not gray dwarf", "Daytime", "Not daytime", "Outdoor", "Not outdoor", "Keg", "Not keg", "Outsider", "Not outsider"}; @@ -2298,8 +2236,32 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { break; case 0x192: // Add effects list - s.add(new Unknown(buffer, offset, 4)); - s.add(new DecNumber(buffer, offset + 4, 4, "Apply to type")); + final String s_applytype[] = {"Default", "Undead", "Not undead", + "Fire-dwelling", "Not fire-dwelling", "Humanoid", "Not humanoid", + "Animal", "Not animal", "Elemental", "Not elemental", "Fungus", + "Not fungus", "Huge creature", "Not huge creature", "Elf", + "Not elf", "Umber hulk", "Not umber hulk", "Half-elf", + "Not half-elf", "Humanoid or animal", "Not humanoid or animal", + "Blind", "Not blind", "Cold-dwelling", "Not cold-dwelling", "Golem", + "Not golem", "Minotaur", "Not minotaur", "Undead or fungus", + "Not undead or fungus", "Good", "Not good", "Neutral", + "Not neutral", "Evil", "Not evil", "Paladin", "Not paladin", + "Same moral alignment as source", + "Not same moral alignment as source", "Source", "Not source", + "Water-dwelling", "Not water-dwelling", "Breathing", + "Not breathing", "Allies", "Not allies", "Enemies", "Not enemies", + "Fire or cold dwelling", "Not fire or cold dwelling", "Unnatural", + "Not unnatural", "Male", "Not male", "Lawful", "Not lawful", + "Chaotic", "Not chaotic", "Orc", "Not orc", "Deaf", "Not deaf", + "Same alignment", "Not same alignment", "Allied and same alignment", + "Not allied and same alignment", "Hit points greater than", + "Hit points less than", "Drow", "Not drow", "Gray dwarf", + "Not gray dwarf", "Summoned creature", "Not summoned creature", + "Goblin", "Not goblin", "Giant", "Not giant", "Troll", "Not troll", + "Keg", "Not keg", "Human", "Not human", "Yuan-ti", "Not yuan-ti", + "Outsider", "Not outsider"}; + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Apply to type", s_applytype)); restype = "SPL"; break; diff --git a/infinity/resource/are/Actor.java b/infinity/resource/are/Actor.java index 6dec086..66df1c1 100644 --- a/infinity/resource/are/Actor.java +++ b/infinity/resource/are/Actor.java @@ -106,11 +106,20 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 68, 4, "# times talked to")); list.add(new ResourceRef(buffer, offset + 72, "Dialogue", "DLG")); list.add(new ResourceRef(buffer, offset + 80, "Override script", "BCS")); - list.add(new ResourceRef(buffer, offset + 88, "General script", "BCS")); - list.add(new ResourceRef(buffer, offset + 96, "Class script", "BCS")); - list.add(new ResourceRef(buffer, offset + 104, "Race script", "BCS")); - list.add(new ResourceRef(buffer, offset + 112, "Default script", "BCS")); - list.add(new ResourceRef(buffer, offset + 120, "Specific script", "BCS")); + if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) { + list.add(new ResourceRef(buffer, offset + 88, "Special 3 script", "BCS")); + list.add(new ResourceRef(buffer, offset + 96, "Special 2 script", "BCS")); + list.add(new ResourceRef(buffer, offset + 104, "Combat script", "BCS")); + list.add(new ResourceRef(buffer, offset + 112, "Movement script", "BCS")); + list.add(new ResourceRef(buffer, offset + 120, "Team script", "BCS")); + } + else { + list.add(new ResourceRef(buffer, offset + 88, "General script", "BCS")); + list.add(new ResourceRef(buffer, offset + 96, "Class script", "BCS")); + list.add(new ResourceRef(buffer, offset + 104, "Race script", "BCS")); + list.add(new ResourceRef(buffer, offset + 112, "Default script", "BCS")); + list.add(new ResourceRef(buffer, offset + 120, "Specific script", "BCS")); + } if (buffer[offset + 128] == 0x2a) // * list.add(new TextString(buffer, offset + 128, 8, "Character")); else @@ -118,9 +127,8 @@ protected int read(byte buffer[], int offset) throws Exception HexNumber creOffset = new HexNumber(buffer, offset + 136, 4, "CRE structure offset"); list.add(creOffset); list.add(new DecNumber(buffer, offset + 140, 4, "CRE structure size")); - if (getSuperStruct() != null && - getSuperStruct().getAttribute("Version").toString().equalsIgnoreCase("V9.1")) { - list.add(new ResourceRef(buffer, offset + 144, "Script?", "BCS")); + if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) { + list.add(new ResourceRef(buffer, offset + 144, "Special script 1", "BCS")); list.add(new Unknown(buffer, offset + 152, 120)); } else { diff --git a/infinity/resource/are/ITEPoint.java b/infinity/resource/are/ITEPoint.java index 7330a2b..95a4da1 100644 --- a/infinity/resource/are/ITEPoint.java +++ b/infinity/resource/are/ITEPoint.java @@ -80,7 +80,7 @@ protected void setAddRemovableOffset(AddRemovable datatype) protected int read(byte buffer[], int offset) throws Exception { list.add(new TextString(buffer, offset, 32, "Name")); - list.add(new Bitmap(buffer, offset + 32, 2, "Type of point", s_type)); + list.add(new Bitmap(buffer, offset + 32, 2, "Type", s_type)); list.add(new DecNumber(buffer, offset + 34, 2, "Bounding box: Left")); list.add(new DecNumber(buffer, offset + 36, 2, "Bounding box: Top")); list.add(new DecNumber(buffer, offset + 38, 2, "Bounding box: Right")); @@ -101,19 +101,31 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 114, 2, "Launch point: Y")); list.add(new ResourceRef(buffer, offset + 116, "Key", "ITM")); // Key type? list.add(new ResourceRef(buffer, offset + 124, "Script", "BCS")); - list.add(new DecNumber(buffer, offset + 132, 2, "Activation point: X")); - list.add(new DecNumber(buffer, offset + 134, 2, "Activation point: Y")); +// list.add(new DecNumber(buffer, offset + 132, 2, "Override box: Left")); +// list.add(new DecNumber(buffer, offset + 134, 2, "Override box: Top")); // list.add(new DecNumber(buffer, offset + 136, 2, "Override box: Right")); // list.add(new DecNumber(buffer, offset + 138, 2, "Override box: Bottom")); if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) { - list.add(new Unknown(buffer, offset + 136, 44)); + list.add(new Unknown(buffer, offset + 132, 48)); list.add(new DecNumber(buffer, offset + 180, 2, "Speaker point: X")); list.add(new DecNumber(buffer, offset + 182, 2, "Speaker point: Y")); list.add(new StringRef(buffer, offset + 184, "Speaker name")); list.add(new ResourceRef(buffer, offset + 188, "Dialogue", "DLG")); } - else + else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND || + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOW || + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOWTOT || + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) { + list.add(new Unknown(buffer, offset + 132, 4)); + list.add(new DecNumber(buffer, offset + 136, 4, "Alternate point: X")); + list.add(new DecNumber(buffer, offset + 140, 4, "Alternate point: Y")); + list.add(new Unknown(buffer, offset + 144, 52)); + } + else { + list.add(new DecNumber(buffer, offset + 132, 2, "Activation point: X")); + list.add(new DecNumber(buffer, offset + 134, 2, "Activation point: Y")); list.add(new Unknown(buffer, offset + 136, 60)); + } // list.add(new ResourceRef(buffer, offset + 188, "Proximity trigger dialog", "DLG")); return offset + 196; } diff --git a/infinity/resource/are/SpawnPoint.java b/infinity/resource/are/SpawnPoint.java index fb37928..bbe1cc8 100644 --- a/infinity/resource/are/SpawnPoint.java +++ b/infinity/resource/are/SpawnPoint.java @@ -32,7 +32,9 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 116, 2, "# creatures")); list.add(new DecNumber(buffer, offset + 118, 2, "Encounter difficulty")); list.add(new DecNumber(buffer, offset + 120, 2, "Spawn delay")); - list.add(new Flag(buffer, offset + 122, 2, "Spawn method", new String[]{"No flags set", "Spawn until paused", "Disable after spawn", "Spawn paused"})); + list.add(new Flag(buffer, offset + 122, 2, "Spawn method", + new String[]{"No flags set", "Spawn until paused", "Disable after spawn", + "Spawn paused"})); list.add(new DecNumber(buffer, offset + 124, 4, "Creature duration")); list.add(new DecNumber(buffer, offset + 128, 2, "Creature wander distance")); list.add(new DecNumber(buffer, offset + 130, 2, "Creature movement distance")); diff --git a/infinity/resource/are/Viewer.java b/infinity/resource/are/Viewer.java index d4194d3..2e03417 100644 --- a/infinity/resource/are/Viewer.java +++ b/infinity/resource/are/Viewer.java @@ -20,8 +20,8 @@ private static JPanel makeFieldPanel(AreResource are) gbc.insets = new Insets(3, 3, 3, 3); ViewerUtil.addLabelFieldPair(fieldPanel, are.getAttribute("Area north"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(fieldPanel, are.getAttribute("Area south"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, are.getAttribute("Area east"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, are.getAttribute("Area south"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, are.getAttribute("Area west"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, are.getAttribute("WED resource"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, are.getAttribute("Rain probability"), gbl, gbc, true); diff --git a/infinity/resource/are/ViewerActor.java b/infinity/resource/are/ViewerActor.java index 7703bff..6242dbd 100644 --- a/infinity/resource/are/ViewerActor.java +++ b/infinity/resource/are/ViewerActor.java @@ -78,11 +78,22 @@ private JPanel makeFieldPanel(Actor actor) ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Orientation"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Override script"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Specific script"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Class script"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Race script"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("General script"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Default script"), gbl, gbc, true); + if (actor.getSuperStruct() != null && + actor.getSuperStruct().getAttribute("Version").toString().equalsIgnoreCase("V9.1")) { + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Special 1 script"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Team script"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Special 2 script"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Combat script"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Special 3 script"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Movement script"), gbl, gbc, true); + } + else { + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Specific script"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Class script"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Race script"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("General script"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Default script"), gbl, gbc, true); + } ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Dialogue"), gbl, gbc, true); return fieldPanel; diff --git a/infinity/resource/bcs/Compiler.java b/infinity/resource/bcs/Compiler.java index 04c0440..a13ff13 100644 --- a/infinity/resource/bcs/Compiler.java +++ b/infinity/resource/bcs/Compiler.java @@ -90,8 +90,8 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) IdsMapCache.get("GENDER.IDS"), IdsMapCache.get("ALIGNMNT.IDS"), IdsMapCache.get("CLASS.IDS"), -// IdsMapCache.get("AVCLASS.IDS"), -// IdsMapCache.get("CLASSMSK.IDS") + IdsMapCache.get("AVCLASS.IDS"), + IdsMapCache.get("CLASSMSK.IDS") }; else itype = new IdsMap[]{ @@ -282,17 +282,23 @@ private void checkString(String function, String definition, String value) errors.put(new Integer(linenr), error); } } - else if (definition.equalsIgnoreCase("S:Name*")) { - if (function.equalsIgnoreCase("Dead(") || - function.equalsIgnoreCase("Name(") || - function.equalsIgnoreCase("NumDead(") || - function.equalsIgnoreCase("NumDeadGT(") || - function.equalsIgnoreCase("NumDeadLT(")) { - if (scriptNamesValid) { + else if (definition.equalsIgnoreCase("S:Name*")) { // ToDo: need CalledByName()? + if (scriptNamesValid) { + if (function.equalsIgnoreCase("Dead(") || + function.equalsIgnoreCase("IsScriptName(") || + function.equalsIgnoreCase("Name(") || + function.equalsIgnoreCase("NumDead(") || + function.equalsIgnoreCase("NumDeadGT(") || + function.equalsIgnoreCase("NumDeadLT(")) { if (!scriptNamesCre.containsKey(value.substring(1, value.length() - 1).toLowerCase().replaceAll(" ", "")) && IdsMapCache.get("OBJECT.IDS").lookup(value) == null) warnings.put(new Integer(linenr), "Script name not found: " + definition + " - " + value); } + else if (function.equalsIgnoreCase("SetCorpseEnabled(")) { + if (!scriptNamesAre.contains(value.substring(1, value.length() - 1).toLowerCase().replaceAll(" ", "")) && + IdsMapCache.get("OBJECT.IDS").lookup(value) == null) + warnings.put(new Integer(linenr), "Script name not found: " + definition + " - " + value); + } } } else if (function.equalsIgnoreCase("AttachTransitionToDoor(") && scriptNamesValid) { diff --git a/infinity/resource/bcs/Decompiler.java b/infinity/resource/bcs/Decompiler.java index 7bed176..d52d4ad 100644 --- a/infinity/resource/bcs/Decompiler.java +++ b/infinity/resource/bcs/Decompiler.java @@ -364,10 +364,10 @@ private static String decompileOB(StringTokenizer st) lookup(objectMap, numbers[index++]), lookup(objectMap, numbers[index++])}; -// if (numbersIndex == 15) { -// ids[index - 5] = lookup(IdsMapCache.get("AVCLASS.IDS"), numbers[index++]); -// ids[index - 5] = lookup(IdsMapCache.get("CLASSMSK.IDS"), numbers[index++]); -// } + if (numbersIndex == 15) { // ToDo: whatweretheythinking?! + ids[index - 5] = lookup(IdsMapCache.get("AVCLASS.IDS"), numbers[index++]); + ids[index - 5] = lookup(IdsMapCache.get("CLASSMSK.IDS"), numbers[index++]); + } StringBuilder code = new StringBuilder(); StringBuilder endcode = new StringBuilder(); diff --git a/infinity/resource/cre/CreResource.java b/infinity/resource/cre/CreResource.java index 5c6d5f1..9db958d 100644 --- a/infinity/resource/cre/CreResource.java +++ b/infinity/resource/cre/CreResource.java @@ -563,14 +563,14 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new Bitmap(buffer, offset + 661, 1, "Set extra death variable?", s_noyes)); list.add(new Bitmap(buffer, offset + 662, 1, "Increment kill count?", s_noyes)); list.add(new Unknown(buffer, offset + 663, 1)); - list.add(new DecNumber(buffer, offset + 664, 2, "Internal specifier 1")); - list.add(new DecNumber(buffer, offset + 666, 2, "Internal specifier 2")); - list.add(new DecNumber(buffer, offset + 668, 2, "Internal specifier 3")); - list.add(new DecNumber(buffer, offset + 670, 2, "Internal specifier 4")); - list.add(new DecNumber(buffer, offset + 672, 2, "Internal specifier 5")); + list.add(new DecNumber(buffer, offset + 664, 2, "Internal 1")); + list.add(new DecNumber(buffer, offset + 666, 2, "Internal 2")); + list.add(new DecNumber(buffer, offset + 668, 2, "Internal 3")); + list.add(new DecNumber(buffer, offset + 670, 2, "Internal 4")); + list.add(new DecNumber(buffer, offset + 672, 2, "Internal 5")); list.add(new TextString(buffer, offset + 674, 32, "Death variable (set)")); list.add(new TextString(buffer, offset + 706, 32, "Death variable (increment)")); - list.add(new Unknown(buffer, offset + 738, 2)); + list.add(new Bitmap(buffer, offset + 738, 2, "Location saved?", s_noyes)); list.add(new DecNumber(buffer, offset + 740, 2, "Saved location: X")); list.add(new DecNumber(buffer, offset + 742, 2, "Saved location: Y")); list.add(new DecNumber(buffer, offset + 744, 2, "Saved orientation")); @@ -581,11 +581,11 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new IdsBitmap(buffer, offset + 895, 1, "Class", "CLASS.IDS")); list.add(new IdsBitmap(buffer, offset + 896, 1, "Specific", "SPECIFIC.IDS")); list.add(new IdsBitmap(buffer, offset + 897, 1, "Gender", "GENDER.IDS")); - list.add(new IdsBitmap(buffer, offset + 898, 1, "Functional specifier 1", "OBJECT.IDS")); - list.add(new IdsBitmap(buffer, offset + 899, 1, "Functional specifier 2", "OBJECT.IDS")); - list.add(new IdsBitmap(buffer, offset + 900, 1, "Functional specifier 3", "OBJECT.IDS")); - list.add(new IdsBitmap(buffer, offset + 901, 1, "Functional specifier 4", "OBJECT.IDS")); - list.add(new IdsBitmap(buffer, offset + 902, 1, "Functional specifier 5", "OBJECT.IDS")); + list.add(new IdsBitmap(buffer, offset + 898, 1, "Object spec 1", "OBJECT.IDS")); + list.add(new IdsBitmap(buffer, offset + 899, 1, "Object spec 2", "OBJECT.IDS")); + list.add(new IdsBitmap(buffer, offset + 900, 1, "Object spec 3", "OBJECT.IDS")); + list.add(new IdsBitmap(buffer, offset + 901, 1, "Object spec 4", "OBJECT.IDS")); + list.add(new IdsBitmap(buffer, offset + 902, 1, "Object spec 5", "OBJECT.IDS")); list.add(new IdsBitmap(buffer, offset + 903, 1, "Alignment", "ALIGNMNT.IDS")); list.add(new DecNumber(buffer, offset + 904, 2, "Global identifier")); list.add(new DecNumber(buffer, offset + 906, 2, "Local identifier")); @@ -833,7 +833,7 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 96, 2, "Inventory 24")); list.add(new DecNumber(buffer, offset + 98, 2, "Magically created weapon")); list.add(new DecNumber(buffer, offset + 100, 2, "Weapon slot selected")); - list.add(new Unknown(buffer, offset + 102, 2)); + list.add(new DecNumber(buffer, offset + 102, 2, "Weapon ability selected")); int endoffset = offset; for (int i = 0; i < list.size(); i++) { @@ -1067,7 +1067,8 @@ else if (ResourceFactory.getInstance().resourceExists("DIETY.IDS")) "Increment team kills", "Invulnerable", "Good increment on death", "Law increment on death", "Lady increment on death", "Murder increment on death", - "Don't face speaker", "Call for help"})); + "Don't face speaker", "Call for help", "", "", "", "", + "", "", "", "", "", "", "", "", "", "", "Died"})); // list.add(new Flag(buffer, offset + 729, 1, "Attribute flags 2", // new String[]{"No flags set", "", "Invulnerable"})); // list.add(new Unknown(buffer, offset + 730, 2)); @@ -1097,14 +1098,14 @@ else if (version.equalsIgnoreCase("V9.0")) { list.add(new Bitmap(buffer, offset + 617, 1, "Set extra death variable?", s_noyes)); list.add(new Bitmap(buffer, offset + 618, 1, "Increment kill count?", s_noyes)); list.add(new Unknown(buffer, offset + 619, 1)); - list.add(new DecNumber(buffer, offset + 620, 2, "Internal specifier 1")); - list.add(new DecNumber(buffer, offset + 622, 2, "Internal specifier 2")); - list.add(new DecNumber(buffer, offset + 624, 2, "Internal specifier 3")); - list.add(new DecNumber(buffer, offset + 626, 2, "Internal specifier 4")); - list.add(new DecNumber(buffer, offset + 628, 2, "Internal specifier 5")); + list.add(new DecNumber(buffer, offset + 620, 2, "Internal 1")); + list.add(new DecNumber(buffer, offset + 622, 2, "Internal 2")); + list.add(new DecNumber(buffer, offset + 624, 2, "Internal 3")); + list.add(new DecNumber(buffer, offset + 626, 2, "Internal 4")); + list.add(new DecNumber(buffer, offset + 628, 2, "Internal 5")); list.add(new TextString(buffer, offset + 630, 32, "Death variable (set)")); list.add(new TextString(buffer, offset + 662, 32, "Death variable (increment)")); - list.add(new Unknown(buffer, offset + 694, 2)); + list.add(new Bitmap(buffer, offset + 694, 2, "Location saved?", s_noyes)); list.add(new DecNumber(buffer, offset + 696, 2, "Saved location: X")); list.add(new DecNumber(buffer, offset + 698, 2, "Saved location: Y")); list.add(new DecNumber(buffer, offset + 700, 2, "Saved orientation")); @@ -1117,11 +1118,11 @@ else if (version.equalsIgnoreCase("V9.0")) { list.add(new IdsBitmap(buffer, offset + 619, 1, "Class", "CLASS.IDS")); list.add(new IdsBitmap(buffer, offset + 620, 1, "Specific", "SPECIFIC.IDS")); list.add(new IdsBitmap(buffer, offset + 621, 1, "Gender", "GENDER.IDS")); - list.add(new IdsBitmap(buffer, offset + 622, 1, "Functional specifier 1", "OBJECT.IDS")); - list.add(new IdsBitmap(buffer, offset + 623, 1, "Functional specifier 2", "OBJECT.IDS")); - list.add(new IdsBitmap(buffer, offset + 624, 1, "Functional specifier 3", "OBJECT.IDS")); - list.add(new IdsBitmap(buffer, offset + 625, 1, "Functional specifier 4", "OBJECT.IDS")); - list.add(new IdsBitmap(buffer, offset + 626, 1, "Functional specifier 5", "OBJECT.IDS")); + list.add(new IdsBitmap(buffer, offset + 622, 1, "Object spec 1", "OBJECT.IDS")); + list.add(new IdsBitmap(buffer, offset + 623, 1, "Object spec 2", "OBJECT.IDS")); + list.add(new IdsBitmap(buffer, offset + 624, 1, "Object spec 3", "OBJECT.IDS")); + list.add(new IdsBitmap(buffer, offset + 625, 1, "Object spec 4", "OBJECT.IDS")); + list.add(new IdsBitmap(buffer, offset + 626, 1, "Object spec 5", "OBJECT.IDS")); // if (ResourceFactory.getGameID() == ResourceFactory.ID_BG2 || // ResourceFactory.getGameID() == ResourceFactory.ID_BG2TOB) // list.add(new IdsBitmap(buffer, offset + 627, 1, "Alignment", "ALIGN.IDS")); diff --git a/infinity/resource/cre/Viewer.java b/infinity/resource/cre/Viewer.java index 5a78dc3..d2eff8b 100644 --- a/infinity/resource/cre/Viewer.java +++ b/infinity/resource/cre/Viewer.java @@ -62,7 +62,7 @@ private static JPanel makeMiscPanelIWD2(CreResource cre) ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("General"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Race"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Class"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Specific"), gbl, gbc, true); +// ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Specific"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Gender"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Alignment"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Kit"), gbl, gbc, true); diff --git a/infinity/resource/itm/Ability.java b/infinity/resource/itm/Ability.java index 529deab..345327e 100644 --- a/infinity/resource/itm/Ability.java +++ b/infinity/resource/itm/Ability.java @@ -102,8 +102,15 @@ protected int read(byte buffer[], int offset) throws Exception // list.add(new Unknown(buffer, offset + 40, 2)); if (ResourceFactory.getInstance().resourceExists("PROJECTL.IDS")) list.add(new ProRef(buffer, offset + 42, "Projectile")); + else if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) + list.add(new Bitmap(buffer, offset + 42, 2, "Projectile", s_proj_pst)); + else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND || + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOW || + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOWTOT || + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) + list.add(new Bitmap(buffer, offset + 42, 2, "Projectile", s_proj_iwd)); else - list.add(new DecNumber(buffer, offset + 42, 2, "Projectile")); + list.add(new Bitmap(buffer, offset + 42, 2, "Projectile", s_projectile)); list.add(new DecNumber(buffer, offset + 44, 2, "Animation: Overhand swing %")); list.add(new DecNumber(buffer, offset + 46, 2, "Animation: Backhand swing %")); list.add(new DecNumber(buffer, offset + 48, 2, "Animation: Thrust %")); diff --git a/infinity/resource/itm/ItmResource.java b/infinity/resource/itm/ItmResource.java index 2fcae59..1f9165d 100644 --- a/infinity/resource/itm/ItmResource.java +++ b/infinity/resource/itm/ItmResource.java @@ -18,15 +18,15 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd {"Miscellaneous", "Amulets and necklaces", "Armor", "Belts and girdles", "Boots", "Arrows", "Bracers and gauntlets", "Headgear", "Keys", "Potions", "Rings", "Scrolls", "Shields", "Food", - "Bullets", "Bows", "Daggers", "Maces", "Slings", "Short swords", - "Long swords", "Hammers", "Morning stars", "Flails", "Darts", + "Bullets", "Bows", "Daggers", "Maces", "Slings", "Small swords", + "Large swords", "Hammers", "Morning stars", "Flails", "Darts", "Axes", "Quarterstaves", "Crossbows", "Hand-to-hand weapons", "Spears", "Halberds", "Bolts", "Cloaks and robes", "Gold pieces", "Gems", "Wands", "Containers", "Books", "Familiars", "Tattoos", "Lenses", "Bucklers", - "Candles", "", "Clubs", "", "", - "Large shields", "", "Medium shields", "Notes", - "Rods", "Skulls", "Small shields", "", + "Candles", "Child bodies", "Clubs", "Female bodies", "", + "Large shields", "Male bodies", "Medium shields", "Notes", + "Rods", "Skulls", "Small shields", "Spider bodies", "Telescopes", "Bottles", "Greatswords", "Bags", "Furs and pelts", "Leather armor", "Studded leather", "Chain mail", "Splint mail", "Plate mail", "Full plate", "Hide armor", "Robes", @@ -34,9 +34,9 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd public static final String s_categories11[] = {"Miscellaneous", "Amulets and necklaces", "Armor", "Belts and girdles", "Boots", "Arrows", "Bracers and gauntlets", "Headgear", - "Keys", "Potions", "Rings", "Scrolls", "Shields", "Food", - "Bullets", "Bows", "Daggers", "Clubs", "Slings", "Short swords", - "Long swords", "Hammers", "Morning stars", "Flails", "Darts", + "Keys", "Potions", "Rings", "Scrolls", "Shields", "Spells", + "Bullets", "Bows", "Daggers", "Maces", "Slings", "Small swords", + "Large swords", "Hammers", "Morning stars", "Flails", "Darts", "Axes", "Quarterstaves", "Crossbows", "Hand-to-hand weapons", "Greatswords", "Halberds", "Bolts", "Cloaks and robes", "Copper commons", "Gems", "Wands", "Eyeballs", "Bracelets", diff --git a/infinity/resource/other/VvcResource.java b/infinity/resource/other/VvcResource.java index ccfb1d5..f3c96b2 100644 --- a/infinity/resource/other/VvcResource.java +++ b/infinity/resource/other/VvcResource.java @@ -49,15 +49,15 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 92, 4, "Duration (frames)")); list.add(new Unknown(buffer, offset + 96, 4)); list.add(new Unknown(buffer, offset + 100, 4)); - list.add(new DecNumber(buffer, offset + 104, 4, "First BAM animation number")); - list.add(new DecNumber(buffer, offset + 108, 4, "Second BAM animation number")); + list.add(new DecNumber(buffer, offset + 104, 4, "First animation number")); + list.add(new DecNumber(buffer, offset + 108, 4, "Second animation number")); list.add(new Unknown(buffer, offset + 112, 4)); list.add(new Unknown(buffer, offset + 116, 4)); list.add(new ResourceRef(buffer, offset + 120, "Starting sound", "WAV")); list.add(new ResourceRef(buffer, offset + 128, "Duration sound", "WAV")); list.add(new Unknown(buffer, offset + 136, 4)); list.add(new Unknown(buffer, offset + 140, 4)); - list.add(new DecNumber(buffer, offset + 144, 4, "Third BAM animation number")); + list.add(new DecNumber(buffer, offset + 144, 4, "Third animation number")); list.add(new ResourceRef(buffer, offset + 148, "Ending sound", "WAV")); list.add(new Unknown(buffer, offset + 156, 336)); return offset + 492; diff --git a/infinity/resource/spl/Ability.java b/infinity/resource/spl/Ability.java index 5a4519b..02307a6 100644 --- a/infinity/resource/spl/Ability.java +++ b/infinity/resource/spl/Ability.java @@ -68,8 +68,15 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new Unknown(buffer, offset + 36, 2)); if (ResourceFactory.getInstance().resourceExists("PROJECTL.IDS")) list.add(new ProRef(buffer, offset + 38, "Projectile")); + else if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) + list.add(new Bitmap(buffer, offset + 38, 2, "Projectile", s_proj_pst)); + else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND || + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOW || + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOWTOT || + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) + list.add(new Bitmap(buffer, offset + 38, 2, "Projectile", s_proj_iwd)); else - list.add(new DecNumber(buffer, offset + 38, 2, "Projectile")); + list.add(new Bitmap(buffer, offset + 38, 2, "Projectile", s_projectile)); return offset + 40; } } diff --git a/infinity/resource/spl/SplResource.java b/infinity/resource/spl/SplResource.java index 3ec725e..a236a4b 100644 --- a/infinity/resource/spl/SplResource.java +++ b/infinity/resource/spl/SplResource.java @@ -23,15 +23,17 @@ public final class SplResource extends AbstractStruct implements Resource, HasAd "Necromancer", "Transmuter", "Generalist"}; // private static final LongIntegerHashMap m_wizardtype = new LongIntegerHashMap(); private static final LongIntegerHashMap m_priesttype = new LongIntegerHashMap(); - private static final String[] s_spelltype = {"Special", "Wizard", "Priest", "Psionic", "Innate"}; - private static final String[] s_anim = {"None", "None", "None", "None", "None", "None", "None", "None", "None", - "Necromancy", "Alteration", "Enchantment", - "Abjuration", "Illusion", "Conjuration", - "Invocation", "Divination", "Blue sparks", "Black sparks", "Blue sparks", - "Gold sparks", "Green sparks", "Magenta sparks", "Purple sparks", "Red sparks", - "White sparks", "Blue sparks", "Black sparks", "Blue sparks", "Gold sparks", - "Green sparks", "Magenta sparks", "Purple sparks", "Red sparks", - "White sparks"}; + private static final String[] s_spelltype = {"Special", "Wizard", "Priest", "Psionic", "Innate", "Bard song"}; + private static final String[] s_anim = {"None", "Fire aqua", "Fire blue", "Fire gold", "Fire green", + "Fire magenta", "Fire purple", "Fire red", "Fire white", + "Necromancy", "Alteration", "Enchantment", "Abjuration", + "Illusion", "Conjuration", "Invocation", "Divination", + "Fountain aqua", "Fountain black", "Fountain blue", "Fountain gold", + "Fountain green", "Fountain magenta", "Fountain purple", + "Fountain red", "Fountain white", "Swirl aqua", "Swirl black", + "Swirl blue", "Swirl gold", "Swirl green", + "Swirl magenta", "Swirl purple", "Swirl red", + "Swirl white"}; private static final String[] s_spellflag = {"No flags set", "", "", "", "", "", "", "", "", "", "", "Hostile", "No LOS required", "", "Outdoors only", @@ -223,7 +225,7 @@ protected int read(byte buffer[], int offset) throws Exception if (version.toString().equalsIgnoreCase("V2.0")) { list.add(new DecNumber(buffer, offset + 114, 1, "Spell duration rounds/level")); - list.add(new DecNumber(buffer, offset + 115, 1, "Spell duration bonus")); + list.add(new DecNumber(buffer, offset + 115, 1, "Spell duration rounds base")); list.add(new Unknown(buffer, offset + 116, 14)); } diff --git a/infinity/resource/sto/StoResource.java b/infinity/resource/sto/StoResource.java index 2a33def..d7c2256 100644 --- a/infinity/resource/sto/StoResource.java +++ b/infinity/resource/sto/StoResource.java @@ -12,19 +12,16 @@ public final class StoResource extends AbstractStruct implements Resource, HasAddRemovable, HasDetailViewer { - private static final String[] s_type = {"Store", "Tavern", "Inn", "Temple"}; +// private static final String[] s_type = {"Store", "Tavern", "Inn", "Temple"}; private static final String[] s_type9 = {"Store", "Tavern", "Inn", "Temple", "Container"}; private static final String[] s_type_bg2 = {"Store", "Tavern", "Inn", "Temple", "", "Container"}; - private static final String[] s_flag = {"Can only rest", "Can buy", "Can sell", "Can identify", - "Can steal", "Can buy cures", "Can donate", "Can buy drinks", - "", "", "Tavern quality 1", "Tavern quality 2", "Tavern quality 3"}; - private static final String[] s_flag9 = {"Can only rest", "Can buy", "Can sell", "Can identify", - "Can steal", "Can donate", "Can buy cures", "Can buy drinks", - "", "", "Tavern quality 1", "Tavern quality 2", "Tavern quality 3"}; +// private static final String[] s_flag = {"Can't do anything", "Can buy", "Can sell", "Can identify", +// "Can steal", "Can buy cures", "Can donate", +// "Can buy drinks", "", "", "Quality Bit 0 (BAM)", "Quality Bit 1 (BAM)"}; private static final String[] s_flag_bg2 = {"Can only rest", "Can buy", "Can sell", "Can identify", - "Can steal", "Can buy cures", "Can donate", "Can buy drinks", - "", "", "Tavern quality 1", "Tavern quality 2", - "Tavern quality 3", "Fence"}; + "Can steal", "Can donate", "Can buy cures", + "Can buy drinks", "", "", "Tavern quality 1", "Tavern quality 2", + "", "Fence"}; private static final String[] s_rooms = {"No rooms available", "Peasant", "Merchant", "Noble", "Royal"}; public static String getSearchString(byte buffer[]) @@ -74,18 +71,15 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new StringRef(buffer, offset + 12, "Name")); list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag_bg2)); } - else if (version.toString().equalsIgnoreCase("V9.0")) { - list.add(new Bitmap(buffer, offset + 8, 4, "Type", s_type9)); - list.add(new StringRef(buffer, offset + 12, "Name")); - list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag9)); - } +// else if (version.toString().equalsIgnoreCase("V9.0")) { +// list.add(new Bitmap(buffer, offset + 8, 4, "Type", s_type9)); +// list.add(new StringRef(buffer, offset + 12, "Name")); +// list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag)); +// } else { - list.add(new Bitmap(buffer, offset + 8, 4, "Type", s_type)); + list.add(new Bitmap(buffer, offset + 8, 4, "Type", s_type9)); list.add(new StringRef(buffer, offset + 12, "Name")); - if (version.toString().equalsIgnoreCase("V1.1")) - list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag9)); - else - list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag)); + list.add(new Flag(buffer, offset + 16, 4, "Flags", s_flag_bg2)); } list.add(new DecNumber(buffer, offset + 20, 4, "Sell markup")); list.add(new DecNumber(buffer, offset + 24, 4, "Buy markup")); diff --git a/infinity/util/MassExporter.java b/infinity/util/MassExporter.java index 4fa1b9a..126bd14 100644 --- a/infinity/util/MassExporter.java +++ b/infinity/util/MassExporter.java @@ -204,10 +204,9 @@ private void export(ResourceEntry entry) entry.getExtension().equalsIgnoreCase("DWK") || entry.getExtension().equalsIgnoreCase("PWK") || entry.getExtension().equalsIgnoreCase("NSS") || - entry.getExtension().equalsIgnoreCase("INI") || entry.getExtension().equalsIgnoreCase("TXT") || - entry.getExtension().equalsIgnoreCase("SRC") && - ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) && + (entry.getExtension().equalsIgnoreCase("SRC") && + ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2)) && cbDecrypt.isSelected()) { byte data[] = entry.getResourceData(); if (data[0] == -1) From fdb12c836ad0b525385cf53d26b45b79e7eaf4fa Mon Sep 17 00:00:00 2001 From: Taimon Date: Mon, 5 Jul 2010 10:01:11 +0800 Subject: [PATCH 04/37] devSin merge --- infinity/check/ResourceUseChecker.java | 4 +- infinity/resource/AbstractAbility.java | 4 +- infinity/resource/EffectFactory.java | 1238 ++++++++++++++++------ infinity/resource/are/Actor.java | 12 +- infinity/resource/are/Ambient.java | 2 +- infinity/resource/are/AreResource.java | 13 +- infinity/resource/are/AutomapNote.java | 2 +- infinity/resource/are/Container.java | 4 +- infinity/resource/are/Door.java | 2 +- infinity/resource/are/ITEPoint.java | 5 +- infinity/resource/are/ProTrap.java | 8 +- infinity/resource/are/ViewerActor.java | 2 +- infinity/resource/bcs/Compiler.java | 12 +- infinity/resource/bcs/Decompiler.java | 15 +- infinity/resource/cre/CreResource.java | 134 ++- infinity/resource/cre/Viewer.java | 9 +- infinity/resource/gam/GamResource.java | 6 +- infinity/resource/gam/PartyNPC.java | 90 +- infinity/resource/itm/Ability.java | 2 +- infinity/resource/itm/ItmResource.java | 17 +- infinity/resource/other/ProResource.java | 4 +- infinity/resource/other/VvcResource.java | 47 +- infinity/resource/sto/ItemSale11.java | 4 +- infinity/resource/wmp/AreaEntry.java | 2 +- infinity/resource/wmp/ViewerArea.java | 2 +- infinity/resource/wmp/ViewerMap.java | 2 +- 26 files changed, 1147 insertions(+), 495 deletions(-) diff --git a/infinity/check/ResourceUseChecker.java b/infinity/check/ResourceUseChecker.java index 92a9ce6..7de2a1b 100644 --- a/infinity/check/ResourceUseChecker.java +++ b/infinity/check/ResourceUseChecker.java @@ -30,8 +30,8 @@ public final class ResourceUseChecker implements Runnable, ListSelectionListener private static final String FILETYPES[] = {"2DA", "ARE", "BCS", "BS", "CHR", "CHU", "CRE", "DLG", "EFF", "INI", "ITM", "PRO", "SPL", "STO", "VVC", "WED", "WMP"}; - private static final String CHECKTYPES[] = {"ARE", "BCS", "BMP", "CRE", "DLG", "EFF", "ITM", "SPL", "STO", - "TIS", "WAV", "WED"}; + private static final String CHECKTYPES[] = {"ARE", "BCS", "CRE", "DLG", "EFF", "ITM", "PRO", "SPL", "STO", + "TIS", "VVC", "WAV", "WED"}; private final ChildFrame selectframe = new ChildFrame("Find unused files", true); private final JButton bstart = new JButton("Search", Icons.getIcon("Find16.gif")); private final JButton bcancel = new JButton("Cancel", Icons.getIcon("Delete16.gif")); diff --git a/infinity/resource/AbstractAbility.java b/infinity/resource/AbstractAbility.java index 095400e..a667737 100644 --- a/infinity/resource/AbstractAbility.java +++ b/infinity/resource/AbstractAbility.java @@ -202,7 +202,7 @@ public abstract class AbstractAbility extends AbstractStruct "Acid blob ochre", "Red holy might", "Hit necromancy area", "Hit alteration area", "Hit enchantment area", "Hit abjuration area", "Hit illusion area", "Hit conjuration area", "Hit invocation area", - "Hit divination area", "Litany of curses", "Stories-Bones-Tell", + "Hit divination area", "Litany of curses", "Stories-bones-tell", "Magic missiles 1", "Magic missiles 2", "Magic missiles 3", "Magic missiles 4", "Magic missiles 5", "Magic missiles 6", "Magic missiles 7", "Magic missiles 8", "Magic missiles 9", @@ -218,7 +218,7 @@ public abstract class AbstractAbility extends AbstractStruct "Ignus' fury", "Power word, blind", "Mechanus' cannon", "Celestial host", "Rune of torment", "Blessing", "Curse", "", "Halo of lesser revelation", "Spiritual hammer", "Call lightning", "", "Vampiric touch", "Confusion", - "Power word, kill", "Globe of invulnerability", "Nordom's crossbow bolt", + "Power word, kill", "Globe of invulnerability", "Nordom's crossbow bolts", "Raise dead", "Aura of fear", "Conflagration", "Special trap", "Ignus' fireball", "Tongues of flame 1", "Tongues of flame 2", "Tongues of flame 3", "Tongues of flame 4", "Tongues of flame 5", diff --git a/infinity/resource/EffectFactory.java b/infinity/resource/EffectFactory.java index 9a363f6..373891e 100644 --- a/infinity/resource/EffectFactory.java +++ b/infinity/resource/EffectFactory.java @@ -38,8 +38,8 @@ public final class EffectFactory "Static charge", "Remove paralysis", "Free action", "Miscast magic", "Strength of one", "Champion's strength", "Flame strike", "Raise dead", "Resurrection", "Chaotic commands", "Righteous wrath of the faithful", - "Sunray", "Spike stones", "Dimension door (origin)", - "Dimension door (destination)", "Cone of cold", "Sol's searing orb", + "Sunray", "Spike stones", "Dimension door departure", + "Dimension door arrival", "Cone of cold", "Sol's searing orb", "Hit fire", "Hit cold", "Hit electricity", "Hit acid", "Hit paralysis", "Malavon's rage", "Righteous wrath of the faithful ground", "Belhifet death", "Portal", "Sunscorch", "Blade barrier (front)", @@ -285,7 +285,7 @@ private EffectFactory() "Set color glow pulse", "Constitution bonus", "Cure poison", "Damage", "Kill target", "Defrost", "Dexterity bonus", "Haste", "Current HP bonus", "Maximum HP bonus", "Intelligence bonus", - "Invisibility", "Lore bonus", "Luck bonus", "Reset morale", "Panic", + "Invisibility", "Lore bonus", "Luck bonus", "Morale bonus", "Panic", "Poison", "Remove curse", "Acid resistance bonus", "Cold resistance bonus", "Electricity resistance bonus", "Fire resistance bonus", "Magic damage resistance bonus", @@ -342,37 +342,42 @@ private EffectFactory() "No collision detection", "Hold creature 2", "Move creature", "Set local variable", "Increase spells cast per round", "Increase casting speed factor", "Increase attack speed factor", - "Casting level bonus", "Unknown (C0)", "Invisibility detection", - "Unknown (C2)", "Unknown (C3)", "Unknown (C4)", "Unknown (C5)", - "Unknown (C6)", "Unknown (C7)", "Unknown (C8)", "Unknown (C9)", - "Unknown (CA)", "Unknown (CB)", "Unknown (CC)", "Unknown (CD)", - "Protection from spell", "Unknown (CF)", "Minimum HP", "Unknown (D1)", - "Power word, stun", "Unknown (D3)", "Unknown (D4)", "Unknown (D5)", - "Unknown (D6)", "Unknown (D7)", "Unknown (D8)", "Unknown (D9)", - "Stoneskin effect", "Unknown (DB)", "Unknown (DC)", "Unknown (DD)", - "Unknown (DE)", "Unknown (DF)", "Unknown (E0)", "Unknown (E1)", - "Unknown (E2)", "Unknown (E3)", "Unknown (E4)", "Unknown (E5)", - "Unknown (E6)", "Unknown (E7)", "Creature RGB color fade", - "Show visual effect", "Cold damage on hit", "Unknown (EB)", - "Chill touch", "Double damage to undead", "All saving throws bonus", + "Casting level bonus", "Find familiar", "Invisibility detection", + "Ignore dialogue pause", "Drain HP on death", "Familiar", + "Physical mirror", "Reflect specified effect", "Reflect spell level", + "Spell turning", "Spell deflection", "Reflect spell school", + "Reflect spell type", "Protection from spell school", + "Protection from spell type", "Protection from spell", + "Reflect specified spell", "Minimum HP", "Power word, kill", + "Power word, stun", "Imprisonment", "Freedom", "Maze", "Select spell", + "Play visual effect", "Level drain", "Power word, sleep", + "Stoneskin effect", "Attack roll penalty", + "Remove spell school protections", "Remove spell type protections", + "Teleport field", "Spell school deflection", "Restoration", + "Detect magic", "Spell type deflection", "Spell school turning", + "Spell type turning", "Remove protection by school", + "Remove protection by type", "Time stop", "Creature RGB color fade", + "Show visual effect", "Snilloc's snowball swarm", "Show casting glow", + "Chill touch", "Magical stone", "All saving throws bonus", "Slow poison", "Summon creature 2", "Vampiric touch", - "Show visual overlay", "Animate dead", "Unknown (F4)", "Unknown (F5)", + "Show visual overlay", "Animate dead", "Prayer", "Bad prayer", "Summon creature 3", "Beltyn's burning blood", "Summon shadow", - "Unknown (F9)", "Unknown (FA)", "Lich touch", "Sol's searing orb", + "Recitation", "Bad recitation", "Lich touch", "Sol's searing orb", "Bonus AC vs. weapons", "Dispel specific spell", "Salamander aura", - "Umber hulk gaze", "Unknown (101)", "Unknown (102)", - "Summon creatures with cloud", "Animation removal", - "Immunity to effect and string", "Unknown (106)", "Unknown (107)", - "Static charge", "Cloak of fear", "Movement rate modifier", - "Unknown (10B)", "Eye of the mind", "Eye of the sword", - "Eye of the mage", "Eye of venom", "Eye of the spirit", - "Eye of fortitude", "Eye of stone", "Unknown (113)", "Unknown (114)", - "Unknown (115)", "Unknown (116)", "Unknown (117)", "Unknown (118)", - "Unknown (119)", "Hide hit points", "Float text", - "Double damage vs. undead/outer planar", "Unknown (11D)", - "Ranger tracking", "Unknown (11F)", "Unknown (120)", "Unknown (121)", - "Display spell immunity string", - "Double damage vs. golem/outer planar"}; + "Umber hulk gaze", "Zombie lord aura", + "Immunity to specific resource", "Summon creatures with cloud", + "Hide creature", "Immunity to effect and string", "Pomab images", + "Evil turn undead", "Static charge", "Cloak of fear", + "Movement rate modifier", "Cure confusion", "Eye of the mind", + "Eye of the sword", "Eye of the mage", "Eye of venom", + "Eye of the spirit", "Eye of fortitude", "Eye of stone", + "Remove seven eyes", "Remove effect by type", "Soul eater", + "Shroud of flame", "Animal rage", "Turn undead", "Vitriolic sphere", + "Hide hit points", "Float text", "Mace of disruption", "Force sleep", + "Ranger tracking", "Immunity to sneak attack", "Set status", + "Dragon gem cutscene", "Display spell immunity string", + "Rod of smiting", "Rest", "Beholder dispel magic", "Harpy wail", + "Jackalwere gaze", "Set global variable"}; s_poricon = new String[]{"Charm", "Dire charm", "Rigid thinking", "Confused", "Berserk", "Intoxicated", "Poisoned", "Nauseated", "Blind", "Protection from evil", "Protection from petrification", @@ -565,7 +570,7 @@ private EffectFactory() "Set color glow pulse", "Constitution bonus", "Cure poison", "Damage", "Kill target", "Defrost", "Dexterity bonus", "Haste", "Current HP bonus", "Maximum HP bonus", "Intelligence bonus", - "Invisibility", "Knowledge arcana", "Luck bonus", "Reset morale", + "Invisibility", "Knowledge arcana", "Luck bonus", "Morale bonus", "Panic", "Poison", "Remove curse", "Acid resistance bonus", "Cold resistance bonus", "Electricity resistance bonus", "Fire resistance bonus", "Magic damage resistance bonus", @@ -578,74 +583,84 @@ private EffectFactory() "Base attack bonus", "Slay", "Reverse alignment", "Change alignment", "Dispel effects", "Move silently bonus", "Casting failure", "Alchemy", "Bonus priest spells", "Infravision", "Remove infravision", "Blur", - "Translucency", "Summon creature", "Unsummon creature", "Nondetection", - "Remove nondetection", "Change gender", "Change AI type", - "Attack damage bonus", "Blindness", "Cure blindness", - "Feeblemindedness", "Cure feeblemindedness", "Disease", - "Cure disease", "Deafness", "Cure deafness", "Set AI script", - "Immunity to projectile", "Unknown (54)", "Unknown (55)", + "Translucency", "Summon creature", "Unsummon creature", + "Nondetection", "Remove nondetection", "Change gender", + "Change AI type", "Attack damage bonus", "Blindness", + "Cure blindness", "Feeblemindedness", "Cure feeblemindedness", + "Disease", "Cure disease", "Deafness", "Cure deafness", + "Set AI script", "Immunity to projectile", + "Magical fire resistance bonus", "Magical cold resistance bonus", "Slashing resistance bonus", "Crushing resistance bonus", "Piercing resistance bonus", "Missile resistance bonus", "Open locks bonus", "Find traps bonus", "Pick pockets bonus", "Fatigue bonus", "Intoxication bonus", "Tracking bonus", - "Change level", "Unknown (61)", "Regeneration", "Modify duration", - "Unknown (64)", "Immunity to effect", "Immunity to spell level", - "Change name", "XP bonus", "Remove gold", "Morale break", - "Change portrait", "Reputation bonus", "Paralyze", "Retreat from", - "Create weapon", "Remove item", "Equip weapon", "Dither", - "Unknown (73)", "Detect invisible", "Clairvoyance", "Show creatures", - "Mirror image", "Immunity to weapons", "Unknown (79)", + "Change level", "Exceptional strength bonus", "Regeneration", + "Modify duration", "Protection from creature type", + "Immunity to effect", "Immunity to spell level", "Change name", + "XP bonus", "Remove gold", "Morale break", "Change portrait", + "Reputation bonus", "Paralyze", "Retreat from", "Create weapon", + "Remove item", "Equip weapon", "Dither", "Detect alignment", + "Detect invisible", "Clairvoyance", "Show creatures", "Mirror image", + "Immunity to weapons", "Visual animation effect", "Create inventory item", "Remove inventory item", "Teleport", - "Unlock", "Movement rate bonus", "Unknown (7E)", "Confusion", + "Unlock", "Movement rate bonus", "Summon monsters", "Confusion", "Aid (non-cumulative)", "Bless (non-cumulative)", "Chant (non-cumulative)", "Draw upon holy might (non-cumulative)", "Luck (non-cumulative)", "Petrification", "Polymorph", - "Force visible", "Unknown (89)", "Set animation sequence", - "Display string", "Casting glow", "Visual spell hit", - "Display portrait icon", "Create item in slot", "Disable button", - "Disable spellcasting", "Cast spell", "Learn spell", - "Cast spell at point", "Identify", "Detect traps", "Replace self", - "Play movie", "Sanctuary", "Entangle", "Unknown (9B)", "Unknown (9C)", - "Web effect", "Grease overlay", "Mirror image effect", "Unknown (A0)", - "Remove fear", "Remove paralysis", "Free action", + "Force visible", "Bad chant (non-cumulative)", + "Set animation sequence", "Display string", "Casting glow", + "Lighting effects", "Display portrait icon", "Create item in slot", + "Disable button", "Disable spellcasting", "Cast spell", "Learn spell", + "Cast spell at point", "Identify", "Find traps", "Replace self", + "Play movie", "Sanctuary", "Entangle overlay", "Minor globe overlay", + "Protection from normal missiles overlay", "Web effect", + "Grease overlay", "Mirror image effect", "Remove sanctuary", + "Remove fear", "Remove paralysis", "Reset movement rate", "Remove intoxication", "Pause caster", "Magic resistance bonus", "Missile attack bonus", "Remove creature", "Prevent portrait icon", - "Play damage animation", "Give innate ability", - "Remove innate ability", "Poison resistance bonus", "Play sound", - "Unknown (AF)", "Movement rate bonus 2", "Unknown (B1)", - "Unknown (B2)", "Unknown (B3)", "Unknown (B4)", "Unknown (B5)", - "Unknown (B6)", "Unknown (B7)", "Unknown (B8)", - "Hold creature (forced)", "Unknown (BA)", "Unknown (BB)", - "Aura cleansing", "Mental speed", "Physical speed", - "Casting level bonus", "Unknown (C0)", "Invisibility detection", - "Unknown (C2)", "Unknown (C3)", "Unknown (C4)", "Unknown (C5)", - "Unknown (C6)", "Unknown (C7)", "Unknown (C8)", "Unknown (C9)", - "Unknown (CA)", "Unknown (CB)", "Unknown (CC)", "Unknown (CD)", - "Protection from spell", "Unknown (CF)", "Minimum HP", "Unknown (D1)", - "Unknown (D2)", "Unknown (D3)", "Unknown (D4)", "Unknown (D5)", - "Unknown (D6)", "Unknown (D7)", "Unknown (D8)", "Unknown (D9)", - "Stoneskin effect", "Unknown (DB)", "Unknown (DC)", "Unknown (DD)", - "Unknown (DE)", "Unknown (DF)", "Unknown (E0)", "Unknown (E1)", - "Unknown (E2)", "Unknown (E3)", "Unknown (E4)", "Unknown (E5)", - "Unknown (E6)", "Unknown (E7)", "Color glow dissipate", - "Show visual effect", "Unknown (EA)", "Casting glow", "Panic undead", - "Unknown (ED)", "Saving throw change", "Slow poison", "Unknown (F0)", - "Vampiric touch", "Unknown (F2)", "Unknown (F3)", "Prayer", - "Unknown (F5)", "Unknown (F6)", "Beltyn's burning blood", - "Unknown (F8)", "Recitation", "Unknown (FA)", "Unknown (FB)", - "Unknown (FC)", "Unknown (FD)", "Remove specific effects", - "Salamander aura", "Umber hulk gaze", "Zombie lord aura", - "Unknown (102)", "Unknown (103)", "Hide creature", - "Immunity effect and resource", "Unknown (106)", "Unknown (107)", - "Static charge", "Cloak of fear", "Movement rate", "Remove confusion", - "Eye of the mind", "Eye of the sword", "Eye of the mage", - "Eye of venom", "Eye of the spirit", "Eye of fortitude", - "Eye of stone", "Remove seven eyes", "Remove effects of type", - "Soul eater", "Shroud of flame", "Animal rage", "Turn undead", - "Vitriolic sphere", "Suppress HP info", "Float text", - "Mace of disruption", "Sleep", "Tracking", "Sneak attack immunity", - "Set state", "Unknown (121)", "Display spell immunity string", - "Unknown (123)", "Rest", "Beholder dispel magic", "Harpy wail", + "Play damage animation", "Give innate ability", "Remove spell", + "Poison resistance bonus", "Play sound", "Hold creature", + "Movement rate penalty", "Use EFF file", "THAC0 vs. type bonus", + "Damage vs. type bonus", "Disallow item", "Disallow item type", + "Apply effect on equip item", "Apply effect on equip type", + "No collision detection", "Hold creature 2", "Move creature", + "Set local variable", "Increase spells cast per round", + "Increase casting speed factor", "Increase attack speed factor", + "Casting level bonus", "Find familiar", "Invisibility detection", + "Ignore dialogue pause", "Drain HP on death", "Familiar", + "Physical mirror", "Reflect specified effect", "Reflect spell level", + "Spell turning", "Spell deflection", "Reflect spell school", + "Reflect spell type", "Protection from spell school", + "Protection from spell type", "Protection from spell", + "Reflect specified spell", "Minimum HP", "Power word, kill", + "Power word, stun", "Imprisonment", "Freedom", "Maze", "Select spell", + "Play visual effect", "Level drain", "Power word, sleep", + "Stoneskin effect", "Attack roll penalty", + "Remove spell school protections", "Remove spell type protections", + "Teleport field", "Spell school deflection", "Cure level drain", + "Detect magic", "Spell type deflection", "Spell school turning", + "Spell type turning", "Remove protection by school", + "Remove protection by type", "Time stop", "Creature RGB color fade", + "Show visual effect", "Snilloc's snowball swarm", "Show casting glow", + "Chill touch", "Magical stone", "All saving throws bonus", + "Slow poison", "Summon creature 2", "Vampiric touch", + "Show visual overlay", "Animate dead", "Prayer", "Bad prayer", + "Summon creature 3", "Beltyn's burning blood", "Summon shadow", + "Recitation", "Bad recitation", "Lich touch", "Sol's searing orb", + "Bonus AC vs. weapons", "Dispel specific spell", "Salamander aura", + "Umber hulk gaze", "Zombie lord aura", + "Immunity to specific resource", "Summon creatures with cloud", + "Hide creature", "Immunity to effect and resource", "Pomab images", + "Evil turn undead", "Static charge", "Cloak of fear", + "Movement rate modifier", "Cure confusion", "Eye of the mind", + "Eye of the sword", "Eye of the mage", "Eye of venom", + "Eye of the spirit", "Eye of fortitude", "Eye of stone", + "Remove seven eyes", "Remove effect by type", "Soul eater", + "Shroud of flame", "Animal rage", "Turn undead", "Vitriolic sphere", + "Hide hit points", "Float text", "Mace of disruption", "Force sleep", + "Ranger tracking", "Immunity to sneak attack", "Set status", + "Dragon gem cutscene", "Display spell immunity string", + "Rod of smiting", "Rest", "Beholder dispel magic", "Harpy wail", "Jackalwere gaze", "Set global variable", "Hide in shadows bonus", "Use magic device bonus", "Unknown (12B)", "Unknown (12C)", "Unknown (12D)", "Unknown (12E)", "Unknown (12F)", "Unknown (130)", @@ -673,39 +688,38 @@ private EffectFactory() "Unknown (185)", "Unknown (186)", "Unknown (187)", "Unknown (188)", "Unknown (189)", "Unknown (18A)", "Unknown (18B)", "Unknown (18C)", "Unknown (18D)", "Unknown (18E)", "Unknown (18F)", "Hopelessness", - "Protection from evil", "Add effects list", "Armor of faith", + "Protection from evil", "Apply effects list", "Armor of faith", "Nausea", "Enfeeblement", "Fire shield", "Death ward", "Holy power", - "Righteous wrath of the faithful", "Summon (as ally)", - "Summon (as enemy)", "Control", "Visual effect", + "Righteous wrath of the faithful", "Summon friendly creature", + "Summon hostile creature", "Control creature", "Run visual effect", "Otiluke's resilient sphere", "Barkskin", "Bleeding wounds", - "Area effect using effects list", "Free action", - "Knocked unconscious", "Death magic", "Entropy shield", "Storm shell", + "Area effect using effects list", "Free action", "Unconsciousness", + "Death magic", "Entropy shield", "Storm shell", "Protection from the elements", "Hold undead", "Control undead", - "Aegis", "Executioner's eyes", "Banish", - "When struck using effects list", + "Aegis", "Executioner's eyes", "Banish", "Apply effects list on hit", "Projectile type using effects list", "Energy drain", - "Tortoise shell", "Blink", "Persistant using effects list", + "Tortoise shell", "Blink", "Persistent using effects list", "Day blindness", "Damage reduction", "Disguise", "Heroic inspiration", - "Prevent AI slowdown", "Barbarian rage", "Slowed", "Cleave", + "Prevent AI slowdown", "Barbarian rage", "Force slow", "Cleave", "Protection from arrows", "Tenser's transformation", "Unknown (1BD)", - "Smite evil", "Restoration", "Alicorn lance glow", "Call lightning", + "Smite evil", "Restoration", "Alicorn lance", "Call lightning", "Globe of invulnerability", "Lower resistance", "Bane", "Power attack", "Expertise", "Arterial strike", "Hamstring", - "Rapdid shot", "Unknown (1CA)", "Unknown (1CB)"}; + "Rapid shot", "Unknown (1CA)", "Unknown (1CB)"}; s_poricon = new String[]{"Charmed", "", "", "Confused", "Berserk", "Intoxicated", "Poisoned", "Diseased", "Blind", "Protection from evil", "Protection from petrification", "Protection from normal missiles", "Armor", "Held", "Asleep", "Shield", "Protection from fire", "Bless", "Chant", "Free action", "Barkskin", "Strength", "Heroism", "Spell invulnerability", - "Protection from acid", "Protection from cold", + "Protection from acid", "Protection from cold", "", "Protection from electricity", "Protection from magic", "Protection from undead", "Protection from poison", "Undetectable", "Good luck", "Bad luck", "Silenced", "Cursed", "Panic", "Resist fear", "Hasted", "Fatigued", "Bard song", "Slowed", "Regenerating", "Nauseous", "Stunned", "Ghost armor", "Stoneskin", "Hopelessness", "Courage", "Friends", "Hope", "Malison", "Spirit armor", "Dominated", - "Feeblemind", "Tenser's transformation", "Mind blank", "Aid", + "Feebleminded", "Tenser's transformation", "Mind blank", "Aid", "Find traps", "Draw upon holy might", "Miscast magic", "Strength of one", "Prayer", "Defensive harmony", "Recitation", "Champion's strength", "Chaotic commands", @@ -720,12 +734,12 @@ private EffectFactory() "Protection from the elements", "Grease", "Web", "Minor globe of invulnerability", "Globe of invulnerability", "Shroud of flame", "Antimagic shell", "Otiluke's resilient sphere", - "Intelligence drained", "Cloak of fear", "Entrophy shield", + "Intelligence drained", "Cloak of fear", "Entropy shield", "Insect plague", "Storm shell", "Shield of lathander", "Greater shield of lathander", "Seven eyes", "Blur", "Invisibility", "Barbarian rage", "Called shot", "Defensive spin", "Maximized attacks", "Offensive spin", "Envenom weapon", - "Unconscious 2", "Doom", "Aegis", "Executioner's eyes", + "Unconscious", "Doom", "Aegis", "Executioner's eyes", "Fire shield (red)", "Fire shield (blue)", "Energy drained", "Faerie fire", "Tortoise shell", "Spell shield", "Negative energy protection", "Aura of vitality", "Death armor", @@ -756,17 +770,6 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i // Infinity Engine Effects // ----------------------- switch (effectType) { - case 0x1: // Modify attacks per round (CGameEffectAttackNo) - s.add(new Bitmap(buffer, offset, 4, "Value", - new String[]{"0 attacks per round", "1 attack per round", - "2 attacks per round", "3 attacks per round", - "4 attacks per round", "5 attacks per round", - "1 attack per 2 rounds", "3 attacks per 2 rounds", - "5 attacks per 2 rounds", "7 attacks per 2 rounds", - "9 attacks per 2 rounds"})); - s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); - break; - case 0x5: // Charm creature (CGameEffectCharm) s.add(new IdsBitmap(buffer, offset, 4, "Creature type", "GENERAL.IDS")); s.add(new Flag(buffer, offset + 4, 4, "Charm flags", @@ -776,10 +779,7 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i case 0x6: // Charisma bonus (CGameEffectCHR) case 0xA: // Constitution bonus (CGameEffectCON) - case 0xF: // Dexterity bonus (CGameEffectDEX) case 0x13: // Intelligence bonus (CGameEffectINT) - case 0x15: // Lore bonus (CGameEffectLore) / Knowledge arcana - case 0x16: // Luck bonus (CGameEffectLuck) case 0x1B: // Acid resistance bonus (CGameEffectResistAcid) case 0x1C: // Cold resistance bonus (CGameEffectResistCold) case 0x1D: // Electricity resistance bonus (CGameEffectResistElectricity) @@ -790,11 +790,9 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i case 0x23: // Save vs. polymorph bonus (CGameEffectSaveVsPoly) / Will save bonus case 0x24: // Save vs. breath bonus (CGameEffectSaveVsBreath) case 0x25: // Save vs. spell bonus (CGameEffectSaveVsSpell) - case 0x2C: // Strength bonus (CGameEffectSTR) case 0x31: // Wisdom bonus (CGameEffectWIS) case 0x36: // Base THAC0 bonus (CGameEffectThac0) / Base attack bonus case 0x3B: // Stealth bonus / Move silently bonus (CGameEffectSkillStealth) - case 0x49: // Attack damage bonus (CGameEffectDamageMod) case 0x54: // Magical fire resistance bonus (CGameEffectResistMagicFire) case 0x55: // Magical cold resistance bonus (CGameEffectResistMagicCold) case 0x56: // Slashing resistance bonus (CGameEffectResistSlashing) @@ -815,7 +813,7 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i case 0x6C: // Reputation bonus (CGameEffectReputation) case 0x7E: // Movement rate bonus (CGameEffectMovementRate) case 0xA7: // Missile THAC0 bonus (CGameEffectMissileTHAC0Bonus) / Missile attack bonus - case 0xB0: // Movement rate bonus 2 (CGameEffectMovementRate) + case 0xB0: // Movement rate bonus 2 (CGameEffectMovementRate) / Movement rate penalty s.add(new DecNumber(buffer, offset, 4, "Value")); s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); break; @@ -842,13 +840,6 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i s.add(new DecNumber(buffer, offset + 6, 2, "Cycle speed")); break; - case 0xC: // Damage (CGameEffectDamage) - s.add(new DecNumber(buffer, offset, 4, "Amount")); - s.add(new Bitmap(buffer, offset + 4, 2, "Mode", - new String[]{"Normal", "Set to value", "Set to %", "Percentage"})); - s.add(new IdsBitmap(buffer, offset + 6, 2, "Damage type", "DAMAGES.IDS")); - break; - case 0xD: // Kill target (CGameEffectDeath) s.add(new Bitmap(buffer, offset, 4, "Display text?", s_yesno)); s.add(new Flag(buffer, offset + 4, 4, "Death type", @@ -863,15 +854,6 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i new String[]{"Normal", "Improved", "Movement rate only"})); break; - case 0x11: // Current HP bonus (CGameEffectHeal) - s.add(new DecNumber(buffer, offset, 4, "Value")); - s.add(new Bitmap(buffer, offset + 4, 2, "Modifier type", - new String[]{"Increment", "Set", "Increment % of"})); - s.add(new Flag(buffer, offset + 6, 2, "Heal flags", - new String[]{"No flags set", "Raise dead", - "Remove limited effects"})); - break; - case 0x12: // Maximum HP bonus (CGameEffectHitPoints) s.add(new DecNumber(buffer, offset, 4, "Value")); s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", @@ -887,13 +869,10 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i new String[]{"Normal", "Improved"})); break; - case 0x19: // Poison (CGameEffectPoison) - s.add(new DecNumber(buffer, offset, 4, "Amount")); - s.add(new Bitmap(buffer, offset + 4, 4, "Poison type", - new String[]{"1 damage per second", "1 damage per second", - "Amount damage per second", - "1 damage per amount seconds", - "Variable per amount seconds"})); + case 0x15: // Lore bonus (CGameEffectLore) / Knowledge arcana + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", + new String[]{"Increment", "Set", "Mastery"})); break; case 0x29: // Sparkle (CGameEffectSparkle) @@ -945,7 +924,7 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i case 0xAF: // Hold creature (CGameEffectHoldCreatureSpell) case 0xB2: // THAC0 vs. type bonus (CGameEffectSelectiveToHitBonus) case 0xB3: // Damage vs. type bonus (CGameEffectSelectiveDamageBonus) - case 0xB9: // Hold creature 2 (CGameEffectHoldCreatureSpell) / Hold creature (forced) + case 0xB9: // Hold creature 2 (CGameEffectHoldCreatureSpell) s.add(new IDSTargetEffect(buffer, offset)); break; @@ -964,13 +943,6 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i "Use specific level"})); break; - case 0x3C: // Casting failure (CGameEffectCastingFailure) - s.add(new DecNumber(buffer, offset, 4, "Amount")); - s.add(new Bitmap(buffer, offset + 4, 4, "Failure type", - new String[]{"Wizard", "Priest", "Innate", "Wizard (dead magic)", - "Priest (dead magic)", "Innate (dead magic)"})); - break; - case 0x3E: // Bonus priest spells (CGameEffectSpellMemorizationCleric) s.add(new DecNumber(buffer, offset, 4, "# spells to add")); s.add(new Flag(buffer, offset + 4, 4, "Spell levels", @@ -978,28 +950,6 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i "Level 4", "Level 5", "Level 6", "Level 7"})); break; - case 0x42: // Translucency (CGameEffectTranslucent) - s.add(new DecNumber(buffer, offset, 4, "Fade amount")); - s.add(new Unknown(buffer, offset + 4, 4)); - break; - - case 0x43: // Summon creature (CGameEffectSummon) - if (gameid == ResourceFactory.ID_ICEWIND || - gameid == ResourceFactory.ID_ICEWINDHOW || - gameid == ResourceFactory.ID_ICEWINDHOWTOT) - s.add(new Bitmap(buffer, offset, 4, "Animation", - new String[]{"No animation", "Monster summoning circle", - "Animal summoning circle", "Earth summoning circle", - "Fire summoning circle", "Water summoning circle", "", - "Puff of smoke"})); - else - s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Allegiance", - new String[]{"Match target", "Match target", "From CRE file", - "Match target", "From CRE file", "Hostile"})); - restype = "CRE"; - break; - case 0x44: // Unsummon creature (CGameEffectUnsummon) s.add(new Bitmap(buffer, offset, 4, "Display text?", s_noyes)); s.add(new Unknown(buffer, offset + 4, 4)); @@ -1013,19 +963,9 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i case 0x48: // Change AI type (CGameEffectAIChange) s.add(new DecNumber(buffer, offset, 4, "Value")); - s.add(new Bitmap(buffer, offset + 4, 4, "From IDS file", - new String[]{"EA.IDS", "GENERAL.IDS", "RACE.IDS", "CLASS.IDS", - "SPECIFIC.IDS", "GENDER.IDS", "ALIGN.IDS"})); - break; - - case 0x4E: // Disease (CGameEffectDisease) - s.add(new DecNumber(buffer, offset, 4, "Amount")); - s.add(new Bitmap(buffer, offset + 4, 4, "Disease type", - new String[]{"1 damage per second", "1 damage per second", - "Amount damage per second", - "1 damage per amount seconds", "Strength", "Dexterity", - "Constitution", "Intelligence", "Wisdom", "Charisma", - "Slow target"})); + s.add(new Bitmap(buffer, offset + 4, 4, "AI type", + new String[]{"Allegiance", "General", "Race", "Class", "Specifics", + "Gender", "Alignment"})); break; case 0x52: // Set AI script (CGameEffectSetAIScript) @@ -1042,14 +982,6 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i s.add(new DecNumber(buffer, offset + 4, 4, "Projectile")); break; - case 0x62: // Regeneration (CGameEffectRegeneration) - s.add(new DecNumber(buffer, offset, 4, "Value")); - s.add(new Bitmap(buffer, offset + 4, 4, "Regeneration type", - new String[]{"1 HP per second", "1 HP per second", - "Amount HP per second", "1 HP per amount seconds", - "Variable per amount seconds"})); - break; - case 0x63: // Modify duration (CGameEffectDurationCasting) s.add(new DecNumber(buffer, offset, 4, "Percentage")); s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", @@ -1100,8 +1032,9 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i s.add(new DecNumber(buffer, offset, 4, "Maximum enchantment")); s.add(new Bitmap(buffer, offset + 4, 4, "Weapon type", new String[]{"Enchanted", "Magical", "Non-magical", "Silver", - "Non-silver", "Non-silver", "Two-handed", "One-handed", - "Cursed", "Non-cursed", "Gold", "Non-gold"})); + "Non-silver", "Non-silver, non-magical", "Two-handed", + "One-handed", "Cursed", "Non-cursed", "Cold iron", + "Non-cold-iron"})); break; case 0x7F: // Summon monsters (CGameEffectRandomSummon) @@ -1120,7 +1053,6 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i break; case 0x82: // Bless (non-cumulative) (CGameEffectNon_CumulativeBless) - case 0x83: // Chant (non-cumulative) (CGameEffectNon_CumulativeChant) case 0x84: // Draw upon holy might (non-cumulative) (CGameEffectNon_CumulativeDrawUponHolyMight) case 0x85: // Luck (non-cumulative) (CGameEffectNon_CumulativeLuck) case 0x89: // Bad chant (non-cumulative) (CGameEffectNon_CumulativeChantBad) @@ -1207,12 +1139,6 @@ else if (ResourceFactory.getInstance().resourceExists("SEQ.IDS")) restype = "ITM"; break; - case 0x91: // Disable spellcasting (CGameEffectDisableSpellType) - s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", - new String[]{"Wizard", "Priest", "Innate"})); - break; - case 0x92: // Cast spell (CGameEffectCastSpell) case 0x94: // Cast spell at point (CGameEffectCastSpellPoint) s.add(new DecNumber(buffer, offset, 4, "Cast at level")); @@ -1288,11 +1214,104 @@ else if (ResourceFactory.getInstance().resourceExists("SEQ.IDS")) s.add(new Flag(buffer, offset + 4, 4, "Bonus to", s_actype)); break; + case 0x1: // Modify attacks per round (CGameEffectAttackNo) + s.add(new Bitmap(buffer, offset, 4, "Value", + new String[]{"0 attacks per round", "1 attack per round", + "2 attacks per round", "3 attacks per round", + "4 attacks per round", "5 attacks per round", + "1 attack per 2 rounds", "3 attacks per 2 rounds", + "5 attacks per 2 rounds", "7 attacks per 2 rounds", + "9 attacks per 2 rounds"})); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); + break; + + case 0xC: // Damage (CGameEffectDamage) + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 2, "Mode", + new String[]{"Normal", "Set to value", "Set to %"})); + s.add(new IdsBitmap(buffer, offset + 6, 2, "Damage type", "DAMAGES.IDS")); + break; + + case 0xF: // Dexterity bonus (CGameEffectDEX) + case 0x16: // Luck bonus (CGameEffectLuck) + case 0x2C: // Strength bonus (CGameEffectSTR) + case 0x49: // Attack damage bonus (CGameEffectDamageMod) + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); + break; + + case 0x11: // Current HP bonus (CGameEffectHeal) + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 2, "Modifier type", + new String[]{"Increment", "Set", "Increment % of"})); + s.add(new Flag(buffer, offset + 6, 2, "Heal flags", + new String[]{"No flags set", "Raise dead"})); + break; + + case 0x19: // Poison (CGameEffectPoison) + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Poison type", + new String[]{"1 damage per second", "1 damage per second", + "Amount damage per second", + "1 damage per amount seconds", + "Variable per amount seconds"})); + break; + + case 0x3C: // Casting failure (CGameEffectCastingFailure) + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Failure type", + new String[]{"Wizard", "Priest", "Innate"})); + break; + + case 0x42: // Translucency (CGameEffectTranslucent) + s.add(new DecNumber(buffer, offset, 4, "Fade amount")); + s.add(new Unknown(buffer, offset + 4, 4)); + break; + + case 0x43: // Summon creature (CGameEffectSummon) + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Allegiance", + new String[]{"Match target", "Match target", "From CRE file", + "Match target", "From CRE file", "Hostile"})); + restype = "CRE"; + break; + + case 0x4E: // Disease (CGameEffectDisease) + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Disease type", + new String[]{"1 damage per second", "1 damage per second", + "Amount damage per second", + "1 damage per amount seconds", "Strength", "Dexterity", + "Constitution", "Intelligence", "Wisdom", "Charisma", + "Slow target"})); + break; + + case 0x62: // Regeneration (CGameEffectRegeneration) + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Regeneration type", + new String[]{"1 HP per second", "1 HP per second", + "Amount HP per second", "1 HP per amount seconds", + "Variable per amount seconds"})); + break; + + case 0x83: // Chant (non-cumulative) (CGameEffectNon_CumulativeChant) + case 0xBD: // Increase casting speed factor (CGameEffectMentalSpeed) + case 0xBE: // Increase attack speed factor (CGameEffectPhysicalSpeed) + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Unknown(buffer, offset + 4, 4)); + break; + case 0x90: // Disable button (CGameEffectDisableButton) s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Button", s_button)); break; + case 0x91: // Disable spellcasting (CGameEffectDisableSpellType) + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", + new String[]{"Wizard", "Priest", "Innate"})); + break; + case 0xBA: // Move creature (CGameEffectJumpToArea) s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Orientation", Actor.s_orientation)); @@ -1310,12 +1329,6 @@ else if (ResourceFactory.getInstance().resourceExists("SEQ.IDS")) s.add(new Bitmap(buffer, offset + 4, 4, "Cleanse aura?", s_noyes)); break; - case 0xBD: // Increase casting speed factor (CGameEffectMentalSpeed) - case 0xBE: // Increase attack speed factor (CGameEffectPhysicalSpeed) - s.add(new DecNumber(buffer, offset, 4, "Amount")); - s.add(new Unknown(buffer, offset + 4, 4)); - break; - case 0xBF: // Casting level bonus (CGameEffectCastingLevelBonus) s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", @@ -1334,14 +1347,107 @@ else if (gameid == ResourceFactory.ID_TORMENT) { s.add(new Flag(buffer, offset + 4, 4, "Bonus to", s_actype)); break; + case 0x1: // Modify attacks per round + s.add(new Bitmap(buffer, offset, 4, "Value", + new String[]{"0 attacks per round", "1 attack per round", + "2 attacks per round", "3 attacks per round", + "4 attacks per round", "5 attacks per round", + "1 attack per 2 rounds", "3 attacks per 2 rounds", + "5 attacks per 2 rounds", "7 attacks per 2 rounds", + "9 attacks per 2 rounds"})); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); + break; + + case 0xC: // Damage + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 2, "Mode", + new String[]{"Normal", "Set to value", "Set to %"})); + s.add(new IdsBitmap(buffer, offset + 6, 2, "Damage type", "DAMAGES.IDS")); + break; + + case 0xF: // Dexterity bonus + case 0x16: // Luck bonus + case 0x2C: // Strength bonus + case 0x49: // Attack damage bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); + break; + + case 0x11: // Current HP bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 2, "Modifier type", + new String[]{"Increment", "Set", "Increment % of"})); + s.add(new Flag(buffer, offset + 6, 2, "Heal flags", + new String[]{"No flags set", "Raise dead"})); + break; + + case 0x19: // Poison + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Poison type", + new String[]{"1 damage per second", "1 damage per second", + "Amount damage per second", + "1 damage per amount seconds", + "Variable per amount seconds"})); + break; + + case 0x3C: // Casting failure + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Failure type", + new String[]{"Wizard", "Priest", "Innate"})); + break; + + case 0x42: // Translucency + s.add(new DecNumber(buffer, offset, 4, "Fade amount")); + s.add(new Unknown(buffer, offset + 4, 4)); + break; + + case 0x43: // Summon creature + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Allegiance", + new String[]{"Match target", "Match target", "From CRE file", + "Match target", "From CRE file", "Hostile"})); + restype = "CRE"; + break; + + case 0x4E: // Disease + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Disease type", + new String[]{"1 damage per second", "1 damage per second", + "Amount damage per second", + "1 damage per amount seconds", "Strength", "Dexterity", + "Constitution", "Intelligence", "Wisdom", "Charisma", + "Slow target"})); + break; + + case 0x62: // Regeneration + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Regeneration type", + new String[]{"1 HP per second", "1 HP per second", + "Amount HP per second", "1 HP per amount seconds", + "Variable per amount seconds"})); + break; + + case 0x83: // Chant (non-cumulative) + case 0xCB: // Curse + case 0xCC: // Prayer + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Unknown(buffer, offset + 4, 4)); + break; + case 0x90: // Disable button s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Button", s_button)); break; + case 0x91: // Disable spellcasting + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", + new String[]{"Wizard", "Priest", "Innate"})); + break; + case 0xBA: // Set status s.add(new Unknown(buffer, offset, 4)); - s.add(new IdsFlag(buffer, offset + 4, 4, "Status", "STATE.IDS")); + s.add(new IdsFlag(buffer, offset + 4, 4, "State", "STATE.IDS")); break; case 0xBB: // Play BAM file (single/dual) @@ -1375,8 +1481,8 @@ else if (gameid == ResourceFactory.ID_TORMENT) { case 0xC0: // Hit point transfer s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Bitmap(buffer, offset + 4, 2, "Direction", - new String[]{"Caster to target", "Target to caster", "Swap HP", - "Caster to target 2"})); + new String[]{"Source to target", "Target to source", "Swap HP", + "Caster to target"})); s.add(new IdsBitmap(buffer, offset + 6, 2, "Damage type", "DAMAGES.IDS")); break; @@ -1425,12 +1531,6 @@ else if (gameid == ResourceFactory.ID_TORMENT) { restype = "BAM"; break; - case 0xCB: // Curse - case 0xCC: // Prayer - s.add(new DecNumber(buffer, offset, 4, "Amount")); - s.add(new Unknown(buffer, offset + 4, 4)); - break; - case 0xCD: // Move view to target s.add(new DecNumber(buffer, offset, 4, "Speed")); s.add(new Unknown(buffer, offset + 4, 4)); @@ -1456,14 +1556,146 @@ else if (gameid == ResourceFactory.ID_ICEWIND || s.add(new Flag(buffer, offset + 4, 4, "Bonus to", s_actype)); break; + case 0x1: // Modify attacks per round + case 0x16: // Luck bonus + case 0x17: // Morale bonus + case 0xEE: // All saving throws bonus + case 0x10A: // Movement rate modifier + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); + break; + + case 0x3: // Berserk + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Berserk type", + new String[]{"Normal", "Blood rage"})); + break; + + case 0xC: // Damage + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 2, "Mode", + new String[]{"Normal", "Set to value", "Set to %", "Percentage"})); + s.add(new IdsBitmap(buffer, offset + 6, 2, "Damage type", "DAMAGES.IDS")); + break; + + case 0xF: // Dexterity bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", + new String[]{"Increment", "Set", "Set % of", "Cat's grace"})); + break; + + case 0x11: // Current HP bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 2, "Modifier type", + new String[]{"Increment", "Set", "Increment % of"})); + s.add(new Flag(buffer, offset + 6, 2, "Heal flags", + new String[]{"No flags set", "Raise dead"})); + break; + + case 0x19: // Poison + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Poison type", + new String[]{"1 damage per second", "1 damage per second", + "Amount damage per second", + "1 damage per amount seconds", + "Variable per amount seconds"})); + break; + + case 0x2C: // Strength bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", + new String[]{"Increment", "Set", "Set % of", "Wizard strength"})); + break; + + case 0x27: // Sleep + case 0x11D: // Force sleep + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Wake on damage?", s_yesno)); + break; + + case 0x3C: // Casting failure + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Failure type", + new String[]{"Wizard", "Priest", "Innate"})); + break; + + case 0x42: // Translucency + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Visual effect", + new String[]{"Draw instantly", "Fade in", "Fade out"})); + break; + + case 0x43: // Summon creature + s.add(new DecNumber(buffer, offset, 4, "# creatures")); + s.add(new Bitmap(buffer, offset + 4, 4, "Summon animation", + new String[]{"No animation", "Monster summoning circle", + "Animal summoning circle", "Earth summoning circle", + "Fire summoning circle", "Water summoning circle", "", + "Puff of smoke"})); + restype = "CRE"; + break; + + case 0x49: // Attack damage bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", + new String[]{"Increment", "Fire damage", "Cold damage", + "Electricity damage", "Acid damage", "Magic damage", + "Poison damage", "Slashing damage", "Piercing damage", + "Crushing damage", "Missile damage"})); + break; + + case 0x4E: // Disease + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Disease type", + new String[]{"1 damage per second", "Amount damage per round", + "Amount damage per second", + "1 damage per amount seconds", "Strength", "Dexterity", + "Constitution", "Intelligence", "Wisdom", "Charisma", + "Slow target", "Mold touch"})); + break; + + case 0x62: // Regeneration + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Regeneration type", + new String[]{"1 HP per second", "1 HP per second", + "Amount HP per second", "1 HP per amount seconds", + "Amount HP per round"})); + break; + + case 0x77: // Mirror image + s.add(new DecNumber(buffer, offset, 4, "# images")); + s.add(new Unknown(buffer, offset + 4, 4)); + break; + + case 0x7C: // Teleport + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Behavior", + new String[]{"Normal", "Source to target", "Return to start", + "Exchange with target"})); + break; + + case 0x83: // Chant (non-cumulative) + case 0xF4: // Prayer + case 0xF9: // Recitation + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Prayer type", + new String[]{"Beneficial", "Detrimental"})); + break; + case 0x90: // Disable button s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Button", s_button)); break; + case 0x91: // Disable spellcasting + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", + new String[]{"Wizard", "Priest", "Innate"})); + break; + case 0xBA: // Move creature s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Orientation", Actor.s_orientation)); + s.add(new IdsBitmap(buffer, offset + 4, 4, "Orientation", "DIR.IDS")); restype = "ARE"; break; @@ -1480,13 +1712,19 @@ else if (gameid == ResourceFactory.ID_ICEWIND || case 0xBD: // Increase casting speed factor case 0xBE: // Increase attack speed factor + case 0xEA: // Snilloc's snowball swarm + case 0xED: // Magical stone + case 0xEF: // Slow poison + case 0xF5: // Bad prayer + case 0xFA: // Bad recitation + case 0xFC: // Sol's searing orb s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Unknown(buffer, offset + 4, 4)); break; case 0xCE: // Protection from spell case 0x122: // Display spell immunity string - final String s_cretype[] = {"Default", "Undead", "Not undead", + final String s_cretype[] = {"Anyone", "Undead", "Not undead", "Fire-dwelling", "Not fire-dwelling", "Humanoid", "Not humanoid", "Animal", "Not animal", "Elemental", "Not elemental", "Fungus", "Not fungus", "Huge creature", "Not huge creature", "Elf", @@ -1540,14 +1778,16 @@ else if (gameid == ResourceFactory.ID_ICEWIND || s.add(new Bitmap(buffer, offset + 4, 4, "Effect", s_visuals)); break; - case 0xEE: // All saving throws bonus - case 0x10A: // Movement rate modifier - s.add(new DecNumber(buffer, offset, 4, "Value")); - s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); + case 0xEB: // Show casting glow + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Glow", + new String[]{"None", "Abjuration", "Conjuration", "Divination", + "Enchantment", "Illusion", "Invocation", "Necromancy", + "Alteration"})); break; case 0xF0: // Summon creature 2 - s.add(new DecNumber(buffer, offset, 4, "Creature")); + s.add(new DecNumber(buffer, offset, 4, "# creatures")); s.add(new Bitmap(buffer, offset + 4, 4, "Summon type", new String[]{"Monster summoning 1", "Monster summoning 2", "Monster summoning 3", "Monster summoning 4", @@ -1558,9 +1798,9 @@ else if (gameid == ResourceFactory.ID_ICEWIND || break; case 0xF1: // Vampiric touch - s.add(new Unknown(buffer, offset, 4)); + s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Bitmap(buffer, offset + 4, 4, "Direction", - new String[]{"Target to caster", "Caster to target"})); + new String[]{"Target to source", "Source to target"})); break; case 0xF2: // Show visual overlay @@ -1587,15 +1827,30 @@ else if (gameid == ResourceFactory.ID_ICEWIND || "Fire elemental (wizard)", "Earth elemental (wizard)", "Water elemental (wizard)", "Fire elemental (priest)", "Earth elemental (priest)", "Water elemental (priest)", - "Earth elemental"})); + "Malavon earth elemental"})); + break; + + case 0xF7: // Beltyn's burning blood + case 0x108: // Static charge + case 0x109: // Cloak of fear + case 0x116: // Shroud of flame + s.add(new DecNumber(buffer, offset, 4, "# hits")); + s.add(new Unknown(buffer, offset + 4, 4)); break; case 0xF8: // Summon shadow - s.add(new Unknown(buffer, offset, 4)); + s.add(new DecNumber(buffer, offset, 4, "# creatures")); s.add(new Bitmap(buffer, offset + 4, 4, "Shadow type", new String[]{"Shadow", "Demishadow", "Shade"})); break; + case 0xFB: // Lich touch + case 0x100: // Umber hulk gaze + case 0x117: // Animal rage + s.add(new DecNumber(buffer, offset, 4, "# seconds")); + s.add(new Unknown(buffer, offset + 4, 4)); + break; + case 0xFD: // Bonus AC vs. weapons s.add(new DecNumber(buffer, offset, 4, "AC value")); s.add(new Flag(buffer, offset + 4, 4, "Bonus to", @@ -1613,24 +1868,20 @@ else if (gameid == ResourceFactory.ID_ICEWIND || break; case 0xFF: // Salamander aura - s.add(new DecNumber(buffer, offset, 4, "Damage amount")); + s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Bitmap(buffer, offset + 4, 4, "Aura type", new String[]{"Fire", "Frost"})); break; - case 0x100: // Umber hulk gaze - s.add(new DecNumber(buffer, offset, 4, "# seconds")); - s.add(new Unknown(buffer, offset + 4, 4)); - break; - case 0x103: // Summon creatures with cloud - s.add(new DecNumber(buffer, offset, 4, "Creature")); + s.add(new DecNumber(buffer, offset, 4, "# creatures")); s.add(new Bitmap(buffer, offset + 4, 4, "Summon type", new String[]{"Default", "Ally", "Hostile", "Forced", "Genie"})); restype = "CRE"; break; case 0x105: // Immunity to effect and string + case 0x114: // Remove effect by type s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Effect", s_effname)); break; @@ -1638,7 +1889,12 @@ else if (gameid == ResourceFactory.ID_ICEWIND || case 0x11B: // Float text s.add(new StringRef(buffer, offset, "String")); s.add(new Bitmap(buffer, offset + 4, 4, "Display type", - new String[]{"Default", "Cynicism"})); + new String[]{"String reference", "Cynicism"})); + break; + + case 0x128: // Set global variable + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Unknown(buffer, offset + 4, 4)); break; } } @@ -1655,12 +1911,113 @@ else if (gameid == ResourceFactory.ID_BG2 || s.add(new Flag(buffer, offset + 4, 4, "Bonus to", s_actype)); break; + case 0x1: // Modify attacks per round (CGameEffectAttackNo) + s.add(new Bitmap(buffer, offset, 4, "Value", + new String[]{"0 attacks per round", "1 attack per round", + "2 attacks per round", "3 attacks per round", + "4 attacks per round", "5 attacks per round", + "1 attack per 2 rounds", "3 attacks per 2 rounds", + "5 attacks per 2 rounds", "7 attacks per 2 rounds", + "9 attacks per 2 rounds"})); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); + break; + + case 0xC: // Damage (CGameEffectDamage) + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 2, "Mode", + new String[]{"Normal", "Set to value", "Set to %", "Percentage"})); + s.add(new IdsBitmap(buffer, offset + 6, 2, "Damage type", "DAMAGES.IDS")); + break; + + case 0x11: // Current HP bonus (CGameEffectHeal) + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 2, "Modifier type", + new String[]{"Increment", "Set", "Increment % of"})); + s.add(new Flag(buffer, offset + 6, 2, "Heal flags", + new String[]{"No flags set", "Raise dead", + "Remove limited effects"})); + break; + + case 0xF: // Dexterity bonus (CGameEffectDEX) + case 0x16: // Luck bonus (CGameEffectLuck) + case 0x2C: // Strength bonus (CGameEffectSTR) + case 0x49: // Attack damage bonus (CGameEffectDamageMod) + case 0x106: // Visual range bonus (CGameEffectVisualRange) + case 0x107: // Backstab bonus (CGameEffectBackStabMod) + case 0x113: // Hide in shadows bonus (CGameEffectHideInShadows) + case 0x114: // Detect illusions bonus (CGameEffectDetectIllusion) + case 0x115: // Set traps bonus (CGameEffectSetTrap) + case 0x116: // THAC0 bonus (CGameEffectHitMod) + case 0x119: // Wild surge bonus (CGameEffectSurgeMod) + case 0x11C: // Melee THAC0 bonus (CGameEffectMeleeTHAC0Bonus) + case 0x11D: // Melee weapon damage bonus (CGameEffectMeleeDamageBonus) + case 0x11E: // Missile weapon damage bonus (CGameEffectMissileDamageBonus) + case 0x120: // Fist THAC0 bonus (CGameEffectFistTHAC0Bonus) + case 0x121: // Fist damage bonus (CGameEffectFistDamageBonus) + case 0x131: // Off-hand THAC0 bonus (CGameEffectThac0Left) + case 0x132: // Main hand THAC0 bonus (CGameEffectThac0Right) + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); + break; + + case 0x3C: // Casting failure (CGameEffectCastingFailure) + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Failure type", + new String[]{"Wizard", "Priest", "Innate", "Wizard (dead magic)", + "Priest (dead magic)", "Innate (dead magic)"})); + break; + + case 0x42: // Translucency (CGameEffectTranslucent) + s.add(new DecNumber(buffer, offset, 4, "Fade amount")); + s.add(new Unknown(buffer, offset + 4, 4)); + break; + + case 0x43: // Summon creature (CGameEffectSummon) + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Allegiance", + new String[]{"Match target", "Match target", "From CRE file", + "Match target", "From CRE file", "Hostile"})); + restype = "CRE"; + break; + + case 0x4E: // Disease (CGameEffectDisease) + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Disease type", + new String[]{"1 damage per second", "1 damage per second", + "Amount damage per second", + "1 damage per amount seconds", "Strength", "Dexterity", + "Constitution", "Intelligence", "Wisdom", "Charisma", + "Slow target"})); + break; + + case 0x62: // Regeneration (CGameEffectRegeneration) + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Regeneration type", + new String[]{"1 HP per second", "1 HP per second", + "Amount HP per second", "1 HP per amount seconds", + "Variable per amount seconds"})); + break; + + case 0x83: // Chant (non-cumulative) (CGameEffectNon_CumulativeChant) + case 0xBD: // Increase casting speed factor (CGameEffectMentalSpeed) + case 0xBE: // Increase attack speed factor (CGameEffectPhysicalSpeed) + case 0x12D: // Critical threat range bonus (CGameEffectCriticalHitBonus) + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Unknown(buffer, offset + 4, 4)); + break; + case 0x90: // Disable button (CGameEffectDisableButton) case 0x117: // Enable button (CGameEffectEnableButton) s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Button", s_button)); break; + case 0x91: // Disable spellcasting (CGameEffectDisableSpellType) + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", + new String[]{"Wizard", "Priest", "Innate"})); + break; + case 0xB8: // No collision detection (CGameEffectSetDoNotJump) case 0xBC: // Increase spells cast per round (CGameEffectAuraCleansing) case 0xC1: // Invisibility detection (CGameEffectSeeInvisible) @@ -1695,13 +2052,6 @@ else if (gameid == ResourceFactory.ID_BG2 || restype = "String"; break; - case 0xBD: // Increase casting speed factor (CGameEffectMentalSpeed) - case 0xBE: // Increase attack speed factor (CGameEffectPhysicalSpeed) - case 0x12D: // Critical threat range bonus (CGameEffectCriticalHitBonus) - s.add(new DecNumber(buffer, offset, 4, "Amount")); - s.add(new Unknown(buffer, offset + 4, 4)); - break; - case 0xBF: // Casting level bonus (CGameEffectCastingLevelBonus) s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", @@ -1938,24 +2288,6 @@ else if (gameid == ResourceFactory.ID_BG2 || new String[]{"Wizard", "Priest"})); break; - case 0x106: // Visual range bonus (CGameEffectVisualRange) - case 0x107: // Backstab bonus (CGameEffectBackStabMod) - case 0x113: // Hide in shadows bonus (CGameEffectHideInShadows) - case 0x114: // Detect illusions bonus (CGameEffectDetectIllusion) - case 0x115: // Set traps bonus (CGameEffectSetTrap) - case 0x116: // THAC0 bonus (CGameEffectHitMod) - case 0x119: // Wild surge bonus (CGameEffectSurgeMod) - case 0x11C: // Melee THAC0 bonus (CGameEffectMeleeTHAC0Bonus) - case 0x11D: // Melee weapon damage bonus (CGameEffectMeleeDamageBonus) - case 0x11E: // Missile weapon damage bonus (CGameEffectMissileDamageBonus) - case 0x120: // Fist THAC0 bonus (CGameEffectFistTHAC0Bonus) - case 0x121: // Fist damage bonus (CGameEffectFistDamageBonus) - case 0x131: // Off-hand THAC0 bonus (CGameEffectThac0Left) - case 0x132: // Main hand THAC0 bonus (CGameEffectThac0Right) - s.add(new DecNumber(buffer, offset, 4, "Value")); - s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); - break; - case 0x108: // Drop item (CGameEffectRandomDrop) s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Only quick weapons?", s_noyes)); @@ -2040,21 +2372,170 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { switch (effectType) { case 0x0: // AC bonus s.add(new DecNumber(buffer, offset, 4, "AC value")); - s.add(new Flag(buffer, offset + 4, 4, "Bonus to", + s.add(new Bitmap(buffer, offset + 4, 4, "Bonus to", new String[]{"Generic", "Armor", "Deflection", "Shield", "Crushing", "Piercing", "Slashing", "Missile"})); break; - case 0x3D: // Alchemy - case 0xEE: // Saving throw change - case 0x10A: // Movement rate + case 0x1: // Modify attacks per round + case 0x17: // Morale bonus + case 0xEE: // All saving throws bonus + case 0x10A: // Movement rate modifier case 0x129: // Hide in shadows bonus case 0x12A: // Use magic device bonus - case 0x1B9: // Slowed + case 0x1B9: // Force slow s.add(new DecNumber(buffer, offset, 4, "Value")); s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", s_inctype)); break; + case 0x3: // Berserk + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Berserk type", + new String[]{"Normal", "Constant", "Blood rage"})); + break; + + case 0xC: // Damage + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 2, "Mode", + new String[]{"Normal", "Set to value", "Set to %", "Save for half"})); + s.add(new IdsBitmap(buffer, offset + 6, 2, "Damage type", "DAMAGES.IDS")); + break; + + case 0xF: // Dexterity bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", + new String[]{"Increment", "Set", "Set % of", "Cat's grace"})); + break; + + case 0x11: // Current HP bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 2, "Modifier type", + new String[]{"Increment", "Set", "Increment % of", "Lay on hands", + "Wholeness of body", "Lathander's renewal"})); + s.add(new Flag(buffer, offset + 6, 2, "Heal flags", + new String[]{"No flags set", "Raise dead"})); + break; + + case 0x16: // Luck bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", + new String[]{"Increment", "Lucky streak", "Fortune's favorite"})); + break; + + case 0x18: // Panic + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Panic type", + new String[]{"Normal", "Harpy wail"})); + break; + + case 0x19: // Poison + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Poison type", + new String[]{"1 damage per second", "1 damage per second", + "Amount damage per second", + "1 damage per amount seconds", + "Amount damage per round", + "Snake bite", "Envenomed weapon"})); + break; + + case 0x27: // Sleep + case 0x11D: // Force sleep + case 0x1A3: // Unconsciousness + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Wake on damage?", s_yesno)); + break; + + case 0x2C: // Strength bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", + new String[]{"Increment", "Set", "Set % of", "Wizard strength"})); + break; + + case 0x2D: // Stun + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Stun type", + new String[]{"Normal", "Unstun on damage", "Power word, stun"})); + break; + + case 0x3C: // Casting failure + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", + new String[]{"Arcane", "Divine", "All spells"})); + break; + + case 0x3D: // Alchemy + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", + new String[]{"Increment", "Set", "Mastery"})); + break; + + case 0x42: // Translucency + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Visual effect", + new String[]{"Draw instantly", "Fade in", "Fade out"})); + break; + + case 0x43: // Summon creature + case 0x19A: // Summon friendly creature + case 0x19B: // Summon hostile creature + s.add(new DecNumber(buffer, offset, 4, "# creatures")); + s.add(new Bitmap(buffer, offset + 4, 4, "Summon animation", + new String[]{"No animation", "Monster summoning circle", + "Animal summoning circle", "Earth summoning circle", + "Fire summoning circle", "Water summoning circle", "", + "Puff of smoke"})); + restype = "CRE"; + break; + + case 0x49: // Attack damage bonus + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Modifier type", + new String[]{"Increment", "Fire damage", "Cold damage", + "Electricity damage", "Acid damage", "Magic damage", + "Poison damage", "Slashing damage", "Piercing damage", + "Crushing damage", "Missile damage"})); + break; + + case 0x4E: // Disease + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Bitmap(buffer, offset + 4, 4, "Disease type", + new String[]{"1 damage per second", "Amount damage per round", + "Amount damage per second", + "1 damage per amount seconds", "Strength", "Dexterity", + "Constitution", "Intelligence", "Wisdom", "Charisma", + "Slow target", "Mold touch", "", "Contagion", + "Cloud of pestilence", "Dolorous decay"})); + break; + + case 0x62: // Regeneration + s.add(new DecNumber(buffer, offset, 4, "Value")); + s.add(new Bitmap(buffer, offset + 4, 4, "Regeneration type", + new String[]{"1 HP per second", "1 HP per second", + "Amount HP per second", "1 HP per amount seconds", + "Amount HP per round"})); + break; + + case 0x77: // Mirror image + s.add(new DecNumber(buffer, offset, 4, "# images")); + s.add(new Bitmap(buffer, offset + 4, 4, "Image type", + new String[]{"Normal", "Reflected image"})); + break; + + case 0x7C: // Teleport + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Behavior", + new String[]{"Normal", "Source to target", "Return to start", + "Exchange with target"})); + break; + + case 0x83: // Chant (non-cumulative) + case 0xF4: // Prayer + case 0xF9: // Recitation + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Prayer type", + new String[]{"Beneficial", "Detrimental"})); + break; + case 0x90: // Disable button s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Button", @@ -2070,19 +2551,38 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { "Quick skill 6", "Quick skill 7", "Quick skill 8"})); break; + case 0x91: // Disable spellcasting + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Spell class", + new String[]{"All spells", "Non-innate", "Arcane", "Divine", + "Innate"})); + break; + + case 0xBA: // Move creature + s.add(new Unknown(buffer, offset, 4)); + s.add(new IdsBitmap(buffer, offset + 4, 4, "Orientation", "DIR.IDS")); + restype = "ARE"; + break; + case 0xBB: // Set local variable s.add(new DecNumber(buffer, offset, 4, "Value")); s.add(new Unknown(buffer, offset + 4, 4)); restype = "String"; break; - case 0xBC: // Aura cleansing + case 0xBC: // Increase spells cast per round s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Cleanse aura?", s_noyes)); break; - case 0xBD: // Mental speed - case 0xBE: // Physical speed + case 0xBD: // Increase casting speed factor + case 0xBE: // Increase attack speed factor + case 0xEA: // Snilloc's snowball swarm + case 0xED: // Magical stone + case 0xEF: // Slow poison + case 0xF5: // Bad prayer + case 0xFA: // Bad recitation + case 0xFC: // Sol's searing orb s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Unknown(buffer, offset + 4, 4)); break; @@ -2090,12 +2590,17 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { case 0xBF: // Casting level bonus s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Bitmap(buffer, offset, 4, "Spell class", - new String[]{"Wizard", "Priest"})); + new String[]{"Arcane", "Divine"})); + break; + + case 0xC1: // Invisibility detection + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Ignore visibility?", s_noyes)); break; case 0xCE: // Protection from spell case 0x122: // Display spell immunity string - final String s_cretype[] = {"Default", "Undead", "Not undead", + final String s_cretype[] = {"Anyone", "Undead", "Not undead", "Fire-dwelling", "Not fire-dwelling", "Humanoid", "Not humanoid", "Animal", "Not animal", "Elemental", "Not elemental", "Fungus", "Not fungus", "Huge creature", "Not huge creature", "Elf", @@ -2126,6 +2631,7 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { break; case 0xD0: // Minimum HP + case 0x1B0: // Tortoise shell s.add(new DecNumber(buffer, offset, 4, "HP amount")); s.add(new Unknown(buffer, offset + 4, 4)); break; @@ -2136,107 +2642,163 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { new String[]{"Stoneskin", "Iron skins"})); break; + case 0xE8: // Creature RGB color fade + s.add(new Unknown(buffer, offset, 1)); + s.add(new UnsignDecNumber(buffer, offset + 1, 1, "Red")); + s.add(new UnsignDecNumber(buffer, offset + 2, 1, "Green")); + s.add(new UnsignDecNumber(buffer, offset + 3, 1, "Blue")); + s.add(new Unknown(buffer, offset + 4, 2)); + s.add(new DecNumber(buffer, offset + 6, 2, "Speed")); + break; + case 0xE9: // Show visual effect s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Effect", s_visuals)); break; - case 0xEF: // Slow poison + case 0xEB: // Show casting glow s.add(new Unknown(buffer, offset, 4)); - s.add(new DecNumber(buffer, offset + 4, 4, "Factor")); + s.add(new Bitmap(buffer, offset + 4, 4, "Glow", + new String[]{"None", "Abjuration", "Conjuration", "Divination", + "Enchantment", "Illusion", "Invocation", "Necromancy", + "Alteration"})); + break; + + case 0xF0: // Summon creature 2 + s.add(new DecNumber(buffer, offset, 4, "# creatures")); + s.add(new Bitmap(buffer, offset + 4, 4, "Summon type", + new String[]{"Monster summoning 1", "Monster summoning 2", + "Monster summoning 3", "Monster summoning 4", + "Monster summoning 5", "Monster summoning 6", + "Monster summoning 7", "Animal summoning 1", + "Animal summoning 2", "Animal summoning 3", + "Summon insects", "Creeping doom", "Malavon summon"})); break; case 0xF1: // Vampiric touch - s.add(new Unknown(buffer, offset, 4)); + s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Bitmap(buffer, offset + 4, 4, "Direction", - new String[]{"Target to caster", "Caster to target"})); + new String[]{"Target to source", "Source to target"})); break; - case 0xF4: // Prayer + case 0xF2: // Show visual overlay s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Prayer type", - new String[]{"Beneficial", "Detrimental"})); + s.add(new Bitmap(buffer, offset + 4, 4, "Overlay", + new String[]{"Globe of invulnerability", "Shroud of flame", + "Antimagic shell", "Otiluke's resilient sphere", + "Protection from normal missiles", "Cloak of fear", + "Entropy shield", "Fire aura", "Frost aura", + "Insect plague", "Storm shell", "Shield of lathander", + "Greater shield of lathander", "Seven eyes"})); + break; + + case 0xF3: // Animate dead + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Undead type", + new String[]{"Normal", "Lich"})); + break; + + case 0xF6: // Summon creature 3 + s.add(new DecNumber(buffer, offset, 4, "# creatures")); + s.add(new Bitmap(buffer, offset + 4, 4, "Creature type", + new String[]{"Lizard man", "Troll", "Shadow", "Invisible stalker", + "Fire elemental (wizard)", "Earth elemental (wizard)", + "Water elemental (wizard)", "Fire elemental (priest)", + "Earth elemental (priest)", "Water elemental (priest)", + "Malavon earth elemental"})); break; case 0xF7: // Beltyn's burning blood - case 0x108: // Static charge - case 0x109: // Cloak of fear - s.add(new DecNumber(buffer, offset, 4, "# strikes")); + s.add(new DecNumber(buffer, offset, 4, "# hits")); s.add(new Unknown(buffer, offset + 4, 4)); break; - case 0xF9: // Recitation - s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Recitation type", - new String[]{"Beneficial", "Detrimental"})); + case 0xF8: // Summon shadow + s.add(new DecNumber(buffer, offset, 4, "# creatures")); + s.add(new Bitmap(buffer, offset + 4, 4, "Shadow type", + new String[]{"Shadow", "Demishadow", "Shade"})); + break; + + case 0xFB: // Lich touch + case 0x100: // Umber hulk gaze + case 0x117: // Animal rage + s.add(new DecNumber(buffer, offset, 4, "# seconds")); + s.add(new Unknown(buffer, offset + 4, 4)); break; - case 0xFE: // Remove specific effects + case 0xFD: // Bonus AC vs. weapons + s.add(new DecNumber(buffer, offset, 4, "AC value")); + s.add(new Flag(buffer, offset + 4, 4, "Bonus to", + new String[]{"All weapons", "Blunt weapons", "Missile weapons", + "Piercing weapons", "Slashing weapons", + "Set base AC to value"})); + break; + + case 0xFE: // Dispel specific spell s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Removal type", - new String[]{"Default", "Equipped effects only", + s.add(new Bitmap(buffer, offset + 4, 4, "Dispel type", + new String[]{"All effects", "Equipped effects only", "Limited effects only"})); restype = "SPL"; break; case 0xFF: // Salamander aura - s.add(new Unknown(buffer, offset, 4)); + s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Bitmap(buffer, offset + 4, 4, "Aura type", new String[]{"Fire", "Frost"})); break; - case 0x100: // Umber hulk gaze - s.add(new DecNumber(buffer, offset, 4, "# seconds")); - s.add(new Unknown(buffer, offset + 4, 4)); + case 0x103: // Summon creatures with cloud + s.add(new DecNumber(buffer, offset, 4, "# creatures")); + s.add(new Bitmap(buffer, offset + 4, 4, "Summon type", + new String[]{"Default", "Ally", "Hostile", "Forced", "Genie"})); + restype = "CRE"; break; - case 0x105: // Immunity effect and resource + case 0x105: // Immunity to effect and resource s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Effect", s_effname)); restype = "SPL"; break; - case 0x114: // Remove effects of type - s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Effect", s_effname)); + case 0x108: // Static charge + case 0x109: // Cloak of fear + case 0x1C1: // Call lightning + s.add(new DecNumber(buffer, offset, 4, "# hits")); + s.add(new Unknown(buffer, offset + 4, 4)); + restype = "SPL"; break; - case 0x117: // Animal rage - s.add(new DecNumber(buffer, offset, 4, "# seconds")); - s.add(new Unknown(buffer, offset + 4, 4)); + case 0x114: // Remove effect by type + s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset + 4, 4, "Effect", s_effname)); break; case 0x118: // Turn undead s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Turning type", + s.add(new Bitmap(buffer, offset + 4, 4, "Turn type", new String[]{"Command", "Rebuke", "Destroy", "Panic", "Depend on caster"})); break; case 0x11B: // Float text s.add(new StringRef(buffer, offset, "String")); - s.add(new Bitmap(buffer, offset + 4, 4, "Text type", - new String[]{"Default", "Cynicim (while equipped)"})); - break; - - case 0x11D: // Sleep - s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Awaken on damage?", s_yesno)); + s.add(new Bitmap(buffer, offset + 4, 4, "Display type", + new String[]{"String reference", "Cynicism"})); break; - case 0x120: // Set state + case 0x120: // Set status s.add(new Unknown(buffer, offset, 4)); s.add(new IdsBitmap(buffer, offset + 4, 4, "State", "SPLSTATE.IDS")); break; case 0x128: // Set global variable s.add(new DecNumber(buffer, offset, 4, "Value")); - s.add(new DecNumber(buffer, offset + 4, 4, "Increase by")); - restype = "String"; + s.add(new Unknown(buffer, offset + 4, 4)); break; - case 0x192: // Add effects list - final String s_applytype[] = {"Default", "Undead", "Not undead", + case 0x192: // Apply effects list + final String s_applytype[] = {"Anyone", "Undead", "Not undead", "Fire-dwelling", "Not fire-dwelling", "Humanoid", "Not humanoid", "Animal", "Not animal", "Elemental", "Not elemental", "Fungus", "Not fungus", "Huge creature", "Not huge creature", "Elf", @@ -2261,7 +2823,7 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { "Keg", "Not keg", "Human", "Not human", "Yuan-ti", "Not yuan-ti", "Outsider", "Not outsider"}; s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Apply to type", s_applytype)); + s.add(new Bitmap(buffer, offset + 4, 4, "Creature type", s_applytype)); restype = "SPL"; break; @@ -2275,6 +2837,7 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Shield type", new String[]{"Red", "Blue"})); + restype = "SPL"; break; case 0x199: // Righteous wrath of the faithful @@ -2283,24 +2846,13 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { new String[]{"Allies", "Allies and same alignment"})); break; - case 0x19A: // Summon (as ally) - case 0x19B: // Summon (as enemy) - s.add(new DecNumber(buffer, offset, 4, "# creatures")); - s.add(new Bitmap(buffer, offset + 4, 4, "Summon animation", - new String[]{"No animation", "Monster summoning circle", - "Animal summoning circle", "Earth summoning circle", - "Fire summoning circle", "Water summoning circle", "", - "Puff of smoke"})); - restype = "CRE"; - break; - - case 0x19C: // Control + case 0x19C: // Control creature s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Control type", new String[]{"", "Default", "Mental domination"})); break; - case 0x19D: // Visual effect + case 0x19D: // Run visual effect s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Animation", new String[]{"Sanctuary", "Entangle", "Wisp", "Shield", "Grease", @@ -2320,7 +2872,7 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { s.add(new DecNumber(buffer, offset, 4, "Amount")); s.add(new Bitmap(buffer, offset + 4, 4, "Damage type", new String[]{"Amount HP per round", "Amount HP per second", - "Amount seconds per HP"})); + "1 HP per amount seconds"})); break; case 0x1A1: // Area effect using effects list @@ -2330,11 +2882,6 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { restype = "SPL"; break; - case 0x1A3: // Knocked unconscious - s.add(new Unknown(buffer, offset, 4)); - s.add(new Bitmap(buffer, offset + 4, 4, "Awaken on damage?", s_yesno)); - break; - case 0x1A4: // Death magic s.add(new Unknown(buffer, offset, 4)); s.add(new Flag(buffer, offset + 4, 4, "Death type", @@ -2343,16 +2890,13 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { "Destruction"})); break; - case 0x1AD: // When struck using effects list + case 0x1AD: // Apply effects list on hit restype = "SPL"; break; case 0x1AE: // Projectile type using effects list - final LongIntegerHashMap m_projmap = new LongIntegerHashMap(); - m_projmap.put(0L, "Default"); - m_projmap.put(243L, "Find traps"); s.add(new Unknown(buffer, offset, 4)); - s.add(new HashBitmap(buffer, offset + 4, 4, "Projectile type", m_projmap)); + s.add(new DecNumber(buffer, offset + 4, 4, "Projectile")); restype = "SPL"; break; @@ -2361,19 +2905,14 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { s.add(new Unknown(buffer, offset + 4, 4)); break; - case 0x1B0: // Tortoise shell - s.add(new DecNumber(buffer, offset, 4, "# HP")); - s.add(new Unknown(buffer, offset + 4, 4)); - break; - case 0x1B1: // Blink s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Blink type", - new String[]{"Default", "Empty body"})); + new String[]{"Normal", "Empty body"})); break; case 0x1B2: // Persistent using effects list - s.add(new DecNumber(buffer, offset, 4, "Interval in seconds")); + s.add(new DecNumber(buffer, offset, 4, "Interval")); s.add(new Unknown(buffer, offset + 4, 4)); restype = "SPL"; break; @@ -2389,11 +2928,6 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { new String[]{"None", "10/+1", "10/+2", "10/+3", "10/+4", "10/+5"})); break; - case 0x1C1: // Call lightning - s.add(new DecNumber(buffer, offset, 4, "# strikes")); - s.add(new Unknown(buffer, offset + 4, 4)); - break; - case 0x1C2: // Globe of invulnerability s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Globe type", diff --git a/infinity/resource/are/Actor.java b/infinity/resource/are/Actor.java index 66df1c1..0d387d1 100644 --- a/infinity/resource/are/Actor.java +++ b/infinity/resource/are/Actor.java @@ -23,6 +23,7 @@ public final class Actor extends AbstractStruct implements AddRemovable, HasDeta "15:30-16:29", "16:30-17:29", "17:30-18:29", "18:30-19:29", "19:30-20:29", "20:30-21:29", "21:30-22:29", "22:30-23:29", "23:30-00:29"}; + private static final String[] s_diff = {"None", "Level 1", "Level 2", "Level 3"}; public Actor() throws Exception { @@ -95,7 +96,12 @@ protected int read(byte buffer[], int offset) throws Exception // else // list.add(new Bitmap(buffer, offset + 40, 4, "Is visible?", s_noyes)); list.add(new Bitmap(buffer, offset + 44, 2, "Is spawned?", s_noyes)); - list.add(new Unknown(buffer, offset + 46, 2)); + if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) { + list.add(new Unknown(buffer, offset + 46, 1)); + list.add(new Flag(buffer, offset + 47, 1, "Difficulty", s_diff)); + } + else + list.add(new Unknown(buffer, offset + 46, 2)); list.add(new IdsBitmap(buffer, offset + 48, 4, "Animation", "ANIMATE.IDS")); list.add(new Bitmap(buffer, offset + 52, 2, "Orientation", s_orientation)); list.add(new Unknown(buffer, offset + 54, 2)); @@ -118,7 +124,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new ResourceRef(buffer, offset + 96, "Class script", "BCS")); list.add(new ResourceRef(buffer, offset + 104, "Race script", "BCS")); list.add(new ResourceRef(buffer, offset + 112, "Default script", "BCS")); - list.add(new ResourceRef(buffer, offset + 120, "Specific script", "BCS")); + list.add(new ResourceRef(buffer, offset + 120, "Specifics script", "BCS")); } if (buffer[offset + 128] == 0x2a) // * list.add(new TextString(buffer, offset + 128, 8, "Character")); @@ -128,7 +134,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(creOffset); list.add(new DecNumber(buffer, offset + 140, 4, "CRE structure size")); if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) { - list.add(new ResourceRef(buffer, offset + 144, "Special script 1", "BCS")); + list.add(new ResourceRef(buffer, offset + 144, "Special 1 script", "BCS")); list.add(new Unknown(buffer, offset + 152, 120)); } else { diff --git a/infinity/resource/are/Ambient.java b/infinity/resource/are/Ambient.java index 8edf845..99aaf8e 100644 --- a/infinity/resource/are/Ambient.java +++ b/infinity/resource/are/Ambient.java @@ -43,7 +43,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 128, 2, "# sounds")); list.add(new Unknown(buffer, offset + 130, 2)); list.add(new DecNumber(buffer, offset + 132, 4, "Base interval")); - list.add(new DecNumber(buffer, offset + 136, 4, "Interval deviation")); + list.add(new DecNumber(buffer, offset + 136, 4, "Interval variation")); list.add(new Flag(buffer, offset + 140, 4, "Active at", Actor.s_schedule)); // list.add(new HexNumber(buffer, offset + 140, 4, "Day/night presence?")); list.add(new Flag(buffer, offset + 144, 4, "Flags", s_flag)); diff --git a/infinity/resource/are/AreResource.java b/infinity/resource/are/AreResource.java index 3479382..c42fc70 100644 --- a/infinity/resource/are/AreResource.java +++ b/infinity/resource/are/AreResource.java @@ -262,7 +262,9 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) list.add(new DecNumber(buffer, offset + 80, 2, "Lightning probability")); list.add(new Unknown(buffer, offset + 82, 2)); if (version.toString().equalsIgnoreCase("V9.1")) { - list.add(new Unknown(buffer, offset + 84, 16)); + list.add(new DecNumber(buffer, offset + 84, 1, "Area difficulty 2")); + list.add(new DecNumber(buffer, offset + 85, 1, "Area difficulty 3")); + list.add(new Unknown(buffer, offset + 86, 14)); offset += 16; } SectionOffset offset_actors = new SectionOffset(buffer, offset + 84, "Actors offset", @@ -380,6 +382,15 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_BG2 || list.add(new ResourceRef(buffer, offset + 220, "Rest movie (night)", "MVE")); list.add(new Unknown(buffer, offset + 228, 56)); } + else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) { + offset_automapnote = new SectionOffset(buffer, offset + 196, "Automap notes offset", + AutomapNote.class); + list.add(offset_automapnote); + count_automapnote = new SectionCount(buffer, offset + 200, 4, "# automap notes", + AutomapNote.class); + list.add(count_automapnote); + list.add(new Unknown(buffer, offset + 204, 80)); + } else list.add(new Unknown(buffer, offset + 196, 88)); diff --git a/infinity/resource/are/AutomapNote.java b/infinity/resource/are/AutomapNote.java index 658312a..b8dd7f3 100644 --- a/infinity/resource/are/AutomapNote.java +++ b/infinity/resource/are/AutomapNote.java @@ -30,7 +30,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 2, 2, "Coordinate: Y")); list.add(new StringRef(buffer, offset + 4, "Text")); list.add(new Bitmap(buffer, offset + 8, 2, "Text location", s_source)); - list.add(new Bitmap(buffer, offset + 10, 2, "Automap mark color", s_flag)); + list.add(new Bitmap(buffer, offset + 10, 2, "Marker color", s_flag)); list.add(new DecNumber(buffer, offset + 12, 4, "Control ID")); list.add(new Unknown(buffer, offset + 16, 36)); return offset + 52; diff --git a/infinity/resource/are/Container.java b/infinity/resource/are/Container.java index d219bc1..e17849d 100644 --- a/infinity/resource/are/Container.java +++ b/infinity/resource/are/Container.java @@ -148,9 +148,9 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new ResourceRef(buffer, offset + 72, "Trap script", "BCS")); list.add(new DecNumber(buffer, offset + 80, 4, "First vertex index")); list.add(new DecNumber(buffer, offset + 84, 2, "# vertices")); - list.add(new Unknown(buffer, offset + 86, 2)); + list.add(new Unknown(buffer, offset + 86, 34)); // list.add(new ResourceRef(buffer, offset + 88, "Creature?", "CRE")); - list.add(new Unknown(buffer, offset + 88, 32)); +// list.add(new Unknown(buffer, offset + 96, 24)); list.add(new ResourceRef(buffer, offset + 120, "Key", "ITM")); list.add(new Unknown(buffer, offset + 128, 4)); list.add(new StringRef(buffer, offset + 132, "Lockpick string")); diff --git a/infinity/resource/are/Door.java b/infinity/resource/are/Door.java index fe2b842..d9d0e83 100644 --- a/infinity/resource/are/Door.java +++ b/infinity/resource/are/Door.java @@ -147,7 +147,7 @@ protected int read(byte buffer[], int offset) throws Exception // list.add(new Unknown(buffer, offset + 86, 2)); list.add(new ResourceRef(buffer, offset + 88, "Opening sound", "WAV")); list.add(new ResourceRef(buffer, offset + 96, "Closing sound", "WAV")); - list.add(new DecNumber(buffer, offset + 104, 4, "Cursor frame number")); + list.add(new DecNumber(buffer, offset + 104, 4, "Cursor number")); list.add(new DecNumber(buffer, offset + 108, 2, "Trap detection difficulty")); list.add(new DecNumber(buffer, offset + 110, 2, "Trap removal difficulty")); list.add(new Bitmap(buffer, offset + 112, 2, "Is trapped?", s_yesno)); diff --git a/infinity/resource/are/ITEPoint.java b/infinity/resource/are/ITEPoint.java index 95a4da1..6cdc0f4 100644 --- a/infinity/resource/are/ITEPoint.java +++ b/infinity/resource/are/ITEPoint.java @@ -88,7 +88,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 42, 2, "# vertices")); list.add(new DecNumber(buffer, offset + 44, 4, "First vertex index")); list.add(new Unknown(buffer, offset + 48, 4)); - list.add(new DecNumber(buffer, offset + 52, 4, "Cursor frame number")); + list.add(new DecNumber(buffer, offset + 52, 4, "Cursor number")); list.add(new ResourceRef(buffer, offset + 56, "Destination area", "ARE")); list.add(new TextString(buffer, offset + 64, 32, "Entrance name")); list.add(new Flag(buffer, offset + 96, 4, "Flags", s_flag)); @@ -116,7 +116,8 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND || ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOW || ResourceFactory.getGameID() == ResourceFactory.ID_ICEWINDHOWTOT || ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) { - list.add(new Unknown(buffer, offset + 132, 4)); + list.add(new DecNumber(buffer, offset + 132, 2, "Override point: X")); + list.add(new DecNumber(buffer, offset + 134, 2, "Override point: Y")); list.add(new DecNumber(buffer, offset + 136, 4, "Alternate point: X")); list.add(new DecNumber(buffer, offset + 140, 4, "Alternate point: Y")); list.add(new Unknown(buffer, offset + 144, 52)); diff --git a/infinity/resource/are/ProTrap.java b/infinity/resource/are/ProTrap.java index 40f9d31..e970c68 100644 --- a/infinity/resource/are/ProTrap.java +++ b/infinity/resource/are/ProTrap.java @@ -27,12 +27,12 @@ protected int read(byte buffer[], int offset) throws Exception // Mac ToB doesn't save these right, so EFFs not handled list.add(new DecNumber(buffer, offset + 12, 2, "Effects list size")); list.add(new Unknown(buffer, offset + 14, 2, "Projectile")); - list.add(new Unknown(buffer, offset + 16, 2)); - list.add(new Unknown(buffer, offset + 18, 2)); + list.add(new DecNumber(buffer, offset + 16, 2, "Explosion frequency (frames)")); + list.add(new DecNumber(buffer, offset + 18, 2, "Duration")); list.add(new DecNumber(buffer, offset + 20, 2, "Location: X")); list.add(new DecNumber(buffer, offset + 22, 2, "Location: Y")); - list.add(new Unknown(buffer, offset + 24, 2)); - list.add(new Unknown(buffer, offset + 26, 2)); + list.add(new DecNumber(buffer, offset + 24, 2, "Location: Z")); + list.add(new DecNumber(buffer, offset + 26, 2, "Target")); return offset + 28; } } diff --git a/infinity/resource/are/ViewerActor.java b/infinity/resource/are/ViewerActor.java index 6242dbd..016519c 100644 --- a/infinity/resource/are/ViewerActor.java +++ b/infinity/resource/are/ViewerActor.java @@ -88,7 +88,7 @@ private JPanel makeFieldPanel(Actor actor) ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Movement script"), gbl, gbc, true); } else { - ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Specific script"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Specifics script"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Class script"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("Race script"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, actor.getAttribute("General script"), gbl, gbc, true); diff --git a/infinity/resource/bcs/Compiler.java b/infinity/resource/bcs/Compiler.java index a13ff13..9c43ce4 100644 --- a/infinity/resource/bcs/Compiler.java +++ b/infinity/resource/bcs/Compiler.java @@ -85,12 +85,12 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) IdsMapCache.get("EA.IDS"), IdsMapCache.get("GENERAL.IDS"), IdsMapCache.get("RACE.IDS"), - IdsMapCache.get("SUBRACE.IDS"), + IdsMapCache.get("CLASS.IDS"), IdsMapCache.get("SPECIFIC.IDS"), IdsMapCache.get("GENDER.IDS"), IdsMapCache.get("ALIGNMNT.IDS"), + IdsMapCache.get("SUBRACE.IDS"), IdsMapCache.get("CLASS.IDS"), - IdsMapCache.get("AVCLASS.IDS"), IdsMapCache.get("CLASSMSK.IDS") }; else @@ -274,9 +274,11 @@ private void checkString(String function, String definition, String value) // System.out.println("Compiler.checkString: " + function + " " + definition + " " + value); if (value.equals("\"\"")) // ToDo: "" due to IWD2 decompiler bug? return; - if (definition.equalsIgnoreCase("S:Area*") || - definition.equalsIgnoreCase("S:Area1*") || - definition.equalsIgnoreCase("S:Area2*")) { + if (value.substring(1, value.length() - 1).length() > 32) + warnings.put(new Integer(linenr), "Invalid string length: " + definition + " - " + value); + else if (definition.equalsIgnoreCase("S:Area*") || + definition.equalsIgnoreCase("S:Area1*") || + definition.equalsIgnoreCase("S:Area2*")) { if (!isPossibleNamespace(value)) { String error = "Invalid area string: " + definition + " - " + value; errors.put(new Integer(linenr), error); diff --git a/infinity/resource/bcs/Decompiler.java b/infinity/resource/bcs/Decompiler.java index d52d4ad..270c939 100644 --- a/infinity/resource/bcs/Decompiler.java +++ b/infinity/resource/bcs/Decompiler.java @@ -342,17 +342,14 @@ private static String decompileOB(StringTokenizer st) } ids[index] = lookup(IdsMapCache.get("GENERAL.IDS"), numbers[index++]); ids[index] = lookup(IdsMapCache.get("RACE.IDS"), numbers[index++]); + ids[index] = lookup(IdsMapCache.get("CLASS.IDS"), numbers[index++]); + ids[index] = lookup(IdsMapCache.get("SPECIFIC.IDS"), numbers[index++]); + ids[index] = lookup(IdsMapCache.get("GENDER.IDS"), numbers[index++]); if (numbersIndex == 15) { - ids[index] = lookup(IdsMapCache.get("SUBRACE.IDS"), numbers[index++]); - ids[index] = lookup(IdsMapCache.get("SPECIFIC.IDS"), numbers[index++]); - ids[index] = lookup(IdsMapCache.get("GENDER.IDS"), numbers[index++]); ids[index] = lookup(IdsMapCache.get("ALIGNMNT.IDS"), numbers[index++]); - ids[index] = lookup(IdsMapCache.get("CLASS.IDS"), numbers[index++]); + ids[index] = lookup(IdsMapCache.get("SUBRACE.IDS"), numbers[index++]); } else { - ids[index] = lookup(IdsMapCache.get("CLASS.IDS"), numbers[index++]); - ids[index] = lookup(IdsMapCache.get("SPECIFIC.IDS"), numbers[index++]); - ids[index] = lookup(IdsMapCache.get("GENDER.IDS"), numbers[index++]); ids[index] = lookup(IdsMapCache.get("ALIGN.IDS"), numbers[index++]); } @@ -364,8 +361,8 @@ private static String decompileOB(StringTokenizer st) lookup(objectMap, numbers[index++]), lookup(objectMap, numbers[index++])}; - if (numbersIndex == 15) { // ToDo: whatweretheythinking?! - ids[index - 5] = lookup(IdsMapCache.get("AVCLASS.IDS"), numbers[index++]); + if (numbersIndex == 15) { + ids[index - 5] = lookup(IdsMapCache.get("CLASS.IDS"), numbers[index++]); ids[index - 5] = lookup(IdsMapCache.get("CLASSMSK.IDS"), numbers[index++]); } diff --git a/infinity/resource/cre/CreResource.java b/infinity/resource/cre/CreResource.java index 9db958d..00885b6 100644 --- a/infinity/resource/cre/CreResource.java +++ b/infinity/resource/cre/CreResource.java @@ -31,27 +31,26 @@ public final class CreResource extends AbstractStruct implements Resource, HasAd "Specifics tracking", "Gender tracking", "Alignment tracking", "Uninterruptible"}; private static final String s_feats1[] = { - "No feats selected", "Aegis of rime", "Ambidexterity", "Aqua mortis", "Armor prof", "Armored arcana", - "Arterial strike", "Blind fight", "Bullheaded", "Cleave", "Combat casting", "Conundrum", "Crippling strike", + "No feats selected", "Aegis of rime", "Ambidexterity", "Aqua mortis", "Armor proficiency", "Armored arcana", + "Arterial strike", "Blind fight", "Bullheaded", "Cleave", "Combat casting", "Courteous magocracy", "Crippling strike", "Dash", "Deflect arrows", "Dirty fighting", "Discipline", "Dodge", "Envenom weapon", "Exotic bastard", "Expertise", "Extra rage", "Extra shapeshifting", "Extra smiting", "Extra turning", "Fiendslayer", - "Forester", "Great fortitude", "Hamstring", "Heretics bane", "Heroic inspiration", "Improved critical", + "Forester", "Great fortitude", "Hamstring", "Heretic's bane", "Heroic inspiration", "Improved critical", "Improved evasion"}; private static final String s_feats2[] = { "No feats selected", "Improved initiative", "Improved turning", "Iron will", "Lightning reflexes", "Lingering song", "Luck of heroes", "Martial axe", "Martial bow", "Martial flail", "Martial greatsword", "Martial hammer", "Martial large sword", "Martial polearm", "Maximized attacks", "Mercantile background", - "Power attack", "Precise shot", "Rapid shot", "Resist poison", "Scion of storms", "Shield prof", + "Power attack", "Precise shot", "Rapid shot", "Resist poison", "Scion of storms", "Shield proficiency", "Simple crossbow", "Simple mace", "Simple missile", "Simple quarterstaff", "Simple small blade", "Slippery mind", "Snake blood", "Spell focus enchantment", "Spell focus evocation", "Spell focus necromancy", "Spell focus transmutation"}; private static final String s_feats3[] = { "No feats selected", "Spell penetration", "Spirit of flame", "Strong back", "Stunning fist", "Subvocal casting", - "Toughness", "Two weapon fighting", "Weapon finesse", "Wildshape boar", "Wildshape panther", - "Wildshape shambler"}; + "Toughness", "Two-weapon fighting", "Weapon finesse", "Wild shape boar", "Wild shape panther", + "Wild shape shambler"}; private static final String s_attacks[] = {"0", "1", "2", "3", "4", "5", "1/2", "3/2", "5/2", "7/2", "9/2"}; - private static final String s_sex[] = {"", "Male", "Female"}; private static final String s_noyes[] = {"No", "Yes"}; private static final String s_visible[] = {"Shown", "Hidden"}; @@ -369,7 +368,81 @@ protected int read(byte buffer[], int offset) throws Exception HexNumber structOffset = new HexNumber(buffer, offset + 40, 4, "CRE structure offset"); list.add(structOffset); list.add(new HexNumber(buffer, offset + 44, 4, "CRE structure length")); - if (version.toString().equalsIgnoreCase("V1.0")) { + if (version.toString().equalsIgnoreCase("V2.2")) { + list.add(new IdsBitmap(buffer, offset + 48, 2, "Quick weapon slot 1", "SLOTS.IDS")); + list.add(new IdsBitmap(buffer, offset + 50, 2, "Quick shield slot 1", "SLOTS.IDS")); + list.add(new IdsBitmap(buffer, offset + 52, 2, "Quick weapon slot 2", "SLOTS.IDS")); + list.add(new IdsBitmap(buffer, offset + 54, 2, "Quick shield slot 2", "SLOTS.IDS")); + list.add(new IdsBitmap(buffer, offset + 56, 2, "Quick weapon slot 3", "SLOTS.IDS")); + list.add(new IdsBitmap(buffer, offset + 58, 2, "Quick shield slot 3", "SLOTS.IDS")); + list.add(new IdsBitmap(buffer, offset + 60, 2, "Quick weapon slot 4", "SLOTS.IDS")); + list.add(new IdsBitmap(buffer, offset + 62, 2, "Quick shield slot 4", "SLOTS.IDS")); + list.add(new HashBitmap(buffer, offset + 64, 2, "Show quick weapon 1?", m_slotmask)); + list.add(new HashBitmap(buffer, offset + 66, 2, "Show quick shield 1?", m_slotmask)); + list.add(new HashBitmap(buffer, offset + 68, 2, "Show quick weapon 2?", m_slotmask)); + list.add(new HashBitmap(buffer, offset + 70, 2, "Show quick shield 2?", m_slotmask)); + list.add(new HashBitmap(buffer, offset + 72, 2, "Show quick weapon 3?", m_slotmask)); + list.add(new HashBitmap(buffer, offset + 74, 2, "Show quick shield 3?", m_slotmask)); + list.add(new HashBitmap(buffer, offset + 76, 2, "Show quick weapon 4?", m_slotmask)); + list.add(new HashBitmap(buffer, offset + 78, 2, "Show quick shield 4?", m_slotmask)); + list.add(new ResourceRef(buffer, offset + 80, "Quick spell 1", "SPL")); + list.add(new ResourceRef(buffer, offset + 88, "Quick spell 2", "SPL")); + list.add(new ResourceRef(buffer, offset + 96, "Quick spell 3", "SPL")); + list.add(new ResourceRef(buffer, offset + 104, "Quick spell 4", "SPL")); + list.add(new ResourceRef(buffer, offset + 112, "Quick spell 5", "SPL")); + list.add(new ResourceRef(buffer, offset + 120, "Quick spell 6", "SPL")); + list.add(new ResourceRef(buffer, offset + 128, "Quick spell 7", "SPL")); + list.add(new ResourceRef(buffer, offset + 136, "Quick spell 8", "SPL")); + list.add(new ResourceRef(buffer, offset + 144, "Quick spell 9", "SPL")); + list.add(new IdsBitmap(buffer, offset + 152, 1, "Quick spell 1 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 153, 1, "Quick spell 2 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 154, 1, "Quick spell 3 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 155, 1, "Quick spell 4 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 156, 1, "Quick spell 5 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 157, 1, "Quick spell 6 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 158, 1, "Quick spell 7 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 159, 1, "Quick spell 8 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 160, 1, "Quick spell 9 class", "CLASS.IDS")); + list.add(new Unknown(buffer, offset + 161, 1)); + list.add(new IdsBitmap(buffer, offset + 162, 2, "Quick item slot 1", "SLOTS.IDS")); + list.add(new IdsBitmap(buffer, offset + 164, 2, "Quick item slot 2", "SLOTS.IDS")); + list.add(new IdsBitmap(buffer, offset + 166, 2, "Quick item slot 3", "SLOTS.IDS")); + list.add(new HashBitmap(buffer, offset + 168, 2, "Show quick item 1?", m_slotmask)); + list.add(new HashBitmap(buffer, offset + 170, 2, "Show quick item 2?", m_slotmask)); + list.add(new HashBitmap(buffer, offset + 172, 2, "Show quick item 3?", m_slotmask)); + list.add(new ResourceRef(buffer, offset + 174, "Quick ability 1", "SPL")); + list.add(new ResourceRef(buffer, offset + 182, "Quick ability 2", "SPL")); + list.add(new ResourceRef(buffer, offset + 190, "Quick ability 3", "SPL")); + list.add(new ResourceRef(buffer, offset + 198, "Quick ability 4", "SPL")); + list.add(new ResourceRef(buffer, offset + 206, "Quick ability 5", "SPL")); + list.add(new ResourceRef(buffer, offset + 214, "Quick ability 6", "SPL")); + list.add(new ResourceRef(buffer, offset + 222, "Quick ability 7", "SPL")); + list.add(new ResourceRef(buffer, offset + 230, "Quick ability 8", "SPL")); + list.add(new ResourceRef(buffer, offset + 238, "Quick ability 9", "SPL")); + list.add(new ResourceRef(buffer, offset + 246, "Quick song 1", "SPL")); + list.add(new ResourceRef(buffer, offset + 254, "Quick song 2", "SPL")); + list.add(new ResourceRef(buffer, offset + 262, "Quick song 3", "SPL")); + list.add(new ResourceRef(buffer, offset + 270, "Quick song 4", "SPL")); + list.add(new ResourceRef(buffer, offset + 278, "Quick song 5", "SPL")); + list.add(new ResourceRef(buffer, offset + 286, "Quick song 6", "SPL")); + list.add(new ResourceRef(buffer, offset + 294, "Quick song 7", "SPL")); + list.add(new ResourceRef(buffer, offset + 302, "Quick song 8", "SPL")); + list.add(new ResourceRef(buffer, offset + 310, "Quick song 9", "SPL")); + list.add(new DecNumber(buffer, offset + 318, 4, "Quick button 1")); + list.add(new DecNumber(buffer, offset + 322, 4, "Quick button 2")); + list.add(new DecNumber(buffer, offset + 326, 4, "Quick button 3")); + list.add(new DecNumber(buffer, offset + 330, 4, "Quick button 4")); + list.add(new DecNumber(buffer, offset + 334, 4, "Quick button 5")); + list.add(new DecNumber(buffer, offset + 338, 4, "Quick button 6")); + list.add(new DecNumber(buffer, offset + 342, 4, "Quick button 7")); + list.add(new DecNumber(buffer, offset + 346, 4, "Quick button 8")); + list.add(new DecNumber(buffer, offset + 350, 4, "Quick button 9")); + list.add(new Unknown(buffer, offset + 354, 26)); + list.add(new TextString(buffer, offset + 380, 8, "Voice set prefix")); + list.add(new TextString(buffer, offset + 388, 32, "Voice set")); + list.add(new Unknown(buffer, offset + 420, 128)); + } + else if (version.toString().equalsIgnoreCase("V1.0")) { list.add(new IdsBitmap(buffer, offset + 48, 2, "Quick weapon slot 1", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 50, 2, "Quick weapon slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 52, 2, "Quick weapon slot 3", "SLOTS.IDS")); @@ -432,12 +505,12 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new ResourceRef(buffer, offset + 52, "Large portrait", "BMP")); list.add(new DecNumber(buffer, offset + 60, 1, "Reputation")); list.add(new Unknown(buffer, offset + 61, 1)); - list.add(new DecNumber(buffer, offset + 62, 2, "AC")); + list.add(new DecNumber(buffer, offset + 62, 2, "Armor class")); list.add(new DecNumber(buffer, offset + 64, 2, "Bludgeoning AC modifier")); list.add(new DecNumber(buffer, offset + 66, 2, "Missile AC modifier")); list.add(new DecNumber(buffer, offset + 68, 2, "Piercing AC modifier")); list.add(new DecNumber(buffer, offset + 70, 2, "Slashing AC modifier")); - list.add(new Unknown(buffer, offset + 72, 1)); + list.add(new DecNumber(buffer, offset + 72, 1, "Base attack bonus")); list.add(new DecNumber(buffer, offset + 73, 1, "# attacks/round")); list.add(new DecNumber(buffer, offset + 74, 1, "Fortitude save")); list.add(new DecNumber(buffer, offset + 75, 1, "Reflex save")); @@ -476,8 +549,22 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 141, 1, "Wizard level")); list.add(new Unknown(buffer, offset + 142, 22)); - for (int i = 0; i < 64; i++) - list.add(new StringRef(buffer, offset + 164 + 4 * i, "String")); + LongIntegerHashMap sndmap = null; + if (ResourceFactory.getInstance().resourceExists("SOUNDOFF.IDS")) + sndmap = IdsMapCache.get("SOUNDOFF.IDS").getMap(); + if (sndmap != null) { + for (int i = 0; i < 64; i++) + if (sndmap.containsKey((long)i)) + list.add( + new StringRef(buffer, offset + 164 + 4 * i, + "Sound: " + ((IdsMapEntry)sndmap.get((long)i)).getString())); + else + list.add(new StringRef(buffer, offset + 164 + 4 * i, "Sound: Unknown")); + } + else { + for (int i = 0; i < 64; i++) + list.add(new StringRef(buffer, offset + 164 + 4 * i, "Soundset string")); + } list.add(new ResourceRef(buffer, offset + 420, "Team script", "BCS")); list.add(new ResourceRef(buffer, offset + 428, "Special script 1", "BCS")); @@ -543,7 +630,7 @@ private int readIWD2(byte buffer[], int offset) throws Exception new String[]{"Pureblood", "Aamimar/Drow/Gold dwarf/Strongheart halfling/Deep gnome", "Tiefling/Wild elf/Gray dwarf/Ghostwise halfling"})); list.add(new Unknown(buffer, offset + 604, 1)); - list.add(new Bitmap(buffer, offset + 605, 1, "Sex", s_sex)); + list.add(new IdsBitmap(buffer, offset + 605, 1, "Sex", "GENDER.IDS")); list.add(new DecNumber(buffer, offset + 606, 1, "Strength")); list.add(new DecNumber(buffer, offset + 607, 1, "Intelligence")); list.add(new DecNumber(buffer, offset + 608, 1, "Wisdom")); @@ -579,7 +666,7 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new IdsBitmap(buffer, offset + 893, 1, "General", "GENERAL.IDS")); list.add(new IdsBitmap(buffer, offset + 894, 1, "Race", "RACE.IDS")); list.add(new IdsBitmap(buffer, offset + 895, 1, "Class", "CLASS.IDS")); - list.add(new IdsBitmap(buffer, offset + 896, 1, "Specific", "SPECIFIC.IDS")); + list.add(new IdsBitmap(buffer, offset + 896, 1, "Specifics", "SPECIFIC.IDS")); list.add(new IdsBitmap(buffer, offset + 897, 1, "Gender", "GENDER.IDS")); list.add(new IdsBitmap(buffer, offset + 898, 1, "Object spec 1", "OBJECT.IDS")); list.add(new IdsBitmap(buffer, offset + 899, 1, "Object spec 2", "OBJECT.IDS")); @@ -590,7 +677,8 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 904, 2, "Global identifier")); list.add(new DecNumber(buffer, offset + 906, 2, "Local identifier")); list.add(new TextString(buffer, offset + 908, 32, "Script name")); - list.add(new Unknown(buffer, offset + 940, 6)); + list.add(new IdsBitmap(buffer, offset + 940, 2, "Class 2", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 942, 4, "Class mask", "CLASSMSK.IDS")); // Bard spells for (int i = 0; i < 9; i++) { @@ -799,11 +887,11 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 28, 2, "Shield 3")); list.add(new DecNumber(buffer, offset + 30, 2, "Weapon 4")); list.add(new DecNumber(buffer, offset + 32, 2, "Shield 4")); - list.add(new DecNumber(buffer, offset + 34, 2, "Cloak")); - list.add(new DecNumber(buffer, offset + 36, 2, "Quiver 1")); - list.add(new DecNumber(buffer, offset + 38, 2, "Quiver 2")); - list.add(new DecNumber(buffer, offset + 40, 2, "Quiver 3")); - list.add(new DecNumber(buffer, offset + 42, 2, "Quiver 4")); + list.add(new DecNumber(buffer, offset + 34, 2, "Quiver 1")); + list.add(new DecNumber(buffer, offset + 36, 2, "Quiver 2")); + list.add(new DecNumber(buffer, offset + 38, 2, "Quiver 3")); + list.add(new DecNumber(buffer, offset + 40, 2, "Quiver 4")); + list.add(new DecNumber(buffer, offset + 42, 2, "Cloak")); list.add(new DecNumber(buffer, offset + 44, 2, "Quick item 1")); list.add(new DecNumber(buffer, offset + 46, 2, "Quick item 2")); list.add(new DecNumber(buffer, offset + 48, 2, "Quick item 3")); @@ -998,8 +1086,8 @@ else if (ResourceFactory.getInstance().resourceExists("SOUNDOFF.IDS")) list.add(new DecNumber(buffer, offset + 556, 1, "Level first class")); list.add(new DecNumber(buffer, offset + 557, 1, "Level second class")); list.add(new DecNumber(buffer, offset + 558, 1, "Level third class")); - list.add( - new Bitmap(buffer, offset + 559, 1, "Sex", s_sex)); + list.add(new IdsBitmap(buffer, offset + 559, 1, "Sex", "GENDER.IDS")); +// new Bitmap(buffer, offset + 559, 1, "Sex", new String[]{"", "Male", "Female", "Neither", "Both"})); list.add(new DecNumber(buffer, offset + 560, 1, "Strength")); list.add(new DecNumber(buffer, offset + 561, 1, "Strength bonus")); list.add(new DecNumber(buffer, offset + 562, 1, "Intelligence")); @@ -1116,7 +1204,7 @@ else if (version.equalsIgnoreCase("V9.0")) { list.add(new IdsBitmap(buffer, offset + 617, 1, "General", "GENERAL.IDS")); list.add(new IdsBitmap(buffer, offset + 618, 1, "Race", "RACE.IDS")); list.add(new IdsBitmap(buffer, offset + 619, 1, "Class", "CLASS.IDS")); - list.add(new IdsBitmap(buffer, offset + 620, 1, "Specific", "SPECIFIC.IDS")); + list.add(new IdsBitmap(buffer, offset + 620, 1, "Specifics", "SPECIFIC.IDS")); list.add(new IdsBitmap(buffer, offset + 621, 1, "Gender", "GENDER.IDS")); list.add(new IdsBitmap(buffer, offset + 622, 1, "Object spec 1", "OBJECT.IDS")); list.add(new IdsBitmap(buffer, offset + 623, 1, "Object spec 2", "OBJECT.IDS")); diff --git a/infinity/resource/cre/Viewer.java b/infinity/resource/cre/Viewer.java index d2eff8b..1dd5d8b 100644 --- a/infinity/resource/cre/Viewer.java +++ b/infinity/resource/cre/Viewer.java @@ -152,9 +152,10 @@ else if (effectFlag.toString().equalsIgnoreCase("1")) effectPanel = ViewerUtil.makeListPanel("Effects", cre, Effect.class, "Type"); ResourceRef imageRef = (ResourceRef)cre.getAttribute("Large portrait"); JComponent imagePanel; - if (imageRef.getResourceName().endsWith(".BAM")) - imagePanel = ViewerUtil.makeBamPanel(imageRef, 0); - else if (ResourceFactory.getInstance().resourceExists(imageRef.getResourceName())) +// if (imageRef.getResourceName().endsWith(".BAM")) +// imagePanel = ViewerUtil.makeBamPanel(imageRef, 0); + if (imageRef.getResourceName().endsWith(".BMP") && + ResourceFactory.getInstance().resourceExists(imageRef.getResourceName())) imagePanel = ViewerUtil.makeImagePanel(imageRef); else imagePanel = ViewerUtil.makeImagePanel((ResourceRef)cre.getAttribute("Small portrait")); @@ -316,7 +317,7 @@ private JPanel makeStatsPanelIWD2(CreResource cre) ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("XP"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("XP value"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Total level"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("AC"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(panel, cre.getAttribute("Armor class"), gbl, gbc, true); StructEntry s1 = cre.getAttribute("Current HP"); StructEntry s2 = cre.getAttribute("Maximum HP"); diff --git a/infinity/resource/gam/GamResource.java b/infinity/resource/gam/GamResource.java index 0958bad..0332a66 100644 --- a/infinity/resource/gam/GamResource.java +++ b/infinity/resource/gam/GamResource.java @@ -197,7 +197,11 @@ else if (gameid == ResourceFactory.ID_BG2 || gameid == ResourceFactory.ID_BG2TOB else if (gameid == ResourceFactory.ID_ICEWIND2) { // V2.2 (V1.1 & V2.0 in BIFF) list.add(new Unknown(buffer, offset + 84, 4)); list.add(new ResourceRef(buffer, offset + 88, "Current area?", "ARE")); - list.add(new Unknown(buffer, offset + 96, 8)); + list.add(new Flag(buffer, offset + 96, 4, "Configuration", + new String[]{"Normal windows", "Party AI disabled", "", + "", "", "Fullscreen mode", "Button bar hidden", + "Console hidden", "Automap notes hidden"})); + list.add(new Unknown(buffer, offset + 100, 4)); if (version.toString().equalsIgnoreCase("V2.2")) { offIWD2 = new SectionOffset(buffer, offset + 104, "Unknown offset", UnknownSection.class); diff --git a/infinity/resource/gam/PartyNPC.java b/infinity/resource/gam/PartyNPC.java index ff37341..d3367ab 100644 --- a/infinity/resource/gam/PartyNPC.java +++ b/infinity/resource/gam/PartyNPC.java @@ -258,24 +258,24 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { list.add(new HashBitmap(buffer, offset + 166, 2, "Show quick shield 3?", m_partyslot)); list.add(new HashBitmap(buffer, offset + 168, 2, "Show quick weapon 4?", m_partyslot)); list.add(new HashBitmap(buffer, offset + 170, 2, "Show quick shield 4?", m_partyslot)); - list.add(new TextString(buffer, offset + 172, 8, "Quick spell 1")); - list.add(new TextString(buffer, offset + 180, 8, "Quick spell 2")); - list.add(new TextString(buffer, offset + 188, 8, "Quick spell 3")); - list.add(new TextString(buffer, offset + 196, 8, "Quick spell 4")); - list.add(new TextString(buffer, offset + 204, 8, "Quick spell 5")); - list.add(new TextString(buffer, offset + 212, 8, "Quick spell 6")); - list.add(new TextString(buffer, offset + 220, 8, "Quick spell 7")); - list.add(new TextString(buffer, offset + 228, 8, "Quick spell 8")); - list.add(new TextString(buffer, offset + 236, 8, "Quick spell 9")); - list.add(new DecNumber(buffer, offset + 244, 1, "Quick spell 1 class")); - list.add(new DecNumber(buffer, offset + 245, 1, "Quick spell 2 class")); - list.add(new DecNumber(buffer, offset + 246, 1, "Quick spell 3 class")); - list.add(new DecNumber(buffer, offset + 247, 1, "Quick spell 4 class")); - list.add(new DecNumber(buffer, offset + 248, 1, "Quick spell 5 class")); - list.add(new DecNumber(buffer, offset + 249, 1, "Quick spell 6 class")); - list.add(new DecNumber(buffer, offset + 250, 1, "Quick spell 7 class")); - list.add(new DecNumber(buffer, offset + 251, 1, "Quick spell 8 class")); - list.add(new DecNumber(buffer, offset + 252, 1, "Quick spell 9 class")); + list.add(new ResourceRef(buffer, offset + 172, "Quick spell 1", "SPL")); + list.add(new ResourceRef(buffer, offset + 180, "Quick spell 2", "SPL")); + list.add(new ResourceRef(buffer, offset + 188, "Quick spell 3", "SPL")); + list.add(new ResourceRef(buffer, offset + 196, "Quick spell 4", "SPL")); + list.add(new ResourceRef(buffer, offset + 204, "Quick spell 5", "SPL")); + list.add(new ResourceRef(buffer, offset + 212, "Quick spell 6", "SPL")); + list.add(new ResourceRef(buffer, offset + 220, "Quick spell 7", "SPL")); + list.add(new ResourceRef(buffer, offset + 228, "Quick spell 8", "SPL")); + list.add(new ResourceRef(buffer, offset + 236, "Quick spell 9", "SPL")); + list.add(new IdsBitmap(buffer, offset + 244, 1, "Quick spell 1 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 245, 1, "Quick spell 2 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 246, 1, "Quick spell 3 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 247, 1, "Quick spell 4 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 248, 1, "Quick spell 5 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 249, 1, "Quick spell 6 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 250, 1, "Quick spell 7 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 251, 1, "Quick spell 8 class", "CLASS.IDS")); + list.add(new IdsBitmap(buffer, offset + 252, 1, "Quick spell 9 class", "CLASS.IDS")); list.add(new Unknown(buffer, offset + 253, 1)); list.add(new IdsBitmap(buffer, offset + 254, 2, "Quick item slot 1", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 256, 2, "Quick item slot 2", "SLOTS.IDS")); @@ -283,33 +283,33 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { list.add(new HashBitmap(buffer, offset + 260, 2, "Show quick item 1?", m_partyslot)); list.add(new HashBitmap(buffer, offset + 262, 2, "Show quick item 2?", m_partyslot)); list.add(new HashBitmap(buffer, offset + 264, 2, "Show quick item 3?", m_partyslot)); - list.add(new TextString(buffer, offset + 266, 8, "Quick ability 1")); - list.add(new TextString(buffer, offset + 274, 8, "Quick ability 2")); - list.add(new TextString(buffer, offset + 282, 8, "Quick ability 3")); - list.add(new TextString(buffer, offset + 290, 8, "Quick ability 4")); - list.add(new TextString(buffer, offset + 298, 8, "Quick ability 5")); - list.add(new TextString(buffer, offset + 306, 8, "Quick ability 6")); - list.add(new TextString(buffer, offset + 314, 8, "Quick ability 7")); - list.add(new TextString(buffer, offset + 322, 8, "Quick ability 8")); - list.add(new TextString(buffer, offset + 330, 8, "Quick ability 9")); - list.add(new TextString(buffer, offset + 338, 8, "Quick song 1")); - list.add(new TextString(buffer, offset + 346, 8, "Quick song 2")); - list.add(new TextString(buffer, offset + 354, 8, "Quick song 3")); - list.add(new TextString(buffer, offset + 362, 8, "Quick song 4")); - list.add(new TextString(buffer, offset + 370, 8, "Quick song 5")); - list.add(new TextString(buffer, offset + 378, 8, "Quick song 6")); - list.add(new TextString(buffer, offset + 386, 8, "Quick song 7")); - list.add(new TextString(buffer, offset + 394, 8, "Quick song 8")); - list.add(new TextString(buffer, offset + 402, 8, "Quick song 9")); - list.add(new DecNumber(buffer, offset + 410, 4, "Quick slot 1")); - list.add(new DecNumber(buffer, offset + 414, 4, "Quick slot 2")); - list.add(new DecNumber(buffer, offset + 418, 4, "Quick slot 3")); - list.add(new DecNumber(buffer, offset + 422, 4, "Quick slot 4")); - list.add(new DecNumber(buffer, offset + 426, 4, "Quick slot 5")); - list.add(new DecNumber(buffer, offset + 430, 4, "Quick slot 6")); - list.add(new DecNumber(buffer, offset + 434, 4, "Quick slot 7")); - list.add(new DecNumber(buffer, offset + 438, 4, "Quick slot 8")); - list.add(new DecNumber(buffer, offset + 442, 4, "Quick slot 9")); + list.add(new ResourceRef(buffer, offset + 266, "Quick ability 1", "SPL")); + list.add(new ResourceRef(buffer, offset + 274, "Quick ability 2", "SPL")); + list.add(new ResourceRef(buffer, offset + 282, "Quick ability 3", "SPL")); + list.add(new ResourceRef(buffer, offset + 290, "Quick ability 4", "SPL")); + list.add(new ResourceRef(buffer, offset + 298, "Quick ability 5", "SPL")); + list.add(new ResourceRef(buffer, offset + 306, "Quick ability 6", "SPL")); + list.add(new ResourceRef(buffer, offset + 314, "Quick ability 7", "SPL")); + list.add(new ResourceRef(buffer, offset + 322, "Quick ability 8", "SPL")); + list.add(new ResourceRef(buffer, offset + 330, "Quick ability 9", "SPL")); + list.add(new ResourceRef(buffer, offset + 338, "Quick song 1", "SPL")); + list.add(new ResourceRef(buffer, offset + 346, "Quick song 2", "SPL")); + list.add(new ResourceRef(buffer, offset + 354, "Quick song 3", "SPL")); + list.add(new ResourceRef(buffer, offset + 362, "Quick song 4", "SPL")); + list.add(new ResourceRef(buffer, offset + 370, "Quick song 5", "SPL")); + list.add(new ResourceRef(buffer, offset + 378, "Quick song 6", "SPL")); + list.add(new ResourceRef(buffer, offset + 386, "Quick song 7", "SPL")); + list.add(new ResourceRef(buffer, offset + 394, "Quick song 8", "SPL")); + list.add(new ResourceRef(buffer, offset + 402, "Quick song 9", "SPL")); + list.add(new DecNumber(buffer, offset + 410, 4, "Quick button 1")); + list.add(new DecNumber(buffer, offset + 414, 4, "Quick button 2")); + list.add(new DecNumber(buffer, offset + 418, 4, "Quick button 3")); + list.add(new DecNumber(buffer, offset + 422, 4, "Quick button 4")); + list.add(new DecNumber(buffer, offset + 426, 4, "Quick button 5")); + list.add(new DecNumber(buffer, offset + 430, 4, "Quick button 6")); + list.add(new DecNumber(buffer, offset + 434, 4, "Quick button 7")); + list.add(new DecNumber(buffer, offset + 438, 4, "Quick button 8")); + list.add(new DecNumber(buffer, offset + 442, 4, "Quick button 9")); list.add(new TextString(buffer, offset + 446, 32, "Name")); list.add(new Unknown(buffer, offset + 478, 4)); offset = readCharStats(buffer, offset + 482); diff --git a/infinity/resource/itm/Ability.java b/infinity/resource/itm/Ability.java index 345327e..c15fe26 100644 --- a/infinity/resource/itm/Ability.java +++ b/infinity/resource/itm/Ability.java @@ -15,7 +15,7 @@ final class Ability extends AbstractAbility implements AddRemovable, HasAddRemov private static final String[] s_yesno = {"No", "Yes"}; private static final String[] s_drain = {"Item remains", "Item vanishes", "Replace with used up", "Item recharges"}; private static final String[] s_launcher = {"None", "Bow", "Crossbow", "Sling"}; - private static final String[] s_abilityuse = {"", "Weapon slots", "", "Item slots", "Gem"}; + private static final String[] s_abilityuse = {"", "Weapon slots", "", "Item slots", "Gem?"}; private static final String[] s_recharge = {"No flags set", "Add strength bonus", "Breakable", "", "", "", "", "", "", "", "", "Hostile", "Recharge after resting", "", "", "", "", "Bypass armor", "Keen edge"}; diff --git a/infinity/resource/itm/ItmResource.java b/infinity/resource/itm/ItmResource.java index 1f9165d..f75bd5e 100644 --- a/infinity/resource/itm/ItmResource.java +++ b/infinity/resource/itm/ItmResource.java @@ -24,7 +24,7 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd "Spears", "Halberds", "Bolts", "Cloaks and robes", "Gold pieces", "Gems", "Wands", "Containers", "Books", "Familiars", "Tattoos", "Lenses", "Bucklers", - "Candles", "Child bodies", "Clubs", "Female bodies", "", + "Candles", "Child bodies", "Clubs", "Female bodies", "Keys (old)", "Large shields", "Male bodies", "Medium shields", "Notes", "Rods", "Skulls", "Small shields", "Spider bodies", "Telescopes", "Bottles", "Greatswords", "Bags", @@ -43,7 +43,7 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd "Earrings", "Tattoos", "Lenses", "Teeth"}; private static final String[] s_flags = {"None", "Unsellable", "Two-handed", "Droppable", "Displayable", - "Cursed", "Not copyable", "Magical", "Bow", "Silver", "Gold", "Stolen", "Conversable"}; + "Cursed", "Not copyable", "Magical", "Bow", "Silver", "Cold iron", "", "Conversable"}; private static final String[] s_flags11 = {"None", "Unsellable", "Two-handed", "Droppable", "Displayable", "Cursed", "Not copyable", "Magical", "", "Silver", "Cold iron", "Steel", "Conversable", @@ -55,13 +55,13 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd "Fighter-Mage", "Fighter-Cleric", "Fighter-Mage-Cleric", "Fighter-Mage-Thief", "Fighter-Thief", "Mage", "Mage-Thief", "Paladin", "Ranger", "Thief", "Elf", "Dwarf", "Half-Elf", - "Halfling", "Human", "Gnome", "Monk", "Druid", "Half-Orc"}; + "Halfling", "Human", "Gnome", "Monk", "Druid"}; private static final String[] s_usability11 = {"None", "Chaotic", "Evil", "Good", "... Neutral", "Lawful", "Neutral ...", "Sensate", "Priest", "Godsman", "Anarchist", "Xaositect", "Fighter", "Non-aligned", "Fighter-Mage", "Dustman", - "Mercykiller", "Idep", "Figher-Thief", "Mage", + "Mercykiller", "Indep", "Figher-Thief", "Mage", "Mage-Thief", "Dak'kon", "Fall-From-Grace", "Thief", "Vhailor", "Ignus", "Morte", "Nordom", "Human", "Annah", "", "Nameless One", "" @@ -72,8 +72,8 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd "Rogue", "Sorcerer", "Wizard", "", "Chaotic", "Evil", "Good", "... Neutral", "Lawful", "Neutral ...", "", "", - "", "", "", "", - "Dwarf", "", "", "" + "", "", "", "Elf", + "Dwarf", "Half-elf", "Halfling", "Human", "Gnome" }; private static final String[] s_kituse1 = {"None", "Cleric of talos", "Cleric of helm", "Cleric of lathander", @@ -267,7 +267,10 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, 46, 1, "Minimum wisdom")); list.add(new Flag(buffer, 47, 1, "Unusable by (4/4)", s_kituse4)); list.add(new DecNumber(buffer, 48, 1, "Minimum constitution")); - list.add(new IdsBitmap(buffer, 49, 1, "Weapon proficiency", "STATS.IDS")); + if (ResourceFactory.getInstance().resourceExists("PROFTYPE.IDS")) + list.add(new IdsBitmap(buffer, 49, 1, "Weapon proficiency", "PROFTYPE.IDS")); + else + list.add(new IdsBitmap(buffer, 49, 1, "Weapon proficiency", "STATS.IDS")); } else { list.add(new DecNumber(buffer, 40, 2, "Minimum strength bonus")); diff --git a/infinity/resource/other/ProResource.java b/infinity/resource/other/ProResource.java index baf187f..6898a82 100644 --- a/infinity/resource/other/ProResource.java +++ b/infinity/resource/other/ProResource.java @@ -28,7 +28,7 @@ public final class ProResource extends AbstractStruct implements Resource "Not affecting enemies"}; private static final String[] s_flags = { "No flags set", "Colored BAM", "Creates smoke", "", "Darken", "", "Casts shadow", - "Light spot enabled", "Translucent" + "Light spot enabled", "Translucent", "", "Blended" }; private static final String[] s_behave = {"No flags set", "Show sparks", "3D traveling", "Loop sound 1", "Loop sound 2", "Ignore center"}; @@ -100,7 +100,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new ColorValue(buffer, offset + 304, 1, "Smoke color 5")); list.add(new ColorValue(buffer, offset + 305, 1, "Smoke color 6")); list.add(new ColorValue(buffer, offset + 306, 1, "Smoke color 7")); - list.add(new HexNumber(buffer, offset + 307, 1, "Face target?")); + list.add(new DecNumber(buffer, offset + 307, 1, "# orientations")); // new Flag(buffer, offset + 307, 1, "Aim to target", // new String[]{"No flags set", "", "", "Face target"})); list.add(new IdsBitmap(buffer, offset + 308, 2, "Smoke animation", "ANIMATE.IDS")); diff --git a/infinity/resource/other/VvcResource.java b/infinity/resource/other/VvcResource.java index f3c96b2..d5f2f5a 100644 --- a/infinity/resource/other/VvcResource.java +++ b/infinity/resource/other/VvcResource.java @@ -11,11 +11,16 @@ public final class VvcResource extends AbstractStruct implements Resource { - private static final String s_transparency[] = {"No flags set", "", "Transparent", "", "Translucent"}; - private static final String s_tint[] = {"No flags set", "", "Blend", "", "Grayscale", "", "Brighten", - "", "", "", "Sepia"}; - private static final String s_seq[] = {"No flags set", "Looping", "", "", "Draw animation", "", "", - "Not covered by wall"}; + private static final String s_transparency[] = {"No flags set", "Transparent", "Translucent", "Translucent shadow", "Blended", + "Mirror X axis", "Mirror Y axis", "Clipped", "Copy from back", "Clear fill", + "3D blend", "Not covered by wall", "Persist through time stop", "Ignore dream palette", + "2D blend"}; + private static final String s_tint[] = {"No flags set", "Not light source", "Light source", "Internal brightness", "Time stopped", "", + "Internal gamma", "Non-reserved palette", "Full palette", "", "Dream palette"}; + private static final String s_seq[] = {"No flags set", "Looping", "Special lighting", "Modify for height", "Draw animation", "Custom palette", + "Purgeable", "Not covered by wall", "High-level brighten", "Mid-level brighten"}; + private static final String s_face[] = {"Use current", "Orbit parent", "Parent orientation", "", "Ignore orientation"}; + private static final String s_noyes[] = {"No", "Yes"}; public VvcResource(ResourceEntry entry) throws Exception { @@ -27,7 +32,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new TextString(buffer, offset, 4, "Signature")); list.add(new TextString(buffer, offset + 4, 4, "Version")); list.add(new ResourceRef(buffer, offset + 8, "Animation", "BAM")); - list.add(new Unknown(buffer, offset + 16, 8)); + list.add(new ResourceRef(buffer, offset + 16, "Shadow", "BAM")); list.add(new Flag(buffer, offset + 24, 2, "Drawing", s_transparency)); list.add(new Flag(buffer, offset + 26, 2, "Color adjustment", s_tint)); list.add(new Unknown(buffer, offset + 28, 4)); @@ -35,28 +40,28 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new Unknown(buffer, offset + 36, 4)); list.add(new DecNumber(buffer, offset + 40, 4, "Position: X")); list.add(new DecNumber(buffer, offset + 44, 4, "Position: Y")); - list.add(new Unknown(buffer, offset + 48, 4)); + list.add(new Bitmap(buffer, offset + 48, 4, "Draw oriented", s_noyes)); list.add(new DecNumber(buffer, offset + 52, 4, "Frame rate")); - list.add(new HexNumber(buffer, offset + 56, 4, "Face target?")); - list.add(new Unknown(buffer, offset + 60, 4)); - list.add(new HexNumber(buffer, offset + 64, 4, "Positioning")); - list.add(new Unknown(buffer, offset + 68, 4)); - list.add(new Unknown(buffer, offset + 72, 4)); + list.add(new DecNumber(buffer, offset + 56, 4, "# orientations")); + list.add(new DecNumber(buffer, offset + 60, 4, "Primary orientation")); + list.add(new Flag(buffer, offset + 64, 4, "Travel orientation", s_face)); + list.add(new ResourceRef(buffer, offset + 68, "Palette", "BMP")); +// list.add(new Unknown(buffer, offset + 72, 4)); list.add(new DecNumber(buffer, offset + 76, 4, "Position: Z")); - list.add(new Unknown(buffer, offset + 80, 4)); - list.add(new Unknown(buffer, offset + 84, 4)); - list.add(new Unknown(buffer, offset + 88, 4)); + list.add(new DecNumber(buffer, offset + 80, 4, "Center point: X")); + list.add(new DecNumber(buffer, offset + 84, 4, "Center point: Y")); + list.add(new DecNumber(buffer, offset + 88, 4, "Light spot intensity")); list.add(new DecNumber(buffer, offset + 92, 4, "Duration (frames)")); - list.add(new Unknown(buffer, offset + 96, 4)); - list.add(new Unknown(buffer, offset + 100, 4)); + list.add(new Unknown(buffer, offset + 96, 8)); +// list.add(new Unknown(buffer, offset + 100, 4)); list.add(new DecNumber(buffer, offset + 104, 4, "First animation number")); list.add(new DecNumber(buffer, offset + 108, 4, "Second animation number")); - list.add(new Unknown(buffer, offset + 112, 4)); - list.add(new Unknown(buffer, offset + 116, 4)); + list.add(new DecNumber(buffer, offset + 112, 4, "Current animation number")); + list.add(new Bitmap(buffer, offset + 116, 4, "Continuous playback", s_noyes)); list.add(new ResourceRef(buffer, offset + 120, "Starting sound", "WAV")); list.add(new ResourceRef(buffer, offset + 128, "Duration sound", "WAV")); - list.add(new Unknown(buffer, offset + 136, 4)); - list.add(new Unknown(buffer, offset + 140, 4)); + list.add(new Unknown(buffer, offset + 136, 8)); +// list.add(new Unknown(buffer, offset + 140, 4)); list.add(new DecNumber(buffer, offset + 144, 4, "Third animation number")); list.add(new ResourceRef(buffer, offset + 148, "Ending sound", "WAV")); list.add(new Unknown(buffer, offset + 156, 336)); diff --git a/infinity/resource/sto/ItemSale11.java b/infinity/resource/sto/ItemSale11.java index 5e81477..01b1a00 100644 --- a/infinity/resource/sto/ItemSale11.java +++ b/infinity/resource/sto/ItemSale11.java @@ -34,8 +34,8 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 20, 4, "# in stock")); list.add(new Bitmap(buffer, offset + 24, 4, "Infinite supply?", s_noyes)); list.add(new StringRef(buffer, offset + 28, "Sale trigger")); - list.add(new Unknown(buffer, offset + 32, 44)); - list.add(new Unknown(buffer, offset + 76, 12)); + list.add(new Unknown(buffer, offset + 32, 56)); +// list.add(new Unknown(buffer, offset + 76, 12)); return offset + 88; } } diff --git a/infinity/resource/wmp/AreaEntry.java b/infinity/resource/wmp/AreaEntry.java index 2071386..eb54b29 100644 --- a/infinity/resource/wmp/AreaEntry.java +++ b/infinity/resource/wmp/AreaEntry.java @@ -45,7 +45,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new TextString(buffer, offset + 8, 8, "Area name")); list.add(new TextString(buffer, offset + 16, 32, "Script name")); list.add(new Flag(buffer, offset + 48, 4, "Flags", s_flag)); - list.add(new DecNumber(buffer, offset + 52, 4, "BAM animation number")); + list.add(new DecNumber(buffer, offset + 52, 4, "Icon number")); list.add(new DecNumber(buffer, offset + 56, 4, "Coordinate: X")); list.add(new DecNumber(buffer, offset + 60, 4, "Coordinate: Y")); list.add(new StringRef(buffer, offset + 64, "Name")); diff --git a/infinity/resource/wmp/ViewerArea.java b/infinity/resource/wmp/ViewerArea.java index 5acf50d..e5e11c0 100644 --- a/infinity/resource/wmp/ViewerArea.java +++ b/infinity/resource/wmp/ViewerArea.java @@ -38,7 +38,7 @@ private static JPanel makeInfoPanel(AreaEntry areaEntry) JPanel infoPane = makeInfoPanel(areaEntry); JComponent icon = ViewerUtil.makeBamPanel( (ResourceRef)areaEntry.getSuperStruct().getAttribute("Map icons"), - ((DecNumber)areaEntry.getAttribute("BAM animation number")).getValue(), + ((DecNumber)areaEntry.getAttribute("Icon number")).getValue(), 0); JPanel linkPanelN = ViewerUtil.makeListPanel("North links", areaEntry, AreaLinkNorth.class, "Target entrance"); JPanel linkPanelS = ViewerUtil.makeListPanel("South links", areaEntry, AreaLinkSouth.class, "Target entrance"); diff --git a/infinity/resource/wmp/ViewerMap.java b/infinity/resource/wmp/ViewerMap.java index d17d2ba..81d70bf 100644 --- a/infinity/resource/wmp/ViewerMap.java +++ b/infinity/resource/wmp/ViewerMap.java @@ -84,7 +84,7 @@ public Component getListCellRendererComponent(JList list, Object value, int inde JLabel label = (JLabel)super.getListCellRendererComponent(list, value, index, isSelected, cellHasFocus); AbstractStruct struct = (AbstractStruct)value; label.setText(struct.getAttribute("Name").toString()); - DecNumber animNr = (DecNumber)struct.getAttribute("BAM animation number"); + DecNumber animNr = (DecNumber)struct.getAttribute("Icon number"); setIcon(null); if (icons != null) setIcon(new ImageIcon(icons.getFrame(icons.getFrameNr(animNr.getValue(), 0)))); From 0eedd8d03c85460546a8bc98b2488fb72717132b Mon Sep 17 00:00:00 2001 From: Taimon Date: Sun, 19 Dec 2010 21:32:30 +0800 Subject: [PATCH 05/37] devSin merge --- infinity/datatype/EffectType.java | 2 +- infinity/resource/EffectFactory.java | 47 +++++++++++++++--------- infinity/resource/are/Door.java | 4 +- infinity/resource/chu/Control.java | 7 +++- infinity/resource/chu/Window.java | 3 +- infinity/resource/other/ProResource.java | 23 +++++++----- infinity/resource/other/VvcResource.java | 4 +- infinity/resource/other/WfxResource.java | 10 +++-- 8 files changed, 61 insertions(+), 39 deletions(-) diff --git a/infinity/datatype/EffectType.java b/infinity/datatype/EffectType.java index 69df07c..5a146b3 100644 --- a/infinity/datatype/EffectType.java +++ b/infinity/datatype/EffectType.java @@ -21,7 +21,7 @@ public final class EffectType extends Bitmap "Instant/While equipped", "Delay/Limited", "Delay/Permanent", "Delay/While equipped", "Limited after duration", "Permanent after duration", "Equipped after duration", - "Instant/Permanent", "Trigger"}; + "Instant/Permanent", "Instant/Limited (ticks)"}; private int attr_length; public EffectType(byte buffer[], int offset, int length) diff --git a/infinity/resource/EffectFactory.java b/infinity/resource/EffectFactory.java index 373891e..51589cd 100644 --- a/infinity/resource/EffectFactory.java +++ b/infinity/resource/EffectFactory.java @@ -216,7 +216,7 @@ private EffectFactory() "Change AI type", "Attack damage bonus", "Blindness", "Cure blindness", "Feeblemindedness", "Cure feeblemindedness", "Disease", "Cure disease", "Deafness", "Cure deafness", - "Set AI script", "Immunity to projectile", + "Rush morte", "Immunity to projectile", "Magical fire resistance bonus", "Magical cold resistance bonus", "Slashing resistance bonus", "Crushing resistance bonus", "Piercing resistance bonus", "Missile resistance bonus", @@ -968,12 +968,6 @@ public String makeEffectStruct(byte buffer[], int offset, List s, i "Gender", "Alignment"})); break; - case 0x52: // Set AI script (CGameEffectSetAIScript) - s.add(new Unknown(buffer, offset, 4)); - s.add(new IdsBitmap(buffer, offset + 4, 4, "Script level", "SCRLEV.IDS")); - restype = "BCS"; - break; - case 0x53: // Immunity to projectile (CGameEffectImmunityToProjectile) s.add(new Unknown(buffer, offset, 4)); if (ResourceFactory.getInstance().resourceExists("PROJECTL.IDS")) @@ -1286,6 +1280,12 @@ else if (ResourceFactory.getInstance().resourceExists("SEQ.IDS")) "Slow target"})); break; + case 0x52: // Set AI script (CGameEffectSetAIScript) + s.add(new Unknown(buffer, offset, 4)); + s.add(new IdsBitmap(buffer, offset + 4, 4, "Script level", "SCRLEV.IDS")); + restype = "BCS"; + break; + case 0x62: // Regeneration (CGameEffectRegeneration) s.add(new DecNumber(buffer, offset, 4, "Value")); s.add(new Bitmap(buffer, offset + 4, 4, "Regeneration type", @@ -1446,7 +1446,7 @@ else if (gameid == ResourceFactory.ID_TORMENT) { break; case 0xBA: // Set status - s.add(new Unknown(buffer, offset, 4)); + s.add(new Bitmap(buffer, offset, 4, "Action", new String[]{"Clear", "Set"})); s.add(new IdsFlag(buffer, offset + 4, 4, "State", "STATE.IDS")); break; @@ -1496,8 +1496,7 @@ else if (gameid == ResourceFactory.ID_TORMENT) { s.add(new UnsignDecNumber(buffer, offset + 1, 1, "Green")); s.add(new UnsignDecNumber(buffer, offset + 2, 1, "Blue")); s.add(new Unknown(buffer, offset + 3, 1)); - s.add(new Bitmap(buffer, offset + 4, 4, "Flash type", - new String[]{"Delayed", "Instant"})); + s.add(new Unknown(buffer, offset + 4, 4)); break; case 0xC3: // Tint screen @@ -1505,12 +1504,7 @@ else if (gameid == ResourceFactory.ID_TORMENT) { s.add(new UnsignDecNumber(buffer, offset + 1, 1, "Green")); s.add(new UnsignDecNumber(buffer, offset + 2, 1, "Blue")); s.add(new Unknown(buffer, offset + 3, 1)); - s.add(new Bitmap(buffer, offset + 4, 4, "Method", - new String[]{"Quick to dark then back", "", - "Quick to dark then instant light", "", - "Light to dark for duration", "", "", "", "No effect", - "Very fast light to dark then back", - "Instant dark duration then instant light"})); + s.add(new DecNumber(buffer, offset + 4, 4, "Method")); break; case 0xC4: // Special spell hit @@ -1654,6 +1648,12 @@ else if (gameid == ResourceFactory.ID_ICEWIND || "Slow target", "Mold touch"})); break; + case 0x52: // Set AI script + s.add(new Unknown(buffer, offset, 4)); + s.add(new IdsBitmap(buffer, offset + 4, 4, "Script level", "SCRLEV.IDS")); + restype = "BCS"; + break; + case 0x62: // Regeneration s.add(new DecNumber(buffer, offset, 4, "Value")); s.add(new Bitmap(buffer, offset + 4, 4, "Regeneration type", @@ -1990,6 +1990,12 @@ else if (gameid == ResourceFactory.ID_BG2 || "Slow target"})); break; + case 0x52: // Set AI script (CGameEffectSetAIScript) + s.add(new Unknown(buffer, offset, 4)); + s.add(new IdsBitmap(buffer, offset + 4, 4, "Script level", "SCRLEV.IDS")); + restype = "BCS"; + break; + case 0x62: // Regeneration (CGameEffectRegeneration) s.add(new DecNumber(buffer, offset, 4, "Value")); s.add(new Bitmap(buffer, offset + 4, 4, "Regeneration type", @@ -2207,7 +2213,8 @@ else if (gameid == ResourceFactory.ID_BG2 || case 0xEB: // Wing buffet (CGameEffectPushPull) s.add(new DecNumber(buffer, offset, 4, "Distance")); s.add(new Bitmap(buffer, offset + 4, 4, "Direction", - new String[]{"", "", "Away from source", "", "Toward source"})); + new String[]{"", "Away from target point", "Away from source", + "Toward target point", "Toward source"})); break; case 0xEC: // Project image (CGameEffectCopySelf) @@ -2507,6 +2514,12 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { "Cloud of pestilence", "Dolorous decay"})); break; + case 0x52: // Set AI script + s.add(new Unknown(buffer, offset, 4)); + s.add(new IdsBitmap(buffer, offset + 4, 4, "Script level", "SCRLEV.IDS")); + restype = "BCS"; + break; + case 0x62: // Regeneration s.add(new DecNumber(buffer, offset, 4, "Value")); s.add(new Bitmap(buffer, offset + 4, 4, "Regeneration type", diff --git a/infinity/resource/are/Door.java b/infinity/resource/are/Door.java index d9d0e83..25c6c20 100644 --- a/infinity/resource/are/Door.java +++ b/infinity/resource/are/Door.java @@ -12,8 +12,8 @@ public final class Door extends AbstractStruct implements AddRemovable, HasVerti { private static final String[] s_yesno = {"No", "Yes"}; private static final String[] s_flag = {"No flags set", "Door open", "Door locked", "Trap resets", - "Detectable trap", "Door forced", "", "", "Door secret", - "Secret door detected", "Can be looked through", + "Detectable trap", "Door forced", "Cannot close", "Door located", + "Door secret", "Secret door detected", "Can be looked through", "Uses key", "Sliding door"}; private static final String[] s_flag_iwd2 = {"No flags set", "Door open", "Door locked", "Trap resets", "Detectable trap", "Door forced", "Cannot close", "Door located", diff --git a/infinity/resource/chu/Control.java b/infinity/resource/chu/Control.java index 9e9d080..fb054d0 100644 --- a/infinity/resource/chu/Control.java +++ b/infinity/resource/chu/Control.java @@ -16,7 +16,7 @@ final class Control extends AbstractStruct // implements AddRemovable "Label", "Scroll bar"}; private static final String s_button[] = {"Center", "Left justify", "Right justify", "Top justify", "Bottom justify", "Anchor", - "Reduce size"}; + "Reduce size", "Don't wrap"}; private static final String s_label[] = {"Center", "RGB color", "", "", "Left justify", "Right justify"}; private static final String s_case[] = {"Normal case", "Upper case only", "Lower case only"}; @@ -87,7 +87,10 @@ public int readControl(byte buffer[]) list.add(new DecNumber(buffer, offset + 38, 2, "Knob position: Y")); list.add(new DecNumber(buffer, offset + 40, 2, "Step width")); list.add(new DecNumber(buffer, offset + 42, 2, "Step count")); - list.add(new Unknown(buffer, offset + 44, 8)); + list.add(new DecNumber(buffer, offset + 44, 2, "Slider region: Top")); + list.add(new DecNumber(buffer, offset + 46, 2, "Slider region: Bottom")); + list.add(new DecNumber(buffer, offset + 48, 2, "Slider region: Left")); + list.add(new DecNumber(buffer, offset + 50, 2, "Slider region: Right")); offset += 52; break; case 3: diff --git a/infinity/resource/chu/Window.java b/infinity/resource/chu/Window.java index a252c06..a417117 100644 --- a/infinity/resource/chu/Window.java +++ b/infinity/resource/chu/Window.java @@ -15,6 +15,7 @@ final class Window extends AbstractStruct // implements AddRemovable { private static final String hasb[] = {"No", "Yes"}; + private static final String s_flag[] = {"No flags set", "Don't dim background"}; Window() throws Exception { @@ -91,7 +92,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new UnsignDecNumber(buffer, offset + 14, 2, "# controls")); list.add(new ResourceRef(buffer, offset + 16, "Background image", "MOS")); list.add(new UnsignDecNumber(buffer, offset + 24, 2, "First control index")); - list.add(new Unknown(buffer, offset + 26, 2)); + list.add(new Flag(buffer, offset + 26, 2, "Flags", s_flag)); return offset + 28; } } diff --git a/infinity/resource/other/ProResource.java b/infinity/resource/other/ProResource.java index 6898a82..bd5f13f 100644 --- a/infinity/resource/other/ProResource.java +++ b/infinity/resource/other/ProResource.java @@ -27,12 +27,15 @@ public final class ProResource extends AbstractStruct implements Resource "No overlapping effects", "Secondary projectile", "Fragments", "Not affecting allies", "Not affecting enemies"}; private static final String[] s_flags = { - "No flags set", "Colored BAM", "Creates smoke", "", "Darken", "", "Casts shadow", - "Light spot enabled", "Translucent", "", "Blended" + "No flags set", "Colored BAM", "Creates smoke", "", "Not light source", "Modify for height", + "Casts shadow", "Light spot enabled", "Translucent", "Mid-level brighten", "Blended" }; private static final String[] s_behave = {"No flags set", "Show sparks", "3D traveling", - "Loop sound 1", "Loop sound 2", "Ignore center"}; - private static final String[] s_areatype = {"Round", "", "", "Draw animation", "Cone-shaped"}; + "Loop sound 1", "Loop sound 2", "Ignore center", + "Draw as background"}; + private static final String[] s_areatype = {"Round", "Mage level duration", "Cleric level duration", + "Draw animation", "Cone-shaped", "Non-clipped explosion", + "Delayed explosion", "Skip first condition", "Single target"}; static { s_proj.put(0L, "Fireball"); @@ -73,7 +76,7 @@ protected int read(byte buffer[], int offset) throws Exception // list.add(new Unknown(buffer, offset + 14, 2)); list.add(new ResourceRef(buffer, offset + 16, "Sound 1", "WAV")); list.add(new ResourceRef(buffer, offset + 24, "Sound 2", "WAV")); - list.add(new ResourceRef(buffer, offset + 32, "Sound 3", "WAV")); + list.add(new ResourceRef(buffer, offset + 32, "Source animation", "BAM")); list.add(new Bitmap(buffer, offset + 40, 4, "Particle color", s_color)); list.add(new Unknown(buffer, offset + 44, 212)); list.add(new Flag(buffer, offset + 256, 4, "Flags", s_flags)); @@ -107,9 +110,9 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new ResourceRef(buffer, offset + 310, "Trailing animation 1", "BAM")); list.add(new ResourceRef(buffer, offset + 318, "Trailing animation 2", "BAM")); list.add(new ResourceRef(buffer, offset + 326, "Trailing animation 3", "BAM")); - list.add(new DecNumber(buffer, offset + 334, 2, "Tailing animation number 1")); - list.add(new DecNumber(buffer, offset + 336, 2, "Tailing animation number 2")); - list.add(new DecNumber(buffer, offset + 338, 2, "Tailing animation number 3")); + list.add(new DecNumber(buffer, offset + 334, 2, "Tailing animation delay 1")); + list.add(new DecNumber(buffer, offset + 336, 2, "Tailing animation delay 2")); + list.add(new DecNumber(buffer, offset + 338, 2, "Tailing animation delay 3")); list.add(new Unknown(buffer, offset + 340, 172)); if (projtype.getValue() != 3) return offset + 512; @@ -125,8 +128,8 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new ProRef(buffer, offset + 532, "Secondary projectile")); list.add(new DecNumber(buffer, offset + 534, 1, "Duration")); list.add(new HashBitmap(buffer, offset + 535, 1, "Explosion effect", s_proj)); - list.add(new ColorValue(buffer, offset + 536, 2, "Explosion color")); -// list.add(new Unknown(buffer, offset + 537, 1)); + list.add(new ColorValue(buffer, offset + 536, 1, "Explosion color")); + list.add(new Unknown(buffer, offset + 537, 1)); list.add(new ProRef(buffer, offset + 538, "Explosion projectile")); list.add(new ResourceRef(buffer, offset + 540, "Explosion animation", "VVC")); list.add(new DecNumber(buffer, offset + 548, 2, "Cone width")); diff --git a/infinity/resource/other/VvcResource.java b/infinity/resource/other/VvcResource.java index d5f2f5a..7d99ef9 100644 --- a/infinity/resource/other/VvcResource.java +++ b/infinity/resource/other/VvcResource.java @@ -18,7 +18,7 @@ public final class VvcResource extends AbstractStruct implements Resource private static final String s_tint[] = {"No flags set", "Not light source", "Light source", "Internal brightness", "Time stopped", "", "Internal gamma", "Non-reserved palette", "Full palette", "", "Dream palette"}; private static final String s_seq[] = {"No flags set", "Looping", "Special lighting", "Modify for height", "Draw animation", "Custom palette", - "Purgeable", "Not covered by wall", "High-level brighten", "Mid-level brighten"}; + "Purgeable", "Not covered by wall", "Mid-level brighten", "High-level brighten"}; private static final String s_face[] = {"Use current", "Orbit parent", "Parent orientation", "", "Ignore orientation"}; private static final String s_noyes[] = {"No", "Yes"}; @@ -50,7 +50,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 76, 4, "Position: Z")); list.add(new DecNumber(buffer, offset + 80, 4, "Center point: X")); list.add(new DecNumber(buffer, offset + 84, 4, "Center point: Y")); - list.add(new DecNumber(buffer, offset + 88, 4, "Light spot intensity")); + list.add(new DecNumber(buffer, offset + 88, 4, "Light spot brightness")); list.add(new DecNumber(buffer, offset + 92, 4, "Duration (frames)")); list.add(new Unknown(buffer, offset + 96, 8)); // list.add(new Unknown(buffer, offset + 100, 4)); diff --git a/infinity/resource/other/WfxResource.java b/infinity/resource/other/WfxResource.java index 10b3439..2307e8a 100644 --- a/infinity/resource/other/WfxResource.java +++ b/infinity/resource/other/WfxResource.java @@ -11,7 +11,8 @@ public final class WfxResource extends AbstractStruct implements Resource { - private static final String s_flag[] = {"No flags set", "", "", "Pitch variance"}; + private static final String s_flag[] = {"No flags set", "Cutscene audio", "Alternate SR curve", + "Pitch variance", "Volume variance", "Disable environmental effects"}; public WfxResource(ResourceEntry entry) throws Exception { @@ -22,10 +23,11 @@ protected int read(byte buffer[], int offset) throws Exception { list.add(new TextString(buffer, offset, 4, "Signature")); list.add(new TextString(buffer, offset + 4, 4, "Version")); - list.add(new Unknown(buffer, offset + 8, 4)); + list.add(new DecNumber(buffer, offset + 8, 4, "SR curve radius")); list.add(new Flag(buffer, offset + 12, 4, "Flags", s_flag)); - list.add(new DecNumber(buffer, offset + 16, 4, "Amount")); - list.add(new Unknown(buffer, offset + 20, 244)); + list.add(new DecNumber(buffer, offset + 16, 4, "Pitch variation")); + list.add(new DecNumber(buffer, offset + 20, 4, "Volume variation")); + list.add(new Unknown(buffer, offset + 24, 240)); return offset + 264; } } From 358732e80bb2e16bb817927ffc9d66cc318792a1 Mon Sep 17 00:00:00 2001 From: FredrikLindgren Date: Tue, 17 Apr 2012 15:21:49 +0200 Subject: [PATCH 06/37] Add a .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) create mode 100644 .gitignore diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..6b468b6 --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +*.class From e86d1fba0fd3b0de260a85ead883e2568ca1c89e Mon Sep 17 00:00:00 2001 From: FredrikLindgren Date: Tue, 17 Apr 2012 15:22:06 +0200 Subject: [PATCH 07/37] Fix a bug in the effect index checker --- infinity/check/EffectsIndexChecker.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infinity/check/EffectsIndexChecker.java b/infinity/check/EffectsIndexChecker.java index f196112..cabbdde 100644 --- a/infinity/check/EffectsIndexChecker.java +++ b/infinity/check/EffectsIndexChecker.java @@ -149,7 +149,7 @@ private void search(ResourceEntry entry, AbstractStruct struct) Object o = structList.get(i); if (o instanceof AbstractAbility) { AbstractAbility abil = (AbstractAbility) o; - int effectsIndex = ((DecNumber) abil.getAttribute("Effects index")).getValue(); + int effectsIndex = ((DecNumber) abil.getAttribute("First effect index")).getValue(); if (effectsIndex != expectedEffectsIndex) { hitFrame.addHit(entry, entry.getSearchString(), abil); } From adc67e8c4ee399e66b0e4a5b2bf799d75114bceb Mon Sep 17 00:00:00 2001 From: FredrikLindgren Date: Tue, 17 Apr 2012 15:33:03 +0200 Subject: [PATCH 08/37] Converted all files to LF --- infinity/License.txt | 1008 ++++++++--------- infinity/bsd-license.txt | 62 +- infinity/check/EffectsIndexChecker.java | 320 +++--- infinity/gui/ScriptTextArea.java | 776 ++++++------- .../resource/dlg/DialogItemRefSearcher.java | 254 ++--- 5 files changed, 1210 insertions(+), 1210 deletions(-) diff --git a/infinity/License.txt b/infinity/License.txt index cbee875..ed2098a 100644 --- a/infinity/License.txt +++ b/infinity/License.txt @@ -1,504 +1,504 @@ - GNU LESSER GENERAL PUBLIC LICENSE - Version 2.1, February 1999 - - Copyright (C) 1991, 1999 Free Software Foundation, Inc. - 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - Everyone is permitted to copy and distribute verbatim copies - of this license document, but changing it is not allowed. - -[This is the first released version of the Lesser GPL. It also counts - as the successor of the GNU Library Public License, version 2, hence - the version number 2.1.] - - Preamble - - The licenses for most software are designed to take away your -freedom to share and change it. By contrast, the GNU General Public -Licenses are intended to guarantee your freedom to share and change -free software--to make sure the software is free for all its users. - - This license, the Lesser General Public License, applies to some -specially designated software packages--typically libraries--of the -Free Software Foundation and other authors who decide to use it. You -can use it too, but we suggest you first think carefully about whether -this license or the ordinary General Public License is the better -strategy to use in any particular case, based on the explanations below. - - When we speak of free software, we are referring to freedom of use, -not price. Our General Public Licenses are designed to make sure that -you have the freedom to distribute copies of free software (and charge -for this service if you wish); that you receive source code or can get -it if you want it; that you can change the software and use pieces of -it in new free programs; and that you are informed that you can do -these things. - - To protect your rights, we need to make restrictions that forbid -distributors to deny you these rights or to ask you to surrender these -rights. These restrictions translate to certain responsibilities for -you if you distribute copies of the library or if you modify it. - - For example, if you distribute copies of the library, whether gratis -or for a fee, you must give the recipients all the rights that we gave -you. You must make sure that they, too, receive or can get the source -code. If you link other code with the library, you must provide -complete object files to the recipients, so that they can relink them -with the library after making changes to the library and recompiling -it. And you must show them these terms so they know their rights. - - We protect your rights with a two-step method: (1) we copyright the -library, and (2) we offer you this license, which gives you legal -permission to copy, distribute and/or modify the library. - - To protect each distributor, we want to make it very clear that -there is no warranty for the free library. Also, if the library is -modified by someone else and passed on, the recipients should know -that what they have is not the original version, so that the original -author's reputation will not be affected by problems that might be -introduced by others. - - Finally, software patents pose a constant threat to the existence of -any free program. We wish to make sure that a company cannot -effectively restrict the users of a free program by obtaining a -restrictive license from a patent holder. Therefore, we insist that -any patent license obtained for a version of the library must be -consistent with the full freedom of use specified in this license. - - Most GNU software, including some libraries, is covered by the -ordinary GNU General Public License. This license, the GNU Lesser -General Public License, applies to certain designated libraries, and -is quite different from the ordinary General Public License. We use -this license for certain libraries in order to permit linking those -libraries into non-free programs. - - When a program is linked with a library, whether statically or using -a shared library, the combination of the two is legally speaking a -combined work, a derivative of the original library. The ordinary -General Public License therefore permits such linking only if the -entire combination fits its criteria of freedom. The Lesser General -Public License permits more lax criteria for linking other code with -the library. - - We call this license the "Lesser" General Public License because it -does Less to protect the user's freedom than the ordinary General -Public License. It also provides other free software developers Less -of an advantage over competing non-free programs. These disadvantages -are the reason we use the ordinary General Public License for many -libraries. However, the Lesser license provides advantages in certain -special circumstances. - - For example, on rare occasions, there may be a special need to -encourage the widest possible use of a certain library, so that it becomes -a de-facto standard. To achieve this, non-free programs must be -allowed to use the library. A more frequent case is that a free -library does the same job as widely used non-free libraries. In this -case, there is little to gain by limiting the free library to free -software only, so we use the Lesser General Public License. - - In other cases, permission to use a particular library in non-free -programs enables a greater number of people to use a large body of -free software. For example, permission to use the GNU C Library in -non-free programs enables many more people to use the whole GNU -operating system, as well as its variant, the GNU/Linux operating -system. - - Although the Lesser General Public License is Less protective of the -users' freedom, it does ensure that the user of a program that is -linked with the Library has the freedom and the wherewithal to run -that program using a modified version of the Library. - - The precise terms and conditions for copying, distribution and -modification follow. Pay close attention to the difference between a -"work based on the library" and a "work that uses the library". The -former contains code derived from the library, whereas the latter must -be combined with the library in order to run. - - GNU LESSER GENERAL PUBLIC LICENSE - TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION - - 0. This License Agreement applies to any software library or other -program which contains a notice placed by the copyright holder or -other authorized party saying it may be distributed under the terms of -this Lesser General Public License (also called "this License"). -Each licensee is addressed as "you". - - A "library" means a collection of software functions and/or data -prepared so as to be conveniently linked with application programs -(which use some of those functions and data) to form executables. - - The "Library", below, refers to any such software library or work -which has been distributed under these terms. A "work based on the -Library" means either the Library or any derivative work under -copyright law: that is to say, a work containing the Library or a -portion of it, either verbatim or with modifications and/or translated -straightforwardly into another language. (Hereinafter, translation is -included without limitation in the term "modification".) - - "Source code" for a work means the preferred form of the work for -making modifications to it. For a library, complete source code means -all the source code for all modules it contains, plus any associated -interface definition files, plus the scripts used to control compilation -and installation of the library. - - Activities other than copying, distribution and modification are not -covered by this License; they are outside its scope. The act of -running a program using the Library is not restricted, and output from -such a program is covered only if its contents constitute a work based -on the Library (independent of the use of the Library in a tool for -writing it). Whether that is true depends on what the Library does -and what the program that uses the Library does. - - 1. You may copy and distribute verbatim copies of the Library's -complete source code as you receive it, in any medium, provided that -you conspicuously and appropriately publish on each copy an -appropriate copyright notice and disclaimer of warranty; keep intact -all the notices that refer to this License and to the absence of any -warranty; and distribute a copy of this License along with the -Library. - - You may charge a fee for the physical act of transferring a copy, -and you may at your option offer warranty protection in exchange for a -fee. - - 2. You may modify your copy or copies of the Library or any portion -of it, thus forming a work based on the Library, and copy and -distribute such modifications or work under the terms of Section 1 -above, provided that you also meet all of these conditions: - - a) The modified work must itself be a software library. - - b) You must cause the files modified to carry prominent notices - stating that you changed the files and the date of any change. - - c) You must cause the whole of the work to be licensed at no - charge to all third parties under the terms of this License. - - d) If a facility in the modified Library refers to a function or a - table of data to be supplied by an application program that uses - the facility, other than as an argument passed when the facility - is invoked, then you must make a good faith effort to ensure that, - in the event an application does not supply such function or - table, the facility still operates, and performs whatever part of - its purpose remains meaningful. - - (For example, a function in a library to compute square roots has - a purpose that is entirely well-defined independent of the - application. Therefore, Subsection 2d requires that any - application-supplied function or table used by this function must - be optional: if the application does not supply it, the square - root function must still compute square roots.) - -These requirements apply to the modified work as a whole. If -identifiable sections of that work are not derived from the Library, -and can be reasonably considered independent and separate works in -themselves, then this License, and its terms, do not apply to those -sections when you distribute them as separate works. But when you -distribute the same sections as part of a whole which is a work based -on the Library, the distribution of the whole must be on the terms of -this License, whose permissions for other licensees extend to the -entire whole, and thus to each and every part regardless of who wrote -it. - -Thus, it is not the intent of this section to claim rights or contest -your rights to work written entirely by you; rather, the intent is to -exercise the right to control the distribution of derivative or -collective works based on the Library. - -In addition, mere aggregation of another work not based on the Library -with the Library (or with a work based on the Library) on a volume of -a storage or distribution medium does not bring the other work under -the scope of this License. - - 3. You may opt to apply the terms of the ordinary GNU General Public -License instead of this License to a given copy of the Library. To do -this, you must alter all the notices that refer to this License, so -that they refer to the ordinary GNU General Public License, version 2, -instead of to this License. (If a newer version than version 2 of the -ordinary GNU General Public License has appeared, then you can specify -that version instead if you wish.) Do not make any other change in -these notices. - - Once this change is made in a given copy, it is irreversible for -that copy, so the ordinary GNU General Public License applies to all -subsequent copies and derivative works made from that copy. - - This option is useful when you wish to copy part of the code of -the Library into a program that is not a library. - - 4. You may copy and distribute the Library (or a portion or -derivative of it, under Section 2) in object code or executable form -under the terms of Sections 1 and 2 above provided that you accompany -it with the complete corresponding machine-readable source code, which -must be distributed under the terms of Sections 1 and 2 above on a -medium customarily used for software interchange. - - If distribution of object code is made by offering access to copy -from a designated place, then offering equivalent access to copy the -source code from the same place satisfies the requirement to -distribute the source code, even though third parties are not -compelled to copy the source along with the object code. - - 5. A program that contains no derivative of any portion of the -Library, but is designed to work with the Library by being compiled or -linked with it, is called a "work that uses the Library". Such a -work, in isolation, is not a derivative work of the Library, and -therefore falls outside the scope of this License. - - However, linking a "work that uses the Library" with the Library -creates an executable that is a derivative of the Library (because it -contains portions of the Library), rather than a "work that uses the -library". The executable is therefore covered by this License. -Section 6 states terms for distribution of such executables. - - When a "work that uses the Library" uses material from a header file -that is part of the Library, the object code for the work may be a -derivative work of the Library even though the source code is not. -Whether this is true is especially significant if the work can be -linked without the Library, or if the work is itself a library. The -threshold for this to be true is not precisely defined by law. - - If such an object file uses only numerical parameters, data -structure layouts and accessors, and small macros and small inline -functions (ten lines or less in length), then the use of the object -file is unrestricted, regardless of whether it is legally a derivative -work. (Executables containing this object code plus portions of the -Library will still fall under Section 6.) - - Otherwise, if the work is a derivative of the Library, you may -distribute the object code for the work under the terms of Section 6. -Any executables containing that work also fall under Section 6, -whether or not they are linked directly with the Library itself. - - 6. As an exception to the Sections above, you may also combine or -link a "work that uses the Library" with the Library to produce a -work containing portions of the Library, and distribute that work -under terms of your choice, provided that the terms permit -modification of the work for the customer's own use and reverse -engineering for debugging such modifications. - - You must give prominent notice with each copy of the work that the -Library is used in it and that the Library and its use are covered by -this License. You must supply a copy of this License. If the work -during execution displays copyright notices, you must include the -copyright notice for the Library among them, as well as a reference -directing the user to the copy of this License. Also, you must do one -of these things: - - a) Accompany the work with the complete corresponding - machine-readable source code for the Library including whatever - changes were used in the work (which must be distributed under - Sections 1 and 2 above); and, if the work is an executable linked - with the Library, with the complete machine-readable "work that - uses the Library", as object code and/or source code, so that the - user can modify the Library and then relink to produce a modified - executable containing the modified Library. (It is understood - that the user who changes the contents of definitions files in the - Library will not necessarily be able to recompile the application - to use the modified definitions.) - - b) Use a suitable shared library mechanism for linking with the - Library. A suitable mechanism is one that (1) uses at run time a - copy of the library already present on the user's computer system, - rather than copying library functions into the executable, and (2) - will operate properly with a modified version of the library, if - the user installs one, as long as the modified version is - interface-compatible with the version that the work was made with. - - c) Accompany the work with a written offer, valid for at - least three years, to give the same user the materials - specified in Subsection 6a, above, for a charge no more - than the cost of performing this distribution. - - d) If distribution of the work is made by offering access to copy - from a designated place, offer equivalent access to copy the above - specified materials from the same place. - - e) Verify that the user has already received a copy of these - materials or that you have already sent this user a copy. - - For an executable, the required form of the "work that uses the -Library" must include any data and utility programs needed for -reproducing the executable from it. However, as a special exception, -the materials to be distributed need not include anything that is -normally distributed (in either source or binary form) with the major -components (compiler, kernel, and so on) of the operating system on -which the executable runs, unless that component itself accompanies -the executable. - - It may happen that this requirement contradicts the license -restrictions of other proprietary libraries that do not normally -accompany the operating system. Such a contradiction means you cannot -use both them and the Library together in an executable that you -distribute. - - 7. You may place library facilities that are a work based on the -Library side-by-side in a single library together with other library -facilities not covered by this License, and distribute such a combined -library, provided that the separate distribution of the work based on -the Library and of the other library facilities is otherwise -permitted, and provided that you do these two things: - - a) Accompany the combined library with a copy of the same work - based on the Library, uncombined with any other library - facilities. This must be distributed under the terms of the - Sections above. - - b) Give prominent notice with the combined library of the fact - that part of it is a work based on the Library, and explaining - where to find the accompanying uncombined form of the same work. - - 8. You may not copy, modify, sublicense, link with, or distribute -the Library except as expressly provided under this License. Any -attempt otherwise to copy, modify, sublicense, link with, or -distribute the Library is void, and will automatically terminate your -rights under this License. However, parties who have received copies, -or rights, from you under this License will not have their licenses -terminated so long as such parties remain in full compliance. - - 9. You are not required to accept this License, since you have not -signed it. However, nothing else grants you permission to modify or -distribute the Library or its derivative works. These actions are -prohibited by law if you do not accept this License. Therefore, by -modifying or distributing the Library (or any work based on the -Library), you indicate your acceptance of this License to do so, and -all its terms and conditions for copying, distributing or modifying -the Library or works based on it. - - 10. Each time you redistribute the Library (or any work based on the -Library), the recipient automatically receives a license from the -original licensor to copy, distribute, link with or modify the Library -subject to these terms and conditions. You may not impose any further -restrictions on the recipients' exercise of the rights granted herein. -You are not responsible for enforcing compliance by third parties with -this License. - - 11. If, as a consequence of a court judgment or allegation of patent -infringement or for any other reason (not limited to patent issues), -conditions are imposed on you (whether by court order, agreement or -otherwise) that contradict the conditions of this License, they do not -excuse you from the conditions of this License. If you cannot -distribute so as to satisfy simultaneously your obligations under this -License and any other pertinent obligations, then as a consequence you -may not distribute the Library at all. For example, if a patent -license would not permit royalty-free redistribution of the Library by -all those who receive copies directly or indirectly through you, then -the only way you could satisfy both it and this License would be to -refrain entirely from distribution of the Library. - -If any portion of this section is held invalid or unenforceable under any -particular circumstance, the balance of the section is intended to apply, -and the section as a whole is intended to apply in other circumstances. - -It is not the purpose of this section to induce you to infringe any -patents or other property right claims or to contest validity of any -such claims; this section has the sole purpose of protecting the -integrity of the free software distribution system which is -implemented by public license practices. Many people have made -generous contributions to the wide range of software distributed -through that system in reliance on consistent application of that -system; it is up to the author/donor to decide if he or she is willing -to distribute software through any other system and a licensee cannot -impose that choice. - -This section is intended to make thoroughly clear what is believed to -be a consequence of the rest of this License. - - 12. If the distribution and/or use of the Library is restricted in -certain countries either by patents or by copyrighted interfaces, the -original copyright holder who places the Library under this License may add -an explicit geographical distribution limitation excluding those countries, -so that distribution is permitted only in or among countries not thus -excluded. In such case, this License incorporates the limitation as if -written in the body of this License. - - 13. The Free Software Foundation may publish revised and/or new -versions of the Lesser General Public License from time to time. -Such new versions will be similar in spirit to the present version, -but may differ in detail to address new problems or concerns. - -Each version is given a distinguishing version number. If the Library -specifies a version number of this License which applies to it and -"any later version", you have the option of following the terms and -conditions either of that version or of any later version published by -the Free Software Foundation. If the Library does not specify a -license version number, you may choose any version ever published by -the Free Software Foundation. - - 14. If you wish to incorporate parts of the Library into other free -programs whose distribution conditions are incompatible with these, -write to the author to ask for permission. For software which is -copyrighted by the Free Software Foundation, write to the Free -Software Foundation; we sometimes make exceptions for this. Our -decision will be guided by the two goals of preserving the free status -of all derivatives of our free software and of promoting the sharing -and reuse of software generally. - - NO WARRANTY - - 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO -WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. -EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR -OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY -KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE -IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE -LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME -THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. - - 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN -WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY -AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU -FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR -CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE -LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING -RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A -FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF -SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH -DAMAGES. - - END OF TERMS AND CONDITIONS - - How to Apply These Terms to Your New Libraries - - If you develop a new library, and you want it to be of the greatest -possible use to the public, we recommend making it free software that -everyone can redistribute and change. You can do so by permitting -redistribution under these terms (or, alternatively, under the terms of the -ordinary General Public License). - - To apply these terms, attach the following notices to the library. It is -safest to attach them to the start of each source file to most effectively -convey the exclusion of warranty; and each file should have at least the -"copyright" line and a pointer to where the full notice is found. - - - Copyright (C) - - This library is free software; you can redistribute it and/or - modify it under the terms of the GNU Lesser General Public - License as published by the Free Software Foundation; either - version 2.1 of the License, or (at your option) any later version. - - This library is distributed in the hope that it will be useful, - but WITHOUT ANY WARRANTY; without even the implied warranty of - MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU - Lesser General Public License for more details. - - You should have received a copy of the GNU Lesser General Public - License along with this library; if not, write to the Free Software - Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA - -Also add information on how to contact you by electronic and paper mail. - -You should also get your employer (if you work as a programmer) or your -school, if any, to sign a "copyright disclaimer" for the library, if -necessary. Here is a sample; alter the names: - - Yoyodyne, Inc., hereby disclaims all copyright interest in the - library `Frob' (a library for tweaking knobs) written by James Random Hacker. - - , 1 April 1990 - Ty Coon, President of Vice - -That's all there is to it! - - + GNU LESSER GENERAL PUBLIC LICENSE + Version 2.1, February 1999 + + Copyright (C) 1991, 1999 Free Software Foundation, Inc. + 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + Everyone is permitted to copy and distribute verbatim copies + of this license document, but changing it is not allowed. + +[This is the first released version of the Lesser GPL. It also counts + as the successor of the GNU Library Public License, version 2, hence + the version number 2.1.] + + Preamble + + The licenses for most software are designed to take away your +freedom to share and change it. By contrast, the GNU General Public +Licenses are intended to guarantee your freedom to share and change +free software--to make sure the software is free for all its users. + + This license, the Lesser General Public License, applies to some +specially designated software packages--typically libraries--of the +Free Software Foundation and other authors who decide to use it. You +can use it too, but we suggest you first think carefully about whether +this license or the ordinary General Public License is the better +strategy to use in any particular case, based on the explanations below. + + When we speak of free software, we are referring to freedom of use, +not price. Our General Public Licenses are designed to make sure that +you have the freedom to distribute copies of free software (and charge +for this service if you wish); that you receive source code or can get +it if you want it; that you can change the software and use pieces of +it in new free programs; and that you are informed that you can do +these things. + + To protect your rights, we need to make restrictions that forbid +distributors to deny you these rights or to ask you to surrender these +rights. These restrictions translate to certain responsibilities for +you if you distribute copies of the library or if you modify it. + + For example, if you distribute copies of the library, whether gratis +or for a fee, you must give the recipients all the rights that we gave +you. You must make sure that they, too, receive or can get the source +code. If you link other code with the library, you must provide +complete object files to the recipients, so that they can relink them +with the library after making changes to the library and recompiling +it. And you must show them these terms so they know their rights. + + We protect your rights with a two-step method: (1) we copyright the +library, and (2) we offer you this license, which gives you legal +permission to copy, distribute and/or modify the library. + + To protect each distributor, we want to make it very clear that +there is no warranty for the free library. Also, if the library is +modified by someone else and passed on, the recipients should know +that what they have is not the original version, so that the original +author's reputation will not be affected by problems that might be +introduced by others. + + Finally, software patents pose a constant threat to the existence of +any free program. We wish to make sure that a company cannot +effectively restrict the users of a free program by obtaining a +restrictive license from a patent holder. Therefore, we insist that +any patent license obtained for a version of the library must be +consistent with the full freedom of use specified in this license. + + Most GNU software, including some libraries, is covered by the +ordinary GNU General Public License. This license, the GNU Lesser +General Public License, applies to certain designated libraries, and +is quite different from the ordinary General Public License. We use +this license for certain libraries in order to permit linking those +libraries into non-free programs. + + When a program is linked with a library, whether statically or using +a shared library, the combination of the two is legally speaking a +combined work, a derivative of the original library. The ordinary +General Public License therefore permits such linking only if the +entire combination fits its criteria of freedom. The Lesser General +Public License permits more lax criteria for linking other code with +the library. + + We call this license the "Lesser" General Public License because it +does Less to protect the user's freedom than the ordinary General +Public License. It also provides other free software developers Less +of an advantage over competing non-free programs. These disadvantages +are the reason we use the ordinary General Public License for many +libraries. However, the Lesser license provides advantages in certain +special circumstances. + + For example, on rare occasions, there may be a special need to +encourage the widest possible use of a certain library, so that it becomes +a de-facto standard. To achieve this, non-free programs must be +allowed to use the library. A more frequent case is that a free +library does the same job as widely used non-free libraries. In this +case, there is little to gain by limiting the free library to free +software only, so we use the Lesser General Public License. + + In other cases, permission to use a particular library in non-free +programs enables a greater number of people to use a large body of +free software. For example, permission to use the GNU C Library in +non-free programs enables many more people to use the whole GNU +operating system, as well as its variant, the GNU/Linux operating +system. + + Although the Lesser General Public License is Less protective of the +users' freedom, it does ensure that the user of a program that is +linked with the Library has the freedom and the wherewithal to run +that program using a modified version of the Library. + + The precise terms and conditions for copying, distribution and +modification follow. Pay close attention to the difference between a +"work based on the library" and a "work that uses the library". The +former contains code derived from the library, whereas the latter must +be combined with the library in order to run. + + GNU LESSER GENERAL PUBLIC LICENSE + TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION + + 0. This License Agreement applies to any software library or other +program which contains a notice placed by the copyright holder or +other authorized party saying it may be distributed under the terms of +this Lesser General Public License (also called "this License"). +Each licensee is addressed as "you". + + A "library" means a collection of software functions and/or data +prepared so as to be conveniently linked with application programs +(which use some of those functions and data) to form executables. + + The "Library", below, refers to any such software library or work +which has been distributed under these terms. A "work based on the +Library" means either the Library or any derivative work under +copyright law: that is to say, a work containing the Library or a +portion of it, either verbatim or with modifications and/or translated +straightforwardly into another language. (Hereinafter, translation is +included without limitation in the term "modification".) + + "Source code" for a work means the preferred form of the work for +making modifications to it. For a library, complete source code means +all the source code for all modules it contains, plus any associated +interface definition files, plus the scripts used to control compilation +and installation of the library. + + Activities other than copying, distribution and modification are not +covered by this License; they are outside its scope. The act of +running a program using the Library is not restricted, and output from +such a program is covered only if its contents constitute a work based +on the Library (independent of the use of the Library in a tool for +writing it). Whether that is true depends on what the Library does +and what the program that uses the Library does. + + 1. You may copy and distribute verbatim copies of the Library's +complete source code as you receive it, in any medium, provided that +you conspicuously and appropriately publish on each copy an +appropriate copyright notice and disclaimer of warranty; keep intact +all the notices that refer to this License and to the absence of any +warranty; and distribute a copy of this License along with the +Library. + + You may charge a fee for the physical act of transferring a copy, +and you may at your option offer warranty protection in exchange for a +fee. + + 2. You may modify your copy or copies of the Library or any portion +of it, thus forming a work based on the Library, and copy and +distribute such modifications or work under the terms of Section 1 +above, provided that you also meet all of these conditions: + + a) The modified work must itself be a software library. + + b) You must cause the files modified to carry prominent notices + stating that you changed the files and the date of any change. + + c) You must cause the whole of the work to be licensed at no + charge to all third parties under the terms of this License. + + d) If a facility in the modified Library refers to a function or a + table of data to be supplied by an application program that uses + the facility, other than as an argument passed when the facility + is invoked, then you must make a good faith effort to ensure that, + in the event an application does not supply such function or + table, the facility still operates, and performs whatever part of + its purpose remains meaningful. + + (For example, a function in a library to compute square roots has + a purpose that is entirely well-defined independent of the + application. Therefore, Subsection 2d requires that any + application-supplied function or table used by this function must + be optional: if the application does not supply it, the square + root function must still compute square roots.) + +These requirements apply to the modified work as a whole. If +identifiable sections of that work are not derived from the Library, +and can be reasonably considered independent and separate works in +themselves, then this License, and its terms, do not apply to those +sections when you distribute them as separate works. But when you +distribute the same sections as part of a whole which is a work based +on the Library, the distribution of the whole must be on the terms of +this License, whose permissions for other licensees extend to the +entire whole, and thus to each and every part regardless of who wrote +it. + +Thus, it is not the intent of this section to claim rights or contest +your rights to work written entirely by you; rather, the intent is to +exercise the right to control the distribution of derivative or +collective works based on the Library. + +In addition, mere aggregation of another work not based on the Library +with the Library (or with a work based on the Library) on a volume of +a storage or distribution medium does not bring the other work under +the scope of this License. + + 3. You may opt to apply the terms of the ordinary GNU General Public +License instead of this License to a given copy of the Library. To do +this, you must alter all the notices that refer to this License, so +that they refer to the ordinary GNU General Public License, version 2, +instead of to this License. (If a newer version than version 2 of the +ordinary GNU General Public License has appeared, then you can specify +that version instead if you wish.) Do not make any other change in +these notices. + + Once this change is made in a given copy, it is irreversible for +that copy, so the ordinary GNU General Public License applies to all +subsequent copies and derivative works made from that copy. + + This option is useful when you wish to copy part of the code of +the Library into a program that is not a library. + + 4. You may copy and distribute the Library (or a portion or +derivative of it, under Section 2) in object code or executable form +under the terms of Sections 1 and 2 above provided that you accompany +it with the complete corresponding machine-readable source code, which +must be distributed under the terms of Sections 1 and 2 above on a +medium customarily used for software interchange. + + If distribution of object code is made by offering access to copy +from a designated place, then offering equivalent access to copy the +source code from the same place satisfies the requirement to +distribute the source code, even though third parties are not +compelled to copy the source along with the object code. + + 5. A program that contains no derivative of any portion of the +Library, but is designed to work with the Library by being compiled or +linked with it, is called a "work that uses the Library". Such a +work, in isolation, is not a derivative work of the Library, and +therefore falls outside the scope of this License. + + However, linking a "work that uses the Library" with the Library +creates an executable that is a derivative of the Library (because it +contains portions of the Library), rather than a "work that uses the +library". The executable is therefore covered by this License. +Section 6 states terms for distribution of such executables. + + When a "work that uses the Library" uses material from a header file +that is part of the Library, the object code for the work may be a +derivative work of the Library even though the source code is not. +Whether this is true is especially significant if the work can be +linked without the Library, or if the work is itself a library. The +threshold for this to be true is not precisely defined by law. + + If such an object file uses only numerical parameters, data +structure layouts and accessors, and small macros and small inline +functions (ten lines or less in length), then the use of the object +file is unrestricted, regardless of whether it is legally a derivative +work. (Executables containing this object code plus portions of the +Library will still fall under Section 6.) + + Otherwise, if the work is a derivative of the Library, you may +distribute the object code for the work under the terms of Section 6. +Any executables containing that work also fall under Section 6, +whether or not they are linked directly with the Library itself. + + 6. As an exception to the Sections above, you may also combine or +link a "work that uses the Library" with the Library to produce a +work containing portions of the Library, and distribute that work +under terms of your choice, provided that the terms permit +modification of the work for the customer's own use and reverse +engineering for debugging such modifications. + + You must give prominent notice with each copy of the work that the +Library is used in it and that the Library and its use are covered by +this License. You must supply a copy of this License. If the work +during execution displays copyright notices, you must include the +copyright notice for the Library among them, as well as a reference +directing the user to the copy of this License. Also, you must do one +of these things: + + a) Accompany the work with the complete corresponding + machine-readable source code for the Library including whatever + changes were used in the work (which must be distributed under + Sections 1 and 2 above); and, if the work is an executable linked + with the Library, with the complete machine-readable "work that + uses the Library", as object code and/or source code, so that the + user can modify the Library and then relink to produce a modified + executable containing the modified Library. (It is understood + that the user who changes the contents of definitions files in the + Library will not necessarily be able to recompile the application + to use the modified definitions.) + + b) Use a suitable shared library mechanism for linking with the + Library. A suitable mechanism is one that (1) uses at run time a + copy of the library already present on the user's computer system, + rather than copying library functions into the executable, and (2) + will operate properly with a modified version of the library, if + the user installs one, as long as the modified version is + interface-compatible with the version that the work was made with. + + c) Accompany the work with a written offer, valid for at + least three years, to give the same user the materials + specified in Subsection 6a, above, for a charge no more + than the cost of performing this distribution. + + d) If distribution of the work is made by offering access to copy + from a designated place, offer equivalent access to copy the above + specified materials from the same place. + + e) Verify that the user has already received a copy of these + materials or that you have already sent this user a copy. + + For an executable, the required form of the "work that uses the +Library" must include any data and utility programs needed for +reproducing the executable from it. However, as a special exception, +the materials to be distributed need not include anything that is +normally distributed (in either source or binary form) with the major +components (compiler, kernel, and so on) of the operating system on +which the executable runs, unless that component itself accompanies +the executable. + + It may happen that this requirement contradicts the license +restrictions of other proprietary libraries that do not normally +accompany the operating system. Such a contradiction means you cannot +use both them and the Library together in an executable that you +distribute. + + 7. You may place library facilities that are a work based on the +Library side-by-side in a single library together with other library +facilities not covered by this License, and distribute such a combined +library, provided that the separate distribution of the work based on +the Library and of the other library facilities is otherwise +permitted, and provided that you do these two things: + + a) Accompany the combined library with a copy of the same work + based on the Library, uncombined with any other library + facilities. This must be distributed under the terms of the + Sections above. + + b) Give prominent notice with the combined library of the fact + that part of it is a work based on the Library, and explaining + where to find the accompanying uncombined form of the same work. + + 8. You may not copy, modify, sublicense, link with, or distribute +the Library except as expressly provided under this License. Any +attempt otherwise to copy, modify, sublicense, link with, or +distribute the Library is void, and will automatically terminate your +rights under this License. However, parties who have received copies, +or rights, from you under this License will not have their licenses +terminated so long as such parties remain in full compliance. + + 9. You are not required to accept this License, since you have not +signed it. However, nothing else grants you permission to modify or +distribute the Library or its derivative works. These actions are +prohibited by law if you do not accept this License. Therefore, by +modifying or distributing the Library (or any work based on the +Library), you indicate your acceptance of this License to do so, and +all its terms and conditions for copying, distributing or modifying +the Library or works based on it. + + 10. Each time you redistribute the Library (or any work based on the +Library), the recipient automatically receives a license from the +original licensor to copy, distribute, link with or modify the Library +subject to these terms and conditions. You may not impose any further +restrictions on the recipients' exercise of the rights granted herein. +You are not responsible for enforcing compliance by third parties with +this License. + + 11. If, as a consequence of a court judgment or allegation of patent +infringement or for any other reason (not limited to patent issues), +conditions are imposed on you (whether by court order, agreement or +otherwise) that contradict the conditions of this License, they do not +excuse you from the conditions of this License. If you cannot +distribute so as to satisfy simultaneously your obligations under this +License and any other pertinent obligations, then as a consequence you +may not distribute the Library at all. For example, if a patent +license would not permit royalty-free redistribution of the Library by +all those who receive copies directly or indirectly through you, then +the only way you could satisfy both it and this License would be to +refrain entirely from distribution of the Library. + +If any portion of this section is held invalid or unenforceable under any +particular circumstance, the balance of the section is intended to apply, +and the section as a whole is intended to apply in other circumstances. + +It is not the purpose of this section to induce you to infringe any +patents or other property right claims or to contest validity of any +such claims; this section has the sole purpose of protecting the +integrity of the free software distribution system which is +implemented by public license practices. Many people have made +generous contributions to the wide range of software distributed +through that system in reliance on consistent application of that +system; it is up to the author/donor to decide if he or she is willing +to distribute software through any other system and a licensee cannot +impose that choice. + +This section is intended to make thoroughly clear what is believed to +be a consequence of the rest of this License. + + 12. If the distribution and/or use of the Library is restricted in +certain countries either by patents or by copyrighted interfaces, the +original copyright holder who places the Library under this License may add +an explicit geographical distribution limitation excluding those countries, +so that distribution is permitted only in or among countries not thus +excluded. In such case, this License incorporates the limitation as if +written in the body of this License. + + 13. The Free Software Foundation may publish revised and/or new +versions of the Lesser General Public License from time to time. +Such new versions will be similar in spirit to the present version, +but may differ in detail to address new problems or concerns. + +Each version is given a distinguishing version number. If the Library +specifies a version number of this License which applies to it and +"any later version", you have the option of following the terms and +conditions either of that version or of any later version published by +the Free Software Foundation. If the Library does not specify a +license version number, you may choose any version ever published by +the Free Software Foundation. + + 14. If you wish to incorporate parts of the Library into other free +programs whose distribution conditions are incompatible with these, +write to the author to ask for permission. For software which is +copyrighted by the Free Software Foundation, write to the Free +Software Foundation; we sometimes make exceptions for this. Our +decision will be guided by the two goals of preserving the free status +of all derivatives of our free software and of promoting the sharing +and reuse of software generally. + + NO WARRANTY + + 15. BECAUSE THE LIBRARY IS LICENSED FREE OF CHARGE, THERE IS NO +WARRANTY FOR THE LIBRARY, TO THE EXTENT PERMITTED BY APPLICABLE LAW. +EXCEPT WHEN OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR +OTHER PARTIES PROVIDE THE LIBRARY "AS IS" WITHOUT WARRANTY OF ANY +KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE +IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE. THE ENTIRE RISK AS TO THE QUALITY AND PERFORMANCE OF THE +LIBRARY IS WITH YOU. SHOULD THE LIBRARY PROVE DEFECTIVE, YOU ASSUME +THE COST OF ALL NECESSARY SERVICING, REPAIR OR CORRECTION. + + 16. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN +WRITING WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY +AND/OR REDISTRIBUTE THE LIBRARY AS PERMITTED ABOVE, BE LIABLE TO YOU +FOR DAMAGES, INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR +CONSEQUENTIAL DAMAGES ARISING OUT OF THE USE OR INABILITY TO USE THE +LIBRARY (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR DATA BEING +RENDERED INACCURATE OR LOSSES SUSTAINED BY YOU OR THIRD PARTIES OR A +FAILURE OF THE LIBRARY TO OPERATE WITH ANY OTHER SOFTWARE), EVEN IF +SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH +DAMAGES. + + END OF TERMS AND CONDITIONS + + How to Apply These Terms to Your New Libraries + + If you develop a new library, and you want it to be of the greatest +possible use to the public, we recommend making it free software that +everyone can redistribute and change. You can do so by permitting +redistribution under these terms (or, alternatively, under the terms of the +ordinary General Public License). + + To apply these terms, attach the following notices to the library. It is +safest to attach them to the start of each source file to most effectively +convey the exclusion of warranty; and each file should have at least the +"copyright" line and a pointer to where the full notice is found. + + + Copyright (C) + + This library is free software; you can redistribute it and/or + modify it under the terms of the GNU Lesser General Public + License as published by the Free Software Foundation; either + version 2.1 of the License, or (at your option) any later version. + + This library is distributed in the hope that it will be useful, + but WITHOUT ANY WARRANTY; without even the implied warranty of + MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU + Lesser General Public License for more details. + + You should have received a copy of the GNU Lesser General Public + License along with this library; if not, write to the Free Software + Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA + +Also add information on how to contact you by electronic and paper mail. + +You should also get your employer (if you work as a programmer) or your +school, if any, to sign a "copyright disclaimer" for the library, if +necessary. Here is a sample; alter the names: + + Yoyodyne, Inc., hereby disclaims all copyright interest in the + library `Frob' (a library for tweaking knobs) written by James Random Hacker. + + , 1 April 1990 + Ty Coon, President of Vice + +That's all there is to it! + + diff --git a/infinity/bsd-license.txt b/infinity/bsd-license.txt index 191e28d..2988562 100644 --- a/infinity/bsd-license.txt +++ b/infinity/bsd-license.txt @@ -1,31 +1,31 @@ - - The BSD License for the JGoodies Looks - ====================================== - -Copyright (c) 2001-2004 JGoodies Karsten Lentzsch. All rights reserved. - -Redistribution and use in source and binary forms, with or without -modification, are permitted provided that the following conditions are met: - - o Redistributions of source code must retain the above copyright notice, - this list of conditions and the following disclaimer. - - o Redistributions in binary form must reproduce the above copyright notice, - this list of conditions and the following disclaimer in the documentation - and/or other materials provided with the distribution. - - o Neither the name of JGoodies Karsten Lentzsch nor the names of - its contributors may be used to endorse or promote products derived - from this software without specific prior written permission. - -THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" -AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, -THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR -PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR -CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, -EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, -PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; -OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, -WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR -OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, -EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. + + The BSD License for the JGoodies Looks + ====================================== + +Copyright (c) 2001-2004 JGoodies Karsten Lentzsch. All rights reserved. + +Redistribution and use in source and binary forms, with or without +modification, are permitted provided that the following conditions are met: + + o Redistributions of source code must retain the above copyright notice, + this list of conditions and the following disclaimer. + + o Redistributions in binary form must reproduce the above copyright notice, + this list of conditions and the following disclaimer in the documentation + and/or other materials provided with the distribution. + + o Neither the name of JGoodies Karsten Lentzsch nor the names of + its contributors may be used to endorse or promote products derived + from this software without specific prior written permission. + +THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" +AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, +THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR +PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR +CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, +EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, +PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; +OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, +WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR +OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, +EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. diff --git a/infinity/check/EffectsIndexChecker.java b/infinity/check/EffectsIndexChecker.java index cabbdde..d2d61a9 100644 --- a/infinity/check/EffectsIndexChecker.java +++ b/infinity/check/EffectsIndexChecker.java @@ -1,160 +1,160 @@ -package infinity.check; - -import infinity.NearInfinity; -import infinity.datatype.DecNumber; -import infinity.datatype.SectionCount; -import infinity.gui.Center; -import infinity.gui.ChildFrame; -import infinity.icon.Icons; -import infinity.resource.AbstractAbility; -import infinity.resource.AbstractStruct; -import infinity.resource.Resource; -import infinity.resource.ResourceFactory; -import infinity.resource.StructEntry; -import infinity.resource.key.ResourceEntry; -import infinity.search.ReferenceHitFrame; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.ProgressMonitor; - -public class EffectsIndexChecker extends ChildFrame implements ActionListener, Runnable -{ - private static final String filetypes[] = {"ITM", "SPL"}; - private final JButton bstart = new JButton("Check", Icons.getIcon("Find16.gif")); - private final JButton bcancel = new JButton("Cancel", Icons.getIcon("Delete16.gif")); - private final JButton binvert = new JButton("Invert", Icons.getIcon("Refresh16.gif")); - private final JCheckBox[] boxes; - private final ReferenceHitFrame hitFrame; - private List files; - - public EffectsIndexChecker() - { - super("Effects Index Checker"); - setIconImage(Icons.getIcon("Refresh16.gif").getImage()); - hitFrame = new ReferenceHitFrame("Mis-indexed Effects", NearInfinity.getInstance()); - - boxes = new JCheckBox[filetypes.length]; - bstart.setMnemonic('s'); - bcancel.setMnemonic('c'); - binvert.setMnemonic('i'); - bstart.addActionListener(this); - bcancel.addActionListener(this); - binvert.addActionListener(this); - getRootPane().setDefaultButton(bstart); - - JPanel boxpanel = new JPanel(new GridLayout(0, 2, 3, 3)); - for (int i = 0; i < boxes.length; i++) { - boxes[i] = new JCheckBox(filetypes[i], true); - boxpanel.add(boxes[i]); - } - boxpanel.setBorder(BorderFactory.createEmptyBorder(3, 12, 3, 0)); - - JPanel ipanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); - ipanel.add(binvert); - JPanel innerpanel = new JPanel(new BorderLayout()); - innerpanel.add(boxpanel, BorderLayout.CENTER); - innerpanel.add(ipanel, BorderLayout.SOUTH); - innerpanel.setBorder(BorderFactory.createTitledBorder("Select files to check:")); - - JPanel bpanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); - bpanel.add(bstart); - bpanel.add(bcancel); - - JPanel mainpanel = new JPanel(new BorderLayout()); - mainpanel.add(innerpanel, BorderLayout.CENTER); - mainpanel.add(bpanel, BorderLayout.SOUTH); - mainpanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); - - JPanel pane = (JPanel)getContentPane(); - pane.setLayout(new BorderLayout()); - pane.add(mainpanel, BorderLayout.CENTER); - - pack(); - Center.center(this, NearInfinity.getInstance().getBounds()); - setVisible(true); - } -//--------------------- Begin Interface ActionListener --------------------- - - public void actionPerformed(ActionEvent event) - { - if (event.getSource() == bstart) { - setVisible(false); - files = new ArrayList(); - for (int i = 0; i < filetypes.length; i++) { - if (boxes[i].isSelected()) - files.addAll(ResourceFactory.getInstance().getResources(filetypes[i])); - } - if (files.size() > 0) - new Thread(this).start(); - } - else if (event.getSource() == binvert) { - for (final JCheckBox box : boxes) - box.setSelected(!box.isSelected()); - } - else if (event.getSource() == bcancel) - setVisible(false); - } - -// --------------------- End Interface ActionListener --------------------- - - -// --------------------- Begin Interface Runnable --------------------- - - public void run() - { - ProgressMonitor progress = new ProgressMonitor(NearInfinity.getInstance(), "Checking...", null, 0, - files.size()); - progress.setMillisToDecideToPopup(100); - String type = null; - long startTime = System.currentTimeMillis(); - for (int i = 0; i < files.size(); i++) { - ResourceEntry entry = files.get(i); - Resource resource = ResourceFactory.getResource(entry); - if (resource != null) { - if (!entry.getExtension().equalsIgnoreCase(type)) { - type = entry.getExtension(); - progress.setNote(type + 's'); - } - search(entry, (AbstractStruct)resource); - } - progress.setProgress(i + 1); - if (progress.isCanceled()) { - JOptionPane.showMessageDialog(NearInfinity.getInstance(), "Check canceled", "Info", - JOptionPane.INFORMATION_MESSAGE); - return; - } - } - System.out.println("Check completed: " + (System.currentTimeMillis() - startTime) + "ms."); - hitFrame.setVisible(true); - } - - private void search(ResourceEntry entry, AbstractStruct struct) - { - int numGlobalEffects = ((SectionCount) struct.getAttribute("# global effects")).getValue(); - int expectedEffectsIndex = numGlobalEffects; - List structList = struct.getList(); - for (int i = 0; i < structList.size(); i++) { - Object o = structList.get(i); - if (o instanceof AbstractAbility) { - AbstractAbility abil = (AbstractAbility) o; - int effectsIndex = ((DecNumber) abil.getAttribute("First effect index")).getValue(); - if (effectsIndex != expectedEffectsIndex) { - hitFrame.addHit(entry, entry.getSearchString(), abil); - } - expectedEffectsIndex += abil.getEffectsCount(); - } - } - } -} +package infinity.check; + +import infinity.NearInfinity; +import infinity.datatype.DecNumber; +import infinity.datatype.SectionCount; +import infinity.gui.Center; +import infinity.gui.ChildFrame; +import infinity.icon.Icons; +import infinity.resource.AbstractAbility; +import infinity.resource.AbstractStruct; +import infinity.resource.Resource; +import infinity.resource.ResourceFactory; +import infinity.resource.StructEntry; +import infinity.resource.key.ResourceEntry; +import infinity.search.ReferenceHitFrame; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.ProgressMonitor; + +public class EffectsIndexChecker extends ChildFrame implements ActionListener, Runnable +{ + private static final String filetypes[] = {"ITM", "SPL"}; + private final JButton bstart = new JButton("Check", Icons.getIcon("Find16.gif")); + private final JButton bcancel = new JButton("Cancel", Icons.getIcon("Delete16.gif")); + private final JButton binvert = new JButton("Invert", Icons.getIcon("Refresh16.gif")); + private final JCheckBox[] boxes; + private final ReferenceHitFrame hitFrame; + private List files; + + public EffectsIndexChecker() + { + super("Effects Index Checker"); + setIconImage(Icons.getIcon("Refresh16.gif").getImage()); + hitFrame = new ReferenceHitFrame("Mis-indexed Effects", NearInfinity.getInstance()); + + boxes = new JCheckBox[filetypes.length]; + bstart.setMnemonic('s'); + bcancel.setMnemonic('c'); + binvert.setMnemonic('i'); + bstart.addActionListener(this); + bcancel.addActionListener(this); + binvert.addActionListener(this); + getRootPane().setDefaultButton(bstart); + + JPanel boxpanel = new JPanel(new GridLayout(0, 2, 3, 3)); + for (int i = 0; i < boxes.length; i++) { + boxes[i] = new JCheckBox(filetypes[i], true); + boxpanel.add(boxes[i]); + } + boxpanel.setBorder(BorderFactory.createEmptyBorder(3, 12, 3, 0)); + + JPanel ipanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); + ipanel.add(binvert); + JPanel innerpanel = new JPanel(new BorderLayout()); + innerpanel.add(boxpanel, BorderLayout.CENTER); + innerpanel.add(ipanel, BorderLayout.SOUTH); + innerpanel.setBorder(BorderFactory.createTitledBorder("Select files to check:")); + + JPanel bpanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); + bpanel.add(bstart); + bpanel.add(bcancel); + + JPanel mainpanel = new JPanel(new BorderLayout()); + mainpanel.add(innerpanel, BorderLayout.CENTER); + mainpanel.add(bpanel, BorderLayout.SOUTH); + mainpanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); + + JPanel pane = (JPanel)getContentPane(); + pane.setLayout(new BorderLayout()); + pane.add(mainpanel, BorderLayout.CENTER); + + pack(); + Center.center(this, NearInfinity.getInstance().getBounds()); + setVisible(true); + } +//--------------------- Begin Interface ActionListener --------------------- + + public void actionPerformed(ActionEvent event) + { + if (event.getSource() == bstart) { + setVisible(false); + files = new ArrayList(); + for (int i = 0; i < filetypes.length; i++) { + if (boxes[i].isSelected()) + files.addAll(ResourceFactory.getInstance().getResources(filetypes[i])); + } + if (files.size() > 0) + new Thread(this).start(); + } + else if (event.getSource() == binvert) { + for (final JCheckBox box : boxes) + box.setSelected(!box.isSelected()); + } + else if (event.getSource() == bcancel) + setVisible(false); + } + +// --------------------- End Interface ActionListener --------------------- + + +// --------------------- Begin Interface Runnable --------------------- + + public void run() + { + ProgressMonitor progress = new ProgressMonitor(NearInfinity.getInstance(), "Checking...", null, 0, + files.size()); + progress.setMillisToDecideToPopup(100); + String type = null; + long startTime = System.currentTimeMillis(); + for (int i = 0; i < files.size(); i++) { + ResourceEntry entry = files.get(i); + Resource resource = ResourceFactory.getResource(entry); + if (resource != null) { + if (!entry.getExtension().equalsIgnoreCase(type)) { + type = entry.getExtension(); + progress.setNote(type + 's'); + } + search(entry, (AbstractStruct)resource); + } + progress.setProgress(i + 1); + if (progress.isCanceled()) { + JOptionPane.showMessageDialog(NearInfinity.getInstance(), "Check canceled", "Info", + JOptionPane.INFORMATION_MESSAGE); + return; + } + } + System.out.println("Check completed: " + (System.currentTimeMillis() - startTime) + "ms."); + hitFrame.setVisible(true); + } + + private void search(ResourceEntry entry, AbstractStruct struct) + { + int numGlobalEffects = ((SectionCount) struct.getAttribute("# global effects")).getValue(); + int expectedEffectsIndex = numGlobalEffects; + List structList = struct.getList(); + for (int i = 0; i < structList.size(); i++) { + Object o = structList.get(i); + if (o instanceof AbstractAbility) { + AbstractAbility abil = (AbstractAbility) o; + int effectsIndex = ((DecNumber) abil.getAttribute("First effect index")).getValue(); + if (effectsIndex != expectedEffectsIndex) { + hitFrame.addHit(entry, entry.getSearchString(), abil); + } + expectedEffectsIndex += abil.getEffectsCount(); + } + } + } +} diff --git a/infinity/gui/ScriptTextArea.java b/infinity/gui/ScriptTextArea.java index 6ade527..8e01ebc 100644 --- a/infinity/gui/ScriptTextArea.java +++ b/infinity/gui/ScriptTextArea.java @@ -1,388 +1,388 @@ -package infinity.gui; - -import infinity.NearInfinity; -import infinity.resource.Resource; -import infinity.resource.ResourceFactory; -import infinity.resource.bcs.Compiler; -import infinity.resource.key.ResourceEntry; -import infinity.util.IdsMapCache; -import infinity.util.IdsMapEntry; - -import java.awt.BasicStroke; -import java.awt.Color; -import java.awt.FontMetrics; -import java.awt.Graphics; -import java.awt.Graphics2D; -import java.awt.Point; -import java.awt.Rectangle; -import java.awt.Stroke; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.awt.event.MouseAdapter; -import java.awt.event.MouseEvent; -import java.util.ArrayList; -import java.util.Set; - -import javax.swing.JMenuItem; -import javax.swing.JOptionPane; -import javax.swing.JPopupMenu; -import javax.swing.JTextArea; -import javax.swing.text.BadLocationException; -import javax.swing.text.Document; - -public class ScriptTextArea extends JTextArea { - ScriptPopupMenu menu = new ScriptPopupMenu(); - - public ScriptTextArea() { - super(); - addMouseListener(new MouseAdapter() { - public void mousePressed(MouseEvent ev) { - handlePopup(ev); - } - - public void mouseReleased(MouseEvent ev) { - handlePopup(ev); - } - }); - } - - // try to paint an indicator below "crosslinks" - protected void paintComponent(Graphics g) { - super.paintComponent(g); - Rectangle rect = g.getClipBounds(); - - // try to get the "lines" which need to be painted - int upperLine = 0; - int lowerLine = 0; - try { - upperLine = getLineOfOffset(viewToModel(new Point(rect.x, rect.y))); - lowerLine = getLineOfOffset(viewToModel(new Point(rect.x + rect.width, - rect.y + rect.height))); - } catch (BadLocationException e) { } - //System.err.println("would consider drawing from lines " + upperLine + " to " + lowerLine); - for (int line = upperLine; line <= lowerLine; line++) { - try { - int start = getLineStartOffset(line); - int end = getLineEndOffset(line) - 1; // newline - - int[][] linkOffsets = findLinksInSection(start, end); - if (linkOffsets.length == 0) { - continue; - } - - Graphics2D g2d = (Graphics2D) g; - // clear that line before doing anything - Color oldColor = g2d.getColor(); - g2d.setColor(getBackground()); - Rectangle rectStart = modelToView(start); - Rectangle rectEnd = modelToView(end); - g2d.drawLine(rectStart.x, rectStart.y + rectStart.height, - rectEnd.x, rectEnd.y + rectEnd.height); - g2d.setColor(oldColor); - - Stroke oldStroke = g2d.getStroke(); - g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, - 1, new float[] { 1, 2 }, 0)); - // now underline the crosslinks - for (int[] pair : linkOffsets) { - // convert into view coordinates - rectStart = modelToView(pair[0]); - rectEnd = modelToView(pair[1]); - g2d.drawLine(rectStart.x, rectStart.y + rectStart.height, - rectEnd.x, rectEnd.y + rectEnd.height); - } - g2d.setStroke(oldStroke); - } catch (BadLocationException e) { } - } - } - - // looks for "crosslinks" in script lines - private int[][] findLinksInSection(int start, int end) throws BadLocationException { - ArrayList links = new ArrayList(); - String linetext = getText(start, end - start); - - int posStartToken = -1; - for (int i = 0; i < linetext.length(); i++) { - if (linetext.charAt(i) == '"') { - if (posStartToken != -1) { - // found a "word", so check for possible crosslink - String token = linetext.substring(posStartToken + 1, i); - - if (findResEntry(linetext, posStartToken + 1, token) != null) { - // add it to our list of crosslinks - links.add(new int[] { start + posStartToken + 1, start + i }); - } - posStartToken = -1; - } - else { - posStartToken = i; - } - } - } - return links.toArray(new int[0][0]); - } - - private void handlePopup(MouseEvent ev) { - if (ev.isPopupTrigger()) { - try { - // get "word" under click - Document doc = getDocument(); - int offset = viewToModel(ev.getPoint()); - final int lineNr = getLineOfOffset(offset); - final int lineStart = getLineStartOffset(lineNr); - String line = doc.getText(lineStart, getLineEndOffset(lineNr) - lineStart); - offset = offset - lineStart; - - String token = getToken(line, offset, "\"", "(), "); // quoted - if (token == null) { - // fall back to ids token parsing - token = getToken(line, offset, ",()", "[].\" "); // IDS - if (token == null) { - return; - } - } - - ResourceEntry resEntry = findResEntry(line, offset, token); - menu.setResEntry(resEntry); - - if (resEntry != null) { - menu.show(this, ev.getX(), ev.getY()); - } - } - catch (BadLocationException ble) {} - } - } - - private String getToken(String line, int offset, String delims, String invalidChars) { - int tokenStart, tokenEnd; - for (tokenStart = offset; tokenStart > 0; tokenStart--) { - char current = line.charAt(tokenStart); - if (delims.indexOf(current) != -1) { - tokenStart++; - break; - } - else if (invalidChars.indexOf(current) != -1) { - return null; - } - } - for (tokenEnd = offset + 1; tokenEnd < line.length(); tokenEnd++) { - char current = line.charAt(tokenEnd); - if (delims.indexOf(current) != -1) { - break; - } - else if (invalidChars.indexOf(current) != -1) { - return null; - } - } - return line.substring(tokenStart, tokenEnd); - } - - private ResourceEntry findResEntry(String line, int offset, String token) { - // determine function name and param position - int parenLevel = 0; - int paramPos = 0; - int idx; - for (idx = offset; idx > 0; idx--) { - char current = line.charAt(idx); - if (current == ')') { - parenLevel++; - } - else if ((current == ',') && (parenLevel == 0)) { - paramPos++; - } - else if (current == '(') { - if (parenLevel == 0) { - // found end of corresponding function name - break; - } - parenLevel--; - } - } - - int endPos = idx; - while ((idx > 0) && (Character.isLetter(line.charAt(idx - 1)))) { - idx--; - } - String function = line.substring(idx, endPos); - - // lookup function name in trigger.ids / action.ids - String[] idsFiles = new String[] { "trigger.ids", "action.ids" }; - for (final String idsFile : idsFiles) { - IdsMapEntry idsEntry = IdsMapCache.get(idsFile).lookup(function + "("); - if (idsEntry != null) { - String[] paramDefs = idsEntry.getParameters().split(","); - String definition = paramDefs[paramPos]; - - // check script names (death var) - if (definition.equalsIgnoreCase("O:Object*") - || definition.equalsIgnoreCase("O:Target*") - || definition.equalsIgnoreCase("O:Actor*") - || (definition.equalsIgnoreCase("S:Name*") - && (function.equalsIgnoreCase("Dead") - || function.equalsIgnoreCase("Name") - || function.equalsIgnoreCase("NumDead(") - || function.equalsIgnoreCase("NumDeadGT(") - || function.equalsIgnoreCase("NumDeadLT(")))) { - Compiler bcscomp = Compiler.getInstance(); - if (bcscomp.hasScriptName(token)) { - Set entries = bcscomp.getResForScriptName(token); - for (ResourceEntry entry : entries) { - // for now, just return the first entry - return entry; - } - } - else { - return null; - } - } - - // spell.ids - if (definition.equalsIgnoreCase("I:Spell*Spell")) { - IdsMapEntry idsSpell = IdsMapCache.get("spell.ids").lookup(token); - if (idsSpell != null) { - String spellID = String.valueOf(idsSpell.getID()); - int type = Character.digit(spellID.charAt(0), 10); - String splfile; - switch (type) { - case 1: - splfile = "SPPR"; - break; - - case 2: - splfile = "SPWI"; - break; - - case 3: - splfile = "SPIN"; - break; - - case 4: - splfile = "SPCL"; - break; - - default: - return null; - } - splfile += spellID.substring(1) + ".SPL"; - if (ResourceFactory.getInstance().resourceExists(splfile)) { - return ResourceFactory.getInstance().getResourceEntry(splfile); - } - - } - - // found nothing, if this line is reached - return null; - } - - // guessing - String[] possibleExtensions = guessExtension(function, definition); - for (final String ext : possibleExtensions) { - if (ResourceFactory.getInstance().resourceExists(token + ext)) { - return ResourceFactory.getInstance().getResourceEntry(token + ext); - } - } - - break; - } - } - return null; - } - - // most parts stolen from Compiler.java - private String[] guessExtension(String function, String definition) { - definition = definition.trim(); - // first the unique values - if (definition.equalsIgnoreCase("S:Area*") - || definition.equalsIgnoreCase("S:Area1*") - || definition.equalsIgnoreCase("S:Area2*") - || definition.equalsIgnoreCase("S:ToArea*") - || definition.equalsIgnoreCase("S:Areaname*") - || definition.equalsIgnoreCase("S:FromArea*")) { - return new String[] { ".ARE" }; - } - else if (definition.equalsIgnoreCase("S:BamResRef*")) { - return new String[] { ".BAM" }; - } - else if (definition.equals("S:CutScene*") - || definition.equalsIgnoreCase("S:ScriptFile*") - || definition.equalsIgnoreCase("S:Script*")) { - return new String[] { ".BCS" }; - } - else if (definition.equalsIgnoreCase("S:Palette*")) { - return new String[] { ".BMP" }; - } - else if (definition.equalsIgnoreCase("S:Item*") - || definition.equalsIgnoreCase("S:Take*") - || definition.equalsIgnoreCase("S:Give*") - || definition.equalsIgnoreCase("S:Item") - || definition.equalsIgnoreCase("S:OldObject*")) { - return new String[] { ".ITM" }; - } - else if (definition.equalsIgnoreCase("S:Parchment*")) { - return new String[] { ".MOS" }; - } - else if (definition.equalsIgnoreCase("S:Spell*") - || definition.equalsIgnoreCase("S:Res*")) { - return new String[] { ".SPL" }; - } - else if (definition.equalsIgnoreCase("S:Pool*")) { - return new String[] { ".SRC" }; - } - else if (definition.startsWith("S:Store*")) { - return new String[] { ".STO" }; - } - else if (definition.equalsIgnoreCase("S:Sound*") - || definition.equalsIgnoreCase("S:Voice*")) { - return new String[] { ".WAV" }; - } - else if (definition.equalsIgnoreCase("S:TextList*")) { - return new String[] { ".2DA" }; - } - // and now the ambiguous - else if (definition.equalsIgnoreCase("S:Effect*")) { - return new String[] { ".BAM", ".VVC" }; - } - else if (definition.equalsIgnoreCase("S:DialogFile*")) { - return new String[] { ".DLG", ".VVC" }; - } - else if (definition.equalsIgnoreCase("S:Object*")) { - return new String[] { ".ITM", ".VVC", ".BAM" }; - } - else if (definition.equalsIgnoreCase("S:NewObject*")) { - return new String[] { ".CRE", ".DLG", ".BCS", ".ITM" }; - } - else if (definition.equalsIgnoreCase("S:ResRef*")) { - return new String[]{".CRE", ".ITM", ".ARE", ".2DA", ".BCS", - ".MVE", ".SPL", ".DLG", ".VVC", ".BAM"}; - } - - return new String[] {}; - } - - private class ScriptPopupMenu extends JPopupMenu implements ActionListener { - private ResourceEntry resourceEntry = null; - private final JMenuItem mi_open = new JMenuItem("Open"); - private final JMenuItem mi_opennew = new JMenuItem("Open in new window"); - - ScriptPopupMenu() { - add(mi_open); - add(mi_opennew); - - mi_open.addActionListener(this); - mi_opennew.addActionListener(this); - } - - public void setResEntry(ResourceEntry resEntry) { - this.resourceEntry = resEntry; - } - public void actionPerformed(ActionEvent ev) { - if (ev.getSource() == mi_open) { - NearInfinity.getInstance().showResourceEntry(resourceEntry); - } - else if (ev.getSource() == mi_opennew) { - Resource res = ResourceFactory.getResource(resourceEntry); - new ViewFrame(NearInfinity.getInstance(), res); - } - } - } -} +package infinity.gui; + +import infinity.NearInfinity; +import infinity.resource.Resource; +import infinity.resource.ResourceFactory; +import infinity.resource.bcs.Compiler; +import infinity.resource.key.ResourceEntry; +import infinity.util.IdsMapCache; +import infinity.util.IdsMapEntry; + +import java.awt.BasicStroke; +import java.awt.Color; +import java.awt.FontMetrics; +import java.awt.Graphics; +import java.awt.Graphics2D; +import java.awt.Point; +import java.awt.Rectangle; +import java.awt.Stroke; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.awt.event.MouseAdapter; +import java.awt.event.MouseEvent; +import java.util.ArrayList; +import java.util.Set; + +import javax.swing.JMenuItem; +import javax.swing.JOptionPane; +import javax.swing.JPopupMenu; +import javax.swing.JTextArea; +import javax.swing.text.BadLocationException; +import javax.swing.text.Document; + +public class ScriptTextArea extends JTextArea { + ScriptPopupMenu menu = new ScriptPopupMenu(); + + public ScriptTextArea() { + super(); + addMouseListener(new MouseAdapter() { + public void mousePressed(MouseEvent ev) { + handlePopup(ev); + } + + public void mouseReleased(MouseEvent ev) { + handlePopup(ev); + } + }); + } + + // try to paint an indicator below "crosslinks" + protected void paintComponent(Graphics g) { + super.paintComponent(g); + Rectangle rect = g.getClipBounds(); + + // try to get the "lines" which need to be painted + int upperLine = 0; + int lowerLine = 0; + try { + upperLine = getLineOfOffset(viewToModel(new Point(rect.x, rect.y))); + lowerLine = getLineOfOffset(viewToModel(new Point(rect.x + rect.width, + rect.y + rect.height))); + } catch (BadLocationException e) { } + //System.err.println("would consider drawing from lines " + upperLine + " to " + lowerLine); + for (int line = upperLine; line <= lowerLine; line++) { + try { + int start = getLineStartOffset(line); + int end = getLineEndOffset(line) - 1; // newline + + int[][] linkOffsets = findLinksInSection(start, end); + if (linkOffsets.length == 0) { + continue; + } + + Graphics2D g2d = (Graphics2D) g; + // clear that line before doing anything + Color oldColor = g2d.getColor(); + g2d.setColor(getBackground()); + Rectangle rectStart = modelToView(start); + Rectangle rectEnd = modelToView(end); + g2d.drawLine(rectStart.x, rectStart.y + rectStart.height, + rectEnd.x, rectEnd.y + rectEnd.height); + g2d.setColor(oldColor); + + Stroke oldStroke = g2d.getStroke(); + g2d.setStroke(new BasicStroke(1, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, + 1, new float[] { 1, 2 }, 0)); + // now underline the crosslinks + for (int[] pair : linkOffsets) { + // convert into view coordinates + rectStart = modelToView(pair[0]); + rectEnd = modelToView(pair[1]); + g2d.drawLine(rectStart.x, rectStart.y + rectStart.height, + rectEnd.x, rectEnd.y + rectEnd.height); + } + g2d.setStroke(oldStroke); + } catch (BadLocationException e) { } + } + } + + // looks for "crosslinks" in script lines + private int[][] findLinksInSection(int start, int end) throws BadLocationException { + ArrayList links = new ArrayList(); + String linetext = getText(start, end - start); + + int posStartToken = -1; + for (int i = 0; i < linetext.length(); i++) { + if (linetext.charAt(i) == '"') { + if (posStartToken != -1) { + // found a "word", so check for possible crosslink + String token = linetext.substring(posStartToken + 1, i); + + if (findResEntry(linetext, posStartToken + 1, token) != null) { + // add it to our list of crosslinks + links.add(new int[] { start + posStartToken + 1, start + i }); + } + posStartToken = -1; + } + else { + posStartToken = i; + } + } + } + return links.toArray(new int[0][0]); + } + + private void handlePopup(MouseEvent ev) { + if (ev.isPopupTrigger()) { + try { + // get "word" under click + Document doc = getDocument(); + int offset = viewToModel(ev.getPoint()); + final int lineNr = getLineOfOffset(offset); + final int lineStart = getLineStartOffset(lineNr); + String line = doc.getText(lineStart, getLineEndOffset(lineNr) - lineStart); + offset = offset - lineStart; + + String token = getToken(line, offset, "\"", "(), "); // quoted + if (token == null) { + // fall back to ids token parsing + token = getToken(line, offset, ",()", "[].\" "); // IDS + if (token == null) { + return; + } + } + + ResourceEntry resEntry = findResEntry(line, offset, token); + menu.setResEntry(resEntry); + + if (resEntry != null) { + menu.show(this, ev.getX(), ev.getY()); + } + } + catch (BadLocationException ble) {} + } + } + + private String getToken(String line, int offset, String delims, String invalidChars) { + int tokenStart, tokenEnd; + for (tokenStart = offset; tokenStart > 0; tokenStart--) { + char current = line.charAt(tokenStart); + if (delims.indexOf(current) != -1) { + tokenStart++; + break; + } + else if (invalidChars.indexOf(current) != -1) { + return null; + } + } + for (tokenEnd = offset + 1; tokenEnd < line.length(); tokenEnd++) { + char current = line.charAt(tokenEnd); + if (delims.indexOf(current) != -1) { + break; + } + else if (invalidChars.indexOf(current) != -1) { + return null; + } + } + return line.substring(tokenStart, tokenEnd); + } + + private ResourceEntry findResEntry(String line, int offset, String token) { + // determine function name and param position + int parenLevel = 0; + int paramPos = 0; + int idx; + for (idx = offset; idx > 0; idx--) { + char current = line.charAt(idx); + if (current == ')') { + parenLevel++; + } + else if ((current == ',') && (parenLevel == 0)) { + paramPos++; + } + else if (current == '(') { + if (parenLevel == 0) { + // found end of corresponding function name + break; + } + parenLevel--; + } + } + + int endPos = idx; + while ((idx > 0) && (Character.isLetter(line.charAt(idx - 1)))) { + idx--; + } + String function = line.substring(idx, endPos); + + // lookup function name in trigger.ids / action.ids + String[] idsFiles = new String[] { "trigger.ids", "action.ids" }; + for (final String idsFile : idsFiles) { + IdsMapEntry idsEntry = IdsMapCache.get(idsFile).lookup(function + "("); + if (idsEntry != null) { + String[] paramDefs = idsEntry.getParameters().split(","); + String definition = paramDefs[paramPos]; + + // check script names (death var) + if (definition.equalsIgnoreCase("O:Object*") + || definition.equalsIgnoreCase("O:Target*") + || definition.equalsIgnoreCase("O:Actor*") + || (definition.equalsIgnoreCase("S:Name*") + && (function.equalsIgnoreCase("Dead") + || function.equalsIgnoreCase("Name") + || function.equalsIgnoreCase("NumDead(") + || function.equalsIgnoreCase("NumDeadGT(") + || function.equalsIgnoreCase("NumDeadLT(")))) { + Compiler bcscomp = Compiler.getInstance(); + if (bcscomp.hasScriptName(token)) { + Set entries = bcscomp.getResForScriptName(token); + for (ResourceEntry entry : entries) { + // for now, just return the first entry + return entry; + } + } + else { + return null; + } + } + + // spell.ids + if (definition.equalsIgnoreCase("I:Spell*Spell")) { + IdsMapEntry idsSpell = IdsMapCache.get("spell.ids").lookup(token); + if (idsSpell != null) { + String spellID = String.valueOf(idsSpell.getID()); + int type = Character.digit(spellID.charAt(0), 10); + String splfile; + switch (type) { + case 1: + splfile = "SPPR"; + break; + + case 2: + splfile = "SPWI"; + break; + + case 3: + splfile = "SPIN"; + break; + + case 4: + splfile = "SPCL"; + break; + + default: + return null; + } + splfile += spellID.substring(1) + ".SPL"; + if (ResourceFactory.getInstance().resourceExists(splfile)) { + return ResourceFactory.getInstance().getResourceEntry(splfile); + } + + } + + // found nothing, if this line is reached + return null; + } + + // guessing + String[] possibleExtensions = guessExtension(function, definition); + for (final String ext : possibleExtensions) { + if (ResourceFactory.getInstance().resourceExists(token + ext)) { + return ResourceFactory.getInstance().getResourceEntry(token + ext); + } + } + + break; + } + } + return null; + } + + // most parts stolen from Compiler.java + private String[] guessExtension(String function, String definition) { + definition = definition.trim(); + // first the unique values + if (definition.equalsIgnoreCase("S:Area*") + || definition.equalsIgnoreCase("S:Area1*") + || definition.equalsIgnoreCase("S:Area2*") + || definition.equalsIgnoreCase("S:ToArea*") + || definition.equalsIgnoreCase("S:Areaname*") + || definition.equalsIgnoreCase("S:FromArea*")) { + return new String[] { ".ARE" }; + } + else if (definition.equalsIgnoreCase("S:BamResRef*")) { + return new String[] { ".BAM" }; + } + else if (definition.equals("S:CutScene*") + || definition.equalsIgnoreCase("S:ScriptFile*") + || definition.equalsIgnoreCase("S:Script*")) { + return new String[] { ".BCS" }; + } + else if (definition.equalsIgnoreCase("S:Palette*")) { + return new String[] { ".BMP" }; + } + else if (definition.equalsIgnoreCase("S:Item*") + || definition.equalsIgnoreCase("S:Take*") + || definition.equalsIgnoreCase("S:Give*") + || definition.equalsIgnoreCase("S:Item") + || definition.equalsIgnoreCase("S:OldObject*")) { + return new String[] { ".ITM" }; + } + else if (definition.equalsIgnoreCase("S:Parchment*")) { + return new String[] { ".MOS" }; + } + else if (definition.equalsIgnoreCase("S:Spell*") + || definition.equalsIgnoreCase("S:Res*")) { + return new String[] { ".SPL" }; + } + else if (definition.equalsIgnoreCase("S:Pool*")) { + return new String[] { ".SRC" }; + } + else if (definition.startsWith("S:Store*")) { + return new String[] { ".STO" }; + } + else if (definition.equalsIgnoreCase("S:Sound*") + || definition.equalsIgnoreCase("S:Voice*")) { + return new String[] { ".WAV" }; + } + else if (definition.equalsIgnoreCase("S:TextList*")) { + return new String[] { ".2DA" }; + } + // and now the ambiguous + else if (definition.equalsIgnoreCase("S:Effect*")) { + return new String[] { ".BAM", ".VVC" }; + } + else if (definition.equalsIgnoreCase("S:DialogFile*")) { + return new String[] { ".DLG", ".VVC" }; + } + else if (definition.equalsIgnoreCase("S:Object*")) { + return new String[] { ".ITM", ".VVC", ".BAM" }; + } + else if (definition.equalsIgnoreCase("S:NewObject*")) { + return new String[] { ".CRE", ".DLG", ".BCS", ".ITM" }; + } + else if (definition.equalsIgnoreCase("S:ResRef*")) { + return new String[]{".CRE", ".ITM", ".ARE", ".2DA", ".BCS", + ".MVE", ".SPL", ".DLG", ".VVC", ".BAM"}; + } + + return new String[] {}; + } + + private class ScriptPopupMenu extends JPopupMenu implements ActionListener { + private ResourceEntry resourceEntry = null; + private final JMenuItem mi_open = new JMenuItem("Open"); + private final JMenuItem mi_opennew = new JMenuItem("Open in new window"); + + ScriptPopupMenu() { + add(mi_open); + add(mi_opennew); + + mi_open.addActionListener(this); + mi_opennew.addActionListener(this); + } + + public void setResEntry(ResourceEntry resEntry) { + this.resourceEntry = resEntry; + } + public void actionPerformed(ActionEvent ev) { + if (ev.getSource() == mi_open) { + NearInfinity.getInstance().showResourceEntry(resourceEntry); + } + else if (ev.getSource() == mi_opennew) { + Resource res = ResourceFactory.getResource(resourceEntry); + new ViewFrame(NearInfinity.getInstance(), res); + } + } + } +} diff --git a/infinity/resource/dlg/DialogItemRefSearcher.java b/infinity/resource/dlg/DialogItemRefSearcher.java index 0df9c6c..6afd942 100644 --- a/infinity/resource/dlg/DialogItemRefSearcher.java +++ b/infinity/resource/dlg/DialogItemRefSearcher.java @@ -1,128 +1,128 @@ -package infinity.resource.dlg; - -import infinity.resource.StructEntry; -import infinity.search.ReferenceHitFrame; - -import java.awt.Component; -import java.util.List; - -import javax.swing.JOptionPane; -import javax.swing.ProgressMonitor; - - -public class DialogItemRefSearcher implements Runnable { - - private final DlgResource dlg; - private final Object item; - private final Component parent; - private final ReferenceHitFrame hitFrame; - - public DialogItemRefSearcher(DlgResource dlg, Object item, Component parent) { - this.dlg = dlg; - this.parent = parent; - this.item = item; - hitFrame = new ReferenceHitFrame(item, parent); - new Thread(this).start(); - } - - public void run() { - List searchItems = dlg.getList(); - ProgressMonitor progress = new ProgressMonitor(parent, "Searching...", null, 0, searchItems.size()); - progress.setMillisToDecideToPopup(100); - long startTime = System.currentTimeMillis(); - for (int i = 0; i < searchItems.size(); i++) { - StructEntry entry = searchItems.get(i); - if (entry instanceof State || entry instanceof Transition || entry instanceof AbstractCode) { - search(entry); - } - progress.setProgress(i + 1); - if (progress.isCanceled()) { - JOptionPane.showMessageDialog(parent, "Search canceled", "Info", JOptionPane.INFORMATION_MESSAGE); - return; - } - } - System.out.println("Search completed: " + (System.currentTimeMillis() - startTime) + "ms."); - hitFrame.setVisible(true); - } - - void search(StructEntry entry) { - boolean found = false; - - // ugly dispatching, depending on what we have and what we look for - if (item instanceof State) { - // check transitions - if (entry instanceof Transition) { - State state = (State) item; - int stateNumber = state.getNumber(); - Transition trans = (Transition) entry; - String nextDialog = trans.getNextDialog().getResourceName(); - if ((trans.getNextDialogState() == stateNumber) - && (nextDialog.equalsIgnoreCase(dlg.getName()))) { - found = true; - } - } - } - else if (item instanceof Transition) { - // check states - if (entry instanceof State) { - Transition trans = (Transition) item; - State state = (State) entry; - int transNumber = trans.getNumber(); - int firstTrans = state.getFirstTrans(); - int transCount = state.getTransCount(); - if ((transNumber >= firstTrans) - && (transNumber < (firstTrans + transCount))) { - found = true; - } - } - } - else if (item instanceof StateTrigger) { - // check states - if (entry instanceof State) { - StateTrigger trigger = (StateTrigger) item; - State state = (State) entry; - int triggerNumber = getIndexFromName(trigger.getName()); - if (triggerNumber == state.getTriggerIndex()) { - found = true; - } - } - } - else if (item instanceof ResponseTrigger) { - // check transitions - if (entry instanceof Transition) { - ResponseTrigger trigger = (ResponseTrigger) item; - Transition trans = (Transition) entry; - int triggerNumber = getIndexFromName(trigger.getName()); - if (triggerNumber == trans.getTriggerIndex()) { - found = true; - } - } - } - else if (item instanceof Action) { - // check transitions - if (entry instanceof Transition) { - Action action = (Action) item; - Transition trans = (Transition) entry; - int actionNumber = getIndexFromName(action.getName()); - if (actionNumber == trans.getActionIndex()) { - found = true; - } - } - } - - if (found) { - hitFrame.addHit(dlg.getResourceEntry(), entry.getName(), entry); - } - } - - // tries to return the last number in the name - private int getIndexFromName(String name) { - int posSpace = name.lastIndexOf(' '); - if (posSpace != -1) { - try { - return Integer.parseInt(name.substring(posSpace + 1)); - } catch (NumberFormatException nfe) {} - } - return -1; - } +package infinity.resource.dlg; + +import infinity.resource.StructEntry; +import infinity.search.ReferenceHitFrame; + +import java.awt.Component; +import java.util.List; + +import javax.swing.JOptionPane; +import javax.swing.ProgressMonitor; + + +public class DialogItemRefSearcher implements Runnable { + + private final DlgResource dlg; + private final Object item; + private final Component parent; + private final ReferenceHitFrame hitFrame; + + public DialogItemRefSearcher(DlgResource dlg, Object item, Component parent) { + this.dlg = dlg; + this.parent = parent; + this.item = item; + hitFrame = new ReferenceHitFrame(item, parent); + new Thread(this).start(); + } + + public void run() { + List searchItems = dlg.getList(); + ProgressMonitor progress = new ProgressMonitor(parent, "Searching...", null, 0, searchItems.size()); + progress.setMillisToDecideToPopup(100); + long startTime = System.currentTimeMillis(); + for (int i = 0; i < searchItems.size(); i++) { + StructEntry entry = searchItems.get(i); + if (entry instanceof State || entry instanceof Transition || entry instanceof AbstractCode) { + search(entry); + } + progress.setProgress(i + 1); + if (progress.isCanceled()) { + JOptionPane.showMessageDialog(parent, "Search canceled", "Info", JOptionPane.INFORMATION_MESSAGE); + return; + } + } + System.out.println("Search completed: " + (System.currentTimeMillis() - startTime) + "ms."); + hitFrame.setVisible(true); + } + + void search(StructEntry entry) { + boolean found = false; + + // ugly dispatching, depending on what we have and what we look for + if (item instanceof State) { + // check transitions + if (entry instanceof Transition) { + State state = (State) item; + int stateNumber = state.getNumber(); + Transition trans = (Transition) entry; + String nextDialog = trans.getNextDialog().getResourceName(); + if ((trans.getNextDialogState() == stateNumber) + && (nextDialog.equalsIgnoreCase(dlg.getName()))) { + found = true; + } + } + } + else if (item instanceof Transition) { + // check states + if (entry instanceof State) { + Transition trans = (Transition) item; + State state = (State) entry; + int transNumber = trans.getNumber(); + int firstTrans = state.getFirstTrans(); + int transCount = state.getTransCount(); + if ((transNumber >= firstTrans) + && (transNumber < (firstTrans + transCount))) { + found = true; + } + } + } + else if (item instanceof StateTrigger) { + // check states + if (entry instanceof State) { + StateTrigger trigger = (StateTrigger) item; + State state = (State) entry; + int triggerNumber = getIndexFromName(trigger.getName()); + if (triggerNumber == state.getTriggerIndex()) { + found = true; + } + } + } + else if (item instanceof ResponseTrigger) { + // check transitions + if (entry instanceof Transition) { + ResponseTrigger trigger = (ResponseTrigger) item; + Transition trans = (Transition) entry; + int triggerNumber = getIndexFromName(trigger.getName()); + if (triggerNumber == trans.getTriggerIndex()) { + found = true; + } + } + } + else if (item instanceof Action) { + // check transitions + if (entry instanceof Transition) { + Action action = (Action) item; + Transition trans = (Transition) entry; + int actionNumber = getIndexFromName(action.getName()); + if (actionNumber == trans.getActionIndex()) { + found = true; + } + } + } + + if (found) { + hitFrame.addHit(dlg.getResourceEntry(), entry.getName(), entry); + } + } + + // tries to return the last number in the name + private int getIndexFromName(String name) { + int posSpace = name.lastIndexOf(' '); + if (posSpace != -1) { + try { + return Integer.parseInt(name.substring(posSpace + 1)); + } catch (NumberFormatException nfe) {} + } + return -1; + } } \ No newline at end of file From a372b4975cdd16be3a1a1d2aae49c6110b74cce8 Mon Sep 17 00:00:00 2001 From: FredrikLindgren Date: Fri, 20 Apr 2012 14:12:13 +0200 Subject: [PATCH 09/37] Add an option to turn off script name caching to improve preformance. Script names are cached to allow features like compile-time valididy checking, or the ability to right click on a script name to bring up the corresponding creature or area container. However, this comes with a performance cost, which may not be worth it under some circumstances. Add an option to the BrowserMenuBar to disable this behaviour and make setupScriptNames in the BCS compiler conditional on this option. --- infinity/gui/BrowserMenuBar.java | 7 +++++++ infinity/resource/bcs/Compiler.java | 4 +++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/infinity/gui/BrowserMenuBar.java b/infinity/gui/BrowserMenuBar.java index def1181..5e7236d 100644 --- a/infinity/gui/BrowserMenuBar.java +++ b/infinity/gui/BrowserMenuBar.java @@ -48,6 +48,7 @@ public final class BrowserMenuBar extends JMenuBar private static final String OPTION_AUTOCONVERT_WAV = "AutoconvertWAV"; private static final String OPTION_AUTOCHECK_BCS = "AutocheckBCS"; private static final String OPTION_CACHEOVERRIDE = "CacheOverride"; + private static final String OPTION_CHECKSCRIPTNAMES = "CheckScriptNames"; private static final String OPTION_SHOWOVERRIDES = "ShowOverridesIn"; private static final String OPTION_SHOWRESREF = "ShowResRef"; private static final String OPTION_LOOKANDFEEL = "LookAndFeel"; @@ -219,6 +220,7 @@ public void storePreferences() prefs.putBoolean(OPTION_AUTOCONVERT_WAV, optionAutoConvWAV.isSelected()); prefs.putBoolean(OPTION_AUTOCHECK_BCS, optionAutocheckBCS.isSelected()); prefs.putBoolean(OPTION_CACHEOVERRIDE, optionCacheOverride.isSelected()); + prefs.putBoolean(OPTION_CHECKSCRIPTNAMES, optionCheckScriptNames.isSelected()); prefs.putInt(OPTION_SHOWRESREF, getResRefMode()); prefs.putInt(OPTION_SHOWOVERRIDES, getOverrideMode()); prefs.putInt(OPTION_LOOKANDFEEL, getLookAndFeel()); @@ -269,6 +271,11 @@ private JMenu makeOptionsMenu(Preferences prefs, NearInfinity browser) optionCacheOverride.setToolTipText("Without this option selected, Refresh Tree is required " + "to discover new override files added while NI is open"); menu.add(optionCacheOverride); + optionCheckScriptNames = + new JCheckBoxMenuItem("Interactive script names", prefs.getBoolean(OPTION_CHECKSCRIPTNAMES, true)); + optionCheckScriptNames.setToolTipText("With this option disabled, performance may be boosted " + + "but many features involving script names will be disabled."); + menu.add(optionCheckScriptNames); menu.addSeparator(); diff --git a/infinity/resource/bcs/Compiler.java b/infinity/resource/bcs/Compiler.java index 9c43ce4..9e8c90c 100644 --- a/infinity/resource/bcs/Compiler.java +++ b/infinity/resource/bcs/Compiler.java @@ -6,6 +6,7 @@ import infinity.NearInfinity; import infinity.gui.StatusBar; +import infinity.gui.BrowserMenuBar; import infinity.resource.ResourceFactory; import infinity.resource.are.AreResource; import infinity.resource.cre.CreResource; @@ -105,7 +106,8 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_ICEWIND2) }; emptyObject = compileObject(null, ""); - setupScriptNames(); + if (BrowserMenuBar.getInstance().checkScriptNames()) + setupScriptNames(); } private void setupScriptNames() From b18701831b0aa561cb22771b8ac11c68c8be912a Mon Sep 17 00:00:00 2001 From: FredrikLindgren Date: Fri, 20 Apr 2012 15:31:36 +0200 Subject: [PATCH 10/37] w1.0.2b --- infinity/gui/BrowserMenuBar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infinity/gui/BrowserMenuBar.java b/infinity/gui/BrowserMenuBar.java index 5e7236d..872efeb 100644 --- a/infinity/gui/BrowserMenuBar.java +++ b/infinity/gui/BrowserMenuBar.java @@ -30,7 +30,7 @@ public final class BrowserMenuBar extends JMenuBar { - public static final String VERSION = "v1.33 beta 20"; + public static final String VERSION = "v1.33 w1.0.2b"; public static final int OVERRIDE_IN_THREE = 0, OVERRIDE_IN_OVERRIDE = 1, OVERRIDE_SPLIT = 2; public static final int LOOKFEEL_JAVA = 0, LOOKFEEL_WINDOWS = 1, LOOKFEEL_MOTIF = 2, LOOKFEEL_PLASTICXP = 3; public static final int RESREF_ONLY = 0, RESREF_REF_NAME = 1, RESREF_NAME_REF = 2; From 9183ffdd264fb6e9e8cae8d3eca130e913210ccb Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Thu, 3 May 2012 22:13:22 +0200 Subject: [PATCH 11/37] Add *.jar to .gitignore --- .gitignore | 1 + 1 file changed, 1 insertion(+) diff --git a/.gitignore b/.gitignore index 6b468b6..8e9e794 100644 --- a/.gitignore +++ b/.gitignore @@ -1 +1,2 @@ *.class +*.jar From 550f8baf5b595d23fb6fdcb75931cd4d6658ee65 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Thu, 3 May 2012 22:15:35 +0200 Subject: [PATCH 12/37] Resize some frames Under OpenJDK and/or X some frames are too small. Some components are hidden until the user manually resizes the frame. - Make the open file frame 30 units wider - Make the string lookup frame 40 units wider - Make the search frame 50 units wider - Make the main frame 30 units wider --- infinity/NearInfinity.java | 2 +- infinity/gui/OpenFileFrame.java | 2 +- infinity/gui/StringLookup.java | 2 +- infinity/search/SearchFrame.java | 2 +- 4 files changed, 4 insertions(+), 4 deletions(-) diff --git a/infinity/NearInfinity.java b/infinity/NearInfinity.java index 3d09ed8..0ae9d7f 100644 --- a/infinity/NearInfinity.java +++ b/infinity/NearInfinity.java @@ -193,7 +193,7 @@ public void windowClosing(WindowEvent event) pane.add(splith, BorderLayout.CENTER); pane.add(statusBar, BorderLayout.SOUTH); - setSize(prefs.getInt(WINDOW_SIZEX, 900), prefs.getInt(WINDOW_SIZEY, 700)); + setSize(prefs.getInt(WINDOW_SIZEX, 930), prefs.getInt(WINDOW_SIZEY, 700)); // setSize(900, 700); int centerX = (int)Toolkit.getDefaultToolkit().getScreenSize().getWidth() - getSize().width >> 1; int centerY = (int)Toolkit.getDefaultToolkit().getScreenSize().getHeight() - getSize().height >> 1; diff --git a/infinity/gui/OpenFileFrame.java b/infinity/gui/OpenFileFrame.java index 1f7b43f..ea07dee 100644 --- a/infinity/gui/OpenFileFrame.java +++ b/infinity/gui/OpenFileFrame.java @@ -153,7 +153,7 @@ public void mouseClicked(MouseEvent event) gbl.setConstraints(cbStayOpen, gbc); pane.add(cbStayOpen); - setSize(300, 400); + setSize(330, 400); Center.center(this, NearInfinity.getInstance().getBounds()); } diff --git a/infinity/gui/StringLookup.java b/infinity/gui/StringLookup.java index 20fe547..e62f8ba 100644 --- a/infinity/gui/StringLookup.java +++ b/infinity/gui/StringLookup.java @@ -46,7 +46,7 @@ final class StringLookup extends ChildFrame implements SearchClient gbl.setConstraints(findpanel, gbc); pane.add(findpanel); - setSize(500, 350); + setSize(540, 350); Center.center(this, NearInfinity.getInstance().getBounds()); } diff --git a/infinity/search/SearchFrame.java b/infinity/search/SearchFrame.java index 54ca6b3..a442b70 100644 --- a/infinity/search/SearchFrame.java +++ b/infinity/search/SearchFrame.java @@ -179,7 +179,7 @@ public void windowOpened(WindowEvent event) gbl.setConstraints(bpanel, gbc); pane.add(bpanel); - setSize(450, 450); + setSize(500, 450); Center.center(this, NearInfinity.getInstance().getBounds()); } From 9e1d6be41bee0e8999737542da1458175336fde0 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Thu, 3 May 2012 23:50:42 +0200 Subject: [PATCH 13/37] Additional flags Label the bits introduced by ToBEx and GEMRB in EFF, ITM, SPL and STO. --- infinity/resource/Effect.java | 5 ++++- infinity/resource/itm/Ability.java | 3 ++- infinity/resource/itm/ItmResource.java | 3 ++- infinity/resource/spl/SplResource.java | 4 +++- infinity/resource/sto/StoResource.java | 2 +- 5 files changed, 12 insertions(+), 5 deletions(-) diff --git a/infinity/resource/Effect.java b/infinity/resource/Effect.java index 64ad117..3a73f01 100644 --- a/infinity/resource/Effect.java +++ b/infinity/resource/Effect.java @@ -10,7 +10,10 @@ public final class Effect extends AbstractStruct implements AddRemovable { static final String s_savetype[] = {"No save", "Spell", "Breath weapon", "Paralyze/Poison/Death", "Rod/Staff/Wand", - "Petrify/Polymorph"}; + "Petrify/Polymorph", "", "", "", + "", "", "", "", "", "", "", "", + "", "", "", "", "", "", "", "", + "Ex: bypass mirror image"}; static final String s_savetype2[] = {"No save", "", "", "Fortitude", "Reflex", "Will"}; diff --git a/infinity/resource/itm/Ability.java b/infinity/resource/itm/Ability.java index c15fe26..2de11e9 100644 --- a/infinity/resource/itm/Ability.java +++ b/infinity/resource/itm/Ability.java @@ -18,7 +18,8 @@ final class Ability extends AbstractAbility implements AddRemovable, HasAddRemov private static final String[] s_abilityuse = {"", "Weapon slots", "", "Item slots", "Gem?"}; private static final String[] s_recharge = {"No flags set", "Add strength bonus", "Breakable", "", "", "", "", "", "", "", "", "Hostile", "Recharge after resting", - "", "", "", "", "Bypass armor", "Keen edge"}; + "", "", "", "", "Bypass armor", "Keen edge", "", "", "", "", "", "", + "", "Ex: toggle backstab", "Ex: cannot target invisible"}; Ability() throws Exception { diff --git a/infinity/resource/itm/ItmResource.java b/infinity/resource/itm/ItmResource.java index f75bd5e..26deca7 100644 --- a/infinity/resource/itm/ItmResource.java +++ b/infinity/resource/itm/ItmResource.java @@ -43,7 +43,8 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd "Earrings", "Tattoos", "Lenses", "Teeth"}; private static final String[] s_flags = {"None", "Unsellable", "Two-handed", "Droppable", "Displayable", - "Cursed", "Not copyable", "Magical", "Bow", "Silver", "Cold iron", "", "Conversable"}; + "Cursed", "Not copyable", "Magical", "Bow", "Silver", "Cold iron", "", "Conversable", "", "", "", "", + "", "", "", "", "", "", "", "", "Ex: not dispellable in magical weapon slot", "Ex: toggle critical hit aversion"}; private static final String[] s_flags11 = {"None", "Unsellable", "Two-handed", "Droppable", "Displayable", "Cursed", "Not copyable", "Magical", "", "Silver", "Cold iron", "Steel", "Conversable", diff --git a/infinity/resource/spl/SplResource.java b/infinity/resource/spl/SplResource.java index a236a4b..17cf93f 100644 --- a/infinity/resource/spl/SplResource.java +++ b/infinity/resource/spl/SplResource.java @@ -37,7 +37,9 @@ public final class SplResource extends AbstractStruct implements Resource, HasAd private static final String[] s_spellflag = {"No flags set", "", "", "", "", "", "", "", "", "", "", "Hostile", "No LOS required", "", "Outdoors only", - "Non-magical ability", "Trigger/Contingency"}; + "Non-magical ability", "Trigger/Contingency", + "", "", "", "", "", "", "", "", + "Ex: can target invisible", "Ex: can be cast when silenced"}; private static final String[] s_exclude = { "None", "Chaotic priest", "Evil priest", "Good priest", "... Neutral priest", "Lawful priest", "Neutral ... priest", "Abjurer", "Conjurer", "Diviner", "Enchanter", diff --git a/infinity/resource/sto/StoResource.java b/infinity/resource/sto/StoResource.java index d7c2256..05f2716 100644 --- a/infinity/resource/sto/StoResource.java +++ b/infinity/resource/sto/StoResource.java @@ -21,7 +21,7 @@ public final class StoResource extends AbstractStruct implements Resource, HasAd private static final String[] s_flag_bg2 = {"Can only rest", "Can buy", "Can sell", "Can identify", "Can steal", "Can donate", "Can buy cures", "Can buy drinks", "", "", "Tavern quality 1", "Tavern quality 2", - "", "Fence"}; + "", "Fence", "", "Ex: toggle recharge"}; private static final String[] s_rooms = {"No rooms available", "Peasant", "Merchant", "Noble", "Royal"}; public static String getSearchString(byte buffer[]) From 1ed0627db2961ce4dc5d67694edfae551b0f2977 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Fri, 4 May 2012 00:56:02 +0200 Subject: [PATCH 14/37] Fix a bug pertaining to the GUI and non-existent resource entries If a file held a reference to a non-existent resource entry, the View/Edit button would initially be enabled when you selected it. --- infinity/datatype/ResourceRef.java | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/infinity/datatype/ResourceRef.java b/infinity/datatype/ResourceRef.java index 632d5e0..f5faf89 100644 --- a/infinity/datatype/ResourceRef.java +++ b/infinity/datatype/ResourceRef.java @@ -132,7 +132,8 @@ public void mouseClicked(MouseEvent event) bUpdate.setActionCommand(StructViewer.UPDATE_VALUE); bView = new JButton("View/Edit", Icons.getIcon("Zoom16.gif")); bView.addActionListener(this); - bView.setEnabled(list.getSelectedValue() != null && list.getSelectedValue() != NONE); + bView.setEnabled(list.getSelectedValue() != null && list.getSelectedValue() != NONE + && ((ResourceRefEntry)list.getSelectedValue()).entry != null); list.addListSelectionListener(this); GridBagLayout gbl = new GridBagLayout(); From c0113b6d92ccc361c4522e4a297ce1eec42d1906 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Thu, 12 Jul 2012 23:36:44 +0200 Subject: [PATCH 15/37] Shorter flag labels Shorten two of the ToBEx/GemRB flags to avoid horizontal scrolling --- infinity/resource/itm/ItmResource.java | 2 +- infinity/resource/spl/SplResource.java | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/infinity/resource/itm/ItmResource.java b/infinity/resource/itm/ItmResource.java index 26deca7..6adf17c 100644 --- a/infinity/resource/itm/ItmResource.java +++ b/infinity/resource/itm/ItmResource.java @@ -44,7 +44,7 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd private static final String[] s_flags = {"None", "Unsellable", "Two-handed", "Droppable", "Displayable", "Cursed", "Not copyable", "Magical", "Bow", "Silver", "Cold iron", "", "Conversable", "", "", "", "", - "", "", "", "", "", "", "", "", "Ex: not dispellable in magical weapon slot", "Ex: toggle critical hit aversion"}; + "", "", "", "", "", "", "", "", "Ex: undispellable", "Ex: toggle critical hits"}; private static final String[] s_flags11 = {"None", "Unsellable", "Two-handed", "Droppable", "Displayable", "Cursed", "Not copyable", "Magical", "", "Silver", "Cold iron", "Steel", "Conversable", diff --git a/infinity/resource/spl/SplResource.java b/infinity/resource/spl/SplResource.java index 17cf93f..547a525 100644 --- a/infinity/resource/spl/SplResource.java +++ b/infinity/resource/spl/SplResource.java @@ -39,7 +39,7 @@ public final class SplResource extends AbstractStruct implements Resource, HasAd "No LOS required", "", "Outdoors only", "Non-magical ability", "Trigger/Contingency", "", "", "", "", "", "", "", "", - "Ex: can target invisible", "Ex: can be cast when silenced"}; + "Ex: can target invisible", "Ex: castable when silenced"}; private static final String[] s_exclude = { "None", "Chaotic priest", "Evil priest", "Good priest", "... Neutral priest", "Lawful priest", "Neutral ... priest", "Abjurer", "Conjurer", "Diviner", "Enchanter", From 3bd16ea43710a783ff1e98ded17d7704bc20976e Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Thu, 12 Jul 2012 23:39:54 +0200 Subject: [PATCH 16/37] Version 1.33, w1.0.3 --- infinity/gui/BrowserMenuBar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infinity/gui/BrowserMenuBar.java b/infinity/gui/BrowserMenuBar.java index 872efeb..b9f6af9 100644 --- a/infinity/gui/BrowserMenuBar.java +++ b/infinity/gui/BrowserMenuBar.java @@ -30,7 +30,7 @@ public final class BrowserMenuBar extends JMenuBar { - public static final String VERSION = "v1.33 w1.0.2b"; + public static final String VERSION = "v1.33 w1.0.3"; public static final int OVERRIDE_IN_THREE = 0, OVERRIDE_IN_OVERRIDE = 1, OVERRIDE_SPLIT = 2; public static final int LOOKFEEL_JAVA = 0, LOOKFEEL_WINDOWS = 1, LOOKFEEL_MOTIF = 2, LOOKFEEL_PLASTICXP = 3; public static final int RESREF_ONLY = 0, RESREF_REF_NAME = 1, RESREF_NAME_REF = 2; From 7e5e4b385627e532ea900b2bddcbb9a4a8e40003 Mon Sep 17 00:00:00 2001 From: Fred Richardson Date: Sat, 21 Jul 2012 01:05:48 -0400 Subject: [PATCH 17/37] minor changes to work easily with Eclipse --- build.xml | 8 ++++---- {infinity => src/infinity}/License.txt | 0 {infinity => src/infinity}/NearInfinity.java | 0 {infinity => src/infinity}/bsd-license.txt | 0 {infinity => src/infinity}/check/BCSIDSChecker.java | 0 {infinity => src/infinity}/check/CreInvChecker.java | 0 {infinity => src/infinity}/check/DialogCheker.java | 0 .../infinity}/check/EffectsIndexChecker.java | 0 {infinity => src/infinity}/check/IDSRefChecker.java | 0 {infinity => src/infinity}/check/ResRefChecker.java | 0 .../infinity}/check/ResourceUseChecker.java | 0 {infinity => src/infinity}/check/ScriptChecker.java | 0 .../infinity}/check/StringUseChecker.java | 0 {infinity => src/infinity}/check/StructChecker.java | 0 .../infinity}/datatype/AreResourceRef.java | 0 {infinity => src/infinity}/datatype/Bitmap.java | 0 {infinity => src/infinity}/datatype/ColorValue.java | 0 {infinity => src/infinity}/datatype/Datatype.java | 0 {infinity => src/infinity}/datatype/DecNumber.java | 0 {infinity => src/infinity}/datatype/Editable.java | 0 {infinity => src/infinity}/datatype/EffectType.java | 0 {infinity => src/infinity}/datatype/Flag.java | 0 {infinity => src/infinity}/datatype/HashBitmap.java | 0 {infinity => src/infinity}/datatype/HexNumber.java | 0 .../infinity}/datatype/IDSTargetEffect.java | 0 {infinity => src/infinity}/datatype/IdsBitmap.java | 0 {infinity => src/infinity}/datatype/IdsFlag.java | 0 .../infinity}/datatype/InlineEditable.java | 0 {infinity => src/infinity}/datatype/IwdRef.java | 0 .../infinity}/datatype/Kit2daBitmap.java | 0 {infinity => src/infinity}/datatype/ProRef.java | 0 .../infinity}/datatype/RemovableDecNumber.java | 0 .../infinity}/datatype/ResourceRef.java | 0 .../infinity}/datatype/SectionCount.java | 0 .../infinity}/datatype/SectionOffset.java | 0 .../infinity}/datatype/Song2daBitmap.java | 0 .../infinity}/datatype/SpawnResourceRef.java | 0 {infinity => src/infinity}/datatype/StringRef.java | 0 {infinity => src/infinity}/datatype/TextBitmap.java | 0 {infinity => src/infinity}/datatype/TextString.java | 0 {infinity => src/infinity}/datatype/Unknown.java | 0 .../infinity}/datatype/UnknownBinary.java | 0 .../infinity}/datatype/UnknownDecimal.java | 0 .../infinity}/datatype/UnsignDecNumber.java | 0 {infinity => src/infinity}/gui/BIFFEditor.java | 0 {infinity => src/infinity}/gui/BIFFEditorTable.java | 0 {infinity => src/infinity}/gui/BcsDropFrame.java | 0 {infinity => src/infinity}/gui/BrowserMenuBar.java | 0 {infinity => src/infinity}/gui/ButtonPopupMenu.java | 0 {infinity => src/infinity}/gui/Center.java | 0 {infinity => src/infinity}/gui/ChildFrame.java | 0 {infinity => src/infinity}/gui/ChooseBIFFrame.java | 0 {infinity => src/infinity}/gui/ClipboardViewer.java | 0 {infinity => src/infinity}/gui/DebugConsole.java | 0 {infinity => src/infinity}/gui/IdsBrowser.java | 0 {infinity => src/infinity}/gui/InfinityAmp.java | 0 {infinity => src/infinity}/gui/LinkButton.java | 0 {infinity => src/infinity}/gui/OpenFileFrame.java | 0 {infinity => src/infinity}/gui/ResourceTree.java | 0 {infinity => src/infinity}/gui/ScriptTextArea.java | 0 {infinity => src/infinity}/gui/SortableTable.java | 0 {infinity => src/infinity}/gui/StatusBar.java | 0 {infinity => src/infinity}/gui/StringEditor.java | 0 {infinity => src/infinity}/gui/StringLookup.java | 0 {infinity => src/infinity}/gui/StructViewer.java | 0 {infinity => src/infinity}/gui/TableItem.java | 0 {infinity => src/infinity}/gui/TextListPanel.java | 0 .../infinity}/gui/ToolTipTableCellRenderer.java | 0 {infinity => src/infinity}/gui/ViewFrame.java | 0 {infinity => src/infinity}/gui/ViewerUtil.java | 0 {infinity => src/infinity}/gui/WindowBlocker.java | 0 .../infinity}/gui/treetable/AbstractCellEditor.java | 0 .../gui/treetable/AbstractTreeTableModel.java | 0 .../infinity}/gui/treetable/JTreeTable.java | 0 .../infinity}/gui/treetable/TreeTableModel.java | 0 .../gui/treetable/TreeTableModelAdapter.java | 0 {infinity => src/infinity}/icon/About16.gif | Bin {infinity => src/infinity}/icon/Add16.gif | Bin {infinity => src/infinity}/icon/Application16.gif | Bin {infinity => src/infinity}/icon/Back16.gif | Bin {infinity => src/infinity}/icon/BlueCircle16.gif | Bin {infinity => src/infinity}/icon/BlueCircle20.gif | Bin {infinity => src/infinity}/icon/Bundle16.gif | Bin {infinity => src/infinity}/icon/Check16.gif | Bin {infinity => src/infinity}/icon/Check_Not16.gif | Bin {infinity => src/infinity}/icon/Circle20.gif | Bin {infinity => src/infinity}/icon/Color16.gif | Bin {infinity => src/infinity}/icon/Copy16.gif | Bin {infinity => src/infinity}/icon/Cut16.gif | Bin {infinity => src/infinity}/icon/Delete16.gif | Bin {infinity => src/infinity}/icon/Down16.gif | Bin {infinity => src/infinity}/icon/Edit16.gif | Bin {infinity => src/infinity}/icon/End16.gif | Bin {infinity => src/infinity}/icon/Exit16.gif | Bin {infinity => src/infinity}/icon/Export16.gif | Bin {infinity => src/infinity}/icon/Find16.gif | Bin {infinity => src/infinity}/icon/FindAgain16.gif | Bin {infinity => src/infinity}/icon/Forward16.gif | Bin {infinity => src/infinity}/icon/GreenCircle16.gif | Bin {infinity => src/infinity}/icon/Help16.gif | Bin {infinity => src/infinity}/icon/History16.gif | Bin {infinity => src/infinity}/icon/Icons.java | 0 {infinity => src/infinity}/icon/Import16.gif | Bin {infinity => src/infinity}/icon/Movie16.gif | Bin {infinity => src/infinity}/icon/New16.gif | Bin {infinity => src/infinity}/icon/Open16.gif | Bin {infinity => src/infinity}/icon/Paste16.gif | Bin {infinity => src/infinity}/icon/Play16.gif | Bin {infinity => src/infinity}/icon/Print16.gif | Bin {infinity => src/infinity}/icon/Properties16.gif | Bin {infinity => src/infinity}/icon/Redo16.gif | Bin {infinity => src/infinity}/icon/Refresh16.gif | Bin {infinity => src/infinity}/icon/Release16.gif | Bin {infinity => src/infinity}/icon/Remove16.gif | Bin .../infinity}/icon/RowInsertAfter16.gif | Bin {infinity => src/infinity}/icon/Save16.gif | Bin {infinity => src/infinity}/icon/StepBack16.gif | Bin {infinity => src/infinity}/icon/StepForward16.gif | Bin {infinity => src/infinity}/icon/Stop16.gif | Bin {infinity => src/infinity}/icon/Stop24.gif | Bin {infinity => src/infinity}/icon/Undo16.gif | Bin {infinity => src/infinity}/icon/Up16.gif | Bin {infinity => src/infinity}/icon/Volume16.gif | Bin {infinity => src/infinity}/icon/YellowCircle16.gif | Bin {infinity => src/infinity}/icon/YellowCircle20.gif | Bin {infinity => src/infinity}/icon/Zoom16.gif | Bin .../infinity}/resource/AbstractAbility.java | 0 .../infinity}/resource/AbstractStruct.java | 0 .../infinity}/resource/AddRemovable.java | 0 {infinity => src/infinity}/resource/Closeable.java | 0 {infinity => src/infinity}/resource/Effect.java | 0 {infinity => src/infinity}/resource/Effect2.java | 0 .../infinity}/resource/EffectFactory.java | 0 .../infinity}/resource/HasAddRemovable.java | 0 .../infinity}/resource/HasDetailViewer.java | 0 {infinity => src/infinity}/resource/Resource.java | 0 .../infinity}/resource/ResourceFactory.java | 0 .../infinity}/resource/StructEntry.java | 0 .../infinity}/resource/TextResource.java | 0 {infinity => src/infinity}/resource/Viewable.java | 0 .../infinity}/resource/ViewableContainer.java | 0 {infinity => src/infinity}/resource/Writeable.java | 0 {infinity => src/infinity}/resource/are/Actor.java | 0 .../infinity}/resource/are/Ambient.java | 0 .../infinity}/resource/are/Animation.java | 0 .../infinity}/resource/are/AreResource.java | 0 .../infinity}/resource/are/AutomapNote.java | 0 .../infinity}/resource/are/AutomapNotePST.java | 0 .../infinity}/resource/are/Container.java | 0 {infinity => src/infinity}/resource/are/Door.java | 0 .../infinity}/resource/are/Entrance.java | 0 .../infinity}/resource/are/HasVertices.java | 0 .../infinity}/resource/are/ITEPoint.java | 0 {infinity => src/infinity}/resource/are/Item.java | 0 .../infinity}/resource/are/ProTrap.java | 0 .../infinity}/resource/are/RestSpawn.java | 0 {infinity => src/infinity}/resource/are/Song.java | 0 .../infinity}/resource/are/SpawnPoint.java | 0 .../infinity}/resource/are/TiledObject.java | 0 .../infinity}/resource/are/Variable.java | 0 {infinity => src/infinity}/resource/are/Viewer.java | 0 .../infinity}/resource/are/ViewerActor.java | 0 .../infinity}/resource/are/ViewerContainer.java | 0 .../infinity}/resource/are/ViewerGraphics.java | 0 .../infinity}/resource/bcs/BafResource.java | 0 .../infinity}/resource/bcs/BcsResource.java | 0 .../infinity}/resource/bcs/Compiler.java | 0 .../infinity}/resource/bcs/Decompiler.java | 0 .../infinity}/resource/chu/ChuResource.java | 0 .../infinity}/resource/chu/Control.java | 0 {infinity => src/infinity}/resource/chu/Window.java | 0 .../infinity}/resource/cre/CreResource.java | 0 {infinity => src/infinity}/resource/cre/Item.java | 0 .../infinity}/resource/cre/Iwd2Ability.java | 0 .../infinity}/resource/cre/Iwd2Shape.java | 0 .../infinity}/resource/cre/Iwd2Song.java | 0 .../infinity}/resource/cre/Iwd2Spell.java | 0 .../infinity}/resource/cre/Iwd2Struct.java | 0 .../infinity}/resource/cre/KnownSpells.java | 0 .../infinity}/resource/cre/MemorizedSpells.java | 0 .../infinity}/resource/cre/SpellMemorization.java | 0 {infinity => src/infinity}/resource/cre/Viewer.java | 0 .../infinity}/resource/cre/ViewerItems.java | 0 .../infinity}/resource/cre/ViewerSpells.java | 0 .../infinity}/resource/dlg/AbstractCode.java | 0 {infinity => src/infinity}/resource/dlg/Action.java | 0 .../resource/dlg/DialogItemRefSearcher.java | 0 .../infinity}/resource/dlg/DlgResource.java | 0 .../infinity}/resource/dlg/ResponseTrigger.java | 0 {infinity => src/infinity}/resource/dlg/State.java | 0 .../infinity}/resource/dlg/StateTrigger.java | 0 .../infinity}/resource/dlg/Transition.java | 0 {infinity => src/infinity}/resource/dlg/Viewer.java | 0 .../infinity}/resource/gam/Familiar.java | 0 .../infinity}/resource/gam/GamResource.java | 0 .../infinity}/resource/gam/JournalEntry.java | 0 .../infinity}/resource/gam/KillVariable.java | 0 .../infinity}/resource/gam/NonPartyNPC.java | 0 .../infinity}/resource/gam/PartyNPC.java | 0 .../infinity}/resource/gam/StoredLocation.java | 0 .../infinity}/resource/gam/UnknownSection.java | 0 .../infinity}/resource/gam/UnknownSection2.java | 0 .../infinity}/resource/gam/UnknownSection3.java | 0 .../infinity}/resource/gam/Variable.java | 0 {infinity => src/infinity}/resource/gam/Viewer.java | 0 .../infinity}/resource/gam/ViewerNPC.java | 0 .../infinity}/resource/graphics/BamResource.java | 0 .../infinity}/resource/graphics/BmpResource.java | 0 .../infinity}/resource/graphics/Compressor.java | 0 .../infinity}/resource/graphics/MosResource.java | 0 .../infinity}/resource/graphics/MveResource.java | 0 .../infinity}/resource/graphics/Palette.java | 0 .../infinity}/resource/graphics/PltResource.java | 0 .../infinity}/resource/graphics/TgaResource.java | 0 .../infinity}/resource/graphics/TisResource.java | 0 .../infinity}/resource/graphics/mve.stub | Bin .../infinity}/resource/itm/Ability.java | 0 .../infinity}/resource/itm/ItmResource.java | 0 {infinity => src/infinity}/resource/itm/Viewer.java | 0 .../infinity}/resource/itm/ViewerAbility.java | 0 .../infinity}/resource/key/BIFFArchive.java | 0 .../infinity}/resource/key/BIFFEntry.java | 0 .../infinity}/resource/key/BIFFResourceEntry.java | 0 .../infinity}/resource/key/BIFFWriter.java | 0 .../infinity}/resource/key/FileResourceEntry.java | 0 .../infinity}/resource/key/Keyfile.java | 0 .../infinity}/resource/key/ResourceEntry.java | 0 .../infinity}/resource/key/ResourceTreeFolder.java | 0 .../infinity}/resource/key/ResourceTreeModel.java | 0 .../resource/kotor/GlobalVarsResource.java | 0 .../infinity}/resource/kotor/RimResource.java | 0 {infinity => src/infinity}/resource/mus/Entry.java | 0 .../infinity}/resource/mus/MusResource.java | 0 {infinity => src/infinity}/resource/mus/Viewer.java | 0 .../infinity}/resource/nwn/ErfResource.java | 0 .../infinity}/resource/nwn/NcsResource.java | 0 .../infinity}/resource/nwn/SsfResource.java | 0 .../infinity}/resource/nwn/TableTextResource.java | 0 .../resource/nwn/gff/DefaultGffEditor.java | 0 .../infinity}/resource/nwn/gff/GffResource.java | 0 .../infinity}/resource/nwn/gff/field/GffByte.java | 0 .../infinity}/resource/nwn/gff/field/GffChar.java | 0 .../infinity}/resource/nwn/gff/field/GffDouble.java | 0 .../infinity}/resource/nwn/gff/field/GffDword.java | 0 .../resource/nwn/gff/field/GffDword64.java | 0 .../resource/nwn/gff/field/GffExoLocString.java | 0 .../resource/nwn/gff/field/GffExoString.java | 0 .../infinity}/resource/nwn/gff/field/GffField.java | 0 .../infinity}/resource/nwn/gff/field/GffFloat.java | 0 .../infinity}/resource/nwn/gff/field/GffInt.java | 0 .../infinity}/resource/nwn/gff/field/GffInt64.java | 0 .../infinity}/resource/nwn/gff/field/GffList.java | 0 .../infinity}/resource/nwn/gff/field/GffResRef.java | 0 .../infinity}/resource/nwn/gff/field/GffShort.java | 0 .../infinity}/resource/nwn/gff/field/GffStruct.java | 0 .../infinity}/resource/nwn/gff/field/GffVoid.java | 0 .../infinity}/resource/nwn/gff/field/GffWord.java | 0 .../infinity}/resource/other/EffResource.java | 0 .../infinity}/resource/other/PlainTextResource.java | 0 .../infinity}/resource/other/ProResource.java | 0 .../infinity}/resource/other/UnknownResource.java | 0 .../infinity}/resource/other/VvcResource.java | 0 .../infinity}/resource/other/WfxResource.java | 0 .../infinity}/resource/sav/IOHandler.java | 0 .../infinity}/resource/sav/SavResource.java | 0 .../infinity}/resource/sound/AcmResource.java | 0 .../infinity}/resource/sound/SoundUtilities.java | 0 .../infinity}/resource/sound/WavResource.java | 0 .../infinity}/resource/spl/Ability.java | 0 .../infinity}/resource/spl/SplResource.java | 0 {infinity => src/infinity}/resource/spl/Viewer.java | 0 .../infinity}/resource/spl/ViewerAbility.java | 0 {infinity => src/infinity}/resource/src/Entry.java | 0 .../infinity}/resource/src/SrcResource.java | 0 {infinity => src/infinity}/resource/sto/Cure.java | 0 {infinity => src/infinity}/resource/sto/Drink.java | 0 .../infinity}/resource/sto/ItemSale.java | 0 .../infinity}/resource/sto/ItemSale11.java | 0 .../infinity}/resource/sto/Purchases.java | 0 .../infinity}/resource/sto/StoResource.java | 0 {infinity => src/infinity}/resource/sto/Viewer.java | 0 {infinity => src/infinity}/resource/var/Entry.java | 0 .../infinity}/resource/var/VarResource.java | 0 .../infinity}/resource/vertex/ClosedVertex.java | 0 .../resource/vertex/ClosedVertexImpeded.java | 0 .../infinity}/resource/vertex/OpenVertex.java | 0 .../resource/vertex/OpenVertexImpeded.java | 0 .../infinity}/resource/vertex/Vertex.java | 0 .../infinity}/resource/wed/ClosedPolygon.java | 0 {infinity => src/infinity}/resource/wed/Door.java | 0 .../infinity}/resource/wed/OpenPolygon.java | 0 .../infinity}/resource/wed/Overlay.java | 0 .../infinity}/resource/wed/Polygon.java | 0 .../infinity}/resource/wed/Tilemap.java | 0 .../infinity}/resource/wed/WallPolygon.java | 0 .../infinity}/resource/wed/Wallgroup.java | 0 .../infinity}/resource/wed/WedResource.java | 0 .../infinity}/resource/wmp/AreaEntry.java | 0 .../infinity}/resource/wmp/AreaLink.java | 0 .../infinity}/resource/wmp/AreaLinkEast.java | 0 .../infinity}/resource/wmp/AreaLinkNorth.java | 0 .../infinity}/resource/wmp/AreaLinkSouth.java | 0 .../infinity}/resource/wmp/AreaLinkWest.java | 0 .../infinity}/resource/wmp/MapEntry.java | 0 .../infinity}/resource/wmp/ViewerArea.java | 0 .../infinity}/resource/wmp/ViewerMap.java | 0 .../infinity}/resource/wmp/WmpResource.java | 0 .../infinity}/search/AbstractReferenceSearcher.java | 0 .../infinity}/search/AttributeSearcher.java | 0 .../infinity}/search/DialogSearcher.java | 0 .../search/DialogStateReferenceSearcher.java | 0 .../infinity}/search/ReferenceHitFrame.java | 0 .../infinity}/search/ReferenceSearcher.java | 0 .../infinity}/search/ScriptReferenceSearcher.java | 0 {infinity => src/infinity}/search/SearchClient.java | 0 {infinity => src/infinity}/search/SearchFrame.java | 0 {infinity => src/infinity}/search/SearchMaster.java | 0 .../infinity}/search/StringReferenceSearcher.java | 0 {infinity => src/infinity}/search/TextHitFrame.java | 0 .../infinity}/search/TextResourceSearcher.java | 0 .../infinity}/search/WavReferenceSearcher.java | 0 {infinity => src/infinity}/util/ArrayUtil.java | 0 {infinity => src/infinity}/util/Byteconvert.java | 0 {infinity => src/infinity}/util/Decryptor.java | 0 {infinity => src/infinity}/util/Filereader.java | 0 {infinity => src/infinity}/util/Filewriter.java | 0 {infinity => src/infinity}/util/IdsMap.java | 0 {infinity => src/infinity}/util/IdsMapCache.java | 0 {infinity => src/infinity}/util/IdsMapEntry.java | 0 {infinity => src/infinity}/util/IntegerHashMap.java | 0 .../infinity}/util/LongIntegerHashMap.java | 0 {infinity => src/infinity}/util/MassExporter.java | 0 {infinity => src/infinity}/util/StringResource.java | 0 .../infinity}/util/StructClipboard.java | 0 334 files changed, 4 insertions(+), 4 deletions(-) rename {infinity => src/infinity}/License.txt (100%) rename {infinity => src/infinity}/NearInfinity.java (100%) rename {infinity => src/infinity}/bsd-license.txt (100%) rename {infinity => src/infinity}/check/BCSIDSChecker.java (100%) rename {infinity => src/infinity}/check/CreInvChecker.java (100%) rename {infinity => src/infinity}/check/DialogCheker.java (100%) rename {infinity => src/infinity}/check/EffectsIndexChecker.java (100%) rename {infinity => src/infinity}/check/IDSRefChecker.java (100%) rename {infinity => src/infinity}/check/ResRefChecker.java (100%) rename {infinity => src/infinity}/check/ResourceUseChecker.java (100%) rename {infinity => src/infinity}/check/ScriptChecker.java (100%) rename {infinity => src/infinity}/check/StringUseChecker.java (100%) rename {infinity => src/infinity}/check/StructChecker.java (100%) rename {infinity => src/infinity}/datatype/AreResourceRef.java (100%) rename {infinity => src/infinity}/datatype/Bitmap.java (100%) rename {infinity => src/infinity}/datatype/ColorValue.java (100%) rename {infinity => src/infinity}/datatype/Datatype.java (100%) rename {infinity => src/infinity}/datatype/DecNumber.java (100%) rename {infinity => src/infinity}/datatype/Editable.java (100%) rename {infinity => src/infinity}/datatype/EffectType.java (100%) rename {infinity => src/infinity}/datatype/Flag.java (100%) rename {infinity => src/infinity}/datatype/HashBitmap.java (100%) rename {infinity => src/infinity}/datatype/HexNumber.java (100%) rename {infinity => src/infinity}/datatype/IDSTargetEffect.java (100%) rename {infinity => src/infinity}/datatype/IdsBitmap.java (100%) rename {infinity => src/infinity}/datatype/IdsFlag.java (100%) rename {infinity => src/infinity}/datatype/InlineEditable.java (100%) rename {infinity => src/infinity}/datatype/IwdRef.java (100%) rename {infinity => src/infinity}/datatype/Kit2daBitmap.java (100%) rename {infinity => src/infinity}/datatype/ProRef.java (100%) rename {infinity => src/infinity}/datatype/RemovableDecNumber.java (100%) rename {infinity => src/infinity}/datatype/ResourceRef.java (100%) rename {infinity => src/infinity}/datatype/SectionCount.java (100%) rename {infinity => src/infinity}/datatype/SectionOffset.java (100%) rename {infinity => src/infinity}/datatype/Song2daBitmap.java (100%) rename {infinity => src/infinity}/datatype/SpawnResourceRef.java (100%) rename {infinity => src/infinity}/datatype/StringRef.java (100%) rename {infinity => src/infinity}/datatype/TextBitmap.java (100%) rename {infinity => src/infinity}/datatype/TextString.java (100%) rename {infinity => src/infinity}/datatype/Unknown.java (100%) rename {infinity => src/infinity}/datatype/UnknownBinary.java (100%) rename {infinity => src/infinity}/datatype/UnknownDecimal.java (100%) rename {infinity => src/infinity}/datatype/UnsignDecNumber.java (100%) rename {infinity => src/infinity}/gui/BIFFEditor.java (100%) rename {infinity => src/infinity}/gui/BIFFEditorTable.java (100%) rename {infinity => src/infinity}/gui/BcsDropFrame.java (100%) rename {infinity => src/infinity}/gui/BrowserMenuBar.java (100%) rename {infinity => src/infinity}/gui/ButtonPopupMenu.java (100%) rename {infinity => src/infinity}/gui/Center.java (100%) rename {infinity => src/infinity}/gui/ChildFrame.java (100%) rename {infinity => src/infinity}/gui/ChooseBIFFrame.java (100%) rename {infinity => src/infinity}/gui/ClipboardViewer.java (100%) rename {infinity => src/infinity}/gui/DebugConsole.java (100%) rename {infinity => src/infinity}/gui/IdsBrowser.java (100%) rename {infinity => src/infinity}/gui/InfinityAmp.java (100%) rename {infinity => src/infinity}/gui/LinkButton.java (100%) rename {infinity => src/infinity}/gui/OpenFileFrame.java (100%) rename {infinity => src/infinity}/gui/ResourceTree.java (100%) rename {infinity => src/infinity}/gui/ScriptTextArea.java (100%) rename {infinity => src/infinity}/gui/SortableTable.java (100%) rename {infinity => src/infinity}/gui/StatusBar.java (100%) rename {infinity => src/infinity}/gui/StringEditor.java (100%) rename {infinity => src/infinity}/gui/StringLookup.java (100%) rename {infinity => src/infinity}/gui/StructViewer.java (100%) rename {infinity => src/infinity}/gui/TableItem.java (100%) rename {infinity => src/infinity}/gui/TextListPanel.java (100%) rename {infinity => src/infinity}/gui/ToolTipTableCellRenderer.java (100%) rename {infinity => src/infinity}/gui/ViewFrame.java (100%) rename {infinity => src/infinity}/gui/ViewerUtil.java (100%) rename {infinity => src/infinity}/gui/WindowBlocker.java (100%) rename {infinity => src/infinity}/gui/treetable/AbstractCellEditor.java (100%) rename {infinity => src/infinity}/gui/treetable/AbstractTreeTableModel.java (100%) rename {infinity => src/infinity}/gui/treetable/JTreeTable.java (100%) rename {infinity => src/infinity}/gui/treetable/TreeTableModel.java (100%) rename {infinity => src/infinity}/gui/treetable/TreeTableModelAdapter.java (100%) rename {infinity => src/infinity}/icon/About16.gif (100%) rename {infinity => src/infinity}/icon/Add16.gif (100%) rename {infinity => src/infinity}/icon/Application16.gif (100%) rename {infinity => src/infinity}/icon/Back16.gif (100%) rename {infinity => src/infinity}/icon/BlueCircle16.gif (100%) rename {infinity => src/infinity}/icon/BlueCircle20.gif (100%) rename {infinity => src/infinity}/icon/Bundle16.gif (100%) rename {infinity => src/infinity}/icon/Check16.gif (100%) rename {infinity => src/infinity}/icon/Check_Not16.gif (100%) rename {infinity => src/infinity}/icon/Circle20.gif (100%) rename {infinity => src/infinity}/icon/Color16.gif (100%) rename {infinity => src/infinity}/icon/Copy16.gif (100%) rename {infinity => src/infinity}/icon/Cut16.gif (100%) rename {infinity => src/infinity}/icon/Delete16.gif (100%) rename {infinity => src/infinity}/icon/Down16.gif (100%) rename {infinity => src/infinity}/icon/Edit16.gif (100%) rename {infinity => src/infinity}/icon/End16.gif (100%) rename {infinity => src/infinity}/icon/Exit16.gif (100%) rename {infinity => src/infinity}/icon/Export16.gif (100%) rename {infinity => src/infinity}/icon/Find16.gif (100%) rename {infinity => src/infinity}/icon/FindAgain16.gif (100%) rename {infinity => src/infinity}/icon/Forward16.gif (100%) rename {infinity => src/infinity}/icon/GreenCircle16.gif (100%) rename {infinity => src/infinity}/icon/Help16.gif (100%) rename {infinity => src/infinity}/icon/History16.gif (100%) rename {infinity => src/infinity}/icon/Icons.java (100%) rename {infinity => src/infinity}/icon/Import16.gif (100%) rename {infinity => src/infinity}/icon/Movie16.gif (100%) rename {infinity => src/infinity}/icon/New16.gif (100%) rename {infinity => src/infinity}/icon/Open16.gif (100%) rename {infinity => src/infinity}/icon/Paste16.gif (100%) rename {infinity => src/infinity}/icon/Play16.gif (100%) rename {infinity => src/infinity}/icon/Print16.gif (100%) rename {infinity => src/infinity}/icon/Properties16.gif (100%) rename {infinity => src/infinity}/icon/Redo16.gif (100%) rename {infinity => src/infinity}/icon/Refresh16.gif (100%) rename {infinity => src/infinity}/icon/Release16.gif (100%) rename {infinity => src/infinity}/icon/Remove16.gif (100%) rename {infinity => src/infinity}/icon/RowInsertAfter16.gif (100%) rename {infinity => src/infinity}/icon/Save16.gif (100%) rename {infinity => src/infinity}/icon/StepBack16.gif (100%) rename {infinity => src/infinity}/icon/StepForward16.gif (100%) rename {infinity => src/infinity}/icon/Stop16.gif (100%) rename {infinity => src/infinity}/icon/Stop24.gif (100%) rename {infinity => src/infinity}/icon/Undo16.gif (100%) rename {infinity => src/infinity}/icon/Up16.gif (100%) rename {infinity => src/infinity}/icon/Volume16.gif (100%) rename {infinity => src/infinity}/icon/YellowCircle16.gif (100%) rename {infinity => src/infinity}/icon/YellowCircle20.gif (100%) rename {infinity => src/infinity}/icon/Zoom16.gif (100%) rename {infinity => src/infinity}/resource/AbstractAbility.java (100%) rename {infinity => src/infinity}/resource/AbstractStruct.java (100%) rename {infinity => src/infinity}/resource/AddRemovable.java (100%) rename {infinity => src/infinity}/resource/Closeable.java (100%) rename {infinity => src/infinity}/resource/Effect.java (100%) rename {infinity => src/infinity}/resource/Effect2.java (100%) rename {infinity => src/infinity}/resource/EffectFactory.java (100%) rename {infinity => src/infinity}/resource/HasAddRemovable.java (100%) rename {infinity => src/infinity}/resource/HasDetailViewer.java (100%) rename {infinity => src/infinity}/resource/Resource.java (100%) rename {infinity => src/infinity}/resource/ResourceFactory.java (100%) rename {infinity => src/infinity}/resource/StructEntry.java (100%) rename {infinity => src/infinity}/resource/TextResource.java (100%) rename {infinity => src/infinity}/resource/Viewable.java (100%) rename {infinity => src/infinity}/resource/ViewableContainer.java (100%) rename {infinity => src/infinity}/resource/Writeable.java (100%) rename {infinity => src/infinity}/resource/are/Actor.java (100%) rename {infinity => src/infinity}/resource/are/Ambient.java (100%) rename {infinity => src/infinity}/resource/are/Animation.java (100%) rename {infinity => src/infinity}/resource/are/AreResource.java (100%) rename {infinity => src/infinity}/resource/are/AutomapNote.java (100%) rename {infinity => src/infinity}/resource/are/AutomapNotePST.java (100%) rename {infinity => src/infinity}/resource/are/Container.java (100%) rename {infinity => src/infinity}/resource/are/Door.java (100%) rename {infinity => src/infinity}/resource/are/Entrance.java (100%) rename {infinity => src/infinity}/resource/are/HasVertices.java (100%) rename {infinity => src/infinity}/resource/are/ITEPoint.java (100%) rename {infinity => src/infinity}/resource/are/Item.java (100%) rename {infinity => src/infinity}/resource/are/ProTrap.java (100%) rename {infinity => src/infinity}/resource/are/RestSpawn.java (100%) rename {infinity => src/infinity}/resource/are/Song.java (100%) rename {infinity => src/infinity}/resource/are/SpawnPoint.java (100%) rename {infinity => src/infinity}/resource/are/TiledObject.java (100%) rename {infinity => src/infinity}/resource/are/Variable.java (100%) rename {infinity => src/infinity}/resource/are/Viewer.java (100%) rename {infinity => src/infinity}/resource/are/ViewerActor.java (100%) rename {infinity => src/infinity}/resource/are/ViewerContainer.java (100%) rename {infinity => src/infinity}/resource/are/ViewerGraphics.java (100%) rename {infinity => src/infinity}/resource/bcs/BafResource.java (100%) rename {infinity => src/infinity}/resource/bcs/BcsResource.java (100%) rename {infinity => src/infinity}/resource/bcs/Compiler.java (100%) rename {infinity => src/infinity}/resource/bcs/Decompiler.java (100%) rename {infinity => src/infinity}/resource/chu/ChuResource.java (100%) rename {infinity => src/infinity}/resource/chu/Control.java (100%) rename {infinity => src/infinity}/resource/chu/Window.java (100%) rename {infinity => src/infinity}/resource/cre/CreResource.java (100%) rename {infinity => src/infinity}/resource/cre/Item.java (100%) rename {infinity => src/infinity}/resource/cre/Iwd2Ability.java (100%) rename {infinity => src/infinity}/resource/cre/Iwd2Shape.java (100%) rename {infinity => src/infinity}/resource/cre/Iwd2Song.java (100%) rename {infinity => src/infinity}/resource/cre/Iwd2Spell.java (100%) rename {infinity => src/infinity}/resource/cre/Iwd2Struct.java (100%) rename {infinity => src/infinity}/resource/cre/KnownSpells.java (100%) rename {infinity => src/infinity}/resource/cre/MemorizedSpells.java (100%) rename {infinity => src/infinity}/resource/cre/SpellMemorization.java (100%) rename {infinity => src/infinity}/resource/cre/Viewer.java (100%) rename {infinity => src/infinity}/resource/cre/ViewerItems.java (100%) rename {infinity => src/infinity}/resource/cre/ViewerSpells.java (100%) rename {infinity => src/infinity}/resource/dlg/AbstractCode.java (100%) rename {infinity => src/infinity}/resource/dlg/Action.java (100%) rename {infinity => src/infinity}/resource/dlg/DialogItemRefSearcher.java (100%) rename {infinity => src/infinity}/resource/dlg/DlgResource.java (100%) rename {infinity => src/infinity}/resource/dlg/ResponseTrigger.java (100%) rename {infinity => src/infinity}/resource/dlg/State.java (100%) rename {infinity => src/infinity}/resource/dlg/StateTrigger.java (100%) rename {infinity => src/infinity}/resource/dlg/Transition.java (100%) rename {infinity => src/infinity}/resource/dlg/Viewer.java (100%) rename {infinity => src/infinity}/resource/gam/Familiar.java (100%) rename {infinity => src/infinity}/resource/gam/GamResource.java (100%) rename {infinity => src/infinity}/resource/gam/JournalEntry.java (100%) rename {infinity => src/infinity}/resource/gam/KillVariable.java (100%) rename {infinity => src/infinity}/resource/gam/NonPartyNPC.java (100%) rename {infinity => src/infinity}/resource/gam/PartyNPC.java (100%) rename {infinity => src/infinity}/resource/gam/StoredLocation.java (100%) rename {infinity => src/infinity}/resource/gam/UnknownSection.java (100%) rename {infinity => src/infinity}/resource/gam/UnknownSection2.java (100%) rename {infinity => src/infinity}/resource/gam/UnknownSection3.java (100%) rename {infinity => src/infinity}/resource/gam/Variable.java (100%) rename {infinity => src/infinity}/resource/gam/Viewer.java (100%) rename {infinity => src/infinity}/resource/gam/ViewerNPC.java (100%) rename {infinity => src/infinity}/resource/graphics/BamResource.java (100%) rename {infinity => src/infinity}/resource/graphics/BmpResource.java (100%) rename {infinity => src/infinity}/resource/graphics/Compressor.java (100%) rename {infinity => src/infinity}/resource/graphics/MosResource.java (100%) rename {infinity => src/infinity}/resource/graphics/MveResource.java (100%) rename {infinity => src/infinity}/resource/graphics/Palette.java (100%) rename {infinity => src/infinity}/resource/graphics/PltResource.java (100%) rename {infinity => src/infinity}/resource/graphics/TgaResource.java (100%) rename {infinity => src/infinity}/resource/graphics/TisResource.java (100%) rename {infinity => src/infinity}/resource/graphics/mve.stub (100%) rename {infinity => src/infinity}/resource/itm/Ability.java (100%) rename {infinity => src/infinity}/resource/itm/ItmResource.java (100%) rename {infinity => src/infinity}/resource/itm/Viewer.java (100%) rename {infinity => src/infinity}/resource/itm/ViewerAbility.java (100%) rename {infinity => src/infinity}/resource/key/BIFFArchive.java (100%) rename {infinity => src/infinity}/resource/key/BIFFEntry.java (100%) rename {infinity => src/infinity}/resource/key/BIFFResourceEntry.java (100%) rename {infinity => src/infinity}/resource/key/BIFFWriter.java (100%) rename {infinity => src/infinity}/resource/key/FileResourceEntry.java (100%) rename {infinity => src/infinity}/resource/key/Keyfile.java (100%) rename {infinity => src/infinity}/resource/key/ResourceEntry.java (100%) rename {infinity => src/infinity}/resource/key/ResourceTreeFolder.java (100%) rename {infinity => src/infinity}/resource/key/ResourceTreeModel.java (100%) rename {infinity => src/infinity}/resource/kotor/GlobalVarsResource.java (100%) rename {infinity => src/infinity}/resource/kotor/RimResource.java (100%) rename {infinity => src/infinity}/resource/mus/Entry.java (100%) rename {infinity => src/infinity}/resource/mus/MusResource.java (100%) rename {infinity => src/infinity}/resource/mus/Viewer.java (100%) rename {infinity => src/infinity}/resource/nwn/ErfResource.java (100%) rename {infinity => src/infinity}/resource/nwn/NcsResource.java (100%) rename {infinity => src/infinity}/resource/nwn/SsfResource.java (100%) rename {infinity => src/infinity}/resource/nwn/TableTextResource.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/DefaultGffEditor.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/GffResource.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffByte.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffChar.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffDouble.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffDword.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffDword64.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffExoLocString.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffExoString.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffField.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffFloat.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffInt.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffInt64.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffList.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffResRef.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffShort.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffStruct.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffVoid.java (100%) rename {infinity => src/infinity}/resource/nwn/gff/field/GffWord.java (100%) rename {infinity => src/infinity}/resource/other/EffResource.java (100%) rename {infinity => src/infinity}/resource/other/PlainTextResource.java (100%) rename {infinity => src/infinity}/resource/other/ProResource.java (100%) rename {infinity => src/infinity}/resource/other/UnknownResource.java (100%) rename {infinity => src/infinity}/resource/other/VvcResource.java (100%) rename {infinity => src/infinity}/resource/other/WfxResource.java (100%) rename {infinity => src/infinity}/resource/sav/IOHandler.java (100%) rename {infinity => src/infinity}/resource/sav/SavResource.java (100%) rename {infinity => src/infinity}/resource/sound/AcmResource.java (100%) rename {infinity => src/infinity}/resource/sound/SoundUtilities.java (100%) rename {infinity => src/infinity}/resource/sound/WavResource.java (100%) rename {infinity => src/infinity}/resource/spl/Ability.java (100%) rename {infinity => src/infinity}/resource/spl/SplResource.java (100%) rename {infinity => src/infinity}/resource/spl/Viewer.java (100%) rename {infinity => src/infinity}/resource/spl/ViewerAbility.java (100%) rename {infinity => src/infinity}/resource/src/Entry.java (100%) rename {infinity => src/infinity}/resource/src/SrcResource.java (100%) rename {infinity => src/infinity}/resource/sto/Cure.java (100%) rename {infinity => src/infinity}/resource/sto/Drink.java (100%) rename {infinity => src/infinity}/resource/sto/ItemSale.java (100%) rename {infinity => src/infinity}/resource/sto/ItemSale11.java (100%) rename {infinity => src/infinity}/resource/sto/Purchases.java (100%) rename {infinity => src/infinity}/resource/sto/StoResource.java (100%) rename {infinity => src/infinity}/resource/sto/Viewer.java (100%) rename {infinity => src/infinity}/resource/var/Entry.java (100%) rename {infinity => src/infinity}/resource/var/VarResource.java (100%) rename {infinity => src/infinity}/resource/vertex/ClosedVertex.java (100%) rename {infinity => src/infinity}/resource/vertex/ClosedVertexImpeded.java (100%) rename {infinity => src/infinity}/resource/vertex/OpenVertex.java (100%) rename {infinity => src/infinity}/resource/vertex/OpenVertexImpeded.java (100%) rename {infinity => src/infinity}/resource/vertex/Vertex.java (100%) rename {infinity => src/infinity}/resource/wed/ClosedPolygon.java (100%) rename {infinity => src/infinity}/resource/wed/Door.java (100%) rename {infinity => src/infinity}/resource/wed/OpenPolygon.java (100%) rename {infinity => src/infinity}/resource/wed/Overlay.java (100%) rename {infinity => src/infinity}/resource/wed/Polygon.java (100%) rename {infinity => src/infinity}/resource/wed/Tilemap.java (100%) rename {infinity => src/infinity}/resource/wed/WallPolygon.java (100%) rename {infinity => src/infinity}/resource/wed/Wallgroup.java (100%) rename {infinity => src/infinity}/resource/wed/WedResource.java (100%) rename {infinity => src/infinity}/resource/wmp/AreaEntry.java (100%) rename {infinity => src/infinity}/resource/wmp/AreaLink.java (100%) rename {infinity => src/infinity}/resource/wmp/AreaLinkEast.java (100%) rename {infinity => src/infinity}/resource/wmp/AreaLinkNorth.java (100%) rename {infinity => src/infinity}/resource/wmp/AreaLinkSouth.java (100%) rename {infinity => src/infinity}/resource/wmp/AreaLinkWest.java (100%) rename {infinity => src/infinity}/resource/wmp/MapEntry.java (100%) rename {infinity => src/infinity}/resource/wmp/ViewerArea.java (100%) rename {infinity => src/infinity}/resource/wmp/ViewerMap.java (100%) rename {infinity => src/infinity}/resource/wmp/WmpResource.java (100%) rename {infinity => src/infinity}/search/AbstractReferenceSearcher.java (100%) rename {infinity => src/infinity}/search/AttributeSearcher.java (100%) rename {infinity => src/infinity}/search/DialogSearcher.java (100%) rename {infinity => src/infinity}/search/DialogStateReferenceSearcher.java (100%) rename {infinity => src/infinity}/search/ReferenceHitFrame.java (100%) rename {infinity => src/infinity}/search/ReferenceSearcher.java (100%) rename {infinity => src/infinity}/search/ScriptReferenceSearcher.java (100%) rename {infinity => src/infinity}/search/SearchClient.java (100%) rename {infinity => src/infinity}/search/SearchFrame.java (100%) rename {infinity => src/infinity}/search/SearchMaster.java (100%) rename {infinity => src/infinity}/search/StringReferenceSearcher.java (100%) rename {infinity => src/infinity}/search/TextHitFrame.java (100%) rename {infinity => src/infinity}/search/TextResourceSearcher.java (100%) rename {infinity => src/infinity}/search/WavReferenceSearcher.java (100%) rename {infinity => src/infinity}/util/ArrayUtil.java (100%) rename {infinity => src/infinity}/util/Byteconvert.java (100%) rename {infinity => src/infinity}/util/Decryptor.java (100%) rename {infinity => src/infinity}/util/Filereader.java (100%) rename {infinity => src/infinity}/util/Filewriter.java (100%) rename {infinity => src/infinity}/util/IdsMap.java (100%) rename {infinity => src/infinity}/util/IdsMapCache.java (100%) rename {infinity => src/infinity}/util/IdsMapEntry.java (100%) rename {infinity => src/infinity}/util/IntegerHashMap.java (100%) rename {infinity => src/infinity}/util/LongIntegerHashMap.java (100%) rename {infinity => src/infinity}/util/MassExporter.java (100%) rename {infinity => src/infinity}/util/StringResource.java (100%) rename {infinity => src/infinity}/util/StructClipboard.java (100%) diff --git a/build.xml b/build.xml index 3a40ac8..d7dc78e 100644 --- a/build.xml +++ b/build.xml @@ -1,9 +1,9 @@ - + - + @@ -13,7 +13,7 @@ diff --git a/infinity/License.txt b/src/infinity/License.txt similarity index 100% rename from infinity/License.txt rename to src/infinity/License.txt diff --git a/infinity/NearInfinity.java b/src/infinity/NearInfinity.java similarity index 100% rename from infinity/NearInfinity.java rename to src/infinity/NearInfinity.java diff --git a/infinity/bsd-license.txt b/src/infinity/bsd-license.txt similarity index 100% rename from infinity/bsd-license.txt rename to src/infinity/bsd-license.txt diff --git a/infinity/check/BCSIDSChecker.java b/src/infinity/check/BCSIDSChecker.java similarity index 100% rename from infinity/check/BCSIDSChecker.java rename to src/infinity/check/BCSIDSChecker.java diff --git a/infinity/check/CreInvChecker.java b/src/infinity/check/CreInvChecker.java similarity index 100% rename from infinity/check/CreInvChecker.java rename to src/infinity/check/CreInvChecker.java diff --git a/infinity/check/DialogCheker.java b/src/infinity/check/DialogCheker.java similarity index 100% rename from infinity/check/DialogCheker.java rename to src/infinity/check/DialogCheker.java diff --git a/infinity/check/EffectsIndexChecker.java b/src/infinity/check/EffectsIndexChecker.java similarity index 100% rename from infinity/check/EffectsIndexChecker.java rename to src/infinity/check/EffectsIndexChecker.java diff --git a/infinity/check/IDSRefChecker.java b/src/infinity/check/IDSRefChecker.java similarity index 100% rename from infinity/check/IDSRefChecker.java rename to src/infinity/check/IDSRefChecker.java diff --git a/infinity/check/ResRefChecker.java b/src/infinity/check/ResRefChecker.java similarity index 100% rename from infinity/check/ResRefChecker.java rename to src/infinity/check/ResRefChecker.java diff --git a/infinity/check/ResourceUseChecker.java b/src/infinity/check/ResourceUseChecker.java similarity index 100% rename from infinity/check/ResourceUseChecker.java rename to src/infinity/check/ResourceUseChecker.java diff --git a/infinity/check/ScriptChecker.java b/src/infinity/check/ScriptChecker.java similarity index 100% rename from infinity/check/ScriptChecker.java rename to src/infinity/check/ScriptChecker.java diff --git a/infinity/check/StringUseChecker.java b/src/infinity/check/StringUseChecker.java similarity index 100% rename from infinity/check/StringUseChecker.java rename to src/infinity/check/StringUseChecker.java diff --git a/infinity/check/StructChecker.java b/src/infinity/check/StructChecker.java similarity index 100% rename from infinity/check/StructChecker.java rename to src/infinity/check/StructChecker.java diff --git a/infinity/datatype/AreResourceRef.java b/src/infinity/datatype/AreResourceRef.java similarity index 100% rename from infinity/datatype/AreResourceRef.java rename to src/infinity/datatype/AreResourceRef.java diff --git a/infinity/datatype/Bitmap.java b/src/infinity/datatype/Bitmap.java similarity index 100% rename from infinity/datatype/Bitmap.java rename to src/infinity/datatype/Bitmap.java diff --git a/infinity/datatype/ColorValue.java b/src/infinity/datatype/ColorValue.java similarity index 100% rename from infinity/datatype/ColorValue.java rename to src/infinity/datatype/ColorValue.java diff --git a/infinity/datatype/Datatype.java b/src/infinity/datatype/Datatype.java similarity index 100% rename from infinity/datatype/Datatype.java rename to src/infinity/datatype/Datatype.java diff --git a/infinity/datatype/DecNumber.java b/src/infinity/datatype/DecNumber.java similarity index 100% rename from infinity/datatype/DecNumber.java rename to src/infinity/datatype/DecNumber.java diff --git a/infinity/datatype/Editable.java b/src/infinity/datatype/Editable.java similarity index 100% rename from infinity/datatype/Editable.java rename to src/infinity/datatype/Editable.java diff --git a/infinity/datatype/EffectType.java b/src/infinity/datatype/EffectType.java similarity index 100% rename from infinity/datatype/EffectType.java rename to src/infinity/datatype/EffectType.java diff --git a/infinity/datatype/Flag.java b/src/infinity/datatype/Flag.java similarity index 100% rename from infinity/datatype/Flag.java rename to src/infinity/datatype/Flag.java diff --git a/infinity/datatype/HashBitmap.java b/src/infinity/datatype/HashBitmap.java similarity index 100% rename from infinity/datatype/HashBitmap.java rename to src/infinity/datatype/HashBitmap.java diff --git a/infinity/datatype/HexNumber.java b/src/infinity/datatype/HexNumber.java similarity index 100% rename from infinity/datatype/HexNumber.java rename to src/infinity/datatype/HexNumber.java diff --git a/infinity/datatype/IDSTargetEffect.java b/src/infinity/datatype/IDSTargetEffect.java similarity index 100% rename from infinity/datatype/IDSTargetEffect.java rename to src/infinity/datatype/IDSTargetEffect.java diff --git a/infinity/datatype/IdsBitmap.java b/src/infinity/datatype/IdsBitmap.java similarity index 100% rename from infinity/datatype/IdsBitmap.java rename to src/infinity/datatype/IdsBitmap.java diff --git a/infinity/datatype/IdsFlag.java b/src/infinity/datatype/IdsFlag.java similarity index 100% rename from infinity/datatype/IdsFlag.java rename to src/infinity/datatype/IdsFlag.java diff --git a/infinity/datatype/InlineEditable.java b/src/infinity/datatype/InlineEditable.java similarity index 100% rename from infinity/datatype/InlineEditable.java rename to src/infinity/datatype/InlineEditable.java diff --git a/infinity/datatype/IwdRef.java b/src/infinity/datatype/IwdRef.java similarity index 100% rename from infinity/datatype/IwdRef.java rename to src/infinity/datatype/IwdRef.java diff --git a/infinity/datatype/Kit2daBitmap.java b/src/infinity/datatype/Kit2daBitmap.java similarity index 100% rename from infinity/datatype/Kit2daBitmap.java rename to src/infinity/datatype/Kit2daBitmap.java diff --git a/infinity/datatype/ProRef.java b/src/infinity/datatype/ProRef.java similarity index 100% rename from infinity/datatype/ProRef.java rename to src/infinity/datatype/ProRef.java diff --git a/infinity/datatype/RemovableDecNumber.java b/src/infinity/datatype/RemovableDecNumber.java similarity index 100% rename from infinity/datatype/RemovableDecNumber.java rename to src/infinity/datatype/RemovableDecNumber.java diff --git a/infinity/datatype/ResourceRef.java b/src/infinity/datatype/ResourceRef.java similarity index 100% rename from infinity/datatype/ResourceRef.java rename to src/infinity/datatype/ResourceRef.java diff --git a/infinity/datatype/SectionCount.java b/src/infinity/datatype/SectionCount.java similarity index 100% rename from infinity/datatype/SectionCount.java rename to src/infinity/datatype/SectionCount.java diff --git a/infinity/datatype/SectionOffset.java b/src/infinity/datatype/SectionOffset.java similarity index 100% rename from infinity/datatype/SectionOffset.java rename to src/infinity/datatype/SectionOffset.java diff --git a/infinity/datatype/Song2daBitmap.java b/src/infinity/datatype/Song2daBitmap.java similarity index 100% rename from infinity/datatype/Song2daBitmap.java rename to src/infinity/datatype/Song2daBitmap.java diff --git a/infinity/datatype/SpawnResourceRef.java b/src/infinity/datatype/SpawnResourceRef.java similarity index 100% rename from infinity/datatype/SpawnResourceRef.java rename to src/infinity/datatype/SpawnResourceRef.java diff --git a/infinity/datatype/StringRef.java b/src/infinity/datatype/StringRef.java similarity index 100% rename from infinity/datatype/StringRef.java rename to src/infinity/datatype/StringRef.java diff --git a/infinity/datatype/TextBitmap.java b/src/infinity/datatype/TextBitmap.java similarity index 100% rename from infinity/datatype/TextBitmap.java rename to src/infinity/datatype/TextBitmap.java diff --git a/infinity/datatype/TextString.java b/src/infinity/datatype/TextString.java similarity index 100% rename from infinity/datatype/TextString.java rename to src/infinity/datatype/TextString.java diff --git a/infinity/datatype/Unknown.java b/src/infinity/datatype/Unknown.java similarity index 100% rename from infinity/datatype/Unknown.java rename to src/infinity/datatype/Unknown.java diff --git a/infinity/datatype/UnknownBinary.java b/src/infinity/datatype/UnknownBinary.java similarity index 100% rename from infinity/datatype/UnknownBinary.java rename to src/infinity/datatype/UnknownBinary.java diff --git a/infinity/datatype/UnknownDecimal.java b/src/infinity/datatype/UnknownDecimal.java similarity index 100% rename from infinity/datatype/UnknownDecimal.java rename to src/infinity/datatype/UnknownDecimal.java diff --git a/infinity/datatype/UnsignDecNumber.java b/src/infinity/datatype/UnsignDecNumber.java similarity index 100% rename from infinity/datatype/UnsignDecNumber.java rename to src/infinity/datatype/UnsignDecNumber.java diff --git a/infinity/gui/BIFFEditor.java b/src/infinity/gui/BIFFEditor.java similarity index 100% rename from infinity/gui/BIFFEditor.java rename to src/infinity/gui/BIFFEditor.java diff --git a/infinity/gui/BIFFEditorTable.java b/src/infinity/gui/BIFFEditorTable.java similarity index 100% rename from infinity/gui/BIFFEditorTable.java rename to src/infinity/gui/BIFFEditorTable.java diff --git a/infinity/gui/BcsDropFrame.java b/src/infinity/gui/BcsDropFrame.java similarity index 100% rename from infinity/gui/BcsDropFrame.java rename to src/infinity/gui/BcsDropFrame.java diff --git a/infinity/gui/BrowserMenuBar.java b/src/infinity/gui/BrowserMenuBar.java similarity index 100% rename from infinity/gui/BrowserMenuBar.java rename to src/infinity/gui/BrowserMenuBar.java diff --git a/infinity/gui/ButtonPopupMenu.java b/src/infinity/gui/ButtonPopupMenu.java similarity index 100% rename from infinity/gui/ButtonPopupMenu.java rename to src/infinity/gui/ButtonPopupMenu.java diff --git a/infinity/gui/Center.java b/src/infinity/gui/Center.java similarity index 100% rename from infinity/gui/Center.java rename to src/infinity/gui/Center.java diff --git a/infinity/gui/ChildFrame.java b/src/infinity/gui/ChildFrame.java similarity index 100% rename from infinity/gui/ChildFrame.java rename to src/infinity/gui/ChildFrame.java diff --git a/infinity/gui/ChooseBIFFrame.java b/src/infinity/gui/ChooseBIFFrame.java similarity index 100% rename from infinity/gui/ChooseBIFFrame.java rename to src/infinity/gui/ChooseBIFFrame.java diff --git a/infinity/gui/ClipboardViewer.java b/src/infinity/gui/ClipboardViewer.java similarity index 100% rename from infinity/gui/ClipboardViewer.java rename to src/infinity/gui/ClipboardViewer.java diff --git a/infinity/gui/DebugConsole.java b/src/infinity/gui/DebugConsole.java similarity index 100% rename from infinity/gui/DebugConsole.java rename to src/infinity/gui/DebugConsole.java diff --git a/infinity/gui/IdsBrowser.java b/src/infinity/gui/IdsBrowser.java similarity index 100% rename from infinity/gui/IdsBrowser.java rename to src/infinity/gui/IdsBrowser.java diff --git a/infinity/gui/InfinityAmp.java b/src/infinity/gui/InfinityAmp.java similarity index 100% rename from infinity/gui/InfinityAmp.java rename to src/infinity/gui/InfinityAmp.java diff --git a/infinity/gui/LinkButton.java b/src/infinity/gui/LinkButton.java similarity index 100% rename from infinity/gui/LinkButton.java rename to src/infinity/gui/LinkButton.java diff --git a/infinity/gui/OpenFileFrame.java b/src/infinity/gui/OpenFileFrame.java similarity index 100% rename from infinity/gui/OpenFileFrame.java rename to src/infinity/gui/OpenFileFrame.java diff --git a/infinity/gui/ResourceTree.java b/src/infinity/gui/ResourceTree.java similarity index 100% rename from infinity/gui/ResourceTree.java rename to src/infinity/gui/ResourceTree.java diff --git a/infinity/gui/ScriptTextArea.java b/src/infinity/gui/ScriptTextArea.java similarity index 100% rename from infinity/gui/ScriptTextArea.java rename to src/infinity/gui/ScriptTextArea.java diff --git a/infinity/gui/SortableTable.java b/src/infinity/gui/SortableTable.java similarity index 100% rename from infinity/gui/SortableTable.java rename to src/infinity/gui/SortableTable.java diff --git a/infinity/gui/StatusBar.java b/src/infinity/gui/StatusBar.java similarity index 100% rename from infinity/gui/StatusBar.java rename to src/infinity/gui/StatusBar.java diff --git a/infinity/gui/StringEditor.java b/src/infinity/gui/StringEditor.java similarity index 100% rename from infinity/gui/StringEditor.java rename to src/infinity/gui/StringEditor.java diff --git a/infinity/gui/StringLookup.java b/src/infinity/gui/StringLookup.java similarity index 100% rename from infinity/gui/StringLookup.java rename to src/infinity/gui/StringLookup.java diff --git a/infinity/gui/StructViewer.java b/src/infinity/gui/StructViewer.java similarity index 100% rename from infinity/gui/StructViewer.java rename to src/infinity/gui/StructViewer.java diff --git a/infinity/gui/TableItem.java b/src/infinity/gui/TableItem.java similarity index 100% rename from infinity/gui/TableItem.java rename to src/infinity/gui/TableItem.java diff --git a/infinity/gui/TextListPanel.java b/src/infinity/gui/TextListPanel.java similarity index 100% rename from infinity/gui/TextListPanel.java rename to src/infinity/gui/TextListPanel.java diff --git a/infinity/gui/ToolTipTableCellRenderer.java b/src/infinity/gui/ToolTipTableCellRenderer.java similarity index 100% rename from infinity/gui/ToolTipTableCellRenderer.java rename to src/infinity/gui/ToolTipTableCellRenderer.java diff --git a/infinity/gui/ViewFrame.java b/src/infinity/gui/ViewFrame.java similarity index 100% rename from infinity/gui/ViewFrame.java rename to src/infinity/gui/ViewFrame.java diff --git a/infinity/gui/ViewerUtil.java b/src/infinity/gui/ViewerUtil.java similarity index 100% rename from infinity/gui/ViewerUtil.java rename to src/infinity/gui/ViewerUtil.java diff --git a/infinity/gui/WindowBlocker.java b/src/infinity/gui/WindowBlocker.java similarity index 100% rename from infinity/gui/WindowBlocker.java rename to src/infinity/gui/WindowBlocker.java diff --git a/infinity/gui/treetable/AbstractCellEditor.java b/src/infinity/gui/treetable/AbstractCellEditor.java similarity index 100% rename from infinity/gui/treetable/AbstractCellEditor.java rename to src/infinity/gui/treetable/AbstractCellEditor.java diff --git a/infinity/gui/treetable/AbstractTreeTableModel.java b/src/infinity/gui/treetable/AbstractTreeTableModel.java similarity index 100% rename from infinity/gui/treetable/AbstractTreeTableModel.java rename to src/infinity/gui/treetable/AbstractTreeTableModel.java diff --git a/infinity/gui/treetable/JTreeTable.java b/src/infinity/gui/treetable/JTreeTable.java similarity index 100% rename from infinity/gui/treetable/JTreeTable.java rename to src/infinity/gui/treetable/JTreeTable.java diff --git a/infinity/gui/treetable/TreeTableModel.java b/src/infinity/gui/treetable/TreeTableModel.java similarity index 100% rename from infinity/gui/treetable/TreeTableModel.java rename to src/infinity/gui/treetable/TreeTableModel.java diff --git a/infinity/gui/treetable/TreeTableModelAdapter.java b/src/infinity/gui/treetable/TreeTableModelAdapter.java similarity index 100% rename from infinity/gui/treetable/TreeTableModelAdapter.java rename to src/infinity/gui/treetable/TreeTableModelAdapter.java diff --git a/infinity/icon/About16.gif b/src/infinity/icon/About16.gif similarity index 100% rename from infinity/icon/About16.gif rename to src/infinity/icon/About16.gif diff --git a/infinity/icon/Add16.gif b/src/infinity/icon/Add16.gif similarity index 100% rename from infinity/icon/Add16.gif rename to src/infinity/icon/Add16.gif diff --git a/infinity/icon/Application16.gif b/src/infinity/icon/Application16.gif similarity index 100% rename from infinity/icon/Application16.gif rename to src/infinity/icon/Application16.gif diff --git a/infinity/icon/Back16.gif b/src/infinity/icon/Back16.gif similarity index 100% rename from infinity/icon/Back16.gif rename to src/infinity/icon/Back16.gif diff --git a/infinity/icon/BlueCircle16.gif b/src/infinity/icon/BlueCircle16.gif similarity index 100% rename from infinity/icon/BlueCircle16.gif rename to src/infinity/icon/BlueCircle16.gif diff --git a/infinity/icon/BlueCircle20.gif b/src/infinity/icon/BlueCircle20.gif similarity index 100% rename from infinity/icon/BlueCircle20.gif rename to src/infinity/icon/BlueCircle20.gif diff --git a/infinity/icon/Bundle16.gif b/src/infinity/icon/Bundle16.gif similarity index 100% rename from infinity/icon/Bundle16.gif rename to src/infinity/icon/Bundle16.gif diff --git a/infinity/icon/Check16.gif b/src/infinity/icon/Check16.gif similarity index 100% rename from infinity/icon/Check16.gif rename to src/infinity/icon/Check16.gif diff --git a/infinity/icon/Check_Not16.gif b/src/infinity/icon/Check_Not16.gif similarity index 100% rename from infinity/icon/Check_Not16.gif rename to src/infinity/icon/Check_Not16.gif diff --git a/infinity/icon/Circle20.gif b/src/infinity/icon/Circle20.gif similarity index 100% rename from infinity/icon/Circle20.gif rename to src/infinity/icon/Circle20.gif diff --git a/infinity/icon/Color16.gif b/src/infinity/icon/Color16.gif similarity index 100% rename from infinity/icon/Color16.gif rename to src/infinity/icon/Color16.gif diff --git a/infinity/icon/Copy16.gif b/src/infinity/icon/Copy16.gif similarity index 100% rename from infinity/icon/Copy16.gif rename to src/infinity/icon/Copy16.gif diff --git a/infinity/icon/Cut16.gif b/src/infinity/icon/Cut16.gif similarity index 100% rename from infinity/icon/Cut16.gif rename to src/infinity/icon/Cut16.gif diff --git a/infinity/icon/Delete16.gif b/src/infinity/icon/Delete16.gif similarity index 100% rename from infinity/icon/Delete16.gif rename to src/infinity/icon/Delete16.gif diff --git a/infinity/icon/Down16.gif b/src/infinity/icon/Down16.gif similarity index 100% rename from infinity/icon/Down16.gif rename to src/infinity/icon/Down16.gif diff --git a/infinity/icon/Edit16.gif b/src/infinity/icon/Edit16.gif similarity index 100% rename from infinity/icon/Edit16.gif rename to src/infinity/icon/Edit16.gif diff --git a/infinity/icon/End16.gif b/src/infinity/icon/End16.gif similarity index 100% rename from infinity/icon/End16.gif rename to src/infinity/icon/End16.gif diff --git a/infinity/icon/Exit16.gif b/src/infinity/icon/Exit16.gif similarity index 100% rename from infinity/icon/Exit16.gif rename to src/infinity/icon/Exit16.gif diff --git a/infinity/icon/Export16.gif b/src/infinity/icon/Export16.gif similarity index 100% rename from infinity/icon/Export16.gif rename to src/infinity/icon/Export16.gif diff --git a/infinity/icon/Find16.gif b/src/infinity/icon/Find16.gif similarity index 100% rename from infinity/icon/Find16.gif rename to src/infinity/icon/Find16.gif diff --git a/infinity/icon/FindAgain16.gif b/src/infinity/icon/FindAgain16.gif similarity index 100% rename from infinity/icon/FindAgain16.gif rename to src/infinity/icon/FindAgain16.gif diff --git a/infinity/icon/Forward16.gif b/src/infinity/icon/Forward16.gif similarity index 100% rename from infinity/icon/Forward16.gif rename to src/infinity/icon/Forward16.gif diff --git a/infinity/icon/GreenCircle16.gif b/src/infinity/icon/GreenCircle16.gif similarity index 100% rename from infinity/icon/GreenCircle16.gif rename to src/infinity/icon/GreenCircle16.gif diff --git a/infinity/icon/Help16.gif b/src/infinity/icon/Help16.gif similarity index 100% rename from infinity/icon/Help16.gif rename to src/infinity/icon/Help16.gif diff --git a/infinity/icon/History16.gif b/src/infinity/icon/History16.gif similarity index 100% rename from infinity/icon/History16.gif rename to src/infinity/icon/History16.gif diff --git a/infinity/icon/Icons.java b/src/infinity/icon/Icons.java similarity index 100% rename from infinity/icon/Icons.java rename to src/infinity/icon/Icons.java diff --git a/infinity/icon/Import16.gif b/src/infinity/icon/Import16.gif similarity index 100% rename from infinity/icon/Import16.gif rename to src/infinity/icon/Import16.gif diff --git a/infinity/icon/Movie16.gif b/src/infinity/icon/Movie16.gif similarity index 100% rename from infinity/icon/Movie16.gif rename to src/infinity/icon/Movie16.gif diff --git a/infinity/icon/New16.gif b/src/infinity/icon/New16.gif similarity index 100% rename from infinity/icon/New16.gif rename to src/infinity/icon/New16.gif diff --git a/infinity/icon/Open16.gif b/src/infinity/icon/Open16.gif similarity index 100% rename from infinity/icon/Open16.gif rename to src/infinity/icon/Open16.gif diff --git a/infinity/icon/Paste16.gif b/src/infinity/icon/Paste16.gif similarity index 100% rename from infinity/icon/Paste16.gif rename to src/infinity/icon/Paste16.gif diff --git a/infinity/icon/Play16.gif b/src/infinity/icon/Play16.gif similarity index 100% rename from infinity/icon/Play16.gif rename to src/infinity/icon/Play16.gif diff --git a/infinity/icon/Print16.gif b/src/infinity/icon/Print16.gif similarity index 100% rename from infinity/icon/Print16.gif rename to src/infinity/icon/Print16.gif diff --git a/infinity/icon/Properties16.gif b/src/infinity/icon/Properties16.gif similarity index 100% rename from infinity/icon/Properties16.gif rename to src/infinity/icon/Properties16.gif diff --git a/infinity/icon/Redo16.gif b/src/infinity/icon/Redo16.gif similarity index 100% rename from infinity/icon/Redo16.gif rename to src/infinity/icon/Redo16.gif diff --git a/infinity/icon/Refresh16.gif b/src/infinity/icon/Refresh16.gif similarity index 100% rename from infinity/icon/Refresh16.gif rename to src/infinity/icon/Refresh16.gif diff --git a/infinity/icon/Release16.gif b/src/infinity/icon/Release16.gif similarity index 100% rename from infinity/icon/Release16.gif rename to src/infinity/icon/Release16.gif diff --git a/infinity/icon/Remove16.gif b/src/infinity/icon/Remove16.gif similarity index 100% rename from infinity/icon/Remove16.gif rename to src/infinity/icon/Remove16.gif diff --git a/infinity/icon/RowInsertAfter16.gif b/src/infinity/icon/RowInsertAfter16.gif similarity index 100% rename from infinity/icon/RowInsertAfter16.gif rename to src/infinity/icon/RowInsertAfter16.gif diff --git a/infinity/icon/Save16.gif b/src/infinity/icon/Save16.gif similarity index 100% rename from infinity/icon/Save16.gif rename to src/infinity/icon/Save16.gif diff --git a/infinity/icon/StepBack16.gif b/src/infinity/icon/StepBack16.gif similarity index 100% rename from infinity/icon/StepBack16.gif rename to src/infinity/icon/StepBack16.gif diff --git a/infinity/icon/StepForward16.gif b/src/infinity/icon/StepForward16.gif similarity index 100% rename from infinity/icon/StepForward16.gif rename to src/infinity/icon/StepForward16.gif diff --git a/infinity/icon/Stop16.gif b/src/infinity/icon/Stop16.gif similarity index 100% rename from infinity/icon/Stop16.gif rename to src/infinity/icon/Stop16.gif diff --git a/infinity/icon/Stop24.gif b/src/infinity/icon/Stop24.gif similarity index 100% rename from infinity/icon/Stop24.gif rename to src/infinity/icon/Stop24.gif diff --git a/infinity/icon/Undo16.gif b/src/infinity/icon/Undo16.gif similarity index 100% rename from infinity/icon/Undo16.gif rename to src/infinity/icon/Undo16.gif diff --git a/infinity/icon/Up16.gif b/src/infinity/icon/Up16.gif similarity index 100% rename from infinity/icon/Up16.gif rename to src/infinity/icon/Up16.gif diff --git a/infinity/icon/Volume16.gif b/src/infinity/icon/Volume16.gif similarity index 100% rename from infinity/icon/Volume16.gif rename to src/infinity/icon/Volume16.gif diff --git a/infinity/icon/YellowCircle16.gif b/src/infinity/icon/YellowCircle16.gif similarity index 100% rename from infinity/icon/YellowCircle16.gif rename to src/infinity/icon/YellowCircle16.gif diff --git a/infinity/icon/YellowCircle20.gif b/src/infinity/icon/YellowCircle20.gif similarity index 100% rename from infinity/icon/YellowCircle20.gif rename to src/infinity/icon/YellowCircle20.gif diff --git a/infinity/icon/Zoom16.gif b/src/infinity/icon/Zoom16.gif similarity index 100% rename from infinity/icon/Zoom16.gif rename to src/infinity/icon/Zoom16.gif diff --git a/infinity/resource/AbstractAbility.java b/src/infinity/resource/AbstractAbility.java similarity index 100% rename from infinity/resource/AbstractAbility.java rename to src/infinity/resource/AbstractAbility.java diff --git a/infinity/resource/AbstractStruct.java b/src/infinity/resource/AbstractStruct.java similarity index 100% rename from infinity/resource/AbstractStruct.java rename to src/infinity/resource/AbstractStruct.java diff --git a/infinity/resource/AddRemovable.java b/src/infinity/resource/AddRemovable.java similarity index 100% rename from infinity/resource/AddRemovable.java rename to src/infinity/resource/AddRemovable.java diff --git a/infinity/resource/Closeable.java b/src/infinity/resource/Closeable.java similarity index 100% rename from infinity/resource/Closeable.java rename to src/infinity/resource/Closeable.java diff --git a/infinity/resource/Effect.java b/src/infinity/resource/Effect.java similarity index 100% rename from infinity/resource/Effect.java rename to src/infinity/resource/Effect.java diff --git a/infinity/resource/Effect2.java b/src/infinity/resource/Effect2.java similarity index 100% rename from infinity/resource/Effect2.java rename to src/infinity/resource/Effect2.java diff --git a/infinity/resource/EffectFactory.java b/src/infinity/resource/EffectFactory.java similarity index 100% rename from infinity/resource/EffectFactory.java rename to src/infinity/resource/EffectFactory.java diff --git a/infinity/resource/HasAddRemovable.java b/src/infinity/resource/HasAddRemovable.java similarity index 100% rename from infinity/resource/HasAddRemovable.java rename to src/infinity/resource/HasAddRemovable.java diff --git a/infinity/resource/HasDetailViewer.java b/src/infinity/resource/HasDetailViewer.java similarity index 100% rename from infinity/resource/HasDetailViewer.java rename to src/infinity/resource/HasDetailViewer.java diff --git a/infinity/resource/Resource.java b/src/infinity/resource/Resource.java similarity index 100% rename from infinity/resource/Resource.java rename to src/infinity/resource/Resource.java diff --git a/infinity/resource/ResourceFactory.java b/src/infinity/resource/ResourceFactory.java similarity index 100% rename from infinity/resource/ResourceFactory.java rename to src/infinity/resource/ResourceFactory.java diff --git a/infinity/resource/StructEntry.java b/src/infinity/resource/StructEntry.java similarity index 100% rename from infinity/resource/StructEntry.java rename to src/infinity/resource/StructEntry.java diff --git a/infinity/resource/TextResource.java b/src/infinity/resource/TextResource.java similarity index 100% rename from infinity/resource/TextResource.java rename to src/infinity/resource/TextResource.java diff --git a/infinity/resource/Viewable.java b/src/infinity/resource/Viewable.java similarity index 100% rename from infinity/resource/Viewable.java rename to src/infinity/resource/Viewable.java diff --git a/infinity/resource/ViewableContainer.java b/src/infinity/resource/ViewableContainer.java similarity index 100% rename from infinity/resource/ViewableContainer.java rename to src/infinity/resource/ViewableContainer.java diff --git a/infinity/resource/Writeable.java b/src/infinity/resource/Writeable.java similarity index 100% rename from infinity/resource/Writeable.java rename to src/infinity/resource/Writeable.java diff --git a/infinity/resource/are/Actor.java b/src/infinity/resource/are/Actor.java similarity index 100% rename from infinity/resource/are/Actor.java rename to src/infinity/resource/are/Actor.java diff --git a/infinity/resource/are/Ambient.java b/src/infinity/resource/are/Ambient.java similarity index 100% rename from infinity/resource/are/Ambient.java rename to src/infinity/resource/are/Ambient.java diff --git a/infinity/resource/are/Animation.java b/src/infinity/resource/are/Animation.java similarity index 100% rename from infinity/resource/are/Animation.java rename to src/infinity/resource/are/Animation.java diff --git a/infinity/resource/are/AreResource.java b/src/infinity/resource/are/AreResource.java similarity index 100% rename from infinity/resource/are/AreResource.java rename to src/infinity/resource/are/AreResource.java diff --git a/infinity/resource/are/AutomapNote.java b/src/infinity/resource/are/AutomapNote.java similarity index 100% rename from infinity/resource/are/AutomapNote.java rename to src/infinity/resource/are/AutomapNote.java diff --git a/infinity/resource/are/AutomapNotePST.java b/src/infinity/resource/are/AutomapNotePST.java similarity index 100% rename from infinity/resource/are/AutomapNotePST.java rename to src/infinity/resource/are/AutomapNotePST.java diff --git a/infinity/resource/are/Container.java b/src/infinity/resource/are/Container.java similarity index 100% rename from infinity/resource/are/Container.java rename to src/infinity/resource/are/Container.java diff --git a/infinity/resource/are/Door.java b/src/infinity/resource/are/Door.java similarity index 100% rename from infinity/resource/are/Door.java rename to src/infinity/resource/are/Door.java diff --git a/infinity/resource/are/Entrance.java b/src/infinity/resource/are/Entrance.java similarity index 100% rename from infinity/resource/are/Entrance.java rename to src/infinity/resource/are/Entrance.java diff --git a/infinity/resource/are/HasVertices.java b/src/infinity/resource/are/HasVertices.java similarity index 100% rename from infinity/resource/are/HasVertices.java rename to src/infinity/resource/are/HasVertices.java diff --git a/infinity/resource/are/ITEPoint.java b/src/infinity/resource/are/ITEPoint.java similarity index 100% rename from infinity/resource/are/ITEPoint.java rename to src/infinity/resource/are/ITEPoint.java diff --git a/infinity/resource/are/Item.java b/src/infinity/resource/are/Item.java similarity index 100% rename from infinity/resource/are/Item.java rename to src/infinity/resource/are/Item.java diff --git a/infinity/resource/are/ProTrap.java b/src/infinity/resource/are/ProTrap.java similarity index 100% rename from infinity/resource/are/ProTrap.java rename to src/infinity/resource/are/ProTrap.java diff --git a/infinity/resource/are/RestSpawn.java b/src/infinity/resource/are/RestSpawn.java similarity index 100% rename from infinity/resource/are/RestSpawn.java rename to src/infinity/resource/are/RestSpawn.java diff --git a/infinity/resource/are/Song.java b/src/infinity/resource/are/Song.java similarity index 100% rename from infinity/resource/are/Song.java rename to src/infinity/resource/are/Song.java diff --git a/infinity/resource/are/SpawnPoint.java b/src/infinity/resource/are/SpawnPoint.java similarity index 100% rename from infinity/resource/are/SpawnPoint.java rename to src/infinity/resource/are/SpawnPoint.java diff --git a/infinity/resource/are/TiledObject.java b/src/infinity/resource/are/TiledObject.java similarity index 100% rename from infinity/resource/are/TiledObject.java rename to src/infinity/resource/are/TiledObject.java diff --git a/infinity/resource/are/Variable.java b/src/infinity/resource/are/Variable.java similarity index 100% rename from infinity/resource/are/Variable.java rename to src/infinity/resource/are/Variable.java diff --git a/infinity/resource/are/Viewer.java b/src/infinity/resource/are/Viewer.java similarity index 100% rename from infinity/resource/are/Viewer.java rename to src/infinity/resource/are/Viewer.java diff --git a/infinity/resource/are/ViewerActor.java b/src/infinity/resource/are/ViewerActor.java similarity index 100% rename from infinity/resource/are/ViewerActor.java rename to src/infinity/resource/are/ViewerActor.java diff --git a/infinity/resource/are/ViewerContainer.java b/src/infinity/resource/are/ViewerContainer.java similarity index 100% rename from infinity/resource/are/ViewerContainer.java rename to src/infinity/resource/are/ViewerContainer.java diff --git a/infinity/resource/are/ViewerGraphics.java b/src/infinity/resource/are/ViewerGraphics.java similarity index 100% rename from infinity/resource/are/ViewerGraphics.java rename to src/infinity/resource/are/ViewerGraphics.java diff --git a/infinity/resource/bcs/BafResource.java b/src/infinity/resource/bcs/BafResource.java similarity index 100% rename from infinity/resource/bcs/BafResource.java rename to src/infinity/resource/bcs/BafResource.java diff --git a/infinity/resource/bcs/BcsResource.java b/src/infinity/resource/bcs/BcsResource.java similarity index 100% rename from infinity/resource/bcs/BcsResource.java rename to src/infinity/resource/bcs/BcsResource.java diff --git a/infinity/resource/bcs/Compiler.java b/src/infinity/resource/bcs/Compiler.java similarity index 100% rename from infinity/resource/bcs/Compiler.java rename to src/infinity/resource/bcs/Compiler.java diff --git a/infinity/resource/bcs/Decompiler.java b/src/infinity/resource/bcs/Decompiler.java similarity index 100% rename from infinity/resource/bcs/Decompiler.java rename to src/infinity/resource/bcs/Decompiler.java diff --git a/infinity/resource/chu/ChuResource.java b/src/infinity/resource/chu/ChuResource.java similarity index 100% rename from infinity/resource/chu/ChuResource.java rename to src/infinity/resource/chu/ChuResource.java diff --git a/infinity/resource/chu/Control.java b/src/infinity/resource/chu/Control.java similarity index 100% rename from infinity/resource/chu/Control.java rename to src/infinity/resource/chu/Control.java diff --git a/infinity/resource/chu/Window.java b/src/infinity/resource/chu/Window.java similarity index 100% rename from infinity/resource/chu/Window.java rename to src/infinity/resource/chu/Window.java diff --git a/infinity/resource/cre/CreResource.java b/src/infinity/resource/cre/CreResource.java similarity index 100% rename from infinity/resource/cre/CreResource.java rename to src/infinity/resource/cre/CreResource.java diff --git a/infinity/resource/cre/Item.java b/src/infinity/resource/cre/Item.java similarity index 100% rename from infinity/resource/cre/Item.java rename to src/infinity/resource/cre/Item.java diff --git a/infinity/resource/cre/Iwd2Ability.java b/src/infinity/resource/cre/Iwd2Ability.java similarity index 100% rename from infinity/resource/cre/Iwd2Ability.java rename to src/infinity/resource/cre/Iwd2Ability.java diff --git a/infinity/resource/cre/Iwd2Shape.java b/src/infinity/resource/cre/Iwd2Shape.java similarity index 100% rename from infinity/resource/cre/Iwd2Shape.java rename to src/infinity/resource/cre/Iwd2Shape.java diff --git a/infinity/resource/cre/Iwd2Song.java b/src/infinity/resource/cre/Iwd2Song.java similarity index 100% rename from infinity/resource/cre/Iwd2Song.java rename to src/infinity/resource/cre/Iwd2Song.java diff --git a/infinity/resource/cre/Iwd2Spell.java b/src/infinity/resource/cre/Iwd2Spell.java similarity index 100% rename from infinity/resource/cre/Iwd2Spell.java rename to src/infinity/resource/cre/Iwd2Spell.java diff --git a/infinity/resource/cre/Iwd2Struct.java b/src/infinity/resource/cre/Iwd2Struct.java similarity index 100% rename from infinity/resource/cre/Iwd2Struct.java rename to src/infinity/resource/cre/Iwd2Struct.java diff --git a/infinity/resource/cre/KnownSpells.java b/src/infinity/resource/cre/KnownSpells.java similarity index 100% rename from infinity/resource/cre/KnownSpells.java rename to src/infinity/resource/cre/KnownSpells.java diff --git a/infinity/resource/cre/MemorizedSpells.java b/src/infinity/resource/cre/MemorizedSpells.java similarity index 100% rename from infinity/resource/cre/MemorizedSpells.java rename to src/infinity/resource/cre/MemorizedSpells.java diff --git a/infinity/resource/cre/SpellMemorization.java b/src/infinity/resource/cre/SpellMemorization.java similarity index 100% rename from infinity/resource/cre/SpellMemorization.java rename to src/infinity/resource/cre/SpellMemorization.java diff --git a/infinity/resource/cre/Viewer.java b/src/infinity/resource/cre/Viewer.java similarity index 100% rename from infinity/resource/cre/Viewer.java rename to src/infinity/resource/cre/Viewer.java diff --git a/infinity/resource/cre/ViewerItems.java b/src/infinity/resource/cre/ViewerItems.java similarity index 100% rename from infinity/resource/cre/ViewerItems.java rename to src/infinity/resource/cre/ViewerItems.java diff --git a/infinity/resource/cre/ViewerSpells.java b/src/infinity/resource/cre/ViewerSpells.java similarity index 100% rename from infinity/resource/cre/ViewerSpells.java rename to src/infinity/resource/cre/ViewerSpells.java diff --git a/infinity/resource/dlg/AbstractCode.java b/src/infinity/resource/dlg/AbstractCode.java similarity index 100% rename from infinity/resource/dlg/AbstractCode.java rename to src/infinity/resource/dlg/AbstractCode.java diff --git a/infinity/resource/dlg/Action.java b/src/infinity/resource/dlg/Action.java similarity index 100% rename from infinity/resource/dlg/Action.java rename to src/infinity/resource/dlg/Action.java diff --git a/infinity/resource/dlg/DialogItemRefSearcher.java b/src/infinity/resource/dlg/DialogItemRefSearcher.java similarity index 100% rename from infinity/resource/dlg/DialogItemRefSearcher.java rename to src/infinity/resource/dlg/DialogItemRefSearcher.java diff --git a/infinity/resource/dlg/DlgResource.java b/src/infinity/resource/dlg/DlgResource.java similarity index 100% rename from infinity/resource/dlg/DlgResource.java rename to src/infinity/resource/dlg/DlgResource.java diff --git a/infinity/resource/dlg/ResponseTrigger.java b/src/infinity/resource/dlg/ResponseTrigger.java similarity index 100% rename from infinity/resource/dlg/ResponseTrigger.java rename to src/infinity/resource/dlg/ResponseTrigger.java diff --git a/infinity/resource/dlg/State.java b/src/infinity/resource/dlg/State.java similarity index 100% rename from infinity/resource/dlg/State.java rename to src/infinity/resource/dlg/State.java diff --git a/infinity/resource/dlg/StateTrigger.java b/src/infinity/resource/dlg/StateTrigger.java similarity index 100% rename from infinity/resource/dlg/StateTrigger.java rename to src/infinity/resource/dlg/StateTrigger.java diff --git a/infinity/resource/dlg/Transition.java b/src/infinity/resource/dlg/Transition.java similarity index 100% rename from infinity/resource/dlg/Transition.java rename to src/infinity/resource/dlg/Transition.java diff --git a/infinity/resource/dlg/Viewer.java b/src/infinity/resource/dlg/Viewer.java similarity index 100% rename from infinity/resource/dlg/Viewer.java rename to src/infinity/resource/dlg/Viewer.java diff --git a/infinity/resource/gam/Familiar.java b/src/infinity/resource/gam/Familiar.java similarity index 100% rename from infinity/resource/gam/Familiar.java rename to src/infinity/resource/gam/Familiar.java diff --git a/infinity/resource/gam/GamResource.java b/src/infinity/resource/gam/GamResource.java similarity index 100% rename from infinity/resource/gam/GamResource.java rename to src/infinity/resource/gam/GamResource.java diff --git a/infinity/resource/gam/JournalEntry.java b/src/infinity/resource/gam/JournalEntry.java similarity index 100% rename from infinity/resource/gam/JournalEntry.java rename to src/infinity/resource/gam/JournalEntry.java diff --git a/infinity/resource/gam/KillVariable.java b/src/infinity/resource/gam/KillVariable.java similarity index 100% rename from infinity/resource/gam/KillVariable.java rename to src/infinity/resource/gam/KillVariable.java diff --git a/infinity/resource/gam/NonPartyNPC.java b/src/infinity/resource/gam/NonPartyNPC.java similarity index 100% rename from infinity/resource/gam/NonPartyNPC.java rename to src/infinity/resource/gam/NonPartyNPC.java diff --git a/infinity/resource/gam/PartyNPC.java b/src/infinity/resource/gam/PartyNPC.java similarity index 100% rename from infinity/resource/gam/PartyNPC.java rename to src/infinity/resource/gam/PartyNPC.java diff --git a/infinity/resource/gam/StoredLocation.java b/src/infinity/resource/gam/StoredLocation.java similarity index 100% rename from infinity/resource/gam/StoredLocation.java rename to src/infinity/resource/gam/StoredLocation.java diff --git a/infinity/resource/gam/UnknownSection.java b/src/infinity/resource/gam/UnknownSection.java similarity index 100% rename from infinity/resource/gam/UnknownSection.java rename to src/infinity/resource/gam/UnknownSection.java diff --git a/infinity/resource/gam/UnknownSection2.java b/src/infinity/resource/gam/UnknownSection2.java similarity index 100% rename from infinity/resource/gam/UnknownSection2.java rename to src/infinity/resource/gam/UnknownSection2.java diff --git a/infinity/resource/gam/UnknownSection3.java b/src/infinity/resource/gam/UnknownSection3.java similarity index 100% rename from infinity/resource/gam/UnknownSection3.java rename to src/infinity/resource/gam/UnknownSection3.java diff --git a/infinity/resource/gam/Variable.java b/src/infinity/resource/gam/Variable.java similarity index 100% rename from infinity/resource/gam/Variable.java rename to src/infinity/resource/gam/Variable.java diff --git a/infinity/resource/gam/Viewer.java b/src/infinity/resource/gam/Viewer.java similarity index 100% rename from infinity/resource/gam/Viewer.java rename to src/infinity/resource/gam/Viewer.java diff --git a/infinity/resource/gam/ViewerNPC.java b/src/infinity/resource/gam/ViewerNPC.java similarity index 100% rename from infinity/resource/gam/ViewerNPC.java rename to src/infinity/resource/gam/ViewerNPC.java diff --git a/infinity/resource/graphics/BamResource.java b/src/infinity/resource/graphics/BamResource.java similarity index 100% rename from infinity/resource/graphics/BamResource.java rename to src/infinity/resource/graphics/BamResource.java diff --git a/infinity/resource/graphics/BmpResource.java b/src/infinity/resource/graphics/BmpResource.java similarity index 100% rename from infinity/resource/graphics/BmpResource.java rename to src/infinity/resource/graphics/BmpResource.java diff --git a/infinity/resource/graphics/Compressor.java b/src/infinity/resource/graphics/Compressor.java similarity index 100% rename from infinity/resource/graphics/Compressor.java rename to src/infinity/resource/graphics/Compressor.java diff --git a/infinity/resource/graphics/MosResource.java b/src/infinity/resource/graphics/MosResource.java similarity index 100% rename from infinity/resource/graphics/MosResource.java rename to src/infinity/resource/graphics/MosResource.java diff --git a/infinity/resource/graphics/MveResource.java b/src/infinity/resource/graphics/MveResource.java similarity index 100% rename from infinity/resource/graphics/MveResource.java rename to src/infinity/resource/graphics/MveResource.java diff --git a/infinity/resource/graphics/Palette.java b/src/infinity/resource/graphics/Palette.java similarity index 100% rename from infinity/resource/graphics/Palette.java rename to src/infinity/resource/graphics/Palette.java diff --git a/infinity/resource/graphics/PltResource.java b/src/infinity/resource/graphics/PltResource.java similarity index 100% rename from infinity/resource/graphics/PltResource.java rename to src/infinity/resource/graphics/PltResource.java diff --git a/infinity/resource/graphics/TgaResource.java b/src/infinity/resource/graphics/TgaResource.java similarity index 100% rename from infinity/resource/graphics/TgaResource.java rename to src/infinity/resource/graphics/TgaResource.java diff --git a/infinity/resource/graphics/TisResource.java b/src/infinity/resource/graphics/TisResource.java similarity index 100% rename from infinity/resource/graphics/TisResource.java rename to src/infinity/resource/graphics/TisResource.java diff --git a/infinity/resource/graphics/mve.stub b/src/infinity/resource/graphics/mve.stub similarity index 100% rename from infinity/resource/graphics/mve.stub rename to src/infinity/resource/graphics/mve.stub diff --git a/infinity/resource/itm/Ability.java b/src/infinity/resource/itm/Ability.java similarity index 100% rename from infinity/resource/itm/Ability.java rename to src/infinity/resource/itm/Ability.java diff --git a/infinity/resource/itm/ItmResource.java b/src/infinity/resource/itm/ItmResource.java similarity index 100% rename from infinity/resource/itm/ItmResource.java rename to src/infinity/resource/itm/ItmResource.java diff --git a/infinity/resource/itm/Viewer.java b/src/infinity/resource/itm/Viewer.java similarity index 100% rename from infinity/resource/itm/Viewer.java rename to src/infinity/resource/itm/Viewer.java diff --git a/infinity/resource/itm/ViewerAbility.java b/src/infinity/resource/itm/ViewerAbility.java similarity index 100% rename from infinity/resource/itm/ViewerAbility.java rename to src/infinity/resource/itm/ViewerAbility.java diff --git a/infinity/resource/key/BIFFArchive.java b/src/infinity/resource/key/BIFFArchive.java similarity index 100% rename from infinity/resource/key/BIFFArchive.java rename to src/infinity/resource/key/BIFFArchive.java diff --git a/infinity/resource/key/BIFFEntry.java b/src/infinity/resource/key/BIFFEntry.java similarity index 100% rename from infinity/resource/key/BIFFEntry.java rename to src/infinity/resource/key/BIFFEntry.java diff --git a/infinity/resource/key/BIFFResourceEntry.java b/src/infinity/resource/key/BIFFResourceEntry.java similarity index 100% rename from infinity/resource/key/BIFFResourceEntry.java rename to src/infinity/resource/key/BIFFResourceEntry.java diff --git a/infinity/resource/key/BIFFWriter.java b/src/infinity/resource/key/BIFFWriter.java similarity index 100% rename from infinity/resource/key/BIFFWriter.java rename to src/infinity/resource/key/BIFFWriter.java diff --git a/infinity/resource/key/FileResourceEntry.java b/src/infinity/resource/key/FileResourceEntry.java similarity index 100% rename from infinity/resource/key/FileResourceEntry.java rename to src/infinity/resource/key/FileResourceEntry.java diff --git a/infinity/resource/key/Keyfile.java b/src/infinity/resource/key/Keyfile.java similarity index 100% rename from infinity/resource/key/Keyfile.java rename to src/infinity/resource/key/Keyfile.java diff --git a/infinity/resource/key/ResourceEntry.java b/src/infinity/resource/key/ResourceEntry.java similarity index 100% rename from infinity/resource/key/ResourceEntry.java rename to src/infinity/resource/key/ResourceEntry.java diff --git a/infinity/resource/key/ResourceTreeFolder.java b/src/infinity/resource/key/ResourceTreeFolder.java similarity index 100% rename from infinity/resource/key/ResourceTreeFolder.java rename to src/infinity/resource/key/ResourceTreeFolder.java diff --git a/infinity/resource/key/ResourceTreeModel.java b/src/infinity/resource/key/ResourceTreeModel.java similarity index 100% rename from infinity/resource/key/ResourceTreeModel.java rename to src/infinity/resource/key/ResourceTreeModel.java diff --git a/infinity/resource/kotor/GlobalVarsResource.java b/src/infinity/resource/kotor/GlobalVarsResource.java similarity index 100% rename from infinity/resource/kotor/GlobalVarsResource.java rename to src/infinity/resource/kotor/GlobalVarsResource.java diff --git a/infinity/resource/kotor/RimResource.java b/src/infinity/resource/kotor/RimResource.java similarity index 100% rename from infinity/resource/kotor/RimResource.java rename to src/infinity/resource/kotor/RimResource.java diff --git a/infinity/resource/mus/Entry.java b/src/infinity/resource/mus/Entry.java similarity index 100% rename from infinity/resource/mus/Entry.java rename to src/infinity/resource/mus/Entry.java diff --git a/infinity/resource/mus/MusResource.java b/src/infinity/resource/mus/MusResource.java similarity index 100% rename from infinity/resource/mus/MusResource.java rename to src/infinity/resource/mus/MusResource.java diff --git a/infinity/resource/mus/Viewer.java b/src/infinity/resource/mus/Viewer.java similarity index 100% rename from infinity/resource/mus/Viewer.java rename to src/infinity/resource/mus/Viewer.java diff --git a/infinity/resource/nwn/ErfResource.java b/src/infinity/resource/nwn/ErfResource.java similarity index 100% rename from infinity/resource/nwn/ErfResource.java rename to src/infinity/resource/nwn/ErfResource.java diff --git a/infinity/resource/nwn/NcsResource.java b/src/infinity/resource/nwn/NcsResource.java similarity index 100% rename from infinity/resource/nwn/NcsResource.java rename to src/infinity/resource/nwn/NcsResource.java diff --git a/infinity/resource/nwn/SsfResource.java b/src/infinity/resource/nwn/SsfResource.java similarity index 100% rename from infinity/resource/nwn/SsfResource.java rename to src/infinity/resource/nwn/SsfResource.java diff --git a/infinity/resource/nwn/TableTextResource.java b/src/infinity/resource/nwn/TableTextResource.java similarity index 100% rename from infinity/resource/nwn/TableTextResource.java rename to src/infinity/resource/nwn/TableTextResource.java diff --git a/infinity/resource/nwn/gff/DefaultGffEditor.java b/src/infinity/resource/nwn/gff/DefaultGffEditor.java similarity index 100% rename from infinity/resource/nwn/gff/DefaultGffEditor.java rename to src/infinity/resource/nwn/gff/DefaultGffEditor.java diff --git a/infinity/resource/nwn/gff/GffResource.java b/src/infinity/resource/nwn/gff/GffResource.java similarity index 100% rename from infinity/resource/nwn/gff/GffResource.java rename to src/infinity/resource/nwn/gff/GffResource.java diff --git a/infinity/resource/nwn/gff/field/GffByte.java b/src/infinity/resource/nwn/gff/field/GffByte.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffByte.java rename to src/infinity/resource/nwn/gff/field/GffByte.java diff --git a/infinity/resource/nwn/gff/field/GffChar.java b/src/infinity/resource/nwn/gff/field/GffChar.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffChar.java rename to src/infinity/resource/nwn/gff/field/GffChar.java diff --git a/infinity/resource/nwn/gff/field/GffDouble.java b/src/infinity/resource/nwn/gff/field/GffDouble.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffDouble.java rename to src/infinity/resource/nwn/gff/field/GffDouble.java diff --git a/infinity/resource/nwn/gff/field/GffDword.java b/src/infinity/resource/nwn/gff/field/GffDword.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffDword.java rename to src/infinity/resource/nwn/gff/field/GffDword.java diff --git a/infinity/resource/nwn/gff/field/GffDword64.java b/src/infinity/resource/nwn/gff/field/GffDword64.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffDword64.java rename to src/infinity/resource/nwn/gff/field/GffDword64.java diff --git a/infinity/resource/nwn/gff/field/GffExoLocString.java b/src/infinity/resource/nwn/gff/field/GffExoLocString.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffExoLocString.java rename to src/infinity/resource/nwn/gff/field/GffExoLocString.java diff --git a/infinity/resource/nwn/gff/field/GffExoString.java b/src/infinity/resource/nwn/gff/field/GffExoString.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffExoString.java rename to src/infinity/resource/nwn/gff/field/GffExoString.java diff --git a/infinity/resource/nwn/gff/field/GffField.java b/src/infinity/resource/nwn/gff/field/GffField.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffField.java rename to src/infinity/resource/nwn/gff/field/GffField.java diff --git a/infinity/resource/nwn/gff/field/GffFloat.java b/src/infinity/resource/nwn/gff/field/GffFloat.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffFloat.java rename to src/infinity/resource/nwn/gff/field/GffFloat.java diff --git a/infinity/resource/nwn/gff/field/GffInt.java b/src/infinity/resource/nwn/gff/field/GffInt.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffInt.java rename to src/infinity/resource/nwn/gff/field/GffInt.java diff --git a/infinity/resource/nwn/gff/field/GffInt64.java b/src/infinity/resource/nwn/gff/field/GffInt64.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffInt64.java rename to src/infinity/resource/nwn/gff/field/GffInt64.java diff --git a/infinity/resource/nwn/gff/field/GffList.java b/src/infinity/resource/nwn/gff/field/GffList.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffList.java rename to src/infinity/resource/nwn/gff/field/GffList.java diff --git a/infinity/resource/nwn/gff/field/GffResRef.java b/src/infinity/resource/nwn/gff/field/GffResRef.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffResRef.java rename to src/infinity/resource/nwn/gff/field/GffResRef.java diff --git a/infinity/resource/nwn/gff/field/GffShort.java b/src/infinity/resource/nwn/gff/field/GffShort.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffShort.java rename to src/infinity/resource/nwn/gff/field/GffShort.java diff --git a/infinity/resource/nwn/gff/field/GffStruct.java b/src/infinity/resource/nwn/gff/field/GffStruct.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffStruct.java rename to src/infinity/resource/nwn/gff/field/GffStruct.java diff --git a/infinity/resource/nwn/gff/field/GffVoid.java b/src/infinity/resource/nwn/gff/field/GffVoid.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffVoid.java rename to src/infinity/resource/nwn/gff/field/GffVoid.java diff --git a/infinity/resource/nwn/gff/field/GffWord.java b/src/infinity/resource/nwn/gff/field/GffWord.java similarity index 100% rename from infinity/resource/nwn/gff/field/GffWord.java rename to src/infinity/resource/nwn/gff/field/GffWord.java diff --git a/infinity/resource/other/EffResource.java b/src/infinity/resource/other/EffResource.java similarity index 100% rename from infinity/resource/other/EffResource.java rename to src/infinity/resource/other/EffResource.java diff --git a/infinity/resource/other/PlainTextResource.java b/src/infinity/resource/other/PlainTextResource.java similarity index 100% rename from infinity/resource/other/PlainTextResource.java rename to src/infinity/resource/other/PlainTextResource.java diff --git a/infinity/resource/other/ProResource.java b/src/infinity/resource/other/ProResource.java similarity index 100% rename from infinity/resource/other/ProResource.java rename to src/infinity/resource/other/ProResource.java diff --git a/infinity/resource/other/UnknownResource.java b/src/infinity/resource/other/UnknownResource.java similarity index 100% rename from infinity/resource/other/UnknownResource.java rename to src/infinity/resource/other/UnknownResource.java diff --git a/infinity/resource/other/VvcResource.java b/src/infinity/resource/other/VvcResource.java similarity index 100% rename from infinity/resource/other/VvcResource.java rename to src/infinity/resource/other/VvcResource.java diff --git a/infinity/resource/other/WfxResource.java b/src/infinity/resource/other/WfxResource.java similarity index 100% rename from infinity/resource/other/WfxResource.java rename to src/infinity/resource/other/WfxResource.java diff --git a/infinity/resource/sav/IOHandler.java b/src/infinity/resource/sav/IOHandler.java similarity index 100% rename from infinity/resource/sav/IOHandler.java rename to src/infinity/resource/sav/IOHandler.java diff --git a/infinity/resource/sav/SavResource.java b/src/infinity/resource/sav/SavResource.java similarity index 100% rename from infinity/resource/sav/SavResource.java rename to src/infinity/resource/sav/SavResource.java diff --git a/infinity/resource/sound/AcmResource.java b/src/infinity/resource/sound/AcmResource.java similarity index 100% rename from infinity/resource/sound/AcmResource.java rename to src/infinity/resource/sound/AcmResource.java diff --git a/infinity/resource/sound/SoundUtilities.java b/src/infinity/resource/sound/SoundUtilities.java similarity index 100% rename from infinity/resource/sound/SoundUtilities.java rename to src/infinity/resource/sound/SoundUtilities.java diff --git a/infinity/resource/sound/WavResource.java b/src/infinity/resource/sound/WavResource.java similarity index 100% rename from infinity/resource/sound/WavResource.java rename to src/infinity/resource/sound/WavResource.java diff --git a/infinity/resource/spl/Ability.java b/src/infinity/resource/spl/Ability.java similarity index 100% rename from infinity/resource/spl/Ability.java rename to src/infinity/resource/spl/Ability.java diff --git a/infinity/resource/spl/SplResource.java b/src/infinity/resource/spl/SplResource.java similarity index 100% rename from infinity/resource/spl/SplResource.java rename to src/infinity/resource/spl/SplResource.java diff --git a/infinity/resource/spl/Viewer.java b/src/infinity/resource/spl/Viewer.java similarity index 100% rename from infinity/resource/spl/Viewer.java rename to src/infinity/resource/spl/Viewer.java diff --git a/infinity/resource/spl/ViewerAbility.java b/src/infinity/resource/spl/ViewerAbility.java similarity index 100% rename from infinity/resource/spl/ViewerAbility.java rename to src/infinity/resource/spl/ViewerAbility.java diff --git a/infinity/resource/src/Entry.java b/src/infinity/resource/src/Entry.java similarity index 100% rename from infinity/resource/src/Entry.java rename to src/infinity/resource/src/Entry.java diff --git a/infinity/resource/src/SrcResource.java b/src/infinity/resource/src/SrcResource.java similarity index 100% rename from infinity/resource/src/SrcResource.java rename to src/infinity/resource/src/SrcResource.java diff --git a/infinity/resource/sto/Cure.java b/src/infinity/resource/sto/Cure.java similarity index 100% rename from infinity/resource/sto/Cure.java rename to src/infinity/resource/sto/Cure.java diff --git a/infinity/resource/sto/Drink.java b/src/infinity/resource/sto/Drink.java similarity index 100% rename from infinity/resource/sto/Drink.java rename to src/infinity/resource/sto/Drink.java diff --git a/infinity/resource/sto/ItemSale.java b/src/infinity/resource/sto/ItemSale.java similarity index 100% rename from infinity/resource/sto/ItemSale.java rename to src/infinity/resource/sto/ItemSale.java diff --git a/infinity/resource/sto/ItemSale11.java b/src/infinity/resource/sto/ItemSale11.java similarity index 100% rename from infinity/resource/sto/ItemSale11.java rename to src/infinity/resource/sto/ItemSale11.java diff --git a/infinity/resource/sto/Purchases.java b/src/infinity/resource/sto/Purchases.java similarity index 100% rename from infinity/resource/sto/Purchases.java rename to src/infinity/resource/sto/Purchases.java diff --git a/infinity/resource/sto/StoResource.java b/src/infinity/resource/sto/StoResource.java similarity index 100% rename from infinity/resource/sto/StoResource.java rename to src/infinity/resource/sto/StoResource.java diff --git a/infinity/resource/sto/Viewer.java b/src/infinity/resource/sto/Viewer.java similarity index 100% rename from infinity/resource/sto/Viewer.java rename to src/infinity/resource/sto/Viewer.java diff --git a/infinity/resource/var/Entry.java b/src/infinity/resource/var/Entry.java similarity index 100% rename from infinity/resource/var/Entry.java rename to src/infinity/resource/var/Entry.java diff --git a/infinity/resource/var/VarResource.java b/src/infinity/resource/var/VarResource.java similarity index 100% rename from infinity/resource/var/VarResource.java rename to src/infinity/resource/var/VarResource.java diff --git a/infinity/resource/vertex/ClosedVertex.java b/src/infinity/resource/vertex/ClosedVertex.java similarity index 100% rename from infinity/resource/vertex/ClosedVertex.java rename to src/infinity/resource/vertex/ClosedVertex.java diff --git a/infinity/resource/vertex/ClosedVertexImpeded.java b/src/infinity/resource/vertex/ClosedVertexImpeded.java similarity index 100% rename from infinity/resource/vertex/ClosedVertexImpeded.java rename to src/infinity/resource/vertex/ClosedVertexImpeded.java diff --git a/infinity/resource/vertex/OpenVertex.java b/src/infinity/resource/vertex/OpenVertex.java similarity index 100% rename from infinity/resource/vertex/OpenVertex.java rename to src/infinity/resource/vertex/OpenVertex.java diff --git a/infinity/resource/vertex/OpenVertexImpeded.java b/src/infinity/resource/vertex/OpenVertexImpeded.java similarity index 100% rename from infinity/resource/vertex/OpenVertexImpeded.java rename to src/infinity/resource/vertex/OpenVertexImpeded.java diff --git a/infinity/resource/vertex/Vertex.java b/src/infinity/resource/vertex/Vertex.java similarity index 100% rename from infinity/resource/vertex/Vertex.java rename to src/infinity/resource/vertex/Vertex.java diff --git a/infinity/resource/wed/ClosedPolygon.java b/src/infinity/resource/wed/ClosedPolygon.java similarity index 100% rename from infinity/resource/wed/ClosedPolygon.java rename to src/infinity/resource/wed/ClosedPolygon.java diff --git a/infinity/resource/wed/Door.java b/src/infinity/resource/wed/Door.java similarity index 100% rename from infinity/resource/wed/Door.java rename to src/infinity/resource/wed/Door.java diff --git a/infinity/resource/wed/OpenPolygon.java b/src/infinity/resource/wed/OpenPolygon.java similarity index 100% rename from infinity/resource/wed/OpenPolygon.java rename to src/infinity/resource/wed/OpenPolygon.java diff --git a/infinity/resource/wed/Overlay.java b/src/infinity/resource/wed/Overlay.java similarity index 100% rename from infinity/resource/wed/Overlay.java rename to src/infinity/resource/wed/Overlay.java diff --git a/infinity/resource/wed/Polygon.java b/src/infinity/resource/wed/Polygon.java similarity index 100% rename from infinity/resource/wed/Polygon.java rename to src/infinity/resource/wed/Polygon.java diff --git a/infinity/resource/wed/Tilemap.java b/src/infinity/resource/wed/Tilemap.java similarity index 100% rename from infinity/resource/wed/Tilemap.java rename to src/infinity/resource/wed/Tilemap.java diff --git a/infinity/resource/wed/WallPolygon.java b/src/infinity/resource/wed/WallPolygon.java similarity index 100% rename from infinity/resource/wed/WallPolygon.java rename to src/infinity/resource/wed/WallPolygon.java diff --git a/infinity/resource/wed/Wallgroup.java b/src/infinity/resource/wed/Wallgroup.java similarity index 100% rename from infinity/resource/wed/Wallgroup.java rename to src/infinity/resource/wed/Wallgroup.java diff --git a/infinity/resource/wed/WedResource.java b/src/infinity/resource/wed/WedResource.java similarity index 100% rename from infinity/resource/wed/WedResource.java rename to src/infinity/resource/wed/WedResource.java diff --git a/infinity/resource/wmp/AreaEntry.java b/src/infinity/resource/wmp/AreaEntry.java similarity index 100% rename from infinity/resource/wmp/AreaEntry.java rename to src/infinity/resource/wmp/AreaEntry.java diff --git a/infinity/resource/wmp/AreaLink.java b/src/infinity/resource/wmp/AreaLink.java similarity index 100% rename from infinity/resource/wmp/AreaLink.java rename to src/infinity/resource/wmp/AreaLink.java diff --git a/infinity/resource/wmp/AreaLinkEast.java b/src/infinity/resource/wmp/AreaLinkEast.java similarity index 100% rename from infinity/resource/wmp/AreaLinkEast.java rename to src/infinity/resource/wmp/AreaLinkEast.java diff --git a/infinity/resource/wmp/AreaLinkNorth.java b/src/infinity/resource/wmp/AreaLinkNorth.java similarity index 100% rename from infinity/resource/wmp/AreaLinkNorth.java rename to src/infinity/resource/wmp/AreaLinkNorth.java diff --git a/infinity/resource/wmp/AreaLinkSouth.java b/src/infinity/resource/wmp/AreaLinkSouth.java similarity index 100% rename from infinity/resource/wmp/AreaLinkSouth.java rename to src/infinity/resource/wmp/AreaLinkSouth.java diff --git a/infinity/resource/wmp/AreaLinkWest.java b/src/infinity/resource/wmp/AreaLinkWest.java similarity index 100% rename from infinity/resource/wmp/AreaLinkWest.java rename to src/infinity/resource/wmp/AreaLinkWest.java diff --git a/infinity/resource/wmp/MapEntry.java b/src/infinity/resource/wmp/MapEntry.java similarity index 100% rename from infinity/resource/wmp/MapEntry.java rename to src/infinity/resource/wmp/MapEntry.java diff --git a/infinity/resource/wmp/ViewerArea.java b/src/infinity/resource/wmp/ViewerArea.java similarity index 100% rename from infinity/resource/wmp/ViewerArea.java rename to src/infinity/resource/wmp/ViewerArea.java diff --git a/infinity/resource/wmp/ViewerMap.java b/src/infinity/resource/wmp/ViewerMap.java similarity index 100% rename from infinity/resource/wmp/ViewerMap.java rename to src/infinity/resource/wmp/ViewerMap.java diff --git a/infinity/resource/wmp/WmpResource.java b/src/infinity/resource/wmp/WmpResource.java similarity index 100% rename from infinity/resource/wmp/WmpResource.java rename to src/infinity/resource/wmp/WmpResource.java diff --git a/infinity/search/AbstractReferenceSearcher.java b/src/infinity/search/AbstractReferenceSearcher.java similarity index 100% rename from infinity/search/AbstractReferenceSearcher.java rename to src/infinity/search/AbstractReferenceSearcher.java diff --git a/infinity/search/AttributeSearcher.java b/src/infinity/search/AttributeSearcher.java similarity index 100% rename from infinity/search/AttributeSearcher.java rename to src/infinity/search/AttributeSearcher.java diff --git a/infinity/search/DialogSearcher.java b/src/infinity/search/DialogSearcher.java similarity index 100% rename from infinity/search/DialogSearcher.java rename to src/infinity/search/DialogSearcher.java diff --git a/infinity/search/DialogStateReferenceSearcher.java b/src/infinity/search/DialogStateReferenceSearcher.java similarity index 100% rename from infinity/search/DialogStateReferenceSearcher.java rename to src/infinity/search/DialogStateReferenceSearcher.java diff --git a/infinity/search/ReferenceHitFrame.java b/src/infinity/search/ReferenceHitFrame.java similarity index 100% rename from infinity/search/ReferenceHitFrame.java rename to src/infinity/search/ReferenceHitFrame.java diff --git a/infinity/search/ReferenceSearcher.java b/src/infinity/search/ReferenceSearcher.java similarity index 100% rename from infinity/search/ReferenceSearcher.java rename to src/infinity/search/ReferenceSearcher.java diff --git a/infinity/search/ScriptReferenceSearcher.java b/src/infinity/search/ScriptReferenceSearcher.java similarity index 100% rename from infinity/search/ScriptReferenceSearcher.java rename to src/infinity/search/ScriptReferenceSearcher.java diff --git a/infinity/search/SearchClient.java b/src/infinity/search/SearchClient.java similarity index 100% rename from infinity/search/SearchClient.java rename to src/infinity/search/SearchClient.java diff --git a/infinity/search/SearchFrame.java b/src/infinity/search/SearchFrame.java similarity index 100% rename from infinity/search/SearchFrame.java rename to src/infinity/search/SearchFrame.java diff --git a/infinity/search/SearchMaster.java b/src/infinity/search/SearchMaster.java similarity index 100% rename from infinity/search/SearchMaster.java rename to src/infinity/search/SearchMaster.java diff --git a/infinity/search/StringReferenceSearcher.java b/src/infinity/search/StringReferenceSearcher.java similarity index 100% rename from infinity/search/StringReferenceSearcher.java rename to src/infinity/search/StringReferenceSearcher.java diff --git a/infinity/search/TextHitFrame.java b/src/infinity/search/TextHitFrame.java similarity index 100% rename from infinity/search/TextHitFrame.java rename to src/infinity/search/TextHitFrame.java diff --git a/infinity/search/TextResourceSearcher.java b/src/infinity/search/TextResourceSearcher.java similarity index 100% rename from infinity/search/TextResourceSearcher.java rename to src/infinity/search/TextResourceSearcher.java diff --git a/infinity/search/WavReferenceSearcher.java b/src/infinity/search/WavReferenceSearcher.java similarity index 100% rename from infinity/search/WavReferenceSearcher.java rename to src/infinity/search/WavReferenceSearcher.java diff --git a/infinity/util/ArrayUtil.java b/src/infinity/util/ArrayUtil.java similarity index 100% rename from infinity/util/ArrayUtil.java rename to src/infinity/util/ArrayUtil.java diff --git a/infinity/util/Byteconvert.java b/src/infinity/util/Byteconvert.java similarity index 100% rename from infinity/util/Byteconvert.java rename to src/infinity/util/Byteconvert.java diff --git a/infinity/util/Decryptor.java b/src/infinity/util/Decryptor.java similarity index 100% rename from infinity/util/Decryptor.java rename to src/infinity/util/Decryptor.java diff --git a/infinity/util/Filereader.java b/src/infinity/util/Filereader.java similarity index 100% rename from infinity/util/Filereader.java rename to src/infinity/util/Filereader.java diff --git a/infinity/util/Filewriter.java b/src/infinity/util/Filewriter.java similarity index 100% rename from infinity/util/Filewriter.java rename to src/infinity/util/Filewriter.java diff --git a/infinity/util/IdsMap.java b/src/infinity/util/IdsMap.java similarity index 100% rename from infinity/util/IdsMap.java rename to src/infinity/util/IdsMap.java diff --git a/infinity/util/IdsMapCache.java b/src/infinity/util/IdsMapCache.java similarity index 100% rename from infinity/util/IdsMapCache.java rename to src/infinity/util/IdsMapCache.java diff --git a/infinity/util/IdsMapEntry.java b/src/infinity/util/IdsMapEntry.java similarity index 100% rename from infinity/util/IdsMapEntry.java rename to src/infinity/util/IdsMapEntry.java diff --git a/infinity/util/IntegerHashMap.java b/src/infinity/util/IntegerHashMap.java similarity index 100% rename from infinity/util/IntegerHashMap.java rename to src/infinity/util/IntegerHashMap.java diff --git a/infinity/util/LongIntegerHashMap.java b/src/infinity/util/LongIntegerHashMap.java similarity index 100% rename from infinity/util/LongIntegerHashMap.java rename to src/infinity/util/LongIntegerHashMap.java diff --git a/infinity/util/MassExporter.java b/src/infinity/util/MassExporter.java similarity index 100% rename from infinity/util/MassExporter.java rename to src/infinity/util/MassExporter.java diff --git a/infinity/util/StringResource.java b/src/infinity/util/StringResource.java similarity index 100% rename from infinity/util/StringResource.java rename to src/infinity/util/StringResource.java diff --git a/infinity/util/StructClipboard.java b/src/infinity/util/StructClipboard.java similarity index 100% rename from infinity/util/StructClipboard.java rename to src/infinity/util/StructClipboard.java From 3f09643e667fce4a80de2e079d8c63693c16605e Mon Sep 17 00:00:00 2001 From: Fred Richardson Date: Sat, 21 Jul 2012 01:10:29 -0400 Subject: [PATCH 18/37] Adding eclipse project files. --- .classpath | 6 ++++++ .project | 17 +++++++++++++++++ 2 files changed, 23 insertions(+) create mode 100644 .classpath create mode 100644 .project diff --git a/.classpath b/.classpath new file mode 100644 index 0000000..4da080c --- /dev/null +++ b/.classpath @@ -0,0 +1,6 @@ + + + + + + diff --git a/.project b/.project new file mode 100644 index 0000000..bb1e4ba --- /dev/null +++ b/.project @@ -0,0 +1,17 @@ + + + NearInfinity + + + + + + org.eclipse.jdt.core.javabuilder + + + + + + org.eclipse.jdt.core.javanature + + From d8a58be268168c0df51aa689355de302fe018a4d Mon Sep 17 00:00:00 2001 From: Fred Richardson Date: Sat, 21 Jul 2012 01:51:33 -0400 Subject: [PATCH 19/37] Wholesale import of changes from DevSin. --- src/infinity/check/EffectsIndexChecker.java | 320 +++++++++--------- src/infinity/datatype/ResourceRef.java | 3 +- src/infinity/resource/Effect2.java | 4 +- src/infinity/resource/EffectFactory.java | 12 +- src/infinity/resource/are/Actor.java | 5 +- src/infinity/resource/are/Ambient.java | 6 +- src/infinity/resource/are/Animation.java | 4 +- src/infinity/resource/are/AreResource.java | 16 +- src/infinity/resource/are/Container.java | 5 +- src/infinity/resource/are/Door.java | 4 +- src/infinity/resource/are/ITEPoint.java | 5 +- src/infinity/resource/are/ProTrap.java | 5 +- src/infinity/resource/are/RestSpawn.java | 2 +- src/infinity/resource/are/SpawnPoint.java | 4 +- src/infinity/resource/are/TiledObject.java | 14 +- src/infinity/resource/are/Variable.java | 6 +- src/infinity/resource/chu/Control.java | 14 +- src/infinity/resource/cre/CreResource.java | 77 +++-- .../resource/cre/MemorizedSpells.java | 2 +- src/infinity/resource/gam/GamResource.java | 26 +- src/infinity/resource/gam/PartyNPC.java | 86 +++-- src/infinity/resource/gam/Variable.java | 6 +- src/infinity/resource/gam/Viewer.java | 2 +- .../resource/graphics/BamResource.java | 6 +- src/infinity/resource/itm/ItmResource.java | 4 +- src/infinity/resource/other/ProResource.java | 32 +- src/infinity/resource/other/VvcResource.java | 12 +- src/infinity/resource/spl/Ability.java | 6 +- src/infinity/resource/spl/SplResource.java | 39 ++- src/infinity/resource/sto/StoResource.java | 1 + src/infinity/resource/wed/Door.java | 4 +- src/infinity/resource/wed/Polygon.java | 2 +- src/infinity/resource/wed/Tilemap.java | 2 +- src/infinity/resource/wmp/AreaEntry.java | 4 +- src/infinity/resource/wmp/MapEntry.java | 6 +- src/infinity/resource/wmp/ViewerArea.java | 2 +- 36 files changed, 396 insertions(+), 352 deletions(-) diff --git a/src/infinity/check/EffectsIndexChecker.java b/src/infinity/check/EffectsIndexChecker.java index f196112..d2d61a9 100644 --- a/src/infinity/check/EffectsIndexChecker.java +++ b/src/infinity/check/EffectsIndexChecker.java @@ -1,160 +1,160 @@ -package infinity.check; - -import infinity.NearInfinity; -import infinity.datatype.DecNumber; -import infinity.datatype.SectionCount; -import infinity.gui.Center; -import infinity.gui.ChildFrame; -import infinity.icon.Icons; -import infinity.resource.AbstractAbility; -import infinity.resource.AbstractStruct; -import infinity.resource.Resource; -import infinity.resource.ResourceFactory; -import infinity.resource.StructEntry; -import infinity.resource.key.ResourceEntry; -import infinity.search.ReferenceHitFrame; - -import java.awt.BorderLayout; -import java.awt.FlowLayout; -import java.awt.GridLayout; -import java.awt.event.ActionEvent; -import java.awt.event.ActionListener; -import java.util.ArrayList; -import java.util.List; - -import javax.swing.BorderFactory; -import javax.swing.JButton; -import javax.swing.JCheckBox; -import javax.swing.JOptionPane; -import javax.swing.JPanel; -import javax.swing.ProgressMonitor; - -public class EffectsIndexChecker extends ChildFrame implements ActionListener, Runnable -{ - private static final String filetypes[] = {"ITM", "SPL"}; - private final JButton bstart = new JButton("Check", Icons.getIcon("Find16.gif")); - private final JButton bcancel = new JButton("Cancel", Icons.getIcon("Delete16.gif")); - private final JButton binvert = new JButton("Invert", Icons.getIcon("Refresh16.gif")); - private final JCheckBox[] boxes; - private final ReferenceHitFrame hitFrame; - private List files; - - public EffectsIndexChecker() - { - super("Effects Index Checker"); - setIconImage(Icons.getIcon("Refresh16.gif").getImage()); - hitFrame = new ReferenceHitFrame("Mis-indexed Effects", NearInfinity.getInstance()); - - boxes = new JCheckBox[filetypes.length]; - bstart.setMnemonic('s'); - bcancel.setMnemonic('c'); - binvert.setMnemonic('i'); - bstart.addActionListener(this); - bcancel.addActionListener(this); - binvert.addActionListener(this); - getRootPane().setDefaultButton(bstart); - - JPanel boxpanel = new JPanel(new GridLayout(0, 2, 3, 3)); - for (int i = 0; i < boxes.length; i++) { - boxes[i] = new JCheckBox(filetypes[i], true); - boxpanel.add(boxes[i]); - } - boxpanel.setBorder(BorderFactory.createEmptyBorder(3, 12, 3, 0)); - - JPanel ipanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); - ipanel.add(binvert); - JPanel innerpanel = new JPanel(new BorderLayout()); - innerpanel.add(boxpanel, BorderLayout.CENTER); - innerpanel.add(ipanel, BorderLayout.SOUTH); - innerpanel.setBorder(BorderFactory.createTitledBorder("Select files to check:")); - - JPanel bpanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); - bpanel.add(bstart); - bpanel.add(bcancel); - - JPanel mainpanel = new JPanel(new BorderLayout()); - mainpanel.add(innerpanel, BorderLayout.CENTER); - mainpanel.add(bpanel, BorderLayout.SOUTH); - mainpanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); - - JPanel pane = (JPanel)getContentPane(); - pane.setLayout(new BorderLayout()); - pane.add(mainpanel, BorderLayout.CENTER); - - pack(); - Center.center(this, NearInfinity.getInstance().getBounds()); - setVisible(true); - } -//--------------------- Begin Interface ActionListener --------------------- - - public void actionPerformed(ActionEvent event) - { - if (event.getSource() == bstart) { - setVisible(false); - files = new ArrayList(); - for (int i = 0; i < filetypes.length; i++) { - if (boxes[i].isSelected()) - files.addAll(ResourceFactory.getInstance().getResources(filetypes[i])); - } - if (files.size() > 0) - new Thread(this).start(); - } - else if (event.getSource() == binvert) { - for (final JCheckBox box : boxes) - box.setSelected(!box.isSelected()); - } - else if (event.getSource() == bcancel) - setVisible(false); - } - -// --------------------- End Interface ActionListener --------------------- - - -// --------------------- Begin Interface Runnable --------------------- - - public void run() - { - ProgressMonitor progress = new ProgressMonitor(NearInfinity.getInstance(), "Checking...", null, 0, - files.size()); - progress.setMillisToDecideToPopup(100); - String type = null; - long startTime = System.currentTimeMillis(); - for (int i = 0; i < files.size(); i++) { - ResourceEntry entry = files.get(i); - Resource resource = ResourceFactory.getResource(entry); - if (resource != null) { - if (!entry.getExtension().equalsIgnoreCase(type)) { - type = entry.getExtension(); - progress.setNote(type + 's'); - } - search(entry, (AbstractStruct)resource); - } - progress.setProgress(i + 1); - if (progress.isCanceled()) { - JOptionPane.showMessageDialog(NearInfinity.getInstance(), "Check canceled", "Info", - JOptionPane.INFORMATION_MESSAGE); - return; - } - } - System.out.println("Check completed: " + (System.currentTimeMillis() - startTime) + "ms."); - hitFrame.setVisible(true); - } - - private void search(ResourceEntry entry, AbstractStruct struct) - { - int numGlobalEffects = ((SectionCount) struct.getAttribute("# global effects")).getValue(); - int expectedEffectsIndex = numGlobalEffects; - List structList = struct.getList(); - for (int i = 0; i < structList.size(); i++) { - Object o = structList.get(i); - if (o instanceof AbstractAbility) { - AbstractAbility abil = (AbstractAbility) o; - int effectsIndex = ((DecNumber) abil.getAttribute("Effects index")).getValue(); - if (effectsIndex != expectedEffectsIndex) { - hitFrame.addHit(entry, entry.getSearchString(), abil); - } - expectedEffectsIndex += abil.getEffectsCount(); - } - } - } -} +package infinity.check; + +import infinity.NearInfinity; +import infinity.datatype.DecNumber; +import infinity.datatype.SectionCount; +import infinity.gui.Center; +import infinity.gui.ChildFrame; +import infinity.icon.Icons; +import infinity.resource.AbstractAbility; +import infinity.resource.AbstractStruct; +import infinity.resource.Resource; +import infinity.resource.ResourceFactory; +import infinity.resource.StructEntry; +import infinity.resource.key.ResourceEntry; +import infinity.search.ReferenceHitFrame; + +import java.awt.BorderLayout; +import java.awt.FlowLayout; +import java.awt.GridLayout; +import java.awt.event.ActionEvent; +import java.awt.event.ActionListener; +import java.util.ArrayList; +import java.util.List; + +import javax.swing.BorderFactory; +import javax.swing.JButton; +import javax.swing.JCheckBox; +import javax.swing.JOptionPane; +import javax.swing.JPanel; +import javax.swing.ProgressMonitor; + +public class EffectsIndexChecker extends ChildFrame implements ActionListener, Runnable +{ + private static final String filetypes[] = {"ITM", "SPL"}; + private final JButton bstart = new JButton("Check", Icons.getIcon("Find16.gif")); + private final JButton bcancel = new JButton("Cancel", Icons.getIcon("Delete16.gif")); + private final JButton binvert = new JButton("Invert", Icons.getIcon("Refresh16.gif")); + private final JCheckBox[] boxes; + private final ReferenceHitFrame hitFrame; + private List files; + + public EffectsIndexChecker() + { + super("Effects Index Checker"); + setIconImage(Icons.getIcon("Refresh16.gif").getImage()); + hitFrame = new ReferenceHitFrame("Mis-indexed Effects", NearInfinity.getInstance()); + + boxes = new JCheckBox[filetypes.length]; + bstart.setMnemonic('s'); + bcancel.setMnemonic('c'); + binvert.setMnemonic('i'); + bstart.addActionListener(this); + bcancel.addActionListener(this); + binvert.addActionListener(this); + getRootPane().setDefaultButton(bstart); + + JPanel boxpanel = new JPanel(new GridLayout(0, 2, 3, 3)); + for (int i = 0; i < boxes.length; i++) { + boxes[i] = new JCheckBox(filetypes[i], true); + boxpanel.add(boxes[i]); + } + boxpanel.setBorder(BorderFactory.createEmptyBorder(3, 12, 3, 0)); + + JPanel ipanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); + ipanel.add(binvert); + JPanel innerpanel = new JPanel(new BorderLayout()); + innerpanel.add(boxpanel, BorderLayout.CENTER); + innerpanel.add(ipanel, BorderLayout.SOUTH); + innerpanel.setBorder(BorderFactory.createTitledBorder("Select files to check:")); + + JPanel bpanel = new JPanel(new FlowLayout(FlowLayout.CENTER)); + bpanel.add(bstart); + bpanel.add(bcancel); + + JPanel mainpanel = new JPanel(new BorderLayout()); + mainpanel.add(innerpanel, BorderLayout.CENTER); + mainpanel.add(bpanel, BorderLayout.SOUTH); + mainpanel.setBorder(BorderFactory.createEmptyBorder(3, 3, 3, 3)); + + JPanel pane = (JPanel)getContentPane(); + pane.setLayout(new BorderLayout()); + pane.add(mainpanel, BorderLayout.CENTER); + + pack(); + Center.center(this, NearInfinity.getInstance().getBounds()); + setVisible(true); + } +//--------------------- Begin Interface ActionListener --------------------- + + public void actionPerformed(ActionEvent event) + { + if (event.getSource() == bstart) { + setVisible(false); + files = new ArrayList(); + for (int i = 0; i < filetypes.length; i++) { + if (boxes[i].isSelected()) + files.addAll(ResourceFactory.getInstance().getResources(filetypes[i])); + } + if (files.size() > 0) + new Thread(this).start(); + } + else if (event.getSource() == binvert) { + for (final JCheckBox box : boxes) + box.setSelected(!box.isSelected()); + } + else if (event.getSource() == bcancel) + setVisible(false); + } + +// --------------------- End Interface ActionListener --------------------- + + +// --------------------- Begin Interface Runnable --------------------- + + public void run() + { + ProgressMonitor progress = new ProgressMonitor(NearInfinity.getInstance(), "Checking...", null, 0, + files.size()); + progress.setMillisToDecideToPopup(100); + String type = null; + long startTime = System.currentTimeMillis(); + for (int i = 0; i < files.size(); i++) { + ResourceEntry entry = files.get(i); + Resource resource = ResourceFactory.getResource(entry); + if (resource != null) { + if (!entry.getExtension().equalsIgnoreCase(type)) { + type = entry.getExtension(); + progress.setNote(type + 's'); + } + search(entry, (AbstractStruct)resource); + } + progress.setProgress(i + 1); + if (progress.isCanceled()) { + JOptionPane.showMessageDialog(NearInfinity.getInstance(), "Check canceled", "Info", + JOptionPane.INFORMATION_MESSAGE); + return; + } + } + System.out.println("Check completed: " + (System.currentTimeMillis() - startTime) + "ms."); + hitFrame.setVisible(true); + } + + private void search(ResourceEntry entry, AbstractStruct struct) + { + int numGlobalEffects = ((SectionCount) struct.getAttribute("# global effects")).getValue(); + int expectedEffectsIndex = numGlobalEffects; + List structList = struct.getList(); + for (int i = 0; i < structList.size(); i++) { + Object o = structList.get(i); + if (o instanceof AbstractAbility) { + AbstractAbility abil = (AbstractAbility) o; + int effectsIndex = ((DecNumber) abil.getAttribute("First effect index")).getValue(); + if (effectsIndex != expectedEffectsIndex) { + hitFrame.addHit(entry, entry.getSearchString(), abil); + } + expectedEffectsIndex += abil.getEffectsCount(); + } + } + } +} diff --git a/src/infinity/datatype/ResourceRef.java b/src/infinity/datatype/ResourceRef.java index 632d5e0..20aecb0 100644 --- a/src/infinity/datatype/ResourceRef.java +++ b/src/infinity/datatype/ResourceRef.java @@ -132,7 +132,8 @@ public void mouseClicked(MouseEvent event) bUpdate.setActionCommand(StructViewer.UPDATE_VALUE); bView = new JButton("View/Edit", Icons.getIcon("Zoom16.gif")); bView.addActionListener(this); - bView.setEnabled(list.getSelectedValue() != null && list.getSelectedValue() != NONE); + bView.setEnabled(list.getSelectedValue() != null && list.getSelectedValue() != NONE && + ((ResourceRefEntry)list.getSelectedValue()).entry != null); list.addListSelectionListener(this); GridBagLayout gbl = new GridBagLayout(); diff --git a/src/infinity/resource/Effect2.java b/src/infinity/resource/Effect2.java index 43822cf..8a5a122 100644 --- a/src/infinity/resource/Effect2.java +++ b/src/infinity/resource/Effect2.java @@ -16,8 +16,8 @@ public final class Effect2 extends AbstractStruct implements AddRemovable "Recharge after resting", "", "", "", "", "Bypass armor", "Keen edge"}; private static final String s_splflag[] = {"No flags set", "", "", "", "", "", "", "", "", "", - "", "Hostile", "No LOS required", "", "Outdoors only", - "Non-magical ability", "Trigger/Contingency"}; + "", "Hostile", "No LOS required", "Allow spotting", "Outdoors only", + "Non-magical ability", "Trigger/Contingency", "Non-combat ability"}; public static void readCommon(List list, byte[] buffer, int offset) { diff --git a/src/infinity/resource/EffectFactory.java b/src/infinity/resource/EffectFactory.java index 51589cd..9334a39 100644 --- a/src/infinity/resource/EffectFactory.java +++ b/src/infinity/resource/EffectFactory.java @@ -2211,7 +2211,7 @@ else if (gameid == ResourceFactory.ID_BG2 || break; case 0xEB: // Wing buffet (CGameEffectPushPull) - s.add(new DecNumber(buffer, offset, 4, "Distance")); + s.add(new DecNumber(buffer, offset, 4, "Strength")); s.add(new Bitmap(buffer, offset + 4, 4, "Direction", new String[]{"", "Away from target point", "Away from source", "Toward target point", "Toward source"})); @@ -2935,6 +2935,11 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { s.add(new DecNumber(buffer, offset + 4, 4, "Enchantment to overcome")); break; + case 0x1B5: // Disguise + s.add(new IdsBitmap(buffer, offset, 4, "Animation", "ANIMATE.IDS")); + s.add(new Unknown(buffer, offset + 4, 4)); + break; + case 0x1BB: // Protection from arrows s.add(new Unknown(buffer, offset, 4)); s.add(new Bitmap(buffer, offset + 4, 4, "Damage reduction", @@ -2947,6 +2952,11 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { new String[]{"Minor globe of invulnerability", "Globe of invulnerability"})); break; + + case 0x1C4: // Bane + s.add(new DecNumber(buffer, offset, 4, "Amount")); + s.add(new Unknown(buffer, offset + 4, 4)); + break; } } diff --git a/src/infinity/resource/are/Actor.java b/src/infinity/resource/are/Actor.java index 0d387d1..adebe22 100644 --- a/src/infinity/resource/are/Actor.java +++ b/src/infinity/resource/are/Actor.java @@ -15,7 +15,8 @@ public final class Actor extends AbstractStruct implements AddRemovable, HasDeta public static final String[] s_orientation = { "South", "SSW", "SW", "WSW", "West", "WNW", "NW", "NNW", "North", "NNE", "NE", "ENE", "East", "ESE", "SE", "SSE" }; private static final String[] s_noyes = {"No", "Yes"}; - private static final String[] s_yesno = {"CRE attached", "CRE not attached", "", "", "Override script name"}; + private static final String[] s_yesno = {"CRE attached", "CRE not attached", "Has seen party", + "Toggle invulnerability", "Override script name"}; static final String[] s_schedule = {"Not active", "00:30-01:29", "01:30-02:29", "02:30-03:29", "03:30-04:29", "04:30-05:29", "05:30-06:29", "06:30-07:29", "07:30-08:29", "08:30-09:29", "09:30-10:29", "10:30-11:29", @@ -107,7 +108,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new Unknown(buffer, offset + 54, 2)); list.add(new DecNumber(buffer, offset + 56, 4, "Expiry time")); list.add(new DecNumber(buffer, offset + 60, 2, "Wander distance")); - list.add(new DecNumber(buffer, offset + 62, 2, "Movement distance")); + list.add(new DecNumber(buffer, offset + 62, 2, "Follow distance")); list.add(new Flag(buffer, offset + 64, 4, "Present at", s_schedule)); list.add(new DecNumber(buffer, offset + 68, 4, "# times talked to")); list.add(new ResourceRef(buffer, offset + 72, "Dialogue", "DLG")); diff --git a/src/infinity/resource/are/Ambient.java b/src/infinity/resource/are/Ambient.java index 99aaf8e..8cf9bb3 100644 --- a/src/infinity/resource/are/Ambient.java +++ b/src/infinity/resource/are/Ambient.java @@ -10,7 +10,7 @@ final class Ambient extends AbstractStruct implements AddRemovable { - private static final String[] s_flag = {"Disabled", "Enabled", "Disable environmental effects", + private static final String[] s_flag = {"Disabled", "Enabled", "Looping", "Ignore radius", "Play in random order", "High memory ambient"}; Ambient() throws Exception @@ -30,7 +30,9 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 34, 2, "Origin: Y")); list.add(new DecNumber(buffer, offset + 36, 2, "Radius")); // list.add(new DecNumber(buffer, offset + 38, 2, "Height (3D)?")); - list.add(new Unknown(buffer, offset + 38, 8)); + list.add(new Unknown(buffer, offset + 38, 2)); + list.add(new DecNumber(buffer, offset + 40, 4, "Pitch variation")); + list.add(new DecNumber(buffer, offset + 44, 2, "Volume variation")); list.add(new DecNumber(buffer, offset + 46, 2, "Volume")); if (getSuperStruct() != null) for (int i = 0; i < 10; i++) diff --git a/src/infinity/resource/are/Animation.java b/src/infinity/resource/are/Animation.java index 472ba60..eb8daee 100644 --- a/src/infinity/resource/are/Animation.java +++ b/src/infinity/resource/are/Animation.java @@ -10,7 +10,7 @@ final class Animation extends AbstractStruct implements AddRemovable { private static final String[] s_flag = {"Not shown", "Is shown", "No shadow", "Not light source", - "Partial animation", "Synchronized draw", "", + "Partial animation", "Synchronized draw", "Random start", "Not covered by wall", "Static animation", "Draw as background", "Play all frames", "Recolored by palette", "Mirror Y axis", "Don't remove in combat"}; @@ -37,7 +37,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new Flag(buffer, offset + 52, 4, "Appearance", s_flag)); list.add(new DecNumber(buffer, offset + 56, 2, "Location: Z")); list.add(new DecNumber(buffer, offset + 58, 2, "Translucency")); - list.add(new Unknown(buffer, offset + 60, 2)); + list.add(new DecNumber(buffer, offset + 60, 2, "Start range")); list.add(new DecNumber(buffer, offset + 62, 1, "Loop probability")); list.add(new DecNumber(buffer, offset + 63, 1, "Start delay (frames)")); if (ResourceFactory.getGameID() == ResourceFactory.ID_BG2 || diff --git a/src/infinity/resource/are/AreResource.java b/src/infinity/resource/are/AreResource.java index c42fc70..58dc770 100644 --- a/src/infinity/resource/are/AreResource.java +++ b/src/infinity/resource/are/AreResource.java @@ -30,6 +30,7 @@ public final class AreResource extends AbstractStruct implements Resource, HasAd "Cannot rest", "Cannot save", "Too dangerous to rest", "Cannot save", "Can rest with permission"}; private static final String s_atype_iwd2[] = {"Normal", "Can't save game", "Cannot rest", "Lock battle music"}; + private static final String s_edge[] = {"No flags set", "Party required", "Party enabled"}; public static void addScriptNames(Set scriptNames, byte buffer[]) { @@ -245,13 +246,13 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) else list.add(new Flag(buffer, offset + 20, 4, "Area type", s_atype)); list.add(new ResourceRef(buffer, offset + 24, "Area north", "ARE")); - list.add(new Unknown(buffer, offset + 32, 4)); + list.add(new Flag(buffer, offset + 32, 4, "Edge flags north", s_edge)); list.add(new ResourceRef(buffer, offset + 36, "Area east", "ARE")); - list.add(new Unknown(buffer, offset + 44, 4)); + list.add(new Flag(buffer, offset + 44, 4, "Edge flags east", s_edge)); list.add(new ResourceRef(buffer, offset + 48, "Area south", "ARE")); - list.add(new Unknown(buffer, offset + 56, 4)); + list.add(new Flag(buffer, offset + 56, 4, "Edge flags south", s_edge)); list.add(new ResourceRef(buffer, offset + 60, "Area west", "ARE")); - list.add(new Unknown(buffer, offset + 68, 4)); + list.add(new Flag(buffer, offset + 68, 4, "Edge flags west", s_edge)); if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) list.add(new Flag(buffer, offset + 72, 2, "Location", s_flag_torment)); else @@ -260,7 +261,7 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) list.add(new DecNumber(buffer, offset + 76, 2, "Snow probability")); list.add(new DecNumber(buffer, offset + 78, 2, "Fog probability")); list.add(new DecNumber(buffer, offset + 80, 2, "Lightning probability")); - list.add(new Unknown(buffer, offset + 82, 2)); + list.add(new DecNumber(buffer, offset + 82, 2, "Wind speed")); if (version.toString().equalsIgnoreCase("V9.1")) { list.add(new DecNumber(buffer, offset + 84, 1, "Area difficulty 2")); list.add(new DecNumber(buffer, offset + 85, 1, "Area difficulty 3")); @@ -315,10 +316,11 @@ else if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) SectionOffset offset_variables = new SectionOffset(buffer, offset + 136, "Variables offset", Variable.class); list.add(offset_variables); - SectionCount count_variables = new SectionCount(buffer, offset + 140, 4, "# variables", + SectionCount count_variables = new SectionCount(buffer, offset + 140, 2, "# variables", Variable.class); list.add(count_variables); - list.add(new Unknown(buffer, offset + 144, 4)); + list.add(new HexNumber(buffer, offset + 142, 2, "# object flags")); + list.add(new HexNumber(buffer, offset + 144, 4, "Object flags offset")); list.add(new ResourceRef(buffer, offset + 148, "Area script", "BCS")); SectionCount size_exploredbitmap = new SectionCount(buffer, offset + 156, 4, "Explored bitmap size", Unknown.class); diff --git a/src/infinity/resource/are/Container.java b/src/infinity/resource/are/Container.java index e17849d..a59323b 100644 --- a/src/infinity/resource/are/Container.java +++ b/src/infinity/resource/are/Container.java @@ -17,7 +17,7 @@ public final class Container extends AbstractStruct implements AddRemovable, Has "", "Bag", "Chest", "Drawer", "Pile", "Table", "Shelf", "Altar", "Non-visible", "Spellbook", "Body", "Barrel", "Crate"}; private static final String s_yesno[] = {"No", "Yes"}; - private static final String s_flag[] = { "No flags set", "Locked", "", "", "Trap resets", + private static final String s_flag[] = { "No flags set", "Locked", "", "Magical lock", "Trap resets", "", "Disabled" }; public Container() throws Exception @@ -148,7 +148,8 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new ResourceRef(buffer, offset + 72, "Trap script", "BCS")); list.add(new DecNumber(buffer, offset + 80, 4, "First vertex index")); list.add(new DecNumber(buffer, offset + 84, 2, "# vertices")); - list.add(new Unknown(buffer, offset + 86, 34)); + list.add(new DecNumber(buffer, offset + 86, 2, "Activation range")); + list.add(new TextString(buffer, offset + 88, 32, "Owner name")); // list.add(new ResourceRef(buffer, offset + 88, "Creature?", "CRE")); // list.add(new Unknown(buffer, offset + 96, 24)); list.add(new ResourceRef(buffer, offset + 120, "Key", "ITM")); diff --git a/src/infinity/resource/are/Door.java b/src/infinity/resource/are/Door.java index 25c6c20..a0e986a 100644 --- a/src/infinity/resource/are/Door.java +++ b/src/infinity/resource/are/Door.java @@ -143,8 +143,8 @@ protected int read(byte buffer[], int offset) throws Exception OpenVertexImpeded.class)); list.add(new SectionCount(buffer, offset + 78, 2, "# vertices (impeded, closed)", ClosedVertexImpeded.class)); list.add(new DecNumber(buffer, offset + 80, 4, "First vertex index (impeded, closed)")); - list.add(new Unknown(buffer, offset + 84, 4)); -// list.add(new Unknown(buffer, offset + 86, 2)); + list.add(new DecNumber(buffer, offset + 84, 2, "Current HP")); + list.add(new DecNumber(buffer, offset + 86, 2, "Effective AC")); list.add(new ResourceRef(buffer, offset + 88, "Opening sound", "WAV")); list.add(new ResourceRef(buffer, offset + 96, "Closing sound", "WAV")); list.add(new DecNumber(buffer, offset + 104, 4, "Cursor number")); diff --git a/src/infinity/resource/are/ITEPoint.java b/src/infinity/resource/are/ITEPoint.java index 6cdc0f4..ad0ed14 100644 --- a/src/infinity/resource/are/ITEPoint.java +++ b/src/infinity/resource/are/ITEPoint.java @@ -12,8 +12,9 @@ public final class ITEPoint extends AbstractStruct implements AddRemovable, HasV { private static final String[] s_type = {"Proximity trigger", "Info trigger", "Travel trigger"}; private static final String[] s_flag = {"No flags set", "Locked", "Trap resets", "Party required", "Trap detectable", - "", "", "Trap set off by NPC", "", "Trigger deactivated", "Cannot be passed by NPC", - "Use activation point", "Connected to door"}; + "Trap set off by enemy", "Tutorial trigger", "Trap set off by NPC", "Trigger silent", + "Trigger deactivated", "Cannot be passed by NPC", "Use activation point", + "Connected to door"}; private static final String[] s_yesno = {"No", "Yes"}; public ITEPoint() throws Exception diff --git a/src/infinity/resource/are/ProTrap.java b/src/infinity/resource/are/ProTrap.java index e970c68..ba29eb9 100644 --- a/src/infinity/resource/are/ProTrap.java +++ b/src/infinity/resource/are/ProTrap.java @@ -26,13 +26,14 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new SectionOffset(buffer, offset + 8, "Effects list offset", null)); // Mac ToB doesn't save these right, so EFFs not handled list.add(new DecNumber(buffer, offset + 12, 2, "Effects list size")); - list.add(new Unknown(buffer, offset + 14, 2, "Projectile")); + list.add(new DecNumber(buffer, offset + 14, 2, "Projectile")); list.add(new DecNumber(buffer, offset + 16, 2, "Explosion frequency (frames)")); list.add(new DecNumber(buffer, offset + 18, 2, "Duration")); list.add(new DecNumber(buffer, offset + 20, 2, "Location: X")); list.add(new DecNumber(buffer, offset + 22, 2, "Location: Y")); list.add(new DecNumber(buffer, offset + 24, 2, "Location: Z")); - list.add(new DecNumber(buffer, offset + 26, 2, "Target")); + list.add(new DecNumber(buffer, offset + 26, 1, "Target")); + list.add(new DecNumber(buffer, offset + 27, 1, "Portrait")); return offset + 28; } } diff --git a/src/infinity/resource/are/RestSpawn.java b/src/infinity/resource/are/RestSpawn.java index ee5d910..94893f7 100644 --- a/src/infinity/resource/are/RestSpawn.java +++ b/src/infinity/resource/are/RestSpawn.java @@ -25,7 +25,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 154, 2, "Encounter difficulty")); list.add(new DecNumber(buffer, offset + 156, 4, "Creature duration")); list.add(new DecNumber(buffer, offset + 160, 2, "Creature wander distance")); - list.add(new DecNumber(buffer, offset + 162, 2, "Creature movement distance")); + list.add(new DecNumber(buffer, offset + 162, 2, "Creature follow distance")); list.add(new DecNumber(buffer, offset + 164, 2, "Maximum spawned creatures")); list.add(new Bitmap(buffer, offset + 166, 2, "Is active?", new String[]{"No", "Yes"})); list.add(new DecNumber(buffer, offset + 168, 2, "Probability (day)")); diff --git a/src/infinity/resource/are/SpawnPoint.java b/src/infinity/resource/are/SpawnPoint.java index bbe1cc8..3994bda 100644 --- a/src/infinity/resource/are/SpawnPoint.java +++ b/src/infinity/resource/are/SpawnPoint.java @@ -31,13 +31,13 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new SpawnResourceRef(buffer, offset + 36 + (i << 3), "Creature " + (i + 1))); list.add(new DecNumber(buffer, offset + 116, 2, "# creatures")); list.add(new DecNumber(buffer, offset + 118, 2, "Encounter difficulty")); - list.add(new DecNumber(buffer, offset + 120, 2, "Spawn delay")); + list.add(new DecNumber(buffer, offset + 120, 2, "Spawn rate")); list.add(new Flag(buffer, offset + 122, 2, "Spawn method", new String[]{"No flags set", "Spawn until paused", "Disable after spawn", "Spawn paused"})); list.add(new DecNumber(buffer, offset + 124, 4, "Creature duration")); list.add(new DecNumber(buffer, offset + 128, 2, "Creature wander distance")); - list.add(new DecNumber(buffer, offset + 130, 2, "Creature movement distance")); + list.add(new DecNumber(buffer, offset + 130, 2, "Creature follow distance")); list.add(new DecNumber(buffer, offset + 132, 2, "Maximum spawned creatures")); list.add(new Bitmap(buffer, offset + 134, 2, "Is active?", s_active)); list.add(new Flag(buffer, offset + 136, 4, "Active at", Actor.s_schedule)); diff --git a/src/infinity/resource/are/TiledObject.java b/src/infinity/resource/are/TiledObject.java index af001f1..16ff762 100644 --- a/src/infinity/resource/are/TiledObject.java +++ b/src/infinity/resource/are/TiledObject.java @@ -10,6 +10,8 @@ final class TiledObject extends AbstractStruct implements AddRemovable { + private static final String s_flag[] = { "No flags set", "Secondary tile", "Can be looked through" }; + TiledObject() throws Exception { super(null, "Tiled object", new byte[108], 0); @@ -23,12 +25,12 @@ final class TiledObject extends AbstractStruct implements AddRemovable protected int read(byte buffer[], int offset) throws Exception { list.add(new TextString(buffer, offset, 32, "Name")); - list.add(new TextString(buffer, offset + 32, 8, "Resource?")); - list.add(new Unknown(buffer, offset + 40, 4)); - list.add(new DecNumber(buffer, offset + 44, 4, "Primary search squares offset")); - list.add(new DecNumber(buffer, offset + 48, 4, "# primary search squares")); - list.add(new DecNumber(buffer, offset + 52, 4, "Secondary search squares offset")); - list.add(new DecNumber(buffer, offset + 56, 4, "# secondary search squares")); + list.add(new TextString(buffer, offset + 32, 8, "Tile ID")); + list.add(new Flag(buffer, offset + 40, 4, "Tile flags", s_flag)); + list.add(new DecNumber(buffer, offset + 44, 4, "First vertex index (primary)")); + list.add(new DecNumber(buffer, offset + 48, 2, "# vertices (primary)")); + list.add(new DecNumber(buffer, offset + 50, 2, "# vertices (secondary)")); + list.add(new DecNumber(buffer, offset + 52, 4, "First vertex index (secondary)")); list.add(new Unknown(buffer, offset + 60, 48)); return offset + 108; } diff --git a/src/infinity/resource/are/Variable.java b/src/infinity/resource/are/Variable.java index 1f7305f..e7b4ee9 100644 --- a/src/infinity/resource/are/Variable.java +++ b/src/infinity/resource/are/Variable.java @@ -10,6 +10,9 @@ final class Variable extends AbstractStruct implements AddRemovable { + private static final String s_type[] = {"Integer", "Float", "Script name", "Resource reference", + "String reference", "Double word"}; + Variable() throws Exception { super(null, "Variable", new byte[84], 0); @@ -23,7 +26,8 @@ final class Variable extends AbstractStruct implements AddRemovable protected int read(byte buffer[], int offset) throws Exception { list.add(new TextString(buffer, offset, 32, "Name")); - list.add(new Unknown(buffer, offset + 32, 8)); + list.add(new Bitmap(buffer, offset + 32, 2, "Type", s_type)); + list.add(new Unknown(buffer, offset + 34, 6)); list.add(new DecNumber(buffer, offset + 40, 4, "Value")); list.add(new Unknown(buffer, offset + 44, 40)); return offset + 84; diff --git a/src/infinity/resource/chu/Control.java b/src/infinity/resource/chu/Control.java index fb054d0..4f6b57e 100644 --- a/src/infinity/resource/chu/Control.java +++ b/src/infinity/resource/chu/Control.java @@ -71,10 +71,14 @@ public int readControl(byte buffer[]) list.add(new ResourceRef(buffer, offset + 14, "Button", "BAM")); list.add(new UnsignDecNumber(buffer, offset + 22, 1, "Animation number")); list.add(new Flag(buffer, offset + 23, 1, "Text flags", s_button)); - list.add(new DecNumber(buffer, offset + 24, 2, "Frame number: Unpressed")); - list.add(new DecNumber(buffer, offset + 26, 2, "Frame number: Pressed")); - list.add(new DecNumber(buffer, offset + 28, 2, "Frame number: Selected")); - list.add(new DecNumber(buffer, offset + 30, 2, "Frame number: Disabled")); + list.add(new DecNumber(buffer, offset + 24, 1, "Frame number: Unpressed")); + list.add(new DecNumber(buffer, offset + 25, 1, "Text anchor: Left")); + list.add(new DecNumber(buffer, offset + 26, 1, "Frame number: Pressed")); + list.add(new DecNumber(buffer, offset + 27, 1, "Text anchor: Right")); + list.add(new DecNumber(buffer, offset + 28, 1, "Frame number: Selected")); + list.add(new DecNumber(buffer, offset + 29, 1, "Text anchor: Top")); + list.add(new DecNumber(buffer, offset + 30, 1, "Frame number: Disabled")); + list.add(new DecNumber(buffer, offset + 31, 1, "Text anchor: Bottom")); offset += 32; break; case 2: @@ -102,7 +106,7 @@ public int readControl(byte buffer[]) list.add(new DecNumber(buffer, offset + 48, 2, "Frame number")); list.add(new DecNumber(buffer, offset + 50, 2, "Caret position: X")); list.add(new DecNumber(buffer, offset + 52, 2, "Caret position: Y")); - list.add(new Unknown(buffer, offset + 54, 4)); + list.add(new DecNumber(buffer, offset + 54, 4, "Text field ID")); list.add(new ResourceRef(buffer, offset + 58, "Font", "BAM")); list.add(new Unknown(buffer, offset + 66, 2)); list.add(new TextString(buffer, offset + 68, 32, "Initial text")); diff --git a/src/infinity/resource/cre/CreResource.java b/src/infinity/resource/cre/CreResource.java index 00885b6..781cc31 100644 --- a/src/infinity/resource/cre/CreResource.java +++ b/src/infinity/resource/cre/CreResource.java @@ -18,15 +18,14 @@ public final class CreResource extends AbstractStruct implements Resource, HasAd HasDetailViewer { private static final LongIntegerHashMap m_magetype = new LongIntegerHashMap(); - private static final LongIntegerHashMap m_slotmask = new LongIntegerHashMap(); private static final LongIntegerHashMap m_colorPlacement = new LongIntegerHashMap(); - private static final String s_flag[] = {"No flags set", "", "No corpse", "Permanent corpse", + private static final String s_flag[] = {"No flags set", "Identified", "No corpse", "Permanent corpse", "Original class: Fighter", "Original class: Mage", "Original class: Cleric", "Original class: Thief", "Original class: Druid", "Original class: Ranger", "Fallen paladin", "Fallen ranger", - "Export allowed", "Hide status", "", "Moving between areas", "Been in party", - "", "", "", "", "", "", "", "", "Allegiance tracking", + "Export allowed", "Hide status", "Large creature", "Moving between areas", "Been in party", + "Holding item", "Clear all flags", "", "", "", "", "", "", "Allegiance tracking", "General tracking", "Race tracking", "Class tracking", "Specifics tracking", "Gender tracking", "Alignment tracking", "Uninterruptible"}; @@ -67,9 +66,6 @@ public final class CreResource extends AbstractStruct implements Resource, HasAd m_magetype.put((long)0x2000, "Transmuter"); m_magetype.put((long)0x4000, "Generalist"); - m_slotmask.put(0L, "Yes"); - m_slotmask.put(65535L, "No"); - m_colorPlacement.put((long)0x80, "Metal"); m_colorPlacement.put((long)0x81, "Metal (hologram)"); m_colorPlacement.put((long)0x82, "Metal (pulsate)"); @@ -377,14 +373,14 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new IdsBitmap(buffer, offset + 58, 2, "Quick shield slot 3", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 60, 2, "Quick weapon slot 4", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 62, 2, "Quick shield slot 4", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 64, 2, "Show quick weapon 1?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 66, 2, "Show quick shield 1?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 68, 2, "Show quick weapon 2?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 70, 2, "Show quick shield 2?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 72, 2, "Show quick weapon 3?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 74, 2, "Show quick shield 3?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 76, 2, "Show quick weapon 4?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 78, 2, "Show quick shield 4?", m_slotmask)); + list.add(new DecNumber(buffer, offset + 64, 2, "Quick weapon 1 ability")); + list.add(new DecNumber(buffer, offset + 66, 2, "Quick shield 1 ability")); + list.add(new DecNumber(buffer, offset + 68, 2, "Quick weapon 2 ability")); + list.add(new DecNumber(buffer, offset + 70, 2, "Quick shield 2 ability")); + list.add(new DecNumber(buffer, offset + 72, 2, "Quick weapon 3 ability")); + list.add(new DecNumber(buffer, offset + 74, 2, "Quick shield 3 ability")); + list.add(new DecNumber(buffer, offset + 76, 2, "Quick weapon 4 ability")); + list.add(new DecNumber(buffer, offset + 78, 2, "Quick shield 4 ability")); list.add(new ResourceRef(buffer, offset + 80, "Quick spell 1", "SPL")); list.add(new ResourceRef(buffer, offset + 88, "Quick spell 2", "SPL")); list.add(new ResourceRef(buffer, offset + 96, "Quick spell 3", "SPL")); @@ -407,9 +403,9 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new IdsBitmap(buffer, offset + 162, 2, "Quick item slot 1", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 164, 2, "Quick item slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 166, 2, "Quick item slot 3", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 168, 2, "Show quick item 1?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 170, 2, "Show quick item 2?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 172, 2, "Show quick item 3?", m_slotmask)); + list.add(new DecNumber(buffer, offset + 168, 2, "Quick item 1 ability")); + list.add(new DecNumber(buffer, offset + 170, 2, "Quick item 2 ability")); + list.add(new DecNumber(buffer, offset + 172, 2, "Quick item 3 ability")); list.add(new ResourceRef(buffer, offset + 174, "Quick ability 1", "SPL")); list.add(new ResourceRef(buffer, offset + 182, "Quick ability 2", "SPL")); list.add(new ResourceRef(buffer, offset + 190, "Quick ability 3", "SPL")); @@ -442,24 +438,24 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new TextString(buffer, offset + 388, 32, "Voice set")); list.add(new Unknown(buffer, offset + 420, 128)); } - else if (version.toString().equalsIgnoreCase("V1.0")) { + else if (version.toString().equalsIgnoreCase("V1.0") || version.toString().equalsIgnoreCase("V2.0")) { list.add(new IdsBitmap(buffer, offset + 48, 2, "Quick weapon slot 1", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 50, 2, "Quick weapon slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 52, 2, "Quick weapon slot 3", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 54, 2, "Quick weapon slot 4", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 56, 2, "Show quick weapon 1?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 58, 2, "Show quick weapon 2?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 60, 2, "Show quick weapon 3?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 62, 2, "Show quick weapon 4?", m_slotmask)); + list.add(new DecNumber(buffer, offset + 56, 2, "Quick weapon 1 ability")); + list.add(new DecNumber(buffer, offset + 58, 2, "Quick weapon 2 ability")); + list.add(new DecNumber(buffer, offset + 60, 2, "Quick weapon 3 ability")); + list.add(new DecNumber(buffer, offset + 62, 2, "Quick weapon 4 ability")); list.add(new ResourceRef(buffer, offset + 64, "Quick spell 1", "SPL")); list.add(new ResourceRef(buffer, offset + 72, "Quick spell 2", "SPL")); list.add(new ResourceRef(buffer, offset + 80, "Quick spell 3", "SPL")); list.add(new IdsBitmap(buffer, offset + 88, 2, "Quick item slot 1", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 90, 2, "Quick item slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 92, 2, "Quick item slot 3", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 94, 2, "Show quick item 1?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 96, 2, "Show quick item 2?", m_slotmask)); - list.add(new HashBitmap(buffer, offset + 98, 2, "Show quick item 3?", m_slotmask)); + list.add(new DecNumber(buffer, offset + 94, 2, "Quick item 1 ability")); + list.add(new DecNumber(buffer, offset + 96, 2, "Quick item 2 ability")); + list.add(new DecNumber(buffer, offset + 98, 2, "Quick item 3 ability")); } else list.add(new Unknown(buffer, offset + 48, structOffset.getValue() - 48)); @@ -490,8 +486,8 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new IdsFlag(buffer, offset + 24, 4, "Status", "STATE.IDS")); list.add(new DecNumber(buffer, offset + 28, 2, "Current HP")); list.add(new DecNumber(buffer, offset + 30, 2, "Maximum HP")); - list.add(new IdsBitmap(buffer, offset + 32, 2, "Animation", "ANIMATE.IDS")); - list.add(new Unknown(buffer, offset + 34, 2)); + list.add(new IdsBitmap(buffer, offset + 32, 4, "Animation", "ANIMATE.IDS")); +// list.add(new Unknown(buffer, offset + 34, 2)); list.add(new ColorValue(buffer, offset + 36, 1, "Metal color")); list.add(new ColorValue(buffer, offset + 37, 1, "Minor color")); list.add(new ColorValue(buffer, offset + 38, 1, "Major color")); @@ -661,7 +657,17 @@ private int readIWD2(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 740, 2, "Saved location: X")); list.add(new DecNumber(buffer, offset + 742, 2, "Saved location: Y")); list.add(new DecNumber(buffer, offset + 744, 2, "Saved orientation")); - list.add(new Unknown(buffer, offset + 746, 146)); + list.add(new Unknown(buffer, offset + 746, 15)); + list.add(new DecNumber(buffer, offset + 761, 1, "Fade amount")); + list.add(new DecNumber(buffer, offset + 762, 1, "Fade speed")); + list.add(new Flag(buffer, offset + 763, 1, "Attributes", + new String[]{"No flags set", "Mental fortitude", + "Critical hit immunity", "Cannot be paladin", + "Cannot be monk"})); + list.add(new DecNumber(buffer, offset + 764, 1, "Visibility")); + list.add(new Unknown(buffer, offset + 765, 2)); + list.add(new DecNumber(buffer, offset + 767, 1, "Unused skill points")); + list.add(new Unknown(buffer, offset + 768, 124)); list.add(new IdsBitmap(buffer, offset + 892, 1, "Allegiance", "EA.IDS")); list.add(new IdsBitmap(buffer, offset + 893, 1, "General", "GENERAL.IDS")); list.add(new IdsBitmap(buffer, offset + 894, 1, "Race", "RACE.IDS")); @@ -947,8 +953,8 @@ private int readOther(String version, byte buffer[], int offset) throws Exceptio list.add(new IdsFlag(buffer, offset + 24, 4, "Status", "STATE.IDS")); list.add(new DecNumber(buffer, offset + 28, 2, "Current HP")); list.add(new DecNumber(buffer, offset + 30, 2, "Maximum HP")); - list.add(new IdsBitmap(buffer, offset + 32, 2, "Animation", "ANIMATE.IDS")); - list.add(new Unknown(buffer, offset + 34, 2)); + list.add(new IdsBitmap(buffer, offset + 32, 4, "Animation", "ANIMATE.IDS")); +// list.add(new Unknown(buffer, offset + 34, 2)); // if (version.equalsIgnoreCase("V1.2") || version.equalsIgnoreCase("V1.1")) // list.add(new Unknown(buffer, offset + 36, 7)); // else { @@ -1021,7 +1027,7 @@ private int readOther(String version, byte buffer[], int offset) throws Exceptio list.add(new DecNumber(buffer, offset + 107, 1, "Spiked proficiency")); list.add(new DecNumber(buffer, offset + 108, 1, "Axe proficiency")); list.add(new DecNumber(buffer, offset + 109, 1, "Missile proficiency")); - list.add(new Unknown(buffer, offset + 110, 13)); + list.add(new Unknown(buffer, offset + 110, 12)); } else if (version.equalsIgnoreCase("V1.2") || version.equalsIgnoreCase("V1.1")) { list.add(new DecNumber(buffer, offset + 102, 1, "Fist proficiency")); @@ -1039,7 +1045,7 @@ else if (version.equalsIgnoreCase("V1.2") || version.equalsIgnoreCase("V1.1")) { // list.add(new DecNumber(buffer, offset + 114, 1, "Extra proficiency 7")); // list.add(new DecNumber(buffer, offset + 115, 1, "Extra proficiency 8")); // list.add(new DecNumber(buffer, offset + 116, 1, "Extra proficiency 9")); - list.add(new Unknown(buffer, offset + 108, 15)); + list.add(new Unknown(buffer, offset + 108, 14)); } else if (version.equalsIgnoreCase("V9.0")) { list.add(new DecNumber(buffer, offset + 102, 1, "Large sword proficiency")); @@ -1057,14 +1063,15 @@ else if (version.equalsIgnoreCase("V9.0")) { list.add(new DecNumber(buffer, offset + 114, 1, "Club proficiency")); list.add(new DecNumber(buffer, offset + 115, 1, "Quarterstaff proficiency")); list.add(new DecNumber(buffer, offset + 116, 1, "Crossbow proficiency")); - list.add(new Unknown(buffer, offset + 117, 6)); + list.add(new Unknown(buffer, offset + 117, 5)); } else { list.clear(); throw new Exception("Unsupported version: " + version); } + list.add(new DecNumber(buffer, offset + 122, 1, "Undead level")); list.add(new DecNumber(buffer, offset + 123, 1, "Tracking")); - list.add(new Unknown(buffer, offset + 124, 32)); + list.add(new TextString(buffer, offset + 124, 32, "Target")); LongIntegerHashMap sndmap = null; if (ResourceFactory.getInstance().resourceExists("SNDSLOT.IDS")) sndmap = IdsMapCache.get("SNDSLOT.IDS").getMap(); diff --git a/src/infinity/resource/cre/MemorizedSpells.java b/src/infinity/resource/cre/MemorizedSpells.java index 08c5904..4c5e287 100644 --- a/src/infinity/resource/cre/MemorizedSpells.java +++ b/src/infinity/resource/cre/MemorizedSpells.java @@ -10,7 +10,7 @@ final class MemorizedSpells extends AbstractStruct implements AddRemovable { - private static final String[] s_mem = {"Spell already cast", "Spell memorized"}; + private static final String[] s_mem = {"Spell already cast", "Spell memorized", "Spell disabled"}; MemorizedSpells() throws Exception { diff --git a/src/infinity/resource/gam/GamResource.java b/src/infinity/resource/gam/GamResource.java index 0332a66..d7e7a10 100644 --- a/src/infinity/resource/gam/GamResource.java +++ b/src/infinity/resource/gam/GamResource.java @@ -15,7 +15,9 @@ public final class GamResource extends AbstractStruct implements Resource, HasAddRemovable, HasDetailViewer { private static final String s_formation[] = {"Button 1", "Button 2", "Button 3", "Button 4", "Button 5"}; - private static final String s_weather[] = {"No weather", "Raining", "Snowing"}; + private static final String s_weather[] = {"No weather", "Raining", "Snowing", "Light weather", + "Medium weather", "Light wind", "Medium wind", "Rare lightning", + "Regular lightning", "Storm increasing"}; private static final String s_torment[] = {"Follow", "T", "Gather", "4 and 2", "3 by 2", "Protect", "2 by 3", "Rank", "V", "Wedge", "S", "Line", "None"}; @@ -104,10 +106,10 @@ protected int read(byte buffer[], int offset) throws Exception SectionCount count_partynpc = new SectionCount(buffer, offset + 36, 4, "# party members", PartyNPC.class); list.add(count_partynpc); - SectionOffset offset_unknown = new SectionOffset(buffer, offset + 40, "Unknown section offset", + SectionOffset offset_unknown = new SectionOffset(buffer, offset + 40, "Party inventory offset", UnknownSection2.class); list.add(offset_unknown); - SectionCount count_unknown = new SectionCount(buffer, offset + 44, 4, "Unknown section count", + SectionCount count_unknown = new SectionCount(buffer, offset + 44, 4, "Party inventory count", UnknownSection2.class); list.add(count_unknown); SectionOffset offset_nonpartynpc = new SectionOffset(buffer, offset + 48, "Non-party characters offset", @@ -122,8 +124,8 @@ protected int read(byte buffer[], int offset) throws Exception SectionCount count_global = new SectionCount(buffer, offset + 60, 4, "# global variables", Variable.class); list.add(count_global); - list.add(new ResourceRef(buffer, offset + 64, "Main area", "ARE")); - list.add(new Unknown(buffer, offset + 72, 4)); + list.add(new ResourceRef(buffer, offset + 64, "Current area", "ARE")); + list.add(new DecNumber(buffer, offset + 72, 4, "Current link")); SectionCount count_journal = new SectionCount(buffer, offset + 76, 4, "# journal entries", JournalEntry.class); list.add(count_journal); @@ -138,17 +140,17 @@ protected int read(byte buffer[], int offset) throws Exception int gameid = ResourceFactory.getGameID(); if (gameid == ResourceFactory.ID_BG1 || gameid == ResourceFactory.ID_BG1TOTSC) { // V1.1 list.add(new DecNumber(buffer, offset + 84, 4, "Reputation")); - list.add(new ResourceRef(buffer, offset + 88, "Current area", "ARE")); + list.add(new ResourceRef(buffer, offset + 88, "Master area", "ARE")); list.add(new Flag(buffer, offset + 96, 4, "Configuration", new String[]{"Normal windows", "Party AI disabled", "Larger text window", "Largest text window"})); - list.add(new Unknown(buffer, offset + 100, 4)); + list.add(new DecNumber(buffer, offset + 100, 4, "Save version")); list.add(new Unknown(buffer, offset + 104, 76)); } else if (gameid == ResourceFactory.ID_ICEWIND || gameid == ResourceFactory.ID_ICEWINDHOW || gameid == ResourceFactory.ID_ICEWINDHOWTOT) { // V1.1 list.add(new DecNumber(buffer, offset + 84, 4, "Reputation")); - list.add(new ResourceRef(buffer, offset + 88, "Current area", "ARE")); + list.add(new ResourceRef(buffer, offset + 88, "Master area", "ARE")); list.add(new Flag(buffer, offset + 96, 4, "Configuration", new String[]{"Normal windows", "", "Larger text window", "Largest text window"})); @@ -162,7 +164,7 @@ else if (gameid == ResourceFactory.ID_TORMENT) { // V1.1 offRubikon = new SectionOffset(buffer, offset + 84, "Modron maze offset", Unknown.class); list.add(offRubikon); list.add(new DecNumber(buffer, offset + 88, 4, "Reputation")); - list.add(new ResourceRef(buffer, offset + 92, "Current area", "ARE")); + list.add(new ResourceRef(buffer, offset + 92, "Master area", "ARE")); offKillvariable = new SectionOffset(buffer, offset + 100, "Kill variables offset", KillVariable.class); list.add(offKillvariable); numKillVariable = new SectionCount(buffer, offset + 104, 4, "# kill variables", KillVariable.class); @@ -175,12 +177,12 @@ else if (gameid == ResourceFactory.ID_TORMENT) { // V1.1 else if (gameid == ResourceFactory.ID_BG2 || gameid == ResourceFactory.ID_BG2TOB || gameid == ResourceFactory.ID_TUTU) { // V2.0 list.add(new DecNumber(buffer, offset + 84, 4, "Reputation")); - list.add(new ResourceRef(buffer, offset + 88, "Current area", "ARE")); + list.add(new ResourceRef(buffer, offset + 88, "Master area", "ARE")); list.add(new Flag(buffer, offset + 96, 4, "Configuration", new String[]{"Normal windows", "Party AI disabled", "Larger text window", "Largest text window", "", "Fullscreen mode", "Left pane hidden", "Right pane hidden", "Automap notes hidden"})); - list.add(new Unknown(buffer, offset + 100, 4)); + list.add(new DecNumber(buffer, offset + 100, 4, "Save version")); offFamiliar = new SectionOffset(buffer, offset + 104, "Familiar info offset", Familiar.class); list.add(offFamiliar); // list.add(new DecNumber(buffer, offset + 108, 4, "File size")); @@ -196,7 +198,7 @@ else if (gameid == ResourceFactory.ID_BG2 || gameid == ResourceFactory.ID_BG2TOB } else if (gameid == ResourceFactory.ID_ICEWIND2) { // V2.2 (V1.1 & V2.0 in BIFF) list.add(new Unknown(buffer, offset + 84, 4)); - list.add(new ResourceRef(buffer, offset + 88, "Current area?", "ARE")); + list.add(new ResourceRef(buffer, offset + 88, "Master area", "ARE")); list.add(new Flag(buffer, offset + 96, 4, "Configuration", new String[]{"Normal windows", "Party AI disabled", "", "", "", "Fullscreen mode", "Button bar hidden", diff --git a/src/infinity/resource/gam/PartyNPC.java b/src/infinity/resource/gam/PartyNPC.java index d3367ab..048bee4 100644 --- a/src/infinity/resource/gam/PartyNPC.java +++ b/src/infinity/resource/gam/PartyNPC.java @@ -16,7 +16,6 @@ class PartyNPC extends AbstractStruct implements HasDetailViewer, HasAddRemovabl { private static final LongIntegerHashMap partyOrder = new LongIntegerHashMap(); private static final LongIntegerHashMap m_selected = new LongIntegerHashMap(); - private static final LongIntegerHashMap m_partyslot = new LongIntegerHashMap(); private static final String s_noyes[] = {"No", "Yes"}; static { @@ -32,9 +31,6 @@ class PartyNPC extends AbstractStruct implements HasDetailViewer, HasAddRemovabl m_selected.put(0L, "Not selected"); m_selected.put(1L, "Selected"); m_selected.put(32768L, "Dead"); - - m_partyslot.put(0L, "Yes"); - m_partyslot.put(65535L, "No"); } PartyNPC() throws Exception @@ -133,19 +129,19 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new IdsBitmap(buffer, offset + 142, 2, "Quick weapon slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 144, 2, "Quick weapon slot 3", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 146, 2, "Quick weapon slot 4", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 148, 2, "Show quick weapon 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 150, 2, "Show quick weapon 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 152, 2, "Show quick weapon 3?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 154, 2, "Show quick weapon 4?", m_partyslot)); + list.add(new DecNumber(buffer, offset + 148, 2, "Quick weapon 1 ability")); + list.add(new DecNumber(buffer, offset + 150, 2, "Quick weapon 2 ability")); + list.add(new DecNumber(buffer, offset + 152, 2, "Quick weapon 3 ability")); + list.add(new DecNumber(buffer, offset + 154, 2, "Quick weapon 4 ability")); list.add(new ResourceRef(buffer, offset + 156, "Quick spell 1", "SPL")); list.add(new ResourceRef(buffer, offset + 164, "Quick spell 2", "SPL")); list.add(new ResourceRef(buffer, offset + 172, "Quick spell 3", "SPL")); list.add(new IdsBitmap(buffer, offset + 180, 2, "Quick item slot 1", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 182, 2, "Quick item slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 184, 2, "Quick item slot 3", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 186, 2, "Show quick item 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 188, 2, "Show quick item 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 190, 2, "Show quick item 3?", m_partyslot)); + list.add(new DecNumber(buffer, offset + 186, 2, "Quick item 1 ability")); + list.add(new DecNumber(buffer, offset + 188, 2, "Quick item 2 ability")); + list.add(new DecNumber(buffer, offset + 190, 2, "Quick item 3 ability")); list.add(new TextString(buffer, offset + 192, 32, "Name")); list.add(new DecNumber(buffer, offset + 224, 4, "# times talked to")); offset = readCharStats(buffer, offset + 228); @@ -161,19 +157,19 @@ else if (gameid == ResourceFactory.ID_BG2 || gameid == ResourceFactory.ID_BG2TOB list.add(new IdsBitmap(buffer, offset + 142, 2, "Quick weapon slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 144, 2, "Quick weapon slot 3", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 146, 2, "Quick weapon slot 4", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 148, 2, "Show quick weapon 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 150, 2, "Show quick weapon 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 152, 2, "Show quick weapon 3?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 154, 2, "Show quick weapon 4?", m_partyslot)); + list.add(new DecNumber(buffer, offset + 148, 2, "Quick weapon 1 ability")); + list.add(new DecNumber(buffer, offset + 150, 2, "Quick weapon 2 ability")); + list.add(new DecNumber(buffer, offset + 152, 2, "Quick weapon 3 ability")); + list.add(new DecNumber(buffer, offset + 154, 2, "Quick weapon 4 ability")); list.add(new ResourceRef(buffer, offset + 156, "Quick spell 1", "SPL")); list.add(new ResourceRef(buffer, offset + 164, "Quick spell 2", "SPL")); list.add(new ResourceRef(buffer, offset + 172, "Quick spell 3", "SPL")); list.add(new IdsBitmap(buffer, offset + 180, 2, "Quick item slot 1", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 182, 2, "Quick item slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 184, 2, "Quick item slot 3", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 186, 2, "Show quick item 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 188, 2, "Show quick item 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 190, 2, "Show quick item 3?", m_partyslot)); + list.add(new DecNumber(buffer, offset + 186, 2, "Quick item 1 ability")); + list.add(new DecNumber(buffer, offset + 188, 2, "Quick item 2 ability")); + list.add(new DecNumber(buffer, offset + 190, 2, "Quick item 3 ability")); list.add(new TextString(buffer, offset + 192, 32, "Name")); list.add(new DecNumber(buffer, offset + 224, 4, "# times talked to")); offset = readCharStats(buffer, offset + 228); @@ -188,10 +184,10 @@ else if (gameid == ResourceFactory.ID_TORMENT) { list.add(new DecNumber(buffer, offset + 142, 2, "Quick weapon slot 2")); list.add(new DecNumber(buffer, offset + 144, 2, "Quick weapon slot 3")); list.add(new DecNumber(buffer, offset + 146, 2, "Quick weapon slot 4")); - list.add(new HashBitmap(buffer, offset + 148, 2, "Show quick weapon 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 150, 2, "Show quick weapon 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 152, 2, "Show quick weapon 3?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 154, 2, "Show quick weapon 4?", m_partyslot)); + list.add(new DecNumber(buffer, offset + 148, 2, "Quick weapon 1 ability")); + list.add(new DecNumber(buffer, offset + 150, 2, "Quick weapon 2 ability")); + list.add(new DecNumber(buffer, offset + 152, 2, "Quick weapon 3 ability")); + list.add(new DecNumber(buffer, offset + 154, 2, "Quick weapon 4 ability")); list.add(new ResourceRef(buffer, offset + 156, "Quick spell 1", "SPL")); list.add(new ResourceRef(buffer, offset + 164, "Quick spell 2", "SPL")); list.add(new ResourceRef(buffer, offset + 172, "Quick spell 3", "SPL")); @@ -200,11 +196,11 @@ else if (gameid == ResourceFactory.ID_TORMENT) { list.add(new DecNumber(buffer, offset + 184, 2, "Quick item slot 3")); list.add(new DecNumber(buffer, offset + 186, 2, "Quick item slot 4")); list.add(new DecNumber(buffer, offset + 188, 2, "Quick item slot 5")); - list.add(new HashBitmap(buffer, offset + 190, 2, "Show quick item 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 192, 2, "Show quick item 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 194, 2, "Show quick item 3?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 196, 2, "Show quick item 4?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 198, 2, "Show quick item 5?", m_partyslot)); + list.add(new DecNumber(buffer, offset + 190, 2, "Quick item 1 ability")); + list.add(new DecNumber(buffer, offset + 192, 2, "Quick item 2 ability")); + list.add(new DecNumber(buffer, offset + 194, 2, "Quick item 3 ability")); + list.add(new DecNumber(buffer, offset + 196, 2, "Quick item 4 ability")); + list.add(new DecNumber(buffer, offset + 198, 2, "Quick item 5 ability")); list.add(new TextString(buffer, offset + 200, 32, "Name")); list.add(new DecNumber(buffer, offset + 232, 4, "# times talked to")); offset = readCharStats(buffer, offset + 236); @@ -219,19 +215,19 @@ else if (gameid == ResourceFactory.ID_ICEWIND || gameid == ResourceFactory.ID_IC list.add(new IdsBitmap(buffer, offset + 142, 2, "Quick weapon slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 144, 2, "Quick weapon slot 3", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 146, 2, "Quick weapon slot 4", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 148, 2, "Show quick weapon 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 150, 2, "Show quick weapon 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 152, 2, "Show quick weapon 3?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 154, 2, "Show quick weapon 4?", m_partyslot)); + list.add(new DecNumber(buffer, offset + 148, 2, "Quick weapon 1 ability")); + list.add(new DecNumber(buffer, offset + 150, 2, "Quick weapon 2 ability")); + list.add(new DecNumber(buffer, offset + 152, 2, "Quick weapon 3 ability")); + list.add(new DecNumber(buffer, offset + 154, 2, "Quick weapon 4 ability")); list.add(new ResourceRef(buffer, offset + 156, "Quick spell 1", "SPL")); list.add(new ResourceRef(buffer, offset + 164, "Quick spell 2", "SPL")); list.add(new ResourceRef(buffer, offset + 172, "Quick spell 3", "SPL")); list.add(new IdsBitmap(buffer, offset + 180, 2, "Quick item slot 1", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 182, 2, "Quick item slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 184, 2, "Quick item slot 3", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 186, 2, "Show quick item 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 188, 2, "Show quick item 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 190, 2, "Show quick item 3?", m_partyslot)); + list.add(new DecNumber(buffer, offset + 186, 2, "Quick item 1 ability")); + list.add(new DecNumber(buffer, offset + 188, 2, "Quick item 2 ability")); + list.add(new DecNumber(buffer, offset + 190, 2, "Quick item 3 ability")); list.add(new TextString(buffer, offset + 192, 32, "Name")); list.add(new Unknown(buffer, offset + 224, 4)); offset = readCharStats(buffer, offset + 228); @@ -250,14 +246,14 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { list.add(new IdsBitmap(buffer, offset + 150, 2, "Quick shield slot 3", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 152, 2, "Quick weapon slot 4", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 154, 2, "Quick shield slot 4", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 156, 2, "Show quick weapon 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 158, 2, "Show quick shield 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 160, 2, "Show quick weapon 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 162, 2, "Show quick shield 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 164, 2, "Show quick weapon 3?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 166, 2, "Show quick shield 3?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 168, 2, "Show quick weapon 4?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 170, 2, "Show quick shield 4?", m_partyslot)); + list.add(new DecNumber(buffer, offset + 156, 2, "Quick weapon 1 ability")); + list.add(new DecNumber(buffer, offset + 158, 2, "Quick shield 1 ability")); + list.add(new DecNumber(buffer, offset + 160, 2, "Quick weapon 2 ability")); + list.add(new DecNumber(buffer, offset + 162, 2, "Quick shield 2 ability")); + list.add(new DecNumber(buffer, offset + 164, 2, "Quick weapon 3 ability")); + list.add(new DecNumber(buffer, offset + 166, 2, "Quick shield 3 ability")); + list.add(new DecNumber(buffer, offset + 168, 2, "Quick weapon 4 ability")); + list.add(new DecNumber(buffer, offset + 170, 2, "Quick shield 4 ability")); list.add(new ResourceRef(buffer, offset + 172, "Quick spell 1", "SPL")); list.add(new ResourceRef(buffer, offset + 180, "Quick spell 2", "SPL")); list.add(new ResourceRef(buffer, offset + 188, "Quick spell 3", "SPL")); @@ -280,9 +276,9 @@ else if (gameid == ResourceFactory.ID_ICEWIND2) { list.add(new IdsBitmap(buffer, offset + 254, 2, "Quick item slot 1", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 256, 2, "Quick item slot 2", "SLOTS.IDS")); list.add(new IdsBitmap(buffer, offset + 258, 2, "Quick item slot 3", "SLOTS.IDS")); - list.add(new HashBitmap(buffer, offset + 260, 2, "Show quick item 1?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 262, 2, "Show quick item 2?", m_partyslot)); - list.add(new HashBitmap(buffer, offset + 264, 2, "Show quick item 3?", m_partyslot)); + list.add(new DecNumber(buffer, offset + 260, 2, "Quick item 1 ability")); + list.add(new DecNumber(buffer, offset + 262, 2, "Quick item 2 ability")); + list.add(new DecNumber(buffer, offset + 264, 2, "Quick item 3 ability")); list.add(new ResourceRef(buffer, offset + 266, "Quick ability 1", "SPL")); list.add(new ResourceRef(buffer, offset + 274, "Quick ability 2", "SPL")); list.add(new ResourceRef(buffer, offset + 282, "Quick ability 3", "SPL")); diff --git a/src/infinity/resource/gam/Variable.java b/src/infinity/resource/gam/Variable.java index 5a4537f..555ae99 100644 --- a/src/infinity/resource/gam/Variable.java +++ b/src/infinity/resource/gam/Variable.java @@ -10,6 +10,9 @@ class Variable extends AbstractStruct implements AddRemovable { + private static final String s_type[] = {"Integer", "Float", "Script name", "Resource reference", + "String reference", "Double word"}; + Variable() throws Exception { super(null, "Variable", new byte[84], 0); @@ -28,7 +31,8 @@ class Variable extends AbstractStruct implements AddRemovable protected int read(byte buffer[], int offset) throws Exception { list.add(new TextString(buffer, offset, 32, "Name")); - list.add(new Unknown(buffer, offset + 32, 8)); + list.add(new Bitmap(buffer, offset + 32, 2, "Type", s_type)); + list.add(new Unknown(buffer, offset + 34, 6)); list.add(new DecNumber(buffer, offset + 40, 4, "Value")); list.add(new Unknown(buffer, offset + 44, 40)); return offset + 84; diff --git a/src/infinity/resource/gam/Viewer.java b/src/infinity/resource/gam/Viewer.java index 106598e..792f196 100644 --- a/src/infinity/resource/gam/Viewer.java +++ b/src/infinity/resource/gam/Viewer.java @@ -26,7 +26,7 @@ private static JPanel makeMiscPanel(GamResource gam) ResourceFactory.getGameID() == ResourceFactory.ID_TUTU) // V2.0 - better check? ViewerUtil.addLabelFieldPair(panel, gam.getAttribute("Game time (real seconds)"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, gam.getAttribute("Party gold"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(panel, gam.getAttribute("Main area"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(panel, gam.getAttribute("Master area"), gbl, gbc, true); return panel; } diff --git a/src/infinity/resource/graphics/BamResource.java b/src/infinity/resource/graphics/BamResource.java index 30aea69..e30fe00 100644 --- a/src/infinity/resource/graphics/BamResource.java +++ b/src/infinity/resource/graphics/BamResource.java @@ -103,8 +103,7 @@ else if (event.getSource() == bprevframe) { else if (event.getSource() == bnextanim) { selectedAnim++; // stop timer if no frames in current cycle - if ((timer != null) && timer.isRunning() - && (anims[selectedAnim].frameCount == 0)) { + if (timer != null && timer.isRunning() && anims[selectedAnim].frameCount == 0) { timer.stop(); bplay.setSelected(false); } @@ -113,8 +112,7 @@ else if (event.getSource() == bnextanim) { } else if (event.getSource() == bprevanim) { selectedAnim--; - if ((timer != null) && timer.isRunning() - && (anims[selectedAnim].frameCount == 0)) { + if (timer != null && timer.isRunning() && anims[selectedAnim].frameCount == 0) { timer.stop(); bplay.setSelected(false); } diff --git a/src/infinity/resource/itm/ItmResource.java b/src/infinity/resource/itm/ItmResource.java index f75bd5e..4297da4 100644 --- a/src/infinity/resource/itm/ItmResource.java +++ b/src/infinity/resource/itm/ItmResource.java @@ -43,10 +43,10 @@ public final class ItmResource extends AbstractStruct implements Resource, HasAd "Earrings", "Tattoos", "Lenses", "Teeth"}; private static final String[] s_flags = {"None", "Unsellable", "Two-handed", "Droppable", "Displayable", - "Cursed", "Not copyable", "Magical", "Bow", "Silver", "Cold iron", "", "Conversable"}; + "Cursed", "Not copyable", "Magical", "Left-handed", "Silver", "Cold iron", "Off-handed", "Conversable"}; private static final String[] s_flags11 = {"None", "Unsellable", "Two-handed", "Droppable", "Displayable", - "Cursed", "Not copyable", "Magical", "", "Silver", "Cold iron", "Steel", "Conversable", + "Cursed", "Not copyable", "Magical", "Left-handed", "Silver", "Cold iron", "Steel", "Conversable", "Pulsating"}; private static final String[] s_usability = {"None", "Chaotic", "Evil", "Good", "... Neutral", "Lawful", diff --git a/src/infinity/resource/other/ProResource.java b/src/infinity/resource/other/ProResource.java index bd5f13f..934f4c5 100644 --- a/src/infinity/resource/other/ProResource.java +++ b/src/infinity/resource/other/ProResource.java @@ -24,18 +24,18 @@ public final class ProResource extends AbstractStruct implements Resource // "Purple fireball", "Green dragon blast"}; private static final String[] s_areaflags = { "Trap not visible", "Trap visible", "Triggered by inanimates", "Triggered by condition", - "No overlapping effects", "Secondary projectile", "Fragments", "Not affecting allies", - "Not affecting enemies"}; + "Delayed trigger", "Secondary projectile", "Fragments", "Not affecting allies", + "Not affecting enemies", "Mage-level duration", "Cleric-level duration", "Draw animation", + "Cone-shaped", "Ignore visibility", "Delayed explosion", "Skip first condition", "Single target" + }; private static final String[] s_flags = { - "No flags set", "Colored BAM", "Creates smoke", "", "Not light source", "Modify for height", + "No flags set", "Colored BAM", "Creates smoke", "Colored smoke", "Not light source", "Modify for height", "Casts shadow", "Light spot enabled", "Translucent", "Mid-level brighten", "Blended" }; - private static final String[] s_behave = {"No flags set", "Show sparks", "3D traveling", - "Loop sound 1", "Loop sound 2", "Ignore center", + private static final String[] s_behave = {"No flags set", "Show sparks", "Use height", + "Loop fire sound", "Loop impact sound", "Ignore center", "Draw as background"}; - private static final String[] s_areatype = {"Round", "Mage level duration", "Cleric level duration", - "Draw animation", "Cone-shaped", "Non-clipped explosion", - "Delayed explosion", "Skip first condition", "Single target"}; + private static final String[] s_trail = {"No flags set", "Draw at target", "Draw at source"}; static { s_proj.put(0L, "Fireball"); @@ -74,8 +74,8 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 10, 2, "Speed")); list.add(new Flag(buffer, offset + 12, 4, "Behavior", s_behave)); // list.add(new Unknown(buffer, offset + 14, 2)); - list.add(new ResourceRef(buffer, offset + 16, "Sound 1", "WAV")); - list.add(new ResourceRef(buffer, offset + 24, "Sound 2", "WAV")); + list.add(new ResourceRef(buffer, offset + 16, "Fire sound", "WAV")); + list.add(new ResourceRef(buffer, offset + 24, "Impact sound", "WAV")); list.add(new ResourceRef(buffer, offset + 32, "Source animation", "BAM")); list.add(new Bitmap(buffer, offset + 40, 4, "Particle color", s_color)); list.add(new Unknown(buffer, offset + 44, 212)); @@ -113,20 +113,22 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 334, 2, "Tailing animation delay 1")); list.add(new DecNumber(buffer, offset + 336, 2, "Tailing animation delay 2")); list.add(new DecNumber(buffer, offset + 338, 2, "Tailing animation delay 3")); - list.add(new Unknown(buffer, offset + 340, 172)); + list.add(new Flag(buffer, offset + 340, 4, "Trail flags", s_trail)); + list.add(new Unknown(buffer, offset + 344, 168)); if (projtype.getValue() != 3) return offset + 512; // Area of effect - list.add(new Flag(buffer, offset + 512, 1, "Area of effect target", s_areaflags)); - list.add(new Flag(buffer, offset + 513, 1, "Area of effect type", s_areatype)); - list.add(new Unknown(buffer, offset + 514, 2)); + list.add(new Flag(buffer, offset + 512, 4, "Area flags", s_areaflags)); +// list.add(new Flag(buffer, offset + 513, 1, "Area of effect type", +// new String[]{"Round", "", "", "Secondary projectile", "", "", "Cone-shaped"})); +// list.add(new Unknown(buffer, offset + 514, 2)); list.add(new DecNumber(buffer, offset + 516, 2, "Trap size")); list.add(new DecNumber(buffer, offset + 518, 2, "Explosion size")); list.add(new ResourceRef(buffer, offset + 520, "Explosion sound", "WAV")); list.add(new DecNumber(buffer, offset + 528, 2, "Explosion frequency (frames)")); list.add(new IdsBitmap(buffer, offset + 530, 2, "Fragment animation", "ANIMATE.IDS")); list.add(new ProRef(buffer, offset + 532, "Secondary projectile")); - list.add(new DecNumber(buffer, offset + 534, 1, "Duration")); + list.add(new DecNumber(buffer, offset + 534, 1, "# repetitions")); list.add(new HashBitmap(buffer, offset + 535, 1, "Explosion effect", s_proj)); list.add(new ColorValue(buffer, offset + 536, 1, "Explosion color")); list.add(new Unknown(buffer, offset + 537, 1)); diff --git a/src/infinity/resource/other/VvcResource.java b/src/infinity/resource/other/VvcResource.java index 7d99ef9..b12906f 100644 --- a/src/infinity/resource/other/VvcResource.java +++ b/src/infinity/resource/other/VvcResource.java @@ -19,7 +19,7 @@ public final class VvcResource extends AbstractStruct implements Resource "Internal gamma", "Non-reserved palette", "Full palette", "", "Dream palette"}; private static final String s_seq[] = {"No flags set", "Looping", "Special lighting", "Modify for height", "Draw animation", "Custom palette", "Purgeable", "Not covered by wall", "Mid-level brighten", "High-level brighten"}; - private static final String s_face[] = {"Use current", "Orbit parent", "Parent orientation", "", "Ignore orientation"}; + private static final String s_face[] = {"Use current", "Face target", "Follow target", "Follow path", "Lock orientation"}; private static final String s_noyes[] = {"No", "Yes"}; public VvcResource(ResourceEntry entry) throws Exception @@ -48,11 +48,11 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new ResourceRef(buffer, offset + 68, "Palette", "BMP")); // list.add(new Unknown(buffer, offset + 72, 4)); list.add(new DecNumber(buffer, offset + 76, 4, "Position: Z")); - list.add(new DecNumber(buffer, offset + 80, 4, "Center point: X")); - list.add(new DecNumber(buffer, offset + 84, 4, "Center point: Y")); + list.add(new DecNumber(buffer, offset + 80, 4, "Light spot width")); + list.add(new DecNumber(buffer, offset + 84, 4, "Light spot height")); list.add(new DecNumber(buffer, offset + 88, 4, "Light spot brightness")); list.add(new DecNumber(buffer, offset + 92, 4, "Duration (frames)")); - list.add(new Unknown(buffer, offset + 96, 8)); + list.add(new ResourceRef(buffer, offset + 96, "Resource", "VVC")); // list.add(new Unknown(buffer, offset + 100, 4)); list.add(new DecNumber(buffer, offset + 104, 4, "First animation number")); list.add(new DecNumber(buffer, offset + 108, 4, "Second animation number")); @@ -60,8 +60,8 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new Bitmap(buffer, offset + 116, 4, "Continuous playback", s_noyes)); list.add(new ResourceRef(buffer, offset + 120, "Starting sound", "WAV")); list.add(new ResourceRef(buffer, offset + 128, "Duration sound", "WAV")); - list.add(new Unknown(buffer, offset + 136, 8)); -// list.add(new Unknown(buffer, offset + 140, 4)); + list.add(new ResourceRef(buffer, offset + 136, "Alpha mask", "BAM")); +// list.add(new Unknown(buffer, offset + 136, 4)); list.add(new DecNumber(buffer, offset + 144, 4, "Third animation number")); list.add(new ResourceRef(buffer, offset + 148, "Ending sound", "WAV")); list.add(new Unknown(buffer, offset + 156, 336)); diff --git a/src/infinity/resource/spl/Ability.java b/src/infinity/resource/spl/Ability.java index 02307a6..247c7ad 100644 --- a/src/infinity/resource/spl/Ability.java +++ b/src/infinity/resource/spl/Ability.java @@ -45,11 +45,11 @@ public JComponent getDetailViewer() protected int read(byte buffer[], int offset) throws Exception { + if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) { list.add(new Bitmap(buffer, offset, 1, "Type", s_type)); - if (ResourceFactory.getGameID() == ResourceFactory.ID_TORMENT) list.add(new Bitmap(buffer, offset + 1, 1, "Hostility", s_hostility)); - else - list.add(new Unknown(buffer, offset + 1, 1)); + } else + list.add(new Bitmap(buffer, offset, 2, "Type", s_type)); list.add(new Bitmap(buffer, offset + 2, 2, "Ability location", s_abilityuse)); list.add(new ResourceRef(buffer, offset + 4, "Icon", "BAM")); list.add(new Bitmap(buffer, offset + 12, 1, "Target", s_targettype)); diff --git a/src/infinity/resource/spl/SplResource.java b/src/infinity/resource/spl/SplResource.java index a236a4b..d88444b 100644 --- a/src/infinity/resource/spl/SplResource.java +++ b/src/infinity/resource/spl/SplResource.java @@ -22,7 +22,7 @@ public final class SplResource extends AbstractStruct implements Resource, HasAd public static final String[] s_school = {"None", "Abjurer", "Conjurer", "Diviner", "Enchanter", "Illusionist", "Invoker", "Necromancer", "Transmuter", "Generalist"}; // private static final LongIntegerHashMap m_wizardtype = new LongIntegerHashMap(); - private static final LongIntegerHashMap m_priesttype = new LongIntegerHashMap(); +// private static final LongIntegerHashMap m_priesttype = new LongIntegerHashMap(); private static final String[] s_spelltype = {"Special", "Wizard", "Priest", "Psionic", "Innate", "Bard song"}; private static final String[] s_anim = {"None", "Fire aqua", "Fire blue", "Fire gold", "Fire green", "Fire magenta", "Fire purple", "Fire red", "Fire white", @@ -36,13 +36,15 @@ public final class SplResource extends AbstractStruct implements Resource, HasAd "Swirl white"}; private static final String[] s_spellflag = {"No flags set", "", "", "", "", "", "", "", "", "", "", "Hostile", - "No LOS required", "", "Outdoors only", - "Non-magical ability", "Trigger/Contingency"}; - private static final String[] s_exclude = { "None", "Chaotic priest", "Evil priest", "Good priest", - "... Neutral priest", "Lawful priest", "Neutral ... priest", + "No LOS required", "Allow spotting", "Outdoors only", + "Non-magical ability", "Trigger/Contingency", "Non-combat ability"}; + private static final String[] s_exclude = { "None", "Chaotic", "Evil", "Good", + "... Neutral", "Lawful", "Neutral ...", "Abjurer", "Conjurer", "Diviner", "Enchanter", "Illusionist", "Invoker", "Necromancer", "Transmuter", - "Generalist"}; + "Generalist", "", "", "", "", "", "", "", "", "Elf", + "Dwarf", "Half-elf", "Halfling", "Human", "Gnome", "", + "Cleric", "Druid"}; static { @@ -56,9 +58,9 @@ public final class SplResource extends AbstractStruct implements Resource, HasAd // m_wizardtype.put((long)0x2000, "Abjuration"); // m_wizardtype.put((long)0x2400, "Necromancy"); - m_priesttype.put((long)0x0000, "All priests"); - m_priesttype.put((long)0x4000, "Druid/Ranger"); - m_priesttype.put((long)0x8000, "Cleric/Paladin"); +// m_priesttype.put((long)0x0000, "All priests"); +// m_priesttype.put((long)0x4000, "Druid/Ranger"); +// m_priesttype.put((long)0x8000, "Cleric/Paladin"); } public static String getSearchString(byte buffer[]) @@ -189,26 +191,27 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new ResourceRef(buffer, offset + 16, "Casting sound", "WAV")); list.add(new Flag(buffer, offset + 24, 4, "Flags", s_spellflag)); list.add(new Bitmap(buffer, offset + 28, 2, "Spell type", s_spelltype)); - list.add(new Flag(buffer, offset + 30, 2, "Exclusion flags", s_exclude)); // 0x1e - list.add(new HashBitmap(buffer, offset + 32, 2, "Priest type", m_priesttype)); // 0x20 + list.add(new Flag(buffer, offset + 30, 4, "Exclusion flags", s_exclude)); // 0x1e +// list.add(new HashBitmap(buffer, offset + 32, 2, "Priest type", m_priesttype)); // 0x20 list.add(new Bitmap(buffer, offset + 34, 2, "Casting animation", s_anim)); // 0x22 list.add(new Unknown(buffer, offset + 36, 1)); // 0x23 if (ResourceFactory.getInstance().resourceExists("SCHOOL.IDS")) - list.add(new IdsBitmap(buffer, offset + 37, 2, "Primary type (school)", "SCHOOL.IDS")); // 0x25 + list.add(new IdsBitmap(buffer, offset + 37, 1, "Primary type (school)", "SCHOOL.IDS")); // 0x25 else - list.add(new Bitmap(buffer, offset + 37, 2, "Primary type (school)", s_school)); // 0x25 + list.add(new Bitmap(buffer, offset + 37, 1, "Primary type (school)", s_school)); // 0x25 + list.add(new Unknown(buffer, offset + 38, 1)); list.add(new Bitmap(buffer, offset + 39, 1, "Secondary type", s_category)); // 0x27 list.add(new Unknown(buffer, offset + 40, 12)); list.add(new DecNumber(buffer, offset + 52, 4, "Spell level")); list.add(new Unknown(buffer, offset + 56, 2)); list.add(new ResourceRef(buffer, offset + 58, "Spell icon", "BAM")); - list.add(new Unknown(buffer, offset + 66, 14)); -// list.add(new TextString(buffer, offset + 68, 8, "ResRef?")); -// list.add(new Unknown(buffer, offset + 76, 4)); + list.add(new Unknown(buffer, offset + 66, 2)); + list.add(new ResourceRef(buffer, offset + 68, "Ground icon", "BAM")); + list.add(new Unknown(buffer, offset + 76, 4)); list.add(new StringRef(buffer, offset + 80, "Spell description")); list.add(new StringRef(buffer, offset + 84, "Identified description")); -// list.add(new ResourceRef(buffer, offset + 88, 8, "Animation?", "BAM")); - list.add(new Unknown(buffer, offset + 88, 12)); + list.add(new ResourceRef(buffer, offset + 88, "Description image", "BAM")); + list.add(new Unknown(buffer, offset + 96, 4)); SectionOffset abil_offset = new SectionOffset(buffer, offset + 100, "Abilities offset", Ability.class); list.add(abil_offset); diff --git a/src/infinity/resource/sto/StoResource.java b/src/infinity/resource/sto/StoResource.java index d7c2256..806523f 100644 --- a/src/infinity/resource/sto/StoResource.java +++ b/src/infinity/resource/sto/StoResource.java @@ -84,6 +84,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset + 20, 4, "Sell markup")); list.add(new DecNumber(buffer, offset + 24, 4, "Buy markup")); list.add(new DecNumber(buffer, offset + 28, 4, "Depreciation rate")); +// list.add(new Unknown(buffer, offset + 30, 2)); list.add(new DecNumber(buffer, offset + 32, 2, "Stealing difficulty")); if (version.toString().equalsIgnoreCase("V9.0")) list.add(new Unknown(buffer, offset + 34, 2)); diff --git a/src/infinity/resource/wed/Door.java b/src/infinity/resource/wed/Door.java index fe672dc..f493b5b 100644 --- a/src/infinity/resource/wed/Door.java +++ b/src/infinity/resource/wed/Door.java @@ -9,6 +9,8 @@ final class Door extends AbstractStruct implements AddRemovable, HasAddRemovable { + private static final String[] s_yesno = {"No", "Yes"}; + Door() throws Exception { super(null, "Door", new byte[26], 0); @@ -75,7 +77,7 @@ public void updatePolygonsOffset(int offset) protected int read(byte buffer[], int offset) throws Exception { list.add(new TextString(buffer, offset, 8, "Name")); - list.add(new Unknown(buffer, offset + 8, 2)); + list.add(new Bitmap(buffer, offset + 8, 2, "Is door?", s_yesno)); DecNumber indexTileCell = new DecNumber(buffer, offset + 10, 2, "Tilemap lookup index"); list.add(indexTileCell); SectionCount countTileCell = new SectionCount(buffer, offset + 12, 2, "# tilemap indexes", diff --git a/src/infinity/resource/wed/Polygon.java b/src/infinity/resource/wed/Polygon.java index 88a5e58..e9b1e49 100644 --- a/src/infinity/resource/wed/Polygon.java +++ b/src/infinity/resource/wed/Polygon.java @@ -67,7 +67,7 @@ protected int read(byte buffer[], int offset) throws Exception { list.add(new DecNumber(buffer, offset, 4, "Vertex index")); list.add(new SectionCount(buffer, offset + 4, 4, "# vertices", Vertex.class)); - list.add(new Unknown(buffer, offset + 8, 2, "Hole flags")); + list.add(new Unknown(buffer, offset + 8, 2)); // list.add(new Unknown(buffer, offset + 9, 1)); list.add(new DecNumber(buffer, offset + 10, 2, "Minimum coordinate: X")); list.add(new DecNumber(buffer, offset + 12, 2, "Maximum coordinate: X")); diff --git a/src/infinity/resource/wed/Tilemap.java b/src/infinity/resource/wed/Tilemap.java index 9ec7dc4..863f173 100644 --- a/src/infinity/resource/wed/Tilemap.java +++ b/src/infinity/resource/wed/Tilemap.java @@ -32,7 +32,7 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new DecNumber(buffer, offset, 2, "Primary tile index")); list.add(new DecNumber(buffer, offset + 2, 2, "Primary tile count")); list.add(new DecNumber(buffer, offset + 4, 2, "Secondary tile index")); - list.add(new Unknown(buffer, offset + 6, 4, "Overlays drawn")); + list.add(new Unknown(buffer, offset + 6, 4)); // list.add(new Unknown(buffer, offset + 7, 3)); return offset + 10; } diff --git a/src/infinity/resource/wmp/AreaEntry.java b/src/infinity/resource/wmp/AreaEntry.java index eb54b29..c86c935 100644 --- a/src/infinity/resource/wmp/AreaEntry.java +++ b/src/infinity/resource/wmp/AreaEntry.java @@ -41,8 +41,8 @@ public JComponent getDetailViewer() protected int read(byte buffer[], int offset) throws Exception { - list.add(new ResourceRef(buffer, offset, "Area content", "ARE")); - list.add(new TextString(buffer, offset + 8, 8, "Area name")); + list.add(new ResourceRef(buffer, offset, "Current area", "ARE")); + list.add(new ResourceRef(buffer, offset + 8, "Original area", "ARE")); list.add(new TextString(buffer, offset + 16, 32, "Script name")); list.add(new Flag(buffer, offset + 48, 4, "Flags", s_flag)); list.add(new DecNumber(buffer, offset + 52, 4, "Icon number")); diff --git a/src/infinity/resource/wmp/MapEntry.java b/src/infinity/resource/wmp/MapEntry.java index 53ecff1..0a738ca 100644 --- a/src/infinity/resource/wmp/MapEntry.java +++ b/src/infinity/resource/wmp/MapEntry.java @@ -40,10 +40,10 @@ protected int read(byte buffer[], int offset) throws Exception list.add(new ResourceRef(buffer, offset, "Map", "MOS")); list.add(new DecNumber(buffer, offset + 8, 4, "Width")); list.add(new DecNumber(buffer, offset + 12, 4, "Height")); - list.add(new Unknown(buffer, offset + 16, 4)); + list.add(new DecNumber(buffer, offset + 16, 4, "Map ID")); list.add(new StringRef(buffer, offset + 20, "Name")); - list.add(new Unknown(buffer, offset + 24, 4)); - list.add(new Unknown(buffer, offset + 28, 4)); + list.add(new DecNumber(buffer, offset + 24, 4, "Center location: X")); + list.add(new DecNumber(buffer, offset + 28, 4, "Center location: Y")); SectionCount area_count = new SectionCount(buffer, offset + 32, 4, "# areas", AreaEntry.class); list.add(area_count); diff --git a/src/infinity/resource/wmp/ViewerArea.java b/src/infinity/resource/wmp/ViewerArea.java index e5e11c0..2cdbce2 100644 --- a/src/infinity/resource/wmp/ViewerArea.java +++ b/src/infinity/resource/wmp/ViewerArea.java @@ -27,7 +27,7 @@ private static JPanel makeInfoPanel(AreaEntry areaEntry) JPanel panel = new JPanel(gbl); gbc.insets = new Insets(3, 3, 3, 3); ViewerUtil.addLabelFieldPair(panel, areaEntry.getAttribute("Name"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(panel, areaEntry.getAttribute("Area content"), gbl, gbc, true); + ViewerUtil.addLabelFieldPair(panel, areaEntry.getAttribute("Current area"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(panel, areaEntry.getAttribute("Loading image"), gbl, gbc, true); return panel; } From cda9ddac47c3abd035f5f5649d7873b6da80fe5a Mon Sep 17 00:00:00 2001 From: Fred Richardson Date: Mon, 23 Jul 2012 22:10:15 -0400 Subject: [PATCH 20/37] Minor changes for BGEE. --- src/infinity/resource/ResourceFactory.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/infinity/resource/ResourceFactory.java b/src/infinity/resource/ResourceFactory.java index f7970ed..2b9bc99 100644 --- a/src/infinity/resource/ResourceFactory.java +++ b/src/infinity/resource/ResourceFactory.java @@ -305,6 +305,8 @@ else if (new File(rootDir, "bg1tutu.exe").exists()) currentGame = ID_TUTU; else if (new File(rootDir, "baldur.exe").exists() && new File(rootDir, "chitin.ini").exists()) currentGame = ID_DEMO; + else if (new File(rootDir, "Baldur.exe").exists() && new File(rootDir, "movies/TSRLOGO.wbm").exists()) + currentGame = ID_BG2TOB; // Placeholder for BGEE - so far we can get by with ToB configuration keyfile = new Keyfile(file, currentGame); factory = this; @@ -493,7 +495,12 @@ public void loadResources() throws Exception // Get resources from keyfile keyfile.addBIFFResourceEntries(treeModel); - StringResource.init(new File(rootDir, DIALOGFILENAME)); + // dialog.tlk has moved in BGEE: + File dlg_file = new File(rootDir, DIALOGFILENAME); + if (! dlg_file.exists()) { + dlg_file = new File(rootDir + "/lang/en_US", DIALOGFILENAME); + } + StringResource.init(dlg_file); // Add other resources for (final String extraDir : games[currentGame].extraDirs) { From 9092a351a4443e015b0dc8d77f874a84448b2bde Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Wed, 25 Jul 2012 12:53:48 +0200 Subject: [PATCH 21/37] Resolve a harmless error related to "Priest type". --- src/infinity/resource/spl/Viewer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infinity/resource/spl/Viewer.java b/src/infinity/resource/spl/Viewer.java index aa83574..850aba6 100644 --- a/src/infinity/resource/spl/Viewer.java +++ b/src/infinity/resource/spl/Viewer.java @@ -23,7 +23,7 @@ private static JPanel makeFieldPanel(SplResource spl) ViewerUtil.addLabelFieldPair(fieldPanel, spl.getAttribute("Spell name"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, spl.getAttribute("Spell type"), gbl, gbc, true); // ViewerUtil.addLabelFieldPair(fieldPanel, spl.getAttribute("Wizard school"), gbl, gbc, true); - ViewerUtil.addLabelFieldPair(fieldPanel, spl.getAttribute("Priest type"), gbl, gbc, true); +// ViewerUtil.addLabelFieldPair(fieldPanel, spl.getAttribute("Priest type"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, spl.getAttribute("Casting animation"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, spl.getAttribute("Primary type (school)"), gbl, gbc, true); ViewerUtil.addLabelFieldPair(fieldPanel, spl.getAttribute("Secondary type"), gbl, gbc, true); From ffe19d52905d3ce1370d600affc1237ec6cd39b1 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Wed, 25 Jul 2012 13:05:38 +0200 Subject: [PATCH 22/37] Version 1.33, w1.0.4 --- src/infinity/gui/BrowserMenuBar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infinity/gui/BrowserMenuBar.java b/src/infinity/gui/BrowserMenuBar.java index b9f6af9..aeffa44 100644 --- a/src/infinity/gui/BrowserMenuBar.java +++ b/src/infinity/gui/BrowserMenuBar.java @@ -30,7 +30,7 @@ public final class BrowserMenuBar extends JMenuBar { - public static final String VERSION = "v1.33 w1.0.3"; + public static final String VERSION = "v1.33 w1.0.4"; public static final int OVERRIDE_IN_THREE = 0, OVERRIDE_IN_OVERRIDE = 1, OVERRIDE_SPLIT = 2; public static final int LOOKFEEL_JAVA = 0, LOOKFEEL_WINDOWS = 1, LOOKFEEL_MOTIF = 2, LOOKFEEL_PLASTICXP = 3; public static final int RESREF_ONLY = 0, RESREF_REF_NAME = 1, RESREF_NAME_REF = 2; From 0bad62b23972b6d1b26bab9516867b9886e86396 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Wed, 25 Jul 2012 14:02:03 +0200 Subject: [PATCH 23/37] Clean before build --- build.xml | 31 +++++++++++++++++-------------- 1 file changed, 17 insertions(+), 14 deletions(-) diff --git a/build.xml b/build.xml index d7dc78e..7d662c1 100644 --- a/build.xml +++ b/build.xml @@ -1,25 +1,28 @@ - - - - - - + + + + + + + + + - + - + From 953286337684141831226cd5c7d6931b361be5be Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Sat, 28 Jul 2012 20:32:11 +0200 Subject: [PATCH 24/37] Bugfix with resources loaded from BCS If you had, for example, a creature and an item of the same resref, all triggers and actions with a S:ResRef* parameter would load the creature, even if the item should have been loaded (e.g., if it was the HasItem trigger). This was so for CRE > ITM > ARE > 2DA > BCS > MVE > SPL > DLG ... This problem could also shadow missing resources, if there existed a matching resref of higher priority but of wrong type. --- src/infinity/gui/ScriptTextArea.java | 4 +- src/infinity/resource/bcs/Compiler.java | 6 +- src/infinity/resource/bcs/Decompiler.java | 81 +++++++++++++++++++++-- 3 files changed, 79 insertions(+), 12 deletions(-) diff --git a/src/infinity/gui/ScriptTextArea.java b/src/infinity/gui/ScriptTextArea.java index 8e01ebc..c6ea0e9 100644 --- a/src/infinity/gui/ScriptTextArea.java +++ b/src/infinity/gui/ScriptTextArea.java @@ -4,6 +4,7 @@ import infinity.resource.Resource; import infinity.resource.ResourceFactory; import infinity.resource.bcs.Compiler; +import infinity.resource.bcs.Decompiler; import infinity.resource.key.ResourceEntry; import infinity.util.IdsMapCache; import infinity.util.IdsMapEntry; @@ -352,8 +353,7 @@ else if (definition.equalsIgnoreCase("S:NewObject*")) { return new String[] { ".CRE", ".DLG", ".BCS", ".ITM" }; } else if (definition.equalsIgnoreCase("S:ResRef*")) { - return new String[]{".CRE", ".ITM", ".ARE", ".2DA", ".BCS", - ".MVE", ".SPL", ".DLG", ".VVC", ".BAM"}; + return Decompiler.getResRefType(function); } return new String[] {}; diff --git a/src/infinity/resource/bcs/Compiler.java b/src/infinity/resource/bcs/Compiler.java index 9e8c90c..b886018 100644 --- a/src/infinity/resource/bcs/Compiler.java +++ b/src/infinity/resource/bcs/Compiler.java @@ -9,6 +9,7 @@ import infinity.gui.BrowserMenuBar; import infinity.resource.ResourceFactory; import infinity.resource.are.AreResource; +import infinity.resource.bcs.Decompiler; import infinity.resource.cre.CreResource; import infinity.resource.key.ResourceEntry; import infinity.util.IdsMap; @@ -358,9 +359,8 @@ else if (definition.equalsIgnoreCase("S:Pool*")) resourceTypes = new String[]{".SRC"}; else if (definition.equalsIgnoreCase("S:Palette*")) resourceTypes = new String[]{".BMP"}; - else if (definition.equalsIgnoreCase("S:ResRef*")) // ToDo: Better check possible? - resourceTypes = new String[]{".CRE", ".ITM", ".ARE", ".2DA", ".BCS", ".MVE", ".SPL", ".DLG", ".VVC", - ".BAM"}; + else if (definition.equalsIgnoreCase("S:ResRef*")) + resourceTypes = Decompiler.getResRefType(function.substring(0, function.length() - 1)); else if (definition.equalsIgnoreCase("S:Object*")) // ToDo: Better check possible? resourceTypes = new String[]{".ITM", ".VVC", ".BAM"}; else if (definition.equalsIgnoreCase("S:NewObject*")) // ToDo: Better check possible? diff --git a/src/infinity/resource/bcs/Decompiler.java b/src/infinity/resource/bcs/Decompiler.java index 270c939..8f6057d 100644 --- a/src/infinity/resource/bcs/Decompiler.java +++ b/src/infinity/resource/bcs/Decompiler.java @@ -146,8 +146,10 @@ private static void decompileAC(StringBuilder code, StringTokenizer st) index += 4; } } - else if (newp != null) // ToDo: IWD2 bug? - comment = getResourceName(p, newp.substring(1, newp.length() - 1)); + else if (newp != null) { // ToDo: IWD2 bug? + String function = action.getString().substring(0, action.getString().length() - 1); + comment = getResourceName(function, p, newp.substring(1, newp.length() - 1)); + } } else if (p.substring(0, 2).equals("O:")) { while (objects[index_o++].equals("[ANYONE]") && index_o < 2) @@ -532,7 +534,8 @@ private static String decompileTR(StringTokenizer st) String p = defParam.nextToken(); if (p.substring(0, 2).equals("S:")) { String newp = strings[index_s++]; - comment = getResourceName(p, newp.substring(1, newp.length() - 1)); + String function = trigger.getString().substring(0, trigger.getString().length() - 1); + comment = getResourceName(function, p, newp.substring(1, newp.length() - 1)); code.append(newp); } else if (p.substring(0, 2).equals("O:")) @@ -557,7 +560,71 @@ public static SortedMap getIdsErrors() return idsErrors; } - private static String getResourceName(String definition, String value) + public static String[] getResRefType(String function) + { + if (function.equalsIgnoreCase("HasItem") || + function.equalsIgnoreCase("Contains") || + function.equalsIgnoreCase("NumItems") || + function.equalsIgnoreCase("NumItemsGT") || + function.equalsIgnoreCase("NumItemsLT") || + function.equalsIgnoreCase("NumItemsParty") || + function.equalsIgnoreCase("NumItemsPartyGT") || + function.equalsIgnoreCase("NumItemsPartyLT") || + function.equalsIgnoreCase("HasItemEquiped") || + function.equalsIgnoreCase("PartyHasItemIdentified") || + function.equalsIgnoreCase("HasItemEquipedReal") || + function.equalsIgnoreCase("Acquired") || + function.equalsIgnoreCase("Unusable") || + function.equalsIgnoreCase("CreateItem") || + function.equalsIgnoreCase("GiveItemCreate") || + function.equalsIgnoreCase("DestroyItem") || + function.equalsIgnoreCase("TakePartyItemNum") || + function.equalsIgnoreCase("CreateItemNumGlobal") || + function.equalsIgnoreCase("CreateItemGlobal") || + function.equalsIgnoreCase("PickUpItem")) { + return new String[] {".ITM"}; + } + else if (function.equalsIgnoreCase("ChangeAnimation") || + function.equalsIgnoreCase("ChangeAnimationNoEffect") || + function.equalsIgnoreCase("CreateCreatureObject") || + function.equalsIgnoreCase("CreateCreatureObjectDoor") || + function.equalsIgnoreCase("CreateCreatureObjectOffScreen") || + function.equalsIgnoreCase("CreateCreatureOffScreen") || + function.equalsIgnoreCase("CreateCreatureAtLocation") || + function.equalsIgnoreCase("CreateCreatureObjectCopy") || + function.equalsIgnoreCase("CreateCreatureObjectOffset") || + function.equalsIgnoreCase("CreateCreatureCopyPoint")) { + return new String[] {".CRE"}; + } + else if (function.equalsIgnoreCase("AreaCheck") || + function.equalsIgnoreCase("AreaCheckObject") || + function.equalsIgnoreCase("RevealAreaOnMap") || + function.equalsIgnoreCase("HideAreaOnMap") || + function.equalsIgnoreCase("CopyGroundPilesTo") || + function.equalsIgnoreCase("EscapeAreaObjectMove")) { + return new String[] {".ARE"}; + } + else if (function.equalsIgnoreCase("G") || + function.equalsIgnoreCase("GGT") || + function.equalsIgnoreCase("GLT")) { + return new String[] {}; + } + else if (function.equalsIgnoreCase("IncrementChapter") || + function.equalsIgnoreCase("TakeItemListParty") || + function.equalsIgnoreCase("TakeItemListPartyNum")) { + return new String[] {".2DA"}; + } + else if (function.equalsIgnoreCase("StartMovie")) { + return new String[] {".MVE"}; + } + else if (function.equalsIgnoreCase("AddSpecialAbility")) { + return new String[] {".SPL"}; + } + return new String[] {".CRE", ".ITM", ".ARE", ".2DA", ".BCS", + ".MVE", ".SPL", ".DLG", ".VVC", ".BAM"}; + } + + private static String getResourceName(String function, String definition, String value) { if (value.length() > 8) return null; @@ -592,9 +659,9 @@ else if (definition.equalsIgnoreCase("S:Pool*")) entry = decompileStringCheck(value, new String[]{".SRC"}); else if (definition.equalsIgnoreCase("S:Palette*")) entry = decompileStringCheck(value, new String[]{".BMP"}); - else if (definition.equalsIgnoreCase("S:ResRef*")) // ToDo: Better check possible? - entry = decompileStringCheck(value, new String[]{".CRE", ".ITM", ".ARE", ".2DA", ".BCS", ".MVE", - ".SPL", ".DLG"}); + else if (definition.equalsIgnoreCase("S:ResRef*")) { + entry = decompileStringCheck(value, getResRefType(function)); + } else if (definition.equalsIgnoreCase("S:Object*")) // ToDo: Better check possible? entry = decompileStringCheck(value, new String[]{".ITM", ".VVC", ".BAM"}); else if (definition.equalsIgnoreCase("S:NewObject*")) // ToDo: Better check possible? From 7efa07eabd007734b8bee37acf7f81a3aba0f105 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Sat, 28 Jul 2012 20:42:53 +0200 Subject: [PATCH 25/37] Fix incorrect attempts at matching against function + "(" --- src/infinity/gui/ScriptTextArea.java | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/infinity/gui/ScriptTextArea.java b/src/infinity/gui/ScriptTextArea.java index c6ea0e9..7fdc361 100644 --- a/src/infinity/gui/ScriptTextArea.java +++ b/src/infinity/gui/ScriptTextArea.java @@ -221,9 +221,9 @@ else if (current == '(') { || (definition.equalsIgnoreCase("S:Name*") && (function.equalsIgnoreCase("Dead") || function.equalsIgnoreCase("Name") - || function.equalsIgnoreCase("NumDead(") - || function.equalsIgnoreCase("NumDeadGT(") - || function.equalsIgnoreCase("NumDeadLT(")))) { + || function.equalsIgnoreCase("NumDead") + || function.equalsIgnoreCase("NumDeadGT") + || function.equalsIgnoreCase("NumDeadLT")))) { Compiler bcscomp = Compiler.getInstance(); if (bcscomp.hasScriptName(token)) { Set entries = bcscomp.getResForScriptName(token); From 75b06aa3fdc8cf88f9c35510d0cd8d5155c8a1db Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Sun, 29 Jul 2012 00:22:55 +0200 Subject: [PATCH 26/37] Fix NPE in StructViewer --- src/infinity/gui/StructViewer.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/infinity/gui/StructViewer.java b/src/infinity/gui/StructViewer.java index d2d68e1..d3eca43 100644 --- a/src/infinity/gui/StructViewer.java +++ b/src/infinity/gui/StructViewer.java @@ -554,8 +554,8 @@ public void tableChanged(TableModelEvent event) { if (event.getType() == TableModelEvent.UPDATE) { StructEntry structEntry = struct.getStructEntryAt(event.getFirstRow()); - if (structEntry instanceof Editable && structEntry.getOffset() == editable.getOffset() && - structEntry != editable) { + if (structEntry instanceof Editable && (editable == null || (structEntry.getOffset() == editable.getOffset() && + structEntry != editable))) { editable = (Editable)structEntry; editpanel.removeAll(); From 569308c32153f8d73e761edca56a56130e010ab1 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Tue, 14 Aug 2012 01:32:08 +0200 Subject: [PATCH 27/37] MassExporter - outputDir.mkdirs() before we try to write files to it --- src/infinity/util/MassExporter.java | 1 + 1 file changed, 1 insertion(+) diff --git a/src/infinity/util/MassExporter.java b/src/infinity/util/MassExporter.java index 126bd14..d2113f1 100644 --- a/src/infinity/util/MassExporter.java +++ b/src/infinity/util/MassExporter.java @@ -136,6 +136,7 @@ public void actionPerformed(ActionEvent event) if (event.getSource() == bExport) { selectedTypes = listTypes.getSelectedValues(); outputDir = new File(tfDirectory.getText()); + outputDir.mkdirs(); setVisible(false); new Thread(this).start(); } From 50b69a0694e7bc97e2697bce6f63caad1fad3895 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Mon, 20 Aug 2012 23:21:37 +0200 Subject: [PATCH 28/37] Support for libacm - Streamline the code facing the external audio converter. Everything now goes through SoundUtilites, which calls AudioConverter for creating the inferior process for the external converter. - Support decoding acm files with acmtool from libacm, in addition to acm2wav. - Add the option of choosing which converter to use to the menu bar. --- src/infinity/gui/BrowserMenuBar.java | 30 ++++++ src/infinity/resource/mus/Viewer.java | 2 +- .../resource/sound/AudioConverter.java | 96 +++++++++++++++++++ .../resource/sound/SoundUtilities.java | 28 +++--- src/infinity/resource/sound/WavResource.java | 23 +---- src/infinity/util/MassExporter.java | 17 +--- src/infinity/util/StreamDiscarder.java | 42 ++++++++ 7 files changed, 190 insertions(+), 48 deletions(-) create mode 100644 src/infinity/resource/sound/AudioConverter.java create mode 100644 src/infinity/util/StreamDiscarder.java diff --git a/src/infinity/gui/BrowserMenuBar.java b/src/infinity/gui/BrowserMenuBar.java index aeffa44..3229466 100644 --- a/src/infinity/gui/BrowserMenuBar.java +++ b/src/infinity/gui/BrowserMenuBar.java @@ -41,6 +41,7 @@ public final class BrowserMenuBar extends JMenuBar new Font("SansSerif", Font.PLAIN, 12), new Font("Lucida", Font.PLAIN, 12)}; private static final String BCSINDENT[] = {" ", " ", "\t"}; + private static final String AUDIODECODERS[] = {"acm2wav.exe", "acmtool"}; private static final String OPTION_SHOWOFFSETS = "ShowOffsets"; private static final String OPTION_IGNOREOVERRIDE = "IgnoreOverride"; private static final String OPTION_IGNOREREADERRORS = "IgnoreReadErrors"; @@ -56,6 +57,7 @@ public final class BrowserMenuBar extends JMenuBar private static final String OPTION_FONT = "Font"; private static final String OPTION_BCSINDENT = "BcsIndent"; private static final String OPTION_TLKCHARSET = "TLKCharset"; + private static final String OPTION_AUDIODECODER = "AudioDecoder"; private final EditMenu editMenu; private final FileMenu fileMenu; private final GameMenu gameMenu; @@ -65,6 +67,7 @@ public final class BrowserMenuBar extends JMenuBar private final JRadioButtonMenuItem viewOrEditShown[] = new JRadioButtonMenuItem[3]; private final JRadioButtonMenuItem selectFont[] = new JRadioButtonMenuItem[FONTS.length]; private final JRadioButtonMenuItem selectBcsIndent[] = new JRadioButtonMenuItem[BCSINDENT.length]; + private final JRadioButtonMenuItem selectAudioDecoder[] = new JRadioButtonMenuItem[AUDIODECODERS.length]; private JCheckBoxMenuItem optionShowOffset, optionIgnoreOverride, optionIgnoreReadErrors, optionAutoConvMUS; private JCheckBoxMenuItem optionAutoConvWAV, optionAutocheckBCS, optionCacheOverride, optionCheckScriptNames; @@ -143,6 +146,17 @@ public String getBcsIndent() return BCSINDENT[2]; } + /** + * @since 2012-08-20 + */ + public String getAudioDecoder() + { + for (int i = 0; i < AUDIODECODERS.length; i++) + if (selectAudioDecoder[i].isSelected()) + return AUDIODECODERS[i]; + return AUDIODECODERS[0]; + } + public int getDefaultStructView() { if (viewOrEditShown[DEFAULT_VIEW].isSelected()) @@ -234,8 +248,13 @@ public void storePreferences() for (int i = 0; i < selectBcsIndent.length; i++) if (selectBcsIndent[i].isSelected()) selectedIndent = i; + int audioDecoder = 0; + for (int i = 0; i < selectAudioDecoder.length; i++) + if (selectAudioDecoder[i].isSelected()) + audioDecoder = i; prefs.putInt(OPTION_BCSINDENT, selectedIndent); prefs.put(OPTION_TLKCHARSET, StringResource.getCharset().name()); + prefs.putInt(OPTION_AUDIODECODER, audioDecoder); gameMenu.storePreferences(prefs); } @@ -407,6 +426,17 @@ public void actionPerformed(ActionEvent event) { } } }); + + final JMenu audioDecoderMenu = new JMenu("Sound Converter"); + menu.add(audioDecoderMenu); + bg = new ButtonGroup(); + int audioDecoder = prefs.getInt(OPTION_AUDIODECODER, 0); + for (int i = 0; i < AUDIODECODERS.length; i++) { + selectAudioDecoder[i] = new JRadioButtonMenuItem(AUDIODECODERS[i], i == audioDecoder); + audioDecoderMenu.add(selectAudioDecoder[i]); + bg.add(selectAudioDecoder[i]); + } + tf.addFocusListener(new FocusAdapter() { public void focusLost(FocusEvent event) { // only trigger when states differ diff --git a/src/infinity/resource/mus/Viewer.java b/src/infinity/resource/mus/Viewer.java index f047530..e0b8052 100644 --- a/src/infinity/resource/mus/Viewer.java +++ b/src/infinity/resource/mus/Viewer.java @@ -191,7 +191,7 @@ public void run() e.printStackTrace(); JOptionPane.showMessageDialog(parent, "Error converting " + entry + '\n' + e.getMessage(), "Error", JOptionPane.ERROR_MESSAGE); - if (e.getMessage().equals("acm2wav.exe not found")) + if (e.getMessage().equals("Sound converter not found")) break; } blocker.setBlocked(false); diff --git a/src/infinity/resource/sound/AudioConverter.java b/src/infinity/resource/sound/AudioConverter.java new file mode 100644 index 0000000..b5cf20d --- /dev/null +++ b/src/infinity/resource/sound/AudioConverter.java @@ -0,0 +1,96 @@ + +package infinity.resource.sound; + +import infinity.gui.BrowserMenuBar; +import infinity.resource.ResourceFactory; +import infinity.util.StreamDiscarder; + +import java.io.File; +import java.io.IOException; + +/** + * @author Fredrik Lindgren + * @since 2012-08-20 + */ +public class AudioConverter +{ + public static final String ACM2WAV = "acm2wav.exe"; + public static final String ACMTOOL = "acmtool"; + private File acm2wav; + private String decoder; + + /** + * Retrieves the selected converter from the gui and binds it to an instance variable + * + * If the converter is acm2wav, the existence of the file acm2wav.exe is tested for in the root game directory and in the + * current working directory. If the file exists it is bound to the decoder instance variable. If the converter is acmtool, + * that is bound to the decoder variable instead. + */ + public AudioConverter() + { + String d = BrowserMenuBar.getInstance().getAudioDecoder(); + if (d.equalsIgnoreCase(ACM2WAV)) { + if (acm2wav == null || !acm2wav.exists()) + acm2wav = new File(ResourceFactory.getRootDir(), ACM2WAV); + if (!acm2wav.exists()) + acm2wav = new File(ACM2WAV); + if (acm2wav.exists()) + decoder = ACM2WAV; + } + else if (d.equalsIgnoreCase(ACMTOOL)) { + decoder = ACMTOOL; + } + } + + /** + * Invokes the external audio converter + * + * @param acmfile the acm file to be converted + * @param wavfile the output file of the conversion + * @param isMono whether the converter should force mono sound + * @throws IOException if an I/O error occurs + * @return void + */ + public void convert(File acmfile, File wavfile, boolean isMono) throws IOException + { + try { + Process p; + Runtime rt = Runtime.getRuntime(); + if (decoder.equalsIgnoreCase(ACM2WAV)) { + if (isMono) + p = rt.exec("\"" + acm2wav.getAbsolutePath() + "\" \"" + acmfile.getPath() + "\" -m", null, + wavfile.getAbsoluteFile().getParentFile()); + else + p = rt.exec("\"" + acm2wav.getAbsolutePath() + "\" \"" + acmfile.getPath() + "\"", null, + wavfile.getAbsoluteFile().getParentFile()); + } + else if (decoder.equalsIgnoreCase(ACMTOOL)) { + if (isMono) + //acmtool -d -m -o outfile infile + p = rt.exec("acmtool -d -m" + " -o " + wavfile.getPath() + " " + acmfile.getPath()); + else + //atmtool -d -o outfile infile + p = rt.exec("acmtool -d" + " -o " + wavfile.getPath() + " " + acmfile.getPath()); + } + else + return; + new StreamDiscarder(p.getErrorStream()).start(); + new StreamDiscarder(p.getInputStream()).start(); + p.waitFor(); + } catch (InterruptedException e) {} + } + + /** + * Tests whether a converter is available + * + * @return true if the converter is acm2wav and the file acm2wav.exe exists; true if the converter is acmtool; otherwise false + */ + public boolean converterExists() + { + if (decoder == null) + return false; + if (decoder.equalsIgnoreCase(ACM2WAV)) + return acm2wav.exists(); + return true; + } +} diff --git a/src/infinity/resource/sound/SoundUtilities.java b/src/infinity/resource/sound/SoundUtilities.java index 6fc500d..140e77b 100644 --- a/src/infinity/resource/sound/SoundUtilities.java +++ b/src/infinity/resource/sound/SoundUtilities.java @@ -5,6 +5,7 @@ package infinity.resource.sound; import infinity.resource.ResourceFactory; +import infinity.resource.sound.AudioConverter; import infinity.util.Byteconvert; import infinity.util.Filewriter; @@ -14,7 +15,6 @@ public final class SoundUtilities { private static final AdpcmFmt fmt = new AdpcmFmt(); - private static File acm2wav; private static final byte myData[] = new byte[8196]; // old value: 32769 private static final int stepTable[] = { 7, 8, 9, 10, 11, 12, 13, 14, @@ -33,24 +33,15 @@ public final class SoundUtilities private AudioFormat audioFormat; private SourceDataLine dataLine; private boolean notstop = true, stopped = true; + private static AudioConverter converter; public static File convert(File acmfile, boolean isMono) throws IOException { - File wavfile = new File(acmfile.getName().substring(0, acmfile.getName().lastIndexOf((int)'.')) + ".WAV"); + File wavfile = new File(acmfile.getAbsoluteFile().getParent() ,acmfile.getName().substring(0, acmfile.getName().lastIndexOf((int)'.')) + ".WAV"); if (!wavfile.exists()) { - if (acm2wav == null || !acm2wav.exists()) - acm2wav = new File(ResourceFactory.getRootDir(), "acm2wav.exe"); - if (!acm2wav.exists()) - acm2wav = new File("acm2wav.exe"); - if (!acm2wav.exists()) - throw new IOException("acm2wav.exe not found"); - try { - if (isMono) - Runtime.getRuntime().exec('\"' + acm2wav.getAbsolutePath() + "\" \"" + acmfile + "\" -m").waitFor(); - else - Runtime.getRuntime().exec('\"' + acm2wav.getAbsolutePath() + "\" \"" + acmfile + '\"').waitFor(); - } catch (InterruptedException e) { - } + if (converter == null || !converter.converterExists()) + converter = new AudioConverter(); + converter.convert(acmfile, wavfile, isMono); } return wavfile; } @@ -69,6 +60,13 @@ public static File convert(byte data[], int offset, String filename, boolean isM return wavfile; } + public static boolean converterExists() + { + if (converter == null || !converter.converterExists()) + converter = new AudioConverter(); + return converter.converterExists(); + } + public static File convertADPCM(byte data[], int offset, String filename) throws IOException { File pcmwav = new File(filename); diff --git a/src/infinity/resource/sound/WavResource.java b/src/infinity/resource/sound/WavResource.java index 7fb8e51..4b88985 100644 --- a/src/infinity/resource/sound/WavResource.java +++ b/src/infinity/resource/sound/WavResource.java @@ -130,24 +130,8 @@ else if (event.getSource() == bexportConvert) { chooser.setSelectedFile(new File(entry.toString())); if (chooser.showDialog(panel, "Export") == JFileChooser.APPROVE_OPTION) { String filename = chooser.getSelectedFile().toString(); - File acmfile = new File(filename.substring(0, filename.lastIndexOf('.')) + ".ACM"); try { - BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(acmfile)); - byte data[] = entry.getResourceData(); - bos.write(data, 28, data.length - 28); - bos.close(); - File acm2wav = new File(ResourceFactory.getRootDir(), "acm2wav.exe"); - if (!acm2wav.exists()) - acm2wav = new File("acm2wav.exe"); - if (!acm2wav.exists()) - return; - if (channels == 1) - Runtime.getRuntime().exec('\"' + acm2wav.getAbsolutePath() + "\" \"" + acmfile + "\" -m", null, - chooser.getSelectedFile().getParentFile()).waitFor(); - else - Runtime.getRuntime().exec('\"' + acm2wav.getAbsolutePath() + "\" \"" + acmfile + '\"', null, - chooser.getSelectedFile().getParentFile()).waitFor(); - acmfile.delete(); + SoundUtilities.convert(entry.getResourceData(), 28, filename, channels == 1); } catch (Exception e) { JOptionPane.showMessageDialog(panel, "Error during conversion", "Error", JOptionPane.ERROR_MESSAGE); e.printStackTrace(); @@ -260,12 +244,11 @@ public JComponent makeViewer(ViewableContainer container) if (signature.equalsIgnoreCase("WAVC")) { bexportConvert = new JButton("Export & Convert...", Icons.getIcon("Export16.gif")); bexportConvert.addActionListener(this); - if (new File(ResourceFactory.getRootDir(), "acm2wav.exe").exists() || - new File("acm2wav.exe").exists()) + if (SoundUtilities.converterExists()) ; else { bexportConvert.setSelected(false); - bexportConvert.setToolTipText("acm2wav.exe not found"); + bexportConvert.setToolTipText("Sound converter not found"); } lowerpanel.add(bexportConvert); } diff --git a/src/infinity/util/MassExporter.java b/src/infinity/util/MassExporter.java index d2113f1..16558ce 100644 --- a/src/infinity/util/MassExporter.java +++ b/src/infinity/util/MassExporter.java @@ -15,6 +15,7 @@ import infinity.resource.graphics.Compressor; import infinity.resource.graphics.MveResource; import infinity.resource.key.ResourceEntry; +import infinity.resource.sound.SoundUtilities; import javax.swing.*; import javax.swing.event.*; @@ -62,13 +63,12 @@ public MassExporter() getRootPane().setDefaultButton(bExport); bExport.setMnemonic('e'); bCancel.setMnemonic('d'); - if (new File(ResourceFactory.getRootDir(), "acm2wav.exe").exists() || - new File("acm2wav.exe").exists()) + if (SoundUtilities.converterExists()) ; else { cbConvertWAV.setSelected(false); cbConvertWAV.setEnabled(false); - cbConvertWAV.setToolTipText("acm2wav.exe not found"); + cbConvertWAV.setToolTipText("Sound converter not found"); } JPanel leftPanel = new JPanel(new BorderLayout()); @@ -267,17 +267,10 @@ else if (entry.getExtension().equalsIgnoreCase("WAV") && cbConvertWAV.isSelected BufferedOutputStream bos = new BufferedOutputStream(new FileOutputStream(acmfile)); bos.write(data, 28, data.length - 28); bos.close(); - File acm2wav = new File(ResourceFactory.getRootDir(), "acm2wav.exe"); - if (!acm2wav.exists()) - acm2wav = new File("acm2wav.exe"); - if (!acm2wav.exists()) + if (!SoundUtilities.converterExists()) return; - if (channels == 1) - Runtime.getRuntime().exec('\"' + acm2wav.getAbsolutePath() + "\" \"" + acmfile + "\" -m", null, - outputDir).waitFor(); else - Runtime.getRuntime().exec('\"' + acm2wav.getAbsolutePath() + "\" \"" + acmfile + '\"', null, - outputDir).waitFor(); + SoundUtilities.convert(acmfile, channels == 1); acmfile.delete(); } else { diff --git a/src/infinity/util/StreamDiscarder.java b/src/infinity/util/StreamDiscarder.java new file mode 100644 index 0000000..a4e6c42 --- /dev/null +++ b/src/infinity/util/StreamDiscarder.java @@ -0,0 +1,42 @@ +package infinity.util; + +import java.io.InputStream; +import java.io.InputStreamReader; +import java.io.BufferedReader; +import java.io.IOException; + +/** + * @author Fredrik Lindgren + * @since 2012-08-20 + */ +public class StreamDiscarder extends Thread +{ + private InputStream in; + + /** + * Binds the argument stream to an instance variable + * + * @param in the input stream to be read from + */ + public StreamDiscarder(InputStream in) + { + this.in = in; + } + + /** + * Reads from the provided input stream + * + * @return void + */ + public void run() + { + try { + InputStreamReader r = new InputStreamReader(in); + BufferedReader b = new BufferedReader(r); + String s = null; + while ((s = b.readLine()) != null) {} + } catch (IOException e) { + e.printStackTrace(); + } + } +} From f1f52a85160ad4d222f01ff84253527d991b0828 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Tue, 21 Aug 2012 01:35:05 +0200 Subject: [PATCH 29/37] Implement Runnable instead of extending Thread --- src/infinity/resource/sound/AudioConverter.java | 4 ++-- src/infinity/util/StreamDiscarder.java | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/src/infinity/resource/sound/AudioConverter.java b/src/infinity/resource/sound/AudioConverter.java index b5cf20d..cebaefd 100644 --- a/src/infinity/resource/sound/AudioConverter.java +++ b/src/infinity/resource/sound/AudioConverter.java @@ -74,8 +74,8 @@ else if (decoder.equalsIgnoreCase(ACMTOOL)) { } else return; - new StreamDiscarder(p.getErrorStream()).start(); - new StreamDiscarder(p.getInputStream()).start(); + new Thread(new StreamDiscarder(p.getErrorStream())).start(); + new Thread(new StreamDiscarder(p.getInputStream())).start(); p.waitFor(); } catch (InterruptedException e) {} } diff --git a/src/infinity/util/StreamDiscarder.java b/src/infinity/util/StreamDiscarder.java index a4e6c42..9072d76 100644 --- a/src/infinity/util/StreamDiscarder.java +++ b/src/infinity/util/StreamDiscarder.java @@ -9,7 +9,7 @@ * @author Fredrik Lindgren * @since 2012-08-20 */ -public class StreamDiscarder extends Thread +public class StreamDiscarder implements Runnable { private InputStream in; From 116012698fce6dc15b50598ebcd7a222cc37bf20 Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Tue, 21 Aug 2012 21:24:57 +0200 Subject: [PATCH 30/37] Don't create so many threads while decoding audio --- src/infinity/resource/sound/AudioConverter.java | 11 +++++++++-- src/infinity/util/StreamDiscarder.java | 2 +- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/src/infinity/resource/sound/AudioConverter.java b/src/infinity/resource/sound/AudioConverter.java index cebaefd..e8308ef 100644 --- a/src/infinity/resource/sound/AudioConverter.java +++ b/src/infinity/resource/sound/AudioConverter.java @@ -19,6 +19,11 @@ public class AudioConverter private File acm2wav; private String decoder; + private static final StreamDiscarder outReader = new StreamDiscarder(); + private static final StreamDiscarder errReader = new StreamDiscarder(); + private static final Thread outThread = new Thread(outReader); + private static final Thread errThread = new Thread(errReader); + /** * Retrieves the selected converter from the gui and binds it to an instance variable * @@ -74,8 +79,10 @@ else if (decoder.equalsIgnoreCase(ACMTOOL)) { } else return; - new Thread(new StreamDiscarder(p.getErrorStream())).start(); - new Thread(new StreamDiscarder(p.getInputStream())).start(); + outReader.setStream(p.getInputStream()); + errReader.setStream(p.getErrorStream()); + outThread.run(); + errThread.run(); p.waitFor(); } catch (InterruptedException e) {} } diff --git a/src/infinity/util/StreamDiscarder.java b/src/infinity/util/StreamDiscarder.java index 9072d76..e69acea 100644 --- a/src/infinity/util/StreamDiscarder.java +++ b/src/infinity/util/StreamDiscarder.java @@ -18,7 +18,7 @@ public class StreamDiscarder implements Runnable * * @param in the input stream to be read from */ - public StreamDiscarder(InputStream in) + public void setStream(InputStream in) { this.in = in; } From 9135725605f0d08697440f430dc15f4851aac47a Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Thu, 23 Aug 2012 23:37:30 +0200 Subject: [PATCH 31/37] Add export option to StringUseChecker --- src/infinity/check/StringUseChecker.java | 56 +++++++++++++++++++++++- 1 file changed, 55 insertions(+), 1 deletion(-) diff --git a/src/infinity/check/StringUseChecker.java b/src/infinity/check/StringUseChecker.java index 14b1250..6e38ec3 100644 --- a/src/infinity/check/StringUseChecker.java +++ b/src/infinity/check/StringUseChecker.java @@ -21,12 +21,19 @@ import javax.swing.*; import javax.swing.event.*; import java.awt.*; +import java.awt.event.ActionListener; +import java.awt.event.ActionEvent; +import java.io.File; +import java.io.PrintWriter; +import java.io.BufferedWriter; +import java.io.FileWriter; +import java.io.IOException; import java.util.*; import java.util.List; import java.util.regex.Matcher; import java.util.regex.Pattern; -public final class StringUseChecker implements Runnable, ListSelectionListener, SearchClient +public final class StringUseChecker implements Runnable, ListSelectionListener, SearchClient, ActionListener { private static final Pattern NUMBERPATTERN = Pattern.compile("\\d+", Pattern.DOTALL); private static final String FILETYPES[] = {"2DA", "ARE", "BCS", "BS", "CHR", "CHU", "CRE", "DLG", "EFF", @@ -35,6 +42,7 @@ public final class StringUseChecker implements Runnable, ListSelectionListener, private JTextArea textArea; private SortableTable table; private boolean strUsed[]; + private JMenuItem save; public StringUseChecker() { @@ -106,6 +114,13 @@ else if (resource != null) textArea.setLineWrap(true); JScrollPane scrollText = new JScrollPane(textArea); resultFrame = new ChildFrame("Result", true); + save = new JMenuItem("Save"); + save.addActionListener(this); + JMenu fileMenu = new JMenu("File"); + fileMenu.add(save); + JMenuBar menuBar = new JMenuBar(); + menuBar.add(fileMenu); + resultFrame.setJMenuBar(menuBar); resultFrame.setIconImage(Icons.getIcon("Find16.gif").getImage()); JLabel count = new JLabel(table.getRowCount() + " unused string(s) found", JLabel.CENTER); count.setFont(count.getFont().deriveFont((float)count.getFont().getSize() + 2.0f)); @@ -132,6 +147,45 @@ else if (resource != null) // --------------------- End Interface Runnable --------------------- +// --------------------- Begin Interface ActionListener --------------------- + + public void actionPerformed(ActionEvent e) + { + if (e.getSource() == save) { + JFileChooser c = new JFileChooser(ResourceFactory.getRootDir()); + c.setDialogTitle("Save result"); + if (c.showSaveDialog(resultFrame) == JFileChooser.APPROVE_OPTION) { + File output = c.getSelectedFile(); + if (output.exists()) { + String[] options = {"Overwrite", "Cancel"}; + if (JOptionPane.showOptionDialog(resultFrame, output + "exists. Overwrite?", + "Save result",JOptionPane.YES_NO_OPTION, + JOptionPane.WARNING_MESSAGE, null, options, options[0]) == 1) + return; + } + try { + PrintWriter w = new PrintWriter(new BufferedWriter(new FileWriter(output))); + w.println("Searched for unused strings"); + w.println("Number of hits: " + table.getRowCount()); + w.println(""); + for (int i = 0; i < table.getRowCount(); i++) { + w.println("StringRef: " + table.getTableItemAt(i).getObjectAt(1) + " /* " + + table.getTableItemAt(i).toString().replaceAll("\r\n", System.getProperty("line.separator")) + + " */"); + } + w.close(); + JOptionPane.showMessageDialog(resultFrame, "Result saved to " + output, "Save complete", + JOptionPane.INFORMATION_MESSAGE); + } catch (IOException ex) { + JOptionPane.showMessageDialog(resultFrame, "Error while saving " + output, + "Error", JOptionPane.ERROR_MESSAGE); + ex.printStackTrace(); + } + } + } + } + +// --------------------- End Interface ActionListener --------------------- // --------------------- Begin Interface SearchClient --------------------- From 85d2e4730add72fbdca5e1e1f8caca5c4155feac Mon Sep 17 00:00:00 2001 From: FredrikLingren Date: Sun, 26 Aug 2012 23:21:46 +0200 Subject: [PATCH 32/37] Version 1.33, w1.1.0 --- src/infinity/gui/BrowserMenuBar.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/infinity/gui/BrowserMenuBar.java b/src/infinity/gui/BrowserMenuBar.java index 3229466..f236837 100644 --- a/src/infinity/gui/BrowserMenuBar.java +++ b/src/infinity/gui/BrowserMenuBar.java @@ -30,7 +30,7 @@ public final class BrowserMenuBar extends JMenuBar { - public static final String VERSION = "v1.33 w1.0.4"; + public static final String VERSION = "v1.33 w1.1.0"; public static final int OVERRIDE_IN_THREE = 0, OVERRIDE_IN_OVERRIDE = 1, OVERRIDE_SPLIT = 2; public static final int LOOKFEEL_JAVA = 0, LOOKFEEL_WINDOWS = 1, LOOKFEEL_MOTIF = 2, LOOKFEEL_PLASTICXP = 3; public static final int RESREF_ONLY = 0, RESREF_REF_NAME = 1, RESREF_NAME_REF = 2; From 6e865213d10318ca8a8b9589595b49069fc7d098 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Mon, 25 Oct 2010 14:35:47 +0200 Subject: [PATCH 33/37] Add text to print button --- infinity/gui/StructViewer.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/infinity/gui/StructViewer.java b/infinity/gui/StructViewer.java index d2d68e1..4ddcbf6 100644 --- a/infinity/gui/StructViewer.java +++ b/infinity/gui/StructViewer.java @@ -91,7 +91,7 @@ public final class StructViewer extends JPanel implements ListSelectionListener, private final CardLayout cards = new CardLayout(); private final JButton bview = new JButton("View/Edit", Icons.getIcon("Zoom16.gif")); private final JButton bexport = new JButton("Export...", Icons.getIcon("Export16.gif")); - private final JButton bprint = new JButton(Icons.getIcon("Print16.gif")); + private final JButton bprint = new JButton("Print", Icons.getIcon("Print16.gif")); private final JButton bremove = new JButton("Remove", Icons.getIcon("Remove16.gif")); private final JMenuItem ifindattribute = new JMenuItem("selected attribute"); private final JMenuItem ifindreferences = new JMenuItem("references to this file"); From 4fcfd686f2ae97f7c474d5cf582ad7616b84cc84 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Mon, 25 Oct 2010 14:44:13 +0200 Subject: [PATCH 34/37] Fix NPE if icon is not found --- infinity/icon/Icons.java | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/infinity/icon/Icons.java b/infinity/icon/Icons.java index eebee15..fa6e377 100644 --- a/infinity/icon/Icons.java +++ b/infinity/icon/Icons.java @@ -16,7 +16,14 @@ public static ImageIcon getIcon(String name) { ImageIcon icon = ICONMAP.get(name); if (icon == null) { - icon = new ImageIcon(Icons.class.getResource(name)); + java.net.URL resource = Icons.class.getResource(name); + if (resource == null) { + icon = new ImageIcon(); + System.err.println("Icon file not found: " + name); + } + else { + icon = new ImageIcon(resource); + } ICONMAP.put(name, icon); } return icon; From 741d52dd0dcadb8157f348eaef1179e3f9ca92da Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Mon, 25 Oct 2010 14:34:47 +0200 Subject: [PATCH 35/37] New and improved build.xml * Build out-of-source * Include revision information in source distributions and the final executable --- build.xml | 135 +++++++++++++++++++++++++++++++++++++++++++++++------- 1 file changed, 118 insertions(+), 17 deletions(-) diff --git a/build.xml b/build.xml index 3a40ac8..b25c8ad 100644 --- a/build.xml +++ b/build.xml @@ -1,25 +1,126 @@ - - - - + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + - + + - - + + + + + + + + + + + + + + + + + + + - - - - + + + + + + + From 4e1a7f3542aefbee50683917a299c08f02e38186 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Thu, 17 Sep 2015 12:46:55 +0200 Subject: [PATCH 36/37] Create README.md --- README.md | 7 +++++++ 1 file changed, 7 insertions(+) create mode 100644 README.md diff --git a/README.md b/README.md new file mode 100644 index 0000000..b8ce540 --- /dev/null +++ b/README.md @@ -0,0 +1,7 @@ +# NearInfinity + +An Infinity Engine Browser and Editor + +# Enhanced Edition Warning + +This code is ancient and will likely not work properly with the more recent Enhanced Editions! From f4ad044f11f8a51120c9e936759f9f2210b5f592 Mon Sep 17 00:00:00 2001 From: Dennis Schridde Date: Thu, 17 Sep 2015 12:44:58 +0200 Subject: [PATCH 37/37] Add variables for setting Java source/target version --- build.xml | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/build.xml b/build.xml index c238f55..57622aa 100644 --- a/build.xml +++ b/build.xml @@ -6,7 +6,8 @@ - + + @@ -66,8 +67,8 @@