From a2b876e418d349c40294397454f2c856f36f2bb2 Mon Sep 17 00:00:00 2001 From: tianscar Date: Mon, 13 Mar 2023 15:18:09 +0800 Subject: [PATCH] v0.1.3: Final commit --- .../utils/QuietCallable.java | 8 ++++ build.gradle | 4 +- .../assets/messages/actors/actors.properties | 6 +++ .../messages/actors/actors_tc.properties | 6 +++ .../messages/actors/actors_zh.properties | 6 +++ .../actors/hero/DualWielding.java | 15 ++++++- .../actors/hero/Hero.java | 44 ++++++++++++------- .../hero/abilities/rogue/ShadowClone.java | 24 +++++++--- .../actors/mobs/npcs/MirrorImage.java | 22 ++++------ .../actors/mobs/npcs/PrismaticImage.java | 13 +++++- .../scenes/GameScene.java | 7 +-- .../scenes/WelcomeScene.java | 10 +++-- .../carbonizedpixeldungeon/ui/Toolbar.java | 4 +- .../carbonizedpd/v0_1_X_Changes.java | 22 ++++++++-- 14 files changed, 136 insertions(+), 55 deletions(-) create mode 100644 PD-classes/src/main/java/com/tianscar/pixeldungeonclasses/utils/QuietCallable.java diff --git a/PD-classes/src/main/java/com/tianscar/pixeldungeonclasses/utils/QuietCallable.java b/PD-classes/src/main/java/com/tianscar/pixeldungeonclasses/utils/QuietCallable.java new file mode 100644 index 000000000..5bb274552 --- /dev/null +++ b/PD-classes/src/main/java/com/tianscar/pixeldungeonclasses/utils/QuietCallable.java @@ -0,0 +1,8 @@ +package com.tianscar.pixeldungeonclasses.utils; + +@FunctionalInterface +public interface QuietCallable { + + V call(); + +} diff --git a/build.gradle b/build.gradle index 6fee98d10..9a7d1f84f 100644 --- a/build.gradle +++ b/build.gradle @@ -13,8 +13,8 @@ allprojects { ext { appPackageName = 'com.tianscar.carbonizedpixeldungeon' - appVersionCode = 102 - appVersionName = '0.1.2' + appVersionCode = 103 + appVersionName = '0.1.3' appJavaCompatibility = JavaVersion.VERSION_1_8 diff --git a/core/src/main/assets/messages/actors/actors.properties b/core/src/main/assets/messages/actors/actors.properties index 2d567a53a..2ee41861e 100644 --- a/core/src/main/assets/messages/actors/actors.properties +++ b/core/src/main/assets/messages/actors/actors.properties @@ -122,6 +122,7 @@ actors.buffs.chill.freezes=%s freezes! actors.buffs.chill.desc=Not quite frozen, but still much too cold.\n\nChilled targets perform all actions more slowly, depending on how many turns are left in the effect. At its worst, this is equivalent to being slowed.\n\nTurns of chill remaining: %1$s.\nSpeed is reduced by: %2$s%% actors.buffs.combo.name=Combo +actors.buffs.combo.action_name=combo attack actors.buffs.combo.combo=%d hit combo! actors.buffs.combo.bad_target=You must target an enemy in attack range. actors.buffs.combo.prompt=Select a target to attack. @@ -235,6 +236,7 @@ actors.buffs.mindvision.desc=Somehow you are able to see all creatures on this f actors.buffs.momentum.momentum=Building Momentum actors.buffs.momentum.running=Freerunning actors.buffs.momentum.resting=Recovering +actors.buffs.momentum.action_name=freerun actors.buffs.momentum.momentum_desc=As he moves, the Freerunner builds momentum, which he can spend to start freerunning.\n\nEach charge of momentum grants two turns of freerunning, and the Freerunner can build up to 10 charges. Momentum is rapidly lost when the Freerunner stops moving.\n\nCurrent momentum charge: %d. actors.buffs.momentum.running_desc=As he moves, the Freerunner builds momentum, which he can spend to start freerunning.\n\nWhile freerunning, the Freerunner moves at double speed and gains bonus evasion based on his level.\n\nTurns remaining: %d. actors.buffs.momentum.resting_desc=As he moves, the Freerunner builds momentum, which he can spend to start freerunning.\n\nThe Freerunner needs time to regain his stamina before building momentum again.\n\nTurns remaining: %d. @@ -260,6 +262,7 @@ actors.buffs.poison.rankings_desc=Succumbed to Poison actors.buffs.poison.desc=Poison works its way through the body, slowly impairing its internal functioning.\n\nPoison deals damage each turn proportional to how long until it expires.\n\nTurns of poison remaining: %s. actors.buffs.preparation.name=Preparation +actors.buffs.preparation.action_name=prepared strike actors.buffs.preparation.desc=The Assassin is waiting patiently, preparing to strike from the shadows. actors.buffs.preparation.desc_dmg=His next attack will deal _%1$d%% bonus damage_, and will execute regular enemies below _%2$d%% health_, or bosses below _%3$d%% health_. actors.buffs.preparation.desc_dmg_likely=The attack will also be more likely to deal a larger amount of damage. @@ -297,6 +300,9 @@ actors.buffs.slow.name=Slowed actors.buffs.slow.desc=Slowing magic affects the target's rate of time, to them everything is moving super-fast.\n\nA slowed character performs all actions in twice the amount of time they would normally take.\n\nTurns of slow remaining: %s. actors.buffs.snipersmark.name=Sniper's mark +actors.buffs.snipersmark.action_name_snapshot=snapshot +actors.buffs.snipersmark.action_name_volley=volley +actors.buffs.snipersmark.action_name_sniper=sniper shot actors.buffs.snipersmark.desc=The Sniper is honed in on the target she most recently attacked. She is able to perform a special attack with her bow which will vary based on how the bow is augmented.\n\nAn unaugmented bow will fire a _snapshot,_ which deals reduced damage but does not take any time to fire.\n\nA bow augmented for speed will fire a _volley_ of three arrows. Each arrow will deal reduced damage, but can still activate enchantment. This volley takes 1 turn to shoot.\n\nA bow augmented for damage will fire a _sniper shot._ This shot is guaranteed to hit, deals bonus damage based on distance from the target, and takes 2 turns to fire. actors.buffs.soulmark.name=Soul Marked diff --git a/core/src/main/assets/messages/actors/actors_tc.properties b/core/src/main/assets/messages/actors/actors_tc.properties index 73d6b9e41..f2ab31200 100644 --- a/core/src/main/assets/messages/actors/actors_tc.properties +++ b/core/src/main/assets/messages/actors/actors_tc.properties @@ -122,6 +122,7 @@ actors.buffs.chill.freezes=%s凍住了! actors.buffs.chill.desc=還沒有完全凍住,不過已經非常冷了。\n\n凍傷的目標所有行動都會更加緩慢,減速程度取決於剩餘的凍傷效果時間。最嚴重的凍傷情況等同於遲緩效果。\n\n剩餘的凍傷效果時長:%1$s回合\n當前減少的速度:%2$s%% actors.buffs.combo.name=連擊 +actors.buffs.combo.action_name=連擊 actors.buffs.combo.combo=%d連擊! actors.buffs.combo.bad_target=你的目標必須是攻擊距離以內的敵人。 actors.buffs.combo.prompt=選擇一個目標以攻擊 @@ -235,6 +236,7 @@ actors.buffs.mindvision.desc=你可以在腦海中以某種方式看到這一層 actors.buffs.momentum.momentum=動量積蓄 actors.buffs.momentum.running=逸動 actors.buffs.momentum.resting=恢復 +actors.buffs.momentum.action_name=逸動 actors.buffs.momentum.momentum_desc=移動的時候,疾行者會逐漸積蓄動能。疾行者可以消耗動量以開啟逸動狀態。\n\n每一點動量可以支持兩個回合的逸動,最多可以儲存10點動量。當疾行者停止移動時動量會快速消散。\n\n現有的動量:%d。 actors.buffs.momentum.running_desc=移動的時候,疾行者會逐漸積蓄動能。疾行者可以消耗動能以開啟逸動狀態。\n\n處於逸動狀態時,疾行者能夠以兩倍速移動,並且基於自身等級獲得額外的閃避屬性。\n\n效果剩餘回合數:%d。 actors.buffs.momentum.resting_desc=移動的時候,疾行者會逐漸積蓄動量。疾行者可以消耗動量以開啟逸動狀態。\n\n疾行者現在需要休息一會恢復體力才能重新積蓄動量。\n\n還需要休息%d回合。 @@ -260,6 +262,7 @@ actors.buffs.poison.rankings_desc=中毒致死 actors.buffs.poison.desc=毒素傳遍全身,緩慢地損傷著各個臟器。 \n\n毒素每回合造成的傷害與其剩餘的回合數成正比。 \n\n剩餘的中毒效果時長:%s回合 actors.buffs.preparation.name=準備階段 +actors.buffs.preparation.action_name=蓄意打擊 actors.buffs.preparation.desc=刺客正耐心地等待著,準備從暗影中給出致命一擊。 actors.buffs.preparation.desc_dmg=他的下一次攻擊會造成_%1$d%%的額外傷害_,並瞬間斬殺生命低於_%2$d%%_的普通敵人,或生命低於_%3$d%%_的Boss。 actors.buffs.preparation.desc_dmg_likely=這一擊也更有可能造成額外的傷害。 @@ -297,6 +300,9 @@ actors.buffs.slow.name=遲緩 actors.buffs.slow.desc=減速魔法影響了目標的時間流速,在目標眼中所有的事物都移動得飛快。 \n\n遲緩下的角色執行所有行動花費的時間是其執行相同行動的兩倍。\n\n剩餘的遲緩效果持續時長:%s回合 actors.buffs.snipersmark.name=狙擊標記 +actors.buffs.snipersmark.action_name_snapshot=速射 +actors.buffs.snipersmark.action_name_volley=齊射 +actors.buffs.snipersmark.action_name_sniper=強射 actors.buffs.snipersmark.desc=狙擊手會專注於最近射擊的目標,能夠用靈能弓進行一次特殊攻擊,攻擊方式取決於弓的改造方式。\n\n若持有未改造的弓,狙擊手可發射_瞬時箭矢_,造成低於正常箭矢的傷害,但不消耗時間。\n\n若持有加強了速度的弓,狙擊手可進行_三箭連發_。每枝箭造成低於正常箭矢的傷害,但能觸發附魔。消耗一回合。\n\n若持有加強了傷害的弓,狙擊手可發射_狙擊箭矢_。狙擊箭矢必定命中,造成基於與目標距離的額外傷害,消耗兩回合。 actors.buffs.soulmark.name=靈魂標記 diff --git a/core/src/main/assets/messages/actors/actors_zh.properties b/core/src/main/assets/messages/actors/actors_zh.properties index 478b22c40..694045a11 100644 --- a/core/src/main/assets/messages/actors/actors_zh.properties +++ b/core/src/main/assets/messages/actors/actors_zh.properties @@ -122,6 +122,7 @@ actors.buffs.chill.freezes=%s冻住了! actors.buffs.chill.desc=还没有完全冻住,不过已经非常冷了。\n\n冻伤的目标所有行动都会更加缓慢,减速程度取决于剩余的冻伤效果时间。最严重的冻伤情况等同于迟缓效果。\n\n剩余的冻伤效果时长:%1$s回合\n当前减少的速度:%2$s%% actors.buffs.combo.name=连击 +actors.buffs.combo.action_name=连击 actors.buffs.combo.combo=%d连击! actors.buffs.combo.bad_target=你的目标必须是攻击距离以内的敌人。 actors.buffs.combo.prompt=选择一个目标以攻击 @@ -235,6 +236,7 @@ actors.buffs.mindvision.desc=你可以在脑海中以某种方式看到这一层 actors.buffs.momentum.momentum=动量积蓄 actors.buffs.momentum.running=逸动 actors.buffs.momentum.resting=恢复 +actors.buffs.momentum.action_name=逸动 actors.buffs.momentum.momentum_desc=移动的时候,疾行者会逐渐积蓄动能。疾行者可以消耗动量以开启逸动状态。\n\n每一点动量可以支持两个回合的逸动,最多可以储存10点动量。当疾行者停止移动时动量会快速消散。\n\n现有的动量:%d。 actors.buffs.momentum.running_desc=移动的时候,疾行者会逐渐积蓄动能。疾行者可以消耗动能以开启逸动状态。\n\n处于逸动状态时,疾行者能够以两倍速移动,并且基于自身等级获得额外的闪避属性。\n\n效果剩余回合数:%d。 actors.buffs.momentum.resting_desc=移动的时候,疾行者会逐渐积蓄动量。疾行者可以消耗动量以开启逸动状态。\n\n疾行者现在需要休息一会恢复体力才能重新积蓄动量。\n\n还需要休息%d回合。 @@ -260,6 +262,7 @@ actors.buffs.poison.rankings_desc=中毒致死 actors.buffs.poison.desc=毒素传遍全身,缓慢地损伤着各个脏器。 \n\n毒素每回合造成的伤害与其剩余的回合数成正比。 \n\n剩余的中毒效果时长:%s回合 actors.buffs.preparation.name=准备阶段 +actors.buffs.preparation.action_name=蓄意打击 actors.buffs.preparation.desc=刺客正耐心地等待着,准备从暗影中给出致命一击。 actors.buffs.preparation.desc_dmg=他的下一次攻击会造成_%1$d%%的额外伤害_,并瞬间斩杀生命低于_%2$d%%_的普通敌人,或生命低于_%3$d%%_的Boss。 actors.buffs.preparation.desc_dmg_likely=这一击也更有可能造成额外的伤害。 @@ -297,6 +300,9 @@ actors.buffs.slow.name=迟缓 actors.buffs.slow.desc=减速魔法影响了目标的时间流速,在目标眼中所有的事物都移动得飞快。 \n\n迟缓下的角色执行所有行动花费的时间是其执行相同行动的两倍。\n\n剩余的迟缓效果持续时长:%s回合 actors.buffs.snipersmark.name=狙击标记 +actors.buffs.snipersmark.action_name_snapshot=速射 +actors.buffs.snipersmark.action_name_volley=齐射 +actors.buffs.snipersmark.action_name_sniper=强射 actors.buffs.snipersmark.desc=狙击手会专注于最近射击的目标,能够用灵能弓进行一次特殊攻击,攻击方式取决于弓的改造方式。\n\n若持有未改造的弓,狙击手可发射_瞬时箭矢_,造成低于正常箭矢的伤害,但不消耗时间。\n\n若持有加强了速度的弓,狙击手可进行_三箭连发_。每支箭造成低于正常箭矢的伤害,但能触发附魔。消耗一回合。\n\n若持有加强了伤害的弓,狙击手可发射_狙击箭矢_。狙击箭矢必定命中,造成基于与目标距离的额外伤害,消耗两回合。 actors.buffs.soulmark.name=灵魂标记 diff --git a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/DualWielding.java b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/DualWielding.java index 81e20c92f..e262a91a0 100644 --- a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/DualWielding.java +++ b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/DualWielding.java @@ -7,19 +7,30 @@ import com.tianscar.carbonizedpixeldungeon.items.weapon.SpiritBow; import com.tianscar.carbonizedpixeldungeon.items.weapon.melee.MeleeWeapon; import com.tianscar.carbonizedpixeldungeon.items.weapon.missiles.MissileWeapon; +import com.tianscar.pixeldungeonclasses.utils.QuietCallable; // TODO Improve this public class DualWielding { + private final QuietCallable weapon, extra; + public DualWielding( QuietCallable weapon, QuietCallable extra ) { + this.weapon = weapon; + this.extra = extra; + } + + public DualWielding( Hero hero ) { + this(hero.belongings::weapon, hero.belongings::extra); + } + public boolean canWeaponAttack = false; public boolean canExtraAttack = false; public KindOfWeapon weapon() { - return Dungeon.hero.belongings.weapon(); + return weapon.call(); } public KindOfWeapon extra() { - return Dungeon.hero.belongings.extra(); + return extra.call(); } public void weaponHitSound(float pitch) { diff --git a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/Hero.java index face6ba2b..8e76c4f9e 100644 --- a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/Hero.java @@ -206,7 +206,7 @@ public Hero() { STR = STARTING_STR; belongings = new Belongings( this ); - dualWielding = new DualWielding(); + dualWielding = new DualWielding( this ); visibleEnemies = new ArrayList<>(); } @@ -436,14 +436,13 @@ public boolean shoot( Char enemy, MissileWeapon wep ) { return hit; } - - @Override - public int attackSkill( Char target ) { - KindOfWeapon wep = belongings.weapon(); - + + public int attackSkill( DualWielding dualWielding, Char target ) { + KindOfWeapon wep = dualWielding.weapon(); + float accuracy = 1; accuracy *= RingOfAccuracy.accuracyMultiplier( this ); - + if (wep instanceof MissileWeapon){ if (Dungeon.level.adjacent( pos, target.pos )) { accuracy *= (0.5f + 0.2f*pointsInTalent(Talent.POINT_BLANK)); @@ -451,7 +450,7 @@ public int attackSkill( Char target ) { accuracy *= 1.5f; } } - + if (dualWielding.weaponNotNull()) { return (int)(attackSkill * accuracy * dualWielding.weaponAccuracyFactor( this )); } else { @@ -459,6 +458,11 @@ public int attackSkill( Char target ) { } } + @Override + public int attackSkill( Char target ) { + return attackSkill(dualWielding, target); + } + @Override public int defenseSkill( Char enemy ) { @@ -538,10 +542,9 @@ else if (belongings.extra() != null) { return dr; } - - @Override - public int damageRoll() { - KindOfWeapon wep = belongings.weapon(); + + public int damageRoll(DualWielding dualWielding) { + KindOfWeapon wep = dualWielding.weapon(); int dmg; if (dualWielding.weaponNotNull()) { @@ -551,10 +554,15 @@ public int damageRoll() { dmg = RingOfForce.damageRoll(this); } if (dmg < 0) dmg = 0; - + return dmg; } + @Override + public int damageRoll() { + return damageRoll(dualWielding); + } + @Override public float speed() { @@ -598,8 +606,8 @@ public boolean canSurpriseAttack(){ public boolean canAttack(Char enemy){ return dualWielding.weaponCanAttack(this, enemy); } - - public float attackDelay() { + + public float attackDelay(DualWielding dualWielding) { if (buff(Talent.LethalMomentumTracker.class) != null){ buff(Talent.LethalMomentumTracker.class).detach(); return 0; @@ -608,7 +616,7 @@ public float attackDelay() { if (dualWielding.weaponNotNull()) { return dualWielding.weaponDelayFactor( this ); - + } else { //Normally putting furor speed on unarmed attacks would be unnecessary //But there's going to be that one guy who gets a furor+force ring combo @@ -617,6 +625,10 @@ public float attackDelay() { } } + public float attackDelay() { + return attackDelay(dualWielding); + } + @Override public void spend( float time ) { justMoved = false; diff --git a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java index e61f457b1..083c826ff 100644 --- a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java +++ b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/hero/abilities/rogue/ShadowClone.java @@ -27,6 +27,7 @@ import com.tianscar.carbonizedpixeldungeon.actors.Char; import com.tianscar.carbonizedpixeldungeon.actors.buffs.Corruption; import com.tianscar.carbonizedpixeldungeon.actors.buffs.Invisibility; +import com.tianscar.carbonizedpixeldungeon.actors.hero.DualWielding; import com.tianscar.carbonizedpixeldungeon.actors.hero.Hero; import com.tianscar.carbonizedpixeldungeon.actors.hero.Talent; import com.tianscar.carbonizedpixeldungeon.actors.hero.abilities.ArmorAbility; @@ -148,11 +149,17 @@ public static class ShadowAlly extends DirectableAlly { immunities.add(Corruption.class); } - public ShadowAlly(){ + private DualWielding dualWielding; + private DualWielding dualWielding() { + if (dualWielding == null) dualWielding = new DualWielding( Dungeon.hero ); + return dualWielding; + } + + public ShadowAlly() { super(); } - public ShadowAlly( int heroLevel ){ + public ShadowAlly( int heroLevel ) { super(); int hpBonus = 15 + 5*heroLevel; hpBonus = Math.round(0.1f * Dungeon.hero.pointsInTalent(Talent.PERFECT_COPY) * hpBonus); @@ -194,8 +201,8 @@ public int attackSkill(Char target) { @Override public int damageRoll() { int damage = Random.NormalIntRange(10, 20); - int heroDamage = Dungeon.hero.damageRoll(); - heroDamage /= Dungeon.hero.attackDelay(); //normalize hero damage based on atk speed + int heroDamage = Dungeon.hero.damageRoll(dualWielding()); + heroDamage /= Dungeon.hero.attackDelay(dualWielding()); //normalize hero damage based on atk speed heroDamage = Math.round(0.075f * Dungeon.hero.pointsInTalent(Talent.SHADOW_BLADE) * heroDamage); if (heroDamage > 0){ damage += heroDamage; @@ -207,13 +214,18 @@ public int damageRoll() { public int attackProc( Char enemy, int damage ) { damage = super.attackProc( enemy, damage ); if (Random.Int(4) < Dungeon.hero.pointsInTalent(Talent.SHADOW_BLADE) - && Dungeon.hero.dualWielding.weaponNotNull()){ - return Dungeon.hero.dualWielding.weaponProc( this, enemy, damage ); + && dualWielding().weaponNotNull()){ + return dualWielding().weaponProc( this, enemy, damage ); } else { return damage; } } + @Override + protected boolean canAttack(Char enemy) { + return dualWielding().weaponCanAttack(this, enemy) || super.canAttack(enemy); + } + @Override public int drRoll() { int dr = super.drRoll(); diff --git a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/mobs/npcs/MirrorImage.java b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/mobs/npcs/MirrorImage.java index 094fe8f7b..7ced9beaa 100644 --- a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/mobs/npcs/MirrorImage.java +++ b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/mobs/npcs/MirrorImage.java @@ -57,16 +57,16 @@ public class MirrorImage extends NPC { } private Hero hero; + private DualWielding dualWielding; private int heroID; public int armTier; - public DualWielding dualWielding = new DualWielding(); - @Override protected boolean act() { - if ( hero == null ){ + if ( hero == null ) { hero = (Hero)Actor.findById(heroID); + dualWielding = new DualWielding( hero ); if ( hero == null ){ die(null); sprite.killAndErase(); @@ -98,24 +98,20 @@ public void restoreFromBundle( Bundle bundle ) { public void duplicate( Hero hero ) { this.hero = hero; + dualWielding = new DualWielding( hero ); heroID = this.hero.id(); Buff.affect(this, MirrorInvis.class, Short.MAX_VALUE); } @Override public int damageRoll() { - int damage; - if (dualWielding.weaponNotNull()){ - damage = dualWielding.weaponDamageRoll(this); - } else { - damage = hero.damageRoll(); //handles ring of force - } + int damage = hero.damageRoll( dualWielding ); return (damage+1)/2; //half hero damage, rounded up } @Override public int attackSkill( Char target ) { - return hero.attackSkill(target); + return hero.attackSkill( dualWielding, target ); } @Override @@ -133,17 +129,17 @@ public int defenseSkill(Char enemy) { @Override public float attackDelay() { - return hero.attackDelay(); //handles ring of furor + return hero.attackDelay( dualWielding ); //handles ring of furor } @Override protected boolean canAttack(Char enemy) { - return super.canAttack(enemy) || (dualWielding.weaponCanAttack(this, enemy)); + return dualWielding.weaponCanAttack(this, enemy) || super.canAttack(enemy); } @Override public int drRoll() { - if (hero != null && dualWielding.weaponNotNull()){ + if (hero != null && dualWielding.weaponNotNull()) { return Random.NormalIntRange(0, dualWielding.weaponDefenseFactor(this)/2); } else { return 0; diff --git a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/mobs/npcs/PrismaticImage.java b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/mobs/npcs/PrismaticImage.java index b8a8bb75e..29a02aaa8 100644 --- a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/mobs/npcs/PrismaticImage.java +++ b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/actors/mobs/npcs/PrismaticImage.java @@ -30,6 +30,7 @@ import com.tianscar.carbonizedpixeldungeon.actors.buffs.Burning; import com.tianscar.carbonizedpixeldungeon.actors.buffs.Corruption; import com.tianscar.carbonizedpixeldungeon.actors.buffs.PrismaticGuard; +import com.tianscar.carbonizedpixeldungeon.actors.hero.DualWielding; import com.tianscar.carbonizedpixeldungeon.actors.hero.Hero; import com.tianscar.carbonizedpixeldungeon.actors.mobs.Mob; import com.tianscar.carbonizedpixeldungeon.effects.CellEmitter; @@ -62,6 +63,7 @@ public class PrismaticImage extends NPC { } private Hero hero; + private DualWielding dualWielding; private int heroID; public int armTier; @@ -91,6 +93,7 @@ protected boolean act() { if ( hero == null ){ hero = (Hero) Actor.findById(heroID); + dualWielding = new DualWielding( hero ); if ( hero == null ){ destroy(); sprite.die(); @@ -137,6 +140,7 @@ public void restoreFromBundle( Bundle bundle ) { public void duplicate( Hero hero, int HP ) { this.hero = hero; + dualWielding = new DualWielding( hero ); heroID = this.hero.id(); this.HP = HP; HT = PrismaticGuard.maxHP( hero ); @@ -150,11 +154,11 @@ public int damageRoll() { return Random.NormalIntRange( 1, 4 ); } } - + @Override public int attackSkill( Char target ) { if (hero != null) { - return hero.attackSkill(target); + return hero.attackSkill( dualWielding, target ); } else { return 0; } @@ -172,6 +176,11 @@ public int defenseSkill(Char enemy) { return 0; } } + + @Override + protected boolean canAttack(Char enemy) { + return dualWielding.weaponCanAttack(this, enemy) || super.canAttack(enemy); + } @Override public int drRoll() { diff --git a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/scenes/GameScene.java b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/scenes/GameScene.java index 497c48716..e16b1f73a 100644 --- a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/scenes/GameScene.java +++ b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/scenes/GameScene.java @@ -162,11 +162,8 @@ public void create() { CarbonizedPixelDungeon.switchNoFade(TitleScene.class); return; } - - Music.INSTANCE.playTracks( - new String[]{Assets.Music.SEWERS_1, Assets.Music.SEWERS_2, Assets.Music.SEWERS_2}, - new float[]{1, 1, 0.5f}, - false); + + Dungeon.level.playLevelMusic(); PDSettings.lastClass(Dungeon.hero.heroClass.ordinal()); diff --git a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/scenes/WelcomeScene.java b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/scenes/WelcomeScene.java index 45282dd35..73249929a 100644 --- a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/scenes/WelcomeScene.java +++ b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/scenes/WelcomeScene.java @@ -86,8 +86,8 @@ public void create() { align(title); - placeTorch(title.x + 22, title.y + 46); - placeTorch(title.x + title.width - 22, title.y + 46); + placeTorch(title.x + 28, title.y + 46); + placeTorch(title.x + title.width - 28, title.y + 46); Image signs = new Image( BannerSprites.get( BannerSprites.Type.PIXEL_DUNGEON_SIGNS ) ) { private float time = 0; @@ -161,9 +161,9 @@ protected void onClick() { //TODO: change the messages here in accordance with the type of patch. message = Messages.get(this, "patch_intro"); message += "\n"; - message += "\n" + Messages.get(this, "patch_balance"); + //message += "\n" + Messages.get(this, "patch_balance"); message += "\n" + Messages.get(this, "patch_bugfixes"); - message += "\n" + Messages.get(this, "patch_contents"); + //message += "\n" + Messages.get(this, "patch_contents"); //message += "\n" + Messages.get(this, "patch_translations"); } @@ -175,6 +175,8 @@ protected void onClick() { text.setPos((w - text.width()) / 2f, (topRegion + 2) + (textSpace - text.height())/2); add(text); + fadeIn(); + } private void placeTorch( float x, float y ) { diff --git a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/ui/Toolbar.java b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/ui/Toolbar.java index 2b70a9c23..bc8f189aa 100644 --- a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/ui/Toolbar.java +++ b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/ui/Toolbar.java @@ -257,8 +257,8 @@ protected void layout() { //center = group but.. well.. centered, so all we need to do is pre-emptively set the right side further in. case CENTER: float toolbarWidth = btnWait.width() + btnExamine.width() + btnInventory.width(); - for(Button slot : btnQuick){ - if (slot.visible) toolbarWidth += slot.width(); + for (int i = 0; i < numVisibleSlots; i++) { + toolbarWidth += btnQuick[boundIndex(quickSlots + i)].width(); } if (numVisibleSlots < QuickSlot.SIZE) toolbarWidth += btnSwitchSlot.width(); right = (width + toolbarWidth)/2; diff --git a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/ui/changelist/carbonizedpd/v0_1_X_Changes.java b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/ui/changelist/carbonizedpd/v0_1_X_Changes.java index 0cb6e08cf..79296a4d8 100644 --- a/core/src/main/java/com/tianscar/carbonizedpixeldungeon/ui/changelist/carbonizedpd/v0_1_X_Changes.java +++ b/core/src/main/java/com/tianscar/carbonizedpixeldungeon/ui/changelist/carbonizedpd/v0_1_X_Changes.java @@ -42,12 +42,31 @@ public static void addAllChanges( ArrayList changeInfos ) { ChangeInfo changes = new ChangeInfo( "v0.1.X", true, ""); changes.hardlight( Window.TITLE_COLOR ); changeInfos.add( changes ); + add_v0_1_3_Changes( changeInfos ); add_v0_1_2_Changes( changeInfos ); add_v0_1_1_Changes( changeInfos ); add_v0_1_0_Changes( changeInfos ); } + public static void add_v0_1_3_Changes( ArrayList changeInfos ){ + + ChangeInfo changes = new ChangeInfo("v0.1.3", false, ""); + changes.hardlight(Window.TITLE_COLOR); + changeInfos.add(changes); + + changes.addButton(new ChangeButton(new Image(Assets.Sprites.SPINNER, 144, 0, 16, 16), + Messages.get(ChangesScene.class, "bugfixes"), + "尝试修复了(v0.1.0的bug):\n" + + "_-_ 镜像/虹卫无限连刃、暗影映像没伤害的问题\n" + + "_-_ 物品栏居中显示错误的问题\n" + + "_-_ 场景BGM不能正确播放的问题")); + + changes.addButton(new ChangeButton(Icons.get(Icons.WARNING), "删档警告", + "因为下个版本将全面重做天赋系统,所以将不兼容以前的存档")); + + } + public static void add_v0_1_2_Changes( ArrayList changeInfos ){ ChangeInfo changes = new ChangeInfo("v0.1.2", false, ""); @@ -62,9 +81,6 @@ public static void add_v0_1_2_Changes( ArrayList changeInfos ){ "_-_ 修改了部分贴图(来自Daniel Calan)\n" + "_-_ 修改了幸福结局界面")); - changes.addButton(new ChangeButton(Icons.get(Icons.WARNING), "删档警告", - "因为下个版本将全面重做天赋系统,所以将不兼容以前的存档")); - } public static void add_v0_1_1_Changes( ArrayList changeInfos ){