v0.9.3: implement base data types for armor abilities

This commit is contained in:
Evan Debenham 2021-04-05 22:37:57 -04:00
parent 661b76b9ae
commit 42b1bbc9a6
10 changed files with 258 additions and 123 deletions

View File

@ -331,6 +331,74 @@ actors.buffs.wellfed.desc=You feel quite satisfied and full.\n\nWhile well fed,
###hero
##abilities
actors.hero.abilities.warrior.warrior1.name=test1
actors.hero.abilities.warrior.warrior1.desc=test10
actors.hero.abilities.warrior.warrior2.name=test2
actors.hero.abilities.warrior.warrior2.desc=test20
actors.hero.abilities.warrior.warrior3.name=test3
actors.hero.abilities.warrior.warrior3.desc=test30
actors.hero.hero.name=you
actors.hero.hero.leave=You can't leave yet, the rest of the dungeon awaits below!
actors.hero.hero.level_up=Level up!
actors.hero.hero.new_level=Level up! +Accuracy, +Evasion, +5 HP!
actors.hero.hero.new_talent=+1 Talent Point!
actors.hero.hero.unspent=You have unspent talent points!
actors.hero.hero.level_cap=You cannot grow stronger, but your experiences do give you a surge of power!
actors.hero.hero.you_now_have=You picked up: %s.
actors.hero.hero.you_cant_have=You can't carry: %s.
actors.hero.hero.locked_chest=This chest is locked and you don't have a matching key.
actors.hero.hero.locked_door=You don't have a matching key.
actors.hero.hero.noticed_smth=You noticed something.
actors.hero.hero.wait=...
actors.hero.hero.search=search
actors.hero.hero.search_distracted=It's hard to concentrate, searching is exhausting.
actors.hero.hero.pain_resist=The pain helps you resist the urge to sleep.
actors.hero.hero.revive=The ankh explodes with life-giving energy!
actors.hero.heroclass.warrior=warrior
actors.hero.heroclass.warrior_desc_innate=The Warrior starts with a _unique broken seal,_ which he can affix to armor. He will slowly generate shielding over his health while he is wearing armor with the seal affixed.\n\nThe Warrior's seal can be moved between different armor sets, transferring a single upgrade with it.\n\nThe Warrior automatically identifies:\n- Scrolls of Identify\n- Potions of Healing\n- Scrolls of Rage
actors.hero.heroclass.warrior_desc_loadout=The Warrior starts with a _worn shortsword,_ which offers more direct damage than other starter weapons.\n\nThe Warrior starts with _three throwing stones,_ which offer limited ranged damage.\n\nThe Warrior starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Warrior starts with a _velvet pouch,_ which can store small items like seeds and runestones.
actors.hero.heroclass.warrior_desc_subclasses=A subclass can be chosen after defeating the second boss. The Warrior has two subclasses:
actors.hero.heroclass.mage=mage
actors.hero.heroclass.mage_unlock=The Mage is an expert with wands, and carries a _unique magical staff._\n\nTo unlock him _use a scroll of upgrade to make an item stronger._
actors.hero.heroclass.mage_desc_innate=The Mage starts with a _unique staff_ of magic missile. The staff recharges significantly faster than a wand, and has 1 more maximum charge.\n\nThe Mage's staff can be imbued with any wand he finds in the dungeon. Imbuing changes the staff's effect and can be used to transfer some upgrades.\n\nThe Mage automatically identifies:\n- Scrolls of Identify\n- Potions of Liquid Flame\n- Scrolls of Upgrade
actors.hero.heroclass.mage_desc_loadout=The Mage starts with his staff as his melee weapon. The staff deals less melee damage than other starter weapons.\n\nThe Mage can use the magic in his staff to attack at range.\n\nThe Mage starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Mage starts with a _velvet pouch,_ which can store small items like seeds and runestones.
actors.hero.heroclass.mage_desc_subclasses=A subclass can be chosen after defeating the second boss. The Mage has two subclasses:
actors.hero.heroclass.rogue=rogue
actors.hero.heroclass.rogue_unlock=The Rogue can control the flow of battle and strike from invisibility using his _unique cloak of shadows._\n\nTo unlock him _perform 10 surprise attacks in one run._
actors.hero.heroclass.rogue_desc_innate=The Rogue starts with a unique artifact: the _Cloak of Shadows,_ which he can use to become invisible at will. Like all artifacts, the cloak becomes more powerful as it is used.\n\nThe Rogue can detect secrets and traps from a greater distance.\n\nThe Rogue automatically identifies:\n- Scrolls of Identify\n- Potions of Invisibility\n- Scrolls of Magic Mapping
actors.hero.heroclass.rogue_desc_loadout=The Rogue starts with a _dagger,_ which deals more damage when surprising enemies.\n\nThe Rogue starts with _three throwing knives,_ which offer some ranged damage and deal more damage to surprised enemies.\n\nThe Rogue starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Rogue starts with a _velvet pouch,_ which can store small items like seeds and runestones.
actors.hero.heroclass.rogue_desc_subclasses=A subclass can be chosen after defeating the second boss. The Rogue has two subclasses:
actors.hero.heroclass.huntress=huntress
actors.hero.heroclass.huntress_unlock=The Huntress is a master of thrown weapons, and has a _unique magical bow_ with infinite arrows.\n\nTo unlock her _hit 15 different enemies with thrown weapons in one run._
actors.hero.heroclass.huntress_desc_innate=The Huntress starts with a _unique spirit bow,_ which can fire an infinite number of conjured arrows. The bow steadily grows stronger as the huntress levels up, and can be augmented and enchanted.\n\nThe Huntress can travel through tall grass without trampling it.\n\nThe Huntress automatically identifies:\n- Scrolls of Identify\n- Potions of Mind Vision\n- Scrolls of Lullaby
actors.hero.heroclass.huntress_desc_loadout=The Huntress starts with a pair of _studded gloves,_ which attack much faster than other starter weapons.\n\nThe Huntress starts with her bow as a ranged option.\n\nThe Huntress starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Huntress starts with a _velvet pouch,_ which can store small items like seeds and runestones.
actors.hero.heroclass.huntress_desc_subclasses=A subclass can be chosen after defeating the second boss. The Huntress has two subclasses:
actors.hero.herosubclass.gladiator=gladiator
actors.hero.herosubclass.gladiator_desc=A successful attack with a melee weapon allows the _Gladiator_ to start a combo. Building combo allows him to use unique combo moves.
actors.hero.herosubclass.berserker=berserker
actors.hero.herosubclass.berserker_desc=The _Berserker_ builds rage as he takes damage, which increases his damage. When at full rage, he can refuse to die for a short time, at the cost of exhaustion.
actors.hero.herosubclass.warlock=warlock
actors.hero.herosubclass.warlock_desc=When using wands on an enemy, the _Warlock_ has a chance to mark their soul. Marked enemies will heal him whenever he attacks them with physical damage.
actors.hero.herosubclass.battlemage=battlemage
actors.hero.herosubclass.battlemage_desc=When fighting with his staff, the _Battlemage_ conjures bonus effects depending on the wand his staff is imbued with. His staff will also gain charge through combat.
actors.hero.herosubclass.assassin=assassin
actors.hero.herosubclass.assassin_desc=While invisible the _Assassin_ prepares a deadly strike on his next attack. The longer spent invisible, the more powerful the attack will be.
actors.hero.herosubclass.freerunner=freerunner
actors.hero.herosubclass.freerunner_desc=The _Freerunner_ builds momentum as he runs. Momentum can be used to start freerunning, which grants him 2x movespeed and bonus evasion for a short while.
actors.hero.herosubclass.sniper=sniper
actors.hero.herosubclass.sniper_desc=The _Sniper_ is a master of ranged combat. Her ranged attacks pierce armor, and after striking with a thrown weapon she can follow up with a special attack from her bow.
actors.hero.herosubclass.warden=warden
actors.hero.herosubclass.warden_desc=The _Warden_ has a strong connection to nature which allows her to see through tall grass and command furrowed grass to sprout around plants she grows. Plants she tramples will also give bonus effects.
##talents
actors.hero.talent.hearty_meal.title=hearty meal
actors.hero.talent.hearty_meal.desc=_+1:_ Eating heals the Warrior for _2 HP_ when he is below 50% health, and _3 HP_ when he is below 25% health.\n\n_+2:_ Eating heals the Warrior for _3 HP_ when he is below 50% health, and _5 HP_ when he is below 25% health.
actors.hero.talent.armsmasters_intuition.title=armsmaster's intuition
@ -469,65 +537,7 @@ actors.hero.talent.durable_tips.desc=_+1:_ Tipped darts have _2x durability_ whe
actors.hero.talent.barkskin.title=barkskin
actors.hero.talent.barkskin.desc=_+1:_ When stepping in grass, the Warden gains barkskin equivalent to her level which fades every _1 turn_.\n\n_+2:_ When stepping in grass, the Warden gains barkskin equivalent to her level which fades every _2 turns_.\n\n_+3:_ When stepping in grass, the Warden gains barkskin equivalent to her level which fades every _3 turns_.
actors.hero.talent.shielding_dew.title=shielding dew
actors.hero.talent.shielding_dew.desc=_+1:_ Dewdrops can shield the Warden when her health is full, up to _20% of her max HP_.\n\n_+2:_ Dewdrops can shield the Warden when her health is full, up to _40% of her max HP_.\n\n_+3:_ Dewdrops can shield the Warden when her health is full, up to _60% of her max HP_.
actors.hero.hero.name=you
actors.hero.hero.leave=You can't leave yet, the rest of the dungeon awaits below!
actors.hero.hero.level_up=Level up!
actors.hero.hero.new_level=Level up! +Accuracy, +Evasion, +5 HP!
actors.hero.hero.new_talent=+1 Talent Point!
actors.hero.hero.unspent=You have unspent talent points!
actors.hero.hero.level_cap=You cannot grow stronger, but your experiences do give you a surge of power!
actors.hero.hero.you_now_have=You picked up: %s.
actors.hero.hero.you_cant_have=You can't carry: %s.
actors.hero.hero.locked_chest=This chest is locked and you don't have a matching key.
actors.hero.hero.locked_door=You don't have a matching key.
actors.hero.hero.noticed_smth=You noticed something.
actors.hero.hero.wait=...
actors.hero.hero.search=search
actors.hero.hero.search_distracted=It's hard to concentrate, searching is exhausting.
actors.hero.hero.pain_resist=The pain helps you resist the urge to sleep.
actors.hero.hero.revive=The ankh explodes with life-giving energy!
actors.hero.heroclass.warrior=warrior
actors.hero.heroclass.warrior_desc_innate=The Warrior starts with a _unique broken seal,_ which he can affix to armor. He will slowly generate shielding over his health while he is wearing armor with the seal affixed.\n\nThe Warrior's seal can be moved between different armor sets, transferring a single upgrade with it.\n\nThe Warrior automatically identifies:\n- Scrolls of Identify\n- Potions of Healing\n- Scrolls of Rage
actors.hero.heroclass.warrior_desc_loadout=The Warrior starts with a _worn shortsword,_ which offers more direct damage than other starter weapons.\n\nThe Warrior starts with _three throwing stones,_ which offer limited ranged damage.\n\nThe Warrior starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Warrior starts with a _velvet pouch,_ which can store small items like seeds and runestones.
actors.hero.heroclass.warrior_desc_subclasses=A subclass can be chosen after defeating the second boss. The Warrior has two subclasses:
actors.hero.heroclass.mage=mage
actors.hero.heroclass.mage_unlock=The Mage is an expert with wands, and carries a _unique magical staff._\n\nTo unlock him _use a scroll of upgrade to make an item stronger._
actors.hero.heroclass.mage_desc_innate=The Mage starts with a _unique staff_ of magic missile. The staff recharges significantly faster than a wand, and has 1 more maximum charge.\n\nThe Mage's staff can be imbued with any wand he finds in the dungeon. Imbuing changes the staff's effect and can be used to transfer some upgrades.\n\nThe Mage automatically identifies:\n- Scrolls of Identify\n- Potions of Liquid Flame\n- Scrolls of Upgrade
actors.hero.heroclass.mage_desc_loadout=The Mage starts with his staff as his melee weapon. The staff deals less melee damage than other starter weapons.\n\nThe Mage can use the magic in his staff to attack at range.\n\nThe Mage starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Mage starts with a _velvet pouch,_ which can store small items like seeds and runestones.
actors.hero.heroclass.mage_desc_subclasses=A subclass can be chosen after defeating the second boss. The Mage has two subclasses:
actors.hero.heroclass.rogue=rogue
actors.hero.heroclass.rogue_unlock=The Rogue can control the flow of battle and strike from invisibility using his _unique cloak of shadows._\n\nTo unlock him _perform 10 surprise attacks in one run._
actors.hero.heroclass.rogue_desc_innate=The Rogue starts with a unique artifact: the _Cloak of Shadows,_ which he can use to become invisible at will. Like all artifacts, the cloak becomes more powerful as it is used.\n\nThe Rogue can detect secrets and traps from a greater distance.\n\nThe Rogue automatically identifies:\n- Scrolls of Identify\n- Potions of Invisibility\n- Scrolls of Magic Mapping
actors.hero.heroclass.rogue_desc_loadout=The Rogue starts with a _dagger,_ which deals more damage when surprising enemies.\n\nThe Rogue starts with _three throwing knives,_ which offer some ranged damage and deal more damage to surprised enemies.\n\nThe Rogue starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Rogue starts with a _velvet pouch,_ which can store small items like seeds and runestones.
actors.hero.heroclass.rogue_desc_subclasses=A subclass can be chosen after defeating the second boss. The Rogue has two subclasses:
actors.hero.heroclass.huntress=huntress
actors.hero.heroclass.huntress_unlock=The Huntress is a master of thrown weapons, and has a _unique magical bow_ with infinite arrows.\n\nTo unlock her _hit 15 different enemies with thrown weapons in one run._
actors.hero.heroclass.huntress_desc_innate=The Huntress starts with a _unique spirit bow,_ which can fire an infinite number of conjured arrows. The bow steadily grows stronger as the huntress levels up, and can be augmented and enchanted.\n\nThe Huntress can travel through tall grass without trampling it.\n\nThe Huntress automatically identifies:\n- Scrolls of Identify\n- Potions of Mind Vision\n- Scrolls of Lullaby
actors.hero.heroclass.huntress_desc_loadout=The Huntress starts with a pair of _studded gloves,_ which attack much faster than other starter weapons.\n\nThe Huntress starts with her bow as a ranged option.\n\nThe Huntress starts with a _waterskin_, which can store healing water found in the dungeon\n\nThe Huntress starts with a _velvet pouch,_ which can store small items like seeds and runestones.
actors.hero.heroclass.huntress_desc_subclasses=A subclass can be chosen after defeating the second boss. The Huntress has two subclasses:
actors.hero.herosubclass.gladiator=gladiator
actors.hero.herosubclass.gladiator_desc=A successful attack with a melee weapon allows the _Gladiator_ to start a combo. Building combo allows him to use unique combo moves.
actors.hero.herosubclass.berserker=berserker
actors.hero.herosubclass.berserker_desc=The _Berserker_ builds rage as he takes damage, which increases his damage. When at full rage, he can refuse to die for a short time, at the cost of exhaustion.
actors.hero.herosubclass.warlock=warlock
actors.hero.herosubclass.warlock_desc=When using wands on an enemy, the _Warlock_ has a chance to mark their soul. Marked enemies will heal him whenever he attacks them with physical damage.
actors.hero.herosubclass.battlemage=battlemage
actors.hero.herosubclass.battlemage_desc=When fighting with his staff, the _Battlemage_ conjures bonus effects depending on the wand his staff is imbued with. His staff will also gain charge through combat.
actors.hero.herosubclass.assassin=assassin
actors.hero.herosubclass.assassin_desc=While invisible the _Assassin_ prepares a deadly strike on his next attack. The longer spent invisible, the more powerful the attack will be.
actors.hero.herosubclass.freerunner=freerunner
actors.hero.herosubclass.freerunner_desc=The _Freerunner_ builds momentum as he runs. Momentum can be used to start freerunning, which grants him 2x movespeed and bonus evasion for a short while.
actors.hero.herosubclass.sniper=sniper
actors.hero.herosubclass.sniper_desc=The _Sniper_ is a master of ranged combat. Her ranged attacks pierce armor, and after striking with a thrown weapon she can follow up with a special attack from her bow.
actors.hero.herosubclass.warden=warden
actors.hero.herosubclass.warden_desc=The _Warden_ has a strong connection to nature which allows her to see through tall grass and command furrowed grass to sprout around plants she grows. Plants she tramples will also give bonus effects.
actors.hero.talent.shielding_dew.desc=_+1:_ Dewdrops can shield the Warden when her health is full, up to _20% of her max HP_.\n\n_+2:_ Dewdrops can shield the Warden when her health is full, up to _40% of her max HP_.\n\n_+3:_ Dewdrops can shield the Warden when her health is full, up to _60% of her max HP_.actors.hero.talent.hearty_meal.title=hearty meal

View File

@ -252,6 +252,7 @@ public enum Rankings {
private static final String CAUSE = "cause";
private static final String WIN = "win";
private static final String SCORE = "score";
private static final String CLASS = "class";
private static final String TIER = "tier";
private static final String LEVEL = "level";
private static final String DEPTH = "depth";
@ -296,7 +297,7 @@ public enum Rankings {
win = bundle.getBoolean( WIN );
score = bundle.getInt( SCORE );
heroClass = HeroClass.restoreInBundle( bundle );
heroClass = bundle.getEnum( CLASS, HeroClass.class );
armorTier = bundle.getInt( TIER );
if (bundle.contains(DATA)) gameData = bundle.getBundle(DATA);
@ -317,7 +318,7 @@ public enum Rankings {
bundle.put( WIN, win );
bundle.put( SCORE, score );
heroClass.storeInBundle( bundle );
bundle.put( CLASS, heroClass );
bundle.put( TIER, armorTier );
bundle.put( LEVEL, herolevel );
bundle.put( DEPTH, depth );

View File

@ -52,6 +52,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Paralysis;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Regeneration;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.SnipersMark;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Vertigo;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Monk;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
@ -154,6 +155,7 @@ public class Hero extends Char {
public HeroClass heroClass = HeroClass.ROGUE;
public HeroSubClass subClass = HeroSubClass.NONE;
public ArmorAbility armorAbility = null;
public ArrayList<LinkedHashMap<Talent, Integer>> talents = new ArrayList<>();
private int attackSkill = 10;
@ -226,6 +228,10 @@ public class Hero extends Char {
return STR;
}
private static final String CLASS = "class";
private static final String SUBCLASS = "subClass";
private static final String ABILITY = "armorAbility";
private static final String ATTACK = "attackSkill";
private static final String DEFENSE = "defenseSkill";
private static final String STRENGTH = "STR";
@ -238,8 +244,9 @@ public class Hero extends Char {
super.storeInBundle( bundle );
heroClass.storeInBundle( bundle );
subClass.storeInBundle( bundle );
bundle.put( CLASS, heroClass );
bundle.put( SUBCLASS, subClass );
bundle.put( ABILITY, armorAbility );
Talent.storeTalentsInBundle( bundle, this );
bundle.put( ATTACK, attackSkill );
@ -265,8 +272,9 @@ public class Hero extends Char {
super.restoreFromBundle( bundle );
heroClass = HeroClass.restoreInBundle( bundle );
subClass = HeroSubClass.restoreInBundle( bundle );
heroClass = bundle.getEnum( CLASS, HeroClass.class );
subClass = bundle.getEnum( SUBCLASS, HeroSubClass.class );
armorAbility = (ArmorAbility)bundle.get( ABILITY );
Talent.restoreTalentsFromBundle( bundle, this );
attackSkill = bundle.getInt( ATTACK );
@ -284,8 +292,8 @@ public class Hero extends Char {
info.hp = bundle.getInt( Char.TAG_HP );
info.ht = bundle.getInt( Char.TAG_HT );
info.shld = bundle.getInt( Char.TAG_SHLD );
info.heroClass = HeroClass.restoreInBundle( bundle );
info.subClass = HeroSubClass.restoreInBundle( bundle );
info.heroClass = bundle.getEnum( CLASS, HeroClass.class );
info.subClass = bundle.getEnum( SUBCLASS, HeroSubClass.class );
Belongings.preview( info, bundle );
}

View File

@ -26,6 +26,10 @@ import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Challenges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.QuickSlot;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.Warrior1;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.Warrior2;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior.Warrior3;
import com.shatteredpixel.shatteredpixeldungeon.items.BrokenSeal;
import com.shatteredpixel.shatteredpixeldungeon.items.Item;
import com.shatteredpixel.shatteredpixeldungeon.items.Waterskin;
@ -51,21 +55,18 @@ import com.shatteredpixel.shatteredpixeldungeon.items.weapon.melee.WornShortswor
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingKnife;
import com.shatteredpixel.shatteredpixeldungeon.items.weapon.missiles.ThrowingStone;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.utils.Bundle;
import com.watabou.utils.DeviceCompat;
public enum HeroClass {
WARRIOR( "warrior", HeroSubClass.BERSERKER, HeroSubClass.GLADIATOR ),
MAGE( "mage", HeroSubClass.BATTLEMAGE, HeroSubClass.WARLOCK ),
ROGUE( "rogue", HeroSubClass.ASSASSIN, HeroSubClass.FREERUNNER ),
HUNTRESS( "huntress", HeroSubClass.SNIPER, HeroSubClass.WARDEN );
WARRIOR( HeroSubClass.BERSERKER, HeroSubClass.GLADIATOR ),
MAGE( HeroSubClass.BATTLEMAGE, HeroSubClass.WARLOCK ),
ROGUE( HeroSubClass.ASSASSIN, HeroSubClass.FREERUNNER ),
HUNTRESS( HeroSubClass.SNIPER, HeroSubClass.WARDEN );
private String title;
private HeroSubClass[] subClasses;
HeroClass( String title, HeroSubClass...subClasses ) {
this.title = title;
HeroClass( HeroSubClass...subClasses ) {
this.subClasses = subClasses;
}
@ -187,13 +188,17 @@ public enum HeroClass {
}
public String title() {
return Messages.get(HeroClass.class, title);
return Messages.get(HeroClass.class, name());
}
public HeroSubClass[] subClasses() {
return subClasses;
}
public ArmorAbility[] armorAbilities(){
return new ArmorAbility[]{new Warrior1(), new Warrior2(), new Warrior3()};
}
public String spritesheet() {
switch (this) {
case WARRIOR: default:
@ -286,14 +291,4 @@ public enum HeroClass {
}
}
private static final String CLASS = "class";
public void storeInBundle( Bundle bundle ) {
bundle.put( CLASS, toString() );
}
public static HeroClass restoreInBundle( Bundle bundle ) {
String value = bundle.getString( CLASS );
return value.length() > 0 ? valueOf( value ) : ROGUE;
}
}

View File

@ -22,47 +22,29 @@
package com.shatteredpixel.shatteredpixeldungeon.actors.hero;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.utils.Bundle;
public enum HeroSubClass {
NONE( null ),
NONE,
GLADIATOR( "gladiator" ),
BERSERKER( "berserker" ),
GLADIATOR,
BERSERKER,
WARLOCK( "warlock" ),
BATTLEMAGE( "battlemage" ),
WARLOCK,
BATTLEMAGE,
ASSASSIN( "assassin" ),
FREERUNNER( "freerunner" ),
ASSASSIN,
FREERUNNER,
SNIPER( "sniper" ),
WARDEN( "warden" );
private String title;
HeroSubClass( String title ) {
this.title = title;
}
SNIPER,
WARDEN;
public String title() {
return Messages.get(this, title);
return Messages.get(this, name());
}
public String desc() {
return Messages.get(this, title+"_desc");
}
private static final String SUBCLASS = "subClass";
public void storeInBundle( Bundle bundle ) {
bundle.put( SUBCLASS, toString() );
}
public static HeroSubClass restoreInBundle( Bundle bundle ) {
String value = bundle.getString( SUBCLASS );
return valueOf( value );
return Messages.get(this, name()+"_desc");
}
}

View File

@ -34,6 +34,7 @@ import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Haste;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Recharging;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Roots;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.WandEmpower;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
import com.shatteredpixel.shatteredpixeldungeon.actors.mobs.Mob;
import com.shatteredpixel.shatteredpixeldungeon.effects.CellEmitter;
import com.shatteredpixel.shatteredpixeldungeon.effects.Speck;
@ -495,8 +496,16 @@ public enum Talent {
}
tierTalents.clear();
//tier4
//TBD
}
public static void initArmorTalents( Hero hero ){
initArmorTalents( hero.armorAbility, hero.talents);
}
public static void initArmorTalents(ArmorAbility abil, ArrayList<LinkedHashMap<Talent, Integer>> talents ){
if (abil == null) return;
//TODO
}
private static final String TALENT_TIER = "talents_tier_";
@ -519,8 +528,9 @@ public enum Talent {
}
public static void restoreTalentsFromBundle( Bundle bundle, Hero hero ){
if (hero.heroClass != null) initClassTalents(hero);
if (hero.subClass != null) initSubclassTalents(hero);
if (hero.heroClass != null) initClassTalents(hero);
if (hero.subClass != null) initSubclassTalents(hero);
if (hero.armorAbility != null) initArmorTalents(hero);
for (int i = 0; i < MAX_TALENT_TIERS; i++){
LinkedHashMap<Talent, Integer> tier = hero.talents.get(i);

View File

@ -0,0 +1,47 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2021 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities;
import com.shatteredpixel.shatteredpixeldungeon.messages.Messages;
import com.watabou.utils.Bundlable;
import com.watabou.utils.Bundle;
public abstract class ArmorAbility implements Bundlable {
//TODO code for actual effects
public String name(){
return Messages.get(this, "name");
}
public String desc(){
return Messages.get(this, "desc");
}
@Override
public void storeInBundle(Bundle bundle) {
}
@Override
public void restoreFromBundle(Bundle bundle) {
}
}

View File

@ -0,0 +1,28 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2021 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
public class Warrior1 extends ArmorAbility {
}

View File

@ -0,0 +1,27 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2021 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
public class Warrior2 extends ArmorAbility {
}

View File

@ -0,0 +1,27 @@
/*
* Pixel Dungeon
* Copyright (C) 2012-2015 Oleg Dolya
*
* Shattered Pixel Dungeon
* Copyright (C) 2014-2021 Evan Debenham
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* the Free Software Foundation, either version 3 of the License, or
* (at your option) any later version.
*
* This program is distributed in the hope that it will be useful,
* but WITHOUT ANY WARRANTY; without even the implied warranty of
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
* GNU General Public License for more details.
*
* You should have received a copy of the GNU General Public License
* along with this program. If not, see <http://www.gnu.org/licenses/>
*/
package com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.warrior;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.abilities.ArmorAbility;
public class Warrior3 extends ArmorAbility {
}