From f8244d013e1ff5740e3cdd1966e6ee3232b8ee3b Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 8 Sep 2017 00:29:05 -0400 Subject: [PATCH] v0.6.2: reworked rogue and cloak of shadows --- .../actors/buffs/Hunger.java | 6 +- .../actors/hero/Hero.java | 3 +- .../actors/hero/HeroClass.java | 1 - .../items/armor/Armor.java | 3 - .../items/artifacts/CloakOfShadows.java | 78 +++++++++---------- .../items/rings/Ring.java | 13 ---- .../levels/rooms/secret/SecretRoom.java | 6 +- .../messages/actors/actors.properties | 11 ++- 8 files changed, 49 insertions(+), 72 deletions(-) diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java index fab4fee8c..4bae44e4b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/buffs/Hunger.java @@ -25,7 +25,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges; import com.shatteredpixel.shatteredpixeldungeon.Challenges; import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.Artifact; import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -107,9 +106,8 @@ public class Hunger extends Buff implements Hero.Doom { } } - - float step = ((Hero)target).heroClass == HeroClass.ROGUE ? STEP * 1.2f : STEP; - spend( target.buff( Shadows.class ) == null ? step : step * 1.5f ); + + spend( target.buff( Shadows.class ) == null ? STEP : STEP * 1.5f ); } else { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java index 00d2d2f9f..0b2443bcb 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/Hero.java @@ -318,7 +318,6 @@ public class Hero extends Char { } else { int bonus = 0; - if (heroClass == HeroClass.ROGUE) bonus += -aEnc; if (belongings.armor != null && belongings.armor.hasGlyph(Swiftness.class)) bonus += 5 + belongings.armor.level()*1.5f; @@ -1474,7 +1473,7 @@ public class Hero extends Char { boolean smthFound = false; - int distance = 1; + int distance = heroClass == HeroClass.ROGUE ? 2 : 1; int cx = pos % Dungeon.level.width(); int cy = pos / Dungeon.level.width(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java index 5edf20527..95c328f92 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java @@ -216,7 +216,6 @@ public enum HeroClass { Messages.get(HeroClass.class, "rogue_perk3"), Messages.get(HeroClass.class, "rogue_perk4"), Messages.get(HeroClass.class, "rogue_perk5"), - Messages.get(HeroClass.class, "rogue_perk6"), }; case HUNTRESS: return new String[]{ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java index a9f0fd447..48582ba7e 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/Armor.java @@ -27,7 +27,6 @@ import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal; import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem; @@ -292,8 +291,6 @@ public class Armor extends EquipableItem { if (STRReq() > Dungeon.hero.STR()) { info += " " + Messages.get(Armor.class, "too_heavy"); - } else if (Dungeon.hero.heroClass == HeroClass.ROGUE && Dungeon.hero.STR() > STRReq()){ - info += " " + Messages.get(Armor.class, "excess_str"); } } else { info += "\n\n" + Messages.get(Armor.class, "avg_absorb", DRMin(0), DRMax(0), STRReq(0)); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java index eff9f2e38..08cfc2f82 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/artifacts/CloakOfShadows.java @@ -44,13 +44,11 @@ public class CloakOfShadows extends Artifact { image = ItemSpriteSheet.ARTIFACT_CLOAK; exp = 0; - levelCap = 14; + levelCap = 10; - charge = level()+6; + charge = Math.min(level()+3, 10); partialCharge = 0; - chargeCap = level()+6; - - cooldown = 0; + chargeCap = Math.min(level()+3, 10); defaultAction = AC_STEALTH; @@ -79,8 +77,7 @@ public class CloakOfShadows extends Artifact { if (!stealthed){ if (!isEquipped(hero)) GLog.i( Messages.get(Artifact.class, "need_to_equip") ); - else if (cooldown > 0) GLog.i( Messages.get(this, "cooldown", cooldown) ); - else if (charge <= 1) GLog.i( Messages.get(this, "no_charge") ); + else if (charge <= 0) GLog.i( Messages.get(this, "no_charge") ); else { stealthed = true; hero.spend( 1f ); @@ -136,25 +133,28 @@ public class CloakOfShadows extends Artifact { @Override public Item upgrade() { - chargeCap++; + chargeCap = Math.min(chargeCap + 1, 10); return super.upgrade(); } private static final String STEALTHED = "stealthed"; - private static final String COOLDOWN = "cooldown"; @Override public void storeInBundle( Bundle bundle ) { super.storeInBundle(bundle); bundle.put( STEALTHED, stealthed ); - bundle.put( COOLDOWN, cooldown ); } @Override public void restoreFromBundle( Bundle bundle ) { super.restoreFromBundle(bundle); stealthed = bundle.getBoolean( STEALTHED ); - cooldown = bundle.getInt( COOLDOWN ); + // pre-0.6.2 saves + if (bundle.contains("cooldown")){ + exp = 0; + level((int)Math.ceil(level()*0.7f)); + charge = chargeCap = Math.min(3 + level(), 10); + } } @Override @@ -167,8 +167,11 @@ public class CloakOfShadows extends Artifact { public boolean act() { if (charge < chargeCap) { LockedFloor lock = target.buff(LockedFloor.class); - if (!stealthed && (lock == null || lock.regenOn())) - partialCharge += (1f / (50 - (chargeCap-charge))); + if (!stealthed && (lock == null || lock.regenOn())) { + float turnsToCharge = (60 - 2*(chargeCap - charge)); + if (level() > 7) turnsToCharge -= 2 * (level() - 7); + partialCharge += (1f / turnsToCharge); + } if (partialCharge >= 1) { charge++; @@ -213,41 +216,35 @@ public class CloakOfShadows extends Artifact { @Override public boolean act(){ - if (turnsToCost == 0) charge--; - if (charge <= 0) { - detach(); - GLog.w( Messages.get(this, "no_charge") ); - ((Hero)target).interrupt(); + turnsToCost--; + + if (turnsToCost <= 0){ + charge--; + if (charge < 0) { + charge = 0; + detach(); + GLog.w(Messages.get(this, "no_charge")); + ((Hero) target).interrupt(); + } else { + exp += 10 + ((Hero) target).lvl; + + if (exp >= (level() + 1) * 50 && level() < levelCap) { + upgrade(); + exp -= level() * 50; + GLog.p(Messages.get(this, "levelup")); + + } + turnsToCost = 5; + } + updateQuickslot(); } - if (turnsToCost == 0) exp += 10 + ((Hero)target).lvl; - - if (exp >= (level()+1)*40 && level() < levelCap) { - upgrade(); - exp -= level()*40; - GLog.p( Messages.get(this, "levelup") ); - } - - if (turnsToCost == 0) turnsToCost = 2; - else turnsToCost--; - updateQuickslot(); - spend( TICK ); return true; } public void dispel(){ - charge --; - - exp += 10 + ((Hero)target).lvl; - - if (exp >= (level()+1)*40 && level() < levelCap) { - upgrade(); - exp -= level()*40; - GLog.p( Messages.get(this, "levelup") ); - } - updateQuickslot(); detach(); } @@ -273,7 +270,6 @@ public class CloakOfShadows extends Artifact { if (target.invisible > 0) target.invisible--; stealthed = false; - cooldown = 6 - (level() / 4); updateQuickslot(); super.detach(); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java index 5e439a9be..499719a51 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/rings/Ring.java @@ -26,7 +26,6 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon; import com.shatteredpixel.shatteredpixeldungeon.actors.Char; import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; -import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.ItemStatusHandler; import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc; @@ -279,18 +278,6 @@ public class Ring extends KindofMisc { public class RingBuff extends Buff { - @Override - public boolean attachTo( Char target ) { - - if (target instanceof Hero && ((Hero)target).heroClass == HeroClass.ROGUE && !isKnown()) { - setKnown(); - GLog.i( Messages.get(Ring.class, "known", name()) ); - Badges.validateItemLevelAquired( Ring.this ); - } - - return super.attachTo(target); - } - @Override public boolean act() { diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretRoom.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretRoom.java index f492fe0df..d3293c203 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretRoom.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/levels/rooms/secret/SecretRoom.java @@ -22,7 +22,9 @@ package com.shatteredpixel.shatteredpixeldungeon.levels.rooms.secret; import com.shatteredpixel.shatteredpixeldungeon.ShatteredPixelDungeon; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass; import com.shatteredpixel.shatteredpixeldungeon.levels.rooms.special.SpecialRoom; +import com.shatteredpixel.shatteredpixeldungeon.scenes.StartScene; import com.watabou.utils.Bundle; import com.watabou.utils.Random; @@ -47,11 +49,11 @@ public abstract class SecretRoom extends SpecialRoom { float[] regionChances = baseRegionSecrets.clone(); - /*if (StartScene.curClass == HeroClass.ROGUE){ + if (StartScene.curClass == HeroClass.ROGUE){ for (int i = 0; i < regionChances.length; i++){ regionChances[i] += 0.6f; } - }*/ + } for (int i = 0; i < regionSecretsThisRun.length; i++){ regionSecretsThisRun[i] = (int)regionChances[i]; diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties index f193fb7f0..ee46c124c 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/actors/actors.properties @@ -237,12 +237,11 @@ actors.hero.heroclass.mage_perk4=When eaten, any piece of food restores 1 charge actors.hero.heroclass.mage_perk5=Scrolls of Upgrade are identified from the beginning. actors.hero.heroclass.rogue=rogue -actors.hero.heroclass.rogue_perk1=The Rogue starts with a unique Cloak of Shadows. -actors.hero.heroclass.rogue_perk2=The Rogue identifies a type of a ring on equipping it. -actors.hero.heroclass.rogue_perk3=The Rogue is proficient with light armor, dodging better with excess strength. -actors.hero.heroclass.rogue_perk4=The Rogue is more proficient in detecting hidden doors and traps. -actors.hero.heroclass.rogue_perk5=The Rogue can go without food longer. -actors.hero.heroclass.rogue_perk6=Scrolls of Magic Mapping are identified from the beginning. +actors.hero.heroclass.rogue_perk1=The Rogue starts with a unique Cloak of Shadows, which he can use to become invisible at will. +actors.hero.heroclass.rogue_perk2=The Rogue's cloak is an artifact, it becomes more powerful as he uses it. +actors.hero.heroclass.rogue_perk3=The Rogue detects secrets and traps from farther away than other heroes. +actors.hero.heroclass.rogue_perk4=The Rogue is able to find more secrets hidden in the dungeon than other heroes. +actors.hero.heroclass.rogue_perk5=Scrolls of Magic Mapping are identified from the beginning. actors.hero.heroclass.huntress=huntress actors.hero.heroclass.huntress_perk1=The Huntress starts with a unique upgradeable boomerang.