wpdev-commits Mailing List for Wolfpack Emu (Page 8)
Brought to you by:
rip,
thiagocorrea
You can subscribe to this list here.
2003 |
Jan
|
Feb
|
Mar
|
Apr
|
May
|
Jun
|
Jul
(14) |
Aug
(121) |
Sep
(256) |
Oct
(59) |
Nov
(73) |
Dec
(120) |
---|---|---|---|---|---|---|---|---|---|---|---|---|
2004 |
Jan
(259) |
Feb
(381) |
Mar
(501) |
Apr
(355) |
May
(427) |
Jun
(270) |
Jul
(394) |
Aug
(412) |
Sep
(724) |
Oct
(578) |
Nov
(65) |
Dec
|
From: Sebastian H. <dar...@us...> - 2004-10-21 12:11:35
|
Update of /cvsroot/wpdev/wolfpack/muls In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10137/muls Modified Files: maps.h multiscache.cpp multiscache.h Log Message: housing updates Index: maps.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/maps.h,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** maps.h 1 Oct 2004 19:43:56 -0000 1.5 --- maps.h 21 Oct 2004 12:11:19 -0000 1.6 *************** *** 61,65 **** #pragma pack() ! class StaticsIterator { public: --- 61,65 ---- #pragma pack() ! class WPEXPORT StaticsIterator { public: *************** *** 101,105 **** }; ! class cMaps : public cComponent { QMap<uint, MapsPrivate*> d; --- 101,105 ---- }; ! class WPEXPORT cMaps : public cComponent { QMap<uint, MapsPrivate*> d; Index: multiscache.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/multiscache.cpp,v retrieving revision 1.6 retrieving revision 1.7 diff -C2 -d -r1.6 -r1.7 *** multiscache.cpp 10 Aug 2004 03:20:29 -0000 1.6 --- multiscache.cpp 21 Oct 2004 12:11:19 -0000 1.7 *************** *** 39,43 **** #include <algorithm> ! MultiDefinition::MultiDefinition() : width( 0 ), height( 0 ) { } --- 39,43 ---- #include <algorithm> ! MultiDefinition::MultiDefinition() : width( 0 ), height( 0 ), left(0), top(0), right(0), bottom(0) { } *************** *** 49,71 **** return; unsigned int i = 0; - int max_X = 0, max_Y = 0, min_X = 0, min_Y = 0; for ( ; i < items.size(); ++i ) { ! if ( items[max_X].x < items[i].x ) ! max_X = i; ! if ( items[max_Y].y < items[i].y ) ! max_Y = i; ! if ( items[min_X].x > items[i].x ) ! min_X = i; ! if ( items[min_Y].y > items[i].y ) ! min_Y = i; } // by now we have the dimensions. ! this->width = items[max_X].x + abs( items[min_X].x ); ! this->height = items[max_Y].y + abs( items[min_Y].y ); entries = items; } /*! Checks if the given pair of \a x and \a y coordinates --- 49,92 ---- return; unsigned int i = 0; for ( ; i < items.size(); ++i ) { ! if ( items[i].x < left ) ! left = items[i].x; ! else if ( items[i].x > right ) ! right = items[i].x; ! ! if ( items[i].y < top ) ! top = items[i].y; ! else if ( items[i].y > bottom ) ! bottom = items[i].y; } // by now we have the dimensions. ! this->width = abs(right - left) + 1; ! this->height = abs(bottom - top) + 1; ! ! // copy into grid ! grid.resize(width * height); ! for ( i = 0; i < items.size(); ++i) { ! unsigned int index = (items[i].y - top) * width + (items[i].x - left); ! if (index >= 0 && index < grid.size()) { ! grid[index].append(items[i]); ! } ! } ! entries = items; } + const QValueVector<multiItem_st> &MultiDefinition::itemsAt(int x, int y) { + unsigned int index = (x - left) + (y - top) * width; + static QValueVector<multiItem_st> emptyGrid; + + if (index < 0 || index >= grid.size()) { + return emptyGrid; + } else { + return grid[index]; + } + } + /*! Checks if the given pair of \a x and \a y coordinates *************** *** 233,234 **** --- 254,257 ---- return 0; } + + Index: multiscache.h =================================================================== RCS file: /cvsroot/wpdev/wolfpack/muls/multiscache.h,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** multiscache.h 19 Jun 2004 02:06:51 -0000 1.3 --- multiscache.h 21 Oct 2004 12:11:19 -0000 1.4 *************** *** 47,55 **** protected: QValueVector<multiItem_st> entries; // sorted list of items ! uint width; ! uint height; public: MultiDefinition(); void setItems( const QValueVector<multiItem_st>& items ); bool inMulti( short x, short y ); --- 47,83 ---- protected: QValueVector<multiItem_st> entries; // sorted list of items ! int left, right, top, bottom; ! unsigned int height, width; ! ! QValueVector< QValueVector<multiItem_st> > grid; public: MultiDefinition(); + const QValueVector<multiItem_st> &itemsAt(int x, int y); + + unsigned int getHeight() { + return height; + } + + unsigned int getWidth() { + return width; + } + + int getLeft() { + return left; + } + + int getRight() { + return right; + } + + int getBottom() { + return bottom; + } + + int getTop() { + return top; + } + void setItems( const QValueVector<multiItem_st>& items ); bool inMulti( short x, short y ); |
From: Sebastian H. <dar...@us...> - 2004-10-21 12:11:35
|
Update of /cvsroot/wpdev/wolfpack/python In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10137/python Modified Files: global.cpp Log Message: housing updates Index: global.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/python/global.cpp,v retrieving revision 1.166 retrieving revision 1.167 diff -C2 -d -r1.166 -r1.167 *** global.cpp 15 Oct 2004 14:38:23 -0000 1.166 --- global.cpp 21 Oct 2004 12:11:19 -0000 1.167 *************** *** 44,47 **** --- 44,48 ---- #include "../multi.h" #include "../scriptmanager.h" + #include "../muls/multiscache.h" #include "../definitions.h" #include "../pythonscript.h" *************** *** 623,627 **** Q_UNUSED( self ); // Minimum is x, y, map ! uint x = 0, y = 0, map = 0; --- 624,628 ---- Q_UNUSED( self ); // Minimum is x, y, map ! int x = 0, y = 0, map = 0; *************** *** 630,633 **** --- 631,647 ---- return 0; + if (!Maps::instance()->hasMap(map)) { + PyErr_Format(PyExc_RuntimeError, "Unable to access unknown map %u.", map); + } + + if (x < 0) + x = 0; + if (x >= Maps::instance()->mapTileWidth(map)) + x = Maps::instance()->mapTileWidth(map) - 1; + if (y < 0) + y = 0; + if (y >= Maps::instance()->mapTileHeight(map)) + y = Maps::instance()->mapTileHeight(map) - 1; + StaticsIterator iter = Maps::instance()->staticsIterator( Coord_cl( x, y, 0, map ), exact ); *************** *** 756,759 **** --- 770,812 ---- /* + \function wolfpack.canplace + \param pos The position. + \param id The display id of the multi (0x0000 to 0x4000). + \param yard The size of the multis yard. + \return True if the given multi can be placed by a player at the given location. + \description This function checks if a multi can be placed at a certain location by players. + */ + static PyObject *wpCanPlace( PyObject* self, PyObject *args ) { + Coord_cl pos; + unsigned short multiid; + unsigned short yard; + if (!PyArg_ParseTuple(args, "O&hh:wolfpack.canplace(id, yard)", &PyConvertCoord, &pos, &multiid, &yard)) { + return 0; + } + + QPtrList<cUObject> moveOut; // List of objects to move out + + PyObject *result = PyTuple_New(2); + + if (cMulti::canPlace(pos, multiid, moveOut, yard)) { + Py_INCREF(Py_True); + PyTuple_SET_ITEM(result, 0, Py_True); + + PyObject *list = PyTuple_New(moveOut.count()); + int i = 0; + for (cUObject *obj = moveOut.first(); obj; obj = moveOut.next()) { + PyTuple_SET_ITEM(list, i++, obj->getPyObject()); + } + PyTuple_SET_ITEM(result, 1, list); + } else { + Py_INCREF(Py_True); + PyTuple_SET_ITEM(result, 0, Py_False); + PyTuple_SET_ITEM(result, 1, PyTuple_New(0)); + } + + return result; + } + + /* \function wolfpack.effect \param id The art id of the effect that should be shown. *************** *** 1864,1867 **** --- 1917,1921 ---- { "addtimer", wpAddtimer, METH_VARARGS, "Adds a timed effect" }, { "effect", wpEffect, METH_VARARGS, "Shows a graphical effect." }, + { "canplace", wpCanPlace, METH_VARARGS, 0 }, { "region", wpRegion, METH_VARARGS, "Gets the region at a specific position" }, { "spawnregion", wpSpawnregion, METH_VARARGS, 0 }, |
From: Sebastian H. <dar...@us...> - 2004-10-21 12:09:11
|
Update of /cvsroot/wpdev/xmlscripts/scripts/housing In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv9446 Modified Files: deed.py Log Message: housing updates Index: deed.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/housing/deed.py,v retrieving revision 1.2 retrieving revision 1.3 diff -C2 -d -r1.2 -r1.3 *** deed.py 18 Oct 2004 12:05:22 -0000 1.2 --- deed.py 21 Oct 2004 12:08:56 -0000 1.3 *************** *** 71,75 **** player.socket.clilocmessage(1010433) ! player.socket.attachmultitarget("housing.deed.placement", dispid - 0x4000, [item.serial], xoffset, yoffset, zoffset) return True --- 71,75 ---- player.socket.clilocmessage(1010433) ! player.socket.attachmultitarget("housing.deed.placement", dispid - 0x4000, [item.serial, dispid, xoffset, yoffset, zoffset], xoffset, yoffset, zoffset) return True *************** *** 79,84 **** def placement(player, arguments, target): deed = wolfpack.finditem(arguments[0]) if not checkDeed(player, deed): ! return if not player.canreach(target.pos, 20): --- 79,86 ---- def placement(player, arguments, target): deed = wolfpack.finditem(arguments[0]) + (dispid, xoffset, yoffset, zoffset) = arguments[1:] # Get the rest of the arguments + if not checkDeed(player, deed): ! return if not player.canreach(target.pos, 20): *************** *** 86,94 **** return house = wolfpack.addmulti(str(deed.gettag('section'))) house.owner = player house.moveto(target.pos) house.update() - housing.registerHouse(house) --- 88,107 ---- return + (canplace, moveout) = wolfpack.canplace(target.pos, dispid - 0x4000, 4) + + if not canplace: + player.socket.sysmessage('CANT PLACE THERE') + return + house = wolfpack.addmulti(str(deed.gettag('section'))) house.owner = player house.moveto(target.pos) house.update() housing.registerHouse(house) + for obj in moveout: + obj.removefromview() + obj.moveto(player.pos) + obj.update() + if obj.ischar() and obj.socket: + obj.socket.resendworld() |
From: HellRaider <hel...@us...> - 2004-10-21 00:21:49
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/humans In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21720/definitions/npcs/humans Modified Files: civilists.xml Log Message: Male NPCs can now have beards... matching their hair's color :) Index: civilists.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/humans/civilists.xml,v retrieving revision 1.17 retrieving revision 1.18 diff -C2 -d -r1.17 -r1.18 *** civilists.xml 9 Sep 2004 03:19:37 -0000 1.17 --- civilists.xml 21 Oct 2004 00:21:33 -0000 1.18 *************** *** 8,11 **** --- 8,31 ---- --> <definitions> + + <npc id="npc_empty"> + <!-- Empty NPC definition, works as a NOOP for inheritance. --> + </npc> + + <!-- NPC with a beard --> + <npc id="npc_with_beard"> + <equipped> + <item list="FACIAL_HAIR"/> + </equipped> + </npc> + + <!-- Inheriting from this yields a 75% chance of getting a beard --> + <list id="NPC_BEARD_CHANCE"> + <item>npc_empty</item> + <item>npc_with_beard</item> + <item>npc_with_beard</item> + <item>npc_with_beard</item> + </list> + <!-- Male Base --> <npc id="base_male"> *************** *** 18,22 **** <wandertype>1</wandertype> <direction><random min="0" max="7" /></direction> <!-- Facing a random direction --> ! <!-- The Equipment of a standard human --> <equipped> --- 38,42 ---- <wandertype>1</wandertype> <direction><random min="0" max="7" /></direction> <!-- Facing a random direction --> ! <!-- The Equipment of a standard human --> <equipped> *************** *** 28,31 **** --- 48,55 ---- </equipped> + <inherit><random list="NPC_BEARD_CHANCE"/></inherit> + + <haircolor><random list="HAIRCOLOR" /></haircolor> + <str><random min="71" max="85" /></str> <dex><random min="66" max="80" /></dex> *************** *** 44,48 **** <wandertype>1</wandertype> <direction><random min="0" max="7" /></direction> <!-- Facing a random direction --> ! <!-- The Equipment of a standard human --> <equipped> --- 68,72 ---- <wandertype>1</wandertype> <direction><random min="0" max="7" /></direction> <!-- Facing a random direction --> ! <!-- The Equipment of a standard human --> <equipped> *************** *** 54,57 **** --- 78,83 ---- </equipped> + <haircolor><random list="HAIRCOLOR" /></haircolor> + <str><random min="71" max="85" /></str> <dex><random min="66" max="80" /></dex> *************** *** 59,63 **** <basescripts>speech.pets</basescripts> </npc> ! <!-- Pirate --> <npc id="pirate_male"> --- 85,89 ---- <basescripts>speech.pets</basescripts> </npc> ! <!-- Pirate --> <npc id="pirate_male"> *************** *** 88,90 **** --- 114,117 ---- <wandertype>0</wandertype> </npc> + </definitions> |
From: HellRaider <hel...@us...> - 2004-10-21 00:21:49
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/equipment In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21720/definitions/items/equipment Modified Files: hair.xml Log Message: Male NPCs can now have beards... matching their hair's color :) Index: hair.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/equipment/hair.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** hair.xml 15 Mar 2004 02:12:17 -0000 1.4 --- hair.xml 21 Oct 2004 00:21:32 -0000 1.5 *************** *** 14,18 **** <item id="203b"> <id>0x203b</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Hair\Short Hair</category> </item> --- 14,17 ---- *************** *** 20,24 **** <item id="203c"> <id>0x203c</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Hair\Long Hair</category> </item> --- 19,22 ---- *************** *** 26,30 **** <item id="203d"> <id>0x203d</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Hair\Pony Tail</category> </item> --- 24,27 ---- *************** *** 32,36 **** <item id="2044"> <id>0x2044</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Hair\Mohawk</category> </item> --- 29,32 ---- *************** *** 38,42 **** <item id="2045"> <id>0x2045</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Hair\Pageboy</category> </item> --- 34,37 ---- *************** *** 44,48 **** <item id="2046"> <id>0x2046</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Hair\Buns hair</category> </item> --- 39,42 ---- *************** *** 50,54 **** <item id="2047"> <id>0x2047</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Hair\Afro</category> </item> --- 44,47 ---- *************** *** 56,60 **** <item id="2048"> <id>0x2048</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Hair\Receding Hair</category> </item> --- 49,52 ---- *************** *** 62,66 **** <item id="2049"> <id>0x2049</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Hair\2 pig-tails</category> </item> --- 54,57 ---- *************** *** 68,72 **** <item id="204a"> <id>0x204a</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Hair\Krisna Hair</category> </item> --- 59,62 ---- *************** *** 75,79 **** <item id="203e"> <id>0x203e</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Beards\Long Beard</category> </item> --- 65,68 ---- *************** *** 81,85 **** <item id="203f"> <id>0x203f</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Beards\Short Beard</category> </item> --- 70,73 ---- *************** *** 87,91 **** <item id="2040"> <id>0x2040</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Beards\Goatee</category> </item> --- 75,78 ---- *************** *** 93,97 **** <item id="2041"> <id>0x2041</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Beards\Mustache</category> </item> --- 80,83 ---- *************** *** 99,103 **** <item id="204b"> <id>0x204b</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Beards\Med Short Beard</category> </item> --- 85,88 ---- *************** *** 105,109 **** <item id="204c"> <id>0x204c</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Beards\Med Long Beard</category> </item> --- 90,93 ---- *************** *** 111,115 **** <item id="204d"> <id>0x204d</id> - <color><random list="HAIRCOLOR" /></color> <category>Equipment\Beards\Vandyke</category> </item> --- 95,98 ---- |
From: HellRaider <hel...@us...> - 2004-10-21 00:21:49
|
Update of /cvsroot/wpdev/xmlscripts/definitions/lists In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21720/definitions/lists Modified Files: itemids.xml Log Message: Male NPCs can now have beards... matching their hair's color :) Index: itemids.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/lists/itemids.xml,v retrieving revision 1.8 retrieving revision 1.9 diff -C2 -d -r1.8 -r1.9 *** itemids.xml 26 May 2004 13:45:33 -0000 1.8 --- itemids.xml 21 Oct 2004 00:21:32 -0000 1.9 *************** *** 72,75 **** --- 72,86 ---- </list> + <!-- Item IDs of Facial Hair --> + <list id="FACIAL_HAIR"> + <item>203e</item> + <item>203f</item> + <item>2040</item> + <item>2041</item> + <item>204b</item> + <item>204c</item> + <item>204d</item> + </list> + <!-- IDs of Potions --> <list id="POTIONS"> |
From: HellRaider <hel...@us...> - 2004-10-21 00:21:49
|
Update of /cvsroot/wpdev/xmlscripts/documentation/webroot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21720/documentation/webroot Modified Files: ChangeLog.wolfpack Log Message: Male NPCs can now have beards... matching their hair's color :) Index: ChangeLog.wolfpack =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/documentation/webroot/ChangeLog.wolfpack,v retrieving revision 1.169 retrieving revision 1.170 diff -C2 -d -r1.169 -r1.170 *** ChangeLog.wolfpack 20 Oct 2004 19:43:55 -0000 1.169 --- ChangeLog.wolfpack 21 Oct 2004 00:21:33 -0000 1.170 *************** *** 5,8 **** --- 5,9 ---- - Adjusted carving sheeps. - Fixed leatherworkers and tanners not buying leather and hides. + - Male NPCs now have a 75% chance of getting a beard when created. * Python Script Changes: - Fixed bug #0000361. (Pets don't follow trough gate) |
From: HellRaider <hel...@us...> - 2004-10-21 00:19:54
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21278 Modified Files: ChangeLog basechar.cpp Log Message: Added the <haircolor> definition tag to NPCs Index: basechar.cpp =================================================================== RCS file: /cvsroot/wpdev/wolfpack/basechar.cpp,v retrieving revision 1.167 retrieving revision 1.168 diff -C2 -d -r1.167 -r1.168 *** basechar.cpp 18 Oct 2004 20:29:51 -0000 1.167 --- basechar.cpp 21 Oct 2004 00:19:41 -0000 1.168 *************** *** 1396,1399 **** --- 1396,1415 ---- this->setSaycolor( color ); } + // <haircolor>color</haircolor> dyes currently equipped hair/beard + else if ( TagName == "haircolor" ) + { + bool ok; + ushort color = Value.toUShort( &ok ); + if( ok ) + { + P_ITEM hair = getItemOnLayer( Hair ); + if( hair ) + hair->setColor( color ); + + P_ITEM facialHair = getItemOnLayer( FacialHair ); + if( facialHair ) + facialHair->setColor( color ); + } + } else { Index: ChangeLog =================================================================== RCS file: /cvsroot/wpdev/wolfpack/ChangeLog,v retrieving revision 1.120 retrieving revision 1.121 diff -C2 -d -r1.120 -r1.121 *** ChangeLog 18 Oct 2004 20:29:51 -0000 1.120 --- ChangeLog 21 Oct 2004 00:19:41 -0000 1.121 *************** *** 3,6 **** --- 3,7 ---- Wolfpack 12.9.13 Beta (CVS) - Fixed meditation skillcheck in mana regeneration code. + - Added the <haircolor> NPC definition tag to dye the currently equipped hair/beard (both the same color). Wolfpack 12.9.12 Beta (18. October 2004) |
From: Incanus <inc...@us...> - 2004-10-20 20:42:32
|
Update of /cvsroot/wpdev/xmlscripts/definitions/lists In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv3180/definitions/lists Modified Files: colors.xml Log Message: fixed a wrong color id Index: colors.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/lists/colors.xml,v retrieving revision 1.3 retrieving revision 1.4 diff -C2 -d -r1.3 -r1.4 *** colors.xml 25 Feb 2004 22:38:55 -0000 1.3 --- colors.xml 20 Oct 2004 20:42:16 -0000 1.4 *************** *** 2176,2180 **** <item>0x5ae</item> <!-- ORANGE --> ! <item>0x5db</item> <item>0x5de</item> <item>0x5df</item> --- 2176,2180 ---- <item>0x5ae</item> <!-- ORANGE --> ! <item>0x5dd</item> <item>0x5de</item> <item>0x5df</item> |
From: Incanus <inc...@us...> - 2004-10-20 19:44:09
|
Update of /cvsroot/wpdev/xmlscripts/scripts/system In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22231/scripts/system Modified Files: skillgain.py Log Message: Fixed gainfactor for skills always beeing 1.0 Index: skillgain.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/system/skillgain.py,v retrieving revision 1.21 retrieving revision 1.22 diff -C2 -d -r1.21 -r1.22 *** skillgain.py 8 Oct 2004 01:35:35 -0000 1.21 --- skillgain.py 20 Oct 2004 19:43:55 -0000 1.22 *************** *** 305,309 **** elif child.name == 'defname': SKILLS[i][SKILL_DEFNAME] = child.value ! elif child.name == 'gainfactor': SKILLS[i][SKILL_GAINFACTOR] = float(child.value) elif child.name == 'strchance': --- 305,309 ---- elif child.name == 'defname': SKILLS[i][SKILL_DEFNAME] = child.value ! elif child.name == 'gainchance': SKILLS[i][SKILL_GAINFACTOR] = float(child.value) elif child.name == 'strchance': |
From: Incanus <inc...@us...> - 2004-10-20 19:44:09
|
Update of /cvsroot/wpdev/xmlscripts/documentation/webroot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22231/documentation/webroot Modified Files: ChangeLog.wolfpack Log Message: Fixed gainfactor for skills always beeing 1.0 Index: ChangeLog.wolfpack =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/documentation/webroot/ChangeLog.wolfpack,v retrieving revision 1.168 retrieving revision 1.169 diff -C2 -d -r1.168 -r1.169 *** ChangeLog.wolfpack 20 Oct 2004 16:27:33 -0000 1.168 --- ChangeLog.wolfpack 20 Oct 2004 19:43:55 -0000 1.169 *************** *** 11,14 **** --- 11,15 ---- - Fixed blood created at carving not decaying for a long time. - Fixed fishing pole not wearing out. + - Fixed gainfactor for skills always beeing 1.0 * Misc. Changes: * Known Issues, Bugs, and Missing Features: |
From: Sebastian H. <dar...@us...> - 2004-10-20 19:40:40
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21520/magic Modified Files: __init__.py Log Message: Fixed a bug in the runebook that made it impossible to use runes with foreign characters Index: __init__.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/__init__.py,v retrieving revision 1.22 retrieving revision 1.23 diff -C2 -d -r1.22 -r1.23 *** __init__.py 16 Oct 2004 19:42:48 -0000 1.22 --- __init__.py 20 Oct 2004 19:40:30 -0000 1.23 *************** *** 127,131 **** return ! message = "Casting spell %u (%s) on item %s (0x%x).\n" % (spell.spellid, spell.__class__.__name__, target.item.getname(), target.item.serial) char.log(LOG_MESSAGE, message) spell.target(char, mode, TARGET_ITEM, target.item, args, item) --- 127,131 ---- return ! message = u"Casting spell %u (%s) on item %s (0x%x).\n" % (spell.spellid, spell.__class__.__name__, target.item.getname(), target.item.serial) char.log(LOG_MESSAGE, message) spell.target(char, mode, TARGET_ITEM, target.item, args, item) |
From: Sebastian H. <dar...@us...> - 2004-10-20 16:27:55
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10796/magic Modified Files: runebook.py Log Message: recall Index: runebook.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/runebook.py,v retrieving revision 1.12 retrieving revision 1.13 diff -C2 -d -r1.12 -r1.13 *** runebook.py 20 Oct 2004 15:44:26 -0000 1.12 --- runebook.py 20 Oct 2004 16:27:25 -0000 1.13 *************** *** 344,348 **** if( charges < 1 ): # "There are no charges left on that item." ! char.socket.clilocmessage( 502412 ) return False else: --- 344,349 ---- if( charges < 1 ): # "There are no charges left on that item." ! #char.socket.clilocmessage( 502412 ) ! wolfpack.addtimer( 0, "magic.runebook.recall1", [ char.serial, runes[ runenum ] ] ) return False else: |
From: Incanus <inc...@us...> - 2004-10-20 16:27:55
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10853/scripts/skills Modified Files: fishing.py Log Message: Fixed fishing pole not wearing out. Index: fishing.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/fishing.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** fishing.py 14 Sep 2004 01:22:50 -0000 1.11 --- fishing.py 20 Oct 2004 16:27:34 -0000 1.12 *************** *** 31,34 **** --- 31,64 ---- ] + def checktool(char, item, wearout = False): + if not item: + return False + + # Has to be in our posession + if item.getoutmostchar() != char: + #You can't use that, it belongs to someone else. + char.socket.clilocmessage( 500364 ) + return False + + # We do not allow "invulnerable" tools. + if not( item.hastag('remaining_uses') ): + #You broke your fishing pole. + char.socket.clilocmessage( 503174 ) + item.delete() + return False + + if( wearout ): + uses = int(item.gettag('remaining_uses')) + if( uses <= 1 ): + #You broke your fishing pole. + char.socket.clilocmessage( 503174 ) + item.delete() + return False + else: + item.settag('remaining_uses', uses - 1) + item.resendtooltip() + + return True + def onUse( char, item ): socket = char.socket *************** *** 56,60 **** else: socket.clilocmessage( 0x7A4EE, "", 0x3b2, 3 ) # What water do you want to fish in? ! socket.attachtarget( "skills.fishing.response" ) return True --- 86,90 ---- else: socket.clilocmessage( 0x7A4EE, "", 0x3b2, 3 ) # What water do you want to fish in? ! socket.attachtarget( "skills.fishing.response", [ iserial ] ) return True *************** *** 150,154 **** socket.settag( 'is_fishing', int( wolfpack.time.currenttime() + 5000 ) ) # Times out after 5000ms char.addtimer( 2500, "skills.fishing.effecttimer", [ pos, deepwater ] ) ! char.addtimer( 5000, "skills.fishing.itemtimer", [ pos, deepwater ] ) pass --- 180,184 ---- socket.settag( 'is_fishing', int( wolfpack.time.currenttime() + 5000 ) ) # Times out after 5000ms char.addtimer( 2500, "skills.fishing.effecttimer", [ pos, deepwater ] ) ! char.addtimer( 5000, "skills.fishing.itemtimer", [ pos, deepwater, args[0] ] ) pass *************** *** 216,227 **** # Do the real skill checks def itemtimer( char, args ): if len( fishingItems ) < 1: socket.sysmessage( 'This script has not been configured correctly.' ) ! return 0 - socket = char.socket socket.deltag( 'is_fishing' ) ! if len( args ) != 2: return --- 246,261 ---- # Do the real skill checks def itemtimer( char, args ): + if not( char.socket ): + return False + + socket = char.socket + if len( fishingItems ) < 1: socket.sysmessage( 'This script has not been configured correctly.' ) ! return False socket.deltag( 'is_fishing' ) ! if len( args ) != 3: return *************** *** 279,282 **** --- 313,323 ---- item.update() + #wear out the fishing pole + tool = wolfpack.finditem( args[2] ) + checktool( char, tool, True ) + + #resend weight + socket.resendstatus() + # Success! if not spawnmonster: |
From: Incanus <inc...@us...> - 2004-10-20 16:27:55
|
Update of /cvsroot/wpdev/xmlscripts/definitions/items/professions In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10853/definitions/items/professions Modified Files: fisher.xml Log Message: Fixed fishing pole not wearing out. Index: fisher.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/items/professions/fisher.xml,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** fisher.xml 14 Sep 2004 01:22:13 -0000 1.11 --- fisher.xml 20 Oct 2004 16:27:33 -0000 1.12 *************** *** 173,177 **** <category>Professions\Fisher\Tools\Fishing Pole (N/S)</category> <tag name="remaining_uses" type="int" value="50" /> ! <basescripts>skills.fishing</basescripts> <weight>8.0</weight> <twohanded /> --- 173,177 ---- <category>Professions\Fisher\Tools\Fishing Pole (N/S)</category> <tag name="remaining_uses" type="int" value="50" /> ! <basescripts>equipment,skills.fishing</basescripts> <weight>8.0</weight> <twohanded /> |
From: Incanus <inc...@us...> - 2004-10-20 16:27:55
|
Update of /cvsroot/wpdev/xmlscripts/documentation/webroot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv10853/documentation/webroot Modified Files: ChangeLog.wolfpack Log Message: Fixed fishing pole not wearing out. Index: ChangeLog.wolfpack =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/documentation/webroot/ChangeLog.wolfpack,v retrieving revision 1.167 retrieving revision 1.168 diff -C2 -d -r1.167 -r1.168 *** ChangeLog.wolfpack 19 Oct 2004 13:32:34 -0000 1.167 --- ChangeLog.wolfpack 20 Oct 2004 16:27:33 -0000 1.168 *************** *** 10,13 **** --- 10,14 ---- - Chars will now get revealed when using training dummy or archery butte. - Fixed blood created at carving not decaying for a long time. + - Fixed fishing pole not wearing out. * Misc. Changes: * Known Issues, Bugs, and Missing Features: |
From: Sebastian H. <dar...@us...> - 2004-10-20 15:44:42
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv31770/magic Modified Files: runebook.py Log Message: Fixes Index: runebook.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/runebook.py,v retrieving revision 1.11 retrieving revision 1.12 diff -C2 -d -r1.11 -r1.12 *** runebook.py 17 Oct 2004 23:11:40 -0000 1.11 --- runebook.py 20 Oct 2004 15:44:26 -0000 1.12 *************** *** 215,219 **** runes[ i ] = int( item.gettag( "rune %i" % i ) ) runenum = 0 ! while( runes[ runenum ] > -1 ): runenum = runenum + 1 runenames = [ "Empty" ] * 16 --- 215,219 ---- runes[ i ] = int( item.gettag( "rune %i" % i ) ) runenum = 0 ! while( runenum < 16 and runes[ runenum ] > -1 ): runenum = runenum + 1 runenames = [ "Empty" ] * 16 |
From: Incanus <inc...@us...> - 2004-10-20 00:36:02
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv14329/scripts/skills Modified Files: tailoring.py Log Message: fixed remaining uses of tailoring tool not resend to client Index: tailoring.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/tailoring.py,v retrieving revision 1.9 retrieving revision 1.10 diff -C2 -d -r1.9 -r1.10 *** tailoring.py 13 Oct 2004 18:45:42 -0000 1.9 --- tailoring.py 20 Oct 2004 00:35:53 -0000 1.10 *************** *** 1,7 **** ################################################################# ! # ) (\_ # WOLFPACK 13.0.0 Scripts # ! # (( _/{ "-; # Created by: DarkStorm # ! # )).-' {{ ;'` # Revised by: # ! # ( ( ;._ \\ ctr # Last Modification: Created # ################################################################# --- 1,7 ---- ################################################################# ! # ) (\_ # WOLFPACK 13.0.0 Scripts # ! # (( _/{ "-; # Created by: Darkstorm # ! # )).-' {{ ;'` # Revised by: # ! # ( ( ;._ \\ ctr # Last Modification: Created # ################################################################# *************** *** 17,21 **** # Leather types used by tailoring. LEATHERS = [ ! ['Leather', TAILORING, 0, ['leather_cut', 'leather_hides'], 0x0, 'leather'], ['Spined Leather', TAILORING, 650, ['spined_leather_cut', 'spined_leather_hides'], 0x283, 'spined_leather'], ['Horned Leather', TAILORING, 800, ['horned_leather_cut', 'horned_leather_hides'], 0x227, 'horned_leather'], --- 17,21 ---- # Leather types used by tailoring. LEATHERS = [ ! ['Leather', TAILORING, 0, ['leather_cut', 'leather_hides'], 0x0, 'leather'], ['Spined Leather', TAILORING, 650, ['spined_leather_cut', 'spined_leather_hides'], 0x283, 'spined_leather'], ['Horned Leather', TAILORING, 800, ['horned_leather_cut', 'horned_leather_hides'], 0x227, 'horned_leather'], *************** *** 26,37 **** # Check if the character is using the right tool # ! def checktool(char, item, wearout = 0): if not item: ! return 0 # Has to be in our posession if item.getoutmostchar() != char: char.socket.clilocmessage(500364) ! return 0 # We do not allow "invulnerable" tools. --- 26,37 ---- # Check if the character is using the right tool # ! def checktool(char, item, wearout = False): if not item: ! return False # Has to be in our posession if item.getoutmostchar() != char: char.socket.clilocmessage(500364) ! return False # We do not allow "invulnerable" tools. *************** *** 39,43 **** char.socket.clilocmessage(1044038) item.delete() ! return 0 if wearout: --- 39,43 ---- char.socket.clilocmessage(1044038) item.delete() ! return False if wearout: *************** *** 46,54 **** char.socket.clilocmessage(1044038) item.delete() ! return 0 else: item.settag('remaining_uses', uses - 1) ! ! return 1 # --- 46,54 ---- char.socket.clilocmessage(1044038) item.delete() ! return False else: item.settag('remaining_uses', uses - 1) ! item.resendtooltip() ! return True # *************** *** 57,66 **** def onUse(char, item): if not checktool(char, item): ! return 1 menu = findmenu('TAILORING') if menu: menu.send(char, [item.serial]) ! return 1 # --- 57,66 ---- def onUse(char, item): if not checktool(char, item): ! return True menu = findmenu('TAILORING') if menu: menu.send(char, [item.serial]) ! return True # *************** *** 78,82 **** # Only works if this item requires blacksmithing if not self.skills.has_key(TAILORING): ! return 0 minskill = self.skills[TAILORING][0] --- 78,82 ---- # Only works if this item requires blacksmithing if not self.skills.has_key(TAILORING): ! return False minskill = self.skills[TAILORING][0] *************** *** 114,118 **** # Reduce the uses remain count ! checktool(player, wolfpack.finditem(arguments[0]), 1) # --- 114,118 ---- # Reduce the uses remain count ! checktool(player, wolfpack.finditem(arguments[0]), True) # *************** *** 123,127 **** if not checktool(player, wolfpack.finditem(arguments[0])): ! return 0 return CraftItemAction.make(self, player, arguments, nodelay) --- 123,127 ---- if not checktool(player, wolfpack.finditem(arguments[0])): ! return False return CraftItemAction.make(self, player, arguments, nodelay) *************** *** 219,223 **** def getsubmaterial1used(self, player, arguments): if not player.hastag('tailoring_leather'): ! return 0 else: material = int(player.gettag('tailoring_leather')) --- 219,223 ---- def getsubmaterial1used(self, player, arguments): if not player.hastag('tailoring_leather'): ! return False else: material = int(player.gettag('tailoring_leather')) *************** *** 225,229 **** return material else: ! return 0 # --- 225,229 ---- return material else: ! return False # |
From: Incanus <inc...@us...> - 2004-10-19 23:03:51
|
Update of /cvsroot/wpdev/xmlscripts/scripts/skills In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22267/scripts/skills Modified Files: bowcraft.py Log Message: fixed remaining uses of bowcraft tool not resend to client Index: bowcraft.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/skills/bowcraft.py,v retrieving revision 1.19 retrieving revision 1.20 diff -C2 -d -r1.19 -r1.20 *** bowcraft.py 29 Sep 2004 17:11:43 -0000 1.19 --- bowcraft.py 19 Oct 2004 23:03:42 -0000 1.20 *************** *** 53,56 **** --- 53,57 ---- else: item.settag('remaining_uses', uses - 1) + item.resendtooltip() return True |
From: Correa <thi...@us...> - 2004-10-19 18:59:15
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv25041 Modified Files: configure.py Log Message: Attempt to get configure.py to work on Fedora and Solaris. Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.38 retrieving revision 1.39 diff -C2 -d -r1.38 -r1.39 *** configure.py 19 Oct 2004 18:44:09 -0000 1.38 --- configure.py 19 Oct 2004 18:59:03 -0000 1.39 *************** *** 14,17 **** --- 14,19 ---- import string import distutils.sysconfig + + # Older Python lib work arounds... try: from optparse import OptionParser *************** *** 19,23 **** sys.path.append( './tools/scripts' ) from optparse import OptionParser ! # These are the variables we are trying to figure out --- 21,29 ---- sys.path.append( './tools/scripts' ) from optparse import OptionParser ! ! try: ! osHasPathDotSep = sys.path.sep ! except: ! sys.path.sep = '/' # These are the variables we are trying to figure out |
From: Correa <thi...@us...> - 2004-10-19 18:44:21
|
Update of /cvsroot/wpdev/wolfpack/tools/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20727/tools/scripts Added Files: optparse.py textwrap.py Log Message: Attempt to get configure.py to work on Fedora and Solaris. --- NEW FILE: textwrap.py --- """Text wrapping and filling. """ # Copyright (C) 1999-2001 Gregory P. Ward. # Copyright (C) 2002, 2003 Python Software Foundation. # Written by Greg Ward <gw...@py...> __revision__ = "$Id: textwrap.py,v 1.1 2004/10/19 18:44:10 thiagocorrea Exp $" import string, re # Do the right thing with boolean values for all known Python versions # (so this module can be copied to projects that don't depend on Python # 2.3, e.g. Optik and Docutils). try: True, False except NameError: (True, False) = (1, 0) __all__ = ['TextWrapper', 'wrap', 'fill'] # Hardcode the recognized whitespace characters to the US-ASCII # whitespace characters. The main reason for doing this is that in # ISO-8859-1, 0xa0 is non-breaking whitespace, so in certain locales # that character winds up in string.whitespace. Respecting # string.whitespace in those cases would 1) make textwrap treat 0xa0 the # same as any other whitespace char, which is clearly wrong (it's a # *non-breaking* space), 2) possibly cause problems with Unicode, # since 0xa0 is not in range(128). _whitespace = '\t\n\x0b\x0c\r ' class TextWrapper: """ Object for wrapping/filling text. The public interface consists of the wrap() and fill() methods; the other methods are just there for subclasses to override in order to tweak the default behaviour. If you want to completely replace the main wrapping algorithm, you'll probably have to override _wrap_chunks(). Several instance attributes control various aspects of wrapping: width (default: 70) the maximum width of wrapped lines (unless break_long_words is false) initial_indent (default: "") string that will be prepended to the first line of wrapped output. Counts towards the line's width. subsequent_indent (default: "") string that will be prepended to all lines save the first of wrapped output; also counts towards each line's width. expand_tabs (default: true) Expand tabs in input text to spaces before further processing. Each tab will become 1 .. 8 spaces, depending on its position in its line. If false, each tab is treated as a single character. replace_whitespace (default: true) Replace all whitespace characters in the input text by spaces after tab expansion. Note that if expand_tabs is false and replace_whitespace is true, every tab will be converted to a single space! fix_sentence_endings (default: false) Ensure that sentence-ending punctuation is always followed by two spaces. Off by default because the algorithm is (unavoidably) imperfect. break_long_words (default: true) Break words longer than 'width'. If false, those words will not be broken, and some lines might be longer than 'width'. """ whitespace_trans = string.maketrans(_whitespace, ' ' * len(_whitespace)) unicode_whitespace_trans = {} uspace = ord(u' ') for x in map(ord, _whitespace): unicode_whitespace_trans[x] = uspace # This funky little regex is just the trick for splitting # text up into word-wrappable chunks. E.g. # "Hello there -- you goof-ball, use the -b option!" # splits into # Hello/ /there/ /--/ /you/ /goof-/ball,/ /use/ /the/ /-b/ /option! # (after stripping out empty strings). wordsep_re = re.compile(r'(\s+|' # any whitespace r'-*\w{2,}-(?=\w{2,})|' # hyphenated words r'(?<=[\w\!\"\'\&\.\,\?])-{2,}(?=\w))') # em-dash # XXX will there be a locale-or-charset-aware version of # string.lowercase in 2.3? sentence_end_re = re.compile(r'[%s]' # lowercase letter r'[\.\!\?]' # sentence-ending punct. r'[\"\']?' # optional end-of-quote % string.lowercase) def __init__(self, width=70, initial_indent="", subsequent_indent="", expand_tabs=True, replace_whitespace=True, fix_sentence_endings=False, break_long_words=True): self.width = width self.initial_indent = initial_indent self.subsequent_indent = subsequent_indent self.expand_tabs = expand_tabs self.replace_whitespace = replace_whitespace self.fix_sentence_endings = fix_sentence_endings self.break_long_words = break_long_words # -- Private methods ----------------------------------------------- # (possibly useful for subclasses to override) def _munge_whitespace(self, text): """_munge_whitespace(text : string) -> string Munge whitespace in text: expand tabs and convert all other whitespace characters to spaces. Eg. " foo\tbar\n\nbaz" becomes " foo bar baz". """ if self.expand_tabs: text = text.expandtabs() if self.replace_whitespace: if isinstance(text, str): text = text.translate(self.whitespace_trans) elif isinstance(text, unicode): text = text.translate(self.unicode_whitespace_trans) return text def _split(self, text): """_split(text : string) -> [string] Split the text to wrap into indivisible chunks. Chunks are not quite the same as words; see wrap_chunks() for full details. As an example, the text Look, goof-ball -- use the -b option! breaks into the following chunks: 'Look,', ' ', 'goof-', 'ball', ' ', '--', ' ', 'use', ' ', 'the', ' ', '-b', ' ', 'option!' """ chunks = self.wordsep_re.split(text) chunks = filter(None, chunks) return chunks def _fix_sentence_endings(self, chunks): """_fix_sentence_endings(chunks : [string]) Correct for sentence endings buried in 'chunks'. Eg. when the original text contains "... foo.\nBar ...", munge_whitespace() and split() will convert that to [..., "foo.", " ", "Bar", ...] which has one too few spaces; this method simply changes the one space to two. """ i = 0 pat = self.sentence_end_re while i < len(chunks)-1: if chunks[i+1] == " " and pat.search(chunks[i]): chunks[i+1] = " " i += 2 else: i += 1 def _handle_long_word(self, chunks, cur_line, cur_len, width): """_handle_long_word(chunks : [string], cur_line : [string], cur_len : int, width : int) Handle a chunk of text (most likely a word, not whitespace) that is too long to fit in any line. """ space_left = max(width - cur_len, 1) # If we're allowed to break long words, then do so: put as much # of the next chunk onto the current line as will fit. if self.break_long_words: cur_line.append(chunks[0][0:space_left]) chunks[0] = chunks[0][space_left:] # Otherwise, we have to preserve the long word intact. Only add # it to the current line if there's nothing already there -- # that minimizes how much we violate the width constraint. elif not cur_line: cur_line.append(chunks.pop(0)) # If we're not allowed to break long words, and there's already # text on the current line, do nothing. Next time through the # main loop of _wrap_chunks(), we'll wind up here again, but # cur_len will be zero, so the next line will be entirely # devoted to the long word that we can't handle right now. def _wrap_chunks(self, chunks): """_wrap_chunks(chunks : [string]) -> [string] Wrap a sequence of text chunks and return a list of lines of length 'self.width' or less. (If 'break_long_words' is false, some lines may be longer than this.) Chunks correspond roughly to words and the whitespace between them: each chunk is indivisible (modulo 'break_long_words'), but a line break can come between any two chunks. Chunks should not have internal whitespace; ie. a chunk is either all whitespace or a "word". Whitespace chunks will be removed from the beginning and end of lines, but apart from that whitespace is preserved. """ lines = [] if self.width <= 0: raise ValueError("invalid width %r (must be > 0)" % self.width) while chunks: # Start the list of chunks that will make up the current line. # cur_len is just the length of all the chunks in cur_line. cur_line = [] cur_len = 0 # Figure out which static string will prefix this line. if lines: indent = self.subsequent_indent else: indent = self.initial_indent # Maximum width for this line. width = self.width - len(indent) # First chunk on line is whitespace -- drop it, unless this # is the very beginning of the text (ie. no lines started yet). if chunks[0].strip() == '' and lines: del chunks[0] while chunks: l = len(chunks[0]) # Can at least squeeze this chunk onto the current line. if cur_len + l <= width: cur_line.append(chunks.pop(0)) cur_len += l # Nope, this line is full. else: break # The current line is full, and the next chunk is too big to # fit on *any* line (not just this one). if chunks and len(chunks[0]) > width: self._handle_long_word(chunks, cur_line, cur_len, width) # If the last chunk on this line is all whitespace, drop it. if cur_line and cur_line[-1].strip() == '': del cur_line[-1] # Convert current line back to a string and store it in list # of all lines (return value). if cur_line: lines.append(indent + ''.join(cur_line)) return lines # -- Public interface ---------------------------------------------- def wrap(self, text): """wrap(text : string) -> [string] Reformat the single paragraph in 'text' so it fits in lines of no more than 'self.width' columns, and return a list of wrapped lines. Tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characters (including newline) are converted to space. """ text = self._munge_whitespace(text) indent = self.initial_indent chunks = self._split(text) if self.fix_sentence_endings: self._fix_sentence_endings(chunks) return self._wrap_chunks(chunks) def fill(self, text): """fill(text : string) -> string Reformat the single paragraph in 'text' to fit in lines of no more than 'self.width' columns, and return a new string containing the entire wrapped paragraph. """ return "\n".join(self.wrap(text)) # -- Convenience interface --------------------------------------------- def wrap(text, width=70, **kwargs): """Wrap a single paragraph of text, returning a list of wrapped lines. Reformat the single paragraph in 'text' so it fits in lines of no more than 'width' columns, and return a list of wrapped lines. By default, tabs in 'text' are expanded with string.expandtabs(), and all other whitespace characters (including newline) are converted to space. See TextWrapper class for available keyword args to customize wrapping behaviour. """ w = TextWrapper(width=width, **kwargs) return w.wrap(text) def fill(text, width=70, **kwargs): """Fill a single paragraph of text, returning a new string. Reformat the single paragraph in 'text' to fit in lines of no more than 'width' columns, and return a new string containing the entire wrapped paragraph. As with wrap(), tabs are expanded and other whitespace characters converted to space. See TextWrapper class for available keyword args to customize wrapping behaviour. """ w = TextWrapper(width=width, **kwargs) return w.fill(text) # -- Loosely related functionality ------------------------------------- def dedent(text): """dedent(text : string) -> string Remove any whitespace than can be uniformly removed from the left of every line in `text`. This can be used e.g. to make triple-quoted strings line up with the left edge of screen/whatever, while still presenting it in the source code in indented form. For example: def test(): # end first line with \ to avoid the empty line! s = '''\ hello world ''' print repr(s) # prints ' hello\n world\n ' print repr(dedent(s)) # prints 'hello\n world\n' """ lines = text.expandtabs().split('\n') margin = None for line in lines: content = line.lstrip() if not content: continue indent = len(line) - len(content) if margin is None: margin = indent else: margin = min(margin, indent) if margin is not None and margin > 0: for i in range(len(lines)): lines[i] = lines[i][margin:] return '\n'.join(lines) --- NEW FILE: optparse.py --- """optparse - a powerful, extensible, and easy-to-use option parser. By Greg Ward <gw...@py...> Originally distributed as Optik; see http://optik.sourceforge.net/ . If you have problems with this module, please do not file bugs, patches, or feature requests with Python; instead, use Optik's SourceForge project page: http://sourceforge.net/projects/optik For support, use the opt...@li... mailing list (http://lists.sourceforge.net/lists/listinfo/optik-users). """ # Python developers: please do not make changes to this file, since # it is automatically generated from the Optik source code. __version__ = "1.4.1+" [...1365 lines suppressed...] else: # Isolate all words with s as a prefix. possibilities = [word for word in wordmap.keys() if word.startswith(s)] # No exact match, so there had better be just one possibility. if len(possibilities) == 1: return possibilities[0] elif not possibilities: raise BadOptionError("no such option: %s" % s) else: # More than one possible completion: ambiguous prefix. raise BadOptionError("ambiguous option: %s (%s?)" % (s, ", ".join(possibilities))) # Some day, there might be many Option classes. As of Optik 1.3, the # preferred way to instantiate Options is indirectly, via make_option(), # which will become a factory function when there are many Option # classes. make_option = Option |
From: Correa <thi...@us...> - 2004-10-19 18:44:20
|
Update of /cvsroot/wpdev/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20727 Modified Files: configure.py Log Message: Attempt to get configure.py to work on Fedora and Solaris. Index: configure.py =================================================================== RCS file: /cvsroot/wpdev/wolfpack/configure.py,v retrieving revision 1.37 retrieving revision 1.38 diff -C2 -d -r1.37 -r1.38 *** configure.py 24 Sep 2004 04:47:23 -0000 1.37 --- configure.py 19 Oct 2004 18:44:09 -0000 1.38 *************** *** 1,3 **** ! #!/usr/bin/env python2.3 ################################################################# # ) (\_ # Wolfpack 13.0.0 Build Script # --- 1,3 ---- ! #!/usr/bin/env python ################################################################# # ) (\_ # Wolfpack 13.0.0 Build Script # *************** *** 14,18 **** import string import distutils.sysconfig ! from optparse import OptionParser # These are the variables we are trying to figure out --- 14,23 ---- import string import distutils.sysconfig ! try: ! from optparse import OptionParser ! except: ! sys.path.append( './tools/scripts' ) ! from optparse import OptionParser ! # These are the variables we are trying to figure out *************** *** 227,235 **** sys.stdout.write( "Checking Python version... " ) ! if sys.hexversion >= 0x020300F0: sys.stdout.write(green("ok\n")) else: sys.stdout.write( red("failed") + "\n" ) ! sys.stdout.write( bold("Wolfpack requires Python version greater than 2.3.0 ") ) sys.exit(); --- 232,240 ---- sys.stdout.write( "Checking Python version... " ) ! if sys.hexversion >= 0x020200F0: sys.stdout.write(green("ok\n")) else: sys.stdout.write( red("failed") + "\n" ) ! sys.stdout.write( bold("Wolfpack requires Python version greater than 2.2.0 ") ) sys.exit(); |
From: Correa <thi...@us...> - 2004-10-19 18:42:43
|
Update of /cvsroot/wpdev/wolfpack/tools/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv20153/scripts Log Message: Directory /cvsroot/wpdev/wolfpack/tools/scripts added to the repository |
From: Incanus <inc...@us...> - 2004-10-19 13:32:43
|
Update of /cvsroot/wpdev/xmlscripts/documentation/webroot In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv543/documentation/webroot Modified Files: ChangeLog.wolfpack Log Message: Fixed leatherworkers and tanners not buying leather and hides Index: ChangeLog.wolfpack =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/documentation/webroot/ChangeLog.wolfpack,v retrieving revision 1.166 retrieving revision 1.167 diff -C2 -d -r1.166 -r1.167 *** ChangeLog.wolfpack 19 Oct 2004 11:55:21 -0000 1.166 --- ChangeLog.wolfpack 19 Oct 2004 13:32:34 -0000 1.167 *************** *** 4,7 **** --- 4,8 ---- * Definition Changes: - Adjusted carving sheeps. + - Fixed leatherworkers and tanners not buying leather and hides. * Python Script Changes: - Fixed bug #0000361. (Pets don't follow trough gate) |
From: Incanus <inc...@us...> - 2004-10-19 13:32:42
|
Update of /cvsroot/wpdev/xmlscripts/definitions/npcs/humans/vendors In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv543/definitions/npcs/humans/vendors Modified Files: leatherworker.xml tanner.xml Log Message: Fixed leatherworkers and tanners not buying leather and hides Index: leatherworker.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/humans/vendors/leatherworker.xml,v retrieving revision 1.4 retrieving revision 1.5 diff -C2 -d -r1.4 -r1.5 *** leatherworker.xml 26 Sep 2004 12:52:23 -0000 1.4 --- leatherworker.xml 19 Oct 2004 13:32:33 -0000 1.5 *************** *** 14,17 **** --- 14,23 ---- <item id="1711"><amount>10</amount></item> </restockable> + <sellable> + <item id="1078"/> + <item id="1081"/> + <item id="leather_cut"/> + <item id="leather_hides"/> + </sellable> </shopkeeper> </npc> Index: tanner.xml =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/definitions/npcs/humans/vendors/tanner.xml,v retrieving revision 1.5 retrieving revision 1.6 diff -C2 -d -r1.5 -r1.6 *** tanner.xml 26 Sep 2004 12:52:23 -0000 1.5 --- tanner.xml 19 Oct 2004 13:32:33 -0000 1.6 *************** *** 36,39 **** --- 36,45 ---- <item id="9b2"><amount>20</amount></item> <!-- Backpack --> </restockable> + <sellable> + <item id="1078"/> + <item id="1081"/> + <item id="leather_cut"/> + <item id="leather_hides"/> + </sellable> </shopkeeper> </npc> |