v0.9.1: implemented the wand preservation talent

This commit is contained in:
Evan Debenham 2020-11-30 13:13:08 -05:00
parent 68bdd4931c
commit b0b0d38a57
2 changed files with 12 additions and 0 deletions

View File

@ -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.

View File

@ -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.