v0.4.0: refactors and rebalancing to existing weapons

This commit is contained in:
Evan Debenham 2016-05-14 18:32:35 -04:00
parent 8f27e921d8
commit 56ec14e370
28 changed files with 152 additions and 106 deletions

View File

@ -261,7 +261,7 @@ public class Hero extends Char {
KindOfWeapon wep = rangedWeapon != null ? rangedWeapon : belongings.weapon;
if (wep != null) {
return (int)(attackSkill * accuracy * wep.acuracyFactor( this ));
return (int)(attackSkill * accuracy * wep.accuracyFactor( this ));
} else {
return (int)(attackSkill * accuracy);
}

View File

@ -92,7 +92,7 @@ public class Statue extends Mob {
@Override
public int attackSkill( Char target ) {
return (int)((9 + Dungeon.depth) * weapon.ACU);
return (int)((9 + Dungeon.depth) * weapon.ACC);
}
@Override

View File

@ -77,14 +77,22 @@ abstract public class KindOfWeapon extends EquipableItem {
}
}
abstract public int min();
abstract public int max();
public int min(){
return min(level());
}
public int max(){
return max(level());
}
abstract public int min(int lvl);
abstract public int max(int lvl);
public int damageRoll( Hero owner ) {
return Random.NormalIntRange( min(), max() );
}
public float acuracyFactor( Hero hero ) {
public float accuracyFactor(Hero hero ) {
return 1f;
}

View File

@ -63,18 +63,18 @@ public class Pickaxe extends Weapon {
public boolean bloodStained = false;
@Override
public int min() {
return 3;
public int min(int lvl) {
return 2; //tier 2
}
@Override
public int max() {
return 12;
public int max(int lvl) {
return 15; //tier 2
}
@Override
public int STRReq(int lvl) {
return 14;
return 14; //tier 3
}
@Override
@ -89,7 +89,7 @@ public class Pickaxe extends Weapon {
super.execute( hero, action );
if (action == AC_MINE) {
if (action.equals(AC_MINE)) {
if (Dungeon.depth < 11 || Dungeon.depth > 15) {
GLog.w( Messages.get(this, "no_vein") );

View File

@ -54,7 +54,7 @@ abstract public class Weapon extends KindOfWeapon {
private static final String TXT_TO_STRING = "%s :%d";
public float ACU = 1; // Accuracy modifier
public float ACC = 1; // Accuracy modifier
public float DLY = 1f; // Speed modifier
public enum Imbue {
@ -105,11 +105,11 @@ abstract public class Weapon extends KindOfWeapon {
}
@Override
public float acuracyFactor( Hero hero ) {
public float accuracyFactor( Hero hero ) {
int encumbrance = STRReq() - hero.STR();
float ACU = this.ACU;
float ACC = this.ACC;
if (this instanceof MissileWeapon) {
if (hero.heroClass == HeroClass.HUNTRESS) {
@ -119,10 +119,10 @@ abstract public class Weapon extends KindOfWeapon {
for (Buff buff : hero.buffs(RingOfSharpshooting.Aim.class)) {
bonus += ((RingOfSharpshooting.Aim)buff).level;
}
ACU *= (float)(Math.pow(1.1, bonus));
ACC *= (float)(Math.pow(1.1, bonus));
}
return encumbrance > 0 ? (float)(ACU / Math.pow( 1.5, encumbrance )) : ACU;
return encumbrance > 0 ? (float)(ACC / Math.pow( 1.5, encumbrance )) : ACC;
}
@Override

View File

@ -26,10 +26,15 @@ public class BattleAxe extends MeleeWeapon {
{
image = ItemSpriteSheet.BATTLE_AXE;
tier = 4;
ACC = 1.175f; //17.5% boost to accuracy
}
public BattleAxe() {
super( 4, 1.2f, 1f );
@Override
public int max(int lvl) {
return 20 + //20 base, down from 25
lvl*(tier+1); //scaling unchanged
}
}

View File

@ -26,10 +26,15 @@ public class Dagger extends MeleeWeapon {
{
image = ItemSpriteSheet.DAGGER;
tier = 1;
ACC = 1.25f; //25% boost to accuracy
}
public Dagger() {
super( 1, 1.2f, 1f );
@Override
public int max(int lvl) {
return 8 + //8 base, down from 10
lvl*(tier+1); //scaling unchanged
}
}

View File

@ -20,16 +20,33 @@
*/
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 {
{
image = ItemSpriteSheet.GLAIVE;
tier = 5;
DLY = 1.5f; //0.67x speed
}
public Glaive() {
super( 5, 1f, 1f );
@Override
public int reachFactor(Hero hero) {
return 2; //extra reach
}
@Override
public int min(int lvl) {
return tier + //base unchanged
2*lvl; //+2 per level, up from +1
}
@Override
public int max(int lvl) {
return 40 + //40 base, up from 30
lvl*8; //+8 per level, up from +6
}
}

View File

@ -6,10 +6,8 @@ public class Greatsword extends MeleeWeapon {
{
image = ItemSpriteSheet.GREATSWORD;
}
public Greatsword() {
super( 5, 1f, 1f );
tier=5;
}
}

View File

@ -26,10 +26,15 @@ public class Knuckles extends MeleeWeapon {
{
image = ItemSpriteSheet.KNUCKLEDUSTER;
tier = 1;
DLY = 0.5f; //2x speed
}
public Knuckles() {
super( 1, 1f, 0.5f );
@Override
public int max(int lvl) {
return 6 + //6 base, down from 10
lvl*2; //+1 per level, down from +2
}
}

View File

@ -26,10 +26,8 @@ public class Longsword extends MeleeWeapon {
{
image = ItemSpriteSheet.LONGSWORD;
}
public Longsword() {
super( 4, 1f, 1f );
tier = 4;
}
}

View File

@ -26,10 +26,15 @@ public class Mace extends MeleeWeapon {
{
image = ItemSpriteSheet.MACE;
tier = 3;
ACC = 1.2f; //20% boost to accuracy
}
public Mace() {
super( 3, 1f, 0.8f );
@Override
public int max(int lvl) {
return 16 + //16 base, down from 20
lvl*(tier+1); //scaling unchanged
}
}

View File

@ -61,6 +61,8 @@ public class MagesStaff extends MeleeWeapon {
{
image = ItemSpriteSheet.MAGES_STAFF;
tier = 1;
defaultAction = AC_ZAP;
usesTargeting = true;
@ -69,15 +71,13 @@ public class MagesStaff extends MeleeWeapon {
}
public MagesStaff() {
super(1, 1f, 1f);
wand = null;
}
@Override
protected int maxBase() {
return 6; //6 base damage instead of 10
public int max(int lvl) {
return 6 + //6 base damage, down from 10
lvl*(tier+1); //scaling unaffected
}
public MagesStaff(Wand wand){

View File

@ -28,33 +28,18 @@ import com.watabou.utils.Random;
public class MeleeWeapon extends Weapon {
private int tier;
public MeleeWeapon( int tier, float acu, float dly ) {
super();
this.tier = tier;
ACU = acu;
DLY = dly;
}
protected int minBase() {
return tier;
}
protected int tier;
protected int maxBase() {
return (int)((tier + 1) * 5 / ACU * DLY);
@Override
public int min(int lvl) {
return tier + //base
lvl; //level scaling
}
@Override
public int min() {
return minBase() + level();
}
@Override
public int max() {
return maxBase() + level() * (tier + 1);
public int max(int lvl) {
return 5*(tier+1) + //base
lvl*(tier+1); //level scaling
}
@Override
@ -86,8 +71,8 @@ public class MeleeWeapon extends Weapon {
float dmgfactor = (imbue == Imbue.LIGHT ? 0.7f : imbue == Imbue.HEAVY ? 1.5f : 1);
info += " " + Messages.get(Weapon.class, "avg_dmg", Math.round((min + (max - min) / 2)*dmgfactor));
} else {
int min = minBase();
int max = maxBase();
int min = min(0);
int max = max(0);
info += " " + Messages.get(MeleeWeapon.class, "unknown", (min + (max - min) / 2), STRReq(0));
if (STRReq(0) > Dungeon.hero.STR()) {
info += " " + Messages.get(MeleeWeapon.class, "probably_too_heavy");

View File

@ -27,10 +27,8 @@ public class NewShortsword extends MeleeWeapon {
{
image = ItemSpriteSheet.SHORTSWORD;
}
public NewShortsword() {
super( 2, 1f, 1f );
tier = 2;
}
}

View File

@ -26,10 +26,16 @@ public class Quarterstaff extends MeleeWeapon {
{
image = ItemSpriteSheet.QUARTERSTAFF;
}
public Quarterstaff() {
super( 2, 1f, 1f );
tier = 2;
}
@Override
public int max(int lvl) {
return 12 + //12 base, down from 15
lvl*(tier+1); //scaling unchanged
}
//TODO add defence bonus code
}

View File

@ -27,15 +27,26 @@ public class Spear extends MeleeWeapon {
{
image = ItemSpriteSheet.SPEAR;
tier = 2;
DLY = 1.5f; //0.67x speed
}
@Override
public int reachFactor(Hero hero) {
return 2;
return 2; //extra reach
}
public Spear() {
super( 2, 1f, 1.5f );
@Override
public int min(int lvl) {
return tier + //base unchanged
2*lvl; //+2 per level, up from +1
}
@Override
public int max(int lvl) {
return 20 + //20 base, up from 15
lvl*4; //+4 per level, up from +3
}
}

View File

@ -26,10 +26,8 @@ public class Sword extends MeleeWeapon {
{
image = ItemSpriteSheet.SWORD;
}
public Sword() {
super( 3, 1f, 1f );
tier = 3;
}
}

View File

@ -26,10 +26,15 @@ public class WarHammer extends MeleeWeapon {
{
image = ItemSpriteSheet.WAR_HAMMER;
tier = 5;
ACC = 1.15f; //15% boost to accuracy
}
public WarHammer() {
super( 5, 1.2f, 1f );
@Override
public int max(int lvl) {
return 24 + //24 base, down from 30
lvl*(tier+1); //scaling unchanged
}
}

View File

@ -26,10 +26,8 @@ public class WornShortsword extends MeleeWeapon {
{
image = ItemSpriteSheet.WORN_SHORTSWORD;
}
public WornShortsword() {
super( 1, 1f, 1f );
tier = 1;
}
}

View File

@ -50,18 +50,21 @@ public class Boomerang extends MissileWeapon {
}
@Override
public int min() {
return 1 + level();
public int min(int lvl) {
return 1 +
lvl;
}
@Override
public int max() {
return 5 + 2 * level();
public int max(int lvl) {
return 5 + //half the base damage of a tier-1 weapon
2 * lvl;//scales the same as a tier 1 weapon
}
@Override
public int STRReq(int lvl) {
lvl = Math.max(0, lvl);
//strength req decreases at +1,+3,+6,+10,etc.
return 10 - (int)(Math.sqrt(8 * lvl + 1) - 1)/2;
}

View File

@ -36,12 +36,12 @@ public class CurareDart extends MissileWeapon {
}
@Override
public int min() {
public int min(int lvl) {
return 1;
}
@Override
public int max() {
public int max(int lvl) {
return 3;
}

View File

@ -33,12 +33,12 @@ public class Dart extends MissileWeapon {
}
@Override
public int min() {
public int min(int lvl) {
return 1;
}
@Override
public int max() {
public int max(int lvl) {
return 4;
}

View File

@ -39,12 +39,12 @@ public class IncendiaryDart extends MissileWeapon {
}
@Override
public int min() {
public int min(int lvl) {
return 1;
}
@Override
public int max() {
public int max(int lvl) {
return 2;
}

View File

@ -34,12 +34,12 @@ public class Javelin extends MissileWeapon {
}
@Override
public int min() {
public int min(int lvl) {
return 2;
}
@Override
public int max() {
public int max(int lvl) {
return 15;
}

View File

@ -33,12 +33,12 @@ public class Shuriken extends MissileWeapon {
}
@Override
public int min() {
public int min(int lvl) {
return 2;
}
@Override
public int max() {
public int max(int lvl) {
return 6;
}

View File

@ -35,12 +35,12 @@ public class Tamahawk extends MissileWeapon {
}
@Override
public int min() {
public int min(int lvl) {
return 4;
}
@Override
public int max() {
public int max(int lvl) {
return 20;
}

View File

@ -690,7 +690,8 @@ items.weapon.melee.dagger.stats_desc=This is a rather accurate weapon.
items.weapon.melee.dagger.desc=A simple iron dagger with a well worn wooden handle.
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.glaive.stats_desc=This is a rather slow weapon.\nThis weapon has extra reach.
items.weapon.melee.glaive.desc=A massive 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.
@ -703,7 +704,7 @@ items.weapon.melee.longsword.name=longsword
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.
items.weapon.melee.mace.stats_desc=This is a rather accurate weapon.
items.weapon.melee.mace.desc=The iron head of this weapon inflicts substantial damage.
items.weapon.melee.magesstaff.name=mage's staff