diff --git a/RemixedDungeon/src/main/assets/scripts/buffs/Counter.lua b/RemixedDungeon/src/main/assets/scripts/buffs/Counter.lua index f4e39483c..c62b994d1 100644 --- a/RemixedDungeon/src/main/assets/scripts/buffs/Counter.lua +++ b/RemixedDungeon/src/main/assets/scripts/buffs/Counter.lua @@ -33,6 +33,6 @@ return buff.init{ RPD.debug("counter: %d", self.data.counter) storage.gamePut("CounterBuffTest", self.data.counter) storage.put("CounterBuffTest", self.data.counter) - buff.target:getSprite():showStatus( 0xFF00FF, tostring(self.data.counter)) + buff.target:showStatus( 0xFF00FF, tostring(self.data.counter)) end } \ No newline at end of file diff --git a/RemixedDungeon/src/main/assets/scripts/items/ArmorTemplate.lua b/RemixedDungeon/src/main/assets/scripts/items/ArmorTemplate.lua index b733ec0be..96ac3ef8e 100644 --- a/RemixedDungeon/src/main/assets/scripts/items/ArmorTemplate.lua +++ b/RemixedDungeon/src/main/assets/scripts/items/ArmorTemplate.lua @@ -37,7 +37,7 @@ return item.init{ end, defenceProc = function(self, item, attacker, defender, damage) - defender:getSprite():showStatus(0x00b77070,"ouch!") + defender:showStatus(0x00b77070,"ouch!") return damage end, } diff --git a/RemixedDungeon/src/main/assets/scripts/items/test/TestItem.lua b/RemixedDungeon/src/main/assets/scripts/items/test/TestItem.lua index ede64d316..eaf3dca75 100644 --- a/RemixedDungeon/src/main/assets/scripts/items/test/TestItem.lua +++ b/RemixedDungeon/src/main/assets/scripts/items/test/TestItem.lua @@ -241,7 +241,7 @@ return itemLib.init{ self.data.counter = (self.data.counter or 0) + 1 if item:getOwner():valid() then - item:getOwner():getSprite():showStatus( 0xFF00FF, tostring(self.data.counter)) + item:getOwner():showStatus( 0xFF00FF, tostring(self.data.counter)) end item:spend(1) diff --git a/RemixedDungeon/src/main/assets/scripts/npc/BlackCat.lua b/RemixedDungeon/src/main/assets/scripts/npc/BlackCat.lua index b5ea7b89d..263163011 100644 --- a/RemixedDungeon/src/main/assets/scripts/npc/BlackCat.lua +++ b/RemixedDungeon/src/main/assets/scripts/npc/BlackCat.lua @@ -19,7 +19,7 @@ return mob.init({ local hero = RPD.Dungeon.hero hero:STR(math.max(hero:STR()-1,1)) hero:getSprite():emitter():burst( RPD.Sfx.ShadowParticle.CURSE, 6 ) - hero:getSprite():showStatus( 0xFF0000, RPD.textById("Str_lose")) + hero:showStatus( 0xFF0000, RPD.textById("Str_lose")) RPD.playSound( "snd_cursed" ) end, diff --git a/RemixedDungeon/src/main/assets/scripts/spells/Backstab.lua b/RemixedDungeon/src/main/assets/scripts/spells/Backstab.lua index e2beb2459..59a0a3c4c 100644 --- a/RemixedDungeon/src/main/assets/scripts/spells/Backstab.lua +++ b/RemixedDungeon/src/main/assets/scripts/spells/Backstab.lua @@ -46,7 +46,7 @@ return spell.init{ return false end - victim:getSprite():showStatus(0xff2030,"backstab") + victim:showStatus(0xff2030,"backstab") local weapon = caster:getBelongings().weapon local secondaryWeapon = caster:getBelongings().leftHand diff --git a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/Char.java b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/Char.java index 714153f52..943cd4e36 100644 --- a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/Char.java +++ b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/Char.java @@ -397,8 +397,7 @@ public void showStatus(int color, String text) { getSprite().showStatus(color, text); } - @LuaInterface - public void showStatus(int color, String text, Object... args) { + public void showStatus_a(int color, String text, Object... args) { getSprite().showStatus(color, text, args); } diff --git a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/Hero.java b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/Hero.java index 15f57b1fe..188faf481 100644 --- a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/Hero.java +++ b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/actors/hero/Hero.java @@ -478,7 +478,7 @@ public void earnExp(int exp) { this.setExp(this.getExpForLevelUp() + exp); - showStatus(CharSprite.POSITIVE, TXT_EXP, exp); + showStatus_a(CharSprite.POSITIVE, TXT_EXP, exp); boolean levelUp = false; diff --git a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/DewVial.java b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/DewVial.java index 57c6dcc0d..f2e0bea43 100644 --- a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/DewVial.java +++ b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/DewVial.java @@ -70,7 +70,7 @@ public void doDrink(@NotNull Char chr) { int effect = Math.min(chr.ht() - chr.hp(), value); if (effect > 0) { chr.heal(effect, this); - chr.showStatus(CharSprite.POSITIVE, TXT_VALUE, effect); + chr.showStatus_a(CharSprite.POSITIVE, TXT_VALUE, effect); } setVolume(0); diff --git a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/Dewdrop.java b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/Dewdrop.java index dba420430..1aca0b0ea 100644 --- a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/Dewdrop.java +++ b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/Dewdrop.java @@ -42,7 +42,7 @@ public boolean doPickUp(@NotNull Char hero ) { int effect = Math.min( hero.ht() - hero.hp(), value[0] * quantity() ); if (effect > 0) { hero.heal(effect, this); - hero.showStatus( CharSprite.POSITIVE, TXT_VALUE, effect ); + hero.showStatus_a( CharSprite.POSITIVE, TXT_VALUE, effect ); collected = true; } } diff --git a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/Gold.java b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/Gold.java index 238867bbd..7fb90627f 100644 --- a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/Gold.java +++ b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/Gold.java @@ -46,7 +46,7 @@ public boolean doPickUp(@NotNull Char hero) { Badges.validateGoldCollected(); GameScene.pickUp(this); - hero.showStatus(CharSprite.NEUTRAL, TXT_VALUE, quantity()); + hero.showStatus_a(CharSprite.NEUTRAL, TXT_VALUE, quantity()); hero.spend(TIME_TO_PICK_UP); Sample.INSTANCE.play(Assets.SND_GOLD, 1, 1, Random.Float(0.9f, 1.1f)); diff --git a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/armor/glyphs/Viscosity.java b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/armor/glyphs/Viscosity.java index bf2e20bfd..1a56ac24b 100644 --- a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/armor/glyphs/Viscosity.java +++ b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/items/armor/glyphs/Viscosity.java @@ -42,7 +42,7 @@ public int defenceProc(Armor armor, Char attacker, Char defender, int damage ) { } debuff.prolong( damage ); - defender.showStatus( CharSprite.WARNING, StringsManager.getVar(R.string.Viscosity_Status), damage ); + defender.showStatus_a( CharSprite.WARNING, StringsManager.getVar(R.string.Viscosity_Status), damage ); return 0; diff --git a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/scenes/GameScene.java b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/scenes/GameScene.java index 8c5ed481f..dab457823 100644 --- a/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/scenes/GameScene.java +++ b/RemixedDungeon/src/main/java/com/watabou/pixeldungeon/scenes/GameScene.java @@ -387,14 +387,28 @@ public void createGameScene(@NotNull Level level, @NotNull Hero hero) { Camera.main.setTarget(hero.getHeroSprite()); + int l_w = level.getWidth(); + int l_h = level.getHeight(); + level.activateScripts(); - // Epic level gen compatibility - createTerrain(level); + boolean epicRegen = false; + if(l_w != level.getWidth() || l_h != level.getHeight()) { + epicRegen = true; + } + + if(epicRegen) { + // Epic level gen compatibility + createTerrain(level); + } + LevelTools.upgradeMap(level); - // Yeah, epic level gen compatibility - Dungeon.initSizeDependentStuff(level.getWidth(), level.getHeight()); - fog.reinit(level.getWidth(), level.getHeight()); + + if(epicRegen) { + // Yeah, epic level gen compatibility + Dungeon.initSizeDependentStuff(level.getWidth(), level.getHeight()); + fog.reinit(level.getWidth(), level.getHeight()); + } level.addVisuals(this);