v0.9.1: implemented the wand preservation talent
This commit is contained in:
parent
68bdd4931c
commit
b0b0d38a57
|
@ -1396,6 +1396,7 @@ items.weapon.melee.magesstaff.ac_imbue=IMBUE
|
|||
items.weapon.melee.magesstaff.ac_zap=ZAP
|
||||
items.weapon.melee.magesstaff.prompt=Select a wand
|
||||
items.weapon.melee.magesstaff.imbue=You imbue your staff with the %s.
|
||||
items.weapon.melee.magesstaff.preserved=The previous wand was preserved!
|
||||
items.weapon.melee.magesstaff.conflict=The conflicting magics erase the enchantment on your staff.
|
||||
items.weapon.melee.magesstaff.id_first=You'll need to identify this wand first.
|
||||
items.weapon.melee.magesstaff.cursed=You can't use a cursed wand.
|
||||
|
|
|
@ -27,6 +27,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ElmoParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||
|
@ -187,6 +188,16 @@ public class MagesStaff extends MeleeWeapon {
|
|||
|
||||
public Item imbueWand(Wand wand, Char owner){
|
||||
|
||||
if (owner == Dungeon.hero && Dungeon.hero.hasTalent(Talent.WAND_PRESERVATION)
|
||||
&& Random.Float() < 0.3f + 0.3f*Dungeon.hero.pointsInTalent(Talent.WAND_PRESERVATION)){
|
||||
this.wand.level(0);
|
||||
if (!this.wand.collect()){
|
||||
Dungeon.level.drop(this.wand, owner.pos);
|
||||
}
|
||||
GLog.newLine();
|
||||
GLog.p(Messages.get(this, "preserved"));
|
||||
}
|
||||
|
||||
this.wand = null;
|
||||
|
||||
//syncs the level of the two items.
|
||||
|
|
Loading…
Reference in New Issue
Block a user