v0.2.3: initial implementation of dried rose

This commit is contained in:
Evan Debenham
2014-12-09 01:49:10 -05:00
parent a42ccd3b6c
commit 17facf7cde
3 changed files with 235 additions and 23 deletions
@@ -44,6 +44,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Stylus;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.AlchemistsToolkit;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Food;
@@ -212,6 +213,19 @@ public abstract class Level implements Bundlable {
else
addItemToSpawn( new PotionOfMight() );
}
DriedRose rose = Dungeon.hero.belongings.getItem( DriedRose.class );
if (rose != null){
//this way if a rose is dropped later in the game, player still has a chance to max it out.
int petalsNeeded = (int) Math.ceil((float)((Dungeon.depth / 2) - rose.droppedPetals) / 3);
for (int i=1; i <= petalsNeeded; i++) {
if (rose.droppedPetals < 10) {
addItemToSpawn(new DriedRose.Petal());
rose.droppedPetals++;
}
}
}
if (Dungeon.depth > 1) {
switch (Random.Int( 10 )) {