From 11c4979e7e814ca39150c319bcb0ae11a5283a64 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Sat, 21 Apr 2018 23:28:20 -0400 Subject: [PATCH] v0.6.5: added 4 new curses, and nerfed wayward curse --- .../items/armor/Armor.java | 12 +++- .../items/armor/curses/Bulk.java | 48 +++++++++++++ .../items/armor/curses/Overgrowth.java | 68 +++++++++++++++++++ .../items/weapon/Weapon.java | 7 +- .../items/weapon/curses/Elastic.java | 54 +++++++++++++++ .../items/weapon/curses/Friendly.java | 62 +++++++++++++++++ .../shatteredpixeldungeon/plants/Plant.java | 2 +- .../messages/items/items.properties | 12 ++++ 8 files changed, 261 insertions(+), 4 deletions(-) create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Bulk.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/curses/Elastic.java create mode 100644 core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/curses/Friendly.java 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 62fe897ab..0c6cb4988 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 @@ -34,10 +34,12 @@ import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal; import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem; import com.shatteredpixel.shatteredpixeldungeon.items.Item; import com.shatteredpixel.shatteredpixeldungeon.items.armor.curses.AntiEntropy; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.curses.Bulk; import com.shatteredpixel.shatteredpixeldungeon.items.armor.curses.Corrosion; import com.shatteredpixel.shatteredpixeldungeon.items.armor.curses.Displacement; import com.shatteredpixel.shatteredpixeldungeon.items.armor.curses.Metabolism; import com.shatteredpixel.shatteredpixeldungeon.items.armor.curses.Multiplicity; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.curses.Overgrowth; import com.shatteredpixel.shatteredpixeldungeon.items.armor.curses.Stench; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Affection; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic; @@ -52,6 +54,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Stone; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Swiftness; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Thorns; import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Viscosity; +import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; import com.shatteredpixel.shatteredpixeldungeon.sprites.HeroSprite; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; @@ -307,6 +310,12 @@ public class Armor extends EquipableItem { speed *= (1.5f + 0.1f * level()); } + if (hasGlyph(Bulk.class) && + (Dungeon.level.map[owner.pos] == Terrain.DOOR + || Dungeon.level.map[owner.pos] == Terrain.OPEN_DOOR )) { + speed /= 3f; + } + return speed; } @@ -523,7 +532,8 @@ public class Armor extends EquipableItem { 2, 2, 2 }; private static final Class[] curses = new Class[]{ - AntiEntropy.class, Corrosion.class, Displacement.class, Metabolism.class, Multiplicity.class, Stench.class + AntiEntropy.class, Corrosion.class, Displacement.class, Metabolism.class, + Multiplicity.class, Stench.class, Overgrowth.class, Bulk.class }; public abstract int proc( Armor armor, Char attacker, Char defender, int damage ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Bulk.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Bulk.java new file mode 100644 index 000000000..3b3b44668 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Bulk.java @@ -0,0 +1,48 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2018 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.armor.curses; + +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; + +public class Bulk extends Armor.Glyph { + + private static ItemSprite.Glowing BLACK = new ItemSprite.Glowing( 0x000000 ); + + @Override + public int proc(Armor armor, Char attacker, Char defender, int damage) { + + //no proc effect, see armor.speedfactor + return damage; + } + + @Override + public ItemSprite.Glowing glowing() { + return BLACK; + } + + @Override + public boolean curse() { + return true; + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java new file mode 100644 index 000000000..a4dcebd30 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/armor/curses/Overgrowth.java @@ -0,0 +1,68 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2018 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.armor.curses; + +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter; +import com.shatteredpixel.shatteredpixeldungeon.effects.particles.LeafParticle; +import com.shatteredpixel.shatteredpixeldungeon.items.Generator; +import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor; +import com.shatteredpixel.shatteredpixeldungeon.plants.BlandfruitBush; +import com.shatteredpixel.shatteredpixeldungeon.plants.Plant; +import com.shatteredpixel.shatteredpixeldungeon.plants.Starflower; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; +import com.watabou.utils.Random; + +public class Overgrowth extends Armor.Glyph { + + private static ItemSprite.Glowing BLACK = new ItemSprite.Glowing( 0x000000 ); + + @Override + public int proc(Armor armor, Char attacker, Char defender, int damage) { + + if ( Random.Int( 20 ) == 0) { + + Plant.Seed s; + do{ + s = (Plant.Seed) Generator.random(Generator.Category.SEED); + } while (s instanceof BlandfruitBush.Seed || s instanceof Starflower.Seed); + + Plant p = s.couch(defender.pos, null); + + p.activate(); + CellEmitter.get( defender.pos ).burst( LeafParticle.LEVEL_SPECIFIC, 10 ); + + } + + return damage; + } + + @Override + public ItemSprite.Glowing glowing() { + return BLACK; + } + + @Override + public boolean curse() { + return true; + } +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java index 8b69064ed..e36951402 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/Weapon.java @@ -30,8 +30,10 @@ import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon; import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfFuror; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Annoying; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Displacing; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Elastic; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Exhausting; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Fragile; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Friendly; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Sacrificial; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.curses.Wayward; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Blazing; @@ -145,7 +147,7 @@ abstract public class Weapon extends KindOfWeapon { } if (hasEnchant(Wayward.class)) - encumbrance = Math.max(3, encumbrance+3); + encumbrance = Math.max(2, encumbrance+2); float ACC = this.ACC; @@ -272,7 +274,8 @@ abstract public class Weapon extends KindOfWeapon { 2, 2, 2 }; private static final Class[] curses = new Class[]{ - Annoying.class, Displacing.class, Exhausting.class, Fragile.class, Sacrificial.class, Wayward.class + Annoying.class, Displacing.class, Exhausting.class, Fragile.class, + Sacrificial.class, Wayward.class, Elastic.class, Friendly.class }; public abstract int proc( Weapon weapon, Char attacker, Char defender, int damage ); diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/curses/Elastic.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/curses/Elastic.java new file mode 100644 index 000000000..4b5fd6285 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/curses/Elastic.java @@ -0,0 +1,54 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2018 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.weapon.curses; + +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfBlastWave; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; +import com.shatteredpixel.shatteredpixeldungeon.mechanics.Ballistica; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; + +public class Elastic extends Weapon.Enchantment { + + private static ItemSprite.Glowing BLACK = new ItemSprite.Glowing( 0x000000 ); + + @Override + public int proc(Weapon weapon, Char attacker, Char defender, int damage ) { + + int oppositeDefender = defender.pos + (defender.pos - attacker.pos); + Ballistica trajectory = new Ballistica(defender.pos, oppositeDefender, Ballistica.MAGIC_BOLT); + WandOfBlastWave.throwChar(defender, trajectory, 2); + + return 0; + } + + @Override + public boolean curse() { + return true; + } + + @Override + public ItemSprite.Glowing glowing() { + return BLACK; + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/curses/Friendly.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/curses/Friendly.java new file mode 100644 index 000000000..886d6e141 --- /dev/null +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/items/weapon/curses/Friendly.java @@ -0,0 +1,62 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2018 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.weapon.curses; + +import com.shatteredpixel.shatteredpixeldungeon.actors.Char; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff; +import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Charm; +import com.shatteredpixel.shatteredpixeldungeon.effects.Speck; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon; +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSprite; +import com.watabou.utils.Random; + +public class Friendly extends Weapon.Enchantment { + + private static ItemSprite.Glowing BLACK = new ItemSprite.Glowing( 0x000000 ); + + @Override + public int proc(Weapon weapon, Char attacker, Char defender, int damage ) { + + if (Random.Int(10) == 0){ + + Buff.affect( attacker, Charm.class, Random.IntRange(9, 15) ).object = defender.id(); + attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 ); + + Buff.affect( defender, Charm.class, Random.IntRange(3, 5) ).object = attacker.id(); + defender.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 ); + + } + + return damage; + } + + @Override + public boolean curse() { + return true; + } + + @Override + public ItemSprite.Glowing glowing() { + return BLACK; + } + +} diff --git a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java index 21ce6010e..c30038017 100644 --- a/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java +++ b/core/src/main/java/com/shatteredpixel/shatteredpixeldungeon/plants/Plant.java @@ -171,7 +171,7 @@ public abstract class Plant implements Bundlable { public Plant couch( int pos, Level level ) { try { - if (level.heroFOV != null && level.heroFOV[pos]) { + if (level != null && level.heroFOV != null && level.heroFOV[pos]) { Sample.INSTANCE.play(Assets.SND_PLANT); } Plant plant = plantClass.newInstance(); diff --git a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index fc127bde3..80d653ffc 100644 --- a/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/core/src/main/resources/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -2,6 +2,9 @@ items.armor.curses.antientropy.name=%s of anti-entropy items.armor.curses.antientropy.desc=Anti-entropy curse works against the forces of the universe, pulling energy away from the attacker and into the wearer. This briefly freezes the attacker, but sets the wearer on fire! +items.armor.curses.bulk.name=%s of bulk +items.armor.curses.bulk.desc=Armor of bulk looks larger and more imposing, but doesn't actually have enhanced defence. Even worse, the added size makes moving through doorways very difficult. + items.armor.curses.corrosion.name=%s of corrosion items.armor.curses.corrosion.desc=Armor of corrosion is capable of bursting with corrosive fluid, coating everything in the area with sticky acidic ooze. @@ -14,6 +17,9 @@ items.armor.curses.metabolism.desc=The metabolism curse directly converts satiet items.armor.curses.multiplicity.name=%s of multiplicity items.armor.curses.multiplicity.desc=Armor cursed with multiplicity contains dangerous duplication magic. It will sometimes create a mirror image of the wearer, but is equally likely to duplicate the attacker! +items.armor.curses.overgrowth.name=%s of overgrowth +items.armor.curses.overgrowth.desc=Armor of overgrowth is covered in various blooming plants. While this effect certainly looks interesting, it does nothing for defence, and these plants will randomly activate in combat! + items.armor.curses.stench.name=%s of stench items.armor.curses.stench.desc=Armor cursed with stench will release clouds of noxious gas, which is hazardous to everything caught in the cloud. @@ -772,12 +778,18 @@ items.weapon.curses.annoying.desc=Annoying weapons are capable of speech, but th items.weapon.curses.displacing.name=displacing %s items.weapon.curses.displacing.desc=Displacing weapons are infused with chaotic teleportation magic, possessing the ability to warp enemies around the floor randomly. +items.weapon.curses.elastic.name=elastic %s +items.weapon.curses.elastic.desc=Elastic weapons aren't able to deal any damage, but can send enemies flying back short distances. + items.weapon.curses.exhausting.name=exhausting %s items.weapon.curses.exhausting.desc=Exhausting weapons take great effort to use, and will periodically weaken the wearer as a result. items.weapon.curses.fragile.name=fragile %s items.weapon.curses.fragile.desc=Fragile weapons start out just as strong as their normal counterparts, but rapidly decrease in effectiveness as they are used. +items.weapon.curses.friendly.name=friendly %s +items.weapon.curses.friendly.desc=Friendly weapons are best suited for pacifists, occasionally triggering magic that makes it impossible to fight. + items.weapon.curses.sacrificial.name=sacrificial %s items.weapon.curses.sacrificial.desc=Sacrificial weapons will demand blood from the wearer in return for attacking foes. The more healthy the wearer is, the more blood the curse will take.