Merging 1.9.1 source: item changes
This commit is contained in:
parent
bc1e3ee17a
commit
366dce1610
|
@ -48,7 +48,7 @@ public class Regeneration extends Buff {
|
|||
if (regenBuff.isCursed())
|
||||
spend( REGENERATION_DELAY * 1.5f );
|
||||
else
|
||||
spend( REGENERATION_DELAY - regenBuff.level()*0.9f );
|
||||
spend( REGENERATION_DELAY - regenBuff.itemLevel()*0.9f );
|
||||
else
|
||||
spend( REGENERATION_DELAY );
|
||||
|
||||
|
|
|
@ -141,7 +141,7 @@ public class Thief extends Mob {
|
|||
|
||||
Item item = hero.belongings.randomUnequipped();
|
||||
|
||||
if (item != null && !item.unique && item.level < 1 ) {
|
||||
if (item != null && !item.unique && item.level() < 1 ) {
|
||||
|
||||
GLog.w( TXT_STOLE, this.name, item.name() );
|
||||
Dungeon.quickslot.clearItem( item );
|
||||
|
|
|
@ -338,11 +338,11 @@ public class Ghost extends NPC {
|
|||
do {
|
||||
another = Generator.randomWeapon(10+i);
|
||||
} while (another instanceof MissileWeapon);
|
||||
if (another.level >= weapon.level) {
|
||||
if (another.level() >= weapon.level()) {
|
||||
weapon = (Weapon) another;
|
||||
}
|
||||
another = Generator.randomArmor(10+i);
|
||||
if (another.level >= armor.level) {
|
||||
if (another.level() >= armor.level()) {
|
||||
armor = (Armor) another;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -20,12 +20,10 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.ResultDescriptions;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.Utils;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
|
@ -35,15 +33,12 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.BlastParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.SmokeParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Arrays;
|
||||
import java.util.Collections;
|
||||
|
||||
public class Bomb extends Item {
|
||||
|
||||
|
@ -131,7 +126,7 @@ public class Bomb extends Item {
|
|||
}
|
||||
|
||||
if (Level.flamable[c]) {
|
||||
Level.set( c, Terrain.EMBERS );
|
||||
Dungeon.level.destroy( c );
|
||||
GameScene.updateMap( c );
|
||||
terrainAffected = true;
|
||||
}
|
||||
|
|
|
@ -292,7 +292,7 @@ public class Heap implements Bundlable {
|
|||
return;
|
||||
|
||||
//unique and upgraded items can endure the blast
|
||||
} else if (!(item.level > 0 || item.unique))
|
||||
} else if (!(item.level() > 0 || item.unique))
|
||||
items.remove( item );
|
||||
|
||||
}
|
||||
|
@ -376,7 +376,7 @@ public class Heap implements Bundlable {
|
|||
|
||||
//alchemists toolkit gives a chance to cook a potion in two or even one seeds
|
||||
AlchemistsToolkit.alchemy alchemy = Dungeon.hero.buff(AlchemistsToolkit.alchemy.class);
|
||||
int bonus = alchemy != null ? alchemy.level() : -1;
|
||||
int bonus = alchemy != null ? alchemy.itemLevel() : -1;
|
||||
|
||||
if (bonus != -1 ? alchemy.tryCook(count) : count >= SEEDS_TO_POTION) {
|
||||
|
||||
|
|
|
@ -74,7 +74,8 @@ public class Item implements Bundlable {
|
|||
public boolean stackable = false;
|
||||
protected int quantity = 1;
|
||||
|
||||
public int level = 0;
|
||||
private int level = 0;
|
||||
|
||||
public boolean levelKnown = false;
|
||||
|
||||
public boolean cursed;
|
||||
|
@ -264,6 +265,14 @@ public class Item implements Bundlable {
|
|||
|
||||
protected void onDetach(){}
|
||||
|
||||
public int level(){
|
||||
return level;
|
||||
}
|
||||
|
||||
public void level( int value ){
|
||||
level = value;
|
||||
}
|
||||
|
||||
public Item upgrade() {
|
||||
|
||||
cursed = false;
|
||||
|
|
|
@ -28,15 +28,12 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class KindOfWeapon extends EquipableItem {
|
||||
abstract public class KindOfWeapon extends EquipableItem {
|
||||
|
||||
private static final String TXT_EQUIP_CURSED = "you wince as your grip involuntarily tightens around your %s";
|
||||
|
||||
protected static final float TIME_TO_EQUIP = 1f;
|
||||
|
||||
public int MIN = 0;
|
||||
public int MAX = 1;
|
||||
|
||||
@Override
|
||||
public ArrayList<String> actions( Hero hero ) {
|
||||
ArrayList<String> actions = super.actions( hero );
|
||||
|
@ -94,8 +91,11 @@ public class KindOfWeapon extends EquipableItem {
|
|||
public void activate( Hero hero ) {
|
||||
}
|
||||
|
||||
abstract public int min();
|
||||
abstract public int max();
|
||||
|
||||
public int damageRoll( Hero owner ) {
|
||||
return Random.NormalIntRange( MIN, MAX );
|
||||
return Random.NormalIntRange( min(), max() );
|
||||
}
|
||||
|
||||
public float acuracyFactor( Hero hero ) {
|
||||
|
|
|
@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.PurpleParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
|
@ -34,7 +35,7 @@ import java.util.ArrayList;
|
|||
|
||||
public class Stylus extends Item {
|
||||
|
||||
private static final String TXT_SELECT_ARMOR = "Select an armor to inscribe on";
|
||||
private static final String TXT_SELECT_ARMOR = "Select an armor to inscribe";
|
||||
private static final String TXT_INSCRIBED = "you inscribed your %s with the stylus";
|
||||
|
||||
private static final float TIME_TO_INSCRIBE = 2;
|
||||
|
@ -91,6 +92,7 @@ public class Stylus extends Item {
|
|||
|
||||
curUser.sprite.operate(curUser.pos);
|
||||
curUser.sprite.centerEmitter().start(PurpleParticle.BURST, 0.05f, 10);
|
||||
Enchanting.show(curUser, armor);
|
||||
Sample.INSTANCE.play(Assets.SND_BURNING);
|
||||
|
||||
curUser.spend(TIME_TO_INSCRIBE);
|
||||
|
|
|
@ -54,7 +54,6 @@ public class Armor extends EquipableItem {
|
|||
public int tier;
|
||||
|
||||
public int STR;
|
||||
public int DR;
|
||||
|
||||
private int hitsToKnow = HITS_TO_KNOW;
|
||||
|
||||
|
@ -65,7 +64,6 @@ public class Armor extends EquipableItem {
|
|||
this.tier = tier;
|
||||
|
||||
STR = typicalSTR();
|
||||
DR = typicalDR();
|
||||
}
|
||||
|
||||
private static final String UNFAMILIRIARITY = "unfamiliarity";
|
||||
|
@ -147,6 +145,10 @@ public class Armor extends EquipableItem {
|
|||
return hero.belongings.armor == this;
|
||||
}
|
||||
|
||||
public int DR(){
|
||||
return tier * (2 + level() + (glyph == null ? 0 : 1));
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item upgrade() {
|
||||
return upgrade( false );
|
||||
|
@ -155,7 +157,7 @@ public class Armor extends EquipableItem {
|
|||
public Item upgrade( boolean inscribe ) {
|
||||
|
||||
if (glyph != null) {
|
||||
if (!inscribe && Random.Int( level ) > 0) {
|
||||
if (!inscribe && Random.Int( level() ) > 0) {
|
||||
GLog.w( TXT_INCOMPATIBLE );
|
||||
inscribe( null );
|
||||
}
|
||||
|
@ -165,7 +167,6 @@ public class Armor extends EquipableItem {
|
|||
}
|
||||
};
|
||||
|
||||
DR += tier;
|
||||
STR--;
|
||||
|
||||
return super.upgrade();
|
||||
|
@ -173,7 +174,6 @@ public class Armor extends EquipableItem {
|
|||
|
||||
@Override
|
||||
public Item degrade() {
|
||||
DR -= tier;
|
||||
STR++;
|
||||
|
||||
return super.degrade();
|
||||
|
@ -214,7 +214,7 @@ public class Armor extends EquipableItem {
|
|||
if (levelKnown) {
|
||||
info.append(
|
||||
"\n\nThis " + name + " provides damage absorption up to " +
|
||||
"" + Math.max( DR, 0 ) + " points per attack. " );
|
||||
"" + Math.max( DR(), 0 ) + " points per attack. " );
|
||||
|
||||
if (STR > Dungeon.hero.STR()) {
|
||||
|
||||
|
@ -297,10 +297,10 @@ public class Armor extends EquipableItem {
|
|||
price /= 2;
|
||||
}
|
||||
if (levelKnown) {
|
||||
if (level > 0) {
|
||||
price *= (level + 1);
|
||||
} else if (level < 0) {
|
||||
price /= (1 - level);
|
||||
if (level() > 0) {
|
||||
price *= (level() + 1);
|
||||
} else if (level() < 0) {
|
||||
price /= (1 - level());
|
||||
}
|
||||
}
|
||||
if (price < 1) {
|
||||
|
@ -310,13 +310,6 @@ public class Armor extends EquipableItem {
|
|||
}
|
||||
|
||||
public Armor inscribe( Glyph glyph ) {
|
||||
|
||||
if (glyph != null && this.glyph == null) {
|
||||
DR += tier;
|
||||
} else if (glyph == null && this.glyph != null) {
|
||||
DR -= tier;
|
||||
}
|
||||
|
||||
this.glyph = glyph;
|
||||
|
||||
return this;
|
||||
|
|
|
@ -40,6 +40,8 @@ abstract public class ClassArmor extends Armor {
|
|||
bones = false;
|
||||
}
|
||||
|
||||
private int DR;
|
||||
|
||||
public ClassArmor() {
|
||||
super( 6 );
|
||||
}
|
||||
|
@ -64,7 +66,7 @@ abstract public class ClassArmor extends Armor {
|
|||
}
|
||||
|
||||
classArmor.STR = armor.STR;
|
||||
classArmor.DR = armor.DR;
|
||||
classArmor.DR = armor.DR();
|
||||
|
||||
classArmor.inscribe( armor.glyph );
|
||||
|
||||
|
@ -119,6 +121,11 @@ abstract public class ClassArmor extends Armor {
|
|||
abstract public String special();
|
||||
abstract public void doSpecial();
|
||||
|
||||
@Override
|
||||
public int DR(){
|
||||
return DR;
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgradable() {
|
||||
return false;
|
||||
|
|
|
@ -41,7 +41,7 @@ public class Affection extends Glyph {
|
|||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
int level = (int)GameMath.gate( 0, armor.level, 6 );
|
||||
int level = (int)GameMath.gate( 0, armor.level(), 6 );
|
||||
|
||||
if (Level.adjacent( attacker.pos, defender.pos ) && Random.Int( level / 2 + 5 ) >= 4) {
|
||||
|
||||
|
|
|
@ -43,7 +43,7 @@ public class AntiEntropy extends Glyph {
|
|||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
int level = Math.max( 0, armor.level );
|
||||
int level = Math.max( 0, armor.level() );
|
||||
|
||||
if (Level.adjacent( attacker.pos, defender.pos ) && Random.Int( level + 6 ) >= 5) {
|
||||
|
||||
|
|
|
@ -37,7 +37,7 @@ public class Bounce extends Glyph {
|
|||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
int level = Math.max( 0, armor.level );
|
||||
int level = Math.max( 0, armor.level() );
|
||||
|
||||
if (Level.adjacent( attacker.pos, defender.pos ) && Random.Int( level + 5) >= 4) {
|
||||
|
||||
|
|
|
@ -44,7 +44,7 @@ public class Displacement extends Glyph {
|
|||
return damage;
|
||||
}
|
||||
|
||||
int nTries = (armor.level < 0 ? 1 : armor.level + 1) * 5;
|
||||
int nTries = (armor.level() < 0 ? 1 : armor.level() + 1) * 5;
|
||||
for (int i=0; i < nTries; i++) {
|
||||
int pos = Random.Int( Level.LENGTH );
|
||||
if (Dungeon.visible[pos] && Level.passable[pos] && Actor.findChar( pos ) == null) {
|
||||
|
|
|
@ -42,7 +42,7 @@ public class Entanglement extends Glyph {
|
|||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage ) {
|
||||
|
||||
int level = Math.max( 0, armor.level );
|
||||
int level = Math.max( 0, armor.level() );
|
||||
|
||||
if (Random.Int( 4 ) == 0) {
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class Metabolism extends Glyph {
|
|||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
int level = Math.max( 0, armor.level );
|
||||
int level = Math.max( 0, armor.level() );
|
||||
if (Random.Int( level / 2 + 5 ) >= 4) {
|
||||
|
||||
int healing = Math.min( defender.HT - defender.HP, Random.Int( 1, defender.HT / 5 ) );
|
||||
|
|
|
@ -44,7 +44,7 @@ public class Multiplicity extends Glyph {
|
|||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
int level = Math.max( 0, armor.level );
|
||||
int level = Math.max( 0, armor.level() );
|
||||
|
||||
if (Random.Int( level / 2 + 6 ) >= 5) {
|
||||
|
||||
|
|
|
@ -41,7 +41,7 @@ public class Potential extends Glyph {
|
|||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
int level = Math.max( 0, armor.level );
|
||||
int level = Math.max( 0, armor.level() );
|
||||
|
||||
if (Level.adjacent( attacker.pos, defender.pos ) && Random.Int( level + 7 ) >= 6) {
|
||||
|
||||
|
|
|
@ -40,7 +40,7 @@ public class Stench extends Glyph {
|
|||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
int level = Math.max( 0, armor.level );
|
||||
int level = Math.max( 0, armor.level() );
|
||||
|
||||
if (Level.adjacent( attacker.pos, defender.pos ) && Random.Int( level + 5 ) >= 4) {
|
||||
|
||||
|
|
|
@ -49,7 +49,7 @@ public class Viscosity extends Glyph {
|
|||
return 0;
|
||||
}
|
||||
|
||||
int level = Math.max( 0, armor.level );
|
||||
int level = Math.max( 0, armor.level() );
|
||||
|
||||
if (Random.Int( level + 7 ) >= 6) {
|
||||
|
||||
|
|
|
@ -43,7 +43,6 @@ public class AlchemistsToolkit extends Artifact {
|
|||
name = "Alchemists Toolkit";
|
||||
image = ItemSpriteSheet.ARTIFACT_TOOLKIT;
|
||||
|
||||
level = 0;
|
||||
levelCap = 10;
|
||||
}
|
||||
|
||||
|
@ -79,7 +78,7 @@ public class AlchemistsToolkit extends Artifact {
|
|||
@Override
|
||||
public ArrayList<String> actions( Hero hero ) {
|
||||
ArrayList<String> actions = super.actions( hero );
|
||||
if (isEquipped( hero ) && level < levelCap && !cursed)
|
||||
if (isEquipped( hero ) && level() < levelCap && !cursed)
|
||||
actions.add(AC_BREW);
|
||||
return actions;
|
||||
}
|
||||
|
@ -120,15 +119,15 @@ public class AlchemistsToolkit extends Artifact {
|
|||
GLog.i("Your mixture is complete, but none of the potions you used seem to react well. " +
|
||||
"The brew is useless, you throw it away.");
|
||||
|
||||
} else if (score > level) {
|
||||
} else if (score > level()) {
|
||||
|
||||
level = score;
|
||||
level(score);
|
||||
seedsToPotion = 0;
|
||||
bstGuess = curGuess;
|
||||
this.numRight = numRight;
|
||||
this.numWrongPlace = numWrongPlace;
|
||||
|
||||
if (level == 10){
|
||||
if (level() == 10){
|
||||
bstGuess = new ArrayList<String>();
|
||||
GLog.p("The mixture you've created seems perfect, you don't think there is any way to improve it!");
|
||||
} else {
|
||||
|
@ -174,10 +173,10 @@ public class AlchemistsToolkit extends Artifact {
|
|||
else
|
||||
result += "The toolkit rests on your hip, the various tools inside make a light jingling sound as you move.\n\n";
|
||||
|
||||
if (level == 0){
|
||||
if (level() == 0){
|
||||
result += "The toolkit seems to be missing a key tool, a catalyst mixture. You'll have to make your own " +
|
||||
"out of three common potions to get the most out of the toolkit.";
|
||||
} else if (level == 10) {
|
||||
} else if (level() == 10) {
|
||||
result += "The mixture you have created seems perfect, and the toolkit is working at maximum efficiency.";
|
||||
} else if (!bstGuess.isEmpty()) {
|
||||
result += "Your current best mixture is made from: " + bstGuess.get(0) + ", " + bstGuess.get(1) + ", "
|
||||
|
@ -236,8 +235,8 @@ public class AlchemistsToolkit extends Artifact {
|
|||
//this logic is handled inside the class with a variable so that it may be stored.
|
||||
//to prevent manipulation where a player could keep throwing in 1-2 seeds until they get lucky.
|
||||
if (seedsToPotion == 0){
|
||||
if (Random.Int(20) < 10+level){
|
||||
if (Random.Int(20) < level){
|
||||
if (Random.Int(20) < 10+level()){
|
||||
if (Random.Int(20) < level()){
|
||||
seedsToPotion = 1;
|
||||
} else
|
||||
seedsToPotion = 2;
|
||||
|
|
|
@ -188,7 +188,7 @@ public class Artifact extends KindofMisc {
|
|||
|
||||
@Override
|
||||
public int visiblyUpgraded() {
|
||||
return ((level*10)/levelCap);
|
||||
return ((level()*10)/levelCap);
|
||||
}
|
||||
|
||||
//transfers upgrades from another artifact, transfer level will equal the displayed level
|
||||
|
@ -212,7 +212,7 @@ public class Artifact extends KindofMisc {
|
|||
@Override
|
||||
public String toString() {
|
||||
|
||||
if (levelKnown && level/levelCap != 0) {
|
||||
if (levelKnown && level()/levelCap != 0) {
|
||||
if (chargeCap > 0) {
|
||||
return Utils.format( TXT_TO_STRING_LVL_CHARGE, name(), visiblyUpgraded(), charge, chargeCap );
|
||||
} else {
|
||||
|
@ -273,8 +273,8 @@ public class Artifact extends KindofMisc {
|
|||
@Override
|
||||
public int price() {
|
||||
int price = 100;
|
||||
if (level > 0)
|
||||
price += 50*((level*10)/levelCap);
|
||||
if (level() > 0)
|
||||
price += 50*((level()*10)/levelCap);
|
||||
if (cursed && cursedKnown) {
|
||||
price /= 2;
|
||||
}
|
||||
|
@ -293,8 +293,8 @@ public class Artifact extends KindofMisc {
|
|||
|
||||
public class ArtifactBuff extends Buff {
|
||||
|
||||
public int level() {
|
||||
return level;
|
||||
public int itemLevel() {
|
||||
return level();
|
||||
}
|
||||
|
||||
public boolean isCursed() {
|
||||
|
|
|
@ -34,7 +34,6 @@ public class CapeOfThorns extends Artifact {
|
|||
name = "Cape of Thorns";
|
||||
image = ItemSpriteSheet.ARTIFACT_CAPE;
|
||||
|
||||
level = 0;
|
||||
levelCap = 10;
|
||||
|
||||
charge = 0;
|
||||
|
@ -85,10 +84,10 @@ public class CapeOfThorns extends Artifact {
|
|||
|
||||
public int proc(int damage, Char attacker, Char defender){
|
||||
if (cooldown == 0){
|
||||
charge += damage*(0.5+level*0.05);
|
||||
charge += damage*(0.5+level()*0.05);
|
||||
if (charge >= chargeCap){
|
||||
charge = 0;
|
||||
cooldown = 10+level;
|
||||
cooldown = 10+level();
|
||||
GLog.p("Your Cape begins radiating energy, you feel protected!");
|
||||
BuffIndicator.refreshHero();
|
||||
}
|
||||
|
@ -104,8 +103,8 @@ public class CapeOfThorns extends Artifact {
|
|||
|
||||
exp+= deflected;
|
||||
|
||||
if (exp >= (level+1)*5 && level < levelCap){
|
||||
exp -= (level+1)*5;
|
||||
if (exp >= (level()+1)*5 && level() < levelCap){
|
||||
exp -= (level()+1)*5;
|
||||
upgrade();
|
||||
GLog.p("Your Cape grows stronger!");
|
||||
}
|
||||
|
|
|
@ -52,7 +52,6 @@ public class ChaliceOfBlood extends Artifact {
|
|||
name = "Chalice of Blood";
|
||||
image = ItemSpriteSheet.ARTIFACT_CHALICE1;
|
||||
|
||||
level = 0;
|
||||
levelCap = 10;
|
||||
}
|
||||
|
||||
|
@ -61,7 +60,7 @@ public class ChaliceOfBlood extends Artifact {
|
|||
@Override
|
||||
public ArrayList<String> actions( Hero hero ) {
|
||||
ArrayList<String> actions = super.actions( hero );
|
||||
if (isEquipped( hero ) && level < levelCap && !cursed)
|
||||
if (isEquipped( hero ) && level() < levelCap && !cursed)
|
||||
actions.add(AC_PRICK);
|
||||
return actions;
|
||||
}
|
||||
|
@ -71,7 +70,7 @@ public class ChaliceOfBlood extends Artifact {
|
|||
super.execute(hero, action);
|
||||
if (action.equals(AC_PRICK)){
|
||||
|
||||
int damage = 3*(level*level);
|
||||
int damage = 3*(level()*level());
|
||||
|
||||
if (damage > hero.HP*0.75) {
|
||||
|
||||
|
@ -92,7 +91,7 @@ public class ChaliceOfBlood extends Artifact {
|
|||
}
|
||||
|
||||
private void prick(Hero hero){
|
||||
int damage = 3*(level*level);
|
||||
int damage = 3*(level()*level());
|
||||
|
||||
Earthroot.Armor armor = hero.buff(Earthroot.Armor.class);
|
||||
if (armor != null) {
|
||||
|
@ -133,9 +132,9 @@ public class ChaliceOfBlood extends Artifact {
|
|||
|
||||
@Override
|
||||
public Item upgrade() {
|
||||
if (level >= 6)
|
||||
if (level() >= 6)
|
||||
image = ItemSpriteSheet.ARTIFACT_CHALICE3;
|
||||
else if (level >= 2)
|
||||
else if (level() >= 2)
|
||||
image = ItemSpriteSheet.ARTIFACT_CHALICE2;
|
||||
return super.upgrade();
|
||||
}
|
||||
|
@ -148,7 +147,7 @@ public class ChaliceOfBlood extends Artifact {
|
|||
@Override
|
||||
public String desc() {
|
||||
String desc = "This shining silver chalice is oddly adorned with sharp gems at the rim. ";
|
||||
if (level < levelCap)
|
||||
if (level() < levelCap)
|
||||
desc += "The chalice is pulling your attention strangely, you feel like it wants something from you.";
|
||||
else
|
||||
desc += "The chalice is full and radiating energy.";
|
||||
|
@ -157,15 +156,15 @@ public class ChaliceOfBlood extends Artifact {
|
|||
desc += "\n\n";
|
||||
if (cursed)
|
||||
desc += "The cursed chalice has bound itself to your hand, and is slowly tugging at your life energy.";
|
||||
else if (level == 0)
|
||||
else if (level() == 0)
|
||||
desc += "As you hold the chalice, you feel oddly compelled to prick yourself on the sharp gems.";
|
||||
else if (level < 3)
|
||||
else if (level() < 3)
|
||||
desc += "Some of your blood is pooled into the chalice, you can subtly feel the chalice feeding life " +
|
||||
"energy into you. You still want to cut yourself on the chalice, even though you know it will hurt.";
|
||||
else if (level < 7)
|
||||
else if (level() < 7)
|
||||
desc += "The chalice is about half full of your blood and you can feel it feeding life energy " +
|
||||
"into you. you still want to hurt yourself, the chalice needs your energy, it's your friend.";
|
||||
else if (level < levelCap)
|
||||
else if (level() < levelCap)
|
||||
desc += "The chalice is getting pretty full, and the life force it's feeding you is stronger than " +
|
||||
"ever. You should give it more energy, you need too, your friend needs your energy, it needs " +
|
||||
"your help. Your friend knows you have limits though, it doesn't want you to die, just bleed.";
|
||||
|
|
|
@ -43,13 +43,12 @@ public class CloakOfShadows extends Artifact {
|
|||
name = "Cloak of Shadows";
|
||||
image = ItemSpriteSheet.ARTIFACT_CLOAK;
|
||||
|
||||
level = 0;
|
||||
exp = 0;
|
||||
levelCap = 15;
|
||||
|
||||
charge = level+5;
|
||||
charge = level()+5;
|
||||
partialCharge = 0;
|
||||
chargeCap = level+5;
|
||||
chargeCap = level()+5;
|
||||
|
||||
cooldown = 0;
|
||||
|
||||
|
@ -145,11 +144,11 @@ public class CloakOfShadows extends Artifact {
|
|||
String desc = "This light silken cloak shimmers in and out of your vision as it sways in the air. When worn, " +
|
||||
"it can be used to hide your presence for a short time.\n\n";
|
||||
|
||||
if (level < 5)
|
||||
if (level() < 5)
|
||||
desc += "The cloak's magic has faded and it is not very powerful, perhaps it will regain strength through use.";
|
||||
else if (level < 10)
|
||||
else if (level() < 10)
|
||||
desc += "The cloak's power has begun to return.";
|
||||
else if (level < 15)
|
||||
else if (level() < 15)
|
||||
desc += "The cloak has almost returned to full strength.";
|
||||
else
|
||||
desc += "The cloak is at full potential and will work for extended durations.";
|
||||
|
@ -239,9 +238,9 @@ public class CloakOfShadows extends Artifact {
|
|||
|
||||
if (turnsToCost == 0) exp += 10 + ((Hero)target).lvl;
|
||||
|
||||
if (exp >= (level+1)*50 && level < levelCap) {
|
||||
if (exp >= (level()+1)*50 && level() < levelCap) {
|
||||
upgrade();
|
||||
exp -= level*50;
|
||||
exp -= level()*50;
|
||||
GLog.p("Your cloak grows stronger!");
|
||||
}
|
||||
|
||||
|
@ -259,9 +258,9 @@ public class CloakOfShadows extends Artifact {
|
|||
|
||||
exp += 10 + ((Hero)target).lvl;
|
||||
|
||||
if (exp >= (level+1)*50 && level < levelCap) {
|
||||
if (exp >= (level()+1)*50 && level() < levelCap) {
|
||||
upgrade();
|
||||
exp -= level*50;
|
||||
exp -= level()*50;
|
||||
GLog.p("Your cloak grows stronger!");
|
||||
}
|
||||
|
||||
|
@ -295,7 +294,7 @@ public class CloakOfShadows extends Artifact {
|
|||
if (target.invisible > 0)
|
||||
target.invisible--;
|
||||
stealthed = false;
|
||||
cooldown = 10 - (level / 3);
|
||||
cooldown = 10 - (level() / 3);
|
||||
|
||||
updateQuickslot();
|
||||
super.detach();
|
||||
|
|
|
@ -55,7 +55,6 @@ public class DriedRose extends Artifact {
|
|||
name = "Dried Rose";
|
||||
image = ItemSpriteSheet.ARTIFACT_ROSE1;
|
||||
|
||||
level = 0;
|
||||
levelCap = 10;
|
||||
|
||||
charge = 100;
|
||||
|
@ -103,7 +102,7 @@ public class DriedRose extends Artifact {
|
|||
}
|
||||
|
||||
if (spawnPoints.size() > 0) {
|
||||
GhostHero ghost = new GhostHero( level );
|
||||
GhostHero ghost = new GhostHero( level() );
|
||||
ghost.pos = Random.element(spawnPoints);
|
||||
|
||||
GameScene.add(ghost, 1f);
|
||||
|
@ -144,10 +143,10 @@ public class DriedRose extends Artifact {
|
|||
if (!cursed){
|
||||
desc += "\n\nThe rose rests in your hand, it feels strangely warm.";
|
||||
|
||||
if (level < 5)
|
||||
if (level() < 5)
|
||||
desc+= "\n\nThe rose has lost most of its petals. It feels extremely frail, like it " +
|
||||
"could snap any moment.";
|
||||
else if (level < 10)
|
||||
else if (level() < 10)
|
||||
desc+= "\n\nYou have reattached many petals and the rose has started to somehow come back to life."+
|
||||
" It almost looks like it's ready to bloom.";
|
||||
else
|
||||
|
@ -167,13 +166,13 @@ public class DriedRose extends Artifact {
|
|||
|
||||
@Override
|
||||
public Item upgrade() {
|
||||
if (level >= 9)
|
||||
if (level() >= 9)
|
||||
image = ItemSpriteSheet.ARTIFACT_ROSE3;
|
||||
else if (level >= 4)
|
||||
else if (level() >= 4)
|
||||
image = ItemSpriteSheet.ARTIFACT_ROSE2;
|
||||
|
||||
//For upgrade transferring via well of transmutation
|
||||
droppedPetals = Math.max( level, droppedPetals );
|
||||
droppedPetals = Math.max( level(), droppedPetals );
|
||||
|
||||
return super.upgrade();
|
||||
}
|
||||
|
@ -261,13 +260,13 @@ public class DriedRose extends Artifact {
|
|||
if (rose == null){
|
||||
GLog.w("You have no rose to add this petal to.");
|
||||
return false;
|
||||
} if ( rose.level >= rose.levelCap ){
|
||||
} if ( rose.level() >= rose.levelCap ){
|
||||
GLog.i("There is no room left for this petal, so you discard it.");
|
||||
return true;
|
||||
} else {
|
||||
|
||||
rose.upgrade();
|
||||
if (rose.level == rose.levelCap) {
|
||||
if (rose.level() == rose.levelCap) {
|
||||
GLog.p("The rose is completed!");
|
||||
Sample.INSTANCE.play( Assets.SND_GHOST );
|
||||
GLog.n("sad ghost: \"Thank you...\"");
|
||||
|
|
|
@ -49,7 +49,6 @@ public class EtherealChains extends Artifact {
|
|||
name = "ethereal chains";
|
||||
image = ItemSpriteSheet.ARTIFACT_CHAINS;
|
||||
|
||||
level = 0;
|
||||
levelCap = 5;
|
||||
exp = 0;
|
||||
|
||||
|
@ -207,7 +206,7 @@ public class EtherealChains extends Artifact {
|
|||
|
||||
@Override
|
||||
public boolean act() {
|
||||
int chargeTarget = 5+(level*2);
|
||||
int chargeTarget = 5+(level()*2);
|
||||
LockedFloor lock = target.buff(LockedFloor.class);
|
||||
if (charge < chargeTarget && !cursed && (lock == null || lock.regenOn())) {
|
||||
partialCharge += 1 / (40f - (chargeTarget - charge)*2f);
|
||||
|
@ -233,13 +232,13 @@ public class EtherealChains extends Artifact {
|
|||
exp += Math.round(levelPortion*100);
|
||||
|
||||
//past the soft charge cap, gaining charge from leveling is slowed.
|
||||
if (charge > 5+(level*2)){
|
||||
levelPortion *= (5+((float)level*2))/charge;
|
||||
if (charge > 5+(level()*2)){
|
||||
levelPortion *= (5+((float)level()*2))/charge;
|
||||
}
|
||||
partialCharge += levelPortion*10f;
|
||||
|
||||
if (exp > 100+level*50 && level < levelCap){
|
||||
exp -= 100+level*50;
|
||||
if (exp > 100+level()*50 && level() < levelCap){
|
||||
exp -= 100+level()*50;
|
||||
GLog.p("Your chains grow stronger!");
|
||||
upgrade();
|
||||
}
|
||||
|
|
|
@ -49,7 +49,6 @@ public class HornOfPlenty extends Artifact {
|
|||
name = "Horn of Plenty";
|
||||
image = ItemSpriteSheet.ARTIFACT_HORN1;
|
||||
|
||||
level = 0;
|
||||
levelCap = 30;
|
||||
|
||||
charge = 0;
|
||||
|
@ -74,7 +73,7 @@ public class HornOfPlenty extends Artifact {
|
|||
ArrayList<String> actions = super.actions( hero );
|
||||
if (isEquipped( hero ) && charge > 0)
|
||||
actions.add(AC_EAT);
|
||||
if (isEquipped( hero ) && level < 30 && !cursed)
|
||||
if (isEquipped( hero ) && level() < 30 && !cursed)
|
||||
actions.add(AC_STORE);
|
||||
return actions;
|
||||
}
|
||||
|
@ -158,7 +157,7 @@ public class HornOfPlenty extends Artifact {
|
|||
if (!cursed) {
|
||||
desc += "\n\nThe horn rests at your side and is surprisingly lightweight, even with food in it.";
|
||||
|
||||
if (level < 15)
|
||||
if (level() < 15)
|
||||
desc += " Perhaps there is a way to increase the horn's power by giving it food energy.";
|
||||
} else {
|
||||
desc += "\n\nThe cursed horn has bound itself to your side, " +
|
||||
|
@ -178,7 +177,7 @@ public class HornOfPlenty extends Artifact {
|
|||
|
||||
//generates 0.25 food value every round, +0.015 value per level
|
||||
//to a max of 0.70 food value per round (0.25+0.5, at level 30)
|
||||
partialCharge += 0.25f + (0.015f*level);
|
||||
partialCharge += 0.25f + (0.015f*level());
|
||||
|
||||
//charge is in increments of 36 food value.
|
||||
if (partialCharge >= 36) {
|
||||
|
@ -224,8 +223,8 @@ public class HornOfPlenty extends Artifact {
|
|||
hero.spend( TIME_TO_EAT );
|
||||
|
||||
curItem.upgrade(((Food)item).hornValue);
|
||||
if (curItem.level >= 30){
|
||||
curItem.level = 30;
|
||||
if (curItem.level() >= 30){
|
||||
curItem.level(30);
|
||||
GLog.p("your horn has consumed all the food it can!");
|
||||
} else
|
||||
GLog.p("the horn consumes your food offering and grows in strength!");
|
||||
|
|
|
@ -86,11 +86,10 @@ public class LloydsBeacon extends Artifact {
|
|||
name = "lloyd's beacon";
|
||||
image = ItemSpriteSheet.ARTIFACT_BEACON;
|
||||
|
||||
level = 0;
|
||||
levelCap = 3;
|
||||
|
||||
charge = 0;
|
||||
chargeCap = 3+level;
|
||||
chargeCap = 3+level();
|
||||
|
||||
defaultAction = AC_ZAP;
|
||||
usesTargeting = true;
|
||||
|
|
|
@ -30,7 +30,6 @@ public class MasterThievesArmband extends Artifact {
|
|||
name = "Master Thieves' Armband";
|
||||
image = ItemSpriteSheet.ARTIFACT_ARMBAND;
|
||||
|
||||
level = 0;
|
||||
levelCap = 10;
|
||||
|
||||
charge = 0;
|
||||
|
@ -84,7 +83,7 @@ public class MasterThievesArmband extends Artifact {
|
|||
exp += value;
|
||||
}
|
||||
}
|
||||
while(exp >= 600 && level < levelCap) {
|
||||
while(exp >= 600 && level() < levelCap) {
|
||||
exp -= 600;
|
||||
upgrade();
|
||||
}
|
||||
|
@ -93,7 +92,7 @@ public class MasterThievesArmband extends Artifact {
|
|||
|
||||
public float stealChance(int value){
|
||||
//get lvl*100 gold or lvl*5% item value of free charge, whichever is less.
|
||||
int chargeBonus = Math.min(level*100, (value*level)/20);
|
||||
int chargeBonus = Math.min(level()*100, (value*level())/20);
|
||||
|
||||
return (((float)charge + chargeBonus)/value);
|
||||
}
|
||||
|
|
|
@ -47,7 +47,6 @@ public class SandalsOfNature extends Artifact {
|
|||
name = "Sandals of Nature";
|
||||
image = ItemSpriteSheet.ARTIFACT_SANDALS;
|
||||
|
||||
level = 0;
|
||||
levelCap = 3;
|
||||
|
||||
charge = 0;
|
||||
|
@ -69,7 +68,7 @@ public class SandalsOfNature extends Artifact {
|
|||
@Override
|
||||
public ArrayList<String> actions( Hero hero ) {
|
||||
ArrayList<String> actions = super.actions( hero );
|
||||
if (isEquipped( hero ) && level < 3 && !cursed)
|
||||
if (isEquipped( hero ) && level() < 3 && !cursed)
|
||||
actions.add(AC_FEED);
|
||||
if (isEquipped( hero ) && charge > 0)
|
||||
actions.add(AC_ROOT);
|
||||
|
@ -81,7 +80,7 @@ public class SandalsOfNature extends Artifact {
|
|||
super.execute(hero, action);
|
||||
if (action.equals(AC_FEED)){
|
||||
GameScene.selectItem(itemSelector, mode, inventoryTitle);
|
||||
} else if (action.equals(AC_ROOT) && level > 0){
|
||||
} else if (action.equals(AC_ROOT) && level() > 0){
|
||||
|
||||
if (!isEquipped( hero )) GLog.i("You need to equip them to do that.");
|
||||
else if (charge == 0) GLog.i("They have no energy right now.");
|
||||
|
@ -104,13 +103,13 @@ public class SandalsOfNature extends Artifact {
|
|||
@Override
|
||||
public String desc() {
|
||||
String desc = "";
|
||||
if (level == 0)
|
||||
if (level() == 0)
|
||||
desc += "What initially seem like sandals made of twine are actually two plants! The footwear moves ever " +
|
||||
"so slightly when being held. They seem very weak and pale, perhaps they need to be given nutrients?";
|
||||
else if (level == 1)
|
||||
else if (level() == 1)
|
||||
desc += "The footwear has grown and now more closely resemble two tailored shoes. They seem to match the " +
|
||||
"contours of your feet exactly. Some colour has returned to them, perhaps they can still grow further?";
|
||||
else if (level == 2)
|
||||
else if (level() == 2)
|
||||
desc += "The plants have grown again and now resembles a pair of solid tall boots. They appear to be made" +
|
||||
" of solid bark more than vine now, yet are still very flexible. The plants seem to have " +
|
||||
"regained their strength, but perhaps they can still grow further";
|
||||
|
@ -121,15 +120,15 @@ public class SandalsOfNature extends Artifact {
|
|||
|
||||
if ( isEquipped ( Dungeon.hero ) ){
|
||||
desc += "\n\n";
|
||||
if (level == 0) {
|
||||
if (level() == 0) {
|
||||
if (!cursed)
|
||||
desc += "The sandals wrap snugly around your feet, they seem happy to be worn.";
|
||||
else
|
||||
desc += "The cursed sandals wrap tightly around your feet.";
|
||||
}
|
||||
else if (level == 1)
|
||||
else if (level() == 1)
|
||||
desc += "The shoes fit on loosely but quickly tighten to make a perfect fit.";
|
||||
else if (level == 2)
|
||||
else if (level() == 2)
|
||||
desc += "The boots fit snugly and add a nice heft to your step.";
|
||||
else
|
||||
desc += "The greaves are thick and weighty, but very easy to move in, as if they are moving with you.";
|
||||
|
@ -139,7 +138,7 @@ public class SandalsOfNature extends Artifact {
|
|||
else
|
||||
desc += " They are blocking any attunement with nature.";
|
||||
|
||||
if (level > 0)
|
||||
if (level() > 0)
|
||||
desc += "\n\nThe footwear has gained the ability to form up into a sort of immobile natural armour, " +
|
||||
"but will need to charge up for it.";
|
||||
}
|
||||
|
@ -159,15 +158,15 @@ public class SandalsOfNature extends Artifact {
|
|||
|
||||
@Override
|
||||
public Item upgrade() {
|
||||
if (level < 0)
|
||||
if (level() < 0)
|
||||
image = ItemSpriteSheet.ARTIFACT_SANDALS;
|
||||
else if (level == 0)
|
||||
else if (level() == 0)
|
||||
image = ItemSpriteSheet.ARTIFACT_SHOES;
|
||||
else if (level == 1)
|
||||
else if (level() == 1)
|
||||
image = ItemSpriteSheet.ARTIFACT_BOOTS;
|
||||
else if (level >= 2)
|
||||
else if (level() >= 2)
|
||||
image = ItemSpriteSheet.ARTIFACT_GREAVES;
|
||||
name = NAMES[level+1];
|
||||
name = NAMES[level()+1];
|
||||
return super.upgrade();
|
||||
}
|
||||
|
||||
|
@ -194,7 +193,7 @@ public class SandalsOfNature extends Artifact {
|
|||
public void charge() {
|
||||
if (charge < target.HT){
|
||||
//gain 1+(1*level)% of the difference between current charge and max HP.
|
||||
charge+= (Math.round( (target.HT-charge) * (.01+ level*0.01) ));
|
||||
charge+= (Math.round( (target.HT-charge) * (.01+ level()*0.01) ));
|
||||
updateQuickslot();
|
||||
}
|
||||
}
|
||||
|
@ -214,11 +213,11 @@ public class SandalsOfNature extends Artifact {
|
|||
Sample.INSTANCE.play( Assets.SND_PLANT );
|
||||
hero.busy();
|
||||
hero.spend( 2f );
|
||||
if (seeds.size() >= 5+(level*2)){
|
||||
if (seeds.size() >= 5+(level()*2)){
|
||||
seeds.clear();
|
||||
upgrade();
|
||||
if (level >= 1 && level <= 3) {
|
||||
GLog.p("Your " + NAMES[level-1] + " surge in size, they are now " + NAMES[level] + "!");
|
||||
if (level() >= 1 && level() <= 3) {
|
||||
GLog.p("Your " + NAMES[level()-1] + " surge in size, they are now " + NAMES[level()] + "!");
|
||||
}
|
||||
|
||||
} else {
|
||||
|
|
|
@ -42,7 +42,6 @@ public class TalismanOfForesight extends Artifact {
|
|||
name = "Talisman of Foresight";
|
||||
image = ItemSpriteSheet.ARTIFACT_TALISMAN;
|
||||
|
||||
level = 0;
|
||||
exp = 0;
|
||||
levelCap = 10;
|
||||
|
||||
|
@ -175,7 +174,7 @@ public class TalismanOfForesight extends Artifact {
|
|||
//fully charges in 2500 turns at lvl=0, scaling to 1000 turns at lvl = 10.
|
||||
LockedFloor lock = target.buff(LockedFloor.class);
|
||||
if (charge < chargeCap && !cursed && (lock == null || lock.regenOn())) {
|
||||
partialCharge += 0.04+(level*0.006);
|
||||
partialCharge += 0.04+(level()*0.006);
|
||||
|
||||
if (partialCharge > 1 && charge < chargeCap) {
|
||||
partialCharge--;
|
||||
|
@ -190,9 +189,9 @@ public class TalismanOfForesight extends Artifact {
|
|||
}
|
||||
|
||||
public void charge(){
|
||||
charge = Math.min(charge+(2+(level/3)), chargeCap);
|
||||
charge = Math.min(charge+(2+(level()/3)), chargeCap);
|
||||
exp++;
|
||||
if (exp >= 4 && level < levelCap) {
|
||||
if (exp >= 4 && level() < levelCap) {
|
||||
upgrade();
|
||||
GLog.p("Your Talisman grows stronger!");
|
||||
exp -= 4;
|
||||
|
|
|
@ -53,12 +53,11 @@ public class TimekeepersHourglass extends Artifact {
|
|||
name = "Timekeeper's Hourglass";
|
||||
image = ItemSpriteSheet.ARTIFACT_HOURGLASS;
|
||||
|
||||
level = 0;
|
||||
levelCap = 5;
|
||||
|
||||
charge = 10+level*2;
|
||||
charge = 10+level()*2;
|
||||
partialCharge = 0;
|
||||
chargeCap = 10+level*2;
|
||||
chargeCap = 10+level()*2;
|
||||
|
||||
defaultAction = AC_ACTIVATE;
|
||||
}
|
||||
|
@ -139,7 +138,7 @@ public class TimekeepersHourglass extends Artifact {
|
|||
chargeCap+= 2;
|
||||
|
||||
//for artifact transmutation.
|
||||
while (level+1 > sandBags)
|
||||
while (level()+1 > sandBags)
|
||||
sandBags ++;
|
||||
|
||||
return super.upgrade();
|
||||
|
@ -156,7 +155,7 @@ public class TimekeepersHourglass extends Artifact {
|
|||
if (!cursed) {
|
||||
desc += "\n\nThe hourglass rests at your side, the whisper of steadily pouring sand is reassuring.";
|
||||
|
||||
if (level < levelCap )
|
||||
if (level() < levelCap )
|
||||
desc +=
|
||||
"\n\nThe hourglass seems to have lost some sand with age. While there are no cracks, " +
|
||||
"there is a port on the top of the hourglass to pour sand in, if only you could find some...";
|
||||
|
@ -363,7 +362,7 @@ public class TimekeepersHourglass extends Artifact {
|
|||
if (hourglass != null && !hourglass.cursed) {
|
||||
hourglass.upgrade();
|
||||
Sample.INSTANCE.play( Assets.SND_DEWDROP );
|
||||
if (hourglass.level == hourglass.levelCap)
|
||||
if (hourglass.level() == hourglass.levelCap)
|
||||
GLog.p("Your hourglass is filled with magical sand!");
|
||||
else
|
||||
GLog.i("you add the sand to your hourglass.");
|
||||
|
|
|
@ -49,12 +49,11 @@ public class UnstableSpellbook extends Artifact {
|
|||
name = "Unstable Spellbook";
|
||||
image = ItemSpriteSheet.ARTIFACT_SPELLBOOK;
|
||||
|
||||
level = 0;
|
||||
levelCap = 10;
|
||||
|
||||
charge = ((level/2)+3);
|
||||
charge = ((level()/2)+3);
|
||||
partialCharge = 0;
|
||||
chargeCap = ((level/2)+3);
|
||||
chargeCap = ((level()/2)+3);
|
||||
|
||||
defaultAction = AC_READ;
|
||||
}
|
||||
|
@ -87,7 +86,7 @@ public class UnstableSpellbook extends Artifact {
|
|||
ArrayList<String> actions = super.actions( hero );
|
||||
if (isEquipped( hero ) && charge > 0 && !cursed)
|
||||
actions.add(AC_READ);
|
||||
if (isEquipped( hero ) && level < levelCap && !cursed)
|
||||
if (isEquipped( hero ) && level() < levelCap && !cursed)
|
||||
actions.add(AC_ADD);
|
||||
return actions;
|
||||
}
|
||||
|
@ -129,10 +128,10 @@ public class UnstableSpellbook extends Artifact {
|
|||
|
||||
@Override
|
||||
public Item upgrade() {
|
||||
chargeCap = (((level+1)/2)+3);
|
||||
chargeCap = (((level()+1)/2)+3);
|
||||
|
||||
//for artifact transmutation.
|
||||
while (scrolls.size() > (levelCap-1-level))
|
||||
while (scrolls.size() > (levelCap-1-level()))
|
||||
scrolls.remove(0);
|
||||
|
||||
return super.upgrade();
|
||||
|
@ -142,9 +141,9 @@ public class UnstableSpellbook extends Artifact {
|
|||
public String desc() {
|
||||
String desc = "This Tome is in surprising good condition given its age. ";
|
||||
|
||||
if (level < 3)
|
||||
if (level() < 3)
|
||||
desc += "It emanates a strange chaotic energy. ";
|
||||
else if (level < 7)
|
||||
else if (level() < 7)
|
||||
desc += "It glows with a strange chaotic energy. ";
|
||||
else
|
||||
desc += "It fizzes and crackles as you move the pages, surging with unstable energy. ";
|
||||
|
@ -165,7 +164,7 @@ public class UnstableSpellbook extends Artifact {
|
|||
|
||||
}
|
||||
|
||||
if (level < levelCap)
|
||||
if (level() < levelCap)
|
||||
if (scrolls.size() > 1)
|
||||
desc += "The book's index points to some pages which are blank. " +
|
||||
"Those pages are listed as: " + scrolls.get(0) + " and "
|
||||
|
|
|
@ -61,12 +61,20 @@ public class Pickaxe extends Weapon {
|
|||
defaultAction = AC_MINE;
|
||||
|
||||
STR = 14;
|
||||
MIN = 3;
|
||||
MAX = 12;
|
||||
}
|
||||
|
||||
public boolean bloodStained = false;
|
||||
|
||||
@Override
|
||||
public int min() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int max() {
|
||||
return 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> actions( Hero hero ) {
|
||||
ArrayList<String> actions = super.actions( hero );
|
||||
|
|
|
@ -283,10 +283,10 @@ public class Ring extends KindofMisc {
|
|||
}
|
||||
|
||||
if (Random.Float() < 0.3f) {
|
||||
level = -n;
|
||||
level(-n);
|
||||
cursed = true;
|
||||
} else
|
||||
level = n;
|
||||
level(n);
|
||||
|
||||
return this;
|
||||
}
|
||||
|
@ -302,10 +302,10 @@ public class Ring extends KindofMisc {
|
|||
price /= 2;
|
||||
}
|
||||
if (levelKnown) {
|
||||
if (level > 0) {
|
||||
price *= (level + 1);
|
||||
} else if (level < 0) {
|
||||
price /= (1 - level);
|
||||
if (level() > 0) {
|
||||
price *= (level() + 1);
|
||||
} else if (level() < 0) {
|
||||
price /= (1 - level());
|
||||
}
|
||||
}
|
||||
if (price < 1) {
|
||||
|
@ -340,7 +340,7 @@ public class Ring extends KindofMisc {
|
|||
|
||||
public int level;
|
||||
public RingBuff() {
|
||||
level = Ring.this.level;
|
||||
level = Ring.this.level();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -43,7 +43,7 @@ public class RingOfForce extends Ring {
|
|||
"When unarmed, at your current strength, ";
|
||||
int str = Dungeon.hero.STR() - 8;
|
||||
desc += levelKnown ?
|
||||
"average damage with this ring is " + (str/2+level + (int)(str*0.5f*level) + str*2)/2 + " points per hit.":
|
||||
"average damage with this ring is " + (str/2+level() + (int)(str*0.5f*level()) + str*2)/2 + " points per hit.":
|
||||
"typical average damage with this ring is" + (str/2+1 + (int)(str*0.5f) + str*2)/2 + " points per hit.";
|
||||
desc += " Wearing a second ring of force would enhance this.";
|
||||
return desc;
|
||||
|
|
|
@ -79,7 +79,7 @@ public abstract class InventoryScroll extends Scroll {
|
|||
if (item != null) {
|
||||
|
||||
((InventoryScroll)curItem).onItemSelected( item );
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
((InventoryScroll)curItem).readAnimation();
|
||||
|
||||
Sample.INSTANCE.play( Assets.SND_READ );
|
||||
Invisibility.dispel();
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.ItemStatusHandler;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.UnstableSpellbook;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
@ -144,6 +145,12 @@ public abstract class Scroll extends Item {
|
|||
|
||||
abstract protected void doRead();
|
||||
|
||||
protected void readAnimation() {
|
||||
curUser.spend( TIME_TO_READ );
|
||||
curUser.busy();
|
||||
((HeroSprite)curUser.sprite).read();
|
||||
}
|
||||
|
||||
public boolean isKnown() {
|
||||
return handler.isKnown( this );
|
||||
}
|
||||
|
|
|
@ -58,7 +58,7 @@ public class ScrollOfLullaby extends Scroll {
|
|||
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -84,7 +84,7 @@ public class ScrollOfMagicMapping extends Scroll {
|
|||
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -22,6 +22,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.scrolls;
|
|||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Enchanting;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
|
@ -57,6 +58,7 @@ public class ScrollOfMagicalInfusion extends InventoryScroll {
|
|||
Badges.validateItemLevelAquired(item);
|
||||
|
||||
curUser.sprite.emitter().start(Speck.factory(Speck.UP), 0.2f, 3);
|
||||
Enchanting.show(curUser, item);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -72,7 +72,7 @@ public class ScrollOfMirrorImage extends Scroll {
|
|||
Sample.INSTANCE.play( Assets.SND_READ );
|
||||
Invisibility.dispel();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -65,7 +65,7 @@ public class ScrollOfPsionicBlast extends Scroll {
|
|||
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
curUser.spendAndNext( TIME_TO_READ ); //no animation here, the flash interrupts it anyway.
|
||||
|
||||
if (!curUser.isAlive()) {
|
||||
Dungeon.fail( Utils.format(ResultDescriptions.ITEM, name ));
|
||||
|
|
|
@ -67,7 +67,7 @@ public class ScrollOfRage extends Scroll {
|
|||
Sample.INSTANCE.play( Assets.SND_CHALLENGE );
|
||||
Invisibility.dispel();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -53,7 +53,7 @@ public class ScrollOfRecharging extends Scroll {
|
|||
SpellSprite.show( curUser, SpellSprite.CHARGE );
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -67,7 +67,7 @@ public class ScrollOfRemoveCurse extends Scroll {
|
|||
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -52,7 +52,7 @@ public class ScrollOfTeleportation extends Scroll {
|
|||
teleportHero( curUser );
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
public static void teleportHero( Hero hero ) {
|
||||
|
|
|
@ -70,7 +70,7 @@ public class ScrollOfTerror extends Scroll {
|
|||
}
|
||||
setKnown();
|
||||
|
||||
curUser.spendAndNext( TIME_TO_READ );
|
||||
readAnimation();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -389,7 +389,7 @@ public class CursedWand {
|
|||
do {
|
||||
reward = Generator.random(Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR,
|
||||
Generator.Category.RING, Generator.Category.WAND));
|
||||
} while (reward.level < 2 && !(reward instanceof MissileWeapon));
|
||||
} while (reward.level() < 2 && !(reward instanceof MissileWeapon));
|
||||
Sample.INSTANCE.play(Assets.SND_MIMIC, 1, 1, 0.5f);
|
||||
mimic.items.clear();
|
||||
mimic.items.add(reward);
|
||||
|
@ -426,7 +426,7 @@ public class CursedWand {
|
|||
do {
|
||||
result = Generator.random(Random.oneOf(Generator.Category.WEAPON, Generator.Category.ARMOR,
|
||||
Generator.Category.RING, Generator.Category.ARTIFACT));
|
||||
} while (result.level < 0 && !(result instanceof MissileWeapon));
|
||||
} while (result.level() < 0 && !(result instanceof MissileWeapon));
|
||||
if (result.isUpgradable()) result.upgrade();
|
||||
result.cursed = result.cursedKnown = true;
|
||||
GLog.w("your wand transmogrifies into a different item!");
|
||||
|
|
|
@ -56,10 +56,6 @@ public abstract class Wand extends Item {
|
|||
|
||||
public static final String AC_ZAP = "ZAP";
|
||||
|
||||
private static final String TXT_WOOD = "This thin %s wand is warm to the touch. Who knows what it will do when used?";
|
||||
private static final String TXT_DAMAGE = "When this wand is used as a melee weapon, its average damage is %d points per hit.";
|
||||
private static final String TXT_WEAPON = "You can use this wand as a melee weapon.";
|
||||
|
||||
private static final String TXT_FIZZLES = "your wand fizzles; it must not have enough charge.";
|
||||
private static final String TXT_SELF_TARGET = "You can't target yourself";
|
||||
|
||||
|
@ -79,7 +75,6 @@ public abstract class Wand extends Item {
|
|||
|
||||
protected int collisionProperties = Ballistica.MAGIC_BOLT;
|
||||
|
||||
|
||||
{
|
||||
defaultAction = AC_ZAP;
|
||||
usesTargeting = true;
|
||||
|
@ -139,7 +134,7 @@ public abstract class Wand extends Item {
|
|||
protected void processSoulMark(Char target, int chargesUsed){
|
||||
if (target != Dungeon.hero &&
|
||||
Dungeon.hero.subClass == HeroSubClass.WARLOCK &&
|
||||
Random.Float() < .15f + (level*chargesUsed*0.03f)){
|
||||
Random.Float() < .15f + (level()*chargesUsed*0.03f)){
|
||||
SoulMark.prolong(target, SoulMark.class, SoulMark.DURATION);
|
||||
}
|
||||
}
|
||||
|
@ -156,13 +151,9 @@ public abstract class Wand extends Item {
|
|||
}
|
||||
}
|
||||
|
||||
public int level() {
|
||||
if (charger != null) {
|
||||
Magic magic = charger.target.buff( Magic.class );
|
||||
return magic == null ? level : Math.max( level + magic.level, 0 );
|
||||
} else {
|
||||
return level;
|
||||
}
|
||||
public void level( int value) {
|
||||
super.level( value );
|
||||
updateLevel();
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -233,7 +224,7 @@ public abstract class Wand extends Item {
|
|||
}
|
||||
|
||||
public void updateLevel() {
|
||||
maxCharges = Math.min( initialCharges() + level, 10 );
|
||||
maxCharges = Math.min( initialCharges() + level(), 10 );
|
||||
curCharges = Math.min( curCharges, maxCharges );
|
||||
}
|
||||
|
||||
|
@ -299,10 +290,10 @@ public abstract class Wand extends Item {
|
|||
price /= 2;
|
||||
}
|
||||
if (levelKnown) {
|
||||
if (level > 0) {
|
||||
price *= (level + 1);
|
||||
} else if (level < 0) {
|
||||
price /= (1 - level);
|
||||
if (level() > 0) {
|
||||
price *= (level() + 1);
|
||||
} else if (level() < 0) {
|
||||
price /= (1 - level());
|
||||
}
|
||||
}
|
||||
if (price < 1) {
|
||||
|
|
|
@ -63,7 +63,7 @@ public class WandOfBlastWave extends Wand {
|
|||
Sample.INSTANCE.play( Assets.SND_BLAST );
|
||||
BlastWave.blast(bolt.collisionPos);
|
||||
|
||||
int damage = Random.NormalIntRange(1, 6+(int)(level*level/4f));
|
||||
int damage = Random.NormalIntRange(1, 6+(int)(level()*level()/4f));
|
||||
|
||||
//presses all tiles in the AOE first
|
||||
for (int i : Level.NEIGHBOURS9){
|
||||
|
@ -80,7 +80,7 @@ public class WandOfBlastWave extends Wand {
|
|||
|
||||
if (ch.isAlive()) {
|
||||
Ballistica trajectory = new Ballistica(ch.pos, ch.pos + i, Ballistica.MAGIC_BOLT);
|
||||
int strength = 1 + ((level + 1) / 3);
|
||||
int strength = 1 + ((level() + 1) / 3);
|
||||
throwChar(ch, trajectory, strength);
|
||||
}
|
||||
}
|
||||
|
@ -94,7 +94,7 @@ public class WandOfBlastWave extends Wand {
|
|||
|
||||
if (ch.isAlive() && bolt.path.size() > bolt.dist+1) {
|
||||
Ballistica trajectory = new Ballistica(ch.pos, bolt.path.get(bolt.dist + 1), Ballistica.MAGIC_BOLT);
|
||||
int strength = level + 3;
|
||||
int strength = level() + 3;
|
||||
throwChar(ch, trajectory, strength);
|
||||
}
|
||||
}
|
||||
|
@ -139,7 +139,7 @@ public class WandOfBlastWave extends Wand {
|
|||
@Override
|
||||
//a weaker knockback, not dissimilar to the glyph of bounce, but a fair bit stronger.
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
int level = Math.max(0, staff.level);
|
||||
int level = Math.max(0, staff.level());
|
||||
|
||||
// lvl 0 - 25%
|
||||
// lvl 1 - 40%
|
||||
|
|
|
@ -76,7 +76,7 @@ public class WandOfCorruption extends Wand {
|
|||
return;
|
||||
}
|
||||
|
||||
int basePower = 10 + 2*level;
|
||||
int basePower = 10 + 2*level();
|
||||
int mobPower = Random.IntRange(0, ch.HT) + ch.HP*2;
|
||||
for ( Buff buff : ch.buffs()){
|
||||
if (buff.type == Buff.buffType.NEGATIVE){
|
||||
|
@ -89,7 +89,7 @@ public class WandOfCorruption extends Wand {
|
|||
//try to use extra charges to overpower the mob
|
||||
while (basePower <= mobPower){
|
||||
extraCharges++;
|
||||
basePower += 5 + level;
|
||||
basePower += 5 + level();
|
||||
}
|
||||
|
||||
//if we fail, lose all charges, remember we have 1 left to lose from using the wand.
|
||||
|
@ -114,8 +114,8 @@ public class WandOfCorruption extends Wand {
|
|||
// lvl 0 - 25%
|
||||
// lvl 1 - 40%
|
||||
// lvl 2 - 50%
|
||||
if (Random.Int( level + 4 ) >= 3){
|
||||
Buff.prolong( defender, Amok.class, 3+level);
|
||||
if (Random.Int( level() + 4 ) >= 3){
|
||||
Buff.prolong( defender, Amok.class, 3+level());
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -75,7 +75,7 @@ public class WandOfDisintegration extends Wand {
|
|||
|
||||
if (Level.flamable[c]) {
|
||||
|
||||
Level.set( c, Terrain.EMBERS );
|
||||
Dungeon.level.destroy( c );
|
||||
GameScene.updateMap( c );
|
||||
terrainAffected = true;
|
||||
|
||||
|
|
|
@ -68,7 +68,7 @@ public class WandOfFireblast extends Wand {
|
|||
Char ch = Actor.findChar( cell );
|
||||
if (ch != null) {
|
||||
|
||||
ch.damage(Random.NormalIntRange(1, (int) (8 + (level * level * (1 + chargesPerCast()) / 6f))), this);
|
||||
ch.damage(Random.NormalIntRange(1, (int) (8 + (level() * level() * (1 + chargesPerCast()) / 6f))), this);
|
||||
Buff.affect( ch, Burning.class ).reignite( ch );
|
||||
switch(chargesPerCast()){
|
||||
case 1:
|
||||
|
|
|
@ -57,7 +57,7 @@ public class WandOfFrost extends Wand {
|
|||
Char ch = Actor.findChar(bolt.collisionPos);
|
||||
if (ch != null){
|
||||
|
||||
int damage = Random.NormalIntRange(5+level, 10+(level*level/3));
|
||||
int damage = Random.NormalIntRange(5+level(), 10+(level()*level()/3));
|
||||
|
||||
if (ch.buff(Frost.class) != null){
|
||||
return; //do nothing, can't affect a frozen target
|
||||
|
@ -65,7 +65,7 @@ public class WandOfFrost extends Wand {
|
|||
if (ch.buff(Chill.class) != null){
|
||||
damage = Math.round(damage * ch.buff(Chill.class).speedFactor());
|
||||
} else {
|
||||
ch.sprite.burst( 0xFF99CCFF, level / 2 + 2 );
|
||||
ch.sprite.burst( 0xFF99CCFF, level() / 2 + 2 );
|
||||
}
|
||||
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
|
@ -74,12 +74,12 @@ public class WandOfFrost extends Wand {
|
|||
if (ch.isAlive()){
|
||||
if (Level.water[ch.pos]){
|
||||
//20+(10*level)% chance
|
||||
if (Random.Int(10) >= 8-level )
|
||||
if (Random.Int(10) >= 8-level() )
|
||||
Buff.affect(ch, Frost.class, Frost.duration(ch)*Random.Float(2f, 4f));
|
||||
else
|
||||
Buff.prolong(ch, Chill.class, 6+level);
|
||||
Buff.prolong(ch, Chill.class, 6+level());
|
||||
} else {
|
||||
Buff.prolong(ch, Chill.class, 4+level);
|
||||
Buff.prolong(ch, Chill.class, 4+level());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
@ -60,8 +60,8 @@ public class WandOfLightning extends Wand {
|
|||
float multipler = 0.4f + (0.6f/affected.size());
|
||||
if (Level.water[bolt.collisionPos]) multipler *= 1.5f;
|
||||
|
||||
int min = 5+level;
|
||||
int max = Math.round(10 + (level * level / 4f));
|
||||
int min = 5+level();
|
||||
int max = Math.round(10 + (level() * level() / 4f));
|
||||
|
||||
for (Char ch : affected){
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
|
|
|
@ -43,12 +43,10 @@ public class WandOfMagicMissile extends Wand {
|
|||
Char ch = Actor.findChar( bolt.collisionPos );
|
||||
if (ch != null) {
|
||||
|
||||
int level = level();
|
||||
|
||||
processSoulMark(ch, chargesPerCast());
|
||||
ch.damage(Random.NormalIntRange(4 , 6 + level * 2), this);
|
||||
ch.damage(Random.NormalIntRange(4 , 6 + level() * 2), this);
|
||||
|
||||
ch.sprite.burst(0xFFFFFFFF, level / 2 + 2);
|
||||
ch.sprite.burst(0xFFFFFFFF, level() / 2 + 2);
|
||||
|
||||
}
|
||||
}
|
||||
|
@ -56,8 +54,8 @@ public class WandOfMagicMissile extends Wand {
|
|||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//gain 1 turn of recharging buff per level of the wand.
|
||||
if (level > 0) {
|
||||
Buff.prolong( attacker, ScrollOfRecharging.Recharging.class, (float)staff.level);
|
||||
if (level() > 0) {
|
||||
Buff.prolong( attacker, ScrollOfRecharging.Recharging.class, (float)staff.level());
|
||||
SpellSprite.show(attacker, SpellSprite.CHARGE);
|
||||
}
|
||||
}
|
||||
|
|
|
@ -90,25 +90,25 @@ public class WandOfPrismaticLight extends Wand {
|
|||
affectMap(beam);
|
||||
|
||||
if (curUser.viewDistance < 4)
|
||||
Buff.prolong( curUser, Light.class, 10f+level*5);
|
||||
Buff.prolong( curUser, Light.class, 10f+level()*5);
|
||||
}
|
||||
|
||||
private void affectTarget(Char ch){
|
||||
int dmg = Random.NormalIntRange(level, (int) (8+(level*(level/5f))));
|
||||
int dmg = Random.NormalIntRange(level(), (int) (8+(level()*(level()/5f))));
|
||||
|
||||
//three in (5+lvl) chance of failing
|
||||
if (Random.Int(5+level) >= 3) {
|
||||
Buff.prolong(ch, Blindness.class, 2f + (level * 0.34f));
|
||||
if (Random.Int(5+level()) >= 3) {
|
||||
Buff.prolong(ch, Blindness.class, 2f + (level() * 0.34f));
|
||||
ch.sprite.emitter().burst(Speck.factory(Speck.LIGHT), 6 );
|
||||
}
|
||||
|
||||
if (evilMobs.contains(ch.getClass())){
|
||||
ch.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10+level );
|
||||
ch.sprite.emitter().start( ShadowParticle.UP, 0.05f, 10+level() );
|
||||
Sample.INSTANCE.play(Assets.SND_BURNING);
|
||||
|
||||
ch.damage((int)(dmg*1.5), this);
|
||||
} else {
|
||||
ch.sprite.centerEmitter().burst( RainbowParticle.BURST, 10+level );
|
||||
ch.sprite.centerEmitter().burst( RainbowParticle.BURST, 10+level() );
|
||||
|
||||
ch.damage(dmg, this);
|
||||
}
|
||||
|
@ -156,7 +156,7 @@ public class WandOfPrismaticLight extends Wand {
|
|||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//cripples enemy
|
||||
Buff.prolong( defender, Cripple.class, 1f+staff.level);
|
||||
Buff.prolong( defender, Cripple.class, 1f+staff.level());
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -168,7 +168,7 @@ public class WandOfRegrowth extends Wand {
|
|||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//like vampiric enchantment, except with herbal healing buff
|
||||
|
||||
int level = Math.max( 0, staff.level );
|
||||
int level = Math.max( 0, staff.level() );
|
||||
|
||||
// lvl 0 - 33%
|
||||
// lvl 1 - 43%
|
||||
|
|
|
@ -109,24 +109,24 @@ public class WandOfTransfusion extends Wand {
|
|||
|
||||
int missingHP = ch.HT - ch.HP;
|
||||
//heals 30%+3%*lvl missing HP.
|
||||
int healing = (int)Math.ceil((missingHP * (0.30f+(0.03f*level))));
|
||||
int healing = (int)Math.ceil((missingHP * (0.30f+(0.03f*level()))));
|
||||
ch.HP += healing;
|
||||
ch.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1 + level / 2);
|
||||
ch.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1 + level() / 2);
|
||||
ch.sprite.showStatus(CharSprite.POSITIVE, "+%dHP", healing);
|
||||
|
||||
//harms the undead
|
||||
} else if (undeadMobs.contains(ch.getClass())){
|
||||
|
||||
//deals 30%+5%*lvl total HP.
|
||||
int damage = (int) Math.ceil(ch.HT*(0.3f+(0.05f*level)));
|
||||
int damage = (int) Math.ceil(ch.HT*(0.3f+(0.05f*level())));
|
||||
ch.damage(damage, this);
|
||||
ch.sprite.emitter().start(ShadowParticle.UP, 0.05f, 10 + level);
|
||||
ch.sprite.emitter().start(ShadowParticle.UP, 0.05f, 10 + level());
|
||||
Sample.INSTANCE.play(Assets.SND_BURNING);
|
||||
|
||||
//charms an enemy
|
||||
} else {
|
||||
|
||||
float duration = 5+level;
|
||||
float duration = 5+level();
|
||||
Buff.affect(ch, Charm.class, Charm.durationFactor(ch) * duration).object = curUser.id();
|
||||
|
||||
duration *= Random.Float(0.75f, 1f);
|
||||
|
@ -143,14 +143,14 @@ public class WandOfTransfusion extends Wand {
|
|||
Item item = heap.peek();
|
||||
|
||||
//30% + 10%*lvl chance to uncurse the item and reset it to base level if degraded.
|
||||
if (item != null && Random.Float() <= 0.3f+level*0.1f){
|
||||
if (item != null && Random.Float() <= 0.3f+level()*0.1f){
|
||||
if (item.cursed){
|
||||
item.cursed = false;
|
||||
CellEmitter.get(cell).start( ShadowParticle.UP, 0.05f, 10 );
|
||||
Sample.INSTANCE.play(Assets.SND_BURNING);
|
||||
}
|
||||
|
||||
int lvldiffFromBase = item.level - (item instanceof Ring ? 1 : 0);
|
||||
int lvldiffFromBase = item.level() - (item instanceof Ring ? 1 : 0);
|
||||
if (lvldiffFromBase < 0){
|
||||
item.upgrade(-lvldiffFromBase);
|
||||
CellEmitter.get(cell).start(Speck.factory(Speck.UP), 0.2f, 3);
|
||||
|
@ -170,7 +170,7 @@ public class WandOfTransfusion extends Wand {
|
|||
} else if (Dungeon.level.map[cell] == Terrain.EMBERS) {
|
||||
|
||||
//30% + 3%*lvl chance to grow a random plant, or just regrow grass.
|
||||
if (Random.Float() <= 0.3f+level*0.03f) {
|
||||
if (Random.Float() <= 0.3f+level()*0.03f) {
|
||||
Dungeon.level.plant((Plant.Seed) Generator.random(Generator.Category.SEED), cell);
|
||||
CellEmitter.get( cell ).burst(LeafParticle.LEVEL_SPECIFIC, 8);
|
||||
GameScene.updateMap(cell);
|
||||
|
@ -213,7 +213,7 @@ public class WandOfTransfusion extends Wand {
|
|||
// lvl 0 - 10%
|
||||
// lvl 1 - 18%
|
||||
// lvl 2 - 25%
|
||||
if (Random.Int( level + 10 ) >= 9){
|
||||
if (Random.Int( level() + 10 ) >= 9){
|
||||
//grants a free use of the staff
|
||||
freeCharge = true;
|
||||
GLog.p("Your staff is charged with the life energy of your enemy!");
|
||||
|
|
|
@ -45,8 +45,8 @@ public class WandOfVenom extends Wand {
|
|||
|
||||
@Override
|
||||
protected void onZap(Ballistica bolt) {
|
||||
Blob venomGas = Blob.seed(bolt.collisionPos, 50 + 10 * level, VenomGas.class);
|
||||
((VenomGas)venomGas).setStrength(level+1);
|
||||
Blob venomGas = Blob.seed(bolt.collisionPos, 50 + 10 * level(), VenomGas.class);
|
||||
((VenomGas)venomGas).setStrength(level()+1);
|
||||
GameScene.add(venomGas);
|
||||
|
||||
Char ch = Actor.findChar(bolt.collisionPos);
|
||||
|
|
|
@ -39,7 +39,7 @@ import com.watabou.utils.Bundlable;
|
|||
import com.watabou.utils.Bundle;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class Weapon extends KindOfWeapon {
|
||||
abstract public class Weapon extends KindOfWeapon {
|
||||
|
||||
private static final int HITS_TO_KNOW = 20;
|
||||
|
||||
|
@ -165,7 +165,7 @@ public class Weapon extends KindOfWeapon {
|
|||
|
||||
public Item upgrade( boolean enchant ) {
|
||||
if (enchantment != null) {
|
||||
if (!enchant && Random.Int( level ) > 0) {
|
||||
if (!enchant && Random.Int( level() ) > 0) {
|
||||
GLog.w( TXT_INCOMPATIBLE );
|
||||
enchant( null );
|
||||
}
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.watabou.utils.Random;
|
|||
|
||||
public class Death extends Weapon.Enchantment {
|
||||
|
||||
private static final String TXT_GRIM = "Grim %s";
|
||||
private static final String TXT_GRIM = "grim %s";
|
||||
|
||||
private static ItemSprite.Glowing BLACK = new ItemSprite.Glowing( 0x000000 );
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class Death extends Weapon.Enchantment {
|
|||
// lvl 0 - 8%
|
||||
// lvl 1 ~ 9%
|
||||
// lvl 2 ~ 10%
|
||||
int level = Math.max( 0, weapon.level );
|
||||
int level = Math.max( 0, weapon.level() );
|
||||
|
||||
if (Random.Int( level + 100 ) >= 92) {
|
||||
|
||||
|
|
|
@ -31,7 +31,7 @@ import com.watabou.utils.Random;
|
|||
|
||||
public class Fire extends Weapon.Enchantment {
|
||||
|
||||
private static final String TXT_BLAZING = "Blazing %s";
|
||||
private static final String TXT_BLAZING = "blazing %s";
|
||||
|
||||
private static ItemSprite.Glowing ORANGE = new ItemSprite.Glowing( 0xFF4400 );
|
||||
|
||||
|
@ -40,7 +40,7 @@ public class Fire extends Weapon.Enchantment {
|
|||
// lvl 0 - 33%
|
||||
// lvl 1 - 50%
|
||||
// lvl 2 - 60%
|
||||
int level = Math.max( 0, weapon.level );
|
||||
int level = Math.max( 0, weapon.level() );
|
||||
|
||||
if (Random.Int( level + 3 ) >= 2) {
|
||||
|
||||
|
|
|
@ -32,7 +32,7 @@ import com.watabou.utils.Random;
|
|||
|
||||
public class Horror extends Weapon.Enchantment {
|
||||
|
||||
private static final String TXT_ELDRITCH = "Eldritch %s";
|
||||
private static final String TXT_ELDRITCH = "eldritch %s";
|
||||
|
||||
private static ItemSprite.Glowing GREY = new ItemSprite.Glowing( 0x222222 );
|
||||
|
||||
|
@ -41,7 +41,7 @@ public class Horror extends Weapon.Enchantment {
|
|||
// lvl 0 - 20%
|
||||
// lvl 1 - 33%
|
||||
// lvl 2 - 43%
|
||||
int level = Math.max( 0, weapon.level );
|
||||
int level = Math.max( 0, weapon.level() );
|
||||
|
||||
if (Random.Int( level + 5 ) >= 4) {
|
||||
|
||||
|
|
|
@ -27,7 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Boomerang;
|
|||
|
||||
public class Instability extends Weapon.Enchantment {
|
||||
|
||||
private static final String TXT_UNSTABLE = "Unstable %s";
|
||||
private static final String TXT_UNSTABLE = "unstable %s";
|
||||
|
||||
@Override
|
||||
public boolean proc( Weapon weapon, Char attacker, Char defender, int damage ) {
|
||||
|
|
|
@ -30,14 +30,14 @@ import com.watabou.utils.Random;
|
|||
|
||||
public class Leech extends Weapon.Enchantment {
|
||||
|
||||
private static final String TXT_VAMPIRIC = "Vampiric %s";
|
||||
private static final String TXT_VAMPIRIC = "vampiric %s";
|
||||
|
||||
private static ItemSprite.Glowing RED = new ItemSprite.Glowing( 0x660022 );
|
||||
|
||||
@Override
|
||||
public boolean proc( Weapon weapon, Char attacker, Char defender, int damage ) {
|
||||
|
||||
int level = Math.max( 0, weapon.level );
|
||||
int level = Math.max( 0, weapon.level() );
|
||||
|
||||
// lvl 0 - 33%
|
||||
// lvl 1 - 43%
|
||||
|
|
|
@ -27,13 +27,13 @@ import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
|||
|
||||
public class Luck extends Weapon.Enchantment {
|
||||
|
||||
private static final String TXT_LUCKY = "Lucky %s";
|
||||
private static final String TXT_LUCKY = "lucky %s";
|
||||
|
||||
private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x00FF00 );
|
||||
|
||||
@Override
|
||||
public boolean proc( Weapon weapon, Char attacker, Char defender, int damage ) {
|
||||
int level = Math.max( 0, weapon.level );
|
||||
int level = Math.max( 0, weapon.level() );
|
||||
|
||||
int dmg = damage;
|
||||
for (int i=1; i <= level+1; i++) {
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.watabou.utils.Random;
|
|||
|
||||
public class Paralysis extends Weapon.Enchantment {
|
||||
|
||||
private static final String TXT_STUNNING = "Stunning %s";
|
||||
private static final String TXT_STUNNING = "stunning %s";
|
||||
|
||||
private static ItemSprite.Glowing YELLOW = new ItemSprite.Glowing( 0xCCAA44 );
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class Paralysis extends Weapon.Enchantment {
|
|||
// lvl 0 - 13%
|
||||
// lvl 1 - 22%
|
||||
// lvl 2 - 30%
|
||||
int level = Math.max( 0, weapon.level );
|
||||
int level = Math.max( 0, weapon.level() );
|
||||
|
||||
if (Random.Int( level + 8 ) >= 7) {
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ import com.watabou.utils.Random;
|
|||
|
||||
public class Poison extends Weapon.Enchantment {
|
||||
|
||||
private static final String TXT_VENOMOUS = "Venomous %s";
|
||||
private static final String TXT_VENOMOUS = "venomous %s";
|
||||
|
||||
private static ItemSprite.Glowing PURPLE = new ItemSprite.Glowing( 0x4400AA );
|
||||
|
||||
|
@ -38,7 +38,7 @@ public class Poison extends Weapon.Enchantment {
|
|||
// lvl 0 - 33%
|
||||
// lvl 1 - 50%
|
||||
// lvl 2 - 60%
|
||||
int level = Math.max( 0, weapon.level );
|
||||
int level = Math.max( 0, weapon.level() );
|
||||
|
||||
if (Random.Int( level + 3 ) >= 2) {
|
||||
|
||||
|
|
|
@ -34,14 +34,14 @@ import com.watabou.utils.Random;
|
|||
|
||||
public class Shock extends Weapon.Enchantment {
|
||||
|
||||
private static final String TXT_SHOCKING = "Shocking %s";
|
||||
private static final String TXT_SHOCKING = "shocking %s";
|
||||
|
||||
@Override
|
||||
public boolean proc( Weapon weapon, Char attacker, Char defender, int damage ) {
|
||||
// lvl 0 - 25%
|
||||
// lvl 1 - 40%
|
||||
// lvl 2 - 50%
|
||||
int level = Math.max( 0, weapon.level );
|
||||
int level = Math.max( 0, weapon.level() );
|
||||
|
||||
if (Random.Int( level + 4 ) >= 3) {
|
||||
|
||||
|
|
|
@ -30,7 +30,7 @@ import com.watabou.utils.Random;
|
|||
|
||||
public class Slow extends Weapon.Enchantment {
|
||||
|
||||
private static final String TXT_CHILLING = "Chilling %s";
|
||||
private static final String TXT_CHILLING = "chilling %s";
|
||||
|
||||
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x0044FF );
|
||||
|
||||
|
@ -39,7 +39,7 @@ public class Slow extends Weapon.Enchantment {
|
|||
// lvl 0 - 25%
|
||||
// lvl 1 - 40%
|
||||
// lvl 2 - 50%
|
||||
int level = Math.max( 0, weapon.level );
|
||||
int level = Math.max( 0, weapon.level() );
|
||||
|
||||
if (Random.Int( level + 4 ) >= 3) {
|
||||
|
||||
|
|
|
@ -69,14 +69,16 @@ public class MagesStaff extends MeleeWeapon {
|
|||
|
||||
public MagesStaff() {
|
||||
|
||||
//tier 1 weapon with poor base stats.
|
||||
super(1, 1f, 1f);
|
||||
MIN = 1;
|
||||
MAX = 6;
|
||||
|
||||
wand = null;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int maxBase() {
|
||||
return 6; //6 base damage instead of 10
|
||||
}
|
||||
|
||||
public MagesStaff(Wand wand){
|
||||
this();
|
||||
wand.identify();
|
||||
|
@ -156,15 +158,15 @@ public class MagesStaff extends MeleeWeapon {
|
|||
}
|
||||
|
||||
//syncs the level of the two items.
|
||||
int targetLevel = Math.max(this.level, wand.level);
|
||||
int targetLevel = Math.max(this.level(), wand.level());
|
||||
|
||||
int staffLevelDiff = targetLevel - this.level;
|
||||
int staffLevelDiff = targetLevel - this.level();
|
||||
if (staffLevelDiff > 0)
|
||||
this.upgrade(staffLevelDiff);
|
||||
else if (staffLevelDiff < 0)
|
||||
this.degrade(Math.abs(staffLevelDiff));
|
||||
|
||||
int wandLevelDiff = targetLevel - wand.level;
|
||||
int wandLevelDiff = targetLevel - wand.level();
|
||||
if (wandLevelDiff > 0)
|
||||
wand.upgrade(wandLevelDiff);
|
||||
else if (wandLevelDiff < 0)
|
||||
|
|
|
@ -40,18 +40,26 @@ public class MeleeWeapon extends Weapon {
|
|||
|
||||
STR = typicalSTR();
|
||||
|
||||
MIN = min();
|
||||
MAX = max();
|
||||
}
|
||||
|
||||
private int min() {
|
||||
protected int minBase() {
|
||||
return tier;
|
||||
}
|
||||
|
||||
private int max() {
|
||||
protected int maxBase() {
|
||||
return (int)((tier * tier - tier + 10) / ACU * DLY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int min() {
|
||||
return minBase() + level();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int max() {
|
||||
return maxBase() + level() * tier;
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item upgrade() {
|
||||
return upgrade( false );
|
||||
|
@ -59,8 +67,6 @@ public class MeleeWeapon extends Weapon {
|
|||
|
||||
public Item upgrade( boolean enchant ) {
|
||||
STR--;
|
||||
MIN++;
|
||||
MAX += tier;
|
||||
|
||||
return super.upgrade( enchant );
|
||||
}
|
||||
|
@ -72,8 +78,6 @@ public class MeleeWeapon extends Weapon {
|
|||
@Override
|
||||
public Item degrade() {
|
||||
STR++;
|
||||
MIN--;
|
||||
MAX -= tier;
|
||||
return super.degrade();
|
||||
}
|
||||
|
||||
|
@ -88,18 +92,22 @@ public class MeleeWeapon extends Weapon {
|
|||
|
||||
StringBuilder info = new StringBuilder( desc() );
|
||||
|
||||
String quality = levelKnown && level != 0 ? (level > 0 ? "upgraded" : "degraded") : "";
|
||||
String quality = levelKnown && level() != 0 ? (level() > 0 ? "upgraded" : "degraded") : "";
|
||||
info.append( p );
|
||||
info.append( "This " + name + " is " + Utils.indefinite( quality ) );
|
||||
info.append( " tier-" + tier + " melee weapon. " );
|
||||
|
||||
if (levelKnown) {
|
||||
int min = min();
|
||||
int max = max();
|
||||
info.append( "Its average damage is " +
|
||||
Math.round((MIN + (MAX - MIN) / 2)*(imbue == Imbue.LIGHT ? 0.7f : (imbue == Imbue.HEAVY ? 1.5f : 1)))
|
||||
Math.round((min + (max - min) / 2)*(imbue == Imbue.LIGHT ? 0.7f : (imbue == Imbue.HEAVY ? 1.5f : 1)))
|
||||
+ " points per hit. " );
|
||||
} else {
|
||||
int min = minBase();
|
||||
int max = maxBase();
|
||||
info.append(
|
||||
"Its typical average damage is " + (min() + (max() - min()) / 2) + " points per hit " +
|
||||
"Its typical average damage is " + (min + (max - min) / 2) + " points per hit " +
|
||||
"and usually it requires " + typicalSTR() + " points of strength. " );
|
||||
if (typicalSTR() > Dungeon.hero.STR()) {
|
||||
info.append( "Probably this weapon is too heavy for you. " );
|
||||
|
@ -173,10 +181,10 @@ public class MeleeWeapon extends Weapon {
|
|||
price /= 2;
|
||||
}
|
||||
if (levelKnown) {
|
||||
if (level > 0) {
|
||||
price *= (level + 1);
|
||||
} else if (level < 0) {
|
||||
price /= (1 - level);
|
||||
if (level() > 0) {
|
||||
price *= (level() + 1);
|
||||
} else if (level() < 0) {
|
||||
price /= (1 - level());
|
||||
}
|
||||
}
|
||||
if (price < 1) {
|
||||
|
@ -189,7 +197,7 @@ public class MeleeWeapon extends Weapon {
|
|||
public Item random() {
|
||||
super.random();
|
||||
|
||||
if (Random.Int( 10 + level ) == 0) {
|
||||
if (Random.Int( 10 + level() ) == 0) {
|
||||
enchant();
|
||||
}
|
||||
|
||||
|
|
|
@ -61,13 +61,17 @@ public class ShortSword extends MeleeWeapon {
|
|||
super( 1, 1f, 1f );
|
||||
|
||||
STR = 11;
|
||||
MAX = 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected int maxBase() {
|
||||
return 12;
|
||||
}
|
||||
|
||||
@Override
|
||||
public ArrayList<String> actions( Hero hero ) {
|
||||
ArrayList<String> actions = super.actions( hero );
|
||||
if (level > 0) {
|
||||
if (level() > 0) {
|
||||
actions.add( AC_REFORGE );
|
||||
}
|
||||
return actions;
|
||||
|
|
|
@ -35,15 +35,22 @@ public class Boomerang extends MissileWeapon {
|
|||
|
||||
STR = 10;
|
||||
|
||||
MIN = 1;
|
||||
MAX = 5;
|
||||
|
||||
stackable = false;
|
||||
|
||||
unique = true;
|
||||
bones = false;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int min() {
|
||||
return 1 + level();
|
||||
}
|
||||
|
||||
@Override
|
||||
public int max() {
|
||||
return 5 + 2 * level();
|
||||
}
|
||||
|
||||
@Override
|
||||
public boolean isUpgradable() {
|
||||
return true;
|
||||
|
@ -56,8 +63,6 @@ public class Boomerang extends MissileWeapon {
|
|||
|
||||
@Override
|
||||
public Item upgrade( boolean enchant ) {
|
||||
MIN += 1;
|
||||
MAX += 2;
|
||||
super.upgrade( enchant );
|
||||
|
||||
updateQuickslot();
|
||||
|
@ -67,8 +72,6 @@ public class Boomerang extends MissileWeapon {
|
|||
|
||||
@Override
|
||||
public Item degrade() {
|
||||
MIN -= 1;
|
||||
MAX -= 2;
|
||||
return super.degrade();
|
||||
}
|
||||
|
||||
|
|
|
@ -36,9 +36,16 @@ public class CurareDart extends MissileWeapon {
|
|||
image = ItemSpriteSheet.CURARE_DART;
|
||||
|
||||
STR = 14;
|
||||
}
|
||||
|
||||
MIN = 1;
|
||||
MAX = 3;
|
||||
@Override
|
||||
public int min() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int max() {
|
||||
return 3;
|
||||
}
|
||||
|
||||
public CurareDart() {
|
||||
|
|
|
@ -30,12 +30,19 @@ public class Dart extends MissileWeapon {
|
|||
name = "dart";
|
||||
image = ItemSpriteSheet.DART;
|
||||
|
||||
MIN = 1;
|
||||
MAX = 4;
|
||||
|
||||
bones = false; //Finding them in bones would be semi-frequent and disappointing.
|
||||
}
|
||||
|
||||
@Override
|
||||
public int min() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int max() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
public Dart() {
|
||||
this( 1 );
|
||||
}
|
||||
|
|
|
@ -41,9 +41,16 @@ public class IncendiaryDart extends MissileWeapon {
|
|||
image = ItemSpriteSheet.INCENDIARY_DART;
|
||||
|
||||
STR = 12;
|
||||
}
|
||||
|
||||
MIN = 1;
|
||||
MAX = 2;
|
||||
@Override
|
||||
public int min() {
|
||||
return 1;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int max() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
public IncendiaryDart() {
|
||||
|
|
|
@ -34,9 +34,16 @@ public class Javelin extends MissileWeapon {
|
|||
image = ItemSpriteSheet.JAVELIN;
|
||||
|
||||
STR = 15;
|
||||
}
|
||||
|
||||
MIN = 2;
|
||||
MAX = 15;
|
||||
@Override
|
||||
public int min() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int max() {
|
||||
return 15;
|
||||
}
|
||||
|
||||
public Javelin() {
|
||||
|
|
|
@ -36,7 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.windows.WndOptions;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
public class MissileWeapon extends Weapon {
|
||||
abstract public class MissileWeapon extends Weapon {
|
||||
|
||||
private static final String TXT_MISSILES = "Missile weapon";
|
||||
private static final String TXT_YES = "Yes, I know what I'm doing";
|
||||
|
@ -150,7 +150,7 @@ public class MissileWeapon extends Weapon {
|
|||
|
||||
StringBuilder info = new StringBuilder( desc() );
|
||||
|
||||
info.append( "\n\nAverage damage of this weapon equals to " + (MIN + (MAX - MIN) / 2) + " points per hit. " );
|
||||
info.append( "\n\nAverage damage of this weapon equals to " + (min() + (max() - min()) / 2) + " points per hit. " );
|
||||
|
||||
if (Dungeon.hero.belongings.backpack.items.contains( this )) {
|
||||
if (STR > Dungeon.hero.STR()) {
|
||||
|
|
|
@ -32,12 +32,19 @@ public class Shuriken extends MissileWeapon {
|
|||
|
||||
STR = 13;
|
||||
|
||||
MIN = 2;
|
||||
MAX = 6;
|
||||
|
||||
DLY = 0.5f;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int min() {
|
||||
return 2;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int max() {
|
||||
return 6;
|
||||
}
|
||||
|
||||
public Shuriken() {
|
||||
this( 1 );
|
||||
}
|
||||
|
|
|
@ -34,9 +34,16 @@ public class Tamahawk extends MissileWeapon {
|
|||
image = ItemSpriteSheet.TOMAHAWK;
|
||||
|
||||
STR = 17;
|
||||
}
|
||||
|
||||
MIN = 4;
|
||||
MAX = 20;
|
||||
@Override
|
||||
public int min() {
|
||||
return 4;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int max() {
|
||||
return 20;
|
||||
}
|
||||
|
||||
public Tamahawk() {
|
||||
|
|
|
@ -36,7 +36,6 @@ import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.plants.Plant;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.scenes.GameScene;
|
||||
import com.watabou.utils.Random;
|
||||
|
||||
|
@ -54,7 +53,7 @@ public class HighGrass {
|
|||
SandalsOfNature.Naturalism naturalism = ch.buff( SandalsOfNature.Naturalism.class );
|
||||
if (naturalism != null) {
|
||||
if (!naturalism.isCursed()) {
|
||||
naturalismLevel = naturalism.level() + 1;
|
||||
naturalismLevel = naturalism.itemLevel() + 1;
|
||||
naturalism.charge();
|
||||
} else {
|
||||
naturalismLevel = -1;
|
||||
|
|
|
@ -81,7 +81,7 @@ public abstract class Plant implements Bundlable {
|
|||
int naturalismLevel = 0;
|
||||
SandalsOfNature.Naturalism naturalism = Dungeon.hero.buff( SandalsOfNature.Naturalism.class );
|
||||
if (naturalism != null) {
|
||||
naturalismLevel = naturalism.level()+1;
|
||||
naturalismLevel = naturalism.itemLevel()+1;
|
||||
}
|
||||
|
||||
if (Random.Int( 5 - (naturalismLevel/2) ) == 0) {
|
||||
|
|
Loading…
Reference in New Issue
Block a user