You can subscribe to this list here.
2006 |
Jan
|
Feb
|
Mar
|
Apr
|
May
(103) |
Jun
(121) |
Jul
(16) |
Aug
(67) |
Sep
(126) |
Oct
(161) |
Nov
(164) |
Dec
(588) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2007 |
Jan
(394) |
Feb
(181) |
Mar
(131) |
Apr
(180) |
May
(255) |
Jun
(11) |
Jul
(79) |
Aug
(70) |
Sep
(274) |
Oct
(138) |
Nov
(195) |
Dec
(8) |
2008 |
Jan
(3) |
Feb
(142) |
Mar
(162) |
Apr
(124) |
May
(148) |
Jun
(157) |
Jul
(425) |
Aug
(373) |
Sep
(264) |
Oct
(315) |
Nov
(225) |
Dec
(6) |
2009 |
Jan
(67) |
Feb
(78) |
Mar
(279) |
Apr
(294) |
May
(92) |
Jun
(65) |
Jul
(134) |
Aug
(41) |
Sep
(138) |
Oct
(125) |
Nov
(126) |
Dec
(122) |
2010 |
Jan
(15) |
Feb
(48) |
Mar
(9) |
Apr
(195) |
May
(373) |
Jun
(507) |
Jul
(42) |
Aug
(16) |
Sep
(38) |
Oct
(81) |
Nov
(64) |
Dec
(18) |
2011 |
Jan
(13) |
Feb
(12) |
Mar
(39) |
Apr
(1) |
May
(2) |
Jun
(27) |
Jul
(27) |
Aug
(31) |
Sep
(14) |
Oct
(102) |
Nov
(20) |
Dec
(37) |
2012 |
Jan
(22) |
Feb
(1) |
Mar
(1) |
Apr
(2) |
May
(2) |
Jun
(18) |
Jul
(6) |
Aug
(1) |
Sep
(1) |
Oct
|
Nov
|
Dec
|
2013 |
Jan
(1) |
Feb
(2) |
Mar
(1) |
Apr
(1) |
May
(47) |
Jun
(7) |
Jul
(107) |
Aug
|
Sep
|
Oct
(112) |
Nov
(31) |
Dec
(17) |
2014 |
Jan
(29) |
Feb
(111) |
Mar
(34) |
Apr
|
May
(1) |
Jun
|
Jul
|
Aug
|
Sep
|
Oct
(2) |
Nov
(18) |
Dec
(10) |
From: <aki...@us...> - 2011-07-08 15:22:10
|
Revision: 8935 http://gridarta.svn.sourceforge.net/gridarta/?rev=8935&view=rev Author: akirschbaum Date: 2011-07-08 15:22:04 +0000 (Fri, 08 Jul 2011) Log Message: ----------- Do not reorder game objects when loading map files. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapReader.java trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java Added Paths: ----------- trunk/model/src/test/net/sf/gridarta/model/io/DefaultMapReaderTest.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-07-08 15:20:23 UTC (rev 8934) +++ trunk/atrinik/ChangeLog 2011-07-08 15:22:04 UTC (rev 8935) @@ -1,3 +1,8 @@ +2011-07-08 Andreas Kirschbaum + + * Do not reorder game objects when loading map files. Formerly + multi-square game objects were moved to top. + 2011-07-07 Andreas Kirschbaum * Support "draw_double" and "draw_double_always" attributes in map Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-07-08 15:20:23 UTC (rev 8934) +++ trunk/crossfire/ChangeLog 2011-07-08 15:22:04 UTC (rev 8935) @@ -1,3 +1,8 @@ +2011-07-08 Andreas Kirschbaum + + * Do not reorder game objects when loading map files. Formerly + multi-square game objects were moved to top. + 2011-06-30 Andreas Kirschbaum * Adapt to changed format of crossfire.0. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-07-08 15:20:23 UTC (rev 8934) +++ trunk/daimonin/ChangeLog 2011-07-08 15:22:04 UTC (rev 8935) @@ -1,3 +1,8 @@ +2011-07-08 Andreas Kirschbaum + + * Do not reorder game objects when loading map files. Formerly + multi-square game objects were moved to top. + 2011-07-06 Andreas Kirschbaum * Fix map renderer to paint multi-square objects at the correct Modified: trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapReader.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapReader.java 2011-07-08 15:20:23 UTC (rev 8934) +++ trunk/model/src/app/net/sf/gridarta/model/io/DefaultMapReader.java 2011-07-08 15:22:04 UTC (rev 8935) @@ -25,8 +25,6 @@ import java.io.IOException; import java.io.InputStreamReader; import java.util.ArrayList; -import java.util.Collections; -import java.util.Comparator; import java.util.List; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.gameobject.GameObject; @@ -56,21 +54,6 @@ private final A mapArchObject; /** - * A comparator to sort multi-part objects before single-part objects. - */ - private static final Comparator<GameObject<?, ?, ?>> sorter = new Comparator<GameObject<?, ?, ?>>() { - - /** {@inheritDoc} */ - @Override - public int compare(final GameObject<?, ?, ?> o1, final GameObject<?, ?, ?> o2) { - final boolean b1 = o1.isMulti(); - final boolean b2 = o2.isMulti(); - return b1 == b2 ? 0 : b2 ? -1 : 1; - } - - }; - - /** * Open a file for reading it as a map. * @param mapArchObjectParserFactory the map arch object parser factory * instance @@ -103,7 +86,6 @@ } gameObjectParser.collectTempList(mapViewSettings, objects); - Collections.sort(objects, sorter); } /** Added: trunk/model/src/test/net/sf/gridarta/model/io/DefaultMapReaderTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/io/DefaultMapReaderTest.java (rev 0) +++ trunk/model/src/test/net/sf/gridarta/model/io/DefaultMapReaderTest.java 2011-07-08 15:22:04 UTC (rev 8935) @@ -0,0 +1,84 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.io; + +import java.awt.Point; +import java.io.File; +import java.io.IOException; +import java.util.List; +import net.sf.gridarta.model.archetype.DuplicateArchetypeException; +import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.maparchobject.TestMapArchObject; +import net.sf.gridarta.model.mapcontrol.MapControl; +import net.sf.gridarta.model.mapcontrol.TestMapControlCreator; +import net.sf.gridarta.model.mapmodel.InsertionMode; +import net.sf.gridarta.model.mapmodel.MapModel; +import net.sf.gridarta.model.mapmodel.TestMapModelCreator; +import net.sf.gridarta.model.mapviewsettings.MapViewSettings; +import net.sf.gridarta.model.mapviewsettings.TestMapViewSettings; +import net.sf.gridarta.utils.Size2D; +import org.junit.Assert; +import org.junit.Test; + +/** + * Regression tests for {@link DefaultMapReader}. + * @author Andreas Kirschbaum + */ +public class DefaultMapReaderTest { + + /** + * Checks that map loading doesn't reorder multi-square game objects. + * @throws DuplicateArchetypeException if the test fails + * @throws IOException if the test fails + */ + @Test + public void testReorderMultiSquares() throws DuplicateArchetypeException, IOException { + final TestMapControlCreator mapControlCreator = new TestMapControlCreator(); + final TestMapModelCreator mapModelCreator = mapControlCreator.getMapModelCreator(); + final File mapFile = File.createTempFile("gridarta", null); + final MapControl<TestGameObject, TestMapArchObject, TestArchetype> mapControl = mapControlCreator.newMapControl(mapFile, "test", new Size2D(2, 1)); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapControl.getMapModel(); + final InsertionMode<TestGameObject, TestMapArchObject, TestArchetype> insertionMode = mapModelCreator.getTopmostInsertionMode(); + final TestArchetype arch1x1 = mapModelCreator.getArchetype("arch1x1"); + final TestArchetype arch2x1 = mapModelCreator.newArchetype("arch2x1"); + final TestArchetype arch2x1b = mapModelCreator.newArchetype("arch2x1b"); + arch2x1b.setMultiX(1); + arch2x1.addTailPart(arch2x1b); + mapModelCreator.getArchetypeSet().addArchetype(arch2x1); + mapModel.insertArchToMap(arch1x1, null, new Point(0, 0), false); + mapModel.insertArchToMap(arch1x1, null, new Point(1, 0), false); + mapModel.insertArchToMap(arch2x1, null, new Point(0, 0), false); + mapModel.insertArchToMap(arch1x1, null, new Point(0, 0), false); + mapModel.insertArchToMap(arch1x1, null, new Point(1, 0), false); + mapControl.save(); + final MapViewSettings mapViewSettings = new TestMapViewSettings(); + final DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype> reader = mapControlCreator.newMapReader(mapViewSettings, mapFile); + final List<TestGameObject> objects = reader.getGameObjects(); + Assert.assertEquals(6, objects.size()); + Assert.assertEquals("arch1x1", objects.get(0).getArchetype().getArchetypeName()); + Assert.assertEquals("arch2x1", objects.get(1).getArchetype().getArchetypeName()); + Assert.assertEquals("arch1x1", objects.get(2).getArchetype().getArchetypeName()); + Assert.assertEquals("arch1x1", objects.get(3).getArchetype().getArchetypeName()); + Assert.assertEquals("arch1x1", objects.get(4).getArchetype().getArchetypeName()); + Assert.assertEquals("arch2x1b", objects.get(5).getArchetype().getArchetypeName()); + } + +} Property changes on: trunk/model/src/test/net/sf/gridarta/model/io/DefaultMapReaderTest.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java 2011-07-08 15:20:23 UTC (rev 8934) +++ trunk/model/src/test/net/sf/gridarta/model/mapcontrol/TestMapControlCreator.java 2011-07-08 15:22:04 UTC (rev 8935) @@ -20,6 +20,7 @@ package net.sf.gridarta.model.mapcontrol; import java.io.File; +import java.io.IOException; import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.archetype.DuplicateArchetypeException; import net.sf.gridarta.model.archetype.TestArchetype; @@ -27,6 +28,7 @@ import net.sf.gridarta.model.autojoin.AutojoinListsHelper; import net.sf.gridarta.model.exitconnector.ExitMatcher; import net.sf.gridarta.model.gameobject.TestGameObject; +import net.sf.gridarta.model.io.DefaultMapReader; import net.sf.gridarta.model.io.DefaultMapWriter; import net.sf.gridarta.model.io.GameObjectParser; import net.sf.gridarta.model.io.MapArchObjectParserFactory; @@ -47,6 +49,7 @@ import net.sf.gridarta.model.mapmodel.MapModelFactory; import net.sf.gridarta.model.mapmodel.TestMapModelCreator; import net.sf.gridarta.model.mapmodel.TestMapModelHelper; +import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.model.match.TypeNrsGameObjectMatcher; import net.sf.gridarta.model.settings.GlobalSettings; @@ -86,6 +89,18 @@ private final ExitMatcher<TestGameObject, TestMapArchObject, TestArchetype> exitMatcher; /** + * The {@link MapArchObjectParserFactory} instance. + */ + @NotNull + private final MapArchObjectParserFactory<TestMapArchObject> mapArchObjectParserFactory; + + /** + * The {@link GameObjectParser} instance. + */ + @NotNull + private final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser; + + /** * The {@link MapReaderFactory} instance. */ @NotNull @@ -139,8 +154,8 @@ public TestMapControlCreator() { final GameObjectMatcher exitGameObjectMatcher = new TypeNrsGameObjectMatcher(TestMapModelHelper.EXIT_TYPE); exitMatcher = new ExitMatcher<TestGameObject, TestMapArchObject, TestArchetype>(exitGameObjectMatcher); - final MapArchObjectParserFactory<TestMapArchObject> mapArchObjectParserFactory = new TestMapArchObjectParserFactory(); - final GameObjectParser<TestGameObject, TestMapArchObject, TestArchetype> gameObjectParser = mapModelCreator.newGameObjectParser(); + mapArchObjectParserFactory = new TestMapArchObjectParserFactory(); + gameObjectParser = mapModelCreator.newGameObjectParser(); mapReaderFactory = new TestMapReaderFactory(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, mapModelCreator.getMapViewSettings()); globalSettings = new TestGlobalSettings(); mapWriter = new DefaultMapWriter<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, gameObjectParser); @@ -305,4 +320,17 @@ return mapWriter; } + /** + * Creates a new instance. + * @param mapViewSettings the map view settings to pass to the map reader + * constructor + * @param mapFile the file to pass to the map reader constructor + * @return the map reader instance + * @throws IOException if the map reader cannot be created + */ + @NotNull + public DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype> newMapReader(@NotNull final MapViewSettings mapViewSettings, @NotNull final File mapFile) throws IOException { + return new DefaultMapReader<TestGameObject, TestMapArchObject, TestArchetype>(mapArchObjectParserFactory, mapArchObjectFactory, gameObjectParser, mapViewSettings, mapFile); + } + } // class TestMapControlCreator This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-08 15:20:29
|
Revision: 8934 http://gridarta.svn.sourceforge.net/gridarta/?rev=8934&view=rev Author: akirschbaum Date: 2011-07-08 15:20:23 +0000 (Fri, 08 Jul 2011) Log Message: ----------- Add TestMapModelCreator.newArchetype(). Modified Paths: -------------- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2011-07-08 15:19:29 UTC (rev 8933) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2011-07-08 15:20:23 UTC (rev 8934) @@ -232,7 +232,7 @@ // ignore } - final TestArchetype archetype = new TestArchetype(archetypeName, faceObjectProviders, animationObjects); + final TestArchetype archetype = newArchetype(archetypeName); try { archetypeSet.addArchetype(archetype); } catch (final DuplicateArchetypeException ex) { @@ -243,6 +243,17 @@ } /** + * Creates a new {@link TestArchetype} instance but doesn't add it to the + * archetype set. + * @param archetypeName the archetype´s name + * @return the new instance + */ + @NotNull + public TestArchetype newArchetype(@NotNull final String archetypeName) { + return new TestArchetype(archetypeName, faceObjectProviders, animationObjects); + } + + /** * Returns the {@link GameObjectFactory} instance. * @return the game object factory instance */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-08 15:19:35
|
Revision: 8933 http://gridarta.svn.sourceforge.net/gridarta/?rev=8933&view=rev Author: akirschbaum Date: 2011-07-08 15:19:29 +0000 (Fri, 08 Jul 2011) Log Message: ----------- Make TestMapModelCreator more flexible: add archetypeName parameters when creating game objects. Modified Paths: -------------- trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java 2011-07-07 20:31:04 UTC (rev 8932) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/DefaultMapModelTest.java 2011-07-08 15:19:29 UTC (rev 8933) @@ -201,12 +201,12 @@ mapModel.beginTransaction("TEST"); mapModel.getMapArchObject().setMapSize(new Size2D(4, 3)); - mapModelCreator.addGameObjectToMap(mapModel, "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModelCreator.addGameObjectToMap(mapModel, "arch", "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); mapModel.endTransaction(); result.setLength(0); mapModel.beginTransaction("TEST"); - mapModelCreator.addGameObjectToMap(mapModel, "1", 2, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModelCreator.addGameObjectToMap(mapModel, "arch", "1", 2, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); mapModel.getMapArchObject().setMapSize(new Size2D(1, 2)); // cancels square changed event mapModel.endTransaction(); final StringBuilder expectedResult = new StringBuilder(); @@ -226,7 +226,7 @@ mapModel.beginTransaction("TEST"); mapModel.getMapArchObject().setMapSize(new Size2D(4, 3)); - mapModelCreator.addGameObjectToMap(mapModel, "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModelCreator.addGameObjectToMap(mapModel, "arch", "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); mapModel.endTransaction(); result.setLength(0); @@ -234,7 +234,7 @@ for (final BaseObject<TestGameObject, TestMapArchObject, TestArchetype, ?> gameObject : mapModel.getMapSquare(new Point(1, 2))) { gameObject.setAttributeString("key", "value"); } - mapModelCreator.addGameObjectToMap(mapModel, "1", 2, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModelCreator.addGameObjectToMap(mapModel, "arch", "1", 2, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); mapModel.getMapArchObject().setMapSize(new Size2D(1, 2)); // cancels square changed event mapModel.endTransaction(); final StringBuilder expectedResult = new StringBuilder(); @@ -259,7 +259,7 @@ result.setLength(0); mapModel.beginTransaction("TEST"); - mapModelCreator.addGameObjectToMap(mapModel, "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModelCreator.addGameObjectToMap(mapModel, "arch", "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); mapModel.endTransaction(); final StringBuilder expectedResult = new StringBuilder(); expectedResult.append("mapObjectsChanged:\n"); @@ -286,9 +286,9 @@ result.setLength(0); mapModel.beginTransaction("TEST"); - mapModelCreator.addGameObjectToMap(mapModel, "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); - mapModelCreator.addGameObjectToMap(mapModel, "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); - mapModelCreator.addGameObjectToMap(mapModel, "1", 2, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModelCreator.addGameObjectToMap(mapModel, "arch", "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModelCreator.addGameObjectToMap(mapModel, "arch", "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModelCreator.addGameObjectToMap(mapModel, "arch", "1", 2, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); mapModel.endTransaction(); final StringBuilder expectedResult = new StringBuilder(); expectedResult.append("mapObjectsChanged:\n"); @@ -312,13 +312,13 @@ mapModel.beginTransaction("TEST"); mapModel.getMapArchObject().setMapSize(new Size2D(4, 3)); - mapModelCreator.addGameObjectToMap(mapModel, "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModelCreator.addGameObjectToMap(mapModel, "arch", "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); mapModel.endTransaction(); result.setLength(0); mapModel.beginTransaction("TEST"); for (final GameObject<TestGameObject, TestMapArchObject, TestArchetype> gameObject : mapModel.getMapSquare(new Point(1, 2))) { - mapModelCreator.insertGameObject(gameObject, "2"); + mapModelCreator.insertGameObject(gameObject, "arch", "2"); } mapModel.endTransaction(); final StringBuilder expectedResult = new StringBuilder(); @@ -339,7 +339,7 @@ mapModel.beginTransaction("TEST"); mapModel.getMapArchObject().setMapSize(new Size2D(4, 3)); - mapModelCreator.addGameObjectToMap(mapModel, "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); + mapModelCreator.addGameObjectToMap(mapModel, "arch", "1", 1, 2, mapModelCreator.getInsertionModeSet().getAutoInsertionMode()); mapModel.endTransaction(); result.setLength(0); Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2011-07-07 20:31:04 UTC (rev 8932) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelCreator.java 2011-07-08 15:19:29 UTC (rev 8933) @@ -164,11 +164,13 @@ /** * Creates a new game object. + * @param archetypeName the name of the game object´s archetype * @param objectName the object name to set * @return the game object */ - private TestGameObject newGameObject(@NotNull final String objectName) { - final TestArchetype archetype = getArchetype("arch"); + @NotNull + private TestGameObject newGameObject(@NotNull final String archetypeName, @NotNull final String objectName) { + final TestArchetype archetype = getArchetype(archetypeName); final TestGameObject gameObject = new TestGameObject(archetype, faceObjectProviders, animationObjects); gameObject.setAttributeString(BaseObject.NAME, objectName); return gameObject; @@ -177,23 +179,25 @@ /** * Inserts a game object into a map. * @param mapModel the map to add to + * @param archetypeName the name of the game object´s archetype * @param name the name of the game object to add * @param x the x coordinate to add to * @param y the y coordinate to add to * @param insertionMode the insertion mode to use */ - public void addGameObjectToMap(@NotNull final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel, @NotNull final String name, final int x, final int y, @NotNull final InsertionMode<TestGameObject, TestMapArchObject, TestArchetype> insertionMode) { - final TestGameObject gameObject = newGameObject(name); + public void addGameObjectToMap(@NotNull final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel, @NotNull final String archetypeName, @NotNull final String name, final int x, final int y, @NotNull final InsertionMode<TestGameObject, TestMapArchObject, TestArchetype> insertionMode) { + final TestGameObject gameObject = newGameObject(archetypeName, name); mapModel.addGameObjectToMap(gameObject, new Point(x, y), insertionMode); } /** * Inserts a game object into the inventory of another game object. * @param gameObject the game object to add to + * @param archetypeName the name of the game object´s archetype * @param name the name of the game object to add */ - public void insertGameObject(@NotNull final GameObject<TestGameObject, TestMapArchObject, TestArchetype> gameObject, @NotNull final String name) { - final TestGameObject inv = newGameObject(name); + public void insertGameObject(@NotNull final GameObject<TestGameObject, TestMapArchObject, TestArchetype> gameObject, @NotNull final String archetypeName, @NotNull final String name) { + final TestGameObject inv = newGameObject(archetypeName, name); gameObject.addLast(inv); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-07 20:31:10
|
Revision: 8932 http://gridarta.svn.sourceforge.net/gridarta/?rev=8932&view=rev Author: akirschbaum Date: 2011-07-07 20:31:04 +0000 (Thu, 07 Jul 2011) Log Message: ----------- Fix map renderer issues introduced in r8927. [Atrinik, Daimonin] Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-07 20:08:02 UTC (rev 8931) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-07 20:31:04 UTC (rev 8932) @@ -543,7 +543,12 @@ icon.paintIcon(this, g, x + xOffset, y); } } else { - final int x = xStart + isoMapSquareInfo.getXLen2() - icon.getIconWidth() / 2; + final int x; + if (icon.getIconWidth() > isoMapSquareInfo.getXLen()) { + x = xStart + isoMapSquareInfo.getXLen2() - icon.getIconWidth() / 2; + } else { + x = xStart; + } final int y = yStart + isoMapSquareInfo.getYLen() - icon.getIconHeight(); icon.paintIcon(this, g, x + xOffset, y); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-07 20:08:08
|
Revision: 8931 http://gridarta.svn.sourceforge.net/gridarta/?rev=8931&view=rev Author: akirschbaum Date: 2011-07-07 20:08:02 +0000 (Thu, 07 Jul 2011) Log Message: ----------- Support arbitrary sized multi-part game objects. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionEntry.java Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionEntry.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionEntry.java 2011-07-07 20:03:03 UTC (rev 8930) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionEntry.java 2011-07-07 20:08:02 UTC (rev 8931) @@ -47,7 +47,7 @@ * Array with position data. */ @NotNull - private final int[] data = new int[X_DIM]; + private final int[] data; /** * The vertical size of a square. @@ -61,9 +61,9 @@ */ public MultiPositionEntry(@NotNull final IsoMapSquareInfo isoMapSquareInfo, @NotNull final Dimension size) { final int sum = size.width + size.height; - // Set size or rectangle width = sum * isoMapSquareInfo.getXLen2(); height = sum * isoMapSquareInfo.getYLen2(); + data = new int[width * height]; int index = 0; for (int y = 0; y < size.height; y++) { for (int x = 0; x < size.width; x++) { @@ -71,10 +71,6 @@ data[index++] = (x + y) * isoMapSquareInfo.getYLen2(); } } - // Fill rest of row with 0 - while (index < X_DIM) { - data[index++] = 0; - } yLen = isoMapSquareInfo.getYLen(); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-07 20:03:09
|
Revision: 8930 http://gridarta.svn.sourceforge.net/gridarta/?rev=8930&view=rev Author: akirschbaum Date: 2011-07-07 20:03:03 +0000 (Thu, 07 Jul 2011) Log Message: ----------- Extract MultiPositionEntry from MultiPositionData. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionEntry.java Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java 2011-07-07 18:23:27 UTC (rev 8929) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java 2011-07-07 20:03:03 UTC (rev 8930) @@ -20,7 +20,6 @@ package net.sf.gridarta.model.gameobject; import java.awt.Dimension; -import java.awt.Point; import java.io.BufferedReader; import java.io.IOException; import java.io.InputStream; @@ -51,11 +50,6 @@ private static final Category log = Logger.getLogger(MultiPositionData.class); /** - * Number of columns in the array. - */ - private static final int X_DIM = 34; - - /** * Number of rows in the array. */ public static final int Y_DIM = 16; @@ -70,7 +64,7 @@ * Array with position data. */ @NotNull - private final int[][] data = new int[Y_DIM][X_DIM]; + private final MultiPositionEntry[] data = new MultiPositionEntry[Y_DIM]; /** * Creates a new instance. @@ -98,7 +92,6 @@ try { final LineNumberReader lnr = new LineNumberReader(bufferedReader); try { - final Point p = new Point(); int yp = 0; // y-index in the data array // read the whole file line by line @@ -139,27 +132,7 @@ hasErrors = true; continue; } - final int sum = d.width + d.height; - // Set size or rectangle - if (sum == 0) { - data[yp][0] = 0; - data[yp][1] = 0; - } else { - data[yp][0] = sum * isoMapSquareInfo.getXLen2(); - data[yp][1] = sum * isoMapSquareInfo.getYLen2() - 1; - } - int index = 2; - for (p.y = 0; p.y < d.height; p.y++) { - for (p.x = 0; p.x < d.width; p.x++) { - data[yp][index++] = (p.x + d.height - p.y - 1) * isoMapSquareInfo.getXLen2(); - data[yp][index++] = (p.x + p.y) * isoMapSquareInfo.getYLen2(); - } - } - // Fill rest of row with 0 - while (index < X_DIM) { - data[yp][index++] = 0; - } - yp++; + data[yp++] = new MultiPositionEntry(isoMapSquareInfo, d); } // report if there haven't been enough rows in the file @@ -198,7 +171,8 @@ * @return x-offset */ public int getXOffset(final int shapeID, final int positionID) { - return data[shapeID][2 + positionID * 2]; + final MultiPositionEntry entry = data[shapeID]; + return entry == null ? 0 : entry.getXOffset(positionID); } /** @@ -211,7 +185,8 @@ * @return y-offset */ public int getYOffset(final int shapeID, final int positionID) { - return data[shapeID][1] - isoMapSquareInfo.getYLen() - data[shapeID][3 + positionID * 2]; + final MultiPositionEntry entry = data[shapeID]; + return entry == null ? 0 : entry.getYOffset(positionID); } /** @@ -220,7 +195,8 @@ * @return the width in pixels */ public int getWidth(final int shapeID) { - return data[shapeID][0]; + final MultiPositionEntry entry = data[shapeID]; + return entry == null ? 0 : entry.getWidth(); } /** @@ -229,7 +205,8 @@ * @return the height in pixels */ public int getHeight(final int shapeID) { - return data[shapeID][1]; + final MultiPositionEntry entry = data[shapeID]; + return entry == null ? 0 : entry.getHeight(); } } // class MultiPositionData Added: trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionEntry.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionEntry.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionEntry.java 2011-07-07 20:03:03 UTC (rev 8930) @@ -0,0 +1,119 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.gameobject; + +import java.awt.Dimension; +import org.jetbrains.annotations.NotNull; + +/** + * Encapsulated information about a multi-square image. + * @author Andreas Kirschbaum + */ +public class MultiPositionEntry { + + /** + * Number of columns in the array. + */ + private static final int X_DIM = 32; + + /** + * The total width of the multi-square image in pixels. + */ + private final int width; + + /** + * The total height of the multi-square image in pixels. + */ + private final int height; + + /** + * Array with position data. + */ + @NotNull + private final int[] data = new int[X_DIM]; + + /** + * The vertical size of a square. + */ + private final int yLen; + + /** + * Creates a new instance. + * @param isoMapSquareInfo the iso information to use + * @param size the size of the entry in map squares + */ + public MultiPositionEntry(@NotNull final IsoMapSquareInfo isoMapSquareInfo, @NotNull final Dimension size) { + final int sum = size.width + size.height; + // Set size or rectangle + width = sum * isoMapSquareInfo.getXLen2(); + height = sum * isoMapSquareInfo.getYLen2(); + int index = 0; + for (int y = 0; y < size.height; y++) { + for (int x = 0; x < size.width; x++) { + data[index++] = (x + size.height - y - 1) * isoMapSquareInfo.getXLen2(); + data[index++] = (x + y) * isoMapSquareInfo.getYLen2(); + } + } + // Fill rest of row with 0 + while (index < X_DIM) { + data[index++] = 0; + } + yLen = isoMapSquareInfo.getYLen(); + } + + /** + * Returns the x offset from the left-most pixel of the multi-square image + * and the default x position. (The default position is where a + * single-square image would be put.) + * @param positionID the square number in the multi-square + * @return the x offset + */ + public int getXOffset(final int positionID) { + return data[positionID * 2]; + } + + /** + * Returns the y offset from the left-most pixel of the multi-square image + * and the default y position. (The default position is where a + * single-square image would be put.) + * @param positionID the square number in the multi-square + * @return the y offset + */ + public int getYOffset(final int positionID) { + return height - yLen - data[1 + positionID * 2]; + } + + /** + * Returns the total width of a multi-square image. + * @return the width in pixels + */ + public int getWidth() { + return width; + } + + /** + * Returns the total height of a multi-square image. + * @return the height in pixels + */ + public int getHeight() { + return height; + } + +} Property changes on: trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionEntry.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-07 18:23:34
|
Revision: 8929 http://gridarta.svn.sourceforge.net/gridarta/?rev=8929&view=rev Author: akirschbaum Date: 2011-07-07 18:23:27 +0000 (Thu, 07 Jul 2011) Log Message: ----------- Support "draw_double" and "draw_double_always" attributes in map renderer. [Atrinik] Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-07-07 17:36:34 UTC (rev 8928) +++ trunk/atrinik/ChangeLog 2011-07-07 18:23:27 UTC (rev 8929) @@ -1,5 +1,8 @@ 2011-07-07 Andreas Kirschbaum + * Support "draw_double" and "draw_double_always" attributes in map + renderer. + * Implement part of #3332081 (Atrinik Rendering). The renderer now supports the "align" and "z" attributes. Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2011-07-07 17:36:34 UTC (rev 8928) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2011-07-07 18:23:27 UTC (rev 8929) @@ -19,11 +19,13 @@ package net.sf.gridarta.var.atrinik.model.gameobject; +import javax.swing.ImageIcon; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.DefaultIsoGameObject; +import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.var.atrinik.model.archetype.Archetype; import net.sf.gridarta.var.atrinik.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -139,4 +141,26 @@ return false; } + /** + * {@inheritDoc} + */ + @NotNull + @Override + public ImageIcon getImage(@NotNull final MapViewSettings mapViewSettings) { + final boolean drawDouble = getAttributeInt("draw_double_always") != 0 || (mapViewSettings.isDoubleFaces() && getAttributeInt("draw_double") != 0); + if (mapViewSettings.isAlphaType(getEditType())) { + if (drawDouble) { + return getTransparentDoubleImage(); + } else { + return getTransparentImage(); + } + } else { + if (drawDouble) { + return getDoubleImage(); + } else { + return getNormalImage(); + } + } + } + } // class GameObject Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2011-07-07 17:36:34 UTC (rev 8928) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/model/gameobject/GameObject.java 2011-07-07 18:23:27 UTC (rev 8929) @@ -19,11 +19,13 @@ package net.sf.gridarta.var.daimonin.model.gameobject; +import javax.swing.ImageIcon; import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.archetypetype.ArchetypeTypeSet; import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.gameobject.DefaultIsoGameObject; +import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import net.sf.gridarta.var.daimonin.model.archetype.Archetype; import net.sf.gridarta.var.daimonin.model.maparchobject.MapArchObject; import org.jetbrains.annotations.NotNull; @@ -128,4 +130,25 @@ return false; } + /** + * {@inheritDoc} + */ + @NotNull + @Override + public ImageIcon getImage(@NotNull final MapViewSettings mapViewSettings) { + if (mapViewSettings.isAlphaType(getEditType())) { + if (mapViewSettings.isDoubleFaces()) { + return getTransparentDoubleImage(); + } else { + return getTransparentImage(); + } + } else { + if (mapViewSettings.isDoubleFaces()) { + return getDoubleImage(); + } else { + return getNormalImage(); + } + } + } + } // class GameObject Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2011-07-07 17:36:34 UTC (rev 8928) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/DefaultIsoGameObject.java 2011-07-07 18:23:27 UTC (rev 8929) @@ -24,7 +24,6 @@ import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.face.FaceObjectProviders; import net.sf.gridarta.model.maparchobject.MapArchObject; -import net.sf.gridarta.model.mapviewsettings.MapViewSettings; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -102,7 +101,7 @@ * @return the transparent face for this game object */ @NotNull - private ImageIcon getTransparentImage() { + protected ImageIcon getTransparentImage() { if (transFace == null) { transFace = faceObjectProviders.getTrans(this); } @@ -114,7 +113,7 @@ * @return the double face for this game object */ @NotNull - private ImageIcon getDoubleImage() { + protected ImageIcon getDoubleImage() { if (doubleFace == null) { doubleFace = faceObjectProviders.getDouble(this); } @@ -126,7 +125,7 @@ * @return the transparent face for this game object */ @NotNull - private ImageIcon getTransparentDoubleImage() { + protected ImageIcon getTransparentDoubleImage() { if (transDoubleFace == null) { transDoubleFace = faceObjectProviders.getTransDouble(this); } @@ -158,28 +157,7 @@ /** * {@inheritDoc} */ - @NotNull @Override - public ImageIcon getImage(@NotNull final MapViewSettings mapViewSettings) { - if (mapViewSettings.isAlphaType(getEditType())) { - if (mapViewSettings.isDoubleFaces()) { - return getTransparentDoubleImage(); - } else { - return getTransparentImage(); - } - } else { - if (mapViewSettings.isDoubleFaces()) { - return getDoubleImage(); - } else { - return getNormalImage(); - } - } - } - - /** - * {@inheritDoc} - */ - @Override public void facesReloaded() { transFace = null; doubleFace = null; This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-07 17:36:41
|
Revision: 8928 http://gridarta.svn.sourceforge.net/gridarta/?rev=8928&view=rev Author: akirschbaum Date: 2011-07-07 17:36:34 +0000 (Thu, 07 Jul 2011) Log Message: ----------- Implement part of #3332081 (Atrinik Rendering). The renderer now supports the "align" and "z" attributes. [Atrinik] Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-07-06 20:40:37 UTC (rev 8927) +++ trunk/atrinik/ChangeLog 2011-07-07 17:36:34 UTC (rev 8928) @@ -1,3 +1,8 @@ +2011-07-07 Andreas Kirschbaum + + * Implement part of #3332081 (Atrinik Rendering). The renderer now + supports the "align" and "z" attributes. + 2011-07-06 Andreas Kirschbaum * Fix map renderer to paint multi-square objects at the correct Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 20:40:37 UTC (rev 8927) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-07 17:36:34 UTC (rev 8928) @@ -532,6 +532,7 @@ private void paintGameObject(@NotNull final Graphics2D g, final int xStart, final int yStart, @NotNull final G gameObject, final boolean inSpawnPoint) { final G head = gameObject.getHead(); final Icon icon = "trans.101".equals(head.getFaceObjName()) ? unknownSquareIcon : head.getImage(mapViewSettings); + final int xOffset = head.getAttributeInt("align"); if (head.getMultiRefCount() > 0) { final R archetype = gameObject.getArchetype(); if (inSpawnPoint || archetype.isLowestPart()) { @@ -539,12 +540,12 @@ final int multiPartNr = archetype.getMultiPartNr(); final int x = xStart - multiPositionData.getXOffset(headMultiShapeID, multiPartNr) + multiPositionData.getWidth(headMultiShapeID) / 2 - icon.getIconWidth() / 2; final int y = yStart - multiPositionData.getYOffset(headMultiShapeID, multiPartNr) + isoMapSquareInfo.getYLen() - icon.getIconHeight(); - icon.paintIcon(this, g, x, y); + icon.paintIcon(this, g, x + xOffset, y); } } else { final int x = xStart + isoMapSquareInfo.getXLen2() - icon.getIconWidth() / 2; final int y = yStart + isoMapSquareInfo.getYLen() - icon.getIconHeight(); - icon.paintIcon(this, g, x, y); + icon.paintIcon(this, g, x + xOffset, y); } // Paint first object (most likely a mob) in spawn points. Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2011-07-06 20:40:37 UTC (rev 8927) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2011-07-07 17:36:34 UTC (rev 8928) @@ -165,10 +165,19 @@ if (square.isEmpty()) { emptySquareIcon.paintIcon(this, g, x, y); } else { + boolean foundFloor = false; for (final G node : square) { filterControl.objectInSquare(filterState, node); if (filterControl.canShow(node)) { - paintGameObjectIfVisible(g, x, y, node); + final G head = node.getHead(); + final int yOffset; + if (!foundFloor && head.getAttributeInt("layer") == 1) { + foundFloor = true; + yOffset = 0; + } else { + yOffset = head.getAttributeInt("z"); + } + paintGameObjectIfVisible(g, x, y - yOffset, node); } } } Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java 2011-07-06 20:40:37 UTC (rev 8927) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoPickmapRenderer.java 2011-07-07 17:36:34 UTC (rev 8928) @@ -79,8 +79,17 @@ */ @Override protected void paintSquare(@NotNull final Graphics2D g, final int x, final int y, @NotNull final MapSquare<G, A, R> square) { + boolean foundFloor = false; for (final G node : square) { - paintGameObjectIfVisible(g, x, y, node); + final G head = node.getHead(); + final int yOffset; + if (!foundFloor && head.getAttributeInt("layer") == 1) { + foundFloor = true; + yOffset = 0; + } else { + yOffset = head.getAttributeInt("z"); + } + paintGameObjectIfVisible(g, x, y - yOffset, node); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-06 20:40:44
|
Revision: 8927 http://gridarta.svn.sourceforge.net/gridarta/?rev=8927&view=rev Author: akirschbaum Date: 2011-07-06 20:40:37 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Fix map renderer to paint multi-square objects at the correct location, [Atrinik, Daimonin] Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-07-06 19:39:53 UTC (rev 8926) +++ trunk/atrinik/ChangeLog 2011-07-06 20:40:37 UTC (rev 8927) @@ -1,3 +1,8 @@ +2011-07-06 Andreas Kirschbaum + + * Fix map renderer to paint multi-square objects at the correct + location. + 2011-07-05 Alex Tokar * Discard existing z attribute if a newly inserted game object has Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-07-06 19:39:53 UTC (rev 8926) +++ trunk/daimonin/ChangeLog 2011-07-06 20:40:37 UTC (rev 8927) @@ -1,3 +1,8 @@ +2011-07-06 Andreas Kirschbaum + + * Fix map renderer to paint multi-square objects at the correct + location. + 2011-06-28 Andreas Kirschbaum * Implement map, inv, and allows_all_inv attributes for <type> in Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java 2011-07-06 19:39:53 UTC (rev 8926) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/MultiPositionData.java 2011-07-06 20:40:37 UTC (rev 8927) @@ -214,4 +214,22 @@ return data[shapeID][1] - isoMapSquareInfo.getYLen() - data[shapeID][3 + positionID * 2]; } + /** + * Returns the total width for a multi-square image. + * @param shapeID the shape ID + * @return the width in pixels + */ + public int getWidth(final int shapeID) { + return data[shapeID][0]; + } + + /** + * Returns the total height for a multi-square image. + * @param shapeID the shape ID + * @return the height in pixels + */ + public int getHeight(final int shapeID) { + return data[shapeID][1]; + } + } // class MultiPositionData Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 19:39:53 UTC (rev 8926) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 20:40:37 UTC (rev 8927) @@ -532,29 +532,19 @@ private void paintGameObject(@NotNull final Graphics2D g, final int xStart, final int yStart, @NotNull final G gameObject, final boolean inSpawnPoint) { final G head = gameObject.getHead(); final Icon icon = "trans.101".equals(head.getFaceObjName()) ? unknownSquareIcon : head.getImage(mapViewSettings); - final int yOffset = icon.getIconHeight() - isoMapSquareInfo.getYLen(); if (head.getMultiRefCount() > 0) { - // multi-part images have to be painted with correct offset - // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. final R archetype = gameObject.getArchetype(); - final R headArchetype = head.getArchetype(); - final int headMultiShapeID = headArchetype.getMultiShapeID(); - final int multiPartNr = archetype.getMultiPartNr(); - final int x = xStart - multiPositionData.getXOffset(headMultiShapeID, multiPartNr); - final int y = yStart - yOffset + multiPositionData.getYOffset(headMultiShapeID, multiPartNr); - if (archetype.isLowestPart()) { + if (inSpawnPoint || archetype.isLowestPart()) { + final int headMultiShapeID = head.getArchetype().getMultiShapeID(); + final int multiPartNr = archetype.getMultiPartNr(); + final int x = xStart - multiPositionData.getXOffset(headMultiShapeID, multiPartNr) + multiPositionData.getWidth(headMultiShapeID) / 2 - icon.getIconWidth() / 2; + final int y = yStart - multiPositionData.getYOffset(headMultiShapeID, multiPartNr) + isoMapSquareInfo.getYLen() - icon.getIconHeight(); icon.paintIcon(this, g, x, y); - } else if (inSpawnPoint) { - icon.paintIcon(this, g, x, y); } } else { - final int xOffset; - if (icon.getIconWidth() > isoMapSquareInfo.getXLen()) { - xOffset = (icon.getIconWidth() - isoMapSquareInfo.getXLen()) / 2; - } else { - xOffset = 0; - } - icon.paintIcon(this, g, xStart - xOffset, yStart - yOffset); + final int x = xStart + isoMapSquareInfo.getXLen2() - icon.getIconWidth() / 2; + final int y = yStart + isoMapSquareInfo.getYLen() - icon.getIconHeight(); + icon.paintIcon(this, g, x, y); } // Paint first object (most likely a mob) in spawn points. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-06 19:39:59
|
Revision: 8926 http://gridarta.svn.sourceforge.net/gridarta/?rev=8926&view=rev Author: akirschbaum Date: 2011-07-06 19:39:53 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Simplify code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 19:33:56 UTC (rev 8925) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 19:39:53 UTC (rev 8926) @@ -516,7 +516,7 @@ protected void paintGameObjectIfVisible(@NotNull final Graphics2D g, final int xStart, final int yStart, @NotNull final G gameObject) { final G head = gameObject.getHead(); if (isGameObjectVisible(head)) { - paintGameObject(g, xStart, yStart, gameObject); + paintGameObject(g, xStart, yStart, gameObject, false); } } @@ -526,8 +526,10 @@ * @param xStart the x offset for painting * @param yStart the y offset for painting * @param gameObject the game object to paint + * @param inSpawnPoint whether <code>gameObject</code> is within a spawn + * point */ - private void paintGameObject(@NotNull final Graphics2D g, final int xStart, final int yStart, @NotNull final G gameObject) { + private void paintGameObject(@NotNull final Graphics2D g, final int xStart, final int yStart, @NotNull final G gameObject, final boolean inSpawnPoint) { final G head = gameObject.getHead(); final Icon icon = "trans.101".equals(head.getFaceObjName()) ? unknownSquareIcon : head.getImage(mapViewSettings); final int yOffset = icon.getIconHeight() - isoMapSquareInfo.getYLen(); @@ -542,11 +544,8 @@ final int y = yStart - yOffset + multiPositionData.getYOffset(headMultiShapeID, multiPartNr); if (archetype.isLowestPart()) { icon.paintIcon(this, g, x, y); - } else { - final BaseObject<G, A, R, ?> env = head.getContainerGameObject(); - if (env != null && isSpawnPoint(env)) { - icon.paintIcon(this, g, x, y); - } + } else if (inSpawnPoint) { + icon.paintIcon(this, g, x, y); } } else { final int xOffset; @@ -559,10 +558,10 @@ } // Paint first object (most likely a mob) in spawn points. - if (isSpawnPoint(head)) { + if (!inSpawnPoint && isSpawnPoint(head)) { final G mob = head.getFirst(); if (mob != null) { - paintGameObject(g, xStart, yStart, mob); + paintGameObject(g, xStart, yStart, mob, true); } } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-06 19:34:02
|
Revision: 8925 http://gridarta.svn.sourceforge.net/gridarta/?rev=8925&view=rev Author: akirschbaum Date: 2011-07-06 19:33:56 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Remove redundant check. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 19:29:17 UTC (rev 8924) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 19:33:56 UTC (rev 8925) @@ -540,7 +540,7 @@ final int multiPartNr = archetype.getMultiPartNr(); final int x = xStart - multiPositionData.getXOffset(headMultiShapeID, multiPartNr); final int y = yStart - yOffset + multiPositionData.getYOffset(headMultiShapeID, multiPartNr); - if (archetype.isLowestPart() || headArchetype.isLowestPart()) { + if (archetype.isLowestPart()) { icon.paintIcon(this, g, x, y); } else { final BaseObject<G, A, R, ?> env = head.getContainerGameObject(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-06 19:29:23
|
Revision: 8924 http://gridarta.svn.sourceforge.net/gridarta/?rev=8924&view=rev Author: akirschbaum Date: 2011-07-06 19:29:17 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Merge duplicated code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 19:26:34 UTC (rev 8923) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 19:29:17 UTC (rev 8924) @@ -534,9 +534,13 @@ if (head.getMultiRefCount() > 0) { // multi-part images have to be painted with correct offset // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. - final int x = xStart - multiPositionData.getXOffset(head.getArchetype().getMultiShapeID(), gameObject.getArchetype().getMultiPartNr()); - final int y = yStart - yOffset + multiPositionData.getYOffset(head.getArchetype().getMultiShapeID(), gameObject.getArchetype().getMultiPartNr()); - if (gameObject.getArchetype().isLowestPart() || head.getArchetype().isLowestPart()) { + final R archetype = gameObject.getArchetype(); + final R headArchetype = head.getArchetype(); + final int headMultiShapeID = headArchetype.getMultiShapeID(); + final int multiPartNr = archetype.getMultiPartNr(); + final int x = xStart - multiPositionData.getXOffset(headMultiShapeID, multiPartNr); + final int y = yStart - yOffset + multiPositionData.getYOffset(headMultiShapeID, multiPartNr); + if (archetype.isLowestPart() || headArchetype.isLowestPart()) { icon.paintIcon(this, g, x, y); } else { final BaseObject<G, A, R, ?> env = head.getContainerGameObject(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-06 19:26:41
|
Revision: 8923 http://gridarta.svn.sourceforge.net/gridarta/?rev=8923&view=rev Author: akirschbaum Date: 2011-07-06 19:26:34 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Remove unreachable code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 19:06:51 UTC (rev 8922) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 19:26:34 UTC (rev 8923) @@ -534,10 +534,9 @@ if (head.getMultiRefCount() > 0) { // multi-part images have to be painted with correct offset // TODO: This should be improved, especially regarding multi arch mobs inside spawn points. - final BaseObject<G, A, R, ?> tmpNode = gameObject.isMulti() ? gameObject : null; - final int x = xStart - multiPositionData.getXOffset(head.getArchetype().getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); - final int y = yStart - yOffset + multiPositionData.getYOffset(head.getArchetype().getMultiShapeID(), tmpNode == null ? head.getArchetype().getMultiPartNr() : tmpNode.getArchetype().getMultiPartNr()); - if (tmpNode != null && tmpNode.getArchetype().isLowestPart() || head.getArchetype().isLowestPart()) { + final int x = xStart - multiPositionData.getXOffset(head.getArchetype().getMultiShapeID(), gameObject.getArchetype().getMultiPartNr()); + final int y = yStart - yOffset + multiPositionData.getYOffset(head.getArchetype().getMultiShapeID(), gameObject.getArchetype().getMultiPartNr()); + if (gameObject.getArchetype().isLowestPart() || head.getArchetype().isLowestPart()) { icon.paintIcon(this, g, x, y); } else { final BaseObject<G, A, R, ?> env = head.getContainerGameObject(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-06 19:06:57
|
Revision: 8922 http://gridarta.svn.sourceforge.net/gridarta/?rev=8922&view=rev Author: akirschbaum Date: 2011-07-06 19:06:51 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Make local variable final. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 18:55:00 UTC (rev 8921) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/AbstractIsoMapRenderer.java 2011-07-06 19:06:51 UTC (rev 8922) @@ -546,9 +546,11 @@ } } } else { - int xOffset = 0; + final int xOffset; if (icon.getIconWidth() > isoMapSquareInfo.getXLen()) { xOffset = (icon.getIconWidth() - isoMapSquareInfo.getXLen()) / 2; + } else { + xOffset = 0; } icon.paintIcon(this, g, xStart - xOffset, yStart - yOffset); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-06 18:55:06
|
Revision: 8921 http://gridarta.svn.sourceforge.net/gridarta/?rev=8921&view=rev Author: akirschbaum Date: 2011-07-06 18:55:00 +0000 (Wed, 06 Jul 2011) Log Message: ----------- Remove redundant check. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java Modified: trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2011-07-05 17:36:37 UTC (rev 8920) +++ trunk/src/app/net/sf/gridarta/gui/map/renderer/IsoMapRenderer.java 2011-07-06 18:55:00 UTC (rev 8921) @@ -167,7 +167,7 @@ } else { for (final G node : square) { filterControl.objectInSquare(filterState, node); - if (filterControl.canShow(node) && isGameObjectVisible(node)) { + if (filterControl.canShow(node)) { paintGameObjectIfVisible(g, x, y, node); } } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-07-05 17:36:43
|
Revision: 8920 http://gridarta.svn.sourceforge.net/gridarta/?rev=8920&view=rev Author: akirschbaum Date: 2011-07-05 17:36:37 +0000 (Tue, 05 Jul 2011) Log Message: ----------- Discard existing z attribute if a newly inserted game object has a non-zero z attribute. [Atrinik] Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-06-30 13:58:26 UTC (rev 8919) +++ trunk/atrinik/ChangeLog 2011-07-05 17:36:37 UTC (rev 8920) @@ -1,3 +1,8 @@ +2011-07-05 Alex Tokar + + * Discard existing z attribute if a newly inserted game object has + a non-zero z attribute. + 2011-06-28 Andreas Kirschbaum * Implement map, inv, and allows_all_inv attributes for <type> in Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2011-06-30 13:58:26 UTC (rev 8919) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/model/gameobject/GameObject.java 2011-07-05 17:36:37 UTC (rev 8920) @@ -101,8 +101,10 @@ */ @Override public void propagateElevation(@NotNull final BaseObject<?, ?, ?, ?> gameObject) { - final int elevation = gameObject.getAttributeInt(Z_ATTRIBUTE, false); - setAttributeInt(Z_ATTRIBUTE, elevation); + if (getAttributeInt(Z_ATTRIBUTE) == 0) { + final int elevation = gameObject.getAttributeInt(Z_ATTRIBUTE, false); + setAttributeInt(Z_ATTRIBUTE, elevation); + } gameObject.removeAttribute(Z_ATTRIBUTE); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-06-30 13:58:32
|
Revision: 8919 http://gridarta.svn.sourceforge.net/gridarta/?rev=8919&view=rev Author: akirschbaum Date: 2011-06-30 13:58:26 +0000 (Thu, 30 Jun 2011) Log Message: ----------- Make constructor public. Modified Paths: -------------- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2011-06-30 13:57:44 UTC (rev 8918) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2011-06-30 13:58:26 UTC (rev 8919) @@ -59,7 +59,7 @@ /** * Creates a new instance. */ - GameObjectCreator() { + public GameObjectCreator() { final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, false); final GUIUtils guiUtils = new GUIUtils(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-06-30 13:57:51
|
Revision: 8918 http://gridarta.svn.sourceforge.net/gridarta/?rev=8918&view=rev Author: akirschbaum Date: 2011-06-30 13:57:44 +0000 (Thu, 30 Jun 2011) Log Message: ----------- Adapt to changed format of crossfire.0. [Crossfire]. Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/crossfire.0 trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-06-28 19:39:20 UTC (rev 8917) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/maincontrol/DefaultEditorFactory.java 2011-06-30 13:57:44 UTC (rev 8918) @@ -268,7 +268,7 @@ @NotNull @Override public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider); + return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, true); } /** Modified: trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-06-28 19:39:20 UTC (rev 8917) +++ trunk/atrinik/src/test/net/sf/gridarta/var/atrinik/model/archetype/ArchetypeParserTest.java 2011-06-30 13:57:44 UTC (rev 8918) @@ -140,7 +140,7 @@ @Override protected AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ? extends AbstractArchetypeBuilder<GameObject, MapArchObject, Archetype>> newArchetypeParser() { final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); - final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider); + final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, true); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-06-28 19:39:20 UTC (rev 8917) +++ trunk/crossfire/ChangeLog 2011-06-30 13:57:44 UTC (rev 8918) @@ -1,3 +1,7 @@ +2011-06-30 Andreas Kirschbaum + + * Adapt to changed format of crossfire.0. + 2011-06-28 Andreas Kirschbaum * Implement map, inv, and allows_all_inv attributes for <type> in Modified: trunk/crossfire/resource/resource/conf/crossfire.0 =================================================================== (Binary files differ) Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-06-28 19:39:20 UTC (rev 8917) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/maincontrol/DefaultEditorFactory.java 2011-06-30 13:57:44 UTC (rev 8918) @@ -239,7 +239,7 @@ @NotNull @Override public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider); + return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, false); } /** Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-06-28 19:39:20 UTC (rev 8917) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/archetype/ArchetypeParserTest.java 2011-06-30 13:57:44 UTC (rev 8918) @@ -98,7 +98,7 @@ @Override protected AbstractArchetypeParser<GameObject, MapArchObject, Archetype, ? extends AbstractArchetypeBuilder<GameObject, MapArchObject, Archetype>> newArchetypeParser() { final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); - final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider); + final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, false); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); final FaceObjectProviders faceObjectProviders = new FaceObjectProviders(0, faceObjects, systemIcons); Modified: trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java =================================================================== --- trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2011-06-28 19:39:20 UTC (rev 8917) +++ trunk/crossfire/src/test/net/sf/gridarta/var/crossfire/model/gameobject/GameObjectCreator.java 2011-06-30 13:57:44 UTC (rev 8918) @@ -61,7 +61,7 @@ */ GameObjectCreator() { final ArchFaceProvider archFaceProvider = new ArchFaceProvider(); - final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider); + final FaceObjects<GameObject, MapArchObject, Archetype> faceObjects = new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, false); final GUIUtils guiUtils = new GUIUtils(); final SystemIcons systemIcons = new SystemIcons(guiUtils); faceObjectProviders = new FaceObjectProviders(1, faceObjects, systemIcons); Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-06-28 19:39:20 UTC (rev 8917) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/maincontrol/DefaultEditorFactory.java 2011-06-30 13:57:44 UTC (rev 8918) @@ -268,7 +268,7 @@ @NotNull @Override public FaceObjects<GameObject, MapArchObject, Archetype> createFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { - return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider); + return new DefaultFaceObjects<GameObject, MapArchObject, Archetype>(archFaceProvider, true); } /** Modified: trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java 2011-06-28 19:39:20 UTC (rev 8917) +++ trunk/model/src/app/net/sf/gridarta/model/face/DefaultFaceObjects.java 2011-06-30 13:57:44 UTC (rev 8918) @@ -87,12 +87,19 @@ private final ArchFaceProvider archFaceProvider; /** + * Whether the face file contains face numbers. + */ + private final boolean includeFaceNumbers; + + /** * Creates a new instance. * @param archFaceProvider the arch face provider to use for collection + * @param includeFaceNumbers whether the face file contains face numbers */ - public DefaultFaceObjects(@NotNull final ArchFaceProvider archFaceProvider) { + public DefaultFaceObjects(@NotNull final ArchFaceProvider archFaceProvider, final boolean includeFaceNumbers) { super(ActionBuilderUtils.getString(ACTION_BUILDER, "nameOfFaceObject")); this.archFaceProvider = archFaceProvider; + this.includeFaceNumbers = includeFaceNumbers; } /** @@ -136,7 +143,7 @@ final FileChannel inChannel = fin.getChannel(); final long imageSize = inChannel.size(); byteBuffer.clear(); - byteBuffer.put(("IMAGE " + i + " " + imageSize + " " + face + "\n").getBytes(charset)); + byteBuffer.put(("IMAGE " + (includeFaceNumbers ? i + " " : "") + imageSize + " " + face + "\n").getBytes(charset)); byteBuffer.flip(); outChannel.write(byteBuffer); inChannel.transferTo(0L, imageSize, outChannel); @@ -261,13 +268,16 @@ int offset = 0; while (offset < data.length) { // File: Structure* - // Structure: "IMAGE " seqNr ' ' size ' ' facename '\n' PNGBinary + // Structure: "IMAGE " seqNr ' ' size ' ' facename '\n' PNGBinary (if includeFaceNumbers) + // Structure: "IMAGE " size ' ' facename '\n' PNGBinary (if !includeFaceNumbers) if (!ArrayUtils.contains(data, offset, tag)) { // check for IMAGE throw new IOException("expecting 'IMAGE' at position " + offset); } offset += 6; // skip "IMAGE "; - while (data[offset++] != 0x20) { - // skip seqNr ' ' + if (includeFaceNumbers) { + while (data[offset++] != 0x20) { + // skip seqNr ' ' + } } int size = 0; // read size ' ' This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-06-28 19:39:29
|
Revision: 8917 http://gridarta.svn.sourceforge.net/gridarta/?rev=8917&view=rev Author: akirschbaum Date: 2011-06-28 19:39:20 +0000 (Tue, 28 Jun 2011) Log Message: ----------- Implement map, inv, and allows_all_inv attributes for <type> in types.xml. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/types.xml trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java trunk/resource/system/dtd/types.dtd trunk/src/app/net/sf/gridarta/gui/archetypetype/ArchetypeTypeChecks.java trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java trunk/src/app/net/sf/gridarta/messages.properties trunk/src/app/net/sf/gridarta/messages_de.properties trunk/src/app/net/sf/gridarta/messages_fr.properties trunk/src/app/net/sf/gridarta/messages_sv.properties trunk/src/doc/ref/validators.xhtml trunk/test-mapvalidator/atrinik/regtest.conf trunk/test-mapvalidator/crossfire/maps/AttributeRange.expected trunk/test-mapvalidator/crossfire/maps/ConnectedInsideContainer.expected trunk/test-mapvalidator/crossfire/maps/ConnectedPickable.expected trunk/test-mapvalidator/crossfire/maps/CustomType.expected trunk/test-mapvalidator/crossfire/maps/UnsetSlaying.expected trunk/test-mapvalidator/crossfire/regtest.conf trunk/test-mapvalidator/daimonin/regtest.conf Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/validation/checks/EnvironmentChecker.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentInvError.java trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentMapError.java trunk/test-mapvalidator/crossfire/arch/creator1.arc trunk/test-mapvalidator/crossfire/arch/disease1.arc trunk/test-mapvalidator/crossfire/arch/player1.arc trunk/test-mapvalidator/crossfire/maps/Environment trunk/test-mapvalidator/crossfire/maps/Environment.expected Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/atrinik/ChangeLog 2011-06-28 19:39:20 UTC (rev 8917) @@ -1,3 +1,12 @@ +2011-06-28 Andreas Kirschbaum + + * Implement map, inv, and allows_all_inv attributes for <type> in + types.xml. Allows to restrict the use of archetype types to maps + and/or inventories. For details see comments in types.xml. + + Implements #3079988 (putting some things in containers can cause + server crash). + 2011-06-26 Andreas Kirschbaum * Fix #3332031 (animated ammunition is given an incorrect face). Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/crossfire/ChangeLog 2011-06-28 19:39:20 UTC (rev 8917) @@ -1,3 +1,12 @@ +2011-06-28 Andreas Kirschbaum + + * Implement map, inv, and allows_all_inv attributes for <type> in + types.xml. Allows to restrict the use of archetype types to maps + and/or inventories. For details see comments in types.xml. + + Implements #3079988 (putting some things in containers can cause + server crash). + 2011-06-26 Andreas Kirschbaum * Collect resources. Modified: trunk/crossfire/resource/resource/conf/types.xml =================================================================== --- trunk/crossfire/resource/resource/conf/types.xml 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/crossfire/resource/resource/conf/types.xml 2011-06-28 19:39:20 UTC (rev 8917) @@ -42,7 +42,8 @@ # # # about the 'type' elements: # # # -# <type number="15" name="Type Name"> # +# <type number="15" name="Type Name" map="no" inv="1,2" # +# allows_all_inv="yes"> # # <import_type name="Type Name" /> import attributes of this type; # # Attributes explicitly defined in a type are not imported. # # <required> # @@ -60,6 +61,19 @@ # ... attributes ... # # </type> # # # +# map="yes|no" is optional and defaults to "yes". If set to "no", a # +# validator warning is generated if this this game object is # +# directly on the map. # +# # +# inv="type,type,...|*" is optional and defaults to "*". If this # +# game object is in the inventory of another game object and this # +# other game object has a type not in the list "type,type,...", a # +# validator warning is generated. # +# # +# allows_all_inv="yes" is optional and defaults to "no". If set to # +# "yes", this type number is implicitly added to all "inv" # +# attributes. # +# # # about the 'attribute' type: <attribute ... type="XXX" > # # # # bool - This attribute can only be set to '1' or '0' # @@ -545,7 +559,7 @@ </type> <!--####################################################################--> - <type number="18" name="Altar"> + <type number="18" name="Altar" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -597,7 +611,7 @@ </type> <!--####################################################################--> - <type number="31" name="Altar Trigger"> + <type number="31" name="Altar Trigger" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -988,7 +1002,7 @@ </type> <!--####################################################################--> - <type number="58" name="Battleground"> + <type number="58" name="Battleground" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -1151,7 +1165,7 @@ </type> <!--####################################################################--> - <type number="92" name="Button"> + <type number="92" name="Button" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -1183,7 +1197,7 @@ </type> <!--####################################################################--> - <type number="30" name="Button Trigger"> + <type number="30" name="Button Trigger" inv=""> <import_type name="Button"/> <ignore> <ignore_list name="non_pickable"/> @@ -1196,7 +1210,7 @@ </type> <!--####################################################################--> - <type number="37" name="Class Changer"> + <type number="37" name="Class Changer" inv="57"> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -1363,7 +1377,7 @@ </type> <!--####################################################################--> - <type number="103" name="Converter"> + <type number="103" name="Converter" inv=""> <ignore> <attribute arch="value"/> <attribute arch="nrof"/> @@ -1417,7 +1431,7 @@ </type> <!--####################################################################--> - <type number="42" name="Creator"> + <type number="42" name="Creator" inv="" allows_all_inv="yes"> <ignore> <ignore_list name="system_object"/> </ignore> @@ -1463,7 +1477,7 @@ </type> <!--####################################################################--> - <type number="51" name="Detector"> + <type number="51" name="Detector" inv=""> <ignore> <ignore_list name="system_object"/> </ignore> @@ -1502,7 +1516,7 @@ </type> <!--####################################################################--> - <type number="112" name="Director"> + <type number="112" name="Director" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -1536,7 +1550,7 @@ </type> <!--####################################################################--> - <type number="158" name="Disease"> + <type number="158" name="Disease" map="no"> <ignore> <ignore_list name="system_object"/> </ignore> @@ -1704,7 +1718,7 @@ </type> <!--####################################################################--> - <type number="23" name="Door"> + <type number="23" name="Door" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -1765,7 +1779,7 @@ </type> <!--####################################################################--> - <type number="83" name="Duplicator"> + <type number="83" name="Duplicator" inv=""> <ignore> <ignore_list name="system_object"/> </ignore> @@ -1837,7 +1851,7 @@ </type> <!--####################################################################--> - <type number="66" name="Exit"> + <type number="66" name="Exit" inv="0"> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -2105,7 +2119,7 @@ </type> <!--####################################################################--> - <type number="0" name="Floor"> + <type number="0" name="Floor" inv=""> <required> <attribute arch="is_floor" value="1"/> <attribute arch="alive" value="0"/> @@ -2162,7 +2176,7 @@ </type> <!--####################################################################--> - <type number="67" name="Floor (Encounter)"> + <type number="67" name="Floor (Encounter)" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -2243,7 +2257,7 @@ </type> <!--####################################################################--> - <type number="91" name="Gate"> + <type number="91" name="Gate" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -2337,7 +2351,7 @@ </type> <!--####################################################################--> - <type number="93" name="Handle"> + <type number="93" name="Handle" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -2368,7 +2382,7 @@ </type> <!--####################################################################--> - <type number="27" name="Handle Trigger"> + <type number="27" name="Handle Trigger" inv=""> <import_type name="Handle"/> <ignore> <ignore_list name="non_pickable"/> @@ -2391,7 +2405,7 @@ </type> <!--####################################################################--> - <type number="88" name="Hazard Floor"> + <type number="88" name="Hazard Floor" inv=""> <required> <attribute arch="is_floor" value="1"/> </required> @@ -2510,7 +2524,7 @@ </type> <!--####################################################################--> - <type number="56" name="Holy Altar"> + <type number="56" name="Holy Altar" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -2618,7 +2632,7 @@ </type> <!--####################################################################--> - <type number="64" name="Inventory Checker"> + <type number="64" name="Inventory Checker" inv=""> <ignore> <ignore_list name="system_object"/> </ignore> @@ -2767,7 +2781,7 @@ </type> <!--####################################################################--> - <type number="20" name="Locked Door"> + <type number="20" name="Locked Door" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -2815,7 +2829,7 @@ </type> <!--####################################################################--> - <type number="29" name="Magic Ear"> + <type number="29" name="Magic Ear" inv="0"> <ignore> <ignore_list name="system_object"/> </ignore> @@ -2855,7 +2869,7 @@ </type> <!--####################################################################--> - <type number="62" name="Magic Wall"> + <type number="62" name="Magic Wall" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -2972,7 +2986,7 @@ </type> <!--####################################################################--> - <type number="55" name="Marker"> + <type number="55" name="Marker" inv="122"> <ignore> <ignore_list name="system_object"/> </ignore> @@ -3059,7 +3073,7 @@ </type> <!--####################################################################--> - <type number="0" name="Monster & NPC" display="level ${level}${generator?*:}"> + <type number="0" name="Monster & NPC" display="level ${level}${generator?*:}" inv=""> <required> <attribute arch="is_floor" value="0"/> <attribute arch="alive" value="1"/> @@ -3498,7 +3512,7 @@ </type> <!--####################################################################--> - <type number="28" name="Monster (Grimreaper)"> + <type number="28" name="Monster (Grimreaper)" inv=""> <import_type name="Monster & NPC"/> <ignore> <attribute arch="material"/> @@ -3519,7 +3533,7 @@ </type> <!--####################################################################--> - <type number="65" name="Mood Floor"> + <type number="65" name="Mood Floor" inv=""> <ignore> <ignore_list name="system_object"/> </ignore> @@ -3588,7 +3602,7 @@ </type> <!--####################################################################--> - <type number="40" name="Mover"> + <type number="40" name="Mover" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -3680,7 +3694,7 @@ </type> <!--####################################################################--> - <type number="17" name="Pedestal"> + <type number="17" name="Pedestal" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -3719,7 +3733,7 @@ </type> <!--####################################################################--> - <type number="94" name="Pit"> + <type number="94" name="Pit" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -3776,7 +3790,7 @@ </type> <!--####################################################################--> - <type number="1" name="Player"> + <type number="1" name="Player" map="no" inv=""> <description><![CDATA[ This type of objects must not be used on a map. They will be ignored during map load by server.]]> @@ -4146,7 +4160,7 @@ </type> <!--####################################################################--> - <type number="154" name="Rune"> + <type number="154" name="Rune" inv="4,23,122"> <ignore> <attribute arch="no_pick"/> <attribute arch="title"/> @@ -4251,7 +4265,7 @@ </type> <!--####################################################################--> - <type number="106" name="Savebed"> + <type number="106" name="Savebed" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -4485,7 +4499,7 @@ </type> <!--####################################################################--> - <type number="68" name="Shop Floor"> + <type number="68" name="Shop Floor" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -4536,7 +4550,7 @@ </type> <!--####################################################################--> - <type number="69" name="Shop Mat"> + <type number="69" name="Shop Mat" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -4562,7 +4576,7 @@ </type> <!--####################################################################--> - <type number="98" name="Sign & Magic Mouth"> + <type number="98" name="Sign & Magic Mouth" inv="0"> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -4617,7 +4631,7 @@ </type> <!--####################################################################--> - <type number="43" name="Skill"> + <type number="43" name="Skill" map="no" inv="0"> <ignore> <ignore_list name="system_object"/> </ignore> @@ -4767,7 +4781,7 @@ </type> <!--####################################################################--> - <type number="101" name="Spell"> + <type number="101" name="Spell" map="no"> <ignore> <ignore_list name="system_object"/> </ignore> @@ -4903,7 +4917,7 @@ </type> <!--####################################################################--> - <type number="90" name="Spinner"> + <type number="90" name="Spinner" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -4936,7 +4950,7 @@ </type> <!--####################################################################--> - <type number="138" name="Swamp"> + <type number="138" name="Swamp" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -4978,7 +4992,7 @@ </type> <!--####################################################################--> - <type number="41" name="Teleporter"> + <type number="41" name="Teleporter" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -5068,7 +5082,7 @@ </type> <!--####################################################################--> - <type number="26" name="Timed Gate"> + <type number="26" name="Timed Gate" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -5118,7 +5132,7 @@ </type> <!--####################################################################--> - <type number="2" name="Transport"> + <type number="2" name="Transport" inv=""> <description><![CDATA[ A transport is an object that helps the player move. It should not be confused an EXIT, which instantaneously transport a player from @@ -5265,7 +5279,7 @@ </type> <!--####################################################################--> - <type number="95" name="Trapdoor"> + <type number="95" name="Trapdoor" inv=""> <ignore> <ignore_list name="non_pickable"/> </ignore> @@ -5358,7 +5372,7 @@ </type> <!--####################################################################--> - <type number="52" name="Trigger Marker"> + <type number="52" name="Trigger Marker" inv=""> <ignore> <ignore_list name="system_object"/> </ignore> @@ -5419,7 +5433,7 @@ </type> <!--####################################################################--> - <type number="0" name="Wall"> + <type number="0" name="Wall" inv=""> <required> <attribute arch="is_floor" value="0"/> <attribute arch="alive" value="0"/> @@ -5503,7 +5517,7 @@ </type> <!--####################################################################--> - <type number="0" name="Weak Wall"> + <type number="0" name="Weak Wall" inv=""> <required> <attribute arch="is_floor" value="0"/> <attribute arch="alive" value="1"/> Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/daimonin/ChangeLog 2011-06-28 19:39:20 UTC (rev 8917) @@ -1,3 +1,12 @@ +2011-06-28 Andreas Kirschbaum + + * Implement map, inv, and allows_all_inv attributes for <type> in + types.xml. Allows to restrict the use of archetype types to maps + and/or inventories. For details see comments in types.xml. + + Implements #3079988 (putting some things in containers can cause + server crash). + 2011-06-26 Andreas Kirschbaum * Fix #3332031 (animated ammunition is given an incorrect face). Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeType.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -51,6 +51,24 @@ private final String display; /** + * Whether this archetype type is allowed on maps. + */ + private final boolean map; + + /** + * Which archetype types allow this archetype type in their inventories or + * <code>null</code> for no restrictions. + */ + @Nullable + private final int[] inv; + + /** + * Whether this archetype type allows any inventory game objects, whether + * these types have "inv" specifications. + */ + private final boolean allowsAllInv; + + /** * The description. */ @Nullable @@ -88,16 +106,24 @@ * @param typeName the type name (artificial) * @param typeNo the type number * @param display additional description text + * @param map whether this archetype type is allowed on maps + * @param inv which archetype types allow this archetype type in their + * inventories or <code>null</code> for no restrictions + * @param allowsAllInv whether this archetype type allows any inventory game objects, whether + * these types have "inv" specifications * @param description the description * @param use the usage notes * @param sectionNum the number of attribute sections * @param archetypeAttributes the list of archetype attributes * @param typeAttributes the list of additional attributes */ - public ArchetypeType(@NotNull final String typeName, final int typeNo, @NotNull final String display, @Nullable final String description, @Nullable final String use, final int sectionNum, @NotNull final ArchetypeAttributes archetypeAttributes, @NotNull final ArchetypeAttributesDefinition typeAttributes) { + public ArchetypeType(@NotNull final String typeName, final int typeNo, @NotNull final String display, final boolean map, @Nullable final int[] inv, final boolean allowsAllInv, @Nullable final String description, @Nullable final String use, final int sectionNum, @NotNull final ArchetypeAttributes archetypeAttributes, @NotNull final ArchetypeAttributesDefinition typeAttributes) { this.typeName = typeName; this.typeNo = typeNo; this.display = display; + this.map = map; + this.inv = inv == null ? null : inv.clone(); + this.allowsAllInv = allowsAllInv; this.description = description; this.use = use; this.sectionNum = sectionNum; @@ -150,6 +176,34 @@ } /** + * Returns whether this archetype is allowed on maps. + * @return whether this archetype is allowed on maps + */ + public boolean isMap() { + return map; + } + + /** + * Returns which archetype types allow this archetype type in their + * inventories. + * @return the allowed environment types or <code>null</code> for no + * restrictions + */ + @Nullable + public int[] getInv() { + return inv == null ? null : inv.clone(); + } + + /** + * Returns whether this archetype type allows any inventory game objects, + * regardless whether these types have "inv" specifications. + * @return whether this archetype type allows any inveotry game objects + */ + public boolean isAllowsAllInv() { + return allowsAllInv; + } + + /** * Returns the description. * @return the description */ Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeParser.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -25,6 +25,7 @@ import java.util.LinkedHashSet; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; +import net.sf.gridarta.utils.StringUtils; import net.sf.japi.xml.NodeListIterator; import org.jetbrains.annotations.NotNull; import org.jetbrains.annotations.Nullable; @@ -119,6 +120,12 @@ private static final String XML_USE = "use"; /** + * An empty array of <code>int</code>s. + */ + @NotNull + public static final int[] EMPTY_INT_ARRAY = new int[0]; + + /** * The parser to use. */ @NotNull @@ -149,6 +156,9 @@ final String typeName = parseTypeName(typeElement, isDefaultType); final int typeNo = parseTypeNo(typeElement, isDefaultType, typeName, errorViewCollector); final String display = typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_DISPLAY); + final boolean map = parseMap(typeElement); + final int[] inv = parseInv(typeElement, typeName, errorViewCollector); + final boolean allowsAllInv = parseAllowsAllInv(typeElement); final Collection<String> ignoreTable = new HashSet<String>(); final ArchetypeAttributesDefinition typeAttributes = isDefaultType ? new ArchetypeAttributesDefinition() : parseTypeAttributes(typeElement, typeName, errorViewCollector, ignoreTable, ignorelistsDefinition); @@ -181,7 +191,7 @@ } attributes.setSectionNames(sectionNames); - return new ArchetypeType(typeName, typeNo, display, parseDescription(typeElement), parseUse(typeElement), sectionNames.getSectionNames(), attributes, typeAttributes); + return new ArchetypeType(typeName, typeNo, display, map, inv, allowsAllInv, parseDescription(typeElement), parseUse(typeElement), sectionNames.getSectionNames(), attributes, typeAttributes); } /** @@ -296,6 +306,61 @@ } /** + * Parses the "map" attribute of a "type" {@link Element}. + * @param typeElement the element + * @return whether this archetype is allowed on maps + */ + private static boolean parseMap(@NotNull final Element typeElement) { + final String map = typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_MAP); + return map.equals("yes"); + } + + /** + * Parses the "inv" attribute of a "type" {@link Element}. + * @param typeElement the element + * @param typeName the type name for error messages + * @param errorViewCollector the error view collector for error messages + * @return the archetype types this game object is allowed in or + * <code>null</code> for no restrictions + */ + @Nullable + private static int[] parseInv(@NotNull final Element typeElement, @NotNull final String typeName, @NotNull final ErrorViewCollector errorViewCollector) { + if (!typeElement.hasAttribute(ArchetypeTypeSetParser.XML_TYPE_INV)) { + return null; + } + + final String inv = typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_INV); + if (inv.isEmpty()) { + return EMPTY_INT_ARRAY; + } + if (inv.equals("*")) { + return null; + } + + final String[] types = StringUtils.PATTERN_COMMA.split(inv, -1); + final int[] result = new int[types.length]; + for (int i = 0; i < types.length; i++) { + try { + result[i] = Integer.parseInt(types[i]); + } catch (final NumberFormatException ignored) { + errorViewCollector.addWarning(ErrorViewCategory.TYPES_ENTRY_INVALID, "type " + typeName + " has invalid inv specification '" + types[i] + "'."); + result[i] = -1; + } + } + return result; + } + + /** + * Parses the "allows_all_inv" attribute of a "type" {@link Element}. + * @param typeElement the element + * @return whether this archetype allows all inventory game objects + */ + private static boolean parseAllowsAllInv(@NotNull final Element typeElement) { + final String allowsAllInv = typeElement.getAttribute(ArchetypeTypeSetParser.XML_TYPE_ALLOWS_ALL_INV); + return allowsAllInv.equals("yes"); + } + + /** * Parses the type attributes of a "type" or "default_type" {@link * Element}. * @param typeElement the element Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSet.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -277,7 +277,7 @@ public void defineFallbackArchetypeType() { fallbackArchetypeType = archetypeTypeNames.get("Misc"); if (fallbackArchetypeType == null) { - fallbackArchetypeType = new ArchetypeType("", 0, "", null, null, 2, new ArchetypeAttributes(), new ArchetypeAttributesDefinition()); + fallbackArchetypeType = new ArchetypeType("", 0, "", true, null, false, null, null, 2, new ArchetypeAttributes(), new ArchetypeAttributesDefinition()); } } Modified: trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/model/src/app/net/sf/gridarta/model/archetypetype/ArchetypeTypeSetParser.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -176,6 +176,27 @@ public static final String XML_TYPE_NUMBER = "number"; /** + * The name of the "map" attribute within {@link #XML_ELEMENT_TYPE} + * elements. + */ + @NotNull + public static final String XML_TYPE_MAP = "map"; + + /** + * The name of the "inv" attribute within {@link #XML_ELEMENT_TYPE} + * elements. + */ + @NotNull + public static final String XML_TYPE_INV = "inv"; + + /** + * The name of the "allows_all_inv" attribute within {@link + * #XML_ELEMENT_TYPE} elements. + */ + @NotNull + public static final String XML_TYPE_ALLOWS_ALL_INV = "allows_all_inv"; + + /** * The name of the "display" attribute within {@link #XML_ELEMENT_TYPE} * elements. */ Added: trunk/model/src/app/net/sf/gridarta/model/validation/checks/EnvironmentChecker.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/EnvironmentChecker.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/EnvironmentChecker.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -0,0 +1,118 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.validation.checks; + +import java.util.Arrays; +import java.util.IdentityHashMap; +import java.util.Map; +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.archetypetype.ArchetypeType; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import net.sf.gridarta.model.validation.AbstractValidator; +import net.sf.gridarta.model.validation.ErrorCollector; +import net.sf.gridarta.model.validation.GameObjectValidator; +import net.sf.gridarta.model.validation.ValidatorPreferences; +import net.sf.gridarta.model.validation.errors.EnvironmentInvError; +import net.sf.gridarta.model.validation.errors.EnvironmentMapError; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link GameObjectValidator} that checks for valid environment. Warnings can + * be generated for game objects placed directly on maps, or for game objects + * placed into inventories of game objects not having some type. + * @author Andreas Kirschbaum + */ +public class EnvironmentChecker<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractValidator<G, A, R> implements GameObjectValidator<G, A, R> { + + /** + * The {@link ArchetypeType ArchetypeTypes} that are not allowed on maps. + */ + @NotNull + private final Map<ArchetypeType, Void> noMap = new IdentityHashMap<ArchetypeType, Void>(); + + /** + * Maps {@link ArchetypeType ArchetypeTypes} to allowed environment types. + * Game object types not included are allowed in any inventory. + */ + @NotNull + private final Map<ArchetypeType, int[]> inv = new IdentityHashMap<ArchetypeType, int[]>(); + + /** + * Creates a new instance. + * @param validatorPreferences the validator preferences to use + */ + public EnvironmentChecker(@NotNull final ValidatorPreferences validatorPreferences) { + super(validatorPreferences); + } + + /** + * Marks an {@link ArchetypeType} to not be allowed directly on maps. + * @param archetypeType the archetype type + */ + public void addNoMap(@NotNull final ArchetypeType archetypeType) { + noMap.put(archetypeType, null); + } + + /** + * Sets the allowed environment game object types for an {@link + * ArchetypeType}. + * @param archetypeType the archetype type + * @param types the allowed environment types + */ + public void addInv(@NotNull final ArchetypeType archetypeType, @NotNull final int[] types) { + if (inv.containsKey(archetypeType)) { + throw new IllegalArgumentException(); + } + + final int[] tmp = types.clone(); + Arrays.sort(tmp); + inv.put(archetypeType, tmp); + } + + /** + * {@inheritDoc} + */ + @Override + public void validateGameObject(@NotNull final G gameObject, @NotNull final ErrorCollector<G, A, R> errorCollector) { + final G envGameObject = gameObject.getContainerGameObject(); + if (envGameObject == null) { + for (final ArchetypeType archetypeType : noMap.keySet()) { + if (archetypeType.matches(gameObject)) { + errorCollector.collect(new EnvironmentMapError<G, A, R>(gameObject, archetypeType.getTypeName())); + break; + } + } + } else { + for (final Map.Entry<ArchetypeType, int[]> entry : inv.entrySet()) { + final ArchetypeType archetypeType = entry.getKey(); + if (archetypeType.matches(gameObject)) { + final int[] types = entry.getValue(); + if (types != null && Arrays.binarySearch(types, envGameObject.getTypeNo()) < 0) { + final String typeDescription = archetypeType.getTypeName(); + final String envTypeDescription = Integer.toString(envGameObject.getTypeNo()); // XXX: use envArchetypeType.getTypeName() + errorCollector.collect(new EnvironmentInvError<G, A, R>(gameObject, typeDescription, envTypeDescription)); + } + } + } + } + } + +} // class EnvironmentChecker Property changes on: trunk/model/src/app/net/sf/gridarta/model/validation/checks/EnvironmentChecker.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentInvError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentInvError.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentInvError.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -0,0 +1,80 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.validation.errors; + +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Validation error that's used when the EnvironmentChecker detected a + * possible error on the map. + * @author Andreas Kirschbaum + */ +public class EnvironmentInvError<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends GameObjectValidationError<G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The type's description. + */ + @NotNull + private final String typeDescription; + + /** + * The environment type's description. + */ + @NotNull + private final String envTypeDescription; + + /** + * Creates a new instance. + * @param gameObject the game object on which the error occurred + * @param typeDescription the type's description + * @param envTypeDescription the environment type's description + */ + public EnvironmentInvError(@NotNull final G gameObject, @NotNull final String typeDescription, @NotNull final String envTypeDescription) { + super(gameObject); + this.typeDescription = typeDescription; + this.envTypeDescription = envTypeDescription; + } + + /** + * {@inheritDoc} + */ + @Nullable + @Override + public String getParameter(final int id) { + switch (id) { + case 0: + return typeDescription; + + case 1: + return envTypeDescription; + } + return super.getParameter(id); + } + +} // class EnvironmentInvError Property changes on: trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentInvError.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentMapError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentMapError.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentMapError.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -0,0 +1,69 @@ +/* + * Gridarta MMORPG map editor for Crossfire, Daimonin and similar games. + * Copyright (C) 2000-2010 The Gridarta Developers. + * + * This program is free software; you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation; either version 2 of the License, or + * (at your option) any later version. + * + * This program 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 General Public License for more details. + * + * You should have received a copy of the GNU General Public License along + * with this program; if not, write to the Free Software Foundation, Inc., + * 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA. + */ + +package net.sf.gridarta.model.validation.errors; + +import net.sf.gridarta.model.archetype.Archetype; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.maparchobject.MapArchObject; +import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; + +/** + * Validation error that's used when the EnvironmentChecker detected a + * possible error on the map. + * @author Andreas Kirschbaum + */ +public class EnvironmentMapError<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends GameObjectValidationError<G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The type's description. + */ + @NotNull + private final String typeDescription; + + /** + * Creates a new instance. + * @param gameObject the game object on which the error occurred + * @param typeDescription the type's description + */ + public EnvironmentMapError(@NotNull final G gameObject, @NotNull final String typeDescription) { + super(gameObject); + this.typeDescription = typeDescription; + } + + /** + * {@inheritDoc} + */ + @Nullable + @Override + public String getParameter(final int id) { + switch (id) { + case 0: + return typeDescription; + } + return super.getParameter(id); + } + +} // class EnvironmentMapError Property changes on: trunk/model/src/app/net/sf/gridarta/model/validation/errors/EnvironmentMapError.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/model/src/test/net/sf/gridarta/model/archetypetype/ArchetypeTypeTest.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -53,7 +53,7 @@ final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); final BaseObject<?, ?, ?, ?> archetype = new TestArchetype("base", faceObjectProviders, animationObjects); - final ArchetypeType archetypeType1 = new ArchetypeType("name1", 1, "", "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType1 = new ArchetypeType("name1", 1, "", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); Assert.assertEquals("name1 (1)", archetypeType1.getDisplayName(archetype)); } @@ -71,7 +71,7 @@ final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); final BaseObject<?, ?, ?, ?> archetype = new TestArchetype("base", faceObjectProviders, animationObjects); - final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a}${a}", "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a}${a}", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); Assert.assertEquals("name2 (1) [a=]", archetypeType2.getDisplayName(archetype)); archetype.setObjectText("a xyz\n"); @@ -81,10 +81,10 @@ Assert.assertEquals("name2 (1) [a=${a}${a}]", archetypeType2.getDisplayName(archetype)); // syntax errors are not fatal - final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${}", "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${}", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); Assert.assertEquals("name (1) []", archetypeType3.getDisplayName(archetype)); - final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a", "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); Assert.assertEquals("name (1) [${a]", archetypeType4.getDisplayName(archetype)); } @@ -102,7 +102,7 @@ final ArchetypeAttributesDefinition typeAttributes = new ArchetypeAttributesDefinition(); final BaseObject<?, ?, ?, ?> archetype = new TestArchetype("base", faceObjectProviders, animationObjects); - final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a?True:False}", "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType2 = new ArchetypeType("name2", 1, "a=${a?True:False}", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); Assert.assertEquals("name2 (1) [a=False]", archetypeType2.getDisplayName(archetype)); archetype.setObjectText("a xyz\n"); @@ -112,33 +112,33 @@ Assert.assertEquals("name2 (1) [a=False]", archetypeType2.getDisplayName(archetype)); // empty replacements are allowed - final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${a?:}", "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType3 = new ArchetypeType("name", 1, "${a?:}", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); archetype.setObjectText("a 0\n"); Assert.assertEquals("name (1) []", archetypeType3.getDisplayName(archetype)); archetype.setObjectText("a 1\n"); Assert.assertEquals("name (1) []", archetypeType3.getDisplayName(archetype)); // replacements with multiple colons - final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a?b:c:d}", "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType4 = new ArchetypeType("name", 1, "${a?b:c:d}", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); archetype.setObjectText("a 0\n"); Assert.assertEquals("name (1) [c:d]", archetypeType4.getDisplayName(archetype)); archetype.setObjectText("a 1\n"); Assert.assertEquals("name (1) [b]", archetypeType4.getDisplayName(archetype)); // syntax errors are not fatal - final ArchetypeType archetypeType5 = new ArchetypeType("name", 1, "${?", "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType5 = new ArchetypeType("name", 1, "${?", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); archetype.setObjectText("a 0\n"); Assert.assertEquals("name (1) [${?]", archetypeType5.getDisplayName(archetype)); archetype.setObjectText("a 1\n"); Assert.assertEquals("name (1) [${?]", archetypeType5.getDisplayName(archetype)); - final ArchetypeType archetypeType6 = new ArchetypeType("name", 1, "${a?", "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType6 = new ArchetypeType("name", 1, "${a?", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); archetype.setObjectText("a 0\n"); Assert.assertEquals("name (1) [${a?]", archetypeType6.getDisplayName(archetype)); archetype.setObjectText("a 1\n"); Assert.assertEquals("name (1) [${a?]", archetypeType6.getDisplayName(archetype)); - final ArchetypeType archetypeType7 = new ArchetypeType("name", 1, "${a?:", "description", "use", 1, archetypeAttributes, typeAttributes); + final ArchetypeType archetypeType7 = new ArchetypeType("name", 1, "${a?:", true, null, false, "description", "use", 1, archetypeAttributes, typeAttributes); archetype.setObjectText("a 0\n"); Assert.assertEquals("name (1) [${a?:]", archetypeType7.getDisplayName(archetype)); archetype.setObjectText("a 1\n"); Modified: trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/model/src/test/net/sf/gridarta/model/mapmodel/TestMapModelHelper.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -33,6 +33,7 @@ import net.sf.gridarta.model.gameobject.TestGameObject; import net.sf.gridarta.model.maparchobject.TestMapArchObject; import net.sf.gridarta.utils.Size2D; +import net.sf.gridarta.utils.StringUtils; import org.jetbrains.annotations.NotNull; import org.junit.Assert; @@ -239,7 +240,7 @@ final Size2D mapSize = mapModel.getMapArchObject().getMapSize(); Assert.assertEquals(lines.length, mapSize.getHeight()); final Pattern pattern1 = Pattern.compile("\\|"); - final Pattern pattern2 = Pattern.compile(","); + final Pattern pattern2 = StringUtils.PATTERN_COMMA; final Point pos = new Point(); for (int y = 0; y < lines.length; y++) { final CharSequence line = lines[y]; Modified: trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -142,6 +142,16 @@ } /** + * Checks that {@link net.sf.gridarta.model.validation.checks.EnvironmentChecker} + * can be instantiated. + * @throws NoSuchValidatorException if the test fails + */ + @Test + public void testNewEnvironmentChecker() throws NoSuchValidatorException { + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.EnvironmentChecker"); + } + + /** * Checks that {@link net.sf.gridarta.model.validation.checks.ExitChecker} * can be instantiated. * @throws NoSuchValidatorException if the test fails Modified: trunk/resource/system/dtd/types.dtd =================================================================== --- trunk/resource/system/dtd/types.dtd 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/resource/system/dtd/types.dtd 2011-06-28 19:39:20 UTC (rev 8917) @@ -96,6 +96,13 @@ references are replaced with attribute values; ${attr?true:false} references are replaced by "true" if the attribute exists and is not zero, or else by "false". --> +<!-- map: when set to 'no', generate a map warning if this game object is placed + directly on a map. --> +<!-- inv: comma-separated list of game object types that allow this object as + their inventory. If this game object is part of any other inventory, a map + warning is generated. Defaults to '*' which disables the check. --> +<!-- allows_all_inv: when set to 'yes', implicitly adds this game object type to + 'inv' of all <type> definitions. --> <!ELEMENT type (import_type*,required?,ignore?,description?,use?,(section | attribute)*)> <!ATTLIST type xml:base CDATA #IMPLIED @@ -103,6 +110,9 @@ number CDATA #REQUIRED available (yes|no) 'yes' display CDATA #IMPLIED + map (yes|no) 'yes' + inv CDATA #IMPLIED + allows_all_inv (yes|no) 'no' > <!ELEMENT description (#PCDATA)> Modified: trunk/src/app/net/sf/gridarta/gui/archetypetype/ArchetypeTypeChecks.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/archetypetype/ArchetypeTypeChecks.java 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/src/app/net/sf/gridarta/gui/archetypetype/ArchetypeTypeChecks.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -19,6 +19,9 @@ package net.sf.gridarta.gui.archetypetype; +import java.util.HashSet; +import java.util.Iterator; +import java.util.Set; import net.sf.gridarta.model.archetype.Archetype; import net.sf.gridarta.model.archetypetype.ArchetypeAttribute; import net.sf.gridarta.model.archetypetype.ArchetypeAttributeAnimationName; @@ -46,6 +49,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.validation.checks.AttributeRangeChecker; +import net.sf.gridarta.model.validation.checks.EnvironmentChecker; import net.sf.gridarta.model.validation.checks.InvalidCheckException; import org.apache.log4j.Category; import org.apache.log4j.Logger; @@ -71,11 +75,35 @@ /** * Adds attribute range checks for all defined attributes. * @param attributeRangeChecker the attribute range checker to add to + * @param environmentChecker the environment checker to add to * @param archetypeTypeSet the archetype type set to use */ - public static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void addChecks(@NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker) { + public static <G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> void addChecks(@NotNull final ArchetypeTypeSet archetypeTypeSet, @NotNull final AttributeRangeChecker<G, A, R> attributeRangeChecker, @NotNull final EnvironmentChecker<G, A, R> environmentChecker) { + final Set<Integer> allowsAllInvTypes = new HashSet<Integer>(); for (final ArchetypeType archetypeType : archetypeTypeSet) { + if (archetypeType.isAllowsAllInv()) { + allowsAllInvTypes.add(archetypeType.getTypeNo()); + } + } + for (final ArchetypeType archetypeType : archetypeTypeSet) { addChecks(archetypeTypeSet, attributeRangeChecker, archetypeType); + if (!archetypeType.isMap()) { + environmentChecker.addNoMap(archetypeType); + } + final int[] types = archetypeType.getInv(); + if (types != null) { + final Set<Integer> tmp = new HashSet<Integer>(allowsAllInvTypes); + for (final int type : types) { + tmp.add(type); + } + final int[] tmp2 = new int[tmp.size()]; + final Iterator<Integer> it = tmp.iterator(); + for (int i = 0; i < tmp2.length; i++) { + tmp2[i] = it.next(); + } + assert !it.hasNext(); + environmentChecker.addInv(archetypeType, tmp2); + } } } Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2011-06-28 19:39:20 UTC (rev 8917) @@ -94,6 +94,7 @@ import net.sf.gridarta.model.validation.NoSuchValidatorException; import net.sf.gridarta.model.validation.ValidatorPreferences; import net.sf.gridarta.model.validation.checks.AttributeRangeChecker; +import net.sf.gridarta.model.validation.checks.EnvironmentChecker; import net.sf.gridarta.model.validation.checks.PaidItemShopSquareChecker; import net.sf.gridarta.model.validation.checks.ShopSquareChecker; import net.sf.gridarta.model.validation.checks.ValidatorFactory; @@ -190,6 +191,7 @@ throw new MissingResourceException("Cannot create XML parser: " + ex.getMessage(), null, null); } final AttributeRangeChecker<G, A, R> attributeRangeChecker = new AttributeRangeChecker<G, A, R>(validatorPreferences); + final EnvironmentChecker<G, A, R> environmentChecker = new EnvironmentChecker<G, A, R>(validatorPreferences); final DocumentBuilder documentBuilder = xmlHelper.getDocumentBuilder(); try { final URL url = IOUtils.getResource(globalSettings.getConfigurationDirectory(), "GameObjectMatchers.xml"); @@ -210,6 +212,7 @@ loadValidators(validators, validatorFactory, errorView); editorFactory.initMapValidators(validators, gameObjectMatchersErrorViewCollector, globalSettings, gameObjectMatchers, attributeRangeChecker, validatorPreferences); validators.addValidator(attributeRangeChecker); + validators.addValidator(environmentChecker); } catch (final FileNotFoundException ex) { errorView.addWarning(ErrorViewCategory.GAMEOBJECTMATCHERS_FILE_INVALID, "GameObjectMatchers.xml: " + ex.getMessage()); } @@ -330,7 +333,7 @@ final ScriptModelParser<G, A, R> scriptModelParser = new ScriptModelParser<G, A, R>(pluginParameterFactory); new ScriptModelLoader<G, A, R>(scriptModelParser).loadScripts(errorView, scriptsFile, scriptModel); new AutojoinListsParser<G, A, R>(errorView, archetypeSet, autojoinLists).loadList(globalSettings.getConfigurationDirectory()); - ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker); + ArchetypeTypeChecks.addChecks(archetypeTypeSet, attributeRangeChecker, environmentChecker); } /** Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2011-06-27 22:49:06 UTC (rev 8916) +++ trunk/src/app/net/sf/gridarta/messages.properties 2011-06-28 19:39:20 UTC (rev 8917) @@ -1171,6 +1171,7 @@ prefs.Validator.DoubleLayer=Whether this map validator check is is enabled. prefs.Validator.DoubleType... [truncated message content] |
From: <aki...@us...> - 2011-06-27 22:49:12
|
Revision: 8916 http://gridarta.svn.sourceforge.net/gridarta/?rev=8916&view=rev Author: akirschbaum Date: 2011-06-27 22:49:06 +0000 (Mon, 27 Jun 2011) Log Message: ----------- Merge duplicated code. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java Modified: trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java 2011-06-26 14:44:02 UTC (rev 8915) +++ trunk/src/app/net/sf/gridarta/gui/shortcuts/ShortcutsDialog.java 2011-06-27 22:49:06 UTC (rev 8916) @@ -98,7 +98,7 @@ * The {@link Pattern} to split a list of action categories. */ @NotNull - private static final Pattern PATTERN_CATEGORIES = Pattern.compile(","); + private static final Pattern PATTERN_CATEGORIES = StringUtils.PATTERN_COMMA; /** * The {@link Pattern} to split a category into sub-categories. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-06-26 14:44:12
|
Revision: 8915 http://gridarta.svn.sourceforge.net/gridarta/?rev=8915&view=rev Author: akirschbaum Date: 2011-06-26 14:44:02 +0000 (Sun, 26 Jun 2011) Log Message: ----------- Collect resources. [Crossfire] Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/animations trunk/crossfire/resource/resource/conf/animtree trunk/crossfire/resource/resource/conf/archetypes trunk/crossfire/resource/resource/conf/bmaps.paths trunk/crossfire/resource/resource/conf/crossfire.0 Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-06-26 14:22:38 UTC (rev 8914) +++ trunk/crossfire/ChangeLog 2011-06-26 14:44:02 UTC (rev 8915) @@ -1,5 +1,7 @@ 2011-06-26 Andreas Kirschbaum + * Collect resources. + * Fix #3332031 (animated ammunition is given an incorrect face). 2011-06-10 Andreas Kirschbaum Modified: trunk/crossfire/resource/resource/conf/animations =================================================================== --- trunk/crossfire/resource/resource/conf/animations 2011-06-26 14:22:38 UTC (rev 8914) +++ trunk/crossfire/resource/resource/conf/animations 2011-06-26 14:44:02 UTC (rev 8915) @@ -579,10 +579,10 @@ blood_sea.112 mina anim blue_dragon1 -pl_dragon.151 -pl_dragon.152 -pl_dragon.171 -pl_dragon.172 +pl_dragon_blue.151 +pl_dragon_blue.152 +pl_dragon_blue.171 +pl_dragon_blue.172 facings 2 mina anim blue_dragon2 @@ -1785,6 +1785,21 @@ fenx_class_warrior.171 fenx_class_warrior.172 mina +anim fenx_player_praying +facings 4 +fenx_praying.110 +fenx_praying.111 +fenx_praying.110 +fenx_praying.130 +fenx_praying.131 +fenx_praying.130 +fenx_praying.150 +fenx_praying.151 +fenx_praying.150 +fenx_praying.170 +fenx_praying.171 +fenx_praying.170 +mina anim fenx_player_singing facings 4 fenx_singing.110 @@ -1802,18 +1817,18 @@ mina anim fenx_player_spellcasting facings 4 +fenx_spellcasting.111 +fenx_spellcasting.112 +fenx_spellcasting.111 +fenx_spellcasting.131 +fenx_spellcasting.132 +fenx_spellcasting.131 fenx_spellcasting.151 fenx_spellcasting.152 fenx_spellcasting.151 -fenx_spellcasting.151 -fenx_spellcasting.152 -fenx_spellcasting.151 -fenx_spellcasting.151 -fenx_spellcasting.152 -fenx_spellcasting.151 -fenx_spellcasting.151 -fenx_spellcasting.152 -fenx_spellcasting.151 +fenx_spellcasting.171 +fenx_spellcasting.172 +fenx_spellcasting.171 mina anim fenx_player_sword facings 4 @@ -3927,17 +3942,47 @@ pl_dragon_bl.172 facings 4 mina +anim pl_dragon_bl_spellcasting +facings 4 +pl_dragon_bl_spellcasting.111 +pl_dragon_bl_spellcasting.112 +pl_dragon_bl_spellcasting.113 +pl_dragon_bl_spellcasting.131 +pl_dragon_bl_spellcasting.132 +pl_dragon_bl_spellcasting.133 +pl_dragon_bl_spellcasting.151 +pl_dragon_bl_spellcasting.152 +pl_dragon_bl_spellcasting.153 +pl_dragon_bl_spellcasting.171 +pl_dragon_bl_spellcasting.172 +pl_dragon_bl_spellcasting.173 +mina anim pl_dragon_blue -pl_dragon.111 -pl_dragon.112 -pl_dragon.131 -pl_dragon.132 -pl_dragon.151 -pl_dragon.152 -pl_dragon.171 -pl_dragon.172 +pl_dragon_blue.111 +pl_dragon_blue.112 +pl_dragon_blue.131 +pl_dragon_blue.132 +pl_dragon_blue.151 +pl_dragon_blue.152 +pl_dragon_blue.171 +pl_dragon_blue.172 facings 4 mina +anim pl_dragon_blue_spellcasting +facings 4 +pl_dragon_blue_spellcasting.111 +pl_dragon_blue_spellcasting.112 +pl_dragon_blue_spellcasting.113 +pl_dragon_blue_spellcasting.131 +pl_dragon_blue_spellcasting.132 +pl_dragon_blue_spellcasting.133 +pl_dragon_blue_spellcasting.151 +pl_dragon_blue_spellcasting.152 +pl_dragon_blue_spellcasting.153 +pl_dragon_blue_spellcasting.171 +pl_dragon_blue_spellcasting.172 +pl_dragon_blue_spellcasting.173 +mina anim pl_dragon_g pl_dragon_g.111 pl_dragon_g.112 @@ -3949,6 +3994,21 @@ pl_dragon_g.172 facings 4 mina +anim pl_dragon_g_spellcasting +pl_dragon_g_spellcasting.111 +pl_dragon_g_spellcasting.112 +pl_dragon_g_spellcasting.113 +pl_dragon_g_spellcasting.131 +pl_dragon_g_spellcasting.132 +pl_dragon_g_spellcasting.133 +pl_dragon_g_spellcasting.151 +pl_dragon_g_spellcasting.152 +pl_dragon_g_spellcasting.153 +pl_dragon_g_spellcasting.171 +pl_dragon_g_spellcasting.172 +pl_dragon_g_spellcasting.173 +facings 4 +mina anim pl_dragon_r facings 4 pl_dragon_r.111 @@ -3960,6 +4020,21 @@ pl_dragon_r.171 pl_dragon_r.172 mina +anim pl_dragon_r_spellcasting +facings 4 +pl_dragon_r_spellcasting.111 +pl_dragon_r_spellcasting.112 +pl_dragon_r_spellcasting.113 +pl_dragon_r_spellcasting.131 +pl_dragon_r_spellcasting.132 +pl_dragon_r_spellcasting.133 +pl_dragon_r_spellcasting.151 +pl_dragon_r_spellcasting.152 +pl_dragon_r_spellcasting.153 +pl_dragon_r_spellcasting.171 +pl_dragon_r_spellcasting.172 +pl_dragon_r_spellcasting.173 +mina anim pl_half_orc facings 4 pl_half_orc.111 @@ -5812,6 +5887,21 @@ wraithp.171 wraithp.172 mina +anim wraith_player_feeding +facings 4 +wraith_player_feeding.111 +wraith_player_feeding.112 +wraith_player_feeding.113 +wraith_player_feeding.131 +wraith_player_feeding.132 +wraith_player_feeding.133 +wraith_player_feeding.151 +wraith_player_feeding.152 +wraith_player_feeding.153 +wraith_player_feeding.171 +wraith_player_feeding.172 +wraith_player_feeding.173 +mina anim wrathful_eye sunspear.111 sunspear.112 Modified: trunk/crossfire/resource/resource/conf/animtree =================================================================== --- trunk/crossfire/resource/resource/conf/animtree 2011-06-26 14:22:38 UTC (rev 8914) +++ trunk/crossfire/resource/resource/conf/animtree 2011-06-26 14:44:02 UTC (rev 8915) @@ -239,6 +239,7 @@ /spell/Cone/fear /player/race/fenx_player /player/race/fenx_player_class_warrior +/player/race/fenx_player_praying /player/race/fenx_player_singing /player/race/fenx_player_spellcasting /player/race/fenx_player_sword @@ -510,9 +511,13 @@ /connect/Hole/pit_white-red-c-marble_114_open /monster/misc/pixie /player/race/pl_dragon_bl +/player/race/pl_dragon_bl_spellcasting /player/race/pl_dragon_blue +/player/race/pl_dragon_blue_spellcasting /player/race/pl_dragon_g +/player/race/pl_dragon_g_spellcasting /player/race/pl_dragon_r +/player/race/pl_dragon_r_spellcasting /player/race/pl_half_orc /system/player_changer /spell/MovingBall/poison_fog @@ -759,6 +764,7 @@ /monster/dragon/WDragon/worthless_dragon /monster/undead/wraith /player/race/wraith_player +/player/race/wraith_player_feeding /spell/Cone/wrathful_eye /wall/wwall/wwall_weak_1 /wall/wwall/wwall_weak_2 Modified: trunk/crossfire/resource/resource/conf/archetypes =================================================================== --- trunk/crossfire/resource/resource/conf/archetypes 2011-06-26 14:22:38 UTC (rev 8914) +++ trunk/crossfire/resource/resource/conf/archetypes 2011-06-26 14:44:02 UTC (rev 8915) @@ -5286,7 +5286,6 @@ name chemney face chemney_1.111 map_layer fly -tall_height 2 no_pick 1 end Object chemney_2 @@ -5294,7 +5293,6 @@ name chemney face chemney_2.111 map_layer fly -tall_height 2 no_pick 1 end Object roof_1 @@ -23207,6 +23205,81 @@ run_away 60 attack_movement 3 end +Object awful_rat +editor_folder monster/animal +name awful rat +Con 50 +hp 6000 +maxhp 6000 +exp 900000 +dam 95 +wc -100 +ac -120 +speed -0.99 +level 120 +resist_physical 95 +resist_magic 95 +resist_fire 95 +resist_electricity 95 +resist_cold 95 +resist_confusion 95 +resist_acid 95 +resist_drain 95 +resist_weaponmagic 75 +resist_ghosthit 95 +resist_poison 100 +resist_slow 95 +resist_paralyze -50 +resist_turn_undead 95 +resist_deplete 95 +resist_death 95 +resist_chaos 95 +resist_godpower 95 +resist_holyword 95 +resist_blind 95 +see_invisible 1 +reflect_missile 1 +run_away 10 +can_cast_spell 0 +can_see_in_dark 1 +face giantrat.x31 +animation giantrat +race animal +randomitems giantrat +attack_movement 3 +monster 1 +move_type walk +sleep 1 +Wis 10 +resist_fear 100 +Str 30 +Dex 30 +alive 1 +weight 2400000 +attacktype 1 +end +More +Object awful_rat_2 +face giantrat.x31 +animation giantrat +alive 1 +x 1 +end +More +Object awful_rat_3 +face giantrat.x31 +animation giantrat +alive 1 +y 1 +end +More +Object awful_rat_4 +face giantrat.x31 +animation giantrat +alive 1 +x 1 +y 1 +end Object giantrat editor_folder monster/animal name giant rat @@ -25792,7 +25865,7 @@ exp 1000000 dam 50 wc -50 -ac -120 +ac -50 resist_physical 100 resist_cold 100 resist_electricity 60 @@ -25846,7 +25919,7 @@ exp 400000 dam 80 wc -60 -ac -110 +ac -50 attacktype 5242880 resist_physical 100 resist_magic 30 @@ -25897,7 +25970,7 @@ exp 1000000 dam 30 wc -80 -ac -120 +ac -50 resist_physical 100 resist_fire 100 resist_electricity 50 @@ -25957,7 +26030,7 @@ exp 200000 dam 100 wc -50 -ac -105 +ac -55 resist_physical 100 resist_magic 20 speed 0.500000 @@ -26355,6 +26428,65 @@ x 2 y 1 end +Object ancient_chinese_dragon +editor_folder monster/dragon +name Ancient dragon +hp 4000 +maxhp 4000 +maxsp 60 +exp 100000 +dam 30 +ac -12 +speed -0.300000 +level 20 +randomitems chinese +race dragon +face chinese_dr.x71 +animation chinese_dragon +monster 1 +move_type walk +sleep 1 +Wis 20 +Con 4 +Pow 32 +can_cast_spell 1 +resist_cold 100 +resist_fear 100 +resist_blind 100 +resist_fire -100 +resist_magic 30 +wc -15 +see_invisible 1 +alive 1 +no_pick 1 +weight 200000 +run_away 4 +end +More +Object ancient_chinese_dragon_2 +name Ancient dragon +face chinese_dr.x71 +animation chinese_dragon +alive 1 +x 1 +end +More +Object ancient_chinese_dragon_3 +name Ancient dragon +face chinese_dr.x71 +animation chinese_dragon +alive 1 +y 1 +end +More +Object ancient_chinese_dragon_4 +name Ancient dragon +face chinese_dr.x71 +animation chinese_dragon +alive 1 +x 1 +y 1 +end Object chinese_dragon editor_folder monster/dragon name chinese dragon @@ -26414,6 +26546,127 @@ x 1 y 1 end +Object eternal_chinese_dragon +editor_folder monster/dragon +name_pl Eternal dragons +name Eternal dragon +Wis 29 +hp 32000 +maxhp 32000 +maxsp 400 +exp 900000 +dam 100 +ac -12 +speed -0.300000 +level 110 +resist_magic 100 +randomitems eternal_chinese_dragon +race dragon +face chinese_dr.x71 +animation chinese_dragon +monster 1 +move_type walk +sleep 1 +Con 4 +Pow 32 +can_cast_spell 1 +resist_cold 100 +resist_fear 100 +resist_blind 100 +resist_fire -100 +wc -15 +see_invisible 1 +alive 1 +no_pick 1 +weight 200000 +run_away 4 +end +More +Object eternal_chinese_dragon_2 +name chinese dragon +face chinese_dr.x71 +animation chinese_dragon +alive 1 +x 1 +end +More +Object eternal_chinese_dragon_3 +name chinese dragon +face chinese_dr.x71 +animation chinese_dragon +alive 1 +y 1 +end +More +Object eternal_chinese_dragon_4 +name chinese dragon +face chinese_dr.x71 +animation chinese_dragon +alive 1 +x 1 +y 1 +end +Object legendary_chinese_dragon +editor_folder monster/dragon +name_pl Legendary dragons +name Legendary dragon +Wis 24 +hp 12000 +maxhp 12000 +maxsp 300 +exp 300000 +dam 70 +ac -12 +speed -0.300000 +level 90 +resist_magic 60 +carrying 75000 +randomitems legendary_chinese_dragon +race dragon +face chinese_dr.x71 +animation chinese_dragon +monster 1 +move_type walk +sleep 1 +Con 4 +Pow 32 +can_cast_spell 1 +resist_cold 100 +resist_fear 100 +resist_blind 100 +resist_fire -100 +wc -15 +see_invisible 1 +alive 1 +no_pick 1 +weight 200000 +run_away 4 +end +More +Object legendary_chinese_dragon_2 +name chinese dragon +face chinese_dr.x71 +animation chinese_dragon +alive 1 +x 1 +end +More +Object legendary_chinese_dragon_3 +name chinese dragon +face chinese_dr.x71 +animation chinese_dragon +alive 1 +y 1 +end +More +Object legendary_chinese_dragon_4 +name chinese dragon +face chinese_dr.x71 +animation chinese_dragon +alive 1 +x 1 +y 1 +end Object Cwyvern editor_folder monster/dragon name wyvern of chaos @@ -27848,7 +28101,6 @@ speed 0.4 attacktype 2065 can_see_in_dark 1 -can_use_rod 0 will_apply 4 Con 10 Pow 32 @@ -27862,7 +28114,7 @@ resist_magic 80 resist_blind 100 resist_fire -20 -resist_ice 100 +resist_cold 100 resist_paralyze 90 resist_fear 100 weight 75000 @@ -30223,10 +30475,10 @@ alive 1 hp 10000 maxhp 10000 -exp 5000 +exp 30000 dam 70 -wc -50 -ac -100 +wc -20 +ac -30 resist_physical 100 speed .4 level 30 @@ -30698,7 +30950,7 @@ alive 1 exp 1000 level 20 -ac -100 +ac -50 can_see_in_dark 1 Str 30 Dex 20 @@ -32028,7 +32280,7 @@ name blue dragon race dragon randomitems dragon_player_items -face pl_dragon.151 +face pl_dragon_blue.151 animation blue_dragon1 monster 1 move_type walk @@ -33753,7 +34005,7 @@ monster 1 move_type walk alive 1 -ac -80 +ac -50 wc -50 dam 200 hp 3300 @@ -37489,10 +37741,10 @@ hp 30000 maxhp 30000 maxsp 40 -exp 10000 +exp 100000 dam 200 wc -100 -ac -100 +ac -50 speed 0.150000 level 50 resist_physical 50 @@ -37554,7 +37806,7 @@ resist_slow 100 resist_cancellation 65 resist_counterspell 65 -ac -70 +ac -50 wc -70 maxsp 10000 sp 10000 @@ -41363,7 +41615,7 @@ exp 3 neutral 1 no_drop 1 -face pl_dragon.151 +face pl_dragon_blue.151 animation pl_dragon_blue is_animated 1 anim_speed -1 @@ -44618,6 +44870,76 @@ x 1 y 1 end +Object store_bows +editor_folder shop/shop +name shop +face store_bow.x11 +type 66 +no_pick 1 +move_block all +client_type 25012 +end +More +Object store_bows_2 +name shop +face store_bow.x11 +type 66 +no_pick 1 +move_block all +x 1 +end +More +Object store_bows_3 +name shop +face store_bow.x11 +type 66 +no_pick 1 +y 1 +end +More +Object store_bows_4 +name shop +face store_bow.x11 +type 66 +no_pick 1 +x 1 +y 1 +end +Object store_gems +editor_folder shop/shop +name shop +face store_gems.x11 +type 66 +no_pick 1 +move_block all +client_type 25012 +end +More +Object store_gems_2 +name shop +face store_gems.x11 +type 66 +no_pick 1 +move_block all +x 1 +end +More +Object store_gems_3 +name shop +face store_gems.x11 +type 66 +no_pick 1 +y 1 +end +More +Object store_gems_4 +name shop +face store_gems.x11 +type 66 +no_pick 1 +x 1 +y 1 +end Object store_general editor_folder shop/shop name shop @@ -45002,67 +45324,6 @@ x 1 y 1 end -Object experience_agility -editor_folder skills/Old -name agility -type 44 -invisible 1 -no_drop 1 -level 1 -exp 0 -Dex 1 -end -Object experience_charisma -editor_folder skills/Old -name personality -type 44 -invisible 1 -no_drop 1 -level 1 -exp 0 -Cha 1 -end -Object experience_mental -editor_folder skills/Old -name mental -type 44 -invisible 1 -no_drop 1 -level 1 -exp 0 -Int 1 -end -Object experience_physical -editor_folder skills/Old -name physique -type 44 -invisible 1 -no_drop 1 -level 1 -exp 0 -Con 1 -Str 1 -end -Object experience_power -editor_folder skills/Old -name magic -type 44 -invisible 1 -no_drop 1 -level 1 -exp 0 -Pow 1 -end -Object experience_wis -editor_folder skills/Old -name wisdom -type 44 -invisible 1 -no_drop 1 -level 1 -exp 0 -Wis 1 -end Object scroll_alchemy editor_folder skills/Skill_Scrolls name scroll of alchemistry @@ -46024,6 +46285,7 @@ body_skill -1 exp 0 level 100 +anim_suffix praying end Object skill_punching editor_folder skills/skills @@ -46227,6 +46489,7 @@ Object skill_wraith_feed editor_folder skills/skills name wraith feed +anim_suffix feeding skill wraith feed type 43 invisible 1 @@ -46245,6 +46508,7 @@ anim_suffix spellcasting name ball lightning ability name_pl ball lightning ability +face spell_ball_lightning.111 type 101 subtype 35 level 9 @@ -46268,6 +46532,7 @@ anim_suffix spellcasting name burning hands ability name_pl burning hands ability +face spell_burning_hands.111 level 1 sp 5 casting_time 5 @@ -46292,6 +46557,7 @@ anim_suffix spellcasting name fear ability name_pl fear ability +face spell_fear.111 level 4 sp 6 casting_time 5 @@ -46316,6 +46582,7 @@ anim_suffix spellcasting name create fire wall ability name_pl create fire wall ability +face spell_create_fire_wall.111 level 6 sp 5 casting_time 4 @@ -46341,6 +46608,7 @@ anim_suffix spellcasting name create frost wall ability name_pl create frost wall ability +face spell_create_frost_wall.111 level 8 sp 8 casting_time 3 @@ -46366,6 +46634,7 @@ anim_suffix spellcasting name frostbolt ability name_pl frostbolts ability +face spell_frostbolt.111 level 3 sp 12 casting_time 3 @@ -46389,6 +46658,7 @@ anim_suffix spellcasting name icestorm ability name_pl icestorm ability +face spell_icestorm.111 level 1 sp 5 casting_time 3 @@ -46413,6 +46683,7 @@ anim_suffix spellcasting name large icestorm ability name_pl large icestorm ability +face spell_large_icestorm.111 level 12 sp 13 casting_time 4 @@ -46437,6 +46708,7 @@ anim_suffix spellcasting name medium fireball ability name_pl medium fireball ability +face spell_medium_fireball.111 level 3 sp 10 casting_time 10 @@ -46461,6 +46733,7 @@ anim_suffix spellcasting name poison cloud ability name_pl poison cloud ability +face spell_poison_cloud.111 level 2 sp 5 casting_time 10 @@ -46485,6 +46758,7 @@ anim_suffix spellcasting name slow ability name_pl slow ability +face spell_slow.111 level 1 sp 5 casting_time 10 @@ -46509,6 +46783,7 @@ anim_suffix spellcasting name dragonbreath ability name_pl dragonbreath ability +face spell_dragonbreath.111 level 12 sp 13 casting_time 5 @@ -46561,7 +46836,7 @@ name_pl animate weapon type 101 subtype 41 -face spell_sorcery.111 +face spell_animate_weapon.111 level 7 value 70 sp 25 @@ -46588,7 +46863,7 @@ name_pl staff to snake type 101 subtype 41 -face spell_praying.111 +face spell_staff_to_snake.111 level 6 value 20 grace 8 @@ -46666,7 +46941,7 @@ name_pl flaming aura type 101 subtype 46 -face spell_praying.111 +face spell_flaming_aura.111 level 1 value 10 grace 5 @@ -46693,7 +46968,7 @@ name_pl sanctuary type 101 subtype 46 -face spell_praying.111 +face spell_sanctuary.111 level 14 value 70 grace 30 @@ -46716,7 +46991,7 @@ anim_suffix spellcasting name bless name_pl bless -face spell_praying.111 +face spell_bless.111 level 4 grace 8 casting_time 5 @@ -46765,7 +47040,7 @@ anim_suffix spellcasting name curse name_pl curse -face spell_praying.111 +face spell_curse.111 level 4 grace 8 casting_time 5 @@ -46814,7 +47089,7 @@ anim_suffix spellcasting name holy possession name_pl holy possession -face spell_praying.111 +face spell_holy_possession.111 level 18 grace 30 casting_time 10 @@ -46945,7 +47220,7 @@ anim_suffix spellcasting name cancellation name_pl cancellation -face spell_evocation.111 +face spell_cancellation.111 level 20 sp 30 casting_time 10 @@ -46969,7 +47244,7 @@ anim_suffix spellcasting name firebolt name_pl firebolt -face spell_pyromancy.111 +face spell_firebolt.111 level 4 sp 9 casting_time 10 @@ -46996,7 +47271,7 @@ anim_suffix spellcasting name forked lightning name_pl forked lightnings -face spell_praying.111 +face spell_forked_lightning.111 level 8 grace 15 maxgrace 24 @@ -47025,7 +47300,7 @@ anim_suffix spellcasting name frostbolt name_pl frostbolts -face spell_evocation.111 +face spell_frostbolt.111 level 6 sp 12 casting_time 10 @@ -47052,7 +47327,7 @@ anim_suffix spellcasting name large lightning name_pl large lightnings -face spell_pyromancy.111 +face spell_large_lightning.111 level 8 sp 13 casting_time 7 @@ -47079,7 +47354,7 @@ anim_suffix spellcasting name mana bolt name_pl mana bolts -face spell_evocation.111 +face spell_manabolt.111 level 6 sp 18 maxsp 30 @@ -47133,7 +47408,7 @@ anim_suffix spellcasting name small lightning name_pl small lightnings -face spell_pyromancy.111 +face spell_sm_lightning.111 level 1 sp 6 casting_time 5 @@ -47160,7 +47435,7 @@ anim_suffix spellcasting name steambolt name_pl steambolts -face spell_sorcery.111 +face spell_steambolt.111 level 10 sp 10 maxsp 40 @@ -47188,7 +47463,7 @@ anim_suffix spellcasting name sunspear name_pl sunspears -face spell_praying.111 +face spell_sunspear.111 level 12 grace 8 dam 8 @@ -47266,7 +47541,7 @@ anim_suffix spellcasting name create bomb name_pl create bomb -face spell_pyromancy.111 +face spell_create_bomb.111 level 12 sp 10 casting_time 5 @@ -47406,6 +47681,7 @@ end Object cause_wounds editor_folder spell/Bullet +name cause wounds type 102 subtype 5 face cause.111 @@ -47628,7 +47904,7 @@ anim_suffix spellcasting name magic bullet name_pl magic bullet -face spell_sorcery.111 +face spell_magic_bullet.111 level 1 sp 1 casting_time 2 @@ -47653,7 +47929,7 @@ anim_suffix spellcasting name cause critical wounds name_pl cause critical wounds -face spell_praying.111 +face spell_cause_critical_wounds.111 level 14 grace 25 casting_time 5 @@ -47678,7 +47954,7 @@ anim_suffix spellcasting name cause heavy wounds name_pl cause heavy wounds -face spell_praying.111 +face spell_cause_heavy_wounds.111 level 10 grace 16 casting_time 5 @@ -47703,7 +47979,7 @@ anim_suffix spellcasting name cause light wounds name_pl cause light wounds -face spell_praying.111 +face spell_cause_light_wounds.111 level 1 grace 4 casting_time 5 @@ -47728,7 +48004,7 @@ anim_suffix spellcasting name cause medium wounds name_pl cause medium wounds -face spell_praying.111 +face spell_cause_medium_wounds.111 level 6 grace 8 casting_time 5 @@ -47753,7 +48029,7 @@ anim_suffix spellcasting name comet name_pl comet -face spell_pyromancy.111 +face spell_comet.111 level 16 value 80 sp 15 @@ -47782,7 +48058,7 @@ anim_suffix spellcasting name hellfire name_pl hellfire -face spell_pyromancy.111 +face spell_hellfire.111 level 16 sp 13 casting_time 8 @@ -47810,7 +48086,7 @@ anim_suffix spellcasting name holy orb name_pl holy orb -face spell_praying.111 +face spell_holy_orb.111 level 14 grace 10 casting_time 5 @@ -47840,7 +48116,7 @@ anim_suffix spellcasting name large fireball name_pl large fireball -face spell_pyromancy.111 +face spell_large_fireball.111 level 10 sp 16 casting_time 8 @@ -47868,7 +48144,7 @@ anim_suffix spellcasting name large manaball name_pl large manaball -face spell_evocation.111 +face spell_large_manaball.111 level 12 sp 32 casting_time 9 @@ -47896,7 +48172,7 @@ anim_suffix spellcasting name large snowstorm name_pl large snowstorm -face spell_evocation.111 +face spell_large_snowstorm.111 level 10 sp 16 casting_time 6 @@ -47924,7 +48200,7 @@ anim_suffix spellcasting name large bullet name_pl large bullet -face spell_evocation.111 +face spell_lg_magic_bullet.111 level 8 sp 3 casting_time 6 @@ -47949,7 +48225,7 @@ anim_suffix spellcasting name medium fireball name_pl medium fireball -face spell_pyromancy.111 +face spell_medium_fireball.111 level 6 sp 10 casting_time 10 @@ -47977,7 +48253,7 @@ anim_suffix spellcasting name medium manaball name_pl medium manaball -face spell_evocation.111 +face spell_medium_manaball.111 level 8 sp 6 casting_time 18 @@ -48005,7 +48281,7 @@ anim_suffix spellcasting name medium snowstorm name_pl medium snowstorm -face spell_evocation.111 +face spell_medium_snowstorm.111 level 6 sp 10 casting_time 5 @@ -48033,7 +48309,7 @@ anim_suffix spellcasting name poison cloud name_pl poison cloud -face spell_sorcery.111 +face spell_poison_cloud.111 level 4 sp 5 casting_time 10 @@ -48110,7 +48386,7 @@ anim_suffix spellcasting name small fireball name_pl small fireball -face spell_pyromancy.111 +face spell_small_fireball.111 level 1 sp 6 casting_time 5 @@ -48138,7 +48414,7 @@ anim_suffix spellcasting name small manaball name_pl small manaball -face spell_evocation.111 +face spell_small_manaball.111 level 4 sp 12 casting_time 9 @@ -48166,7 +48442,7 @@ anim_suffix spellcasting name small snowstorm name_pl small snowstorm -face spell_evocation.111 +face spell_small_snowstorm.111 level 1 sp 6 casting_time 5 @@ -48195,7 +48471,7 @@ anim_suffix spellcasting name vitriol name_pl vitriol -face spell_praying.111 +face spell_vitriol.111 level 10 grace 15 casting_time 10 @@ -48294,7 +48570,7 @@ anim_suffix spellcasting name armour name_pl armour -face spell_evocation.111 +face spell_armour.111 level 1 sp 8 casting_time 10 @@ -48320,7 +48596,7 @@ anim_suffix spellcasting name charisma name_pl charisma -face spell_sorcery.111 +face spell_charisma.111 level 6 sp 12 casting_time 20 @@ -48343,7 +48619,7 @@ anim_suffix spellcasting name confusion name_pl confusion -face spell_sorcery.111 +face spell_confusion.111 level 2 sp 10 casting_time 10 @@ -48367,7 +48643,7 @@ anim_suffix spellcasting name constitution name_pl constitution -face spell_sorcery.111 +face spell_constitution.111 level 4 sp 15 casting_time 20 @@ -48390,7 +48666,7 @@ anim_suffix spellcasting name dark vision name_pl dark vision -face spell_sorcery.111 +face spell_dark_vision.111 level 5 sp 10 casting_time 12 @@ -48414,7 +48690,7 @@ anim_suffix spellcasting name defense name_pl defense -face spell_praying.111 +face spell_defense.111 level 40 grace 75 casting_time 30 @@ -48454,7 +48730,7 @@ anim_suffix spellcasting name dexterity name_pl dexterity -face spell_sorcery.111 +face spell_dexterity.111 level 3 sp 12 casting_time 20 @@ -48474,6 +48750,7 @@ anim_suffix spellcasting name haste name_pl haste +face spell_haste.111 level 12 sp 50 casting_time 10 @@ -48493,6 +48770,7 @@ anim_suffix spellcasting name heroism name_pl heroism +face spell_heroism.111 level 10 sp 50 casting_time 10 @@ -48556,7 +48834,7 @@ anim_suffix spellcasting name iron skin name_pl iron skin -face spell_praying.111 +face spell_iron_skin.111 level 1 grace 8 casting_time 10 @@ -48582,7 +48860,7 @@ anim_suffix spellcasting name levitate name_pl levitate -face spell_sorcery.111 +face spell_levitate.111 level 6 sp 10 casting_time 10 @@ -48605,7 +48883,7 @@ anim_suffix spellcasting name protection from attack name_pl protection from attack -face spell_praying.111 +face spell_protection_from_attack.111 level 16 grace 50 casting_time 15 @@ -48630,7 +48908,7 @@ anim_suffix spellcasting name protection from cancellation name_pl protection from cancellation -face spell_praying.111 +face spell_protection_from_cancellation.111 level 12 grace 30 casting_time 10 @@ -48655,7 +48933,7 @@ anim_suffix spellcasting name protection from cold name_pl protection from cold -face spell_praying.111 +face spell_protection_from_cold.111 level 2 grace 15 casting_time 10 @@ -48680,7 +48958,7 @@ anim_suffix spellcasting name protection from confusion name_pl protection from confusion -face spell_praying.111 +face spell_protection_from_confusion.111 level 4 grace 20 casting_time 10 @@ -48705,7 +48983,7 @@ anim_suffix spellcasting name protection from depletion name_pl protection from depletion -face spell_praying.111 +face spell_protection_from_depletion.111 level 6 grace 20 casting_time 10 @@ -48730,7 +49008,7 @@ anim_suffix spellcasting name protection from draining name_pl protection from draining -face spell_praying.111 +face spell_protection_from_draining.111 level 8 grace 25 casting_time 10 @@ -48755,7 +49033,7 @@ anim_suffix spellcasting name protection from electricity name_pl protection from electricity -face spell_praying.111 +face spell_protection_from_electricity.111 level 3 grace 15 casting_time 10 @@ -48780,7 +49058,7 @@ anim_suffix spellcasting name protection from fire name_pl protection from fire -face spell_praying.111 +face spell_protection_from_fire.111 level 2 grace 20 casting_time 10 @@ -48805,7 +49083,7 @@ anim_suffix spellcasting name protection from magic name_pl protection from magic -face spell_praying.111 +face spell_protection_from_magic.111 level 10 grace 30 casting_time 12 @@ -48830,7 +49108,7 @@ anim_suffix spellcasting name protection from paralysis name_pl protection from paralysis -face spell_praying.111 +face spell_protection_from_paralysis.111 level 6 grace 20 casting_time 10 @@ -48855,7 +49133,7 @@ anim_suffix spellcasting name protection from poison name_pl protection from poison -face spell_praying.111 +face spell_protection_from_poison.111 level 2 grace 20 casting_time 10 @@ -48880,7 +49158,7 @@ anim_suffix spellcasting name protection from slow name_pl protection from slow -face spell_praying.111 +face spell_protection_from_slow.111 level 4 grace 20 casting_time 10 @@ -48905,7 +49183,7 @@ anim_suffix spellcasting name rage name_pl rage -face spell_praying.111 +face spell_rage.111 level 1 grace 5 casting_time 10 @@ -48937,7 +49215,7 @@ anim_suffix spellcasting name regeneration name_pl regeneration -face spell_praying.111 +face spell_regeneration.111 level 14 grace 15 casting_time 10 @@ -48962,7 +49240,7 @@ anim_suffix spellcasting name strength name_pl strength -face spell_sorcery.111 +face spell_strength.111 level 2 sp 10 casting_time 20 @@ -48985,7 +49263,7 @@ anim_suffix spellcasting name xray name_pl xray -face spell_sorcery.111 +face spell_xray.111 level 10 sp 20 casting_time 20 @@ -49244,7 +49522,7 @@ anim_suffix spellcasting name banishment name_pl banishment -face spell_praying.111 +face spell_banishment.111 level 10 grace 10 casting_time 10 @@ -49272,7 +49550,7 @@ anim_suffix spellcasting name burning hands name_pl burning hands -face spell_pyromancy.111 +face spell_burning_hands.111 level 1 sp 5 casting_time 5 @@ -49302,7 +49580,7 @@ anim_suffix spellcasting name color spray name_pl color spray -face spell_sorcery.111 +face spell_color_spray.111 level 26 sp 35 casting_time 2 @@ -49330,7 +49608,7 @@ anim_suffix spellcasting name counterspell name_pl counterspell -face spell_summoner.111 +face spell_counterspell.111 level 6 sp 10 casting_time 2 @@ -49358,7 +49636,7 @@ anim_suffix spellcasting name dragonbreath name_pl dragonbreath -face spell_pyromancy.111 +face spell_dragonbreath.111 level 24 sp 13 casting_time 5 @@ -49386,7 +49664,7 @@ anim_suffix spellcasting name face of death name_pl face of death -face spell_praying.111 +face spell_face_of_death.111 level 34 grace 80 casting_time 10 @@ -49414,7 +49692,7 @@ anim_suffix spellcasting name fear name_pl fear -face spell_sorcery.111 +face spell_fear.111 level 4 sp 6 casting_time 5 @@ -49442,7 +49720,7 @@ anim_suffix spellcasting name holy word name_pl holy word -face spell_praying.111 +face spell_holy_word.111 level 1 grace 4 casting_time 1 @@ -49470,7 +49748,7 @@ anim_suffix spellcasting name icestorm name_pl icestorm -face spell_evocation.111 +face spell_icestorm.111 level 1 sp 5 casting_time 8 @@ -49498,7 +49776,7 @@ anim_suffix spellcasting name large icestorm name_pl large icestorm -face spell_evocation.111 +face spell_large_icestorm.111 level 24 sp 13 casting_time 9 @@ -49526,7 +49804,7 @@ anim_suffix spellcasting name mana blast name_pl mana blast -face spell_evocation.111 +face spell_mana_blast.111 level 4 sp 10 casting_time 7 @@ -49554,7 +49832,7 @@ anim_suffix spellcasting name mass confusion name_pl mass confusion -face spell_sorcery.111 +face spell_mass_confusion.111 level 7 sp 20 casting_time 10 @@ -49582,7 +49860,7 @@ anim_suffix spellcasting name paralyze name_pl paralyze -face spell_sorcery.111 +face spell_paralyze.111 level 2 sp 5 casting_time 10 @@ -49610,7 +49888,7 @@ anim_suffix spellcasting name peace name_pl peace -face spell_praying.111 +face spell_peace.111 level 40 grace 80 casting_time 10 @@ -49638,7 +49916,7 @@ anim_suffix spellcasting name shockwave name_pl shockwave -face spell_evocation.111 +face spell_shockwave.111 level 28 sp 26 casting_time 9 @@ -49666,7 +49944,7 @@ anim_suffix spellcasting name slow name_pl slow -face spell_sorcery.111 +face spell_slow.111 level 1 sp 5 casting_time 10 @@ -49694,6 +49972,7 @@ anim_suffix spellcasting name spark shower name_pl spark shower +face spell_spark_shower.111 level 1 sp 5 casting_time 6 @@ -49721,7 +50000,7 @@ anim_suffix spellcasting name spiderweb name_pl spiderweb -face spell_praying.111 +face spell_spiderweb.111 level 8 grace 10 casting_time 10 @@ -49749,7 +50028,7 @@ anim_suffix spellcasting name turn undead name_pl turn undead -face spell_praying.111 +face spell_turn_undead.111 level 1 grace 2 casting_time 5 @@ -49777,7 +50056,7 @@ anim_suffix spellcasting name vitriol splash name_pl vitriol splash -face spell_praying.111 +face spell_vitriol_splash.111 level 10 grace 15 casting_time 10 @@ -49805,7 +50084,7 @@ anim_suffix spellcasting name wave name_pl wave -face spell_praying.111 +face spell_wave.111 level 6 grace 8 casting_time 10 @@ -49833,7 +50112,7 @@ anim_suffix spellcasting name windstorm name_pl windstorm -face spell_praying.111 +face spell_windstorm.111 level 6 grace 3 casting_time 10 @@ -49861,7 +50140,7 @@ anim_suffix spellcasting name wonder name_pl wonder -face spell_sorcery.111 +face spell_wonder.111 level 3 sp 10 casting_time 0 @@ -49890,7 +50169,7 @@ anim_suffix spellcasting name wrathful eye name_pl wrathful eye -face spell_praying.111 +face spell_wrathful_eye.111 level 10 grace 30 casting_time 8 @@ -50020,7 +50299,7 @@ anim_suffix spellcasting name detect curse name_pl detect curse -face spell_praying.111 +face spell_detect_curse.111 level 10 grace 10 casting_time 20 @@ -50044,7 +50323,7 @@ anim_suffix spellcasting name detect evil name_pl detect evil -face spell_praying.111 +face spell_detect_evil.111 level 6 grace 3 casting_time 15 @@ -50068,7 +50347,7 @@ anim_suffix spellcasting name detect magic name_pl detect magic -face spell_sorcery.111 +face spell_detect_magic.111 level 1 sp 1 casting_time 13 @@ -50092,7 +50371,7 @@ anim_suffix spellcasting name detect monster name_pl detect monster -face spell_evocation.111 +face spell_detect_monster.111 level 4 sp 2 casting_time 15 @@ -50116,7 +50395,7 @@ anim_suffix spellcasting name show invisible name_pl show invisible -face spell_praying.111 +face spell_show_invisible.111 level 14 grace 10 casting_time 20 @@ -50140,7 +50419,7 @@ anim_suffix spellcasting name cause anthrax name_pl cause anthrax -face spell_praying.111 +face spell_cause_anthrax.111 type 101 subtype 45 level 24 @@ -50168,7 +50447,7 @@ name_pl cause black death type 101 subtype 45 -face spell_praying.111 +face spell_cause_black_death.111 level 30 value 150 grace 120 @@ -50196,7 +50475,7 @@ name_pl cause cold type 101 subtype 45 -face spell_praying.111 +face spell_cause_cold.111 level 2 value 20 grace 10 @@ -50220,7 +50499,7 @@ anim_suffix spellcasting name cause flu name_pl cause flu -face spell_praying.111 +face spell_cause_flu.111 type 101 subtype 45 level 4 @@ -50246,7 +50525,7 @@ anim_suffix spellcasting name cause leprosy name_pl cause leprosy -face spell_praying.111 +face spell_cause_leprosy.111 type 101 subtype 45 level 10 @@ -50272,7 +50551,7 @@ anim_suffix spellcasting name cause rabies name_pl cause rabies -face spell_praying.111 +face spell_cause_rabies.111 type 101 subtype 45 level 24 @@ -50298,7 +50577,7 @@ anim_suffix spellcasting name cause red death name_pl cause red death -face spell_praying.111 +face spell_cause_red_death.111 type 101 subtype 45 level 24 @@ -50324,7 +50603,7 @@ anim_suffix spellcasting name cause smallpox name_pl cause smallpox -face spell_praying.111 +face spell_cause_smallpox.111 type 101 subtype 45 level 20 @@ -50350,7 +50629,7 @@ anim_suffix spellcasting name cause typhoid name_pl cause typhoid -face spell_praying.111 +face spell_cause_typhoid.111 type 101 subtype 45 level 16 @@ -50376,7 +50655,7 @@ anim_suffix spellcasting name cause white death name_pl cause white death -face spell_praying.111 +face spell_cause_white_death.111 type 101 subtype 45 level 85 @@ -50484,7 +50763,7 @@ anim_suffix spellcasting name call holy servant name_pl call holy servant -face spell_praying.111 +face spell_call_holy_servant.111 level 12 grace 30 casting_time 5 @@ -50502,6 +50781,7 @@ no_drop 1 invisible 1 skill praying +wc_increase_rate 4 end Object spell_dancing_sword editor_folder spell/Golem @@ -50511,7 +50791,7 @@ anim_suffix spellcasting name dancing sword name_pl dancing sword -face spell_summoner.111 +face spell_dancing_sword.111 type 101 subtype 12 level 12 @@ -50530,6 +50810,7 @@ attacktype 1 no_drop 1 invisible 1 +wc_increase_rate 4 end Object spell_summon_golem editor_folder spell/Golem @@ -50539,7 +50820,7 @@ anim_suffix spellcasting name summon golem name_pl summon golem -face spell_summoner.111 +face spell_summon_golem.111 level 2 sp 5 casting_time 10 @@ -50558,6 +50839,7 @@ no_drop 1 invisible 1 skill summoning +wc_increase_rate 4 end Object spell_lesser_summon_golem editor_folder spell/Golem @@ -50585,6 +50867,7 @@ no_drop 1 invisible 1 skill summoning +wc_increase_rate 5 end Object spell_mystic_fist editor_folder spell/Golem @@ -50594,7 +50877,7 @@ anim_suffix spellcasting name mystic fist name_pl mystic fist -face spell_summoner.111 +face spell_mystic_fist.111 level 10 sp 10 casting_time 15 @@ -50613,6 +50896,7 @@ no_drop 1 invisible 1 skill summoning +wc_increase_rate 4 end Object spell_summon_air_elemental editor_folder spell/Golem @@ -50622,7 +50906,7 @@ anim_suffix spellcasting name summon air elemental name_pl summon air elemental -face spell_summoner.111 +face spell_summon_air_elemental.111 level 12 sp 20 casting_time 12 @@ -50641,6 +50925,7 @@ no_drop 1 invisible 1 skill summoning +wc_increase_rate 4 end Object spell_summon_avatar editor_folder spell/Golem @@ -50650,7 +50935,7 @@ anim_suffix spellcasting name summon avatar name_pl summon avatar -face spell_praying.111 +face spell_summon_avatar.111 level 20 grace 60 casting_time 15 @@ -50668,6 +50953,7 @@ no_drop 1 invisible 1 skill praying +wc_increase_rate 4 end Object spell_summon_devil editor_folder spell/Golem @@ -50677,7 +50963,7 @@ anim_suffix spellcasting name summon devil name_pl summon devil -face spell_summoner.111 +face spell_summon_devil.111 level 6 sp 20 casting_time 13 @@ -50696,6 +50982,7 @@ no_drop 1 invisible 1 skill summoning +wc_increase_rate 4 end Object spell_summon_earth_elemental editor_folder spell/Golem @@ -50705,7 +50992,7 @@ anim_suffix spellcasting name summon earth elemental name_pl summon earth elemental -face spell_summoner.111 +face spell_summon_earth_elemental.111 level 8 sp 15 casting_time 11 @@ -50724,6 +51011,7 @@ no_drop 1 invisible 1 skill summoning +wc_increase_rate 4 end Object spell_summon_fire_elemental editor_folder spell/Golem @@ -50733,7 +51021,7 @@ anim_suffix spellcasting name summon fire elemental name_pl summon fire elemental -face spell_summoner.111 +face spell_summon_fire_elemental.111 level 14 sp 25 casting_time 12 @@ -50752,6 +51040,7 @@ no_drop 1 invisible 1 skill summoning +wc_increase_rate 4 end Object spell_summon_water_elemental editor_folder spell/Golem @@ -50761,7 +51050,7 @@ anim_suffix spellcasting name summon water elemental name_pl summon water elemental -face spell_summoner.111 +face spell_summon_water_elemental.111 level 10 sp 15 casting_time 11 @@ -50780,6 +51069,7 @@ no_drop 1 invisible 1 skill summoning +wc_increase_rate 4 end Object healing editor_folder spell/Healing @@ -50802,7 +51092,7 @@ anim_suffix spellcasting name cure blindness name_pl cure blindness -face spell_praying.111 +face spell_cure_blindness.111 level 18 grace 30 casting_time 10 @@ -50824,7 +51114,7 @@ anim_suffix spellcasting name cure confusion name_pl cure confusion -face spell_praying.111 +face spell_cure_confusion.111 level 14 grace 8 casting_time 15 @@ -50846,7 +51136,7 @@ anim_suffix spellcasting name cure disease name_pl cure disease -face spell_praying.111 +face spell_cure_disease.111 level 10 grace 30 casting_time 10 @@ -50868,7 +51158,7 @@ anim_suffix spellcasting name cure poison name_pl cure poison -face spell_praying.111 +face spell_cure_poison.111 level 8 grace 7 casting_time 10 @@ -50890,7 +51180,7 @@ anim_suffix spellcasting name heal name_pl heal -face spell_praying.111 +face spell_heal.111 level 30 grace 50 casting_time 12 @@ -50913,7 +51203,7 @@ anim_suffix spellcasting name major healing name_pl major healing -face spell_praying.111 +face spell_major_healing.111 level 16 grace 10 casting_time 9 @@ -50936,7 +51226,7 @@ anim_suffix spellcasting name medium healing name_pl medium healing -face spell_praying.111 +face spell_medium_healing.111 level 8 grace 7 casting_time 6 @@ -50959,7 +51249,7 @@ anim_suffix spellcasting name minor healing name_pl minor healing -face spell_praying.111 +face spell_minor_healing.111 level 1 grace 4 casting_time 3 @@ -50979,6 +51269,7 @@ anim_suffix spellcasting name regenerate spellpoints name_pl regenerate spellpoints +face spell_regenerate_spellpoints.111 level 99 sp 0 casting_time 0 @@ -51000,7 +51291,7 @@ anim_suffix spellcasting name restoration name_pl restoration -face spell_praying.111 +face spell_restoration.111 level 32 grace 80 casting_time 15 @@ -51040,7 +51331,7 @@ anim_suffix spellcasting name magic missile name_pl magic missile -face spell_sorcery.111 +face spell_magic_missile.111 level 1 sp 1 casting_time 3 @@ -51210,7 +51501,7 @@ anim_suffix spellcasting name build bullet wall name_pl build bullet wall -face spell_evocation.111 +face spell_build_bullet_wall.111 type 101 subtype 15 level 24 @@ -51240,7 +51531,7 @@ anim_suffix spellcasting name build director name_pl build director -face spell_summoner.111 +face spell_build_director.111 type 101 subtype 15 level 20 @@ -51269,7 +51560,7 @@ anim_suffix spellcasting name build fireball wall name_pl build fireball wall -face spell_pyromancy.111 +face spell_build_fireball_wall.111 type 101 subtype 15 level 32 @@ -51299,7 +51590,7 @@ anim_suffix spellcasting name build lightning wall name_pl build lightning wall -face spell_pyromancy.111 +face spell_build_lightning_wall.111 type 101 subtype 15 level 28 @@ -51329,7 +51620,7 @@ anim_suffix spellcasting name counterwall name_pl counterwall -face spell_summoner.111 +face spell_counterwall.111 level 16 sp 8 attacktype 524288 @@ -51357,7 +51648,7 @@ anim_suffix spellcasting name create earth wall name_pl create earth wall -face spell_summoner.111 +face spell_create_earth_wall.111 level 8 sp 6 casting_time 12 @@ -51383,7 +51674,7 @@ anim_suffix spellcasting name create fire wall name_pl create fire wall -face spell_pyromancy.111 +face spell_create_fire_wall.111 level 12 sp 5 casting_time 10 @@ -51413,7 +51704,7 @@ anim_suffix spellcasting name create frost wall name_pl create frost wall -face spell_evocation.111 +face spell_create_frost_wall.111 level 16 sp 8 casting_time 10 @@ -51465,7 +51756,7 @@ anim_suffix spellcasting name create pool of chaos name_pl create pool of chaos -face spell_evocation.111 +face spell_create_pool_of_chaos.111 level 20 sp 10 casting_time 15 @@ -51495,7 +51786,7 @@ anim_suffix spellcasting name darkness name_pl darkness -face spell_praying.111 +face spell_darkness.111 level 10 grace 15 casting_time 5 @@ -51551,7 +51842,7 @@ anim_suffix spellcasting name wall of thorns name_pl wall of thorns -face spell_praying.111 +face spell_wall_of_thorns.111 level 12 grace 20 casting_time 5 @@ -51645,7 +51936,7 @@ anim_suffix spellcasting name alchemy name_pl alchemy -face spell_summoner.111 +face spell_alchemy.111 level 6 sp 5 casting_time 25 @@ -51668,7 +51959,7 @@ anim_suffix spellcasting name consecrate name_pl consecrate -face spell_praying.111 +face spell_consecrate.111 type 101 subtype 40 level 8 @@ -51688,7 +51979,7 @@ anim_suffix spellcasting name create food name_pl create food -face spell_summoner.111 +face spell_create_food.111 level 12 sp 10 casting_time 20 @@ -51711,7 +52002,7 @@ anim_suffix spellcasting name create missile name_pl create missile -face spell_summoner.111 +face spell_create_missile.111 type 101 subtype 39 level 1 @@ -51735,7 +52026,7 @@ anim_suffix spellcasting name daylight name_pl daylight -face spell_praying.111 +face spell_daylight.111 type 101 subtype 43 level 36 @@ -51756,7 +52047,7 @@ anim_suffix spellcasting name destruction name_pl destruction -face spell_sorcery.111 +face spell_destruction.111 level 30 sp 30 casting_time 10 @@ -51787,7 +52078,7 @@ anim_suffix spellcasting name dimension door name_pl dimension door -face spell_sorcery.111 +face spell_dimension_door.111 level 10 value 100 sp 25 @@ -51810,7 +52101,7 @@ anim_suffix spellcasting name disarm name_pl disarm -face spell_sorcery.111 +face spell_disarm.111 type 101 subtype 38 level 4 @@ -51830,7 +52121,7 @@ anim_suffix spellcasting name earth to dust name_pl earth to dust -face spell_summoner.111 +face spell_earth_to_dust.111 level 4 sp 5 casting_time 15 @@ -51854,7 +52145,7 @@ anim_suffix spellcasting name faery fire name_pl faery fire -face spell_pyromancy.111 +face spell_faery_fire.111 type 101 subtype 44 level 8 @@ -51880,7 +52171,7 @@ anim_suffix spellcasting name identify name_pl identify -face spell_sorcery.111 +face spell_identify.111 level 8 sp 60 casting_time 20 @@ -51903,7 +52194,7 @@ anim_suffix spellcasting name improved invisibility name_pl improved invisibility -face spell_sorcery.111 +face spell_improved_invisibility.111 level 8 sp 25 casting_time 10 @@ -51928,7 +52219,7 @@ anim_suffix spellcasting name invisible name_pl invisible -face spell_sorcery.111 +face spell_invisible.111 level 6 sp 15 casting_time 5 @@ -51952,7 +52243,7 @@ anim_suffix spellcasting name invisible to undead name_pl invisible to undead -face spell_praying.111 +face spell_invisible_to_undead.111 level 12 grace 25 casting_time 5 @@ -51977,7 +52268,7 @@ anim_suffix spellcasting name light name_pl light -face spell_praying.111 +face spell_light.111 type 101 subtype 42 level 1 @@ -52006,7 +52297,7 @@ anim_suffix spellcasting name magic drain name_pl magic drain -face spell_sorcery.111 +face spell_magic_drain.111 type 101 subtype 37 level 12 @@ -52029,7 +52320,7 @@ anim_suffix spellcasting name magic mapping name_pl magic mapping -face spell_sorcery.111 +face spell_magic_mapping.111 level 5 sp 15 casting_time 1 @@ -52050,7 +52341,7 @@ anim_suffix spellcasting name marking rune name_pl marking rune -face spell_sorcery.111 +face spell_marking_rune.111 type 101 subtype 3 level 1 @@ -52071,7 +52362,7 @@ anim_suffix spellcasting name nightfall name_pl nightfall -face spell_praying.111 +face spell_nightfall.111 type 101 subtype 43 level 32 @@ -52094,7 +52385,7 @@ anim_suffix spellcasting name perceive self name_pl perceive self -face spell_praying.111 +face spell_perceive_self.111 level 4 grace 5 casting_time 1 @@ -52111,6 +52402,7 @@ msg Converts a living object into another monster of some sort, or transforms an object to another type of object. endmsg +face spell_polymorph.111 anim_suffix spellcasting name polymorph name_pl polymorph @@ -52136,7 +52428,7 @@ anim_suffix spellcasting name probe name_pl probe -face spell_sorcery.111 +face spell_probe.111 level 1 sp 3 casting_time 2 @@ -52158,6 +52450,7 @@ anim_suffix spellcasting name charging name_pl charging +face spell_charging.111 level 10 sp 200 casting_time 75 @@ -52179,7 +52472,7 @@ anim_suffix spellcasting name remove curse name_pl remove curse -face spell_praying.111 +face spell_remove_curse.111 level 16 grace 80 casting_time 20 @@ -52201,7 +52494,7 @@ anim_suffix spellcasting name remove damnation name_pl remove damnation -face spell_praying.111 +face spell_remove_damnation.111 level 30 grace 150 casting_time 25 @@ -52223,7 +52516,7 @@ anim_suffix spellcasting name transference name_pl transference -face spell_sorcery.111 +face spell_transference.111 type 101 subtype 37 level 5 @@ -52246,7 +52539,7 @@ anim_suffix spellcasting name word of recall name_pl word of recall -face spell_praying.111 +face spell_word_of_recall.111 level 20 grace 40 casting_time 15 @@ -52277,6 +52570,7 @@ msg Aggravation is used to change the mood of unagressive creatures so that they attack the caster. endmsg +face spell_aggravation.111 anim_suffix spellcasting name aggravation name_pl aggravation @@ -52302,7 +52596,7 @@ anim_suffix spellcasting name charm monsters name_pl charm monsters -face spell_summoner.111 +face spell_charm_monsters.111 level 15 sp 20 casting_time 10 @@ -52327,7 +52621,7 @@ anim_suffix spellcasting name command undead name_pl command undead -face spell_praying.111 +face spell_command_undead.111 level 10 grace 12 casting_time 10 @@ -52354,7 +52648,7 @@ anim_suffix spellcasting name conflict name_pl conflict -face spell_praying.111 +face spell_conflict.111 level 20 grace 50 casting_time 10 @@ -52379,7 +52673,7 @@ anim_suffix spellcasting name pacify name_pl pacify -face spell_praying.111 +face spell_pacify.111 level 8 grace 10 casting_time 2 @@ -52505,7 +52799,7 @@ anim_suffix spellcasting name ball lightning name_pl ball lightning -face spell_evocation.111 +face spell_ball_lightning.111 type 101 subtype 35 level 18 @@ -52532,7 +52826,7 @@ anim_suffix spellcasting name divine shock name_pl divine shock -face spell_praying.111 +face spell_divine_shock.111 type 101 subtype 35 level 10 @@ -52587,7 +52881,7 @@ anim_suffix spellcasting name poison fog name_pl poison fog -face spell_praying.111 +face spell_poison_fog.111 type 101 subtype 35 level 10 @@ -52674,7 +52968,7 @@ anim_suffix spellcasting name raise dead name_pl raise dead -face spell_praying.111 +face spell_raise_dead.111 type 101 subtype 1 level 10 @@ -52697,7 +52991,7 @@ anim_suffix spellcasting name reincarnation name_pl reincarnation -face spell_praying.111 +face spell_reincarnation.111 type 101 subtype 1 level 25 @@ -52719,7 +53013,7 @@ anim_suffix spellcasting name resurrection name_pl resurrection -face spell_praying.111 +face spell_resurrection.111 type 101 subtype 1 level 20 @@ -53326,7 +53620,7 @@ anim_suffix spellcasting name antimagic rune name_pl antimagic rune -face spell_sorcery.111 +face spell_antimagic_rune.111 type 101 subtype 2 no_drop 1 @@ -53390,7 +53684,7 @@ anim_suffix spellcasting name magic rune name_pl magic rune -face generic_rune.111 +face spell_magic_rune.111 type 101 subtype 2 no_drop 1 @@ -53432,7 +53726,7 @@ anim_suffix spellcasting name rune of blasting name_pl rune of blasting -face spell_pyromancy.111 +face spell_rune_of_blasting.111 type 101 subtype 2 no_drop 1 @@ -53453,7 +53747,7 @@ anim_suffix spellcasting name rune of death name_pl rune of death -face spell_sorcery.111 +face spell_rune_of_death.111 type 101 subtype 2 no_drop 1 @@ -53474,7 +53768,7 @@ anim_suffix spellcasting name rune of fire name_pl rune of fire -face spell_pyromancy.111 +face spell_rune_of_fire.111 type 101 subtype 2 no_drop 1 @@ -53495,7 +53789,7 @@ anim_suffix spellcasting name rune of frost name_pl rune of frost -face spell_evocation.111 +face spell_rune_of_frost.111 type 101 subtype 2 no_drop 1 @@ -53516,7 +53810,7 @@ anim_suffix spellcasting name rune of magic drain name_pl rune of magic drain -face spell_evocation.111 +face spell_rune_of_magic_drain.111 type 101 subtype 2 no_drop 1 @@ -53537,7 +53831,7 @@ anim_suffix spellcasting name rune of shocking name_pl rune of shocking -face spell_pyromancy.111 +face spell_rune_of_shocking.111 type 101 subtype 2 no_drop 1 @@ -53558,7 +53852,7 @@ anim_suffix spellcasting name rune of transference name_pl rune of transference -face spell_sorcery.111 +face spell_rune_of_transference.111 type 101 subtype 2 other_arch rune_transferrence @@ -53846,7 +54140,7 @@ anim_suffix spellcasting name finger of death name_pl finger of death -face spell_praying.111 +face spell_finger_of_death.111 type 101 subtype 10 level 28 @@ -53873,7 +54167,7 @@ anim_suffix spellcasting name holy wrath name_pl holy wrath -face spell_praying.111 +face spell_holy_wrath.111 type 101 subtype 10 level 24 @@ -53901,7 +54195,7 @@ anim_suffix spellcasting name insect plague name_pl insect plague -face spell_praying.111 +face spell_insect_plague.111 type 101 subtype 10 level 18 @@ -53929,7 +54223,7 @@ anim_suffix spellcasting name retributive strike name_pl retributive strike -face spell_praying.111 +face spell_retributive_strike.111 type 101 subtype 10 level 36 @@ -54139,7 +54433,7 @@ anim_suffix spellcasting name large speedball name_pl large speedball -face spell_evocation.111 +face spell_large_speedball.111 type 101 subtype 27 level 6 @@ -54193,7 +54487,7 @@ anim_suffix spellcasting name small speedball name_pl small speedball -face spell_evocation.111 +face spell_small_speedball.111 type 101 subtype 27 level 3 @@ -54215,7 +54509,7 @@ anim_suffix spellcasting name summon cult monsters name_pl summon cult monsters -face spell_praying.111 +face spell_summon_cult_monsters.111 type 101 subtype 27 level 6 @@ -54238,7 +54532,7 @@ anim_suffix spellcasting name summon fog name_pl summon fog -face spell_summoner.111 +face spell_summon_fog.111 type 101 subtype 27 level 4 @@ -54280,7 +54574,7 @@ anim_suffix spellcasting name summon pet monster name_pl summon pet monster -face spell_summoner.111 +face spell_summon_pet_monster.111 type 101 subtype 27 level 4 @@ -54302,7 +54596,7 @@ anim_suffix spellcasting name bullet storm name_pl bullet storm -face spell_evocation.111 +face spell_bullet_storm.111 skill evocation type 101 subtype 36 @@ -54326,7 +54620,7 @@ anim_suffix spellcasting name bullet swarm name_pl bullet swarm -face spell_evocation.111 +face spell_bullet_swarm.111 skill evocation type 101 subtype 36 @@ -54351,7 +54645,7 @@ anim_suffix spellcasting name cause many wounds name_pl cause many wounds -face spell_praying.111 +face spell_cause_many_wounds.111 skill praying type 101 subtype 36 @@ -54400,7 +54694,7 @@ anim_suffix spellcasting name meteor swarm name_pl meteor swarm -face spell_pyromancy.111 +face spell_meteor_swarm.111 skill pyromancy type 101 subtype 36 @@ -54426,7 +54720,7 @@ anim_suffix spellcasting name missile swarm name_pl missile swarm -face spell_sorcery.111 +face spell_missile_swarm.111 skill sorcery type 101 subtype 36 @@ -54462,7 +54756,7 @@ anim_suffix spellcasting name town portal name_pl town portal -face spell_sorcery.111 +face spell_town_portal.111 type 101 subtype 47 level 15 @@ -54995,6 +55289,7 @@ subtype 3 slaying /start/newbieshouse face map.111 +unique 1 hp 9 sp 4 end Modified: trunk/crossfire/resource/resource/conf/bmaps.paths =================================================================== --- trunk/crossfire/resource/resource/conf/bmaps.paths 2011-06-26 14:22:38 UTC (rev 8914) +++ trunk/crossfire/resource/resource/conf/bmaps.paths 2011-06-26 14:44:02 UTC (rev 8915) @@ -1831,3234 +1831,3507 @@ \01830 ./arch/player/race/fenx_class_warrior.170 \01831 ./arch/player/race/fenx_class_warrior.171 \01832 ./arch/player/race/fenx_class_warrior.172 -\01833 ./arch/player/race/fenx_singing.110 -\01834 ./arch/player/race/fenx_singing.111 -\01835 ./arch/player/race/fenx_singing.112 -\01836 ./arch/player/race/fenx_singing.130 -\01837 ./arch/player/race/fenx_singing.131 -\01838 ./arch/player/race/fenx_singing.132 -\01839 ./arch/player/race/fenx_singing.150 -\01840 ./arch/player/race/fenx_singing.151 -\01841 ./arch/player/race/fenx_singing.152 -\01842 ./arch/player/race/fenx_singing.170 -\01843 ./arch/player/race/fenx_singing.171 -\01844 ./arch/player/race/fenx_singing.172 -\01845 ./arch/player/race/fenx_spellcasting.151 -\01846 ./arch/player/race/fenx_spellcasting.152 -\01847 ./arch/player/race/fenx_sword.131 -\01848 ./arch/player/race/fenx_sword.132 -\01849 ./arch/player/race/fenx_sword.151 -\01850 ./arch/player/race/fenx_sword.152 -\01851 ./arch/player/race/fenx_sword.171 -\01852 ./arch/player/race/fenx_sword.172 -\01853 ./arch/ground/new/fernsdense.111 -\01854 ./arch/ground/new/fernssparse.111 -\01855 ./arch/monster/demon/fiend.111 -\01856 ./arch/monster/demon/fiend.112 -\01857 ./arch/monster/humanoid/Class/fighter.111 -\01858 ./arch/monster/humanoid/Class/fighter.112 -\01859 ./arch/monster/humanoid/Class/fighter.113 -\01860 ./arch/spell/Potion/figurine_gen.111 -\01861 ./arch/flesh/human/finger.111 -\01862 ./arch/monster/dragon/Hatchlings/fire_drag.131 -\01863 ./arch/monster/dragon/Hatchlings/fire_drag.132 -\01864 ./arch/monster/dragon/Hatchlings/fire_drag.171 -\01865 ./arch/monster/dragon/Hatchlings/fire_drag.172 -\01866 ./arch/monster/troll/Troll/fire_troll.x11 -\01867 ./arch/monster/troll/Troll/fire_troll.x12 -\01868 ./arch/monster/troll/Troll/fire_troll.x13 -\01869 ./arch/spell/Bullet/Fire/fireball.111 -\01870 ./arch/spell/Bullet/Fire/fireball.112 -\01871 ./arch/spell/Bullet/Fire/fireball.113 -\01872 ./arch/spell/Bullet/Fire/fireball_S.111 -\01873 ./arch/spell/Bullet/Fire/fireball_S.112 -\01874 ./arch/spell/Bullet/Fire/fireball_S.113 -\01875 ./arch/spell/Bolt/firebolt.111 -\01876 ./arch/spell/Bolt/firebolt.121 -\01877 ./arch/spell/Bolt/firebolt.131 -\01878 ./arch/spell/Bolt/firebolt.141 -\01879 ./arch/spell/Bolt/firebolt.151 -\01880 ./arch/spell/Bolt/firebolt.161 -\01881 ./arch/spell/Bolt/firebolt.171 -\01882 ./arch/spell/Bolt/firebolt.181 -\01883 ./arch/player/race/fireborn.111 -\01884 ./arch/player/race/fireborn.222 -\01885 ./arch/player/race/fireborn.333 -\01886 ./arch/player/race/fireborn.444 -\01887 ./arch/weapon/artifact/firebrand.111 -\01888 ./arch/weapon/artifact/firebrand.112 -\01889 ./arch/weapon/artifact/firebrand.113 -\01890 ./arch/spell/Bullet/Fire/firebullet.111 -\01891 ./arch/spell/Bullet/Fire/firebullet.121 -\01892 ./arch/spell/Bullet/Fire/firebullet.131 -\01893 ./arch/spell/Bullet/Fire/firebullet.141 -\01894 ./arch/spell/Bullet/Fire/firebullet.151 -\01895 ./arch/spell/Bullet/Fire/firebullet.161 -\01896 ./arch/spell/Bullet/Fire/firebullet.171 -\01897 ./arch/spell/Bullet/Fire/firebullet.181 -\01898 ./arch/monster/misc/firechest.111 -\01899 ./arch/floor/fireholes.111 -\01900 ./arch/misc/fireplace.111 -\01901 ./arch/misc/fireplace.112 -\01902 ./arch/misc/fireplace.113 -\01903 ./arch/misc/firepot.111 -\01904 ./arch/misc/firepot.112 -\01905 ./arch/misc/firepot.113 -\01906 ./arch/misc/firepot.114 -\01907 ./arch/weapon/artifact/Firestar/firestar.111 -\01908 ./arch/weapon/artifact/Firestar/firestar.112 -\01909 ./arch/weapon/artifact/Firestar/firestar.113 -\01910 ./arch/wall/firewall/firewall_1.111 -\01911 ./arch/wall/firewall/firewall_2.111 -\01912 ./arch/wall/firewall/firewall_3.111 -\01913 ./arch/wall/firewall/firewall_4.111 -\01914 ./arch/wall/firewall/firewall_5.111 -\01915 ./arch/wall/firewall/firewall_6.111 -\01916 ./arch/wall/firewall/firewall_7.111 -\01917 ./arch/wall/firewall/firewall_8.111 -\01918 ./arch/food/fish_1.111 -\01919 ./arch/food/fish_2.111 -\01920 ./arch/food/fish_3.111 -\01921 ./arch/food/fish_4.111 -\01922 ./arch/food/fish_5.111 -\01923 ./arch/food/fish_6.111 -\01924 ./arch/transport/fishboat.x11 -\01925 ./arch/food/fishfood.111 -\01926 ./arch/skills/Skill_Tools/fishing_pole.111 -\01927 ./arch/inorganic/fix_mercury.111 -\01928 ./arch/inorganic/fix_mercury.112 -\01929 ./arch/floor/flagstone.111 -\01930 ./arch/wall/flagstone/flagstone_0.111 -\01931 ./arch/wall/flagstone/flagstone_1.111 -\01932 ./arch/wall/flagstone/flagstone_2.111 -\01933 ./arch/wall/flagstone/flagstone_3.111 -\01934 ./arch/wall/flagstone/flagstone_4.111 -\01935 ./arch/wall/flagstone/flagstone_5.111 -\01936 ./arch/wall/flagstone/flagstone_6.111 -\01937 ./arch/wall/flagstone/flagstone_7.111 -\01938 ./arch/wall/flagstone/flagstone_8.111 -\01939 ./arch/wall/flagstone/flagstone_9.111 -\01940 ./arch/wall/flagstone/flagstone_A.111 -\01941 ./arch/wall/flagstone/flagstone_B.111 -\01942 ./arch/wall/flagstone/flagstone_C.111 -\01943 ./arch/wall/flagstone/flagstone_D.111 -\01944 ./arch/wall/flagstone/flagstone_E.111 -\01945 ./arch/wall/flagstone/flagstone_F.111 -\01946 ./arch/floor/smooth/flagstone_S.111 -\01947 ./arch/wall/flagstone/flagstone_win1.111 -\01948 ./arch/planes/fire/flamingtower.x11 -\01949 ./arch/planes/fire/flamingtower.x12 -\01950 ./arch/planes/fire/flamingtower.x13 -\01951 ./arch/planes/fire/flamingtower.x14 -\01952 ./arch/light/flint_and_steel.111 -\01953 ./arch/spell/Cone/flowers.111 -\01954 ./arch/monster/insect/ant/fly_ant.131 -\01955 ./arch/monster/insect/ant/fly_ant.132 -\01956 ./arch/monster/insect/ant/fly_ant.171 -\01957 ./arch/monster/insect/ant/fly_ant.172 -\01958 ./arch/ground/fog.111 -\01959 ./arch/ground/fog.112 -\01960 ./arch/ground/fog_2.111 -\01961 ./arch/food/food.111 -\01962 ./arch/flesh/human/foot.111 -\01963 ./arch/road/footbridge/footbridge_0.111 -\01964 ./arch/road/footbridge/footbridge_1.111 -\01965 ./arch/road/footbridge/footbridge_2.111 -\01966 ./arch/road/footbridge/footbridge_3.111 -\01967 ./arch/road/footbridge/footbridge_4.1... [truncated message content] |
From: <aki...@us...> - 2011-06-26 14:22:45
|
Revision: 8914 http://gridarta.svn.sourceforge.net/gridarta/?rev=8914&view=rev Author: akirschbaum Date: 2011-06-26 14:22:38 +0000 (Sun, 26 Jun 2011) Log Message: ----------- Whitespace changes. Modified Paths: -------------- trunk/crossfire/resource/resource/conf/types.xml Modified: trunk/crossfire/resource/resource/conf/types.xml =================================================================== --- trunk/crossfire/resource/resource/conf/types.xml 2011-06-26 14:19:50 UTC (rev 8913) +++ trunk/crossfire/resource/resource/conf/types.xml 2011-06-26 14:22:38 UTC (rev 8914) @@ -2421,8 +2421,8 @@ <attribute arch="attacktype" editor="attack type" type="bitmask_attacktype"> This attribute specifies the attack types that this floor uses to damage it's victims. Attack types are: physical, fire, cold.. etc. - If you want a real tough hazard floor, add more than just one - attack type. + If you want a real tough hazard floor, add more than just one attack + type. </attribute> <attribute arch="dam" editor="base damage" type="int" min="0" max="32767"> The <base damage> defines how much damage is inflicted to the This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-06-26 14:19:56
|
Revision: 8913 http://gridarta.svn.sourceforge.net/gridarta/?rev=8913&view=rev Author: akirschbaum Date: 2011-06-26 14:19:50 +0000 (Sun, 26 Jun 2011) Log Message: ----------- Fix Javadoc issue. Modified Paths: -------------- trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java Modified: trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java 2011-06-26 14:19:03 UTC (rev 8912) +++ trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java 2011-06-26 14:19:50 UTC (rev 8913) @@ -44,8 +44,8 @@ /** * Checks that {@link net.sf.gridarta.model.gameobject.GameObjectFactory#cloneGameObject(GameObject)} * correctly updates the container. + * @throws CannotInsertGameObjectException if the test fails * @throws DuplicateArchetypeException if the test fails - * @throws CannotInsertGameObjectException if the test fails */ @Test public void testDoMoveSquareTopSingle() throws CannotInsertGameObjectException, DuplicateArchetypeException { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-06-26 14:19:10
|
Revision: 8912 http://gridarta.svn.sourceforge.net/gridarta/?rev=8912&view=rev Author: akirschbaum Date: 2011-06-26 14:19:03 +0000 (Sun, 26 Jun 2011) Log Message: ----------- Fix #3332031 (animated ammunition is given an incorrect face). Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-06-26 11:05:20 UTC (rev 8911) +++ trunk/atrinik/ChangeLog 2011-06-26 14:19:03 UTC (rev 8912) @@ -1,5 +1,7 @@ 2011-06-26 Andreas Kirschbaum + * Fix #3332031 (animated ammunition is given an incorrect face). + * Fix #3331957 (False positive for duplicate attribute name). Do not report spurious warning message for artifacts with a "name" which inherit from archetypes not having a "name". Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2011-06-26 11:05:20 UTC (rev 8911) +++ trunk/crossfire/ChangeLog 2011-06-26 14:19:03 UTC (rev 8912) @@ -1,3 +1,7 @@ +2011-06-26 Andreas Kirschbaum + + * Fix #3332031 (animated ammunition is given an incorrect face). + 2011-06-10 Andreas Kirschbaum * Add XML file parse errors to error dialog box. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-06-26 11:05:20 UTC (rev 8911) +++ trunk/daimonin/ChangeLog 2011-06-26 14:19:03 UTC (rev 8912) @@ -1,5 +1,7 @@ 2011-06-26 Andreas Kirschbaum + * Fix #3332031 (animated ammunition is given an incorrect face). + * Fix #3331957 (False positive for duplicate attribute name). Do not report spurious warning message for artifacts with a "name" which inherit from archetypes not having a "name". Modified: trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2011-06-26 11:05:20 UTC (rev 8911) +++ trunk/model/src/app/net/sf/gridarta/model/gameobject/AbstractGameObjectFactory.java 2011-06-26 14:19:03 UTC (rev 8912) @@ -48,7 +48,9 @@ @Override public void createInventory(@NotNull final GameObject<G, A, R> gameObject, @NotNull final Iterable<G> archetype) { for (final G invGameObject : archetype) { - gameObject.addLast(cloneGameObject(invGameObject)); + final G clone = cloneGameObject(invGameObject); + clone.setObjectFace(); + gameObject.addLast(clone); } } Modified: trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java 2011-06-26 11:05:20 UTC (rev 8911) +++ trunk/model/src/test/net/sf/gridarta/model/gameobject/GameObjectFactoryTest.java 2011-06-26 14:19:03 UTC (rev 8912) @@ -20,13 +20,18 @@ package net.sf.gridarta.model.gameobject; import java.awt.Point; +import javax.swing.ImageIcon; +import net.sf.gridarta.model.archetype.ArchetypeSet; import net.sf.gridarta.model.archetype.DuplicateArchetypeException; import net.sf.gridarta.model.archetype.TestArchetype; +import net.sf.gridarta.model.baseobject.BaseObject; +import net.sf.gridarta.model.face.FaceProvider; import net.sf.gridarta.model.maparchobject.TestMapArchObject; import net.sf.gridarta.model.mapmodel.CannotInsertGameObjectException; import net.sf.gridarta.model.mapmodel.MapModel; import net.sf.gridarta.model.mapmodel.TestMapModelCreator; import net.sf.gridarta.model.mapmodel.TestMapModelHelper; +import org.jetbrains.annotations.NotNull; import org.junit.Assert; import org.junit.Test; @@ -65,4 +70,58 @@ Assert.assertSame(ob1Clone, ob2Clone.getContainer()); } + /** + * Checks that face information is updated for inventory objects cloned from + * an archetype. + * @throws CannotInsertGameObjectException if the test fails + * @throws DuplicateArchetypeException if the test fails + */ + @Test + public void testUpdateFaceInformation() throws CannotInsertGameObjectException, DuplicateArchetypeException { + final TestMapModelCreator mapModelCreator = new TestMapModelCreator(false); + final TestMapModelHelper mapModelHelper = mapModelCreator.newTestMapModelHelper(); + final MapModel<TestGameObject, TestMapArchObject, TestArchetype> mapModel = mapModelCreator.newMapModel(1, 1); + + final GameObjectFactory<TestGameObject, TestMapArchObject, TestArchetype> gameObjectFactory = mapModelCreator.getGameObjectFactory(); + final ArchetypeSet<TestGameObject, TestMapArchObject, TestArchetype> archetypeSet = mapModelCreator.getArchetypeSet(); + + final TestArchetype invArchetype = gameObjectFactory.newArchetype("inv"); + invArchetype.setAttributeString(BaseObject.FACE, "face"); + archetypeSet.addArchetype(invArchetype); + + final TestArchetype envArchetype = gameObjectFactory.newArchetype("env"); + envArchetype.setAttributeString(BaseObject.FACE, "face"); + envArchetype.addLast(gameObjectFactory.createGameObject(invArchetype)); + archetypeSet.addArchetype(envArchetype); + + final FaceProvider faceProvider = new FaceProvider() { + + @Override + public ImageIcon getImageIconForFacename(@NotNull final String faceName) { + if (faceName.equals("face")) { + return new ImageIcon(); + } + return null; + } + + @Override + public void reload() { + // do nothing + } + + }; + mapModelCreator.getFaceObjectProviders().setNormal(faceProvider); + + final Point point = new Point(0, 0); + mapModel.beginTransaction("TEST"); + final TestGameObject env = mapModelHelper.insertArchetype(mapModel, point, envArchetype, false); + + Assert.assertNotNull(env); + Assert.assertEquals(FaceSource.ARCHETYPE_FACE, env.getFaceObjSource()); + + final TestGameObject inv = env.getFirst(); + Assert.assertNotNull(inv); + Assert.assertEquals(FaceSource.ARCHETYPE_FACE, inv.getFaceObjSource()); + } + } // class GameObjectFactoryTest This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2011-06-26 11:05:27
|
Revision: 8911 http://gridarta.svn.sourceforge.net/gridarta/?rev=8911&view=rev Author: akirschbaum Date: 2011-06-26 11:05:20 +0000 (Sun, 26 Jun 2011) Log Message: ----------- Fix #3331957 (False positive for duplicate attribute name). Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2011-06-19 16:10:12 UTC (rev 8910) +++ trunk/atrinik/ChangeLog 2011-06-26 11:05:20 UTC (rev 8911) @@ -1,3 +1,9 @@ +2011-06-26 Andreas Kirschbaum + + * Fix #3331957 (False positive for duplicate attribute name). Do + not report spurious warning message for artifacts with a "name" + which inherit from archetypes not having a "name". + 2011-06-10 Andreas Kirschbaum * Add XML file parse errors to error dialog box. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2011-06-19 16:10:12 UTC (rev 8910) +++ trunk/daimonin/ChangeLog 2011-06-26 11:05:20 UTC (rev 8911) @@ -1,3 +1,9 @@ +2011-06-26 Andreas Kirschbaum + + * Fix #3331957 (False positive for duplicate attribute name). Do + not report spurious warning message for artifacts with a "name" + which inherit from archetypes not having a "name". + 2011-06-10 Andreas Kirschbaum * Add XML file parse errors to error dialog box. Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java 2011-06-19 16:10:12 UTC (rev 8910) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeBuilder.java 2011-06-26 11:05:20 UTC (rev 8911) @@ -40,6 +40,13 @@ public abstract class AbstractArchetypeBuilder<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> { /** + * The base {@link Archetype} for artifacts. Set to <code>null</code> when + * parsing archetypes. + */ + @Nullable + private R prototype; + + /** * The {@link ErrorViewCollector} for reporting errors. */ @Nullable @@ -74,7 +81,12 @@ this.gameObjectFactory = gameObjectFactory; } - public void init(@Nullable final BaseObject<G, A, R, R> prototype, @NotNull final ErrorViewCollector errorViewCollector) { + /** + * @param prototype the base archetype for artifacts; <code>null</code> when + * parsig archetypes + */ + public void init(@Nullable final R prototype, @NotNull final ErrorViewCollector errorViewCollector) { + this.prototype = prototype; this.errorViewCollector = errorViewCollector; // start with new clean GameObject instance if (prototype == null) { @@ -136,6 +148,11 @@ */ @NotNull public R finish() { + if (prototype != null && prototype.getAttributeString(BaseObject.NAME).isEmpty() && !attributes.containsKey(BaseObject.NAME)) { + assert prototype != null; + addObjectText(BaseObject.NAME + " " + prototype.getArchetypeName()); + } + if (archetype == null) { throw new IllegalStateException(); } Modified: trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java 2011-06-19 16:10:12 UTC (rev 8910) +++ trunk/model/src/app/net/sf/gridarta/model/archetype/AbstractArchetypeParser.java 2011-06-26 11:05:20 UTC (rev 8911) @@ -25,7 +25,6 @@ import net.sf.gridarta.model.anim.AnimationObjects; import net.sf.gridarta.model.anim.DuplicateAnimationException; import net.sf.gridarta.model.anim.IllegalAnimationException; -import net.sf.gridarta.model.baseobject.BaseObject; import net.sf.gridarta.model.errorview.ErrorViewCategory; import net.sf.gridarta.model.errorview.ErrorViewCollector; import net.sf.gridarta.model.gameobject.GameObject; @@ -140,9 +139,6 @@ final String archetypeName = archName != null ? archName : thisLine2.trim().substring(7); archetypeBuilder.reInit(archetypeName); - if (prototype != null && prototype.getAttributeString(BaseObject.NAME).isEmpty()) { - archetypeBuilder.addObjectText(BaseObject.NAME + " " + prototype.getArchetypeName()); - } if (!archMore) { if (firstArch != null) { finishParseArchetype(firstArch); Modified: trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java 2011-06-19 16:10:12 UTC (rev 8910) +++ trunk/model/src/test/net/sf/gridarta/model/archetype/TestArchetypeParser.java 2011-06-26 11:05:20 UTC (rev 8911) @@ -57,7 +57,7 @@ */ @Override protected boolean isStartLine(@NotNull final String line) { - return line.startsWith("Object "); + return line.startsWith("Object"); } /** Modified: trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java 2011-06-19 16:10:12 UTC (rev 8910) +++ trunk/model/src/test/net/sf/gridarta/model/artifact/ArtifactParserTest.java 2011-06-26 11:05:20 UTC (rev 8911) @@ -58,7 +58,7 @@ Assert.assertFalse(errorView.hasErrors()); Assert.assertEquals(2, parser.getArchetypeCount()); final Archetype<TestGameObject, TestMapArchObject, TestArchetype> archetype = parser.getArchetype("art"); - Assert.assertEquals("name base\nsp 3\n", archetype.getObjectText()); + Assert.assertEquals("sp 3\nname base\n", archetype.getObjectText()); } /** @@ -146,4 +146,56 @@ Assert.assertEquals("special_horn of fools", parser.getArchetype("horn_fools").getBestName()); } + /** + * Checks for spurious error messages when setting an artifact's name when + * the base archetype doesn't has an explicit name. + * @throws DuplicateArchetypeException if the test fails + * @throws IOException if the test fails + * @throws UndefinedArchetypeException if the test fails + */ + @Test + public void testDefaultName5a() throws DuplicateArchetypeException, IOException, UndefinedArchetypeException { + final TestParser parser = new TestParser(); + parser.addArchetype("note", "face note.101", "layer 3", "identified 1", "type 8", "material 1", "value 8", "weight 75", "level 1", "exp 10"); + final StringBuilder artifacts = new StringBuilder(); + artifacts.append("Allowed none\n"); + artifacts.append("chance 1\n"); + artifacts.append("artifact my_notebook_item\n"); + artifacts.append("def_arch note\n"); + artifacts.append("Object\n"); + artifacts.append("name A notebook\n"); + artifacts.append("msg\n"); + artifacts.append("This should be giving a false positive for duplicate attributes.\n"); + artifacts.append("endmsg\n"); + artifacts.append("end\n"); + parser.parseArtifacts(artifacts.toString()); + Assert.assertEquals("A notebook", parser.getArchetype("my_notebook_item").getBestName()); + } + + /** + * Checks for spurious error messages when setting an artifact's name when + * the base archetype doesn't has an explicit name. + * @throws DuplicateArchetypeException if the test fails + * @throws IOException if the test fails + * @throws UndefinedArchetypeException if the test fails + */ + @Test + public void testDefaultName5b() throws DuplicateArchetypeException, IOException, UndefinedArchetypeException { + final TestParser parser = new TestParser(); + parser.addArchetype("note", "face note.101", "name note", "layer 3", "identified 1", "type 8", "material 1", "value 8", "weight 75", "level 1", "exp 10"); + final StringBuilder artifacts = new StringBuilder(); + artifacts.append("Allowed none\n"); + artifacts.append("chance 1\n"); + artifacts.append("artifact my_notebook_item\n"); + artifacts.append("def_arch note\n"); + artifacts.append("Object\n"); + artifacts.append("name A notebook\n"); + artifacts.append("msg\n"); + artifacts.append("This should be giving a false positive for duplicate attributes.\n"); + artifacts.append("endmsg\n"); + artifacts.append("end\n"); + parser.parseArtifacts(artifacts.toString()); + Assert.assertEquals("A notebook", parser.getArchetype("my_notebook_item").getBestName()); + } + } // class ArtifactParserTest This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |