Update of /cvsroot/wpdev/xmlscripts/scripts/magic
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv21418/magic
Modified Files:
__init__.py circle1.py circle2.py circle3.py circle4.py
circle5.py circle6.py circle7.py circle8.py necrospells.py
scroll.py spell.py
Log Message:
Allowed casting from scrolls.
Decreased mana by 50% for scrolls
decreased circle for skill calculation by 2 for scrolls
started implementation for wands
Index: spell.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/spell.py,v
retrieving revision 1.11
retrieving revision 1.12
diff -C2 -d -r1.11 -r1.12
*** spell.py 20 Jul 2004 20:55:13 -0000 1.11
--- spell.py 22 Jul 2004 17:22:06 -0000 1.12
***************
*** 43,53 ****
eventlist.remove('magic')
char.events = eventlist
! args[0].cast(char, args[1], args[2])
# Basic Spell Class
class Spell:
# We affect another character
! def affectchar(self, char, mode, target, args=[]):
return 1
--- 43,75 ----
eventlist.remove('magic')
char.events = eventlist
+
+ # target
+ if args[3] and type(args[3]) == int:
+ target = wolfpack.findobject(args[3])
+
+ # Object went out of scope
+ if not target:
+ fizzle(char)
+ return
+ else:
+ target = None
+
+ # item
+ if args[4] and type(args[4]) == int:
+ item = wolfpack.findobject(args[4])
+
+ # Object went out of scope
+ if not item:
+ fizzle(char)
+ return
+ else:
+ item = None
! args[0].cast(char, args[1], args[2], args[3], item)
# Basic Spell Class
class Spell:
# We affect another character
! def affectchar(self, char, mode, target, args=[], item=None):
return 1
***************
*** 80,86 ****
# Prepare the casting of this spell.
#
! def precast(self, char, mode=0, args=[]):
eventlist = char.events
socket = char.socket
# We are frozen
--- 102,116 ----
# Prepare the casting of this spell.
#
! def precast(self, char, mode=0, args=[], target = None, item = None):
eventlist = char.events
socket = char.socket
+
+ # Casting from a scroll and no scroll was passed
+ if mode == 1 and not item:
+ return
+
+ # Casting from a wand and no wand was passed
+ if mode == 2 and not item:
+ return
# We are frozen
***************
*** 100,104 ****
return 0
! if not self.checkrequirements(char, mode, args):
return 0
--- 130,134 ----
return 0
! if not self.checkrequirements(char, mode, args, target, item):
return 0
***************
*** 112,116 ****
char.events = ['magic'] + eventlist
char.action(self.castaction)
! char.addtimer(self.calcdelay(), 'magic.spell.callback', [self, mode, args], 0, 0, "cast_delay")
return 1
--- 142,161 ----
char.events = ['magic'] + eventlist
char.action(self.castaction)
!
! if item:
! item = item.serial
!
! if target and (type(target).__name__ == 'wpchar' or type(target).__name__ == 'wpitem'):
! target = target.serial
!
! if mode == MODE_BOOK:
! source = 'book'
! elif mode == MODE_SCROLL:
! source = 'scroll (0x%x)' % item
! elif mode == MODE_WAND:
! source = 'wand (0x%x)' % item
!
! char.log(LOG_MESSAGE, "Casting spell %u (%s) from %s.\n" % (self.spellid, self.__class__.__name__, source))
! char.addtimer(self.calcdelay(), 'magic.spell.callback', [self, mode, args, target, item], 0, 0, "cast_delay")
return 1
***************
*** 118,122 ****
return self.casttime
! def checkrequirements(self, char, mode, args=[]):
if char.dead:
return 0
--- 163,167 ----
return self.casttime
! def checkrequirements(self, char, mode, args=[], target=None, item=None):
if char.dead:
return 0
***************
*** 137,152 ****
return 0
return 1
! def consumerequirements(self, char, mode, args=[]):
# Check Basic Requirements before proceeding (Includes Death of Caster etc.)
! if not self.checkrequirements(char, mode):
fizzle(char)
! return 0
# Consume Mana
if mode == MODE_BOOK:
if self.mana != 0:
! char.mana -= self.mana
char.updatemana()
--- 182,213 ----
return 0
+ elif mode == MODE_SCROLL:
+ # Check if the scroll is allright
+ if not item or item.getoutmostchar() != char:
+ char.message(501625)
+ return 0
+
+ # Check for Mana
+ if char.mana < (self.mana + 1) / 2:
+ char.message(502625)
+ return 0
+
+ elif mode == MODE_WAND:
+ # Check if the wand is allright
+ if not item or item.getoutmostchar() != char:
+ return 0
+
return 1
! def consumerequirements(self, char, mode, args=[], target=None, item=None):
# Check Basic Requirements before proceeding (Includes Death of Caster etc.)
! if not self.checkrequirements(char, mode, args, target, item):
fizzle(char)
! return 0
# Consume Mana
if mode == MODE_BOOK:
if self.mana != 0:
! char.mana = max(0, char.mana - self.mana)
char.updatemana()
***************
*** 154,162 ****
if len(self.reagents) > 0:
consumeReagents(char.getbackpack(), self.reagents.copy())
# Check Skill
if self.skill != None:
! minskill = max(0, int((1000 / 7) * self.circle - 200))
! maxskill = min(1200, int((1000 / 7) * self.circle + 200))
if not char.checkskill(self.skill, minskill, maxskill):
--- 215,244 ----
if len(self.reagents) > 0:
consumeReagents(char.getbackpack(), self.reagents.copy())
+
+ # Reduced Skill, Reduced Mana, No Reagents
+ elif mode == MODE_SCROLL:
+ if self.mana != 0:
+ char.mana = max(0, char.mana - (self.mana + 1) / 2)
+ char.updatemana()
+
+ # Remove one of the scrolls
+ if item.amount == 1:
+ item.delete()
+ else:
+ item.amount -= 1
+ item.update()
+
+ # No requirements at all
+ elif mode == MODE_WAND:
+ pass
# Check Skill
if self.skill != None:
! if mode == MODE_BOOK:
! circle = self.circle
! else:
! circle = self.circle - 2
! minskill = max(0, int((1000 / 7) * circle - 200))
! maxskill = min(1200, int((1000 / 7) * circle + 200))
if not char.checkskill(self.skill, minskill, maxskill):
***************
*** 168,172 ****
# Not implemented yet
! def checkreflect(self, char, mode, targettype, target):
return 0
--- 250,254 ----
# Not implemented yet
! def checkreflect(self, char, mode, targettype, target, args, item):
return 0
***************
*** 224,236 ****
return chance >= random.random()
! def cast(self, char, mode, args=[]):
! if char.socket:
! char.socket.settag('cast_target', 1)
! char.socket.attachtarget('magic.target_response', [ self, mode, args ], 'magic.target_cancel', 'magic.target_timeout', 8000) # Don't forget the timeout later on
else:
! # Callback to the NPC AI ??
! wolfpack.console.log(LOG_ERROR, "A NPC is trying to cast a spell.")
! def target(self, char, mode, targettype, target, args=[]):
raise Exception, "Spell without target method: " + str(self.__class__.__name__)
--- 306,324 ----
return chance >= random.random()
! def cast(self, char, mode, args=[], target=None, item=None):
! if not target:
! if char.socket:
! char.socket.settag('cast_target', 1)
! if item:
! item = item.serial
! char.socket.attachtarget('magic.target_response', [ self, mode, args, item ], 'magic.target_cancel', 'magic.target_timeout', 8000) # Don't forget the timeout later on
! else:
! # Callback to the NPC AI ??
! wolfpack.console.log(LOG_ERROR, "A NPC is trying to cast a spell.")
! # A target has been supplied
else:
! char.message('target has been supplied')
! def target(self, char, mode, targettype, target, args, item):
raise Exception, "Spell without target method: " + str(self.__class__.__name__)
***************
*** 247,263 ****
self.resistable = 1 # Most of them are resistable
! def effect(self, char, target):
raise Exception, "CharEffectSpell with unimplemented effect method: " + str(self.__clas__.__name__)
! def target(self, char, mode, targettype, target, args=[]):
! if not self.consumerequirements(char, mode):
return
! if not self.affectchar(char, mode, target):
return
char.turnto(target)
! if self.reflectable and self.checkreflect(char, mode, targettype, target):
target = char
--- 335,351 ----
self.resistable = 1 # Most of them are resistable
! def effect(self, char, target, mode, args, item):
raise Exception, "CharEffectSpell with unimplemented effect method: " + str(self.__clas__.__name__)
! def target(self, char, mode, targettype, target, args, item):
! if not self.consumerequirements(char, mode, args, target, item):
return
! if not self.affectchar(char, mode, target, item):
return
char.turnto(target)
! if self.reflectable and self.checkreflect(char, mode, targettype, target, args, item):
target = char
***************
*** 265,269 ****
self.harmchar(char, target)
! self.effect(char, target)
#
--- 353,357 ----
self.harmchar(char, target)
! self.effect(char, target, mode, args, item)
#
***************
*** 280,284 ****
self.sound = None
! def effect(self, char, target):
# Shoot a missile?
if self.missile:
--- 368,372 ----
self.sound = None
! def effect(self, char, target, mode, args, item):
# Shoot a missile?
if self.missile:
***************
*** 303,307 ****
# Something went out of scope
if not char or not spell:
- wolfpack.console.log(LOG_WARNING, "Either Caster or Spell went out of scope in damage_callback.\n")
return
--- 391,394 ----
Index: necrospells.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/necrospells.py,v
retrieving revision 1.3
retrieving revision 1.4
diff -C2 -d -r1.3 -r1.4
*** necrospells.py 16 Jul 2004 07:09:27 -0000 1.3
--- necrospells.py 22 Jul 2004 17:22:06 -0000 1.4
***************
*** 24,28 ****
self.circle = 4
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 24,28 ----
self.circle = 4
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 39,43 ****
return
! if not self.consumerequirements(char, mode):
return
--- 39,43 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
Index: circle1.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle1.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** circle1.py 20 May 2004 06:32:29 -0000 1.8
--- circle1.py 22 Jul 2004 17:22:06 -0000 1.9
***************
*** 17,21 ****
self.reflectable = 1
! def effect(self, char, target):
statmodifier(char, target, 1, 1)
--- 17,21 ----
self.reflectable = 1
! def effect(self, char, target, mode, args, item):
statmodifier(char, target, 1, 1)
***************
*** 32,36 ****
self.reflectable = 1
! def effect(self, char, target):
statmodifier(char, target, 2, 1)
--- 32,36 ----
self.reflectable = 1
! def effect(self, char, target, mode, args, item):
statmodifier(char, target, 2, 1)
***************
*** 47,51 ****
self.reflectable = 1
! def effect(self, char, target):
statmodifier(char, target, 0, 1)
--- 47,51 ----
self.reflectable = 1
! def effect(self, char, target, mode, args, item):
statmodifier(char, target, 0, 1)
***************
*** 61,65 ****
def cast(self, char, mode, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 61,65 ----
def cast(self, char, mode, args=[]):
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 94,98 ****
return 1
! def effect(self, char, target):
# 10% of Magery + 1-5
#amount = int(0.01 * char.skill[MAGERY]) + random.randint(1, 5)
--- 94,98 ----
return 1
! def effect(self, char, target, mode, args, item):
# 10% of Magery + 1-5
#amount = int(0.01 * char.skill[MAGERY]) + random.randint(1, 5)
***************
*** 127,131 ****
return 1
! def effect(self, char, target):
# Remove an old bonus
if target.hastag('nightsight'):
--- 127,131 ----
return 1
! def effect(self, char, target, mode, args, item):
# Remove an old bonus
if target.hastag('nightsight'):
***************
*** 168,172 ****
def cast(self, char, mode, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 168,172 ----
def cast(self, char, mode, args=[]):
! if not self.consumerequirements(char, mode, args, target, item):
return
Index: circle6.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle6.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** circle6.py 20 May 2004 06:32:29 -0000 1.6
--- circle6.py 22 Jul 2004 17:22:06 -0000 1.7
***************
*** 29,33 ****
return 1
! def effect(self, char, target):
# Show an effect at the position
if self.checkresist(char, target):
--- 29,33 ----
return 1
! def effect(self, char, target, mode, args, item):
# Show an effect at the position
if self.checkresist(char, target):
***************
*** 76,80 ****
self.mantra = 'An Lor Xen'
! def effect(self, char, target):
# Clean previous removal timers
target.dispel(None, 1, "invisibility_reveal")
--- 76,80 ----
self.mantra = 'An Lor Xen'
! def effect(self, char, target, mode, args, item):
# Clean previous removal timers
target.dispel(None, 1, "invisibility_reveal")
***************
*** 107,111 ****
return Spell.cast(self, char, mode)
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 107,111 ----
return Spell.cast(self, char, mode)
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 125,129 ****
return
! if not self.consumerequirements(char, mode):
return
--- 125,129 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 144,149 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 144,149 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 186,193 ****
self.resistable = 1
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
! if not self.consumerequirements(char, mode):
return
--- 186,193 ----
self.resistable = 1
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 242,247 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 242,247 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
! if not self.consumerequirements(char, mode, args, target, item):
return
Index: __init__.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/__init__.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** __init__.py 19 Jul 2004 21:07:35 -0000 1.9
--- __init__.py 22 Jul 2004 17:22:06 -0000 1.10
***************
*** 37,46 ****
#
# Mode: 0 = Book
! def castSpell( char, spell, mode = 0, args = [] ):
if char.dead:
return
socket = char.socket
!
if not spells.has_key(spell):
if socket:
--- 37,48 ----
#
# Mode: 0 = Book
! # Mode: 1 = Scroll
! # MOde: 2 = Wand
! def castSpell( char, spell, mode = 0, args = [], target = None, item = None ):
if char.dead:
return
socket = char.socket
!
if not spells.has_key(spell):
if socket:
***************
*** 49,53 ****
return
! spells[spell].precast(char, mode, args)
# Target Cancel
--- 51,55 ----
return
! spells[spell].precast(char, mode, args, target, item)
# Target Cancel
***************
*** 69,72 ****
--- 71,82 ----
spell = args[0]
mode = args[1]
+ item = args[3]
+ args = args[2]
+ if type(item) == int:
+ item = wolfpack.findobject(item)
+ # Object went out of scope
+ if not item:
+ fizzle(char)
+ return
# Char Targets
***************
*** 93,97 ****
return
! spell.target(char, mode, TARGET_CHAR, target.char)
# Item Target
--- 103,109 ----
return
! message = "Casting spell %u (%s) on character %s (0x%x).\n" % (spell.spellid, spell.__class__.__name__, target.char.name, target.char.serial)
! char.log(LOG_MESSAGE, message)
! spell.target(char, mode, TARGET_CHAR, target.char, args, item)
# Item Target
***************
*** 105,110 ****
char.socket.clilocmessage(500237)
return
!
! spell.target(char, mode, TARGET_ITEM, target.item)
# Ground Target
--- 117,124 ----
char.socket.clilocmessage(500237)
return
!
! message = "Casting spell %u (%s) on item %s (0x%x).\n" % (spell.spellid, spell.__class__.__name__, target.item.getname(), target.item.serial)
! char.log(LOG_MESSAGE, message)
! spell.target(char, mode, TARGET_ITEM, target.item, args, item)
# Ground Target
***************
*** 130,134 ****
return
! spell.target(char, mode, TARGET_GROUND, pos)
else:
--- 144,150 ----
return
! message = "Casting spell %u (%s) on coordinate %s.\n" % (spell.spellid, spell.__class__.__name__, str(pos))
! char.log(LOG_MESSAGE, message)
! spell.target(char, mode, TARGET_GROUND, pos, args, item)
else:
Index: circle3.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle3.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** circle3.py 26 May 2004 13:07:22 -0000 1.6
--- circle3.py 22 Jul 2004 17:22:06 -0000 1.7
***************
*** 15,19 ****
self.mantra = 'Rel Sanct'
! def effect(self, char, target):
statmodifier(char, target, 3, 0)
--- 15,19 ----
self.mantra = 'Rel Sanct'
! def effect(self, char, target, mode, args, item):
statmodifier(char, target, 3, 0)
***************
*** 41,48 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
! if not self.consumerequirements(char, mode):
return
--- 41,48 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 81,85 ****
self.range = 12
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 81,85 ----
self.range = 12
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 96,100 ****
return
! if not self.consumerequirements(char, mode):
return
--- 96,100 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 119,123 ****
self.validtarget = TARGET_ITEM
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 119,123 ----
self.validtarget = TARGET_ITEM
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 132,136 ****
return
! if not self.consumerequirements(char, mode):
return
--- 132,136 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 152,156 ****
self.validtarget = TARGET_ITEM
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 152,156 ----
self.validtarget = TARGET_ITEM
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 164,168 ****
return
! if not self.consumerequirements(char, mode):
return
--- 164,168 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 183,187 ****
self.validtarget = TARGET_ITEM
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 183,187 ----
self.validtarget = TARGET_ITEM
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 205,209 ****
return
! if not self.consumerequirements(char, mode):
return
--- 205,209 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 235,239 ****
self.reflectable = 1
! def effect(self, char, target):
target.disturb()
--- 235,239 ----
self.reflectable = 1
! def effect(self, char, target, mode, args, item):
target.disturb()
Index: circle5.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle5.py,v
retrieving revision 1.10
retrieving revision 1.11
diff -C2 -d -r1.10 -r1.11
*** circle5.py 18 Jul 2004 09:39:52 -0000 1.10
--- circle5.py 22 Jul 2004 17:22:06 -0000 1.11
***************
*** 21,25 ****
return Spell.cast(self, char, mode)
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 21,25 ----
return Spell.cast(self, char, mode)
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 28,32 ****
return
! if not self.consumerequirements(char, mode):
return
--- 28,32 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 45,49 ****
self.validtarget = TARGET_ITEM
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 45,49 ----
self.validtarget = TARGET_ITEM
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 54,58 ****
return
! if not self.consumerequirements(char, mode):
return
--- 54,58 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 106,110 ****
return
! if not self.consumerequirements(char, mode):
return
--- 106,110 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 178,182 ****
def cast(self, char, mode, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 178,182 ----
def cast(self, char, mode, args=[]):
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 229,233 ****
return 1
! def effect(self, char, target):
target.disturb()
target.frozen = 1
--- 229,233 ----
return 1
! def effect(self, char, target, mode, args, item):
target.disturb()
target.frozen = 1
***************
*** 257,264 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
! if not self.consumerequirements(char, mode):
return
--- 257,264 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 328,332 ****
return Spell.cast(self, char, mode)
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 328,332 ----
return Spell.cast(self, char, mode)
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 341,345 ****
return
! if not self.consumerequirements(char, mode):
return
--- 341,345 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
Index: scroll.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/scroll.py,v
retrieving revision 1.4
retrieving revision 1.5
diff -C2 -d -r1.4 -r1.5
*** scroll.py 18 Jul 2004 01:41:48 -0000 1.4
--- scroll.py 22 Jul 2004 17:22:06 -0000 1.5
***************
*** 9,12 ****
--- 9,14 ----
import wolfpack
+ import magic
+ from magic.utilities import MODE_SCROLL
from magic.spellbook import addspell, hasspell
***************
*** 23,36 ****
def onUse( char, item ):
try:
! char.message( 'Casting spell %d' % calcSpellId( item ) )
except:
! char.socket.sysmessage( 'Broken scroll' )
return False
! if item.amount > 1:
! item.amount -= 1
! item.update()
! else:
! item.delete()
return True
--- 25,34 ----
def onUse( char, item ):
try:
! spell = calcSpellId(item)
except:
! char.socket.sysmessage('This scroll seems to be broken.')
return False
! magic.castSpell(char, spell + 1, MODE_SCROLL, [], None, item)
return True
Index: circle8.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle8.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** circle8.py 16 Jul 2004 07:09:27 -0000 1.9
--- circle8.py 22 Jul 2004 17:22:06 -0000 1.10
***************
*** 23,27 ****
def cast(self, char, mode, args):
! if not self.consumerequirements(char, mode):
return
--- 23,27 ----
def cast(self, char, mode, args):
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 67,74 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
! if not self.consumerequirements(char, mode):
return
--- 67,74 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 85,89 ****
self.validtarget = TARGET_CHAR
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 85,89 ----
self.validtarget = TARGET_CHAR
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 96,100 ****
return
! if not self.consumerequirements(char, mode):
return
--- 96,100 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 111,115 ****
self.controlslots = 3
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 111,115 ----
self.controlslots = 3
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 118,122 ****
return
! if not self.consumerequirements(char, mode):
return
--- 118,122 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
Index: circle7.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle7.py,v
retrieving revision 1.8
retrieving revision 1.9
diff -C2 -d -r1.8 -r1.9
*** circle7.py 18 Jul 2004 09:39:52 -0000 1.8
--- circle7.py 22 Jul 2004 17:22:06 -0000 1.9
***************
*** 15,20 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 15,20 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 62,69 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
! if not self.consumerequirements(char, mode):
return
--- 62,69 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 136,140 ****
return Spell.cast(self, char, mode)
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 136,140 ----
return Spell.cast(self, char, mode)
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 144,148 ****
return
! if not self.consumerequirements(char, mode):
return
--- 144,148 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 252,257 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 252,257 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 293,298 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 293,298 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 344,348 ****
self.mantra = 'Vas Ylem Rel'
! def checkrequirements(self, char, mode, args=[]):
if char.polymorph:
if char.socket:
--- 344,348 ----
self.mantra = 'Vas Ylem Rel'
! def checkrequirements(self, char, mode, args=[], target=None, item=None):
if char.polymorph:
if char.socket:
***************
*** 357,361 ****
polymorph.showmenu(char)
return 0
! return Spell.checkrequirements(self, char, mode, args)
def cast(self, char, mode, args):
--- 357,361 ----
polymorph.showmenu(char)
return 0
! return Spell.checkrequirements(self, char, mode, args, target, item)
def cast(self, char, mode, args):
Index: circle4.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle4.py,v
retrieving revision 1.9
retrieving revision 1.10
diff -C2 -d -r1.9 -r1.10
*** circle4.py 18 Jul 2004 09:39:52 -0000 1.9
--- circle4.py 22 Jul 2004 17:22:06 -0000 1.10
***************
*** 15,19 ****
self.reflectable = 1
! def effect(self, char, target):
statmodifier(char, target, 3, 1)
target.effect(0x373a, 10, 15)
--- 15,19 ----
self.reflectable = 1
! def effect(self, char, target, mode, args, item):
statmodifier(char, target, 3, 1)
target.effect(0x373a, 10, 15)
***************
*** 35,39 ****
return 1
! def effect(self, char, target):
# 40% of Magery + 1-10
amount = int(0.04 * char.skill[ MAGERY ]) + random.randint(1, 10)
--- 35,39 ----
return 1
! def effect(self, char, target, mode, args, item):
# 40% of Magery + 1-10
amount = int(0.04 * char.skill[ MAGERY ]) + random.randint(1, 10)
***************
*** 123,127 ****
return Spell.cast(self, char, mode)
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 123,127 ----
return Spell.cast(self, char, mode)
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 131,135 ****
return
! if not self.consumerequirements(char, mode):
return
--- 131,135 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 180,184 ****
self.resistable = 1
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 180,184 ----
self.resistable = 1
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 187,191 ****
return
! if not self.consumerequirements(char, mode):
return
--- 187,191 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 240,245 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 240,245 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 273,278 ****
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 273,278 ----
self.validtarget = TARGET_GROUND
! def target(self, char, mode, targettype, target, args, item):
! if not self.consumerequirements(char, mode, args, target, item):
return
Index: circle2.py
===================================================================
RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/circle2.py,v
retrieving revision 1.6
retrieving revision 1.7
diff -C2 -d -r1.6 -r1.7
*** circle2.py 18 May 2004 02:33:20 -0000 1.6
--- circle2.py 22 Jul 2004 17:22:06 -0000 1.7
***************
*** 14,18 ****
self.mantra = 'Ex Uus'
! def effect(self, char, target):
statmodifier(char, target, 1, 0)
target.effect(0x375a, 10, 15)
--- 14,18 ----
self.mantra = 'Ex Uus'
! def effect(self, char, target, mode, args, item):
statmodifier(char, target, 1, 0)
target.effect(0x375a, 10, 15)
***************
*** 25,29 ****
self.mantra = 'Uus Wis'
! def effect(self, char, target):
statmodifier(char, target, 2, 0)
--- 25,29 ----
self.mantra = 'Uus Wis'
! def effect(self, char, target, mode, args, item):
statmodifier(char, target, 2, 0)
***************
*** 37,41 ****
self.mantra = 'Uus Mani'
! def effect(self, char, target):
statmodifier(char, target, 0, 0)
--- 37,41 ----
self.mantra = 'Uus Mani'
! def effect(self, char, target, mode, args, item):
statmodifier(char, target, 0, 0)
***************
*** 71,75 ****
self.mantra = 'In Jux'
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
--- 71,75 ----
self.mantra = 'In Jux'
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
***************
*** 79,83 ****
return
! if not self.consumerequirements(char, mode):
return
--- 79,83 ----
return
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 102,109 ****
self.mantra = 'An Jux'
! def target(self, char, mode, targettype, target, args=[]):
char.turnto(target)
! if not self.consumerequirements(char, mode):
return
--- 102,109 ----
self.mantra = 'An Jux'
! def target(self, char, mode, targettype, target, args, item):
char.turnto(target)
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 131,135 ****
def cast(self, char, mode, args=[]):
! if not self.consumerequirements(char, mode):
return
--- 131,135 ----
def cast(self, char, mode, args=[]):
! if not self.consumerequirements(char, mode, args, target, item):
return
***************
*** 172,176 ****
self.mantra = 'An Nox'
! def effect(self, char, target):
if target.poison != -1:
chance = (10000 + int(char.skill[MAGERY] * 7.5) - ((target.poison + 1) * 1750)) / 10000.0
--- 172,176 ----
self.mantra = 'An Nox'
! def effect(self, char, target, mode, args, item):
if target.poison != -1:
chance = (10000 + int(char.skill[MAGERY] * 7.5) - ((target.poison + 1) * 1750)) / 10000.0
|