v1.4.0: implemented the ring of arcana (minus brimstone effect)
This commit is contained in:
@@ -849,6 +849,11 @@ items.rings.ringofaccuracy.stats=When worn, this ring will increase your accurac
|
||||
items.rings.ringofaccuracy.typical_stats=When worn, this ring will typically increase your accuracy by _%s%%._
|
||||
items.rings.ringofaccuracy.desc=This ring increases your focus, making it easier for your attacks to find their mark. A cursed ring will instead make it harder for your attacks to connect.
|
||||
|
||||
items.rings.ringofarcana.name=ring of arcana
|
||||
items.rings.ringofarcana.stats=When worn, this ring will increase the power of enchants and glyphs by _%s%%._
|
||||
items.rings.ringofarcana.typical_stats=When worn, this ring will typically increase the power of enchants and glyphs by _%s%%._
|
||||
items.rings.ringofarcana.desc=This ring enhances magical enchantments on weapons and glyphs on armor, first increasing their activation chance and then the strength of their effects. A cursed ring will instead weaken enchantments and glyphs.
|
||||
|
||||
items.rings.ringofelements.name=ring of elements
|
||||
items.rings.ringofelements.stats=When worn, this ring will provide _%s%%_ elemental resistance.
|
||||
items.rings.ringofelements.typical_stats=When worn, this ring will typically provide _%s%%_ elemental resistance.
|
||||
|
||||
Binary file not shown.
|
Before Width: | Height: | Size: 1.6 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -81,6 +81,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Potential;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.exotic.PotionOfCleansing;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRetribution;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfTeleportation;
|
||||
@@ -668,7 +669,12 @@ public abstract class Char extends Actor {
|
||||
|
||||
if (HP < 0 && src instanceof Char){
|
||||
if (((Char) src).buff(Kinetic.KineticTracker.class) != null){
|
||||
Buff.affect((Char) src, Kinetic.ConservedDamage.class).setBonus(-HP);
|
||||
int dmgToAdd = -HP;
|
||||
dmgToAdd -= ((Char) src).buff(Kinetic.KineticTracker.class).conservedDamage;
|
||||
dmgToAdd = Math.round(dmgToAdd * RingOfArcana.enchantPowerMultiplier((Char) src));
|
||||
if (dmgToAdd > 0) {
|
||||
Buff.affect((Char) src, Kinetic.ConservedDamage.class).setBonus(dmgToAdd);
|
||||
}
|
||||
((Char) src).buff(Kinetic.KineticTracker.class).detach();
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1263,7 +1263,7 @@ public class Hero extends Char {
|
||||
//TODO improve this when I have proper damage source logic
|
||||
if (belongings.armor() != null && belongings.armor().hasGlyph(AntiMagic.class, this)
|
||||
&& AntiMagic.RESISTS.contains(src.getClass())){
|
||||
dmg -= AntiMagic.drRoll(belongings.armor().buffedLvl());
|
||||
dmg -= AntiMagic.drRoll(this, belongings.armor().buffedLvl());
|
||||
}
|
||||
|
||||
if (buff(Talent.WarriorFoodImmunity.class) != null){
|
||||
|
||||
@@ -271,7 +271,7 @@ public class ShadowClone extends ArmorAbility {
|
||||
&& Dungeon.hero.belongings.armor() != null
|
||||
&& Dungeon.hero.belongings.armor().hasGlyph(AntiMagic.class, this)
|
||||
&& AntiMagic.RESISTS.contains(src.getClass())){
|
||||
dmg -= AntiMagic.drRoll(Dungeon.hero.belongings.armor().buffedLvl());
|
||||
dmg -= AntiMagic.drRoll(Dungeon.hero, Dungeon.hero.belongings.armor().buffedLvl());
|
||||
}
|
||||
|
||||
super.damage(dmg, src);
|
||||
|
||||
@@ -100,7 +100,7 @@ public class ArmoredStatue extends Statue {
|
||||
//TODO improve this when I have proper damage source logic
|
||||
if (armor != null && armor.hasGlyph(AntiMagic.class, this)
|
||||
&& AntiMagic.RESISTS.contains(src.getClass())){
|
||||
dmg -= AntiMagic.drRoll(armor.buffedLvl());
|
||||
dmg -= AntiMagic.drRoll(this, armor.buffedLvl());
|
||||
}
|
||||
|
||||
super.damage( dmg, src );
|
||||
|
||||
@@ -799,7 +799,7 @@ public abstract class Mob extends Char {
|
||||
|
||||
//lucky enchant logic
|
||||
if (buff(Lucky.LuckProc.class) != null){
|
||||
Dungeon.level.drop(Lucky.genLoot(), pos).sprite.drop();
|
||||
Dungeon.level.drop(buff(Lucky.LuckProc.class).genLoot(), pos).sprite.drop();
|
||||
Lucky.showFlare(sprite);
|
||||
}
|
||||
|
||||
|
||||
@@ -199,7 +199,7 @@ public class PrismaticImage extends NPC {
|
||||
//TODO improve this when I have proper damage source logic
|
||||
if (hero != null && hero.belongings.armor() != null && hero.belongings.armor().hasGlyph(AntiMagic.class, this)
|
||||
&& AntiMagic.RESISTS.contains(src.getClass())){
|
||||
dmg -= AntiMagic.drRoll(hero.belongings.armor().buffedLvl());
|
||||
dmg -= AntiMagic.drRoll(hero, hero.belongings.armor().buffedLvl());
|
||||
}
|
||||
|
||||
super.damage(dmg, src);
|
||||
|
||||
@@ -60,6 +60,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfStrength;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.potions.PotionOfToxicGas;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfAccuracy;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEnergy;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfEvasion;
|
||||
@@ -437,6 +438,7 @@ public class Generator {
|
||||
|
||||
RING.classes = new Class<?>[]{
|
||||
RingOfAccuracy.class,
|
||||
RingOfArcana.class,
|
||||
RingOfEvasion.class,
|
||||
RingOfElements.class,
|
||||
RingOfForce.class,
|
||||
@@ -447,7 +449,7 @@ public class Generator {
|
||||
RingOfSharpshooting.class,
|
||||
RingOfTenacity.class,
|
||||
RingOfWealth.class};
|
||||
RING.probs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
RING.probs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1 };
|
||||
|
||||
ARTIFACT.classes = new Class<?>[]{
|
||||
CapeOfThorns.class,
|
||||
|
||||
@@ -56,6 +56,7 @@ 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.rings.RingOfArcana;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
@@ -352,15 +353,15 @@ public class Armor extends EquipableItem {
|
||||
break;
|
||||
}
|
||||
}
|
||||
if (!enemyNear) speed *= (1.2f + 0.04f * buffedLvl());
|
||||
if (!enemyNear) speed *= (1.2f + 0.04f * buffedLvl()) * RingOfArcana.enchantPowerMultiplier(owner);
|
||||
} else if (hasGlyph(Flow.class, owner) && Dungeon.level.water[owner.pos]){
|
||||
speed *= (2f + 0.25f*buffedLvl());
|
||||
speed *= (2f + 0.25f*buffedLvl()) * RingOfArcana.enchantPowerMultiplier(owner);
|
||||
}
|
||||
|
||||
if (hasGlyph(Bulk.class, owner) &&
|
||||
(Dungeon.level.map[owner.pos] == Terrain.DOOR
|
||||
|| Dungeon.level.map[owner.pos] == Terrain.OPEN_DOOR )) {
|
||||
speed /= 3f;
|
||||
speed /= 3f * RingOfArcana.enchantPowerMultiplier(owner);
|
||||
}
|
||||
|
||||
return speed;
|
||||
@@ -370,7 +371,7 @@ public class Armor extends EquipableItem {
|
||||
public float stealthFactor( Char owner, float stealth ){
|
||||
|
||||
if (hasGlyph(Obfuscation.class, owner)){
|
||||
stealth += 1 + buffedLvl()/3f;
|
||||
stealth += (1 + buffedLvl()/3f) * RingOfArcana.enchantPowerMultiplier(owner);
|
||||
}
|
||||
|
||||
return stealth;
|
||||
@@ -642,6 +643,10 @@ public class Armor extends EquipableItem {
|
||||
};
|
||||
|
||||
public abstract int proc( Armor armor, Char attacker, Char defender, int damage );
|
||||
|
||||
protected float procChanceMultiplier( Char defender ){
|
||||
return RingOfArcana.enchantPowerMultiplier(defender);
|
||||
}
|
||||
|
||||
public String name() {
|
||||
if (!curse())
|
||||
|
||||
@@ -44,7 +44,8 @@ public class AntiEntropy extends Glyph {
|
||||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
if (Random.Int( 8 ) == 0) {
|
||||
float procChance = 1/8f * procChanceMultiplier(defender);
|
||||
if ( Random.Float() < procChance ) {
|
||||
|
||||
for (int i : PathFinder.NEIGHBOURS8){
|
||||
Freezing.affect(defender.pos+i);
|
||||
|
||||
@@ -38,7 +38,8 @@ public class Corrosion extends Armor.Glyph {
|
||||
@Override
|
||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
if (Random.Int(10) == 0){
|
||||
float procChance = 1/10f * procChanceMultiplier(defender);
|
||||
if ( Random.Float() < procChance ) {
|
||||
int pos = defender.pos;
|
||||
for (int i : PathFinder.NEIGHBOURS9){
|
||||
Splash.at(pos+i, 0x000000, 5);
|
||||
|
||||
@@ -35,8 +35,9 @@ public class Displacement extends Armor.Glyph {
|
||||
@Override
|
||||
public int proc(Armor armor, Char attacker, Char defender, int damage ) {
|
||||
|
||||
if (defender == Dungeon.hero && Random.Int(20) == 0){
|
||||
ScrollOfTeleportation.teleportChar(Dungeon.hero);
|
||||
float procChance = 1/20f * procChanceMultiplier(defender);
|
||||
if ( Random.Float() < procChance ) {
|
||||
ScrollOfTeleportation.teleportChar(defender);
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
||||
@@ -40,7 +40,8 @@ public class Metabolism extends Glyph {
|
||||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
if (Random.Int( 6 ) == 0 && defender instanceof Hero) {
|
||||
float procChance = 1/6f * procChanceMultiplier(defender);
|
||||
if ( Random.Float() < procChance && defender instanceof Hero) {
|
||||
|
||||
//assumes using up 10% of starving, and healing of 1 hp per 10 turns;
|
||||
int healing = Math.min((int)Hunger.STARVING/100, defender.HT - defender.HP);
|
||||
|
||||
@@ -49,7 +49,8 @@ public class Multiplicity extends Armor.Glyph {
|
||||
@Override
|
||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
if (Random.Int(20) == 0){
|
||||
float procChance = 1/20f * procChanceMultiplier(defender);
|
||||
if ( Random.Float() < procChance ) {
|
||||
ArrayList<Integer> spawnPoints = new ArrayList<>();
|
||||
|
||||
for (int i = 0; i < PathFinder.NEIGHBOURS8.length; i++) {
|
||||
|
||||
@@ -38,8 +38,9 @@ public class Overgrowth extends Armor.Glyph {
|
||||
|
||||
@Override
|
||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
if ( Random.Int( 20 ) == 0) {
|
||||
|
||||
float procChance = 1/20f * procChanceMultiplier(defender);
|
||||
if ( Random.Float() < procChance ) {
|
||||
|
||||
Plant p = ((Plant.Seed) Generator.randomUsingDefaults(Generator.Category.SEED)).couch(defender.pos, null);
|
||||
|
||||
|
||||
@@ -36,7 +36,8 @@ public class Stench extends Armor.Glyph {
|
||||
@Override
|
||||
public int proc(Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
if ( Random.Int( 8 ) == 0) {
|
||||
float procChance = 1/8f * procChanceMultiplier(defender);
|
||||
if ( Random.Float() < procChance ) {
|
||||
|
||||
GameScene.add( Blob.seed( defender.pos, 250, ToxicGas.class ) );
|
||||
|
||||
|
||||
@@ -43,9 +43,12 @@ public class Affection extends Glyph {
|
||||
// lvl 0 - 15%
|
||||
// lvl 1 ~ 19%
|
||||
// lvl 2 ~ 23%
|
||||
if (Random.Int( level + 20 ) >= 17) {
|
||||
float procChance = (level+3f)/(level+20f) * procChanceMultiplier(defender);
|
||||
if (Random.Float() < procChance) {
|
||||
|
||||
Buff.affect( attacker, Charm.class, Charm.DURATION ).object = defender.id();
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
Buff.affect( attacker, Charm.class, Math.round(Charm.DURATION*powerMulti) ).object = defender.id();
|
||||
attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );
|
||||
|
||||
}
|
||||
|
||||
@@ -36,6 +36,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Warlock;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.YogFist;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bombs.Bomb;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ScrollOfPsionicBlast;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfDisintegration;
|
||||
@@ -106,8 +107,10 @@ public class AntiMagic extends Armor.Glyph {
|
||||
return damage;
|
||||
}
|
||||
|
||||
public static int drRoll( int level ){
|
||||
return Random.NormalIntRange(level, 3 + Math.round(level*1.5f));
|
||||
public static int drRoll( Char ch, int level ){
|
||||
return Random.NormalIntRange(
|
||||
Math.round(level * RingOfArcana.enchantPowerMultiplier(ch)),
|
||||
Math.round((3 + (level*1.5f)) * RingOfArcana.enchantPowerMultiplier(ch)));
|
||||
}
|
||||
|
||||
@Override
|
||||
|
||||
@@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Invisibility;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.watabou.noosa.audio.Sample;
|
||||
|
||||
@@ -41,7 +42,7 @@ public class Camouflage extends Armor.Glyph {
|
||||
}
|
||||
|
||||
public static void activate(Char ch, int level){
|
||||
Buff.prolong(ch, Invisibility.class, 3 + level/2);
|
||||
Buff.prolong(ch, Invisibility.class, Math.round((3 + level/2f)* RingOfArcana.enchantPowerMultiplier(ch)));
|
||||
if ( Dungeon.level.heroFOV[ch.pos] ) {
|
||||
Sample.INSTANCE.play( Assets.Sounds.MELD );
|
||||
}
|
||||
|
||||
@@ -41,10 +41,13 @@ public class Entanglement extends Glyph {
|
||||
public int proc(Armor armor, Char attacker, final Char defender, final int damage ) {
|
||||
|
||||
final int level = Math.max( 0, armor.buffedLvl() );
|
||||
|
||||
if (Random.Int( 4 ) == 0) {
|
||||
|
||||
Buff.affect( defender, Earthroot.Armor.class ).level( 5 + 2 * level );
|
||||
float procChance = 1/4f * procChanceMultiplier(defender);
|
||||
|
||||
if (Random.Float() < procChance) {
|
||||
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
Buff.affect( defender, Earthroot.Armor.class ).level( Math.round((5 + 2 * level)*powerMulti) );
|
||||
CellEmitter.bottom( defender.pos ).start( EarthParticle.FACTORY, 0.05f, 8 );
|
||||
Camera.main.shake( 1, 0.4f );
|
||||
|
||||
|
||||
@@ -42,8 +42,12 @@ public class Potential extends Glyph {
|
||||
// lvl 0 - 16.7%
|
||||
// lvl 1 - 28.6%
|
||||
// lvl 2 - 37.5%
|
||||
if (defender instanceof Hero && Random.Int( level + 6 ) >= 5 ) {
|
||||
int wands = ((Hero) defender).belongings.charge( 1f );
|
||||
float procChance = (level+1f)/(level+6f) * procChanceMultiplier(defender);
|
||||
if (Random.Float() < procChance && defender instanceof Hero) {
|
||||
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
int wands = ((Hero) defender).belongings.charge( powerMulti );
|
||||
if (wands > 0) {
|
||||
defender.sprite.centerEmitter().burst(EnergyParticle.FACTORY, 10);
|
||||
}
|
||||
|
||||
@@ -34,15 +34,25 @@ public class Repulsion extends Armor.Glyph {
|
||||
|
||||
@Override
|
||||
public int proc( Armor armor, Char attacker, Char defender, int damage) {
|
||||
|
||||
int level = Math.max( 0, armor.buffedLvl() );
|
||||
|
||||
// lvl 0 - 20%
|
||||
// lvl 1 - 33%
|
||||
// lvl 2 - 43%
|
||||
int level = Math.max( 0, armor.buffedLvl() );
|
||||
float procChance = (level+1f)/(level+5f) * procChanceMultiplier(defender);
|
||||
if (Random.Float() < procChance){
|
||||
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
if (Random.Int( level + 5 ) >= 4){
|
||||
int oppositeHero = attacker.pos + (attacker.pos - defender.pos);
|
||||
Ballistica trajectory = new Ballistica(attacker.pos, oppositeHero, Ballistica.MAGIC_BOLT);
|
||||
WandOfBlastWave.throwChar(attacker, trajectory, 2, true, true, getClass());
|
||||
WandOfBlastWave.throwChar(attacker,
|
||||
trajectory,
|
||||
Math.round(2 * powerMulti),
|
||||
true,
|
||||
true,
|
||||
getClass());
|
||||
}
|
||||
|
||||
return damage;
|
||||
|
||||
@@ -23,6 +23,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
import com.watabou.utils.GameMath;
|
||||
|
||||
@@ -37,6 +38,8 @@ public class Stone extends Armor.Glyph {
|
||||
float evasion = defender.defenseSkill(attacker);
|
||||
float accuracy = attacker.attackSkill(defender);
|
||||
testing = false;
|
||||
|
||||
evasion *= RingOfArcana.enchantPowerMultiplier(defender);
|
||||
|
||||
float hitChance;
|
||||
if (evasion >= accuracy){
|
||||
|
||||
@@ -40,9 +40,12 @@ public class Thorns extends Armor.Glyph {
|
||||
// lvl 0 - 16.7%
|
||||
// lvl 1 - 23.1%
|
||||
// lvl 2 - 28.5%
|
||||
if ( Random.Int( level + 12) >= 10) {
|
||||
float procChance = (level+2f)/(level+12f) * procChanceMultiplier(defender);
|
||||
if ( Random.Float() < procChance ) {
|
||||
|
||||
Buff.affect( attacker, Bleeding.class).set( 4 + level );
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
Buff.affect( attacker, Bleeding.class).set( Math.round((4 + level)*powerMulti) );
|
||||
|
||||
}
|
||||
|
||||
|
||||
@@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor.Glyph;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite;
|
||||
@@ -76,7 +77,15 @@ public class Viscosity extends Glyph {
|
||||
int level = Math.max( 0, this.level );
|
||||
|
||||
float percent = (level+1)/(float)(level+6);
|
||||
int amount = (int)Math.ceil(dmg * percent);
|
||||
percent *= RingOfArcana.enchantPowerMultiplier(target);
|
||||
|
||||
int amount;
|
||||
if (percent > 1f){
|
||||
dmg = Math.round(dmg / percent);
|
||||
amount = dmg;
|
||||
} else {
|
||||
amount = (int)Math.ceil(dmg * percent);
|
||||
}
|
||||
|
||||
if (amount > 0){
|
||||
DeferedDamage deferred = Buff.affect( target, DeferedDamage.class );
|
||||
|
||||
@@ -644,7 +644,7 @@ public class DriedRose extends Artifact {
|
||||
//TODO improve this when I have proper damage source logic
|
||||
if (rose != null && rose.armor != null && rose.armor.hasGlyph(AntiMagic.class, this)
|
||||
&& AntiMagic.RESISTS.contains(src.getClass())){
|
||||
dmg -= AntiMagic.drRoll(rose.armor.buffedLvl());
|
||||
dmg -= AntiMagic.drRoll(this, rose.armor.buffedLvl());
|
||||
}
|
||||
|
||||
super.damage( dmg, src );
|
||||
|
||||
@@ -0,0 +1,56 @@
|
||||
/*
|
||||
* Pixel Dungeon
|
||||
* Copyright (C) 2012-2015 Oleg Dolya
|
||||
*
|
||||
* Shattered Pixel Dungeon
|
||||
* Copyright (C) 2014-2022 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.rings;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
import java.text.DecimalFormat;
|
||||
|
||||
public class RingOfArcana extends Ring {
|
||||
|
||||
{
|
||||
icon = ItemSpriteSheet.Icons.RING_ARCANA;
|
||||
}
|
||||
|
||||
public String statsInfo() {
|
||||
if (isIdentified()){
|
||||
return Messages.get(this, "stats", new DecimalFormat("#.##").format(100f * (Math.pow(1.15f, soloBuffedBonus()) - 1f)));
|
||||
} else {
|
||||
return Messages.get(this, "typical_stats", new DecimalFormat("#.##").format(15f));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
protected RingBuff buff( ) {
|
||||
return new Arcana();
|
||||
}
|
||||
|
||||
public static float enchantPowerMultiplier(Char target ){
|
||||
return (float)Math.pow(1.15f, getBuffedBonus(target, Arcana.class));
|
||||
}
|
||||
|
||||
public class Arcana extends RingBuff {
|
||||
}
|
||||
|
||||
}
|
||||
@@ -179,6 +179,8 @@ public class WandOfBlastWave extends DamageWand {
|
||||
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//acts like elastic enchantment
|
||||
//FIXME this benefits from ring of arcana atm, change this
|
||||
new Elastic().proc(staff, attacker, defender, damage);
|
||||
}
|
||||
|
||||
|
||||
@@ -145,6 +145,7 @@ public class WandOfFireblast extends DamageWand {
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//acts like blazing enchantment
|
||||
//FIXME this benefits from ring of arcana atm, change this
|
||||
new Blazing().proc( staff, attacker, defender, damage);
|
||||
}
|
||||
|
||||
|
||||
@@ -99,6 +99,7 @@ public class WandOfLightning extends DamageWand {
|
||||
@Override
|
||||
public void onHit(MagesStaff staff, Char attacker, Char defender, int damage) {
|
||||
//acts like shocking enchantment
|
||||
//FIXME this benefits from ring of arcana atm, change this
|
||||
new Shocking().proc(staff, attacker, defender, damage);
|
||||
}
|
||||
|
||||
|
||||
@@ -30,6 +30,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfFuror;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Annoying;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Displacing;
|
||||
@@ -208,7 +209,11 @@ abstract public class Weapon extends KindOfWeapon {
|
||||
|
||||
@Override
|
||||
public int reachFactor(Char owner) {
|
||||
return hasEnchant(Projecting.class, owner) ? RCH+1 : RCH;
|
||||
if (hasEnchant(Projecting.class, owner)){
|
||||
return RCH + Math.round(RingOfArcana.enchantPowerMultiplier(owner));
|
||||
} else {
|
||||
return RCH;
|
||||
}
|
||||
}
|
||||
|
||||
public int STRReq(){
|
||||
@@ -361,7 +366,7 @@ abstract public class Weapon extends KindOfWeapon {
|
||||
public abstract int proc( Weapon weapon, Char attacker, Char defender, int damage );
|
||||
|
||||
protected float procChanceMultiplier( Char attacker ){
|
||||
float multi = 1f;
|
||||
float multi = RingOfArcana.enchantPowerMultiplier(attacker);
|
||||
if (attacker instanceof Hero && ((Hero) attacker).hasTalent(Talent.ENRAGED_CATALYST)){
|
||||
Berserk rage = attacker.buff(Berserk.class);
|
||||
if (rage != null) {
|
||||
|
||||
@@ -44,11 +44,13 @@ public class Blazing extends Weapon.Enchantment {
|
||||
// lvl 2 - 60%
|
||||
float procChance = (level+1f)/(level+3f) * procChanceMultiplier(attacker);
|
||||
if (Random.Float() < procChance) {
|
||||
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
if (defender.buff(Burning.class) != null){
|
||||
Buff.affect(defender, Burning.class).reignite(defender, 8f);
|
||||
int burnDamage = Random.NormalIntRange( 1, 3 + Dungeon.scalingDepth()/4 );
|
||||
defender.damage( Math.round(burnDamage * 0.67f), this );
|
||||
defender.damage( Math.round(burnDamage * 0.67f * powerMulti), this );
|
||||
} else {
|
||||
Buff.affect(defender, Burning.class).reignite(defender, 8f);
|
||||
}
|
||||
|
||||
@@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.FlavourBuff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite;
|
||||
@@ -41,7 +42,8 @@ public class Blocking extends Weapon.Enchantment {
|
||||
|
||||
int level = Math.max( 0, weapon.buffedLvl() );
|
||||
|
||||
Buff.prolong(attacker, BlockBuff.class, 2 + level/2).setBlocking(level + 1);
|
||||
Buff.prolong(attacker, BlockBuff.class, 2 + level/2 * RingOfArcana.enchantPowerMultiplier(attacker))
|
||||
.setBlocking(Math.round((level + 1) * RingOfArcana.enchantPowerMultiplier(attacker)));
|
||||
|
||||
return damage;
|
||||
}
|
||||
|
||||
@@ -48,11 +48,21 @@ public class Blooming extends Weapon.Enchantment {
|
||||
// lvl 2 - 60%
|
||||
float procChance = (level+1f)/(level+3f) * procChanceMultiplier(attacker);
|
||||
if (Random.Float() < procChance) {
|
||||
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
float plants = (1f + 0.1f*level) * powerMulti;
|
||||
if (Random.Float() < plants%1){
|
||||
plants = (float)Math.ceil(plants);
|
||||
} else {
|
||||
plants = (float)Math.floor(plants);
|
||||
}
|
||||
|
||||
boolean secondPlant = level > Random.Int(10);
|
||||
if (plantGrass(defender.pos)){
|
||||
if (secondPlant) secondPlant = false;
|
||||
else return damage;
|
||||
plants--;
|
||||
if (plants <= 0){
|
||||
return damage;
|
||||
}
|
||||
}
|
||||
|
||||
ArrayList<Integer> positions = new ArrayList<>();
|
||||
@@ -62,8 +72,10 @@ public class Blooming extends Weapon.Enchantment {
|
||||
Random.shuffle( positions );
|
||||
for (int i : positions){
|
||||
if (plantGrass(defender.pos + i)){
|
||||
if (secondPlant) secondPlant = false;
|
||||
else return damage;
|
||||
plants--;
|
||||
if (plants <= 0) {
|
||||
return damage;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,12 +43,14 @@ public class Chilling extends Weapon.Enchantment {
|
||||
// lvl 2 - 50%
|
||||
float procChance = (level+1f)/(level+4f) * procChanceMultiplier(attacker);
|
||||
if (Random.Float() < procChance) {
|
||||
|
||||
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
//adds 3 turns of chill per proc, with a cap of 6 turns
|
||||
float durationToAdd = 3f;
|
||||
float durationToAdd = 3f * powerMulti;
|
||||
Chill existing = defender.buff(Chill.class);
|
||||
if (existing != null){
|
||||
durationToAdd = Math.min(durationToAdd, 6f-existing.cooldown());
|
||||
durationToAdd = Math.min(durationToAdd, (6f*powerMulti)-existing.cooldown());
|
||||
}
|
||||
|
||||
Buff.affect( defender, Chill.class, durationToAdd );
|
||||
|
||||
@@ -25,6 +25,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Statistics;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Adrenaline;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.AllyBuff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Corruption;
|
||||
@@ -63,6 +64,12 @@ public class Corrupting extends Weapon.Enchantment {
|
||||
Corruption.corruptionHeal(enemy);
|
||||
|
||||
AllyBuff.affectAndLoot(enemy, hero, Corruption.class);
|
||||
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
if (powerMulti > 1.1f){
|
||||
//1 turn of adrenaline for each 20% above 100% proc rate
|
||||
Buff.affect(enemy, Adrenaline.class, Math.round(5*(powerMulti-1f)));
|
||||
}
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
@@ -43,6 +43,9 @@ public class Elastic extends Weapon.Enchantment {
|
||||
// lvl 2 - 43%
|
||||
float procChance = (level+1f)/(level+5f) * procChanceMultiplier(attacker);
|
||||
if (Random.Float() < procChance) {
|
||||
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
//trace a ballistica to our target (which will also extend past them
|
||||
Ballistica trajectory = new Ballistica(attacker.pos, defender.pos, Ballistica.STOP_TARGET);
|
||||
//trim it to just be the part that goes past them
|
||||
@@ -50,7 +53,7 @@ public class Elastic extends Weapon.Enchantment {
|
||||
//knock them back along that ballistica
|
||||
WandOfBlastWave.throwChar(defender,
|
||||
trajectory,
|
||||
2,
|
||||
Math.round(2 * powerMulti),
|
||||
!(weapon instanceof MissileWeapon || weapon instanceof SpiritBow),
|
||||
true,
|
||||
getClass());
|
||||
|
||||
@@ -45,7 +45,7 @@ public class Kinetic extends Weapon.Enchantment {
|
||||
}
|
||||
|
||||
//use a tracker so that we can know the true final damage
|
||||
Buff.affect(attacker, KineticTracker.class);
|
||||
Buff.affect(attacker, KineticTracker.class).conservedDamage = conservedDamage;
|
||||
|
||||
return damage + conservedDamage;
|
||||
}
|
||||
@@ -61,6 +61,8 @@ public class Kinetic extends Weapon.Enchantment {
|
||||
actPriority = Actor.VFX_PRIO;
|
||||
}
|
||||
|
||||
public int conservedDamage;
|
||||
|
||||
@Override
|
||||
public boolean act() {
|
||||
detach();
|
||||
|
||||
@@ -44,7 +44,12 @@ public class Lucky extends Weapon.Enchantment {
|
||||
// lvl 2 ~ 14%
|
||||
float procChance = (level+4f)/(level+40f) * procChanceMultiplier(attacker);
|
||||
if (defender.HP <= damage && Random.Float() < procChance){
|
||||
Buff.affect(defender, LuckProc.class);
|
||||
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
//default is -5: 80% common, 20% uncommon, 0% rare
|
||||
//ring level increases by 1 for each 20% above 100% proc rate
|
||||
Buff.affect(defender, LuckProc.class).ringLevel = -10 + Math.round(5*powerMulti);
|
||||
}
|
||||
|
||||
return damage;
|
||||
@@ -67,12 +72,19 @@ public class Lucky extends Weapon.Enchantment {
|
||||
|
||||
//used to keep track of whether a luck proc is incoming. see Mob.die()
|
||||
public static class LuckProc extends Buff {
|
||||
|
||||
private int ringLevel = -5;
|
||||
|
||||
@Override
|
||||
public boolean act() {
|
||||
detach();
|
||||
return true;
|
||||
}
|
||||
|
||||
public Item genLoot(){
|
||||
detach();
|
||||
return RingOfWealth.genConsumableDrop(ringLevel);
|
||||
}
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -49,6 +49,8 @@ public class Shocking extends Weapon.Enchantment {
|
||||
// lvl 2 - 50%
|
||||
float procChance = (level+1f)/(level+4f) * procChanceMultiplier(attacker);
|
||||
if (Random.Float() < procChance) {
|
||||
|
||||
float powerMulti = Math.max(1f, procChance);
|
||||
|
||||
affected.clear();
|
||||
arcs.clear();
|
||||
@@ -58,7 +60,7 @@ public class Shocking extends Weapon.Enchantment {
|
||||
affected.remove(defender); //defender isn't hurt by lightning
|
||||
for (Char ch : affected) {
|
||||
if (ch.alignment != attacker.alignment) {
|
||||
ch.damage(Math.round(damage * 0.4f), this);
|
||||
ch.damage(Math.round(damage * 0.4f * powerMulti), this);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -43,9 +43,11 @@ public class Vampiric extends Weapon.Enchantment {
|
||||
healChance *= procChanceMultiplier(attacker);
|
||||
|
||||
if (Random.Float() < healChance){
|
||||
|
||||
float powerMulti = Math.max(1f, healChance);
|
||||
|
||||
//heals for 50% of damage dealt
|
||||
int healAmt = Math.round(damage * 0.5f);
|
||||
int healAmt = Math.round(damage * 0.5f * powerMulti);
|
||||
healAmt = Math.min( healAmt, attacker.HT - attacker.HP );
|
||||
|
||||
if (healAmt > 0 && attacker.isAlive()) {
|
||||
|
||||
@@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.MagicalHolster;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfArcana;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfSharpshooting;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.SpiritBow;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
@@ -163,7 +164,9 @@ abstract public class MissileWeapon extends Weapon {
|
||||
}
|
||||
}
|
||||
|
||||
if (projecting && !Dungeon.level.solid[dst] && Dungeon.level.distance(user.pos, dst) <= 4){
|
||||
if (projecting
|
||||
&& !Dungeon.level.solid[dst]
|
||||
&& Dungeon.level.distance(user.pos, dst) <= Math.round(4 * RingOfArcana.enchantPowerMultiplier(user))){
|
||||
return dst;
|
||||
} else {
|
||||
return super.throwPos(user, dst);
|
||||
|
||||
@@ -720,19 +720,20 @@ public class ItemSpriteSheet {
|
||||
|
||||
private static final int RINGS = xy(1, 1); //16 slots
|
||||
public static final int RING_ACCURACY = RINGS+0;
|
||||
public static final int RING_ELEMENTS = RINGS+1;
|
||||
public static final int RING_ENERGY = RINGS+2;
|
||||
public static final int RING_EVASION = RINGS+3;
|
||||
public static final int RING_FORCE = RINGS+4;
|
||||
public static final int RING_FUROR = RINGS+5;
|
||||
public static final int RING_HASTE = RINGS+6;
|
||||
public static final int RING_MIGHT = RINGS+7;
|
||||
public static final int RING_SHARPSHOOT = RINGS+8;
|
||||
public static final int RING_TENACITY = RINGS+9;
|
||||
public static final int RING_WEALTH = RINGS+10;
|
||||
public static final int RING_UNUSED = RINGS+11;
|
||||
public static final int RING_ARCANA = RINGS+1;
|
||||
public static final int RING_ELEMENTS = RINGS+2;
|
||||
public static final int RING_ENERGY = RINGS+3;
|
||||
public static final int RING_EVASION = RINGS+4;
|
||||
public static final int RING_FORCE = RINGS+5;
|
||||
public static final int RING_FUROR = RINGS+6;
|
||||
public static final int RING_HASTE = RINGS+7;
|
||||
public static final int RING_MIGHT = RINGS+8;
|
||||
public static final int RING_SHARPSHOOT = RINGS+9;
|
||||
public static final int RING_TENACITY = RINGS+10;
|
||||
public static final int RING_WEALTH = RINGS+11;
|
||||
static {
|
||||
assignIconRect( RING_ACCURACY, 7, 7 );
|
||||
assignIconRect( RING_ARCANA, 7, 7 );
|
||||
assignIconRect( RING_ELEMENTS, 7, 7 );
|
||||
assignIconRect( RING_ENERGY, 7, 5 );
|
||||
assignIconRect( RING_EVASION, 7, 7 );
|
||||
|
||||
Reference in New Issue
Block a user