v0.4.0: implemented new glyphs
This commit is contained in:
parent
14a8fbdd63
commit
6172b46175
|
@ -145,7 +145,9 @@ public class ShatteredPixelDungeon extends Game {
|
||||||
com.watabou.utils.Bundle.addAlias(
|
com.watabou.utils.Bundle.addAlias(
|
||||||
com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Repulsion.class,
|
com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Repulsion.class,
|
||||||
"com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Bounce" );
|
"com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Bounce" );
|
||||||
|
com.watabou.utils.Bundle.addAlias(
|
||||||
|
com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Repulsion.class,
|
||||||
|
"com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Displacement" );
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -27,9 +27,11 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Blob;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.blobs.Fire;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Thief;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Thief;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.ChargrilledMeat;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
|
import com.shatteredpixel.shatteredpixeldungeon.items.food.MysteryMeat;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements.Resistance;
|
||||||
|
@ -45,8 +47,6 @@ import com.watabou.utils.Random;
|
||||||
|
|
||||||
public class Burning extends Buff implements Hero.Doom {
|
public class Burning extends Buff implements Hero.Doom {
|
||||||
|
|
||||||
private static final String TXT_BURNS_UP = "%s burns up!";
|
|
||||||
|
|
||||||
private static final float DURATION = 8f;
|
private static final float DURATION = 8f;
|
||||||
|
|
||||||
private float left;
|
private float left;
|
||||||
|
@ -76,37 +76,55 @@ public class Burning extends Buff implements Hero.Doom {
|
||||||
|
|
||||||
//maximum damage scales from 6 to 2 depending on remaining hp.
|
//maximum damage scales from 6 to 2 depending on remaining hp.
|
||||||
int maxDmg = 3 + Math.round( 4 * target.HP / (float)target.HT );
|
int maxDmg = 3 + Math.round( 4 * target.HP / (float)target.HT );
|
||||||
target.damage( Random.Int( 1, maxDmg ), this );
|
int damage = Random.Int( 1, maxDmg );
|
||||||
Buff.detach( target, Chill.class);
|
Buff.detach( target, Chill.class);
|
||||||
|
|
||||||
if (target instanceof Hero) {
|
if (target instanceof Hero) {
|
||||||
|
|
||||||
Hero hero = (Hero)target;
|
Hero hero = (Hero)target;
|
||||||
Item item = hero.belongings.randomUnequipped();
|
|
||||||
if (item instanceof Scroll) {
|
|
||||||
|
|
||||||
item = item.detach( hero.belongings.backpack );
|
if (hero.belongings.armor != null && hero.belongings.armor.glyph != null
|
||||||
GLog.w( Messages.get(this, "burnsup", Messages.capitalize(item.toString())) );
|
&& hero.belongings.armor.glyph instanceof Brimstone){
|
||||||
|
|
||||||
Heap.burnFX( hero.pos );
|
int heal = hero.belongings.armor.level()/2;
|
||||||
|
if (heal > 0 && hero.HP < hero.HT) {
|
||||||
} else if (item instanceof MysteryMeat) {
|
hero.sprite.emitter().burst(Speck.factory(Speck.HEALING), 1);
|
||||||
|
hero.HP = Math.min(hero.HT, hero.HP + heal);
|
||||||
item = item.detach( hero.belongings.backpack );
|
|
||||||
ChargrilledMeat steak = new ChargrilledMeat();
|
|
||||||
if (!steak.collect( hero.belongings.backpack )) {
|
|
||||||
Dungeon.level.drop( steak, hero.pos ).sprite.drop();
|
|
||||||
}
|
}
|
||||||
GLog.w( Messages.get(this, "burnsup", item.toString()) );
|
|
||||||
|
|
||||||
Heap.burnFX( hero.pos );
|
} else {
|
||||||
|
|
||||||
|
hero.damage( damage, this );
|
||||||
|
Item item = hero.belongings.randomUnequipped();
|
||||||
|
if (item instanceof Scroll) {
|
||||||
|
|
||||||
|
item = item.detach( hero.belongings.backpack );
|
||||||
|
GLog.w( Messages.get(this, "burnsup", Messages.capitalize(item.toString())) );
|
||||||
|
|
||||||
|
Heap.burnFX( hero.pos );
|
||||||
|
|
||||||
|
} else if (item instanceof MysteryMeat) {
|
||||||
|
|
||||||
|
item = item.detach( hero.belongings.backpack );
|
||||||
|
ChargrilledMeat steak = new ChargrilledMeat();
|
||||||
|
if (!steak.collect( hero.belongings.backpack )) {
|
||||||
|
Dungeon.level.drop( steak, hero.pos ).sprite.drop();
|
||||||
|
}
|
||||||
|
GLog.w( Messages.get(this, "burnsup", item.toString()) );
|
||||||
|
|
||||||
|
Heap.burnFX( hero.pos );
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
} else if (target instanceof Thief && ((Thief)target).item instanceof Scroll) {
|
} else {
|
||||||
|
target.damage( damage, this );
|
||||||
|
}
|
||||||
|
|
||||||
((Thief)target).item = null;
|
if (target instanceof Thief && ((Thief)target).item instanceof Scroll) {
|
||||||
target.sprite.emitter().burst( ElmoParticle.FACTORY, 6 );
|
((Thief)target).item = null;
|
||||||
|
target.sprite.emitter().burst( ElmoParticle.FACTORY, 6 );
|
||||||
}
|
}
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
|
@ -221,39 +221,12 @@ public class Belongings implements Iterable<Item> {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int charge( boolean full) {
|
public int charge( float charge ) {
|
||||||
|
|
||||||
int count = 0;
|
int count = 0;
|
||||||
|
|
||||||
for (Item item : this) {
|
for (Wand.Charger charger : owner.buffs(Wand.Charger.class)){
|
||||||
if (item instanceof Wand) {
|
charger.gainCharge(charge);
|
||||||
Wand wand = (Wand)item;
|
|
||||||
if (wand.curCharges < wand.maxCharges) {
|
|
||||||
wand.curCharges = full ? wand.maxCharges : wand.curCharges + 1;
|
|
||||||
count++;
|
|
||||||
|
|
||||||
wand.updateQuickslot();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return count;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int discharge() {
|
|
||||||
|
|
||||||
int count = 0;
|
|
||||||
|
|
||||||
for (Item item : this) {
|
|
||||||
if (item instanceof Wand) {
|
|
||||||
Wand wand = (Wand)item;
|
|
||||||
if (wand.curCharges > 0) {
|
|
||||||
wand.curCharges--;
|
|
||||||
count++;
|
|
||||||
|
|
||||||
wand.updateQuickslot();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return count;
|
return count;
|
||||||
|
|
|
@ -54,6 +54,11 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Heap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Heap.Type;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Heap.Type;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Flow;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Obfuscation;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Swiftness;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CapeOfThorns;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.DriedRose;
|
||||||
|
@ -287,11 +292,14 @@ public class Hero extends Char {
|
||||||
return (int)(defenseSkill * evasion / Math.pow( 1.5, aEnc ));
|
return (int)(defenseSkill * evasion / Math.pow( 1.5, aEnc ));
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
if (heroClass == HeroClass.ROGUE) {
|
bonus = 0;
|
||||||
return (int)((defenseSkill - aEnc) * evasion);
|
if (heroClass == HeroClass.ROGUE) bonus += -aEnc;
|
||||||
} else {
|
|
||||||
return (int)(defenseSkill * evasion);
|
if (belongings.armor != null && belongings.armor.glyph != null
|
||||||
}
|
&& belongings.armor.glyph instanceof Swiftness)
|
||||||
|
bonus += belongings.armor.level()*2;
|
||||||
|
|
||||||
|
return Math.round((defenseSkill + bonus) * evasion);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -345,7 +353,18 @@ public class Hero extends Char {
|
||||||
if (hasteLevel != 0)
|
if (hasteLevel != 0)
|
||||||
speed *= Math.pow(1.2, hasteLevel);
|
speed *= Math.pow(1.2, hasteLevel);
|
||||||
|
|
||||||
int aEnc = belongings.armor != null ? belongings.armor.STRReq() - STR() : 0;
|
Armor armor = belongings.armor;
|
||||||
|
|
||||||
|
if (armor != null && armor.glyph != null){
|
||||||
|
|
||||||
|
if (armor.glyph instanceof Swiftness) {
|
||||||
|
speed *= (1.1f + 0.01f * belongings.armor.level());
|
||||||
|
} else if (armor.glyph instanceof Flow && Level.water[pos]){
|
||||||
|
speed *= (1.5f + 0.05f * belongings.armor.level());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
int aEnc = armor != null ? armor.STRReq() - STR() : 0;
|
||||||
if (aEnc > 0) {
|
if (aEnc > 0) {
|
||||||
|
|
||||||
return (float)(speed / Math.pow( 1.2, aEnc ));
|
return (float)(speed / Math.pow( 1.2, aEnc ));
|
||||||
|
@ -938,6 +957,12 @@ public class Hero extends Char {
|
||||||
if (tenacity != 0) //(HT - HP)/HT = heroes current % missing health.
|
if (tenacity != 0) //(HT - HP)/HT = heroes current % missing health.
|
||||||
dmg = (int)Math.ceil((float)dmg * Math.pow(0.9, tenacity*((float)(HT - HP)/HT)));
|
dmg = (int)Math.ceil((float)dmg * Math.pow(0.9, tenacity*((float)(HT - HP)/HT)));
|
||||||
|
|
||||||
|
//TODO improve this when I have proper damage source logic
|
||||||
|
if (belongings.armor != null && belongings.armor.glyph != null
|
||||||
|
&& belongings.armor.glyph instanceof AntiMagic && RingOfElements.FULL.contains(src.getClass())){
|
||||||
|
dmg -= Random.IntRange(0, belongings.armor.DR()/2);
|
||||||
|
}
|
||||||
|
|
||||||
super.damage( dmg, src );
|
super.damage( dmg, src );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -1210,6 +1235,10 @@ public class Hero extends Char {
|
||||||
for (Buff buff : buffs( RingOfEvasion.Evasion.class )) {
|
for (Buff buff : buffs( RingOfEvasion.Evasion.class )) {
|
||||||
stealth += ((RingOfEvasion.Evasion)buff).effectiveLevel;
|
stealth += ((RingOfEvasion.Evasion)buff).effectiveLevel;
|
||||||
}
|
}
|
||||||
|
if (belongings.armor != null && belongings.armor.glyph != null
|
||||||
|
&& belongings.armor.glyph instanceof Obfuscation){
|
||||||
|
stealth += belongings.armor.level();
|
||||||
|
}
|
||||||
return stealth;
|
return stealth;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -30,14 +30,17 @@ import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
|
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Affection;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Affection;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiEntropy;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Displacement;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Brimstone;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Camouflage;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Entanglement;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Entanglement;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Metabolism;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Flow;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Multiplicity;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Obfuscation;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Repulsion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Repulsion;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Stench;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Stone;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Swiftness;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Thorns;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite;
|
||||||
|
@ -204,7 +207,11 @@ public class Armor extends EquipableItem {
|
||||||
}
|
}
|
||||||
|
|
||||||
public int DR(){
|
public int DR(){
|
||||||
return tier * (2 + level() + (glyph == null ? 0 : 1));
|
int effectiveTier = tier;
|
||||||
|
if (glyph != null) effectiveTier += glyph.tierDRAdjust();
|
||||||
|
effectiveTier = Math.max(0, effectiveTier);
|
||||||
|
|
||||||
|
return effectiveTier * (2 + level());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
@ -332,8 +339,12 @@ public class Armor extends EquipableItem {
|
||||||
|
|
||||||
public int STRReq(int lvl){
|
public int STRReq(int lvl){
|
||||||
lvl = Math.max(0, lvl);
|
lvl = Math.max(0, lvl);
|
||||||
|
int effectiveTier = tier;
|
||||||
|
if (glyph != null) effectiveTier += glyph.tierSTRAdjust();
|
||||||
|
effectiveTier = Math.max(0, effectiveTier);
|
||||||
|
|
||||||
//strength req decreases at +1,+3,+6,+10,etc.
|
//strength req decreases at +1,+3,+6,+10,etc.
|
||||||
return (8 + tier * 2) - (int)(Math.sqrt(8 * lvl + 1) - 1)/2;
|
return (8 + effectiveTier * 2) - (int)(Math.sqrt(8 * lvl + 1) - 1)/2;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int typicalDR() {
|
public int typicalDR() {
|
||||||
|
@ -391,11 +402,14 @@ public class Armor extends EquipableItem {
|
||||||
public static abstract class Glyph implements Bundlable {
|
public static abstract class Glyph implements Bundlable {
|
||||||
|
|
||||||
private static final Class<?>[] glyphs = new Class<?>[]{
|
private static final Class<?>[] glyphs = new Class<?>[]{
|
||||||
Repulsion.class, Affection.class, AntiEntropy.class, Multiplicity.class,
|
Obfuscation.class, Swiftness.class, Stone.class, Potential.class,
|
||||||
Potential.class, Metabolism.class, Stench.class, Viscosity.class,
|
Brimstone.class, Viscosity.class, Entanglement.class, Repulsion.class, Camouflage.class, Flow.class,
|
||||||
Displacement.class, Entanglement.class };
|
Affection.class, AntiMagic.class, Thorns.class };
|
||||||
|
|
||||||
private static final float[] chances= new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
private static final float[] chances= new float[]{
|
||||||
|
10, 10, 10, 10,
|
||||||
|
5, 5, 5, 500, 5, 5,
|
||||||
|
2, 2, 2 };
|
||||||
|
|
||||||
public abstract int proc( Armor armor, Char attacker, Char defender, int damage );
|
public abstract int proc( Armor armor, Char attacker, Char defender, int damage );
|
||||||
|
|
||||||
|
@ -417,6 +431,14 @@ public class Armor extends EquipableItem {
|
||||||
|
|
||||||
public abstract ItemSprite.Glowing glowing();
|
public abstract ItemSprite.Glowing glowing();
|
||||||
|
|
||||||
|
public int tierDRAdjust(){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int tierSTRAdjust(){
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
public boolean checkOwner( Char owner ) {
|
public boolean checkOwner( Char owner ) {
|
||||||
if (!owner.isAlive() && owner instanceof Hero) {
|
if (!owner.isAlive() && owner instanceof Hero) {
|
||||||
|
|
||||||
|
|
|
@ -26,10 +26,8 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
||||||
import com.watabou.utils.GameMath;
|
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
public class Affection extends Glyph {
|
public class Affection extends Glyph {
|
||||||
|
@ -39,19 +37,16 @@ public class Affection extends Glyph {
|
||||||
@Override
|
@Override
|
||||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||||
|
|
||||||
int level = (int)GameMath.gate( 0, armor.level(), 6 );
|
//TODO balancing
|
||||||
|
int level = Math.max(0, armor.level());
|
||||||
|
|
||||||
if (Level.adjacent( attacker.pos, defender.pos ) && Random.Int( level / 2 + 5 ) >= 4) {
|
if (Random.Int( level / 2 + 10 ) >= 9) {
|
||||||
|
|
||||||
int duration = Random.IntRange( 3, 7 );
|
int duration = Random.IntRange( 2, 5 );
|
||||||
|
|
||||||
Buff.affect( attacker, Charm.class, Charm.durationFactor( attacker ) * duration ).object = defender.id();
|
Buff.affect( attacker, Charm.class, Charm.durationFactor( attacker ) * duration ).object = defender.id();
|
||||||
attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
|
attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
|
||||||
|
|
||||||
duration *= Random.Float( 0.5f, 1 );
|
|
||||||
|
|
||||||
Buff.affect( defender, Charm.class, Charm.durationFactor( defender ) * duration ).object = attacker.id();
|
|
||||||
defender.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
|
|
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* Pixel Dungeon
|
||||||
|
* Copyright (C) 2012-2015 Oleg Dolya
|
||||||
|
*
|
||||||
|
* Shattered Pixel Dungeon
|
||||||
|
* Copyright (C) 2014-2016 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.armor.glyphs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
|
||||||
|
public class AntiMagic extends Armor.Glyph {
|
||||||
|
|
||||||
|
private static ItemSprite.Glowing TEAL = new ItemSprite.Glowing( 0x88EEFF );
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
|
//no proc effect, see Hero.damage
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemSprite.Glowing glowing() {
|
||||||
|
return TEAL;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,42 @@
|
||||||
|
/*
|
||||||
|
* Pixel Dungeon
|
||||||
|
* Copyright (C) 2012-2015 Oleg Dolya
|
||||||
|
*
|
||||||
|
* Shattered Pixel Dungeon
|
||||||
|
* Copyright (C) 2014-2016 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.armor.glyphs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
|
||||||
|
public class Brimstone extends Armor.Glyph {
|
||||||
|
|
||||||
|
private static ItemSprite.Glowing ORANGE = new ItemSprite.Glowing( 0xFF4400 );
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
|
//no proc effect, see Burning.act
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemSprite.Glowing glowing() {
|
||||||
|
return ORANGE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,97 @@
|
||||||
|
/*
|
||||||
|
* Pixel Dungeon
|
||||||
|
* Copyright (C) 2012-2015 Oleg Dolya
|
||||||
|
*
|
||||||
|
* Shattered Pixel Dungeon
|
||||||
|
* Copyright (C) 2014-2016 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.armor.glyphs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.Assets;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
import com.watabou.noosa.audio.Sample;
|
||||||
|
import com.watabou.utils.Bundle;
|
||||||
|
|
||||||
|
public class Camouflage extends Armor.Glyph {
|
||||||
|
|
||||||
|
private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x448822 );
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
|
//no proc effect, see HighGrass.trample
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemSprite.Glowing glowing() {
|
||||||
|
return GREEN;
|
||||||
|
}
|
||||||
|
|
||||||
|
public static class Camo extends Invisibility {
|
||||||
|
private int pos;
|
||||||
|
private int left;
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public boolean act() {
|
||||||
|
left--;
|
||||||
|
if (left == 0 || target.pos != pos) {
|
||||||
|
detach();
|
||||||
|
} else {
|
||||||
|
spend(TICK);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void set(int time){
|
||||||
|
left = time;
|
||||||
|
pos = target.pos;
|
||||||
|
Sample.INSTANCE.play( Assets.SND_MELD );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
return Messages.get(this, "name");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String desc() {
|
||||||
|
return Messages.get(this, "desc", dispTurns(left));
|
||||||
|
}
|
||||||
|
|
||||||
|
private static final String POS = "pos";
|
||||||
|
private static final String LEFT = "left";
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void storeInBundle( Bundle bundle ) {
|
||||||
|
super.storeInBundle( bundle );
|
||||||
|
bundle.put( POS, pos );
|
||||||
|
bundle.put( LEFT, left );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void restoreFromBundle( Bundle bundle ) {
|
||||||
|
super.restoreFromBundle( bundle );
|
||||||
|
pos = bundle.getInt( POS );
|
||||||
|
left = bundle.getInt( LEFT );
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -35,17 +35,17 @@ import com.watabou.utils.Random;
|
||||||
|
|
||||||
public class Entanglement extends Glyph {
|
public class Entanglement extends Glyph {
|
||||||
|
|
||||||
private static ItemSprite.Glowing GREEN = new ItemSprite.Glowing( 0x448822 );
|
private static ItemSprite.Glowing BROWN = new ItemSprite.Glowing( 0x663300 );
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc( Armor armor, Char attacker, Char defender, int damage ) {
|
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) {
|
if (Random.Int( 3 ) == 0) {
|
||||||
|
|
||||||
Buff.prolong( defender, Roots.class, 5 - level / 5 );
|
Buff.prolong( defender, Roots.class, 5 );
|
||||||
Buff.affect( defender, Earthroot.Armor.class ).level( 5 * (level + 1) );
|
Buff.affect( defender, Earthroot.Armor.class ).level( 5 + level );
|
||||||
CellEmitter.bottom( defender.pos ).start( EarthParticle.FACTORY, 0.05f, 8 );
|
CellEmitter.bottom( defender.pos ).start( EarthParticle.FACTORY, 0.05f, 8 );
|
||||||
Camera.main.shake( 1, 0.4f );
|
Camera.main.shake( 1, 0.4f );
|
||||||
|
|
||||||
|
@ -56,7 +56,7 @@ public class Entanglement extends Glyph {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Glowing glowing() {
|
public Glowing glowing() {
|
||||||
return GREEN;
|
return BROWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,22 @@
|
||||||
|
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
|
||||||
|
public class Flow extends Armor.Glyph {
|
||||||
|
|
||||||
|
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x0000FF );
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
|
//no proc effect, see hero.speed for effect.
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemSprite.Glowing glowing() {
|
||||||
|
return BLUE;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,47 @@
|
||||||
|
/*
|
||||||
|
* Pixel Dungeon
|
||||||
|
* Copyright (C) 2012-2015 Oleg Dolya
|
||||||
|
*
|
||||||
|
* Shattered Pixel Dungeon
|
||||||
|
* Copyright (C) 2014-2016 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.armor.glyphs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
|
||||||
|
public class Obfuscation extends Armor.Glyph {
|
||||||
|
|
||||||
|
private static ItemSprite.Glowing GREY = new ItemSprite.Glowing( 0x888888 );
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
|
//no proc effect, see hero.stealth for effect.
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int tierDRAdjust() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemSprite.Glowing glowing() {
|
||||||
|
return GREY;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.Lightning;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.traps.LightningTrap;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
||||||
|
@ -34,22 +33,20 @@ import com.watabou.utils.Random;
|
||||||
|
|
||||||
public class Potential extends Glyph {
|
public class Potential extends Glyph {
|
||||||
|
|
||||||
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x66CCEE );
|
private static ItemSprite.Glowing WHITE = new ItemSprite.Glowing( 0xFFFFFF, 0.5f );
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
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) {
|
if (Random.Int( level + 10 ) >= 9) {
|
||||||
|
|
||||||
int dmg = Random.IntRange( 1, damage );
|
defender.damage( Random.IntRange( defender.HT/20, defender.HT/10 ), LightningTrap.LIGHTNING );
|
||||||
attacker.damage( dmg, LightningTrap.LIGHTNING );
|
|
||||||
dmg = Random.IntRange( 1, dmg );
|
|
||||||
defender.damage( dmg, LightningTrap.LIGHTNING );
|
|
||||||
|
|
||||||
checkOwner( defender );
|
checkOwner( defender );
|
||||||
if (defender == Dungeon.hero) {
|
if (defender == Dungeon.hero) {
|
||||||
|
Dungeon.hero.belongings.charge(1f);
|
||||||
Camera.main.shake( 2, 0.3f );
|
Camera.main.shake( 2, 0.3f );
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -62,6 +59,6 @@ public class Potential extends Glyph {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Glowing glowing() {
|
public Glowing glowing() {
|
||||||
return BLUE;
|
return WHITE;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,18 +20,14 @@
|
||||||
*/
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
|
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Pushing;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
|
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
public class Repulsion extends Glyph {
|
public class Repulsion extends Armor.Glyph {
|
||||||
|
|
||||||
private static ItemSprite.Glowing WHITE = new ItemSprite.Glowing( 0xFFFFFF );
|
private static ItemSprite.Glowing WHITE = new ItemSprite.Glowing( 0xFFFFFF );
|
||||||
|
|
||||||
|
@ -40,31 +36,10 @@ public class Repulsion extends Glyph {
|
||||||
|
|
||||||
int level = Math.max( 0, armor.level() );
|
int level = Math.max( 0, armor.level() );
|
||||||
|
|
||||||
if (Level.adjacent( attacker.pos, defender.pos )
|
if (Random.Int( level + 5 ) >= 4){
|
||||||
&& !defender.properties().contains(Char.Property.IMMOVABLE)
|
int oppositeHero = attacker.pos + (attacker.pos - defender.pos);
|
||||||
&& Random.Int( level + 5) >= 4) {
|
Ballistica trajectory = new Ballistica(attacker.pos, oppositeHero, Ballistica.MAGIC_BOLT);
|
||||||
|
WandOfBlastWave.throwChar(attacker, trajectory, 2);
|
||||||
for (int i=0; i < Level.NEIGHBOURS8.length; i++) {
|
|
||||||
int ofs = Level.NEIGHBOURS8[i];
|
|
||||||
if (attacker.pos - defender.pos == ofs) {
|
|
||||||
int newPos = attacker.pos + ofs;
|
|
||||||
if ((Level.passable[newPos] || Level.avoid[newPos]) && Actor.findChar( newPos ) == null) {
|
|
||||||
|
|
||||||
Actor.addDelayed( new Pushing( attacker, attacker.pos, newPos ), -1 );
|
|
||||||
|
|
||||||
attacker.pos = newPos;
|
|
||||||
// FIXME
|
|
||||||
if (attacker instanceof Mob) {
|
|
||||||
Dungeon.level.mobPress( (Mob)attacker );
|
|
||||||
} else {
|
|
||||||
Dungeon.level.press( newPos, attacker );
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
|
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
* Pixel Dungeon
|
||||||
|
* Copyright (C) 2012-2015 Oleg Dolya
|
||||||
|
*
|
||||||
|
* Shattered Pixel Dungeon
|
||||||
|
* Copyright (C) 2014-2016 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.armor.glyphs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
|
||||||
|
public class Stone extends Armor.Glyph {
|
||||||
|
|
||||||
|
private static ItemSprite.Glowing GREY = new ItemSprite.Glowing( 0x222222 );
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
|
//no proc effect
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int tierDRAdjust() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int tierSTRAdjust() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemSprite.Glowing glowing() {
|
||||||
|
return GREY;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,52 @@
|
||||||
|
/*
|
||||||
|
* Pixel Dungeon
|
||||||
|
* Copyright (C) 2012-2015 Oleg Dolya
|
||||||
|
*
|
||||||
|
* Shattered Pixel Dungeon
|
||||||
|
* Copyright (C) 2014-2016 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.armor.glyphs;
|
||||||
|
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
|
|
||||||
|
public class Swiftness extends Armor.Glyph {
|
||||||
|
|
||||||
|
private static ItemSprite.Glowing YELLOW = new ItemSprite.Glowing( 0xFFFF00 );
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
|
//no proc effect, see hero.defenseskill and hero.speed for effect.
|
||||||
|
return damage;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int tierDRAdjust() {
|
||||||
|
return -2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int tierSTRAdjust() {
|
||||||
|
return -1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public ItemSprite.Glowing glowing() {
|
||||||
|
return YELLOW;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -20,46 +20,33 @@
|
||||||
*/
|
*/
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
|
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Bleeding;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite.Glowing;
|
|
||||||
import com.watabou.utils.Random;
|
import com.watabou.utils.Random;
|
||||||
|
|
||||||
public class Displacement extends Glyph {
|
public class Thorns extends Armor.Glyph {
|
||||||
|
|
||||||
private static ItemSprite.Glowing BLUE = new ItemSprite.Glowing( 0x66AAFF );
|
private static ItemSprite.Glowing RED = new ItemSprite.Glowing( 0x660022 );
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int proc( Armor armor, Char attacker, Char defender, int damage ) {
|
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||||
|
|
||||||
if (Dungeon.bossLevel()) {
|
int level = Math.max(0, armor.level());
|
||||||
return damage;
|
|
||||||
}
|
|
||||||
|
|
||||||
int nTries = (armor.level() < 0 ? 1 : armor.level() + 1) * 5;
|
if ( Random.Int( level/2 + 5) >= 4) {
|
||||||
for (int i=0; i < nTries; i++) {
|
|
||||||
int pos = Random.Int( Level.LENGTH );
|
|
||||||
if (Dungeon.visible[pos] && Level.passable[pos] && Actor.findChar( pos ) == null) {
|
|
||||||
|
|
||||||
ScrollOfTeleportation.appear( defender, pos );
|
Buff.affect( attacker, Bleeding.class).set( Math.max( level/2, damage));
|
||||||
Dungeon.level.press( pos, defender );
|
|
||||||
Dungeon.observe();
|
|
||||||
|
|
||||||
break;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return damage;
|
return damage;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public Glowing glowing() {
|
public ItemSprite.Glowing glowing() {
|
||||||
return BLUE;
|
return RED;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -48,7 +48,7 @@ public class Viscosity extends Glyph {
|
||||||
|
|
||||||
int level = Math.max( 0, armor.level() );
|
int level = Math.max( 0, armor.level() );
|
||||||
|
|
||||||
if (Random.Int( level + 7 ) >= 6) {
|
if (Random.Int( level + 4 ) >= 3) {
|
||||||
|
|
||||||
DeferedDamage debuff = defender.buff( DeferedDamage.class );
|
DeferedDamage debuff = defender.buff( DeferedDamage.class );
|
||||||
if (debuff == null) {
|
if (debuff == null) {
|
||||||
|
@ -118,7 +118,8 @@ public class Viscosity extends Glyph {
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
if (target.isAlive()) {
|
if (target.isAlive()) {
|
||||||
|
|
||||||
target.damage( 1, this );
|
int damageThisTick = Math.max(1, damage/10);
|
||||||
|
target.damage( damageThisTick, this );
|
||||||
if (target == Dungeon.hero && !target.isAlive()) {
|
if (target == Dungeon.hero && !target.isAlive()) {
|
||||||
|
|
||||||
Dungeon.fail( getClass() );
|
Dungeon.fail( getClass() );
|
||||||
|
@ -128,7 +129,8 @@ public class Viscosity extends Glyph {
|
||||||
}
|
}
|
||||||
spend( TICK );
|
spend( TICK );
|
||||||
|
|
||||||
if (--damage <= 0) {
|
damage -= damageThisTick;
|
||||||
|
if (damage <= 0) {
|
||||||
detach();
|
detach();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,7 +39,7 @@ public class RingOfElements extends Ring {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final HashSet<Class<?>> EMPTY = new HashSet<Class<?>>();
|
private static final HashSet<Class<?>> EMPTY = new HashSet<Class<?>>();
|
||||||
private static final HashSet<Class<?>> FULL;
|
public static final HashSet<Class<?>> FULL;
|
||||||
static {
|
static {
|
||||||
FULL = new HashSet<Class<?>>();
|
FULL = new HashSet<Class<?>>();
|
||||||
FULL.add( Burning.class );
|
FULL.add( Burning.class );
|
||||||
|
|
|
@ -382,7 +382,7 @@ public abstract class Wand extends Item {
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
|
||||||
protected class Charger extends Buff {
|
public class Charger extends Buff {
|
||||||
|
|
||||||
private static final float BASE_CHARGE_DELAY = 10f;
|
private static final float BASE_CHARGE_DELAY = 10f;
|
||||||
private static final float SCALING_CHARGE_ADDITION = 40f;
|
private static final float SCALING_CHARGE_ADDITION = 40f;
|
||||||
|
@ -402,7 +402,7 @@ public abstract class Wand extends Item {
|
||||||
@Override
|
@Override
|
||||||
public boolean act() {
|
public boolean act() {
|
||||||
if (curCharges < maxCharges)
|
if (curCharges < maxCharges)
|
||||||
gainCharge();
|
recharge();
|
||||||
|
|
||||||
if (partialCharge >= 1 && curCharges < maxCharges) {
|
if (partialCharge >= 1 && curCharges < maxCharges) {
|
||||||
partialCharge--;
|
partialCharge--;
|
||||||
|
@ -415,7 +415,7 @@ public abstract class Wand extends Item {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void gainCharge(){
|
private void recharge(){
|
||||||
int missingCharges = maxCharges - curCharges;
|
int missingCharges = maxCharges - curCharges;
|
||||||
|
|
||||||
float turnsToCharge = (float) (BASE_CHARGE_DELAY
|
float turnsToCharge = (float) (BASE_CHARGE_DELAY
|
||||||
|
@ -431,6 +431,16 @@ public abstract class Wand extends Item {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void gainCharge(float charge){
|
||||||
|
partialCharge += charge;
|
||||||
|
while (partialCharge >= 1f){
|
||||||
|
curCharges++;
|
||||||
|
partialCharge--;
|
||||||
|
}
|
||||||
|
curCharges = Math.min(curCharges, maxCharges);
|
||||||
|
updateQuickslot();
|
||||||
|
}
|
||||||
|
|
||||||
private void setScaleFactor(float value){
|
private void setScaleFactor(float value){
|
||||||
this.scalingFactor = value;
|
this.scalingFactor = value;
|
||||||
}
|
}
|
||||||
|
|
|
@ -98,7 +98,7 @@ public class WandOfBlastWave extends Wand {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void throwChar(final Char ch, final Ballistica trajectory, int power){
|
public static void throwChar(final Char ch, final Ballistica trajectory, int power){
|
||||||
int dist = Math.min(trajectory.dist, power);
|
int dist = Math.min(trajectory.dist, power);
|
||||||
|
|
||||||
if (ch.properties().contains(Char.Property.BOSS))
|
if (ch.properties().contains(Char.Property.BOSS))
|
||||||
|
@ -135,7 +135,7 @@ public class WandOfBlastWave extends Wand {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
//a weaker knockback, not dissimilar to the glyph of bounce, but a fair bit stronger.
|
//behaves just like glyph of Repulsion
|
||||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
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());
|
||||||
|
|
||||||
|
|
|
@ -32,6 +32,7 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Dewdrop;
|
||||||
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.armor.glyphs.Camouflage;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
|
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.SandalsOfNature;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
@ -84,10 +85,22 @@ public class HighGrass {
|
||||||
|
|
||||||
int leaves = 4;
|
int leaves = 4;
|
||||||
|
|
||||||
// Barkskin
|
|
||||||
if (ch instanceof Hero && ((Hero)ch).subClass == HeroSubClass.WARDEN) {
|
if (ch instanceof Hero) {
|
||||||
Buff.affect( ch, Barkskin.class ).level( ch.HT / 3 );
|
Hero hero = (Hero)ch;
|
||||||
leaves = 8;
|
|
||||||
|
// Barkskin
|
||||||
|
if (hero.subClass == HeroSubClass.WARDEN) {
|
||||||
|
Buff.affect(ch, Barkskin.class).level(ch.HT / 3);
|
||||||
|
leaves += 4;
|
||||||
|
}
|
||||||
|
|
||||||
|
//Camouflage
|
||||||
|
if (hero.belongings.armor != null && hero.belongings.armor.glyph != null
|
||||||
|
&& hero.belongings.armor.glyph instanceof Camouflage){
|
||||||
|
Buff.affect(hero, Camouflage.Camo.class).set(3 + hero.belongings.armor.level());
|
||||||
|
leaves += 4;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
CellEmitter.get( pos ).burst( LeafParticle.LEVEL_SPECIFIC, leaves );
|
CellEmitter.get( pos ).burst( LeafParticle.LEVEL_SPECIFIC, leaves );
|
||||||
|
|
|
@ -3,15 +3,23 @@ items.armor.glyphs.affection.name=%s of affection
|
||||||
|
|
||||||
items.armor.glyphs.antientropy.name=%s of anti-entropy
|
items.armor.glyphs.antientropy.name=%s of anti-entropy
|
||||||
|
|
||||||
items.armor.glyphs.displacement.name=%s of displacement
|
items.armor.glyphs.antimagic.name=%s of anti-magic
|
||||||
|
|
||||||
|
items.armor.glyphs.brimstone.name=%s of brimstone
|
||||||
|
|
||||||
|
items.armor.glyphs.camouflage.name=%s of camouflage
|
||||||
|
|
||||||
items.armor.glyphs.entanglement.name=%s of entanglement
|
items.armor.glyphs.entanglement.name=%s of entanglement
|
||||||
|
|
||||||
|
items.armor.glyphs.flow.name=%s of flow
|
||||||
|
|
||||||
items.armor.glyphs.metabolism.name=%s of metabolism
|
items.armor.glyphs.metabolism.name=%s of metabolism
|
||||||
|
|
||||||
items.armor.glyphs.multiplicity.name=%s of multiplicity
|
items.armor.glyphs.multiplicity.name=%s of multiplicity
|
||||||
items.armor.glyphs.multiplicity.rankings_desc=Killed by: glyph of multiplicity
|
items.armor.glyphs.multiplicity.rankings_desc=Killed by: glyph of multiplicity
|
||||||
|
|
||||||
|
items.armor.glyphs.obfuscation.name=%s of obfuscation
|
||||||
|
|
||||||
items.armor.glyphs.potential.name=%s of potential
|
items.armor.glyphs.potential.name=%s of potential
|
||||||
items.armor.glyphs.potential.rankings_desc=Killed by: glyph of potential
|
items.armor.glyphs.potential.rankings_desc=Killed by: glyph of potential
|
||||||
|
|
||||||
|
@ -19,12 +27,18 @@ items.armor.glyphs.repulsion.name=%s of repulsion
|
||||||
|
|
||||||
items.armor.glyphs.stench.name=%s of stench
|
items.armor.glyphs.stench.name=%s of stench
|
||||||
|
|
||||||
|
items.armor.glyphs.stone.name=%s of stone
|
||||||
|
|
||||||
|
items.armor.glyphs.swiftness.name=%s of swiftness
|
||||||
|
|
||||||
|
items.armor.glyphs.thorns.name=%s of thorns
|
||||||
|
|
||||||
items.armor.glyphs.viscosity.name=%s of viscosity
|
items.armor.glyphs.viscosity.name=%s of viscosity
|
||||||
items.armor.glyphs.viscosity.deferred=deferred %d
|
items.armor.glyphs.viscosity.deferred=deferred %d
|
||||||
items.armor.glyphs.viscosity$defereddamage.name=Deferred damage
|
items.armor.glyphs.viscosity$defereddamage.name=Deferred damage
|
||||||
items.armor.glyphs.viscosity$defereddamage.ondeath=The deferred damage killed you...
|
items.armor.glyphs.viscosity$defereddamage.ondeath=The deferred damage killed you...
|
||||||
items.armor.glyphs.viscosity$defereddamage.rankings_desc=Killed by deferred damage
|
items.armor.glyphs.viscosity$defereddamage.rankings_desc=Killed by deferred damage
|
||||||
items.armor.glyphs.viscosity$defereddamage.desc=While your armor's glyph has protected you from damage, it seems to be slowly paying you back for it.\n\nDamage is being dealt to you over time instead of immediately. You will take one damage per turn until there is no damage left.\n\nDeferred damage remaining: %d.
|
items.armor.glyphs.viscosity$defereddamage.desc=While your armor's glyph has protected you from damage, it seems to be slowly paying you back for it.\n\nDamage is being dealt to you over time instead of immediately.\n\nDeferred damage remaining: %d.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user