示例#1
0
def checkSlaying(weapon, defender):
	slayer = properties.fromitem(weapon, SLAYER)
	if slayer == '':
		return False
				
	slayer = system.slayer.findEntry(slayer)
	
	if not slayer:
		return False
		
	return slayer.slays(defender)
示例#2
0
def checkSlaying(weapon, defender):
    slayer = properties.fromitem(weapon, SLAYER)
    if slayer == '':
        return False

    slayer = system.slayer.findEntry(slayer)

    if not slayer:
        return False

    return slayer.slays(defender)
示例#3
0
def GetDifficultyFor(player, instrument, target):
    # Difficulty TODO: Add another 100 points for each of the following abilities:
    #	- Radiation or Aura Damage (Heat, Cold etc.)
    #	- Summoning Undead
    #
    totalskills = 0
    val = target.hitpoints + target.stamina + target.mana
    skills = target.skill
    for i in range(0, ALLSKILLS):
        totalskills += skills[i] / 100.0

    if val > 700:
        val = 700 + ((val - 700) / 3.66667)

    # Target is Magery Creature
    if target.ai == "Monster_Mage" and target.skill[MAGERY] > 50:
        val += 100

    #if IsFireBreathingCreature( bc ):
    #	val += 100

    if IsPoisonImmune(target):
        val += 100

    if target.id == 317:
        val += 100

    val += (target.getintproperty('hit_poison_level', 0) + 1) * 20

    val /= 10

    #if ( bc != null && bc.IsParagon )
    #	val += 40.0;

    if instrument.hastag('exceptional'):
        val -= 5.0  # 10%

    slayer = properties.fromitem(instrument, SLAYER)
    if slayer != '':
        slayers = slayer.split(',')
        for slayer in slayers:
            slayer = system.slayer.findEntry(slayer)
            if slayer:
                if slayer.slays(target):
                    val -= 10.0  # 20%
                elif slayer.group.opposition.super.slays(
                        target):  # not sure if this is correct
                    val += 10.0  # -20%
    return val
def GetDifficultyFor( player, instrument, target ):
	# Difficulty TODO: Add another 100 points for each of the following abilities:
	#	- Radiation or Aura Damage (Heat, Cold etc.)
	#	- Summoning Undead
	#
	totalskills = 0
	val = target.hitpoints + target.stamina + target.mana
	skills = target.skill
	for i in range(0, ALLSKILLS):
		totalskills += skills[i] / 100.0

	if val > 700:
		val = 700 + ((val - 700) / 3.66667)

	# Target is Magery Creature
	if target.ai == "Monster_Mage" and target.skill[MAGERY] > 50:
		val += 100

	#if IsFireBreathingCreature( bc ):
	#	val += 100

	if IsPoisonImmune( target ):
		val += 100

	if target.id == 317:
		val += 100

	val += (target.getintproperty('hit_poison_level', 0) + 1) * 20

	val /= 10

	#if ( bc != null && bc.IsParagon )
	#	val += 40.0;

	if instrument.hastag('exceptional'):
		val -= 5.0 # 10%

	slayer = properties.fromitem(instrument, SLAYER)
	if slayer != '':
		slayers = slayer.split(',')
		for slayer in slayers:
			slayer = system.slayer.findEntry(slayer)
			if slayer:
				if slayer.slays(target):
					val -= 10.0 # 20%
				elif slayer.group.opposition.super.slays(target): # not sure if this is correct
					val += 10.0 # -20%
	return val