[wpdev-commits] xmlscripts/scripts/wolfpack utilities.py,1.59,1.60
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-07-09 10:07:12
|
Update of /cvsroot/wpdev/xmlscripts/scripts/wolfpack In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv28798/wolfpack Modified Files: utilities.py Log Message: commands.fix Added a new utility function Index: utilities.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/wolfpack/utilities.py,v retrieving revision 1.59 retrieving revision 1.60 diff -C2 -d -r1.59 -r1.60 *** utilities.py 27 Jun 2004 11:48:29 -0000 1.59 --- utilities.py 9 Jul 2004 10:06:54 -0000 1.60 *************** *** 18,21 **** --- 18,22 ---- from wolfpack.consts import * import random + import string from types import * *************** *** 111,114 **** --- 112,133 ---- """ + \function wolfpack.utilities.booleantoggle + \param boolean + \return Boolean + \description Takes a boolean property and toggles it. + """ + + def booleantoggle( boolean ): + if boolean == 1: + boolean = 0 + elif boolean == 0: + boolean = 1 + elif boolean.lower() == "true": + boolean = "false" + elif boolean.lower() == "false": + boolean = "true" + return boolean + + """ \function wolfpack.utilities.tocontainer \param item The item you want to move to the given container. *************** *** 448,452 **** \param baseid The baseid of the resource you are looking for. \param amount The amount that is required of the given resource. ! \return 0 if all the required resources have been found. Otherwise the remaining amount of the resource that has not been found. \description Recursively searches for items with a given baseid in a container and checks if a --- 467,471 ---- \param baseid The baseid of the resource you are looking for. \param amount The amount that is required of the given resource. ! \return 0 if all the required resources have been found. Otherwise the remaining amount of the resource that has not been found. \description Recursively searches for items with a given baseid in a container and checks if a *************** *** 502,510 **** \param source The source of the damage. May be None. \param amount The amount of damage dealt. ! \param physical Defaults to 0. The physical fraction of the damage. This is an integer value ranging from 0 to 100. ! \param fire Defaults to 0. The fire fraction of the damage. This is an integer value ranging from 0 to 100. ! \param cold Defaults to 0. The cold fraction of the damage. This is an integer value ranging from 0 to 100. \param poison Defaults to 0. --- 521,529 ---- \param source The source of the damage. May be None. \param amount The amount of damage dealt. ! \param physical Defaults to 0. The physical fraction of the damage. This is an integer value ranging from 0 to 100. ! \param fire Defaults to 0. The fire fraction of the damage. This is an integer value ranging from 0 to 100. ! \param cold Defaults to 0. The cold fraction of the damage. This is an integer value ranging from 0 to 100. \param poison Defaults to 0. *************** *** 512,516 **** \param energy Defaults to 0. The energy fraction of the damage. This is an integer value ranging from 0 to 100. ! \param noreflect Defaults to 0. If this parameter is 1, no physical damage will be reflected back to the source. \param damagetype Defaults to DAMAGE_MAGICAL. This is the damagetype passed on to the internal damage function. --- 531,535 ---- \param energy Defaults to 0. The energy fraction of the damage. This is an integer value ranging from 0 to 100. ! \param noreflect Defaults to 0. If this parameter is 1, no physical damage will be reflected back to the source. \param damagetype Defaults to DAMAGE_MAGICAL. This is the damagetype passed on to the internal damage function. |