[wpdev-commits] xmlscripts/scripts door.py,1.3,1.4
Brought to you by:
rip,
thiagocorrea
|
From: <dr...@us...> - 2004-01-14 03:11:44
|
Update of /cvsroot/wpdev/xmlscripts/scripts
In directory sc8-pr-cvs1:/tmp/cvs-serv31260
Modified Files:
door.py
Log Message:
Door linking:
'tags set link serial_of_other_door
Index: door.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/door.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** door.py 8 Oct 2003 01:35:48 -0000 1.3
--- door.py 14 Jan 2004 03:11:41 -0000 1.4
***************
*** 1,4 ****
--- 1,5 ----
import wolfpack
+ from wolfpack.utilities import *
# Sound constants for opening and closing a door
***************
*** 230,234 ****
opencount = int( item.gettag( 'opencount' ) ) + 1
! item.settag( 'opencount', opencount )
# Add an autoclose tempeffect
--- 231,240 ----
opencount = int( item.gettag( 'opencount' ) ) + 1
! item.settag( 'opencount', str(opencount) )
!
! if not item.hastag('opened'):
! item.settag( 'opened', 'true' )
! else:
! item.deltag( 'opened' )
# Add an autoclose tempeffect
***************
*** 259,263 ****
return 0
!
def autoclose( item, args ):
if not item or not item.hastag( 'opencount' ):
--- 265,269 ----
return 0
!
def autoclose( item, args ):
if not item or not item.hastag( 'opencount' ):
***************
*** 272,275 ****
--- 278,284 ----
item.deltag( 'opencount' )
+
+ if item.hastag( 'opened' ):
+ item.deltag( 'opened' )
# Find the door definition for this item
***************
*** 285,293 ****
# Soundeffect (close)
item.soundeffect( door[5] )
!
def onUse( char, item ):
# Using doors doesnt count against the object-delay
char.objectdelay = 0
# In Range?
if not char.gm and not char.canreach( item, 2 ):
--- 294,308 ----
# Soundeffect (close)
item.soundeffect( door[5] )
!
!
def onUse( char, item ):
# Using doors doesnt count against the object-delay
char.objectdelay = 0
+ if item.hastag('link') and not item.gettag('opened'):
+ doubledoor = wolfpack.finditem( hex2dec(item.gettag('link')) )
+ if not doubledoor.gettag('opened'):
+ opendoor( char, doubledoor )
+
# In Range?
if not char.gm and not char.canreach( item, 2 ):
***************
*** 296,297 ****
--- 311,313 ----
return opendoor( char, item )
+
|