v0.8.2: added a temp reference to equipped weps when using thrown weps
This commit is contained in:
parent
a298053118
commit
666e009334
|
@ -52,6 +52,9 @@ public class Belongings implements Iterable<Item> {
|
|||
public Artifact artifact = null;
|
||||
public KindofMisc misc = null;
|
||||
public Ring ring = null;
|
||||
|
||||
//used when thrown weapons temporary occupy the weapon slot
|
||||
public KindOfWeapon stashedWeapon = null;
|
||||
|
||||
public Belongings( Hero owner ) {
|
||||
this.owner = owner;
|
||||
|
|
|
@ -323,11 +323,12 @@ public class Hero extends Char {
|
|||
public boolean shoot( Char enemy, MissileWeapon wep ) {
|
||||
|
||||
//temporarily set the hero's weapon to the missile weapon being used
|
||||
KindOfWeapon equipped = belongings.weapon;
|
||||
belongings.stashedWeapon = belongings.weapon;
|
||||
belongings.weapon = wep;
|
||||
boolean hit = attack( enemy );
|
||||
Invisibility.dispel();
|
||||
belongings.weapon = equipped;
|
||||
belongings.weapon = belongings.stashedWeapon;
|
||||
belongings.stashedWeapon = null;
|
||||
|
||||
if (subClass == HeroSubClass.GLADIATOR){
|
||||
if (hit) {
|
||||
|
|
|
@ -42,7 +42,7 @@ abstract public class KindOfWeapon extends EquipableItem {
|
|||
|
||||
@Override
|
||||
public boolean isEquipped( Hero hero ) {
|
||||
return hero.belongings.weapon == this;
|
||||
return hero.belongings.weapon == this || hero.belongings.stashedWeapon == this;
|
||||
}
|
||||
|
||||
@Override
|
||||
|
|
Loading…
Reference in New Issue
Block a user