v0.4.0: refactored extra reach on weapons, adjusted statues to use new weapon properties
This commit is contained in:
parent
256cca2e7e
commit
bbc45c6dc9
|
@ -31,6 +31,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon.Enchantment;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Death;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.enchantments.Leech;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.StatueSprite;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
@ -100,9 +101,14 @@ public class Statue extends Mob {
|
|||
return weapon.DLY;
|
||||
}
|
||||
|
||||
@Override
|
||||
protected boolean canAttack(Char enemy) {
|
||||
return Level.distance( pos, enemy.pos ) <= weapon.RCH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int dr() {
|
||||
return Dungeon.depth;
|
||||
return Dungeon.depth + weapon.defenceFactor(null);
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -54,8 +54,9 @@ abstract public class Weapon extends KindOfWeapon {
|
|||
|
||||
private static final String TXT_TO_STRING = "%s :%d";
|
||||
|
||||
public float ACC = 1; // Accuracy modifier
|
||||
public float ACC = 1f; // Accuracy modifier
|
||||
public float DLY = 1f; // Speed modifier
|
||||
public int RCH = 1; // Reach modifier (only applies to melee hits)
|
||||
|
||||
public enum Imbue {
|
||||
NONE, LIGHT, HEAVY
|
||||
|
@ -146,6 +147,11 @@ abstract public class Weapon extends KindOfWeapon {
|
|||
(encumrance > 0 ? (float)(DLY * Math.pow( 1.2, encumrance )) : DLY);
|
||||
}
|
||||
|
||||
@Override
|
||||
public int reachFactor(Hero hero) {
|
||||
return RCH;
|
||||
}
|
||||
|
||||
@Override
|
||||
public int damageRoll( Hero hero ) {
|
||||
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
public class Glaive extends MeleeWeapon {
|
||||
|
@ -30,11 +29,7 @@ public class Glaive extends MeleeWeapon {
|
|||
|
||||
tier = 5;
|
||||
DLY = 1.5f; //0.67x speed
|
||||
}
|
||||
|
||||
@Override
|
||||
public int reachFactor(Hero hero) {
|
||||
return 2; //extra reach
|
||||
RCH = 2; //extra reach
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
public class Spear extends MeleeWeapon {
|
||||
|
@ -30,11 +29,7 @@ public class Spear extends MeleeWeapon {
|
|||
|
||||
tier = 2;
|
||||
DLY = 1.5f; //0.67x speed
|
||||
}
|
||||
|
||||
@Override
|
||||
public int reachFactor(Hero hero) {
|
||||
return 2; //extra reach
|
||||
RCH = 2; //extra reach
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
|
@ -20,7 +20,6 @@
|
|||
*/
|
||||
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||
|
||||
public class Whip extends MeleeWeapon {
|
||||
|
@ -29,6 +28,7 @@ public class Whip extends MeleeWeapon {
|
|||
image = ItemSpriteSheet.WHIP;
|
||||
|
||||
tier = 3;
|
||||
RCH = 3; //lots of extra reach
|
||||
}
|
||||
|
||||
@Override
|
||||
|
@ -37,8 +37,4 @@ public class Whip extends MeleeWeapon {
|
|||
lvl*(tier); //+3 per level, down from +4
|
||||
}
|
||||
|
||||
@Override
|
||||
public int reachFactor(Hero hero) {
|
||||
return 3; //lots of extra reach
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user