v0.4.0: adjusted encumberance penalties
This commit is contained in:
parent
ad4c117643
commit
baeaae13e0
|
@ -78,6 +78,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.Scroll;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicMapping;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfMagicalInfusion;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfUpgrade;
|
||||||
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.MissileWeapon;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Level;
|
||||||
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
import com.shatteredpixel.shatteredpixeldungeon.levels.Terrain;
|
||||||
|
@ -347,7 +348,7 @@ public class Hero extends Char {
|
||||||
int aEnc = belongings.armor != null ? belongings.armor.STRReq() - STR() : 0;
|
int aEnc = belongings.armor != null ? belongings.armor.STRReq() - STR() : 0;
|
||||||
if (aEnc > 0) {
|
if (aEnc > 0) {
|
||||||
|
|
||||||
return (float)(speed * Math.pow( 1.3, -aEnc ));
|
return (float)(speed / Math.pow( 1.2, aEnc ));
|
||||||
|
|
||||||
} else {
|
} else {
|
||||||
|
|
||||||
|
@ -360,6 +361,15 @@ public class Hero extends Char {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public boolean encumbered(){
|
||||||
|
return (belongings.weapon != null
|
||||||
|
&& belongings.weapon instanceof Weapon
|
||||||
|
&& STR() < ((Weapon)belongings.weapon).STRReq())
|
||||||
|
||
|
||||||
|
(belongings.armor != null
|
||||||
|
&& STR() < belongings.armor.STRReq());
|
||||||
|
}
|
||||||
|
|
||||||
public boolean canAttack(Char enemy){
|
public boolean canAttack(Char enemy){
|
||||||
if (enemy == null || pos == enemy.pos)
|
if (enemy == null || pos == enemy.pos)
|
||||||
return false;
|
return false;
|
||||||
|
|
|
@ -339,7 +339,8 @@ public abstract class Mob extends Char {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int defenseSkill( Char enemy ) {
|
public int defenseSkill( Char enemy ) {
|
||||||
if (enemySeen && paralysed == 0) {
|
boolean seen = enemySeen || (enemy == Dungeon.hero && Dungeon.hero.encumbered());
|
||||||
|
if (seen && paralysed == 0) {
|
||||||
int defenseSkill = this.defenseSkill;
|
int defenseSkill = this.defenseSkill;
|
||||||
int penalty = 0;
|
int penalty = 0;
|
||||||
for (Buff buff : enemy.buffs(RingOfAccuracy.Accuracy.class)) {
|
for (Buff buff : enemy.buffs(RingOfAccuracy.Accuracy.class)) {
|
||||||
|
@ -355,7 +356,7 @@ public abstract class Mob extends Char {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int defenseProc( Char enemy, int damage ) {
|
public int defenseProc( Char enemy, int damage ) {
|
||||||
if (!enemySeen && enemy == Dungeon.hero) {
|
if (!enemySeen && enemy == Dungeon.hero && !Dungeon.hero.encumbered()) {
|
||||||
if (((Hero)enemy).subClass == HeroSubClass.ASSASSIN) {
|
if (((Hero)enemy).subClass == HeroSubClass.ASSASSIN) {
|
||||||
damage *= 1.34f;
|
damage *= 1.34f;
|
||||||
Wound.hit(this);
|
Wound.hit(this);
|
||||||
|
|
Loading…
Reference in New Issue
Block a user