v0.9.2: implemented the enraged catalyst talent

This commit is contained in:
Evan Debenham 2021-02-12 20:09:19 -05:00
parent 831e9fee20
commit eef60d6c7e
19 changed files with 61 additions and 30 deletions

View File

@ -340,6 +340,8 @@ actors.hero.talent.endless_rage.title=endless rage
actors.hero.talent.endless_rage.desc=_+1:_ The Berserker can reach a max of _115% rage_.\n\n_+2:_ The Berserker can reach a max of _130% rage_.\n\n_+3:_ The Berserker can reach a max of _145% rage_.\n\nNote that rage above 100% will not grant more than +50% damage.
actors.hero.talent.berserking_stamina.title=berserking stamina
actors.hero.talent.berserking_stamina.desc=_+1:_ The Berserker gains _17% more shield_ when berserking, and the berserking cooldown is reduced to _2.5 levels_ from 3.\n\n_+2:_ The Berserker gains _33% more shield_ when berserking, and the berserking cooldown is reduced to _2 levels_ from 3.\n\n_+3:_ The Berserker gains _50% more shield_ when berserking, and the berserking cooldown is reduced to _1.5 levels_ from 3.
actors.hero.talent.enraged_catalyst.title=enraged catalyst
actors.hero.talent.enraged_catalyst.desc=_+1:_ Enchantments and curses on the Berserker's weapon trigger more often the more rage he has, to a maximum of _20% more often_ at 100% rage.\n\n_+2:_ Enchantments and curses on the Berserker's weapon trigger more often the more rage he has, to a maximum of _40% more often_ at 100% rage.\n\n_+3:_ Enchantments and curses on the Berserker's weapon trigger more often the more rage he has, to a maximum of _60% more often_ at 100% rage.
actors.hero.talent.cleave.title=cleave
actors.hero.talent.cleave.desc=_+1:_ When the Gladiator kills an enemy, the combo cooldown for his next hit is increased to _10 turns_.\n\n_+2:_ When the Gladiator kills an enemy, the combo cooldown for his next hit is increased to _20 turns_.\n\n_+3:_ When the Gladiator kills an enemy, the combo cooldown for his next hit is increased to _30 turns_.
actors.hero.talent.lethal_defense.title=lethal defense

View File

@ -104,6 +104,10 @@ public class Berserk extends Buff {
return true;
}
public float rageAmount(){
return Math.min(1f, power);
}
public int damageFactor(int dmg){
float bonus = Math.min(1.5f, 1f + (power / 2f));
return Math.round(dmg * bonus);

View File

@ -73,7 +73,7 @@ public enum Talent {
//Warrior T3
STRONGMAN(9, 3), WARRIOR_T3_2(10, 3),
//Berserker T3
ENDLESS_RAGE(11, 3), BERSERKING_STAMINA(12, 3), BERSERKER_T3_3(13, 3),
ENDLESS_RAGE(11, 3), BERSERKING_STAMINA(12, 3), ENRAGED_CATALYST(13, 3),
//Gladiator T3
CLEAVE(14, 3), LETHAL_DEFENSE(15, 3), GLADIATOR_T3_3(16, 3),
@ -458,7 +458,7 @@ public enum Talent {
//tier 3
switch (cls){
case BERSERKER: default:
Collections.addAll(tierTalents, ENDLESS_RAGE, BERSERKING_STAMINA, BERSERKER_T3_3);
Collections.addAll(tierTalents, ENDLESS_RAGE, BERSERKING_STAMINA, ENRAGED_CATALYST);
break;
case GLADIATOR:
Collections.addAll(tierTalents, CLEAVE, LETHAL_DEFENSE, GLADIATOR_T3_3);

View File

@ -24,6 +24,7 @@ package com.shatteredpixel.shatteredpixeldungeon.items.weapon;
import com.shatteredpixel.shatteredpixeldungeon.Badges;
import com.shatteredpixel.shatteredpixeldungeon.Dungeon;
import com.shatteredpixel.shatteredpixeldungeon.actors.Char;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.Berserk;
import com.shatteredpixel.shatteredpixeldungeon.actors.buffs.MagicImmune;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Hero;
import com.shatteredpixel.shatteredpixeldungeon.actors.hero.Talent;
@ -346,6 +347,15 @@ abstract public class Weapon extends KindOfWeapon {
public abstract int proc( Weapon weapon, Char attacker, Char defender, int damage );
protected float procChanceMultiplier( Char attacker ){
float multi = 1f;
if (attacker instanceof Hero && ((Hero) attacker).hasTalent(Talent.ENRAGED_CATALYST)){
Berserk rage = attacker.buff(Berserk.class);
multi += 0.2f*rage.rageAmount()*((Hero) attacker).pointsInTalent(Talent.ENRAGED_CATALYST);
}
return multi;
}
public String name() {
if (!curse())
return name( Messages.get(this, "enchant"));

View File

@ -41,7 +41,8 @@ public class Annoying extends Weapon.Enchantment {
@Override
public int proc( Weapon weapon, Char attacker, Char defender, int damage ) {
if (Random.Int(20) == 0) {
float procChance = 1/20f * procChanceMultiplier(attacker);
if (Random.Float() < procChance) {
for (Mob mob : Dungeon.level.mobs.toArray(new Mob[0])) {
mob.beckon(attacker.pos);
}

View File

@ -37,7 +37,8 @@ public class Displacing extends Weapon.Enchantment {
@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage ) {
if (Random.Int(12) == 0 && !defender.properties().contains(Char.Property.IMMOVABLE)){
float procChance = 1/12f * procChanceMultiplier(attacker);
if (Random.Float() < procChance && !defender.properties().contains(Char.Property.IMMOVABLE)){
int count = 10;
int newPos;
do {

View File

@ -36,7 +36,8 @@ public class Exhausting extends Weapon.Enchantment {
@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage ) {
if (attacker == Dungeon.hero && Random.Int(15) == 0) {
float procChance = 1/15f * procChanceMultiplier(attacker);
if (attacker == Dungeon.hero && Random.Float() < procChance) {
Buff.affect(attacker, Weakness.class, Random.NormalIntRange(5, 20));
}

View File

@ -36,7 +36,8 @@ public class Friendly extends Weapon.Enchantment {
@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage ) {
if (Random.Int(10) == 0){
float procChance = 1/10f * procChanceMultiplier(attacker);
if (Random.Float() < procChance) {
Buff.affect( attacker, Charm.class, Charm.DURATION ).object = defender.id();
attacker.sprite.centerEmitter().start( Speck.factory( Speck.HEART ), 0.2f, 5 );

View File

@ -33,7 +33,8 @@ public class Polarized extends Weapon.Enchantment {
@Override
public int proc( Weapon weapon, Char attacker, Char defender, int damage ) {
if (Random.Int(2) == 0){
float procChance = 1/2f * procChanceMultiplier(attacker);
if (Random.Float() < procChance) {
return Math.round(1.5f*damage);
} else {
return 0;

View File

@ -35,7 +35,8 @@ public class Sacrificial extends Weapon.Enchantment {
@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage ) {
if (Random.Int(12) == 0){
float procChance = 1/12f * procChanceMultiplier(attacker);
if (Random.Float() < procChance) {
Buff.affect(attacker, Bleeding.class).set(Math.max(1, attacker.HP/6));
}

View File

@ -37,12 +37,13 @@ public class Blazing extends Weapon.Enchantment {
@Override
public int proc( Weapon weapon, Char attacker, Char defender, int damage ) {
int level = Math.max( 0, weapon.buffedLvl() );
// lvl 0 - 33%
// lvl 1 - 50%
// lvl 2 - 60%
int level = Math.max( 0, weapon.buffedLvl() );
if (Random.Int( level + 3 ) >= 2) {
float procChance = (level+1f)/(level+3f) * procChanceMultiplier(attacker);
if (Random.Float() < procChance) {
if (defender.buff(Burning.class) != null){
Buff.affect(defender, Burning.class).reignite(defender, 8f);

View File

@ -41,13 +41,13 @@ public class Blooming extends Weapon.Enchantment {
@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage) {
int level = Math.max( 0, weapon.buffedLvl() );
// lvl 0 - 33%
// lvl 1 - 50%
// lvl 2 - 60%
int level = Math.max( 0, weapon.buffedLvl() );
if (Random.Int( level + 3 ) >= 2) {
float procChance = (level+1f)/(level+3f) * procChanceMultiplier(attacker);
if (Random.Float() < procChance) {
boolean secondPlant = level > Random.Int(10);
if (plantGrass(defender.pos)){

View File

@ -36,12 +36,13 @@ public class Chilling extends Weapon.Enchantment {
@Override
public int proc( Weapon weapon, Char attacker, Char defender, int damage ) {
int level = Math.max( 0, weapon.buffedLvl() );
// lvl 0 - 25%
// lvl 1 - 40%
// lvl 2 - 50%
int level = Math.max( 0, weapon.buffedLvl() );
if (Random.Int( level + 4 ) >= 3) {
float procChance = (level+1f)/(level+4f) * procChanceMultiplier(attacker);
if (Random.Float() < procChance) {
//adds 3 turns of chill per proc, with a cap of 6 turns
float durationToAdd = 3f;

View File

@ -48,8 +48,9 @@ public class Corrupting extends Weapon.Enchantment {
// lvl 0 - 20%
// lvl 1 ~ 23%
// lvl 2 ~ 26%
float procChance = (level+5f)/(level+25f) * procChanceMultiplier(attacker);
if (damage >= defender.HP
&& Random.Int( level + 25 ) >= 20
&& Random.Float() < procChance
&& !defender.isImmune(Corruption.class)
&& defender.buff(Corruption.class) == null
&& defender instanceof Mob

View File

@ -36,12 +36,13 @@ public class Elastic extends Weapon.Enchantment {
@Override
public int proc(Weapon weapon, Char attacker, Char defender, int damage ) {
int level = Math.max( 0, weapon.buffedLvl() );
// lvl 0 - 20%
// lvl 1 - 33%
// lvl 2 - 43%
int level = Math.max( 0, weapon.buffedLvl() );
if (Random.Int( level + 5 ) >= 4) {
float procChance = (level+1f)/(level+5f) * procChanceMultiplier(attacker);
if (Random.Float() < procChance) {
//trace a ballistica to our target (which will also extend past them
Ballistica trajectory = new Ballistica(attacker.pos, defender.pos, Ballistica.STOP_TARGET);
//trim it to just be the part that goes past them

View File

@ -47,6 +47,8 @@ public class Grim extends Weapon.Enchantment {
float chanceMulti = (float)Math.pow( ((defender.HT - enemyHealth) / (float)defender.HT), 2);
float chance = maxChance * chanceMulti;
chance *= procChanceMultiplier(attacker);
if (Random.Float() < chance) {
defender.damage( defender.HP, this );

View File

@ -42,8 +42,8 @@ public class Lucky extends Weapon.Enchantment {
// lvl 0 - 10%
// lvl 1 ~ 12%
// lvl 2 ~ 14%
if (defender.HP <= damage
&& Random.Int( level + 40 ) >= 36){
float procChance = (level+4f)/(level+40f) * procChanceMultiplier(attacker);
if (defender.HP <= damage && Random.Float() < procChance){
Buff.affect(defender, LuckProc.class);
}

View File

@ -42,12 +42,13 @@ public class Shocking extends Weapon.Enchantment {
@Override
public int proc( Weapon weapon, Char attacker, Char defender, int damage ) {
int level = Math.max( 0, weapon.buffedLvl() );
// lvl 0 - 25%
// lvl 1 - 40%
// lvl 2 - 50%
int level = Math.max( 0, weapon.buffedLvl() );
if (Random.Int( level + 4 ) >= 3) {
float procChance = (level+1f)/(level+4f) * procChanceMultiplier(attacker);
if (Random.Float() < procChance) {
affected.clear();
arcs.clear();

View File

@ -40,6 +40,8 @@ public class Vampiric extends Weapon.Enchantment {
float missingPercent = (attacker.HT - attacker.HP) / (float)attacker.HT;
float healChance = 0.05f + .25f*missingPercent;
healChance *= procChanceMultiplier(attacker);
if (Random.Float() < healChance){
//heals for 50% of damage dealt