v0.4.0: added the ability for weapons to give DR, gave it to quarterstaff
This commit is contained in:
parent
84324c6f52
commit
7021b01821
|
@ -296,11 +296,13 @@ public class Hero extends Char {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int dr() {
|
public int dr() {
|
||||||
int dr = belongings.armor != null ? Math.max( belongings.armor.DR(), 0 ) : 0;
|
int dr = 0;
|
||||||
Barkskin barkskin = buff( Barkskin.class );
|
Barkskin bark = buff(Barkskin.class);
|
||||||
if (barkskin != null) {
|
|
||||||
dr += barkskin.level();
|
if (belongings.armor != null) dr += Math.max( belongings.armor.DR(), 0);
|
||||||
}
|
if (belongings.weapon != null) dr += Math.max( belongings.weapon.defenceFactor( this ), 0 );
|
||||||
|
if (bark != null) dr += bark.level();
|
||||||
|
|
||||||
return dr;
|
return dr;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -103,6 +103,10 @@ abstract public class KindOfWeapon extends EquipableItem {
|
||||||
public int reachFactor( Hero hero ){
|
public int reachFactor( Hero hero ){
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int defenceFactor( Hero hero ) {
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
public void proc( Char attacker, Char defender, int damage ) {
|
public void proc( Char attacker, Char defender, int damage ) {
|
||||||
}
|
}
|
||||||
|
|
|
@ -20,6 +20,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.sprites.ItemSpriteSheet;
|
import com.shatteredpixel.shatteredpixeldungeon.sprites.ItemSpriteSheet;
|
||||||
|
|
||||||
public class Quarterstaff extends MeleeWeapon {
|
public class Quarterstaff extends MeleeWeapon {
|
||||||
|
@ -36,6 +37,8 @@ public class Quarterstaff extends MeleeWeapon {
|
||||||
lvl*(tier+1); //scaling unchanged
|
lvl*(tier+1); //scaling unchanged
|
||||||
}
|
}
|
||||||
|
|
||||||
//TODO add defence bonus code
|
@Override
|
||||||
|
public int defenceFactor(Hero hero) {
|
||||||
|
return 2+level(); //2 extra defence, plus 1 per level;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -736,6 +736,7 @@ items.weapon.melee.newshortsword.name=shortsword
|
||||||
items.weapon.melee.newshortsword.desc=A quite short sword, only a few inches longer than a dagger.
|
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.name=quarterstaff
|
||||||
|
items.weapon.melee.quarterstaff.stats_desc=This weapon increases your damage absorbtion.
|
||||||
items.weapon.melee.quarterstaff.desc=A staff of hardwood, its ends are shod with iron.
|
items.weapon.melee.quarterstaff.desc=A staff of hardwood, its ends are shod with iron.
|
||||||
|
|
||||||
items.weapon.melee.spear.name=spear
|
items.weapon.melee.spear.name=spear
|
||||||
|
|
Loading…
Reference in New Issue
Block a user