v3.0.0: implemented the enlightening meal talent
This commit is contained in:
@@ -1011,8 +1011,8 @@ actors.hero.talent.searing_light.desc=_+1:_ Physical attacks on enemies illumina
|
||||
actors.hero.talent.shield_of_light.title=shield of light
|
||||
actors.hero.talent.shield_of_light.desc=_+1:_ The Cleric can cast _Shield of Light,_ a spell that is cast instantly and grants them 2-4 armor against a target for _3 turns_ at the cost of 1 charge.\n\n_+2:_ The Cleric can cast _Shield of Light,_ a spell that is cast instantly and them 2-4 armor against a target for _5 turns_ at the cost of 1 charge.
|
||||
|
||||
actors.hero.talent.clerict2a.title=Enlightening Meal
|
||||
actors.hero.talent.clerict2a.desc=TODO
|
||||
actors.hero.talent.enlightening_meal.title=Enlightening Meal
|
||||
actors.hero.talent.enlightening_meal.desc=_+1:_ Eating food takes the Cleric 1 turn and grants them _1 charge_ on their holy tome.\n\n_+2:_ Eating food takes the Cleric 1 turn and grants them _1.5 charges_ on their holy tome.
|
||||
actors.hero.talent.clerict2b.title=TODO
|
||||
actors.hero.talent.clerict2b.desc=TODO
|
||||
actors.hero.talent.clerict2c.title=TODO
|
||||
|
||||
@@ -54,6 +54,7 @@ import com.shatteredpixel.shatteredpixeldungeon.items.Item;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.Armor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.armor.ClothArmor;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.CloakOfShadows;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HolyTome;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.artifacts.HornOfPlenty;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.rings.Ring;
|
||||
import com.shatteredpixel.shatteredpixeldungeon.items.scrolls.ScrollOfRecharging;
|
||||
@@ -174,7 +175,7 @@ public enum Talent {
|
||||
//Cleric T1
|
||||
SATIATED_SPELLS(160), DETECT_CURSE(161), SEARING_LIGHT(162), SHIELD_OF_LIGHT(163),
|
||||
//Cleric T2
|
||||
CLERICT2A(164), CLERICT2B(165), CLERICT2C(166), CLERICT2D(167), CLERICT2E(168),
|
||||
ENLIGHTENING_MEAL(164), CLERICT2B(165), CLERICT2C(166), CLERICT2D(167), CLERICT2E(168),
|
||||
//Cleric T3
|
||||
CLERICT3A(169, 3), CLERICT3B(170, 3),
|
||||
|
||||
@@ -588,6 +589,13 @@ public enum Talent {
|
||||
if (hero.hasTalent(SATIATED_SPELLS)){
|
||||
Buff.affect( hero, SatiatedSpellsTracker.class );
|
||||
}
|
||||
if (hero.hasTalent(ENLIGHTENING_MEAL)){
|
||||
HolyTome tome = hero.belongings.getItem(HolyTome.class);
|
||||
if (tome != null) {
|
||||
tome.directCharge( 0.5f * (1+hero.pointsInTalent(ENLIGHTENING_MEAL)));
|
||||
ScrollOfRecharging.charge(hero);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public static class WarriorFoodImmunity extends FlavourBuff{
|
||||
@@ -907,7 +915,7 @@ public enum Talent {
|
||||
Collections.addAll(tierTalents, FOCUSED_MEAL, LIQUID_AGILITY, WEAPON_RECHARGING, LETHAL_HASTE, SWIFT_EQUIP);
|
||||
break;
|
||||
case CLERIC:
|
||||
Collections.addAll(tierTalents, CLERICT2A, CLERICT2B, CLERICT2C, CLERICT2D, CLERICT2E);
|
||||
Collections.addAll(tierTalents, ENLIGHTENING_MEAL, CLERICT2B, CLERICT2C, CLERICT2D, CLERICT2E);
|
||||
break;
|
||||
}
|
||||
for (Talent talent : tierTalents){
|
||||
|
||||
@@ -121,6 +121,22 @@ public class HolyTome extends Artifact {
|
||||
updateQuickslot();
|
||||
}
|
||||
|
||||
public void directCharge(float amount){
|
||||
if (charge < chargeCap) {
|
||||
partialCharge += amount;
|
||||
while (partialCharge >= 1f) {
|
||||
charge++;
|
||||
partialCharge--;
|
||||
}
|
||||
if (charge >= chargeCap){
|
||||
partialCharge = 0;
|
||||
charge = chargeCap;
|
||||
}
|
||||
updateQuickslot();
|
||||
}
|
||||
updateQuickslot();
|
||||
}
|
||||
|
||||
@Override
|
||||
public Item upgrade() {
|
||||
chargeCap = Math.min(chargeCap + 1, 10);
|
||||
@@ -132,6 +148,24 @@ public class HolyTome extends Artifact {
|
||||
return new TomeRecharge();
|
||||
}
|
||||
|
||||
@Override
|
||||
public void charge(Hero target, float amount) {
|
||||
if (cursed || target.buff(MagicImmune.class) != null) return;
|
||||
|
||||
if (charge < chargeCap) {
|
||||
partialCharge += 0.25f*amount;
|
||||
while (partialCharge >= 1f) {
|
||||
charge++;
|
||||
partialCharge--;
|
||||
}
|
||||
if (charge >= chargeCap){
|
||||
partialCharge = 0;
|
||||
charge = chargeCap;
|
||||
}
|
||||
updateQuickslot();
|
||||
}
|
||||
}
|
||||
|
||||
public class TomeRecharge extends ArtifactBuff {
|
||||
|
||||
public void gainCharge(float levelPortion) {
|
||||
|
||||
@@ -45,7 +45,8 @@ public class Berry extends Food {
|
||||
|| Dungeon.hero.hasTalent(Talent.ENERGIZING_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.MYSTICAL_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.INVIGORATING_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.FOCUSED_MEAL)){
|
||||
|| Dungeon.hero.hasTalent(Talent.FOCUSED_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.ENLIGHTENING_MEAL)){
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
|
||||
@@ -103,7 +103,8 @@ public class Food extends Item {
|
||||
|| Dungeon.hero.hasTalent(Talent.ENERGIZING_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.MYSTICAL_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.INVIGORATING_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.FOCUSED_MEAL)){
|
||||
|| Dungeon.hero.hasTalent(Talent.FOCUSED_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.ENLIGHTENING_MEAL)){
|
||||
return TIME_TO_EAT - 2;
|
||||
} else {
|
||||
return TIME_TO_EAT;
|
||||
|
||||
@@ -46,7 +46,8 @@ public class SupplyRation extends Food {
|
||||
|| Dungeon.hero.hasTalent(Talent.ENERGIZING_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.MYSTICAL_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.INVIGORATING_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.FOCUSED_MEAL)){
|
||||
|| Dungeon.hero.hasTalent(Talent.FOCUSED_MEAL)
|
||||
|| Dungeon.hero.hasTalent(Talent.ENLIGHTENING_MEAL)){
|
||||
return 0;
|
||||
} else {
|
||||
return 1;
|
||||
|
||||
Reference in New Issue
Block a user