use of com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Monk method attackProc.
@Override
public int attackProc(Char enemy, int damage) {
damage = super.attackProc(enemy, damage);
if (enemy == Dungeon.hero) {
Hero hero = Dungeon.hero;
KindOfWeapon weapon = hero.belongings.weapon;
if (weapon != null && !(weapon instanceof Knuckles) && !(weapon instanceof Gauntlet) && !weapon.cursed) {
if (hitsToDisarm == 0)
hitsToDisarm = Random.NormalIntRange(4, 8);
if (--hitsToDisarm == 0) {
hero.belongings.weapon = null;
Dungeon.quickslot.convertToPlaceholder(weapon);
weapon.updateQuickslot();
Dungeon.level.drop(weapon, hero.pos).sprite.drop();
GLog.w(Messages.get(this, "disarm", weapon.name()));
}
}
}
return damage;
}
use of com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles in project shattered-pixel-dungeon-gdx by 00-Evan.
the class DisarmingTrap method activate.
@Override
public void activate() {
Heap heap = Dungeon.level.heaps.get(pos);
if (heap != null) {
int cell = Dungeon.level.randomRespawnCell();
if (cell != -1) {
Item item = heap.pickUp();
Dungeon.level.drop(item, cell).seen = true;
for (int i : PathFinder.NEIGHBOURS9) Dungeon.level.visited[cell + i] = true;
GameScene.updateFog();
Sample.INSTANCE.play(Assets.SND_TELEPORT);
CellEmitter.get(pos).burst(Speck.factory(Speck.LIGHT), 4);
}
}
if (Dungeon.hero.pos == pos) {
Hero hero = Dungeon.hero;
KindOfWeapon weapon = hero.belongings.weapon;
if (weapon != null && !(weapon instanceof Knuckles) && !weapon.cursed) {
int cell = Dungeon.level.randomRespawnCell();
if (cell != -1) {
hero.belongings.weapon = null;
Dungeon.quickslot.clearItem(weapon);
weapon.updateQuickslot();
Dungeon.level.drop(weapon, cell).seen = true;
for (int i : PathFinder.NEIGHBOURS9) Dungeon.level.visited[cell + i] = true;
GameScene.updateFog();
GLog.w(Messages.get(this, "disarm"));
Sample.INSTANCE.play(Assets.SND_TELEPORT);
CellEmitter.get(pos).burst(Speck.factory(Speck.LIGHT), 4);
}
}
}
}
Aggregations