Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16134
Modified Files:
environment.py ore.py pickaxe.py potionkeg.py potions.py
Log Message:
More import cleanups...
Removed wolfpack.currentime() and moved it to wolfpack.time.currenttime() / wolfpack.time.servertime()
It seems to belong here more than it would in wolfpack.currenttime()
Scripts updated to support this.
Index: environment.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/environment.py,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** environment.py 9 Jul 2004 21:47:45 -0000 1.13
--- environment.py 16 Jul 2004 07:09:21 -0000 1.14
***************
*** 3,7 ****
import wolfpack
! import time
import random
from wolfpack.consts import COTTONPLANTS_REGROW, ANIM_ATTACK5, TINKERING, \
--- 3,7 ----
import wolfpack
! import wolfpack.time
import random
from wolfpack.consts import COTTONPLANTS_REGROW, ANIM_ATTACK5, TINKERING, \
***************
*** 13,22 ****
def cotton( char, item ):
- currenttime = int( time.time() )
if item.hastag( 'lastpick' ):
lastpick = item.gettag( 'lastpick' )
! if lastpick + COTTONPLANTS_REGROW > currenttime:
char.message( "You can't pick cotton here yet." )
return 1
--- 13,21 ----
def cotton( char, item ):
if item.hastag( 'lastpick' ):
lastpick = item.gettag( 'lastpick' )
! if lastpick + COTTONPLANTS_REGROW > wolfpack.time.currenttime():
char.message( "You can't pick cotton here yet." )
return 1
***************
*** 33,37 ****
# Set a timer for the cotton plant
! item.settag( 'lastpick', currenttime )
return 1
--- 32,36 ----
# Set a timer for the cotton plant
! item.settag( 'lastpick', wolfpack.time.currenttime() )
return 1
Index: ore.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/ore.py,v
retrieving revision 1.21
retrieving revision 1.22
diff -C2 -d -r1.21 -r1.22
*** ore.py 15 Jul 2004 20:08:30 -0000 1.21
--- ore.py 16 Jul 2004 07:09:22 -0000 1.22
***************
*** 9,13 ****
from wolfpack.consts import GRAY, MINING, SOUND_HAMMER_1
from skills import mining
- from wolfpack.time import *
from random import randrange, randint
from system.lootlists import DEF_ORES # Gets BaseIDs
--- 9,12 ----
Index: potions.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/potions.py,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** potions.py 13 Jul 2004 06:35:36 -0000 1.41
--- potions.py 16 Jul 2004 07:09:26 -0000 1.42
***************
*** 1,7 ****
import wolfpack
from random import randint, random
- from wolfpack import time
from wolfpack.utilities import hex2dec, throwobject, energydamage, checkLoS
- import math
from system import poison
from wolfpack.consts import RED, ALCHEMY, STRENGTH_TIME, ANIM_FIDGET3, \
--- 1,8 ----
+
import wolfpack
+ import wolfpack.time
+ import math
from random import randint, random
from wolfpack.utilities import hex2dec, throwobject, energydamage, checkLoS
from system import poison
from wolfpack.consts import RED, ALCHEMY, STRENGTH_TIME, ANIM_FIDGET3, \
***************
*** 410,422 ****
if not char.hastag( "heal_pot_timer" ):
! char.settag( "heal_pot_timer", (time.servertime() + HEAL_POT_DELAY) )
# Compare
elapsed = int( char.gettag( "heal_pot_timer" ) )
! if elapsed > time.servertime():
socket.clilocmessage( 500235, '', GRAY ) # You must wait 10 seconds before using another healing potion.
return False
else:
! char.settag( "heal_pot_timer", (time.servertime() + HEAL_POT_DELAY) )
amount = 0
--- 411,423 ----
if not char.hastag( "heal_pot_timer" ):
! char.settag( "heal_pot_timer", (wolfpack.time.currenttime() + HEAL_POT_DELAY) )
# Compare
elapsed = int( char.gettag( "heal_pot_timer" ) )
! if elapsed > wolfpack.time.currenttime():
socket.clilocmessage( 500235, '', GRAY ) # You must wait 10 seconds before using another healing potion.
return False
else:
! char.settag( "heal_pot_timer", (wolfpack.time.currenttime() + HEAL_POT_DELAY) )
amount = 0
***************
*** 506,518 ****
if not char.hastag( "dex_pot_timer" ):
! char.settag( "dex_pot_timer", (time.servertime() + AGILITY_TIME) )
# Compare
elapsed = int( char.gettag( "dex_pot_timer" ) )
! if elapsed > time.servertime():
socket.clilocmessage(502173) # You are already under a similar effect.
return False
else:
! char.settag( 'dex_pot_timer', (time.servertime() + AGILITY_TIME) )
if char.dexterity + bonus < 1:
--- 507,519 ----
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:
***************
*** 553,565 ****
if not char.hastag( "str_pot_timer" ):
! char.settag( "str_pot_timer", (time.servertime() + STRENGTH_TIME) )
# Compare
elapsed = int( char.gettag( "str_pot_timer" ) )
! if elapsed > time.servertime():
socket.clilocmessage(502173) # You are already under a similar effect
return False
else:
! char.settag( 'str_pot_timer', (time.servertime() + STRENGTH_TIME) )
if char.strength + bonus < 1:
--- 554,566 ----
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:
Index: pickaxe.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/pickaxe.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** pickaxe.py 9 Jul 2004 21:47:45 -0000 1.4
--- pickaxe.py 16 Jul 2004 07:09:26 -0000 1.5
***************
*** 7,20 ****
import wolfpack
import skills
import whrandom
import wolfpack.utilities
from wolfpack.consts import GRAY, LAYER_MOUNT
- from wolfpack.time import *
-
def onUse( char, tool ):
#Already digging ?
! if char.socket.hastag( 'is_mining' ) and ( char.socket.gettag( 'is_mining' ) > servertime() ):
# You are already digging.
char.socket.clilocmessage( 503029, "", GRAY )
--- 7,19 ----
import wolfpack
+ import wolfpack.time
import skills
import whrandom
import wolfpack.utilities
from wolfpack.consts import GRAY, LAYER_MOUNT
def onUse( char, tool ):
#Already digging ?
! if char.socket.hastag( 'is_mining' ) and ( char.socket.gettag( 'is_mining' ) > wolfpack.time.currenttime() ):
# You are already digging.
char.socket.clilocmessage( 503029, "", GRAY )
Index: potionkeg.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/potionkeg.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** potionkeg.py 12 Jul 2004 21:06:29 -0000 1.9
--- potionkeg.py 16 Jul 2004 07:09:26 -0000 1.10
***************
*** 1,5 ****
import wolfpack
- import wolfpack.time
import wolfpack.utilities
# Imports the potion table.
--- 1,4 ----
|