use of com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat in project shattered-pixel-dungeon-gdx by 00-Evan.
the class GreatCrab method die.
@Override
public void die(Object cause) {
super.die(cause);
Ghost.Quest.process();
Dungeon.level.drop(new MysteryMeat(), pos);
Dungeon.level.drop(new MysteryMeat(), pos).sprite.drop();
}
use of com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Burning method act.
@Override
public boolean act() {
if (target.isAlive()) {
int damage = Random.NormalIntRange(1, 3 + target.HT / 40);
Buff.detach(target, Chill.class);
if (target instanceof Hero) {
Hero hero = (Hero) target;
if (hero.belongings.armor != null && hero.belongings.armor.hasGlyph(Brimstone.class)) {
Buff.affect(target, Brimstone.BrimstoneShield.class);
} else {
hero.damage(damage, this);
burnIncrement++;
// at 4+ turns, there is a (turns-3)/3 chance an item burns
if (Random.Int(3) < (burnIncrement - 3)) {
burnIncrement = 0;
ArrayList<Item> burnable = new ArrayList<>();
// does not reach inside of containers
for (Item i : hero.belongings.backpack.items) {
if ((i instanceof Scroll && !(i instanceof ScrollOfUpgrade || i instanceof ScrollOfMagicalInfusion)) || i instanceof MysteryMeat) {
burnable.add(i);
}
}
if (!burnable.isEmpty()) {
Item toBurn = Random.element(burnable).detach(hero.belongings.backpack);
if (toBurn instanceof MysteryMeat) {
ChargrilledMeat steak = new ChargrilledMeat();
if (!steak.collect(hero.belongings.backpack)) {
Dungeon.level.drop(steak, hero.pos).sprite.drop();
}
}
Heap.burnFX(hero.pos);
GLog.w(Messages.get(this, "burnsup", Messages.capitalize(toBurn.toString())));
}
}
}
} else {
target.damage(damage, this);
}
if (target instanceof Thief) {
Item item = ((Thief) target).item;
if (item instanceof Scroll && !(item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion)) {
target.sprite.emitter().burst(ElmoParticle.FACTORY, 6);
((Thief) target).item = null;
} else if (item instanceof MysteryMeat) {
target.sprite.emitter().burst(ElmoParticle.FACTORY, 6);
((Thief) target).item = new ChargrilledMeat();
}
}
} else {
Brimstone.BrimstoneShield brimShield = target.buff(Brimstone.BrimstoneShield.class);
if (brimShield != null)
brimShield.startDecay();
detach();
}
if (Dungeon.level.flamable[target.pos] && Blob.volumeAt(target.pos, Fire.class) == 0) {
GameScene.add(Blob.seed(target.pos, 4, Fire.class));
}
spend(TICK);
left -= TICK;
if (left <= 0 || (Dungeon.level.water[target.pos] && !target.flying)) {
detach();
}
return true;
}
use of com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Frost method attachTo.
@Override
public boolean attachTo(Char target) {
if (super.attachTo(target)) {
target.paralysed++;
Buff.detach(target, Burning.class);
Buff.detach(target, Chill.class);
if (target instanceof Hero) {
Hero hero = (Hero) target;
ArrayList<Item> freezable = new ArrayList<>();
// does not reach inside of containers
for (Item i : hero.belongings.backpack.items) {
if ((i instanceof Potion && !(i instanceof PotionOfStrength || i instanceof PotionOfMight)) || i instanceof MysteryMeat) {
freezable.add(i);
}
}
if (!freezable.isEmpty()) {
Item toFreeze = Random.element(freezable).detach(hero.belongings.backpack);
if (toFreeze instanceof Potion) {
((Potion) toFreeze).shatter(hero.pos);
} else if (toFreeze instanceof MysteryMeat) {
FrozenCarpaccio carpaccio = new FrozenCarpaccio();
if (!carpaccio.collect(hero.belongings.backpack)) {
Dungeon.level.drop(carpaccio, target.pos).sprite.drop();
}
}
GLog.w(Messages.get(this, "freezes", toFreeze.toString()));
}
} else if (target instanceof Thief) {
Item item = ((Thief) target).item;
if (item instanceof Potion && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) {
((Potion) ((Thief) target).item).shatter(target.pos);
((Thief) target).item = null;
} else if (item instanceof MysteryMeat) {
((Thief) target).item = new FrozenCarpaccio();
;
}
}
return true;
} else {
return false;
}
}
use of com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Heap method freeze.
public void freeze() {
if (type == Type.MIMIC) {
Mimic m = Mimic.spawnAt(pos, items);
if (m != null) {
Buff.prolong(m, Frost.class, Frost.duration(m) * Random.Float(1.0f, 1.5f));
destroy();
}
}
if (type != Type.HEAP) {
return;
}
boolean frozen = false;
for (Item item : items.toArray(new Item[0])) {
if (item instanceof MysteryMeat) {
replace(item, FrozenCarpaccio.cook((MysteryMeat) item));
frozen = true;
} else if (item instanceof Potion && !(item instanceof PotionOfStrength || item instanceof PotionOfMight)) {
items.remove(item);
((Potion) item).shatter(pos);
frozen = true;
} else if (item instanceof Bomb) {
((Bomb) item).fuse = null;
frozen = true;
}
}
if (frozen) {
if (isEmpty()) {
destroy();
} else if (sprite != null) {
sprite.view(items.peek());
}
}
}
use of com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat in project shattered-pixel-dungeon-gdx by 00-Evan.
the class Heap method burn.
public void burn() {
if (type == Type.MIMIC) {
Mimic m = Mimic.spawnAt(pos, items);
if (m != null) {
Buff.affect(m, Burning.class).reignite(m);
m.sprite.emitter().burst(FlameParticle.FACTORY, 5);
destroy();
}
}
if (type != Type.HEAP) {
return;
}
boolean burnt = false;
boolean evaporated = false;
for (Item item : items.toArray(new Item[0])) {
if (item instanceof Scroll && !(item instanceof ScrollOfUpgrade || item instanceof ScrollOfMagicalInfusion)) {
items.remove(item);
burnt = true;
} else if (item instanceof Dewdrop) {
items.remove(item);
evaporated = true;
} else if (item instanceof MysteryMeat) {
replace(item, ChargrilledMeat.cook((MysteryMeat) item));
burnt = true;
} else if (item instanceof Bomb) {
items.remove(item);
((Bomb) item).explode(pos);
// stop processing the burning, it will be replaced by the explosion.
return;
}
}
if (burnt || evaporated) {
if (Dungeon.level.heroFOV[pos]) {
if (burnt) {
burnFX(pos);
} else {
evaporateFX(pos);
}
}
if (isEmpty()) {
destroy();
} else if (sprite != null) {
sprite.view(items.peek());
}
}
}
Aggregations