v0.6.1: adjusted weapon/armor code so npcs and mobs can better use them
This commit is contained in:
parent
6a0a7ae450
commit
dc7d59c65f
|
@ -88,27 +88,27 @@ public class Statue extends Mob {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageRoll() {
|
public int damageRoll() {
|
||||||
return Random.NormalIntRange( weapon.min(), weapon.max() );
|
return weapon.damageRoll(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int attackSkill( Char target ) {
|
public int attackSkill( Char target ) {
|
||||||
return (int)((9 + Dungeon.depth) * weapon.ACC);
|
return (int)((9 + Dungeon.depth) * weapon.accuracyFactor(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected float attackDelay() {
|
protected float attackDelay() {
|
||||||
return weapon.DLY;
|
return weapon.speedFactor( this );
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
protected boolean canAttack(Char enemy) {
|
protected boolean canAttack(Char enemy) {
|
||||||
return Dungeon.level.distance( pos, enemy.pos ) <= weapon.RCH;
|
return Dungeon.level.distance( pos, enemy.pos ) <= weapon.reachFactor(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int drRoll() {
|
public int drRoll() {
|
||||||
return Random.NormalIntRange(0, Dungeon.depth + weapon.defenseFactor(null));
|
return Random.NormalIntRange(0, Dungeon.depth + weapon.defenseFactor(this));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|
|
@ -89,23 +89,23 @@ abstract public class KindOfWeapon extends EquipableItem {
|
||||||
abstract public int min(int lvl);
|
abstract public int min(int lvl);
|
||||||
abstract public int max(int lvl);
|
abstract public int max(int lvl);
|
||||||
|
|
||||||
public int damageRoll( Hero owner ) {
|
public int damageRoll( Char owner ) {
|
||||||
return Random.NormalIntRange( min(), max() );
|
return Random.NormalIntRange( min(), max() );
|
||||||
}
|
}
|
||||||
|
|
||||||
public float accuracyFactor(Hero hero ) {
|
public float accuracyFactor( Char owner ) {
|
||||||
return 1f;
|
return 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public float speedFactor( Hero hero ) {
|
public float speedFactor( Char owner ) {
|
||||||
return 1f;
|
return 1f;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int reachFactor( Hero hero ){
|
public int reachFactor( Char owner ){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int defenseFactor(Hero hero ) {
|
public int defenseFactor( Char owner ) {
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -39,6 +39,11 @@ import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
|
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShaftParticle;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.AntiMagic;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Flow;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Obfuscation;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.armor.glyphs.Swiftness;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfElements;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfPsionicBlast;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
|
@ -415,7 +420,13 @@ public class DriedRose extends Artifact {
|
||||||
@Override
|
@Override
|
||||||
public int attackSkill(Char target) {
|
public int attackSkill(Char target) {
|
||||||
//same accuracy as the hero.
|
//same accuracy as the hero.
|
||||||
return (defenseSkill/2)+5;
|
int acc = (defenseSkill/2)+5;
|
||||||
|
|
||||||
|
if (weapon != null){
|
||||||
|
acc *= weapon.accuracyFactor(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
return acc;
|
||||||
}
|
}
|
||||||
|
|
||||||
//FIXME currently many effects on weapons/armor are ignored
|
//FIXME currently many effects on weapons/armor are ignored
|
||||||
|
@ -424,7 +435,7 @@ public class DriedRose extends Artifact {
|
||||||
@Override
|
@Override
|
||||||
protected float attackDelay() {
|
protected float attackDelay() {
|
||||||
if (weapon != null){
|
if (weapon != null){
|
||||||
return weapon.DLY;
|
return weapon.speedFactor(this);
|
||||||
} else {
|
} else {
|
||||||
return super.attackDelay();
|
return super.attackDelay();
|
||||||
}
|
}
|
||||||
|
@ -433,7 +444,7 @@ public class DriedRose extends Artifact {
|
||||||
@Override
|
@Override
|
||||||
protected boolean canAttack(Char enemy) {
|
protected boolean canAttack(Char enemy) {
|
||||||
if (weapon != null) {
|
if (weapon != null) {
|
||||||
return Dungeon.level.distance(pos, enemy.pos) <= weapon.RCH;
|
return Dungeon.level.distance(pos, enemy.pos) <= weapon.reachFactor(this);
|
||||||
} else {
|
} else {
|
||||||
return super.canAttack(enemy);
|
return super.canAttack(enemy);
|
||||||
}
|
}
|
||||||
|
@ -443,14 +454,80 @@ public class DriedRose extends Artifact {
|
||||||
public int damageRoll() {
|
public int damageRoll() {
|
||||||
int dmg = 0;
|
int dmg = 0;
|
||||||
if (weapon != null){
|
if (weapon != null){
|
||||||
dmg += Random.NormalIntRange(weapon.min(), weapon.max());
|
dmg += weapon.damageRoll(this);
|
||||||
} else {
|
} else {
|
||||||
dmg += Random.NormalIntRange(0, 5);
|
dmg += Random.NormalIntRange(0, 5);
|
||||||
}
|
}
|
||||||
|
|
||||||
return dmg;
|
return dmg;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int attackProc(Char enemy, int damage) {
|
||||||
|
if (weapon != null) {
|
||||||
|
return weapon.proc( enemy, this, damage );
|
||||||
|
} else {
|
||||||
|
return super.attackProc(enemy, damage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int defenseProc(Char enemy, int damage) {
|
||||||
|
if (armor != null) {
|
||||||
|
return armor.proc( enemy, this, damage );
|
||||||
|
} else {
|
||||||
|
return super.defenseProc(enemy, damage);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void damage(int dmg, Object src) {
|
||||||
|
//TODO improve this when I have proper damage source logic
|
||||||
|
if (armor != null && armor.hasGlyph(AntiMagic.class)
|
||||||
|
&& RingOfElements.FULL.contains(src.getClass())){
|
||||||
|
dmg -= Random.NormalIntRange(armor.DRMin(), armor.DRMax())/3;
|
||||||
|
}
|
||||||
|
|
||||||
|
super.damage( dmg, src );
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public float speed() {
|
||||||
|
float speed = super.speed();
|
||||||
|
|
||||||
|
if (armor != null){
|
||||||
|
if (armor.hasGlyph(Swiftness.class)) {
|
||||||
|
speed *= (1.1f + 0.01f * armor.level());
|
||||||
|
} else if (armor.hasGlyph(Flow.class) && Level.water[pos]){
|
||||||
|
speed *= (1.5f + 0.05f * armor.level());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
return speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int defenseSkill(Char enemy) {
|
||||||
|
int defense = super.defenseSkill(enemy);
|
||||||
|
|
||||||
|
if (armor != null && armor.hasGlyph(Swiftness.class)){
|
||||||
|
defense += 5 + armor.level()*1.5f;
|
||||||
|
}
|
||||||
|
|
||||||
|
return defense;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int stealth() {
|
||||||
|
int stealth = super.stealth();
|
||||||
|
|
||||||
|
if (armor != null && armor.hasGlyph(Obfuscation.class)){
|
||||||
|
stealth += armor.level();
|
||||||
|
}
|
||||||
|
|
||||||
|
return stealth;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int drRoll() {
|
public int drRoll() {
|
||||||
int block = 0;
|
int block = 0;
|
||||||
|
@ -458,7 +535,7 @@ public class DriedRose extends Artifact {
|
||||||
block += Random.NormalIntRange( armor.DRMin(), armor.DRMax());
|
block += Random.NormalIntRange( armor.DRMin(), armor.DRMax());
|
||||||
}
|
}
|
||||||
if (weapon != null){
|
if (weapon != null){
|
||||||
block += Random.NormalIntRange( 0, weapon.defenseFactor( null ));
|
block += Random.NormalIntRange( 0, weapon.defenseFactor( this ));
|
||||||
}
|
}
|
||||||
return block;
|
return block;
|
||||||
}
|
}
|
||||||
|
|
|
@ -136,9 +136,13 @@ abstract public class Weapon extends KindOfWeapon {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float accuracyFactor( Hero hero ) {
|
public float accuracyFactor( Char owner ) {
|
||||||
|
|
||||||
int encumbrance = STRReq() - hero.STR();
|
int encumbrance = 0;
|
||||||
|
|
||||||
|
if( owner instanceof Hero ){
|
||||||
|
encumbrance = STRReq() - ((Hero)owner).STR();
|
||||||
|
}
|
||||||
|
|
||||||
if (hasEnchant(Wayward.class))
|
if (hasEnchant(Wayward.class))
|
||||||
encumbrance = Math.max(3, encumbrance+3);
|
encumbrance = Math.max(3, encumbrance+3);
|
||||||
|
@ -146,40 +150,44 @@ abstract public class Weapon extends KindOfWeapon {
|
||||||
float ACC = this.ACC;
|
float ACC = this.ACC;
|
||||||
|
|
||||||
if (this instanceof MissileWeapon) {
|
if (this instanceof MissileWeapon) {
|
||||||
ACC *= RingOfSharpshooting.accuracyMultiplier( hero );
|
ACC *= RingOfSharpshooting.accuracyMultiplier( owner );
|
||||||
}
|
}
|
||||||
|
|
||||||
return encumbrance > 0 ? (float)(ACC / Math.pow( 1.5, encumbrance )) : ACC;
|
return encumbrance > 0 ? (float)(ACC / Math.pow( 1.5, encumbrance )) : ACC;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public float speedFactor( Hero hero ) {
|
public float speedFactor( Char owner ) {
|
||||||
|
|
||||||
int encumrance = STRReq() - hero.STR();
|
int encumbrance = 0;
|
||||||
if (this instanceof MissileWeapon && hero.heroClass == HeroClass.HUNTRESS) {
|
if (owner instanceof Hero) {
|
||||||
encumrance -= 2;
|
encumbrance = STRReq() - ((Hero)owner).STR();
|
||||||
|
if (this instanceof MissileWeapon && ((Hero)owner).heroClass == HeroClass.HUNTRESS) {
|
||||||
|
encumbrance -= 2;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
float DLY = imbue.delayFactor(this.DLY);
|
float DLY = imbue.delayFactor(this.DLY);
|
||||||
|
|
||||||
DLY = RingOfFuror.modifyAttackDelay(DLY, hero);
|
DLY = RingOfFuror.modifyAttackDelay(DLY, owner);
|
||||||
|
|
||||||
return
|
return (encumbrance > 0 ? (float)(DLY * Math.pow( 1.2, encumbrance )) : DLY);
|
||||||
(encumrance > 0 ? (float)(DLY * Math.pow( 1.2, encumrance )) : DLY);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int reachFactor(Hero hero) {
|
public int reachFactor(Char owner) {
|
||||||
return hasEnchant(Projecting.class) ? RCH+1 : RCH;
|
return hasEnchant(Projecting.class) ? RCH+1 : RCH;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageRoll( Hero hero ) {
|
public int damageRoll( Char owner ) {
|
||||||
|
|
||||||
int damage = super.damageRoll( hero );
|
int damage = super.damageRoll( owner );
|
||||||
|
|
||||||
if (this instanceof MeleeWeapon || (this instanceof MissileWeapon && hero.heroClass == HeroClass.HUNTRESS)) {
|
if (owner instanceof Hero &&
|
||||||
int exStr = hero.STR() - STRReq();
|
(this instanceof MeleeWeapon
|
||||||
|
|| (this instanceof MissileWeapon && ((Hero)owner).heroClass == HeroClass.HUNTRESS))) {
|
||||||
|
int exStr = ((Hero)owner).STR() - STRReq();
|
||||||
if (exStr > 0) {
|
if (exStr > 0) {
|
||||||
damage += Random.IntRange( 0, exStr );
|
damage += Random.IntRange( 0, exStr );
|
||||||
}
|
}
|
||||||
|
|
|
@ -42,18 +42,21 @@ public class AssassinsBlade extends MeleeWeapon {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageRoll(Hero hero) {
|
public int damageRoll(Char owner) {
|
||||||
Char enemy = hero.enemy();
|
if (owner instanceof Hero) {
|
||||||
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
|
Hero hero = (Hero)owner;
|
||||||
//deals avg damage to max on surprise, instead of min to max.
|
Char enemy = hero.enemy();
|
||||||
int damage = imbue.damageFactor(Random.NormalIntRange((min() + max()) / 2, max()));
|
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
|
||||||
int exStr = hero.STR() - STRReq();
|
//deals avg damage to max on surprise, instead of min to max.
|
||||||
if (exStr > 0) {
|
int damage = imbue.damageFactor(Random.NormalIntRange((min() + max()) / 2, max()));
|
||||||
damage += Random.IntRange( 0, exStr );
|
int exStr = hero.STR() - STRReq();
|
||||||
|
if (exStr > 0) {
|
||||||
|
damage += Random.IntRange(0, exStr);
|
||||||
|
}
|
||||||
|
return damage;
|
||||||
}
|
}
|
||||||
return damage;
|
}
|
||||||
} else
|
return super.damageRoll(owner);
|
||||||
return super.damageRoll(hero);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
|
@ -40,19 +40,23 @@ public class Dagger extends MeleeWeapon {
|
||||||
return 4*(tier+1) + //8 base, down from 10
|
return 4*(tier+1) + //8 base, down from 10
|
||||||
lvl*(tier+1); //scaling unchanged
|
lvl*(tier+1); //scaling unchanged
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageRoll(Hero hero) {
|
public int damageRoll(Char owner) {
|
||||||
Char enemy = hero.enemy();
|
if (owner instanceof Hero) {
|
||||||
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
|
Hero hero = (Hero)owner;
|
||||||
//deals avg damage to max on surprise, instead of min to max.
|
Char enemy = hero.enemy();
|
||||||
int damage = imbue.damageFactor(Random.NormalIntRange((min() + max()) / 2, max()));
|
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
|
||||||
int exStr = hero.STR() - STRReq();
|
//deals avg damage to max on surprise, instead of min to max.
|
||||||
if (exStr > 0) {
|
int damage = imbue.damageFactor(Random.NormalIntRange((min() + max()) / 2, max()));
|
||||||
damage += Random.IntRange( 0, exStr );
|
int exStr = hero.STR() - STRReq();
|
||||||
|
if (exStr > 0) {
|
||||||
|
damage += Random.IntRange(0, exStr);
|
||||||
|
}
|
||||||
|
return damage;
|
||||||
}
|
}
|
||||||
return damage;
|
}
|
||||||
} else
|
return super.damageRoll(owner);
|
||||||
return super.damageRoll(hero);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -40,19 +40,23 @@ public class Dirk extends MeleeWeapon {
|
||||||
return 4*(tier+1) + //12 base, down from 15
|
return 4*(tier+1) + //12 base, down from 15
|
||||||
lvl*(tier+1); //scaling unchanged
|
lvl*(tier+1); //scaling unchanged
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int damageRoll(Hero hero) {
|
public int damageRoll(Char owner) {
|
||||||
Char enemy = hero.enemy();
|
if (owner instanceof Hero) {
|
||||||
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
|
Hero hero = (Hero)owner;
|
||||||
//deals avg damage to max on surprise, instead of min to max.
|
Char enemy = hero.enemy();
|
||||||
int damage = imbue.damageFactor(Random.NormalIntRange((min() + max()) / 2, max()));
|
if (enemy instanceof Mob && ((Mob) enemy).surprisedBy(hero)) {
|
||||||
int exStr = hero.STR() - STRReq();
|
//deals avg damage to max on surprise, instead of min to max.
|
||||||
if (exStr > 0) {
|
int damage = imbue.damageFactor(Random.NormalIntRange((min() + max()) / 2, max()));
|
||||||
damage += Random.IntRange( 0, exStr );
|
int exStr = hero.STR() - STRReq();
|
||||||
|
if (exStr > 0) {
|
||||||
|
damage += Random.IntRange(0, exStr);
|
||||||
|
}
|
||||||
|
return damage;
|
||||||
}
|
}
|
||||||
return damage;
|
}
|
||||||
} else
|
return super.damageRoll(owner);
|
||||||
return super.damageRoll(hero);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
|
||||||
public class Greatshield extends MeleeWeapon {
|
public class Greatshield extends MeleeWeapon {
|
||||||
|
@ -39,7 +39,7 @@ public class Greatshield extends MeleeWeapon {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int defenseFactor(Hero hero) {
|
public int defenseFactor( Char owner ) {
|
||||||
return 10+3*level(); //10 extra defence, plus 3 per level;
|
return 10+3*level(); //10 extra defence, plus 3 per level;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -138,9 +138,11 @@ public class MagesStaff extends MeleeWeapon {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int reachFactor(Hero hero) {
|
public int reachFactor(Char owner) {
|
||||||
int reach = super.reachFactor(hero);
|
int reach = super.reachFactor(owner);
|
||||||
if (wand instanceof WandOfDisintegration && hero.subClass == HeroSubClass.BATTLEMAGE){
|
if (owner instanceof Hero
|
||||||
|
&& wand instanceof WandOfDisintegration
|
||||||
|
&& ((Hero)owner).subClass == HeroSubClass.BATTLEMAGE){
|
||||||
reach++;
|
reach++;
|
||||||
}
|
}
|
||||||
return reach;
|
return reach;
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
|
||||||
public class Quarterstaff extends MeleeWeapon {
|
public class Quarterstaff extends MeleeWeapon {
|
||||||
|
@ -39,7 +39,7 @@ public class Quarterstaff extends MeleeWeapon {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int defenseFactor(Hero hero) {
|
public int defenseFactor( Char owner ) {
|
||||||
return 3; //3 extra defence
|
return 3; //3 extra defence
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
|
||||||
public class RoundShield extends MeleeWeapon {
|
public class RoundShield extends MeleeWeapon {
|
||||||
|
@ -39,7 +39,7 @@ public class RoundShield extends MeleeWeapon {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int defenseFactor(Hero hero) {
|
public int defenseFactor( Char owner ) {
|
||||||
return 5+2*level(); //5 extra defence, plus 2 per level;
|
return 5+2*level(); //5 extra defence, plus 2 per level;
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -21,7 +21,7 @@
|
||||||
|
|
||||||
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
package com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee;
|
||||||
|
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
|
||||||
public class Sai extends MeleeWeapon {
|
public class Sai extends MeleeWeapon {
|
||||||
|
@ -40,7 +40,7 @@ public class Sai extends MeleeWeapon {
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int defenseFactor(Hero hero) {
|
public int defenseFactor( Char owner ) {
|
||||||
return 3; //3 extra defence
|
return 3; //3 extra defence
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue
Block a user