[wpdev-commits] xmlscripts/scripts potions.py,1.57,1.58
Brought to you by:
rip,
thiagocorrea
From: Sebastian H. <dar...@us...> - 2004-10-10 19:56:54
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv4434 Modified Files: potions.py Log Message: fixes Index: potions.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/potions.py,v retrieving revision 1.57 retrieving revision 1.58 diff -C2 -d -r1.57 -r1.58 *** potions.py 30 Sep 2004 16:01:14 -0000 1.57 --- potions.py 10 Oct 2004 19:56:41 -0000 1.58 *************** *** 3,6 **** --- 3,7 ---- import wolfpack.time import math + import time from random import randint, random from wolfpack.utilities import hex2dec, throwobject, energydamage, checkLoS *************** *** 405,411 **** if socket.hastag('heal_pot_timer'): elapsed = int( socket.gettag( "heal_pot_timer" ) ) ! if elapsed > wolfpack.time.currenttime(): # Broken Timer ! if wolfpack.time.currenttime() - elapsed > HEAL_POT_DELAY: socket.deltag('heal_pot_timer') else: --- 406,412 ---- if socket.hastag('heal_pot_timer'): elapsed = int( socket.gettag( "heal_pot_timer" ) ) ! if elapsed > time.time(): # Broken Timer ! if time.time() - elapsed > HEAL_POT_DELAY: socket.deltag('heal_pot_timer') else: *************** *** 413,417 **** return False ! socket.settag( "heal_pot_timer", wolfpack.time.currenttime() + HEAL_POT_DELAY) amount = 0 --- 414,418 ---- return False ! socket.settag( "heal_pot_timer", time.time() + HEAL_POT_DELAY) amount = 0 *************** *** 499,515 **** return False ! if not char.hastag( "dex_pot_timer" ): ! char.settag( "dex_pot_timer", (wolfpack.time.currenttime() + AGILITY_TIME) ) ! # Compare ! elapsed = int( char.gettag( "dex_pot_timer" ) ) ! if elapsed > wolfpack.time.currenttime(): ! socket.clilocmessage(502173) # You are already under a similar effect. ! return False ! else: ! char.settag( 'dex_pot_timer', (wolfpack.time.currenttime() + AGILITY_TIME) ) if char.dexterity + bonus < 1: bonus = -(char.strength - 1) char.dexterity2 += bonus char.dexterity += bonus --- 500,519 ---- return False ! if char.hastag( "dex_pot_timer" ): ! # Compare ! elapsed = int( char.gettag( "dex_pot_timer" ) ) ! ! # Some bug occured ! if elapsed - time.time() > AGILITY_TIME: ! char.deltag('dex_pot_timer') ! elif elapsed > time.time(): ! socket.clilocmessage(502173) # You are already under a similar effect. ! return False ! char.settag('dex_pot_timer', time.time() + AGILITY_TIME) if char.dexterity + bonus < 1: bonus = -(char.strength - 1) + char.dexterity2 += bonus char.dexterity += bonus *************** *** 518,522 **** char.updatestats() ! char.addtimer( AGILITY_TIME, "magic.utilities.statmodifier_expire", [1, bonus], 1, 1, "magic_statmodifier_1", "magic.utilities.statmodifier_dispel" ) char.action( ANIM_FIDGET3 ) --- 522,526 ---- char.updatestats() ! char.addtimer( int(AGILITY_TIME * 1000), "magic.utilities.statmodifier_expire", [1, bonus], 1, 1, "magic_statmodifier_1", "magic.utilities.statmodifier_dispel" ) char.action( ANIM_FIDGET3 ) *************** *** 546,559 **** return False ! if not char.hastag( "str_pot_timer" ): ! char.settag( "str_pot_timer", (wolfpack.time.currenttime() + STRENGTH_TIME) ) ! ! # Compare ! elapsed = int( char.gettag( "str_pot_timer" ) ) ! if elapsed > wolfpack.time.currenttime(): ! socket.clilocmessage(502173) # You are already under a similar effect ! return False ! else: ! char.settag( 'str_pot_timer', (wolfpack.time.currenttime() + STRENGTH_TIME) ) if char.strength + bonus < 1: --- 550,564 ---- return False ! if char.hastag( "str_pot_timer" ): ! # Compare ! elapsed = int( char.gettag( "str_pot_timer" ) ) ! ! if elapsed - time.time() > STRENGTH_TIME: ! char.deltag('str_pot_timer') ! elif elapsed > time.time(): ! socket.clilocmessage(502173) # You are already under a similar effect ! return False ! ! char.settag( "str_pot_timer", time.time() + STRENGTH_TIME ) if char.strength + bonus < 1: *************** *** 565,569 **** char.updatestats() ! char.addtimer( STRENGTH_TIME, "magic.utilities.statmodifier_expire", [0, bonus], 1, 1, "magic_statmodifier_0", "magic.utilities.statmodifier_dispel" ) char.action( ANIM_FIDGET3 ) --- 570,574 ---- char.updatestats() ! char.addtimer( int(STRENGTH_TIME * 1000.0), "magic.utilities.statmodifier_expire", [0, bonus], 1, 1, "magic_statmodifier_0", "magic.utilities.statmodifier_dispel" ) char.action( ANIM_FIDGET3 ) |