v2.4.0: implemented exotic crystals and mossy clump
This commit is contained in:
@@ -1291,17 +1291,20 @@ items.stones.stoneofshock.desc=This runestone unleashes a blast of electrical en
|
||||
|
||||
|
||||
###trinkets
|
||||
items.trinkets.exoticcrystal.name=exotic crystal
|
||||
items.trinkets.exoticcrystal.desc=...\n\nAt its current level it will replace %d%% of potion or scroll drops with their exotic equivalents. This trinket does not affect potions of strength or scrolls of upgrade.
|
||||
items.trinkets.exoticcrystals.name=exotic crystals
|
||||
items.trinkets.exoticcrystals.desc=These small pink crystals have the same shape as crystals of alchemical energy. While they can't be used for energy directly, they seem to be somehow influencing the potions and scrolls you find.\n\nAt its current level this trinket will replace %d%% of potion or scroll drops with their exotic equivalents. This does not affect potions of strength, scrolls of upgrade, or items that are generated to help solve hazard rooms.
|
||||
|
||||
items.trinkets.mossyclump.name=mossy clump
|
||||
items.trinkets.mossyclump.desc=This clump of wet moss seems to hold onto its moisture no matter how hard you squeeze it. It seems to be magically tied to the dungeon itself, making grass and water more likely to appear.\n\nAt its current level this trinket will make %d%% of regular floors become filled with either water or grass instead.
|
||||
|
||||
items.trinkets.parchmentscrap.name=parchment scrap
|
||||
items.trinkets.parchmentscrap.desc=This little scrap of parchment looks like it came from a scroll. It has regained some of its magic, and it seems to be influencing weapons and armor found in the dungeon.\n\nAt its current level it will make enchantments/glyphs _%dx_ as common, and curses on weapons and armor _%sx_ as common. Curses on wands, rings, or artifacts are not affected.
|
||||
items.trinkets.parchmentscrap.desc=This little scrap of parchment looks like it came from a scroll. It has retained some of its magic, and it seems to be influencing weapons and armor found in the dungeon.\n\nAt its current level this trinket will make enchantments and glyphs _%dx_ as common, and curses on weapons and armor _%sx_ as common. Curses on wands, rings, or artifacts are not affected.
|
||||
|
||||
items.trinkets.petrifiedseed.name=petrified seed
|
||||
items.trinkets.petrifiedseed.desc=This seed has been fossilised, either by slow geological processes or by magic. The seed seems to be magically influencing the flora of the dungeon, occasionally replacing plant seeds with runestones.\n\nAt its current level it will cause trampled grass to drop runestones instead of seeds _%1$d%%_ of the time, and will also cause high grass to drop items _%2$d%%_ more often.
|
||||
items.trinkets.petrifiedseed.desc=This seed has been fossilised, either by slow geological processes or by magic. The seed seems to be magically influencing the flora of the dungeon, occasionally replacing plant seeds with runestones.\n\nAt its current level this trinket will cause trampled grass to drop runestones instead of seeds _%1$d%%_ of the time, and will also cause high grass to drop items _%2$d%%_ more often.
|
||||
|
||||
items.trinkets.ratskull.name=rat skull
|
||||
items.trinkets.ratskull.desc=This macabre trinket isn't much larger than the skull of a normal rat, which is somehow a rarity down in this dungeon. The skull's magical influence seems to attract the more rare denizens of the dungeon, making them appear far more often.\n\nAt its current level it will make rare exotic enemies _%dx_ as likely to appear. The skull is only half as effective at attracting crystal mimics and armored statues, however.
|
||||
items.trinkets.ratskull.desc=This macabre trinket isn't much larger than the skull of a normal rat, which is somehow a rarity down in this dungeon. The skull's magical influence seems to attract the more rare denizens of the dungeon, making them appear far more often.\n\nAt its current level this trinket will make rare exotic enemies _%dx_ as likely to appear. The skull is only half as effective at attracting crystal mimics and armored statues, however.
|
||||
|
||||
items.trinkets.trinketcatalyst.name=trinket catalyst
|
||||
items.trinkets.trinketcatalyst.window_text=The water begins to glow as you use the catalyst. There are a few nearby items you could imbue with magical energy.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 22 KiB After Width: | Height: | Size: 22 KiB |
@@ -61,9 +61,12 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.MasterThievesArmband;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfWealth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfAggression;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ExoticCrystals;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Lucky;
|
||||
@@ -922,6 +925,16 @@ public abstract class Mob extends Char {
|
||||
|
||||
} else if (loot instanceof Class<?>) {
|
||||
|
||||
if (ExoticPotion.regToExo.containsKey(loot)){
|
||||
if (Random.Float() < ExoticCrystals.consumableExoticChance()){
|
||||
return Generator.random(ExoticPotion.regToExo.get(loot));
|
||||
}
|
||||
} else if (ExoticScroll.regToExo.containsKey(loot)){
|
||||
if (Random.Float() < ExoticCrystals.consumableExoticChance()){
|
||||
return Generator.random(ExoticScroll.regToExo.get(loot));
|
||||
}
|
||||
}
|
||||
|
||||
item = Generator.random( (Class<? extends Item>)loot );
|
||||
|
||||
} else {
|
||||
|
||||
@@ -61,6 +61,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticG
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfPurity;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
||||
@@ -87,6 +88,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportat
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTerror;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfAggression;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfAugmentation;
|
||||
@@ -100,6 +102,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfFear;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfFlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfIntuition;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfShock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ExoticCrystals;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MossyClump;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ParchmentScrap;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.PetrifiedSeed;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.RatSkull;
|
||||
@@ -520,9 +524,11 @@ public class Generator {
|
||||
TRINKET.classes = new Class<?>[]{
|
||||
RatSkull.class,
|
||||
ParchmentScrap.class,
|
||||
PetrifiedSeed.class
|
||||
PetrifiedSeed.class,
|
||||
ExoticCrystals.class,
|
||||
MossyClump.class
|
||||
};
|
||||
TRINKET.defaultProbs = new float[]{ 1, 1, 1 };
|
||||
TRINKET.defaultProbs = new float[]{ 1, 1, 1, 1, 1 };
|
||||
TRINKET.probs = TRINKET.defaultProbs.clone();
|
||||
|
||||
for (Category cat : Category.values()){
|
||||
@@ -582,11 +588,15 @@ public class Generator {
|
||||
//reverts changes to drop chances generates by this item
|
||||
//equivalent of shuffling the card back into the deck, does not preserve order!
|
||||
public static void undoDrop(Item item){
|
||||
undoDrop(item.getClass());
|
||||
}
|
||||
|
||||
public static void undoDrop(Class cls){
|
||||
for (Category cat : Category.values()){
|
||||
if (item.getClass().isAssignableFrom(cat.superClass)){
|
||||
if (cls.isAssignableFrom(cat.superClass)){
|
||||
if (cat.defaultProbs == null) continue;
|
||||
for (int i = 0; i < cat.classes.length; i++){
|
||||
if (item.getClass() == cat.classes[i]){
|
||||
if (cls == cat.classes[i]){
|
||||
cat.probs[i]++;
|
||||
}
|
||||
}
|
||||
@@ -641,13 +651,24 @@ public class Generator {
|
||||
i = Random.chances(cat.probs);
|
||||
}
|
||||
if (cat.defaultProbs != null) cat.probs[i]--;
|
||||
Class<?> itemCls = cat.classes[i];
|
||||
|
||||
if (cat.defaultProbs != null && cat.seed != null){
|
||||
Random.popGenerator();
|
||||
cat.dropped++;
|
||||
}
|
||||
|
||||
return ((Item) Reflection.newInstance(cat.classes[i])).random();
|
||||
if (ExoticPotion.regToExo.containsKey(itemCls)){
|
||||
if (Random.Float() < ExoticCrystals.consumableExoticChance()){
|
||||
itemCls = ExoticPotion.regToExo.get(itemCls);
|
||||
}
|
||||
} else if (ExoticScroll.regToExo.containsKey(itemCls)){
|
||||
if (Random.Float() < ExoticCrystals.consumableExoticChance()){
|
||||
itemCls = ExoticScroll.regToExo.get(itemCls);
|
||||
}
|
||||
}
|
||||
|
||||
return ((Item) Reflection.newInstance(itemCls)).random();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -34,10 +34,13 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfExperience;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.brews.UnstableBrew;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfDivineInspiration;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfMetamorphosis;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.spells.UnstableSpell;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfEnchantment;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ExoticCrystals;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
@@ -230,10 +233,18 @@ public class RingOfWealth extends Ring {
|
||||
return i.quantity(i.quantity()*2);
|
||||
case 1:
|
||||
i = Generator.randomUsingDefaults(Generator.Category.POTION);
|
||||
return Reflection.newInstance(ExoticPotion.regToExo.get(i.getClass()));
|
||||
if (!(i instanceof ExoticPotion)) {
|
||||
return Reflection.newInstance(ExoticPotion.regToExo.get(i.getClass()));
|
||||
} else {
|
||||
return Reflection.newInstance(i.getClass());
|
||||
}
|
||||
case 2:
|
||||
i = Generator.randomUsingDefaults(Generator.Category.SCROLL);
|
||||
return Reflection.newInstance(ExoticScroll.regToExo.get(i.getClass()));
|
||||
if (!(i instanceof ExoticScroll)){
|
||||
return Reflection.newInstance(ExoticScroll.regToExo.get(i.getClass()));
|
||||
} else {
|
||||
return Reflection.newInstance(i.getClass());
|
||||
}
|
||||
case 3:
|
||||
return Random.Int(2) == 0 ? new UnstableBrew() : new UnstableSpell();
|
||||
case 4:
|
||||
@@ -255,9 +266,9 @@ public class RingOfWealth extends Ring {
|
||||
case 1:
|
||||
return new StoneOfEnchantment();
|
||||
case 2:
|
||||
return new PotionOfExperience();
|
||||
return Random.Float() < ExoticCrystals.consumableExoticChance() ? new PotionOfDivineInspiration() : new PotionOfExperience();
|
||||
case 3:
|
||||
return new ScrollOfTransmutation();
|
||||
return Random.Float() < ExoticCrystals.consumableExoticChance() ? new ScrollOfMetamorphosis() : new ScrollOfTransmutation();
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -0,0 +1,55 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2024 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.trinkets;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
public class ExoticCrystals extends Trinket {
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.EXOTIC_CRYSTALS;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int upgradeEnergyCost() {
|
||||
return 1 + level(); //TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return Messages.get(this, "desc", (int)(100*consumableExoticChance(buffedLvl())));
|
||||
}
|
||||
|
||||
public static float consumableExoticChance(){
|
||||
return consumableExoticChance(trinketLevel(ExoticCrystals.class));
|
||||
}
|
||||
|
||||
public static float consumableExoticChance( int level ){
|
||||
if (level == -1){
|
||||
return 0f;
|
||||
} else {
|
||||
return 0.1f + 0.1f*level;
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,116 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2024 Evan Debenham
|
||||
*
|
||||
* This program is free software: you can redistribute it and/or modify
|
||||
* it under the terms of the GNU General Public License as published by
|
||||
* the Free Software Foundation, either version 3 of the License, or
|
||||
* (at your option) any later version.
|
||||
*
|
||||
* This program is distributed in the hope that it will be useful,
|
||||
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
||||
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
||||
* GNU General Public License for more details.
|
||||
*
|
||||
* You should have received a copy of the GNU General Public License
|
||||
* along with this program. If not, see <http://www.gnu.org/licenses/>
|
||||
*/
|
||||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.trinkets;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.ArrayList;
|
||||
|
||||
public class MossyClump extends Trinket {
|
||||
|
||||
{
|
||||
image = ItemSpriteSheet.MOSSY_CLUMP;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int upgradeEnergyCost() {
|
||||
return 1 + level(); //TODO
|
||||
}
|
||||
|
||||
@Override
|
||||
public String desc() {
|
||||
return Messages.get(this, "desc", (int)(100*overrideNormalLevelChance(buffedLvl())));
|
||||
}
|
||||
|
||||
public static float overrideNormalLevelChance(){
|
||||
return overrideNormalLevelChance(trinketLevel(MossyClump.class));
|
||||
}
|
||||
|
||||
public static float overrideNormalLevelChance( int level ){
|
||||
if (level == -1){
|
||||
return 0f;
|
||||
} else {
|
||||
return 0.25f + 0.25f*level;
|
||||
}
|
||||
}
|
||||
|
||||
//true for grass, false for water
|
||||
//ensures a little consistency of RNG
|
||||
private ArrayList<Boolean> levelFeels = new ArrayList<>();
|
||||
private int shuffles = 0;
|
||||
|
||||
public static Level.Feeling getNextFeeling(){
|
||||
MossyClump clump = Dungeon.hero.belongings.getItem(MossyClump.class);
|
||||
if (clump == null) {
|
||||
return Level.Feeling.NONE;
|
||||
}
|
||||
if (clump.levelFeels.isEmpty()){
|
||||
Random.pushGenerator(Dungeon.seed+1);
|
||||
clump.levelFeels.add(true);
|
||||
clump.levelFeels.add(true);
|
||||
clump.levelFeels.add(true);
|
||||
clump.levelFeels.add(false);
|
||||
clump.levelFeels.add(false);
|
||||
clump.levelFeels.add(false);
|
||||
for (int i = 0; i <= clump.shuffles; i++) {
|
||||
Random.shuffle(clump.levelFeels);
|
||||
}
|
||||
clump.shuffles++;
|
||||
Random.popGenerator();
|
||||
}
|
||||
|
||||
return clump.levelFeels.remove(0) ? Level.Feeling.GRASS : Level.Feeling.WATER;
|
||||
}
|
||||
|
||||
private static final String FEELS = "feels";
|
||||
private static final String SHUFFLES = "shuffles";
|
||||
|
||||
@Override
|
||||
public void storeInBundle(Bundle bundle) {
|
||||
super.storeInBundle(bundle);
|
||||
if (!levelFeels.isEmpty()){
|
||||
boolean[] storeFeels = new boolean[levelFeels.size()];
|
||||
for (int i = 0; i < storeFeels.length; i++){
|
||||
storeFeels[i] = levelFeels.get(i);
|
||||
}
|
||||
bundle.put(FEELS, storeFeels);
|
||||
}
|
||||
bundle.put( SHUFFLES, shuffles );
|
||||
}
|
||||
|
||||
@Override
|
||||
public void restoreFromBundle(Bundle bundle) {
|
||||
super.restoreFromBundle(bundle);
|
||||
levelFeels.clear();
|
||||
if (bundle.contains(FEELS)){
|
||||
for (boolean b : bundle.getBooleanArray(FEELS)){
|
||||
levelFeels.add(b);
|
||||
}
|
||||
}
|
||||
shuffles = bundle.getInt( SHUFFLES );
|
||||
}
|
||||
}
|
||||
@@ -67,6 +67,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfEnchantment;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfIntuition;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.MossyClump;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.TrinketCatalyst;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfRegrowth;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfWarding;
|
||||
@@ -259,6 +260,12 @@ public abstract class Level implements Bundlable {
|
||||
case 6:
|
||||
feeling = Feeling.SECRETS;
|
||||
break;
|
||||
default:
|
||||
if (Random.Float() < MossyClump.overrideNormalLevelChance()){
|
||||
feeling = MossyClump.getNextFeeling();
|
||||
} else {
|
||||
feeling = Feeling.NONE;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -131,20 +131,26 @@ public abstract class RegularPainter extends Painter {
|
||||
}
|
||||
|
||||
paintDoors( level, rooms );
|
||||
|
||||
//use a separate RNG here so that extra painting variance doesn't affect the rest of levelgen
|
||||
//e.g. this minimizes mossy clump's effect on levelgen
|
||||
Random.pushGenerator(Random.Long());
|
||||
|
||||
if (waterFill > 0f) {
|
||||
paintWater( level, rooms );
|
||||
}
|
||||
|
||||
if (grassFill > 0f){
|
||||
paintGrass( level, rooms );
|
||||
}
|
||||
|
||||
if (nTraps > 0){
|
||||
paintTraps( level, rooms );
|
||||
}
|
||||
|
||||
if (waterFill > 0f) {
|
||||
paintWater( level, rooms );
|
||||
}
|
||||
|
||||
if (grassFill > 0f){
|
||||
paintGrass( level, rooms );
|
||||
}
|
||||
|
||||
if (nTraps > 0){
|
||||
paintTraps( level, rooms );
|
||||
}
|
||||
|
||||
decorate( level, rooms );
|
||||
decorate( level, rooms );
|
||||
|
||||
Random.popGenerator();
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
@@ -36,6 +36,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfMindVision
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfParalyticGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfPurity;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ExoticCrystals;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
@@ -94,6 +96,13 @@ public class SecretLaboratoryRoom extends SecretRoom {
|
||||
|
||||
Class<?extends Potion> potionCls = Random.chances(chances);
|
||||
chances.put(potionCls, 0f);
|
||||
|
||||
if (ExoticPotion.regToExo.containsKey(potionCls)){
|
||||
if (Random.Float() < ExoticCrystals.consumableExoticChance()){
|
||||
potionCls = ExoticPotion.regToExo.get(potionCls);
|
||||
}
|
||||
}
|
||||
|
||||
level.drop( Reflection.newInstance(potionCls), pos );
|
||||
}
|
||||
|
||||
|
||||
@@ -33,6 +33,8 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetributio
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTerror;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ExoticCrystals;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
@@ -93,6 +95,13 @@ public class SecretLibraryRoom extends SecretRoom {
|
||||
|
||||
Class<?extends Scroll> scrollCls = Random.chances(chances);
|
||||
chances.put(scrollCls, 0f);
|
||||
|
||||
if (ExoticScroll.regToExo.containsKey(scrollCls)){
|
||||
if (Random.Float() < ExoticCrystals.consumableExoticChance()){
|
||||
scrollCls = ExoticScroll.regToExo.get(scrollCls);
|
||||
}
|
||||
}
|
||||
|
||||
level.drop( Reflection.newInstance(scrollCls), pos );
|
||||
}
|
||||
}
|
||||
|
||||
@@ -26,7 +26,12 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.keys.CrystalKey;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfExperience;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfDivineInspiration;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTransmutation;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfMetamorphosis;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.trinkets.ExoticCrystals;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;
|
||||
@@ -165,9 +170,11 @@ public class CrystalPathRoom extends SpecialRoom {
|
||||
|
||||
if (Random.Int(2) == 0){
|
||||
addRewardItem(Generator.Category.POTION, potions, duplicates);
|
||||
scrolls.add(new ScrollOfTransmutation());
|
||||
scrolls.add(Random.Float() < ExoticCrystals.consumableExoticChance()
|
||||
? new ScrollOfMetamorphosis() : new ScrollOfTransmutation());
|
||||
} else {
|
||||
potions.add(new PotionOfExperience());
|
||||
potions.add(Random.Float() < ExoticCrystals.consumableExoticChance()
|
||||
? new PotionOfDivineInspiration() : new PotionOfExperience());
|
||||
addRewardItem(Generator.Category.SCROLL, scrolls, duplicates);
|
||||
}
|
||||
addRewardItem(Generator.Category.POTION, potions, duplicates);
|
||||
@@ -177,7 +184,13 @@ public class CrystalPathRoom extends SpecialRoom {
|
||||
|
||||
//need to undo the changes to spawn chances that the duplicates created
|
||||
for (Item i : duplicates){
|
||||
Generator.undoDrop(i);
|
||||
if (i instanceof ExoticPotion){
|
||||
Generator.undoDrop(ExoticPotion.exoToReg.get(i.getClass()));
|
||||
} else if (i instanceof ExoticScroll){
|
||||
Generator.undoDrop(ExoticScroll.exoToReg.get(i.getClass()));
|
||||
} else {
|
||||
Generator.undoDrop(i);
|
||||
}
|
||||
}
|
||||
|
||||
//rarer potions/scrolls go later in the order
|
||||
@@ -185,9 +198,16 @@ public class CrystalPathRoom extends SpecialRoom {
|
||||
@Override
|
||||
public int compare(Item a, Item b) {
|
||||
int aVal = 0, bVal = 0;
|
||||
Class aCls = a.getClass(), bCls = b.getClass();
|
||||
if (a instanceof ExoticPotion){
|
||||
aCls = ExoticPotion.exoToReg.get(aCls);
|
||||
}
|
||||
if (b instanceof ExoticPotion){
|
||||
bCls = ExoticPotion.exoToReg.get(aCls);
|
||||
}
|
||||
for (int i = 0; i < Generator.Category.POTION.classes.length; i++){
|
||||
if (a.getClass() == Generator.Category.POTION.classes[i]) aVal = (int)Generator.Category.POTION.defaultProbsTotal[i];
|
||||
if (b.getClass() == Generator.Category.POTION.classes[i]) bVal = (int)Generator.Category.POTION.defaultProbsTotal[i];
|
||||
if (aCls == Generator.Category.POTION.classes[i]) aVal = (int)Generator.Category.POTION.defaultProbsTotal[i];
|
||||
if (bCls == Generator.Category.POTION.classes[i]) bVal = (int)Generator.Category.POTION.defaultProbsTotal[i];
|
||||
}
|
||||
return bVal - aVal;
|
||||
}
|
||||
@@ -196,9 +216,16 @@ public class CrystalPathRoom extends SpecialRoom {
|
||||
@Override
|
||||
public int compare(Item a, Item b) {
|
||||
int aVal = 0, bVal = 0;
|
||||
Class aCls = a.getClass(), bCls = b.getClass();
|
||||
if (a instanceof ExoticScroll){
|
||||
aCls = ExoticScroll.exoToReg.get(aCls);
|
||||
}
|
||||
if (b instanceof ExoticScroll){
|
||||
bCls = ExoticScroll.exoToReg.get(aCls);
|
||||
}
|
||||
for (int i = 0; i < Generator.Category.SCROLL.classes.length; i++){
|
||||
if (a.getClass() == Generator.Category.SCROLL.classes[i]) aVal = (int)Generator.Category.SCROLL.defaultProbsTotal[i];
|
||||
if (b.getClass() == Generator.Category.SCROLL.classes[i]) bVal = (int)Generator.Category.SCROLL.defaultProbsTotal[i];
|
||||
if (aCls == Generator.Category.SCROLL.classes[i]) aVal = (int)Generator.Category.SCROLL.defaultProbsTotal[i];
|
||||
if (bCls == Generator.Category.SCROLL.classes[i]) bVal = (int)Generator.Category.SCROLL.defaultProbsTotal[i];
|
||||
}
|
||||
return bVal - aVal;
|
||||
}
|
||||
|
||||
@@ -472,10 +472,14 @@ public class ItemSpriteSheet {
|
||||
public static final int RAT_SKULL = TRINKETS+0;
|
||||
public static final int PARCHMENT_SCRAP = TRINKETS+1;
|
||||
public static final int PETRIFIED_SEED = TRINKETS+2;
|
||||
public static final int EXOTIC_CRYSTALS = TRINKETS+3;
|
||||
public static final int MOSSY_CLUMP = TRINKETS+4;
|
||||
static{
|
||||
assignItemRect(RAT_SKULL, 16, 11);
|
||||
assignItemRect(PARCHMENT_SCRAP, 10, 14);
|
||||
assignItemRect(PETRIFIED_SEED, 10, 10);
|
||||
assignItemRect(RAT_SKULL, 16, 11);
|
||||
assignItemRect(PARCHMENT_SCRAP, 10, 14);
|
||||
assignItemRect(PETRIFIED_SEED, 10, 10);
|
||||
assignItemRect(EXOTIC_CRYSTALS, 11, 11);
|
||||
assignItemRect(MOSSY_CLUMP, 12, 11);
|
||||
}
|
||||
|
||||
private static final int SCROLLS = xy(1, 19); //16 slots
|
||||
|
||||
Reference in New Issue
Block a user