v0.9.0: implemented an ID speed related talent for each hero
This commit is contained in:
parent
a7c6744c30
commit
8aeeacb10e
|
@ -298,32 +298,32 @@ actors.buffs.wellfed.desc=You feel quite satisfied and full.\n\nWhile well fed,
|
|||
###hero
|
||||
actors.hero.talent.hearty_meal.title=hearty meal
|
||||
actors.hero.talent.hearty_meal.desc=_+1:_ Eating at below 50% health heals the Warrior for _4 HP_.\n\n_+2:_ Eating at below 50% health heals the Warrior for _6 HP_.
|
||||
actors.hero.talent.test_warrior_2.title=armsmaster's intuition
|
||||
actors.hero.talent.test_warrior_2.desc=_+1:_ The Warrior identifies weapons and armor _2x faster_.\n\n_+2:_ The Warrior identifies weapons and armor _when he equips them_.
|
||||
actors.hero.talent.armsmasters_intuition.title=armsmaster's intuition
|
||||
actors.hero.talent.armsmasters_intuition.desc=_+1:_ The Warrior identifies weapons and armor _2x faster_.\n\n_+2:_ The Warrior identifies weapons and armor _when he equips them_.
|
||||
actors.hero.talent.test_warrior_3.title=test talent
|
||||
actors.hero.talent.test_warrior_3.desc=_+1:_ Whenever he identifies a potion, the warrior heals for _3 HP_.\n\n_+2:_ Whenever he identifies a potion, the warrior heals for _5 HP_.
|
||||
actors.hero.talent.test_warrior_4.title=iron will
|
||||
actors.hero.talent.test_warrior_4.desc=_+1:_ The max shield provided by the warrior's seal is _increased by 1_.\n\n_+2:_ The max shield provided by the warrior's seal is _increased by 2_.
|
||||
actors.hero.talent.energizing_meal.title=energizing meal
|
||||
actors.hero.talent.energizing_meal.desc=_+1:_ Eating at below 50% health grants the Mage _4 turns of wand recharging_.\n\n_+2:_ Eating at below 50% health grants the Mage _6 turns of wand recharging_.
|
||||
actors.hero.talent.test_mage_2.title=scholar's intuition
|
||||
actors.hero.talent.test_mage_2.desc=_+1:_ The Mage identifies wands _2x faster_.\n\n_+2:_ The Mage identifies wands _when he uses them_.
|
||||
actors.hero.talent.scholars_intuition.title=scholar's intuition
|
||||
actors.hero.talent.scholars_intuition.desc=_+1:_ The Mage identifies wands _2x faster_.\n\n_+2:_ The Mage identifies wands _when he uses them_.
|
||||
actors.hero.talent.test_mage_3.title=test talent
|
||||
actors.hero.talent.test_mage_3.desc=TODO
|
||||
actors.hero.talent.test_mage_4.title=test talent
|
||||
actors.hero.talent.test_mage_4.desc=TODO
|
||||
actors.hero.talent.rationed_meal.title=rationed meal
|
||||
actors.hero.talent.rationed_meal.desc=_+1:_ Eating at below 50% health gives the Rogue _20% more satiety_.\n\n_+2:_ Eating at below 50% health gives the Rogue _30% more satiety_.
|
||||
actors.hero.talent.test_rogue_2.title=thief's intuition
|
||||
actors.hero.talent.test_rogue_2.desc=_+1:_ The Rogue identifies the type of a ring _when he equips it_.\n\n_+2:_ The Rogue identifies the type of a ring _when he examines it_.
|
||||
actors.hero.talent.thiefs_intuition.title=thief's intuition
|
||||
actors.hero.talent.thiefs_intuition.desc=_+1:_ The Rogue identifies rings _2x faster_, and identifies the type of a ring _when he equips it_.\n\n_+2:_ The Rogue identifies rings _when he equips them_, and identifies the type of a ring _when he picks it up_.
|
||||
actors.hero.talent.test_rogue_3.title=test talent
|
||||
actors.hero.talent.test_rogue_3.desc=TODO
|
||||
actors.hero.talent.test_rogue_4.title=test talent
|
||||
actors.hero.talent.test_rogue_4.desc=TODO
|
||||
actors.hero.talent.invigorating_meal.title=invigorating meal
|
||||
actors.hero.talent.invigorating_meal.desc=_+1:_ Eating at below 50% health takes 1 turn and grants the Huntress _2 turns of haste_.\n\n_+2:_ Eating at below 50% health takes 1 turn and grants the Huntress _3 turns of haste_.
|
||||
actors.hero.talent.test_huntress_2.title=survivalist's intuition
|
||||
actors.hero.talent.test_huntress_2.desc=_+1:_ The Huntress identifies all equipment _1.5x faster_.\n\n_+2:_ The Huntress identifies all equipment _2x faster_.
|
||||
actors.hero.talent.survivalists_intuition.title=survivalist's intuition
|
||||
actors.hero.talent.survivalists_intuition.desc=_+1:_ The Huntress identifies all equipment _1.5x faster_.\n\n_+2:_ The Huntress identifies all equipment _2x faster_.
|
||||
actors.hero.talent.test_huntress_3.title=test talent
|
||||
actors.hero.talent.test_huntress_3.desc=TODO
|
||||
actors.hero.talent.test_huntress_4.title=test talent
|
||||
|
|
|
@ -306,6 +306,7 @@ public class Hero extends Char {
|
|||
if (f == talent) tier.put(talent, tier.get(talent)+1);
|
||||
}
|
||||
}
|
||||
Talent.onTalentUpgraded(this, talent);
|
||||
}
|
||||
|
||||
//TODO account for tiers
|
||||
|
|
|
@ -21,12 +21,19 @@
|
|||
|
||||
package com.shatteredpixel.shatteredpixeldungeon.actors.hero;
|
||||
|
||||
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Hunger;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.wands.Wand;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.Weapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.MeleeWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.watabou.utils.Bundle;
|
||||
|
||||
|
@ -37,22 +44,22 @@ import java.util.LinkedHashMap;
|
|||
public enum Talent {
|
||||
|
||||
HEARTY_MEAL(0),
|
||||
TEST_WARRIOR_2(1),
|
||||
ARMSMASTERS_INTUITION(1),
|
||||
TEST_WARRIOR_3(2),
|
||||
TEST_WARRIOR_4(3),
|
||||
|
||||
ENERGIZING_MEAL(16),
|
||||
TEST_MAGE_2(17),
|
||||
SCHOLARS_INTUITION(17),
|
||||
TEST_MAGE_3(18),
|
||||
TEST_MAGE_4(19),
|
||||
|
||||
RATIONED_MEAL(32),
|
||||
TEST_ROGUE_2(33),
|
||||
THIEFS_INTUITION(33),
|
||||
TEST_ROGUE_3(34),
|
||||
TEST_ROGUE_4(35),
|
||||
|
||||
INVIGORATING_MEAL(48),
|
||||
TEST_HUNTRESS_2(49),
|
||||
SURVIVALISTS_INTUITION(49),
|
||||
TEST_HUNTRESS_3(50),
|
||||
TEST_HUNTRESS_4(51);
|
||||
|
||||
|
@ -78,6 +85,26 @@ public enum Talent {
|
|||
return Messages.get(this, name() + ".desc");
|
||||
}
|
||||
|
||||
public static void onTalentUpgraded( Hero hero, Talent talent){
|
||||
if (talent == ARMSMASTERS_INTUITION && hero.pointsInTalent(ARMSMASTERS_INTUITION) == 2){
|
||||
if (hero.belongings.weapon != null) hero.belongings.weapon.identify();
|
||||
if (hero.belongings.armor != null) hero.belongings.armor.identify();
|
||||
}
|
||||
if (talent == THIEFS_INTUITION && hero.pointsInTalent(THIEFS_INTUITION) == 2){
|
||||
if (hero.belongings.ring instanceof Ring) hero.belongings.ring.identify();
|
||||
if (hero.belongings.misc instanceof Ring) hero.belongings.misc.identify();
|
||||
for (Item item : Dungeon.hero.belongings){
|
||||
if (item instanceof Ring){
|
||||
((Ring) item).setKnown();
|
||||
}
|
||||
}
|
||||
}
|
||||
if (talent == THIEFS_INTUITION && hero.pointsInTalent(THIEFS_INTUITION) == 1){
|
||||
if (hero.belongings.ring instanceof Ring) hero.belongings.ring.setKnown();
|
||||
if (hero.belongings.misc instanceof Ring) ((Ring) hero.belongings.misc).setKnown();
|
||||
}
|
||||
}
|
||||
|
||||
public static void onFoodEaten( Hero hero, float foodVal ){
|
||||
if (hero.hasTalent(HEARTY_MEAL) && hero.HP <= hero.HT/2){
|
||||
//4/6 HP healed
|
||||
|
@ -104,6 +131,42 @@ public enum Talent {
|
|||
}
|
||||
}
|
||||
|
||||
public static float itemIDSpeedFactor( Hero hero, Item item ){
|
||||
// 1.5x/2x speed with huntress talent
|
||||
float factor = 1f + hero.pointsInTalent(SURVIVALISTS_INTUITION)/2f;
|
||||
|
||||
//otherwise 2x/3x speed (also ID instantly though)
|
||||
if (item instanceof MeleeWeapon || item instanceof Armor){
|
||||
factor *= 1f + hero.pointsInTalent(ARMSMASTERS_INTUITION);
|
||||
}
|
||||
if (item instanceof Wand){
|
||||
factor *= 1f + hero.pointsInTalent(SCHOLARS_INTUITION);
|
||||
}
|
||||
if (item instanceof Ring){
|
||||
factor *= 1f + hero.pointsInTalent(THIEFS_INTUITION);
|
||||
}
|
||||
return factor;
|
||||
}
|
||||
|
||||
public static void onItemEquipped( Hero hero, Item item ){
|
||||
if (hero.hasTalent(ARMSMASTERS_INTUITION) && (item instanceof Weapon || item instanceof Armor)){
|
||||
item.identify();
|
||||
}
|
||||
if (hero.hasTalent(THIEFS_INTUITION) && item instanceof Ring){
|
||||
if (hero.pointsInTalent(THIEFS_INTUITION) == 2){
|
||||
item.identify();
|
||||
} else {
|
||||
((Ring) item).setKnown();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static void onItemCollected( Hero hero, Item item ){
|
||||
if (hero.pointsInTalent(THIEFS_INTUITION) == 2){
|
||||
if (item instanceof Ring) ((Ring) item).setKnown();
|
||||
}
|
||||
}
|
||||
|
||||
private static final int TALENT_TIERS = 1;
|
||||
|
||||
public static void initClassTalents( Hero hero ){
|
||||
|
@ -116,16 +179,16 @@ public enum Talent {
|
|||
//tier 1
|
||||
switch (hero.heroClass){
|
||||
case WARRIOR: default:
|
||||
Collections.addAll(tierTalents, HEARTY_MEAL, TEST_WARRIOR_2, TEST_WARRIOR_3, TEST_WARRIOR_4);
|
||||
Collections.addAll(tierTalents, HEARTY_MEAL, ARMSMASTERS_INTUITION, TEST_WARRIOR_3, TEST_WARRIOR_4);
|
||||
break;
|
||||
case MAGE:
|
||||
Collections.addAll(tierTalents, ENERGIZING_MEAL, TEST_MAGE_2, TEST_MAGE_3, TEST_MAGE_4);
|
||||
Collections.addAll(tierTalents, ENERGIZING_MEAL, SCHOLARS_INTUITION, TEST_MAGE_3, TEST_MAGE_4);
|
||||
break;
|
||||
case ROGUE:
|
||||
Collections.addAll(tierTalents, RATIONED_MEAL, TEST_ROGUE_2, TEST_ROGUE_3, TEST_ROGUE_4);
|
||||
Collections.addAll(tierTalents, RATIONED_MEAL, THIEFS_INTUITION, TEST_ROGUE_3, TEST_ROGUE_4);
|
||||
break;
|
||||
case HUNTRESS:
|
||||
Collections.addAll(tierTalents, INVIGORATING_MEAL, TEST_HUNTRESS_2, TEST_HUNTRESS_3, TEST_HUNTRESS_4);
|
||||
Collections.addAll(tierTalents, INVIGORATING_MEAL, SURVIVALISTS_INTUITION, TEST_HUNTRESS_3, TEST_HUNTRESS_4);
|
||||
break;
|
||||
}
|
||||
for (Talent talent : tierTalents){
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.particles.ShadowParticle;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.utils.GLog;
|
||||
|
@ -59,6 +60,9 @@ public abstract class EquipableItem extends Item {
|
|||
//This is a special case as the item is being removed from inventory, but is staying with the hero.
|
||||
int slot = Dungeon.quickslot.getSlot( this );
|
||||
doEquip(hero);
|
||||
if (isEquipped(hero)){
|
||||
Talent.onItemEquipped(hero, this);
|
||||
}
|
||||
if (slot != -1) {
|
||||
Dungeon.quickslot.setSlot( slot, this );
|
||||
updateQuickslot();
|
||||
|
|
|
@ -28,6 +28,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.Actor;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Degrade;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.journal.Catalog;
|
||||
|
@ -105,6 +106,7 @@ public class Item implements Bundlable {
|
|||
|
||||
GameScene.pickUp( this, hero.pos );
|
||||
Sample.INSTANCE.play( Assets.Sounds.ITEM );
|
||||
Talent.onItemCollected( hero, this );
|
||||
hero.spendAndNext( TIME_TO_PICK_UP );
|
||||
return true;
|
||||
|
||||
|
|
|
@ -29,6 +29,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Momentum;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.EquipableItem;
|
||||
|
@ -106,7 +107,7 @@ public class Armor extends EquipableItem {
|
|||
public int tier;
|
||||
|
||||
private static final int USES_TO_ID = 10;
|
||||
private int usesLeftToID = USES_TO_ID;
|
||||
private float usesLeftToID = USES_TO_ID;
|
||||
private float availableUsesToID = USES_TO_ID/2f;
|
||||
|
||||
public Armor( int tier ) {
|
||||
|
@ -386,9 +387,10 @@ public class Armor extends EquipableItem {
|
|||
damage = glyph.proc( this, attacker, defender, damage );
|
||||
}
|
||||
|
||||
if (!levelKnown && defender == Dungeon.hero && availableUsesToID >= 1) {
|
||||
availableUsesToID--;
|
||||
usesLeftToID--;
|
||||
if (!levelKnown && defender == Dungeon.hero) {
|
||||
float uses = Math.min( availableUsesToID, Talent.itemIDSpeedFactor(Dungeon.hero, this) );
|
||||
availableUsesToID -= uses;
|
||||
usesLeftToID -= uses;
|
||||
if (usesLeftToID <= 0) {
|
||||
identify();
|
||||
GLog.p( Messages.get(Armor.class, "identify") );
|
||||
|
@ -401,6 +403,7 @@ public class Armor extends EquipableItem {
|
|||
|
||||
@Override
|
||||
public void onHeroGainExp(float levelPercent, Hero hero) {
|
||||
levelPercent *= Talent.itemIDSpeedFactor(hero, this);
|
||||
if (!levelKnown && isEquipped(hero) && availableUsesToID <= USES_TO_ID/2f) {
|
||||
//gains enough uses to ID over 0.5 levels
|
||||
availableUsesToID = Math.min(USES_TO_ID/2f, availableUsesToID + levelPercent * USES_TO_ID);
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Buff;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.ItemStatusHandler;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.KindofMisc;
|
||||
|
@ -288,6 +289,7 @@ public class Ring extends KindofMisc {
|
|||
|
||||
public void onHeroGainExp( float levelPercent, Hero hero ){
|
||||
if (isIdentified() || !isEquipped(hero)) return;
|
||||
levelPercent *= Talent.itemIDSpeedFactor(hero, this);
|
||||
//becomes IDed after 1 level
|
||||
levelsToID -= levelPercent;
|
||||
if (levelsToID <= 0){
|
||||
|
|
|
@ -35,6 +35,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SoulMark;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.HeroSubClass;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.effects.MagicMissile;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.bags.Bag;
|
||||
|
@ -72,7 +73,7 @@ public abstract class Wand extends Item {
|
|||
public boolean curseInfusionBonus = false;
|
||||
|
||||
private static final int USES_TO_ID = 10;
|
||||
private int usesLeftToID = USES_TO_ID;
|
||||
private float usesLeftToID = USES_TO_ID;
|
||||
private float availableUsesToID = USES_TO_ID/2f;
|
||||
|
||||
protected int collisionProperties = Ballistica.MAGIC_BOLT;
|
||||
|
@ -202,6 +203,7 @@ public abstract class Wand extends Item {
|
|||
}
|
||||
|
||||
public void onHeroGainExp( float levelPercent, Hero hero ){
|
||||
levelPercent *= Talent.itemIDSpeedFactor(hero, this);
|
||||
if (!isIdentified() && availableUsesToID <= USES_TO_ID/2f) {
|
||||
//gains enough uses to ID over 1 level
|
||||
availableUsesToID = Math.min(USES_TO_ID/2f, availableUsesToID + levelPercent * USES_TO_ID/2f);
|
||||
|
@ -319,10 +321,11 @@ public abstract class Wand extends Item {
|
|||
}
|
||||
|
||||
protected void wandUsed() {
|
||||
if (!isIdentified() && availableUsesToID >= 1) {
|
||||
availableUsesToID--;
|
||||
usesLeftToID--;
|
||||
if (usesLeftToID <= 0) {
|
||||
if (!isIdentified()) {
|
||||
float uses = Math.min( availableUsesToID, Talent.itemIDSpeedFactor(Dungeon.hero, this) );
|
||||
availableUsesToID -= uses;
|
||||
usesLeftToID -= uses;
|
||||
if (usesLeftToID <= 0 || Dungeon.hero.pointsInTalent(Talent.SCHOLARS_INTUITION) == 2) {
|
||||
identify();
|
||||
GLog.p( Messages.get(Wand.class, "identify") );
|
||||
Badges.validateItemLevelAquired( this );
|
||||
|
|
|
@ -26,6 +26,7 @@ import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
|
|||
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.KindOfWeapon;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.RingOfFuror;
|
||||
|
@ -92,7 +93,7 @@ abstract public class Weapon extends KindOfWeapon {
|
|||
public Augment augment = Augment.NONE;
|
||||
|
||||
private static final int USES_TO_ID = 20;
|
||||
private int usesLeftToID = USES_TO_ID;
|
||||
private float usesLeftToID = USES_TO_ID;
|
||||
private float availableUsesToID = USES_TO_ID/2f;
|
||||
|
||||
public Enchantment enchantment;
|
||||
|
@ -105,9 +106,10 @@ abstract public class Weapon extends KindOfWeapon {
|
|||
damage = enchantment.proc( this, attacker, defender, damage );
|
||||
}
|
||||
|
||||
if (!levelKnown && attacker == Dungeon.hero && availableUsesToID >= 1) {
|
||||
availableUsesToID--;
|
||||
usesLeftToID--;
|
||||
if (!levelKnown && attacker == Dungeon.hero) {
|
||||
float uses = Math.min( availableUsesToID, Talent.itemIDSpeedFactor(Dungeon.hero, this) );
|
||||
availableUsesToID -= uses;
|
||||
usesLeftToID -= uses;
|
||||
if (usesLeftToID <= 0) {
|
||||
identify();
|
||||
GLog.p( Messages.get(Weapon.class, "identify") );
|
||||
|
@ -119,6 +121,7 @@ abstract public class Weapon extends KindOfWeapon {
|
|||
}
|
||||
|
||||
public void onHeroGainExp( float levelPercent, Hero hero ){
|
||||
levelPercent *= Talent.itemIDSpeedFactor(hero, this);
|
||||
if (!levelKnown && isEquipped(hero) && availableUsesToID <= USES_TO_ID/2f) {
|
||||
//gains enough uses to ID over 0.5 levels
|
||||
availableUsesToID = Math.min(USES_TO_ID/2f, availableUsesToID + levelPercent * USES_TO_ID);
|
||||
|
@ -144,8 +147,8 @@ abstract public class Weapon extends KindOfWeapon {
|
|||
@Override
|
||||
public void restoreFromBundle( Bundle bundle ) {
|
||||
super.restoreFromBundle( bundle );
|
||||
usesLeftToID = bundle.getInt( USES_LEFT_TO_ID );
|
||||
availableUsesToID = bundle.getInt( AVAILABLE_USES );
|
||||
usesLeftToID = bundle.getFloat( USES_LEFT_TO_ID );
|
||||
availableUsesToID = bundle.getFloat( AVAILABLE_USES );
|
||||
enchantment = (Enchantment)bundle.get( ENCHANTMENT );
|
||||
curseInfusionBonus = bundle.getBoolean( CURSE_INFUSION_BONUS );
|
||||
|
||||
|
|
Loading…
Reference in New Issue
Block a user