예제 #1
0
	@Override
	public int damageRoll( Hero hero ) {
		
		int damage = super.damageRoll( hero );
		
		if (this instanceof MeleeWeapon || (this instanceof MissileWeapon && hero.heroClass == HeroClass.HUNTRESS)) {
			int exStr = hero.STR() - STR;
			if (exStr > 0) {
				damage += Random.IntRange( 0, exStr );
			}
			int lvlbonus = Math.round(hero.level/3);
			if (lvlbonus > 0) {
				damage += Random.IntRange( 0, lvlbonus );
			}
		}
		
		if (this instanceof MissileWeapon && hero.heroClass != HeroClass.HUNTRESS)) {
			int exStr = Math.round((hero.STR() - STR)/3);
			if (exStr > 0) {
				damage += Random.IntRange( 0, exStr );
			}
			int lvlbonus = Math.round(hero.level/5);
			if (lvlbonus > 0) {
				damage += Random.IntRange( 0, lvlbonus );
			}
		}
		
		return Math.round(damage * (imbue == Imbue.LIGHT ? 0.7f : (imbue == Imbue.HEAVY ? 1.5f : 1f)));
	}
예제 #2
0
	@Override
	public float acuracyFactor( Hero hero ) {
		
		int encumbrance = STR - hero.STR();

		float ACU = this.ACU;
		
		if (this instanceof MissileWeapon) {
			switch (hero.heroClass) {
			case WARRIOR:
				encumbrance += 3;
				break;
			case HUNTRESS:
				encumbrance -= 2;
				break;
			default:
			}
			int bonus = 0;
			for (Buff buff : hero.buffs(RingOfSharpshooting.Aim.class)) {
				bonus += ((RingOfSharpshooting.Aim)buff).level;
			}
			ACU *= (float)(Math.pow(1.1, bonus));
		}

		return encumbrance > 0 ? (float)(ACU / Math.pow( 1.5, encumbrance )) : ACU;
	}
예제 #3
0
	@Override
	public float speedFactor( Hero hero ) {

		int encumrance = STR - hero.STR();
		if (this instanceof MissileWeapon && hero.heroClass == HeroClass.HUNTRESS) {
			encumrance -= 2;
		}

		float DLY = this.DLY * (imbue == Imbue.LIGHT ? 0.667f : (imbue == Imbue.HEAVY ? 1.667f : 1.0f));

		int bonus = 0;
		for (Buff buff : hero.buffs(RingOfFuror.Furor.class)) {
			bonus += ((RingOfFuror.Furor)buff).level;
		}

		DLY = (float)(0.25 + (DLY - 0.25)*Math.pow(0.8, bonus));

		return
				(encumrance > 0 ? (float)(DLY * Math.pow( 1.2, encumrance )) : DLY);
	}
 @Override
 public void apply(Hero hero) {
   setKnown();
   hero.earnExp(hero.maxExp());
 }