v2.0.0: fixed various crash bugs
This commit is contained in:
Binary file not shown.
|
Before Width: | Height: | Size: 1.5 KiB After Width: | Height: | Size: 1.6 KiB |
@@ -76,7 +76,8 @@ public class Bones {
|
|||||||
case 0:
|
case 0:
|
||||||
item = hero.belongings.weapon;
|
item = hero.belongings.weapon;
|
||||||
//if the hero has two weapons (champion), pick the stronger one
|
//if the hero has two weapons (champion), pick the stronger one
|
||||||
if (hero.belongings.secondWep != null && hero.belongings.secondWep.trueLevel() > item.trueLevel()){
|
if (hero.belongings.secondWep != null &&
|
||||||
|
(item == null || hero.belongings.secondWep.trueLevel() > item.trueLevel())){
|
||||||
item = hero.belongings.secondWep;
|
item = hero.belongings.secondWep;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|||||||
+8
-4
@@ -166,7 +166,10 @@ public class ElementalStrike extends ArmorAbility {
|
|||||||
Ballistica.STOP_SOLID | Ballistica.STOP_TARGET);
|
Ballistica.STOP_SOLID | Ballistica.STOP_TARGET);
|
||||||
|
|
||||||
KindOfWeapon w = hero.belongings.weapon();
|
KindOfWeapon w = hero.belongings.weapon();
|
||||||
Weapon.Enchantment enchantment = ((MeleeWeapon) w).enchantment;
|
Weapon.Enchantment enchantment = null;
|
||||||
|
if (w instanceof MeleeWeapon) {
|
||||||
|
enchantment = ((MeleeWeapon) w).enchantment;
|
||||||
|
}
|
||||||
Class<?extends Weapon.Enchantment> enchCls = null;
|
Class<?extends Weapon.Enchantment> enchCls = null;
|
||||||
if (enchantment != null){
|
if (enchantment != null){
|
||||||
enchCls = enchantment.getClass();
|
enchCls = enchantment.getClass();
|
||||||
@@ -182,6 +185,7 @@ public class ElementalStrike extends ArmorAbility {
|
|||||||
);
|
);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Weapon.Enchantment finalEnchantment = enchantment;
|
||||||
hero.sprite.attack(target, new Callback() {
|
hero.sprite.attack(target, new Callback() {
|
||||||
@Override
|
@Override
|
||||||
public void call() {
|
public void call() {
|
||||||
@@ -198,7 +202,7 @@ public class ElementalStrike extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
preAttackEffect(cone, hero, enchantment);
|
preAttackEffect(cone, hero, finalEnchantment);
|
||||||
|
|
||||||
if (enemy != null){
|
if (enemy != null){
|
||||||
AttackIndicator.target(enemy);
|
AttackIndicator.target(enemy);
|
||||||
@@ -207,9 +211,9 @@ public class ElementalStrike extends ArmorAbility {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
perCellEffect(cone, enchantment);
|
perCellEffect(cone, finalEnchantment);
|
||||||
|
|
||||||
perCharEffect(cone, hero, enemy, enchantment);
|
perCharEffect(cone, hero, enemy, finalEnchantment);
|
||||||
|
|
||||||
Invisibility.dispel();
|
Invisibility.dispel();
|
||||||
hero.spendAndNext(hero.attackDelay());
|
hero.spendAndNext(hero.attackDelay());
|
||||||
|
|||||||
@@ -1271,6 +1271,7 @@ public class GameScene extends PixelScene {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public static void flash( int color, boolean lightmode ) {
|
public static void flash( int color, boolean lightmode ) {
|
||||||
|
if (scene != null) {
|
||||||
//greater than 0 to account for negative values (which have the first bit set to 1)
|
//greater than 0 to account for negative values (which have the first bit set to 1)
|
||||||
if (color > 0 && color < 0x01000000) {
|
if (color > 0 && color < 0x01000000) {
|
||||||
scene.fadeIn(0xFF000000 | color, lightmode);
|
scene.fadeIn(0xFF000000 | color, lightmode);
|
||||||
@@ -1278,6 +1279,7 @@ public class GameScene extends PixelScene {
|
|||||||
scene.fadeIn(color, lightmode);
|
scene.fadeIn(color, lightmode);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
public static void gameOver() {
|
public static void gameOver() {
|
||||||
if (scene == null) return;
|
if (scene == null) return;
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public class HeroIcon extends Image {
|
|||||||
public static final int CHALLENGE = 28;
|
public static final int CHALLENGE = 28;
|
||||||
public static final int ELEMENTAL_STRIKE= 29;
|
public static final int ELEMENTAL_STRIKE= 29;
|
||||||
public static final int DUELIST_3 = 30;
|
public static final int DUELIST_3 = 30;
|
||||||
public static final int RATMOGRIFY = 33;
|
public static final int RATMOGRIFY = 31;
|
||||||
|
|
||||||
public HeroIcon(HeroSubClass subCls){
|
public HeroIcon(HeroSubClass subCls){
|
||||||
super( Assets.Interfaces.HERO_ICONS );
|
super( Assets.Interfaces.HERO_ICONS );
|
||||||
|
|||||||
Reference in New Issue
Block a user