diff --git a/core/src/main/assets/messages/items/items.properties b/core/src/main/assets/messages/items/items.properties index 53c517e01..2fe9f212f 100644 --- a/core/src/main/assets/messages/items/items.properties +++ b/core/src/main/assets/messages/items/items.properties @@ -903,6 +903,8 @@ items.remains.cloakscrap.name=scrap of fabric items.remains.cloakscrap.desc=This scrap of translucent fabric looks like it came from a late Rogue's cloak of shadows. You can still feel a little mystical energy left in it, you can use it to give your artifacts a little charge boost. Doing this will destroy the fabric however. items.remains.sealshard.name=seal shards items.remains.sealshard.desc=These tiny shards of red wax look like they came from the seal of a fallen Warrior. You can still feel a bit of willpower clinging to the seal, you can use it to give yourself a bit of shielding. Doing this will destroy the seal shards however. +items.remains.tornpage.name=torn page +items.remains.tornpage.desc=This page looks like it was ripped out of an expired Cleric's holy tome. There's still a little divine energy clinging to it, you can use it to regain a little bit of health. Doing this will destroy the torn page however. diff --git a/core/src/main/assets/sprites/items.png b/core/src/main/assets/sprites/items.png index ca8ff9d2b..30271658d 100644 Binary files a/core/src/main/assets/sprites/items.png and b/core/src/main/assets/sprites/items.png differ diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/RemainsItem.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/RemainsItem.java index 5352a7935..e453d7ea5 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/RemainsItem.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/RemainsItem.java @@ -90,8 +90,8 @@ public abstract class RemainsItem extends Item { return new BowFragment(); case DUELIST: return new BrokenHilt(); - case CLERIC: //TODO CLERIC remains item - return new SealShard(); + case CLERIC: + return new TornPage(); } } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/SealShard.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/SealShard.java index b77900953..4d96fb509 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/SealShard.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/SealShard.java @@ -38,7 +38,7 @@ public class SealShard extends RemainsItem { @Override protected void doEffect(Hero hero) { - Buff.affect(hero, Barrier.class).incShield(hero.HT/10); + Buff.affect(hero, Barrier.class).incShield(Math.round(hero.HT/5f)); hero.sprite.showStatusWithIcon( CharSprite.POSITIVE, Integer.toString(hero.HT/10), FloatingText.SHIELDING ); Sample.INSTANCE.play(Assets.Sounds.UNLOCK); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/TornPage.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/TornPage.java new file mode 100644 index 000000000..57008b127 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/remains/TornPage.java @@ -0,0 +1,45 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2024 Evan Debenham + * + * This program is free software: you can redistribute it and/or modify + * it under the terms of the GNU General Public License as published by + * the Free Software Foundation, either version 3 of the License, or + * (at your option) any later version. + * + * This program is distributed in the hope that it will be useful, + * but WITHOUT ANY WARRANTY; without even the implied warranty of + * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the + * GNU General Public License for more details. + * + * You should have received a copy of the GNU General Public License + * along with this program. If not, see + */ + +package com.shatteredpixel.shatteredpixeldungeon.items.remains; + +import com.shatteredpixel.shatteredpixeldungeon.Assets; +import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero; +import com.shatteredpixel.shatteredpixeldungeon.effects.FloatingText; +import com.shatteredpixel.shatteredpixeldungeon.sprites.CharSprite; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; +import com.watabou.noosa.audio.Sample; + +public class TornPage extends RemainsItem { + + { + image = ItemSpriteSheet.TORN_PAGE; + } + + @Override + protected void doEffect(Hero hero) { + int toHeal = Math.round(hero.HT/10f); + hero.HP = Math.min(hero.HP + toHeal, hero.HT); + hero.sprite.showStatusWithIcon( CharSprite.POSITIVE, Integer.toString(toHeal), FloatingText.HEALING ); + Sample.INSTANCE.play( Assets.Sounds.READ ); + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java index 2c6f21714..090fe6a0b 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/journal/Catalog.java @@ -96,6 +96,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.remains.BrokenHilt; import com.shatteredpixel.shatteredpixeldungeon.items.remains.BrokenStaff; import com.shatteredpixel.shatteredpixeldungeon.items.remains.CloakScrap; import com.shatteredpixel.shatteredpixeldungeon.items.remains.SealShard; +import com.shatteredpixel.shatteredpixeldungeon.items.remains.TornPage; import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.exotic.ExoticScroll; import com.shatteredpixel.shatteredpixeldungeon.items.spells.Alchemize; import com.shatteredpixel.shatteredpixeldungeon.items.spells.BeaconOfReturning; @@ -257,7 +258,7 @@ public enum Catalog { CorpseDust.class, Embers.class, CeremonialCandle.class, DarkGold.class, DwarfToken.class, GooBlob.class, TengusMask.class, MetalShard.class, KingsCrown.class, LiquidMetal.class, ArcaneResin.class, - SealShard.class, BrokenStaff.class, CloakScrap.class, BowFragment.class, BrokenHilt.class); + SealShard.class, BrokenStaff.class, CloakScrap.class, BowFragment.class, BrokenHilt.class, TornPage.class); } diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java index ebb776d54..2d6ecaac3 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/sprites/ItemSpriteSheet.java @@ -151,7 +151,8 @@ public class ItemSpriteSheet { public static final int CLOAK_SCRAP = MISC_CONSUMABLE +18; public static final int BOW_FRAGMENT = MISC_CONSUMABLE +19; public static final int BROKEN_HILT = MISC_CONSUMABLE +20; - public static final int TRINKET_CATA = MISC_CONSUMABLE +21; + public static final int TORN_PAGE = MISC_CONSUMABLE +21; + public static final int TRINKET_CATA = MISC_CONSUMABLE +22; static{ assignItemRect(ANKH, 10, 16); @@ -178,6 +179,7 @@ public class ItemSpriteSheet { assignItemRect(CLOAK_SCRAP, 9, 9); assignItemRect(BOW_FRAGMENT, 12, 9); assignItemRect(BROKEN_HILT, 9, 9); + assignItemRect(TORN_PAGE, 11, 13); assignItemRect(TRINKET_CATA, 12, 11); }