v2.0.0: repulsion now only triggers if enemy is adjacent

This commit is contained in:
Evan Debenham
2022-11-29 12:00:26 -05:00
parent 472b2785a8
commit e502680851

View File

@@ -21,6 +21,7 @@
package com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave;
@@ -41,7 +42,7 @@ public class Repulsion extends Armor.Glyph {
// lvl 1 - 33%
// lvl 2 - 43%
float procChance = (level+1f)/(level+5f) * procChanceMultiplier(defender);
if (Random.Float() < procChance){
if (Dungeon.level.adjacent(attacker.pos, defender.pos) && Random.Float() < procChance){
float powerMulti = Math.max(1f, procChance);