Thread: [wpdev-commits] xmlscripts/scripts potions.py,1.51,1.52
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-09-20 16:03:35
|
Update of /cvsroot/wpdev/xmlscripts/scripts In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv2299 Modified Files: potions.py Log Message: I noticed tha when explosion potions do the chain bomb, the objects are slightly out of sync and you can see the pattern to which they were scanned... This should hopefully make it a faster process. Index: potions.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/potions.py,v retrieving revision 1.51 retrieving revision 1.52 diff -C2 -d -r1.51 -r1.52 *** potions.py 16 Sep 2004 16:42:29 -0000 1.51 --- potions.py 20 Sep 2004 16:03:25 -0000 1.52 *************** *** 226,230 **** else: outradius = 5 ! # Potion thrown on the ground if not potion.container: x1 = int(potion.pos.x - outradius) --- 226,232 ---- else: outradius = 5 ! # Empty Lists ! potion_chainlist = [] ! # Potion is thrown on the ground if not potion.container: x1 = int(potion.pos.x - outradius) *************** *** 244,263 **** # Chain Reaction Bombing chainregion = wolfpack.itemregion( x1, y1, x2, y2, potion.pos.map ) ! chainbomb= chainregion.first while chainbomb: ! if checkLoS( potion, chainbomb, outradius ) and not chainbomb.hastag('exploding'): ! if chainbomb.baseid in explodables: ! chainbomb.settag('exploding', 'true') ! chainbomb.addtimer( randint(1000, 2250), "potions.potioncountdown", [char.serial, 0, chainbomb.amount] ) ! chainbomb = chainregion.next ! # Potion Kegs ! elif (chainbomb.hastag('kegfill') and chainbomb.hastag('potiontype')) and ( chainbomb.gettag('potiontype') in [11, 12, 13] and chainbomb.gettag('kegfill') >= 1 ): ! chainbomb.settag('exploding', 'true') ! chainbomb.addtimer( randint(1000, 2250), "potions.potioncountdown", [char.serial, 11, chainbomb.gettag('kegfill') ] ) ! chainbomb = chainregion.next ! else: ! chainbomb = chainregion.next ! else: chainbomb = chainregion.next return # Potion is in a container --- 246,272 ---- # Chain Reaction Bombing chainregion = wolfpack.itemregion( x1, y1, x2, y2, potion.pos.map ) ! ! chainbomb = chainregion.first ! # Scan the region, build a list of explosives while chainbomb: ! # Doing error checks first, makes it faster ! if not checkLoS( potion, chainbomb, outradius ): chainbomb = chainregion.next + if chainbomb.hastag('exploding'): + chainbomb = chainregion.next + # Type Checking + if not potion.hastag('potiontype') or not chainbomb.gettag('potiontype') in [11,12,13]: + chainbomb = chainregion.next + # Append + potion_chainlist.append( chainbomb ) + chainbomb = chainregion.next + # Explosions + for bomb in potion_chainlist: + bomb.settag( 'exploding', char.serial ) + if chainbomb.hastag( 'kegfill' ) and int( chainbomb.gettag( 'kegfill' ) ) >= 1: + bomb.addtimer( randint(1000,2250), "potions.potioncountdown", [ char.serial, 0, int( bomb.gettag( 'kegfill' ) ) ] ) + else: + bomb.addtimer( randint( 1000, 2250 ), "potions.potioncountdown", [ char.serial, 0, bomb.amount ] ) + return # Potion is in a container *************** *** 280,298 **** chainregion = wolfpack.itemregion( x1, y1, x2, y2, char.pos.map ) chainbomb = chainregion.first while chainbomb: ! if checkLoS( char, chainbomb, outradius ) and not chainbomb.hastag('exploding'): ! if chainbomb.baseid in explodables: ! chainbomb.settag('exploding', 'true') ! chainbomb.addtimer( randint(1000, 2250), "potions.potioncountdown", [char.serial, 0, chainbomb.amount] ) ! chainbomb = chainregion.next ! elif ( chainbomb.hastag('kegfill') and chainbomb.hastag('potiontype') ) and ( chainbomb.gettag('potiontype') in [11, 12, 13] and chainbomb.gettag('kegfill') >= 1 ): ! chainbomb.settag('exploding', 'true') ! chainbomb.addtimer( randint(1000, 2250), "potions.potioncountdown", [char.serial, 11, chainbomb.gettag('kegfill') ] ) ! chainbomb = chainregion.next ! else: ! chainbomb = chainregion.next ! else: chainbomb = chainregion.next ! # Potion Kegs return --- 289,312 ---- chainregion = wolfpack.itemregion( x1, y1, x2, y2, char.pos.map ) chainbomb = chainregion.first + # Scan the region, build a list of explosives while chainbomb: ! # Doing error checks first, makes it faster ! if not checkLoS( potion, chainbomb, outradius ): chainbomb = chainregion.next ! if chainbomb.hastag('exploding'): ! chainbomb = chainregion.next ! # Type Checking ! if not potion.hastag('potiontype') or not chainbomb.gettag('potiontype') in [11,12,13]: ! chainbomb = chainregion.next ! # Append ! potion_chainlist.append( chainbomb ) ! chainbomb = chainregion.next ! # Explosions ! for bomb in potion_chainlist: ! bomb.settag( 'exploding', char.serial ) ! if chainbomb.hastag( 'kegfill' ) and int( chainbomb.gettag( 'kegfill' ) ) >= 1: ! bomb.addtimer( randint(1000,2250), "potions.potioncountdown", [ char.serial, 0, int( bomb.gettag( 'kegfill' ) ) ] ) ! else: ! bomb.addtimer( randint( 1000, 2250 ), "potions.potioncountdown", [ char.serial, 0, bomb.amount ] ) return |