v0.3.1: adjusted dwarf monks, no overall balance change, but disarming is now much more consistent, average hits to disarm is unchanged at 6.
This commit is contained in:
parent
72515aee99
commit
5fd3d94ca2
|
@ -33,6 +33,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.MonkSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.MonkSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||||
|
import com.watabou.utils.Bundle;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
public class Monk extends Mob {
|
public class Monk extends Mob {
|
||||||
|
@ -85,15 +86,20 @@ public class Monk extends Mob {
|
||||||
super.die( cause );
|
super.die( cause );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private int hitsToDisarm = 0;
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int attackProc( Char enemy, int damage ) {
|
public int attackProc( Char enemy, int damage ) {
|
||||||
|
|
||||||
if (Random.Int( 6 ) == 0 && enemy == Dungeon.hero) {
|
if (enemy == Dungeon.hero) {
|
||||||
|
|
||||||
Hero hero = Dungeon.hero;
|
Hero hero = Dungeon.hero;
|
||||||
KindOfWeapon weapon = hero.belongings.weapon;
|
KindOfWeapon weapon = hero.belongings.weapon;
|
||||||
|
|
||||||
if (weapon != null && !(weapon instanceof Knuckles) && !weapon.cursed) {
|
if (weapon != null && !(weapon instanceof Knuckles) && !weapon.cursed) {
|
||||||
|
if (hitsToDisarm == 0) hitsToDisarm = Random.NormalIntRange(4, 8);
|
||||||
|
|
||||||
|
if (--hitsToDisarm == 0) {
|
||||||
hero.belongings.weapon = null;
|
hero.belongings.weapon = null;
|
||||||
Dungeon.quickslot.clearItem(weapon);
|
Dungeon.quickslot.clearItem(weapon);
|
||||||
weapon.updateQuickslot();
|
weapon.updateQuickslot();
|
||||||
|
@ -101,6 +107,7 @@ public class Monk extends Mob {
|
||||||
GLog.w(TXT_DISARM, name, weapon.name());
|
GLog.w(TXT_DISARM, name, weapon.name());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
@ -122,4 +129,18 @@ public class Monk extends Mob {
|
||||||
public HashSet<Class<?>> immunities() {
|
public HashSet<Class<?>> immunities() {
|
||||||
return IMMUNITIES;
|
return IMMUNITIES;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private static String DISARMHITS = "hitsToDisarm";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void storeInBundle(Bundle bundle) {
|
||||||
|
super.storeInBundle(bundle);
|
||||||
|
bundle.put(DISARMHITS, hitsToDisarm);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void restoreFromBundle(Bundle bundle) {
|
||||||
|
super.restoreFromBundle(bundle);
|
||||||
|
hitsToDisarm = bundle.getInt(DISARMHITS);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user