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...> - 2010-11-06 06:33:31
|
Revision: 8760 http://gridarta.svn.sourceforge.net/gridarta/?rev=8760&view=rev Author: akirschbaum Date: 2010-11-06 06:33:24 +0000 (Sat, 06 Nov 2010) Log Message: ----------- Fix possible assertion failure. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java trunk/utils/src/app/net/sf/gridarta/utils/ImageUtils.java Modified: trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java 2010-11-05 21:28:41 UTC (rev 8759) +++ trunk/src/app/net/sf/gridarta/gui/mapimagecache/MapImageCacheEntry.java 2010-11-06 06:33:24 UTC (rev 8760) @@ -265,6 +265,9 @@ //noinspection ErrorNotRethrown try { result = ImageUtils.scaleImage(image, width, height); + } catch (final InterruptedException ignored) { + Thread.currentThread().interrupt(); + result = defaultImage; } catch (final OutOfMemoryError ignored) { result = defaultImage; } Modified: trunk/utils/src/app/net/sf/gridarta/utils/ImageUtils.java =================================================================== --- trunk/utils/src/app/net/sf/gridarta/utils/ImageUtils.java 2010-11-05 21:28:41 UTC (rev 8759) +++ trunk/utils/src/app/net/sf/gridarta/utils/ImageUtils.java 2010-11-06 06:33:24 UTC (rev 8760) @@ -61,20 +61,20 @@ * @param w the scaled width * @param h the scaled height * @return the scaled image + * @throws InterruptedException if scaling failed because the current thread + * was interrupted */ @NotNull - public static Image scaleImage(@NotNull final Image image, final int w, final int h) { + public static Image scaleImage(@NotNull final Image image, final int w, final int h) throws InterruptedException { final Image scaledImage = image.getScaledInstance(w, h, Image.SCALE_SMOOTH); final int id = 0; tracker.addImage(scaledImage, id); try { tracker.waitForID(id); - } catch (final InterruptedException ex) { - Thread.currentThread().interrupt(); - throw new AssertionError(ex); // XXX + } finally { + tracker.removeImage(scaledImage, id); } - tracker.removeImage(scaledImage, id); return scaledImage; } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-05 21:28:48
|
Revision: 8759 http://gridarta.svn.sourceforge.net/gridarta/?rev=8759&view=rev Author: akirschbaum Date: 2010-11-05 21:28:41 +0000 (Fri, 05 Nov 2010) Log Message: ----------- Enhance "Shop square allows magic and/or prayers" validator: flag shop squares that are adjacent to squares that allow spells or prayers. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml trunk/model/src/app/net/sf/gridarta/model/validation/checks/ShopSquareChecker.java trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.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/GameObjectMatcher.xhtml trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare trunk/test-mapvalidator/crossfire/maps/ShopSquare trunk/test-mapvalidator/crossfire/maps/ShopSquare.expected Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java trunk/test-mapvalidator/crossfire/arch/wall1.arc Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/crossfire/ChangeLog 2010-11-05 21:28:41 UTC (rev 8759) @@ -1,5 +1,9 @@ 2010-11-05 Andreas Kirschbaum + * Enhance "Shop square allows magic and/or prayers" validator: + flag shop squares that are adjacent to squares that allow spells + or prayers. + * Fix game object matchers to reliably match int valued attributes. * Add "type" attribute to <Attrib> game object matchers. Allowed Modified: trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml =================================================================== --- trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-05 21:28:41 UTC (rev 8759) @@ -260,4 +260,14 @@ </And> </GameObjectMatcher> + <!-- Objects to be treated as blocked in map validator --> + <GameObjectMatcher id="system_blocked" system="true"> + <title xml:lang="en">Blocked</title> + <title xml:lang="de">Blockiert</title> + <And> + <Attrib name="move_block" op="ne" value=""/> + <Attrib name="move_block" op="ne" value="0"/> + </And> + </GameObjectMatcher> + </GameObjectMatchers> Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/ShopSquareChecker.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/ShopSquareChecker.java 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/ShopSquareChecker.java 2010-11-05 21:28:41 UTC (rev 8759) @@ -27,8 +27,10 @@ import net.sf.gridarta.model.match.GameObjectMatcher; import net.sf.gridarta.model.validation.ErrorCollector; import net.sf.gridarta.model.validation.ValidatorPreferences; +import net.sf.gridarta.model.validation.errors.ShopSquare2Error; import net.sf.gridarta.model.validation.errors.ShopSquareError; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * A {@link net.sf.gridarta.model.validation.MapValidator} to detect shop @@ -50,16 +52,25 @@ private final GameObjectMatcher noSpellsMatcher; /** + * The {@link GameObjectMatcher} for finding blocked squares. + */ + @Nullable + private final GameObjectMatcher blockedMatcher; + + /** * Creates a new instance. * @param validatorPreferences the validator preferences to use * @param shopMatcher the game object matcher for finding shop squares * @param noSpellsMatcher the game object matcher for finding no-spell * squares + * @param blockedMatcher the game object matcher for finding blocked + * squares */ - public ShopSquareChecker(@NotNull final ValidatorPreferences validatorPreferences, @NotNull final GameObjectMatcher shopMatcher, @NotNull final GameObjectMatcher noSpellsMatcher) { + public ShopSquareChecker(@NotNull final ValidatorPreferences validatorPreferences, @NotNull final GameObjectMatcher shopMatcher, @NotNull final GameObjectMatcher noSpellsMatcher, @Nullable final GameObjectMatcher blockedMatcher) { super(validatorPreferences); this.shopMatcher = shopMatcher; this.noSpellsMatcher = noSpellsMatcher; + this.blockedMatcher = blockedMatcher; } /** @@ -69,14 +80,49 @@ public void validateMap(@NotNull final MapModel<G, A, R> mapModel, @NotNull final ErrorCollector<G, A, R> errorCollector) { final boolean[][] shopSquares = findMatchingSquares(mapModel, shopMatcher); final boolean[][] noSpellsSquares = findMatchingSquares(mapModel, noSpellsMatcher); + final boolean[][] blockedSquares = blockedMatcher == null ? null : findMatchingSquares(mapModel, blockedMatcher); final Point point = new Point(); for (point.x = 0; point.x < shopSquares.length && point.x < noSpellsSquares.length; point.x++) { for (point.y = 0; point.y < shopSquares[point.x].length && point.y < noSpellsSquares[point.x].length; point.y++) { - if (shopSquares[point.x][point.y] && !noSpellsSquares[point.x][point.y]) { - errorCollector.collect(new ShopSquareError<G, A, R>(mapModel.getMapSquare(point))); + if (shopSquares[point.x][point.y]) { + if (!noSpellsSquares[point.x][point.y]) { + errorCollector.collect(new ShopSquareError<G, A, R>(mapModel.getMapSquare(point))); + } else if (blockedSquares != null && hasAdjacentNonBlockedSpellsAllowedSquare(noSpellsSquares, blockedSquares, point)) { + errorCollector.collect(new ShopSquare2Error<G, A, R>(mapModel.getMapSquare(point))); + } } } } } + /** + * Returns whether a given square is not blocked and has a non-blocked + * adjacent square that allows spells. + * @param noSpellsSquares the map squares disallowing spells + * @param blockedSquares the blocked map squares + * @param point the map square to check + * @return whether a match was found + */ + private static boolean hasAdjacentNonBlockedSpellsAllowedSquare(@NotNull final boolean[][] noSpellsSquares, @NotNull final boolean[][] blockedSquares, @NotNull final Point point) { + if (blockedSquares[point.x][point.y]) { + return false; + } + + for (int dx = -1; dx <= +1; dx++) { + for (int dy = -1; dy <= +1; dy++) { + final int x = point.x + dx; + final int y = point.y + dy; + //noinspection ProhibitedExceptionCaught + try { + if (!noSpellsSquares[x][y] && !blockedSquares[x][y]) { + return true; + } + } catch (final ArrayIndexOutOfBoundsException ignored) { + // ignore: expected for points at the border of the map + } + } + } + return false; + } + } // class ShopSquareChecker Added: trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java 2010-11-05 21:28:41 UTC (rev 8759) @@ -0,0 +1,48 @@ +/* + * 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 net.sf.gridarta.model.mapmodel.MapSquare; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link SquareValidationError} for shop tiles that have an adjacent map + * square that is not blocked and does allow spells or prayers. + * @author <a href="mailto:ch...@ri...">Christian Hujer</a> + */ +public class ShopSquare2Error<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends SquareValidationError<G, A, R> { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * Creates a new instance. + * @param mapSquare the square on which the error occurred + */ + public ShopSquare2Error(@NotNull final MapSquare<G, A, R> mapSquare) { + super(mapSquare); + } + +} // class ShopSquare2Error Property changes on: trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquare2Error.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java 2010-11-05 21:28:41 UTC (rev 8759) @@ -188,7 +188,7 @@ */ @Test public void testNewShopSquareChecker() throws NoSuchValidatorException { - ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.ShopSquareChecker matcher matcher"); + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.ShopSquareChecker matcher matcher matcher"); } /** Modified: trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java =================================================================== --- trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/app/net/sf/gridarta/maincontrol/DefaultMainControl.java 2010-11-05 21:28:41 UTC (rev 8759) @@ -209,7 +209,8 @@ if (shopSquareMatcher != null) { final GameObjectMatcher noSpellsMatcher = gameObjectMatchers.getMatcher("system_no_spells", "no_spells"); if (noSpellsMatcher != null) { - validators.addValidator(new ShopSquareChecker<G, A, R>(validatorPreferences, shopSquareMatcher, noSpellsMatcher)); + final GameObjectMatcher blockedMatcher = gameObjectMatchers.getMatcher("system_blocked", "blocked"); + validators.addValidator(new ShopSquareChecker<G, A, R>(validatorPreferences, shopSquareMatcher, noSpellsMatcher, blockedMatcher)); } final GameObjectMatcher paidItemMatcher = gameObjectMatchers.getMatcher("system_paid_item"); Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-11-05 21:28:41 UTC (rev 8759) @@ -1362,6 +1362,8 @@ Validator.ShopSquare.default=true Validator.ShopSquare.title=Shop square allows magic and/or prayers Validator.ShopSquare.msg=<html><h3>{0}</h3><p>On this square there is a shop square which allows magic and/or prayers.</p> +Validator.ShopSquare2.title=Adjacent shop square allows magic and/or prayers +Validator.ShopSquare2.msg=<html><h3>{0}</h3><p>On this square there is a shop square which has an adjacent square that both is not blocked and that does allows magic and/or prayers.</p> Validator.Slaying.default=true Validator.Slaying.title=Critical slaying characters Modified: trunk/src/app/net/sf/gridarta/messages_de.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_de.properties 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/app/net/sf/gridarta/messages_de.properties 2010-11-05 21:28:41 UTC (rev 8759) @@ -1152,6 +1152,8 @@ Validator.ShopSquare.title=Gesch\u00e4ftsfl\u00e4che erlaubt Magie Validator.ShopSquare.msg=<html><h3>{0}</h3><p>Dieses Feld ist eine Gesch\u00e4ftsfl\u00e4che und erlaubt Magic.</p> +Validator.ShopSquare2.title=Angrenzende Gesch\u00e4ftsfl\u00e4che erlaubt Magie +Validator.ShopSquare2.msg=<html><h3>{0}</h3><p>Dieses Feld ist eine Gesch\u00e4ftsfl\u00e4che und besitzt ein angrenzendes Feld, welches Magic erlaubt.</p> Validator.Slaying.title=Ung\u00fcltige Zeichen f\u00fcr "slaying" Validator.Slaying.msg=<html><h3>{0}</h3><p>Dieses Feld enth\u00e4lt ein Objekt mit einem Attribut "slaying", das ung\u00fcltige Zeichen enth\u00e4lt.</p><p>Erlaubte Zeichen sind:<br><code>a-z A-Z 0-9 / . _</code></p><p>Sie k\u00f6nnen:</p><ul><li>Das Attribut \u00e4ndern</li></ul> Modified: trunk/src/app/net/sf/gridarta/messages_fr.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/app/net/sf/gridarta/messages_fr.properties 2010-11-05 21:28:41 UTC (rev 8759) @@ -1140,6 +1140,8 @@ #Validator.ShopSquare.title= #Validator.ShopSquare.msg= +#Validator.ShopSquare2.title= +#Validator.ShopSquare2.msg= #Validator.Slaying.title= #Validator.Slaying.msg= Modified: trunk/src/app/net/sf/gridarta/messages_sv.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/app/net/sf/gridarta/messages_sv.properties 2010-11-05 21:28:41 UTC (rev 8759) @@ -1148,6 +1148,8 @@ #Validator.ShopSquare.title= #Validator.ShopSquare.msg= +#Validator.ShopSquare2.title= +#Validator.ShopSquare2.msg= Validator.MobOutsideSpawnPoint.title=Mob utan spawnpoint Validator.MobOutsideSpawnPoint.msg=<html><h3>{0}</h3><p>H\u00e4r finns det en mob utanf\u00f6r en spawnpoint.<br>Detta \u00e4r ok, men du kanske \u00e4nd\u00e5 b\u00f6r stoppa moben i spawnpointen s\u00e5 den \u00e5terf\u00f6ds om den skulle d\u00f6.</p><p>Du kan:</p><ul><li>ignorera detta</li><li>skapa en spawnpoint f\u00f6r denna mob</li></ul> Modified: trunk/src/doc/ref/GameObjectMatcher.xhtml =================================================================== --- trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-11-05 21:28:41 UTC (rev 8759) @@ -48,8 +48,11 @@ <li>Checks for shop tiles that allow spells. Shop tiles are selected by matcher 'system_shop_tile' (or fallback 'shop_tile'); denied spells are selected by matcher - 'system_no_spells' (or fallback 'no_spells'). Not - checked if either matcher is not defined. + 'system_no_spells' (or fallback 'no_spells'). If matcher + 'system_blocked' (or fallback blocked') exists, also + checks for shop tiles with adjacent map squares that + allow spells which are both not blocked. Not checked if + either matcher is not defined. </li> <li>Checks for shop tiles that contain paid items. Shop tiles are selected by matcher 'system_shop_tile' (or Added: trunk/test-mapvalidator/crossfire/arch/wall1.arc =================================================================== --- trunk/test-mapvalidator/crossfire/arch/wall1.arc (rev 0) +++ trunk/test-mapvalidator/crossfire/arch/wall1.arc 2010-11-05 21:28:41 UTC (rev 8759) @@ -0,0 +1,3 @@ +Object wall1 +move_block all +end Property changes on: trunk/test-mapvalidator/crossfire/arch/wall1.arc ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare =================================================================== --- trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-05 21:28:41 UTC (rev 8759) @@ -5,7 +5,7 @@ height 4 msg Created: 2010-06-27 Andreas Kirschbaum -Modified: 2010-11-03 Andreas Kirschbaum +Modified: 2010-11-05 ank endmsg end arch shop2 @@ -13,6 +13,12 @@ arch rod1 end arch shop2 +y 1 +end +arch shop2 +y 2 +end +arch shop2 y 3 end arch mob1 @@ -20,6 +26,9 @@ end arch shop2 x 1 +end +arch shop2 +x 1 y 1 end arch rod1 @@ -37,7 +46,14 @@ no_pick 1 end arch shop2 +x 1 +y 3 +end +arch shop2 x 2 +end +arch shop2 +x 2 y 1 end arch rod1 @@ -55,7 +71,14 @@ unpaid 1 end arch shop2 +x 2 +y 3 +end +arch shop2 x 3 +end +arch shop2 +x 3 y 1 end arch rod1 @@ -73,7 +96,14 @@ monster 1 end arch shop2 +x 3 +y 3 +end +arch shop2 x 4 +end +arch shop2 +x 4 y 1 end arch rod1 @@ -91,7 +121,14 @@ generator 1 end arch shop2 +x 4 +y 3 +end +arch shop2 x 5 +end +arch shop2 +x 5 y 1 end arch rod1 @@ -108,3 +145,7 @@ y 2 weight 1 end +arch shop2 +x 5 +y 3 +end Modified: trunk/test-mapvalidator/crossfire/maps/ShopSquare =================================================================== --- trunk/test-mapvalidator/crossfire/maps/ShopSquare 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/test-mapvalidator/crossfire/maps/ShopSquare 2010-11-05 21:28:41 UTC (rev 8759) @@ -1,43 +1,223 @@ arch map name test for ShopSquare map validator difficulty 1 -width 4 -height 2 +width 14 +height 4 msg Created: 2010-06-27 Andreas Kirschbaum +Modified: 2010-11-05 ank endmsg end arch shop1 end +arch wall1 +y 1 +end arch shop2 -y 1 +y 2 no_magic 0 damned 0 end -arch shop1 +arch wall1 +y 3 +end +arch wall1 x 1 -no_magic 1 end -arch shop2 +arch wall1 x 1 y 1 -damned 0 end +arch wall1 +x 1 +y 2 +end +arch wall1 +x 1 +y 3 +end arch shop1 x 2 -damned 1 +no_magic 1 end +arch wall1 +x 2 +y 1 +end arch shop2 x 2 +y 2 +damned 0 +end +arch wall1 +x 2 +y 3 +end +arch wall1 +x 3 +end +arch wall1 +x 3 y 1 +end +arch wall1 +x 3 +y 2 +end +arch wall1 +x 3 +y 3 +end +arch shop1 +x 4 +damned 1 +end +arch wall1 +x 4 +y 1 +end +arch shop2 +x 4 +y 2 no_magic 0 end +arch wall1 +x 4 +y 3 +end +arch wall1 +x 5 +end +arch wall1 +x 5 +y 1 +end +arch wall1 +x 5 +y 2 +end +arch wall1 +x 5 +y 3 +end arch shop1 -x 3 +x 6 no_magic 1 damned 1 end +arch wall1 +x 6 +y 1 +end arch shop2 -x 3 +x 6 +y 2 +end +arch wall1 +x 6 +y 3 +end +arch wall1 +x 7 +end +arch wall1 +x 7 y 1 end +arch wall1 +x 7 +y 2 +end +arch wall1 +x 7 +y 3 +end +arch shop1 +x 8 +no_magic 1 +damned 1 +end +arch wall1 +x 8 +y 1 +end +arch shop2 +x 8 +y 2 +end +arch wall1 +x 8 +y 3 +end +arch wall1 +x 9 +y 1 +end +arch wall1 +x 9 +y 3 +end +arch wall1 +x 10 +end +arch wall1 +x 10 +y 1 +end +arch wall1 +x 10 +y 2 +end +arch wall1 +x 10 +y 3 +end +arch shop1 +x 11 +no_magic 1 +damned 1 +end +arch wall1 +x 11 +y 1 +end +arch shop2 +x 11 +y 2 +end +arch wall1 +x 11 +y 3 +end +arch shop1 +x 12 +no_magic 1 +damned 1 +end +arch wall1 +x 12 +y 1 +end +arch shop2 +x 12 +y 2 +end +arch wall1 +x 12 +y 3 +end +arch wall1 +x 13 +end +arch wall1 +x 13 +y 1 +end +arch wall1 +x 13 +y 2 +end +arch wall1 +x 13 +y 3 +end Modified: trunk/test-mapvalidator/crossfire/maps/ShopSquare.expected =================================================================== --- trunk/test-mapvalidator/crossfire/maps/ShopSquare.expected 2010-11-05 21:24:58 UTC (rev 8758) +++ trunk/test-mapvalidator/crossfire/maps/ShopSquare.expected 2010-11-05 21:28:41 UTC (rev 8759) @@ -1,6 +1,8 @@ [0|0] Shop square allows magic and/or prayers -[1|0] Shop square allows magic and/or prayers [2|0] Shop square allows magic and/or prayers -[0|1] Shop square allows magic and/or prayers -[1|1] Shop square allows magic and/or prayers -[2|1] Shop square allows magic and/or prayers +[4|0] Shop square allows magic and/or prayers +[8|0] Adjacent shop square allows magic and/or prayers +[0|2] Shop square allows magic and/or prayers +[2|2] Shop square allows magic and/or prayers +[4|2] Shop square allows magic and/or prayers +[8|2] Adjacent shop square allows magic and/or prayers This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-05 21:25:06
|
Revision: 8758 http://gridarta.svn.sourceforge.net/gridarta/?rev=8758&view=rev Author: akirschbaum Date: 2010-11-05 21:24:58 +0000 (Fri, 05 Nov 2010) Log Message: ----------- Fix game object parser to reject attribute names 'msg*' for 'msg'. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-11-05 20:11:52 UTC (rev 8757) +++ trunk/model/src/app/net/sf/gridarta/model/io/AbstractGameObjectParser.java 2010-11-05 21:24:58 UTC (rev 8758) @@ -136,7 +136,7 @@ objects.add(gameObject); } return gameObject; - } else if (thisLine.startsWith("msg")) { + } else if (thisLine.equals("msg")) { gameObject.setMsgText(""); while (true) { final String thisLine3 = reader.readLine(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-05 20:11:58
|
Revision: 8757 http://gridarta.svn.sourceforge.net/gridarta/?rev=8757&view=rev Author: akirschbaum Date: 2010-11-05 20:11:52 +0000 (Fri, 05 Nov 2010) Log Message: ----------- Fix game object matchers to reliably match int valued attributes. Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-05 20:09:23 UTC (rev 8756) +++ trunk/crossfire/ChangeLog 2010-11-05 20:11:52 UTC (rev 8757) @@ -1,5 +1,7 @@ 2010-11-05 Andreas Kirschbaum + * Fix game object matchers to reliably match int valued attributes. + * Add "type" attribute to <Attrib> game object matchers. Allowed values are "string" or "int"; defaults to "string" if omitted. "string" compares the attribute value literally, "int" compares as Modified: trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml =================================================================== --- trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-05 20:09:23 UTC (rev 8756) +++ trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-05 20:11:52 UTC (rev 8757) @@ -25,10 +25,10 @@ <title xml:lang="fr">Monstres</title> <title xml:lang="sv">Monster</title> <And> - <Attrib name="alive"/> + <Attrib name="alive" type="int" op="ne" value="0"/> <Or> - <Attrib name="monster"/> - <Attrib name="generator"/> + <Attrib name="monster" type="int" op="ne" value="0"/> + <Attrib name="generator" type="int" op="ne" value="0"/> </Or> </And> </GameObjectMatcher> @@ -39,9 +39,8 @@ <title xml:lang="sv">Väggar</title> <And> <TypeNrs numbers="0"/> - <Attrib name="move_block" op="ne" value=""/> - <Attrib name="move_block" op="ne" value="0"/> - <Attrib name="is_floor" value=""/> + <Attrib name="move_block" type="int" op="ne" value="0"/> + <Attrib name="is_floor" type="int" value="0"/> </And> </GameObjectMatcher> <GameObjectMatcher id="connected"> @@ -49,10 +48,7 @@ <title xml:lang="de">Verbunden</title> <title xml:lang="fr">Objets connectés</title> <title xml:lang="sv">Anslutna</title> - <And> - <Attrib name="connected" op="ne" value=""/> - <Attrib name="connected" op="ne" value="0"/> - </And> + <Attrib name="connected" type="int" op="ne" value="0"/> </GameObjectMatcher> <GameObjectMatcher id="exit"> <title xml:lang="en">Exit</title> @@ -68,10 +64,7 @@ <title xml:lang="sv">Skatter</title> <And> <TypeNrs numbers="4 5 36 60 85 111 123 124 130"/> - <Or> - <Attrib name="no_pick" value=""/> - <Attrib name="no_pick" value="0"/> - </Or> + <Attrib name="no_pick" type="int" value="0"/> </And> </GameObjectMatcher> <GameObjectMatcher id="door"> @@ -88,67 +81,61 @@ <title xml:lang="sv">Utrustning</title> <And> <TypeNrs numbers="3 13 14 15 16 33 34 35 39 70 87 99 100 104 109 113 122"/> - <Or> - <Attrib name="no_pick" value=""/> - <Attrib name="no_pick" value="0"/> - </Or> + <Attrib name="no_pick" type="int" value="0"/> </And> </GameObjectMatcher> <GameObjectMatcher id="blocked"> <title xml:lang="en">Blocked</title> <title xml:lang="de">Blockiert</title> - <And> - <Attrib name="move_block" op="ne" value=""/> - <Attrib name="move_block" op="ne" value="0"/> - </And> + <Attrib name="move_block" type="int" op="ne" value="0"/> </GameObjectMatcher> <GameObjectMatcher id="weak_wall"> <title xml:lang="en">Weak wall</title> <title xml:lang="de">Zerstörbare Wand</title> <And> - <Attrib name="alive"/> - <Attrib name="tear_down"/> + <Attrib name="alive" type="int" op="ne" value="0"/> + <Attrib name="tear_down" type="int" op="ne" value="0"/> </And> </GameObjectMatcher> <GameObjectMatcher id="invisible"> <title xml:lang="en">Hidden items</title> <title xml:lang="de">Versteckte Objekte</title> - <Attrib name="invisible"/> + <Attrib name="invisible" type="int" op="ne" value="0"/> </GameObjectMatcher> <GameObjectMatcher id="floor"> <title xml:lang="en">Floor</title> <title xml:lang="de">Boden</title> - <Attrib name="is_floor"/> + <Attrib name="is_floor" type="int" op="ne" value="0"/> </GameObjectMatcher> <GameObjectMatcher id="no_magic"> <title xml:lang="en">Magic forbidden</title> <title xml:lang="de">Magie verboten</title> <And> - <Attrib name="no_magic"/> - <Attrib name="no_pick"/> + <Attrib name="no_magic" type="int" op="ne" value="0"/> + <Attrib name="no_pick" type="int" op="ne" value="0"/> </And> </GameObjectMatcher> <GameObjectMatcher id="no_prayer"> <title xml:lang="en">Unholy ground</title> <title xml:lang="de">Ungeweihter Boden</title> <And> - <Attrib name="damned"/> - <Attrib name="no_pick"/> + <Attrib name="damned" type="int" op="ne" value="0"/> + <Attrib name="no_pick" type="int" op="ne" value="0"/> </And> </GameObjectMatcher> <GameObjectMatcher id="no_spells"> <title xml:lang="en">Spells forbidden</title> <title xml:lang="de">Zaubern verboten</title> <And> - <Attrib name="no_magic"/> - <Attrib name="damned"/> - <Attrib name="no_pick"/> + <Attrib name="no_magic" type="int" op="ne" value="0"/> + <Attrib name="damned" type="int" op="ne" value="0"/> + <Attrib name="no_pick" type="int" op="ne" value="0"/> </And> </GameObjectMatcher> <GameObjectMatcher id="living"> <title xml:lang="en">Living creature</title> <title xml:lang="de">Lebewesen</title> - <Attrib name="alive"/> + <Attrib name="alive" type="int" op="ne" value="0"/> </GameObjectMatcher> <GameObjectMatcher id="shop_square"> <title xml:lang="en">Shop Square</title> @@ -163,14 +150,14 @@ <GameObjectMatcher id="unique"> <title xml:lang="en">Unique squares/objects</title> <title xml:lang="de">'unique'-Felder/Objekte</title> - <Attrib name="unique"/> + <Attrib name="unique" type="int" op="ne" value="0"/> </GameObjectMatcher> <!-- Objects to be treated as floors in insertion tool --> <GameObjectMatcher id="system_floor" system="true"> <title xml:lang="en">Floor</title> <title xml:lang="de">Boden</title> - <Attrib name="is_floor"/> + <Attrib name="is_floor" type="int" op="ne" value="0"/> </GameObjectMatcher> <!-- Objects to be put below the floor in insertion tool --> @@ -189,10 +176,8 @@ <title xml:lang="sv">Väggar</title> <And> <TypeNrs numbers="0"/> - <Attrib name="move_block" op="ne" value=""/> - <Attrib name="move_block" op="ne" value="0"/> - <Attrib name="is_floor" value=""/> - <Attrib name="is_floor" value="0"/> + <Attrib name="move_block" type="int" op="ne" value="0"/> + <Attrib name="is_floor" type="int" value="0"/> </And> </GameObjectMatcher> @@ -205,8 +190,8 @@ <And> <Attrib name="alive"/> <Or> - <Attrib name="monster"/> - <Attrib name="generator"/> + <Attrib name="monster" type="int" op="ne" value="0"/> + <Attrib name="generator" type="int" op="ne" value="0"/> </Or> </And> </GameObjectMatcher> @@ -257,7 +242,7 @@ <Env/> <And> <TypeNrs numbers="116"/> - <Attrib name="subtype" value="10"/> + <Attrib name="subtype" type="int" value="10"/> </And> </GameObjectMatcher> @@ -267,24 +252,11 @@ <title xml:lang="en">Paid items</title> <title xml:lang="de">Bezahlte Gegenstände</title> <And> - <Or> - <Attrib name="no_pick" value=""/> - <Attrib name="no_pick" value="0"/> - </Or> - <Or> - <Attrib name="unpaid" value=""/> - <Attrib name="unpaid" value="0"/> - </Or> - <Or> - <Attrib name="monster" value=""/> - <Attrib name="monster" value="0"/> - </Or> - <Or> - <Attrib name="generator" value=""/> - <Attrib name="generator" value="0"/> - </Or> - <Attrib name="weight" op="ne" value=""/> - <Attrib name="weight" op="ne" value="0"/> + <Attrib name="no_pick" type="int" value="0"/> + <Attrib name="unpaid" type="int" value="0"/> + <Attrib name="monster" type="int" value="0"/> + <Attrib name="generator" type="int" value="0"/> + <Attrib name="weight" type="int" op="ne" value="0"/> </And> </GameObjectMatcher> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-05 20:09:30
|
Revision: 8756 http://gridarta.svn.sourceforge.net/gridarta/?rev=8756&view=rev Author: akirschbaum Date: 2010-11-05 20:09:23 +0000 (Fri, 05 Nov 2010) Log Message: ----------- Add "type" attribute to <Attrib> game object matchers. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/match/AttributeGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java trunk/model/src/app/net/sf/gridarta/model/match/ParsingException.java trunk/resource/system/dtd/GameObjectMatchers.dtd trunk/src/doc/ref/GameObjectMatcher.xhtml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml Added Paths: ----------- trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/atrinik/ChangeLog 2010-11-05 20:09:23 UTC (rev 8756) @@ -1,3 +1,10 @@ +2010-11-05 Andreas Kirschbaum + + * Add "type" attribute to <Attrib> game object matchers. Allowed + values are "string" or "int"; defaults to "string" if omitted. + "string" compares the attribute value literally, "int" compares as + integer values. + 2010-11-01 Andreas Kirschbaum * Suppress stray query dialog whether to delete the current Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/crossfire/ChangeLog 2010-11-05 20:09:23 UTC (rev 8756) @@ -1,3 +1,10 @@ +2010-11-05 Andreas Kirschbaum + + * Add "type" attribute to <Attrib> game object matchers. Allowed + values are "string" or "int"; defaults to "string" if omitted. + "string" compares the attribute value literally, "int" compares as + integer values. + 2010-11-04 Andreas Kirschbaum * Do not warn about map difficulty 0 as many existing maps use Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/daimonin/ChangeLog 2010-11-05 20:09:23 UTC (rev 8756) @@ -1,3 +1,10 @@ +2010-11-05 Andreas Kirschbaum + + * Add "type" attribute to <Attrib> game object matchers. Allowed + values are "string" or "int"; defaults to "string" if omitted. + "string" compares the attribute value literally, "int" compares as + integer values. + 2010-11-01 Andreas Kirschbaum * Suppress stray query dialog whether to delete the current Modified: trunk/model/src/app/net/sf/gridarta/model/match/AttributeGameObjectMatcher.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/AttributeGameObjectMatcher.java 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/model/src/app/net/sf/gridarta/model/match/AttributeGameObjectMatcher.java 2010-11-05 20:09:23 UTC (rev 8756) @@ -25,9 +25,9 @@ /** * An {@link GameObjectMatcher} that matches an attribute value. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> - * @todo care about int comparison + * @author Andreas Kirschbaum */ -public class AttributeGameObjectMatcher implements GameObjectMatcher { +public abstract class AttributeGameObjectMatcher implements GameObjectMatcher { /** * The serial version UID. @@ -35,20 +35,6 @@ private static final long serialVersionUID = 1L; /** - * The attribute name to match. - * @serial - */ - @NotNull - private final String name; - - /** - * The attribute value to match. - * @serial - */ - @NotNull - private final String value; - - /** * The operator to use. * @serial */ @@ -56,23 +42,11 @@ private final Operation operation; /** - * Whether to query the archetype as well. - * @serial - */ - private final boolean useDefArch; - - /** * Creates an <code>AttributeGameObjectMatcher</code>. - * @param name the attribute name to match * @param operation the <code>Operator</code> to use - * @param value the attribute value to compare with - * @param useDefArch whether to query the archetype as well */ - public AttributeGameObjectMatcher(@NotNull final String name, @NotNull final Operation operation, @NotNull final String value, final boolean useDefArch) { - this.name = name; + protected AttributeGameObjectMatcher(@NotNull final Operation operation) { this.operation = operation; - this.value = value; - this.useDefArch = useDefArch; } /** @@ -80,8 +54,7 @@ */ @Override public boolean isMatching(@NotNull final GameObject<?, ?, ?> gameObject) { - final Comparable<String> actual = gameObject.getAttributeString(name, useDefArch); - final int ret = actual.compareTo(value); + final int ret = compareValue(gameObject); switch (operation) { case eq: return ret == 0; @@ -100,4 +73,12 @@ throw new IllegalStateException(); } + /** + * Compares the attribute value of a given game object with the expected + * value. + * @param gameObject the game object + * @return <0, 0, or >0 depending on the comparison result + */ + protected abstract int compareValue(@NotNull final GameObject<?, ?, ?> gameObject); + } // class AttributeGameObjectMatcher Modified: trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java 2010-11-05 20:09:23 UTC (rev 8756) @@ -54,6 +54,13 @@ private static final String XML_ATTRIB_ATTRIBUTE_OP = "op"; /** + * The name of the "type" attribute within {@link #XML_ELEMENT_ATTRIB} + * elements. + */ + @NotNull + private static final String XML_ATTRIB_ATTRIBUTE_TYPE = "type"; + + /** * The name of the "value" attribute within {@link #XML_ELEMENT_ATTRIB} * elements. */ @@ -256,10 +263,18 @@ * Creates an {@link AttributeGameObjectMatcher}. * @param el <code><Attribute/></code> xml element * @return the created matcher + * @throws ParsingException if the attribute matcher cannot be created */ @NotNull - private static GameObjectMatcher createAttributeArchObjectMatcher(@NotNull final Element el) { - return new AttributeGameObjectMatcher(el.getAttribute(XML_ATTRIB_ATTRIBUTE_NAME), Enum.valueOf(Operation.class, el.getAttribute(XML_ATTRIB_ATTRIBUTE_OP)), el.getAttribute(XML_ATTRIB_ATTRIBUTE_VALUE), Boolean.valueOf(el.getAttribute(XML_ATTRIB_ATTRIBUTE_USEARCHETYPE))); + private static GameObjectMatcher createAttributeArchObjectMatcher(@NotNull final Element el) throws ParsingException { + final String type = el.getAttribute(XML_ATTRIB_ATTRIBUTE_TYPE); + if (type.equals("string")) { + return new StringAttributeGameObjectMatcher(el.getAttribute(XML_ATTRIB_ATTRIBUTE_NAME), Enum.valueOf(Operation.class, el.getAttribute(XML_ATTRIB_ATTRIBUTE_OP)), el.getAttribute(XML_ATTRIB_ATTRIBUTE_VALUE), Boolean.valueOf(el.getAttribute(XML_ATTRIB_ATTRIBUTE_USEARCHETYPE))); + } else if (type.equals("int")) { + return new IntAttributeGameObjectMatcher(el.getAttribute(XML_ATTRIB_ATTRIBUTE_NAME), Enum.valueOf(Operation.class, el.getAttribute(XML_ATTRIB_ATTRIBUTE_OP)), el.getAttribute(XML_ATTRIB_ATTRIBUTE_VALUE), Boolean.valueOf(el.getAttribute(XML_ATTRIB_ATTRIBUTE_USEARCHETYPE))); + } else { + throw new AssertionError("impossible value '" + type + "' for XML_ATTRIB_ATTRIBUTE_TYPE"); + } } /** Added: trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java 2010-11-05 20:09:23 UTC (rev 8756) @@ -0,0 +1,90 @@ +/* + * 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.match; + +import net.sf.gridarta.model.gameobject.GameObject; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link AttributeGameObjectMatcher} that compares attributes values using + * "int" type. + * @author Andreas Kirschbaum + */ +public class IntAttributeGameObjectMatcher extends AttributeGameObjectMatcher { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The attribute name to match. + * @serial + */ + @NotNull + private final String name; + + /** + * The attribute value to match. + * @serial + */ + private final int value; + + /** + * Whether to query the archetype as well. + * @serial + */ + private final boolean useDefArch; + + /** + * Creates an <code>AttributeGameObjectMatcher</code>. + * @param name the attribute name to match + * @param operation the <code>Operator</code> to use + * @param value the attribute value to compare with + * @param useDefArch whether to query the archetype as well + * @throws ParsingException if the value is not an integer + */ + public IntAttributeGameObjectMatcher(@NotNull final String name, @NotNull final Operation operation, @NotNull final String value, final boolean useDefArch) throws ParsingException { + super(operation); + this.name = name; + try { + this.value = Integer.parseInt(value); + } catch (final NumberFormatException ex) { + throw new ParsingException("invalid integer value: " + value, ex); + } + this.useDefArch = useDefArch; + } + + /** + * {@inheritDoc} + */ + @Override + protected int compareValue(@NotNull final GameObject<?, ?, ?> gameObject) { + final int actual = gameObject.getAttributeInt(name, useDefArch); + if (actual < value) { + return -1; + } + if (actual > value) { + return +1; + } + return 0; + } + +} // class StringAttributeGameObjectMatcher Property changes on: trunk/model/src/app/net/sf/gridarta/model/match/IntAttributeGameObjectMatcher.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/model/src/app/net/sf/gridarta/model/match/ParsingException.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/ParsingException.java 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/model/src/app/net/sf/gridarta/model/match/ParsingException.java 2010-11-05 20:09:23 UTC (rev 8756) @@ -20,6 +20,7 @@ package net.sf.gridarta.model.match; import org.jetbrains.annotations.NotNull; +import org.jetbrains.annotations.Nullable; /** * Thrown when a parsing error occurs. @@ -40,4 +41,13 @@ super(parsingError); } + /** + * Creates a new instance. + * @param parsingError the parsing error + * @param cause the cause + */ + public ParsingException(@NotNull final String parsingError, @Nullable final Throwable cause) { + super(parsingError, cause); + } + } // class ParsingException Added: trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java (rev 0) +++ trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java 2010-11-05 20:09:23 UTC (rev 8756) @@ -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.match; + +import net.sf.gridarta.model.gameobject.GameObject; +import org.jetbrains.annotations.NotNull; + +/** + * A {@link AttributeGameObjectMatcher} that compares attributes values using + * "string" type. + * @author Andreas Kirschbaum + */ +public class StringAttributeGameObjectMatcher extends AttributeGameObjectMatcher { + + /** + * The serial version UID. + */ + private static final long serialVersionUID = 1L; + + /** + * The attribute name to match. + * @serial + */ + @NotNull + private final String name; + + /** + * The attribute value to match. + * @serial + */ + @NotNull + private final String value; + + /** + * Whether to query the archetype as well. + * @serial + */ + private final boolean useDefArch; + + /** + * Creates an <code>AttributeGameObjectMatcher</code>. + * @param name the attribute name to match + * @param operation the <code>Operator</code> to use + * @param value the attribute value to compare with + * @param useDefArch whether to query the archetype as well + */ + public StringAttributeGameObjectMatcher(@NotNull final String name, @NotNull final Operation operation, @NotNull final String value, final boolean useDefArch) { + super(operation); + this.name = name; + this.value = value; + this.useDefArch = useDefArch; + } + + /** + * {@inheritDoc} + */ + @Override + protected int compareValue(@NotNull final GameObject<?, ?, ?> gameObject) { + final Comparable<String> actual = gameObject.getAttributeString(name, useDefArch); + return actual.compareTo(value); + } + +} // class StringAttributeGameObjectMatcher Property changes on: trunk/model/src/app/net/sf/gridarta/model/match/StringAttributeGameObjectMatcher.java ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Modified: trunk/resource/system/dtd/GameObjectMatchers.dtd =================================================================== --- trunk/resource/system/dtd/GameObjectMatchers.dtd 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/resource/system/dtd/GameObjectMatchers.dtd 2010-11-05 20:09:23 UTC (rev 8756) @@ -43,6 +43,7 @@ useArchetype (true|false) 'true' name NMTOKEN #REQUIRED value CDATA '1' + type (string|int) 'string' op (eq|ne|ge|gt|le|lt) 'eq' > Modified: trunk/src/doc/ref/GameObjectMatcher.xhtml =================================================================== --- trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/src/doc/ref/GameObjectMatcher.xhtml 2010-11-05 20:09:23 UTC (rev 8756) @@ -262,6 +262,9 @@ expected value: eq=equal, ne=not equal, ge=greater or equal, gt=greater, le=less or equal, lt=less. If omitted, 'eq' is assumed. +The 'type' attribute may be set to "int" to compare the attribute values as +integers. If omitted or set to "string", a string comparison is used. + The 'useArchetype' attribute specifies whether the archetype's value should be used if the game object does not define a value; it defaults to 'true' which is the normal behavior for the server. If set to 'false', a matcher can check for @@ -306,8 +309,8 @@ <pre><![CDATA[ <GameObjectMatcher id="name"> <And> - <Attrib name="damage" value="10" op="ge"/> - <Attrib name="damage" value="15" op="le"/> + <Attrib name="damage" type="int" value="10" op="ge"/> + <Attrib name="damage" type="int" value="15" op="le"/> </And> </GameObjectMatcher> ]]></pre> Modified: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml 2010-11-05 19:25:13 UTC (rev 8755) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml 2010-11-05 20:09:23 UTC (rev 8756) @@ -17,7 +17,7 @@ <title xml:lang="en">T</title> <And> <TypeNrs numbers="77" /> - <Attrib name="layer" value="7" op="ne" /> + <Attrib name="layer" type="int" value="7" op="ne" /> </And> </GameObjectMatcher> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-05 19:25:19
|
Revision: 8755 http://gridarta.svn.sourceforge.net/gridarta/?rev=8755&view=rev Author: akirschbaum Date: 2010-11-05 19:25:13 +0000 (Fri, 05 Nov 2010) Log Message: ----------- Do not consider some misspelled words as typos. Modified Paths: -------------- trunk/gridarta.ipr Modified: trunk/gridarta.ipr =================================================================== --- trunk/gridarta.ipr 2010-11-05 19:24:14 UTC (rev 8754) +++ trunk/gridarta.ipr 2010-11-05 19:25:13 UTC (rev 8755) @@ -1157,6 +1157,7 @@ <w>asmlinkage</w> <w>atrinik</w> <w>attlist</w> + <w>attrib</w> <w>attribute's</w> <w>autojoin</w> <w>autojoining</w> @@ -1365,6 +1366,7 @@ <w>treasurelists</w> <w>tristate</w> <w>typedefs</w> + <w>typenrs</w> <w>typenumbers</w> <w>tönnies</w> <w>unapplied</w> @@ -1378,6 +1380,7 @@ <w>unsets</w> <w>unsynchronized</w> <w>unwielded</w> + <w>usearchetype</w> <w>username</w> <w>validator's</w> <w>validator...</w> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-05 19:24:20
|
Revision: 8754 http://gridarta.svn.sourceforge.net/gridarta/?rev=8754&view=rev Author: akirschbaum Date: 2010-11-05 19:24:14 +0000 (Fri, 05 Nov 2010) Log Message: ----------- Replace string constants with named constants. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java Modified: trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java 2010-11-04 20:54:51 UTC (rev 8753) +++ trunk/model/src/app/net/sf/gridarta/model/match/GameObjectMatcherParser.java 2010-11-05 19:24:14 UTC (rev 8754) @@ -40,6 +40,83 @@ public class GameObjectMatcherParser { /** + * The name of the "name" attribute within {@link #XML_ELEMENT_ATTRIB} + * elements. + */ + @NotNull + private static final String XML_ATTRIB_ATTRIBUTE_NAME = "name"; + + /** + * The name of the "op" attribute within {@link #XML_ELEMENT_ATTRIB} + * elements. + */ + @NotNull + private static final String XML_ATTRIB_ATTRIBUTE_OP = "op"; + + /** + * The name of the "value" attribute within {@link #XML_ELEMENT_ATTRIB} + * elements. + */ + @NotNull + private static final String XML_ATTRIB_ATTRIBUTE_VALUE = "value"; + + /** + * The name of the "useArchetype" attribute within {@link + * #XML_ELEMENT_ATTRIB} elements. + */ + @NotNull + private static final String XML_ATTRIB_ATTRIBUTE_USEARCHETYPE = "useArchetype"; + + /** + * The name of the "id" attribute within matcher elements. + */ + @NotNull + private static final String XML_MATCHER_ATTRIBUTE_ID = "id"; + + /** + * The name of the "system" attribute within matcher elements. + */ + @NotNull + private static final String XML_MATCHER_ATTRIBUTE_SYSTEM = "system"; + + /** + * The name of the "Env" element within matcher elements. + */ + @NotNull + private static final String XML_MATCHER_ELEMENT_ENV = "Env"; + + /** + * The name of the "TypeNrs" element. + */ + @NotNull + private static final String XML_ELEMENT_TYPENRS = "TypeNrs"; + + /** + * The name of the "Attrib" element. + */ + @NotNull + private static final String XML_ELEMENT_ATTRIB = "Attrib"; + + /** + * The name of the "Or" element. + */ + @NotNull + private static final String XML_ELEMENT_OR = "Or"; + + /** + * The name of the "And" element. + */ + @NotNull + private static final String XML_ELEMENT_AND = "And"; + + /** + * The name of the "numbers" attribute within {@link #XML_ELEMENT_TYPENRS} + * elements. + */ + @NotNull + private static final String XML_TYPENRS_ATTRIBUTE_NUMBERS = "numbers"; + + /** * {@link XPath} to use. */ @NotNull @@ -67,7 +144,7 @@ if (localName == null || !localName.equals("GameObjectMatcher")) { throw new ParsingException("wrong local element name: expected \"GameObjectMatcher\" but got \" + localName + \""); } - final String id = el.getAttribute("id"); + final String id = el.getAttribute(XML_MATCHER_ATTRIBUTE_ID); String title = getLanguageTitle(el, currentLanguage); if (title == null || title.length() == 0) { title = getLanguageTitle(el, "en"); @@ -75,11 +152,11 @@ if (title == null || title.length() == 0) { title = id; } - final boolean systemMatcher = el.getAttribute("system").equals("true"); + final boolean systemMatcher = el.getAttribute(XML_MATCHER_ATTRIBUTE_SYSTEM).equals("true"); final Node content = xpathEvaluate(el, "*[last()]"); assert content != null; - final Node env = xpathEvaluate(el, "Env"); + final Node env = xpathEvaluate(el, XML_MATCHER_ELEMENT_ENV); @Nullable final GameObjectMatcher envGameObjectMatcher; if (env != null && env instanceof Element) { final Node envContent = xpathEvaluate(env, "*[1]"); @@ -119,16 +196,16 @@ final String localName = el.getLocalName(); if (localName == null) { // ignore - } else if (localName.equals("TypeNrs")) { + } else if (localName.equals(XML_ELEMENT_TYPENRS)) { return createTypeNrsArchObjectMatcher(el); - } else if (localName.equals("Attrib")) { + } else if (localName.equals(XML_ELEMENT_ATTRIB)) { return createAttributeArchObjectMatcher(el); - } else if (localName.equals("Or")) { + } else if (localName.equals(XML_ELEMENT_OR)) { return createOrMatcher(el); - } else if (localName.equals("And")) { + } else if (localName.equals(XML_ELEMENT_AND)) { return createAndMatcher(el); } - throw new ParsingException("expected element node name to be one of \"TypeNrs\", \"Attrib\", \"Or\", \"And\"."); + throw new ParsingException("expected element node name to be one of \"" + XML_ELEMENT_TYPENRS + "\", \"" + XML_ELEMENT_ATTRIB + "\", \"" + XML_ELEMENT_OR + "\", \"" + XML_ELEMENT_AND + "\"."); } /** @@ -182,7 +259,7 @@ */ @NotNull private static GameObjectMatcher createAttributeArchObjectMatcher(@NotNull final Element el) { - return new AttributeGameObjectMatcher(el.getAttribute("name"), Enum.valueOf(Operation.class, el.getAttribute("op")), el.getAttribute("value"), Boolean.valueOf(el.getAttribute("useArchetype"))); + return new AttributeGameObjectMatcher(el.getAttribute(XML_ATTRIB_ATTRIBUTE_NAME), Enum.valueOf(Operation.class, el.getAttribute(XML_ATTRIB_ATTRIBUTE_OP)), el.getAttribute(XML_ATTRIB_ATTRIBUTE_VALUE), Boolean.valueOf(el.getAttribute(XML_ATTRIB_ATTRIBUTE_USEARCHETYPE))); } /** @@ -193,7 +270,7 @@ */ @NotNull private static GameObjectMatcher createTypeNrsArchObjectMatcher(@NotNull final Element el) throws ParsingException { - final CharSequence numbers = el.getAttribute("numbers"); + final CharSequence numbers = el.getAttribute(XML_TYPENRS_ATTRIBUTE_NUMBERS); final String[] typeNrs = StringUtils.PATTERN_WHITESPACE.split(numbers, 0); final int[] types = new int[typeNrs.length]; for (int i = 0; i < types.length; i++) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-04 20:54:57
|
Revision: 8753 http://gridarta.svn.sourceforge.net/gridarta/?rev=8753&view=rev Author: akirschbaum Date: 2010-11-04 20:54:51 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Add @NotNull annotation. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquareError.java Modified: trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquareError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquareError.java 2010-11-04 20:49:31 UTC (rev 8752) +++ trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquareError.java 2010-11-04 20:54:51 UTC (rev 8753) @@ -23,6 +23,7 @@ import net.sf.gridarta.model.gameobject.GameObject; import net.sf.gridarta.model.maparchobject.MapArchObject; import net.sf.gridarta.model.mapmodel.MapSquare; +import org.jetbrains.annotations.NotNull; /** * A {@link SquareValidationError} for shop tiles that allow spells or prayers. @@ -39,7 +40,7 @@ * Creates a new instance. * @param mapSquare the square on which the error occurred */ - public ShopSquareError(final MapSquare<G, A, R> mapSquare) { + public ShopSquareError(@NotNull final MapSquare<G, A, R> mapSquare) { super(mapSquare); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-04 20:49:37
|
Revision: 8752 http://gridarta.svn.sourceforge.net/gridarta/?rev=8752&view=rev Author: akirschbaum Date: 2010-11-04 20:49:31 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Fix comment. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquareError.java Modified: trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquareError.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquareError.java 2010-11-04 19:17:57 UTC (rev 8751) +++ trunk/model/src/app/net/sf/gridarta/model/validation/errors/ShopSquareError.java 2010-11-04 20:49:31 UTC (rev 8752) @@ -25,8 +25,7 @@ import net.sf.gridarta.model.mapmodel.MapSquare; /** - * Validation error that's used when the BlockedMobOrSpawnPointChecker detected - * a possible error on the map. + * A {@link SquareValidationError} for shop tiles that allow spells or prayers. * @author <a href="mailto:ch...@ri...">Christian Hujer</a> */ public class ShopSquareError<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends SquareValidationError<G, A, R> { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-04 19:18:04
|
Revision: 8751 http://gridarta.svn.sourceforge.net/gridarta/?rev=8751&view=rev Author: akirschbaum Date: 2010-11-04 19:17:57 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Do not warn about map difficulty 0 as many existing maps use this. [Crossfire] Modified Paths: -------------- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties trunk/crossfire/ChangeLog trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapDifficultyChecker.java trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java trunk/src/doc/ref/validators.xhtml Added Paths: ----------- trunk/test-mapvalidator/crossfire/maps/MapDifficulty0 trunk/test-mapvalidator/crossfire/maps/MapDifficulty0.expected trunk/test-mapvalidator/crossfire/maps/MapDifficulty1 trunk/test-mapvalidator/crossfire/maps/MapDifficulty1.expected Removed Paths: ------------- trunk/test-mapvalidator/crossfire/maps/MapDifficulty trunk/test-mapvalidator/crossfire/maps/MapDifficulty.expected Modified: trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties =================================================================== --- trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/atrinik/src/app/net/sf/gridarta/var/atrinik/messages.properties 2010-11-04 19:17:57 UTC (rev 8751) @@ -166,7 +166,7 @@ validator.5=net.sf.gridarta.model.validation.checks.DoubleLayerChecker validator.6=net.sf.gridarta.model.validation.checks.EmptySpawnPointChecker 81 validator.7=net.sf.gridarta.model.validation.checks.ExitChecker 66 -validator.8=net.sf.gridarta.model.validation.checks.MapDifficultyChecker +validator.8=net.sf.gridarta.model.validation.checks.MapDifficultyChecker 1 10000 validator.9=net.sf.gridarta.model.validation.checks.MobOutsideSpawnPointChecker 80 validator.10=net.sf.gridarta.model.validation.checks.TilePathsChecker 8 validator.11=net.sf.gridarta.model.validation.checks.UndefinedArchetypeChecker Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/crossfire/ChangeLog 2010-11-04 19:17:57 UTC (rev 8751) @@ -1,3 +1,8 @@ +2010-11-04 Andreas Kirschbaum + + * Do not warn about map difficulty 0 as many existing maps use + this. + 2010-11-03 Andreas Kirschbaum * Do not consider game objects with "weight 0" as items. Modified: trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties =================================================================== --- trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/crossfire/src/app/net/sf/gridarta/var/crossfire/messages.properties 2010-11-04 19:17:57 UTC (rev 8751) @@ -144,7 +144,7 @@ validator.2=net.sf.gridarta.model.validation.checks.ConnectedInsideContainerChecker validator.3=net.sf.gridarta.model.validation.checks.ConnectedPickableChecker validator.4=net.sf.gridarta.model.validation.checks.ExitChecker 66 -validator.5=net.sf.gridarta.model.validation.checks.MapDifficultyChecker +validator.5=net.sf.gridarta.model.validation.checks.MapDifficultyChecker 0 10000 validator.6=net.sf.gridarta.model.validation.checks.TilePathsChecker 4 validator.7=net.sf.gridarta.model.validation.checks.UndefinedFaceChecker validator.8=net.sf.gridarta.model.validation.checks.UndefinedArchetypeChecker Modified: trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties =================================================================== --- trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/daimonin/src/app/net/sf/gridarta/var/daimonin/messages.properties 2010-11-04 19:17:57 UTC (rev 8751) @@ -168,7 +168,7 @@ validator.7=net.sf.gridarta.model.validation.checks.DoubleLayerChecker validator.8=net.sf.gridarta.model.validation.checks.EmptySpawnPointChecker 81 validator.9=net.sf.gridarta.model.validation.checks.ExitChecker 66 -validator.10=net.sf.gridarta.model.validation.checks.MapDifficultyChecker +validator.10=net.sf.gridarta.model.validation.checks.MapDifficultyChecker 1 10000 validator.11=net.sf.gridarta.model.validation.checks.MobOutsideSpawnPointChecker 80 validator.12=net.sf.gridarta.model.validation.checks.SquareWithoutFloorChecker 71,68 validator.13=net.sf.gridarta.model.validation.checks.SysObjectNotOnLayerZeroChecker Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapDifficultyChecker.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapDifficultyChecker.java 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/MapDifficultyChecker.java 2010-11-04 19:17:57 UTC (rev 8751) @@ -37,11 +37,25 @@ public class MapDifficultyChecker<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends AbstractValidator<G, A, R> implements MapValidator<G, A, R> { /** + * The minimal acceptable difficulty. + */ + private final int minDifficulty; + + /** + * The maximal acceptable difficulty. + */ + private final int maxDifficulty; + + /** * Creates a new instance. * @param validatorPreferences the validator preferences to use + * @param minDifficulty the minimal acceptable difficulty + * @param maxDifficulty the maximal acceptable difficulty */ - public MapDifficultyChecker(@NotNull final ValidatorPreferences validatorPreferences) { + public MapDifficultyChecker(@NotNull final ValidatorPreferences validatorPreferences, final int minDifficulty, final int maxDifficulty) { super(validatorPreferences); + this.minDifficulty = minDifficulty; + this.maxDifficulty = maxDifficulty; } /** @@ -51,7 +65,7 @@ public void validateMap(@NotNull final MapModel<G, A, R> mapModel, @NotNull final ErrorCollector<G, A, R> errorCollector) { final MapArchObject<A> mapArch = mapModel.getMapArchObject(); final int difficulty = mapArch.getDifficulty(); - if (difficulty < 1) { + if (difficulty < minDifficulty || difficulty > maxDifficulty) { errorCollector.collect(new MapDifficultyError<G, A, R>(mapModel, difficulty)); } } Modified: trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java =================================================================== --- trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/model/src/test/net/sf/gridarta/validation/checks/ValidatorFactoryTest.java 2010-11-04 19:17:57 UTC (rev 8751) @@ -158,7 +158,7 @@ */ @Test public void testNewMapDifficultyChecker() throws NoSuchValidatorException { - ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.MapDifficultyChecker"); + ValidationUtils.newValidatorFactory().newValidator("net.sf.gridarta.model.validation.checks.MapDifficultyChecker 1 2"); } /** Modified: trunk/src/doc/ref/validators.xhtml =================================================================== --- trunk/src/doc/ref/validators.xhtml 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/src/doc/ref/validators.xhtml 2010-11-04 19:17:57 UTC (rev 8751) @@ -212,10 +212,10 @@ <y> <message>" is reported as a per map square warning. Any other lines are reported as per map warnings.</p> -<h2>net.sf.gridarta.model.validation.checks.MapDifficultyChecker</h2> +<h2>net.sf.gridarta.model.validation.checks.MapDifficultyChecker min max</h2> -<p>A map validator that checks for valid "difficulty" map attributes. - The map attribute is considered invalid if it is less than 1.</p> +<p>A map validator that checks that the "difficulty" map attribute is + within "min..max" (inclusive).</p> <h2>net.sf.gridarta.model.validation.checks.MobOutsideSpawnPointChecker type...</h2> Deleted: trunk/test-mapvalidator/crossfire/maps/MapDifficulty =================================================================== --- trunk/test-mapvalidator/crossfire/maps/MapDifficulty 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/test-mapvalidator/crossfire/maps/MapDifficulty 2010-11-04 19:17:57 UTC (rev 8751) @@ -1,8 +0,0 @@ -arch map -name test for MapDifficulty map validator -width 1 -height 1 -msg -Created: 2010-06-27 Andreas Kirschbaum -endmsg -end Deleted: trunk/test-mapvalidator/crossfire/maps/MapDifficulty.expected =================================================================== --- trunk/test-mapvalidator/crossfire/maps/MapDifficulty.expected 2010-11-04 08:12:46 UTC (rev 8750) +++ trunk/test-mapvalidator/crossfire/maps/MapDifficulty.expected 2010-11-04 19:17:57 UTC (rev 8751) @@ -1 +0,0 @@ -Map difficulty invalid Copied: trunk/test-mapvalidator/crossfire/maps/MapDifficulty0 (from rev 8747, trunk/test-mapvalidator/crossfire/maps/MapDifficulty) =================================================================== --- trunk/test-mapvalidator/crossfire/maps/MapDifficulty0 (rev 0) +++ trunk/test-mapvalidator/crossfire/maps/MapDifficulty0 2010-11-04 19:17:57 UTC (rev 8751) @@ -0,0 +1,8 @@ +arch map +name test for MapDifficulty map validator +width 1 +height 1 +msg +Created: 2010-06-27 Andreas Kirschbaum +endmsg +end Copied: trunk/test-mapvalidator/crossfire/maps/MapDifficulty0.expected (from rev 8747, trunk/test-mapvalidator/crossfire/maps/MapDifficulty.expected) =================================================================== Added: trunk/test-mapvalidator/crossfire/maps/MapDifficulty1 =================================================================== --- trunk/test-mapvalidator/crossfire/maps/MapDifficulty1 (rev 0) +++ trunk/test-mapvalidator/crossfire/maps/MapDifficulty1 2010-11-04 19:17:57 UTC (rev 8751) @@ -0,0 +1,9 @@ +arch map +name test for MapDifficulty map validator +difficulty 12345678 +width 1 +height 1 +msg +Created: 2010-11-03 Andreas Kirschbaum +endmsg +end Property changes on: trunk/test-mapvalidator/crossfire/maps/MapDifficulty1 ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/test-mapvalidator/crossfire/maps/MapDifficulty1.expected =================================================================== --- trunk/test-mapvalidator/crossfire/maps/MapDifficulty1.expected (rev 0) +++ trunk/test-mapvalidator/crossfire/maps/MapDifficulty1.expected 2010-11-04 19:17:57 UTC (rev 8751) @@ -0,0 +1 @@ +Map difficulty invalid Property changes on: trunk/test-mapvalidator/crossfire/maps/MapDifficulty1.expected ___________________________________________________________________ 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...> - 2010-11-04 08:12:52
|
Revision: 8750 http://gridarta.svn.sourceforge.net/gridarta/?rev=8750&view=rev Author: akirschbaum Date: 2010-11-04 08:12:46 +0000 (Thu, 04 Nov 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/crossfire/resource/resource/conf/types.xml Modified: trunk/crossfire/resource/resource/conf/types.xml =================================================================== --- trunk/crossfire/resource/resource/conf/types.xml 2010-11-04 08:11:36 UTC (rev 8749) +++ trunk/crossfire/resource/resource/conf/types.xml 2010-11-04 08:12:46 UTC (rev 8750) @@ -3530,7 +3530,7 @@ </ignore> <description><![CDATA[ As the name implies, mood floors can change the "mood" of a - monsters/NPC. For example, an unaggressive monster could be turned + monster/NPC. For example, an unaggressive monster could be turned mad to start attacking. Similar, an aggressive monster could be calmed. ]]> </description> @@ -4629,7 +4629,7 @@ For map making, Skill objects serve two purposes: <p>First, the predefined skill archetypes (in the 'skills' directory) can be seen as the global skill definitions. A skill - which doesn't exists as an archetype cannot be learned or used by + which doesn't exist as an archetype cannot be learned or used by players. When you want to use skills in your maps, you may need to look up the <skill name>s of defined skill archetypes, because those strings are used as a reference in many skill-related objects. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-04 08:11:45
|
Revision: 8749 http://gridarta.svn.sourceforge.net/gridarta/?rev=8749&view=rev Author: akirschbaum Date: 2010-11-04 08:11:36 +0000 (Thu, 04 Nov 2010) 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 2010-11-03 20:09:15 UTC (rev 8748) +++ trunk/crossfire/resource/resource/conf/types.xml 2010-11-04 08:11:36 UTC (rev 8749) @@ -354,7 +354,7 @@ <ignorelists> <!-- This ignore list is for all system objects which are non pickable -and invisible. They don't interact with players at all. --> + and invisible. They don't interact with players at all. --> <ignore_list name="system_object"> <attribute arch="value"/> <attribute arch="nrof"/> @@ -371,7 +371,7 @@ </ignore_list> <!-- This ignore list is for non-pickable objects. They can be seen by -the player, but don't have values like material or weight. --> + the player, but don't have values like material or weight. --> <ignore_list name="non_pickable"> <attribute arch="value"/> <attribute arch="nrof"/> @@ -513,9 +513,10 @@ <type number="0" name="Misc"> <required> <!-- this is a special case: The "misc" type with type number 0 is -the fallback for all types which don't match any other defined types. -The required attribute "misc x" prevents that it gets confused with -other types like "monster & npc" which also have type number 0. --> + the fallback for all types which don't match any other defined + types. The required attribute "misc x" prevents that it gets + confused with other types like "monster & npc" which also have + type number 0. --> <attribute arch="misc" value="x"/> </required> <attribute arch="move_block" editor="blocked movement" type="bitmask_movement"> @@ -549,10 +550,10 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - When a player puts a defined number of certain items on the altar, - then either a spell is casted (on the player) or a connector is - triggered. If the latter is the case, the altar works only once. - Either way, the sacrificed item disappears. ]]> + When a player puts a defined number of certain items on the altar, + then either a spell is casted (on the player) or a connector is + triggered. If the latter is the case, the altar works only once. + Either way, the sacrificed item disappears. ]]> </description> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="move_on" value="walk" type="fixed"/> @@ -601,20 +602,23 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - Altar_triggers work pretty much like normal altars - (drop sacrifice -> connection activated), except for the fact that - they reset after usage. Hence, altar_triggers can be used infinitely. ]]> + Altar_triggers work pretty much like normal altars (drop sacrifice + -> connection activated), except for the fact that they reset after + usage. Hence, altar_triggers can be used infinitely. ]]> </description> <use><![CDATA[ - Altar_triggers are very useful if you want to charge a price for... - <ul> - <li> ...an item. -> Connect the altar_trigger (set "last_sp 1") to a creator. - <li> ...opening a gate. -> Connect the altar_trigger (set "last_sp 0") to the gate. - <li> ...information. -> Connect the altar_trigger (set "last_sp 1") to a magic_mouth. - </ul> - The big advantage over normal altars is the infinite usability - of altar_triggers! If there are ten players on one server, they're - quite grateful if things work more than once. =) ]]> + Altar_triggers are very useful if you want to charge a price for... + <ul> + <li> ...an item. -> Connect the altar_trigger (set "last_sp 1") to a + creator. + <li> ...opening a gate. -> Connect the altar_trigger (set "last_sp + 0") to the gate. + <li> ...information. -> Connect the altar_trigger (set "last_sp 1") + to a magic_mouth. + </ul> + The big advantage over normal altars is the infinite usability of + altar_triggers! If there are ten players on one server, they're + quite grateful if things work more than once. =) ]]> </use> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="move_block" editor="blocked movement" type="bitmask_movement"> @@ -677,12 +681,14 @@ <!--####################################################################--> <type number="39" name="Amulet"> <description><![CDATA[ - Wearing an amulet, the object's stats will directly be inherited to - the player. Amulets are usually meant for protection and defense. ]]> + Wearing an amulet, the object's stats will directly be inherited to + the player. Amulets are usually meant for protection and defense. + ]]> </description> <use><![CDATA[ - Feel free to create your own special artifacts. However, it is very - important that you keep your artifact in balance with existing maps. ]]> + Feel free to create your own special artifacts. However, it is very + important that you keep your artifact in balance with existing maps. + ]]> </use> <attribute arch="ac" editor="armor class" type="int"> This value defines the amount of armor-class bonus for wearing this @@ -693,9 +699,9 @@ <attribute arch="wc" editor="weapon class" type="int" min="-128" max="127"> The <weapon class> value adds to the overall weapon class of the wielder's melee attacks. Weapon class improves the chance of - hitting the opponent. Weapon class is the "counter piece" of <armor - class>. It should usually be set only for weapon-like items. - Lower values are better. + hitting the opponent. Weapon class is the "counter piece" of + <armor class>. It should usually be set only for weapon-like + items. Lower values are better. </attribute> <attribute arch="item_power" editor="item power" type="int"> The <item power> value measures how "powerful" an artifact is. @@ -987,24 +993,24 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - Battleground is very special: In short, players can die on battleground - without any death penalties. They don't loose or gain experience - while on battleground. Acid, draining and depletion effects don't - work either. - When a player dies on battleground, he gets teleported to an exit - location which is defined in the battleground object. ]]> + Battleground is very special: In short, players can die on + battleground without any death penalties. They don't loose or gain + experience while on battleground. Acid, draining and depletion + effects don't work either. + When a player dies on battleground, he gets teleported to an exit + location which is defined in the battleground object. ]]> </description> <use><![CDATA[ - Battleground is only meant for player vs. player duels. You can - design combat arenas similar to the one in Scorn.<br> - What should NEVER be done is placing battleground squares in - open dungeons or other free kinds of land. - It must not be possible to gain significant treasure for fighting - on battleground, because it bears no risk.<br><br> - (Battleground will cease to work when the image or name is changed, - or when it is placed beneath another floor square. - This is not a bug, it is there to prevent any attempts of placing - "hidden" battleground squares anywhere.) ]]> + Battleground is only meant for player vs. player duels. You can + design combat arenas similar to the one in Scorn.<br> + What should NEVER be done is placing battleground squares in + open dungeons or other free kinds of land. + It must not be possible to gain significant treasure for fighting + on battleground, because it bears no risk.<br><br> + (Battleground will cease to work when the image or name is changed, + or when it is placed beneath another floor square. + This is not a bug, it is there to prevent any attempts of placing + "hidden" battleground squares anywhere.) ]]> </use> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="is_floor" value="1" type="fixed"/> @@ -1024,7 +1030,8 @@ <!--####################################################################--> <type number="8" name="Book"> <description><![CDATA[ - Applying a book, the containing message is displayed to the player. ]]> + Applying a book, the containing message is displayed to the player. + ]]> </description> <attribute arch="level" editor="literacy level" type="int" min="-32768" max="32767" check_min="0" check_max="115"> If this value is set to be greater than zero, the player needs a @@ -1056,13 +1063,14 @@ <type number="99" name="Boots"> <import_type name="Amulet"/> <description><![CDATA[ - Wearing boots, the object's stats will directly be inherited to - the player. Usually enhancing his speed, or granting some minor - protection bonus. ]]> + Wearing boots, the object's stats will directly be inherited to + the player. Usually enhancing his speed, or granting some minor + protection bonus. ]]> </description> <use><![CDATA[ - Feel free to create your own special artifacts. However, it is very - important that you keep your artifact in balance with existing maps. ]]> + Feel free to create your own special artifacts. However, it is very + important that you keep your artifact in balance with existing maps. + ]]> </use> <attribute arch="exp" editor="speed bonus" type="int" min="0"> Boots with <speed bonus> will increase the player's walking @@ -1091,13 +1099,14 @@ <type number="104" name="Bracers"> <import_type name="Amulet"/> <description><![CDATA[ - Bracers are armor-plates worn around the wrists. - Wearing bracer, the object's stats will directly be inherited to - the player. Usually enhancing his defense. ]]> + Bracers are armor-plates worn around the wrists. + Wearing bracer, the object's stats will directly be inherited to + the player. Usually enhancing his defense. ]]> </description> <use><![CDATA[ - Feel free to create your own special artifacts. However, it is very - important that you keep your artifact in balance with existing maps. ]]> + Feel free to create your own special artifacts. However, it is very + important that you keep your artifact in balance with existing maps. + ]]> </use> <attribute arch="magic" editor="magic bonus" type="int"> <magic bonus> works just like ac, except that it can be @@ -1114,12 +1123,13 @@ <type number="16" name="Breastplate Armor"> <import_type name="Amulet"/> <description><![CDATA[ - Wearing an armor, the object's stats will directly be inherited to - the player. Usually enhancing his defense. ]]> + Wearing an armor, the object's stats will directly be inherited to + the player. Usually enhancing his defense. ]]> </description> <use><![CDATA[ - Feel free to create your own special artifacts. However, it is very - important that you keep your artifact in balance with existing maps. ]]> + Feel free to create your own special artifacts. However, it is very + important that you keep your artifact in balance with existing maps. + ]]> </use> <attribute arch="last_heal" editor="spellpoint penalty" type="int"> This poses a penalty to spell regeneration speed, for wearing the @@ -1146,10 +1156,10 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - When a predefined amount of weigh is placed on a button, the - <connection> value is triggered. In most cases this happens when a - player or monster steps on it. When the button is "released", the - <connection> value gets triggered a second time. ]]> + When a predefined amount of weigh is placed on a button, the + <connection> value is triggered. In most cases this happens + when a player or monster steps on it. When the button is "released", + the <connection> value gets triggered a second time. ]]> </description> <attribute arch="move_on" value="walk" type="fixed"/> <attribute arch="move_off" value="walk" type="fixed"/> @@ -1179,9 +1189,9 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - Handle buttons are buttons which reset after a short period - of time. Every time it is either applied or reset, the - <connection> value is triggered. ]]> + Handle buttons are buttons which reset after a short period + of time. Every time it is either applied or reset, the + <connection> value is triggered. ]]> </description> </type> @@ -1191,7 +1201,7 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - Class changer are used while creating a character. ]]> + Class changer are used while creating a character. ]]> </description> <attribute arch="randomitems" editor="class items" type="treasurelist"> This entry determines which initial items the character receives. @@ -1236,13 +1246,14 @@ <type number="87" name="Cloak"> <import_type name="Amulet"/> <description><![CDATA[ - Wearing a cloak, the object's stats will directly be inherited to - the player. Cloaks usually add minor <armor class> and - sometimes a bit of resistance. ]]> + Wearing a cloak, the object's stats will directly be inherited to + the player. Cloaks usually add minor <armor class> and + sometimes a bit of resistance. ]]> </description> <use><![CDATA[ - Feel free to create your own special artifacts. However, it is very - important that you keep your artifact in balance with existing maps. ]]> + Feel free to create your own special artifacts. However, it is very + important that you keep your artifact in balance with existing maps. + ]]> </use> <attribute arch="magic" editor="magic bonus" type="int"> <magic bonus> works just like ac, except that it can be @@ -1262,7 +1273,7 @@ <!--####################################################################--> <type number="9" name="Clock"> <description><![CDATA[ - Applying a clock, the time is displayed to the player. ]]> + Applying a clock, the time is displayed to the player. ]]> </description> <attribute arch_begin="msg" arch_end="endmsg" editor="description" type="text"> This text may describe the item @@ -1276,22 +1287,23 @@ <!--####################################################################--> <type number="122" name="Container"> <description><![CDATA[ - A player can put (certain kinds of) items in the container. - The overall weight of items is reduced when put inside a - container, depending on the settings. - <br><br> - A special feature of containers is the "cauldron", - capable of mixing alchemical recipes. ]]> + A player can put (certain kinds of) items in the container. + The overall weight of items is reduced when put inside a container, + depending on the settings. + <br><br> + A special feature of containers is the "cauldron", capable of mixing + alchemical recipes. ]]> </description> <use><![CDATA[ - Note on chests - There are two types of chests: - <ul> - <li> First the random treasure chests - Those are NOT containers - (but object type Treasure), they create random treasures when - applied. Archetype name is "chest". - <li> Second there are the permanent chests - Those are containers, - they can be opened and closed again. Archetype name is "chest_2". - </ul> ]]> + Note on chests - There are two types of chests: + <ul> + <li> First the random treasure chests - Those are NOT containers + (but object type Treasure), they create random treasures when + applied. Archetype name is "chest". + <li> Second there are the permanent chests - Those are containers, + they can be opened and closed again. Archetype name is + "chest_2". + </ul> ]]> </use> <attribute arch="race" editor="container class" type="string"> If set, the container will hold only certain types of objects. @@ -1299,9 +1311,10 @@ "arrows" and "keys". Unfortunately it is not easy to create new container classes, - because items need a matching counter piece attribute to the <container - class> before they can be put inside a container. This attribute - ("race") is set only for the existing container classes. + because items need a matching counter piece attribute to the + <container class> before they can be put inside a container. + This attribute ("race") is set only for the existing container + classes. </attribute> <attribute arch="slaying" editor="key string" type="string"> If <key string> is set, only players with a special key of @@ -1361,21 +1374,22 @@ <attribute arch="title"/> </ignore> <description><![CDATA[ - Converters are like "exchange tables". When the player drops a - specific type of items, they get converted into other items, at a - predefined exchange-ratio. ]]> + Converters are like "exchange tables". When the player drops a + specific type of items, they get converted into other items, at a + predefined exchange-ratio. ]]> </description> <use><![CDATA[ - Converters are better than shopping with doormats, because the - converters never get sold out. For some items like food or jewels - those "exchange tables" are really nice, while for the more important - stuff like potions converters should not exist. - <br><br> - VERY IMPORTANT: Be careful with the exchange-ratio! When you drop - items on a converter, the stuff you get must be of equal or lesser - value than before! (Except if you are using "rare" items like - dragon scales for payment). The code will not check if your ratio is - sane, so the player could gain infinite wealth by using your converter. ]]> + Converters are better than shopping with doormats, because the + converters never get sold out. For some items like food or jewels + those "exchange tables" are really nice, while for the more + important stuff like potions converters should not exist. + <br><br> + VERY IMPORTANT: Be careful with the exchange-ratio! When you drop + items on a converter, the stuff you get must be of equal or lesser + value than before! (Except if you are using "rare" items like dragon + scales for payment). The code will not check if your ratio is sane, + so the player could gain infinite wealth by using your converter. + ]]> </use> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="slaying" editor="cost arch" type="string"> @@ -1409,13 +1423,13 @@ <ignore_list name="system_object"/> </ignore> <description><![CDATA[ - A creator is an object which creates another object when it - is triggered. The child object can be anything. Creators are - VERY useful for all kinds of map-mechanisms. ]]> + A creator is an object which creates another object when it + is triggered. The child object can be anything. Creators are + VERY useful for all kinds of map-mechanisms. ]]> </description> <use><![CDATA[ - Don't hesitate to hide your creators under the floor. - The created items will still always appear on top of the floor. ]]> + Don't hesitate to hide your creators under the floor. + The created items will still always appear on top of the floor. ]]> </use> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="other_arch" editor="create arch" type="string"> @@ -1455,19 +1469,20 @@ <ignore_list name="system_object"/> </ignore> <description><![CDATA[ - Detectors work quite much like inventory checkers/pedestals: If the detector - finds a specific object, it toggles its connected value. - <br><br> - What is "unique" about them, compared to inventory checkers/ pedestals? - - First, detectors check their square for a match periodically, not - instantly. Second, detectors check directly for object names. Third, - detectors do not check the inventory of players/monsters. ]]> + Detectors work quite much like inventory checkers/pedestals: If the + detector finds a specific object, it toggles its connected value. + <br><br> + What is "unique" about them, compared to inventory + checkers/pedestals? + - First, detectors check their square for a match periodically, not + instantly. Second, detectors check directly for object names. Third, + detectors do not check the inventory of players/monsters. ]]> </description> <use><![CDATA[ - There is one major specialty about detectors: You can detect spells - blown over a detector! To detect a lighting bolt for example, set - "slaying lighting" and "speed 1.0". In combination with spellcasting - walls, this can be very useful for map-mechanisms. ]]> + There is one major specialty about detectors: You can detect spells + blown over a detector! To detect a lighting bolt for example, set + "slaying lighting" and "speed 1.0". In combination with spellcasting + walls, this can be very useful for map-mechanisms. ]]> </use> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="slaying" editor="match name" type="string"> @@ -1493,28 +1508,29 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - Directors change the direction of spell objects and other projectiles - that fly past. Unlike spinners, directors always move objects in the - same direction. It does not make a difference from what angle you - shoot into it.<br> - Directors are visible per default. ]]> + Directors change the direction of spell objects and other + projectiles that fly past. Unlike spinners, directors always move + objects in the same direction. It does not make a difference from + what angle you shoot into it.<br> + Directors are visible per default. ]]> </description> <use><![CDATA[ - Directors are rarely used in maps. Sometimes they are placed to - change the direction of spells coming out of magic walls, - "channeling" spell-projectiles in some direction. When doing this, - <b>never place directors facing each other with magic walls firing - into them!</b> The spell-projectiles bouncing between the directors - would accumulate to huge numbers and at some point slow down the - server by eating memory- and CPU-time. - <br><br> - You'd better not place directors in monster vs. player combat - areas too much, because that freaks out wizard-type players. ]]> + Directors are rarely used in maps. Sometimes they are placed to + change the direction of spells coming out of magic walls, + "channeling" spell-projectiles in some direction. When doing this, + <b>never place directors facing each other with magic walls firing + into them!</b> The spell-projectiles bouncing between the directors + would accumulate to huge numbers and at some point slow down the + server by eating memory- and CPU-time. + <br><br> + You'd better not place directors in monster vs. player combat + areas too much, because that freaks out wizard-type players. ]]> </use> <attribute arch="sp" editor="direction" type="list_direction"> - Projectiles will leave the director flying in the selected <direction>. - A director with direction <none> simply stops projectiles. - (The latter works out a bit strange for some spells). + Projectiles will leave the director flying in the selected + <direction>. A director with direction <none> simply + stops projectiles. (The latter works out a bit strange for some + spells). </attribute> <attribute arch="move_on" editor="affected movement" type="bitmask_movement"> The movement types this director affects. @@ -1527,17 +1543,17 @@ <ignore_list name="system_object"/> </ignore> <description><![CDATA[ - Diseases are an interesting form of spellcraft in Crossfire. - Once casted, they can spread out and infect creatures in a large - area. Being infected can have various effects, from amusing farts - to horrible damage - almost everything is possible. ]]> + Diseases are an interesting form of spellcraft in Crossfire. + Once casted, they can spread out and infect creatures in a large + area. Being infected can have various effects, from amusing farts + to horrible damage - almost everything is possible. ]]> </description> <use><![CDATA[ - Diseases are extremely flexible and usable in a many ways. - So far they are mostly used for causing bad, unwanted effects. - You could just as well create a disease which helps the player - (recharging mana for example). - Infection with a "positive disease" could even be a quest reward. ]]> + Diseases are extremely flexible and usable in a many ways. So far + they are mostly used for causing bad, unwanted effects. You could + just as well create a disease which helps the player (recharging + mana for example). Infection with a "positive disease" could even be + a quest reward. ]]> </use> <attribute arch="invisible" value="1" type="fixed"/> <attribute arch="level" editor="plaque level" type="int" min="-32768" max="32767" check_min="0"> @@ -1565,16 +1581,16 @@ catching it. </attribute> <attribute arch="last_grace" editor="attenuation" type="int" min="0" max="32767"> - The <attenuation> value reduces the diseases' <infectiousness> - every time it infects someone new. This limits how many - generations a disease can propagate. + The <attenuation> value reduces the diseases' + <infectiousness> every time it infects someone new. This + limits how many generations a disease can propagate. </attribute> <attribute arch="magic" editor="infection range" type="int"> <infection range> sets the range at which infection may occur. If positive, the <infection range> is level - dependant - If negative, it is not: E.g. "<infection range> - -6" means creatures can be infected in six square range, and - <plaque level> doesn't modify that. + dependant - If negative, it is not: E.g. "<infection + range> -6" means creatures can be infected in six square + range, and <plaque level> doesn't modify that. </attribute> <attribute arch="maxhp" editor="persistence" type="int" min="-32768" max="32767"> <persistence> defines how long the disease can persist @@ -1604,16 +1620,16 @@ </section> <section name="symptoms"> <attribute arch="attacktype" editor="attacktype" type="bitmask_attacktype"> - The disease will attack the host with the given <attacktype>. - Godpower attacktype is commonly used for "unresistable" - diseases. + The disease will attack the host with the given + <attacktype>. Godpower attacktype is commonly used for + "unresistable" diseases. </attribute> <attribute arch="dam" editor="damage" type="int" min="-100" max="32767"> A disease with a positive <damage> value will strike the player for that amount of damage every time the symptoms occur. - A negative <damage> value produces %-based damage: "<damage> - -10" means the player's health is reduced by 10% every time the - symptoms strike. + A negative <damage> value produces %-based damage: + "<damage> -10" means the player's health is reduced by + 10% every time the symptoms strike. Diseases with %-based damage can be dangerous - but not deadly - for players of all levels. @@ -1695,10 +1711,10 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - A door can be opened with a normal key. It also can be broken by attacking - it, and it can be defeated with the lockpicking skill. If a door is - defeated, horizontally and vertically adjacent doors are automatically - removed. ]]> + A door can be opened with a normal key. It also can be broken by + attacking it, and it can be defeated with the lockpicking skill. If + a door is defeated, horizontally and vertically adjacent doors are + automatically removed. ]]> </description> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="alive" value="1" type="fixed"/> @@ -1714,8 +1730,9 @@ If set to non-zero, the door cannot be destroyed by attacking it. </attribute> <attribute arch="ac" editor="armor class" type="int"> - Doors of high <armor class> are less likely to get hit. <armor - class> can be considered the "counter piece" to <weapon class>. + Doors of high <armor class> are less likely to get hit. + <armor class> can be considered the "counter piece" to + <weapon class>. </attribute> <attribute arch="other_arch" editor="drop arch" type="string"> This string defines the object that will be created when the door @@ -1756,22 +1773,26 @@ <ignore_list name="system_object"/> </ignore> <description><![CDATA[ - When activated, a duplicator can duplicate, multiply or destroy a pile of - objects which lies somewhere on top of the duplicator. - The duplicator has one arch name specified as <target arch>, - and only objects of this archetype can be affected.<br> - It will multiply the number of items in the pile, by the <multiply factor>. - If the latter is set to zero, it will destroy objects. ]]> + When activated, a duplicator can duplicate, multiply or destroy a + pile of objects which lies somewhere on top of the duplicator. The + duplicator has one arch name specified as <target arch>, and + only objects of this archetype can be affected. + <br> + It will multiply the number of items in the pile, by the + <multiply factor>. If the latter is set to zero, it will + destroy objects. ]]> </description> <use><![CDATA[ - I hope it is clear that one must be very cautious when inserting a duplicator - anywhere with <multiply factor> greater than one. - It is designed to be used for betting mechanisms only (bet -> win/loose). - It is <b>not acceptable</b> to allow duplication of anything other than - coins, gold and jewels. Besides, it is very important that the chance to - loose the input matches the chance to earn winnings.<br> - A duplicator with <multiply factor> 3 for example should have a - loosing rate of 2/3 = 67%. ]]> + I hope it is clear that one must be very cautious when inserting a + duplicator anywhere with <multiply factor> greater than one. + It is designed to be used for betting mechanisms only (bet -> + win/loose). It is <b>not acceptable</b> to allow duplication of + anything other than coins, gold and jewels. Besides, it is very + important that the chance to loose the input matches the chance to + earn winnings. + <br> + A duplicator with <multiply factor> 3 for example should have + a loosing rate of 2/3 = 67%. ]]> </use> <attribute arch="other_arch" editor="target arch" type="string"> Only objects of matching archetype, lying on top of the duplicator @@ -1798,8 +1819,8 @@ <ignore_list name="event_object"/> </ignore> <description><![CDATA[ - Scripts are to be put in object's inventory. They execute an external - script file when the trigger condition is met.]]> + Scripts are to be put in object's inventory. They execute an + external script file when the trigger condition is met.]]> </description> <attribute arch="subtype" editor="event type" type="list_event"> The event type determines the trigger condition. @@ -1824,18 +1845,20 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - When the player applies an exit, he is transferred to a different location. - (Monsters cannot use exits.) Depending on how it is set, the player applies - the exit just by walking into it, or by pressing <a>pply when standing on - the exit. ]]> + When the player applies an exit, he is transferred to a different + location. (Monsters cannot use exits.) Depending on how it is set, + the player applies the exit just by walking into it, or by pressing + <a>pply when standing on the exit. ]]> </description> <use><![CDATA[ - If you want to have an invisible exit, set <invisible> (, of course - <apply by walking>), and put it *under* the floor. Otherwise it could be - detected with the show_invisible spell. - <br><br> - You can be quite creative with the outlook of secret exits (their "face"). - Don't forget to give the player reliable hints about them though. ]]> + If you want to have an invisible exit, set <invisible> (, of + course <apply by walking>), and put it *under* the floor. + Otherwise it could be detected with the show_invisible spell. + <br> + <br> + You can be quite creative with the outlook of secret exits (their + "face"). Don't forget to give the player reliable hints about them + though. ]]> </use> <attribute arch="slaying" editor="exit path" type="map_path"> The exit path defines the map that the player is transferred to. You @@ -1897,25 +1920,29 @@ <!--####################################################################--> <type number="72" name="Flesh"> <description><![CDATA[ - Just like with food, the player can fill his stomach and gain a - little health by eating flesh-objects. <br> - For dragon players, flesh plays a very special role though: If the - flesh has resistances set, a dragon player has a chance to gain resistance in - those categories. The only constraint to this process is the <flesh level>. - Don't forget that flesh items with resistances have to be balanced - according to map/monster difficulty. ]]> + Just like with food, the player can fill his stomach and gain a + little health by eating flesh-objects. + <br> + For dragon players, flesh plays a very special role though: If the + flesh has resistances set, a dragon player has a chance to gain + resistance in those categories. The only constraint to this process + is the <flesh level>. Don't forget that flesh items with + resistances have to be balanced according to map/monster difficulty. + ]]> </description> <use><![CDATA[ - For dragon players, flesh items can be highly valuable. Note that many - standard monsters carry flesh items from their <treasurelist>. - These flesh items "inherit" resistances and level from the monster they belong to. - When you add special flesh items to the inventory of a monster, this is - not the case - so you have to set it manually. - <br><br> - Generally adding special flesh-treaties for dragon players is a great thing - to do. Always consider that dragon players might really not be interested - in that special piece of weapon or armor, so don't let the dragon-fellows miss - out on the reward completely. ]]> + For dragon players, flesh items can be highly valuable. Note that + many standard monsters carry flesh items from their + <treasurelist>. These flesh items "inherit" resistances and + level from the monster they belong to. When you add special flesh + items to the inventory of a monster, this is not the case - so you + have to set it manually. + <br> + <br> + Generally adding special flesh-treaties for dragon players is a + great thing to do. Always consider that dragon players might really + not be interested in that special piece of weapon or armor, so don't + let the dragon-fellows miss out on the reward completely. ]]> </use> <attribute arch="food" editor="food points" type="int" min="0" max="32767"> The player's stomach will get filled with this amount of food @@ -2090,8 +2117,8 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - Floor is a very basic thing without too much - functionality. It's a floor - you stand on it. ]]> + Floor is a very basic thing without too much functionality. It's a + floor - you stand on it. ]]> </description> <attribute arch="is_floor" value="1" type="fixed"/> <attribute arch="no_pick" value="1" type="fixed"/> @@ -2143,12 +2170,12 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - Encounter-Floor is pretty much the same as normal floor. - Most outdoor floor/ground-arches are set to be "encounters". - That is kind of a relict from former code: When walking over - encounter-floor, players sometimes got beamed to little maps - with monsters on them. Nowadays this feature is disabled - - Hence encounter floor is not different from normal floor. ]]> + Encounter-Floor is pretty much the same as normal floor. Most + outdoor floor/ground-arches are set to be "encounters". That is kind + of a relict from former code: When walking over encounter-floor, + players sometimes got beamed to little maps with monsters on them. + Nowadays this feature is disabled - Hence encounter floor is not + different from normal floor. ]]> </description> <attribute arch="is_floor" value="1" type="fixed"/> <attribute arch="no_pick" value="1" type="fixed"/> @@ -2197,8 +2224,8 @@ <!--####################################################################--> <type number="6" name="Food"> <description><![CDATA[ - By eating/drinking food-objects, the player can fill his - stomach and gain a little health. ]]> + By eating/drinking food-objects, the player can fill his + stomach and gain a little health. ]]> </description> <attribute arch="food" editor="food points" type="int" min="0" max="32767"> The player's stomach will get filled with this amount of food @@ -2224,16 +2251,16 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - Gates play an important role in Crossfire. Gates can be opened - by activating a button/trigger, by speaking passwords (-> magic_ear) - or carrying special key-objects (-> inventory checker). - Unlike locked doors, gates can get shut again after a player has - passed, which makes them more practical in many cases. ]]> + Gates play an important role in Crossfire. Gates can be opened + by activating a button/trigger, by speaking passwords (-> magic_ear) + or carrying special key-objects (-> inventory checker). + Unlike locked doors, gates can get shut again after a player has + passed, which makes them more practical in many cases. ]]> </description> <use><![CDATA[ - Use gates to divide your maps into separated areas. After solving - area A, the player gains access to area B, and so on. Make your - maps more complex than "one-way". ]]> + Use gates to divide your maps into separated areas. After solving + area A, the player gains access to area B, and so on. Make your + maps more complex than "one-way". ]]> </use> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="connected" editor="connection" type="int"> @@ -2265,13 +2292,14 @@ <type number="113" name="Girdle"> <import_type name="Amulet"/> <description><![CDATA[ - Wearing a girdle, the object's stats will directly be inherited to - the player. Girdles usually provide stats- or damage bonuses and no - defense. ]]> + Wearing a girdle, the object's stats will directly be inherited to + the player. Girdles usually provide stats- or damage bonuses and no + defense. ]]> </description> <use><![CDATA[ - Feel free to create your own special artifacts. However, it is very - important that you keep your artifact in balance with existing maps. ]]> + Feel free to create your own special artifacts. However, it is very + important that you keep your artifact in balance with existing maps. + ]]> </use> <attribute arch="magic" editor="magic bonus" type="int"> <magic bonus> works just like ac, except that it can be @@ -2292,12 +2320,13 @@ <type number="100" name="Gloves"> <import_type name="Amulet"/> <description><![CDATA[ - Wearing gloves, the object's stats will directly be inherited to - the player. Gloves can add defense or damage bonuses. ]]> + Wearing gloves, the object's stats will directly be inherited to the + player. Gloves can add defense or damage bonuses. ]]> </description> <use><![CDATA[ - Feel free to create your own special artifacts. However, it is very - important that you keep your artifact in balance with existing maps. ]]> + Feel free to create your own special artifacts. However, it is very + important that you keep your artifact in balance with existing maps. + ]]> </use> <attribute arch="magic" editor="magic bonus" type="int"> If the gloves provide <armor class>, <magic bonus> will @@ -2316,14 +2345,15 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - A handle can be applied by players and (certain) monsters. - Every time it is applied, the <connection> value is triggered. ]]> + A handle can be applied by players and (certain) monsters. + Every time it is applied, the <connection> value is triggered. + ]]> </description> <use><![CDATA[ - Handles are commonly used to move gates. When placing your lever, - don't forget that some monsters are able to apply it. - The ability to apply levers is rare among monsters - - but vampires can do it for example. ]]> + Handles are commonly used to move gates. When placing your lever, + don't forget that some monsters are able to apply it. The ability to + apply levers is rare among monsters - but vampires can do it for + example. ]]> </use> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="connected" editor="connection" type="int"> @@ -2347,14 +2377,15 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - Handle triggers are handles which reset after a short period - of time. Every time it is either applied or reset, the - <connection> value is triggered. ]]> + Handle triggers are handles which reset after a short period of + time. Every time it is either applied or reset, the + <connection> value is triggered. ]]> </description> <use><![CDATA[ - When you connect an ordinary handle to a gate, the gate normally remains - opened after the first player passed. If you want to keep the gate shut, - connecting it to a handle trigger is an easy solution. ]]> + When you connect an ordinary handle to a gate, the gate normally + remains opened after the first player passed. If you want to keep + the gate shut, connecting it to a handle trigger is an easy + solution. ]]> </use> <attribute arch="race_restriction" editor="race restriction" type="string"> If this is set to a : separated (with leading and trailing :) list @@ -2371,16 +2402,17 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - The best example for Hazard Floor is lava. It works like standard - floor, but damages all creatures standing on it. - Damage is taken in regular time intervals. ]]> + The best example for Hazard Floor is lava. It works like standard + floor, but damages all creatures standing on it. Damage is taken in + regular time intervals. ]]> </description> <use><![CDATA[ - The default lava for example does minor damage. But you can turn - it up so that your hazard floor poses a real threat.<br> - Like magic walls, such floors add a permanent thrill to your map. - You can use that to safely chase off too-weak players, or just - to have something different. ]]> + The default lava for example does minor damage. But you can turn it + up so that your hazard floor poses a real threat. + <br> + Like magic walls, such floors add a permanent thrill to your map. + You can use that to safely chase off too-weak players, or just to + have something different. ]]> </use> <attribute arch="is_floor" value="1" type="fixed"/> <attribute arch="lifesave" value="1" type="fixed"/> @@ -2417,15 +2449,15 @@ </attribute> <attribute arch="move_slow_penalty" editor="slow penalty" type="float"> <![CDATA[<html> - If <slow movement> is set to a value greater zero, all - creatures moving over this spot will be slower than normal. - <ul> - <li><slow movement> 1 - rough terrain - <li><slow movement> 2 - very rough terrain - <li>... - <li><slow movement> 7 - spider web (sticky as hell) - </ul> - ]]> + If <slow movement> is set to a value greater zero, all + creatures moving over this spot will be slower than normal. + <ul> + <li><slow movement> 1 - rough terrain + <li><slow movement> 2 - very rough terrain + <li>... + <li><slow movement> 7 - spider web (sticky as hell) + </ul> + ]]> </attribute> <attribute arch="is_wooded" editor="wooded terrain" type="bool"> This flag indicates this spot contains wood or high grass. @@ -2455,14 +2487,15 @@ <type number="34" name="Helmet"> <import_type name="Amulet"/> <description><![CDATA[ - Wearing a helmet, the object's stats will directly be inherited to - the player. Normal helmets usually increase defense, while crowns - add more special bonuses like stats/resistances paired with - low defense. ]]> + Wearing a helmet, the object's stats will directly be inherited to + the player. Normal helmets usually increase defense, while crowns + add more special bonuses like stats/resistances paired with low + defense. ]]> </description> <use><![CDATA[ - Feel free to create your own special artifacts. However, it is very - important that you keep your artifact in balance with existing maps. ]]> + Feel free to create your own special artifacts. However, it is very + important that you keep your artifact in balance with existing maps. + ]]> </use> <attribute arch="magic" editor="magic bonus" type="int"> <magic bonus> works just like ac, except that it can be @@ -2485,9 +2518,9 @@ <ignore_list name="non_pickable"/> </ignore> <description><![CDATA[ - Holy_altars are altars for the various religions. Praying - at a Holy_altar will make you a follower of that god, and - if you already follow that god, you may get some extra bonus. ]]> + Holy_altars are altars for the various religions. Praying at a + Holy_altar will make you a follower of that god, and if you already + follow that god, you may get some extra bonus. ]]> </description> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="move_block" editor="blocked movement" type="bitmask_movement"> @@ -2519,17 +2552,18 @@ <attribute arch="title"/> </ignore> <description><![CDATA[ - Horns are very similar to rods. The difference is that horns regenerate - spellpoints faster and thus are more valuable than rods. - <br><br> - A horn contains a spell. The player can use this spell by applying and - "firing" (blowing) the horn. Unlike wands/scrolls, horns can be - used endlessly. ]]> + Horns are very similar to rods. The difference is that horns + regenerate spellpoints faster and thus are more valuable than rods. + <br> + <br> + A horn contains a spell. The player can use this spell by applying + and "firing" (blowing) the horn. Unlike wands/scrolls, horns can be + used endlessly. ]]> </description> <use><![CDATA[ - Horns are powerful due to their fast recharge rate. They should - never contain high level attacking spells. Even curing/healing spells - are almost too good on a horn. ]]> + Horns are powerful due to their fast recharge rate. They should + never contain high level attacking spells. Even curing/healing + spells are almost too good on a horn. ]]> </use> <attribute arch="" editor="spell" type="inv_spell"> Sets the <spell> of the horn. Consider twice before handing @@ -2567,9 +2601,8 @@ <!--####################################################################--> <type number="73" name="Inorganic"> <description><![CDATA[ - Inorganic materials are generally used as ingredients for - alchemical recipes. By themselves, they have no special - functionality. ]]> + Inorganic materials are generally used as ingredients for alchemical + recipes. By themselves, they have no special functionality. ]]> </description> <section name="resistance"> <attribute arch="resist_physical" editor="resist physical %" length="15" type="int"></attribute> @@ -2593,25 +2626,28 @@ <ignore_list name="system_object"/> </ignore> <description><![CDATA[ - Inventory checkers passively check the players inventory for a - specific object. You can set a connected value that is triggered - either if that object is present or missing (-> "last_sp") when a - player walks over the inventory checker. A valid option is to remove the - matching object (usually not recommended, see "last_heal"). - <br><br> - Alternatively, you can set your inventory checker to block all players - that do/don't carry the matching object (-> "blocked movement"). - <br><br> - As you can see, inventory checkers are quite powerful, holding a - great variety of possibilities. ]]> + Inventory checkers passively check the players inventory for a + specific object. You can set a connected value that is triggered + either if that object is present or missing (-> "last_sp") when a + player walks over the inventory checker. A valid option is to remove + the matching object (usually not recommended, see "last_heal"). + <br> + <br> + Alternatively, you can set your inventory checker to block all + players that do/don't carry the matching object (-> "blocked + movement"). + <br> + <br> + As you can see, inventory checkers are quite powerful, holding a + great variety of possibilities. ]]> </description> <use><![CDATA[ - Putting a check_inventory space in front of a gate (one below) and - one on the opposite side works reasonably well as a control mechanism. - Unlike the key/door-combo, this one works infinite since it is - independent from map reset. Use it to put a "structure" into your - maps: Player must solve area A to gain access to area B. This concept - can be found in nearly every RPG - simple but effective. ]]> + Putting a check_inventory space in front of a gate (one below) and + one on the opposite side works reasonably well as a control + mechanism. Unlike the key/door-combo, this one works infinite since + it is independent from map reset. Use it to put a "structure" into + your maps: Player must solve area A to gain access to area B. This + concept can be found in nearly every RPG - simple but effective. ]]> </use> <attribute arch="no_pick" value="1" type="fixed"/> <attribute arch="slaying" editor="match key string" type="string"> @@ -2635,11 +2671,11 @@ if the player does/don't carry an object that is of type <match type>. - Example: Set <match type> 15 (type 15 => weapon) and <blocking - passage> enabled. Now you have an inventory checker blocking all - players that carry any kind of melee weapon. To pass, a player is - forced to leave behind all his weaponry... bad news for a warrior. - ;) + Example: Set <match type> 15 (type 15 => weapon) and + <blocking passage> enabled. Now you have an inventory checker + blocking all players that carry any kind of melee weapon. To pass, a + player is forced to leave behind all his weaponry... bad news for a + warrior. ;) </attribute> <attribute arch="last_sp" editor="match = having" type="bool"> Enabled means having that object is a match. Disabled means not @@ -2670,23 +2706,26 @@ <!--####################################################################--> <type number="163" name="Item Transformer"> <description><![CDATA[ - An item transformer is simply applied, after having marked a 'victim' - item. If the victim is suitable, it will be transformed into something - else.]]> + An item transformer is simply applied, after having marked a + 'victim' item. If the victim is suitable, it will be transformed + into something else.]]> </description> <use><![CDATA[ - To make an item transformable, you just have to fill the 'slaying' field. - The syntax is: - <br> - <pre>slaying slayer:[yield ]new_item[;slayer:[yield ]new_item]*</pre> - <br> - with [] denoting optional part, and * any number of preceding []. - 'new_item' must be the name of an existing archetype. - <br><br> - Example, for object apple: slaying knife:2 half_apple - <br><br> - This means that, when applying a knife (should be an Item Transformer), - one 'apple' will be transformed into 2 'half_apple'.]]> + To make an item transformable, you just have to fill the 'slaying' + field. The syntax is: + <br> + <pre>slaying slayer:[yield ]new_item[;slayer:[yield ]new_item]*</pre> + <br> + with [] denoting optional part, and * any number of preceding []. + 'new_item' must be the name of an existing archetype. + <br> + <br> + Example, for object apple: slaying knife:2 half_apple + <br> + <br> + This means that, when applying a knife (should be an Item + Transformer), one 'apple' will be transformed into 2 'half_apple'. + ]]> </use> <attribute arch="food" editor="number of uses" type="int" min="0" max="32767"> <number of uses> controls how many times the item transformer @@ -2708,9 +2747,9 @@ <!--####################################################################--> <type number="60" name="Jewel"> <description><![CDATA[ - Items of the type Gold & Jewels are handled like a currency. - Unlike for any other type of item, in shops, the buy- and selling - prices differ only marginally. ]]> + Items of the type Gold & Jewels are handled like a currency. + Unlike for a... [truncated message content] |
From: <aki...@us...> - 2010-11-03 20:09:21
|
Revision: 8748 http://gridarta.svn.sourceforge.net/gridarta/?rev=8748&view=rev Author: akirschbaum Date: 2010-11-03 20:09:15 +0000 (Wed, 03 Nov 2010) Log Message: ----------- Do not consider game objects with "weight 0" as items. [Crossfire] Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml trunk/test-mapvalidator/crossfire/arch/rod1.arc trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-03 07:58:12 UTC (rev 8747) +++ trunk/crossfire/ChangeLog 2010-11-03 20:09:15 UTC (rev 8748) @@ -1,5 +1,7 @@ 2010-11-03 Andreas Kirschbaum + * Do not consider game objects with "weight 0" as items. + * Update game object matchers to handle redundant "attribute 0" lines. Modified: trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml =================================================================== --- trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-03 07:58:12 UTC (rev 8747) +++ trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-03 20:09:15 UTC (rev 8748) @@ -283,6 +283,8 @@ <Attrib name="generator" value=""/> <Attrib name="generator" value="0"/> </Or> + <Attrib name="weight" op="ne" value=""/> + <Attrib name="weight" op="ne" value="0"/> </And> </GameObjectMatcher> Modified: trunk/test-mapvalidator/crossfire/arch/rod1.arc =================================================================== --- trunk/test-mapvalidator/crossfire/arch/rod1.arc 2010-11-03 07:58:12 UTC (rev 8747) +++ trunk/test-mapvalidator/crossfire/arch/rod1.arc 2010-11-03 20:09:15 UTC (rev 8748) @@ -1,4 +1,5 @@ Object rod1 type 3 level 1 +weight 10 end Modified: trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare =================================================================== --- trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-03 07:58:12 UTC (rev 8747) +++ trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-03 20:09:15 UTC (rev 8748) @@ -1,7 +1,7 @@ arch map name test for ShopSquare map validator difficulty 1 -width 5 +width 6 height 4 msg Created: 2010-06-27 Andreas Kirschbaum @@ -90,3 +90,21 @@ y 2 generator 1 end +arch shop2 +x 5 +y 1 +end +arch rod1 +x 5 +y 1 +weight 0 +end +arch shop2 +x 5 +y 2 +end +arch rod1 +x 5 +y 2 +weight 1 +end Modified: trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected =================================================================== --- trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected 2010-11-03 07:58:12 UTC (rev 8747) +++ trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected 2010-11-03 20:09:15 UTC (rev 8748) @@ -3,3 +3,4 @@ [2|1] Shop square contains paid item [3|1] Shop square contains paid item [4|1] Shop square contains paid item +[5|2] Shop square contains paid item This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-03 07:58:19
|
Revision: 8747 http://gridarta.svn.sourceforge.net/gridarta/?rev=8747&view=rev Author: akirschbaum Date: 2010-11-03 07:58:12 +0000 (Wed, 03 Nov 2010) Log Message: ----------- Update game object matchers to handle redundant "attribute 0" lines. [Crossfire] Modified Paths: -------------- trunk/crossfire/ChangeLog trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-11-01 13:53:06 UTC (rev 8746) +++ trunk/crossfire/ChangeLog 2010-11-03 07:58:12 UTC (rev 8747) @@ -1,3 +1,8 @@ +2010-11-03 Andreas Kirschbaum + + * Update game object matchers to handle redundant "attribute 0" + lines. + 2010-11-01 Andreas Kirschbaum * Suppress stray query dialog whether to delete the current Modified: trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml =================================================================== --- trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-01 13:53:06 UTC (rev 8746) +++ trunk/crossfire/resource/resource/conf/GameObjectMatchers.xml 2010-11-03 07:58:12 UTC (rev 8747) @@ -40,6 +40,7 @@ <And> <TypeNrs numbers="0"/> <Attrib name="move_block" op="ne" value=""/> + <Attrib name="move_block" op="ne" value="0"/> <Attrib name="is_floor" value=""/> </And> </GameObjectMatcher> @@ -48,7 +49,10 @@ <title xml:lang="de">Verbunden</title> <title xml:lang="fr">Objets connectés</title> <title xml:lang="sv">Anslutna</title> - <Attrib name="connected" op="ne" value=""/> + <And> + <Attrib name="connected" op="ne" value=""/> + <Attrib name="connected" op="ne" value="0"/> + </And> </GameObjectMatcher> <GameObjectMatcher id="exit"> <title xml:lang="en">Exit</title> @@ -64,7 +68,10 @@ <title xml:lang="sv">Skatter</title> <And> <TypeNrs numbers="4 5 36 60 85 111 123 124 130"/> - <Attrib name="no_pick" value=""/> + <Or> + <Attrib name="no_pick" value=""/> + <Attrib name="no_pick" value="0"/> + </Or> </And> </GameObjectMatcher> <GameObjectMatcher id="door"> @@ -81,13 +88,19 @@ <title xml:lang="sv">Utrustning</title> <And> <TypeNrs numbers="3 13 14 15 16 33 34 35 39 70 87 99 100 104 109 113 122"/> - <Attrib name="no_pick" value=""/> + <Or> + <Attrib name="no_pick" value=""/> + <Attrib name="no_pick" value="0"/> + </Or> </And> </GameObjectMatcher> <GameObjectMatcher id="blocked"> <title xml:lang="en">Blocked</title> <title xml:lang="de">Blockiert</title> - <Attrib name="move_block" op="ne" value=""/> + <And> + <Attrib name="move_block" op="ne" value=""/> + <Attrib name="move_block" op="ne" value="0"/> + </And> </GameObjectMatcher> <GameObjectMatcher id="weak_wall"> <title xml:lang="en">Weak wall</title> @@ -177,7 +190,9 @@ <And> <TypeNrs numbers="0"/> <Attrib name="move_block" op="ne" value=""/> + <Attrib name="move_block" op="ne" value="0"/> <Attrib name="is_floor" value=""/> + <Attrib name="is_floor" value="0"/> </And> </GameObjectMatcher> @@ -252,10 +267,22 @@ <title xml:lang="en">Paid items</title> <title xml:lang="de">Bezahlte Gegenstände</title> <And> - <Attrib name="no_pick" value=""/> - <Attrib name="unpaid" value=""/> - <Attrib name="monster" value=""/> - <Attrib name="generator" value=""/> + <Or> + <Attrib name="no_pick" value=""/> + <Attrib name="no_pick" value="0"/> + </Or> + <Or> + <Attrib name="unpaid" value=""/> + <Attrib name="unpaid" value="0"/> + </Or> + <Or> + <Attrib name="monster" value=""/> + <Attrib name="monster" value="0"/> + </Or> + <Or> + <Attrib name="generator" value=""/> + <Attrib name="generator" value="0"/> + </Or> </And> </GameObjectMatcher> Modified: trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare =================================================================== --- trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-01 13:53:06 UTC (rev 8746) +++ trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare 2010-11-03 07:58:12 UTC (rev 8747) @@ -1,10 +1,11 @@ arch map name test for ShopSquare map validator difficulty 1 -width 1 -height 3 +width 5 +height 4 msg Created: 2010-06-27 Andreas Kirschbaum +Modified: 2010-11-03 Andreas Kirschbaum endmsg end arch shop2 @@ -12,15 +13,80 @@ arch rod1 end arch shop2 +y 3 +end +arch mob1 +y 3 +end +arch shop2 +x 1 y 1 end arch rod1 +x 1 y 1 +no_pick 0 +end +arch shop2 +x 1 +y 2 +end +arch rod1 +x 1 +y 2 +no_pick 1 +end +arch shop2 +x 2 +y 1 +end +arch rod1 +x 2 +y 1 +unpaid 0 +end +arch shop2 +x 2 +y 2 +end +arch rod1 +x 2 +y 2 unpaid 1 end arch shop2 +x 3 +y 1 +end +arch rod1 +x 3 +y 1 +monster 0 +end +arch shop2 +x 3 y 2 end -arch mob1 +arch rod1 +x 3 y 2 +monster 1 end +arch shop2 +x 4 +y 1 +end +arch rod1 +x 4 +y 1 +generator 0 +end +arch shop2 +x 4 +y 2 +end +arch rod1 +x 4 +y 2 +generator 1 +end Modified: trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected =================================================================== --- trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected 2010-11-01 13:53:06 UTC (rev 8746) +++ trunk/test-mapvalidator/crossfire/maps/PaidItemShopSquare.expected 2010-11-03 07:58:12 UTC (rev 8747) @@ -1 +1,5 @@ [0|0] Shop square contains paid item +[1|1] Shop square contains paid item +[2|1] Shop square contains paid item +[3|1] Shop square contains paid item +[4|1] Shop square contains paid item This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-01 13:53:12
|
Revision: 8746 http://gridarta.svn.sourceforge.net/gridarta/?rev=8746&view=rev Author: akirschbaum Date: 2010-11-01 13:53:06 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Fix comment. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java Modified: trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java 2010-11-01 13:52:50 UTC (rev 8745) +++ trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java 2010-11-01 13:53:06 UTC (rev 8746) @@ -240,7 +240,7 @@ } /** - * Executes the "close map" action. + * Executes the "delete pickmap" action. * @param performAction whether the action should be performed * @return whether the action was or can be performed */ This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-01 13:52:56
|
Revision: 8745 http://gridarta.svn.sourceforge.net/gridarta/?rev=8745&view=rev Author: akirschbaum Date: 2010-11-01 13:52:50 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Suppress stray query dialog whether to delete the current pickmap folder when switching between pickmap folders. Modified Paths: -------------- branches/0.8/atrinik/ChangeLog branches/0.8/crossfire/ChangeLog branches/0.8/daimonin/ChangeLog branches/0.8/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java Modified: branches/0.8/atrinik/ChangeLog =================================================================== --- branches/0.8/atrinik/ChangeLog 2010-11-01 13:52:18 UTC (rev 8744) +++ branches/0.8/atrinik/ChangeLog 2010-11-01 13:52:50 UTC (rev 8745) @@ -1,3 +1,8 @@ +2010-11-01 Andreas Kirschbaum + + * Suppress stray query dialog whether to delete the current + pickmap folder when switching between pickmap folders. + 2010-10-10 Andreas Kirschbaum * Correctly update game object type in undo/redo. Modified: branches/0.8/crossfire/ChangeLog =================================================================== --- branches/0.8/crossfire/ChangeLog 2010-11-01 13:52:18 UTC (rev 8744) +++ branches/0.8/crossfire/ChangeLog 2010-11-01 13:52:50 UTC (rev 8745) @@ -1,3 +1,8 @@ +2010-11-01 Andreas Kirschbaum + + * Suppress stray query dialog whether to delete the current + pickmap folder when switching between pickmap folders. + 2010-10-10 Andreas Kirschbaum * Correctly update game object type in undo/redo. Modified: branches/0.8/daimonin/ChangeLog =================================================================== --- branches/0.8/daimonin/ChangeLog 2010-11-01 13:52:18 UTC (rev 8744) +++ branches/0.8/daimonin/ChangeLog 2010-11-01 13:52:50 UTC (rev 8745) @@ -1,3 +1,8 @@ +2010-11-01 Andreas Kirschbaum + + * Suppress stray query dialog whether to delete the current + pickmap folder when switching between pickmap folders. + 2010-10-10 Andreas Kirschbaum * Correctly update game object type in undo/redo. Modified: branches/0.8/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java =================================================================== --- branches/0.8/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java 2010-11-01 13:52:18 UTC (rev 8744) +++ branches/0.8/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java 2010-11-01 13:52:50 UTC (rev 8745) @@ -198,11 +198,11 @@ return false; } - if (mapFolder.getPickmaps() > 0 && !ACTION_BUILDER.showQuestionDialog(null/*XXX:parent*/, confirmDeleteFolderKey, mapFolder.getName(), mapFolder.getPickmaps())) { - return false; - } + if (performAction) { + if (mapFolder.getPickmaps() > 0 && !ACTION_BUILDER.showQuestionDialog(null/*XXX:parent*/, confirmDeleteFolderKey, mapFolder.getName(), mapFolder.getPickmaps())) { + return false; + } - if (performAction) { try { mapFolderTree.removeMapFolder(mapFolder, true); } catch (final MapFolderNotEmptyException ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-11-01 13:52:25
|
Revision: 8744 http://gridarta.svn.sourceforge.net/gridarta/?rev=8744&view=rev Author: akirschbaum Date: 2010-11-01 13:52:18 +0000 (Mon, 01 Nov 2010) Log Message: ----------- Suppress stray query dialog whether to delete the current pickmap folder when switching between pickmap folders. Modified Paths: -------------- trunk/atrinik/ChangeLog trunk/crossfire/ChangeLog trunk/daimonin/ChangeLog trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java Modified: trunk/atrinik/ChangeLog =================================================================== --- trunk/atrinik/ChangeLog 2010-10-29 18:50:29 UTC (rev 8743) +++ trunk/atrinik/ChangeLog 2010-11-01 13:52:18 UTC (rev 8744) @@ -1,3 +1,8 @@ +2010-11-01 Andreas Kirschbaum + + * Suppress stray query dialog whether to delete the current + pickmap folder when switching between pickmap folders. + 2010-10-18 Andreas Kirschbaum * Include monster levels in monster view. Modified: trunk/crossfire/ChangeLog =================================================================== --- trunk/crossfire/ChangeLog 2010-10-29 18:50:29 UTC (rev 8743) +++ trunk/crossfire/ChangeLog 2010-11-01 13:52:18 UTC (rev 8744) @@ -1,3 +1,8 @@ +2010-11-01 Andreas Kirschbaum + + * Suppress stray query dialog whether to delete the current + pickmap folder when switching between pickmap folders. + 2010-10-18 Andreas Kirschbaum * Include monster levels in monster view. Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-10-29 18:50:29 UTC (rev 8743) +++ trunk/daimonin/ChangeLog 2010-11-01 13:52:18 UTC (rev 8744) @@ -1,3 +1,8 @@ +2010-11-01 Andreas Kirschbaum + + * Suppress stray query dialog whether to delete the current + pickmap folder when switching between pickmap folders. + 2010-10-28 Andreas Kirschbaum * Fix 'custom type' map validator to not flag mobs within spawn Modified: trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java 2010-10-29 18:50:29 UTC (rev 8743) +++ trunk/src/app/net/sf/gridarta/gui/mapfiles/MapFolderTreeActions.java 2010-11-01 13:52:18 UTC (rev 8744) @@ -254,11 +254,11 @@ return false; } - if (mapFolder.getPickmaps() > 0 && !ACTION_BUILDER.showQuestionDialog(null/*XXX:parent*/, confirmDeleteFolderKey, mapFolder.getName(), mapFolder.getPickmaps())) { - return false; - } + if (performAction) { + if (mapFolder.getPickmaps() > 0 && !ACTION_BUILDER.showQuestionDialog(null/*XXX:parent*/, confirmDeleteFolderKey, mapFolder.getName(), mapFolder.getPickmaps())) { + return false; + } - if (performAction) { try { mapFolderTree.removeMapFolder(mapFolder, true); } catch (final MapFolderNotEmptyException ex) { This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-10-29 18:50:36
|
Revision: 8743 http://gridarta.svn.sourceforge.net/gridarta/?rev=8743&view=rev Author: akirschbaum Date: 2010-10-29 18:50:29 +0000 (Fri, 29 Oct 2010) Log Message: ----------- Require ant 1.7.0 to prevent unit tests from failing. Modified Paths: -------------- trunk/INSTALL trunk/README trunk/src/app/net/sf/gridarta/package.html Modified: trunk/INSTALL =================================================================== --- trunk/INSTALL 2010-10-29 16:44:04 UTC (rev 8742) +++ trunk/INSTALL 2010-10-29 18:50:29 UTC (rev 8743) @@ -9,7 +9,7 @@ Build Requirements ------------------ * Java Software Development Kit 5.0 or newer -* Ant 1.6.5 or newer, including the "optional" tasks +* Ant 1.7.0 or newer, including the "optional" tasks On Debian: install packages "ant" and "ant-optional". On Mandriva: install "ant-nodeps". Modified: trunk/README =================================================================== --- trunk/README 2010-10-29 16:44:04 UTC (rev 8742) +++ trunk/README 2010-10-29 18:50:29 UTC (rev 8743) @@ -41,7 +41,7 @@ auto-boxing, static imports, foreach loops, assertions, covariant return types and varargs quite a lot. -Ant 1.6.5 or later +Ant 1.7.0 or later Previous versions of Ant might work but are not tested. Modified: trunk/src/app/net/sf/gridarta/package.html =================================================================== --- trunk/src/app/net/sf/gridarta/package.html 2010-10-29 16:44:04 UTC (rev 8742) +++ trunk/src/app/net/sf/gridarta/package.html 2010-10-29 18:50:29 UTC (rev 8743) @@ -20,6 +20,8 @@ <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 3.2 Final//EN"> <html> <body> -Common classes for Gridarta that aren't sorted in other packages yet. +Base package of all Gridarta classes. This package contains only one interface: +{@link MainControl} which defines the location for storing preferences. All +other types are part of sub-packages. </body> </html> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-10-29 16:44:10
|
Revision: 8742 http://gridarta.svn.sourceforge.net/gridarta/?rev=8742&view=rev Author: akirschbaum Date: 2010-10-29 16:44:04 +0000 (Fri, 29 Oct 2010) Log Message: ----------- Circumvent problems that prevent compilation on some compiler versions. Modified Paths: -------------- branches/0.8/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java Modified: branches/0.8/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java =================================================================== --- branches/0.8/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-10-29 16:43:57 UTC (rev 8741) +++ branches/0.8/model/src/app/net/sf/gridarta/model/map/mapmodel/DefaultMapModel.java 2010-10-29 16:44:04 UTC (rev 8742) @@ -333,8 +333,8 @@ mapGrid.resize(newSize); mapArchObject.discardInvalidMapSquares(changedSquares); - mapArchObject.discardInvalidGameObjects(changedGameObjects); - mapArchObject.discardInvalidGameObjects(transientChangedGameObjects); + mapArchObject.<G, R>discardInvalidGameObjects(changedGameObjects); + mapArchObject.<G, R>discardInvalidGameObjects(transientChangedGameObjects); fireMapSizeChanged(newSize); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-10-29 16:44:04
|
Revision: 8741 http://gridarta.svn.sourceforge.net/gridarta/?rev=8741&view=rev Author: akirschbaum Date: 2010-10-29 16:43:57 +0000 (Fri, 29 Oct 2010) Log Message: ----------- Circumvent problems that prevent compilation on some compiler versions. Modified Paths: -------------- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java Modified: trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2010-10-28 19:28:32 UTC (rev 8740) +++ trunk/model/src/app/net/sf/gridarta/model/mapmodel/DefaultMapModel.java 2010-10-29 16:43:57 UTC (rev 8741) @@ -335,8 +335,8 @@ mapGrid.resize(newSize); mapArchObject.discardInvalidMapSquares(changedSquares); - mapArchObject.discardInvalidGameObjects(changedGameObjects); - mapArchObject.discardInvalidGameObjects(transientChangedGameObjects); + mapArchObject.<G, R>discardInvalidGameObjects(changedGameObjects); + mapArchObject.<G, R>discardInvalidGameObjects(transientChangedGameObjects); fireMapSizeChanged(newSize); } This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-10-28 19:28:44
|
Revision: 8740 http://gridarta.svn.sourceforge.net/gridarta/?rev=8740&view=rev Author: akirschbaum Date: 2010-10-28 19:28:32 +0000 (Thu, 28 Oct 2010) Log Message: ----------- Fix 'custom type' map validator to not flag mobs within spawn points. Modified Paths: -------------- trunk/build.xml trunk/daimonin/ChangeLog trunk/model/src/app/net/sf/gridarta/model/validation/checks/ValidatorFactory.java Added Paths: ----------- trunk/test-mapvalidator/daimonin/ trunk/test-mapvalidator/daimonin/arch/ trunk/test-mapvalidator/daimonin/arch/artifacts trunk/test-mapvalidator/daimonin/arch/dev/ trunk/test-mapvalidator/daimonin/arch/dev/editor/ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/archdef.dat trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/autojoin.txt trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml trunk/test-mapvalidator/daimonin/arch/dev/editor/pickmaps/ trunk/test-mapvalidator/daimonin/arch/floor1.arc trunk/test-mapvalidator/daimonin/arch/mob1.arc trunk/test-mapvalidator/daimonin/arch/spawnpoint1.arc trunk/test-mapvalidator/daimonin/arch/treasures trunk/test-mapvalidator/daimonin/maps/ trunk/test-mapvalidator/daimonin/maps/CustomType trunk/test-mapvalidator/daimonin/maps/CustomType.expected trunk/test-mapvalidator/daimonin/maps/dev/ trunk/test-mapvalidator/daimonin/maps/dev/editor/ trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/ trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator trunk/test-mapvalidator/daimonin/regtest.conf Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-10-28 19:18:12 UTC (rev 8739) +++ trunk/build.xml 2010-10-28 19:28:32 UTC (rev 8740) @@ -843,7 +843,7 @@ </javadoc> </target> - <target name="test" description="Executes all tests." depends="test-junit,test-mapvalidator-crossfire"/> + <target name="test" description="Executes all tests." depends="test-junit,test-mapvalidator-crossfire,test-mapvalidator-daimonin"/> <target name="test-junit" description="Executes the junit tests." depends="test-atrinik,test-crossfire,test-daimonin,test-gridarta,test-model,test-preferences,test-textedit,test-utils"> <junitreport todir="docs/test"> @@ -1050,4 +1050,11 @@ </java> </target> + <target name="test-mapvalidator-daimonin" description="Executes the map validator tests using DaimoninEditor.jar." depends="jar-daimonin"> + <java jar="DaimoninEditor.jar" failonerror="true" fork="true"> + <arg value="--config=test-mapvalidator/daimonin/regtest.conf"/> + <arg value="--script=MapValidator"/> + </java> + </target> + </project> Modified: trunk/daimonin/ChangeLog =================================================================== --- trunk/daimonin/ChangeLog 2010-10-28 19:18:12 UTC (rev 8739) +++ trunk/daimonin/ChangeLog 2010-10-28 19:28:32 UTC (rev 8740) @@ -1,3 +1,8 @@ +2010-10-28 Andreas Kirschbaum + + * Fix 'custom type' map validator to not flag mobs within spawn + points. + 2010-10-18 Andreas Kirschbaum * Include monster levels in monster view. Modified: trunk/model/src/app/net/sf/gridarta/model/validation/checks/ValidatorFactory.java =================================================================== --- trunk/model/src/app/net/sf/gridarta/model/validation/checks/ValidatorFactory.java 2010-10-28 19:18:12 UTC (rev 8739) +++ trunk/model/src/app/net/sf/gridarta/model/validation/checks/ValidatorFactory.java 2010-10-28 19:28:32 UTC (rev 8740) @@ -204,7 +204,7 @@ } else { final int envType; try { - envType = Integer.parseInt(tmp[1]); + envType = Integer.parseInt(tmp[2]); } catch (final NumberFormatException ex) { throw new NoSuchValidatorException("invalid env type: " + args[pos], ex); } Property changes on: trunk/test-mapvalidator/daimonin/arch/artifacts ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,67 @@ +<?xml version="1.0"?> +<!DOCTYPE GameObjectMatchers SYSTEM "GameObjectMatchers.dtd"> +<GameObjectMatchers> + + <GameObjectMatcher id="system_floor" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="65 68 71" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_below_floor" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="-666" /> + <!-- <Attrib name="layer" value="0" /> --> + </GameObjectMatcher> + + <GameObjectMatcher id="system_wall" system="true"> + <title xml:lang="en">T</title> + <And> + <TypeNrs numbers="77" /> + <Attrib name="layer" value="7" op="ne" /> + </And> + </GameObjectMatcher> + + <GameObjectMatcher id="system_monster" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="80 81 83" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_exit" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="41 66 69 94 95" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_environment_sensor" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="133" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_monster_only" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="80 83" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_combat_values_objects" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="5 6 7 13 39 54 62 72 73 80 83 154 158" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_connection_source" system="true"> + <title xml:lang="en">T</title> + <TypeNrs numbers="17 18 27 30 31 32 51 64 92 93 132 133 134" /> + </GameObjectMatcher> + + <GameObjectMatcher id="system_connection_sink" system="true"> + <title xml:lang="en">T</title> + <Or> + <TypeNrs numbers="26 41 42 55 62 65 74 78 81 91 94 98 112 132" /> + </Or> + </GameObjectMatcher> + + <GameObjectMatcher id="system_connection_sink2" system="true"> + <title xml:lang="en">T</title> + <Env/> + <TypeNrs numbers="-666" /> + </GameObjectMatcher> + +</GameObjectMatchers> Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/GameObjectMatchers.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,4 @@ +<?xml version="1.0"?> +<!DOCTYPE lists SYSTEM "TreasureLists.dtd"> +<lists> +</lists> Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/TreasureLists.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/archdef.dat =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/archdef.dat (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/archdef.dat 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,16 @@ +0 0 +1 2 +2 1 +2 2 +2 3 +3 2 +3 3 +2 4 +4 2 +2 5 +5 2 +3 4 +4 3 +2 7 +7 2 +4 4 Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/archdef.dat ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/autojoin.txt ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + LF Added: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,5 @@ +<?xml version="1.0" encoding="UTF-8" ?> +<!DOCTYPE spells SYSTEM "spells.dtd"> +<spells> +<spell id="0" name="none"/> +</spells> Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/spells.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml =================================================================== --- trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,30 @@ +<?xml version="1.0" standalone="no" ?> +<!DOCTYPE types SYSTEM "types.dtd"> +<types> + <bitmasks/> + <lists> + <list name="event"> + <listentry value="1" name="apply"/> + </list> + </lists> + <ignorelists/> + + <default_type> + <attribute arch="name" editor="name" type="string"> + This is the name of the object, displayed to the player. + </attribute> + </default_type> + + <type number="0" name="Misc"/> + + <type number="80" name="Mob"> + <attribute arch="dam" editor="damage" type="int"/> + </type> + + <type number="81" name="Spawn Point"/> + + <type number="83" name="Spawn Point Mob"> + <attribute arch="dam" editor="damage" type="int"/> + </type> + +</types> Property changes on: trunk/test-mapvalidator/daimonin/arch/dev/editor/conf/types.xml ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/floor1.arc =================================================================== --- trunk/test-mapvalidator/daimonin/arch/floor1.arc (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/floor1.arc 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,3 @@ +Object floor1 +type 71 +end Property changes on: trunk/test-mapvalidator/daimonin/arch/floor1.arc ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/mob1.arc =================================================================== --- trunk/test-mapvalidator/daimonin/arch/mob1.arc (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/mob1.arc 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,3 @@ +Object mob1 +type 80 +end Property changes on: trunk/test-mapvalidator/daimonin/arch/mob1.arc ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/arch/spawnpoint1.arc =================================================================== --- trunk/test-mapvalidator/daimonin/arch/spawnpoint1.arc (rev 0) +++ trunk/test-mapvalidator/daimonin/arch/spawnpoint1.arc 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,4 @@ +Object spawnpoint1 +type 81 +last_heal 9 +end Property changes on: trunk/test-mapvalidator/daimonin/arch/spawnpoint1.arc ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Property changes on: trunk/test-mapvalidator/daimonin/arch/treasures ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/maps/CustomType =================================================================== --- trunk/test-mapvalidator/daimonin/maps/CustomType (rev 0) +++ trunk/test-mapvalidator/daimonin/maps/CustomType 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,36 @@ +arch map +name test for CustomType map validator +msg +Modified: 2010-10-28 ank +endmsg +width 3 +height 1 +difficulty 1 +darkness -1 +end +arch floor1 +end +arch spawnpoint1 +arch mob1 +type 83 +dam 1 +end +end +arch floor1 +x 1 +end +arch spawnpoint1 +x 1 +arch mob1 +type 82 +dam 1 +end +end +arch floor1 +x 2 +end +arch mob1 +type 83 +dam 1 +x 2 +end Property changes on: trunk/test-mapvalidator/daimonin/maps/CustomType ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/maps/CustomType.expected =================================================================== --- trunk/test-mapvalidator/daimonin/maps/CustomType.expected (rev 0) +++ trunk/test-mapvalidator/daimonin/maps/CustomType.expected 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,2 @@ +[1|0] Object with custom type [mob1] [mob1] [80, 82] +[2|0] Object with custom type [mob1] [mob1] [80, 83] Property changes on: trunk/test-mapvalidator/daimonin/maps/CustomType.expected ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator =================================================================== --- trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator (rev 0) +++ trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,134 @@ +<?xml version="1.0" encoding="UTF-8"?> +<script> + <name>MapValidator</name> + <code><![CDATA[import java.io.BufferedWriter; +import java.io.ByteArrayOutputStream; +import java.io.File; +import java.io.FileInputStream; +import java.io.FileWriter; +import java.io.InputStream; +import java.util.Iterator; +import net.sf.gridarta.model.gameobject.GameObject; +import net.sf.gridarta.model.io.RecursiveFileIterator; +import net.sf.gridarta.model.validation.ErrorCollector; +import net.sf.gridarta.model.validation.errors.ValidationError; + +String checkMap(File mapFile, String mapPath) { + try { + map = mapManager.openMapFile(mapFile, false); + } catch (IOException ex) { + print("Cannot load map '"+mapFile+"': "+ex.getMessage()); + return null; + } + if (map == null) { + print(mapPath + ":"); + print("- cannot load map file"); + return null; + } + + ErrorCollector errorCollector; + try { + try { + validators.validateAll(map.getMapModel()); + } finally { + errorCollector = map.getMapModel().getErrors(); + } + } finally { + mapManager.release(map); + } + + StringBuffer sb = new StringBuffer(); + Iterator it = errorCollector.iterator(); + while (it.hasNext()) { + ValidationError validationError = it.next(); + + sb.append(validationError); + + Iterator it2 = validationError.getGameObjects().iterator(); + while (it2.hasNext()) { + GameObject gameObject = it2.next(); + sb.append(" [").append(gameObject.getBestName()).append(']'); + } + + String parameter0 = validationError.getParameter(0); + if (parameter0 != null) { + sb.append(" [").append(parameter0); + String parameter1 = validationError.getParameter(1); + if (parameter1 != null) { + sb.append(", ").append(parameter1); + } + sb.append(']'); + } + sb.append("\n"); + } + + return sb.toString(); +} + +if (baseDirectory == null || baseDirectory.length() <= 0) { + baseDirectory = "/"; +} +print("Checking maps below " + baseDirectory + "..."); +if (baseDirectory.endsWith("/")) { + baseDirectory = baseDirectory.substring(0, baseDirectory.length() - 1); +} + +String mapDefaultFolder = globalSettings.getMapsDirectory().getPath(); +String rootDirectory = mapDefaultFolder + baseDirectory; +boolean ok = true; +Iterator it = new RecursiveFileIterator(new File(rootDirectory)); +while (it.hasNext()) { + File file = it.next(); + String name = file.getName(); + String path = file.getPath(); + if (file.isFile() + && path.startsWith(rootDirectory) + && !name.endsWith(".expected")) { + File expectedFile = new File(file.getPath() + ".expected"); + if (expectedFile.exists()) { + String result = checkMap(file, file.getPath().substring(mapDefaultFolder.length())); + + final ByteArrayOutputStream byteArrayOutputStream = new ByteArrayOutputStream(); + final InputStream inputStream = new FileInputStream(expectedFile); + try { + final byte[] buf = new byte[1024]; + for (;;) { + final int len = inputStream.read(buf); + if (len == -1) { + break; + } + byteArrayOutputStream.write(buf, 0, len); + } + } finally { + inputStream.close(); + } + final String expected = byteArrayOutputStream.toString("UTF-8"); + if (result.equals(expected)) { + print(file + ": OK"); + } else { + print(file + ": unexpected result:"); + print(result); + print("expected result:"); + print(expected); + ok = false; + } + } + } +} +if (!ok) { + throw new AssertionError(); +} +]]></code> + <mode> + <autoboot>false</autoboot> + <bash>true</bash> + <filter>false</filter> + </mode> + <parameter> + <name>baseDirectory</name> + <description>Base Directory</description> + <type>java.lang.String</type> + <value>/</value> + </parameter> +</script> + Property changes on: trunk/test-mapvalidator/daimonin/maps/dev/editor/scripts/MapValidator ___________________________________________________________________ Added: svn:mime-type + text/xml Added: svn:eol-style + native Added: trunk/test-mapvalidator/daimonin/regtest.conf =================================================================== --- trunk/test-mapvalidator/daimonin/regtest.conf (rev 0) +++ trunk/test-mapvalidator/daimonin/regtest.conf 2010-10-28 19:28:32 UTC (rev 8740) @@ -0,0 +1,104 @@ + +# Whether the map validator is enabled. +MapValidator.All=true + +UpdaterAutoCheck=false + +# Whether this map validator check is is enabled. +Validator.AttributeRange=true + +# Whether this map validator check is is enabled. +Validator.BlockedMobOrSpawnPoint=true + +# Whether this map validator check is is enabled. +Validator.BlockedSpawnPoint=true + +# Whether this map validator check is is enabled. +Validator.BlockedSquare=true + +# Whether this map validator check is is enabled. +Validator.ConnectedInsideContainer=true + +# Whether this map validator check is is enabled. +Validator.ConnectedPickable=true + +# Whether this map validator check is is enabled. +Validator.Connection=true + +# Whether this map validator check is enabled. +Validator.CustomType=true + +# Whether this map validator check is is enabled. +Validator.DoubleLayer=true + +# Whether this map validator check is is enabled. +Validator.DoubleType=true + +# Whether this map validator check is is enabled. +Validator.EmptySpawnPoint=true + +# Whether this map validator check is is enabled. +Validator.Exit=true + +# Whether this map validator check is is enabled. +Validator.MapDifficulty=true + +# Whether this map validator check is is enabled. +Validator.MobOutsideSpawnPoint=true + +# Whether this map validator check is is enabled. +Validator.Slaying=true + +# Whether this map validator check is is enabled. +Validator.SquareWithoutFloor=true + +# Whether this map validator check is is enabled. +Validator.SysObjectNotOnLayerZero=true + +# Whether this map validator check is is enabled. +Validator.TilePaths=true + +# Whether this map validator check is is enabled. +Validator.UndefinedArchetype=true + +# Whether this map validator check is is enabled. +Validator.UndefinedFace=true + +# Whether this map validator check is is enabled. +Validator.UnsetSlaying=true + +# Archetype directory. +archDirectory=test-mapvalidator/daimonin/arch + +configSource=ARCH_DIRECTORY + +# Last displayed version of the help documentation. +docuVersion=1 + +filterRealMaps=true + +# Language for the user interface. +language=en + +# Maps directory. +mapDirectory=test-mapvalidator/daimonin/maps + +# The settings for alpha faces. +mapViewSettings.alphaType=0 + +# Whether autojoining is enabled. +mapViewSettings.autojoin=false + +# Whether double faces are shown. +mapViewSettings.doubleFaces=false + +# Whether the map grid is visible. +mapViewSettings.gridVisible=false + +# Whether smoothing is active. +mapViewSettings.smoothing=false + +mediaDirectory=test-mapvalidator/daimonin/client/media + +# The image set to use. +useImageSet= Property changes on: trunk/test-mapvalidator/daimonin/regtest.conf ___________________________________________________________________ Added: svn:mime-type + text/plain Added: svn:eol-style + native This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-10-28 19:18:18
|
Revision: 8739 http://gridarta.svn.sourceforge.net/gridarta/?rev=8739&view=rev Author: akirschbaum Date: 2010-10-28 19:18:12 +0000 (Thu, 28 Oct 2010) Log Message: ----------- Fix typo. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/messages.properties Modified: trunk/src/app/net/sf/gridarta/messages.properties =================================================================== --- trunk/src/app/net/sf/gridarta/messages.properties 2010-10-28 18:05:14 UTC (rev 8738) +++ trunk/src/app/net/sf/gridarta/messages.properties 2010-10-28 19:18:12 UTC (rev 8739) @@ -1278,7 +1278,7 @@ Validator.AttributeRange.default=true Validator.AttributeRange.title=Suspicious attribute value -Validator.AttributeRange.msg=<html><h3>{0}</h3><p>The attribute "{4}" of {3} is probably incorrect. It''s value ({5}) should be between {6} and {7}.</p><p>You could:</p><ul><li>Ignore this</li><li>Change the attribute value</li></ul> +Validator.AttributeRange.msg=<html><h3>{0}</h3><p>The attribute "{4}" of {3} is probably incorrect. Its value ({5}) should be between {6} and {7}.</p><p>You could:</p><ul><li>Ignore this</li><li>Change the attribute value</li></ul> Validator.BlockedMobOrSpawnPoint.default=true Validator.BlockedMobOrSpawnPoint.title=Blocked mob This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-10-28 18:05:20
|
Revision: 8738 http://gridarta.svn.sourceforge.net/gridarta/?rev=8738&view=rev Author: akirschbaum Date: 2010-10-28 18:05:14 +0000 (Thu, 28 Oct 2010) Log Message: ----------- Rename directory test-mapvalidator to test-mapvalidator/crossfire. Modified Paths: -------------- trunk/build.xml Added Paths: ----------- trunk/test-mapvalidator/crossfire/ trunk/test-mapvalidator/crossfire/arch/ trunk/test-mapvalidator/crossfire/maps/ trunk/test-mapvalidator/crossfire/regtest.conf Removed Paths: ------------- trunk/test-mapvalidator/arch/ trunk/test-mapvalidator/maps/ trunk/test-mapvalidator/regtest.conf Modified: trunk/build.xml =================================================================== --- trunk/build.xml 2010-10-28 13:40:45 UTC (rev 8737) +++ trunk/build.xml 2010-10-28 18:05:14 UTC (rev 8738) @@ -843,7 +843,7 @@ </javadoc> </target> - <target name="test" description="Executes all tests." depends="test-junit,test-mapvalidator"/> + <target name="test" description="Executes all tests." depends="test-junit,test-mapvalidator-crossfire"/> <target name="test-junit" description="Executes the junit tests." depends="test-atrinik,test-crossfire,test-daimonin,test-gridarta,test-model,test-preferences,test-textedit,test-utils"> <junitreport todir="docs/test"> @@ -1043,9 +1043,9 @@ </junit> </target> - <target name="test-mapvalidator" description="Executes the map validator tests." depends="jar-crossfire"> + <target name="test-mapvalidator-crossfire" description="Executes the map validator tests using CrossfireEditor.jar." depends="jar-crossfire"> <java jar="CrossfireEditor.jar" failonerror="true" fork="true"> - <arg value="--config=test-mapvalidator/regtest.conf"/> + <arg value="--config=test-mapvalidator/crossfire/regtest.conf"/> <arg value="--script=MapValidator"/> </java> </target> Copied: trunk/test-mapvalidator/crossfire/regtest.conf (from rev 8737, trunk/test-mapvalidator/regtest.conf) =================================================================== --- trunk/test-mapvalidator/crossfire/regtest.conf (rev 0) +++ trunk/test-mapvalidator/crossfire/regtest.conf 2010-10-28 18:05:14 UTC (rev 8738) @@ -0,0 +1,86 @@ + +# Whether the map validator is enabled. +MapValidator.All=true + +UpdaterAutoCheck=false + +# Whether this map validator check is is enabled. +Validator.AttributeRange=true + +# Whether this map validator check is is enabled. +Validator.ConnectedInsideContainer=true + +# Whether this map validator check is is enabled. +Validator.ConnectedPickable=true + +# Whether this map validator check is is enabled. +Validator.Connection=true + +# Whether this map validator check is enabled. +Validator.CustomType=true + +# Whether this map validator check is is enabled. +Validator.Exit=true + +# Whether this map validator check is is enabled. +Validator.MapDifficulty=true + +# Whether this map validator check is is enabled. +Validator.NonAbsoluteExitPath=true + +# Whether this map validator check is is enabled. +Validator.PaidItemShopSquare=true + +# Whether this map validator check is is enabled. +Validator.ShopSquare=true + +# Whether this map validator check is is enabled. +Validator.TilePaths=true + +# Whether this map validator check is is enabled. +Validator.UndefinedArchetype=true + +# Whether this map validator check is is enabled. +Validator.UndefinedFace=true + +# Whether this map validator check is is enabled. +Validator.UnsetSlaying=true + +# Archetype directory. +archDirectory=test-mapvalidator/crossfire/arch + +configSource=ARCH_DIRECTORY + +# Last displayed version of the help documentation. +docuVersion=2 + +filterRealMaps=true + +# Language for the user interface. +language=en + +# Maps directory. +mapDirectory=test-mapvalidator/crossfire/maps + +# The settings for alpha faces. +mapViewSettings.alphaType=0 + +# Whether autojoining is enabled. +mapViewSettings.autojoin=false + +# Whether double faces are shown. +mapViewSettings.doubleFaces=false + +# Whether the map grid is visible. +mapViewSettings.gridVisible=false + +# Whether smoothing is active. +mapViewSettings.smoothing=false + +mediaDirectory= + +# Script directory. +scriptDirectory=test-mapvalidator/crossfire/scripts + +# The image set to use. +useImageSet=base Deleted: trunk/test-mapvalidator/regtest.conf =================================================================== --- trunk/test-mapvalidator/regtest.conf 2010-10-28 13:40:45 UTC (rev 8737) +++ trunk/test-mapvalidator/regtest.conf 2010-10-28 18:05:14 UTC (rev 8738) @@ -1,86 +0,0 @@ - -# Whether the map validator is enabled. -MapValidator.All=true - -UpdaterAutoCheck=false - -# Whether this map validator check is is enabled. -Validator.AttributeRange=true - -# Whether this map validator check is is enabled. -Validator.ConnectedInsideContainer=true - -# Whether this map validator check is is enabled. -Validator.ConnectedPickable=true - -# Whether this map validator check is is enabled. -Validator.Connection=true - -# Whether this map validator check is enabled. -Validator.CustomType=true - -# Whether this map validator check is is enabled. -Validator.Exit=true - -# Whether this map validator check is is enabled. -Validator.MapDifficulty=true - -# Whether this map validator check is is enabled. -Validator.NonAbsoluteExitPath=true - -# Whether this map validator check is is enabled. -Validator.PaidItemShopSquare=true - -# Whether this map validator check is is enabled. -Validator.ShopSquare=true - -# Whether this map validator check is is enabled. -Validator.TilePaths=true - -# Whether this map validator check is is enabled. -Validator.UndefinedArchetype=true - -# Whether this map validator check is is enabled. -Validator.UndefinedFace=true - -# Whether this map validator check is is enabled. -Validator.UnsetSlaying=true - -# Archetype directory. -archDirectory=test-mapvalidator/arch - -configSource=ARCH_DIRECTORY - -# Last displayed version of the help documentation. -docuVersion=2 - -filterRealMaps=true - -# Language for the user interface. -language=en - -# Maps directory. -mapDirectory=test-mapvalidator/maps - -# The settings for alpha faces. -mapViewSettings.alphaType=0 - -# Whether autojoining is enabled. -mapViewSettings.autojoin=false - -# Whether double faces are shown. -mapViewSettings.doubleFaces=false - -# Whether the map grid is visible. -mapViewSettings.gridVisible=false - -# Whether smoothing is active. -mapViewSettings.smoothing=false - -mediaDirectory= - -# Script directory. -scriptDirectory=test-mapvalidator/scripts - -# The image set to use. -useImageSet=base This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-10-28 13:40:51
|
Revision: 8737 http://gridarta.svn.sourceforge.net/gridarta/?rev=8737&view=rev Author: akirschbaum Date: 2010-10-28 13:40:45 +0000 (Thu, 28 Oct 2010) Log Message: ----------- Fix typos. Modified Paths: -------------- trunk/src/doc/ref/validators.xhtml Modified: trunk/src/doc/ref/validators.xhtml =================================================================== --- trunk/src/doc/ref/validators.xhtml 2010-10-19 19:52:42 UTC (rev 8736) +++ trunk/src/doc/ref/validators.xhtml 2010-10-28 13:40:45 UTC (rev 8737) @@ -140,7 +140,7 @@ <p>A game object validator that checks that the "type" attribute is not changed from the archetype's default value.</p> -<p>The parameters "from,to" or "from,to.env" define allowed +<p>The parameters "from,to" or "from,to,env" define allowed exceptions: a change from archetype's type "from" to game object's type "to" is allowed. The form "from,to,env" restricts the allowed change for game objects in the inventory of game objects with @@ -205,7 +205,7 @@ </ul> <p>The command is searched on all paths given in the environment variable "PATH" - if it is relarive.</p> + if it is relative.</p> <p>The script's output is one problem per line. No headers before the messages or footers after the messages are allowed. A line matching "<x> This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <aki...@us...> - 2010-10-19 19:52:48
|
Revision: 8736 http://gridarta.svn.sourceforge.net/gridarta/?rev=8736&view=rev Author: akirschbaum Date: 2010-10-19 19:52:42 +0000 (Tue, 19 Oct 2010) Log Message: ----------- Whitespace change. Modified Paths: -------------- trunk/src/app/net/sf/gridarta/gui/connectionview/MonsterCellRenderer.java Modified: trunk/src/app/net/sf/gridarta/gui/connectionview/MonsterCellRenderer.java =================================================================== --- trunk/src/app/net/sf/gridarta/gui/connectionview/MonsterCellRenderer.java 2010-10-18 16:54:49 UTC (rev 8735) +++ trunk/src/app/net/sf/gridarta/gui/connectionview/MonsterCellRenderer.java 2010-10-19 19:52:42 UTC (rev 8736) @@ -29,7 +29,7 @@ * A {@link CellRenderer} for the monster view. * @author Andreas Kirschbaum */ -public class MonsterCellRenderer<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A,R>> extends CellRenderer<GameObject<G, A, R>> { +public class MonsterCellRenderer<G extends GameObject<G, A, R>, A extends MapArchObject<A>, R extends Archetype<G, A, R>> extends CellRenderer<GameObject<G, A, R>> { /** * The serial version UID. This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |