~thindil/anaria/server

« back to all changes in this revision

Viewing changes to lib/pymodules/fight.py

  • Committer: thindil
  • Date: 2010-05-27 12:07:37 UTC
  • Revision ID: thindil2@gmail.com-20100527120737-jyinsv8waie696h0
naprawiono oblicznie opóźnienia broni

Show diffs side-by-side

added added

removed removed

Lines of Context:
232
232
        chAttSkillName = chWeapon.get_type_data("weapon").skill
233
233
        chDamage += (chDamage * float(chWeapon.get_type_data("weapon").damage / 100))
234
234
        chDamageType = chWeapon.get_type_data("weapon").subtype
235
 
        chPreparation = chWeapon.get_type_data("weapon").preparation
 
235
        chPreparation = chWeapon.get_type_data("weapon").prepare
236
236
    if chAttSkillName in ch.aux('skills').names:
237
237
        hasAttSkill = ch.aux('skills').names.index(chAttSkillName)
238
238
        chHitChance += ch.aux('skills').levels[hasAttSkill]
263
263
                    continue
264
264
                chArmor[bpart] = obj.get_type_data('armor').resistance
265
265
                chArmorHit[bpart] = False
266
 
    return [ch, chDamage, chDamageType, chPreparation, chHitChance, chEvadeChance, chDefSkillName, chArmor, chBody, hasAttSkill, hasDefSkill, False, False, chAttSkillName, chPreparation, chArmorHit]
 
266
    return [ch, chDamage, chDamageType, chPreparation, chHitChance, chEvadeChance, chDefSkillName, chArmor, chBody, hasAttSkill, hasDefSkill, False, False, chAttSkillName, 1, chArmorHit]
267
267
        
268
268
def do_fight(ch, vict):
269
269
    '''Function start fight with mobs.'''
323
323
        return
324
324
 
325
325
    if vict.hasvar('enemy'):
326
 
        ch.send(vict.name + " już z kimś walczy.")
 
326
        if ch.is_pc:
 
327
            ch.send(vict.name + " już z kimś walczy.")
327
328
        return
328
329
 
329
330
    if vict.hasPrefs('immortal'):
330
 
        ch.send("Nie możesz zaatakować tej postaci.")
 
331
        if ch.is_pc:
 
332
            ch.send("Nie możesz zaatakować tej postaci.")
331
333
        return
332
334
 
333
335
    ch.setvar("enemy", vict.name)
334
336
    vict.setvar('enemy', ch.name)
335
 
    ch.send("Atakujesz %s." % (vict.name))
 
337
    if ch.is_pc:
 
338
        ch.send("Atakujesz %s." % (vict.name))
336
339
    do_fight(ch, vict)
337
340
 
338
341
def cmd_challenge(ch, cmd, arg):