[wpdev-commits] xmlscripts/scripts/magic spell.py,1.25,1.26
Brought to you by:
rip,
thiagocorrea
From: Richard M. <dr...@us...> - 2004-09-23 01:12:11
|
Update of /cvsroot/wpdev/xmlscripts/scripts/magic In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv22027/magic Modified Files: spell.py Log Message: Removed casting animation when on a mount. Index: spell.py =================================================================== RCS file: /cvsroot/wpdev/xmlscripts/scripts/magic/spell.py,v retrieving revision 1.25 retrieving revision 1.26 diff -C2 -d -r1.25 -r1.26 *** spell.py 14 Sep 2004 00:10:52 -0000 1.25 --- spell.py 23 Sep 2004 01:11:49 -0000 1.26 *************** *** 43,51 **** def callback(char, args): char.removescript('magic') ! # target if args[3] and type(args[3]) is int: target = wolfpack.findobject(args[3]) ! # Object went out of scope if not target: --- 43,51 ---- def callback(char, args): char.removescript('magic') ! # target if args[3] and type(args[3]) is int: target = wolfpack.findobject(args[3]) ! # Object went out of scope if not target: *************** *** 54,62 **** else: target = None ! # item if args[4] and (type(args[4]) is int): item = wolfpack.findobject(args[4]) ! # Object went out of scope if not item: --- 54,62 ---- else: target = None ! # item if args[4] and (type(args[4]) is int): item = wolfpack.findobject(args[4]) ! # Object went out of scope if not item: *************** *** 98,102 **** self.casttime = 500 + (250 * self.circle) self.castaction = ANIM_CASTDIRECTED ! # Change this to 0 for AoS behaviour self.castrecovery = 1 * circle --- 98,102 ---- self.casttime = 500 + (250 * self.circle) self.castaction = ANIM_CASTDIRECTED ! # Change this to 0 for AoS behaviour self.castrecovery = 1 * circle *************** *** 105,115 **** # Prepare the casting of this spell. # ! def precast(self, char, mode=0, args=[], target = None, item = None): socket = char.socket ! # Casting from a scroll and no scroll was passed if mode == MODE_SCROLL and not item: return ! # Casting from a wand and no wand was passed if mode == MODE_WAND and not item: --- 105,115 ---- # Prepare the casting of this spell. # ! def precast(self, char, mode=0, args=[], target = None, item = None): socket = char.socket ! # Casting from a scroll and no scroll was passed if mode == MODE_SCROLL and not item: return ! # Casting from a wand and no wand was passed if mode == MODE_WAND and not item: *************** *** 143,157 **** # Precasting char.addscript('magic') ! # Show the cast action ! if char.bodytype == BODY_HUMAN: 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' --- 143,157 ---- # Precasting char.addscript('magic') ! # Show the cast action ! if char.bodytype == BODY_HUMAN and not char.itemonlayer( LAYER_MOUNT ): 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' *************** *** 167,171 **** else: char.log(LOG_MESSAGE, "Casting spell %s from %s.\n" % (self.__class__.__name__, source)) ! char.addtimer(self.calcdelay(char, mode), 'magic.spell.callback', [self, mode, args, target, item], 0, 0, "cast_delay") return 1 --- 167,171 ---- else: char.log(LOG_MESSAGE, "Casting spell %s from %s.\n" % (self.__class__.__name__, source)) ! char.addtimer(self.calcdelay(char, mode), 'magic.spell.callback', [self, mode, args, target, item], 0, 0, "cast_delay") return 1 *************** *** 178,185 **** if mode == MODE_WAND or mode == MODE_CMD: return 0 ! # Get the AOS bonus from all items the character wears castspeed = 3 - properties.fromchar(char, CASTSPEEDBONUS) ! # Under the influence of the protection spell # spells are cast more slowly --- 178,185 ---- if mode == MODE_WAND or mode == MODE_CMD: return 0 ! # Get the AOS bonus from all items the character wears castspeed = 3 - properties.fromchar(char, CASTSPEEDBONUS) ! # Under the influence of the protection spell # spells are cast more slowly *************** *** 195,213 **** #char.message(str(castspeed / 4.0)) return castspeed * 250 ! def checkweapon(self, char): weapon = char.itemonlayer(LAYER_RIGHTHAND) ! if not weapon or not properties.itemcheck(weapon, ITEM_WEAPON): weapon = char.itemonlayer(LAYER_LEFTHAND) ! if not weapon: return True ! # Check if the spellchanneling property is true for this item if not properties.fromitem(weapon, SPELLCHANNELING): if not utilities.tobackpack(weapon, char): weapon.update() ! return True else: --- 195,213 ---- #char.message(str(castspeed / 4.0)) return castspeed * 250 ! def checkweapon(self, char): weapon = char.itemonlayer(LAYER_RIGHTHAND) ! if not weapon or not properties.itemcheck(weapon, ITEM_WEAPON): weapon = char.itemonlayer(LAYER_LEFTHAND) ! if not weapon: return True ! # Check if the spellchanneling property is true for this item if not properties.fromitem(weapon, SPELLCHANNELING): if not utilities.tobackpack(weapon, char): weapon.update() ! return True else: *************** *** 217,221 **** # Set the delay for the next spell # ! def setspelldelay(self, char, mode): if char.npc: pass --- 217,221 ---- # Set the delay for the next spell # ! def setspelldelay(self, char, mode): if char.npc: pass *************** *** 223,228 **** castrecovery = - properties.fromchar(char, CASTRECOVERYBONUS) castrecovery += 6 ! castrecovery += self.castrecovery ! if castrecovery < 0: castrecovery = 0 --- 223,228 ---- castrecovery = - properties.fromchar(char, CASTRECOVERYBONUS) castrecovery += 6 ! castrecovery += self.castrecovery ! if castrecovery < 0: castrecovery = 0 *************** *** 236,240 **** if char.dead: return False ! if char.gm: return True --- 236,240 ---- if char.dead: return False ! if char.gm: return True *************** *** 244,248 **** char.message(502626) return 0 ! # Check for Mana if char.mana < self.mana: --- 244,248 ---- char.message(502626) return 0 ! # Check for Mana if char.mana < self.mana: *************** *** 268,272 **** char.message(501625) return 0 ! # Check for Mana if char.mana < (self.mana + 1) / 2: --- 268,272 ---- char.message(501625) return 0 ! # Check for Mana if char.mana < (self.mana + 1) / 2: *************** *** 284,292 **** if char.gm: return True ! # 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 --- 284,292 ---- if char.gm: return True ! # 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 *************** *** 299,303 **** if len(self.reagents) > 0: consumeReagents(char.getbackpack(), self.reagents.copy()) ! # Reduced Skill, Reduced Mana, No Reagents elif mode == MODE_SCROLL: --- 299,303 ---- if len(self.reagents) > 0: consumeReagents(char.getbackpack(), self.reagents.copy()) ! # Reduced Skill, Reduced Mana, No Reagents elif mode == MODE_SCROLL: *************** *** 305,309 **** char.mana = max(0, char.mana - (self.mana + 1) / 2) char.updatemana() ! # Remove one of the scrolls if item.amount == 1: --- 305,309 ---- char.mana = max(0, char.mana - (self.mana + 1) / 2) char.updatemana() ! # Remove one of the scrolls if item.amount == 1: *************** *** 314,318 **** # No requirements at all ! elif mode == MODE_WAND: pass --- 314,318 ---- # No requirements at all ! elif mode == MODE_WAND: pass *************** *** 330,334 **** fizzle(char) return 0 ! # Set the next spell delay self.setspelldelay(char, mode) --- 330,334 ---- fizzle(char) return 0 ! # Set the next spell delay self.setspelldelay(char, mode) |