v1.4.0: adjusted blooming to prefer to not place grass on the hero
This commit is contained in:
+11
-3
@@ -46,7 +46,7 @@ public class Blooming extends Weapon.Enchantment {
|
|||||||
// lvl 0 - 33%
|
// lvl 0 - 33%
|
||||||
// lvl 1 - 50%
|
// lvl 1 - 50%
|
||||||
// lvl 2 - 60%
|
// lvl 2 - 60%
|
||||||
float procChance = (level+1f)/(level+3f) * procChanceMultiplier(attacker);
|
float procChance = (level+1f)/(level+1f) * procChanceMultiplier(attacker);
|
||||||
if (Random.Float() < procChance) {
|
if (Random.Float() < procChance) {
|
||||||
|
|
||||||
float powerMulti = Math.max(1f, procChance);
|
float powerMulti = Math.max(1f, procChance);
|
||||||
@@ -67,11 +67,19 @@ public class Blooming extends Weapon.Enchantment {
|
|||||||
|
|
||||||
ArrayList<Integer> positions = new ArrayList<>();
|
ArrayList<Integer> positions = new ArrayList<>();
|
||||||
for (int i : PathFinder.NEIGHBOURS8){
|
for (int i : PathFinder.NEIGHBOURS8){
|
||||||
positions.add(i);
|
if (defender.pos + i != attacker.pos) {
|
||||||
|
positions.add(defender.pos + i);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
Random.shuffle( positions );
|
Random.shuffle( positions );
|
||||||
|
|
||||||
|
//The attacker's position is always lowest priority
|
||||||
|
if (Dungeon.level.adjacent(attacker.pos, defender.pos)){
|
||||||
|
positions.add(attacker.pos);
|
||||||
|
}
|
||||||
|
|
||||||
for (int i : positions){
|
for (int i : positions){
|
||||||
if (plantGrass(defender.pos + i)){
|
if (plantGrass(i)){
|
||||||
plants--;
|
plants--;
|
||||||
if (plants <= 0) {
|
if (plants <= 0) {
|
||||||
return damage;
|
return damage;
|
||||||
|
|||||||
Reference in New Issue
Block a user