diff --git a/android/debug/output.json b/android/debug/output.json index ed14b1e3..733e6a85 100644 --- a/android/debug/output.json +++ b/android/debug/output.json @@ -1 +1 @@ -[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":11,"versionName":"0.3.6-INDEV","enabled":true,"outputFile":"android-debug.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"android-debug.apk","properties":{}}] \ No newline at end of file +[{"outputType":{"type":"APK"},"apkData":{"type":"MAIN","splits":[],"versionCode":12,"versionName":"0.3.7-INDEV","enabled":true,"outputFile":"android-debug.apk","fullName":"debug","baseName":"debug","dirName":""},"path":"android-debug.apk","properties":{}}] \ No newline at end of file diff --git a/core/src/main/java/com/shatteredpixel/yasd/general/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/yasd/general/actors/hero/Hero.java index 3bba6e8a..0f0dc9ee 100644 --- a/core/src/main/java/com/shatteredpixel/yasd/general/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/yasd/general/actors/hero/Hero.java @@ -250,9 +250,10 @@ public void useStamina(float amount) { } stamina -= amount; if (stamina < 0) { - int damage = (int) (-stamina*(HT/40)); + int damage = (int) (stamina*3); stamina = 0; - damage(damage, new DamageSrc(Element.META).ignoreDefense()); + //damage(damage, new DamageSrc(Element.META).ignoreDefense()); + Buff.affect(this, Hunger.class).reduceHunger(damage); if (!isAlive()){ Dungeon.fail( Stamina.class ); GLog.n( Messages.get( this, "exhausted") ); diff --git a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Blocking.java b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Blocking.java index 6dccd478..f542170d 100644 --- a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Blocking.java +++ b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Blocking.java @@ -47,7 +47,7 @@ public int proc(Weapon weapon, Char attacker, Char defender, int damage) { int level = Math.max( 0, weapon.level() ); - Buff.prolong(attacker, BlockBuff.class, 2 + level/2).setBlocking(level*2 + 2); + Buff.prolong(attacker, BlockBuff.class, 2 + level/2f).setBlocking(level + 2); return damage; } diff --git a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Blooming.java b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Blooming.java index b28a43ad..47bbc758 100644 --- a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Blooming.java +++ b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Blooming.java @@ -53,7 +53,7 @@ public int proc(Weapon weapon, Char attacker, Char defender, int damage) { // lvl 2 - 60% int level = Math.max( 0, weapon.level() ); - if (Random.Int( level + 3 ) >= 2) { + if (Random.Int( level + 3 ) > 2) { boolean secondPlant = level > Random.Int(10); if (plantGrass(defender.pos)){ diff --git a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Chilling.java b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Chilling.java index 82bdf525..a2f4c834 100644 --- a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Chilling.java +++ b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Chilling.java @@ -47,7 +47,7 @@ public int proc( Weapon weapon, Char attacker, Char defender, int damage ) { // lvl 2 - 60% int level = Math.max( 0, weapon.level() ); - if (Random.Int( level + 5 ) >= 4) { + if (Random.Int( level + 5 ) > 4) { //adds 3 turns of chill per proc, with a cap of 6 turns float durationToAdd = 3f; diff --git a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Corrupting.java b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Corrupting.java index c3421234..66be62eb 100644 --- a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Corrupting.java +++ b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Corrupting.java @@ -58,7 +58,7 @@ public int proc(Weapon weapon, Char attacker, Char defender, int damage) { // lvl 2 ~ 25% if (damage >= defender.HP && !defender.isImmune(Corruption.class) - && Random.Int( level + 15 ) >= 12){ + && Random.Int( level/2 + 15 ) > 12) { Mob enemy = (Mob) defender; Hero hero = (attacker instanceof Hero) ? (Hero) attacker : Dungeon.hero; diff --git a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Elastic.java b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Elastic.java index 373ae00d..26fe4f23 100644 --- a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Elastic.java +++ b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Elastic.java @@ -45,7 +45,7 @@ public int proc(Weapon weapon, Char attacker, Char defender, int damage ) { // lvl 2 - 43% int level = Math.max( 0, weapon.level() ); - if (Random.Int( level + 5 ) >= 4) { + if (Random.Int( level/3 + 5 ) > 3) { //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 diff --git a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Grim.java b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Grim.java index e4e06a53..f0b4f9d6 100644 --- a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Grim.java +++ b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Grim.java @@ -40,31 +40,26 @@ public class Grim extends Weapon.Enchantment { private static ItemSprite.Glowing BLACK = new ItemSprite.Glowing( 0x000000 ); - - @Override - public int proc( Weapon weapon, Char attacker, Char defender, int damage ) { - int level = Math.max( 0, weapon.level() ); + @Override + public int proc(Weapon weapon, Char attacker, Char defender, int damage ) { int enemyHealth = defender.HP - damage; if (enemyHealth <= 0) return damage; //no point in proccing if they're already dead. - //scales from 0 - 50% based on how low hp the enemy is, plus 5% per level - float maxChance = 0.5f + .08f*level; - float chanceMulti = (float)Math.pow( ((defender.HT - enemyHealth) / (float)defender.HT), 2); - float chance = maxChance * chanceMulti; - + float chance = ((float)(damage/2))/defender.HP;//Chance is now half of damage dealt out of enemy hp. This is a massive nerf for fast weapons but a smaller one for slow weapons. + if (Random.Float() < chance) { - + defender.damage( defender.HP, new Char.DamageSrc(Element.SPIRIT, this).ignoreDefense()); - defender.sprite.emitter().burst( ShadowParticle.UP, 5 ); - + int level = 0; + defender.sprite.emitter().burst( ShadowParticle.UP, 5 + level ); + if (!defender.isAlive() && attacker instanceof Hero - //this prevents unstable from triggering grim achievement - && weapon.hasEnchant(Grim.class, attacker)) { + //this prevents unstable from triggering grim achievement + && weapon.hasEnchant(Grim.class, attacker)) { Badges.validateGrimWeapon(); } - } return damage; diff --git a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Lucky.java b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Lucky.java index e41621ee..01eaf2e1 100644 --- a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Lucky.java +++ b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Lucky.java @@ -29,9 +29,8 @@ import com.shatteredpixel.yasd.general.actors.Char; import com.shatteredpixel.yasd.general.actors.buffs.Buff; -import com.shatteredpixel.yasd.general.items.Generator; -import com.shatteredpixel.yasd.general.items.Gold; import com.shatteredpixel.yasd.general.items.Item; +import com.shatteredpixel.yasd.general.items.powers.LuckyBadge; import com.shatteredpixel.yasd.general.items.weapon.Weapon; import com.shatteredpixel.yasd.general.sprites.ItemSprite; import com.shatteredpixel.yasd.general.sprites.ItemSprite.Glowing; @@ -58,7 +57,8 @@ public int proc( Weapon weapon, Char attacker, Char defender, int damage ) { } public static Item genLoot(){ - float roll = Random.Float(); + return LuckyBadge.tryForBonusDrop(); + /*float roll = Random.Float(); if (roll < 0.6f){ Item result = new Gold().random(); result.quantity(Math.round(result.quantity() * 0.5f)); @@ -71,7 +71,7 @@ public static Item genLoot(){ return Random.Int(2) == 0 ? Generator.random(Generator.Category.POTION) : Generator.random(Generator.Category.SCROLL); - } + }*/ } @Override diff --git a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Vampiric.java b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Vampiric.java index 5d7eafaf..ebec0301 100644 --- a/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Vampiric.java +++ b/core/src/main/java/com/shatteredpixel/yasd/general/items/weapon/enchantments/Vampiric.java @@ -44,14 +44,14 @@ public int proc( Weapon weapon, Char attacker, Char defender, int damage ) { float missingPercent = (attacker.HT - attacker.HP) / (float)attacker.HT, maxHeal = (.025f + missingPercent * .125f) * 2, // min max heal is .025%, consistent with shattered. healPercent = 0; - int tries = weapon.level(); + int tries = 1 + weapon.level()/5; do { healPercent = Math.max(healPercent, Random.NormalFloat(0,maxHeal)); } while(tries-- > 0); int healAmt = Math.min( Math.round(healPercent*damage), attacker.HT - attacker.HP ); if (healAmt > 0 && attacker.isAlive()) { - attacker.heal(healAmt, false); + attacker.heal(healAmt, false, true); } return damage;