v0.7.0: groundwork for alchemy phase 2

This commit is contained in:
Evan Debenham 2018-07-08 18:11:08 -04:00
parent 05c4c39fb5
commit c4ac5e672b
23 changed files with 504 additions and 34 deletions

Binary file not shown.

Before

Width:  |  Height:  |  Size: 15 KiB

After

Width:  |  Height:  |  Size: 29 KiB

View File

@ -132,6 +132,10 @@ public class ShatteredPixelDungeon extends Game {
com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfAugmentation.class, com.shatteredpixel.shatteredpixeldungeon.items.stones.StoneOfAugmentation.class,
"com.shatteredpixel.shatteredpixeldungeon.items.Weightstone" ); "com.shatteredpixel.shatteredpixeldungeon.items.Weightstone" );
//v0.7.0
com.watabou.utils.Bundle.addAlias(
com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb.class,
"com.shatteredpixel.shatteredpixeldungeon.items.Bomb" );
} }
@Override @Override

View File

@ -37,6 +37,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.FlameParticle;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat; import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat;
import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio; import com.shatteredpixel.shatteredpixeldungeon.items.food.FrozenCarpaccio;
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat; import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;

View File

@ -145,18 +145,39 @@ public class ItemStatusHandler<T extends Item> {
return false; return false;
} }
public boolean contains( Class<?extends T> itemCls ){
for (Class<?extends Item> i : items){
if (itemCls.equals(i)){
return true;
}
}
return false;
}
public int image( T item ) { public int image( T item ) {
return labelImages.get(label(item)); return labelImages.get(label(item));
} }
public int image( Class<?extends T> itemCls ) {
return labelImages.get(label(itemCls));
}
public String label( T item ) { public String label( T item ) {
return itemLabels.get(item.getClass()); return itemLabels.get(item.getClass());
} }
public String label( Class<?extends T> itemCls ){
return itemLabels.get( itemCls );
}
public boolean isKnown( T item ) { public boolean isKnown( T item ) {
return known.contains( item.getClass() ); return known.contains( item.getClass() );
} }
public boolean isKnown( Class<?extends T> itemCls ){
return known.contains( itemCls );
}
public void know( T item ) { public void know( T item ) {
known.add( (Class<? extends T>)item.getClass() ); known.add( (Class<? extends T>)item.getClass() );
} }

View File

@ -22,9 +22,12 @@
package com.shatteredpixel.shatteredpixeldungeon.items; package com.shatteredpixel.shatteredpixeldungeon.items;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit; import com.shatteredpixel.shatteredpixeldungeon.items.food.Blandfruit;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.ExoticPotion;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand; import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.Dart;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.darts.TippedDart;
@ -123,7 +126,10 @@ public abstract class Recipe {
}; };
private static Recipe[] threeIngredientRecipes = new Recipe[]{ private static Recipe[] threeIngredientRecipes = new Recipe[]{
new Potion.SeedToPotion() new Potion.SeedToPotion(),
new ExoticPotion.PotionToExotic(),
new ExoticScroll.ScrollToExotic(),
new Bomb.EnhanceBomb()
}; };
public static Recipe findRecipe(ArrayList<Item> ingredients){ public static Recipe findRecipe(ArrayList<Item> ingredients){

View File

@ -19,17 +19,24 @@
* along with this program. If not, see <http://www.gnu.org/licenses/> * along with this program. If not, see <http://www.gnu.org/licenses/>
*/ */
package com.shatteredpixel.shatteredpixeldungeon.items; package com.shatteredpixel.shatteredpixeldungeon.items.bombs;
import com.shatteredpixel.shatteredpixeldungeon.Assets; import com.shatteredpixel.shatteredpixeldungeon.Assets;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor; import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene; import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
@ -41,6 +48,7 @@ import com.watabou.utils.PathFinder;
import com.watabou.utils.Random; import com.watabou.utils.Random;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.HashMap;
public class Bomb extends Item { public class Bomb extends Item {
@ -62,7 +70,7 @@ public class Bomb extends Item {
@Override @Override
public boolean isSimilar(Item item) { public boolean isSimilar(Item item) {
return item instanceof Bomb && this.fuse == ((Bomb) item).fuse; return item.getClass() == getClass() && this.fuse == ((Bomb) item).fuse;
} }
@Override @Override
@ -277,4 +285,68 @@ public class Bomb extends Item {
return false; return false;
} }
} }
public static class EnhanceBomb extends Recipe {
private static final HashMap<Class<?extends Item>, Class<?extends Bomb>> validIngredients = new HashMap<>();
static {
validIngredients.put(PotionOfHealing.class, HealingBomb.class);
}
@Override
public boolean testIngredients(ArrayList<Item> ingredients) {
boolean seedOrStone = false;
boolean bomb = false;
boolean ingredient = false;
for (Item i : ingredients){
if (i instanceof Plant.Seed || i instanceof Runestone){
seedOrStone = true;
} else if (i.getClass().equals(Bomb.class)){
bomb = true;
} else if (validIngredients.containsKey(i.getClass())){
ingredient = true;
}
}
return seedOrStone && bomb && ingredient;
}
@Override
public int cost(ArrayList<Item> ingredients) {
return 0;
}
@Override
public Item brew(ArrayList<Item> ingredients) {
Item result = null;
for (Item i : ingredients){
i.quantity(i.quantity()-1);
if (validIngredients.containsKey(i.getClass())){
try {
result = validIngredients.get(i.getClass()).newInstance();
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
}
}
return result;
}
@Override
public Item sampleOutput(ArrayList<Item> ingredients) {
for (Item i : ingredients){
if (validIngredients.containsKey(i.getClass())){
try {
return validIngredients.get(i.getClass()).newInstance();
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
}
}
return null;
}
}
} }

View File

@ -0,0 +1,32 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.bombs;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class HealingBomb extends Bomb {
{
image = ItemSpriteSheet.HEAL_BOMB;
}
}

View File

@ -127,7 +127,7 @@ public class Potion extends Item {
canThrowPots.add(PotionOfLevitation.class); canThrowPots.add(PotionOfLevitation.class);
} }
private static ItemStatusHandler<Potion> handler; protected static ItemStatusHandler<Potion> handler;
private String color; private String color;

View File

@ -0,0 +1,115 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.potions.exotic;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
import java.util.ArrayList;
import java.util.HashMap;
public class ExoticPotion extends Potion {
{
//sprite = equivalent potion sprite but one row down
}
public static final HashMap<Class<?extends Potion>, Class<?extends ExoticPotion>> regToExo = new HashMap<>();
public static final HashMap<Class<?extends ExoticPotion>, Class<?extends Potion>> exoToReg = new HashMap<>();
static{
regToExo.put(PotionOfHealing.class, PotionOfSheilding.class);
exoToReg.put(PotionOfSheilding.class, PotionOfHealing.class);
}
@Override
public boolean isKnown() {
//assume it is IDed as ided potions are needed for alchemy
return true;
}
@Override
public void reset() {
if (handler != null && handler.contains(exoToReg.get(this.getClass()))) {
image = handler.image(exoToReg.get(this.getClass())) + 16;
}
}
public static class PotionToExotic extends Recipe{
@Override
public boolean testIngredients(ArrayList<Item> ingredients) {
int s = 0;
Potion p = null;
for (Item i : ingredients){
if (i instanceof Plant.Seed){
s++;
} else if (regToExo.containsKey(i.getClass())) {
p = (Potion)i;
}
}
return p != null && s == 2;
}
@Override
public int cost(ArrayList<Item> ingredients) {
return 0;
}
@Override
public Item brew(ArrayList<Item> ingredients) {
Item result = null;
for (Item i : ingredients){
i.quantity(i.quantity()-1);
if (regToExo.containsKey(i.getClass())) {
try {
result = regToExo.get(i.getClass()).newInstance();
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
}
}
return result;
}
@Override
public Item sampleOutput(ArrayList<Item> ingredients) {
for (Item i : ingredients){
if (regToExo.containsKey(i.getClass())) {
try {
return regToExo.get(i.getClass()).newInstance();
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
}
}
return null;
}
}
}

View File

@ -0,0 +1,25 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.potions.exotic;
public class PotionOfSheilding extends ExoticPotion {
}

View File

@ -22,11 +22,11 @@
package com.shatteredpixel.shatteredpixeldungeon.items.rings; package com.shatteredpixel.shatteredpixeldungeon.items.rings;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Gold; import com.shatteredpixel.shatteredpixeldungeon.items.Gold;
import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot; import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
import com.watabou.utils.Random; import com.watabou.utils.Random;
import java.util.ArrayList; import java.util.ArrayList;

View File

@ -93,7 +93,7 @@ public abstract class Scroll extends Item {
} }
}; };
private static ItemStatusHandler<Scroll> handler; protected static ItemStatusHandler<Scroll> handler;
private String rune; private String rune;

View File

@ -0,0 +1,117 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.scrolls.exotic;
import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Recipe;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfIdentify;
import com.shatteredpixel.shatteredpixeldungeon.items.stones.Runestone;
import java.util.ArrayList;
import java.util.HashMap;
public abstract class ExoticScroll extends Scroll {
public static final HashMap<Class<?extends Scroll>, Class<?extends ExoticScroll>> regToExo = new HashMap<>();
public static final HashMap<Class<?extends ExoticScroll>, Class<?extends Scroll>> exoToReg = new HashMap<>();
static{
regToExo.put(ScrollOfIdentify.class, ScrollOfForesight.class);
exoToReg.put(ScrollOfForesight.class, ScrollOfIdentify.class);
}
@Override
public boolean isKnown() {
//assume it is IDed as ided scrolls are needed for alchemy
return true;
}
@Override
public void reset() {
if (handler != null && handler.contains(exoToReg.get(this.getClass()))) {
image = handler.image(exoToReg.get(this.getClass())) + 16;
}
}
@Override
public void empoweredRead() {
}
public static class ScrollToExotic extends Recipe {
@Override
public boolean testIngredients(ArrayList<Item> ingredients) {
int r = 0;
Scroll s = null;
for (Item i : ingredients){
if (i instanceof Runestone){
r++;
} else if (regToExo.containsKey(i.getClass())) {
s = (Scroll)i;
}
}
return s != null && r == 2;
}
@Override
public int cost(ArrayList<Item> ingredients) {
return 0;
}
@Override
public Item brew(ArrayList<Item> ingredients) {
Item result = null;
for (Item i : ingredients){
i.quantity(i.quantity()-1);
if (regToExo.containsKey(i.getClass())) {
try {
result = regToExo.get(i.getClass()).newInstance();
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
}
}
return result;
}
@Override
public Item sampleOutput(ArrayList<Item> ingredients) {
for (Item i : ingredients){
if (regToExo.containsKey(i.getClass())) {
try {
return regToExo.get(i.getClass()).newInstance();
} catch (Exception e) {
ShatteredPixelDungeon.reportException(e);
}
}
}
return null;
}
}
}

View File

@ -0,0 +1,29 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2018 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.scrolls.exotic;
public class ScrollOfForesight extends ExoticScroll {
@Override
public void doRead() {
}
}

View File

@ -21,7 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.stones; package com.shatteredpixel.shatteredpixeldungeon.items.stones;
import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
public class StoneOfBlast extends Runestone { public class StoneOfBlast extends Runestone {

View File

@ -46,10 +46,10 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite; import com.shatteredpixel.shatteredpixeldungeon.effects.SpellSprite;
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle; import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
import com.shatteredpixel.shatteredpixeldungeon.items.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.TimekeepersHourglass;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;

View File

@ -21,8 +21,8 @@
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret; package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret;
import com.shatteredpixel.shatteredpixeldungeon.items.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;

View File

@ -23,9 +23,9 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bee; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Bee;
import com.shatteredpixel.shatteredpixeldungeon.items.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot; import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter; import com.shatteredpixel.shatteredpixeldungeon.levels.painters.Painter;

View File

@ -22,9 +22,9 @@
package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special; package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.items.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey; import com.shatteredpixel.shatteredpixeldungeon.items.keys.IronKey;
import com.shatteredpixel.shatteredpixeldungeon.levels.Level; import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;

View File

@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Belongings;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Shopkeeper; import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Shopkeeper;
import com.shatteredpixel.shatteredpixeldungeon.items.Ankh; import com.shatteredpixel.shatteredpixeldungeon.items.Ankh;
import com.shatteredpixel.shatteredpixeldungeon.items.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.Generator; import com.shatteredpixel.shatteredpixeldungeon.items.Generator;
import com.shatteredpixel.shatteredpixeldungeon.items.Heap; import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot; import com.shatteredpixel.shatteredpixeldungeon.items.Honeypot;
@ -44,6 +43,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.PotionBandolier; import com.shatteredpixel.shatteredpixeldungeon.items.bags.PotionBandolier;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder; import com.shatteredpixel.shatteredpixeldungeon.items.bags.ScrollHolder;
import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch; import com.shatteredpixel.shatteredpixeldungeon.items.bags.VelvetPouch;
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
import com.shatteredpixel.shatteredpixeldungeon.items.food.SmallRation; import com.shatteredpixel.shatteredpixeldungeon.items.food.SmallRation;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion; import com.shatteredpixel.shatteredpixeldungeon.items.potions.Potion;
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing; import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfHealing;

View File

@ -21,7 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.levels.traps; package com.shatteredpixel.shatteredpixeldungeon.levels.traps;
import com.shatteredpixel.shatteredpixeldungeon.items.Bomb; import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
public class ExplosiveTrap extends Trap { public class ExplosiveTrap extends Trap {

View File

@ -63,14 +63,13 @@ public class ItemSpriteSheet {
public static final int DEWDROP = UNCOLLECTIBLE+1; public static final int DEWDROP = UNCOLLECTIBLE+1;
public static final int PETAL = UNCOLLECTIBLE+2; public static final int PETAL = UNCOLLECTIBLE+2;
public static final int SANDBAG = UNCOLLECTIBLE+3; public static final int SANDBAG = UNCOLLECTIBLE+3;
public static final int DBL_BOMB = UNCOLLECTIBLE+4;
public static final int GUIDE_PAGE = UNCOLLECTIBLE+5; public static final int GUIDE_PAGE = UNCOLLECTIBLE+5;
static{ static{
assignItemRect(GOLD, 15, 13); assignItemRect(GOLD, 15, 13);
assignItemRect(DEWDROP, 10, 10); assignItemRect(DEWDROP, 10, 10);
assignItemRect(PETAL, 8, 8); assignItemRect(PETAL, 8, 8);
assignItemRect(SANDBAG, 10, 10); assignItemRect(SANDBAG, 10, 10);
assignItemRect(DBL_BOMB, 14, 13);
assignItemRect(GUIDE_PAGE, 10, 11); assignItemRect(GUIDE_PAGE, 10, 11);
} }
@ -101,7 +100,7 @@ public class ItemSpriteSheet {
public static final int SEAL = SINGLE_USE+3; public static final int SEAL = SINGLE_USE+3;
public static final int TORCH = SINGLE_USE+4; public static final int TORCH = SINGLE_USE+4;
public static final int BEACON = SINGLE_USE+5; public static final int BEACON = SINGLE_USE+5;
public static final int BOMB = SINGLE_USE+6;
public static final int HONEYPOT = SINGLE_USE+7; public static final int HONEYPOT = SINGLE_USE+7;
public static final int SHATTPOT = SINGLE_USE+8; public static final int SHATTPOT = SINGLE_USE+8;
public static final int IRON_KEY = SINGLE_USE+9; public static final int IRON_KEY = SINGLE_USE+9;
@ -118,7 +117,7 @@ public class ItemSpriteSheet {
assignItemRect(SEAL, 9, 15); assignItemRect(SEAL, 9, 15);
assignItemRect(TORCH, 12, 15); assignItemRect(TORCH, 12, 15);
assignItemRect(BEACON, 16, 15); assignItemRect(BEACON, 16, 15);
assignItemRect(BOMB, 10, 13);
assignItemRect(HONEYPOT, 14, 12); assignItemRect(HONEYPOT, 14, 12);
assignItemRect(SHATTPOT, 14, 12); assignItemRect(SHATTPOT, 14, 12);
assignItemRect(IRON_KEY, 8, 14); assignItemRect(IRON_KEY, 8, 14);
@ -129,8 +128,20 @@ public class ItemSpriteSheet {
assignItemRect(KIT, 16, 15); assignItemRect(KIT, 16, 15);
assignItemRect(AMULET, 16, 16); assignItemRect(AMULET, 16, 16);
} }
private static final int BOMBS = xy(1, 5); //16 slots
public static final int BOMB = BOMBS+0;
public static final int DBL_BOMB = BOMBS+1;
public static final int HEAL_BOMB = BOMBS+2;
static{
assignItemRect(BOMB, 10, 13);
assignItemRect(DBL_BOMB, 14, 13);
assignItemRect(HEAL_BOMB, 10, 13);
}
//32 free slots
//16 free slots
private static final int WEP_TIER1 = xy(1, 7); //8 slots private static final int WEP_TIER1 = xy(1, 7); //8 slots
public static final int WORN_SHORTSWORD = WEP_TIER1+0; public static final int WORN_SHORTSWORD = WEP_TIER1+0;
@ -378,9 +389,9 @@ public class ItemSpriteSheet {
assignItemRect(ARTIFACT_ROSE3, 14, 14); assignItemRect(ARTIFACT_ROSE3, 14, 14);
} }
//32 free slots //16 free slots
private static final int SCROLLS = xy(1, 20); //16 slots private static final int SCROLLS = xy(1, 19); //16 slots
public static final int SCROLL_KAUNAN = SCROLLS+0; public static final int SCROLL_KAUNAN = SCROLLS+0;
public static final int SCROLL_SOWILO = SCROLLS+1; public static final int SCROLL_SOWILO = SCROLLS+1;
public static final int SCROLL_LAGUZ = SCROLLS+2; public static final int SCROLL_LAGUZ = SCROLLS+2;
@ -398,6 +409,24 @@ public class ItemSpriteSheet {
assignItemRect(i, 15, 14); assignItemRect(i, 15, 14);
} }
private static final int EXOTIC_SCROLLS = xy(1, 20); //16 slots
public static final int EXOTIC_KAUNAN = EXOTIC_SCROLLS+0;
public static final int EXOTIC_SOWILO = EXOTIC_SCROLLS+1;
public static final int EXOTIC_LAGUZ = EXOTIC_SCROLLS+2;
public static final int EXOTIC_YNGVI = EXOTIC_SCROLLS+3;
public static final int EXOTIC_GYFU = EXOTIC_SCROLLS+4;
public static final int EXOTIC_RAIDO = EXOTIC_SCROLLS+5;
public static final int EXOTIC_ISAZ = EXOTIC_SCROLLS+6;
public static final int EXOTIC_MANNAZ = EXOTIC_SCROLLS+7;
public static final int EXOTIC_NAUDIZ = EXOTIC_SCROLLS+8;
public static final int EXOTIC_BERKANAN = EXOTIC_SCROLLS+9;
public static final int EXOTIC_ODAL = EXOTIC_SCROLLS+10;
public static final int EXOTIC_TIWAZ = EXOTIC_SCROLLS+11;
static {
for (int i = EXOTIC_SCROLLS; i < EXOTIC_SCROLLS+16; i++)
assignItemRect(i, 15, 14);
}
private static final int STONES = xy(1, 21); //16 slots private static final int STONES = xy(1, 21); //16 slots
public static final int STONE_KAUNAN = STONES+0; public static final int STONE_KAUNAN = STONES+0;
public static final int STONE_SOWILO = STONES+1; public static final int STONE_SOWILO = STONES+1;
@ -431,10 +460,28 @@ public class ItemSpriteSheet {
public static final int POTION_IVORY = POTIONS+11; public static final int POTION_IVORY = POTIONS+11;
static { static {
for (int i = POTIONS; i < POTIONS+16; i++) for (int i = POTIONS; i < POTIONS+16; i++)
assignItemRect(i, 10, 14); assignItemRect(i, 12, 14);
}
private static final int EXOTIC_POTIONS = xy(1, 23); //16 slots
public static final int EXOTIC_CRIMSON = EXOTIC_POTIONS+0;
public static final int EXOTIC_AMBER = EXOTIC_POTIONS+1;
public static final int EXOTIC_GOLDEN = EXOTIC_POTIONS+2;
public static final int EXOTIC_JADE = EXOTIC_POTIONS+3;
public static final int EXOTIC_TURQUOISE= EXOTIC_POTIONS+4;
public static final int EXOTIC_AZURE = EXOTIC_POTIONS+5;
public static final int EXOTIC_INDIGO = EXOTIC_POTIONS+6;
public static final int EXOTIC_MAGENTA = EXOTIC_POTIONS+7;
public static final int EXOTIC_BISTRE = EXOTIC_POTIONS+8;
public static final int EXOTIC_CHARCOAL = EXOTIC_POTIONS+9;
public static final int EXOTIC_SILVER = EXOTIC_POTIONS+10;
public static final int EXOTIC_IVORY = EXOTIC_POTIONS+11;
static {
for (int i = EXOTIC_POTIONS; i < EXOTIC_POTIONS+16; i++)
assignItemRect(i, 12, 13);
} }
private static final int SEEDS = xy(1, 23); //16 slots private static final int SEEDS = xy(1, 24); //16 slots
public static final int SEED_ROTBERRY = SEEDS+0; public static final int SEED_ROTBERRY = SEEDS+0;
public static final int SEED_FIREBLOOM = SEEDS+1; public static final int SEED_FIREBLOOM = SEEDS+1;
public static final int SEED_SWIFTTHISTLE = SEEDS+2; public static final int SEED_SWIFTTHISTLE = SEEDS+2;
@ -452,8 +499,6 @@ public class ItemSpriteSheet {
assignItemRect(i, 10, 10); assignItemRect(i, 10, 10);
} }
//16 free slots
private static final int FOOD = xy(1, 25); //16 slots private static final int FOOD = xy(1, 25); //16 slots
public static final int MEAT = FOOD+0; public static final int MEAT = FOOD+0;
public static final int STEAK = FOOD+1; public static final int STEAK = FOOD+1;

View File

@ -343,6 +343,19 @@ items.bags.magicalholster.desc=This slim holster is made from some exotic animal
###bombs
items.bombs.bomb.name=bomb
items.bombs.bomb.ac_lightthrow=LIGHT & THROW
items.bombs.bomb.snuff_fuse=You quickly snuff the bomb's fuse.
items.bombs.bomb.ondeath=Killed by an explosion
items.bombs.bomb.rankings_desc=Killed by an explosion
items.bombs.bomb.desc=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nIt looks like the fuse will take a couple rounds to burn down once it is lit.
items.bombs.bomb.desc_burning=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nThe bomb's fuse is burning away, keep your distance or put it out!
items.bombs.bomb$doublebomb.name=two bombs
items.bombs.bomb$doublebomb.desc=A stack of two hefty black powder bombs, looks like you get one free!
###food ###food
items.food.blandfruit.name=blandfruit items.food.blandfruit.name=blandfruit
items.food.blandfruit.sunfruit=sunfruit items.food.blandfruit.sunfruit=sunfruit
@ -1129,16 +1142,6 @@ items.armorkit.prompt=Select an armor
items.armorkit.upgraded=You applied the armor kit to upgrade your %s items.armorkit.upgraded=You applied the armor kit to upgrade your %s
items.armorkit.desc=Using this kit of small tools and materials anybody can transform any armor into an "epic armor", which will keep all properties of the original armor, but will also provide its wearer a special ability depending on his class. No skills in tailoring, leatherworking or blacksmithing are required. items.armorkit.desc=Using this kit of small tools and materials anybody can transform any armor into an "epic armor", which will keep all properties of the original armor, but will also provide its wearer a special ability depending on his class. No skills in tailoring, leatherworking or blacksmithing are required.
items.bomb.name=bomb
items.bomb.ac_lightthrow=LIGHT & THROW
items.bomb.snuff_fuse=You quickly snuff the bomb's fuse.
items.bomb.ondeath=Killed by an explosion
items.bomb.rankings_desc=Killed by an explosion
items.bomb.desc=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nIt looks like the fuse will take a couple rounds to burn down once it is lit.
items.bomb.desc_burning=A fairly hefty black powder bomb. An explosion from this would certainly do damage to anything nearby.\n\nThe bomb's fuse is burning away, keep your distance or put it out!
items.bomb$doublebomb.name=two bombs
items.bomb$doublebomb.desc=A stack of two hefty black powder bombs, looks like you get one free!
items.brokenseal.name=broken seal items.brokenseal.name=broken seal
items.brokenseal.ac_affix=AFFIX items.brokenseal.ac_affix=AFFIX
items.brokenseal.prompt=Select an armor items.brokenseal.prompt=Select an armor