Skip to content

Commit

Permalink
Nerfed most enchantments.
Browse files Browse the repository at this point in the history
  • Loading branch information
Smujb committed Jun 24, 2020
1 parent d768594 commit 1f6d8c5
Show file tree
Hide file tree
Showing 10 changed files with 25 additions and 29 deletions.
2 changes: 1 addition & 1 deletion android/debug/output.json
Original file line number Diff line number Diff line change
@@ -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":{}}]
[{"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":{}}]
Original file line number Diff line number Diff line change
Expand Up @@ -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") );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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)){
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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));
Expand All @@ -71,7 +71,7 @@ public static Item genLoot(){
return Random.Int(2) == 0
? Generator.random(Generator.Category.POTION)
: Generator.random(Generator.Category.SCROLL);
}
}*/
}

@Override
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit 1f6d8c5

Please sign in to comment.