From 8f27e921d8e24538b93f58d7bc8c7e44c9db5af8 Mon Sep 17 00:00:00 2001 From: Evan Debenham Date: Fri, 13 May 2016 18:45:32 -0400 Subject: [PATCH] v0.4.0: reworked/added the 5 basic swords --- .../ShatteredPixelDungeon.java | 4 +++ .../actors/hero/HeroClass.java | 4 +-- .../items/Generator.java | 6 +--- .../items/weapon/melee/Greatsword.java | 15 ++++++++ .../items/weapon/melee/NewShortsword.java | 36 +++++++++++++++++++ .../{ShortSword.java => WornShortsword.java} | 8 ++--- .../messages/items/items.properties | 19 ++++++---- 7 files changed, 75 insertions(+), 17 deletions(-) create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatsword.java create mode 100644 src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/NewShortsword.java rename src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/{ShortSword.java => WornShortsword.java} (92%) diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java b/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java index f67909f9c..ace11cd1f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/ShatteredPixelDungeon.java @@ -106,6 +106,10 @@ public class ShatteredPixelDungeon extends Game { com.shatteredpixel.shatteredpixeldungeon.plants.Rotberry.Seed.class, "com.shatteredpixel.shatteredpixeldungeon.actors.mobs.npcs.Wandmaker$Rotberry$Seed" ); + //0.4.0 + com.watabou.utils.Bundle.addAlias( + com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WornShortsword.class, + "com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.ShortSword" ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java index d027a1195..71103954f 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/actors/hero/HeroClass.java @@ -35,7 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade; import com.shatteredpixel.shatteredpixeldungeon.items.wands.WandOfMagicMissile; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Dagger; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MagesStaff; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.ShortSword; +import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WornShortsword; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Boomerang; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Dart; import com.shatteredpixel.shatteredpixeldungeon.messages.Messages; @@ -104,7 +104,7 @@ public enum HeroClass { } private static void initWarrior( Hero hero ) { - (hero.belongings.weapon = new ShortSword()).identify(); + (hero.belongings.weapon = new WornShortsword()).identify(); Dart darts = new Dart( 8 ); darts.identify().collect(); diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java index a52c1693f..c9be10b03 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/Generator.java @@ -105,13 +105,11 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Knuckles; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Longsword; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Mace; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Quarterstaff; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.ShortSword; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Spear; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.Sword; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WarHammer; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Boomerang; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.CurareDart; -import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Dart; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.IncendiaryDart; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Javelin; import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.Shuriken; @@ -240,15 +238,13 @@ public class Generator { BattleAxe.class, WarHammer.class, Glaive.class, - ShortSword.class, - Dart.class, Javelin.class, IncendiaryDart.class, CurareDart.class, Shuriken.class, Boomerang.class, Tamahawk.class }; - Category.WEAPON.probs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 0, 1, 1, 1, 1, 0, 1 }; + Category.WEAPON.probs = new float[]{ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 1 }; Category.ARMOR.classes = new Class[]{ ClothArmor.class, diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatsword.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatsword.java new file mode 100644 index 000000000..bab2c431d --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/Greatsword.java @@ -0,0 +1,15 @@ +package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; + +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; + +public class Greatsword extends MeleeWeapon { + + { + image = ItemSpriteSheet.GREATSWORD; + } + + public Greatsword() { + super( 5, 1f, 1f ); + } + +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/NewShortsword.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/NewShortsword.java new file mode 100644 index 000000000..b7deeeaea --- /dev/null +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/NewShortsword.java @@ -0,0 +1,36 @@ +/* + * Pixel Dungeon + * Copyright (C) 2012-2015 Oleg Dolya + * + * Shattered Pixel Dungeon + * Copyright (C) 2014-2016 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.melee; + +import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; + +//this class is named as such to avoid conflicts with the ShortSword class, from pre-0.4.0 +public class NewShortsword extends MeleeWeapon { + + { + image = ItemSpriteSheet.SHORTSWORD; + } + + public NewShortsword() { + super( 2, 1f, 1f ); + } + +} diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/ShortSword.java b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WornShortsword.java similarity index 92% rename from src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/ShortSword.java rename to src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WornShortsword.java index 9465399e5..84537c8e1 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/ShortSword.java +++ b/src/com/shatteredpixel/shatteredpixeldungeon/items/weapon/melee/WornShortsword.java @@ -22,13 +22,13 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee; import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet; -public class ShortSword extends MeleeWeapon { - +public class WornShortsword extends MeleeWeapon { + { image = ItemSpriteSheet.WORN_SHORTSWORD; } - - public ShortSword() { + + public WornShortsword() { super( 1, 1f, 1f ); } diff --git a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties index 650674a65..effa6b75c 100644 --- a/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties +++ b/src/com/shatteredpixel/shatteredpixeldungeon/messages/items/items.properties @@ -692,12 +692,15 @@ items.weapon.melee.dagger.desc=A simple iron dagger with a well worn wooden hand items.weapon.melee.glaive.name=glaive items.weapon.melee.glaive.desc=A polearm consisting of a sword blade on the end of a pole. +items.weapon.melee.greatsword.name=greatsword +items.weapon.melee.greatsword.desc=This towering blade inflicts heavy damage by investing its heft into every swing. + items.weapon.melee.knuckles.name=knuckleduster items.weapon.melee.knuckles.stats_desc=This is a rather fast weapon. items.weapon.melee.knuckles.desc=A piece of iron shaped to fit around the knuckles. items.weapon.melee.longsword.name=longsword -items.weapon.melee.longsword.desc=This towering blade inflicts heavy damage by investing its heft into every cut. +items.weapon.melee.longsword.desc=This sword's long razor-sharp steel blade shines reassuringly, though its size does make it quite heavy. items.weapon.melee.mace.name=mace items.weapon.melee.mace.stats_desc=This is a slightly fast weapon. @@ -724,24 +727,28 @@ items.weapon.melee.meleeweapon.stats_desc= items.weapon.melee.meleeweapon.cursed_worn=Because this weapon is cursed, you are powerless to remove it. items.weapon.melee.meleeweapon.cursed=You can feel a malevolent magic lurking within this weapon. +items.weapon.melee.newshortsword.name=shortsword +items.weapon.melee.newshortsword.ac_reforge=REFORGE +items.weapon.melee.newshortsword.desc=A quite short sword, only a few inches longer than a dagger. + items.weapon.melee.quarterstaff.name=quarterstaff items.weapon.melee.quarterstaff.desc=A staff of hardwood, its ends are shod with iron. -items.weapon.melee.shortsword.name=short sword -items.weapon.melee.shortsword.ac_reforge=REFORGE -items.weapon.melee.shortsword.desc=It is indeed quite short, just a few inches longer, than a dagger. - items.weapon.melee.spear.name=spear items.weapon.melee.spear.stats_desc=This is a rather slow weapon.\nThis weapon has extra reach. items.weapon.melee.spear.desc=A slender wooden rod tipped with sharpened iron. items.weapon.melee.sword.name=sword -items.weapon.melee.sword.desc=The razor-sharp length of steel blade shines reassuringly. +items.weapon.melee.sword.desc=A nicely balanced sword. Not too large, but still notably longer than a shortsword. items.weapon.melee.warhammer.name=war hammer items.weapon.melee.warhammer.stats_desc=This is a rather accurate weapon. items.weapon.melee.warhammer.desc=Few creatures can withstand the crushing blow of this towering mass of lead and steel, but only the strongest of adventurers can use it effectively. +items.weapon.melee.wornshortsword.name=worn shortsword +items.weapon.melee.wornshortsword.ac_reforge=REFORGE +items.weapon.melee.wornshortsword.desc=A quite short sword, worn down through heavy use. It is both weaker and a bit lighter than a shortsword in better condition. + ###missile weapons items.weapon.missiles.boomerang.name=boomerang